[
  {
    "path": ".devcontainer/Dockerfile",
    "content": "# Use QuantConnect Research as the base\nFROM quantconnect/research:latest\n\n# Install dos2unix utility for converting pesky windows formatting when needed\nRUN apt-get update && apt-get install -y dos2unix\n\n# Install QuantConnect Stubs for Python Autocomplete\nRUN pip install --no-cache-dir quantconnect-stubs"
  },
  {
    "path": ".devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Lean Development Container\",\n\t\"workspaceMount\": \"source=${localWorkspaceFolder},target=/Lean,type=bind\",\n\t\"workspaceFolder\": \"/Lean\",\n\t// Use devcontainer Dockerfile that is based on Lean foundation image\n\t\"build\": {\n\t\t\"dockerfile\": \"Dockerfile\"\n\t},\n\t//See https://containers.dev/implementors/json_reference/ for a comprehensive json schema used to define this file.\n\t\"customizations\": {\n\t\t\"vscode\": {\n\t\t\t// Add the IDs of extensions you want installed when the container is created.\n\t\t\t\"extensions\": [\n\t\t\t\t\"ms-dotnettools.csdevkit\",\n\t\t\t\t\"ms-python.python\",\n\t\t\t\t\"eamodio.gitlens\",\n\t\t\t\t\"yzhang.markdown-all-in-one\",\n\t\t\t\t\"SonarSource.sonarlint-vscode\"\n\t\t\t],\n\t\t\t// Set *default* vscode specific settings.json values on container create.\n\t\t\t\"settings\": {\n\t\t\t\t\"terminal.integrated.profiles.linux\": {\n\t\t\t\t\t\"bash\": {\n\t\t\t\t\t\t\"path\": \"bash\",\n\t\t\t\t\t\t\"icon\": \"terminal-bash\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t//use the same network configuration as the host machine, ensuring no problems with firewalls, proxies etc.\n\t\"runArgs\": [\n\t\t\"--network=host\"\n\t],\n\t// Use 'forwardPorts' to make a list of ports inside the container available locally.\n\t// \"forwardPorts\": [],\n\t// Uncomment the next line to run commands after the container is created - for example installing curl.\n\t\"postCreateCommand\": \"dotnet nuget add source /Lean/LocalPackages;chmod u+x /Lean/.vscode/launch_research.sh;dos2unix /Lean/.vscode/launch_research.sh\",\n\t// Add mounts to docker container\n\t\"mounts\": [\n\t\t// Example data mount from local machine, must use target directory in Config.json\n\t\t// \"source=C:/Users/XXXXXXXXXXXX/Lean/Data,target=/Data,type=bind,consistency=cached\" \n\t]\n}"
  },
  {
    "path": ".dockerignore",
    "content": "packages/*\n.git/*\n.github/*\n.vs/*\n.nuget/*\nTests/*"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_size = 4\nindent_style = space\ninsert_final_newline = true\n\n[*.{js,yml,json,config,csproj}]\nindent_size = 2\n\n[*.sh]\nend_of_line = lf"
  },
  {
    "path": ".gitattributes",
    "content": "###############################################################################\n# Set default behavior to automatically normalize line endings.\n###############################################################################\n* text=auto\n\n###############################################################################\n# Set default behavior for command prompt diff.\n#\n# This is need for earlier builds of msysgit that does not have it on by\n# default for csharp files.\n# Note: This is only used by command line\n###############################################################################\n#*.cs     diff=csharp\n\n###############################################################################\n# Set the merge driver for project and solution files\n#\n# Merging from the command prompt will add diff markers to the files if there\n# are conflicts (Merging from VS is not affected by the settings below, in VS\n# the diff markers are never inserted). Diff markers may cause the following \n# file extensions to fail to load in VS. An alternative would be to treat\n# these files as binary and thus will always conflict and require user\n# intervention with every merge. To do so, just uncomment the entries below\n###############################################################################\n#*.sln       merge=binary\n#*.csproj    merge=binary\n#*.vbproj    merge=binary\n#*.vcxproj   merge=binary\n#*.vcproj    merge=binary\n#*.dbproj    merge=binary\n#*.fsproj    merge=binary\n#*.lsproj    merge=binary\n#*.wixproj   merge=binary\n#*.modelproj merge=binary\n#*.sqlproj   merge=binary\n#*.wwaproj   merge=binary\n\n###############################################################################\n# behavior for image files\n#\n# image files are treated as binary by default.\n###############################################################################\n#*.jpg   binary\n#*.png   binary\n#*.gif   binary\n\n###############################################################################\n# diff behavior for common document formats\n# \n# Convert binary document formats to text before diffing them. This feature\n# is only available from the command line. Turn it on by uncommenting the \n# entries below.\n###############################################################################\n#*.doc   diff=astextplain\n#*.DOC   diff=astextplain\n#*.docx  diff=astextplain\n#*.DOCX  diff=astextplain\n#*.dot   diff=astextplain\n#*.DOT   diff=astextplain\n#*.pdf   diff=astextplain\n#*.PDF   diff=astextplain\n#*.rtf   diff=astextplain\n#*.RTF   diff=astextplain\n\n#these files are used in linux, so use just LF\n*.sh lf"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n#### Expected Behavior\n<!--- Required. Describe the behavior you expect to see for your case. -->\n\n#### Actual Behavior\n<!--- Required. Describe the actual behavior for your case. -->\n\n#### Potential Solution\n<!--- Optional. Describe any potential solutions and/or thoughts as to what may be causing the difference between expected and actual behavior. -->\n\n#### Reproducing the Problem\n<!--- Required for Bugs. Describe how to reproduce the problem. This can be via a failing unit test or a simplified algorithm that reliably demonstrates this issue.  -->\n\n#### System Information\n<!--- Required for Bugs. Include any system specific information, such as OS. -->\n\n#### Checklist\n<!--- Confirm that you've provided all the required information. -->\n<!--- Required fields --->\n- [ ] I have completely filled out this template\n- [ ] I have confirmed that this issue exists on the current `master` branch\n- [ ] I have confirmed that this is not a duplicate issue by searching [issues](https://github.com/QuantConnect/Lean/issues)\n<!--- Required for Bugs, feature request can delete the line below. -->\n- [ ] I have provided detailed steps to reproduce the issue\n\n<!--- Template inspired by https://github.com/stevemao/github-issue-templates -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n#### Expected Behavior\n<!--- Required. Describe the behavior you expect to see for your case. -->\n\n#### Actual Behavior\n<!--- Required. Describe the actual behavior for your case. -->\n\n#### Potential Solution\n<!--- Optional. Describe any potential solutions and/or thoughts as to what may be causing the difference between expected and actual behavior. -->\n\n#### Checklist\n<!--- Confirm that you've provided all the required information. -->\n<!--- Required fields --->\n- [ ] I have completely filled out this template\n- [ ] I have confirmed that this issue exists on the current `master` branch\n- [ ] I have confirmed that this is not a duplicate issue by searching [issues](https://github.com/QuantConnect/Lean/issues)\n\n<!--- Template inspired by https://github.com/stevemao/github-issue-templates -->\n"
  },
  {
    "path": ".github/funding.yml",
    "content": "# These are supported funding model platforms\n\ngithub: quantconnect\n#custom: ['https://github.com/sponsors/QuantConnect']\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "\n<!--- Provide a general summary of your changes in the Title above -->\n\n#### Description\n<!--- Describe your changes in detail -->\n\n#### Related Issue\n<!--- This project only accepts pull requests related to open issues -->\n<!--- If suggesting a new feature or change, please discuss it in an issue first -->\n<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->\n<!--- Please link to the issue here: -->\n\n#### Motivation and Context\n<!--- Why is this change required? What problem does it solve? -->\n\n#### Requires Documentation Change\n<!--- Please indicate if these changes will require updates to documentation, and if so, specify what changes are required -->\n\n#### How Has This Been Tested?\n<!--- Please describe in detail how you tested your changes. -->\n<!--- Include details of your testing environment, and the tests you ran to -->\n<!--- see how your change affects other areas of the code, etc. -->\n\n#### Types of changes\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\n- [ ] Bug fix (non-breaking change which fixes an issue)\n- [ ] Refactor (non-breaking change which improves implementation)\n- [ ] Performance (non-breaking change which improves performance. Please add associated performance test and results)\n- [ ] New feature (non-breaking change which adds functionality)\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\n- [ ] Non-functional change (xml comments/documentation/etc)\n\n#### Checklist:\n<!--- The following is a checklist of items that MUST be completed before a PR is accepted -->\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\n- [ ] My code follows the code style of this project.\n- [ ] I have read the **CONTRIBUTING** [document](https://github.com/QuantConnect/Lean/blob/master/CONTRIBUTING.md).\n- [ ] I have added tests to cover my changes. <!--- If not applicable, please explain why -->\n- [ ] All new and existing tests passed.\n- [ ] My branch follows the naming convention `bug-<issue#>-<description>` or `feature-<issue#>-<description>`\n\n<!--- Template inspired by https://www.talater.com/open-source-templates/#/page/99 -->\n"
  },
  {
    "path": ".github/workflows/api-tests.yml",
    "content": "name: API Tests\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    # Only run on push events (not on pull_request) for security reasons in order to be able to use secrets\n    if: ${{ github.event_name == 'push' }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            -e GITHUB_REF=\"${{ github.ref }}\" \\\n            -e QC_JOB_USER_ID=\"${{ secrets.QC_JOB_USER_ID }}\" \\\n            -e QC_API_ACCESS_TOKEN=\"${{ secrets.QC_API_ACCESS_TOKEN }}\" \\\n            -e QC_JOB_ORGANIZATION_ID=\"${{ secrets.QC_JOB_ORGANIZATION_ID }}\" \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Run API Tests\n        run: |\n          # Build\n          runInContainer dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n          \n          # Run Projects tests\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 7minutes --blame-crash --logger \"console;verbosity=detailed\" --filter \"FullyQualifiedName=QuantConnect.Tests.API.ProjectTests|FullyQualifiedName=QuantConnect.Tests.API.ObjectStoreTests\" -- TestRunParameters.Parameter\\(name=\\\"log-handler\\\", value=\\\"ConsoleErrorLogHandler\\\"\\)\n"
  },
  {
    "path": ".github/workflows/benchmarks.yml",
    "content": "name: Benchmarks\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: self-hosted\n    container:\n        image: quantconnect/lean:foundation\n        volumes:\n          - /nas:/Data\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Checkout Lean Master\n        uses: actions/checkout@v2\n        with:\n          repository: QuantConnect/Lean\n          path: LeanMaster\n          ref: 'master'\n      - name: Build Lean Master\n        run: dotnet build --verbosity q /p:Configuration=Release /p:WarningLevel=1 LeanMaster/QuantConnect.Lean.sln\n\n      - name: Run Benchmarks Master\n        run: cp run_benchmarks.py LeanMaster/run_benchmarks.py && cd LeanMaster && python run_benchmarks.py /Data && cd ../\n\n      - name: Build\n        run: dotnet build --verbosity q /p:Configuration=Release /p:WarningLevel=1 QuantConnect.Lean.sln\n\n      - name: Run Benchmarks\n        run: python run_benchmarks.py /Data\n\n      - name: Compare Benchmarks\n        run: python compare_benchmarks.py LeanMaster/benchmark_results.json benchmark_results.json\n"
  },
  {
    "path": ".github/workflows/gh-actions.yml",
    "content": "name: Build & Test Lean\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        with:\n          fetch-depth: 0  # Ensures we fetch all history\n\n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo -e 'runInContainer() { docker exec test-container \"$@\"; }\\n' > \"$HOME/ci_functions.sh\"\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            -e GITHUB_REF=\"${{ github.ref }}\" \\\n            -e PYPI_API_TOKEN=\"${{ secrets.PYPI_API_TOKEN }}\" \\\n            -e ADDITIONAL_STUBS_REPOS=\"${{ secrets.ADDITIONAL_STUBS_REPOS }}\" \\\n            -e QC_GIT_TOKEN=\"${{ secrets.QC_GIT_TOKEN }}\" \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Run build and tests\n        run: |\n          # Add exception\n          runInContainer git config --global --add safe.directory /__w/Lean/Lean\n          \n          # Get Last Commit of the Current Tag\n          TAG_COMMIT=$(runInContainer git rev-parse HEAD) && echo \"CURRENT BRANCH LAST COMMIT $TAG_COMMIT\"\n          \n          # Get Last Commit of the master\n          MASTER_COMMIT=$(runInContainer git rev-parse origin/master) && echo \"MASTER BRANCH LAST COMMIT $MASTER_COMMIT\"\n          \n          # Build\n          runInContainer dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n          \n          # Run Tests\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter \"TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests\" -- TestRunParameters.Parameter\\(name=\\\"log-handler\\\", value=\\\"ConsoleErrorLogHandler\\\"\\)\n          \n          # Generate & Publish python stubs\n          echo \"GITHUB_REF ${{ github.ref }}\"\n          if [[ \"${{ github.ref }}\" = refs/tags/* && \"$TAG_COMMIT\" = \"$MASTER_COMMIT\" ]]; then \n            echo \"Generating stubs\"\n            runInContainer chmod +x ci_build_stubs.sh\n            runInContainer ./ci_build_stubs.sh -t -g -p\n          else \n            echo \"Skipping stub generation\"\n          fi\n"
  },
  {
    "path": ".github/workflows/rebase-org-branches.yml",
    "content": "name: Rebase Organization Branches\n\non:\n  push:\n    branches:\n      - 'master'\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n\n      - name: Rebase Organization Branches\n        run: |\n          chmod +x rebase_organization_branches.sh\n          ./rebase_organization_branches.sh\n        env:\n          QC_GIT_TOKEN: ${{ secrets.QC_GIT_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/regression-tests.yml",
    "content": "name: Regression Tests\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Build\n        run: runInContainer dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n\n      - name: Run Tests\n        run: |\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll \\\n            --filter TestCategory=RegressionTests \\\n            -- TestRunParameters.Parameter\\(name=\\\"log-handler\\\", value=\\\"ConsoleErrorLogHandler\\\"\\) \\\n            TestRunParameters.Parameter\\(name=\\\"reduced-disk-size\\\", value=\\\"true\\\"\\)"
  },
  {
    "path": ".github/workflows/report-generator.yml",
    "content": "name: Report Generator Tests\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Build and Run Report Generator Tests\n        run: |\n          # Build\n          runInContainer dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n          \n          # Run Backtest\n          runInContainer bash -c \"cd ./Launcher/bin/Release && dotnet QuantConnect.Lean.Launcher.dll\"\n          \n          # Run Report\n          runInContainer bash -c \"cd ./Report/bin/Release && dotnet ./QuantConnect.Report.dll --backtest-data-source-file ../../../Launcher/bin/Release/BasicTemplateFrameworkAlgorithm.json --close-automatically true\""
  },
  {
    "path": ".github/workflows/research-regression-tests.yml",
    "content": "name: Research Regression Tests\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n          \n      - name: Install Dependencies and Setup Kernel\n        run: |\n          runInContainer bash -c \"\n            # Install dependencies\n            pip3 install papermill==2.4.0 clr-loader==0.2.9\n            \n            # Install kernel\n            dotnet tool install -g --no-cache --version 1.0.661703 \\\n              --add-source 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' \\\n              Microsoft.dotnet-interactive\n              \n            # Add dotnet tools to Path and activate kernel\n            export PATH=\\\"/root/.dotnet/tools:\\$PATH\\\"\n            dotnet interactive jupyter install\n          \"\n\n      - name: Build and Run Research Tests\n        run: |\n          runInContainer bash -c \"\n            # Build\n            export PATH=\\\"/root/.dotnet/tools:\\$PATH\\\"\n            dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n            \n            # Run Tests\n            dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll \\\n              --filter TestCategory=ResearchRegressionTests \\\n              -- \\\"TestRunParameters.Parameter(name=\\\\\\\"log-handler\\\\\\\", value=\\\\\\\"ConsoleErrorLogHandler\\\\\\\")\\\" \\\n              \\\"TestRunParameters.Parameter(name=\\\\\\\"reduced-disk-size\\\\\\\", value=\\\\\\\"true\\\\\\\")\\\"\n          \""
  },
  {
    "path": ".github/workflows/syntax-tests.yml",
    "content": "name: Syntax Tests\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n\n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Run Syntax Test\n        run: |\n          runInContainer bash -c \"pip install --no-cache-dir quantconnect-stubs types-requests==2.32.* types-pytz==2025.2.0.* mypy==1.15.0\"\n          runInContainer python run_syntax_check.py"
  },
  {
    "path": ".github/workflows/virtual-environments.yml",
    "content": "name: Python Virtual Environments\n\non:\n  push:\n    branches: ['*']\n    tags: ['*']\n  pull_request:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n        \n      - name: Liberate disk space\n        uses: jlumbroso/free-disk-space@main\n        with:\n          tool-cache: true\n          large-packages: false\n          docker-images: false\n          swap-storage: false\n\n      - name: Define docker helper\n        run: |\n          echo 'runInContainer() { docker exec test-container \"$@\"; }' > $HOME/ci_functions.sh\n          echo \"BASH_ENV=$HOME/ci_functions.sh\" >> $GITHUB_ENV\n\n      - name: Start container\n        run: |\n          docker run -d \\\n            --workdir /__w/Lean/Lean \\\n            -v /home/runner/work:/__w \\\n            --name test-container \\\n            quantconnect/lean:foundation \\\n            tail -f /dev/null\n\n      - name: Run Python Virtual Environments Tests\n        run: |\n          # Build\n          runInContainer dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n          \n          # Python Virtual Environment System Packages\n          runInContainer bash -c \"python -m venv /lean-testenv --system-site-packages && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.221 && deactivate\"\n          \n          # Run Virtual Environment Test System Packages\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment\"\n          \n          # Python Virtual Environment\n          runInContainer bash -c \"rm -rf /lean-testenv && python -m venv /lean-testenv && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.221 && deactivate\"\n          \n          # Run Virtual Environment Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment\"\n          \n          # Run Python Package Tests\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run StableBaselines Python Package Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StableBaselinesTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run AxPlatform Python Package Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.AxPlatformTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run TensorlyTest Python Package Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorlyTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run NeuralTangents, Ignite Python Package Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.IgniteTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run TensorflowTest\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorflowTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run TensorflowProbability\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorflowProbabilityTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run Hvplot Python Package Test\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.RiskparityportfolioTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run Transformers\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Transformers\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.XTransformers\" --blame-hang-timeout 120seconds --blame-crash\n          \n          # Run Shap\n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.KerasTest|PyvinecopulibTest\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StatsForecast|Mlforecast\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.MlxtendTest|Thinc\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.ModuleVersionTestExplicit\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Neuralforecast\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Tsfel\" --blame-hang-timeout 120seconds --blame-crash\n          \n          runInContainer dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter \"FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.ScikitOptimizeTest\" --blame-hang-timeout 120seconds --blame-crash"
  },
  {
    "path": ".gitignore",
    "content": "# OS Files\n.DS_Store\n\n# Object files\n*.o\n*.ko\n*.obj\n*.elf\n*.pyc\n\n# Visual Studio Project Items:\n*.suo\n\n# Precompiled Headers\n*.gch\n*.pch\n\n# Libraries\n*.lib\n*.a\n*.la\n*.lo\n\n# Shared objects (inc. Windows DLLs)\n#*.dll\n*.so\n*.so.*\n*.dylib\n\n# Executables\n*/bin/*.exe\n*.out\n*.app\n*.i*86\n*.x86_64\n*.hex\n\n# QC Cloud Setup Bash Files\n*.sh\n# Include docker launch scripts for Mac/Linux\n!run_docker.sh\n!research/run_docker_notebook.sh\n\n# QC Config Files:\n# config.json\n\n# QC-C-Specific\n*Engine/bin/Debug/cache/data/*.zip\n*/obj/*\n*/bin/*\n*Data/*\n*Docker/*\n*/Docker/*\n*Algorithm.Python/Lib/*\n*/[Ee]xtensions/*\n!**/Libraries/*\n\n# C Debug Binaries\n*.pdb\n\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n*.userprefs\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n.vs/\nbuild/\nbld/\n[Bb]in/\n[Oo]bj/\n\n# Roslyn cache directories\n*.ide/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n#NUNIT\n*.VisualState.xml\nTestResult.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n*_i.c\n*_p.c\n*_i.h\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n*.cachefile\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings\n*.DotSettings.user\n\n# JustCode is a .NET coding addin-in\n.JustCode\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# JetBrains Rider\n.idea/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# TODO: Comment the next line if you want to checkin your web deploy settings \n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# NuGet Packages\n*.nupkg\n!LocalPackages/*\n# The packages folder can be ignored because of Package Restore\n**/packages/*\n# except build/, which is used as an MSBuild target.\n!**/packages/build/\n# If using the old MSBuild-Integrated Package Restore, uncomment this:\n#!**/packages/repositories.config\n# ignore sln level nuget\n.nuget/\n!.nuget/NuGet.config\n\n# Windows Azure Build Output\ncsx/\n*.build.csdef\n\n# Windows Store app package directory\nAppPackages/\n\n# Others\n*.Cache\nClientBin/\n[Ss]tyle[Cc]op.*\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.pfx\n*.publishsettings\nnode_modules/\nbower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\n*.mdf\n*.ldf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# Test Runner\ntestrunner/\n\n# Meld original diff files\n*.orig\n\n# Output chart data\nCharts/\n\n# NCrunch files\n*.ncrunchsolution\n*.ncrunchproject\n\n# QuantConnect plugin files\nQuantConnectProjects.xml\nLauncher/Plugins/*\n/ApiPython/dist\n/ApiPython/quantconnect.egg-info\n/ApiPython/quantconnect.egg-info/*\n\nQuantConnect.Lean.sln.DotSettings*\n\n#User notebook files\nResearch/Notebooks\n\n#Docker result files\nResults/\nQuantConnect.Lean.sln.DotSettings\n"
  },
  {
    "path": ".nuget/NuGet.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <packageRestore>\n        <add key=\"enabled\" value=\"true\" />\n        <add key=\"automatic\" value=\"true\" />\n    </packageRestore>\n    <packageSources>\n        <add key=\"LocalPackages\" value=\"../LocalPackages\" />\n    </packageSources>\n</configuration>"
  },
  {
    "path": ".travis.yml",
    "content": "language: csharp\nmono: none\ndotnet: 5.0\nos: linux\ndist: focal\nbefore_install:\n  - export PATH=\"$HOME/miniconda3/bin:$PATH\"\n  - export PYTHONNET_PYDLL=\"$HOME/miniconda3/lib/libpython3.6m.so\"\n  - wget -q https://cdn.quantconnect.com/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh\n  - bash Miniconda3-4.5.12-Linux-x86_64.sh -b\n  - rm -rf Miniconda3-4.5.12-Linux-x86_64.sh\n  - sudo ln -s $HOME/miniconda3/lib/libpython3.6m.so /usr/lib/libpython3.6m.so\n  - conda update -y python conda pip\n  - conda install -y python=3.6.8\n  - conda install -y numpy=1.18.1\n  - conda install -y pandas=0.25.3\n  - conda install -y cython=0.29.15\n  - conda install -y scipy=1.4.1\n  - conda install -y wrapt=1.12.1\nscript:\n  - dotnet nuget add source $TRAVIS_BUILD_DIR/LocalPackages\n  - dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln\n  - dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\\(name=\\\"log-handler\\\", value=\\\"ConsoleErrorLogHandler\\\"\\)"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n    /*\n        Recommended VS Code extensions for the LEAN engine\n    */\n    \"recommendations\": [\n        \"ms-dotnettools.csharp\",\n        \"ms-dotnettools.csdevkit\",\n        \"ms-vscode-remote.remote-containers\",\n        \"ms-python.python\"\n    ]\n}"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n    /*\n        VS Code Launch configurations for the LEAN engine\n\n        Launch LEAN:\n        Builds the project and then launches the program using coreclr; supports debugging.\n        Requires the C# extension from the marketplace.\n\n        Run Tests:\n        Builds and runs tests with an optional filter prompt.\n\n        Attach to Python:\n        Will attempt to attach to LEAN running locally using DebugPy. Requires that the process is\n        actively running and config is set: \"debugging\": true, \"debugging-method\": \"DebugPy\",\n        Requires Python extension from the marketplace.\n    */\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Launch LEAN\",\n            \"type\": \"coreclr\",\n            \"request\": \"launch\",\n            \"preLaunchTask\": \"build\",\n            \"program\": \"${workspaceFolder}/Launcher/bin/Debug/QuantConnect.Lean.Launcher.dll\",\n            \"args\": [\n                \"--config\",\n                \"${workspaceFolder}/Launcher/bin/Debug/config.json\"\n            ],\n            \"cwd\": \"${workspaceFolder}/Launcher/bin/Debug/\",\n            \"stopAtEntry\": false,\n            \"console\": \"integratedTerminal\",\n            \"internalConsoleOptions\": \"neverOpen\"\n        },\n        {\n            \"name\": \"Run Tests\",\n            \"type\": \"coreclr\",\n            \"request\": \"launch\",\n            \"preLaunchTask\": \"build\",\n            \"program\": \"dotnet\",\n            \"args\": [\n                \"test\",\n                \"${workspaceFolder}/Tests/QuantConnect.Tests.csproj\",\n                \"--no-build\",\n                \"--filter\",\n                \"TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests\"\n            ],\n            \"cwd\": \"${workspaceFolder}\",\n            \"console\": \"integratedTerminal\",\n            \"internalConsoleOptions\": \"neverOpen\"\n        },\n        {\n            \"name\": \"Attach to Python\",\n            \"type\": \"python\",\n            \"request\": \"attach\",\n            \"port\": 5678,\n            \"pathMappings\": [\n                {\n                    \"localRoot\": \"${workspaceFolder}\",\n                    \"remoteRoot\": \"${workspaceFolder}\"\n                }\n            ]\n        }\n    ]\n}"
  },
  {
    "path": ".vscode/readme.md",
    "content": "<h1>Local Development & Docker Integration with Visual Studio Code</h1>\n\nThis 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:\n\n- 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.\n\n- Using a Lean Dev container -> A docker environment with all dependencies pre-installed to allow seamless Lean development across platforms. Great for open source contributors.\n\n- Locally installing all dependencies to run Lean with Visual Studio Code on your OS.\n\n<br />\n\n<h1>Setup</h1>\n\n<h2>Option 1: Lean CLI</h2>\n\nTo use Lean CLI follow the instructions for installation and tutorial for usage in our [documentation](https://www.quantconnect.com/docs/v2/lean-cli/key-concepts/getting-started)\n\n<br />\n\n<h2>Option 2: Lean Development Container</h2>\n\nBefore anything we need to ensure a few things have been done for either option:\n\n1. Get [Visual Studio Code](https://code.visualstudio.com/download)\n    - Get [Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) Extension\n\n2. Get [Docker](https://docs.docker.com/get-docker/):\n    - Follow the instructions for your Operating System\n    - New to Docker? Try [docker getting-started](https://docs.docker.com/get-started/)\n\n3. Pull Lean’s latest research image from a terminal\n    - `docker pull quantconnect/research:latest`\n\n4. Get Lean into VS Code\n    - Download the repo or clone it using: `git clone [https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)`\n    - Open the folder using VS Code\n\n5. Open Development Container\n    - In VS Code, either:\n        - Select \"Reopen in Container\" from pop up box.\n\n            OR\n\n        - Ctrl+Shift+P (Command Palette) and select \"Remote-Containers: Rebuild and Reopen in Container\"\n\nYou should now be in the development container, give VS Code a moment to prepare and you will be ready to go!\nIf you would like to mount any additional local files to your container, checkout [devcontainer.json \"mounts\" section](https://containers.dev/implementors/json_reference/) for an example! Upon any mount changes you must rebuild the container using Command Palette as in step 5.\n\n<br />\n\n<h2>Option 3: Install Dependencies Locally</h2>\n\n1. Install [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) for the project\n\n2. (Optional) Get [Python 3.11.14](https://www.python.org/downloads/release/python-31114/) for running Python algorithms\n    - Follow Python instructions [here](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#installing-python-311) for your platform\n\n3. Get [Visual Studio Code](https://code.visualstudio.com/download)\n    - Get the Extension [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) for C# Debugging\n    - Get the Extension [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) for the .NET Test Explorer and enhanced C# development\n    - Get the Extension [IntelliCode for C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscodeintellicode-csharp) for AI-assisted IntelliSense\n    - Get the Extension [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python Debugging\n\n4. Get Lean into VS Code\n    - Download the repo or clone it using: `git clone [https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)`\n    - Open the folder using VS Code\n\nYour environment is prepared and ready to run Lean.\n\n<br />\n\n<h1>How to use Lean</h1>\n\nThis 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/key-concepts/getting-started)\n\n<br />\n\n<h2>Configuration</h2>\n\nWe need to be sure that our Lean configuration at **.\\Launcher\\config.json** is properly set.\n\nYour configuration file should look something like this for the following languages:\n\n<h3>Python:</h3>\n\n    \"algorithm-type-name\": \"**AlgorithmName**\",\n\n    \"algorithm-language\": \"Python\",\n\n    \"algorithm-location\": \"../../../Algorithm.Python/**AlgorithmName**.py\",\n\n<h3>C#:</h3>\n\n    \"algorithm-type-name\": \"**AlgorithmName**\",\n\n    \"algorithm-language\": \"CSharp\",\n\n    \"algorithm-location\": \"QuantConnect.Algorithm.CSharp.dll\",\n\n<br />\n\n<h2>Building</h2>\n\nBefore 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.\n\nIn VS Code run build task (Ctrl+Shift+B or \"Terminal\" dropdown); there are a few options:\n\n- __Build__ - basic build task, just builds Lean once\n- __Rebuild__ - rebuild task, completely rebuilds the project. Use if having issues with debugging symbols being loaded for your algorithms.\n- __Clean__ - deletes out all project build files\n- __Test__ - runs the unit tests (requires building first)\n\n**Note:** VS Code will prompt you to install the recommended extensions (C#, C# Dev Kit, Python) when you first open the workspace. You can also install them manually or via the `extensions.json` file.\n\n<br />\n\n<h2>Launching Lean</h2>\n\nNow 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.\n\n<br />\n\n<h2>Debugging Python</h2>\n\nPython algorithms require a little extra work in order to be able to debug them. Follow the steps below to get Python debugging working.\n\n<br />\n\n<h3>Modifying the Configuration</h3>\n\nFirst 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:\n\n    \"debugging\": true,\n    \"debugging-method\": \"DebugPy\",\n\nIn setting this we are telling Lean to expect a debugger connection using ‘Python Tools for Visual Studio Debugger’. Once this is set Lean will stop upon initialization and await a connection to the debugger via port 5678.\n\n<br />\n\n<h3>Using VS Code Launch Options to Connect</h3>\n\nNow that Lean is configured for the python debugger we can make use of the programmed launch options to connect to Lean during runtime.\n\nStart 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.\n\n<br />\n\n_Figure 2: Python Debugger Messages_\n\n```\n20200715 17:12:06.546 Trace:: PythonInitializer.Initialize(): ended\n20200715 17:12:06.547 Trace:: DebuggerHelper.Initialize(): python initialization done\n20200715 17:12:06.547 Trace:: DebuggerHelper.Initialize(): starting...\n20200715 17:12:06.548 Trace:: DebuggerHelper.Initialize(): waiting for debugger to attach at localhost:5678...\n```\n\n<br />\n\n<h1>Common Issues</h1>\nHere we will cover some common issues with setting this up. This section will expand as we get user feedback!\n\n- The \"project file cannot be loaded\" and \"nuget packages not found\" errors occurs when the project files are open by another process in the host. Closing all applications and/or restarting the computer solve the issue.\n- Autocomplete and reference finding with omnisharp can sometimes be buggy, if this occurs use the command palette to restart omnisharp. (Ctrl+Shift+P \"OmniSharp: Restart OmniSharp\")\n- 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.\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    \"files.eol\": \"\\n\",\n    \"files.exclude\": {\n        \"**/bin\": true,\n        \"**/obj\": true,\n        \"**/.git\": true\n    },\n    \"search.exclude\": {\n        \"**/bin\": true,\n        \"**/obj\": true\n    },\n    \"omnisharp.enableRoslynAnalyzers\": true,\n    \"omnisharp.enableEditorConfigSupport\": true,\n    \"dotnet.defaultSolution\": \"QuantConnect.Lean.sln\",\n    \"editor.formatOnSave\": true,\n    \"editor.rulers\": [\n        150\n    ],\n    \"[csharp]\": {\n        \"editor.defaultFormatter\": \"ms-dotnettools.csharp\",\n        \"editor.tabSize\": 4,\n        \"editor.insertSpaces\": true\n    },\n    \"python.analysis.extraPaths\": [\n        \"./Algorithm.Python\",\n        \"/opt/miniconda3/lib/python3.11/site-packages\",\n    ]\n}"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n    /*\n        VS Code Tasks for the LEAN engine\n        In order to use the build tasks you need dotnet on your system path.\n    */\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"label\": \"build\",\n            \"type\": \"shell\",\n            \"command\": \"dotnet\",\n            \"args\": [\n                \"build\",\n                \"${workspaceFolder}/QuantConnect.Lean.sln\",\n                \"/p:Configuration=Debug\",\n                \"/p:DebugType=portable\",\n                \"/p:WarningLevel=1\"\n            ],\n            \"group\": {\n                \"kind\": \"build\",\n                \"isDefault\": true\n            },\n            \"presentation\": {\n                \"reveal\": \"silent\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"rebuild\",\n            \"type\": \"shell\",\n            \"command\": \"dotnet\",\n            \"args\": [\n                \"build\",\n                \"${workspaceFolder}/QuantConnect.Lean.sln\",\n                \"--no-incremental\",\n                \"/p:Configuration=Debug\",\n                \"/p:DebugType=portable\",\n                \"/p:WarningLevel=1\"\n            ],\n            \"group\": \"build\",\n            \"presentation\": {\n                \"reveal\": \"silent\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"clean\",\n            \"type\": \"shell\",\n            \"command\": \"dotnet\",\n            \"args\": [\n                \"clean\",\n                \"${workspaceFolder}/QuantConnect.Lean.sln\"\n            ],\n            \"group\": \"build\",\n            \"presentation\": {\n                \"reveal\": \"silent\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"test\",\n            \"type\": \"shell\",\n            \"command\": \"dotnet\",\n            \"args\": [\n                \"test\",\n                \"${workspaceFolder}/Tests/QuantConnect.Tests.csproj\",\n                \"--no-build\"\n            ],\n            \"group\": {\n                \"kind\": \"test\",\n                \"isDefault\": true\n            },\n            \"presentation\": {\n                \"reveal\": \"always\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"start research\",\n            \"type\": \"shell\",\n            \"dependsOn\": [\"build\"],\n            \"group\": \"build\",\n            \"isBackground\": true,\n            \"command\": \"${workspaceFolder}/.vscode/launch_research.sh\",\n            \"args\": [\n                \"${workspaceFolder}/Launcher/bin/Debug\"\n            ],\n            \"problemMatcher\": \"$msCompile\"\n        }\n    ]\n}\n"
  },
  {
    "path": "Algorithm/Alphas/AlphaModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides a base class for alpha models.\n    /// </summary>\n    public class AlphaModel : BasePythonWrapper<AlphaModel>, IAlphaModel, INamedModel\n    {\n        /// <summary>\n        /// Defines a name for a framework model\n        /// </summary>\n        public virtual string Name { get; set; }\n\n        /// <summary>\n        /// Initialize new <see cref=\"AlphaModel\"/>\n        /// </summary>\n        public AlphaModel()\n        {\n            Name = Guid.NewGuid().ToString();\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public virtual IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            throw new NotImplementedException(\"Types deriving from 'AlphaModel' must implement the 'IEnumerable<Insight> Update(QCAlgorithm, Slice) method.\");\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public virtual void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Alphas/AlphaModelExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides extension methods for alpha models\n    /// </summary>\n    public static class AlphaModelExtensions\n    {\n        /// <summary>\n        /// Gets the name of the alpha model\n        /// </summary>\n        public static string GetModelName(this IAlphaModel model)\n        {\n            var namedModel = model as INamedModel;\n            if (namedModel != null)\n            {\n                return namedModel.Name;\n            }\n\n            return model.GetType().Name;\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Alphas/AlphaModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IAlphaModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class AlphaModelPythonWrapper : AlphaModel\n    {\n        /// <summary>\n        /// Defines a name for a framework model\n        /// </summary>\n        public override string Name\n        {\n            get\n            {\n                using (Py.GIL())\n                {\n                    // if the model defines a Name property then use that\n                    if (HasAttr(nameof(Name)))\n                    {\n                        return GetProperty<string>(nameof(Name));\n                    }\n\n                    // if the model does not define a name property, use the python type name\n                    return GetProperty(\" __class__\").GetAttr(\"__name__\").GetAndDispose<string>();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"IAlphaModel\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">>Model that generates alpha</param>\n        public AlphaModelPythonWrapper(PyObject model)\n        {\n            SetPythonInstance(model, false);\n            foreach (var attributeName in new[] { \"Update\", \"OnSecuritiesChanged\" })\n            {\n                if (!HasAttr(attributeName))\n                {\n                    throw new NotImplementedException($\"IAlphaModel.{attributeName} must be implemented. Please implement this missing method on {model.GetPythonType()}\");\n                }\n            }\n\n            var methodName = nameof(SetPythonInstance);\n            if (HasAttr(methodName))\n            {\n                InvokeMethod(methodName, model);\n            }\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            return InvokeMethodAndEnumerate<Insight>(nameof(Update), algorithm, data);\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            InvokeVoidMethod(nameof(OnSecuritiesChanged), algorithm, changes);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Alphas/CompositeAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IAlphaModel\"/> that combines multiple alpha\n    /// models into a single alpha model and properly sets each insights 'SourceModel' property.\n    /// </summary>\n    public class CompositeAlphaModel : AlphaModel\n    {\n        private readonly List<IAlphaModel> _alphaModels = new List<IAlphaModel>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"alphaModels\">The individual alpha models defining this composite model</param>\n        public CompositeAlphaModel(params IAlphaModel[] alphaModels)\n        {\n            if (alphaModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 alpha model for the CompositeAlphaModel\");\n            }\n\n            _alphaModels.AddRange(alphaModels);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"alphaModels\">The individual alpha models defining this composite model</param>\n        public CompositeAlphaModel(params PyObject[] alphaModels)\n        {\n            if (alphaModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 alpha model for the CompositeAlphaModel\");\n            }\n\n            foreach (var pyAlphaModel in alphaModels)\n            {\n                AddAlpha(pyAlphaModel);\n            }\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities.\n        /// This method patches this call through the each of the wrapped models.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            foreach (var model in _alphaModels)\n            {\n                var name = model.GetModelName();\n                foreach (var insight in model.Update(algorithm, data))\n                {\n                    if (string.IsNullOrEmpty(insight.SourceModel))\n                    {\n                        // set the source model name if not already set\n                        insight.SourceModel = name;\n                    }\n\n                    yield return insight;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed.\n        /// This method patches this call through the each of the wrapped models.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var model in _alphaModels)\n            {\n                model.OnSecuritiesChanged(algorithm, changes);\n            }\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"AlphaModel\"/>\n        /// </summary>\n        /// <param name=\"alphaModel\">The alpha model to add</param>\n        public void AddAlpha(IAlphaModel alphaModel)\n        {\n            _alphaModels.Add(alphaModel);\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"AlphaModel\"/>\n        /// </summary>\n        /// <param name=\"pyAlphaModel\">The alpha model to add</param>\n        public void AddAlpha(PyObject pyAlphaModel)\n        {\n            var alphaModel = PythonUtil.CreateInstanceOrWrapper<IAlphaModel>(\n                pyAlphaModel,\n                py => new AlphaModelPythonWrapper(py)\n            );\n            _alphaModels.Add(alphaModel);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Alphas/IAlphaModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Algorithm framework model that produces insights\n    /// </summary>\n    public interface IAlphaModel : INotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data);\n    }\n}"
  },
  {
    "path": "Algorithm/Alphas/INamedModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides a marker interface allowing models to define their own names.\n    /// If not specified, the framework will use the model's type name.\n    /// Implementation of this is not required unless you plan on running multiple models\n    /// of the same type w/ different parameters.\n    /// </summary>\n    public interface INamedModel\n    {\n        /// <summary>\n        /// Defines a name for a framework model\n        /// </summary>\n        string Name { get; }\n    }\n}"
  },
  {
    "path": "Algorithm/Alphas/NullAlphaModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides a null implementation of an alpha model\n    /// </summary>\n    public class NullAlphaModel : AlphaModel\n    {\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            return Enumerable.Empty<Insight>();\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Alphas/NullAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass NullAlphaModel(AlphaModel):\n    '''Provides a null implementation of an alpha model'''\n\n    def update(self, algorithm, data):\n        ''' Determines an insight for each security based on it's current MACD signal\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        return []\n"
  },
  {
    "path": "Algorithm/CandlestickPatterns.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators.CandlestickPatterns;\n\nnamespace QuantConnect.Algorithm\n{\n    /// <summary>\n    /// Provides helpers for using candlestick patterns\n    /// </summary>\n    public class CandlestickPatterns\n    {\n        private readonly QCAlgorithm _algorithm;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CandlestickPatterns\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public CandlestickPatterns(QCAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.TwoCrows\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public TwoCrows TwoCrows(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"TWOCROWS\", resolution);\n            var pattern = new TwoCrows(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeBlackCrows\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeBlackCrows ThreeBlackCrows(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREEBLACKCROWS\", resolution);\n            var pattern = new ThreeBlackCrows(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeInside\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeInside ThreeInside(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREEINSIDE\", resolution);\n            var pattern = new ThreeInside(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeLineStrike\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeLineStrike ThreeLineStrike(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREELINESTRIKE\", resolution);\n            var pattern = new ThreeLineStrike(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeOutside\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeOutside ThreeOutside(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREEOUTSIDE\", resolution);\n            var pattern = new ThreeOutside(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeStarsInSouth\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeStarsInSouth ThreeStarsInSouth(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREESTARSINSOUTH\", resolution);\n            var pattern = new ThreeStarsInSouth(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ThreeWhiteSoldiers\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ThreeWhiteSoldiers ThreeWhiteSoldiers(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THREEWHITESOLDIERS\", resolution);\n            var pattern = new ThreeWhiteSoldiers(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.AbandonedBaby\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public AbandonedBaby AbandonedBaby(Symbol symbol, decimal penetration = 0.3m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"ABANDONEDBABY\", resolution);\n            var pattern = new AbandonedBaby(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.AdvanceBlock\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public AdvanceBlock AdvanceBlock(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"ADVANCEBLOCK\", resolution);\n            var pattern = new AdvanceBlock(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.BeltHold\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public BeltHold BeltHold(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"BELTHOLD\", resolution);\n            var pattern = new BeltHold(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Breakaway\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Breakaway Breakaway(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"BREAKAWAY\", resolution);\n            var pattern = new Breakaway(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ClosingMarubozu\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ClosingMarubozu ClosingMarubozu(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"CLOSINGMARUBOZU\", resolution);\n            var pattern = new ClosingMarubozu(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ConcealedBabySwallow\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ConcealedBabySwallow ConcealedBabySwallow(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"CONCEALEDBABYSWALLOW\", resolution);\n            var pattern = new ConcealedBabySwallow(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Counterattack\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Counterattack Counterattack(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"COUNTERATTACK\", resolution);\n            var pattern = new Counterattack(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.DarkCloudCover\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public DarkCloudCover DarkCloudCover(Symbol symbol, decimal penetration = 0.5m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"DARKCLOUDCOVER\", resolution);\n            var pattern = new DarkCloudCover(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Doji\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Doji Doji(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"DOJI\", resolution);\n            var pattern = new Doji(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.DojiStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public DojiStar DojiStar(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"DOJISTAR\", resolution);\n            var pattern = new DojiStar(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.DragonflyDoji\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public DragonflyDoji DragonflyDoji(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"DRAGONFLYDOJI\", resolution);\n            var pattern = new DragonflyDoji(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Engulfing\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Engulfing Engulfing(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"ENGULFING\", resolution);\n            var pattern = new Engulfing(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.EveningDojiStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public EveningDojiStar EveningDojiStar(Symbol symbol, decimal penetration = 0.3m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"EVENINGDOJISTAR\", resolution);\n            var pattern = new EveningDojiStar(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.EveningStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public EveningStar EveningStar(Symbol symbol, decimal penetration = 0.3m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"EVENINGSTAR\", resolution);\n            var pattern = new EveningStar(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.GapSideBySideWhite\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public GapSideBySideWhite GapSideBySideWhite(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"GAPSIDEBYSIDEWHITE\", resolution);\n            var pattern = new GapSideBySideWhite(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.GravestoneDoji\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public GravestoneDoji GravestoneDoji(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"GRAVESTONEDOJI\", resolution);\n            var pattern = new GravestoneDoji(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Hammer\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Hammer Hammer(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HAMMER\", resolution);\n            var pattern = new Hammer(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.HangingMan\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public HangingMan HangingMan(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HANGINGMAN\", resolution);\n            var pattern = new HangingMan(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Harami\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Harami Harami(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HARAMI\", resolution);\n            var pattern = new Harami(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.HaramiCross\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public HaramiCross HaramiCross(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HARAMICROSS\", resolution);\n            var pattern = new HaramiCross(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.HighWaveCandle\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public HighWaveCandle HighWaveCandle(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HIGHWAVECANDLE\", resolution);\n            var pattern = new HighWaveCandle(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Hikkake\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Hikkake Hikkake(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HIKKAKE\", resolution);\n            var pattern = new Hikkake(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.HikkakeModified\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public HikkakeModified HikkakeModified(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HIKKAKEMODIFIED\", resolution);\n            var pattern = new HikkakeModified(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.HomingPigeon\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public HomingPigeon HomingPigeon(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"HOMINGPIGEON\", resolution);\n            var pattern = new HomingPigeon(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.IdenticalThreeCrows\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public IdenticalThreeCrows IdenticalThreeCrows(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"IDENTICALTHREECROWS\", resolution);\n            var pattern = new IdenticalThreeCrows(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.InNeck\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public InNeck InNeck(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"INNECK\", resolution);\n            var pattern = new InNeck(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.InvertedHammer\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public InvertedHammer InvertedHammer(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"INVERTEDHAMMER\", resolution);\n            var pattern = new InvertedHammer(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Kicking\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Kicking Kicking(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"KICKING\", resolution);\n            var pattern = new Kicking(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.KickingByLength\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public KickingByLength KickingByLength(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"KICKINGBYLENGTH\", resolution);\n            var pattern = new KickingByLength(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.LadderBottom\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public LadderBottom LadderBottom(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"LADDERBOTTOM\", resolution);\n            var pattern = new LadderBottom(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.LongLeggedDoji\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public LongLeggedDoji LongLeggedDoji(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"LONGLEGGEDDOJI\", resolution);\n            var pattern = new LongLeggedDoji(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.LongLineCandle\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public LongLineCandle LongLineCandle(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"LONGLINECANDLE\", resolution);\n            var pattern = new LongLineCandle(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Marubozu\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Marubozu Marubozu(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"MARUBOZU\", resolution);\n            var pattern = new Marubozu(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.MatchingLow\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public MatchingLow MatchingLow(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"MATCHINGLOW\", resolution);\n            var pattern = new MatchingLow(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.MatHold\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public MatHold MatHold(Symbol symbol, decimal penetration = 0.5m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"MATHOLD\", resolution);\n            var pattern = new MatHold(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.MorningDojiStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public MorningDojiStar MorningDojiStar(Symbol symbol, decimal penetration = 0.3m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"MORNINGDOJISTAR\", resolution);\n            var pattern = new MorningDojiStar(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.MorningStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public MorningStar MorningStar(Symbol symbol, decimal penetration = 0.3m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"MORNINGSTAR\", resolution);\n            var pattern = new MorningStar(name, penetration);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.OnNeck\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public OnNeck OnNeck(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"ONNECK\", resolution);\n            var pattern = new OnNeck(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Piercing\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Piercing Piercing(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"PIERCING\", resolution);\n            var pattern = new Piercing(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.RickshawMan\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public RickshawMan RickshawMan(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"RICKSHAWMAN\", resolution);\n            var pattern = new RickshawMan(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.RiseFallThreeMethods\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public RiseFallThreeMethods RiseFallThreeMethods(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"RISEFALLTHREEMETHODS\", resolution);\n            var pattern = new RiseFallThreeMethods(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.SeparatingLines\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public SeparatingLines SeparatingLines(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"SEPARATINGLINES\", resolution);\n            var pattern = new SeparatingLines(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ShootingStar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ShootingStar ShootingStar(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"SHOOTINGSTAR\", resolution);\n            var pattern = new ShootingStar(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.ShortLineCandle\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public ShortLineCandle ShortLineCandle(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"SHORTLINECANDLE\", resolution);\n            var pattern = new ShortLineCandle(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.SpinningTop\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public SpinningTop SpinningTop(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"SPINNINGTOP\", resolution);\n            var pattern = new SpinningTop(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.StalledPattern\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public StalledPattern StalledPattern(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"STALLEDPATTERN\", resolution);\n            var pattern = new StalledPattern(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.StickSandwich\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public StickSandwich StickSandwich(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"STICKSANDWICH\", resolution);\n            var pattern = new StickSandwich(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Takuri\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Takuri Takuri(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"TAKURI\", resolution);\n            var pattern = new Takuri(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.TasukiGap\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public TasukiGap TasukiGap(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"TASUKIGAP\", resolution);\n            var pattern = new TasukiGap(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Thrusting\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Thrusting Thrusting(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"THRUSTING\", resolution);\n            var pattern = new Thrusting(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.Tristar\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public Tristar Tristar(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"TRISTAR\", resolution);\n            var pattern = new Tristar(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.UniqueThreeRiver\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public UniqueThreeRiver UniqueThreeRiver(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"UNIQUETHREERIVER\", resolution);\n            var pattern = new UniqueThreeRiver(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.UpsideGapTwoCrows\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public UpsideGapTwoCrows UpsideGapTwoCrows(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"UPSIDEGAPTWOCROWS\", resolution);\n            var pattern = new UpsideGapTwoCrows(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Indicators.CandlestickPatterns.UpDownGapThreeMethods\"/> pattern indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose pattern we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The pattern indicator for the requested symbol.</returns>\n        public UpDownGapThreeMethods UpDownGapThreeMethods(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = _algorithm.CreateIndicatorName(symbol, \"UPDOWNGAPTHREEMETHODS\", resolution);\n            var pattern = new UpDownGapThreeMethods(name);\n            _algorithm.RegisterIndicator(symbol, pattern, resolution, selector);\n            return pattern;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/ConstituentUniverseDefinitions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm\n{\n    /// <summary>\n    /// Provides helpers for defining constituent universes based on the Morningstar\n    /// asset classification <see cref=\"AssetClassification\"/> https://www.morningstar.com/\n    /// </summary>\n    public class ConstituentUniverseDefinitions\n    {\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies whose revenues and earnings have both been growing significantly faster than\n        /// the general economy.\n        /// </summary>\n        public Universe AggressiveGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-AggressiveGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-AggressiveGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that are growing respectably faster than the general economy, and often pay a\n        /// steady dividend. They tend to be mature and solidly profitable businesses.\n        /// </summary>\n        public Universe ClassicGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-ClassicGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-ClassicGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies in the cyclicals and durables sectors, except those in the three types below.\n        /// The profits of cyclicals tend to rise and fall with the general economy.\n        /// </summary>\n        public Universe Cyclicals(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Cyclicals\", SecurityType.Equity, Market.USA), \"constituents-universe-Cyclicals\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that have had consistently declining cash flows and earnings over the past\n        /// three years, and/or very high debt.\n        /// </summary>\n        public Universe Distressed(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Distressed\", SecurityType.Equity, Market.USA), \"constituents-universe-Distressed\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that deal in assets such as oil, metals, and real estate, which tend to do\n        /// well in inflationary environments.\n        /// </summary>\n        public Universe HardAsset(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-HardAsset\", SecurityType.Equity, Market.USA), \"constituents-universe-HardAsset\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that have dividend yields at least twice the average for large-cap stocks.\n        /// They tend to be mature, slow-growing companies.\n        /// </summary>\n        public Universe HighYield(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-HighYield\", SecurityType.Equity, Market.USA), \"constituents-universe-HighYield\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that have shown slow revenue and earnings growth (typically less than the rate\n        /// of GDP growth) over at least three years.\n        /// </summary>\n        public Universe SlowGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-SlowGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-SlowGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// <see cref=\"Universe\"/> which selects companies that have shown strong revenue growth but slower or spotty earnings growth.\n        /// Very small or young companies also tend to fall into this class.\n        /// </summary>\n        public Universe SpeculativeGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-SpeculativeGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-SpeculativeGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe LargeValue(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-LargeValue\", SecurityType.Equity, Market.USA), \"constituents-universe-LargeValue\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe LargeCore(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-LargeCore\", SecurityType.Equity, Market.USA), \"constituents-universe-LargeCore\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe LargeGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-LargeGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-LargeGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe MidValue(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MidValue\", SecurityType.Equity, Market.USA), \"constituents-universe-MidValue\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe MidCore(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MidCore\", SecurityType.Equity, Market.USA), \"constituents-universe-MidCore\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe MidGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MidGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-MidGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe SmallValue(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-SmallValue\", SecurityType.Equity, Market.USA), \"constituents-universe-SmallValue\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe SmallCore(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-SmallCore\", SecurityType.Equity, Market.USA), \"constituents-universe-SmallCore\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Classifies securities according to market capitalization and growth and value factor\n        /// </summary>\n        /// <remarks>Please refer to http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n        public Universe SmallGrowth(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-SmallGrowth\", SecurityType.Equity, Market.USA), \"constituents-universe-SmallGrowth\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Agriculture industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Agriculture(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Agriculture\", SecurityType.Equity, Market.USA), \"constituents-universe-Agriculture\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar BuildingMaterials industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe BuildingMaterials(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-BuildingMaterials\", SecurityType.Equity, Market.USA), \"constituents-universe-BuildingMaterials\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Chemicals industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Chemicals(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Chemicals\", SecurityType.Equity, Market.USA), \"constituents-universe-Chemicals\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar ForestProducts industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe ForestProducts(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-ForestProducts\", SecurityType.Equity, Market.USA), \"constituents-universe-ForestProducts\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar MetalsAndMining industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe MetalsAndMining(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MetalsAndMining\", SecurityType.Equity, Market.USA), \"constituents-universe-MetalsAndMining\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Steel industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Steel(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Steel\", SecurityType.Equity, Market.USA), \"constituents-universe-Steel\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar VehiclesAndParts industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe VehiclesAndParts(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-VehiclesAndParts\", SecurityType.Equity, Market.USA), \"constituents-universe-VehiclesAndParts\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar FixturesAndAppliances industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe FixturesAndAppliances(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-FixturesAndAppliances\", SecurityType.Equity, Market.USA), \"constituents-universe-FixturesAndAppliances\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar HomebuildingAndConstruction industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe HomebuildingAndConstruction(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-HomebuildingAndConstruction\", SecurityType.Equity, Market.USA), \"constituents-universe-HomebuildingAndConstruction\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar ManufacturingApparelAndAccessories industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe ManufacturingApparelAndAccessories(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-ManufacturingApparelAndAccessories\", SecurityType.Equity, Market.USA), \"constituents-universe-ManufacturingApparelAndAccessories\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar PackagingAndContainers industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe PackagingAndContainers(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-PackagingAndContainers\", SecurityType.Equity, Market.USA), \"constituents-universe-PackagingAndContainers\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar PersonalServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe PersonalServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-PersonalServices\", SecurityType.Equity, Market.USA), \"constituents-universe-PersonalServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Restaurants industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Restaurants(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Restaurants\", SecurityType.Equity, Market.USA), \"constituents-universe-Restaurants\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar RetailCyclical industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe RetailCyclical(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-RetailCyclical\", SecurityType.Equity, Market.USA), \"constituents-universe-RetailCyclical\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar TravelAndLeisure industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe TravelAndLeisure(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-TravelAndLeisure\", SecurityType.Equity, Market.USA), \"constituents-universe-TravelAndLeisure\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar AssetManagement industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe AssetManagement(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-AssetManagement\", SecurityType.Equity, Market.USA), \"constituents-universe-AssetManagement\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Banks industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Banks(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Banks\", SecurityType.Equity, Market.USA), \"constituents-universe-Banks\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar CapitalMarkets industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe CapitalMarkets(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-CapitalMarkets\", SecurityType.Equity, Market.USA), \"constituents-universe-CapitalMarkets\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Insurance industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Insurance(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Insurance\", SecurityType.Equity, Market.USA), \"constituents-universe-Insurance\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar DiversifiedFinancialServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe DiversifiedFinancialServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-DiversifiedFinancialServices\", SecurityType.Equity, Market.USA), \"constituents-universe-DiversifiedFinancialServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar CreditServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe CreditServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-CreditServices\", SecurityType.Equity, Market.USA), \"constituents-universe-CreditServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar RealEstate industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe RealEstate(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-RealEstate\", SecurityType.Equity, Market.USA), \"constituents-universe-RealEstate\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar REITs industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe REITs(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-REITs\", SecurityType.Equity, Market.USA), \"constituents-universe-REITs\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar BeveragesAlcoholic industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe BeveragesAlcoholic(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-BeveragesAlcoholic\", SecurityType.Equity, Market.USA), \"constituents-universe-BeveragesAlcoholic\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar BeveragesNonAlcoholic industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe BeveragesNonAlcoholic(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-BeveragesNonAlcoholic\", SecurityType.Equity, Market.USA), \"constituents-universe-BeveragesNonAlcoholic\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar ConsumerPackagedGoods industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe ConsumerPackagedGoods(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-ConsumerPackagedGoods\", SecurityType.Equity, Market.USA), \"constituents-universe-ConsumerPackagedGoods\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Education industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Education(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Education\", SecurityType.Equity, Market.USA), \"constituents-universe-Education\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar RetailDefensive industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe RetailDefensive(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-RetailDefensive\", SecurityType.Equity, Market.USA), \"constituents-universe-RetailDefensive\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar TobaccoProducts industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe TobaccoProducts(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-TobaccoProducts\", SecurityType.Equity, Market.USA), \"constituents-universe-TobaccoProducts\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Biotechnology industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Biotechnology(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Biotechnology\", SecurityType.Equity, Market.USA), \"constituents-universe-Biotechnology\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar DrugManufacturers industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe DrugManufacturers(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-DrugManufacturers\", SecurityType.Equity, Market.USA), \"constituents-universe-DrugManufacturers\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar HealthcarePlans industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe HealthcarePlans(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-HealthcarePlans\", SecurityType.Equity, Market.USA), \"constituents-universe-HealthcarePlans\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar HealthcareProvidersAndServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe HealthcareProvidersAndServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-HealthcareProvidersAndServices\", SecurityType.Equity, Market.USA), \"constituents-universe-HealthcareProvidersAndServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar MedicalDevicesAndInstruments industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe MedicalDevicesAndInstruments(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MedicalDevicesAndInstruments\", SecurityType.Equity, Market.USA), \"constituents-universe-MedicalDevicesAndInstruments\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar MedicalDiagnosticsAndResearch industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe MedicalDiagnosticsAndResearch(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MedicalDiagnosticsAndResearch\", SecurityType.Equity, Market.USA), \"constituents-universe-MedicalDiagnosticsAndResearch\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar MedicalDistribution industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe MedicalDistribution(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MedicalDistribution\", SecurityType.Equity, Market.USA), \"constituents-universe-MedicalDistribution\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar UtilitiesIndependentPowerProducers industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe UtilitiesIndependentPowerProducers(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-UtilitiesIndependentPowerProducers\", SecurityType.Equity, Market.USA), \"constituents-universe-UtilitiesIndependentPowerProducers\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar UtilitiesRegulated industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe UtilitiesRegulated(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-UtilitiesRegulated\", SecurityType.Equity, Market.USA), \"constituents-universe-UtilitiesRegulated\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar TelecommunicationServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe TelecommunicationServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-TelecommunicationServices\", SecurityType.Equity, Market.USA), \"constituents-universe-TelecommunicationServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar MediaDiversified industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe MediaDiversified(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-MediaDiversified\", SecurityType.Equity, Market.USA), \"constituents-universe-MediaDiversified\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar InteractiveMedia industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe InteractiveMedia(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-InteractiveMedia\", SecurityType.Equity, Market.USA), \"constituents-universe-InteractiveMedia\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar OilAndGas industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe OilAndGas(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-OilAndGas\", SecurityType.Equity, Market.USA), \"constituents-universe-OilAndGas\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar OtherEnergySources industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe OtherEnergySources(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-OtherEnergySources\", SecurityType.Equity, Market.USA), \"constituents-universe-OtherEnergySources\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar AerospaceAndDefense industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe AerospaceAndDefense(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-AerospaceAndDefense\", SecurityType.Equity, Market.USA), \"constituents-universe-AerospaceAndDefense\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar BusinessServices industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe BusinessServices(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-BusinessServices\", SecurityType.Equity, Market.USA), \"constituents-universe-BusinessServices\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Conglomerates industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Conglomerates(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Conglomerates\", SecurityType.Equity, Market.USA), \"constituents-universe-Conglomerates\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Construction industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Construction(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Construction\", SecurityType.Equity, Market.USA), \"constituents-universe-Construction\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar FarmAndHeavyConstructionMachinery industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe FarmAndHeavyConstructionMachinery(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-FarmAndHeavyConstructionMachinery\", SecurityType.Equity, Market.USA), \"constituents-universe-FarmAndHeavyConstructionMachinery\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar IndustrialDistribution industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe IndustrialDistribution(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-IndustrialDistribution\", SecurityType.Equity, Market.USA), \"constituents-universe-IndustrialDistribution\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar IndustrialProducts industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe IndustrialProducts(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-IndustrialProducts\", SecurityType.Equity, Market.USA), \"constituents-universe-IndustrialProducts\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Transportation industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Transportation(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Transportation\", SecurityType.Equity, Market.USA), \"constituents-universe-Transportation\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar WasteManagement industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe WasteManagement(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-WasteManagement\", SecurityType.Equity, Market.USA), \"constituents-universe-WasteManagement\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Software industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Software(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Software\", SecurityType.Equity, Market.USA), \"constituents-universe-Software\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Hardware industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Hardware(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Hardware\", SecurityType.Equity, Market.USA), \"constituents-universe-Hardware\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Morningstar Semiconductors industry group <see cref=\"MorningstarIndustryGroupCode\"/>\n        /// </summary>\n        public Universe Semiconductors(UniverseSettings universeSettings = null)\n        {\n            return new ConstituentsUniverse(\n                new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\"constituents-universe-Semiconductors\", SecurityType.Equity, Market.USA), \"constituents-universe-Semiconductors\"),\n                universeSettings ?? _algorithm.UniverseSettings);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstituentUniverseDefinitions\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for obtaining the default <see cref=\"UniverseSettings\"/></param>\n        public ConstituentUniverseDefinitions(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/DollarVolumeUniverseDefinitions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing MathNet.Numerics.Statistics;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm\n{\n    /// <summary>\n    /// Provides helpers for defining universes based on the daily dollar volume\n    /// </summary>\n    public class DollarVolumeUniverseDefinitions\n    {\n        private readonly QCAlgorithm _algorithm;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DollarVolumeUniverseDefinitions\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for obtaining the default <see cref=\"UniverseSettings\"/></param>\n        public DollarVolumeUniverseDefinitions(QCAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n        }\n\n        /// <summary>\n        /// Creates a new coarse <see cref=\"Universe\"/> that contains the top count of stocks\n        /// by daily dollar volume\n        /// </summary>\n        /// <param name=\"count\">The number of stock to select</param>\n        /// <param name=\"universeSettings\">The settings for stocks added by this universe.\n        /// Defaults to <see cref=\"QCAlgorithm.UniverseSettings\"/></param>\n        /// <returns>A new coarse universe for the top count of stocks by dollar volume</returns>\n        [Obsolete(\"This method is deprecated. Use method `Universe.Top(...)` instead\")]\n        public Universe Top(int count, UniverseSettings universeSettings = null)\n        {\n            return _algorithm.Universe.Top(count, universeSettings);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Execution/ExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Provides a base class for execution models\n    /// </summary>\n    public class ExecutionModel : BasePythonWrapper<ExecutionModel>, IExecutionModel\n    {\n        /// <summary>\n        /// If true, orders should be submitted asynchronously.\n        /// </summary>\n        protected bool Asynchronous { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ExecutionModel\"/> class.\n        /// </summary>\n        /// <param name=\"asynchronous\">If true, orders should be submitted asynchronously</param>\n        public ExecutionModel(bool asynchronous = true)\n        {\n            Asynchronous = asynchronous;\n        }\n\n        /// <summary>\n        /// Submit orders for the specified portfolio targets.\n        /// This model is free to delay or spread out these orders as it sees fit\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets just emitted by the portfolio construction model.\n        /// These are always just the new/updated targets and not a complete set of targets</param>\n        public virtual void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            throw new System.NotImplementedException(\"Types deriving from 'ExecutionModel' must implement the 'void Execute(QCAlgorithm, IPortfolioTarget[]) method.\");\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public virtual void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n        }\n\n        /// <summary>\n        /// New order event handler\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"orderEvent\">Order event to process</param>\n        public virtual void OnOrderEvent(QCAlgorithm algorithm, OrderEvent orderEvent)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Execution/ExecutionModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Python;\nusing System;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IExecutionModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class ExecutionModelPythonWrapper : ExecutionModel\n    {\n        private readonly bool _onOrderEventsDefined;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"IExecutionModel\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Model defining how to execute trades to reach a portfolio target</param>\n        public ExecutionModelPythonWrapper(PyObject model)\n        {\n            SetPythonInstance(model, false);\n            foreach (var attributeName in new[] { \"Execute\", \"OnSecuritiesChanged\" })\n            {\n                if (!HasAttr(attributeName))\n                {\n                    throw new NotImplementedException($\"IExecutionModel.{attributeName} must be implemented. Please implement this missing method on {model.GetPythonType()}\");\n                }\n            }\n\n            _onOrderEventsDefined = HasAttr(\"OnOrderEvent\");\n\n            var methodName = nameof(SetPythonInstance);\n            if (HasAttr(methodName))\n            {\n                InvokeMethod(methodName, model);\n            }\n        }\n\n        /// <summary>\n        /// Submit orders for the specified portfolio targets.\n        /// This model is free to delay or spread out these orders as it sees fit\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets to be ordered</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            InvokeMethod(nameof(Execute), algorithm, targets).Dispose();\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            InvokeMethod(nameof(OnSecuritiesChanged), algorithm, changes).Dispose();\n        }\n\n        /// <summary>\n        /// New order event handler\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"orderEvent\">Order event to process</param>\n        public override void OnOrderEvent(QCAlgorithm algorithm, OrderEvent orderEvent)\n        {\n            if (_onOrderEventsDefined)\n            {\n                InvokeMethod(nameof(OnOrderEvent), algorithm, orderEvent).Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Execution/IExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Algorithm framework model that executes portfolio targets\n    /// </summary>\n    public interface IExecutionModel : INotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Submit orders for the specified portfolio targets.\n        /// This model is free to delay or spread out these orders as it sees fit\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets just emitted by the portfolio construction model.\n        /// These are always just the new/updated targets and not a complete set of targets</param>\n        void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets);\n\n        /// <summary>\n        /// New order event handler\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"orderEvent\">Order event to process</param>\n        void OnOrderEvent(QCAlgorithm algorithm, OrderEvent orderEvent);\n    }\n}\n"
  },
  {
    "path": "Algorithm/Execution/ImmediateExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IExecutionModel\"/> that immediately submits\n    /// market orders to achieve the desired portfolio targets\n    /// </summary>\n    public class ImmediateExecutionModel : ExecutionModel\n    {\n        private readonly PortfolioTargetCollection _targetsCollection = new PortfolioTargetCollection();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ImmediateExecutionModel\"/> class.\n        /// </summary>\n        /// <param name=\"asynchronous\">If true, orders will be submitted asynchronously</param>\n        public ImmediateExecutionModel(bool asynchronous = true)\n            : base(asynchronous)\n        {\n        }\n\n        /// <summary>\n        /// Immediately submits orders for the specified portfolio targets.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets to be ordered</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            _targetsCollection.AddRange(targets);\n            // for performance we if empty, OrderByMarginImpact and ClearFulfilled are expensive to call\n            if (!_targetsCollection.IsEmpty)\n            {\n                foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                {\n                    var security = algorithm.Securities[target.Symbol];\n\n                    // calculate remaining quantity to be ordered\n                    var quantity = OrderSizing.GetUnorderedQuantity(algorithm, target, security, true);\n\n                    if (quantity != 0)\n                    {\n                        if (security.BuyingPowerModel.AboveMinimumOrderMarginPortfolioPercentage(security, quantity,\n                            algorithm.Portfolio, algorithm.Settings.MinimumOrderMarginPortfolioPercentage))\n                        {\n                            algorithm.MarketOrder(security, quantity, Asynchronous, target.Tag);\n                        }\n                        else if (!PortfolioTarget.MinimumOrderMarginPercentageWarningSent.HasValue)\n                        {\n                            // will trigger the warning if it has not already been sent\n                            PortfolioTarget.MinimumOrderMarginPercentageWarningSent = false;\n                        }\n                    }\n                }\n\n                _targetsCollection.ClearFulfilled(algorithm);\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Execution/ImmediateExecutionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass ImmediateExecutionModel(ExecutionModel):\n    '''Provides an implementation of IExecutionModel that immediately submits market orders to achieve the desired portfolio targets'''\n\n    def __init__(self, asynchronous=True):\n        '''Initializes a new instance of the ImmediateExecutionModel class.\n        Args:\n            asynchronous: If True, orders will be submitted asynchronously.'''\n        super().__init__(asynchronous)\n        self.targets_collection = PortfolioTargetCollection()\n\n    def execute(self, algorithm, targets):\n        '''Immediately submits orders for the specified portfolio targets.\n        Args:\n            algorithm: The algorithm instance\n            targets: The portfolio targets to be ordered'''\n        # for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n        self.targets_collection.add_range(targets)\n        if not self.targets_collection.is_empty:\n            for target in self.targets_collection.order_by_margin_impact(algorithm):\n                security = algorithm.securities[target.symbol]\n                # calculate remaining quantity to be ordered\n                quantity = OrderSizing.get_unordered_quantity(algorithm, target, security, True)\n\n                if quantity != 0:\n                    above_minimum_portfolio = BuyingPowerModelExtensions.above_minimum_order_margin_portfolio_percentage(\n                        security.buying_power_model,\n                        security,\n                        quantity,\n                        algorithm.portfolio,\n                        algorithm.settings.minimum_order_margin_portfolio_percentage)\n                    if above_minimum_portfolio:\n                        algorithm.market_order(security, quantity, self.asynchronous, target.tag)\n                    elif not PortfolioTarget.minimum_order_margin_percentage_warning_sent:\n                        # will trigger the warning if it has not already been sent\n                        PortfolioTarget.minimum_order_margin_percentage_warning_sent = False\n\n            self.targets_collection.clear_fulfilled(algorithm)\n"
  },
  {
    "path": "Algorithm/Execution/NullExecutionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IExecutionModel\"/> that does nothing\n    /// </summary>\n    public class NullExecutionModel : ExecutionModel\n    {\n        /// <summary>\n        /// Execute the ExecutionModel\n        /// </summary>\n        /// <param name=\"algorithm\">The Algorithm to execute this model on</param>\n        /// <param name=\"targets\">The portfolio targets</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            // NOP\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Execution/NullExecutionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass NullExecutionModel(ExecutionModel):\n    '''Provides an implementation of IExecutionModel that does nothing'''\n    def execute(self, algorithm, targets):\n        pass\n"
  },
  {
    "path": "Algorithm/INotifiedSecurityChanges.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework\n{\n    /// <summary>\n    /// Types implementing this interface will be called when the algorithm's set of securities changes\n    /// </summary>\n    public interface INotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes);\n    }\n}\n"
  },
  {
    "path": "Algorithm/Portfolio/IPortfolioConstructionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Algorithm framework model that\n    /// </summary>\n    public interface IPortfolioConstructionModel : INotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Create portfolio targets from the specified insights\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <returns>An enumerable of portfolio targets to be sent to the execution model</returns>\n        IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights);\n    }\n}\n"
  },
  {
    "path": "Algorithm/Portfolio/IPortfolioOptimizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Interface for portfolio optimization algorithms\n    /// </summary>\n    public interface IPortfolioOptimizer\n    {\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Array of double with the portfolio annualized expected returns (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null);\n    }\n}"
  },
  {
    "path": "Algorithm/Portfolio/NullPortfolioConstructionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that does nothing\n    /// </summary>\n    public class NullPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        /// <summary>\n        /// Create Targets; Does nothing in this implementation and returns an empty IEnumerable\n        /// </summary>\n        /// <returns>Empty IEnumerable of <see cref=\"IPortfolioTarget\"/>s</returns>\n        public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n        {\n            return Enumerable.Empty<IPortfolioTarget>();\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Portfolio/NullPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass NullPortfolioConstructionModel(PortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that does nothing'''\n    def create_targets(self, algorithm, insights):\n        return []\n"
  },
  {
    "path": "Algorithm/Portfolio/PortfolioBias.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Specifies the bias of the portfolio (Short, Long/Short, Long) \n    /// </summary>\n    public enum PortfolioBias\n    {\n        /// <summary>\n        /// Portfolio can only have short positions (-1)\n        /// </summary>\n        Short = -1,\n\n        /// <summary>\n        /// Portfolio can have both long and short positions (0)\n        /// </summary>\n        LongShort = 0,\n\n        /// <summary>\n        /// Portfolio can only have long positions (1)\n        /// </summary>\n        Long = 1\n    }\n}"
  },
  {
    "path": "Algorithm/Portfolio/PortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides a base class for portfolio construction models\n    /// </summary>\n    public class PortfolioConstructionModel : IPortfolioConstructionModel\n    {\n        private Func<DateTime, DateTime?> _rebalancingFunc;\n        private DateTime? _rebalancingTime;\n        private bool _securityChanges;\n\n        /// <summary>\n        /// True if should rebalance portfolio on security changes. True by default\n        /// </summary>\n        public virtual bool RebalanceOnSecurityChanges { get; set; } = true;\n\n        /// <summary>\n        /// True if should rebalance portfolio on new insights or expiration of insights. True by default\n        /// </summary>\n        public virtual bool RebalanceOnInsightChanges { get; set; } = true;\n\n        /// <summary>\n        /// The algorithm instance\n        /// </summary>\n        protected IAlgorithm Algorithm { get; private set; }\n\n        /// <summary>\n        /// This is required due to a limitation in PythonNet to resolved overriden methods.\n        /// When Python calls a C# method that calls a method that's overriden in python it won't\n        /// run the python implementation unless the call is performed through python too.\n        /// </summary>\n        protected PortfolioConstructionModelPythonWrapper PythonWrapper { get; set; }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"PortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        public PortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc)\n        {\n            _rebalancingFunc = rebalancingFunc;\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"PortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        public PortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc = null)\n        : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null)\n        {\n        }\n\n        /// <summary>\n        /// Used to set the <see cref=\"PortfolioConstructionModelPythonWrapper\"/> instance if any\n        /// </summary>\n        protected void SetPythonWrapper(PortfolioConstructionModelPythonWrapper pythonWrapper)\n        {\n            PythonWrapper = pythonWrapper;\n        }\n\n        /// <summary>\n        /// Create portfolio targets from the specified insights\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <returns>An enumerable of portfolio targets to be sent to the execution model</returns>\n        public virtual IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n        {\n            Algorithm = algorithm;\n\n            if (!(PythonWrapper?.IsRebalanceDue(insights, algorithm.UtcTime)\n                  ?? IsRebalanceDue(insights, algorithm.UtcTime)))\n            {\n                return Enumerable.Empty<IPortfolioTarget>();\n            }\n\n            var targets = new List<IPortfolioTarget>();\n\n            var lastActiveInsights = PythonWrapper?.GetTargetInsights()\n                                                 ?? GetTargetInsights();\n\n            var errorSymbols = new HashSet<Symbol>();\n\n            // Determine target percent for the given insights\n            var percents = PythonWrapper?.DetermineTargetPercent(lastActiveInsights)\n                           ?? DetermineTargetPercent(lastActiveInsights);\n\n            foreach (var insight in lastActiveInsights)\n            {\n                if (!percents.TryGetValue(insight, out var percent))\n                {\n                    continue;\n                }\n\n                var target = PortfolioTarget.Percent(algorithm, insight.Symbol, percent);\n                if (target != null)\n                {\n                    targets.Add(target);\n                }\n                else\n                {\n                    errorSymbols.Add(insight.Symbol);\n                }\n            }\n\n            // Get expired insights and create flatten targets for each symbol\n            var expiredInsights = Algorithm.Insights.RemoveExpiredInsights(algorithm.UtcTime);\n\n            var expiredTargets = from insight in expiredInsights\n                                                          group insight.Symbol by insight.Symbol into g\n                                                          where !Algorithm.Insights.HasActiveInsights(g.Key, algorithm.UtcTime) && !errorSymbols.Contains(g.Key)\n                                                          select new PortfolioTarget(g.Key, 0);\n\n            targets.AddRange(expiredTargets);\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public virtual void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            Algorithm ??= algorithm;\n\n            _securityChanges = changes != SecurityChanges.None;\n            // Get removed symbol and invalidate them in the insight collection\n            var removedSymbols = changes.RemovedSecurities.Select(x => x.Symbol);\n            algorithm?.Insights.Expire(removedSymbols);\n        }\n\n        /// <summary>\n        /// Gets the target insights to calculate a portfolio target percent for\n        /// </summary>\n        /// <returns>An enumerable of the target insights</returns>\n        protected virtual List<Insight> GetTargetInsights()\n        {\n            // Validate we should create a target for this insight\n            bool IsValidInsight(Insight insight) => PythonWrapper?.ShouldCreateTargetForInsight(insight)\n                ?? ShouldCreateTargetForInsight(insight);\n\n            // Get insight that haven't expired of each symbol that is still in the universe\n            var activeInsights = Algorithm.Insights.GetActiveInsights(Algorithm.UtcTime).Where(IsValidInsight);\n\n            // Get the last generated active insight for each symbol\n            return (from insight in activeInsights\n                group insight by insight.Symbol into g\n                select g.OrderBy(x => x.GeneratedTimeUtc).Last()).ToList();\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected virtual bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected virtual Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            throw new NotImplementedException(\"Types deriving from 'PortfolioConstructionModel' must implement the 'Dictionary<Insight, double> DetermineTargetPercent(ICollection<Insight>)' method.\");\n        }\n\n        /// <summary>\n        /// Python helper method to set the rebalancing function.\n        /// This is required due to a python net limitation not being able to use the base type constructor, and also because\n        /// when python algorithms use C# portfolio construction models, it can't convert python methods into func nor resolve\n        /// the correct constructor for the date rules, timespan parameter.\n        /// For performance we prefer python algorithms using the C# implementation\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        protected void SetRebalancingFunc(PyObject rebalance)\n        {\n            IDateRule dateRules;\n            TimeSpan timeSpan;\n            if (rebalance.TryConvert(out dateRules))\n            {\n                _rebalancingFunc = dateRules.ToFunc();\n            }\n            else if (!rebalance.TrySafeAs(out _rebalancingFunc))\n            {\n                try\n                {\n                    using (Py.GIL())\n                    {\n                        // try convert does not work for timespan\n                        timeSpan = rebalance.As<TimeSpan>();\n                        if (timeSpan != default(TimeSpan))\n                        {\n                            _rebalancingFunc = time => time.Add(timeSpan);\n                        }\n                    }\n                }\n                catch\n                {\n                    _rebalancingFunc = null;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if the portfolio should be rebalanced base on the provided rebalancing func,\n        /// if any security change have been taken place or if an insight has expired or a new insight arrived\n        /// If the rebalancing function has not been provided will return true.\n        /// </summary>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <param name=\"algorithmUtc\">The current algorithm UTC time</param>\n        /// <returns>True if should rebalance</returns>\n        protected virtual bool IsRebalanceDue(Insight[] insights, DateTime algorithmUtc)\n        {\n            // if there is no rebalance func set, just return true but refresh state\n            // just in case the rebalance func is going to be set.\n            if (_rebalancingFunc == null)\n            {\n                RefreshRebalance(algorithmUtc);\n                return true;\n            }\n\n            // we always get the next expiry time\n            // we don't know if a new insight was added or removed\n            var nextInsightExpiryTime = Algorithm.Insights.GetNextExpiryTime();\n\n            if (_rebalancingTime == null)\n            {\n                _rebalancingTime = _rebalancingFunc(algorithmUtc);\n\n                if (_rebalancingTime != null && _rebalancingTime <= algorithmUtc)\n                {\n                    // if the rebalancing time stopped being null and is current time\n                    // we will ask for the next rebalance time in the next loop.\n                    // we don't want to call the '_rebalancingFunc' twice in the same loop,\n                    // since its internal state machine will probably be in the same state.\n                    _rebalancingTime = null;\n                    _securityChanges = false;\n                    return true;\n                }\n            }\n\n            if (_rebalancingTime != null && _rebalancingTime <= algorithmUtc\n                || RebalanceOnSecurityChanges && _securityChanges\n                || RebalanceOnInsightChanges\n                    && (insights.Length != 0\n                        || nextInsightExpiryTime != null && nextInsightExpiryTime < algorithmUtc))\n            {\n                RefreshRebalance(algorithmUtc);\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Refresh the next rebalance time and clears the security changes flag\n        /// </summary>\n        protected void RefreshRebalance(DateTime algorithmUtc)\n        {\n            if (_rebalancingFunc != null)\n            {\n                _rebalancingTime = _rebalancingFunc(algorithmUtc);\n            }\n            _securityChanges = false;\n        }\n\n        /// <summary>\n        /// Helper class that can be used by the different <see cref=\"IPortfolioConstructionModel\"/>\n        /// implementations to filter <see cref=\"Insight\"/> instances with an invalid\n        /// <see cref=\"Insight.Magnitude\"/> value based on the <see cref=\"IAlgorithmSettings\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"insights\">The insight collection to filter</param>\n        /// <returns>Returns a new array of insights removing invalid ones</returns>\n        protected static Insight[] FilterInvalidInsightMagnitude(IAlgorithm algorithm, Insight[] insights)\n        {\n            var result = insights.Where(insight =>\n            {\n                if (!insight.Magnitude.HasValue || insight.Magnitude == 0)\n                {\n                    return true;\n                }\n\n                var absoluteMagnitude = Math.Abs(insight.Magnitude.Value);\n                if (absoluteMagnitude > (double)algorithm.Settings.MaxAbsolutePortfolioTargetPercentage\n                    || absoluteMagnitude < (double)algorithm.Settings.MinAbsolutePortfolioTargetPercentage)\n                {\n                    algorithm.Error(\"PortfolioConstructionModel.FilterInvalidInsightMagnitude():\" +\n                        $\"The insight target Magnitude: {insight.Magnitude}, will not comply with the current \" +\n                        $\"'Algorithm.Settings' 'MaxAbsolutePortfolioTargetPercentage': {algorithm.Settings.MaxAbsolutePortfolioTargetPercentage}\" +\n                        $\" or 'MinAbsolutePortfolioTargetPercentage': {algorithm.Settings.MinAbsolutePortfolioTargetPercentage}. Skipping insight.\"\n                    );\n                    return false;\n                }\n\n                return true;\n            });\n            return result.ToArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Portfolio/PortfolioConstructionModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class PortfolioConstructionModelPythonWrapper : PortfolioConstructionModel\n    {\n        private readonly BasePythonWrapper<PortfolioConstructionModel> _model;\n        private readonly bool _implementsDetermineTargetPercent;\n\n        /// <summary>\n        /// True if should rebalance portfolio on security changes. True by default\n        /// </summary>\n        public override bool RebalanceOnSecurityChanges\n        {\n            get\n            {\n                return _model.GetProperty<bool>(nameof(RebalanceOnSecurityChanges));\n            }\n            set\n            {\n                _model.SetProperty(nameof(RebalanceOnSecurityChanges), value);\n            }\n        }\n\n        /// <summary>\n        /// True if should rebalance portfolio on new insights or expiration of insights. True by default\n        /// </summary>\n        public override bool RebalanceOnInsightChanges\n        {\n            get\n            {\n                return _model.GetProperty<bool>(nameof(RebalanceOnInsightChanges));\n            }\n            set\n            {\n                _model.SetProperty(nameof(RebalanceOnInsightChanges), value);\n            }\n        }\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"IPortfolioConstructionModel\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Model defining how to build a portfolio from alphas</param>\n        public PortfolioConstructionModelPythonWrapper(PyObject model)\n        {\n            _model = new BasePythonWrapper<PortfolioConstructionModel>(model, false);\n            using (Py.GIL())\n            {\n                foreach (var attributeName in new[] { \"CreateTargets\", \"OnSecuritiesChanged\" })\n                {\n                    if (!_model.HasAttr(attributeName))\n                    {\n                        throw new NotImplementedException($\"IPortfolioConstructionModel.{attributeName} must be implemented. Please implement this missing method on {model.GetPythonType()}\");\n                    }\n                }\n\n                _model.InvokeVoidMethod(nameof(SetPythonWrapper), this);\n\n                _implementsDetermineTargetPercent = model.GetPythonMethod(\"DetermineTargetPercent\") != null;\n            }\n        }\n\n        /// <summary>\n        /// Create portfolio targets from the specified insights\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <returns>An enumerable of portfolio targets to be sent to the execution model</returns>\n        public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n        {\n            return _model.InvokeMethodAndEnumerate<IPortfolioTarget>(nameof(CreateTargets), algorithm, insights);\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            _model.InvokeVoidMethod(nameof(OnSecuritiesChanged), algorithm, changes);\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return _model.InvokeMethod<bool>(nameof(ShouldCreateTargetForInsight), insight);\n        }\n\n        /// <summary>\n        /// Determines if the portfolio should be rebalanced base on the provided rebalancing func,\n        /// if any security change have been taken place or if an insight has expired or a new insight arrived\n        /// If the rebalancing function has not been provided will return true.\n        /// </summary>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <param name=\"algorithmUtc\">The current algorithm UTC time</param>\n        /// <returns>True if should rebalance</returns>\n        protected override bool IsRebalanceDue(Insight[] insights, DateTime algorithmUtc)\n        {\n            return _model.InvokeMethod<bool>(nameof(IsRebalanceDue), insights, algorithmUtc);\n        }\n\n        /// <summary>\n        /// Gets the target insights to calculate a portfolio target percent for\n        /// </summary>\n        /// <returns>An enumerable of the target insights</returns>\n        protected override List<Insight> GetTargetInsights()\n        {\n            return _model.InvokeMethod<List<Insight>>(nameof(GetTargetInsights));\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            if (!_implementsDetermineTargetPercent)\n            {\n                // the implementation is in C#\n                return _model.InvokeMethod<Dictionary<Insight, double>>(nameof(DetermineTargetPercent), activeInsights);\n            }\n\n            return _model.InvokeMethodAndGetDictionary<Insight, double>(nameof(DetermineTargetPercent), activeInsights);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Algorithm\")]\n[assembly: AssemblyProduct(\"QuantConnect.Algorithm\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"5396be58-69fe-437e-8dd1-92c2aa7e9f14\")]"
  },
  {
    "path": "Algorithm/QCAlgorithm.Framework.Python.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        /// <summary>\n        /// Sets the alpha model\n        /// </summary>\n        /// <param name=\"alpha\">Model that generates alpha</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void SetAlpha(PyObject alpha)\n        {\n            Alpha = PythonUtil.CreateInstanceOrWrapper<IAlphaModel>(\n                alpha,\n                py => new AlphaModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Adds a new alpha model\n        /// </summary>\n        /// <param name=\"alpha\">Model that generates alpha to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void AddAlpha(PyObject alpha)\n        {\n            var model = PythonUtil.CreateInstanceOrWrapper<IAlphaModel>(\n                alpha,\n                py => new AlphaModelPythonWrapper(py)\n            );\n            AddAlpha(model);\n        }\n\n        /// <summary>\n        /// Sets the execution model\n        /// </summary>\n        /// <param name=\"execution\">Model defining how to execute trades to reach a portfolio target</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetExecution(PyObject execution)\n        {\n            Execution = PythonUtil.CreateInstanceOrWrapper<IExecutionModel>(\n                execution,\n                py => new ExecutionModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the portfolio construction model\n        /// </summary>\n        /// <param name=\"portfolioConstruction\">Model defining how to build a portfolio from alphas</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetPortfolioConstruction(PyObject portfolioConstruction)\n        {\n            PortfolioConstruction = PythonUtil.CreateInstanceOrWrapper<IPortfolioConstructionModel>(\n                portfolioConstruction,\n                py => new PortfolioConstructionModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the universe selection model\n        /// </summary>\n        /// <param name=\"universeSelection\">Model defining universes for the algorithm</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(Universes)]\n        public void SetUniverseSelection(PyObject universeSelection)\n        {\n            UniverseSelection = PythonUtil.CreateInstanceOrWrapper<IUniverseSelectionModel>(\n                universeSelection,\n                py => new UniverseSelectionModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Adds a new universe selection model\n        /// </summary>\n        /// <param name=\"universeSelection\">Model defining universes for the algorithm to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(Universes)]\n        public void AddUniverseSelection(PyObject universeSelection)\n        {\n            var model = PythonUtil.CreateInstanceOrWrapper<IUniverseSelectionModel>(\n                universeSelection,\n                py => new UniverseSelectionModelPythonWrapper(py)\n            );\n            AddUniverseSelection(model);\n        }\n\n        /// <summary>\n        /// Sets the risk management model\n        /// </summary>\n        /// <param name=\"riskManagement\">Model defining how risk is managed</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetRiskManagement(PyObject riskManagement)\n        {\n            RiskManagement = PythonUtil.CreateInstanceOrWrapper<IRiskManagementModel>(\n                riskManagement,\n                py => new RiskManagementModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Adds a new risk management model\n        /// </summary>\n        /// <param name=\"riskManagement\">Model defining how risk is managed to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void AddRiskManagement(PyObject riskManagement)\n        {\n            var model = PythonUtil.CreateInstanceOrWrapper<IRiskManagementModel>(\n                riskManagement,\n                py => new RiskManagementModelPythonWrapper(py)\n            );\n            AddRiskManagement(model);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Framework.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        // this is so that later during 'UniverseSelection.CreateUniverses' we wont remove the user universes from the UniverseManager\n        private readonly HashSet<Symbol> _universeSelectionUniverses = new ();\n        private bool _isEmitWarmupInsightWarningSent;\n        private bool _isEmitDelistedInsightWarningSent;\n\n        /// <summary>\n        /// Enables additional logging of framework models including:\n        /// All insights, portfolio targets, order events, and any risk management altered targets\n        /// </summary>\n        [DocumentationAttribute(Logging)]\n        public bool DebugMode { get; set; }\n\n        /// <summary>\n        /// Gets or sets the universe selection model.\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public IUniverseSelectionModel UniverseSelection { get; set; }\n\n        /// <summary>\n        /// Gets or sets the alpha model\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public IAlphaModel Alpha { get; set; }\n\n        /// <summary>\n        /// Gets the insight manager\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public InsightManager Insights { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the portfolio construction model\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public IPortfolioConstructionModel PortfolioConstruction { get; set; }\n\n        /// <summary>\n        /// Gets or sets the execution model\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public IExecutionModel Execution { get; set; }\n\n        /// <summary>\n        /// Gets or sets the risk management model\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public IRiskManagementModel RiskManagement { get; set; }\n\n        /// <summary>\n        /// Called by setup handlers after <see cref=\"Initialize\"/> and allows the algorithm a chance to organize\n        /// the data gather in the <see cref=\"Initialize\"/> method\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void FrameworkPostInitialize()\n        {\n            foreach (var universe in UniverseSelection.CreateUniverses(this))\n            {\n                AddUniverse(universe);\n                _universeSelectionUniverses.Add(universe.Configuration.Symbol);\n            }\n\n            if (DebugMode)\n            {\n                InsightsGenerated += (algorithm, data) => Log($\"{Time}: {string.Join(\" | \", data.Insights.OrderBy(i => i.Symbol.ToString()))}\");\n            }\n        }\n\n        /// <summary>\n        /// Used to send data updates to algorithm framework models\n        /// </summary>\n        /// <param name=\"slice\">The current data <see cref=\"Slice\"/></param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(HandlingData)]\n        public void OnFrameworkData(Slice slice)\n        {\n            if (UtcTime >= UniverseSelection.GetNextRefreshTimeUtc())\n            {\n                // remove deselected universes by symbol before we create new universes\n                foreach (var ukvp in UniverseManager.Where(kvp => kvp.Value.DisposeRequested))\n                {\n                    var universeSymbol = ukvp.Key;\n                    // have to remove in the next loop after the universe is marked as disposed, when 'Dispose()' is called it will trigger universe selection\n                    // and deselect all symbols, sending the removed security changes, which are picked up by the AlgorithmManager and tags securities\n                    // as non tradable as long as they are not active in any universe (uses UniverseManager.ActiveSecurities)\n                    // but they will remain tradable if a position is still being hold since they won't be remove from the UniverseManager\n                    // but this last part will not happen if we remove the universe from the UniverseManager right away, since it won't be part of 'UniverseManager'.\n                    // And we have to remove the universe even if it's present at 'universes' because that one is another New universe that should get added!\n                    // 'UniverseManager' will skip duplicate entries getting added.\n                    UniverseManager.Remove(universeSymbol);\n                    _universeSelectionUniverses.Remove(universeSymbol);\n                }\n\n                var toRemove = new HashSet<Symbol>(_universeSelectionUniverses);\n                foreach (var universe in UniverseSelection.CreateUniverses(this))\n                {\n                    // add newly selected universes\n                    _universeSelectionUniverses.Add(universe.Configuration.Symbol);\n                    AddUniverse(universe);\n\n                    toRemove.Remove(universe.Configuration.Symbol);\n                }\n\n                // remove deselected universes by symbol but prevent removal of qc algorithm created user defined universes\n                foreach (var universeSymbol in toRemove)\n                {\n                    // mark this universe as disposed to remove all child subscriptions\n                    UniverseManager[universeSymbol].Dispose();\n                }\n            }\n\n            // update scores\n            Insights.Step(UtcTime);\n\n            // we only want to run universe selection if there's no data available in the slice\n            if (!slice.HasData)\n            {\n                return;\n            }\n\n            // insight timestamping handled via InsightsGenerated event handler\n            var insightsEnumerable = Alpha.Update(this, slice);\n            // for performance only call 'ToArray' if not empty enumerable (which is static)\n            var insights = insightsEnumerable == Enumerable.Empty<Insight>()\n                ? new Insight[] { } : insightsEnumerable.ToArray();\n\n            // only fire insights generated event if we actually have insights\n            if (insights.Length != 0)\n            {\n                insights = InitializeInsights(insights);\n                OnInsightsGenerated(insights);\n            }\n\n            ProcessInsights(insights);\n        }\n\n        /// <summary>\n        /// They different framework models will process the new provided <see cref=\"Insight\"/>.\n        /// The <see cref=\"IPortfolioConstructionModel\"/> will create targets,\n        /// the <see cref=\"IRiskManagementModel\"/> will adjust the targets\n        /// and the <see cref=\"IExecutionModel\"/> will execute the <see cref=\"IPortfolioTarget\"/>\n        /// </summary>\n        /// <param name=\"insights\">The <see cref=\"Insight\"/> to process</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        private void ProcessInsights(Insight[] insights)\n        {\n            // construct portfolio targets from insights\n            var targetsEnumerable = PortfolioConstruction.CreateTargets(this, insights);\n            // for performance only call 'ToArray' if not empty enumerable (which is static)\n            var targets = targetsEnumerable == Enumerable.Empty<IPortfolioTarget>()\n                ? new IPortfolioTarget[] { } : targetsEnumerable.ToArray();\n\n            // set security targets w/ those generated via portfolio construction module\n            foreach (var target in targets)\n            {\n                var security = Securities[target.Symbol];\n                security.Holdings.Target = target;\n            }\n\n            if (DebugMode)\n            {\n                // debug printing of generated targets\n                if (targets.Length > 0)\n                {\n                    Log($\"{Time}: PORTFOLIO: {string.Join(\" | \", targets.Select(t => t.ToString()).OrderBy(t => t))}\");\n                }\n            }\n\n            var riskTargetOverridesEnumerable = RiskManagement.ManageRisk(this, targets);\n            // for performance only call 'ToArray' if not empty enumerable (which is static)\n            var riskTargetOverrides = riskTargetOverridesEnumerable == Enumerable.Empty<IPortfolioTarget>()\n                ? new IPortfolioTarget[] { } : riskTargetOverridesEnumerable.ToArray();\n\n            // override security targets w/ those generated via risk management module\n            foreach (var target in riskTargetOverrides)\n            {\n                var security = Securities[target.Symbol];\n                security.Holdings.Target = target;\n            }\n\n            if (DebugMode)\n            {\n                // debug printing of generated risk target overrides\n                if (riskTargetOverrides.Length > 0)\n                {\n                    Log($\"{Time}: RISK: {string.Join(\" | \", riskTargetOverrides.Select(t => t.ToString()).OrderBy(t => t))}\");\n                }\n            }\n\n            IPortfolioTarget[] riskAdjustedTargets;\n            // for performance we check the length before\n            if (riskTargetOverrides.Length != 0\n                || targets.Length != 0)\n            {\n                // execute on the targets, overriding targets for symbols w/ risk targets\n                riskAdjustedTargets = riskTargetOverrides.Concat(targets).DistinctBy(pt => pt.Symbol).ToArray();\n            }\n            else\n            {\n                riskAdjustedTargets = new IPortfolioTarget[] { };\n            }\n\n            if (DebugMode)\n            {\n                // only log adjusted targets if we've performed an adjustment\n                if (riskTargetOverrides.Length > 0)\n                {\n                    Log($\"{Time}: RISK ADJUSTED TARGETS: {string.Join(\" | \", riskAdjustedTargets.Select(t => t.ToString()).OrderBy(t => t))}\");\n                }\n            }\n\n            Execution.Execute(this, riskAdjustedTargets);\n        }\n\n        /// <summary>\n        /// Used to send security changes to algorithm framework models\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(Universes)]\n        public void OnFrameworkSecuritiesChanged(SecurityChanges changes)\n        {\n            if (DebugMode)\n            {\n                Debug($\"{Time}: {changes}\");\n            }\n\n            Alpha.OnSecuritiesChanged(this, changes);\n            PortfolioConstruction.OnSecuritiesChanged(this, changes);\n            Execution.OnSecuritiesChanged(this, changes);\n            RiskManagement.OnSecuritiesChanged(this, changes);\n        }\n\n        /// <summary>\n        /// Sets the universe selection model\n        /// </summary>\n        /// <param name=\"universeSelection\">Model defining universes for the algorithm</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(Universes)]\n        public void SetUniverseSelection(IUniverseSelectionModel universeSelection)\n        {\n            UniverseSelection = universeSelection;\n        }\n\n        /// <summary>\n        /// Adds a new universe selection model\n        /// </summary>\n        /// <param name=\"universeSelection\">Model defining universes for the algorithm to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(Universes)]\n        public void AddUniverseSelection(IUniverseSelectionModel universeSelection)\n        {\n            if (UniverseSelection.GetType() != typeof(NullUniverseSelectionModel))\n            {\n                var compositeUniverseSelection = UniverseSelection as CompositeUniverseSelectionModel;\n                if (compositeUniverseSelection != null)\n                {\n                    compositeUniverseSelection.AddUniverseSelection(universeSelection);\n                }\n                else\n                {\n                    UniverseSelection = new CompositeUniverseSelectionModel(UniverseSelection, universeSelection);\n                }\n            }\n            else\n            {\n                UniverseSelection = universeSelection;\n            }\n        }\n\n        /// <summary>\n        /// Sets the alpha model\n        /// </summary>\n        /// <param name=\"alpha\">Model that generates alpha</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void SetAlpha(IAlphaModel alpha)\n        {\n            Alpha = alpha;\n        }\n\n        /// <summary>\n        /// Adds a new alpha model\n        /// </summary>\n        /// <param name=\"alpha\">Model that generates alpha to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void AddAlpha(IAlphaModel alpha)\n        {\n            if (Alpha.GetType() != typeof(NullAlphaModel))\n            {\n                var compositeAlphaModel = Alpha as CompositeAlphaModel;\n                if (compositeAlphaModel != null)\n                {\n                    compositeAlphaModel.AddAlpha(alpha);\n                }\n                else\n                {\n                    Alpha = new CompositeAlphaModel(Alpha, alpha);\n                }\n            }\n            else\n            {\n                Alpha = alpha;\n            }\n        }\n\n        /// <summary>\n        /// Sets the portfolio construction model\n        /// </summary>\n        /// <param name=\"portfolioConstruction\">Model defining how to build a portfolio from insights</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetPortfolioConstruction(IPortfolioConstructionModel portfolioConstruction)\n        {\n            PortfolioConstruction = portfolioConstruction;\n        }\n\n        /// <summary>\n        /// Sets the execution model\n        /// </summary>\n        /// <param name=\"execution\">Model defining how to execute trades to reach a portfolio target</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetExecution(IExecutionModel execution)\n        {\n            Execution = execution;\n        }\n\n        /// <summary>\n        /// Sets the risk management model\n        /// </summary>\n        /// <param name=\"riskManagement\">Model defining how risk is managed</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetRiskManagement(IRiskManagementModel riskManagement)\n        {\n            RiskManagement = riskManagement;\n        }\n\n        /// <summary>\n        /// Adds a new risk management model\n        /// </summary>\n        /// <param name=\"riskManagement\">Model defining how risk is managed to add</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public void AddRiskManagement(IRiskManagementModel riskManagement)\n        {\n            if (RiskManagement.GetType() != typeof(NullRiskManagementModel))\n            {\n                var compositeRiskModel = RiskManagement as CompositeRiskManagementModel;\n                if (compositeRiskModel != null)\n                {\n                    compositeRiskModel.AddRiskManagement(riskManagement);\n                }\n                else\n                {\n                    RiskManagement = new CompositeRiskManagementModel(RiskManagement, riskManagement);\n                }\n            }\n            else\n            {\n                RiskManagement = riskManagement;\n            }\n        }\n\n        /// <summary>\n        /// Manually emit insights from an algorithm.\n        /// This is typically invoked before calls to submit orders in algorithms written against\n        /// QCAlgorithm that have been ported into the algorithm framework.\n        /// </summary>\n        /// <param name=\"insights\">The array of insights to be emitted</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void EmitInsights(params Insight[] insights)\n        {\n            if (IsWarmingUp)\n            {\n                if (!_isEmitWarmupInsightWarningSent)\n                {\n                    Error(\"Warning: insights emitted during algorithm warmup are ignored.\");\n                    _isEmitWarmupInsightWarningSent = true;\n                }\n                return;\n            }\n\n            insights = InitializeInsights(insights);\n            OnInsightsGenerated(insights);\n            ProcessInsights(insights);\n        }\n\n        /// <summary>\n        /// Manually emit insights from an algorithm.\n        /// This is typically invoked before calls to submit orders in algorithms written against\n        /// QCAlgorithm that have been ported into the algorithm framework.\n        /// </summary>\n        /// <param name=\"insight\">The insight to be emitted</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void EmitInsights(Insight insight)\n        {\n            EmitInsights(new[] { insight });\n        }\n\n        /// <summary>\n        /// Helper method used to validate insights and prepare them to be emitted\n        /// </summary>\n        /// <param name=\"insights\">insights preparing to be emitted</param>\n        /// <returns>Validated insights</returns>\n        private Insight[] InitializeInsights(Insight[] insights)\n        {\n            List<Insight> validInsights = null;\n            for (var i = 0; i < insights.Length; i++)\n            {\n                var security = Securities[insights[i].Symbol];\n                if (security.IsDelisted)\n                {\n                    if (!_isEmitDelistedInsightWarningSent)\n                    {\n                        Error($\"QCAlgorithm.EmitInsights(): Warning: cannot emit insights for delisted securities, these will be discarded\");\n                        _isEmitDelistedInsightWarningSent = true;\n                    }\n\n                    // If this is our first invalid insight, create the list and fill it with previous values\n                    if (validInsights == null)\n                    {\n                        validInsights = new List<Insight>() {};\n                        for (var j = 0; j < i; j++)\n                        {\n                            validInsights.Add(insights[j]);\n                        }\n                    }\n                }\n                else\n                {\n                    // Initialize the insight fields\n                    insights[i] = InitializeInsightFields(insights[i], security);\n\n                    // If we already had an invalid insight, this will have been initialized storing the valid ones.\n                    if (validInsights != null)\n                    {\n                        validInsights.Add(insights[i]);\n                    }\n                }\n            }\n\n            return validInsights == null ? insights : validInsights.ToArray();\n\n        }\n\n        /// <summary>\n        /// Helper class used to set values not required to be set by alpha models\n        /// </summary>\n        /// <param name=\"insight\">The <see cref=\"Insight\"/> to set the values for</param>\n        /// <param name=\"security\">The <see cref=\"Security\"/> instance associated with this insight</param>\n        /// <returns>The same <see cref=\"Insight\"/> instance with the values set</returns>\n        private Insight InitializeInsightFields(Insight insight, Security security)\n        {\n            insight.GeneratedTimeUtc = UtcTime;\n            switch (insight.Type)\n            {\n                case InsightType.Price:\n                    insight.ReferenceValue = security.Price;\n                    break;\n                case InsightType.Volatility:\n                    insight.ReferenceValue = security.VolatilityModel.Volatility;\n                    break;\n            }\n            insight.SourceModel = string.IsNullOrEmpty(insight.SourceModel) ? Alpha.GetModelName() : insight.SourceModel;\n\n            var exchangeHours = MarketHoursDatabase.GetExchangeHours(insight.Symbol.ID.Market, insight.Symbol, insight.Symbol.SecurityType);\n            insight.SetPeriodAndCloseTime(exchangeHours);\n            return insight;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.History.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        private static readonly int SeedLookbackPeriod = Config.GetInt(\"seed-lookback-period\", 5);\n        private static readonly int SeedRetryMinuteLookbackPeriod = Config.GetInt(\"seed-retry-minute-lookback-period\", 24 * 60);\n        private static readonly int SeedRetryHourLookbackPeriod = Config.GetInt(\"seed-retry-hour-lookback-period\", 24);\n        private static readonly int SeedRetryDailyLookbackPeriod = Config.GetInt(\"seed-retry-daily-lookback-period\", 10);\n\n        private bool _dataDictionaryTickWarningSent;\n\n        /// <summary>\n        /// Gets or sets the history provider for the algorithm\n        /// </summary>\n        public IHistoryProvider HistoryProvider\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets whether or not this algorithm is still warming up\n        /// </summary>\n        [DocumentationAttribute(HistoricalData)]\n        public bool IsWarmingUp\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Sets the warm up period to the specified value\n        /// </summary>\n        /// <param name=\"timeSpan\">The amount of time to warm up, this does not take into account market hours/weekends</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmup(TimeSpan timeSpan)\n        {\n            SetWarmUp(timeSpan, null);\n        }\n\n        /// <summary>\n        /// Sets the warm up period to the specified value\n        /// </summary>\n        /// <param name=\"timeSpan\">The amount of time to warm up, this does not take into account market hours/weekends</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmUp(TimeSpan timeSpan)\n        {\n            SetWarmup(timeSpan);\n        }\n\n        /// <summary>\n        /// Sets the warm up period to the specified value\n        /// </summary>\n        /// <param name=\"timeSpan\">The amount of time to warm up, this does not take into account market hours/weekends</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmup(TimeSpan timeSpan, Resolution? resolution)\n        {\n            SetWarmup(null, timeSpan, resolution);\n        }\n\n        /// <summary>\n        /// Sets the warm up period to the specified value\n        /// </summary>\n        /// <param name=\"timeSpan\">The amount of time to warm up, this does not take into account market hours/weekends</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmUp(TimeSpan timeSpan, Resolution? resolution)\n        {\n            SetWarmup(timeSpan, resolution);\n        }\n\n        /// <summary>\n        /// Sets the warm up period by resolving a start date that would send that amount of data into\n        /// the algorithm. The highest (smallest) resolution in the securities collection will be used.\n        /// For example, if an algorithm has minute and daily data and 200 bars are requested, that would\n        /// use 200 minute bars.\n        /// </summary>\n        /// <param name=\"barCount\">The number of data points requested for warm up</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmup(int barCount)\n        {\n            SetWarmUp(barCount, null);\n        }\n\n        /// <summary>\n        /// Sets the warm up period by resolving a start date that would send that amount of data into\n        /// the algorithm. The highest (smallest) resolution in the securities collection will be used.\n        /// For example, if an algorithm has minute and daily data and 200 bars are requested, that would\n        /// use 200 minute bars.\n        /// </summary>\n        /// <param name=\"barCount\">The number of data points requested for warm up</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmUp(int barCount)\n        {\n            SetWarmup(barCount);\n        }\n\n        /// <summary>\n        /// Sets the warm up period by resolving a start date that would send that amount of data into\n        /// the algorithm.\n        /// </summary>\n        /// <param name=\"barCount\">The number of data points requested for warm up</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmup(int barCount, Resolution? resolution)\n        {\n            SetWarmup(barCount, null, resolution);\n        }\n\n        /// <summary>\n        /// Sets the warm up period by resolving a start date that would send that amount of data into\n        /// the algorithm.\n        /// </summary>\n        /// <param name=\"barCount\">The number of data points requested for warm up</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetWarmUp(int barCount, Resolution? resolution)\n        {\n            SetWarmup(barCount, resolution);\n        }\n\n        /// <summary>\n        /// Sets <see cref=\"IAlgorithm.IsWarmingUp\"/> to false to indicate this algorithm has finished its warm up\n        /// </summary>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetFinishedWarmingUp()\n        {\n            IsWarmingUp = false;\n        }\n\n        /// <summary>\n        /// Message for exception that is thrown when the implicit conversion between symbol and string fails\n        /// </summary>\n        private readonly string _symbolEmptyErrorMessage = \"Cannot create history for the given ticker. \" +\n                                                           \"Either explicitly use a symbol object to make the history request \" +\n                                                           \"or ensure the symbol has been added using the AddSecurity() method before making the history request.\";\n\n        /// <summary>\n        /// Gets the history requests required for provide warm up data for the algorithm\n        /// </summary>\n        /// <returns></returns>\n        [DocumentationAttribute(HistoricalData)]\n        private bool TryGetWarmupHistoryStartTime(out DateTime result)\n        {\n            result = Time;\n\n            if (_warmupBarCount.HasValue)\n            {\n                var symbols = Securities.Keys;\n                if (symbols.Count != 0)\n                {\n                    var startTimeUtc = CreateBarCountHistoryRequests(symbols, _warmupBarCount.Value, Settings.WarmupResolution)\n                        .DefaultIfEmpty()\n                        .Min(request => request == null ? default : request.StartTimeUtc);\n                    if (startTimeUtc != default)\n                    {\n                        result = startTimeUtc.ConvertFromUtc(TimeZone);\n                        return true;\n                    }\n                }\n\n                var defaultResolutionToUse = UniverseSettings.Resolution;\n                if (Settings.WarmupResolution.HasValue)\n                {\n                    defaultResolutionToUse = Settings.WarmupResolution.Value;\n                }\n\n                // if the algorithm has no added security, let's take a look at the universes to determine\n                // what the start date should be used. Defaulting to always open\n                result = Time - _warmupBarCount.Value * defaultResolutionToUse.ToTimeSpan();\n\n                foreach (var universe in UniverseManager.Values)\n                {\n                    var config = universe.Configuration;\n                    var resolution = universe.Configuration.Resolution;\n                    if (Settings.WarmupResolution.HasValue)\n                    {\n                        resolution = Settings.WarmupResolution.Value;\n                    }\n                    var exchange = MarketHoursDatabase.GetExchangeHours(config);\n                    var start = _historyRequestFactory.GetStartTimeAlgoTz(config.Symbol, _warmupBarCount.Value, resolution, exchange, config.DataTimeZone, config.Type);\n                    // we choose the min start\n                    result = result < start ? result : start;\n                }\n                return true;\n            }\n            if (_warmupTimeSpan.HasValue)\n            {\n                result = Time - _warmupTimeSpan.Value;\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Get the history for all configured securities over the requested span.\n        /// This will use the resolution and other subscription settings for each security.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"span\">The span over which to request data. This is a calendar span, so take into consideration weekends and such</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing data over the most recent span for all configured securities</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(TimeSpan span, Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            return History(Securities.Keys, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Get the history for all configured securities over the requested span.\n        /// This will use the resolution and other subscription settings for each security.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing data over the most recent span for all configured securities</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(int periods, Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            return History(Securities.Keys, periods, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Get the history for all configured securities over the requested span.\n        /// This will use the resolution and other subscription settings for each security.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"universe\">The universe to fetch the data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing data over the most recent span for all configured securities</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<BaseDataCollection> History(Universe universe, int periods, Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            var symbols = new[] { universe.Configuration.Symbol };\n            resolution ??= universe.Configuration.Resolution;\n            CheckPeriodBasedHistoryRequestResolution(symbols, resolution, universe.Configuration.Type);\n            var requests = CreateBarCountHistoryRequests(symbols, universe.Configuration.Type, periods, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<BaseDataCollection>(requests).Select(x => x.Values.Single());\n        }\n\n        /// <summary>\n        /// Gets the historical data for all symbols of the requested type over the requested span.\n        /// The symbol's configured values for resolution and fill forward behavior will be used\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"universe\">The universe to fetch the data for</param>\n        /// <param name=\"span\">The span over which to request data. This is a calendar span, so take into consideration weekends and such</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<BaseDataCollection> History(Universe universe, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            return History(universe, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"universe\">The universe to fetch the data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<BaseDataCollection> History(Universe universe, DateTime start, DateTime end, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            resolution ??= universe.Configuration.Resolution;\n            var requests = CreateDateRangeHistoryRequests(new[] { universe.Symbol }, universe.DataType, start, end, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<BaseDataCollection>(requests).Select(x => x.Values.Single());\n        }\n\n        /// <summary>\n        /// Gets the historical data for all symbols of the requested type over the requested span.\n        /// The symbol's configured values for resolution and fill forward behavior will be used\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<DataDictionary<T>> History<T>(TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            return History<T>(Securities.Keys, span, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols over the requested span.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type of the symbols</typeparam>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<DataDictionary<T>> History<T>(IEnumerable<Symbol> symbols, TimeSpan span, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            return History<T>(symbols, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols. The exact number of bars will be returned for\n        /// each symbol. This may result in some data start earlier/later than others due to when various\n        /// exchanges are open. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type of the symbols</typeparam>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<DataDictionary<T>> History<T>(IEnumerable<Symbol> symbols, int periods, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            CheckPeriodBasedHistoryRequestResolution(symbols, resolution, typeof(T));\n            var requests = CreateBarCountHistoryRequests(symbols, typeof(T), periods, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<T>(requests);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type of the symbols</typeparam>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<DataDictionary<T>> History<T>(IEnumerable<Symbol> symbols, DateTime start, DateTime end, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            var requests = CreateDateRangeHistoryRequests(symbols, typeof(T), start, end, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<T>(requests);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type of the symbol</typeparam>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<T> History<T>(Symbol symbol, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            return History<T>(symbol, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<TradeBar> History(Symbol symbol, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            if (symbol == null) throw new ArgumentException(_symbolEmptyErrorMessage);\n\n            resolution = GetResolution(symbol, resolution, typeof(TradeBar));\n            CheckPeriodBasedHistoryRequestResolution(new[] { symbol }, resolution, typeof(TradeBar));\n            var marketHours = GetMarketHours(symbol);\n            var start = _historyRequestFactory.GetStartTimeAlgoTz(symbol, periods, resolution.Value, marketHours.ExchangeHours,\n                marketHours.DataTimeZone, typeof(TradeBar), extendedMarketHours);\n\n            return History(symbol, start, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type of the symbol</typeparam>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<T> History<T>(Symbol symbol, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            resolution = GetResolution(symbol, resolution, typeof(T));\n            CheckPeriodBasedHistoryRequestResolution(new[] { symbol }, resolution, typeof(T));\n            var requests = CreateBarCountHistoryRequests(new[] { symbol }, typeof(T), periods, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<T>(requests, symbol);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol between the specified dates. The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<T> History<T>(Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n            where T : IBaseData\n        {\n            var requests = CreateDateRangeHistoryRequests(new[] { symbol }, typeof(T), start, end, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            return GetDataTypedHistory<T>(requests, symbol);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<TradeBar> History(Symbol symbol, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            return History(symbol, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<TradeBar> History(Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            var securityType = symbol.ID.SecurityType;\n            if (securityType == SecurityType.Forex || securityType == SecurityType.Cfd)\n            {\n                Error(\"Calling History<TradeBar> method on a Forex or CFD security will return an empty result. Please use the generic version with QuoteBar type parameter.\");\n            }\n\n            var resolutionToUse = resolution ?? GetResolution(symbol, resolution, typeof(TradeBar));\n            if (resolutionToUse == Resolution.Tick)\n            {\n                throw new InvalidOperationException(\"Calling History<TradeBar> method with Resolution.Tick will return an empty result.\" +\n                                                    \" Please use the generic version with Tick type parameter or provide a list of Symbols to use the Slice history request API.\");\n            }\n\n            return History(new[] { symbol }, start, end, resolutionToUse, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset).Get(symbol).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols over the requested span.\n        /// The symbol's configured values for resolution and fill forward behavior will be used\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(IEnumerable<Symbol> symbols, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            return History(symbols, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols. The exact number of bars will be returned for\n        /// each symbol. This may result in some data start earlier/later than others due to when various\n        /// exchanges are open. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(IEnumerable<Symbol> symbols, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            CheckPeriodBasedHistoryRequestResolution(symbols, resolution, null);\n            return History(CreateBarCountHistoryRequests(symbols, periods, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset)).Memoize();\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>An enumerable of slice containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(IEnumerable<Symbol> symbols, DateTime start, DateTime end, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            return History(CreateDateRangeHistoryRequests(symbols, start, end, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset)).Memoize();\n        }\n\n        /// <summary>\n        /// Executes the specified history request\n        /// </summary>\n        /// <param name=\"request\">the history request to execute</param>\n        /// <returns>An enumerable of slice satisfying the specified history request</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(HistoryRequest request)\n        {\n            return History(new[] { request }).Memoize();\n        }\n\n        /// <summary>\n        /// Executes the specified history requests\n        /// </summary>\n        /// <param name=\"requests\">the history requests to execute</param>\n        /// <returns>An enumerable of slice satisfying the specified history request</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<Slice> History(IEnumerable<HistoryRequest> requests)\n        {\n            return History(requests, TimeZone).Memoize();\n        }\n\n        /// <summary>\n        /// Yields data to warmup a security for all it's subscribed data types\n        /// </summary>\n        /// <param name=\"security\"><see cref=\"Security\"/> object for which to retrieve historical data</param>\n        /// <returns>Securities historical data</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<BaseData> GetLastKnownPrices(Security security)\n        {\n            return GetLastKnownPrices(security.Symbol);\n        }\n\n        /// <summary>\n        /// Yields data to warm up a security for all its subscribed data types\n        /// </summary>\n        /// <param name=\"symbol\">The symbol we want to get seed data for</param>\n        /// <returns>Securities historical data</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public IEnumerable<BaseData> GetLastKnownPrices(Symbol symbol)\n        {\n            if (!HistoryRequestValid(symbol) || HistoryProvider == null)\n            {\n                return Enumerable.Empty<BaseData>();\n            }\n\n            var data = GetLastKnownPrices([symbol]);\n            return data.Values.FirstOrDefault() ?? Enumerable.Empty<BaseData>();\n        }\n\n        /// <summary>\n        /// Yields data to warm up multiple securities for all their subscribed data types\n        /// </summary>\n        /// <param name=\"securities\">The securities we want to get seed data for</param>\n        /// <returns>Securities historical data</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public DataDictionary<IEnumerable<BaseData>> GetLastKnownPrices(IEnumerable<Security> securities)\n        {\n            return GetLastKnownPrices(securities.Select(s => s.Symbol));\n        }\n\n        /// <summary>\n        /// Yields data to warm up multiple securities for all their subscribed data types\n        /// </summary>\n        /// <param name=\"symbols\">The symbols we want to get seed data for</param>\n        /// <returns>Securities historical data</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public DataDictionary<IEnumerable<BaseData>> GetLastKnownPrices(IEnumerable<Symbol> symbols)\n        {\n            if (HistoryProvider == null)\n            {\n                return new DataDictionary<IEnumerable<BaseData>>();\n            }\n\n            var data = new Dictionary<(Symbol, Type, TickType), BaseData>();\n            GetLastKnownPricesImpl(symbols, data);\n\n            return data\n                .GroupBy(kvp => kvp.Key.Item1)\n                .ToDataDictionary(\n                    g => g.Key,\n                    g => g.OrderBy(kvp => kvp.Value.Time)\n                        .ThenBy(kvp => GetTickTypeOrder(kvp.Key.Item1.SecurityType, kvp.Key.Item3))\n                        .Select(kvp => kvp.Value)\n                );\n        }\n\n        /// <summary>\n        /// Get the last known price using the history provider.\n        /// Useful for seeding securities with the correct price\n        /// </summary>\n        /// <param name=\"security\"><see cref=\"Security\"/> object for which to retrieve historical data</param>\n        /// <returns>A single <see cref=\"BaseData\"/> object with the last known price</returns>\n        [Obsolete(\"This method is obsolete please use 'GetLastKnownPrices' which will return the last data point\" +\n            \" for each type associated with the requested security\")]\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public BaseData GetLastKnownPrice(Security security)\n        {\n            return GetLastKnownPrice(security.Symbol);\n        }\n\n        /// <summary>\n        /// Get the last known price using the history provider.\n        /// Useful for seeding securities with the correct price\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for which to retrieve historical data</param>\n        /// <returns>A single <see cref=\"BaseData\"/> object with the last known price</returns>\n        [Obsolete(\"This method is obsolete please use 'GetLastKnownPrices' which will return the last data point\" +\n            \" for each type associated with the requested security\")]\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HistoricalData)]\n        public BaseData GetLastKnownPrice(Symbol symbol)\n        {\n            return GetLastKnownPrices(symbol)\n                // since we are returning a single data point let's respect order\n                .OrderByDescending(data => GetTickTypeOrder(data.Symbol.SecurityType, LeanData.GetCommonTickTypeForCommonDataTypes(data.GetType(), data.Symbol.SecurityType)))\n                .LastOrDefault();\n        }\n\n        private void GetLastKnownPricesImpl(IEnumerable<Symbol> symbols, Dictionary<(Symbol, Type, TickType), BaseData> result,\n            int attempts = 0, IEnumerable<HistoryRequest> failedRequests = null)\n        {\n            IEnumerable<HistoryRequest> historyRequests;\n            var isRetry = failedRequests != null;\n\n            symbols = symbols?.Where(x => !x.IsCanonical() || x.SecurityType == SecurityType.Future);\n\n            if (attempts == 0)\n            {\n                historyRequests = CreateBarCountHistoryRequests(symbols, SeedLookbackPeriod,\n                    fillForward: false, useAllSubscriptions: true)\n                    .SelectMany(request =>\n                    {\n                        // Make open interest request daily, higher resolutions will need greater periods to return data\n                        if (request.DataType == typeof(OpenInterest) && request.Resolution < Resolution.Daily)\n                        {\n                            return CreateBarCountHistoryRequests([request.Symbol], typeof(OpenInterest), SeedLookbackPeriod,\n                                Resolution.Daily, fillForward: false, useAllSubscriptions: true);\n                        }\n\n                        if (request.Resolution < Resolution.Minute)\n                        {\n                            var dataType = request.DataType;\n                            if (dataType == typeof(Tick))\n                            {\n                                dataType = request.TickType == TickType.Trade ? typeof(TradeBar) : typeof(QuoteBar);\n                            }\n\n                            return CreateBarCountHistoryRequests([request.Symbol], dataType, SeedLookbackPeriod,\n                                Resolution.Minute, fillForward: false, useAllSubscriptions: true);\n                        }\n\n                        return [request];\n                    });\n            }\n            else if (attempts == 1)\n            {\n                // If the first attempt to get the last know price returns no data, it maybe the case of an illiquid security.\n                // We increase the look-back period for this case accordingly to the resolution to cover a longer period\n                historyRequests = failedRequests\n                    .GroupBy(request => request.Symbol)\n                    .Select(group =>\n                    {\n                        var symbolRequests = group.ToArray();\n                        var resolution = symbolRequests[0].Resolution;\n                        var periods = resolution == Resolution.Daily\n                            ? SeedRetryDailyLookbackPeriod\n                            : resolution == Resolution.Hour ? SeedRetryHourLookbackPeriod : SeedRetryMinuteLookbackPeriod;\n                        return CreateBarCountHistoryRequests([group.Key], periods, resolution, fillForward: false, useAllSubscriptions: true)\n                            .Where(request => symbolRequests.Any(x => x.DataType == request.DataType));\n                    })\n                    .SelectMany(x => x);\n            }\n            else\n            {\n                // Fall back to bigger daily requests as a last resort\n                historyRequests = CreateBarCountHistoryRequests(failedRequests.Select(x => x.Symbol).Distinct(),\n                    Math.Min(60, 5 * SeedRetryDailyLookbackPeriod), Resolution.Daily, fillForward: false, useAllSubscriptions: true);\n            }\n\n            var requests = historyRequests.ToArray();\n            if (requests.Length == 0)\n            {\n                return;\n            }\n\n            foreach (var slice in History(requests))\n            {\n                for (var i = 0; i < requests.Length; i++)\n                {\n                    var historyRequest = requests[i];\n\n                    // keep the last data point per tick type\n                    BaseData data = null;\n\n                    if (historyRequest.DataType == typeof(QuoteBar))\n                    {\n                        if (slice.QuoteBars.TryGetValue(historyRequest.Symbol, out var quoteBar))\n                        {\n                            data = quoteBar;\n                        }\n                    }\n                    else if (historyRequest.DataType == typeof(TradeBar))\n                    {\n                        if (slice.Bars.TryGetValue(historyRequest.Symbol, out var quoteBar))\n                        {\n                            data = quoteBar;\n                        }\n                    }\n                    else if (historyRequest.DataType == typeof(OpenInterest))\n                    {\n                        if (slice.Ticks.TryGetValue(historyRequest.Symbol, out var openInterests))\n                        {\n                            data = openInterests[0];\n                        }\n                    }\n                    // No Tick data, resolution is limited to Minute as minimum\n                    else\n                    {\n                        var typeData = slice.Get(historyRequest.DataType);\n                        if (typeData.ContainsKey(historyRequest.Symbol))\n                        {\n                            data = typeData[historyRequest.Symbol];\n                        }\n                    }\n\n                    if (data != null)\n                    {\n                        result[(historyRequest.Symbol, historyRequest.DataType, historyRequest.TickType)] = data;\n                    }\n                }\n            }\n\n            if (attempts < 2)\n            {\n                // Give it another try to get data for all symbols and all data types\n                GetLastKnownPricesImpl(null, result, attempts + 1,\n                    requests.Where((request, i) => !result.ContainsKey((request.Symbol, request.DataType, request.TickType))));\n            }\n        }\n\n        /// <summary>\n        /// Centralized logic to get data typed history given a list of requests for the specified symbol.\n        /// This method is used to keep backwards compatibility for those History methods that expect an ArgumentException to be thrown\n        /// when the security and the requested data type do not match\n        /// </summary>\n        /// <remarks>\n        /// This method will check for Python custom data types in order to call the right Slice.Get dynamic method\n        /// </remarks>\n        private IEnumerable<T> GetDataTypedHistory<T>(IEnumerable<HistoryRequest> requests, Symbol symbol)\n            where T : IBaseData\n        {\n            var type = typeof(T);\n\n            var historyRequests = requests.Where(x => x != null).ToList();\n            if (historyRequests.Count == 0)\n            {\n                throw new ArgumentException($\"No history data could be fetched. \" +\n                    $\"This could be due to the specified security not being of the requested type. Symbol: {symbol} Requested Type: {type.Name}\");\n            }\n\n            var slices = History(historyRequests, TimeZone);\n\n            IEnumerable<T> result = null;\n\n            // If T is a custom data coming from Python (a class derived from PythonData), T will get here as PythonData\n            // and not the actual custom type. We take care of this especial case by using a dynamic version of GetDataTypedHistory that\n            // receives the Python type, and we get it from the history requests.\n            if (type == typeof(PythonData))\n            {\n                result = GetPythonCustomDataTypeHistory(slices, historyRequests, symbol).OfType<T>();\n            }\n            // TODO: This is a patch to fix the issue with the Slice.GetImpl method returning only the last tick\n            //       for each symbol instead of the whole list of ticks.\n            //       The actual issue is Slice.GetImpl, so patch this can be removed right after it is properly addressed.\n            //       A proposed solution making the Tick class a BaseDataCollection and make the Ticks class a dictionary Symbol->Tick instead of\n            //       Symbol->List<Tick> so we can use the Slice.Get methods to collect all ticks in every slice instead of only the last one.\n            else if (type == typeof(Tick))\n            {\n                result = (IEnumerable<T>)slices.Select(x => x.Ticks).Where(x => x.ContainsKey(symbol)).SelectMany(x => x[symbol]);\n            }\n            else\n            {\n                result = slices.Get<T>(symbol);\n            }\n\n            return result.Memoize();\n        }\n\n        /// <summary>\n        /// Centralized logic to get data typed history for a given list of requests.\n        /// </summary>\n        /// <remarks>\n        /// This method will check for Python custom data types in order to call the right Slice.Get dynamic method\n        /// </remarks>\n        protected IEnumerable<DataDictionary<T>> GetDataTypedHistory<T>(IEnumerable<HistoryRequest> requests)\n            where T : IBaseData\n        {\n            var historyRequests = requests.Where(x => x != null).ToList();\n            var slices = History(historyRequests, TimeZone);\n\n            IEnumerable<DataDictionary<T>> result = null;\n\n            if (typeof(T) == typeof(PythonData))\n            {\n                result = GetPythonCustomDataTypeHistory(slices, historyRequests).OfType<DataDictionary<T>>();\n            }\n            else\n            {\n                if (typeof(T) == typeof(Tick) && !_dataDictionaryTickWarningSent)\n                {\n                    _dataDictionaryTickWarningSent = true;\n                    Debug(\"Warning: Multiple symbols Tick history will return the last tick per timestep. To access all ticks remove the 'Tick' type to use the History() returning Slice, all ticks can be accessed with Slice.Ticks.\");\n                }\n\n                if (typeof(T) == typeof(BaseDataCollection) && historyRequests[0].DataType != typeof(BaseDataCollection))\n                {\n                    result = (IEnumerable<DataDictionary<T>>)slices.GetUniverseData();\n                }\n                else\n                {\n                    result = slices.Get<T>();\n                }\n            }\n\n            return result.Memoize();\n        }\n\n        private IEnumerable<Slice> History(IEnumerable<HistoryRequest> requests, DateTimeZone timeZone)\n        {\n            // filter out any universe securities that may have made it this far\n            var filteredRequests = GetFilterestRequests(requests);\n\n            // filter out future data to prevent look ahead bias\n            var history = HistoryProvider.GetHistory(filteredRequests, timeZone);\n\n            if (PythonEngine.IsInitialized)\n            {\n                // add protection against potential python deadlocks\n                // with parallel history requests we reuse the data stack threads to serve the history calls because of this we need to make sure to release\n                // the GIL before waiting on the history request because there could be a work/job in the data stack queues which needs the GIL\n                return WrapPythonDataHistory(history);\n            }\n\n            return history;\n        }\n\n        private IEnumerable<HistoryRequest> GetFilterestRequests(IEnumerable<HistoryRequest> requests)\n        {\n            var sentMessage = false;\n            foreach (var request in requests.Where(hr => HistoryRequestValid(hr.Symbol)))\n            {\n                // prevent future requests\n                if (request.EndTimeUtc > UtcTime)\n                {\n                    var endTimeUtc = UtcTime;\n                    var startTimeUtc = request.StartTimeUtc;\n                    if (request.StartTimeUtc > request.EndTimeUtc)\n                    {\n                        startTimeUtc = request.EndTimeUtc;\n                    }\n\n                    yield return new HistoryRequest(startTimeUtc, endTimeUtc,\n                        request.DataType, request.Symbol, request.Resolution, request.ExchangeHours,\n                        request.DataTimeZone, request.FillForwardResolution, request.IncludeExtendedMarketHours,\n                        request.IsCustomData, request.DataNormalizationMode, request.TickType, request.DataMappingMode,\n                        request.ContractDepthOffset);\n\n                    if (!sentMessage)\n                    {\n                        sentMessage = true;\n                        Debug(\"Request for future history modified to end now.\");\n                    }\n                }\n                else\n                {\n                    yield return request;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper method to create history requests from a date range\n        /// </summary>\n        protected IEnumerable<HistoryRequest> CreateDateRangeHistoryRequests(IEnumerable<Symbol> symbols, DateTime startAlgoTz, DateTime endAlgoTz,\n            Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            // Materialize the symbols to avoid multiple enumeration\n            var symbolsArray = symbols.ToArray();\n            return CreateDateRangeHistoryRequests(\n                symbolsArray,\n                Extensions.GetCustomDataTypeFromSymbols(symbolsArray),\n                startAlgoTz,\n                endAlgoTz,\n                resolution,\n                fillForward,\n                extendedMarketHours,\n                dataMappingMode,\n                dataNormalizationMode,\n                contractDepthOffset);\n        }\n\n        /// <summary>\n        /// Helper method to create history requests from a date range with custom data type\n        /// </summary>\n        protected IEnumerable<HistoryRequest> CreateDateRangeHistoryRequests(IEnumerable<Symbol> symbols, Type requestedType, DateTime startAlgoTz, DateTime endAlgoTz,\n            Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null)\n        {\n            return symbols.Where(HistoryRequestValid).SelectMany(x =>\n            {\n                var requests = new List<HistoryRequest>();\n\n                foreach (var config in GetMatchingSubscriptions(x, requestedType, resolution))\n                {\n                    var request = _historyRequestFactory.CreateHistoryRequest(config, startAlgoTz, endAlgoTz, GetExchangeHours(x, requestedType), resolution,\n                        fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                    requests.Add(request);\n                }\n\n                return requests;\n            });\n        }\n\n        /// <summary>\n        /// Helper methods to create a history request for the specified symbols and bar count\n        /// </summary>\n        private IEnumerable<HistoryRequest> CreateBarCountHistoryRequests(IEnumerable<Symbol> symbols, int periods, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null, bool useAllSubscriptions = false)\n        {\n            // Materialize the symbols to avoid multiple enumeration\n            var symbolsArray = symbols.ToArray();\n            return CreateBarCountHistoryRequests(\n                symbolsArray,\n                Extensions.GetCustomDataTypeFromSymbols(symbolsArray),\n                periods,\n                resolution,\n                fillForward,\n                extendedMarketHours,\n                dataMappingMode,\n                dataNormalizationMode,\n                contractDepthOffset,\n                useAllSubscriptions);\n        }\n\n        /// <summary>\n        /// Helper methods to create a history request for the specified symbols and bar count with custom data type\n        /// </summary>\n        private IEnumerable<HistoryRequest> CreateBarCountHistoryRequests(IEnumerable<Symbol> symbols, Type requestedType, int periods,\n            Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null, bool useAllSubscriptions = false)\n        {\n            return symbols.Where(HistoryRequestValid).SelectMany(symbol =>\n            {\n                // Match or create configs for the symbol\n                var configs = GetMatchingSubscriptions(symbol, requestedType, resolution, useAllSubscriptions).ToList();\n                if (configs.Count == 0)\n                {\n                    return Enumerable.Empty<HistoryRequest>();\n                }\n\n                return configs.Select(config =>\n                {\n                    // If no requested type was passed, use the config type to get the resolution (if not provided) and the exchange hours\n                    var type = requestedType ?? config.Type;\n                    var res = resolution ?? config.Resolution;\n                    var exchange = GetExchangeHours(symbol, type);\n                    var start = _historyRequestFactory.GetStartTimeAlgoTz(symbol, periods, res, exchange, config.DataTimeZone,\n                        config.Type, extendedMarketHours);\n                    var end = Time;\n\n                    return _historyRequestFactory.CreateHistoryRequest(config, start, end, exchange, res, fillForward,\n                        extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                });\n            });\n        }\n\n        private int GetTickTypeOrder(SecurityType securityType, TickType tickType)\n        {\n            return SubscriptionManager.AvailableDataTypes[securityType].IndexOf(tickType);\n        }\n\n        private IEnumerable<SubscriptionDataConfig> GetMatchingSubscriptions(Symbol symbol, Type type, Resolution? resolution = null, bool useAllSubscriptions = false)\n        {\n            var subscriptions = SubscriptionManager.SubscriptionDataConfigService\n                // we add internal subscription so that history requests are covered, this allows us to warm them up too\n                .GetSubscriptionDataConfigs(symbol, includeInternalConfigs: true)\n                // find all subscriptions matching the requested type with a higher resolution than requested\n                .OrderByDescending(s => s.Resolution)\n                // lets make sure to respect the order of the data types\n                .ThenByDescending(config => GetTickTypeOrder(config.SecurityType, config.TickType));\n\n            var matchingSubscriptions = Enumerable.Empty<SubscriptionDataConfig>();\n\n            if (type == typeof(Tick))\n            {\n                // If type is Tick, don't rely on matchingSubscriptions\n                // Instead, we generate all available Tick subscriptions for the given resolution,\n                // to avoid cases where, for example with a FutureContract, only OpenInterest would match,\n                // when we actually need to generate Trade, Quote, and OpenInterest.\n                matchingSubscriptions = subscriptions.Where(s => LeanData.IsCommonLeanDataType(s.Type))\n                    .Select(s => s.Type == type ? s : new SubscriptionDataConfig(s, type, resolution: Resolution.Tick,\n                        tickType: LeanData.GetCommonTickTypeForCommonDataTypes(s.Type, s.SecurityType)));\n            }\n            else\n            {\n                // Filter subscriptions matching the requested type\n                matchingSubscriptions = subscriptions.Where(s => SubscriptionDataConfigTypeFilter(type, s.Type, filterOutOpenInterest: !useAllSubscriptions));\n            }\n\n            var internalConfig = new List<SubscriptionDataConfig>();\n            var userConfig = new List<SubscriptionDataConfig>();\n            foreach (var config in matchingSubscriptions)\n            {\n                if (config.IsInternalFeed)\n                {\n                    internalConfig.Add(config);\n                }\n                else\n                {\n                    userConfig.Add(config);\n                }\n            }\n\n            // if we have any user defined subscription configuration we use it, else we use internal ones if any\n            List<SubscriptionDataConfig> configs = null;\n            if (userConfig.Count != 0)\n            {\n                configs = userConfig;\n            }\n            if ((useAllSubscriptions || configs == null) && internalConfig.Count != 0)\n            {\n                if (configs == null)\n                {\n                    configs = internalConfig;\n                }\n                else\n                {\n                    configs.AddRange(internalConfig);\n                }\n            }\n\n            // we use the subscription manager registered configurations here, we can not rely on the Securities collection\n            // since this might be called when creating a security and warming it up\n            if (configs != null && configs.Count != 0)\n            {\n                if (resolution.HasValue && symbol.SecurityType == SecurityType.Equity)\n                {\n                    // Check if resolution is set and not Daily or Hourly for an Equity symbol\n                    if (resolution == Resolution.Daily || resolution == Resolution.Hour)\n                    {\n                        // for Daily and Hour resolution, for equities, we have to\n                        // filter out any existing subscriptions that could be of Quote type\n                        // This could happen if they were Resolution.Minute/Second/Tick\n                        return configs.Where(s => s.TickType != TickType.Quote);\n                    }\n\n                    // If no existing configuration for the Quote tick type, add the new config\n                    if ((type == null || type == typeof(Tick)) && !configs.Any(config => config.TickType == TickType.Quote))\n                    {\n                        type = LeanData.GetDataType(resolution.Value, TickType.Quote);\n                        var entry = MarketHoursDatabase.GetEntry(symbol, new[] { type });\n                        var baseFillForward = configs[0].FillDataForward;\n                        var baseExtendedMarketHours = configs[0].ExtendedMarketHours;\n\n                        // Create a new SubscriptionDataConfig\n                        var newConfig = new SubscriptionDataConfig(\n                            type,\n                            symbol,\n                            resolution.Value,\n                            entry.DataTimeZone,\n                            entry.ExchangeHours.TimeZone,\n                            baseFillForward,\n                            baseExtendedMarketHours,\n                            false, tickType: TickType.Quote);\n\n                        configs.Add(newConfig);\n\n                        // Sort the configs in descending order based on tick type\n                        return configs.OrderByDescending(config => GetTickTypeOrder(config.SecurityType, config.TickType));\n                    }\n                }\n\n                if (symbol.IsCanonical() && configs.Count > 1)\n                {\n                    // option/future (canonicals) might add in a ZipEntryName auxiliary data type used for selection, we filter it out from history requests by default\n                    return configs.Where(s => !s.Type.IsAssignableTo(typeof(BaseChainUniverseData)));\n                }\n\n                return configs;\n            }\n            else\n            {\n                // let's try to respect already added user settings, even if resolution/type don't match, like Tick vs Bars\n                var userConfigIfAny = subscriptions.FirstOrDefault(x => LeanData.IsCommonLeanDataType(x.Type) && !x.IsInternalFeed);\n\n                // Inherit values from existing subscriptions or use defaults\n                var extendedMarketHours = userConfigIfAny?.ExtendedMarketHours ?? UniverseSettings.ExtendedMarketHours;\n                var dataNormalizationMode = userConfigIfAny?.DataNormalizationMode ?? UniverseSettings.GetUniverseNormalizationModeOrDefault(symbol.SecurityType);\n                var dataMappingMode = userConfigIfAny?.DataMappingMode ?? UniverseSettings.GetUniverseMappingModeOrDefault(symbol.SecurityType, symbol.ID.Market);\n                var contractDepthOffset = userConfigIfAny?.ContractDepthOffset ?? (uint)Math.Abs(UniverseSettings.ContractDepthOffset);\n\n                // If type was specified and not a lean data type and also not abstract, we create a new subscription\n                if (type != null && !LeanData.IsCommonLeanDataType(type) && !type.IsAbstract)\n                {\n                    // we already know it's not a common lean data type\n                    var isCustom = Extensions.IsCustomDataType(symbol, type);\n                    var entry = MarketHoursDatabase.GetEntry(symbol, new[] { type });\n\n                    // Retrieve the associated data type from the universe if available, otherwise, use the provided type\n                    var dataType = UniverseManager.TryGetValue(symbol, out var universe) && type.IsAssignableFrom(universe.DataType)\n                        ? universe.DataType\n                        : type;\n\n                    // Determine resolution using the data type\n                    resolution = GetResolution(symbol, resolution, dataType);\n\n                    // we were giving a specific type let's fetch it\n                    return new[] { new SubscriptionDataConfig(\n                        dataType,\n                        symbol,\n                        resolution.Value,\n                        entry.DataTimeZone,\n                        entry.ExchangeHours.TimeZone,\n                        UniverseSettings.FillForward,\n                        extendedMarketHours,\n                        true,\n                        isCustom,\n                        LeanData.GetCommonTickTypeForCommonDataTypes(dataType, symbol.SecurityType),\n                        true,\n                        dataNormalizationMode,\n                        dataMappingMode,\n                        contractDepthOffset)};\n                }\n\n                var res = GetResolution(symbol, resolution, type);\n                return SubscriptionManager\n                    .LookupSubscriptionConfigDataTypes(symbol.SecurityType, res,\n                        // for continuous contracts, if we are given a type (or none) that's common (like trade/quote), we respect it\n                        symbol.IsCanonical() && (symbol.SecurityType != SecurityType.Future || type != null && !LeanData.IsCommonLeanDataType(type)))\n                    .Where(tuple => SubscriptionDataConfigTypeFilter(type, tuple.Item1, filterOutOpenInterest: !useAllSubscriptions))\n                    .Select(x =>\n                    {\n                        var configType = x.Item1;\n                        // Use the config type to get an accurate mhdb entry\n                        var entry = MarketHoursDatabase.GetEntry(symbol, new[] { configType });\n                        var res = GetResolution(symbol, resolution, configType);\n\n                        return new SubscriptionDataConfig(\n                            configType,\n                            symbol,\n                            res,\n                            entry.DataTimeZone,\n                            entry.ExchangeHours.TimeZone,\n                            UniverseSettings.FillForward,\n                            extendedMarketHours,\n                            true,\n                            false,\n                            x.Item2,\n                            true,\n                            dataNormalizationMode,\n                            dataMappingMode,\n                            contractDepthOffset);\n                    })\n                    // lets make sure to respect the order of the data types, if used on a history request will affect outcome when using pushthrough for example\n                    .OrderByDescending(config => GetTickTypeOrder(config.SecurityType, config.TickType));\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine if the provided config type passes the filter of the target type\n        /// </summary>\n        /// <remarks>If the target type is <see cref=\"BaseData\"/>, <see cref=\"OpenInterest\"/> config types will return false.\n        /// This is useful to filter OpenInterest by default from history requests unless it's explicitly requested</remarks>\n        private bool SubscriptionDataConfigTypeFilter(Type targetType, Type configType, bool filterOutOpenInterest = true)\n        {\n            if (targetType == null)\n            {\n                return !filterOutOpenInterest || configType != typeof(OpenInterest);\n            }\n\n            var targetIsGenericType = targetType == typeof(BaseData);\n\n            return targetType.IsAssignableFrom(configType) && (!targetIsGenericType || !filterOutOpenInterest || configType != typeof(OpenInterest));\n        }\n\n        private SecurityExchangeHours GetExchangeHours(Symbol symbol, Type type = null)\n        {\n            return GetMarketHours(symbol, type).ExchangeHours;\n        }\n\n        private MarketHoursDatabase.Entry GetMarketHours(Symbol symbol, Type type = null)\n        {\n            var hoursEntry = type != null\n                ? MarketHoursDatabase.GetEntry(symbol, new[] { type })\n                : MarketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n\n\n            // user can override the exchange hours in algorithm, i.e. HistoryAlgorithm\n            Security security;\n            if (Securities.TryGetValue(symbol, out security))\n            {\n                return new MarketHoursDatabase.Entry(hoursEntry.DataTimeZone, security.Exchange.Hours);\n            }\n\n            return hoursEntry;\n        }\n\n        private Resolution GetResolution(Symbol symbol, Resolution? resolution, Type type)\n        {\n            if (resolution != null)\n            {\n                return resolution.Value;\n            }\n\n            Resolution? result = null;\n            var hasNonInternal = false;\n            foreach (var config in SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(symbol, includeInternalConfigs: true)\n                // we process non internal configs first\n                .OrderBy(config => config.IsInternalFeed ? 1 : 0))\n            {\n                if (!config.IsInternalFeed || !hasNonInternal)\n                {\n                    // once we find a non internal config we ignore internals\n                    hasNonInternal |= !config.IsInternalFeed;\n                    if (!result.HasValue || config.Resolution < result)\n                    {\n                        result = config.Resolution;\n                    }\n                }\n            }\n\n            // if resolution is tick, type should be tick or not common, meaning should not use resolution tick with quoteBar/tradeBar/openinterest types\n            if (result != null && (result.Value != Resolution.Tick || type == typeof(Tick) || !LeanData.IsCommonLeanDataType(type)))\n            {\n                return (Resolution)result;\n            }\n            else\n            {\n                if (resolution != null)\n                {\n                    return resolution.Value;\n                }\n\n                if (type == null || LeanData.IsCommonLeanDataType(type) || type.IsAbstract)\n                {\n                    return UniverseSettings.Resolution;\n                }\n\n                try\n                {\n                    // for custom data types let's try to fetch the default resolution from the type definition\n                    var instance = type.GetBaseDataInstance();\n                    return instance.DefaultResolution();\n                }\n                catch\n                {\n                    // just in case\n                    return UniverseSettings.Resolution;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Validate a symbol for a history request.\n        /// Universe and canonical symbols are only valid for future security types\n        /// </summary>\n        private bool HistoryRequestValid(Symbol symbol)\n        {\n            return symbol.SecurityType == SecurityType.Future ||\n                symbol.SecurityType == SecurityType.Option ||\n                symbol.SecurityType == SecurityType.IndexOption ||\n                symbol.SecurityType == SecurityType.FutureOption ||\n                !symbol.IsCanonical();\n        }\n\n        /// <summary>\n        /// Will set warmup settings validating the algorithm has not finished initialization yet\n        /// </summary>\n        private void SetWarmup(int? barCount, TimeSpan? timeSpan, Resolution? resolution)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"QCAlgorithm.SetWarmup(): This method cannot be used after algorithm initialized\");\n            }\n\n            _warmupTimeSpan = timeSpan;\n            _warmupBarCount = barCount;\n            Settings.WarmupResolution = resolution;\n        }\n\n        /// <summary>\n        /// Throws if a period bases history request is made for tick resolution, which is not allowed.\n        /// </summary>\n        private void CheckPeriodBasedHistoryRequestResolution(IEnumerable<Symbol> symbols, Resolution? resolution, Type requestedType)\n        {\n            if (symbols.Any(symbol => GetResolution(symbol, resolution, requestedType) == Resolution.Tick))\n            {\n                throw new InvalidOperationException(\"History functions that accept a 'periods' parameter can not be used with Resolution.Tick\");\n            }\n        }\n\n        /// <summary>\n        /// Centralized logic to get data typed history given a list of requests for the specified symbol.\n        /// This method is used to keep backwards compatibility for those History methods that expect an ArgumentException to be thrown\n        /// when the security and the requested data type do not match\n        /// </summary>\n        /// <remarks>\n        /// This method is only used for Python algorithms, specially for those requesting custom data type history.\n        /// The reason for using this method is that custom data type Python history calls to\n        /// <see cref=\"History{T}(QuantConnect.Symbol, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?)\"/> will always use <see cref=\"PythonData\"/> (the custom data base class)\n        /// as the T argument, because the custom data class is a Python type, which will cause the history data in the slices to not be matched\n        /// to the actual requested type, resulting in an empty list of slices.\n        /// </remarks>\n        private static IEnumerable<dynamic> GetPythonCustomDataTypeHistory(IEnumerable<Slice> slices, List<HistoryRequest> requests,\n            Symbol symbol = null)\n        {\n            if (requests.Count == 0 || requests.Any(x => x.DataType != requests[0].DataType))\n            {\n                throw new ArgumentException(\"QCAlgorithm.GetPythonCustomDataTypeHistory(): All history requests must be for the same data type\");\n            }\n\n            var pythonType = requests[0].DataType;\n\n            if (symbol == null)\n            {\n                return slices.Get(pythonType);\n            }\n\n            return slices.Get(pythonType, symbol);\n        }\n\n        /// <summary>\n        /// Wraps the resulting history enumerable in case of a Python custom data history request.\n        /// We need to get and release the Python GIL when parallel history requests are enabled to avoid deadlocks\n        /// in the custom data readers.\n        /// </summary>\n        private static IEnumerable<Slice> WrapPythonDataHistory(IEnumerable<Slice> history)\n        {\n            using var enumerator = history.GetEnumerator();\n\n            var hasData = true;\n            while (hasData)\n            {\n                // When yielding in tasks there's no guarantee it will continue in the same thread, but we need that guarantee\n                using (Py.GIL())\n                {\n                    var state = PythonEngine.BeginAllowThreads();\n                    try\n                    {\n                        hasData = enumerator.MoveNext();\n                    }\n                    finally\n                    {\n                        // we always need to reset the state so that we can dispose of the GIL\n                        PythonEngine.EndAllowThreads(state);\n                    }\n                }\n                if (hasData)\n                {\n                    yield return enumerator.Current;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Indicators.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing static QuantConnect.StringExtensions;\nusing QuantConnect.Data.Common;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        private readonly List<Func<IBaseData, decimal>> _quoteRequiredFields = new() {\n            Field.BidPrice,\n            Field.AskPrice,\n            Field.BidClose,\n            Field.BidOpen,\n            Field.BidLow,\n            Field.BidHigh,\n            Field.AskClose,\n            Field.AskOpen,\n            Field.AskLow,\n            Field.AskHigh,\n        };\n\n        private static readonly HashSet<string> _ignoredProperties = new HashSet<string>\n        {\n            \"Consolidators\",\n            \"Current\",\n            \"Previous\",\n            \"Name\",\n            \"Samples\",\n            \"IsReady\",\n            \"Window\",\n            \"Item\",\n            \"WarmUpPeriod\",\n            \"Period\"\n        };\n\n        /// <summary>\n        /// Gets whether or not WarmUpIndicator is allowed to warm up indicators\n        /// </summary>\n        [Obsolete(\"Please use Settings.AutomaticIndicatorWarmUp\")]\n        public bool EnableAutomaticIndicatorWarmUp\n        {\n            get\n            {\n                return Settings.AutomaticIndicatorWarmUp;\n            }\n            set\n            {\n                Settings.AutomaticIndicatorWarmUp = value;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new Acceleration Bands indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Acceleration Bands we want.</param>\n        /// <param name=\"period\">The period of the three moving average (middle, upper and lower band).</param>\n        /// <param name=\"width\">A coefficient specifying the distance between the middle band and upper or lower bands.</param>\n        /// <param name=\"movingAverageType\">Type of the moving average.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.</param>\n        /// <returns></returns>\n        [DocumentationAttribute(Indicators)]\n        public AccelerationBands ABANDS(Symbol symbol, int period, decimal width = 4, MovingAverageType movingAverageType = MovingAverageType.Simple,\n            Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ABANDS({period},{width})\", resolution);\n            var accelerationBands = new AccelerationBands(name, period, width, movingAverageType);\n            InitializeIndicator(accelerationBands, resolution, selector, symbol);\n\n            return accelerationBands;\n        }\n\n        /// <summary>\n        /// Creates a new AccumulationDistribution indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose AD we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The AccumulationDistribution indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AccumulationDistribution AD(Symbol symbol, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"AD\", resolution);\n            var accumulationDistribution = new AccumulationDistribution(name);\n            InitializeIndicator(accumulationDistribution, resolution, selector, symbol);\n\n            return accumulationDistribution;\n        }\n\n        /// <summary>\n        /// Creates a new AccumulationDistributionOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ADOSC we want</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The AccumulationDistributionOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AccumulationDistributionOscillator ADOSC(Symbol symbol, int fastPeriod, int slowPeriod, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ADOSC({fastPeriod},{slowPeriod})\", resolution);\n            var accumulationDistributionOscillator = new AccumulationDistributionOscillator(name, fastPeriod, slowPeriod);\n            InitializeIndicator(accumulationDistributionOscillator, resolution, selector, symbol);\n\n            return accumulationDistributionOscillator;\n        }\n\n        /// <summary>\n        /// Creates a Alpha indicator for the given target symbol in relation with the reference used.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"target\">The target symbol whose Alpha value we want</param>\n        /// <param name=\"reference\">The reference symbol to compare with the target symbol</param>\n        /// <param name=\"alphaPeriod\">The period of the Alpha indicator</param>\n        /// <param name=\"betaPeriod\">The period of the Beta indicator</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Alpha indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public Alpha A(Symbol target, Symbol reference, int alphaPeriod = 1, int betaPeriod = 252, Resolution? resolution = null, decimal? riskFreeRate = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var baseBame = riskFreeRate.HasValue ? $\"A({alphaPeriod},{betaPeriod},{riskFreeRate})\" : $\"A({alphaPeriod},{betaPeriod})\";\n            var name = CreateIndicatorName(target, baseBame, resolution);\n\n            // If risk free rate is not specified, use the default risk free rate model\n            IRiskFreeInterestRateModel riskFreeRateModel = riskFreeRate.HasValue\n                ? new ConstantRiskFreeRateInterestRateModel(riskFreeRate.Value)\n                : new FuncRiskFreeRateInterestRateModel((datetime) => RiskFreeInterestRateModel.GetInterestRate(datetime));\n\n            var alpha = new Alpha(name, target, reference, alphaPeriod, betaPeriod, riskFreeRateModel);\n            InitializeIndicator(alpha, resolution, selector, target, reference);\n\n            return alpha;\n        }\n\n        /// <summary>\n        /// Creates a new Average Range (AR) indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Average Range we want to calculate</param>\n        /// <param name=\"period\">The period over which to compute the Average Range</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator. If null, defaults to the Value property of BaseData (x => x.Value).</param>\n        /// <returns>The Average Range indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AverageRange AR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"AR({period})\", resolution);\n            var averageRange = new AverageRange(name, period);\n            InitializeIndicator(averageRange, resolution, selector, symbol);\n            return averageRange;\n        }\n\n        /// <summary>\n        /// Creates a new ARIMA indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ARIMA indicator we want</param>\n        /// <param name=\"arOrder\">AR order (p) -- defines the number of past values to consider in the AR component of the model.</param>\n        /// <param name=\"diffOrder\">Difference order (d) -- defines how many times to difference the model before fitting parameters.</param>\n        /// <param name=\"maOrder\">MA order (q) -- defines the number of past values to consider in the MA component of the model.</param>\n        /// <param name=\"period\">Size of the rolling series to fit onto</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ARIMA indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AutoRegressiveIntegratedMovingAverage ARIMA(Symbol symbol, int arOrder, int diffOrder, int maOrder, int period,\n            Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return ARIMA(symbol, arOrder, diffOrder, maOrder, period, true, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new ARIMA indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ARIMA indicator we want</param>\n        /// <param name=\"arOrder\">AR order (p) -- defines the number of past values to consider in the AR component of the model.</param>\n        /// <param name=\"diffOrder\">Difference order (d) -- defines how many times to difference the model before fitting parameters.</param>\n        /// <param name=\"maOrder\">MA order (q) -- defines the number of past values to consider in the MA component of the model.</param>\n        /// <param name=\"period\">Size of the rolling series to fit onto</param>\n        /// <param name=\"intercept\">Whether or not to include the intercept term</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ARIMA indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AutoRegressiveIntegratedMovingAverage ARIMA(Symbol symbol, int arOrder, int diffOrder, int maOrder, int period, bool intercept,\n            Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ARIMA({arOrder},{diffOrder},{maOrder},{period})\", resolution);\n            var arimaIndicator = new AutoRegressiveIntegratedMovingAverage(name, arOrder, diffOrder, maOrder, period, intercept);\n            InitializeIndicator(arimaIndicator, resolution, selector, symbol);\n\n            return arimaIndicator;\n        }\n\n        /// <summary>\n        /// Creates a new Average Directional Index indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Average Directional Index we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"period\">The period over which to compute the Average Directional Index</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Average Directional Index indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public AverageDirectionalIndex ADX(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ADX({period})\", resolution);\n            var averageDirectionalIndex = new AverageDirectionalIndex(name, period);\n            InitializeIndicator(averageDirectionalIndex, resolution, selector, symbol);\n\n            return averageDirectionalIndex;\n        }\n\n        /// <summary>\n        /// Creates a new Awesome Oscillator from the specified periods.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Awesome Oscillator we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"fastPeriod\">The period of the fast moving average associated with the AO</param>\n        /// <param name=\"slowPeriod\">The period of the slow moving average associated with the AO</param>\n        /// <param name=\"type\">The type of moving average used when computing the fast and slow term. Defaults to simple moving average.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        [DocumentationAttribute(Indicators)]\n        public AwesomeOscillator AO(Symbol symbol, int fastPeriod, int slowPeriod, MovingAverageType type, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"AO({fastPeriod},{slowPeriod},{type})\", resolution);\n            var awesomeOscillator = new AwesomeOscillator(name, fastPeriod, slowPeriod, type);\n            InitializeIndicator(awesomeOscillator, resolution, selector, symbol);\n\n            return awesomeOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new AverageDirectionalMovementIndexRating indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ADXR we want</param>\n        /// <param name=\"period\">The period over which to compute the ADXR</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The AverageDirectionalMovementIndexRating indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AverageDirectionalMovementIndexRating ADXR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ADXR({period})\", resolution);\n            var averageDirectionalMovementIndexRating = new AverageDirectionalMovementIndexRating(name, period);\n            InitializeIndicator(averageDirectionalMovementIndexRating, resolution, selector, symbol);\n\n            return averageDirectionalMovementIndexRating;\n        }\n\n        /// <summary>\n        /// Creates a new ArnaudLegouxMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ALMA we want</param>\n        /// <param name=\"period\">int - the number of periods to calculate the ALMA</param>\n        /// <param name=\"sigma\"> int - this parameter is responsible for the shape of the curve coefficients.\n        /// </param>\n        /// <param name=\"offset\">\n        /// decimal - This parameter allows regulating the smoothness and high sensitivity of the\n        /// Moving Average. The range for this parameter is [0, 1].\n        /// </param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ArnaudLegouxMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ArnaudLegouxMovingAverage ALMA(Symbol symbol, int period, int sigma = 6, decimal offset = 0.85m, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ALMA({period},{sigma},{offset})\", resolution);\n            var arnaudLegouxMovingAverage = new ArnaudLegouxMovingAverage(name, period, sigma, offset);\n            InitializeIndicator(arnaudLegouxMovingAverage, resolution, selector, symbol);\n\n            return arnaudLegouxMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new AbsolutePriceOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose APO we want</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The AbsolutePriceOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AbsolutePriceOscillator APO(Symbol symbol, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"APO({fastPeriod},{slowPeriod})\", resolution);\n            var absolutePriceOscillator = new AbsolutePriceOscillator(name, fastPeriod, slowPeriod, movingAverageType);\n            InitializeIndicator(absolutePriceOscillator, resolution, selector, symbol);\n\n            return absolutePriceOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Aroon we seek</param>\n        /// <param name=\"period\">The look back period for computing number of periods since maximum and minimum</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>An AroonOscillator configured with the specified periods</returns>\n        [DocumentationAttribute(Indicators)]\n        public AroonOscillator AROON(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            return AROON(symbol, period, period, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Aroon we seek</param>\n        /// <param name=\"upPeriod\">The look back period for computing number of periods since maximum</param>\n        /// <param name=\"downPeriod\">The look back period for computing number of periods since minimum</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>An AroonOscillator configured with the specified periods</returns>\n        [DocumentationAttribute(Indicators)]\n        public AroonOscillator AROON(Symbol symbol, int upPeriod, int downPeriod, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"AROON({upPeriod},{downPeriod})\", resolution);\n            var aroonOscillator = new AroonOscillator(name, upPeriod, downPeriod);\n            InitializeIndicator(aroonOscillator, resolution, selector, symbol);\n\n            return aroonOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new AverageTrueRange indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ATR we want</param>\n        /// <param name=\"period\">The smoothing period used to smooth the computed TrueRange values</param>\n        /// <param name=\"type\">The type of smoothing to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new AverageTrueRange indicator with the specified smoothing type and period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AverageTrueRange ATR(Symbol symbol, int period, MovingAverageType type = MovingAverageType.Simple, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ATR({period})\", resolution);\n            var averageTrueRange = new AverageTrueRange(name, period, type);\n            InitializeIndicator(averageTrueRange, resolution, selector, symbol);\n\n            return averageTrueRange;\n        }\n\n        /// <summary>\n        /// Creates an AugenPriceSpike indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose APS we want</param>\n        /// <param name=\"period\">The period of the APS</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The AugenPriceSpike indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public AugenPriceSpike APS(Symbol symbol, int period = 3, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"APS({period})\", resolution);\n            var augenPriceSpike = new AugenPriceSpike(name, period);\n            InitializeIndicator(augenPriceSpike, resolution, selector, symbol);\n\n            return augenPriceSpike;\n        }\n\n        /// <summary>\n        /// Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose BollingerBands we seek</param>\n        /// <param name=\"period\">The period of the standard deviation and moving average (middle band)</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the middle band and upper or lower bands</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>A BollingerBands configured with the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public BollingerBands BB(Symbol symbol, int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple,\n            Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"BB({period},{k})\", resolution);\n            var bollingerBands = new BollingerBands(name, period, k, movingAverageType);\n            InitializeIndicator(bollingerBands, resolution, selector, symbol);\n\n            return bollingerBands;\n        }\n\n        /// <summary>\n        /// Creates a Beta indicator for the given target symbol in relation with the reference used.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"target\">The target symbol whose Beta value we want</param>\n        /// <param name=\"reference\">The reference symbol to compare with the target symbol</param>\n        /// <param name=\"period\">The period of the Beta indicator</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Beta indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public Beta B(Symbol target, Symbol reference, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"B({period})\", resolution);\n            var beta = new Beta(name, target, reference, period);\n            InitializeIndicator(beta, resolution, selector, target, reference);\n\n            return beta;\n        }\n\n        /// <summary>\n        /// Creates a new Balance Of Power indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Balance Of Power we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Balance Of Power indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public BalanceOfPower BOP(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"BOP\", resolution);\n            var balanceOfPower = new BalanceOfPower(name);\n            InitializeIndicator(balanceOfPower, resolution, selector, symbol);\n\n            return balanceOfPower;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoppockCurve\"/> indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Coppock Curve we want</param>\n        /// <param name=\"shortRocPeriod\">The period for the short ROC</param>\n        /// <param name=\"longRocPeriod\">The period for the long ROC</param>\n        /// <param name=\"lwmaPeriod\">The period for the LWMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Coppock Curve indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public CoppockCurve CC(Symbol symbol, int shortRocPeriod = 11, int longRocPeriod = 14, int lwmaPeriod = 10, Resolution? resolution = null,\n                               Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CC({shortRocPeriod},{longRocPeriod},{lwmaPeriod})\", resolution);\n            var coppockCurve = new CoppockCurve(name, shortRocPeriod, longRocPeriod, lwmaPeriod);\n            InitializeIndicator(coppockCurve, resolution, selector, symbol);\n\n            return coppockCurve;\n        }\n\n        /// <summary>\n        /// Creates a Correlation indicator for the given target symbol in relation with the reference used.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"target\">The target symbol of this indicator</param>\n        /// <param name=\"reference\">The reference symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"correlationType\">Correlation type</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Correlation indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public Correlation C(Symbol target, Symbol reference, int period, CorrelationType correlationType = CorrelationType.Pearson, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"C({period})\", resolution);\n            var correlation = new Correlation(name, target, reference, period, correlationType);\n            InitializeIndicator(correlation, resolution, selector, target, reference);\n\n            return correlation;\n        }\n\n        /// <summary>\n        /// Creates a Covariance indicator for the given target symbol in relation with the reference used.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"target\">The target symbol whose Covariance value we want</param>\n        /// <param name=\"reference\">The reference symbol to compare with the target symbol</param>\n        /// <param name=\"period\">The period of the Covariance indicator</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Covariance indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public Covariance COV(Symbol target, Symbol reference, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"COV({period})\", resolution);\n            var covariance = new Covariance(name, target, reference, period);\n            InitializeIndicator(covariance, resolution, selector, target, reference);\n\n            return covariance;\n        }\n\n        /// <summary>\n        /// Creates a new CommodityChannelIndex indicator. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CCI we want</param>\n        /// <param name=\"period\">The period over which to compute the CCI</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use in computing the typical price average</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The CommodityChannelIndex indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public CommodityChannelIndex CCI(Symbol symbol, int period, MovingAverageType movingAverageType = MovingAverageType.Simple, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CCI({period})\", resolution);\n            var commodityChannelIndex = new CommodityChannelIndex(name, period, movingAverageType);\n            InitializeIndicator(commodityChannelIndex, resolution, selector, symbol);\n\n            return commodityChannelIndex;\n        }\n\n        /// <summary>\n        /// Creates a new ChoppinessIndex indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CHOP we want</param>\n        /// <param name=\"period\">The input window period used to calculate max high and min low</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new ChoppinessIndex indicator with the window period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ChoppinessIndex CHOP(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CHOP({period})\", resolution);\n            var indicator = new ChoppinessIndex(name, period);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new Chande Kroll Stop indicator which will compute the short and lower stop.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Chande Kroll Stop we seek.</param>\n        /// <param name=\"atrPeriod\">The period over which to compute the average true range.</param>\n        /// <param name=\"atrMult\">The ATR multiplier to be used to compute stops distance.</param>\n        /// <param name=\"period\">The period over which to compute the max of high stop and min of low stop.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Chande Kroll Stop indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public ChandeKrollStop CKS(Symbol symbol, int atrPeriod, decimal atrMult, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CKS({atrPeriod},{atrMult},{period})\", resolution);\n            var indicator = new ChandeKrollStop(name, atrPeriod, atrMult, period, movingAverageType);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new ChaikinMoneyFlow indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CMF we want</param>\n        /// <param name=\"period\">The period over which to compute the CMF</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The ChaikinMoneyFlow indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ChaikinMoneyFlow CMF(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CMF({period})\", resolution);\n            var chaikinMoneyFlow = new ChaikinMoneyFlow(name, period);\n            InitializeIndicator(chaikinMoneyFlow, resolution, selector, symbol);\n\n            return chaikinMoneyFlow;\n\n        }\n\n        /// <summary>\n        /// Creates a new Chaikin Oscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CO we want</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Chaikin Oscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ChaikinOscillator CO(Symbol symbol, int fastPeriod, int slowPeriod, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CO({fastPeriod},{slowPeriod})\", resolution);\n            var chaikinOscillator = new ChaikinOscillator(name, fastPeriod, slowPeriod);\n            InitializeIndicator(chaikinOscillator, resolution, selector, symbol);\n\n            return chaikinOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new ChandeMomentumOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CMO we want</param>\n        /// <param name=\"period\">The period over which to compute the CMO</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ChandeMomentumOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ChandeMomentumOscillator CMO(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CMO({period})\", resolution);\n            var chandeMomentumOscillator = new ChandeMomentumOscillator(name, period);\n            InitializeIndicator(chandeMomentumOscillator, resolution, selector, symbol);\n\n            return chandeMomentumOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new Connors Relative Strength Index (CRSI) indicator, which combines the traditional Relative Strength Index (RSI),\n        /// Streak RSI (SRSI), and Percent Rank to provide a more robust measure of market strength.\n        /// This indicator oscillates based on momentum, streak behavior, and price change over the specified periods.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose CRSI is to be calculated.</param>\n        /// <param name=\"rsiPeriod\">The period for the traditional RSI calculation.</param>\n        /// <param name=\"rsiPeriodStreak\">The period for the Streak RSI calculation (SRSI).</param>\n        /// <param name=\"lookBackPeriod\">The look-back period for calculating the Percent Rank.</param>\n        /// <param name=\"resolution\">The resolution of the data (optional).</param>\n        /// <param name=\"selector\">Function to select a value from the BaseData to input into the indicator. Defaults to using the 'Value' property of BaseData if null.</param>\n        /// <returns>The Connors Relative Strength Index (CRSI) for the specified symbol and periods.</returns>\n        [DocumentationAttribute(Indicators)]\n        public ConnorsRelativeStrengthIndex CRSI(Symbol symbol, int rsiPeriod, int rsiPeriodStreak, int lookBackPeriod, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"CRSI({rsiPeriod},{rsiPeriodStreak},{lookBackPeriod})\", resolution);\n            var connorsRelativeStrengthIndex = new ConnorsRelativeStrengthIndex(name, rsiPeriod, rsiPeriodStreak, lookBackPeriod);\n            InitializeIndicator(connorsRelativeStrengthIndex, resolution, selector, symbol);\n            return connorsRelativeStrengthIndex;\n        }\n\n        ///<summary>\n        /// Creates a new DeMarker Indicator (DEM), an oscillator-type indicator measuring changes in terms of an asset's\n        /// High and Low tradebar values.\n        ///</summary>\n        /// <param name=\"symbol\">The symbol whose DEM we seek.</param>\n        /// <param name=\"period\">The period of the moving average implemented</param>\n        /// <param name=\"type\">Specifies the type of moving average to be used</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The DeMarker indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public DeMarkerIndicator DEM(Symbol symbol, int period, MovingAverageType type, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"DEM({period},{type})\", resolution);\n            var deMarkerIndicator = new DeMarkerIndicator(name, period, type);\n            InitializeIndicator(deMarkerIndicator, resolution, selector, symbol);\n            return deMarkerIndicator;\n        }\n\n        /// <summary>\n        /// Creates a new Donchian Channel indicator which will compute the Upper Band and Lower Band.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Donchian Channel we seek.</param>\n        /// <param name=\"upperPeriod\">The period over which to compute the upper Donchian Channel.</param>\n        /// <param name=\"lowerPeriod\">The period over which to compute the lower Donchian Channel.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Donchian Channel indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public DonchianChannel DCH(Symbol symbol, int upperPeriod, int lowerPeriod, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"DCH({upperPeriod},{lowerPeriod})\", resolution);\n            var donchianChannel = new DonchianChannel(name, upperPeriod, lowerPeriod);\n            InitializeIndicator(donchianChannel, resolution, selector, symbol);\n\n            return donchianChannel;\n        }\n\n        /// <summary>\n        /// Overload shorthand to create a new symmetric Donchian Channel indicator which\n        /// has the upper and lower channels set to the same period length.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Donchian Channel we seek.</param>\n        /// <param name=\"period\">The period over which to compute the Donchian Channel.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a IBaseDataBar</param>\n        /// <returns>The Donchian Channel indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public DonchianChannel DCH(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            return DCH(symbol, period, period, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new Delta indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Delta indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Delta D(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<Delta>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var delta = new Delta(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel);\n            InitializeOptionIndicator(delta, resolution, symbol, mirrorOption);\n            return delta;\n        }\n\n        /// <summary>\n        /// Creates a new Delta indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Delta indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Delta Δ(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null, OptionPricingModelType optionModel = OptionPricingModelType.BlackScholes,\n            OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            return D(symbol, mirrorOption, riskFreeRate, dividendYield, optionModel, ivModel, resolution);\n        }\n\n        /// <summary>\n        /// Creates a new DoubleExponentialMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose DEMA we want</param>\n        /// <param name=\"period\">The period over which to compute the DEMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The DoubleExponentialMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public DoubleExponentialMovingAverage DEMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"DEMA({period})\", resolution);\n            var doubleExponentialMovingAverage = new DoubleExponentialMovingAverage(name, period);\n            InitializeIndicator(doubleExponentialMovingAverage, resolution, selector, symbol);\n\n            return doubleExponentialMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new DerivativeOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose DO we want</param>\n        /// <param name=\"rsiPeriod\">The period over which to compute the RSI</param>\n        /// <param name=\"smoothingRsiPeriod\">The period over which to compute the smoothing RSI</param>\n        /// <param name=\"doubleSmoothingRsiPeriod\">The period over which to compute the double smoothing RSI</param>\n        /// <param name=\"signalLinePeriod\">The period over which to compute the signal line</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x =&gt; x.Value)</param>\n        /// <returns>The DerivativeOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public DerivativeOscillator DO(Symbol symbol, int rsiPeriod, int smoothingRsiPeriod, int doubleSmoothingRsiPeriod, int signalLinePeriod, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"DO({rsiPeriod},{smoothingRsiPeriod},{doubleSmoothingRsiPeriod},{signalLinePeriod})\", resolution);\n            var derivativeOscillator = new DerivativeOscillator(name, rsiPeriod, smoothingRsiPeriod, doubleSmoothingRsiPeriod, signalLinePeriod);\n            InitializeIndicator(derivativeOscillator, resolution, selector, symbol);\n\n            return derivativeOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"DetrendedPriceOscillator\"/> indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose DPO we want</param>\n        /// <param name=\"period\">The period over which to compute the DPO</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>A new registered DetrendedPriceOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public DetrendedPriceOscillator DPO(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"DPO({period})\", resolution);\n            var detrendedPriceOscillator = new DetrendedPriceOscillator(name, period);\n            InitializeIndicator(detrendedPriceOscillator, resolution, selector, symbol);\n\n            return detrendedPriceOscillator;\n        }\n\n        /// <summary>\n        /// Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose EMA we want</param>\n        /// <param name=\"period\">The period of the EMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ExponentialMovingAverage for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public ExponentialMovingAverage EMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return EMA(symbol, period, ExponentialMovingAverage.SmoothingFactorDefault(period), resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose EMA we want</param>\n        /// <param name=\"period\">The period of the EMA</param>\n        /// <param name=\"smoothingFactor\">The percentage of data from the previous value to be carried into the next value</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ExponentialMovingAverage for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public ExponentialMovingAverage EMA(Symbol symbol, int period, decimal smoothingFactor, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"EMA({period})\", resolution);\n            var exponentialMovingAverage = new ExponentialMovingAverage(name, period, smoothingFactor);\n            InitializeIndicator(exponentialMovingAverage, resolution, selector, symbol);\n\n            return exponentialMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose EMV we want</param>\n        /// <param name=\"period\">The period of the EMV</param>\n        /// <param name=\"scale\">The length of the outputed value</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The EaseOfMovementValue indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public EaseOfMovementValue EMV(Symbol symbol, int period = 1, int scale = 10000, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"EMV({period}, {scale})\", resolution);\n            var easeOfMovementValue = new EaseOfMovementValue(name, period, scale);\n            InitializeIndicator(easeOfMovementValue, resolution, selector, symbol);\n\n            return easeOfMovementValue;\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, Func<IBaseData, IBaseDataBar> selector = null, Func<IBaseData, bool> filter = null, string fieldName = null)\n        {\n            var resolution = GetSubscription(symbol).Resolution;\n            return FilteredIdentity(symbol, resolution, selector, filter, fieldName);\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, Resolution resolution, Func<IBaseData, IBaseDataBar> selector = null, Func<IBaseData, bool> filter = null, string fieldName = null)\n        {\n            var name = CreateIndicatorName(symbol, fieldName ?? \"close\", resolution);\n            var filteredIdentity = new FilteredIdentity(name, filter);\n            RegisterIndicator<IBaseData>(symbol, filteredIdentity, resolution, selector);\n            return filteredIdentity;\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, TimeSpan resolution, Func<IBaseData, IBaseDataBar> selector = null, Func<IBaseData, bool> filter = null, string fieldName = null)\n        {\n            var name = Invariant($\"{symbol}({fieldName ?? \"close\"}_{resolution})\");\n            var filteredIdentity = new FilteredIdentity(name, filter);\n            RegisterIndicator<IBaseData>(symbol, filteredIdentity, ResolveConsolidator(symbol, resolution), selector);\n            return filteredIdentity;\n        }\n\n        /// <summary>\n        /// Creates a new ForceIndex indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ForceIndex we want</param>\n        /// <param name=\"period\">The smoothing period used to smooth the computed ForceIndex values</param>\n        /// <param name=\"type\">The type of smoothing to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new ForceIndex indicator with the specified smoothing type and period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ForceIndex FI(Symbol symbol, int period, MovingAverageType type = MovingAverageType.Exponential, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"FI({period})\", resolution);\n            var indicator = new ForceIndex(name, period, type);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates an FisherTransform indicator for the symbol.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose FisherTransform we want</param>\n        /// <param name=\"period\">The period of the FisherTransform</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The FisherTransform for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public FisherTransform FISH(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"FISH({period})\", resolution);\n            var fisherTransform = new FisherTransform(name, period);\n            InitializeIndicator(fisherTransform, resolution, selector, symbol);\n\n            return fisherTransform;\n        }\n\n\n        /// <summary>\n        /// Creates an FractalAdaptiveMovingAverage (FRAMA) indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose FRAMA we want</param>\n        /// <param name=\"period\">The period of the FRAMA</param>\n        /// <param name=\"longPeriod\">The long period of the FRAMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The FRAMA for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public FractalAdaptiveMovingAverage FRAMA(Symbol symbol, int period, int longPeriod = 198, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"FRAMA({period},{longPeriod})\", resolution);\n            var fractalAdaptiveMovingAverage = new FractalAdaptiveMovingAverage(name, period, longPeriod);\n            InitializeIndicator(fractalAdaptiveMovingAverage, resolution, selector, symbol);\n\n            return fractalAdaptiveMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new Gamma indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Gamma indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Gamma G(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<Gamma>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var gamma = new Gamma(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel);\n            InitializeOptionIndicator(gamma, resolution, symbol, mirrorOption);\n            return gamma;\n        }\n\n        /// <summary>\n        /// Creates a new Gamma indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Gamma indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Gamma Γ(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null, OptionPricingModelType optionModel = OptionPricingModelType.BlackScholes,\n            OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            return G(symbol, mirrorOption, riskFreeRate, dividendYield, optionModel, ivModel, resolution);\n        }\n\n        /// <summary>\n        /// Creates a new Heikin-Ashi indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Heikin-Ashi we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Heikin-Ashi indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public HeikinAshi HeikinAshi(Symbol symbol, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"HA\", resolution);\n            var heikinAshi = new HeikinAshi(name);\n            InitializeIndicator(heikinAshi, resolution, selector, symbol);\n\n            return heikinAshi;\n        }\n\n        /// <summary>\n        /// Creates a new Hurst Exponent indicator for the specified symbol.\n        /// The Hurst Exponent measures the long-term memory or self-similarity in a time series.\n        /// The default maxLag value of 20 is chosen for reliable and accurate results, but using a higher lag may reduce precision.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which the Hurst Exponent is calculated.</param>\n        /// <param name=\"period\">The number of data points used to calculate the indicator at each step.</param>\n        /// <param name=\"maxLag\">The maximum time lag used to compute the tau values for the Hurst Exponent calculation.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Function to select a value from the BaseData to input into the indicator. Defaults to using the 'Value' property of BaseData if null.</param>\n        /// <returns>The Hurst Exponent indicator for the specified symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public HurstExponent HE(Symbol symbol, int period, int maxLag = 20, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"HE({period},{maxLag})\", resolution);\n            var hurstExponent = new HurstExponent(name, period, maxLag);\n            InitializeIndicator(hurstExponent, resolution, selector, symbol);\n            return hurstExponent;\n        }\n\n        /// <summary>\n        /// Creates a new Hilbert Transform indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Hilbert transform we want</param>\n        /// <param name=\"length\">The length of the FIR filter used in the calculation of the Hilbert Transform.\n        /// This parameter determines the number of filter coefficients in the FIR filter.</param>\n        /// <param name=\"inPhaseMultiplicationFactor\">The multiplication factor used in the calculation of the in-phase component\n        /// of the Hilbert Transform. This parameter adjusts the sensitivity and responsiveness of\n        /// the transform to changes in the input signal.</param>\n        /// <param name=\"quadratureMultiplicationFactor\">The multiplication factor used in the calculation of the quadrature component of\n        /// the Hilbert Transform. This parameter also adjusts the sensitivity and responsiveness of the\n        /// transform to changes in the input signal.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(Indicators)]\n        public HilbertTransform HT(Symbol symbol, int length, decimal inPhaseMultiplicationFactor, decimal quadratureMultiplicationFactor, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"HT({length}, {inPhaseMultiplicationFactor}, {quadratureMultiplicationFactor})\", resolution);\n            var hilbertTransform = new HilbertTransform(length, inPhaseMultiplicationFactor, quadratureMultiplicationFactor);\n            InitializeIndicator(hilbertTransform, resolution, selector, symbol);\n\n            return hilbertTransform;\n        }\n\n        /// <summary>\n        /// Creates a new HullMovingAverage indicator. The Hull moving average is a series of nested weighted moving averages, is fast and smooth.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Hull moving average we want</param>\n        /// <param name=\"period\">The period over which to compute the Hull moving average</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns></returns>\n        [DocumentationAttribute(Indicators)]\n        public HullMovingAverage HMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"HMA({period})\", resolution);\n            var hullMovingAverage = new HullMovingAverage(name, period);\n            InitializeIndicator(hullMovingAverage, resolution, selector, symbol);\n\n            return hullMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new InternalBarStrength indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose IBS we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new InternalBarStrength indicator</returns>\n        [DocumentationAttribute(Indicators)]\n        public InternalBarStrength IBS(Symbol symbol, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"IBS\", resolution);\n            var indicator = new InternalBarStrength(name);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new IchimokuKinkoHyo indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ICHIMOKU we want</param>\n        /// <param name=\"tenkanPeriod\">The period to calculate the Tenkan-sen period</param>\n        /// <param name=\"kijunPeriod\">The period to calculate the Kijun-sen period</param>\n        /// <param name=\"senkouAPeriod\">The period to calculate the Tenkan-sen period</param>\n        /// <param name=\"senkouBPeriod\">The period to calculate the Tenkan-sen period</param>\n        /// <param name=\"senkouADelayPeriod\">The period to calculate the Tenkan-sen period</param>\n        /// <param name=\"senkouBDelayPeriod\">The period to calculate the Tenkan-sen period</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new IchimokuKinkoHyo indicator with the specified periods and delays</returns>\n        [DocumentationAttribute(Indicators)]\n        public IchimokuKinkoHyo ICHIMOKU(Symbol symbol, int tenkanPeriod, int kijunPeriod, int senkouAPeriod, int senkouBPeriod,\n            int senkouADelayPeriod, int senkouBDelayPeriod, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ICHIMOKU({tenkanPeriod},{kijunPeriod},{senkouAPeriod},{senkouBPeriod},{senkouADelayPeriod},{senkouBDelayPeriod})\", resolution);\n            var ichimokuKinkoHyo = new IchimokuKinkoHyo(name, tenkanPeriod, kijunPeriod, senkouAPeriod, senkouBPeriod, senkouADelayPeriod, senkouBDelayPeriod);\n            InitializeIndicator(ichimokuKinkoHyo, resolution, selector, symbol);\n\n            return ichimokuKinkoHyo;\n        }\n\n        /// <summary>\n        /// Creates a new Identity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new Identity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public Identity Identity(Symbol symbol, Func<IBaseData, decimal> selector = null, string fieldName = null)\n        {\n            var resolution = GetSubscription(symbol).Resolution;\n            return Identity(symbol, resolution, selector, fieldName);\n        }\n\n        /// <summary>\n        /// Creates a new Identity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new Identity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public Identity Identity(Symbol symbol, Resolution resolution, Func<IBaseData, decimal> selector = null, string fieldName = null)\n        {\n            var name = CreateIndicatorName(symbol, fieldName ?? \"close\", resolution);\n            var identity = new Identity(name);\n            InitializeIndicator(identity, resolution, selector, symbol);\n            return identity;\n        }\n\n        /// <summary>\n        /// Creates a new Identity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new Identity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public Identity Identity(Symbol symbol, TimeSpan resolution, Func<IBaseData, decimal> selector = null, string fieldName = null)\n        {\n            var name = Invariant($\"{symbol}({fieldName ?? \"close\"},{resolution})\");\n            var identity = new Identity(name);\n            RegisterIndicator(symbol, identity, ResolveConsolidator(symbol, resolution), selector);\n            return identity;\n        }\n\n        /// <summary>\n        /// Creates a new ImpliedVolatility indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option contract used for parity type calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new ImpliedVolatility indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public ImpliedVolatility IV(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<ImpliedVolatility>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var iv = new ImpliedVolatility(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel);\n            InitializeOptionIndicator(iv, resolution, symbol, mirrorOption);\n            return iv;\n        }\n\n        /// <summary>\n        /// Creates a new KaufmanAdaptiveMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose KAMA we want</param>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER) of KAMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The KaufmanAdaptiveMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public KaufmanAdaptiveMovingAverage KAMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return KAMA(symbol, period, 2, 30, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new KaufmanAdaptiveMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose KAMA we want</param>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER)</param>\n        /// <param name=\"fastEmaPeriod\">The period of the fast EMA used to calculate the Smoothing Constant (SC)</param>\n        /// <param name=\"slowEmaPeriod\">The period of the slow EMA used to calculate the Smoothing Constant (SC)</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The KaufmanAdaptiveMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public KaufmanAdaptiveMovingAverage KAMA(Symbol symbol, int period, int fastEmaPeriod, int slowEmaPeriod, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"KAMA({period},{fastEmaPeriod},{slowEmaPeriod})\", resolution);\n            var kaufmanAdaptiveMovingAverage = new KaufmanAdaptiveMovingAverage(name, period, fastEmaPeriod, slowEmaPeriod);\n            InitializeIndicator(kaufmanAdaptiveMovingAverage, resolution, selector, symbol);\n\n            return kaufmanAdaptiveMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates an KaufmanEfficiencyRatio indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose EF we want</param>\n        /// <param name=\"period\">The period of the EF</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The KaufmanEfficiencyRatio indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public KaufmanEfficiencyRatio KER(Symbol symbol, int period = 2, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"KER({period})\", resolution);\n            var kaufmanEfficiencyRatio = new KaufmanEfficiencyRatio(name, period);\n            InitializeIndicator(kaufmanEfficiencyRatio, resolution, selector, symbol);\n\n            return kaufmanEfficiencyRatio;\n        }\n\n        /// <summary>\n        /// Creates a new Keltner Channels indicator.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Keltner Channel we seek</param>\n        /// <param name=\"period\">The period over which to compute the Keltner Channels</param>\n        /// <param name=\"k\">The number of multiples of the <see cref=\"AverageTrueRange\"/> from the middle band of the Keltner Channels</param>\n        /// <param name=\"movingAverageType\">Specifies the type of moving average to be used as the middle line of the Keltner Channel</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Keltner Channel indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public KeltnerChannels KCH(Symbol symbol, int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"KCH({period},{k})\", resolution);\n            var keltnerChannels = new KeltnerChannels(name, period, k, movingAverageType);\n            InitializeIndicator(keltnerChannels, resolution, selector, symbol);\n\n            return keltnerChannels;\n        }\n\n        /// <summary>\n        /// Creates a new KnowSureThing indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose KST we want</param>\n        /// <param name=\"roc1Period\">The period over which to compute ROC1</param>\n        /// <param name=\"roc1MaPeriod\">The smoothing period used to smooth the computed ROC1 values</param>\n        /// <param name=\"roc2Period\">The period over which to compute ROC2</param>\n        /// <param name=\"roc2MaPeriod\">The smoothing period used to smooth the computed ROC2 values</param>\n        /// <param name=\"roc3Period\">The period over which to compute ROC3</param>\n        /// <param name=\"roc3MaPeriod\">The smoothing period used to smooth the computed ROC3 values</param>\n        /// <param name=\"roc4Period\">The period over which to compute ROC4</param>\n        /// <param name=\"roc4MaPeriod\">The smoothing period used to smooth the computed ROC4 values</param>\n        /// <param name=\"signalPeriod\">The smoothing period used to smooth the signal values</param>\n        /// <param name=\"movingAverageType\">Specifies the type of moving average to be used as smoother for KnowSureThing values</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new KnowSureThing indicator with the specified smoothing type and period</returns>\n        [DocumentationAttribute(Indicators)]\n        public KnowSureThing KST(Symbol symbol,\n            int roc1Period = 10, int roc1MaPeriod = 10, int roc2Period = 15, int roc2MaPeriod = 10,\n            int roc3Period = 20, int roc3MaPeriod = 10, int roc4Period = 30, int roc4MaPeriod = 15, int signalPeriod = 9,\n            MovingAverageType movingAverageType = MovingAverageType.Simple,\n            Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"KST({roc1Period},{roc1MaPeriod},{roc2Period},{roc2MaPeriod},{roc3Period},{roc3MaPeriod},{roc4Period},{roc4MaPeriod},{signalPeriod},{movingAverageType})\", resolution);\n            var indicator = new KnowSureThing(name, roc1Period, roc1MaPeriod, roc2Period, roc2MaPeriod, roc3Period, roc3MaPeriod, roc4Period, roc4MaPeriod, signalPeriod, movingAverageType);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new Klinger Volume Oscillator (KVO) indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose KVO we want</param>\n        /// <param name=\"fastPeriod\">The period of the fast EMA used to calculate KVO</param>\n        /// <param name=\"slowPeriod\">The period of the slow EMA used to calculate KVO, default to 13</param>\n        /// <param name=\"signalPeriod\">The period of the signal EMA of the raw KVO value</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Klinger Volume Oscillator indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public KlingerVolumeOscillator KVO(Symbol symbol, int fastPeriod, int slowPeriod, int signalPeriod = 13, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"KVO({fastPeriod},{slowPeriod},{signalPeriod})\", resolution);\n            var klingerVolumeOscillator = new KlingerVolumeOscillator(name, fastPeriod, slowPeriod, signalPeriod);\n            InitializeIndicator(klingerVolumeOscillator, resolution, selector, symbol);\n            return klingerVolumeOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new LogReturn indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose log return we seek</param>\n        /// <param name=\"period\">The period of the log return.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.</param>\n        /// <returns>log return indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public LogReturn LOGR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"LOGR({period})\", resolution);\n            var logReturn = new LogReturn(name, period);\n            InitializeIndicator(logReturn, resolution, selector, symbol);\n\n            return logReturn;\n        }\n\n        /// <summary>\n        /// Creates and registers a new Least Squares Moving Average instance.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose LSMA we seek.</param>\n        /// <param name=\"period\">The LSMA period. Normally 14.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.</param>\n        /// <returns>A LeastSquaredMovingAverage configured with the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public LeastSquaresMovingAverage LSMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"LSMA({period})\", resolution);\n            var leastSquaresMovingAverage = new LeastSquaresMovingAverage(name, period);\n            InitializeIndicator(leastSquaresMovingAverage, resolution, selector, symbol);\n\n            return leastSquaresMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new LinearWeightedMovingAverage indicator.  This indicator will linearly distribute\n        /// the weights across the periods.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose LWMA we want</param>\n        /// <param name=\"period\">The period over which to compute the LWMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns></returns>\n        [DocumentationAttribute(Indicators)]\n        public LinearWeightedMovingAverage LWMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"LWMA({period})\", resolution);\n            var linearWeightedMovingAverage = new LinearWeightedMovingAverage(name, period);\n            InitializeIndicator(linearWeightedMovingAverage, resolution, selector, symbol);\n\n            return linearWeightedMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a MACD indicator for the symbol. The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose MACD we want</param>\n        /// <param name=\"fastPeriod\">The period for the fast moving average</param>\n        /// <param name=\"slowPeriod\">The period for the slow moving average</param>\n        /// <param name=\"signalPeriod\">The period for the signal moving average</param>\n        /// <param name=\"type\">The type of moving average to use for the MACD</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The moving average convergence divergence between the fast and slow averages</returns>\n        [DocumentationAttribute(Indicators)]\n        public MovingAverageConvergenceDivergence MACD(Symbol symbol, int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type = MovingAverageType.Exponential, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MACD({fastPeriod},{slowPeriod},{signalPeriod})\", resolution);\n            var movingAverageConvergenceDivergence = new MovingAverageConvergenceDivergence(name, fastPeriod, slowPeriod, signalPeriod, type);\n            InitializeIndicator(movingAverageConvergenceDivergence, resolution, selector, symbol);\n\n            return movingAverageConvergenceDivergence;\n        }\n\n        /// <summary>\n        /// Creates a new MeanAbsoluteDeviation indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose MeanAbsoluteDeviation we want</param>\n        /// <param name=\"period\">The period over which to compute the MeanAbsoluteDeviation</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The MeanAbsoluteDeviation indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MeanAbsoluteDeviation MAD(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MAD({period})\", resolution);\n            var meanAbsoluteDeviation = new MeanAbsoluteDeviation(name, period);\n            InitializeIndicator(meanAbsoluteDeviation, resolution, selector, symbol);\n\n            return meanAbsoluteDeviation;\n        }\n\n        /// <summary>\n        /// Creates a new Mesa Adaptive Moving Average (MAMA) indicator.\n        /// The MAMA adjusts its smoothing factor based on the market's volatility, making it more adaptive than a simple moving average.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which the MAMA indicator is being created.</param>\n        /// <param name=\"fastLimit\">The fast limit for the adaptive moving average.</param>\n        /// <param name=\"slowLimit\">The slow limit for the adaptive moving average.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Optional function to select a value from the BaseData. Defaults to casting the input to a TradeBar.</param>\n        /// <returns>The Mesa Adaptive Moving Average (MAMA) indicator for the requested symbol with the specified limits.</returns>\n        [DocumentationAttribute(Indicators)]\n        public MesaAdaptiveMovingAverage MAMA(Symbol symbol, decimal fastLimit = 0.5m, decimal slowLimit = 0.05m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MAMA({fastLimit},{slowLimit})\", resolution);\n            var mesaAdaptiveMovingAverage = new MesaAdaptiveMovingAverage(name, fastLimit, slowLimit);\n            InitializeIndicator(mesaAdaptiveMovingAverage, resolution, selector, symbol);\n            return mesaAdaptiveMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates an Market Profile indicator for the symbol with Volume Profile (VOL) mode. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VP we want</param>\n        /// <param name=\"period\">The period of the VP</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision. i.e 0.01 round to two digits exactly.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Volume Profile indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public VolumeProfile VP(Symbol symbol, int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m, Resolution resolution = Resolution.Daily, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VP({period},{valueAreaVolumePercentage},{priceRangeRoundOff})\", resolution);\n            var marketProfile = new VolumeProfile(name, period, valueAreaVolumePercentage, priceRangeRoundOff);\n            InitializeIndicator(marketProfile, resolution, selector, symbol);\n\n            return marketProfile;\n        }\n\n        /// <summary>\n        /// Creates an Market Profile indicator for the symbol with Time Price Opportunity (TPO) mode. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TP we want</param>\n        /// <param name=\"period\">The period of the TP</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision. i.e 0.01 round to two digits exactly.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Time Profile indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public TimeProfile TP(Symbol symbol, int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m, Resolution resolution = Resolution.Daily, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TP({period},{valueAreaVolumePercentage},{priceRangeRoundOff})\", resolution);\n            var marketProfile = new TimeProfile(name, period, valueAreaVolumePercentage, priceRangeRoundOff);\n            InitializeIndicator(marketProfile, resolution, selector, symbol);\n\n            return marketProfile;\n        }\n\n        /// <summary>\n        /// Creates a new Time Series Forecast indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TSF we want</param>\n        /// <param name=\"period\">The period of the TSF</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to Value property of BaseData (x => x.Value)</param>\n        /// <returns>The TimeSeriesForecast indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public TimeSeriesForecast TSF(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TSF({period})\", resolution);\n            var timeSeriesForecast = new TimeSeriesForecast(name, period);\n            InitializeIndicator(timeSeriesForecast, resolution, selector, symbol);\n\n            return timeSeriesForecast;\n        }\n\n        /// <summary>\n        /// Creates a new Maximum indicator to compute the maximum value\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose max we want</param>\n        /// <param name=\"period\">The look back period over which to compute the max value</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null and the symbol is of type TradeBar defaults to the High property,\n        /// otherwise it defaults to Value property of BaseData (x => x.Value)</param>\n        /// <returns>A Maximum indicator that compute the max value and the periods since the max value</returns>\n        [DocumentationAttribute(Indicators)]\n        public Maximum MAX(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MAX({period})\", resolution);\n            var maximum = new Maximum(name, period);\n\n            // assign a default value for the selector function\n            if (selector == null)\n            {\n                var subscription = GetSubscription(symbol);\n                if (typeof(TradeBar).IsAssignableFrom(subscription.Type))\n                {\n                    // if we have trade bar data we'll use the High property, if not x => x.Value will be set in RegisterIndicator\n                    selector = x => ((TradeBar)x).High;\n                }\n            }\n\n            InitializeIndicator(maximum, resolution, selector, symbol);\n            return maximum;\n        }\n\n        /// <summary>\n        /// Creates a new MoneyFlowIndex indicator. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose MFI we want</param>\n        /// <param name=\"period\">The period over which to compute the MFI</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The MoneyFlowIndex indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MoneyFlowIndex MFI(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MFI({period})\", resolution);\n            var moneyFlowIndex = new MoneyFlowIndex(name, period);\n            InitializeIndicator(moneyFlowIndex, resolution, selector, symbol);\n\n            return moneyFlowIndex;\n        }\n\n        /// <summary>\n        /// Creates a new Mass Index indicator. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Mass Index we want.</param>\n        /// <param name=\"emaPeriod\">The period used by both EMA.</param>\n        /// <param name=\"sumPeriod\">The sum period.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Mass Index indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MassIndex MASS(Symbol symbol, int emaPeriod = 9, int sumPeriod = 25, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MASS({emaPeriod},{sumPeriod})\", resolution);\n            var massIndex = new MassIndex(name, emaPeriod, sumPeriod);\n            InitializeIndicator(massIndex, resolution, selector, symbol);\n\n            return massIndex;\n        }\n\n        /// <summary>\n        /// Creates a new MidPoint indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose MIDPOINT we want</param>\n        /// <param name=\"period\">The period over which to compute the MIDPOINT</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The MidPoint indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MidPoint MIDPOINT(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MIDPOINT({period})\", resolution);\n            var midPoint = new MidPoint(name, period);\n            InitializeIndicator(midPoint, resolution, selector, symbol);\n\n            return midPoint;\n        }\n\n        /// <summary>\n        /// Creates a new MidPrice indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose MIDPRICE we want</param>\n        /// <param name=\"period\">The period over which to compute the MIDPRICE</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The MidPrice indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MidPrice MIDPRICE(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MIDPRICE({period})\", resolution);\n            var midPrice = new MidPrice(name, period);\n            InitializeIndicator(midPrice, resolution, selector, symbol);\n\n            return midPrice;\n        }\n\n        /// <summary>\n        /// Creates a new Minimum indicator to compute the minimum value\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose min we want</param>\n        /// <param name=\"period\">The look back period over which to compute the min value</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null and the symbol is of type TradeBar defaults to the Low property,\n        /// otherwise it defaults to Value property of BaseData (x => x.Value)</param>\n        /// <returns>A Minimum indicator that compute the in value and the periods since the min value</returns>\n        [DocumentationAttribute(Indicators)]\n        public Minimum MIN(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MIN({period})\", resolution);\n            var minimum = new Minimum(name, period);\n\n            // assign a default value for the selector function\n            if (selector == null)\n            {\n                var subscription = GetSubscription(symbol);\n                if (typeof(TradeBar).IsAssignableFrom(subscription.Type))\n                {\n                    // if we have trade bar data we'll use the Low property, if not x => x.Value will be set in RegisterIndicator\n                    selector = x => ((TradeBar)x).Low;\n                }\n            }\n\n            InitializeIndicator(minimum, resolution, selector, symbol);\n            return minimum;\n        }\n\n        /// <summary>\n        /// Creates a new Momentum indicator. This will compute the absolute n-period change in the security.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose momentum we want</param>\n        /// <param name=\"period\">The period over which to compute the momentum</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The momentum indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Momentum MOM(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MOM({period})\", resolution);\n            var momentum = new Momentum(name, period);\n            InitializeIndicator(momentum, resolution, selector, symbol);\n\n            return momentum;\n        }\n\n        /// <summary>\n        /// Creates a new Momersion indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Momersion we want</param>\n        /// <param name=\"minPeriod\">The minimum period over which to compute the Momersion. Must be greater than 3. If null, only full period will be used in computations.</param>\n        /// <param name=\"fullPeriod\">The full period over which to compute the Momersion</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Momersion indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Momersion MOMERSION(Symbol symbol, int? minPeriod, int fullPeriod, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MOMERSION({minPeriod},{fullPeriod})\", resolution);\n            var momersion = new Momersion(name, minPeriod, fullPeriod);\n            InitializeIndicator(momersion, resolution, selector, symbol);\n\n            return momersion;\n        }\n\n        /// <summary>\n        /// Creates a new MomentumPercent indicator. This will compute the n-period percent change in the security.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose momentum we want</param>\n        /// <param name=\"period\">The period over which to compute the momentum</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The momentum indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public MomentumPercent MOMP(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MOMP({period})\", resolution);\n            var momentumPercent = new MomentumPercent(name, period);\n            InitializeIndicator(momentumPercent, resolution, selector, symbol);\n\n            return momentumPercent;\n        }\n\n        /// <summary>\n        /// Creates a new NormalizedAverageTrueRange indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose NATR we want</param>\n        /// <param name=\"period\">The period over which to compute the NATR</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The NormalizedAverageTrueRange indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public NormalizedAverageTrueRange NATR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"NATR({period})\", resolution);\n            var normalizedAverageTrueRange = new NormalizedAverageTrueRange(name, period);\n            InitializeIndicator(normalizedAverageTrueRange, resolution, selector, symbol);\n\n            return normalizedAverageTrueRange;\n        }\n\n        /// <summary>\n        /// Creates a new New Highs - New Lows indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose NHNL we want</param>\n        /// <param name=\"period\">The period over which to compute the NHNL</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a IBaseDataBar</param>\n        /// <returns>The NewHighsNewLows indicator for the requested symbols over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public NewHighsNewLows NHNL(IEnumerable<Symbol> symbols, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"NH/NL({period})\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var nhnlDifference = new NewHighsNewLows(name, period);\n            foreach (var symbol in symbols)\n            {\n                nhnlDifference.Add(symbol);\n            }\n            InitializeIndicator(nhnlDifference, resolution, selector, symbols.ToArray());\n\n            return nhnlDifference;\n        }\n\n        /// <summary>\n        /// Creates a new New Highs - New Lows Volume indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose NHNLV we want</param>\n        /// <param name=\"period\">The period over which to compute the NHNLV</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The NewHighsNewLowsVolume indicator for the requested symbols over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public NewHighsNewLowsVolume NHNLV(IEnumerable<Symbol> symbols, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"NH/NL Volume({period})\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var nhnlVolume = new NewHighsNewLowsVolume(name, period);\n            foreach (var symbol in symbols)\n            {\n                nhnlVolume.Add(symbol);\n            }\n            InitializeIndicator(nhnlVolume, resolution, selector, symbols.ToArray());\n\n            return nhnlVolume;\n        }\n\n        /// <summary>\n        /// Creates a new On Balance Volume indicator. This will compute the cumulative total volume\n        /// based on whether the close price being higher or lower than the previous period.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose On Balance Volume we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The On Balance Volume indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public OnBalanceVolume OBV(Symbol symbol, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"OBV\", resolution);\n            var onBalanceVolume = new OnBalanceVolume(name);\n            InitializeIndicator(onBalanceVolume, resolution, selector, symbol);\n\n            return onBalanceVolume;\n        }\n\n        /// <summary>\n        /// Creates a new PivotPointsHighLow indicator which will compute the high and low pivot points based on the configurable surrounding bars count.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose PPHL we seek</param>\n        /// <param name=\"lengthHigh\">The number of surrounding bars whose high values should be less than the current bar's for the bar high to be marked as high pivot point</param>\n        /// <param name=\"lengthLow\">The number of surrounding bars whose low values should be more than the current bar's for the bar low to be marked as low pivot point</param>\n        /// <param name=\"lastStoredValues\">The number of last stored indicator values</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The PivotPointsHighLow indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public PivotPointsHighLow PPHL(Symbol symbol, int lengthHigh, int lengthLow, int lastStoredValues, Resolution? resolution, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            return PPHL(symbol, lengthHigh, lengthLow, lastStoredValues, strict: true, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new PivotPointsHighLow indicator which will compute the high and low pivot points based on the configurable surrounding bars count.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose PPHL we seek</param>\n        /// <param name=\"lengthHigh\">The number of surrounding bars whose high values should be less than the current bar's for the bar high to be marked as high pivot point</param>\n        /// <param name=\"lengthLow\">The number of surrounding bars whose low values should be more than the current bar's for the bar low to be marked as low pivot point</param>\n        /// <param name=\"lastStoredValues\">The number of last stored indicator values</param>\n        /// <param name=\"strict\">When true (default), uses strict inequalities (greater than and less than). When false, uses relaxed inequalities (greater than or equal and less than or equal) allowing equal values to be detected as pivot points.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The PivotPointsHighLow indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public PivotPointsHighLow PPHL(Symbol symbol, int lengthHigh, int lengthLow, int lastStoredValues = 100, bool strict = true, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"PPHL({lengthHigh},{lengthLow})\", resolution);\n            var pivotPointsHighLow = new PivotPointsHighLow(name, lengthHigh, lengthLow, lastStoredValues, strict);\n            InitializeIndicator(pivotPointsHighLow, resolution, selector, symbol);\n\n            return pivotPointsHighLow;\n        }\n\n        /// <summary>\n        /// Creates a new PercentagePriceOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose PPO we want</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The PercentagePriceOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public PercentagePriceOscillator PPO(Symbol symbol, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"PPO({fastPeriod},{slowPeriod})\", resolution);\n            var percentagePriceOscillator = new PercentagePriceOscillator(name, fastPeriod, slowPeriod, movingAverageType);\n            InitializeIndicator(percentagePriceOscillator, resolution, selector, symbol);\n\n            return percentagePriceOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new Parabolic SAR indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose PSAR we seek</param>\n        /// <param name=\"afStart\">Acceleration factor start value. Normally 0.02</param>\n        /// <param name=\"afIncrement\">Acceleration factor increment value. Normally 0.02</param>\n        /// <param name=\"afMax\">Acceleration factor max value. Normally 0.2</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A ParabolicStopAndReverse configured with the specified periods</returns>\n        [DocumentationAttribute(Indicators)]\n        public ParabolicStopAndReverse PSAR(Symbol symbol, decimal afStart = 0.02m, decimal afIncrement = 0.02m, decimal afMax = 0.2m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"PSAR({afStart},{afIncrement},{afMax})\", resolution);\n            var parabolicStopAndReverse = new ParabolicStopAndReverse(name, afStart, afIncrement, afMax);\n            InitializeIndicator(parabolicStopAndReverse, resolution, selector, symbol);\n\n            return parabolicStopAndReverse;\n        }\n\n        /// <summary>\n        /// Creates a new RegressionChannel indicator which will compute the LinearRegression, UpperChannel and LowerChannel lines, the intercept and slope\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RegressionChannel we seek</param>\n        /// <param name=\"period\">The period of the standard deviation and least square moving average (linear regression line)</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the linear regression and upper or lower channel lines</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>A Regression Channel configured with the specified period and number of standard deviation</returns>\n        [DocumentationAttribute(Indicators)]\n        public RegressionChannel RC(Symbol symbol, int period, decimal k, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RC({period},{k})\", resolution);\n            var regressionChannel = new RegressionChannel(name, period, k);\n            InitializeIndicator(regressionChannel, resolution, selector, symbol);\n\n            return regressionChannel;\n        }\n\n        /// <summary>\n        /// Creates a new Relative Moving Average indicator for the symbol. The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose relative moving average we seek</param>\n        /// <param name=\"period\">The period of the relative moving average</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>A relative moving average configured with the specified period and number of standard deviation</returns>\n        [DocumentationAttribute(Indicators)]\n        public RelativeMovingAverage RMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RMA({period})\", resolution);\n            var relativeMovingAverage = new RelativeMovingAverage(name, period);\n            InitializeIndicator(relativeMovingAverage, resolution, selector, symbol);\n\n            return relativeMovingAverage;\n        }\n\n\n        /// <summary>\n        /// Creates a new RateOfChange indicator. This will compute the n-period rate of change in the security.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RateOfChange we want</param>\n        /// <param name=\"period\">The period over which to compute the RateOfChange</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The RateOfChange indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RateOfChange ROC(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ROC({period})\", resolution);\n            var rateOfChange = new RateOfChange(name, period);\n            InitializeIndicator(rateOfChange, resolution, selector, symbol);\n\n            return rateOfChange;\n        }\n\n        /// <summary>\n        /// Creates a new RateOfChangePercent indicator. This will compute the n-period percentage rate of change in the security.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RateOfChangePercent we want</param>\n        /// <param name=\"period\">The period over which to compute the RateOfChangePercent</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The RateOfChangePercent indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RateOfChangePercent ROCP(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ROCP({period})\", resolution);\n            var rateOfChangePercent = new RateOfChangePercent(name, period);\n            InitializeIndicator(rateOfChangePercent, resolution, selector, symbol);\n\n            return rateOfChangePercent;\n        }\n\n        /// <summary>\n        /// Creates a new RateOfChangeRatio indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ROCR we want</param>\n        /// <param name=\"period\">The period over which to compute the ROCR</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The RateOfChangeRatio indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RateOfChangeRatio ROCR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ROCR({period})\", resolution);\n            var rateOfChangeRatio = new RateOfChangeRatio(name, period);\n            InitializeIndicator(rateOfChangeRatio, resolution, selector, symbol);\n\n            return rateOfChangeRatio;\n        }\n\n        /// <summary>\n        /// Creates a new RelativeStrengthIndex indicator. This will produce an oscillator that ranges from 0 to 100 based\n        /// on the ratio of average gains to average losses over the specified period.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RSI we want</param>\n        /// <param name=\"period\">The period over which to compute the RSI</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use in computing the average gain/loss values</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The RelativeStrengthIndex indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RelativeStrengthIndex RSI(Symbol symbol, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RSI({period},{movingAverageType})\", resolution);\n            var relativeStrengthIndex = new RelativeStrengthIndex(name, period, movingAverageType);\n            InitializeIndicator(relativeStrengthIndex, resolution, selector, symbol);\n\n            return relativeStrengthIndex;\n        }\n\n        /// <summary>\n        /// Creates a new RelativeVigorIndex indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RVI we want</param>\n        /// <param name=\"period\">The period over which to compute the RVI</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The RelativeVigorIndex indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RelativeVigorIndex RVI(Symbol symbol, int period, MovingAverageType movingAverageType = MovingAverageType.Simple, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RVI({period},{movingAverageType})\", resolution);\n            var relativeVigorIndex = new RelativeVigorIndex(name, period, movingAverageType);\n            InitializeIndicator(relativeVigorIndex, resolution, selector, symbol);\n\n            return relativeVigorIndex;\n        }\n\n        /// <summary>\n        /// Creates an RelativeDailyVolume indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RDV we want</param>\n        /// <param name=\"period\">The period of the RDV</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Relative Volume indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public RelativeDailyVolume RDV(Symbol symbol, int period = 2, Resolution resolution = Resolution.Daily, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RDV({period})\", resolution);\n            var relativeDailyVolume = new RelativeDailyVolume(name, period);\n            RegisterIndicator(symbol, relativeDailyVolume, resolution, selector);\n\n            return relativeDailyVolume;\n        }\n\n        /// <summary>\n        /// Creates a new Rho indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Rho indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Rho R(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<Rho>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var rho = new Rho(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel);\n            InitializeOptionIndicator(rho, resolution, symbol, mirrorOption);\n            return rho;\n        }\n\n        /// <summary>\n        /// Creates a new Rho indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Rho indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Rho ρ(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null, OptionPricingModelType optionModel = OptionPricingModelType.BlackScholes,\n            OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            return R(symbol, mirrorOption, riskFreeRate, dividendYield, optionModel, ivModel, resolution);\n        }\n\n\n        /// <summary>\n        /// Creates a new Stochastic RSI indicator which will compute the %K and %D\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Stochastic RSI we seek</param>\n        /// <param name=\"rsiPeriod\">The period of the relative strength index</param>\n        /// <param name=\"stochPeriod\">The period of the stochastic indicator</param>\n        /// <param name=\"kSmoothingPeriod\">The smoothing period of K output</param>\n        /// <param name=\"dSmoothingPeriod\">The smoothing period of D output</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>A StochasticRelativeStrengthIndex configured with the specified periods and moving average type</returns>\n        [DocumentationAttribute(Indicators)]\n        public StochasticRelativeStrengthIndex SRSI(Symbol symbol, int rsiPeriod, int stochPeriod, int kSmoothingPeriod, int dSmoothingPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple,\n            Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SRSI({rsiPeriod},{stochPeriod},{kSmoothingPeriod},{dSmoothingPeriod})\", resolution);\n            var indicator = new StochasticRelativeStrengthIndex(name, rsiPeriod, stochPeriod, kSmoothingPeriod, dSmoothingPeriod, movingAverageType);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new SuperTrend indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose SuperTrend indicator we want.</param>\n        /// <param name=\"period\">The smoothing period for average true range.</param>\n        /// <param name=\"multiplier\">Multiplier to calculate basic upper and lower bands width.</param>\n        /// <param name=\"movingAverageType\">Smoother type for average true range, defaults to Wilders.</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        [DocumentationAttribute(Indicators)]\n        public SuperTrend STR(Symbol symbol, int period, decimal multiplier, MovingAverageType movingAverageType = MovingAverageType.Wilders,\n            Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"STR({period},{multiplier})\", resolution);\n            var strend = new SuperTrend(name, period, multiplier, movingAverageType);\n            InitializeIndicator(strend, resolution, selector, symbol);\n\n            return strend;\n        }\n\n        /// <summary>\n        /// Creates a new SharpeRatio indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RSR we want</param>\n        /// <param name=\"sharpePeriod\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRate\">\n        /// Risk-free rate for sharpe ratio calculation. If not specified, it will use the algorithms' <see cref=\"RiskFreeInterestRateModel\"/>\n        /// </param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The SharpeRatio indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public SharpeRatio SR(Symbol symbol, int sharpePeriod, decimal? riskFreeRate = null, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var baseBame = riskFreeRate.HasValue ? $\"SR({sharpePeriod},{riskFreeRate})\" : $\"SR({sharpePeriod})\";\n            var name = CreateIndicatorName(symbol, baseBame, resolution);\n            IRiskFreeInterestRateModel riskFreeRateModel = riskFreeRate.HasValue\n                ? new ConstantRiskFreeRateInterestRateModel(riskFreeRate.Value)\n                // Make it a function so it's lazily evaluated: SetRiskFreeInterestRateModel can be called after this method\n                : new FuncRiskFreeRateInterestRateModel((datetime) => RiskFreeInterestRateModel.GetInterestRate(datetime));\n            var sharpeRatio = new SharpeRatio(name, sharpePeriod, riskFreeRateModel);\n            InitializeIndicator(sharpeRatio, resolution, selector, symbol);\n\n            return sharpeRatio;\n        }\n\n        /// <summary>\n        /// Creates a new Sortino indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Sortino we want</param>\n        /// <param name=\"sortinoPeriod\">Period of historical observation for Sortino ratio calculation</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return (eg risk-free rate) for the Sortino ratio calculation</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The SortinoRatio indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public SortinoRatio SORTINO(Symbol symbol, int sortinoPeriod, double minimumAcceptableReturn = 0.0, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SORTINO({sortinoPeriod},{minimumAcceptableReturn})\", resolution);\n            var sortinoRatio = new SortinoRatio(name, sortinoPeriod, minimumAcceptableReturn);\n            InitializeIndicator(sortinoRatio, resolution, selector, symbol);\n\n            return sortinoRatio;\n        }\n\n        /// <summary>\n        /// Creates a new Parabolic SAR Extended indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose SAREXT we seek</param>\n        /// <param name=\"sarStart\">The starting value for the Stop and Reverse indicator</param>\n        /// <param name=\"offsetOnReverse\">The offset value to be applied on reverse </param>\n        /// <param name=\"afStartShort\">The starting acceleration factor for short positions</param>\n        /// <param name=\"afIncrementShort\">The increment value for the acceleration factor for short positions</param>\n        /// <param name=\"afMaxShort\">The maximum value for the acceleration factor for short positions</param>\n        /// <param name=\"afStartLong\">The starting acceleration factor for long positions</param>\n        /// <param name=\"afIncrementLong\">The increment value for the acceleration factor for long positions</param>\n        /// <param name=\"afMaxLong\">The maximum value for the acceleration factor for long positions</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A ParabolicStopAndReverseExtended configured with the specified periods</returns>\n        [DocumentationAttribute(Indicators)]\n        public ParabolicStopAndReverseExtended SAREXT(Symbol symbol, decimal sarStart = 0.0m, decimal offsetOnReverse = 0.0m, decimal afStartShort = 0.02m,\n            decimal afIncrementShort = 0.02m, decimal afMaxShort = 0.2m, decimal afStartLong = 0.02m, decimal afIncrementLong = 0.02m, decimal afMaxLong = 0.2m,\n            Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SAREXT({sarStart},{offsetOnReverse},{afStartShort},{afIncrementShort},{afMaxShort},{afStartLong},{afIncrementLong},{afMaxLong})\", resolution);\n            var parabolicStopAndReverseExtended = new ParabolicStopAndReverseExtended(name, sarStart, offsetOnReverse, afStartShort, afIncrementShort, afMaxShort, afStartLong, afIncrementLong, afMaxLong);\n            InitializeIndicator(parabolicStopAndReverseExtended, resolution, selector, symbol);\n\n            return parabolicStopAndReverseExtended;\n        }\n\n        /// <summary>\n        /// Creates a Squeeze Momentum indicator to identify market squeezes and potential breakouts.\n        /// Compares Bollinger Bands and Keltner Channels to signal low or high volatility periods.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which the indicator is calculated.</param>\n        /// <param name=\"bollingerPeriod\">The period for Bollinger Bands.</param>\n        /// <param name=\"bollingerMultiplier\">The multiplier for the Bollinger Bands' standard deviation.</param>\n        /// <param name=\"keltnerPeriod\">The period for Keltner Channels.</param>\n        /// <param name=\"keltnerMultiplier\">The multiplier for the Average True Range in Keltner Channels.</param>\n        /// <param name=\"resolution\">The resolution of the data.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator. If null, defaults to the Value property of BaseData (x => x.Value).</param>\n        /// <returns>The configured Squeeze Momentum indicator.</returns>\n        [DocumentationAttribute(Indicators)]\n        public SqueezeMomentum SM(Symbol symbol, int bollingerPeriod = 20, decimal bollingerMultiplier = 2m, int keltnerPeriod = 20,\n            decimal keltnerMultiplier = 1.5m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SM({bollingerPeriod}, {bollingerMultiplier}, {keltnerPeriod}, {keltnerMultiplier})\", resolution);\n            var squeezeMomentum = new SqueezeMomentum(name, bollingerPeriod, bollingerMultiplier, keltnerPeriod, keltnerMultiplier);\n            InitializeIndicator(squeezeMomentum, resolution, selector, symbol);\n            return squeezeMomentum;\n        }\n\n        /// <summary>\n        /// Creates an SimpleMovingAverage indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose SMA we want</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The SimpleMovingAverage for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public SimpleMovingAverage SMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SMA({period})\", resolution);\n            var simpleMovingAverage = new SimpleMovingAverage(name, period);\n            InitializeIndicator(simpleMovingAverage, resolution, selector, symbol);\n\n            return simpleMovingAverage;\n        }\n\n\n        /// <summary>\n        /// Creates a new Schaff Trend Cycle indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for the indicator to track</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"cyclePeriod\">The signal period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The SchaffTrendCycle indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public SchaffTrendCycle STC(Symbol symbol, int cyclePeriod, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType = MovingAverageType.Exponential, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"STC({cyclePeriod},{fastPeriod},{slowPeriod})\", resolution);\n            var schaffTrendCycle = new SchaffTrendCycle(name, cyclePeriod, fastPeriod, slowPeriod, movingAverageType);\n            InitializeIndicator(schaffTrendCycle, resolution, selector, symbol);\n\n            return schaffTrendCycle;\n        }\n\n        /// <summary>\n        /// Creates a new SmoothedOnBalanceVolume indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose SmoothedOnBalanceVolume we want</param>\n        /// <param name=\"period\">The smoothing period used to smooth the computed OnBalanceVolume values</param>\n        /// <param name=\"type\">The type of smoothing to use</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new SmoothedOnBalanceVolume indicator with the specified smoothing type and period</returns>\n        [DocumentationAttribute(Indicators)]\n        public SmoothedOnBalanceVolume SOBV(Symbol symbol, int period, MovingAverageType type = MovingAverageType.Simple, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SOBV({period})\", resolution);\n            var indicator = new SmoothedOnBalanceVolume(name, period, type);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new StandardDeviation indicator. This will return the population standard deviation of samples over the specified period.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose STD we want</param>\n        /// <param name=\"period\">The period over which to compute the STD</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The StandardDeviation indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public StandardDeviation STD(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"STD({period})\", resolution);\n            var standardDeviation = new StandardDeviation(name, period);\n            InitializeIndicator(standardDeviation, resolution, selector, symbol);\n\n            return standardDeviation;\n        }\n\n        /// <summary>\n        /// Creates a new TargetDownsideDeviation indicator. The target downside deviation is defined as the root-mean-square, or RMS, of the deviations of the\n        /// realized return’s underperformance from the target return where all returns above the target return are treated as underperformance of 0.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TDD we want</param>\n        /// <param name=\"period\">The period over which to compute the TDD</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return (MAR) for the target downside deviation calculation</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The TargetDownsideDeviation indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public TargetDownsideDeviation TDD(Symbol symbol, int period, double minimumAcceptableReturn = 0, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TDD({period},{minimumAcceptableReturn})\", resolution);\n            var targetDownsideDeviation = new TargetDownsideDeviation(name, period, minimumAcceptableReturn);\n            InitializeIndicator(targetDownsideDeviation, resolution, selector, symbol);\n\n            return targetDownsideDeviation;\n        }\n\n        /// <summary>\n        /// Creates a new TomDemark Sequential candlestick indicator for the symbol. The indicator will be automatically\n        /// updated on the symbol's subscription resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TomDemark Sequential we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a IBaseDataBar</param>\n        /// <returns>The TomDemark Sequential indicator for the requested symbol over the specified period</returns>\n        public TomDemarkSequential TDS(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"TDS\", resolution);\n            var tdSequential = new TomDemarkSequential(name);\n            InitializeIndicator(tdSequential, resolution, selector, symbol);\n            return tdSequential;\n        }\n\n        /// <summary>\n        /// Creates a new Stochastic indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose stochastic we seek</param>\n        /// <param name=\"period\">The period of the stochastic. Normally 14</param>\n        /// <param name=\"kPeriod\">The sum period of the stochastic. Normally 14</param>\n        /// <param name=\"dPeriod\">The sum period of the stochastic. Normally 3</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>Stochastic indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public Stochastic STO(Symbol symbol, int period, int kPeriod, int dPeriod, Resolution? resolution = null,\n            Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"STO({period},{kPeriod},{dPeriod})\", resolution);\n            var stochastic = new Stochastic(name, period, kPeriod, dPeriod);\n            InitializeIndicator(stochastic, resolution, selector, symbol);\n\n            return stochastic;\n        }\n\n        /// <summary>\n        /// Overload short hand to create a new Stochastic indicator; defaulting to the 3 period for dStoch\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose stochastic we seek</param>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"period\">The period of the stochastic. Normally 14</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>Stochastic indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public Stochastic STO(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            return STO(symbol, period, period, 3, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new instance of the Premier Stochastic Oscillator for the specified symbol.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which the stochastic indicator is being calculated.</param>\n        /// <param name=\"period\">The period for calculating the Stochastic K value.</param>\n        /// <param name=\"emaPeriod\">The period for the Exponential Moving Average (EMA) used to smooth the Stochastic K.</param>\n        /// <param name=\"resolution\">The data resolution (e.g., daily, hourly) for the indicator</param>\n        /// <param name=\"selector\">Optional function to select a value from the BaseData. Defaults to casting the input to a TradeBar.</param>\n        /// <returns>A PremierStochasticOscillator instance for the specified symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public PremierStochasticOscillator PSO(Symbol symbol, int period, int emaPeriod, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"PSO({period},{emaPeriod})\", resolution);\n            var premierStochasticOscillator = new PremierStochasticOscillator(name, period, emaPeriod);\n            InitializeIndicator(premierStochasticOscillator, resolution, selector, symbol);\n            return premierStochasticOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new Sum indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Sum we want</param>\n        /// <param name=\"period\">The period over which to compute the Sum</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Sum indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Sum SUM(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SUM({period})\", resolution);\n            var sum = new Sum(name, period);\n            InitializeIndicator(sum, resolution, selector, symbol);\n\n            return sum;\n        }\n\n        /// <summary>\n        /// Creates Swiss Army Knife transformation for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to use for calculations</param>\n        /// <param name=\"period\">The period of the calculation</param>\n        /// <param name=\"delta\">The delta scale of the BandStop or BandPass</param>\n        /// <param name=\"tool\">The tool os the Swiss Army Knife</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">elects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The calculation using the given tool</returns>\n        [DocumentationAttribute(Indicators)]\n        public SwissArmyKnife SWISS(Symbol symbol, int period, double delta, SwissArmyKnifeTool tool, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"SWISS({period},{delta},{tool})\", resolution);\n            var swissArmyKnife = new SwissArmyKnife(name, period, delta, tool);\n            InitializeIndicator(swissArmyKnife, resolution, selector, symbol);\n\n            return swissArmyKnife;\n        }\n\n        /// <summary>\n        /// Creates a new Theta indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Theta indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Theta T(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<Theta>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var theta = new Theta(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel);\n            InitializeOptionIndicator(theta, resolution, symbol, mirrorOption);\n            return theta;\n        }\n\n        /// <summary>\n        /// Creates a new Theta indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Theta indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Theta Θ(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null, OptionPricingModelType optionModel = OptionPricingModelType.BlackScholes,\n            OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            return T(symbol, mirrorOption, riskFreeRate, dividendYield, optionModel, ivModel, resolution);\n        }\n\n        /// <summary>\n        /// Creates a new T3MovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose T3 we want</param>\n        /// <param name=\"period\">The period over which to compute the T3</param>\n        /// <param name=\"volumeFactor\">The volume factor to be used for the T3 (value must be in the [0,1] range, defaults to 0.7)</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The T3MovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public T3MovingAverage T3(Symbol symbol, int period, decimal volumeFactor = 0.7m, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"T3({period},{volumeFactor})\", resolution);\n            var t3MovingAverage = new T3MovingAverage(name, period, volumeFactor);\n            InitializeIndicator(t3MovingAverage, resolution, selector, symbol);\n\n            return t3MovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new TripleExponentialMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TEMA we want</param>\n        /// <param name=\"period\">The period over which to compute the TEMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The TripleExponentialMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public TripleExponentialMovingAverage TEMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TEMA({period})\", resolution);\n            var tripleExponentialMovingAverage = new TripleExponentialMovingAverage(name, period);\n            InitializeIndicator(tripleExponentialMovingAverage, resolution, selector, symbol);\n\n            return tripleExponentialMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a TrueStrengthIndex indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TSI we want</param>\n        /// <param name=\"shortTermPeriod\">Period used for the first price change smoothing</param>\n        /// <param name=\"longTermPeriod\">Period used for the second (double) price change smoothing</param>\n        /// <param name=\"signalPeriod\">The signal period</param>\n        /// <param name=\"signalType\">The type of moving average to use for the signal</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The TrueStrengthIndex indicator for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public TrueStrengthIndex TSI(Symbol symbol, int longTermPeriod = 25, int shortTermPeriod = 13, int signalPeriod = 7,\n            MovingAverageType signalType = MovingAverageType.Exponential, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TSI({longTermPeriod},{shortTermPeriod},{signalPeriod})\", resolution);\n            var trueStrengthIndex = new TrueStrengthIndex(name, longTermPeriod, shortTermPeriod, signalPeriod, signalType);\n            InitializeIndicator(trueStrengthIndex, resolution, selector, symbol);\n\n            return trueStrengthIndex;\n        }\n\n        /// <summary>\n        /// Creates a new TrueRange indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TR we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The TrueRange indicator for the requested symbol.</returns>\n        [DocumentationAttribute(Indicators)]\n        public TrueRange TR(Symbol symbol, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"TR\", resolution);\n            var trueRange = new TrueRange(name);\n            InitializeIndicator(trueRange, resolution, selector, symbol);\n\n            return trueRange;\n        }\n\n        /// <summary>\n        /// Creates a new TriangularMovingAverage indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TRIMA we want</param>\n        /// <param name=\"period\">The period over which to compute the TRIMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The TriangularMovingAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public TriangularMovingAverage TRIMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TRIMA({period})\", resolution);\n            var triangularMovingAverage = new TriangularMovingAverage(name, period);\n            InitializeIndicator(triangularMovingAverage, resolution, selector, symbol);\n\n            return triangularMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a new Trix indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose TRIX we want</param>\n        /// <param name=\"period\">The period over which to compute the TRIX</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Trix indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Trix TRIX(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"TRIX({period})\", resolution);\n            var trix = new Trix(name, period);\n            InitializeIndicator(trix, resolution, selector, symbol);\n\n            return trix;\n        }\n\n        /// <summary>\n        /// Creates a new UltimateOscillator indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ULTOSC we want</param>\n        /// <param name=\"period1\">The first period over which to compute the ULTOSC</param>\n        /// <param name=\"period2\">The second period over which to compute the ULTOSC</param>\n        /// <param name=\"period3\">The third period over which to compute the ULTOSC</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The UltimateOscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public UltimateOscillator ULTOSC(Symbol symbol, int period1, int period2, int period3, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ULTOSC({period1},{period2},{period3})\", resolution);\n            var ultimateOscillator = new UltimateOscillator(name, period1, period2, period3);\n            InitializeIndicator(ultimateOscillator, resolution, selector, symbol);\n\n            return ultimateOscillator;\n        }\n\n        /// <summary>\n        /// Creates a new Vega indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The option symbol whose values we want as an indicator</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"dividendYield\">The dividend yield</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <returns>A new Vega indicator for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public Vega V(Symbol symbol, Symbol mirrorOption = null, decimal? riskFreeRate = null, decimal? dividendYield = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null, Resolution? resolution = null)\n        {\n            var name = InitializeOptionIndicator<Vega>(symbol, out var riskFreeRateModel, out var dividendYieldModel, riskFreeRate, dividendYield, optionModel, resolution);\n\n            var vega = new Vega(name, symbol, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel);\n            InitializeOptionIndicator(vega, resolution, symbol, mirrorOption);\n            return vega;\n        }\n\n        /// <summary>\n        /// Creates a new Chande's Variable Index Dynamic Average indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VIDYA we want</param>\n        /// <param name=\"period\">The period over which to compute the VIDYA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The VariableIndexDynamicAverage indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public VariableIndexDynamicAverage VIDYA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VIDYA({period})\", resolution);\n            var variableIndexDynamicAverage = new VariableIndexDynamicAverage(name, period);\n            InitializeIndicator(variableIndexDynamicAverage, resolution, selector, symbol);\n\n            return variableIndexDynamicAverage;\n        }\n\n        /// <summary>\n        /// Creates a new Variance indicator. This will return the population variance of samples over the specified period.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VAR we want</param>\n        /// <param name=\"period\">The period over which to compute the VAR</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Variance indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        [Obsolete(\"'VAR' is obsolete please use 'V' instead\")]\n        public Variance VAR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return V(symbol, period, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new Variance indicator. This will return the population variance of samples over the specified period.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose variance we want</param>\n        /// <param name=\"period\">The period over which to compute the variance</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The Variance indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Variance V(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"V({period})\", resolution);\n            var variance = new Variance(name, period);\n            InitializeIndicator(variance, resolution, selector, symbol);\n\n            return variance;\n        }\n\n        /// <summary>\n        /// Creates a new ValueAtRisk indicator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VAR we want</param>\n        /// <param name=\"period\">The period over which to compute the VAR</param>\n        /// <param name=\"confidenceLevel\">The confidence level for Value at risk calculation</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ValueAtRisk indicator for the requested Symbol, lookback period, and confidence level</returns>\n        public ValueAtRisk VAR(Symbol symbol, int period, double confidenceLevel, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VAR({period},{confidenceLevel})\", resolution);\n            var valueAtRisk = new ValueAtRisk(name, period, confidenceLevel);\n            InitializeIndicator(valueAtRisk, resolution, selector, symbol);\n\n            return valueAtRisk;\n        }\n\n        /// <summary>\n        /// Creates an VolumeWeightedAveragePrice (VWAP) indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VWAP we want</param>\n        /// <param name=\"period\">The period of the VWAP</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The VolumeWeightedAveragePrice for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public VolumeWeightedAveragePriceIndicator VWAP(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VWAP({period})\", resolution);\n            var volumeWeightedAveragePriceIndicator = new VolumeWeightedAveragePriceIndicator(name, period);\n            InitializeIndicator(volumeWeightedAveragePriceIndicator, resolution, selector, symbol);\n\n            return volumeWeightedAveragePriceIndicator;\n        }\n\n        /// <summary>\n        /// Creates the canonical VWAP indicator that resets each day. The indicator will be automatically\n        /// updated on the security's configured resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VWAP we want</param>\n        /// <returns>The IntradayVWAP for the specified symbol</returns>\n        [DocumentationAttribute(Indicators)]\n        public IntradayVwap VWAP(Symbol symbol)\n        {\n            var name = CreateIndicatorName(symbol, \"VWAP\", null);\n            var intradayVwap = new IntradayVwap(name);\n            RegisterIndicator(symbol, intradayVwap);\n            return intradayVwap;\n        }\n\n        /// <summary>\n        /// Creates a new VolumeWeightedMovingAverage indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VWMA we want</param>\n        /// <param name=\"period\">The smoothing period used to smooth the computed VWMA values</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new VolumeWeightedMovingAverage indicator with the specified smoothing period</returns>\n        [DocumentationAttribute(Indicators)]\n        public VolumeWeightedMovingAverage VWMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VWMA({period})\", resolution);\n            var indicator = new VolumeWeightedMovingAverage(name, period);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new Vortex indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose VWMA we want</param>\n        /// <param name=\"period\">The smoothing period used to smooth the computed VWMA values</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new Vortex indicator with the specified smoothing period</returns>\n        [DocumentationAttribute(Indicators)]\n        public Vortex VTX(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"VTX({period})\", resolution);\n            var indicator = new Vortex(name, period);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new Williams %R indicator. This will compute the percentage change of\n        /// the current closing price in relation to the high and low of the past N periods.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose Williams %R we want</param>\n        /// <param name=\"period\">The period over which to compute the Williams %R</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Williams %R indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public WilliamsPercentR WILR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"WILR({period})\", resolution);\n            var williamsPercentR = new WilliamsPercentR(name, period);\n            InitializeIndicator(williamsPercentR, resolution, selector, symbol);\n\n            return williamsPercentR;\n        }\n\n        /// <summary>\n        /// Creates a WilderMovingAverage indicator for the symbol.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose WMA we want</param>\n        /// <param name=\"period\">The period of the WMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The WilderMovingAverage for the given parameters</returns>\n        /// <remarks>WWMA for Welles Wilder Moving Average</remarks>\n        [DocumentationAttribute(Indicators)]\n        public WilderMovingAverage WWMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"WWMA({period})\", resolution);\n            var wilderMovingAverage = new WilderMovingAverage(name, period);\n            InitializeIndicator(wilderMovingAverage, resolution, selector, symbol);\n\n            return wilderMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a Wilder Swing Index (SI) indicator for the symbol.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose SI we want</param>\n        /// <param name=\"limitMove\">The maximum daily change in price for the SI</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The WilderSwingIndex for the given parameters</returns>\n        /// <remarks>SI for Wilder Swing Index</remarks>\n        [DocumentationAttribute(Indicators)]\n        public WilderSwingIndex SI(Symbol symbol, decimal limitMove, Resolution? resolution = Resolution.Daily,\n            Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"SI\", resolution);\n            var si = new WilderSwingIndex(name, limitMove);\n            InitializeIndicator(si, resolution, selector, symbol);\n\n            return si;\n        }\n\n        /// <summary>\n        /// Creates a Wilder Accumulative Swing Index (ASI) indicator for the symbol.\n        /// The indicator will be automatically updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ASI we want</param>\n        /// <param name=\"limitMove\">The maximum daily change in price for the ASI</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The WilderAccumulativeSwingIndex for the given parameters</returns>\n        /// <remarks>ASI for Wilder Accumulative Swing Index</remarks>\n        [DocumentationAttribute(Indicators)]\n        public WilderAccumulativeSwingIndex ASI(Symbol symbol, decimal limitMove, Resolution? resolution = Resolution.Daily,\n            Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, \"ASI\", resolution);\n            var asi = new WilderAccumulativeSwingIndex(name, limitMove);\n            InitializeIndicator(asi, resolution, selector, symbol);\n\n            return asi;\n        }\n\n        /// <summary>\n        /// Creates a new Arms Index indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose Arms Index we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Arms Index indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ArmsIndex TRIN(IEnumerable<Symbol> symbols, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            return TRIN(symbols.ToArray(), resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new Arms Index indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose Arms Index we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Arms Index indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public ArmsIndex TRIN(Symbol[] symbols, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, \"TRIN\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var trin = new ArmsIndex(name);\n            foreach (var symbol in symbols)\n            {\n                trin.Add(symbol);\n            }\n            InitializeIndicator(trin, resolution, selector, symbols);\n\n            return trin;\n        }\n\n        /// <summary>\n        /// Creates a new Advance/Decline Ratio indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose A/D Ratio we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Advance/Decline Ratio indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AdvanceDeclineRatio ADR(IEnumerable<Symbol> symbols, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, \"A/D Ratio\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var adr = new AdvanceDeclineRatio(name);\n            foreach (var symbol in symbols)\n            {\n                adr.Add(symbol);\n            }\n            InitializeIndicator(adr, resolution, selector, symbols.ToArray());\n\n            return adr;\n        }\n\n        /// <summary>\n        /// Creates a new Advance/Decline Volume Ratio indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbol whose A/D Volume Rate we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Advance/Decline Volume Ratio indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AdvanceDeclineVolumeRatio ADVR(IEnumerable<Symbol> symbols, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, \"A/D Volume Rate\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var advr = new AdvanceDeclineVolumeRatio(name);\n            foreach (var symbol in symbols)\n            {\n                advr.Add(symbol);\n            }\n            InitializeIndicator(advr, resolution, selector, symbols.ToArray());\n\n            return advr;\n        }\n\n        /// <summary>\n        /// Creates a new Advance/Decline Difference indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose A/D Difference we want</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The Advance/Decline Difference indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public AdvanceDeclineDifference ADDIFF(IEnumerable<Symbol> symbols, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, \"A/D Difference\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var adDiff = new AdvanceDeclineDifference(name);\n            foreach (var symbol in symbols)\n            {\n                adDiff.Add(symbol);\n            }\n            InitializeIndicator(adDiff, resolution, selector, symbols.ToArray());\n\n            return adDiff;\n        }\n\n        /// <summary>\n        /// Creates a new McGinley Dynamic indicator\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose McGinley Dynamic indicator value we want</param>\n        /// <param name=\"period\">The period of the McGinley Dynamic indicator</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The McGinley Dynamic indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public McGinleyDynamic MGD(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"MGD({period})\", resolution);\n            var indicator = new McGinleyDynamic(name, period);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a new McClellan Oscillator indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose McClellan Oscillator we want</param>\n        /// <param name=\"fastPeriod\">Fast period EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">Slow period EMA of advance decline difference</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The McClellan Oscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public McClellanOscillator MOSC(IEnumerable<Symbol> symbols, int fastPeriod = 19, int slowPeriod = 39, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            return MOSC(symbols.ToArray(), fastPeriod, slowPeriod, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new McClellan Oscillator indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose McClellan Oscillator we want</param>\n        /// <param name=\"fastPeriod\">Fast period EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">Slow period EMA of advance decline difference</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The McClellan Oscillator indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public McClellanOscillator MOSC(Symbol[] symbols, int fastPeriod = 19, int slowPeriod = 39, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"MO({fastPeriod},{slowPeriod})\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var mosc = new McClellanOscillator(name, fastPeriod, slowPeriod);\n            foreach (var symbol in symbols)\n            {\n                mosc.Add(symbol);\n            }\n            InitializeIndicator(mosc, resolution, selector, symbols);\n\n            return mosc;\n        }\n\n        /// <summary>\n        /// Creates a new McClellan Summation Index indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose McClellan Summation Index we want</param>\n        /// <param name=\"fastPeriod\">Fast period EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">Slow period EMA of advance decline difference</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The McClellan Summation Index indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public McClellanSummationIndex MSI(IEnumerable<Symbol> symbols, int fastPeriod = 19, int slowPeriod = 39, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            return MSI(symbols.ToArray(), fastPeriod, slowPeriod, resolution, selector);\n        }\n\n        /// <summary>\n        /// Creates a new McClellan Summation Index indicator\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose McClellan Summation Index we want</param>\n        /// <param name=\"fastPeriod\">Fast period EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">Slow period EMA of advance decline difference</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>The McClellan Summation Index indicator for the requested symbol over the specified period</returns>\n        [DocumentationAttribute(Indicators)]\n        public McClellanSummationIndex MSI(Symbol[] symbols, int fastPeriod = 19, int slowPeriod = 39, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var name = CreateIndicatorName(QuantConnect.Symbol.None, $\"MSI({fastPeriod},{slowPeriod})\", resolution ?? GetSubscription(symbols.First()).Resolution);\n            var msi = new McClellanSummationIndex(name, fastPeriod, slowPeriod);\n            foreach (var symbol in symbols)\n            {\n                msi.Add(symbol);\n            }\n            InitializeIndicator(msi, resolution, selector, symbols);\n\n            return msi;\n        }\n\n\n        /// <summary>\n        /// Creates a new RogersSatchellVolatility indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose RogersSatchellVolatility we want</param>\n        /// <param name=\"period\">The period of the rolling window used to compute volatility</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>\n        /// <returns>A new RogersSatchellVolatility indicator with the specified smoothing type and period</returns>\n        [DocumentationAttribute(Indicators)]\n        public RogersSatchellVolatility RSV(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"RSV({period})\", resolution);\n            var indicator = new RogersSatchellVolatility(name, period);\n            InitializeIndicator(indicator, resolution, selector, symbol);\n\n            return indicator;\n        }\n\n        /// <summary>\n        /// Creates a ZeroLagExponentialMovingAverage indicator for the symbol. The indicator will be automatically\n        /// updated on the given resolution.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose ZLEMA we want</param>\n        /// <param name=\"period\">The period of the ZLEMA</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The ZeroLagExponentialMovingAverage for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public ZeroLagExponentialMovingAverage ZLEMA(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ZLEMA({period})\", resolution);\n            var zeroLagExponentialMovingAverage = new ZeroLagExponentialMovingAverage(name, period);\n            InitializeIndicator(zeroLagExponentialMovingAverage, resolution, selector, symbol);\n\n            return zeroLagExponentialMovingAverage;\n        }\n\n        /// <summary>\n        /// Creates a ZigZag indicator for the specified symbol, with adjustable sensitivity and minimum trend length.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which to create the ZigZag indicator.</param>\n        /// <param name=\"sensitivity\">The sensitivity for detecting pivots.</param>\n        /// <param name=\"minTrendLength\">The minimum number of bars required for a trend before a pivot is confirmed.</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>The configured ZigZag indicator.</returns>\n        [DocumentationAttribute(Indicators)]\n        public ZigZag ZZ(Symbol symbol, decimal sensitivity = 0.05m, int minTrendLength = 1, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var name = CreateIndicatorName(symbol, $\"ZZ({sensitivity},{minTrendLength})\", resolution);\n            var zigZag = new ZigZag(name, sensitivity, minTrendLength);\n            InitializeIndicator(zigZag, resolution, selector, symbol);\n            return zigZag;\n        }\n\n        /// <summary>\n        /// Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this indicator is registered to</param>\n        /// <param name=\"type\">The indicator type, for example, 'SMA(5)'</param>\n        /// <param name=\"resolution\">The resolution requested</param>\n        /// <returns>A unique for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public string CreateIndicatorName(Symbol symbol, FormattableString type, Resolution? resolution)\n        {\n            return CreateIndicatorName(symbol, Invariant(type), resolution);\n        }\n\n        /// <summary>\n        /// Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this indicator is registered to</param>\n        /// <param name=\"type\">The indicator type, for example, 'SMA(5)'</param>\n        /// <param name=\"resolution\">The resolution requested</param>\n        /// <returns>A unique for the given parameters</returns>\n        [DocumentationAttribute(Indicators)]\n        public string CreateIndicatorName(Symbol symbol, string type, Resolution? resolution)\n        {\n            var symbolIsNotEmpty = symbol != QuantConnect.Symbol.None && symbol != QuantConnect.Symbol.Empty;\n\n            if (!resolution.HasValue && symbolIsNotEmpty)\n            {\n                resolution = GetSubscription(symbol).Resolution;\n            }\n\n            var res = string.Empty;\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                    res = \"tick\";\n                    break;\n\n                case Resolution.Second:\n                    res = \"sec\";\n                    break;\n\n                case Resolution.Minute:\n                    res = \"min\";\n                    break;\n\n                case Resolution.Hour:\n                    res = \"hr\";\n                    break;\n\n                case Resolution.Daily:\n                    res = \"day\";\n                    break;\n\n                case null:\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution), resolution, \"resolution parameter is out of range.\");\n            }\n\n            var parts = new List<string>();\n\n            if (symbolIsNotEmpty)\n            {\n                parts.Add(symbol.ToString());\n            }\n            parts.Add(res);\n\n            return Invariant($\"{type}({string.Join(\"_\", parts)})\").Replace(\")(\", \",\");\n        }\n\n        /// <summary>\n        /// Gets the SubscriptionDataConfig for the specified symbol and tick type\n        /// </summary>\n        /// <exception cref=\"InvalidOperationException\">Thrown if no configuration is found for the requested symbol</exception>\n        /// <param name=\"symbol\">The symbol to retrieve configuration for</param>\n        /// <param name=\"tickType\">The tick type of the subscription to get. If null, will use the first ordered by TickType</param>\n        /// <returns>The SubscriptionDataConfig for the specified symbol</returns>\n        private SubscriptionDataConfig GetSubscription(Symbol symbol, TickType? tickType = null)\n        {\n            SubscriptionDataConfig subscription;\n            try\n            {\n                // deterministic ordering is required here\n                var subscriptions = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(symbol)\n                    // make sure common lean data types are at the bottom\n                    .OrderByDescending(x => LeanData.IsCommonLeanDataType(x.Type))\n                    .ThenBy(x => x.TickType)\n                    .ToList();\n\n                // find our subscription\n                subscription = subscriptions.FirstOrDefault(x => tickType == null || tickType == x.TickType);\n                if (subscription == null)\n                {\n                    // if we can't locate the exact subscription by tick type just grab the first one we find\n                    subscription = subscriptions.First();\n                }\n            }\n            catch (InvalidOperationException)\n            {\n                // this will happen if we did not find the subscription, let's give the user a decent error message\n                throw new Exception($\"Please register to receive data for symbol \\'{symbol}\\' using the AddSecurity() function.\");\n            }\n            return subscription;\n        }\n\n        /// <summary>\n        /// Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures\n        /// the indicator to receive updates from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator(Symbol symbol, IndicatorBase<IndicatorDataPoint> indicator, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution), selector ?? (x => x.Value));\n        }\n\n        /// <summary>\n        /// Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures\n        /// the indicator to receive updates from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator(Symbol symbol, IndicatorBase<IndicatorDataPoint> indicator, TimeSpan? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution), selector ?? (x => x.Value));\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"consolidator\">The consolidator to receive raw subscription data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator(Symbol symbol, IndicatorBase<IndicatorDataPoint> indicator, IDataConsolidator consolidator, Func<IBaseData, decimal> selector = null)\n        {\n            // default our selector to the Value property on BaseData\n            selector = selector ?? (x => x.Value);\n\n            RegisterConsolidator(symbol, consolidator, null, indicator);\n\n            // attach to the DataConsolidated event so it updates our indicator\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                var value = selector(consolidated);\n                indicator.Update(new IndicatorDataPoint(consolidated.Symbol, consolidated.EndTime, value));\n            };\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, Resolution? resolution = null)\n            where T : IBaseData\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution, typeof(T)));\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, Resolution? resolution, Func<IBaseData, T> selector)\n            where T : IBaseData\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution, typeof(T)), selector);\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, TimeSpan? resolution, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution, typeof(T)), selector);\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"consolidator\">The consolidator to receive raw subscription data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void RegisterIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, IDataConsolidator consolidator, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            // assign default using cast\n            var selectorToUse = selector ?? (x => (T)x);\n\n            RegisterConsolidator(symbol, consolidator, null, indicator);\n\n            // check the output type of the consolidator and verify we can assign it to T\n            var type = typeof(T);\n            if (!type.IsAssignableFrom(consolidator.OutputType))\n            {\n                if (type == typeof(IndicatorDataPoint) && selector == null)\n                {\n                    // if no selector was provided and the indicator input is of 'IndicatorDataPoint', common case, a selector with a direct cast will fail\n                    // so we use a smarter selector as in other API methods\n                    selectorToUse = consolidated => (T)(object)new IndicatorDataPoint(consolidated.Symbol, consolidated.EndTime, consolidated.Value);\n                }\n                else\n                {\n                    throw new ArgumentException($\"Type mismatch found between consolidator and indicator for symbol: {symbol}.\" +\n                                                $\"Consolidator outputs type {consolidator.OutputType.Name} but indicator expects input type {type.Name}\"\n                    );\n                }\n            }\n\n            // attach to the DataConsolidated event so it updates our indicator\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                var value = selectorToUse(consolidated);\n                indicator.Update(value);\n            };\n        }\n\n        /// <summary>\n        /// Will unregister an indicator and it's associated consolidator instance so they stop receiving data updates\n        /// </summary>\n        /// <param name=\"indicator\">The indicator instance to unregister</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void UnregisterIndicator(IndicatorBase indicator)\n        {\n            DeregisterIndicator(indicator);\n        }\n\n        /// <summary>\n        /// Will deregister an indicator and it's associated consolidator instance so they stop receiving data updates\n        /// </summary>\n        /// <param name=\"indicator\">The indicator instance to deregister</param>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public void DeregisterIndicator(IndicatorBase indicator)\n        {\n            foreach (var consolidator in indicator.Consolidators)\n            {\n                SubscriptionManager.RemoveConsolidator(null, consolidator);\n            }\n\n            indicator.Consolidators.Clear();\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator(Symbol symbol, IndicatorBase<IndicatorDataPoint> indicator, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            WarmUpIndicator(new[] { symbol }, indicator, resolution, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator(IEnumerable<Symbol> symbols, IndicatorBase<IndicatorDataPoint> indicator, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            if (AssertIndicatorHasWarmupPeriod(indicator))\n            {\n                IndicatorHistory(indicator, symbols, 0, resolution, selector);\n            }\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator(Symbol symbol, IndicatorBase<IndicatorDataPoint> indicator, TimeSpan period, Func<IBaseData, decimal> selector = null)\n        {\n            WarmUpIndicator([symbol], indicator, period, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator(IEnumerable<Symbol> symbols, IndicatorBase<IndicatorDataPoint> indicator, TimeSpan period, Func<IBaseData, decimal> selector = null)\n        {\n            var history = GetIndicatorWarmUpHistory(symbols, indicator, period, out var identityConsolidator);\n            if (history == Enumerable.Empty<Slice>()) return;\n\n            // assign default using cast\n            selector ??= (x => x.Value);\n\n            Action<IBaseData> onDataConsolidated = bar =>\n            {\n                var input = new IndicatorDataPoint(bar.Symbol, bar.EndTime, selector(bar));\n                indicator.Update(input);\n            };\n\n            WarmUpIndicatorImpl(symbols, period, onDataConsolidated, history, identityConsolidator);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : class, IBaseData\n        {\n            WarmUpIndicator(new[] { symbol }, indicator, resolution, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator<T>(IEnumerable<Symbol> symbols, IndicatorBase<T> indicator, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : class, IBaseData\n        {\n            if (AssertIndicatorHasWarmupPeriod(indicator))\n            {\n                IndicatorHistory(indicator, symbols, 0, resolution, selector);\n            }\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator<T>(IEnumerable<Symbol> symbols, IndicatorBase<T> indicator, TimeSpan period, Func<IBaseData, T> selector = null)\n            where T : class, IBaseData\n        {\n            var history = GetIndicatorWarmUpHistory(symbols, indicator, period, out var identityConsolidator);\n            if (history == Enumerable.Empty<Slice>()) return;\n\n            // assign default selector\n            selector ??= GetDefaultSelector<T>();\n\n            // we expect T type as input\n            Action<T> onDataConsolidated = bar =>\n            {\n                indicator.Update(selector(bar));\n            };\n\n            WarmUpIndicatorImpl(symbols, period, onDataConsolidated, history, identityConsolidator);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(HistoricalData)]\n        [DocumentationAttribute(Indicators)]\n        public void WarmUpIndicator<T>(Symbol symbol, IndicatorBase<T> indicator, TimeSpan period, Func<IBaseData, T> selector = null)\n            where T : class, IBaseData\n        {\n            WarmUpIndicator([symbol], indicator, period, selector);\n        }\n\n        private Func<IBaseData, T> GetDefaultSelector<T>()\n            where T : IBaseData\n        {\n            if (typeof(T) == typeof(IndicatorDataPoint))\n            {\n                return x =>\n                {\n                    if (!(x is IndicatorDataPoint))\n                    {\n\n                        return (T)(object)new IndicatorDataPoint(x.Symbol, x.EndTime, x.Price);\n                    }\n                    return (T)x;\n                };\n            }\n            return x => (T)x;\n        }\n\n        private IEnumerable<Slice> GetIndicatorWarmUpHistory(IEnumerable<Symbol> symbols, IIndicator indicator, TimeSpan timeSpan, out bool identityConsolidator)\n        {\n            identityConsolidator = false;\n            if (!AssertIndicatorHasWarmupPeriod(indicator))\n            {\n                return Enumerable.Empty<Slice>();\n            }\n\n            var periods = ((IIndicatorWarmUpPeriodProvider)indicator).WarmUpPeriod;\n            if (periods != 0)\n            {\n                var resolution = timeSpan.ToHigherResolutionEquivalent(false);\n                // if they are the same, means we can use an identity consolidator\n                identityConsolidator = resolution.ToTimeSpan() == timeSpan;\n                var resolutionTicks = resolution.ToTimeSpan().Ticks;\n                if (resolutionTicks != 0)\n                {\n                    periods *= (int)(timeSpan.Ticks / resolutionTicks);\n                }\n\n                try\n                {\n                    return History(symbols, periods, resolution, dataNormalizationMode: GetIndicatorHistoryDataNormalizationMode(indicator));\n                }\n                catch (ArgumentException e)\n                {\n                    Debug($\"{indicator.Name} could not be warmed up. Reason: {e.Message}\");\n                }\n            }\n            return Enumerable.Empty<Slice>();\n        }\n\n        private bool AssertIndicatorHasWarmupPeriod(IIndicator indicator)\n        {\n            if (indicator is not IIndicatorWarmUpPeriodProvider)\n            {\n                if (!_isEmitWarmupInsightWarningSent)\n                {\n                    Debug($\"Warning: the 'WarmUpIndicator' feature only works with indicators which inherit from '{nameof(IIndicatorWarmUpPeriodProvider)}'\" +\n                          $\" and define a warm up period, setting property 'WarmUpPeriod' with a value > 0.\" +\n                          $\" The provided indicator of type '{indicator.GetType().Name}' will not be warmed up.\");\n                    _isEmitWarmupInsightWarningSent = true;\n                }\n                return false;\n            }\n            return true;\n        }\n\n        private void WarmUpIndicatorImpl<T>(IEnumerable<Symbol> symbols, TimeSpan period, Action<T> handler, IEnumerable<Slice> history, bool identityConsolidator)\n            where T : class, IBaseData\n        {\n            var consolidators = symbols.ToDictionary(symbol => symbol, symbol =>\n            {\n                IDataConsolidator consolidator;\n                if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol).Count > 0)\n                {\n                    consolidator = Consolidate(symbol, period, handler);\n                }\n                else\n                {\n                    if (identityConsolidator)\n                    {\n                        period = TimeSpan.Zero;\n                    }\n\n                    var providedType = typeof(T);\n                    if (providedType.IsAbstract)\n                    {\n                        var dataType = SubscriptionManager.LookupSubscriptionConfigDataTypes(\n                            symbol.SecurityType,\n                            Resolution.Daily,\n                            // order by tick type so that behavior is consistent with 'GetSubscription()'\n                            symbol.IsCanonical())\n                            // make sure common lean data types are at the bottom\n                            .OrderByDescending(tuple => LeanData.IsCommonLeanDataType(tuple.Item1))\n                            .ThenBy(tuple => tuple.Item2).First();\n\n                        consolidator = CreateConsolidator(period, dataType.Item1, dataType.Item2);\n                    }\n                    else\n                    {\n                        // if the 'providedType' is not abstract we use it instead to determine which consolidator to use\n                        var tickType = LeanData.GetCommonTickTypeForCommonDataTypes(providedType, symbol.SecurityType);\n                        consolidator = CreateConsolidator(period, providedType, tickType);\n                    }\n                    consolidator.DataConsolidated += (s, bar) => handler((T)bar);\n                }\n\n                return consolidator;\n            });\n\n            foreach (var slice in history)\n            {\n                foreach (var (symbol, consolidator) in consolidators)\n                {\n                    var consolidatorInputType = consolidator.InputType;\n                    if (slice.TryGet(consolidatorInputType, symbol, out var data))\n                    {\n                        consolidator.Update(data);\n                    }\n                }\n            }\n\n            // Scan for time after we've pumped all the data through for this consolidator\n            foreach (var (symbol, consolidator) in consolidators)\n            {\n                if (consolidator.WorkingData != null)\n                {\n                    DateTime currentTime;\n                    if (Securities.TryGetValue(symbol, out var security))\n                    {\n                        currentTime = security.LocalTime;\n                    }\n                    else\n                    {\n                        var exchangeHours = MarketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n                        currentTime = UtcTime.ConvertFromUtc(exchangeHours.TimeZone);\n                    }\n\n                    consolidator.Scan(currentTime);\n                }\n\n                SubscriptionManager.RemoveConsolidator(symbol, consolidator);\n            }\n        }\n\n        /// <summary>\n        /// Gets the default consolidator for the specified symbol and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose data is to be consolidated</param>\n        /// <param name=\"resolution\">The resolution for the consolidator, if null, uses the resolution from subscription</param>\n        /// <param name=\"dataType\">The data type for this consolidator, if null, uses TradeBar over QuoteBar if present</param>\n        /// <returns>The new default consolidator</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public IDataConsolidator ResolveConsolidator(Symbol symbol, Resolution? resolution, Type dataType = null)\n        {\n            var tickType = dataType != null ? LeanData.GetCommonTickTypeForCommonDataTypes(dataType, symbol.SecurityType) : (TickType?)null;\n            return CreateConsolidator(symbol, null, tickType, null, resolution, null);\n        }\n\n        /// <summary>\n        /// Gets the default consolidator for the specified symbol and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose data is to be consolidated</param>\n        /// <param name=\"timeSpan\">The requested time span for the consolidator, if null, uses the resolution from subscription</param>\n        /// <param name=\"dataType\">The data type for this consolidator, if null, uses TradeBar over QuoteBar if present</param>\n        /// <returns>The new default consolidator</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        [DocumentationAttribute(Indicators)]\n        public IDataConsolidator ResolveConsolidator(Symbol symbol, TimeSpan? timeSpan, Type dataType = null)\n        {\n            var tickType = dataType != null ? LeanData.GetCommonTickTypeForCommonDataTypes(dataType, symbol.SecurityType) : (TickType?)null;\n            return CreateConsolidator(symbol, null, tickType, timeSpan, null, null);\n        }\n\n        /// <summary>\n        /// Creates a new consolidator for the specified period, generating the requested output type.\n        /// </summary>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"consolidatorInputType\">The desired input type of the consolidator, such as TradeBar or QuoteBar</param>\n        /// <param name=\"tickType\">Trade or Quote. Optional, defaults to trade</param>\n        /// <returns>A new consolidator matching the requested parameters</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public static IDataConsolidator CreateConsolidator(TimeSpan period, Type consolidatorInputType, TickType? tickType = null)\n        {\n            if (period.Ticks == 0)\n            {\n                return CreateIdentityConsolidator(consolidatorInputType);\n            }\n\n            // if our type can be used as a trade bar, then let's just make one of those\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to TradeBar\n            if (typeof(TradeBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new TradeBarConsolidator(period);\n            }\n\n            // if our type can be used as a quote bar, then let's just make one of those\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to QuoteBar\n            if (typeof(QuoteBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new QuoteBarConsolidator(period);\n            }\n\n            // if our type can be used as a tick then we'll use a consolidator that keeps the TickType\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to Tick\n            if (typeof(Tick).IsAssignableFrom(consolidatorInputType))\n            {\n                switch (tickType)\n                {\n                    case TickType.OpenInterest:\n                        return new OpenInterestConsolidator(period);\n\n                    case TickType.Quote:\n                        return new TickQuoteBarConsolidator(period);\n\n                    default:\n                        return new TickConsolidator(period);\n                }\n            }\n\n            // if our type can be used as a DynamicData then we'll use the DynamicDataConsolidator\n            if (typeof(DynamicData).IsAssignableFrom(consolidatorInputType))\n            {\n                return new DynamicDataConsolidator(period);\n            }\n\n            // no matter what we can always consolidate based on the time-value pair of BaseData\n            return new BaseDataConsolidator(period);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Resolution period, Action<TradeBar> handler)\n        {\n            return Consolidate(symbol, period, TickType.Trade, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, TimeSpan period, Action<TradeBar> handler)\n        {\n            return Consolidate(symbol, period, TickType.Trade, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Resolution period, Action<QuoteBar> handler)\n        {\n            return Consolidate(symbol, period.ToTimeSpan(), TickType.Quote, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, TimeSpan period, Action<QuoteBar> handler)\n        {\n            return Consolidate(symbol, period, TickType.Quote, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol and tick type.\n        /// The handler and tick type must match.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate<T>(Symbol symbol, TimeSpan period, Action<T> handler)\n            where T : class, IBaseData\n        {\n            // only infer TickType from T if it's not abstract (for example IBaseData, BaseData), else if will end up being TradeBar let's not take that\n            // decision here (default type), it will be taken later by 'GetSubscription' so we keep it centralized\n            // This could happen when a user passes in a generic 'Action<BaseData>' handler\n            var tickType = typeof(T).IsAbstract ? (TickType?)null : LeanData.GetCommonTickTypeForCommonDataTypes(typeof(T), symbol.SecurityType);\n            return Consolidate(symbol, period, tickType, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol and tick type.\n        /// The handler and tick type must match.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate<T>(Symbol symbol, Resolution period, TickType? tickType, Action<T> handler)\n            where T : class, IBaseData\n        {\n            return Consolidate(symbol, null, tickType, handler, null, period);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol and tick type.\n        /// The handler and tick type must match.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate<T>(Symbol symbol, TimeSpan period, TickType? tickType, Action<T> handler)\n            where T : class, IBaseData\n        {\n            return Consolidate(symbol, null, tickType, handler, period, null);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Func<DateTime, CalendarInfo> calendar, Action<QuoteBar> handler)\n        {\n            return Consolidate(symbol, calendar, TickType.Quote, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Func<DateTime, CalendarInfo> calendar, Action<TradeBar> handler)\n        {\n            return Consolidate(symbol, calendar, TickType.Trade, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol and tick type.\n        /// The handler and tick type must match.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate<T>(Symbol symbol, Func<DateTime, CalendarInfo> calendar, Action<T> handler)\n            where T : class, IBaseData\n        {\n            // only infer TickType from T if it's not abstract (for example IBaseData, BaseData), else if will end up being TradeBar let's not take that\n            // decision here (default type), it will be taken later by 'GetSubscription' so we keep it centralized\n            // This could happen when a user passes in a generic 'Action<BaseData>' handler\n            var tickType = typeof(T).IsAbstract ? (TickType?)null : LeanData.GetCommonTickTypeForCommonDataTypes(typeof(T), symbol.SecurityType);\n            return Consolidate(symbol, calendar, tickType, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol and tick type.\n        /// The handler and tick type must match.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate<T>(Symbol symbol, Func<DateTime, CalendarInfo> calendar, TickType? tickType, Action<T> handler)\n            where T : class, IBaseData\n        {\n            return Consolidate(symbol, calendar, tickType, handler, null, null);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"period\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, period, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbols. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"period\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, IEnumerable<Symbol> symbols, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var warmupPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod ?? 0;\n            if (warmupPeriod > 0 && period > 0)\n            {\n                warmupPeriod -= 1;\n            }\n            var history = History(symbols, period + warmupPeriod, resolution, dataNormalizationMode: GetIndicatorHistoryDataNormalizationMode(indicator));\n            return IndicatorHistory(indicator, history, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"period\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, period, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbols. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"period\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, IEnumerable<Symbol> symbols, int period, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            var warmupPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod ?? 0;\n            if (warmupPeriod > 0 && period > 0)\n            {\n                warmupPeriod -= 1;\n            }\n            var history = History(symbols, period + warmupPeriod, resolution, dataNormalizationMode: GetIndicatorHistoryDataNormalizationMode(indicator));\n            return IndicatorHistory(indicator, history, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, TimeSpan span, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, span, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, IEnumerable<Symbol> symbols, TimeSpan span, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return IndicatorHistory(indicator, symbols, Time - span, Time, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, IEnumerable<Symbol> symbols, TimeSpan span, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            return IndicatorHistory(indicator, symbols, Time - span, Time, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, Symbol symbol, TimeSpan span, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, span, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbols. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, IEnumerable<Symbol> symbols, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var history = History(symbols, GetIndicatorAdjustedHistoryStart(indicator, symbols, start, end, resolution), end, resolution, dataNormalizationMode: GetIndicatorHistoryDataNormalizationMode(indicator));\n            return IndicatorHistory(indicator, history, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, start, end, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            return IndicatorHistory(indicator, new[] { symbol }, start, end, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbols. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, IEnumerable<Symbol> symbols, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            var history = History(symbols, GetIndicatorAdjustedHistoryStart(indicator, symbols, start, end, resolution), end, resolution, dataNormalizationMode: GetIndicatorHistoryDataNormalizationMode(indicator));\n            return IndicatorHistory(indicator, history, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator and convert it into pandas.DataFrame\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"history\">Historical data used to calculate the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame containing the historical data of <paramref name=\"indicator\"/></returns>\n        public IndicatorHistory IndicatorHistory(IndicatorBase<IndicatorDataPoint> indicator, IEnumerable<Slice> history, Func<IBaseData, decimal> selector = null)\n        {\n            selector ??= (x => x.Value);\n            return IndicatorHistory(indicator, history, (bar) => indicator.Update(new IndicatorDataPoint(bar.Symbol, bar.EndTime, selector(bar))), GetDataTypeFromSelector(selector));\n        }\n\n        /// <summary>\n        /// Gets the historical data of an bar indicator and convert it into pandas.DataFrame\n        /// </summary>\n        /// <param name=\"indicator\">Bar indicator</param>\n        /// <param name=\"history\">Historical data used to calculate the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame containing the historical data of <paramref name=\"indicator\"/></returns>\n        public IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, IEnumerable<Slice> history, Func<IBaseData, T> selector = null)\n            where T : IBaseData\n        {\n            selector ??= GetDefaultSelector<T>();\n            return IndicatorHistory(indicator, history, (bar) => indicator.Update(selector(bar)));\n        }\n\n        /// <summary>\n        /// Adds the provided consolidator and asserts the handler T type is assignable from the consolidator output,\n        /// if not will throw <see cref=\"ArgumentException\"/>\n        /// </summary>\n        private IDataConsolidator Consolidate<T>(Symbol symbol, Func<DateTime, CalendarInfo> calendar, TickType? tickType, Action<T> handler, TimeSpan? period, Resolution? resolution)\n            where T : class, IBaseData\n        {\n            var consolidator = CreateConsolidator(symbol, calendar, tickType, period, resolution, typeof(T));\n            if (handler != null)\n            {\n                // register user-defined handler to receive consolidated data events\n                consolidator.DataConsolidated += (sender, consolidated) => handler((T)consolidated);\n\n                // register the consolidator for automatic updates via SubscriptionManager\n                RegisterConsolidator(symbol, consolidator, tickType, indicatorBase: null);\n            }\n            return consolidator;\n        }\n\n        /// <summary>\n        /// Registers a Renko or VolumeRenko consolidator for the specified symbol and bar size,\n        /// and subscribes the <paramref name=\"handler\"/> to receive consolidated data.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose data is to be consolidated</param>\n        /// <param name=\"size\">The bar size used for consolidation</param>\n        /// <param name=\"tickType\">The tick type of the data to be consolidated</param>\n        /// <param name=\"handler\">Handler to receive consolidated data</param>\n        /// <returns>A new Renko-based consolidator with the handler registered</returns>\n        public IDataConsolidator Consolidate<T>(Symbol symbol, decimal size, TickType? tickType, Action<T> handler)\n            where T : class, IBaseData\n        {\n            var consolidator = CreateConsolidator(symbol, size, typeof(T), tickType);\n            if (handler != null)\n            {\n                // register user-defined handler to receive consolidated data events\n                consolidator.DataConsolidated += (sender, consolidated) => handler((T)consolidated);\n\n                // register the consolidator for automatic updates via SubscriptionManager\n                RegisterConsolidator(symbol, consolidator, tickType, indicatorBase: null);\n            }\n            return consolidator;\n        }\n\n        private IDataConsolidator CreateConsolidator(Symbol symbol, decimal size, Type consolidatorType, TickType? tickType)\n        {\n            var subscription = GetSubscription(symbol);\n\n            // Select consolidator based on the consolidator type\n            // size attribute will be used as barSize or range\n            if (consolidatorType == typeof(VolumeRenkoBar))\n            {\n                return new VolumeRenkoConsolidator(size);\n            }\n\n            if (consolidatorType == typeof(RenkoBar))\n            {\n                return new RenkoConsolidator(size);\n            }\n\n            if (consolidatorType == typeof(RangeBar))\n            {\n                return new RangeConsolidator((int)size);\n            }\n\n            // size attribute will be used as maxCount\n            // If the subscription uses Tick resolution, choose the consolidator based on TickType\n            if (subscription.Resolution == Resolution.Tick)\n            {\n                switch (tickType)\n                {\n                    case TickType.OpenInterest:\n                        return new OpenInterestConsolidator((int)size);\n\n                    case TickType.Quote:\n                        return new TickQuoteBarConsolidator((int)size);\n\n                    default:\n                        return new TickConsolidator((int)size);\n                }\n            }\n\n            if (consolidatorType == typeof(TradeBar))\n            {\n                return new TradeBarConsolidator((int)size);\n            }\n\n            if (consolidatorType == typeof(QuoteBar))\n            {\n                return new QuoteBarConsolidator((int)size);\n            }\n\n            // no matter what, we can always consolidate using BaseData with a maxCount\n            return new BaseDataConsolidator((int)size);\n        }\n\n        private IDataConsolidator CreateConsolidator(Symbol symbol, Func<DateTime, CalendarInfo> calendar, TickType? tickType, TimeSpan? period, Resolution? resolution, Type consolidatorType)\n        {\n            // resolve consolidator input subscription\n            var subscription = GetSubscription(symbol, tickType);\n\n            // verify this consolidator will give reasonable results, if someone asks for second consolidation but we have minute\n            // data we won't be able to do anything good, we'll call it second, but it would really just be minute!\n            if (period.HasValue && period.Value < subscription.Increment || resolution.HasValue && resolution.Value < subscription.Resolution)\n            {\n                throw new ArgumentException($\"Unable to create {symbol} consolidator because {symbol} is registered for \" +\n                    Invariant($\"{subscription.Resolution.ToStringInvariant()} data. Consolidators require higher resolution data to produce lower resolution data.\")\n                );\n            }\n\n            IDataConsolidator consolidator = null;\n            if (calendar != null)\n            {\n                // create requested consolidator\n                consolidator = CreateConsolidator(calendar, subscription.Type, subscription.TickType);\n            }\n            else\n            {\n                // if not specified, default to the subscription resolution\n                if (!period.HasValue && !resolution.HasValue)\n                {\n                    period = subscription.Increment;\n                }\n\n                if (period.HasValue && period.Value == subscription.Increment || resolution.HasValue && resolution.Value == subscription.Resolution)\n                {\n                    consolidator = CreateIdentityConsolidator(subscription.Type);\n                }\n                else\n                {\n                    if (resolution.HasValue)\n                    {\n                        if (resolution.Value == Resolution.Daily)\n                        {\n                            if (subscription.ExtendedMarketHours && !Settings.DailyConsolidationUseExtendedMarketHours)\n                            {\n                                // Show this warning only once\n                                if (!_hasShownDailyConsolidationWarning)\n                                {\n                                    Debug($\"Warning: The subscription for {symbol} has ExtendedMarketHours=true, \" +\n                                        $\"but Settings.DailyConsolidationUseExtendedMarketHours=false. \" +\n                                        $\"Daily consolidations will exclude extended market hours. \" +\n                                        $\"Enable algorithm.Settings.DailyConsolidationUseExtendedMarketHours to include them.\"\n                                    );\n\n                                    _hasShownDailyConsolidationWarning = true;\n                                }\n                            }\n\n                            consolidator = new MarketHourAwareConsolidator(Settings.DailyPreciseEndTime, resolution.Value, subscription.Type, subscription.TickType,\n                                Settings.DailyConsolidationUseExtendedMarketHours && subscription.ExtendedMarketHours);\n                        }\n                        period = resolution.Value.ToTimeSpan();\n                    }\n                    consolidator ??= CreateConsolidator(period.Value, subscription.Type, subscription.TickType);\n                }\n            }\n\n            if (consolidatorType != null && !consolidatorType.IsAssignableFrom(consolidator.OutputType))\n            {\n                throw new ArgumentException(\n                    $\"Unable to consolidate with the specified handler because the consolidator's output type \" +\n                    $\"is {consolidator.OutputType.Name} but the handler's input type is {subscription.Type.Name}.\");\n            }\n            return consolidator;\n        }\n\n        private IDataConsolidator CreateConsolidator(Func<DateTime, CalendarInfo> calendar, Type consolidatorInputType, TickType tickType)\n        {\n            // if our type can be used as a trade bar, then let's just make one of those\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to TradeBar\n            if (typeof(TradeBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new TradeBarConsolidator(calendar);\n            }\n\n            // if our type can be used as a quote bar, then let's just make one of those\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to QuoteBar\n            if (typeof(QuoteBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new QuoteBarConsolidator(calendar);\n            }\n\n            // if our type can be used as a tick then we'll use a consolidator that keeps the TickType\n            // we use IsAssignableFrom instead of IsSubclassOf so that we can account for types that are able to be cast to Tick\n            if (typeof(Tick).IsAssignableFrom(consolidatorInputType))\n            {\n                if (tickType == TickType.Quote)\n                {\n                    return new TickQuoteBarConsolidator(calendar);\n                }\n                return new TickConsolidator(calendar);\n            }\n\n            // if our type can be used as a DynamicData then we'll use the DynamicDataConsolidator\n            if (typeof(DynamicData).IsAssignableFrom(consolidatorInputType))\n            {\n                return new DynamicDataConsolidator(calendar);\n            }\n\n            // no matter what we can always consolidate based on the time-value pair of BaseData\n            return new BaseDataConsolidator(calendar);\n        }\n\n        /// <summary>\n        /// Creates a new consolidator identity consolidator for the requested output type.\n        /// </summary>\n        private static IDataConsolidator CreateIdentityConsolidator(Type consolidatorInputType)\n        {\n            if (typeof(TradeBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new IdentityDataConsolidator<TradeBar>();\n            }\n            else if (typeof(QuoteBar).IsAssignableFrom(consolidatorInputType))\n            {\n                return new IdentityDataConsolidator<QuoteBar>();\n            }\n            else if (typeof(Tick).IsAssignableFrom(consolidatorInputType))\n            {\n                return new IdentityDataConsolidator<Tick>();\n            }\n            else if (typeof(DynamicData).IsAssignableFrom(consolidatorInputType))\n            {\n                return new DynamicDataConsolidator(1);\n            }\n            return new IdentityDataConsolidator<BaseData>();\n        }\n\n        /// <summary>\n        /// Registers and warms up (if EnableAutomaticIndicatorWarmUp is set) the indicator\n        /// </summary>\n        private void InitializeIndicator(IndicatorBase<IndicatorDataPoint> indicator, Resolution? resolution = null,\n            Func<IBaseData, decimal> selector = null, params Symbol[] symbols)\n        {\n            var dataType = GetDataTypeFromSelector(selector);\n            foreach (var symbol in symbols)\n            {\n                RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution, dataType), selector);\n            }\n\n            if (Settings.AutomaticIndicatorWarmUp)\n            {\n                WarmUpIndicator(symbols, indicator, resolution, selector);\n            }\n        }\n\n        private void InitializeIndicator<T>(IndicatorBase<T> indicator, Resolution? resolution = null,\n            Func<IBaseData, T> selector = null, params Symbol[] symbols)\n            where T : class, IBaseData\n        {\n            foreach (var symbol in symbols)\n            {\n                RegisterIndicator(symbol, indicator, resolution, selector);\n            }\n\n            if (Settings.AutomaticIndicatorWarmUp)\n            {\n                WarmUpIndicator(symbols, indicator, resolution, selector);\n            }\n        }\n\n        private void InitializeOptionIndicator(IndicatorBase<IBaseData> indicator, Resolution? resolution, Symbol symbol, Symbol mirrorOption)\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution, typeof(QuoteBar)));\n            RegisterIndicator(symbol.Underlying, indicator, ResolveConsolidator(symbol.Underlying, resolution));\n            var symbols = new List<Symbol> { symbol, symbol.Underlying };\n            if (mirrorOption != null)\n            {\n                RegisterIndicator(mirrorOption, indicator, ResolveConsolidator(mirrorOption, resolution, typeof(QuoteBar)));\n                symbols.Add(mirrorOption);\n            }\n\n            if (Settings.AutomaticIndicatorWarmUp)\n            {\n                WarmUpIndicator(symbols, indicator, resolution);\n            }\n        }\n\n        private string InitializeOptionIndicator<T>(Symbol symbol, out IRiskFreeInterestRateModel riskFreeRateModel, out IDividendYieldModel dividendYieldModel,\n            decimal? riskFreeRate = null, decimal? dividendYield = null, OptionPricingModelType? optionModel = null, Resolution? resolution = null)\n            where T : OptionIndicatorBase\n        {\n            var name = CreateIndicatorName(symbol,\n                $\"{typeof(T).Name}({riskFreeRate},{dividendYield},{OptionIndicatorBase.GetOptionModel(optionModel, symbol.ID.OptionStyle)})\",\n                resolution);\n\n            riskFreeRateModel = riskFreeRate.HasValue\n                ? new ConstantRiskFreeRateInterestRateModel(riskFreeRate.Value)\n                // Make it a function so it's lazily evaluated: SetRiskFreeInterestRateModel can be called after this method\n                : new FuncRiskFreeRateInterestRateModel((datetime) => RiskFreeInterestRateModel.GetInterestRate(datetime));\n\n            if (dividendYield.HasValue)\n            {\n                dividendYieldModel = new ConstantDividendYieldModel(dividendYield.Value);\n            }\n            else\n            {\n                dividendYieldModel = DividendYieldProvider.CreateForOption(symbol);\n            }\n\n            return name;\n        }\n\n        private void RegisterConsolidator(Symbol symbol, IDataConsolidator consolidator, TickType? tickType, IndicatorBase indicatorBase)\n        {\n            // keep a reference of the consolidator so we can unregister it later using only a reference to the indicator\n            indicatorBase?.Consolidators.Add(consolidator);\n\n            // register the consolidator for automatic updates via SubscriptionManager\n            SubscriptionManager.AddConsolidator(symbol, consolidator, tickType);\n        }\n\n        private DateTime GetIndicatorAdjustedHistoryStart(IndicatorBase indicator, IEnumerable<Symbol> symbols, DateTime start, DateTime end, Resolution? resolution = null)\n        {\n            var warmupPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod ?? 0;\n            if (warmupPeriod != 0)\n            {\n                warmupPeriod -= 1;\n                if (warmupPeriod > 0)\n                {\n                    foreach (var request in CreateDateRangeHistoryRequests(symbols, start, end, resolution))\n                    {\n                        var adjustedStart = _historyRequestFactory.GetStartTimeAlgoTz(request.StartTimeUtc, request.Symbol, warmupPeriod, request.Resolution,\n                            request.ExchangeHours, request.DataTimeZone, request.DataType, request.IncludeExtendedMarketHours);\n                        if (adjustedStart < start)\n                        {\n                            start = adjustedStart;\n                        }\n                    }\n                }\n            }\n            return start;\n        }\n\n        private DataNormalizationMode? GetIndicatorHistoryDataNormalizationMode(IIndicator indicator)\n        {\n            DataNormalizationMode? dataNormalizationMode = null;\n            if (indicator is OptionIndicatorBase optionIndicator && optionIndicator.OptionSymbol.Underlying.SecurityType == SecurityType.Equity)\n            {\n                // we use point in time raw data to warmup option indicators which use underlying prices and strikes\n                dataNormalizationMode = DataNormalizationMode.ScaledRaw;\n            }\n            return dataNormalizationMode;\n        }\n\n        private IndicatorHistory IndicatorHistory<T>(IndicatorBase<T> indicator, IEnumerable<Slice> history, Action<IBaseData> updateIndicator, Type dataType = null)\n            where T : IBaseData\n        {\n            // Reset the indicator\n            indicator.Reset();\n\n            var properties = indicator.GetType()\n                .GetProperties()\n                .Where(p => !p.IsDefined(typeof(PandasIgnoreAttribute), true) &&\n                            !_ignoredProperties.Contains(p.Name))\n                .ToLookup(p => typeof(IIndicator).IsAssignableFrom(p.PropertyType));\n\n            var indicatorProperties = properties[true];\n            var nonIndicatorProperties = properties[false];\n\n            var indicatorsDataPointPerProperty = indicatorProperties\n                .Select(p => InternalIndicatorValues.Create(indicator, p))\n                .Append(InternalIndicatorValues.Create(indicator, \"Current\"))\n                .ToList();\n\n            var nonIndicatorValues = new Dictionary<string, List<(DateTime, object)>>();\n            var indicatorsDataPointsByTime = new List<IndicatorDataPoints>();\n            var lastConsumedTime = DateTime.MinValue;\n            IndicatorDataPoint lastPoint = null;\n            void consumeLastPoint(IndicatorDataPoint newInputPoint)\n            {\n                if (newInputPoint == null || lastConsumedTime == newInputPoint.EndTime)\n                {\n                    return;\n                }\n                lastConsumedTime = newInputPoint.EndTime;\n\n                var IndicatorDataPoints = new IndicatorDataPoints { Time = newInputPoint.Time, EndTime = newInputPoint.EndTime };\n                indicatorsDataPointsByTime.Add(IndicatorDataPoints);\n                for (var i = 0; i < indicatorsDataPointPerProperty.Count; i++)\n                {\n                    var newPoint = indicatorsDataPointPerProperty[i].UpdateValue();\n                    IndicatorDataPoints.SetProperty(indicatorsDataPointPerProperty[i].Name, newPoint);\n                }\n\n                foreach (var property in nonIndicatorProperties)\n                {\n                    var propertyName = property.Name;\n                    var propertyValue = property.GetValue(indicator);\n\n                    if (!nonIndicatorValues.TryGetValue(propertyName, out var propertyHistory))\n                    {\n                        propertyHistory = new List<(DateTime, object)>();\n                        nonIndicatorValues[propertyName] = propertyHistory;\n                    }\n\n                    propertyHistory.Add((newInputPoint.EndTime, propertyValue));\n                }\n            }\n\n            IndicatorUpdatedHandler callback = (object _, IndicatorDataPoint newInputPoint) =>\n            {\n                if (!indicator.IsReady)\n                {\n                    return;\n                }\n\n                if (lastPoint == null || lastPoint.Time != newInputPoint.Time)\n                {\n                    // if null, it's the first point, we transitions from not ready to ready\n                    // else when the time changes we fetch the indicators values, some indicators which consume data from multiple symbols might trigger the Updated event\n                    // even if their value has not changed yet\n                    consumeLastPoint(newInputPoint);\n                }\n                lastPoint = newInputPoint;\n            };\n\n            // register the callback, update the indicator and unregister finally\n            indicator.Updated += callback;\n\n            if (typeof(T) == typeof(IndicatorDataPoint) || typeof(T).IsAbstract)\n            {\n                history.PushThrough(bar => updateIndicator(bar), dataType);\n            }\n            else\n            {\n                // if the indicator requires a specific type, like a QuoteBar for an equity symbol, we need to fetch it directly\n                foreach (var dataDictionary in history.Get<T>())\n                {\n                    foreach (var dataPoint in dataDictionary.Values)\n                    {\n                        updateIndicator(dataPoint);\n                    }\n                }\n            }\n            // flush the last point, this will be useful for indicator consuming time from multiple symbols\n            consumeLastPoint(lastPoint);\n            indicator.Updated -= callback;\n\n            return new IndicatorHistory(indicatorsDataPointsByTime, indicatorsDataPointPerProperty,\n                new Lazy<PyObject>(\n                    () => PandasConverter.GetIndicatorDataFrame(indicatorsDataPointPerProperty.Select(x => new KeyValuePair<string, List<IndicatorDataPoint>>(x.Name, x.Values)), nonIndicatorValues),\n                    isThreadSafe: false));\n        }\n\n        private Type GetDataTypeFromSelector(Func<IBaseData, decimal> selector)\n        {\n            Type dataType = null;\n            if (_quoteRequiredFields.Any(x => ReferenceEquals(selector, x)))\n            {\n                dataType = typeof(QuoteBar);\n            }\n            else if (ReferenceEquals(selector, Field.Volume))\n            {\n                dataType = typeof(TradeBar);\n            }\n\n            return dataType;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Plotting.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        private bool _isEmitWarmupPlotWarningSet;\n        private readonly ConcurrentDictionary<string, Chart> _charts = new ConcurrentDictionary<string, Chart>();\n\n        private static readonly Dictionary<string, List<string>> ReservedChartSeriesNames = new Dictionary<string, List<string>>\n        {\n            { \"Strategy Equity\", new List<string> { \"Equity\", \"Return\" } },\n            { \"Capacity\", new List<string> { \"Strategy Capacity\" } },\n            { \"Drawdown\", new List<string> { \"Equity Drawdown\" } },\n            { \"Benchmark\", new List<string>() { \"Benchmark\" } },\n            { \"Assets Sales Volume\", new List<string>() },\n            { \"Exposure\", new List<string>() },\n            { \"Portfolio Margin\", new List<string>() },\n            { \"Portfolio Turnover\", new List<string> { \"Portfolio Turnover\" } }\n        };\n\n        /// <summary>\n        /// Access to the runtime statistics property. User provided statistics.\n        /// </summary>\n        /// <remarks> RuntimeStatistics are displayed in the head banner in live trading</remarks>\n        [DocumentationAttribute(Charting)]\n        public ConcurrentDictionary<string, string> RuntimeStatistics { get; } = new ConcurrentDictionary<string, string>();\n\n        /// <summary>\n        /// Add a Chart object to algorithm collection\n        /// </summary>\n        /// <param name=\"chart\">Chart object to add to collection.</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void AddChart(Chart chart)\n        {\n            _charts.TryAdd(chart.Name, chart);\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with value.\n        /// </summary>\n        /// <param name=\"series\">Name of the plot series</param>\n        /// <param name=\"value\">Value to plot</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, decimal value)\n        {\n            //By default plot to the primary chart:\n            Plot(\"Strategy Equity\", series, value);\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with int value. Alias of Plot();\n        /// </summary>\n        /// <remarks> Record(string series, int value)</remarks>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Record(string series, int value)\n        {\n            Plot(series, value);\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with double value. Alias of Plot();\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Record(string series, double value)\n        {\n            Plot(series, value);\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with decimal value. Alias of Plot();\n        /// </summary>\n        /// <param name=\"series\"></param>\n        /// <param name=\"value\"></param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Record(string series, decimal value)\n        {\n            //By default plot to the primary chart:\n            Plot(series, value);\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with double value.\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, double value) {\n            Plot(series, value.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with int value.\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, int value)\n        {\n            Plot(series, (decimal)value);\n        }\n\n        /// <summary>\n        ///Plot a chart using string series name, with float value.\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, float value)\n        {\n            Plot(series, (double)value);\n        }\n\n        /// <summary>\n        /// Plot a chart to string chart name, using string series name, with double value.\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, double value)\n        {\n            Plot(chart, series, value.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Plot a chart to string chart name, using string series name, with int value\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, int value)\n        {\n            Plot(chart, series, (decimal)value);\n        }\n\n        /// <summary>\n        /// Plot a chart to string chart name, using string series name, with float value\n        /// </summary>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, float value)\n        {\n            Plot(chart, series, (double)value);\n        }\n\n        /// <summary>\n        /// Plot a value to a chart of string-chart name, with string series name, and decimal value. If chart does not exist, create it.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"value\">Value of the point</param>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, decimal value)\n        {\n            if (TryGetChartSeries(chart, series, out Series chartSeries))\n            {\n                chartSeries.AddPoint(UtcTime, value);\n            }\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the default/primary chart series by the given series name.\n        /// </summary>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, double open, double high, double low, double close)\n        {\n            Plot(series, open.SafeDecimalCast(), high.SafeDecimalCast(), low.SafeDecimalCast(), close.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the default/primary chart series by the given series name.\n        /// </summary>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, float open, float high, float low, float close)\n        {\n            Plot(series, (double)open, (double)high, (double)low, (double)close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the default/primary chart series by the given series name.\n        /// </summary>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, int open, int high, int low, int close)\n        {\n            Plot(series, (decimal)open, (decimal)high, (decimal)low, (decimal)close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the default/primary chart series by the given series name.\n        /// </summary>\n        /// <param name=\"series\">Name of the plot series</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, decimal open, decimal high, decimal low, decimal close)\n        {\n            //By default plot to the primary chart:\n            Plot(\"Strategy Equity\", series, open, high, low, close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the given series of the given chart.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, double open, double high, double low, double close)\n        {\n            Plot(chart, series, open.SafeDecimalCast(), high.SafeDecimalCast(), low.SafeDecimalCast(), close.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the given series of the given chart.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, float open, float high, float low, float close)\n        {\n            Plot(chart, series, (double)open, (double)high, (double)low, (double)close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the given series of the given chart.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, int open, int high, int low, int close)\n        {\n            Plot(chart, series, (decimal)open, (decimal)high, (decimal)low, (decimal)close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to a chart of string-chart name, with string series name, and decimal value. If chart does not exist, create it.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Series name</param>\n        /// <param name=\"open\">The candlestick open value</param>\n        /// <param name=\"high\">The candlestick high value</param>\n        /// <param name=\"low\">The candlestick low value</param>\n        /// <param name=\"close\">The candlestick close value</param>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, decimal open, decimal high, decimal low, decimal close)\n        {\n            if (TryGetChartSeries(chart, series, out CandlestickSeries candlestickSeries))\n            {\n                candlestickSeries.AddPoint(UtcTime, open, high, low, close);\n            }\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the given series of the given chart.\n        /// </summary>\n        /// <param name=\"series\">Name of the plot series</param>\n        /// <param name=\"bar\">The trade bar to be plotted to the candlestick series</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, TradeBar bar)\n        {\n            Plot(series, bar.Open, bar.High, bar.Low, bar.Close);\n        }\n\n        /// <summary>\n        /// Plot a candlestick to the given series of the given chart.\n        /// </summary>\n        /// <param name=\"chart\">Chart name</param>\n        /// <param name=\"series\">Name of the plot series</param>\n        /// <param name=\"bar\">The trade bar to be plotted to the candlestick series</param>\n        /// <seealso cref=\"Plot(string,string,decimal,decimal,decimal,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, string series, TradeBar bar)\n        {\n            Plot(chart, series, bar.Open, bar.High, bar.Low, bar.Close);\n        }\n\n        private bool TryGetChartSeries<T>(string chartName, string seriesName, out T series)\n            where T : BaseSeries, new()\n        {\n            series = null;\n\n            // Check if chart/series names are reserved\n            if (ReservedChartSeriesNames.TryGetValue(chartName, out var reservedSeriesNames))\n            {\n                if (reservedSeriesNames.Count == 0)\n                {\n                    throw new ArgumentException($\"'{chartName}' is a reserved chart name.\");\n                }\n                if (reservedSeriesNames.Contains(seriesName))\n                {\n                    throw new ArgumentException($\"'{seriesName}' is a reserved series name for chart '{chartName}'.\");\n                }\n            }\n\n            if(!_charts.TryGetValue(chartName, out var chart))\n            {\n                // If we don't have the chart, create it\n                _charts[chartName] = chart = new Chart(chartName);\n            }\n\n            if (!chart.Series.TryGetValue(seriesName, out var chartSeries))\n            {\n                chartSeries = new T() { Name = seriesName };\n                chart.AddSeries(chartSeries);\n            }\n\n            if (LiveMode && IsWarmingUp)\n            {\n                if (!_isEmitWarmupPlotWarningSet)\n                {\n                    _isEmitWarmupPlotWarningSet = true;\n                    Debug(\"Plotting is disabled during algorithm warmup in live trading.\");\n                }\n                return false;\n            }\n\n            series = (T)chartSeries;\n            return true;\n        }\n\n        /// <summary>\n        /// Add a series object for charting. This is useful when initializing charts with\n        /// series other than type = line. If a series exists in the chart with the same name,\n        /// then it is replaced.\n        /// </summary>\n        /// <param name=\"chart\">The chart name</param>\n        /// <param name=\"series\">The series name</param>\n        /// <param name=\"seriesType\">The type of series, i.e, Scatter</param>\n        /// <param name=\"unit\">The unit of the y axis, usually $</param>\n        [DocumentationAttribute(Charting)]\n        public void AddSeries(string chart, string series, SeriesType seriesType, string unit = \"$\")\n        {\n            Chart c;\n            if (!_charts.TryGetValue(chart, out c))\n            {\n                _charts[chart] = c = new Chart(chart);\n            }\n\n            c.Series[series] = BaseSeries.Create(seriesType, series, unit: unit);\n        }\n\n        /// <summary>\n        /// Plots the value of each indicator on the chart\n        /// </summary>\n        /// <param name=\"chart\">The chart's name</param>\n        /// <param name=\"indicators\">The indicators to plot</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, params IndicatorBase[] indicators)\n        {\n            foreach (var indicator in indicators)\n            {\n                Plot(chart, indicator.Name, indicator.Current.Value);\n            }\n        }\n\n        /// <summary>\n        /// Automatically plots each indicator when a new value is available\n        /// </summary>\n        [DocumentationAttribute(Charting)]\n        [DocumentationAttribute(Indicators)]\n        public void PlotIndicator(string chart, params IndicatorBase[] indicators)\n        {\n            PlotIndicator(chart, false, indicators);\n        }\n\n        /// <summary>\n        /// Automatically plots each indicator when a new value is available, optionally waiting for indicator.IsReady to return true\n        /// </summary>\n        [DocumentationAttribute(Charting)]\n        [DocumentationAttribute(Indicators)]\n        public void PlotIndicator(string chart, bool waitForReady, params IndicatorBase[] indicators)\n        {\n            foreach (var i in indicators)\n            {\n                if (i == null) continue;\n\n                // copy loop variable for usage in closure\n                var ilocal = i;\n                i.Updated += (sender, args) =>\n                {\n                    if (!waitForReady || ilocal.IsReady)\n                    {\n                        Plot(chart, ilocal);\n                    }\n                };\n            }\n        }\n\n        /// <summary>\n        /// Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.\n        /// </summary>\n        /// <param name=\"name\">Name of your runtime statistic</param>\n        /// <param name=\"value\">String value of your runtime statistic</param>\n        /// <seealso cref=\"LiveMode\"/>\n        [DocumentationAttribute(Charting)]\n        public void SetRuntimeStatistic(string name, string value)\n        {\n            RuntimeStatistics.AddOrUpdate(name, value);\n        }\n\n        /// <summary>\n        /// Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.\n        /// </summary>\n        /// <param name=\"name\">Name of your runtime statistic</param>\n        /// <param name=\"value\">Decimal value of your runtime statistic</param>\n        [DocumentationAttribute(Charting)]\n        public void SetRuntimeStatistic(string name, decimal value)\n        {\n            SetRuntimeStatistic(name, value.ToString(CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.\n        /// </summary>\n        /// <param name=\"name\">Name of your runtime statistic</param>\n        /// <param name=\"value\">Int value of your runtime statistic</param>\n        [DocumentationAttribute(Charting)]\n        public void SetRuntimeStatistic(string name, int value)\n        {\n            SetRuntimeStatistic(name, value.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.\n        /// </summary>\n        /// <param name=\"name\">Name of your runtime statistic</param>\n        /// <param name=\"value\">Double value of your runtime statistic</param>\n        [DocumentationAttribute(Charting)]\n        public void SetRuntimeStatistic(string name, double value)\n        {\n            SetRuntimeStatistic(name, value.ToString(CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Set a custom summary statistic for the algorithm.\n        /// </summary>\n        /// <param name=\"name\">Name of the custom summary statistic</param>\n        /// <param name=\"value\">Value of the custom summary statistic</param>\n        [DocumentationAttribute(StatisticsTag)]\n        public void SetSummaryStatistic(string name, string value)\n        {\n            if (int.TryParse(name, NumberStyles.Integer, CultureInfo.InvariantCulture, out var intName) &&\n                intName >= 0 && intName <= 100)\n            {\n                throw new ArgumentException($\"'{name}' is a reserved statistic name.\");\n            }\n\n            _statisticsService.SetSummaryStatistic(name, value);\n        }\n\n        /// <summary>\n        /// Set a custom summary statistic for the algorithm.\n        /// </summary>\n        /// <param name=\"name\">Name of the custom summary statistic</param>\n        /// <param name=\"value\">Value of the custom summary statistic</param>\n        [DocumentationAttribute(StatisticsTag)]\n        public void SetSummaryStatistic(string name, int value)\n        {\n            SetSummaryStatistic(name, value.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Set a custom summary statistic for the algorithm.\n        /// </summary>\n        /// <param name=\"name\">Name of the custom summary statistic</param>\n        /// <param name=\"value\">Value of the custom summary statistic</param>\n        [DocumentationAttribute(StatisticsTag)]\n        public void SetSummaryStatistic(string name, double value)\n        {\n            SetSummaryStatistic(name, value.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Set a custom summary statistic for the algorithm.\n        /// </summary>\n        /// <param name=\"name\">Name of the custom summary statistic</param>\n        /// <param name=\"value\">Value of the custom summary statistic</param>\n        [DocumentationAttribute(StatisticsTag)]\n        public void SetSummaryStatistic(string name, decimal value)\n        {\n            SetSummaryStatistic(name, value.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Get the chart updates by fetch the recent points added and return for dynamic Charting.\n        /// </summary>\n        /// <param name=\"clearChartData\"></param>\n        /// <returns>List of chart updates since the last request</returns>\n        /// <remarks>GetChartUpdates returns the latest updates since previous request.</remarks>\n        [DocumentationAttribute(Charting)]\n        public IEnumerable<Chart> GetChartUpdates(bool clearChartData = false)\n        {\n            foreach (var chart in _charts.Values)\n            {\n                yield return chart.GetUpdates();\n                if (clearChartData)\n                {\n                    // we can clear this data out after getting updates to prevent unnecessary memory usage\n                    foreach (var series in chart.Series)\n                    {\n                        series.Value.Purge();\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Python.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing QuantConnect.Securities;\nusing NodaTime;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data.Fundamental;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Commands;\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        private readonly Dictionary<IntPtr, PythonIndicator> _pythonIndicators = new Dictionary<IntPtr, PythonIndicator>();\n\n        /// <summary>\n        /// PandasConverter for this Algorithm\n        /// </summary>\n        public virtual PandasConverter PandasConverter { get; private set; }\n\n        /// <summary>\n        /// Sets pandas converter\n        /// </summary>\n        public void SetPandasConverter()\n        {\n            PandasConverter = new PandasConverter();\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time).\n        /// This method is meant for custom data types that require a ticker, but have no underlying Symbol.\n        /// Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data\n        /// </summary>\n        /// <param name=\"type\">Data source type</param>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the data</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(PyObject type, string ticker, Resolution? resolution = null)\n        {\n            return AddData(type, ticker, resolution, null, false, 1m);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time).\n        /// This adds a Symbol to the `Underlying` property in the custom data Symbol object.\n        /// Use this method when adding custom data with a ticker from the past, such as \"AOL\"\n        /// before it became \"TWX\", or if you need to filter using custom data and place trades on the\n        /// Symbol associated with the custom data.\n        /// </summary>\n        /// <param name=\"type\">Data source type</param>\n        /// <param name=\"underlying\">The underlying symbol for the custom data</param>\n        /// <param name=\"resolution\">Resolution of the data</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>\n        /// We include three optional unused object parameters so that pythonnet chooses the intended method\n        /// correctly. Previously, calling the overloaded method that accepts a string would instead call this method.\n        /// Adding the three unused parameters makes it choose the correct method when using a string or Symbol. This is\n        /// due to pythonnet's method precedence, as viewable here: https://github.com/QuantConnect/pythonnet/blob/9e29755c54e6008cb016e3dd9d75fbd8cd19fcf7/src/runtime/methodbinder.cs#L215\n        /// </remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(PyObject type, Symbol underlying, Resolution? resolution = null)\n        {\n            return AddData(type, underlying, resolution, null, false, 1m);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// This method is meant for custom data types that require a ticker, but have no underlying Symbol.\n        /// Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data\n        /// </summary>\n        /// <param name=\"type\">Data source type</param>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(PyObject type, string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillForward = false, decimal leverage = 1.0m)\n        {\n            return AddData(type.CreateType(), ticker, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// This adds a Symbol to the `Underlying` property in the custom data Symbol object.\n        /// Use this method when adding custom data with a ticker from the past, such as \"AOL\"\n        /// before it became \"TWX\", or if you need to filter using custom data and place trades on the\n        /// Symbol associated with the custom data.\n        /// </summary>\n        /// <param name=\"type\">Data source type</param>\n        /// <param name=\"underlying\">The underlying symbol for the custom data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>\n        /// We include three optional unused object parameters so that pythonnet chooses the intended method\n        /// correctly. Previously, calling the overloaded method that accepts a string would instead call this method.\n        /// Adding the three unused parameters makes it choose the correct method when using a string or Symbol. This is\n        /// due to pythonnet's method precedence, as viewable here: https://github.com/QuantConnect/pythonnet/blob/9e29755c54e6008cb016e3dd9d75fbd8cd19fcf7/src/runtime/methodbinder.cs#L215\n        /// </remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(PyObject type, Symbol underlying, Resolution? resolution, DateTimeZone timeZone, bool fillForward = false, decimal leverage = 1.0m)\n        {\n            return AddData(type.CreateType(), underlying, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// This method is meant for custom data types that require a ticker, but have no underlying Symbol.\n        /// Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data\n        /// </summary>\n        /// <param name=\"dataType\">Data source type</param>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(Type dataType, string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillForward = false, decimal leverage = 1.0m)\n        {\n            // NOTE: Invoking methods on BaseData w/out setting the symbol may provide unexpected behavior\n            var baseInstance = dataType.GetBaseDataInstance();\n            if (!baseInstance.RequiresMapping())\n            {\n                var symbol = new Symbol(\n                    SecurityIdentifier.GenerateBase(dataType, ticker, Market.USA, baseInstance.RequiresMapping()),\n                    ticker);\n                return AddDataImpl(dataType, symbol, resolution, timeZone, fillForward, leverage);\n            }\n            // If we need a mappable ticker and we can't find one in the SymbolCache, throw\n            Symbol underlying;\n            if (!SymbolCache.TryGetSymbol(ticker, out underlying))\n            {\n                throw new InvalidOperationException($\"The custom data type {dataType.Name} requires mapping, but the provided ticker is not in the cache. \" +\n                                                    $\"Please add this custom data type using a Symbol or perform this call after \" +\n                                                    $\"a Security has been added using AddEquity, AddForex, AddCfd, AddCrypto, AddFuture, AddOption or AddSecurity. \" +\n                                                    $\"An example use case can be found in CustomDataAddDataRegressionAlgorithm\");\n            }\n\n            return AddData(dataType, underlying, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source, requiring only the minimum config options.\n        /// This adds a Symbol to the `Underlying` property in the custom data Symbol object.\n        /// Use this method when adding custom data with a ticker from the past, such as \"AOL\"\n        /// before it became \"TWX\", or if you need to filter using custom data and place trades on the\n        /// Symbol associated with the custom data.\n        /// </summary>\n        /// <param name=\"dataType\">Data source type</param>\n        /// <param name=\"underlying\"></param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>\n        /// We include three optional unused object parameters so that pythonnet chooses the intended method\n        /// correctly. Previously, calling the overloaded method that accepts a string would instead call this method.\n        /// Adding the three unused parameters makes it choose the correct method when using a string or Symbol. This is\n        /// due to pythonnet's method precedence, as viewable here: https://github.com/QuantConnect/pythonnet/blob/9e29755c54e6008cb016e3dd9d75fbd8cd19fcf7/src/runtime/methodbinder.cs#L215\n        /// </remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(Type dataType, Symbol underlying, Resolution? resolution = null, DateTimeZone timeZone = null, bool fillForward = false, decimal leverage = 1.0m)\n        {\n            var symbol = QuantConnect.Symbol.CreateBase(dataType, underlying, underlying.ID.Market);\n            return AddDataImpl(dataType, symbol, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData a new user defined data source including symbol properties and exchange hours,\n        /// all other vars are not required and will use defaults.\n        /// This overload reflects the C# equivalent for custom properties and market hours\n        /// </summary>\n        /// <param name=\"type\">Data source type</param>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"properties\">The properties of this new custom data</param>\n        /// <param name=\"exchangeHours\">The Exchange hours of this symbol</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData(PyObject type, string ticker, SymbolProperties properties, SecurityExchangeHours exchangeHours, Resolution? resolution = null, bool fillForward = false, decimal leverage = 1.0m)\n        {\n            // Get the right key for storage of base type symbols\n            var dataType = type.CreateType();\n            var key = SecurityIdentifier.GenerateBaseSymbol(dataType, ticker);\n\n            // Add entries to our Symbol Properties DB and MarketHours DB\n            SetDatabaseEntries(key, properties, exchangeHours);\n\n            // Then add the data\n            return AddData(dataType, ticker, resolution, null, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// Creates and adds a new Future Option contract to the algorithm.\n        /// </summary>\n        /// <param name=\"futureSymbol\">The Future canonical symbol (i.e. Symbol returned from <see cref=\"AddFuture\"/>)</param>\n        /// <param name=\"optionFilter\">Filter to apply to option contracts loaded as part of the universe</param>\n        /// <returns>The new Option security, containing a Future as its underlying.</returns>\n        /// <exception cref=\"ArgumentException\">The symbol provided is not canonical.</exception>\n        [DocumentationAttribute(AddingData)]\n        public void AddFutureOption(Symbol futureSymbol, PyObject optionFilter)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> optionFilterUniverse;\n            if (!optionFilter.TrySafeAs(out optionFilterUniverse))\n            {\n                throw new ArgumentException(\"Option contract universe filter provided is not a function\");\n            }\n\n            AddFutureOption(futureSymbol, optionFilterUniverse);\n        }\n\n        /// <summary>\n        /// Adds the provided final Symbol with/without underlying set to the algorithm.\n        /// This method is meant for custom data types that require a ticker, but have no underlying Symbol.\n        /// Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data\n        /// </summary>\n        /// <param name=\"dataType\">Data source type</param>\n        /// <param name=\"symbol\">Final symbol that includes underlying (if any)</param>\n        /// <param name=\"resolution\">Resolution of the Data required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        private Security AddDataImpl(Type dataType, Symbol symbol, Resolution? resolution, DateTimeZone timeZone, bool fillForward, decimal leverage)\n        {\n            var alias = symbol.ID.Symbol;\n            SymbolCache.Set(alias, symbol);\n\n            if (timeZone != null)\n            {\n                // user set time zone\n                MarketHoursDatabase.SetEntryAlwaysOpen(symbol.ID.Market, alias, SecurityType.Base, timeZone);\n            }\n\n            //Add this new generic data as a tradeable security:\n            var config = SubscriptionManager.SubscriptionDataConfigService.Add(\n                dataType,\n                symbol,\n                resolution,\n                fillForward,\n                isCustomData: true,\n                extendedMarketHours: true);\n            var security = Securities.CreateSecurity(symbol, config, leverage, addToSymbolCache: false);\n\n            return AddToUserDefinedUniverse(security, new List<SubscriptionDataConfig> { config });\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for coarse fundamental US Equity data and\n        /// will be executed on day changes in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"pyObject\">Defines an initial coarse selection</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject pyObject)\n        {\n            Func<IEnumerable<Fundamental>, object> fundamentalSelector;\n            Universe universe;\n\n            if (pyObject.TryCreateType(out var type))\n            {\n                return AddUniverse(pyObject, null, null);\n            }\n            // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved\n            else if (pyObject.TryConvert(out universe))\n            {\n                return AddUniverse(universe);\n            }\n            else if (pyObject.TryConvert(out universe, allowPythonDerivative: true))\n            {\n                return AddUniverse(new UniversePythonWrapper(pyObject));\n            }\n            else if (pyObject.TrySafeAs(out fundamentalSelector))\n            {\n                return AddUniverse(FundamentalUniverse.USA(fundamentalSelector));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"QCAlgorithm.AddUniverse: {pyObject.Repr()} is not a valid argument.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for coarse and fine fundamental US Equity data and\n        /// will be executed on day changes in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"pyObject\">Defines an initial coarse selection or a universe</param>\n        /// <param name=\"pyfine\">Defines a more detailed selection with access to more data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject pyObject, PyObject pyfine)\n        {\n            Func<IEnumerable<CoarseFundamental>, object> coarseFunc;\n            Func<IEnumerable<FineFundamental>, object> fineFunc;\n\n            try\n            {\n                // this is due to a pythonNet limitation even if defining 'AddUniverse(IDateRule, PyObject)'\n                // it will chose this method instead\n                IDateRule dateRule;\n                using (Py.GIL())\n                {\n                    dateRule = pyObject.As<IDateRule>();\n                }\n\n                if (pyfine.TrySafeAs(out coarseFunc))\n                {\n                    return AddUniverse(dateRule, coarseFunc.ConvertToUniverseSelectionSymbolDelegate());\n                }\n            }\n            catch (InvalidCastException)\n            {\n                // pass\n            }\n\n            if (pyObject.TryCreateType(out var type))\n            {\n                return AddUniverse(pyObject, null, pyfine);\n            }\n            else if (pyObject.TryConvert(out Universe universe) && pyfine.TrySafeAs(out fineFunc))\n            {\n                return AddUniverse(universe, fineFunc.ConvertToUniverseSelectionSymbolDelegate());\n            }\n            else if (pyObject.TrySafeAs(out coarseFunc) && pyfine.TrySafeAs(out fineFunc))\n            {\n                return AddUniverse(coarseFunc.ConvertToUniverseSelectionSymbolDelegate(),\n                    fineFunc.ConvertToUniverseSelectionSymbolDelegate());\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"QCAlgorithm.AddUniverse: {pyObject.Repr()} or {pyfine.Repr()} is not a valid argument.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This can be used to return a list of string\n        /// symbols retrieved from anywhere and will loads those symbols under the US Equity market.\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The resolution this universe should be triggered on</param>\n        /// <param name=\"pySelector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(string name, Resolution resolution, PyObject pySelector)\n        {\n            var selector = pySelector.SafeAs<Func<DateTime, object>>();\n            return AddUniverse(name, resolution, selector.ConvertToUniverseSelectionStringDelegate());\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This can be used to return a list of string\n        /// symbols retrieved from anywhere and will loads those symbols under the US Equity market.\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"pySelector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(string name, PyObject pySelector)\n        {\n            var selector = pySelector.SafeAs<Func<DateTime, object>>();\n            return AddUniverse(name, selector.ConvertToUniverseSelectionStringDelegate());\n        }\n\n        /// <summary>\n        /// Creates a new user defined universe that will fire on the requested resolution during market hours.\n        /// </summary>\n        /// <param name=\"securityType\">The security type of the universe</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The resolution this universe should be triggered on</param>\n        /// <param name=\"market\">The market of the universe</param>\n        /// <param name=\"universeSettings\">The subscription settings used for securities added from this universe</param>\n        /// <param name=\"pySelector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, PyObject pySelector)\n        {\n            var selector = pySelector.SafeAs<Func<DateTime, object>>();\n            return AddUniverse(securityType, name, resolution, market, universeSettings, selector.ConvertToUniverseSelectionStringDelegate());\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, string name, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), null, name, null, null, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Market.USA and UniverseSettings\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, string name, Resolution resolution, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), null, name, resolution, null, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, and Market.USA\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, string name, Resolution resolution, UniverseSettings universeSettings, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), null, name, resolution, null, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, and Market.USA\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, string name, UniverseSettings universeSettings, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), null, name, null, null, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property.\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"securityType\">The security type the universe produces</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, SecurityType securityType, string name, Resolution resolution, string market, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), securityType, name, resolution, market, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm\n        /// </summary>\n        /// <param name=\"T\">The data type</param>\n        /// <param name=\"securityType\">The security type the universe produces</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"universeSettings\">The subscription settings to use for newly created subscriptions</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(PyObject T, SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, PyObject selector)\n        {\n            return AddUniverse(T.CreateType(), securityType, name, resolution, market, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm\n        /// </summary>\n        /// <param name=\"dataType\">The data type</param>\n        /// <param name=\"securityType\">The security type the universe produces</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"universeSettings\">The subscription settings to use for newly created subscriptions</param>\n        /// <param name=\"pySelector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(Type dataType, SecurityType? securityType = null, string name = null, Resolution? resolution = null, string market = null, UniverseSettings universeSettings = null, PyObject pySelector = null)\n        {\n            if (market.IsNullOrEmpty())\n            {\n                market = Market.USA;\n            }\n            securityType ??= SecurityType.Equity;\n            Func<IEnumerable<BaseData>, IEnumerable<Symbol>> wrappedSelector = null;\n            if (pySelector != null)\n            {\n                var selector = pySelector.SafeAs<Func<IEnumerable<IBaseData>, object>>();\n                wrappedSelector = baseDatas =>\n                {\n                    var result = selector(baseDatas);\n                    if (ReferenceEquals(result, Universe.Unchanged))\n                    {\n                        return Universe.Unchanged;\n                    }\n                    return ((object[])result).Select(x => x is Symbol symbol ? symbol : QuantConnect.Symbol.Create((string)x, securityType.Value, market, baseDataType: dataType));\n                };\n            }\n            return AddUniverseSymbolSelector(dataType, name, resolution, market, universeSettings, wrappedSelector);\n        }\n\n        /// <summary>\n        /// Creates a new universe selection model and adds it to the algorithm. This universe selection model will chain to the security\n        /// changes of a given <see cref=\"Universe\"/> selection output and create a new <see cref=\"OptionChainUniverse\"/> for each of them\n        /// </summary>\n        /// <param name=\"universe\">The universe we want to chain an option universe selection model too</param>\n        /// <param name=\"optionFilter\">The option filter universe to use</param>\n        [DocumentationAttribute(Universes)]\n        public void AddUniverseOptions(PyObject universe, PyObject optionFilter)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> convertedOptionChain;\n            Universe universeToChain;\n\n            if (universe.TryConvert(out universeToChain) && optionFilter.TrySafeAs(out convertedOptionChain))\n            {\n                AddUniverseOptions(universeToChain, convertedOptionChain);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"QCAlgorithm.AddChainedEquityOptionUniverseSelectionModel: {universe.Repr()} or {optionFilter.Repr()} is not a valid argument.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(ConsolidatingData)]\n        public void RegisterIndicator(Symbol symbol, PyObject indicator, Resolution? resolution = null, PyObject selector = null)\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution), selector);\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"resolution\">The resolution at which to send data to the indicator, null to use the same resolution as the subscription</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(ConsolidatingData)]\n        public void RegisterIndicator(Symbol symbol, PyObject indicator, TimeSpan? resolution = null, PyObject selector = null)\n        {\n            RegisterIndicator(symbol, indicator, ResolveConsolidator(symbol, resolution), selector);\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"pyObject\">The python object that it is trying to register with, could be consolidator or a timespan</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(ConsolidatingData)]\n        public void RegisterIndicator(Symbol symbol, PyObject indicator, PyObject pyObject, PyObject selector = null)\n        {\n            // First check if this is just a regular IDataConsolidator\n            IDataConsolidator dataConsolidator;\n            if (pyObject.TryConvert(out dataConsolidator))\n            {\n                RegisterIndicator(symbol, indicator, dataConsolidator, selector);\n                return;\n            }\n\n            try\n            {\n                dataConsolidator = new DataConsolidatorPythonWrapper(pyObject);\n            }\n            catch\n            {\n                // Finally, since above didn't work, just try it as a timespan\n                // Issue #4668 Fix\n                using (Py.GIL())\n                {\n                    try\n                    {\n                        // tryConvert does not work for timespan\n                        TimeSpan? timeSpan = pyObject.SafeAs<TimeSpan>();\n                        if (timeSpan != default(TimeSpan))\n                        {\n                            RegisterIndicator(symbol, indicator, timeSpan, selector);\n                            return;\n                        }\n                    }\n                    catch (Exception e)\n                    {\n                        throw new ArgumentException(\"Invalid third argument, should be either a valid consolidator or timedelta object. The following exception was thrown: \", e);\n                    }\n                }\n            }\n\n            RegisterIndicator(symbol, indicator, dataConsolidator, selector);\n        }\n\n        /// <summary>\n        /// Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates\n        /// from the consolidator.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to register against</param>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"consolidator\">The consolidator to receive raw subscription data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(ConsolidatingData)]\n        public void RegisterIndicator(Symbol symbol, PyObject indicator, IDataConsolidator consolidator, PyObject selector = null)\n        {\n            // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    RegisterIndicator(symbol, pythonIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    RegisterIndicator(symbol, dataPointIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, decimal>>());\n                    break;\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    RegisterIndicator(symbol, baseDataBarIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n                    break;\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    RegisterIndicator(symbol, tradeBarIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, TradeBar>>());\n                    break;\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    RegisterIndicator(symbol, baseDataIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    RegisterIndicator(symbol, baseDataIndicator, consolidator,\n                        selector?.SafeAs<Func<IBaseData, BaseData>>());\n                    break;\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(HistoricalData)]\n        public void WarmUpIndicator(Symbol symbol, PyObject indicator, Resolution? resolution = null, PyObject selector = null)\n        {\n            // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved\n            WarmUpIndicator([symbol], indicator, resolution, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol or symbols to retrieve historical data for</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(HistoricalData)]\n        public void WarmUpIndicator(PyObject symbol, PyObject indicator, Resolution? resolution = null, PyObject selector = null)\n        {\n            // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved\n            var symbols = symbol.ConvertToSymbolEnumerable();\n            WarmUpIndicator(symbols, indicator, resolution, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        private void WarmUpIndicator(IEnumerable<Symbol> symbols, PyObject indicator, Resolution? resolution = null, PyObject selector = null)\n        {\n            // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    WarmUpIndicator(symbols, pythonIndicator, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    WarmUpIndicator(symbols, dataPointIndicator, resolution, selector?.SafeAs<Func<IBaseData, decimal>>());\n                    break;\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    WarmUpIndicator(symbols, baseDataBarIndicator, resolution, selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n                    break;\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    WarmUpIndicator(symbols, tradeBarIndicator, resolution, selector?.SafeAs<Func<IBaseData, TradeBar>>());\n                    break;\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    WarmUpIndicator(symbols, baseDataIndicator, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    WarmUpIndicator(symbols, baseDataIndicator, resolution, selector?.SafeAs<Func<IBaseData, BaseData>>());\n                    break;\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose indicator we want</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(HistoricalData)]\n        public void WarmUpIndicator(Symbol symbol, PyObject indicator, TimeSpan period, PyObject selector = null)\n        {\n            WarmUpIndicator([symbol], indicator, period, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol or symbols to retrieve historical data for</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        [DocumentationAttribute(Indicators)]\n        [DocumentationAttribute(HistoricalData)]\n        public void WarmUpIndicator(PyObject symbol, PyObject indicator, TimeSpan period, PyObject selector = null)\n        {\n            var symbols = symbol.ConvertToSymbolEnumerable();\n            WarmUpIndicator(symbols, indicator, period, selector);\n        }\n\n        /// <summary>\n        /// Warms up a given indicator with historical data\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve historical data for</param>\n        /// <param name=\"indicator\">The indicator we want to warm up</param>\n        /// <param name=\"period\">The necessary period to warm up the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)</param>\n        private void WarmUpIndicator(IEnumerable<Symbol> symbols, PyObject indicator, TimeSpan period, PyObject selector = null)\n        {\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    WarmUpIndicator(symbols, pythonIndicator, period, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    WarmUpIndicator(symbols, dataPointIndicator, period, selector?.SafeAs<Func<IBaseData, decimal>>());\n                    break;\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    WarmUpIndicator(symbols, baseDataBarIndicator, period, selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n                    break;\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    WarmUpIndicator(symbols, tradeBarIndicator, period, selector?.SafeAs<Func<IBaseData, TradeBar>>());\n                    break;\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    WarmUpIndicator(symbols, baseDataIndicator, period, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n                    break;\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    WarmUpIndicator(symbols, baseDataIndicator, period, selector?.SafeAs<Func<IBaseData, BaseData>>());\n                    break;\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Plot a chart using string series name, with value.\n        /// </summary>\n        /// <param name=\"series\">Name of the plot series</param>\n        /// <param name=\"pyObject\">PyObject with the value to plot</param>\n        /// <seealso cref=\"Plot(string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string series, PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                if (pyObject.TryConvert(out IndicatorBase indicator, true))\n                {\n                    Plot(series, indicator);\n                }\n                else\n                {\n                    try\n                    {\n                        var value = (((dynamic)pyObject).Value as PyObject).GetAndDispose<decimal>();\n                        Plot(series, value);\n                    }\n                    catch\n                    {\n                        var pythonType = pyObject.GetPythonType().Repr();\n                        throw new ArgumentException($\"QCAlgorithm.Plot(): The last argument should be a QuantConnect Indicator object, {pythonType} was provided.\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Plots the value of each indicator on the chart\n        /// </summary>\n        /// <param name=\"chart\">The chart's name</param>\n        /// <param name=\"first\">The first indicator to plot</param>\n        /// <param name=\"second\">The second indicator to plot</param>\n        /// <param name=\"third\">The third indicator to plot</param>\n        /// <param name=\"fourth\">The fourth indicator to plot</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, Indicator first, Indicator second = null, Indicator third = null, Indicator fourth = null)\n        {\n            Plot(chart, new[] { first, second, third, fourth }.Where(x => x != null).ToArray());\n        }\n\n        /// <summary>\n        /// Plots the value of each indicator on the chart\n        /// </summary>\n        /// <param name=\"chart\">The chart's name</param>\n        /// <param name=\"first\">The first indicator to plot</param>\n        /// <param name=\"second\">The second indicator to plot</param>\n        /// <param name=\"third\">The third indicator to plot</param>\n        /// <param name=\"fourth\">The fourth indicator to plot</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, BarIndicator first, BarIndicator second = null, BarIndicator third = null, BarIndicator fourth = null)\n        {\n            Plot(chart, new[] { first, second, third, fourth }.Where(x => x != null).ToArray());\n        }\n\n        /// <summary>\n        /// Plots the value of each indicator on the chart\n        /// </summary>\n        /// <param name=\"chart\">The chart's name</param>\n        /// <param name=\"first\">The first indicator to plot</param>\n        /// <param name=\"second\">The second indicator to plot</param>\n        /// <param name=\"third\">The third indicator to plot</param>\n        /// <param name=\"fourth\">The fourth indicator to plot</param>\n        /// <seealso cref=\"Plot(string,string,decimal)\"/>\n        [DocumentationAttribute(Charting)]\n        public void Plot(string chart, TradeBarIndicator first, TradeBarIndicator second = null, TradeBarIndicator third = null, TradeBarIndicator fourth = null)\n        {\n            Plot(chart, new[] { first, second, third, fourth }.Where(x => x != null).ToArray());\n        }\n\n        /// <summary>\n        /// Automatically plots each indicator when a new value is available\n        /// </summary>\n        [DocumentationAttribute(Charting)]\n        [DocumentationAttribute(Indicators)]\n        public void PlotIndicator(string chart, PyObject first, PyObject second = null, PyObject third = null, PyObject fourth = null)\n        {\n            var array = GetIndicatorArray(first, second, third, fourth);\n            PlotIndicator(chart, array[0], array[1], array[2], array[3]);\n        }\n\n        /// <summary>\n        /// Automatically plots each indicator when a new value is available\n        /// </summary>\n        [DocumentationAttribute(Charting)]\n        [DocumentationAttribute(Indicators)]\n        public void PlotIndicator(string chart, bool waitForReady, PyObject first, PyObject second = null, PyObject third = null, PyObject fourth = null)\n        {\n            var array = GetIndicatorArray(first, second, third, fourth);\n            PlotIndicator(chart, waitForReady, array[0], array[1], array[2], array[3]);\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, PyObject selector = null, PyObject filter = null, string fieldName = null)\n        {\n            var resolution = GetSubscription(symbol).Resolution;\n            return FilteredIdentity(symbol, resolution, selector, filter, fieldName);\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, Resolution resolution, PyObject selector = null, PyObject filter = null, string fieldName = null)\n        {\n            var name = CreateIndicatorName(symbol, fieldName ?? \"close\", resolution);\n            var pyselector = PythonUtil.ToFunc<IBaseData, IBaseDataBar>(selector);\n            var filteredIdentity = new FilteredIdentity(name, filter);\n            RegisterIndicator(symbol, filteredIdentity, resolution, pyselector);\n            return filteredIdentity;\n        }\n\n        /// <summary>\n        /// Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically\n        /// updated on the symbol's subscription resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose values we want as an indicator</param>\n        /// <param name=\"resolution\">The desired resolution of the data</param>\n        /// <param name=\"selector\">Selects a value from the BaseData, if null defaults to the .Value property (x => x.Value)</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        /// <param name=\"fieldName\">The name of the field being selected</param>\n        /// <returns>A new FilteredIdentity indicator for the specified symbol and selector</returns>\n        [DocumentationAttribute(Indicators)]\n        public FilteredIdentity FilteredIdentity(Symbol symbol, TimeSpan resolution, PyObject selector = null, PyObject filter = null, string fieldName = null)\n        {\n            var name = $\"{symbol}({fieldName ?? \"close\"}_{resolution.ToStringInvariant(null)})\";\n            var pyselector = PythonUtil.ToFunc<IBaseData, IBaseDataBar>(selector);\n            var filteredIdentity = new FilteredIdentity(name, filter);\n            RegisterIndicator(symbol, filteredIdentity, ResolveConsolidator(symbol, resolution), pyselector);\n            return filteredIdentity;\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>A python dictionary with pandas DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject tickers, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            if (tickers.TryConvert<Universe>(out var universe))\n            {\n                resolution ??= universe.Configuration.Resolution;\n                var requests = CreateBarCountHistoryRequests(new[] { universe.Symbol }, universe.DataType, periods, resolution, fillForward, extendedMarketHours,\n                    dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                // we pass in 'BaseDataCollection' type so we clean up the data frame if we can\n                return GetDataFrame(History(requests.Where(x => x != null)), flatten, typeof(BaseDataCollection));\n            }\n            if (tickers.TryCreateType(out var type))\n            {\n                var requests = CreateBarCountHistoryRequests(Securities.Keys, type, periods, resolution, fillForward, extendedMarketHours,\n                    dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                return GetDataFrame(History(requests.Where(x => x != null)), flatten, type);\n            }\n\n            var symbols = tickers.ConvertToSymbolEnumerable().ToArray();\n            var dataType = Extensions.GetCustomDataTypeFromSymbols(symbols);\n\n            return GetDataFrame(\n                History(symbols, periods, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset),\n                flatten,\n                dataType);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols over the requested span.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>A python dictionary with pandas DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject tickers, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            return History(tickers, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset, flatten);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>A python dictionary with a pandas DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject tickers, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            if (tickers.TryConvert<Universe>(out var universe))\n            {\n                resolution ??= universe.Configuration.Resolution;\n                var requests = CreateDateRangeHistoryRequests(new[] { universe.Symbol }, universe.DataType, start, end, resolution, fillForward, extendedMarketHours,\n                    dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                // we pass in 'BaseDataCollection' type so we clean up the data frame if we can\n                return GetDataFrame(History(requests.Where(x => x != null)), flatten, typeof(BaseDataCollection));\n            }\n            if (tickers.TryCreateType(out var type))\n            {\n                var requests = CreateDateRangeHistoryRequests(Securities.Keys, type, start, end, resolution, fillForward, extendedMarketHours,\n                    dataMappingMode, dataNormalizationMode, contractDepthOffset);\n                return GetDataFrame(History(requests.Where(x => x != null)), flatten, type);\n            }\n\n            var symbols = tickers.ConvertToSymbolEnumerable().ToArray();\n            var dataType = Extensions.GetCustomDataTypeFromSymbols(symbols);\n\n            return GetDataFrame(\n                History(symbols, start, end, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset),\n                flatten,\n                dataType);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, PyObject tickers, DateTime start, DateTime end, Resolution? resolution = null,\n            bool? fillForward = null, bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null, int? contractDepthOffset = null, bool flatten = false)\n        {\n            var symbols = tickers.ConvertToSymbolEnumerable().ToArray();\n            var requestedType = type.CreateType();\n            var requests = CreateDateRangeHistoryRequests(symbols, requestedType, start, end, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            return GetDataFrame(History(requests.Where(x => x != null)), flatten, requestedType);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols. The exact number of bars will be returned for\n        /// each symbol. This may result in some data start earlier/later than others due to when various\n        /// exchanges are open. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, PyObject tickers, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            var symbols = tickers.ConvertToSymbolEnumerable().ToArray();\n            var requestedType = type.CreateType();\n            CheckPeriodBasedHistoryRequestResolution(symbols, resolution, requestedType);\n\n            var requests = CreateBarCountHistoryRequests(symbols, requestedType, periods, resolution, fillForward, extendedMarketHours,\n                dataMappingMode, dataNormalizationMode, contractDepthOffset);\n\n            return GetDataFrame(History(requests.Where(x => x != null)), flatten, requestedType);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols over the requested span.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"tickers\">The symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, PyObject tickers, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            return History(type, tickers, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset, flatten);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            return History(type.CreateType(), symbol, start, end, resolution, fillForward, extendedMarketHours, dataMappingMode,\n                dataNormalizationMode, contractDepthOffset, flatten);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        private PyObject History(Type type, Symbol symbol, DateTime start, DateTime end, Resolution? resolution, bool? fillForward,\n            bool? extendedMarketHours, DataMappingMode? dataMappingMode, DataNormalizationMode? dataNormalizationMode,\n            int? contractDepthOffset, bool flatten)\n        {\n            var requests = CreateDateRangeHistoryRequests(new[] { symbol }, type, start, end, resolution, fillForward,\n                extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset);\n            if (requests.IsNullOrEmpty())\n            {\n                throw new ArgumentException($\"No history data could be fetched. \" +\n                    $\"This could be due to the specified security not being of the requested type. Symbol: {symbol} Requested Type: {type.Name}\");\n            }\n\n            return GetDataFrame(History(requests), flatten, type);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols. The exact number of bars will be returned for\n        /// each symbol. This may result in some data start earlier/later than others due to when various\n        /// exchanges are open. The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, Symbol symbol, int periods, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            var managedType = type.CreateType();\n            resolution = GetResolution(symbol, resolution, managedType);\n            CheckPeriodBasedHistoryRequestResolution(new[] { symbol }, resolution, managedType);\n\n            var marketHours = GetMarketHours(symbol, managedType);\n            var start = _historyRequestFactory.GetStartTimeAlgoTz(symbol, periods, resolution.Value, marketHours.ExchangeHours,\n                marketHours.DataTimeZone, managedType, extendedMarketHours);\n            return History(managedType, symbol, start, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset, flatten);\n        }\n\n        /// <summary>\n        /// Gets the historical data for the specified symbols over the requested span.\n        /// The symbols must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"type\">The data type of the symbols</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// e.g. for universe requests, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>pandas.DataFrame containing the requested historical data</returns>\n        [DocumentationAttribute(HistoricalData)]\n        public PyObject History(PyObject type, Symbol symbol, TimeSpan span, Resolution? resolution = null, bool? fillForward = null,\n            bool? extendedMarketHours = null, DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null, bool flatten = false)\n        {\n            return History(type, symbol, Time - span, Time, resolution, fillForward, extendedMarketHours, dataMappingMode, dataNormalizationMode,\n                contractDepthOffset, flatten);\n        }\n\n        /// <summary>\n        /// Sets the specified function as the benchmark, this function provides the value of\n        /// the benchmark at each date/time requested\n        /// </summary>\n        /// <param name=\"benchmark\">The benchmark producing function</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public void SetBenchmark(PyObject benchmark)\n        {\n            using (Py.GIL())\n            {\n                var pyBenchmark = PythonUtil.ToFunc<DateTime, decimal>(benchmark);\n                if (pyBenchmark != null)\n                {\n                    SetBenchmark(pyBenchmark);\n                    return;\n                }\n                SetBenchmark((Symbol)benchmark.AsManagedObject(typeof(Symbol)));\n            }\n        }\n\n        /// <summary>\n        /// Sets the brokerage to emulate in backtesting or paper trading.\n        /// This can be used to set a custom brokerage model.\n        /// </summary>\n        /// <param name=\"model\">The brokerage model to use</param>\n        [DocumentationAttribute(Modeling)]\n        public void SetBrokerageModel(PyObject model)\n        {\n            var brokerageModel = PythonUtil.CreateInstanceOrWrapper<IBrokerageModel>(\n                model,\n                py => new BrokerageModelPythonWrapper(py)\n            );\n            SetBrokerageModel(brokerageModel);\n        }\n\n        /// <summary>\n        /// Sets the implementation used to handle messages from the brokerage.\n        /// The default implementation will forward messages to debug or error\n        /// and when a <see cref=\"BrokerageMessageType.Error\"/> occurs, the algorithm\n        /// is stopped.\n        /// </summary>\n        /// <param name=\"handler\">The message handler to use</param>\n        [DocumentationAttribute(Modeling)]\n        [DocumentationAttribute(Logging)]\n        public void SetBrokerageMessageHandler(PyObject handler)\n        {\n            var brokerageMessageHandler = PythonUtil.CreateInstanceOrWrapper<IBrokerageMessageHandler>(\n                handler,\n                py => new BrokerageMessageHandlerPythonWrapper(py)\n            );\n            SetBrokerageMessageHandler(brokerageMessageHandler);\n        }\n\n        /// <summary>\n        /// Sets the risk free interest rate model to be used in the algorithm\n        /// </summary>\n        /// <param name=\"model\">The risk free interest rate model to use</param>\n        [DocumentationAttribute(Modeling)]\n        public void SetRiskFreeInterestRateModel(PyObject model)\n        {\n            var riskFreeInterestRateModel = PythonUtil.CreateInstanceOrWrapper<IRiskFreeInterestRateModel>(\n                model,\n                py => new RiskFreeInterestRateModelPythonWrapper(py)\n            );\n            SetRiskFreeInterestRateModel(riskFreeInterestRateModel);\n        }\n\n        /// <summary>\n        /// Sets the security initializer function, used to initialize/configure securities after creation\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer function or class</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void SetSecurityInitializer(PyObject securityInitializer)\n        {\n            var securityInitializer1 = PythonUtil.ToAction<Security>(securityInitializer);\n            if (securityInitializer1 != null)\n            {\n                SetSecurityInitializer(securityInitializer1);\n                return;\n            }\n\n            SetSecurityInitializer(new SecurityInitializerPythonWrapper(securityInitializer));\n        }\n\n        /// <summary>\n        /// Adds a security initializer, used to initialize/configure securities after creation.\n        /// The initializer will appended to the default initializer and others that might have been\n        /// added using this method, and will be applied to all universes and manually added securities.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer function or class</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void AddSecurityInitializer(PyObject securityInitializer)\n        {\n            var securityInitializer1 = PythonUtil.ToAction<Security>(securityInitializer);\n            if (securityInitializer1 != null)\n            {\n                AddSecurityInitializer(securityInitializer1);\n                return;\n            }\n            AddSecurityInitializer(new SecurityInitializerPythonWrapper(securityInitializer));\n        }\n\n        /// <summary>\n        /// Downloads the requested resource as a <see cref=\"string\"/>.\n        /// The resource to download is specified as a <see cref=\"string\"/> containing the URI.\n        /// </summary>\n        /// <param name=\"address\">A string containing the URI to download</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        /// <returns>The requested resource as a <see cref=\"string\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public string Download(string address, PyObject headers) => Download(address, headers, null, null);\n\n        /// <summary>\n        /// Downloads the requested resource as a <see cref=\"string\"/>.\n        /// The resource to download is specified as a <see cref=\"string\"/> containing the URI.\n        /// </summary>\n        /// <param name=\"address\">A string containing the URI to download</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        /// <param name=\"userName\">The user name associated with the credentials</param>\n        /// <param name=\"password\">The password for the user name associated with the credentials</param>\n        /// <returns>The requested resource as a <see cref=\"string\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public string Download(string address, PyObject headers, string userName, string password)\n        {\n            var dict = new Dictionary<string, string>();\n\n            if (headers != null)\n            {\n                using (Py.GIL())\n                {\n                    // In python algorithms, headers must be a python dictionary\n                    // In order to convert it into a C# Dictionary\n                    if (PyDict.IsDictType(headers))\n                    {\n                        using var iterator = headers.GetIterator();\n                        foreach (PyObject pyKey in iterator)\n                        {\n                            var key = (string)pyKey.AsManagedObject(typeof(string));\n                            var value = (string)headers.GetItem(pyKey).AsManagedObject(typeof(string));\n                            dict.Add(key, value);\n                        }\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"QCAlgorithm.Fetch(): Invalid argument. {headers.Repr()} is not a dict\");\n                    }\n                }\n            }\n            return Download(address, dict, userName, password);\n        }\n\n        /// <summary>\n        /// Send a debug message to the web console:\n        /// </summary>\n        /// <param name=\"message\">Message to send to debug console</param>\n        /// <seealso cref=\"Log(PyObject)\"/>\n        /// <seealso cref=\"Error(PyObject)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Debug(PyObject message)\n        {\n            Debug(message.ToSafeString());\n        }\n\n        /// <summary>\n        /// Send a string error message to the Console.\n        /// </summary>\n        /// <param name=\"message\">Message to display in errors grid</param>\n        /// <seealso cref=\"Debug(PyObject)\"/>\n        /// <seealso cref=\"Log(PyObject)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(PyObject message)\n        {\n            Error(message.ToSafeString());\n        }\n\n        /// <summary>\n        /// Added another method for logging if user guessed.\n        /// </summary>\n        /// <param name=\"message\">String message to log.</param>\n        /// <seealso cref=\"Debug(PyObject)\"/>\n        /// <seealso cref=\"Error(PyObject)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Log(PyObject message)\n        {\n            Log(message.ToSafeString());\n        }\n\n        /// <summary>\n        /// Terminate the algorithm after processing the current event handler.\n        /// </summary>\n        /// <param name=\"message\">Exit message to display on quitting</param>\n        [DocumentationAttribute(Logging)]\n        public void Quit(PyObject message)\n        {\n            Quit(message.ToSafeString());\n        }\n\n        /// <summary>\n        /// Creates and registers a consolidator for the following bar types: RenkoBar, VolumeRenkoBar, or RangeBar\n        /// for the specified symbol and threshold. The specified handler will be invoked with each new consolidated bar.\n        /// </summary>\n        /// <param name=\"type\">The Python type of the bar (RenkoBar, VolumeRenkoBar, or RangeBar)</param>\n        /// <param name=\"symbol\">The symbol whose data is to be consolidated</param>\n        /// <param name=\"size\">The size value for the consolidator (e.g., brick size, range size or maxCount)</param>\n        /// <param name=\"tickType\">The tick type to consolidate. If null, the first matching subscription is used.</param>\n        /// <param name=\"handler\">The callback to invoke with each new consolidated bar</param>\n        /// <returns>The created and registered <see cref=\"IDataConsolidator\"/> instance</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(PyObject type, Symbol symbol, decimal size, TickType? tickType, PyObject handler)\n        {\n            var convertedType = type.CreateType();\n\n            if (convertedType == typeof(RenkoBar))\n            {\n                // size will be used as barSize\n                return Consolidate(symbol, size, tickType, handler.SafeAs<Action<RenkoBar>>());\n            }\n            else if (convertedType == typeof(VolumeRenkoBar))\n            {\n                // size will be used as barSize\n                return Consolidate(symbol, size, tickType, handler.SafeAs<Action<VolumeRenkoBar>>());\n            }\n            else if (convertedType == typeof(RangeBar))\n            {\n                // size will be used as rangeSize\n                return Consolidate(symbol, (int)size, tickType, handler.SafeAs<Action<RangeBar>>());\n            }\n            else if (convertedType == typeof(TradeBar))\n            {\n                // size will be used as maxCount\n                return Consolidate(symbol, (int)size, tickType, handler.SafeAs<Action<TradeBar>>());\n            }\n            else if (convertedType == typeof(QuoteBar))\n            {\n                // size will be used as maxCount\n                return Consolidate(symbol, (int)size, tickType, handler.SafeAs<Action<QuoteBar>>());\n            }\n            else\n            {\n                // size will be used as maxCount\n                return Consolidate(symbol, (int)size, tickType, handler.SafeAs<Action<BaseData>>());\n            }\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Resolution period, PyObject handler)\n        {\n            return Consolidate(symbol, period, null, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Resolution period, TickType? tickType, PyObject handler)\n        {\n            // resolve consolidator input subscription\n            var type = GetSubscription(symbol, tickType).Type;\n\n            if (type == typeof(TradeBar))\n            {\n                return Consolidate(symbol, period, tickType, handler.SafeAs<Action<TradeBar>>());\n            }\n\n            if (type == typeof(QuoteBar))\n            {\n                return Consolidate(symbol, period, tickType, handler.SafeAs<Action<QuoteBar>>());\n            }\n\n            return Consolidate(symbol, period, tickType, handler.SafeAs<Action<BaseData>>());\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, TimeSpan period, PyObject handler)\n        {\n            return Consolidate(symbol, period, null, handler);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"period\">The consolidation period</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, TimeSpan period, TickType? tickType, PyObject handler)\n        {\n            // resolve consolidator input subscription\n            var type = GetSubscription(symbol, tickType).Type;\n\n            if (type == typeof(TradeBar))\n            {\n                return Consolidate(symbol, period, tickType, handler.SafeAs<Action<TradeBar>>());\n            }\n\n            if (type == typeof(QuoteBar))\n            {\n                return Consolidate(symbol, period, tickType, handler.SafeAs<Action<QuoteBar>>());\n            }\n\n            return Consolidate(symbol, period, tickType, handler.SafeAs<Action<BaseData>>());\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Func<DateTime, CalendarInfo> calendar, PyObject handler)\n        {\n            return Consolidate(symbol, calendar, null, handler);\n        }\n\n        /// <summary>\n        /// Schedules the provided training code to execute immediately\n        /// </summary>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        [DocumentationAttribute(MachineLearning)]\n        [DocumentationAttribute(ScheduledEvents)]\n        public ScheduledEvent Train(PyObject trainingCode)\n        {\n            return Schedule.TrainingNow(trainingCode);\n        }\n\n        /// <summary>\n        /// Schedules the training code to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        [DocumentationAttribute(MachineLearning)]\n        [DocumentationAttribute(ScheduledEvents)]\n        public ScheduledEvent Train(IDateRule dateRule, ITimeRule timeRule, PyObject trainingCode)\n        {\n            return Schedule.Training(dateRule, timeRule, trainingCode);\n        }\n\n        /// <summary>\n        /// Registers the <paramref name=\"handler\"/> to receive consolidated data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol who's data is to be consolidated</param>\n        /// <param name=\"calendar\">The consolidation calendar</param>\n        /// <param name=\"tickType\">The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.</param>\n        /// <param name=\"handler\">Data handler receives new consolidated data when generated</param>\n        /// <returns>A new consolidator matching the requested parameters with the handler already registered</returns>\n        [DocumentationAttribute(ConsolidatingData)]\n        public IDataConsolidator Consolidate(Symbol symbol, Func<DateTime, CalendarInfo> calendar, TickType? tickType, PyObject handler)\n        {\n            // resolve consolidator input subscription\n            var type = GetSubscription(symbol, tickType).Type;\n\n            if (type == typeof(TradeBar))\n            {\n                return Consolidate(symbol, calendar, tickType, handler.SafeAs<Action<TradeBar>>());\n            }\n\n            if (type == typeof(QuoteBar))\n            {\n                return Consolidate(symbol, calendar, tickType, handler.SafeAs<Action<QuoteBar>>());\n            }\n\n            return Consolidate(symbol, calendar, tickType, handler.SafeAs<Action<BaseData>>());\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol or symbols to retrieve historical data for</param>\n        /// <param name=\"period\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(PyObject indicator, PyObject symbol, int period, Resolution? resolution = null, PyObject selector = null)\n        {\n            var symbols = symbol.ConvertToSymbolEnumerable();\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    return IndicatorHistory(pythonIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    return IndicatorHistory(dataPointIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, decimal>>());\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    return IndicatorHistory(baseDataBarIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    return IndicatorHistory(tradeBarIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, TradeBar>>());\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, symbols, period, resolution, selector?.SafeAs<Func<IBaseData, BaseData>>());\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol or symbols to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(PyObject indicator, PyObject symbol, TimeSpan span, Resolution? resolution = null, PyObject selector = null)\n        {\n            return IndicatorHistory(indicator, symbol, Time - span, Time, resolution, selector);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"symbol\">The symbol or symbols to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        public IndicatorHistory IndicatorHistory(PyObject indicator, PyObject symbol, DateTime start, DateTime end, Resolution? resolution = null, PyObject selector = null)\n        {\n            var symbols = symbol.ConvertToSymbolEnumerable();\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    return IndicatorHistory(pythonIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    return IndicatorHistory(dataPointIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, decimal>>());\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    return IndicatorHistory(baseDataBarIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    return IndicatorHistory(tradeBarIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, TradeBar>>());\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, symbols, start, end, resolution, selector?.SafeAs<Func<IBaseData, BaseData>>());\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator and convert it into pandas.DataFrame\n        /// </summary>\n        /// <param name=\"indicator\">The target indicator</param>\n        /// <param name=\"history\">Historical data used to calculate the indicator</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame containing the historical data of <paramref name=\"indicator\"/></returns>\n        public IndicatorHistory IndicatorHistory(PyObject indicator, IEnumerable<Slice> history, PyObject selector = null)\n        {\n            var convertedIndicator = ConvertPythonIndicator(indicator);\n\n            switch (convertedIndicator)\n            {\n                case PythonIndicator pythonIndicator:\n                    return IndicatorHistory(pythonIndicator, history, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<IndicatorDataPoint> dataPointIndicator:\n                    return IndicatorHistory(dataPointIndicator, history, selector?.SafeAs<Func<IBaseData, decimal>>());\n\n                case IndicatorBase<IBaseDataBar> baseDataBarIndicator:\n                    return IndicatorHistory(baseDataBarIndicator, history, selector?.SafeAs<Func<IBaseData, IBaseDataBar>>());\n\n                case IndicatorBase<TradeBar> tradeBarIndicator:\n                    return IndicatorHistory(tradeBarIndicator, history, selector?.SafeAs<Func<IBaseData, TradeBar>>());\n\n                case IndicatorBase<IBaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, history, selector?.SafeAs<Func<IBaseData, IBaseData>>());\n\n                case IndicatorBase<BaseData> baseDataIndicator:\n                    return IndicatorHistory(baseDataIndicator, history, selector?.SafeAs<Func<IBaseData, BaseData>>());\n\n                default:\n                    // Shouldn't happen, ConvertPythonIndicator will wrap the PyObject in a PythonIndicator instance if it can't convert it\n                    throw new ArgumentException($\"Indicator type {indicator.GetPythonType().Name} is not supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Liquidate your portfolio holdings\n        /// </summary>\n        /// <param name=\"symbols\">List of symbols to liquidate in Python</param>\n        /// <param name=\"asynchronous\">Flag to indicate if the symbols should be liquidated asynchronously</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this</param>\n        /// <param name=\"orderProperties\">Order properties to use</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Liquidate(PyObject symbols, bool asynchronous = false, string tag = \"Liquidated\", IOrderProperties orderProperties = null)\n        {\n            return Liquidate(symbols.ConvertToSymbolEnumerable(), asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Register a command type to be used\n        /// </summary>\n        /// <param name=\"type\">The command type</param>\n        public void AddCommand(PyObject type)\n        {\n            // create a test instance to validate interface is implemented accurate\n            var testInstance = new CommandPythonWrapper(type);\n\n            var wrappedType = Extensions.CreateType(type);\n            _registeredCommands[wrappedType.Name] = (CallbackCommand command) =>\n            {\n                var commandWrapper = new CommandPythonWrapper(type, command.Payload);\n                return commandWrapper.Run(this);\n            };\n        }\n\n\n        /// <summary>\n        /// Get the option chains for the specified symbols at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbols\">\n        /// The symbols for which the option chain is asked for.\n        /// It can be either the canonical options or the underlying symbols.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The option chains</returns>\n        [DocumentationAttribute(AddingData)]\n        public OptionChains OptionChains(PyObject symbols, bool flatten = false)\n        {\n            return OptionChains(symbols.ConvertToSymbolEnumerable(), flatten);\n        }\n\n        /// <summary>\n        /// Get an authenticated link to execute the given command instance\n        /// </summary>\n        /// <param name=\"command\">The target command</param>\n        /// <returns>The authenticated link</returns>\n        public string Link(PyObject command)\n        {\n            var payload = ConvertCommandToPayload(command, out var typeName);\n            return CommandLink(typeName, payload);\n        }\n\n        /// <summary>\n        /// Broadcast a live command\n        /// </summary>\n        /// <param name=\"command\">The target command</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse BroadcastCommand(PyObject command)\n        {\n            var payload = ConvertCommandToPayload(command, out var typeName);\n            return SendBroadcast(typeName, payload);\n        }\n\n        /// <summary>\n        /// Convert the command to a dictionary payload\n        /// </summary>\n        /// <param name=\"command\">The target command</param>\n        /// <param name=\"typeName\">The type of the command</param>\n        /// <returns>The dictionary payload</returns>\n        private Dictionary<string, object> ConvertCommandToPayload(PyObject command, out string typeName)\n        {\n            using var _ = Py.GIL();\n\n            var strResult = CommandPythonWrapper.Serialize(command);\n            using var pyType = command.GetPythonType();\n            typeName = Extensions.CreateType(pyType).Name;\n\n            return JsonConvert.DeserializeObject<Dictionary<string, object>>(strResult);\n        }\n\n        /// <summary>\n        /// Gets indicator base type\n        /// </summary>\n        /// <param name=\"type\">Indicator type</param>\n        /// <returns>Indicator base type</returns>\n        private Type GetIndicatorBaseType(Type type)\n        {\n            if (type.BaseType == typeof(object))\n            {\n                return type;\n            }\n            return GetIndicatorBaseType(type.BaseType);\n        }\n\n        /// <summary>\n        /// Converts the sequence of PyObject objects into an array of dynamic objects that represent indicators of the same type\n        /// </summary>\n        /// <returns>Array of dynamic objects with indicator</returns>\n        private dynamic[] GetIndicatorArray(PyObject first, PyObject second = null, PyObject third = null, PyObject fourth = null)\n        {\n            using (Py.GIL())\n            {\n                var array = new[] { first, second, third, fourth }\n                    .Select(\n                        x =>\n                        {\n                            if (x == null) return null;\n\n                            Type type;\n                            return x.GetPythonType().TryConvert(out type)\n                                ? x.AsManagedObject(type)\n                                : WrapPythonIndicator(x);\n                        }\n                    ).ToArray();\n\n                var types = array.Where(x => x != null).Select(x => GetIndicatorBaseType(x.GetType())).Distinct();\n\n                if (types.Count() > 1)\n                {\n                    throw new Exception(\"QCAlgorithm.GetIndicatorArray(). All indicators must be of the same type: data point, bar or tradebar.\");\n                }\n\n                return array;\n            }\n        }\n\n        /// <summary>\n        /// Converts the given PyObject into an indicator\n        /// </summary>\n        private IndicatorBase ConvertPythonIndicator(PyObject pyIndicator)\n        {\n            IndicatorBase convertedIndicator;\n            if (pyIndicator.TryConvert(out PythonIndicator pythonIndicator))\n            {\n                convertedIndicator = WrapPythonIndicator(pyIndicator, pythonIndicator);\n            }\n            else if (!pyIndicator.TryConvert(out convertedIndicator))\n            {\n                convertedIndicator = WrapPythonIndicator(pyIndicator);\n            }\n\n            return convertedIndicator;\n        }\n\n        /// <summary>\n        /// Wraps a custom python indicator and save its reference to _pythonIndicators dictionary\n        /// </summary>\n        /// <param name=\"pyObject\">The python implementation of <see cref=\"IndicatorBase{IBaseDataBar}\"/></param>\n        /// <param name=\"convertedPythonIndicator\">The C# converted <paramref name=\"pyObject\"/> to avoid re-conversion</param>\n        /// <returns><see cref=\"PythonIndicator\"/> that wraps the python implementation</returns>\n        private PythonIndicator WrapPythonIndicator(PyObject pyObject, PythonIndicator convertedPythonIndicator = null)\n        {\n            PythonIndicator pythonIndicator;\n\n            if (!_pythonIndicators.TryGetValue(pyObject.Handle, out pythonIndicator))\n            {\n                if (convertedPythonIndicator == null)\n                {\n                    pyObject.TryConvert(out pythonIndicator);\n                }\n                else\n                {\n                    pythonIndicator = convertedPythonIndicator;\n                }\n\n                if (pythonIndicator == null)\n                {\n                    pythonIndicator = new PythonIndicator(pyObject);\n                }\n                else\n                {\n                    pythonIndicator.SetIndicator(pyObject);\n                }\n\n                // Save to prevent future additions\n                _pythonIndicators.Add(pyObject.Handle, pythonIndicator);\n            }\n\n            return pythonIndicator;\n        }\n\n        /// <summary>\n        /// Converts an enumerable of Slice into a Python Pandas data frame\n        /// </summary>\n        protected PyObject GetDataFrame(IEnumerable<Slice> data, bool flatten, Type dataType = null)\n        {\n            var history = PandasConverter.GetDataFrame(RemoveMemoizing(data), flatten, dataType);\n            return flatten ? history : TryCleanupCollectionDataFrame(dataType, history);\n        }\n\n        /// <summary>\n        /// Converts an enumerable of BaseData into a Python Pandas data frame\n        /// </summary>\n        protected PyObject GetDataFrame<T>(IEnumerable<T> data, bool flatten)\n            where T : IBaseData\n        {\n            var history = PandasConverter.GetDataFrame(RemoveMemoizing(data), flatten: flatten);\n            return flatten ? history : TryCleanupCollectionDataFrame(typeof(T), history);\n        }\n\n        private IEnumerable<T> RemoveMemoizing<T>(IEnumerable<T> data)\n        {\n            var memoizingEnumerable = data as MemoizingEnumerable<T>;\n            if (memoizingEnumerable != null)\n            {\n                // we don't need the internal buffer which will just generate garbage, so we disable it\n                // the user will only have access to the final pandas data frame object\n                memoizingEnumerable.Enabled = false;\n            }\n            return data;\n        }\n\n        private PyObject TryCleanupCollectionDataFrame(Type dataType, PyObject history)\n        {\n            if (dataType != null && dataType.IsAssignableTo(typeof(BaseDataCollection)))\n            {\n                // clear out the first symbol level since it doesn't make sense, it's the universe generic symbol\n                // let's directly return the data property which is where all the data points are in a BaseDataCollection, save the user some pain\n                dynamic dynamic = history;\n                using (Py.GIL())\n                {\n                    if (!dynamic.empty)\n                    {\n                        using var columns = new PySequence(dynamic.columns);\n                        using var dataKey = \"data\".ToPython();\n                        if (columns.Contains(dataKey))\n                        {\n                            history = dynamic[\"data\"];\n                        }\n                        else\n                        {\n                            dynamic.index = dynamic.index.droplevel(\"symbol\");\n                            history = dynamic;\n                        }\n                    }\n                }\n            }\n            return history;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Trading.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        private int _maxOrders = 10000;\n        private bool _isMarketOnOpenOrderWarningSent;\n        private bool _isMarketOnOpenOrderRestrictedForFuturesWarningSent;\n        private bool _isGtdTfiForMooAndMocOrdersValidationWarningSent;\n        private bool _isOptionsOrderOnStockSplitWarningSent;\n\n        /// <summary>\n        /// Transaction Manager - Process transaction fills and order management.\n        /// </summary>\n        [DocumentationAttribute(TradingAndOrders)]\n        public SecurityTransactionManager Transactions { get; set; }\n\n        /// <summary>\n        /// Buy Stock (Alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">string Symbol of the asset to trade</param>\n        /// <param name=\"quantity\">int Quantity of the asset to trade</param>\n        /// <seealso cref=\"Buy(Symbol, double)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Buy(Symbol symbol, int quantity)\n        {\n            return Order(symbol, (decimal)Math.Abs(quantity));\n        }\n\n        /// <summary>\n        /// Buy Stock (Alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">string Symbol of the asset to trade</param>\n        /// <param name=\"quantity\">double Quantity of the asset to trade</param>\n        /// <seealso cref=\"Buy(Symbol, decimal)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Buy(Symbol symbol, double quantity)\n        {\n            return Order(symbol, Math.Abs(quantity).SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Buy Stock (Alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">string Symbol of the asset to trade</param>\n        /// <param name=\"quantity\">decimal Quantity of the asset to trade</param>\n        /// <seealso cref=\"Order(Symbol, int)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Buy(Symbol symbol, decimal quantity)\n        {\n            return Order(symbol, Math.Abs(quantity));\n        }\n\n        /// <summary>\n        /// Buy Stock (Alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">string Symbol of the asset to trade</param>\n        /// <param name=\"quantity\">float Quantity of the asset to trade</param>\n        /// <seealso cref=\"Buy(Symbol, decimal)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Buy(Symbol symbol, float quantity)\n        {\n            return Order(symbol, (decimal)Math.Abs(quantity));\n        }\n\n\n        /// <summary>\n        /// Sell stock (alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">string Symbol of the asset to trade</param>\n        /// <param name=\"quantity\">int Quantity of the asset to trade</param>\n        /// <seealso cref=\"Sell(Symbol, decimal)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Sell(Symbol symbol, int quantity)\n        {\n            return Order(symbol, (decimal)Math.Abs(quantity) * -1);\n        }\n\n        /// <summary>\n        /// Sell stock (alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">String symbol to sell</param>\n        /// <param name=\"quantity\">Quantity to order</param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Sell(Symbol symbol, double quantity)\n        {\n            return Order(symbol, Math.Abs(quantity).SafeDecimalCast() * -1m);\n        }\n\n        /// <summary>\n        /// Sell stock (alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">String symbol</param>\n        /// <param name=\"quantity\">Quantity to sell</param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Sell(Symbol symbol, float quantity)\n        {\n            return Order(symbol, (decimal)Math.Abs(quantity) * -1m);\n        }\n\n        /// <summary>\n        /// Sell stock (alias of Order)\n        /// </summary>\n        /// <param name=\"symbol\">String symbol to sell</param>\n        /// <param name=\"quantity\">Quantity to sell</param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Sell(Symbol symbol, decimal quantity)\n        {\n            return Order(symbol, Math.Abs(quantity) * -1);\n        }\n\n        /// <summary>\n        /// Issue an order/trade for asset: Alias wrapper for Order(string, int);\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to order</param>\n        /// <param name=\"quantity\">Quantity to order</param>\n        /// <seealso cref=\"Order(Symbol, decimal)\"/>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, double quantity)\n        {\n            return Order(symbol, quantity.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Issue an order/trade for asset\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to order</param>\n        /// <param name=\"quantity\">Quantity to order</param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, int quantity)\n        {\n            return MarketOrder(symbol, (decimal)quantity);\n        }\n\n        /// <summary>\n        /// Issue an order/trade for asset\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to order</param>\n        /// <param name=\"quantity\">Quantity to order</param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, decimal quantity)\n        {\n            return MarketOrder(symbol, quantity);\n        }\n\n        /// <summary>\n        /// Wrapper for market order method: submit a new order for quantity of symbol using type order.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the MarketType Required.</param>\n        /// <param name=\"quantity\">Number of shares to request.</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOrder(symbol, quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market order implementation: Send a market order and wait for it to be filled.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the MarketType Required.</param>\n        /// <param name=\"quantity\">Number of shares to request.</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOrder(Symbol symbol, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOrder(symbol, (decimal)quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market order implementation: Send a market order and wait for it to be filled.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the MarketType Required.</param>\n        /// <param name=\"quantity\">Number of shares to request.</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOrder(Symbol symbol, double quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOrder(symbol, quantity.SafeDecimalCast(), asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market order implementation: Send a market order and wait for it to be filled.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the MarketType Required.</param>\n        /// <param name=\"quantity\">Number of shares to request.</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOrder(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n\n            // check the exchange is open before sending a market order, if it's not open then convert it into a market on open order.\n            // For futures and FOPs, market orders can be submitted on extended hours, so we let them through.\n            if ((security.Type != SecurityType.Future && security.Type != SecurityType.FutureOption) && !security.Exchange.ExchangeOpen)\n            {\n                var mooTicket = MarketOnOpenOrder(security.Symbol, quantity, asynchronous, tag, orderProperties);\n                if (!_isMarketOnOpenOrderWarningSent)\n                {\n                    var anyNonDailySubscriptions = security.Subscriptions.Any(x => x.Resolution != Resolution.Daily);\n                    if (mooTicket.SubmitRequest.Response.IsSuccess && !anyNonDailySubscriptions)\n                    {\n                        Debug(\"Warning: all market orders sent using daily data, or market orders sent after hours are automatically converted into MarketOnOpen orders.\");\n                        _isMarketOnOpenOrderWarningSent = true;\n                    }\n                }\n                return mooTicket;\n            }\n\n            var request = CreateSubmitOrderRequest(OrderType.Market, security, quantity, tag, orderProperties ?? DefaultOrderProperties?.Clone(), asynchronous);\n\n            //Add the order and create a new order Id.\n            var ticket = SubmitOrderRequest(request);\n\n            // Wait for the order event to process, only if the exchange is open and the order is valid\n            if (ticket.Status != OrderStatus.Invalid && !asynchronous)\n            {\n                Transactions.WaitForOrder(ticket.OrderId);\n            }\n\n            return ticket;\n        }\n\n        /// <summary>\n        /// Market on open order implementation: Send a market order when the exchange opens\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnOpenOrder(Symbol symbol, double quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOnOpenOrder(symbol, quantity.SafeDecimalCast(), asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market on open order implementation: Send a market order when the exchange opens\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnOpenOrder(Symbol symbol, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOnOpenOrder(symbol, (decimal)quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market on open order implementation: Send a market order when the exchange opens\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnOpenOrder(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var properties = orderProperties ?? DefaultOrderProperties?.Clone();\n            InvalidateGoodTilDateTimeInForce(properties);\n\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.MarketOnOpen, security, quantity, tag, properties, asynchronous);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Market on close order implementation: Send a market order when the exchange closes\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnCloseOrder(Symbol symbol, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOnCloseOrder(symbol, (decimal)quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market on close order implementation: Send a market order when the exchange closes\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnCloseOrder(Symbol symbol, double quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return MarketOnCloseOrder(symbol, quantity.SafeDecimalCast(), asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Market on close order implementation: Send a market order when the exchange closes\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be ordered</param>\n        /// <param name=\"quantity\">The number of shares to required</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Place a custom order property or tag (e.g. indicator data).</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket MarketOnCloseOrder(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var properties = orderProperties ?? DefaultOrderProperties?.Clone();\n            InvalidateGoodTilDateTimeInForce(properties);\n\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.MarketOnClose, security, quantity, tag, properties, asynchronous);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Send a limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitOrder(Symbol symbol, int quantity, decimal limitPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return LimitOrder(symbol, (decimal)quantity, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitOrder(Symbol symbol, double quantity, decimal limitPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return LimitOrder(symbol, quantity.SafeDecimalCast(), limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitOrder(Symbol symbol, decimal quantity, decimal limitPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.Limit, security, quantity, tag,\n                orderProperties ?? DefaultOrderProperties?.Clone(), asynchronous, limitPrice: limitPrice);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Create a stop market order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset we're trading</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Price to fill the stop order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopMarketOrder(Symbol symbol, int quantity, decimal stopPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return StopMarketOrder(symbol, (decimal)quantity, stopPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a stop market order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset we're trading</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Price to fill the stop order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopMarketOrder(Symbol symbol, double quantity, decimal stopPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return StopMarketOrder(symbol, quantity.SafeDecimalCast(), stopPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a stop market order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset we're trading</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Price to fill the stop order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopMarketOrder(Symbol symbol, decimal quantity, decimal stopPrice, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.StopMarket, security, quantity, tag,\n                orderProperties ?? DefaultOrderProperties?.Clone(), asynchronous, stopPrice: stopPrice);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid.\n        /// It will calculate the stop price using the trailing amount and the current market price.\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, int quantity, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return TrailingStopOrder(symbol, (decimal)quantity, trailingAmount, trailingAsPercentage, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid.\n        /// It will calculate the stop price using the trailing amount and the current market price.\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, double quantity, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return TrailingStopOrder(symbol, quantity.SafeDecimalCast(), trailingAmount, trailingAsPercentage, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid.\n        /// It will calculate the stop price using the trailing amount and the current market price.\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, decimal quantity, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var stopPrice = Orders.TrailingStopOrder.CalculateStopPrice(security.Price, trailingAmount, trailingAsPercentage,\n                quantity > 0 ? OrderDirection.Buy : OrderDirection.Sell);\n            return TrailingStopOrder(symbol, quantity, stopPrice, trailingAmount, trailingAsPercentage, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Initial stop price at which the order should be triggered</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, int quantity, decimal stopPrice, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return TrailingStopOrder(symbol, (decimal)quantity, stopPrice, trailingAmount, trailingAsPercentage, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Initial stop price at which the order should be triggered</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, double quantity, decimal stopPrice, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return TrailingStopOrder(symbol, quantity.SafeDecimalCast(), stopPrice, trailingAmount, trailingAsPercentage, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Create a trailing stop order and return the newly created order id; or negative if the order is invalid\n        /// </summary>\n        /// <param name=\"symbol\">Trading asset symbol</param>\n        /// <param name=\"quantity\">Quantity to be traded</param>\n        /// <param name=\"stopPrice\">Initial stop price at which the order should be triggered</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">Optional string data tag for the order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket TrailingStopOrder(Symbol symbol, decimal quantity, decimal stopPrice, decimal trailingAmount, bool trailingAsPercentage,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(\n                OrderType.TrailingStop,\n                security,\n                quantity,\n                tag,\n                stopPrice: stopPrice,\n                trailingAmount: trailingAmount,\n                trailingAsPercentage: trailingAsPercentage,\n                properties: orderProperties ?? DefaultOrderProperties?.Clone(),\n                asynchronous: asynchronous);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Send a stop limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"stopPrice\">Stop price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopLimitOrder(Symbol symbol, int quantity, decimal stopPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return StopLimitOrder(symbol, (decimal)quantity, stopPrice, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a stop limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"stopPrice\">Stop price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopLimitOrder(Symbol symbol, double quantity, decimal stopPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return StopLimitOrder(symbol, quantity.SafeDecimalCast(), stopPrice, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a stop limit order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"stopPrice\">Stop price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket StopLimitOrder(Symbol symbol, decimal quantity, decimal stopPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.StopLimit, security, quantity, tag, stopPrice: stopPrice,\n                limitPrice: limitPrice, properties: orderProperties ?? DefaultOrderProperties?.Clone(), asynchronous: asynchronous);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Send a limit if touched order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"triggerPrice\">Trigger price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitIfTouchedOrder(Symbol symbol, int quantity, decimal triggerPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return LimitIfTouchedOrder(symbol, (decimal)quantity, triggerPrice, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a limit if touched order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"triggerPrice\">Trigger price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitIfTouchedOrder(Symbol symbol, double quantity, decimal triggerPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return LimitIfTouchedOrder(symbol, quantity.SafeDecimalCast(), triggerPrice, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Send a limit if touched order to the transaction handler:\n        /// </summary>\n        /// <param name=\"symbol\">String symbol for the asset</param>\n        /// <param name=\"quantity\">Quantity of shares for limit order</param>\n        /// <param name=\"triggerPrice\">Trigger price for this order</param>\n        /// <param name=\"limitPrice\">Limit price to fill this order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket LimitIfTouchedOrder(Symbol symbol, decimal quantity, decimal triggerPrice, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var security = GetSecurityForOrder(symbol);\n            var request = CreateSubmitOrderRequest(OrderType.LimitIfTouched, security, quantity, tag,\n                triggerPrice: triggerPrice, limitPrice: limitPrice, properties: orderProperties ?? DefaultOrderProperties?.Clone(),\n                asynchronous: asynchronous);\n\n            return SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Send an exercise order to the transaction handler\n        /// </summary>\n        /// <param name=\"optionSymbol\">String symbol for the option position</param>\n        /// <param name=\"quantity\">Quantity of options contracts</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket ExerciseOption(Symbol optionSymbol, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            var option = (Option)GetSecurityForOrder(optionSymbol);\n\n            // SubmitOrderRequest.Quantity indicates the change in holdings quantity, therefore manual exercise quantities must be negative\n            // PreOrderChecksImpl confirms that we don't hold a short position, so we're lenient here and accept +/- quantity values\n            var request = CreateSubmitOrderRequest(OrderType.OptionExercise, option, -Math.Abs(quantity), tag,\n                orderProperties ?? DefaultOrderProperties?.Clone(), asynchronous);\n\n            //Initialize the exercise order parameters\n            var preOrderCheckResponse = PreOrderChecks(request);\n            if (preOrderCheckResponse.IsError)\n            {\n                return OrderTicket.InvalidSubmitRequest(Transactions, request, preOrderCheckResponse);\n            }\n\n            //Add the order and create a new order Id.\n            var ticket = Transactions.AddOrder(request);\n\n            // Wait for the order event to process, only if the exchange is open\n            if (!asynchronous)\n            {\n                Transactions.WaitForOrder(ticket.OrderId);\n            }\n\n            return ticket;\n        }\n\n        // Support for option strategies trading\n\n        /// <summary>\n        /// Buy Option Strategy (Alias of Order)\n        /// </summary>\n        /// <param name=\"strategy\">Specification of the strategy to trade</param>\n        /// <param name=\"quantity\">Quantity of the strategy to trade</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Buy(OptionStrategy strategy, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return Order(strategy, Math.Abs(quantity), asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Sell Option Strategy (alias of Order)\n        /// </summary>\n        /// <param name=\"strategy\">Specification of the strategy to trade</param>\n        /// <param name=\"quantity\">Quantity of the strategy to trade</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Sell(OptionStrategy strategy, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return Order(strategy, Math.Abs(quantity) * -1, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        ///  Issue an order/trade for buying/selling an option strategy\n        /// </summary>\n        /// <param name=\"strategy\">Specification of the strategy to trade</param>\n        /// <param name=\"quantity\">Quantity of the strategy to trade</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Order(OptionStrategy strategy, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return GenerateOptionStrategyOrders(strategy, quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Issue a combo market order/trade for multiple assets\n        /// </summary>\n        /// <param name=\"legs\">The list of legs the order consists of</param>\n        /// <param name=\"quantity\">The total quantity for the order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it fills</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets, one for each leg</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> ComboMarketOrder(List<Leg> legs, int quantity, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return SubmitComboOrder(legs, quantity, 0, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Issue a combo leg limit order/trade for multiple assets, each having its own limit price.\n        /// </summary>\n        /// <param name=\"legs\">The list of legs the order consists of</param>\n        /// <param name=\"quantity\">The total quantity for the order</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets, one for each leg</returns>\n        /// <exception cref=\"ArgumentException\">If not every leg has a defined limit price</exception>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> ComboLegLimitOrder(List<Leg> legs, int quantity, bool asynchronous = false,\n            string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            if (legs.Any(x => x.OrderPrice == null || x.OrderPrice == 0))\n            {\n                throw new ArgumentException(\"ComboLegLimitOrder requires a limit price for each leg\");\n            }\n\n            return SubmitComboOrder(legs, quantity, 0, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Issue a combo limit order/trade for multiple assets.\n        /// A single limit price is defined for the combo order and will fill only if the sum of the assets price compares properly to the limit price, depending on the direction.\n        /// </summary>\n        /// <param name=\"legs\">The list of legs the order consists of</param>\n        /// <param name=\"quantity\">The total quantity for the order</param>\n        /// <param name=\"limitPrice\">The compound limit price to use for a ComboLimit order. This limit price will compared to the sum of the assets price in order to fill the order.</param>\n        /// <param name=\"asynchronous\">Send the order asynchronously (false). Otherwise we'll block until it is fully submitted</param>\n        /// <param name=\"tag\">String tag for the order (optional)</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>Sequence of order tickets, one for each leg</returns>\n        /// <exception cref=\"ArgumentException\">If the order type is neither ComboMarket, ComboLimit nor ComboLegLimit</exception>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> ComboLimitOrder(List<Leg> legs, int quantity, decimal limitPrice,\n            bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            if (limitPrice == 0)\n            {\n                throw new ArgumentException(\"ComboLimitOrder requires a limit price\");\n            }\n\n            if (legs.Any(x => x.OrderPrice != null && x.OrderPrice != 0))\n            {\n                throw new ArgumentException(\"ComboLimitOrder does not support limit prices for individual legs\");\n            }\n\n            return SubmitComboOrder(legs, quantity, limitPrice, asynchronous, tag, orderProperties);\n        }\n\n        private List<OrderTicket> GenerateOptionStrategyOrders(OptionStrategy strategy, int strategyQuantity, bool asynchronous, string tag, IOrderProperties orderProperties)\n        {\n            // Make sure the strategy is initialized, that is, canonical and leg symbols are set.\n            strategy.SetSymbols();\n\n            // setting up the tag text for all orders of one strategy\n            tag ??= $\"{strategy.Name} ({strategyQuantity.ToStringInvariant()})\";\n\n            var legs = strategy.UnderlyingLegs.Cast<Leg>().Concat(strategy.OptionLegs).ToList();\n\n            return SubmitComboOrder(legs, strategyQuantity, 0, asynchronous, tag, orderProperties);\n        }\n\n        private List<OrderTicket> SubmitComboOrder(List<Leg> legs, decimal quantity, decimal limitPrice, bool asynchronous, string tag, IOrderProperties orderProperties)\n        {\n            CheckComboOrderSizing(legs, quantity);\n\n            var orderType = OrderType.ComboMarket;\n            if (limitPrice != 0)\n            {\n                orderType = OrderType.ComboLimit;\n            }\n\n            // we create a unique Id so the algorithm and the brokerage can relate the combo orders with each other\n            var groupOrderManager = new GroupOrderManager(Transactions.GetIncrementGroupOrderManagerId(), legs.Count, quantity, limitPrice);\n\n            List<OrderTicket> orderTickets = new(capacity: legs.Count);\n            List<SubmitOrderRequest> submitRequests = new(capacity: legs.Count);\n            foreach (var leg in legs)\n            {\n                var security = GetSecurityForOrder(leg.Symbol);\n\n                if (leg.OrderPrice.HasValue)\n                {\n                    // limit price per leg!\n                    limitPrice = leg.OrderPrice.Value;\n                    orderType = OrderType.ComboLegLimit;\n                }\n                var request = CreateSubmitOrderRequest(\n                    orderType,\n                    security,\n                    ((decimal)leg.Quantity).GetOrderLegGroupQuantity(groupOrderManager),\n                    tag,\n                    orderProperties ?? DefaultOrderProperties?.Clone(),\n                    groupOrderManager: groupOrderManager,\n                    limitPrice: limitPrice,\n                    asynchronous: asynchronous);\n\n                // we execture pre order checks for all requests before submitting, so that if anything fails we are not left with half submitted combo orders\n                var response = PreOrderChecks(request);\n                if (response.IsError)\n                {\n                    orderTickets.Add(OrderTicket.InvalidSubmitRequest(Transactions, request, response));\n                    return orderTickets;\n                }\n\n                submitRequests.Add(request);\n            }\n\n            foreach (var request in submitRequests)\n            {\n                //Add the order and create a new order Id.\n                orderTickets.Add(Transactions.AddOrder(request));\n            }\n\n            // Wait for the order event to process, only if the exchange is open\n            if (!asynchronous && orderType == OrderType.ComboMarket)\n            {\n                foreach (var ticket in orderTickets)\n                {\n                    if (ticket.Status.IsOpen())\n                    {\n                        Transactions.WaitForOrder(ticket.OrderId);\n                    }\n                }\n            }\n\n            return orderTickets;\n        }\n\n        /// <summary>\n        /// Will submit an order request to the algorithm\n        /// </summary>\n        /// <param name=\"request\">The request to submit</param>\n        /// <remarks>Will run order prechecks, which include making sure the algorithm is not warming up, security is added and has data among others</remarks>\n        /// <returns>The order ticket</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket SubmitOrderRequest(SubmitOrderRequest request)\n        {\n            var response = PreOrderChecks(request);\n            if (response.IsError)\n            {\n                return OrderTicket.InvalidSubmitRequest(Transactions, request, response);\n            }\n\n            //Add the order and create a new order Id.\n            return Transactions.AddOrder(request);\n        }\n\n        /// <summary>\n        /// Perform pre-order checks to ensure we have sufficient capital,\n        /// the market is open, and we haven't exceeded maximum realistic orders per day.\n        /// </summary>\n        /// <returns>OrderResponse. If no error, order request is submitted.</returns>\n        private OrderResponse PreOrderChecks(SubmitOrderRequest request)\n        {\n            var response = PreOrderChecksImpl(request);\n            if (response.IsError)\n            {\n                Error(response.ErrorMessage);\n            }\n            return response;\n        }\n\n        /// <summary>\n        /// Perform pre-order checks to ensure we have sufficient capital,\n        /// the market is open, and we haven't exceeded maximum realistic orders per day.\n        /// </summary>\n        /// <returns>OrderResponse. If no error, order request is submitted.</returns>\n        private OrderResponse PreOrderChecksImpl(SubmitOrderRequest request)\n        {\n            if (IsWarmingUp)\n            {\n                return OrderResponse.WarmingUp(request);\n            }\n\n            //Most order methods use security objects; so this isn't really used.\n            // todo: Left here for now but should review\n            Security security;\n            if (!Securities.TryGetValue(request.Symbol, out security))\n            {\n                return OrderResponse.MissingSecurity(request);\n            }\n\n            //Ordering 0 is useless.\n            if (request.Quantity == 0)\n            {\n                return OrderResponse.ZeroQuantity(request);\n            }\n\n            if (Math.Abs(request.Quantity) < security.SymbolProperties.LotSize)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.OrderQuantityLessThanLotSize,\n                    Invariant($\"Unable to {request.OrderRequestType.ToLower()} order with id {request.OrderId} which \") +\n                    Invariant($\"quantity ({Math.Abs(request.Quantity)}) is less than lot \") +\n                    Invariant($\"size ({security.SymbolProperties.LotSize}).\")\n                );\n            }\n\n            if (!security.IsTradable)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.NonTradableSecurity,\n                    $\"The security with symbol '{request.Symbol}' is marked as non-tradable.\"\n                );\n            }\n\n            var price = security.Price;\n\n            //Check the exchange is open before sending a exercise orders\n            if (request.OrderType == OrderType.OptionExercise && !security.Exchange.ExchangeOpen)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.ExchangeNotOpen,\n                    $\"{request.OrderType} order and exchange not open.\"\n                );\n            }\n\n            //Check the exchange is open before sending a market on open order for futures\n            if ((security.Type == SecurityType.Future || security.Type == SecurityType.FutureOption) && request.OrderType == OrderType.MarketOnOpen)\n            {\n                if (!_isMarketOnOpenOrderRestrictedForFuturesWarningSent)\n                {\n                    Debug(\"Warning: Market-On-Open orders are not allowed for futures and future options. Consider using limit orders during extended market hours.\");\n                    _isMarketOnOpenOrderRestrictedForFuturesWarningSent = true;\n                }\n\n                return OrderResponse.Error(request, OrderResponseErrorCode.ExchangeNotOpen,\n                    $\"{request.OrderType} orders not supported for {security.Type}.\"\n                );\n            }\n\n            if (price == 0)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.SecurityPriceZero, request.Symbol.GetZeroPriceMessage());\n            }\n\n            // check quote currency existence/conversion rate on all orders\n            var quoteCurrency = security.QuoteCurrency.Symbol;\n            if (!Portfolio.CashBook.TryGetValue(quoteCurrency, out var quoteCash))\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.QuoteCurrencyRequired,\n                    $\"{request.Symbol.Value}: requires {quoteCurrency} in the cashbook to trade.\"\n                );\n            }\n            if (security.QuoteCurrency.ConversionRate == 0m)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.ConversionRateZero,\n                    $\"{request.Symbol.Value}: requires {quoteCurrency} to have a non-zero conversion rate. This can be caused by lack of data.\"\n                );\n            }\n\n            // need to also check base currency existence/conversion rate on forex orders\n            if (security.Type == SecurityType.Forex || security.Type == SecurityType.Crypto)\n            {\n                var baseCurrency = ((IBaseCurrencySymbol)security).BaseCurrency.Symbol;\n                if (!Portfolio.CashBook.TryGetValue(baseCurrency, out var baseCash))\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.ForexBaseAndQuoteCurrenciesRequired,\n                        $\"{request.Symbol.Value}: requires {baseCurrency} and {quoteCurrency} in the cashbook to trade.\"\n                    );\n                }\n                if (baseCash.ConversionRate == 0m)\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.ForexConversionRateZero,\n                        $\"{request.Symbol.Value}: requires {baseCurrency} and {quoteCurrency} to have non-zero conversion rates. This can be caused by lack of data.\"\n                    );\n                }\n            }\n\n            //Make sure the security has some data:\n            if (!security.HasData)\n            {\n                return OrderResponse.Error(request, OrderResponseErrorCode.SecurityHasNoData,\n                    \"There is no data for this symbol yet, please check the security.HasData flag to ensure there is at least one data point.\"\n                );\n            }\n\n            // We've already processed too many orders: max 10k\n            if (!LiveMode && Transactions.OrdersCount > _maxOrders)\n            {\n                Status = AlgorithmStatus.Stopped;\n                return OrderResponse.Error(request, OrderResponseErrorCode.ExceededMaximumOrders,\n                    Invariant($\"You have exceeded maximum number of orders ({_maxOrders}), for unlimited orders upgrade your account.\")\n                );\n            }\n\n            if (request.OrderType == OrderType.OptionExercise)\n            {\n                if (!security.Type.IsOption())\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.NonExercisableSecurity,\n                        $\"The security with symbol '{request.Symbol}' is not exercisable.\"\n                    );\n                }\n\n                if ((security as Option).Style == OptionStyle.European && UtcTime.Date < security.Symbol.ID.Date.ConvertToUtc(security.Exchange.TimeZone).Date)\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.EuropeanOptionNotExpiredOnExercise,\n                        $\"Cannot exercise European style option with symbol '{request.Symbol}' before its expiration date.\"\n                    );\n                }\n\n                if (security.Holdings.IsShort)\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.UnsupportedRequestType,\n                        $\"The security with symbol '{request.Symbol}' has a short option position. Only long option positions are exercisable.\"\n                    );\n                }\n\n                if (Math.Abs(request.Quantity) > security.Holdings.Quantity)\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.UnsupportedRequestType,\n                        $\"Cannot exercise more contracts of '{request.Symbol}' than is currently available in the portfolio. \"\n                    );\n                }\n            }\n\n            if (request.OrderType == OrderType.MarketOnOpen)\n            {\n                if (security.Exchange.Hours.IsMarketAlwaysOpen)\n                {\n                    throw new InvalidOperationException($\"Market never closes for this symbol {security.Symbol}, can no submit a {nameof(OrderType.MarketOnOpen)} order.\");\n                }\n\n                if (security.Exchange.Hours.IsOpen(security.LocalTime, false))\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.MarketOnOpenNotAllowedDuringRegularHours, $\"Cannot submit a {nameof(OrderType.MarketOnOpen)} order while the market is open.\");\n                }\n            }\n            else if (request.OrderType == OrderType.MarketOnClose)\n            {\n                if (security.Exchange.Hours.IsMarketAlwaysOpen)\n                {\n                    throw new InvalidOperationException($\"Market never closes for this symbol {security.Symbol}, can no submit a {nameof(OrderType.MarketOnClose)} order.\");\n                }\n\n                var nextMarketClose = security.Exchange.Hours.GetNextMarketClose(security.LocalTime, false);\n\n                // Enforce MarketOnClose submission buffer\n                var latestSubmissionTimeUtc = nextMarketClose\n                    .ConvertToUtc(security.Exchange.TimeZone)\n                    .Subtract(Orders.MarketOnCloseOrder.SubmissionTimeBuffer);\n                if (UtcTime > latestSubmissionTimeUtc)\n                {\n                    // Tell user the required buffer on these orders, also inform them it can be changed for special cases.\n                    // Default buffer is 15.5 minutes because with minute data a user will receive the 3:44->3:45 bar at 3:45,\n                    // if the latest time is 3:45 it is already too late to submit one of these orders\n                    return OrderResponse.Error(request, OrderResponseErrorCode.MarketOnCloseOrderTooLate,\n                        $\"MarketOnClose orders must be placed within {Orders.MarketOnCloseOrder.SubmissionTimeBuffer} before market close.\" +\n                        \" Override this TimeSpan buffer by setting Orders.MarketOnCloseOrder.SubmissionTimeBuffer in QCAlgorithm.Initialize().\"\n                    );\n                }\n            }\n\n            if (request.OrderType == OrderType.ComboMarket && request.LimitPrice != 0)\n            {\n                // just in case some validation\n                throw new ArgumentException(\"Can not set a limit price using market combo orders\");\n            }\n\n            // Check for splits. Option are selected before the security price is split-adjusted, so in this time step\n            // we don't allow option orders to make sure they are properly filtered using the right security price.\n            if (request.SecurityType.IsOption() &&\n                CurrentSlice != null &&\n                CurrentSlice.Splits.Count > 0 &&\n                CurrentSlice.Splits.TryGetValue(request.Symbol.Underlying, out _))\n            {\n                if (!_isOptionsOrderOnStockSplitWarningSent)\n                {\n                    Debug(\"Warning: Options orders are not allowed when a split occurred for its underlying stock\");\n                    _isOptionsOrderOnStockSplitWarningSent = true;\n                }\n\n                return OrderResponse.Error(request, OrderResponseErrorCode.OptionOrderOnStockSplit,\n                    \"Options orders are not allowed when a split occurred for its underlying stock\");\n            }\n\n            // passes all initial order checks\n            return OrderResponse.Success(request);\n        }\n\n        /// <summary>\n        /// Gets the security for the given symbol.\n        /// This method is intended to get a security that is going to be traded, so it will try to\n        /// add the security if it's not found in the algorithm's securities collection and it meets \n        /// the requirements to be added (e.g. not delisted, not expired, etc).\n        /// The added security will be seeded with data so that it can be traded immediately.\n        /// </summary>\n        private Security GetSecurityForOrder(Symbol symbol)\n        {\n            var isCanonical = symbol.IsCanonical();\n            if (Securities.TryGetValue(symbol, out var security) && \n                // Let canonical and delisted securities through instead of throwing. An invalid ticket will be returned later on when trying to submit the order.\n                (isCanonical || security.IsTradable || security.IsDelisted))\n            {\n                return security;\n            }\n\n            if (security == null || !security.IsTradable)\n            {\n                // Try to add and seed the security, but don't is it's a canonical symbol\n                if (!isCanonical &&\n                    // Indexes are not tradable by default\n                    symbol.SecurityType != SecurityType.Index &&\n                    (!symbol.HasUnderlying ||\n                     (symbol.SecurityType.IsOption() && !OptionSymbol.IsOptionContractExpired(symbol, UtcTime)) ||\n                     (symbol.SecurityType == SecurityType.Future && !FuturesExpiryUtilityFunctions.IsFutureContractExpired(symbol, UtcTime, MarketHoursDatabase))))\n                {\n                    // Send one time warning\n                    security = AddSecurity(symbol);\n\n                    if (!Settings.SeedInitialPrices)\n                    {\n                        AlgorithmUtils.SeedSecurities([security], this);\n                    }\n\n                    return security;\n                }\n            }\n\n            throw new InvalidOperationException($\"The symbol {symbol} is not found in the algorithm's securities collection \" +\n                    \"and cannot be re-added due to it being delisted or no longer tradable.\");\n        }\n\n        /// <summary>\n        /// Liquidate your portfolio holdings\n        /// </summary>\n        /// <param name=\"symbol\">Specific asset to liquidate, defaults to all</param>\n        /// <param name=\"asynchronous\">Flag to indicate if the symbols should be liquidated asynchronously</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this</param>\n        /// <param name=\"orderProperties\">Order properties to use</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Liquidate(Symbol symbol = null, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            IEnumerable<Symbol> toLiquidate;\n            if (symbol != null)\n            {\n                toLiquidate = Securities.ContainsKey(symbol)\n                    ? new[] { symbol } : Enumerable.Empty<Symbol>();\n            }\n            else\n            {\n                toLiquidate = Securities.Keys.OrderBy(x => x.Value);\n            }\n\n            return Liquidate(toLiquidate, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Liquidate your portfolio holdings\n        /// </summary>\n        /// <param name=\"symbols\">List of symbols to liquidate, defaults to all</param>\n        /// <param name=\"asynchronous\">Flag to indicate if the symbols should be liquidated asynchronously</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this</param>\n        /// <param name=\"orderProperties\">Order properties to use</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> Liquidate(IEnumerable<Symbol> symbols, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            var orderTickets = new List<OrderTicket>();\n            if (!Settings.LiquidateEnabled)\n            {\n                Debug(\"Liquidate() is currently disabled by settings. To re-enable please set 'Settings.LiquidateEnabled' to true\");\n                return orderTickets;\n            }\n\n            tag ??= \"Liquidated\";\n            foreach (var symbolToLiquidate in symbols)\n            {\n                // get open orders\n                var orders = Transactions.GetOpenOrders(symbolToLiquidate);\n\n                // get quantity in portfolio\n                var quantity = 0m;\n                var holdings = Portfolio[symbolToLiquidate];\n                if (holdings.Invested)\n                {\n                    // invested flag might filter some quantity that's less than lot size\n                    quantity = holdings.Quantity;\n                }\n\n                // if there is only one open market order that would close the position, do nothing\n                if (orders.Count == 1 && quantity != 0 && orders[0].Quantity == -quantity && orders[0].Type == OrderType.Market)\n                {\n                    continue;\n                }\n\n                // cancel all open orders\n                var marketOrdersQuantity = 0m;\n                foreach (var order in orders)\n                {\n                    if (order.Type == OrderType.Market)\n                    {\n                        // pending market order\n                        var ticket = Transactions.GetOrderTicket(order.Id);\n                        if (ticket != null)\n                        {\n                            // get remaining quantity\n                            marketOrdersQuantity += ticket.QuantityRemaining;\n                        }\n                    }\n                    else\n                    {\n                        Transactions.CancelOrder(order.Id, tag);\n                    }\n                }\n\n                // Liquidate at market price\n                if (quantity != 0)\n                {\n                    // calculate quantity for closing market order\n                    var ticket = Order(symbolToLiquidate, -quantity - marketOrdersQuantity, asynchronous: asynchronous, tag: tag, orderProperties: orderProperties);\n                    orderTickets.Add(ticket);\n                }\n            }\n\n            return orderTickets;\n        }\n\n        /// <summary>\n        /// Liquidate all holdings and cancel open orders. Called at the end of day for tick-strategies.\n        /// </summary>\n        /// <param name=\"symbolToLiquidate\">Symbol we wish to liquidate</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this.</param>\n        /// <returns>Array of order ids for liquidated symbols</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [Obsolete($\"This method is obsolete, please use Liquidate(symbol: symbolToLiquidate, tag: tag) method\")]\n        public List<int> Liquidate(Symbol symbolToLiquidate, string tag)\n        {\n            return Liquidate(symbol: symbolToLiquidate, tag: tag).Select(x => x.OrderId).ToList();\n        }\n\n        /// <summary>\n        /// Maximum number of orders for the algorithm\n        /// </summary>\n        /// <param name=\"max\"></param>\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetMaximumOrders(int max)\n        {\n            if (!_locked)\n            {\n                _maxOrders = max;\n            }\n        }\n\n        /// <summary>\n        /// Sets holdings for a collection of targets.\n        /// The implementation will order the provided targets executing first those that\n        /// reduce a position, freeing margin.\n        /// </summary>\n        /// <param name=\"targets\">The portfolio desired quantities as percentages</param>\n        /// <param name=\"liquidateExistingHoldings\">True will liquidate existing holdings</param>\n        /// <param name=\"asynchronous\">Send the orders asynchronously (false). Otherwise we'll block until it is fully submitted (or filled for market orders)</param>\n        /// <param name=\"tag\">Tag the order with a short string.</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>A list of order tickets.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> SetHoldings(List<PortfolioTarget> targets, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            List<OrderTicket> orderTickets = null;\n            //If they triggered a liquidate\n            if (liquidateExistingHoldings)\n            {\n                orderTickets = Liquidate(GetSymbolsToLiquidate(targets.Select(t => t.Symbol)), tag: tag, orderProperties: orderProperties);\n            }\n            orderTickets ??= new List<OrderTicket>();\n\n            foreach (var portfolioTarget in targets\n                // we need to create targets with quantities for OrderTargetsByMarginImpact\n                .Select(target => new PortfolioTarget(target.Symbol, CalculateOrderQuantity(target.Symbol, target.Quantity)))\n                .OrderTargetsByMarginImpact(this, targetIsDelta: true))\n            {\n                var tickets = SetHoldingsImpl(portfolioTarget.Symbol, portfolioTarget.Quantity, false, asynchronous, tag, orderProperties);\n                orderTickets.AddRange(tickets);\n            }\n            return orderTickets;\n        }\n\n        /// <summary>\n        /// Alias for SetHoldings to avoid the M-decimal errors.\n        /// </summary>\n        /// <param name=\"symbol\">string symbol we wish to hold</param>\n        /// <param name=\"percentage\">double percentage of holdings desired</param>\n        /// <param name=\"liquidateExistingHoldings\">liquidate existing holdings if necessary to hold this stock</param>\n        /// <param name=\"asynchronous\">Send the orders asynchronously (false). Otherwise we'll block until it is fully submitted (or filled for market orders)</param>\n        /// <param name=\"tag\">Tag the order with a short string.</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>A list of order tickets.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> SetHoldings(Symbol symbol, double percentage, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            return SetHoldings(symbol, percentage.SafeDecimalCast(), liquidateExistingHoldings, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Alias for SetHoldings to avoid the M-decimal errors.\n        /// </summary>\n        /// <param name=\"symbol\">string symbol we wish to hold</param>\n        /// <param name=\"percentage\">float percentage of holdings desired</param>\n        /// <param name=\"liquidateExistingHoldings\">bool liquidate existing holdings if necessary to hold this stock</param>\n        /// <param name=\"asynchronous\">Send the orders asynchronously (false). Otherwise we'll block until it is fully submitted (or filled for market orders)</param>\n        /// <param name=\"tag\">Tag the order with a short string.</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>A list of order tickets.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> SetHoldings(Symbol symbol, float percentage, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            return SetHoldings(symbol, (decimal)percentage, liquidateExistingHoldings, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Alias for SetHoldings to avoid the M-decimal errors.\n        /// </summary>\n        /// <param name=\"symbol\">string symbol we wish to hold</param>\n        /// <param name=\"percentage\">float percentage of holdings desired</param>\n        /// <param name=\"liquidateExistingHoldings\">bool liquidate existing holdings if necessary to hold this stock</param>\n        /// <param name=\"asynchronous\">Send the orders asynchronously (false). Otherwise we'll block until it is fully submitted (or filled for market orders)</param>\n        /// <param name=\"tag\">Tag the order with a short string.</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>A list of order tickets.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> SetHoldings(Symbol symbol, int percentage, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            return SetHoldings(symbol, (decimal)percentage, liquidateExistingHoldings, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Automatically place a market order which will set the holdings to between 100% or -100% of *PORTFOLIO VALUE*.\n        /// E.g. SetHoldings(\"AAPL\", 0.1); SetHoldings(\"IBM\", -0.2); -> Sets portfolio as long 10% APPL and short 20% IBM\n        /// E.g. SetHoldings(\"AAPL\", 2); -> Sets apple to 2x leveraged with all our cash.\n        /// If the market is closed, place a market on open order.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol indexer</param>\n        /// <param name=\"percentage\">decimal fraction of portfolio to set stock</param>\n        /// <param name=\"liquidateExistingHoldings\">bool flag to clean all existing holdings before setting new faction.</param>\n        /// <param name=\"asynchronous\">Send the orders asynchronously (false). Otherwise we'll block until it is fully submitted (or filled for market orders)</param>\n        /// <param name=\"tag\">Tag the order with a short string.</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>A list of order tickets.</returns>\n        /// <seealso cref=\"MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)\"/>\n        [DocumentationAttribute(TradingAndOrders)]\n        public List<OrderTicket> SetHoldings(Symbol symbol, decimal percentage, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            return SetHoldingsImpl(symbol, CalculateOrderQuantity(symbol, percentage), liquidateExistingHoldings, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Set holdings implementation, which uses order quantities (delta) not percentage nor target final quantity\n        /// </summary>\n        private List<OrderTicket> SetHoldingsImpl(Symbol symbol, decimal orderQuantity, bool liquidateExistingHoldings = false, bool asynchronous = false, string tag = null, IOrderProperties orderProperties = null)\n        {\n            List<OrderTicket> orderTickets = null;\n            //If they triggered a liquidate\n            if (liquidateExistingHoldings)\n            {\n                orderTickets = Liquidate(GetSymbolsToLiquidate([symbol]), tag: tag, orderProperties: orderProperties);\n            }\n\n            orderTickets ??= new List<OrderTicket>();\n            tag ??= \"\";\n            //Calculate total unfilled quantity for open market orders\n            var marketOrdersQuantity = Transactions.GetOpenOrderTickets(\n                    ticket => ticket.Symbol == symbol\n                              && (ticket.OrderType == OrderType.Market\n                                  || ticket.OrderType == OrderType.MarketOnOpen))\n                .Aggregate(0m, (d, ticket) => d + ticket.QuantityRemaining);\n\n            //Only place trade if we've got > 1 share to order.\n            var quantity = orderQuantity - marketOrdersQuantity;\n            if (Math.Abs(quantity) > 0)\n            {\n                Security security;\n                if (!Securities.TryGetValue(symbol, out security))\n                {\n                    Error($\"{symbol} not found in portfolio. Request this data when initializing the algorithm.\");\n                    return orderTickets;\n                }\n\n                //Check whether the exchange is open to send a market order. If not, send a market on open order instead\n                OrderTicket ticket;\n                if (security.Exchange.ExchangeOpen)\n                {\n                    ticket = MarketOrder(symbol, quantity, asynchronous, tag, orderProperties);\n                }\n                else\n                {\n                    ticket = MarketOnOpenOrder(symbol, quantity, asynchronous, tag, orderProperties);\n                }\n                orderTickets.Add(ticket);\n            }\n            return orderTickets;\n        }\n\n        /// <summary>\n        /// Returns the symbols in the portfolio to be liquidated, excluding the provided symbols.\n        /// </summary>\n        /// <param name=\"symbols\">The list of symbols to exclude from liquidation.</param>\n        /// <returns>A list of symbols to liquidate.</returns>\n        private List<Symbol> GetSymbolsToLiquidate(IEnumerable<Symbol> symbols)\n        {\n            var targetSymbols = new HashSet<Symbol>(symbols);\n            var symbolsToLiquidate = Portfolio.Keys\n                .Where(symbol => !targetSymbols.Contains(symbol))\n                .OrderBy(symbol => symbol.Value)\n                .ToList();\n            return symbolsToLiquidate;\n        }\n\n        /// <summary>\n        /// Calculate the order quantity to achieve target-percent holdings.\n        /// </summary>\n        /// <param name=\"symbol\">Security object we're asking for</param>\n        /// <param name=\"target\">Target percentage holdings</param>\n        /// <returns>Order quantity to achieve this percentage</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public decimal CalculateOrderQuantity(Symbol symbol, double target)\n        {\n            return CalculateOrderQuantity(symbol, target.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Calculate the order quantity to achieve target-percent holdings.\n        /// </summary>\n        /// <param name=\"symbol\">Security object we're asking for</param>\n        /// <param name=\"target\">Target percentage holdings, this is an unleveraged value, so\n        /// if you have 2x leverage and request 100% holdings, it will utilize half of the\n        /// available margin</param>\n        /// <returns>Order quantity to achieve this percentage</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public decimal CalculateOrderQuantity(Symbol symbol, decimal target)\n        {\n            var percent = PortfolioTarget.Percent(this, symbol, target, true);\n\n            if (percent == null)\n            {\n                return 0;\n            }\n            return percent.Quantity;\n        }\n\n        /// <summary>\n        /// Obsolete implementation of Order method accepting a OrderType. This was deprecated since it\n        /// was impossible to generate other orders via this method. Any calls to this method will always default to a Market Order.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol we want to purchase</param>\n        /// <param name=\"quantity\">Quantity to buy, + is long, - short.</param>\n        /// <param name=\"type\">Order Type</param>\n        /// <param name=\"asynchronous\">Don't wait for the response, just submit order and move on.</param>\n        /// <param name=\"tag\">Custom data for this order</param>\n        /// <param name=\"orderProperties\">The order properties to use. Defaults to <see cref=\"DefaultOrderProperties\"/></param>\n        /// <returns>The order ticket instance.</returns>\n        [Obsolete(\"This Order method has been made obsolete, use Order(string, int, bool, string) method instead. Calls to the obsolete method will only generate market orders.\")]\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, int quantity, OrderType type, bool asynchronous = false, string tag = \"\", IOrderProperties orderProperties = null)\n        {\n            return Order(symbol, quantity, asynchronous, tag, orderProperties);\n        }\n\n        /// <summary>\n        /// Obsolete method for placing orders.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol we want to order</param>\n        /// <param name=\"quantity\">The quantity to order</param>\n        /// <param name=\"type\">The order type</param>\n        /// <returns>The order ticket instance.</returns>\n        [Obsolete(\"This Order method has been made obsolete, use the specialized Order helper methods instead. Calls to the obsolete method will only generate market orders.\")]\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, decimal quantity, OrderType type)\n        {\n            return Order(symbol, quantity);\n        }\n\n        /// <summary>\n        /// Obsolete method for placing orders.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol we want to order</param>\n        /// <param name=\"quantity\">The quantity to order</param>\n        /// <param name=\"type\">The order type</param>\n        /// <returns>The order ticket instance.</returns>\n        [Obsolete(\"This Order method has been made obsolete, use the specialized Order helper methods instead. Calls to the obsolete method will only generate market orders.\")]\n        [DocumentationAttribute(TradingAndOrders)]\n        public OrderTicket Order(Symbol symbol, int quantity, OrderType type)\n        {\n            return Order(symbol, (decimal)quantity);\n        }\n\n        /// <summary>\n        /// Determines if the exchange for the specified symbol is open at the current time.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>True if the exchange is considered open at the current time, false otherwise</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public bool IsMarketOpen(Symbol symbol)\n        {\n            if (Securities.TryGetValue(symbol, out var security))\n            {\n                return security.IsMarketOpen(false);\n            }\n            return symbol.IsMarketOpen(UtcTime, false);\n        }\n\n        private SubmitOrderRequest CreateSubmitOrderRequest(OrderType orderType, Security security, decimal quantity, string tag,\n            IOrderProperties properties, bool asynchronous, decimal stopPrice = 0m, decimal limitPrice = 0m, decimal triggerPrice = 0m, decimal trailingAmount = 0m,\n            bool trailingAsPercentage = false, GroupOrderManager groupOrderManager = null)\n        {\n            return new SubmitOrderRequest(orderType, security.Type, security.Symbol, quantity, stopPrice, limitPrice, triggerPrice, trailingAmount,\n                trailingAsPercentage, UtcTime, tag, properties, groupOrderManager, asynchronous);\n        }\n\n        private static void CheckComboOrderSizing(List<Leg> legs, decimal quantity)\n        {\n            var greatestsCommonDivisor = Math.Abs(legs.Select(leg => leg.Quantity).GreatestCommonDivisor());\n\n            if (greatestsCommonDivisor != 1)\n            {\n                throw new ArgumentException(\n                    \"The global combo quantity should be used to increase or reduce the size of the order, \" +\n                    \"while the leg quantities should be used to specify the ratio of the order. \" +\n                    \"The combo order quantities should be reduced \" +\n                    $\"from {quantity}x({string.Join(\", \", legs.Select(leg => $\"{leg.Quantity} {leg.Symbol}\"))}) \" +\n                    $\"to {quantity * greatestsCommonDivisor}x({string.Join(\", \", legs.Select(leg => $\"{leg.Quantity / greatestsCommonDivisor} {leg.Symbol}\"))}).\");\n            }\n        }\n\n        /// <summary>\n        /// Resets the time-in-force to the default <see cref=\"TimeInForce.GoodTilCanceled\" /> if the given one is a <see cref=\"GoodTilDateTimeInForce\"/>.\n        /// This is required for MOO and MOC orders, for which GTD is not supported.\n        /// </summary>\n        private void InvalidateGoodTilDateTimeInForce(IOrderProperties orderProperties)\n        {\n            if (orderProperties.TimeInForce as GoodTilDateTimeInForce != null)\n            {\n                // Good-Til-Date(GTD) Time-In-Force is not supported for MOO and MOC orders\n                orderProperties.TimeInForce = TimeInForce.GoodTilCanceled;\n\n                if (!_isGtdTfiForMooAndMocOrdersValidationWarningSent)\n                {\n                    Debug(\"Warning: Good-Til-Date Time-In-Force is not supported for MOO and MOC orders. \" +\n                        \"The time-in-force will be reset to Good-Til-Canceled (GTC).\");\n                    _isGtdTfiForMooAndMocOrdersValidationWarningSent = true;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.Universe.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Collections.Specialized;\nusing NodaTime;\nusing QuantConnect.Algorithm.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm\n{\n    public partial class QCAlgorithm\n    {\n        // save universe additions and apply at end of time step\n        // this removes temporal dependencies from w/in initialize method\n        // original motivation: adding equity/options to enforce equity raw data mode\n        private readonly object _pendingUniverseAdditionsLock = new object();\n        private readonly List<UserDefinedUniverseUpdate> _pendingUserDefinedUniverseSecurityChanges = new();\n        private bool _pendingUniverseAdditions;\n        private ConcurrentSet<Symbol> _rawNormalizationWarningSymbols = new ConcurrentSet<Symbol>();\n        private readonly int _rawNormalizationWarningSymbolsMaxCount = 10;\n        private bool _coarseFineUniverseObsoleteLogSent;\n\n        /// <summary>\n        /// Gets universe manager which holds universes keyed by their symbol\n        /// </summary>\n        [DocumentationAttribute(Universes)]\n        public UniverseManager UniverseManager\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the universe settings to be used when adding securities via universe selection\n        /// </summary>\n        [DocumentationAttribute(Universes)]\n        public UniverseSettings UniverseSettings\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Invoked at the end of every time step. This allows the algorithm\n        /// to process events before advancing to the next time step.\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public void OnEndOfTimeStep()\n        {\n            // rewrite securities w/ derivatives to be in raw mode\n            lock (_pendingUniverseAdditionsLock)\n            {\n                if (!_pendingUniverseAdditions && _pendingUserDefinedUniverseSecurityChanges.Count == 0)\n                {\n                    // no point in looping through everything if there's no pending changes\n                    return;\n                }\n\n                var securitiesToSeed = new HashSet<Security>();\n\n                foreach (var security in Securities.Select(kvp => kvp.Value).Union(\n                    _pendingUserDefinedUniverseSecurityChanges.Where(x => x.IsAddition).Select(x => x.Security)))\n                {\n                    // check for any derivative securities and mark the underlying as raw\n                    if (security.Type == SecurityType.Equity &&\n                        Securities.Any(skvp => skvp.Key.SecurityType != SecurityType.Base && skvp.Key.HasUnderlyingSymbol(security.Symbol)))\n                    {\n                        // set data mode raw and default volatility model\n                        ConfigureUnderlyingSecurity(security);\n                    }\n\n                    var configs = SubscriptionManager.SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(security.Symbol);\n                    if (security.Symbol.HasUnderlying && security.Symbol.SecurityType != SecurityType.Base)\n                    {\n                        Security underlyingSecurity;\n                        var underlyingSymbol = security.Symbol.Underlying;\n\n                        var resolution = configs.GetHighestResolution();\n                        var isFillForward = configs.IsFillForward();\n                        if (UniverseManager.TryGetValue(security.Symbol, out var universe))\n                        {\n                            // as if the universe had selected this asset, the configuration of the canonical can be different\n                            resolution = universe.UniverseSettings.Resolution;\n                            isFillForward = universe.UniverseSettings.FillForward;\n                        }\n\n                        // create the underlying security object if it doesn't already exist\n                        if (!Securities.TryGetValue(underlyingSymbol, out underlyingSecurity))\n                        {\n                            underlyingSecurity = AddSecurity(underlyingSymbol.SecurityType,\n                                underlyingSymbol.Value,\n                                resolution,\n                                underlyingSymbol.ID.Market,\n                                isFillForward,\n                                Security.NullLeverage,\n                                configs.IsExtendedMarketHours(),\n                                dataNormalizationMode: DataNormalizationMode.Raw);\n                        }\n\n                        // set data mode raw and default volatility model\n                        if (underlyingSecurity.Symbol.SecurityType == SecurityType.Equity)\n                        {\n                            ConfigureUnderlyingSecurity(underlyingSecurity);\n                        }\n\n                        if (LiveMode && !Settings.SeedInitialPrices && underlyingSecurity.GetLastData() == null)\n                        {\n                            securitiesToSeed.Add(underlyingSecurity);\n                        }\n                        // set the underlying security on the derivative -- we do this in two places since it's possible\n                        // to do AddOptionContract w/out the underlying already added and normalized properly\n                        var derivative = security as IDerivativeSecurity;\n                        if (derivative != null)\n                        {\n                            derivative.Underlying = underlyingSecurity;\n                        }\n                    }\n                }\n\n                if (!securitiesToSeed.IsNullOrEmpty())\n                {\n                    AlgorithmUtils.SeedSecurities(securitiesToSeed, this);\n                }\n\n                // add subscriptionDataConfig to their respective user defined universes\n                foreach (var userDefinedUniverseAddition in _pendingUserDefinedUniverseSecurityChanges)\n                {\n                    var changedCollection = false;\n                    var action = NotifyCollectionChangedAction.Add;\n                    if (userDefinedUniverseAddition.IsAddition)\n                    {\n                        foreach (var subscriptionDataConfig in userDefinedUniverseAddition.SubscriptionDataConfigs)\n                        {\n                            changedCollection |= userDefinedUniverseAddition.Universe.Add(subscriptionDataConfig);\n                        }\n                    }\n                    else\n                    {\n                        action = NotifyCollectionChangedAction.Replace;\n                        changedCollection |= userDefinedUniverseAddition.Universe.Remove(userDefinedUniverseAddition.Security);\n                    }\n\n                    if (changedCollection)\n                    {\n                        UniverseManager.Update(userDefinedUniverseAddition.Universe.Symbol, userDefinedUniverseAddition.Universe, action);\n                    }\n                }\n\n                // finally add any pending universes, this will make them available to the data feed\n                // The universe will be added at the end of time step, same as the AddData user defined universes.\n                // This is required to be independent of the start and end date set during initialize\n                UniverseManager.ProcessChanges();\n\n                _pendingUniverseAdditions = false;\n                _pendingUserDefinedUniverseSecurityChanges.Clear();\n            }\n\n            if (!_rawNormalizationWarningSymbols.IsNullOrEmpty())\n            {\n                // Log our securities being set to raw price mode\n                Debug($\"Warning: The following securities were set to raw price normalization mode to work with options: \" +\n                    $\"{string.Join(\", \", _rawNormalizationWarningSymbols.Take(_rawNormalizationWarningSymbolsMaxCount).Select(x => x.Value))}...\");\n\n                // Set our warning list to null to stop emitting these warnings after its done once\n                _rawNormalizationWarningSymbols = null;\n            }\n        }\n\n        /// <summary>\n        /// Gets a helper that provides pre-defined universe definitions, such as top dollar volume\n        /// </summary>\n        [DocumentationAttribute(Universes)]\n        public UniverseDefinitions Universe\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Adds the universe to the algorithm\n        /// </summary>\n        /// <param name=\"universe\">The universe to be added</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(Universe universe)\n        {\n            if (universe.UniverseSettings == null)\n            {\n                // set default value so that users don't need to pass it\n                universe.UniverseSettings = UniverseSettings;\n            }\n            _pendingUniverseAdditions = true;\n            // note: UniverseManager.Add uses TryAdd, so don't need to worry about duplicates here\n            UniverseManager.Add(universe.Configuration.Symbol, universe);\n            return universe;\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverse<T>(null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(name, null, null, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, null, name);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, and Market.USA\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(name, null, null, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Resolution.Daily, and Market.USA\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, null, name, null, null, universeSettings);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Market.USA and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Resolution resolution, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(name, resolution, null, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, Market.USA and UniverseSettings\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Resolution resolution, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, null, name, resolution);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, and Market.USA\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Resolution resolution, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(name, resolution, market: null, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property. This universe will use the defaults\n        /// of SecurityType.Equity, and Market.USA\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"universeSettings\">The settings used for securities added by this universe</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Resolution resolution, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, null, name, resolution, universeSettings: universeSettings);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name, Resolution resolution, string market, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse<T>(name, resolution, market, null, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This will use the default universe settings\n        /// specified via the <see cref=\"UniverseSettings\"/> property.\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"securityType\">The security type the universe produces</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(SecurityType securityType, string name, Resolution resolution, string market, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, securityType, name, resolution, market);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"securityType\">The security type the universe produces</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"universeSettings\">The subscription settings to use for newly created subscriptions</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<string>> selector)\n        {\n            return AddUniverseStringSelector<T>(selector, securityType, name, resolution, market, universeSettings);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The expected resolution of the universe data</param>\n        /// <param name=\"market\">The market for selected symbols</param>\n        /// <param name=\"universeSettings\">The subscription settings to use for newly created subscriptions</param>\n        /// <param name=\"selector\">Function delegate that performs selection on the universe data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse<T>(string name = null, Resolution? resolution = null, string market = null, UniverseSettings universeSettings = null,\n            Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector = null)\n        {\n            return AddUniverseSymbolSelector(typeof(T), name, resolution, market, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for fundamental US Equity data and\n        /// will be executed on day changes in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"selector\">Defines an initial fundamental selection</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector)\n        {\n            return AddUniverse(FundamentalUniverse.USA(selector));\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for fundamental US Equity data and\n        /// will be executed based on the provided <see cref=\"IDateRule\"/> in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"dateRule\">Date rule that will be used to set the <see cref=\"Data.UniverseSelection.UniverseSettings.Schedule\"/></param>\n        /// <param name=\"selector\">Defines an initial fundamental selection</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(IDateRule dateRule, Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector)\n        {\n            var otherSettings = new UniverseSettings(UniverseSettings);\n            otherSettings.Schedule.On(dateRule);\n            return AddUniverse(FundamentalUniverse.USA(selector, otherSettings));\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for coarse and fine fundamental US Equity data and\n        /// will be executed on day changes in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"coarseSelector\">Defines an initial coarse selection</param>\n        /// <param name=\"fineSelector\">Defines a more detailed selection with access to more data</param>\n        [Obsolete(\"This method is obsolete, please use AddUniverse(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector) instead\")]\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> coarseSelector, Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> fineSelector)\n        {\n            if (!_coarseFineUniverseObsoleteLogSent)\n            {\n                Debug(\"Warning: AddUniverse(coarseSelector, fineSelector) is obsolete, please use AddUniverse(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector) instead.\");\n                _coarseFineUniverseObsoleteLogSent = true;\n            }\n\n            var coarse = new CoarseFundamentalUniverse(UniverseSettings, coarseSelector);\n\n            return AddUniverse(new FineFundamentalFilteredUniverse(coarse, fineSelector));\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This is for fine fundamental US Equity data and\n        /// will be executed on day changes in the NewYork time zone (<see cref=\"TimeZones.NewYork\"/>)\n        /// </summary>\n        /// <param name=\"universe\">The universe to be filtered with fine fundamental selection</param>\n        /// <param name=\"fineSelector\">Defines a more detailed selection with access to more data</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(Universe universe, Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> fineSelector)\n        {\n            return AddUniverse(new FundamentalFilteredUniverse(universe, fineSelector));\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This can be used to return a list of string\n        /// symbols retrieved from anywhere and will loads those symbols under the US Equity market.\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(string name, Func<DateTime, IEnumerable<string>> selector)\n        {\n            return AddUniverse(SecurityType.Equity, name, Resolution.Daily, Market.USA, UniverseSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new universe and adds it to the algorithm. This can be used to return a list of string\n        /// symbols retrieved from anywhere and will loads those symbols under the US Equity market.\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The resolution this universe should be triggered on</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(string name, Resolution resolution, Func<DateTime, IEnumerable<string>> selector)\n        {\n            return AddUniverse(SecurityType.Equity, name, resolution, Market.USA, UniverseSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new user defined universe that will fire on the requested resolution during market hours.\n        /// </summary>\n        /// <param name=\"securityType\">The security type of the universe</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"resolution\">The resolution this universe should be triggered on</param>\n        /// <param name=\"market\">The market of the universe</param>\n        /// <param name=\"universeSettings\">The subscription settings used for securities added from this universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        [DocumentationAttribute(Universes)]\n        public Universe AddUniverse(SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, Func<DateTime, IEnumerable<string>> selector)\n        {\n            var marketHoursDbEntry = MarketHoursDatabase.GetEntry(market, name, securityType);\n            var dataTimeZone = marketHoursDbEntry.DataTimeZone;\n            var exchangeTimeZone = marketHoursDbEntry.ExchangeHours.TimeZone;\n            var symbol = QuantConnect.Symbol.Create(name, securityType, market);\n            var config = new SubscriptionDataConfig(typeof(Fundamental), symbol, resolution, dataTimeZone, exchangeTimeZone, false, false, true, isFilteredSubscription: false);\n            return AddUniverse(new UserDefinedUniverse(config, universeSettings, resolution.ToTimeSpan(), selector));\n        }\n\n        /// <summary>\n        /// Adds a new universe that creates options of the security by monitoring any changes in the Universe the provided security is in.\n        /// Additionally, a filter can be applied to the options generated when the universe of the security changes.\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">Underlying Symbol to add as an option. For Futures, the option chain constructed will be per-contract, as long as a canonical Symbol is provided.</param>\n        /// <param name=\"optionFilter\">User-defined filter used to select the options we want out of the option chain provided.</param>\n        /// <exception cref=\"InvalidOperationException\">The underlying Symbol's universe is not found.</exception>\n        [DocumentationAttribute(Universes)]\n        public void AddUniverseOptions(Symbol underlyingSymbol, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter)\n        {\n            // We need to load the universe associated with the provided Symbol and provide that universe to the option filter universe.\n            // The option filter universe will subscribe to any changes in the universe of the underlying Symbol,\n            // ensuring that we load the option chain for every asset found in the underlying's Universe.\n            Universe universe;\n            if (!UniverseManager.TryGetValue(underlyingSymbol, out universe))\n            {\n                underlyingSymbol = AddSecurity(underlyingSymbol).Symbol;\n\n                // Recheck again, we should have a universe addition pending for the provided Symbol\n                if (!UniverseManager.TryGetValue(underlyingSymbol, out universe))\n                {\n                    // Should never happen, but it could be that the subscription\n                    // created with AddSecurity is not aligned with the Symbol we're using.\n                    throw new InvalidOperationException($\"Universe not found for underlying Symbol: {underlyingSymbol}.\");\n                }\n            }\n\n            // Allow all option contracts through without filtering if we're provided a null filter.\n            AddUniverseOptions(universe, optionFilter ?? (_ => _));\n        }\n\n        /// <summary>\n        /// Creates a new universe selection model and adds it to the algorithm. This universe selection model will chain to the security\n        /// changes of a given <see cref=\"Universe\"/> selection output and create a new <see cref=\"OptionChainUniverse\"/> for each of them\n        /// </summary>\n        /// <param name=\"universe\">The universe we want to chain an option universe selection model too</param>\n        /// <param name=\"optionFilter\">The option filter universe to use</param>\n        [DocumentationAttribute(Universes)]\n        public void AddUniverseOptions(Universe universe, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter)\n        {\n            AddUniverseSelection(new OptionChainedUniverseSelectionModel(universe, optionFilter));\n        }\n\n        /// <summary>\n        /// Adds the security to the user defined universe\n        /// </summary>\n        /// <param name=\"security\">The security to add</param>\n        /// <param name=\"configurations\">The <see cref=\"SubscriptionDataConfig\"/> instances we want to add</param>\n        private Security AddToUserDefinedUniverse(\n            Security security,\n            List<SubscriptionDataConfig> configurations)\n        {\n            var subscription = configurations.First();\n            // if we are adding a non-internal security which already has an internal feed, we remove it first\n            if (Securities.TryGetValue(security.Symbol, out var existingSecurity))\n            {\n                if (!subscription.IsInternalFeed && existingSecurity.IsInternalFeed())\n                {\n                    var securityUniverse = UniverseManager.Select(x => x.Value).OfType<UserDefinedUniverse>().FirstOrDefault(x => x.Members.ContainsKey(security.Symbol));\n                    securityUniverse?.Remove(security.Symbol);\n\n                    Securities.Remove(security.Symbol);\n                    Securities.Add(security);\n                }\n            }\n            else\n            {\n                Securities.Add(security);\n            }\n\n            // add this security to the user defined universe\n            Universe universe;\n            var universeSymbol = UserDefinedUniverse.CreateSymbol(security.Type, security.Symbol.ID.Market);\n            if (!UniverseManager.TryGetValue(universeSymbol, out universe))\n            {\n                if (universe == null)\n                {\n                    // create a new universe, these subscription settings don't currently get used\n                    // since universe selection proper is never invoked on this type of universe\n                    var uconfig = new SubscriptionDataConfig(subscription, symbol: universeSymbol, isInternalFeed: true, fillForward: false,\n                        exchangeTimeZone: DateTimeZone.Utc,\n                        dataTimeZone: DateTimeZone.Utc);\n\n                    // this is the universe symbol, has no real entry in the mhdb, will default to market and security type\n                    // set entry in market hours database for the universe subscription to match the config\n                    var symbolString = MarketHoursDatabase.GetDatabaseSymbolKey(uconfig.Symbol);\n                    MarketHoursDatabase.SetEntry(uconfig.Market, symbolString, uconfig.SecurityType,\n                        SecurityExchangeHours.AlwaysOpen(uconfig.ExchangeTimeZone), uconfig.DataTimeZone);\n\n                    universe = new UserDefinedUniverse(uconfig,\n                        new UniverseSettings(\n                            subscription.Resolution,\n                            security.Leverage,\n                            subscription.FillDataForward,\n                            subscription.ExtendedMarketHours,\n                            TimeSpan.Zero),\n                        QuantConnect.Time.MaxTimeSpan,\n                        new List<Symbol>());\n\n                    AddUniverse(universe);\n                }\n            }\n\n            var userDefinedUniverse = universe as UserDefinedUniverse;\n            if (userDefinedUniverse != null)\n            {\n                lock (_pendingUniverseAdditionsLock)\n                {\n                    _pendingUserDefinedUniverseSecurityChanges.Add(new UserDefinedUniverseUpdate(userDefinedUniverse, configurations, security));\n                }\n            }\n            else\n            {\n                // should never happen, someone would need to add a non-user defined universe with this symbol\n                throw new Exception($\"Expected universe with symbol '{universeSymbol.Value}' to be of type {nameof(UserDefinedUniverse)} but was {universe.GetType().Name}.\");\n            }\n\n            return security;\n        }\n\n        /// <summary>\n        /// Configures the security to be in raw data mode and ensures that a reasonable default volatility model is supplied\n        /// </summary>\n        /// <param name=\"security\">The underlying security</param>\n        private void ConfigureUnderlyingSecurity(Security security)\n        {\n            // force underlying securities to be raw data mode\n            var configs = SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(security.Symbol);\n            if (configs.DataNormalizationMode() != DataNormalizationMode.Raw)\n            {\n                // Add this symbol to our set of raw normalization warning symbols to alert the user at the end\n                // Set a hard limit to avoid growing this collection unnecessarily large\n                if (_rawNormalizationWarningSymbols != null && _rawNormalizationWarningSymbols.Count <= _rawNormalizationWarningSymbolsMaxCount)\n                {\n                    _rawNormalizationWarningSymbols.Add(security.Symbol);\n                }\n\n                configs.SetDataNormalizationMode(DataNormalizationMode.Raw);\n                // For backward compatibility we need to refresh the security DataNormalizationMode Property\n                security.RefreshDataNormalizationModeProperty();\n            }\n        }\n\n        /// <summary>\n        /// Helper method to create the configuration of a custom universe\n        /// </summary>\n        private SubscriptionDataConfig GetCustomUniverseConfiguration(Type dataType, string name, string market, Resolution? resolution = null)\n        {\n            if (dataType == typeof(CoarseFundamental) || dataType == typeof(FineFundamental))\n            {\n                dataType = typeof(FundamentalUniverse);\n            }\n\n            if (!TryGetUniverseSymbol(dataType, market, out var universeSymbol))\n            {\n                market ??= Market.USA;\n                if (string.IsNullOrEmpty(name))\n                {\n                    name = $\"{dataType.Name}-{market}-{Guid.NewGuid()}\";\n                }\n                // same as 'AddData<>' 'T' type will be treated as custom/base data type with always open market hours\n                universeSymbol = QuantConnect.Symbol.Create(name, SecurityType.Base, market, baseDataType: dataType);\n            }\n            var marketHoursDbEntry = MarketHoursDatabase.GetEntry(universeSymbol, new[] { dataType });\n            var dataTimeZone = marketHoursDbEntry.DataTimeZone;\n            var exchangeTimeZone = marketHoursDbEntry.ExchangeHours.TimeZone;\n            return new SubscriptionDataConfig(dataType, universeSymbol, resolution ?? Resolution.Daily, dataTimeZone, exchangeTimeZone, false, false, true, true, isFilteredSubscription: false);\n        }\n\n        private bool TryGetUniverseSymbol(Type dataType, string market, out Symbol symbol)\n        {\n            symbol = null;\n            if (dataType.IsAssignableTo(typeof(BaseDataCollection)))\n            {\n                var instance = dataType.GetBaseDataInstance() as BaseDataCollection;\n                symbol = instance.UniverseSymbol(market);\n                return true;\n            }\n            return false;\n        }\n\n        private Universe AddUniverseStringSelector<T>(Func<IEnumerable<BaseData>, IEnumerable<string>> selector, SecurityType? securityType = null, string name = null,\n            Resolution? resolution = null, string market = null, UniverseSettings universeSettings = null)\n        {\n            if (market.IsNullOrEmpty())\n            {\n                market = Market.USA;\n            }\n            securityType ??= SecurityType.Equity;\n            Func<IEnumerable<BaseData>, IEnumerable<Symbol>> symbolSelector = data => selector(data).Select(x => QuantConnect.Symbol.Create(x, securityType.Value, market, baseDataType: typeof(T)));\n            return AddUniverse<T>(name, resolution, market, universeSettings, symbolSelector);\n        }\n\n        private Universe AddUniverseSymbolSelector(Type dataType, string name = null, Resolution? resolution = null, string market = null, UniverseSettings universeSettings = null,\n            Func<IEnumerable<BaseData>, IEnumerable<Symbol>> selector = null)\n        {\n            var config = GetCustomUniverseConfiguration(dataType, name, market, resolution);\n            return AddUniverse(new FuncUniverse(config, universeSettings, selector));\n        }\n\n        /// <summary>\n        /// Helper class used to store <see cref=\"UserDefinedUniverse\"/> additions.\n        /// They will be consumed at <see cref=\"OnEndOfTimeStep\"/>\n        /// </summary>\n        private class UserDefinedUniverseUpdate\n        {\n            public bool IsAddition => SubscriptionDataConfigs != null;\n            public Security Security { get; }\n            public UserDefinedUniverse Universe { get; }\n            public List<SubscriptionDataConfig> SubscriptionDataConfigs { get; }\n\n            public UserDefinedUniverseUpdate(\n                UserDefinedUniverse universe,\n                List<SubscriptionDataConfig> subscriptionDataConfigs,\n                Security security)\n            {\n                Universe = universe;\n                SubscriptionDataConfigs = subscriptionDataConfigs;\n                Security = security;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QCAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Globalization;\nusing NodaTime;\nusing NodaTime.TimeZones;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Notifications;\nusing QuantConnect.Orders;\nusing QuantConnect.Parameters;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.IndexOption;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Fundamental;\nusing System.Collections.Concurrent;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Selection;\nusing QuantConnect.Storage;\nusing Index = QuantConnect.Securities.Index.Index;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing Python.Runtime;\nusing QuantConnect.Commands;\nusing Newtonsoft.Json;\nusing QuantConnect.Securities.Index;\nusing QuantConnect.Api;\nusing Common.Util;\n\nnamespace QuantConnect.Algorithm\n{\n    /// <summary>\n    /// QC Algorithm Base Class - Handle the basic requirements of a trading algorithm,\n    /// allowing user to focus on event methods. The QCAlgorithm class implements Portfolio,\n    /// Securities, Transactions and Data Subscription Management.\n    /// </summary>\n    public partial class QCAlgorithm : MarshalByRefObject, IAlgorithm\n    {\n        #region Documentation Attribute Categories\n        const string AddingData = \"Adding Data\";\n        const string AlgorithmFramework = \"Algorithm Framework\";\n        const string Charting = \"Charting\";\n        const string ConsolidatingData = \"Consolidating Data\";\n        const string HandlingData = \"Handling Data\";\n        const string HistoricalData = \"Historical Data\";\n        const string Indicators = \"Indicators\";\n        const string LiveTrading = \"Live Trading\";\n        const string Logging = \"Logging\";\n        const string MachineLearning = \"Machine Learning\";\n        const string Modeling = \"Modeling\";\n        const string ParameterAndOptimization = \"Parameter and Optimization\";\n        const string ScheduledEvents = \"Scheduled Events\";\n        const string SecuritiesAndPortfolio = \"Securities and Portfolio\";\n        const string TradingAndOrders = \"Trading and Orders\";\n        const string Universes = \"Universes\";\n        const string StatisticsTag = \"Statistics\";\n        #endregion\n\n        /// <summary>\n        /// Maximum length of the name or tags of a backtest\n        /// </summary>\n        protected const int MaxNameAndTagsLength = 200;\n\n        /// <summary>\n        /// Maximum number of tags allowed for a backtest\n        /// </summary>\n        protected const int MaxTagsCount = 100;\n\n        private readonly TimeKeeper _timeKeeper;\n        private LocalTimeKeeper _localTimeKeeper;\n\n        private string _name;\n        private HashSet<string> _tags;\n        private bool _tagsLimitReachedLogSent;\n        private bool _tagsCollectionTruncatedLogSent;\n        private bool _hasShownDailyConsolidationWarning;\n        private DateTime _start;\n        private DateTime _startDate;   //Default start and end dates.\n        private DateTime _endDate;     //Default end to yesterday\n        private bool _locked;\n        private bool _liveMode;\n        private AlgorithmMode _algorithmMode;\n        private DeploymentTarget _deploymentTarget;\n        private string _algorithmId = \"\";\n        private ConcurrentQueue<string> _debugMessages = new ConcurrentQueue<string>();\n        private ConcurrentQueue<string> _logMessages = new ConcurrentQueue<string>();\n        private ConcurrentQueue<string> _errorMessages = new ConcurrentQueue<string>();\n        private IStatisticsService _statisticsService;\n        private IBrokerageModel _brokerageModel;\n\n        private bool _sentBroadcastCommandsDisabled;\n        private readonly HashSet<string> _oneTimeCommandErrors = new();\n        private readonly Dictionary<string, Func<CallbackCommand, bool?>> _registeredCommands = new(StringComparer.InvariantCultureIgnoreCase);\n\n        //Error tracking to avoid message flooding:\n        private string _previousDebugMessage = \"\";\n        private string _previousErrorMessage = \"\";\n\n        /// <summary>\n        /// Gets the market hours database in use by this algorithm\n        /// </summary>\n        protected MarketHoursDatabase MarketHoursDatabase { get; }\n\n        /// <summary>\n        /// Gets the symbol properties database in use by this algorithm\n        /// </summary>\n        protected SymbolPropertiesDatabase SymbolPropertiesDatabase { get; }\n\n        // used for calling through to void OnData(Slice) if no override specified\n        private bool _checkedForOnDataSlice;\n        private Action<Slice> _onDataSlice;\n\n        // flips to true when the user\n        private bool _userSetSecurityInitializer;\n\n        // warmup resolution variables\n        private TimeSpan? _warmupTimeSpan;\n        private int? _warmupBarCount;\n        private Dictionary<string, string> _parameters = new Dictionary<string, string>();\n        private SecurityDefinitionSymbolResolver _securityDefinitionSymbolResolver;\n\n        private SecurityDefinitionSymbolResolver SecurityDefinitionSymbolResolver\n        {\n            get\n            {\n                _securityDefinitionSymbolResolver ??= SecurityDefinitionSymbolResolver.GetInstance();\n                return _securityDefinitionSymbolResolver;\n            }\n        }\n\n        private readonly HistoryRequestFactory _historyRequestFactory;\n\n        private IApi _api;\n\n        /// <summary>\n        /// QCAlgorithm Base Class Constructor - Initialize the underlying QCAlgorithm components.\n        /// QCAlgorithm manages the transactions, portfolio, charting and security subscriptions for the users algorithms.\n        /// </summary>\n        public QCAlgorithm()\n        {\n            Name = GetType().Name;\n            Tags = new();\n            Status = AlgorithmStatus.Running;\n\n            // AlgorithmManager will flip this when we're caught up with realtime\n            IsWarmingUp = true;\n\n            //Initialise the Algorithm Helper Classes:\n            //- Note - ideally these wouldn't be here, but because of the DLL we need to make the classes shared across\n            //  the Worker & Algorithm, limiting ability to do anything else.\n\n            //Initialise Start Date:\n            _startDate = new DateTime(1998, 01, 01);\n            // intialize our time keeper with only new york\n            _timeKeeper = new TimeKeeper(_startDate, new[] { TimeZones.NewYork });\n            // set our local time zone\n            _localTimeKeeper = _timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            //Initialise End Date:\n            SetEndDate(DateTime.UtcNow.ConvertFromUtc(TimeZone));\n\n            // Set default algorithm mode as backtesting\n            _algorithmMode = AlgorithmMode.Backtesting;\n\n            // Set default deployment target as local\n            _deploymentTarget = DeploymentTarget.LocalPlatform;\n\n            Settings = new AlgorithmSettings();\n            DefaultOrderProperties = new OrderProperties();\n\n            //Initialise Data Manager\n            SubscriptionManager = new SubscriptionManager(_timeKeeper);\n\n            Securities = new SecurityManager(_timeKeeper);\n            Transactions = new SecurityTransactionManager(this, Securities);\n            Portfolio = new SecurityPortfolioManager(Securities, Transactions, Settings, DefaultOrderProperties);\n            SignalExport = new SignalExportManager(this);\n\n            BrokerageModel = new DefaultBrokerageModel();\n            RiskFreeInterestRateModel = new InterestRateProvider();\n            Notify = new NotificationManager(false); // Notification manager defaults to disabled.\n\n            //Initialise to unlocked:\n            _locked = false;\n\n            // get exchange hours loaded from the market-hours-database.csv in /Data/market-hours\n            MarketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            SymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n\n            // universe selection\n            UniverseManager = new UniverseManager();\n            Universe = new UniverseDefinitions(this);\n            UniverseSettings = new UniverseSettings(Resolution.Minute, Security.NullLeverage, true, false, TimeSpan.FromDays(1));\n\n            // initialize our scheduler, this acts as a liason to the real time handler\n            Schedule = new ScheduleManager(this, Securities, TimeZone, MarketHoursDatabase);\n\n            // initialize the trade builder\n            SetTradeBuilder(new TradeBuilder(FillGroupingMethod.FillToFill, FillMatchingMethod.FIFO));\n\n            SecurityInitializer = new BrokerageModelSecurityInitializer(BrokerageModel, SecuritySeeder.Null);\n\n            CandlestickPatterns = new CandlestickPatterns(this);\n\n            // initialize trading calendar\n            TradingCalendar = new TradingCalendar(Securities, MarketHoursDatabase);\n\n            OptionChainProvider = new EmptyOptionChainProvider();\n            FutureChainProvider = new EmptyFutureChainProvider();\n            _historyRequestFactory = new HistoryRequestFactory(this);\n\n            // set model defaults, universe selection set via PostInitialize\n            SetAlpha(new NullAlphaModel());\n            SetPortfolioConstruction(new NullPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n            SetUniverseSelection(new NullUniverseSelectionModel());\n\n            Insights = new InsightManager(this);\n        }\n\n        /// <summary>\n        /// Event fired when the algorithm generates insights\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public event AlgorithmEvent<GeneratedInsightsCollection> InsightsGenerated;\n\n        /// <summary>\n        /// Security collection is an array of the security objects such as <see cref=\"Equity\"/> and <see cref=\"Forex\"/>. Securities data\n        /// manages the properties of tradeable assets such as price, open and close time and holdings information.\n        /// </summary>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public SecurityManager Securities\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Read-only dictionary containing all active securities. An active security is\n        /// a security that is currently selected by the universe or has holdings or open orders.\n        /// </summary>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public ReadOnlyExtendedDictionary<Symbol, Security> ActiveSecurities => UniverseManager.ActiveSecurities;\n\n        /// <summary>\n        /// Portfolio object provieds easy access to the underlying security-holding properties; summed together in a way to make them useful.\n        /// This saves the user time by providing common portfolio requests in a single\n        /// </summary>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public SecurityPortfolioManager Portfolio\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the account currency\n        /// </summary>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public string AccountCurrency => Portfolio.CashBook.AccountCurrency;\n\n        /// <summary>\n        /// Gets the time keeper instance\n        /// </summary>\n        public ITimeKeeper TimeKeeper => _timeKeeper;\n\n        /// <summary>\n        /// Generic Data Manager - Required for compiling all data feeds in order, and passing them into algorithm event methods.\n        /// The subscription manager contains a list of the data feed's we're subscribed to and properties of each data feed.\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public SubscriptionManager SubscriptionManager\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// SignalExport - Allows sending export signals to different 3rd party API's. For example, it allows to send signals\n        /// to Collective2, CrunchDAO and Numerai API's\n        /// </summary>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public SignalExportManager SignalExport\n        {\n            get;\n        }\n\n        /// <summary>\n        /// The project id associated with this algorithm if any\n        /// </summary>\n        public int ProjectId\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the brokerage model - used to model interactions with specific brokerages.\n        /// </summary>\n        [DocumentationAttribute(Modeling)]\n        public IBrokerageModel BrokerageModel\n        {\n            get\n            {\n                return _brokerageModel;\n            }\n            private set\n            {\n                _brokerageModel = value;\n                try\n                {\n                    BrokerageName = Brokerages.BrokerageModel.GetBrokerageName(_brokerageModel);\n                }\n                catch (ArgumentOutOfRangeException)\n                {\n                    // The brokerage model might be a custom one which has not a corresponding BrokerageName\n                    BrokerageName = BrokerageName.Default;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the brokerage name.\n        /// </summary>\n        [DocumentationAttribute(Modeling)]\n        public BrokerageName BrokerageName\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the brokerage message handler used to decide what to do\n        /// with each message sent from the brokerage\n        /// </summary>\n        [DocumentationAttribute(Modeling)]\n        public IBrokerageMessageHandler BrokerageMessageHandler\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the risk free interest rate model used to get the interest rates\n        /// </summary>\n        [DocumentationAttribute(Modeling)]\n        public IRiskFreeInterestRateModel RiskFreeInterestRateModel\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Notification Manager for Sending Live Runtime Notifications to users about important events.\n        /// </summary>\n        [DocumentationAttribute(LiveTrading)]\n        public NotificationManager Notify\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets schedule manager for adding/removing scheduled events\n        /// </summary>\n        [DocumentationAttribute(ScheduledEvents)]\n        public ScheduleManager Schedule\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets or sets the current status of the algorithm\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public AlgorithmStatus Status\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets an instance that is to be used to initialize newly created securities.\n        /// </summary>\n        [DocumentationAttribute(AddingData)]\n        public ISecurityInitializer SecurityInitializer\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the Trade Builder to generate trades from executions\n        /// </summary>\n        [DocumentationAttribute(TradingAndOrders)]\n        public ITradeBuilder TradeBuilder\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets an instance to access the candlestick pattern helper methods\n        /// </summary>\n        [DocumentationAttribute(Indicators)]\n        public CandlestickPatterns CandlestickPatterns\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the date rules helper object to make specifying dates for events easier\n        /// </summary>\n        [DocumentationAttribute(ScheduledEvents)]\n        public DateRules DateRules\n        {\n            get { return Schedule.DateRules; }\n        }\n\n        /// <summary>\n        /// Gets the time rules helper object to make specifying times for events easier\n        /// </summary>\n        [DocumentationAttribute(ScheduledEvents)]\n        public TimeRules TimeRules\n        {\n            get { return Schedule.TimeRules; }\n        }\n\n        /// <summary>\n        /// Gets trading calendar populated with trading events\n        /// </summary>\n        [DocumentationAttribute(ScheduledEvents)]\n        public TradingCalendar TradingCalendar\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the user settings for the algorithm\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public IAlgorithmSettings Settings\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        [DocumentationAttribute(AddingData)]\n        [Obsolete(\"OptionChainProvider property is will soon be deprecated. \" +\n            \"The new OptionChain() method should be used to fetch option chains, \" +\n            \"which will contain additional data per contract, like daily price data, implied volatility and greeks.\")]\n        public IOptionChainProvider OptionChainProvider { get; private set; }\n\n        /// <summary>\n        /// Gets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        [DocumentationAttribute(AddingData)]\n        [Obsolete(\"FutureChainProvider property is will soon be deprecated. \" +\n            \"The new FuturesChain() method should be used to fetch futures chains, \" +\n            \"which will contain additional data per contract, like daily price data.\")]\n        public IFutureChainProvider FutureChainProvider { get; private set; }\n\n        /// <summary>\n        /// Gets the default order properties\n        /// </summary>\n        [DocumentationAttribute(TradingAndOrders)]\n        public IOrderProperties DefaultOrderProperties { get; set; }\n\n        /// <summary>\n        /// Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting\n        /// the algorithm-id.\n        /// </summary>\n        /// <seealso cref=\"AlgorithmId\"/>\n        [DocumentationAttribute(HandlingData)]\n        public string Name\n        {\n            get\n            {\n                return _name;\n            }\n            set\n            {\n                if (_locked)\n                {\n                    throw new InvalidOperationException(\"Cannot set algorithm name after it is initialized.\");\n                }\n\n                if (!string.IsNullOrEmpty(value))\n                {\n                    _name = value.Truncate(MaxNameAndTagsLength);\n                }\n            }\n        }\n\n        /// <summary>\n        /// A list of tags associated with the algorithm or the backtest, useful for categorization\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public HashSet<string> Tags\n        {\n            get\n            {\n                return _tags;\n            }\n            set\n            {\n                if (value == null)\n                {\n                    return;\n                }\n\n                var tags = value.Where(x => !string.IsNullOrEmpty(x?.Trim())).ToList();\n\n                if (tags.Count > MaxTagsCount && !_tagsCollectionTruncatedLogSent)\n                {\n                    Log($\"Warning: The tags collection cannot contain more than {MaxTagsCount} items. It will be truncated.\");\n                    _tagsCollectionTruncatedLogSent = true;\n                }\n\n                _tags = tags.Take(MaxTagsCount).ToHashSet(tag => tag.Truncate(MaxNameAndTagsLength));\n                if (_locked)\n                {\n                    TagsUpdated?.Invoke(this, Tags);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event fired algorithm's name is changed\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public event AlgorithmEvent<string> NameUpdated;\n\n        /// <summary>\n        /// Event fired when the tag collection is updated\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public event AlgorithmEvent<HashSet<string>> TagsUpdated;\n\n        /// <summary>\n        /// Read-only value for current time frontier of the algorithm in terms of the <see cref=\"TimeZone\"/>\n        /// </summary>\n        /// <remarks>During backtesting this is primarily sourced from the data feed. During live trading the time is updated from the system clock.</remarks>\n        [DocumentationAttribute(HandlingData)]\n        public DateTime Time\n        {\n            get { return _localTimeKeeper.LocalTime; }\n        }\n\n        /// <summary>\n        /// Current date/time in UTC.\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public DateTime UtcTime\n        {\n            get { return _timeKeeper.UtcTime; }\n        }\n\n        /// <summary>\n        /// Gets the time zone used for the <see cref=\"Time\"/> property. The default value\n        /// is <see cref=\"TimeZones.NewYork\"/>\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public DateTimeZone TimeZone\n        {\n            get { return _localTimeKeeper.TimeZone; }\n        }\n\n        /// <summary>\n        /// Value of the user set start-date from the backtest.\n        /// </summary>\n        /// <remarks>This property is set with SetStartDate() and defaults to the earliest QuantConnect data available - Jan 1st 1998. It is ignored during live trading </remarks>\n        /// <seealso cref=\"SetStartDate(DateTime)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public DateTime StartDate => _startDate;\n\n        /// <summary>\n        /// Value of the user set start-date from the backtest. Controls the period of the backtest.\n        /// </summary>\n        /// <remarks> This property is set with SetEndDate() and defaults to today. It is ignored during live trading.</remarks>\n        /// <seealso cref=\"SetEndDate(DateTime)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public DateTime EndDate\n        {\n            get\n            {\n                return _endDate;\n            }\n        }\n\n        /// <summary>\n        /// Algorithm Id for this backtest or live algorithm.\n        /// </summary>\n        /// <remarks>A unique identifier for </remarks>\n        [DocumentationAttribute(HandlingData)]\n        public string AlgorithmId\n        {\n            get\n            {\n                return _algorithmId;\n            }\n        }\n\n        /// <summary>\n        /// Boolean property indicating the algorithm is currently running in live mode.\n        /// </summary>\n        /// <remarks>Intended for use where certain behaviors will be enabled while the algorithm is trading live: such as notification emails, or displaying runtime statistics.</remarks>\n        [DocumentationAttribute(LiveTrading)]\n        public bool LiveMode\n        {\n            get\n            {\n                return _liveMode;\n            }\n        }\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        public AlgorithmMode AlgorithmMode\n        {\n            get\n            {\n                return _algorithmMode;\n            }\n        }\n\n        /// <summary>\n        /// Deployment target, either local or cloud.\n        /// </summary>\n        public DeploymentTarget DeploymentTarget\n        {\n            get\n            {\n                return _deploymentTarget;\n            }\n        }\n\n        /// <summary>\n        /// Storage for debugging messages before the event handler has passed control back to the Lean Engine.\n        /// </summary>\n        /// <seealso cref=\"Debug(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public ConcurrentQueue<string> DebugMessages\n        {\n            get\n            {\n                return _debugMessages;\n            }\n            set\n            {\n                _debugMessages = value;\n            }\n        }\n\n        /// <summary>\n        /// Storage for log messages before the event handlers have passed control back to the Lean Engine.\n        /// </summary>\n        /// <seealso cref=\"Log(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public ConcurrentQueue<string> LogMessages\n        {\n            get\n            {\n                return _logMessages;\n            }\n            set\n            {\n                _logMessages = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the run time error from the algorithm, or null if none was encountered.\n        /// </summary>\n        [DocumentationAttribute(Logging)]\n        public Exception RunTimeError { get; set; }\n\n        /// <summary>\n        /// List of error messages generated by the user's code calling the \"Error\" function.\n        /// </summary>\n        /// <remarks>This method is best used within a try-catch bracket to handle any runtime errors from a user algorithm.</remarks>\n        /// <see cref=\"Error(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public ConcurrentQueue<string> ErrorMessages\n        {\n            get\n            {\n                return _errorMessages;\n            }\n            set\n            {\n                _errorMessages = value;\n            }\n        }\n\n        /// <summary>\n        /// Returns the current Slice object\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public Slice CurrentSlice { get; private set; }\n\n        /// <summary>\n        /// Gets the object store, used for persistence\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public ObjectStore ObjectStore { get; private set; }\n\n        /// <summary>\n        /// The current statistics for the running algorithm.\n        /// </summary>\n        [DocumentationAttribute(StatisticsTag)]\n        public StatisticsResults Statistics\n        {\n            get\n            {\n                return _statisticsService?.StatisticsResults() ?? new StatisticsResults();\n            }\n        }\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <seealso cref=\"SetStartDate(DateTime)\"/>\n        /// <seealso cref=\"SetEndDate(DateTime)\"/>\n        /// <seealso cref=\"SetCash(decimal)\"/>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(HandlingData)]\n        public virtual void Initialize()\n        {\n            //Setup Required Data\n            throw new NotImplementedException(\"Please override the Initialize() method\");\n        }\n\n        /// <summary>\n        /// Called by setup handlers after Initialize and allows the algorithm a chance to organize\n        /// the data gather in the Initialize method\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        [DocumentationAttribute(HandlingData)]\n        public virtual void PostInitialize()\n        {\n            if (_endDate < _startDate)\n            {\n                throw new ArgumentException(\"Please select an algorithm end date greater than start date.\");\n            }\n\n            var portfolioConstructionModel = PortfolioConstruction as PortfolioConstructionModel;\n            if (portfolioConstructionModel != null)\n            {\n                // only override default values if user set the algorithm setting\n                if (Settings.RebalancePortfolioOnSecurityChanges.HasValue)\n                {\n                    portfolioConstructionModel.RebalanceOnSecurityChanges\n                        = Settings.RebalancePortfolioOnSecurityChanges.Value;\n                }\n                if (Settings.RebalancePortfolioOnInsightChanges.HasValue)\n                {\n                    portfolioConstructionModel.RebalanceOnInsightChanges\n                        = Settings.RebalancePortfolioOnInsightChanges.Value;\n                }\n            }\n            else\n            {\n                if (Settings.RebalancePortfolioOnInsightChanges.HasValue\n                    || Settings.RebalancePortfolioOnSecurityChanges.HasValue)\n                {\n                    Debug(\"Warning: rebalance portfolio settings are set but not supported by the current IPortfolioConstructionModel type: \" +\n                          $\"{PortfolioConstruction.GetType()}\");\n                }\n            }\n\n            FrameworkPostInitialize();\n\n            // if the benchmark hasn't been set yet, load in the default from the brokerage model\n            if (Benchmark == null)\n            {\n                Benchmark = BrokerageModel.GetBenchmark(Securities);\n            }\n\n            // Check benchmark timezone against algorithm timezone to warn for misaligned statistics\n            if (Benchmark is SecurityBenchmark securityBenchmark)\n            {\n                // Only warn on algorithms subscribed to daily resolution as its statistics will suffer the most\n                var subscription = SubscriptionManager.Subscriptions.OrderByDescending(x => x.Resolution).FirstOrDefault();\n                var benchmarkTimeZone = MarketHoursDatabase.GetDataTimeZone(securityBenchmark.Security.Symbol.ID.Market,\n                    securityBenchmark.Security.Symbol, securityBenchmark.Security.Type);\n                if ((subscription?.Resolution == Resolution.Daily || UniverseSettings.Resolution == Resolution.Daily) && benchmarkTimeZone != TimeZone)\n                {\n                    Log($\"QCAlgorithm.PostInitialize(): Warning: Using a security benchmark of a different timezone ({benchmarkTimeZone})\" +\n                        $\" than the algorithm TimeZone ({TimeZone}) may lead to skewed and incorrect statistics. Use a higher resolution than daily to minimize.\");\n                }\n            }\n\n            if (TryGetWarmupHistoryStartTime(out var result))\n            {\n                SetDateTime(result.ConvertToUtc(TimeZone));\n            }\n            else\n            {\n                SetFinishedWarmingUp();\n            }\n\n            // perform end of time step checks, such as enforcing underlying securities are in raw data mode\n            OnEndOfTimeStep();\n        }\n\n        /// <summary>\n        /// Called when the algorithm has completed initialization and warm up.\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnWarmupFinished()\n        {\n        }\n\n        /// <summary>\n        /// Gets the parameter with the specified name. If a parameter with the specified name does not exist,\n        /// the given default value is returned if any, else null\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public string GetParameter(string name, string defaultValue = null)\n        {\n            return _parameters.TryGetValue(name, out var value) ? value : defaultValue;\n        }\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as an integer. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public int GetParameter(string name, int defaultValue)\n        {\n            return _parameters.TryGetValue(name, out var strValue) && int.TryParse(strValue, out var value) ? value : defaultValue;\n        }\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a double. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public double GetParameter(string name, double defaultValue)\n        {\n            return _parameters.TryGetValue(name, out var strValue) &&\n                double.TryParse(strValue, NumberStyles.Any, CultureInfo.InvariantCulture, out var value) ? value : defaultValue;\n        }\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a decimal. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public decimal GetParameter(string name, decimal defaultValue)\n        {\n            return _parameters.TryGetValue(name, out var strValue) &&\n                decimal.TryParse(strValue, NumberStyles.Any, CultureInfo.InvariantCulture, out var value) ? value : defaultValue;\n        }\n\n        /// <summary>\n        /// Gets a read-only dictionary with all current parameters\n        /// </summary>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public ReadOnlyExtendedDictionary<string, string> GetParameters()\n        {\n            return _parameters.ToReadOnlyExtendedDictionary();\n        }\n\n        /// <summary>\n        /// Sets the parameters from the dictionary\n        /// </summary>\n        /// <param name=\"parameters\">Dictionary containing the parameter names to values</param>\n        [DocumentationAttribute(ParameterAndOptimization)]\n        public void SetParameters(Dictionary<string, string> parameters)\n        {\n            // save off a copy and try to apply the parameters\n            _parameters = parameters.ToDictionary();\n            try\n            {\n                ParameterAttribute.ApplyAttributes(parameters, this);\n            }\n            catch (Exception err)\n            {\n                Error(\"Error applying parameter values: \" + err.Message);\n            }\n        }\n\n        /// <summary>\n        /// Set the available data feeds in the <see cref=\"SecurityManager\"/>\n        /// </summary>\n        /// <param name=\"availableDataTypes\">The different <see cref=\"TickType\"/> each <see cref=\"Security\"/> supports</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetAvailableDataTypes(Dictionary<SecurityType, List<TickType>> availableDataTypes)\n        {\n            if (availableDataTypes == null)\n            {\n                return;\n            }\n\n            foreach (var dataFeed in availableDataTypes)\n            {\n                SubscriptionManager.AvailableDataTypes[dataFeed.Key] = dataFeed.Value;\n            }\n        }\n\n        /// <summary>\n        /// Sets the security initializer, used to initialize/configure securities after creation.\n        /// The initializer will be applied to all universes and manually added securities.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void SetSecurityInitializer(ISecurityInitializer securityInitializer)\n        {\n            if (_locked)\n            {\n                throw new Exception(\"SetSecurityInitializer() cannot be called after algorithm initialization. \" +\n                                    \"When you use the SetSecurityInitializer() method it will apply to all universes and manually added securities.\");\n            }\n\n            if (_userSetSecurityInitializer)\n            {\n                Debug(\"Warning: SetSecurityInitializer() has already been called, existing security initializers in all universes will be overwritten.\");\n            }\n\n            // this flag will prevent calls to SetBrokerageModel from overwriting this initializer\n            _userSetSecurityInitializer = true;\n            SecurityInitializer = securityInitializer;\n        }\n\n        /// <summary>\n        /// Sets the security initializer function, used to initialize/configure securities after creation.\n        /// The initializer will be applied to all universes and manually added securities.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer function</param>\n        [Obsolete(\"This method is deprecated. Please use this overload: SetSecurityInitializer(Action<Security> securityInitializer)\")]\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void SetSecurityInitializer(Action<Security, bool> securityInitializer)\n        {\n            SetSecurityInitializer(new FuncSecurityInitializer(security => securityInitializer(security, false)));\n        }\n\n        /// <summary>\n        /// Sets the security initializer function, used to initialize/configure securities after creation.\n        /// The initializer will be applied to all universes and manually added securities.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer function</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void SetSecurityInitializer(Action<Security> securityInitializer)\n        {\n            SetSecurityInitializer(new FuncSecurityInitializer(securityInitializer));\n        }\n\n        /// <summary>\n        /// Adds a security initializer, used to initialize/configure securities after creation.\n        /// The initializer will appended to the default initializer and others that might have been\n        /// added using this method, and will be applied to all universes and manually added securities.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void AddSecurityInitializer(ISecurityInitializer securityInitializer)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"AddSecurityInitializer() cannot be called after algorithm initialization. \" +\n                    \"When you use the AddSecurityInitializer() method it will apply to all universes and manually added securities.\");\n            }\n\n            if (SecurityInitializer is CompositeSecurityInitializer compositeSecurityInitializer)\n            {\n                compositeSecurityInitializer.AddSecurityInitializer(securityInitializer);\n            }\n            else\n            {\n                SecurityInitializer = new CompositeSecurityInitializer(SecurityInitializer, securityInitializer);\n            }\n        }\n\n        /// <summary>\n        /// Adds a security initializer, used to initialize/configure securities after creation.\n        /// </summary>\n        /// <param name=\"securityInitializer\">The security initializer</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Modeling)]\n        public void AddSecurityInitializer(Action<Security> securityInitializer)\n        {\n            AddSecurityInitializer(new FuncSecurityInitializer(securityInitializer));\n        }\n\n        /// <summary>\n        /// Sets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"optionChainProvider\">The option chain provider</param>\n        [DocumentationAttribute(AddingData)]\n        public void SetOptionChainProvider(IOptionChainProvider optionChainProvider)\n        {\n            OptionChainProvider = optionChainProvider;\n        }\n\n        /// <summary>\n        /// Sets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"futureChainProvider\">The future chain provider</param>\n        [DocumentationAttribute(AddingData)]\n        public void SetFutureChainProvider(IFutureChainProvider futureChainProvider)\n        {\n            FutureChainProvider = futureChainProvider;\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <code>\n        /// TradeBars bars = slice.Bars;\n        /// Ticks ticks = slice.Ticks;\n        /// TradeBar spy = slice[\"SPY\"];\n        /// List{Tick} aaplTicks = slice[\"AAPL\"]\n        /// Quandl oil = slice[\"OIL\"]\n        /// dynamic anySymbol = slice[symbol];\n        /// DataDictionary{Quandl} allQuandlData = slice.Get{Quand}\n        /// Quandl oil = slice.Get{Quandl}(\"OIL\")\n        /// </code>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnData(Slice slice)\n        {\n            // as a default implementation, let's look for and call OnData(Slice) just in case a user forgot to use the override keyword\n            if (!_checkedForOnDataSlice)\n            {\n                _checkedForOnDataSlice = true;\n\n                var method = GetType().GetMethods()\n                    .Where(x => x.Name == \"OnData\")\n                    .Where(x => x.DeclaringType != typeof(QCAlgorithm))\n                    .Where(x => x.GetParameters().Length == 1)\n                    .FirstOrDefault(x => x.GetParameters()[0].ParameterType == typeof(Slice));\n\n                if (method == null)\n                {\n                    return;\n                }\n\n                var self = Expression.Constant(this);\n                var parameter = Expression.Parameter(typeof(Slice), \"data\");\n                var call = Expression.Call(self, method, parameter);\n                var lambda = Expression.Lambda<Action<Slice>>(call, parameter);\n                _onDataSlice = lambda.Compile();\n            }\n            // if we have it, then invoke it\n            if (_onDataSlice != null)\n            {\n                _onDataSlice(slice);\n            }\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a split event\n        /// </summary>\n        /// <param name=\"splits\">The current time slice splits</param>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnSplits(Splits splits)\n        {\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a dividend event\n        /// </summary>\n        /// <param name=\"dividends\">The current time slice dividends</param>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnDividends(Dividends dividends)\n        {\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a delistings event\n        /// </summary>\n        /// <param name=\"delistings\">The current time slice delistings</param>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnDelistings(Delistings delistings)\n        {\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a symbol changed event\n        /// </summary>\n        /// <param name=\"symbolsChanged\">The current time slice symbol changed events</param>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged)\n        {\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(Universes)]\n        public virtual void OnSecuritiesChanged(SecurityChanges changes)\n        {\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        [DocumentationAttribute(Modeling)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public virtual void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n        }\n\n        /// <summary>\n        /// Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue\n        /// </summary>\n        [DocumentationAttribute(Modeling)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public virtual void OnMarginCallWarning()\n        {\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>Method is called 10 minutes before closing to allow user to close out position.</remarks>\n        /// <remarks>Deprecated because different assets have different market close times,\n        /// and because Python does not support two methods with the same name</remarks>\n        [Obsolete(\"This method is deprecated and will be removed after August 2021. Please use this overload: OnEndOfDay(Symbol symbol)\")]\n        [DocumentationAttribute(HandlingData)]\n        [StubsIgnore]\n        public virtual void OnEndOfDay()\n        {\n\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>\n        /// This method is left for backwards compatibility and is invoked via <see cref=\"OnEndOfDay(Symbol)\"/>, if that method is\n        /// override then this method will not be called without a called to base.OnEndOfDay(string)\n        /// </remarks>\n        /// <param name=\"symbol\">Asset symbol for this end of day event. Forex and equities have different closing hours.</param>\n        [DocumentationAttribute(HandlingData)]\n        [StubsIgnore]\n        public virtual void OnEndOfDay(string symbol)\n        {\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <param name=\"symbol\">Asset symbol for this end of day event. Forex and equities have different closing hours.</param>\n        [DocumentationAttribute(HandlingData)]\n        [StubsAvoidImplicits]\n        public virtual void OnEndOfDay(Symbol symbol)\n        {\n            OnEndOfDay(symbol.ToString());\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        [DocumentationAttribute(HandlingData)]\n        public virtual void OnEndOfAlgorithm()\n        {\n\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        [DocumentationAttribute(TradingAndOrders)]\n        public virtual void OnOrderEvent(OrderEvent orderEvent)\n        {\n\n        }\n\n        /// <summary>\n        /// Option assignment event handler. On an option assignment event for short legs the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"assignmentEvent\">Option exercise event details containing details of the assignment</param>\n        /// <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>\n        [DocumentationAttribute(TradingAndOrders)]\n        public virtual void OnAssignmentOrderEvent(OrderEvent assignmentEvent)\n        {\n\n        }\n\n        /// <summary>\n        /// Brokerage message event handler. This method is called for all types of brokerage messages.\n        /// </summary>\n        /// <param name=\"messageEvent\">The brokerage message event instance containing the message details.</param>\n        [DocumentationAttribute(LiveTrading)]\n        [DocumentationAttribute(Modeling)]\n        [DocumentationAttribute(TradingAndOrders)]\n        public virtual void OnBrokerageMessage(BrokerageMessageEvent messageEvent)\n        {\n\n        }\n\n        /// <summary>\n        /// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n        /// </summary>\n        [DocumentationAttribute(LiveTrading)]\n        public virtual void OnBrokerageDisconnect()\n        {\n\n        }\n\n        /// <summary>\n        /// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n        /// </summary>\n        [DocumentationAttribute(LiveTrading)]\n        public virtual void OnBrokerageReconnect()\n        {\n\n        }\n\n        /// <summary>\n        /// Update the internal algorithm time frontier.\n        /// </summary>\n        /// <remarks>For internal use only to advance time.</remarks>\n        /// <param name=\"frontier\">Current utc datetime.</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetDateTime(DateTime frontier)\n        {\n            _timeKeeper.SetUtcDateTime(frontier);\n            if (_locked && IsWarmingUp && Time >= _start)\n            {\n                SetFinishedWarmingUp();\n            }\n        }\n\n        /// <summary>\n        /// Sets the time zone of the <see cref=\"Time\"/> property in the algorithm\n        /// </summary>\n        /// <param name=\"timeZone\">The desired time zone</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetTimeZone(string timeZone)\n        {\n            DateTimeZone tz;\n            try\n            {\n                tz = DateTimeZoneProviders.Tzdb[timeZone];\n            }\n            catch (DateTimeZoneNotFoundException)\n            {\n                throw new ArgumentException($\"TimeZone with id '{timeZone}' was not found. For a complete list of time zones please visit: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones\");\n            }\n\n            SetTimeZone(tz);\n        }\n\n        /// <summary>\n        /// Sets the time zone of the <see cref=\"Time\"/> property in the algorithm\n        /// </summary>\n        /// <param name=\"timeZone\">The desired time zone</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetTimeZone(DateTimeZone timeZone)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetTimeZone(): Cannot change time zone after algorithm running.\");\n            }\n\n            if (timeZone == null) throw new ArgumentNullException(nameof(timeZone));\n            _timeKeeper.AddTimeZone(timeZone);\n            _localTimeKeeper = _timeKeeper.GetLocalTimeKeeper(timeZone);\n\n            // the time rules need to know the default time zone as well\n            TimeRules.SetDefaultTimeZone(timeZone);\n            DateRules.SetDefaultTimeZone(timeZone);\n\n            // In BackTest mode we reset the Algorithm time to reflect the new timezone\n            // startDate is set by the user so we expect it to be for their timezone already\n            // so there is no need to update it.\n            if (!LiveMode)\n            {\n                _start = _startDate;\n                SetDateTime(_startDate.ConvertToUtc(TimeZone));\n            }\n            // In live mode we need to adjust startDate to reflect the new timezone\n            // startDate is set by Lean to the default timezone (New York), so we must update it here\n            else\n            {\n                SetLiveModeStartDate();\n            }\n        }\n\n        /// <summary>\n        /// Sets the brokerage to emulate in backtesting or paper trading.\n        /// This can be used for brokerages that have been implemented in LEAN\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage to emulate</param>\n        /// <param name=\"accountType\">The account type (Cash or Margin)</param>\n        [DocumentationAttribute(Modeling)]\n        public void SetBrokerageModel(BrokerageName brokerage, AccountType accountType = AccountType.Margin)\n        {\n            SetBrokerageModel(Brokerages.BrokerageModel.Create(Transactions, brokerage, accountType));\n        }\n\n        /// <summary>\n        /// Sets the brokerage to emulate in backtesting or paper trading.\n        /// This can be used to set a custom brokerage model.\n        /// </summary>\n        /// <param name=\"model\">The brokerage model to use</param>\n        [DocumentationAttribute(Modeling)]\n        public void SetBrokerageModel(IBrokerageModel model)\n        {\n            BrokerageModel = model;\n\n            if (!_userSetSecurityInitializer)\n            {\n                // purposefully use the direct setter vs Set method so we don't flip the switch :/\n                var brokerageSecurityInitializer = new BrokerageModelSecurityInitializer(model, SecuritySeeder.Null);\n\n                if (SecurityInitializer is CompositeSecurityInitializer compositeSecurityInitializer)\n                {\n                    Debug($\"Warning: SetBrokerageModel(): a custom security initializer has been added. Please call SetBrokerageModel() before calling AddSecurityInitializer().\");\n\n                    // Set the brokerage security initializer as the first initializer to ensure\n                    // it runs before any user defined initializers\n                    var initializers = compositeSecurityInitializer.Initializers;\n                    var index = initializers.FindIndex((model) => model is BrokerageModelSecurityInitializer);\n                    if (index != -1)\n                    {\n                        initializers[index] = brokerageSecurityInitializer;\n                        SecurityInitializer = new CompositeSecurityInitializer(initializers.ToArray());\n                    }\n                    else\n                    {\n                        SecurityInitializer = new CompositeSecurityInitializer([brokerageSecurityInitializer, .. initializers]);\n                    }\n                }\n                else\n                {\n                    SecurityInitializer = brokerageSecurityInitializer;\n                }\n\n                // update models on securities added earlier (before SetBrokerageModel is called)\n                foreach (var kvp in Securities)\n                {\n                    var security = kvp.Value;\n\n                    // save the existing leverage specified in AddSecurity,\n                    // if Leverage needs to be set in a SecurityInitializer,\n                    // SetSecurityInitializer must be called before SetBrokerageModel\n                    var leverage = security.Leverage;\n\n                    SecurityInitializer.Initialize(security);\n\n                    // restore the saved leverage\n                    security.SetLeverage(leverage);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the implementation used to handle messages from the brokerage.\n        /// The default implementation will forward messages to debug or error\n        /// and when a <see cref=\"BrokerageMessageType.Error\"/> occurs, the algorithm\n        /// is stopped.\n        /// </summary>\n        /// <param name=\"handler\">The message handler to use</param>\n        [DocumentationAttribute(Modeling)]\n        [DocumentationAttribute(Logging)]\n        public void SetBrokerageMessageHandler(IBrokerageMessageHandler handler)\n        {\n            BrokerageMessageHandler = handler ?? throw new ArgumentNullException(nameof(handler));\n        }\n\n        /// <summary>\n        /// Sets the risk free interest rate model to be used in the algorithm\n        /// </summary>\n        /// <param name=\"model\">The risk free interest rate model to use</param>\n        [DocumentationAttribute(Modeling)]\n        public void SetRiskFreeInterestRateModel(IRiskFreeInterestRateModel model)\n        {\n            RiskFreeInterestRateModel = model ?? throw new ArgumentNullException(nameof(model));\n        }\n\n        /// <summary>\n        /// Sets the benchmark used for computing statistics of the algorithm to the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">symbol to use as the benchmark</param>\n        /// <param name=\"securityType\">Is the symbol an equity, forex, base, etc. Default <see cref=\"SecurityType.Equity\"/></param>\n        /// <remarks>\n        /// Must use symbol that is available to the trade engine in your data store(not strictly enforced)\n        /// </remarks>\n        [Obsolete(\"Symbol implicit operator to string is provided for algorithm use only.\")]\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public void SetBenchmark(SecurityType securityType, string symbol)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetBenchmark(): Cannot change Benchmark after algorithm initialized.\");\n            }\n\n            var market = GetMarket(null, symbol, securityType, defaultMarket: Market.USA);\n\n            var benchmarkSymbol = QuantConnect.Symbol.Create(symbol, securityType, market);\n            SetBenchmark(benchmarkSymbol);\n        }\n\n        /// <summary>\n        /// Sets the benchmark used for computing statistics of the algorithm to the specified ticker, defaulting to <see cref=\"SecurityType.Equity\"/>\n        /// if the ticker doesn't exist in the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">Ticker to use as the benchmark</param>\n        /// <remarks>\n        /// Overload to accept ticker without passing <see cref=\"SecurityType\"/>. If ticker is in portfolio it will use that <see cref=\"SecurityType\"/>, otherwise will default to <see cref=\"SecurityType.Equity\"/>\n        /// </remarks>\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public void SetBenchmark(string ticker)\n        {\n            Symbol symbol;\n\n            // Check the cache for the symbol\n            if (!SymbolCache.TryGetSymbol(ticker, out symbol))\n            {\n                // Check our securities for a symbol matched with this ticker\n                symbol = Securities.FirstOrDefault(x => x.Key.Value == ticker).Key;\n\n                // If we didn't find a symbol matching our ticker, create one.\n                if (symbol == null)\n                {\n                    Debug($\"Warning: SetBenchmark({ticker}): no existing symbol found, benchmark security will be added with {SecurityType.Equity} type.\");\n                    symbol = QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n                }\n            }\n\n            // Send our symbol through\n            SetBenchmark(symbol);\n        }\n\n        /// <summary>\n        /// Sets the benchmark used for computing statistics of the algorithm to the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">symbol to use as the benchmark</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public void SetBenchmark(Symbol symbol)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetBenchmark(): Cannot change Benchmark after algorithm initialized.\");\n            }\n\n            // Create our security benchmark\n            Benchmark = SecurityBenchmark.CreateInstance(Securities, symbol);\n        }\n\n        /// <summary>\n        /// Sets the specified function as the benchmark, this function provides the value of\n        /// the benchmark at each date/time requested\n        /// </summary>\n        /// <param name=\"benchmark\">The benchmark producing function</param>\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public void SetBenchmark(Func<DateTime, decimal> benchmark)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetBenchmark(): Cannot change Benchmark after algorithm initialized.\");\n            }\n\n            Benchmark = new FuncBenchmark(benchmark);\n        }\n\n        /// <summary>\n        /// The <see cref=\"IBenchmark\"/> for the algorithm\n        /// </summary>\n        /// <remarks>Use <see cref=\"IBenchmark\"/> for the algorithm to override default symbol based benchmark, and create your own benchmark. For example a custom moving average benchmark </remarks>\n        ///\n        [DocumentationAttribute(TradingAndOrders)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        [DocumentationAttribute(Indicators)]\n        public IBenchmark Benchmark\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Sets name to the currently running backtest\n        /// </summary>\n        /// <param name=\"name\">The name for the backtest</param>\n        public void SetName(string name)\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        /// Adds a tag to the algorithm\n        /// </summary>\n        /// <param name=\"tag\">The tag to add</param>\n        public void AddTag(string tag)\n        {\n            if (!string.IsNullOrEmpty(tag?.Trim()))\n            {\n                if (Tags.Count >= MaxTagsCount)\n                {\n                    if (!_tagsLimitReachedLogSent)\n                    {\n                        Log($\"Warning: AddTag({tag}): Unable to add tag. Tags are limited to a maximum of {MaxTagsCount}.\");\n                        _tagsLimitReachedLogSent = true;\n                    }\n                    return;\n                }\n\n                // We'll only notify the tad update after the algorithm has been initialized\n                if (Tags.Add(tag.Truncate(MaxNameAndTagsLength)) && _locked)\n                {\n                    TagsUpdated?.Invoke(this, Tags);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the tags for the algorithm\n        /// </summary>\n        /// <param name=\"tags\">The tags</param>\n        public void SetTags(HashSet<string> tags)\n        {\n            Tags = tags;\n        }\n\n        /// <summary>\n        /// Sets the account currency cash symbol this algorithm is to manage, as well as\n        /// the starting cash in this currency if given\n        /// </summary>\n        /// <remarks>Has to be called during <see cref=\"Initialize\"/> before\n        /// calling <see cref=\"SetCash(decimal)\"/> or adding any <see cref=\"Security\"/></remarks>\n        /// <param name=\"accountCurrency\">The account currency cash symbol to set</param>\n        /// <param name=\"startingCash\">The account currency starting cash to set</param>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public void SetAccountCurrency(string accountCurrency, decimal? startingCash = null)\n        {\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetAccountCurrency(): \" +\n                    \"Cannot change AccountCurrency after algorithm initialized.\");\n            }\n\n            if (startingCash == null)\n            {\n                Debug($\"Changing account currency from {AccountCurrency} to {accountCurrency}...\");\n            }\n            else\n            {\n                Debug($\"Changing account currency from {AccountCurrency} to {accountCurrency}, with a starting cash of {startingCash}...\");\n            }\n\n            Portfolio.SetAccountCurrency(accountCurrency, startingCash);\n        }\n\n        /// <summary>\n        /// Set initial cash for the strategy while backtesting. During live mode this value is ignored\n        /// and replaced with the actual cash of your brokerage account.\n        /// </summary>\n        /// <param name=\"startingCash\">Starting cash for the strategy backtest</param>\n        /// <remarks>Alias of <see cref=\"SetCash(decimal)\"/></remarks>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public void SetCash(double startingCash)\n        {\n            SetCash((decimal)startingCash);\n        }\n\n        /// <summary>\n        /// Set initial cash for the strategy while backtesting. During live mode this value is ignored\n        /// and replaced with the actual cash of your brokerage account.\n        /// </summary>\n        /// <param name=\"startingCash\">Starting cash for the strategy backtest</param>\n        /// <remarks>Alias of <see cref=\"SetCash(decimal)\"/></remarks>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public void SetCash(int startingCash)\n        {\n            SetCash((decimal)startingCash);\n        }\n\n        /// <summary>\n        /// Set initial cash for the strategy while backtesting. During live mode this value is ignored\n        /// and replaced with the actual cash of your brokerage account.\n        /// </summary>\n        /// <param name=\"startingCash\">Starting cash for the strategy backtest</param>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public void SetCash(decimal startingCash)\n        {\n            if (!_locked)\n            {\n                Portfolio.SetCash(startingCash);\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Algorithm.SetCash(): Cannot change cash available after algorithm initialized.\");\n            }\n        }\n\n        /// <summary>\n        /// Set the cash for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The cash symbol to set</param>\n        /// <param name=\"startingCash\">Decimal cash value of portfolio</param>\n        /// <param name=\"conversionRate\">The current conversion rate for the</param>\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public void SetCash(string symbol, decimal startingCash, decimal conversionRate = 0)\n        {\n            if (!_locked)\n            {\n                Portfolio.SetCash(symbol, startingCash, conversionRate);\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Algorithm.SetCash(): Cannot change cash available after algorithm initialized.\");\n            }\n        }\n\n        /// <summary>\n        /// Set the start date for backtest.\n        /// </summary>\n        /// <param name=\"day\">Int starting date 1-30</param>\n        /// <param name=\"month\">Int month starting date</param>\n        /// <param name=\"year\">Int year starting date</param>\n        /// <remarks>Wrapper for SetStartDate(DateTime).\n        /// Must be less than end date.\n        /// Ignored in live trading mode.</remarks>\n        /// <seealso cref=\"SetStartDate(DateTime)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public void SetStartDate(int year, int month, int day)\n        {\n            try\n            {\n                var start = new DateTime(year, month, day);\n\n                // We really just want the date of the start, so it's 12am of the requested day (first moment of the day)\n                start = start.Date;\n\n                SetStartDate(start);\n            }\n            catch (Exception err)\n            {\n                throw new ArgumentException($\"Date Invalid: {err.Message}\");\n            }\n        }\n\n        /// <summary>\n        /// Set the end date for a backtest run\n        /// </summary>\n        /// <param name=\"day\">Int end date 1-30</param>\n        /// <param name=\"month\">Int month end date</param>\n        /// <param name=\"year\">Int year end date</param>\n        /// <remarks>Wrapper for SetEndDate(datetime).</remarks>\n        /// <seealso cref=\"SetEndDate(DateTime)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public void SetEndDate(int year, int month, int day)\n        {\n            try\n            {\n                var end = new DateTime(year, month, day);\n\n                // we want the end date to be just before the next day (last moment of the day)\n                end = end.Date.AddDays(1).Subtract(TimeSpan.FromTicks(1));\n\n                SetEndDate(end);\n            }\n            catch (Exception err)\n            {\n                throw new ArgumentException($\"Date Invalid: {err.Message}\");\n            }\n        }\n\n        /// <summary>\n        /// Set the algorithm id (backtestId or live deployId for the algorithm).\n        /// </summary>\n        /// <param name=\"algorithmId\">String Algorithm Id</param>\n        /// <remarks>Intended for internal QC Lean Engine use only as a setter for AlgorithmId</remarks>\n        [DocumentationAttribute(HandlingData)]\n        public void SetAlgorithmId(string algorithmId)\n        {\n            _algorithmId = algorithmId;\n        }\n\n        /// <summary>\n        /// Set the start date for the backtest\n        /// </summary>\n        /// <param name=\"start\">The start date for the backtest</param>\n        /// <remarks>Must be less than end date and within data available</remarks>\n        /// <seealso cref=\"SetStartDate(int, int, int)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public void SetStartDate(DateTime start)\n        {\n            // no need to set this value in live mode, will be set using the current time.\n            if (_liveMode) return;\n\n            //Round down\n            start = start.RoundDown(TimeSpan.FromDays(1));\n\n            //Validate the start date:\n            //1. Check range;\n            if (start < (new DateTime(1900, 01, 01)))\n            {\n                throw new ArgumentOutOfRangeException(nameof(start), \"Please select a start date after January 1st, 1900.\");\n            }\n\n            //2. Check future date\n            var todayInAlgorithmTimeZone = DateTime.UtcNow.ConvertFromUtc(TimeZone).Date;\n            if (start > todayInAlgorithmTimeZone)\n            {\n                throw new ArgumentOutOfRangeException(nameof(start), \"Please select start date less than today\");\n            }\n\n            //3. Check not locked already:\n            if (!_locked)\n            {\n                _start = _startDate = start;\n                SetDateTime(_startDate.ConvertToUtc(TimeZone));\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Algorithm.SetStartDate(): Cannot change start date after algorithm initialized.\");\n            }\n        }\n\n        /// <summary>\n        /// Set the end date for a backtest.\n        /// </summary>\n        /// <param name=\"end\">Datetime value for end date</param>\n        /// <remarks>Must be greater than the start date</remarks>\n        /// <seealso cref=\"SetEndDate(int, int, int)\"/>\n        [DocumentationAttribute(HandlingData)]\n        public void SetEndDate(DateTime end)\n        {\n            // no need to set this value in live mode, will be set using the current time.\n            if (_liveMode) return;\n\n            //1. Check not locked already:\n            if (_locked)\n            {\n                throw new InvalidOperationException(\"Algorithm.SetEndDate(): Cannot change end date after algorithm initialized.\");\n            }\n\n            //Validate:\n            //2. Check Range:\n            var yesterdayInAlgorithmTimeZone = DateTime.UtcNow.ConvertFromUtc(TimeZone).Date.AddDays(-1);\n            if (end > yesterdayInAlgorithmTimeZone)\n            {\n                end = yesterdayInAlgorithmTimeZone;\n            }\n\n            //3. Make this at the very end of the requested date\n            _endDate = end.RoundDown(TimeSpan.FromDays(1)).AddDays(1).AddTicks(-1);\n        }\n\n        /// <summary>\n        /// Lock the algorithm initialization to avoid user modifiying cash and data stream subscriptions\n        /// </summary>\n        /// <remarks>Intended for Internal QC Lean Engine use only to prevent accidental manipulation of important properties</remarks>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public void SetLocked()\n        {\n            _locked = true;\n\n            // The algorithm is initialized, we can now send the initial name and tags updates\n            NameUpdated?.Invoke(this, Name);\n            TagsUpdated?.Invoke(this, Tags);\n        }\n\n        /// <summary>\n        /// Gets whether or not this algorithm has been locked and fully initialized\n        /// </summary>\n        [DocumentationAttribute(AlgorithmFramework)]\n        public bool GetLocked()\n        {\n            return _locked;\n        }\n\n        /// <summary>\n        /// Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode.\n        /// </summary>\n        [DocumentationAttribute(LiveTrading)]\n        public void SetLiveMode(bool live)\n        {\n            if (!_locked)\n            {\n                _liveMode = live;\n                Notify = new NotificationManager(live);\n                TradeBuilder.SetLiveMode(live);\n                Securities.SetLiveMode(live);\n                Transactions.SetLiveMode(live);\n                if (live)\n                {\n                    SetLiveModeStartDate();\n                    _algorithmMode = AlgorithmMode.Live;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the algorithm running mode\n        /// </summary>\n        /// <param name=\"algorithmMode\">Algorithm mode</param>\n        public void SetAlgorithmMode(AlgorithmMode algorithmMode)\n        {\n            if (!_locked)\n            {\n                _algorithmMode = algorithmMode;\n                SetLiveMode(_algorithmMode == AlgorithmMode.Live);\n            }\n        }\n\n        /// <summary>\n        /// Sets the algorithm deployment target\n        /// </summary>\n        /// <param name=\"deploymentTarget\">Deployment target</param>\n        public void SetDeploymentTarget(DeploymentTarget deploymentTarget)\n        {\n            if (!_locked)\n            {\n                _deploymentTarget = deploymentTarget;\n            }\n        }\n\n        /// <summary>\n        /// Set the <see cref=\"ITradeBuilder\"/> implementation to generate trades from executions and market price updates\n        /// </summary>\n        [DocumentationAttribute(TradingAndOrders)]\n        public void SetTradeBuilder(ITradeBuilder tradeBuilder)\n        {\n            TradeBuilder = tradeBuilder;\n            TradeBuilder.SetLiveMode(LiveMode);\n            TradeBuilder.SetSecurityManager(Securities);\n        }\n\n        /// <summary>\n        /// Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.\n        /// </summary>\n        /// <param name=\"securityType\">MarketType Type: Equity, Commodity, Future, FOREX or Crypto</param>\n        /// <param name=\"ticker\">The security ticker</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        [DocumentationAttribute(AddingData)]\n        public Security AddSecurity(SecurityType securityType, string ticker, Resolution? resolution = null, bool? fillForward = null, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null)\n        {\n            return AddSecurity(securityType, ticker, resolution, fillForward, Security.NullLeverage, extendedMarketHours, dataMappingMode, dataNormalizationMode);\n        }\n\n        /// <summary>\n        /// Add specified data to required list. QC will funnel this data to the handle data routine.\n        /// </summary>\n        /// <param name=\"securityType\">MarketType Type: Equity, Commodity, Future, FOREX or Crypto</param>\n        /// <param name=\"ticker\">The security ticker</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        /// <remarks> AddSecurity(SecurityType securityType, Symbol symbol, Resolution resolution, bool fillForward, decimal leverage, bool extendedMarketHours)</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddSecurity(SecurityType securityType, string ticker, Resolution? resolution, bool? fillForward, decimal leverage, bool? extendedMarketHours,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null)\n        {\n            return AddSecurity(securityType, ticker, resolution, null, fillForward, leverage, extendedMarketHours, dataMappingMode, dataNormalizationMode);\n        }\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"securityType\">MarketType Type: Equity, Commodity, Future, FOREX or Crypto</param>\n        /// <param name=\"ticker\">The security ticker, e.g. AAPL</param>\n        /// <param name=\"resolution\">Resolution of the MarketType required: MarketData, Second or Minute</param>\n        /// <param name=\"market\">The market the requested security belongs to, such as 'usa' or 'fxcm'</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        [DocumentationAttribute(AddingData)]\n        public Security AddSecurity(SecurityType securityType, string ticker, Resolution? resolution, string market, bool? fillForward, decimal leverage, bool? extendedMarketHours,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null)\n        {\n            // if AddSecurity method is called to add an option or a future, we delegate a call to respective methods\n            if (securityType == SecurityType.Option)\n            {\n                return AddOption(ticker, resolution, market, fillForward, leverage);\n            }\n\n            if (securityType == SecurityType.Future)\n            {\n                return AddFuture(ticker, resolution, market, fillForward, leverage, extendedMarketHours, dataMappingMode, dataNormalizationMode);\n            }\n\n            try\n            {\n                market = GetMarket(market, ticker, securityType);\n\n                Symbol symbol;\n                if (!SymbolCache.TryGetSymbol(ticker, out symbol) ||\n                    symbol.ID.Market != market ||\n                    symbol.SecurityType != securityType)\n                {\n                    symbol = QuantConnect.Symbol.Create(ticker, securityType, market);\n                }\n\n                return AddSecurity(symbol, resolution, fillForward, leverage, extendedMarketHours, dataMappingMode, dataNormalizationMode);\n            }\n            catch (Exception err)\n            {\n                Error(\"Algorithm.AddSecurity(): \" + err);\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The security Symbol</param>\n        /// <param name=\"resolution\">Resolution of the MarketType required: MarketData, Second or Minute</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <returns>The new Security that was added to the algorithm</returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddSecurity(Symbol symbol, Resolution? resolution = null, bool? fillForward = null, decimal leverage = Security.NullLeverage, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int contractDepthOffset = 0)\n        {\n            // allow users to specify negative numbers, we get the abs of it\n            var contractOffset = (uint)Math.Abs(contractDepthOffset);\n            if (contractOffset > Futures.MaximumContractDepthOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(contractDepthOffset), $\"'contractDepthOffset' current maximum value is {Futures.MaximumContractDepthOffset}.\" +\n                    $\" Front month (0) and only {Futures.MaximumContractDepthOffset} back month contracts are currently supported.\");\n            }\n\n            var isCanonical = symbol.IsCanonical();\n            var securityFillForward = fillForward ??= UniverseSettings.FillForward;\n            extendedMarketHours ??= UniverseSettings.ExtendedMarketHours;\n\n            // Short-circuit to AddOptionContract because it will add the underlying if required\n            if (!isCanonical && symbol.SecurityType.IsOption())\n            {\n                return AddOptionContract(symbol, resolution, securityFillForward, leverage, extendedMarketHours.Value);\n            }\n\n            var securityResolution = resolution;\n            if (isCanonical)\n            {\n                // canonical options and futures are daily only\n                securityResolution = Resolution.Daily;\n                securityFillForward = false;\n            }\n\n            var isFilteredSubscription = !isCanonical;\n            List<SubscriptionDataConfig> configs;\n            // we pass dataNormalizationMode to SubscriptionManager.SubscriptionDataConfigService.Add conditionally,\n            // so the default value for its argument is used when the it is null here.\n            if (dataNormalizationMode.HasValue)\n            {\n                configs = SubscriptionManager.SubscriptionDataConfigService.Add(symbol,\n                    securityResolution,\n                    securityFillForward,\n                    extendedMarketHours.Value,\n                    isFilteredSubscription,\n                    dataNormalizationMode: dataNormalizationMode.Value,\n                    contractDepthOffset: (uint)contractDepthOffset);\n            }\n            else\n            {\n                configs = SubscriptionManager.SubscriptionDataConfigService.Add(symbol,\n                   securityResolution,\n                   securityFillForward,\n                   extendedMarketHours.Value,\n                   isFilteredSubscription,\n                   contractDepthOffset: (uint)contractDepthOffset);\n            }\n\n            var security = Securities.CreateSecurity(symbol, configs, leverage);\n\n            if (isCanonical)\n            {\n                security.IsTradable = false;\n                Securities.Add(security);\n\n                // add this security to the user defined universe\n                Universe universe;\n                if (!UniverseManager.ContainsKey(symbol))\n                {\n                    var canonicalConfig = configs.First();\n                    var universeSettingsResolution = resolution ?? UniverseSettings.Resolution;\n                    var settings = new UniverseSettings(universeSettingsResolution, leverage, fillForward.Value, extendedMarketHours.Value, UniverseSettings.MinimumTimeInUniverse)\n                    {\n                        Asynchronous = UniverseSettings.Asynchronous\n                    };\n\n                    if (symbol.SecurityType.IsOption())\n                    {\n                        universe = new OptionChainUniverse((Option)security, settings);\n                    }\n                    else\n                    {\n                        // add the expected configurations of the canonical symbol right away, will allow it to warmup and indicators register to them\n                        var dataTypes = SubscriptionManager.LookupSubscriptionConfigDataTypes(SecurityType.Future,\n                            GetResolution(symbol, resolution, null), isCanonical: false);\n                        var continuousUniverseSettings = new UniverseSettings(settings)\n                        {\n                            ExtendedMarketHours = extendedMarketHours.Value,\n                            FillForward = fillForward.Value,\n                            DataMappingMode = dataMappingMode ?? UniverseSettings.GetUniverseMappingModeOrDefault(symbol.SecurityType, symbol.ID.Market),\n                            DataNormalizationMode = dataNormalizationMode ?? UniverseSettings.GetUniverseNormalizationModeOrDefault(symbol.SecurityType),\n                            ContractDepthOffset = (int)contractOffset,\n                            SubscriptionDataTypes = dataTypes,\n                            Asynchronous = UniverseSettings.Asynchronous\n                        };\n                        ContinuousContractUniverse.AddConfigurations(SubscriptionManager.SubscriptionDataConfigService, continuousUniverseSettings, security.Symbol);\n\n                        // let's add a MHDB entry for the continuous symbol using the associated security\n                        var continuousContractSymbol = ContinuousContractUniverse.CreateSymbol(security.Symbol);\n                        MarketHoursDatabase.SetEntry(continuousContractSymbol.ID.Market,\n                            continuousContractSymbol.ID.Symbol,\n                            continuousContractSymbol.ID.SecurityType,\n                            security.Exchange.Hours);\n                        AddUniverse(new ContinuousContractUniverse(security, continuousUniverseSettings, LiveMode,\n                            new SubscriptionDataConfig(canonicalConfig, symbol: continuousContractSymbol,\n                                // We can use any data type here, since we are not going to use the data.\n                                // We just don't want to use the FutureUniverse type because it will force disable extended market hours\n                                objectType: typeof(Tick), extendedHours: extendedMarketHours)));\n\n                        universe = new FuturesChainUniverse((Future)security, settings);\n                    }\n\n                    AddUniverse(universe);\n                }\n                return security;\n            }\n\n            return AddToUserDefinedUniverse(security, configs);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Equity\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The equity ticker symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The equity's market, <seealso cref=\"Market\"/>. Default value is null and looked up using BrokerageModel.DefaultMarkets in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">True to send data during pre and post market sessions. Default is <value>false</value></param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the equity</param>\n        /// <returns>The new <see cref=\"Equity\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Equity AddEquity(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true,\n            decimal leverage = Security.NullLeverage, bool extendedMarketHours = false, DataNormalizationMode? dataNormalizationMode = null)\n        {\n            return AddSecurity<Equity>(SecurityType.Equity, ticker, resolution, market, fillForward, leverage, extendedMarketHours, normalizationMode: dataNormalizationMode);\n        }\n\n        /// <summary>\n        /// Creates and adds a new equity <see cref=\"Option\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"underlying\">The underlying equity ticker</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The equity's market, <seealso cref=\"Market\"/>. Default is value null and looked up using BrokerageModel.DefaultMarkets in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <returns>The new <see cref=\"Option\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Option AddOption(string underlying, Resolution? resolution = null, string market = null, bool? fillForward = null, decimal leverage = Security.NullLeverage)\n        {\n            market = GetMarket(market, underlying, SecurityType.Option);\n\n            var underlyingSymbol = QuantConnect.Symbol.Create(underlying, SecurityType.Equity, market);\n            return AddOption(underlyingSymbol, resolution, market, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Option\"/> security to the algorithm.\n        /// This method can be used to add options with non-equity asset classes\n        /// to the algorithm (e.g. Future Options).\n        /// </summary>\n        /// <param name=\"underlying\">Underlying asset Symbol to use as the option's underlying</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The option's market, <seealso cref=\"Market\"/>. Default value is null, but will be resolved using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, data will be provided to the algorithm every Second, Minute, Hour, or Day, while the asset is open and depending on the Resolution this option was configured to use.</param>\n        /// <param name=\"leverage\">The requested leverage for the </param>\n        /// <returns>The new option security instance</returns>\n        /// <exception cref=\"KeyNotFoundException\"></exception>\n        [DocumentationAttribute(AddingData)]\n        public Option AddOption(Symbol underlying, Resolution? resolution = null, string market = null, bool? fillForward = null, decimal leverage = Security.NullLeverage)\n        {\n            return AddOption(underlying, null, resolution, market, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Option\"/> security to the algorithm.\n        /// This method can be used to add options with non-equity asset classes\n        /// to the algorithm (e.g. Future Options).\n        /// </summary>\n        /// <param name=\"underlying\">Underlying asset Symbol to use as the option's underlying</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The option's market, <seealso cref=\"Market\"/>. Default value is null, but will be resolved using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, data will be provided to the algorithm every Second, Minute, Hour, or Day, while the asset is open and depending on the Resolution this option was configured to use.</param>\n        /// <param name=\"leverage\">The requested leverage for the </param>\n        /// <returns>The new option security instance</returns>\n        /// <exception cref=\"KeyNotFoundException\"></exception>\n        [DocumentationAttribute(AddingData)]\n        public Option AddOption(Symbol underlying, string targetOption, Resolution? resolution = null,\n            string market = null, bool? fillForward = null, decimal leverage = Security.NullLeverage)\n        {\n            var optionType = QuantConnect.Symbol.GetOptionTypeFromUnderlying(underlying);\n\n            market = GetMarket(market, targetOption, optionType);\n\n            Symbol canonicalSymbol;\n\n            string alias;\n            if (!string.IsNullOrEmpty(targetOption))\n            {\n                alias = $\"?{targetOption}\";\n            }\n            else\n            {\n                alias = $\"?{underlying.Value}\";\n            }\n            if (!SymbolCache.TryGetSymbol(alias, out canonicalSymbol) ||\n                canonicalSymbol.ID.Market != market ||\n                !canonicalSymbol.SecurityType.IsOption())\n            {\n                canonicalSymbol = QuantConnect.Symbol.CreateCanonicalOption(underlying, targetOption, market, alias);\n            }\n\n            return (Option)AddSecurity(canonicalSymbol, resolution, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Future\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The future ticker</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The futures market, <seealso cref=\"Market\"/>. Default is value null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this future. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the continuous future contract</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the continuous future contract</param>\n        /// <param name=\"contractDepthOffset\">The continuous future contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <returns>The new <see cref=\"Future\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Future AddFuture(string ticker, Resolution? resolution = null, string market = null,\n            bool? fillForward = null, decimal leverage = Security.NullLeverage, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int contractDepthOffset = 0)\n        {\n            market = GetMarket(market, ticker, SecurityType.Future);\n\n            Symbol canonicalSymbol;\n            var alias = \"/\" + ticker;\n            if (!SymbolCache.TryGetSymbol(alias, out canonicalSymbol) ||\n                canonicalSymbol.ID.Market != market ||\n                canonicalSymbol.SecurityType != SecurityType.Future)\n            {\n                canonicalSymbol = QuantConnect.Symbol.Create(ticker, SecurityType.Future, market, alias);\n            }\n\n            return (Future)AddSecurity(canonicalSymbol, resolution, fillForward, leverage, extendedMarketHours, dataMappingMode: dataMappingMode,\n                dataNormalizationMode: dataNormalizationMode, contractDepthOffset: contractDepthOffset);\n        }\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Future\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The futures contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this future. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <returns>The new <see cref=\"Future\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Future AddFutureContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true,\n            decimal leverage = Security.NullLeverage, bool extendedMarketHours = false)\n        {\n            return (Future)AddSecurity(symbol, resolution, fillForward, leverage, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Creates and adds a new Future Option contract to the algorithm.\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Future\"/> canonical symbol (i.e. Symbol returned from <see cref=\"AddFuture\"/>)</param>\n        /// <param name=\"optionFilter\">Filter to apply to option contracts loaded as part of the universe</param>\n        /// <returns>The new <see cref=\"Option\"/> security, containing a <see cref=\"Future\"/> as its underlying.</returns>\n        /// <exception cref=\"ArgumentException\">The symbol provided is not canonical.</exception>\n        [DocumentationAttribute(AddingData)]\n        public void AddFutureOption(Symbol symbol, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter = null)\n        {\n            if (!symbol.IsCanonical())\n            {\n                throw new ArgumentException(\"Symbol provided must be canonical (i.e. the Symbol returned from AddFuture(), not AddFutureContract().\");\n            }\n\n            AddUniverseOptions(symbol, optionFilter);\n\n            // Also add universe options for ContinuousContractUniverse to handle continuous futures\n            var continuousUniverseSymbol = ContinuousContractUniverse.CreateSymbol(symbol);\n            if (UniverseManager.ContainsKey(continuousUniverseSymbol))\n            {\n                AddUniverseOptions(continuousUniverseSymbol, optionFilter);\n            }\n        }\n\n        /// <summary>\n        /// Adds a future option contract to the algorithm.\n        /// </summary>\n        /// <param name=\"symbol\">Option contract Symbol</param>\n        /// <param name=\"resolution\">Resolution of the option contract, i.e. the granularity of the data</param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <param name=\"leverage\">The leverage to apply to the option contract</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <returns>Option security</returns>\n        /// <exception cref=\"ArgumentException\">Symbol is canonical (i.e. a generic Symbol returned from <see cref=\"AddFuture\"/> or <see cref=\"AddOption(string, Resolution?, string, bool?, decimal)\"/>)</exception>\n        [DocumentationAttribute(AddingData)]\n        public Option AddFutureOptionContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true,\n            decimal leverage = Security.NullLeverage, bool extendedMarketHours = false)\n        {\n            if (symbol.IsCanonical())\n            {\n                throw new ArgumentException(\"Expected non-canonical Symbol (i.e. a Symbol representing a specific Future contract\");\n            }\n\n            return AddOptionContract(symbol, resolution, fillForward, leverage, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Creates and adds index options to the algorithm.\n        /// </summary>\n        /// <param name=\"underlying\">The underlying ticker of the <see cref=\"IndexOption\"/></param>\n        /// <param name=\"resolution\">Resolution of the index option contracts, i.e. the granularity of the data</param>\n        /// <param name=\"market\">The foreign exchange trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <returns>Canonical Option security</returns>\n        [DocumentationAttribute(AddingData)]\n\n        public IndexOption AddIndexOption(string underlying, Resolution? resolution = null, string market = null, bool fillForward = true)\n        {\n            return AddIndexOption(underlying, null, resolution, market, fillForward);\n        }\n\n        /// <summary>\n        /// Creates and adds index options to the algorithm.\n        /// </summary>\n        /// <param name=\"symbol\">The Symbol of the <see cref=\"Security\"/> returned from <see cref=\"AddIndex\"/></param>\n        /// <param name=\"resolution\">Resolution of the index option contracts, i.e. the granularity of the data</param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <returns>Canonical Option security</returns>\n        [DocumentationAttribute(AddingData)]\n        public IndexOption AddIndexOption(Symbol symbol, Resolution? resolution = null, bool fillForward = true)\n        {\n            return AddIndexOption(symbol, null, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Creates and adds index options to the algorithm.\n        /// </summary>\n        /// <param name=\"symbol\">The Symbol of the <see cref=\"Security\"/> returned from <see cref=\"AddIndex\"/></param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"resolution\">Resolution of the index option contracts, i.e. the granularity of the data</param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <returns>Canonical Option security</returns>\n        [DocumentationAttribute(AddingData)]\n        public IndexOption AddIndexOption(Symbol symbol, string targetOption, Resolution? resolution = null, bool fillForward = true)\n        {\n            if (symbol.SecurityType != SecurityType.Index)\n            {\n                throw new ArgumentException(\"Symbol provided must be of type SecurityType.Index\");\n            }\n\n            return (IndexOption)AddOption(symbol, targetOption, resolution, symbol.ID.Market, fillForward);\n        }\n\n        /// <summary>\n        /// Creates and adds index options to the algorithm.\n        /// </summary>\n        /// <param name=\"underlying\">The underlying ticker of the Index Option</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"resolution\">Resolution of the index option contracts, i.e. the granularity of the data</param>\n        /// <param name=\"market\">The foreign exchange trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <returns>Canonical Option security</returns>\n        [DocumentationAttribute(AddingData)]\n        public IndexOption AddIndexOption(string underlying, string targetOption, Resolution? resolution = null, string market = null, bool fillForward = true)\n        {\n            return AddIndexOption(\n                QuantConnect.Symbol.Create(underlying, SecurityType.Index, GetMarket(market, underlying, SecurityType.Index)),\n                targetOption, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Adds an index option contract to the algorithm.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the index option contract</param>\n        /// <param name=\"resolution\">Resolution of the index option contract, i.e. the granularity of the data</param>\n        /// <param name=\"fillForward\">If true, this will fill in missing data points with the previous data point</param>\n        /// <returns>Index Option Contract</returns>\n        /// <exception cref=\"ArgumentException\">The provided Symbol is not an <see cref=\"IndexOption\"/></exception>\n        [DocumentationAttribute(AddingData)]\n        public IndexOption AddIndexOptionContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true)\n        {\n            if (symbol.SecurityType != SecurityType.IndexOption || symbol.IsCanonical())\n            {\n                throw new ArgumentException(\"Symbol provided must be non-canonical and of type SecurityType.IndexOption\");\n            }\n\n            return (IndexOption)AddOptionContract(symbol, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Option\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this option. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <returns>The new <see cref=\"Option\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Option AddOptionContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true,\n            decimal leverage = Security.NullLeverage, bool extendedMarketHours = false)\n        {\n            if (symbol == null || !symbol.SecurityType.IsOption() || symbol.Underlying == null)\n            {\n                throw new ArgumentException($\"Unexpected option symbol {symbol}. \" +\n                    $\"Please provide a valid option contract with it's underlying symbol set.\");\n            }\n\n            // add underlying if not present\n            var underlying = symbol.Underlying;\n            Security underlyingSecurity;\n            List<SubscriptionDataConfig> underlyingConfigs;\n            if (!Securities.TryGetValue(underlying, out underlyingSecurity) ||\n                // The underlying might have been removed, let's see if there's already a subscription for it\n                (!underlyingSecurity.IsTradable && SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(underlying).Count == 0))\n            {\n                underlyingSecurity = AddSecurity(underlying, resolution, fillForward, leverage, extendedMarketHours);\n                underlyingConfigs = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(underlying);\n            }\n            else if (underlyingSecurity != null && underlyingSecurity.IsDelisted)\n            {\n                throw new ArgumentException($\"The underlying {underlying.SecurityType} asset ({underlying.Value}) is delisted \" +\n                    $\"(current time is {Time})\");\n            }\n            else\n            {\n                underlyingConfigs = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(underlying);\n\n                if (symbol.SecurityType == SecurityType.Option)\n                {\n                    var dataNormalizationMode = underlyingConfigs.DataNormalizationMode();\n                    if (dataNormalizationMode != DataNormalizationMode.Raw && _locked)\n                    {\n                        // We check the \"locked\" flag here because during initialization we need to load existing open orders and holdings from brokerages.\n                        // There is no data streaming yet, so it is safe to change the data normalization mode to Raw.\n                        throw new ArgumentException($\"The underlying {underlying.SecurityType} asset ({underlying.Value}) is set to \" +\n                            $\"{dataNormalizationMode}, please change this to DataNormalizationMode.Raw with the \" +\n                            \"SetDataNormalization() method\"\n                        );\n                    }\n                }\n            }\n\n            var configs = SubscriptionManager.SubscriptionDataConfigService.Add(symbol, resolution, fillForward, extendedMarketHours,\n                dataNormalizationMode: DataNormalizationMode.Raw);\n            var option = (Option)Securities.CreateSecurity(symbol, configs, leverage, underlying: underlyingSecurity);\n\n            underlyingConfigs.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            // For backward compatibility we need to refresh the security DataNormalizationMode Property\n            underlyingSecurity.RefreshDataNormalizationModeProperty();\n\n            Securities.Add(option);\n\n            // get or create the universe\n            var universeSymbol = OptionContractUniverse.CreateSymbol(symbol.ID.Market, symbol.Underlying.SecurityType);\n            Universe universe;\n            if (!UniverseManager.TryGetValue(universeSymbol, out universe))\n            {\n                var settings = new UniverseSettings(UniverseSettings)\n                {\n                    DataNormalizationMode = DataNormalizationMode.Raw,\n                    Resolution = underlyingConfigs.GetHighestResolution(),\n                    ExtendedMarketHours = extendedMarketHours\n                };\n                universe = AddUniverse(new OptionContractUniverse(new SubscriptionDataConfig(configs.First(),\n                    // We can use any data type here, since we are not going to use the data.\n                    // We just don't want to use the OptionUniverse type because it will force disable extended market hours\n                    symbol: universeSymbol, objectType: typeof(Tick), extendedHours: extendedMarketHours), settings));\n            }\n\n            // update the universe\n            var optionUniverse = universe as OptionContractUniverse;\n            if (optionUniverse != null)\n            {\n                lock (_pendingUniverseAdditionsLock)\n                {\n                    _pendingUserDefinedUniverseSecurityChanges.Add(new UserDefinedUniverseUpdate(optionUniverse, [.. configs, .. underlyingConfigs], option));\n                }\n            }\n\n            return option;\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Forex\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The currency pair</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The foreign exchange trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\" /> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this forex security. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <returns>The new <see cref=\"Forex\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Forex AddForex(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true, decimal leverage = Security.NullLeverage)\n        {\n            return AddSecurity<Forex>(SecurityType.Forex, ticker, resolution, market, fillForward, leverage, false);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Cfd\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The CFD ticker symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The cfd trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this CFD. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <returns>The new <see cref=\"Cfd\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Cfd AddCfd(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true, decimal leverage = Security.NullLeverage)\n        {\n            return AddSecurity<Cfd>(SecurityType.Cfd, ticker, resolution, market, fillForward, leverage, false);\n        }\n\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Index\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The index ticker</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The index trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <returns>The new <see cref=\"Index\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Index AddIndex(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true)\n        {\n            var index = AddSecurity<Index>(SecurityType.Index, ticker, resolution, market, fillForward, 1, false);\n            return index;\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Crypto\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The crypto ticker symbol/param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The The crypto trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this crypto. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <returns>The new <see cref=\"Crypto\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public Crypto AddCrypto(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true, decimal leverage = Security.NullLeverage)\n        {\n            return AddSecurity<Crypto>(SecurityType.Crypto, ticker, resolution, market, fillForward, leverage, false);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"CryptoFuture\"/> security to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The crypto future ticker symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"market\">The The crypto future trading market, <seealso cref=\"Market\"/>. Default value is null and looked up using <see cref=\"IBrokerageModel.DefaultMarkets\"/> in <see cref=\"AddSecurity{T}\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this crypto future. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <returns>The new <see cref=\"CryptoFuture\"/> security</returns>\n        [DocumentationAttribute(AddingData)]\n        public CryptoFuture AddCryptoFuture(string ticker, Resolution? resolution = null, string market = null, bool fillForward = true, decimal leverage = Security.NullLeverage)\n        {\n            return AddSecurity<CryptoFuture>(SecurityType.CryptoFuture, ticker, resolution, market, fillForward, leverage, false);\n        }\n\n        /// <summary>\n        /// Removes the security with the specified symbol. This will cancel all\n        /// open orders and then liquidate any existing holdings\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be removed</param>\n        /// <param name=\"tag\">Optional tag to indicate the cause of removal</param>\n        /// <remarks>Sugar syntax for <see cref=\"RemoveSecurity\"/></remarks>\n        [DocumentationAttribute(AddingData)]\n        public bool RemoveOptionContract(Symbol symbol, string tag = null)\n        {\n            return RemoveSecurity(symbol, tag);\n        }\n\n        /// <summary>\n        /// Removes the security with the specified symbol. This will cancel all\n        /// open orders and then liquidate any existing holdings\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be removed</param>\n        /// <param name=\"tag\">Optional tag to indicate the cause of removal</param>\n        [DocumentationAttribute(AddingData)]\n        public bool RemoveSecurity(Symbol symbol, string tag = null)\n        {\n            Security security;\n            if (!Securities.TryGetValue(symbol, out security))\n            {\n                return false;\n            }\n\n            tag ??= \"Removed\";\n            if (!IsWarmingUp)\n            {\n                // cancel open orders\n                Transactions.CancelOpenOrders(security.Symbol, tag);\n            }\n\n            // liquidate if invested\n            if (security.Invested)\n            {\n                Liquidate(symbol: security.Symbol, tag: tag);\n            }\n\n            // Mark security as not tradable\n            security.Reset();\n            if (symbol.IsCanonical())\n            {\n                // remove underlying equity data if it's marked as internal\n                foreach (var kvp in UniverseManager.Where(x => x.Value.Configuration.Symbol == symbol\n                    || x.Value.Configuration.Symbol == ContinuousContractUniverse.CreateSymbol(symbol)))\n                {\n                    var universe = kvp.Value;\n                    // remove underlying if not used by other universes\n                    var otherUniverses = UniverseManager.Select(ukvp => ukvp.Value).Where(u => !ReferenceEquals(u, universe)).ToList();\n                    if (symbol.HasUnderlying)\n                    {\n                        var underlying = Securities[symbol.Underlying];\n                        if (!otherUniverses.Any(u => u.Members.ContainsKey(underlying.Symbol)))\n                        {\n                            RemoveSecurity(underlying.Symbol, tag);\n                        }\n                    }\n\n                    // remove child securities (option contracts for option chain universes) if not used in other universes\n                    // we order the securities so that the removal is deterministic, it will liquidate any holdings\n                    foreach (var child in universe.Members.Values.OrderBy(security1 => security1.Symbol))\n                    {\n                        if (!otherUniverses.Any(u => u.Members.ContainsKey(child.Symbol)) && !child.Symbol.IsCanonical())\n                        {\n                            RemoveSecurity(child.Symbol, tag);\n                        }\n                    }\n\n                    // finally, dispose and remove the canonical security from the universe manager\n                    UniverseManager.Remove(kvp.Key);\n                    _universeSelectionUniverses.Remove(security.Symbol);\n                }\n            }\n            else\n            {\n                lock (_pendingUniverseAdditionsLock)\n                {\n                    // for existing universes we need to purge pending additions too, also handled at OnEndOfTimeStep()\n                    _pendingUserDefinedUniverseSecurityChanges.RemoveAll(addition => addition.Security.Symbol == symbol);\n\n                    // we need to handle existing universes and pending to be added universes, that will be pushed\n                    // at the end of this time step see OnEndOfTimeStep()\n                    foreach (var universe in UniverseManager.Where(x => x.Value.ContainsMember(security)).Select(x => x.Value).OfType<UserDefinedUniverse>())\n                    {\n                        _pendingUserDefinedUniverseSecurityChanges.Add(new UserDefinedUniverseUpdate(universe, null, security));\n                    }\n                }\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)\n        /// </summary>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the data</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(string ticker, Resolution? resolution = null)\n            where T : IBaseData, new()\n        {\n            //Add this new generic data as a tradeable security:\n            // Defaults:extended market hours\"      = true because we want events 24 hours,\n            //          fillforward                 = false because only want to trigger when there's new custom data.\n            //          leverage                    = 1 because no leverage on nonmarket data?\n            return AddData<T>(ticker, resolution, fillForward: false, leverage: 1m);\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)\n        /// </summary>\n        /// <param name=\"underlying\">The underlying symbol for the custom data</param>\n        /// <param name=\"resolution\">Resolution of the data</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(Symbol underlying, Resolution? resolution = null)\n            where T : IBaseData, new()\n        {\n            //Add this new generic data as a tradeable security:\n            // Defaults:extended market hours\"      = true because we want events 24 hours,\n            //          fillforward                 = false because only want to trigger when there's new custom data.\n            //          leverage                    = 1 because no leverage on nonmarket data?\n            return AddData<T>(underlying, resolution, fillForward: false, leverage: 1m);\n        }\n\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)\n        /// </summary>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(string ticker, Resolution? resolution, bool fillForward, decimal leverage = 1.0m)\n            where T : IBaseData, new()\n        {\n            return AddData<T>(ticker, resolution, null, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)\n        /// </summary>\n        /// <param name=\"underlying\">The underlying symbol for the custom data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(Symbol underlying, Resolution? resolution, bool fillForward, decimal leverage = 1.0m)\n            where T : IBaseData, new()\n        {\n            return AddData<T>(underlying, resolution, null, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// </summary>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillForward = false, decimal leverage = 1.0m)\n            where T : IBaseData, new()\n        {\n            return AddData(typeof(T), ticker, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source, requiring only the minimum config options.\n        /// </summary>\n        /// <param name=\"underlying\">The underlying symbol for the custom data</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"timeZone\">Specifies the time zone of the raw data</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        /// <remarks>Generic type T must implement base data</remarks>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(Symbol underlying, Resolution? resolution, DateTimeZone timeZone, bool fillForward = false, decimal leverage = 1.0m)\n            where T : IBaseData, new()\n        {\n            return AddData(typeof(T), underlying, resolution, timeZone, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// AddData<typeparam name=\"T\"/> a new user defined data source including symbol properties and exchange hours,\n        /// all other vars are not required and will use defaults.\n        /// </summary>\n        /// <param name=\"ticker\">Key/Ticker for data</param>\n        /// <param name=\"properties\">The properties of this new custom data</param>\n        /// <param name=\"exchangeHours\">The Exchange hours of this symbol</param>\n        /// <param name=\"resolution\">Resolution of the Data Required</param>\n        /// <param name=\"fillForward\">When no data available on a tradebar, return the last data that was generated</param>\n        /// <param name=\"leverage\">Custom leverage per security</param>\n        /// <returns>The new <see cref=\"Security\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        public Security AddData<T>(string ticker, SymbolProperties properties, SecurityExchangeHours exchangeHours, Resolution? resolution = null, bool fillForward = false, decimal leverage = 1.0m)\n            where T : IBaseData, new()\n        {\n            // Get the right key for storage of base type symbols\n            var key = SecurityIdentifier.GenerateBaseSymbol(typeof(T), ticker);\n\n            // Set our database entries for this data type\n            SetDatabaseEntries(key, properties, exchangeHours);\n\n            // Then add the data\n            return AddData(typeof(T), ticker, resolution, null, fillForward, leverage);\n        }\n\n        /// <summary>\n        /// Send a debug message to the web console:\n        /// </summary>\n        /// <param name=\"message\">Message to send to debug console</param>\n        /// <seealso cref=\"Log(string)\"/>\n        /// <seealso cref=\"Error(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Debug(string message)\n        {\n            if (!_liveMode && (string.IsNullOrEmpty(message) || _previousDebugMessage == message)) return;\n            _debugMessages.Enqueue(FormatLog(message));\n            _previousDebugMessage = message;\n        }\n\n        /// <summary>\n        /// Send a debug message to the web console:\n        /// </summary>\n        /// <param name=\"message\">Message to send to debug console</param>\n        /// <seealso cref=\"Log(int)\"/>\n        /// <seealso cref=\"Error(int)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Debug(int message)\n        {\n            Debug(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a debug message to the web console:\n        /// </summary>\n        /// <param name=\"message\">Message to send to debug console</param>\n        /// <seealso cref=\"Log(double)\"/>\n        /// <seealso cref=\"Error(double)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Debug(double message)\n        {\n            Debug(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a debug message to the web console:\n        /// </summary>\n        /// <param name=\"message\">Message to send to debug console</param>\n        /// <seealso cref=\"Log(decimal)\"/>\n        /// <seealso cref=\"Error(decimal)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Debug(decimal message)\n        {\n            Debug(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Added another method for logging if user guessed.\n        /// </summary>\n        /// <param name=\"message\">String message to log.</param>\n        /// <seealso cref=\"Debug(string)\"/>\n        /// <seealso cref=\"Error(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Log(string message)\n        {\n            if (!_liveMode && string.IsNullOrEmpty(message)) return;\n            _logMessages.Enqueue(FormatLog(message));\n        }\n\n        /// <summary>\n        /// Added another method for logging if user guessed.\n        /// </summary>\n        /// <param name=\"message\">Int message to log.</param>\n        /// <seealso cref=\"Debug(int)\"/>\n        /// <seealso cref=\"Error(int)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Log(int message)\n        {\n            Log(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Added another method for logging if user guessed.\n        /// </summary>\n        /// <param name=\"message\">Double message to log.</param>\n        /// <seealso cref=\"Debug(double)\"/>\n        /// <seealso cref=\"Error(double)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Log(double message)\n        {\n            Log(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Added another method for logging if user guessed.\n        /// </summary>\n        /// <param name=\"message\">Decimal message to log.</param>\n        /// <seealso cref=\"Debug(decimal)\"/>\n        /// <seealso cref=\"Error(decimal)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Log(decimal message)\n        {\n            Log(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a string error message to the Console.\n        /// </summary>\n        /// <param name=\"message\">Message to display in errors grid</param>\n        /// <seealso cref=\"Debug(string)\"/>\n        /// <seealso cref=\"Log(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(string message)\n        {\n            if (!_liveMode && (string.IsNullOrEmpty(message) || _previousErrorMessage == message)) return;\n            _errorMessages.Enqueue(FormatLog(message));\n            _previousErrorMessage = message;\n        }\n\n        /// <summary>\n        /// Send a int error message to the Console.\n        /// </summary>\n        /// <param name=\"message\">Message to display in errors grid</param>\n        /// <seealso cref=\"Debug(int)\"/>\n        /// <seealso cref=\"Log(int)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(int message)\n        {\n            Error(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a double error message to the Console.\n        /// </summary>\n        /// <param name=\"message\">Message to display in errors grid</param>\n        /// <seealso cref=\"Debug(double)\"/>\n        /// <seealso cref=\"Log(double)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(double message)\n        {\n            Error(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a decimal error message to the Console.\n        /// </summary>\n        /// <param name=\"message\">Message to display in errors grid</param>\n        /// <seealso cref=\"Debug(decimal)\"/>\n        /// <seealso cref=\"Log(decimal)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(decimal message)\n        {\n            Error(message.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Send a string error message to the Console.\n        /// </summary>\n        /// <param name=\"error\">Exception object captured from a try catch loop</param>\n        /// <seealso cref=\"Debug(string)\"/>\n        /// <seealso cref=\"Log(string)\"/>\n        [DocumentationAttribute(Logging)]\n        public void Error(Exception error)\n        {\n            Error(error.Message);\n        }\n\n        /// <summary>\n        /// Terminate the algorithm after processing the current event handler.\n        /// </summary>\n        /// <param name=\"message\">Exit message to display on quitting</param>\n        [DocumentationAttribute(Logging)]\n        public void Quit(string message = \"\")\n        {\n            Debug(\"Quit(): \" + message);\n            Status = AlgorithmStatus.Stopped;\n        }\n\n        /// <summary>\n        /// Set the Quit flag property of the algorithm.\n        /// </summary>\n        /// <remarks>Intended for internal use by the QuantConnect Lean Engine only.</remarks>\n        /// <param name=\"quit\">Boolean quit state</param>\n        /// <seealso cref=\"Quit(String)\"/>\n        [DocumentationAttribute(Logging)]\n        public void SetQuit(bool quit)\n        {\n            if (quit)\n            {\n                Status = AlgorithmStatus.Stopped;\n            }\n        }\n\n        /// <summary>\n        /// Converts the string 'ticker' symbol into a full <see cref=\"Symbol\"/> object\n        /// This requires that the string 'ticker' has been added to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The ticker symbol. This should be the ticker symbol\n        /// as it was added to the algorithm</param>\n        /// <returns>The symbol object mapped to the specified ticker</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HandlingData)]\n        public Symbol Symbol(string ticker)\n        {\n            return SymbolCache.GetSymbol(ticker);\n        }\n\n        /// <summary>\n        /// For the given symbol will resolve the ticker it used at the current algorithm date\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get the ticker for</param>\n        /// <returns>The mapped ticker for a symbol</returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(HandlingData)]\n        public string Ticker(Symbol symbol)\n        {\n            return SecurityIdentifier.Ticker(symbol, Time);\n        }\n\n        /// <summary>\n        /// Creates and adds a new <see cref=\"Security\"/> to the algorithm\n        /// </summary>\n        [DocumentationAttribute(AddingData)]\n        private T AddSecurity<T>(SecurityType securityType, string ticker, Resolution? resolution, string market, bool fillForward, decimal leverage, bool extendedMarketHours,\n            DataMappingMode? mappingMode = null, DataNormalizationMode? normalizationMode = null)\n            where T : Security\n        {\n            market = GetMarket(market, ticker, securityType);\n\n            Symbol symbol;\n            if (!SymbolCache.TryGetSymbol(ticker, out symbol) ||\n                symbol.ID.Market != market ||\n                symbol.SecurityType != securityType)\n            {\n                symbol = QuantConnect.Symbol.Create(ticker, securityType, market);\n            }\n\n            var configs = SubscriptionManager.SubscriptionDataConfigService.Add(symbol, resolution, fillForward, extendedMarketHours,\n                dataNormalizationMode: normalizationMode ?? UniverseSettings.DataNormalizationMode,\n                dataMappingMode: mappingMode ?? UniverseSettings.DataMappingMode);\n            var security = Securities.CreateSecurity(symbol, configs, leverage);\n\n            return (T)AddToUserDefinedUniverse(security, configs);\n        }\n\n        /// <summary>\n        /// Set the historical data provider\n        /// </summary>\n        /// <param name=\"historyProvider\">Historical data provider</param>\n        [DocumentationAttribute(HistoricalData)]\n        public void SetHistoryProvider(IHistoryProvider historyProvider)\n        {\n            if (historyProvider == null)\n            {\n                throw new ArgumentNullException(nameof(historyProvider), \"Algorithm.SetHistoryProvider(): Historical data provider cannot be null.\");\n            }\n            HistoryProvider = historyProvider;\n        }\n\n        /// <summary>\n        /// Set the runtime error\n        /// </summary>\n        /// <param name=\"exception\">Represents error that occur during execution</param>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(LiveTrading)]\n        public void SetRunTimeError(Exception exception)\n        {\n            if (exception == null)\n            {\n                throw new ArgumentNullException(nameof(exception), \"Algorithm.SetRunTimeError(): Algorithm.RunTimeError cannot be set to null.\");\n            }\n\n            RunTimeError = exception;\n        }\n\n        /// <summary>\n        /// Set the state of a live deployment\n        /// </summary>\n        /// <param name=\"status\">Live deployment status</param>\n        [DocumentationAttribute(LiveTrading)]\n        public void SetStatus(AlgorithmStatus status)\n        {\n            Status = status;\n        }\n\n        /// <summary>\n        /// Downloads the requested resource as a <see cref=\"string\"/>.\n        /// The resource to download is specified as a <see cref=\"string\"/> containing the URI.\n        /// </summary>\n        /// <param name=\"address\">A string containing the URI to download</param>\n        /// <returns>The requested resource as a <see cref=\"string\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public string Download(string address) => Download(address, Enumerable.Empty<KeyValuePair<string, string>>());\n\n        /// <summary>\n        /// Downloads the requested resource as a <see cref=\"string\"/>.\n        /// The resource to download is specified as a <see cref=\"string\"/> containing the URI.\n        /// </summary>\n        /// <param name=\"address\">A string containing the URI to download</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        /// <returns>The requested resource as a <see cref=\"string\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public string Download(string address, IEnumerable<KeyValuePair<string, string>> headers) => Download(address, headers, null, null);\n\n        /// <summary>\n        /// Downloads the requested resource as a <see cref=\"string\"/>.\n        /// The resource to download is specified as a <see cref=\"string\"/> containing the URI.\n        /// </summary>\n        /// <param name=\"address\">A string containing the URI to download</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        /// <param name=\"userName\">The user name associated with the credentials</param>\n        /// <param name=\"password\">The password for the user name associated with the credentials</param>\n        /// <returns>The requested resource as a <see cref=\"string\"/></returns>\n        [DocumentationAttribute(AddingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public string Download(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password)\n        {\n            return _api.Download(address, headers, userName, password);\n        }\n\n        /// <summary>\n        /// Schedules the provided training code to execute immediately\n        /// </summary>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        [DocumentationAttribute(MachineLearning)]\n        [DocumentationAttribute(ScheduledEvents)]\n        public ScheduledEvent Train(Action trainingCode)\n        {\n            return Schedule.TrainingNow(trainingCode);\n        }\n\n        /// <summary>\n        /// Schedules the training code to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        [DocumentationAttribute(MachineLearning)]\n        [DocumentationAttribute(ScheduledEvents)]\n        public ScheduledEvent Train(IDateRule dateRule, ITimeRule timeRule, Action trainingCode)\n        {\n            return Schedule.Training(dateRule, timeRule, trainingCode);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"InsightsGenerated\"/> event\n        /// </summary>\n        /// <param name=\"insights\">The collection of insights generaed at the current time step</param>\n        [DocumentationAttribute(AlgorithmFramework)]\n        private void OnInsightsGenerated(Insight[] insights)\n        {\n            // debug printing of generated insights\n            if (DebugMode)\n            {\n                Log($\"{Time}: ALPHA: {string.Join(\" | \", insights.Select(i => i.ToString()).OrderBy(i => i))}\");\n            }\n\n            Insights.AddRange(insights);\n\n            InsightsGenerated?.Invoke(this, new GeneratedInsightsCollection(UtcTime, insights));\n        }\n\n        /// <summary>\n        /// Sets the current slice\n        /// </summary>\n        /// <param name=\"slice\">The Slice object</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetCurrentSlice(Slice slice)\n        {\n            CurrentSlice = slice;\n        }\n\n\n        /// <summary>\n        /// Provide the API for the algorithm.\n        /// </summary>\n        /// <param name=\"api\">Initiated API</param>\n        [DocumentationAttribute(HandlingData)]\n        public void SetApi(IApi api)\n        {\n            _api = api;\n        }\n\n        /// <summary>\n        /// Sets the object store\n        /// </summary>\n        /// <param name=\"objectStore\">The object store</param>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(MachineLearning)]\n        public void SetObjectStore(IObjectStore objectStore)\n        {\n            ObjectStore = new ObjectStore(objectStore);\n        }\n\n        /// <summary>\n        /// Determines if the Symbol is shortable at the brokerage\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check if shortable</param>\n        /// <returns>True if shortable</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public bool Shortable(Symbol symbol)\n        {\n            return Shortable(symbol, 0);\n        }\n\n        /// <summary>\n        /// Determines if the Symbol is shortable at the brokerage\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check if shortable</param>\n        /// <param name=\"shortQuantity\">Order's quantity to check if it is currently shortable, taking into account current holdings and open orders</param>\n        /// <param name=\"updateOrderId\">Optionally the id of the order being updated. When updating an order\n        /// we want to ignore it's submitted short quantity and use the new provided quantity to determine if we\n        /// can perform the update</param>\n        /// <returns>True if the symbol can be shorted by the requested quantity</returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public bool Shortable(Symbol symbol, decimal shortQuantity, int? updateOrderId = null)\n        {\n            var security = Securities[symbol];\n            var shortableQuantity = security.ShortableProvider.ShortableQuantity(symbol, security.LocalTime);\n            if (shortableQuantity == null)\n            {\n                return true;\n            }\n\n            var openOrderQuantity = Transactions.GetOpenOrdersRemainingQuantity(\n                // if 'updateOrderId' was given, ignore that orders quantity\n                order => order.Symbol == symbol && (!updateOrderId.HasValue || order.OrderId != updateOrderId.Value));\n\n            var portfolioQuantity = security.Holdings.Quantity;\n            // We check portfolio and open orders beforehand to ensure that orderQuantity == 0 case does not return\n            // a true result whenever we have no more shares left to short.\n            if (portfolioQuantity + openOrderQuantity <= -shortableQuantity)\n            {\n                return false;\n            }\n\n            shortQuantity = -Math.Abs(shortQuantity);\n            return portfolioQuantity + shortQuantity + openOrderQuantity >= -shortableQuantity;\n        }\n\n        /// <summary>\n        /// Gets the quantity shortable for the given asset\n        /// </summary>\n        /// <returns>\n        /// Quantity shortable for the given asset. Zero if not\n        /// shortable, or a number greater than zero if shortable.\n        /// </returns>\n        [DocumentationAttribute(TradingAndOrders)]\n        public long ShortableQuantity(Symbol symbol)\n        {\n            var security = Securities[symbol];\n            return security.ShortableProvider.ShortableQuantity(symbol, security.LocalTime) ?? 0;\n        }\n\n        /// <summary>\n        /// Converts an ISIN identifier into a <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"isin\">The International Securities Identification Number (ISIN) of an asset</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock being looked up is/was traded at.\n        /// The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.\n        /// </param>\n        /// <returns>Symbol corresponding to the ISIN. If no Symbol with a matching ISIN was found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Symbol ISIN(string isin, DateTime? tradingDate = null)\n        {\n            return SecurityDefinitionSymbolResolver.ISIN(isin, GetVerifiedTradingDate(tradingDate));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Symbol\"/> into an ISIN identifier\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>ISIN corresponding to the Symbol. If no matching ISIN is found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public string ISIN(Symbol symbol)\n        {\n            return SecurityDefinitionSymbolResolver.ISIN(symbol);\n        }\n\n        /// <summary>\n        /// Converts a composite FIGI identifier into a <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"compositeFigi\">The composite Financial Instrument Global Identifier (FIGI) of an asset</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock being looked up is/was traded at.\n        /// The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.\n        /// </param>\n        /// <returns>Symbol corresponding to the composite FIGI. If no Symbol with a matching composite FIGI was found, returns null.</returns>\n        /// <remarks>\n        /// The composite FIGI differs from an exchange-level FIGI, in that it identifies\n        /// an asset across all exchanges in a single country that the asset trades in.\n        /// </remarks>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Symbol CompositeFIGI(string compositeFigi, DateTime? tradingDate = null)\n        {\n            return SecurityDefinitionSymbolResolver.CompositeFIGI(compositeFigi, GetVerifiedTradingDate(tradingDate));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Symbol\"/> into a composite FIGI identifier\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>Composite FIGI corresponding to the Symbol. If no matching composite FIGI is found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public string CompositeFIGI(Symbol symbol)\n        {\n            return SecurityDefinitionSymbolResolver.CompositeFIGI(symbol);\n        }\n\n        /// <summary>\n        /// Converts a CUSIP identifier into a <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"cusip\">The CUSIP number of an asset</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock being looked up is/was traded at.\n        /// The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.\n        /// </param>\n        /// <returns>Symbol corresponding to the CUSIP. If no Symbol with a matching CUSIP was found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Symbol CUSIP(string cusip, DateTime? tradingDate = null)\n        {\n            return SecurityDefinitionSymbolResolver.CUSIP(cusip, GetVerifiedTradingDate(tradingDate));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Symbol\"/> into a CUSIP identifier\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>CUSIP corresponding to the Symbol. If no matching CUSIP is found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public string CUSIP(Symbol symbol)\n        {\n            return SecurityDefinitionSymbolResolver.CUSIP(symbol);\n        }\n\n        /// <summary>\n        /// Converts a SEDOL identifier into a <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"sedol\">The SEDOL identifier of an asset</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock being looked up is/was traded at.\n        /// The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.\n        /// </param>\n        /// <returns>Symbol corresponding to the SEDOL. If no Symbol with a matching SEDOL was found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Symbol SEDOL(string sedol, DateTime? tradingDate = null)\n        {\n            return SecurityDefinitionSymbolResolver.SEDOL(sedol, GetVerifiedTradingDate(tradingDate));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Symbol\"/> into a SEDOL identifier\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>SEDOL corresponding to the Symbol. If no matching SEDOL is found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public string SEDOL(Symbol symbol)\n        {\n            return SecurityDefinitionSymbolResolver.SEDOL(symbol);\n        }\n\n        /// <summary>\n        /// Converts a CIK identifier into <see cref=\"Symbol\"/> array\n        /// </summary>\n        /// <param name=\"cik\">The CIK identifier of an asset</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock being looked up is/was traded at.\n        /// The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.\n        /// </param>\n        /// <returns>Symbols corresponding to the CIK. If no Symbol with a matching CIK was found, returns empty array.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Symbol[] CIK(int cik, DateTime? tradingDate = null)\n        {\n            return SecurityDefinitionSymbolResolver.CIK(cik, GetVerifiedTradingDate(tradingDate));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Symbol\"/> into a CIK identifier\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>CIK corresponding to the Symbol. If no matching CIK is found, returns null.</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public int? CIK(Symbol symbol)\n        {\n            return SecurityDefinitionSymbolResolver.CIK(symbol);\n        }\n\n        /// <summary>\n        /// Get the fundamental data for the requested symbol at the current time\n        /// </summary>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/></param>\n        /// <returns>The fundamental data for the Symbol</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public Fundamental Fundamentals(Symbol symbol)\n        {\n            return Fundamental.ForDate(Time, symbol);\n        }\n\n        /// <summary>\n        /// Get the fundamental data for the requested symbols at the current time\n        /// </summary>\n        /// <param name=\"symbols\">The <see cref=\"Symbol\"/></param>\n        /// <returns>The fundamental data for the symbols</returns>\n        [DocumentationAttribute(HandlingData)]\n        [DocumentationAttribute(SecuritiesAndPortfolio)]\n        public List<Fundamental> Fundamentals(List<Symbol> symbols)\n        {\n            return symbols.Select(symbol => Fundamentals(symbol)).ToList();\n        }\n\n        /// <summary>\n        /// Get the option chain for the specified symbol at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbol\">\n        /// The symbol for which the option chain is asked for.\n        /// It can be either the canonical option or the underlying symbol.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"OptionChain.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The option chain</returns>\n        /// <remarks>\n        /// As of 2024/09/11, future options chain will not contain any additional data (e.g. daily price data, implied volatility and greeks),\n        /// it will be populated with the contract symbol only. This is expected to change in the future.\n        /// As of 2024/12/18, future options data will contain daily price data but not implied volatility and greeks.\n        /// </remarks>\n        [DocumentationAttribute(AddingData)]\n        public OptionChain OptionChain(Symbol symbol, bool flatten = false)\n        {\n            return OptionChains(new[] { symbol }, flatten).Values.SingleOrDefault() ??\n                new OptionChain(GetCanonicalOptionSymbol(symbol), Time.Date, flatten);\n        }\n\n        /// <summary>\n        /// Get the option chains for the specified symbols at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbols\">\n        /// The symbols for which the option chain is asked for.\n        /// It can be either the canonical options or the underlying symbols.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"OptionChain.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The option chains</returns>\n        [DocumentationAttribute(AddingData)]\n        public OptionChains OptionChains(IEnumerable<Symbol> symbols, bool flatten = false)\n        {\n            var canonicalSymbols = symbols.Select(GetCanonicalOptionSymbol).ToList();\n            var optionChainsData = GetChainsData<OptionUniverse>(canonicalSymbols);\n\n            var chains = new OptionChains(Time.Date, flatten);\n            foreach (var (symbol, contracts) in optionChainsData)\n            {\n                var symbolProperties = SymbolPropertiesDatabase.GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, AccountCurrency);\n                var optionChain = new OptionChain(symbol, GetTimeInExchangeTimeZone(symbol).Date, contracts, symbolProperties, flatten);\n                chains.Add(symbol, optionChain);\n            }\n\n            return chains;\n        }\n\n        /// <summary>\n        /// Get the futures chain for the specified symbol at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbol\">\n        /// The symbol for which the futures chain is asked for.\n        /// It can be either the canonical future, a contract or an option symbol.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"FuturesChain.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The futures chain</returns>\n        [DocumentationAttribute(AddingData)]\n        public FuturesChain FutureChain(Symbol symbol, bool flatten = false)\n        {\n            return FuturesChain(symbol, flatten);\n        }\n\n        /// <summary>\n        /// Get the futures chain for the specified symbol at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbol\">\n        /// The symbol for which the futures chain is asked for.\n        /// It can be either the canonical future, a contract or an option symbol.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"FuturesChain.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The futures chain</returns>\n        [DocumentationAttribute(AddingData)]\n        public FuturesChain FuturesChain(Symbol symbol, bool flatten = false)\n        {\n            return FuturesChains(new[] { symbol }, flatten).Values.SingleOrDefault() ??\n                new FuturesChain(GetCanonicalFutureSymbol(symbol), Time.Date);\n        }\n\n        /// <summary>\n        /// Get the futures chains for the specified symbols at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbols\">\n        /// The symbols for which the futures chains are asked for.\n        /// It can be either the canonical future, a contract or an option symbol.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"FuturesChains.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The futures chains</returns>\n        [DocumentationAttribute(AddingData)]\n        public FuturesChains FutureChains(IEnumerable<Symbol> symbols, bool flatten = false)\n        {\n            return FuturesChains(symbols, flatten);\n        }\n\n        /// <summary>\n        /// Get the futures chains for the specified symbols at the current time (<see cref=\"Time\"/>)\n        /// </summary>\n        /// <param name=\"symbols\">\n        /// The symbols for which the futures chains are asked for.\n        /// It can be either the canonical future, a contract or an option symbol.\n        /// </param>\n        /// <param name=\"flatten\">\n        /// Whether to flatten the resulting data frame. Used from Python when accessing <see cref=\"FuturesChains.DataFrame\"/>.\n        /// See <see cref=\"History(PyObject, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?, bool)\"/>\n        /// </param>\n        /// <returns>The futures chains</returns>\n        [DocumentationAttribute(AddingData)]\n        public FuturesChains FuturesChains(IEnumerable<Symbol> symbols, bool flatten = false)\n        {\n            var canonicalSymbols = symbols.Select(GetCanonicalFutureSymbol).ToList();\n            var futureChainsData = GetChainsData<FutureUniverse>(canonicalSymbols);\n\n            var chains = new FuturesChains(Time.Date, flatten);\n\n            if (futureChainsData != null)\n            {\n                foreach (var (symbol, contracts) in futureChainsData)\n                {\n                    var chain = new FuturesChain(symbol, GetTimeInExchangeTimeZone(symbol).Date, contracts, flatten);\n                    chains.Add(symbol, chain);\n                }\n            }\n\n            return chains;\n        }\n\n        /// <summary>\n        /// Get an authenticated link to execute the given command instance\n        /// </summary>\n        /// <param name=\"command\">The target command</param>\n        /// <returns>The authenticated link</returns>\n        public string Link(object command)\n        {\n            var typeName = command.GetType().Name;\n            if (command is Command || typeName.Contains(\"AnonymousType\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                return CommandLink(typeName, command);\n            }\n            // this shouldn't happen but just in case\n            throw new ArgumentException($\"Unexpected command type: {typeName}\");\n        }\n\n        /// <summary>\n        /// Register a command type to be used\n        /// </summary>\n        /// <typeparam name=\"T\">The command type</typeparam>\n        public void AddCommand<T>() where T : Command\n        {\n            _registeredCommands[typeof(T).Name] = (CallbackCommand command) =>\n            {\n                var commandInstance = JsonConvert.DeserializeObject<T>(command.Payload);\n                return commandInstance.Run(this);\n            };\n        }\n\n        /// <summary>\n        /// Broadcast a live command\n        /// </summary>\n        /// <param name=\"command\">The target command</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse BroadcastCommand(object command)\n        {\n            var typeName = command.GetType().Name;\n            if (command is Command || typeName.Contains(\"AnonymousType\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                var serialized = JsonConvert.SerializeObject(command);\n                var payload = JsonConvert.DeserializeObject<Dictionary<string, object>>(serialized);\n                return SendBroadcast(typeName, payload);\n            }\n            // this shouldn't happen but just in case\n            throw new ArgumentException($\"Unexpected command type: {typeName}\");\n        }\n\n        /// <summary>\n        /// Run a callback command instance\n        /// </summary>\n        /// <param name=\"command\">The callback command instance</param>\n        /// <returns>The command result</returns>\n        public CommandResultPacket RunCommand(CallbackCommand command)\n        {\n            bool? result = null;\n            if (_registeredCommands.TryGetValue(command.Type, out var target))\n            {\n                try\n                {\n                    result = target.Invoke(command);\n                }\n                catch (Exception ex)\n                {\n                    QuantConnect.Logging.Log.Error(ex);\n                    if (_oneTimeCommandErrors.Add(command.Type))\n                    {\n                        Log($\"Unexpected error running command '{command.Type}' error: '{ex.Message}'\");\n                    }\n                }\n            }\n            else\n            {\n                if (_oneTimeCommandErrors.Add(command.Type))\n                {\n                    Log($\"Detected unregistered command type '{command.Type}', will be ignored\");\n                }\n            }\n            return new CommandResultPacket(command, result) { CommandName = command.Type };\n        }\n\n        /// <summary>\n        /// Generic untyped command call handler\n        /// </summary>\n        /// <param name=\"data\">The associated data</param>\n        /// <returns>True if success, false otherwise. Returning null will disable command feedback</returns>\n        public virtual bool? OnCommand(dynamic data)\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Helper method to get a market for a given security type and ticker\n        /// </summary>\n        private string GetMarket(string market, string ticker, SecurityType securityType, string defaultMarket = null)\n        {\n            if (string.IsNullOrEmpty(market))\n            {\n                if (securityType == SecurityType.Index && IndexSymbol.TryGetIndexMarket(ticker, out market))\n                {\n                    return market;\n                }\n\n                if (securityType == SecurityType.Future && SymbolPropertiesDatabase.TryGetMarket(ticker, securityType, out market))\n                {\n                    return market;\n                }\n\n                if (!BrokerageModel.DefaultMarkets.TryGetValue(securityType, out market))\n                {\n                    if (string.IsNullOrEmpty(defaultMarket))\n                    {\n                        throw new KeyNotFoundException($\"No default market set for security type: {securityType}\");\n                    }\n                    return defaultMarket;\n                }\n            }\n            return market;\n        }\n\n        private string CommandLink(string typeName, object command)\n        {\n            var payload = new Dictionary<string, dynamic> { { \"projectId\", ProjectId }, { \"command\", command } };\n            if (_registeredCommands.ContainsKey(typeName))\n            {\n                payload[\"command[$type]\"] = typeName;\n            }\n            return Authentication.Link(\"live/commands/create\", payload);\n        }\n\n        private RestResponse SendBroadcast(string typeName, Dictionary<string, object> payload)\n        {\n            if (AlgorithmMode == AlgorithmMode.Backtesting)\n            {\n                if (!_sentBroadcastCommandsDisabled)\n                {\n                    _sentBroadcastCommandsDisabled = true;\n                    Debug(\"Warning: sending broadcast commands is disabled in backtesting\");\n                }\n                return null;\n            }\n\n            if (_registeredCommands.ContainsKey(typeName))\n            {\n                payload[\"$type\"] = typeName;\n            }\n            return _api.BroadcastLiveCommand(Globals.OrganizationID,\n                AlgorithmMode == AlgorithmMode.Live ? ProjectId : null,\n                payload);\n        }\n\n        private static Symbol GetCanonicalOptionSymbol(Symbol symbol)\n        {\n            // We got the underlying\n            if (symbol.SecurityType.HasOptions())\n            {\n                return QuantConnect.Symbol.CreateCanonicalOption(symbol);\n            }\n\n            if (symbol.SecurityType.IsOption())\n            {\n                return symbol.Canonical;\n            }\n\n            throw new ArgumentException($\"The symbol {symbol} is not an option or an underlying symbol.\");\n        }\n\n        private static Symbol GetCanonicalFutureSymbol(Symbol symbol)\n        {\n            // We got either a contract or the canonical itself\n            if (symbol.SecurityType == SecurityType.Future)\n            {\n                return symbol.Canonical;\n            }\n\n            if (symbol.SecurityType == SecurityType.FutureOption)\n            {\n                return symbol.Underlying.Canonical;\n            }\n\n            throw new ArgumentException($\"The symbol {symbol} is neither a future nor a future option symbol.\");\n        }\n\n        /// <summary>\n        /// Set the properties and exchange hours for a given key into our databases\n        /// </summary>\n        /// <param name=\"key\">Key for database storage</param>\n        /// <param name=\"properties\">Properties to store</param>\n        /// <param name=\"exchangeHours\">Exchange hours to store</param>\n        private void SetDatabaseEntries(string key, SymbolProperties properties, SecurityExchangeHours exchangeHours)\n        {\n            // Add entries to our Symbol Properties DB and MarketHours DB\n            SymbolPropertiesDatabase.SetEntry(Market.USA, key, SecurityType.Base, properties);\n            MarketHoursDatabase.SetEntry(Market.USA, key, SecurityType.Base, exchangeHours);\n        }\n\n        /// <summary>\n        /// Takes a date, and verifies that it is point-in-time. If null\n        /// time is provided, algorithm time is returned instead.\n        /// </summary>\n        /// <param name=\"tradingDate\">\n        /// The trading date to verify that it is a point-in-time\n        /// date, or before, relative to the algorithm's current trading date.\n        /// </param>\n        /// <returns>The date provided if not null, otherwise the algorithm's current trading date</returns>\n        /// <exception cref=\"ArgumentException\">\n        /// The trading date provided is not null and it is after the algorithm's current trading date\n        /// </exception>\n        private DateTime GetVerifiedTradingDate(DateTime? tradingDate)\n        {\n            tradingDate ??= Time.Date;\n            if (tradingDate > Time.Date)\n            {\n                throw new ArgumentException($\"The trading date provided: \\\"{tradingDate:yyyy-MM-dd}\\\" is after the current algorithm's trading date: \\\"{Time:yyyy-MM-dd}\\\"\");\n            }\n\n            return tradingDate.Value;\n        }\n\n        /// <summary>\n        /// Helper method to set the start date during live trading\n        /// </summary>\n        private void SetLiveModeStartDate()\n        {\n            if (!LiveMode)\n            {\n                throw new InvalidOperationException(\"SetLiveModeStartDate should only be called during live trading!\");\n            }\n            _start = DateTime.UtcNow.ConvertFromUtc(TimeZone);\n            // startDate is set relative to the algorithm's timezone.\n            _startDate = _start.Date;\n            _endDate = QuantConnect.Time.EndOfTime;\n        }\n\n        /// <summary>\n        /// Sets the statistics service instance to be used by the algorithm\n        /// </summary>\n        /// <param name=\"statisticsService\">The statistics service instance</param>\n        public void SetStatisticsService(IStatisticsService statisticsService)\n        {\n            if (_statisticsService == null)\n            {\n                _statisticsService = statisticsService;\n            }\n        }\n\n        /// <summary>\n        /// Makes a history request to get the option/future chain data for the specified symbols\n        /// at the current algorithm time (<see cref=\"Time\"/>)\n        /// </summary>\n        private IEnumerable<KeyValuePair<Symbol, IEnumerable<T>>> GetChainsData<T>(IEnumerable<Symbol> canonicalSymbols)\n            where T : BaseChainUniverseData\n        {\n            foreach (var symbol in canonicalSymbols)\n            {\n                // We will add a safety measure in case the universe file for the current time is not available:\n                // we will use the latest available universe file within the last 3 trading dates.\n                // This is useful in cases like live trading when the algorithm is deployed at a time of day when\n                // the universe file is not available yet.\n                var history = (DataDictionary<T>)null;\n                var periods = 1;\n                while ((history == null || history.Count == 0) && periods <= 3)\n                {\n                    history = History<T>([symbol], periods++).FirstOrDefault();\n                }\n\n                var chain = history != null && history.Count > 0 ? history.Values.Single().Cast<T>() : Enumerable.Empty<T>();\n                yield return KeyValuePair.Create(symbol, chain);\n            }\n        }\n\n        /// <summary>\n        /// Gets the current time in the exchange time zone for the given symbol\n        /// </summary>\n        private DateTime GetTimeInExchangeTimeZone(Symbol symbol)\n        {\n            var exchange = MarketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            return UtcTime.ConvertFromUtc(exchange.TimeZone);\n        }\n\n        private string FormatLog(string message)\n        {\n            return $\"{Time.ToStringInvariant(DateFormat.UI)} {message}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/QuantConnect.Algorithm.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Algorithm</RootNamespace>\n    <AssemblyName>QuantConnect.Algorithm</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Algorithm.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Algorithm Project - Core QCAlgorithm implementation</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Alphas\\NullAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Execution\\ImmediateExecutionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Execution\\NullExecutionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\NullPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\CompositeRiskManagementModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\NullRiskManagementModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\ManualUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\UniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Algorithm/Risk/CompositeRiskManagementModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that combines multiple risk\n    /// models into a single risk management model and properly sets each insights 'SourceModel' property.\n    /// </summary>\n    public class CompositeRiskManagementModel : RiskManagementModel\n    {\n        private readonly List<IRiskManagementModel> _riskManagementModels = new List<IRiskManagementModel>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeRiskManagementModel\"/> class\n        /// </summary>\n        /// <param name=\"riskManagementModels\">The individual risk management models defining this composite model</param>\n        public CompositeRiskManagementModel(params IRiskManagementModel[] riskManagementModels)\n        {\n            if (riskManagementModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 risk management model for the CompositeRiskManagementModel\");\n            }\n\n            _riskManagementModels.AddRange(riskManagementModels);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeRiskManagementModel\"/> class\n        /// </summary>\n        /// <param name=\"riskManagementModels\">The individual risk management models defining this composite model</param>\n        public CompositeRiskManagementModel(IEnumerable<IRiskManagementModel> riskManagementModels)\n        {\n            foreach (var riskManagementModel in riskManagementModels)\n            {\n                AddRiskManagement(riskManagementModel);\n            }\n\n            if (_riskManagementModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 risk management model for the CompositeRiskManagementModel\");\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeRiskManagementModel\"/> class\n        /// </summary>\n        /// <param name=\"riskManagementModels\">The individual risk management models defining this composite model</param>\n        public CompositeRiskManagementModel(params PyObject[] riskManagementModels)\n        {\n            if (riskManagementModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 risk management model for the CompositeRiskManagementModel\");\n            }\n\n            foreach (var pyRiskManagementModel in riskManagementModels)\n            {\n                AddRiskManagement(pyRiskManagementModel);\n            }\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step.\n        /// This method patches this call through the each of the wrapped models.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        /// <returns>The new portfolio targets</returns>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            foreach (var model in _riskManagementModels)\n            {\n                // take into account the possibility of ManageRisk returning nothing\n                var riskAdjusted = model.ManageRisk(algorithm, targets);\n\n                // produce a distinct set of new targets giving preference to newer targets\n                targets = riskAdjusted.Concat(targets).DistinctBy(t => t.Symbol).ToArray();\n            }\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed.\n        /// This method patches this call through the each of the wrapped models.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var model in _riskManagementModels)\n            {\n                model.OnSecuritiesChanged(algorithm, changes);\n            }\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"IRiskManagementModel\"/> instance\n        /// </summary>\n        /// <param name=\"riskManagementModel\">The risk management model to add</param>\n        public void AddRiskManagement(IRiskManagementModel riskManagementModel)\n        {\n            _riskManagementModels.Add(riskManagementModel);\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"IRiskManagementModel\"/> instance\n        /// </summary>\n        /// <param name=\"pyRiskManagementModel\">The risk management model to add</param>\n        public void AddRiskManagement(PyObject pyRiskManagementModel)\n        {\n            var riskManagementModel = PythonUtil.CreateInstanceOrWrapper<IRiskManagementModel>(\n                pyRiskManagementModel,\n                py => new RiskManagementModelPythonWrapper(py)\n            );\n            _riskManagementModels.Add(riskManagementModel);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Risk/CompositeRiskManagementModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass CompositeRiskManagementModel(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that combines multiple risk models\n    into a single risk management model and properly sets each insights 'SourceModel' property.'''\n\n    def __init__(self, *risk_management_models):\n        '''Initializes a new instance of the CompositeRiskManagementModel class\n        Args:\n            risk_management_models: The individual risk management models defining this composite model.'''\n        for model in risk_management_models:\n            for attribute_names in [('ManageRisk', 'manage_risk'), ('OnSecuritiesChanged', 'on_securities_changed')]:\n                if not hasattr(model, attribute_names[0]) and not hasattr(model, attribute_names[1]):\n                    raise Exception(f'IRiskManagementModel.{attribute_names[1]} must be implemented. Please implement this missing method on {model.__class__.__name__}')\n\n        self.risk_management_models = risk_management_models\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance\n            targets: The current portfolio targets to be assessed for risk'''\n        for model in self.risk_management_models:\n            # take into account the possibility of ManageRisk returning nothing\n            risk_adjusted = model.manage_risk(algorithm, targets)\n\n            # produce a distinct set of new targets giving preference to newer targets\n            symbols = [x.symbol for x in risk_adjusted]\n            for target in targets:\n                if target.symbol not in symbols:\n                    risk_adjusted.append(target)\n\n            targets = risk_adjusted\n\n        return targets\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed.\n        This method patches this call through the each of the wrapped models.\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for model in self.risk_management_models:\n            model.on_securities_changed(algorithm, changes)\n\n    def add_risk_management(self, risk_management_model):\n        '''Adds a new 'IRiskManagementModel' instance\n        Args:\n            risk_management_model: The risk management model to add'''\n        self.risk_management_models.add(risk_management_model)\n"
  },
  {
    "path": "Algorithm/Risk/IRiskManagementModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Algorithm framework model that manages an algorithm's risk/downside\n    /// </summary>\n    public interface IRiskManagementModel : INotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets);\n    }\n}\n"
  },
  {
    "path": "Algorithm/Risk/NullRiskManagementModel.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that does nothing\n    /// </summary>\n    public class NullRiskManagementModel : RiskManagementModel\n    {\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            return Enumerable.Empty<IPortfolioTarget>();\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Risk/NullRiskManagementModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass NullRiskManagementModel(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that does nothing'''\n    def manage_risk(self, algorithm, targets):\n        return []\n"
  },
  {
    "path": "Algorithm/Risk/RiskManagementModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides a base class for risk management models\n    /// </summary>\n    public class RiskManagementModel : IRiskManagementModel\n    {\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public virtual IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            throw new System.NotImplementedException(\"Types deriving from 'RiskManagementModel' must implement the 'IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm, IPortfolioTarget[]) method.\");\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public virtual void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Risk/RiskManagementModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class RiskManagementModelPythonWrapper : RiskManagementModel\n    {\n        private readonly BasePythonWrapper<IRiskManagementModel> _model;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"IRiskManagementModel\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Model defining how risk is managed</param>\n        public RiskManagementModelPythonWrapper(PyObject model)\n        {\n            _model = new BasePythonWrapper<IRiskManagementModel>(model);\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            return _model.InvokeMethodAndEnumerate<IPortfolioTarget>(nameof(ManageRisk), algorithm, targets);\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            _model.InvokeMethod(nameof(OnSecuritiesChanged), algorithm, changes).Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/CompositeUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that combines multiple universe\n    /// selection models into a single model.\n    /// </summary>\n    public class CompositeUniverseSelectionModel : UniverseSelectionModel\n    {\n        private readonly List<IUniverseSelectionModel> _universeSelectionModels = new List<IUniverseSelectionModel>();\n        private bool _alreadyCalledCreateUniverses;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"universeSelectionModels\">The individual universe selection models defining this composite model</param>\n        public CompositeUniverseSelectionModel(params IUniverseSelectionModel[] universeSelectionModels)\n        {\n            if (universeSelectionModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 universe selection model for the CompositeUniverseSelectionModel\");\n            }\n\n            _universeSelectionModels.AddRange(universeSelectionModels);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"universeSelectionModels\">The individual universe selection models defining this composite model</param>\n        public CompositeUniverseSelectionModel(params PyObject[] universeSelectionModels)\n        {\n            if (universeSelectionModels.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Must specify at least 1 universe selection model for the CompositeUniverseSelectionModel\");\n            }\n\n            foreach (var pyUniverseSelectionModel in universeSelectionModels)\n            {\n                AddUniverseSelection(pyUniverseSelectionModel);\n            }\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"IUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"universeSelectionModel\">The universe selection model to add</param>\n        public void AddUniverseSelection(IUniverseSelectionModel universeSelectionModel)\n        {\n            _universeSelectionModels.Add(universeSelectionModel);\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"IUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"pyUniverseSelectionModel\">The universe selection model to add</param>\n        public void AddUniverseSelection(PyObject pyUniverseSelectionModel)\n        {\n            IUniverseSelectionModel selectionModel;\n            if (!pyUniverseSelectionModel.TryConvert(out selectionModel))\n            {\n                selectionModel = new UniverseSelectionModelPythonWrapper(pyUniverseSelectionModel);\n            }\n            _universeSelectionModels.Add(selectionModel);\n        }\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public override DateTime GetNextRefreshTimeUtc()\n        {\n            return _universeSelectionModels.Min(model => model.GetNextRefreshTimeUtc());\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            foreach (var universeSelectionModel in _universeSelectionModels)\n            {\n                var selectionRefreshTime = universeSelectionModel.GetNextRefreshTimeUtc();\n                var refreshTime = algorithm.UtcTime >= selectionRefreshTime;\n                if (!_alreadyCalledCreateUniverses // first initial call\n                    || refreshTime\n                    || selectionRefreshTime == DateTime.MaxValue)\n                {\n                    foreach (var universe in universeSelectionModel.CreateUniverses(algorithm))\n                    {\n                        yield return universe;\n                    }\n                }\n            }\n            _alreadyCalledCreateUniverses = true;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/CustomUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Defines a universe as a set of dynamically set symbols.\n    /// </summary>\n    public class CustomUniverse : UserDefinedUniverse\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"CustomUniverse\"/>\n        /// </summary>\n        public CustomUniverse(SubscriptionDataConfig configuration,\n            UniverseSettings universeSettings,\n            TimeSpan interval,\n            Func<DateTime, IEnumerable<string>> selector)\n            : base(configuration, universeSettings, interval, selector)\n        {\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            // CustomUniverse will return any existing SDC for the symbol, else will create new, using universe settings.\n            var existingSubscriptionDataConfigs = subscriptionService.GetSubscriptionDataConfigs(security.Symbol);\n\n            if (existingSubscriptionDataConfigs.Any())\n            {\n                return existingSubscriptionDataConfigs.Select(\n                    config => new SubscriptionRequest(isUniverseSubscription: false,\n                        universe: this,\n                        security: security,\n                        configuration: config,\n                        startTimeUtc: currentTimeUtc,\n                        endTimeUtc: maximumEndTimeUtc));\n            }\n            return base.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc, subscriptionService);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Selection/CustomUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that simply\n    /// subscribes to the specified set of symbols\n    /// </summary>\n    public class CustomUniverseSelectionModel : UniverseSelectionModel\n    {\n        private static readonly MarketHoursDatabase MarketHours = MarketHoursDatabase.FromDataFolder();\n        private readonly Symbol _symbol;\n        private readonly Func<DateTime, IEnumerable<string>> _selector;\n        private readonly UniverseSettings _universeSettings;\n        private readonly TimeSpan _interval;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CustomUniverseSelectionModel\"/> class\n        /// for <see cref=\"Market.USA\"/> and <see cref=\"SecurityType.Equity\"/>\n        /// using the algorithm's universe settings\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        public CustomUniverseSelectionModel(string name, Func<DateTime, IEnumerable<string>> selector)\n            : this(SecurityType.Equity, name, Market.USA, selector, null, Time.OneDay)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CustomUniverseSelectionModel\"/> class\n        /// for <see cref=\"Market.USA\"/> and <see cref=\"SecurityType.Equity\"/>\n        /// using the algorithm's universe settings\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        public CustomUniverseSelectionModel(string name, PyObject selector)\n            : this(SecurityType.Equity, name, Market.USA, selector, null, Time.OneDay)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CustomUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"securityType\">The security type of the universe</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"market\">The market of the universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        /// <param name=\"universeSettings\">The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings</param>\n        /// <param name=\"interval\">The interval at which selection should be performed</param>\n        public CustomUniverseSelectionModel(SecurityType securityType, string name, string market, Func<DateTime, IEnumerable<string>> selector, UniverseSettings universeSettings, TimeSpan interval)\n        {\n            _interval = interval;\n            _selector = selector;\n            _universeSettings = universeSettings;\n            _symbol = Symbol.Create($\"{name}-{securityType}-{market}\", securityType, market);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CustomUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"securityType\">The security type of the universe</param>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"market\">The market of the universe</param>\n        /// <param name=\"selector\">Function delegate that accepts a DateTime and returns a collection of string symbols</param>\n        /// <param name=\"universeSettings\">The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings</param>\n        /// <param name=\"interval\">The interval at which selection should be performed</param>\n        public CustomUniverseSelectionModel(SecurityType securityType, string name, string market, PyObject selector, UniverseSettings universeSettings, TimeSpan interval)\n            : this(\n                securityType,\n                name,\n                market,\n                selector.SafeAs<Func<DateTime, object>>().ConvertToUniverseSelectionStringDelegate(),\n                universeSettings,\n                interval\n            )\n        {\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called at algorithm start.\n        /// </summary>\n        /// <returns>The universes defined by this model</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            var universeSettings = _universeSettings ?? algorithm.UniverseSettings;\n            var entry = MarketHours.GetEntry(_symbol.ID.Market, (string)null, _symbol.SecurityType);\n\n            var config = new SubscriptionDataConfig(\n                universeSettings.Resolution == Resolution.Tick ? typeof(Tick) : typeof(TradeBar),\n                _symbol,\n                universeSettings.Resolution,\n                entry.DataTimeZone,\n                entry.ExchangeHours.TimeZone,\n                universeSettings.FillForward,\n                universeSettings.ExtendedMarketHours,\n                true\n            );\n\n            yield return new CustomUniverse(config, universeSettings, _interval, dt => Select(algorithm, dt));\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <param name=\"algorithm\"></param>\n        /// <param name=\"date\"></param>\n        /// <returns></returns>\n        public virtual IEnumerable<string> Select(QCAlgorithm algorithm, DateTime date)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Select), out IEnumerable<string> result, algorithm, date))\n            {\n                return result;\n            }\n\n            if (_selector == null)\n            {\n                throw new ArgumentNullException(nameof(_selector));\n            }\n\n            return _selector(date);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object\n        /// </summary>\n        public override string ToString() => _symbol.Value;\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/IUniverseSelectionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Algorithm framework model that defines the universes to be used by an algorithm\n    /// </summary>\n    public interface IUniverseSelectionModel\n    {\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        DateTime GetNextRefreshTimeUtc();\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm);\n    }\n}"
  },
  {
    "path": "Algorithm/Selection/ManualUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Defines a universe as a set of manually set symbols. This differs from <see cref=\"UserDefinedUniverse\"/>\n    /// in that these securities were not added via AddSecurity.\n    /// </summary>\n    /// <remarks>Incompatible with multiple <see cref=\"Universe\"/> selecting the same <see cref=\"Symbol\"/>.\n    /// with different <see cref=\"SubscriptionDataConfig\"/>. More information <see cref=\"GetSubscriptionRequests\"/></remarks>\n    public class ManualUniverse : UserDefinedUniverse\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ManualUniverse\"/>\n        /// </summary>\n        public ManualUniverse(SubscriptionDataConfig configuration,\n            UniverseSettings universeSettings,\n            IEnumerable<Symbol> symbols)\n            : base(configuration, universeSettings, Time.MaxTimeSpan, symbols)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ManualUniverse\"/>\n        /// </summary>\n        public ManualUniverse(SubscriptionDataConfig configuration,\n            UniverseSettings universeSettings,\n            Symbol[] symbols)\n            : base(configuration, universeSettings, Time.MaxTimeSpan, symbols)\n        {\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            // ManualUniverse will return any existing SDC for the symbol, else will create new, using universe settings.\n            // This is for maintaining existing behavior and preventing breaking changes: Specifically motivated\n            // by usages of Algorithm.Securities.Keys as constructor parameter of the ManualUniverseSelectionModel.\n            // Symbols at Algorithm.Securities.Keys added by Addxxx() calls will already be added by the UserDefinedUniverse.\n\n            var existingSubscriptionDataConfigs = subscriptionService.GetSubscriptionDataConfigs(security.Symbol);\n\n            if (existingSubscriptionDataConfigs.Any())\n            {\n                return existingSubscriptionDataConfigs.Select(\n                    config => new SubscriptionRequest(isUniverseSubscription: false,\n                        universe: this,\n                        security: security,\n                        configuration: config,\n                        startTimeUtc: currentTimeUtc,\n                        endTimeUtc: maximumEndTimeUtc));\n            }\n            return base.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc, subscriptionService);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Selection/ManualUniverseSelectionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that simply\n    /// subscribes to the specified set of symbols\n    /// </summary>\n    public class ManualUniverseSelectionModel : UniverseSelectionModel\n    {\n        private static readonly MarketHoursDatabase MarketHours = MarketHoursDatabase.FromDataFolder();\n\n        private readonly IReadOnlyList<Symbol> _symbols;\n        private readonly UniverseSettings _universeSettings;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualUniverseSelectionModel\"/> class using the algorithm's\n        /// security initializer and universe settings\n        /// </summary>\n        public ManualUniverseSelectionModel()\n            : this(Enumerable.Empty<Symbol>())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualUniverseSelectionModel\"/> class using the algorithm's\n        /// security initializer and universe settings\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to subscribe to.\n        /// Should not send in symbols at <see cref=\"QCAlgorithm.Securities\"/> since those will be managed by the <see cref=\"UserDefinedUniverse\"/></param>\n        public ManualUniverseSelectionModel(IEnumerable<Symbol> symbols)\n            : this(symbols.ToArray())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualUniverseSelectionModel\"/> class using the algorithm's\n        /// security initializer and universe settings\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to subscribe to\n        /// Should not send in symbols at <see cref=\"QCAlgorithm.Securities\"/> since those will be managed by the <see cref=\"UserDefinedUniverse\"/></param>\n        public ManualUniverseSelectionModel(params Symbol[] symbols)\n            : this (symbols?.AsEnumerable(), null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to subscribe to\n        /// Should not send in symbols at <see cref=\"QCAlgorithm.Securities\"/> since those will be managed by the <see cref=\"UserDefinedUniverse\"/></param>\n        /// <param name=\"universeSettings\">The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings</param>\n        public ManualUniverseSelectionModel(IEnumerable<Symbol> symbols, UniverseSettings universeSettings)\n        {\n            if (symbols == null)\n            {\n                throw new ArgumentNullException(nameof(symbols));\n            }\n\n            _symbols = symbols.Where(s => !s.IsCanonical()).ToList();\n            _universeSettings = universeSettings;\n\n            foreach (var symbol in _symbols)\n            {\n                SymbolCache.Set(symbol.Value, symbol);\n            }\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm.\n        /// Called at algorithm start.\n        /// </summary>\n        /// <returns>The universes defined by this model</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            var universeSettings = _universeSettings ?? algorithm.UniverseSettings;\n            var resolution = universeSettings.Resolution;\n            var type = resolution == Resolution.Tick ? typeof(Tick) : typeof(TradeBar);\n\n            // universe per security type/market\n            foreach (var grp in _symbols.GroupBy(s => new { s.ID.Market, s.SecurityType }))\n            {\n                MarketHoursDatabase.Entry entry;\n\n                var market = grp.Key.Market;\n                var securityType = grp.Key.SecurityType;\n                var hashCode = 1;\n                foreach (var symbol in grp)\n                {\n                    hashCode = hashCode * 31 + symbol.GetHashCode();\n                }\n                var universeSymbol = Symbol.Create($\"manual-universe-selection-model-{securityType}-{market}-{hashCode}\", securityType, market);\n                if (securityType == SecurityType.Base)\n                {\n                    // add an entry for this custom universe symbol -- we don't really know the time zone for sure,\n                    // but we set it to TimeZones.NewYork in AddData, also, since this is a manual universe, the time\n                    // zone doesn't actually matter since this universe specifically doesn't do anything with data.\n                    var symbolString = MarketHoursDatabase.GetDatabaseSymbolKey(universeSymbol);\n                    var alwaysOpen = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n                    entry = MarketHours.SetEntry(market, symbolString, securityType, alwaysOpen, TimeZones.NewYork);\n                }\n                else\n                {\n                    entry = MarketHours.GetEntry(market, (string) null, securityType);\n                }\n\n                var config = new SubscriptionDataConfig(type, universeSymbol, resolution, entry.DataTimeZone, entry.ExchangeHours.TimeZone, false, false, true);\n                yield return new ManualUniverse(config, universeSettings, grp);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/ManualUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom clr import GetClrType as typeof\n\nfrom Selection.UniverseSelectionModel import UniverseSelectionModel\nfrom itertools import groupby\n\nclass ManualUniverseSelectionModel(UniverseSelectionModel):\n    '''Provides an implementation of IUniverseSelectionModel that simply subscribes to the specified set of symbols'''\n\n    def __init__(self, symbols = list(), universe_settings = None):\n        self.marketHours = MarketHoursDatabase.from_data_folder()\n        self.symbols = symbols\n        self.universe_settings = universe_settings\n\n        for symbol in symbols:\n            SymbolCache.set(symbol.Value, symbol)\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates the universes for this algorithm. Called once after IAlgorithm.Initialize\n        Args:\n            algorithm: The algorithm instance to create universes for</param>\n        Returns:\n            The universes to be used by the algorithm'''\n        universe_settings = self.universe_settings \\\n            if self.universe_settings is not None else algorithm.universe_settings\n\n        resolution = universe_settings.resolution\n        type = typeof(Tick) if resolution == Resolution.TICK else typeof(TradeBar)\n\n        universes = list()\n\n        # universe per security type/market\n        self.symbols = sorted(self.symbols, key=lambda s: (s.id.market, s.security_type))\n        for key, grp in groupby(self.symbols, lambda s: (s.id.market, s.security_type)):\n\n            market = key[0]\n            security_type = key[1]\n            universe_symbol = Symbol.create(f\"manual-universe-selection-model-{security_type}-{market}\", security_type, market)\n\n            if security_type == SecurityType.BASE:\n                # add an entry for this custom universe symbol -- we don't really know the time zone for sure,\n                # but we set it to TimeZones.NewYork in AddData, also, since this is a manual universe, the time\n                # zone doesn't actually matter since this universe specifically doesn't do anything with data.\n                symbol_string = MarketHoursDatabase.get_database_symbol_key(universe_symbol)\n                always_open = SecurityExchangeHours.always_open(TimeZones.NEW_YORK)\n                entry = self.marketHours.set_entry(market, symbol_string, security_type, always_open, TimeZones.NEW_YORK)\n            else:\n                entry = self.marketHours.get_entry(market, None, security_type)\n\n            config = SubscriptionDataConfig(type, universe_symbol, resolution, entry.data_time_zone, entry.exchange_hours.time_zone, False, False, True)\n            universes.append( ManualUniverse(config, universe_settings, list(grp)))\n\n        return universes\n"
  },
  {
    "path": "Algorithm/Selection/NullUniverseSelectionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides a null implementation of <see cref=\"IUniverseSelectionModel\"/>\n    /// </summary>\n    public class NullUniverseSelectionModel : UniverseSelectionModel\n    {\n        /// <summary>\n        /// Creates the universes for this algorithm.\n        /// Called at algorithm start.\n        /// </summary>\n        /// <returns>The universes defined by this model</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            yield break;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/OptionChainedUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Securities.Future;\nusing Python.Runtime;\n\nnamespace QuantConnect.Algorithm.Selection\n{\n    /// <summary>\n    /// This universe selection model will chain to the security changes of a given <see cref=\"Universe\"/> selection\n    /// output and create a new <see cref=\"OptionChainUniverse\"/> for each of them\n    /// </summary>\n    public class OptionChainedUniverseSelectionModel : UniverseSelectionModel\n    {\n        private DateTime _nextRefreshTimeUtc;\n        private IEnumerable<Symbol> _currentSymbols;\n        private readonly UniverseSettings _universeSettings;\n        private readonly Func<OptionFilterUniverse, OptionFilterUniverse> _optionFilter;\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public override DateTime GetNextRefreshTimeUtc() => _nextRefreshTimeUtc;\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionChainedUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"universe\">The universe we want to chain to</param>\n        /// <param name=\"optionFilter\">The option filter universe to use</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public OptionChainedUniverseSelectionModel(Universe universe,\n            Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter,\n            UniverseSettings universeSettings = null)\n        {\n            _optionFilter = optionFilter;\n            _universeSettings = universeSettings;\n            _nextRefreshTimeUtc = DateTime.MaxValue;\n\n            _currentSymbols = Enumerable.Empty<Symbol>();\n            universe.SelectionChanged += (sender, args) =>\n            {\n                // the universe we were watching changed, this will trigger a call to CreateUniverses\n                _nextRefreshTimeUtc = DateTime.MinValue;\n\n                // We must create the new option Symbol using the CreateOption(Symbol, ...) overload.\n                // Otherwise, we'll end up loading equity data for the selected Symbol, which won't\n                // work whenever we're loading options data for any non-equity underlying asset class.\n                _currentSymbols = ((Universe.SelectionEventArgs)args).CurrentSelection\n                    .Select(symbol => Symbol.CreateOption(\n                        symbol,\n                        symbol.ID.Market,\n                        symbol.SecurityType.DefaultOptionStyle(),\n                        default(OptionRight),\n                        0m,\n                        SecurityIdentifier.DefaultDate))\n                    .ToList();\n            };\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionChainedUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"universe\">The universe we want to chain to</param>\n        /// <param name=\"optionFilter\">The python option filter universe to use</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public OptionChainedUniverseSelectionModel(Universe universe,\n            PyObject optionFilter,\n            UniverseSettings universeSettings = null): this(universe, ConvertOptionFilter(optionFilter), universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            _nextRefreshTimeUtc = DateTime.MaxValue;\n\n            foreach (var optionSymbol in _currentSymbols)\n            {\n                yield return algorithm.CreateOptionChain(optionSymbol, _optionFilter, _universeSettings);\n            }\n        }\n\n        private static Func<OptionFilterUniverse, OptionFilterUniverse> ConvertOptionFilter(PyObject optionFilter)\n        {\n            using (Py.GIL())\n            {\n                return optionFilter.SafeAs<Func<OptionFilterUniverse, OptionFilterUniverse>>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/OptionContractUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Selection\n{\n    /// <summary>\n    /// This universe will hold single option contracts and their underlying, managing removals and additions\n    /// </summary>\n    public class OptionContractUniverse : UserDefinedUniverse\n    {\n        private readonly HashSet<Symbol> _symbols;\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        /// <param name=\"configuration\">The universe configuration to use</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        public OptionContractUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings)\n            : base(AdjustUniverseConfiguration(configuration), universeSettings, Time.EndOfTimeTimeSpan,\n                // Argument isn't used since we override 'SelectSymbols'\n                Enumerable.Empty<Symbol>())\n        {\n            _symbols = new HashSet<Symbol>();\n        }\n\n        /// <summary>\n        /// Returns the symbols defined by the user for this universe\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _symbols;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"UserDefinedUniverse.CollectionChanged\"/> event\n        /// </summary>\n        /// <param name=\"e\">The notify collection changed event arguments</param>\n        protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Remove)\n            {\n                var removedSymbol = (Symbol)e.OldItems[0];\n                _symbols.Remove(removedSymbol);\n\n                // the option has been removed! This can happen when the user manually removed the option contract we remove the underlying\n                // but only if there isn't any other option selected using the same underlying!\n                if (removedSymbol.SecurityType.IsOption()\n                    && !_symbols.Any(symbol => symbol.SecurityType.IsOption() && symbol.Underlying == removedSymbol.Underlying))\n                {\n                    Remove(removedSymbol.Underlying);\n                }\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                // QCAlgorithm.AddOptionContract will add both underlying and option contract\n                _symbols.Add((Symbol)e.NewItems[0]);\n            }\n\n            base.OnCollectionChanged(e);\n        }\n\n        /// <summary>\n        /// Creates a user defined universe symbol\n        /// </summary>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"securityType\">The underlying option security type</param>\n        /// <returns>A symbol for user defined universe of the specified security type and market</returns>\n        public static Symbol CreateSymbol(string market, SecurityType securityType)\n        {\n            var ticker = $\"qc-universe-optioncontract-{securityType.SecurityTypeToLower()}-{market.ToLowerInvariant()}\";\n            var underlying = Symbol.Create(ticker, securityType, market);\n            var sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlying.ID, market, 0, 0, 0);\n\n            return new Symbol(sid, ticker);\n        }\n\n        /// <summary>\n        /// Make sure the configuration of the universe is what we want\n        /// </summary>\n        private static SubscriptionDataConfig AdjustUniverseConfiguration(SubscriptionDataConfig input)\n        {\n            return new SubscriptionDataConfig(input, fillForward: false);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/Selection/UniverseSelectionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides a base class for universe selection models.\n    /// </summary>\n    public class UniverseSelectionModel : BasePythonWrapper<UniverseSelectionModel>, IUniverseSelectionModel\n    {\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseSelectionModel\"/> class.\n        /// </summary>\n        public UniverseSelectionModel()\n        {\n        }\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public virtual DateTime GetNextRefreshTimeUtc()\n        {\n            return DateTime.MaxValue;\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public virtual IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            throw new NotImplementedException(\"Types deriving from 'UniverseSelectionModel' must implement the 'IEnumerable<Universe> CreateUniverses(QCAlgorithm) method.\");\n        }\n    }\n}"
  },
  {
    "path": "Algorithm/Selection/UniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass UniverseSelectionModel:\n    '''Provides a base class for universe selection models.'''\n\n    def get_next_refresh_time_utc(self) -> datetime:\n        '''Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.'''\n        if hasattr(self, \"GetNextRefreshTimeUtc\") and callable(self.GetNextRefreshTimeUtc):\n            return self.GetNextRefreshTimeUtc()\n        return datetime.max\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        Args:\n            algorithm: The algorithm instance to create universes for</param>\n        Returns:\n            The universes to be used by the algorithm'''\n        if hasattr(self, \"CreateUniverses\") and callable(self.CreateUniverses):\n            return self.CreateUniverses(algorithm)\n        raise NotImplementedError(\"Types deriving from 'UniverseSelectionModel' must implement the 'def CreateUniverses(QCAlgorithm) method.\")\n"
  },
  {
    "path": "Algorithm/Selection/UniverseSelectionModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class UniverseSelectionModelPythonWrapper : UniverseSelectionModel\n    {\n        private readonly bool _modelHasGetNextRefreshTime;\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public override DateTime GetNextRefreshTimeUtc()\n        {\n            if (!_modelHasGetNextRefreshTime)\n            {\n                return DateTime.MaxValue;\n            }\n\n            return InvokeMethod<DateTime>(nameof(GetNextRefreshTimeUtc));\n        }\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"IUniverseSelectionModel\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Model defining universes for the algorithm</param>\n        public UniverseSelectionModelPythonWrapper(PyObject model)\n        {\n            SetPythonInstance(model, false);\n            using (Py.GIL())\n            {\n                _modelHasGetNextRefreshTime = HasAttr(nameof(IUniverseSelectionModel.GetNextRefreshTimeUtc));\n\n                foreach (var attributeName in new[] { \"CreateUniverses\" })\n                {\n                    if (!HasAttr(attributeName))\n                    {\n                        throw new NotImplementedException($\"UniverseSelectionModel.{attributeName} must be implemented. Please implement this missing method on {model.GetPythonType()}\");\n                    }\n                }\n\n                var methodName = nameof(SetPythonInstance);\n                if (HasAttr(methodName))\n                {\n                    InvokeMethod(methodName, model);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            return InvokeMethodAndEnumerate<Universe>(nameof(CreateUniverses), algorithm);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm/UniverseDefinitions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm\n{\n    /// <summary>\n    /// Provides helpers for defining universes in algorithms\n    /// </summary>\n    public class UniverseDefinitions\n    {\n        private readonly QCAlgorithm _algorithm;\n\n        /// <summary>\n        /// Gets a helper that provides methods for creating universes based on daily dollar volumes\n        /// </summary>\n        public DollarVolumeUniverseDefinitions DollarVolume { get; set; }\n\n        /// <summary>\n        /// Specifies that universe selection should not make changes on this iteration\n        /// </summary>\n        public Universe.UnchangedUniverse Unchanged => Universe.Unchanged;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseDefinitions\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for obtaining the default <see cref=\"UniverseSettings\"/></param>\n        public UniverseDefinitions(QCAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n            DollarVolume = new DollarVolumeUniverseDefinitions(algorithm);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"market\">Market of the ETF</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(\n            string etfTicker,\n            string market,\n            UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            market ??= _algorithm.BrokerageModel.DefaultMarkets.TryGetValue(SecurityType.Equity, out var defaultMarket)\n                ? defaultMarket\n                : throw new Exception(\"No default market set for security type: Equity\");\n\n            var etfSymbol = new Symbol(\n                SecurityIdentifier.GenerateEquity(\n                    etfTicker,\n                    market,\n                    true,\n                    mappingResolveDate: _algorithm.Time.Date),\n                etfTicker);\n\n            return ETF(etfSymbol, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"market\">Market of the ETF</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(string etfTicker, string market, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return ETF(etfTicker, market, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(string etfTicker, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return ETF(etfTicker, null, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(\n            string etfTicker,\n            UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return ETF(etfTicker, null, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"market\">Market of the ETF</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(\n            string etfTicker,\n            string market = null,\n            UniverseSettings universeSettings = null,\n            PyObject universeFilterFunc = null)\n        {\n            return ETF(etfTicker, market, universeSettings, universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"etfTicker\"/>\n        /// </summary>\n        /// <param name=\"etfTicker\">Ticker of the ETF to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(\n            string etfTicker,\n            UniverseSettings universeSettings,\n            PyObject universeFilterFunc)\n        {\n            return ETF(etfTicker, null, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided ETF <paramref name=\"symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">ETF Symbol to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(Symbol symbol, UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return new ETFConstituentsUniverseFactory(symbol, universeSettings ?? _algorithm.UniverseSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided ETF <paramref name=\"symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">ETF Symbol to get constituents for</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(Symbol symbol, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return ETF(symbol, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided ETF <paramref name=\"symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">ETF Symbol to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New ETF constituents Universe</returns>\n        public Universe ETF(Symbol symbol, UniverseSettings universeSettings = null, PyObject universeFilterFunc = null)\n        {\n            return ETF(symbol, universeSettings ?? _algorithm.UniverseSettings,\n                universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"market\">Market of the index</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(string indexTicker, string market, UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            market ??= _algorithm.BrokerageModel.DefaultMarkets.TryGetValue(SecurityType.Index, out var defaultMarket)\n                ? defaultMarket\n                : throw new Exception(\"No default market set for security type: Index\");\n\n            return Index(\n                Symbol.Create(indexTicker, SecurityType.Index, market),\n                universeSettings,\n                universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"market\">Market of the index</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(string indexTicker, string market, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return Index(indexTicker, market, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(string indexTicker, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return Index(indexTicker, null, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(string indexTicker, UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return Index(indexTicker, null, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"market\">Market of the index</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(\n            string indexTicker,\n            string market = null,\n            UniverseSettings universeSettings = null,\n            PyObject universeFilterFunc = null)\n        {\n            return Index(indexTicker, market, universeSettings, universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexTicker\"/>\n        /// </summary>\n        /// <param name=\"indexTicker\">Ticker of the index to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(\n            string indexTicker,\n            UniverseSettings universeSettings,\n            PyObject universeFilterFunc)\n        {\n            return Index(indexTicker, null, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexSymbol\"/>\n        /// </summary>\n        /// <param name=\"indexSymbol\">Index Symbol to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(Symbol indexSymbol, UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return new ETFConstituentsUniverseFactory(indexSymbol, universeSettings, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexSymbol\"/>\n        /// </summary>\n        /// <param name=\"indexSymbol\">Index Symbol to get constituents for</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(Symbol indexSymbol, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            return Index(indexSymbol, null, universeFilterFunc);\n        }\n\n        /// <summary>\n        /// Creates a universe for the constituents of the provided <paramref name=\"indexSymbol\"/>\n        /// </summary>\n        /// <param name=\"indexSymbol\">Index Symbol to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        /// <returns>New index constituents Universe</returns>\n        public Universe Index(\n            Symbol indexSymbol,\n            UniverseSettings universeSettings = null,\n            PyObject universeFilterFunc = null)\n        {\n            return Index(indexSymbol, universeSettings ?? _algorithm.UniverseSettings,\n                universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());\n        }\n\n        /// <summary>\n        /// Creates a new fine universe that contains the constituents of QC500 index based onthe company fundamentals\n        /// The algorithm creates a default tradable and liquid universe containing 500 US equities\n        /// which are chosen at the first trading day of each month.\n        /// </summary>\n        /// <returns>A new coarse universe for the top count of stocks by dollar volume</returns>\n        public Universe QC500\n        {\n            get\n            {\n                return ETF(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA));\n            }\n        }\n\n        /// <summary>\n        /// Creates a new coarse universe that contains the top count of stocks\n        /// by daily dollar volume\n        /// </summary>\n        /// <param name=\"count\">The number of stock to select</param>\n        /// <param name=\"universeSettings\">The settings for stocks added by this universe.\n        /// Defaults to <see cref=\"QCAlgorithm.UniverseSettings\"/></param>\n        /// <returns>A new coarse universe for the top count of stocks by dollar volume</returns>\n        public Universe Top(int count, UniverseSettings universeSettings = null)\n        {\n            universeSettings ??= _algorithm.UniverseSettings;\n\n            var symbol = Symbol.Create(\"us-equity-dollar-volume-top-\" + count, SecurityType.Equity, Market.USA);\n            return FundamentalUniverse.USA(selectionData => (\n                from c in selectionData\n                orderby c.DollarVolume descending\n                select c.Symbol).Take(count),\n                universeSettings);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AccordVectorMachinesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.MachineLearning.VectorMachines.Learning;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Machine Learning example using Accord VectorMachines Learning\n    /// In this example, the algorithm forecasts the direction based on the last 5 days of rate of return\n    /// </summary>\n    public class AccordVectorMachinesAlgorithm : QCAlgorithm\n    {\n        // Define the size of the data used to train the model\n        // It will use _lookback sets with _inputSize members\n        // Those members are rate of return\n        private const int _lookback = 30;\n        private const int _inputSize = 5;\n        private RollingWindow<double> _window = new RollingWindow<double>(_inputSize * _lookback + 2);\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            var symbol = AddEquity(\"SPY\").Symbol;\n\n            ROC(symbol, 1, Resolution.Daily).Updated += (s, e) => _window.Add((double)e.Value);\n\n            Schedule.On(DateRules.Every(DayOfWeek.Monday),\n                TimeRules.AfterMarketOpen(symbol, 10),\n                TrainAndTrade);\n\n            SetWarmUp(_window.Size, Resolution.Daily);\n        }\n\n        private void TrainAndTrade()\n        {\n            if (!_window.IsReady) return;\n\n            // Convert the rolling window of rate of change into the Learn method\n            var returns = new double[_inputSize];\n            var targets = new double[_lookback];\n            var inputs = new double[_lookback][];\n\n            // Use the sign of the returns to predict the direction\n            for (var i = 0; i < _lookback; i++)\n            {\n                for (var j = 0; j < _inputSize; j++)\n                {\n                    returns[j] = Math.Sign(_window[i + j + 1]);\n                }\n\n                targets[i] = Math.Sign(_window[i]);\n                inputs[i] = returns;\n            }\n\n            // Train SupportVectorMachine using SetHoldings(\"SPY\", percentage);\n            var teacher = new LinearCoordinateDescent();\n            teacher.Learn(inputs, targets);\n\n            var svm = teacher.Model;\n\n            // Compute the value for the last rate of change\n            var last = (double) Math.Sign(_window[0]);\n            var value = svm.Compute(new[] {last});\n            if (value.IsNaNOrZero()) return;\n\n            SetHoldings(\"SPY\", Math.Sign(value));\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/> and <see cref=\"ConstantAlphaModel\"/>\n    /// generating a constant <see cref=\"Insight\"/> with a 0.25 confidence\n    /// </summary>\n    public class AccumulativeInsightPortfolioRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, 0.25));\n            SetPortfolioConstruction(new AccumulativeInsightPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (// holdings value should be 0.03 - to avoid price fluctuation issue we compare with 0.06 and 0.01\n                Portfolio.TotalHoldingsValue > Portfolio.TotalPortfolioValue * 0.06m\n                ||\n                Portfolio.TotalHoldingsValue < Portfolio.TotalPortfolioValue * 0.01m)\n            {\n                throw new RegressionTestException($\"Unexpected Total Holdings Value: {Portfolio.TotalHoldingsValue}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"199\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-12.611%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-0.585\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99827.80\"},\n            {\"Net Profit\", \"-0.172%\"},\n            {\"Sharpe Ratio\", \"-11.13\"},\n            {\"Sortino Ratio\", \"-16.704\"},\n            {\"Probabilistic Sharpe Ratio\", \"12.075%\"},\n            {\"Loss Rate\", \"78%\"},\n            {\"Win Rate\", \"22%\"},\n            {\"Profit-Loss Ratio\", \"0.87\"},\n            {\"Alpha\", \"-0.156\"},\n            {\"Beta\", \"0.035\"},\n            {\"Annual Standard Deviation\", \"0.008\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.603\"},\n            {\"Tracking Error\", \"0.215\"},\n            {\"Treynor Ratio\", \"-2.478\"},\n            {\"Total Fees\", \"$199.00\"},\n            {\"Estimated Strategy Capacity\", \"$26000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"119.89%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d06c26f557b83d8d42ac808fe2815a1e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddAlphaModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"QCAlgorithm.AddAlphaModel(IAlphaModel)\"/>\n    /// </summary>\n    public class AddAlphaModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private Symbol _fb;\n        private Symbol _ibm;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            _fb = QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA);\n            _ibm = QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            SetUniverseSelection(new ManualUniverseSelectionModel(_spy, _fb, _ibm));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            AddAlpha(new OneTimeAlphaModel(_spy));\n            AddAlpha(new OneTimeAlphaModel(_fb));\n            AddAlpha(new OneTimeAlphaModel(_ibm));\n\n            InsightsGenerated += OnInsightsGeneratedVerifier;\n        }\n\n        private void OnInsightsGeneratedVerifier(IAlgorithm algorithm,\n            GeneratedInsightsCollection insightsCollection)\n        {\n            if (insightsCollection.Insights.Count(insight => insight.Symbol == _fb) != 1\n                || insightsCollection.Insights.Count(insight => insight.Symbol == _spy) != 1\n                || insightsCollection.Insights.Count(insight => insight.Symbol == _ibm) != 1)\n            {\n                throw new RegressionTestException(\"Unexpected insights were emitted\");\n            }\n        }\n\n        private class OneTimeAlphaModel : AlphaModel\n        {\n            private readonly Symbol _symbol;\n            private bool _triggered;\n\n            public OneTimeAlphaModel(Symbol symbol)\n            {\n                _symbol = symbol;\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                if (!_triggered)\n                {\n                    _triggered = true;\n                    yield return Insight.Price(\n                        _symbol,\n                        Resolution.Daily,\n                        1,\n                        InsightDirection.Down\n                        );\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 58;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.86%\"},\n            {\"Average Loss\", \"-0.27%\"},\n            {\"Compounding Annual Return\", \"206.404%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"1.781\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101441.92\"},\n            {\"Net Profit\", \"1.442%\"},\n            {\"Sharpe Ratio\", \"4.836\"},\n            {\"Sortino Ratio\", \"10.481\"},\n            {\"Probabilistic Sharpe Ratio\", \"59.497%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"3.17\"},\n            {\"Alpha\", \"4.164\"},\n            {\"Beta\", \"-1.322\"},\n            {\"Annual Standard Deviation\", \"0.321\"},\n            {\"Annual Variance\", \"0.103\"},\n            {\"Information Ratio\", \"-0.795\"},\n            {\"Tracking Error\", \"0.532\"},\n            {\"Treynor Ratio\", \"-1.174\"},\n            {\"Total Fees\", \"$14.78\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"41.18%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"713c956deb193bed2290e9f379c0f9f9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #5748 where in some cases an option underlying symbol was not being\n    /// removed from all universes it was hold\n    /// </summary>\n    public class AddAndRemoveOptionContractRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contract;\n        private bool _hasRemoved;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n\n            var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            _contract = OptionChain(aapl)\n                .OrderBy(symbol => symbol.ID.OptionRight)\n                .ThenBy(symbol => symbol.ID.StrikePrice)\n                .ThenBy(symbol => symbol.ID.Date)\n                .ThenBy(symbol => symbol.ID)\n                .FirstOrDefault(optionContract => optionContract.ID.OptionRight == OptionRight.Call);\n            AddOptionContract(_contract);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.HasData)\n            {\n                if (!_hasRemoved)\n                {\n                    RemoveOptionContract(_contract);\n                    RemoveSecurity(_contract.Underlying);\n                    _hasRemoved = true;\n                }\n                else\n                {\n                    throw new RegressionTestException(\"Expect a single call to OnData where we removed the option and underlying\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasRemoved)\n            {\n                throw new RegressionTestException(\"Expect a single call to OnData where we removed the option and underlying\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 26;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddAndRemoveSecuritySameLoopRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #5971 where we add and remove an option in the same loop\n    /// </summary>\n    public class AddAndRemoveSecuritySameLoopRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contract;\n        private bool _hasRemoved;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n\n            var aapl = AddEquity(\"AAPL\").Symbol;\n\n            _contract = OptionChain(aapl)\n                .OrderBy(x => x.ID.Symbol)\n                .FirstOrDefault(optionContract => optionContract.ID.OptionRight == OptionRight.Call\n                    && optionContract.ID.OptionStyle == OptionStyle.American);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_hasRemoved)\n            {\n                throw new RegressionTestException(\"Expect a single call to OnData where we removed the option and underlying\");\n            }\n\n            _hasRemoved = true;\n            AddOptionContract(_contract);\n\n            // changed my mind!\n            RemoveOptionContract(_contract);\n            RemoveSecurity(_contract.Underlying);\n\n            RemoveSecurity(AddEquity(\"SPY\", Resolution.Daily).Symbol);\n        }\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasRemoved)\n            {\n                throw new RegressionTestException(\"We did not remove the option contract!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 25;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\n\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to explain how Beta indicator works\n    /// </summary>\n    public class AddBetaIndicatorNewAssetsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Beta _beta;\n        private SimpleMovingAverage _sma;\n        private decimal _lastSMAValue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 05, 08);\n            SetEndDate(2017, 06, 15);\n            SetCash(10000);\n\n            AddCrypto(\"BTCUSD\", Resolution.Daily);\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            EnableAutomaticIndicatorWarmUp = true;\n            _beta = B(\"BTCUSD\", \"SPY\", 3, Resolution.Daily);\n            _sma = SMA(\"SPY\", 3, Resolution.Daily);\n            _lastSMAValue = 0;\n\n            if (!_beta.IsReady)\n            {\n                throw new RegressionTestException(\"Beta indicator was expected to be ready\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var price = Securities[\"BTCUSD\"].Price;\n\n            if (!Portfolio.Invested)\n            {\n                var quantityToBuy = (int)(Portfolio.Cash * 0.05m / price);\n                Buy(\"BTCUSD\", quantityToBuy);\n            }\n\n            if (Math.Abs(_beta.Current.Value) > 2)\n            {\n                Liquidate(\"BTCUSD\");\n                Log(\"Liquidated BTCUSD due to high Beta\");\n            }\n\n            Log($\"Beta between BTCUSD and SPY is: {_beta.Current.Value}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            var goUpwards = _lastSMAValue < _sma.Current.Value;\n            _lastSMAValue = _sma.Current.Value;\n\n            if (order.Status == OrderStatus.Filled)\n            {\n                if (order.Type == OrderType.Limit && Math.Abs(_beta.Current.Value - 1) < 0.2m && goUpwards)\n                {\n                    Transactions.CancelOpenOrders(order.Symbol);\n                }\n            }\n\n            if (order.Status == OrderStatus.Canceled)\n            {\n                Log(orderEvent.ToString());\n            }\n        }\n\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5798;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 26;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"436\"},\n            {\"Average Win\", \"0.28%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"1.925%\"},\n            {\"Drawdown\", \"1.000%\"},\n            {\"Expectancy\", \"1.649\"},\n            {\"Start Equity\", \"10000.00\"},\n            {\"End Equity\", \"10410.99\"},\n            {\"Net Profit\", \"4.110%\"},\n            {\"Sharpe Ratio\", \"0.332\"},\n            {\"Sortino Ratio\", \"0.313\"},\n            {\"Probabilistic Sharpe Ratio\", \"74.084%\"},\n            {\"Loss Rate\", \"90%\"},\n            {\"Win Rate\", \"10%\"},\n            {\"Profit-Loss Ratio\", \"25.25\"},\n            {\"Alpha\", \"0.003\"},\n            {\"Beta\", \"0.001\"},\n            {\"Annual Standard Deviation\", \"0.01\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.495\"},\n            {\"Tracking Error\", \"0.111\"},\n            {\"Treynor Ratio\", \"2.716\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$87000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"2.22%\"},\n            {\"Drawdown Recovery\", \"139\"},\n            {\"OrderListHash\", \"896ecc92440d51ed26644aac5b8706e4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddBetaIndicatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to explain how Beta indicator works\n    /// </summary>\n    public class AddBetaIndicatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Beta _beta;\n        private SimpleMovingAverage _sma;\n        private decimal _lastSMAValue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 15);\n            SetCash(10000);\n\n            AddEquity(\"IBM\");\n            AddEquity(\"SPY\");\n\n            EnableAutomaticIndicatorWarmUp = true;\n            _beta = B(\"IBM\", \"SPY\", 3, Resolution.Daily);\n            _sma = SMA(\"SPY\", 3, Resolution.Daily);\n            _lastSMAValue = 0;\n\n            if (!_beta.IsReady)\n            {\n                throw new RegressionTestException(\"Beta indicator was expected to be ready\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var price = slice[\"IBM\"].Close;\n                Buy(\"IBM\", 10);\n                LimitOrder(\"IBM\", 10, price * 0.1m);\n                StopMarketOrder(\"IBM\", 10, price / 0.1m);\n            }\n\n            if (_beta.Current.Value < 0m || _beta.Current.Value > 2.80m)\n            {\n                throw new RegressionTestException($\"_beta value was expected to be between 0 and 2.80 but was {_beta.Current.Value}\");\n            }\n\n            Log($\"Beta between IBM and SPY is: {_beta.Current.Value}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            var goUpwards = _lastSMAValue < _sma.Current.Value;\n            _lastSMAValue = _sma.Current.Value;\n\n            if (order.Status == OrderStatus.Filled)\n            {\n                if (order.Type == OrderType.Limit && Math.Abs(_beta.Current.Value - 1) < 0.2m && goUpwards)\n                {\n                    Transactions.CancelOpenOrders(order.Symbol);\n                }\n            }\n\n            if (order.Status == OrderStatus.Canceled)\n            {\n                Log(orderEvent.ToString());\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10977;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 11;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"12.939%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10028.93\"},\n            {\"Net Profit\", \"0.289%\"},\n            {\"Sharpe Ratio\", \"3.924\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"68.349%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.028\"},\n            {\"Beta\", \"0.122\"},\n            {\"Annual Standard Deviation\", \"0.024\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-3.181\"},\n            {\"Tracking Error\", \"0.142\"},\n            {\"Treynor Ratio\", \"0.78\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$35000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"1.51%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"1db1ce949db995bba20ed96ea5e2438a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureContractWithContinuousRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// and a future contract at the same time\n    /// </summary>\n    public class AddFutureContractWithContinuousRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Future _futureContract;\n        private bool _ended;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 10);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0\n            );\n\n            _futureContract = AddFutureContract(FuturesChain(_continuousContract.Symbol).First());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_ended)\n            {\n                throw new RegressionTestException($\"Algorithm should of ended!\");\n            }\n            if (slice.Keys.Count > 2)\n            {\n                throw new RegressionTestException($\"Getting data for more than 2 symbols! {string.Join(\",\", slice.Keys.Select(symbol => symbol))}\");\n            }\n            if (UniverseManager.Count != 3)\n            {\n                throw new RegressionTestException($\"Expecting 3 universes (chain, continuous and user defined) but have {UniverseManager.Count}\");\n            }\n\n            if (!Portfolio.Invested)\n            {\n                Buy(_futureContract.Symbol, 1);\n                Buy(_continuousContract.Mapped, 1);\n\n                RemoveSecurity(_futureContract.Symbol);\n                RemoveSecurity(_continuousContract.Symbol);\n\n                _ended = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n\n            if (changes.AddedSecurities.Any(security => security.Symbol != _continuousContract.Symbol && security.Symbol != _futureContract.Symbol)\n                || changes.RemovedSecurities.Any(security => security.Symbol != _continuousContract.Symbol && security.Symbol != _futureContract.Symbol))\n            {\n                throw new RegressionTestException($\"We got an unexpected security changes {changes}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 61;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.10%\"},\n            {\"Compounding Annual Return\", \"-14.232%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99803.9\"},\n            {\"Net Profit\", \"-0.196%\"},\n            {\"Sharpe Ratio\", \"-7.95\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.128\"},\n            {\"Beta\", \"0.026\"},\n            {\"Annual Standard Deviation\", \"0.016\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.186\"},\n            {\"Tracking Error\", \"0.237\"},\n            {\"Treynor Ratio\", \"-4.747\"},\n            {\"Total Fees\", \"$8.60\"},\n            {\"Estimated Strategy Capacity\", \"$2000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VU1EHIDJYLMP\"},\n            {\"Portfolio Turnover\", \"66.50%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4720516462fcabb4db1aead46051cb4a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests that we receive the expected data when\n    /// we add future option contracts individually using <see cref=\"AddFutureOptionContract\"/>\n    /// </summary>\n    public class AddFutureOptionContractDataStreamingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _onDataReached;\n        private bool _invested;\n        private Symbol _es20h20;\n        private Symbol _es19m20;\n\n        private readonly HashSet<Symbol> _symbolsReceived = new HashSet<Symbol>();\n        private readonly HashSet<Symbol> _expectedSymbolsReceived = new HashSet<Symbol>();\n        private readonly Dictionary<Symbol, List<QuoteBar>> _dataReceived = new Dictionary<Symbol, List<QuoteBar>>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 4);\n            SetEndDate(2020, 1, 8);\n\n            _es20h20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute).Symbol;\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Get option contract lists for 2020/01/05 (Time.AddDays(1)) because Lean has local data for that date\n            var optionChains = OptionChainProvider.GetOptionContractList(_es20h20, Time.AddDays(1))\n                .Concat(OptionChainProvider.GetOptionContractList(_es19m20, Time.AddDays(1)));\n\n            foreach (var optionContract in optionChains)\n            {\n                _expectedSymbolsReceived.Add(AddFutureOptionContract(optionContract, Resolution.Minute).Symbol);\n            }\n\n            if (_expectedSymbolsReceived.Count == 0)\n            {\n                throw new InvalidOperationException(\"Expected Symbols receive count is 0, expected >0\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.HasData)\n            {\n                return;\n            }\n\n            _onDataReached = true;\n\n            var hasOptionQuoteBars = false;\n            foreach (var qb in slice.QuoteBars.Values)\n            {\n                if (qb.Symbol.SecurityType != SecurityType.FutureOption)\n                {\n                    continue;\n                }\n\n                hasOptionQuoteBars = true;\n\n                _symbolsReceived.Add(qb.Symbol);\n                if (!_dataReceived.ContainsKey(qb.Symbol))\n                {\n                    _dataReceived[qb.Symbol] = new List<QuoteBar>();\n                }\n\n                _dataReceived[qb.Symbol].Add(qb);\n            }\n\n            if (_invested || !hasOptionQuoteBars)\n            {\n                return;\n            }\n\n            if (slice.ContainsKey(_es20h20) && slice.ContainsKey(_es19m20))\n            {\n                SetHoldings(_es20h20, 0.2);\n                SetHoldings(_es19m20, 0.2);\n\n                _invested = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            base.OnEndOfAlgorithm();\n\n            if (!_onDataReached)\n            {\n                throw new RegressionTestException(\"OnData() was never called.\");\n            }\n            if (_symbolsReceived.Count != _expectedSymbolsReceived.Count)\n            {\n                throw new AggregateException($\"Expected {_expectedSymbolsReceived.Count} option contracts Symbols, found {_symbolsReceived.Count}\");\n            }\n\n            var missingSymbols = new List<Symbol>();\n            foreach (var expectedSymbol in _expectedSymbolsReceived)\n            {\n                if (!_symbolsReceived.Contains(expectedSymbol))\n                {\n                    missingSymbols.Add(expectedSymbol);\n                }\n            }\n\n            if (missingSymbols.Count > 0)\n            {\n                throw new RegressionTestException($\"Symbols: \\\"{string.Join(\", \", missingSymbols)}\\\" were not found in OnData\");\n            }\n\n            foreach (var expectedSymbol in _expectedSymbolsReceived)\n            {\n                var data = _dataReceived[expectedSymbol];\n                var nonDupeDataCount = data.Select(x =>\n                {\n                    x.EndTime = default(DateTime);\n                    return x;\n                }).Distinct().Count();\n\n                if (nonDupeDataCount < 1000)\n                {\n                    throw new RegressionTestException($\"Received too few data points. Expected >=1000, found {nonDupeDataCount} for {expectedSymbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 311881;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"5512.811%\"},\n            {\"Drawdown\", \"1.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"105332.8\"},\n            {\"Net Profit\", \"5.333%\"},\n            {\"Sharpe Ratio\", \"64.084\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.977%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"25.763\"},\n            {\"Beta\", \"2.914\"},\n            {\"Annual Standard Deviation\", \"0.423\"},\n            {\"Annual Variance\", \"0.179\"},\n            {\"Information Ratio\", \"66.11\"},\n            {\"Tracking Error\", \"0.403\"},\n            {\"Treynor Ratio\", \"9.308\"},\n            {\"Total Fees\", \"$8.60\"},\n            {\"Estimated Strategy Capacity\", \"$22000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"122.11%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d744fa8beaa60546c84924ed68d945d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureOptionContractFromFutureChainRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests we can add future option contracts from contracts in the future chain\n    /// </summary>\n    public class AddFutureOptionContractFromFutureChainRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _addedOptions;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 4);\n            SetEndDate(2020, 1, 6);\n\n            var es = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, Market.CME);\n            es.SetFilter((futureFilter) =>\n            {\n                return futureFilter.Expiration(0, 365).ExpirationCycle(new[] { 3, 6 });\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_addedOptions)\n            {\n                _addedOptions = true;\n                foreach (var futuresContracts in slice.FutureChains.Values)\n                {\n                    foreach (var contract in futuresContracts)\n                    {\n                        var option_contract_symbols = OptionChain(contract.Symbol).ToList();\n                        if(option_contract_symbols.Count == 0)\n                        {\n                            continue;\n                        }\n\n                        foreach (var option_contract_symbol in option_contract_symbols.OrderBy(x => x.ID.Date)\n                            .ThenBy(x => x.ID.StrikePrice)\n                            .ThenBy(x => x.ID.OptionRight).Take(5))\n                        {\n                            AddOptionContract(option_contract_symbol);\n                        }\n                    }\n                }\n            }\n\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            foreach (var chain in slice.OptionChains.Values)\n            {\n                foreach (var option in chain.Contracts.Keys)\n                {\n                    MarketOrder(option, 1);\n                    MarketOrder(option.Underlying, 1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 9922;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"20\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"88398927.578%\"},\n            {\"Drawdown\", \"5.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"111911.55\"},\n            {\"Net Profit\", \"11.912%\"},\n            {\"Sharpe Ratio\", \"1604181.904\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"2144882.02\"},\n            {\"Beta\", \"31.223\"},\n            {\"Annual Standard Deviation\", \"1.337\"},\n            {\"Annual Variance\", \"1.788\"},\n            {\"Information Ratio\", \"1657259.526\"},\n            {\"Tracking Error\", \"1.294\"},\n            {\"Treynor Ratio\", \"68696.045\"},\n            {\"Total Fees\", \"$35.70\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"ES 31C3JQS9DCF1G|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"495.15%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"af830085995d0b8fa0d33a6e80dd1241\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureOptionContractWithInternalMappedUnderlyingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting AddFutureOptionContract does not throw even when the underlying security configurations are internal\n    /// </summary>\n    public class AddFutureOptionContractWithInternalMappedUnderlyingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Option _fopContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 04);\n            SetEndDate(2020, 01 , 06);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Any(security => security.Symbol == _continuousContract.Symbol))\n            {\n                if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_continuousContract.Mapped).Count != 0 ||\n                    SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_continuousContract.Mapped, includeInternalConfigs: true).Count == 0)\n                {\n                    throw new RegressionTestException(\"Continuous future underlying should only have internal subscription configs\");\n                }\n\n                var contract = OptionChain(_continuousContract.Mapped).FirstOrDefault()?.Symbol;\n\n                try\n                {\n                    _fopContract = AddFutureOptionContract(contract);\n                }\n                catch (Exception e)\n                {\n                    throw new RegressionTestException($\"Failed to add future option contract {contract}\", e);\n                }\n            }\n            else if (_fopContract != null && changes.AddedSecurities.Any(security => security.Symbol == _fopContract.Symbol))\n            {\n                var underlyingSubscriptions = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_fopContract.Symbol.Underlying);\n                if (underlyingSubscriptions.Any(x => x.DataNormalizationMode == DataNormalizationMode.Raw))\n                {\n                    throw new RegressionTestException(\"Future option underlying should not have raw data normalization mode\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_fopContract == null)\n            {\n                throw new RegressionTestException(\"Failed to add future option contract\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3181;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-14.395\"},\n            {\"Tracking Error\", \"0.043\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests that we only receive the option chain for a single future contract\n    /// in the option universe filter.\n    /// </summary>\n    public class AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _invested;\n        private bool _onDataReached;\n        private bool _optionFilterRan;\n        private readonly HashSet<Symbol> _symbolsReceived = new HashSet<Symbol>();\n        private readonly HashSet<Symbol> _expectedSymbolsReceived = new HashSet<Symbol>();\n        private readonly Dictionary<Symbol, List<QuoteBar>> _dataReceived = new Dictionary<Symbol, List<QuoteBar>>();\n\n        private Future _es;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 4);\n            SetEndDate(2020, 1, 8);\n\n            _es = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, Market.CME);\n            _es.SetFilter((futureFilter) =>\n            {\n                return futureFilter.Expiration(0, 365).ExpirationCycle(new[] { 3, 6 });\n            });\n\n            AddFutureOption(_es.Symbol, optionContracts =>\n            {\n                _optionFilterRan = true;\n\n                var expiry = new HashSet<DateTime>(optionContracts.Select(x => x.Symbol.Underlying.ID.Date)).SingleOrDefault();\n                // Cast to List<Symbol> because OptionFilterContract overrides some LINQ operators like `Select` and `Where`\n                // and cause it to mutate the underlying Symbol collection when using those operators.\n                var symbol = new HashSet<Symbol>(((List<Symbol>)optionContracts).Select(x => x.Underlying)).SingleOrDefault();\n\n                if (expiry == null || symbol == null)\n                {\n                    throw new InvalidOperationException(\"Expected a single Option contract in the chain, found 0 contracts\");\n                }\n\n                var enumerator = optionContracts.GetEnumerator();\n                while (enumerator.MoveNext())\n                {\n                    _expectedSymbolsReceived.Add(enumerator.Current);\n                }\n\n                return optionContracts;\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.HasData)\n            {\n                return;\n            }\n\n            _onDataReached = true;\n\n            var hasOptionQuoteBars = false;\n            foreach (var qb in slice.QuoteBars.Values)\n            {\n                if (qb.Symbol.SecurityType != SecurityType.FutureOption)\n                {\n                    continue;\n                }\n\n                hasOptionQuoteBars = true;\n\n                _symbolsReceived.Add(qb.Symbol);\n                if (!_dataReceived.ContainsKey(qb.Symbol))\n                {\n                    _dataReceived[qb.Symbol] = new List<QuoteBar>();\n                }\n\n                _dataReceived[qb.Symbol].Add(qb);\n            }\n\n            if (_invested || !hasOptionQuoteBars)\n            {\n                return;\n            }\n\n            foreach (var chain in slice.OptionChains.Values.OrderBy(x => x.Symbol.Underlying.ID.Date))\n            {\n                var futureInvested = false;\n                var optionInvested = false;\n\n                foreach (var option in chain.Contracts.Keys)\n                {\n                    if (futureInvested && optionInvested)\n                    {\n                        return;\n                    }\n\n                    var future = option.Underlying;\n\n                    if (!optionInvested && slice.ContainsKey(option))\n                    {\n                        var optionContract = Securities[option];\n                        var marginModel = optionContract.BuyingPowerModel as FuturesOptionsMarginModel;\n                        if (marginModel.InitialIntradayMarginRequirement == 0\n                            || marginModel.InitialOvernightMarginRequirement == 0\n                            || marginModel.MaintenanceIntradayMarginRequirement == 0\n                            || marginModel.MaintenanceOvernightMarginRequirement == 0)\n                        {\n                            throw new RegressionTestException(\"Unexpected margin requirements\");\n                        }\n\n                        if (marginModel.GetInitialMarginRequirement(optionContract, 1) == 0)\n                        {\n                            throw new RegressionTestException(\"Unexpected Initial Margin requirement\");\n                        }\n                        if (marginModel.GetMaintenanceMargin(optionContract) != 0)\n                        {\n                            throw new RegressionTestException(\"Unexpected Maintenance Margin requirement\");\n                        }\n\n                        MarketOrder(option, 1);\n                        _invested = true;\n                        optionInvested = true;\n\n                        if (marginModel.GetMaintenanceMargin(optionContract) == 0)\n                        {\n                            throw new RegressionTestException(\"Unexpected Maintenance Margin requirement\");\n                        }\n                    }\n                    if (!futureInvested && slice.ContainsKey(future))\n                    {\n                        MarketOrder(future, 1);\n                        _invested = true;\n                        futureInvested = true;\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_optionFilterRan)\n            {\n                throw new InvalidOperationException(\"Option chain filter was never ran\");\n            }\n            if (!_onDataReached)\n            {\n                throw new RegressionTestException(\"OnData() was never called.\");\n            }\n            if (_symbolsReceived.Count != _expectedSymbolsReceived.Count)\n            {\n                throw new AggregateException($\"Expected {_expectedSymbolsReceived.Count} option contracts Symbols, found {_symbolsReceived.Count}\");\n            }\n\n            var missingSymbols = new List<Symbol>();\n            foreach (var expectedSymbol in _expectedSymbolsReceived)\n            {\n                if (!_symbolsReceived.Contains(expectedSymbol))\n                {\n                    missingSymbols.Add(expectedSymbol);\n                }\n            }\n\n            if (missingSymbols.Count > 0)\n            {\n                throw new RegressionTestException($\"Symbols: \\\"{string.Join(\", \", missingSymbols)}\\\" were not found in OnData\");\n            }\n\n            foreach (var expectedSymbol in _expectedSymbolsReceived)\n            {\n                var data = _dataReceived[expectedSymbol];\n                var nonDupeDataCount = data.Select(x =>\n                {\n                    x.EndTime = default(DateTime);\n                    return x;\n                }).Distinct().Count();\n\n                if (nonDupeDataCount < 1000)\n                {\n                    throw new RegressionTestException($\"Received too few data points. Expected >=1000, found {nonDupeDataCount} for {expectedSymbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 319494;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"430.834%\"},\n            {\"Drawdown\", \"4.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102313.03\"},\n            {\"Net Profit\", \"2.313%\"},\n            {\"Sharpe Ratio\", \"17.721\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.977%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"2.663\"},\n            {\"Beta\", \"1.264\"},\n            {\"Annual Standard Deviation\", \"0.184\"},\n            {\"Annual Variance\", \"0.034\"},\n            {\"Information Ratio\", \"16.514\"},\n            {\"Tracking Error\", \"0.169\"},\n            {\"Treynor Ratio\", \"2.574\"},\n            {\"Total Fees\", \"$3.57\"},\n            {\"Estimated Strategy Capacity\", \"$28000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLCA62LNO|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"33.84%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7c82013ecabca41591e0253a477025dd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddFutureUniverseSelectionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing System;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to use the FutureUniverseSelectionModel to select futures contracts for a given underlying asset.\n    /// The model is set to update daily, and the algorithm ensures that the selected contracts meet specific criteria.\n    /// This also includes a check to ensure that only future contracts are added to the algorithm's universe.\n    /// </summary>\n    public class AddFutureUniverseSelectionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            SetUniverseSelection(new FutureUniverseSelectionModel(\n                TimeSpan.FromDays(1),\n                time => new List<Symbol> {\n                    QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME)\n                }\n            ));\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Count > 0)\n            {\n                foreach (var security in changes.AddedSecurities)\n                {\n                    if (security.Symbol.SecurityType != SecurityType.Future)\n                    {\n                        throw new RegressionTestException($\"Expected future security, but found '{security.Symbol.SecurityType}'\");\n                    }\n                    if (security.Symbol.ID.Symbol != \"ES\")\n                    {\n                        throw new RegressionTestException($\"Expected future symbol 'ES', but found '{security.Symbol.ID.Symbol}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (ActiveSecurities.Count == 0)\n            {\n                throw new RegressionTestException(\"No active securities found. Expected at least one active security\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 26094;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-66.775\"},\n            {\"Tracking Error\", \"0.243\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddOptionContractExpiresRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// We add an option contract using <see cref=\"QCAlgorithm.AddOptionContract\"/> and place a trade and wait till it expires\n    /// later will liquidate the resulting equity position and assert both option and underlying get removed\n    /// </summary>\n    public class AddOptionContractExpiresRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _expiration = new DateTime(2014, 06, 21);\n        private Symbol _option;\n        private Symbol _twx;\n        private bool _traded;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 30);\n\n            _twx = QuantConnect.Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n\n            AddUniverse(\"my-daily-universe-name\", time => new List<string> { \"AAPL\" });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_option == null)\n            {\n                var option = OptionChain(_twx)\n                    .OrderBy(x => x.ID.Symbol)\n                    .FirstOrDefault(optionContract => optionContract.ID.Date == _expiration\n                                                      && optionContract.ID.OptionRight == OptionRight.Call\n                                                      && optionContract.ID.OptionStyle == OptionStyle.American);\n                if (option != null)\n                {\n                    _option = AddOptionContract(option).Symbol;\n                }\n            }\n\n            if (_option != null && Securities[_option].Price != 0 && !_traded)\n            {\n                _traded = true;\n                Buy(_option, 1);\n\n                foreach (var symbol in new [] { _option, _option.Underlying })\n                {\n                    var config = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol).ToList();\n\n                    if (!config.Any())\n                    {\n                        throw new RegressionTestException($\"Was expecting configurations for {symbol}\");\n                    }\n                    if (config.Any(dataConfig => dataConfig.DataNormalizationMode != DataNormalizationMode.Raw))\n                    {\n                        throw new RegressionTestException($\"Was expecting DataNormalizationMode.Raw configurations for {symbol}\");\n                    }\n                }\n            }\n\n            if (Time.Date > _expiration)\n            {\n                if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_option).Any())\n                {\n                    throw new RegressionTestException($\"Unexpected configurations for {_option} after it has been delisted\");\n                }\n\n                if (Securities[_twx].Invested)\n                {\n                    if (!SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_twx).Any())\n                    {\n                        throw new RegressionTestException($\"Was expecting configurations for {_twx}\");\n                    }\n\n                    // first we liquidate the option exercised position\n                    Liquidate(_twx);\n                }\n            }\n            else if (Time.Date > _expiration && !Securities[_twx].Invested)\n            {\n                if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_twx).Any())\n                {\n                    throw new RegressionTestException($\"Unexpected configurations for {_twx} after it has been liquidated\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 37598;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"2.73%\"},\n            {\"Average Loss\", \"-2.98%\"},\n            {\"Compounding Annual Return\", \"-4.619%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-0.042\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99668\"},\n            {\"Net Profit\", \"-0.332%\"},\n            {\"Sharpe Ratio\", \"-4.614\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.427%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.92\"},\n            {\"Alpha\", \"-0.022\"},\n            {\"Beta\", \"-0.012\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.823\"},\n            {\"Tracking Error\", \"0.049\"},\n            {\"Treynor Ratio\", \"2.01\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$5700000.00\"},\n            {\"Lowest Capacity Asset\", \"AOL VRKS95ENPM9Y|AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.55%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d314aef81752b6583fd58f9e49054cd4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddOptionContractFromUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// We add an option contract using <see cref=\"QCAlgorithm.AddOptionContract\"/> and place a trade, the underlying\n    /// gets deselected from the universe selection but should still be present since we manually added the option contract.\n    /// Later we call <see cref=\"QCAlgorithm.RemoveOptionContract\"/> and expect both option and underlying to be removed.\n    /// </summary>\n    public class AddOptionContractFromUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _expiration = new DateTime(2014, 06, 21);\n        private SecurityChanges _securityChanges = SecurityChanges.None;\n        private Symbol _option;\n        private Symbol _aapl;\n        private Symbol _twx;\n        private bool _traded;\n\n        public override void Initialize()\n        {\n            _twx = QuantConnect.Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n            _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            UniverseSettings.Resolution = Resolution.Minute;\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n\n            AddUniverse(enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl },\n                enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_option != null && Securities[_option].Price != 0 && !_traded)\n            {\n                _traded = true;\n                Buy(_option, 1);\n            }\n\n            if (Time.Date > new DateTime(2014, 6, 5))\n            {\n                if (Time < new DateTime(2014, 6, 6, 14, 0, 0))\n                {\n                    var configs = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_twx);\n                    // assert underlying still there after the universe selection removed it, still used by the manually added option contract\n                    if (!configs.Any())\n                    {\n                        throw new RegressionTestException($\"Was expecting configurations for {_twx}\" +\n                                            $\" even after it has been deselected from coarse universe because we still have the option contract.\");\n                    }\n                }\n                else if (Time == new DateTime(2014, 6, 6, 14, 0, 0))\n                {\n                    // liquidate & remove the option\n                    RemoveOptionContract(_option);\n                }\n                // assert underlying was finally removed\n                else if(Time > new DateTime(2014, 6, 6, 14, 0, 0))\n                {\n                    foreach (var symbol in new[] { _option, _option.Underlying })\n                    {\n                        var configs = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol);\n                        if (configs.Any())\n                        {\n                            throw new RegressionTestException($\"Unexpected configuration for {symbol} after it has been deselected from coarse universe and option contract is removed.\");\n                        }\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (_securityChanges.RemovedSecurities.Intersect(changes.RemovedSecurities).Any())\n            {\n                throw new RegressionTestException($\"SecurityChanges.RemovedSecurities intersect {changes.RemovedSecurities}. We expect no duplicate!\");\n            }\n            if (_securityChanges.AddedSecurities.Intersect(changes.AddedSecurities).Any())\n            {\n                throw new RegressionTestException($\"SecurityChanges.AddedSecurities intersect {changes.RemovedSecurities}. We expect no duplicate!\");\n            }\n            // keep track of all removed and added securities\n            _securityChanges += changes;\n\n            if (changes.AddedSecurities.Any(security => security.Symbol.SecurityType == SecurityType.Option))\n            {\n                return;\n            }\n\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                var option = OptionChain(addedSecurity.Symbol)\n                    .OrderBy(contractData => contractData.ID.Symbol)\n                    .First(optionContract => optionContract.ID.Date == _expiration\n                                                      && optionContract.ID.OptionRight == OptionRight.Call\n                                                      && optionContract.ID.OptionStyle == OptionStyle.American);\n                AddOptionContract(option);\n\n                foreach (var symbol in new[] { option.Symbol, option.UnderlyingSymbol })\n                {\n                    var config = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol).ToList();\n\n                    if (!config.Any())\n                    {\n                        throw new RegressionTestException($\"Was expecting configurations for {symbol}\");\n                    }\n                    if (config.Any(dataConfig => dataConfig.DataNormalizationMode != DataNormalizationMode.Raw))\n                    {\n                        throw new RegressionTestException($\"Was expecting DataNormalizationMode.Raw configurations for {symbol}\");\n                    }\n                }\n\n                // just keep the first we got\n                if (_option == null)\n                {\n                    _option = option;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (SubscriptionManager.Subscriptions.Any(dataConfig => dataConfig.Symbol == _twx || dataConfig.Symbol.Underlying == _twx))\n            {\n                throw new RegressionTestException($\"Was NOT expecting any configurations for {_twx} or it's options, since we removed the contract\");\n            }\n\n            if (SubscriptionManager.Subscriptions.All(dataConfig => dataConfig.Symbol != _aapl))\n            {\n                throw new RegressionTestException($\"Was expecting configurations for {_aapl}\");\n            }\n            if (SubscriptionManager.Subscriptions.All(dataConfig => dataConfig.Symbol.Underlying != _aapl))\n            {\n                throw new RegressionTestException($\"Was expecting options configurations for {_aapl}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5800;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.23%\"},\n            {\"Compounding Annual Return\", \"-15.596%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99768\"},\n            {\"Net Profit\", \"-0.232%\"},\n            {\"Sharpe Ratio\", \"-8.903\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.015\"},\n            {\"Beta\", \"-0.171\"},\n            {\"Annual Standard Deviation\", \"0.006\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.082\"},\n            {\"Tracking Error\", \"0.043\"},\n            {\"Treynor Ratio\", \"0.335\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$2800000.00\"},\n            {\"Lowest Capacity Asset\", \"AOL VRKS95ENPM9Y|AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"1.14%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e33b98d8e94ed92d0441fc6fe0d461fb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddOptionContractTwiceRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #6073 where we remove and re add an option and expect it to work\n    /// </summary>\n    public class AddOptionContractTwiceRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contract;\n        private bool _hasRemoved;\n        private bool _reAdded;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n            UniverseSettings.FillForward = false;\n\n            AddEquity(\"SPY\", Resolution.Hour);\n\n            var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            _contract = OptionChain(aapl)\n                .OrderBy(x => x.ID.StrikePrice)\n                .FirstOrDefault(optionContract => optionContract.ID.OptionRight == OptionRight.Call\n                    && optionContract.ID.OptionStyle == OptionStyle.American);\n            AddOptionContract(_contract);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_hasRemoved)\n            {\n                if (!_reAdded && slice.ContainsKey(_contract) && slice.ContainsKey(_contract.Underlying))\n                {\n                    throw new RegressionTestException(\"Getting data for removed option and underlying!\");\n                }\n\n                if (!Portfolio.Invested && _reAdded)\n                {\n                    var option = Securities[_contract];\n                    var optionUnderlying = Securities[_contract.Underlying];\n                    if (option.IsTradable && optionUnderlying.IsTradable\n                        && slice.ContainsKey(_contract) && slice.ContainsKey(_contract.Underlying))\n                    {\n                        Buy(_contract, 1);\n                    }\n                }\n\n                if (!Securities[_contract].IsTradable\n                    && !Securities[_contract.Underlying].IsTradable\n                    && !_reAdded)\n                {\n                    // ha changed my mind!\n                    AddOptionContract(_contract);\n                    _reAdded = true;\n                }\n            }\n\n            if (slice.ContainsKey(_contract) && slice.ContainsKey(_contract.Underlying))\n            {\n                if (!_hasRemoved)\n                {\n                    RemoveOptionContract(_contract);\n                    RemoveSecurity(_contract.Underlying);\n                    _hasRemoved = true;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasRemoved)\n            {\n                throw new RegressionTestException(\"We did not remove the option contract!\");\n            }\n            if (!_reAdded)\n            {\n                throw new RegressionTestException(\"We did not re add the option contract!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3818;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.50%\"},\n            {\"Compounding Annual Return\", \"-39.406%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99498\"},\n            {\"Net Profit\", \"-0.502%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$5000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL VXBK4R62H7S6|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"22.70%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"71511e4929377cd55fbf5e7e9555c248\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddOptionUniverseSelectionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing System;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to use the OptionUniverseSelectionModel to select options contracts based on specified conditions.\n    /// The model is updated daily and selects different options based on the current date.\n    /// The algorithm ensures that only valid option contracts are selected for the universe.\n    /// </summary>\n    public class AddOptionUniverseSelectionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _optionCount;\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 06);\n\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetUniverseSelection(new OptionUniverseSelectionModel(\n                TimeSpan.FromDays(1),\n                SelectOptionChainSymbols\n            ));\n        }\n\n        private static IEnumerable<Symbol> SelectOptionChainSymbols(DateTime utcTime)\n        {\n            var newYorkTime = utcTime.ConvertFromUtc(TimeZones.NewYork);\n            if (newYorkTime.Date < new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"TWX\", SecurityType.Option, Market.USA);\n            }\n\n            if (newYorkTime.Date >= new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA);\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Count > 0)\n            {\n                foreach (var security in changes.AddedSecurities)\n                {\n                    var symbol = security.Symbol.Underlying == null ? security.Symbol : security.Symbol.Underlying;\n                    if (symbol != \"AAPL\" && symbol != \"TWX\")\n                    {\n                        throw new RegressionTestException($\"Unexpected security {security.Symbol}\");\n                    }\n                    _optionCount += (security.Symbol.SecurityType == SecurityType.Option) ? 1 : 0;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (ActiveSecurities.Count == 0)\n            {\n                throw new RegressionTestException(\"No active securities found. Expected at least one active security\");\n            }\n            if (_optionCount == 0)\n            {\n                throw new RegressionTestException(\"The option count should be greater than 0\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2349547;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddOptionWithOnMarketOpenOnlyFilterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that using OnlyApplyFilterAtMarketOpen along with other dynamic filters will make the filters be applied only on market\n    /// open, regardless of the order of configuration of the filters\n    /// </summary>\n    public class AddOptionWithOnMarketOpenOnlyFilterRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 10);\n\n            // OnlyApplyFilterAtMarketOpen as first filter\n            AddOption(\"AAPL\", Resolution.Minute).SetFilter(u =>\n                u.OnlyApplyFilterAtMarketOpen()\n                 .Strikes(-5, 5)\n                 .Expiration(0, 100)\n                 .IncludeWeeklys());\n\n            // OnlyApplyFilterAtMarketOpen as last filter\n            AddOption(\"TWX\", Resolution.Minute).SetFilter(u =>\n                u.Strikes(-5, 5)\n                 .Expiration(0, 100)\n                 .IncludeWeeklys()\n                 .OnlyApplyFilterAtMarketOpen());\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // This will be the first call, the underlying securities are added.\n            if (changes.AddedSecurities.All(s => s.Type != SecurityType.Option))\n            {\n                return;\n            }\n\n            var changeOptions = changes.AddedSecurities.Concat(changes.RemovedSecurities)\n                                                                        .Where(s => s.Type == SecurityType.Option);\n\n            if (Time != Time.Date)\n            {\n                throw new RegressionTestException($\"Expected options filter to be run only at midnight. Actual was {Time}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all time slices of algorithm\n        /// </summary>\n        public long DataPoints => 470217;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-10.144\"},\n            {\"Tracking Error\", \"0.033\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\n\n// ReSharper disable InvokeAsExtensionMethod -- .net 4.7.2 added ToHashSet and it looks like our version of mono has it as well causing ambiguity in the cloud\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class AddRemoveOptionUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private readonly Symbol Underlying = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Equity, Market.USA);\n        private readonly Symbol OptionChainSymbol = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Option, Market.USA);\n        private readonly HashSet<Symbol> _expectedSecurities = new HashSet<Symbol>();\n        private readonly HashSet<Symbol> _expectedData = new HashSet<Symbol>();\n        private readonly HashSet<Symbol> _expectedUniverses = new HashSet<Symbol>();\n        private bool _expectUniverseSubscription;\n        private DateTime _universeSubscriptionTime;\n\n        // order of expected contract additions as price moves\n        private int _expectedContractIndex;\n        private readonly List<Symbol> _expectedContracts = new List<Symbol>\n        {\n            SymbolRepresentation.ParseOptionTickerOSI(\"GOOG  151224P00750000\"),\n            SymbolRepresentation.ParseOptionTickerOSI(\"GOOG  151224P00752500\"),\n            SymbolRepresentation.ParseOptionTickerOSI(\"GOOG  151224P00755000\")\n        };\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            var goog = AddEquity(UnderlyingTicker);\n\n            // expect GOOG equity\n            _expectedData.Add(goog.Symbol);\n            _expectedSecurities.Add(goog.Symbol);\n            // expect user defined universe holding GOOG equity\n            _expectedUniverses.Add(UserDefinedUniverse.CreateSymbol(SecurityType.Equity, Market.USA));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // verify expectations\n            if (SubscriptionManager.Subscriptions.Count(x => x.Symbol == OptionChainSymbol)\n                != (_expectUniverseSubscription ? 1 : 0))\n            {\n                Log($\"SubscriptionManager.Subscriptions:  {string.Join(\" -- \", SubscriptionManager.Subscriptions)}\");\n                throw new RegressionTestException($\"Unexpected {OptionChainSymbol} subscription presence\");\n            }\n            if (Time != _universeSubscriptionTime && !slice.ContainsKey(Underlying))\n            {\n                // TODO : In fact, we're unable to properly detect whether or not we auto-added or it was manually added\n                // this is because when we auto-add the underlying we don't mark it as an internal security like we do with other auto adds\n                // so there's currently no good way to remove the underlying equity without invoking RemoveSecurity(underlying) manually\n                // from the algorithm, otherwise we may remove it incorrectly. Now, we could track MORE state, but it would likely be a duplication\n                // of the internal flag's purpose, so kicking this issue for now with a big fat note here about it :) to be considerd for any future\n                // refactorings of how we manage subscription/security data and track various aspects about the security (thinking a flags enum with\n                // things like manually added, auto added, internal, and any other boolean state we need to track against a single security)\n                throw new RegressionTestException(\"The underlying equity data should NEVER be removed in this algorithm because it was manually added\");\n            }\n            if (_expectedSecurities.AreDifferent(Securities.Total.Select(x => x.Symbol).ToHashSet()))\n            {\n                var expected = string.Join(Environment.NewLine, _expectedSecurities.OrderBy(s => s.ToString()));\n                var actual = string.Join(Environment.NewLine, Securities.Keys.OrderBy(s => s.ToString()));\n                throw new RegressionTestException($\"{Time}:: Detected differences in expected and actual securities{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}\");\n            }\n            if (_expectedUniverses.AreDifferent(UniverseManager.Keys.ToHashSet()))\n            {\n                var expected = string.Join(Environment.NewLine, _expectedUniverses.OrderBy(s => s.ToString()));\n                var actual = string.Join(Environment.NewLine, UniverseManager.Keys.OrderBy(s => s.ToString()));\n                throw new RegressionTestException($\"{Time}:: Detected differences in expected and actual universes{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}\");\n            }\n            if (Time != _universeSubscriptionTime && _expectedData.AreDifferent(slice.Keys.ToHashSet()))\n            {\n                var expected = string.Join(Environment.NewLine, _expectedData.OrderBy(s => s.ToString()));\n                var actual = string.Join(Environment.NewLine, slice.Keys.OrderBy(s => s.ToString()));\n                throw new RegressionTestException($\"{Time}:: Detected differences in expected and actual slice data keys{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}\");\n            }\n\n            // 10AM add GOOG option chain\n            if (Time.TimeOfDay.Hours == 10 && Time.TimeOfDay.Minutes == 0 && !_expectUniverseSubscription)\n            {\n                if (Securities.ContainsKey(OptionChainSymbol))\n                {\n                    throw new RegressionTestException(\"The option chain security should not have been added yet\");\n                }\n\n                var googOptionChain = AddOption(UnderlyingTicker);\n                googOptionChain.SetFilter(u =>\n                {\n                    // we added the universe at 10, the universe selection data should not be from before\n                    if (u.LocalTime.Hour < 10)\n                    {\n                        throw new RegressionTestException($\"Unexpected selection time {u.LocalTime}\");\n                    }\n                    // find first put above market price\n                    return u.IncludeWeeklys()\n                        .Strikes(+1, +3)\n                        .Expiration(TimeSpan.Zero, TimeSpan.FromDays(1))\n                        .Contracts(c => c.Where(s => s.ID.OptionRight == OptionRight.Put));\n                });\n\n                _expectedSecurities.Add(OptionChainSymbol);\n                _expectedUniverses.Add(OptionChainSymbol);\n                _expectUniverseSubscription = true;\n                _universeSubscriptionTime = Time;\n            }\n\n            // 11:30AM remove GOOG option chain\n            if (Time.TimeOfDay.Hours == 11 && Time.TimeOfDay.Minutes == 30)\n            {\n                RemoveSecurity(OptionChainSymbol);\n                // remove contracts from expected data\n                _expectedData.RemoveWhere(s => _expectedContracts.Contains(s));\n                // remove option chain universe from expected universes\n                _expectedUniverses.Remove(OptionChainSymbol);\n                // OptionChainSymbol universe subscription should not be present\n                _expectUniverseSubscription = false;\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Any())\n            {\n                foreach (var added in changes.AddedSecurities)\n                {\n                    // any option security additions for this algorithm should match the expected contracts\n                    if (added.Symbol.SecurityType == SecurityType.Option)\n                    {\n                        var expectedContract = _expectedContracts[_expectedContractIndex];\n                        if (added.Symbol != expectedContract)\n                        {\n                            throw new RegressionTestException($\"Expected option contract {expectedContract.Value} to be added but received {added.Symbol}\");\n                        }\n\n                        _expectedContractIndex++;\n\n                        // purchase for regression statistics\n                        MarketOrder(added.Symbol, 1);\n                    }\n\n                    _expectedData.Add(added.Symbol);\n                    _expectedSecurities.Add(added.Symbol);\n                }\n            }\n\n            // security removal happens exactly once in this algorithm when the option chain is removed\n            // and all child subscriptions (option contracts) should be removed at the same time\n            if (changes.RemovedSecurities.Any(x => x.Symbol.SecurityType == SecurityType.Option))\n            {\n                // receive removed event next timestep at 11:31AM\n                if (Time.TimeOfDay.Hours != 11 || Time.TimeOfDay.Minutes != 31)\n                {\n                    throw new RegressionTestException($\"Expected option contracts to be removed at 11:31AM, instead removed at: {Time}\");\n                }\n\n                if (changes.RemovedSecurities\n                    .Where(x => x.Symbol.SecurityType == SecurityType.Option)\n                    .ToHashSet(s => s.Symbol)\n                    .AreDifferent(_expectedContracts.ToHashSet()))\n                {\n                    throw new RegressionTestException(\"Expected removed securities to equal expected contracts added\");\n                }\n            }\n\n            if (Securities.ContainsKey(Underlying))\n            {\n                Log($\"{Time:o}:: PRICE:: {Securities[Underlying].Price} CHANGES:: {changes}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3502;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98784\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$6.00\"},\n            {\"Estimated Strategy Capacity\", \"$4000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ2BZGA4M|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.58%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f418de0673fc166487daf80991dfe3a0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddRemoveSecurityCacheRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm making sure the securities cache is reset correctly once it's removed from the algorithm\n    /// </summary>\n    public class AddRemoveSecurityCacheRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            AddEquity(\"SPY\", Resolution.Minute, extendedMarketHours: true);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n\n            if (Time.Day == 11)\n            {\n                return;\n            }\n            if (!ActiveSecurities.ContainsKey(\"AIG\"))\n            {\n                var aig = AddEquity(\"AIG\", Resolution.Minute);\n\n                var ticket = MarketOrder(\"AIG\", 1);\n\n                if (ticket.Status != OrderStatus.Invalid || aig.HasData || aig.Price != 0)\n                {\n                    throw new RegressionTestException(\"Expected order to always be invalid because there is no data yet!\");\n                }\n            }\n            else\n            {\n                RemoveSecurity(\"AIG\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15042;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"19\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"271.720%\"},\n            {\"Drawdown\", \"2.500%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101753.84\"},\n            {\"Net Profit\", \"1.754%\"},\n            {\"Sharpe Ratio\", \"11.954\"},\n            {\"Sortino Ratio\", \"29.606\"},\n            {\"Probabilistic Sharpe Ratio\", \"74.160%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.616\"},\n            {\"Beta\", \"0.81\"},\n            {\"Annual Standard Deviation\", \"0.185\"},\n            {\"Annual Variance\", \"0.034\"},\n            {\"Information Ratio\", \"3.961\"},\n            {\"Tracking Error\", \"0.061\"},\n            {\"Treynor Ratio\", \"2.737\"},\n            {\"Total Fees\", \"$21.45\"},\n            {\"Estimated Strategy Capacity\", \"$830000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.49%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"6ebe462373e2ecc22de8eb2fe114d704\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddRemoveSecurityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates the runtime addition and removal of securities from your algorithm.\n    /// With LEAN it is possible to add and remove securities after the initialization.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"assets\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class AddRemoveSecurityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime lastAction;\n\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private Symbol _aig = QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA);\n        private Symbol _bac = QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            AddSecurity(SecurityType.Equity, \"SPY\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (lastAction.Date == Time.Date) return;\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 0.5);\n                lastAction = Time;\n            }\n            if (Time.DayOfWeek == DayOfWeek.Tuesday)\n            {\n                AddSecurity(SecurityType.Equity, \"AIG\");\n                AddSecurity(SecurityType.Equity, \"BAC\");\n                lastAction = Time;\n            }\n            else if (Time.DayOfWeek == DayOfWeek.Wednesday)\n            {\n                SetHoldings(_aig, .25);\n                SetHoldings(_bac, .25);\n                lastAction = Time;\n            }\n            else if (Time.DayOfWeek == DayOfWeek.Thursday)\n            {\n                RemoveSecurity(_aig);\n                RemoveSecurity(_bac);\n                lastAction = Time;\n            }\n        }\n\n        /// <summary>\n        /// Order events are triggered on order status changes. There are many order events including non-fill messages.\n        /// </summary>\n        /// <param name=\"orderEvent\">OrderEvent object with details about the order status</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                Debug(Time + \": Submitted: \" + Transactions.GetOrderById(orderEvent.OrderId));\n            }\n            if (orderEvent.Status.IsFill())\n            {\n                Debug(Time + \": Filled: \" + Transactions.GetOrderById(orderEvent.OrderId));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7065;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0.46%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"296.356%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101776.32\"},\n            {\"Net Profit\", \"1.776%\"},\n            {\"Sharpe Ratio\", \"12.966\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"80.409%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.678\"},\n            {\"Beta\", \"0.707\"},\n            {\"Annual Standard Deviation\", \"0.16\"},\n            {\"Annual Variance\", \"0.026\"},\n            {\"Information Ratio\", \"1.378\"},\n            {\"Tracking Error\", \"0.072\"},\n            {\"Treynor Ratio\", \"2.935\"},\n            {\"Total Fees\", \"$28.30\"},\n            {\"Estimated Strategy Capacity\", \"$4700000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"29.88%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"f04b3521256c7d6740966bc3df34e7b1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddRiskManagementAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"QCAlgorithm.AddRiskManagement(IRiskManagementModel)\"/>\n    /// </summary>\n    public class AddRiskManagementAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            AddRiskManagement(new MaximumDrawdownPercentPortfolio(0.02m));\n            AddRiskManagement(new MaximumUnrealizedProfitPercentPerSecurity(0.01m));\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"1.02%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"296.066%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101775.37\"},\n            {\"Net Profit\", \"1.775%\"},\n            {\"Sharpe Ratio\", \"9.34\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"68.302%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.106\"},\n            {\"Beta\", \"1.021\"},\n            {\"Annual Standard Deviation\", \"0.227\"},\n            {\"Annual Variance\", \"0.052\"},\n            {\"Information Ratio\", \"25.083\"},\n            {\"Tracking Error\", \"0.006\"},\n            {\"Treynor Ratio\", \"2.079\"},\n            {\"Total Fees\", \"$10.33\"},\n            {\"Estimated Strategy Capacity\", \"$38000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"59.74%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"5d7657ec9954875eca633bed711085d3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddTwoAndRemoveOneOptionContractRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue where underlying option contract would be removed with the first call\n    /// too RemoveOptionContract\n    /// </summary>\n    public class AddTwoAndRemoveOneOptionContractRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contract1;\n        private Symbol _contract2;\n        private bool _hasRemoved;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 06);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n\n            var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            var contracts = OptionChain(aapl)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Where(optionContract => optionContract.ID.OptionRight == OptionRight.Call\n                    && optionContract.ID.OptionStyle == OptionStyle.American)\n                .Take(2)\n                .ToList();\n\n            _contract1 = contracts[0];\n            _contract2 = contracts[1];\n            AddOptionContract(_contract1);\n            AddOptionContract(_contract2);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.HasData)\n            {\n                if (!_hasRemoved)\n                {\n                    RemoveOptionContract(_contract1);\n                    _hasRemoved = true;\n                }\n                else\n                {\n                    var subscriptions =\n                        SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(\"AAPL\");\n                    if (subscriptions.Count == 0)\n                    {\n                        throw new RegressionTestException(\"No configuration for underlying was found!\");\n                    }\n\n                    if (!Portfolio.Invested &&\n                        // This security will be liquidated due to impending split, let's not trade it again after the contract is removed.\n                        // Trying to trade it will make the security to be re-added\n                        Securities[_contract2].IsTradable)\n                    {\n                        Buy(_contract2, 1);\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasRemoved)\n            {\n                throw new RegressionTestException(\"Expect a single call to OnData where we removed the option and underlying\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1579;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99238\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$6200000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL VXBK4QA5IWKM|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"90.27%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a332b93ff5e2dfe89258c450a64c7125\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"QCAlgorithm.AddUniverseSelection(IUniverseSelectionModel)\"/>\n    /// </summary>\n    public class AddUniverseSelectionModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            AddUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)));\n            AddUniverseSelection(new ManualUniverseSelectionModel(\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), // duplicate will be ignored\n                QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA)));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (UniverseManager.Count != 3)\n            {\n                throw new RegressionTestException(\"Unexpected universe count\");\n            }\n            if (UniverseManager.ActiveSecurities.Count != 3\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"SPY\")\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"AAPL\")\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"FB\"))\n            {\n                throw new RegressionTestException(\"Unexpected active securities\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"1296.838%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102684.23\"},\n            {\"Net Profit\", \"2.684%\"},\n            {\"Sharpe Ratio\", \"34.319\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-5.738\"},\n            {\"Beta\", \"1.381\"},\n            {\"Annual Standard Deviation\", \"0.246\"},\n            {\"Annual Variance\", \"0.06\"},\n            {\"Information Ratio\", \"-26.937\"},\n            {\"Tracking Error\", \"0.068\"},\n            {\"Treynor Ratio\", \"6.106\"},\n            {\"Total Fees\", \"$18.61\"},\n            {\"Estimated Strategy Capacity\", \"$980000000.00\"},\n            {\"Lowest Capacity Asset\", \"FB V6OIPNZEM8V9\"},\n            {\"Portfolio Turnover\", \"25.56%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"5ee20c8556d706ab0a63ae41b6579c62\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AddUniverseSelectionModelCoarseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"QCAlgorithm.AddUniverseSelection(IUniverseSelectionModel)\"/>\n    /// </summary>\n    public class AddUniverseSelectionModelCoarseAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 04, 07);\n            SetCash(100000);\n\n            // set algorithm framework models\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            SetUniverseSelection(new CoarseFundamentalUniverseSelectionModel(\n                enumerable => enumerable\n                    .Select(fundamental => fundamental.Symbol)\n                    .Where(symbol => symbol.Value == \"AAPL\")));\n            AddUniverseSelection(new CoarseFundamentalUniverseSelectionModel(\n                enumerable => enumerable\n                    .Select(fundamental => fundamental.Symbol)\n                    .Where(symbol => symbol.Value == \"SPY\")));\n            AddUniverseSelection(new CoarseFundamentalUniverseSelectionModel(\n                enumerable => enumerable\n                    .Select(fundamental => fundamental.Symbol)\n                    .Where(symbol => symbol.Value == \"FB\")));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (UniverseManager.Count != 3)\n            {\n                throw new RegressionTestException(\"Unexpected universe count\");\n            }\n            if (UniverseManager.ActiveSecurities.Count != 3\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"SPY\")\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"AAPL\")\n                || UniverseManager.ActiveSecurities.Keys.All(symbol => symbol.Value != \"FB\"))\n            {\n                throw new RegressionTestException(\"Unexpected active securities\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 234015;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"21\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-77.566%\"},\n            {\"Drawdown\", \"6.000%\"},\n            {\"Expectancy\", \"-0.811\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94042.73\"},\n            {\"Net Profit\", \"-5.957%\"},\n            {\"Sharpe Ratio\", \"-3.345\"},\n            {\"Sortino Ratio\", \"-3.766\"},\n            {\"Probabilistic Sharpe Ratio\", \"4.557%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"0.70\"},\n            {\"Alpha\", \"-0.519\"},\n            {\"Beta\", \"1.491\"},\n            {\"Annual Standard Deviation\", \"0.2\"},\n            {\"Annual Variance\", \"0.04\"},\n            {\"Information Ratio\", \"-3.878\"},\n            {\"Tracking Error\", \"0.147\"},\n            {\"Treynor Ratio\", \"-0.449\"},\n            {\"Total Fees\", \"$29.11\"},\n            {\"Estimated Strategy Capacity\", \"$680000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"7.48%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2c814c55e7d7c56482411c065b861b33\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test volume adjusted behavior\n    /// </summary>\n    public class AdjustedVolumeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n        private const string Ticker = \"AAPL\";\n        private CorporateFactorProvider _factorFile;\n        private readonly IEnumerator<decimal> _expectedAdjustedVolume = new List<decimal> { 6164842, 3044047, 3680347, 3468303, 2169943, 2652523,\n            1499707, 1518215, 1655219, 1510487 }.GetEnumerator();\n        private readonly IEnumerator<decimal> _expectedAdjustedAskSize = new List<decimal> { 215600, 5600, 25200, 8400, 5600, 5600, 2800,\n            8400, 14000, 2800 }.GetEnumerator();\n        private readonly IEnumerator<decimal> _expectedAdjustedBidSize = new List<decimal> { 2800, 11200, 2800, 2800, 2800, 5600, 11200,\n            8400, 30800, 2800 }.GetEnumerator();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);      //Set Start Date\n            SetEndDate(2014, 6, 5);         //Set End Date\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.SplitAdjusted;\n            _aapl = AddEquity(Ticker, Resolution.Minute).Symbol;\n\n            var dataProvider =\n                Composer.Instance.GetExportedValueByTypeName<IDataProvider>(Config.Get(\"data-provider\",\n                    \"DefaultDataProvider\"));\n\n            var mapFileProvider = new LocalDiskMapFileProvider();\n            mapFileProvider.Initialize(dataProvider);\n            var factorFileProvider = new LocalDiskFactorFileProvider();\n            factorFileProvider.Initialize(mapFileProvider, dataProvider);\n\n\n            _factorFile = factorFileProvider.Get(_aapl) as CorporateFactorProvider;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_aapl, 1);\n            }\n\n            if (slice.Splits.ContainsKey(_aapl))\n            {\n                Log(slice.Splits[_aapl].ToString());\n            }\n\n            if (slice.Bars.ContainsKey(_aapl))\n            {\n                var aaplData = slice.Bars[_aapl];\n\n                // Assert our volume matches what we expect\n                if (_expectedAdjustedVolume.MoveNext() && _expectedAdjustedVolume.Current != aaplData.Volume)\n                {\n                    // Our values don't match lets try and give a reason why\n                    var dayFactor = _factorFile.GetPriceScale(aaplData.Time, DataNormalizationMode.SplitAdjusted);\n                    var probableAdjustedVolume = aaplData.Volume / dayFactor;\n\n                    if (_expectedAdjustedVolume.Current == probableAdjustedVolume)\n                    {\n                        throw new ArgumentException($\"Volume was incorrect; but manually adjusted value is correct.\" + \n                            $\" Adjustment by multiplying volume by {1 / dayFactor} is not occurring.\");\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"Volume was incorrect; even when adjusted manually by\" + \n                            $\" multiplying volume by {1 / dayFactor}. Data may have changed.\");\n                    }\n                }\n            }\n\n            if (slice.QuoteBars.ContainsKey(_aapl))\n            {\n                var aaplQuoteData = slice.QuoteBars[_aapl];\n\n                // Assert our askSize matches what we expect\n                if (_expectedAdjustedAskSize.MoveNext() && _expectedAdjustedAskSize.Current != aaplQuoteData.LastAskSize)\n                {\n                    // Our values don't match lets try and give a reason why\n                    var dayFactor = _factorFile.GetPriceScale(aaplQuoteData.Time, DataNormalizationMode.SplitAdjusted);\n                    var probableAdjustedAskSize = aaplQuoteData.LastAskSize / dayFactor;\n\n                    if (_expectedAdjustedAskSize.Current == probableAdjustedAskSize)\n                    {\n                        throw new ArgumentException($\"Ask size was incorrect; but manually adjusted value is correct.\" +\n                            $\" Adjustment by multiplying size by {1 / dayFactor} is not occurring.\");\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"Ask size was incorrect; even when adjusted manually by\" +\n                            $\" multiplying size by {1 / dayFactor}. Data may have changed.\");\n                    }\n                }\n\n                // Assert our bidSize matches what we expect\n                if (_expectedAdjustedBidSize.MoveNext() && _expectedAdjustedBidSize.Current != aaplQuoteData.LastBidSize)\n                {\n                    // Our values don't match lets try and give a reason why\n                    var dayFactor = _factorFile.GetPriceScale(aaplQuoteData.Time, DataNormalizationMode.SplitAdjusted);\n                    var probableAdjustedBidSize = aaplQuoteData.LastBidSize / dayFactor;\n\n                    if (_expectedAdjustedBidSize.Current == probableAdjustedBidSize)\n                    {\n                        throw new ArgumentException($\"Bid size was incorrect; but manually adjusted value is correct.\" +\n                            $\" Adjustment by multiplying size by {1 / dayFactor} is not occurring.\");\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"Bid size was incorrect; even when adjusted manually by\" +\n                            $\" multiplying size by {1 / dayFactor}. Data may have changed.\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100146.57\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$21.60\"},\n            {\"Estimated Strategy Capacity\", \"$42000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"99.56%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"60f03c8c589a4f814dc4e8945df23207\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting the correct values for the deployment target and algorithm mode.\n    /// </summary>\n    public class AlgorithmModeAndDeploymentTargetAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 07);\n            SetCash(100000);\n\n            Debug($\"Algorithm Mode: {AlgorithmMode}. Is Live Mode: {LiveMode}. Deployment Target: {DeploymentTarget}.\");\n\n            if (AlgorithmMode != AlgorithmMode.Backtesting)\n            {\n                throw new RegressionTestException($\"Algorithm mode is not backtesting. Actual: {AlgorithmMode}\");\n            }\n\n            if (LiveMode)\n            {\n                throw new RegressionTestException(\"Algorithm should not be live\");\n            }\n\n            if (DeploymentTarget != DeploymentTarget.LocalPlatform)\n            {\n                throw new RegressionTestException($\"Algorithm deployment target is not local. Actual{DeploymentTarget}\");\n            }\n\n            // For a live deployment these checks should pass:\n            //if (AlgorithmMode != AlgorithmMode.Live) throw new RegressionTestException(\"Algorithm mode is not live\");\n            //if (!LiveMode) throw new RegressionTestException(\"Algorithm should be live\");\n\n            // For a cloud deployment these checks should pass:\n            //if (DeploymentTarget != DeploymentTarget.CloudPlatform) throw new RegressionTestException(\"Algorithm deployment target is not cloud\");\n\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AllShortableSymbolsCoarseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System.IO;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests filtering in coarse selection by shortable quantity\n    /// </summary>\n    public class AllShortableSymbolsCoarseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private static readonly DateTime _20140325 = new DateTime(2014, 3, 25);\n        private static readonly DateTime _20140326 = new DateTime(2014, 3, 26);\n        private static readonly DateTime _20140327 = new DateTime(2014, 3, 27);\n        private static readonly DateTime _20140328 = new DateTime(2014, 3, 28);\n        private static readonly DateTime _20140329 = new DateTime(2014, 3, 29);\n\n        private static readonly Symbol _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n        private static readonly Symbol _bac = QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA);\n        private static readonly Symbol _gme = QuantConnect.Symbol.Create(\"GME\", SecurityType.Equity, Market.USA);\n        private static readonly Symbol _goog = QuantConnect.Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA);\n        private static readonly Symbol _qqq = QuantConnect.Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA);\n        private static readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private DateTime _lastTradeDate;\n\n        private static readonly Dictionary<DateTime, bool> _coarseSelected = new Dictionary<DateTime, bool>\n        {\n            { _20140325, false },\n            { _20140326, false },\n            { _20140327, false },\n            { _20140328, false },\n        };\n\n        private static readonly Dictionary<DateTime, Symbol[]> _expectedSymbols = new Dictionary<DateTime, Symbol[]>\n        {\n            { _20140325, new[]\n                {\n                    _bac,\n                    _qqq,\n                    _spy\n                }\n            },\n            { _20140326, new[]\n                {\n                    _spy\n                }\n            },\n            { _20140327, new[]\n                {\n                    _aapl,\n                    _bac,\n                    _gme,\n                    _qqq,\n                    _spy,\n                }\n            },\n            { _20140328, new[]\n                {\n                    _goog\n                }\n            },\n            { _20140329, new Symbol[0] }\n        };\n\n        private Security _security;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 3, 25);\n            SetEndDate(2014, 3, 29);\n            SetCash(10000000);\n            _security = AddEquity(_spy);\n            _security.SetShortableProvider(new RegressionTestShortableProvider());\n\n            AddUniverse(CoarseSelection);\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetBrokerageModel(new AllShortableSymbolsRegressionAlgorithmBrokerageModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Date == _lastTradeDate)\n            {\n                return;\n            }\n\n            foreach (var (symbol, security) in ActiveSecurities.Where(kvp => !kvp.Value.Invested).OrderBy(kvp => kvp.Key))\n            {\n                var shortableQuantity = security.ShortableProvider.ShortableQuantity(symbol, Time);\n                if (shortableQuantity == null)\n                {\n                    throw new RegressionTestException($\"Expected {symbol} to be shortable on {Time:yyyy-MM-dd}\");\n                }\n\n                // Buy at least once into all Symbols. Since daily data will always use\n                // MOO orders, it makes the testing of liquidating buying into Symbols difficult.\n                MarketOrder(symbol, -(decimal)shortableQuantity);\n                _lastTradeDate = Time.Date;\n            }\n        }\n\n        private IEnumerable<Symbol> CoarseSelection(IEnumerable<CoarseFundamental> coarse)\n        {\n            var shortableSymbols = (_security.ShortableProvider as dynamic).AllShortableSymbols(Time);\n            var selectedSymbols = coarse\n                .Select(x => x.Symbol)\n                .Where(s => shortableSymbols.ContainsKey(s) && shortableSymbols[s] >= 500)\n                .OrderBy(s => s)\n                .ToList();\n\n            var expectedMissing = 0;\n            if (Time.Date == _20140327)\n            {\n                var gme = QuantConnect.Symbol.Create(\"GME\", SecurityType.Equity, Market.USA);\n                if (!shortableSymbols.ContainsKey(gme))\n                {\n                    throw new RegressionTestException(\"Expected unmapped GME in shortable symbols list on 2014-03-27\");\n                }\n                if (!coarse.Select(x => x.Symbol.Value).Contains(\"GME\"))\n                {\n                    throw new RegressionTestException(\"Expected mapped GME in coarse symbols on 2014-03-27\");\n                }\n\n                expectedMissing = 1;\n            }\n\n            var missing = _expectedSymbols[Time.Date].Except(selectedSymbols).ToList();\n            if (missing.Count != expectedMissing)\n            {\n                throw new RegressionTestException($\"Expected Symbols selected on {Time.Date:yyyy-MM-dd} to match expected Symbols, but the following Symbols were missing: {string.Join(\", \", missing.Select(s => s.ToString()))}\");\n            }\n\n            _coarseSelected[Time.Date] = true;\n            return selectedSymbols;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_coarseSelected.Values.All(x => x))\n            {\n                throw new AggregateException($\"Expected coarse selection on all dates, but didn't run on: {string.Join(\", \", _coarseSelected.Where(kvp => !kvp.Value).Select(kvp => kvp.Key.ToStringInvariant(\"yyyy-MM-dd\")))}\");\n            }\n        }\n\n        private class AllShortableSymbolsRegressionAlgorithmBrokerageModel : DefaultBrokerageModel\n        {\n            public AllShortableSymbolsRegressionAlgorithmBrokerageModel() : base()\n            {\n            }\n            public override IShortableProvider GetShortableProvider(Security security)\n            {\n                return new RegressionTestShortableProvider();\n            }\n        }\n\n        private class RegressionTestShortableProvider : LocalDiskShortableProvider\n        {\n            public RegressionTestShortableProvider() : base(\"testbrokerage\")\n            {\n            }\n\n            /// <summary>\n            /// Gets a list of all shortable Symbols, including the quantity shortable as a Dictionary.\n            /// </summary>\n            /// <param name=\"localTime\">The algorithm's local time</param>\n            /// <returns>Symbol/quantity shortable as a Dictionary. Returns null if no entry data exists for this date or brokerage</returns>\n            public Dictionary<Symbol, long> AllShortableSymbols(DateTime localTime)\n            {\n                var shortableDataDirectory = Path.Combine(Globals.DataFolder, SecurityType.Equity.SecurityTypeToLower(), Market.USA, \"shortable\", Brokerage);\n                var allSymbols = new Dictionary<Symbol, long>();\n\n                // Check backwards up to one week to see if we can source a previous file.\n                // If not, then we return a list of all Symbols with quantity set to zero.\n                var i = 0;\n                while (i <= 7)\n                {\n                    var shortableListFile = Path.Combine(shortableDataDirectory, \"dates\", $\"{localTime.AddDays(-i):yyyyMMdd}.csv\");\n\n                    foreach (var line in DataProvider.ReadLines(shortableListFile))\n                    {\n                        var csv = line.Split(',');\n                        var ticker = csv[0];\n\n                        var symbol = new Symbol(\n                                SecurityIdentifier.GenerateEquity(ticker, QuantConnect.Market.USA,\n                                    mappingResolveDate: localTime), ticker);\n                        var quantity = Parse.Long(csv[1]);\n\n                        allSymbols[symbol] = quantity;\n                    }\n\n                    if (allSymbols.Count > 0)\n                    {\n                        return allSymbols;\n                    }\n\n                    i++;\n                }\n\n                // Return our empty dictionary if we did not find a file to extract\n                return allSymbols;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 36573;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"11.027%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"10011469.88\"},\n            {\"Net Profit\", \"0.115%\"},\n            {\"Sharpe Ratio\", \"11.963\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.07\"},\n            {\"Beta\", \"-0.077\"},\n            {\"Annual Standard Deviation\", \"0.008\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"3.876\"},\n            {\"Tracking Error\", \"0.105\"},\n            {\"Treynor Ratio\", \"-1.215\"},\n            {\"Total Fees\", \"$282.50\"},\n            {\"Estimated Strategy Capacity\", \"$61000000000.00\"},\n            {\"Lowest Capacity Asset\", \"NB R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0ea806c53bfa2bdca2504ba7155ef130\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.Math;\nusing Accord.Statistics;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// Energy prices, especially Oil and Natural Gas, are in general fairly correlated,\n    /// meaning they typically move in the same direction as an overall trend.This Alpha\n    /// uses this idea and implements an Alpha Model that takes Natural Gas ETF price\n    /// movements as a leading indicator for Crude Oil ETF price movements.We take the\n    /// Natural Gas/Crude Oil ETF pair with the highest historical price correlation and\n    /// then create insights for Crude Oil depending on whether or not the Natural Gas ETF price change\n    /// is above/below a certain threshold that we set (arbitrarily).\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    /// sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class GasAndCrudeOilEnergyCorrelationAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            Func<string, Symbol> ToSymbol = x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA);\n            var naturalGas = new[] { \"UNG\", \"BOIL\", \"FCG\" }.Select(ToSymbol).ToArray();\n            var crudeOil = new[] { \"USO\", \"UCO\", \"DBO\" }.Select(ToSymbol).ToArray();\n\n            // Manually curated universe\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetUniverseSelection(new ManualUniverseSelectionModel(naturalGas.Concat(crudeOil)));\n\n            // Use PairsAlphaModel to establish insights\n            SetAlpha(new PairsAlphaModel(naturalGas, crudeOil, 90, Resolution.Minute));\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Custom Execution Model\n            SetExecution(new CustomExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// This Alpha model assumes that the ETF for natural gas is a good leading-indicator\n        /// of the price of the crude oil ETF.The model will take in arguments for a threshold\n        /// at which the model triggers an insight, the length of the look-back period for evaluating\n        /// rate-of-change of UNG prices, and the duration of the insight\n        /// </summary>\n        private class PairsAlphaModel : AlphaModel\n        {\n            private readonly Symbol[] _leading;\n            private readonly Symbol[] _following;\n            private readonly int _historyDays;\n            private readonly int _lookback;\n            private readonly decimal _differenceTrigger = 0.75m;\n            private readonly Resolution _resolution;\n            private readonly TimeSpan _predictionInterval;\n            private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol;\n            private Tuple<SymbolData, SymbolData> _pair;\n\n            private DateTime _nextUpdate;\n\n            public PairsAlphaModel(\n                Symbol[] naturalGas,\n                Symbol[] crudeOil,\n                int historyDays = 90,\n                Resolution resolution = Resolution.Hour,\n                int lookback = 5,\n                decimal differenceTrigger = 0.75m)\n            {\n                _leading = naturalGas;\n                _following = crudeOil;\n                _historyDays = historyDays;\n                _resolution = resolution;\n                _lookback = lookback;\n                _differenceTrigger = differenceTrigger;\n                _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n                _predictionInterval = resolution.ToTimeSpan().Multiply(lookback);\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                if (_nextUpdate == DateTime.MinValue || algorithm.Time > _nextUpdate)\n                {\n                    CorrelationPairsSelection();\n                    _nextUpdate = algorithm.Time.AddDays(30);\n                }\n\n                var magnitude = (double)Math.Round(_pair.Item1.Return / 100, 6);\n\n                if (_pair.Item1.Return > _differenceTrigger)\n                {\n                    yield return Insight.Price(_pair.Item2.Symbol, _predictionInterval, InsightDirection.Up, magnitude);\n                }\n                if (_pair.Item1.Return < -_differenceTrigger)\n                {\n                    yield return Insight.Price(_pair.Item2.Symbol, _predictionInterval, InsightDirection.Down, magnitude);\n                }\n            }\n\n            public void CorrelationPairsSelection()\n            {\n                var maxCorrelation = -1.0;\n                var matrix = new double[_historyDays, _following.Length + 1];\n\n                // Get returns for each oil ETF\n                for (var j = 0; j < _following.Length; j++)\n                {\n                    SymbolData symbolData2;\n                    if (_symbolDataBySymbol.TryGetValue(_following[j], out symbolData2))\n                    {\n                        var dailyReturn2 = symbolData2.DailyReturnArray;\n                        for (var i = 0; i < _historyDays; i++)\n                        {\n                            matrix[i, j + 1] = symbolData2.DailyReturnArray[i];\n                        }\n                    }\n                }\n\n                // Get returns for each natural gas ETF\n                for (var j = 0; j < _leading.Length; j++)\n                {\n                    SymbolData symbolData1;\n                    if (_symbolDataBySymbol.TryGetValue(_leading[j], out symbolData1))\n                    {\n                        for (var i = 0; i < _historyDays; i++)\n                        {\n                            matrix[i, 0] = symbolData1.DailyReturnArray[i];\n                        }\n\n                        var column = matrix.Correlation().GetColumn(0);\n                        var correlation = column.RemoveAt(0).Max();\n\n                        // Calculate the pair with highest historical correlation\n                        if (correlation > maxCorrelation)\n                        {\n                            var maxIndex = column.IndexOf(correlation) - 1;\n                            if (maxIndex < 0) continue;\n                            var symbolData2 = _symbolDataBySymbol[_following[maxIndex]];\n                            _pair = Tuple.Create(symbolData1, symbolData2);\n                            maxCorrelation = correlation;\n                        }\n                    }\n                }\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                foreach (var removed in changes.RemovedSecurities)\n                {\n                    if (_symbolDataBySymbol.ContainsKey(removed.Symbol))\n                    {\n                        _symbolDataBySymbol[removed.Symbol].RemoveConsolidators(algorithm);\n                        _symbolDataBySymbol.Remove(removed.Symbol);\n                    }\n                }\n\n                // Initialize data for added securities\n                var symbols = changes.AddedSecurities.Select(x => x.Symbol);\n                var dailyHistory = algorithm.History(symbols, _historyDays + 1, Resolution.Daily);\n                if (symbols.Count() > 0 && dailyHistory.Count() == 0)\n                {\n                    algorithm.Debug($\"{algorithm.Time} :: No daily data\");\n                }\n\n                dailyHistory.PushThrough(bar =>\n                {\n                    SymbolData symbolData;\n                    if (!_symbolDataBySymbol.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData = new SymbolData(algorithm, bar.Symbol, _historyDays, _lookback, _resolution);\n                        _symbolDataBySymbol.Add(bar.Symbol, symbolData);\n                    }\n                    // Update daily rate of change indicator\n                    symbolData.UpdateDailyRateOfChange(bar);\n                });\n\n                algorithm.History(symbols, _lookback, _resolution).PushThrough(bar =>\n                {\n                    // Update rate of change indicator with given resolution\n                    if (_symbolDataBySymbol.ContainsKey(bar.Symbol))\n                    {\n                        _symbolDataBySymbol[bar.Symbol].UpdateRateOfChange(bar);\n                    }\n                });\n            }\n\n            /// <summary>\n            /// Contains data specific to a symbol required by this model\n            /// </summary>\n            private class SymbolData\n            {\n                private readonly RateOfChangePercent _dailyReturn;\n                private readonly IDataConsolidator _dailyConsolidator;\n                private readonly RollingWindow<IndicatorDataPoint> _dailyReturnHistory;\n                private readonly IDataConsolidator _consolidator;\n\n                public Symbol Symbol { get; }\n\n                public RateOfChangePercent Return { get; }\n\n                public double[] DailyReturnArray => _dailyReturnHistory\n                    .OrderBy(x => x.EndTime)\n                    .Select(x => (double)x.Value).ToArray();\n\n                public SymbolData(QCAlgorithm algorithm, Symbol symbol, int dailyLookback, int lookback, Resolution resolution)\n                {\n                    Symbol = symbol;\n\n                    _dailyReturn = new RateOfChangePercent($\"{symbol}.DailyROCP(1)\", 1);\n                    _dailyConsolidator = algorithm.ResolveConsolidator(symbol, Resolution.Daily);\n                    _dailyReturnHistory = new RollingWindow<IndicatorDataPoint>(dailyLookback);\n                    _dailyReturn.Updated += (s, e) => _dailyReturnHistory.Add(e);\n                    algorithm.RegisterIndicator(symbol, _dailyReturn, _dailyConsolidator);\n\n                    Return = new RateOfChangePercent($\"{symbol}.ROCP({lookback})\", lookback);\n                    _consolidator = algorithm.ResolveConsolidator(symbol, resolution);\n                    algorithm.RegisterIndicator(symbol, Return, _consolidator);\n                }\n\n                public void RemoveConsolidators(QCAlgorithm algorithm)\n                {\n                    algorithm.SubscriptionManager.RemoveConsolidator(Symbol, _consolidator);\n                    algorithm.SubscriptionManager.RemoveConsolidator(Symbol, _dailyConsolidator);\n                }\n\n                public void UpdateRateOfChange(BaseData data)\n                {\n                    Return.Update(data.EndTime, data.Value);\n                }\n\n                internal void UpdateDailyRateOfChange(BaseData data)\n                {\n                    _dailyReturn.Update(data.EndTime, data.Value);\n                }\n\n                public override string ToString() => Return.ToDetailedString();\n            }\n        }\n\n        /// <summary>\n        /// Provides an implementation of IExecutionModel that immediately submits market orders to achieve the desired portfolio targets\n        /// </summary>\n        private class CustomExecutionModel : ExecutionModel\n        {\n            private readonly PortfolioTargetCollection _targetsCollection = new PortfolioTargetCollection();\n            private Symbol _previousSymbol;\n\n            /// <summary>\n            /// Immediately submits orders for the specified portfolio targets.\n            /// </summary>\n            /// <param name=\"algorithm\">The algorithm instance</param>\n            /// <param name=\"targets\">The portfolio targets to be ordered</param>\n            public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n            {\n                _targetsCollection.AddRange(targets);\n\n                foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                {\n                    var openQuantity = algorithm.Transactions.GetOpenOrders(target.Symbol)\n                        .Sum(x => x.Quantity);\n                    var existing = algorithm.Securities[target.Symbol].Holdings.Quantity + openQuantity;\n                    var quantity = target.Quantity - existing;\n\n                    // Liquidate positions in Crude Oil ETF that is no longer part of the highest-correlation pair\n                    if (_previousSymbol != null && target.Symbol != _previousSymbol)\n                    {\n                        algorithm.Liquidate(_previousSymbol);\n                    }\n                    if (quantity != 0)\n                    {\n                        algorithm.MarketOrder(target.Symbol, quantity);\n                        _previousSymbol = target.Symbol;\n                    }\n                }\n                _targetsCollection.ClearFulfilled(algorithm);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/GlobalEquityMeanReversionIBSAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// Equity indices exhibit mean reversion in daily returns. The Internal Bar Strength indicator (IBS),\n    /// which relates the closing price of a security to its daily range can be used to identify overbought\n    /// and oversold securities.\n    ///\n    /// This alpha ranks 33 global equity ETFs on its IBS value the previous day and predicts for the following day\n    /// that the ETF with the highest IBS value will decrease in price, and the ETF with the lowest IBS value\n    /// will increase in price.\n    ///\n    /// Source: Kakushadze, Zura, and Juan Andrés Serur. “4. Exchange-Traded Funds (ETFs).” 151 Trading Strategies, Palgrave Macmillan, 2018, pp. 90–91.\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class GlobalEquityMeanReversionIBSAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Global Equity ETF tickers\n            var symbols = new[] {\n                \"ECH\", \"EEM\", \"EFA\", \"EPHE\", \"EPP\", \"EWA\", \"EWC\", \"EWG\",\n                \"EWH\", \"EWI\", \"EWJ\", \"EWL\", \"EWM\", \"EWM\", \"EWO\", \"EWP\",\n                \"EWQ\", \"EWS\", \"EWT\", \"EWU\", \"EWY\", \"EWZ\", \"EZA\", \"FXI\",\n                \"GXG\", \"IDX\", \"ILF\", \"EWM\", \"QQQ\", \"RSX\", \"SPY\", \"THD\"}\n                .Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA));\n\n            // Manually curated universe\n            UniverseSettings.Resolution = Resolution.Daily;\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n            // Use MeanReversionIBSAlphaModel to establish insights\n            SetAlpha(new MeanReversionIBSAlphaModel());\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Uses ranking of Internal Bar Strength (IBS) to create direction prediction for insights\n        /// </summary>\n        private class MeanReversionIBSAlphaModel : AlphaModel\n        {\n            private readonly int _numberOfStocks;\n            private readonly TimeSpan _predictionInterval;\n\n            public MeanReversionIBSAlphaModel(\n                int lookback = 1,\n                int numberOfStocks = 2,\n                Resolution resolution = Resolution.Daily)\n            {\n                _numberOfStocks = numberOfStocks;\n                _predictionInterval = resolution.ToTimeSpan().Multiply(lookback);\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                var symbolsIBS = new Dictionary<Symbol, decimal>();\n                var returns = new Dictionary<Symbol, decimal>();\n\n                foreach (var kvp in algorithm.ActiveSecurities)\n                {\n                    var security = kvp.Value;\n                    if (security.HasData)\n                    {\n                        var high = security.High;\n                        var low = security.Low;\n                        var hilo = high - low;\n\n                        // Do not consider symbol with zero open and avoid division by zero\n                        if (security.Open * hilo != 0)\n                        {\n                            // Internal bar strength (IBS)\n                            symbolsIBS.Add(security.Symbol, (security.Close - low) / hilo);\n                            returns.Add(security.Symbol, security.Close / security.Open - 1);\n                        }\n                    }\n                }\n\n                var insights = new List<Insight>();\n\n                // Number of stocks cannot be higher than half of symbolsIBS length\n                var numberOfStocks = Math.Min((int)(symbolsIBS.Count / 2.0), _numberOfStocks);\n                if (numberOfStocks == 0)\n                {\n                    return insights;\n                }\n\n                // Rank securities with the highest IBS value\n                var ordered = from entry in symbolsIBS\n                              orderby Math.Round(entry.Value, 6) descending, entry.Key\n                              select entry;\n                var highIBS = ordered.Take(numberOfStocks);            // Get highest IBS\n                var lowIBS = ordered.Reverse().Take(numberOfStocks);   // Get lowest IBS\n\n                // Emit \"down\" insight for the securities with the highest IBS value\n                foreach (var kvp in highIBS)\n                {\n                    insights.Add(Insight.Price(kvp.Key, _predictionInterval, InsightDirection.Down, Math.Abs((double)returns[kvp.Key])));\n                }\n\n                // Emit \"up\" insight for the securities with the highest IBS value\n                foreach (var kvp in lowIBS)\n                {\n                    insights.Add(Insight.Price(kvp.Key, _predictionInterval, InsightDirection.Up, Math.Abs((double)returns[kvp.Key])));\n                }\n\n                return insights;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// This alpha picks stocks according to Joel Greenblatt's Magic Formula.\n    /// First, each stock is ranked depending on the relative value of the ratio EV/EBITDA. For example, a stock\n    /// that has the lowest EV/EBITDA ratio in the security universe receives a score of one while a stock that has\n    /// the tenth lowest EV/EBITDA score would be assigned 10 points.\n    ///\n    /// Then, each stock is ranked and given a score for the second valuation ratio, Return on Capital (ROC).\n    /// Similarly, a stock that has the highest ROC value in the universe gets one score point.\n    /// The stocks that receive the lowest combined score are chosen for insights.\n    ///\n    /// Source: Greenblatt, J. (2010) The Little Book That Beats the Market\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    /// sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class GreenblattMagicFormulaAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Select stocks using MagicFormulaUniverseSelectionModel\n            SetUniverseSelection(new GreenBlattMagicFormulaUniverseSelectionModel());\n\n            // Use RateOfChangeAlphaModel to establish insights\n            SetAlpha(new RateOfChangeAlphaModel());\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Uses Rate of Change (ROC) to create magnitude prediction for insights.\n        /// </summary>\n        private class RateOfChangeAlphaModel : AlphaModel\n        {\n            private readonly int _lookback;\n            private readonly Resolution _resolution;\n            private readonly TimeSpan _predictionInterval;\n            private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol;\n\n            public RateOfChangeAlphaModel(\n                int lookback = 1,\n                Resolution resolution = Resolution.Daily)\n            {\n                _lookback = lookback;\n                _resolution = resolution;\n                _predictionInterval = resolution.ToTimeSpan().Multiply(lookback);\n                _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                var insights = new List<Insight>();\n\n                foreach (var kvp in _symbolDataBySymbol)\n                {\n                    var symbolData = kvp.Value;\n                    if (symbolData.CanEmit)\n                    {\n                        var magnitude = Convert.ToDouble(Math.Abs(symbolData.Return));\n                        insights.Add(Insight.Price(kvp.Key, _predictionInterval, InsightDirection.Up, magnitude));\n                    }\n                }\n\n                return insights;\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                // Clean up data for removed securities\n                foreach (var removed in changes.RemovedSecurities)\n                {\n                    SymbolData symbolData;\n                    if (_symbolDataBySymbol.TryGetValue(removed.Symbol, out symbolData))\n                    {\n                        symbolData.RemoveConsolidators(algorithm);\n                        _symbolDataBySymbol.Remove(removed.Symbol);\n                    }\n                }\n\n                // Initialize data for added securities\n                var symbols = changes.AddedSecurities.Select(x => x.Symbol);\n                var history = algorithm.History(symbols, _lookback, _resolution);\n                if (symbols.Count() == 0 && history.Count() == 0)\n                {\n                    return;\n                }\n\n                history.PushThrough(bar =>\n                {\n                    SymbolData symbolData;\n                    if (!_symbolDataBySymbol.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData = new SymbolData(algorithm, bar.Symbol, _lookback, _resolution);\n                        _symbolDataBySymbol[bar.Symbol] = symbolData;\n                    }\n                    symbolData.WarmUpIndicators(bar);\n                });\n            }\n\n            /// <summary>\n            /// Contains data specific to a symbol required by this model\n            /// </summary>\n            private class SymbolData\n            {\n                private readonly Symbol _symbol;\n                private readonly IDataConsolidator _consolidator;\n                private long _previous = 0;\n\n                public RateOfChange Return { get; }\n\n                public bool CanEmit\n                {\n                    get\n                    {\n                        if (_previous == Return.Samples)\n                        {\n                            return false;\n                        }\n                        _previous = Return.Samples;\n                        return Return.IsReady;\n                    }\n                }\n\n                public SymbolData(QCAlgorithm algorithm, Symbol symbol, int lookback, Resolution resolution)\n                {\n                    _symbol = symbol;\n                    Return = new RateOfChange($\"{symbol}.ROC({lookback})\", lookback);\n                    _consolidator = algorithm.ResolveConsolidator(symbol, resolution);\n                    algorithm.RegisterIndicator(symbol, Return, _consolidator);\n                }\n\n                internal void RemoveConsolidators(QCAlgorithm algorithm)\n                {\n                    algorithm.SubscriptionManager.RemoveConsolidator(_symbol, _consolidator);\n                }\n\n                internal void WarmUpIndicators(BaseData bar)\n                {\n                    Return.Update(bar.EndTime, bar.Value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Defines a universe according to Joel Greenblatt's Magic Formula, as a universe selection model for the framework algorithm.\n        /// From the universe QC500, stocks are ranked using the valuation ratios, Enterprise Value to EBITDA(EV/EBITDA) and Return on Assets(ROA).\n        /// </summary>\n        private class GreenBlattMagicFormulaUniverseSelectionModel : FundamentalUniverseSelectionModel\n        {\n            private const int _numberOfSymbolsCoarse = 500;\n            private const int _numberOfSymbolsFine = 20;\n            private const int _numberOfSymbolsInPortfolio = 10;\n            private int _lastMonth = -1;\n            private Dictionary<Symbol, double> _dollarVolumeBySymbol;\n\n            public GreenBlattMagicFormulaUniverseSelectionModel() : base(true)\n            {\n                _dollarVolumeBySymbol = new ();\n            }\n\n            /// <summary>\n            /// Performs coarse selection for constituents.\n            /// The stocks must have fundamental data\n            /// The stock must have positive previous-day close price\n            /// The stock must have positive volume on the previous trading day\n            /// </summary>\n            public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n            {\n                if (algorithm.Time.Month == _lastMonth)\n                {\n                    return algorithm.Universe.Unchanged;\n                }\n                _lastMonth = algorithm.Time.Month;\n\n                _dollarVolumeBySymbol = (\n                    from cf in coarse\n                    where cf.HasFundamentalData\n                    orderby cf.DollarVolume descending\n                    select new { cf.Symbol, cf.DollarVolume }\n                    )\n                    .Take(_numberOfSymbolsCoarse)\n                    .ToDictionary(x => x.Symbol, x => x.DollarVolume);\n\n                return _dollarVolumeBySymbol.Keys;\n            }\n\n            /// <summary>\n            /// QC500: Performs fine selection for the coarse selection constituents\n            /// The company's headquarter must in the U.S.\n            /// The stock must be traded on either the NYSE or NASDAQ\n            /// At least half a year since its initial public offering\n            /// The stock's market cap must be greater than 500 million\n            ///\n            /// Magic Formula: Rank stocks by Enterprise Value to EBITDA(EV/EBITDA)\n            /// Rank subset of previously ranked stocks(EV/EBITDA), using the valuation ratio Return on Assets(ROA)\n            /// </summary>\n            public override IEnumerable<Symbol> SelectFine(QCAlgorithm algorithm, IEnumerable<FineFundamental> fine)\n            {\n                var filteredFine =\n                    from x in fine\n                    where x.CompanyReference.CountryId == \"USA\"\n                    where x.CompanyReference.PrimaryExchangeID == \"NYS\" || x.CompanyReference.PrimaryExchangeID == \"NAS\"\n                    where (algorithm.Time - x.SecurityReference.IPODate).TotalDays > 180\n                    where x.EarningReports.BasicAverageShares.ThreeMonths * x.EarningReports.BasicEPS.TwelveMonths * x.ValuationRatios.PERatio > 5e8\n                    select x;\n\n                double count = filteredFine.Count();\n                if (count == 0)\n                {\n                    return Enumerable.Empty<Symbol>();\n                }\n\n                var percent = _numberOfSymbolsFine / count;\n\n                // Select stocks with top dollar volume in every single sector\n                var myDict = (\n                    from x in filteredFine\n                    group x by x.CompanyReference.IndustryTemplateCode into g\n                    let y = (\n                        from item in g\n                        orderby _dollarVolumeBySymbol[item.Symbol] descending\n                        select item\n                    )\n                    let c = (int)Math.Ceiling(y.Count() * percent)\n                    select new { g.Key, Value = y.Take(c) }\n                    )\n                    .ToDictionary(x => x.Key, x => x.Value);\n\n                // Stocks in QC500 universe\n                var topFine = myDict.Values.SelectMany(x => x);\n\n                // Magic Formula:\n                // Rank stocks by Enterprise Value to EBITDA (EV/EBITDA)\n                // Rank subset of previously ranked stocks (EV/EBITDA), using the valuation ratio Return on Assets (ROA)\n                return topFine\n                    // Sort stocks in the security universe of QC500 based on Enterprise Value to EBITDA valuation ratio\n                    .OrderByDescending(x => x.ValuationRatios.EVToEBITDA)\n                    .Take(_numberOfSymbolsFine)\n                    // sort subset of stocks that have been sorted by Enterprise Value to EBITDA, based on the valuation ratio Return on Assets (ROA)\n                    .OrderByDescending(x => x.ValuationRatios.ForwardROA)\n                    .Take(_numberOfSymbolsInPortfolio)\n                    .Select(x => x.Symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Alphas/IntradayReversalCurrencyMarketsAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// Reversal strategy that goes long when price crosses below SMA and Short when price crosses above SMA.\n    /// The trading strategy is implemented only between 10AM - 3PM (NY time). Research suggests this is due to\n    /// institutional trades during market hours which need hedging with the USD. Source paper:\n    /// LeBaron, Zhao: Intraday Foreign Exchange Reversals\n    /// http://people.brandeis.edu/~blebaron/wps/fxnyc.pdf\n    /// http://www.fma.org/Reno/Papers/ForeignExchangeReversalsinNewYorkTime.pdf\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class IntradayReversalCurrencyMarketsAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2015, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Select resolution\n            var resolution = Resolution.Hour;\n\n            // Reversion on the USD.\n            var symbols = new[] { QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda) };\n\n            // Set requested data resolution\n            UniverseSettings.Resolution = resolution;\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n            // Use IntradayReversalAlphaModel to establish insights\n            SetAlpha(new IntradayReversalAlphaModel(5, resolution));\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Alpha model that uses a Price/SMA Crossover to create insights on Hourly Frequency.\n        /// Frequency: Hourly data with 5-hour simple moving average.\n        /// Strategy:\n        /// Reversal strategy that goes Long when price crosses below SMA and Short when price crosses above SMA.\n        /// The trading strategy is implemented only between 10AM - 3PM (NY time)\n        /// </summary>\n        private class IntradayReversalAlphaModel : AlphaModel\n        {\n            private readonly int _periodSma;\n            private readonly Resolution _resolution;\n            private readonly Dictionary<Symbol, SymbolData> _cache;\n\n            public IntradayReversalAlphaModel(\n                int periodSma = 5,\n                Resolution resolution = Resolution.Hour)\n            {\n                _periodSma = periodSma;\n                _resolution = resolution;\n                _cache = new Dictionary<Symbol, SymbolData>();\n                Name = \"IntradayReversalAlphaModel\";\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                // Set the time to close all positions at 3PM\n                var timeToClose = algorithm.Time.Date.Add(new TimeSpan(0, 15, 1, 0));\n\n                var insights = new List<Insight>();\n\n                foreach (var kvp in algorithm.ActiveSecurities)\n                {\n                    var symbol = kvp.Key;\n\n                    SymbolData symbolData;\n\n                    if (ShouldEmitInsight(algorithm, symbol) &&\n                        _cache.TryGetValue(symbol, out symbolData))\n                    {\n                        var price = kvp.Value.Price;\n\n                        var direction = symbolData.IsUptrend(price)\n                            ? InsightDirection.Up\n                            : InsightDirection.Down;\n\n                        // Ignore signal for same direction as previous signal (when no crossover)\n                        if (direction == symbolData.PreviousDirection)\n                        {\n                            continue;\n                        }\n\n                        // Save the current Insight Direction to check when the crossover happens\n                        symbolData.PreviousDirection = direction;\n\n                        // Generate insight\n                        insights.Add(Insight.Price(symbol, timeToClose, direction));\n                    }\n                }\n\n                return insights;\n            }\n\n            private bool ShouldEmitInsight(QCAlgorithm algorithm, Symbol symbol)\n            {\n                var timeOfDay = algorithm.Time.TimeOfDay;\n\n                return algorithm.Securities[symbol].HasData &&\n                    timeOfDay >= TimeSpan.FromHours(10) &&\n                    timeOfDay <= TimeSpan.FromHours(15);\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                foreach (var symbol in changes.AddedSecurities.Select(x => x.Symbol))\n                {\n                    if (_cache.ContainsKey(symbol)) continue;\n                    _cache.Add(symbol, new SymbolData(algorithm, symbol, _periodSma, _resolution));\n                }\n            }\n\n            /// <summary>\n            /// Contains data specific to a symbol required by this model\n            /// </summary>\n            private class SymbolData\n            {\n                private readonly SimpleMovingAverage _priceSMA;\n\n                public InsightDirection PreviousDirection { get; set; }\n\n                public SymbolData(QCAlgorithm algorithm, Symbol symbol, int periodSma, Resolution resolution)\n                {\n                    PreviousDirection = InsightDirection.Flat;\n                    _priceSMA = algorithm.SMA(symbol, periodSma, resolution);\n                }\n\n                public bool IsUptrend(decimal price)\n                {\n                    return _priceSMA.IsReady && price < Math.Round(_priceSMA * 1.001m, 6);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/MeanReversionLunchBreakAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// This alpha aims to capture the mean-reversion effect of ETFs during lunch-break by ranking 20 ETFs\n    /// on their return between the close of the previous day to 12:00 the day after and predicting mean-reversion\n    /// in price during lunch-break.\n    ///\n    /// Source:  Lunina, V. (June 2011). The Intraday Dynamics of Stock Returns and Trading Activity: Evidence from OMXS 30 (Master's Essay, Lund University).\n    /// Retrieved from http://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=1973850&fileOId=1973852\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class MeanReversionLunchBreakAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Use Hourly Data For Simplicity\n            UniverseSettings.Resolution = Resolution.Hour;\n            SetUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelectionFunction));\n\n            // Use MeanReversionLunchBreakAlphaModel to establish insights\n            SetAlpha(new MeanReversionLunchBreakAlphaModel());\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Sort the data by daily dollar volume and take the top '20' ETFs\n        /// </summary>\n        private IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            return (from cf in coarse\n                    where !cf.HasFundamentalData\n                    orderby cf.DollarVolume descending\n                    select cf.Symbol).Take(20);\n        }\n\n        /// <summary>\n        /// Uses the price return between the close of previous day to 12:00 the day after to\n        /// predict mean-reversion of stock price during lunch break and creates direction prediction\n        /// for insights accordingly.\n        /// </summary>\n        private class MeanReversionLunchBreakAlphaModel : AlphaModel\n        {\n            private const Resolution _resolution = Resolution.Hour;\n            private readonly TimeSpan _predictionInterval;\n            private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol;\n\n            public MeanReversionLunchBreakAlphaModel(int lookback = 1)\n            {\n                _predictionInterval = _resolution.ToTimeSpan().Multiply(lookback);\n                _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                foreach (var kvp in _symbolDataBySymbol)\n                {\n                    if (data.Bars.ContainsKey(kvp.Key))\n                    {\n                        var bar = data.Bars.GetValue(kvp.Key);\n                        kvp.Value.Update(bar.EndTime, bar.Close);\n                    }\n                }\n\n                return algorithm.Time.Hour == 12\n                    ? _symbolDataBySymbol.Select(kvp => kvp.Value.Insight)\n                    : Enumerable.Empty<Insight>();\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                foreach (var security in changes.RemovedSecurities)\n                {\n                    if (_symbolDataBySymbol.ContainsKey(security.Symbol))\n                    {\n                        _symbolDataBySymbol.Remove(security.Symbol);\n                    }\n                }\n\n                // Retrieve price history for all securities in the security universe\n                // and update the indicators in the SymbolData object\n                var symbols = changes.AddedSecurities.Select(x => x.Symbol);\n                var history = algorithm.History(symbols, 1, _resolution);\n                if (symbols.Count() > 0 && history.Count() == 0)\n                {\n                    algorithm.Debug($\"No data on {algorithm.Time}\");\n                }\n\n                history.PushThrough(bar =>\n                {\n                    SymbolData symbolData;\n                    if (!_symbolDataBySymbol.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData = new SymbolData(bar.Symbol, _predictionInterval);\n                    }\n                    symbolData.Update(bar.EndTime, bar.Price);\n                    _symbolDataBySymbol[bar.Symbol] = symbolData;\n                });\n            }\n\n            /// <summary>\n            /// Contains data specific to a symbol required by this model\n            /// </summary>\n            private class SymbolData\n            {\n                // Mean value of returns for magnitude prediction\n                private readonly SimpleMovingAverage _meanOfPriceChange = new RateOfChangePercent(1).SMA(3);\n                // Price change from close price the previous day\n                private readonly RateOfChangePercent _priceChange = new RateOfChangePercent(3);\n\n                private readonly Symbol _symbol;\n                private readonly TimeSpan _period;\n\n                public Insight Insight\n                {\n                    get\n                    {\n                        // Emit \"down\" insight for the securities that increased in value and\n                        // emit \"up\" insight for securities that have decreased in value\n                        var direction = _priceChange > 0 ? InsightDirection.Down : InsightDirection.Up;\n                        var magnitude = Convert.ToDouble(Math.Abs(_meanOfPriceChange));\n                        return Insight.Price(_symbol, _period, direction, magnitude);\n                    }\n                }\n\n                public SymbolData(Symbol symbol, TimeSpan period)\n                {\n                    _symbol = symbol;\n                    _period = period;\n                }\n\n                public bool Update(DateTime time, decimal value)\n                {\n                    return _meanOfPriceChange.Update(time, value) &\n                        _priceChange.Update(time, value);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/RebalancingLeveragedETFAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    ///<summary>\n    /// Alpha Benchmark Strategy capitalizing on ETF rebalancing causing momentum during trending markets.\n    /// Strategy by Prof. Shum, reposted by Ernie Chan.\n    /// Source: http://epchan.blogspot.com/2012/10/a-leveraged-etfs-strategy.html\n    ///</summary>\n    /// <meta name=\"tag\" content=\"alphastream\" />\n    /// <meta name=\"tag\" content=\"algorithm framework\" />\n    /// <meta name=\"tag\" content=\"etf\" />\n    public class RebalancingLeveragedETFAlpha : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly List<ETFGroup> Groups = new List<ETFGroup>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 6, 1);\n            SetEndDate(2018, 8, 1);\n            SetCash(100000);\n\n            var underlying = new List<string> { \"SPY\", \"QLD\", \"DIA\", \"IJR\", \"MDY\", \"IWM\", \"QQQ\", \"IYE\", \"EEM\", \"IYW\", \"EFA\", \"GAZB\", \"SLV\", \"IEF\", \"IYM\", \"IYF\", \"IYH\", \"IYR\", \"IYC\", \"IBB\", \"FEZ\", \"USO\", \"TLT\" };\n            var ultraLong = new List<string> { \"SSO\", \"UGL\", \"DDM\", \"SAA\", \"MZZ\", \"UWM\", \"QLD\", \"DIG\", \"EET\", \"ROM\", \"EFO\", \"BOIL\", \"AGQ\", \"UST\", \"UYM\", \"UYG\", \"RXL\", \"URE\", \"UCC\", \"BIB\", \"ULE\", \"UCO\", \"UBT\" };\n            var ultraShort = new List<string> { \"SDS\", \"GLL\", \"DXD\", \"SDD\", \"MVV\", \"TWM\", \"QID\", \"DUG\", \"EEV\", \"REW\", \"EFU\", \"KOLD\", \"ZSL\", \"PST\", \"SMN\", \"SKF\", \"RXD\", \"SRS\", \"SCC\", \"BIS\", \"EPV\", \"SCO\", \"TBT\" };\n\n            for (var i = 0; i < underlying.Count; i++)\n            {\n                Groups.Add(new ETFGroup(AddEquity(underlying[i]).Symbol, AddEquity(ultraLong[i]).Symbol, AddEquity(ultraShort[i]).Symbol));\n            }\n\n            // Manually curated universe\n            SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            // Select the demonstration alpha model\n            SetAlpha(new RebalancingLeveragedETFAlphaModel(Groups));\n\n            // Select our default model types\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2465\"},\n            {\"Average Win\", \"0.26%\"},\n            {\"Average Loss\", \"-0.24%\"},\n            {\"Compounding Annual Return\", \"7.848%\"},\n            {\"Drawdown\", \"17.500%\"},\n            {\"Expectancy\", \"0.035\"},\n            {\"Net Profit\", \"9.233%\"},\n            {\"Sharpe Ratio\", \"0.492\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.06\"},\n            {\"Alpha\", \"0.585\"},\n            {\"Beta\", \"-24.639\"},\n            {\"Annual Standard Deviation\", \"0.19\"},\n            {\"Annual Variance\", \"0.036\"},\n            {\"Information Ratio\", \"0.387\"},\n            {\"Tracking Error\", \"0.19\"},\n            {\"Treynor Ratio\", \"-0.004\"},\n            {\"Total Fees\", \"$9029.33\"}\n        };\n    }\n\n    /// <summary>\n    /// If the underlying ETF has experienced a return >= 1% since the previous day's close up to the current time at 14:15,\n    /// then buy it's ultra ETF right away, and exit at the close. If the return is &lt;= -1%, sell it's ultra-short ETF.\n    /// </summary>\n    class RebalancingLeveragedETFAlphaModel : AlphaModel\n    {\n        private DateTime _date;\n        private readonly List<ETFGroup> _etfGroups;\n\n        /// <summary>\n        /// Create a new leveraged ETF rebalancing alpha\n        /// </summary>\n        public RebalancingLeveragedETFAlphaModel(List<ETFGroup> etfGroups)\n        {\n            _etfGroups = etfGroups;\n            _date = DateTime.MinValue;\n            Name = \"RebalancingLeveragedETFAlphaModel\";\n        }\n\n        /// <summary>\n        /// Scan to see if the returns are greater than 1% at 2.15pm to emit an insight.\n        /// </summary>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            // Initialize:\n            var insights = new List<Insight>();\n            var magnitude = 0.0005;\n\n            // Paper suggests leveraged ETF's rebalance from 2.15pm - to close\n            // giving an insight period of 105 minutes.\n            var period = TimeSpan.FromMinutes(105);\n\n            if (algorithm.Time.Date != _date)\n            {\n                _date = algorithm.Time.Date;\n\n                // Save yesterday's price and reset the signal.\n                foreach (var group in _etfGroups)\n                {\n                    var history = algorithm.History(group.Underlying, 1, Resolution.Daily);\n                    group.YesterdayClose = history.Select(x => x.Close).FirstOrDefault();\n                }\n            }\n\n            // Check if the returns are > 1% at 14.15\n            if (algorithm.Time.Hour == 14 && algorithm.Time.Minute == 15)\n            {\n                foreach (var group in _etfGroups)\n                {\n                    if (group.YesterdayClose == 0) continue;\n                    var returns = (algorithm.Portfolio[group.Underlying].Price - group.YesterdayClose) / group.YesterdayClose;\n\n                    if (returns > 0.01m)\n                    {\n                        insights.Add(Insight.Price(group.UltraLong, period, InsightDirection.Up, magnitude));\n                    }\n                    else if (returns < -0.01m)\n                    {\n                        insights.Add(Insight.Price(group.UltraShort, period, InsightDirection.Down, magnitude));\n                    }\n                }\n            }\n            return insights;\n        }\n    }\n\n    class ETFGroup\n    {\n        public Symbol Underlying;\n        public Symbol UltraLong;\n        public Symbol UltraShort;\n        public decimal YesterdayClose;\n\n        /// <summary>\n        /// Group the underlying ETF and it's ultra ETFs\n        /// </summary>\n        /// <param name=\"underlying\">The underlying indexETF</param>\n        /// <param name=\"ultraLong\">The long-leveraged version of underlying ETF</param>\n        /// <param name=\"ultraShort\">The short-leveraged version of the underlying ETF</param>\n        public ETFGroup(Symbol underlying, Symbol ultraLong, Symbol ultraShort)\n        {\n            Underlying = underlying;\n            UltraLong = ultraLong;\n            UltraShort = ultraShort;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Alphas/ShareClassMeanReversionAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// A number of companies publicly trade two different classes of shares\n    /// in US equity markets. If both assets trade with reasonable volume, then\n    /// the underlying driving forces of each should be similar or the same. Given\n    /// this, we can create a relatively dollar-neutral long/short portfolio using\n    /// the dual share classes. Theoretically, any deviation of this portfolio from\n    /// its mean-value should be corrected, and so the motivating idea is based on\n    /// mean-reversion. Using a Simple Moving Average indicator, we can\n    /// compare the value of this portfolio against its SMA and generate insights\n    /// to buy the under-valued symbol and sell the over-valued symbol.\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    /// </summary>\n    public class ShareClassMeanReversionAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2019, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            SetWarmUp(20);\n\n            // Setup Universe settings and tickers to be used\n            var symbols = new[] { \"VIA\", \"VIAB\" }\n                .Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA));\n\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n            // Use ShareClassMeanReversionAlphaModel to establish insights\n            SetAlpha(new ShareClassMeanReversionAlphaModel(symbols));\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        private class ShareClassMeanReversionAlphaModel : AlphaModel\n        {\n            private const double _insightMagnitude = 0.001;\n            private readonly Symbol _longSymbol;\n            private readonly Symbol _shortSymbol;\n            private readonly TimeSpan _insightPeriod;\n            private readonly SimpleMovingAverage _sma;\n            private readonly RollingWindow<decimal> _positionWindow;\n            private decimal _alpha;\n            private decimal _beta;\n            private bool _invested;\n\n            public ShareClassMeanReversionAlphaModel(\n                IEnumerable<Symbol> symbols,\n                Resolution resolution = Resolution.Minute)\n            {\n                if (symbols.Count() != 2)\n                {\n                    throw new ArgumentException(\"ShareClassMeanReversionAlphaModel: symbols parameter must contain 2 elements\");\n                }\n                _longSymbol = symbols.ToArray()[0];\n                _shortSymbol = symbols.ToArray()[1];\n                _insightPeriod = resolution.ToTimeSpan().Multiply(5);\n                _sma = new SimpleMovingAverage(2);\n                _positionWindow = new RollingWindow<decimal>(2);\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                // Check to see if either ticker will return a NoneBar, and skip the data slice if so\n                if (data.Bars.Count < 2)\n                {\n                    return Enumerable.Empty<Insight>();\n                }\n\n                // If Alpha and Beta haven't been calculated yet, then do so\n                if (_alpha == 0 || _beta == 0)\n                {\n                    CalculateAlphaBeta(algorithm);\n                }\n\n                // Update indicator and Rolling Window for each data slice passed into Update() method\n                if (!UpdateIndicators(data))\n                {\n                    return Enumerable.Empty<Insight>();\n                }\n\n                // Check to see if the portfolio is invested. If no, then perform value comparisons and emit insights accordingly\n                if (!_invested)\n                {\n                    //Reset invested boolean\n                    _invested = true;\n\n                    if (_positionWindow[0] > _sma)\n                    {\n                        return Insight.Group(new[]\n                        {\n                            Insight.Price(_longSymbol, _insightPeriod, InsightDirection.Down, _insightMagnitude),\n                            Insight.Price(_shortSymbol, _insightPeriod, InsightDirection.Up, _insightMagnitude),\n                        });\n                    }\n                    else\n                    {\n                        return Insight.Group(new[]\n                    {\n                            Insight.Price(_longSymbol, _insightPeriod, InsightDirection.Up, _insightMagnitude),\n                            Insight.Price(_shortSymbol, _insightPeriod, InsightDirection.Down, _insightMagnitude),\n                        });\n                    }\n                }\n                // If the portfolio is invested and crossed back over the SMA, then emit flat insights\n                else if (_invested && CrossedMean())\n                {\n                    _invested = false;\n                }\n\n                return Enumerable.Empty<Insight>();\n            }\n\n            /// <summary>\n            /// Calculate Alpha and Beta, the initial number of shares for each security needed to achieve a 50/50 weighting\n            /// </summary>\n            /// <param name=\"algorithm\"></param>\n            private void CalculateAlphaBeta(QCAlgorithm algorithm)\n            {\n                _alpha = algorithm.CalculateOrderQuantity(_longSymbol, 0.5);\n                _beta = algorithm.CalculateOrderQuantity(_shortSymbol, 0.5);\n                algorithm.Log($\"{algorithm.Time} :: Alpha: {_alpha} Beta: {_beta}\");\n            }\n\n            /// <summary>\n            /// Calculate position value and update the SMA indicator and Rolling Window\n            /// </summary>\n            private bool UpdateIndicators(Slice data)\n            {\n                var positionValue = (_alpha * data[_longSymbol].Close) - (_beta * data[_shortSymbol].Close);\n                _sma.Update(data[_longSymbol].EndTime, positionValue);\n                _positionWindow.Add(positionValue);\n                return _sma.IsReady && _positionWindow.IsReady;\n            }\n\n            /// <summary>\n            /// Check to see if the position value has crossed the SMA and then return a boolean value\n            /// </summary>\n            /// <returns></returns>\n            private bool CrossedMean()\n            {\n                return (_positionWindow[0] >= _sma && _positionWindow[1] < _sma)\n                    || (_positionWindow[1] >= _sma && _positionWindow[0] < _sma);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/SykesShortMicroCapAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// Identify \"pumped\" penny stocks and predict that the price of a \"Pumped\" penny stock reverts to mean\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    ///</summary>\n    public class SykesShortMicroCapAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Select stocks using PennyStockUniverseSelectionModel\n            UniverseSettings.Resolution = Resolution.Daily;\n            SetUniverseSelection(new PennyStockUniverseSelectionModel());\n\n            // Use SykesShortMicroCapAlphaModel to establish insights\n            SetAlpha(new SykesShortMicroCapAlphaModel());\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Performs coarse selection for constituents.\n        /// The stocks must have fundamental data\n        /// The stock must have positive previous-day close price\n        /// The stock must have volume between $1000000 and $10000 on the previous trading day\n        /// The stock must cost less than $5'''\n        /// </summary>\n        private class PennyStockUniverseSelectionModel : FundamentalUniverseSelectionModel\n        {\n            private const int _numberOfSymbolsCoarse = 500;\n            private int _lastMonth = -1;\n\n            public PennyStockUniverseSelectionModel() : base(false)\n            {\n            }\n\n            public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n            {\n                var month = algorithm.Time.Month;\n                if (month == _lastMonth)\n                {\n                    return algorithm.Universe.Unchanged;\n                }\n                _lastMonth = month;\n\n                return (from cf in coarse\n                        where cf.HasFundamentalData\n                        where cf.Volume < 1000000\n                        where cf.Volume > 10000\n                        where cf.Price < 5\n                        orderby cf.DollarVolume descending\n                        select cf.Symbol).Take(_numberOfSymbolsCoarse);\n            }\n        }\n\n        /// <summary>\n        /// Uses ranking of intraday percentage difference between open price and close price to create magnitude and direction prediction for insights\n        /// </summary>\n        private class SykesShortMicroCapAlphaModel : AlphaModel\n        {\n            private readonly int _numberOfStocks;\n            private readonly TimeSpan _predictionInterval;\n\n            public SykesShortMicroCapAlphaModel(\n                int lookback = 1,\n                int numberOfStocks = 10,\n                Resolution resolution = Resolution.Daily)\n            {\n                _numberOfStocks = numberOfStocks;\n                _predictionInterval = resolution.ToTimeSpan().Multiply(lookback);\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                return (\n                    from entry in algorithm.ActiveSecurities\n                    let security = entry.Value\n                    where security.HasData && security.Open > 0\n                    // Rank penny stocks on one day price change\n                    let Magnitude = security.Close / security.Open - 1\n                    orderby Math.Round(Magnitude, 6), security.Symbol descending\n                    select Insight.Price(security.Symbol, _predictionInterval, InsightDirection.Down, Math.Abs((double)Magnitude)))\n                    // Retrieve list of _numberOfStocks \"pumped\" penny stocks\n                    .Take(_numberOfStocks);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/TriangleExchangeRateArbitrageAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// In a perfect market, you could buy 100 EUR worth of USD, sell 100 EUR worth of GBP,\n    /// and then use the GBP to buy USD and wind up with the same amount in USD as you received when\n    /// you bought them with EUR. This relationship is expressed by the Triangle Exchange Rate, which is\n    ///\n    /// Triangle Exchange Rate = (A/B) * (B/C) * (C/A)\n    ///\n    /// where (A/B) is the exchange rate of A-to-B. In a perfect market, TER = 1, and so when\n    /// there is a mispricing in the market, then TER will not be 1 and there exists an arbitrage opportunity.\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    /// </summary>\n    public class TriangleExchangeRateArbitrageAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2019, 2, 1);\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // Select trio of currencies to trade where\n            // Currency A = USD\n            // Currency B = EUR\n            // Currency C = GBP\n            var symbols = new[] { \"EURUSD\", \"EURGBP\", \"GBPUSD\" }\n                .Select(x => QuantConnect.Symbol.Create(x, SecurityType.Forex, Market.Oanda));\n\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n            // Use ForexTriangleArbitrageAlphaModel to establish insights\n            SetAlpha(new ForexTriangleArbitrageAlphaModel(symbols, Resolution.Minute));\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        private class ForexTriangleArbitrageAlphaModel : AlphaModel\n        {\n            private readonly Symbol[] _symbols;\n            private readonly TimeSpan _insightPeriod;\n\n            public ForexTriangleArbitrageAlphaModel(\n                IEnumerable<Symbol> symbols,\n                Resolution resolution = Resolution.Minute)\n            {\n                _symbols = symbols.ToArray();\n                _insightPeriod = resolution.ToTimeSpan().Multiply(5);\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                // Check to make sure all currency symbols are present\n                if (data.QuoteBars.Count < 3)\n                {\n                    return Enumerable.Empty<Insight>();\n                }\n\n                // Extract QuoteBars for all three Forex securities\n                var barA = data[_symbols[0]];\n                var barB = data[_symbols[1]];\n                var barC = data[_symbols[2]];\n\n                // Calculate the triangle exchange rate\n                // Bid(Currency A -> Currency B) * Bid(Currency B -> Currency C) * Bid(Currency C -> Currency A)\n                // If exchange rates are priced perfectly, then this yield 1.If it is different than 1, then an arbitrage opportunity exists\n                var triangleRate = barA.Ask.Close / barB.Bid.Close / barC.Ask.Close;\n\n                // If the triangle rate is significantly different than 1, then emit insights\n                if (triangleRate > 1.0005m)\n                {\n                    return Insight.Group(new[]\n                    {\n                        Insight.Price(_symbols[0], _insightPeriod, InsightDirection.Up, 0.0001),\n                        Insight.Price(_symbols[1], _insightPeriod, InsightDirection.Down, 0.0001),\n                        Insight.Price(_symbols[2], _insightPeriod, InsightDirection.Up, 0.0001)\n                    });\n                }\n\n                return Enumerable.Empty<Insight>();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/TripleLeveragedETFPairVolatilityDecayAlpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// Leveraged ETFs (LETF) promise a fixed leverage ratio with respect to an underlying asset or an index.\n    /// A Triple-Leveraged ETF allows speculators to amplify their exposure to the daily returns of an underlying index by a factor of 3.\n    ///\n    /// Increased volatility generally decreases the value of a LETF over an extended period of time as daily compounding is amplified.\n    ///\n    /// This alpha emits short-biased insight to capitalize on volatility decay for each listed pair of TL-ETFs, by rebalancing the\n    /// ETFs with equal weights each day.\n    ///\n    /// This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n    /// </summary>\n    public class TripleLeveragedETFPairVolatilityDecayAlpha : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n\n            SetCash(100000);\n\n            // Set zero transaction fees\n            SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n\n            // 3X ETF pair tickers\n            var ultraLong = QuantConnect.Symbol.Create(\"UGLD\", SecurityType.Equity, Market.USA);\n            var ultraShort = QuantConnect.Symbol.Create(\"DGLD\", SecurityType.Equity, Market.USA);\n\n            // Manually curated universe\n            UniverseSettings.Resolution = Resolution.Daily;\n            SetUniverseSelection(new ManualUniverseSelectionModel(new[] { ultraLong, ultraShort }));\n\n            // Select the demonstration alpha model\n            SetAlpha(new RebalancingTripleLeveragedETFAlphaModel(ultraLong, ultraShort));\n\n            // Equally weigh securities in portfolio, based on insights\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Set Immediate Execution Model\n            SetExecution(new ImmediateExecutionModel());\n\n            // Set Null Risk Management Model\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// Rebalance a pair of 3x leveraged ETFs and predict that the value of both ETFs in each pair will decrease.\n        /// </summary>\n        private class RebalancingTripleLeveragedETFAlphaModel : AlphaModel\n        {\n            private const double _magnitude = 0.001;\n            private readonly Symbol _ultraLong;\n            private readonly Symbol _ultraShort;\n            private readonly TimeSpan _period;\n\n            public RebalancingTripleLeveragedETFAlphaModel(Symbol ultraLong, Symbol ultraShort)\n            {\n                // Giving an insight period 1 days.\n                _period = QuantConnect.Time.OneDay;\n\n                _ultraLong = ultraLong;\n                _ultraShort = ultraShort;\n\n                Name = \"RebalancingTripleLeveragedETFAlphaModel\";\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                return Insight.Group(new[]\n                {\n                    Insight.Price(_ultraLong, _period, InsightDirection.Down, _magnitude),\n                    Insight.Price(_ultraShort, _period, InsightDirection.Down, _magnitude)\n                });\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/Alphas/VixDualThrustAlpha.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Algorithm.CSharp.Alphas\n{\n    /// <summary>\n    /// This is a demonstration algorithm. It trades UVXY.\n    /// Dual Thrust alpha model is used to produce insights.\n    /// Those input parameters have been chosen that gave acceptable results on a series\n    /// of random backtests run for the period from Oct, 2016 till Feb, 2019.\n    /// </summary>\n    class VIXDualThrustAlpha : QCAlgorithm\n    {\n        // -- STRATEGY INPUT PARAMETERS --\n        private decimal _k1 = 0.63m;\n        private decimal _k2 = 0.63m;\n        private int _rangePeriod = 20;\n        private int _consolidatorBars = 30;\n\n        // -- INITIALIZE --\n        public override void Initialize()\n        {\n            // Settings\n            SetStartDate(2016, 10, 01);\n            SetSecurityInitializer(s => s.SetFeeModel(new ConstantFeeModel(0m)));\n            SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n\n            // Universe Selection\n            UniverseSettings.Resolution = Resolution.Minute;   // it's minute by default, but lets leave this param here\n            var symbols = new[] { QuantConnect.Symbol.Create(\"UVXY\", SecurityType.Equity, Market.USA) };\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n            // Warming up\n            var resolutionInTimeSpan = UniverseSettings.Resolution.ToTimeSpan();\n            var warmUpTimeSpan = resolutionInTimeSpan.Multiply(_consolidatorBars).Multiply(_rangePeriod);\n            SetWarmUp(warmUpTimeSpan);\n\n            // Alpha Model\n            SetAlpha(new DualThrustAlphaModel(_k1, _k2, _rangePeriod, UniverseSettings.Resolution, _consolidatorBars));\n\n            // Portfolio Construction\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Execution\n            SetExecution(new ImmediateExecutionModel());\n\n            // Risk Management\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.03m));\n        }\n    }\n\n    /// <summary>\n    /// Alpha model that uses dual-thrust strategy to create insights\n    /// https://medium.com/@FMZ_Quant/dual-thrust-trading-strategy-2cc74101a626\n    /// or here:\n    /// https://www.quantconnect.com/tutorials/strategy-library/dual-thrust-trading-algorithm\n    /// </summary>\n    public class DualThrustAlphaModel : AlphaModel\n    {\n        private readonly decimal _k1;\n        private readonly decimal _k2;\n        private readonly TimeSpan _consolidatorTimeSpan;\n        private readonly int _rangePeriod;\n        private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol;\n\n        /// <summary>\n        /// Initializes a new instance of the  class\n        /// </summary>\n        /// <param name=\"k1\">Coefficient for upper band</param>\n        /// <param name=\"k2\">Coefficient for lower band</param>\n        /// <param name=\"rangePeriod\">Amount of last bars to calculate the range</param>\n        /// <param name=\"resolution\">The resolution of data sent into the EMA indicators</param>\n        /// <param name=\"barsToConsolidate\">If we want alpha o work on trade bars whose length is\n        /// different from the standard resolution - 1m 1h etc. - we need to pass this parameters along\n        /// with proper data resolution</param>\n        public DualThrustAlphaModel(\n            decimal k1,\n            decimal k2,\n            int rangePeriod,\n            Resolution resolution = Resolution.Daily,\n            int barsToConsolidate = 1\n            )\n        {\n            // coefficient that used to determine upper and lower borders of a breakout channel\n            _k1 = k1;\n            _k2 = k2;\n\n            // period the range is calculated over\n            _rangePeriod = rangePeriod;\n\n            // initialize with empty dict.\n            _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n\n            // time for bars we make the calculations on\n            _consolidatorTimeSpan = resolution.ToTimeSpan().Multiply(barsToConsolidate);\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            var insights = new List<Insight>();\n\n            // in 5 days after emission an insight is to be considered expired\n            int insightCloseAddDays = 5;\n\n            foreach (var symbolData in _symbolDataBySymbol.Values)\n            {\n                var range = symbolData.Range;\n                var symbol = symbolData.Symbol;\n                var security = algorithm.Securities[symbol];\n\n                if (symbolData.IsReady)\n                {\n                    // buying condition\n                    // - (1) price is above upper line\n                    // - (2) and we are not long. this is a first time we crossed the line lately\n                    if (security.Price > symbolData.UpperLine && !algorithm.Portfolio[symbol].IsLong)\n                    {\n                        DateTime insightCloseTimeUtc = algorithm.UtcTime.AddDays(insightCloseAddDays);\n                        insights.Add(Insight.Price(symbolData.Symbol, insightCloseTimeUtc, InsightDirection.Up));\n                    }\n\n                    // selling condition\n                    // - (1) price is lower that lower line\n                    // - (2) and we are not short. this is a first time we crossed the line lately\n                    if (security.Price < symbolData.LowerLine && !algorithm.Portfolio[symbol].IsShort)\n                    {\n                        DateTime insightCloseTimeUtc = algorithm.UtcTime.AddDays(insightCloseAddDays);\n                        insights.Add(Insight.Price(symbolData.Symbol, insightCloseTimeUtc, InsightDirection.Down));\n                    }\n                }\n            }\n\n            return insights;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            // added\n            foreach (var added in changes.AddedSecurities)\n            {\n                SymbolData symbolData;\n                if (!_symbolDataBySymbol.TryGetValue(added.Symbol, out symbolData))\n                {\n                    // add symbol/symbolData pair to collection\n                    symbolData = new SymbolData(_rangePeriod, _consolidatorTimeSpan)\n                    {\n                        Symbol = added.Symbol,\n                        K1 = _k1,\n                        K2 = _k2\n                    };\n\n                    _symbolDataBySymbol[added.Symbol] = symbolData;\n\n                    //register consolidator\n                    algorithm.SubscriptionManager.AddConsolidator(added.Symbol, symbolData.GetConsolidator());\n                }\n            }\n\n            // removed\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                SymbolData symbolData;\n                if (_symbolDataBySymbol.TryGetValue(removed.Symbol, out symbolData))\n                {\n                    // unsubscribe consolidator from data updates\n                    algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, symbolData.GetConsolidator());\n\n                    // remove item from dictionary collection\n                    if (!_symbolDataBySymbol.Remove(removed.Symbol))\n                    {\n                        algorithm.Error(\"Unable to remove data from collection: DualThrustAlphaModel\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Contains data specific to a symbol required by this model\n        /// </summary>\n        private class SymbolData\n        {\n            // rolling to contain items over the looking back period\n            private readonly RollingWindow<TradeBar> _rangeWindow;\n\n            // we calculate our logic on bars\n            private readonly TradeBarConsolidator _consolidator;\n\n            // current range value\n            public decimal Range { get; private set; }\n\n            // upper Line\n            public decimal UpperLine { get; private set; }\n\n            // lower Line\n            public decimal LowerLine { get; private set; }\n\n            // symbol value\n            public Symbol Symbol { get; set; }\n\n            // k1\n            public decimal K1 { private get; set; }\n\n            // k2\n            public decimal K2 { private get; set; }\n\n            // data is ready when rolling window is ready\n            public bool IsReady => _rangeWindow.IsReady;\n\n            /// <summary>\n            /// Main constructor for the class\n            /// </summary>\n            /// <param name=\"rangePeriod\">Range period</param>\n            /// <param name=\"consolidatorResolution\">Time length of consolidator</param>\n            public SymbolData(int rangePeriod, TimeSpan consolidatorResolution)\n            {\n                _rangeWindow = new RollingWindow<TradeBar>(rangePeriod);\n                _consolidator = new TradeBarConsolidator(consolidatorResolution);\n\n                // event fired at new consolidated trade bar\n                _consolidator.DataConsolidated += (sender, consolidated) =>\n                {\n                    // add new tradebar to\n                    _rangeWindow.Add(consolidated);\n\n                    if (IsReady)\n                    {\n                        var hh = _rangeWindow.Select(x => x.High).Max();\n                        var hc = _rangeWindow.Select(x => x.Close).Max();\n                        var lc = _rangeWindow.Select(x => x.Close).Min();\n                        var ll = _rangeWindow.Select(x => x.Low).Min();\n\n                        Range = Math.Max(hh - lc, hc - ll);\n\n                        UpperLine = consolidated.Close + K1 * Range;\n                        LowerLine = consolidated.Close - K2 * Range;\n                    }\n                };\n            }\n\n            /// <summary>\n            /// Returns the interior consolidator\n            /// </summary>\n            public TradeBarConsolidator GetConsolidator()\n            {\n                return _consolidator;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AsynchronousUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm using the asynchronous universe selection functionality\n    /// </summary>\n    public class AsynchronousUniverseRegressionAlgorithm : FundamentalRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            UniverseSettings.Asynchronous = true;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AutoRegressiveIntegratedMovingAverageRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test the behaviour of ARMA versus AR models at the same order of differencing.\n    /// In particular, an ARIMA(1,1,1) and ARIMA(1,1,0) are instantiated while orders are placed if their difference\n    /// is sufficiently large (which would be due to the inclusion of the MA(1) term).\n    /// </summary>\n    public class AutoRegressiveIntegratedMovingAverageRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private AutoRegressiveIntegratedMovingAverage _arima;\n        private AutoRegressiveIntegratedMovingAverage _ar;\n        private decimal _last;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 1, 07);\n            SetEndDate(2013, 12, 11);\n\n            Settings.AutomaticIndicatorWarmUp = true;\n            AddEquity(\"SPY\", Resolution.Daily);\n            _arima = ARIMA(\"SPY\", 1, 1, 1, 50);\n            _ar = ARIMA(\"SPY\", 1, 1, 0, 50);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_arima.IsReady)\n            {\n                if (Math.Abs(_ar.Current.Value - _arima.Current.Value) > 1) // Difference due to MA(1) being included.\n                {\n                    if (_arima.Current.Value > _last)\n                    {\n                        MarketOrder(\"SPY\", 1);\n                    }\n                    else\n                    {\n                        MarketOrder(\"SPY\", -1);\n                    }\n                }\n\n                _last = _arima.Current.Value;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1893;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 100;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"53\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"0.076%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"2.933\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100070.90\"},\n            {\"Net Profit\", \"0.071%\"},\n            {\"Sharpe Ratio\", \"-9.164\"},\n            {\"Sortino Ratio\", \"-9.852\"},\n            {\"Probabilistic Sharpe Ratio\", \"36.417%\"},\n            {\"Loss Rate\", \"27%\"},\n            {\"Win Rate\", \"73%\"},\n            {\"Profit-Loss Ratio\", \"4.41\"},\n            {\"Alpha\", \"-0.008\"},\n            {\"Beta\", \"0.008\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.961\"},\n            {\"Tracking Error\", \"0.092\"},\n            {\"Treynor Ratio\", \"-0.911\"},\n            {\"Total Fees\", \"$53.00\"},\n            {\"Estimated Strategy Capacity\", \"$16000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"50\"},\n            {\"OrderListHash\", \"685c37df6e4c49b75792c133be189094\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AutomaticIndicatorWarmupDataTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm which tests indicator warm up using different data types, related to GH issue 4205\n    /// </summary>\n    public class AutomaticIndicatorWarmupDataTypeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        public override void Initialize()\n        {\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            Settings.AutomaticIndicatorWarmUp = true;\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            var SP500 = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            _symbol = FuturesChain(SP500).OrderBy(x => x.Symbol.ID.Date).First();\n\n            // Test case: custom IndicatorBase<QuoteBar> indicator using Future unsubscribed symbol\n            var indicator1 = new CustomIndicator();\n            AssertIndicatorState(indicator1, isReady: false);\n            WarmUpIndicator(_symbol, indicator1);\n            AssertIndicatorState(indicator1, isReady: true);\n\n            // Test case: SimpleMovingAverage<IndicatorDataPoint> using Future unsubscribed symbol (should use TradeBar)\n            var sma1 = new SimpleMovingAverage(10);\n            AssertIndicatorState(sma1, isReady: false);\n            WarmUpIndicator(_symbol, sma1);\n            AssertIndicatorState(sma1, isReady: true);\n\n            // Test case: SimpleMovingAverage<IndicatorDataPoint> using Equity unsubscribed symbol\n            var spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var sma = new SimpleMovingAverage(10);\n            AssertIndicatorState(sma, isReady: false);\n            WarmUpIndicator(spy, sma);\n            AssertIndicatorState(sma, isReady: true);\n\n            // We add the symbol\n            AddFutureContract(_symbol);\n            AddEquity(\"SPY\");\n            // force spy for use Raw data mode so that it matches the used when unsubscribed which uses the universe settings\n            SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(spy).SetDataNormalizationMode(DataNormalizationMode.Raw);\n\n            // Test case: custom IndicatorBase<QuoteBar> indicator using Future subscribed symbol\n            var indicator = new CustomIndicator();\n            var consolidator = CreateConsolidator(TimeSpan.FromMinutes(2), typeof(QuoteBar));\n            RegisterIndicator(_symbol, indicator, consolidator);\n\n            AssertIndicatorState(indicator, isReady: false);\n            WarmUpIndicator(_symbol, indicator);\n            AssertIndicatorState(indicator, isReady: true);\n\n            // Test case: SimpleMovingAverage<IndicatorDataPoint> using Future Subscribed symbol (should use TradeBar)\n            var sma11 = new SimpleMovingAverage(10);\n            AssertIndicatorState(sma11, isReady: false);\n            WarmUpIndicator(_symbol, sma11);\n            AssertIndicatorState(sma11, isReady: true);\n\n            if (!sma11.Current.Equals(sma1.Current))\n            {\n                throw new RegressionTestException(\"Expected SMAs warmed up before and after adding the Future to the algorithm to have the same current value. \" +\n                                    \"The result of 'WarmUpIndicator' shouldn't change if the symbol is or isn't subscribed\");\n            }\n\n            // Test case: SimpleMovingAverage<IndicatorDataPoint> using Equity unsubscribed symbol\n            var smaSpy = new SimpleMovingAverage(10);\n            AssertIndicatorState(smaSpy, isReady: false);\n            WarmUpIndicator(spy, smaSpy);\n            AssertIndicatorState(smaSpy, isReady: true);\n\n            if (!smaSpy.Current.Equals(sma.Current))\n            {\n                throw new RegressionTestException(\"Expected SMAs warmed up before and after adding the Equity to the algorithm to have the same current value. \" +\n                                    \"The result of 'WarmUpIndicator' shouldn't change if the symbol is or isn't subscribed\");\n            }\n        }\n\n        private void AssertIndicatorState(IIndicator indicator, bool isReady)\n        {\n            if (indicator.IsReady != isReady)\n            {\n                throw new RegressionTestException($\"Expected indicator state, expected {isReady} but was {indicator.IsReady}\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 0.5);\n            }\n        }\n\n        private class CustomIndicator : IndicatorBase<QuoteBar>, IIndicatorWarmUpPeriodProvider\n        {\n            private bool _isReady;\n            public int WarmUpPeriod => 1;\n            public override bool IsReady => _isReady;\n            public CustomIndicator() : base(\"Pepe\")\n            { }\n            protected override decimal ComputeNextValue(QuoteBar input)\n            {\n                _isReady = true;\n                return input.Ask.High;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6426;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 85;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"733913.744%\"},\n            {\"Drawdown\", \"15.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"106827.7\"},\n            {\"Net Profit\", \"6.828%\"},\n            {\"Sharpe Ratio\", \"203744786353.299\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"456382350698.622\"},\n            {\"Beta\", \"9.229\"},\n            {\"Annual Standard Deviation\", \"2.24\"},\n            {\"Annual Variance\", \"5.017\"},\n            {\"Information Ratio\", \"228504036840.953\"},\n            {\"Tracking Error\", \"1.997\"},\n            {\"Treynor Ratio\", \"49450701625.717\"},\n            {\"Total Fees\", \"$23.65\"},\n            {\"Estimated Strategy Capacity\", \"$200000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"351.80%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"dfd9a280d3c6470b305c03e0b72c234e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AutomaticIndicatorWarmupOptionIndicatorsMirrorContractsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of the AutomaticIndicatorWarmUp on option greeks\n    /// </summary>\n    public class AutomaticIndicatorWarmupOptionIndicatorsMirrorContractsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            Settings.AutomaticIndicatorWarmUp = true;\n\n            var underlying = \"GOOG\";\n            var resolution = Resolution.Minute;\n\n            var expiration = new DateTime(2015, 12, 24);\n            var strike = 650m;\n\n            var equity = AddEquity(underlying, resolution).Symbol;\n            var option = QuantConnect.Symbol.CreateOption(underlying, Market.USA, OptionStyle.American, OptionRight.Put, strike, expiration);\n            AddOptionContract(option, resolution);\n            // add the call counter side of the mirrored pair\n            var mirrorOption = QuantConnect.Symbol.CreateOption(underlying, Market.USA, OptionStyle.American, OptionRight.Call, strike, expiration);\n            AddOptionContract(mirrorOption, resolution);\n\n            var impliedVolatility = IV(option, mirrorOption);\n            var delta = D(option, mirrorOption, optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n            var gamma = G(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            var vega = V(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            var theta = T(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            var rho = R(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n\n            if (impliedVolatility == 0m || delta == 0m || gamma == 0m || vega == 0m || theta == 0m || rho == 0m)\n            {\n                throw new RegressionTestException(\"Expected IV/greeks calculated\");\n            }\n            if (!impliedVolatility.IsReady || !delta.IsReady || !gamma.IsReady || !vega.IsReady || !theta.IsReady || !rho.IsReady)\n            {\n                throw new RegressionTestException(\"Expected IV/greeks to be ready\");\n            }\n\n            Quit($\"Implied Volatility: {impliedVolatility}, Delta: {delta}, Gamma: {gamma}, Vega: {vega}, Theta: {theta}, Rho: {rho}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 18;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AutomaticIndicatorWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm which reproduces GH issue 3861, where in some cases 2 consolidators were added when\n    /// using the automatic indicator warmup feature\n    /// </summary>\n    public class AutomaticIndicatorWarmupRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            Settings.AutomaticIndicatorWarmUp = true;\n\n            // Test case 1\n            _spy = AddEquity(\"SPY\").Symbol;\n            var sma = SMA(_spy, 10);\n            if (!sma.IsReady)\n            {\n                throw new RegressionTestException(\"Expected SMA to be warmed up\");\n            }\n\n            // Test case 2\n            var indicator = new CustomIndicator(10);\n            RegisterIndicator(_spy, indicator, Resolution.Minute, (Func<IBaseData, decimal>) null);\n\n            if (indicator.IsReady)\n            {\n                throw new RegressionTestException(\"Expected CustomIndicator Not to be warmed up\");\n            }\n            WarmUpIndicator(_spy, indicator);\n            if (!indicator.IsReady)\n            {\n                throw new RegressionTestException(\"Expected CustomIndicator to be warmed up\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var subscription = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_spy).First(config => config.TickType == TickType.Trade);\n\n                // we expect 1 consolidator per indicator\n                if (subscription.Consolidators.Count != 2)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidator count for subscription: {subscription.Consolidators.Count}\");\n                }\n                SetHoldings(_spy, 1);\n            }\n        }\n\n        private class CustomIndicator : SimpleMovingAverage\n        {\n            private IndicatorDataPoint _previous;\n            public CustomIndicator(int period) : base(period)\n            {\n            }\n            protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n            {\n                if (_previous != null && input.EndTime == _previous.EndTime)\n                {\n                    throw new RegressionTestException($\"Unexpected indicator double data point call: {_previous}\");\n                }\n                _previous = input;\n                return base.ComputeNextValue(window, input);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 40;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AutomaticSeedBaseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that security are automatically seeded by default\n    /// </summary>\n    public abstract class AutomaticSeedBaseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool ShouldHaveTradeData { get; }\n        protected virtual bool ShouldHaveQuoteData { get; }\n        protected virtual bool ShouldHaveOpenInterestData { get; }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            var gotTrades = false;\n            var gotQuotes = false;\n            var gotOpenInterest = false;\n\n            foreach (var addedSecurity in changes.AddedSecurities.Where(x => !x.Symbol.IsCanonical() || x.Symbol.SecurityType == SecurityType.Future))\n            {\n                if (addedSecurity.Price == 0)\n                {\n                    throw new RegressionTestException(\"Security was not seeded\");\n                }\n\n                if (!addedSecurity.HasData)\n                {\n                    throw new RegressionTestException(\"Security does not have TradeBar or QuoteBar or OpenInterest data\");\n                }\n\n                gotTrades |= addedSecurity.Cache.GetData<TradeBar>() != null;\n                gotQuotes |= addedSecurity.Cache.GetData<QuoteBar>() != null;\n                gotOpenInterest |= addedSecurity.Cache.GetData<OpenInterest>() != null;\n            }\n\n            if (changes.AddedSecurities.Count > 0)\n            {\n                if (ShouldHaveTradeData && !gotTrades)\n                {\n                    throw new RegressionTestException(\"No contract had TradeBar data\");\n                }\n\n                if (ShouldHaveQuoteData && !gotQuotes)\n                {\n                    throw new RegressionTestException(\"No contract had QuoteBar data\");\n                }\n\n                if (ShouldHaveOpenInterestData && !gotOpenInterest)\n                {\n                    throw new RegressionTestException(\"No contract had OpenInterest data\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public abstract long DataPoints { get; }\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public abstract int AlgorithmHistoryDataPoints { get; }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/AuxiliaryDataHandlersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm using and asserting the behavior of auxiliary Data handlers\n    /// </summary>\n    public class AuxiliaryDataHandlersRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _onSplits;\n        private bool _onDividends;\n        private bool _onDelistingsCalled;\n        private bool _onSymbolChangedEvents;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2007, 05, 16);\n            SetEndDate(2015, 1, 1);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // will get delisted\n            AddEquity(\"AAA.1\");\n\n            // get's remapped\n            AddEquity(\"SPWR\");\n\n            // has a split & dividends\n            AddEquity(\"AAPL\");\n        }\n\n        public override void OnDelistings(Delistings delistings)\n        {\n            if (!delistings.ContainsKey(\"AAA.1\"))\n            {\n                throw new RegressionTestException(\"Unexpected OnDelistings call\");\n            }\n            _onDelistingsCalled = true;\n        }\n\n        public override void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged)\n        {\n            if (!symbolsChanged.ContainsKey(\"SPWR\"))\n            {\n                throw new RegressionTestException(\"Unexpected OnSymbolChangedEvents call\");\n            }\n            _onSymbolChangedEvents = true;\n        }\n\n        public override void OnSplits(Splits splits)\n        {\n            if (!splits.ContainsKey(\"AAPL\"))\n            {\n                throw new RegressionTestException(\"Unexpected OnSplits call\");\n            }\n            _onSplits = true;\n        }\n\n        public override void OnDividends(Dividends dividends)\n        {\n            if (!dividends.ContainsKey(\"AAPL\"))\n            {\n                throw new RegressionTestException(\"Unexpected OnDividends call\");\n            }\n            _onDividends = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_onDelistingsCalled)\n            {\n                throw new RegressionTestException(\"OnDelistings was not called!\");\n            }\n            if (!_onSymbolChangedEvents)\n            {\n                throw new RegressionTestException(\"OnSymbolChangedEvents was not called!\");\n            }\n            if (!_onSplits)\n            {\n                throw new RegressionTestException(\"OnSplits was not called!\");\n            }\n            if (!_onDividends)\n            {\n                throw new RegressionTestException(\"OnDividends was not called!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17270;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.332\"},\n            {\"Tracking Error\", \"0.183\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BacktestingAsynchronousOrdersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that in backtesting, orders are submitted in the same time step even when asynchronous\n    /// </summary>\n    public class BacktestingAsynchronousOrdersRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\").Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var marketOrderTicket = MarketOrder(_symbol, 100, asynchronous: false);\n                AssertMarketOrderStatus(marketOrderTicket);\n\n                var asyncMarketOrderTicket = MarketOrder(_symbol, -100, asynchronous: true);\n                AssertMarketOrderStatus(asyncMarketOrderTicket);\n\n                var limitPrice = Securities[_symbol].Price * 0.95m;\n                var limitOrderTicket = LimitOrder(_symbol, 100, limitPrice, asynchronous: false);\n                AssertLimitOrderStatus(limitOrderTicket);\n\n                var asyncLimitOrderTicket = LimitOrder(_symbol, -100, limitPrice, asynchronous: true);\n                AssertLimitOrderStatus(asyncLimitOrderTicket);\n            }\n        }\n\n        private static void AssertMarketOrderStatus(OrderTicket ticket)\n        {\n            // In backtesting the order should be submitted and filled right away.\n            // Note that OrderSet event will not be fired if there is an error when processing the order submission,\n            // but this is a happy case\n            if (!ticket.OrderSet.WaitOne(0))\n            {\n                throw new RegressionTestException(\"Order was not submitted immediately in backtesting mode\");\n            }\n            if (!ticket.OrderClosed.WaitOne(0))\n            {\n                throw new RegressionTestException(\"Order was not filled immediately in backtesting mode\");\n            }\n            if (ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException($\"Order status is not filled: {ticket.Status}\");\n            }\n        }\n\n        private static void AssertLimitOrderStatus(OrderTicket ticket)\n        {\n            // In backtesting the order should be submitted right away but not filled since price hasn't moved even when asynchronous\n            // Note that OrderSet event will not be fired if there is an error when processing the order submission,\n            // but this is a happy case\n            if (!ticket.OrderSet.WaitOne(0))\n            {\n                throw new RegressionTestException(\"Asynchronous limit order was not submitted immediately in backtesting mode\");\n            }\n            if (ticket.OrderClosed.WaitOne(0))\n            {\n                throw new RegressionTestException(\"Asynchronous limit order was filled immediately in backtesting mode when it shouldn't\");\n            }\n            if (ticket.Status != OrderStatus.Submitted)\n            {\n                throw new RegressionTestException($\"Order status is not submitted: {ticket.Status}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100168.20\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$22000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"21.72%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"65f010e904a929e5383f0920a3c5b797\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests the order processing of the backtesting brokerage.\n    /// We open an equity position that should fill in two parts, on two different bars.\n    /// We open a long option position and let it expire so we can exercise the position.\n    /// To check the orders we use OnOrderEvent and throw exceptions if verification fails.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"backtesting brokerage\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    class BacktestingBrokerageRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        private Symbol _spy;\n        private OrderTicket _equityBuy;\n        private Option _option;\n        private Symbol _optionSymbol;\n        private OrderTicket _optionBuy;\n        private bool _optionBought = false;\n        private bool _equityBought = false;\n        private decimal _optionStrikePrice;\n\n        /// <summary>\n        /// Initialize the algorithm\n        /// </summary>\n        public override void Initialize()\n        {\n            SetCash(100000);\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 28);\n\n            // Get our equity\n            _security = AddEquity(\"SPY\", Resolution.Hour);\n            _security.SetFillModel(new PartialMarketFillModel(2));\n            _spy = _security.Symbol;\n\n            // Get our option\n            _option = AddOption(\"GOOG\");\n            _option.SetFilter(u => u.IncludeWeeklys()\n                                   .Strikes(-2, +2)\n                                   .Expiration(TimeSpan.Zero, TimeSpan.FromDays(10)));\n            _optionSymbol = _option.Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice data)\n        {\n            if (!_equityBought && data.ContainsKey(_spy))\n            {\n                //Buy our Equity.\n                //Quantity is rounded down to an even number since it will be split in two equal halves\n                var quantity = Math.Floor(CalculateOrderQuantity(_spy, .1m) / 2) * 2;\n                _equityBuy = MarketOrder(_spy, quantity, asynchronous: true);\n                _equityBought = true;\n            }\n\n            if (!_optionBought)\n            {\n                // Buy our option\n                OptionChain chain;\n                if (data.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // Find the second call strike under market price expiring today\n                    var contracts = (\n                        from optionContract in chain.OrderByDescending(x => x.Strike)\n                        where optionContract.Right == OptionRight.Call\n                        where optionContract.Expiry == Time.Date\n                        where optionContract.Strike < chain.Underlying.Price\n                        select optionContract\n                        ).Take(2);\n\n                    if (contracts.Any())\n                    {\n                        var optionToBuy = contracts.FirstOrDefault();\n                        _optionStrikePrice = optionToBuy.Strike;\n                        _optionBuy = MarketOrder(optionToBuy.Symbol, 1);\n                        _optionBought = true;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// All order events get pushed through this function\n        /// </summary>\n        /// <param name=\"orderEvent\">OrderEvent object that contains all the information about the event</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // Get the order from our transactions\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n\n            // Based on the type verify the order\n            switch (order.Type)\n            {\n                case OrderType.Market:\n                    VerifyMarketOrder(order, orderEvent);\n                    break;\n\n                case OrderType.OptionExercise:\n                    VerifyOptionExercise(order, orderEvent);\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// To verify Market orders is process correctly\n        /// </summary>\n        /// <param name=\"order\">Order object to analyze</param>\n        public void VerifyMarketOrder(Order order, OrderEvent orderEvent)\n        {\n            switch (order.Status)\n            {\n                case OrderStatus.Submitted:\n                    break;\n\n                // All PartiallyFilled orders should have a LastFillTime\n                case OrderStatus.PartiallyFilled:\n                    if (order.LastFillTime == null)\n                    {\n                        throw new RegressionTestException(\"LastFillTime should not be null\");\n                    }\n\n                    if (order.Quantity / 2 != orderEvent.FillQuantity)\n                    {\n                        throw new RegressionTestException(\"Order size should be half\");\n                    }\n                    break;\n\n                // All filled equity orders should have filled after creation because of our fill model!\n                case OrderStatus.Filled:\n                    if (order.SecurityType == SecurityType.Equity && order.CreatedTime == order.LastFillTime)\n                    {\n                        throw new RegressionTestException(\"Order should not finish during the CreatedTime bar\");\n                    }\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// To verify OptionExercise orders is process correctly\n        /// </summary>\n        /// <param name=\"order\">Order object to analyze</param>\n        public void VerifyOptionExercise(Order order, OrderEvent orderEvent)\n        {\n            // If the option price isn't the same as the strike price, its incorrect\n            if (order.Price != _optionStrikePrice)\n            {\n                throw new RegressionTestException(\"OptionExercise order price should be strike price!!\");\n            }\n\n            if (orderEvent.Quantity != -1)\n            {\n                throw new RegressionTestException(\"OrderEvent Quantity should be -1\");\n            }\n        }\n\n        /// <summary>\n        /// Runs after algorithm, used to check our portfolio and orders\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (!Portfolio.ContainsKey(_optionBuy.Symbol) || !Portfolio.ContainsKey(_optionBuy.Symbol.Underlying) || !Portfolio.ContainsKey(_equityBuy.Symbol))\n            {\n                throw new RegressionTestException(\"Portfolio does not contain the Symbols we purchased\");\n            }\n\n            //Check option holding, should not be invested since it expired, profit should be -400\n            var optionHolding = Portfolio[_optionBuy.Symbol];\n            if (optionHolding.Invested || optionHolding.Profit != -400)\n            {\n                throw new RegressionTestException(\"Options holding does not match expected outcome\");\n            }\n\n            //Check the option underlying symbol since we should have bought it at exercise\n            //Quantity should be 100, AveragePrice should be option strike price\n            var optionExerciseHolding = Portfolio[_optionBuy.Symbol.Underlying];\n            if (!optionExerciseHolding.Invested || optionExerciseHolding.Quantity != 100 || optionExerciseHolding.AveragePrice != _optionBuy.Symbol.ID.StrikePrice)\n            {\n                throw new RegressionTestException(\"Equity holding for exercised option does not match expected outcome\");\n            }\n\n            //Check equity holding, should be invested, profit should be\n            //Quantity should be 52, AveragePrice should be ticket AverageFillPrice\n            var equityHolding = Portfolio[_equityBuy.Symbol];\n            if (!equityHolding.Invested || equityHolding.Quantity != 52 || equityHolding.AveragePrice != _equityBuy.AverageFillPrice)\n            {\n                throw new RegressionTestException(\"Equity holding does not match expected outcome\");\n            }\n        }\n\n        /// <summary>\n        /// PartialMarketFillModel that allows the user to set the number of fills and restricts\n        /// the fill to only one per bar.\n        /// </summary>\n        private class PartialMarketFillModel : ImmediateFillModel\n        {\n            private readonly decimal _percent;\n            private readonly Dictionary<long, decimal> _absoluteRemainingByOrderId = new Dictionary<long, decimal>();\n\n            /// <param name=\"numberOfFills\"></param>\n            public PartialMarketFillModel(int numberOfFills = 1)\n            {\n                _percent = 1m / numberOfFills;\n            }\n\n            /// <summary>\n            /// Performs partial market fills once per time step\n            /// </summary>\n            /// <param name=\"asset\">The security being ordered</param>\n            /// <param name=\"order\">The order</param>\n            /// <returns>The order fill</returns>\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                var currentUtcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n                // Only fill once a time slice\n                if (order.LastFillTime != null && currentUtcTime <= order.LastFillTime)\n                {\n                    return new OrderEvent(order, currentUtcTime, OrderFee.Zero);\n                }\n\n                decimal absoluteRemaining;\n                if (!_absoluteRemainingByOrderId.TryGetValue(order.Id, out absoluteRemaining))\n                {\n                    absoluteRemaining = order.AbsoluteQuantity;\n                    _absoluteRemainingByOrderId.Add(order.Id, order.AbsoluteQuantity);\n                }\n\n                var fill = base.MarketFill(asset, order);\n                var absoluteFillQuantity = (int)(Math.Min(absoluteRemaining, (int)(_percent * order.Quantity)));\n                fill.FillQuantity = Math.Sign(order.Quantity) * absoluteFillQuantity;\n\n                if (absoluteRemaining == absoluteFillQuantity)\n                {\n                    fill.Status = OrderStatus.Filled;\n                    _absoluteRemainingByOrderId.Remove(order.Id);\n                }\n                else\n                {\n                    absoluteRemaining = absoluteRemaining - absoluteFillQuantity;\n                    _absoluteRemainingByOrderId[order.Id] = absoluteRemaining;\n                    fill.Status = OrderStatus.PartiallyFilled;\n                }\n\n                return fill;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 27071;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.40%\"},\n            {\"Compounding Annual Return\", \"-21.378%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99671.06\"},\n            {\"Net Profit\", \"-0.329%\"},\n            {\"Sharpe Ratio\", \"-14.095\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.01\"},\n            {\"Beta\", \"0.097\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"7.39\"},\n            {\"Tracking Error\", \"0.015\"},\n            {\"Treynor Ratio\", \"-0.234\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"17.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1be5073f2cf8802ffa163f7dab7d040e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Abstract regression framework algorithm for multiple framework regression tests\n    /// </summary>\n    public abstract class BaseFrameworkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 1);\n            SetEndDate(2014, 6, 30);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n\n            var symbols = new[] { \"AAPL\", \"AIG\", \"BAC\", \"SPY\" }\n                .Select(ticker => QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA))\n                .ToList();\n\n            // Manually add AAPL and AIG when the algorithm starts\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols.Take(2)));\n\n            // At midnight, add all securities every day except on the last data\n            // With this procedure, the Alpha Model will experience multiple universe changes\n            AddUniverseSelection(new ScheduledUniverseSelectionModel(\n                DateRules.EveryDay(), TimeRules.Midnight,\n                dt => dt < EndDate.AddDays(-1) ? symbols : Enumerable.Empty<Symbol>()));\n\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(31), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // The base implementation checks for active insights\n            var insightsCount = Insights.GetInsights(insight => insight.IsActive(UtcTime)).Count;\n            if (insightsCount != 0)\n            {\n                throw new RegressionTestException($\"The number of active insights should be 0. Actual: {insightsCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 765;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicPythonIntegrationTemplateAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing Python.Runtime;\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class BasicPythonIntegrationTemplateAlgorithm : QCAlgorithm\n    {\n        // Create class field for numpy library\n        private dynamic _numpy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);  // Set Start Date\n            SetEndDate(2013, 10, 11);  // Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            AddEquity(\"SPY\", Resolution.Minute);\n\n            // Assign numpy library\n            using (Py.GIL())\n            {\n                _numpy = Py.Import(\"numpy\");\n            }\n\n        }\n\n        private decimal ComputeSin(decimal value)\n        {\n            // Calculate python sin(10)\n            using (Py.GIL())\n            {\n                return (decimal)_numpy.sin(value);\n            }\n        }\n\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// Slice object keyed by symbol containing the stock data\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n            \tSetHoldings(\"SPY\", 1);\n            \tvar sin = ComputeSin(10);\n\n                // Calculate C# sin(10)\n            \tvar sinOfTen = Math.Sin(10);\n            \tDebug($\"According to Python, the value of sin(10) is: {sin}\");\n            \tDebug($\"According to C#, the value of sin(10) is: {sinOfTen}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicSetAccountCurrencyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm using SetAccountCurrency\n    /// </summary>\n    public class BasicSetAccountCurrencyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _btcEur;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 04, 04);  //Set Start Date\n            SetEndDate(2018, 04, 04);    //Set End Date\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n            SetAccountCurrency();\n            _btcEur = AddCrypto(\"BTCEUR\").Symbol;\n        }\n\n        public virtual void SetAccountCurrency()\n        {\n            //Before setting any cash or adding a Security call SetAccountCurrency\n            SetAccountCurrency(\"EUR\");\n            SetCash(100000);             //Set Strategy Cash\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_btcEur, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4319;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"92395.59\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€298.35\"},\n            {\"Estimated Strategy Capacity\", \"€85000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCEUR 2XR\"},\n            {\"Portfolio Turnover\", \"107.64%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6819dc936b86af6e4b89b6017b7d5284\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicSetAccountCurrencyWithAmountAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm using SetAccountCurrency with an amount\n    /// </summary>\n    public class BasicSetAccountCurrencyWithAmountAlgorithm : BasicSetAccountCurrencyAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void SetAccountCurrency()\n        {\n            //Before setting any cash or adding a Security call SetAccountCurrency\n            SetAccountCurrency(\"EUR\", 200000);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4319;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000.00\"},\n            {\"End Equity\", \"184791.19\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€596.71\"},\n            {\"Estimated Strategy Capacity\", \"€85000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCEUR 2XR\"},\n            {\"Portfolio Turnover\", \"107.64%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3d450fd418a0e845b3eaaac17fcd13fc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm simply initializes the date range and cash. This is a skeleton\n    /// framework you can use for designing an algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n            AddEquity(\"SPY\", Resolution.Minute);\n\n            // There are other assets with similar methods. See \"Selecting Options\" etc for more details.\n            // AddFuture, AddForex, AddCfd, AddOption\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateAxosAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm for the Axos brokerage\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateAxosAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            SetBrokerageModel(BrokerageName.Axos);\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                // will set 25% of our buying power with a market order\n                SetHoldings(\"SPY\", 0.25m);\n\n                Debug(\"Purchased SPY!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3901;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"39.143%\"},\n            {\"Drawdown\", \"0.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100423.24\"},\n            {\"Net Profit\", \"0.423%\"},\n            {\"Sharpe Ratio\", \"5.498\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.498%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"5.634\"},\n            {\"Tracking Error\", \"0.055\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.60\"},\n            {\"Estimated Strategy Capacity\", \"$150000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4.98%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"8774049eb5141a2b6956d9432426f837\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateCfdAlgorithm.cs",
    "content": "/*\r\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\r\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n*/\r\n\r\nusing System.Linq;\r\nusing QuantConnect.Data;\r\nusing QuantConnect.Orders;\r\n\r\nnamespace QuantConnect.Algorithm.CSharp\r\n{\r\n    /// <summary>\r\n    /// Algorithm demonstrating CFD asset types and requesting history.\r\n    /// </summary>\r\n    /// <meta name=\"tag\" content=\"using data\" />\r\n    /// <meta name=\"tag\" content=\"history\" />\r\n    /// <meta name=\"tag\" content=\"cfd\" />\r\n    public class BasicTemplateCfdAlgorithm : QCAlgorithm\r\n    {\r\n        private Symbol _symbol;\r\n\r\n        /// <summary>\r\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\r\n        /// </summary>\r\n        public override void Initialize()\r\n        {\r\n            SetAccountCurrency(\"EUR\");\r\n\r\n            SetStartDate(2019, 2, 20);\r\n            SetEndDate(2019, 2, 21);\r\n            SetCash(\"EUR\", 100000);\r\n\r\n            _symbol = AddCfd(\"DE30EUR\").Symbol;\r\n\r\n            // Historical Data\r\n            var history = History(_symbol, 60, Resolution.Daily);\r\n            Log($\"Received {history.Count()} bars from CFD historical data call.\");\r\n        }\r\n\r\n        /// <summary>\r\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\r\n        /// </summary>\r\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\r\n        public override void OnData(Slice slice)\r\n        {\r\n            // Access Data\r\n            if (slice.QuoteBars.ContainsKey(_symbol))\r\n            {\r\n                var quoteBar = slice.QuoteBars[_symbol];\r\n                Log($\"{quoteBar.EndTime} :: {quoteBar.Close}\");\r\n            }\r\n\r\n            if (!Portfolio.Invested)\r\n                SetHoldings(_symbol, 1);\r\n        }\r\n\r\n        public override void OnOrderEvent(OrderEvent orderEvent)\r\n        {\r\n            Debug($\"{Time} {orderEvent.ToString()}\");\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing Futures = QuantConnect.Securities.Futures;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic Continuous Futures Template Algorithm\n    /// </summary>\n    public class BasicTemplateContinuousFutureAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Security _currentContract;\n        private SimpleMovingAverage _fast;\n        private SimpleMovingAverage _slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0\n            );\n\n            _fast = SMA(_continuousContract.Symbol, 4, Resolution.Daily);\n            _slow = SMA(_continuousContract.Symbol, 10, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                if(_fast > _slow)\n                {\n                    _currentContract = Securities[_continuousContract.Mapped];\n                    Buy(_currentContract.Symbol, 1);\n                }\n            }\n            else if(_fast < _slow)\n            {\n                Liquidate();\n            }\n\n            // We check exchange hours because the contract mapping can call OnData outside of regular hours.\n            if (_currentContract != null && _currentContract.Symbol != _continuousContract.Mapped && _continuousContract.Exchange.ExchangeOpen)\n            {\n                Log($\"{Time} - rolling position from {_currentContract.Symbol} to {_continuousContract.Mapped}\");\n\n                var currentPositionSize = _currentContract.Holdings.Quantity;\n                Liquidate(_currentContract.Symbol);\n                Buy(_continuousContract.Mapped, currentPositionSize);\n                _currentContract = Securities[_continuousContract.Mapped];\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 162575;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"2.48%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"11.325%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"105549.6\"},\n            {\"Net Profit\", \"5.550%\"},\n            {\"Sharpe Ratio\", \"1.332\"},\n            {\"Sortino Ratio\", \"879.904\"},\n            {\"Probabilistic Sharpe Ratio\", \"79.894%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.075\"},\n            {\"Beta\", \"-0.017\"},\n            {\"Annual Standard Deviation\", \"0.053\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-1.48\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"-4.187\"},\n            {\"Total Fees\", \"$10.75\"},\n            {\"Estimated Strategy Capacity\", \"$7100000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"2.33%\"},\n            {\"Drawdown Recovery\", \"37\"},\n            {\"OrderListHash\", \"223735440010fcec5889bb7becacfa82\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing Futures = QuantConnect.Securities.Futures;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic Continuous Futures Template Algorithm with extended market hours\n    /// </summary>\n    public class BasicTemplateContinuousFutureWithExtendedMarketAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Security _currentContract;\n        private SimpleMovingAverage _fast;\n        private SimpleMovingAverage _slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0,\n                extendedMarketHours: true\n            );\n\n            _fast = SMA(_continuousContract.Symbol, 4, Resolution.Daily);\n            _slow = SMA(_continuousContract.Symbol, 10, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n            }\n\n            if (!IsMarketOpen(_continuousContract.Symbol))\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                if(_fast > _slow)\n                {\n                    _currentContract = Securities[_continuousContract.Mapped];\n                    Buy(_currentContract.Symbol, 1);\n                }\n            }\n            else if(_fast < _slow)\n            {\n                Liquidate();\n            }\n\n            if (_currentContract != null && _currentContract.Symbol != _continuousContract.Mapped)\n            {\n                Log($\"{Time} - rolling position from {_currentContract.Symbol} to {_continuousContract.Mapped}\");\n\n                var currentPositionSize = _currentContract.Holdings.Quantity;\n                Liquidate(_currentContract.Symbol);\n                Buy(_continuousContract.Mapped, currentPositionSize);\n                _currentContract = Securities[_continuousContract.Mapped];\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 504530;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"2.86%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"12.959%\"},\n            {\"Drawdown\", \"1.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"106337.1\"},\n            {\"Net Profit\", \"6.337%\"},\n            {\"Sharpe Ratio\", \"1.41\"},\n            {\"Sortino Ratio\", \"1.242\"},\n            {\"Probabilistic Sharpe Ratio\", \"77.992%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.071\"},\n            {\"Beta\", \"0.054\"},\n            {\"Annual Standard Deviation\", \"0.059\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-1.392\"},\n            {\"Tracking Error\", \"0.097\"},\n            {\"Treynor Ratio\", \"1.518\"},\n            {\"Total Fees\", \"$10.75\"},\n            {\"Estimated Strategy Capacity\", \"$890000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"2.32%\"},\n            {\"Drawdown Recovery\", \"34\"},\n            {\"OrderListHash\", \"1504a8892da8d8c0650018732f315753\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// The demonstration algorithm shows some of the most common order methods when working with Crypto assets.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateCryptoAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 4); // Set Start Date\n            SetEndDate(2018, 4, 4); // Set End Date\n\n            // Although typically real brokerages as GDAX only support a single account currency,\n            // here we add both USD and EUR to demonstrate how to handle non-USD account currencies.\n            // Set Strategy Cash (USD)\n            SetCash(10000);\n\n            // Set Strategy Cash (EUR)\n            // EUR/USD conversion rate will be updated dynamically\n            SetCash(\"EUR\", 10000);\n\n            // Add some coins as initial holdings\n            // When connected to a real brokerage, the amount specified in SetCash\n            // will be replaced with the amount in your actual account.\n            SetCash(\"BTC\", 1m);\n            SetCash(\"ETH\", 5m);\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            // You can uncomment the following line when live trading with GDAX,\n            // to ensure limit orders will only be posted to the order book and never executed as a taker (incurring fees).\n            // Please note this statement has no effect in backtesting or paper trading.\n            // DefaultOrderProperties = new GDAXOrderProperties { PostOnly = true };\n\n            // Find more symbols here: http://quantconnect.com/data\n            AddCrypto(\"BTCUSD\");\n            AddCrypto(\"ETHUSD\");\n            AddCrypto(\"BTCEUR\");\n            var symbol = AddCrypto(\"LTCUSD\").Symbol;\n\n            // create two moving averages\n            _fast = EMA(symbol, 30, Resolution.Minute);\n            _slow = EMA(symbol, 60, Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.CashBook[\"EUR\"].ConversionRate == 0\n                || Portfolio.CashBook[\"BTC\"].ConversionRate == 0\n                || Portfolio.CashBook[\"ETH\"].ConversionRate == 0\n                || Portfolio.CashBook[\"LTC\"].ConversionRate == 0)\n            {\n                Log($\"EUR conversion rate: {Portfolio.CashBook[\"EUR\"].ConversionRate}\");\n                Log($\"BTC conversion rate: {Portfolio.CashBook[\"BTC\"].ConversionRate}\");\n                Log($\"LTC conversion rate: {Portfolio.CashBook[\"LTC\"].ConversionRate}\");\n                Log($\"ETH conversion rate: {Portfolio.CashBook[\"ETH\"].ConversionRate}\");\n\n                throw new RegressionTestException(\"Conversion rate is 0\");\n            }\n            if (Time.Hour == 1 && Time.Minute == 0)\n            {\n                // Sell all ETH holdings with a limit order at 1% above the current price\n                var limitPrice = Math.Round(Securities[\"ETHUSD\"].Price * 1.01m, 2);\n                var quantity = Portfolio.CashBook[\"ETH\"].Amount;\n                LimitOrder(\"ETHUSD\", -quantity, limitPrice);\n            }\n            else if (Time.Hour == 2 && Time.Minute == 0)\n            {\n                // Submit a buy limit order for BTC at 5% below the current price\n                var usdTotal = Portfolio.CashBook[\"USD\"].Amount;\n                var limitPrice = Math.Round(Securities[\"BTCUSD\"].Price * 0.95m, 2);\n                // use only half of our total USD\n                var quantity = usdTotal * 0.5m / limitPrice;\n                LimitOrder(\"BTCUSD\", quantity, limitPrice);\n            }\n            else if (Time.Hour == 2 && Time.Minute == 1)\n            {\n                // Get current USD available, subtracting amount reserved for buy open orders\n                var usdTotal = Portfolio.CashBook[\"USD\"].Amount;\n                var usdReserved = Transactions.GetOpenOrders(x => x.Direction == OrderDirection.Buy && x.Type == OrderType.Limit)\n                    .Where(x => x.Symbol == \"BTCUSD\" || x.Symbol == \"ETHUSD\")\n                    .Sum(x => x.Quantity * ((LimitOrder) x).LimitPrice);\n                var usdAvailable = usdTotal - usdReserved;\n\n                // Submit a marketable buy limit order for ETH at 1% above the current price\n                var limitPrice = Math.Round(Securities[\"ETHUSD\"].Price * 1.01m, 2);\n\n                // use all of our available USD\n                var quantity = usdAvailable / limitPrice;\n\n                // this order will be rejected for insufficient funds\n                LimitOrder(\"ETHUSD\", quantity, limitPrice);\n\n                // use only half of our available USD\n                quantity = usdAvailable * 0.5m / limitPrice;\n                LimitOrder(\"ETHUSD\", quantity, limitPrice);\n            }\n            else if (Time.Hour == 11 && Time.Minute == 0)\n            {\n                // Liquidate our BTC holdings (including the initial holding)\n                SetHoldings(\"BTCUSD\", 0m);\n            }\n            else if (Time.Hour == 12 && Time.Minute == 0)\n            {\n                // Submit a market buy order for 1 BTC using EUR\n                Buy(\"BTCEUR\", 1m);\n\n                // Submit a sell limit order at 10% above market price\n                var limitPrice = Math.Round(Securities[\"BTCEUR\"].Price * 1.1m, 2);\n                LimitOrder(\"BTCEUR\", -1, limitPrice);\n            }\n            else if (Time.Hour == 13 && Time.Minute == 0)\n            {\n                // Cancel the limit order if not filled\n                Transactions.CancelOpenOrders(\"BTCEUR\");\n            }\n            else if (Time.Hour > 13)\n            {\n                // To include any initial holdings, we read the LTC amount from the cashbook\n                // instead of using Portfolio[\"LTCUSD\"].Quantity\n\n                if (_fast > _slow)\n                {\n                    if (Portfolio.CashBook[\"LTC\"].Amount == 0)\n                    {\n                        Buy(\"LTCUSD\", 10);\n                    }\n                }\n                else\n                {\n                    if (Portfolio.CashBook[\"LTC\"].Amount > 0)\n                    {\n                        Liquidate(\"LTCUSD\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"{Time} - TotalPortfolioValue: {Portfolio.TotalPortfolioValue}\");\n            Log($\"{Time} - CashBook: {Portfolio.CashBook}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 12965;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 35;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"12\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"31592.84\"},\n            {\"End Equity\", \"30866.71\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$85.34\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"BTCEUR 2XR\"},\n            {\"Portfolio Turnover\", \"118.08%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"26b9a07ace86b6a0e0eb2ff8c168cee0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateCryptoFrameworkAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template framework algorithm uses framework components to define the algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateFrameworkCryptoAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2016, 10, 7);  //Set Start Date\n            SetEndDate(2016, 10, 7);    //Set End Date\n            SetCash(100000);            //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.GDAX)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Minute resolution regression algorithm trading Coin and USDT binance futures long and short asserting the behavior\n    /// </summary>\n    public class BasicTemplateCryptoFutureAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, int> _interestPerSymbol = new();\n        private CryptoFuture _btcUsd;\n        private CryptoFuture _adaUsdt;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13); // Set Start Date\n            SetEndDate(2022, 12, 13); // Set End Date\n\n            SetTimeZone(TimeZones.Utc);\n\n            try\n            {\n                SetBrokerageModel(BrokerageName.BinanceFutures, AccountType.Cash);\n            }\n            catch (InvalidOperationException)\n            {\n                // expected, we don't allow cash account type\n            }\n            SetBrokerageModel(BrokerageName.BinanceFutures, AccountType.Margin);\n\n            _btcUsd = AddCryptoFuture(\"BTCUSD\");\n            _adaUsdt = AddCryptoFuture(\"ADAUSDT\");\n\n            _fast = EMA(_btcUsd.Symbol, 30, Resolution.Minute);\n            _slow = EMA(_btcUsd.Symbol, 60, Resolution.Minute);\n\n            _interestPerSymbol[_btcUsd.Symbol] = 0;\n            _interestPerSymbol[_adaUsdt.Symbol] = 0;\n\n            // Default USD cash, set 1M but it wont be used\n            SetCash(1000000);\n\n            // the amount of BTC we need to hold to trade 'BTCUSD'\n            _btcUsd.BaseCurrency.SetAmount(0.005m);\n            // the amount of USDT we need to hold to trade 'ADAUSDT'\n            _adaUsdt.QuoteCurrency.SetAmount(200);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var interestRates = slice.Get<MarginInterestRate>();\n            foreach (var interestRate in interestRates)\n            {\n                _interestPerSymbol[interestRate.Key]++;\n\n                var cachedInterestRate = Securities[interestRate.Key].Cache.GetData<MarginInterestRate>();\n                if (cachedInterestRate != interestRate.Value)\n                {\n                    throw new RegressionTestException($\"Unexpected cached margin interest rate for {interestRate.Key}!\");\n                }\n            }\n\n            if (_fast > _slow)\n            {\n                if (!Portfolio.Invested && Transactions.OrdersCount == 0)\n                {\n                    var ticket = Buy(_btcUsd.Symbol, 50);\n                    if (ticket.Status != OrderStatus.Invalid)\n                    {\n                        throw new RegressionTestException($\"Unexpected valid order {ticket}, should fail due to margin not sufficient\");\n                    }\n\n                    Buy(_btcUsd.Symbol, 1);\n\n                    var marginUsed = Portfolio.TotalMarginUsed;\n                    var btcUsdHoldings = _btcUsd.Holdings;\n\n                    // Coin futures value is 100 USD\n                    var holdingsValueBtcUsd = 100;\n\n                    if (Math.Abs(btcUsdHoldings.TotalSaleVolume - holdingsValueBtcUsd) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalSaleVolume {btcUsdHoldings.TotalSaleVolume}\");\n                    }\n                    if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - holdingsValueBtcUsd) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}\");\n                    }\n                    if (_btcUsd.BuyingPowerModel.GetMaintenanceMargin(_btcUsd) != marginUsed)\n                    {\n                        throw new RegressionTestException($\"Unexpected margin used {marginUsed}\");\n                    }\n\n                    Buy(_adaUsdt.Symbol, 1000);\n\n                    marginUsed = Portfolio.TotalMarginUsed - marginUsed;\n                    var adaUsdtHoldings = _adaUsdt.Holdings;\n\n                    // USDT/BUSD futures value is based on it's price\n                    var holdingsValueUsdt = _adaUsdt.Price * _adaUsdt.SymbolProperties.ContractMultiplier * 1000;\n\n                    if (Math.Abs(adaUsdtHoldings.TotalSaleVolume - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalSaleVolume {adaUsdtHoldings.TotalSaleVolume}\");\n                    }\n                    if (Math.Abs(adaUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {adaUsdtHoldings.HoldingsCost}\");\n                    }\n                    if (_adaUsdt.BuyingPowerModel.GetMaintenanceMargin(_adaUsdt) != marginUsed)\n                    {\n                        throw new RegressionTestException($\"Unexpected margin used {marginUsed}\");\n                    }\n\n                    // position just opened should be just spread here\n                    var profit = Portfolio.TotalUnrealizedProfit;\n                    if ((5 - Math.Abs(profit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                    }\n\n                    if (Portfolio.TotalProfit != 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                    }\n                }\n            }\n            else\n            {\n                // let's revert our position and double\n                if (Time.Hour > 10 && Transactions.OrdersCount == 3)\n                {\n                    Sell(_btcUsd.Symbol, 3);\n\n                    var btcUsdHoldings = _btcUsd.Holdings;\n\n                    if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - 100 * 2) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}\");\n                    }\n\n                    Sell(_adaUsdt.Symbol, 3000);\n\n                    var adaUsdtHoldings = _adaUsdt.Holdings;\n\n                    // USDT/BUSD futures value is based on it's price\n                    var holdingsValueUsdt = _adaUsdt.Price * _adaUsdt.SymbolProperties.ContractMultiplier * 2000;\n\n                    if (Math.Abs(adaUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {adaUsdtHoldings.HoldingsCost}\");\n                    }\n\n                    // position just opened should be just spread here\n                    var profit = Portfolio.TotalUnrealizedProfit;\n                    if ((5 - Math.Abs(profit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                    }\n                    // we barely did any difference on the previous trade\n                    if ((5 - Math.Abs(Portfolio.TotalProfit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_interestPerSymbol[_adaUsdt.Symbol] != 1)\n            {\n                throw new RegressionTestException($\"Unexpected interest rate count {_interestPerSymbol[_adaUsdt.Symbol]}\");\n            }\n\n            if (_interestPerSymbol[_btcUsd.Symbol] != 3)\n            {\n                throw new RegressionTestException($\"Unexpected interest rate count {_interestPerSymbol[_btcUsd.Symbol]}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7205;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000200.00\"},\n            {\"End Equity\", \"1000278.02\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.65\"},\n            {\"Estimated Strategy Capacity\", \"$620000000.00\"},\n            {\"Lowest Capacity Asset\", \"ADAUSDT 18R\"},\n            {\"Portfolio Turnover\", \"0.16%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"dcc4f964b5549c753123848c32eaee41\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Hourly regression algorithm trading ADAUSDT binance futures long and short asserting the behavior\n    /// </summary>\n    public class BasicTemplateCryptoFutureHourlyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, int> _interestPerSymbol = new();\n        private CryptoFuture _adaUsdt;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 13);\n\n            SetTimeZone(TimeZones.Utc);\n\n            try\n            {\n                SetBrokerageModel(BrokerageName.BinanceCoinFutures, AccountType.Cash);\n            }\n            catch (InvalidOperationException)\n            {\n                // expected, we don't allow cash account type\n            }\n            SetBrokerageModel(BrokerageName.BinanceCoinFutures, AccountType.Margin);\n\n            _adaUsdt = AddCryptoFuture(\"ADAUSDT\", Resolution.Hour);\n\n            _fast = EMA(_adaUsdt.Symbol, 3, Resolution.Hour);\n            _slow = EMA(_adaUsdt.Symbol, 6, Resolution.Hour);\n\n            _interestPerSymbol[_adaUsdt.Symbol] = 0;\n\n            // Default USD cash, set 1M but it wont be used\n            SetCash(1000000);\n\n            // the amount of USDT we need to hold to trade 'ADAUSDT'\n            _adaUsdt.QuoteCurrency.SetAmount(200);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var interestRates = slice.Get<MarginInterestRate>();\n            foreach (var interestRate in interestRates)\n            {\n                _interestPerSymbol[interestRate.Key]++;\n\n                var cachedInterestRate = Securities[interestRate.Key].Cache.GetData<MarginInterestRate>();\n                if (cachedInterestRate != interestRate.Value)\n                {\n                    throw new RegressionTestException($\"Unexpected cached margin interest rate for {interestRate.Key}!\");\n                }\n            }\n\n            if (_fast > _slow)\n            {\n                if (!Portfolio.Invested && Transactions.OrdersCount == 0)\n                {\n                    var ticket = Buy(_adaUsdt.Symbol, 100000);\n                    if (ticket.Status != OrderStatus.Invalid)\n                    {\n                        throw new RegressionTestException($\"Unexpected valid order {ticket}, should fail due to margin not sufficient\");\n                    }\n\n                    Buy(_adaUsdt.Symbol, 1000);\n\n                    var marginUsed = Portfolio.TotalMarginUsed;\n                    var adaUsdtHoldings = _adaUsdt.Holdings;\n\n                    // USDT/BUSD futures value is based on it's price\n                    var holdingsValueUsdt = _adaUsdt.Price * _adaUsdt.SymbolProperties.ContractMultiplier * 1000;\n\n                    if (Math.Abs(adaUsdtHoldings.TotalSaleVolume - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalSaleVolume {adaUsdtHoldings.TotalSaleVolume}\");\n                    }\n                    if (Math.Abs(adaUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {adaUsdtHoldings.HoldingsCost}\");\n                    }\n                    if (_adaUsdt.BuyingPowerModel.GetMaintenanceMargin(_adaUsdt) != marginUsed)\n                    {\n                        throw new RegressionTestException($\"Unexpected margin used {marginUsed}\");\n                    }\n\n                    // position just opened should be just spread here\n                    var profit = Portfolio.TotalUnrealizedProfit;\n                    if ((5 - Math.Abs(profit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                    }\n\n                    if (Portfolio.TotalProfit != 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                    }\n                }\n            }\n            else\n            {\n                // let's revert our position and double\n                if (Time.Hour > 10 && Transactions.OrdersCount == 2)\n                {\n                    Sell(_adaUsdt.Symbol, 3000);\n\n                    var adaUsdtHoldings = _adaUsdt.Holdings;\n\n                    // USDT/BUSD futures value is based on it's price\n                    var holdingsValueUsdt = _adaUsdt.Price * _adaUsdt.SymbolProperties.ContractMultiplier * 2000;\n\n                    if (Math.Abs(adaUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {adaUsdtHoldings.HoldingsCost}\");\n                    }\n\n                    // position just opened should be just spread here\n                    var profit = Portfolio.TotalUnrealizedProfit;\n                    if ((5 - Math.Abs(profit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                    }\n                    // we barely did any difference on the previous trade\n                    if ((5 - Math.Abs(Portfolio.TotalProfit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                    }\n                }\n\n                if (Time.Hour >= 22 && Transactions.OrdersCount == 3)\n                {\n                    Liquidate();\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_interestPerSymbol[_adaUsdt.Symbol] != 1)\n            {\n                throw new RegressionTestException($\"Unexpected interest rate count {_interestPerSymbol[_adaUsdt.Symbol]}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000200\"},\n            {\"End Equity\", \"1000189.47\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.61\"},\n            {\"Estimated Strategy Capacity\", \"$460000000.00\"},\n            {\"Lowest Capacity Asset\", \"ADAUSDT 18R\"},\n            {\"Portfolio Turnover\", \"0.12%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"50a51d06d03a5355248a6bccef1ca521\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of requesting daily resolution data for US Equities.\n    /// This is a simple regression test algorithm using a skeleton algorithm and requesting daily data.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class BasicTemplateDailyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 17);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 72;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"424.375%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104486.22\"},\n            {\"Net Profit\", \"4.486%\"},\n            {\"Sharpe Ratio\", \"17.304\"},\n            {\"Sortino Ratio\", \"35.217\"},\n            {\"Probabilistic Sharpe Ratio\", \"96.835%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.249\"},\n            {\"Beta\", \"1.015\"},\n            {\"Annual Standard Deviation\", \"0.141\"},\n            {\"Annual Variance\", \"0.02\"},\n            {\"Information Ratio\", \"-19\"},\n            {\"Tracking Error\", \"0.011\"},\n            {\"Treynor Ratio\", \"2.403\"},\n            {\"Total Fees\", \"$3.49\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"10.01%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"70f21e930175a2ec9d465b21edc1b6d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateEurexFuturesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests and demonstrates EUREX futures subscription and trading:\n    /// - It tests contracts rollover by adding a continuous future and asserting that mapping happens at some point.\n    /// - It tests basic trading by buying a contract and holding it until expiration.\n    /// - It tests delisting and asserts the holdings are liquidated after that.\n    /// </summary>\n    public class BasicTemplateEurexFuturesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Symbol _mappedSymbol;\n        private Symbol _contractToTrade;\n        private int _mappingsCount;\n        private decimal _boughtQuantity;\n        private decimal _liquidatedQuantity;\n        private bool _delisted;\n\n        public override void Initialize()\n        {\n            SetStartDate(2024, 5, 30);\n            SetEndDate(2024, 6, 23);\n\n            SetAccountCurrency(Currencies.EUR);\n            SetCash(1000000);\n\n            _continuousContract = AddFuture(Futures.Indices.EuroStoxx50, Resolution.Minute,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.FirstDayMonth,\n                contractDepthOffset: 0);\n            _continuousContract.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(180));\n            _mappedSymbol = _continuousContract.Mapped;\n\n            var benchmark = AddIndex(\"SX5E\");\n            SetBenchmark(benchmark.Symbol);\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (++_mappingsCount > 1)\n                {\n                    throw new RegressionTestException($\"{Time} - Unexpected number of symbol changed events (mappings): {_mappingsCount}. \" +\n                        $\"Expected only 1.\");\n                }\n\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n\n                if (changedEvent.OldSymbol != _mappedSymbol.ID.ToString())\n                {\n                    throw new RegressionTestException($\"{Time} - Unexpected symbol changed event old symbol: {changedEvent}\");\n                }\n\n                if (changedEvent.NewSymbol != _continuousContract.Mapped.ID.ToString())\n                {\n                    throw new RegressionTestException($\"{Time} - Unexpected symbol changed event new symbol: {changedEvent}\");\n                }\n\n                // Let's trade the previous mapped contract, so we can hold it until expiration for testing\n                // (will be sooner than the new mapped contract)\n                _contractToTrade = _mappedSymbol;\n                _mappedSymbol = _continuousContract.Mapped;\n            }\n\n            // Let's trade after the mapping is done\n            if (_contractToTrade != null && _boughtQuantity == 0 && Securities[_contractToTrade].Exchange.ExchangeOpen)\n            {\n                Buy(_contractToTrade, 1);\n            }\n\n            if (_contractToTrade != null && slice.Delistings.TryGetValue(_contractToTrade, out var delisting))\n            {\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    _delisted = true;\n\n                    if (Portfolio.Invested)\n                    {\n                        throw new RegressionTestException($\"{Time} - Portfolio should not be invested after the traded contract is delisted.\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Symbol != _contractToTrade)\n            {\n                throw new RegressionTestException($\"{Time} - Unexpected order event symbol: {orderEvent.Symbol}. Expected {_contractToTrade}\");\n            }\n\n            if (orderEvent.Direction == OrderDirection.Buy)\n            {\n                if (orderEvent.Status == OrderStatus.Filled)\n                {\n                    if (_boughtQuantity != 0 && _liquidatedQuantity != 0)\n                    {\n                        throw new RegressionTestException($\"{Time} - Unexpected buy order event status: {orderEvent.Status}\");\n                    }\n                    _boughtQuantity = orderEvent.Quantity;\n                }\n            }\n            else if (orderEvent.Direction == OrderDirection.Sell)\n            {\n                if (orderEvent.Status == OrderStatus.Filled)\n                {\n                    if (_boughtQuantity <= 0 && _liquidatedQuantity != 0)\n                    {\n                        throw new RegressionTestException($\"{Time} - Unexpected sell order event status: {orderEvent.Status}\");\n                    }\n                    _liquidatedQuantity = orderEvent.Quantity;\n\n                    if (_liquidatedQuantity != -_boughtQuantity)\n                    {\n                        throw new RegressionTestException($\"{Time} - Unexpected liquidated quantity: {_liquidatedQuantity}. Expected: {-_boughtQuantity}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (addedSecurity.Symbol.SecurityType == SecurityType.Future && addedSecurity.Symbol.IsCanonical())\n                {\n                    _mappedSymbol = _continuousContract.Mapped;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_mappingsCount == 0)\n            {\n                throw new RegressionTestException($\"Unexpected number of symbol changed events (mappings): {_mappingsCount}. Expected 1.\");\n            }\n\n            if (!_delisted)\n            {\n                throw new RegressionTestException(\"Contract was not delisted\");\n            }\n\n            // Make sure we traded and that the position was liquidated on delisting\n            if (_boughtQuantity <= 0 || _liquidatedQuantity >= 0)\n            {\n                throw new RegressionTestException($\"Unexpected sold quantity: {_boughtQuantity} and liquidated quantity: {_liquidatedQuantity}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 94326;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.11%\"},\n            {\"Compounding Annual Return\", \"-1.667%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"998849.48\"},\n            {\"Net Profit\", \"-0.115%\"},\n            {\"Sharpe Ratio\", \"-34.455\"},\n            {\"Sortino Ratio\", \"-57.336\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.002%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.176\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€1.02\"},\n            {\"Estimated Strategy Capacity\", \"€2300000000.00\"},\n            {\"Lowest Capacity Asset\", \"FESX YJHOAMPYKRS5\"},\n            {\"Portfolio Turnover\", \"0.40%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ac9acc478ba1afe53993cdbb92f8ec6e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFillForwardAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Skeleton algorithm demonstrating filling forward data through gaps and inconsistent data. By default LEAN fills the previous bar forward\n    /// so you get regular bars.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class BasicTemplateFillForwardAlgorithm : QCAlgorithm\n    {\n        private Symbol _asur = QuantConnect.Symbol.Create(\"ASUR\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);  //Set Start Date\n            SetEndDate(2013, 11, 30);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"ASUR\", Resolution.Second);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_asur, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateForexAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating FOREX asset types and requesting history on them in bulk. As FOREX uses\n    /// QuoteBars you should request slices or\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"forex\" />\n    public class BasicTemplateForexAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 5, 7);  //Set Start Date\n            SetEndDate(2014, 5, 15);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddForex(\"EURUSD\");\n            AddForex(\"NZDUSD\");\n\n            var dailyHistory = History(5, Resolution.Daily);\n            var hourHistory = History(5, Resolution.Hour);\n            var minuteHistory = History(5, Resolution.Minute);\n            var secondHistory = History(5, Resolution.Second);\n\n            // Log values from history request of second-resolution data\n            foreach (var data in secondHistory)\n            {\n                foreach (var key in data.Keys)\n                {\n                    Log(key.Value + \": \" + data.Time + \" > \" + data[key].Value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"EURUSD\", .5);\n                SetHoldings(\"NZDUSD\", .5);\n                Log(string.Join(\", \", slice.Values));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template framework algorithm uses framework components to define the algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n\n            // We can define who often the EWPCM will rebalance if no new insight is submitted using:\n            // Resolution Enum:\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Resolution.Daily));\n            // TimeSpan\n            // SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(TimeSpan.FromDays(2)));\n            // A Func<DateTime, DateTime>. In this case, we can use the pre-defined func at Expiry helper class\n            // SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Expiry.EndOfWeek));\n\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.01%\"},\n            {\"Compounding Annual Return\", \"261.134%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101655.30\"},\n            {\"Net Profit\", \"1.655%\"},\n            {\"Sharpe Ratio\", \"8.472\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.840%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.091\"},\n            {\"Beta\", \"1.006\"},\n            {\"Annual Standard Deviation\", \"0.224\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-33.445\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"1.885\"},\n            {\"Total Fees\", \"$10.32\"},\n            {\"Estimated Strategy Capacity\", \"$27000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"59.86%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"f209ed42701b0419858e0100595b40c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFutureOptionAlgorithm.cs",
    "content": "/*\r\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\r\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n*/\r\n\r\nusing System;\r\nusing System.Linq;\r\nusing QuantConnect.Data;\r\nusing QuantConnect.Orders;\r\nusing QuantConnect.Securities;\r\n\r\nnamespace QuantConnect.Algorithm.CSharp\r\n{\r\n    /// <summary>\r\n    /// Algorithm demonstrating FutureOption asset types and requesting history.\r\n    /// </summary>\r\n    /// <meta name=\"tag\" content=\"using data\" />\r\n    /// <meta name=\"tag\" content=\"history\" />\r\n    /// <meta name=\"tag\" content=\"future option\" />\r\n    public class BasicTemplateFutureOptionAlgorithm : QCAlgorithm\r\n    {\r\n        private Symbol _symbol;\r\n\r\n        /// <summary>\r\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\r\n        /// </summary>\r\n        public override void Initialize()\r\n        {\r\n            SetStartDate(2022, 1, 1);\r\n            SetEndDate(2022, 2, 1);\r\n            SetCash(100000);\r\n\r\n            var gold_futures = AddFuture(Futures.Metals.Gold, Resolution.Minute);\r\n            gold_futures.SetFilter(0, 180);\r\n            _symbol = gold_futures.Symbol;\r\n            AddFutureOption(_symbol, universe => universe.Strikes(-5, +5)\r\n                                                        .CallsOnly()\r\n                                                        .BackMonth()\r\n                                                        .OnlyApplyFilterAtMarketOpen());\r\n\r\n            // Historical Data\r\n            var history = History(_symbol, 60, Resolution.Daily);\r\n            Log($\"Received {history.Count()} bars from {_symbol} FutureOption historical data call.\");\r\n        }\r\n\r\n        /// <summary>\r\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\r\n        /// </summary>\r\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\r\n        public override void OnData(Slice slice)\r\n        {\r\n            // Access Data\r\n            foreach(var kvp in slice.OptionChains)\r\n            {\r\n                var underlyingFutureContract = kvp.Key.Underlying;\r\n                var chain = kvp.Value;\r\n\r\n                if (chain.Count() == 0) continue;\r\n\r\n                foreach(var contract in chain)\r\n                {\r\n                    Log($@\"Canonical Symbol: {kvp.Key}; \r\n                        Contract: {contract}; \r\n                        Right: {contract.Right}; \r\n                        Expiry: {contract.Expiry}; \r\n                        Bid price: {contract.BidPrice}; \r\n                        Ask price: {contract.AskPrice}; \r\n                        Implied Volatility: {contract.ImpliedVolatility}\");\r\n                }\r\n\r\n                if (!Portfolio.Invested)\r\n                {\r\n                    var atmStrike = chain.OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike)).First().Strike;\r\n                    var selectedContract = chain.Where(x => x.Strike == atmStrike).OrderByDescending(x => x.Expiry).First();\r\n                    MarketOrder(selectedContract.Symbol, 1);\r\n                }\r\n            }\r\n        }\r\n\r\n        public override void OnOrderEvent(OrderEvent orderEvent)\r\n        {\r\n            Debug($\"{Time} {orderEvent.ToString()}\");\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFutureRolloverAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm for trading continuous future\n    /// </summary>\n    public class BasicTemplateFutureRolloverAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, SymbolData> _symbolDataBySymbol = new();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 8);\n            SetEndDate(2013, 12, 10);\n            SetCash(1000000);\n\n            var futures = new List<string> {\n                Futures.Indices.SP500EMini\n            };\n\n            foreach (var future in futures)\n            {\n                // Requesting data\n                var continuousContract = AddFuture(future,\n                    resolution: Resolution.Daily,\n                    extendedMarketHours: true,\n                    dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                    dataMappingMode: DataMappingMode.OpenInterest,\n                    contractDepthOffset: 0\n                );\n\n                var symbolData = new SymbolData(this, continuousContract);\n                _symbolDataBySymbol.Add(continuousContract.Symbol, symbolData);\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var kvp in _symbolDataBySymbol)\n            {\n                var symbol = kvp.Key;\n                var symbolData = kvp.Value;\n\n                // Call SymbolData.Update() method to handle new data slice received\n                symbolData.Update(slice);\n\n                // Check if information in SymbolData class and new slice data are ready for trading\n                if (!symbolData.IsReady || !slice.Bars.ContainsKey(symbol))\n                {\n                    return;\n                }\n\n                var emaCurrentValue = symbolData.EMA.Current.Value;\n                if (emaCurrentValue < symbolData.Price && !symbolData.IsLong)\n                {\n                    MarketOrder(symbolData.Mapped, 1);\n                }\n                else if (emaCurrentValue > symbolData.Price && !symbolData.IsShort)\n                {\n                    MarketOrder(symbolData.Mapped, -1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Abstracted class object to hold information (state, indicators, methods, etc.) from a Symbol/Security in a multi-security algorithm\n        /// </summary>\n        public class SymbolData\n        {\n            private QCAlgorithm _algorithm;\n            private Future _future;\n            public ExponentialMovingAverage EMA { get; set; }\n            public decimal Price { get; set; }\n            public bool IsLong { get; set; }\n            public bool IsShort { get; set; }\n            public Symbol Symbol => _future.Symbol;\n            public Symbol Mapped => _future.Mapped;\n\n            /// <summary>\n            /// Check if symbolData class object are ready for trading\n            /// </summary>\n            public bool IsReady => Mapped != null && EMA.IsReady;\n\n            /// <summary>\n            /// Constructor to instantiate the information needed to be hold\n            /// </summary>\n            public SymbolData(QCAlgorithm algorithm, Future future)\n            {\n                _algorithm = algorithm;\n                _future = future;\n                EMA = algorithm.EMA(future.Symbol, 20, Resolution.Daily);\n\n                Reset();\n            }\n\n            /// <summary>\n            /// Handler of new slice of data received\n            /// </summary>\n            public void Update(Slice slice)\n            {\n                if (slice.SymbolChangedEvents.TryGetValue(Symbol, out var changedEvent))\n                {\n                    var oldSymbol = changedEvent.OldSymbol;\n                    var newSymbol = changedEvent.NewSymbol;\n                    var tag = $\"Rollover - Symbol changed at {_algorithm.Time}: {oldSymbol} -> {newSymbol}\";\n                    var quantity = _algorithm.Portfolio[oldSymbol].Quantity;\n\n                    // Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract\n                    _algorithm.Liquidate(oldSymbol, tag: tag);\n                    _algorithm.MarketOrder(newSymbol, quantity, tag: tag);\n\n                    Reset();\n                }\n\n                Price = slice.Bars.ContainsKey(Symbol) ? slice.Bars[Symbol].Price : Price;\n                IsLong = _algorithm.Portfolio[Mapped].IsLong;\n                IsShort = _algorithm.Portfolio[Mapped].IsShort;\n            }\n\n            /// <summary>\n            /// Reset RollingWindow/indicator to adapt to newly mapped contract, then warm up the RollingWindow/indicator\n            /// </summary>\n            private void Reset()\n            {\n                EMA.Reset();\n                _algorithm.WarmUpIndicator(Symbol, EMA, Resolution.Daily);\n            }\n\n            /// <summary>\n            /// Disposal method to remove consolidator/update method handler, and reset RollingWindow/indicator to free up memory and speed\n            /// </summary>\n            public void Dispose()\n            {\n                EMA.Reset();\n            }\n        }\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 727;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.010%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999983.2\"},\n            {\"Net Profit\", \"-0.002%\"},\n            {\"Sharpe Ratio\", \"-225.214\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.135%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.008\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.146\"},\n            {\"Tracking Error\", \"0.083\"},\n            {\"Treynor Ratio\", \"-542.359\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a6ccce3a1a7f549f887d83e84bfa878d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add futures for a given underlying asset.\n    /// It also shows how you can prefilter contracts easily based on expirations, and how you\n    /// can inspect the futures chain to pick a specific contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contractSymbol;\n\n        // S&P 500 EMini futures\n        private const string RootSP500 = Futures.Indices.SP500EMini;\n\n        // Gold futures\n        private const string RootGold = Futures.Metals.Gold;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n            SetCash(1000000);\n\n            var futureSP500 = AddFuture(RootSP500);\n            var futureGold = AddFuture(RootGold);\n\n            // set our expiry filter for this futures chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n            futureGold.SetFilter(0, 182);\n\n            var benchmark = AddEquity(\"SPY\");\n            SetBenchmark(benchmark.Symbol);\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                foreach(var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        _contractSymbol = contract.Symbol;\n                        MarketOrder(_contractSymbol, 1);\n                    }\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Get the margin requirements\n            var buyingPowerModel = Securities[_contractSymbol].BuyingPowerModel;\n            var futureMarginModel = buyingPowerModel as FutureMarginModel;\n            if (buyingPowerModel == null)\n            {\n                throw new RegressionTestException($\"Invalid buying power model. Found: {buyingPowerModel.GetType().Name}. Expected: {nameof(FutureMarginModel)}\");\n            }\n            var initialOvernight = futureMarginModel.InitialOvernightMarginRequirement;\n            var maintenanceOvernight = futureMarginModel.MaintenanceOvernightMarginRequirement;\n            var initialIntraday = futureMarginModel.InitialIntradayMarginRequirement;\n            var maintenanceIntraday = futureMarginModel.MaintenanceIntradayMarginRequirement;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (addedSecurity.Symbol.SecurityType == SecurityType.Future\n                    && !addedSecurity.Symbol.IsCanonical()\n                    && !addedSecurity.HasData)\n                {\n                    throw new RegressionTestException($\"Future contracts did not work up as expected: {addedSecurity.Symbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 40308;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 354;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2700\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-99.597%\"},\n            {\"Drawdown\", \"4.400%\"},\n            {\"Expectancy\", \"-0.724\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"955700.5\"},\n            {\"Net Profit\", \"-4.430%\"},\n            {\"Sharpe Ratio\", \"-31.63\"},\n            {\"Sortino Ratio\", \"-31.63\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"83%\"},\n            {\"Win Rate\", \"17%\"},\n            {\"Profit-Loss Ratio\", \"0.65\"},\n            {\"Alpha\", \"-3.065\"},\n            {\"Beta\", \"0.128\"},\n            {\"Annual Standard Deviation\", \"0.031\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-81.232\"},\n            {\"Tracking Error\", \"0.212\"},\n            {\"Treynor Ratio\", \"-7.677\"},\n            {\"Total Fees\", \"$6237.00\"},\n            {\"Estimated Strategy Capacity\", \"$14000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VOFJUCDY9XNH\"},\n            {\"Portfolio Turnover\", \"9912.69%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6e0f767a46a54365287801295cf7bb75\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesConsolidationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// A demonstration of consolidating futures data into larger bars for your algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"consolidating data\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesConsolidationAlgorithm : QCAlgorithm\n    {\n        private const string RootSP500 = Futures.Indices.SP500EMini;\n        private HashSet<Symbol> _futureContracts = new HashSet<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 8);\n            SetEndDate(2013, 10, 11);\n            SetCash(1000000);\n\n            var futureSP500 = AddFuture(RootSP500);\n            // set our expiry filter for this future chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            futureSP500.SetFilter(0, 182);\n            // futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var chain in slice.FutureChains)\n            {\n                foreach (var contract in chain.Value)\n                {\n                    if (!_futureContracts.Contains(contract.Symbol))\n                    {\n                        _futureContracts.Add(contract.Symbol);\n\n                        var consolidator = new QuoteBarConsolidator(TimeSpan.FromMinutes(5));\n                        consolidator.DataConsolidated += OnDataConsolidated;\n                        SubscriptionManager.AddConsolidator(contract.Symbol, consolidator);\n\n                        Log(\"Added new consolidator for \" + contract.Symbol.Value);\n                    }\n                }\n            }\n        }\n\n        public void OnDataConsolidated(object sender, QuoteBar quoteBar)\n        {\n            Log(\"OnDataConsolidated called\");\n            Log(quoteBar.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add futures with daily resolution.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesDailyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual Resolution Resolution => Resolution.Daily;\n        protected virtual bool ExtendedMarketHours => false;\n\n        // S&P 500 EMini futures\n        private const string RootSP500 = Futures.Indices.SP500EMini;\n\n        // Gold futures\n        private const string RootGold = Futures.Metals.Gold;\n        private Future _futureSP500;\n        private Future _futureGold;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2014, 10, 10);\n            SetCash(1000000);\n\n            _futureSP500 = AddFuture(RootSP500, Resolution, extendedMarketHours: ExtendedMarketHours);\n            _futureGold = AddFuture(RootGold, Resolution, extendedMarketHours: ExtendedMarketHours);\n\n            // set our expiry filter for this futures chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            _futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n            _futureGold.SetFilter(0, 182);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach(var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it.\n                    // Also check if exchange is open for regular or extended hours. Since daily data comes at 8PM, this allows us prevent the\n                    // algorithm from trading on friday when there is not after-market.\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n            // Same as above, check for cases like trading on a friday night.\n            else if (Securities.Values.Where(x => x.Invested).All(x => x.Exchange.Hours.IsOpen(Time, true)))\n            {\n                Liquidate();\n            }\n\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Count > 0 &&\n                Portfolio.Invested &&\n                Securities.Values.Where(x => x.Invested).All(x => x.Exchange.Hours.IsOpen(Time, true)))\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 5867;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"38\"},\n            {\"Average Win\", \"0.33%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"0.098%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0.165\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000991.96\"},\n            {\"Net Profit\", \"0.099%\"},\n            {\"Sharpe Ratio\", \"-1.708\"},\n            {\"Sortino Ratio\", \"-0.84\"},\n            {\"Probabilistic Sharpe Ratio\", \"14.542%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"10.07\"},\n            {\"Alpha\", \"-0.007\"},\n            {\"Beta\", \"0.002\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.354\"},\n            {\"Tracking Error\", \"0.089\"},\n            {\"Treynor Ratio\", \"-4.054\"},\n            {\"Total Fees\", \"$85.54\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES VRJST036ZY0X\"},\n            {\"Portfolio Turnover\", \"1.04%\"},\n            {\"Drawdown Recovery\", \"69\"},\n            {\"OrderListHash\", \"eafc33ea4dcb219f7aacdbdd0973d5bc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template futures framework algorithm uses framework components to define an algorithm\n    /// that trades futures.\n    /// </summary>\n    public class BasicTemplateFuturesFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool ExtendedMarketHours => false;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n            UniverseSettings.ExtendedMarketHours = ExtendedMarketHours;\n\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            // set framework models\n            SetUniverseSelection(new FrontMonthFutureUniverseSelectionModel(SelectFutureChainSymbols));\n            SetAlpha(new ConstantFutureContractAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new SingleSharePortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        // future symbol universe selection function\n        private static IEnumerable<Symbol> SelectFutureChainSymbols(DateTime utcTime)\n        {\n            var newYorkTime = utcTime.ConvertFromUtc(TimeZones.NewYork);\n            if (newYorkTime.Date < new DateTime(2013, 10, 09))\n            {\n                yield return QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            }\n\n            if (newYorkTime.Date >= new DateTime(2013, 10, 09))\n            {\n                yield return QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX);\n            }\n        }\n\n        /// <summary>\n        /// Creates futures chain universes that select the front month contract and runs a user\n        /// defined futureChainSymbolSelector every day to enable choosing different futures chains\n        /// </summary>\n        class FrontMonthFutureUniverseSelectionModel : FutureUniverseSelectionModel\n        {\n            public FrontMonthFutureUniverseSelectionModel(Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector)\n                : base(TimeSpan.FromDays(1), futureChainSymbolSelector)\n            {\n            }\n\n            /// <summary>\n            /// Defines the future chain universe filter\n            /// </summary>\n            protected override FutureFilterUniverse Filter(FutureFilterUniverse filter)\n            {\n                return filter\n                    .FrontMonth()\n                    .OnlyApplyFilterAtMarketOpen();\n            }\n        }\n\n        /// <summary>\n        /// Implementation of a constant alpha model that only emits insights for future symbols\n        /// </summary>\n        class ConstantFutureContractAlphaModel : ConstantAlphaModel\n        {\n            public ConstantFutureContractAlphaModel(InsightType type, InsightDirection direction, TimeSpan period)\n                : base(type, direction, period)\n            {\n            }\n\n            protected override bool ShouldEmitInsight(DateTime utcTime, Symbol symbol)\n            {\n                // only emit alpha for future symbols and not underlying equity symbols\n                if (symbol.SecurityType != SecurityType.Future)\n                {\n                    return false;\n                }\n\n                return base.ShouldEmitInsight(utcTime, symbol);\n            }\n        }\n\n        /// <summary>\n        /// Portfolio construction model that sets target quantities to 1 for up insights and -1 for down insights\n        /// </summary>\n        class SingleSharePortfolioConstructionModel : PortfolioConstructionModel\n        {\n            public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                foreach (var insight in insights)\n                {\n                    yield return new PortfolioTarget(insight.Symbol, (int) insight.Direction);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 24883;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-81.734%\"},\n            {\"Drawdown\", \"4.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97830.76\"},\n            {\"Net Profit\", \"-2.169%\"},\n            {\"Sharpe Ratio\", \"-10.299\"},\n            {\"Sortino Ratio\", \"-10.299\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-1.212\"},\n            {\"Beta\", \"0.238\"},\n            {\"Annual Standard Deviation\", \"0.072\"},\n            {\"Annual Variance\", \"0.005\"},\n            {\"Information Ratio\", \"-15.404\"},\n            {\"Tracking Error\", \"0.176\"},\n            {\"Treynor Ratio\", \"-3.109\"},\n            {\"Total Fees\", \"$4.62\"},\n            {\"Estimated Strategy Capacity\", \"$17000000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VL5E74HP3EE5\"},\n            {\"Portfolio Turnover\", \"43.23%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c0fc1bcdc3008a8d263521bbc9d7cdbd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template futures framework algorithm uses framework components to define an algorithm\n    /// that trades futures.\n    /// </summary>\n    public class BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm : BasicTemplateFuturesFrameworkAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 70262;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-92.667%\"},\n            {\"Drawdown\", \"5.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96685.76\"},\n            {\"Net Profit\", \"-3.314%\"},\n            {\"Sharpe Ratio\", \"-6.359\"},\n            {\"Sortino Ratio\", \"-11.237\"},\n            {\"Probabilistic Sharpe Ratio\", \"9.333%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-1.47\"},\n            {\"Beta\", \"0.312\"},\n            {\"Annual Standard Deviation\", \"0.134\"},\n            {\"Annual Variance\", \"0.018\"},\n            {\"Information Ratio\", \"-14.77\"},\n            {\"Tracking Error\", \"0.192\"},\n            {\"Treynor Ratio\", \"-2.742\"},\n            {\"Total Fees\", \"$4.62\"},\n            {\"Estimated Strategy Capacity\", \"$52000000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VL5E74HP3EE5\"},\n            {\"Portfolio Turnover\", \"43.77%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"dcdaafcefa47465962ace2759ed99c91\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to get access to futures history for a given root symbol.\n    /// It also shows how you can prefilter contracts easily based on expirations, and inspect the futures\n    /// chain to pick a specific contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesHistoryAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool ExtendedMarketHours => false;\n        protected virtual int ExpectedHistoryCallCount => 42;\n\n        // S&P 500 EMini futures\n        private string [] roots = new []\n        {\n            Futures.Indices.SP500EMini,\n            Futures.Metals.Gold,\n        };\n\n        private int _successCount = 0;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 8);\n            SetEndDate(2013, 10, 9);\n            SetCash(1000000);\n\n            foreach (var root in roots)\n            {\n                // set our expiry filter for this futures chain\n                AddFuture(root, Resolution.Minute, extendedMarketHours: ExtendedMarketHours).SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n            }\n\n            SetBenchmark(d => 1000000);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(1)), MakeHistoryCall);\n        }\n\n        private void MakeHistoryCall()\n        {\n            var history = History(10, Resolution.Minute);\n            if (history.Count() < 10)\n            {\n                throw new RegressionTestException($\"Empty history at {Time}\");\n            }\n            _successCount++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_successCount < ExpectedHistoryCallCount)\n            {\n                throw new RegressionTestException($\"Scheduled Event did not assert history call as many times as expected: {_successCount}/49\");\n            }\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    foreach (var contract in chain.Value)\n                    {\n                        Log($\"{contract.Symbol.Value},\" +\n                            $\"Bid={contract.BidPrice.ToStringInvariant()} \" +\n                            $\"Ask={contract.AskPrice.ToStringInvariant()} \" +\n                            $\"Last={contract.LastPrice.ToStringInvariant()} \" +\n                            $\"OI={contract.OpenInterest.ToStringInvariant()}\"\n                        );\n                    }\n                }\n            }\n        }\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var change in changes.AddedSecurities)\n            {\n                var history = History(change.Symbol, 10, Resolution.Minute);\n\n                foreach (var data in history.OrderByDescending(x => x.Time).Take(3))\n                {\n                    Log(\"History: \" + data.Symbol.Value + \": \" + data.Time + \" > \" + data.Close);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 25316;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 6075;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to get access to futures history for a given root symbol with extended market hours.\n    /// It also shows how you can prefilter contracts easily based on expirations, and inspect the futures\n    /// chain to pick a specific contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm : BasicTemplateFuturesHistoryAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n        protected override int ExpectedHistoryCallCount => 49;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 76063;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 6112;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regressions tests the BasicTemplateFuturesDailyAlgorithm with hour data\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesHourlyAlgorithm : BasicTemplateFuturesDailyAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 25339;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"718\"},\n            {\"Average Win\", \"0.03%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-1.720%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"-0.770\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"982676.58\"},\n            {\"Net Profit\", \"-1.732%\"},\n            {\"Sharpe Ratio\", \"-8.877\"},\n            {\"Sortino Ratio\", \"-5.476\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"96%\"},\n            {\"Win Rate\", \"4%\"},\n            {\"Profit-Loss Ratio\", \"4.90\"},\n            {\"Alpha\", \"-0.018\"},\n            {\"Beta\", \"-0.002\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.484\"},\n            {\"Tracking Error\", \"0.089\"},\n            {\"Treynor Ratio\", \"9.171\"},\n            {\"Total Fees\", \"$1638.42\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"20.14%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c301a0a086f8905b1a555f0257087272\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add futures for a given underlying asset.\n    /// It also shows how you can prefilter contracts easily based on expirations, and how you\n    /// can inspect the futures chain to pick a specific contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesWithExtendedMarketAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contractSymbol;\n\n        // S&P 500 EMini futures\n        private const string RootSP500 = Futures.Indices.SP500EMini;\n\n        // Gold futures\n        private const string RootGold = Futures.Metals.Gold;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n            SetCash(1000000);\n\n            var futureSP500 = AddFuture(RootSP500, extendedMarketHours: true);\n            var futureGold = AddFuture(RootGold, extendedMarketHours: true);\n\n            // set our expiry filter for this futures chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n            futureGold.SetFilter(0, 182);\n\n            var benchmark = AddEquity(\"SPY\");\n            SetBenchmark(benchmark.Symbol);\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                foreach(var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        _contractSymbol = contract.Symbol;\n                        MarketOrder(_contractSymbol, 1);\n                    }\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Get the margin requirements\n            var buyingPowerModel = Securities[_contractSymbol].BuyingPowerModel;\n            var futureMarginModel = buyingPowerModel as FutureMarginModel;\n            if (buyingPowerModel == null)\n            {\n                throw new RegressionTestException($\"Invalid buying power model. Found: {buyingPowerModel.GetType().Name}. Expected: {nameof(FutureMarginModel)}\");\n            }\n            var initialOvernight = futureMarginModel.InitialOvernightMarginRequirement;\n            var maintenanceOvernight = futureMarginModel.MaintenanceOvernightMarginRequirement;\n            var initialIntraday = futureMarginModel.InitialIntradayMarginRequirement;\n            var maintenanceIntraday = futureMarginModel.MaintenanceIntradayMarginRequirement;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (addedSecurity.Symbol.SecurityType == SecurityType.Future\n                    && !addedSecurity.Symbol.IsCanonical()\n                    && !addedSecurity.HasData)\n                {\n                    throw new RegressionTestException($\"Future contracts did not work up as expected: {addedSecurity.Symbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 117079;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 354;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8282\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-100.000%\"},\n            {\"Drawdown\", \"13.900%\"},\n            {\"Expectancy\", \"-0.824\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"861260.7\"},\n            {\"Net Profit\", \"-13.874%\"},\n            {\"Sharpe Ratio\", \"-19.346\"},\n            {\"Sortino Ratio\", \"-19.346\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"0.64\"},\n            {\"Alpha\", \"2.468\"},\n            {\"Beta\", \"-0.215\"},\n            {\"Annual Standard Deviation\", \"0.052\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-58.37\"},\n            {\"Tracking Error\", \"0.295\"},\n            {\"Treynor Ratio\", \"4.695\"},\n            {\"Total Fees\", \"$19131.42\"},\n            {\"Estimated Strategy Capacity\", \"$130000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VOFJUCDY9XNH\"},\n            {\"Portfolio Turnover\", \"32523.20%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0664a72652a19956ea3c4915269cc4b9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add futures with daily resolution and extended market hours.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesWithExtendedMarketDailyAlgorithm : BasicTemplateFuturesDailyAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5971;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"36\"},\n            {\"Average Win\", \"0.33%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"0.103%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0.172\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1001033.76\"},\n            {\"Net Profit\", \"0.103%\"},\n            {\"Sharpe Ratio\", \"-1.701\"},\n            {\"Sortino Ratio\", \"-0.809\"},\n            {\"Probabilistic Sharpe Ratio\", \"14.685%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"9.55\"},\n            {\"Alpha\", \"-0.007\"},\n            {\"Beta\", \"0.002\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.353\"},\n            {\"Tracking Error\", \"0.089\"},\n            {\"Treynor Ratio\", \"-4.042\"},\n            {\"Total Fees\", \"$81.24\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES VRJST036ZY0X\"},\n            {\"Portfolio Turnover\", \"0.99%\"},\n            {\"Drawdown Recovery\", \"69\"},\n            {\"OrderListHash\", \"67120ad5c9a6116001dda6c8061e5353\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regressions tests the BasicTemplateFuturesDailyAlgorithm with hour data and extended market hours\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm : BasicTemplateFuturesHourlyAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 67998;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1992\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-4.687%\"},\n            {\"Drawdown\", \"4.700%\"},\n            {\"Expectancy\", \"-0.911\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"952789.22\"},\n            {\"Net Profit\", \"-4.721%\"},\n            {\"Sharpe Ratio\", \"-7.183\"},\n            {\"Sortino Ratio\", \"-5.14\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"97%\"},\n            {\"Win Rate\", \"3%\"},\n            {\"Profit-Loss Ratio\", \"2.04\"},\n            {\"Alpha\", \"-0.038\"},\n            {\"Beta\", \"-0.008\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.702\"},\n            {\"Tracking Error\", \"0.09\"},\n            {\"Treynor Ratio\", \"5.054\"},\n            {\"Total Fees\", \"$4543.28\"},\n            {\"Estimated Strategy Capacity\", \"$3000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"56.73%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6ce7812de5c98744cc35169a86a24325\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm simply initializes the date range and cash. This is a skeleton\n    /// framework you can use for designing an algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateHourlyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n            AddEquity(\"SPY\", Resolution.Hour);\n\n            // There are other assets with similar methods. See \"Selecting Options\" etc for more details.\n            // AddFuture, AddForex, AddCfd, AddOption\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"227.693%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101529.08\"},\n            {\"Net Profit\", \"1.529%\"},\n            {\"Sharpe Ratio\", \"8.855\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.564\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.971\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$110000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.96%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"60747dce5c2aed393b7dccc258d2c9b5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add index asset types.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"indexes\" />\n    public class BasicTemplateIndexAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Symbol Spx { get; set; }\n        protected Symbol SpxOption { get; set; }\n        private ExponentialMovingAverage _emaSlow;\n        private ExponentialMovingAverage _emaFast;\n\n        protected virtual Resolution Resolution => Resolution.Minute;\n        protected virtual int StartDay => 4;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, StartDay);\n            SetEndDate(2021, 1, 18);\n            SetCash(1000000);\n\n            // Use indicator for signal; but it cannot be traded\n            Spx = AddIndex(\"SPX\", Resolution).Symbol;\n\n            // Trade on SPX ITM calls\n            SpxOption = QuantConnect.Symbol.CreateOption(\n                Spx,\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3200m,\n                new DateTime(2021, 1, 15));\n\n            AddIndexOptionContract(SpxOption, Resolution);\n\n            _emaSlow = EMA(Spx, Resolution > Resolution.Minute ? 6 : 80);\n            _emaFast = EMA(Spx, Resolution > Resolution.Minute ? 2 : 200);\n\n            Settings.DailyPreciseEndTime = true;\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading underlying.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.Bars.ContainsKey(Spx) || !slice.Bars.ContainsKey(SpxOption))\n            {\n                return;\n            }\n\n            // Warm up indicators\n            if (!_emaSlow.IsReady)\n            {\n                return;\n            }\n\n            if (_emaFast > _emaSlow)\n            {\n                SetHoldings(SpxOption, 1);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// Asserts indicators are ready\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\"></exception>\n        protected void AssertIndicators()\n        {\n            if (!_emaSlow.IsReady || !_emaFast.IsReady)\n            {\n                throw new RegressionTestException(\"Indicators are not ready!\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio[Spx].TotalSaleVolume > 0)\n            {\n                throw new RegressionTestException(\"Index is not tradable.\");\n            }\n            AssertIndicators();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 16199;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"7.08%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"603.355%\"},\n            {\"Drawdown\", \"3.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1064395\"},\n            {\"Net Profit\", \"6.440%\"},\n            {\"Sharpe Ratio\", \"-4.563\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.781%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.169\"},\n            {\"Beta\", \"0.073\"},\n            {\"Annual Standard Deviation\", \"0.028\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-6.684\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"-1.771\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$3000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"23.97%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"4b560d2a8cfae510c3c8dc92603470fc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression for running an Index algorithm with Daily data\n    /// </summary>\n    public class BasicTemplateIndexDailyAlgorithm : BasicTemplateIndexAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n        protected override int StartDay => 1;\n\n        // two complete weeks starting from the 5th. The 18th bar is not included since it is a holiday\n        protected virtual int ExpectedBarCount => 2 * 5;\n        protected int BarCounter { get; set; }\n\n        /// <summary>\n        /// Purchase a contract when we are not invested, liquidate otherwise\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                // SPX Index is not tradable, but we can trade an option\n                MarketOrder(SpxOption, 1);\n            }\n            else\n            {\n                Liquidate();\n            }\n\n            // Count how many slices we receive with SPX data in it to assert later\n            if (slice.ContainsKey(Spx))\n            {\n                BarCounter++;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (BarCounter != ExpectedBarCount)\n            {\n                throw new ArgumentException($\"Bar Count {BarCounter} is not expected count of {ExpectedBarCount}\");\n            }\n            AssertIndicators();\n\n            if (Resolution != Resolution.Daily)\n            {\n                return;\n            }\n\n            var openInterest = Securities[SpxOption].Cache.GetAll<OpenInterest>();\n            if (openInterest.Single().EndTime != new DateTime(2021, 1, 15, 15, 15, 0))\n            {\n                throw new ArgumentException($\"Unexpected open interest time: {openInterest.Single().EndTime}\");\n            }\n\n            foreach (var symbol in new[] { SpxOption, Spx })\n            {\n                var history = History(symbol, 10).ToList();\n                if (history.Count != 10)\n                {\n                    throw new RegressionTestException($\"Unexpected history count: {history.Count}\");\n                }\n                if (history.Any(x => x.Time.TimeOfDay != new TimeSpan(8, 30, 0)))\n                {\n                    throw new RegressionTestException($\"Unexpected history data start time\");\n                }\n                if (history.Any(x => x.EndTime.TimeOfDay != new TimeSpan(15, 15, 0)))\n                {\n                    throw new RegressionTestException($\"Unexpected history data end time\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 122;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 30;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"11\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"653.545%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1084600\"},\n            {\"Net Profit\", \"8.460%\"},\n            {\"Sharpe Ratio\", \"9.923\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"93.682%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"3.61\"},\n            {\"Beta\", \"-0.513\"},\n            {\"Annual Standard Deviation\", \"0.359\"},\n            {\"Annual Variance\", \"0.129\"},\n            {\"Information Ratio\", \"8.836\"},\n            {\"Tracking Error\", \"0.392\"},\n            {\"Treynor Ratio\", \"-6.937\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"2.42%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ce421d0aeb7bde3bc92a6b87c09c510e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexHourlyAlgorithm.cs",
    "content": "using System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression for running an Index algorithm with Hourly data\n    /// </summary>\n    public class BasicTemplateIndexHourlyAlgorithm : BasicTemplateIndexDailyAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n        protected override int ExpectedBarCount => base.ExpectedBarCount * 8;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 401;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"81\"},\n            {\"Average Win\", \"1.28%\"},\n            {\"Average Loss\", \"-0.06%\"},\n            {\"Compounding Annual Return\", \"-20.546%\"},\n            {\"Drawdown\", \"1.800%\"},\n            {\"Expectancy\", \"-0.402\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"990775\"},\n            {\"Net Profit\", \"-0.922%\"},\n            {\"Sharpe Ratio\", \"-2.903\"},\n            {\"Sortino Ratio\", \"-6.081\"},\n            {\"Probabilistic Sharpe Ratio\", \"22.230%\"},\n            {\"Loss Rate\", \"97%\"},\n            {\"Win Rate\", \"3%\"},\n            {\"Profit-Loss Ratio\", \"19.95\"},\n            {\"Alpha\", \"-0.157\"},\n            {\"Beta\", \"0.025\"},\n            {\"Annual Standard Deviation\", \"0.053\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-2.07\"},\n            {\"Tracking Error\", \"0.121\"},\n            {\"Treynor Ratio\", \"-6.189\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$300000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"24.63%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7bc05310e971f09b0663bc380fdfee80\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexOptionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add index asset types and trade index options on SPX.\n    /// </summary>\n    public class BasicTemplateIndexOptionsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private ExponentialMovingAverage _emaSlow;\n        private ExponentialMovingAverage _emaFast;\n        protected virtual Resolution Resolution => Resolution.Minute;\n        protected virtual int StartDay => 4;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, StartDay);\n            SetEndDate(2021, 2, 1);\n            SetCash(1000000);\n\n            // Use indicator for signal; but it cannot be traded.\n            // We will instead trade on SPX options\n            _spx = AddIndex(\"SPX\", Resolution).Symbol;\n            var spxOptions = AddIndexOption(_spx, Resolution);\n            spxOptions.SetFilter(filterFunc => filterFunc.CallsOnly());\n\n            _emaSlow = EMA(_spx, Resolution > Resolution.Minute ? 6 : 80);\n            _emaFast = EMA(_spx, Resolution > Resolution.Minute ? 2 : 200);\n\n            Settings.DailyPreciseEndTime = true;\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading index options of the index.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.Bars.ContainsKey(_spx))\n            {\n                Debug($\"No SPX on {Time}\");\n                return;\n            }\n\n            // Warm up indicators\n            if (!_emaSlow.IsReady)\n            {\n                Debug($\"EMA slow not ready on {Time}\");\n                return;\n            }\n\n            foreach (var chain in slice.OptionChains.Values)\n            {\n                foreach (var contract in chain.Contracts.Values)\n                {\n                    if (contract.Expiry.Month == 3 && contract.Symbol.ID.StrikePrice == 3700m && contract.Right == OptionRight.Call && slice.QuoteBars.ContainsKey(contract.Symbol))\n                    {\n                        Log($\"{Time} {contract.Strike}{(contract.Right == OptionRight.Call ? 'C' : 'P')} -- {slice.QuoteBars[contract.Symbol]}\");\n                    }\n\n                    if (Portfolio.Invested)\n                    {\n                        continue;\n                    }\n\n                    if (_emaFast > _emaSlow && contract.Right == OptionRight.Call)\n                    {\n                        Liquidate(InvertOption(contract.Symbol));\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                    else if (_emaFast < _emaSlow && contract.Right == OptionRight.Put)\n                    {\n                        Liquidate(InvertOption(contract.Symbol));\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio[_spx].TotalSaleVolume > 0)\n            {\n                throw new RegressionTestException(\"Index is not tradable.\");\n            }\n            if (Portfolio.TotalSaleVolume == 0)\n            {\n                throw new RegressionTestException(\"Trade volume should be greater than zero by the end of this algorithm\");\n            }\n            AssertIndicators();\n        }\n\n        public Symbol InvertOption(Symbol symbol)\n        {\n            return QuantConnect.Symbol.CreateOption(\n                symbol.Underlying,\n                symbol.ID.Market,\n                symbol.ID.OptionStyle,\n                symbol.ID.OptionRight == OptionRight.Call ? OptionRight.Put : OptionRight.Call,\n                symbol.ID.StrikePrice,\n                symbol.ID.Date);\n        }\n\n        /// <summary>\n        /// Asserts indicators are ready\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\"></exception>\n        protected void AssertIndicators()\n        {\n            if (!_emaSlow.IsReady || !_emaFast.IsReady)\n            {\n                throw new RegressionTestException(\"Indicators are not ready!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8220\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-100.000%\"},\n            {\"Drawdown\", \"13.500%\"},\n            {\"Expectancy\", \"-0.818\"},\n            {\"Net Profit\", \"-13.517%\"},\n            {\"Sharpe Ratio\", \"-2.678\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"0.69\"},\n            {\"Alpha\", \"4.398\"},\n            {\"Beta\", \"-0.989\"},\n            {\"Annual Standard Deviation\", \"0.373\"},\n            {\"Annual Variance\", \"0.139\"},\n            {\"Information Ratio\", \"-12.816\"},\n            {\"Tracking Error\", \"0.504\"},\n            {\"Treynor Ratio\", \"1.011\"},\n            {\"Total Fees\", \"$15207.00\"},\n            {\"Estimated Strategy Capacity\", \"$8800000.00\"},\n            {\"Fitness Score\", \"0.033\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-8.62\"},\n            {\"Return Over Maximum Drawdown\", \"-7.81\"},\n            {\"Portfolio Turnover\", \"302.321\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"35b3f4b7a225468d42ca085386a2383e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexOptionsDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression for running an IndexOptions algorithm with Daily data\n    /// </summary>\n    public class BasicTemplateIndexOptionsDailyAlgorithm : BasicTemplateIndexOptionsAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n        protected override int StartDay => 1;\n        \n        /// <summary>\n        /// Index EMA Cross trading index options of the index.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            foreach (var chain in slice.OptionChains.Values)\n            {\n                // Select the contract with the lowest AskPrice\n                var contract = chain.Contracts.OrderBy(x => x.Value.AskPrice).FirstOrDefault().Value;\n\n                if (contract == null)\n                {\n                    return;\n                }\n                \n                if (Portfolio.Invested)\n                {\n                    Liquidate();\n                }\n                else\n                {\n                    MarketOrder(contract.Symbol, 1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 360;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"11\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-0.092%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999920\"},\n            {\"Net Profit\", \"-0.008%\"},\n            {\"Sharpe Ratio\", \"-19.865\"},\n            {\"Sortino Ratio\", \"-175397.15\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.013%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.454\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"-44.954\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P59H9OI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"34d295b82e29b1dbe8f104d3300d9255\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndexOptionsHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression for running an IndexOptions algorithm with Hourly data\n    /// </summary>\n    public class BasicTemplateIndexOptionsHourlyAlgorithm : BasicTemplateIndexOptionsDailyAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1269;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"81\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-0.006%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-0.486\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999995\"},\n            {\"Net Profit\", \"0.000%\"},\n            {\"Sharpe Ratio\", \"-101.77\"},\n            {\"Sortino Ratio\", \"-9053542.758\"},\n            {\"Probabilistic Sharpe Ratio\", \"17.439%\"},\n            {\"Loss Rate\", \"97%\"},\n            {\"Win Rate\", \"3%\"},\n            {\"Profit-Loss Ratio\", \"17.50\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"-0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.449\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"116.921\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P59H9OI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"214026660a13ecaecc7074fa97f86ea1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndiaAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template India algorithm simply initializes the date range and cash. This is a skeleton\n    /// framework you can use for designing an algorithm.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateIndiaAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"INR\");  //Set Account Currency\n            SetStartDate(2019, 1, 23);  //Set Start Date\n            SetEndDate(2019, 10, 31);   //Set End Date\n            SetCash(100000);            //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            AddEquity(\"YESBANK\", Resolution.Minute, Market.India);\n\n            //Set Order Properties as per the requirements for order placement\n            DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE);\n            //override default productType value set in config.json if needed - order specific productType value\n            //DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE, IndiaOrderProperties.IndiaProductType.CNC);\n\n            // General Debug statement for acknowledgement\n            Debug(\"Initialization Done\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var marketTicket = MarketOrder(\"YESBANK\", 1);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Purchased Complete: {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 29524;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.010%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99992.45\"},\n            {\"Net Profit\", \"-0.008%\"},\n            {\"Sharpe Ratio\", \"-497.389\"},\n            {\"Sortino Ratio\", \"-73.22\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.001%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.183\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₹6.00\"},\n            {\"Estimated Strategy Capacity\", \"₹61000000000.00\"},\n            {\"Lowest Capacity Asset\", \"YESBANK UL\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"06f782c83dd633dac6f228b91273ba26\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIndiaIndexAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add index asset types.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"indexes\" />\n    public class BasicTemplateIndiaIndexAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Symbol Nifty { get; set; }\n        protected Symbol NiftyETF { get; set; }\n        private ExponentialMovingAverage _emaSlow;\n        private ExponentialMovingAverage _emaFast;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"INR\"); //Set Account Currency\n            SetStartDate(2019, 1, 1);  //Set End Date\n            SetEndDate(2019, 1, 5);    //Set End Date\n            SetCash(1000000);          //Set Strategy Cash\n\n            // Use indicator for signal; but it cannot be traded\n            Nifty = AddIndex(\"NIFTY50\", Resolution.Minute, Market.India).Symbol;\n\n            //Trade Index based ETF\n            NiftyETF = AddEquity(\"JUNIORBEES\", Resolution.Minute, Market.India).Symbol;\n\n            //Set Order Properties as per the requirements for order placement\n            DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE);\n\n            _emaSlow = EMA(Nifty, 80);\n            _emaFast = EMA(Nifty, 200);\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading underlying.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.Bars.ContainsKey(Nifty) || !slice.Bars.ContainsKey(NiftyETF))\n            {\n                return;\n            }\n\n            // Warm up indicators\n            if (!_emaSlow.IsReady)\n            {\n                return;\n            }\n\n            if (_emaFast > _emaSlow)\n            {\n                if (!Portfolio.Invested)\n                {\n                    var marketTicket = MarketOrder(NiftyETF, 1);\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio[Nifty].TotalSaleVolume > 0)\n            {\n                throw new RegressionTestException(\"Index is not tradable.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2882;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-0.386%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999961.17\"},\n            {\"Net Profit\", \"-0.004%\"},\n            {\"Sharpe Ratio\", \"-328.371\"},\n            {\"Sortino Ratio\", \"-328.371\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-23.595\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₹36.00\"},\n            {\"Estimated Strategy Capacity\", \"₹84000.00\"},\n            {\"Lowest Capacity Asset\", \"JUNIORBEES UL\"},\n            {\"Portfolio Turnover\", \"0.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8790bec8175539e6d92e01608ac57733\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateIntrinioEconomicData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.Intrinio;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    ///     Basic template algorithm simply initializes the date range and cash. This is a skeleton\n    ///     framework you can use for designing an algorithm.\n    /// </summary>\n    /// <remarks>This regression test requires a valid Intrinio account</remarks>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateIntrinioEconomicData : QCAlgorithm\n    {\n        // Set your Intrinio user and password.\n        private string _user = string.Empty;\n        private string _password = string.Empty;\n\n        private Symbol _uso; // United States Oil Fund LP\n        private Symbol _bno; // United States Brent Oil Fund LP\n\n        private readonly Identity _brent = new Identity(\"Brent\");\n        private readonly Identity _wti = new Identity(\"WTI\");\n\n        private CompositeIndicator _spread;\n\n        private ExponentialMovingAverage _emaWti;\n\n        /// <summary>\n        ///     Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All\n        ///     algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(year: 2010, month: 01, day: 01); //Set Start Date\n            SetEndDate(year: 2013, month: 12, day: 31); //Set End Date\n            SetCash(startingCash: 100000); //Set Strategy Cash\n\n            // Set your Intrinio user and password.\n            IntrinioConfig.SetUserAndPassword(_user, _password);\n\n            // Set Intrinio config to make 1 call each minute, default is 1 call each 5 seconds.\n            // (1 call each minute is the free account limit for historical_data endpoint)\n            IntrinioConfig.SetTimeIntervalBetweenCalls(TimeSpan.FromMinutes(1));\n\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n            _uso = AddEquity(\"USO\", Resolution.Daily, leverage: 2m).Symbol;\n            _bno = AddEquity(\"BNO\", Resolution.Daily, leverage: 2m).Symbol;\n\n            AddData<IntrinioEconomicData>(IntrinioEconomicDataSources.Commodities.CrudeOilWTI, Resolution.Daily);\n            AddData<IntrinioEconomicData>(IntrinioEconomicDataSources.Commodities.CrudeOilBrent, Resolution.Daily);\n            _spread = _brent.Minus(_wti);\n\n            _emaWti = EMA(Securities[IntrinioEconomicDataSources.Commodities.CrudeOilWTI].Symbol, 10);\n        }\n\n        /// <summary>\n        ///     OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var customData = slice.Get<IntrinioEconomicData>();\n            if (customData.Count == 0) return;\n\n            foreach (var economicData in customData.Values)\n            {\n                if (economicData.Symbol.Value == IntrinioEconomicDataSources.Commodities.CrudeOilWTI)\n                {\n                    _wti.Update(economicData.Time, economicData.Price);\n                }\n                else\n                {\n                    _brent.Update(economicData.Time, economicData.Price);\n                }\n            }\n\n            if (_spread > 0 && !Portfolio[_bno].IsLong ||\n                _spread < 0 && !Portfolio[_uso].IsShort)\n            {\n                var logText = _spread > 0 ?\n                    new[] {\"higher\", \"long\", \"short\"} :\n                    new[] {\"lower\", \"short\", \"long\"};\n\n                Log($\"Brent Price is {logText[0]} than West Texas. Go {logText[1]} BNO and {logText[2]} USO. West Texas EMA: {_emaWti}\");\n                SetHoldings(_bno, 0.25 * Math.Sign(_spread));\n                SetHoldings(_uso, -0.25 * Math.Sign(_spread));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"91\"},\n            {\"Average Win\", \"0.09%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"5.732%\"},\n            {\"Drawdown\", \"4.800%\"},\n            {\"Expectancy\", \"1.846\"},\n            {\"Net Profit\", \"24.996%\"},\n            {\"Sharpe Ratio\", \"1.142\"},\n            {\"Loss Rate\", \"68%\"},\n            {\"Win Rate\", \"32%\"},\n            {\"Profit-Loss Ratio\", \"7.97\"},\n            {\"Alpha\", \"0.076\"},\n            {\"Beta\", \"-1.101\"},\n            {\"Annual Standard Deviation\", \"0.048\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"0.741\"},\n            {\"Tracking Error\", \"0.048\"},\n            {\"Treynor Ratio\", \"-0.05\"},\n            {\"Total Fees\", \"$102.64\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateLibrary.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Basic Template Library Class\n    /// Library classes are snippets of code you can reuse between projects. They are added to projects on compile. This can be useful for reusing\n    /// indicators, math components, risk modules etc. If you use a custom namespace make sure you add the correct using statement to the\n    /// algorithm-user.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    public class BasicTemplateLibrary\n    {\n        /*\n         * To use this library; add its namespace at the top of the page:\n         * using QuantConnect\n         *\n         * Then instantiate the class:\n         * var btl = new BasicTemplateLibrary();\n         * btl.Add(1,2)\n         */\n\n        public int Add(int a, int b)\n        {\n            return a + b;\n        }\n\n        public int Subtract(int a, int b)\n        {\n            return a - b;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to create a multi asset class trading strategy.\n    /// It is designed for test purposes and can be used with paper brokerage. All asset classes are not\n    /// necessarily supported by some brokers. See our website for details.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    /// <meta name=\"tag\" content=\"equity\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    public class BasicTemplateMultiAssetAlgorithm : QCAlgorithm\n    {\n        private int _barCount = 0;\n        private Symbol _equitySymbol;\n        private Symbol _forexSymbol;\n        private Symbol _futureSymbol;\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2016, 01, 28);\n            SetEndDate(2016, 02, 29);\n            SetCash(1000000);\n\n            // setting up Microsoft Equity\n            _equitySymbol = AddEquity(\"MSFT\").Symbol;\n\n            // setting up EUR/USD FX spot pair\n            _forexSymbol = AddForex(\"EURUSD\").Symbol;\n\n            // setting up S&P 500 EMini futures\n            var futureSP500 = AddFuture(Futures.Indices.SP500EMini);\n            _futureSymbol = futureSP500.Symbol;\n\n            // set our expiry filter for this futures chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            futureSP500.SetFilter(10, 182);\n            // futureSP500.SetFilter(TimeSpan.FromDays(10), TimeSpan.FromDays(182));\n\n            // setting up Dow Jones ETF Options\n            var option = AddOption(\"DIA\");\n            _optionSymbol = option.Symbol;\n\n            option.PriceModel = OptionPriceModels.BinomialCoxRossRubinstein();\n            // option.EnableGreekApproximation = true;\n            // set our strike/expiry filter for this option chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            option.SetFilter(-2, +2, 0, 180);\n            // option.SetFilter(-2, +2, TimeSpan.Zero, TimeSpan.FromDays(180));\n\n            // specifying zero benchmark\n            SetBenchmark(date => 0m);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            _barCount++;\n\n            if (_barCount % 20 == 0)\n            {\n                if (!Portfolio.Invested)\n                {\n                    foreach (var chain in slice.FutureChains)\n                    {\n                        // find the front contract expiring no earlier than in 90 days\n                        var contract = (\n                            from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                            where futuresContract.Expiry > Time.Date.AddDays(90)\n                            select futuresContract\n                            ).FirstOrDefault();\n\n                        // if found, trade it\n                        if (contract != null)\n                        {\n                            MarketOrder(contract.Symbol, 1);\n                        }\n                    }\n\n                    OptionChain optionChain;\n                    if (slice.OptionChains.TryGetValue(_optionSymbol, out optionChain))\n                    {\n                        // find a farthest ATM contract\n                        var contract = optionChain\n                            .OrderBy(x => Math.Abs(optionChain.Underlying.Price - x.Strike))\n                            .ThenByDescending(x => x.Expiry)\n                            .FirstOrDefault();\n\n                        // if found, trade it\n                        if (contract != null)\n                        {\n                            MarketOrder(contract.Symbol, 1);\n                        }\n                    }\n\n                    // trade MSFT\n                    MarketOrder(_equitySymbol, 100);\n\n                    // trade FX pair\n                    MarketOrder(_forexSymbol, 100000);\n                }\n                else\n                {\n                    Liquidate();\n                }\n            }\n\n            if (_barCount % 20 == 1)\n            {\n                Log($\"P/L:{Portfolio.TotalUnrealisedProfit.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Fees:{Portfolio.TotalFees.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Profit:{Portfolio.TotalProfit.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Eq:{Portfolio.TotalPortfolioValue.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Holdings:{Portfolio.TotalHoldingsValue.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Vol: {Portfolio.TotalSaleVolume.ToStringInvariant(\"0.00\")}, \" +\n                    $\"Margin: {Portfolio.TotalMarginUsed.ToStringInvariant(\"0.00\")}\"\n                );\n\n                foreach (var holding in Securities.Values.OrderByDescending(x => x.Holdings.AbsoluteQuantity))\n                {\n                    Log($\" - {holding.Symbol.Value}, \" +\n                        $\"Avg Prc:{holding.Holdings.AveragePrice.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Qty:{holding.Holdings.Quantity.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Mkt Prc:{holding.Holdings.Price.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Mkt Val:{holding.Holdings.HoldingsValue.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Unreal P/L: {holding.Holdings.UnrealizedProfit.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Fees: {holding.Holdings.TotalFees.ToStringInvariant(\"0.00\")}, \" +\n                        $\"Vol: {holding.Holdings.TotalSaleVolume.ToStringInvariant(\"0.00\")}\"\n                    );\n                }\n            }\n\n            if (_barCount % 20 == 2)\n            {\n                foreach (var chain in slice.OptionChains)\n                {\n                    var underlying = Securities[chain.Key.Underlying];\n                    foreach (var contract in chain.Value)\n                    {\n                        Log($\"{Time.ToStringInvariant()} {contract.Symbol.Value},\" +\n                            $\"B={contract.BidPrice.ToStringInvariant()} \" +\n                            $\"A={contract.AskPrice.ToStringInvariant()} \" +\n                            $\"L={contract.LastPrice.ToStringInvariant()} \" +\n                            $\"OI={contract.OpenInterest.ToStringInvariant()} \" +\n                            $\"σ={underlying.VolatilityModel.Volatility:0.00} \" +\n                            $\"NPV={contract.TheoreticalPrice.ToStringInvariant(\"0.00\")} \" +\n                            $\"Δ={contract.Greeks.Delta.ToStringInvariant(\"0.00\")} \" +\n                            $\"Γ={contract.Greeks.Gamma.ToStringInvariant(\"0.00\")} \" +\n                            $\"ν={contract.Greeks.Vega.ToStringInvariant(\"0.00\")} \" +\n                            $\"ρ={contract.Greeks.Rho.ToStringInvariant(\"0.00\")} \" +\n                            $\"Θ={(contract.Greeks.Theta / 365.0m).ToStringInvariant(\"0.00\")} \" +\n                            $\"IV={contract.ImpliedVolatility.ToStringInvariant(\"0.00\")}\"\n                        );\n                    }\n                }\n\n                foreach (var chain in slice.FutureChains)\n                {\n                    foreach (var contract in chain.Value)\n                    {\n                        Log($\"{contract.Symbol.Value}, {Time}, \" +\n                            $\"B={contract.BidPrice} \" +\n                            $\"A={contract.AskPrice} \" +\n                            $\"L={contract.LastPrice} \" +\n                            $\"OI={contract.OpenInterest}\"\n                        );\n                    }\n                }\n            }\n\n            foreach (var kpv in slice.QuoteBars)\n            {\n                Log($\"---> QuoteBar: {Time}, {kpv.Key.Value}, {kpv.Value.Close:0.0000}\");\n            }\n\n            foreach (var kpv in slice.Bars)\n            {\n                Log($\"---> Bar: {Time}, {kpv.Key.Value}, {kpv.Value.Close.ToStringInvariant(\"0.0000\")}\");\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm trading a Call Butterfly option equity strategy\n    /// </summary>\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class BasicTemplateOptionEquityStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                // Expiration method accepts TimeSpan objects or integer for days.\n                // The following statements yield the same filtering criteria\n                .Expiration(0, 180));\n        }\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var expiry = callContracts[0].Expiry;\n                    var lowerStrike = callContracts[0].Strike;\n                    var middleStrike = callContracts[1].Strike;\n                    var higherStrike = callContracts[2].Strike;\n\n                    var optionStrategy = OptionStrategies.CallButterfly(_optionSymbol, higherStrike, middleStrike, lowerStrike, expiry);\n\n                    Order(optionStrategy, 10);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98024\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$69000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"61.31%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ccd6cb1b6244d0c6d30b2760938958f1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use Option Strategies (e.g. OptionStrategies.Straddle) helper classes to batch send orders for common strategies.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations, and how you can inspect the\n    /// option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"option strategies\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class BasicTemplateOptionStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(1000000);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            option.SetFilter(u => u.StandardsOnly()\n                                   .Strikes(-2, +2)\n                                   .Expiration(0, 180));\n\n            // Adding this to reproduce GH issue #2314\n            SetWarmup(TimeSpan.FromMinutes(1));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"GOOG\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var atmStraddle = chain\n                        .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Expiry)\n                        .FirstOrDefault();\n\n                    if (atmStraddle != null)\n                    {\n                        Sell(OptionStrategies.Straddle(_optionSymbol, atmStraddle.Strike, atmStraddle.Expiry), 2);\n                    }\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n\n            foreach (var kpv in slice.Bars)\n            {\n                Log($\"---> OnData: {Time}, {kpv.Key.Value}, {kpv.Value.Close:0.00}\");\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15130;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"420\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"952636.6\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$543.40\"},\n            {\"Estimated Strategy Capacity\", \"$4000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMEBFLDY|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"338.60%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8229716b93428dc885cf856b4cc9fc35\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations.\n    /// It also shows how you can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    public class BasicTemplateOptionTradesAlgorithm : QCAlgorithm\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(10000);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yields the same filtering criteria\n            option.SetFilter(-2, +2, 0, 10);\n            // option.SetFilter(-2, +2, TimeSpan.Zero, TimeSpan.FromDays(10));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"GOOG\");\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // find the second call strike under market price expiring today\n                    var contract = chain\n                        .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Expiry)\n                        .FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n\n            foreach (var kpv in slice.Bars)\n            {\n                Log($\"---> OnData: {Time}, {kpv.Key.Value}, {kpv.Value.Close:0:00}\");\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n    /// can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class BasicTemplateOptionsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                                   // Expiration method accepts TimeSpan objects or integer for days.\n                                   // The following statements yield the same filtering criteria\n                                   .Expiration(0, 180)); // .Expiration(TimeSpan.Zero, TimeSpan.FromDays(180)));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Right)\n                        .FirstOrDefault();\n\n                    if (atmContract != null)\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15012;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99718\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"10.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"19ba1220073493495880581b38df2da9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsConsolidationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// A demonstration of consolidating options data into larger bars for your algorithm.\n    /// </summary>\n    public class BasicTemplateOptionsConsolidationAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, IDataConsolidator> _consolidators = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(1000000);\n\n            var option = AddOption(\"SPY\");\n            option.SetFilter(-2, 2, 0, 189);\n        }\n\n        public void OnQuoteBarConsolidated(object sender, QuoteBar quoteBar)\n        {\n            Log($\"OnQuoteBarConsolidated called on {Time}\");\n            Log(quoteBar.ToString());\n        }\n\n        public void OnTradeBarConsolidated(object sender, TradeBar tradeBar)\n        {\n            Log($\"OnTradeBarConsolidated called on {Time}\");\n            Log(tradeBar.ToString());\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach(var security in changes.AddedSecurities)\n            {\n                IDataConsolidator consolidator;\n                if (security.Type == SecurityType.Equity)\n                {\n                    consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(5));\n                    (consolidator as TradeBarConsolidator).DataConsolidated += OnTradeBarConsolidated;\n                }\n                else\n                {\n                    consolidator = new QuoteBarConsolidator(new TimeSpan(0, 5, 0));\n                    (consolidator as QuoteBarConsolidator).DataConsolidated += OnQuoteBarConsolidated;\n                }\n\n                SubscriptionManager.AddConsolidator(security.Symbol, consolidator);\n                _consolidators[security.Symbol] = consolidator;\n            }\n\n            foreach(var security in changes.RemovedSecurities)\n            {\n                _consolidators.Remove(security.Symbol, out var consolidator);\n                SubscriptionManager.RemoveConsolidator(security.Symbol, consolidator);\n\n                if (security.Type == SecurityType.Equity)\n                {\n                    (consolidator as TradeBarConsolidator).DataConsolidated -= OnTradeBarConsolidated;\n                }\n                else\n                {\n                    (consolidator as QuoteBarConsolidator).DataConsolidated -= OnQuoteBarConsolidated;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsDailyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n    /// can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class BasicTemplateOptionsDailyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"AAPL\";\n        private Symbol _optionSymbol;\n        private bool _optionExpired;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 15);\n            SetEndDate(2016, 2, 1);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker, Resolution.Daily);\n            var option = AddOption(UnderlyingTicker, Resolution.Daily);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(x => x.CallsOnly().Expiration(0, 60));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // Grab us the contract nearest expiry that is not today\n                    var contractsByExpiration = chain.Where(x => x.Expiry != Time.Date).OrderBy(x => x.Expiry);\n                    var contract = contractsByExpiration.FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        // if found, trade it\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n\n            // Check for our expected OTM option expiry\n            if (orderEvent.Message.Contains(\"OTM\", StringComparison.InvariantCulture))\n            {\n                // Assert it is at midnight (5AM UTC)\n                if (orderEvent.UtcTime != new DateTime(2016, 1, 16, 5, 0, 0))\n                {\n                    throw new ArgumentException($\"Expiry event was not at the correct time, {orderEvent.UtcTime}\");\n                }\n\n                _optionExpired = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Assert we had our option expire and fill a liquidation order\n            if (_optionExpired != true)\n            {\n                throw new ArgumentException(\"Algorithm did not process the option expiration like expected\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 308;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.16%\"},\n            {\"Compounding Annual Return\", \"-8.351%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98844\"},\n            {\"Net Profit\", \"-1.156%\"},\n            {\"Sharpe Ratio\", \"-4.04\"},\n            {\"Sortino Ratio\", \"-2.422\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.099%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.058\"},\n            {\"Beta\", \"0.021\"},\n            {\"Annual Standard Deviation\", \"0.017\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.49\"},\n            {\"Tracking Error\", \"0.289\"},\n            {\"Treynor Ratio\", \"-3.212\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$72000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL W78ZEO29CFS6|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5639c19a7d56ec312f61029b943903b8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsFilterUniverseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations.\n    /// It also shows how you can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class BasicTemplateOptionsFilterUniverseAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            // Set our custom universe filter, Expires today, is a call, and is within 10 dollars of the current price\n            option.SetFilter(universe => from symbol in universe.WeeklysOnly().Expiration(0, 1)\n                                         where symbol.ID.OptionRight != OptionRight.Put &&\n                                              -10 < universe.Underlying.Price - symbol.ID.StrikePrice &&\n                                              universe.Underlying.Price - symbol.ID.StrikePrice < 10\n                                         select symbol);\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // Get the first ITM call expiring today\n                    var contract = (\n                        from optionContract in chain.OrderByDescending(x => x.Strike)\n                        where optionContract.Expiry == Time.Date\n                        where optionContract.Strike < chain.Underlying.Price\n                        select optionContract\n                        ).FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 12290;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.40%\"},\n            {\"Compounding Annual Return\", \"-20.338%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99689\"},\n            {\"Net Profit\", \"-0.311%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"15.08%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c53bc9318676161ed3b7797c945e2113\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template options framework algorithm uses framework components to define an algorithm\n    /// that trades options.\n    /// </summary>\n    public class BasicTemplateOptionsFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n            SetCash(100000);\n\n            // set framework models\n            SetUniverseSelection(new EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel(SelectOptionChainSymbols));\n            SetAlpha(new ConstantOptionContractAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromHours(0.5)));\n            SetPortfolioConstruction(new SingleSharePortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        // option symbol universe selection function\n        private static IEnumerable<Symbol> SelectOptionChainSymbols(DateTime utcTime)\n        {\n            var newYorkTime = utcTime.ConvertFromUtc(TimeZones.NewYork);\n            if (newYorkTime.Date < new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"TWX\", SecurityType.Option, Market.USA, \"?TWX\");\n            }\n\n            if (newYorkTime.Date >= new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA, \"?AAPL\");\n            }\n        }\n\n        /// <summary>\n        /// Creates option chain universes that select only the earliest expiry ATM weekly put contract\n        /// and runs a user defined optionChainSymbolSelector every day to enable choosing different option chains\n        /// </summary>\n        class EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel : OptionUniverseSelectionModel\n        {\n            public EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel(Func<DateTime, IEnumerable<Symbol>> optionChainSymbolSelector)\n                : base(TimeSpan.FromDays(1), optionChainSymbolSelector)\n            {\n            }\n\n            /// <summary>\n            /// Defines the option chain universe filter\n            /// </summary>\n            protected override OptionFilterUniverse Filter(OptionFilterUniverse filter)\n            {\n                return filter\n                    .Strikes(+1, +1)\n                    // Expiration method accepts TimeSpan objects or integer for days.\n                    // The following statements yield the same filtering criteria\n                    .Expiration(0, 7)\n                    //.Expiration(TimeSpan.Zero, TimeSpan.FromDays(7))\n                    .WeeklysOnly()\n                    .PutsOnly()\n                    .OnlyApplyFilterAtMarketOpen();\n            }\n        }\n\n        /// <summary>\n        /// Implementation of a constant alpha model that only emits insights for option symbols\n        /// </summary>\n        class ConstantOptionContractAlphaModel : ConstantAlphaModel\n        {\n            public ConstantOptionContractAlphaModel(InsightType type, InsightDirection direction, TimeSpan period)\n                : base(type, direction, period)\n            {\n            }\n\n            protected override bool ShouldEmitInsight(DateTime utcTime, Symbol symbol)\n            {\n                // only emit alpha for option symbols and not underlying equity symbols\n                if (symbol.SecurityType != SecurityType.Option)\n                {\n                    return false;\n                }\n\n                return base.ShouldEmitInsight(utcTime, symbol);\n            }\n        }\n\n        /// <summary>\n        /// Portfolio construction model that sets target quantities to 1 for up insights and -1 for down insights\n        /// </summary>\n        class SingleSharePortfolioConstructionModel : PortfolioConstructionModel\n        {\n            public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                foreach (var insight in insights)\n                {\n                    yield return new PortfolioTarget(insight.Symbol, (int) insight.Direction);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17487;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0.13%\"},\n            {\"Average Loss\", \"-0.30%\"},\n            {\"Compounding Annual Return\", \"-46.395%\"},\n            {\"Drawdown\", \"1.600%\"},\n            {\"Expectancy\", \"0.429\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99149.50\"},\n            {\"Net Profit\", \"-0.850%\"},\n            {\"Sharpe Ratio\", \"-4.298\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"15.319%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0.43\"},\n            {\"Alpha\", \"-0.84\"},\n            {\"Beta\", \"0.986\"},\n            {\"Annual Standard Deviation\", \"0.098\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-9.299\"},\n            {\"Tracking Error\", \"0.091\"},\n            {\"Treynor Ratio\", \"-0.428\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"13.50%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"2ab4ffc0944a2888a3be0568c2570a79\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example demonstrating how to access to options history for a given underlying equity security.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    public class BasicTemplateOptionsHistoryAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            // this test opens position in the first day of trading, lives through stock split (7 for 1), and closes adjusted position on the second day\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(1000000);\n\n            var option = AddOption(\"GOOG\");\n            // add the initial contract filter\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            option.SetFilter(-2, +2, 0, 180);\n            // option.SetFilter(-2, +2, TimeSpan.Zero, TimeSpan.FromDays(180));\n\n            // set the pricing model for Greeks and volatility\n            // find more pricing models https://www.quantconnect.com/lean/documentation/topic27704.html\n            option.PriceModel = OptionPriceModels.BlackScholes();\n            // set the warm-up period for the pricing model\n            SetWarmup(TimeSpan.FromDays(4));\n            // set the benchmark to be the initial cash\n            SetBenchmark(d => 1000000);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n            if (!Portfolio.Invested)\n            {\n                foreach (var chain in slice.OptionChains)\n                {\n                    var underlying = Securities[chain.Key.Underlying];\n                    foreach (var contract in chain.Value)\n                    {\n                        Log($\"{contract.Symbol.Value},\" +\n                            $\"Bid={contract.BidPrice.ToStringInvariant()} \" +\n                            $\"Ask={contract.AskPrice.ToStringInvariant()} \" +\n                            $\"Last={contract.LastPrice.ToStringInvariant()} \" +\n                            $\"OI={contract.OpenInterest.ToStringInvariant()} \" +\n                            $\"σ={underlying.VolatilityModel.Volatility.ToStringInvariant(\"0.000\")} \" +\n                            $\"NPV={contract.TheoreticalPrice.ToStringInvariant(\"0.000\")} \" +\n                            $\"Δ={contract.Greeks.Delta.ToStringInvariant(\"0.000\")} \" +\n                            $\"Γ={contract.Greeks.Gamma.ToStringInvariant(\"0.000\")} \" +\n                            $\"ν={contract.Greeks.Vega.ToStringInvariant(\"0.000\")} \" +\n                            $\"ρ={contract.Greeks.Rho.ToStringInvariant(\"0.00\")} \" +\n                            $\"Θ={(contract.Greeks.Theta / 365.0m).ToStringInvariant(\"0.00\")} \" +\n                            $\"IV={contract.ImpliedVolatility.ToStringInvariant(\"0.000\")}\"\n                        );\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var change in changes.AddedSecurities)\n            {\n                // Only print options price\n                if (change.Symbol.Value == \"GOOG\") continue;\n                var history = History(change.Symbol, 10, Resolution.Minute);\n\n                foreach (var data in history.OrderByDescending(x => x.Time).Take(3))\n                {\n                    Log($\"History: {data.Symbol.Value}: {data.Time} > {data.Close}\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateOptionsHourlyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security.\n    /// It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n    /// can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class BasicTemplateOptionsHourlyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"AAPL\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 9);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker, Resolution.Hour);\n            var option = AddOption(UnderlyingTicker, Resolution.Hour);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                                   // Expiration method accepts TimeSpan objects or integer for days.\n                                   // The following statements yield the same filtering criteria\n                                   .Expiration(0, 180));\n            // .Expiration(TimeSpan.Zero, TimeSpan.FromDays(180)));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Right)\n                        .FirstOrDefault();\n\n                    if (atmContract != null && IsMarketOpen(atmContract.Symbol))\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 9504;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.07%\"},\n            {\"Compounding Annual Return\", \"-11.517%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99866\"},\n            {\"Net Profit\", \"-0.134%\"},\n            {\"Sharpe Ratio\", \"-9.78\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.075\"},\n            {\"Beta\", \"-0.054\"},\n            {\"Annual Standard Deviation\", \"0.008\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-18.699\"},\n            {\"Tracking Error\", \"0.155\"},\n            {\"Treynor Ratio\", \"1.434\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$1000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL 2ZTXYMUAHGSME|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.28%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"70bbc60c969f18e943e8e00cf0f7a0ea\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add and trade SPX index weekly options\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"indexes\" />\n    public class BasicTemplateSPXWeeklyIndexOptionsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spxOption;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 10);\n            SetCash(1000000);\n\n            // regular option SPX contracts\n            var spxOptions = AddIndexOption(\"SPX\");\n            spxOptions.SetFilter(u => u.Strikes(0, 1).Expiration(0, 30));\n\n            // weekly option SPX contracts\n            var spxw = AddIndexOption(\"SPX\", \"SPXW\");\n            spxw.SetFilter(u => u.Strikes(0, 1)\n                 // single week ahead since there are many SPXW contracts and we want to preserve performance\n                 .Expiration(0, 7)\n                 .IncludeWeeklys());\n\n            _spxOption = spxw.Symbol;\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading underlying.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            OptionChain chain;\n            if (slice.OptionChains.TryGetValue(_spxOption, out chain))\n            {\n                // we find at the money (ATM) put contract with closest expiration\n                var atmContract = chain\n                    .OrderBy(x => x.Expiry)\n                    .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                    .ThenByDescending(x => x.Right)\n                    .FirstOrDefault();\n\n                if (atmContract != null)\n                {\n                    // if found, buy until it expires\n                    MarketOrder(atmContract.Symbol, 1);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 21467;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0.63%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"54.478%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"23.219\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1006025\"},\n            {\"Net Profit\", \"0.602%\"},\n            {\"Sharpe Ratio\", \"2.62\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"63.221%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"23.22\"},\n            {\"Alpha\", \"0.067\"},\n            {\"Beta\", \"-0.013\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-50.808\"},\n            {\"Tracking Error\", \"0.086\"},\n            {\"Treynor Ratio\", \"-0.725\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$580000.00\"},\n            {\"Lowest Capacity Asset\", \"SPXW 31K54PVWHYTTA|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.40%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"03148bbb5453fc1056a3285bd31ce158\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add and trade SPX index weekly option strategy\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"indexes\" />\n    public class BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spxOption;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 10);\n            SetCash(1000000);\n\n            var spx = AddIndex(\"SPX\").Symbol;\n\n            // weekly option SPX contracts\n            var spxw = AddIndexOption(spx, \"SPXW\");\n            spxw.SetFilter(u => u.Strikes(-1, +1)\n                 // single week ahead since there are many SPXW contracts and we want to preserve performance\n                 .Expiration(0, 7)\n                 .IncludeWeeklys());\n\n            _spxOption = spxw.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            OptionChain chain;\n            if (slice.OptionChains.TryGetValue(_spxOption, out chain))\n            {\n                // we find the first expiration group of call options and order them in ascending strike\n                var contracts = chain\n                    .Where(x => x.Right == OptionRight.Call)\n                    .OrderBy(x => x.Expiry)\n                    .GroupBy(x => x.Expiry)\n                    .First()\n                    .OrderBy(x => x.Strike)\n                    .ToList();\n\n                if (contracts.Count > 1)\n                {\n                    var smallerStrike = contracts[0];\n                    var higherStrike = contracts[1];\n\n                    // if found, buy until it expires\n                    var optionStrategy = OptionStrategies.BearCallSpread(_spxOption, smallerStrike.Strike, higherStrike.Strike, smallerStrike.Expiry);\n                    Buy(optionStrategy, 1);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(orderEvent.ToString());\n            if (orderEvent.Symbol.ID.Symbol != \"SPXW\")\n            {\n                throw new RegressionTestException(\"Unexpected order event symbol!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 16680;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"10\"},\n            {\"Average Win\", \"0.46%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"101.998%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"24.137\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1009050\"},\n            {\"Net Profit\", \"0.905%\"},\n            {\"Sharpe Ratio\", \"8.44\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.546%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"49.27\"},\n            {\"Alpha\", \"-2.01\"},\n            {\"Beta\", \"0.307\"},\n            {\"Annual Standard Deviation\", \"0.021\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-144.654\"},\n            {\"Tracking Error\", \"0.048\"},\n            {\"Treynor Ratio\", \"0.589\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$13000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPXW XKX6S2GMDZSE|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.28%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"9d03f85003416861df07ccb31a18af9a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BasicTemplateTradableIndexAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add index asset types and change the tradable condition\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    /// <meta name=\"tag\" content=\"indexes\" />\n    public class BasicTemplateTradableIndexAlgorithm : BasicTemplateIndexAlgorithm\n    {\n        private OrderTicket _ticket;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n            Securities[Spx].IsTradable = true;\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading underlying.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            base.OnData(slice);\n            _ticket ??= MarketOrder(Spx, 1);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_ticket.Status.IsFill())\n            {\n                throw new RegressionTestException(\"Index is tradable.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"7.08%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"602.278%\"},\n            {\"Drawdown\", \"3.400%\"},\n            {\"Expectancy\", \"677.669\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1064342.82\"},\n            {\"Net Profit\", \"6.434%\"},\n            {\"Sharpe Ratio\", \"-4.563\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.781%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1356.34\"},\n            {\"Alpha\", \"-0.169\"},\n            {\"Beta\", \"0.073\"},\n            {\"Annual Standard Deviation\", \"0.028\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-6.684\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"-1.771\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$3000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"24.03%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"691cf4990024b856a0a70255c9fd2545\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/BasicTemplateBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Benchmark Algorithm: The minimalist basic template algorithm benchmark strategy.\n    /// </summary>\n    /// <remarks>\n    /// All new projects in the cloud are created with the basic template algorithm. It uses a minute algorithm\n    /// over a long period of time to establish a baseline.\n    /// </remarks>\n    public class BasicTemplateBenchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2000, 01, 01);\n            SetEndDate(2022, 01, 01);\n            SetBenchmark(dt => 1m);\n            AddEquity(\"SPY\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/CoarseFineUniverseSelectionBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n\n    public class CoarseFineUniverseSelectionBenchmark : QCAlgorithm\n    {\n        private const int NumberOfSymbolsCoarse = 150;\n        private const int NumberOfSymbolsFine = 40;\n\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2017, 11, 01);\n            SetEndDate(2018, 3, 01);\n            SetCash(50000);\n\n            AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbolsCoarse'\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // select only symbols with fundamental data and sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse\n                .Where(x => x.HasFundamentalData)\n                .OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top5 = sortedByDollarVolume.Take(NumberOfSymbolsCoarse);\n\n            // we need to return only the symbol objects\n            return top5.Select(x => x.Symbol);\n        }\n\n        // sort the data by P/E ratio and take the top 'NumberOfSymbolsFine'\n        public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            // sort descending by P/E ratio\n            var sortedByPeRatio = fine.OrderByDescending(x => x.ValuationRatios.PERatio);\n\n            // take the top entries from our sorted collection\n            var topFine = sortedByPeRatio.Take(NumberOfSymbolsFine);\n\n            // we need to return only the symbol objects\n            return topFine.Select(x => x.Symbol);\n        }\n\n        //Data Event Handler: New data arrives here.\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.02m);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/EmptyEquityAndOptions400Benchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Benchmark Algorithm: Loading and synchronization of 500 equity minute symbols and their options.\n    /// </summary>\n    public class EmptyEquityAndOptions400Benchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2022, 5, 11);\n            SetEndDate(2022, 5, 12);\n\n            var equity_symbols = new[] {\n\n\"MARK\", \"TSN\", \"DT\", \"RDW\", \"CVE\", \"NXPI\", \"FIVN\", \"CLX\", \"SPXL\", \"BKSY\", \"NUGT\", \"CF\", \"NEGG\",\n\"RH\", \"SIRI\", \"ITUB\", \"CSX\", \"AUR\", \"LIDR\", \"CMPS\", \"DHI\", \"GLW\", \"NTES\", \"CIFR\", \"S\", \"HSBC\",\n\"HIPO\", \"WTRH\", \"AMRN\", \"BIIB\", \"RIO\", \"EDIT\", \"TEAM\", \"CNK\", \"BUD\", \"MILE\", \"AEHR\", \"DOCN\",\n\"CLSK\", \"BROS\", \"MLCO\", \"SBLK\", \"ICLN\", \"OPK\", \"CNC\", \"SKX\", \"SESN\", \"VRM\", \"ASML\", \"BBAI\",\n\"HON\", \"MRIN\", \"BLMN\", \"NTNX\", \"POWW\", \"FOUR\", \"HOG\", \"GOGO\", \"MGNI\", \"GENI\", \"XPDI\",\n\"DG\", \"PSX\", \"RRC\", \"CORT\", \"MET\", \"UMC\", \"INMD\", \"RBAC\", \"ISRG\", \"BOX\", \"DVAX\", \"CRVS\", \"HLT\",\n\"BKNG\", \"BENE\", \"CLVS\", \"ESSC\", \"PTRA\", \"BE\", \"FPAC\", \"YETI\", \"DOCS\", \"DB\", \"EBON\", \"RDS.B\",\n\"ERIC\", \"BSIG\", \"INTU\", \"MNTS\", \"BCTX\", \"BLU\", \"FIS\", \"MAC\", \"WMB\", \"TTWO\", \"ARDX\", \"SWBI\",\n\"ELY\", \"INDA\", \"REAL\", \"ACI\", \"APRN\", \"BHP\", \"CPB\", \"SLQT\", \"ARKF\", \"TSP\", \"OKE\", \"NVTA\", \"META\",\n\"CSTM\", \"KMX\", \"IBB\", \"AGEN\", \"WOOF\", \"MJ\", \"HYZN\", \"RSI\", \"JCI\", \"EXC\", \"HPE\", \"SI\", \"WPM\",\n\"PRTY\", \"BBD\", \"FVRR\", \"CANO\", \"INDI\", \"MDLZ\", \"KOLD\", \"AMBA\", \"SOXS\", \"RSX\", \"ZEN\", \"PUBM\",\n\"VLDR\", \"CI\", \"ISEE\", \"GEO\", \"BKR\", \"DHR\", \"GRPN\", \"NRXP\", \"ACN\", \"MAT\", \"BODY\", \"ENDP\",\n\"SHPW\", \"AVIR\", \"GPN\", \"BILL\", \"BZ\", \"CERN\", \"ARVL\", \"DNMR\", \"NTR\", \"FSM\", \"BMBL\", \"PAAS\",\n\"INVZ\", \"ANF\", \"CL\", \"XP\", \"CS\", \"KD\", \"WW\", \"AHT\", \"GRTX\", \"XLC\", \"BLDP\", \"HTA\", \"APT\", \"BYSI\",\n\"ENB\", \"TRIT\", \"VTNR\", \"AVCT\", \"SLI\", \"CP\", \"CAH\", \"ALLY\", \"FIGS\", \"PXD\", \"TPX\", \"ZI\", \"BKLN\", \"SKIN\",\n\"LNG\", \"NU\", \"CX\", \"GSM\", \"NXE\", \"REI\", \"MNDT\", \"IP\", \"BLOK\", \"IAA\", \"TIP\", \"MCHP\", \"EVTL\", \"BIGC\",\n\"IGV\", \"LOTZ\", \"EWC\", \"DRI\", \"PSTG\", \"APLS\", \"KIND\", \"BBIO\", \"APPH\", \"FIVE\", \"LSPD\", \"SHAK\",\n\"COMM\", \"NAT\", \"VFC\", \"AMT\", \"VRTX\", \"RGS\", \"DD\", \"GBIL\", \"LICY\", \"ACHR\", \"FLR\", \"HGEN\", \"TECL\",\n\"SEAC\", \"NVS\", \"NTAP\", \"ML\", \"SBSW\", \"XRX\", \"UA\", \"NNOX\", \"SFT\", \"FE\", \"APP\", \"KEY\", \"CDEV\",\n\"DPZ\", \"BARK\", \"SPR\", \"CNQ\", \"XL\", \"AXSM\", \"ECH\", \"RNG\", \"AMLP\", \"ENG\", \"BTI\", \"REKR\",\n\"STZ\", \"BK\", \"HEAR\", \"LEV\", \"SKT\", \"HBI\", \"ALB\", \"CAG\", \"MNKD\", \"NMM\", \"BIRD\", \"CIEN\", \"SILJ\",\n\"STNG\", \"GUSH\", \"GIS\", \"PRPL\", \"SDOW\", \"GNRC\", \"ERX\", \"GES\", \"CPE\", \"FBRX\", \"WM\", \"ESTC\",\n\"GOED\", \"STLD\", \"LILM\", \"JNK\", \"BOIL\", \"ALZN\", \"IRBT\", \"KOPN\", \"AU\", \"TPR\", \"RWLK\", \"TROX\",\n\"TMO\", \"AVDL\", \"XSPA\", \"JKS\", \"PACB\", \"LOGI\", \"BLK\", \"REGN\", \"CFVI\", \"EGHT\", \"ATNF\", \"PRU\",\n\"URBN\", \"KMB\", \"SIX\", \"CME\", \"ENVX\", \"NVTS\", \"CELH\", \"CSIQ\", \"GSL\", \"PAA\", \"WU\", \"MOMO\",\n\"TOL\", \"WEN\", \"GTE\", \"EXAS\", \"GDRX\", \"PVH\", \"BFLY\", \"SRTY\", \"UDOW\", \"NCR\", \"ALTO\", \"CRTD\",\n\"GOCO\", \"ALK\", \"TTM\", \"DFS\", \"VFF\", \"ANTM\", \"FREY\", \"WY\", \"ACWI\", \"PNC\", \"SYY\", \"SNY\", \"CRK\",\n\"SO\", \"XXII\", \"PBF\", \"AER\", \"RKLY\", \"SOL\", \"CND\", \"MPLX\", \"JNPR\", \"FTCV\", \"CLR\", \"XHB\", \"YY\",\n\"POSH\", \"HIMS\", \"LIFE\", \"XENE\", \"ADM\", \"ROST\", \"MIR\", \"NRG\", \"AAP\", \"SSYS\", \"KBH\", \"KKR\", \"PLAN\",\n\"DUK\", \"WIMI\", \"DBRG\", \"WSM\", \"LTHM\", \"OVV\", \"CFLT\", \"EWT\", \"UNFI\", \"TX\", \"EMR\", \"IMGN\", \"K\",\n\"ONON\", \"UNIT\", \"LEVI\", \"ADTX\", \"UPWK\", \"DBA\", \"VOO\", \"FATH\", \"URI\", \"MPW\", \"JNUG\", \"RDFN\",\n\"OSCR\", \"WOLF\", \"SYF\", \"GOGL\", \"HES\", \"PHM\", \"CWEB\", \"ALDX\", \"BTWN\", \"AFL\", \"PPL\", \"CIM\"\n\n            };\n            \n            SetWarmUp(TimeSpan.FromDays(1));\n            foreach(var ticker in equity_symbols)\n            {\n                var option = AddOption(ticker);\n                option.SetFilter(1, 7, 0, 90);\n            }\n\n            AddEquity(\"SPY\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp)\n            {\n                return;\n            }\n            Quit(\"The end!\");\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/EmptyMinute400EquityBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Benchmark Algorithm: Loading and synchronization of 400 equity minute symbols.\n    /// </summary>\n    /// <remarks>\n    /// Testing the parsing; synchronizing and injection of data into LEAN event handlers. This directly adds the symbols to avoid universe\n    /// selection overhead. Later tests will include universe selection. The data sources are sparse.\n    /// </remarks>\n    public class EmptyMinute400EquityBenchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2015, 9, 1);\n            SetEndDate(2015, 12, 1);\n            foreach (var symbol in Symbols.Equity.All.Take(400))\n            {\n                AddSecurity(SecurityType.Equity, symbol);\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n        }\n    }\n\n    public static class Symbols\n    {\n        public static class Equity\n        {\n            #region All\n            public static readonly HashSet<string> All = new HashSet<string>\n            {\n                \"SPY\",\n                \"AAPL\",\n                \"FB\",\n                \"VXX\",\n                \"VRX\",\n                \"NFLX\",\n                \"UVXY\",\n                \"QQQ\",\n                \"IWM\",\n                \"BABA\",\n                \"GILD\",\n                \"XIV\",\n                \"XOM\",\n                \"CVX\",\n                \"MSFT\",\n                \"GE\",\n                \"SLB\",\n                \"JPM\",\n                \"XLE\",\n                \"DIS\",\n                \"AMZN\",\n                \"TWTR\",\n                \"PFE\",\n                \"C\",\n                \"BAC\",\n                \"ABBV\",\n                \"JNJ\",\n                \"HAL\",\n                \"XLV\",\n                \"INTC\",\n                \"WFC\",\n                \"V\",\n                \"YHOO\",\n                \"COP\",\n                \"MYL\",\n                \"AGN\",\n                \"WMT\",\n                \"KMI\",\n                \"MRK\",\n                \"TSLA\",\n                \"GDX\",\n                \"LLY\",\n                \"FCX\",\n                \"CAT\",\n                \"CELG\",\n                \"QCOM\",\n                \"MCD\",\n                \"CMCSA\",\n                \"XOP\",\n                \"CVS\",\n                \"AMGN\",\n                \"DOW\",\n                \"AAL\",\n                \"APC\",\n                \"SUNE\",\n                \"MU\",\n                \"VLO\",\n                \"SBUX\",\n                \"WMB\",\n                \"PG\",\n                \"EOG\",\n                \"DVN\",\n                \"BMY\",\n                \"APA\",\n                \"UNH\",\n                \"EEM\",\n                \"IBM\",\n                \"NKE\",\n                \"T\",\n                \"HD\",\n                \"UNP\",\n                \"DAL\",\n                \"ENDP\",\n                \"CSCO\",\n                \"OXY\",\n                \"MRO\",\n                \"MDT\",\n                \"TXN\",\n                \"WLL\",\n                \"ORCL\",\n                \"GOOGL\",\n                \"UAL\",\n                \"WYNN\",\n                \"MS\",\n                \"HZNP\",\n                \"BIIB\",\n                \"VZ\",\n                \"GM\",\n                \"NBL\",\n                \"TWX\",\n                \"SWKS\",\n                \"JD\",\n                \"HCA\",\n                \"AVGO\",\n                \"YUM\",\n                \"KO\",\n                \"GOOG\",\n                \"GS\",\n                \"PEP\",\n                \"AIG\",\n                \"EMC\",\n                \"BIDU\",\n                \"CLR\",\n                \"PYPL\",\n                \"LVS\",\n                \"SWN\",\n                \"AXP\",\n                \"ATVI\",\n                \"RRC\",\n                \"WBA\",\n                \"MPC\",\n                \"NXPI\",\n                \"ETE\",\n                \"NOV\",\n                \"FOXA\",\n                \"SNDK\",\n                \"DIA\",\n                \"UTX\",\n                \"DD\",\n                \"WDC\",\n                \"AA\",\n                \"M\",\n                \"FXI\",\n                \"RIG\",\n                \"MA\",\n                \"DUST\",\n                \"TGT\",\n                \"AET\",\n                \"EBAY\",\n                \"LUV\",\n                \"EFA\",\n                \"BRK.B\",\n                \"BA\",\n                \"MET\",\n                \"LYB\",\n                \"SVXY\",\n                \"UWTI\",\n                \"HON\",\n                \"HPQ\",\n                \"OAS\",\n                \"ABT\",\n                \"MO\",\n                \"ESRX\",\n                \"TEVA\",\n                \"STX\",\n                \"IBB\",\n                \"F\",\n                \"CBS\",\n                \"TLT\",\n                \"PM\",\n                \"ESV\",\n                \"NE\",\n                \"PSX\",\n                \"SCHW\",\n                \"MON\",\n                \"HES\",\n                \"GPRO\",\n                \"TVIX\",\n                \"MNK\",\n                \"NVDA\",\n                \"NFX\",\n                \"USO\",\n                \"NUGT\",\n                \"EWZ\",\n                \"LOW\",\n                \"UA\",\n                \"TNA\",\n                \"XLY\",\n                \"MMM\",\n                \"PXD\",\n                \"VIAB\",\n                \"MDLZ\",\n                \"NEM\",\n                \"USB\",\n                \"MUR\",\n                \"ETN\",\n                \"FEYE\",\n                \"PTEN\",\n                \"OIH\",\n                \"UPS\",\n                \"CHK\",\n                \"DHR\",\n                \"RAI\",\n                \"TQQQ\",\n                \"CCL\",\n                \"BRCM\",\n                \"DG\",\n                \"JBLU\",\n                \"CRM\",\n                \"ADBE\",\n                \"COG\",\n                \"PBR\",\n                \"HP\",\n                \"BHI\",\n                \"BK\",\n                \"TJX\",\n                \"DE\",\n                \"COF\",\n                \"INCY\",\n                \"DHI\",\n                \"ABC\",\n                \"XLI\",\n                \"ZTS\",\n                \"BP\",\n                \"IYR\",\n                \"PNC\",\n                \"CNX\",\n                \"XLF\",\n                \"LRCX\",\n                \"GG\",\n                \"RDS.A\",\n                \"WFM\",\n                \"TSO\",\n                \"ANTM\",\n                \"KSS\",\n                \"EA\",\n                \"PRU\",\n                \"RAD\",\n                \"WFT\",\n                \"XBI\",\n                \"THC\",\n                \"VWO\",\n                \"CTSH\",\n                \"ABX\",\n                \"VMW\",\n                \"CSX\",\n                \"ACN\",\n                \"EMR\",\n                \"SE\",\n                \"MJN\",\n                \"SKX\",\n                \"ACE\",\n                \"P\",\n                \"CMI\",\n                \"CL\",\n                \"CAH\",\n                \"EXC\",\n                \"DUK\",\n                \"AMAT\",\n                \"AEM\",\n                \"FTI\",\n                \"STT\",\n                \"ILMN\",\n                \"HOG\",\n                \"KR\",\n                \"EXPE\",\n                \"VRTX\",\n                \"IVV\",\n                \"CAM\",\n                \"GPS\",\n                \"MCK\",\n                \"ADSK\",\n                \"CMCSK\",\n                \"HTZ\",\n                \"MGM\",\n                \"DLTR\",\n                \"STI\",\n                \"CYH\",\n                \"MOS\",\n                \"CNQ\",\n                \"GLW\",\n                \"KEY\",\n                \"KORS\",\n                \"SIRI\",\n                \"EPD\",\n                \"SU\",\n                \"DFS\",\n                \"TMO\",\n                \"TAP\",\n                \"HST\",\n                \"NBR\",\n                \"EQT\",\n                \"XLU\",\n                \"BSX\",\n                \"COST\",\n                \"CTRP\",\n                \"HFC\",\n                \"VNQ\",\n                \"TRV\",\n                \"POT\",\n                \"CERN\",\n                \"LLTC\",\n                \"DO\",\n                \"ADI\",\n                \"BAX\",\n                \"AMT\",\n                \"URI\",\n                \"UCO\",\n                \"ECA\",\n                \"MAS\",\n                \"ALL\",\n                \"PCAR\",\n                \"VIPS\",\n                \"ATW\",\n                \"SPXU\",\n                \"LNKD\",\n                \"X\",\n                \"TSM\",\n                \"SO\",\n                \"BBT\",\n                \"SYF\",\n                \"VFC\",\n                \"CXO\",\n                \"IR\",\n                \"PWR\",\n                \"GLD\",\n                \"LNG\",\n                \"ETP\",\n                \"JNPR\",\n                \"MAT\",\n                \"KLAC\",\n                \"XLK\",\n                \"TRIP\",\n                \"AEP\",\n                \"VTR\",\n                \"ROST\",\n                \"RDC\",\n                \"CF\",\n                \"FAS\",\n                \"HCN\",\n                \"AR\",\n                \"SM\",\n                \"WPX\",\n                \"D\",\n                \"HOT\",\n                \"PRGO\",\n                \"ALXN\",\n                \"CNC\",\n                \"VALE\",\n                \"JCP\",\n                \"GDXJ\",\n                \"OKE\",\n                \"ADM\",\n                \"JOY\",\n                \"TSN\",\n                \"MAR\",\n                \"KHC\",\n                \"NSC\",\n                \"CMA\",\n                \"COH\",\n                \"GMCR\",\n                \"FL\",\n                \"FITB\",\n                \"BHP\",\n                \"JWN\",\n                \"DNR\",\n                \"PBF\",\n                \"XLNX\"\n            };\n            #endregion\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/EmptySPXOptionChainBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Benchmark Algorithm that adds SPX option chain but does not trade it.\n    /// This is an interesting benchmark because SPX option chains are large\n    /// </summary>\n    public class EmptySPXOptionChainBenchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetEndDate(2020, 6, 1);\n\n            var index = AddIndex(\"SPX\");\n            var option = AddOption(index);\n            option.SetFilter(x => x.IncludeWeeklys().Strikes(-30, 30).Expiration(0, 7));\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/EmptySingleSecuritySecondEquityBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Benchmark Algorithm: Pure processing of 1 equity second resolution with the same benchmark.\n    /// </summary>\n    /// <remarks>\n    /// This should eliminate the synchronization part of LEAN and focus on measuring the performance of a single datafeed and event handling system.\n    /// </remarks>\n    public class EmptySingleSecuritySecondEquityBenchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2008, 01, 01);\n            SetEndDate(2008, 06, 01);\n            SetBenchmark(dt => 1m);\n            AddEquity(\"SPY\", Resolution.Second);\n        }\n\n        public override void OnData(Slice slice)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/HistoryRequestBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    public class HistoryRequestBenchmark : QCAlgorithm\n    {\n        private Symbol _symbol;\n        public override void Initialize()\n        {\n            SetStartDate(2010, 01, 01);\n            SetEndDate(2022, 01, 01);\n            SetCash(10000);\n            _symbol = AddEquity(\"SPY\").Symbol;\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            var minuteHistory = History(symbol, 60, Resolution.Minute);\n            var lastHourHigh = minuteHistory.Select(minuteBar => minuteBar.High).DefaultIfEmpty(0).Max();\n            var dailyHistory = History(symbol, 1, Resolution.Daily).First();\n            var dailyHigh = dailyHistory.High;\n            var dailyLow = dailyHistory.Low;\n            var dailyOpen = dailyHistory.Open;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/IndicatorRibbonBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    /// <summary>\n    /// Constructs a displaced moving average ribbon \n    /// </summary>\n    public class IndicatorRibbonBenchmark : QCAlgorithm\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private IndicatorBase<IndicatorDataPoint>[] _ribbon;\n\n        public override void Initialize()\n        {\n            SetStartDate(2010, 01, 01);\n            SetEndDate(2022, 01, 01);\n\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Minute);\n\n            const int count = 50;\n            const int offset = 5;\n            const int period = 15;\n\n            // define our sma as the base of the ribbon\n            var sma = new SimpleMovingAverage(period);\n\n            _ribbon = Enumerable.Range(0, count).Select(x =>\n            {\n                // define our offset to the zero sma, these various offsets will create our 'displaced' ribbon\n                var delay = new Delay(offset * (x + 1));\n\n                // define an indicator that takes the output of the sma and pipes it into our delay indicator\n                var delayedSma = delay.Of(sma);\n\n                // register our new 'delayedSma' for automatic updates on a daily resolution\n                RegisterIndicator(_spy, delayedSma, Resolution.Daily, data => data.Value);\n\n                return delayedSma;\n            }).ToArray();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // wait for our entire ribbon to be ready\n            if (!_ribbon.All(x => x.IsReady)) return;\n            foreach (var indicator in _ribbon)\n            {\n                var value = indicator.Current.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/ScheduledEventsBenchmark.cs",
    "content": "/*\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    public class ScheduledEventsBenchmark : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2011, 1, 1);\n            SetEndDate(2022, 1, 1);\n            SetCash(100000);\n            AddEquity(\"SPY\");\n            foreach (int period in Enumerable.Range(0, 300))\n            {\n                Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.AfterMarketOpen(\"SPY\", period), Rebalance);\n                Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.BeforeMarketClose(\"SPY\", period), Rebalance);\n            }\n        }\n\n        public override void OnData(Slice slice) { }\n        private void Rebalance() { }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/StatefulCoarseUniverseSelectionBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    public class StatefulCoarseUniverseSelectionBenchmark : QCAlgorithm\n    {\n        private const int NumberOfSymbolsCoarse = 250;\n        private readonly List<Symbol> _blackList = new List<Symbol>();\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2017, 1, 01);\n            SetEndDate(2019, 1, 01);\n            SetCash(50000);\n\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // select only symbols with fundamental data and sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse\n                .Where(x => x.HasFundamentalData)\n                .OrderByDescending(x => x.DollarVolume);\n\n            var top = sortedByDollarVolume\n                .Where(fundamental => !_blackList.Contains(fundamental.Symbol))\n                .Take(NumberOfSymbolsCoarse);\n\n            // we need to return only the symbol objects\n            return top.Select(x => x.Symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.HasData)\n            {\n                var symbol = slice.Keys.FirstOrDefault();\n                if (symbol != null)\n                {\n                    if (_blackList.Count > 50)\n                    {\n                        _blackList.RemoveAt(0);\n                    }\n                    _blackList.Add(symbol);\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n            foreach (var security in changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.001m);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Benchmarks/StatelessCoarseUniverseSelectionBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp.Benchmarks\n{\n    public class StatelessCoarseUniverseSelectionBenchmark : QCAlgorithm\n    {\n        private const int NumberOfSymbolsCoarse = 250;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2017, 1, 01);\n            SetEndDate(2019, 1, 01);\n            SetCash(50000);\n\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        // sort the data by daily dollar volume and take the top 250\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // select only symbols with fundamental data and sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse\n                .Where(x => x.HasFundamentalData)\n                .OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top = sortedByDollarVolume.Take(NumberOfSymbolsCoarse);\n\n            // we need to return only the symbol objects\n            return top.Select(x => x.Symbol);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n            foreach (var security in changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.001m);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Binance cash account regression algorithm, reproduces issue https://github.com/QuantConnect/Lean/issues/6123\n    /// </summary>\n    public class BinanceCashAccountFeeRegressionAlgorithm : CryptoBaseCurrencyFeeRegressionAlgorithm\n    {\n        /// <summary>\n        /// The target account type\n        /// </summary>\n        protected override AccountType AccountType { get; } = AccountType.Cash;\n\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"USDT\");\n            SetStartDate(2018, 05, 02);\n            SetEndDate(2018, 05, 03);\n            BrokerageName = BrokerageName.Binance;\n            Pair = \"BTCUSDT\";\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"49\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"99986.57\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₮45.62\"},\n            {\"Estimated Strategy Capacity\", \"₮220000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT 18N\"},\n            {\"Portfolio Turnover\", \"22.80%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"80711e4c1e3c0da20152da8fafc3fd66\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BinanceMarginAccountFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Binance margin account regression algorithm, reproduces issue https://github.com/QuantConnect/Lean/issues/6123\n    /// </summary>\n    public class BinanceMarginAccountFeeRegressionAlgorithm : CryptoBaseCurrencyFeeRegressionAlgorithm\n    {\n        /// <summary>\n        /// The target account type\n        /// </summary>\n        protected override AccountType AccountType { get; } = AccountType.Margin;\n\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"USDT\");\n            SetStartDate(2018, 05, 02);\n            SetEndDate(2018, 05, 03);\n            BrokerageName = BrokerageName.Binance;\n            Pair = \"BTCUSDT\";\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"49\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"99986.57\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₮45.62\"},\n            {\"Estimated Strategy Capacity\", \"₮12000000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT 18N\"},\n            {\"Portfolio Turnover\", \"22.80%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"80711e4c1e3c0da20152da8fafc3fd66\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BitfinexCashAccountFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Bitfinex cash account regression algorithm, reproduces issue https://github.com/QuantConnect/Lean/issues/6123\n    /// </summary>\n    public class BitfinexCashAccountFeeRegressionAlgorithm : CryptoBaseCurrencyFeeRegressionAlgorithm\n    {\n        /// <summary>\n        /// The target account type\n        /// </summary>\n        protected override AccountType AccountType { get; } = AccountType.Cash;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 02);\n            SetEndDate(2013, 10, 03);\n            BrokerageName = BrokerageName.Bitfinex;\n            Pair = \"BTCUSD\";\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 126;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"49\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100001.31\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.13\"},\n            {\"Estimated Strategy Capacity\", \"$2000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD E3\"},\n            {\"Portfolio Turnover\", \"0.28%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"899ef4e299a6cc73c1bd96fb9993db0e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BitfinexMarginAccountFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Bitfinex margin account regression algorithm, reproduces issue https://github.com/QuantConnect/Lean/issues/6123\n    /// </summary>\n    public class BitfinexMarginAccountFeeRegressionAlgorithm : CryptoBaseCurrencyFeeRegressionAlgorithm\n    {\n        /// <summary>\n        /// The target account type\n        /// </summary>\n        protected override AccountType AccountType { get; } = AccountType.Margin;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 02);\n            SetEndDate(2013, 10, 03);\n            BrokerageName = BrokerageName.Bitfinex;\n            Pair = \"BTCUSD\";\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 126;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"49\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100001.31\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.13\"},\n            {\"Estimated Strategy Capacity\", \"$640000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD E3\"},\n            {\"Portfolio Turnover\", \"0.28%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"899ef4e299a6cc73c1bd96fb9993db0e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class BlackLittermanPortfolioOptimizationFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private IEnumerable<Symbol> _symbols = (new string[] { \"AIG\", \"BAC\", \"IBM\", \"SPY\" }).Select(s => QuantConnect.Symbol.Create(s, SecurityType.Equity, Market.USA));\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n\n            var optimizer = new UnconstrainedMeanVariancePortfolioOptimizer();\n\n            // set algorithm framework models\n            SetUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelector));\n            SetAlpha(new HistoricalReturnsAlphaModel(resolution: Resolution.Daily));\n            SetPortfolioConstruction(new BlackLittermanOptimizationPortfolioConstructionModel(optimizer: optimizer));\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        public IEnumerable<Symbol> CoarseSelector(IEnumerable<CoarseFundamental> coarse)\n        {\n            int last = Time.Day > 8 ? 3 : _symbols.Count();\n            return _symbols.Take(last);\n        }\n\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14082;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 256;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"22\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"-0.14%\"},\n            {\"Compounding Annual Return\", \"71.152%\"},\n            {\"Drawdown\", \"1.100%\"},\n            {\"Expectancy\", \"-0.797\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100738.86\"},\n            {\"Net Profit\", \"0.739%\"},\n            {\"Sharpe Ratio\", \"4.46\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"60.106%\"},\n            {\"Loss Rate\", \"80%\"},\n            {\"Win Rate\", \"20%\"},\n            {\"Profit-Loss Ratio\", \"0.02\"},\n            {\"Alpha\", \"-0.552\"},\n            {\"Beta\", \"0.579\"},\n            {\"Annual Standard Deviation\", \"0.133\"},\n            {\"Annual Variance\", \"0.018\"},\n            {\"Information Ratio\", \"-13.953\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"1.024\"},\n            {\"Total Fees\", \"$46.24\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"69.06%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"44a85134cd1c91c9720549bc0e007f80\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BrokerageActivityEventHandlingAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm to demostrate the event handlers of Brokerage activities\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    public class BrokerageActivityEventHandlingAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        /// <summary>\n        /// Brokerage message event handler. This method is called for all types of brokerage messages.\n        /// </summary>\n        public override void OnBrokerageMessage(BrokerageMessageEvent messageEvent)\n        {\n            Debug($\"Brokerage meesage received - {messageEvent.ToString()}\");\n        }\n\n        /// <summary>\n        /// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n        /// </summary>\n        public override void OnBrokerageDisconnect()\n        {\n            Debug($\"Brokerage disconnected!\");\n        }\n\n        /// <summary>\n        /// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n        /// </summary>\n        public override void OnBrokerageReconnect()\n        {\n            Debug($\"Brokerage reconnected!\");\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BrokerageModelAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstrate the usage of the BrokerageModel property to help improve backtesting\n    /// accuracy through simulation of a specific brokerage's rules around restrictions\n    /// on submitting orders as well as fee structure.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"brokerage models\" />\n    public class BrokerageModelAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must be initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Second);\n\n            // there's two ways to set your brokerage model. The easiest would be to call\n            // SetBrokerageModel( BrokerageName ); // BrokerageName is an enum\n            //SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n            //SetBrokerageModel(BrokerageName.Default);\n\n            // the other way is to call SetBrokerageModel( IBrokerageModel ) with your\n            // own custom model. I've defined a simple extension to the default brokerage\n            // model to take into account a requirement to maintain 500 cash in the account\n            // at all times\n\n            SetBrokerageModel(new MinimumAccountBalanceBrokerageModel(this, 500.00m));\n        }\n\n        private decimal _last = 1.0m;\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                //fails first several times, we'll keep decrementing until it succeeds\n                SetHoldings(\"SPY\", _last);\n                if (Portfolio[\"SPY\"].Quantity == 0)\n                {\n                    // each time we fail to purchase we'll decrease our set holdings percentage\n                    Debug(Time + \" - Failed to purchase stock\");\n                    _last *= 0.95m;\n                }\n                else\n                {\n                    Debug(Time + \" - Purchased Stock @ SetHoldings( \" + _last + \" )\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Custom brokerage model that requires clients to maintain a minimum cash balance\n        /// </summary>\n        class MinimumAccountBalanceBrokerageModel : DefaultBrokerageModel\n        {\n            private readonly QCAlgorithm _algorithm;\n            private readonly decimal _minimumAccountBalance;\n\n            public MinimumAccountBalanceBrokerageModel(QCAlgorithm algorithm, decimal minimumAccountBalance)\n            {\n                _algorithm = algorithm;\n                _minimumAccountBalance = minimumAccountBalance;\n            }\n\n            /// <summary>\n            /// Prevent orders which would bring the account below a minimum cash balance\n            /// </summary>\n            public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n            {\n                message = null;\n\n                // we want to model brokerage requirement of _minimumAccountBalance cash value in account\n\n                var orderCost = order.GetValue(security);\n                var cash = _algorithm.Portfolio.Cash;\n                var cashAfterOrder = cash - orderCost;\n                if (cashAfterOrder < _minimumAccountBalance)\n                {\n                    // return a message describing why we're not allowing this order\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"InsufficientRemainingCapital\",\n                        $\"Account must maintain a minimum of ${_minimumAccountBalance.ToStringInvariant()} USD at all times. \" +\n                        $\"Order ID: {order.Id.ToStringInvariant()}\"\n                    );\n                    return false;\n                }\n                return true;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/BubbleAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Strategy example algorithm using CAPE - a bubble indicator dataset saved in dropbox. CAPE is based on a macroeconomic indicator(CAPE Ratio),\n    /// we are looking for entry/exit points for momentum stocks CAPE data: January 1990 - December 2014\n    /// Goals:\n    /// Capitalize in overvalued markets by generating returns with momentum and selling before the crash\n    /// Capitalize in undervalued markets by purchasing stocks at bottom of trough\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    public class BubbleAlgorithm : QCAlgorithm\n    {\n        private decimal _currCape;\n        private readonly decimal[] _c = new decimal[4];\n        private readonly decimal[] _cCopy = new decimal[4];\n        private bool _newLow;\n        private int _counter;\n        private int _counter2;\n        private MovingAverageConvergenceDivergence _macd;\n        private RelativeStrengthIndex _rsi = new RelativeStrengthIndex(14);\n        private readonly ArrayList _symbols = new ArrayList();\n        private readonly Dictionary<string, RelativeStrengthIndex> _rsiDic = new Dictionary<string, RelativeStrengthIndex>();\n        private readonly Dictionary<string, MovingAverageConvergenceDivergence> _macdDic = new Dictionary<string, MovingAverageConvergenceDivergence>();\n\n        /// <summary>\n        /// Called at the start of your algorithm to setup your requirements:\n        /// </summary>\n        public override void Initialize()\n        {\n            SetCash(100000);\n            _symbols.Add(\"SPY\");\n            SetStartDate(1998, 1, 1);\n            SetEndDate(2014, 6, 1);\n\n            //Present Social Media Stocks:\n            // symbols.Add(\"FB\");symbols.Add(\"LNKD\");symbols.Add(\"GRPN\");symbols.Add(\"TWTR\");\n            // SetStartDate(2011, 1, 1);\n            // SetEndDate(2014, 12, 1);\n\n            //2008 Financials:\n            // symbols.Add(\"C\");symbols.Add(\"AIG\");symbols.Add(\"BAC\");symbols.Add(\"HBOS\");\n            // SetStartDate(2003, 1, 1);\n            // SetEndDate(2011, 1, 1);\n\n            //2000 Dot.com:\n            // symbols.Add(\"IPET\");symbols.Add(\"WBVN\");symbols.Add(\"GCTY\");\n            // SetStartDate(1998, 1, 1);\n            // SetEndDate(2000, 1, 1);\n\n            //CAPE data\n            AddData<CAPE>(\"CAPE\");\n\n            foreach (string stock in _symbols)\n            {\n                AddSecurity(SecurityType.Equity, stock, Resolution.Minute);\n\n                _macd = MACD(stock, 12, 26, 9, MovingAverageType.Exponential, Resolution.Daily);\n                _macdDic.Add(stock, _macd);\n                _rsi = RSI(stock, 14, MovingAverageType.Exponential, Resolution.Daily);\n                _rsiDic.Add(stock, _rsi);\n\n                Securities[stock].SetLeverage(10);\n            }\n        }\n\n        /// <summary>\n        /// Trying to find if current Cape is the lowest Cape in three months to indicate selling period\n        /// </summary>\n        public void OnData(CAPE data)\n        {\n            _newLow = false;\n            //Adds first four Cape Ratios to array c\n            _currCape = data.Cape;\n            if (_counter < 4)\n            {\n                _c[_counter++] = _currCape;\n            }\n            //Replaces oldest Cape with current Cape\n            //Checks to see if current Cape is lowest in the previous quarter\n            //Indicating a sell off\n            else\n            {\n                Array.Copy(_c, _cCopy, 4);\n                Array.Sort(_cCopy);\n                if (_cCopy[0] > _currCape) _newLow = true;\n                _c[_counter2++] = _currCape;\n                if (_counter2 == 4) _counter2 = 0;\n            }\n\n            Debug(\"Current Cape: \" + _currCape + \" on \" + data.Time);\n            if (_newLow) Debug(\"New Low has been hit on \" + data.Time);\n        }\n\n        /// <summary>\n        /// New data for our assets.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            try\n            {\n                //Bubble territory\n                if (_currCape > 20 && _newLow == false)\n                {\n                    foreach (string stock in _symbols)\n                    {\n                        //Order stock based on MACD\n                        //During market hours, stock is trading, and sufficient cash\n                        if (Securities[stock].Holdings.Quantity == 0 && _rsiDic[stock] < 70\n                            && Securities[stock].Price != 0 && Portfolio.Cash > Securities[stock].Price * 100\n                            && Time.Hour == 9 && Time.Minute == 31)\n                        {\n                            Buy(stock);\n                        }\n                        //Utilize RSI for overbought territories and liquidate that stock\n                        if (_rsiDic[stock] > 70 && Securities[stock].Holdings.Quantity > 0\n                                && Time.Hour == 9 && Time.Minute == 31)\n                        {\n                            Sell(stock);\n                        }\n                    }\n                }\n\n                // Undervalued territory\n                else if (_newLow)\n                {\n                    foreach (string stock in _symbols)\n                    {\n\n                        //Sell stock based on MACD\n                        if (Securities[stock].Holdings.Quantity > 0 && _rsiDic[stock] > 30\n                            && Time.Hour == 9 && Time.Minute == 31)\n                        {\n                            Sell(stock);\n                        }\n                        //Utilize RSI and MACD to understand oversold territories\n                        else if (Securities[stock].Holdings.Quantity == 0 && _rsiDic[stock] < 30\n                            && Securities[stock].Price != 0 && Portfolio.Cash > Securities[stock].Price * 100\n                            && Time.Hour == 9 && Time.Minute == 31)\n                        {\n                            Buy(stock);\n                        }\n                    }\n\n                }\n                // Cape Ratio is missing from original data\n                // Most recent cape data is most likely to be missing\n                else if (_currCape == 0)\n                {\n                    Debug(\"Exiting due to no CAPE!\");\n                    Quit(\"CAPE ratio not supplied in data, exiting.\");\n                }\n            }\n            catch (RegressionTestException err)\n            {\n                Error(err.Message);\n            }\n        }\n\n\n        /// <summary>\n        /// Buy this symbol\n        /// </summary>\n        public void Buy(string symbol)\n        {\n            var s = Securities[symbol].Holdings;\n            if (_macdDic[symbol] > 0m)\n            {\n                SetHoldings(symbol, 1);\n\n                Debug(\"Purchasing: \" + symbol + \"   MACD: \" + _macdDic[symbol] + \"   RSI: \" + _rsiDic[symbol]\n                    + \"   Price: \" + Math.Round(Securities[symbol].Price, 2) + \"   Quantity: \" + s.Quantity);\n            }\n        }\n\n        /// <summary>\n        /// Sell this symbol\n        /// </summary>\n        /// <param name=\"symbol\"></param>\n        public void Sell(string symbol)\n        {\n            var s = Securities[symbol].Holdings;\n            if (s.Quantity > 0 && _macdDic[symbol] < 0m)\n            {\n                Liquidate(symbol);\n\n                Debug(\"Selling: \" + symbol + \" at sell MACD: \" + _macdDic[symbol] + \"   RSI: \" + _rsiDic[symbol]\n                    + \"   Price: \" + Math.Round(Securities[symbol].Price, 2) + \"   Profit from sale: \" + s.LastTradeProfit);\n            }\n        }\n    }\n\n    /// <summary>\n    /// CAPE Ratio for SP500 PE Ratio for avg inflation adjusted earnings for previous ten years\n    /// Custom Data from DropBox\n    /// Original Data from: http://www.econ.yale.edu/~shiller/data.htm\n    /// </summary>\n    public class CAPE : BaseData\n    {\n        public decimal Cape { get; set; }\n        private const string Format = \"yyyy-MM\";\n        private readonly CultureInfo _provider = CultureInfo.InvariantCulture;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CAPE\"/> indicator.\n        /// </summary>\n        public CAPE()\n        {\n            Symbol = \"CAPE\";\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            // Remember to add the \"?dl=1\" for dropbox links\n            return new SubscriptionDataSource(\"https://www.dropbox.com/s/ggt6blmib54q36e/CAPE.csv?dl=1\", SubscriptionTransportMedium.RemoteFile);\n        }\n\n        /// <summary>\n        /// Reader Method :: using set of arguments we specify read out type. Enumerate\n        /// until the end of the data stream or file. E.g. Read CSV file line by line and convert\n        /// into data types.\n        /// </summary>\n        /// <returns>BaseData type set by Subscription Method.</returns>\n        /// <param name=\"config\">Config.</param>\n        /// <param name=\"line\">Line.</param>\n        /// <param name=\"date\">Date.</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var index = new CAPE();\n\n            try\n            {\n                //Example File Format:\n                //Date   |  Price |  Div  | Earning | CPI  | FractionalDate | Interest Rate | RealPrice | RealDiv | RealEarnings | CAPE\n                //2014.06  1947.09  37.38   103.12   238.343    2014.37          2.6           1923.95     36.94        101.89     25.55\n                var data = line.Split(',');\n                //Dates must be in the format YYYY-MM-DD. If your data source does not have this format, you must use\n                //DateTime.ParseExact() and explicit declare the format your data source has.\n                var dateString = data[0];\n                index.Time = DateTime.ParseExact(dateString, Format, _provider);\n                index.Cape = Convert.ToDecimal(data[10], CultureInfo.InvariantCulture);\n                index.Symbol = \"CAPE\";\n                index.Value = index.Cape;\n            }\n            catch\n            {\n\n            }\n            return index;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating and ensuring that Bybit crypto futures brokerage model works as expected\n    /// </summary>\n    public class BybitCryptoFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CryptoFuture _btcUsdt;\n        private CryptoFuture _btcUsd;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        private Dictionary<Symbol, int> _interestPerSymbol = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 13);\n\n            // Set strategy cash (USD)\n            SetCash(100000);\n\n            SetBrokerageModel(BrokerageName.Bybit, AccountType.Margin);\n\n            AddCrypto(\"BTCUSDT\", Resolution.Minute);\n\n            _btcUsdt = AddCryptoFuture(\"BTCUSDT\", Resolution.Minute);\n            _btcUsd = AddCryptoFuture(\"BTCUSD\", Resolution.Minute);\n\n            // create two moving averages\n            _fast = EMA(_btcUsdt.Symbol, 30, Resolution.Minute);\n            _slow = EMA(_btcUsdt.Symbol, 60, Resolution.Minute);\n\n            _interestPerSymbol[_btcUsdt.Symbol] = 0;\n            _interestPerSymbol[_btcUsd.Symbol] = 0;\n\n            // the amount of USDT we need to hold to trade 'BTCUSDT'\n            _btcUsdt.QuoteCurrency.SetAmount(200);\n            // the amount of BTC we need to hold to trade 'BTCUSD'\n            _btcUsd.BaseCurrency.SetAmount(0.005m);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var interestRates = slice.Get<MarginInterestRate>();\n            foreach (var interestRate in interestRates)\n            {\n                _interestPerSymbol[interestRate.Key]++;\n\n                var cachedInterestRate = Securities[interestRate.Key].Cache.GetData<MarginInterestRate>();\n                if (cachedInterestRate != interestRate.Value)\n                {\n                    throw new RegressionTestException($\"Unexpected cached margin interest rate for {interestRate.Key}!\");\n                }\n            }\n\n            if (!_slow.IsReady)\n            {\n                return;\n            }\n\n            if (_fast > _slow)\n            {\n                if (!Portfolio.Invested && Transactions.OrdersCount == 0)\n                {\n                    var ticket = Buy(_btcUsd.Symbol, 1000);\n                    if (ticket.Status != OrderStatus.Invalid)\n                    {\n                        throw new RegressionTestException($\"Unexpected valid order {ticket}, should fail due to margin not sufficient\");\n                    }\n\n                    Buy(_btcUsd.Symbol, 100);\n\n                    var marginUsed = Portfolio.TotalMarginUsed;\n                    var btcUsdHoldings = _btcUsd.Holdings;\n\n                    // Coin futures value is 100 USD\n                    var holdingsValueBtcUsd = 100;\n                    if (Math.Abs(btcUsdHoldings.TotalSaleVolume - holdingsValueBtcUsd) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalSaleVolume {btcUsdHoldings.TotalSaleVolume}\");\n                    }\n                    if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - holdingsValueBtcUsd) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}\");\n                    }\n                    if (_btcUsd.BuyingPowerModel.GetMaintenanceMargin(_btcUsd) != marginUsed)\n                    {\n                        throw new RegressionTestException($\"Unexpected margin used {marginUsed}\");\n                    }\n\n                    Buy(_btcUsdt.Symbol, 0.01);\n\n                    marginUsed = Portfolio.TotalMarginUsed - marginUsed;\n                    var btcUsdtHoldings = _btcUsdt.Holdings;\n\n                    // USDT futures value is based on it's price\n                    var holdingsValueUsdt = _btcUsdt.Price * _btcUsdt.SymbolProperties.ContractMultiplier * 0.01m;\n\n                    if (Math.Abs(btcUsdtHoldings.TotalSaleVolume - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalSaleVolume {btcUsdtHoldings.TotalSaleVolume}\");\n                    }\n                    if (Math.Abs(btcUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected holdings cost {btcUsdtHoldings.HoldingsCost}\");\n                    }\n                    if (_btcUsdt.BuyingPowerModel.GetMaintenanceMargin(_btcUsdt) != marginUsed)\n                    {\n                        throw new RegressionTestException($\"Unexpected margin used {marginUsed}\");\n                    }\n\n                    // position just opened should be just spread here\n                    var unrealizedProfit = Portfolio.TotalUnrealizedProfit;\n                    if ((5 - Math.Abs(unrealizedProfit)) < 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                    }\n\n                    if (Portfolio.TotalProfit != 0)\n                    {\n                        throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                    }\n                }\n            }\n            // let's revert our position\n            else if (Transactions.OrdersCount == 3)\n            {\n                Sell(_btcUsd.Symbol, 300);\n\n                var btcUsdHoldings = _btcUsd.Holdings;\n\n                if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - 100 * 2) > 1)\n                {\n                    throw new RegressionTestException($\"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}\");\n                }\n\n                Sell(_btcUsdt.Symbol, 0.03);\n\n                var btcUsdtHoldings = _btcUsdt.Holdings;\n\n                // USDT futures value is based on it's price\n                var holdingsValueUsdt = _btcUsdt.Price * _btcUsdt.SymbolProperties.ContractMultiplier * 0.02m;\n\n                if (Math.Abs(btcUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)\n                {\n                    throw new RegressionTestException($\"Unexpected holdings cost {btcUsdtHoldings.HoldingsCost}\");\n                }\n\n                // position just opened should be just spread here\n                var profit = Portfolio.TotalUnrealizedProfit;\n                if ((5 - Math.Abs(profit)) < 0)\n                {\n                    throw new RegressionTestException($\"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}\");\n                }\n                // we barely did any difference on the previous trade\n                if ((5 - Math.Abs(Portfolio.TotalProfit)) < 0)\n                {\n                    throw new RegressionTestException($\"Unexpected TotalProfit {Portfolio.TotalProfit}\");\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"{Time} - TotalPortfolioValue: {Portfolio.TotalPortfolioValue}\");\n            Log($\"{Time} - CashBook: {Portfolio.CashBook}\");\n\n            if (_interestPerSymbol.Any(kvp => kvp.Value == 0))\n            {\n                throw new RegressionTestException(\"Expected interest rate data for all symbols\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8625;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100285.85\"},\n            {\"End Equity\", \"100285.26\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.60\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT 2V3\"},\n            {\"Portfolio Turnover\", \"1.08%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0157a5c7c2c8a8c13e984b72721aa0ca\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected\n    /// </summary>\n    public class BybitCryptoRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _btcUsdt;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        private bool _liquidated;\n\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 13);\n\n            // Set account currency (USDT)\n            SetAccountCurrency(\"USDT\");\n\n            // Set strategy cash (USD)\n            SetCash(100000);\n\n            // Add some coin as initial holdings\n            // When connected to a real brokerage, the amount specified in SetCash\n            // will be replaced with the amount in your actual account.\n            SetCash(\"BTC\", 1m);\n\n            SetBrokerageModel(BrokerageName.Bybit, AccountType.Cash);\n\n            _btcUsdt = AddCrypto(\"BTCUSDT\").Symbol;\n\n            // create two moving averages\n            _fast = EMA(_btcUsdt, 30, Resolution.Minute);\n            _slow = EMA(_btcUsdt, 60, Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.CashBook[\"USDT\"].ConversionRate == 0 || Portfolio.CashBook[\"BTC\"].ConversionRate == 0)\n            {\n                Log($\"USDT conversion rate: {Portfolio.CashBook[\"USDT\"].ConversionRate}\");\n                Log($\"BTC conversion rate: {Portfolio.CashBook[\"BTC\"].ConversionRate}\");\n\n                throw new RegressionTestException(\"Conversion rate is 0\");\n            }\n\n            if (!_slow.IsReady)\n            {\n                return;\n            }\n\n\n            var btcAmount = Portfolio.CashBook[\"BTC\"].Amount;\n            if (_fast > _slow)\n            {\n                if (btcAmount == 1m && !_liquidated)\n                {\n                    Buy(_btcUsdt, 1);\n                }\n            }\n            else\n            {\n                if (btcAmount > 1m)\n                {\n                    Liquidate(_btcUsdt);\n                    _liquidated = true;\n                }\n                else if (btcAmount > 0 && _liquidated && Transactions.GetOpenOrders().Count == 0)\n                {\n                    // Place a limit order to sell our initial BTC holdings at 1% above the current price\n                    var limitPrice = Math.Round(Securities[_btcUsdt].Price * 1.01m, 2);\n                    LimitOrder(_btcUsdt, -btcAmount, limitPrice);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"{Time} - TotalPortfolioValue: {Portfolio.TotalPortfolioValue}\");\n            Log($\"{Time} - CashBook: {Portfolio.CashBook}\");\n\n            var btcAmount = Portfolio.CashBook[\"BTC\"].Amount;\n            if (btcAmount > 0)\n            {\n                throw new RegressionTestException($\"BTC holdings should be zero at the end of the algorithm, but was {btcAmount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2883;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"117170.74\"},\n            {\"End Equity\", \"117244.52\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₮51.65\"},\n            {\"Estimated Strategy Capacity\", \"₮560000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT 2UZ\"},\n            {\"Portfolio Turnover\", \"44.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"47580e88a8cc54b04f3b2bcb5d501150\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/BybitCustomDataCryptoRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.IO;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected with custom data types\n    /// </summary>\n    public class BybitCustomDataCryptoRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _btcUsdt;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 13);\n\n            SetAccountCurrency(\"USDT\");\n            SetCash(100000);\n\n            SetBrokerageModel(BrokerageName.Bybit, AccountType.Cash);\n\n            var symbol = AddCrypto(\"BTCUSDT\").Symbol;\n            _btcUsdt = AddData<CustomCryptoData>(symbol, Resolution.Minute).Symbol;\n\n            // create two moving averages\n            _fast = EMA(_btcUsdt, 30, Resolution.Minute);\n            _slow = EMA(_btcUsdt, 60, Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_slow.IsReady)\n            {\n                return;\n            }\n\n            if (_fast > _slow)\n            {\n                if (Transactions.OrdersCount == 0)\n                {\n                    Buy(_btcUsdt, 1);\n                }\n            }\n            else\n            {\n                if (Transactions.OrdersCount == 1)\n                {\n                    Liquidate(_btcUsdt);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        public class CustomCryptoData : BaseData\n        {\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n            public decimal Volume { get; set; }\n\n            public override DateTime EndTime\n            {\n                get { return Time + Period; }\n                set { Time = value - Period; }\n            }\n\n            public TimeSpan Period\n            {\n                get { return QuantConnect.Time.OneMinute; }\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var tickTypeString = config.TickType.TickTypeToLower();\n                var formattedDate = date.ToStringInvariant(DateFormat.EightCharacter);\n                var source = Path.Combine(Globals.DataFolder, \"crypto\", \"bybit\", config.Resolution.ToString().ToLower(),\n                    config.Symbol.Value.ToLower(), $\"{formattedDate}_{tickTypeString}.zip\");\n\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.ToCsv(6);\n\n                var data = new CustomCryptoData\n                {\n                    Symbol = config.Symbol,\n                    Time = date.Date.AddMilliseconds(csv[0].ToInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone),\n                    Open = csv[1].ToDecimal(),\n                    High = csv[2].ToDecimal(),\n                    Low = csv[3].ToDecimal(),\n                    Close = csv[4].ToDecimal(),\n                    Volume = csv[5].ToDecimal(),\n                    Value = csv[4].ToDecimal()\n                };\n\n                return data;\n            }\n        }\n\n        /// <summary\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4324;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"99981.72\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₮0.00\"},\n            {\"Estimated Strategy Capacity\", \"₮0\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT.CustomCryptoData 2US\"},\n            {\"Portfolio Turnover\", \"34.30%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"52ddb7dfcaaf1ea4f70cc614c49f0cd0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CallbackCommandRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Commands;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of different callback commands call\n    /// </summary>\n    public class CallbackCommandRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\");\n            AddEquity(\"BAC\");\n            AddEquity(\"IBM\");\n            AddCommand<BoolCommand>();\n            AddCommand<VoidCommand>();\n\n            var potentialCommand = new VoidCommand\n            {\n                Target = new[] { \"BAC\" },\n                Quantity = 10,\n                Parameters = new() { { \"tag\", \"Signal X\" } }\n            };\n            var commandLink = Link(potentialCommand);\n            Notify.Email(\"email@address\", \"Trade Command Event\", $\"Signal X trade\\nFollow link to trigger: {commandLink}\");\n\n            var commandLink2 = Link(new { Symbol = \"SPY\", Parameters = new Dictionary<string, int>() { { \"Quantity\", 10 } } });\n            Notify.Email(\"email@address\", \"Untyped Command Event\", $\"Signal Y trade\\nFollow link to trigger: {commandLink2}\");\n\n            // We need to create a project on QuantConnect to test the BroadcastCommand method\n            // and use the ProjectId in the BroadcastCommand call\n            ProjectId = 21805137;\n\n            // All live deployments receive the broadcasts below\n            var broadcastResult = BroadcastCommand(potentialCommand);\n            var broadcastResult2 = BroadcastCommand(new { Symbol = \"SPY\", Parameters = new Dictionary<string, int>() { { \"Quantity\", 10 } } });\n        }\n\n        /// <summary>\n        /// Handle generic command callback\n        /// </summary>\n        public override bool? OnCommand(dynamic data)\n        {\n            Buy(data.Symbol, data.parameters[\"quantity\"]);\n            return true;\n        }\n\n        private class VoidCommand : Command\n        {\n            public DateTime TargetTime { get; set; }\n            public string[] Target { get; set; }\n            public decimal Quantity { get; set; }\n            public Dictionary<string, string> Parameters { get; set; }\n            public override bool? Run(IAlgorithm algorithm)\n            {\n                if (TargetTime != algorithm.Time)\n                {\n                    return null;\n                }\n\n                ((QCAlgorithm)algorithm).Order(Target[0], Quantity, tag: Parameters[\"tag\"]);\n                return null;\n            }\n        }\n        private class BoolCommand : Command\n        {\n            public bool? Result { get; set; }\n            public override bool? Run(IAlgorithm algorithm)\n            {\n                var shouldTrade = MyCustomMethod();\n                if (shouldTrade.HasValue && shouldTrade.Value)\n                {\n                    ((QCAlgorithm)algorithm).Buy(\"IBM\", 1);\n                }\n                return shouldTrade;\n            }\n\n            private bool? MyCustomMethod()\n            {\n                return Result;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CanLiquidateWithOrderPropertiesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test we can liquidate our portfolio holdings using order properties\n    /// </summary>\n    public class CanLiquidateWithOrderPropertiesRegressionAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly DateTime _openExchange = new (2014, 6, 6, 10, 0, 0);\n        private readonly DateTime _closeExchange = new(2014, 6, 6, 16, 0, 0);\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 6);\n\n            AddEquity(\"AAPL\", Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time > _openExchange && Time < _closeExchange)\n            {\n                if (!Portfolio.Invested)\n                {\n                    MarketOrder(\"AAPL\", 10);\n                }\n                else\n                {\n                    var orderProperties = new OrderProperties() { TimeInForce = TimeInForce.Day };\n                    var tickets = Liquidate(asynchronous: true, orderProperties: orderProperties);\n                    foreach (var ticket in tickets)\n                    {\n                        if (ticket.SubmitRequest.OrderProperties.TimeInForce != TimeInForce.Day)\n                        {\n                            throw new RegressionTestException(\"The TimeInForce for all orders should be daily, but it was {ticket.SubmitRequest.OrderProperties.TimeInForce}\");\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1583;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"359\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99637.08\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$359.00\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"37.56%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e9e8a07dc58bff7198181f9fafb58834\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CancelOpenOrdersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a regression test case for CancelOpenOrders and rejected orders\n    /// </summary>\n    public class CancelOpenOrdersRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2017, 9, 3);  //Set Start Date\n            SetEndDate(2017, 9, 3);    //Set End Date\n            SetCash(1000);             //Set Strategy Cash\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            AddCrypto(\"BTCUSD\");\n            AddCrypto(\"ETHUSD\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (UtcTime.Hour != 6) return;\n\n            if (UtcTime.Minute == 0)\n            {\n                // this order will be rejected for insufficient funds\n                LimitOrder(\"BTCUSD\", 100m, 4734.64m);\n                LimitOrder(\"ETHUSD\", 1.35505027m, 368.8m);\n            }\n            else if (UtcTime.Minute == 6)\n            {\n                Transactions.CancelOpenOrders(\"BTCUSD\");\n                LimitOrder(\"BTCUSD\", 0.10576312m, 4727.61m);\n            }\n            else if (UtcTime.Minute == 12)\n            {\n                Transactions.CancelOpenOrders(\"BTCUSD\");\n                LimitOrder(\"BTCUSD\", 0.10576267m, 4727.63m);\n            }\n            else if (UtcTime.Minute == 18)\n            {\n                Transactions.CancelOpenOrders(\"BTCUSD\");\n                LimitOrder(\"BTCUSD\", 0.10547724m, 4740.42m);\n            }\n            else if (UtcTime.Minute == 24)\n            {\n                Transactions.CancelOpenOrders(\"BTCUSD\");\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            const int expectedOrders = 5;\n            var expectedStatus = new[] { OrderStatus.Invalid, OrderStatus.Filled, OrderStatus.Canceled, OrderStatus.Canceled, OrderStatus.Filled };\n\n            var orders = Transactions.GetOrders(x => true).ToList();\n\n            if (orders.Count != expectedOrders)\n            {\n                throw new RegressionTestException($\"Expected orders: {expectedOrders}, actual orders: {orders.Count}\");\n            }\n\n            for (var i = 0; i < expectedOrders; i++)\n            {\n                var order = orders[i];\n                if (order.Status != expectedStatus[i])\n                {\n                    throw new RegressionTestException($\"Invalid status for order {order.Id}, Expected: {expectedStatus[i]}, actual: {order.Status}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5765;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000.00\"},\n            {\"End Equity\", \"955.69\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$370000.00\"},\n            {\"Lowest Capacity Asset\", \"ETHUSD 2XR\"},\n            {\"Portfolio Turnover\", \"104.59%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5277847166fcd10cde634e3986e1d285\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/BeastVsPenny.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests capacity by trading SPY (beast) alongside a small cap stock ABUS (penny)\n    /// </summary>\n    public class BeastVsPenny : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 3, 31);\n            SetCash(10000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            var penny = AddEquity(\"ABUS\", Resolution.Hour).Symbol;\n\n            Schedule.On(DateRules.EveryDay(_spy), TimeRules.AfterMarketOpen(_spy, 1, false), () =>\n            {\n                SetHoldings(_spy, 0.5m);\n                SetHoldings(penny, 0.5m);\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"70\"},\n            {\"Average Win\", \"0.07%\"},\n            {\"Average Loss\", \"-0.51%\"},\n            {\"Compounding Annual Return\", \"-89.548%\"},\n            {\"Drawdown\", \"49.900%\"},\n            {\"Expectancy\", \"-0.514\"},\n            {\"Net Profit\", \"-42.920%\"},\n            {\"Sharpe Ratio\", \"-0.797\"},\n            {\"Probabilistic Sharpe Ratio\", \"9.019%\"},\n            {\"Loss Rate\", \"57%\"},\n            {\"Win Rate\", \"43%\"},\n            {\"Profit-Loss Ratio\", \"0.13\"},\n            {\"Alpha\", \"-0.24\"},\n            {\"Beta\", \"1.101\"},\n            {\"Annual Standard Deviation\", \"1.031\"},\n            {\"Annual Variance\", \"1.063\"},\n            {\"Information Ratio\", \"-0.351\"},\n            {\"Tracking Error\", \"0.836\"},\n            {\"Treynor Ratio\", \"-0.747\"},\n            {\"Total Fees\", \"$81.45\"},\n            {\"Estimated Strategy Capacity\", \"$21000.00\"},\n            {\"Fitness Score\", \"0.01\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-1.284\"},\n            {\"Return Over Maximum Drawdown\", \"-1.789\"},\n            {\"Portfolio Turnover\", \"0.038\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"67c9083f604ed16fb68481e7c26878dc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests an illiquid asset that has bursts of liquidity around 11:00 A.M. Central Time\n    /// with an hourly in and out strategy.\n    /// </summary>\n    public class CheeseMilkHourlyRebalance : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private Symbol _contract;\n        private DateTime _lastTrade;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 2, 17);\n            SetTimeZone(TimeZones.Chicago);\n            SetCash(100000);\n            SetWarmup(1000);\n\n            var dc = AddFuture(\"DC\", Resolution.Minute, Market.CME);\n            dc.SetFilter(0, 10000);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var contract = slice.FutureChains.Values.SelectMany(c => c.Contracts.Values)\n                .OrderBy(c => c.Symbol.ID.Date)\n                .FirstOrDefault()?\n                .Symbol;\n\n            if (contract == null)\n            {\n                return;\n            }\n\n            if (_contract != contract || (_fast == null && _slow == null))\n            {\n                _fast = EMA(contract, 600);\n                _slow = EMA(contract, 1200);\n                _contract = contract;\n            }\n\n            if (!_fast.IsReady || !_slow.IsReady)\n            {\n                return;\n            }\n\n            if (Time - _lastTrade <= TimeSpan.FromHours(1) || Time.TimeOfDay <= new TimeSpan(10, 50, 0) || Time.TimeOfDay >= new TimeSpan(12, 30, 0))\n            {\n                return;\n            }\n\n            if (!Portfolio.ContainsKey(contract) || (Portfolio[contract].Quantity <= 0 && _fast > _slow))\n            {\n                SetHoldings(contract, 0.5);\n                _lastTrade = Time;\n            }\n            else if (Portfolio.ContainsKey(contract) && Portfolio[contract].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(contract, -0.5);\n                _lastTrade = Time;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"19\"},\n            {\"Average Win\", \"39.16%\"},\n            {\"Average Loss\", \"-8.81%\"},\n            {\"Compounding Annual Return\", \"-99.857%\"},\n            {\"Drawdown\", \"82.900%\"},\n            {\"Expectancy\", \"-0.359\"},\n            {\"Net Profit\", \"-57.725%\"},\n            {\"Sharpe Ratio\", \"-0.555\"},\n            {\"Probabilistic Sharpe Ratio\", \"10.606%\"},\n            {\"Loss Rate\", \"88%\"},\n            {\"Win Rate\", \"12%\"},\n            {\"Profit-Loss Ratio\", \"4.45\"},\n            {\"Alpha\", \"-1.188\"},\n            {\"Beta\", \"0.603\"},\n            {\"Annual Standard Deviation\", \"1.754\"},\n            {\"Annual Variance\", \"3.075\"},\n            {\"Information Ratio\", \"-0.759\"},\n            {\"Tracking Error\", \"1.753\"},\n            {\"Treynor Ratio\", \"-1.612\"},\n            {\"Total Fees\", \"$2558.55\"},\n            {\"Estimated Strategy Capacity\", \"$20000.00\"},\n            {\"Fitness Score\", \"0.351\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-0.602\"},\n            {\"Return Over Maximum Drawdown\", \"-1.415\"},\n            {\"Portfolio Turnover\", \"14.226\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"4f5fd2fb25e957bd0cb7cb6d275ddb97\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/EmaPortfolioRebalance100.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests a wide variety of liquid and illiquid stocks together, with bins\n    /// of 20 ranging from micro-cap to mega-cap stocks.\n    /// </summary>\n    public class EmaPortfolioRebalance100 : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<SymbolData> _data;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 2, 5);\n            SetWarmup(1000);\n            SetCash(100000);\n\n            _data = new List<SymbolData> {\n                new SymbolData(this, AddEquity(\"AADR\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAMC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAU\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ABDC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ABIO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ABUS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACER\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACES\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACGLO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACH\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACHV\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACIO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACIU\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACNB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACRS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACSI\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACT\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACT\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACTG\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZYNE\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZYME\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZUO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZUMZ\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZTR\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZSL\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZSAN\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZROZ\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZLAB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZIXI\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZIV\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZIOP\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZGNX\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZG\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZEUS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZAGG\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"YYY\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"YRD\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"YRCW\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"YPF\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AA\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAN\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAP\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAXN\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ABB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ABC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACAD\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACGL\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACIW\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACWV\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ACWX\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ADM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ADPT\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ADS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ADUS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AEM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AEO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AEP\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ZTS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"YUM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLY\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLV\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLRE\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLP\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLNX\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLF\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XLB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XEL\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"XBI\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"X\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WYNN\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WW\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WORK\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WMB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WELL\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"WEC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AAPL\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"ADBE\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AGG\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AMD\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"AMZN\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"BA\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"BABA\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"BAC\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"BMY\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"C\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"CMCSA\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"CRM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"CSCO\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"DIS\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"EEM\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"EFA\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"FB\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"GDX\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"GE\", Resolution.Minute).Symbol),\n                new SymbolData(this, AddEquity(\"SPY\", Resolution.Minute).Symbol)\n            };\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var fastFactor = 0.005m;\n\n            foreach (var sd in _data)\n            {\n                if (!Portfolio.Invested && sd.Fast * (1 + fastFactor) > sd.Slow)\n                {\n                    SetHoldings(sd.Symbol, 0.01);\n                }\n                else if (Portfolio.Invested && sd.Fast * (1 - fastFactor) < sd.Slow)\n                {\n                    Liquidate(sd.Symbol);\n                }\n            }\n        }\n\n        public class SymbolData\n        {\n            public Symbol Symbol { get; set; }\n            public ExponentialMovingAverage Fast { get; set; }\n            public ExponentialMovingAverage Slow { get; set; }\n            public bool IsCrossed => Fast > Slow;\n\n            public SymbolData(QCAlgorithm algorithm, Symbol symbol) {\n                Symbol = symbol;\n                Fast = algorithm.EMA(symbol, 20);\n                Slow = algorithm.EMA(symbol, 300);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1015\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-12.674%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"-0.761\"},\n            {\"Net Profit\", \"-1.328%\"},\n            {\"Sharpe Ratio\", \"-12.258\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"95%\"},\n            {\"Win Rate\", \"5%\"},\n            {\"Profit-Loss Ratio\", \"3.67\"},\n            {\"Alpha\", \"-0.142\"},\n            {\"Beta\", \"0.038\"},\n            {\"Annual Standard Deviation\", \"0.01\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-4.389\"},\n            {\"Tracking Error\", \"0.123\"},\n            {\"Treynor Ratio\", \"-3.359\"},\n            {\"Total Fees\", \"$1125.52\"},\n            {\"Estimated Strategy Capacity\", \"$300.00\"},\n            {\"Fitness Score\", \"0.007\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-14.315\"},\n            {\"Return Over Maximum Drawdown\", \"-9.589\"},\n            {\"Portfolio Turnover\", \"0.406\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"4c165e8d648d54a85bb7b564050a6f85\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalping.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps SPY using an EMA cross strategy at minute resolution.\n    /// This tests equity strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result.\n    /// </summary>\n    public class IntradayMinuteScalping : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 1, 30);\n            SetCash(100000);\n            SetWarmup(100);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            _fast = EMA(_spy, 20);\n            _slow = EMA(_spy, 40);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio[_spy].Quantity <= 0 && _fast > _slow)\n            {\n                SetHoldings(_spy, 1);\n            }\n            else if (Portfolio[_spy].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(_spy, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"150\"},\n            {\"Average Win\", \"0.16%\"},\n            {\"Average Loss\", \"-0.11%\"},\n            {\"Compounding Annual Return\", \"-19.320%\"},\n            {\"Drawdown\", \"3.900%\"},\n            {\"Expectancy\", \"-0.193\"},\n            {\"Net Profit\", \"-1.730%\"},\n            {\"Sharpe Ratio\", \"-1.606\"},\n            {\"Probabilistic Sharpe Ratio\", \"21.397%\"},\n            {\"Loss Rate\", \"67%\"},\n            {\"Win Rate\", \"33%\"},\n            {\"Profit-Loss Ratio\", \"1.45\"},\n            {\"Alpha\", \"-0.357\"},\n            {\"Beta\", \"0.635\"},\n            {\"Annual Standard Deviation\", \"0.119\"},\n            {\"Annual Variance\", \"0.014\"},\n            {\"Information Ratio\", \"-4.249\"},\n            {\"Tracking Error\", \"0.106\"},\n            {\"Treynor Ratio\", \"-0.302\"},\n            {\"Total Fees\", \"$449.14\"},\n            {\"Estimated Strategy Capacity\", \"$27000000.00\"},\n            {\"Fitness Score\", \"0.088\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-3.259\"},\n            {\"Return Over Maximum Drawdown\", \"-7.992\"},\n            {\"Portfolio Turnover\", \"14.605\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"f5a0e9547f7455004fa6c3eb136534e9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingBTCETH.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps BTCETH using an EMA cross strategy at minute resolution.\n    /// This tests crypto strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result. This also tests\n    /// that currency conversions are handled properly in the strategy capacity\n    /// calculation class.\n    /// </summary>\n    public class IntradayMinuteScalpingBTCETH : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _ethbtc;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 30);\n            SetCash(100000);\n            SetWarmup(100);\n\n            var ethbtc = AddCrypto(\"ETHBTC\", Resolution.Minute, Market.GDAX);\n            ethbtc.BuyingPowerModel = new BuyingPowerModel();\n            _ethbtc = ethbtc.Symbol;\n\n            _fast = EMA(_ethbtc, 20);\n            _slow = EMA(_ethbtc, 40);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio[_ethbtc].Quantity <= 0 && _fast > _slow)\n            {\n                SetHoldings(_ethbtc, 1);\n            }\n            else if (Portfolio[_ethbtc].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(_ethbtc, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1005\"},\n            {\"Average Win\", \"0.96%\"},\n            {\"Average Loss\", \"-0.33%\"},\n            {\"Compounding Annual Return\", \"76.267%\"},\n            {\"Drawdown\", \"77.100%\"},\n            {\"Expectancy\", \"-0.012\"},\n            {\"Net Profit\", \"4.768%\"},\n            {\"Sharpe Ratio\", \"1.01909630017278E+24\"},\n            {\"Probabilistic Sharpe Ratio\", \"93.814%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"2.95\"},\n            {\"Alpha\", \"1.3466330963256E+25\"},\n            {\"Beta\", \"25.59\"},\n            {\"Annual Standard Deviation\", \"13.214\"},\n            {\"Annual Variance\", \"174.61\"},\n            {\"Information Ratio\", \"1.02164274756513E+24\"},\n            {\"Tracking Error\", \"13.181\"},\n            {\"Treynor Ratio\", \"5.2622435344112E+23\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Fitness Score\", \"0.38\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-0.239\"},\n            {\"Return Over Maximum Drawdown\", \"-1.385\"},\n            {\"Portfolio Turnover\", \"81.433\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"6a779e7a8d12b4808845c75b88d43b3a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingEURUSD.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps EURUSD using an EMA cross strategy at minute resolution.\n    /// This tests FOREX strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result.\n    /// </summary>\n    public class IntradayMinuteScalpingEURUSD : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _eurusd;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 30);\n            SetCash(100000);\n            SetWarmup(100);\n\n            _eurusd = AddForex(\"EURUSD\", Resolution.Minute, Market.Oanda).Symbol;\n            _fast = EMA(_eurusd, 20);\n            _slow = EMA(_eurusd, 40);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio[_eurusd].Quantity <= 0 && _fast > _slow)\n            {\n                SetHoldings(_eurusd, 1);\n            }\n            else if (Portfolio[_eurusd].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(_eurusd, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"671\"},\n            {\"Average Win\", \"0.07%\"},\n            {\"Average Loss\", \"-0.04%\"},\n            {\"Compounding Annual Return\", \"-80.820%\"},\n            {\"Drawdown\", \"12.200%\"},\n            {\"Expectancy\", \"-0.447\"},\n            {\"Net Profit\", \"-12.180%\"},\n            {\"Sharpe Ratio\", \"-13.121\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"79%\"},\n            {\"Win Rate\", \"21%\"},\n            {\"Profit-Loss Ratio\", \"1.61\"},\n            {\"Alpha\", \"-0.746\"},\n            {\"Beta\", \"-0.02\"},\n            {\"Annual Standard Deviation\", \"0.057\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-4.046\"},\n            {\"Tracking Error\", \"0.161\"},\n            {\"Treynor Ratio\", \"37.346\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$44000000.00\"},\n            {\"Fitness Score\", \"0.025\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-16.609\"},\n            {\"Return Over Maximum Drawdown\", \"-7.115\"},\n            {\"Portfolio Turnover\", \"52.476\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"74ee44736b9300c0262dc75c0cd140e1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingFuturesES.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps ES futures contracts (E-mini SP500) using an EMA cross strategy at minute resolution.\n    /// This tests futures strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result.\n    /// </summary>\n    /// <remarks>\n    /// The insanely high capacity estimate of this strategy is realistic.\n    /// ES notional contract value traded is around $600 Billion USD per day (!!!), which\n    /// is what the capacity is set to.\n    /// </remarks>\n    public class IntradayMinuteScalpingFuturesES : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private Symbol _contract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n            SetWarmup(1000);\n\n            var a = AddFuture(\"ES\", Resolution.Minute, Market.CME);\n            a.SetFilter(0, 10000);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var contract = slice.FutureChains.Values.SelectMany(c => c.Contracts.Values)\n                .OrderBy(c => c.Symbol.ID.Date)\n                .FirstOrDefault()?\n                .Symbol;\n\n            if (contract == null)\n            {\n                return;\n            }\n\n            if (_contract != contract || (_fast == null && _slow == null))\n            {\n                _fast = EMA(contract, 10);\n                _slow = EMA(contract, 20);\n                _contract = contract;\n            }\n\n            if (!_fast.IsReady || !_slow.IsReady)\n            {\n                return;\n            }\n\n            if (!Portfolio.ContainsKey(contract) || (Portfolio[contract].Quantity <= 0 && _fast > _slow))\n            {\n                SetHoldings(contract, 1);\n            }\n            else if (Portfolio.ContainsKey(contract) && Portfolio[contract].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(contract, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1217\"},\n            {\"Average Win\", \"2.69%\"},\n            {\"Average Loss\", \"-0.93%\"},\n            {\"Compounding Annual Return\", \"-99.756%\"},\n            {\"Drawdown\", \"77.200%\"},\n            {\"Expectancy\", \"-0.047\"},\n            {\"Net Profit\", \"-40.013%\"},\n            {\"Sharpe Ratio\", \"-0.52\"},\n            {\"Probabilistic Sharpe Ratio\", \"19.865%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"2.88\"},\n            {\"Alpha\", \"-1.279\"},\n            {\"Beta\", \"-3.686\"},\n            {\"Annual Standard Deviation\", \"1.85\"},\n            {\"Annual Variance\", \"3.422\"},\n            {\"Information Ratio\", \"-0.463\"},\n            {\"Tracking Error\", \"1.895\"},\n            {\"Treynor Ratio\", \"0.261\"},\n            {\"Total Fees\", \"$19843.10\"},\n            {\"Estimated Strategy Capacity\", \"$560000000.00\"},\n            {\"Fitness Score\", \"0.334\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-0.837\"},\n            {\"Return Over Maximum Drawdown\", \"-1.402\"},\n            {\"Portfolio Turnover\", \"1174.125\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"f353843132df7b0604eff3a37b134ca2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingGBPJPY.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps GBPJPY using an EMA cross strategy at minute resolution.\n    /// This tests FOREX strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result. This test also\n    /// tests that currency conversion rates are applied and calculated correctly.\n    /// </summary>\n    public class IntradayMinuteScalpingGBPJPY : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _gbpjpy;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 30);\n            SetCash(100000);\n            SetWarmup(100);\n\n            _gbpjpy = AddForex(\"GBPJPY\", Resolution.Minute, Market.Oanda).Symbol;\n            _fast = EMA(_gbpjpy, 20);\n            _slow = EMA(_gbpjpy, 40);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio[_gbpjpy].Quantity <= 0 && _fast > _slow)\n            {\n                SetHoldings(_gbpjpy, 1);\n            }\n            else if (Portfolio[_gbpjpy].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(_gbpjpy, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"735\"},\n            {\"Average Win\", \"0.08%\"},\n            {\"Average Loss\", \"-0.05%\"},\n            {\"Compounding Annual Return\", \"-93.946%\"},\n            {\"Drawdown\", \"19.900%\"},\n            {\"Expectancy\", \"-0.592\"},\n            {\"Net Profit\", \"-19.794%\"},\n            {\"Sharpe Ratio\", \"-10.054\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"84%\"},\n            {\"Win Rate\", \"16%\"},\n            {\"Profit-Loss Ratio\", \"1.56\"},\n            {\"Alpha\", \"-0.895\"},\n            {\"Beta\", \"0.068\"},\n            {\"Annual Standard Deviation\", \"0.09\"},\n            {\"Annual Variance\", \"0.008\"},\n            {\"Information Ratio\", \"-4.929\"},\n            {\"Tracking Error\", \"0.164\"},\n            {\"Treynor Ratio\", \"-13.276\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$49000000.00\"},\n            {\"Fitness Score\", \"0.049\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-10.846\"},\n            {\"Return Over Maximum Drawdown\", \"-4.904\"},\n            {\"Portfolio Turnover\", \"58.921\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"66f04c9622ab242993c8ce951418e6d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingTRYJPY.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Scalps TRYJPY using an EMA cross strategy at minute resolution.\n    /// This tests FOREX strategies that trade at a higher frequency, which\n    /// should have a reduced capacity estimate as a result. This tests that\n    /// currency conversions are applied properly to the capacity estimate calculation.\n    /// </summary>\n    public class IntradayMinuteScalpingTRYJPY : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _tryjpy;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 30);\n            SetCash(100000);\n            SetWarmup(100);\n\n            _tryjpy = AddForex(\"TRYJPY\", Resolution.Minute, Market.Oanda).Symbol;\n            _fast = EMA(_tryjpy, 20);\n            _slow = EMA(_tryjpy, 40);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio[_tryjpy].Quantity <= 0 && _fast > _slow)\n            {\n                SetHoldings(_tryjpy, 1);\n            }\n            else if (Portfolio[_tryjpy].Quantity >= 0 && _fast < _slow)\n            {\n                SetHoldings(_tryjpy, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"603\"},\n            {\"Average Win\", \"0.20%\"},\n            {\"Average Loss\", \"-0.26%\"},\n            {\"Compounding Annual Return\", \"-100.000%\"},\n            {\"Drawdown\", \"73.200%\"},\n            {\"Expectancy\", \"-0.849\"},\n            {\"Net Profit\", \"-73.118%\"},\n            {\"Sharpe Ratio\", \"-2.046\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"91%\"},\n            {\"Win Rate\", \"9%\"},\n            {\"Profit-Loss Ratio\", \"0.75\"},\n            {\"Alpha\", \"-0.95\"},\n            {\"Beta\", \"0.541\"},\n            {\"Annual Standard Deviation\", \"0.489\"},\n            {\"Annual Variance\", \"0.239\"},\n            {\"Information Ratio\", \"-1.863\"},\n            {\"Tracking Error\", \"0.487\"},\n            {\"Treynor Ratio\", \"-1.849\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$4400000.00\"},\n            {\"Fitness Score\", \"0.259\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-2.135\"},\n            {\"Return Over Maximum Drawdown\", \"-1.389\"},\n            {\"Portfolio Turnover\", \"49.501\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"4eb4d703a9f200b6bb3d8b0ebbc9db7f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/MonthlyRebalanceDaily.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Rebalances ultra-liquid stocks monthly, testing\n    /// bursts of orders centered around the start of the month at Daily resolution\n    /// </summary>\n    public class MonthlyRebalanceDaily : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2019, 12, 31);\n            SetEndDate(2020, 4, 5);\n            SetCash(100000);\n\n            var spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            AddEquity(\"GE\", Resolution.Daily);\n            AddEquity(\"FB\", Resolution.Daily);\n            AddEquity(\"DIS\", Resolution.Daily);\n            AddEquity(\"CSCO\", Resolution.Daily);\n            AddEquity(\"CRM\", Resolution.Daily);\n            AddEquity(\"C\", Resolution.Daily);\n            AddEquity(\"BAC\", Resolution.Daily);\n            AddEquity(\"BABA\", Resolution.Daily);\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            Schedule.On(DateRules.MonthStart(spy), TimeRules.Noon, () =>\n            {\n                foreach (var symbol in Securities.Keys)\n                {\n                    SetHoldings(symbol, 0.10);\n                }\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"35\"},\n            {\"Average Win\", \"0.07%\"},\n            {\"Average Loss\", \"-0.07%\"},\n            {\"Compounding Annual Return\", \"-68.407%\"},\n            {\"Drawdown\", \"32.400%\"},\n            {\"Expectancy\", \"-0.309\"},\n            {\"Net Profit\", \"-25.901%\"},\n            {\"Sharpe Ratio\", \"-1.503\"},\n            {\"Probabilistic Sharpe Ratio\", \"2.878%\"},\n            {\"Loss Rate\", \"64%\"},\n            {\"Win Rate\", \"36%\"},\n            {\"Profit-Loss Ratio\", \"0.90\"},\n            {\"Alpha\", \"-0.7\"},\n            {\"Beta\", \"-0.238\"},\n            {\"Annual Standard Deviation\", \"0.386\"},\n            {\"Annual Variance\", \"0.149\"},\n            {\"Information Ratio\", \"-0.11\"},\n            {\"Tracking Error\", \"0.712\"},\n            {\"Treynor Ratio\", \"2.442\"},\n            {\"Total Fees\", \"$38.99\"},\n            {\"Estimated Strategy Capacity\", \"$19000000.00\"},\n            {\"Fitness Score\", \"0.003\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-2.021\"},\n            {\"Return Over Maximum Drawdown\", \"-2.113\"},\n            {\"Portfolio Turnover\", \"0.014\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"76d8164a3c0d4a7d45e94367c4ba5be1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/MonthlyRebalanceHourly.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Rebalances ultra-liquid stocks monthly, testing\n    /// bursts of orders centered around the start of the month at Hourly resolution\n    /// </summary>\n    public class MonthlyRebalanceHourly : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2019, 12, 31);\n            SetEndDate(2020, 4, 5);\n            SetCash(100000);\n\n            var spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            AddEquity(\"GE\", Resolution.Hour);\n            AddEquity(\"FB\", Resolution.Hour);\n            AddEquity(\"DIS\", Resolution.Hour);\n            AddEquity(\"CSCO\", Resolution.Hour);\n            AddEquity(\"CRM\", Resolution.Hour);\n            AddEquity(\"C\", Resolution.Hour);\n            AddEquity(\"BAC\", Resolution.Hour);\n            AddEquity(\"BABA\", Resolution.Hour);\n            AddEquity(\"AAPL\", Resolution.Hour);\n\n            Schedule.On(DateRules.MonthStart(spy), TimeRules.Noon, () =>\n            {\n                foreach (var symbol in Securities.Keys)\n                {\n                    SetHoldings(symbol, 0.10);\n                }\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"35\"},\n            {\"Average Win\", \"0.05%\"},\n            {\"Average Loss\", \"-0.10%\"},\n            {\"Compounding Annual Return\", \"-72.444%\"},\n            {\"Drawdown\", \"36.500%\"},\n            {\"Expectancy\", \"-0.449\"},\n            {\"Net Profit\", \"-28.406%\"},\n            {\"Sharpe Ratio\", \"-1.369\"},\n            {\"Probabilistic Sharpe Ratio\", \"4.398%\"},\n            {\"Loss Rate\", \"64%\"},\n            {\"Win Rate\", \"36%\"},\n            {\"Profit-Loss Ratio\", \"0.51\"},\n            {\"Alpha\", \"-0.175\"},\n            {\"Beta\", \"0.892\"},\n            {\"Annual Standard Deviation\", \"0.503\"},\n            {\"Annual Variance\", \"0.253\"},\n            {\"Information Ratio\", \"-0.822\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"-0.772\"},\n            {\"Total Fees\", \"$38.83\"},\n            {\"Estimated Strategy Capacity\", \"$6000000.00\"},\n            {\"Fitness Score\", \"0.004\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-2.033\"},\n            {\"Return Over Maximum Drawdown\", \"-2.079\"},\n            {\"Portfolio Turnover\", \"0.018\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"1de9bcf6cda0945af6ba1f74c4dcb22c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/SplitTestingStrategy.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests that splits do not cause the algorithm to report capacity estimates\n    /// above or below the actual capacity due to splits. The stock HTGM is illiquid,\n    /// trading only $1.2 Million per day on average with sparse trade frequencies.\n    /// </summary>\n    public class SplitTestingStrategy : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _htgm;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 11, 1);\n            SetEndDate(2020, 12, 5);\n            SetCash(100000);\n\n            var htgm = AddEquity(\"HTGM\", Resolution.Hour);\n            htgm.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            _htgm = htgm.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_htgm, 1);\n            }\n            else\n            {\n                SetHoldings(_htgm, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"162\"},\n            {\"Average Win\", \"0.10%\"},\n            {\"Average Loss\", \"-0.35%\"},\n            {\"Compounding Annual Return\", \"-94.432%\"},\n            {\"Drawdown\", \"30.400%\"},\n            {\"Expectancy\", \"-0.564\"},\n            {\"Net Profit\", \"-23.412%\"},\n            {\"Sharpe Ratio\", \"-1.041\"},\n            {\"Probabilistic Sharpe Ratio\", \"12.971%\"},\n            {\"Loss Rate\", \"66%\"},\n            {\"Win Rate\", \"34%\"},\n            {\"Profit-Loss Ratio\", \"0.29\"},\n            {\"Alpha\", \"-4.827\"},\n            {\"Beta\", \"1.43\"},\n            {\"Annual Standard Deviation\", \"0.876\"},\n            {\"Annual Variance\", \"0.767\"},\n            {\"Information Ratio\", \"-4.288\"},\n            {\"Tracking Error\", \"0.851\"},\n            {\"Treynor Ratio\", \"-0.637\"},\n            {\"Total Fees\", \"$2655.91\"},\n            {\"Estimated Strategy Capacity\", \"$11000.00\"},\n            {\"Fitness Score\", \"0.052\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-2.2\"},\n            {\"Return Over Maximum Drawdown\", \"-3.481\"},\n            {\"Portfolio Turnover\", \"0.307\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"54f571c11525656e9b383e235e77002e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapacityTests/SpyBondPortfolioRebalance.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Rebalances between SPY and BND. Tests capacity of the weakest link, which in this\n    /// case is BND, dragging down the capacity estimate.\n    /// </summary>\n    public class SpyBondPortfolioRebalance : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 3, 31);\n            SetCash(10000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            var bnd = AddEquity(\"BND\", Resolution.Hour).Symbol;\n\n            Schedule.On(DateRules.EveryDay(_spy), TimeRules.AfterMarketOpen(_spy, 1, false), () =>\n            {\n                SetHoldings(_spy, 0.5m);\n                SetHoldings(bnd, 0.5m);\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"21\"},\n            {\"Average Win\", \"0.02%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"-33.564%\"},\n            {\"Drawdown\", \"19.700%\"},\n            {\"Expectancy\", \"-0.140\"},\n            {\"Net Profit\", \"-9.655%\"},\n            {\"Sharpe Ratio\", \"-0.99\"},\n            {\"Probabilistic Sharpe Ratio\", \"13.754%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.72\"},\n            {\"Alpha\", \"-0.022\"},\n            {\"Beta\", \"0.538\"},\n            {\"Annual Standard Deviation\", \"0.309\"},\n            {\"Annual Variance\", \"0.096\"},\n            {\"Information Ratio\", \"0.826\"},\n            {\"Tracking Error\", \"0.269\"},\n            {\"Treynor Ratio\", \"-0.569\"},\n            {\"Total Fees\", \"$21.00\"},\n            {\"Estimated Strategy Capacity\", \"$1100000.00\"},\n            {\"Fitness Score\", \"0.005\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"-1.524\"},\n            {\"Return Over Maximum Drawdown\", \"-1.688\"},\n            {\"Portfolio Turnover\", \"0.02\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"95a130426900aaf227a08a5d1c617b2b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CapmAlphaRankingFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing MathNet.Numerics;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// CapmAlphaRankingFrameworkAlgorithm: example of custom scheduled universe selection model\n    /// Universe Selection inspired by https://www.quantconnect.com/tutorials/strategy-library/capm-alpha-ranking-strategy-on-dow-30-companies\n    /// </summary>\n    public class CapmAlphaRankingFrameworkAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2016, 1, 1);   //Set Start Date\n            SetEndDate(2017, 1, 1);     //Set End Date\n            SetCash(100000);            //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new CapmAlphaRankingUniverseSelectionModel());\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n        }\n\n        /// <summary>\n        /// This universe selection model picks stocks with the highest alpha: interception of the linear regression against a benchmark.\n        /// </summary>\n        private class CapmAlphaRankingUniverseSelectionModel : UniverseSelectionModel\n        {\n            private const int period = 21;\n            private const string _benchmark = \"SPY\";\n\n            // Symbols of Dow 30 companies.\n            private readonly IEnumerable<Symbol> _symbols = new[]\n            {\n                \"AAPL\", \"AXP\", \"BA\", \"CAT\", \"CSCO\", \"CVX\", \"DD\", \"DIS\", \"GE\", \"GS\",\n                \"HD\", \"IBM\", \"INTC\", \"JPM\", \"KO\", \"MCD\", \"MMM\", \"MRK\", \"MSFT\",\n                \"NKE\",\"PFE\", \"PG\", \"TRV\", \"UNH\", \"UTX\", \"V\", \"VZ\", \"WMT\", \"XOM\"\n            }.Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA));\n\n            public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n            {\n                // Adds the benchmark to the user defined universe\n                var benchmark = algorithm.AddEquity(_benchmark, Resolution.Daily);\n\n                // Defines a schedule universe that fires after market open when the month starts\n                yield return new ScheduledUniverse(\n                    benchmark.Exchange.TimeZone,\n                    algorithm.DateRules.MonthStart(benchmark.Symbol),\n                    algorithm.TimeRules.AfterMarketOpen(benchmark.Symbol),\n                    datetime => SelectPair(algorithm, datetime),\n                    algorithm.UniverseSettings);\n            }\n\n            /// <summary>\n            /// Selects the pair (two stocks) with the highest alpha\n            /// </summary>\n            private IEnumerable<Symbol> SelectPair(QCAlgorithm algorithm, DateTime dateTime)\n            {\n                var dictionary = new Dictionary<Symbol, double>();\n\n                var benchmark = GetReturns(algorithm, _benchmark);\n\n                foreach (var symbol in _symbols)\n                {\n                    var prices = GetReturns(algorithm, symbol);\n\n                    // Calculate the Least-Square fitting to the returns of a given symbol and the benchmark\n                    var ols = Fit.Line(prices, benchmark);\n\n                    dictionary.Add(symbol, ols.Item1);\n                }\n\n                // Returns the top 2 highest alphas\n                var orderedDictionary = dictionary.OrderByDescending(key => key.Value);\n                return orderedDictionary.Take(2).Select(x => x.Key);\n            }\n\n            private double[] GetReturns(QCAlgorithm algorithm, Symbol symbol)\n            {\n                var window = new RollingWindow<double>(period);\n                var rateOfChange = new RateOfChange(1);\n                rateOfChange.Updated += (s, item) => window.Add((double)item.Value);\n\n                foreach (var bar in algorithm.History(symbol, period, Resolution.Daily))\n                {\n                    rateOfChange.Update(bar.EndTime, bar.Close);\n                }\n                return window.ToArray();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/CfdTimeZonesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is a regression algorithm for CFD assets which have the exchange time zone ahead of the data time zone.\n    /// </summary>\n    public class CfdTimeZonesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"EUR\");\n\n            SetStartDate(2019, 2, 19);\n            SetEndDate(2019, 2, 21);\n            SetCash(\"EUR\", 100000);\n\n            _symbol = AddCfd(\"DE30EUR\").Symbol;\n\n            SetBenchmark(_symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Time.Minute % 10 != 0) return;\n\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(_symbol, 1m);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2776;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"279\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-33.650%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-0.345\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99663.4\"},\n            {\"Net Profit\", \"-0.337%\"},\n            {\"Sharpe Ratio\", \"-21.957\"},\n            {\"Sortino Ratio\", \"-21.957\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"68%\"},\n            {\"Win Rate\", \"32%\"},\n            {\"Profit-Loss Ratio\", \"1.07\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.014\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-19.772\"},\n            {\"Tracking Error\", \"0.014\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€0.00\"},\n            {\"Estimated Strategy Capacity\", \"€670000.00\"},\n            {\"Lowest Capacity Asset\", \"DE30EUR 8I\"},\n            {\"Portfolio Turnover\", \"1062.25%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d5d15485c8fc6d412e5e73d40d9afd60\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRangeConsolidatorAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of how to use the ClassicRangeConsolidator\n    /// </summary>\n    public class ClassicRangeConsolidatorAlgorithm : RangeConsolidatorAlgorithm\n    {\n        protected override RangeConsolidator CreateRangeConsolidator()\n        {\n            return new ClassicRangeConsolidator(Range);\n        }\n\n        protected override void OnDataConsolidated(Object sender, RangeBar rangeBar)\n        {\n            base.OnDataConsolidated(sender, rangeBar);\n\n            if (rangeBar.Volume == 0)\n            {\n                throw new RegressionTestException($\"All RangeBar's should have non-zero volume, but this doesn't\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRangeConsolidatorWithTickAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of how to use ClassicRangeConsolidator with Tick resolution\n    /// </summary>\n    public class ClassicRangeConsolidatorWithTickAlgorithm : RangeConsolidatorWithTickAlgorithm\n    {\n        protected override RangeConsolidator CreateRangeConsolidator()\n        {\n            return new ClassicRangeConsolidator(Range);\n        }\n\n        protected override void OnDataConsolidated(Object sender, RangeBar rangeBar)\n        {\n            base.OnDataConsolidated(sender, rangeBar);\n\n            if (rangeBar.Volume == 0)\n            {\n                throw new RegressionTestException($\"All RangeBar's should have non-zero volume, but this doesn't\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRenkoConsolidatorAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to initialize and use the RenkoConsolidator\n    /// </summary>\n    /// <meta name=\"tag\" content=\"renko\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"consolidating data\" />\n    public class ClassicRenkoConsolidatorAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initializes the algorithm state.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2012, 01, 01);\n            SetEndDate(2013, 01, 01);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            // this is the simple constructor that will perform the renko logic to the Value\n            // property of the data it receives.\n\n            // break SPY into $2.5 renko bricks and send that data to our 'OnRenkoBar' method\n            var renkoClose = new ClassicRenkoConsolidator(2.5m);\n            renkoClose.DataConsolidated += (sender, consolidated) =>\n            {\n                // call our event handler for renko data\n                HandleRenkoClose(consolidated);\n            };\n\n            // register the consolidator for updates\n            SubscriptionManager.AddConsolidator(\"SPY\", renkoClose);\n\n\n            // this is the full constructor that can accept a value selector and a volume selector\n            // this allows us to perform the renko logic on values other than Close, even computed values!\n\n            // break SPY into (2*o + h + l + 3*c)/7\n            var renko7bar = new ClassicRenkoConsolidator<TradeBar>(2.5m, x => (2 * x.Open + x.High + x.Low + 3 * x.Close) / 7m, x => x.Volume);\n            renko7bar.DataConsolidated += (sender, consolidated) =>\n            {\n                HandleRenko7Bar(consolidated);\n            };\n\n            // register the consolidator for updates\n            SubscriptionManager.AddConsolidator(\"SPY\", renko7bar);\n        }\n\n        /// <summary>\n        /// We're doing our analysis in the OnRenkoBar method, but the framework verifies that this method exists, so we define it.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n        }\n\n        /// <summary>\n        /// This function is called by our renkoClose consolidator defined in Initialize()\n        /// </summary>\n        /// <param name=\"data\">The new renko bar produced by the consolidator</param>\n        public void HandleRenkoClose(RenkoBar data)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(data.Symbol, 1.0);\n            }\n            Log($\"CLOSE - {data.Time.ToIso8601Invariant()} - {data.Open} {data.Close}\");\n        }\n\n        /// <summary>\n        /// This function is called by our renko7bar onsolidator defined in Initialize()\n        /// </summary>\n        /// <param name=\"data\">The new renko bar produced by the consolidator</param>\n        public void HandleRenko7Bar(RenkoBar data)\n        {\n            if (Portfolio.Invested)\n            {\n                Liquidate(data.Symbol);\n            }\n            Log($\"7BAR - {data.Time.ToIso8601Invariant()} - {data.Open} {data.Close}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2003;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"29\"},\n            {\"Average Win\", \"1.85%\"},\n            {\"Average Loss\", \"-1.49%\"},\n            {\"Compounding Annual Return\", \"7.824%\"},\n            {\"Drawdown\", \"6.800%\"},\n            {\"Expectancy\", \"0.281\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107838.74\"},\n            {\"Net Profit\", \"7.839%\"},\n            {\"Sharpe Ratio\", \"0.692\"},\n            {\"Sortino Ratio\", \"0.636\"},\n            {\"Probabilistic Sharpe Ratio\", \"39.336%\"},\n            {\"Loss Rate\", \"43%\"},\n            {\"Win Rate\", \"57%\"},\n            {\"Profit-Loss Ratio\", \"1.24\"},\n            {\"Alpha\", \"0.004\"},\n            {\"Beta\", \"0.411\"},\n            {\"Annual Standard Deviation\", \"0.07\"},\n            {\"Annual Variance\", \"0.005\"},\n            {\"Information Ratio\", \"-0.704\"},\n            {\"Tracking Error\", \"0.083\"},\n            {\"Treynor Ratio\", \"0.118\"},\n            {\"Total Fees\", \"$129.34\"},\n            {\"Estimated Strategy Capacity\", \"$2500000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"7.91%\"},\n            {\"Drawdown Recovery\", \"105\"},\n            {\"OrderListHash\", \"2668157409450ab9949a71716a5dbc2e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesAndDefaultTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the Classic Renko Consolidator with future and default tick data.\n    /// If consolidation does not happen, a RegressionTestException is thrown\n    /// </summary>\n    public class ClassicRenkoConsolidatorWithFuturesAndDefaultTickTypeRegressionAlgorithm : ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm\n    {\n        protected override ClassicRenkoConsolidator GetConsolidator()\n        {\n            Func<IBaseData, decimal> selector = data =>\n            {\n                var tick = data as Tick;\n                if (tick.TickType != TickType.Quote)\n                {\n                    throw new RegressionTestException(\"The tick type should be quote\");\n                }\n                WasSelectorExecuted = true;\n                return tick.AskPrice * 10;\n            };\n\n            var consolidator = new ClassicRenkoConsolidator(BucketSize, selector);\n            return consolidator;\n        }\n\n        public override void AddConsolidator(ClassicRenkoConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesQuoteTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the Classic Renko Consolidator with future quote tick data.\n    /// It checks if valid quote data (non-zero Bid/Ask prices) is received during the algorithm's execution.\n    /// If consolidation does not happen, a RegressionTestException is thrown\n    /// </summary>\n    public class ClassicRenkoConsolidatorWithFuturesQuoteTickTypeRegressionAlgorithm : ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm\n    {\n        private bool _hasNonZeroBidPrice;\n        private bool _hasNonZeroAskPrice;\n        protected override TickType TickType => TickType.Quote;\n        protected override ClassicRenkoConsolidator GetConsolidator()\n        {\n            Func<IBaseData, decimal> selector = data =>\n            {\n                var tick = data as Tick;\n                _hasNonZeroBidPrice |= tick.BidPrice != 0;\n                _hasNonZeroAskPrice |= tick.AskPrice != 0;\n                if (tick.TickType != TickType)\n                {\n                    throw new RegressionTestException(\"The tick type should be quote\");\n                }\n                WasSelectorExecuted = true;\n                return tick.AskPrice * 10;\n            };\n\n            var consolidator = new ClassicRenkoConsolidator(BucketSize, selector);\n            return consolidator;\n        }\n\n        public override void AddConsolidator(ClassicRenkoConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator, TickType);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasNonZeroBidPrice || !_hasNonZeroAskPrice)\n            {\n                throw new RegressionTestException(\"No valid Quote tick data found: fields (Bid/Ask) were zero.\");\n            }\n            base.OnEndOfAlgorithm();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the Classic Renko Consolidator with future trade tick data.\n    /// It checks if data consolidation occurs as expected for the given time period. If consolidation does not happen, a RegressionTestException is thrown.\n    /// </summary>\n    public class ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, ClassicRenkoConsolidator> _consolidators = new Dictionary<Symbol, ClassicRenkoConsolidator>();\n        private bool _itWasConsolidated;\n        protected Future GoldFuture { get; set; }\n        protected virtual TickType TickType => TickType.Trade;\n        protected decimal BucketSize { get; set; }\n        protected bool WasSelectorExecuted { get; set; }\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 9);\n\n            GoldFuture = AddFuture(\"GC\", Resolution.Tick, Market.COMEX);\n            GoldFuture.SetFilter(0, 180);\n            BucketSize = 2000m;\n        }\n\n        private void OnConsolidated(object sender, TradeBar bar)\n        {\n            _itWasConsolidated = true;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_consolidators.ContainsKey(GoldFuture.Mapped))\n            {\n                var consolidator = GetConsolidator();\n                consolidator.DataConsolidated += OnConsolidated;\n                AddConsolidator(consolidator);\n                _consolidators[GoldFuture.Mapped] = consolidator;\n            }\n        }\n\n        public virtual void AddConsolidator(ClassicRenkoConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator, TickType);\n        }\n\n        protected virtual ClassicRenkoConsolidator GetConsolidator()\n        {\n            Func<IBaseData, decimal> selector = data =>\n            {\n                var tick = data as Tick;\n                if (tick.TickType != TickType)\n                {\n                    throw new RegressionTestException(\"The tick type should be trade\");\n                }\n                WasSelectorExecuted = true;\n                return tick.Quantity * tick.Price;\n            };\n\n            var consolidator = new ClassicRenkoConsolidator(BucketSize, selector);\n            return consolidator;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_itWasConsolidated)\n            {\n                throw new RegressionTestException(\"ClassicRenko did not consolidate any data.\");\n            }\n            if (!WasSelectorExecuted)\n            {\n                throw new RegressionTestException(\"The selector was not executed\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1082920;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.524\"},\n            {\"Tracking Error\", \"0.136\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseFineAsyncUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that using separate coarse & fine selection with async universe settings is not allowed\n    /// </summary>\n    public class CoarseFineAsyncUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            UniverseSettings.Asynchronous = true;\n\n            var threwException = false;\n            try\n            {\n                AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n            }\n            catch (ArgumentException)\n            {\n                threwException = true;\n                // expected\n            }\n\n            if (!threwException)\n            {\n                throw new RegressionTestException(\"Expected exception to be thrown for AddUniverse\");\n            }\n\n            SetUniverseSelection(new FineFundamentalUniverseSelectionModel(CoarseSelectionFunction, FineSelectionFunction));\n        }\n\n        private IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            return Enumerable.Empty<Symbol>();\n        }\n\n        private IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            return Enumerable.Empty<Symbol>();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Running;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to define a universe filtered by the combination of coarse\n    /// fundamental data and fine fundamental data. This lets you do a first pass based on the asset volume; then later\n    /// select based on the company fundamentals.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"fine universes\" />\n    public class CoarseFineFundamentalComboAlgorithm : QCAlgorithm\n    {\n        private const int NumberOfSymbolsCoarse = 5;\n        private const int NumberOfSymbolsFine = 2;\n\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 04, 01);\n            SetEndDate(2014, 04, 30);\n            SetCash(50000);\n\n            // this add universe method accepts two parameters:\n            // - coarse selection function: accepts an IEnumerable<CoarseFundamental> and returns an IEnumerable<Symbol>\n            // - fine selection function: accepts an IEnumerable<FineFundamental> and returns an IEnumerable<Symbol>\n            AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbolsCoarse'\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // select only symbols with fundamental data and sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse\n                .Where(x => x.HasFundamentalData)\n                .OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top5 = sortedByDollarVolume.Take(NumberOfSymbolsCoarse);\n\n            // we need to return only the symbol objects\n            return top5.Select(x => x.Symbol);\n        }\n\n        // sort the data by P/E ratio and take the top 'NumberOfSymbolsFine'\n        public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            // sort descending by P/E ratio\n            var sortedByPeRatio = fine.OrderByDescending(x => x.ValuationRatios.PERatio);\n\n            // take the top entries from our sorted collection\n            var topFine = sortedByPeRatio.Take(NumberOfSymbolsFine);\n\n            // we need to return only the symbol objects\n            return topFine.Select(x => x.Symbol);\n        }\n\n        //Data Event Handler: New data arrives here.\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                    Debug(\"Liquidated Stock: \" + security.Symbol.Value);\n                }\n            }\n\n            // we want 50% allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.5m);\n                Debug(\"Purchased Stock: \" + security.Symbol.Value);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n\n            if (changes.AddedSecurities.Count > 0)\n            {\n                Debug(\"Securities added: \" + string.Join(\",\", changes.AddedSecurities.Select(x => x.Symbol.Value)));\n            }\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                Debug(\"Securities removed: \" + string.Join(\",\", changes.RemovedSecurities.Select(x => x.Symbol.Value)));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to define a universe\n    /// as a combination of use the coarse fundamental data and fine fundamental data\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class CoarseFineFundamentalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbolsFine = 2;\n\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 04, 07);\n            SetCash(50000);\n\n            // this add universe method accepts two parameters:\n            // - coarse selection function: accepts an IEnumerable<CoarseFundamental> and returns an IEnumerable<Symbol>\n            // - fine selection function: accepts an IEnumerable<FineFundamental> and returns an IEnumerable<Symbol>\n            AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n        }\n\n        // return a list of three fixed symbol objects\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            if (Time.Date < new DateTime(2014, 4, 1))\n            {\n                return new List<Symbol>\n                {\n                    QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                    QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                    QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA)\n                };\n            }\n\n            return new List<Symbol>\n            {\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)\n            };\n        }\n\n        // sort the data by market capitalization and take the top 'NumberOfSymbolsFine'\n        public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            // sort descending by market capitalization\n            var sortedByMarketCap = fine.OrderByDescending(x => x.MarketCap);\n\n            // take the top entries from our sorted collection\n            var topFine = sortedByMarketCap.Take(NumberOfSymbolsFine);\n\n            // we need to return only the symbol objects\n            return topFine.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // verify we don't receive data for inactive securities\n            var inactiveSymbols = slice.Keys\n                .Where(sym => !UniverseManager.ActiveSecurities.ContainsKey(sym))\n                // on daily data we'll get the last data point and the delisting at the same time\n                .Where(sym => !slice.Delistings.ContainsKey(sym) || slice.Delistings[sym].Type != DelistingType.Delisted)\n                .ToList();\n            if (inactiveSymbols.Any())\n            {\n                var symbols = string.Join(\", \", inactiveSymbols);\n                throw new RegressionTestException($\"Received data for non-active security: {symbols}.\");\n            }\n\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                    Debug(\"Liquidated Stock: \" + security.Symbol.Value);\n                }\n            }\n\n            // we want 50% allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (security.Fundamentals.EarningRatios.EquityPerShareGrowth.OneYear > 0.25)\n                {\n                    SetHoldings(security.Symbol, 0.5m);\n                    Debug(\"Purchased Stock: \" + security.Symbol.Value);\n                }\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n\n            if (changes.AddedSecurities.Count > 0)\n            {\n                Debug(\"Securities added: \" + string.Join(\",\", changes.AddedSecurities.Select(x => x.Symbol.Value)));\n            }\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                Debug(\"Securities removed: \" + string.Join(\",\", changes.RemovedSecurities.Select(x => x.Symbol.Value)));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7244;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"1.39%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"40.025%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"50000\"},\n            {\"End Equity\", \"50696.56\"},\n            {\"Net Profit\", \"1.393%\"},\n            {\"Sharpe Ratio\", \"3.192\"},\n            {\"Sortino Ratio\", \"4.952\"},\n            {\"Probabilistic Sharpe Ratio\", \"68.664%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.328\"},\n            {\"Beta\", \"0.474\"},\n            {\"Annual Standard Deviation\", \"0.088\"},\n            {\"Annual Variance\", \"0.008\"},\n            {\"Information Ratio\", \"4.219\"},\n            {\"Tracking Error\", \"0.09\"},\n            {\"Treynor Ratio\", \"0.59\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$81000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"6.65%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4eaacdd341a5be0d04cb32647d931471\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseFineOptionUniverseChainRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to chain a coarse and fine universe selection with an option chain universe selection model\n    /// that will add and remove an <see cref=\"OptionChainUniverse\"/> for each symbol selected on fine\n    /// </summary>\n    public class CoarseFineOptionUniverseChainRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n        private int _optionCount;\n        private Symbol _lastEquityAdded;\n        private Symbol _aapl;\n        private Symbol _twx;\n\n        private Dictionary<string, decimal> _rawPrices = new()\n        {\n            { \"AOL\", 70  },\n            { \"AAPL\", 650 }\n        };\n\n        public override void Initialize()\n        {\n            _twx = QuantConnect.Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n            _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            // Let's disable initial price seeding, the algorithm will wait until both equity\n            // and options are added an have prices to do the tests, we don't want the equity\n            // having prices before the options are added.\n            Settings.SeedInitialPrices = false;\n\n            SetStartDate(2014, 06, 04);\n            // TWX is selected the 4th and 5th and aapl after that.\n            // If the algo ends on the 6th, TWX subscriptions will not be removed before OnEndOfAlgorithm is called:\n            //   - 6th: AAPL is selected, TWX is removed but subscriptions are not removed because the securities are invested.\n            //      - TWX and its options are liquidated.\n            //   - 7th: Since options universe selection is daily now, TWX subscriptions are removed the next day (7th)\n            SetEndDate(2014, 06, 07);\n\n            var selectionUniverse = AddUniverse(enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl },\n                enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl });\n\n            AddUniverseOptions(selectionUniverse, universe =>\n            {\n                if (universe.Underlying == null)\n                {\n                    throw new RegressionTestException(\"Underlying data point is null! This shouldn't happen, each OptionChainUniverse handles and should provide this\");\n                }\n                return universe.IncludeWeeklys()\n                    .FrontMonth()\n                    .Contracts(universe.Take(5));\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None ||\n                _changes.AddedSecurities.Any(security => security.Price == 0))\n            {\n                return;\n            }\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (!security.Symbol.HasUnderlying)\n                {\n                    _lastEquityAdded = security.Symbol;\n                }\n                else\n                {\n                    // options added should all match prev added security\n                    if (security.Symbol.Underlying != _lastEquityAdded)\n                    {\n                        throw new RegressionTestException($\"Unexpected symbol added {security.Symbol}\");\n                    }\n\n                    _optionCount++;\n                }\n\n                SetHoldings(security.Symbol, 0.05m);\n\n                var config = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(security.Symbol).ToList();\n\n                if (!config.Any())\n                {\n                    throw new RegressionTestException($\"Was expecting configurations for {security.Symbol}\");\n                }\n                if (config.Any(dataConfig => dataConfig.DataNormalizationMode != DataNormalizationMode.Raw))\n                {\n                    throw new RegressionTestException($\"Was expecting DataNormalizationMode.Raw configurations for {security.Symbol}\");\n                }\n\n                if (security.Symbol.SecurityType == SecurityType.Equity)\n                {\n                    var expectedPrice = _rawPrices[security.Symbol.ID.Symbol];\n                    if (Math.Abs(security.Price - expectedPrice) > expectedPrice * 0.1m)\n                    {\n                        throw new RegressionTestException($\"Unexpected raw prices for symbol {security.Symbol}\");\n                    }\n                }\n            }\n            _changes = SecurityChanges.None;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes += changes;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var config = SubscriptionManager.Subscriptions.ToList();\n            if (config.Any(dataConfig => dataConfig.Symbol == _twx || dataConfig.Symbol.Underlying == _twx))\n            {\n                throw new RegressionTestException($\"Was NOT expecting any configurations for {_twx} or it's options, since coarse/fine should have deselected it\");\n            }\n\n            if (_optionCount == 0)\n            {\n                throw new RegressionTestException(\"Option universe chain did not add any option!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 18993;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"13\"},\n            {\"Average Win\", \"0.04%\"},\n            {\"Average Loss\", \"-0.05%\"},\n            {\"Compounding Annual Return\", \"-24.719%\"},\n            {\"Drawdown\", \"0.500%\"},\n            {\"Expectancy\", \"-0.685\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99766.89\"},\n            {\"Net Profit\", \"-0.233%\"},\n            {\"Sharpe Ratio\", \"-9.078\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"83%\"},\n            {\"Win Rate\", \"17%\"},\n            {\"Profit-Loss Ratio\", \"0.89\"},\n            {\"Alpha\", \"4.632\"},\n            {\"Beta\", \"-1.524\"},\n            {\"Annual Standard Deviation\", \"0.029\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-72.647\"},\n            {\"Tracking Error\", \"0.048\"},\n            {\"Treynor Ratio\", \"0.172\"},\n            {\"Total Fees\", \"$16.10\"},\n            {\"Estimated Strategy Capacity\", \"$5000000.00\"},\n            {\"Lowest Capacity Asset\", \"AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"17.64%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"228e694280e05c8aa24246a5866b5a83\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseFundamentalImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Assert that CoarseFundamentals universe selection happens right away after algorithm starts\n    /// </summary>\n    public class CoarseFundamentalImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbols = 3;\n\n        private bool _initialSelectionDone;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 03, 30);\n            SetCash(100000);\n\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            if (!_initialSelectionDone)\n            {\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"CoarseSelectionFunction called at unexpected time. \" +\n                        $\"Expected it to be called on {StartDate} but was called on {Time}\");\n                }\n            }\n\n            // sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top = sortedByDollarVolume.Take(NumberOfSymbols);\n\n            // we need to return only the symbol objects\n            return top.Select(x => x.Symbol);\n        }\n\n        public void OnData(Slice data)\n        {\n            Log($\"OnData({UtcTime:o}): Keys: {string.Join(\", \", data.Keys.OrderBy(x => x))}\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Log($\"OnSecuritiesChanged({UtcTime:o}):: {changes}\");\n\n            // This should also happen right away\n            if (!_initialSelectionDone)\n            {\n                _initialSelectionDone = true;\n\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"OnSecuritiesChanged called at unexpected time. \" +\n                        $\"Expected it to be called on {StartDate} but was called on {Time}\");\n                }\n\n                if (changes.AddedSecurities.Count != NumberOfSymbols)\n                {\n                    throw new RegressionTestException($\"Unexpected number of added securities. \" +\n                        $\"Expected {NumberOfSymbols} but was {changes.AddedSecurities.Count}\");\n                }\n\n                if (changes.RemovedSecurities.Count != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected number of removed securities. \" +\n                        $\"Expected 0 but was {changes.RemovedSecurities.Count}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 35402;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"3.134\"},\n            {\"Tracking Error\", \"0.097\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we demonstrate how to use the coarse fundamental data to\n    /// define a universe as the top dollar volume\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class CoarseFundamentalTop3Algorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbols = 3;\n\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 04, 07);\n            SetCash(50000);\n\n            // this add universe method accepts a single parameter that is a function that\n            // accepts an IEnumerable<CoarseFundamental> and returns IEnumerable<Symbol>\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n        public static IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top = sortedByDollarVolume.Take(NumberOfSymbols);\n\n            // we need to return only the symbol objects\n            return top.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Log($\"OnData({UtcTime:o}): Keys: {string.Join(\", \", slice.Keys.OrderBy(x => x))}\");\n\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want 1/N allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 1m / NumberOfSymbols);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n            Log($\"OnSecuritiesChanged({UtcTime:o}):: {changes}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"OnOrderEvent({UtcTime:o}):: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78088;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"12\"},\n            {\"Average Win\", \"0.63%\"},\n            {\"Average Loss\", \"-0.49%\"},\n            {\"Compounding Annual Return\", \"-35.851%\"},\n            {\"Drawdown\", \"2.700%\"},\n            {\"Expectancy\", \"-0.542\"},\n            {\"Start Equity\", \"50000\"},\n            {\"End Equity\", \"49096.01\"},\n            {\"Net Profit\", \"-1.808%\"},\n            {\"Sharpe Ratio\", \"-1.989\"},\n            {\"Sortino Ratio\", \"-3.359\"},\n            {\"Probabilistic Sharpe Ratio\", \"23.898%\"},\n            {\"Loss Rate\", \"80%\"},\n            {\"Win Rate\", \"20%\"},\n            {\"Profit-Loss Ratio\", \"1.29\"},\n            {\"Alpha\", \"-0.172\"},\n            {\"Beta\", \"1.068\"},\n            {\"Annual Standard Deviation\", \"0.141\"},\n            {\"Annual Variance\", \"0.02\"},\n            {\"Information Ratio\", \"-1.865\"},\n            {\"Tracking Error\", \"0.096\"},\n            {\"Treynor Ratio\", \"-0.263\"},\n            {\"Total Fees\", \"$26.72\"},\n            {\"Estimated Strategy Capacity\", \"$630000000.00\"},\n            {\"Lowest Capacity Asset\", \"FB V6OIPNZEM8V9\"},\n            {\"Portfolio Turnover\", \"24.59%\"},\n            {\"Drawdown Recovery\", \"6\"},\n            {\"OrderListHash\", \"90b57d40d047eedbff7111d2a73a1290\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseNoLookAheadBiasAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is a regression algorithm to ensure coarse data does not enable potential look-ahead bias.\n    /// </summary>\n    public class CoarseNoLookAheadBiasAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbols = 1;\n        private static Dictionary<Symbol, decimal> _coarsePrices = new Dictionary<Symbol, decimal>();\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 04, 06);\n            SetCash(50000);\n\n            AddUniverse(CoarseSelectionFunction);\n\n            // schedule an event at 10 AM every day\n            Schedule.On(\n                DateRules.EveryDay(),\n                TimeRules.At(10, 0),\n                () =>\n                {\n                    foreach (var symbol in _coarsePrices.Keys)\n                    {\n                        if (Securities.ContainsKey(symbol))\n                        {\n                            // If the coarse price is emitted at midnight for the same date, we would have look-ahead bias\n                            // i.e. _coarsePrices[symbol] would be the closing price of the current day,\n                            // which we obviously cannot know at 10 AM :)\n                            // As the coarse data is now emitted for the previous day, there is no look-ahead bias:\n                            // _coarsePrices[symbol] and Securities[symbol].Price will have the same value (equal to the previous closing price)\n                            // for the backtesting period, so we expect this algorithm to make zero trades.\n                            if (_coarsePrices[symbol] > Securities[symbol].Price)\n                            {\n                                SetHoldings(symbol, 1m / NumberOfSymbols);\n                            }\n                            else\n                            {\n                                Liquidate(symbol);\n                            }\n                        }\n                    }\n                }\n            );\n        }\n\n        private static IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n            var top = sortedByDollarVolume.Take(NumberOfSymbols).ToList();\n\n            // save the coarse adjusted prices in a dictionary, so we can access them in the scheduled event handler\n            _coarsePrices = top.ToDictionary(c => c.Symbol, c => c.AdjustedPrice);\n\n            return top.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 70951;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"50000\"},\n            {\"End Equity\", \"50000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.388\"},\n            {\"Tracking Error\", \"0.096\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseSelectionTimeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm that reproduces GH issues 3410 and 3409.\n    /// Coarse universe selection should start from the algorithm start date.\n    /// Data returned by history requests performed from the selection method should be up to date.\n    /// </summary>\n    public class CoarseSelectionTimeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private decimal _spyPrice;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 04, 01);\n\n            _spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n            var top = sortedByDollarVolume\n                .Where(fundamental => fundamental.Symbol != _spy) // ignore spy\n                .Take(1);\n\n            var historyCoarseSpyPrice = History(_spy, 1).First().Close;\n            if (_spyPrice != 0 && (historyCoarseSpyPrice == 0 ||  historyCoarseSpyPrice != _spyPrice))\n            {\n                throw new RegressionTestException($\"Unexpected SPY price: {historyCoarseSpyPrice}\");\n            }\n            _spyPrice = 0;\n\n            return top.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected data count: {slice.Count}\");\n            }\n            if (ActiveSecurities.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected ActiveSecurities count: {ActiveSecurities.Count}\");\n            }\n\n            // we get the data at 4PM, selection happening at midnight\n            _spyPrice = Securities[_spy].Price;\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 49660;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 6;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"36.033%\"},\n            {\"Drawdown\", \"1.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100676.75\"},\n            {\"Net Profit\", \"0.677%\"},\n            {\"Sharpe Ratio\", \"2.646\"},\n            {\"Sortino Ratio\", \"2.77\"},\n            {\"Probabilistic Sharpe Ratio\", \"58.013%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.264\"},\n            {\"Beta\", \"1.183\"},\n            {\"Annual Standard Deviation\", \"0.103\"},\n            {\"Annual Variance\", \"0.011\"},\n            {\"Information Ratio\", \"-8.158\"},\n            {\"Tracking Error\", \"0.022\"},\n            {\"Treynor Ratio\", \"0.231\"},\n            {\"Total Fees\", \"$3.07\"},\n            {\"Estimated Strategy Capacity\", \"$930000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"12.65%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"87438e51988f37757a2d7f97389483ea\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoarseSelectionsAutomaticSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that securities added via coarse selection get automatically seeded by default\n    /// </summary>\n    public class CoarseSelectionsAutomaticSeedRegressionAlgorithm : AutomaticSeedBaseRegressionAlgorithm\n    {\n        private readonly Queue<List<Symbol>> _coarseSelections = new(new[] { \"AAPL\", \"GOOG\", \"AIG\", \"BAC\", \"FB\", \"IBM\" }\n            .Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA))\n            .BatchBy(2));\n\n        private HashSet<Symbol> _addedSecurities = new();\n\n        protected override bool ShouldHaveTradeData => true;\n        // Daily resolution, only trade data is available\n        protected override bool ShouldHaveQuoteData => false;\n        protected override bool ShouldHaveOpenInterestData => false;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 01, 01);\n            SetEndDate(2015, 03, 01);\n            SetCash(100000);\n\n            Settings.SeedInitialPrices = true;\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverse((coarse) =>\n            {\n                var selection = _coarseSelections.Dequeue();\n                _coarseSelections.Enqueue(selection);\n                return selection;\n            });\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(changes);\n\n            foreach (var addedSecurity in changes.AddedSecurities.Where(x => !x.Symbol.IsCanonical()))\n            {\n                _addedSecurities.Add(addedSecurity.Symbol);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_coarseSelections.SelectMany(x => x).Order().SequenceEqual(_addedSecurities.Order()))\n            {\n                throw new RegressionTestException(\"Not all securities were added\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 358;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 390;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.066\"},\n            {\"Tracking Error\", \"0.116\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoinbaseCryptoYearMarketTradingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class CoinbaseCryptoYearMarketTradingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// The Average amount of day in year\n        /// </summary>\n        /// <remarks>Regardless of calendar</remarks>\n        private const int _daysInYear = 365;\n\n        /// <summary>\n        /// Flag prevents same order <see cref=\"Orders.OrderDirection\"/>\n        /// </summary>\n        private bool _isBuy;\n\n        /// <summary>\n        /// Trading security\n        /// </summary>\n        private Crypto _BTCUSD;\n\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <remarks>In fact, you can assign custom value for <see cref=\"IAlgorithmSettings.TradingDaysPerYear\"/></remarks>\n        public override void Initialize()\n        {\n            SetStartDate(2015, 01, 13);\n            SetEndDate(2016, 02, 03);\n\n            SetCash(100000);\n\n            // Setup brokerage for current algorithm\n            SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);\n\n            _BTCUSD = AddCrypto(\"BTCUSD\", Resolution.Daily, Market.Coinbase);\n        }\n\n        /// <summary>\n        /// Data Event Handler: receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_isBuy)\n            {\n                MarketOrder(_BTCUSD, 1);\n                _isBuy = true;\n            }\n            else\n            {\n                Liquidate();\n                _isBuy = false;\n            }\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Settings.TradingDaysPerYear != _daysInYear)\n            {\n                throw new RegressionTestException(\"The Algorithm was using invalid `TradingDaysPerYear` for this brokerage. The ExpectedStatistics is wrong.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all time slices of algorithm\n        /// </summary>\n        public long DataPoints => 673;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 11;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"388\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-0.597%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"-0.400\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"99365.56\"},\n            {\"Net Profit\", \"-0.634%\"},\n            {\"Sharpe Ratio\", \"-7.126\"},\n            {\"Sortino Ratio\", \"-7.337\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"66%\"},\n            {\"Win Rate\", \"34%\"},\n            {\"Profit-Loss Ratio\", \"0.79\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.086\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$331.31\"},\n            {\"Estimated Strategy Capacity\", \"$71000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"0.29%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a0058926f4ca5b009cfcc9096506a548\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm sends a list of portfolio targets from algorithm's Portfolio \n    /// to Collective2 API every time the ema indicators crosses between themselves\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    public class Collective2PortfolioSignalExportDemonstrationAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Collective2 APIv4 KEY: This value is provided by Collective2 in their webpage in your account section (See https://collective2.com/account-info)\n        /// See API documentation at https://trade.collective2.com/c2-api\n        /// </summary>\n        private const string _collective2ApiKey = \"YOUR APIV4 KEY\";\n\n        /// <summary>\n        /// Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page\n        /// </summary>\n        private const int _collective2SystemId = 0;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private bool _emaFastWasAbove;\n        private bool _emaFastIsNotSet;\n        private bool _firstCall = true;\n\n        /// <summary>\n        /// Symbols accepted by Collective2. Collective2 accepts stock,\n        /// future, forex and US stock option symbols \n        /// </summary>\n        private List<Symbol> _symbols = new()\n        {   \n            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA, null, null),\n            QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda, null, null),\n            QuantConnect.Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2023, 12, 15), null),\n            QuantConnect.Symbol.CreateOption(\"GOOG\", Market.USA, OptionStyle.American, OptionRight.Call, 130, new DateTime(2023, 9, 1)),\n        };\n\n        /// <summary>\n        /// Initialize the date and add all equity symbols present in _symbols list\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100 * 1000);\n\n            foreach (var item in _symbols)\n            {\n                AddSecurity(item);\n            }\n\n            _fast = EMA(\"SPY\", 10);\n            _slow = EMA(\"SPY\", 100);\n\n            // Initialize this flag, to check when the ema indicators crosses between themselves\n            _emaFastIsNotSet = true;\n\n            // Disable automatic exports as we manually set them\n            SignalExport.AutomaticExportTimeSpan = null;\n            // Set Collective2 signal export provider\n            SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));\n\n            SetWarmUp(100);\n        }\n\n        /// <summary>\n        /// Reduce the quantity of holdings for SPY or increase it, depending the case, \n        /// when the EMA's indicators crosses between themselves, then send a signal to \n        /// Collective2 API\n        /// </summary>\n        /// <param name=\"slice\"></param>\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n\n            // Place an order as soon as possible to send a signal.\n            if (_firstCall)\n            {\n                SetHoldings(\"SPY\", 0.1);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n                _firstCall = false;\n            }\n\n            // Set the value of flag _emaFastWasAbove, to know when the ema indicators crosses between themselves\n            if (_emaFastIsNotSet)\n            {\n                if (_fast > _slow * 1.001m)\n                {\n                    _emaFastWasAbove = true;\n                }\n                else\n                {\n                    _emaFastWasAbove = false;\n                }\n                _emaFastIsNotSet = false;\n            }\n\n            // Check whether ema fast and ema slow crosses. If they do, set holdings to SPY\n            // or reduce its holdings, and send signals to the Collective2 API from your\n            // Portfolio\n            if ((_fast > _slow * 1.001m) && (!_emaFastWasAbove))\n            {\n                SetHoldings(\"SPY\", 0.1);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n            }\n            else if ((_fast < _slow * 0.999m) && (_emaFastWasAbove))\n            {\n                SetHoldings(\"SPY\", 0.01);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4155;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 50;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"14.180%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100169.68\"},\n            {\"Net Profit\", \"0.170%\"},\n            {\"Sharpe Ratio\", \"4.88\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.725%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.088\"},\n            {\"Beta\", \"0.099\"},\n            {\"Annual Standard Deviation\", \"0.022\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.315\"},\n            {\"Tracking Error\", \"0.201\"},\n            {\"Treynor Ratio\", \"1.086\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$260000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.00%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"006af1a065fca33ac1f1e9cd6bd02c11\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm sends a list of portfolio targets to Collective2 API every time the ema indicators crosses between themselves\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    public class Collective2SignalExportDemonstrationAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Collective2 APIv4 KEY: This value is provided by Collective2 in your account section (See https://collective2.com/account-info)\n        /// See API documentation at https://trade.collective2.com/c2-api\n        /// </summary>\n        private const string _collective2ApiKey = \"YOUR APIV4 KEY\";\n\n        /// <summary>\n        /// Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page\n        /// </summary>\n        private const int _collective2SystemId = 0;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private bool _emaFastWasAbove;\n        private bool _emaFastIsNotSet;\n        private bool _firstCall = true;\n\n        private PortfolioTarget[] _targets = new PortfolioTarget[4];\n\n        /// <summary>\n        /// Symbols accepted by Collective2. Collective2 accepts stock,\n        /// future, forex and US stock option symbols\n        /// </summary>\n        private List<Symbol> _symbols = new()\n        {\n            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n            QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda),\n            QuantConnect.Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2023, 12, 15)),\n            QuantConnect.Symbol.CreateOption(\"GOOG\", Market.USA, OptionStyle.American, OptionRight.Call, 130, new DateTime(2023, 9, 1)),\n        };\n\n        /// <summary>\n        /// Initialize the date and add all equity symbols present in _symbols list.\n        /// Besides, make a new PortfolioTarget for each symbol in _symbols, assign it\n        /// an initial quantity and save it in _targets array\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100 * 1000);\n\n            var index = 0;\n            foreach (var item in _symbols)\n            {\n                var symbol = AddSecurity(item).Symbol;\n                if (symbol.SecurityType == SecurityType.Equity\n                    || symbol.SecurityType == SecurityType.Forex)\n                {\n                    _targets[index] = new PortfolioTarget(symbol, (decimal)0.05);\n                }\n                else\n                {\n                    _targets[index] = new PortfolioTarget(symbol, 1);\n                }\n                index++;\n            }\n\n            _fast = EMA(\"SPY\", 10);\n            _slow = EMA(\"SPY\", 100);\n\n            // Initialize this flag, to check when the ema indicators crosses between themselves\n            _emaFastIsNotSet = true;\n\n            // Disable automatic exports as we manually set them\n            SignalExport.AutomaticExportTimeSpan = null;\n\n            // Set Collective2 signal export provider.\n            // If using the Collective2 white-label API, you can specify it in the constructor with the optional parameter `useWhiteLabelApi`:\n            // e.g. new Collective2SignalExport(_collective2ApiKey, _collective2SystemId, useWhiteLabelApi: true)\n            // The API url can also be overridden by setting the Destination property:\n            // e.g. new Collective2SignalExport(_collective2ApiKey, _collective2SystemId) { Destination = new Uri(\"your url\") }\n            SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));\n\n            SetWarmUp(100);\n        }\n\n        /// <summary>\n        /// Reduce the quantity of holdings for SPY or increase it, depending the case,\n        /// when the EMA's indicators crosses between themselves, then send a signal to\n        /// Collective2 API\n        /// </summary>\n        /// <param name=\"slice\"></param>\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n\n            // Place an order as soon as possible to send a signal.\n            if (_firstCall)\n            {\n                SetHoldings(\"SPY\", 0.1);\n                _targets[0] = new PortfolioTarget(Portfolio[\"SPY\"].Symbol, (decimal)0.1);\n                SignalExport.SetTargetPortfolio(_targets);\n                _firstCall = false;\n            }\n\n            // Set the value of flag _emaFastWasAbove, to know when the ema indicators crosses between themselves\n            if (_emaFastIsNotSet)\n            {\n                if (_fast > _slow * 1.001m)\n                {\n                    _emaFastWasAbove = true;\n                }\n                else\n                {\n                    _emaFastWasAbove = false;\n                }\n                _emaFastIsNotSet = false;\n            }\n\n            // Check whether ema fast and ema slow crosses. If they do, set holdings to SPY\n            // or reduce its holdings, change its value in _targets array and send signals\n            // to the Collective2 API from _targets array\n            if ((_fast > _slow * 1.001m) && (!_emaFastWasAbove))\n            {\n                SetHoldings(\"SPY\", 0.1);\n                _targets[0] = new PortfolioTarget(Portfolio[\"SPY\"].Symbol, (decimal)0.1);\n                SignalExport.SetTargetPortfolio(_targets);\n            }\n            else if ((_fast < _slow * 0.999m) && (_emaFastWasAbove))\n            {\n                SetHoldings(\"SPY\", 0.01);\n                _targets[0] = new PortfolioTarget(Portfolio[\"SPY\"].Symbol, (decimal)0.01);\n                SignalExport.SetTargetPortfolio(_targets);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4155;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 50;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"14.180%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100169.68\"},\n            {\"Net Profit\", \"0.170%\"},\n            {\"Sharpe Ratio\", \"4.88\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.725%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.088\"},\n            {\"Beta\", \"0.099\"},\n            {\"Annual Standard Deviation\", \"0.022\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.315\"},\n            {\"Tracking Error\", \"0.201\"},\n            {\"Treynor Ratio\", \"1.086\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$260000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.00%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"006af1a065fca33ac1f1e9cd6bd02c11\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboLegLimitOrderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test combo leg limit orders\n    /// </summary>\n    public class ComboLegLimitOrderAlgorithm : ComboOrderAlgorithm\n    {\n        private List<decimal> _originalLimitPrices = new();\n\n        protected virtual bool AsynchronousOrders => false;\n\n        protected override IEnumerable<OrderTicket> PlaceComboOrder(List<Leg> legs, int quantity, decimal? limitPrice = null)\n        {\n            foreach (var leg in legs)\n            {\n                _originalLimitPrices.Add(leg.OrderPrice.Value);\n                leg.OrderPrice *= 2; // Won't fill\n            }\n\n            return ComboLegLimitOrder(legs, quantity, asynchronous: AsynchronousOrders);\n        }\n\n        protected override void UpdateComboOrder(List<OrderTicket> tickets)\n        {\n            // Let's updated the limit prices to the original values\n            for (int i = 0; i < tickets.Count; i++)\n            {\n                tickets[i].Update(new UpdateOrderFields { LimitPrice = _originalLimitPrices[i] });\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            base.OnEndOfAlgorithm();\n\n            if (FillOrderEvents.Zip(OrderLegs).Any(x => x.Second.OrderPrice < x.First.FillPrice))\n            {\n                throw new RegressionTestException($\"Limit price expected to be greater that the fill price for each order. Limit prices: {string.Join(\",\", OrderLegs.Select(x => x.OrderPrice))} Fill prices: {string.Join(\",\", FillOrderEvents.Select(x => x.FillPrice))}\");\n            }\n\n            foreach (var ticket in Transactions.GetOrderTickets())\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198524\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$58000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"30.22%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6168ffaa5b9f3c389f5da52e90455889\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboLegLimitOrderAsyncAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test combo leg limit orders in asynchronous mode\n    /// </summary>\n    public class ComboLegLimitOrderAsyncAlgorithm : ComboLegLimitOrderAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboLimitOrderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test combo limit orders\n    /// </summary>\n    public class ComboLimitOrderAlgorithm : ComboOrderAlgorithm\n    {\n        private decimal _limitPrice;\n        private int _comboQuantity;\n\n        private decimal _temporaryLimitPrice;\n        private int _temporaryComboQuantity;\n\n        private int _fillCount;\n\n        private decimal _liquidatedQuantity;\n\n        private bool _liquidated;\n\n        protected override int ExpectedFillCount\n        {\n            get\n            {\n                // times 2 because of liquidation\n                return OrderLegs.Count * 2;\n            }\n        }\n\n        protected virtual bool AsynchronousOrders => false;\n\n        protected override IEnumerable<OrderTicket> PlaceComboOrder(List<Leg> legs, int quantity, decimal? limitPrice)\n        {\n            _limitPrice = limitPrice.Value;\n            _comboQuantity = quantity;\n            _temporaryLimitPrice = limitPrice.Value - Math.Sign(quantity) * limitPrice.Value * 0.5m; // Won't fill\n            _temporaryComboQuantity = quantity * 10;\n\n            legs.ForEach(x => { x.OrderPrice = null; });\n\n            // First, let's place a limit order that won't fill so we can update it later\n            return ComboLimitOrder(legs, _temporaryComboQuantity, _temporaryLimitPrice, asynchronous: AsynchronousOrders);\n        }\n\n        protected override void UpdateComboOrder(List<OrderTicket> tickets)\n        {\n            // Let's update the quantity and limit price to the real values\n            tickets[0].Update(new UpdateOrderFields\n            {\n                Quantity = _comboQuantity,\n                LimitPrice = _limitPrice\n            });\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            base.OnOrderEvent(orderEvent);\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                _fillCount++;\n                if (_fillCount == OrderLegs.Count)\n                {\n                    Liquidate();\n                }\n                else if (_fillCount < 2 * OrderLegs.Count)\n                {\n                    _liquidatedQuantity += orderEvent.FillQuantity;\n                }\n                else if (_fillCount == 2 * OrderLegs.Count)\n                {\n                    _liquidated = true;\n                    var totalComboQuantity = _comboQuantity * OrderLegs.Select(x => x.Quantity).Sum();\n\n                    if (_liquidatedQuantity != totalComboQuantity)\n                    {\n                        throw new RegressionTestException($\"Liquidated quantity {_liquidatedQuantity} does not match combo quantity {totalComboQuantity}\");\n                    }\n\n                    if (Portfolio.TotalHoldingsValue != 0)\n                    {\n                        throw new RegressionTestException($\"Portfolio value {Portfolio.TotalPortfolioValue} is not zero\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            base.OnEndOfAlgorithm();\n\n            if (_limitPrice == null)\n            {\n                throw new RegressionTestException(\"Limit price was not set\");\n            }\n\n            var fillPricesSum = FillOrderEvents.Take(OrderLegs.Count).Select(x => x.FillPrice * x.FillQuantity / _comboQuantity).Sum();\n            if (_limitPrice < fillPricesSum)\n            {\n                throw new RegressionTestException($\"Limit price expected to be greater that the sum of the fill prices ({fillPricesSum}), but was {_limitPrice}\");\n            }\n\n            if (!_liquidated)\n            {\n                throw new RegressionTestException(\"Combo order was not liquidated\");\n            }\n\n            foreach (var ticket in Transactions.GetOrderTickets().Where(x => x.OrderType == OrderType.ComboLimit))\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"196348\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$52.00\"},\n            {\"Estimated Strategy Capacity\", \"$5000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"60.91%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7daf3d43bef2b023ab26517085840c0e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboLimitOrderAsyncAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test combo limit orders in asynchronous mode\n    /// </summary>\n    public class ComboLimitOrderAsyncAlgorithm : ComboLimitOrderAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboMarketOrderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test combo market orders\n    /// </summary>\n    public class ComboMarketOrderAlgorithm : ComboOrderAlgorithm\n    {\n        protected override IEnumerable<OrderTicket> PlaceComboOrder(List<Leg> legs, int quantity, decimal? limitPrice = null)\n        {\n            legs.ForEach(x => { x.OrderPrice = null; });\n            return ComboMarketOrder(legs, quantity);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            base.OnOrderEvent(orderEvent);\n            if (orderEvent.Status == OrderStatus.Filled && orderEvent.OrderFee.Value.Amount != (orderEvent.AbsoluteFillQuantity * 0.65m))\n            {\n                throw new RegressionTestException($\"The fee for each order should be {orderEvent.AbsoluteFillQuantity * 0.65m} USD, but for order {orderEvent.OrderId} was {orderEvent.OrderFee}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198024\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$69000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"30.35%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0b9f42bc22c9c7c382bc57a64c99f7e5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboOrderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that combo orders are filled correctly and at the same time\n    /// </summary>\n    public abstract class ComboOrderAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        private List<OrderTicket> Tickets { get; set; }\n        private bool _updated;\n\n        protected List<OrderEvent> FillOrderEvents { get; private set; } = new();\n\n        protected List<Leg> OrderLegs { get; private set; }\n\n        protected int ComboOrderQuantity { get; } = 10;\n\n        protected virtual int ExpectedFillCount\n        {\n            get\n            {\n                return OrderLegs.Count;\n            }\n        }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(200000);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4, fillForward: true);\n            var option = AddOption(equity.Symbol, fillForward: true);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                  .Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (OrderLegs == null)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    // Let's wait until we have at least three contracts\n                    if (callContracts.Count < 3)\n                    {\n                        return;\n                    }\n\n                    OrderLegs = new List<Leg>()\n                    {\n                        Leg.Create(callContracts[0].Symbol, 1, 16.7m),\n                        Leg.Create(callContracts[1].Symbol, -2, 14.6m),\n                        Leg.Create(callContracts[2].Symbol, 1, 14.0m)\n                    };\n                    Tickets = PlaceComboOrder(OrderLegs, ComboOrderQuantity, 1.9m).ToList();\n                }\n            }\n            // Let's test order updates\n            else if (Tickets.All(ticket => ticket.OrderType != OrderType.ComboMarket) && FillOrderEvents.Count == 0 && !_updated)\n            {\n                UpdateComboOrder(Tickets);\n                _updated = true;\n            }\n        }\n\n        protected virtual void UpdateComboOrder(List<OrderTicket> tickets)\n        {\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\" Order Event: {orderEvent}\");\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                FillOrderEvents.Add(orderEvent);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (OrderLegs == null)\n            {\n                throw new RegressionTestException(\"Combo order legs were not initialized\");\n            }\n\n            if (Tickets.All(ticket => ticket.OrderType != OrderType.ComboMarket) && !_updated)\n            {\n                throw new RegressionTestException(\"Combo order was not updated\");\n            }\n\n            if (FillOrderEvents.Count != ExpectedFillCount)\n            {\n                throw new RegressionTestException($\"Expected {ExpectedFillCount} fill order events, found {FillOrderEvents.Count}\");\n            }\n\n            var fillTimes = FillOrderEvents.Select(x => x.UtcTime).ToHashSet();\n            if (fillTimes.Count != 1)\n            {\n                throw new RegressionTestException($\"Expected all fill order events to have the same time, found {string.Join(\", \", fillTimes)}\");\n            }\n\n            if (FillOrderEvents.Zip(OrderLegs).Any(x => x.First.FillQuantity != x.Second.Quantity * ComboOrderQuantity))\n            {\n                throw new RegressionTestException(\"Fill quantity does not match expected quantity for at least one order leg.\" +\n                    $\"Expected: {string.Join(\", \", OrderLegs.Select(x => x.Quantity * ComboOrderQuantity))}. \" +\n                    $\"Actual: {string.Join(\", \", FillOrderEvents.Select(x => x.FillQuantity))}\");\n            }\n        }\n\n        protected abstract IEnumerable<OrderTicket> PlaceComboOrder(List<Leg> legs, int quantity, decimal? limitPrice = null);\n\n        public abstract bool CanRunLocally { get; }\n\n        public abstract List<Language> Languages { get; }\n\n        public abstract long DataPoints { get; }\n\n        public abstract int AlgorithmHistoryDataPoints { get; }\n\n        public abstract AlgorithmStatus AlgorithmStatus { get; }\n\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm for testing submit/update/cancel for combo orders\n    /// </summary>\n    public class ComboOrderTicketDemoAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly List<OrderTicket> _openMarketOrders = new();\n        private readonly List<OrderTicket> _openLegLimitOrders = new();\n        private readonly List<OrderTicket> _openLimitOrders = new();\n\n        private Symbol _optionSymbol;\n        private List<Leg> _orderLegs;\n\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4, fillForward: true);\n            var option = AddOption(equity.Symbol, fillForward: true);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                  .Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_orderLegs == null)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    // Let's wait until we have at least three contracts\n                    if (callContracts.Count < 3)\n                    {\n                        return;\n                    }\n\n                    _orderLegs = new List<Leg>()\n                    {\n                        Leg.Create(callContracts[0].Symbol, 1),\n                        Leg.Create(callContracts[1].Symbol, -2),\n                        Leg.Create(callContracts[2].Symbol, 1),\n                    };\n                }\n            }\n            else\n            {\n                // COMBO MARKET ORDERS\n\n                ComboMarketOrders();\n\n                // COMBO LIMIT ORDERS\n\n                ComboLimitOrders();\n\n                // COMBO LEG LIMIT ORDERS\n\n                ComboLegLimitOrders();\n            }\n        }\n\n        private void ComboMarketOrders()\n        {\n            if (_openMarketOrders.Count != 0 || _orderLegs == null)\n            {\n                return;\n            }\n\n            Log(\"Submitting combo market orders\");\n\n            var tickets = ComboMarketOrder(_orderLegs, 2, asynchronous: false);\n            _openMarketOrders.AddRange(tickets);\n\n            tickets = ComboMarketOrder(_orderLegs, 2, asynchronous: true);\n            _openMarketOrders.AddRange(tickets);\n\n            foreach (var ticket in tickets)\n            {\n                var response = ticket.Cancel(\"Attempt to cancel combo market order\");\n                if (response.IsSuccess)\n                {\n                    throw new RegressionTestException(\"Combo market orders should fill instantly, they should not be cancelable in backtest mode: \" + response.OrderId);\n                }\n            }\n        }\n\n        private void ComboLimitOrders()\n        {\n            if (_openLimitOrders.Count == 0)\n            {\n                Log(\"Submitting ComboLimitOrder\");\n\n                var currentPrice = _orderLegs.Sum(leg => leg.Quantity * Securities[leg.Symbol].Close);\n\n                var tickets = ComboLimitOrder(_orderLegs, 2, currentPrice + 1.5m);\n                _openLimitOrders.AddRange(tickets);\n\n                // These won't fill, we will test cancel with this\n                tickets = ComboLimitOrder(_orderLegs, -2, currentPrice + 3m);\n                _openLimitOrders.AddRange(tickets);\n            }\n            else\n            {\n                var combo1 = _openLimitOrders.Take(_orderLegs.Count).ToList();\n                var combo2 = _openLimitOrders.Skip(_orderLegs.Count).Take(_orderLegs.Count).ToList();\n\n                // check if either is filled and cancel the other\n                if (CheckGroupOrdersForFills(combo1, combo2))\n                {\n                    return;\n                }\n\n                // if neither order has filled, bring in the limits by a penny\n\n                var ticket = combo1[0];\n                var newLimit = Math.Round(ticket.Get(OrderField.LimitPrice) + 0.01m, 2);\n                Debug($\"Updating limits - Combo 1 {ticket.OrderId}: {newLimit.ToStringInvariant(\"0.00\")}\");\n                ticket.Update(new UpdateOrderFields\n                {\n                    LimitPrice = newLimit,\n                    Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                });\n\n                ticket = combo2[0];\n                newLimit = Math.Round(ticket.Get(OrderField.LimitPrice) - 0.01m, 2);\n                Debug($\"Updating limits - Combo 2 {ticket.OrderId}: {newLimit.ToStringInvariant(\"0.00\")}\");\n                ticket.Update(new UpdateOrderFields\n                {\n                    LimitPrice = newLimit,\n                    Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                });\n            }\n        }\n\n        private void ComboLegLimitOrders()\n        {\n            if (_openLegLimitOrders.Count == 0)\n            {\n                Log(\"Submitting ComboLegLimitOrder\");\n\n                // submit a limit order to buy 2 shares at .1% below the bar's close\n                foreach (var leg in _orderLegs)\n                {\n                    var close = Securities[leg.Symbol].Close;\n                    leg.OrderPrice = close * .999m;\n                }\n\n                var tickets = ComboLegLimitOrder(_orderLegs, quantity: 2);\n                _openLegLimitOrders.AddRange(tickets);\n\n                // submit another limit order to sell 2 shares at .1% above the bar's close\n                foreach (var leg in _orderLegs)\n                {\n                    var close = Securities[leg.Symbol].Close;\n                    leg.OrderPrice = close * 1.001m;\n                }\n\n                tickets = ComboLegLimitOrder(_orderLegs, -2);\n                _openLegLimitOrders.AddRange(tickets);\n            }\n            else\n            {\n                var combo1 = _openLegLimitOrders.Take(_orderLegs.Count).ToList();\n                var combo2 = _openLegLimitOrders.Skip(_orderLegs.Count).Take(_orderLegs.Count).ToList();\n\n                // check if either is filled and cancel the other\n                if (CheckGroupOrdersForFills(combo1, combo2))\n                {\n                    return;\n                }\n\n                // if neither order has filled, bring in the limits by a penny\n\n                foreach (var ticket in combo1)\n                {\n                    var newLimit = Math.Round(ticket.Get(OrderField.LimitPrice) + (ticket.Quantity > 0 ? 1m : -1m) * 0.01m, 2);\n                    Debug($\"Updating limits - Combo #1: {newLimit.ToStringInvariant(\"0.00\")}\");\n\n                    ticket.Update(new UpdateOrderFields\n                    {\n                        LimitPrice = newLimit,\n                        Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                    });\n                }\n\n                foreach (var ticket in combo2)\n                {\n                    var newLimit = Math.Round(ticket.Get(OrderField.LimitPrice) + (ticket.Quantity > 0 ? 1m : -1m) * 0.01m, 2);\n                    Debug($\"Updating limits - Combo #2: {newLimit.ToStringInvariant(\"0.00\")}\");\n\n                    ticket.Update(new UpdateOrderFields\n                    {\n                        LimitPrice = newLimit,\n                        Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                    });\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n\n            if (orderEvent.Quantity == 0)\n            {\n                throw new RegressionTestException(\"OrderEvent quantity is Not expected to be 0, it should hold the current order Quantity\");\n            }\n            if (orderEvent.Quantity != order.Quantity)\n            {\n                throw new RegressionTestException($@\"OrderEvent quantity should hold the current order Quantity. Got {orderEvent.Quantity}, expected {order.Quantity}\");\n            }\n            if (order is ComboLegLimitOrder && orderEvent.LimitPrice == 0)\n            {\n                throw new RegressionTestException(\"OrderEvent.LimitPrice is not expected to be 0 for ComboLegLimitOrder\");\n            }\n        }\n\n        private bool CheckGroupOrdersForFills(List<OrderTicket> combo1, List<OrderTicket> combo2)\n        {\n            if (combo1.All(x => x.Status == OrderStatus.Filled))\n            {\n                if (combo2.Any(x => x.Status.IsOpen()))\n                {\n                    Log(combo1[0].OrderType + \": Canceling combo #2, combo #1 is filled.\");\n                    combo2.ForEach(x => x.Cancel(\"Combo #1 filled.\"));\n                }\n\n                return true;\n            }\n\n            if (combo2.All(x => x.Status == OrderStatus.Filled))\n            {\n                if (combo1.Any(x => x.Status.IsOpen()))\n                {\n                    Log(combo1[0].OrderType + \": Canceling combo #1, combo #2 is filled.\");\n                    combo1.ForEach(x => x.Cancel(\"Combo #2 filled.\"));\n                }\n\n                return true;\n            }\n\n            return false;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var filledOrders = Transactions.GetOrders(x => x.Status == OrderStatus.Filled).ToList();\n            var orderTickets = Transactions.GetOrderTickets().ToList();\n            var openOrders = Transactions.GetOpenOrders();\n            var openOrderTickets = Transactions.GetOpenOrderTickets().ToList();\n            var remainingOpenOrders = Transactions.GetOpenOrdersRemainingQuantity();\n\n            // 6 market, 6 limit, 6 leg limit.\n            // Out of the 6 limit orders, 3 are expected to be canceled.\n            var expectedOrdersCount = 18;\n            var expectedFillsCount = 15;\n            if (filledOrders.Count != expectedFillsCount || orderTickets.Count != expectedOrdersCount)\n            {\n                throw new RegressionTestException($\"There were expected {expectedFillsCount} filled orders and {expectedOrdersCount} order tickets, but there were {filledOrders.Count} filled orders and {orderTickets.Count} order tickets\");\n            }\n\n            var filledComboMarketOrders = filledOrders.Where(x => x.Type == OrderType.ComboMarket).ToList();\n            var filledComboLimitOrders = filledOrders.Where(x => x.Type == OrderType.ComboLimit).ToList();\n            var filledComboLegLimitOrders = filledOrders.Where(x => x.Type == OrderType.ComboLegLimit).ToList();\n            if (filledComboMarketOrders.Count != 6 || filledComboLimitOrders.Count != 3 || filledComboLegLimitOrders.Count != 6)\n            {\n                throw new RegressionTestException(\n                    \"There were expected 6 filled market orders, 3 filled combo limit orders and 6 filled combo leg limit orders, \" +\n                    $@\"but there were {filledComboMarketOrders.Count} filled market orders, {filledComboLimitOrders.Count} filled combo limit orders and {filledComboLegLimitOrders.Count} filled combo leg limit orders\");\n            }\n\n            if (openOrders.Count != 0 || openOrderTickets.Count != 0)\n            {\n                throw new RegressionTestException($\"No open orders or tickets were expected\");\n            }\n\n            if (remainingOpenOrders != 0m)\n            {\n                throw new RegressionTestException($\"No remaining quantity to be filled from open orders was expected\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"18\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98838\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$2000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"58.98%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"bec09c16bbc4d87a4e5122f29dd5a38b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ComboOrdersFillModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm that implements a fill model with combo orders\n    /// </summary>\n    public class ComboOrdersFillModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _spy;\n        private Security _ibm;\n        private Dictionary<OrderType, int> _orderTypes;\n\n        public override void Initialize()\n        {\n            SetStartDate(2019, 1, 1);\n            SetEndDate(2019, 1, 20);\n\n            _orderTypes = new Dictionary<OrderType, int>();\n            _spy = AddEquity(\"SPY\", Resolution.Hour);\n            _ibm = AddEquity(\"IBM\", Resolution.Hour);\n\n            _spy.SetFillModel(new CustomPartialFillModel());\n            _ibm.SetFillModel(new CustomPartialFillModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var legs = new List<Leg>() { Leg.Create(_spy.Symbol, 1), Leg.Create(_ibm.Symbol, -1)};\n                ComboMarketOrder(legs, 100);\n                ComboLimitOrder(legs, 100, Math.Round(_spy.BidPrice));\n\n                legs = new List<Leg>() { Leg.Create(_spy.Symbol, 1, Math.Round(_spy.BidPrice) + 1), Leg.Create(_ibm.Symbol, -1, Math.Round(_ibm.BidPrice) + 1) };\n                ComboLegLimitOrder(legs, 100);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if(orderEvent.Status == OrderStatus.Filled)\n            {\n                var orderType = Transactions.GetOrderById(orderEvent.OrderId).Type;\n                if (orderType == OrderType.ComboMarket && orderEvent.AbsoluteFillQuantity != 50)\n                {\n                    throw new RegressionTestException($\"The absolute quantity filled for all combo market orders should be 50, but for order {orderEvent.OrderId} was {orderEvent.AbsoluteFillQuantity}\");\n                }\n\n                if (orderType == OrderType.ComboLimit && orderEvent.AbsoluteFillQuantity != 20)\n                {\n                    throw new RegressionTestException($\"The absolute quantity filled for all combo limit orders should be 20, but for order {orderEvent.OrderId} was {orderEvent.AbsoluteFillQuantity}\");\n                }\n\n                if (orderType == OrderType.ComboLegLimit && orderEvent.AbsoluteFillQuantity != 10)\n                {\n                    throw new RegressionTestException($\"The absolute quantity filled for all combo leg limit orders should be 20, but for order {orderEvent.OrderId} was {orderEvent.AbsoluteFillQuantity}\");\n                }\n\n                _orderTypes[orderType] = 1;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_orderTypes.Keys.Count != 3)\n            {\n                throw new RegressionTestException($\"Just 3 different types of order were submitted in this algorithm, but the amount of order types was {_orderTypes.Count}\");\n            }\n\n            if (!_orderTypes.Keys.Contains(OrderType.ComboMarket))\n            {\n                throw new RegressionTestException($\"One Combo Market Order should have been submitted but it was not\");\n            }\n\n            if (!_orderTypes.Keys.Contains(OrderType.ComboLimit))\n            {\n                throw new RegressionTestException($\"One Combo Limit Order should have been submitted but it was not\");\n            }\n\n            if (!_orderTypes.Keys.Contains(OrderType.ComboLegLimit))\n            {\n                throw new RegressionTestException($\"One Combo Leg Limit Order should have been submitted but it was not\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 281;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"162.471%\"},\n            {\"Drawdown\", \"1.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104781.43\"},\n            {\"Net Profit\", \"4.781%\"},\n            {\"Sharpe Ratio\", \"8.272\"},\n            {\"Sortino Ratio\", \"6.986\"},\n            {\"Probabilistic Sharpe Ratio\", \"87.028%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.049\"},\n            {\"Beta\", \"0.646\"},\n            {\"Annual Standard Deviation\", \"0.119\"},\n            {\"Annual Variance\", \"0.014\"},\n            {\"Information Ratio\", \"-8.927\"},\n            {\"Tracking Error\", \"0.069\"},\n            {\"Treynor Ratio\", \"1.519\"},\n            {\"Total Fees\", \"$6.00\"},\n            {\"Estimated Strategy Capacity\", \"$250000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"9.81%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"397d4e81b8c7fa9258e18c4bcf4154e1\"}\n        };\n    }\n\n    public class CustomPartialFillModel : FillModel\n    {\n        private readonly Dictionary<int, decimal> _absoluteRemainingByOrderId;\n\n        public CustomPartialFillModel()\n        {\n            _absoluteRemainingByOrderId = new Dictionary<int, decimal>();\n        }\n\n        private List<OrderEvent> FillOrdersPartially(FillModelParameters parameters, List<OrderEvent> fills, int quantity)\n        {\n            var partialFills = new List<OrderEvent>();\n            if (fills.Count == 0)\n            {\n                return partialFills;\n            }\n\n            foreach (var kvp in parameters.SecuritiesForOrders.OrderBy(kvp => kvp.Key.Id))\n            {\n                var order = kvp.Key;\n                var fill = fills.Find(x => x.OrderId == order.Id);\n\n                decimal absoluteRemaining;\n                if (!_absoluteRemainingByOrderId.TryGetValue(order.Id, out absoluteRemaining))\n                {\n                    absoluteRemaining = order.AbsoluteQuantity;\n                }\n\n                // Set the fill amount\n                fill.FillQuantity = Math.Sign(order.Quantity) * quantity;\n                if (Math.Min(Math.Abs(fill.FillQuantity), absoluteRemaining) == absoluteRemaining)\n                {\n                    fill.FillQuantity = Math.Sign(order.Quantity) * absoluteRemaining;\n                    fill.Status = OrderStatus.Filled;\n                    _absoluteRemainingByOrderId.Remove(order.Id);\n                }\n                else\n                {\n                    fill.Status = OrderStatus.PartiallyFilled;\n                    _absoluteRemainingByOrderId[order.Id] = absoluteRemaining - Math.Abs(fill.FillQuantity);\n                    var price = fill.FillPrice;\n                    //_algorithm.Debug($\"{_algorithm.Time} - Partial Fill - Remaining {_absoluteRemainingByOrderId[order.Id]} Price - {price}\");\n                }\n\n                partialFills.Add(fill);\n            }\n\n            return partialFills;\n        }\n\n        public override List<OrderEvent> ComboMarketFill(Order order, FillModelParameters parameters)\n        {\n            var fills = base.ComboMarketFill(order, parameters);\n            var partialFills = FillOrdersPartially(parameters, fills, 50);\n            return partialFills;\n        }\n\n        public override List<OrderEvent> ComboLimitFill(Order order, FillModelParameters parameters)\n        {\n            var fills = base.ComboLimitFill(order, parameters);\n            var partialFills = FillOrdersPartially(parameters, fills, 20);\n            return partialFills;\n        }\n\n        public override List<OrderEvent> ComboLegLimitFill(Order order, FillModelParameters parameters)\n        {\n            var fills = base.ComboLegLimitFill(order, parameters);\n            var partialFills = FillOrdersPartially(parameters, fills, 10);\n            return partialFills;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CompleteOrderTagUpdateAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that closed orders can be updated with a new tag\n    /// </summary>\n    public class CompleteOrderTagUpdateAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private static string TagAfterFill = \"This is the tag set after order was filled.\";\n        private static string TagAfterCanceled = \"This is the tag set after order was canceled.\";\n\n        private OrderTicket _marketOrderTicket;\n        private OrderTicket _limitOrderTicket;\n\n        private int _quantity = 100;\n\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                // a limit order to test the tag update after order was canceled\n                if (_limitOrderTicket == null)\n                {\n                    // low price, we don't want it to fill since we are canceling it\n                    _limitOrderTicket = LimitOrder(_spy, 100, Securities[_spy].Price * 0.1m);\n                    _limitOrderTicket.Cancel();\n                }\n                // a market order to test the tag update after order was filled\n                else\n                {\n                    Buy(_spy, _quantity);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Canceled)\n            {\n                if (orderEvent.OrderId != _limitOrderTicket.OrderId)\n                {\n                    throw new RegressionTestException(\"The only canceled order should have been the limit order.\");\n                }\n\n                // update canceled order tag\n                UpdateOrderTag(_limitOrderTicket, TagAfterCanceled, \"Error updating order tag after canceled\");\n            }\n            else if (orderEvent.Status == OrderStatus.Filled)\n            {\n                _marketOrderTicket = Transactions.GetOrderTickets(x => x.OrderType == OrderType.Market).Single();\n                if (orderEvent.OrderId != _marketOrderTicket.OrderId)\n                {\n                    throw new RegressionTestException(\"The only filled order should have been the market order.\");\n                }\n\n                // try to update a field other than the tag\n                var updateFields = new UpdateOrderFields();\n                updateFields.Quantity = 50;\n                var response = _marketOrderTicket.Update(updateFields);\n                if (response.IsSuccess)\n                {\n                    throw new RegressionTestException(\"The market order quantity should not have been updated.\");\n                }\n\n                // update filled order tag\n                UpdateOrderTag(_marketOrderTicket, TagAfterFill, \"Error updating order tag after fill\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // check the filled order\n            AssertOrderTagUpdate(_marketOrderTicket, TagAfterFill, \"filled\");\n            if (_marketOrderTicket.Quantity != _quantity || _marketOrderTicket.QuantityFilled != _quantity)\n            {\n                throw new RegressionTestException(\"The market order quantity should not have been updated.\");\n            }\n\n            // check the canceled order\n            AssertOrderTagUpdate(_limitOrderTicket, TagAfterCanceled, \"canceled\");\n        }\n\n        private void AssertOrderTagUpdate(OrderTicket ticket, string expectedTag, string orderAction)\n        {\n            if (ticket == null)\n            {\n                throw new RegressionTestException($\"The order ticket was not set for the {orderAction} order\");\n            }\n\n            if (ticket.Tag != expectedTag)\n            {\n                throw new RegressionTestException($\"Order ticket tag was not updated after order was {orderAction}\");\n            }\n\n            var order = Transactions.GetOrderById(ticket.OrderId);\n            if (order.Tag != expectedTag)\n            {\n                throw new RegressionTestException($\"Order tag was not updated after order was {orderAction}\");\n            }\n        }\n\n        private static void UpdateOrderTag(OrderTicket ticket, string tag, string errorMessagePrefix)\n        {\n            var updateFields = new UpdateOrderFields();\n            updateFields.Tag = tag;\n            var response = ticket.Update(updateFields);\n\n            if (response.IsError)\n            {\n                throw new RegressionTestException($\"{errorMessagePrefix}: {response.ErrorMessage}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"21.706%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100251.47\"},\n            {\"Net Profit\", \"0.251%\"},\n            {\"Sharpe Ratio\", \"5.078\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.483%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.122\"},\n            {\"Beta\", \"0.144\"},\n            {\"Annual Standard Deviation\", \"0.032\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-9.515\"},\n            {\"Tracking Error\", \"0.191\"},\n            {\"Treynor Ratio\", \"1.13\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$210000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.89%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"8fba4f724843997ef421cf26ccabe51b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CompositeAlphaModelFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Show cases how to use the <see cref=\"CompositeAlphaModel\"/> to define\n    /// </summary>\n    public class CompositeAlphaModelFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            // even though we're using a framework algorithm, we can still add our securities\n            // using the AddEquity/Forex/Crypto/ect methods and then pass them into a manual\n            // universe selection model using Securities.Keys\n            AddEquity(\"SPY\");\n            AddEquity(\"IBM\");\n            AddEquity(\"BAC\");\n            AddEquity(\"AIG\");\n\n            // define a manual universe of all the securities we manually registered\n            SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            // define alpha model as a composite of the rsi and ema cross models\n            SetAlpha(new CompositeAlphaModel(\n                new RsiAlphaModel(),\n                new EmaCrossAlphaModel()\n            ));\n\n            // default models for the rest\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 208;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"16\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.18%\"},\n            {\"Compounding Annual Return\", \"-35.728%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"-0.690\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99436.42\"},\n            {\"Net Profit\", \"-0.564%\"},\n            {\"Sharpe Ratio\", \"-2.767\"},\n            {\"Sortino Ratio\", \"-3.388\"},\n            {\"Probabilistic Sharpe Ratio\", \"32.568%\"},\n            {\"Loss Rate\", \"70%\"},\n            {\"Win Rate\", \"30%\"},\n            {\"Profit-Loss Ratio\", \"0.03\"},\n            {\"Alpha\", \"-0.771\"},\n            {\"Beta\", \"0.296\"},\n            {\"Annual Standard Deviation\", \"0.068\"},\n            {\"Annual Variance\", \"0.005\"},\n            {\"Information Ratio\", \"-13.734\"},\n            {\"Tracking Error\", \"0.157\"},\n            {\"Treynor Ratio\", \"-0.632\"},\n            {\"Total Fees\", \"$39.85\"},\n            {\"Estimated Strategy Capacity\", \"$4700000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"60.79%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7a65de0f613e5c6161e410d499f45445\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CompositeIndicatorWorksAsExpectedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the CompositeIndicator,  \n    /// using either a lambda expression or a method reference.\n    /// </summary>\n    public class CompositeIndicatorWorksAsExpectedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CompositeIndicator _compositeMinDirect;\n        private CompositeIndicator _compositeMinMethod;\n        private bool _dataReceived;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 4);\n            SetEndDate(2013, 10, 5);\n            AddEquity(\"SPY\", Resolution.Minute);\n\n            var closePrice = Identity(\"SPY\", Resolution.Minute, Field.Close);\n            var lowPrice = MIN(\"SPY\", 420, Resolution.Minute, Field.Low);\n\n            _compositeMinDirect = new CompositeIndicator(\"CompositeMinDirect\", closePrice, lowPrice, (l, r) => new IndicatorResult(Math.Min(l.Current.Value, r.Current.Value)));\n            _compositeMinMethod = new CompositeIndicator(\"CompositeMinMethod\", closePrice, lowPrice, Composer);\n\n            _dataReceived = false;\n        }\n\n        private IndicatorResult Composer(IndicatorBase l, IndicatorBase r)\n        {\n            return new IndicatorResult(Math.Min(l.Current.Value, r.Current.Value));\n        }\n\n        public override void OnData(Slice data)\n        {\n            _dataReceived = true;\n\n            if (_compositeMinDirect.Current.Value != _compositeMinMethod.Current.Value)\n            {\n                throw new RegressionTestException($\"Values of indicators differ: {_compositeMinDirect.Current.Value} | {_compositeMinMethod.Current.Value}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_dataReceived)\n            {\n                throw new RegressionTestException(\"No data was processed during the algorithm execution.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CompositeRiskManagementModelFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Show cases how to use the <see cref=\"CompositeRiskManagementModel\"/> to define\n    /// </summary>\n    public class CompositeRiskManagementModelFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, System.TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            // define risk management model as a composite of several risk management models\n            SetRiskManagement(new CompositeRiskManagementModel(\n                new MaximumUnrealizedProfitPercentPerSecurity(0.01m),\n                new MaximumDrawdownPercentPerSecurity(0.01m)\n            ));\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"1.05%\"},\n            {\"Average Loss\", \"-1.01%\"},\n            {\"Compounding Annual Return\", \"227.385%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0.361\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101527.86\"},\n            {\"Net Profit\", \"1.528%\"},\n            {\"Sharpe Ratio\", \"7.572\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"65.639%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"1.04\"},\n            {\"Alpha\", \"-0.288\"},\n            {\"Beta\", \"0.994\"},\n            {\"Annual Standard Deviation\", \"0.221\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-46.455\"},\n            {\"Tracking Error\", \"0.006\"},\n            {\"Treynor Ratio\", \"1.686\"},\n            {\"Total Fees\", \"$24.08\"},\n            {\"Estimated Strategy Capacity\", \"$23000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"139.03%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"fa7c51aaf284cdc29cb4c0ac8ebd5356\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConfidenceWeightedFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/> and <see cref=\"ConstantAlphaModel\"/>\n    /// generating a constant <see cref=\"Insight\"/> with a 0.25 confidence\n    /// </summary>\n    public class ConfidenceWeightedFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, 0.25));\n            SetPortfolioConstruction(new ConfidenceWeightedPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (// holdings value should be 0.25 - to avoid price fluctuation issue we compare with 0.28 and 0.23\n                Portfolio.TotalHoldingsValue > Portfolio.TotalPortfolioValue * 0.28m\n                ||\n                Portfolio.TotalHoldingsValue < Portfolio.TotalPortfolioValue * 0.23m)\n            {\n                throw new RegressionTestException($\"Unexpected Total Holdings Value: {Portfolio.TotalHoldingsValue}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"39.071%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"-0.028\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100422.57\"},\n            {\"Net Profit\", \"0.423%\"},\n            {\"Sharpe Ratio\", \"5.481\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.478%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.94\"},\n            {\"Alpha\", \"-0.188\"},\n            {\"Beta\", \"0.248\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-9.998\"},\n            {\"Tracking Error\", \"0.167\"},\n            {\"Treynor Ratio\", \"1.22\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$45000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"5.15%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"ae4986890fe7ab09ddb93059888f34c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidateDifferentTickTypesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm asserts we can consolidate Tick data with different tick types\n    /// </summary>\n    public class ConsolidateDifferentTickTypesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _thereIsAtLeastOneQuoteTick;\n        private bool _thereIsAtLeastOneTradeTick;\n\n        private bool _thereIsAtLeastOneTradeBar;\n        private bool _thereIsAtLeastOneQuoteBar;\n\n        private int _consolidationCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 06);\n            SetEndDate(2013, 10, 07);\n            SetCash(1000000);\n\n            var equity = AddEquity(\"SPY\", Resolution.Tick, Market.USA);\n            var quoteConsolidator = Consolidate(equity.Symbol, Resolution.Tick, TickType.Quote, (Tick tick) => OnQuoteTick(tick));\n            _thereIsAtLeastOneQuoteTick = false;\n\n            var tradeConsolidator = Consolidate(equity.Symbol, Resolution.Tick, TickType.Trade, (Tick tick) => OnTradeTick(tick));\n            _thereIsAtLeastOneTradeTick = false;\n\n            // TickConsolidators with max count\n            Consolidate(equity.Symbol, 10m, TickType.Trade, (TradeBar tick) => OnTradeTickMaxCount(tick));\n            Consolidate(equity.Symbol, 10m, TickType.Quote, (QuoteBar tick) => OnQuoteTickMaxCount(tick));\n        }\n\n        public void OnTradeTickMaxCount(TradeBar tradeBar)\n        {\n            _thereIsAtLeastOneTradeBar = true;\n        }\n        public void OnQuoteTickMaxCount(QuoteBar quoteBar)\n        {\n            _thereIsAtLeastOneQuoteBar = true;\n\n            // Let's shortcut to reduce regression test duration: algorithms using tick data are too long\n            if (++_consolidationCount >= 1000)\n            {\n                Quit();\n            }\n        }\n\n        public void OnQuoteTick(Tick tick)\n        {\n            _thereIsAtLeastOneQuoteTick = true;\n            if (tick.TickType != TickType.Quote)\n            {\n                throw new RegressionTestException($\"The type of the tick should be Quote, but was {tick.TickType}\");\n            }\n        }\n\n        public void OnTradeTick(Tick tick)\n        {\n            _thereIsAtLeastOneTradeTick = true;\n            if (tick.TickType != TickType.Trade)\n            {\n                throw new RegressionTestException($\"The type of the tick should be Trade, but was {tick.TickType}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_thereIsAtLeastOneQuoteTick)\n            {\n                throw new RegressionTestException($\"There should have been at least one tick in OnQuoteTick() method, but there wasn't\");\n            }\n\n            if (!_thereIsAtLeastOneTradeTick)\n            {\n                throw new RegressionTestException($\"There should have been at least one tick in OnTradeTick() method, but there wasn't\");\n            }\n\n            if (!_thereIsAtLeastOneTradeBar)\n            {\n                throw new RegressionTestException($\"There should have been at least one bar in OnTradeTickMaxCount() method, but there wasn't\");\n            }\n\n            if (!_thereIsAtLeastOneQuoteBar)\n            {\n                throw new RegressionTestException($\"There should have been at least one bar in OnQuoteTickMaxCount() method, but there wasn't\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 12190;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm asserts the consolidated US equity daily bars from the hour bars exactly matches\n    /// the daily bars returned from the database\n    /// </summary>\n    public class ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private RelativeStrengthIndex _rsi;\n        private RelativeStrengthIndex _rsiTimeDelta;\n        private Dictionary<DateTime, decimal> _values = new();\n        private int _count;\n        private bool _indicatorsCompared;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 5, 1);\n            SetEndDate(2020, 6, 5);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            // We will use these two indicators to compare the daily consolidated bars equals\n            // the ones returned from the database. We use this specific type of indicator as\n            // it depends on its previous values. Thus, if at some point the bars received by\n            // the indicators differ, so will their final values\n            _rsi = new RelativeStrengthIndex(\"FIRST\", 15, MovingAverageType.Wilders);\n            RegisterIndicator(_spy, _rsi, Resolution.Daily, selector: (bar) =>\n            {\n                var tradeBar = (TradeBar)bar;\n                return (tradeBar.Close + tradeBar.Open) / 2;\n            });\n\n            // We won't register this indicator as we will update it manually at the end of the\n            // month, so that we can compare the values of the indicator that received consolidated\n            // bars and the values of this one\n            _rsiTimeDelta = new RelativeStrengthIndex(\"SECOND\" ,15, MovingAverageType.Wilders);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n\n            if (slice.ContainsKey(_spy) && slice[_spy] != null)\n            {\n                if (Time.Month == EndDate.Month)\n                {\n                    var history = History(_spy, _count, Resolution.Daily);\n                    foreach (var bar in history)\n                    {\n                        var time = bar.EndTime.Date;\n                        var average = (bar.Close + bar.Open) / 2;\n                        _rsiTimeDelta.Update(bar.EndTime, average);\n                        if (_rsiTimeDelta.Current.Value != _values[time])\n                        {\n                            throw new RegressionTestException($\"Both {_rsi.Name} and {_rsiTimeDelta.Name} should have the same values, but they differ. {_rsi.Name}: {_values[time]} | {_rsiTimeDelta.Name}: {_rsiTimeDelta.Current.Value}\");\n                        }\n                    }\n                    _indicatorsCompared = true;\n                    Quit();\n                }\n                else\n                {\n                    _values[Time.Date] = _rsi.Current.Value;\n\n                    // Since the symbol resolution is hour and the symbol is equity, we know the last bar received in a day will\n                    // be at the market close, this is 16h. We need to count how many daily bars were consolidated in order to know\n                    // how many we need to request from the history\n                    if (Time.Hour == 16)\n                    {\n                        _count++;\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_indicatorsCompared)\n            {\n                throw new RegressionTestException($\"Indicators {_rsi.Name} and {_rsiTimeDelta.Name} should have been compared, but they were not. Please make sure the indicators are getting SPY data\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 290;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.215\"},\n            {\"Tracking Error\", \"0.159\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidateRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing data type bugs in the Consolidate API. Related to GH 4205.\n    /// </summary>\n    public class ConsolidateRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<int> _consolidationCounts;\n        private List<int> _expectedConsolidationCounts;\n        private List<SimpleMovingAverage> _smas;\n        private List<DateTime> _lastSmaUpdates;\n        private int _customDataConsolidatorCount;\n        private Future _future;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 20);\n\n            var SP500 = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            var symbol = FuturesChain(SP500).OrderBy(x => x.Symbol.ID.Date).First();\n            _future = AddFutureContract(symbol);\n\n            var tradableDatesCount = QuantConnect.Time.EachTradeableDayInTimeZone(_future.Exchange.Hours,\n                StartDate,\n                EndDate,\n                _future.Exchange.TimeZone,\n                false).Count();\n            _expectedConsolidationCounts = new(10);\n\n            Consolidate<QuoteBar>(symbol, time => new CalendarInfo(time.RoundDown(TimeSpan.FromDays(1)), TimeSpan.FromDays(1)),\n                bar => UpdateQuoteBar(bar, 0));\n            // The consolidator will respect the full 1 day bar span and will not consolidate the last tradable date,\n            // since scan will not be called at 202/01/21 12am\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            Consolidate<QuoteBar>(symbol, time => new CalendarInfo(time.RoundDown(TimeSpan.FromDays(1)), TimeSpan.FromDays(1)),\n                TickType.Quote, bar => UpdateQuoteBar(bar, 1));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            Consolidate<QuoteBar>(symbol, TimeSpan.FromDays(1), bar => UpdateQuoteBar(bar, 2));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            Consolidate(symbol, Resolution.Daily, TickType.Quote, (Action<QuoteBar>)(bar => UpdateQuoteBar(bar, 3)));\n            _expectedConsolidationCounts.Add(tradableDatesCount);\n\n            Consolidate(symbol, TimeSpan.FromDays(1), bar => UpdateTradeBar(bar, 4));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            Consolidate<TradeBar>(symbol, TimeSpan.FromDays(1), bar => UpdateTradeBar(bar, 5));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            // Test using abstract T types, through defining a 'BaseData' handler\n\n            Consolidate(symbol, Resolution.Daily, null, (Action<BaseData>)(bar => UpdateBar(bar, 6)));\n            _expectedConsolidationCounts.Add(tradableDatesCount);\n\n            Consolidate(symbol, TimeSpan.FromDays(1), null, (Action<BaseData>)(bar => UpdateBar(bar, 7)));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            Consolidate(symbol, TimeSpan.FromDays(1), (Action<BaseData>)(bar => UpdateBar(bar, 8)));\n            _expectedConsolidationCounts.Add(tradableDatesCount - 1);\n\n            _consolidationCounts = Enumerable.Repeat(0, _expectedConsolidationCounts.Count).ToList();\n            _smas = _consolidationCounts.Select(_ => new SimpleMovingAverage(10)).ToList();\n            _lastSmaUpdates = _consolidationCounts.Select(_ => DateTime.MinValue).ToList();\n\n            // custom data\n            var customSecurity = AddData<CustomDataRegressionAlgorithm.Bitcoin>(\"BTC\", Resolution.Minute);\n            Consolidate<TradeBar>(customSecurity.Symbol, TimeSpan.FromDays(1), bar => _customDataConsolidatorCount++);\n\n            try\n            {\n                Consolidate<QuoteBar>(customSecurity.Symbol, TimeSpan.FromDays(1), bar => { UpdateQuoteBar(bar, -1); });\n                throw new RegressionTestException($\"Expected {nameof(ArgumentException)} to be thrown\");\n            }\n            catch (ArgumentException)\n            {\n                // will try to use BaseDataConsolidator for which input is TradeBars not QuoteBars\n            }\n        }\n\n        private void UpdateBar(BaseData tradeBar, int position)\n        {\n            if (!(tradeBar is TradeBar))\n            {\n                throw new RegressionTestException(\"Expected a TradeBar\");\n            }\n            _consolidationCounts[position]++;\n            _smas[position].Update(tradeBar.EndTime, tradeBar.Value);\n            _lastSmaUpdates[position] = tradeBar.EndTime;\n        }\n        private void UpdateTradeBar(TradeBar tradeBar, int position)\n        {\n            _consolidationCounts[position]++;\n            _smas[position].Update(tradeBar.EndTime, tradeBar.High);\n            _lastSmaUpdates[position] = tradeBar.EndTime;\n        }\n        private void UpdateQuoteBar(QuoteBar quoteBar, int position)\n        {\n            _consolidationCounts[position]++;\n            _smas[position].Update(quoteBar.EndTime, quoteBar.High);\n            _lastSmaUpdates[position] = quoteBar.EndTime;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            for (var i = 0; i < _consolidationCounts.Count; i++)\n            {\n                var consolidationCount = _consolidationCounts[i];\n                var expectedConsolidationCount = _expectedConsolidationCounts[i];\n\n                if (consolidationCount != expectedConsolidationCount)\n                {\n                    throw new RegressionTestException($\"Expected {expectedConsolidationCount} consolidations for consolidator {i} but received {consolidationCount}\");\n                }\n            }\n\n            if (_customDataConsolidatorCount == 0)\n            {\n                throw new RegressionTestException($\"Unexpected custom data consolidation count: {_customDataConsolidatorCount}\");\n            }\n\n            for (var i = 0; i < _smas.Count; i++)\n            {\n                if (_smas[i].Samples != _expectedConsolidationCounts[i])\n                {\n                    throw new RegressionTestException($\"Expected {_expectedConsolidationCounts} samples in each SMA but found {_smas[i].Samples} in SMA in index {i}\");\n                }\n\n                if (_smas[i].Current.Time != _lastSmaUpdates[i])\n                {\n                    throw new RegressionTestException($\"Expected SMA in index {i} to have been last updated at {_lastSmaUpdates[i]} but was {_smas[i].Current.Time}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && _future.HasData)\n            {\n                SetHoldings(_future.Symbol, 0.5);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14228;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"665.524%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"109332.4\"},\n            {\"Net Profit\", \"9.332%\"},\n            {\"Sharpe Ratio\", \"9.805\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"93.474%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"3.164\"},\n            {\"Beta\", \"0.957\"},\n            {\"Annual Standard Deviation\", \"0.383\"},\n            {\"Annual Variance\", \"0.146\"},\n            {\"Information Ratio\", \"8.29\"},\n            {\"Tracking Error\", \"0.379\"},\n            {\"Treynor Ratio\", \"3.917\"},\n            {\"Total Fees\", \"$15.05\"},\n            {\"Estimated Strategy Capacity\", \"$2100000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"64.34%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d814db6d5a9c97ee6de477ea06cd3834\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidateScanRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting consolidation happing flushed due to scan calls\n    /// </summary>\n    public class ConsolidateScanRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Queue<DateTime> _consolidationDaily = new();\n        private readonly Queue<DateTime> _consolidationHourly = new();\n        private readonly Queue<DateTime> _consolidation2Days = new();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 10);\n\n            AddEquity(\"SPY\", Resolution.Hour);\n            Consolidate(\"SPY\", Resolution.Daily, (TradeBar bar) =>\n            {\n                Debug($\"Consolidated.Daily: {Time} {bar}\");\n                var expectedTime = _consolidationDaily.Dequeue();\n                if (expectedTime != Time)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidation time {expectedTime} != {Time}\");\n                }\n\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(\"SPY\", 1);\n                }\n            });\n            _consolidationDaily.Enqueue(new DateTime(2013, 10, 7, 16, 0, 0));\n            _consolidationDaily.Enqueue(new DateTime(2013, 10, 8, 16, 0, 0));\n            _consolidationDaily.Enqueue(new DateTime(2013, 10, 9, 16, 0, 0));\n            _consolidationDaily.Enqueue(new DateTime(2013, 10, 10, 16, 0, 0));\n\n            Consolidate(\"SPY\", TimeSpan.FromHours(3), (TradeBar bar) =>\n            {\n                Debug($\"Consolidated.FromHours(3): {Time} {bar}\");\n                var expectedTime = _consolidationHourly.Dequeue();\n                if (expectedTime != Time)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidation time {expectedTime} != {Time} 3 hours\");\n                }\n            });\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 7, 12, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 7, 15, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 7, 18, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 8, 12, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 8, 15, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 8, 18, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 9, 12, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 9, 15, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 9, 18, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 10, 12, 0, 0));\n            _consolidationHourly.Enqueue(new DateTime(2013, 10, 10, 15, 0, 0));\n\n            Consolidate(\"SPY\", TimeSpan.FromDays(2), (TradeBar bar) =>\n            {\n                Debug($\"Consolidated.2Days: {Time} {bar}\");\n                var expectedTime = _consolidation2Days.Dequeue();\n                if (expectedTime != Time)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidation time {expectedTime} != {Time} 2 days\");\n                }\n            });\n            _consolidation2Days.Enqueue(new DateTime(2013, 10, 9, 9, 0, 0));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_consolidationDaily.Count != 0 || _consolidationHourly.Count != 0 || _consolidation2Days.Count != 0)\n            {\n                throw new RegressionTestException($\"Unexpected consolidation count\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 64;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"186.478%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101062.91\"},\n            {\"Net Profit\", \"1.063%\"},\n            {\"Sharpe Ratio\", \"5.448\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.055\"},\n            {\"Beta\", \"1.003\"},\n            {\"Annual Standard Deviation\", \"0.272\"},\n            {\"Annual Variance\", \"0.074\"},\n            {\"Information Ratio\", \"-33.89\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.479\"},\n            {\"Total Fees\", \"$3.45\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"25.24%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"bbda6d0a04ae0b87b2fa10e036296cbb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidateWithSizeAttributeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests different overloads of the Consolidate method\n    /// using a variety of bar types, including RenkoBar, VolumeRenkoBar, RangeBar,\n    /// as well as common bars like TradeBar and QuoteBar with a maxCount parameter.\n    /// It verifies that each overload functions correctly and that the appropriate consolidators are properly created and invoked.\n    /// </summary>\n    public class ConsolidateWithSizeAttributeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private List<SimpleMovingAverage> _smaIndicators;\n        private List<IDataConsolidator> _consolidators;\n\n        /// <summary>\n        /// Initializes the algorithm.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            _smaIndicators = new List<SimpleMovingAverage>()\n            {\n                new SimpleMovingAverage(\"RenkoBarSMA\", 10),\n                new SimpleMovingAverage(\"VolumeRenkoBarSMA\", 10),\n                new SimpleMovingAverage(\"RangeBarSMA\", 10),\n                new SimpleMovingAverage(\"TradeBarSMA\", 10),\n                new SimpleMovingAverage(\"QuoteBarSMA\", 10),\n                new SimpleMovingAverage(\"BaseDataSMA\", 10),\n            };\n            _consolidators = new List<IDataConsolidator>()\n            {\n                Consolidate<RenkoBar>(_spy, 0.1m, null, renkoBar => UpdateWithRenkoBar(renkoBar, 0)),\n                Consolidate<VolumeRenkoBar>(_spy, 10000m, null, volumeRenkoBar => UpdateWithVolumeRenkoBar(volumeRenkoBar, 1)),\n                Consolidate<RangeBar>(_spy, 12m, null, rangeBar => UpdateWithRangeBar(rangeBar, 2)),\n\n                // Trade and Quote consolidators with max count\n                Consolidate<TradeBar>(_spy, 10, null, tradeBar => UpdateWithTradeBar(tradeBar, 3)),\n                Consolidate<QuoteBar>(_spy, 10, null, quoteBar => UpdateWithQuoteBar(quoteBar, 4)),\n\n                // BaseData consolidator with max count\n                Consolidate<BaseData>(_spy, 10, null, quoteBar => UpdateWithBaseData(quoteBar, 5))\n            };\n        }\n\n        // <summary>\n        /// Updates the BaseDataSMA indicator with the bar's value.\n        /// </summary>\n        private void UpdateWithBaseData(BaseData baseData, int position)\n        {\n            _smaIndicators[position].Update(baseData.EndTime, baseData.Value);\n        }\n\n        /// <summary>\n        /// Updates the TradeBarSMA indicator with the bar's high price.\n        /// </summary>\n        private void UpdateWithTradeBar(TradeBar tradeBar, int position)\n        {\n            _smaIndicators[position].Update(tradeBar.EndTime, tradeBar.High);\n        }\n\n        /// <summary>\n        /// Updates the QuoteBarSMA indicator with the bar's high price.\n        /// </summary>\n        private void UpdateWithQuoteBar(QuoteBar quoteBar, int position)\n        {\n            _smaIndicators[position].Update(quoteBar.EndTime, quoteBar.High);\n        }\n\n        /// <summary>\n        /// Updates the RenkoBarSMA indicator with the bar's high price.\n        /// </summary>\n        private void UpdateWithRenkoBar(RenkoBar renkoBar, int position)\n        {\n            _smaIndicators[position].Update(renkoBar.EndTime, renkoBar.High);\n        }\n\n        /// <summary>\n        /// Updates the VolumeRenkoBarSMA indicator with the bar's high price.\n        /// </summary>\n        private void UpdateWithVolumeRenkoBar(VolumeRenkoBar volumeRenkoBar, int position)\n        {\n            _smaIndicators[position].Update(volumeRenkoBar.EndTime, volumeRenkoBar.High);\n        }\n\n        /// <summary>\n        /// Updates the RangeBarSMA indicator with the bar's high price.\n        /// </summary>\n        private void UpdateWithRangeBar(RangeBar rangeBar, int position)\n        {\n            _smaIndicators[position].Update(rangeBar.EndTime, rangeBar.High);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Verifies that each SMA was updated and is ready, confirming the Consolidate overloads functioned correctly.\n            foreach (var sma in _smaIndicators)\n            {\n                if (sma.Samples == 0)\n                {\n                    throw new RegressionTestException($\"The indicator '{sma.Name}' did not receive any updates. This indicates the associated consolidator was not triggered.\");\n                }\n                if (!sma.IsReady)\n                {\n                    throw new RegressionTestException($\"The indicator '{sma.Name}' is not ready. It received only {sma.Samples} samples, but requires at least {sma.Period} to be ready.\");\n                }\n            }\n\n            var expectedConsolidatorTypes = new List<Type>()\n            {\n                typeof(RenkoConsolidator),\n                typeof(VolumeRenkoConsolidator),\n                typeof(RangeConsolidator),\n                typeof(TradeBarConsolidator),\n                typeof(QuoteBarConsolidator),\n                typeof(BaseDataConsolidator)\n            };\n\n            for (var i = 0; i < _consolidators.Count; i++)\n            {\n                var consolidator = _consolidators[i];\n                if (consolidator.GetType() != expectedConsolidatorTypes[i])\n                {\n                    throw new RegressionTestException($\"Expected consolidator type {expectedConsolidatorTypes[i]} but received {consolidator.GetType()}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidatorAnIdentityIndicatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing System.Security.Principal;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #8017\n    /// </summary>\n    public class ConsolidatorAnIdentityIndicatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<DateTime, decimal> _expectedValues = new Dictionary<DateTime, decimal> {\n            { new DateTime(2013, 10, 7, 16, 0, 0),  144.75578537200m },\n            { new DateTime(2013, 10, 8, 16, 0, 0),  143.07840976800m },\n            { new DateTime(2013, 10, 9, 16, 0, 0), 143.15622616200m },\n            { new DateTime(2013, 10, 10, 16, 0, 0),  146.32940578400m },\n            { new DateTime(2013, 10, 11, 16, 0, 0),  147.24590998000m }\n        };\n        private Identity _identity;\n        private int _assertCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var symbol = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            Consolidate(symbol, Resolution.Daily, (TradeBar bar) =>\n            {\n                _assertCount++;\n                if (_expectedValues[Time] != bar.Value)\n                {\n                    throw new RegressionTestException($\"{Time} - Consolidate unexpected current value: {bar.Value}\");\n                }\n            });\n            _identity = Identity(symbol, Resolution.Daily);\n            _identity.Updated += _identity_Updated;\n            var min = MIN(symbol, 5, Resolution.Daily);\n            min.Updated += Min_Updated;\n        }\n\n        private void _identity_Updated(object sender, IndicatorDataPoint updated)\n        {\n            _assertCount++;\n            if (_expectedValues[Time] != _identity.Current.Value)\n            {\n                throw new RegressionTestException($\"{Time} - _identity_Updated unexpected current value: {_identity.Current.Value}\");\n            }\n        }\n\n        private void Min_Updated(object sender, IndicatorDataPoint updated)\n        {\n            _assertCount++;\n            if (_expectedValues[Time] != _identity.Current.Value)\n            {\n                throw new RegressionTestException($\"{Time} - Min_Updated unexpected current value: {_identity.Current.Value}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_assertCount != 15)\n            {\n                throw new RegressionTestException($\"Unexpected asserting count: {_assertCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidatorAndAlgorithmTimeConsistencyWithWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the time consistency of the consolidator and the algorithm\n    /// It is expected to fail if the consolidator and the algorithm time are not in sync\n    /// </summary>\n    public class ConsolidatorAndAlgorithmTimeConsistencyWithWarmupRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 04, 07);\n            SetEndDate(2013, 10, 31);\n\n            AddEquity(\"SPY\", Resolution.Hour);\n            SetWarmup(TimeSpan.FromDays(10), Resolution.Hour);\n            Consolidate(\"SPY\", TimeSpan.FromDays(1), OnConsolidated);\n        }\n\n        public void OnConsolidated(TradeBar bar)\n        {\n            if (Time != bar.EndTime)\n            {\n                throw new RegressionTestException($\"Mismatches between consolidation time and algorithm time: {Time} != {bar.EndTime}\");\n            }\n\n            // check if the consolidation time is midnight\n            if (Time.TimeOfDay != TimeSpan.Zero)\n            {\n                throw new RegressionTestException($\"Unexpected consolidation time {bar.EndTime}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2132;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.81\"},\n            {\"Tracking Error\", \"0.102\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConsolidatorStartTimeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm show casing and asserting the behavior of creating a consolidator specifying the start time\n    /// </summary>\n    public class ConsolidatorStartTimeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Queue<TimeSpan> _expectedConsolidationTime = new([\n            new TimeSpan(9, 30, 0),\n            new TimeSpan(10, 30, 0),\n            new TimeSpan(11, 30, 0),\n            new TimeSpan(12, 30, 0),\n            new TimeSpan(13, 30, 0),\n            new TimeSpan(14, 30, 0)\n        ]);\n        private TradeBarConsolidator consolidator;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 04);\n            SetEndDate(2013, 10, 04);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n\n            consolidator = new TradeBarConsolidator(TimeSpan.FromHours(1), startTime: new TimeSpan(9, 30, 0));\n            consolidator.DataConsolidated += BarHandler;\n\n            SubscriptionManager.AddConsolidator(\"SPY\", consolidator);\n        }\n\n        private void BarHandler(object _, TradeBar bar)\n        {\n            if (Time != bar.EndTime)\n            {\n                throw new RegressionTestException($\"Unexpected consolidation time {bar.Time} != {Time}!\");\n            }\n\n            var expected = _expectedConsolidationTime.Dequeue();\n            if (bar.Time.TimeOfDay != expected)\n            {\n                throw new RegressionTestException($\"Unexpected consolidation time {bar.Time.TimeOfDay} != {expected}!\");\n            }\n\n            if (bar.Period != TimeSpan.FromHours(1))\n            {\n                throw new RegressionTestException($\"Unexpected consolidation period {bar.Period}!\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_expectedConsolidationTime.Count > 0)\n            {\n                throw new RegressionTestException(\"Unexpected consolidation times!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConstituentsQC500GeneratorAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to estimate constituents of QC500 index based on the company fundamentals\n    /// The algorithm creates a default tradable and liquid universe containing 500 US equities\n    /// which are chosen at the first trading day of each month.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"fine universes\" />\n    public class ConstituentsQC500GeneratorAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2018, 1, 1);   // Set Start Date\n            SetEndDate(2019, 1, 1);     // Set End Date\n            SetCash(100000);            // Set Strategy Cash\n\n            // Add QC500 Universe\n            AddUniverse(Universe.QC500);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConstituentsUniverseDataGeneratorAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm used to generate daily data on disk for the different <see cref=\"ConstituentsUniverse\"/>.\n    /// How to use me? search for 'CHANGE ME'\n    /// 1- change the universe name\n    /// 2- change the desired start and end date to generate\n    /// 3- define the universe selection to use\n    /// Data will be generated in:\n    /// 'Globals.DataFolder\\SecurityType\\Market\\universes\\Resolution\\{UniverseName}\\{dates:yyyyMMdd}.csv'\n    /// </summary>\n    /// <remarks>The data produced by this algorithm is the one used by the\n    /// <see cref=\"ConstituentsUniverseRegressionAlgorithm\"/></remarks>\n    /// <remarks>In the cloud, users can implement their own <see cref=\"ConstituentsUniverseData\"/>\n    /// (not using <see cref=\"SubscriptionTransportMedium.LocalFile\"/>) that can fetch the files\n    /// generated from this algorithm</remarks>\n    public class ConstituentsUniverseDataGeneratorAlgorithm : QCAlgorithm\n    {\n        private readonly HashSet<Symbol> _currentSelection = new HashSet<Symbol>();\n        private DateTime _currentDateTime = DateTime.MinValue;\n        private readonly string _rootDataPath = Globals.DataFolder;\n        private string _dataPath;\n        private bool _skippedFirst;\n\n        // Configuration properties: Only these are supported for now (Don't change me)\n        private readonly SecurityType _securityType = SecurityType.Equity;\n        private readonly string _market = Market.USA;\n        private readonly Resolution _resolution = Resolution.Daily;\n\n        // CHANGE ME\n        private readonly string _universeName = \"qctest\";\n\n        public override void Initialize()\n        {\n            // CHANGE ME\n            SetStartDate(2013, 10, 07);   // Set Start Date\n            SetEndDate(2013, 10, 11);     // Set End Date\n            SetCash(100000);            // Set Strategy Cash\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            _dataPath = Path.Combine(_rootDataPath,\n                _securityType.SecurityTypeToLower(),\n                _market,\n                \"universes\",\n                _resolution.ResolutionToLower(),\n                _universeName);\n            Directory.CreateDirectory(_dataPath);\n\n            // CHANGE ME\n            int step = 0;\n            AddUniverse(coarse =>\n            {\n                step++;\n                switch (step)\n                {\n                    case 1:\n                    case 2:\n                        return new[]\n                        {\n                            QuantConnect.Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA),\n                            QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)\n                        };\n                    case 3:\n                        return Enumerable.Empty<Symbol>();\n                    case 4:\n                    case 5:\n                        return new[]\n                        {\n                            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n                            QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA)\n                        };\n                    default:\n                        throw new RegressionTestException(\"Unexpected step count\");\n                }\n            });\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.At(23, 0), SaveConstituentsUniverseDataToDisk);\n        }\n\n        private void SaveConstituentsUniverseDataToDisk()\n        {\n            if (_skippedFirst && Time > _currentDateTime)\n            {\n                if (Time.DayOfWeek == DayOfWeek.Sunday\n                    || Time.DayOfWeek == DayOfWeek.Monday)\n                {\n                    // we generate files from Tue to Saturday using current selected securities\n                    return;\n                }\n                // files are for Mon to Friday\n                _currentDateTime = Time.Date.AddDays(-1);\n\n                var path = Path.Combine(_dataPath, $\"{_currentDateTime:yyyyMMdd}.csv\");\n                File.Delete(path);\n                if (_currentSelection.Count == 0)\n                {\n                    using (StreamWriter constituentsUniverseFile = new StreamWriter(path, append:true))\n                    {\n                        constituentsUniverseFile.WriteLine(\n                            $\"{QuantConnect.Symbol.None.Value},{QuantConnect.Symbol.None.ID.ToString()}\");\n                    }\n                }\n                else\n                {\n                    foreach (var symbol in _currentSelection)\n                    {\n                        using (StreamWriter constituentsUniverseFile = new StreamWriter(path, append: true))\n                        {\n                            constituentsUniverseFile.WriteLine($\"{symbol.Value},{symbol.ID.ToString()}\");\n                        }\n                    }\n                }\n            }\n            _skippedFirst = true;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                Log($\"AddedSecurities {added}\");\n                if (_currentSelection.Contains(added.Symbol))\n                {\n                    throw new RegressionTestException(\"Added symbol already selected\");\n                }\n                _currentSelection.Add(added.Symbol);\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                Log($\"RemovedSecurities {removed}\");\n                if (!_currentSelection.Contains(removed.Symbol))\n                {\n                    throw new RegressionTestException(\"Removing symbol already deselected\");\n                }\n                _currentSelection.Remove(removed.Symbol);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Assert that constituents universe selection happens right away after algorithm starts\n    /// </summary>\n    public class ConstituentsUniverseImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly List<Symbol> _expectedConstituents = new()\n        {\n            QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n            QuantConnect.Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA)\n        };\n\n        private bool _securitiesChanged;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            var customUniverseSymbol = new Symbol(\n                SecurityIdentifier.GenerateConstituentIdentifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.Equity,\n                    Market.USA),\n                \"constituents-universe-qctest\");\n\n            AddUniverse(new ConstituentsUniverse(customUniverseSymbol, UniverseSettings));\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (!_securitiesChanged)\n            {\n                // Selection should be happening right on algorithm start\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"Universe selection should have been triggered right away on {StartDate} \" +\n                        $\"but happened on {Time}\");\n                }\n\n                // Constituents should have been added to the algorithm\n                if (changes.AddedSecurities.Count != _expectedConstituents.Count)\n                {\n                    throw new RegressionTestException($\"Expected {_expectedConstituents.Count} stocks to be added to the algorithm, \" +\n                        $\"instead added: {changes.AddedSecurities.Count}\");\n                }\n\n                if (!_expectedConstituents.All(constituent => changes.AddedSecurities.Any(security => security.Symbol == constituent)))\n                {\n                    throw new RegressionTestException(\"Not all constituents were added to the algorithm\");\n                }\n\n                _securitiesChanged = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_securitiesChanged)\n            {\n                throw new RegressionTestException(\"Expected events didn't happen\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 28;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConstituentsUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using a <see cref=\"ConstituentsUniverse\"/> with test data\n    /// </summary>\n    public class ConstituentsUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _appl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private readonly Symbol _qqq = QuantConnect.Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA);\n        private readonly Symbol _fb = QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA);\n        private int _step;\n\n    /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            var customUniverseSymbol = new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.Equity,\n                    Market.USA),\n                \"constituents-universe-qctest\");\n\n            AddUniverse(new ConstituentsUniverse(customUniverseSymbol, UniverseSettings));\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _step++;\n            if (_step == 1)\n            {\n                if (!slice.ContainsKey(_qqq)\n                    || !slice.ContainsKey(_appl))\n                {\n                    throw new RegressionTestException($\"Unexpected symbols found, step: {_step}\");\n                }\n                if (slice.Count != 2)\n                {\n                    throw new RegressionTestException($\"Unexpected data count, step: {_step}\");\n                }\n                // AAPL will be deselected by the ConstituentsUniverse\n                // but it shouldn't be removed since we hold it\n                SetHoldings(_appl, 0.5);\n            }\n            else if (_step == 2)\n            {\n                if (!slice.ContainsKey(_appl))\n                {\n                    throw new RegressionTestException($\"Unexpected symbols found, step: {_step}\");\n                }\n                if (slice.Count != 1)\n                {\n                    throw new RegressionTestException($\"Unexpected data count, step: {_step}\");\n                }\n                // AAPL should now be released\n                // note: takes one extra loop because the order is executed on market open\n                Liquidate();\n            }\n            else if (_step == 3)\n            {\n                if (!slice.ContainsKey(_fb)\n                    || !slice.ContainsKey(_spy)\n                    || !slice.ContainsKey(_appl))\n                {\n                    throw new RegressionTestException($\"Unexpected symbols found, step: {_step}\");\n                }\n                if (slice.Count != 3)\n                {\n                    throw new RegressionTestException($\"Unexpected data count, step: {_step}\");\n                }\n            }\n            else if (_step == 4)\n            {\n                if (!slice.ContainsKey(_fb)\n                    || !slice.ContainsKey(_spy))\n                {\n                    throw new RegressionTestException($\"Unexpected symbols found, step: {_step}\");\n                }\n                if (slice.Count != 2)\n                {\n                    throw new RegressionTestException($\"Unexpected data count, step: {_step}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // First selection is on the midnight of the 8th, start getting data from the 8th to the 11th\n            if (_step != 4)\n            {\n                throw new RegressionTestException($\"Unexpected step count: {_step}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                Log($\"{Time} AddedSecurities {added}\");\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                Log($\"{Time} RemovedSecurities {removed} {_step}\");\n                // we are currently notifying the removal of AAPl twice,\n                // when deselected and when finally removed (since it stayed pending)\n                if (removed.Symbol == _appl && _step != 1 && _step != 2\n                    || removed.Symbol == _qqq && _step != 1)\n                {\n                    throw new RegressionTestException($\"Unexpected removal step count: {_step}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.68%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"70.501%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100684.53\"},\n            {\"Net Profit\", \"0.685%\"},\n            {\"Sharpe Ratio\", \"13.41\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.997%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.235\"},\n            {\"Beta\", \"0.15\"},\n            {\"Annual Standard Deviation\", \"0.04\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-7.587\"},\n            {\"Tracking Error\", \"0.19\"},\n            {\"Treynor Ratio\", \"3.546\"},\n            {\"Total Fees\", \"$32.77\"},\n            {\"Estimated Strategy Capacity\", \"$230000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.15%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d269ebced0796dde34f9eb775772e027\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Back Month Raw Futures Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// </summary>\n    public class ContinuousBackMonthRawFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<SymbolChangedEvent> _mappings = new();\n        private Future _continuousContract;\n        private DateTime _lastDateLog;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.Raw,\n                dataMappingMode: DataMappingMode.FirstDayMonth,\n                contractDepthOffset: 1\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Keys.Count != 1)\n            {\n                throw new RegressionTestException($\"We are getting data for more than one symbols! {string.Join(\",\", slice.Keys.Select(symbol => symbol))}\");\n            }\n\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (changedEvent.Symbol == _continuousContract.Symbol)\n                {\n                    _mappings.Add(changedEvent);\n                    Log($\"SymbolChanged event: {changedEvent}\");\n\n                    var currentExpiration = changedEvent.Symbol.Underlying.ID.Date;\n                    // +4 months cause we are actually using the back month, es is quarterly contract\n                    var frontMonthExpiration = FuturesExpiryFunctions.FuturesExpiryFunction(_continuousContract.Symbol)(Time.AddMonths(1 + 4));\n\n                    if (currentExpiration != frontMonthExpiration.Date)\n                    {\n                        throw new RegressionTestException($\"Unexpected current mapped contract expiration {currentExpiration}\" +\n                            $\" @ {Time} it should be AT front month expiration {frontMonthExpiration}\");\n                    }\n\n                    if (_continuousContract.Mapped != changedEvent.Symbol.Underlying)\n                    {\n                        throw new RegressionTestException($\"Unexpected mapped continuous contract {_continuousContract.Mapped} expected {changedEvent.Symbol.Underlying}\");\n                    }\n                }\n            }\n\n            if (_lastDateLog.Month != Time.Month && _continuousContract.HasData)\n            {\n                _lastDateLog = Time;\n\n                Log($\"{Time}- {Securities[_continuousContract.Symbol].GetLastData()}\");\n                if (Portfolio.Invested)\n                {\n                    Liquidate();\n                }\n                else\n                {\n                    Buy(_continuousContract.Mapped, 1);\n                }\n\n                if(Time.Month == 1 && Time.Year == 2013)\n                {\n                    var response = History(new[] { _continuousContract.Symbol }, 60 * 24 * 90);\n                    if (!response.Any())\n                    {\n                        throw new RegressionTestException(\"Unexpected empty history response\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var expectedMappingCounts = 2;\n            if (_mappings.Count != expectedMappingCounts)\n            {\n                throw new RegressionTestException($\"Unexpected symbol changed events: {_mappings.Count}, was expecting {expectedMappingCounts}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 162571;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"1.48%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"2.968%\"},\n            {\"Drawdown\", \"1.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101483.2\"},\n            {\"Net Profit\", \"1.483%\"},\n            {\"Sharpe Ratio\", \"0.521\"},\n            {\"Sortino Ratio\", \"0.124\"},\n            {\"Probabilistic Sharpe Ratio\", \"42.535%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.011\"},\n            {\"Beta\", \"0.113\"},\n            {\"Annual Standard Deviation\", \"0.026\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-2.674\"},\n            {\"Tracking Error\", \"0.076\"},\n            {\"Treynor Ratio\", \"0.117\"},\n            {\"Total Fees\", \"$4.30\"},\n            {\"Estimated Strategy Capacity\", \"$76000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"0.91%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"a472060eeb87c7474d25f7035fa150c4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureBackMonthRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Back Month #1 Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// </summary>\n    public class ContinuousFutureBackMonthRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<SymbolChangedEvent> _mappings = new();\n        private Future _continuousContract;\n        private DateTime _lastDateLog;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            try\n            {\n                AddFuture(Futures.Indices.SP500EMini,\n                    dataNormalizationMode: DataNormalizationMode.BackwardsPanamaCanal,\n                    dataMappingMode: DataMappingMode.OpenInterest,\n                    contractDepthOffset: 5\n                );\n                throw new RegressionTestException(\"Expected out of rage exception. We don't support that many back months\");\n            }\n            catch (ArgumentOutOfRangeException)\n            {\n                // expected\n            }\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsPanamaCanal,\n                dataMappingMode: DataMappingMode.OpenInterest,\n                contractDepthOffset: 1\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Keys.Count != 1)\n            {\n                throw new RegressionTestException($\"We are getting data for more than one symbols! {string.Join(\",\", slice.Keys.Select(symbol => symbol))}\");\n            }\n\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (changedEvent.Symbol == _continuousContract.Symbol)\n                {\n                    _mappings.Add(changedEvent);\n                    Log($\"SymbolChanged event: {changedEvent}\");\n\n                    var backMonthExpiration = changedEvent.Symbol.Underlying.ID.Date;\n                    var frontMonthExpiration = FuturesExpiryFunctions.FuturesExpiryFunction(_continuousContract.Symbol)(Time.AddMonths(1));\n\n                    if (backMonthExpiration <= frontMonthExpiration.Date)\n                    {\n                        throw new RegressionTestException($\"Unexpected current mapped contract expiration {backMonthExpiration}\" +\n                            $\" @ {Time} it should be AFTER front month expiration {frontMonthExpiration}\");\n                    }\n\n                    if (_continuousContract.Mapped != changedEvent.Symbol.Underlying)\n                    {\n                        throw new RegressionTestException($\"Unexpected mapped continuous contract {_continuousContract.Mapped} expected {changedEvent.Symbol.Underlying}\");\n                    }\n                }\n            }\n\n            if (_lastDateLog.Month != Time.Month && _continuousContract.HasData)\n            {\n                _lastDateLog = Time;\n\n                Log($\"{Time}- {Securities[_continuousContract.Symbol].GetLastData()}\");\n                if (_continuousContract.Exchange.ExchangeOpen)\n                {\n                    if (Portfolio.Invested)\n                    {\n                        Liquidate();\n                    }\n                    else\n                    {\n                        Buy(_continuousContract.Mapped, 1);\n                }\n                }\n\n                if(Time.Month == 1 && Time.Year == 2013)\n                {\n                    var response = History(new[] { _continuousContract.Symbol }, 60 * 24 * 90);\n                    if (!response.Any())\n                    {\n                        throw new RegressionTestException(\"Unexpected empty history response\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var expectedMappingCounts = 2;\n            if (_mappings.Count != expectedMappingCounts)\n            {\n                throw new RegressionTestException($\"Unexpected symbol changed events: {_mappings.Count}, was expecting {expectedMappingCounts}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 172698;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"1.48%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4.603%\"},\n            {\"Drawdown\", \"1.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102291.4\"},\n            {\"Net Profit\", \"2.291%\"},\n            {\"Sharpe Ratio\", \"0.892\"},\n            {\"Sortino Ratio\", \"0.312\"},\n            {\"Probabilistic Sharpe Ratio\", \"55.781%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.006\"},\n            {\"Beta\", \"0.14\"},\n            {\"Annual Standard Deviation\", \"0.028\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-2.584\"},\n            {\"Tracking Error\", \"0.075\"},\n            {\"Treynor Ratio\", \"0.175\"},\n            {\"Total Fees\", \"$6.45\"},\n            {\"Estimated Strategy Capacity\", \"$230000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"1.39%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"6a5b2e6b3f140e9bb7f32c07cbf5f36c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures History Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// </summary>\n    public class ContinuousFutureHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private bool _warmedUp;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 10);\n            SetEndDate(2013, 10, 11);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.OpenInterest,\n                contractDepthOffset: 1\n            );\n            SetWarmup(1, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // ES has an expiration on december but because we are using 'contractDepthOffset: 1' we expect to use the next contract\n            if (_continuousContract.Mapped.ID.Date.Month != 3)\n            {\n                throw new RegressionTestException($\"Unexpected mapped continuous contract future {_continuousContract.Mapped}\");\n            }\n\n            if (IsWarmingUp)\n            {\n                // warm up data\n                _warmedUp = true;\n\n                if (!_continuousContract.HasData)\n                {\n                    throw new RegressionTestException($\"ContinuousContract did not get any data during warmup!\");\n                }\n\n                var backMonthExpiration =   slice.Keys.Single().Underlying.ID.Date;\n                var frontMonthExpiration = FuturesExpiryFunctions.FuturesExpiryFunction(_continuousContract.Symbol)(Time.AddMonths(1));\n                if (backMonthExpiration <= frontMonthExpiration.Date)\n                {\n                    throw new RegressionTestException($\"Unexpected current mapped contract expiration {backMonthExpiration}\" +\n                        $\" @ {Time} it should be AFTER front month expiration {frontMonthExpiration}\");\n                }\n            }\n            if (slice.Keys.Count != 1)\n            {\n                throw new RegressionTestException($\"We are getting data for more than one symbols! {string.Join(\",\", slice.Keys.Select(symbol => symbol))}\");\n            }\n\n            if (!Portfolio.Invested && !IsWarmingUp)\n            {\n                Buy(_continuousContract.Mapped, 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_warmedUp)\n            {\n                throw new RegressionTestException(\"Algorithm didn't warm up!\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n            if (changes.AddedSecurities.Any(security => security.Symbol != _continuousContract.Symbol)\n                || changes.RemovedSecurities.Any(security => security.Symbol != _continuousContract.Symbol))\n            {\n                throw new RegressionTestException($\"We got an unexpected security changes {changes}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 5469;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101558.2\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"41.23%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b9f8e1a0704c086944e5df07e0ab04d6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureHistoryTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures History Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// </summary>\n    public class ContinuousFutureHistoryTimeSpanWarmupRegressionAlgorithm : ContinuousFutureHistoryRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            // We want to match the start time of the base algorithm. ES futures data time zone is UTC, algorithm time zone is new york (default).\n            // Base algorithm warmup is 1 bar of daily resolution starts at 8 PM new york time of T-1. So to match the same start time\n            // we go back a 1 day + 4 hours. This is calculated by 'Time.GetStartTimeForTradeBars'\n            SetWarmup(TimeSpan.FromHours(24 + 4));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 9079;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing System;\nusing QuantConnect.Data.UniverseSelection;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that continuous future universe selection happens right away for all futures.\n    /// An example case is ES and HSI futures, which have different time zones. ES is in New York and HSI is in Hong Kong.\n    /// ES selection would happen first just because of this, but all futures should have a mapped contract right away.\n    /// </summary>\n    public class ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _es;\n        private Future _hsi;\n\n        private bool _dataReceived;\n\n        private DateTime _startDateUtc;\n\n        private DateTime _esSelectionTimeUtc;\n        private DateTime _hsiSelectionTimeUtc;\n\n        private bool _securitiesChangedEventReceived;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n\n            _startDateUtc = StartDate.ConvertToUtc(TimeZone);\n\n            // ES time zone is New York\n            _es = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.OpenInterestAnnual,\n                contractDepthOffset: 0,\n                extendedMarketHours: true);\n\n            _hsi = AddFuture(Futures.Indices.HangSeng,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.FirstDayMonth,\n                contractDepthOffset: 0,\n                extendedMarketHours: true);\n\n            _es.SetFilter(universe =>\n            {\n                if (_esSelectionTimeUtc == DateTime.MinValue)\n                {\n                    _esSelectionTimeUtc = universe.LocalTime.ConvertToUtc(_es.Exchange.TimeZone);\n\n                    if (_esSelectionTimeUtc != _startDateUtc)\n                    {\n                        throw new RegressionTestException($\"Expected ES universe selection to happen on algorithm start ({_startDateUtc}), \" +\n                            $\"but happened on {_esSelectionTimeUtc}\");\n                    }\n                }\n                return universe;\n            });\n\n            _hsi.SetFilter(universe =>\n            {\n                if (_hsiSelectionTimeUtc == DateTime.MinValue)\n                {\n                    _hsiSelectionTimeUtc = universe.LocalTime.ConvertToUtc(_hsi.Exchange.TimeZone);\n\n                    if (_hsiSelectionTimeUtc != _startDateUtc)\n                    {\n                        throw new RegressionTestException($\"Expected HSI universe selection to happen on algorithm start ({_startDateUtc}), \" +\n                            $\"but happened on {_hsiSelectionTimeUtc}\");\n                    }\n                }\n                return universe;\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            _dataReceived = true;\n\n            if (_es.Mapped == null)\n            {\n                throw new RegressionTestException(\"ES mapped contract is null\");\n            }\n\n            // This is what we actually want to assert: even though Hong Kong future time zone is different,\n            // we should have a mapped contract right away.\n            if (_hsi.Mapped == null)\n            {\n                throw new RegressionTestException(\"HSI mapped contract is null\");\n            }\n\n            Log($\"{slice.Time} :: ES Mapped Contract: {_es.Mapped}. HSI Mapped Contract: {_hsi.Mapped}\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (!_securitiesChangedEventReceived)\n            {\n                _securitiesChangedEventReceived = true;\n\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"Expected OnSecuritiesChanged to be called on algorithm start ({StartDate}), \" +\n                        $\"but happened on {Time}\");\n                }\n\n                if (_esSelectionTimeUtc == DateTime.MinValue)\n                {\n                    throw new RegressionTestException(\"ES universe selection time was not set\");\n                }\n\n                if (_hsiSelectionTimeUtc == DateTime.MinValue)\n                {\n                    throw new RegressionTestException(\"HSI universe selection time was not set\");\n                }\n\n                if (changes.AddedSecurities.Count == 0 || changes.RemovedSecurities.Count != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected securities changes. Expected multiple securities added and none removed \" +\n                        $\"but got {changes.AddedSecurities.Count} securities added and {changes.RemovedSecurities.Count} removed.\");\n                }\n\n                if (!changes.AddedSecurities.Any(x => !x.Symbol.IsCanonical() && x.Symbol.Canonical == _es.Symbol))\n                {\n                    throw new RegressionTestException($\"Expected to find a multiple futures for ES\");\n                }\n\n                if (!changes.AddedSecurities.Any(x => !x.Symbol.IsCanonical() && x.Symbol.Canonical == _hsi.Symbol))\n                {\n                    throw new RegressionTestException($\"Expected to find a multiple futures for HSI\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Just a protection in case data is changed to make sure assertions in OnData were done.\n            if (!_dataReceived)\n            {\n                throw new RegressionTestException(\"No data was received so no checks were done\");\n            }\n\n            if (!_securitiesChangedEventReceived)\n            {\n                throw new RegressionTestException(\"OnSecuritiesChanged was not called\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 129796;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureLimitIfTouchedOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Regression algorithm reproducing GH issue #6490 asserting limit if touched order works as expected\n    /// </summary>\n    public class ContinuousFutureLimitIfTouchedOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _ticket;\n        private Future _continuousContract;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 10);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_ticket == null)\n            {\n                _ticket = LimitIfTouchedOrder(_continuousContract.Mapped, -1, _continuousContract.Price, _continuousContract.Price);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_ticket == null || _ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Order ticket was not placed or filled!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10883;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-99.012%\"},\n            {\"Drawdown\", \"6.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"93870.7\"},\n            {\"Net Profit\", \"-6.129%\"},\n            {\"Sharpe Ratio\", \"-2.199\"},\n            {\"Sortino Ratio\", \"-2.305\"},\n            {\"Probabilistic Sharpe Ratio\", \"5.175%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.984\"},\n            {\"Beta\", \"-0.022\"},\n            {\"Annual Standard Deviation\", \"0.449\"},\n            {\"Annual Variance\", \"0.202\"},\n            {\"Information Ratio\", \"-2.231\"},\n            {\"Tracking Error\", \"0.513\"},\n            {\"Treynor Ratio\", \"43.96\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$2600000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"16.49%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d13f91ab95169699139d21685a5e346a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureModelsConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that when setting custom models for canonical future, a one-time warning is sent\n    /// informing the user that the contracts models are different (not the custom ones).\n    /// </summary>\n    public class ContinuousFutureModelsConsistencyRegressionAlgorithm : OptionModelsConsistencyRegressionAlgorithm\n    {\n        protected override Security InitializeAlgorithm()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            var continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsPanamaCanal,\n                dataMappingMode: DataMappingMode.OpenInterest,\n                contractDepthOffset: 1\n            );\n\n            return continuousContract;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override Language[] Languages { get; } = { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 703062;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #8386 and other related bugs.\n    /// It asserts that open positions are liquidated when a contract is delisted, even if the contract was added as an internal subscription.\n    /// It also asserts that the contract is not tradable after being delisted.\n    /// </summary>\n    public class ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Symbol _prevContractSymbol;\n        private bool _traded;\n        private bool _mapped;\n        private bool _delistedContractChecked;\n        private DateTime _firstMappedContractRemovalTime;\n        private int _removalCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 12, 30);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.OpenInterest,\n                contractDepthOffset: 0\n            );\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_traded && _continuousContract.HasData)\n            {\n                var ticket = MarketOrder(_continuousContract.Mapped, 1);\n                if (ticket.Status == OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Order should be valid: {ticket}\");\n                }\n                _traded = true;\n            }\n\n            if (slice.SymbolChangedEvents.Count > 0)\n            {\n                foreach (var change in slice.SymbolChangedEvents.Values)\n                {\n                    Debug($\"[{Time}] :: Mapping: {change}\");\n                    _prevContractSymbol = Symbol(change.OldSymbol);\n                    _mapped = true;\n                }\n            }\n\n            if (!_delistedContractChecked &&\n                _prevContractSymbol  != null &&\n                Time.Date > _prevContractSymbol.ID.Date &&\n                IsMarketOpen(_prevContractSymbol))\n            {\n                _delistedContractChecked = true;\n                var delistedContract = Securities.Total.Single(sec => sec.Symbol == _prevContractSymbol);\n\n                if (delistedContract.Invested)\n                {\n                    throw new RegressionTestException($\"Position should be closed when {_prevContractSymbol} got delisted {_prevContractSymbol.ID.Date}\");\n                }\n\n                if (!delistedContract.IsDelisted)\n                {\n                    throw new RegressionTestException($\"Contract should be delisted: {delistedContract.Symbol}\");\n                }\n\n                if (delistedContract.IsTradable)\n                {\n                    throw new RegressionTestException($\"Contract should not be tradable: {delistedContract.Symbol}\");\n                }\n\n                var ticket = MarketOrder(_prevContractSymbol, 1);\n\n                if (ticket.Status != OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Delisted contract order should be invalid: {ticket}\");\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (_prevContractSymbol != null)\n            {\n                if (changes.RemovedSecurities.Any(x => x.Symbol == _prevContractSymbol))\n                {\n                    throw new RegressionTestException($\"Previous contract symbol {_prevContractSymbol} should not be removed as a non-internal security\");\n                }\n\n                changes.FilterInternalSecurities = false;\n\n                if (!changes.RemovedSecurities.Any(x => x.Symbol == _prevContractSymbol))\n                {\n                    throw new RegressionTestException($\"Previous contract symbol {_prevContractSymbol} should be removed as an internal security\");\n                }\n\n                _firstMappedContractRemovalTime = Time;\n                _removalCount++;\n            }\n\n            changes.FilterInternalSecurities = false;\n            Debug($\"[{Time}] :: {changes}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"[{Time}] :: Order event: {orderEvent}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_traded)\n            {\n                throw new RegressionTestException(\"No trades have been made\");\n            }\n\n            if (!_mapped)\n            {\n                throw new RegressionTestException(\"No mapping events have been fired\");\n            }\n\n            if (!_delistedContractChecked)\n            {\n                throw new RegressionTestException(\"No delisted contract has been checked\");\n            }\n\n            if (_prevContractSymbol == null)\n            {\n                throw new RegressionTestException(\"No previous contract symbol has been set\");\n            }\n\n            var tradedContract = Securities.Total.Single(sec => sec.Symbol == _prevContractSymbol);\n            if (tradedContract.Invested)\n            {\n                throw new RegressionTestException($\"Position should be closed when {_prevContractSymbol} got delisted on {_prevContractSymbol.ID.Date}\");\n            }\n\n            if (_firstMappedContractRemovalTime == default || _firstMappedContractRemovalTime >= _prevContractSymbol.ID.Date)\n            {\n                throw new RegressionTestException($\"First mapped contract should have been removed before it's expiry date\");\n            }\n\n            if (_removalCount != 1)\n            {\n                throw new RegressionTestException($\"The mapped contract should have been removed once only\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 159274;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"7.02%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.386%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107016.6\"},\n            {\"Net Profit\", \"7.017%\"},\n            {\"Sharpe Ratio\", \"3.217\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.828%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.227\"},\n            {\"Beta\", \"0.109\"},\n            {\"Annual Standard Deviation\", \"0.084\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-1.122\"},\n            {\"Tracking Error\", \"0.112\"},\n            {\"Treynor Ratio\", \"2.49\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$1700000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"2.01%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"838e662caaa5a385c43ef27df1efbaf4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n    /// </summary>\n    public class ContinuousFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _previousMappedContractSymbols = new();\n        private Symbol _currentMappedSymbol;\n        private Future _continuousContract;\n        private DateTime _lastMonth;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // we subtract a minute cause we can get data on the market close, from the previous minute\n            if (!_continuousContract.Exchange.DateTimeIsOpen(Time.AddMinutes(-1)))\n            {\n                if (slice.Bars.Count > 0 || slice.QuoteBars.Count > 0)\n                {\n                    throw new RegressionTestException($\"We are getting data during closed market!\");\n                }\n            }\n\n            var currentlyMappedSecurity = Securities[_continuousContract.Mapped];\n\n            if (slice.Keys.Count != 1)\n            {\n                throw new RegressionTestException($\"We are getting data for more than one symbols! {string.Join(\",\", slice.Keys.Select(symbol => symbol))}\");\n            }\n\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (changedEvent.Symbol == _continuousContract.Symbol)\n                {\n                    _previousMappedContractSymbols.Add(Symbol(changedEvent.OldSymbol));\n                    Log($\"{Time} - SymbolChanged event: {changedEvent}\");\n\n                    if (_currentMappedSymbol == _continuousContract.Mapped)\n                    {\n                        throw new RegressionTestException($\"Continuous contract current symbol did not change! {_continuousContract.Mapped}\");\n                    }\n\n                    var currentExpiration = changedEvent.Symbol.Underlying.ID.Date;\n                    var frontMonthExpiration = FuturesExpiryFunctions.FuturesExpiryFunction(_continuousContract.Symbol)(Time.AddMonths(1));\n\n                    if (currentExpiration != frontMonthExpiration.Date)\n                    {\n                        throw new RegressionTestException($\"Unexpected current mapped contract expiration {currentExpiration}\" +\n                            $\" @ {Time} it should be AT front month expiration {frontMonthExpiration}\");\n                    }\n                }\n            }\n            if (_lastMonth.Month != Time.Month && currentlyMappedSecurity.HasData)\n            {\n                _lastMonth = Time;\n\n                Log($\"{Time}- {currentlyMappedSecurity.GetLastData()}\");\n                if (Portfolio.Invested)\n                {\n                    Liquidate();\n                }\n                else\n                {\n                    // This works because we set this contract as tradable, even if it's a canonical security\n                    Buy(currentlyMappedSecurity.Symbol, 1);\n                }\n\n                if(Time.Month == 1 && Time.Year == 2013)\n                {\n                    var response = History(new[] { _continuousContract.Symbol }, 60 * 24 * 90);\n                    if (!response.Any())\n                    {\n                        throw new RegressionTestException(\"Unexpected empty history response\");\n                    }\n                }\n            }\n\n            _currentMappedSymbol = _continuousContract.Mapped;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n            if (changes.AddedSecurities.Any(security => security.Symbol != _continuousContract.Symbol)\n                || changes.RemovedSecurities.Any(security => security.Symbol != _continuousContract.Symbol))\n            {\n                throw new RegressionTestException($\"We got an unexpected security changes {changes}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var expectedMappingCounts = 2;\n            if (_previousMappedContractSymbols.Count != expectedMappingCounts)\n            {\n                throw new RegressionTestException($\"Unexpected symbol changed events: {_previousMappedContractSymbols.Count}, was expecting {expectedMappingCounts}\");\n            }\n\n            var delistedSecurities = _previousMappedContractSymbols\n                .Select(x => Securities.Total.Single(sec => sec.Symbol == x))\n                .Where(x => x.Symbol.ID.Date < Time)\n                .ToList();\n            var markedDelistedSecurities = delistedSecurities.Where(x => x.IsDelisted && !x.IsTradable).ToList();\n            if (markedDelistedSecurities.Count != delistedSecurities.Count)\n            {\n                throw new RegressionTestException($\"Not all delisted contracts are properly market as delisted and non-tradable: \" +\n                    $\"only {markedDelistedSecurities.Count} are marked, was expecting {delistedSecurities.Count}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 162575;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.84%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"3.380%\"},\n            {\"Drawdown\", \"1.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101687.3\"},\n            {\"Net Profit\", \"1.687%\"},\n            {\"Sharpe Ratio\", \"0.605\"},\n            {\"Sortino Ratio\", \"0.202\"},\n            {\"Probabilistic Sharpe Ratio\", \"45.198%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.013\"},\n            {\"Beta\", \"0.134\"},\n            {\"Annual Standard Deviation\", \"0.027\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-2.687\"},\n            {\"Tracking Error\", \"0.075\"},\n            {\"Treynor Ratio\", \"0.121\"},\n            {\"Total Fees\", \"$6.45\"},\n            {\"Estimated Strategy Capacity\", \"$2600000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"1.88%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"1973b0beb9bc5e618e0387d960553d7a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverBaseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing System;\nusing QuantConnect.Util;\nusing System.Linq;\nusing NodaTime;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data, regardless of the\n    /// offset between the exchange time zone and the data time zone.\n    /// </summary>\n    public abstract class ContinuousFutureRolloverBaseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        const string Ticker = Futures.Indices.SP500EMini;\n\n        private Future _continuousContract;\n\n        private DateTime _rolloverTime;\n\n        private MarketHoursDatabase.Entry _originalMhdbEntry;\n\n        protected abstract Resolution Resolution { get; }\n\n        protected abstract Offset ExchangeToDataTimeZoneOffset { get; }\n\n        protected virtual bool SeedIntialPrices { get; }\n\n        private DateTimeZone DataTimeZone => TimeZones.Utc;\n\n        private DateTimeZone ExchangeTimeZone => DateTimeZone.ForOffset(ExchangeToDataTimeZoneOffset);\n\n        private bool RolloverHappened => _rolloverTime != DateTime.MinValue;\n\n        private BaseData MappedContractSeededData;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 8);\n            SetEndDate(2013, 12, 20);\n\n            Settings.SeedInitialPrices = SeedIntialPrices;\n\n            _originalMhdbEntry = MarketHoursDatabase.GetEntry(Market.CME, Ticker, SecurityType.Future);\n            var exchangeHours = new SecurityExchangeHours(ExchangeTimeZone,\n                _originalMhdbEntry.ExchangeHours.Holidays,\n                _originalMhdbEntry.ExchangeHours.MarketHours.ToDictionary(),\n                _originalMhdbEntry.ExchangeHours.EarlyCloses,\n                _originalMhdbEntry.ExchangeHours.LateOpens);\n            MarketHoursDatabase.SetEntry(Market.CME, Ticker, SecurityType.Future, exchangeHours, DataTimeZone);\n\n            SetTimeZone(ExchangeTimeZone);\n\n            _continuousContract = AddFuture(Ticker,\n                Resolution,\n                extendedMarketHours: true,\n                dataNormalizationMode: DataNormalizationMode.Raw,\n                dataMappingMode: DataMappingMode.OpenInterest,\n                contractDepthOffset: 0\n            );\n\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            try\n            {\n                var receivedRollover = false;\n                foreach (var (symbol, symbolChangedEvent) in slice.SymbolChangedEvents)\n                {\n                    if (RolloverHappened)\n                    {\n                        throw new RegressionTestException($\"[{Time}] -- Unexpected symbol changed event for {symbol}. Expected only one mapping.\");\n                    }\n\n                    receivedRollover = true;\n                    _rolloverTime = symbolChangedEvent.EndTime;\n\n                    var oldSymbol = symbolChangedEvent.OldSymbol;\n                    var newSymbol = symbolChangedEvent.NewSymbol;\n                    Debug($\"[{Time}] -- Rollover: {oldSymbol} -> {newSymbol}\");\n\n                    if (symbol != _continuousContract.Symbol)\n                    {\n                        throw new RegressionTestException($\"[{Time}] -- Unexpected symbol changed event for {symbol}\");\n                    }\n\n                    var expectedMappingDate = new DateTime(2013, 12, 18);\n                    if (_rolloverTime != expectedMappingDate)\n                    {\n                        throw new RegressionTestException($\"[{Time}] -- Unexpected date {_rolloverTime}. Expected {expectedMappingDate}\");\n                    }\n\n                    var expectedMappingOldSymbol = \"ES VMKLFZIH2MTD\";\n                    var expectedMappingNewSymbol = \"ES VP274HSU1AF5\";\n                    if (symbolChangedEvent.OldSymbol != expectedMappingOldSymbol || symbolChangedEvent.NewSymbol != expectedMappingNewSymbol)\n                    {\n                        throw new RegressionTestException($\"[{Time}] -- Unexpected mapping. \" +\n                            $\"Expected {expectedMappingOldSymbol} -> {expectedMappingNewSymbol} \" +\n                            $\"but was {symbolChangedEvent.OldSymbol} -> {symbolChangedEvent.NewSymbol}\");\n                    }\n\n                    var mappedContract = Securities[_continuousContract.Mapped];\n                    MappedContractSeededData = mappedContract.GetLastData();\n                }\n\n                var mappedFuture = Securities[_continuousContract.Mapped];\n                var mappedFuturePrice = mappedFuture.Price;\n\n                var otherFuture = Securities.Values.SingleOrDefault(x => !x.Symbol.IsCanonical() && x.Symbol != _continuousContract.Mapped);\n                var otherFuturePrice = otherFuture?.Price;\n\n                var continuousContractPrice = _continuousContract.Price;\n\n                Debug($\"[{Time}] Contracts prices:\\n\" +\n                    $\"  -- Mapped future: {mappedFuture.Symbol} :: {mappedFuture.Price} :: {mappedFuture.GetLastData()}\\n\" +\n                    $\"  -- Other future: {otherFuture?.Symbol} :: {otherFuture?.Price} :: {otherFuture?.GetLastData()}\\n\" +\n                    $\"  -- Mapped future from continuous contract: {_continuousContract.Symbol} :: {_continuousContract.Mapped} :: \" +\n                    $\"{_continuousContract.Price} :: {_continuousContract.GetLastData()}\\n\");\n\n                if (receivedRollover)\n                {\n                    if (continuousContractPrice != otherFuturePrice)\n                    {\n                        var continuousContractLastData = _continuousContract.GetLastData();\n                        throw new RegressionTestException($\"[{Time}] -- Prices do not match. \" +\n                            $\"At the time of the rollover, expected continuous future price to be the same as \" +\n                            $\"the previously mapped contract since no data for the new mapped contract has been received:\\n\" +\n                            $\"   Continuous contract ({_continuousContract.Symbol}) price: \" +\n                            $\"{continuousContractPrice} :: {continuousContractLastData.Symbol.Underlying} :: \" +\n                            $\"{continuousContractLastData.Time} - {continuousContractLastData.EndTime} :: {continuousContractLastData}. \\n\" +\n                            $\"   Mapped contract ({mappedFuture.Symbol}) price: {mappedFuturePrice} :: {mappedFuture.GetLastData()}. \\n\" +\n                            $\"   Other contract ({otherFuture?.Symbol}) price: {otherFuturePrice} :: {otherFuture?.GetLastData()}\\n\");\n                    }\n                }\n                else if (mappedFuturePrice != 0 || !RolloverHappened)\n                {\n                    var mappedFutureData = mappedFuture.GetLastData();\n                    // We only do this check is default securities seeding is desabled, else the mapped contract will have historical data\n                    if ((!Settings.SeedInitialPrices || !ReferenceEquals(MappedContractSeededData, mappedFutureData)) &&\n                        continuousContractPrice != mappedFuturePrice)\n                    {\n                        var continuousContractLastData = _continuousContract.GetLastData();\n                        throw new RegressionTestException($\"[{Time}] -- Prices do not match. \" +\n                            $\"Expected continuous future price to be the same as the mapped contract:\\n\" +\n                            $\"   Continuous contract ({_continuousContract.Symbol}) price: {continuousContractPrice} :: \" +\n                            $\"{continuousContractLastData.Symbol.Underlying} :: {continuousContractLastData}. \\n\" +\n                            $\"   Mapped contract ({mappedFuture.Symbol}) price: {mappedFuturePrice} :: {mappedFuture.GetLastData()}. \\n\" +\n                            $\"   Other contract ({otherFuture?.Symbol}) price: {otherFuturePrice} :: {otherFuture?.GetLastData()}\\n\");\n                    }\n                }\n                // No data for the mapped future yet after rollover\n                else\n                {\n                    if (otherFuture == null)\n                    {\n                        throw new RegressionTestException($\"[{Time}] --\" +\n                            $\" Mapped future price is 0 (no data has arrived) so the previous mapped contract is expected to be there\");\n                    }\n\n                    var continuousContractLastData = _continuousContract.GetLastData();\n\n                    if (continuousContractLastData.EndTime > _rolloverTime)\n                    {\n                        throw new RegressionTestException($\"[{Time}] -- Expected continuous future contract last data to be from the previously \" +\n                            $\"mapped contract until the new mapped contract gets data:\\n\" +\n                            $\"   Rollover time: {_rolloverTime}\\n\" +\n                            $\"   Continuous contract ({_continuousContract.Symbol}) last data: \" +\n                            $\"{continuousContractLastData.Symbol.Underlying} :: \" +\n                            $\"{continuousContractLastData.Time} - {continuousContractLastData.EndTime} :: {continuousContractLastData}.\");\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                ResetMarketHoursDatabase();\n                throw;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            ResetMarketHoursDatabase();\n\n            if (!RolloverHappened)\n            {\n                throw new RegressionTestException($\"[{Time}] -- Rollover did not happen.\");\n            }\n        }\n\n        private void ResetMarketHoursDatabase()\n        {\n            MarketHoursDatabase.SetEntry(Market.CME, Ticker, SecurityType.Future, _originalMhdbEntry.ExchangeHours, _originalMhdbEntry.DataTimeZone);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneAheadOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneAheadOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 483;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverDailyExchangeTimeZoneAheadOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 15;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneBehindOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneBehindOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(-2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 479;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverDailyExchangeTimeZoneBehindOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 17;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneSameAsDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneSameAsDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.Zero;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 483;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverDailyExchangeTimeZoneSameAsDataWithIntialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverDailyExchangeTimeZoneSameAsDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverDailyExchangeTimeZoneSameAsDataRegressionAlgorithm\n\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 17;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneAheadOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneAheadOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 7424;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverHourExchangeTimeZoneAheadOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 65;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneBehindOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneBehindOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(-2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 7440;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverHourExchangeTimeZoneBehindOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 64;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneSameAsDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneSameAsDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.Zero;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 7434;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverHourExchangeTimeZoneSameAsDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverHourExchangeTimeZoneSameAsDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverHourExchangeTimeZoneSameAsDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 64;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneAheadOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneAheadOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Minute;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 444159;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is ahead of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneAheadOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverMinuteExchangeTimeZoneAheadOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1958;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneBehindOfDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneBehindOfDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Minute;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.FromHours(-2);\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 445123;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the exchange time zone is behind of the data time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneBehindOfDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverMinuteExchangeTimeZoneBehindOfDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 892;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneSameAsDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneSameAsDataRegressionAlgorithm\n        : ContinuousFutureRolloverBaseRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Minute;\n\n        protected override Offset ExchangeToDataTimeZoneOffset => Offset.Zero;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 444757;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFutureRolloverMinuteExchangeTimeZoneSameAsDataWithInitialSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for regression algorithms testing that when a continuous future rollover happens,\n    /// the continuous contract is updated correctly with the new contract data.\n    /// The algorithms asserts the behavior for the case when the data time zone is the same as the exchange time zone.\n    /// </summary>\n    public class ContinuousFutureRolloverMinuteExchangeTimeZoneSameAsDataWithInitialSeedRegressionAlgorithm\n        : ContinuousFutureRolloverMinuteExchangeTimeZoneSameAsDataRegressionAlgorithm\n    {\n        protected override bool SeedIntialPrices => true;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 668;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ContinuousFuturesDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Regression algorithm asserting bug fix for GH issue #6840\n    /// </summary>\n    public class ContinuousFuturesDailyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SymbolChangedEvent _symbolChangedEvent;\n        private Future _continuousContract;\n        private decimal _previousFactor;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 12, 25);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.ForwardPanamaCanal,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0,\n                resolution: Resolution.Daily\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                if (changedEvent.Symbol == _continuousContract.Symbol)\n                {\n                    _symbolChangedEvent = changedEvent;\n                    Log($\"{Time} - SymbolChanged event: {changedEvent}. New expiration {_continuousContract.Mapped.ID.Date}\");\n                }\n            }\n\n            if (!slice.Bars.TryGetValue(_continuousContract.Symbol, out var continuousBar))\n            {\n                return;\n            }\n\n            var mappedBar = Securities[_continuousContract.Mapped].Cache.GetData<TradeBar>();\n            if (mappedBar == null || continuousBar.EndTime != mappedBar.EndTime)\n            {\n                return;\n            }\n            var priceFactor = continuousBar.Close - mappedBar.Close;\n            Debug($\"{Time} - Price factor {priceFactor}\");\n\n            if(_symbolChangedEvent != null)\n            {\n                if(_previousFactor == priceFactor)\n                {\n                    throw new RegressionTestException($\"Price factor did not change after symbol changed! {Time} {priceFactor}\");\n                }\n\n                Quit(\"We asserted what we wanted\");\n            }\n            _previousFactor = priceFactor;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_symbolChangedEvent == null)\n            {\n                throw new RegressionTestException(\"Unexpected a symbol changed event but got none!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 848;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-4.63\"},\n            {\"Tracking Error\", \"0.088\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration algorithm showing how to easily convert an old algorithm into the framework.\n    ///\n    ///  1. When making orders, also create insights for the correct direction (up/down/flat), can also set insight prediction period/magnitude/direction\n    ///  2. Emit insights before placing any trades\n    ///  3. Profit :)\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    public class ConvertToFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private MovingAverageConvergenceDivergence _macd;\n        private readonly string _symbol = \"SPY\";\n\n        private readonly int _fastEmaPeriod = 12;\n        private readonly int _slowEmaPeriod = 26;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2004, 01, 01);\n            SetEndDate(2015, 01, 01);\n\n            AddSecurity(SecurityType.Equity, _symbol, Resolution.Daily);\n\n            // define our daily macd(12,26) with a 9 day signal\n            _macd = MACD(_symbol, _fastEmaPeriod, _slowEmaPeriod, 9, MovingAverageType.Exponential, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // wait for our indicator to be ready\n            if (!_macd.IsReady) return;\n\n            var holding = Portfolio[_symbol];\n\n            var signalDeltaPercent = (_macd - _macd.Signal) / _macd.Fast;\n            var tolerance = 0.0025m;\n\n            // if our macd is greater than our signal, then let's go long\n            if (holding.Quantity <= 0 && signalDeltaPercent > tolerance)\n            {\n                // 1. Call EmitInsights with insights created in correct direction, here we're going long\n                //    The EmitInsights method can accept multiple insights separated by commas\n                EmitInsights(\n                    // Creates an insight for our symbol, predicting that it will move up within the fast ema period number of days\n                    Insight.Price(_symbol, TimeSpan.FromDays(_fastEmaPeriod), InsightDirection.Up)\n                );\n\n                // longterm says buy as well\n                SetHoldings(_symbol, 1.0);\n            }\n            // if our macd is less than our signal, then let's go short\n            else if (holding.Quantity >= 0 && signalDeltaPercent < -tolerance)\n            {\n                // 1. Call EmitInsights with insights created in correct direction, here we're going short\n                //    The EmitInsights method can accept multiple insights separated by commas\n                EmitInsights(\n                    // Creates an insight for our symbol, predicting that it will move down within the fast ema period number of days\n                    Insight.Price(_symbol, TimeSpan.FromDays(_fastEmaPeriod), InsightDirection.Down)\n                );\n\n                // shortterm says sell as well\n                SetHoldings(_symbol, -1.0);\n            }\n\n            // if we wanted to liquidate our positions\n            // 1. Call EmitInsights with insights create in the correct direction -- Flat\n        \n            // EmitInsights(\n                   // Creates an insight for our symbol, predicting that it will move down or up within the fast ema period number of days, depending on our current position\n                   // Insight.Price(_symbol, TimeSpan.FromDays(FastEmaPeriod), InsightDirection.Flat);\n            // );\n        \n            // Liquidate();\n\n            // plot both lines\n            Plot(\"MACD\", _macd, _macd.Signal);\n            if (slice.Bars.ContainsKey(_symbol))\n            {\n                Plot(_symbol, \"Open\", slice[_symbol].Open);\n            }\n            Plot(_symbol, _macd.Fast, _macd.Slow);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 22136;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"85\"},\n            {\"Average Win\", \"4.85%\"},\n            {\"Average Loss\", \"-4.22%\"},\n            {\"Compounding Annual Return\", \"-3.119%\"},\n            {\"Drawdown\", \"52.900%\"},\n            {\"Expectancy\", \"-0.053\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"70553.97\"},\n            {\"Net Profit\", \"-29.446%\"},\n            {\"Sharpe Ratio\", \"-0.223\"},\n            {\"Sortino Ratio\", \"-0.243\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.001%\"},\n            {\"Loss Rate\", \"56%\"},\n            {\"Win Rate\", \"44%\"},\n            {\"Profit-Loss Ratio\", \"1.15\"},\n            {\"Alpha\", \"-0.029\"},\n            {\"Beta\", \"-0.095\"},\n            {\"Annual Standard Deviation\", \"0.149\"},\n            {\"Annual Variance\", \"0.022\"},\n            {\"Information Ratio\", \"-0.34\"},\n            {\"Tracking Error\", \"0.23\"},\n            {\"Treynor Ratio\", \"0.351\"},\n            {\"Total Fees\", \"$797.27\"},\n            {\"Estimated Strategy Capacity\", \"$1400000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4.23%\"},\n            {\"Drawdown Recovery\", \"943\"},\n            {\"OrderListHash\", \"0422632afa17df1379757085f951de7b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CorrectConsolidatedBarTypeForTickTypesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that consolidated bars are of type <see cref=\"QuoteBar\"/>\n    /// when <see cref=\"QCAlgorithm.Consolidate()\"/> is called with <see cref=\"TickType.Quote\"/>\n    /// </summary>\n    public class CorrectConsolidatedBarTypeForTickTypesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _quoteTickConsolidatorCalled;\n        private bool _tradeTickConsolidatorCalled;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var symbol = AddEquity(\"SPY\", Resolution.Tick).Symbol;\n\n            Consolidate<QuoteBar>(symbol, TimeSpan.FromMinutes(1), TickType.Quote, QuoteTickConsolidationHandler);\n            Consolidate<TradeBar>(symbol, TimeSpan.FromMinutes(1), TickType.Trade, TradeTickConsolidationHandler);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Hour > 9)\n            {\n                Quit(\"Early quit to save time\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_quoteTickConsolidatorCalled)\n            {\n                throw new RegressionTestException(\"QuoteTickConsolidationHandler was not called\");\n            }\n\n            if (!_tradeTickConsolidatorCalled)\n            {\n                throw new RegressionTestException(\"TradeTickConsolidationHandler was not called\");\n            }\n        }\n\n        private void QuoteTickConsolidationHandler(QuoteBar consolidatedBar)\n        {\n            _quoteTickConsolidatorCalled = true;\n        }\n\n        private void TradeTickConsolidationHandler(TradeBar consolidatedBar)\n        {\n            _tradeTickConsolidatorCalled = true;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 393736;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CorrelationTypeComparisonRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Compares two correlation types and asserts they are not equal during the algorithm's execution.\n    /// </summary>\n    public class CorrelationTypeComparisonRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Correlation _correlationPearson;\n        private Correlation _correlationSpearman;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 17);    //Set End Date\n            var symbol = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n            var spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            _correlationPearson = C(symbol, spy, 5, CorrelationType.Pearson);\n            _correlationSpearman = C(symbol, spy, 5, CorrelationType.Spearman);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_correlationPearson.IsReady && _correlationSpearman.IsReady)\n            {\n                var pearsonValue = _correlationPearson.Current.Value;\n                var spearmanValue = _correlationSpearman.Current.Value;\n\n                // Check that the correlation values are not the same\n                if (pearsonValue == spearmanValue)\n                {\n                    // Throw an exception if the correlation values are equal\n                    throw new RegressionTestException($\"Error: Pearson and Spearman correlation values are the same: Pearson = {pearsonValue}, Spearman = {spearmanValue}. This should not happen.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_correlationPearson.IsReady || !_correlationSpearman.IsReady)\n            {\n                throw new RegressionTestException(\"Error: Both correlation values should be ready at the end of the algorithm.\");\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 80;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-19.184\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoveredAndProtectiveCallStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Covered and Protective Call strategies.\n    /// </summary>\n    public class CoveredAndProtectiveCallStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _coveredCall;\n        private OptionStrategy _protectiveCall;\n\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contract = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .FirstOrDefault();\n\n            if (contract != null)\n            {\n                _coveredCall = OptionStrategies.CoveredCall(_optionSymbol, contract.Strike, contract.Expiry);\n                _protectiveCall = OptionStrategies.ProtectiveCall(_optionSymbol, contract.Strike, contract.Expiry);\n                Buy(_coveredCall, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var optionPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Option);\n            if (optionPosition.Symbol.ID.OptionRight != OptionRight.Call)\n            {\n                throw new RegressionTestException($\"Expected option position to be a call. Actual: {optionPosition.Symbol.ID.OptionRight}\");\n            }\n\n            var underlyingPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Equity);\n            var expectedOptionPositionQuantity = -2;\n            var expectedUnderlyingPositionQuantity = 2 * Securities[_optionSymbol].SymbolProperties.ContractMultiplier;\n\n            if (optionPosition.Quantity != expectedOptionPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected option position quantity to be {expectedOptionPositionQuantity}. Actual: {optionPosition.Quantity}\");\n            }\n\n            if (underlyingPosition.Quantity != expectedUnderlyingPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected underlying position quantity to be {expectedUnderlyingPositionQuantity}. Actual: {underlyingPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a protective call)\n            Buy(_protectiveCall, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999499.4\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.60\"},\n            {\"Estimated Strategy Capacity\", \"$120000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM92QHN8ZQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"32.18%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f8b1dfb65e4795a7929e7f3a3edd0205\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoveredAndProtectivePutStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Covered and Protective Put strategies.\n    /// </summary>\n    public class CoveredAndProtectivePutStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _coveredPut;\n        private OptionStrategy _protectivePut;\n\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contract = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .FirstOrDefault();\n\n            if (contract != null)\n            {\n                _coveredPut = OptionStrategies.CoveredPut(_optionSymbol, contract.Strike, contract.Expiry);\n                _protectivePut = OptionStrategies.ProtectivePut(_optionSymbol, contract.Strike, contract.Expiry);\n                Buy(_coveredPut, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var optionPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Option);\n            if (optionPosition.Symbol.ID.OptionRight != OptionRight.Put)\n            {\n                throw new RegressionTestException($\"Expected option position to be a put. Actual: {optionPosition.Symbol.ID.OptionRight}\");\n            }\n\n            var underlyingPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Equity);\n            var expectedOptionPositionQuantity = -2;\n            var expectedUnderlyingPositionQuantity = -2 * Securities[_optionSymbol].SymbolProperties.ContractMultiplier;\n\n            if (optionPosition.Quantity != expectedOptionPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected option position quantity to be {expectedOptionPositionQuantity}. Actual: {optionPosition.Quantity}\");\n            }\n\n            if (underlyingPosition.Quantity != expectedUnderlyingPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected underlying position quantity to be {expectedUnderlyingPositionQuantity}. Actual: {underlyingPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a protective put)\n            Buy(_protectivePut, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999155.4\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.60\"},\n            {\"Estimated Strategy Capacity\", \"$160000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"32.12%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3f95cba29e9c396bc19c0d47a889dbfb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm tarding an equity Covered Call option strategy using a combo limit order\n    /// </summary>\n    public class CoveredCallComboLimitOrderAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _submittionTime;\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(200000);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, +1).Expiration(0, 30));\n        }\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && Transactions.OrdersCount == 0)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) call contract with closest expiration\n                    var atmContract = chain\n                        .OrderBy(x => x.Expiry)\n                        .Where(contract => contract.Right == OptionRight.Call && chain.Underlying.Price > contract.Strike - 10)\n                        .OrderBy(x => x.Strike)\n                        .First();\n\n                    var optionPrice = Securities[atmContract.Symbol].AskPrice;\n                    var underlyingPrice = Securities[\"GOOG\"].AskPrice;\n\n                    // covered call\n                    var legs = new List<Leg> { Leg.Create(atmContract.Symbol, -1), Leg.Create(atmContract.Symbol.Underlying, 100) };\n\n                    var comboPrice = underlyingPrice - optionPrice;\n                    if (comboPrice < 734m)\n                    {\n                        // just to make sure the price makes sense\n                        throw new RegressionTestException($\"Unexpected combo price {comboPrice}\");\n                    }\n                    // place order slightly bellow price\n                    ComboLimitOrder(legs, 6, comboPrice - 0.5m);\n\n                    _submittionTime = Time;\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(orderEvent.ToString());\n            if (orderEvent.Status.IsFill() && (Time - _submittionTime) < TimeSpan.FromMinutes(10))\n            {\n                // we want to make sure we fill because the price moved and hit our limit price\n                throw new RegressionTestException($\"Unexpected fill time {Time} submittion time {_submittionTime}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7029;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"200671.1\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$6.90\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMEBFLDY|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"227.27%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e36c11e174486d80060855efed57a2a9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CryptoBaseCurrencyFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base crypto account regression algorithm trading in and out\n    /// </summary>\n    public abstract class CryptoBaseCurrencyFeeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        /// <summary>\n        /// The target account type\n        /// </summary>\n        protected abstract  AccountType AccountType { get; }\n\n        /// <summary>\n        /// The target brokerage model name\n        /// </summary>\n        protected BrokerageName BrokerageName { get; set; }\n\n        /// <summary>\n        /// The pair to add and trade\n        /// </summary>\n        protected string Pair { get; set; }\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetBrokerageModel(BrokerageName, AccountType);\n            _symbol = AddCrypto(Pair, Resolution.Hour).Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                CurrencyPairUtil.DecomposeCurrencyPair(_symbol, out var baseCurrency, out var quoteCurrency);\n\n                var initialQuoteCurrency = Portfolio.CashBook[quoteCurrency].Amount;\n                var ticket = Buy(_symbol, 0.1m);\n                var filledEvent = ticket.OrderEvents.Single(orderEvent => orderEvent.Status == OrderStatus.Filled);\n\n                if (Portfolio.CashBook[baseCurrency].Amount != ticket.QuantityFilled\n                    || filledEvent.FillQuantity != ticket.QuantityFilled\n                    || (0.1m - filledEvent.OrderFee.Value.Amount) != ticket.QuantityFilled)\n                {\n                    throw new RegressionTestException($\"Unexpected BaseCurrency portfolio status. Event {filledEvent}. CashBook: {Portfolio.CashBook}. \");\n                }\n\n                if (Portfolio.CashBook[quoteCurrency].Amount != (initialQuoteCurrency - 0.1m * filledEvent.FillPrice))\n                {\n                    throw new RegressionTestException($\"Unexpected QuoteCurrency portfolio status. Event {filledEvent}. CashBook: {Portfolio.CashBook}. \");\n                }\n\n                if (Securities[_symbol].Holdings.Quantity != (0.1m - filledEvent.OrderFee.Value.Amount))\n                {\n                    throw new RegressionTestException($\"Unexpected Holdings: {Securities[_symbol].Holdings}. Event {filledEvent}\");\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CryptoFutureDailyMarginInterestRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Daily regression algorithm trading ADAUSDT binance futures long and short asserting the behavior\n    /// </summary>\n    public class CryptoFutureDailyMarginInterestRegressionAlgorithm : CryptoFutureHourlyMarginInterestRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            Initialize(Resolution.Daily);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 8;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000200\"},\n            {\"End Equity\", \"1000206.40\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.15\"},\n            {\"Estimated Strategy Capacity\", \"$4300000000.00\"},\n            {\"Lowest Capacity Asset\", \"ADAUSDT 18R\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c28a12c64a53bfb3d2f9eef1b5f7037b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CryptoFutureHourlyMarginInterestRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Daily regression algorithm trading ADAUSDT binance futures long and short asserting the behavior\n    /// </summary>\n    public class CryptoFutureHourlyMarginInterestRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, int> _interestPerSymbol = new();\n        private decimal _amountAfterTrade;\n\n        private CryptoFuture _adaUsdt;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            Initialize(Resolution.Hour);\n        }\n\n        protected virtual void Initialize(Resolution resolution)\n        {\n            SetStartDate(2022, 12, 12);\n            SetEndDate(2022, 12, 13);\n\n            SetTimeZone(NodaTime.DateTimeZone.Utc);\n            SetBrokerageModel(BrokerageName.BinanceCoinFutures, AccountType.Margin);\n\n            _adaUsdt = AddCryptoFuture(\"ADAUSDT\", resolution);\n\n            // Default USD cash, set 1M but it wont be used\n            SetCash(1000000);\n\n            // the amount of USDT we need to hold to trade 'ADAUSDT'\n            _adaUsdt.QuoteCurrency.SetAmount(200);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var interestRates = slice.Get<MarginInterestRate>();\n            foreach (var interestRate in interestRates)\n            {\n                _interestPerSymbol.TryGetValue(interestRate.Key, out var count);\n                _interestPerSymbol[interestRate.Key] = ++count;\n\n                var cachedInterestRate = Securities[interestRate.Key].Cache.GetData<MarginInterestRate>();\n                if (cachedInterestRate != interestRate.Value)\n                {\n                    throw new RegressionTestException($\"Unexpected cached margin interest rate for {interestRate.Key}!\");\n                }\n            }\n\n            if(interestRates.Count != slice.MarginInterestRates.Count)\n            {\n                throw new RegressionTestException($\"Unexpected cached margin interest rate data!\");\n            }\n\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            Buy(_adaUsdt.Symbol, 1000);\n\n            _amountAfterTrade = Portfolio.CashBook[\"USDT\"].Amount;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_interestPerSymbol.TryGetValue(_adaUsdt.Symbol, out var count) || count != 1)\n            {\n                throw new RegressionTestException($\"Unexpected interest rate count {count}\");\n            }\n\n            // negative because we are long. Rate * Value * Application Count\n            var expectedFundingRateDifference = - (0.0001m * _adaUsdt.Holdings.HoldingsValue * 3);\n            var finalCash = Portfolio.CashBook[\"USDT\"].Amount;\n            if (Math.Abs(finalCash - (_amountAfterTrade + expectedFundingRateDifference)) > Math.Abs(expectedFundingRateDifference * 0.05m))\n            {\n                throw new RegressionTestException($\"Unexpected interest rate count {Portfolio.CashBook[\"USDT\"].Amount}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000200\"},\n            {\"End Equity\", \"1000207.90\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.15\"},\n            {\"Estimated Strategy Capacity\", \"$410000000.00\"},\n            {\"Lowest Capacity Asset\", \"ADAUSDT 18R\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f3d491f943932e64bc38b85d74eb5129\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.CryptoFuture;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that margin used and margin remaining update correctly when\n    /// changing leverage on a crypto future\n    /// </summary>\n    public class CryptoFutureLeverageBasedMarginRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CryptoFuture _cryptoFuture;\n\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 13);\n\n            SetTimeZone(TimeZones.Utc);\n\n            SetAccountCurrency(\"USDT\");\n            SetCash(200);\n\n            SetBrokerageModel(BrokerageName.BinanceFutures, AccountType.Margin);\n\n            _cryptoFuture = AddCryptoFuture(\"ADAUSDT\");\n            _cryptoFuture.SetLeverage(10);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_cryptoFuture.Price == 0)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_cryptoFuture.Symbol, 10); // Buy all we can with our margin (leverage is 10)\n\n                var marginUsed = Portfolio.TotalMarginUsed;\n                var marginRemaining = Portfolio.MarginRemaining;\n\n                if (marginRemaining > 0)\n                {\n                    throw new RegressionTestException($\"Expected no margin remaining after buying with full leverage. \" +\n                        $\"Actual margin remaining is {marginRemaining}\");\n                }\n\n                _cryptoFuture.SetLeverage(20);\n\n                var newMarginUsed = Portfolio.TotalMarginUsed;\n                var newMarginRemaining = Portfolio.MarginRemaining;\n\n                if (newMarginUsed >= marginUsed)\n                {\n                    throw new RegressionTestException($\"Expected margin used to decrease after increasing leverage. \" +\n                        $\"Previous margin used: {marginUsed}, new margin used: {newMarginUsed}\");\n                }\n\n                if (newMarginRemaining <= 0 || newMarginRemaining <= marginRemaining)\n                {\n                    throw new RegressionTestException($\"Expected margin remaining to increase after increasing leverage. \" +\n                        $\"Previous margin remaining: {marginRemaining}, new margin remaining: {newMarginRemaining}\");\n                }\n\n                var holdingsQuantity = _cryptoFuture.Holdings.AbsoluteQuantity;\n\n                SetHoldings(_cryptoFuture.Symbol, 20); // Buy all we can with our margin (new leverage is 20)\n\n                var newHoldingsQuantity = _cryptoFuture.Holdings.AbsoluteQuantity;\n\n                if (newHoldingsQuantity <= holdingsQuantity)\n                {\n                    throw new RegressionTestException($\"Expected holdings quantity to increase after increasing leverage and buying more. \" +\n                        $\"Previous holdings quantity: {holdingsQuantity}, new holdings quantity: {newHoldingsQuantity}\");\n                }\n\n                newMarginRemaining = Portfolio.MarginRemaining;\n\n                if (marginRemaining > 0)\n                {\n                    throw new RegressionTestException($\"Expected no margin remaining after buying with full leverage. \" +\n                        $\"Actual margin remaining is {newMarginRemaining}\");\n                }\n\n                // We are done testing, exit the algorithm\n                Quit();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200\"},\n            {\"End Equity\", \"195.58\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₮1.57\"},\n            {\"Estimated Strategy Capacity\", \"₮0\"},\n            {\"Lowest Capacity Asset\", \"ADAUSDT 18R\"},\n            {\"Portfolio Turnover\", \"2009.51%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f92ad762f77fbf4ee13b1e89a78cb1eb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBenchmarkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Shows how to set a custom benchmark for you algorithms\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"benchmarks\" />\n    public class CustomBenchmarkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Second);\n\n            // Disabling the benchmark / setting to a fixed value\n            // SetBenchmark(time => 0);\n\n            // Set the benchmark to AAPL US Equity\n            SetBenchmark(\"AAPL\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n                Debug(\"Purchased Stock\");\n            }\n\n            Symbol symbol;\n            if (SymbolCache.TryGetSymbol(\"AAPL\", out symbol))\n            {\n                throw new RegressionTestException(\"Benchmark Symbol is not expected to be added to the Symbol cache\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 234043;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"272.157%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101694.38\"},\n            {\"Net Profit\", \"1.694%\"},\n            {\"Sharpe Ratio\", \"8.863\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.143\"},\n            {\"Beta\", \"0.842\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"5.987\"},\n            {\"Tracking Error\", \"0.165\"},\n            {\"Treynor Ratio\", \"2.338\"},\n            {\"Total Fees\", \"$3.45\"},\n            {\"Estimated Strategy Capacity\", \"$310000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.96%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"8c925e7c6c10ff1da3a40669accba91a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Reproduces Lean GH issue 3572: benchmark _would_ use custom data versus equity\n    /// when both were present\n    /// </summary>\n    public class CustomBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Algorithm initialization\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"AAPL\", Resolution.Hour);\n            AddData<DummyCustomData>(\"AAPL\");\n\n            // set benchmark will use equity AAPL as benchmark\n            SetBenchmark(\"AAPL\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"AAPL\", 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n        private class DummyCustomData : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"NonExistingFile\", SubscriptionTransportMedium.LocalFile);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1965;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.768%\"},\n            {\"Drawdown\", \"2.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100382.23\"},\n            {\"Net Profit\", \"0.382%\"},\n            {\"Sharpe Ratio\", \"5.446\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"60.047%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.001\"},\n            {\"Beta\", \"0.997\"},\n            {\"Annual Standard Deviation\", \"0.179\"},\n            {\"Annual Variance\", \"0.032\"},\n            {\"Information Ratio\", \"-7.724\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0.978\"},\n            {\"Total Fees\", \"$32.11\"},\n            {\"Estimated Strategy Capacity\", \"$66000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.08%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"fa51af977e55213dc007a38a3d681b62\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBrokerageMessageHandlerAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating how to setup a custom brokerage message handler. Using the custom messaging\n    /// handler you can ensure your algorithm continues operation through connection failures.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"brokerage models\" />\n    public class CustomBrokerageErrorHandlerAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 1, 1);\n            SetEndDate(DateTime.Now.Date.AddDays(-1));\n            SetCash(25000);\n            AddSecurity(SecurityType.Equity, \"SPY\");\n\n            //Set the brokerage message handler:\n            SetBrokerageMessageHandler(new CustomBrokerageMessageHandler(this));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.HoldStock) return;\n            Order(\"SPY\", 100);\n            Debug(\"Purchased SPY on \" + Time.ToShortDateString());\n        }\n    }\n\n    /// <summary>\n    /// Handle the error messages in a custom manner\n    /// </summary>\n    public class CustomBrokerageMessageHandler : IBrokerageMessageHandler\n    {\n        private readonly IAlgorithm _algo;\n        public CustomBrokerageMessageHandler(IAlgorithm algo) { _algo = algo; }\n\n        /// <summary>\n        /// Process the brokerage message event. Trigger any actions in the algorithm or notifications system required.\n        /// </summary>\n        /// <param name=\"message\">Message object</param>\n        public void HandleMessage(BrokerageMessageEvent message)\n        {\n            var toLog = $\"{_algo.Time.ToStringInvariant(\"o\")} Event: {message.Message}\";\n            _algo.Debug(toLog);\n            _algo.Log(toLog);\n        }\n\n        /// <summary>\n        /// Handles a new order placed manually in the brokerage side\n        /// </summary>\n        /// <param name=\"eventArgs\">The new order event</param>\n        /// <returns>Whether the order should be added to the transaction handler</returns>\n        public bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n        {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBrokerageModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test we can specify a custom brokerage model, and override some of its methods\n    /// </summary>\n    public class CustomBrokerageModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _spyTicket;\n        private OrderTicket _aigTicket;\n\n        private bool _updateRequestSubmitted;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetBrokerageModel(new CustomBrokerageModel());\n            AddEquity(\"SPY\", Resolution.Daily);\n            AddEquity(\"AIG\", Resolution.Daily);\n\n            _updateRequestSubmitted = false;\n\n            if (BrokerageModel.DefaultMarkets[SecurityType.Equity] != Market.USA)\n            {\n                throw new RegressionTestException($\"The default market for Equity should be {Market.USA}\");\n            }\n            if (BrokerageModel.DefaultMarkets[SecurityType.Crypto] != Market.Binance)\n            {\n                throw new RegressionTestException($\"The default market for Crypto should be {Market.Binance}\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(\"SPY\", 100.0);\n                _aigTicket = MarketOrder(\"AIG\", 100.0);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var ticket = Transactions.GetOrderTicket(orderEvent.OrderId);\n            if (_updateRequestSubmitted == false)\n            {\n                var updateOrderFields = new UpdateOrderFields();\n                updateOrderFields.Quantity = ticket.Quantity + 10;\n                ticket.Update(updateOrderFields);\n                _spyTicket = ticket;\n                _updateRequestSubmitted = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var submitExpectedMessage = \"BrokerageModel declared unable to submit order: [2] Information - Code:  - Symbol AIG can not be submitted\";\n            if (_aigTicket.SubmitRequest.Response.ErrorMessage != submitExpectedMessage)\n            {\n                throw new RegressionTestException($\"Order with ID: {_aigTicket.OrderId} should not have submitted symbol AIG\");\n            }\n\n            var updateExpectedMessage = \"OrderID: 1 Information - Code:  - This order can not be updated\";\n            if (_spyTicket.UpdateRequests[0].Response.ErrorMessage != updateExpectedMessage)\n            {\n                throw new RegressionTestException($\"Order with ID: {_spyTicket.OrderId} should have been updated\");\n            }\n        }\n\n        class CustomBrokerageModel : DefaultBrokerageModel\n        {\n            private static readonly IReadOnlyDictionary<SecurityType, string> _defaultMarketMap = new Dictionary<SecurityType, string>\n            {\n                {SecurityType.Equity, Market.USA},\n                {SecurityType.Crypto, Market.Binance }\n            }.ToReadOnlyDictionary();\n\n            public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => _defaultMarketMap;\n\n            public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n            {\n                if (security.Symbol.Value == \"AIG\")\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"Symbol AIG can not be submitted\");\n                    return false;\n                }\n\n                message = null;\n                return true;\n            }\n\n            public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"This order can not be updated\");\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 53;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"21.133%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100245.42\"},\n            {\"Net Profit\", \"0.245%\"},\n            {\"Sharpe Ratio\", \"4.962\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.956%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.126\"},\n            {\"Beta\", \"0.145\"},\n            {\"Annual Standard Deviation\", \"0.032\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-9.54\"},\n            {\"Tracking Error\", \"0.19\"},\n            {\"Treynor Ratio\", \"1.104\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$5300000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.90%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"4e8e27d7546eced2ef3512fcc840a634\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBrokerageSideOrderHandlingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating the usage of custom brokerage message handler and the new brokerage-side order handling/filtering.\n    /// This test is supposed to be ran by the CustomBrokerageMessageHandlerTests unit test fixture.\n    ///\n    /// All orders are sent from the brokerage, none of them will be placed by the algorithm.\n    /// </summary>\n    public class CustomBrokerageSideOrderHandlingRegressionAlgorithm : QCAlgorithm\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            SetBrokerageMessageHandler(new CustomBrokerageMessageHandler(this));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // The security should have been added\n            if (!Securities.ContainsKey(_spy))\n            {\n                throw new RegressionTestException(\"Expected security to have been added\");\n            }\n\n            if (Transactions.OrdersCount == 0)\n            {\n                throw new RegressionTestException(\"Expected orders to be added from brokerage side\");\n            }\n\n            if (Portfolio.Positions.Groups.Count != 1)\n            {\n                throw new RegressionTestException(\"Expected only one position\");\n            }\n        }\n\n        public class CustomBrokerageMessageHandler : IBrokerageMessageHandler\n        {\n            private readonly IAlgorithm _algorithm;\n            public CustomBrokerageMessageHandler(IAlgorithm algo) { _algorithm = algo; }\n\n            /// <summary>\n            /// Process the brokerage message event. Trigger any actions in the algorithm or notifications system required.\n            /// </summary>\n            /// <param name=\"message\">Message object</param>\n            public void HandleMessage(BrokerageMessageEvent message)\n            {\n                _algorithm.Debug($\"{_algorithm.Time.ToStringInvariant(\"o\")} Event: {message.Message}\");\n            }\n\n            /// <summary>\n            /// Handles a new order placed manually in the brokerage side\n            /// </summary>\n            /// <param name=\"eventArgs\">The new order event</param>\n            /// <returns>Whether the order should be added to the transaction handler</returns>\n            public bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n            {\n                var order = eventArgs.Order;\n                if (string.IsNullOrEmpty(order.Tag) || !int.TryParse(order.Tag, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))\n                {\n                    throw new RegressionTestException(\"Expected all new brokerage-side orders to have a valid tag\");\n                }\n\n                // We will only process orders with even tags\n                return value % 2 == 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomBuyingPowerModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of using custom buying power model in backtesting.\n    /// QuantConnect allows you to model all orders as deeply and accurately as you need.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"transaction fees and slippage\" />\n    /// <meta name=\"tag\" content=\"custom buying power models\" />\n    public class CustomBuyingPowerModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 10, 31);\n            var security = AddEquity(\"SPY\", Resolution.Hour);\n            _spy = security.Symbol;\n\n            // set the buying power model\n            security.SetBuyingPowerModel(new CustomBuyingPowerModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            var quantity = CalculateOrderQuantity(_spy, 1m);\n            if (quantity % 100 != 0)\n            {\n                throw new RegressionTestException($\"CustomBuyingPowerModel only allow quantity that is multiple of 100 and {quantity} was found\");\n            }\n\n            // We normally get insufficient buying power model, but the\n            // CustomBuyingPowerModel always says that there is sufficient buying power for the orders\n            MarketOrder(_spy, quantity * 10);\n        }\n\n        public class CustomBuyingPowerModel : BuyingPowerModel\n        {\n            public override GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(\n                GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)\n            {\n                var quantity = base.GetMaximumOrderQuantityForTargetBuyingPower(parameters).Quantity;\n                quantity = Math.Floor(quantity / 100) * 100;\n                return new GetMaximumOrderQuantityResult(quantity);\n            }\n\n            public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n                HasSufficientBuyingPowerForOrderParameters parameters)\n            {\n                // if portfolio doesn't have enough buying power:\n                //     parameters.Insufficient()\n\n                // this model never allows a lack of funds get in the way of buying securities\n                return parameters.Sufficient();\n            }\n\n            // Let's always return 0 as the maintenance margin so we avoid margin call orders\n            public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n            {\n                return new MaintenanceMargin(0);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 330;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4775.196%\"},\n            {\"Drawdown\", \"21.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"138618.81\"},\n            {\"Net Profit\", \"38.619%\"},\n            {\"Sharpe Ratio\", \"14.322\"},\n            {\"Sortino Ratio\", \"26.701\"},\n            {\"Probabilistic Sharpe Ratio\", \"75.756%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"10.447\"},\n            {\"Beta\", \"8.754\"},\n            {\"Annual Standard Deviation\", \"0.95\"},\n            {\"Annual Variance\", \"0.903\"},\n            {\"Information Ratio\", \"15.703\"},\n            {\"Tracking Error\", \"0.844\"},\n            {\"Treynor Ratio\", \"1.554\"},\n            {\"Total Fees\", \"$30.00\"},\n            {\"Estimated Strategy Capacity\", \"$150000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"26.62%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"dae7e349316dce7621bc1f8be86ccd0d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomChartingAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating custom charting support in QuantConnect.\n    /// The entire charting system of quantconnect is adaptable. You can adjust it to draw whatever you'd like.\n    /// Charts can be stacked, or overlayed on each other. Series can be candles, lines or scatter plots.\n    /// Even the default behaviours of QuantConnect can be overridden.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"charting\" />\n    /// <meta name=\"tag\" content=\"adding charts\" />\n    /// <meta name=\"tag\" content=\"series types\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    public class CustomChartingAlgorithm : QCAlgorithm\n    {\n        private decimal _fastMa;\n        private decimal _slowMa;\n        private decimal _lastPrice;\n        private DateTime _resample;\n        private TimeSpan _resamplePeriod;\n        private readonly DateTime _startDate = new DateTime(2010, 3, 3);\n        private readonly DateTime _endDate = new DateTime(2014, 3, 3);\n\n        /// <summary>\n        /// Called at the start of your algorithm to setup your requirements:\n        /// </summary>\n        public override void Initialize()\n        {\n            //Set the date range you want to run your algorithm:\n            SetStartDate(_startDate);\n            SetEndDate(_endDate);\n\n            //Set the starting cash for your strategy:\n            SetCash(100000);\n\n            //Add any stocks you'd like to analyse, and set the resolution:\n            // Find more symbols here: http://quantconnect.com/data\n            var spy = AddSecurity(SecurityType.Equity, \"SPY\").Symbol;\n\n            //Chart - Master Container for the Chart:\n            var stockPlot = new Chart(\"Trade Plot\");\n            //On the Trade Plotter Chart we want 3 series: trades and price:\n            var buyOrders = new Series(\"Buy\", SeriesType.Scatter, 0);\n            var sellOrders = new Series(\"Sell\", SeriesType.Scatter, 0);\n            var assetPrice = new Series(\"Price\", SeriesType.Line, 0);\n            stockPlot.AddSeries(buyOrders);\n            stockPlot.AddSeries(sellOrders);\n            stockPlot.AddSeries(assetPrice);\n            AddChart(stockPlot);\n\n            var avgCross = new Chart(\"Strategy Equity\");\n            var fastMa = new Series(\"FastMA\", SeriesType.Line, 1);\n            var slowMa = new Series(\"SlowMA\", SeriesType.Line, 1);\n            avgCross.AddSeries(fastMa);\n            avgCross.AddSeries(slowMa);\n            AddChart(avgCross);\n\n            _resamplePeriod = TimeSpan.FromMinutes((_endDate - _startDate).TotalMinutes / 2000);\n\n            // There's support for candlestick charts built-in:\n            var dailySpyPlot = new Chart(\"Daily SPY\");\n            var spyCandlesticks = new CandlestickSeries(\"SPY\");\n            dailySpyPlot.AddSeries(spyCandlesticks);\n            AddChart(dailySpyPlot);\n\n            Consolidate<TradeBar>(spy, TimeSpan.FromDays(1), (bar) =>\n            {\n                Plot(\"Daily SPY\", \"SPY\", bar);\n            });\n        }\n\n\n        /// <summary>\n        /// OnEndOfDay Event Handler - At the end of each trading day we fire this code.\n        /// To avoid flooding, we recommend running your plotting at the end of each day.\n        /// </summary>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            //Log the end of day prices:\n            Plot(\"Trade Plot\", \"Price\", _lastPrice);\n        }\n\n\n        /// <summary>\n        /// On receiving new tradebar data it will be passed into this function. The general pattern is:\n        /// \"public void OnData( CustomType name ) {...s\"\n        /// </summary>\n        /// <param name=\"data\">TradeBars data type synchronized and pushed into this function. The tradebars are grouped in a dictionary.</param>\n        public void OnData(TradeBars data)\n        {\n            _lastPrice = data[\"SPY\"].Close;\n\n            if (_fastMa == 0) _fastMa = _lastPrice;\n            if (_slowMa == 0) _slowMa = _lastPrice;\n\n            _fastMa = (0.01m * _lastPrice) + (0.99m * _fastMa);\n            _slowMa = (0.001m * _lastPrice) + (0.999m * _slowMa);\n\n            if (Time > _resample)\n            {\n                _resample = Time.Add(_resamplePeriod);\n                Plot(\"Strategy Equity\", \"FastMA\", _fastMa);\n                Plot(\"Strategy Equity\", \"SlowMA\", _slowMa);\n            }\n\n\n            //On the 5th days when not invested buy:\n            if (!Portfolio.Invested && Time.Day % 13 == 0)\n            {\n                Order(\"SPY\", (int)(Portfolio.MarginRemaining / data[\"SPY\"].Close));\n                Plot(\"Trade Plot\", \"Buy\", _lastPrice);\n            }\n            else if (Time.Day % 21 == 0 && Portfolio.Invested)\n            {\n                Plot(\"Trade Plot\", \"Sell\", _lastPrice);\n                Liquidate();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataAutomaticSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to assert that custom data is seeded by default\n    /// </summary>\n    public class CustomDataAutomaticSeedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 10);\n            SetCash(100000);\n\n            Settings.SeedInitialPrices = true;\n\n            var resolution = Resolution.Daily;\n            var customData = AddData<Bitcoin>(\"BTC\", resolution);\n\n            if (!customData.HasData || customData.Price == 0)\n            {\n                throw new RegressionTestException(\"Custom data was not seeded with data on addition\");\n            }\n\n            var seedData = customData.GetLastData();\n            if (seedData is not Bitcoin)\n            {\n                throw new RegressionTestException(\"Custom data was not seeded with correct data type\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.259\"},\n            {\"Tracking Error\", \"0.073\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n\n        /// <summary>\n        /// Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\n        /// </summary>\n        public class Bitcoin : BaseData\n        {\n            [JsonProperty(\"timestamp\")]\n            public int Timestamp { get; set; }\n            [JsonProperty(\"open\")]\n            public decimal Open { get; set; }\n            [JsonProperty(\"high\")]\n            public decimal High { get; set; }\n            [JsonProperty(\"low\")]\n            public decimal Low { get; set; }\n            public decimal Mid { get; set; }\n\n            [JsonProperty(\"last\")]\n            public decimal Close { get; set; }\n            [JsonProperty(\"bid\")]\n            public decimal Bid { get; set; }\n            [JsonProperty(\"ask\")]\n            public decimal Ask { get; set; }\n            [JsonProperty(\"vwap\")]\n            public decimal WeightedPrice { get; set; }\n            [JsonProperty(\"volume\")]\n            public decimal VolumeBTC { get; set; }\n\n            /// <summary>\n            /// The end time of this data. Some data covers spans (trade bars)\n            /// and as such we want to know the entire time span covered\n            /// </summary>\n            /// <remarks>\n            /// This property is overriden to allow different values for Time and EndTime\n            /// if they are set in the Reader. In the base implementation EndTime equals Time\n            /// </remarks>\n            public override DateTime EndTime { get; set; }\n\n            /// <summary>\n            /// 1. DEFAULT CONSTRUCTOR: Custom data types need a default constructor.\n            /// We search for a default constructor so please provide one here. It won't be used for data, just to generate the \"Factory\".\n            /// </summary>\n            public Bitcoin()\n            {\n                Symbol = \"BTC\";\n            }\n\n            /// <summary>\n            /// 2. RETURN THE STRING URL SOURCE LOCATION FOR YOUR DATA:\n            /// This is a powerful and dynamic select source file method. If you have a large dataset, 10+mb we recommend you break it into smaller files. E.g. One zip per year.\n            /// We can accept raw text or ZIP files. We read the file extension to determine if it is a zip file.\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    return new SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.Rest);\n                }\n\n                //return \"http://my-ftp-server.com/futures-data-\" + date.ToString(\"Ymd\") + \".zip\";\n                // OR simply return a fixed small data file. Large files will slow down your backtest\n                return new SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/nasdaq/api/v3/datatables/QDL/BITFINEX.csv?code=BTCUSD&api_key=qAWKpUfmSVFnU3bRQwKy\")\n                {\n                    Sort = true\n                };\n            }\n\n            /// <summary>\n            /// 3. READER METHOD: Read 1 line from data source and convert it into Object.\n            /// Each line of the CSV File is presented in here. The backend downloads your file, loads it into memory and then line by line\n            /// feeds it into your algorithm\n            /// </summary>\n            /// <param name=\"line\">string line from the data source file submitted above</param>\n            /// <param name=\"config\">Subscription data, symbol name, data type</param>\n            /// <param name=\"date\">Current date we're requesting. This allows you to break up the data source into daily files.</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>New Bitcoin Object which extends BaseData.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var coin = new Bitcoin();\n                if (isLiveMode)\n                {\n                    //Example Line Format:\n                    //{\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n                    try\n                    {\n                        coin = JsonConvert.DeserializeObject<Bitcoin>(line);\n                        coin.EndTime = DateTime.UtcNow.ConvertFromUtc(config.ExchangeTimeZone);\n                        coin.Value = coin.Close;\n                    }\n                    catch { /* Do nothing, possible error in json decoding */ }\n                    return coin;\n                }\n\n                //Example Line Format:\n                // code    date        high     low      mid      last     bid      ask      volume\n                // BTCUSD  2024-10-08  63248.0  61940.0  62246.5  62245.0  62246.0  62247.0  477.91102114\n                try\n                {\n                    string[] data = line.Split(',');\n                    coin.Time = DateTime.Parse(data[1], CultureInfo.InvariantCulture);\n                    coin.EndTime = coin.Time.AddDays(1);\n                    coin.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                    coin.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                    coin.Mid = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                    coin.Close = Convert.ToDecimal(data[5], CultureInfo.InvariantCulture);\n                    coin.Bid = Convert.ToDecimal(data[6], CultureInfo.InvariantCulture);\n                    coin.Ask = Convert.ToDecimal(data[7], CultureInfo.InvariantCulture);\n                    coin.VolumeBTC = Convert.ToDecimal(data[8], CultureInfo.InvariantCulture);\n                    coin.Value = coin.Close;\n                }\n                catch { /* Do nothing, skip first title row */ }\n\n                return coin;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to demonstrate the use of SetBenchmark() with custom data\n    /// </summary>\n    public class CustomDataBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2017, 8, 18);\n            SetEndDate(2017, 8, 21);\n            SetCash(100000);\n\n            AddEquity(\"SPY\", Resolution.Hour);\n            var customSymbol = AddData<ExampleCustomData>(\"ExampleCustomData\", Resolution.Hour).Symbol;\n            SetBenchmark(customSymbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var securityBenchmark = (SecurityBenchmark)Benchmark;\n            if (securityBenchmark.Security.Price == 0)\n            {\n                throw new RegressionTestException(\"Security benchmark price was not expected to be zero\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 114;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"29.610%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100281.67\"},\n            {\"Net Profit\", \"0.282%\"},\n            {\"Sharpe Ratio\", \"7.023\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.094\"},\n            {\"Beta\", \"-0.016\"},\n            {\"Annual Standard Deviation\", \"0.007\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.047\"},\n            {\"Tracking Error\", \"0.439\"},\n            {\"Treynor Ratio\", \"-3.13\"},\n            {\"Total Fees\", \"$2.21\"},\n            {\"Estimated Strategy Capacity\", \"$180000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"24.86%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8c07dafc84c73401fa0c7709b6baf802\"}\n        };\n\n        public class ExampleCustomData : BaseData\n        {\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = \"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\";\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile, FileFormat.Csv);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(\",\");\n                var data = new ExampleCustomData()\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture).AddHours(20),\n                    Value = csv[4].ToDecimal(),\n                    Open = csv[1].ToDecimal(),\n                    High = csv[2].ToDecimal(),\n                    Low = csv[3].ToDecimal(),\n                    Close = csv[4].ToDecimal()\n                };\n\n                return data;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of using an external custom datasource. LEAN Engine is incredibly flexible and allows you to define your own data source.\n    /// This includes any data source which has a TIME and VALUE. These are the *only* requirements. To demonstrate this we're loading in \"Bitcoin\" data.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"crypto\" />\n    public class CustomDataBitcoinAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            //Weather data we have is within these days:\n            SetStartDate(2011, 9, 13);\n            SetEndDate(DateTime.Now.Date.AddDays(-1));\n\n            //Set the cash for the strategy:\n            SetCash(100000);\n\n            //Define the symbol and \"type\" of our generic data:\n            AddData<Bitcoin>(\"BTC\");\n        }\n\n        /// <summary>\n        /// Event Handler for Bitcoin Data Events: These weather objects are created from our\n        /// \"Weather\" type below and fired into this event handler.\n        /// </summary>\n        /// <param name=\"data\">One(1) Weather Object, streamed into our algorithm synchronised in time with our other data streams</param>\n        public void OnData(Bitcoin data)\n        {\n            //If we don't have any weather \"SHARES\" -- invest\"\n            if (!Portfolio.Invested)\n            {\n                //Weather used as a tradable asset, like stocks, futures etc.\n                if (data.Close != 0)\n                {\n                    // It's only OK to use SetHoldings with crypto when using custom data. When trading with built-in crypto data, \n                    // use the cashbook. Reference https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/BasicTemplateCryptoAlgorithm.py \n                    SetHoldings(\"BTC\", 1);\n                }\n                Console.WriteLine(\"Buying BTC 'Shares': BTC: \" + data.Close);\n            }\n            Console.WriteLine(\"Time: \" + Time.ToStringInvariant(\"T\") + \" \" + Time.ToStringInvariant(\"T\") + data.Close.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\n        /// </summary>\n        public class Bitcoin : BaseData\n        {\n            [JsonProperty(\"timestamp\")]\n            public int Timestamp { get; set; }\n            [JsonProperty(\"open\")]\n            public decimal Open { get; set; }\n            [JsonProperty(\"high\")]\n            public decimal High { get; set; }\n            [JsonProperty(\"low\")]\n            public decimal Low { get; set; }\n            [JsonProperty(\"last\")]\n            public decimal Close { get; set; }\n            [JsonProperty(\"bid\")]\n            public decimal Bid { get; set; }\n            [JsonProperty(\"ask\")]\n            public decimal Ask { get; set; }\n            [JsonProperty(\"vwap\")]\n            public decimal WeightedPrice { get; set; }\n            [JsonProperty(\"volume\")]\n            public decimal VolumeBTC { get; set; }\n            public decimal VolumeUSD { get; set; }\n\n            /// <summary>\n            /// The end time of this data. Some data covers spans (trade bars)\n            /// and as such we want to know the entire time span covered\n            /// </summary>\n            /// <remarks>\n            /// This property is overriden to allow different values for Time and EndTime\n            /// if they are set in the Reader. In the base implementation EndTime equals Time\n            /// </remarks>\n            public override DateTime EndTime { get; set; }\n\n            /// <summary>\n            /// 1. DEFAULT CONSTRUCTOR: Custom data types need a default constructor.\n            /// We search for a default constructor so please provide one here. It won't be used for data, just to generate the \"Factory\".\n            /// </summary>\n            public Bitcoin()\n            {\n                Symbol = \"BTC\";\n            }\n\n            /// <summary>\n            /// 2. RETURN THE STRING URL SOURCE LOCATION FOR YOUR DATA:\n            /// This is a powerful and dynamic select source file method. If you have a large dataset, 10+mb we recommend you break it into smaller files. E.g. One zip per year.\n            /// We can accept raw text or ZIP files. We read the file extension to determine if it is a zip file.\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    return new SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.Rest);\n                }\n\n                //return \"http://my-ftp-server.com/futures-data-\" + date.ToString(\"Ymd\") + \".zip\";\n                // OR simply return a fixed small data file. Large files will slow down your backtest\n                return new SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\", SubscriptionTransportMedium.RemoteFile);\n            }\n\n            /// <summary>\n            /// 3. READER METHOD: Read 1 line from data source and convert it into Object.\n            /// Each line of the CSV File is presented in here. The backend downloads your file, loads it into memory and then line by line\n            /// feeds it into your algorithm\n            /// </summary>\n            /// <param name=\"line\">string line from the data source file submitted above</param>\n            /// <param name=\"config\">Subscription data, symbol name, data type</param>\n            /// <param name=\"date\">Current date we're requesting. This allows you to break up the data source into daily files.</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>New Bitcoin Object which extends BaseData.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var coin = new Bitcoin();\n                if (isLiveMode)\n                {\n                    //Example Line Format:\n                    //{\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n                    try\n                    {\n                        coin = JsonConvert.DeserializeObject<Bitcoin>(line);\n                        coin.EndTime = DateTime.UtcNow.ConvertFromUtc(config.ExchangeTimeZone);\n                        coin.Value = coin.Close;\n                    }\n                    catch { /* Do nothing, possible error in json decoding */ }\n                    return coin;\n                }\n\n                //Example Line Format:\n                //Date      Open   High    Low     Close   Volume (BTC)    Volume (Currency)   Weighted Price\n                //2011-09-13 5.8    6.0     5.65    5.97    58.37138238,    346.0973893944      5.929230648356\n                try\n                {\n                    string[] data = line.Split(',');\n                    coin.Time = DateTime.Parse(data[0], CultureInfo.InvariantCulture);\n                    coin.EndTime = coin.Time.AddDays(1);\n                    coin.Open = Convert.ToDecimal(data[1], CultureInfo.InvariantCulture);\n                    coin.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                    coin.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                    coin.Close = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                    coin.VolumeBTC = Convert.ToDecimal(data[5], CultureInfo.InvariantCulture);\n                    coin.VolumeUSD = Convert.ToDecimal(data[6], CultureInfo.InvariantCulture);\n                    coin.WeightedPrice = Convert.ToDecimal(data[7], CultureInfo.InvariantCulture);\n                    coin.Value = coin.Close;\n                }\n                catch { /* Do nothing, skip first title row */ }\n\n                return coin;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataIndicatorExtensionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Globalization;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// The algorithm creates new indicator value with the existing indicator method by Indicator Extensions\n    /// Demonstration of using local custom datasource CustomData to request the IBM and SPY daily data\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    /// <meta name=\"tag\" content=\"charting\" />\n    public class CustomDataIndicatorExtensionsAlgorithm : QCAlgorithm\n    {\n        private const string _ibm = \"IBM\";\n        private const string _spy = \"SPY\";\n        private SimpleMovingAverage _smaIBM;\n        private SimpleMovingAverage _smaSPY;\n        private IndicatorBase<IndicatorDataPoint> _ratio;\n\n        /// <summary>\n        /// Initialize the data and resolution you require for your strategy\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 1, 1);\n            SetEndDate(2018, 1, 1);\n            SetCash(25000);\n\n            // Define the symbol and \"type\" of our generic data\n            AddData<CustomData>(_ibm, Resolution.Daily);\n            AddData<CustomData>(_spy, Resolution.Daily);\n            // Set up default Indicators, these are just 'identities' of the closing price\n            _smaIBM = SMA(_ibm, 1);\n            _smaSPY = SMA(_spy, 1);\n            // This will create a new indicator whose value is smaSPY / smaIBM\n            _ratio = _smaSPY.Over(_smaIBM);\n        }\n\n        /// <summary>\n        /// Custom data event handler:\n        /// </summary>\n        /// <param name=\"data\">CustomData - dictionary Bars of custom data</param>\n        public void OnData(CustomData data)\n        {\n            // Wait for all indicators to fully initialize\n            if (_smaIBM.IsReady && _smaSPY.IsReady && _ratio.IsReady)\n            {\n                if (!Portfolio.Invested && _ratio > 1)\n                {\n                    MarketOrder(_ibm, 100);\n                }\n                else if (_ratio < 1)\n                {\n                    Liquidate();\n                }\n                // plot all indicators\n                PlotIndicator(\"SMA\", _smaIBM, _smaSPY);\n                PlotIndicator(\"Ratio\", _ratio);\n            }\n        }\n    }\n\n    /// <summary>\n    /// Custom data from local LEAN data\n    /// </summary>\n    public class CustomData : BaseData\n    {\n        public decimal Open { get; set; }\n        public decimal High { get; set; }\n        public decimal Low { get; set; }\n        public decimal Close { get; set; }\n\n        public override DateTime EndTime\n        {\n            get { return Time + Period; }\n            set { Time = value - Period; }\n        }\n\n        public TimeSpan Period\n        {\n            get { return QuantConnect.Time.OneDay; }\n        }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var source = Path.Combine(Globals.DataFolder, \"equity\", \"usa\", config.Resolution.ToString().ToLower(), LeanData.GenerateZipFileName(config.Symbol, date, config.Resolution, config.TickType));\n            return new SubscriptionDataSource(source);\n        }\n\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var csv = line.ToCsv(6);\n            var _scaleFactor = 1 / 10000m;\n\n            var custom = new CustomData\n            {\n                Symbol = config.Symbol,\n                Time = DateTime.ParseExact(csv[0], DateFormat.TwelveCharacter, CultureInfo.InvariantCulture),\n                Open = csv[1].ToDecimal() * _scaleFactor,\n                High = csv[2].ToDecimal() * _scaleFactor,\n                Low = csv[3].ToDecimal() * _scaleFactor,\n                Close = csv[4].ToDecimal() * _scaleFactor,\n                Value = csv[4].ToDecimal() * _scaleFactor\n            };\n            return custom;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the use of custom data sourced from multiple \"files\" in the object store\n    /// </summary>\n    public class CustomDataMultiFileObjectStoreRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected readonly static string CustomData = \"2017-08-18 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-18 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-18 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-18 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-18 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-18 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-18 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-18 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-18 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-18 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-18 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-18 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-18 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-18 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-18 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-18 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\\n2017-08-19 01:00:00,5771.75,5792.9,5738.6,5760.2,140394424,5894.04\\n2017-08-19 02:00:00,5709.35,5729.85,5683.1,5699.1,142041404,5462.45\\n2017-08-19 03:00:00,5748.95,5819.4,5739.4,5808.4,124410018,5121.33\\n2017-08-19 04:00:00,5820.4,5854.9,5770.25,5850.05,107160887,4560.84\\n2017-08-19 05:00:00,5841.9,5863.4,5804.3,5813.6,117541145,4591.91\\n2017-08-19 06:00:00,5805.75,5828.4,5777.9,5822.25,115539008,4643.17\\n2017-08-19 07:00:00,5754.15,5755,5645.65,5655.9,198400131,7148\\n2017-08-19 08:00:00,5639.9,5686.15,5616.85,5667.65,182410583,6697.18\\n2017-08-19 09:00:00,5638.05,5640,5566.25,5590.25,193488581,6308.88\\n2017-08-19 10:00:00,5606.95,5666.25,5570.25,5609.1,196571543,6792.49\\n2017-08-19 11:00:00,5627.95,5635.25,5579.35,5588.7,160095940,5939.3\\n2017-08-19 12:00:00,5647.95,5699.35,5630.95,5682.35,239029425,9184.29\\n2017-08-19 13:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-19 14:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-19 15:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-19 16:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-19 17:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-19 18:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-19 19:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-19 20:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-19 21:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-19 22:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-19 23:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-21 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-21 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-21 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-21 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-21 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-21 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-21 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-21 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-21 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-21 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-21 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-21 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-21 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-21 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-21 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\";\n\n        private Symbol _customSymbol;\n\n        private List<ExampleCustomData> _receivedData = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 8, 18);\n            SetEndDate(2017, 8, 21);\n            SetCash(100000);\n\n            SetBenchmark(x => 0);\n\n            _customSymbol = AddData<ExampleCustomData>(\"ExampleCustomData\", Resolution.Hour).Symbol;\n\n            // Saving data here for demonstration and regression testing purposes.\n            // In real scenarios, data has to be saved to the object store before the algorithm starts.\n            // Note: The data is stored in separate files for each date.\n            var data = new Dictionary<DateTime, string>();\n            foreach (var line in CustomData.Split('\\n'))\n            {\n                var csv = line.Split(\",\");\n                var time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture).Date;\n                if (!data.ContainsKey(time))\n                {\n                    data[time] = line;\n                }\n                else\n                {\n                    data[time] += \"\\n\" + line;\n                }\n            }\n\n            foreach (var kvp in data)\n            {\n                ObjectStore.Save(GetCustomDataKey(kvp.Key), kvp.Value);\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(_customSymbol))\n            {\n                // passing symbol\n                var customData = slice.Get<ExampleCustomData>(_customSymbol);\n                if (customData.Price == 0)\n                {\n                    throw new RegressionTestException(\"Custom data price was not expected to be zero\");\n                }\n                var customData2 = CurrentSlice.Get<ExampleCustomData>(_customSymbol);\n                if (customData2.Price == 0)\n                {\n                    throw new RegressionTestException(\"Custom data 2 price was not expected to be zero\");\n                }\n\n                // accessing by symbol\n                customData = slice.Get<ExampleCustomData>()[_customSymbol];\n                if (customData.Price == 0)\n                {\n                    throw new RegressionTestException(\"Custom data price was not expected to be zero, index access\");\n                }\n                customData2 = CurrentSlice.Get<ExampleCustomData>()[_customSymbol];\n                if (customData2.Price == 0)\n                {\n                    throw new RegressionTestException(\"Custom data 2 price was not expected to be zero, index access\");\n                }\n\n                _receivedData.Add(customData);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_receivedData.Count == 0)\n            {\n                throw new RegressionTestException(\"Custom data was not fetched\");\n            }\n\n            var customSecurity = Securities[_customSymbol];\n            if (customSecurity == null || customSecurity.Price == 0)\n            {\n                throw new RegressionTestException(\"Expected the custom security to be added to the algorithm securities and to have a price that is not zero\");\n            }\n\n            // Make sure history requests work as expected\n            var history = History<ExampleCustomData>(_customSymbol, StartDate, EndDate, Resolution.Hour).ToList();\n\n            if (history.Count != _receivedData.Count)\n            {\n                throw new RegressionTestException(\"History request returned different data than expected\");\n            }\n\n            for (var i = 0; i < history.Count; i++)\n            {\n                if (!history[i].Equals(_receivedData[i]))\n                {\n                    throw new RegressionTestException(\"History request returned different data than expected\");\n                }\n            }\n        }\n\n        private static string GetCustomDataKey(DateTime date)\n        {\n            return $\"CustomData/ExampleCustomData{date.ToString(\"yyyyMMdd\", CultureInfo.InvariantCulture)}\";\n        }\n\n        public class ExampleCustomData : BaseData\n        {\n            public static string CustomDataKey { get; set; }\n\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(GetCustomDataKey(date), SubscriptionTransportMedium.ObjectStore, FileFormat.Csv);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(\",\");\n                var data = new ExampleCustomData()\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture),\n                    Value = csv[4].ToDecimal(),\n                    Open = csv[1].ToDecimal(),\n                    High = csv[2].ToDecimal(),\n                    Low = csv[3].ToDecimal(),\n                    Close = csv[4].ToDecimal()\n                };\n\n                return data;\n            }\n\n            public bool Equals(ExampleCustomData other)\n            {\n                return other != null &&\n                    Symbol == other.Symbol &&\n                    Time == other.Time &&\n                    Value == other.Value &&\n                    Open == other.Open &&\n                    High == other.High &&\n                    Low == other.Low &&\n                    Close == other.Close;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 70;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 69;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This demonstration imports indian NSE index \"NIFTY\" as a tradable security in addition to the USDINR currency pair. We move into the\n    /// NSE market when the economy is performing well.s\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    public class CustomDataNiftyAlgorithm : QCAlgorithm\n    {\n        //Create variables for analyzing Nifty\n        private CorrelationPair _today = new CorrelationPair();\n        private readonly List<CorrelationPair> _prices = new List<CorrelationPair>();\n        private const int _minimumCorrelationHistory = 50;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2008, 1, 8);\n            SetEndDate(2014, 7, 25);\n\n            //Set the cash for the strategy:\n            SetCash(100000);\n\n            //Define the symbol and \"type\" of our generic data:\n            var rupee = AddData<DollarRupee>(\"USDINR\", Resolution.Daily).Symbol;\n            var nifty = AddData<Nifty>(\"NIFTY\", Resolution.Daily).Symbol;\n\n            Settings.AutomaticIndicatorWarmUp = true;\n            var rupeeSma = SMA(rupee, 20);\n            var niftySma = SMA(rupee, 20);\n            Log($\"SMA - Is ready? USDINR: {rupeeSma.IsReady} NIFTY: {niftySma.IsReady}\");\n        }\n\n        /// <summary>\n        /// Event Handler for Nifty Data Events: These Nifty objects are created from our\n        /// \"Nifty\" type below and fired into this event handler.\n        /// </summary>\n        /// <param name=\"data\">One(1) Nifty Object, streamed into our algorithm synchronised in time with our other data streams</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(\"USDINR\"))\n            {\n                _today = new CorrelationPair(Time) { CurrencyPrice = Convert.ToDouble(slice[\"USDINR\"].Close) };\n            }\n\n            if (!slice.ContainsKey(\"NIFTY\"))\n            {\n                return;\n            }\n\n            try\n            {\n\n                _today.NiftyPrice = Convert.ToDouble(slice[\"NIFTY\"].Close);\n                if (_today.Date == slice[\"NIFTY\"].Time)\n                {\n                    _prices.Add(_today);\n\n                    if (_prices.Count > _minimumCorrelationHistory)\n                    {\n                        _prices.RemoveAt(0);\n                    }\n                }\n\n                //Strategy\n                var quantity = (int)(Portfolio.MarginRemaining * 0.9m / slice[\"NIFTY\"].Close);\n                var highestNifty = (from pair in _prices select pair.NiftyPrice).Max();\n                var lowestNifty = (from pair in _prices select pair.NiftyPrice).Min();\n\n                if (Time.DayOfWeek == DayOfWeek.Wednesday) //prices.Count >= minimumCorrelationHistory &&\n                {\n                    //List<double> niftyPrices = (from pair in prices select pair.NiftyPrice).ToList();\n                    //List<double> currencyPrices = (from pair in prices select pair.CurrencyPrice).ToList();\n                    //double correlation = Correlation.Pearson(niftyPrices, currencyPrices);\n                    //double niftyFraction = (correlation)/2;\n\n                    if (Convert.ToDouble(slice[\"NIFTY\"].Open) >= highestNifty)\n                    {\n                        var code = Order(\"NIFTY\", quantity - Portfolio[\"NIFTY\"].Quantity);\n                        Debug(\"LONG \" + code + \" Time: \" + Time.ToShortDateString() + \" Quantity: \" + quantity + \" Portfolio:\" + Portfolio[\"NIFTY\"].Quantity + \" Nifty: \" + slice[\"NIFTY\"].Close + \" Buying Power: \" + Portfolio.TotalPortfolioValue);\n                    }\n                    else if (Convert.ToDouble(slice[\"NIFTY\"].Open) <= lowestNifty)\n                    {\n                        var code = Order(\"NIFTY\", -quantity - Portfolio[\"NIFTY\"].Quantity);\n                        Debug(\"SHORT \" + code + \" Time: \" + Time.ToShortDateString() + \" Quantity: \" + quantity + \" Portfolio:\" + Portfolio[\"NIFTY\"].Quantity + \" Nifty: \" + slice[\"NIFTY\"].Close + \" Buying Power: \" + Portfolio.TotalPortfolioValue);\n                    }\n                }\n            }\n            catch (RegressionTestException err)\n            {\n                Debug(\"Error: \" + err.Message);\n            }\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>Method is called 10 minutes before closing to allow user to close out position.</remarks>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            Plot(\"Nifty Closing Price\", _today.NiftyPrice);\n        }\n    }\n\n    /// <summary>\n    /// NIFTY Custom Data Class\n    /// </summary>\n    public class Nifty : BaseData\n    {\n        /// <summary>\n        /// Opening Price\n        /// </summary>\n        public decimal Open { get; set; }\n        /// <summary>\n        /// High Price\n        /// </summary>\n        public decimal High { get; set; }\n        /// <summary>\n        /// Low Price\n        /// </summary>\n        public decimal Low { get; set; }\n        /// <summary>\n        /// Closing Price\n        /// </summary>\n        public decimal Close { get; set; }\n\n        /// <summary>\n        /// Default initializer for NIFTY.\n        /// </summary>\n        public Nifty()\n        {\n            Symbol = \"NIFTY\";\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\"https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1\", SubscriptionTransportMedium.RemoteFile);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            //New Nifty object\n            var index = new Nifty();\n\n            try\n            {\n                //Example File Format:\n                //Date,       Open       High        Low       Close     Volume      Turnover\n                //2011-09-13  7792.9    7799.9     7722.65    7748.7    116534670    6107.78\n                var data = line.Split(',');\n                index.Time = DateTime.Parse(data[0], CultureInfo.InvariantCulture);\n                index.EndTime = index.Time.AddDays(1);\n                index.Open = Convert.ToDecimal(data[1], CultureInfo.InvariantCulture);\n                index.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                index.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                index.Close = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                index.Symbol = \"NIFTY\";\n                index.Value = index.Close;\n            }\n            catch\n            {\n            }\n            return index;\n        }\n    }\n\n\n    /// <summary>\n    /// Dollar Rupe is a custom data type we create for this algorithm\n    /// </summary>\n    public class DollarRupee : BaseData\n    {\n        /// <summary>\n        /// Open Price\n        /// </summary>\n        public decimal Open { get; set; } = 0;\n        /// <summary>\n        /// High Price\n        /// </summary>\n        public decimal High { get; set; } = 0;\n        /// <summary>\n        /// Low Price\n        /// </summary>\n        public decimal Low { get; set; } = 0;\n        /// <summary>\n        /// Closing Price\n        /// </summary>\n        public decimal Close { get; set; }\n\n        /// <summary>\n        /// Default constructor for the custom data class.\n        /// </summary>\n        public DollarRupee()\n        {\n            Symbol = \"USDINR\";\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\"https://www.dropbox.com/s/m6ecmkg9aijwzy2/USDINR.csv?dl=1\", SubscriptionTransportMedium.RemoteFile);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            //New USDINR object\n            var currency = new DollarRupee();\n\n            try\n            {\n                var data = line.Split(',');\n                currency.Time = DateTime.Parse(data[0], CultureInfo.InvariantCulture);\n                currency.EndTime = currency.Time.AddDays(1);\n                currency.Close = Convert.ToDecimal(data[1], CultureInfo.InvariantCulture);\n                currency.Symbol = \"USDINR\";\n                currency.Value = currency.Close;\n            }\n            catch\n            {\n            }\n            return currency;\n        }\n    }\n\n    /// <summary>\n    /// Correlation Pair is a helper class to combine two data points which we'll use to perform the correlation.\n    /// </summary>\n    public class CorrelationPair\n    {\n        /// <summary>\n        /// Date of the correlation pair\n        /// </summary>\n        public DateTime Date { get; set; }\n\n        /// <summary>\n        /// Nifty price for this correlation pair\n        /// </summary>\n        public double NiftyPrice { get; set; }\n\n        /// <summary>\n        /// Currency price for this correlation pair\n        /// </summary>\n        public double CurrencyPrice { get; set; }\n\n        /// <summary>\n        /// Default initializer\n        /// </summary>\n        public CorrelationPair()\n        { }\n\n        /// <summary>\n        /// Date based correlation pair initializer\n        /// </summary>\n        public CorrelationPair(DateTime date)\n        {\n            Date = date.Date;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataObjectStoreRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the use of custom data sourced from the object store\n    /// </summary>\n    public class CustomDataObjectStoreRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual string CustomDataKey => \"CustomData/ExampleCustomData\";\n\n        protected readonly static string CustomData = \"2017-08-18 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-18 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-18 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-18 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-18 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-18 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-18 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-18 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-18 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-18 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-18 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-18 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-18 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-18 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-18 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-18 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\\n2017-08-19 01:00:00,5771.75,5792.9,5738.6,5760.2,140394424,5894.04\\n2017-08-19 02:00:00,5709.35,5729.85,5683.1,5699.1,142041404,5462.45\\n2017-08-19 03:00:00,5748.95,5819.4,5739.4,5808.4,124410018,5121.33\\n2017-08-19 04:00:00,5820.4,5854.9,5770.25,5850.05,107160887,4560.84\\n2017-08-19 05:00:00,5841.9,5863.4,5804.3,5813.6,117541145,4591.91\\n2017-08-19 06:00:00,5805.75,5828.4,5777.9,5822.25,115539008,4643.17\\n2017-08-19 07:00:00,5754.15,5755,5645.65,5655.9,198400131,7148\\n2017-08-19 08:00:00,5639.9,5686.15,5616.85,5667.65,182410583,6697.18\\n2017-08-19 09:00:00,5638.05,5640,5566.25,5590.25,193488581,6308.88\\n2017-08-19 10:00:00,5606.95,5666.25,5570.25,5609.1,196571543,6792.49\\n2017-08-19 11:00:00,5627.95,5635.25,5579.35,5588.7,160095940,5939.3\\n2017-08-19 12:00:00,5647.95,5699.35,5630.95,5682.35,239029425,9184.29\\n2017-08-19 13:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-19 14:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-19 15:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-19 16:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-19 17:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-19 18:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-19 19:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-19 20:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-19 21:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-19 22:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-19 23:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-21 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-21 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-21 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-21 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-21 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-21 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-21 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-21 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-21 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-21 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-21 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-21 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-21 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-21 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-21 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\";\n\n        private Symbol _customSymbol;\n\n        private List<ExampleCustomData> _receivedData = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 8, 18);\n            SetEndDate(2017, 8, 21);\n            SetCash(100000);\n\n            SetBenchmark(x => 0);\n\n            ExampleCustomData.CustomDataKey = CustomDataKey;\n\n            _customSymbol = AddData<ExampleCustomData>(\"ExampleCustomData\", Resolution.Hour).Symbol;\n\n            // Saving data here for demonstration and regression testing purposes.\n            // In real scenarios, data has to be saved to the object store before the algorithm starts.\n            SaveDataToObjectStore();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(_customSymbol))\n            {\n                var customData = slice.Get<ExampleCustomData>(_customSymbol);\n                if (customData.Price == 0)\n                {\n                    throw new RegressionTestException(\"Custom data price was not expected to be zero\");\n                }\n\n                _receivedData.Add(customData);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_receivedData.Count == 0)\n            {\n                throw new RegressionTestException(\"Custom data was not fetched\");\n            }\n\n            var customSecurity = Securities[_customSymbol];\n            if (customSecurity == null || customSecurity.Price == 0)\n            {\n                throw new RegressionTestException(\"Expected the custom security to be added to the algorithm securities and to have a price that is not zero\");\n            }\n\n            // Make sure history requests work as expected\n            var history = History<ExampleCustomData>(_customSymbol, StartDate, EndDate, Resolution.Hour).ToList();\n\n            if (history.Count != _receivedData.Count)\n            {\n                throw new RegressionTestException(\"History request returned different data than expected\");\n            }\n\n            for (var i = 0; i < history.Count; i++)\n            {\n                if (!history[i].Equals(_receivedData[i]))\n                {\n                    throw new RegressionTestException(\"History request returned different data than expected\");\n                }\n            }\n        }\n\n        protected virtual void SaveDataToObjectStore()\n        {\n            ObjectStore.Save(CustomDataKey, CustomData);\n        }\n\n        public class ExampleCustomData : BaseData\n        {\n            public static string CustomDataKey { get; set; }\n\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(CustomDataKey, SubscriptionTransportMedium.ObjectStore, FileFormat.Csv);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(\",\");\n                var data = new ExampleCustomData()\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture),\n                    Value = csv[4].ToDecimal(),\n                    Open = csv[1].ToDecimal(),\n                    High = csv[2].ToDecimal(),\n                    Low = csv[3].ToDecimal(),\n                    Close = csv[4].ToDecimal()\n                };\n\n                return data;\n            }\n\n            public bool Equals(ExampleCustomData other)\n            {\n                return other != null &&\n                    Symbol == other.Symbol &&\n                    Time == other.Time &&\n                    Value == other.Value &&\n                    Open == other.Open &&\n                    High == other.High &&\n                    Low == other.Low &&\n                    Close == other.Close;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 70;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 69;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to demonstrate setting custom Symbol Properties and Market Hours for a custom data import\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"crypto\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class CustomDataPropertiesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private string _ticker = \"BTC\";\n        private Security _bitcoin;\n\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 10);\n\n            //Set the cash for the strategy:\n            SetCash(100000);\n\n            // Define our custom data properties and exchange hours\n            var properties = new SymbolProperties(\"Bitcoin\", \"USD\", 1, 0.01m, 0.01m, _ticker);\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n            // Add the custom data to our algorithm with our custom properties and exchange hours\n            _bitcoin = AddData<Bitcoin>(_ticker, properties, exchangeHours);\n\n            //Verify our symbol properties were changed and loaded into this security\n            if (_bitcoin.SymbolProperties != properties)\n            {\n                throw new RegressionTestException(\"Failed to set and retrieve custom SymbolProperties for BTC\");\n            }\n\n            //Verify our exchange hours were changed and loaded into this security\n            if (_bitcoin.Exchange.Hours != exchangeHours)\n            {\n                throw new RegressionTestException(\"Failed to set and retrieve custom ExchangeHours for BTC\");\n            }\n\n            // For regression purposes on AddData overloads, this call is simply to ensure Lean can accept this\n            // with default params and is not routed to a breaking function.\n            AddData<Bitcoin>(\"BTCUSD\");\n        }\n\n        /// <summary>\n        /// Event Handler for Bitcoin Data Events: These Bitcoin objects are created from our\n        /// \"Bitcoin\" type below and fired into this event handler.\n        /// </summary>\n        /// <param name=\"data\">One(1) Bitcoin Object, streamed into our algorithm synchronized in time with our other data streams</param>\n        public void OnData(Bitcoin data)\n        {\n            //If we don't have any bitcoin \"SHARES\" -- invest\"\n            if (!Portfolio.Invested)\n            {\n                //Bitcoin used as a tradable asset, like stocks, futures etc.\n                if (data.Close != 0)\n                {\n                    //Access custom data symbols using <ticker>.<custom-type>\n                    Order(\"BTC.Bitcoin\", Portfolio.MarginRemaining / Math.Abs(data.Close + 1));\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Reset our Symbol property value, for testing purposes.\n            SymbolPropertiesDatabase.SetEntry(Market.USA, MarketHoursDatabase.GetDatabaseSymbolKey(_bitcoin.Symbol), SecurityType.Base,\n                SymbolProperties.GetDefault(\"USD\"));\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 57;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34781.071%\"},\n            {\"Drawdown\", \"4.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"110102.2\"},\n            {\"Net Profit\", \"10.102%\"},\n            {\"Sharpe Ratio\", \"283.719\"},\n            {\"Sortino Ratio\", \"1123.876\"},\n            {\"Probabilistic Sharpe Ratio\", \"81.716%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"184.11\"},\n            {\"Beta\", \"-6.241\"},\n            {\"Annual Standard Deviation\", \"0.635\"},\n            {\"Annual Variance\", \"0.403\"},\n            {\"Information Ratio\", \"260.511\"},\n            {\"Tracking Error\", \"0.689\"},\n            {\"Treynor Ratio\", \"-28.849\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"BTC.Bitcoin 2S\"},\n            {\"Portfolio Turnover\", \"16.73%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"b890a8e73bf118e943ad2f2e712f12d0\"}\n        };\n\n        /// <summary>\n        /// Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\n        /// </summary>\n        public class Bitcoin : BaseData\n        {\n            [JsonProperty(\"timestamp\")]\n            public int Timestamp { get; set; }\n            [JsonProperty(\"open\")]\n            public decimal Open { get; set; }\n            [JsonProperty(\"high\")]\n            public decimal High { get; set; }\n            [JsonProperty(\"low\")]\n            public decimal Low { get; set; }\n            public decimal Mid { get; set; }\n            [JsonProperty(\"last\")]\n            public decimal Close { get; set; }\n            [JsonProperty(\"bid\")]\n            public decimal Bid { get; set; }\n            [JsonProperty(\"ask\")]\n            public decimal Ask { get; set; }\n            [JsonProperty(\"vwap\")]\n            public decimal WeightedPrice { get; set; }\n            [JsonProperty(\"volume\")]\n            public decimal VolumeBTC { get; set; }\n            public decimal VolumeUSD { get; set; }\n\n            /// <summary>\n            /// The end time of this data. Some data covers spans (trade bars)\n            /// and as such we want to know the entire time span covered\n            /// </summary>\n            /// <remarks>\n            /// This property is overriden to allow different values for Time and EndTime\n            /// if they are set in the Reader. In the base implementation EndTime equals Time\n            /// </remarks>\n            public override DateTime EndTime { get; set; }\n\n            /// <summary>\n            /// 1. DEFAULT CONSTRUCTOR: Custom data types need a default constructor.\n            /// We search for a default constructor so please provide one here. It won't be used for data, just to generate the \"Factory\".\n            /// </summary>\n            public Bitcoin()\n            {\n            }\n\n            /// <summary>\n            /// 2. RETURN THE STRING URL SOURCE LOCATION FOR YOUR DATA:\n            /// This is a powerful and dynamic select source file method. If you have a large dataset, 10+mb we recommend you break it into smaller files. E.g. One zip per year.\n            /// We can accept raw text or ZIP files. We read the file extension to determine if it is a zip file.\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    return new SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.Rest);\n                }\n\n                //return \"http://my-ftp-server.com/futures-data-\" + date.ToString(\"Ymd\") + \".zip\";\n                // OR simply return a fixed small data file. Large files will slow down your backtest\n                return new SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/nasdaq/api/v3/datatables/QDL/BITFINEX.csv?code=BTCUSD&api_key=WyAazVXnq7ATy_fefTqm\")\n                {\n                    Sort = true\n                };\n            }\n\n            /// <summary>\n            /// 3. READER METHOD: Read 1 line from data source and convert it into Object.\n            /// Each line of the CSV File is presented in here. The backend downloads your file, loads it into memory and then line by line\n            /// feeds it into your algorithm\n            /// </summary>\n            /// <param name=\"line\">string line from the data source file submitted above</param>\n            /// <param name=\"config\">Subscription data, symbol name, data type</param>\n            /// <param name=\"date\">Current date we're requesting. This allows you to break up the data source into daily files.</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>New Bitcoin Object which extends BaseData.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var coin = new Bitcoin() { Symbol = config.Symbol };\n                if (isLiveMode)\n                {\n                    //Example Line Format:\n                    //{\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n                    try\n                    {\n                        coin = JsonConvert.DeserializeObject<Bitcoin>(line);\n                        coin.EndTime = DateTime.UtcNow.ConvertFromUtc(config.ExchangeTimeZone);\n                        coin.Value = coin.Close;\n                    }\n                    catch { /* Do nothing, possible error in json decoding */ }\n                    return coin;\n                }\n\n                //Example Line Format:\n                // code    date        high     low      mid      last     bid      ask      volume\n                // BTCUSD  2024-10-08  63248.0  61940.0  62246.5  62245.0  62246.0  62247.0       5.929230648356\n                try\n                {\n                    string[] data = line.Split(',');\n                    coin.Time = DateTime.Parse(data[1], CultureInfo.InvariantCulture);\n                    coin.EndTime = coin.Time.AddDays(1);\n                    coin.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                    coin.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                    coin.Mid = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                    coin.Close = Convert.ToDecimal(data[5], CultureInfo.InvariantCulture);\n                    coin.Bid = Convert.ToDecimal(data[6], CultureInfo.InvariantCulture);\n                    coin.Ask = Convert.ToDecimal(data[7], CultureInfo.InvariantCulture);\n                    coin.VolumeBTC = Convert.ToDecimal(data[8], CultureInfo.InvariantCulture);\n                    coin.Value = coin.Close;\n                }\n                catch { /* Do nothing, skip first title row */ }\n\n                return coin;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to demonstrate importing and trading on custom data.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"crypto\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class CustomDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _warmedUpChecked;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 10);\n\n            //Set the cash for the strategy:\n            SetCash(100000);\n\n            //Define the symbol and \"type\" of our generic data:\n            var resolution = LiveMode ? Resolution.Second : Resolution.Daily;\n            AddData<Bitcoin>(\"BTC\", resolution);\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        /// <summary>\n        /// Event Handler for Bitcoin Data Events: These Bitcoin objects are created from our\n        /// \"Bitcoin\" type below and fired into this event handler.\n        /// </summary>\n        /// <param name=\"data\">One(1) Bitcoin Object, streamed into our algorithm synchronised in time with our other data streams</param>\n        public void OnData(Bitcoin data)\n        {\n            //If we don't have any bitcoin \"SHARES\" -- invest\"\n            if (!Portfolio.Invested)\n            {\n                //Bitcoin used as a tradable asset, like stocks, futures etc.\n                if (data.Close != 0)\n                {\n                    //Access custom data symbols using <ticker>.<custom-type>\n                    Order(\"BTC.Bitcoin\", Portfolio.MarginRemaining / Math.Abs(data.Close + 1));\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            changes.FilterCustomSecurities = false;\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (addedSecurity.Symbol.Value == \"BTC\")\n                {\n                    _warmedUpChecked = true;\n                }\n                if (!addedSecurity.HasData)\n                {\n                    throw new RegressionTestException($\"Security {addedSecurity.Symbol} was not warmed up!\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_warmedUpChecked)\n            {\n                throw new RegressionTestException($\"Security was not warmed up!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"27587.925%\"},\n            {\"Drawdown\", \"4.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"109685\"},\n            {\"Net Profit\", \"9.685%\"},\n            {\"Sharpe Ratio\", \"238.834\"},\n            {\"Sortino Ratio\", \"945.079\"},\n            {\"Probabilistic Sharpe Ratio\", \"81.660%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"149.482\"},\n            {\"Beta\", \"-6.002\"},\n            {\"Annual Standard Deviation\", \"0.61\"},\n            {\"Annual Variance\", \"0.371\"},\n            {\"Information Ratio\", \"218.36\"},\n            {\"Tracking Error\", \"0.664\"},\n            {\"Treynor Ratio\", \"-24.253\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"BTC.Bitcoin 2S\"},\n            {\"Portfolio Turnover\", \"16.03%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"dde8821614d33c89e6e75c536447b7da\"}\n        };\n\n        /// <summary>\n        /// Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\n        /// </summary>\n        public class Bitcoin : BaseData\n        {\n            [JsonProperty(\"timestamp\")]\n            public int Timestamp { get; set; }\n            [JsonProperty(\"open\")]\n            public decimal Open { get; set; }\n            [JsonProperty(\"high\")]\n            public decimal High { get; set; }\n            [JsonProperty(\"low\")]\n            public decimal Low { get; set; }\n            public decimal Mid { get; set; }\n\n            [JsonProperty(\"last\")]\n            public decimal Close { get; set; }\n            [JsonProperty(\"bid\")]\n            public decimal Bid { get; set; }\n            [JsonProperty(\"ask\")]\n            public decimal Ask { get; set; }\n            [JsonProperty(\"vwap\")]\n            public decimal WeightedPrice { get; set; }\n            [JsonProperty(\"volume\")]\n            public decimal VolumeBTC { get; set; }\n\n            /// <summary>\n            /// The end time of this data. Some data covers spans (trade bars)\n            /// and as such we want to know the entire time span covered\n            /// </summary>\n            /// <remarks>\n            /// This property is overriden to allow different values for Time and EndTime\n            /// if they are set in the Reader. In the base implementation EndTime equals Time\n            /// </remarks>\n            public override DateTime EndTime { get; set; }\n\n            /// <summary>\n            /// 1. DEFAULT CONSTRUCTOR: Custom data types need a default constructor.\n            /// We search for a default constructor so please provide one here. It won't be used for data, just to generate the \"Factory\".\n            /// </summary>\n            public Bitcoin()\n            {\n                Symbol = \"BTC\";\n            }\n\n            /// <summary>\n            /// 2. RETURN THE STRING URL SOURCE LOCATION FOR YOUR DATA:\n            /// This is a powerful and dynamic select source file method. If you have a large dataset, 10+mb we recommend you break it into smaller files. E.g. One zip per year.\n            /// We can accept raw text or ZIP files. We read the file extension to determine if it is a zip file.\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    return new SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.Rest);\n                }\n\n                //return \"http://my-ftp-server.com/futures-data-\" + date.ToString(\"Ymd\") + \".zip\";\n                // OR simply return a fixed small data file. Large files will slow down your backtest\n                return new SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/nasdaq/api/v3/datatables/QDL/BITFINEX.csv?code=BTCUSD&api_key=qAWKpUfmSVFnU3bRQwKy\")\n                {\n                    Sort = true\n                };\n            }\n\n            /// <summary>\n            /// 3. READER METHOD: Read 1 line from data source and convert it into Object.\n            /// Each line of the CSV File is presented in here. The backend downloads your file, loads it into memory and then line by line\n            /// feeds it into your algorithm\n            /// </summary>\n            /// <param name=\"line\">string line from the data source file submitted above</param>\n            /// <param name=\"config\">Subscription data, symbol name, data type</param>\n            /// <param name=\"date\">Current date we're requesting. This allows you to break up the data source into daily files.</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>New Bitcoin Object which extends BaseData.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var coin = new Bitcoin();\n                if (isLiveMode)\n                {\n                    //Example Line Format:\n                    //{\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n                    try\n                    {\n                        coin = JsonConvert.DeserializeObject<Bitcoin>(line);\n                        coin.EndTime = DateTime.UtcNow.ConvertFromUtc(config.ExchangeTimeZone);\n                        coin.Value = coin.Close;\n                    }\n                    catch { /* Do nothing, possible error in json decoding */ }\n                    return coin;\n                }\n\n                //Example Line Format:\n                // code    date        high     low      mid      last     bid      ask      volume\n                // BTCUSD  2024-10-08  63248.0  61940.0  62246.5  62245.0  62246.0  62247.0  477.91102114\n                try\n                {\n                    string[] data = line.Split(',');\n                    coin.Time = DateTime.Parse(data[1], CultureInfo.InvariantCulture);\n                    coin.EndTime = coin.Time.AddDays(1);\n                    coin.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                    coin.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                    coin.Mid = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                    coin.Close = Convert.ToDecimal(data[5], CultureInfo.InvariantCulture);\n                    coin.Bid = Convert.ToDecimal(data[6], CultureInfo.InvariantCulture);\n                    coin.Ask = Convert.ToDecimal(data[7], CultureInfo.InvariantCulture);\n                    coin.VolumeBTC = Convert.ToDecimal(data[8], CultureInfo.InvariantCulture);\n                    coin.Value = coin.Close;\n                }\n                catch { /* Do nothing, skip first title row */ }\n\n                return coin;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataSecurityCacheGetDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing static QuantConnect.Algorithm.CSharp.CustomDataRegressionAlgorithm;\n\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm used to verify that GetData<T> correctly retrieves \n    /// the latest custom data stored in the security cache.\n    /// </summary>\n    public class CustomDataSecurityCacheGetDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 10);\n\n            AddData<Bitcoin>(\"BTC\", Resolution.Daily);\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var bitcoin = Securities[\"BTC\"].Cache.GetData<Bitcoin>();\n            if (bitcoin == null)\n            {\n                throw new RegressionTestException(\"Expected Bitcoin data in cache, but none was found\");\n            }\n            if (bitcoin.Value == 0)\n            {\n                throw new RegressionTestException(\"Expected Bitcoin value to be non-zero\");\n            }\n            var bitcoinFromSlice = slice.Get<Bitcoin>().Values.FirstOrDefault();\n            if (bitcoinFromSlice != bitcoin)\n            {\n                throw new RegressionTestException(\"Expected cached Bitcoin to match the one from Slice\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.259\"},\n            {\"Tracking Error\", \"0.073\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataTypeHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that\n    /// </summary>\n    public class CustomDataTypeHistoryAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 8, 20);\n            SetEndDate(2017, 8, 20);\n\n            _symbol = AddData<CustomDataType>(\"CustomDataType\", Resolution.Hour).Symbol;\n\n            var history = History<CustomDataType>(_symbol, 48, Resolution.Hour).ToList();\n\n            Log($\"History count: {history.Count}\");\n\n            if (history.Count == 0)\n            {\n                throw new RegressionTestException(\"History request returned no data\");\n            }\n\n            var history2 = History<CustomDataType>(new[] { _symbol }, 48, Resolution.Hour).ToList();\n\n            if (history2.Count != history.Count)\n            {\n                throw new RegressionTestException(\"History requests returned different data\");\n            }\n\n        }\n\n        public class CustomDataType : DynamicData\n        {\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = \"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\";\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                if (string.IsNullOrWhiteSpace(line.Trim()))\n                {\n                    return null;\n                }\n\n                try\n                {\n                    var csv = line.Split(\",\");\n                    var data = new CustomDataType()\n                    {\n                        Symbol = config.Symbol,\n                        Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture).AddHours(20),\n                        Value = csv[4].ToDecimal(),\n                        Open = csv[1].ToDecimal(),\n                        High = csv[2].ToDecimal(),\n                        Low = csv[3].ToDecimal(),\n                        Close = csv[4].ToDecimal()\n                    };\n\n                    return data;\n                }\n                catch\n                {\n                    return null;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 28;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 54;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataUniverseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm shows how to grab symbols from an external api each day\n    /// and load data using the universe selection feature. In this example we\n    /// define a custom data type for the NYSE top gainers and then short the\n    /// top 2 gainers each day\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"custom universes\" />\n    public class CustomDataUniverseAlgorithm : QCAlgorithm\n    {\n        private SecurityChanges _changes;\n\n        public override void Initialize()\n        {\n            // Data ADDED via universe selection is added with Daily resolution.\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2015, 01, 05);\n            SetEndDate(2015, 07, 01);\n\n            SetCash(100000);\n\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily);\n            SetBenchmark(\"SPY\");\n\n            // add a custom universe data source (defaults to usa-equity)\n            AddUniverse<NyseTopGainers>(\"universe-nyse-top-gainers\", Resolution.Daily, data =>\n            {\n                // define our selection criteria\n                return from NyseTopGainers d in data\n                       // pick top 2 gainers to bet against\n                       where d.TopGainersRank <= 2\n                       select d.Symbol;\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n\n            foreach (var security in changes.RemovedSecurities)\n            {\n                // liquidate securities that have been removed\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                    Log(\"Exit \" + security.Symbol + \" at \" + security.Close);\n                }\n            }\n\n            foreach (var security in changes.AddedSecurities)\n            {\n                // enter short positions on new securities\n                if (!security.Invested && security.Close != 0)\n                {\n                    var qty = CalculateOrderQuantity(security.Symbol, -0.25m);\n                    MarketOnOpenOrder(security.Symbol, qty);\n                    Log(\"Enter  \" + security.Symbol + \" at \" + security.Close);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Custom data type that uses the wall street journal's top 100 nyse gainers\n        /// html page as a live data source, and a csv file that contains the top 10\n        /// nyse gainers since the beginning of 2009 until 2015/10/19\n        /// </summary>\n        public class NyseTopGainers : BaseData\n        {\n            public int TopGainersRank { get; set; }\n\n            public override DateTime EndTime\n            {\n                // define end time as exactly 1 day after Time\n                get { return Time + QuantConnect.Time.OneDay; }\n                set { Time = value - QuantConnect.Time.OneDay; }\n            }\n\n            private int _count;\n            private DateTime _lastDate;\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    // this is actually an html file, we'll handle the parsing accordingly\n                    return new SubscriptionDataSource(@\"http://www.wsj.com/mdc/public/page/2_3021-gainnyse-gainer.html\", SubscriptionTransportMedium.RemoteFile);\n                }\n\n                // this has data from 2009.01.01 to 2015.10.19 for top 10 nyse gainers\n                return new SubscriptionDataSource(@\"https://www.dropbox.com/s/vrn3p38qberw3df/nyse-gainers.csv?dl=1\", SubscriptionTransportMedium.RemoteFile);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                if (!isLiveMode)\n                {\n                    // backtest gets data from csv file in dropbox\n                    var csv = line.Split(',');\n                    return new NyseTopGainers\n                    {\n                        Time = DateTime.ParseExact(csv[0], \"yyyyMMdd\", null),\n                        Symbol = Symbol.Create(csv[1], SecurityType.Equity, Market.USA),\n                        TopGainersRank = Parse.Int(csv[2])\n                    };\n                }\n\n                if (_lastDate != date)\n                {\n                    // reset our counter for the new day\n                    _lastDate = date;\n                    _count = 0;\n                }\n\n                // parse the html into a symbol\n\n                if (!line.StartsWith(@\"<a href=\"\"/public/quotes/main.html?symbol=\"))\n                {\n                    // we're only looking for lines that contain the symbols\n                    return null;\n                }\n\n                var lastCloseParen = line.LastIndexOf(\")\", StringComparison.Ordinal);\n                var lastOpenParen = line.LastIndexOf(\"(\", StringComparison.Ordinal);\n                if (lastOpenParen == -1 || lastCloseParen == -1)\n                {\n                    return null;\n                }\n\n                var symbolString = line.Substring(lastOpenParen + 1, lastCloseParen - lastOpenParen - 1);\n                return new NyseTopGainers\n                {\n                    Symbol = Symbol.Create(symbolString, SecurityType.Equity, Market.USA),\n                    Time = date,\n                    // the html has these in order, so we'll keep incrementing until a new day\n                    TopGainersRank = ++_count\n                };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataUniverseImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Assert that custom data universe selection happens right away after algorithm starts\n    /// </summary>\n    public class CustomDataUniverseImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _selected;\n        private bool _securitiesChanged;\n\n        private bool _firstOnData = true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 07, 04);\n            SetEndDate(2018, 07, 04);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverse<StockDataSource>(\"my-stock-data-source\", stockDataSource =>\n            {\n                _selected = true;\n                return stockDataSource.OfType<StockDataSource>().SelectMany(x => x.Symbols);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_firstOnData)\n            {\n                if (!_selected)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away. \" +\n                        \"The first OnData call should have had happened after the universe selection\");\n                }\n\n                _firstOnData = false;\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (!_selected)\n            {\n                throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n            }\n\n            if (!_securitiesChanged)\n            {\n                // Selection should be happening right on algorithm start\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n                }\n\n                if (changes.AddedSecurities.Count == 0)\n                {\n                    throw new RegressionTestException($\"Expected multiple stocks to be added to the algorithm, \" +\n                        $\"but found {changes.AddedSecurities.Count}\");\n                }\n\n                _securitiesChanged = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_firstOnData || !_selected || !_securitiesChanged)\n            {\n                throw new RegressionTestException(\"Expected events didn't happen\");\n            }\n        }\n\n        /// <summary>\n        /// Our custom data type that defines where to get and how to read our backtest and live data.\n        /// </summary>\n        class StockDataSource : BaseData\n        {\n            private const string Url = @\"https://www.dropbox.com/s/ae1couew5ir3z9y/daily-stock-picker-backtest.csv?dl=1\";\n\n            public List<string> Symbols { get; set; }\n\n            public StockDataSource()\n            {\n                Symbols = new List<string>();\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(Url, SubscriptionTransportMedium.RemoteFile);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                try\n                {\n                    // create a new StockDataSource and set the symbol using config.Symbol\n                    var stocks = new StockDataSource { Symbol = config.Symbol };\n                    // break our line into csv pieces\n                    var csv = line.ToCsv();\n                    if (isLiveMode)\n                    {\n                        // our live mode format does not have a date in the first column, so use date parameter\n                        stocks.Time = date;\n                        stocks.Symbols.AddRange(csv);\n                    }\n                    else\n                    {\n                        // our backtest mode format has the first column as date, parse it\n                        stocks.Time = DateTime.ParseExact(csv[0], \"yyyyMMdd\", null);\n                        // any following comma separated values are symbols, save them off\n                        stocks.Symbols.AddRange(csv.Skip(1));\n                    }\n                    return stocks;\n                }\n                // return null if we encounter any errors\n                catch\n                {\n                    return null;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3287;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.97\"},\n            {\"Tracking Error\", \"0.104\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Custom data universe selection regression algorithm asserting it's behavior. See GH issue #6396\n    /// </summary>\n    public class CustomDataUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private HashSet<Symbol> _currentUnderlyingSymbols = new();\n        private readonly Queue<DateTime> _selectionTime = new (new[] {\n            new DateTime(2014, 03, 24, 0, 0, 0),\n            new DateTime(2014, 03, 25, 0, 0, 0),\n            new DateTime(2014, 03, 26, 0, 0, 0),\n            new DateTime(2014, 03, 27, 0, 0, 0),\n            new DateTime(2014, 03, 28, 0, 0, 0),\n            new DateTime(2014, 03, 29, 0, 0, 0)\n        });\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 03, 31);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse<CoarseFundamental>(\"custom-data-universe\", (coarse) =>\n            {\n                Debug($\"Universe selection called: {Time} Count: {coarse.Count()}\");\n\n                var expectedTime = _selectionTime.Dequeue();\n                if (expectedTime != Time)\n                {\n                    throw new RegressionTestException($\"Unexpected selection time {Time} expected {expectedTime}\");\n                }\n                return coarse.OfType<CoarseFundamental>().OrderByDescending(x => x.DollarVolume)\n                    .SelectMany(x => new[] {\n                        x.Symbol,\n                        QuantConnect.Symbol.CreateBase(typeof(CustomData), x.Symbol)})\n                    .Take(20);\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var customData = slice.Get<CustomData>();\n                if (customData.Count > 0)\n                {\n                    foreach (var symbol in _currentUnderlyingSymbols.OrderBy(x => x.ID.Symbol))\n                    {\n                        if (!Securities[symbol].HasData)\n                        {\n                            continue;\n                        }\n                        SetHoldings(symbol, 1m / _currentUnderlyingSymbols.Count);\n\n                        if (!customData.Any(custom => custom.Key.Underlying == symbol))\n                        {\n                            throw new RegressionTestException($\"Custom data was not found for underlying symbol {symbol}\");\n                        }\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionTime.Count != 0)\n            {\n                throw new RegressionTestException($\"Unexpected selection times, missing {_selectionTime.Count}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach(var security in changes.AddedSecurities.Where(sec => sec.Symbol.SecurityType != SecurityType.Base))\n            {\n                _currentUnderlyingSymbols.Add(security.Symbol);\n            }\n            foreach (var security in changes.RemovedSecurities.Where(sec => sec.Symbol.SecurityType != SecurityType.Base))\n            {\n                _currentUnderlyingSymbols.Remove(security.Symbol);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 42622;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-50.796%\"},\n            {\"Drawdown\", \"1.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98457.63\"},\n            {\"Net Profit\", \"-1.542%\"},\n            {\"Sharpe Ratio\", \"-4.343\"},\n            {\"Sortino Ratio\", \"-3.19\"},\n            {\"Probabilistic Sharpe Ratio\", \"4.159%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.804\"},\n            {\"Beta\", \"1.002\"},\n            {\"Annual Standard Deviation\", \"0.1\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-14.419\"},\n            {\"Tracking Error\", \"0.056\"},\n            {\"Treynor Ratio\", \"-0.433\"},\n            {\"Total Fees\", \"$7.86\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOG T1AZ164W5VTX\"},\n            {\"Portfolio Turnover\", \"7.58%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"fd3e6e9f401bc140d6b7cc8f1df8e46a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataUniverseScheduledRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Custom data universe selection regression algorithm asserting it's behavior. Similar to CustomDataUniverseRegressionAlgorithm but with a custom schedule\n    /// </summary>\n    public class CustomDataUniverseScheduledRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _currentUnderlyingSymbols = new();\n        private readonly Queue<DateTime> _selectionTime = new(new[] {\n            new DateTime(2014, 03, 25, 0, 0, 0),\n            new DateTime(2014, 03, 27, 0, 0, 0),\n            new DateTime(2014, 03, 29, 0, 0, 0)\n        });\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 03, 31);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            UniverseSettings.Schedule.On(DateRules.On(_selectionTime.ToArray()));\n            AddUniverse<CoarseFundamental>(\"custom-data-universe\", UniverseSettings, (coarse) =>\n            {\n                Debug($\"Universe selection called: {Time} Count: {coarse.Count()}\");\n\n                var expectedTime = _selectionTime.Dequeue();\n                if (expectedTime != Time)\n                {\n                    throw new RegressionTestException($\"Unexpected selection time {Time} expected {expectedTime}\");\n                }\n                return coarse.OfType<CoarseFundamental>().OrderByDescending(x => x.DollarVolume)\n                    .SelectMany(x => new[] {\n                        x.Symbol,\n                        QuantConnect.Symbol.CreateBase(typeof(CustomData), x.Symbol)})\n                    .Take(20);\n            });\n\n            // This use case is also valid/same because it will use the algorithm settings by default\n            // AddUniverse<CoarseFundamental>(\"custom-data-universe\", (coarse) => {});\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var customData = slice.Get<CustomData>();\n                if (customData.Count > 0)\n                {\n                    foreach (var symbol in _currentUnderlyingSymbols)\n                    {\n                        SetHoldings(symbol, 1m / _currentUnderlyingSymbols.Count);\n\n                        if (!customData.Any(custom => custom.Key.Underlying == symbol))\n                        {\n                            throw new RegressionTestException($\"Custom data was not found for underlying symbol {symbol}\");\n                        }\n                    }\n                }\n            }\n            // equity daily data arrives at 16 pm but custom data is set to arrive at midnight\n            _currentUnderlyingSymbols = slice.Keys.Where(symbol => symbol.SecurityType != SecurityType.Base).ToList();\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionTime.Count != 0)\n            {\n                throw new RegressionTestException($\"Unexpected selection times, missing {_selectionTime.Count}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 21374;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-65.964%\"},\n            {\"Drawdown\", \"3.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97665.47\"},\n            {\"Net Profit\", \"-2.335%\"},\n            {\"Sharpe Ratio\", \"-3.693\"},\n            {\"Sortino Ratio\", \"-2.881\"},\n            {\"Probabilistic Sharpe Ratio\", \"6.625%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-1.175\"},\n            {\"Beta\", \"1.621\"},\n            {\"Annual Standard Deviation\", \"0.156\"},\n            {\"Annual Variance\", \"0.024\"},\n            {\"Information Ratio\", \"-9.977\"},\n            {\"Tracking Error\", \"0.095\"},\n            {\"Treynor Ratio\", \"-0.355\"},\n            {\"Total Fees\", \"$13.86\"},\n            {\"Estimated Strategy Capacity\", \"$510000000.00\"},\n            {\"Lowest Capacity Asset\", \"NB R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"12.76%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4668d7bd05e2db15ff41d4e1aac621ab\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataUsingMapFileRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating use of map files with custom data\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"rename event\" />\n    /// <meta name=\"tag\" content=\"map\" />\n    /// <meta name=\"tag\" content=\"mapping\" />\n    /// <meta name=\"tag\" content=\"map files\" />\n    public class CustomDataUsingMapFileRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private bool _initialMapping;\n        private bool _executionMapping;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 06, 27);\n            SetEndDate(2013, 07, 02);\n\n            var foxa = QuantConnect.Symbol.Create(\"FOXA\", SecurityType.Equity, Market.USA);\n            _symbol = AddData<CustomDataUsingMapping>(foxa).Symbol;\n\n            foreach (var config in SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(_symbol))\n            {\n                if (config.Resolution != Resolution.Minute)\n                {\n                    throw new RegressionTestException(\"Expected resolution to be set to Minute\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Checks to see if the stock has been renamed, and places an order once the symbol has changed\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (slice.SymbolChangedEvents.ContainsKey(_symbol))\n            {\n                var mappingEvent = slice.SymbolChangedEvents.Single(x => x.Key.SecurityType == SecurityType.Base).Value;\n                Log($\"{Time} - Ticker changed from: {mappingEvent.OldSymbol} to {mappingEvent.NewSymbol}\");\n                if (Time.Date == new DateTime(2013, 06, 27))\n                {\n                    // we should Not receive the initial mapping event\n                    if (mappingEvent.NewSymbol != \"NWSA\"\n                        || mappingEvent.OldSymbol != \"FOXA\")\n                    {\n                        throw new RegressionTestException($\"Unexpected mapping event {mappingEvent}\");\n                    }\n                    _initialMapping = true;\n                }\n                else if (Time.Date == new DateTime(2013, 06, 29))\n                {\n                    if (mappingEvent.NewSymbol != \"FOXA\"\n                        || mappingEvent.OldSymbol != \"NWSA\")\n                    {\n                        throw new RegressionTestException($\"Unexpected mapping event {mappingEvent}\");\n                    }\n\n                    _executionMapping = true;\n                    SetHoldings(_symbol, 1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Final step of the algorithm\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_initialMapping)\n            {\n                throw new RegressionTestException(\"The ticker generated the initial rename event\");\n            }\n            if (!_executionMapping)\n            {\n                throw new RegressionTestException(\"The ticker did not rename throughout the course of its life even though it should have\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1667;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-99.907%\"},\n            {\"Drawdown\", \"11.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"89657.2\"},\n            {\"Net Profit\", \"-10.343%\"},\n            {\"Sharpe Ratio\", \"-1.708\"},\n            {\"Sortino Ratio\", \"-1.361\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.009%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.974\"},\n            {\"Beta\", \"-5.612\"},\n            {\"Annual Standard Deviation\", \"0.587\"},\n            {\"Annual Variance\", \"0.345\"},\n            {\"Information Ratio\", \"-1.517\"},\n            {\"Tracking Error\", \"0.664\"},\n            {\"Treynor Ratio\", \"0.179\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"NWSA.CustomDataUsingMapping T3MO1488O0H0\"},\n            {\"Portfolio Turnover\", \"16.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"fe95edf1a3eabc0ac044b85eb833da5a\"}\n        };\n\n        /// <summary>\n        /// Test example custom data showing how to enable the use of mapping.\n        /// Implemented as a wrapper of existing NWSA->FOXA equity\n        /// </summary>\n        private class CustomDataUsingMapping : TradeBar\n        {\n            /// <summary>\n            /// Indicates if there is support for mapping\n            /// </summary>\n            /// <returns>True indicates mapping should be done</returns>\n            public override bool RequiresMapping()\n            {\n                return true;\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return base.GetSource(new SubscriptionDataConfig(config,\n                        typeof(CustomDataUsingMapping),\n                    // create a new symbol as equity so we find the existing data files\n                    Symbol.Create(config.MappedSymbol, SecurityType.Equity, config.Market)),\n                    date,\n                    isLiveMode);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                return ParseEquity(config, line, date);\n            }\n\n            /// <summary>\n            /// Gets the default resolution for this data and security type\n            /// </summary>\n            /// <remarks>This is a method and not a property so that python\n            /// custom data types can override it</remarks>\n            public override Resolution DefaultResolution()\n            {\n                return Resolution.Minute;\n            }\n\n            /// <summary>\n            /// Gets the supported resolution for this data and security type\n            /// </summary>\n            /// <remarks>This is a method and not a property so that python\n            /// custom data types can override it</remarks>\n            public override List<Resolution> SupportedResolutions()\n            {\n                return new List<Resolution> { Resolution.Minute };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataWorksWithDifferentExchangesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert we can have custom data subscriptions with different exchanges\n    /// </summary>\n    public class CustomDataWorksWithDifferentExchangesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _noDataPointsReceived;\n        public override void Initialize()\n        {\n            SetStartDate(2014, 05, 02);\n            SetEndDate(2014, 05, 03);\n\n            var market1 = AddForex(\"EURUSD\", Resolution.Hour, Market.FXCM);\n            var firstCustomSecurity = AddData<ExampleCustomData>(market1.Symbol, Resolution.Hour, TimeZones.Utc, false);\n            if (firstCustomSecurity.Exchange.TimeZone != TimeZones.Utc)\n            {\n                throw new RegressionTestException($\"The time zone of security {firstCustomSecurity} should be {TimeZones.Utc}, but it was {firstCustomSecurity.Exchange.TimeZone}\");\n            }\n\n            var market2 = AddForex(\"EURUSD\", Resolution.Hour, Market.Oanda);\n            var secondCustomSecurity = AddData<ExampleCustomData>(market2.Symbol, Resolution.Hour, TimeZones.Utc, false);\n            if (secondCustomSecurity.Exchange.TimeZone != TimeZones.Utc)\n            {\n                throw new RegressionTestException($\"The time zone of security {secondCustomSecurity} should be {TimeZones.Utc}, but it was {secondCustomSecurity.Exchange.TimeZone}\");\n            }\n            _noDataPointsReceived = true;\n        }\n\n\n        public override void OnData(Slice slice)\n        {\n            _noDataPointsReceived = false;\n            if (slice.Count != ActiveSecurities.Count)\n            {\n                throw new RegressionTestException($\"{ActiveSecurities.Count.ToString().ToCamelCase()} data points were expected, but only {slice.Count} were received\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_noDataPointsReceived)\n            {\n                throw new RegressionTestException($\"No points were received\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 94;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n\n    public class ExampleCustomData : BaseData\n    {\n        private int _hours { get; set; }\n        public decimal Open { get; set; }\n        public decimal High { get; set; }\n        public decimal Low { get; set; }\n        public decimal Close { get; set; }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var source = \"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\";\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile, FileFormat.Csv);\n        }\n\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var csv = line.Split(\",\");\n            var data = new ExampleCustomData()\n            {\n                Symbol = config.Symbol,\n                Time = date.AddHours(_hours),\n                Value = csv[4].ToDecimal(),\n                Open = csv[1].ToDecimal(),\n                High = csv[2].ToDecimal(),\n                Low = csv[3].ToDecimal(),\n                Close = csv[4].ToDecimal()\n            };\n\n            _hours = (_hours + 1) % 22;\n            return data;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataZipFileEntryNamesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing that custom data types can source zip entry name data from remote zip files\n    /// </summary>\n    public class CustomDataZipFileEntryNamesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _customDataSymbol;\n        private bool _receivedCustomData;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 01, 01);\n            SetEndDate(2021, 05, 31);\n\n            _customDataSymbol = AddData<CustomData>(\"CustomData\", Resolution.Minute).Symbol;\n\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var data = slice.Get<CustomData>(_customDataSymbol);\n            if (data != null)\n            {\n                Log($\"{Time}: {data.Symbol} - {data.Time} - {data.FileEntryName}\");\n                _receivedCustomData = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedCustomData)\n            {\n                throw new RegressionTestException(\"Custom data was not received\");\n            }\n        }\n\n        public class CustomData : BaseData\n        {\n            private int _i;\n\n            public string FileEntryName { get; private set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                // Even though the url includes a specific entry name, FileFormat.ZipEntryName indicates that\n                // the entry names should be read, not the content of the given entry\n                return new SubscriptionDataSource(@\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip?some=query&for=testing#csv_file_10.csv\",\n                    SubscriptionTransportMedium.RemoteFile,\n                    FileFormat.ZipEntryName);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                return new CustomData()\n                {\n                    Symbol = config.Symbol,\n                    EndTime = date.Date.AddMinutes(_i++),\n                    FileEntryName = line\n                };\n            }\n\n            public override BaseData Clone()\n            {\n                var clone = base.Clone() as CustomData;\n                clone.FileEntryName = FileEntryName;\n                return clone;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 11;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataZipFileRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that custom data can be sourced from a remote CSV zipped file.\n    /// </summary>\n    public class CustomDataZipFileRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _customDataSymbol;\n        private bool _receivedCustomData;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 01, 01);\n            SetEndDate(2021, 12, 31);\n\n            CustomData.Url = GetCustomDataUrl();\n\n            _customDataSymbol = AddData<CustomData>(\"CustomData\", Resolution.Daily).Symbol;\n\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var data = slice.Get<CustomData>(_customDataSymbol);\n            if (data != null)\n            {\n                Log($\"{Time}: {data.Symbol} - {data.Time} - {data.Value}\");\n                _receivedCustomData = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedCustomData)\n            {\n                throw new RegressionTestException(\"Custom data was not received\");\n            }\n        }\n\n        protected virtual string GetCustomDataUrl()\n        {\n            return @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip?some=query&for=testing\";\n        }\n\n        public class CustomData : BaseData\n        {\n            public static string Url { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(Url);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.ToCsv(2);\n\n                try\n                {\n                    return new CustomData()\n                    {\n                        Symbol = config.Symbol,\n                        EndTime = date.Date.AddMilliseconds(Convert.ToInt32(csv[0], CultureInfo.InvariantCulture)).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone),\n                        Value = Convert.ToDecimal(csv[1], CultureInfo.InvariantCulture),\n                    };\n                }\n                catch\n                {\n                    return null;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 79;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataZipFileSpecificEntryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that custom data can be sourced from a remote CSV zipped file.\n    /// </summary>\n    public class CustomDataZipFileSpecificEntryRegressionAlgorithm: CustomDataZipFileRegressionAlgorithm\n    {\n        protected override string GetCustomDataUrl()\n        {\n            return @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip?some=query&for=testing#csv_file_10.csv\";\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomDataZippedObjectStoreRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Text;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the use of zipped custom data sourced from the object store\n    /// </summary>\n    public class CustomDataZippedObjectStoreRegressionAlgorithm : CustomDataObjectStoreRegressionAlgorithm\n    {\n        protected override string CustomDataKey => \"CustomData/ExampleCustomData.zip\";\n\n        protected override void SaveDataToObjectStore()\n        {\n            var bytes = Encoding.UTF8.GetBytes(CustomData);\n            ObjectStore.SaveBytes(CustomDataKey, Compression.ZipBytes(bytes, \"data\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomFrameworkModelsAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example algorithm defines its own custom coarse/fine fundamental selection model\n    /// combined with the MACD alpha model.\n    /// </summary>\n    public class CustomFrameworkModelsAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            SetUniverseSelection(new CustomFundamentalUniverseSelectionModel());\n            SetAlpha(new MacdAlphaModel(\n                fastPeriod: 10,\n                slowPeriod: 30,\n                signalPeriod: 12,\n                movingAverageType: MovingAverageType.Simple\n            ));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Defines a custom <see cref=\"FundamentalUniverseSelectionModel\"/> that takes the top 100 by\n        /// dollar volume and then the top 20 by earnings yield\n        /// </summary>\n        public class CustomFundamentalUniverseSelectionModel : FundamentalUniverseSelectionModel\n        {\n            public CustomFundamentalUniverseSelectionModel()\n                : base(filterFineData: true)\n            {\n            }\n\n            /// <summary>\n            /// Defines the coarse fundamental selection function.\n            /// </summary>\n            /// <param name=\"algorithm\">The algorithm instance</param>\n            /// <param name=\"coarse\">The coarse fundamental data used to perform filtering</param>\n            /// <returns>An enumerable of symbols passing the filter</returns>\n            public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n            {\n                return coarse\n                    .OrderByDescending(c => c.DollarVolume)\n                    .Select(c => c.Symbol)\n                    .Take(100);\n            }\n\n            /// <summary>\n            /// Defines the fine fundamental selection function.\n            /// </summary>\n            /// <param name=\"algorithm\">The algorithm instance</param>\n            /// <param name=\"fine\">The fine fundamental data used to perform filtering</param>\n            /// <returns>An enumerable of symbols passing the filter</returns>\n            public override IEnumerable<Symbol> SelectFine(QCAlgorithm algorithm, IEnumerable<FineFundamental> fine)\n            {\n                return fine\n                    .OrderByDescending(f => f.ValuationRatios.EarningYield)\n                    .Select(f => f.Symbol)\n                    .Take(20);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomMarginInterestRateModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of using custom margin interest rate model in backtesting.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"custom margin interest rate models\" />\n    public class CustomMarginInterestRateModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        private decimal _cashAfterOrder;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 10, 31);\n\n            var security = AddEquity(\"SPY\", Resolution.Hour);\n            _spy = security.Symbol;\n\n            // set the margin interest rate model\n            security.SetMarginInterestRateModel(new CustomMarginInterestRateModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                _cashAfterOrder = Portfolio.Cash;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var security = Securities[_spy];\n            var marginInterestRateModel = security.MarginInterestRateModel as CustomMarginInterestRateModel;\n\n            if (marginInterestRateModel == null)\n            {\n                throw new RegressionTestException(\"CustomMarginInterestRateModel was not set\");\n            }\n\n            if (marginInterestRateModel.CallCount == 0)\n            {\n                throw new RegressionTestException(\"CustomMarginInterestRateModel was not called\");\n            }\n\n            var expectedCash = _cashAfterOrder * (decimal)Math.Pow(1 + (double)marginInterestRateModel.InterestRate, marginInterestRateModel.CallCount);\n\n            // add a tolerance since using Math.Pow(double, double) given the lack of a decimal overload\n            if (Math.Abs(Portfolio.Cash - expectedCash) > 1e-10m)\n            {\n                throw new RegressionTestException($\"Expected cash {expectedCash} but got {Portfolio.Cash}\");\n            }\n        }\n\n        public class CustomMarginInterestRateModel : IMarginInterestRateModel\n        {\n            public decimal InterestRate { get; } = 0.01m;\n\n            public int CallCount { get; private set; }\n\n            public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n            {\n                var security = marginInterestRateParameters.Security;\n                var positionValue = security.Holdings.GetQuantityValue(security.Holdings.Quantity);\n\n                if (positionValue.Amount > 0)\n                {\n                    positionValue.Cash.AddAmount(InterestRate * positionValue.Cash.Amount);\n                    CallCount++;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 330;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"93.409%\"},\n            {\"Drawdown\", \"2.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"105698.63\"},\n            {\"Net Profit\", \"5.699%\"},\n            {\"Sharpe Ratio\", \"4.701\"},\n            {\"Sortino Ratio\", \"9.153\"},\n            {\"Probabilistic Sharpe Ratio\", \"85.653%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.145\"},\n            {\"Beta\", \"0.998\"},\n            {\"Annual Standard Deviation\", \"0.108\"},\n            {\"Annual Variance\", \"0.012\"},\n            {\"Information Ratio\", \"28.436\"},\n            {\"Tracking Error\", \"0.005\"},\n            {\"Treynor Ratio\", \"0.506\"},\n            {\"Total Fees\", \"$3.43\"},\n            {\"Estimated Strategy Capacity\", \"$150000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.19%\"},\n            {\"Drawdown Recovery\", \"8\"},\n            {\"OrderListHash\", \"c0205e9d3d1bfdee958fecccb36413ec\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomModelsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of using custom fee, slippage, fill, and buying power models for modelling transactions in backtesting.\n    /// QuantConnect allows you to model all orders as deeply and accurately as you need.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"transaction fees and slippage\" />\n    /// <meta name=\"tag\" content=\"custom buying power models\" />\n    /// <meta name=\"tag\" content=\"custom transaction models\" />\n    /// <meta name=\"tag\" content=\"custom slippage models\" />\n    /// <meta name=\"tag\" content=\"custom fee models\" />\n    public class CustomModelsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 10, 31);\n            _security = AddEquity(\"SPY\", Resolution.Hour);\n            _spy = _security.Symbol;\n\n            // set our models\n            _security.SetFeeModel(new CustomFeeModel(this));\n            _security.SetFillModel(new CustomFillModel(this));\n            _security.SetSlippageModel(new CustomSlippageModel(this));\n            _security.SetBuyingPowerModel(new CustomBuyingPowerModel(this));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var openOrders = Transactions.GetOpenOrders(_spy);\n            if (openOrders.Count != 0) return;\n\n            if (Time.Day > 10 && _security.Holdings.Quantity <= 0)\n            {\n                var quantity = CalculateOrderQuantity(_spy, .5m);\n                Log($\"MarketOrder: {quantity}\");\n                MarketOrder(_spy, quantity, asynchronous: true); // async needed for partial fill market orders\n            }\n            else if (Time.Day > 20 && _security.Holdings.Quantity >= 0)\n            {\n                var quantity = CalculateOrderQuantity(_spy, -.5m);\n                Log($\"MarketOrder: {quantity}\");\n                MarketOrder(_spy, quantity, asynchronous: true); // async needed for partial fill market orders\n            }\n        }\n\n        public class CustomFillModel : ImmediateFillModel\n        {\n            private readonly QCAlgorithm _algorithm;\n            private readonly Random _random = new Random(387510346); // seed it for reproducibility\n            private readonly Dictionary<long, decimal> _absoluteRemainingByOrderId = new Dictionary<long, decimal>();\n\n            public CustomFillModel(QCAlgorithm algorithm)\n            {\n                _algorithm = algorithm;\n            }\n\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                // this model randomly fills market orders\n\n                decimal absoluteRemaining;\n                if (!_absoluteRemainingByOrderId.TryGetValue(order.Id, out absoluteRemaining))\n                {\n                    absoluteRemaining = order.AbsoluteQuantity;\n                    _absoluteRemainingByOrderId.Add(order.Id, order.AbsoluteQuantity);\n                }\n\n                var fill = base.MarketFill(asset, order);\n                var absoluteFillQuantity = (int) (Math.Min(absoluteRemaining, _random.Next(0, 2*(int)order.AbsoluteQuantity)));\n                fill.FillQuantity = Math.Sign(order.Quantity) * absoluteFillQuantity;\n\n                if (absoluteRemaining == absoluteFillQuantity)\n                {\n                    fill.Status = OrderStatus.Filled;\n                    _absoluteRemainingByOrderId.Remove(order.Id);\n                }\n                else\n                {\n                    absoluteRemaining = absoluteRemaining - absoluteFillQuantity;\n                    _absoluteRemainingByOrderId[order.Id] = absoluteRemaining;\n                    fill.Status = OrderStatus.PartiallyFilled;\n                }\n\n                _algorithm.Log($\"CustomFillModel: {fill}\");\n\n                return fill;\n            }\n        }\n\n        public class CustomFeeModel : FeeModel\n        {\n            private readonly QCAlgorithm _algorithm;\n\n            public CustomFeeModel(QCAlgorithm algorithm)\n            {\n                _algorithm = algorithm;\n            }\n\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                // custom fee math\n                var fee = Math.Max(\n                    1m,\n                    parameters.Security.Price*parameters.Order.AbsoluteQuantity*0.00001m);\n\n                _algorithm.Log($\"CustomFeeModel: {fee}\");\n                return new OrderFee(new CashAmount(fee, \"USD\"));\n            }\n        }\n\n        public class CustomSlippageModel : ISlippageModel\n        {\n            private readonly QCAlgorithm _algorithm;\n\n            public CustomSlippageModel(QCAlgorithm algorithm)\n            {\n                _algorithm = algorithm;\n            }\n\n            public decimal GetSlippageApproximation(Security asset, Order order)\n            {\n                // custom slippage math\n                var slippage = asset.Price*0.0001m*(decimal) Math.Log10(2*(double) order.AbsoluteQuantity);\n\n                _algorithm.Log($\"CustomSlippageModel: {slippage}\");\n                return slippage;\n            }\n        }\n\n        public class CustomBuyingPowerModel : BuyingPowerModel\n        {\n            private readonly QCAlgorithm _algorithm;\n\n            public CustomBuyingPowerModel(QCAlgorithm algorithm)\n            {\n                _algorithm = algorithm;\n            }\n\n            public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n                HasSufficientBuyingPowerForOrderParameters parameters)\n            {\n                // custom behavior: this model will assume that there is always enough buying power\n                var hasSufficientBuyingPowerForOrderResult = new HasSufficientBuyingPowerForOrderResult(true);\n                _algorithm.Log($\"CustomBuyingPowerModel: {hasSufficientBuyingPowerForOrderResult.IsSufficient}\");\n\n                return hasSufficientBuyingPowerForOrderResult;\n            }\n        }\n\n        /// <summary>\n        /// The simple fill model shows how to implement a simpler version of \n        /// the most popular order fills: Market, Stop Market and Limit\n        /// </summary>\n        public class SimpleCustomFillModel : FillModel\n        {\n            private static OrderEvent CreateOrderEvent(Security asset, Order order)\n            {\n                var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n                return new OrderEvent(order, utcTime, OrderFee.Zero);\n            }\n\n            private static OrderEvent SetOrderEventToFilled(OrderEvent fill, decimal fillPrice, decimal fillQuantity)\n            {\n                fill.Status = OrderStatus.Filled;\n                fill.FillQuantity = fillQuantity;\n                fill.FillPrice = fillPrice;\n                return fill;\n            }\n\n            private static TradeBar GetTradeBar(Security asset, OrderDirection orderDirection)\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null) return tradeBar;\n                \n                // Tick-resolution data doesn't have TradeBar, use the asset price\n                var price = asset.Price;\n                return new TradeBar(asset.LocalTime, asset.Symbol, price, price, price, price, 0);\n            }\n\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                var fill = CreateOrderEvent(asset, order);\n                if (order.Status == OrderStatus.Canceled) return fill;\n\n                return SetOrderEventToFilled(fill,\n                    order.Direction == OrderDirection.Buy\n                        ? asset.Cache.AskPrice\n                        : asset.Cache.BidPrice,\n                    order.Quantity);\n            }\n\n            public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n            {\n                var fill = CreateOrderEvent(asset, order);\n                if (order.Status == OrderStatus.Canceled) return fill;\n\n                var stopPrice = order.StopPrice;\n                var tradeBar = GetTradeBar(asset, order.Direction);\n                \n                return order.Direction switch\n                {\n                    OrderDirection.Buy => tradeBar.Low < stopPrice\n                        ? SetOrderEventToFilled(fill, stopPrice, order.Quantity)\n                        : fill,\n                    OrderDirection.Sell => tradeBar.High > stopPrice\n                        ? SetOrderEventToFilled(fill, stopPrice, order.Quantity)\n                        : fill,\n                    _ => fill\n                };\n            }\n\n            public override OrderEvent LimitFill(Security asset, LimitOrder order)\n            {\n                var fill = CreateOrderEvent(asset, order);\n                if (order.Status == OrderStatus.Canceled) return fill;\n\n                var limitPrice = order.LimitPrice;\n                var tradeBar = GetTradeBar(asset, order.Direction);\n\n                return order.Direction switch\n                {\n                    OrderDirection.Buy => tradeBar.High > limitPrice\n                        ? SetOrderEventToFilled(fill, limitPrice, order.Quantity)\n                        : fill,\n                    OrderDirection.Sell => tradeBar.Low < limitPrice\n                        ? SetOrderEventToFilled(fill, limitPrice, order.Quantity)\n                        : fill,\n                    _ => fill\n                };\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 330;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"63\"},\n            {\"Average Win\", \"0.11%\"},\n            {\"Average Loss\", \"-0.06%\"},\n            {\"Compounding Annual Return\", \"-7.236%\"},\n            {\"Drawdown\", \"2.400%\"},\n            {\"Expectancy\", \"-0.187\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99370.95\"},\n            {\"Net Profit\", \"-0.629%\"},\n            {\"Sharpe Ratio\", \"-1.47\"},\n            {\"Sortino Ratio\", \"-2.086\"},\n            {\"Probabilistic Sharpe Ratio\", \"21.874%\"},\n            {\"Loss Rate\", \"70%\"},\n            {\"Win Rate\", \"30%\"},\n            {\"Profit-Loss Ratio\", \"1.73\"},\n            {\"Alpha\", \"-0.102\"},\n            {\"Beta\", \"0.122\"},\n            {\"Annual Standard Deviation\", \"0.04\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-4.126\"},\n            {\"Tracking Error\", \"0.102\"},\n            {\"Treynor Ratio\", \"-0.479\"},\n            {\"Total Fees\", \"$62.25\"},\n            {\"Estimated Strategy Capacity\", \"$52000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"197.95%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"709bbf9af9ec6b43a10617dc192a6a5b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomOptionAssignmentRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting we can specify a custom option assignment\n    /// </summary>\n    public class CustomOptionAssignmentRegressionAlgorithm : OptionAssignmentRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetSecurityInitializer((security) =>\n            {\n                var option = security as Option;\n                // we have to be 10% in the money to get assigned\n                option?.SetOptionAssignmentModel(new CustomOptionAssignmentModel(0.1m));\n            });\n\n            base.Initialize();\n        }\n\n        private class CustomOptionAssignmentModel : DefaultOptionAssignmentModel\n        {\n            public CustomOptionAssignmentModel(decimal requiredInTheMoneyPercent) : base (requiredInTheMoneyPercent)\n            {\n            }\n            public override OptionAssignmentResult GetAssignment(OptionAssignmentParameters parameters)\n            {\n                var result = base.GetAssignment(parameters);\n                result.Tag = \"Custom Option Assignment\";\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"9.48%\"},\n            {\"Average Loss\", \"-16.73%\"},\n            {\"Compounding Annual Return\", \"-25.790%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"-0.478\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99538\"},\n            {\"Net Profit\", \"-0.462%\"},\n            {\"Sharpe Ratio\", \"3.755\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.713%\"},\n            {\"Loss Rate\", \"67%\"},\n            {\"Win Rate\", \"33%\"},\n            {\"Profit-Loss Ratio\", \"0.57\"},\n            {\"Alpha\", \"-0.008\"},\n            {\"Beta\", \"-0.096\"},\n            {\"Annual Standard Deviation\", \"0.003\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"10.577\"},\n            {\"Tracking Error\", \"0.019\"},\n            {\"Treynor Ratio\", \"-0.115\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$4800000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ20WLZZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"26.72%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"20f33e143b62ee896aa56f85dd2aa2e8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomOptionExerciseModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Orders.OptionExercise;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting we can specify a custom option exercise model\n    /// </summary>\n    public class CustomOptionExerciseModelRegressionAlgorithm : OptionAssignmentRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetSecurityInitializer((security) =>\n            {\n                var option = security as Option;\n                option?.SetOptionExerciseModel(new CustomOptionExerciseModel());\n            });\n\n            base.Initialize();\n        }\n\n        private class CustomOptionExerciseModel : DefaultExerciseModel\n        {\n            public override IEnumerable<OrderEvent> OptionExercise(Option option, OptionExerciseOrder order)\n            {\n                yield return new OrderEvent(order.Id,\n                    option.Symbol,\n                    option.LocalTime.ConvertToUtc(option.Exchange.TimeZone),\n                    OrderStatus.Filled,\n                    Extensions.GetOrderDirection(order.Quantity),\n                    0.0m,\n                    order.Quantity,\n                    OrderFee.Zero,\n                    \"Tag\")\n                {\n                    IsAssignment = false\n                };\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"32\"},\n            {\"Average Win\", \"6.14%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"26116903817855100000000000000%\"},\n            {\"Drawdown\", \"0.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"257114\"},\n            {\"Net Profit\", \"157.114%\"},\n            {\"Sharpe Ratio\", \"107.743\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.713%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"60.088\"},\n            {\"Beta\", \"-19.374\"},\n            {\"Annual Standard Deviation\", \"0.593\"},\n            {\"Annual Variance\", \"0.351\"},\n            {\"Information Ratio\", \"106.234\"},\n            {\"Tracking Error\", \"0.603\"},\n            {\"Treynor Ratio\", \"-3.295\"},\n            {\"Total Fees\", \"$16.00\"},\n            {\"Estimated Strategy Capacity\", \"$87000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ20WLZZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"10.93%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"19b8f2a8081c3cfa8f6bc02b5d045765\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/CustomOptionPriceModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test the creation and usage of a custom option price model\n    /// </summary>\n    public class CustomOptionPriceModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n        private CustomOptionPriceModel _optionPriceModel;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n            _optionPriceModel = new CustomOptionPriceModel();\n            option.SetPriceModel(_optionPriceModel);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                var underlyingPrice = chain.Underlying.Price;\n                var atmContract = chain\n                    .OrderByDescending(x => x.Expiry)\n                    .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                    .ThenByDescending(x => x.Right)\n                    .FirstOrDefault();\n\n                if (atmContract != null && atmContract.TheoreticalPrice > 0)\n                {\n                    MarketOrder(atmContract.Symbol, 1);\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_optionPriceModel.EvaluationCount == 0)\n            {\n                throw new RegressionTestException(\"CustomOptionPriceModel.Evaluate() was never called\");\n            }\n        }\n\n        private class CustomOptionPriceModel : IOptionPriceModel\n        {\n            public int EvaluationCount { get; private set; }\n            public OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters)\n            {\n                EvaluationCount++;\n                var contract = parameters.Contract;\n                var underlying = contract.UnderlyingLastPrice;\n                var strike = contract.Strike;\n                var greeks = new Greeks(0.5m, 0.2m, 0.15m, 0.05m, 0.1m, 2.0m);\n\n                decimal intrinsicValue;\n                if (contract.Right == OptionRight.Call)\n                {\n                    intrinsicValue = Math.Max(0, underlying - strike);\n                }\n                else\n                {\n                    intrinsicValue = Math.Max(0, strike - underlying);\n                    // Delta and Rho are negative for a put\n                    greeks.Delta *= -1;\n                    greeks.Rho *= -1;\n                }\n                var theoreticalPrice = intrinsicValue + 1.0m;\n                var impliedVolatility = 0.2m;\n\n                return new OptionPriceModelResult(theoreticalPrice, impliedVolatility, greeks);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99799\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"5.49%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1925127010d4a935c1efe4bce0375c15\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomPartialFillModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm that implements a fill model with partial fills\n    /// </summary>\n    /// <meta name=\"tag\" content=\"transaction fees and slippage\" />\n    /// <meta name=\"tag\" content=\"custom fill models\" />\n    public class CustomPartialFillModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private SecurityHolding _holdings;\n\n        public override void Initialize()\n        {\n            SetStartDate(2019, 1, 1);\n            SetEndDate(2019, 3, 1);\n\n            var equity = AddEquity(\"SPY\", Resolution.Hour);\n            _spy = equity.Symbol;\n            _holdings = equity.Holdings;\n\n            // Set the fill model\n            equity.SetFillModel(new CustomPartialFillModel(this));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var openOrders = Transactions.GetOpenOrders(_spy);\n            if (openOrders.Count != 0) return;\n\n            if (Time.Day > 10 && _holdings.Quantity <= 0)\n            {\n                MarketOrder(_spy, 105, true);\n            }\n            else if (Time.Day > 20 && _holdings.Quantity >= 0)\n            {\n                MarketOrder(_spy, -100, true);\n            }\n        }\n\n        /// <summary>\n        /// Implements a custom fill model that inherit from FillModel. Override the MarketFill method to simulate partially fill orders\n        /// </summary>\n        internal class CustomPartialFillModel : FillModel\n        {\n            private readonly QCAlgorithm _algorithm;\n            private readonly Dictionary<int, decimal> _absoluteRemainingByOrderId;\n\n            public CustomPartialFillModel(QCAlgorithm algorithm)\n                : base()\n            {\n                _algorithm = algorithm;\n                _absoluteRemainingByOrderId = new Dictionary<int, decimal>();\n            }\n\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                decimal absoluteRemaining;\n                if (!_absoluteRemainingByOrderId.TryGetValue(order.Id, out absoluteRemaining))\n                {\n                    absoluteRemaining = order.AbsoluteQuantity;\n                }\n\n                // Create the object\n                var fill = base.MarketFill(asset, order);\n\n                // Set the fill amount\n                fill.FillQuantity = Math.Sign(order.Quantity) * 10m;\n                if (Math.Min(Math.Abs(fill.FillQuantity), absoluteRemaining) == absoluteRemaining)\n                {\n                    fill.FillQuantity = Math.Sign(order.Quantity) * absoluteRemaining;\n                    fill.Status = OrderStatus.Filled;\n                    _absoluteRemainingByOrderId.Remove(order.Id);\n                }\n                else\n                {\n                    fill.Status = OrderStatus.PartiallyFilled;\n                    _absoluteRemainingByOrderId[order.Id] = absoluteRemaining - Math.Abs(fill.FillQuantity);\n                    var price = fill.FillPrice;\n                    //_algorithm.Debug($\"{_algorithm.Time} - Partial Fill - Remaining {_absoluteRemainingByOrderId[order.Id]} Price - {price}\");\n                }\n                return fill;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"24\"},\n            {\"Average Win\", \"0.02%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"3.413%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"0.426\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100550.15\"},\n            {\"Net Profit\", \"0.550%\"},\n            {\"Sharpe Ratio\", \"-0.416\"},\n            {\"Sortino Ratio\", \"-0.435\"},\n            {\"Probabilistic Sharpe Ratio\", \"61.217%\"},\n            {\"Loss Rate\", \"44%\"},\n            {\"Win Rate\", \"56%\"},\n            {\"Profit-Loss Ratio\", \"1.52\"},\n            {\"Alpha\", \"-0.037\"},\n            {\"Beta\", \"0.05\"},\n            {\"Annual Standard Deviation\", \"0.015\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.465\"},\n            {\"Tracking Error\", \"0.114\"},\n            {\"Treynor Ratio\", \"-0.123\"},\n            {\"Total Fees\", \"$24.00\"},\n            {\"Estimated Strategy Capacity\", \"$89000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"10.59%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"aa14b4a6f4eb5907cb188ed462c14389\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomPortfolioOptimizerRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting we can specify a custom portfolio optimizer with a MeanVarianceOptimizationPortfolioConstructionModel\n    /// </summary>\n    public class CustomPortfolioOptimizerRegressionAlgorithm : MeanVarianceOptimizationFrameworkAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetPortfolioConstruction(new MeanVarianceOptimizationPortfolioConstructionModel(optimizer: new CustomPortfolioOptimizer()));\n        }\n\n        private class CustomPortfolioOptimizer : IPortfolioOptimizer\n        {\n            public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n            {\n                var result = new double[historicalReturns.GetLength(0)];\n                Array.Fill(result, 0.5);\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"13\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.14%\"},\n            {\"Compounding Annual Return\", \"773.203%\"},\n            {\"Drawdown\", \"3.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103012.99\"},\n            {\"Net Profit\", \"3.013%\"},\n            {\"Sharpe Ratio\", \"12.422\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"62.198%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.949\"},\n            {\"Beta\", \"2.094\"},\n            {\"Annual Standard Deviation\", \"0.49\"},\n            {\"Annual Variance\", \"0.24\"},\n            {\"Information Ratio\", \"14.343\"},\n            {\"Tracking Error\", \"0.287\"},\n            {\"Treynor Ratio\", \"2.906\"},\n            {\"Total Fees\", \"$39.73\"},\n            {\"Estimated Strategy Capacity\", \"$3100000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"52.21%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"a18ad75219f800ac4435bfa4f750a67d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomSecurityDataFilterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting we can specify a custom security data filter\n    /// </summary>\n    public class CustomSecurityDataFilterRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _dataPoints;\n\n        public override void Initialize()\n        {\n            SetCash(2500000);\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var security = AddSecurity(SecurityType.Equity, \"SPY\");\n            security.SetDataFilter(new CustomDataFilter());\n            _dataPoints = 0;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            _dataPoints++;\n            SetHoldings(\"SPY\", 0.2);\n            if (_dataPoints > 5)\n            {\n                throw new RegressionTestException($\"There should not be more than 5 data points, but there were {_dataPoints}\");\n            }\n        }\n\n        private class CustomDataFilter : ISecurityDataFilter\n        {\n            public bool Filter(Security vehicle, BaseData data)\n            {\n                // Skip data after 9:35am\n                if (data.Time >= new DateTime(2013, 10, 7, 9, 35, 0, 0))\n                {\n                    return false;\n                }\n                else\n                {\n                    return true;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 25;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"2500000\"},\n            {\"End Equity\", \"2500131.71\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$17.23\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.95%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3bf23b02f24b7eb6177929ec31fdb63b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomSecurityInitializerAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm shows how to set a custom security initializer.\n    /// A security initializer is run immediately after a new security object\n    /// has been created and can be used to security models and other settings,\n    /// such as data normalization mode\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class CustomSecurityInitializerAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            // set our initializer to our custom type\n            SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n            var funcSecuritySeeder = new FuncSecuritySeeder(CustomSeedFunction);\n            SetSecurityInitializer(new CustomSecurityInitializer(BrokerageModel, funcSecuritySeeder, DataNormalizationMode.Raw));\n\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 11, 01);\n\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Hour);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        private BaseData CustomSeedFunction(Security security)\n        {\n            var resolution = Resolution.Hour;\n            var history = History(new[] { security.Symbol }, 1, resolution);\n\n            if (history.Any() && history.First().Values.Any())\n            {\n                return history.First().Values.First();\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Our custom initializer that will set the data normalization mode.\n        /// We sub-class the <see cref=\"BrokerageModelSecurityInitializer\"/>\n        /// so we can also take advantage of the default model/leverage setting\n        /// behaviors\n        /// </summary>\n        class CustomSecurityInitializer : BrokerageModelSecurityInitializer\n        {\n            private readonly DataNormalizationMode _dataNormalizationMode;\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"CustomSecurityInitializer\"/> class\n            /// with the specified normalization mode\n            /// </summary>\n            /// <param name=\"brokerageModel\">The brokerage model used to get fill/fee/slippage/settlement models</param>\n            /// <param name=\"securitySeeder\">The security seeder to be used</param>\n            /// <param name=\"dataNormalizationMode\">The desired data normalization mode</param>\n            public CustomSecurityInitializer(IBrokerageModel brokerageModel, ISecuritySeeder securitySeeder, DataNormalizationMode dataNormalizationMode)\n                : base(brokerageModel, securitySeeder)\n            {\n                _dataNormalizationMode = dataNormalizationMode;\n            }\n\n            /// <summary>\n            /// Initializes the specified security by setting up the models\n            /// </summary>\n            /// <param name=\"security\">The security to be initialized</param>\n            public override void Initialize(Security security)\n            {\n                // first call the default implementation\n                base.Initialize(security);\n\n                // now apply our data normalization mode\n                security.SetDataNormalizationMode(_dataNormalizationMode);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomShortableProviderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting we can specify a custom Shortable Provider\n    /// </summary>\n    public class CustomShortableProviderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _spy;\n        private OrderTicket _orderId;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 4);\n            SetEndDate(2013, 10, 6);\n            SetCash(10000000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Daily);\n            _spy.SetShortableProvider(new CustomSPYShortableProvider());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var spyShortableQuantity = _spy.ShortableProvider.ShortableQuantity(_spy.Symbol, Time);\n            if (spyShortableQuantity > 1000)\n            {\n                _orderId = Sell(\"SPY\", (int)spyShortableQuantity);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var transactions = Transactions.OrdersCount;\n            if (transactions != 1)\n            {\n                throw new RegressionTestException($\"Algorithm should have just 1 order, but was {transactions}\");\n            }\n            var orderQuantity = Transactions.GetOrderById(_orderId).Quantity;\n            if (orderQuantity != -1001)\n            {\n                throw new RegressionTestException($\"Quantity of order {_orderId} should be -1001, but was {orderQuantity}\");\n            }\n            var feeRate = _spy.ShortableProvider.FeeRate(_spy.Symbol, Time);\n            if (feeRate != 0.0025m)\n            {\n                throw new RegressionTestException($\"Fee rate should be 0.0025, but was {feeRate}\");\n            }\n            var rebateRate = _spy.ShortableProvider.RebateRate(_spy.Symbol, Time);\n            if (rebateRate != 0.0507m)\n            {\n                throw new RegressionTestException($\"Fee rate should be 0.0507, but was {rebateRate}\");\n            }\n        }\n\n        private class CustomSPYShortableProvider : IShortableProvider\n        {\n            public decimal FeeRate(Symbol symbol, DateTime localTime) => 0.0025m;\n\n            public decimal RebateRate(Symbol symbol, DateTime localTime) => 0.0507m;\n\n            public long? ShortableQuantity(Symbol symbol, DateTime localTime)\n            {\n                if (localTime < new DateTime(2013, 10, 4, 16, 0, 0))\n                {\n                    return 10;\n                }\n                else\n                {\n                    return 1001;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 16;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"10000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"22bda6f4ef08246dbab1a43f97de6b68\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomSignalExportDemonstrationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Api;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Net.Http.Json;\nusing System.Text;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm sends a list of portfolio targets to custom endpoint\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    public class CustomSignalExportDemonstrationAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialize the date and add all equity symbols present\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            /// Our custom signal export accepts all asset types\n            AddEquity(\"SPY\", Resolution.Second);\n            AddCrypto(\"BTCUSD\", Resolution.Second);\n            AddForex(\"EURUSD\", Resolution.Second);\n            AddFutureContract(QuantConnect.Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2023, 12, 15), null));\n            AddOptionContract(QuantConnect.Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 130, new DateTime(2023, 9, 1)));\n            \n            // Set CustomSignalExport signal export provider.\n            SignalExport.AddSignalExportProvider(new CustomSignalExport());\n        }\n\n        /// <summary>\n        /// Buy and hold EURUSD and SPY\n        /// </summary>\n        /// <param name=\"slice\"></param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var ticker in new[] { \"SPY\", \"EURUSD\", \"BTCUSD\" })\n            {\n                if (!Portfolio[ticker].Invested && Securities[ticker].HasData)\n                {\n                    SetHoldings(ticker, 0.5m);\n                }\n            }\n        }\n    }\n\n    internal class CustomSignalExport : ISignalExportTarget\n    {\n        private readonly Uri _requestUri = new (\"http://localhost:5000/\");\n        private readonly HttpClient _httpClient = new();\n\n        public bool Send(SignalExportTargetParameters parameters)\n        {\n            object SimplePayload(PortfolioTarget target)\n            {\n                var newTarget = PortfolioTarget.Percent(parameters.Algorithm, target.Symbol, target.Quantity);\n                return new { symbol = newTarget.Symbol.Value, quantity = newTarget.Quantity };\n            };\n\n            var message = JsonConvert.SerializeObject(parameters.Targets.Select(SimplePayload));\n            using var httpMessage = new StringContent(message, Encoding.UTF8, \"application/json\");\n            using HttpResponseMessage response = _httpClient.PostAsync(_requestUri, httpMessage).Result;\n            var result = response.Content.ReadFromJsonAsync<RestResponse>().Result;\n            parameters.Algorithm.Log($\"Send #{parameters.Targets.Count} targets. Success: {result.Success}\");\n            return result.Success;\n        }\n\n        public void Dispose() => _httpClient.Dispose();\n    }\n}\n\n/*\n# To test the algorithm, you can create a simple Python Flask application (app.py) and run flask\n# $ flask --app app run \n\n# app.py:\nfrom flask import Flask, request, jsonify\nfrom json import loads\napp = Flask(__name__)\n@app.post('/')\ndef handle_positions():\n    result = loads(request.data)\n    print(result)\n    return jsonify({'success': True,'message': f'{len(result)} positions received'})\nif __name__ == '__main__':\n    app.run(debug=True)\n*/\n"
  },
  {
    "path": "Algorithm.CSharp/CustomUniverseImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Assert that custom universe selection happens right away after algorithm starts\n    /// </summary>\n    public class CustomUniverseImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private static readonly  List<Symbol> ExpectedSymbols = new List<Symbol>()\n        {\n            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n            QuantConnect.Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA),\n            QuantConnect.Symbol.Create(\"APPL\", SecurityType.Equity, Market.USA)\n        };\n\n        private bool _selected;\n        private bool _securitiesChanged;\n\n        private bool _firstOnData = true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverse(SecurityType.Equity,\n                \"my-custom-universe\",\n                Resolution.Daily,\n                Market.USA,\n                UniverseSettings,\n                time =>\n                {\n                    _selected = true;\n                    return new[] { \"SPY\", \"GOOG\", \"APPL\" };\n                });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_firstOnData)\n            {\n                if (!_selected)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away. \" +\n                        \"The first OnData call should have had happened after the universe selection\");\n                }\n\n                _firstOnData = false;\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (!_selected)\n            {\n                throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n            }\n\n            if (!_securitiesChanged)\n            {\n                // Selection should be happening right on algorithm start\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n                }\n\n                if (changes.AddedSecurities.Count != ExpectedSymbols.Count)\n                {\n                    throw new RegressionTestException($\"Expected {ExpectedSymbols.Count} stocks to be added to the algorithm, \" +\n                        $\"but found {changes.AddedSecurities.Count}\");\n                }\n\n                if (!ExpectedSymbols.All(x => changes.AddedSecurities.Any(security => security.Symbol == x)))\n                {\n                    throw new RegressionTestException(\"Expected symbols were not added to the algorithm\");\n                }\n\n                _securitiesChanged = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_firstOnData || !_selected || !_securitiesChanged)\n            {\n                throw new RegressionTestException(\"Expected events didn't happen\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 52;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomUniverseSelectionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm showing how to implement a custom universe selection model and asserting it's behavior\n    /// </summary>\n    public class CustomUniverseSelectionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 3, 24);\n            SetEndDate(2014, 4, 7);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            SetUniverseSelection(new CustomUniverseSelectionModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach (var kvp in ActiveSecurities)\n                {\n                    SetHoldings(kvp.Key, 0.1);\n                }\n            }\n        }\n\n        private class CustomUniverseSelectionModel : FundamentalUniverseSelectionModel\n        {\n            private bool _selected;\n            public CustomUniverseSelectionModel(): base()\n            {\n            }\n            public override IEnumerable<Symbol> Select(QCAlgorithm algorithm, IEnumerable<Fundamental> fundamental)\n            {\n                if (!_selected)\n                {\n                    _selected = true;\n                    return new[] { QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA) };\n                }\n                return Data.UniverseSelection.Universe.Unchanged;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78062;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-7.765%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99668.37\"},\n            {\"Net Profit\", \"-0.332%\"},\n            {\"Sharpe Ratio\", \"-5.972\"},\n            {\"Sortino Ratio\", \"-7.125\"},\n            {\"Probabilistic Sharpe Ratio\", \"5.408%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.055\"},\n            {\"Beta\", \"0.1\"},\n            {\"Annual Standard Deviation\", \"0.011\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0.413\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"-0.653\"},\n            {\"Total Fees\", \"$2.89\"},\n            {\"Estimated Strategy Capacity\", \"$2000000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.67%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6198706fef1ce2a60e8f16e7ab1485c1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm that verifies that securities added through\n    /// <see cref=\"QCAlgorithm.AddEquity\"/> API and universe selection\n    /// both start sending data at the same time\n    /// </summary>\n    public class CustomUniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse(SecurityType.Equity,\n                \"SecondUniverse\",\n                Resolution.Daily,\n                Market.USA,\n                UniverseSettings,\n                time => new[] { \"SPY\" });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected data count: {slice.Count}\");\n            }\n            if (ActiveSecurities.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected ActiveSecurities count: {ActiveSecurities.Count}\");\n            }\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(Securities.Keys.First(symbol => symbol.Value == \"SPY\"), 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 58;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"272.157%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101694.38\"},\n            {\"Net Profit\", \"1.694%\"},\n            {\"Sharpe Ratio\", \"8.637\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.159%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.053\"},\n            {\"Beta\", \"1.003\"},\n            {\"Annual Standard Deviation\", \"0.223\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-35.82\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.922\"},\n            {\"Total Fees\", \"$3.45\"},\n            {\"Estimated Strategy Capacity\", \"$1300000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.19%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"ec0cf7d19c005d7d23452f96761ad014\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomUniverseWithBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm with a custom universe and benchmark, both using the same security.\n    /// </summary>\n    public class CustomUniverseWithBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int ExpectedLeverage = 2;\n        private Symbol _spy;\n        private decimal _previousBenchmarkValue;\n        private DateTime _previousTime;\n        private decimal _previousSecurityValue;\n        private bool _universeSelected;\n        private bool _onDataWasCalled;\n        private int _benchmarkPriceDidNotChange;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 4);\n            SetEndDate(2013, 10, 11);\n\n            // Hour resolution\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            // Minute resolution\n            AddUniverse(\"my-universe\", x =>\n                {\n                    if(x.Day % 2 == 0)\n                    {\n                        _universeSelected = true;\n                        return new List<string> {\"SPY\"};\n                    }\n                    _universeSelected = false;\n                    return Enumerable.Empty<string>();\n                }\n            );\n\n            // internal daily resolution\n            SetBenchmark(\"SPY\");\n\n            Symbol symbol;\n            if (!SymbolCache.TryGetSymbol(\"SPY\", out symbol)\n                || !ReferenceEquals(_spy, symbol))\n            {\n                throw new RegressionTestException(\"We expected 'SPY' to be added to the Symbol cache,\" +\n                                    \" since the algorithm is also using it\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var security = Securities[_spy];\n            _onDataWasCalled = true;\n\n            var bar = slice.Bars.Values.Single();\n            if (_universeSelected)\n            {\n                if (bar.IsFillForward\n                    || bar.Period != TimeSpan.FromMinutes(1))\n                {\n                    // bar should always be the Minute resolution one here\n                    throw new RegressionTestException(\"Unexpected Bar error\");\n                }\n                if (_previousTime.Date == slice.Time.Date\n                    && (slice.Time - _previousTime) != TimeSpan.FromMinutes(1))\n                {\n                    throw new RegressionTestException(\"For the same date expected data updates every 1 minute\");\n                }\n            }\n            else\n            {\n                if (slice.Time.Minute == 0\n                    && _previousSecurityValue == security.Price)\n                {\n                    throw new RegressionTestException($\"Security Price error. Price should change every new hour\");\n                }\n                if (slice.Time.Minute != 0\n                    && _previousSecurityValue != security.Price\n                    && security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Security Price error. Price should not change every minute\");\n                }\n            }\n            _previousSecurityValue = security.Price;\n\n            // assert benchmark updates only on date change\n            var currentValue = Benchmark.Evaluate(slice.Time);\n            if (_previousTime.Hour == slice.Time.Hour)\n            {\n                if (currentValue != _previousBenchmarkValue)\n                {\n                    throw new RegressionTestException($\"Benchmark value error - expected: {_previousBenchmarkValue} {_previousTime}, actual: {currentValue} {slice.Time}. \" +\n                                        \"Benchmark value should only change when there is a change in hours\");\n                }\n            }\n            else\n            {\n                if (slice.Time.Minute == 0)\n                {\n                    if (currentValue == _previousBenchmarkValue)\n                    {\n                        _benchmarkPriceDidNotChange++;\n                        // there are two consecutive equal data points so we give it some room\n                        if (_benchmarkPriceDidNotChange > 1)\n                        {\n                            throw new RegressionTestException($\"Benchmark value error - expected a new value, current {currentValue} {slice.Time}\" +\n                                                \"Benchmark value should change when there is a change in hours\");\n                        }\n                    }\n                    else\n                    {\n                        _benchmarkPriceDidNotChange = 0;\n                    }\n                }\n            }\n            _previousBenchmarkValue = currentValue;\n            _previousTime = slice.Time;\n\n            // assert algorithm security is the correct one - not the internal one\n            if (security.Leverage != ExpectedLeverage)\n            {\n                throw new RegressionTestException($\"Leverage error - expected: {ExpectedLeverage}, actual: {security.Leverage}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_onDataWasCalled)\n            {\n                throw new RegressionTestException(\"OnData was not called\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3500;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.094\"},\n            {\"Tracking Error\", \"0.175\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomVolatilityModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example of custom volatility model\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"reality modelling\" />\n    public class CustomVolatilityModelAlgorithm : QCAlgorithm\n    {\n        private Security _equity;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);   //Set Start Date\n            SetEndDate(2015, 7, 15);     //Set End Date\n            SetCash(100000);           //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            _equity = AddEquity(\"SPY\", Resolution.Daily);\n            _equity.SetVolatilityModel(new CustomVolatilityModel(10));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !(_equity.VolatilityModel.Volatility > 0))\n                SetHoldings(\"SPY\", 1);\n        }\n    }\n\n    public class CustomVolatilityModel : IVolatilityModel\n    {\n        private DateTime _lastUpdate = DateTime.MinValue;\n        private decimal _lastPrice = 0m;\n        private bool _needsUpdate = false;\n        private TimeSpan _periodSpan = TimeSpan.FromDays(1);\n        private RollingWindow<decimal> _window;\n\n        // Volatility is a mandatory field\n        public decimal Volatility { get; set; } = 0m;\n        public CustomVolatilityModel(int periods)\n        {\n            _window = new RollingWindow<decimal>(periods);\n        }\n\n        // Updates this model using the new price information in the specified security instance\n        // Update is a mandatory method\n        public void Update(Security security, BaseData data)\n        {\n            var timeSinceLastUpdate = data.EndTime - _lastUpdate;\n            if (timeSinceLastUpdate >= _periodSpan && data.Price > 0m)\n            {\n                if (_lastPrice > 0)\n                {\n                    _window.Add(data.Price / _lastPrice - 1.0m);\n                    _needsUpdate = _window.IsReady;\n                }\n\n                _lastUpdate = data.EndTime;\n                _lastPrice = data.Price;\n            }\n\n            if (_window.Count < 2)\n            {\n                Volatility = 0;\n                return;\n            }\n\n            if (_needsUpdate)\n            {\n                _needsUpdate = false;\n                var mean = _window.Average();\n                var std = Math.Sqrt((double)_window.Sum(x => (x - mean)*(x - mean)) / _window.Count);\n                Volatility = (std * Math.Sqrt(252d)).SafeDecimalCast();\n            }\n        }\n\n        // Returns history requirements for the volatility model expressed in the form of history request\n        // GetHistoryRequirements is a mandatory method\n        public IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        // For simplicity's sake, we will not set a history requirement\n        {\n            return Enumerable.Empty<HistoryRequest>();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/CustomWarmUpPeriodIndicatorAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test to check custom indicators warms up properly\n    /// when one of them define WarmUpPeriod parameter and the other doesn't\n    /// </summary>\n    public class CustomWarmUpPeriodIndicatorAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CSMANotWarmUp _customNotWarmUp;\n        private CSMAWithWarmUp _customWarmUp;\n        private SimpleMovingAverage _customNotInherit;\n        private SimpleMovingAverage _duplicateSMA;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            AddEquity(\"SPY\", Resolution.Second);\n\n            // Create two custom indicators, where one of them defines WarmUpPeriod parameter\n            _customNotWarmUp = new CSMANotWarmUp(\"_customNotWarmUp\", 60);\n            _customWarmUp = new CSMAWithWarmUp(\"_customWarmUp\", 60);\n            _customNotInherit = new SimpleMovingAverage(\"_customNotInherit\", 60);\n            // using 2nd SMA to match counterpart python algorithm ( CustomSMA + csharpIndicator )\n            // so that AlgorithmHistoryDataPoints are the same in both\n            _duplicateSMA = new SimpleMovingAverage(\"_duplicateSMA\", 60);\n\n            // Register the daily data of \"SPY\" to automatically update both indicators\n            RegisterIndicator(\"SPY\", _customWarmUp, Resolution.Minute);\n            RegisterIndicator(\"SPY\", _customNotWarmUp, Resolution.Minute);\n            RegisterIndicator(\"SPY\", _customNotInherit, Resolution.Minute);\n            RegisterIndicator(\"SPY\", _duplicateSMA, Resolution.Minute);\n\n            // Warm up _customWarmUp indicator\n            WarmUpIndicator(\"SPY\", _customWarmUp, Resolution.Minute);\n\n            // Check _customWarmUp indicator has already been warmed up with the requested data\n            if (!_customWarmUp.IsReady)\n            {\n                throw new RegressionTestException(\"_customWarmUp indicator was expected to be ready\");\n            }\n            if (_customWarmUp.Samples != 60)\n            {\n                throw new RegressionTestException(\"_customWarmUp indicator was expected to have processed 60 datapoints already\");\n            }\n\n            // Try to warm up _customNotWarmUp indicator. It's expected from LEAN to skip the warm up process\n            // because this indicator doesn't implement IIndicatorWarmUpPeriodProvider\n            WarmUpIndicator(\"SPY\", _customNotWarmUp, Resolution.Minute);\n\n            // Check _customNotWarmUp indicator is not ready, because the warm up process was skipped\n            if (_customNotWarmUp.IsReady)\n            {\n                throw new RegressionTestException(\"_customNotWarmUp indicator wasn't expected to be warmed up\");\n            }\n\n            WarmUpIndicator(\"SPY\", _customNotInherit, Resolution.Minute);\n            // Check _customWarmUp indicator has already been warmed up with the requested data\n            if (!_customNotInherit.IsReady)\n            {\n                throw new RegressionTestException(\"_customNotInherit indicator was expected to be ready\");\n            }\n            if (_customNotInherit.Samples != 60)\n            {\n                throw new RegressionTestException(\"_customNotInherit indicator was expected to have processed 60 datapoints already\");\n            }\n\n            WarmUpIndicator(\"SPY\", _duplicateSMA, Resolution.Minute);\n            // Check _customWarmUp indicator has already been warmed up with the requested data\n            if (!_duplicateSMA.IsReady)\n            {\n                throw new RegressionTestException(\"_duplicateSMA indicator was expected to be ready\");\n            }\n            if (_duplicateSMA.Samples != 60)\n            {\n                throw new RegressionTestException(\"_duplicateSMA indicator was expected to have processed 60 datapoints already\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n\n            if (Time.Second == 0)\n            {\n                // Compute the difference between the indicators values\n                var diff = Math.Abs(_customNotWarmUp.Current.Value - _customWarmUp.Current.Value);\n                diff += Math.Abs(_customNotInherit.Current.Value - _customNotWarmUp.Current.Value);\n                diff += Math.Abs(_customNotInherit.Current.Value - _customWarmUp.Current.Value);\n                diff += Math.Abs(_duplicateSMA.Current.Value - _customWarmUp.Current.Value);\n                diff += Math.Abs(_duplicateSMA.Current.Value - _customNotWarmUp.Current.Value);\n                diff += Math.Abs(_duplicateSMA.Current.Value - _customNotInherit.Current.Value);\n\n                // Check _customNotWarmUp indicator is ready when the number of samples is bigger than its period\n                if (_customNotWarmUp.IsReady != (_customNotWarmUp.Samples >= 60))\n                {\n                    throw new RegressionTestException(\"_customNotWarmUp indicator was expected to be ready when the number of samples were bigger that its WarmUpPeriod parameter\");\n                }\n\n                // Check their values are the same when both are ready\n                if (diff > 1e-10m && _customNotWarmUp.IsReady && _customWarmUp.IsReady) \n                {\n                    throw new RegressionTestException($\"The values of the indicators are not the same. The difference is {diff}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Custom implementation of SimpleMovingAverage.\n        /// Represents the traditional simple moving average indicator (SMA) without WarmUpPeriod parameter defined\n        /// </summary>\n        private class CSMANotWarmUp : IndicatorBase<IBaseData>\n        {\n            private Queue<IBaseData> _queue;\n            private int _period;\n            public CSMANotWarmUp(string name, int period)\n                : base(name)\n            {\n                _queue = new Queue<IBaseData>();\n                _period = period;\n            }\n\n            public override bool IsReady => _queue.Count == _period;\n\n            protected override decimal ComputeNextValue(IBaseData input)\n            {\n                _queue.Enqueue(input);\n                if (_queue.Count > _period)\n                {\n                    _queue.Dequeue();\n                }\n                var items = (_queue.ToArray());\n                var sum = 0m;\n                Array.ForEach(items, i => sum += i.Value);\n                return sum / _queue.Count;\n            }\n        }\n\n        /// <summary>\n        /// Custom implementation of SimpleMovingAverage.\n        /// Represents the traditional simple moving average indicator (SMA) with WarmUpPeriod defined\n        /// </summary>\n        private class CSMAWithWarmUp : CSMANotWarmUp, IIndicatorWarmUpPeriodProvider\n        {\n            public CSMAWithWarmUp(string name, int period)\n                : base(name, period)\n            {\n                WarmUpPeriod = period;\n            }\n            public int WarmUpPeriod { get; private set; }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 234043;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 360;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"272.157%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101694.38\"},\n            {\"Net Profit\", \"1.694%\"},\n            {\"Sharpe Ratio\", \"8.863\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"0.998\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.534\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.972\"},\n            {\"Total Fees\", \"$3.45\"},\n            {\"Estimated Strategy Capacity\", \"$310000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.96%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"8c925e7c6c10ff1da3a40669accba91a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DYDXCryptoFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting DYDX Crypto Future support\n    /// </summary>\n    public class DYDXCryptoFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CryptoFuture _cryptoFuture;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2026, 1, 1);\n            SetEndDate(2026, 1, 1);\n\n            SetBrokerageModel(Brokerages.BrokerageName.DYDX, AccountType.Margin);\n            _cryptoFuture = AddCryptoFuture(\"BTCUSD\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                Buy(\"BTCUSD\", 1);\n            }\n            else\n            {\n                if (Math.Abs(Portfolio.TotalFees - Portfolio.TotalHoldingsValue * 0.0005m) > 1\n                    || Math.Abs(Portfolio.TotalFees - _cryptoFuture.Price * 0.0005m) > 1)\n                {\n                    throw new RegressionTestException(\"Unexpected fees value!\");\n                }\n                if (Math.Abs(Portfolio.TotalHoldingsValue - _cryptoFuture.Price) > 1)\n                {\n                    throw new RegressionTestException(\"Unexpected holdings value!\");\n                }\n                Quit();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99929.57\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$43.71\"},\n            {\"Estimated Strategy Capacity\", \"$33000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD 38Z\"},\n            {\"Portfolio Turnover\", \"87.48%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"637a937cda83ce88d29a3b279832401d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Uses daily data and a simple moving average cross to place trades and an ema for stop placement\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class DailyAlgorithm : QCAlgorithm\n    {\n        private DateTime _lastAction;\n        private MovingAverageConvergenceDivergence _macd;\n        private ExponentialMovingAverage _ema;\n        private readonly Symbol _ibm = QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 01, 01);  //Set Start Date\n            SetEndDate(2014, 01, 01);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"IBM\", Resolution.Hour);\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily);\n\n            _macd = MACD(_spy, 12, 26, 9, MovingAverageType.Wilders, Resolution.Daily, Field.Close);\n            _ema = EMA(_ibm, 15*6, Resolution.Hour, Field.SevenBar);\n\n            Securities[_ibm].SetLeverage(1.0m);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public void OnData(TradeBars data)\n        {\n            if (!_macd.IsReady) return;\n            if (!data.ContainsKey(_ibm)) return;\n            if (_lastAction.Date == Time.Date) return;\n            _lastAction = Time;\n\n            var holding = Portfolio[_spy];\n            if (holding.Quantity <= 0 && _macd > _macd.Signal && data[_ibm].Price > _ema)\n            {\n                SetHoldings(_ibm, 0.25m);\n            }\n            else if (holding.Quantity >= 0 && _macd < _macd.Signal && data[_ibm].Price < _ema)\n            {\n                SetHoldings(_ibm, -0.25m);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/DailyConsolidationExtendedMarketHoursWarningRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class DailyConsolidationExtendedMarketHoursWarningRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private TradeBar _lastBar;\n        private int _mismatchCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 31);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour, extendedMarketHours: true).Symbol;\n\n            // Daily consolidator that excludes extended market hours\n            // Requires both the subscription and the algorithm setting to enable them\n            // the subscription has ExtendedMarketHours=true, but the setting is false by default\n            Consolidate(_spy, Resolution.Daily, OnNormalMarketHours); // This will show a warning\n\n            // Daily consolidator that includes extended market hours,\n            // since both the subscription and the algorithm setting are enabled\n            Settings.DailyConsolidationUseExtendedMarketHours = true;\n            Consolidate(_spy, Resolution.Daily, OnExtendedMarketHours);\n        }\n\n        private void OnNormalMarketHours(TradeBar dailyBar)\n        {\n            // Save the last consolidated bar for comparison\n            _lastBar = dailyBar;\n        }\n        private void OnExtendedMarketHours(TradeBar dailyBar)\n        {\n            if (dailyBar.Open != _lastBar.Open || dailyBar.High != _lastBar.High || dailyBar.Low != _lastBar.Low || dailyBar.Close != _lastBar.Close)\n            {\n                // Track bar mismatches between normal and extended market hours\n                _mismatchCount++;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_mismatchCount == 0)\n            {\n                throw new RegressionTestException(\"Expected differences between daily consolidations with and without extended market hours.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 440;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.224\"},\n            {\"Tracking Error\", \"0.108\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/DailyHistoryForDailyResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm simply fetch one-day history prior current time.\n    /// </summary>\n    public class DailyHistoryForDailyResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol[] _symbols = {\n            QuantConnect.Symbol.Create(\"GBPUSD\", SecurityType.Forex, market: Market.FXCM),\n            QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, market: Market.Oanda),\n            QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, market: Market.USA),\n            QuantConnect.Symbol.Create(\"BTCUSD\", SecurityType.Crypto, market: Market.GDAX),\n            QuantConnect.Symbol.Create(\"XAUUSD\", SecurityType.Cfd, market: Market.Oanda)\n        };\n\n        private HashSet<Symbol> _received = new HashSet<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 3, 26);\n            SetEndDate(2018, 4, 10);\n            foreach (var symbol in _symbols)\n            {\n                AddSecurity(symbol, Resolution.Daily);\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            using (var enumerator = slice.GetEnumerator())\n            {\n                while (enumerator.MoveNext())\n                {\n                    var current = enumerator.Current;\n                    var symbol = current.Key;\n                    _received.Add(symbol);\n\n                    List<BaseData> history;\n\n                    if (current.Value.DataType == MarketDataType.QuoteBar)\n                    {\n                        history = History(1, Resolution.Daily).Get<QuoteBar>(symbol).Cast<BaseData>().ToList();\n                    }\n                    else\n                    {\n                        history = History(1, Resolution.Daily).Get<TradeBar>(symbol).Cast<BaseData>().ToList();\n                    }\n\n                    if (!history.Any()) throw new RegressionTestException($\"No {symbol} data on the eve of {Time} {Time.DayOfWeek}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_received.Count != _symbols.Length)\n            {\n                throw new RegressionTestException($\"Data for symbols {string.Join(\",\", _symbols.Except(_received))} were not received\");\n            }\n        }\n\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 179;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 458;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.101\"},\n            {\"Tracking Error\", \"0.185\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyHistoryForMinuteResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm simply fetch one-day history prior current time.\n    /// </summary>\n    public class DailyHistoryForMinuteResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol[] _symbols = {\n            QuantConnect.Symbol.Create(\"GBPUSD\", SecurityType.Forex, market: Market.FXCM),\n            QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, market: Market.Oanda),\n            QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, market: Market.USA),\n            QuantConnect.Symbol.Create(\"BTCUSD\", SecurityType.Crypto, market: Market.GDAX),\n            QuantConnect.Symbol.Create(\"XAUUSD\", SecurityType.Cfd, market: Market.Oanda)\n        };\n\n        private HashSet<Symbol> _received = new HashSet<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 3, 26);\n            SetEndDate(2018, 4, 10);\n            foreach (var symbol in _symbols)\n            {\n                AddSecurity(symbol, Resolution.Minute);\n            }\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(1)), MakeHistoryCall);\n        }\n\n        private void MakeHistoryCall()\n        {\n            foreach (var symbol in _symbols)\n            {\n                _received.Add(symbol);\n\n                bool hasHistory = false;\n\n                foreach (var dataType in SubscriptionManager.AvailableDataTypes[symbol.SecurityType])\n                {\n                    if (dataType == TickType.Quote)\n                    {\n                        hasHistory |= History(1, Resolution.Daily).Get<QuoteBar>(symbol).Any();\n                    }\n                    else\n                    {\n                        hasHistory |= History(1, Resolution.Daily).Get<TradeBar>(symbol).Any();\n                    }\n                }\n\n                if (!hasHistory)\n                {\n                    throw new RegressionTestException($\"No {symbol} data on the eve of {Time} {Time.DayOfWeek}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_received.Count != _symbols.Length)\n            {\n                throw new RegressionTestException($\"Data for symbols {string.Join(\",\", _symbols.Except(_received))} were not received\");\n            }\n        }\n\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 29579;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15307;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.104\"},\n            {\"Tracking Error\", \"0.192\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyOptionChainOpenInterestDataWithStrictDailyEndTimesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the option chain data has valid open interest values for daily resolution.\n    /// Reproduces GH issue #8421.\n    /// </summary>\n    public class DailyOptionChainOpenInterestDataWithStrictDailyEndTimesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        private List<decimal> _openInterests = new();\n\n        public virtual bool DailyPreciseEndTime => true;\n\n        public override void Initialize()\n        {\n            Settings.DailyPreciseEndTime = DailyPreciseEndTime;\n\n            SetStartDate(2014, 06, 01);\n            SetEndDate(2014, 07, 06);\n\n            var option = AddOption(\"AAPL\", Resolution.Daily);\n            option.SetFilter(u => u.StandardsOnly().Strikes(-5, +5).Expiration(0, 365));\n\n            _symbol = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.OptionChains.TryGetValue(_symbol, out var chain) && chain.Contracts.Count > 0)\n            {\n                var openInterest = chain.Sum(x => x.OpenInterest);\n                _openInterests.Add(openInterest);\n                Debug($\"[{Time}] Sum of open interest: {openInterest}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_openInterests.Count == 0)\n            {\n                throw new RegressionTestException(\"No option chain data was received by the algorithm.\");\n            }\n\n            if (_openInterests.All(x => x == 0))\n            {\n                throw new RegressionTestException(\"Contracts received didn't have valid open interest values.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 47140;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.035\"},\n            {\"Tracking Error\", \"0.05\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyOptionChainOpenInterestDataWithoutStrictDailyEndTimesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the option chain data has valid open interest values for daily resolution.\n    /// Reproduces GH issue #8421.\n    /// </summary>\n    public class DailyOptionChainOpenInterestDataWithoutStrictDailyEndTimesRegressionAlgorithm : DailyOptionChainOpenInterestDataWithStrictDailyEndTimesRegressionAlgorithm\n    {\n        public override bool DailyPreciseEndTime => false;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 46271;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionSplitRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test algorithm reproduces issue reported in GB issue https://github.com/QuantConnect/Lean/issues/2655\n    /// fixed in PR https://github.com/QuantConnect/Lean/pull/2659\n    /// </summary>\n    public class DailyResolutionSplitRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 2, 13);  //Set Start Date\n            SetEndDate(2018, 06, 01);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            _symbol = AddEquity(\"UPRO\", Resolution.Daily).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Date == new DateTime(2018, 05, 22).Date)\n            {\n                MarketOrder(_symbol, 100);\n            }\n\n            if (Time.Date == new DateTime(2018, 05, 23).Date)\n            {\n                MarketOrder(_symbol, 100);\n            }\n\n            if (Time.Date == new DateTime(2018, 05, 24).Date)\n            {\n                MarketOrder(_symbol, 100);\n            }\n\n            if (Time.Date == new DateTime(2018, 05, 25).Date)\n            {\n                MarketOrder(_symbol, 100);\n            }\n\n            if (Time.Date == new DateTime(2018, 05, 29).Date)\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.520%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Net Profit\", \"0.155%\"},\n            {\"Sharpe Ratio\", \"0.242\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.118\"},\n            {\"Beta\", \"-5.794\"},\n            {\"Annual Standard Deviation\", \"0.022\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.644\"},\n            {\"Tracking Error\", \"0.022\"},\n            {\"Treynor Ratio\", \"-0.001\"},\n            {\"Total Fees\", \"$4.00\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionVsTimeSpanNoPreciseEndRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests indicator behavior when \"DailyPreciseEndTime\" is disabled,  \n    /// ensuring updates occur at midnight and values remain consistent.  \n    /// </summary>\n    public class DailyResolutionVsTimeSpanNoPreciseEndRegressionAlgorithm : DailyResolutionVsTimeSpanRegressionAlgorithm\n    {\n        // Disables precise end time, considering the full day instead.\n        protected override bool DailyPreciseEndTime => false;\n\n        protected override void SetupFirstIndicatorUpdatedHandler()\n        {\n            RelativeStrengthIndex1.Updated += (sender, data) =>\n            {\n                var updatedTime = Time;\n\n                // RSI1 should update at midnight when precise end time is disabled\n                if (updatedTime.TimeOfDay != new TimeSpan(0, 0, 0))\n                {\n                    throw new RegressionTestException($\"{RelativeStrengthIndex1.Name} must have updated at midnight, but it was updated at {updatedTime}\");\n                }\n\n                // Since RSI1 updates before RSI2, it should have exactly one extra sample\n                if (RelativeStrengthIndex1.Samples - 1 != RelativeStrengthIndex2.Samples)\n                {\n                    throw new RegressionTestException(\"RSI1 must have 1 extra sample\");\n                }\n\n                // RSI1's previous value should match RSI2's current value, ensuring consistency\n                if (RelativeStrengthIndex1.Previous.Value != RelativeStrengthIndex2.Current.Value)\n                {\n                    throw new RegressionTestException(\"RSI1 and RSI2 must have same value\");\n                }\n            };\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (RelativeStrengthIndex1.Current.Value != RelativeStrengthIndex2.Current.Value)\n            {\n                throw new RegressionTestException(\"RSI1 and RSI2 must have same value\");\n            }\n            if (RelativeStrengthIndex1.Samples <= 20 || RelativeStrengthIndex2.Samples != RelativeStrengthIndex1.Samples)\n            {\n                throw new RegressionTestException(\"The number of samples must be the same and greater than 20\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionVsTimeSpanRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the behavior of indicators with different update mechanisms based on resolution and time span.\n    /// </summary>\n    public class DailyResolutionVsTimeSpanRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Symbol Spy { get; set; }\n        protected RelativeStrengthIndex RelativeStrengthIndex1 { get; set; }\n        protected RelativeStrengthIndex RelativeStrengthIndex2 { get; set; }\n        protected virtual bool DailyPreciseEndTime => true;\n\n        public override void Initialize()\n        {\n            InitializeBaseSettings();\n\n            Settings.DailyPreciseEndTime = DailyPreciseEndTime;\n\n            // First RSI: Updates at market close (4 PM) by default\n            // If DailyPreciseEndTime is false, updates at midnight (12:00 AM)\n            RelativeStrengthIndex1 = new RelativeStrengthIndex(14, MovingAverageType.Wilders);\n            RegisterIndicator(Spy, RelativeStrengthIndex1, Resolution.Daily);\n\n            // Second RSI: Updates every 24 hours (from 12:00 AM to 12:00 AM) using a time span\n            RelativeStrengthIndex2 = new RelativeStrengthIndex(14, MovingAverageType.Wilders);\n            RegisterIndicator(Spy, RelativeStrengthIndex2, TimeSpan.FromDays(1));\n\n            // Warm up indicators with historical data\n            var history = History<TradeBar>(Spy, 20, Resolution.Daily).ToList();\n            foreach (var bar in history)\n            {\n                RelativeStrengthIndex1.Update(bar.EndTime, bar.Close);\n                RelativeStrengthIndex2.Update(bar.EndTime, bar.Close);\n            }\n            if (!RelativeStrengthIndex1.IsReady || !RelativeStrengthIndex2.IsReady)\n            {\n                throw new RegressionTestException(\"Indicators not ready.\");\n            }\n\n            SetupFirstIndicatorUpdatedHandler();\n            SetupSecondIndicatorUpdatedHandler();\n        }\n\n        protected virtual void InitializeBaseSettings()\n        {\n            SetStartDate(2013, 01, 01);\n            SetEndDate(2013, 01, 05);\n            Spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n        }\n\n        /// <summary>\n        /// Event handler for the first RSI indicator\n        /// Validates update timing and sample consistency\n        /// </summary>\n        protected virtual void SetupFirstIndicatorUpdatedHandler()\n        {\n            RelativeStrengthIndex1.Updated += (sender, data) =>\n            {\n                var updatedTime = Time;\n\n                // Ensure RSI1 updates exactly at market close (4 PM)\n                if (updatedTime.TimeOfDay != new TimeSpan(16, 0, 0))\n                {\n                    throw new RegressionTestException($\"RSI1 must have updated at 4 PM, but it updated at {updatedTime}.\");\n                }\n\n                // Since RSI1 updates before RSI2, it should have one extra sample\n                if (RelativeStrengthIndex1.Samples - 1 != RelativeStrengthIndex2.Samples)\n                {\n                    throw new RegressionTestException(\"First RSI indicator should have exactly one more sample than the second indicator.\");\n                }\n\n                // RSI1's previous value should match RSI2's current value, ensuring consistency\n                if (RelativeStrengthIndex1.Previous.Value != RelativeStrengthIndex2.Current.Value)\n                {\n                    throw new RegressionTestException(\"RSI1 and RSI2 must have same value\");\n                }\n\n                // RSI1's and RSI2's current values should be different\n                if (RelativeStrengthIndex1.Current.Value == RelativeStrengthIndex2.Current.Value)\n                {\n                    throw new RegressionTestException(\"RSI1 and RSI2 must have different values\");\n                }\n            };\n        }\n\n        /// <summary>\n        /// Event handler for the second RSI indicator\n        /// Validates update timing and sample consistency\n        /// </summary>\n        protected virtual void SetupSecondIndicatorUpdatedHandler()\n        {\n            RelativeStrengthIndex2.Updated += (sender, data) =>\n            {\n                var updatedTime = Time;\n\n                // RSI2 updates at midnight, ensure the update time is correct\n                if (updatedTime.TimeOfDay != new TimeSpan(0, 0, 0))\n                {\n                    throw new RegressionTestException($\"RSI2 must have updated at midnight, but it was updated at {updatedTime}\");\n                }\n\n                // Since RSI2 updates later, it must now have the same number of samples as RSI1\n                if (RelativeStrengthIndex1.Samples != RelativeStrengthIndex2.Samples)\n                {\n                    throw new RegressionTestException(\"RSI1 must have same number of samples as RSI2\");\n                }\n\n                // At this point, RSI1 and RSI2 should have the same value\n                if (RelativeStrengthIndex1.Current.Value != RelativeStrengthIndex2.Current.Value)\n                {\n                    throw new RegressionTestException(\"RSI1 and RSI2 must have same value\");\n                }\n            };\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (RelativeStrengthIndex1.Samples <= 20)\n            {\n                throw new RegressionTestException(\"The number of samples must be greater than 20\");\n            }\n            if (RelativeStrengthIndex1.Samples <= 20)\n            {\n                throw new RegressionTestException(\"The number of samples must be greater than 20\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-38.725\"},\n            {\"Tracking Error\", \"0.232\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionVsTimeSpanWithMinuteEquityAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class DailyResolutionVsTimeSpanWithMinuteEquityAlgorithm : DailyResolutionVsTimeSpanRegressionAlgorithm\n    {\n        protected override void InitializeBaseSettings()\n        {\n            SetStartDate(2013, 10, 04);\n            SetEndDate(2013, 10, 05);\n            Spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 795;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionVsTimeSpanWithSecondEquityAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class DailyResolutionVsTimeSpanWithSecondEquityAlgorithm : DailyResolutionVsTimeSpanRegressionAlgorithm\n    {\n        protected override void InitializeBaseSettings()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            Spy = AddEquity(\"SPY\", Resolution.Second).Symbol;\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 93622;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyResolutionVsTimeSpanWithTickResolutionEquityAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class DailyResolutionVsTimeSpanWithTickResolutionEquityAlgorithm : DailyResolutionVsTimeSpanRegressionAlgorithm\n    {\n        protected override void InitializeBaseSettings()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            Spy = AddEquity(\"SPY\", Resolution.Tick).Symbol;\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 6877089;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyStrictEndTimeConsolidatorsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting behavior of consolidators while using daily strict end time\n    /// </summary>\n    public class DailyStrictEndTimeConsolidatorsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _consolidatorsDataResolutionCount;\n        private int _consolidatorsDataTimeSpanCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n            AddEquity(\"AAPL\", Resolution.Daily, fillForward: false);\n\n            Consolidate(\"AAPL\", Resolution.Daily, AssertResolutionBasedDailyBars);\n            Consolidate(\"SPY\", Resolution.Daily, AssertResolutionBasedDailyBars);\n\n            Consolidate(\"AAPL\", QuantConnect.Time.OneDay, AssertTimeSpanBasedDailyBars);\n            Consolidate(\"SPY\", QuantConnect.Time.OneDay, AssertTimeSpanBasedDailyBars);\n        }\n\n        protected virtual void AssertResolutionBasedDailyBars(TradeBar bar)\n        {\n            Debug($\"AssertResolutionBasedDailyBars({Time}): {bar}\");\n            _consolidatorsDataResolutionCount++;\n            AssertDailyBar(bar);\n        }\n\n        protected virtual void AssertTimeSpanBasedDailyBars(TradeBar bar)\n        {\n            Debug($\"AssertTimeSpanBasedDailyBars({Time}): {bar}\");\n            _consolidatorsDataTimeSpanCount++;\n            if (bar.Symbol == \"AAPL\")\n            {\n                // underlying is daily, passes through, it will be daily strict end times, even if created as a timespan\n                AssertDailyBar(bar);\n            }\n            else\n            {\n                if (bar.EndTime.Hour != 0 || bar.Period != QuantConnect.Time.OneDay)\n                {\n                    throw new RegressionTestException($\"{Time}: Unexpected daily time span based bar span {bar.EndTime}!\");\n                }\n            }\n        }\n\n        private void AssertDailyBar(TradeBar bar)\n        {\n            if (Settings.DailyPreciseEndTime)\n            {\n                if (bar.EndTime.Hour != 16 || bar.Period != TimeSpan.FromHours(6.5))\n                {\n                    throw new RegressionTestException($\"{Time}: Unexpected daily resolution based bar span {bar.EndTime}!\");\n                }\n            }\n            else\n            {\n                if (bar.EndTime.Hour != 0 || bar.Period != QuantConnect.Time.OneDay)\n                {\n                    throw new RegressionTestException($\"{Time}: Unexpected daily resolution based bar span {bar.EndTime}!\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_consolidatorsDataTimeSpanCount != 9)\n            {\n                throw new RegressionTestException($\"Unexpected consolidator time span data count {_consolidatorsDataTimeSpanCount}!\");\n            }\n            if (_consolidatorsDataResolutionCount != (9 + (Settings.DailyPreciseEndTime ? 1 : 0)))\n            {\n                throw new RegressionTestException($\"Unexpected consolidator resolution data count {_consolidatorsDataResolutionCount}!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3948;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DailyStrictEndTimeDisabledConsolidatorsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting behavior of consolidators while daily strict end time disabled\n    /// </summary>\n    public class DailyStrictEndTimeDisabledConsolidatorsRegressionAlgorithm : DailyStrictEndTimeConsolidatorsRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            Settings.DailyPreciseEndTime = false;\n            base.Initialize();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DataConsolidationAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm giving an introduction into using IDataConsolidators.\n    /// This is an advanced QC concept and requires a certain level of comfort using C# and its event system.\n    ///\n    /// What is an IDataConsolidator?\n    /// IDataConsolidator is a plugin point that can be used to transform your data more easily.\n    /// In this example we show one of the simplest consolidators, the TradeBarConsolidator.\n    /// This type is capable of taking a timespan to indicate how long each bar should be, or an\n    /// integer to indicate how many bars should be aggregated into one.\n    ///\n    /// When a new 'consolidated' piece of data is produced by the IDataConsolidator, an event is fired\n    /// with the argument of the new data.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"consolidating data\" />\n    public class DataConsolidationAlgorithm : QCAlgorithm\n    {\n        private bool consolidatedHour;\n        private bool consolidated45Minute;\n        private TradeBar _last;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <meta name=\"tag\" content=\"using data\" />\n        /// <meta name=\"tag\" content=\"consolidating data\" />\n        public override void Initialize()\n        {\n            AddEquity(\"SPY\");\n            AddForex(\"EURUSD\", Resolution.Hour);\n\n            // we have data for these dates locally\n            var start = new DateTime(2013, 10, 07, 09, 30, 0);\n            SetStartDate(start);\n            SetEndDate(start.AddDays(60));\n\n            // define our 30 minute trade bar consolidator. we can access the 30 minute bar\n            // from the DataConsolidated events\n            var thirtyMinuteConsolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(30));\n\n            // attach our event handler. the event handler is a function that will be called each time we produce\n            // a new consolidated piece of data.\n            thirtyMinuteConsolidator.DataConsolidated += ThirtyMinuteBarHandler;\n\n            // this call adds our 30 minute consolidator to the manager to receive updates from the engine\n            SubscriptionManager.AddConsolidator(\"SPY\", thirtyMinuteConsolidator);\n\n            // here we'll define a slightly more complex consolidator. what we're trying to produce is a 3\n            // day bar.  Now we could just use a single TradeBarConsolidator like above and pass in TimeSpan.FromDays(3),\n            // but in reality that's not what we want. For time spans of longer than a day we'll get incorrect results around\n            // weekends and such. What we really want are tradeable days. So we'll create a daily consolidator, and then wrap\n            // it with a 3 count consolidator.\n\n            // first define a one day trade bar -- this produces a consolidated piece of data after a day has passed\n            var oneDayConsolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));\n\n            // next define our 3 count trade bar -- this produces a consolidated piece of data after it sees 3 pieces of data\n            var threeCountConsolidator = new TradeBarConsolidator(3);\n\n            // here we combine them to make a new, 3 day trade bar. The SequentialConsolidator allows composition of consolidators.\n            // it takes the consolidated output of one consolidator (in this case, the oneDayConsolidator) and pipes it through to\n            // the threeCountConsolidator.  His output will be a 3 day bar.\n            var three_oneDayBar = new SequentialConsolidator(oneDayConsolidator, threeCountConsolidator);\n\n            // attach our handler\n            three_oneDayBar.DataConsolidated += (sender, consolidated) => ThreeDayBarConsolidatedHandler(sender, (TradeBar) consolidated);\n\n            // this call adds our 3 day to the manager to receive updates from the engine\n            SubscriptionManager.AddConsolidator(\"SPY\", three_oneDayBar);\n\n            // API convenience method for easily receiving consolidated data\n            Consolidate(\"SPY\", TimeSpan.FromMinutes(45), FortyFiveMinuteBarHandler);\n            Consolidate(\"SPY\", Resolution.Hour, HourBarHandler);\n            Consolidate(\"EURUSD\", Resolution.Daily, DailyEurUsdBarHandler);\n\n            // API convenience method for easily receiving weekly-consolidated data\n            Consolidate(\"SPY\", Calendar.Weekly, CalendarTradeBarHandler);\n            Consolidate(\"EURUSD\", Calendar.Weekly, CalendarQuoteBarHandler);\n\n            // API convenience method for easily receiving monthly-consolidated data\n            Consolidate(\"SPY\", Calendar.Monthly, CalendarTradeBarHandler);\n            Consolidate(\"EURUSD\", Calendar.Monthly, CalendarQuoteBarHandler);\n\n            // API convenience method for easily receiving quarterly-consolidated data\n            Consolidate(\"SPY\", Calendar.Quarterly, CalendarTradeBarHandler);\n            Consolidate(\"EURUSD\", Calendar.Quarterly, CalendarQuoteBarHandler);\n\n            // API convenience method for easily receiving yearly-consolidated data\n            Consolidate(\"SPY\", Calendar.Yearly, CalendarTradeBarHandler);\n            Consolidate(\"EURUSD\", Calendar.Yearly, CalendarQuoteBarHandler);\n\n            // requires quote data subscription\n            //Consolidate<QuoteBar>(\"EURUSD\", TimeSpan.FromMinutes(45), FortyFiveMinuteBarHandler);\n            //Consolidate<QuoteBar>(\"EURUSD\", Resolution.Hour, HourBarHandler);\n\n            // some securities may have trade and quote data available\n            //Consolidate<TradeBar>(\"BTCUSD\", Resolution.Hour, HourBarHandler);\n            //Consolidate<QuoteBar>(\"BTCUSD\", Resolution.Hour, HourBarHandler);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // we need to declare this method\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <param name=\"symbol\">Asset symbol for this end of day event. Forex and equities have different closing hours.</param>\n        public override void OnEndOfDay(string symbol)\n        {\n            // close up shop each day and reset our 'last' value so we start tomorrow fresh\n            Liquidate(symbol);\n            _last = null;\n        }\n\n        /// <summary>\n        /// This is our event handler for our 30 minute trade bar defined above in Initialize(). So each time the consolidator\n        /// produces a new 30 minute bar, this function will be called automatically. The 'sender' parameter will be the\n        /// instance of the IDataConsolidator that invoked the event, but you'll almost never need that!\n        /// </summary>\n        private void ThirtyMinuteBarHandler(object sender, TradeBar consolidated)\n        {\n            if (_last != null && consolidated.Close > _last.Close)\n            {\n                Log($\"{consolidated.Time:o} >> SPY >> LONG  >> 100 >> {Portfolio[\"SPY\"].Quantity}\");\n                Order(\"SPY\", 100);\n            }\n            else if (_last != null && consolidated.Close < _last.Close)\n            {\n                Log($\"{consolidated.Time:o} >> SPY >> SHORT >> 100 >> {Portfolio[\"SPY\"].Quantity}\");\n                Order(\"SPY\", -100);\n            }\n            _last = consolidated;\n        }\n\n        /// <summary>\n        /// This is our event handler for our 3 day trade bar defined above in Initialize(). So each time the consolidator\n        /// produces a new 3 day bar, this function will be called automatically. The 'sender' parameter will be the\n        /// instance of the IDataConsolidator that invoked the event, but you'll almost never need that!\n        /// </summary>\n        private void ThreeDayBarConsolidatedHandler(object sender, TradeBar consolidated)\n        {\n            Log($\"{consolidated.Time:o} >> Plotting!\");\n            Plot(consolidated.Symbol, \"3HourBar\", consolidated.Close);\n        }\n\n        /// <summary>\n        /// This is our event handler for our one hour consolidated defined using the Consolidate method\n        /// </summary>\n        private void HourBarHandler(TradeBar consolidated)\n        {\n            consolidatedHour = true;\n            Log($\"{consolidated.EndTime:o} Hour consolidated.\");\n        }\n\n        /// <summary>\n        /// This is our event handler for our 45 minute consolidated defined using the Consolidate method\n        /// </summary>\n        private void FortyFiveMinuteBarHandler(TradeBar consolidated)\n        {\n            consolidated45Minute = true;\n            Log($\"{consolidated.EndTime:o} 45 minute consolidated.\");\n        }\n\n        private void DailyEurUsdBarHandler(QuoteBar consolidated)\n        {\n            Log($\"{consolidated.EndTime:o} EURUSD Daily consolidated.\");\n        }\n\n        private void CalendarTradeBarHandler(TradeBar tradeBar)\n        {\n            Log($\"{Time} :: {tradeBar.Time:o} {tradeBar.Close}\");\n        }\n\n        private void CalendarQuoteBarHandler(QuoteBar quoteBar)\n        {\n            Log($\"{Time} :: {quoteBar.Time:o} {quoteBar.Close}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!consolidatedHour)\n            {\n                throw new RegressionTestException(\"Expected hourly consolidator to be fired.\");\n            }\n\n            if (!consolidated45Minute)\n            {\n                throw new RegressionTestException(\"Expected 45-minute consolidator to be fired.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DaylightSavingTimeHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm simply fetch history on boarder of Daylight Saving Time shift\n    /// </summary>\n    public class DaylightSavingTimeHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol[] _symbols = new[]\n        {\n            QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM),\n            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)\n        };\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2011, 11, 10);  //Set Start Date\n            SetEndDate(2011, 11, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            for (int i = 0; i < _symbols.Length; i++)\n            {\n                var symbol = _symbols[i];\n                IEnumerable<BaseData> history;\n                if (symbol.SecurityType == SecurityType.Equity)\n                {\n                    try\n                    {\n\n                        history = History<QuoteBar>(symbol, 10, Resolution.Daily).Select(bar => bar as BaseData);\n                        throw new RegressionTestException(\"We were expecting an argument exception to be thrown. Equity does not have daily QuoteBars!\");\n                    }\n                    catch (ArgumentException)\n                    {\n                        // expected\n                    }\n                    history = History<TradeBar>(symbol, 10, Resolution.Daily).Select(bar => bar as BaseData);\n                }\n                else\n                {\n                    history = History<QuoteBar>(symbol, 10, Resolution.Daily)\n                        .Select(bar => bar as BaseData);\n                }\n\n                var duplications = history\n                    .GroupBy(k => k.Time)\n                    .Where(g => g.Count() > 1);\n                if (duplications.Any())\n                {\n                    var time = duplications.First().Key;\n                    throw new RegressionTestException($\"Duplicated bars were issued for time {time}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 21;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DefaultFutureChainRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #6829 where the default future chain selection would let some contracts through\n    /// </summary>\n    public class DefaultFutureChainRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 12, 10);\n\n            AddFuture(Futures.Metals.Gold);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities.Where(added => !added.Symbol.IsCanonical()))\n            {\n                // With no future chain filters specified, it should return no contracts in security changes event.\n                // The canonical continuous future will get mapped and emit symbol changed events, while it's current mapped security is an internal feed\n                throw new RegressionTestException($\"We expect no non canonical security to be added: {addedSecurity.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 70736;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.145\"},\n            {\"Tracking Error\", \"0.083\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DefaultMarginComboOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of the default position group Not allowing us to fill a combo order above our margin available\n    /// </summary>\n    public class DefaultMarginComboOrderRegressionAlgorithm : NullMarginComboOrderRegressionAlgorithm\n    {\n        protected override void OverrideMarginModels()\n        {\n            // we use the default\n        }\n\n        protected override void AssertState(OrderTicket ticket, int expectedGroupCount, int expectedMarginUsed)\n        {\n            if (ticket.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Unexpected order status {ticket.Status} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.Positions.Groups.Count != 0)\n            {\n                throw new RegressionTestException($\"Unexpected position group count {Portfolio.Positions.Groups.Count} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.TotalMarginUsed != 0)\n            {\n                throw new RegressionTestException($\"Unexpected margin used {Portfolio.TotalMarginUsed} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"73b6f756bf1eacbe11b72be54bc13103\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DefaultMarginMultipleOrdersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of the default position group Not allowing us to fill orders above our margin available\n    /// </summary>\n    public class DefaultMarginMultipleOrdersRegressionAlgorithm : NullMarginMultipleOrdersRegressionAlgorithm\n    {\n        protected override void OverrideMarginModels()\n        {\n            // we use the default\n        }\n\n        protected override void AssertState(OrderTicket ticket, int expectedGroupCount, int expectedMarginUsed)\n        {\n            if (ticket.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Unexpected order status {ticket.Status} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.Positions.Groups.Count != 0)\n            {\n                throw new RegressionTestException($\"Unexpected position group count {Portfolio.Positions.Groups.Count} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.TotalMarginUsed != 0)\n            {\n                throw new RegressionTestException($\"Unexpected margin used {Portfolio.TotalMarginUsed} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f5636192a24570f4a1a95ee49e4073a8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DefaultOptionPriceModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which tests the default option price model\n    /// </summary>\n    /// <meta name=\"tag\" content=\"options\" />\n    public class DefaultOptionPriceModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 4);\n            SetCash(100000);\n\n            AddIndex(\"SPX\");\n            AddIndexOption(\"SPX\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.OptionChains.Any(kvp => kvp.Value.Any(\n                    contract => contract.Greeks.Delta == 0 &&\n                        contract.Greeks.Gamma == 0 && \n                        contract.Greeks.Theta == 0 && \n                        contract.Greeks.Vega == 0 && \n                        contract.Greeks.Rho == 0)))\n            {\n                throw new RegressionTestException(\"All Greeks are zero - Pricing Model is not ready!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2862;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DefaultSchedulingSymbolRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting a default symbol is created using equity market when scheduling if none found\n    /// </summary>\n    public class DefaultSchedulingSymbolRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _implicitChecked;\n        private bool _explicitChecked;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            // implicitly figured usa equity\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(\"AAPL\"), () =>\n            {\n                _implicitChecked = true;\n                if (Time.TimeOfDay != new TimeSpan(9, 30, 0))\n                {\n                    throw new RegressionTestException($\"Unexpected time of day {Time.TimeOfDay}\");\n                }\n            });\n\n            // picked up from cache\n            AddIndex(\"SPX\");\n            Schedule.On(DateRules.Tomorrow, TimeRules.BeforeMarketClose(\"SPX\", extendedMarketClose: true), () =>\n            {\n                _explicitChecked = true;\n                if (Time.TimeOfDay != new TimeSpan(16, 15, 0))\n                {\n                    throw new RegressionTestException($\"Unexpected time of day {Time.TimeOfDay}\");\n                }\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_explicitChecked || !_implicitChecked)\n            {\n                throw new RegressionTestException(\"Failed to run expected checks!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 43;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelayedSettlementAfterManualSecurityRemovalAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing System.Linq;\nusing System;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that delayed cash settlement is applied even when the option contract is manually removed\n    /// </summary>\n    public class DelayedSettlementAfterManualSecurityRemovalAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 31);\n            SetCash(100000);\n\n            var equity = AddEquity(\"GOOG\");\n\n            _optionSymbol = OptionChain(equity.Symbol)\n                .OrderBy(x => x.ID.StrikePrice)\n                .ThenByDescending(x => x.ID.Date)\n                .First(optionContract => optionContract.ID.OptionRight == OptionRight.Call);\n            var option = AddOptionContract(_optionSymbol);\n\n            option.SetSettlementModel(new DelayedSettlementModel(Option.DefaultSettlementDays, Option.DefaultSettlementTime));\n\n            Schedule.On(DateRules.On(StartDate), TimeRules.BeforeMarketClose(_optionSymbol, 30), () =>\n            {\n                MarketOrder(_optionSymbol, 1);\n            });\n\n            Schedule.On(DateRules.On(StartDate), TimeRules.BeforeMarketClose(_optionSymbol, 1), () =>\n            {\n                RemoveOptionContract(_optionSymbol);\n            });\n\n            var expectedSettlementDate = new DateTime(2015, 12, 28);\n\n            Schedule.On(DateRules.On(expectedSettlementDate), TimeRules.AfterMarketOpen(_optionSymbol), () =>\n            {\n                if (Portfolio.UnsettledCash == 0)\n                {\n                    throw new RegressionTestException($\"Expected unsettled cash to be non-zero at {Time}\");\n                }\n            });\n\n            Schedule.On(DateRules.On(expectedSettlementDate), TimeRules.BeforeMarketClose(_optionSymbol), () =>\n            {\n                if (Portfolio.UnsettledCash != 0)\n                {\n                    throw new RegressionTestException($\"Expected unsettled cash to be zero at {Time}\");\n                }\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Transactions.OrdersCount != 2)\n            {\n                throw new RegressionTestException($\"Expected 2 orders, found {Transactions.OrdersCount}\");\n            }\n\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Expected no holdings at end of algorithm\");\n            }\n\n            if (Portfolio.UnsettledCash != 0)\n            {\n                throw new RegressionTestException($\"Expected no unsettled cash at end of algorithm, found {Portfolio.UnsettledCash}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7123;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.73%\"},\n            {\"Compounding Annual Return\", \"-29.516%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99268\"},\n            {\"Net Profit\", \"-0.732%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"2.537\"},\n            {\"Tracking Error\", \"0.104\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$720000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WHEA9CWIDKJQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.63%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d0d7b2b1f483d16e72863ecf3bbc3ed6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistedFutureLiquidateDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduces GH issue 4446, in the case of daily resolution.\n    /// </summary>\n    public class DelistedFutureLiquidateDailyRegressionAlgorithm : DelistedFutureLiquidateRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1235;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"7.78%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"38.609%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107779.1\"},\n            {\"Net Profit\", \"7.779%\"},\n            {\"Sharpe Ratio\", \"3.132\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.474%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.145\"},\n            {\"Beta\", \"0.271\"},\n            {\"Annual Standard Deviation\", \"0.081\"},\n            {\"Annual Variance\", \"0.006\"},\n            {\"Information Ratio\", \"-1.459\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"0.932\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$150000000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"1.98%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"b337ac27f46a6298dd4e9f0f04b49427\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistedFutureLiquidateFromChainAndContinuousMidnightExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that a future contract selected by both the continuous future and\n    /// the future chain universes gets liquidated on delisting and that the algorithm receives the correct\n    /// security addition/removal notifications.\n    ///\n    /// This algorithm uses Gold futures with midnight expiry time to reproduce an edge case where\n    /// the delisting data instance and the universe deselection happen in the same loop but without a particular order.\n    ///\n    /// This partly reproduces GH issue https://github.com/QuantConnect/Lean/issues/9092\n    /// </summary>\n    public class DelistedFutureLiquidateFromChainAndContinuousMidnightExpiryRegressionAlgorithm : DelistedFutureLiquidateFromChainAndContinuousRegressionAlgorithm\n    {\n        protected override string FutureTicker => Futures.Metals.Gold;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 317492;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-5.18%\"},\n            {\"Compounding Annual Return\", \"-20.700%\"},\n            {\"Drawdown\", \"6.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94817.53\"},\n            {\"Net Profit\", \"-5.182%\"},\n            {\"Sharpe Ratio\", \"-2.965\"},\n            {\"Sortino Ratio\", \"-3.407\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.064\"},\n            {\"Beta\", \"-0.2\"},\n            {\"Annual Standard Deviation\", \"0.048\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-4.899\"},\n            {\"Tracking Error\", \"0.11\"},\n            {\"Treynor Ratio\", \"0.716\"},\n            {\"Total Fees\", \"$2.47\"},\n            {\"Estimated Strategy Capacity\", \"$1400000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VL5E74HP3EE5\"},\n            {\"Portfolio Turnover\", \"3.18%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c197fe000cd6d7f2fd84860f7086d730\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistedFutureLiquidateFromChainAndContinuousRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that a future contract selected by both the continuous future and\n    /// the future chain universes gets liquidated on delisting and that the algorithm receives the correct\n    /// security addition/removal notifications.\n    ///\n    /// This partly reproduces GH issue https://github.com/QuantConnect/Lean/issues/9092\n    /// </summary>\n    public class DelistedFutureLiquidateFromChainAndContinuousRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contractSymbol;\n\n        private Future _continuousFuture;\n\n        private DateTime _internalContractRemovalTime;\n        private DateTime _contractRemovalTime;\n\n        protected virtual string FutureTicker => Futures.Indices.SP500EMini;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 12, 30);\n\n            _continuousFuture = AddFuture(FutureTicker);\n            _continuousFuture.SetFilter(0, 182);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_contractSymbol == null)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    // Make sure the mapped contract is in the chain, that is, is selected by both universes\n                    if (chain.Value.Any(x => x.Symbol == _continuousFuture.Mapped))\n                    {\n                        _contractSymbol = _continuousFuture.Mapped;\n                        var ticket = MarketOrder(_contractSymbol, 1);\n\n                        if (ticket.Status != OrderStatus.Filled)\n                        {\n                            throw new RegressionTestException($\"Order should be filled: {ticket}\");\n                        }\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Any(x => x.Symbol == _contractSymbol))\n            {\n                if (_contractRemovalTime != default)\n                {\n                    throw new RegressionTestException($\"Contract {_contractSymbol} was removed multiple times\");\n                }\n                _contractRemovalTime = Time;\n            }\n            else\n            {\n                changes.FilterInternalSecurities = false;\n                if (changes.RemovedSecurities.Any(x => x.Symbol == _contractSymbol))\n                {\n                    if (_internalContractRemovalTime != default)\n                    {\n                        throw new RegressionTestException($\"Contract {_contractSymbol} was removed multiple times as internal subscription\");\n                    }\n                    _internalContractRemovalTime = Time;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_contractSymbol == null)\n            {\n                throw new RegressionTestException(\"No contract was ever traded\");\n            }\n\n            if (_internalContractRemovalTime == default)\n            {\n                throw new RegressionTestException($\"Contract {_contractSymbol} was not removed from the algorithm\");\n            }\n\n            if (_contractRemovalTime == default)\n            {\n                throw new RegressionTestException($\"Contract {_contractSymbol} was not removed from the algorithm as external subscription\");\n            }\n\n            // The internal subscription should be removed first (on continuous future mapping),\n            // and the regular subscription later (on delisting)\n            if (_contractRemovalTime < _internalContractRemovalTime)\n            {\n                throw new RegressionTestException($\"Contract {_contractSymbol} was removed from the algorithm as aregular subscription before internal subscription\");\n            }\n\n            if (Securities[_contractSymbol].Invested)\n            {\n                throw new RegressionTestException($\"Position should be closed when {_contractSymbol} got delisted {_contractSymbol.ID.Date}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{orderEvent}. Delisting on: {_contractSymbol.ID.Date}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 288140;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"7.02%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.386%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107016.6\"},\n            {\"Net Profit\", \"7.017%\"},\n            {\"Sharpe Ratio\", \"3.217\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.828%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.228\"},\n            {\"Beta\", \"0.108\"},\n            {\"Annual Standard Deviation\", \"0.084\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-1.122\"},\n            {\"Tracking Error\", \"0.112\"},\n            {\"Treynor Ratio\", \"2.501\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$1700000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"2.01%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"640ce720644ff0b580687e80105d0a92\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistedFutureLiquidateRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduces GH issue 4446\n    /// </summary>\n    public class DelistedFutureLiquidateRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contractSymbol;\n        private bool _contractRemoved;\n        protected virtual Resolution Resolution => Resolution.Minute;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 12, 30);\n\n            var futureSP500 = AddFuture(Futures.Indices.SP500EMini, Resolution);\n            futureSP500.SetFilter(0, 182);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (_contractSymbol == null)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    var contract = chain.Value.OrderBy(x => x.Expiry).FirstOrDefault();\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        _contractSymbol = contract.Symbol;\n                        MarketOrder(_contractSymbol, 1);\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Any(x => x.Symbol == _contractSymbol))\n            {\n                _contractRemoved = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_contractRemoved)\n            {\n                throw new RegressionTestException($\"Contract {_contractSymbol} was not removed from the algorithm\");\n            }\n\n            Log($\"{_contractSymbol}: {Securities[_contractSymbol].Invested}\");\n            if (Securities[_contractSymbol].Invested)\n            {\n                throw new RegressionTestException($\"Position should be closed when {_contractSymbol} got delisted {_contractSymbol.ID.Date}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{orderEvent}. Delisting on: {_contractSymbol.ID.Date}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 288140;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"7.02%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.386%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107016.6\"},\n            {\"Net Profit\", \"7.017%\"},\n            {\"Sharpe Ratio\", \"3.217\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.828%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.228\"},\n            {\"Beta\", \"0.108\"},\n            {\"Annual Standard Deviation\", \"0.084\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-1.122\"},\n            {\"Tracking Error\", \"0.112\"},\n            {\"Treynor Ratio\", \"2.501\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$1700000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"2.01%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"640ce720644ff0b580687e80105d0a92\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistedIndexOptionDivestedRegression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class DelistedIndexOptionDivestedRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _optionSymbol;\n        private DateTime _optionExpiry = DateTime.MaxValue;\n        private string _ticker;\n        private bool _addOption = true;\n        private bool _receivedWarning;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 3);  //Set Start Date\n            SetEndDate(2021, 1, 20);    //Set End Date\n\n            _ticker = \"SPX\";\n            var spxSecurity = AddIndex(_ticker, Resolution.Minute);\n            spxSecurity.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            _spx = spxSecurity.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.ContainsKey(_spx))\n            {\n                return;\n            }\n\n            if (_addOption)\n            {\n                var contracts = OptionChain(_spx).Where(x => x.ID.OptionRight == OptionRight.Put && x.ID.Date.Date == new DateTime(2021, 1, 15));\n\n                var option = AddIndexOptionContract(contracts.First(), Resolution.Minute);\n                _optionExpiry = option.Expiry;\n                _optionSymbol = option.Symbol;\n\n\n                _addOption = false;\n            }\n\n            if (slice.ContainsKey(_optionSymbol))\n            {\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(_optionSymbol, 0.25);\n                }\n\n                // Verify the order of delisting; warning then delisting\n                Delisting delisting;\n                if (slice.Delistings.TryGetValue(_optionSymbol, out delisting))\n                {\n                    switch (delisting.Type)\n                    {\n                        case DelistingType.Warning:\n                            _receivedWarning = true;\n                            break;\n                        case DelistingType.Delisted:\n                            if (!_receivedWarning)\n                            {\n                                throw new RegressionTestException(\"Did not receive warning before delisting\");\n                            }\n                            break;\n                    }\n                }\n\n                // Verify we aren't receiving expired option data.\n                if (_optionExpiry < Time.Date)\n                {\n                    throw new RegressionTestException($\"Received expired contract {_optionSymbol} expired: {_optionExpiry} current time: {Time}\");\n                }\n            }\n\n        }\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var holding in Portfolio.Values)\n            {\n                Log($\"Holding {holding.Symbol.Value}; Invested: {holding.Invested}; Quantity: {holding.Quantity}\");\n\n                if (holding.Symbol == _optionSymbol && holding.Invested)\n                {\n                    throw new RegressionTestException($\"Index option {_optionSymbol.Value} is still invested after delisting\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17100;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-26.02%\"},\n            {\"Compounding Annual Return\", \"-99.801%\"},\n            {\"Drawdown\", \"46.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"73985\"},\n            {\"Net Profit\", \"-26.015%\"},\n            {\"Sharpe Ratio\", \"-0.605\"},\n            {\"Sortino Ratio\", \"-0.24\"},\n            {\"Probabilistic Sharpe Ratio\", \"19.498%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.541\"},\n            {\"Beta\", \"-0.847\"},\n            {\"Annual Standard Deviation\", \"1.575\"},\n            {\"Annual Variance\", \"2.481\"},\n            {\"Information Ratio\", \"-0.907\"},\n            {\"Tracking Error\", \"1.587\"},\n            {\"Treynor Ratio\", \"1.124\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$1000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX 31KC0UJFOS3N2|SPX 31\"},\n            {\"Portfolio Turnover\", \"1.24%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"eea2a6b8ea827058d695cd5a7bb338ab\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistingEventsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of using the Delisting event in your algorithm. Assets are delisted on their last day of trading, or when their contract expires.\n    /// This data is not included in the open source project.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"data event handlers\" />\n    /// <meta name=\"tag\" content=\"delisting event\" />\n    public class DelistingEventsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _receivedDelistedWarningEvent;\n        private bool _receivedDelistedEvent;\n        private int _receivedSecurityChangesEvent;\n        private int _dataCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2007, 05, 15);  //Set Start Date\n            SetEndDate(2007, 05, 25);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"AAA.1\", Resolution.Daily);\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _dataCount += slice.Bars.Count;\n            if (Transactions.OrdersCount == 0)\n            {\n                SetHoldings(\"AAA.1\", 1);\n                Debug(\"Purchased Stock\");\n            }\n\n            foreach (var kvp in slice.Bars)\n            {\n                var symbol = kvp.Key;\n                var tradeBar = kvp.Value;\n                Debug($\"OnData(Slice): {Time}: {symbol}: {tradeBar.Close.ToStringInvariant(\"0.00\")}\");\n            }\n\n            // the slice can also contain delisting data: data.Delistings in a dictionary string->Delisting\n\n            var aaa = Securities[\"AAA.1\"];\n            if (aaa.IsDelisted && aaa.IsTradable)\n            {\n                throw new RegressionTestException(\"Delisted security must NOT be tradable\");\n            }\n            if (!aaa.IsDelisted && !aaa.IsTradable)\n            {\n                throw new RegressionTestException(\"Securities must be marked as tradable until they're delisted or removed from the universe\");\n            }\n\n            foreach (var kvp in slice.Delistings)\n            {\n                var symbol = kvp.Key;\n                var delisting = kvp.Value;\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    _receivedDelistedWarningEvent = true;\n                    Debug($\"OnData(Delistings): {Time}: {symbol} will be delisted at end of day today.\");\n\n                    // liquidate on delisting warning\n                    SetHoldings(symbol, 0);\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    _receivedDelistedEvent = true;\n                    Debug($\"OnData(Delistings): {Time}: {symbol} has been delisted.\");\n\n                    // fails because the security has already been delisted and is no longer tradable\n                    SetHoldings(symbol, 1);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"OnOrderEvent(OrderEvent): {Time}: {orderEvent}\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var removedSecurity in changes.RemovedSecurities)\n            {\n                if (removedSecurity.Symbol.Value == \"AAA.1\")\n                {\n                    _receivedSecurityChangesEvent++;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedDelistedEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected delisted event\");\n            }\n            if (!_receivedDelistedWarningEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected delisted warning event\");\n            }\n            if (_dataCount != 13)\n            {\n                throw new RegressionTestException($\"Unexpected data count {_dataCount}. Expected 13\");\n            }\n            if (_receivedSecurityChangesEvent != 1)\n            {\n                throw new RegressionTestException($\"Did not receive expected security changes removal! Got {_receivedSecurityChangesEvent}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 87;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-5.58%\"},\n            {\"Compounding Annual Return\", \"-85.973%\"},\n            {\"Drawdown\", \"5.600%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94421.6\"},\n            {\"Net Profit\", \"-5.578%\"},\n            {\"Sharpe Ratio\", \"-5.495\"},\n            {\"Sortino Ratio\", \"-10.306\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.585\"},\n            {\"Beta\", \"-1.085\"},\n            {\"Annual Standard Deviation\", \"0.15\"},\n            {\"Annual Variance\", \"0.023\"},\n            {\"Information Ratio\", \"-5.081\"},\n            {\"Tracking Error\", \"0.206\"},\n            {\"Treynor Ratio\", \"0.76\"},\n            {\"Total Fees\", \"$36.70\"},\n            {\"Estimated Strategy Capacity\", \"$110000.00\"},\n            {\"Lowest Capacity Asset\", \"AAA SEVKGI6HF885\"},\n            {\"Portfolio Turnover\", \"18.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1450ea23a3a1ef4ee2398ec757c39223\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistingFutureOptionDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue #5160 where delisting order would be cancelled because it was placed at the market close on the delisting day,\n    /// in the case of daily resolution.\n    /// </summary>\n    public class DelistingFutureOptionDailyRegressionAlgorithm : DelistingFutureOptionRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1380;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"-0.134%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-0.429\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9997036.08\"},\n            {\"Net Profit\", \"-0.030%\"},\n            {\"Sharpe Ratio\", \"-31.58\"},\n            {\"Sortino Ratio\", \"-7.862\"},\n            {\"Probabilistic Sharpe Ratio\", \"2.982%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.14\"},\n            {\"Alpha\", \"-0.02\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.511\"},\n            {\"Tracking Error\", \"0.429\"},\n            {\"Treynor Ratio\", \"-84.756\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$540000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLDRF238K|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"0.04%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"11ac76bc66928a5e97e064281f6e7ef5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DelistingFutureOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue #5160 where delisting order would be cancelled because it was placed at the market close on the delisting day\n    /// </summary>\n    public class DelistingFutureOptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual Resolution Resolution => Resolution.Minute;\n        private bool _traded;\n        private int _lastMonth;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 3);\n            SetEndDate(2020, 3, 23);\n            SetCash(10000000);\n\n            var future = AddFuture(Futures.Indices.SP500EMini, Resolution, Market.CME);\n            future.SetFilter(1, 120);\n\n            AddFutureOption(future.Symbol, universe => universe.Strikes(-2, 2));\n            _lastMonth = -1;\n\n            // This is required to prevent the algorithm from automatically delisting the underlying. Without this, future options will be subscribed\n            // with resolution default to Minute insted of this.Resolution. This could be replaced after GH issue #6491 is implemented.\n            UniverseSettings.Resolution = Resolution;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Month != _lastMonth)\n            {\n                _lastMonth = Time.Month;\n                var investedSymbols = Securities.Values\n                    .Where(security => security.Invested)\n                    .Select(security => security.Symbol)\n                    .ToList();\n\n                var delistedSecurity = investedSymbols.Where(symbol => symbol.ID.Date.AddDays(1) < Time).ToList();\n                if (delistedSecurity.Count > 0)\n                {\n                    throw new RegressionTestException($\"[{UtcTime}] We hold a delisted securities: {string.Join(\",\", delistedSecurity)}\");\n                }\n                Log($\"Holdings({Time}): {string.Join(\",\", investedSymbols)}\");\n            }\n\n            if (Portfolio.Invested)\n            {\n                return;\n            }\n\n            foreach (var chain in slice.OptionChains.Values)\n            {\n                foreach (var contractsValue in chain.Contracts.Values)\n                {\n                    MarketOrder(contractsValue.Symbol, 1);\n                    _traded = true;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_traded)\n            {\n                throw new RegressionTestException(\"We expected some FOP trading to happen\");\n            }\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"We shouldn't be invested anymore\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 462641;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"17\"},\n            {\"Average Win\", \"0.04%\"},\n            {\"Average Loss\", \"-0.04%\"},\n            {\"Compounding Annual Return\", \"-1.280%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-0.791\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9971576.14\"},\n            {\"Net Profit\", \"-0.284%\"},\n            {\"Sharpe Ratio\", \"-5.765\"},\n            {\"Sortino Ratio\", \"-0.931\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.062%\"},\n            {\"Loss Rate\", \"89%\"},\n            {\"Win Rate\", \"11%\"},\n            {\"Profit-Loss Ratio\", \"0.88\"},\n            {\"Alpha\", \"-0.027\"},\n            {\"Beta\", \"0.002\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.495\"},\n            {\"Tracking Error\", \"0.429\"},\n            {\"Treynor Ratio\", \"-15.266\"},\n            {\"Total Fees\", \"$11.36\"},\n            {\"Estimated Strategy Capacity\", \"$65000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLDQR8R1G|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"0.16%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f9210adc1afc4460146528006675e734\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DescendingCustomDataObjectStoreRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// The regression algorithm showcases the utilization of a custom data source with the Sort flag set to true.\n    /// This means that the source initially provides data in descending order, which is then organized into ascending order and returned in the <see cref=\"OnData(Slice)\"/> function.\n    /// </summary>\n    public class DescendingCustomDataObjectStoreRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual string CustomDataKey => \"CustomData/SortCustomData\";\n\n        protected readonly static string[] descendingCustomData = new string[]\n        {\n            \"2024-10-03 19:00:00,173.5,176.0,172.0,175.2,120195681,4882.29\",\n            \"2024-10-02 18:00:00,174.0,177.0,173.0,175.8,116275729,4641.97\",\n            \"2024-10-01 17:00:00,175.0,178.0,172.5,174.5,127707078,6591.27\",\n            \"2024-09-30 11:00:00,174.8,176.5,172.8,175.0,127707078,6591.27\",\n            \"2024-09-27 10:00:00,172.5,175.0,171.5,173.5,120195681,4882.29\",\n            \"2024-09-26 09:00:00,171.0,172.5,170.0,171.8,117516350,4820.53\",\n            \"2024-09-25 08:00:00,169.5,172.0,169.0,171.0,110427867,4661.55\",\n            \"2024-09-24 07:00:00,170.0,171.0,168.0,169.5,127624733,4823.52\",\n            \"2024-09-23 06:00:00,172.0,173.5,169.5,171.5,123586417,4303.93\",\n            \"2024-09-20 05:00:00,168.0,171.0,167.5,170.5,151929179,5429.87\",\n            \"2024-09-19 04:00:00,170.5,171.5,166.0,167.0,160523863,5219.24\",\n            \"2024-09-18 03:00:00,173.0,174.0,169.0,172.0,145721790,5163.09\",\n            \"2024-09-17 02:00:00,171.0,173.5,170.0,172.5,144794030,5405.72\",\n            \"2024-09-16 01:00:00,168.0,171.0,167.0,170.0,214402430,8753.33\",\n            \"2024-09-13 16:00:00,173.5,176.0,172.0,175.2,120195681,4882.29\",\n            \"2024-09-12 15:00:00,174.5,177.5,173.5,176.5,171728134,7774.83\",\n            \"2024-09-11 14:00:00,175.0,178.0,174.0,175.5,191516153,8349.59\",\n            \"2024-09-10 13:00:00,174.5,176.0,173.0,174.0,151162819,5915.8\",\n            \"2024-09-09 12:00:00,176.0,178.0,175.0,177.0,116275729,4641.97\"\n        };\n\n        private Symbol _customSymbol;\n\n        private List<SortCustomData> _receivedData = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2024, 09, 09);\n            SetEndDate(2024, 10, 03);\n            SetCash(100000);\n\n            SetBenchmark(x => 0);\n\n            SortCustomData.CustomDataKey = CustomDataKey;\n\n            _customSymbol = AddData<SortCustomData>(\"SortCustomData\", Resolution.Daily).Symbol;\n\n            // Saving data here for demonstration and regression testing purposes.\n            // In real scenarios, data has to be saved to the object store before the algorithm starts.\n            ObjectStore.Save(CustomDataKey, string.Join(\"\\n\", descendingCustomData));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(_customSymbol))\n            {\n                var sortCustomData = slice.Get<SortCustomData>(_customSymbol);\n                if (sortCustomData.Open == 0 || sortCustomData.High == 0 || sortCustomData.Low == 0 || sortCustomData.Close == 0 || sortCustomData.Price == 0)\n                {\n                    throw new RegressionTestException(\"One or more custom data fields (Open, High, Low, Close, Price) are zero.\");\n                }\n\n                _receivedData.Add(sortCustomData);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_receivedData.Count == 0)\n            {\n                throw new RegressionTestException(\"Custom data was not fetched\");\n            }\n\n            var history = History<SortCustomData>(_customSymbol, StartDate, EndDate, Resolution.Hour).ToList();\n\n            if (history.Count != _receivedData.Count)\n            {\n                throw new RegressionTestException(\"History request returned different data than expected\");\n            }\n\n            // Iterate through the history collection, checking if the EndTime is in ascending order.\n            for (int i = 0; i < history.Count - 1; i++)\n            {\n                if (history[i].EndTime > history[i + 1].EndTime)\n                {\n                    throw new RegressionTestException($\"Order failure: {history[i].EndTime} > {history[i + 1].EndTime} at index {i}.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages => new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all TimeSlices of algorithm\n        /// </summary>\n        public long DataPoints => 20;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 19;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new ()\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n\n    public class SortCustomData : BaseData\n    {\n        public static string CustomDataKey { get; set; }\n\n        public decimal Open { get; set; }\n        public decimal High { get; set; }\n        public decimal Low { get; set; }\n        public decimal Close { get; set; }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(CustomDataKey, SubscriptionTransportMedium.ObjectStore, FileFormat.Csv)\n            {\n                // Indicate that the data from the subscription will be returned in descending order.\n                Sort = true\n            };\n        }\n\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var csv = line.Split(\",\");\n            var data = new SortCustomData()\n            {\n                Symbol = config.Symbol,\n                Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture),\n                Value = csv[4].ToDecimal(),\n                Open = csv[1].ToDecimal(),\n                High = csv[2].ToDecimal(),\n                Low = csv[3].ToDecimal(),\n                Close = csv[4].ToDecimal()\n            };\n\n            return data;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DisplacedMovingAverageRibbon.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Constructs a displaced moving average ribbon and buys when all are lined up, liquidates when they all line down\n    /// Ribbons are great for visualizing trends\n    ///   Signals are generated when they all line up in a paricular direction\n    ///     A buy signal is when the values of the indicators are increasing (from slowest to fastest).\n    ///     A sell signal is when the values of the indicators are decreasing (from slowest to fastest).\n    /// </summary>\n    public class DisplacedMovingAverageRibbon : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private IndicatorBase<IndicatorDataPoint>[] _ribbon;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <meta name=\"tag\" content=\"charting\" />\n        /// <meta name=\"tag\" content=\"plotting indicators\" />\n        /// <seealso cref=\"QCAlgorithm.SetStartDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetEndDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetCash(decimal)\"/>\n        public override void Initialize()\n        {\n            SetStartDate(2009, 01, 01);\n            SetEndDate(2015, 01, 01);\n\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily);\n\n            const int count = 6;\n            const int offset = 5;\n            const int period = 15;\n\n            // define our sma as the base of the ribbon\n            var sma = new SimpleMovingAverage(period);\n\n            _ribbon = Enumerable.Range(0, count).Select(x =>\n            {\n                // define our offset to the zero sma, these various offsets will create our 'displaced' ribbon\n                var delay = new Delay(offset*(x+1));\n\n                // define an indicator that takes the output of the sma and pipes it into our delay indicator\n                var delayedSma = delay.Of(sma);\n\n                // register our new 'delayedSma' for automatic updates on a daily resolution\n                RegisterIndicator(_spy, delayedSma, Resolution.Daily, data => data.Value);\n\n                return delayedSma;\n            }).ToArray();\n        }\n\n        private DateTime _previous;\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // wait for our entire ribbon to be ready\n            if (!_ribbon.All(x => x.IsReady)) return;\n\n            // only once per day\n            if (_previous.Date == Time.Date) return;\n\n            var data = slice[_spy];\n            if (data == null)\n            {\n                // at midnight we can get dividend call, not price data\n                return;\n            }\n            Plot(\"Ribbon\", \"Price\", data.Price);\n            Plot(\"Ribbon\", _ribbon);\n\n\n            // check for a buy signal\n            var values = _ribbon.Select(x => x.Current.Value).ToArray();\n\n            var holding = Portfolio[_spy];\n            if (holding.Quantity <= 0 && IsAscending(values))\n            {\n                SetHoldings(_spy, 1.0);\n            }\n            else if (holding.Quantity > 0 && IsDescending(values))\n            {\n                Liquidate(_spy);\n            }\n\n            _previous = Time;\n        }\n\n        /// <summary>\n        /// Returns true if the specified values are in ascending order\n        /// </summary>\n        private bool IsAscending(IEnumerable<decimal> values)\n        {\n            decimal? last = null;\n            foreach (var val in values)\n            {\n                if (last == null)\n                {\n                    last = val;\n                    continue;\n                }\n\n                if (last.Value < val)\n                {\n                    return false;\n                }\n                last = val;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the specified values are in descending order\n        /// </summary>\n        private bool IsDescending(IEnumerable<decimal> values)\n        {\n            decimal? last = null;\n            foreach (var val in values)\n            {\n                if (last == null)\n                {\n                    last = val;\n                    continue;\n                }\n\n                if (last.Value > val)\n                {\n                    return false;\n                }\n                last = val;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 12073;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"19.17%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"16.731%\"},\n            {\"Drawdown\", \"12.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"253075.04\"},\n            {\"Net Profit\", \"153.075%\"},\n            {\"Sharpe Ratio\", \"1.05\"},\n            {\"Sortino Ratio\", \"1.078\"},\n            {\"Probabilistic Sharpe Ratio\", \"56.405%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.051\"},\n            {\"Beta\", \"0.507\"},\n            {\"Annual Standard Deviation\", \"0.107\"},\n            {\"Annual Variance\", \"0.011\"},\n            {\"Information Ratio\", \"-0.083\"},\n            {\"Tracking Error\", \"0.105\"},\n            {\"Treynor Ratio\", \"0.221\"},\n            {\"Total Fees\", \"$49.40\"},\n            {\"Estimated Strategy Capacity\", \"$1100000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.32%\"},\n            {\"Drawdown Recovery\", \"268\"},\n            {\"OrderListHash\", \"1ea790ca8afdcad02b98c70e89652562\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DividendAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of payments for cash dividends in backtesting. When data normalization mode is set\n    /// to \"Raw\" the dividends are paid as cash directly into your portfolio.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"data event handlers\" />\n    /// <meta name=\"tag\" content=\"dividend event\" />\n    public class DividendAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(1998, 01, 01);  //Set Start Date\n            SetEndDate(2006, 01, 01);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"MSFT\", Resolution.Daily);\n            Securities[\"MSFT\"].SetDataNormalizationMode(DataNormalizationMode.Raw);\n\n            // this will use the Tradier Brokerage open order split behavior\n            //     forward split will modify open order to maintain order value\n            //     reverse split open orders will be cancelled\n            SetBrokerageModel(BrokerageName.TradierBrokerage);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public void OnData(TradeBars data)\n        {\n            if (Transactions.OrdersCount == 0)\n            {\n                SetHoldings(\"MSFT\", .5);\n                // place some orders that won't fill, when the split comes in they'll get modified to reflect the split\n                Debug(\"Purchased Stock: \" + Securities[\"MSFT\"].Price);\n                StopMarketOrder(\"MSFT\", -CalculateOrderQuantity(\"MSFT\", .25), data[\"MSFT\"].Low/2);\n                LimitOrder(\"MSFT\", -CalculateOrderQuantity(\"MSFT\", .25), data[\"MSFT\"].High*2);\n            }\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"data\">Data.</param>\n        public void OnData(Dividends data) // update this to Dividends dictionary\n        {\n            var dividend = data[\"MSFT\"];\n            Debug($\"{dividend.Time.ToStringInvariant(\"o\")} >> DIVIDEND >> {dividend.Symbol} - \" +\n                $\"{dividend.Distribution.ToStringInvariant(\"C\")} - {Portfolio.Cash} - \" +\n                $\"{Portfolio[\"MSFT\"].Price.ToStringInvariant(\"C\")}\"\n            );\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"data\">Data.</param>\n        public void OnData(Splits data)\n        {\n            Debug(\"MSFT: \" + Securities[\"MSFT\"].Price);\n            var split = data[\"MSFT\"];\n            Debug($\"{split.Time.ToIso8601Invariant()} >> SPLIT >> {split.Symbol} - \" +\n                $\"{split.SplitFactor.ToStringInvariant()} - \" +\n                $\"{Portfolio.Cash.ToStringInvariant()} - \" +\n                $\"{Portfolio[\"MSFT\"].Quantity.ToStringInvariant()}\"\n            );\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // orders get adjusted based on split events to maintain order value\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            Debug($\"{Time.ToStringInvariant()} >> ORDER >> {order}\");\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/DividendRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of payments for cash dividends in backtesting. When data normalization mode is set\n    /// to \"Raw\" the dividends are paid as cash directly into your portfolio.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"data event handlers\" />\n    /// <meta name=\"tag\" content=\"dividend event\" />\n    public class DividendRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private decimal _sumOfDividends;\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(1998, 01, 01);  //Set Start Date\n            SetEndDate(2006, 01, 01);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            _symbol = AddEquity(\"SPY\", Resolution.Daily,\n                dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested) return;\n            SetHoldings(_symbol, .5);\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"dividends\">Data.</param>\n        public override void OnDividends(Dividends dividends) // update this to Dividends dictionary\n        {\n            var dividend = dividends[_symbol];\n            var holdings = Portfolio[_symbol];\n            Debug($\"{dividend.Time.ToStringInvariant(\"o\")} >> DIVIDEND >> {dividend.Symbol} - \" +\n                $\"{dividend.Distribution.ToStringInvariant(\"C\")} - {Portfolio.Cash} - \" +\n                $\"{holdings.Price.ToStringInvariant(\"C\")}\"\n            );\n            _sumOfDividends += dividend.Distribution * holdings.Quantity;\n        }\n        \n        public override void OnEndOfAlgorithm()\n        {\n            // The expected value refers to sum of dividend payments\n            if (Portfolio.TotalProfit != _sumOfDividends)\n            {\n                throw new RegressionTestException($\"Total Profit: Expected {_sumOfDividends}. Actual {Portfolio.TotalProfit}\");\n            }\n\n            var expectNetProfit = _sumOfDividends - Portfolio.TotalFees;\n            if (Portfolio.TotalNetProfit != expectNetProfit)\n            {\n                throw new RegressionTestException($\"Total Net Profit: Expected {expectNetProfit}. Actual {Portfolio.TotalNetProfit}\");\n            }\n\n            if (Portfolio[_symbol].TotalDividends != _sumOfDividends)\n            {\n                throw new RegressionTestException($\"{_symbol} Total Dividends: Expected {_sumOfDividends}. Actual {Portfolio[_symbol].TotalDividends}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 16077;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"2.354%\"},\n            {\"Drawdown\", \"28.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"120462.08\"},\n            {\"Net Profit\", \"20.462%\"},\n            {\"Sharpe Ratio\", \"-0.063\"},\n            {\"Sortino Ratio\", \"-0.078\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.462%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.016\"},\n            {\"Beta\", \"0.521\"},\n            {\"Annual Standard Deviation\", \"0.083\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-0.328\"},\n            {\"Tracking Error\", \"0.076\"},\n            {\"Treynor Ratio\", \"-0.01\"},\n            {\"Total Fees\", \"$2.56\"},\n            {\"Estimated Strategy Capacity\", \"$36000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"126\"},\n            {\"OrderListHash\", \"8068ff5f4917787e48d90fda94de340c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DropboxBaseDataUniverseSelectionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we show how you can easily use the universe selection feature to fetch symbols\n    /// to be traded using the BaseData custom data system in combination with the AddUniverse{T} method.\n    /// AddUniverse{T} requires a function that will return the symbols to be traded.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"custom universes\" />\n    public class DropboxBaseDataUniverseSelectionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // the changes from the previous universe selection\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <seealso cref=\"QCAlgorithm.SetStartDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetEndDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetCash(decimal)\"/>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2017, 07, 06);\n            SetEndDate(2018, 07, 04);\n\n            var universe = AddUniverse<StockDataSource>(stockDataSource =>\n            {\n                return stockDataSource.OfType<StockDataSource>().SelectMany(x => x.Symbols);\n            });\n\n            var historicalSelectionData = History(universe, 3).ToList();\n            if (historicalSelectionData.Count != 3)\n            {\n                throw new RegressionTestException($\"Unexpected universe data count {historicalSelectionData.Count}\");\n            }\n\n            foreach (var universeData in historicalSelectionData)\n            {\n                var stockDataSource = (StockDataSource)universeData.Single();\n                if (stockDataSource.Symbols.Count != 5)\n                {\n                    throw new RegressionTestException($\"Unexpected universe data receieved\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <code>\n        /// TradeBars bars = slice.Bars;\n        /// Ticks ticks = slice.Ticks;\n        /// TradeBar spy = slice[\"SPY\"];\n        /// List{Tick} aaplTicks = slice[\"AAPL\"]\n        /// Quandl oil = slice[\"OIL\"]\n        /// dynamic anySymbol = slice[symbol];\n        /// DataDictionary{Quandl} allQuandlData = slice.Get{Quand}\n        /// Quandl oil = slice.Get{Quandl}(\"OIL\")\n        /// </code>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Bars.Count == 0) return;\n            if (_changes == SecurityChanges.None) return;\n\n            // start fresh\n\n            Liquidate();\n\n            var percentage = 1m / slice.Bars.Count;\n            foreach (var tradeBar in slice.Bars.Values)\n            {\n                SetHoldings(tradeBar.Symbol, percentage);\n            }\n\n            // reset changes\n            _changes = SecurityChanges.None;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\"></param>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // each time our securities change we'll be notified here\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// Our custom data type that defines where to get and how to read our backtest and live data.\n        /// </summary>\n        class StockDataSource : BaseDataCollection\n        {\n            private const string LiveUrl = @\"https://www.dropbox.com/s/2l73mu97gcehmh7/daily-stock-picker-live.csv?dl=1\";\n            private const string BacktestUrl = @\"https://www.dropbox.com/s/ae1couew5ir3z9y/daily-stock-picker-backtest.csv?dl=1\";\n\n            /// <summary>\n            /// The symbols to be selected\n            /// </summary>\n            public List<string> Symbols { get; set; }\n\n            /// <summary>\n            /// Required default constructor\n            /// </summary>\n            public StockDataSource()\n            {\n                // initialize our list to empty\n                Symbols = new List<string>();\n            }\n\n            /// <summary>\n            /// Return the URL string source of the file. This will be converted to a stream\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var url = isLiveMode ? LiveUrl : BacktestUrl;\n                return new SubscriptionDataSource(url, SubscriptionTransportMedium.RemoteFile, FileFormat.FoldingCollection);\n            }\n\n            /// <summary>\n            /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n            /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n            /// </summary>\n            /// <param name=\"config\">Subscription data config setup object</param>\n            /// <param name=\"line\">Line of the source document</param>\n            /// <param name=\"date\">Date of the requested data</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                try\n                {\n                    // create a new StockDataSource and set the symbol using config.Symbol\n                    var stocks = new StockDataSource {Symbol = config.Symbol};\n                    // break our line into csv pieces\n                    var csv = line.ToCsv();\n                    if (isLiveMode)\n                    {\n                        // our live mode format does not have a date in the first column, so use date parameter\n                        stocks.Time = date;\n                        stocks.Symbols.AddRange(csv);\n                    }\n                    else\n                    {\n                        // our backtest mode format has the first column as date, parse it\n                        stocks.Time = DateTime.ParseExact(csv[0], \"yyyyMMdd\", null);\n                        // any following comma separated values are symbols, save them off\n                        stocks.Symbols.AddRange(csv.Skip(1));\n                    }\n                    return stocks;\n                }\n                // return null if we encounter any errors\n                catch { return null; }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5269;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 3;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6415\"},\n            {\"Average Win\", \"0.07%\"},\n            {\"Average Loss\", \"-0.07%\"},\n            {\"Compounding Annual Return\", \"15.655%\"},\n            {\"Drawdown\", \"10.500%\"},\n            {\"Expectancy\", \"0.071\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"115562.68\"},\n            {\"Net Profit\", \"15.563%\"},\n            {\"Sharpe Ratio\", \"0.844\"},\n            {\"Sortino Ratio\", \"0.788\"},\n            {\"Probabilistic Sharpe Ratio\", \"48.632%\"},\n            {\"Loss Rate\", \"46%\"},\n            {\"Win Rate\", \"54%\"},\n            {\"Profit-Loss Ratio\", \"0.98\"},\n            {\"Alpha\", \"0.008\"},\n            {\"Beta\", \"0.986\"},\n            {\"Annual Standard Deviation\", \"0.11\"},\n            {\"Annual Variance\", \"0.012\"},\n            {\"Information Ratio\", \"0.155\"},\n            {\"Tracking Error\", \"0.041\"},\n            {\"Treynor Ratio\", \"0.094\"},\n            {\"Total Fees\", \"$7460.54\"},\n            {\"Estimated Strategy Capacity\", \"$450000.00\"},\n            {\"Lowest Capacity Asset\", \"BNO UN3IMQ2JU1YD\"},\n            {\"Portfolio Turnover\", \"135.63%\"},\n            {\"Drawdown Recovery\", \"36\"},\n            {\"OrderListHash\", \"29c715831bd675f04226f9fd8855a52e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DropboxUniverseSelectionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we show how you can easily use the universe selection feature to fetch symbols\n    /// to be traded using the AddUniverse method. This method accepts a function that will return the\n    /// desired current set of symbols. Return Universe.Unchanged if no universe changes should be made\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"custom universes\" />\n    public class DropboxUniverseSelectionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // the changes from the previous universe selection\n        private SecurityChanges _changes = SecurityChanges.None;\n        // only used in backtest for caching the file results\n        private readonly Dictionary<DateTime, List<string>> _backtestSymbolsPerDay = new Dictionary<DateTime, List<string>>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <seealso cref=\"QCAlgorithm.SetStartDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetEndDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetCash(decimal)\"/>\n        public override void Initialize()\n        {\n            // this sets the resolution for data subscriptions added by our universe\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            // set our start and end for backtest mode\n            SetStartDate(2017, 07, 04);\n            SetEndDate(2018, 07, 04);\n\n            // define a new custom universe that will trigger each day at midnight\n            AddUniverse(\"my-dropbox-universe\", Resolution.Daily, dateTime =>\n            {\n                // handle live mode file format\n                if (LiveMode)\n                {\n                    // fetch the file from dropbox\n                    var file = Download(@\"https://www.dropbox.com/s/2l73mu97gcehmh7/daily-stock-picker-live.csv?dl=1\");\n                    // if we have a file for today, break apart by commas and return symbols\n                    if (file.Length > 0) return file.ToCsv();\n                    // no symbol today, leave universe unchanged\n                    return Universe.Unchanged;\n                }\n\n                // backtest - first cache the entire file\n                if (_backtestSymbolsPerDay.Count == 0)\n                {\n                    // No need for headers for authorization with dropbox, these two lines are for example purposes\n                    var byteKey = Encoding.ASCII.GetBytes($\"UserName:Password\");\n                    // The headers must be passed to the Download method as list of key/value pair.\n                    var headers = new List<KeyValuePair<string, string>>\n                    {\n                        new KeyValuePair<string, string>(\"Authorization\", $\"Basic ({Convert.ToBase64String(byteKey)})\")\n                    };\n\n                    var file = Download(@\"https://www.dropbox.com/s/ae1couew5ir3z9y/daily-stock-picker-backtest.csv?dl=1\", headers);\n\n                    // split the file into lines and add to our cache\n                    foreach (var line in file.Split(new[] { '\\n', '\\r' }, StringSplitOptions.RemoveEmptyEntries))\n                    {\n                        var csv = line.ToCsv();\n                        var date = DateTime.ParseExact(csv[0], \"yyyyMMdd\", null);\n                        var symbols = csv.Skip(1).ToList();\n                        _backtestSymbolsPerDay[date] = symbols;\n                    }\n                }\n\n                // if we have symbols for this date return them, else specify Universe.Unchanged\n                List<string> result;\n                if (_backtestSymbolsPerDay.TryGetValue(dateTime.Date, out result))\n                {\n                    return result;\n                }\n                return Universe.Unchanged;\n            });\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <code>\n        /// TradeBars bars = slice.Bars;\n        /// Ticks ticks = slice.Ticks;\n        /// TradeBar spy = slice[\"SPY\"];\n        /// List{Tick} aaplTicks = slice[\"AAPL\"]\n        /// Quandl oil = slice[\"OIL\"]\n        /// dynamic anySymbol = slice[symbol];\n        /// DataDictionary{Quandl} allQuandlData = slice.Get{Quand}\n        /// Quandl oil = slice.Get{Quandl}(\"OIL\")\n        /// </code>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Bars.Count == 0) return;\n            if (_changes == SecurityChanges.None) return;\n\n            // start fresh\n            Liquidate();\n\n            var percentage = 1m/slice.Bars.Count;\n            foreach (var tradeBar in slice.Bars.Values)\n            {\n                SetHoldings(tradeBar.Symbol, percentage);\n            }\n\n            // reset changes\n            _changes = SecurityChanges.None;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\"></param>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // each time our securities change we'll be notified here\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5278;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5059\"},\n            {\"Average Win\", \"0.08%\"},\n            {\"Average Loss\", \"-0.07%\"},\n            {\"Compounding Annual Return\", \"16.423%\"},\n            {\"Drawdown\", \"10.500%\"},\n            {\"Expectancy\", \"0.081\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"116400.57\"},\n            {\"Net Profit\", \"16.401%\"},\n            {\"Sharpe Ratio\", \"0.891\"},\n            {\"Sortino Ratio\", \"0.831\"},\n            {\"Probabilistic Sharpe Ratio\", \"50.543%\"},\n            {\"Loss Rate\", \"47%\"},\n            {\"Win Rate\", \"53%\"},\n            {\"Profit-Loss Ratio\", \"1.03\"},\n            {\"Alpha\", \"0.018\"},\n            {\"Beta\", \"0.984\"},\n            {\"Annual Standard Deviation\", \"0.11\"},\n            {\"Annual Variance\", \"0.012\"},\n            {\"Information Ratio\", \"0.416\"},\n            {\"Tracking Error\", \"0.041\"},\n            {\"Treynor Ratio\", \"0.099\"},\n            {\"Total Fees\", \"$5848.25\"},\n            {\"Estimated Strategy Capacity\", \"$510000.00\"},\n            {\"Lowest Capacity Asset\", \"BNO UN3IMQ2JU1YD\"},\n            {\"Portfolio Turnover\", \"106.75%\"},\n            {\"Drawdown Recovery\", \"36\"},\n            {\"OrderListHash\", \"5499e61404d453274cee78904d4c0e92\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that open orders are canceled when the option is assigned and delisted,\n    /// also making sure the assignment happens and its processed regardless of the existing of an open order for said option.\n    /// </summary>\n    public class DuplicateOptionAssignmentRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _stock;\n        private Symbol _option;\n\n        private bool _optionSold;\n        private bool _optionAssigned;\n        private bool _optionDelisted;\n        private bool _optionDelistedWarningReceived;\n        private bool _orderCanceled;\n        private bool _stockAssigned;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 17);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            _stock = AddEquity(\"GOOG\").Symbol;\n\n            _option = QuantConnect.Symbol.CreateOption(_stock, Market.USA, OptionStyle.American, OptionRight.Put, 800m, new DateTime(2015, 12, 24));\n\n            AddOptionContract(_option);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // We are done\n            if (_optionSold)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                Sell(_option, 1);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                // This is the fill for the option sell order\n                if (!_optionSold)\n                {\n                    // Let's close the position but with a limit order that won't ever fill (limit price too low)\n                    // just so we keep it open until the brokerage tries to assign it\n                    LimitOrder(_option, 1, Securities[_option].Price * 0.1m);\n\n                    _optionSold = true;\n                }\n                // This is the assignment\n                else if (!_optionAssigned)\n                {\n                    if (orderEvent.Ticket.OrderType != OrderType.OptionExercise || !orderEvent.IsAssignment)\n                    {\n                        throw new RegressionTestException($\"Expected option assignment but got: {orderEvent}\");\n                    }\n\n                    _optionAssigned = true;\n                }\n                else if (!_stockAssigned)\n                {\n                    if (orderEvent.Ticket.OrderType != OrderType.OptionExercise || orderEvent.IsAssignment || orderEvent.Symbol != _stock)\n                    {\n                        throw new RegressionTestException($\"Expected stock assignment but got: {orderEvent}\");\n                    }\n\n                    _stockAssigned = true;\n                }\n                else\n                {\n                    throw new RegressionTestException($\"Unexpected order fill event: {orderEvent}\");\n                }\n            }\n            else if (orderEvent.Status == OrderStatus.CancelPending)\n            {\n                // We receive the delisting warning before the order cancel is requested\n                if (!_optionSold || !_optionAssigned || !_stockAssigned || !_optionDelistedWarningReceived)\n                {\n                    throw new RegressionTestException($\"Unexpected cancel pending event: {orderEvent}\");\n                }\n            }\n            else if (orderEvent.Status == OrderStatus.Canceled)\n            {\n                // The delisted event is received before the order is canceled\n                if (!_optionSold || !_optionAssigned || !_stockAssigned || !_optionDelistedWarningReceived || !_optionDelisted)\n                {\n                    throw new RegressionTestException($\"Unexpected cancel event: {orderEvent}\");\n                }\n\n                _orderCanceled = true;\n            }\n        }\n\n        public override void OnDelistings(Delistings delistings)\n        {\n            if (!delistings.TryGetValue(_option, out var delisting))\n            {\n                throw new RegressionTestException($\"Unexpected delisting events\");\n            }\n\n            if (delisting.Type == DelistingType.Warning)\n            {\n                if (!_optionSold || !_optionAssigned || !_stockAssigned || _optionDelistedWarningReceived)\n                {\n                    throw new RegressionTestException($\"Unexpected delisting warning event: {delisting}\");\n                }\n\n                _optionDelistedWarningReceived = true;\n            }\n            else\n            {\n                if (!_optionSold || !_optionAssigned || !_stockAssigned || !_optionDelistedWarningReceived || _optionDelisted)\n                {\n                    throw new RegressionTestException($\"Unexpected delisting event: {delisting}\");\n                }\n\n                _optionDelisted = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_optionSold)\n            {\n                throw new RegressionTestException(\"Option was not sold\");\n            }\n\n            if (!_optionAssigned)\n            {\n                throw new RegressionTestException(\"Option was not assigned\");\n            }\n\n            if (!_stockAssigned)\n            {\n                throw new RegressionTestException(\"Stock was not assigned\");\n            }\n\n            if (!_optionDelistedWarningReceived)\n            {\n                throw new RegressionTestException(\"Option delisting warning was not received\");\n            }\n\n            if (!_optionDelisted)\n            {\n                throw new RegressionTestException(\"Option was not delisted\");\n            }\n\n            if (!_orderCanceled)\n            {\n                throw new RegressionTestException(\"Order was not canceled\");\n            }\n\n            var openOrders = Transactions.GetOpenOrders();\n            if (openOrders.Count != 0)\n            {\n                throw new RegressionTestException(\"There should be no open orders\");\n            }\n\n            if (!Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Portfolio should be invested\");\n            }\n\n            // We should have the stock since the option was assigned\n            if (Portfolio.Positions.Groups.Single().Single().Symbol != _stock)\n            {\n                throw new RegressionTestException(\"Portfolio should have the stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2850;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"4.48%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-19.248%\"},\n            {\"Drawdown\", \"1.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99319\"},\n            {\"Net Profit\", \"-0.681%\"},\n            {\"Sharpe Ratio\", \"-6.361\"},\n            {\"Sortino Ratio\", \"-4.623\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.018%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.139\"},\n            {\"Beta\", \"-0.082\"},\n            {\"Annual Standard Deviation\", \"0.024\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-2.525\"},\n            {\"Tracking Error\", \"0.137\"},\n            {\"Treynor Ratio\", \"1.883\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ20WLZZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"7.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"79ecc4dd8b045ddf0aa38057b8eb69bf\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DuplicateSecurityWithBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a regression test case using consolidators with SetBenchmark and duplicate securities.\n    /// </summary>\n    public class DuplicateSecurityWithBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SimpleMovingAverage _spyMovingAverage;\n        private Equity _spy1;\n        private Equity _spy2;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spy1 = AddEquity(\"SPY\", Resolution.Daily);\n\n            // SetBenchmark call prevents SMA update\n            SetBenchmark(\"SPY\");\n\n            _spy2 = AddEquity(\"SPY\", Resolution.Daily);\n            _spyMovingAverage = SMA(\"SPY\", 3, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Log($\"{Time} - {Securities[\"SPY\"].Price}, {_spyMovingAverage}\");\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"_spy1.Subscriptions.Count(): {_spy1.Subscriptions.Count()}\");\n            Log($\"_spy2.Subscriptions.Count(): {_spy2.Subscriptions.Count()}\");\n            Log($\"_spy1.Subscriptions.First().Consolidators.Count: {_spy1.Subscriptions.First().Consolidators.Count}\");\n            Log($\"_spy2.Subscriptions.First().Consolidators.Count: {_spy2.Subscriptions.First().Consolidators.Count}\");\n\n            if (_spyMovingAverage == 0)\n            {\n                throw new RegressionTestException(\"SMA was not updated.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DuplicatedIndexOptionSubscriptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Reproduces https://github.com/QuantConnect/Lean/issues/7451, making sure no additional subscriptions are added for an index\n    /// after manually adding both the underlying and an option contract, with slightly different configurations like the fill forward value.\n    /// </summary>\n    public class DuplicatedIndexOptionSubscriptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 4);\n            SetCash(1000000);\n\n            var spx = AddIndex(\"SPX\", Resolution.Minute, fillForward: false).Symbol;\n\n            if (SubscriptionManager.Subscriptions.Single().Symbol != spx)\n            {\n                throw new RegressionTestException($\"Expected a single subscription to exist ({spx})\");\n            }\n\n            var spxOption = QuantConnect.Symbol.CreateOption(\n                spx,\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3200m,\n                new DateTime(2021, 1, 15));\n\n            AddIndexOptionContract(spxOption, Resolution.Minute);\n\n            if (SubscriptionManager.Subscriptions.Count() < 2)\n            {\n                throw new RegressionTestException(\"Expected subscriptions for the added index option contract\");\n            }\n\n            if (SubscriptionManager.Subscriptions.Count(x => x.Symbol == spx) != 1)\n            {\n                throw new RegressionTestException(\"Expected a single subscription for the underlying index security\");\n            }\n\n            // Quit early, we already tested what we wanted\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/DynamicSecurityDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Provides an example algorithm showcasing the <see cref=\"Security.Data\"/> features\n    /// </summary>\n    public class DynamicSecurityDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security Equity;\n        private const string Ticker = \"GOOGL\";\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 10, 22);\n            SetEndDate(2015, 10, 30);\n\n            Equity = AddEquity(Ticker, Resolution.Daily);\n            var customLinkedEquity = AddData<LinkedData>(Ticker, Resolution.Daily).Symbol;\n\n            // Adding linked data manually to cache for example purposes, since\n            // LinkedData is a type used for testing and doesn't point to any real data.\n            Equity.Cache.AddDataList(new List<LinkedData>\n            {\n                new LinkedData\n                {\n                    Count = 100,\n\n                    Symbol = customLinkedEquity,\n                    EndTime = StartDate,\n                },\n                new LinkedData\n                {\n                    Count = 50,\n                    \n                    Symbol = customLinkedEquity,\n                    EndTime = StartDate\n                }\n            }, typeof(LinkedData), false);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // The Security object's Data property provides convenient access\n            // to the various types of data related to that security. You can\n            // access not only the security's price data, but also any custom\n            // data that is mapped to the security, such as our SEC reports.\n\n            // 1. Get the most recent data point of a particular type:\n            // 1.a Using the C# generic method, Get<T>:\n            LinkedData customLinkedData = Equity.Data.Get<LinkedData>();\n            Log($\"{Time:o}: LinkedData: {customLinkedData}\");\n\n            // 2. Get the list of data points of a particular type for the most recent time step:\n            // 2.a Using the C# generic method, GetAll<T>:\n            List<LinkedData> customLinkedDataList = Equity.Data.GetAll<LinkedData>();\n            Log($\"{Time:o}: List: LinkedData: {customLinkedDataList.Count}\");\n\n            if (!Portfolio.Invested)\n            {\n                Buy(Equity.Symbol, 10);\n            }\n        }\n        \n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 65;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-4.847%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99882.1\"},\n            {\"Net Profit\", \"-0.118%\"},\n            {\"Sharpe Ratio\", \"-2.151\"},\n            {\"Sortino Ratio\", \"-1.743\"},\n            {\"Probabilistic Sharpe Ratio\", \"30.061%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.008\"},\n            {\"Beta\", \"-0.104\"},\n            {\"Annual Standard Deviation\", \"0.02\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.063\"},\n            {\"Tracking Error\", \"0.108\"},\n            {\"Treynor Ratio\", \"0.423\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$1600000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOG T1AZ164W5VTX\"},\n            {\"Portfolio Turnover\", \"0.83%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ffab48ec7d6bf58aae9377c4bdf3be02\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ETFConstituentsFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of using ETFConstituentsUniverseSelectionModel\n    /// </summary>\n    public class ETFConstituentsFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2020, 12, 7);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            var symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            AddUniverseSelection(new ETFConstituentsUniverseSelectionModel(symbol, UniverseSettings, ETFConstituentsFilter));\n\n            AddAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n        }\n\n        private protected IEnumerable<Symbol> ETFConstituentsFilter(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            // Get the 10 securities with the largest weight in the index\n            return constituents.OrderByDescending(c => c.Weight).Take(8).Select(c => c.Symbol);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1068;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"64.993%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100918.77\"},\n            {\"Net Profit\", \"0.919%\"},\n            {\"Sharpe Ratio\", \"4.7\"},\n            {\"Sortino Ratio\", \"14.706\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.449%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.618\"},\n            {\"Beta\", \"-0.348\"},\n            {\"Annual Standard Deviation\", \"0.1\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"0.41\"},\n            {\"Tracking Error\", \"0.127\"},\n            {\"Treynor Ratio\", \"-1.358\"},\n            {\"Total Fees\", \"$7.02\"},\n            {\"Estimated Strategy Capacity\", \"$440000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"13.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"21aeef113b8d043e018967d7c1916e5f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of using ETFConstituentsUniverseSelectionModel with simple ticker\n    /// </summary>\n    public class ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm : ETFConstituentsFrameworkAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            SetUniverseSelection(new ETFConstituentsUniverseSelectionModel(\"SPY\", UniverseSettings, ETFConstituentsFilter));\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ETFGlobalRotationAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Strategy example using a portfolio of ETF Global Rotation\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"momentum\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class EtfGlobalRotationAlgorithm : QCAlgorithm\n    {\n        // we'll use this to tell us when the month has ended\n        private DateTime _lastRotationTime = DateTime.MinValue;\n        private TimeSpan _rotationInterval = TimeSpan.FromDays(30);\n        private bool _first = true;\n\n        // these are the growth symbols we'll rotate through\n        List<string> _growthSymbols = new List<string>\n        {\n            \"MDY\", // US S&P mid cap 400\n            \"IEV\", // iShares S&P europe 350\n            \"EEM\", // iShared MSCI emerging markets\n            \"ILF\", // iShares S&P latin america\n            \"EPP\"  // iShared MSCI Pacific ex-Japan\n        };\n\n        // these are the safety symbols we go to when things are looking bad for growth\n        List<string> _safetySymbols = new List<string>\n        {\n            \"EDV\", // Vangaurd TSY 25yr+\n            \"SHY\"  // Barclays Low Duration TSY\n        };\n\n        // we'll hold some computed data in these guys\n        List<SymbolData> _symbolData = new List<SymbolData>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetCash(25000);\n            SetStartDate(2007, 1, 1);\n\n            foreach (var symbol in _growthSymbols.Union(_safetySymbols))\n            {\n                // ideally we would use daily data\n                AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);\n                var oneMonthPerformance = MOM(symbol, 30, Resolution.Daily);\n                var threeMonthPerformance = MOM(symbol, 90, Resolution.Daily);\n\n                _symbolData.Add(new SymbolData\n                {\n                    Symbol = symbol,\n                    OneMonthPerformance = oneMonthPerformance,\n                    ThreeMonthPerformance = threeMonthPerformance\n                });\n            }\n        }\n\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            try\n            {\n                // the first time we come through here we'll need to do some things such as allocation\n                // and initializing our symbol data\n                if (_first)\n                {\n                    _first = false;\n                    _lastRotationTime = Time;\n                    return;\n                }\n\n                var delta = Time.Subtract(_lastRotationTime);\n                if (delta > _rotationInterval)\n                {\n                    _lastRotationTime = Time;\n\n                    // pick which one is best from growth and safety symbols\n                    var orderedObjScores = _symbolData.OrderByDescending(x => x.ObjectiveScore).ToList();\n                    foreach (var orderedObjScore in orderedObjScores)\n                    {\n                        Log($\">>SCORE>>{orderedObjScore.Symbol}>>{orderedObjScore.ObjectiveScore.ToStringInvariant()}\");\n                    }\n                    var bestGrowth = orderedObjScores.First();\n\n                    if (bestGrowth.ObjectiveScore > 0)\n                    {\n                        if (Portfolio[bestGrowth.Symbol].Quantity == 0)\n                        {\n                            Log(\"PREBUY>>LIQUIDATE>>\");\n                            Liquidate();\n                        }\n                        Log($\">>BUY>>{bestGrowth.Symbol}@{(100 * bestGrowth.OneMonthPerformance).ToStringInvariant(\"00.00\")}\");\n                        var qty = Portfolio.MarginRemaining / Securities[bestGrowth.Symbol].Close;\n                        MarketOrder(bestGrowth.Symbol, (int) qty);\n                    }\n                    else\n                    {\n                        // if no one has a good objective score then let's hold cash this month to be safe\n                        Log(\">>LIQUIDATE>>CASH\");\n                        Liquidate();\n                    }\n                }\n            }\n            catch (RegressionTestException ex)\n            {\n                Error(\"OnData: \" + ex.Message + \"\\r\\n\\r\\n\" + ex.StackTrace);\n            }\n        }\n    }\n\n    class SymbolData\n    {\n        public string Symbol;\n\n        public Momentum OneMonthPerformance { get; set; }\n        public Momentum ThreeMonthPerformance { get; set; }\n\n        public decimal ObjectiveScore\n        {\n            get\n            {\n                // we weight the one month performance higher\n                decimal weight1 = 100;\n                decimal weight2 = 75;\n\n                return (weight1 * OneMonthPerformance + weight2 * ThreeMonthPerformance) / (weight1 + weight2);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/EmaCrossAlphaModelFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"EmaCrossAlphaModel\"/>.\n    /// </summary>\n    public class EmaCrossAlphaModelFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetAlpha(new EmaCrossAlphaModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n        }\n\n        public override int AlgorithmHistoryDataPoints => 152;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"38\"},\n            {\"Average Win\", \"0.36%\"},\n            {\"Average Loss\", \"-0.17%\"},\n            {\"Compounding Annual Return\", \"68.881%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"1.552\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104401.15\"},\n            {\"Net Profit\", \"4.401%\"},\n            {\"Sharpe Ratio\", \"8.193\"},\n            {\"Sortino Ratio\", \"16.18\"},\n            {\"Probabilistic Sharpe Ratio\", \"97.920%\"},\n            {\"Loss Rate\", \"19%\"},\n            {\"Win Rate\", \"81%\"},\n            {\"Profit-Loss Ratio\", \"2.14\"},\n            {\"Alpha\", \"0.371\"},\n            {\"Beta\", \"0.406\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"4.394\"},\n            {\"Tracking Error\", \"0.059\"},\n            {\"Treynor Ratio\", \"1.106\"},\n            {\"Total Fees\", \"$80.35\"},\n            {\"Estimated Strategy Capacity\", \"$9600000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"17.26%\"},\n            {\"Drawdown Recovery\", \"6\"},\n            {\"OrderListHash\", \"49a74c348d955700aa5b230f596ed85b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EmaCrossFuturesFrontMonthAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to implement a cross moving average for the futures front contract\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"indicator\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    public class EmaCrossFuturesFrontMonthAlgorithm : QCAlgorithm\n    {\n        private const decimal _tolerance = 0.001m;\n        private Symbol _symbol;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private IDataConsolidator _consolidator;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n            SetCash(1000000);\n\n            var future = AddFuture(Futures.Metals.Gold);\n\n            // Only consider the front month contract\n            // Update the universe once per day to improve performance\n            future.SetFilter(x => x.FrontMonth().OnlyApplyFilterAtMarketOpen());\n\n            // Create two exponential moving averages\n            _fast = new ExponentialMovingAverage(100);\n            _slow = new ExponentialMovingAverage(300);\n\n            // Add a custom chart to track the EMA cross\n            var chart = new Chart(\"EMA Cross\");\n            chart.AddSeries(new Series(\"Fast\", SeriesType.Line, 0));\n            chart.AddSeries(new Series(\"Slow\", SeriesType.Line, 0));\n            AddChart(chart);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            SecurityHolding holding;\n            if (Portfolio.TryGetValue(_symbol, out holding))\n            {\n                // Buy the futures' front contract when the fast EMA is above the slow one\n                if (_fast > _slow * (1 + _tolerance))\n                {\n                    if (!holding.Invested)\n                    {\n                        SetHoldings(_symbol, .1);\n                        PlotEma();\n                    }\n                }\n                else if (holding.Invested)\n                {\n                    Liquidate(_symbol);\n                    PlotEma();\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                // Remove the consolidator for the previous contract\n                // and reset the indicators\n                if (_symbol != null && _consolidator != null)\n                {\n                    SubscriptionManager.RemoveConsolidator(_symbol, _consolidator);\n                    _fast.Reset();\n                    _slow.Reset();\n                }\n                // We don't need to call Liquidate(_symbol),\n                // since its positions are liquidated because the contract has expired.\n            }\n\n            // Only one security will be added: the new front contract\n            _symbol = changes.AddedSecurities.SingleOrDefault().Symbol;\n\n            // Create a new consolidator and register the indicators to it\n            _consolidator = ResolveConsolidator(_symbol, Resolution.Minute);\n            RegisterIndicator(_symbol, _fast, _consolidator);\n            RegisterIndicator(_symbol, _slow, _consolidator);\n\n            // Warm up the indicators\n            WarmUpIndicator(_symbol, _fast, Resolution.Minute);\n            WarmUpIndicator(_symbol, _slow, Resolution.Minute);\n\n            PlotEma();\n        }\n\n        private void PlotEma()\n        {\n            Plot(\"EMA Cross\", \"Fast\", _fast);\n            Plot(\"EMA Cross\", \"Slow\", _slow);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EmaCrossUniverseSelectionAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we demonstrate how to perform some technical analysis as\n    /// part of your coarse fundamental universe selection\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    public class EmaCrossUniverseSelectionAlgorithm : QCAlgorithm\n    {\n        // tolerance to prevent bouncing\n        const decimal Tolerance = 0.01m;\n        private const int Count = 10;\n        // use Buffer+Count to leave a little in cash\n        private const decimal TargetPercent = 0.1m;\n        private SecurityChanges _changes = SecurityChanges.None;\n        // holds our coarse fundamental indicators by symbol\n        private readonly ConcurrentDictionary<Symbol, SelectionData> _averages = new ConcurrentDictionary<Symbol, SelectionData>();\n\n\n        // class used to improve readability of the coarse selection function\n        private class SelectionData\n        {\n            public readonly ExponentialMovingAverage Fast;\n            public readonly ExponentialMovingAverage Slow;\n\n            public SelectionData()\n            {\n                Fast = new ExponentialMovingAverage(100);\n                Slow = new ExponentialMovingAverage(300);\n            }\n\n            // computes an object score of how much large the fast is than the slow\n            public decimal ScaledDelta\n            {\n                get { return (Fast - Slow)/((Fast + Slow)/2m); }\n            }\n\n            // updates the EMA50 and EMA100 indicators, returning true when they're both ready\n            public bool Update(DateTime time, decimal value)\n            {\n                return Fast.Update(time, value) && Slow.Update(time, value);\n            }\n        }\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Leverage = 2.0m;\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2010, 01, 01);\n            SetEndDate(2015, 01, 01);\n            SetCash(100*1000);\n\n            AddUniverse(coarse =>\n            {\n                return (from cf in coarse\n                        // grab th SelectionData instance for this symbol\n                        let avg = _averages.GetOrAdd(cf.Symbol, sym => new SelectionData())\n                        // Update returns true when the indicators are ready, so don't accept until they are\n                        where avg.Update(cf.EndTime, cf.AdjustedPrice)\n                        // only pick symbols who have their 50 day ema over their 100 day ema\n                        where avg.Fast > avg.Slow*(1 + Tolerance)\n                        // prefer symbols with a larger delta by percentage between the two averages\n                        orderby avg.ScaledDelta descending\n                        // we only need to return the symbol and return 'Count' symbols\n                        select cf.Symbol).Take(Count);\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate securities removed from our universe\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we'll simply go long each security we added to the universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, TargetPercent);\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Object containing AddedSecurities and RemovedSecurities</param>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/EmaCrossUniverseSelectionFrameworkAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Framework algorithm that uses the <see cref=\"EmaCrossUniverseSelectionModel\"/> to\n    /// select the universe based on a moving average cross.\n    /// </summary>\n    public class EmaCrossUniverseSelectionFrameworkAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 01, 01);\n            SetEndDate(2015, 01, 01);\n            SetCash(100000);\n\n            var fastPeriod = 100;\n            var slowPeriod = 300;\n            var count = 10;\n\n            UniverseSettings.Leverage = 2.0m;\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetUniverseSelection(new EmaCrossUniverseSelectionModel(fastPeriod, slowPeriod, count));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, Resolution.Daily.ToTimeSpan()));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/EmitInsightCryptoCashAccountType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm showcases an <see cref=\"AccountType.Cash\"/> emitting insights\n    /// and manually trading.\n    /// </summary>\n    public class EmitInsightCryptoCashAccountType : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 4); // Set Start Date\n            SetEndDate(2018, 4, 4); // Set End Date\n            SetAccountCurrency(\"EUR\");\n            SetCash(\"EUR\", 10000);\n            _symbol = AddCrypto(\"BTCEUR\").Symbol;\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                EmitInsights(Insight.Price(_symbol, Resolution.Daily, 1, InsightDirection.Up));\n                SetHoldings(_symbol, 0.5);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4319;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000.00\"},\n            {\"End Equity\", \"9619.78\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€14.92\"},\n            {\"Estimated Strategy Capacity\", \"€85000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCEUR 2XR\"},\n            {\"Portfolio Turnover\", \"51.69%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ee1a5ef96ba00c234f4e31c6772d7a19\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EmitInsightNoAlphaModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test showcasing an algorithm without setting an <see cref=\"AlphaModel\"/>,\n    /// directly calling <see cref=\"QCAlgorithm.EmitInsights\"/> and <see cref=\"QCAlgorithm.SetHoldings\"/>.\n    /// Note that calling <see cref=\"QCAlgorithm.SetHoldings\"/> is useless because\n    /// next time Lean calls the Portfolio construction model it will counter it with another order\n    /// since it only knows of the emitted insights\n    /// </summary>\n    public class EmitInsightNoAlphaModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models except ALPHA\n            SetUniverseSelection(new ManualUniverseSelectionModel(_symbol));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                var order = Transactions.GetOpenOrders(_symbol).FirstOrDefault();\n\n                if (order != null)\n                {\n                    throw new RegressionTestException($\"Unexpected open order {order}\");\n                }\n\n                EmitInsights(Insight.Price(_symbol, Resolution.Daily, 10, InsightDirection.Down));\n\n                // emitted insight should have triggered a new order\n                order = Transactions.GetOpenOrders(_symbol).FirstOrDefault();\n\n                if (order == null)\n                {\n                    throw new RegressionTestException(\"Expected open order for emitted insight\");\n                }\n                if (order.Direction != OrderDirection.Sell\n                    || order.Symbol != _symbol)\n                {\n                    throw new RegressionTestException($\"Unexpected open order for emitted insight: {order}\");\n                }\n\n                SetHoldings(_symbol, 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var holdings = Securities[_symbol].Holdings;\n            if (Math.Sign(holdings.Quantity) != -1)\n            {\n                throw new RegressionTestException(\"Unexpected holdings\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.02%\"},\n            {\"Compounding Annual Return\", \"-74.669%\"},\n            {\"Drawdown\", \"2.900%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98259.71\"},\n            {\"Net Profit\", \"-1.740%\"},\n            {\"Sharpe Ratio\", \"-3.018\"},\n            {\"Sortino Ratio\", \"-3.766\"},\n            {\"Probabilistic Sharpe Ratio\", \"24.616%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.301\"},\n            {\"Beta\", \"-0.998\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-5.95\"},\n            {\"Tracking Error\", \"0.445\"},\n            {\"Treynor Ratio\", \"0.672\"},\n            {\"Total Fees\", \"$19.23\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"100.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"094cbf077486ed2ec2558a2255a385c2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EmitInsightsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test showcasing an algorithm using the framework models\n    /// and directly calling <see cref=\"QCAlgorithm.EmitInsights\"/>\n    /// </summary>\n    public class EmitInsightsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private bool _toggle;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(_symbol));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_toggle)\n            {\n                _toggle = false;\n                var order = Transactions.GetOpenOrders(_symbol).FirstOrDefault();\n\n                if (order != null)\n                {\n                    throw new RegressionTestException($\"Unexpected open order {order}\");\n                }\n\n                // we manually emit an insight\n                EmitInsights(Insight.Price(_symbol, Resolution.Daily, 1, InsightDirection.Down));\n\n                // emitted insight should have triggered a new order\n                order = Transactions.GetOpenOrders(_symbol).FirstOrDefault();\n\n                if (order == null)\n                {\n                    throw new RegressionTestException(\"Expected open order for emitted insight\");\n                }\n                if (order.Direction != OrderDirection.Sell\n                    || order.Symbol != _symbol)\n                {\n                    throw new RegressionTestException($\"Unexpected open order for emitted insight: {order}\");\n                }\n            }\n            else\n            {\n                _toggle = true;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.94%\"},\n            {\"Average Loss\", \"-0.98%\"},\n            {\"Compounding Annual Return\", \"-49.613%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"-0.021\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99127.48\"},\n            {\"Net Profit\", \"-0.873%\"},\n            {\"Sharpe Ratio\", \"-2.432\"},\n            {\"Sortino Ratio\", \"-26.344\"},\n            {\"Probabilistic Sharpe Ratio\", \"33.387%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.96\"},\n            {\"Alpha\", \"-1.649\"},\n            {\"Beta\", \"0.62\"},\n            {\"Annual Standard Deviation\", \"0.175\"},\n            {\"Annual Variance\", \"0.031\"},\n            {\"Information Ratio\", \"-17.555\"},\n            {\"Tracking Error\", \"0.137\"},\n            {\"Treynor Ratio\", \"-0.686\"},\n            {\"Total Fees\", \"$17.19\"},\n            {\"Estimated Strategy Capacity\", \"$1600000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"100.44%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"54c868bc2bc19b62922c1fec8c1d327e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EqualWeightingPortfolioConstructionModelFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Futures regression algorithm intended to test the behavior of the framework models. See GH issue 4027.\n    /// </summary>\n    public class EqualWeightingPortfolioConstructionModelFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _fillCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            SetUniverseSelection(new FrontMonthFutureUniverseSelectionModel(SelectFutureChainSymbols));\n            SetAlpha(new ConstantFutureContractAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n        }\n\n        // future symbol universe selection function\n        private static IEnumerable<Symbol> SelectFutureChainSymbols(DateTime utcTime)\n        {\n            return new []\n            {\n                QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),\n                QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX)\n            };\n        }\n\n        /// <summary>\n        /// Creates futures chain universes that select the front month contract and runs a user\n        /// defined futureChainSymbolSelector every day to enable choosing different futures chains\n        /// </summary>\n        class FrontMonthFutureUniverseSelectionModel : FutureUniverseSelectionModel\n        {\n            public FrontMonthFutureUniverseSelectionModel(Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector)\n                : base(TimeSpan.FromDays(1), futureChainSymbolSelector)\n            {\n            }\n\n            /// <summary>\n            /// Defines the future chain universe filter\n            /// </summary>\n            protected override FutureFilterUniverse Filter(FutureFilterUniverse filter)\n            {\n                return filter\n                    .FrontMonth()\n                    .OnlyApplyFilterAtMarketOpen();\n            }\n        }\n\n        /// <summary>\n        /// Implementation of a constant alpha model that only emits insights for future symbols\n        /// </summary>\n        class ConstantFutureContractAlphaModel : ConstantAlphaModel\n        {\n            public ConstantFutureContractAlphaModel(InsightType type, InsightDirection direction, TimeSpan period)\n                : base(type, direction, period)\n            {\n            }\n\n            protected override bool ShouldEmitInsight(DateTime utcTime, Symbol symbol)\n            {\n                // only emit alpha for future symbols and not underlying equity symbols\n                if (symbol.SecurityType != SecurityType.Future)\n                {\n                    return false;\n                }\n\n                return base.ShouldEmitInsight(utcTime, symbol);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{orderEvent}\");\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                _fillCount++;\n                if (_fillCount == 2)\n                {\n                    if (Portfolio.TotalHoldingsValue / Portfolio.TotalPortfolioValue < 10)\n                    {\n                        throw new RegressionTestException(\"Expected to be trading using the futures margin leverage\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 36213;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0.69%\"},\n            {\"Average Loss\", \"-2.47%\"},\n            {\"Compounding Annual Return\", \"-99.946%\"},\n            {\"Drawdown\", \"28.600%\"},\n            {\"Expectancy\", \"-0.680\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"90213.76\"},\n            {\"Net Profit\", \"-9.786%\"},\n            {\"Sharpe Ratio\", \"-0.603\"},\n            {\"Sortino Ratio\", \"-0.892\"},\n            {\"Probabilistic Sharpe Ratio\", \"30.082%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"0.28\"},\n            {\"Alpha\", \"-15.818\"},\n            {\"Beta\", \"7.498\"},\n            {\"Annual Standard Deviation\", \"1.669\"},\n            {\"Annual Variance\", \"2.787\"},\n            {\"Information Ratio\", \"-2.061\"},\n            {\"Tracking Error\", \"1.447\"},\n            {\"Treynor Ratio\", \"-0.134\"},\n            {\"Total Fees\", \"$52.01\"},\n            {\"Estimated Strategy Capacity\", \"$1800000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VL5E74HP3EE5\"},\n            {\"Portfolio Turnover\", \"475.60%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"91aeb0d6f6a18df9fd755fc473183395\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquityMarginCallAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the <see cref=\"QCAlgorithm.OnMarginCallWarning\"/> and <see cref=\"QCAlgorithm.OnMarginCall\"/>\n    /// events are fired when trading equities\n    /// </summary>\n    public class EquityMarginCallAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        private bool _receivedMarginCallWarning;\n\n        private bool _onMarginCallWasCalled;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 30);\n            SetCash(100000);\n\n            var equity = AddEquity(\"GOOG\");\n            equity.SetLeverage(100);\n            _symbol = equity.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 86);\n            }\n        }\n\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            Debug($\"OnMarginCall at {Time}\");\n            _onMarginCallWasCalled = true;\n            foreach (var request in requests)\n            {\n                var security = Portfolio.Securities[request.Symbol];\n\n                // Ensure margin call orders only happen when the exchange is open\n                if (!security.Exchange.ExchangeOpen)\n                {\n                    throw new RegressionTestException(\"Margin calls should not occur outside regular market hours!\");\n                }\n            }\n        }\n\n        public override void OnMarginCallWarning()\n        {\n            Debug($\"OnMarginCallWarning at {Time}\");\n            _receivedMarginCallWarning = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedMarginCallWarning)\n            {\n                throw new RegressionTestException(\"OnMarginCallWarning was not invoked\");\n            }\n\n            if (!_onMarginCallWasCalled)\n            {\n                throw new RegressionTestException(\"OnMarginCall was not invoked\");\n            }\n\n            // margin call orders should have liquidated part of the position and get us within the maintenance margin\n            if (Portfolio.MarginRemaining < 0)\n            {\n                throw new RegressionTestException(\"MarginRemaining should be positive\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3190;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-6.17%\"},\n            {\"Compounding Annual Return\", \"-100.000%\"},\n            {\"Drawdown\", \"72.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"50554.98\"},\n            {\"Net Profit\", \"-49.445%\"},\n            {\"Sharpe Ratio\", \"-1.155\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.982%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.961\"},\n            {\"Beta\", \"1.583\"},\n            {\"Annual Standard Deviation\", \"0.87\"},\n            {\"Annual Variance\", \"0.756\"},\n            {\"Information Ratio\", \"-1.135\"},\n            {\"Tracking Error\", \"0.861\"},\n            {\"Treynor Ratio\", \"-0.635\"},\n            {\"Total Fees\", \"$91.53\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2904.79%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"80d456f6613030d3ff67b6c59dba5707\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquityOptionsUniverseSettingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that options from universe are added with the same resolution, fill forward and extended market hours settings as the universe settings.\n    /// </summary>\n    public class EquityOptionsUniverseSettingsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SecurityType[] _securityTypes;\n        private HashSet<SecurityType> _checkedSecurityTypes = new();\n\n        protected virtual DateTime TestStartDate => new DateTime(2015, 12, 24);\n\n        public override void Initialize()\n        {\n            SetStartDate(TestStartDate);\n            SetEndDate(TestStartDate.AddDays(1));\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            UniverseSettings.FillForward = false;\n            UniverseSettings.ExtendedMarketHours = true;\n\n            _securityTypes = AddSecurity();\n        }\n\n        protected virtual SecurityType[] AddSecurity()\n        {\n            var equity = AddEquity(\"GOOG\");\n            var option = AddOption(equity.Symbol);\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n\n            return [option.Symbol.SecurityType];\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            var securities = changes.AddedSecurities.Where(x => _securityTypes.Contains(x.Type) && !x.Symbol.IsCanonical()).Select(x => x.Symbol).ToList();\n            var configs = SubscriptionManager.Subscriptions.Where(x => securities.Contains(x.Symbol));\n\n            foreach (var config in configs)\n            {\n                if (config.Resolution != UniverseSettings.Resolution)\n                {\n                    throw new RegressionTestException($\"Config '{config}' resolution {config.Resolution} does not match universe settings resolution {UniverseSettings.Resolution}\");\n                }\n\n                if (config.FillDataForward != UniverseSettings.FillForward)\n                {\n                    throw new RegressionTestException($\"Config '{config}' fill forward {config.FillDataForward} does not match universe settings fill forward {UniverseSettings.FillForward}\");\n                }\n\n                if (config.ExtendedMarketHours != UniverseSettings.ExtendedMarketHours)\n                {\n                    throw new RegressionTestException($\"Config '{config}' extended market hours {config.ExtendedMarketHours} does not match universe settings extended market hours {UniverseSettings.ExtendedMarketHours}\");\n                }\n\n                _checkedSecurityTypes.Add(config.SecurityType);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_checkedSecurityTypes.Count != _securityTypes.Length || !_securityTypes.All(_checkedSecurityTypes.Contains))\n            {\n                throw new RegressionTestException($\"Not all security types were checked. Expected: {string.Join(\", \", _securityTypes)}. Checked: {string.Join(\", \", _checkedSecurityTypes)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 4276;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquitySplitHoldingsDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the current price of the security is adjusted after a split.\n    /// Specific for daily resolution.\n    /// </summary>\n    public class EquitySplitHoldingsDailyRegressionAlgorithm : EquitySplitHoldingsMinuteRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 50;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-44.829%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98919.60\"},\n            {\"Net Profit\", \"-1.080%\"},\n            {\"Sharpe Ratio\", \"-2.862\"},\n            {\"Sortino Ratio\", \"-3.355\"},\n            {\"Probabilistic Sharpe Ratio\", \"23.493%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.395\"},\n            {\"Beta\", \"0.265\"},\n            {\"Annual Standard Deviation\", \"0.129\"},\n            {\"Annual Variance\", \"0.017\"},\n            {\"Information Ratio\", \"-3.531\"},\n            {\"Tracking Error\", \"0.132\"},\n            {\"Treynor Ratio\", \"-1.392\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$370000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.20%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6ea9aed8840dc08f9290028271750dcf\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquitySplitHoldingsHourRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the current price of the security is adjusted after a split.\n    /// Specific for hour resolution.\n    /// </summary>\n    public class EquitySplitHoldingsHourRegressionAlgorithm : EquitySplitHoldingsMinuteRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 80;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-57.230%\"},\n            {\"Drawdown\", \"2.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98460.68\"},\n            {\"Net Profit\", \"-1.539%\"},\n            {\"Sharpe Ratio\", \"-3.994\"},\n            {\"Sortino Ratio\", \"-4.265\"},\n            {\"Probabilistic Sharpe Ratio\", \"11.588%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.447\"},\n            {\"Beta\", \"-0.254\"},\n            {\"Annual Standard Deviation\", \"0.118\"},\n            {\"Annual Variance\", \"0.014\"},\n            {\"Information Ratio\", \"-4.414\"},\n            {\"Tracking Error\", \"0.129\"},\n            {\"Treynor Ratio\", \"1.854\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$68000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.24%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"82c9f6d69e0c1ddcfd1861248634e6d7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquitySplitHoldingsMinuteRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the current price of the security is adjusted after a split.\n    /// Specific for minute resolution.\n    /// </summary>\n    public class EquitySplitHoldingsMinuteRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _aapl;\n\n        private decimal _aaplPriceBeforeSplit;\n        private decimal _aaplVolumeBeforeSplit;\n        private decimal _aaplOpenBeforeSplit;\n        private decimal _aaplCloseBeforeSplit;\n        private decimal _aaplHighBeforeSplit;\n        private decimal _aaplLowBeforeSplit;\n        private decimal _aaplAskPriceBeforeSplit;\n        private decimal _aaplBidPriceBeforeSplit;\n        private decimal _aaplAskSizeBeforeSplit;\n        private decimal _aaplBidSizeBeforeSplit;\n\n        private bool _splitOccurred;\n\n        protected virtual Resolution Resolution => Resolution.Minute;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 11);\n            SetCash(100000);\n\n            _aapl = AddEquity(\"AAPL\", Resolution, dataNormalizationMode: DataNormalizationMode.Raw);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_splitOccurred)\n            {\n                SetHoldings(_aapl.Symbol, -1);\n            }\n\n            if (slice.Splits.TryGetValue(_aapl.Symbol, out var split) && split.Type == SplitType.SplitOccurred)\n            {\n                _splitOccurred = true;\n\n                if (!_aapl.Holdings.Invested)\n                {\n                    throw new RegressionTestException(\"AAPL is not invested after split occurred\");\n                }\n\n                if (_aapl.Holdings.Price != _aapl.Price)\n                {\n                    throw new RegressionTestException($\"AAPL price is not equal to AAPL holdings price. \" +\n                        $\"AAPL price: {_aapl.Price}, AAPL holdings price: {_aapl.Holdings.Price}\");\n                }\n\n                AssertFactorChange(\"Price check\", _aaplPriceBeforeSplit, _aapl.Price, split.SplitFactor);\n                AssertFactorChange(\"Open price check\", _aaplOpenBeforeSplit, _aapl.Open, split.SplitFactor);\n                AssertFactorChange(\"Close price check\", _aaplCloseBeforeSplit, _aapl.Close, split.SplitFactor);\n                AssertFactorChange(\"High price check\", _aaplHighBeforeSplit, _aapl.High, split.SplitFactor);\n                AssertFactorChange(\"Low price check\", _aaplLowBeforeSplit, _aapl.Low, split.SplitFactor);\n                AssertFactorChange(\"Volume check\", _aaplVolumeBeforeSplit, _aapl.Volume, 1 / split.SplitFactor);\n\n                if (Resolution < Resolution.Hour)\n                {\n                    AssertFactorChange(\"Ask price check\", _aaplAskPriceBeforeSplit, _aapl.AskPrice, split.SplitFactor);\n                    AssertFactorChange(\"Bid price check\", _aaplBidPriceBeforeSplit, _aapl.BidPrice, split.SplitFactor);\n                    AssertFactorChange(\"Ask size check\", _aaplAskSizeBeforeSplit, _aapl.AskSize, 1 / split.SplitFactor);\n                    AssertFactorChange(\"Bid size check\", _aaplBidSizeBeforeSplit, _aapl.BidSize, 1 / split.SplitFactor);\n                }\n            }\n            else\n            {\n                _aaplPriceBeforeSplit = _aapl.Price;\n                _aaplOpenBeforeSplit = _aapl.Open;\n                _aaplCloseBeforeSplit = _aapl.Close;\n                _aaplHighBeforeSplit = _aapl.High;\n                _aaplLowBeforeSplit = _aapl.Low;\n                _aaplVolumeBeforeSplit = _aapl.Volume;\n                _aaplAskPriceBeforeSplit = _aapl.AskPrice;\n                _aaplBidPriceBeforeSplit = _aapl.BidPrice;\n                _aaplAskSizeBeforeSplit = _aapl.AskSize;\n                _aaplBidSizeBeforeSplit = _aapl.BidSize;\n            }\n        }\n\n        private static void AssertFactorChange(string messagePrefix, decimal priceBeforeSplit, decimal priceAfterSplit, decimal splitFactor)\n        {\n            if (Math.Abs(priceAfterSplit / priceBeforeSplit - splitFactor) >= 0.0001m)\n            {\n                throw new RegressionTestException($\"{messagePrefix}: split factor is not correct. Expected: {splitFactor}, \" +\n                    $\"Actual: {priceAfterSplit / priceBeforeSplit}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_splitOccurred)\n            {\n                throw new RegressionTestException(\"Split did not occur\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 3945;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-56.234%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98502.10\"},\n            {\"Net Profit\", \"-1.498%\"},\n            {\"Sharpe Ratio\", \"-4.002\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"8.037%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.447\"},\n            {\"Beta\", \"0.159\"},\n            {\"Annual Standard Deviation\", \"0.108\"},\n            {\"Annual Variance\", \"0.012\"},\n            {\"Information Ratio\", \"-4.67\"},\n            {\"Tracking Error\", \"0.113\"},\n            {\"Treynor Ratio\", \"-2.711\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$41000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.24%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"5d7b0658b66b331ba8159011aa2ec5b4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquityTickQuoteAdjustedModeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Checks that the Tick BidPrice and AskPrices are adjusted like Value.\n    /// </summary>\n    public class EquityTickQuoteAdjustedModeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _ibm;\n        private bool _bought;\n        private bool _sold;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _ibm = AddEquity(\"IBM\", Resolution.Tick).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.Ticks.ContainsKey(_ibm))\n            {\n                return;\n            }\n\n            var security = Securities[_ibm];\n            if (!security.HasData)\n            {\n                return;\n            }\n\n            foreach (var tick in slice.Ticks[_ibm])\n            {\n                if (tick.BidPrice != 0 && !_bought && ((tick.Value - tick.BidPrice) <= 0.05m))\n                {\n                    SetHoldings(_ibm, 1);\n                    _bought = true;\n                    return;\n                }\n                if (tick.AskPrice != 0 && _bought && !_sold && Math.Abs((double)tick.Value - (double)tick.AskPrice) <= 0.05)\n                {\n                    Liquidate(_ibm);\n                    _sold = true;\n                    return;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 694806;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.12%\"},\n            {\"Compounding Annual Return\", \"-9.135%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99877.60\"},\n            {\"Net Profit\", \"-0.122%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$7.34\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"39.89%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d2af4746a4d01ca4d0ce0b0c44f30451\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EquityTradeAndQuotesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that test if the fill prices are the correct quote side.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class EquityTradeAndQuotesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private bool _canTrade;\n        private int _quoteCounter;\n        private int _tradeCounter;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n\n            SetSecurityInitializer(x => x.SetDataNormalizationMode(DataNormalizationMode.Raw));\n\n            _symbol = AddEquity(\"IBM\", Resolution.Minute).Symbol;\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            // 2013-10-07 was Monday, that's why we ask 3 days history to get  data from previous Friday.\n            var history = History(new[] { _symbol }, TimeSpan.FromDays(3), Resolution.Minute).ToList();\n            Log($\"{Time} - history.Count: {history.Count}\");\n\n            const int expectedSliceCount = 390;\n            if (history.Count != expectedSliceCount)\n            {\n                throw new RegressionTestException($\"History slices - expected: {expectedSliceCount}, actual: {history.Count}\");\n            }\n\n\n            if (history.Any(s => s.Bars.Count != 1 && s.QuoteBars.Count != 1))\n            {\n                throw new RegressionTestException($\"History not all slices have trades and quotes.\");\n            }\n\n            Schedule.On(DateRules.EveryDay(_symbol), TimeRules.AfterMarketOpen(_symbol, 0), () => { _canTrade = true; });\n\n            Schedule.On(DateRules.EveryDay(_symbol), TimeRules.BeforeMarketClose(_symbol, 16), () => { _canTrade = false; });\n\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _quoteCounter += slice.QuoteBars.Count;\n            _tradeCounter += slice.Bars.Count;\n\n            if (!Portfolio.Invested && _canTrade)\n            {\n                SetHoldings(_symbol, 1);\n                Log($\"Purchased Security {_symbol.ID}\");\n            }\n\n            if (Time.Minute % 15 == 0)\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                var subscriptions = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(addedSecurity.Symbol);\n                if (addedSecurity.Symbol == _symbol)\n                {\n                    if (!(subscriptions.Count == 2 &&\n                          subscriptions.Any(s => s.TickType == TickType.Trade) &&\n                          subscriptions.Any(s => s.TickType == TickType.Quote)))\n                    {\n                        throw new RegressionTestException($\"Subscriptions were not correctly added for high resolution.\");\n                    }\n                }\n                else\n                {\n                    if (subscriptions.Single().TickType != TickType.Trade)\n                    {\n                        throw new RegressionTestException($\"Subscriptions were not correctly added for low resolution.\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{Time:s} {orderEvent.Direction}\");\n                var expectedFillPrice = orderEvent.Direction == OrderDirection.Buy ? Securities[_symbol].AskPrice : Securities[_symbol].BidPrice;\n                if (orderEvent.FillPrice != expectedFillPrice)\n                {\n                    throw new RegressionTestException($\"Fill price is not the expected for OrderId {orderEvent.OrderId} at Algorithm Time {Time:s}.\" +\n                                        $\"\\n\\tExpected fill price: {expectedFillPrice}, Actual fill price: {orderEvent.FillPrice}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // We expect at least 390 * 5 = 1950 minute bar\n            // + 5 daily bars, but those are pumped into OnData every minute \n            if (_tradeCounter <= 1955)\n            {\n                throw new RegressionTestException($\"Fail at trade bars count expected >= 1955, actual: {_tradeCounter}.\");\n            }\n            // We expect 390 * 5 = 1950 quote bars. \n            if (_quoteCounter != 1950)\n            {\n                throw new RegressionTestException($\"Fail at trade bars count expected: 1950, actual: {_quoteCounter}.\");\n            }\n\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5504;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 780;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"250\"},\n            {\"Average Win\", \"0.12%\"},\n            {\"Average Loss\", \"-0.10%\"},\n            {\"Compounding Annual Return\", \"-88.292%\"},\n            {\"Drawdown\", \"3.300%\"},\n            {\"Expectancy\", \"-0.225\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97294.97\"},\n            {\"Net Profit\", \"-2.705%\"},\n            {\"Sharpe Ratio\", \"-5.072\"},\n            {\"Sortino Ratio\", \"-5.033\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.585%\"},\n            {\"Loss Rate\", \"65%\"},\n            {\"Win Rate\", \"35%\"},\n            {\"Profit-Loss Ratio\", \"1.20\"},\n            {\"Alpha\", \"-1.882\"},\n            {\"Beta\", \"0.571\"},\n            {\"Annual Standard Deviation\", \"0.149\"},\n            {\"Annual Variance\", \"0.022\"},\n            {\"Information Ratio\", \"-22.183\"},\n            {\"Tracking Error\", \"0.123\"},\n            {\"Treynor Ratio\", \"-1.323\"},\n            {\"Total Fees\", \"$670.74\"},\n            {\"Estimated Strategy Capacity\", \"$170000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4996.13%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c65a9aa12b55e53a49a29cd28a358fcd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that European options cannot be exercised before expiry\n    /// </summary>\n    public class EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Option _option;\n\n        private OptionContract _contract;\n\n        private bool _marketOrderDone;\n\n        private bool _exerciseBeforeExpiryDone;\n\n        private bool _exerciseOnExpiryDone;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 2, 1);\n            SetCash(200000);\n\n            var index = AddIndex(\"SPX\", Resolution.Hour, fillForward: true);\n            var indexOption = AddIndexOption(index.Symbol, Resolution.Hour, fillForward: true);\n            indexOption.SetFilter(filterFunc => filterFunc);\n\n            _option = indexOption;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if ((_exerciseBeforeExpiryDone && _exerciseOnExpiryDone) || !_option.Exchange.ExchangeOpen)\n            {\n                return;\n            }\n\n            if (_contract == null)\n            {\n                OptionChain contracts;\n                if (!slice.OptionChains.TryGetValue(_option.Symbol, out contracts) || !contracts.Any())\n                {\n                    return;\n                }\n\n                _contract = contracts.First();\n            }\n\n            var expiry = _contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone).Date;\n\n            if (!_exerciseBeforeExpiryDone && UtcTime.Date < expiry)\n            {\n                if (!_marketOrderDone)\n                {\n                    if (MarketOrder(_contract.Symbol, 1).Status != OrderStatus.Filled)\n                    {\n                        throw new RegressionTestException(\"Expected market order to fill immediately\");\n                    }\n\n                    _marketOrderDone = true;\n                }\n\n                if (ExerciseOption(_contract.Symbol, 1).Status == OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Expected European option to not be exercisable before its expiration date. \" +\n                                        $\"Time: {UtcTime}. Expiry: {_contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone)}\");\n                }\n\n                _exerciseBeforeExpiryDone = true;\n\n                return;\n            }\n\n            if (!_exerciseOnExpiryDone && UtcTime.Date == expiry)\n            {\n                if (ExerciseOption(_contract.Symbol, 1).Status != OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Expected European option to be exercisable on its expiration date. \" +\n                                        $\"Time: {UtcTime}. Expiry: {_contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone)}\");\n                }\n\n                _exerciseOnExpiryDone = true;\n\n                // We already tested everything, so we can stop the algorithm\n                Quit();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_exerciseBeforeExpiryDone || !_exerciseOnExpiryDone)\n            {\n                throw new RegressionTestException(\"Expected to try to exercise option before and on expiry\");\n            }\n\n            var optionHoldings = Securities[_contract.Symbol].Holdings;\n            if (optionHoldings.NetProfit != Portfolio.TotalNetProfit)\n            {\n                throw new RegressionTestException($\"Unexpected holdings profit result {optionHoldings.Profit}\");\n            }\n            if (Portfolio.Cash != (Portfolio.TotalNetProfit + 200000))\n            {\n                throw new RegressionTestException($\"Unexpected portfolio cash {Portfolio.Cash}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all time slices of algorithm\n        /// </summary>\n        public long DataPoints => 1461;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"2.19%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"100.016%\"},\n            {\"Drawdown\", \"3.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"204384\"},\n            {\"Net Profit\", \"2.192%\"},\n            {\"Sharpe Ratio\", \"9.169\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"92.918%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"3.002\"},\n            {\"Beta\", \"-0.818\"},\n            {\"Annual Standard Deviation\", \"0.268\"},\n            {\"Annual Variance\", \"0.072\"},\n            {\"Information Ratio\", \"5.749\"},\n            {\"Tracking Error\", \"0.31\"},\n            {\"Treynor Ratio\", \"-2.999\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$420000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"2.37%\"},\n            {\"Drawdown Recovery\", \"10\"},\n            {\"OrderListHash\", \"0d2ccc2fdfa2b81bf71361c8248c4a59\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating how to get order events in custom execution models\n    /// and asserting that they match the algorithm's order events.\n    /// </summary>\n    public class ExecutionModelOrderEventsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly List<OrderEvent> _orderEvents = new();\n        private CustomImmediateExecutionModel _executionModel;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Resolution.Daily));\n\n            _executionModel = new CustomImmediateExecutionModel();\n            SetExecution(_executionModel);\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            _orderEvents.Add(orderEvent);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_executionModel.OrderEvents.Count != _orderEvents.Count)\n            {\n                throw new RegressionTestException($\"Order events count mismatch. Execution model: {_executionModel.OrderEvents.Count}, Algorithm: {_orderEvents.Count}\");\n            }\n\n            for (int i = 0; i < _orderEvents.Count; i++)\n            {\n                var modelEvent = _executionModel.OrderEvents[i];\n                var algoEvent = _orderEvents[i];\n\n                if (modelEvent.Id != algoEvent.Id ||\n                    modelEvent.OrderId != algoEvent.OrderId ||\n                    modelEvent.Status != algoEvent.Status)\n                {\n                    throw new RegressionTestException($\"Order event mismatch at index {i}. Execution model: {_executionModel.OrderEvents[i]}, Algorithm: {_orderEvents[i]}\");\n                }\n            }\n        }\n\n        private class CustomImmediateExecutionModel : ExecutionModel\n        {\n            private readonly PortfolioTargetCollection _targetsCollection = new PortfolioTargetCollection();\n\n            private readonly Dictionary<int, OrderTicket> _orderTickets = new();\n\n            public List<OrderEvent> OrderEvents { get; } = new();\n\n            public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n            {\n                _targetsCollection.AddRange(targets);\n                if (!_targetsCollection.IsEmpty)\n                {\n                    foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                    {\n                        var security = algorithm.Securities[target.Symbol];\n\n                        // calculate remaining quantity to be ordered\n                        var quantity = OrderSizing.GetUnorderedQuantity(algorithm, target, security, true);\n\n                        if (quantity != 0 &&\n                            security.BuyingPowerModel.AboveMinimumOrderMarginPortfolioPercentage(security, quantity,\n                                algorithm.Portfolio, algorithm.Settings.MinimumOrderMarginPortfolioPercentage))\n                        {\n                            var ticket = algorithm.MarketOrder(security, quantity, asynchronous: true, tag: target.Tag);\n                            _orderTickets[ticket.OrderId] = ticket;\n                        }\n                    }\n\n                    _targetsCollection.ClearFulfilled(algorithm);\n                }\n            }\n\n            public override void OnOrderEvent(QCAlgorithm algorithm, OrderEvent orderEvent)\n            {\n                algorithm.Log($\"{algorithm.Time} - Order event received: {orderEvent}\");\n\n                // This method will get events for all orders, but if we save the tickets in Execute we can filter\n                // to process events for orders placed by this model\n                if (_orderTickets.TryGetValue(orderEvent.OrderId, out var ticket))\n                {\n                    if (orderEvent.Status.IsFill())\n                    {\n                        algorithm.Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n                    }\n\n                    if (orderEvent.Status.IsClosed())\n                    {\n                        // Once the order is closed we can remove it from our tracking dictionary\n                        _orderTickets.Remove(orderEvent.OrderId);\n                    }\n                }\n\n                OrderEvents.Add(orderEvent);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.01%\"},\n            {\"Compounding Annual Return\", \"261.134%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101655.30\"},\n            {\"Net Profit\", \"1.655%\"},\n            {\"Sharpe Ratio\", \"8.472\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.840%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.091\"},\n            {\"Beta\", \"1.006\"},\n            {\"Annual Standard Deviation\", \"0.224\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-33.445\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"1.885\"},\n            {\"Total Fees\", \"$10.32\"},\n            {\"Estimated Strategy Capacity\", \"$27000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"59.86%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"f209ed42701b0419858e0100595b40c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ExpiryHelperAlphaModelFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Expiry Helper algorithm uses <see cref=\"Expiry\"/> helper class in an Alpha Model\n    /// </summary>\n    public class ExpiryHelperAlphaModelFrameworkAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2014, 1, 1);      //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ExpiryHelperAlphaModel());\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n\n            InsightsGenerated += (s, e) =>\n            {\n                foreach (var insight in e.Insights)\n                {\n                    Log($\"{e.DateTimeUtc.DayOfWeek}: Close Time {insight.CloseTimeUtc} {insight.CloseTimeUtc.DayOfWeek}\");\n                }\n            };\n        }\n\n        /// <summary>\n        /// <see cref=\"ExpiryHelperAlphaModel\"/> shows how we can use the <see cref=\"Expiry\"/> helper class\n        /// to set an insight with a calendar expiry.\n        /// </summary>\n        private class ExpiryHelperAlphaModel : AlphaModel\n        {\n            private const InsightDirection _direction = InsightDirection.Up;\n            private DateTime _nextUpdate = DateTime.MinValue;\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                if (_nextUpdate > algorithm.Time)\n                {\n                    yield break;\n                }\n\n                var expiry = Expiry.EndOfDay;\n\n                // Use the Expiry helper to calculate a date/time in the future\n                _nextUpdate = expiry(algorithm.Time);\n\n                foreach (var symbol in data.Bars.Keys)\n                {\n                    switch (algorithm.Time.DayOfWeek)\n                    {\n                        // Expected CloseTime: next month on the same day and time\n                        case DayOfWeek.Monday:\n                            yield return Insight.Price(symbol, Expiry.OneMonth, _direction);\n                            break;\n                        // Expected CloseTime: next month on the 1st at market open time\n                        case DayOfWeek.Tuesday:\n                            yield return Insight.Price(symbol, Expiry.EndOfMonth, _direction);\n                            break;\n                        // Expected CloseTime: next Monday at market open time\n                        case DayOfWeek.Wednesday:\n                            yield return Insight.Price(symbol, Expiry.EndOfWeek, _direction);\n                            break;\n                        // Expected CloseTime: next day (Friday) at market open time\n                        case DayOfWeek.Thursday:\n                            yield return Insight.Price(symbol, Expiry.EndOfDay, _direction);\n                            break;\n                        default:\n                            yield break;\n                    }\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/ExtendedMarketHoursHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing doing some history requests outside market hours, reproducing GH issue #4783\n    /// </summary>\n    public class ExtendedMarketHoursHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _minuteHistoryCount;\n        private int _hourHistoryCount;\n        private int _dailyHistoryCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 09);\n            SetCash(100000);\n\n            AddEquity(\"SPY\", Resolution.Minute, extendedMarketHours:true, fillForward:false);\n\n            Schedule.On(\"RunHistoryCall\", DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(1)), RunHistoryCall);\n        }\n\n        private void RunHistoryCall()\n        {\n            var spy = Securities[\"SPY\"];\n            var regularHours = spy.Exchange.Hours.IsOpen(Time, false);\n            var extendedHours = !regularHours && spy.Exchange.Hours.IsOpen(Time, true);\n\n            if (regularHours)\n            {\n                _minuteHistoryCount++;\n                var history = History(spy.Symbol, 5, Resolution.Minute).Count();\n                if (history != 5)\n                {\n                    throw new RegressionTestException($\"Unexpected Minute data count: {history}\");\n                }\n            }\n            else\n            {\n                if (extendedHours)\n                {\n                    _hourHistoryCount++;\n                    var history = History(spy.Symbol, 5, Resolution.Hour).Count();\n                    if (history != 5)\n                    {\n                        throw new RegressionTestException($\"Unexpected Hour data count {history}\");\n                    }\n                }\n                else\n                {\n                    _dailyHistoryCount++;\n                    var history = History(spy.Symbol, 5, Resolution.Daily).Count();\n                    if (history != 5)\n                    {\n                        throw new RegressionTestException($\"Unexpected Daily data count {history}\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_minuteHistoryCount != 3 * 6)\n            {\n                throw new RegressionTestException($\"Unexpected minute history requests count {_minuteHistoryCount}\");\n            }\n            // 6 pre market from 4am to 9am + 4 post market 4pm to 7pm\n            if (_hourHistoryCount != 3 * 10)\n            {\n                throw new RegressionTestException($\"Unexpected hour history requests count {_hourHistoryCount}\");\n            }\n            // 0am to 3am + 8pm to 11pm, last day ends at 8pm\n            if (_dailyHistoryCount != (2 * 8 + 5))\n            {\n                throw new RegressionTestException($\"Unexpected Daily history requests count: {_dailyHistoryCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5215;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 435;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"19\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-73.997%\"},\n            {\"Drawdown\", \"2.500%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98959.88\"},\n            {\"Net Profit\", \"-1.040%\"},\n            {\"Sharpe Ratio\", \"-9.402\"},\n            {\"Sortino Ratio\", \"-9.402\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.286\"},\n            {\"Beta\", \"0.55\"},\n            {\"Annual Standard Deviation\", \"0.075\"},\n            {\"Annual Variance\", \"0.006\"},\n            {\"Information Ratio\", \"0.914\"},\n            {\"Tracking Error\", \"0.061\"},\n            {\"Treynor Ratio\", \"-1.28\"},\n            {\"Total Fees\", \"$21.45\"},\n            {\"Estimated Strategy Capacity\", \"$830000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"34.15%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6ebe462373e2ecc22de8eb2fe114d704\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ExtendedMarketTradingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates extended market hours trading.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"assets\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class ExtendedMarketTradingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _lastAction;\n        private Symbol _spy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            _spy = AddEquity(\"SPY\", Resolution.Minute, Market.USA, true, 0m, true).Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            //Only take an action once a day.\n            if (_lastAction.Date == Time.Date) return;\n            TradeBar spyBar = slice[\"SPY\"];\n\n            //If it isnt during market hours, go ahead and buy ten!\n            if (!InMarketHours())\n            {\n                LimitOrder(_spy, 10, spyBar.Low);\n                _lastAction = Time;\n            }\n        }\n\n        /// <summary>\n        /// Order events are triggered on order status changes. There are many order events including non-fill messages.\n        /// </summary>\n        /// <param name=\"orderEvent\">OrderEvent object with details about the order status</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (InMarketHours())\n            {\n                throw new RegressionTestException(\"Order processed during market hours.\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        /// <summary>\n        /// Check if we are in Market Hours, NYSE is open from (9:30 am to 4 pm)\n        /// </summary>\n        public bool InMarketHours()\n        {\n            TimeSpan now = Time.TimeOfDay;\n            TimeSpan open = new TimeSpan(09, 30, 0);\n            TimeSpan close = new TimeSpan(16, 0, 0);\n\n            return (open < now) && (close > now);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 9643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"10.774%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100135.59\"},\n            {\"Net Profit\", \"0.136%\"},\n            {\"Sharpe Ratio\", \"8.723\"},\n            {\"Sortino Ratio\", \"41.728\"},\n            {\"Probabilistic Sharpe Ratio\", \"90.001%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.005\"},\n            {\"Beta\", \"0.039\"},\n            {\"Annual Standard Deviation\", \"0.009\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.852\"},\n            {\"Tracking Error\", \"0.214\"},\n            {\"Treynor Ratio\", \"2.102\"},\n            {\"Total Fees\", \"$5.00\"},\n            {\"Estimated Strategy Capacity\", \"$14000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"1.44%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"ac13139c0d75afb3d39a5143eb506658\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FeeModelNotUsingAccountCurrency.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm where custom a <see cref=\"FeeModel\"/> does not use Account the Currency\n    /// </summary>\n    public class FeeModelNotUsingAccountCurrency : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        // Adding this so we only trade once, so math is easier and clear\n        private bool _alreadyTraded;\n        private int _initialEurCash = 10000;\n        private decimal _orderFeesInAccountCurrency;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 4); // Set Start Date\n            SetEndDate(2018, 4, 4); // Set End Date\n            // Set Strategy Cash (USD) to 0. This is required for\n            // SetHoldings(_security.Symbol, 1) not to fail\n            SetCash(0);\n\n            // EUR/USD conversion rate will be updated dynamically\n            // Note: the conversion rates are required in backtesting (for now) because of this issue:\n            // https://github.com/QuantConnect/Lean/issues/1859\n            SetCash(\"EUR\", _initialEurCash, 1.23m);\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            _security = AddCrypto(\"BTCEUR\");\n\n            // This is required because in our custom model, NonAccountCurrencyCustomFeeModel,\n            // fees will be charged in ETH (not Base, nor Quote, not account currency).\n            // Setting the cash allows the system to add a data subscription to fetch required conversion rates.\n            SetCash(\"ETH\", 0, 0m);\n            _security.FeeModel = new NonAccountCurrencyCustomFeeModel();\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_alreadyTraded)\n            {\n                _alreadyTraded = true;\n                SetHoldings(_security.Symbol, 1);\n                Debug(\"Purchased Stock\");\n            }\n            else\n            {\n                Liquidate(_security.Symbol);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(Time + \" \" + orderEvent);\n            _orderFeesInAccountCurrency +=\n                Portfolio.CashBook.ConvertToAccountCurrency(orderEvent.OrderFee.Value).Amount;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"TotalPortfolioValue: {Portfolio.TotalPortfolioValue}\");\n            Log($\"CashBook: {Portfolio.CashBook}\");\n            Log($\"Holdings.TotalCloseProfit: {_security.Holdings.TotalCloseProfit()}\");\n            // Fees will be applied to the corresponding Cash currency. 1 ETH * 2 trades\n            if (Portfolio.CashBook[\"ETH\"].Amount != -2)\n            {\n                throw new RegressionTestException(\"Unexpected ETH cash amount: \" +\n                    $\"{Portfolio.CashBook[\"ETH\"].Amount}\");\n            }\n            if (Portfolio.CashBook[\"USD\"].Amount != 0)\n            {\n                throw new RegressionTestException(\"Unexpected USD cash amount: \" +\n                    $\"{Portfolio.CashBook[\"USD\"].Amount}\");\n            }\n            if (Portfolio.CashBook[\"BTC\"].Amount != 0)\n            {\n                throw new RegressionTestException(\"Unexpected BTC cash amount: \" +\n                    $\"{Portfolio.CashBook[\"BTC\"].Amount}\");\n            }\n            if (Portfolio.CashBook.ContainsKey(Currencies.NullCurrency))\n            {\n                throw new RegressionTestException(\"Unexpected NullCurrency cash\");\n            }\n\n            var closedTrade = TradeBuilder.ClosedTrades[0];\n            var profitInQuoteCurrency = (closedTrade.ExitPrice - closedTrade.EntryPrice)\n                * closedTrade.Quantity;\n            if (Portfolio.CashBook[\"EUR\"].Amount != _initialEurCash + profitInQuoteCurrency)\n            {\n                throw new RegressionTestException(\"Unexpected EUR cash amount: \" +\n                    $\"{Portfolio.CashBook[\"EUR\"].Amount}\");\n            }\n            if (closedTrade.TotalFees != _orderFeesInAccountCurrency)\n            {\n                throw new RegressionTestException($\"Unexpected closed trades total fees {closedTrade.TotalFees}\");\n            }\n            if (_security.Holdings.TotalFees != _orderFeesInAccountCurrency)\n            {\n                throw new RegressionTestException($\"Unexpected closed trades total fees {closedTrade.TotalFees}\");\n            }\n        }\n\n        internal class NonAccountCurrencyCustomFeeModel : FeeModel\n        {\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                return new OrderFee(new CashAmount(1m, \"ETH\"));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7201;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"12300.00\"},\n            {\"End Equity\", \"11511.60\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$804.33\"},\n            {\"Estimated Strategy Capacity\", \"$11000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCEUR 2XR\"},\n            {\"Portfolio Turnover\", \"205.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ebb9bbcf4364d5dd5765f878525462d2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardEnumeratorOutOfOrderBarRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm simply fetch and compare data of minute resolution around daylight saving period\n    /// reproduces issue reported in GB issue GH issue https://github.com/QuantConnect/Lean/issues/4925\n    /// related issues https://github.com/QuantConnect/Lean/issues/3707; https://github.com/QuantConnect/Lean/issues/4630\n    /// </summary>\n    public class FillForwardEnumeratorOutOfOrderBarRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private decimal _exptectedClose = 84.09m;\n        private DateTime _exptectedTime = new DateTime(2008, 3, 10, 9, 30, 0);\n        private Symbol _shy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2008, 3, 7);\n            SetEndDate(2008, 3, 10);\n            _shy = AddEquity(\"SHY\", Resolution.Minute).Symbol;\n            // just to make debugging easier, less subscriptions\n            SetBenchmark(time => 1);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var trackingBar = slice.Bars.Values.FirstOrDefault(s => s.Time.Equals(_exptectedTime));\n\n            if (trackingBar != null)\n            {\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(_shy, 1);\n                }\n\n                if (trackingBar.Close != _exptectedClose)\n                {\n                    throw new RegressionTestException(\n                        $\"Bar at {_exptectedTime.ToStringInvariant()} closed at price {trackingBar.Close.ToStringInvariant()}; expected {_exptectedClose.ToStringInvariant()}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1561;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"16.086%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100148.25\"},\n            {\"Net Profit\", \"0.148%\"},\n            {\"Sharpe Ratio\", \"7.182\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.014\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"9.758\"},\n            {\"Tracking Error\", \"0.014\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.93\"},\n            {\"Estimated Strategy Capacity\", \"$150000.00\"},\n            {\"Lowest Capacity Asset\", \"SHY 2T\"},\n            {\"Portfolio Turnover\", \"24.91%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9d00701591b363edda102536ec5e75e0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardFromWarmUpRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert that data is fill-forwarded from the warm-up period.\n    /// </summary>\n    public class FillForwardFromWarmUpRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _firstCheck = true;\n        private DateTime _firstMarketOpen;\n\n        public override void Initialize()\n        {\n            // We only have local SPY minute data until Friday 2013-10-11\n            SetStartDate(2013, 10, 15);\n            SetEndDate(2013, 10, 16);\n\n            var equity = AddEquity(\"SPY\", Resolution.Minute, fillForward: true);\n            _firstMarketOpen = equity.Exchange.Hours.GetNextMarketOpen(Time, false);\n\n            SetBenchmark(_ => 0);\n\n            SetWarmUp(1000);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!IsWarmingUp)\n            {\n                if (_firstCheck)\n                {\n                    if (Time != _firstMarketOpen.AddMinutes(1))\n                    {\n                        throw new RegressionTestException($\"Expected first data point to be at {_firstMarketOpen.AddMinutes(1)}, but got: {Time} at {Time}\");\n                    }\n\n                    _firstCheck = false;\n                }\n\n                foreach (var data in slice.AllData)\n                {\n                    if (!data.IsFillForward)\n                    {\n                        throw new RegressionTestException($\"Expected fill forward data, but got: {data} at {Time}\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3563;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardResolutionAdjustedOnRemovalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproduces GH issue #8023, where fill forward resolution will no get updated in some cases on security removals\n    /// </summary>\n    public class FillForwardResolutionAdjustedOnRemovalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Queue<DateTime> _expectedDataTimes = new(new DateTime[]\n        {\n            new DateTime(2013, 10, 7, 9, 31, 0),\n            new DateTime(2013, 10, 7, 16, 0, 0),\n            new DateTime(2013, 10, 8, 16, 0, 0),\n            new DateTime(2013, 10, 8, 16, 0, 0), // minute data & we remove it\n            new DateTime(2013, 10, 9, 16, 0, 0),\n            new DateTime(2013, 10, 10, 16, 0, 0)\n        });\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 10);\n\n            AddFuture(\"ES\", Resolution.Minute);\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var expected = _expectedDataTimes.Dequeue();\n            if (expected != Time)\n            {\n                throw new RegressionTestException($\"Unexpected data time {expected} != {Time}\");\n            }\n\n            if (ActiveSecurities.ContainsKey(\"/ES\"))\n            {\n                if (slice.ContainsKey(\"/ES\"))\n                {\n                    RemoveSecurity(\"/ES\");\n                }\n            }\n            else if (Time == new DateTime(2013, 10, 8, 16, 0, 0))\n            {\n                // let's re add it\n                AddFuture(\"ES\", Resolution.Minute);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_expectedDataTimes.Count != 0)\n            {\n                throw new RegressionTestException($\"OnEndOfAlgorithm(): Unexpected data times!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 852;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.677\"},\n            {\"Tracking Error\", \"0.271\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardStrictEndTimeDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class FillForwardStrictEndTimeDailyRegressionAlgorithm : FillForwardStrictEndTimeHourRegressionAlgorithm\n    {\n        protected override int StartDate => 1;\n        protected override Resolution FillForwardResolution => Resolution.Daily;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 99;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.878\"},\n            {\"Tracking Error\", \"0.111\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardStrictEndTimeHourRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Text;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of fill forward when using daily strict end times\n    /// </summary>\n    public class FillForwardStrictEndTimeHourRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly bool _updateExpectedData;\n        private readonly StringBuilder _data = new();\n\n        protected virtual string ExpectedDataFile => $\"../../TestData/{GetType().Name}.zip\";\n        protected virtual int StartDate => 4;\n        protected virtual Resolution FillForwardResolution => Resolution.Hour;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, StartDate);\n            SetEndDate(2021, 1, 15);\n\n            AddIndex(\"SPX\", Resolution.Daily);\n            AddEquity(\"SPY\", FillForwardResolution);\n\n            Settings.DailyPreciseEndTime = true;\n        }\n\n        /// <summary>\n        /// Index EMA Cross trading index options of the index.\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(\"SPX\"))\n            {\n                var spxData = slice.Bars[\"SPX\"];\n                var message = $\"{Time.ToString(CultureInfo.GetCultureInfo(\"en-US\"))} ==== FF {spxData.IsFillForward}. {spxData.ToString().Replace(',', '.')} {spxData.Time:HH:mm:ss}->{spxData.EndTime:HH:mm:ss}\";\n                _data.AppendLine(message);\n                Debug(message);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var data = _data.ToString();\n            if (_updateExpectedData)\n            {\n                Compression.ZipData(ExpectedDataFile, new Dictionary<string, string>() { { \"zip_entry_name.txt\", data } });\n                return;\n            }\n\n            var expected  = string.Join(';', Compression.ReadLines(ExpectedDataFile)).ReplaceLineEndings(\"\");\n            if (expected != data.ReplaceLineEndings(\";\").RemoveFromEnd(\";\"))\n            {\n                throw new RegressionTestException($\"Unexpected data: \\\"{data}\\\"{Environment.NewLine}Expected: \\\"{expected}\\\"\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 222;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.208\"},\n            {\"Tracking Error\", \"0.103\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardStrictEndTimeMinuteRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class FillForwardStrictEndTimeMinuteRegressionAlgorithm : FillForwardStrictEndTimeHourRegressionAlgorithm\n    {\n        protected override int StartDate => 14;\n        protected override Resolution FillForwardResolution => Resolution.Minute;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 429;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillForwardUntilExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm checks FillForwardEnumerator should FF the data until it reaches the delisting date\n    /// replicates GH issue https://github.com/QuantConnect/Lean/issues/4872\n    /// </summary>\n    public class FillForwardUntilExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _realEndDate = new DateTime(2014, 06, 07);\n        private SecurityExchange _exchange;\n        private Dictionary<Symbol, HashSet<DateTime>> _options;\n\n        private string[] _contracts =\n        {\n            \"TWX   140621P00067500\",\n            \"TWX   140621C00067500\",\n            \"TWX   140621C00070000\",\n            \"TWX   140621P00070000\"\n        };\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 30);\n\n            _options = new Dictionary<Symbol, HashSet<DateTime>>();\n            var _twxOption = AddOption(\"TWX\", Resolution.Minute);\n            _exchange = _twxOption.Exchange;\n            _twxOption.SetFilter((x) => x\n                .Contracts(c => c.Where(s => _contracts.Contains(s.Symbol.Value))));\n            SetBenchmark(t => 1);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var value in slice.OptionChains.Values)\n            {\n                foreach (var contact in value.Contracts)\n                {\n                    BaseData bar = null;\n                    QuoteBar quoteBar;\n                    if (bar == null && value.QuoteBars.TryGetValue(contact.Key, out quoteBar))\n                    {\n                        bar = quoteBar;\n                    }\n                    TradeBar tradeBar;\n                    if (bar == null && value.TradeBars.TryGetValue(contact.Key, out tradeBar))\n                    {\n                        bar = tradeBar;\n                    }\n                    if (bar.IsFillForward)\n                    {\n                        _options[contact.Key].Add(value.Time.Date);\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.AddedSecurities.OfType<Option>())\n            {\n                _options.Add(security.Symbol, new HashSet<DateTime>());\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_options.Count != _contracts.Length)\n            {\n                throw new RegressionTestException($\"Options weren't setup properly. Expected: {_contracts.Length}\");\n            }\n\n            foreach (var option in _options)\n            {\n                for (DateTime date = _realEndDate; date < option.Key.ID.Date; date = date.AddDays(1))\n                {\n                    if (_exchange.Hours.IsDateOpen(date) &&\n                        !option.Value.Contains(date))\n                    {\n                        throw new RegressionTestException(\"Delisted security should be FF until expiry date\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 70553;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillOutsideHoursDailyResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that orders submitted outside of market hours are:\n    ///     - Filled outside of market hours for daily resolution\n    ///     - Not filled outside of market hours for the rest of the resolutions\n    ///\n    /// This specific algorithm tests this for daily resolution.\n    /// </summary>\n    public class FillOutsideHoursDailyResolutionAlgorithm : FillOutsideHoursMinuteResolutionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 24;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.32\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2d975133eed041a4062bb802855a0e63\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillOutsideHoursHourResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that orders submitted outside of market hours are:\n    ///     - Filled outside of market hours for daily resolution\n    ///     - Not filled outside of market hours for the rest of the resolutions\n    ///\n    /// This specific algorithm tests this for hour resolution.\n    /// </summary>\n    public class FillOutsideHoursHourResolutionAlgorithm : FillOutsideHoursMinuteResolutionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 36;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.22\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$51000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2c05d63210efddda66bbf5b84dcc4812\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillOutsideHoursMinuteResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that orders submitted outside of market hours are:\n    ///     - Filled outside of market hours for daily resolution\n    ///     - Not filled outside of market hours for the rest of the resolutions\n    ///\n    /// This specific algorithm tests this for minute resolution and is intended to be used as a base class for the other resolutions.\n    /// </summary>\n    public class FillOutsideHoursMinuteResolutionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual Resolution Resolution => Resolution.Minute;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            SetCash(100000);\n\n            var spy = AddEquity(\"SPY\", Resolution);\n\n            Schedule.On(DateRules.Today, TimeRules.At(new TimeSpan(23, 0, 0)), () =>\n            {\n                if (!Portfolio.Invested && spy.HasData)\n                {\n                    var ticket = SubmitOrderRequest(new SubmitOrderRequest(OrderType.Market, spy.Type, spy.Symbol, 1, 0, 0, Time, \"\"));\n\n                    if (Resolution == Resolution.Daily)\n                    {\n                        if (ticket.Status != OrderStatus.Filled)\n                        {\n                            throw new RegressionTestException($\"Order was expected to be filled on {Time}. Resolution: {Resolution}\");\n                        }\n                    }\n                    else if (ticket.Status.IsFill())\n                    {\n                        throw new RegressionTestException($\"Order was not expected to be filled on {Time}. Resolution: {Resolution}\");\n                    }\n                }\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 1582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$12000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6a55ff7bccb41a538e1733ccbde482b3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillOutsideHoursSecondResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that orders submitted outside of market hours are:\n    ///     - Filled outside of market hours for daily resolution\n    ///     - Not filled outside of market hours for the rest of the resolutions\n    ///\n    /// This specific algorithm tests this for second resolution.\n    /// </summary>\n    public class FillOutsideHoursSecondResolutionAlgorithm : FillOutsideHoursMinuteResolutionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Second;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 93622;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.31\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$82000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3e9c095446309af56fb68a5c2de098d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FillOutsideHoursTickResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that orders submitted outside of market hours are:\n    ///     - Filled outside of market hours for daily resolution\n    ///     - Not filled outside of market hours for the rest of the resolutions\n    ///\n    /// This specific algorithm tests this for tick resolution.\n    /// </summary>\n    public class FillOutsideHoursTickResolutionAlgorithm : FillOutsideHoursMinuteResolutionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Tick;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 6877089;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.33\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"baab871855df123de17fb010951f55da\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FilteredIdentityAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of the Identity indicator with the filtering enhancement. Filtering is used to check\n    /// the output of the indicator before returning it.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    public class FilteredIdentityAlgorithm : QCAlgorithm\n    {\n        private Symbol _symbol;\n        private FilteredIdentity _identity;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 5, 2);  //Set Start Date\n            SetEndDate(StartDate);     //Set End Date\n            SetCash(100000);           //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            var security = AddForex(\"EURUSD\", Resolution.Tick);\n\n            _symbol = security.Symbol;\n            _identity = FilteredIdentity(_symbol, filter: Filter);\n        }\n\n        /// <summary>\n        /// Filter function: if data is a tick of TickType.Trade\n        /// </summary>\n        /// <param name=\"data\">Data for applying the filter</param>\n        /// <returns>True if we have TickType.Trade</returns>\n        private bool Filter(IBaseData data)\n        {\n            var tick = data as Tick;\n            if (tick != null)\n            {\n                return tick.TickType == TickType.Trade;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // Since we are only accepting TickType.Trade,\n            // this indicator will never be ready\n            if (!_identity.IsReady) return;\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FinancialAdvisorDemoAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates how to submit orders to a Financial Advisor account group, allocation profile or a single managed account.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"financial advisor\" />\n    public class FinancialAdvisorDemoAlgorithm : QCAlgorithm\n    {\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            _symbol = AddEquity(\"SPY\").Symbol;\n\n            // The default order properties can be set here to choose the FA settings\n            // to be automatically used in any order submission method (such as SetHoldings, Buy, Sell and Order)\n\n            // Use a default FA Account Group with an Allocation Method\n            DefaultOrderProperties = new InteractiveBrokersOrderProperties\n            {\n                // account group created manually in IB/TWS\n                FaGroup = \"TestGroupEQ\",\n                // supported allocation methods are: EqualQuantity, NetLiq, AvailableEquity, PctChange\n                FaMethod = \"EqualQuantity\"\n            };\n\n            // set a default FA Allocation Profile\n            //DefaultOrderProperties = new InteractiveBrokersOrderProperties\n            //{\n            //    // allocation profile created manually in IB/TWS\n            //    FaProfile = \"TestProfileP\"\n            //};\n\n            // send all orders to a single managed account\n            //DefaultOrderProperties = new InteractiveBrokersOrderProperties\n            //{\n            //    // a sub-account linked to the Financial Advisor master account\n            //    Account = \"DU123456\"\n            //};\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                // when logged into IB as a Financial Advisor, this call will use order properties\n                // set in the DefaultOrderProperties property of QCAlgorithm\n                SetHoldings(_symbol, 1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FineFundamentalFilteredUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which tests a fine fundamental filtered universe, related to GH issue 4127\n    /// </summary>\n    public class FineFundamentalFilteredUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 10, 08);\n            SetEndDate(2014, 10, 13);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            var customUniverseSymbol = new Symbol(SecurityIdentifier.GenerateConstituentIdentifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.Equity,\n                    Market.USA),\n                \"constituents-universe-qctest\");\n\n            // we use test ConstituentsUniverse\n            AddUniverse(new ConstituentsUniverse(customUniverseSymbol, UniverseSettings), FineSelectionFunction);\n        }\n\n        private IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> data)\n        {\n            return data.Where(fundamental => fundamental.CompanyProfile.HeadquarterCity.Equals(\"Cupertino\"))\n                .Select(fundamental => fundamental.Symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (slice.Keys.Single().Value != \"AAPL\")\n                {\n                    throw new RegressionTestException($\"Unexpected symbol was added to the universe: {slice.Keys.Single()}\");\n                }\n                SetHoldings(slice.Keys.Single(), 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 41;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-66.721%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98306.39\"},\n            {\"Net Profit\", \"-1.694%\"},\n            {\"Sharpe Ratio\", \"-9.567\"},\n            {\"Sortino Ratio\", \"-11.484\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.261\"},\n            {\"Beta\", \"0.353\"},\n            {\"Annual Standard Deviation\", \"0.061\"},\n            {\"Annual Variance\", \"0.004\"},\n            {\"Information Ratio\", \"3.33\"},\n            {\"Tracking Error\", \"0.1\"},\n            {\"Treynor Ratio\", \"-1.655\"},\n            {\"Total Fees\", \"$21.85\"},\n            {\"Estimated Strategy Capacity\", \"$360000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"16.82%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6f46dbb94071af805eee55f78adf3a23\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a test case for adding forex symbols at a higher resolution of an existing internal feed.\n    /// The second symbol is added in the OnData method.\n    /// </summary>\n    public class ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<Symbol, int> _dataPointsPerSymbol = new Dictionary<Symbol, int>();\n        private bool _added;\n        private Symbol _eurusd;\n        private DateTime lastDataTime = DateTime.MinValue;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 8);\n            SetCash(100000);\n\n            _eurusd = QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda);\n            var eurgbp = AddForex(\"EURGBP\", Resolution.Daily);\n            _dataPointsPerSymbol.Add(eurgbp.Symbol, 0);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (lastDataTime == slice.Time)\n            {\n                throw new RegressionTestException(\"Duplicate time for current data and last data slice\");\n            }\n\n            lastDataTime = slice.Time;\n\n            if (_added)\n            {\n                var eurUsdSubscription = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_eurusd, includeInternalConfigs:true)\n                    .Single();\n                if (eurUsdSubscription.IsInternalFeed)\n                {\n                    throw new RegressionTestException(\"Unexpected internal 'EURUSD' Subscription\");\n                }\n            }\n            if (!_added)\n            {\n                var eurUsdSubscription = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_eurusd, includeInternalConfigs: true)\n                    .Single();\n                if (!eurUsdSubscription.IsInternalFeed)\n                {\n                    throw new RegressionTestException(\"Unexpected not internal 'EURUSD' Subscription\");\n                }\n                AddForex(\"EURUSD\", Resolution.Hour);\n                _dataPointsPerSymbol.Add(_eurusd, 0);\n\n                _added = true;\n            }\n\n            foreach (var kvp in slice)\n            {\n                var symbol = kvp.Key;\n                _dataPointsPerSymbol[symbol]++;\n\n                Log($\"{Time} {symbol.Value} {kvp.Value.Price} EndTime {kvp.Value.EndTime}\");\n            }\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            // EURUSD has only one day of hourly data, because it was added on the first time step instead of during Initialize\n            var expectedDataPointsPerSymbol = new Dictionary<string, int>\n            {\n                // 1 daily bar 10/7/2013 8:00:00 PM\n                // Hour resolution 'EURUSD added\n                // 1 daily bar '10/8/2013 8:00:00 PM'\n                // we start to FF\n                // +4 fill forwarded bars till '10/9/2013 12:00:00 AM'\n                { \"EURGBP\", 6},\n                { \"EURUSD\", 28 }\n            };\n\n            foreach (var kvp in _dataPointsPerSymbol)\n            {\n                var symbol = kvp.Key;\n                var actualDataPoints = _dataPointsPerSymbol[symbol];\n                Log($\"Data points for symbol {symbol.Value}: {actualDataPoints}\");\n\n                if (actualDataPoints != expectedDataPointsPerSymbol[symbol.Value])\n                {\n                    throw new RegressionTestException($\"Data point count mismatch for symbol {symbol.Value}: expected: {expectedDataPointsPerSymbol[symbol.Value]}, actual: {actualDataPoints}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 64;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a test case for adding forex symbols at the same resolution of an existing internal feed.\n    /// The second symbol is added in the OnData method.\n    /// </summary>\n    public class ForexInternalFeedOnDataSameResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<Symbol, int> _dataPointsPerSymbol = new Dictionary<Symbol, int>();\n        private bool _added;\n        private Symbol _eurusd;\n        private DateTime lastDataTime = DateTime.MinValue;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 8);\n            SetCash(100000);\n\n            _eurusd = QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda);\n            var eurgbp = AddForex(\"EURGBP\", Resolution.Daily);\n            _dataPointsPerSymbol.Add(eurgbp.Symbol, 0);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (lastDataTime == slice.Time)\n            {\n                throw new RegressionTestException(\"Duplicate time for current data and last data slice\");\n            }\n\n            lastDataTime = slice.Time;\n\n            if (_added)\n            {\n                var eurUsdSubscription = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_eurusd, includeInternalConfigs: true)\n                    .Single();\n                if (eurUsdSubscription.IsInternalFeed)\n                {\n                    throw new RegressionTestException(\"Unexpected internal 'EURUSD' Subscription\");\n                }\n            }\n            if (!_added)\n            {\n                var eurUsdSubscription = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_eurusd, includeInternalConfigs: true)\n                    .Single();\n                if (!eurUsdSubscription.IsInternalFeed)\n                {\n                    throw new RegressionTestException(\"Unexpected not internal 'EURUSD' Subscription\");\n                }\n                var eurusd = AddForex(\"EURUSD\", Resolution.Daily);\n                _dataPointsPerSymbol.Add(eurusd.Symbol, 0);\n\n                _added = true;\n            }\n\n            foreach (var kvp in slice)\n            {\n                var symbol = kvp.Key;\n                _dataPointsPerSymbol[symbol]++;\n\n                Log($\"{Time} {symbol.Value} {kvp.Value.Price} EndTime {kvp.Value.EndTime}\");\n            }\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            // EURUSD has one less data point, because it was added on the first time step instead of during Initialize\n            var expectedDataPointsPerSymbol = new Dictionary<string, int>\n            {\n                // normal feed\n                { \"EURGBP\", 3 },\n                // internal feed on the first day, normal feed on the other two days\n                { \"EURUSD\", 2 },\n                // internal feed only\n                { \"GBPUSD\", 0 }\n            };\n\n            foreach (var kvp in _dataPointsPerSymbol)\n            {\n                var symbol = kvp.Key;\n                var actualDataPoints = _dataPointsPerSymbol[symbol];\n                Log($\"Data points for symbol {symbol.Value}: {actualDataPoints}\");\n\n                if (actualDataPoints != expectedDataPointsPerSymbol[symbol.Value])\n                {\n                    throw new RegressionTestException($\"Data point count mismatch for symbol {symbol.Value}: expected: {expectedDataPointsPerSymbol[symbol.Value]}, actual: {actualDataPoints}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 32;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.91\"},\n            {\"Tracking Error\", \"0.13\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ForexMultiResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a test case for forex symbols at multiple resolutions.\n    /// </summary>\n    public class ForexMultiResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<Symbol, int> _dataPointsPerSymbol = new();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 8);\n\n            var eurgbp = AddForex(\"EURGBP\", Resolution.Daily);\n            _dataPointsPerSymbol.Add(eurgbp.Symbol, 0);\n\n            var gbpusd = AddForex(\"EURUSD\", Resolution.Hour);\n            _dataPointsPerSymbol.Add(gbpusd.Symbol, 0);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var kvp in slice)\n            {\n                var symbol = kvp.Key;\n                _dataPointsPerSymbol[symbol]++;\n\n                if (symbol == \"EURUSD\" && kvp.Value.IsFillForward)\n                {\n                    throw new RegressionTestException($\"Unexpected fill forward for 'EURUSD' bar at {Time}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (// first bat at '10/7/2013 8:00:00 PM' + hour FFing until next bar '10/8/2013 8:00:00 PM' + 4 more FF bars until 10/9/2013 12:00:00 AM\n                _dataPointsPerSymbol[\"EURGBP\"] != 29\n                // data from '10/7/2013 12:00:00 AM' to '10/9/2013 12:00:00 AM'\n                || _dataPointsPerSymbol[\"EURUSD\"] != 49)\n            {\n                throw new RegressionTestException($\"Data point count mismatch for symbol {string.Join(\",\", _dataPointsPerSymbol.Select(kvp => $\"{kvp.Key}:{kvp.Value}\"))}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 100;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 55;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ForwardDataOnlyFillModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fills;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example of custom fill model for security to only fill bars of data obtained after the order was placed. This is to encourage more\n    /// pessimistic fill models and eliminate the possibility to fill on old market data that may not be relevant.\n    /// </summary>\n    public class ForwardDataOnlyFillModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 10, 31);\n\n            var security = AddEquity(\"SPY\", Resolution.Hour);\n            security.SetFillModel(new ForwardDataOnlyFillModel());\n\n            Schedule.On(DateRules.WeekStart(), TimeRules.AfterMarketOpen(security.Symbol), Trade);\n        }\n\n        public void Trade()\n        {\n            if (!Portfolio.Invested)\n            {\n                if(Time.TimeOfDay != new TimeSpan(9, 30, 0))\n                {\n                    throw new RegressionTestException($\"Unexpected event time {Time}\");\n                }\n\n                var ticket = Buy(\"SPY\", 1);\n                if(ticket.Status != OrderStatus.Submitted)\n                {\n                    throw new RegressionTestException($\"Unexpected order status {ticket.Status}\");\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"OnOrderEvent:: {orderEvent}\");\n            if (orderEvent.Status == OrderStatus.Filled && (Time.Hour != 10 || Time.Minute != 0))\n            {\n                throw new RegressionTestException($\"Unexpected fill time {Time}\");\n            }\n        }\n\n        public class ForwardDataOnlyFillModel : EquityFillModel\n        {\n            public override Fill Fill(FillModelParameters parameters)\n            {\n                var orderLocalTime = parameters.Order.Time.ConvertFromUtc(parameters.Security.Exchange.TimeZone);\n                foreach (var dataType in new[] { typeof(QuoteBar), typeof(TradeBar), typeof(Tick)})\n                {\n                    if(parameters.Security.Cache.TryGetValue(dataType, out var data) && data.Count > 0 && orderLocalTime <= data[data.Count - 1].EndTime)\n                    {\n                        return base.Fill(parameters);\n                    }\n                }\n                return new Fill(new List<OrderEvent>());\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 330;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.071%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100005.93\"},\n            {\"Net Profit\", \"0.006%\"},\n            {\"Sharpe Ratio\", \"-47.299\"},\n            {\"Sortino Ratio\", \"-100.304\"},\n            {\"Probabilistic Sharpe Ratio\", \"81.116%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.007\"},\n            {\"Beta\", \"0.001\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.425\"},\n            {\"Tracking Error\", \"0.107\"},\n            {\"Treynor Ratio\", \"-5.375\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$62000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"86f6dc102fded318c6264e36a56567b7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FractionalQuantityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for fractional forex pair\n    /// </summary>\n    public class FractionalQuantityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2015, 11, 12);\n            SetEndDate(2016, 04, 01);\n\n            //Set the cash for the strategy:\n            SetCash(100000);\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            SetTimeZone(NodaTime.DateTimeZone.Utc);\n            var security = AddSecurity(SecurityType.Crypto, \"BTCUSD\", Resolution.Daily, Market.GDAX, false, 1, true);\n\n            // The default buying power model for the Crypto security type is now CashBuyingPowerModel.\n            // Since this test algorithm uses leverage we need to set a buying power model with margin.\n            security.SetBuyingPowerModel(new SecurityMarginModel(3.3m));\n\n            var con = new TradeBarConsolidator(1);\n            SubscriptionManager.AddConsolidator(\"BTCUSD\", con);\n            con.DataConsolidated += DataConsolidated;\n            SetBenchmark(security.Symbol);\n        }\n\n        private void DataConsolidated(object sender, TradeBar e)\n        {\n            var quantity = Math.Truncate((Portfolio.Cash + Portfolio.TotalFees) / Math.Abs(e.Value + 1));\n            if (!Portfolio.Invested)\n            {\n                Order(\"BTCUSD\", quantity);\n            }\n            else if (Portfolio[\"BTCUSD\"].Quantity == quantity)\n            {\n                Order(\"BTCUSD\", 0.1);\n            }\n            else if (Portfolio[\"BTCUSD\"].Quantity == quantity + 0.1m)\n            {\n                Order(\"BTCUSD\", 0.01);\n            }\n            else if (Portfolio[\"BTCUSD\"].Quantity == quantity + 0.11m)\n            {\n                Order(\"BTCUSD\", -0.02);\n            }\n            else if (Portfolio[\"BTCUSD\"].Quantity == quantity + 0.09m)\n            {\n                //should fail (below minimum order quantity)\n                Order(\"BTCUSD\", 0.00001);\n\n                SetHoldings(\"BTCUSD\", -2.0m);\n                SetHoldings(\"BTCUSD\", 2.0m);\n                Quit();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 37;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"6.02%\"},\n            {\"Average Loss\", \"-2.40%\"},\n            {\"Compounding Annual Return\", \"1497.266%\"},\n            {\"Drawdown\", \"5.500%\"},\n            {\"Expectancy\", \"1.339\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"113775.23\"},\n            {\"Net Profit\", \"13.775%\"},\n            {\"Sharpe Ratio\", \"4.906\"},\n            {\"Sortino Ratio\", \"11.482\"},\n            {\"Probabilistic Sharpe Ratio\", \"63.428%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"2.51\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.456\"},\n            {\"Annual Variance\", \"0.208\"},\n            {\"Information Ratio\", \"4.922\"},\n            {\"Tracking Error\", \"0.456\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2650.41\"},\n            {\"Estimated Strategy Capacity\", \"$29000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"46.79%\"},\n            {\"Drawdown Recovery\", \"14\"},\n            {\"OrderListHash\", \"70610cb67cc63d197e22ca71180b2df2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FreePortfolioValueFixedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting setting a free portfolio value disabled trailing behavior, see GH issue #4104\n    /// </summary>\n    public class FreePortfolioValueFixedRegressionAlgorithm : FreePortfolioValueRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            Settings.FreePortfolioValue = 500;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var freePortfolioValue = Portfolio.TotalPortfolioValue - Portfolio.TotalPortfolioValueLessFreeBuffer;\n            if (freePortfolioValue != 500)\n            {\n                throw new RegressionTestException($\"Unexpected FreePortfolioValue value: {freePortfolioValue}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"8.184%\"},\n            {\"Drawdown\", \"55.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"2256717.28\"},\n            {\"Net Profit\", \"125.672%\"},\n            {\"Sharpe Ratio\", \"0.36\"},\n            {\"Sortino Ratio\", \"0.365\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.163%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0\"},\n            {\"Beta\", \"0.999\"},\n            {\"Annual Standard Deviation\", \"0.164\"},\n            {\"Annual Variance\", \"0.027\"},\n            {\"Information Ratio\", \"-0.088\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"0.059\"},\n            {\"Total Fees\", \"$43.54\"},\n            {\"Estimated Strategy Capacity\", \"$800000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.03%\"},\n            {\"Drawdown Recovery\", \"1772\"},\n            {\"OrderListHash\", \"35a80cea61c70c130ca87efeaa06cee6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FreePortfolioValueRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduced GH issue 3759 (performing 26 trades).\n    /// </summary>\n    public class FreePortfolioValueRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2007, 10, 1);\n            SetEndDate(2018, 2, 1);\n            SetCash(1000000);\n\n            UniverseSettings.Leverage = 1;\n            SetUniverseSelection(\n                new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA))\n            );\n            SetAlpha(\n                new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, QuantConnect.Time.OneDay, 0.025, null)\n            );\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var freePortfolioValue = Portfolio.TotalPortfolioValue - Portfolio.TotalPortfolioValueLessFreeBuffer;\n            if (freePortfolioValue != Portfolio.TotalPortfolioValue * Settings.FreePortfolioValuePercentage)\n            {\n                throw new RegressionTestException($\"Unexpected FreePortfolioValue value: {freePortfolioValue}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n             Debug($\"OnOrderEvent: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 20812;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.06%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"8.174%\"},\n            {\"Drawdown\", \"55.100%\"},\n            {\"Expectancy\", \"2.639\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"2254609.41\"},\n            {\"Net Profit\", \"125.461%\"},\n            {\"Sharpe Ratio\", \"0.36\"},\n            {\"Sortino Ratio\", \"0.365\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.164%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"6.28\"},\n            {\"Alpha\", \"-0\"},\n            {\"Beta\", \"0.998\"},\n            {\"Annual Standard Deviation\", \"0.164\"},\n            {\"Annual Variance\", \"0.027\"},\n            {\"Information Ratio\", \"-0.192\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"0.059\"},\n            {\"Total Fees\", \"$45.46\"},\n            {\"Estimated Strategy Capacity\", \"$480000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.03%\"},\n            {\"Drawdown Recovery\", \"1772\"},\n            {\"OrderListHash\", \"bc1c4bb38b3c1c39eb3d1aba5a671bba\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuncRiskFreeRateInterestRateModelWithPythonLambda.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Asserts we can use a C# function as a FuncRiskFreeRateInterestRateModel\n    /// </summary>\n    public class FuncRiskFreeRateInterestRateModelWithPythonLambda: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        FuncRiskFreeRateInterestRateModel _model;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 5, 28);\n            SetEndDate(2020, 6, 28);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n            _model = new FuncRiskFreeRateInterestRateModel(dt => dt.Date == new DateTime(2020, 5, 28) ? 0 : 1);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Date == (new DateTime(2020, 5, 28)) && _model.GetInterestRate(Time) != 0)\n            {\n                throw new RegressionTestException($\"Risk Free interest rate should be 0, but was {_model.GetInterestRate(Time)}\");\n            }\n            else if (Time.Date != (new DateTime(2020, 5, 28)) && _model.GetInterestRate(Time) != 1)\n            {\n                throw new RegressionTestException($\"Risk Free interest rate should be 1, but was {_model.GetInterestRate(Time)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 185;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0.069\"},\n            {\"Tracking Error\", \"0.243\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FundamentalCustomSelectionTimeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm for scheduled universe selection GH 3890\n    /// </summary>\n    public class FundamentalCustomSelectionTimeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _specificDateSelection;\n        private int _monthStartSelection;\n        private int _monthEndSelection;\n        private readonly Symbol _symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 05, 10);\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Test use case A\n            AddUniverse(DateRules.MonthStart(), SelectionFunction_MonthStart);\n\n            // Test use case B\n            var otherSettings = new UniverseSettings(UniverseSettings);\n            otherSettings.Schedule.On(DateRules.MonthEnd());\n            AddUniverse(FundamentalUniverse.USA(SelectionFunction_MonthEnd, otherSettings));\n\n            // Test use case C\n            UniverseSettings.Schedule.On(DateRules.On(new DateTime(2014, 05, 9)));\n            AddUniverse(FundamentalUniverse.USA(SelectionFunction_SpecificDate));\n        }\n\n        public IEnumerable<Symbol> SelectionFunction_SpecificDate(IEnumerable<Fundamental> coarse)\n        {\n            _specificDateSelection++;\n            if (Time != new DateTime(2014, 05, 9))\n            {\n                throw new RegressionTestException($\"SelectionFunction_SpecificDate unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        public IEnumerable<Symbol> SelectionFunction_MonthStart(IEnumerable<Fundamental> coarse)\n        {\n            if (_monthStartSelection++ == 0)\n            {\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"Month Start unexpected initial selection: {Time}\");\n                }\n            }\n            else if (Time != new DateTime(2014, 4, 1)\n                && Time != new DateTime(2014, 5, 1))\n            {\n                throw new RegressionTestException($\"Month Start unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        public IEnumerable<Symbol> SelectionFunction_MonthEnd(IEnumerable<CoarseFundamental> coarse)\n        {\n            if (_monthEndSelection++ == 0)\n            {\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException($\"Month End unexpected initial selection: {Time}\");\n                }\n            }\n            else if (Time != new DateTime(2014, 3, 31)\n                && Time != new DateTime(2014, 4, 30))\n            {\n                throw new RegressionTestException($\"Month End unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 1);\n                Debug($\"Purchased Stock {_symbol}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_monthEndSelection != 3)\n            {\n                throw new RegressionTestException($\"Month End unexpected selection count: {_monthEndSelection}\");\n            }\n            if (_monthStartSelection != 3)\n            {\n                throw new RegressionTestException($\"Month start unexpected selection count: {_monthStartSelection}\");\n            }\n            if (_specificDateSelection != 1)\n            {\n                throw new RegressionTestException($\"Specific date unexpected selection count: {_specificDateSelection}\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14466;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4.334%\"},\n            {\"Drawdown\", \"3.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100532.22\"},\n            {\"Net Profit\", \"0.532%\"},\n            {\"Sharpe Ratio\", \"0.28\"},\n            {\"Sortino Ratio\", \"0.283\"},\n            {\"Probabilistic Sharpe Ratio\", \"39.422%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.022\"},\n            {\"Beta\", \"1.018\"},\n            {\"Annual Standard Deviation\", \"0.099\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-2.462\"},\n            {\"Tracking Error\", \"0.009\"},\n            {\"Treynor Ratio\", \"0.027\"},\n            {\"Total Fees\", \"$3.07\"},\n            {\"Estimated Strategy Capacity\", \"$920000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.20%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"87438e51988f37757a2d7f97389483ea\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FundamentalCustomSelectionTimeWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm for scheduled universe selection and warmup GH 3890\n    /// </summary>\n    public class FundamentalCustomSelectionTimeWarmupRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly TimeSpan _warmupSpan = TimeSpan.FromDays(3);\n        private int _specificDateSelection;\n        private int _monthStartSelection;\n        private readonly Symbol _symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 27);\n            SetEndDate(2014, 05, 10);\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverse(DateRules.MonthStart(), SelectionFunction_MonthStart);\n\n            UniverseSettings.Schedule.On(DateRules.On(\n                new DateTime(2013, 05, 9), // really old date will be ignored\n                new DateTime(2014, 03, 24), // data for this date will be used to trigger the initial selection\n                new DateTime(2014, 03, 26), // date during warmup\n                new DateTime(2014, 05, 9), // after warmup\n                new DateTime(2020, 05, 9))); // after backtest ends -> wont be executed\n            AddUniverse(FundamentalUniverse.USA(SelectionFunction_SpecificDate));\n\n            SetWarmUp(_warmupSpan);\n        }\n\n        public IEnumerable<Symbol> SelectionFunction_SpecificDate(IEnumerable<Fundamental> coarse)\n        {\n            if (_specificDateSelection++ == 0)\n            {\n                if (Time != StartDate.Add(-_warmupSpan))\n                {\n                    throw new RegressionTestException($\"Month Start unexpected initial selection: {Time}\");\n                }\n            }\n            else if (Time != new DateTime(2014, 3, 26)\n                && Time != new DateTime(2014, 5, 9))\n            {\n                throw new RegressionTestException($\"SelectionFunction_SpecificDate unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        public IEnumerable<Symbol> SelectionFunction_MonthStart(IEnumerable<Fundamental> coarse)\n        {\n            if (_monthStartSelection++ == 0)\n            {\n                if (Time != StartDate.Add(-_warmupSpan))\n                {\n                    throw new RegressionTestException($\"Month Start unexpected initial selection: {Time}\");\n                }\n            }\n            else if (Time != new DateTime(2014, 4, 1)\n                && Time != new DateTime(2014, 5, 1))\n            {\n                throw new RegressionTestException($\"Month Start unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !IsWarmingUp)\n            {\n                SetHoldings(_symbol, 1);\n                Debug($\"Purchased Stock {_symbol}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_monthStartSelection != 3)\n            {\n                throw new RegressionTestException($\"Month start unexpected selection count: {_monthStartSelection}\");\n            }\n            if (_specificDateSelection != 3)\n            {\n                throw new RegressionTestException($\"Specific date unexpected selection count: {_specificDateSelection}\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14470;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"13.629%\"},\n            {\"Drawdown\", \"3.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101540.32\"},\n            {\"Net Profit\", \"1.540%\"},\n            {\"Sharpe Ratio\", \"0.947\"},\n            {\"Sortino Ratio\", \"0.896\"},\n            {\"Probabilistic Sharpe Ratio\", \"49.649%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.019\"},\n            {\"Beta\", \"0.99\"},\n            {\"Annual Standard Deviation\", \"0.096\"},\n            {\"Annual Variance\", \"0.009\"},\n            {\"Information Ratio\", \"-2.694\"},\n            {\"Tracking Error\", \"0.007\"},\n            {\"Treynor Ratio\", \"0.092\"},\n            {\"Total Fees\", \"$3.09\"},\n            {\"Estimated Strategy Capacity\", \"$800000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.27%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8c0997bfe6577a63b266bcf91bce1882\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FundamentalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to define a universe using the fundamental data\n    /// </summary>\n    public class FundamentalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbolsFundamental = 2;\n\n        private SecurityChanges _changes = SecurityChanges.None;\n        private Universe _universe;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 26);\n            SetEndDate(2014, 04, 07);\n\n            _universe = AddUniverse(FundamentalSelectionFunction);\n\n            // before we add any symbol\n            AssertFundamentalUniverseData();\n\n            AddEquity(\"SPY\");\n            AddEquity(\"AAPL\");\n\n            // Request fundamental data for symbols at current algorithm time\n            var ibm = QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var ibmFundamental = Fundamentals(ibm);\n            if (Time != StartDate || Time != ibmFundamental.EndTime)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(Fundamental)} time {ibmFundamental.EndTime}\");\n            }\n            if (ibmFundamental.Price == 0)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(Fundamental)} IBM price!\");\n            }\n\n            var nb = QuantConnect.Symbol.Create(\"NB\", SecurityType.Equity, Market.USA);\n            var fundamentals = Fundamentals(new List<Symbol>{ nb, ibm }).ToList();\n            if (fundamentals.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(Fundamental)} count {fundamentals.Count}! Expected 2\");\n            }\n\n            // Request historical fundamental data for symbols\n            var history = History<Fundamental>(Securities.Keys, new TimeSpan(2, 0, 0, 0)).ToList();\n            if(history.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(Fundamental)} history count {history.Count}! Expected 2\");\n            }\n\n            if (history[0].Values.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(Fundamental)} data count {history[0].Values.Count}, expected 2!\");\n            }\n\n            // assert all fundamental API data match\n            foreach (var ticker in new[] {\"AAPL\", \"SPY\"})\n            {\n                var fundamentalThroughSecurity = Securities[ticker].Fundamentals;\n                var fundamentalThroughAlgo = Fundamentals(ticker);\n\n                if (!history[1].TryGetValue(ticker, out var fundamental) || fundamental.Price == 0\n                    || fundamentalThroughSecurity.Price != fundamental.Price\n                    || fundamentalThroughSecurity.EndTime != fundamental.EndTime\n                    || fundamentalThroughAlgo.Price != fundamental.Price\n                    || fundamentalThroughAlgo.EndTime != fundamental.EndTime)\n                {\n                    throw new RegressionTestException($\"Unexpected {ticker} fundamental data\");\n                }\n            }\n            AssertFundamentalUniverseData();\n        }\n\n        private void AssertFundamentalUniverseData()\n        {\n            // we run it twice just to match the history request data point count with the python version which has 1 extra different api test/assert\n            for (var i = 0; i < 2; i++)\n            {\n                // Request historical fundamental data for all symbols, passing the universe instance\n                var universeDataPerTime = History(_universe, new TimeSpan(2, 0, 0, 0)).ToList();\n                if (universeDataPerTime.Count != 2)\n                {\n                    throw new RegressionTestException($\"Unexpected {nameof(Fundamentals)} history count {universeDataPerTime.Count}! Expected 1\");\n                }\n\n                foreach (var universeDataCollection in universeDataPerTime)\n                {\n                    AssertFundamentalEnumerator(universeDataCollection, \"1\");\n                }\n            }\n\n            // Passing through the unvierse type and symbol\n            var enumerableOfDataDictionary = History<FundamentalUniverse>(new[] { _universe.Symbol }, 100);\n            foreach (var selectionCollectionForADay in enumerableOfDataDictionary)\n            {\n                AssertFundamentalEnumerator(selectionCollectionForADay[_universe.Symbol], \"2\");\n            }\n        }\n\n        private void AssertFundamentalEnumerator(IEnumerable<BaseData> enumerable, string caseName)\n        {\n            var dataPointCount = 0;\n            // note we need to cast to Fundamental type\n            foreach (Fundamental fundamental in enumerable)\n            {\n                dataPointCount++;\n            }\n            if (dataPointCount < 7000)\n            {\n                throw new RegressionTestException($\"Unexpected historical {nameof(Fundamentals)} data count {dataPointCount} case {caseName}! Expected > 7000\");\n            }\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbolsCoarse'\n        public IEnumerable<Symbol> FundamentalSelectionFunction(IEnumerable<Fundamental> fundamental)\n        {\n            // select only symbols with fundamental data and sort descending by daily dollar volume\n            var sortedByDollarVolume = fundamental\n                .Where(x => x.Price > 1)\n                .OrderByDescending(x => x.DollarVolume);\n\n            // sort descending by P/E ratio\n            var sortedByPeRatio = sortedByDollarVolume.OrderByDescending(x => x.ValuationRatios.PERatio);\n\n            // take the top entries from our sorted collection\n            var topFine = sortedByPeRatio.Take(NumberOfSymbolsFundamental).ToArray();\n\n            // selection fundamental data should match all other APIs\n            foreach (var fundamentalPoint in topFine)\n            {\n                var symbol = fundamentalPoint.Symbol;\n                if (fundamentalPoint.Price == 0)\n                {\n                    throw new RegressionTestException($\"Unexpected {symbol} fundamental data in selection\");\n                }\n\n                if (UniverseSettings.Asynchronous.HasValue && UniverseSettings.Asynchronous.Value)\n                {\n                    continue;\n                }\n                var fundamentalThroughSecurity = Securities.ContainsKey(symbol) ? Securities[symbol].Fundamentals : null;\n                var fundamentalThroughAlgo = Fundamentals(symbol);\n                if (fundamentalThroughSecurity != null && (fundamentalThroughSecurity.Price != fundamentalPoint.Price\n                    || fundamentalThroughSecurity.EndTime != fundamentalPoint.EndTime)\n                    || fundamentalThroughAlgo != null && (fundamentalThroughAlgo.Price != fundamentalPoint.Price\n                    || fundamentalThroughAlgo.EndTime != fundamentalPoint.EndTime))\n                {\n                    throw new RegressionTestException($\"Unexpected {symbol} fundamental data in selection\");\n                }\n            }\n\n            // we need to return only the symbol objects\n            return topFine.Select(x => x.Symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.02m);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 70972;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 16;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-1.169%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99958.14\"},\n            {\"Net Profit\", \"-0.042%\"},\n            {\"Sharpe Ratio\", \"-3.451\"},\n            {\"Sortino Ratio\", \"-4.933\"},\n            {\"Probabilistic Sharpe Ratio\", \"27.530%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.013\"},\n            {\"Beta\", \"0.043\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0.607\"},\n            {\"Tracking Error\", \"0.093\"},\n            {\"Treynor Ratio\", \"-0.381\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$1900000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.45%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"63a37fcfe86bca2e037d9dbb9c531e43\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FundamentalUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to define a universe using the fundamental data\n    /// </summary>\n    public class FundamentalUniverseSelectionRegressionAlgorithm : FundamentalRegressionAlgorithm\n    {\n        private const int NumberOfSymbolsFundamental = 2;\n\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 26);\n            SetEndDate(2014, 04, 07);\n\n            AddEquity(\"SPY\");\n            AddEquity(\"AAPL\");\n\n            SetUniverseSelection(new FundamentalUniverseSelectionModelTest());\n        }\n\n        private class FundamentalUniverseSelectionModelTest : FundamentalUniverseSelectionModel\n        {\n            public override IEnumerable<Symbol> Select(QCAlgorithm algorithm, IEnumerable<Fundamental> fundamental)\n            {\n                // select only symbols with fundamental data and sort descending by daily dollar volume\n                var sortedByDollarVolume = fundamental\n                    .Where(x => x.Price > 1)\n                    .OrderByDescending(x => x.DollarVolume);\n\n                // sort descending by P/E ratio\n                var sortedByPeRatio = sortedByDollarVolume.OrderByDescending(x => x.ValuationRatios.PERatio);\n\n                // take the top entries from our sorted collection\n                var topFine = sortedByPeRatio.Take(NumberOfSymbolsFundamental);\n\n                // we need to return only the symbol objects\n                return topFine.Select(x => x.Symbol);\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.02m);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureChainInternalSubscriptionsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #7158 where we would get future contracts which were internal\n    /// </summary>\n    public class FutureChainInternalSubscriptionsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            AddFuture(Futures.Indices.SP500EMini).SetFilter(0, 45);\n            AddFuture(Futures.Metals.Gold).SetFilter(0, 45);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            var trade = !Portfolio.Invested;\n            foreach (var chain in slice.FutureChains)\n            {\n                if (trade)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contractToTrade = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contractToTrade != null)\n                    {\n                        MarketOrder(contractToTrade.Symbol, 1);\n                    }\n                }\n\n                foreach (var contract in chain.Value)\n                {\n                    var subscriptions = SubscriptionManager.Subscriptions.Where(x => x.Symbol == contract.Symbol).ToList();\n                    if (subscriptions.Count == 0)\n                    {\n                        throw new RegressionTestException($\"Failed to find valid subscription for {contract.Symbol} at {Time}\");\n                    }\n\n                    var openInterest = Securities[contract.Symbol].OpenInterest;\n                    if(openInterest == 0)\n                    {\n                        throw new RegressionTestException($\"Open interest is 0 for {contract.Symbol} at {Time}\");\n                    }\n\n                    // Open interest should have been set to the chain contract\n                    if (contract.OpenInterest == 0)\n                    {\n                        throw new RegressionTestException($\"Open interest is 0 for {contract.Symbol} at {Time} in the chain contract\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19043;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-98.880%\"},\n            {\"Drawdown\", \"4.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96375.06\"},\n            {\"Net Profit\", \"-3.625%\"},\n            {\"Sharpe Ratio\", \"-16.733\"},\n            {\"Sortino Ratio\", \"-16.733\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"2.959\"},\n            {\"Beta\", \"-0.244\"},\n            {\"Annual Standard Deviation\", \"0.059\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-56.943\"},\n            {\"Tracking Error\", \"0.302\"},\n            {\"Treynor Ratio\", \"4.061\"},\n            {\"Total Fees\", \"$2.47\"},\n            {\"Estimated Strategy Capacity\", \"$2200000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VL5E74HP3EE5\"},\n            {\"Portfolio Turnover\", \"44.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6d4d3664d887d00b8222eb731f298cd8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm asserts that futures have data at extended market hours when this is enabled.\n    /// </summary>\n    public class FutureContractsExtendedMarketHoursRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _es;\n        private Future _gc;\n        private bool _esRanOnRegularHours;\n        private bool _esRanOnExtendedHours;\n        private bool _gcRanOnRegularHours;\n        private bool _gcRanOnExtendedHours;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 11);\n\n            var esFutureSymbol = QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2013, 12, 20));\n            _es = AddFutureContract(esFutureSymbol, Resolution.Hour, fillForward: true, extendedMarketHours: true);\n\n            var gcFutureSymbol = QuantConnect.Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2013, 10, 29));\n            _gc = AddFutureContract(gcFutureSymbol, Resolution.Hour, fillForward: true, extendedMarketHours: false);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var sliceSymbols = new HashSet<Symbol>(slice.Keys);\n            sliceSymbols.UnionWith(slice.Bars.Keys);\n            sliceSymbols.UnionWith(slice.Ticks.Keys);\n            sliceSymbols.UnionWith(slice.QuoteBars.Keys);\n\n            var esIsInRegularHours = _es.Exchange.Hours.IsOpen(Time, false);\n            var esIsInExtendedHours = !esIsInRegularHours && _es.Exchange.Hours.IsOpen(Time, true);\n            var sliceHasESData = sliceSymbols.Any(symbol => symbol == _es.Symbol || symbol.Canonical == _es.Symbol);\n            _esRanOnRegularHours |= esIsInRegularHours && sliceHasESData;\n            _esRanOnExtendedHours |= esIsInExtendedHours && sliceHasESData;\n\n            var gcIsInRegularHours = _gc.Exchange.Hours.IsOpen(Time, false);\n            var gcIsInExtendedHours = !gcIsInRegularHours && _gc.Exchange.Hours.IsOpen(Time, true);\n            var sliceHasGCData = sliceSymbols.Any(symbol => symbol == _gc.Symbol || symbol.Canonical == _gc.Symbol);\n            _gcRanOnRegularHours |= gcIsInRegularHours && sliceHasGCData;\n            _gcRanOnExtendedHours |= gcIsInExtendedHours && sliceHasGCData;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_esRanOnRegularHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on regular hours for {_es.Symbol} future, which enabled extended market hours\");\n            }\n\n            if (!_esRanOnExtendedHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on extended hours for {_es.Symbol} future, which enabled extended market hours\");\n            }\n\n            if (!_gcRanOnRegularHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on regular hours for {_gc.Symbol} future, which did not enable extended market hours\");\n            }\n\n            if (_gcRanOnExtendedHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have not run on extended hours for {_gc.Symbol} future, which did not enable extended market hours\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 525;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.564\"},\n            {\"Tracking Error\", \"0.214\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureMarketOpenAndCloseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to check we are getting the correct market open and close times\n    /// </summary>\n    public class FutureMarketOpenAndCloseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool ExtendedMarketHours => false;\n\n        protected virtual List<DateTime> AfterMarketOpen => new List<DateTime>() {\n            new DateTime(2020, 02, 04, 9, 30, 0),\n            new DateTime(2020, 02, 05, 9, 30, 0),\n            new DateTime(2020, 02, 06, 9, 30, 0),\n            new DateTime(2020, 02, 07, 9, 30, 0),\n            new DateTime(2020, 02, 10, 9, 30, 0),\n            new DateTime(2020, 02, 11, 9, 30, 0)\n        };\n        protected virtual List<DateTime> BeforeMarketClose => new List<DateTime>()\n        {\n            new DateTime(2020, 02, 04, 17, 0, 0),\n            new DateTime(2020, 02, 05, 17, 0, 0),\n            new DateTime(2020, 02, 06, 17, 0, 0),\n            new DateTime(2020, 02, 07, 17, 0, 0),\n            new DateTime(2020, 02, 10, 17, 0, 0),\n            new DateTime(2020, 02, 11, 17, 0, 0)\n        };\n        private Queue<DateTime> _afterMarketOpenQueue;\n        private Queue<DateTime> _beforeMarketCloseQueue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 02, 04);\n            SetEndDate(2020, 02, 11);\n            var esFuture = AddFuture(\"ES\", extendedMarketHours: ExtendedMarketHours).Symbol;\n\n            _afterMarketOpenQueue = new Queue<DateTime>(AfterMarketOpen);\n            _beforeMarketCloseQueue = new Queue<DateTime>(BeforeMarketClose);\n\n            Schedule.On(DateRules.EveryDay(esFuture, extendedMarketHours: ExtendedMarketHours),\n                TimeRules.AfterMarketOpen(esFuture, extendedMarketOpen: ExtendedMarketHours),\n                EveryDayAfterMarketOpen);\n\n            Schedule.On(DateRules.EveryDay(esFuture, extendedMarketHours: ExtendedMarketHours),\n                TimeRules.BeforeMarketClose(esFuture, extendedMarketClose: ExtendedMarketHours),\n                EveryDayBeforeMarketClose);\n        }\n\n        public void EveryDayBeforeMarketClose()\n        {\n            var expectedMarketClose = _beforeMarketCloseQueue.Dequeue();\n            if (Time != expectedMarketClose)\n            {\n                throw new RegressionTestException($\"Expected market close date was {expectedMarketClose} but received {Time}\");\n            }\n        }\n\n        public void EveryDayAfterMarketOpen()\n        {\n            var expectedMarketOpen = _afterMarketOpenQueue.Dequeue();\n            if (Time != expectedMarketOpen)\n            {\n                throw new RegressionTestException($\"Expected market open date was {expectedMarketOpen} but received {Time}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_afterMarketOpenQueue.Any() || _beforeMarketCloseQueue.Any())\n            {\n                throw new RegressionTestException($\"_afterMarketOpenQueue and _beforeMarketCloseQueue should be empty\");\n            }\n        }\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 91;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.049\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureMarketOpenAndCloseWithExtendedMarketRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to check we are getting the correct market open and close times when extended market hours are used\n    /// </summary>\n    public class FutureMarketOpenAndCloseWithExtendedMarketRegressionAlgorithm : FutureMarketOpenAndCloseRegressionAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n        protected override List<DateTime> AfterMarketOpen => new List<DateTime>() {\n            new DateTime(2020, 02, 04, 0, 0, 0), // Tuesday\n            new DateTime(2020, 02, 05, 0, 0, 0),\n            new DateTime(2020, 02, 06, 0, 0, 0),\n            new DateTime(2020, 02, 07, 0, 0, 0),\n            new DateTime(2020, 02, 09, 18, 0, 0), // sunday\n            new DateTime(2020, 02, 10, 0, 0, 0),\n            new DateTime(2020, 02, 11, 0, 0, 0),\n            new DateTime(2020, 02, 12, 0, 0, 0)\n        };\n        protected override List<DateTime> BeforeMarketClose => new List<DateTime>()\n        {\n            new DateTime(2020, 02, 04, 0, 0, 0),\n            new DateTime(2020, 02, 05, 0, 0, 0),\n            new DateTime(2020, 02, 06, 0, 0, 0),\n            new DateTime(2020, 02, 07, 0, 0, 0),\n            new DateTime(2020, 02, 07, 17, 0, 0), // friday\n            new DateTime(2020, 02, 10, 0, 0, 0),\n            new DateTime(2020, 02, 11, 0, 0, 0),\n            new DateTime(2020, 02, 12, 0, 0, 0)\n        };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 92;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.049\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureMarketOpenConsolidatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm using a consolidator to check GetNextMarketClose() and GetNextMarketOpen()\n    /// are returning the correct market close and open times\n    /// </summary>\n    public class FutureMarketOpenConsolidatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool ExtendedMarketHours => false;\n        protected virtual List<DateTime> ExpectedOpens => new List<DateTime>()\n        {\n            new DateTime(2013, 10, 07, 9, 30, 0),\n            new DateTime(2013, 10, 08, 9, 30, 0),\n            new DateTime(2013, 10, 09, 9, 30, 0),\n            new DateTime(2013, 10, 10, 9, 30, 0),\n            new DateTime(2013, 10, 11, 9, 30, 0),\n            new DateTime(2013, 10, 14, 9, 30, 0),\n            new DateTime(2013, 10, 14, 9, 30, 0),\n        };\n        protected virtual List<DateTime> ExpectedCloses => new List<DateTime>()\n        {\n            new DateTime(2013, 10, 07, 17, 0, 0),\n            new DateTime(2013, 10, 08, 17, 0, 0),\n            new DateTime(2013, 10, 09, 17, 0, 0),\n            new DateTime(2013, 10, 10, 17, 0, 0),\n            new DateTime(2013, 10, 11, 17, 0, 0),\n            new DateTime(2013, 10, 14, 17, 0, 0),\n            new DateTime(2013, 10, 14, 17, 0, 0),\n        };\n\n        private Queue<DateTime> _expectedOpensQueue;\n        private Queue<DateTime> _expectedClosesQueue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 06);\n            SetEndDate(2013, 10, 14);\n\n            Settings.DailyConsolidationUseExtendedMarketHours = true;\n            var es = AddSecurity(SecurityType.Future, \"ES\", extendedMarketHours: ExtendedMarketHours);\n\n            _expectedOpensQueue = new Queue<DateTime>(ExpectedOpens);\n            _expectedClosesQueue = new Queue<DateTime>(ExpectedCloses);\n\n            Consolidate<BaseData>(es.Symbol, dataTime =>\n            {\n                // based on the given data time we return the start time of it's bar and the expected period size\n                return LeanData.GetDailyCalendar(dataTime, es.Exchange, ExtendedMarketHours);\n            }, bar => Assert(bar));\n        }\n\n        public void Assert(BaseData bar)\n        {\n            var open = _expectedOpensQueue.Dequeue();\n            var close = _expectedClosesQueue.Dequeue();\n\n            if (open != bar.Time || close != bar.EndTime)\n            {\n                throw new RegressionTestException($\"Bar span was expected to be from {open} to {close}. \" +\n                    $\"\\n But was from {bar.Time} to {bar.EndTime}.\");\n            }\n\n            Logging.Log.Debug($\"Consolidator Event span. Start {bar.Time} End : {bar.EndTime}\");\n        }\n\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 16313;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.108\"},\n            {\"Tracking Error\", \"0.163\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureMarketOpenConsolidatorWithExtendedMarketRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm using a consolidator to check GetNextMarketClose() and GetNextMarketOpen()\n    /// are returning the correct market close and open times, when extended market hours are used\n    /// </summary>\n    public class FutureMarketOpenConsolidatorWithExtendedMarketRegressionAlgorithm : FutureMarketOpenConsolidatorRegressionAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n        protected override List<DateTime> ExpectedOpens => new List<DateTime>(){\n            new DateTime(2013, 10, 06, 18, 0, 0), // Sunday\n            // market is open for the whole day, so goes from midnight to midnight\n            new DateTime(2013, 10, 07, 0, 0, 0),\n            new DateTime(2013, 10, 08, 0, 0, 0),\n            new DateTime(2013, 10, 09, 0, 0, 0),\n            new DateTime(2013, 10, 10, 0, 0, 0),\n            new DateTime(2013, 10, 11, 0, 0, 0),\n            new DateTime(2013, 10, 13, 18, 0, 0),\n            new DateTime(2013, 10, 14, 0, 0, 0),\n        };\n        protected override List<DateTime> ExpectedCloses => new List<DateTime>(){\n            new DateTime(2013, 10, 07, 0, 0, 0),\n            new DateTime(2013, 10, 08, 0, 0, 0),\n            new DateTime(2013, 10, 09, 0, 0, 0),\n            new DateTime(2013, 10, 10, 0, 0, 0),\n            new DateTime(2013, 10, 11, 0, 0, 0),\n            new DateTime(2013, 10, 11, 17, 0, 0), // friday\n            new DateTime(2013, 10, 14, 0, 0, 0),\n            new DateTime(2013, 10, 15, 0, 0, 0),\n        };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 51933;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.108\"},\n            {\"Tracking Error\", \"0.163\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureNoTimeInUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of a zero time in universe setting. Related to GH issue #6653\n    /// </summary>\n    public class FutureNoTimeInUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<DateTime, Symbol> _seenSymbols = new();\n        private Symbol _sp500;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n            var futureSP500 = AddFuture(Futures.Indices.SP500EMini);\n\n            _sp500 = futureSP500.Symbol;\n            futureSP500.SetFilter(u =>\n            {\n                return u.Where(s =>\n                {\n                    if (_seenSymbols.ContainsKey(Time) || _seenSymbols.ContainsValue(s))\n                    {\n                        // for each timestamp we select a single symbol which we haven't selected before\n                        return false;\n                    }\n                    _seenSymbols[Time] = s;\n                    return true;\n                });\n            });\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            var futureContracts = slice.FutureChains.GetValue(_sp500);\n            if(futureContracts == null)\n            {\n                return;\n            }\n            var futureSymbols = futureContracts.Select(future => future.Symbol).ToHashSet();\n\n            if (futureSymbols.Count > 1)\n            {\n                throw new RegressionTestException($\"At {Time} found {futureSymbols.Count}. Future symbols: [{string.Join(\",\", futureSymbols)}]\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 11768;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-66.775\"},\n            {\"Tracking Error\", \"0.243\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionBuySellCallIntradayRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option calls across different strike prices.\n    /// We expect 6 orders from the algorithm, which are:\n    ///\n    ///   * (1) Initial entry, buy ES Call Option (ES19M20 expiring ITM)\n    ///   * (2) Initial entry, sell ES Call Option at different strike (ES20H20 expiring ITM)\n    ///   * [2] Option assignment, opens a position in the underlying (ES20H20, Qty: -1)\n    ///   * [2] Future contract liquidation, due to impending expiry\n    ///   * [1] Option exercise, receive 1 ES19M20 future contract\n    ///   * [1] Liquidate ES19M20 contract, due to expiry\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionBuySellCallIntradayRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            var es20h20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 3, 20)),\n                Resolution.Minute).Symbol;\n\n            var es20m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            var esOptions = OptionChain(es20m20)\n                .Concat(OptionChain(es20h20))\n                .Where(contractData => contractData.ID.StrikePrice == 3200m && contractData.ID.OptionRight == OptionRight.Call)\n                .Select(contractData => AddFutureOptionContract(contractData, Resolution.Minute).Symbol)\n                .ToList();\n\n            var expectedContracts = new[]\n            {\n                QuantConnect.Symbol.CreateOption(es20h20, Market.CME, OptionStyle.American, OptionRight.Call, 3200m,\n                    new DateTime(2020, 3, 20)),\n                QuantConnect.Symbol.CreateOption(es20m20, Market.CME, OptionStyle.American, OptionRight.Call, 3200m,\n                    new DateTime(2020, 6, 19))\n            };\n\n            foreach (var esOption in esOptions)\n            {\n                if (!expectedContracts.Contains(esOption))\n                {\n                    throw new RegressionTestException($\"Contract {esOption} was not found in the chain\");\n                }\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(es20m20, 1), () =>\n            {\n                MarketOrder(esOptions[0], 1);\n                MarketOrder(esOptions[1], -1);\n            });\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 309286;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"3.37%\"},\n            {\"Average Loss\", \"-4.34%\"},\n            {\"Compounding Annual Return\", \"-4.637%\"},\n            {\"Drawdown\", \"5.200%\"},\n            {\"Expectancy\", \"-0.111\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97715.91\"},\n            {\"Net Profit\", \"-2.284%\"},\n            {\"Sharpe Ratio\", \"-0.555\"},\n            {\"Sortino Ratio\", \"-0.069\"},\n            {\"Probabilistic Sharpe Ratio\", \"9.827%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.78\"},\n            {\"Alpha\", \"-0.04\"},\n            {\"Beta\", \"-0.011\"},\n            {\"Annual Standard Deviation\", \"0.072\"},\n            {\"Annual Variance\", \"0.005\"},\n            {\"Information Ratio\", \"-0.134\"},\n            {\"Tracking Error\", \"0.385\"},\n            {\"Treynor Ratio\", \"3.785\"},\n            {\"Total Fees\", \"$2.84\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPBMTJ8|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"3.67%\"},\n            {\"Drawdown Recovery\", \"74\"},\n            {\"OrderListHash\", \"6e17a52c917383260dcf0345567a1ea9\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option expiry for calls.\n    /// We expect 3 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Call Option (expiring ITM)\n    ///   * Option exercise, receiving ES future contracts\n    ///   * Future contract liquidation, due to impending expiry\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionCallITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedOptionContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3200m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedOptionContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedOptionContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                AssertFutureOptionOrderExercise(orderEvent, security, Securities[_expectedOptionContract]);\n            }\n            else if (security.Symbol == _expectedOptionContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{Time:yyyy-MM-dd HH:mm:ss} -- {orderEvent.Symbol} :: Price: {Securities[orderEvent.Symbol].Holdings.Price} Qty: {Securities[orderEvent.Symbol].Holdings.Quantity} Direction: {orderEvent.Direction} Msg: {orderEvent.Message}\");\n        }\n\n        private void AssertFutureOptionOrderExercise(OrderEvent orderEvent, Security future, Security optionContract)\n        {\n            var expectedLiquidationTimeUtc = new DateTime(2020, 6, 20, 4, 0, 0);\n\n            if (orderEvent.Direction == OrderDirection.Sell && future.Holdings.Quantity != 0)\n            {\n                // We expect the contract to have been liquidated immediately\n                throw new RegressionTestException($\"Did not liquidate existing holdings for Symbol {future.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && orderEvent.UtcTime != expectedLiquidationTimeUtc)\n            {\n                throw new RegressionTestException($\"Liquidated future contract, but not at the expected time. Expected: {expectedLiquidationTimeUtc:yyyy-MM-dd HH:mm:ss} - found {orderEvent.UtcTime:yyyy-MM-dd HH:mm:ss}\");\n            }\n\n            // No way to detect option exercise orders or any other kind of special orders\n            // other than matching strings, for now.\n            if (orderEvent.Message.Contains(\"Option Exercise\"))\n            {\n                if (orderEvent.FillPrice != 3200m)\n                {\n                    throw new RegressionTestException(\"Option did not exercise at expected strike price (3200)\");\n                }\n                if (future.Holdings.Quantity != 1)\n                {\n                    // Here, we expect to have some holdings in the underlying, but not in the future option anymore.\n                    throw new RegressionTestException($\"Exercised option contract, but we have no holdings for Future {future.Symbol}\");\n                }\n\n                if (optionContract.Holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"Exercised option contract, but we have holdings for Option contract {optionContract.Symbol}\");\n                }\n            }\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\") && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after exercising option contract {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"2.28%\"},\n            {\"Average Loss\", \"-6.80%\"},\n            {\"Compounding Annual Return\", \"-9.373%\"},\n            {\"Drawdown\", \"5.300%\"},\n            {\"Expectancy\", \"-0.332\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"95323.58\"},\n            {\"Net Profit\", \"-4.676%\"},\n            {\"Sharpe Ratio\", \"-1.163\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.165%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.34\"},\n            {\"Alpha\", \"-0.074\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0.064\"},\n            {\"Annual Variance\", \"0.004\"},\n            {\"Information Ratio\", \"-0.226\"},\n            {\"Tracking Error\", \"0.378\"},\n            {\"Treynor Ratio\", \"-21.841\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPBMTJ8|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"1.94%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a7d2aa89bb101a77fdbc04890235f83c\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option expiry for calls.\n    /// We test to make sure that FOPs have greeks enabled, same as equity options.\n    /// </summary>\n    public class FutureOptionCallITMGreeksExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _invested;\n        private int _onDataCalls;\n        private Security _es19m20;\n        private Option _esOption;\n        private Symbol _expectedOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute);\n\n            // We must set the volatility model on the underlying, since the defaults are\n            // too strict to calculate greeks with when we only have data for a single day\n            _es19m20.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(\n                60,\n                Resolution.Minute,\n                TimeSpan.FromMinutes(1));\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20.Symbol)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute);\n\n            _esOption.PriceModel = OptionPriceModels.QuantLib.BjerksundStensland();\n\n            _expectedOptionContract = QuantConnect.Symbol.CreateOption(_es19m20.Symbol, Market.CME, OptionStyle.American, OptionRight.Call, 3200m, new DateTime(2020, 6, 19));\n            if (_esOption.Symbol != _expectedOptionContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedOptionContract} was not found in the chain\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Let the algo warmup, but without using SetWarmup. Otherwise, we get\n            // no contracts in the option chain\n            if (_invested || _onDataCalls++ < 40)\n            {\n                return;\n            }\n\n            if (slice.OptionChains.Count == 0)\n            {\n                return;\n            }\n            if (slice.OptionChains.Values.All(o => o.Contracts.Values.Any(c => !slice.ContainsKey(c.Symbol))))\n            {\n                return;\n            }\n            if (slice.OptionChains.Values.First().Contracts.Count == 0)\n            {\n                throw new RegressionTestException($\"No contracts found in the option {slice.OptionChains.Keys.First()}\");\n            }\n\n            var deltas = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Delta).ToList();\n            var gammas = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Gamma).ToList();\n            var lambda = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Lambda).ToList();\n            var rho = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Rho).ToList();\n            var theta = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Theta).ToList();\n            var vega = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Vega).ToList();\n\n            // The commented out test cases all return zero.\n            // This is because of failure to evaluate the greeks in the option pricing model.\n            // For now, let's skip those.\n            if (deltas.Any(d => d == 0))\n            {\n                throw new AggregateException(\"Option contract Delta was equal to zero\");\n            }\n            if (gammas.Any(g => g == 0))\n            {\n                throw new AggregateException(\"Option contract Gamma was equal to zero\");\n            }\n            if (lambda.Any(l => l == 0))\n            {\n                throw new AggregateException(\"Option contract Lambda was equal to zero\");\n            }\n            if (rho.Any(r => r == 0))\n            {\n                throw new AggregateException(\"Option contract Rho was equal to zero\");\n            }\n            if (theta.Any(t => t == 0))\n            {\n                throw new AggregateException(\"Option contract Theta was equal to zero\");\n            }\n            if (vega.Any(v => v == 0))\n            {\n                throw new AggregateException(\"Option contract Vega was equal to zero\");\n            }\n\n            if (!_invested)\n            {\n                // the margin requirement for the FOPs is less than the one of the underlying so we can't allocate all our buying power\n                // into FOPs else we won't be able to exercise\n                SetHoldings(slice.OptionChains.Values.First().Contracts.Values.First().Symbol, 0.25);\n                _invested = true;\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n            if (!_invested)\n            {\n                throw new RegressionTestException($\"Never checked greeks, maybe we have no option data?\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"16.44%\"},\n            {\"Average Loss\", \"-35.38%\"},\n            {\"Compounding Annual Return\", \"-44.262%\"},\n            {\"Drawdown\", \"26.200%\"},\n            {\"Expectancy\", \"-0.268\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"75242.9\"},\n            {\"Net Profit\", \"-24.757%\"},\n            {\"Sharpe Ratio\", \"-0.965\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.060%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.46\"},\n            {\"Alpha\", \"-0.303\"},\n            {\"Beta\", \"0.016\"},\n            {\"Annual Standard Deviation\", \"0.313\"},\n            {\"Annual Variance\", \"0.098\"},\n            {\"Information Ratio\", \"-0.649\"},\n            {\"Tracking Error\", \"0.483\"},\n            {\"Treynor Ratio\", \"-18.59\"},\n            {\"Total Fees\", \"$7.10\"},\n            {\"Estimated Strategy Capacity\", \"$24000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPBMTJ8|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"12.22%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1d4a9403cd69b8510f15d100acdffa26\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) future option expiry for calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Call Option (expiring OTM)\n    ///     - contract expires worthless, not exercised, so never opened a position in the underlying\n    ///\n    ///   * Liquidation of worthless ES call option (expiring OTM)\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    /// <remarks>\n    /// Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n    /// See related issue: https://github.com/QuantConnect/Lean/issues/4854\n    /// </remarks>\n    public class FutureOptionCallOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option call expiring OTM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(contractData => contractData.ID.StrikePrice >= 3300m && contractData.ID.OptionRight == OptionRight.Call)\n                .OrderBy(contractData => contractData.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3300m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            // Place order after regular market opens\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                throw new RegressionTestException(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && !orderEvent.Message.Contains(\"OTM\"))\n            {\n                throw new RegressionTestException(\"Contract did not expire OTM\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\"))\n            {\n                throw new RegressionTestException(\"Exercised option, even though it expires OTM\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-3.85%\"},\n            {\"Compounding Annual Return\", \"-7.754%\"},\n            {\"Drawdown\", \"4.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96148.58\"},\n            {\"Net Profit\", \"-3.851%\"},\n            {\"Sharpe Ratio\", \"-1.221\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.131%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.063\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0.052\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-0.198\"},\n            {\"Tracking Error\", \"0.377\"},\n            {\"Treynor Ratio\", \"-23.065\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$180000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPHL5L0|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d84cd529c8535b576d63c0f9c29635c3\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionChainFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> method\n    /// to get a future option chain.\n    /// </summary>\n    public class FutureOptionChainFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 6);\n            SetEndDate(2020, 1, 6);\n\n            var futureContract = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute).Symbol;\n\n            _optionContract = OptionChain(futureContract)\n                // Get contracts expiring within 4 months\n                .Where(contractData => contractData.Expiry - Time <= TimeSpan.FromDays(120))\n                // Get the contract with the latest expiration date, highest strike and lowest price\n                .OrderByDescending(x => x.Expiry)\n                .ThenByDescending(x => x.Strike)\n                .ThenBy(x => x.LastPrice)\n                .First();\n\n            AddFutureOptionContract(_optionContract);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_optionContract, 0.5);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1817;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"450\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"65398.86\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$34601.14\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLCGM7IF8|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"112.25%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4000aa7b360b9146b9f184d0cc188980\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionChainsMultipleFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChains(IEnumerable{Symbol})\"/> method\n    /// to get multiple future option chains.\n    /// </summary>\n    public class FutureOptionChainsMultipleFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _esOptionContract;\n        private Symbol _gcOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 6);\n            SetEndDate(2020, 1, 6);\n            SetCash(100000);\n\n            var esFutureContract = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute).Symbol;\n\n            var gcFutureContract = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 4, 28)),\n                Resolution.Minute).Symbol;\n\n            var chains = OptionChains([esFutureContract, gcFutureContract]);\n\n            _esOptionContract = GetContract(chains, esFutureContract);\n            _gcOptionContract = GetContract(chains, gcFutureContract);\n\n            AddFutureOptionContract(_esOptionContract);\n            AddFutureOptionContract(_gcOptionContract);\n        }\n\n        private Symbol GetContract(OptionChains chains, Symbol underlying)\n        {\n            return chains\n                .Where(kvp => kvp.Key.Underlying == underlying)\n                .Select(kvp => kvp.Value)\n                .Single()\n                // Get contracts expiring within 5 months\n                .Where(contractData => contractData.Expiry - Time <= TimeSpan.FromDays(120))\n                // Get the contract with the latest expiration date, highest strike and lowest price\n                .OrderByDescending(x => x.Expiry)\n                .ThenByDescending(x => x.Strike)\n                .ThenBy(x => x.LastPrice)\n                .First();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_esOptionContract, 0.25);\n                SetHoldings(_gcOptionContract, 0.25);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1819;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"450\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"80983.36\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$19016.64\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLCGM7IF8|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"49.52%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8ef148c1100cb53bdd6a833c7a958974\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionContinuousFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that validates that when using a continuous future (without a filter)\n    /// the option chains are correctly populated using the mapped symbol.\n    /// </summary>\n    public class FutureOptionContinuousFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Future Future { get; private set; }\n        private bool _hasAnyOptionChainForMappedSymbol;\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 4);\n            SetEndDate(2020, 1, 8);\n\n            Future = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, Market.CME);\n            SetFilter();\n\n            AddFutureOption(Future.Symbol, universe => universe.Strikes(-1, 1));\n        }\n\n        public virtual void SetFilter()\n        {\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.OptionChains.Count == 0)\n            {\n                return;\n            }\n\n            ValidateOptionChains(slice);\n\n            // OptionChain for the mapped symbol must exist with or without a future filter\n            if (!slice.OptionChains.TryGetValue(Future.Mapped, out var chain) || chain == null || !chain.Any())\n            {\n                throw new RegressionTestException(\"No option chain found for mapped symbol during algorithm execution\");\n            }\n\n            // Mark that we successfully received a non-empty OptionChain for mapped symbol\n            _hasAnyOptionChainForMappedSymbol = true;\n        }\n\n        public virtual void ValidateOptionChains(Slice slice)\n        {\n            if (slice.OptionChains.Count != 1)\n            {\n                throw new RegressionTestException(\"Expected only one option chain for the mapped symbol\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_hasAnyOptionChainForMappedSymbol)\n            {\n                throw new RegressionTestException(\"No non-empty option chain found for mapped symbol during algorithm execution\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 15767;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.363\"},\n            {\"Tracking Error\", \"0.059\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests using FutureOptions daily resolution\n    /// </summary>\n    public class FutureOptionDailyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected OrderTicket Ticket { get; set; }\n        protected Symbol ESOption { get; set; }\n        protected virtual Resolution Resolution => Resolution.Daily;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 7);\n            SetEndDate(2020, 1, 8);\n\n            // Add our underlying future contract\n            var futureContract = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 3, 20)),\n                Resolution).Symbol;\n\n            // Attempt to fetch a specific future option contract\n            ESOption = OptionChain(futureContract)\n                .Where(x => x.ID.StrikePrice == 3200m && x.ID.OptionRight == OptionRight.Call)\n                .Select(x => AddFutureOptionContract(x, Resolution).Symbol)\n                .FirstOrDefault();\n\n            // Validate it is the expected contract\n            var expectedContract = QuantConnect.Symbol.CreateOption(futureContract, Market.CME, OptionStyle.American,\n                OptionRight.Call, 3200m,\n                new DateTime(2020, 3, 20));\n\n            if (ESOption != expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {ESOption} was not the expected contract {expectedContract}\");\n            }\n\n            ScheduleBuySell();\n        }\n\n        protected virtual void ScheduleBuySell()\n        {\n            // Schedule a purchase of this contract tomorrow at 10AM when the market is open\n            Schedule.On(DateRules.Tomorrow, TimeRules.At(10,0,0), () =>\n            {\n                Ticket = MarketOrder(ESOption, 1);\n            });\n\n            // Schedule liquidation tomorrow at 2PM when the market is open\n            Schedule.On(DateRules.Tomorrow, TimeRules.At(14,0,0), () =>\n            {\n                Liquidate();\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert we are only getting data at 5PM NY, for ES future market closes at 17pm NY\n            if (slice.Time.Hour != 17)\n            {\n                throw new ArgumentException($\"Expected data at 4PM each day; instead was {slice.Time}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n\n            if (Ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Future option order failed to fill correctly\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 27;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99997.16\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.84\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLCEYO5XG|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"4.24%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ea4b22620e9435d7fa80888b8bd7be87\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionHourlyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests using FutureOptions hourly resolution\n    /// </summary>\n    public class FutureOptionHourlyRegressionAlgorithm : FutureOptionDailyRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Hour;\n\n        protected override void ScheduleBuySell()\n        {\n            // Schedule a purchase of this contract at Noon\n            Schedule.On(DateRules.Today, TimeRules.Noon, () =>\n            {\n                Ticket = MarketOrder(ESOption, 1);\n            });\n\n            // Schedule liquidation at 2PM when the market is open\n            Schedule.On(DateRules.Today, TimeRules.At(17,0,0), () =>\n            {\n                Liquidate();\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert we are only getting data only hourly intervals\n            if (slice.Time.Minute != 0)\n            {\n                throw new ArgumentException($\"Expected data only on hourly intervals; instead was {slice.Time}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 55;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99672.16\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.84\"},\n            {\"Estimated Strategy Capacity\", \"$3000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLCEYO5XG|ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"4.90%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"10661c6d84f71ca7e07e2fdf5b79851b\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionIndicatorsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class FutureOptionIndicatorsRegressionAlgorithm : OptionIndicatorsRegressionAlgorithm\n    {\n        protected override string ExpectedGreeks { get; set; } = \"Implied Volatility: 0.13941,Delta: 0.63509,Gamma: 0.00209,Vega: 5.64129,Theta: -0.47731,Rho: 0.03145\";\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 6);\n            SetEndDate(2020, 1, 6);\n\n            var underlying = AddFutureContract(QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute).Symbol;\n\n            var option = AddFutureOptionContract(OptionChain(underlying)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            InitializeIndicators(option);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1817;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test tests for the loading of futures options contracts with a contract month of 2020-03 can live\n    /// and be loaded from the same ZIP file that the 2020-04 contract month Future Option contract lives in.\n    /// </summary>\n    public class FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<Symbol, bool> _expectedSymbols = new Dictionary<Symbol, bool>\n        {\n            { CreateOption(new DateTime(2020, 3, 26), OptionRight.Call, 1650), false },\n            { CreateOption(new DateTime(2020, 3, 26), OptionRight.Put, 1540), false },\n            { CreateOption(new DateTime(2020, 2, 25), OptionRight.Call, 1600), false },\n            { CreateOption(new DateTime(2020, 2, 25), OptionRight.Put, 1545), false }\n        };\n\n        public override void Initialize()\n        {\n            // Required for FOPs to use extended hours, until GH #6491 is addressed\n            UniverseSettings.ExtendedMarketHours = true;\n\n            SetStartDate(2020, 1, 4);\n            SetEndDate(2020, 1, 6);\n\n            var goldFutures = AddFuture(\"GC\", Resolution.Minute, Market.COMEX, extendedMarketHours: true);\n            goldFutures.SetFilter(0, 365);\n\n            AddFutureOption(goldFutures.Symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var symbol in slice.QuoteBars.Keys)\n            {\n                // Check that we are in regular hours, we can place a market order (on extended hours, limit orders should be used)\n                if (_expectedSymbols.ContainsKey(symbol) && IsInRegularHours(symbol))\n                {\n                    var invested = _expectedSymbols[symbol];\n                    if (!invested)\n                    {\n                        MarketOrder(symbol, 1);\n                    }\n\n                    _expectedSymbols[symbol] = true;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var notEncountered = _expectedSymbols.Where(kvp => !kvp.Value).ToList();\n            if (notEncountered.Any())\n            {\n                throw new RegressionTestException($\"Expected all Symbols encountered and invested in, but the following were not found: {string.Join(\", \", notEncountered.Select(kvp => kvp.Value.ToStringInvariant()))}\");\n            }\n            if (!Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Expected holdings at the end of algorithm, but none were found.\");\n            }\n        }\n\n        private bool IsInRegularHours(Symbol symbol)\n        {\n            return Securities[symbol].Exchange.ExchangeOpen;\n        }\n\n        private static Symbol CreateOption(DateTime expiry, OptionRight optionRight, decimal strikePrice)\n        {\n            return QuantConnect.Symbol.CreateOption(\n                QuantConnect.Symbol.CreateFuture(\"GC\", Market.COMEX, new DateTime(2020, 4, 28)),\n                Market.COMEX,\n                OptionStyle.American,\n                optionRight,\n                strikePrice,\n                expiry);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 13942;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-25.338%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99760.12\"},\n            {\"Net Profit\", \"-0.240%\"},\n            {\"Sharpe Ratio\", \"-10.528\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.09\"},\n            {\"Beta\", \"-0.629\"},\n            {\"Annual Standard Deviation\", \"0.027\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-12.58\"},\n            {\"Tracking Error\", \"0.07\"},\n            {\"Treynor Ratio\", \"0.451\"},\n            {\"Total Fees\", \"$9.88\"},\n            {\"Estimated Strategy Capacity\", \"$31000000.00\"},\n            {\"Lowest Capacity Asset\", \"OG 31BFX0QKBZZS0|GC XE1Y0ZJ8NQ8T\"},\n            {\"Portfolio Turnover\", \"2.65%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9b619fad030ef229690386aabbaedb4d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option expiry for puts.\n    /// We expect 3 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Put Option (expiring ITM) (buy, qty 1)\n    ///   * Option exercise, receiving short ES future contracts (sell, qty -1)\n    ///   * Future contract liquidation, due to impending expiry (buy qty 1)\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionPutITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice >= 3300m && x.ID.OptionRight == OptionRight.Put)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Put, 3300m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                AssertFutureOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{Time:yyyy-MM-dd HH:mm:ss} -- {orderEvent.Symbol} :: Price: {Securities[orderEvent.Symbol].Holdings.Price} Qty: {Securities[orderEvent.Symbol].Holdings.Quantity} Direction: {orderEvent.Direction} Msg: {orderEvent.Message}\");\n        }\n\n        private void AssertFutureOptionOrderExercise(OrderEvent orderEvent, Security future, Security optionContract)\n        {\n            var expectedLiquidationTimeUtc = new DateTime(2020, 6, 20, 4, 0, 0);\n\n            if (orderEvent.Direction == OrderDirection.Buy && future.Holdings.Quantity != 0)\n            {\n                // We expect the contract to have been liquidated immediately\n                throw new RegressionTestException($\"Did not liquidate existing holdings for Symbol {future.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Buy && orderEvent.UtcTime != expectedLiquidationTimeUtc)\n            {\n                throw new RegressionTestException($\"Liquidated future contract, but not at the expected time. Expected: {expectedLiquidationTimeUtc:yyyy-MM-dd HH:mm:ss} - found {orderEvent.UtcTime:yyyy-MM-dd HH:mm:ss}\");\n            }\n\n            // No way to detect option exercise orders or any other kind of special orders\n            // other than matching strings, for now.\n            if (orderEvent.Message.Contains(\"Option Exercise\"))\n            {\n                if (orderEvent.FillPrice != 3300m)\n                {\n                    throw new RegressionTestException(\"Option did not exercise at expected strike price (3300)\");\n                }\n                if (future.Holdings.Quantity != -1)\n                {\n                    // Here, we expect to have some holdings in the underlying, but not in the future option anymore.\n                    throw new RegressionTestException($\"Exercised option contract, but we have no holdings for Future {future.Symbol}\");\n                }\n\n                if (optionContract.Holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"Exercised option contract, but we have holdings for Option contract {optionContract.Symbol}\");\n                }\n            }\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\") && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after exercising option contract {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"3.13%\"},\n            {\"Average Loss\", \"-8.06%\"},\n            {\"Compounding Annual Return\", \"-10.371%\"},\n            {\"Drawdown\", \"5.200%\"},\n            {\"Expectancy\", \"-0.306\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94811.08\"},\n            {\"Net Profit\", \"-5.189%\"},\n            {\"Sharpe Ratio\", \"-1.546\"},\n            {\"Sortino Ratio\", \"-0.209\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.39\"},\n            {\"Alpha\", \"-0.082\"},\n            {\"Beta\", \"0.002\"},\n            {\"Annual Standard Deviation\", \"0.053\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-0.248\"},\n            {\"Tracking Error\", \"0.377\"},\n            {\"Treynor Ratio\", \"-36.3\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$79000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES 31EL5FAOOUYYS|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"1.98%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a4de58a3a31739f593c8a1ed099bad10\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) future option expiry for puts.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Put Option (expiring OTM)\n    ///     - contract expires worthless, not exercised, so never opened a position in the underlying\n    ///\n    ///   * Liquidation of worthless ES Put OTM contract\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    /// <remarks>\n    /// Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n    /// </remarks>\n    public class FutureOptionPutOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice <= 3150m && x.ID.OptionRight == OptionRight.Put)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Put, 3150m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                throw new RegressionTestException(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && !orderEvent.Message.Contains(\"OTM\"))\n            {\n                throw new RegressionTestException(\"Contract did not expire OTM\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\"))\n            {\n                throw new RegressionTestException(\"Exercised option, even though it expires OTM\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-5.25%\"},\n            {\"Compounding Annual Return\", \"-10.492%\"},\n            {\"Drawdown\", \"5.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94748.58\"},\n            {\"Net Profit\", \"-5.251%\"},\n            {\"Sharpe Ratio\", \"-1.472\"},\n            {\"Sortino Ratio\", \"-0.181\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.001%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.083\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0.056\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-0.249\"},\n            {\"Tracking Error\", \"0.377\"},\n            {\"Treynor Ratio\", \"-32.556\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$290000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES 31EL5FBZBR7QC|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"0.03%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"01fc084078bdca7ec7d409f7bb398c14\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option expiry for short calls.\n    /// We expect 3 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell ES Call Option (expiring ITM)\n    ///   * Option assignment, sell 1 contract of the underlying (ES)\n    ///   * Future contract expiry, liquidation (buy 1 ES future)\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionShortCallITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice <= 3100m && x.ID.OptionRight == OptionRight.Call)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3100m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                AssertFutureOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionOrderExercise(OrderEvent orderEvent, Security future, Security optionContract)\n        {\n            if (orderEvent.Message.Contains(\"Assignment\"))\n            {\n                if (orderEvent.FillPrice != 3100m)\n                {\n                    throw new RegressionTestException(\"Option was not assigned at expected strike price (3100)\");\n                }\n                if (orderEvent.Direction != OrderDirection.Sell || future.Holdings.Quantity != -1)\n                {\n                    throw new RegressionTestException($\"Expected Qty: -1 futures holdings for assigned future {future.Symbol}, found {future.Holdings.Quantity}\");\n                }\n\n                return;\n            }\n\n            if (orderEvent.Direction == OrderDirection.Buy && future.Holdings.Quantity != 0)\n            {\n                // We buy back the underlying at expiration, so we expect a neutral position then\n                throw new RegressionTestException($\"Expected no holdings when liquidating future contract {future.Symbol}\");\n            }\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.IsAssignment && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after option contract was assigned: {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"10.24%\"},\n            {\"Average Loss\", \"-6.46%\"},\n            {\"Compounding Annual Return\", \"6.498%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"0.292\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103111.08\"},\n            {\"Net Profit\", \"3.111%\"},\n            {\"Sharpe Ratio\", \"0.726\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"45.614%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.58\"},\n            {\"Alpha\", \"0.036\"},\n            {\"Beta\", \"-0.003\"},\n            {\"Annual Standard Deviation\", \"0.049\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"0.064\"},\n            {\"Tracking Error\", \"0.378\"},\n            {\"Treynor Ratio\", \"-13.127\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$13000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UP5OHHG|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"1.79%\"},\n            {\"Drawdown Recovery\", \"165\"},\n            {\"OrderListHash\", \"51a7c148e25c56692d0ed5971483f04d\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) future option expiry for short calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell ES Call Option (expiring OTM)\n    ///     - Profit the option premium, since the option was not assigned.\n    ///\n    ///   * Liquidation of ES call OTM contract on the last trade date\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionShortCallOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice >= 3400m && x.ID.OptionRight == OptionRight.Call)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3400m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                throw new RegressionTestException($\"Expected no order events for underlying Symbol {security.Symbol}\");\n            }\n\n            if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security optionContract)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && optionContract.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {optionContract.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Buy && optionContract.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Expected no options holdings after closing position\");\n            }\n            if (orderEvent.IsAssignment)\n            {\n                throw new RegressionTestException($\"Assignment was not expected for {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"1.74%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"3.600%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101736.08\"},\n            {\"Net Profit\", \"1.736%\"},\n            {\"Sharpe Ratio\", \"0.596\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"49.736%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.015\"},\n            {\"Beta\", \"-0.001\"},\n            {\"Annual Standard Deviation\", \"0.025\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"0.009\"},\n            {\"Tracking Error\", \"0.375\"},\n            {\"Treynor Ratio\", \"-11.048\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPNJHMS|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"165\"},\n            {\"OrderListHash\", \"3e39f8bdb373b371999835fbf680eef8\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) future option expiry for short puts.\n    /// We expect 3 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell ES Put Option (expiring ITM)\n    ///   * Option assignment, buy 1 contract of the underlying (ES)\n    ///   * Future contract expiry, liquidation (sell 1 ES future)\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionShortPutITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice <= 3400m && x.ID.OptionRight == OptionRight.Put)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Put, 3400m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                AssertFutureOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionOrderExercise(OrderEvent orderEvent, Security future, Security optionContract)\n        {\n            if (orderEvent.Message.Contains(\"Assignment\"))\n            {\n                if (orderEvent.FillPrice != 3400)\n                {\n                    throw new RegressionTestException(\"Option was not assigned at expected strike price (3400)\");\n                }\n                if (orderEvent.Direction != OrderDirection.Buy || future.Holdings.Quantity != 1)\n                {\n                    throw new RegressionTestException($\"Expected Qty: 1 futures holdings for assigned future {future.Symbol}, found {future.Holdings.Quantity}\");\n                }\n            }\n            if (!orderEvent.Message.Contains(\"Assignment\") && orderEvent.Direction == OrderDirection.Sell && future.Holdings.Quantity != 0)\n            {\n                // We buy back the underlying at expiration, so we expect a neutral position then\n                throw new RegressionTestException($\"Expected no holdings when liquidating future contract {future.Symbol}\");\n            }\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.IsAssignment && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after option contract was assigned: {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"10.89%\"},\n            {\"Average Loss\", \"-7.10%\"},\n            {\"Compounding Annual Return\", \"6.286%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0.267\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103011.08\"},\n            {\"Net Profit\", \"3.011%\"},\n            {\"Sharpe Ratio\", \"1.255\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"85.803%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.53\"},\n            {\"Alpha\", \"0.033\"},\n            {\"Beta\", \"-0.001\"},\n            {\"Annual Standard Deviation\", \"0.026\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"0.058\"},\n            {\"Tracking Error\", \"0.375\"},\n            {\"Treynor Ratio\", \"-41.831\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$12000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES 31EL5FAOUTB0K|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"1.87%\"},\n            {\"Drawdown Recovery\", \"165\"},\n            {\"OrderListHash\", \"3ced70635b9a6a1ff260a0f8706e9fff\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) future option expiry for short puts.\n    /// We expect 2 order from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell ES Put Option (expiring OTM)\n    ///     - Profit the option premium, since the option was not assigned.\n    ///\n    ///   * Liquidation of ES put OTM contract on the last trade date\n    ///\n    /// Additionally, we test delistings for future options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class FutureOptionShortPutOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option expiring ITM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice <= 3000m && x.ID.OptionRight == OptionRight.Put)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Put, 3000m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_es19m20, 1), () =>\n            {\n                MarketOrder(_esOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 19))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2020, 6, 20))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                throw new RegressionTestException($\"Expected no order events for underlying Symbol {security.Symbol}\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertFutureOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertFutureOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Expected no options holdings after closing position\");\n            }\n            if (orderEvent.IsAssignment)\n            {\n                throw new RegressionTestException($\"Assignment was not expected for {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"3.42%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"7.162%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103423.58\"},\n            {\"Net Profit\", \"3.424%\"},\n            {\"Sharpe Ratio\", \"1.088\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"73.287%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.04\"},\n            {\"Beta\", \"-0.002\"},\n            {\"Annual Standard Deviation\", \"0.036\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"0.075\"},\n            {\"Tracking Error\", \"0.377\"},\n            {\"Treynor Ratio\", \"-24.076\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$110000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES 31EL5FAJQB2N8|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"165\"},\n            {\"OrderListHash\", \"ddc3a9d7483eb53bac7313682f4b7d0f\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/FutureOptionWithFutureFilterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that validates that when using a Future with filter\n    /// the option chains are correctly populated and are unique\n    /// </summary>\n    public class FutureOptionWithFutureFilterRegressionAlgorithm : FutureOptionContinuousFutureRegressionAlgorithm\n    {\n        public override void SetFilter()\n        {\n            Future.SetFilter(0, 368);\n        }\n\n        public override void ValidateOptionChains(Slice slice)\n        {\n            var futureContractsWithOptionChains = 0;\n            foreach (var futureChain in slice.FutureChains.Values)\n            {\n                foreach (var futureContract in futureChain)\n                {\n                    // Not all future contracts have option chains, so we need to check if the contract is in the option chain\n                    if (slice.OptionChains.ContainsKey(futureContract.Symbol))\n                    {\n                        var chain = slice.OptionChains[futureContract.Symbol];\n                        if (chain.Count == 0)\n                        {\n                            throw new RegressionTestException($\"Expected at least one option contract for {chain.Symbol}\");\n                        }\n                        futureContractsWithOptionChains++;\n                    }\n                }\n\n            }\n            if (futureContractsWithOptionChains < 1)\n            {\n                throw new RegressionTestException($\"Expected at least two future contracts with option chains, but found {futureContractsWithOptionChains}\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 29701;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureSharingTickerRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm showcasing adding two futures with the same ticker for different market, related to PR 4328\n    /// </summary>\n    public class FutureSharingTickerRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            var gold = AddFuture(Futures.Metals.Gold, market: Market.COMEX);\n            gold.SetFilter(0, 182);\n\n            // this future does not exist just added as an example\n            var gold2 = AddFuture(Futures.Metals.Gold, market: Market.NYMEX);\n            gold2.SetFilter(0, 182);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 23079;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-99.356%\"},\n            {\"Drawdown\", \"4.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96325.06\"},\n            {\"Net Profit\", \"-3.675%\"},\n            {\"Sharpe Ratio\", \"-15.545\"},\n            {\"Sortino Ratio\", \"-15.545\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"3.263\"},\n            {\"Beta\", \"-0.263\"},\n            {\"Annual Standard Deviation\", \"0.064\"},\n            {\"Annual Variance\", \"0.004\"},\n            {\"Information Ratio\", \"-56.095\"},\n            {\"Tracking Error\", \"0.306\"},\n            {\"Treynor Ratio\", \"3.773\"},\n            {\"Total Fees\", \"$2.47\"},\n            {\"Estimated Strategy Capacity\", \"$19000000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VOFJUCDY9XNH\"},\n            {\"Portfolio Turnover\", \"44.37%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2c82779586fa2691d412e4bd4c4ff2b1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Continuous Futures Regression algorithm.\n    /// Asserting the behavior of stop market order <see cref=\"StopMarketOrder\"/> in extended market hours\n    /// <seealso cref=\"Data.UniverseSelection.UniverseSettings.ExtendedMarketHours\"/>\n    /// </summary>\n    public class FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _ticket;\n        private Future _SP500EMini;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 12);\n\n            _SP500EMini = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, extendedMarketHours: true);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.At(19, 0), () =>\n            {\n                // Don't place orders at the end of the last date, the market-on-stop order won't have time to fill\n                if (Time.Date == EndDate.Date.AddDays(-1))\n                {\n                    return;\n                }\n\n                MarketOrder(_SP500EMini.Mapped, 1);\n                _ticket = StopMarketOrder(_SP500EMini.Mapped, -1, _SP500EMini.Price * 1.1m);\n            });\n        }\n\n        /// <summary>\n        /// Data Event Handler: receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (_ticket == null || _ticket.Status != OrderStatus.Submitted)\n            {\n                return;\n            }\n\n            var stopPrice = _ticket.Get(OrderField.StopPrice);\n            var bar = Securities[_ticket.Symbol].Cache.GetData<TradeBar>();\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent == null)\n            {\n                return;\n            }\n\n            if (Transactions.GetOrderById(orderEvent.OrderId).Type != OrderType.StopMarket)\n            {\n                return;\n            }\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                var time = MarketHoursDatabase.GetExchangeHours(_SP500EMini.SubscriptionDataConfig);\n\n                if (!time.IsOpen(orderEvent.UtcTime, _SP500EMini.IsExtendedMarketHours))\n                {\n                    throw new RegressionTestException($\"The Exchange hours was closed, verify 'extendedMarketHours' flag in {nameof(Initialize)} when added new security(ies).\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var stopMarketOrders = Transactions.GetOrders(x => x is StopMarketOrder);\n\n            if (stopMarketOrders.Any(x => x.Status != OrderStatus.Filled))\n            {\n                throw new RegressionTestException(\"The Algorithms was not handled any StopMarketOrders\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all time slices of algorithm\n        /// </summary>\n        public long DataPoints => 41486;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"10\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.02%\"},\n            {\"Compounding Annual Return\", \"-6.419%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99891\"},\n            {\"Net Profit\", \"-0.109%\"},\n            {\"Sharpe Ratio\", \"-22.29\"},\n            {\"Sortino Ratio\", \"-26.651\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.016%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.05\"},\n            {\"Beta\", \"-0.006\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.76\"},\n            {\"Tracking Error\", \"0.215\"},\n            {\"Treynor Ratio\", \"8.829\"},\n            {\"Total Fees\", \"$21.50\"},\n            {\"Estimated Strategy Capacity\", \"$3400000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"138.95%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"957191893a3de4975ec14b2a3b2490de\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FutureUniverseHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing history requests for <see cref=\"FutureUniverse\"/> type work as expected\n    /// and return the same data as the futures chain provider.\n    /// </summary>\n    public class FutureUniverseHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 11);\n            SetEndDate(2013, 10, 11);\n\n            var future = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute).Symbol;\n\n            var historicalFuturesData = History<FutureUniverse>(future, 3, Resolution.Daily).ToList();\n\n            if (historicalFuturesData.Count != 3)\n            {\n                throw new RegressionTestException($\"Expected 3 futures chains from history request, \" +\n                    $\"but got {historicalFuturesData.Count}\");\n            }\n\n            foreach (var historyFutureUniverse in historicalFuturesData)\n            {\n                var date = historyFutureUniverse.EndTime;\n                var chain = FutureChainProvider.GetFutureContractList(future, date).ToList();\n\n                if (chain.Count == 0)\n                {\n                    throw new RegressionTestException($\"No futures in chain on {date}\");\n                }\n\n                if (chain.Count != historyFutureUniverse.Data.Count)\n                {\n                    throw new RegressionTestException($\"Expected {chain.Count} futures in chain on {date}, \" +\n                        $\"but got {historyFutureUniverse.Data.Count}\");\n                }\n\n                for (var i = 0; i < chain.Count; i++)\n                {\n                    if (historyFutureUniverse.Data[i].Symbol != chain[i])\n                    {\n                        throw new RegressionTestException($\"Missing future contract {chain[i]} on {date}\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2735;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 6;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesAndFutureOptionsUniverseSettingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that futures and future options from universe are added with the same resolution, fill forward and extended market hours settings as the universe settings.\n    /// </summary>\n    public class FuturesAndFutureOptionsUniverseSettingsRegressionAlgorithm : EquityOptionsUniverseSettingsRegressionAlgorithm\n    {\n        protected override DateTime TestStartDate => new DateTime(2020, 01, 03);\n\n        protected override SecurityType[] AddSecurity()\n        {\n            var futures = AddFuture(Futures.Indices.SP500EMini);\n            futures.SetFilter(0, 180);\n\n            AddFutureOption(futures.Symbol, universe => universe.Strikes(-5, +5));\n\n            return [SecurityType.Future, SecurityType.FutureOption];\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 456;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing Futures = QuantConnect.Securities.Futures;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests delistings for Futures and Futures Options to ensure that they are delisted at the expected times.\n    /// </summary>\n    public class FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _invested;\n        private int _liquidated;\n        private int _delistingsReceived;\n\n        private Symbol _esFuture;\n        private Symbol _esFutureOption;\n\n        private readonly DateTime _expectedExpiryWarningTime = new DateTime(2020, 6, 19);\n        private readonly DateTime _expectedExpiryDelistingTime = new DateTime(2020, 6, 20);\n        private readonly DateTime _expectedLiquidationTime = new DateTime(2020, 6, 20);\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 12, 1);\n            SetCash(100000);\n\n            var es = QuantConnect.Symbol.CreateFuture(\n                Futures.Indices.SP500EMini,\n                Market.CME,\n                new DateTime(2020, 6, 19));\n\n            var esOption = QuantConnect.Symbol.CreateOption(\n                es,\n                Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                3400m,\n                new DateTime(2020, 6, 19));\n\n            _esFuture = AddFutureContract(es, Resolution.Minute).Symbol;\n            _esFutureOption = AddFutureOptionContract(esOption, Resolution.Minute).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                // Two warnings and two delisted events should be received for a grand total of 4 events.\n                _delistingsReceived++;\n\n                if (delisting.Type == DelistingType.Warning &&\n                    delisting.Time != _expectedExpiryWarningTime)\n                {\n                    throw new RegressionTestException($\"Expiry warning with time {delisting.Time} but is expected to be {_expectedExpiryWarningTime}\");\n                }\n                if (delisting.Type == DelistingType.Warning && delisting.Time != Time.Date)\n                {\n                    throw new RegressionTestException($\"Delisting warning received at an unexpected date: {Time} - expected {delisting.Time}\");\n                }\n                if (delisting.Type == DelistingType.Delisted &&\n                    delisting.Time != _expectedExpiryDelistingTime)\n                {\n                    throw new RegressionTestException($\"Delisting occurred at unexpected time: {delisting.Time} - expected: {_expectedExpiryDelistingTime}\");\n                }\n                if (delisting.Type == DelistingType.Delisted &&\n                    delisting.Time != Time.Date)\n                {\n                    throw new RegressionTestException($\"Delisting notice received at an unexpected date: {Time} - expected {delisting.Time}\");\n                }\n            }\n\n            if (!_invested &&\n                (slice.Bars.ContainsKey(_esFuture) || slice.QuoteBars.ContainsKey(_esFuture)) &&\n                (slice.Bars.ContainsKey(_esFutureOption) || slice.QuoteBars.ContainsKey(_esFutureOption)))\n            {\n                _invested = true;\n\n                MarketOrder(_esFuture, 1);\n\n                var optionContract = Securities[_esFutureOption];\n                var marginModel = optionContract.BuyingPowerModel as FuturesOptionsMarginModel;\n                if (marginModel.InitialIntradayMarginRequirement == 0\n                    || marginModel.InitialOvernightMarginRequirement == 0\n                    || marginModel.MaintenanceIntradayMarginRequirement == 0\n                    || marginModel.MaintenanceOvernightMarginRequirement == 0)\n                {\n                    throw new RegressionTestException(\"Unexpected margin requirements\");\n                }\n\n                if (marginModel.GetInitialMarginRequirement(optionContract, 1) == 0)\n                {\n                    throw new RegressionTestException(\"Unexpected Initial Margin requirement\");\n                }\n                if (marginModel.GetMaintenanceMargin(optionContract) != 0)\n                {\n                    throw new RegressionTestException(\"Unexpected Maintenance Margin requirement\");\n                }\n\n                MarketOrder(_esFutureOption, 1);\n\n                if (marginModel.GetMaintenanceMargin(optionContract) == 0)\n                {\n                    throw new RegressionTestException(\"Unexpected Maintenance Margin requirement\");\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Direction != OrderDirection.Sell || orderEvent.Status != OrderStatus.Filled)\n            {\n                return;\n            }\n\n            // * Future Liquidation\n            // * Future Option Exercise\n\n            // * We expect NO Underlying Future Liquidation because we already hold a Long future position so the FOP Put selling leaves us breakeven\n            _liquidated++;\n            if (orderEvent.Symbol.SecurityType == SecurityType.FutureOption && _expectedLiquidationTime != Time)\n            {\n                throw new RegressionTestException($\"Expected to liquidate option {orderEvent.Symbol} at {_expectedLiquidationTime}, instead liquidated at {Time}\");\n            }\n            if (orderEvent.Symbol.SecurityType == SecurityType.Future && _expectedLiquidationTime.AddMinutes(-1) != Time && _expectedLiquidationTime != Time)\n            {\n                throw new RegressionTestException($\"Expected to liquidate future {orderEvent.Symbol} at {_expectedLiquidationTime} (+1 minute), instead liquidated at {Time}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_invested)\n            {\n                throw new RegressionTestException(\"Never invested in ES futures and FOPs\");\n            }\n            if (_delistingsReceived != 4)\n            {\n                throw new RegressionTestException($\"Expected 4 delisting events received, found: {_delistingsReceived}\");\n            }\n            if (_liquidated != 2)\n            {\n                throw new RegressionTestException($\"Expected 3 liquidation events, found {_liquidated}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212944;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"10.36%\"},\n            {\"Average Loss\", \"-10.99%\"},\n            {\"Compounding Annual Return\", \"-1.942%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"-0.028\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98233.93\"},\n            {\"Net Profit\", \"-1.766%\"},\n            {\"Sharpe Ratio\", \"-1.141\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.020%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.94\"},\n            {\"Alpha\", \"-0.02\"},\n            {\"Beta\", \"0.001\"},\n            {\"Annual Standard Deviation\", \"0.017\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.602\"},\n            {\"Tracking Error\", \"0.291\"},\n            {\"Treynor Ratio\", \"-16.65\"},\n            {\"Total Fees\", \"$3.57\"},\n            {\"Estimated Strategy Capacity\", \"$16000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"1.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6ef08dcc3239de1821ecaa4bbdee41ab\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesAutomaticSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that futures and future option contracts added via universe selection\n    /// get automatically seeded by default\n    /// </summary>\n    public class FuturesAutomaticSeedRegressionAlgorithm : AutomaticSeedBaseRegressionAlgorithm\n    {\n        private bool _futureContractsAdded;\n        private bool _fopsContractsAdded;\n\n        protected override bool ShouldHaveTradeData => true;\n        protected override bool ShouldHaveQuoteData => false;\n        protected override bool ShouldHaveOpenInterestData => true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 07);\n            SetEndDate(2020, 01, 07);\n            SetCash(100000);\n\n            Settings.SeedInitialPrices = true;\n\n            var futures = AddFuture(Futures.Indices.SP500EMini);\n            futures.SetFilter(0, 365);\n\n            AddFutureOption(futures.Symbol, universe => universe.Strikes(-5, +5));\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(changes);\n\n            if (!_futureContractsAdded || !_fopsContractsAdded)\n            {\n                foreach (var addedSecurity in changes.AddedSecurities)\n                {\n                    // Just making sure we had the data to select and seed futures and future options\n                    _futureContractsAdded |= addedSecurity.Symbol.SecurityType == SecurityType.Future;\n                    _fopsContractsAdded |= addedSecurity.Symbol.SecurityType == SecurityType.FutureOption;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_futureContractsAdded)\n            {\n                throw new RegressionTestException(\"No option contracts were added\");\n            }\n\n            if (!_fopsContractsAdded)\n            {\n                throw new RegressionTestException(\"No future option contracts were added\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 448;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 453;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesChainFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.FuturesChain(Symbol, bool)\"/>\n    /// method to get a future chain.\n    /// </summary>\n    public class FuturesChainFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _futureContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var future = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute).Symbol;\n\n            var chain = FuturesChain(future);\n            foreach (var contract in chain)\n            {\n                if (contract.BidPrice == 0 && contract.AskPrice == 0 && contract.Volume == 0)\n                {\n                    throw new RegressionTestException(\"FuturesChain() returned contract with no data.\");\n                }\n            }\n\n            _futureContract = chain\n                // Get contracts expiring within 6 months\n                .Where(contractData => contractData.Expiry - Time <= TimeSpan.FromDays(180))\n                // Get the contract with the latest expiration date, and lowest price\n                .OrderByDescending(x => x.Expiry)\n                .ThenBy(x => x.LastPrice)\n                .First();\n\n            AddFutureContract(_futureContract);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_futureContract, 0.5);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4083;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"450\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"50272.1\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$8290.40\"},\n            {\"Estimated Strategy Capacity\", \"$13000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"639698.49%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"312461917700d86df1b5c43e1e7ec0eb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesChainsMultipleFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.FuturesChains(IEnumerable{Symbol}, bool)\"/>\n    /// method to get multiple futures chains.\n    /// </summary>\n    public class FuturesChainsMultipleFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _esFutureContract;\n        private Symbol _gcFutureContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var esFuture= AddFuture(Futures.Indices.SP500EMini).Symbol;\n            var gcFuture = AddFuture(Futures.Metals.Gold).Symbol;\n\n            var chains = FuturesChains([esFuture, gcFuture]);\n\n            _esFutureContract = GetContract(chains, esFuture);\n            _gcFutureContract = GetContract(chains, gcFuture);\n\n            AddFutureContract(_esFutureContract);\n            AddFutureContract(_gcFutureContract);\n        }\n\n        private Symbol GetContract(FuturesChains chains, Symbol canonical)\n        {\n            return chains\n                .Where(kvp => kvp.Key == canonical)\n                .Select(kvp => kvp.Value)\n                .Single()\n                // Get contracts expiring within 6 months\n                .Where(contractData => contractData.Expiry - Time <= TimeSpan.FromDays(180))\n                // Get the contract with the latest expiration date, and lowest price\n                .OrderByDescending(x => x.Expiry)\n                .ThenBy(x => x.LastPrice)\n                .First();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_esFutureContract, 0.25);\n                SetHoldings(_gcFutureContract, 0.25);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8184;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"900\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"57108.26\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5701.74\"},\n            {\"Estimated Strategy Capacity\", \"$19000.00\"},\n            {\"Lowest Capacity Asset\", \"GC VOFJUCDY9XNH\"},\n            {\"Portfolio Turnover\", \"432921.78%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c75de8eb115be82a0ec2afaec8d034ff\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesDailySettlementLongRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the futures daily cash settlement behavior taking long positions\n    /// </summary>\n    public class FuturesDailySettlementLongRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private decimal _initialPortfolioValue;\n        private int _lastTradedDay;\n        private Symbol _contractSymbol;\n        private Future _future;\n\n        /// <summary>\n        /// Expected cash balance for each day\n        /// </summary>\n        protected virtual Dictionary<DateTime, decimal> ExpectedCash { get; } = new()\n        {\n            { new DateTime(2013, 10, 07), 100000 },\n            { new DateTime(2013, 10, 08), 103264.45m },\n            { new DateTime(2013, 10, 09), 101231.05m },\n            { new DateTime(2013, 10, 10), 101962.10m },\n            { new DateTime(2013, 10, 10, 17, 0, 0), 100905.65m }\n        };\n\n        /// <summary>\n        /// Order side factor\n        /// </summary>\n        protected virtual int OrderSide => 1;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 10);\n\n            var future = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n\n            _contractSymbol = FuturesChain(future).OrderBy(x => x.ID.Date).First();\n            _future = AddFutureContract(_contractSymbol);\n\n            _future.Holdings.SetHoldings(1600, 1 * OrderSide);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            AssertCash(Time.Date);\n\n            if (Transactions.OrdersCount == 0)\n            {\n                // initial trade\n                _initialPortfolioValue = Portfolio.TotalPortfolioValue - _future.Holdings.UnrealizedProfit;\n                MarketOrder(_contractSymbol, 1 * OrderSide);\n            }\n            else if(Time.Day == 7 && _lastTradedDay != Time.Day)\n            {\n                _lastTradedDay = Time.Day;\n                // increase position\n                MarketOrder(_contractSymbol, 1 * OrderSide);\n            }\n            else if (Time.Day == 8 && _lastTradedDay != Time.Day)\n            {\n                _lastTradedDay = Time.Day;\n                // reduce position\n                MarketOrder(_contractSymbol, -1 * OrderSide);\n            }\n            else if (Time.Day == 9 && _lastTradedDay != Time.Day)\n            {\n                _lastTradedDay = Time.Day;\n                // cross position\n                MarketOrder(_contractSymbol, -3 * OrderSide);\n            }\n            else if (Time.Day == 10)\n            {\n                if(_lastTradedDay != Time.Day)\n                {\n                    _lastTradedDay = Time.Day;\n                    // increase position\n                    MarketOrder(_contractSymbol, -1 * OrderSide);\n                }\n                else\n                {\n                    // finally liquidate\n                    Liquidate();\n                }\n            }\n        }\n\n        private void AssertCash(DateTime currentTime)\n        {\n            if (ExpectedCash.Remove(currentTime, out var expected))\n            {\n                var value = Portfolio.CashBook.TotalValueInAccountCurrency;\n                if (expected != Math.Round(value, 5))\n                {\n                    throw new RegressionTestException($\"Unexpected cash balance {value} expected {expected}\");\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var holdings = (FutureHolding)_future.Holdings;\n            Debug($\"{Environment.NewLine}InitialPortfolioValue: {_initialPortfolioValue}. CurrentPortfolioValue: {Portfolio.TotalPortfolioValue}\" +\n                $\"{Environment.NewLine}Profit: {holdings.Profit}\" +\n                $\"{Environment.NewLine}Fees: {holdings.TotalFees}\" +\n                $\"{Environment.NewLine}CashBook:{Environment.NewLine}{Portfolio.CashBook}\" +\n                $\"{Environment.NewLine}UnsettledCashBook:{Environment.NewLine}{Portfolio.UnsettledCashBook}\");\n\n            var expected = _initialPortfolioValue + holdings.NetProfit;\n            if (expected != Portfolio.TotalPortfolioValue || expected != Portfolio.CashBook[Currencies.USD].Amount)\n            {\n                throw new RegressionTestException($\"Unexpected future profit {holdings.NetProfit}\");\n            }\n            if(holdings.SettledProfit != 0)\n            {\n                throw new RegressionTestException($\"Unexpected SettledProfit value {holdings.SettledProfit}\");\n            }\n            if (holdings.UnrealizedProfit != 0)\n            {\n                throw new RegressionTestException($\"Unexpected UnrealizedProfit value {holdings.UnrealizedProfit}\");\n            }\n\n            AssertCash(Time);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5444;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.89%\"},\n            {\"Average Loss\", \"-0.87%\"},\n            {\"Compounding Annual Return\", \"142.879%\"},\n            {\"Drawdown\", \"3.800%\"},\n            {\"Expectancy\", \"0.349\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100905.65\"},\n            {\"Net Profit\", \"0.906%\"},\n            {\"Sharpe Ratio\", \"-3.968\"},\n            {\"Sortino Ratio\", \"-8.141\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"1.02\"},\n            {\"Alpha\", \"-1.091\"},\n            {\"Beta\", \"0.151\"},\n            {\"Annual Standard Deviation\", \"0.216\"},\n            {\"Annual Variance\", \"0.047\"},\n            {\"Information Ratio\", \"-7.634\"},\n            {\"Tracking Error\", \"0.313\"},\n            {\"Treynor Ratio\", \"-5.675\"},\n            {\"Total Fees\", \"$19.35\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"183.82%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0a1d9c87a1aced914c355e762c255a31\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesDailySettlementShortRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the futures daily cash settlement behavior taking short positions\n    /// </summary>\n    public class FuturesDailySettlementShortRegressionAlgorithm : FuturesDailySettlementLongRegressionAlgorithm\n    {\n        /// <summary>\n        /// Expected cash balance for each day\n        /// </summary>\n        protected override Dictionary<DateTime, decimal> ExpectedCash { get; } = new()\n        {\n            { new DateTime(2013, 10, 07), 100000 },\n            { new DateTime(2013, 10, 08), 96701.95m },\n            { new DateTime(2013, 10, 09), 98718.55m },\n            { new DateTime(2013, 10, 10), 97937.10m },\n            { new DateTime(2013, 10, 10, 17, 0, 0), 98943.15m }\n        };\n\n        /// <summary>\n        /// Order side factor\n        /// </summary>\n        protected override int OrderSide => -1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.83%\"},\n            {\"Average Loss\", \"-0.94%\"},\n            {\"Compounding Annual Return\", \"-64.858%\"},\n            {\"Drawdown\", \"47.200%\"},\n            {\"Expectancy\", \"-0.373\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98943.15\"},\n            {\"Net Profit\", \"-1.057%\"},\n            {\"Sharpe Ratio\", \"26.42\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"67%\"},\n            {\"Win Rate\", \"33%\"},\n            {\"Profit-Loss Ratio\", \"0.88\"},\n            {\"Alpha\", \"6.391\"},\n            {\"Beta\", \"-0.176\"},\n            {\"Annual Standard Deviation\", \"0.232\"},\n            {\"Annual Variance\", \"0.054\"},\n            {\"Information Ratio\", \"11.718\"},\n            {\"Tracking Error\", \"0.392\"},\n            {\"Treynor Ratio\", \"-34.751\"},\n            {\"Total Fees\", \"$19.35\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"190.82%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0e022e93654b97f28728151455889a88\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesExpiredContractRegression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test if expired futures contract chains are making their\n    /// way into the timeslices being delivered to OnData()\n    /// </summary>\n    public class FuturesExpiredContractRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _receivedData;\n\n        /// <summary>\n        /// Initializes the algorithm state.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 1);\n            SetEndDate(2013, 12, 23);\n            SetCash(1000000);\n\n            // Subscribe to futures ES\n            var future = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, Market.CME, false);\n            future.SetFilter(TimeSpan.FromDays(0), TimeSpan.FromDays(90));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var point in slice)\n            {\n                if (point.Value.IsFillForward)\n                {\n                    throw new RegressionTestException(\"We requested no fill forwarding!\");\n                }\n            }\n\n            foreach (var chain in slice.FutureChains)\n            {\n                _receivedData = true;\n\n                foreach (var contract in chain.Value.OrderBy(x => x.Expiry))\n                {\n                    if (contract.Expiry.Date < Time.Date)\n                    {\n                        throw new RegressionTestException($\"Received expired contract {contract} expired: {contract.Expiry} current time: {Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedData)\n            {\n                throw new RegressionTestException(\"No Futures chains were received in this regression\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 24508;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.102\"},\n            {\"Tracking Error\", \"0.091\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm asserts that futures have data at extended market hours when this is enabled.\n    /// </summary>\n    public class FuturesExtendedMarketHoursRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _es;\n        private Future _gc;\n        private bool _esRanOnRegularHours;\n        private bool _esRanOnExtendedHours;\n        private bool _gcRanOnRegularHours;\n        private bool _gcRanOnExtendedHours;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 11);\n\n            _es = AddFuture(Futures.Indices.SP500EMini, Resolution.Hour, fillForward: true, extendedMarketHours: true);\n            _es.SetFilter(0, 180);\n\n            _gc = AddFuture(Futures.Metals.Gold, Resolution.Hour, fillForward: true, extendedMarketHours: false);\n            _gc.SetFilter(0, 180);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var sliceSymbols = new HashSet<Symbol>(slice.Keys);\n            sliceSymbols.UnionWith(slice.Bars.Keys);\n            sliceSymbols.UnionWith(slice.Ticks.Keys);\n            sliceSymbols.UnionWith(slice.QuoteBars.Keys);\n\n            var esIsInRegularHours = _es.Exchange.Hours.IsOpen(Time, false);\n            var esIsInExtendedHours = !esIsInRegularHours && _es.Exchange.Hours.IsOpen(Time, true);\n            var sliceHasESData = sliceSymbols.Any(symbol => symbol == _es.Symbol || symbol.Canonical == _es.Symbol);\n            _esRanOnRegularHours |= esIsInRegularHours && sliceHasESData;\n            _esRanOnExtendedHours |= esIsInExtendedHours && sliceHasESData;\n\n            var gcIsInRegularHours = _gc.Exchange.Hours.IsOpen(Time, false);\n            var gcIsInExtendedHours = !gcIsInRegularHours && _gc.Exchange.Hours.IsOpen(Time, true);\n            var sliceHasGCData = sliceSymbols.Any(symbol => symbol == _gc.Symbol || symbol.Canonical == _gc.Symbol);\n            _gcRanOnRegularHours |= gcIsInRegularHours && sliceHasGCData;\n            _gcRanOnExtendedHours |= gcIsInExtendedHours && sliceHasGCData;\n\n            var currentTimeIsRegularHours = (Time.TimeOfDay >= new TimeSpan(9, 30, 0) && Time.TimeOfDay < new TimeSpan(16, 15, 0)) ||\n                (Time.TimeOfDay >= new TimeSpan(16, 30, 0) && Time.TimeOfDay < new TimeSpan(17, 0, 0));\n            var currentTimeIsExtendedHours = !currentTimeIsRegularHours\n                && (Time.TimeOfDay < new TimeSpan(9, 30, 0) || Time.TimeOfDay >= new TimeSpan(18, 0, 0));\n\n            if (esIsInRegularHours != currentTimeIsRegularHours || esIsInExtendedHours != currentTimeIsExtendedHours)\n            {\n                throw new RegressionTestException($\"At {Time}, {_es.Symbol} is either in regular hours but current time is in extended hours, or viceversa\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_esRanOnRegularHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on regular hours for {_es.Symbol} future, which enabled extended market hours\");\n            }\n\n            if (!_esRanOnExtendedHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on extended hours for {_es.Symbol} future, which enabled extended market hours\");\n            }\n\n            if (!_gcRanOnRegularHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have run on regular hours for {_gc.Symbol} future, which did not enable extended market hours\");\n            }\n\n            if (_gcRanOnExtendedHours)\n            {\n                throw new RegressionTestException($\"Algorithm should have not run on extended hours for {_gc.Symbol} future, which did not enable extended market hours\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2197;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.564\"},\n            {\"Tracking Error\", \"0.214\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of using universe selection with futures\n    /// </summary>\n    public class FuturesFrameworkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private static Symbol _es = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n        private static Symbol _gold = QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX);\n\n        private readonly Dictionary<Symbol, bool> _addedCanonical = new() { { _gold, false }, { _es, false } };\n        private readonly Dictionary<Symbol, bool> _removedCanonical = new() { { _gold, false }, { _es, false } };\n        private readonly Dictionary<Symbol, SimpleMovingAverage> _canonicalData = new() { { _gold, null }, { _es, null } };\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            SetUniverseSelection(new FutureUniverseSelectionModel(QuantConnect.Time.OneDay, SelectFutureChainSymbols));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        private static IEnumerable<Symbol> SelectFutureChainSymbols(DateTime utcTime)\n        {\n            var newYorkTime = utcTime.ConvertFromUtc(TimeZones.NewYork);\n            if (newYorkTime.Date < new DateTime(2013, 10, 09))\n            {\n                yield return _es;\n            }\n            if (newYorkTime.Date >= new DateTime(2013, 10, 09))\n            {\n                yield return _gold;\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var future = _es;\n            if (Time.Date >= new DateTime(2013, 10, 09))\n            {\n                future = _gold;\n            }\n\n            var continuous = Securities[future];\n            if (continuous.Price == Securities[(continuous as Future).Mapped].Price)\n            {\n                // prices should never match because we are using the default backwards adjusted mode, they would match if we used raw mode\n                throw new RegressionTestException($\"Unexpected continuous future price {continuous.Price}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (added.Symbol.IsCanonical())\n                {\n                    _addedCanonical[added.Symbol] = true;\n                    _canonicalData[added.Symbol] = SMA(added.Symbol, 10);\n                }\n            }\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                if (removed.Symbol.IsCanonical())\n                {\n                    _removedCanonical[removed.Symbol] = true;\n                }\n            }\n\n            var canonicals = changes.AddedSecurities.Select(x => x.Symbol.Canonical).ToHashSet();\n            var nonCanonicals = changes.AddedSecurities.Where(x => !x.Symbol.IsCanonical()).ToList();\n            foreach (var subscriptions in SubscriptionManager.Subscriptions.Where(x => canonicals.Contains(x.Symbol.Canonical)).GroupBy(x => x.Symbol.Canonical))\n            {\n                // trade & quote for canonical + contract chain (universe data)\n                if (subscriptions.Count(x => x.Symbol.IsCanonical()) != canonicals.Count * 3)\n                {\n                    throw new RegressionTestException($\"Unexpected canonical subscription count {subscriptions.Count(x => x.Symbol.IsCanonical())}\");\n                }\n\n                // trade and quote for non canonicals\n                if (subscriptions.Count(x => !x.Symbol.IsCanonical()) != nonCanonicals.Count * 2)\n                {\n                    throw new RegressionTestException($\"Unexpected non canonical subscription count {subscriptions.Count(x => !x.Symbol.IsCanonical())}\");\n                }\n            }\n\n            var internalSubscriptions = SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(includeInternalConfigs: true)\n                .Where(x => x.SecurityType == SecurityType.Future && x.IsInternalFeed && canonicals.Contains(x.Symbol.Canonical)).ToList();\n            // an open interest subscription for each + trade and quote for the currently mapped continuous future\n            if (internalSubscriptions.Count != (nonCanonicals.Count + canonicals.Count + canonicals.Count * 2))\n            {\n                throw new RegressionTestException($\"Unexpected internal subscription count {internalSubscriptions.Count}\");\n            }\n\n            // we expect a single continuous universe at the time\n            var universeSubscriptions = SubscriptionManager.Subscriptions.Count(x => x.Symbol.ID.Symbol.Contains(\"QC-UNIVERSE-CONTINUOUS\"));\n            if (universeSubscriptions != 1)\n            {\n                throw new RegressionTestException($\"Unexpected universe subscription count {universeSubscriptions}\");\n            }\n\n            // we expect a single canonical at the time\n            var canonicalSubscriptions = SubscriptionManager.Subscriptions.Where(x => !x.Symbol.ID.Symbol.Contains(\"QC-UNIVERSE-CONTINUOUS\") && x.Symbol.IsCanonical())\n                .Select(x => x.Symbol.Canonical).ToHashSet();\n            if (canonicalSubscriptions.Count != 1)\n            {\n                throw new RegressionTestException($\"Unexpected universe subscription count {universeSubscriptions}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var canonical in _addedCanonical)\n            {\n                if (!canonical.Value)\n                {\n                    throw new RegressionTestException($\"Canonical {canonical} was not added!\");\n                }\n            }\n            foreach (var canonical in _removedCanonical)\n            {\n                if (canonical.Key.ID.Symbol == \"ES\" && !canonical.Value || canonical.Key.ID.Symbol == \"GC\" && canonical.Value)\n                {\n                    throw new RegressionTestException($\"Canonical {canonical} was not removed!\");\n                }\n            }\n            foreach (var canonical in _canonicalData)\n            {\n                if (canonical.Value == null || !canonical.Value.IsReady)\n                {\n                    throw new RegressionTestException($\"Canonical {canonical} emitted no data!\");\n                }\n            }\n\n            if (SubscriptionManager.Subscriptions.Any(x => x.Symbol.ID.Symbol == \"ES\"))\n            {\n                throw new RegressionTestException($\"There should be no ES subscription!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 101119;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"10\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-4.59%\"},\n            {\"Compounding Annual Return\", \"-100.000%\"},\n            {\"Drawdown\", \"33.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"79014\"},\n            {\"Net Profit\", \"-20.986%\"},\n            {\"Sharpe Ratio\", \"-0.537\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"18.566%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-11.401\"},\n            {\"Beta\", \"5.262\"},\n            {\"Annual Standard Deviation\", \"1.875\"},\n            {\"Annual Variance\", \"3.515\"},\n            {\"Information Ratio\", \"-1.71\"},\n            {\"Tracking Error\", \"1.744\"},\n            {\"Treynor Ratio\", \"-0.191\"},\n            {\"Total Fees\", \"$86.00\"},\n            {\"Estimated Strategy Capacity\", \"$410000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VRJST036ZY0X\"},\n            {\"Portfolio Turnover\", \"766.37%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"97cfbcf973995ceb72b937f0f4684f88\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/FuturesMomentumAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// EMA cross with SP500 E-mini futures\n    /// In this example, we demostrate how to trade futures contracts using\n    /// a equity to generate the trading signals\n    /// It also shows how you can prefilter contracts easily based on expirations.\n    /// It also shows how you can inspect the futures chain to pick a specific contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    public class FuturesMomentumAlgorithm : QCAlgorithm\n    {\n        private const decimal _tolerance = 0.001m;\n        private const int _fastPeriod = 20;\n        private const int _slowPeriod = 60;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        public bool IsReady { get { return _fast.IsReady && _slow.IsReady; } }\n        public bool IsUpTrend { get { return IsReady && _fast > _slow * (1 + _tolerance); } }\n        public bool IsDownTrend { get { return IsReady && _fast < _slow * (1 + _tolerance); } }\n\n        public override void Initialize()\n        {\n            SetStartDate(2016, 1, 1);\n            SetEndDate(2016, 8, 18);\n            SetCash(100000);\n            SetWarmUp(Math.Max(_fastPeriod, _slowPeriod));\n\n            // Adds SPY to be used in our EMA indicators\n            var equity = AddEquity(\"SPY\", Resolution.Daily);\n            _fast = EMA(equity.Symbol, _fastPeriod, Resolution.Daily);\n            _slow = EMA(equity.Symbol, _slowPeriod, Resolution.Daily);\n\n            // Adds the future that will be traded and\n            // set our expiry filter for this futures chain\n            var future = AddFuture(Futures.Indices.SP500EMini);\n            future.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsUpTrend)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                        ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n\n            if (Portfolio.Invested && IsDownTrend)\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            Plot(\"Indicator Signal\", \"EOD\", IsDownTrend ? -1 : IsUpTrend ? 1 : 0);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/FuzzyInferenceAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing Accord.Fuzzy;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of the Accord Fuzzy Logic library in CSharp. Using Accord to do fuzzy inference for making decisions on indicators.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"machine learning\" />\n    /// <meta name=\"tag\" content=\"fuzzy logic\" />\n    public class FuzzyInferenceAlgorithm : QCAlgorithm\n    {\n        //Indicators\n        private RelativeStrengthIndex _rsi;\n        private Momentum _mom;\n        private string _symbol = \"SPY\";\n\n        //\n        // With Accord v3.3.0, we need Accord.Math referenced in other projects that use\n        // this. By placing a hard reference to an Accord.Math type, the compiler\n        // will properly copy the required dlls into other project bin directories.\n        // Without this, consuming projects would need to hard reference the Accord dlls,\n        // which is less than perfect. This seems to be the better of two evils\n        //\n#pragma warning disable 0414, CA1823\n        Accord.Math.Matrix3x3 _matrix = new Accord.Math.Matrix3x3();\n#pragma warning restore 0414, CA1823\n\n        //Fuzzy Engine\n        private FuzzyEngine _engine;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 01, 01);  //Set Start Date\n            SetEndDate(2015, 06, 30);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            AddEquity(_symbol, Resolution.Daily);\n\n            _rsi = RSI(_symbol, 14, MovingAverageType.Simple, Resolution.Daily);\n            _mom = MOM(_symbol, 10, Resolution.Daily, Field.Close);\n\n            _engine = new FuzzyEngine();\n        }\n\n        public void OnData(TradeBars data)\n        {\n            if (_rsi.IsReady && _mom.IsReady)\n            {\n                try\n                {\n                    var signal = _engine.DoInference((float)_mom.Current.Value, (float)_rsi.Current.Value);\n\n                    if (!Portfolio.Invested)\n                    {\n                        if (signal > 30)\n                        {\n                            var quantity = decimal.ToInt32(Portfolio.MarginRemaining / data[_symbol].Price);\n                            Buy(_symbol, quantity);\n                            Debug(\"Purchased Stock: \" + quantity + \" shares\");\n                        }\n                    }\n                    else\n                    {\n                        if (signal < -10)\n                        {\n                            var quantity = decimal.ToInt32(Portfolio[_symbol].Quantity);\n                            Sell(_symbol, quantity);\n                            Debug(\"Sold Stock: \" + quantity + \" shares\");\n                        }\n                    }\n                }\n                catch (RegressionTestException ex)\n                {\n                    Debug(\"Ex: \" + ex.Message);\n                    Debug(\"## rsi: \" + _rsi + \" mom: \" + _mom);\n                }\n            }\n\n        }\n    }\n\n    public class FuzzyEngine\n    {\n        private InferenceSystem IS;\n\n        public FuzzyEngine()\n        {\n            // Linguistic labels (fuzzy sets) for Momentum\n            var momDown = new FuzzySet(\"Down\", new TrapezoidalFunction(-20, 5, 5, 5));\n            var momNeutral = new FuzzySet(\"Neutral\", new TrapezoidalFunction(-20, 0, 0, 20));\n            var momUp = new FuzzySet(\"Up\", new TrapezoidalFunction(5, 20, 20, 20));\n\n\n            // Linguistic labels (fuzzy sets) for RSI\n            var rsiLow = new FuzzySet(\"Low\", new TrapezoidalFunction(0, 30, 30, 30));\n            var rsiMedium = new FuzzySet(\"Medium\", new TrapezoidalFunction(0, 50, 50, 100));\n            var rsiHigh = new FuzzySet(\"High\", new TrapezoidalFunction(70, 100, 100, 100));\n\n            // MOM (Input)\n            var lvMom = new LinguisticVariable(\"MOM\", -20, 20);\n            lvMom.AddLabel(momDown);\n            lvMom.AddLabel(momNeutral);\n            lvMom.AddLabel(momUp);\n\n            // RSI (Input)\n            var lvRsi = new LinguisticVariable(\"RSI\", 0, 100);\n            lvRsi.AddLabel(rsiLow);\n            lvRsi.AddLabel(rsiMedium);\n            lvRsi.AddLabel(rsiHigh);\n\n            // Linguistic labels (fuzzy sets) that compose the Signal\n            var fsShort = new FuzzySet(\"Sell\", new TrapezoidalFunction(-100, 0, 0, 00));\n            var fsHold = new FuzzySet(\"Hold\", new TrapezoidalFunction(-50, 0, 0, 50));\n            var fsLong = new FuzzySet(\"Buy\", new TrapezoidalFunction(0, 100, 100, 100));\n\n            // Output\n            var lvSignal = new LinguisticVariable(\"Signal\", -100, 100);\n            lvSignal.AddLabel(fsShort);\n            lvSignal.AddLabel(fsHold);\n            lvSignal.AddLabel(fsLong);\n\n            // The database\n            var fuzzyDB = new Database();\n            fuzzyDB.AddVariable(lvMom);\n            fuzzyDB.AddVariable(lvRsi);\n            fuzzyDB.AddVariable(lvSignal);\n\n            // Creating the inference system\n            IS = new InferenceSystem(fuzzyDB, new CentroidDefuzzifier(1000));\n\n            // Rules\n            IS.NewRule(\"Rule 1\", \"IF RSI IS Low AND MOM IS Down THEN Signal IS Buy\");\n            IS.NewRule(\"Rule 2\", \"IF RSI IS Medium AND MOM IS Down THEN Signal IS Buy\");\n            IS.NewRule(\"Rule 3\", \"IF RSI IS High AND MOM IS Down THEN Signal IS Hold\");\n\n            IS.NewRule(\"Rule 4\", \"IF RSI IS Low AND MOM IS Neutral THEN Signal IS Buy\");\n            IS.NewRule(\"Rule 5\", \"IF RSI IS Medium AND MOM IS Neutral THEN Signal IS Hold\");\n            IS.NewRule(\"Rule 6\", \"IF RSI IS High AND MOM IS Neutral THEN Signal IS Sell\");\n\n            IS.NewRule(\"Rule 7\", \"IF RSI IS Low AND MOM IS Up THEN Signal IS Hold\");\n            IS.NewRule(\"Rule 8\", \"IF RSI IS Medium AND MOM IS Up THEN Signal IS Sell\");\n            IS.NewRule(\"Rule 9\", \"IF RSI IS High AND MOM IS Up THEN Signal IS Sell\");\n        }\n\n        public double DoInference(float mom, float rsi)\n        {\n            // Setting inputs\n            IS.SetInput(\"MOM\", mom);\n            IS.SetInput(\"RSI\", rsi);\n\n            // Setting outputs\n            double signal = IS.Evaluate(\"Signal\");\n\n            return signal;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/G10CurrencySelectionModelFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Framework algorithm that uses the G10CurrencySelectionModel,\n    /// a Universe Selection Model that inherits from ManualUniverseSelectionModel\n    /// </summary>\n    public class G10CurrencySelectionModelFrameworkAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new G10CurrencySelectionModel());\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n            }\n        }\n\n        private class G10CurrencySelectionModel : ManualUniverseSelectionModel\n        {\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"G10CurrencySelectionModel\"/> class\n            /// using the algorithm's security initializer and universe settings\n            /// </summary>\n            public G10CurrencySelectionModel()\n                : base(new[]\n                {\n                \"EURUSD\",\n                \"GBPUSD\",\n                \"USDJPY\",\n                \"AUDUSD\",\n                \"NZDUSD\",\n                \"USDCAD\",\n                \"USDCHF\",\n                \"USDNOK\",\n                \"USDSEK\"\n                }.Select(x => QuantConnect.Symbol.Create(x, SecurityType.Forex, Market.Oanda)))\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/GetParameterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for testing parameterized regression algorithms get valid parameters.\n    /// </summary>\n    public class GetParameterRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n\n            CheckParameter((string)null, GetParameter(\"non-existing\"), \"GetParameter(\\\"non-existing\\\")\");\n            CheckParameter(\"100\", GetParameter(\"non-existing\", \"100\"), \"GetParameter(\\\"non-existing\\\", \\\"100\\\")\");\n            CheckParameter(100, GetParameter(\"non-existing\", 100), \"GetParameter(\\\"non-existing\\\", 100)\");\n            CheckParameter(100d, GetParameter(\"non-existing\", 100d), \"GetParameter(\\\"non-existing\\\", 100d)\");\n            CheckParameter(100m, GetParameter(\"non-existing\", 100m), \"GetParameter(\\\"non-existing\\\", 100m)\");\n\n            CheckParameter(\"10\", GetParameter(\"ema-fast\"), \"GetParameter(\\\"ema-fast\\\")\");\n            CheckParameter(10, GetParameter(\"ema-fast\", 100), \"GetParameter(\\\"ema-fast\\\", 100)\");\n            CheckParameter(10d, GetParameter(\"ema-fast\", 100d), \"GetParameter(\\\"ema-fast\\\", 100d)\");\n            CheckParameter(10m, GetParameter(\"ema-fast\", 100m), \"GetParameter(\\\"ema-fast\\\", 100m)\");\n\n            Quit();\n        }\n\n        private void CheckParameter<T, P>(T expected, P actual, string call)\n        {\n            if (expected == null && actual != null)\n            {\n                throw new RegressionTestException($\"{call} should have returned null but returned {actual} ({actual.GetType()})\");\n            }\n\n            if (expected != null && actual == null)\n            {\n                throw new RegressionTestException($\"{call} should have returned {expected} ({expected.GetType()}) but returned null\");\n            }\n\n            if (expected != null && actual != null && (expected.GetType() != actual.GetType() || !expected.Equals(actual)))\n            {\n                throw new RegressionTestException($\"{call} should have returned {expected} ({expected.GetType()}) but returned {actual} ({actual.GetType()})\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HSIFutureDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm using and testing HSI futures and index\n    /// </summary>\n    public class HSIFutureDailyRegressionAlgorithm : HSIFutureHourRegressionAlgorithm\n    {\n        /// <summary>\n        /// The data resolution\n        /// </summary>\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 176;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 115;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"15\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.33%\"},\n            {\"Compounding Annual Return\", \"-55.187%\"},\n            {\"Drawdown\", \"2.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97610\"},\n            {\"Net Profit\", \"-2.390%\"},\n            {\"Sharpe Ratio\", \"-15.799\"},\n            {\"Sortino Ratio\", \"-19.207\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.029\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-15.544\"},\n            {\"Tracking Error\", \"0.029\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$600.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"HSI VL6DN7UV65S9\"},\n            {\"Portfolio Turnover\", \"1590.77%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"46fc4362ac20b63ea361ff8d8ad38d90\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HSIFutureHourRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm using and testing HSI futures and index\n    /// </summary>\n    public class HSIFutureHourRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _symbolChangeEvent;\n        private Symbol _contractSymbol;\n        private Symbol _index;\n        private Symbol _futureSymbol;\n\n        /// <summary>\n        /// The data resolution\n        /// </summary>\n        protected virtual Resolution Resolution => Resolution.Hour;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 20);\n            SetEndDate(2013, 10, 30);\n\n            SetAccountCurrency(\"HKD\");\n            SetTimeZone(TimeZones.HongKong);\n\n            UniverseSettings.Resolution = Resolution;\n            _index = AddIndex(\"HSI\", Resolution).Symbol;\n            var future = AddFuture(Futures.Indices.HangSeng, Resolution);\n            future.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n            _futureSymbol = future.Symbol;\n\n            var seeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n                if (Time.TimeOfDay != TimeSpan.Zero)\n                {\n                    throw new RegressionTestException($\"{Time} unexpected symbol changed event {changedEvent}!\");\n                }\n                _symbolChangeEvent++;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        _contractSymbol = contract.Symbol;\n                        MarketOrder(_contractSymbol, 1);\n                    }\n                }\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_symbolChangeEvent != 1)\n            {\n                throw new RegressionTestException($\"Got no expected symbol changed event count {_symbolChangeEvent}!\");\n            }\n\n            // Get the margin requirements\n            var buyingPowerModel = Securities[_contractSymbol].BuyingPowerModel;\n            var futureMarginModel = buyingPowerModel as FutureMarginModel;\n            if (buyingPowerModel == null)\n            {\n                throw new RegressionTestException($\"Invalid buying power model. Found: {buyingPowerModel.GetType().Name}. Expected: {nameof(FutureMarginModel)}\");\n            }\n            var initialOvernight = futureMarginModel.InitialOvernightMarginRequirement;\n            var maintenanceOvernight = futureMarginModel.MaintenanceOvernightMarginRequirement;\n            var initialIntraday = futureMarginModel.InitialIntradayMarginRequirement;\n            var maintenanceIntraday = futureMarginModel.MaintenanceIntradayMarginRequirement;\n\n            var lastDataFuture = Securities[_futureSymbol].GetLastData();\n            if (lastDataFuture == null || (lastDataFuture.EndTime - lastDataFuture.Time) != TimeSpan.FromHours(Resolution == Resolution.Hour ? 1 : 7.25)\n                || lastDataFuture.EndTime.Date != lastDataFuture.Time.Date)\n            {\n                throw new RegressionTestException($\"Unexpected data for symbol {_futureSymbol}!\");\n            }\n\n            var lastDataIndex = Securities[_index].GetLastData();\n            if (lastDataIndex == null || (lastDataIndex.EndTime - lastDataIndex.Time) != TimeSpan.FromHours(Resolution == Resolution.Hour ? 1 : 6.5)\n                || lastDataFuture.EndTime.Date != lastDataFuture.Time.Date)\n            {\n                throw new RegressionTestException($\"Unexpected data for symbol {_index}!\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (addedSecurity.Symbol.SecurityType == SecurityType.Future\n                    && !addedSecurity.Symbol.IsCanonical()\n                    && !addedSecurity.HasData)\n                {\n                    throw new RegressionTestException($\"Future contracts did not work up as expected: {addedSecurity.Symbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 654;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 133;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public virtual AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"57\"},\n            {\"Average Win\", \"1.83%\"},\n            {\"Average Loss\", \"-1.31%\"},\n            {\"Compounding Annual Return\", \"-99.930%\"},\n            {\"Drawdown\", \"23.000%\"},\n            {\"Expectancy\", \"-0.572\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"80330\"},\n            {\"Net Profit\", \"-19.670%\"},\n            {\"Sharpe Ratio\", \"-1.298\"},\n            {\"Sortino Ratio\", \"-1.254\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.073%\"},\n            {\"Loss Rate\", \"82%\"},\n            {\"Win Rate\", \"18%\"},\n            {\"Profit-Loss Ratio\", \"1.40\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.772\"},\n            {\"Annual Variance\", \"0.596\"},\n            {\"Information Ratio\", \"-1.288\"},\n            {\"Tracking Error\", \"0.772\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2280.00\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"HSI VL6DN7UV65S9\"},\n            {\"Portfolio Turnover\", \"7099.25%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f7382e07fdf6b8a39ee00ea5092fa831\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"HistoricalReturnsAlphaModel\"/>.\n    /// </summary>\n    public class HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetAlpha(new HistoricalReturnsAlphaModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            const int expected = 78;\n            if (Insights.TotalCount != expected)\n            {\n                throw new RegressionTestException($\"The total number of insights should be {expected}. Actual: {Insights.TotalCount}\");\n            }\n        }\n\n        public override long DataPoints => 779;\n\n        public override int AlgorithmHistoryDataPoints => 4;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"69\"},\n            {\"Average Win\", \"0.18%\"},\n            {\"Average Loss\", \"-0.15%\"},\n            {\"Compounding Annual Return\", \"42.429%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"0.367\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102949.54\"},\n            {\"Net Profit\", \"2.950%\"},\n            {\"Sharpe Ratio\", \"5.164\"},\n            {\"Sortino Ratio\", \"8.556\"},\n            {\"Probabilistic Sharpe Ratio\", \"90.449%\"},\n            {\"Loss Rate\", \"38%\"},\n            {\"Win Rate\", \"62%\"},\n            {\"Profit-Loss Ratio\", \"1.22\"},\n            {\"Alpha\", \"0.306\"},\n            {\"Beta\", \"-0.129\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"1.181\"},\n            {\"Tracking Error\", \"0.077\"},\n            {\"Treynor Ratio\", \"-2.186\"},\n            {\"Total Fees\", \"$267.37\"},\n            {\"Estimated Strategy Capacity\", \"$6000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"65.87%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"d527d869fde7539958e06050ee7d9951\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates the various ways you can call the History function,\n    /// what it returns, and what you can do with the returned values.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"warm up\" />\n    public class HistoryAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _count;\n        private SimpleMovingAverage _dailySma;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            var SPY = AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily).Symbol;\n            var IBM = AddData<CustomData>(\"IBM\", Resolution.Daily).Symbol;\n            // specifying the exchange will allow the history methods that accept a number of bars to return to work properly\n            Securities[\"IBM\"].Exchange = new EquityExchange();\n\n            // we can get history in initialize to set up indicators and such\n            _dailySma = new SimpleMovingAverage(14);\n\n            // get the last calendar year's worth of SPY data at the configured resolution (daily)\n            var tradeBarHistory = History<TradeBar>(\"SPY\", TimeSpan.FromDays(365));\n            AssertHistoryCount(\"History<TradeBar>(\\\"SPY\\\", TimeSpan.FromDays(365))\", tradeBarHistory, 250, SPY);\n\n            // get the last calendar day's worth of SPY data at the specified resolution\n            tradeBarHistory = History<TradeBar>(\"SPY\", TimeSpan.FromDays(1), Resolution.Minute);\n            AssertHistoryCount(\"History<TradeBar>(\\\"SPY\\\", TimeSpan.FromDays(1), Resolution.Minute)\", tradeBarHistory, 390, SPY);\n\n            // get the last 14 bars of SPY at the configured resolution (daily)\n            tradeBarHistory = History<TradeBar>(\"SPY\", 14).ToList();\n            AssertHistoryCount(\"History<TradeBar>(\\\"SPY\\\", 14)\", tradeBarHistory, 14, SPY);\n\n            // get the last 14 minute bars of SPY\n            tradeBarHistory = History<TradeBar>(\"SPY\", 14, Resolution.Minute);\n            AssertHistoryCount(\"History<TradeBar>(\\\"SPY\\\", 14, Resolution.Minute)\", tradeBarHistory, 14, SPY);\n\n            // we can loop over the return value from these functions and we get TradeBars\n            // we can use these TradeBars to initialize indicators or perform other math\n            foreach (TradeBar tradeBar in tradeBarHistory)\n            {\n                _dailySma.Update(tradeBar.EndTime, tradeBar.Close);\n            }\n\n            // get the last calendar year's worth of IBM data at the configured resolution (daily)\n            var customDataHistory = History<CustomData>(\"IBM\", TimeSpan.FromDays(365));\n            AssertHistoryCount(\"History<CustomData>(\\\"IBM\\\", TimeSpan.FromDays(365))\", customDataHistory, 250, IBM);\n\n            // get the last 14 bars of IBM at the configured resolution (daily)\n            customDataHistory = History<CustomData>(\"IBM\", 14);\n            AssertHistoryCount(\"History<CustomData>(\\\"IBM\\\", 14)\", customDataHistory, 14, IBM);\n\n            // we can loop over the return values from these functions and we'll get custom data\n            // this can be used in much the same way as the tradeBarHistory above\n            _dailySma.Reset();\n            foreach (CustomData customData in customDataHistory)\n            {\n                _dailySma.Update(customData.EndTime, customData.Value);\n            }\n\n            // get the last year's worth of all configured custom data at the configured resolution (daily)\n            var allCustomData = History<CustomData>(TimeSpan.FromDays(365));\n            AssertHistoryCount(\"History<CustomData>(TimeSpan.FromDays(365))\", allCustomData, 250, IBM, SPY);\n\n            // get the last 14 bars worth of custom data for the specified symbols at the configured resolution (daily)\n            allCustomData = History<CustomData>(Securities.Keys, 14);\n            AssertHistoryCount(\"History<CustomData>(Securities.Keys, 14)\", allCustomData, 14, IBM, SPY);\n\n            // NOTE: Using different resolutions require that they are properly implemented in your data type. If your\n            // custom data source has different resolutions, it would need to be implemented in the GetSource and Reader\n            // methods properly.\n            //customDataHistory = History<CustomData>(\"IBM\", TimeSpan.FromDays(7), Resolution.Minute);\n            //customDataHistory = History<CustomData>(\"IBM\", 14, Resolution.Minute);\n            //allCustomData = History<CustomData>(TimeSpan.FromDays(365), Resolution.Minute);\n            //allCustomData = History<CustomData>(Securities.Keys, 14, Resolution.Minute);\n            //allCustomData = History<CustomData>(Securities.Keys, TimeSpan.FromDays(1), Resolution.Minute);\n            //allCustomData = History<CustomData>(Securities.Keys, 14, Resolution.Minute);\n\n            // get the last calendar year's worth of all custom data\n            allCustomData = History<CustomData>(Securities.Keys, TimeSpan.FromDays(365));\n            AssertHistoryCount(\"History<CustomData>(Securities.Keys, TimeSpan.FromDays(365))\", allCustomData, 250, IBM, SPY);\n\n            // the return is a series of dictionaries containing all custom data at each time\n            // we can loop over it to get the individual dictionaries\n            foreach (DataDictionary<CustomData> customDataDictionary in allCustomData)\n            {\n                // we can access the dictionary to get the custom data we want\n                var customData = customDataDictionary[\"IBM\"];\n            }\n\n            // we can also access the return value from the multiple symbol functions to request a single\n            // symbol and then loop over it\n            var singleSymbolCustomData = allCustomData.Get(\"IBM\");\n            AssertHistoryCount(\"allCustomData.Get(\\\"IBM\\\")\", singleSymbolCustomData, 250, IBM);\n            foreach (CustomData customData in singleSymbolCustomData)\n            {\n                // do something with 'IBM' custom data\n            }\n\n            // we can also access individual properties on our data, this will\n            // get the 'IBM' CustomData objects like above, but then only return the Value properties\n            var customDataIbmValues = allCustomData.Get(\"IBM\", \"Value\");\n            AssertHistoryCount(\"allCustomData.Get(\\\"IBM\\\", \\\"Value\\\")\", customDataIbmValues, 250);\n            foreach (decimal value in customDataIbmValues)\n            {\n                // do something with each value\n            }\n\n            // sometimes it's necessary to get the history for many configured symbols\n\n            // request the last year's worth of history for all configured symbols at their configured resolutions\n            // SPY daily data arrives at 4pm, while this custom data at midnight so we get 250 * 2 points\n            var allHistory = History(TimeSpan.FromDays(365));\n            AssertHistoryCount(\"History(TimeSpan.FromDays(365))\", allHistory, 250 * 2, SPY, IBM);\n\n            // request the last days's worth of history at the minute resolution\n            allHistory = History(TimeSpan.FromDays(1), Resolution.Minute);\n            AssertHistoryCount(\"History(TimeSpan.FromDays(1), Resolution.Minute)\", allHistory, 390, SPY, IBM);\n\n            // request the last 100 bars for the specified securities at the configured resolution\n            allHistory = History(Securities.Keys, 100);\n            // SPY daily data arrives at 4pm, while this custom data at midnight so we get 100 * 2 points\n            AssertHistoryCount(\"History(Securities.Keys, 100)\", allHistory, 100 * 2, SPY, IBM);\n\n            // request the last 100 minute bars for the specified securities\n            allHistory = History(Securities.Keys, 100, Resolution.Minute);\n            AssertHistoryCount(\"History(Securities.Keys, 100, Resolution.Minute)\", allHistory, 100, SPY, IBM);\n\n            // request the last calendar years worth of history for the specified securities\n            allHistory = History(Securities.Keys, TimeSpan.FromDays(365));\n            // SPY daily data arrives at 4pm, while this custom data at midnight so we get 250 * 2 points\n            AssertHistoryCount(\"History(Securities.Keys, TimeSpan.FromDays(365))\", allHistory, 250 * 2, SPY, IBM);\n            // we can also specify the resolution\n            allHistory = History(Securities.Keys, TimeSpan.FromDays(1), Resolution.Minute);\n            AssertHistoryCount(\"History(Securities.Keys, TimeSpan.FromDays(1), Resolution.Minute)\", allHistory, 390, SPY, IBM);\n\n            // if we loop over this allHistory, we get Slice objects\n            foreach (Slice slice in allHistory)\n            {\n                // do something with each slice, these will come in time order\n                // and will NOT have auxilliary data, just price data and your custom data\n                // if those symbols were specified\n            }\n\n            // we can access the history for individual symbols from the all history by specifying the symbol\n            // the type must be a trade bar!\n            tradeBarHistory = allHistory.Get<TradeBar>(\"SPY\");\n            AssertHistoryCount(\"allHistory.Get(\\\"SPY\\\")\", tradeBarHistory, 390, SPY);\n\n            // we can access all the closing prices in chronological order using this get function\n            var closeHistory = allHistory.Get(\"SPY\", Field.Close);\n            AssertHistoryCount(\"allHistory.Get(\\\"SPY\\\", Field.Close)\", closeHistory, 390);\n            foreach (decimal close in closeHistory)\n            {\n                // do something with each closing value in order\n            }\n\n            // we can convert the close history into your normal double array (double[]) using the ToDoubleArray method\n            double[] doubleArray = closeHistory.ToDoubleArray();\n\n            // for the purposes of regression testing, we're explicitly requesting history\n            // using the universe symbols. Requests for universe symbols are filtered out\n            // and never sent to the history provider.\n            var universeSecurityHistory = History(UniverseManager.Keys, TimeSpan.FromDays(10)).ToList();\n            if (universeSecurityHistory.Count != 0)\n            {\n                throw new RegressionTestException(\"History request for universe symbols incorrectly returned data. \"\n                    + \"These requests are intended to be filtered out and never sent to the history provider.\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _count++;\n\n            if (_count > 5 * 2)\n            {\n                throw new RegressionTestException($\"Invalid number of bars arrived. Expected exactly 5, but received {_count}\");\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        private void AssertHistoryCount<T>(string methodCall, IEnumerable<T> history, int expected, params Symbol[] expectedSymbols)\n        {\n            history = history.ToList();\n            var count = history.Count();\n            if (count != expected)\n            {\n                throw new RegressionTestException(methodCall + \" expected \" + expected + \", but received \" + count);\n            }\n\n            IEnumerable<Symbol> unexpectedSymbols = null;\n            if (typeof(T) == typeof(Slice))\n            {\n                var slices = (IEnumerable<Slice>) history;\n                unexpectedSymbols = slices.SelectMany(slice => slice.Keys)\n                    .Distinct()\n                    .Where(sym => !expectedSymbols.Contains(sym))\n                    .ToList();\n            }\n            else if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(DataDictionary<>))\n            {\n                if (typeof(T).GetGenericArguments()[0] == typeof(CustomData))\n                {\n                    var dictionaries = (IEnumerable<DataDictionary<CustomData>>) history;\n                    unexpectedSymbols = dictionaries.SelectMany(dd => dd.Keys)\n                        .Distinct()\n                        .Where(sym => !expectedSymbols.Contains(sym))\n                        .ToList();\n                }\n            }\n            else if (typeof(IBaseData).IsAssignableFrom(typeof(T)))\n            {\n                var slices = (IEnumerable<IBaseData>)history;\n                unexpectedSymbols = slices.Select(data => data.Symbol)\n                    .Distinct()\n                    .Where(sym => !expectedSymbols.Contains(sym))\n                    .ToList();\n            }\n            else if (typeof(T) == typeof(decimal))\n            {\n                // if the enumerable doesn't contain symbols then we can't assert that certain symbols exist\n                // this case is used when testing data dictionary extensions that select a property value,\n                // such as dataDictionaries.Get(\"MySymbol\", \"MyProperty\") => IEnumerable<decimal>\n                return;\n            }\n\n            if (unexpectedSymbols == null)\n            {\n                throw new RegressionTestException(\"Unhandled case: \" + typeof(T).GetBetterTypeName());\n            }\n\n            var unexpectedSymbolsString = string.Join(\" | \", unexpectedSymbols);\n            if (!string.IsNullOrWhiteSpace(unexpectedSymbolsString))\n            {\n                throw new RegressionTestException($\"{methodCall} contains unexpected symbols: {unexpectedSymbolsString}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => -1;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => -1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"1033.443%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102696.36\"},\n            {\"Net Profit\", \"2.696%\"},\n            {\"Sharpe Ratio\", \"44.092\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-2.58\"},\n            {\"Beta\", \"1.075\"},\n            {\"Annual Standard Deviation\", \"0.192\"},\n            {\"Annual Variance\", \"0.037\"},\n            {\"Information Ratio\", \"-95.146\"},\n            {\"Tracking Error\", \"0.019\"},\n            {\"Treynor Ratio\", \"7.862\"},\n            {\"Total Fees\", \"$3.49\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"25.02%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"70f21e930175a2ec9d465b21edc1b6d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryAuxiliaryDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of auxiliary data history requests\n    /// </summary>\n    public class HistoryAuxiliaryDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 1);\n            SetEndDate(2021, 1, 5);\n\n            var aapl = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n\n            // multi symbol request\n            var spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var multiSymbolRequest = History<Dividend>(new[] { aapl, spy }, 360, Resolution.Daily).ToList();\n            if (multiSymbolRequest.Count != 12)\n            {\n                throw new RegressionTestException($\"Unexpected multi symbol dividend count: {multiSymbolRequest.Count}\");\n            }\n\n            // continuous future mapping requests\n            var sp500 = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            var continuousFutureOpenInterestMapping = History<SymbolChangedEvent>(sp500, new DateTime(2007, 1, 1), new DateTime(2012, 1, 1),\n                dataMappingMode: DataMappingMode.OpenInterest).ToList();\n            if (continuousFutureOpenInterestMapping.Count != 9)\n            {\n                throw new RegressionTestException($\"Unexpected continuous future mapping event count: {continuousFutureOpenInterestMapping.Count}\");\n            }\n            var continuousFutureLastTradingDayMapping = History<SymbolChangedEvent>(sp500, new DateTime(2007, 1, 1),new DateTime(2012, 1, 1),\n                dataMappingMode: DataMappingMode.LastTradingDay).ToList();\n            if (continuousFutureLastTradingDayMapping.Count != 9)\n            {\n                throw new RegressionTestException($\"Unexpected continuous future mapping event count: {continuousFutureLastTradingDayMapping.Count}\");\n            }\n            // mapping dates should be different\n            if (Enumerable.SequenceEqual(continuousFutureOpenInterestMapping.Select(x => x.EndTime), continuousFutureLastTradingDayMapping.Select(x => x.EndTime)))\n            {\n                throw new RegressionTestException($\"Unexpected continuous future mapping times\");\n            }\n\n            var dividends = History<Dividend>(aapl, 360).ToList();\n            if (dividends.Count != 6)\n            {\n                throw new RegressionTestException($\"Unexpected dividend count: {dividends.Count}\");\n            }\n            foreach (var dividend in dividends)\n            {\n                if (dividend.Distribution == 0)\n                {\n                    throw new RegressionTestException($\"Unexpected Distribution: {dividend.Distribution}\");\n                }\n            }\n\n            var splits = History<Split>(aapl, 360).ToList();\n            if (splits.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected split count: {splits.Count}\");\n            }\n            foreach (var split in splits)\n            {\n                if (split.SplitFactor == 0)\n                {\n                    throw new RegressionTestException($\"Unexpected SplitFactor: {split.SplitFactor}\");\n                }\n            }\n\n            var cryptoFuture = QuantConnect.Symbol.Create(\"BTCUSD\", SecurityType.CryptoFuture, Market.Binance);\n            var marginInterests = History<MarginInterestRate>(cryptoFuture, 24 * 3, Resolution.Hour).ToList();\n            if (marginInterests.Count != 8)\n            {\n                throw new RegressionTestException($\"Unexpected margin interest count: {marginInterests.Count}\");\n            }\n            foreach (var marginInterest in marginInterests)\n            {\n                if (marginInterest.InterestRate == 0)\n                {\n                    throw new RegressionTestException($\"Unexpected InterestRate: {marginInterest.InterestRate}\");\n                }\n            }\n\n            // last trading date on 2007-05-18\n            var delistedSymbol = QuantConnect.Symbol.Create(\"AAA.1\", SecurityType.Equity, Market.USA);\n            var delistings = History<Delisting>(delistedSymbol, new DateTime(2007, 5, 15), new DateTime(2007, 5, 21)).ToList();\n            if (delistings.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected delistings count: {delistings.Count}\");\n            }\n            if (delistings[0].Type != DelistingType.Warning)\n            {\n                throw new RegressionTestException($\"Unexpected delisting: {delistings[0]}\");\n            }\n            if (delistings[1].Type != DelistingType.Delisted)\n            {\n                throw new RegressionTestException($\"Unexpected delisting: {delistings[1]}\");\n            }\n\n            // get's remapped:\n            // 2008-09-30 spwr -> spwra\n            // 2011-11-17 spwra -> spwr\n            var remappedSymbol = QuantConnect.Symbol.Create(\"SPWR\", SecurityType.Equity, Market.USA);\n            var symbolChangedEvents = History<SymbolChangedEvent>(remappedSymbol, new DateTime(2007, 1, 1), new DateTime(2012, 1, 1)).ToList();\n            if (symbolChangedEvents.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected SymbolChangedEvents count: {symbolChangedEvents.Count}\");\n            }\n            if (symbolChangedEvents[0].OldSymbol != \"SPWR\" || symbolChangedEvents[0].NewSymbol != \"SPWRA\" || symbolChangedEvents[0].EndTime != new DateTime(2008, 9, 30))\n            {\n                throw new RegressionTestException($\"Unexpected SymbolChangedEvents: {symbolChangedEvents[0]}\");\n            }\n            if (symbolChangedEvents[1].NewSymbol != \"SPWR\" || symbolChangedEvents[1].OldSymbol != \"SPWRA\" || symbolChangedEvents[1].EndTime != new DateTime(2011, 11, 17))\n            {\n                throw new RegressionTestException($\"Unexpected SymbolChangedEvents: {symbolChangedEvents[1]}\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"AAPL\", 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 24;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 50;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"235.317%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101558.94\"},\n            {\"Net Profit\", \"1.559%\"},\n            {\"Sharpe Ratio\", \"13.436\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.977%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.873\"},\n            {\"Beta\", \"0.603\"},\n            {\"Annual Standard Deviation\", \"0.124\"},\n            {\"Annual Variance\", \"0.015\"},\n            {\"Information Ratio\", \"18.773\"},\n            {\"Tracking Error\", \"0.107\"},\n            {\"Treynor Ratio\", \"2.756\"},\n            {\"Total Fees\", \"$3.86\"},\n            {\"Estimated Strategy Capacity\", \"$1100000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.55%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7b1f04613621baa2333be0876f106ad3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryProviderManagerRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm to verify the corret working of <see cref=\"HistoryProviderManager\"/>\n    /// </summary>\n    public class HistoryProviderManagerRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _onDataTriggered = new();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2017, 12, 17);\n            SetEndDate(2018, 1, 1);\n            AddCrypto(\"BTCUSD\");\n            SetWarmup(1000000);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _onDataTriggered = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (IsWarmingUp)\n            {\n                throw new RegressionTestException(\"Warm up not complete\");\n            }\n            if (!_onDataTriggered)\n            {\n                throw new RegressionTestException(\"No data received is OnData method\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 829149;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 100;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.607\"},\n            {\"Tracking Error\", \"0.038\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryTickRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that tick history request includes both trade and quote data\n    /// </summary>\n    public class HistoryTickRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 12);\n            SetEndDate(2013, 10, 13);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Tick).Symbol;\n\n            var tradesCount = 0;\n            var quotesCount = 0;\n\n            foreach (var point in History<Tick>(_symbol, StartDate.AddDays(-1), StartDate, Resolution.Tick))\n            {\n                if (point.TickType == TickType.Trade)\n                {\n                    tradesCount++;\n                }\n                else if (point.TickType == TickType.Quote)\n                {\n                    quotesCount++;\n                }\n\n                if (tradesCount > 0 && quotesCount > 0)\n                {\n                    // We already found at least one tick of each type, we can exit the loop\n                    break;\n                }\n            }\n\n            if (quotesCount == 0 || tradesCount == 0)\n            {\n                throw new RegressionTestException(\"Expected to find at least one tick of each type (quote and trade)\");\n            }\n\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 9;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryWithCustomDataSourceRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test illustrating how history from custom data sources can be requested.\n    /// </summary>\n    public class HistoryWithCustomDataSourceRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n        private Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 6);\n\n            _aapl = AddData<CustomData>(\"AAPL\", Resolution.Minute).Symbol;\n            _spy = AddData<CustomData>(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // We remove the symbol from history data in order to compare values only\n            Func<CustomData, Object> getRawCustomData = data => new {\n                Time = data.Time,\n                Value = data.Value,\n                Close = data.Close,\n                Open = data.Open,\n                High = data.High,\n                Low = data.Low,\n                Volume = data.Volume,\n            };\n\n            var aaplHistory = History<CustomData>(\"AAPL\", StartDate, EndDate, Resolution.Minute).Select(getRawCustomData).ToList();\n            var spyHistory = History<CustomData>(\"SPY\", StartDate, EndDate, Resolution.Minute).Select(getRawCustomData).ToList();\n\n            if (aaplHistory.Count == 0 || spyHistory.Count == 0)\n            {\n                throw new RegressionTestException(\"At least one of the history results is empty\");\n            }\n\n            // Check that both results contain the same data, since CustomData fetches APPL data regardless of the symbol\n            if (!aaplHistory.SequenceEqual(spyHistory))\n            {\n                throw new RegressionTestException(\"Histories are not equal\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2960;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2938;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n\n        /// <summary>\n        /// Custom data source for the regression test algorithm, which returns AAPL equity data regardless of the symbol requested.\n        /// </summary>\n        public class CustomData : BaseData\n        {\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n            public decimal Volume { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new TradeBar().GetSource(\n                    new SubscriptionDataConfig(\n                        config,\n                        typeof(CustomData),\n                        // Create a new symbol as equity so we find the existing data files\n                        // Symbol.Create(config.MappedSymbol, SecurityType.Equity, config.Market)),\n                        Symbol.Create(\"AAPL\", SecurityType.Equity, config.Market)),\n                    date,\n                    isLiveMode);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var tradeBar = TradeBar.ParseEquity(config, line, date);\n\n                return new CustomData {\n                    Symbol = config.Symbol,\n                    Time = tradeBar.Time,\n                    Value = tradeBar.Value,\n                    Close = tradeBar.Close,\n                    Open = tradeBar.Open,\n                    High = tradeBar.High,\n                    Low = tradeBar.Low,\n                    Volume = tradeBar.Volume,\n                };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating how to request history data for continuous contracts with different depth offsets.\n    /// </summary>\n    public class HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _continuousContractSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2014, 1, 1);\n            _continuousContractSymbol = AddFuture(Futures.Indices.SP500EMini, Resolution.Daily).Symbol;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var contractDepthOffsets = Enumerable.Range(0, 3).ToList();\n            var historyResults = contractDepthOffsets.Select(contractDepthOffset =>\n            {\n                return History(new [] { _continuousContractSymbol }, StartDate, EndDate, Resolution.Daily, contractDepthOffset: contractDepthOffset).ToList();\n            }).ToList();\n\n            if (historyResults.Any(x => x.Count == 0 || x.Count != historyResults[0].Count))\n            {\n                throw new RegressionTestException(\"History results are empty or bar counts did not match\");\n            }\n\n            // Check that all history results at least one mapping and that different contracts are used for each offset (which can be checked by\n            // comparing the underlying symbols)\n            List<HashSet<Symbol>> underlyingsPerHistory = new();\n            for (int i = 0; i < historyResults.Count; i++)\n            {\n                HashSet<Symbol> underlyings = new();\n\n                foreach (var slice in historyResults[i])\n                {\n                    var underlying = slice.Keys.Single().Underlying;\n\n                    if (underlyings.Add(underlying) && underlyings.Count > 1)\n                    {\n                        var currentExpiration = underlying.ID.Date;\n                        var frontMonthExpiration = FuturesExpiryFunctions.FuturesExpiryFunction(_continuousContractSymbol)(slice.Time.AddMonths(1));\n\n                        if (contractDepthOffsets[i] == 0)   // Front month\n                        {\n                            if (currentExpiration != frontMonthExpiration.Date)\n                            {\n                                throw new RegressionTestException($\"Unexpected current mapped contract expiration {currentExpiration}\" +\n                                    $\" @ {Time} it should be AT front month expiration {frontMonthExpiration}\");\n                            }\n                        }\n                        else    // Back month\n                        {\n                            if (currentExpiration <= frontMonthExpiration.Date)\n                            {\n                                throw new RegressionTestException($\"Unexpected current mapped contract expiration {currentExpiration}\" +\n                                    $\" @ {Time} it should be AFTER front month expiration {frontMonthExpiration}\");\n                            }\n                        }\n                    }\n                }\n\n                if (underlyings.Count == 0)\n                {\n                    throw new RegressionTestException($\"History results for contractDepthOffset={contractDepthOffsets[i]} did not contain any mappings\");\n                }\n\n                underlyingsPerHistory.Add(underlyings);\n            }\n\n            // Check that underlyings are different for each history result (because we're using different contract depth offsets)\n            for (int i = 0; i < underlyingsPerHistory.Count; i++)\n            {\n                for (int j = i + 1; j < underlyingsPerHistory.Count; j++)\n                {\n                    if (underlyingsPerHistory[i].SetEquals(underlyingsPerHistory[j]))\n                    {\n                        throw new RegressionTestException($\"History results for contractDepthOffset={contractDepthOffsets[i]} and {contractDepthOffsets[j]} contain the same underlying\");\n                    }\n                }\n            }\n\n            // Check that prices at each time are different for different contract depth offsets\n            for (int j = 0; j < historyResults[0].Count; j++)\n            {\n                var closePrices = historyResults.Select(hr => hr[j].Bars.Values.SingleOrDefault(new TradeBar()).Close).ToHashSet();\n                if (closePrices.Count != contractDepthOffsets.Count)\n                {\n                    throw new RegressionTestException($\"History results close prices should have been different for each contract depth offset at each time\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 968;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 366;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.738\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryWithDifferentDataMappingModeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating how to request history data for different data mapping modes.\n    /// </summary>\n    public class HistoryWithDifferentDataMappingModeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _continuousContractSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2014, 1, 1);\n            _continuousContractSymbol = AddFuture(Futures.Indices.SP500EMini, Resolution.Daily).Symbol;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var dataMappingModes = ((DataMappingMode[])Enum.GetValues(typeof(DataMappingMode))).ToList();\n            var historyResults = dataMappingModes.Select(dataMappingMode =>\n            {\n                return History(new [] { _continuousContractSymbol }, StartDate, EndDate, Resolution.Daily, dataMappingMode: dataMappingMode).ToList();\n            }).ToList();\n\n            if (historyResults.Any(x => x.Count != historyResults[0].Count))\n            {\n                throw new RegressionTestException(\"History results bar count did not match\");\n            }\n\n            // Check that all history results have a mapping date at some point in the history\n            HashSet<DateTime> mappingDates = new HashSet<DateTime>();\n            for (int i = 0; i < historyResults.Count; i++)\n            {\n                var underlying = historyResults[i].First().Bars.Keys.First().Underlying;\n                int mappingsCount = 0;\n\n                foreach (var slice in historyResults[i])\n                {\n                    var dataUnderlying = slice.Bars.Keys.First().Underlying;\n                    if (dataUnderlying != underlying)\n                    {\n                        underlying = dataUnderlying;\n                        mappingsCount++;\n                        mappingDates.Add(slice.Time.Date);\n                    }\n                }\n\n                if (mappingsCount == 0)\n                {\n                    throw new RegressionTestException($\"History results for {dataMappingModes[i]} data mapping mode did not contain any mappings\");\n                }\n            }\n\n            if (mappingDates.Count < dataMappingModes.Count)\n            {\n                throw new RegressionTestException($\"History results should have had different mapping dates for each data mapping mode\");\n            }\n\n            // Check that close prices at each time are different for different data mapping modes\n            for (int j = 0; j < historyResults[0].Count; j++)\n            {\n                var closePrices = historyResults.Select(hr => hr[j].Bars.First().Value.Close).ToHashSet();\n                if (closePrices.Count != dataMappingModes.Count)\n                {\n                    throw new RegressionTestException($\"History results close prices should have been different for each data mapping mode at each time\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 968;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 488;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.738\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryWithDifferentDataNormalizationModeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating how to request history data for different data normalization modes.\n    /// </summary>\n    public class HistoryWithDifferentDataNormalizationModeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aaplEquitySymbol;\n        private Symbol _esFutureSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2014, 1, 1);\n\n            _aaplEquitySymbol = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n            _esFutureSymbol = AddFuture(Futures.Indices.SP500EMini, Resolution.Daily).Symbol;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var equityDataNormalizationModes = new DataNormalizationMode[]{\n                DataNormalizationMode.Raw,\n                DataNormalizationMode.Adjusted,\n                DataNormalizationMode.SplitAdjusted\n            };\n            CheckHistoryResultsForDataNormalizationModes(_aaplEquitySymbol, StartDate, EndDate, Resolution.Daily, equityDataNormalizationModes);\n\n            var futureDataNormalizationModes = new DataNormalizationMode[]{\n                DataNormalizationMode.Raw,\n                DataNormalizationMode.BackwardsRatio,\n                DataNormalizationMode.BackwardsPanamaCanal,\n                DataNormalizationMode.ForwardPanamaCanal\n            };\n            CheckHistoryResultsForDataNormalizationModes(_esFutureSymbol, StartDate, EndDate, Resolution.Daily, futureDataNormalizationModes);\n        }\n\n        private void CheckHistoryResultsForDataNormalizationModes(Symbol symbol, DateTime start, DateTime end, Resolution resolution,\n            DataNormalizationMode[] dataNormalizationModes)\n        {\n            var historyResults = dataNormalizationModes\n                .Select(x => History(new [] { symbol }, start, end, resolution, dataNormalizationMode: x).ToList())\n                .ToList();\n\n            if (historyResults.Any(x => x.Count == 0 || x.Count != historyResults.First().Count))\n            {\n                throw new RegressionTestException($\"History results for {symbol} have different number of bars\");\n            }\n\n            // Check that, for each history result, close prices at each time are different for these securities (AAPL and ES)\n            for (int j = 0; j < historyResults[0].Count; j++)\n            {\n                var closePrices = historyResults.Select(hr => hr[j].Bars.First().Value.Close).ToHashSet();\n                if (closePrices.Count != dataNormalizationModes.Length)\n                {\n                    throw new RegressionTestException($\"History results for {symbol} have different close prices at the same time\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1026;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 668;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-4.244\"},\n            {\"Tracking Error\", \"0.086\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HistoryWithSymbolChangesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a test case for a history request including symbol changes during the requested period.\n    /// </summary>\n    public class HistoryWithSymbolChangesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            var symbol = AddEquity(\"WM\", Resolution.Daily).Symbol;\n\n            var history = History(new [] {symbol}, TimeSpan.FromDays(5700), Resolution.Daily).ToList();\n            Debug($\"{Time} - history.Count: {history.Count}\");\n\n            const int expectedSliceCount = 3926;\n            if (history.Count != expectedSliceCount)\n            {\n                throw new RegressionTestException($\"History slices - expected: {expectedSliceCount}, actual: {history.Count}\");\n            }\n\n            var totalBars = history.Count(slice => slice.Bars.Count > 0 && slice.Bars.ContainsKey(symbol));\n            if (totalBars != expectedSliceCount)\n            {\n                throw new RegressionTestException($\"History bars - expected: {expectedSliceCount}, actual: {totalBars}\");\n            }\n\n            var firstBar = history.First().Bars.GetValue(symbol);\n            if (firstBar.EndTime != new DateTime(1998, 3, 2, 16, 0, 0) || firstBar.Close != 24.88039125m)\n            {\n                throw new RegressionTestException(\"First History bar - unexpected data received\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 3926;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HourResolutionMappingEventRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #5232, where we expect SPWR to be mapped to SPWRA\n    /// </summary>\n    public class HourResolutionMappingEventRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _dateTime;\n        private SymbolChangedEvent _changedEvent;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2008, 08, 20);\n            SetEndDate(2008, 10, 1);\n\n            AddEquity(\"SPWR\", Resolution.Hour, fillForward:false);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _dateTime = Time.Date;\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPWR\", 1);\n            }\n\n            foreach (var symbolChangedEvent in slice.SymbolChangedEvents.Values)\n            {\n                _changedEvent = symbolChangedEvent;\n                Log($\"{Time}: {symbolChangedEvent.OldSymbol} -> {symbolChangedEvent.NewSymbol}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_dateTime != EndDate.Date)\n            {\n                throw new RegressionTestException($\"Last day was {_dateTime}, should be algorithm end date: {EndDate.Date}\");\n            }\n            if (_changedEvent == null)\n            {\n                throw new RegressionTestException(\"We got not symbol change event! 'SPWR' should of been mapped\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 429;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-78.316%\"},\n            {\"Drawdown\", \"31.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"83636.96\"},\n            {\"Net Profit\", \"-16.363%\"},\n            {\"Sharpe Ratio\", \"-0.498\"},\n            {\"Sortino Ratio\", \"-0.507\"},\n            {\"Probabilistic Sharpe Ratio\", \"25.138%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.357\"},\n            {\"Beta\", \"2.004\"},\n            {\"Annual Standard Deviation\", \"0.924\"},\n            {\"Annual Variance\", \"0.854\"},\n            {\"Information Ratio\", \"-0.073\"},\n            {\"Tracking Error\", \"0.718\"},\n            {\"Treynor Ratio\", \"-0.23\"},\n            {\"Total Fees\", \"$5.40\"},\n            {\"Estimated Strategy Capacity\", \"$2400000.00\"},\n            {\"Lowest Capacity Asset\", \"SPWR TDQZFPKOZ5UT\"},\n            {\"Portfolio Turnover\", \"2.34%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"cc6e8f0ec77d9ed25118562e954bb781\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test for consistency of hour data over a reverse split event in US equities.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class HourReverseSplitRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 11, 7);\n            SetEndDate(2013, 11, 8);\n            SetCash(100000);\n            SetBenchmark(x => 0);\n\n            _symbol = AddEquity(\"VXX.1\", Resolution.Hour).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            TradeBar bar;\n            if (!slice.Bars.TryGetValue(_symbol, out bar)) return;\n\n            if (!Portfolio.Invested && Time.Date == EndDate.Date)\n            {\n                Buy(_symbol, 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99976.76\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$1000000000.00\"},\n            {\"Lowest Capacity Asset\", \"VXX U9R0H3K6HVMT\"},\n            {\"Portfolio Turnover\", \"0.40%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b159c44453935e5c9be375454153c9ee\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/HourSplitRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test for consistency of hour data over a reverse split event in US equities.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class HourSplitRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private bool _receivedWarningEvent;\n        private bool _receivedOccurredEvent;\n        private int _dataCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 9);\n            SetCash(100000);\n            SetBenchmark(x => 0);\n\n            _symbol = AddEquity(\"AAPL\", Resolution.Hour).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            _dataCount += slice.Bars.Count;\n\n            TradeBar bar;\n            if (!slice.Bars.TryGetValue(_symbol, out bar)) return;\n\n            if (!Portfolio.Invested && Time.Date == EndDate.Date)\n            {\n                Buy(_symbol, 1);\n            }\n        }\n\n        public override void OnSplits(Splits splits)\n        {\n            if (splits.Single().Value.Type == SplitType.Warning)\n            {\n                _receivedWarningEvent = true;\n                Debug($\"{splits.Single().Value}\");\n            }\n            else if (splits.Single().Value.Type == SplitType.SplitOccurred)\n            {\n                _receivedOccurredEvent = true;\n                if (splits.Single().Value.Price != 645.5700m || splits.Single().Value.ReferencePrice != 645.5700m)\n                {\n                    throw new RegressionTestException(\"Did not receive expected price values\");\n                }\n                Debug($\"{splits.Single().Value}\");\n            }\n        }\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedOccurredEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected split event\");\n            }\n            if (!_receivedWarningEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected split warning event\");\n            }\n            if (_dataCount != 14)\n            {\n                throw new RegressionTestException($\"Unexpected data count {_dataCount}. Expected 14\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.068%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99999.31\"},\n            {\"Net Profit\", \"-0.001%\"},\n            {\"Sharpe Ratio\", \"-128.305\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.163\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$160000000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"fded8f29d111ed771b99bc6b296f776c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ImmediateExecutionModelMinimumOrderMarginRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that will test that <see cref=\"IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage\"/>\n    /// is respected by the <see cref=\"ImmediateExecutionModel\"/>\n    /// </summary>\n    public class ImmediateExecutionModelMinimumOrderMarginRegressionAlgorithm : BasicTemplateFrameworkAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            // this setting is the difference between doing 3 trades and > 60\n            Settings.MinimumOrderMarginPortfolioPercentage = 0.001m;\n            SetPortfolioConstruction(new CustomPortfolioConstructionModel(TimeKeeper));\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        private class CustomPortfolioConstructionModel : EqualWeightingPortfolioConstructionModel\n        {\n            private ITimeKeeper _timeKeeper;\n            public CustomPortfolioConstructionModel(ITimeKeeper timeKeeper)\n            {\n                _timeKeeper = timeKeeper;\n            }\n            protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n            {\n                var baseResult = base.DetermineTargetPercent(activeInsights);\n\n                // we generate some fake noise in the percentage allocation\n                var adjustPercentage = _timeKeeper.UtcTime.Minute % 2 == 0;\n                return baseResult.ToDictionary(pair => pair.Key, pair => adjustPercentage ? pair.Value - 0.001 : pair.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ImmediateExecutionModelWorksWithBinanceFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test ImmediateExecutionModel places orders with the\n    /// correct quantity (taking into account the fee's) so that the fill quantity\n    /// is the expected one.\n    /// </summary>\n    public class ImmediateExecutionModelWorksWithBinanceFeeModel: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2022, 12, 13);\n            SetEndDate(2022, 12, 14);\n            SetAccountCurrency(\"BUSD\");\n            SetCash(\"BUSD\", 100000, 1);\n\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            var symbols = new List<Symbol>() { QuantConnect.Symbol.Create(\"BTCBUSD\", SecurityType.Crypto, Market.Binance) };\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Resolution.Minute));\n            SetExecution(new ImmediateExecutionModel());\n            SetBrokerageModel(Brokerages.BrokerageName.Binance, AccountType.Margin);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                if (Math.Abs(orderEvent.Quantity - 5.8m) > 0.01m)\n                {\n                    throw new RegressionTestException($\"The expected quantity was {5.8m} but the quantity from the order was {orderEvent.Quantity}\");\n                }\n            }\n        }\n\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2882;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"103411.39\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"BUSD99.75\"},\n            {\"Estimated Strategy Capacity\", \"BUSD600000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCBUSD 18N\"},\n            {\"Portfolio Turnover\", \"48.18%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2ad07f12d7c80fd4a904269d62794e9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InceptionDateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test universe additions and removals with open positions\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class InceptionDateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 1);\n            SetEndDate(2013, 10, 31);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            // select IBM once a week, empty universe the other days\n            AddUniverseSelection(new CustomUniverseSelectionModel(\"my-custom-universe\", dt => dt.Day % 7 == 0 ? new List<string> { \"IBM\" } : Enumerable.Empty<string>()));\n            // Adds SPY 5 days after StartDate and keep it in Universe\n            AddUniverseSelection(new InceptionDateUniverseSelectionModel(\"spy-inception\", new Dictionary<string, DateTime> {{\"SPY\", StartDate.AddDays(5)}}));\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">TradeBars dictionary object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_changes == SecurityChanges.None) return;\n\n            // we'll simply go long each security we added to the universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, .5);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Object containing AddedSecurities and RemovedSecurities</param>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // liquidate securities removed from our universe\n            foreach (var security in changes.RemovedSecurities)\n            {\n                Liquidate(security.Symbol, \"Removed from Universe\");\n            }\n\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 405;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.11%\"},\n            {\"Average Loss\", \"-0.24%\"},\n            {\"Compounding Annual Return\", \"28.358%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"-0.267\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102119.68\"},\n            {\"Net Profit\", \"2.120%\"},\n            {\"Sharpe Ratio\", \"3.201\"},\n            {\"Sortino Ratio\", \"5.22\"},\n            {\"Probabilistic Sharpe Ratio\", \"76.344%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.47\"},\n            {\"Alpha\", \"0.015\"},\n            {\"Beta\", \"0.478\"},\n            {\"Annual Standard Deviation\", \"0.058\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-2.771\"},\n            {\"Tracking Error\", \"0.063\"},\n            {\"Treynor Ratio\", \"0.392\"},\n            {\"Total Fees\", \"$16.73\"},\n            {\"Estimated Strategy Capacity\", \"$7000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.45%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"27cdeff9728c1a42239ea1b5b2c335dc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionBearCallSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _vixw, _spy;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2021, 1, 1);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"VIX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"VIXW\", Resolution.Minute);\n            option.SetFilter((x) => x.Strikes(-5, 5).Expiration(15, 45));\n            _vixw = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio[_spy].Invested)\n            {\n                MarketOrder(_spy, 100);\n            }\n        \n            // Return if hedge position presents\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_vixw, out var chain)) return;\n\n            // Get the nearest expiry date of the contracts\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the call Option contracts with the nearest expiry and sort by strike price\n            var calls = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Call)\n                            .OrderBy(x => x.Strike).ToArray();\n            if (calls.Length < 2) return;\n\n            // Buy the bear call spread\n            var bearCallSpread = OptionStrategies.BearCallSpread(_vixw, calls[0].Strike, calls[^1].Strike, expiry);\n            _tickets = Buy(bearCallSpread, 1);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionBearPutSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2022, 1, 1);\n            SetEndDate(2022, 7, 1);\n            SetCash(100000);\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.WeeklysOnly().Strikes(5, 10).Expiration(0, 0));\n\n            _spxw = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Return if open position exists\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get the nearest expiry date of the contracts\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the put Option contracts with the nearest expiry and sort by strike price\n            var puts = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Put)\n                .OrderBy(x => x.Strike).ToArray();\n            if (puts.Length < 2) return;\n\n            // Buy the bear put spread\n            var optionStrategy = OptionStrategies.BearPutSpread(_spxw, puts[^1].Strike, puts[0].Strike, expiry);\n            _tickets = Buy(optionStrategy, 1);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionBullCallSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw, _spy;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2021, 1, 1);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.WeeklysOnly().Strikes(-5, 5).Expiration(40, 60));\n            _spxw = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio[_spy].Invested)\n            {\n                MarketOrder(_spy, 100);\n            }\n        \n            // Return if hedge position presents\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get the nearest expiry date of the contracts\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the call Option contracts with the nearest expiry and sort by strike price\n            var calls = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Call)\n                            .OrderBy(x => x.Strike).ToArray();\n            if (calls.Length < 2) return;\n\n            // Buy the bull call spread\n            var bullCallSpread = OptionStrategies.BullCallSpread(_spxw, calls[0].Strike, calls[^1].Strike, expiry);\n            _tickets = Buy(bullCallSpread, 1);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionBullPutSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2019, 1, 1);\n            SetEndDate(2020, 1, 1);\n            SetCash(100000);\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.WeeklysOnly().Strikes(-10, -5).Expiration(0, 0));\n\n            _spxw = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Return if open position exists\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get the nearest expiry date of the contracts\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the put Option contracts with the nearest expiry and sort by strike price\n            var puts = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Put)\n                .OrderBy(x => x.Strike).ToArray();\n            if (puts.Length < 2) return;\n\n            // Buy the bull put spread\n            var bullCallSpread = OptionStrategies.BullPutSpread(_spxw, puts[^1].Strike, puts[0].Strike, expiry);\n            _tickets = Buy(bullCallSpread, 1);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionBuySellCallIntradayRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option calls across different strike prices.\n    /// We expect 4* orders from the algorithm, which are:\n    ///\n    ///   * (1) Initial entry, buy SPX Call Option (SPXF21 expiring ITM)\n    ///   * (2) Initial entry, sell SPX Call Option at different strike (SPXF21 expiring ITM)\n    ///   * [2] Option assignment, settle into cash\n    ///   * [1] Option exercise, settle into cash\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    ///\n    /// * Assignments are counted as orders\n    /// </summary>\n    public class IndexOptionBuySellCallIntradayRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            var spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            var spxOptions = OptionChain(spx)\n                .Where(x => (x.ID.StrikePrice == 3700m || x.ID.StrikePrice == 3800m) && x.ID.OptionRight == OptionRight.Call && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .Select(x => AddIndexOptionContract(x, Resolution.Minute).Symbol)\n                .OrderBy(x => x.ID.StrikePrice)\n                .ToList();\n\n            var expectedContract3700 = QuantConnect.Symbol.CreateOption(\n                spx,\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3700m,\n                new DateTime(2021, 1, 15));\n\n            var expectedContract3800 = QuantConnect.Symbol.CreateOption(\n                spx,\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3800m,\n                new DateTime(2021, 1, 15));\n\n            if (spxOptions.Count != 2)\n            {\n                throw new RegressionTestException($\"Expected 2 index options symbols from chain provider, found {spxOptions.Count}\");\n            }\n\n            if (spxOptions[0] != expectedContract3700)\n            {\n                throw new RegressionTestException($\"Contract {expectedContract3700} was not found in the chain, found instead: {spxOptions[0]}\");\n            }\n            if (spxOptions[1] != expectedContract3800)\n            {\n                throw new RegressionTestException($\"Contract {expectedContract3800} was not found in the chain, found instead: {spxOptions[1]}\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(spx, 1), () =>\n            {\n                MarketOrder(spxOptions[0], 1);\n                MarketOrder(spxOptions[1], -1);\n            });\n            Schedule.On(DateRules.Tomorrow, TimeRules.Noon, () =>\n            {\n                Liquidate();\n            });\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 32144;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.08%\"},\n            {\"Compounding Annual Return\", \"-2.251%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99840\"},\n            {\"Net Profit\", \"-0.160%\"},\n            {\"Sharpe Ratio\", \"-3.642\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.427%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.018\"},\n            {\"Beta\", \"-0.006\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.44\"},\n            {\"Tracking Error\", \"0.139\"},\n            {\"Treynor Ratio\", \"3.118\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3HB9YI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.51%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9237e1fd3cf099a47a2adae18f91aa2f\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionCallButterflyAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw, _vxz;\n        private decimal _multiplier;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2021, 1, 1);\n            SetCash(1000000);\n\n            _vxz = AddEquity(\"VXZ\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.IncludeWeeklys().Strikes(-3, 3).Expiration(15, 45));\n\n            _spxw = option.Symbol;\n            _multiplier = option.SymbolProperties.ContractMultiplier;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // The order of magnitude per SPXW order's value is 10000 times of VXZ\n            if (!Portfolio[_vxz].Invested)\n            {\n                MarketOrder(_vxz, 10000);\n            }\n            \n            // Return if any opening index option position\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get nearest expiry date\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the call Option contracts with nearest expiry and sort by strike price\n            var calls = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Call).ToList();\n            if (calls.Count < 3) return;\n            var sortedCallStrikes = calls.Select(x => x.Strike).OrderBy(x => x).ToArray();\n            \n            // Select ATM call\n            var atmStrike = calls.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n\n            // Get the strike prices for the ITM & OTM contracts, make sure they're in equidistance\n            var spread = Math.Min(atmStrike - sortedCallStrikes[0], sortedCallStrikes[^1] - atmStrike);\n            var itmStrike = atmStrike - spread;\n            var otmStrike = atmStrike + spread;\n            if (!sortedCallStrikes.Contains(otmStrike) || !sortedCallStrikes.Contains(itmStrike)) return;\n\n            // Buy the call butterfly\n            var callButterfly = OptionStrategies.CallButterfly(_spxw, otmStrike, atmStrike, itmStrike, expiry);\n            var price = callButterfly.UnderlyingLegs.Sum(x => Math.Abs(Securities[x.Symbol].Price * x.Quantity) * _multiplier);\n            if (price > 0)\n            {\n                var quantity = Portfolio.TotalPortfolioValue / price;\n                _tickets = Buy(callButterfly, (int)Math.Floor(quantity), asynchronous: true);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionCallCalendarSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _vixw, _vxz, _spy;\n        private decimal _multiplier;\n        private List<Leg> _legs = new();\n        private DateTime _firstExpiry = DateTime.MaxValue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2021, 1, 1);\n            SetCash(50000);\n\n            _vxz = AddEquity(\"VXZ\", Resolution.Minute).Symbol;\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"VIX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"VIXW\", Resolution.Minute);\n            option.SetFilter((x) => x.Strikes(-2, 2).Expiration(15, 45));\n\n            _vixw = option.Symbol;\n            _multiplier = option.SymbolProperties.ContractMultiplier;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Liquidate if the shorter term option is about to expire\n            if (_firstExpiry < Time.AddDays(2) && _legs.All(x => slice.ContainsKey(x.Symbol)))\n            {\n                Liquidate();\n            }\n            // Return if there is any opening position\n            else if (_legs.Any(x => Portfolio[x.Symbol].Invested))\n            {\n                return;\n            }\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_vixw, out var chain)) return;\n\n            // Get ATM strike price\n            var strike = chain.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n            \n            // Select the ATM call Option contracts and sort by expiration date\n            var calls = chain.Where(x => x.Strike == strike && x.Right == OptionRight.Call)\n                            .OrderBy(x => x.Expiry).ToArray();\n            if (calls.Length < 2) return;\n            _firstExpiry = calls[0].Expiry;\n\n            // Create combo order legs\n            _legs = new List<Leg>\n            {\n                Leg.Create(calls[0].Symbol, -1),\n                Leg.Create(calls[^1].Symbol, 1),\n                Leg.Create(_vxz, -100),\n                Leg.Create(_spy, -10)\n            };\n            var quantity = Portfolio.TotalPortfolioValue / _legs.Sum(x =>\n            {\n                var value = Math.Abs(Securities[x.Symbol].Price * x.Quantity);\n                return x.Symbol.ID.SecurityType == SecurityType.IndexOption\n                    ? value * _multiplier\n                    : value;\n            });\n            ComboMarketOrder(_legs, -(int)Math.Floor(quantity), asynchronous: true);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallITMExpiryDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for calls using daily resolution.\n    /// </summary>\n    public class IndexOptionCallITMExpiryDailyRegressionAlgorithm : IndexOptionCallITMExpiryRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        public override void Initialize()\n        {\n            Settings.DailyPreciseEndTime = true;\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 196;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"10.27%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"301.565%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"110274\"},\n            {\"Net Profit\", \"10.274%\"},\n            {\"Sharpe Ratio\", \"5.291\"},\n            {\"Sortino Ratio\", \"384.846\"},\n            {\"Probabilistic Sharpe Ratio\", \"88.621%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.833\"},\n            {\"Beta\", \"-0.228\"},\n            {\"Annual Standard Deviation\", \"0.345\"},\n            {\"Annual Variance\", \"0.119\"},\n            {\"Information Ratio\", \"4.653\"},\n            {\"Tracking Error\", \"0.383\"},\n            {\"Treynor Ratio\", \"-7.99\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"1.90%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"b02af3819f796241269614e0ebf49964\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy SPX Call Option (expiring ITM)\n    ///   * Option exercise, settles into cash\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionCallITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private int _optionOrders;\n        private Symbol _expectedOptionContract;\n\n        protected virtual Resolution Resolution => Resolution.Minute;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n\n            _spx = AddIndex(\"SPX\", Resolution).Symbol;\n\n            // Select an index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution).Symbol;\n\n            _expectedOptionContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Call, 3200m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedOptionContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedOptionContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                throw new RegressionTestException(\"Index options give cash, not the underlying\");\n            }\n            else if (security.Symbol == _expectedOptionContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{Time:yyyy-MM-dd HH:mm:ss} -- {orderEvent.Symbol} :: Price: {Securities[orderEvent.Symbol].Holdings.Price} Qty: {Securities[orderEvent.Symbol].Holdings.Quantity} Direction: {orderEvent.Direction} Msg: {orderEvent.Message}\");\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\") && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after exercising option contract {option.Symbol}\");\n            }\n\n            _optionOrders++;\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n\n            if (_optionOrders != 2)\n            {\n                throw new RegressionTestException(\"Option orders were not as expected!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 19909;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"9.07%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"243.722%\"},\n            {\"Drawdown\", \"2.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"109074\"},\n            {\"Net Profit\", \"9.074%\"},\n            {\"Sharpe Ratio\", \"4.877\"},\n            {\"Sortino Ratio\", \"139.754\"},\n            {\"Probabilistic Sharpe Ratio\", \"87.949%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.511\"},\n            {\"Beta\", \"-0.204\"},\n            {\"Annual Standard Deviation\", \"0.308\"},\n            {\"Annual Variance\", \"0.095\"},\n            {\"Information Ratio\", \"4.185\"},\n            {\"Tracking Error\", \"0.349\"},\n            {\"Treynor Ratio\", \"-7.347\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"1.95%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"59551fdea61b6d4436ffd4a60aed1f40\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for calls.\n    /// We test to make sure that index options have greeks enabled, same as equity options.\n    /// </summary>\n    public class IndexOptionCallITMGreeksExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _invested;\n        private int _onDataCalls;\n        private Symbol _spx;\n        private Option _spxOption;\n        private Symbol _expectedOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            var spx = AddIndex(\"SPX\", Resolution.Minute);\n            spx.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(60, Resolution.Minute, TimeSpan.FromMinutes(1));\n            _spx = spx.Symbol;\n\n            // Select an index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute);\n\n            _spxOption.PriceModel = OptionPriceModels.BlackScholes();\n\n            _expectedOptionContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Call, 3200m, new DateTime(2021, 1, 15));\n            if (_spxOption.Symbol != _expectedOptionContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedOptionContract} was not found in the chain\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Let the algo warmup, but without using SetWarmup. Otherwise, we get\n            // no contracts in the option chain\n            if (_invested || _onDataCalls++ < 40)\n            {\n                return;\n            }\n\n            if (slice.OptionChains.Count == 0)\n            {\n                return;\n            }\n            if (slice.OptionChains.Values.All(o => o.Contracts.Values.Any(c => !slice.ContainsKey(c.Symbol))))\n            {\n                return;\n            }\n            if (slice.OptionChains.Values.First().Contracts.Count == 0)\n            {\n                throw new RegressionTestException($\"No contracts found in the option {slice.OptionChains.Keys.First()}\");\n            }\n\n            var deltas = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Delta).ToList();\n            var gammas = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Gamma).ToList();\n            var rho = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Rho).ToList();\n            var theta = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Theta).ToList();\n            var impliedVol = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.ImpliedVolatility).ToList();\n            var vega = slice.OptionChains.Values.OrderByDescending(y => y.Contracts.Values.Sum(x => x.Volume)).First().Contracts.Values.Select(x => x.Greeks.Vega).ToList();\n\n            // The commented out test cases all return zero.\n            // This is because of failure to evaluate the greeks in the option pricing model, most likely\n            // due to us not clearing the default 30 day requirement for the volatility model to start being updated.\n            if (deltas.Any(d => d == 0))\n            {\n                throw new AggregateException(\"Option contract Delta was equal to zero\");\n            }\n            // Delta is 1, therefore we expect a gamma of 0\n            if (gammas.Any(g => deltas.Any() && deltas[0] == 1 ? g != 0 : g == 0))\n            {\n                throw new AggregateException(\"Option contract Gamma was equal to zero\");\n            }\n            if (rho.Any(r => r == 0))\n            {\n                throw new AggregateException(\"Option contract Rho was equal to zero\");\n            }\n            if (theta.Any(t => t == 0))\n            {\n                throw new AggregateException(\"Option contract Theta was equal to zero\");\n            }\n            // Vega will equal 0 if the quote price and IV are way too off, causing the price is not sensitive to volatility change\n            if (vega.Zip(impliedVol, (v, iv) => (v, iv)).Any(x => x.v == 0 && x.iv < 10))\n            {\n                throw new AggregateException(\"Option contract Vega was equal to zero\");\n            }\n\n            if (!_invested)\n            {\n                SetHoldings(slice.OptionChains.Values.First().Contracts.Values.First().Symbol, 1);\n                _invested = true;\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n            if (!_invested)\n            {\n                throw new RegressionTestException($\"Never checked greeks, maybe we have no option data?\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19909;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"4.97%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"99.378%\"},\n            {\"Drawdown\", \"7.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104974\"},\n            {\"Net Profit\", \"4.974%\"},\n            {\"Sharpe Ratio\", \"5.19\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"89.439%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.674\"},\n            {\"Beta\", \"-0.205\"},\n            {\"Annual Standard Deviation\", \"0.321\"},\n            {\"Annual Variance\", \"0.103\"},\n            {\"Information Ratio\", \"4.505\"},\n            {\"Tracking Error\", \"0.36\"},\n            {\"Treynor Ratio\", \"-8.141\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$59000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"2.19%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"5b8ec5478b149dc9adfb09ea6407af82\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallOTMExpiryDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) index option expiry for calls using daily resolution.\n    /// </summary>\n    public class IndexOptionCallOTMExpiryDailyRegressionAlgorithm : IndexOptionCallOTMExpiryRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        public override void Initialize()\n        {\n            Settings.DailyPreciseEndTime = true;\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 186;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-0.142%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99990\"},\n            {\"Net Profit\", \"-0.010%\"},\n            {\"Sharpe Ratio\", \"-15.959\"},\n            {\"Sortino Ratio\", \"-124989.863\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.015%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.004\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.334\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"-32.969\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P59H9OI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0a8db8bba3b2198ba4675fc909426c35\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) index option expiry for calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy SPX Call Option (expiring OTM)\n    ///     - contract expires worthless, not exercised, so never opened a position in the underlying\n    ///\n    ///   * Liquidation of worthless SPX call option (expiring OTM)\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    /// <remarks>\n    /// Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n    /// See related issue: https://github.com/QuantConnect/Lean/issues/4854\n    /// </remarks>\n    public class IndexOptionCallOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private int _optionOrders;\n        private Symbol _expectedContract;\n\n        protected virtual Resolution Resolution => Resolution.Minute;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            _spx = AddIndex(\"SPX\", Resolution).Symbol;\n\n            // Select a index option call expiring OTM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice >= 4250m && x.ID.OptionRight == OptionRight.Call && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Call, 4250m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                throw new RegressionTestException(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && !orderEvent.Message.Contains(\"OTM\"))\n            {\n                throw new RegressionTestException(\"Contract did not expire OTM\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\"))\n            {\n                throw new RegressionTestException(\"Exercised option, even though it expires OTM\");\n            }\n            _optionOrders++;\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n\n            if (_optionOrders != 2)\n            {\n                throw new RegressionTestException(\"Option orders were not as expected!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 15942;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-0.142%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99990\"},\n            {\"Net Profit\", \"-0.010%\"},\n            {\"Sharpe Ratio\", \"-15.959\"},\n            {\"Sortino Ratio\", \"-124989.863\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.015%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.004\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.334\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"-32.969\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$22000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P59H9OI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0a8db8bba3b2198ba4675fc909426c35\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionChainApisConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the option chain APIs return consistent values for index options\n    /// See <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> and <see cref=\"QCAlgorithm.OptionChainProvider\"/>\n    /// </summary>\n    public class IndexOptionChainApisConsistencyRegressionAlgorithm : OptionChainApisConsistencyRegressionAlgorithm\n    {\n        protected override DateTime TestDate => new DateTime(2021, 1, 4);\n\n        protected override Option GetOption()\n        {\n            return AddIndexOption(\"SPX\");\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2862;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 2;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionIndicatorsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionIndicatorsRegressionAlgorithm : OptionIndicatorsRegressionAlgorithm\n    {\n        protected override string ExpectedGreeks { get; set; } = \"Implied Volatility: 0.17406,Delta: 0.19196,Gamma: 0.00247,Vega: 1.72195,Theta: -1.3689,Rho: 0.01744\";\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 4);\n\n            var underlying = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = QuantConnect.Symbol.CreateOption(underlying, Market.USA, OptionStyle.European, OptionRight.Call, 3800m, new DateTime(2021, 1, 15));\n            AddOptionContract(option, Resolution.Minute);\n\n            InitializeIndicators(option);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1637;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionIronCondorAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionIronCondorAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw;\n        private BollingerBands _bb;\n\n        public override void Initialize()\n        {\n            SetStartDate(2019, 9, 1);\n            SetEndDate(2019, 11, 1);\n            SetCash(100000);\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.WeeklysOnly().Strikes(-5, 5).Expiration(0, 14));\n            _spxw = option.Symbol;\n\n            _bb = BB(index, 10, 2, resolution: Resolution.Daily);\n            WarmUpIndicator(index, _bb);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get the closest expiry date\n            var expiry = chain.Min(x => x.Expiry);\n            var contracts = chain.Where(x => x.Expiry == expiry).ToList();\n\n            // Separate the call and put contracts and sort by Strike to find OTM contracts\n            var calls = contracts.Where(x => x.Right == OptionRight.Call)\n                .OrderByDescending(x => x.Strike).ToArray();\n            var puts = contracts.Where(x => x.Right == OptionRight.Put)\n                .OrderBy(x => x.Strike).ToArray();\n\n            if (calls.Length < 3 || puts.Length < 3) return;\n\n            // Create combo order legs\n            var price = _bb.Price.Current.Value;\n            var quantity = 1;\n            if (price > _bb.UpperBand.Current.Value || price < _bb.LowerBand.Current.Value)\n            {\n                quantity = -1;\n            }\n            \n            var legs = new List<Leg>\n            {\n                Leg.Create(calls[0].Symbol, quantity),\n                Leg.Create(puts[0].Symbol, quantity),\n                Leg.Create(calls[2].Symbol, -quantity),\n                Leg.Create(puts[2].Symbol, -quantity),\n            };\n            ComboMarketOrder(legs, 10, asynchronous: true);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionModelsConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that when setting custom models for canonical index options, a one-time warning is sent\n    /// informing the user that the contracts models are different (not the custom ones).\n    /// </summary>\n    public class IndexOptionModelsConsistencyRegressionAlgorithm : OptionModelsConsistencyRegressionAlgorithm\n    {\n        protected override Security InitializeAlgorithm()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 5);\n\n            var index = AddIndex(\"SPX\", Resolution.Minute);\n            var option = AddIndexOption(index.Symbol, \"SPX\", Resolution.Minute);\n            option.SetFilter((x) => x.Strikes(-5, 5).Expiration(0, 360));\n\n            return option;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override Language[] Languages { get; } = { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 19224;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionPutButterflyAlgorithm : QCAlgorithm\n    {\n        private Symbol _spxw, _vxz;\n        private decimal _multiplier;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2021, 1, 1);\n            SetCash(1000000);\n\n            _vxz = AddEquity(\"VXZ\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"SPXW\", Resolution.Minute);\n            option.SetFilter((x) => x.IncludeWeeklys().Strikes(-3, 3).Expiration(15, 45));\n\n            _spxw = option.Symbol;\n            _multiplier = option.SymbolProperties.ContractMultiplier;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // The order of magnitude per SPXW order's value is 10000 times of VXZ\n            if (!Portfolio[_vxz].Invested)\n            {\n                MarketOrder(_vxz, 10000);\n            }\n            \n            // Return if any opening index option position\n            if (_tickets.Any(x => Portfolio[x.Symbol].Invested)) return;\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_spxw, out var chain)) return;\n\n            // Get nearest expiry date\n            var expiry = chain.Min(x => x.Expiry);\n            \n            // Select the put Option contracts with nearest expiry and sort by strike price\n            var puts = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Put).ToList();\n            if (puts.Count < 3) return;\n            var sortedPutStrikes = puts.Select(x => x.Strike).OrderBy(x => x).ToArray();\n            \n            // Select ATM put\n            var atmStrike = puts.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n\n            // Get the strike prices for the ITM & OTM contracts, make sure they're in equidistance\n            var spread = Math.Min(atmStrike - sortedPutStrikes[0], sortedPutStrikes[^1] - atmStrike);\n            var otmStrike = atmStrike - spread;\n            var itmStrike = atmStrike + spread;\n            if (!sortedPutStrikes.Contains(otmStrike) || !sortedPutStrikes.Contains(itmStrike)) return;\n\n            // Buy the put butterfly\n            var putButterfly = OptionStrategies.PutButterfly(_spxw, itmStrike, atmStrike, otmStrike, expiry);\n            var price = putButterfly.UnderlyingLegs.Sum(x => Math.Abs(Securities[x.Symbol].Price * x.Quantity) * _multiplier);\n            if (price > 0)\n            {\n                var quantity = Portfolio.TotalPortfolioValue / price;\n                _tickets = Buy(putButterfly, (int)Math.Floor(quantity), asynchronous: true);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionPutCalendarSpreadAlgorithm.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class IndexOptionPutCalendarSpreadAlgorithm : QCAlgorithm\n    {\n        private Symbol _vixw, _vxz;\n        private IEnumerable<OrderTicket> _tickets = Enumerable.Empty<OrderTicket>();\n        private DateTime _firstExpiry = DateTime.MaxValue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2023, 1, 1);\n            SetCash(50000);\n\n            _vxz = AddEquity(\"VXZ\", Resolution.Minute).Symbol;\n\n            var index = AddIndex(\"VIX\", Resolution.Minute).Symbol;\n            var option = AddIndexOption(index, \"VIXW\", Resolution.Minute);\n            option.SetFilter((x) => x.Strikes(-2, 2).Expiration(15, 45));\n            _vixw = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio[_vxz].Invested)\n            {\n                MarketOrder(_vxz, 100);\n            }\n            \n            var indexOptionsInvested = _tickets.Where(x => Portfolio[x.Symbol].Invested).ToList();\n            // Liquidate if the shorter term option is about to expire\n            if (_firstExpiry < Time.AddDays(2) && _tickets.All(x => slice.ContainsKey(x.Symbol)))\n            {\n                foreach (var holding in indexOptionsInvested)\n                {\n                    Liquidate(holding.Symbol);\n                }\n            }\n            // Return if there is any opening index option position\n            else if (indexOptionsInvested.Count > 0)\n            {\n                return;\n            }\n\n            // Get the OptionChain\n            if (!slice.OptionChains.TryGetValue(_vixw, out var chain)) return;\n\n            // Get ATM strike price\n            var strike = chain.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n            \n            // Select the ATM put Option contracts and sort by expiration date\n            var puts = chain.Where(x => x.Strike == strike && x.Right == OptionRight.Put)\n                            .OrderBy(x => x.Expiry).ToArray();\n            if (puts.Length < 2) return;\n            _firstExpiry = puts[0].Expiry;\n\n            // Sell the put calendar spread\n            var putCalendarSpread = OptionStrategies.PutCalendarSpread(_vixw, strike, _firstExpiry, puts[^1].Expiry);\n            _tickets = Sell(putCalendarSpread, 1, asynchronous: true);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for puts.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Put Option (expiring ITM) (buy, qty 1)\n    ///   * Option exercise, receiving cash (sell, qty -1)\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionPutITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice >= 4200m && x.ID.OptionRight == OptionRight.Put && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Put, 4200m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                AssertIndexOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{Time:yyyy-MM-dd HH:mm:ss} -- {orderEvent.Symbol} :: Price: {Securities[orderEvent.Symbol].Holdings.Price} Qty: {Securities[orderEvent.Symbol].Holdings.Quantity} Direction: {orderEvent.Direction} Msg: {orderEvent.Message}\");\n        }\n\n        private void AssertIndexOptionOrderExercise(OrderEvent orderEvent, Security index, Security optionContract)\n        {\n            var expectedLiquidationTimeUtc = new DateTime(2021, 1, 15);\n\n            if (orderEvent.Direction == OrderDirection.Buy && orderEvent.UtcTime != expectedLiquidationTimeUtc)\n            {\n                throw new RegressionTestException($\"Liquidated index option contract, but not at the expected time. Expected: {expectedLiquidationTimeUtc:yyyy-MM-dd HH:mm:ss} - found {orderEvent.UtcTime:yyyy-MM-dd HH:mm:ss}\");\n            }\n\n            // No way to detect option exercise orders or any other kind of special orders\n            // other than matching strings, for now.\n            if (orderEvent.Message.Contains(\"Option Exercise\"))\n            {\n                if (orderEvent.FillPrice != 3300m)\n                {\n                    throw new RegressionTestException(\"Option did not exercise at expected strike price (3300)\");\n                }\n\n                if (optionContract.Holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"Exercised option contract, but we have holdings for Option contract {optionContract.Symbol}\");\n                }\n            }\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\") && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after exercising option contract {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19891;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-9.85%\"},\n            {\"Compounding Annual Return\", \"-77.114%\"},\n            {\"Drawdown\", \"12.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"90146\"},\n            {\"Net Profit\", \"-9.854%\"},\n            {\"Sharpe Ratio\", \"-1.957\"},\n            {\"Sortino Ratio\", \"-0.569\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.709%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.64\"},\n            {\"Beta\", \"0.196\"},\n            {\"Annual Standard Deviation\", \"0.323\"},\n            {\"Annual Variance\", \"0.104\"},\n            {\"Information Ratio\", \"-1.982\"},\n            {\"Tracking Error\", \"0.34\"},\n            {\"Treynor Ratio\", \"-3.216\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX 31KC0UJHCBG4U|SPX 31\"},\n            {\"Portfolio Turnover\", \"1.94%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3f315a4d5124203fb8ed466926314824\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) index option expiry for puts.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy SPX Put Option (expiring OTM)\n    ///     - contract expires worthless, not exercised, so never opened a position in the underlying\n    ///\n    ///   * Liquidation of worthless SPX Put OTM contract\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    /// <remarks>\n    /// Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n    /// </remarks>\n    public class IndexOptionPutOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Put && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Put, 3200m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, 1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                throw new RegressionTestException(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM and is not tradable\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Holdings were found after a filled option exercise\");\n            }\n            if (orderEvent.Direction == OrderDirection.Sell && !orderEvent.Message.Contains(\"OTM\"))\n            {\n                throw new RegressionTestException(\"Contract did not expire OTM\");\n            }\n            if (orderEvent.Message.Contains(\"Exercise\"))\n            {\n                throw new RegressionTestException(\"Exercised option, even though it expires OTM\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19985;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.37%\"},\n            {\"Compounding Annual Return\", \"-5.133%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99630\"},\n            {\"Net Profit\", \"-0.370%\"},\n            {\"Sharpe Ratio\", \"-3.525\"},\n            {\"Sortino Ratio\", \"-1.255\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.175%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.039\"},\n            {\"Beta\", \"0.007\"},\n            {\"Annual Standard Deviation\", \"0.011\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.595\"},\n            {\"Tracking Error\", \"0.137\"},\n            {\"Treynor Ratio\", \"-5.965\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX 31KC0UJFOS3N2|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"22c6e3e24145b1d57ef6a7f2b30108a7\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionScaledStrikeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test we can get and trade option contracts for NQX index option\n    /// </summary>\n    public class IndexOptionScaledStrikeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _nqx;\n        private HashSet<int> _orderIds = new HashSet<int>();\n        private DateTime _expiration = new DateTime(2021, 3, 19);\n        private const decimal _initialCash = 100000m;\n        private bool _orderExercisedOTM;\n        private bool _orderExercisedITM;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 3, 18);\n            SetEndDate(2021, 3, 23);\n            SetCash(_initialCash);\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            var index = AddIndex(\"NDX\", Resolution.Hour).Symbol;\n            var option = AddIndexOption(index, \"NQX\", Resolution.Hour);\n            option.SetFilter(universe => universe.IncludeWeeklys().Strikes(-1, 1).Expiration(0, 5));\n\n            _nqx = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var weekly_chain = slice.OptionChains.get(_nqx);\n\n            if (!weekly_chain.IsNullOrEmpty() && !Portfolio.Invested)\n            {\n                foreach (var contract in weekly_chain.Where(x => x.Symbol.ID.Date == _expiration))\n                {\n                    var ticket = MarketOrder(contract.Symbol, 1);\n                    _orderIds.Add(ticket.OrderId);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (_orderIds.Contains(orderEvent.Id) && orderEvent.Status == OrderStatus.Filled)\n            {\n                if (orderEvent.Message.Contains(\"OTM\", StringComparison.InvariantCulture))\n                {\n                    _orderExercisedOTM = true;\n                }\n                else\n                {\n                    _orderExercisedITM = true;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_orderExercisedOTM)\n            {\n                throw new RegressionTestException($\"At least one order should have been exercised OTM\");\n            }\n\n            if (!_orderExercisedITM)\n            {\n                throw new RegressionTestException($\"At least one order should have been exercised ITM\");\n            }\n\n            if (Portfolio.TotalPortfolioValue <= _initialCash)\n            {\n                throw new RegressionTestException($\"Since one order was expected to be exercised ITM, Total Portfolio Value was expected to be higher than {_initialCash}, but was {Portfolio.TotalPortfolioValue}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 106;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"174.10%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"79228162514264337593543950335%\"},\n            {\"Drawdown\", \"2.100%\"},\n            {\"Expectancy\", \"2901.176\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"274018.3\"},\n            {\"Net Profit\", \"174.018%\"},\n            {\"Sharpe Ratio\", \"6.74816637965336E+27\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.428%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"5803.35\"},\n            {\"Alpha\", \"7.922816251426434E+28\"},\n            {\"Beta\", \"4.566\"},\n            {\"Annual Standard Deviation\", \"11.741\"},\n            {\"Annual Variance\", \"137.844\"},\n            {\"Information Ratio\", \"6.749778840887739E+27\"},\n            {\"Tracking Error\", \"11.738\"},\n            {\"Treynor Ratio\", \"1.7351225556608623E+28\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$7000.00\"},\n            {\"Lowest Capacity Asset\", \"NQX 31M220FF67A3Y|NDX 31\"},\n            {\"Portfolio Turnover\", \"6.40%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"bbdd7eb2f738326a6184bc71d435c6cb\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for short calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell SPX Call Option (expiring ITM)\n    ///   * Option assignment\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionShortCallITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n            SetCash(1000000);\n\n            Portfolio.SetMarginCallModel(MarginCallModel.Null);\n\n            SetSecurityInitializer(new CompositeSecurityInitializer(SecurityInitializer,\n                new FuncSecurityInitializer((security) =>\n                {\n                    var option = security as Option;\n                    // avoid getting assigned\n                    option?.SetOptionAssignmentModel(new NullOptionAssignmentModel());\n                })));\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _esOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(contractData => contractData.ID.StrikePrice <= 3200m && contractData.ID.OptionRight == OptionRight.Call && contractData.ID.Date.Year == 2021 && contractData.ID.Date.Month == 1)\n                .OrderByDescending(contractData => contractData.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Call, 3200m, new DateTime(2021, 1, 15));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_esOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                AssertIndexOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionOrderExercise(OrderEvent orderEvent, Security index, Security optionContract)\n        {\n            if (orderEvent.Message.Contains(\"Assignment\"))\n            {\n                if (orderEvent.FillPrice != 3200m)\n                {\n                    throw new RegressionTestException(\"Option was not assigned at expected strike price (3200)\");\n                }\n                if (orderEvent.Direction != OrderDirection.Sell || index.Holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"Expected Qty: 0 index holdings for assigned index option {index.Symbol}, found {index.Holdings.Quantity}\");\n                }\n            }\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.IsAssignment && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after option contract was assigned: {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19909;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.95%\"},\n            {\"Compounding Annual Return\", \"-12.719%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"990476\"},\n            {\"Net Profit\", \"-0.952%\"},\n            {\"Sharpe Ratio\", \"-3.064\"},\n            {\"Sortino Ratio\", \"-0.889\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.542%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.095\"},\n            {\"Beta\", \"0.019\"},\n            {\"Annual Standard Deviation\", \"0.031\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-0.985\"},\n            {\"Tracking Error\", \"0.139\"},\n            {\"Treynor Ratio\", \"-5.019\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.19%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"358b15e6d71c9fab8de9f53e667df96e\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) index option expiry for short calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell SPX Call Option (expiring OTM)\n    ///     - Profit the option premium, since the option was not assigned.\n    ///\n    ///   * Liquidation of SPX call OTM contract on the last trade date\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionShortCallOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice >= 4250m && x.ID.OptionRight == OptionRight.Call && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Call, 4250m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                throw new RegressionTestException($\"Expected no order events for underlying Symbol {security.Symbol}\");\n            }\n\n            if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security optionContract)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && optionContract.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {optionContract.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Buy && optionContract.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Expected no options holdings after closing position\");\n            }\n            if (orderEvent.IsAssignment)\n            {\n                throw new RegressionTestException($\"Assignment was not expected for {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15942;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.142%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100010\"},\n            {\"Net Profit\", \"0.010%\"},\n            {\"Sharpe Ratio\", \"-6.787\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"98.983%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.001\"},\n            {\"Beta\", \"-0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.32\"},\n            {\"Tracking Error\", \"0.138\"},\n            {\"Treynor Ratio\", \"14.02\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$22000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P59H9OI6|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b2d0a0970bfbb57c5b20d251b0366e29\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests In The Money (ITM) index option expiry for short puts.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell SPX Put Option (expiring ITM)\n    ///   * Option assignment\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionShortPutITMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n            SetCash(1000000);\n\n            Portfolio.SetMarginCallModel(MarginCallModel.Null);\n\n            SetSecurityInitializer(new CompositeSecurityInitializer(SecurityInitializer,\n                new FuncSecurityInitializer((security) =>\n                {\n                    var option = security as Option;\n                    // avoid getting assigned\n                    option?.SetOptionAssignmentModel(new NullOptionAssignmentModel());\n                })));\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(contractData => contractData.ID.StrikePrice <= 4200m && contractData.ID.OptionRight == OptionRight.Put && contractData.ID.Date.Year == 2021 && contractData.ID.Date.Month == 1)\n                .OrderByDescending(contractData => contractData.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Put, 4200m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                AssertIndexOptionOrderExercise(orderEvent, security, Securities[_expectedContract]);\n            }\n            else if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionOrderExercise(OrderEvent orderEvent, Security index, Security optionContract)\n        {\n            if (orderEvent.Message.Contains(\"Assignment\"))\n            {\n                if (orderEvent.FillPrice != 4200)\n                {\n                    throw new RegressionTestException(\"Option was not assigned at expected strike price (4200)\");\n                }\n                if (orderEvent.Direction != OrderDirection.Buy || index.Holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"Expected Qty: 0 index holdings for assigned index option {index.Symbol}, found {index.Holdings.Quantity}\");\n                }\n            }\n            else if (index.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Expected no holdings in index: {index.Symbol}\");\n            }\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.IsAssignment && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException($\"Holdings were found after option contract was assigned: {option.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19891;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.94%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"14.183%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1009374\"},\n            {\"Net Profit\", \"0.937%\"},\n            {\"Sharpe Ratio\", \"2.997\"},\n            {\"Sortino Ratio\", \"34.286\"},\n            {\"Probabilistic Sharpe Ratio\", \"86.840%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.098\"},\n            {\"Beta\", \"-0.021\"},\n            {\"Annual Standard Deviation\", \"0.032\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"0.374\"},\n            {\"Tracking Error\", \"0.144\"},\n            {\"Treynor Ratio\", \"-4.521\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX 31KC0UJHCBG4U|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.19%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"86a79c56040bedf9067b7255131e0387\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) index option expiry for short puts.\n    /// We expect 2 order from the algorithm, which are:\n    ///\n    ///   * Initial entry, sell SPX Put Option (expiring OTM)\n    ///     - Profit the option premium, since the option was not assigned.\n    ///\n    ///   * Liquidation of SPX put OTM contract on the last trade date\n    ///\n    /// Additionally, we test delistings for index options and assert that our\n    /// portfolio holdings reflect the orders the algorithm has submitted.\n    /// </summary>\n    public class IndexOptionShortPutOTMExpiryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spx;\n        private Symbol _spxOption;\n        private Symbol _expectedContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 31);\n\n            _spx = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Select a index option expiring ITM, and adds it to the algorithm.\n            _spxOption = AddIndexOptionContract(OptionChain(_spx)\n                .Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Put && x.ID.Date.Year == 2021 && x.ID.Date.Month == 1)\n                .OrderByDescending(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_spx, Market.USA, OptionStyle.European, OptionRight.Put, 3200m, new DateTime(2021, 1, 15));\n            if (_spxOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.AfterMarketOpen(_spx, 1), () =>\n            {\n                MarketOrder(_spxOption, -1);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Assert delistings, so that we can make sure that we receive the delisting warnings at\n            // the expected time. These assertions detect bug #4872\n            foreach (var delisting in slice.Delistings.Values)\n            {\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 15))\n                    {\n                        throw new RegressionTestException($\"Delisting warning issued at unexpected date: {delisting.Time}\");\n                    }\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    if (delisting.Time != new DateTime(2021, 1, 16))\n                    {\n                        throw new RegressionTestException($\"Delisting happened at unexpected date: {delisting.Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _spx)\n            {\n                throw new RegressionTestException($\"Expected no order events for underlying Symbol {security.Symbol}\");\n            }\n            if (security.Symbol == _expectedContract)\n            {\n                AssertIndexOptionContractOrder(orderEvent, security);\n            }\n            else\n            {\n                throw new RegressionTestException($\"Received order event for unknown Symbol: {orderEvent.Symbol}\");\n            }\n\n            Log($\"{orderEvent}\");\n        }\n\n        private void AssertIndexOptionContractOrder(OrderEvent orderEvent, Security option)\n        {\n            if (orderEvent.Direction == OrderDirection.Sell && option.Holdings.Quantity != -1)\n            {\n                throw new RegressionTestException($\"No holdings were created for option contract {option.Symbol}\");\n            }\n            if (orderEvent.Direction == OrderDirection.Buy && option.Holdings.Quantity != 0)\n            {\n                throw new RegressionTestException(\"Expected no options holdings after closing position\");\n            }\n            if (orderEvent.IsAssignment)\n            {\n                throw new RegressionTestException($\"Assignment was not expected for {orderEvent.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19985;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.34%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4.943%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100340\"},\n            {\"Net Profit\", \"0.340%\"},\n            {\"Sharpe Ratio\", \"2.906\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"89.631%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.033\"},\n            {\"Beta\", \"-0.008\"},\n            {\"Annual Standard Deviation\", \"0.011\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.073\"},\n            {\"Tracking Error\", \"0.139\"},\n            {\"Treynor Ratio\", \"-4.22\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPX 31KC0UJFOS3N2|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"0b39fcedbea77ba71bf0d4547a3b8fc5\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/IndexOptionsUniverseSettingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that index options from universe are added with the same resolution, fill forward and extended market hours settings as the universe settings.\n    /// </summary>\n    public class IndexOptionsUniverseSettingsRegressionAlgorithm : EquityOptionsUniverseSettingsRegressionAlgorithm\n    {\n        protected override DateTime TestStartDate => new DateTime(2021, 01, 05);\n\n        protected override SecurityType[] AddSecurity()\n        {\n            var index = AddIndex(\"SPX\");\n            var indexOption = AddOption(index.Symbol);\n            indexOption.SetFilter(u => u.Strikes(-2, +2).Expiration(0, 180));\n\n            return [indexOption.Symbol.SecurityType];\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 46;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-16.713\"},\n            {\"Tracking Error\", \"0.067\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexSecurityCanBeTradableRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test we can manually set index securities to be tradable without breaking\n    /// SignalExportManager\n    /// </summary>\n    public class IndexSecurityCanBeTradableRegressionAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SignalExportManagerTest _signalExportManagerTest;\n        private Symbol _equity;\n        private Symbol _index;\n\n        public virtual bool IsTradable { get; set; } = true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            _index = AddIndex(\"SPX\").Symbol;\n            _equity = AddEquity(\"SPY\").Symbol;\n            SignalExport.AutomaticExportTimeSpan = null;\n            _signalExportManagerTest = new SignalExportManagerTest(this);\n            Securities[_index].IsTradable = IsTradable;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsTradable != Securities[_index].IsTradable)\n            {\n                throw new RegressionTestException($\"Index.IsTradable should be {IsTradable}, but was {Securities[_index].IsTradable}\");\n            }\n\n            _signalExportManagerTest.GetPortfolioTargetsFromPortfolio(out PortfolioTarget[] targets);\n            if (IsTradable)\n            {\n                if (!targets.Where(x => x.Symbol.SecurityType == SecurityType.Index).Any())\n                {\n                    throw new RegressionTestException($\"Index {_index} is marked as tradable security, but no portfolio target with index security type was created\");\n                }\n            }\n            else\n            {\n                if (targets.Where(x => x.Symbol.SecurityType == SecurityType.Index).Any())\n                {\n                    throw new RegressionTestException($\"Index is not a tradable security, so no portfolio target with index security type should have been created\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_equity, 1);\n                RemoveSecurity(_index);\n\n                AssertIndexIsNotTradable();\n\n                AddSecurity(_index);\n                IsTradable = false;\n            }\n\n            AssertIndexIsNotTradable();\n        }\n\n        private void AssertIndexIsNotTradable()\n        {\n            if (Securities[_index].IsTradable)\n            {\n                throw new RegressionTestException($\"Index {_index} has already been removed and should be tradable no more\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 797;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99978.71\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"99.63%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n\n        private class SignalExportManagerTest: SignalExportManager\n        {\n            public SignalExportManagerTest(IAlgorithm algorithm) : base(algorithm)\n            {\n            }\n\n            public void GetPortfolioTargetsFromPortfolio(out PortfolioTarget[] portfolioTargets)\n            {\n                base.GetPortfolioTargets(out portfolioTargets);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndexSecurityIsNotTradableRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test SignalExportManager still works as expected even when index securities\n    /// are not marked as tradable\n    /// </summary>\n    public class IndexSecurityIsNotTradableRegressionAlgorithm: IndexSecurityCanBeTradableRegressionAlgorithm\n    {\n        public override bool IsTradable { get; set; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndiaDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating use of map files with India data\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"India data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"rename event\" />\n    /// <meta name=\"tag\" content=\"map\" />\n    /// <meta name=\"tag\" content=\"mapping\" />\n    /// <meta name=\"tag\" content=\"map files\" />\n    public class IndiaDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _mappingSymbol, _splitAndDividendSymbol;\n        private bool _initialMapping;\n        private bool _executionMapping;\n        private bool _receivedWarningEvent;\n        private bool _receivedOccurredEvent;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetAccountCurrency(\"INR\");  //Set Account Currency \n            SetStartDate(2004, 5, 20);  //Set Start Date\n            SetEndDate(2016, 7, 26);    //Set End Date\n            _mappingSymbol = AddEquity(\"3MINDIA\", Resolution.Daily, Market.India).Symbol;\n            _splitAndDividendSymbol = AddEquity(\"CCCL\", Resolution.Daily, Market.India).Symbol;\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"dividends\">Data.</param>\n        public override void OnDividends(Dividends dividends)\n        {\n            if (dividends.ContainsKey(_splitAndDividendSymbol))\n            {\n                var dividend = dividends[_splitAndDividendSymbol];\n                if (Time.Date == new DateTime(2010, 06, 15) &&\n                    (dividend.Price != 0.5m || dividend.ReferencePrice != 88.8m || dividend.Distribution != 0.5m))\n                {\n                    throw new RegressionTestException(\"Did not receive expected dividend values\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"splits\">Splits.</param>\n        public override void OnSplits(Splits splits)\n        {\n            if (splits.ContainsKey(_splitAndDividendSymbol))\n            {\n                var split = splits[_splitAndDividendSymbol];\n                if (split.Type == SplitType.Warning)\n                {\n                    _receivedWarningEvent = true;\n                }\n                else if (split.Type == SplitType.SplitOccurred)\n                {\n                    _receivedOccurredEvent = true;\n                    if (split.Price != 421m || split.ReferencePrice != 421m || split.SplitFactor != 0.2m)\n                    {\n                        throw new RegressionTestException(\"Did not receive expected split values\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Checks the symbol change event\n        /// </summary>\n        public override void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged)\n        {\n            if (symbolsChanged.ContainsKey(_mappingSymbol))\n            {\n                var mappingEvent = symbolsChanged.Single(x => x.Key.SecurityType == SecurityType.Equity).Value;\n                Log($\"{Time} - Ticker changed from: {mappingEvent.OldSymbol} to {mappingEvent.NewSymbol}\");\n                if (Time.Date == new DateTime(1999, 01, 01))\n                {\n                    _initialMapping = true;\n                }\n                else if (Time.Date == new DateTime(2004, 06, 15))\n                {\n                    if (mappingEvent.NewSymbol == \"3MINDIA\"\n                        && mappingEvent.OldSymbol == \"BIRLA3M\")\n                    {\n                        _executionMapping = true;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Final step of the algorithm\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_initialMapping)\n            {\n                throw new RegressionTestException(\"The ticker generated the initial rename event\");\n            }\n            if (!_executionMapping)\n            {\n                throw new RegressionTestException(\"The ticker did not rename throughout the course of its life even though it should have\");\n            }\n            if (!_receivedOccurredEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected split event\");\n            }\n            if (!_receivedWarningEvent)\n            {\n                throw new RegressionTestException(\"Did not receive expected split warning event\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 23036;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"₹0.00\"},\n            {\"Estimated Strategy Capacity\", \"₹0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorBasedOptionPricingModelIndexOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Option;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to override the option pricing model with the\n    /// <see cref=\"IndicatorBasedOptionPriceModel\"/> for a given index option security.\n    /// </summary>\n    public class IndicatorBasedOptionPricingModelIndexOptionRegressionAlgorithm : IndicatorBasedOptionPricingModelRegressionAlgorithm\n    {\n        protected override DateTime TestStartDate => new(2021, 1, 4);\n\n        protected override DateTime TestEndDate => new(2021, 1, 4);\n\n        protected override Option GetOption()\n        {\n            var index = AddIndex(\"SPX\");\n            var indexOption = AddIndexOption(index.Symbol);\n            indexOption.SetFilter(u => u.CallsOnly());\n            return indexOption;\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 4806;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Option;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to override the option pricing model with the\n    /// <see cref=\"IndicatorBasedOptionPriceModel\"/> for a given option security.\n    /// </summary>\n    public class IndicatorBasedOptionPricingModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _checked;\n\n        private Option _option;\n\n        protected virtual DateTime TestStartDate => new(2015, 12, 24);\n\n        protected virtual DateTime TestEndDate => new(2015, 12, 24);\n\n        public override void Initialize()\n        {\n            SetStartDate(TestStartDate);\n            SetEndDate(TestEndDate);\n            SetCash(100000);\n\n            _option = GetOption();\n\n            if (_option.PriceModel is not IndicatorBasedOptionPriceModel)\n            {\n                throw new RegressionTestException(\"Option pricing model was not set to IndicatorBasedOptionPriceModel, which should be the default\");\n            }\n        }\n\n        protected virtual Option GetOption()\n        {\n            var equity = AddEquity(\"GOOG\");\n            var option = AddOption(equity.Symbol);\n            option.SetFilter(u => u.Strikes(-2, +2).Expiration(0, 180));\n            return option;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_checked  && slice.OptionChains.TryGetValue(_option.Symbol, out var chain))\n            {\n                foreach (var contract in chain)\n                {\n                    var contractSecurity = Securities[contract.Symbol] as Option;\n                    if (contractSecurity.PriceModel is not IndicatorBasedOptionPriceModel)\n                    {\n                        throw new RegressionTestException(\"Contract security pricing model was not set to IndicatorBasedOptionPriceModel\");\n                    }\n\n                    var theoreticalPrice = contract.TheoreticalPrice;\n                    var iv = contract.ImpliedVolatility;\n                    var greeks = contract.Greeks;\n\n                    Log($\"{contract.Symbol}:: Theoretical Price: {theoreticalPrice}, IV: {iv}, \" +\n                           $\"Delta: {greeks.Delta}, Gamma: {greeks.Gamma}, Vega: {greeks.Vega}, \" +\n                           $\"Theta: {greeks.Theta}, Rho: {greeks.Rho}, Lambda: {greeks.Lambda}\");\n\n                    // Sanity check values\n\n                    var theoreticalPriceChecked = false;\n                    // If IV is zero (model could not converge) we skip the theoretical price check, as it will be zero too\n                    if (iv != 0)\n                    {\n                        if (theoreticalPrice <= 0)\n                        {\n                            throw new RegressionTestException($\"Invalid theoretical price for {contract.Symbol}: {theoreticalPrice}\");\n                        }\n                        theoreticalPriceChecked = true;\n                    }\n                    // We check for all greeks and IV together. e.g. IV could be zero if the model can't converge, say for instance if a contract is iliquid or deep ITM/OTM\n                    if (greeks == null ||\n                        (iv == 0 && greeks.Delta == 0 && greeks.Gamma == 0 && greeks.Vega== 0 && greeks.Theta == 0 && greeks.Rho == 0))\n                    {\n                        throw new RegressionTestException($\"Invalid Greeks for {contract.Symbol}\");\n                    }\n\n                    // Manually evaluate the price model, just in case\n                    var result = contractSecurity.EvaluatePriceModel(slice, contract);\n\n                    if (result == null ||\n                        result.TheoreticalPrice != theoreticalPrice ||\n                        result.ImpliedVolatility != iv ||\n                        result.Greeks.Delta != greeks.Delta ||\n                        result.Greeks.Gamma != greeks.Gamma ||\n                        result.Greeks.Vega != greeks.Vega ||\n                        result.Greeks.Theta != greeks.Theta ||\n                        result.Greeks.Rho != greeks.Rho)\n                    {\n                        throw new RegressionTestException($\"EvaluatePriceModel returned different results for {contract.Symbol}\");\n                    }\n\n                    _checked |= theoreticalPriceChecked;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_checked)\n            {\n                throw new RegressionTestException(\"Option chain was never received.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 37131;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration algorithm of indicators history window usage\n    /// </summary>\n    public class IndicatorHistoryAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        private BollingerBands _bollingerBands;\n\n        /// <summary>\n        /// Initialize the data and resolution you require for your strategy\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 1, 1);\n            SetEndDate(2014, 12, 31);\n            SetCash(25000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n\n            _bollingerBands = BB(_symbol, 20, 2.0m, resolution: Resolution.Daily);\n            // Let's keep BB values for a 20 day period\n            _bollingerBands.Window.Size = 20;\n            // Also keep the same period of data for the middle band\n            _bollingerBands.MiddleBand.Window.Size = 20;\n        }\n\n        public void OnData(Slice slice)\n        {\n            // Let's wait for our indicator to fully initialize and have a full window of history data\n            if (!_bollingerBands.Window.IsReady) return;\n\n            // We can access the current and oldest (in our period) values of the indicator\n            Log($\"Current BB value: {_bollingerBands[0].EndTime} - {_bollingerBands[0].Value}\");\n            Log($@\"Oldest BB value: {_bollingerBands[_bollingerBands.Window.Count - 1].EndTime} - {\n                _bollingerBands[_bollingerBands.Window.Count - 1].Value}\");\n\n            // Let's log the BB values for the last 20 days, for demonstration purposes on how it can be enumerated\n            foreach (var dataPoint in _bollingerBands)\n            {\n                Log($\"BB @{dataPoint.EndTime}: {dataPoint.Value}\");\n            }\n\n            // We can also do the same for internal indicators:\n            var middleBand = _bollingerBands.MiddleBand;\n            Log($\"Current BB Middle Band value: {middleBand[0].EndTime} - {middleBand[0].Value}\");\n            Log($@\"Oldest BB Middle Band value: {middleBand[middleBand.Window.Count - 1].EndTime} - {\n                middleBand[middleBand.Window.Count - 1].Value}\");\n            foreach (var dataPoint in middleBand)\n            {\n                Log($\"BB Middle Band @{dataPoint.EndTime}: {dataPoint.Value}\");\n            }\n\n            // We are done now!\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 160;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"25000\"},\n            {\"End Equity\", \"25000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-7.674\"},\n            {\"Tracking Error\", \"0.085\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of the indicator history api\n    /// </summary>\n    public class IndicatorHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialize the data and resolution you require for your strategy\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 1, 1);\n            SetEndDate(2014, 12, 31);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n        }\n\n        public void OnData(Slice slice)\n        {\n            var bollingerBands = new BollingerBands(\"BB\", 20, 2.0m, MovingAverageType.Simple);\n\n            if (bollingerBands.Window.IsReady)\n            {\n                throw new RegressionTestException(\"Unexpected ready bollinger bands state\");\n            }\n\n            var indicatorHistory = IndicatorHistory(bollingerBands, _symbol, 50);\n\n            if (!bollingerBands.Window.IsReady)\n            {\n                throw new RegressionTestException(\"Unexpected not ready bollinger bands state\");\n            }\n\n            // we ask for 50 data points\n            if (indicatorHistory.Count != 50)\n            {\n                throw new RegressionTestException($\"Unexpected indicators values {indicatorHistory.Count}\");\n            }\n\n            foreach (var indicatorDataPoints in indicatorHistory)\n            {\n                var upperBand = ((dynamic)indicatorDataPoints).UpperBand;\n                Debug($\"BB @{indicatorDataPoints.Current}: middleband: {indicatorDataPoints[\"middleband\"]} upperBand {upperBand}\");\n\n                if (indicatorDataPoints == 0)\n                {\n                    throw new RegressionTestException($\"Unexpected indicators point {indicatorDataPoints}\");\n                }\n            }\n\n            var currentValues = indicatorHistory.Current;\n            if (currentValues.Count != 50 || currentValues.Any(x => x.Value == 0))\n            {\n                throw new RegressionTestException($\"Unexpected indicators current values {currentValues.Count}\");\n            }\n            var upperBandPoints = indicatorHistory[\"UpperBand\"];\n            if (upperBandPoints.Count != 50 || upperBandPoints.Any(x => x.Value == 0))\n            {\n                throw new RegressionTestException($\"Unexpected indicators upperBandPoints values {upperBandPoints.Count}\");\n            }\n\n            // We are done now!\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 16;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 69;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorSelectorsWorkWithDifferentOptions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests that we can use selectors in the indicators\n    /// that need quote data\n    /// </summary>\n    public class IndicatorSelectorsWorkWithDifferentOptions: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Indicator> _equityIndicators;\n        private Indicator _optionIndicator;\n        private Indicator _tradebarIndicatorHistory;\n        private Indicator _quotebarIndicatorHistory;\n        private Symbol _equity;\n        private Symbol _eurusd;\n        private Symbol _aapl;\n        private Symbol _option;\n        private Symbol _future;\n        private Symbol _futureContract;\n        private bool _quoteBarsFound;\n        private bool _tradeBarsFound;\n        private DateTime _aaplLastDate;\n        private DateTime _eurusdLastDate;\n        private List<decimal> _aaplPoints = new List<decimal>();\n        private List<decimal> _eurusdPoints = new List<decimal>();\n        private List<decimal> _futurePoints = new List<decimal>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 06, 07);\n            SetEndDate(2013, 11, 08);\n\n            _equity = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            _aapl = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n            _eurusd = AddForex(\"EURUSD\", Resolution.Daily).Symbol;\n            _option = AddOption(\"NWSA\", Resolution.Minute).Symbol;\n            _option = QuantConnect.Symbol.CreateOption(\"NWSA\", Market.USA, OptionStyle.American, OptionRight.Put, 33, new DateTime(2013, 07, 20));\n            var future = AddFuture(\"GC\", Resolution.Daily, Market.COMEX);\n            _future = future.Symbol;\n            future.SetFilter(0, 120);\n            AddOptionContract(_option, Resolution.Minute);\n\n            _equityIndicators = new List<Indicator>()\n            {\n                Identity(_equity, Resolution.Minute, Field.BidClose, \"Bid.Close.\"),\n                Identity(_equity, Resolution.Minute, Field.BidOpen, \"Bid.Open.\"),\n                Identity(_equity, Resolution.Minute, Field.BidLow, \"Bid.Low.\"),\n                Identity(_equity, Resolution.Minute, Field.BidHigh, \"Bid.High.\"),\n                Identity(_equity, Resolution.Minute, Field.AskClose, \"Ask.Close.\"),\n                Identity(_equity, Resolution.Minute, Field.AskOpen, \"Ask.Open.\"),\n                Identity(_equity, Resolution.Minute, Field.AskLow, \"Ask.Low.\"),\n                Identity(_equity, Resolution.Minute, Field.AskHigh, \"Ask.High.\"),\n            };\n\n            _optionIndicator = Identity(_option, Resolution.Minute, Field.Volume, \"Volume.\");\n            _tradebarIndicatorHistory = Identity(_aapl, Resolution.Daily);\n            _quotebarIndicatorHistory = Identity(_eurusd, Resolution.Daily);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_aaplLastDate.Date != Time.Date && slice.TryGetValue(_aapl, out var aaplPoint))\n            {\n                if (aaplPoint.Volume != 0)\n                {\n                    _aaplLastDate = Time.Date;\n                    _aaplPoints.Add(aaplPoint.Volume);\n                }\n            }\n\n            if (_eurusdLastDate.Date != Time.Date && slice.QuoteBars.TryGetValue(_eurusd, out var eurusdPoint))\n            {\n                _eurusdLastDate = Time.Date;\n                _eurusdPoints.Add(eurusdPoint.Bid.Close);\n            }\n\n            if (slice.QuoteBars.ContainsKey(_equity))\n            {\n                _quoteBarsFound = true;\n                var wrongEquityIndicators = _equityIndicators.Where(x =>\n                {\n                    var propertyName = x.Name.Split(\".\")[0]; // This could be Ask/Bid\n                    var secondPropertyName = x.Name.Split(\".\")[1]; // This could be Open/Close/High/Low\n                    var property = slice.QuoteBars[_equity].GetType().GetProperty(propertyName).GetValue(slice.QuoteBars[_equity], null);\n                    var value = (decimal)property.GetType().GetProperty(secondPropertyName).GetValue(property, null);\n                    return x.Current.Value != value;\n                });\n\n                if (wrongEquityIndicators.Any())\n                {\n                    throw new RegressionTestException();\n                }\n            }\n\n            if (slice.OptionChains.TryGetValue(_option.Canonical, out var optionChain) && optionChain.TradeBars.TryGetValue(_option, out var optionChainTradeBar))\n            {\n                _tradeBarsFound = true;\n                if (_optionIndicator.Current.Value != optionChainTradeBar.Volume)\n                {\n                    throw new RegressionTestException();\n                }\n            }\n\n            if (slice.FutureChains.TryGetValue(_future, out var futureChain))\n            {\n                if (_futureContract == null)\n                {\n                    _futureContract = futureChain.TradeBars.Values.FirstOrDefault().Symbol;\n                }\n\n                if (futureChain.TradeBars.TryGetValue(_futureContract, out var value))\n                {\n                    if (value.Volume != 0)\n                    {\n                        _futurePoints.Add(value.Volume);\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_quoteBarsFound)\n            {\n                throw new RegressionTestException(\"At least one quote bar should have been found, but none was found\");\n            }\n\n            if (!_tradeBarsFound)\n            {\n                throw new RegressionTestException(\"At least one trade bar should have been found, but none was found\");\n            }\n\n            var backtestDays = (EndDate - StartDate).Days;\n            var futureIndicator = new Identity(\"\");\n            var futureVolumeHistory = IndicatorHistory(futureIndicator, _futureContract, backtestDays, Resolution.Daily, Field.Volume);\n            if (Math.Abs(futureVolumeHistory.Current.Select(x => x.Value).Where(x => x != 0).Average() - _futurePoints.Average()) > 0.001m)\n            {\n                throw new RegressionTestException($\"No history indicator future data point was found using Field.Volume selector for {_futureContract}!\");\n            }\n\n            var volumeHistory = IndicatorHistory(_tradebarIndicatorHistory, _aapl, 109, Resolution.Daily, Field.Volume);\n            if (Math.Abs(volumeHistory.Current.Select(x => x.Value).Average() - _aaplPoints.Average()) > 0.001m)\n            {\n                throw new RegressionTestException($\"No history indicator data point was found using Field.Volume selector for {_aapl}!\");\n            }\n\n            var bidCloseHistory = IndicatorHistory(_quotebarIndicatorHistory, _eurusd, 132, Resolution.Daily, Field.BidClose);\n            if (Math.Abs(bidCloseHistory.Current.Select(x => x.Value).Average() - _eurusdPoints.Average()) > 0.001m)\n            {\n                throw new RegressionTestException($\"No history indicator data point was found using Field.BidClose selector for {_eurusd}!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 455371;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 296;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.543\"},\n            {\"Tracking Error\", \"0.098\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorSuiteAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration algorithm of popular indicators and plotting them.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    /// <meta name=\"tag\" content=\"charting\" />\n    /// <meta name=\"tag\" content=\"indicator field selection\" />\n    public class IndicatorSuiteAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private string _ticker = \"SPY\";\n        private string _ticker2 = \"GOOG\";\n        private string _customTicker = \"IBM\";\n\n        private Symbol _symbol;\n        private Symbol _symbol2;\n        private Symbol _customSymbol;\n\n        private Indicators _indicators;\n        private Indicators _selectorIndicators;\n        private IndicatorBase<IndicatorDataPoint> _ratio;\n\n        //RSI Custom Data:\n        private RelativeStrengthIndex _rsiCustom;\n        private Minimum _minCustom;\n        private Maximum _maxCustom;\n\n        private decimal _price;\n\n        /// <summary>\n        /// Initialize the data and resolution you require for your strategy\n        /// </summary>\n        public override void Initialize()\n        {\n            //Initialize\n            SetStartDate(2013, 1, 1);\n            SetEndDate(2014, 12, 31);\n            SetCash(25000);\n\n            //Add as many securities as you like. All the data will be passed into the event handler:\n            _symbol = AddSecurity(SecurityType.Equity, _ticker, Resolution.Daily).Symbol;\n            _symbol2 = AddSecurity(SecurityType.Equity, _ticker2, Resolution.Daily).Symbol;\n\n            //Add the Custom Data:\n            _customSymbol = AddData<CustomData>(_customTicker, Resolution.Daily).Symbol;\n\n            //Set up default Indicators, these indicators are defined on the Value property of incoming data (except ATR and AROON which use the full TradeBar object)\n            _indicators = new Indicators\n            {\n                BB = BB(_symbol, 20, 1, MovingAverageType.Simple, Resolution.Daily),\n                RSI = RSI(_symbol, 14, MovingAverageType.Simple, Resolution.Daily),\n                ATR = ATR(_symbol, 14, MovingAverageType.Simple, Resolution.Daily),\n                EMA = EMA(_symbol, 14, Resolution.Daily),\n                SMA = SMA(_symbol, 14, Resolution.Daily),\n                MACD = MACD(_symbol, 12, 26, 9, MovingAverageType.Simple, Resolution.Daily),\n                AROON = AROON(_symbol, 20, Resolution.Daily),\n                MOM = MOM(_symbol, 20, Resolution.Daily),\n                MOMP = MOMP(_symbol, 20, Resolution.Daily),\n                STD = STD(_symbol, 20, Resolution.Daily),\n                MIN = MIN(_symbol, 14, Resolution.Daily), // by default if the symbol is a tradebar type then it will be the min of the low property\n                MAX = MAX(_symbol, 14, Resolution.Daily),  // by default if the symbol is a tradebar type then it will be the max of the high property\n                B = B(_symbol, _symbol2, 14),\n            };\n\n            // Here we're going to define indicators using 'selector' functions. These 'selector' functions will define what data gets sent into the indicator\n            //  These functions have a signature like the following: decimal Selector(BaseData baseData), and can be defined like: baseData => baseData.Value\n            //  We'll define these 'selector' functions to select the Low value\n            //\n            //  For more information on 'anonymous functions' see: http://en.wikipedia.org/wiki/Anonymous_function\n            //                                                     https://msdn.microsoft.com/en-us/library/bb397687.aspx\n            //\n            _selectorIndicators = new Indicators\n            {\n                BB = BB(_symbol, 20, 1, MovingAverageType.Simple, Resolution.Daily, Field.Low),\n                RSI = RSI(_symbol, 14, MovingAverageType.Simple, Resolution.Daily, Field.Low),\n                EMA = EMA(_symbol, 14, Resolution.Daily, Field.Low),\n                SMA = SMA(_symbol, 14, Resolution.Daily, Field.Low),\n                MACD = MACD(_symbol, 12, 26, 9, MovingAverageType.Simple, Resolution.Daily, Field.Low),\n                MOM = MOM(_symbol, 20, Resolution.Daily, Field.Low),\n                MOMP = MOMP(_symbol, 20, Resolution.Daily, Field.Low),\n                STD = STD(_symbol, 20, Resolution.Daily, Field.Low),\n                MIN = MIN(_symbol, 14, Resolution.Daily, Field.High), // this will find the 14 day min of the high property\n                MAX = MAX(_symbol, 14, Resolution.Daily, Field.Low),  // this will find the 14 day max of the low property\n\n                // ATR and AROON are special in that they accept a TradeBar instance instead of a decimal, we could easily project and/or transform the input TradeBar\n                // before it gets sent to the ATR/AROON indicator, here we use a function that will multiply the input trade bar by a factor of two\n                ATR = ATR(_symbol, 14, MovingAverageType.Simple, Resolution.Daily, SelectorDoubleTradeBar),\n                AROON = AROON(_symbol, 20, Resolution.Daily, SelectorDoubleTradeBar)\n            };\n\n            //Custom Data Indicator:\n            _rsiCustom = RSI(_customSymbol, 14, MovingAverageType.Simple, Resolution.Daily);\n            _minCustom = MIN(_customSymbol, 14, Resolution.Daily);\n            _maxCustom = MAX(_customSymbol, 14, Resolution.Daily);\n\n            // in addition to defining indicators on a single security, you can all define 'composite' indicators.\n            // these are indicators that require multiple inputs. the most common of which is a ratio.\n            // suppose we seek the ratio of BTC to SPY, we could write the following:\n            var spyClose = Identity(_symbol);\n            var ibmClose = Identity(_customSymbol);\n            // this will create a new indicator whose value is FB/SPY\n            _ratio = ibmClose.Over(spyClose);\n            // we can also easily plot our indicators each time they update using th PlotIndicator function\n            PlotIndicator(\"Ratio\", _ratio);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_indicators.BB.IsReady || !_indicators.RSI.IsReady) return;\n\n            if (!slice.Bars.ContainsKey(_symbol))\n            {\n                return;\n            }\n            _price = slice[_symbol].Close;\n\n            if (!Portfolio.HoldStock)\n            {\n                int quantity = (int)Math.Floor(Portfolio.Cash / _price);\n\n                //Order function places trades: enter the string symbol and the quantity you want:\n                Order(_symbol, quantity);\n\n                //Debug sends messages to the user console: \"Time\" is the algorithm time keeper object\n                Debug(\"Purchased SPY on \" + Time.ToShortDateString());\n            }\n        }\n\n        /// <summary>\n        /// Fire plotting events once per day.\n        /// </summary>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol != _symbol) return;\n\n            if (!_indicators.BB.IsReady) return;\n\n            Plot(\"BB\", \"Price\", _price);\n            Plot(\"BB\", _indicators.BB.UpperBand, _indicators.BB.MiddleBand, _indicators.BB.LowerBand);\n\n            Plot(\"RSI\", _indicators.RSI);\n\n            //Custom data indicator\n            Plot(\"RSI-BTC\", _rsiCustom);\n\n            Plot(\"ATR\", _indicators.ATR);\n\n            Plot(\"STD\", _indicators.STD);\n\n            Plot(\"AROON\", _indicators.AROON.AroonUp, _indicators.AROON.AroonDown);\n\n            // The following Plot method calls are commented out because of the 10 series limit for backtests\n            //Plot(\"MOM\", _indicators.MOM);\n            //Plot(\"MOMP\", _indicators.MOMP);\n\n            //Plot(\"MACD\", \"Price\", _price);\n            //Plot(\"MACD\", _indicators.MACD.Fast, _indicators.MACD.Slow, _indicators.MACD.Signal);\n\n            //Plot(\"Averages\", _indicators.EMA, _indicators.SMA);\n        }\n\n        /// <summary>\n        /// Class to hold a bunch of different indicators for this example\n        /// </summary>\n        private class Indicators\n        {\n            public BollingerBands BB;\n            public SimpleMovingAverage SMA;\n            public ExponentialMovingAverage EMA;\n            public RelativeStrengthIndex RSI;\n            public AverageTrueRange ATR;\n            public StandardDeviation STD;\n            public AroonOscillator AROON;\n            public Momentum MOM;\n            public MomentumPercent MOMP;\n            public MovingAverageConvergenceDivergence MACD;\n            public Minimum MIN;\n            public Maximum MAX;\n            public Beta B;\n        }\n\n        /// <summary>\n        /// Function used to select a trade bar that has double the values of the input trade bar\n        /// </summary>\n        private static TradeBar SelectorDoubleTradeBar(IBaseData baseData)\n        {\n            var bar = (TradeBar)baseData;\n            return new TradeBar\n            {\n                Close = 2 * bar.Close,\n                DataType = bar.DataType,\n                High = 2 * bar.High,\n                Low = 2 * bar.Low,\n                Open = 2 * bar.Open,\n                Symbol = bar.Symbol,\n                Time = bar.Time,\n                Value = 2 * bar.Value,\n                Volume = 2 * bar.Volume,\n                Period = bar.Period\n            };\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4732;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"19.346%\"},\n            {\"Drawdown\", \"7.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"25000\"},\n            {\"End Equity\", \"35608.77\"},\n            {\"Net Profit\", \"42.435%\"},\n            {\"Sharpe Ratio\", \"1.387\"},\n            {\"Sortino Ratio\", \"1.521\"},\n            {\"Probabilistic Sharpe Ratio\", \"73.548%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.015\"},\n            {\"Beta\", \"0.963\"},\n            {\"Annual Standard Deviation\", \"0.092\"},\n            {\"Annual Variance\", \"0.008\"},\n            {\"Information Ratio\", \"-1.17\"},\n            {\"Tracking Error\", \"0.018\"},\n            {\"Treynor Ratio\", \"0.132\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$680000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.14%\"},\n            {\"Drawdown Recovery\", \"50\"},\n            {\"OrderListHash\", \"7d49829d56cb3055b5f609a91b85fe4d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorVolatilityModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm illustrating the usage of the <see cref=\"IndicatorVolatilityModel\"/> and\n    /// how to handle splits and dividends to avoid price discontinuities\n    /// </summary>\n    public class IndicatorVolatilityModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int _indicatorPeriods = 7;\n\n        private const DataNormalizationMode _dataNormalizationMode = DataNormalizationMode.Raw;\n\n        private Symbol _aapl;\n\n        private IIndicator _indicator;\n\n        private int _splitsAndDividendsCount;\n\n        private bool _volatilityChecked;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 1, 1);\n            SetEndDate(2014, 12, 31);\n            SetCash(100000);\n\n            var equity = AddEquity(\"AAPL\", Resolution.Daily, dataNormalizationMode: _dataNormalizationMode);\n            _aapl = equity.Symbol;\n\n            var std = new StandardDeviation(_indicatorPeriods);\n            var mean = new SimpleMovingAverage(_indicatorPeriods);\n            _indicator = std.Over(mean);\n            equity.SetVolatilityModel(new IndicatorVolatilityModel(_indicator, (_, data, _) =>\n            {\n                if (data.Price > 0)\n                {\n                    std.Update(data.Time, data.Price);\n                    mean.Update(data.Time, data.Price);\n                }\n            }));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.ContainsKey(_aapl) || slice.Dividends.ContainsKey(_aapl))\n            {\n                _splitsAndDividendsCount++;\n\n                // On a split or dividend event, we need to reset and warm the indicator up as Lean does to BaseVolatilityModel's\n                // to avoid big jumps in volatility due to price discontinuities\n                _indicator.Reset();\n                var equity = Securities[_aapl];\n                var volatilityModel = equity.VolatilityModel as IndicatorVolatilityModel;\n                volatilityModel.WarmUp(this, equity, equity.Resolution, _indicatorPeriods, _dataNormalizationMode);\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol != _aapl || !_indicator.IsReady)\n            {\n                return;\n            }\n\n            _volatilityChecked = true;\n\n            // This is expected only in this case, 0.05 is not a magical number of any kind.\n            // Just making sure we don't get big jumps on volatility\n            var volatility = Securities[_aapl].VolatilityModel.Volatility;\n            if (volatility <= 0 || volatility > 0.05m)\n            {\n                throw new RegressionTestException(\n                    \"Expected volatility to stay less than 0.05 (not big jumps due to price discontinuities on splits and dividends), \" +\n                    $\"but got {volatility}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_splitsAndDividendsCount == 0)\n            {\n                throw new RegressionTestException(\"Expected to get at least one split or dividend event\");\n            }\n\n            if (!_volatilityChecked)\n            {\n                throw new RegressionTestException(\"Expected to check volatility at least once\");\n            }\n        }\n\n        private IIndicator UpdateIndicator(Security security, TradeBar bar)\n        {\n            _indicator.Update(bar);\n\n            return _indicator;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2021;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 42;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.025\"},\n            {\"Tracking Error\", \"0.094\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorWarmupAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test for history and warm up using the data available in open source.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"warm up\" />\n    public class IndicatorWarmupAlgorithm : QCAlgorithm\n    {\n        private const string SPY    = \"SPY\";\n        private const string GOOG   = \"GOOG\";\n        private const string IBM    = \"IBM\";\n        private const string BAC    = \"BAC\";\n        private const string GOOGL  = \"GOOGL\";\n\n        private readonly Dictionary<Symbol, SymbolData> _sd = new Dictionary<Symbol, SymbolData>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 11);\n\n            SetCash(1000000);\n\n            AddSecurity(SecurityType.Equity, SPY, Resolution.Minute);\n            AddSecurity(SecurityType.Equity, IBM, Resolution.Minute);\n            AddSecurity(SecurityType.Equity, BAC, Resolution.Minute);\n\n            AddSecurity(SecurityType.Equity, GOOG, Resolution.Daily);\n            AddSecurity(SecurityType.Equity, GOOGL, Resolution.Daily);\n\n            foreach (var security in Securities)\n            {\n                _sd.Add(security.Key, new SymbolData(security.Key, this));\n            }\n\n            // we want to warm up our algorithm\n            SetWarmup(SymbolData.RequiredBarsWarmup);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // we are only using warmup for indicator spooling, so wait for us to be warm then continue\n            if (IsWarmingUp) return;\n\n            foreach (var sd in _sd.Values)\n            {\n                var lastPriceTime = sd.Close.Current.Time;\n                // only make decisions when we have data on our requested resolution\n                if (lastPriceTime.RoundDown(sd.Security.Resolution.ToTimeSpan()) == lastPriceTime)\n                {\n                    sd.Update();\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            SymbolData sd;\n            if (_sd.TryGetValue(orderEvent.Symbol, out sd))\n            {\n                sd.OnOrderEvent(orderEvent);\n            }\n        }\n\n        class SymbolData\n        {\n            public const int RequiredBarsWarmup = 40;\n            public const decimal PercentTolerance = 0.001m;\n            public const decimal PercentGlobalStopLoss = 0.01m;\n            private const int LotSize = 10;\n\n            public readonly Symbol Symbol;\n            public readonly Security Security;\n\n            public decimal Quantity\n            {\n                get { return Security.Holdings.Quantity; }\n            }\n\n            public readonly Identity Close;\n            public readonly AverageDirectionalIndex ADX;\n            public readonly ExponentialMovingAverage EMA;\n            public readonly MovingAverageConvergenceDivergence MACD;\n\n            private readonly QCAlgorithm _algorithm;\n\n            private OrderTicket _currentStopLoss;\n\n            public SymbolData(Symbol symbol, QCAlgorithm algorithm)\n            {\n                Symbol = symbol;\n                Security = algorithm.Securities[symbol];\n\n                Close = algorithm.Identity(symbol);\n                ADX = algorithm.ADX(symbol, 14);\n                EMA = algorithm.EMA(symbol, 14);\n                MACD = algorithm.MACD(symbol, 12, 26, 9, MovingAverageType.Simple);\n\n                // if we're receiving daily\n\n                _algorithm = algorithm;\n            }\n\n            public bool IsReady\n            {\n                get { return Close.IsReady && ADX.IsReady & EMA.IsReady && MACD.IsReady; }\n            }\n\n            public bool IsUptrend\n            {\n                get\n                {\n                    const decimal tolerance = 1 + PercentTolerance;\n\n                    return MACD.Signal > MACD*tolerance\n                        && EMA > Close*tolerance;\n                }\n            }\n\n            public bool IsDowntrend\n            {\n                get\n                {\n                    const decimal tolerance = 1 - PercentTolerance;\n\n                    return MACD.Signal < MACD*tolerance\n                        && EMA < Close*tolerance;\n                }\n            }\n\n            public void OnOrderEvent(OrderEvent fill)\n            {\n                if (fill.Status != OrderStatus.Filled)\n                {\n                    return;\n                }\n\n                // if we just finished entering, place a stop loss as well\n                if (Security.Invested)\n                {\n                    var stop = Security.Holdings.IsLong\n                        ? fill.FillPrice*(1 - PercentGlobalStopLoss)\n                        : fill.FillPrice*(1 + PercentGlobalStopLoss);\n\n                    _currentStopLoss = _algorithm.StopMarketOrder(Symbol, -Quantity, stop, tag: \"StopLoss at: \" + stop);\n                }\n                // check for an exit, cancel the stop loss\n                else\n                {\n                    if (_currentStopLoss != null && _currentStopLoss.Status.IsOpen())\n                    {\n                        // cancel our current stop loss\n                        _currentStopLoss.Cancel(\"Exited position\");\n                        _currentStopLoss = null;\n                    }\n                }\n            }\n\n            public void Update()\n            {\n                OrderTicket ticket;\n                TryEnter(out ticket);\n                TryExit(out ticket);\n            }\n\n            public bool TryEnter(out OrderTicket ticket)\n            {\n                ticket = null;\n                if (Security.Invested)\n                {\n                    // can't enter if we're already in\n                    return false;\n                }\n\n                int qty = 0;\n                decimal limit = 0m;\n                if (IsUptrend)\n                {\n                    // 100 order lots\n                    qty = LotSize;\n                    limit = Security.Low;\n                }\n                else if (IsDowntrend)\n                {\n                    limit = Security.High;\n                    qty = -LotSize;\n                }\n                if (qty != 0)\n                {\n                    ticket = _algorithm.LimitOrder(Symbol, qty, limit, tag: \"TryEnter at: \" + limit);\n                }\n                return qty != 0;\n            }\n\n            public bool TryExit(out OrderTicket ticket)\n            {\n                const decimal exitTolerance = 1 + 2 * PercentTolerance;\n\n                ticket = null;\n                if (!Security.Invested)\n                {\n                    // can't exit if we haven't entered\n                    return false;\n                }\n\n                decimal limit = 0m;\n                if (Security.Holdings.IsLong && Close*exitTolerance < EMA)\n                {\n                    limit = Security.High;\n                }\n                else if (Security.Holdings.IsShort && Close > EMA*exitTolerance)\n                {\n                    limit = Security.Low;\n                }\n                if (limit != 0)\n                {\n                    ticket = _algorithm.LimitOrder(Symbol, -Quantity, limit, tag: \"TryExit at: \" + limit);\n                }\n                return -Quantity != 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndicatorWithRenkoBarsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert we can update indicators that inherit from <see cref=\"IndicatorBase\"/> with RenkoBar's\n    /// </summary>\n    public class IndicatorWithRenkoBarsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private MassIndex _mi;\n        private WilderAccumulativeSwingIndex _wasi;\n        private WilderSwingIndex _wsi;\n        private Beta _b;\n        private List<IIndicator> _indicators;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 09);\n\n            AddEquity(\"SPY\");\n            AddEquity(\"AIG\");\n\n            var spyRenkoBarConsolidator = new RenkoConsolidator<TradeBar>(0.1m);\n            spyRenkoBarConsolidator.DataConsolidated += OnSPYDataConsolidated;\n\n            var aigRenkoBarConsolidator = new RenkoConsolidator<TradeBar>(0.05m);\n            aigRenkoBarConsolidator.DataConsolidated += OnAIGDataConsolidated;\n\n            SubscriptionManager.AddConsolidator(\"SPY\", spyRenkoBarConsolidator);\n            SubscriptionManager.AddConsolidator(\"AIG\", aigRenkoBarConsolidator);\n\n            _mi = new MassIndex(\"MassIndex\", 9, 25);\n            _wasi = new WilderAccumulativeSwingIndex(\"WilderAccumulativeSwingIndex\", 8);\n            _wsi = new WilderSwingIndex(\"WilderSwingIndex\", 8);\n            _b = new Beta(\"Beta\", \"AIG\", \"SPY\", 3);\n            _indicators = new List<IIndicator>() { _mi, _wasi, _wsi, _b };\n        }\n\n        public void OnSPYDataConsolidated(object sender, RenkoBar renkoBar)\n        {\n            _mi.Update(renkoBar);\n            _wasi.Update(renkoBar);\n            _wsi.Update(renkoBar);\n            _b.Update(renkoBar);\n        }\n\n        public void OnAIGDataConsolidated(object sender, RenkoBar renkoBar)\n        {\n            _b.Update(renkoBar);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var indicator in _indicators)\n            {\n                if (!indicator.IsReady)\n                {\n                    throw new RegressionTestException($\"{indicator.Name} indicator should be ready\");\n                }\n                else if (indicator.Current.Value == 0)\n                {\n                    throw new RegressionTestException($\"The current value of {indicator.Name} indicator should be different than zero\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4709;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.524\"},\n            {\"Tracking Error\", \"0.136\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IndustryStandardSecurityIdentifiersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm illustrating how to get a security's industry-standard identifier from its <see cref=\"Symbol\"/>\n    /// </summary>\n    public class IndustryStandardSecurityIdentifiersRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 05);\n\n            var equity = AddEquity(\"AAPL\").Symbol;\n\n            var cusip = equity.CUSIP;\n            var compositeFigi = equity.CompositeFIGI;\n            var sedol = equity.SEDOL;\n            var isin = equity.ISIN;\n            var cik = equity.CIK;\n\n            CheckSymbolRepresentation(cusip, \"CUSIP\");\n            CheckSymbolRepresentation(compositeFigi, \"Composite FIGI\");\n            CheckSymbolRepresentation(sedol, \"SEDOL\");\n            CheckSymbolRepresentation(isin, \"ISIN\");\n            CheckSymbolRepresentation($\"{cik}\", \"CIK\");\n\n            // Check Symbol API vs QCAlgorithm API\n            CheckAPIsSymbolRepresentations(cusip, CUSIP(equity), \"CUSIP\");\n            CheckAPIsSymbolRepresentations(compositeFigi, CompositeFIGI(equity), \"Composite FIGI\");\n            CheckAPIsSymbolRepresentations(sedol, SEDOL(equity), \"SEDOL\");\n            CheckAPIsSymbolRepresentations(isin, ISIN(equity), \"ISIN\");\n            CheckAPIsSymbolRepresentations($\"{cik}\", $\"{CIK(equity)}\", \"CIK\");\n\n            Log($\"\\nAAPL CUSIP: {cusip}\" +\n                $\"\\nAAPL Composite FIGI: {compositeFigi}\" +\n                $\"\\nAAPL SEDOL: {sedol}\" +\n                $\"\\nAAPL ISIN: {isin}\" +\n                $\"\\nAAPL CIK: {cik}\");\n        }\n\n        private static void CheckSymbolRepresentation(string symbol, string standard)\n        {\n            if (symbol.IsNullOrEmpty())\n            {\n                throw new RegressionTestException($\"{standard} symbol representation is null or empty\");\n            }\n        }\n\n        private static void CheckAPIsSymbolRepresentations(string symbolApiSymbol, string algorithmApiSymbol, string standard)\n        {\n            if (symbolApiSymbol != algorithmApiSymbol)\n            {\n                throw new RegressionTestException($@\"Symbol API {standard} symbol representation ({symbolApiSymbol}) does not match QCAlgorithm API {\n                    standard} symbol representation ({algorithmApiSymbol})\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InsightScoringRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm showing how to define a custom insight scoring function and using the insight manager\n    /// </summary>\n    public class InsightScoringRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Resolution.Daily));\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.01m));\n\n            // we specify a custom insight score function\n            Insights.SetInsightScoreFunction(new CustomInsightScoreFunction(Securities));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var allInsights = Insights.GetInsights(insight => true);\n\n            if(allInsights.Count != 100 || Insights.GetInsights().Count != 100)\n            {\n                throw new RegressionTestException($\"Unexpected insight count found {allInsights.Count}\");\n            }\n\n            if(allInsights.Count(insight => insight.Score.Magnitude == 0 || insight.Score.Direction == 0) < 5)\n            {\n                throw new RegressionTestException($\"Insights not scored!\");\n            }\n\n            if (allInsights.Count(insight => insight.Score.IsFinalScore) < 99)\n            {\n                throw new RegressionTestException($\"Insights not finalized!\");\n            }\n        }\n\n        private class CustomInsightScoreFunction : IInsightScoreFunction\n        {\n            private readonly Dictionary<Guid, Insight> _openInsights = new();\n            private SecurityManager _securities;\n\n            public CustomInsightScoreFunction(SecurityManager securities)\n            {\n                _securities = securities;\n            }\n\n            public void Score(InsightManager insightManager, DateTime utcTime)\n            {\n                var openInsights = insightManager.GetActiveInsights(utcTime);\n\n                foreach (var insight in openInsights)\n                {\n                    _openInsights[insight.Id] = insight;\n                }\n\n                List<Insight> toRemove = new();\n                foreach (var kvp in _openInsights)\n                {\n                    var openInsight = kvp.Value;\n\n                    var security = _securities[openInsight.Symbol];\n                    openInsight.ReferenceValueFinal = security.Price;\n\n                    var score = openInsight.ReferenceValueFinal - openInsight.ReferenceValue;\n                    openInsight.Score.SetScore(InsightScoreType.Direction, (double)score, utcTime);\n                    openInsight.Score.SetScore(InsightScoreType.Magnitude, (double)score * 2, utcTime);\n                    openInsight.EstimatedValue = score * 100;\n\n                    if (openInsight.IsExpired(utcTime))\n                    {\n                        openInsight.Score.Finalize(utcTime);\n                        toRemove.Add(openInsight);\n                    }\n                }\n\n                // clean up\n                foreach (var insightToRemove in toRemove)\n                {\n                    _openInsights.Remove(insightToRemove.Id);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.01%\"},\n            {\"Compounding Annual Return\", \"261.134%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101655.30\"},\n            {\"Net Profit\", \"1.655%\"},\n            {\"Sharpe Ratio\", \"8.472\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.840%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.091\"},\n            {\"Beta\", \"1.006\"},\n            {\"Annual Standard Deviation\", \"0.224\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-33.445\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"1.885\"},\n            {\"Total Fees\", \"$10.32\"},\n            {\"Estimated Strategy Capacity\", \"$27000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"59.86%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"f209ed42701b0419858e0100595b40c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InsightTagAlphaRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm generating insights with custom tags\n    /// </summary>\n    public class InsightTagAlphaRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private Symbol _fb;\n        private Symbol _ibm;\n\n        private List<Symbol> _symbolsWithGeneratedInsights = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            _fb = QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA);\n            _ibm = QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(_spy, _fb, _ibm));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            AddAlpha(new OneTimeAlphaModel(_spy));\n            AddAlpha(new OneTimeAlphaModel(_fb));\n            AddAlpha(new OneTimeAlphaModel(_ibm));\n\n            InsightsGenerated += OnInsightsGeneratedVerifier;\n        }\n\n        private void OnInsightsGeneratedVerifier(IAlgorithm algorithm,\n            GeneratedInsightsCollection insightsCollection)\n        {\n            foreach (var insight in insightsCollection.Insights)\n            {\n                if (insight.Tag != OneTimeAlphaModel.GenerateInsightTag(insight.Symbol))\n                {\n                    throw new RegressionTestException(\"Unexpected insight tag was emitted\");\n                }\n\n                _symbolsWithGeneratedInsights.Add(insight.Symbol);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_symbolsWithGeneratedInsights.Count != 3)\n            {\n                throw new RegressionTestException(\"Unexpected number of symbols with generated insights\");\n            }\n\n            if (!_symbolsWithGeneratedInsights.Contains(_spy))\n            {\n                throw new RegressionTestException(\"SPY symbol was not found in symbols with generated insights\");\n            }\n\n            if (!_symbolsWithGeneratedInsights.Contains(_fb))\n            {\n                throw new RegressionTestException(\"FB symbol was not found in symbols with generated insights\");\n            }\n\n            if (!_symbolsWithGeneratedInsights.Contains(_ibm))\n            {\n                throw new RegressionTestException(\"IBM symbol was not found in symbols with generated insights\");\n            }\n        }\n\n        private class OneTimeAlphaModel : AlphaModel\n        {\n            private readonly Symbol _symbol;\n            private bool _triggered;\n\n            public OneTimeAlphaModel(Symbol symbol)\n            {\n                _symbol = symbol;\n            }\n\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                if (!_triggered)\n                {\n                    _triggered = true;\n                    yield return Insight.Price(\n                        _symbol,\n                        Resolution.Daily,\n                        1,\n                        InsightDirection.Down,\n                        tag: GenerateInsightTag(_symbol)\n                        );\n                }\n            }\n\n            public static string GenerateInsightTag(Symbol symbol)\n            {\n                return $\"Insight generated for {symbol}\";\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 58;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.86%\"},\n            {\"Average Loss\", \"-0.27%\"},\n            {\"Compounding Annual Return\", \"206.404%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"1.781\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101441.92\"},\n            {\"Net Profit\", \"1.442%\"},\n            {\"Sharpe Ratio\", \"4.836\"},\n            {\"Sortino Ratio\", \"10.481\"},\n            {\"Probabilistic Sharpe Ratio\", \"59.497%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"3.17\"},\n            {\"Alpha\", \"4.164\"},\n            {\"Beta\", \"-1.322\"},\n            {\"Annual Standard Deviation\", \"0.321\"},\n            {\"Annual Variance\", \"0.103\"},\n            {\"Information Ratio\", \"-0.795\"},\n            {\"Tracking Error\", \"0.532\"},\n            {\"Treynor Ratio\", \"-1.174\"},\n            {\"Total Fees\", \"$14.78\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"41.18%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"713c956deb193bed2290e9f379c0f9f9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InsightWeightingFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm using <see cref=\"InsightWeightingPortfolioConstructionModel\"/> and <see cref=\"ConstantAlphaModel\"/>\n    /// generating a constant <see cref=\"Insight\"/> with a 0.25 weight\n    /// </summary>\n    public class InsightWeightingFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // set algorithm framework models\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null, 0.25));\n            SetPortfolioConstruction(new InsightWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (// holdings value should be 0.25 - to avoid price fluctuation issue we compare with 0.28 and 0.23\n                Portfolio.TotalHoldingsValue > Portfolio.TotalPortfolioValue * 0.28m\n                ||\n                Portfolio.TotalHoldingsValue < Portfolio.TotalPortfolioValue * 0.23m)\n            {\n                throw new RegressionTestException($\"Unexpected Total Holdings Value: {Portfolio.TotalHoldingsValue}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"39.071%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"-0.028\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100422.57\"},\n            {\"Net Profit\", \"0.423%\"},\n            {\"Sharpe Ratio\", \"5.481\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.478%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.94\"},\n            {\"Alpha\", \"-0.188\"},\n            {\"Beta\", \"0.248\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-9.998\"},\n            {\"Tracking Error\", \"0.167\"},\n            {\"Treynor Ratio\", \"1.22\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$45000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"5.15%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"ae4986890fe7ab09ddb93059888f34c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that a short option position is auto exercised even when there is insufficient margin,\n    /// but triggering a margin call for the underlying stock to cover the assignment.\n    /// </summary>\n    public class InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _stock;\n        private Symbol _option;\n\n        private bool _stockBought;\n        private bool _optionSold;\n        private bool _optionAssigned;\n        private bool _marginCallReceived;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            _stock = AddEquity(\"GOOG\").Symbol;\n\n            var contracts = OptionChain(_stock).ToList();\n            _option = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Put)\n                .OrderBy(c => c.ID.Date)\n                .First(c => c.ID.StrikePrice == 800m);\n\n            AddOptionContract(_option);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // We are done with buying\n            if (_stockBought && _optionSold)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                // We'll use all our buying power to buy the stock, so when we then open a short put position,\n                // the margin will not be enough to cover the automatic exercise\n                SetHoldings(_stock, 1);\n            }\n\n            if (_stockBought && Securities[_option].Price != 0)\n            {\n                MarketOrder(_option, -2);\n            }\n        }\n\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            if (!_optionAssigned)\n            {\n                throw new RegressionTestException(\"Expected option to have been assigned before the margin call \" +\n                    \"(which should have been triggered by the auto-exercise of the option with inssuficient margin).\");\n            }\n\n            if (_marginCallReceived)\n            {\n                throw new RegressionTestException(\"Received multiple margin calls. Expected just one.\");\n            }\n\n            var request = requests.Single();\n            if (request.Symbol != _stock)\n            {\n                throw new RegressionTestException(\"Expected margin call for the stock, but got margin call for: \" + request.Symbol);\n            }\n\n            _marginCallReceived = true;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            Debug($\"{Time} :: {order.Id} - {order.Type} - {orderEvent.Symbol}: {orderEvent.Status} - {orderEvent.Quantity} shares at {orderEvent.FillPrice}\");\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                if (orderEvent.Symbol == _stock)\n                {\n                    _stockBought = true;\n                }\n                else if (orderEvent.Symbol == _option)\n                {\n                    if (order.Type == OrderType.Market)\n                    {\n                        if (!_stockBought)\n                        {\n                            throw new RegressionTestException(\"Stock should have been bought first\");\n                        }\n\n                        _optionSold = true;\n                    }\n                    else if (order.Type == OrderType.OptionExercise && orderEvent.IsAssignment)\n                    {\n                        if (!_optionSold)\n                        {\n                            throw new RegressionTestException(\"Option should have been sold first\");\n                        }\n\n                        _optionAssigned = true;\n                    }\n                }\n                else\n                {\n                    throw new RegressionTestException(\"Unexpected symbol: \" + orderEvent.Symbol);\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_stockBought)\n            {\n                throw new RegressionTestException(\"Stock was not bought\");\n            }\n\n            if (!_optionSold)\n            {\n                throw new RegressionTestException(\"Option was not sold\");\n            }\n\n            if (!_optionAssigned)\n            {\n                throw new RegressionTestException(\"Option was not assigned\");\n            }\n\n            if (!_marginCallReceived)\n            {\n                throw new RegressionTestException(\"Margin call was not received\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2822;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"8.96%\"},\n            {\"Average Loss\", \"-1.95%\"},\n            {\"Compounding Annual Return\", \"-67.963%\"},\n            {\"Drawdown\", \"2.900%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98248.35\"},\n            {\"Net Profit\", \"-1.752%\"},\n            {\"Sharpe Ratio\", \"-6.542\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.125%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"4.60\"},\n            {\"Alpha\", \"-0.007\"},\n            {\"Beta\", \"1.181\"},\n            {\"Annual Standard Deviation\", \"0.036\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-1.422\"},\n            {\"Tracking Error\", \"0.03\"},\n            {\"Treynor Ratio\", \"-0.2\"},\n            {\"Total Fees\", \"$3.30\"},\n            {\"Estimated Strategy Capacity\", \"$2400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ20WLZZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"54.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2f22fc5e9584c2d201b9e0b767a7160d\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/InsufficientMarginOrderUpdateRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests order updates with margin constraints to ensure that orders become invalid when exceeding margin requirements.\n    /// </summary>\n    public class InsufficientMarginOrderUpdateRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _stopOrderTicket;\n        private OrderTicket _limitOrderTicket;\n        private OrderTicket _trailingStopOrderTicket;\n        private bool _updatesReady;\n        private bool _updatesInProgress;\n        private int _updateEventsCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 3);\n            SetEndDate(2018, 4, 4);\n            AddForex(\"EURUSD\", Resolution.Minute);\n            _updatesInProgress = true;\n            _updateEventsCount = 0;\n        }\n\n        public override void OnData(Slice data)\n        {\n\n            if (!Portfolio.Invested)\n            {\n                var qty = CalculateOrderQuantity(\"EURUSD\", 50m);\n\n                MarketOrder(\"EURUSD\", qty);\n\n                // Place stop market, limit, and trailing stop orders with half the quantity\n                _stopOrderTicket = StopMarketOrder(\"EURUSD\", -qty / 2, Securities[\"EURUSD\"].Price - 0.003m);\n                _limitOrderTicket = LimitOrder(\"EURUSD\", -qty / 2, Securities[\"EURUSD\"].Price - 0.003m);\n                _trailingStopOrderTicket = TrailingStopOrder(\"EURUSD\", -qty / 2, Securities[\"EURUSD\"].Price - 0.003m, 0.01m, true);\n\n                // Update the stop order \n                var updateStopOrderSettings = new UpdateOrderFields\n                {\n                    // Attempt to increase the order quantity significantly\n                    Quantity = -qty * 100,\n                    StopPrice = Securities[\"EURUSD\"].Price - 0.003m\n                };\n                _stopOrderTicket.Update(updateStopOrderSettings);\n\n                // Update limit order\n                var updateLimitOrderSettings = new UpdateOrderFields\n                {\n                    // Attempt to increase the order quantity significantly\n                    Quantity = -qty * 100,\n                    LimitPrice = Securities[\"EURUSD\"].Price - 0.003m\n                };\n                _limitOrderTicket.Update(updateLimitOrderSettings);\n\n                // Update trailing stop order\n                var updateTrailingStopOrderSettings = new UpdateOrderFields\n                {\n                    // Attempt to increase the order quantity significantly\n                    Quantity = -qty * 100,\n                    StopPrice = Securities[\"EURUSD\"].Price - 0.003m,\n                    TrailingAmount = 0.01m,\n                };\n                _trailingStopOrderTicket.Update(updateTrailingStopOrderSettings);\n                _updatesReady = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (_updatesReady && _updatesInProgress)\n            {\n                if (orderEvent.Status != OrderStatus.Submitted)\n                {\n                    throw new RegressionTestException($\"Unexpected order event status {orderEvent.Status} received. Expected Submitted.\");\n                }\n                // All updates have been enqueued and should be rejected one by one\n                if (orderEvent.OrderId == _stopOrderTicket.OrderId && !orderEvent.Message.Contains(\"Brokerage failed to update order\"))\n                {\n                    throw new RegressionTestException($\"The stop order update should have been rejected due to insufficient margin\");\n                }\n\n                if (orderEvent.Id == _limitOrderTicket.OrderId && !orderEvent.Message.Contains(\"Brokerage failed to update order\"))\n                {\n                    throw new RegressionTestException($\"The limit order update should have been rejected due to insufficient margin\");\n                }\n\n                if (orderEvent.Id == _trailingStopOrderTicket.OrderId && !orderEvent.Message.Contains(\"Brokerage failed to update order\"))\n                {\n                    throw new RegressionTestException($\"The trailing stop order update should have been rejected due to insufficient margin\");\n                }\n                _updateEventsCount++;\n            }\n            if (_updateEventsCount >= 3)\n            {\n                _updatesInProgress = false;\n            }\n\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Updates were rejected, so all orders should be in Filled status\n            var orders = Transactions.GetOrders().ToList();\n            foreach (var order in orders)\n            {\n                if (order.Status != OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Order {order.Id} with symbol {order.Symbol} should have been filled, but its current status is {order.Status}.\");\n                }\n            }\n            if (!_updatesReady)\n            {\n                throw new RegressionTestException(\"Update Orders should be ready!\");\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2893;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"90809.64\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$99000.00\"},\n            {\"Lowest Capacity Asset\", \"EURUSD 8G\"},\n            {\"Portfolio Turnover\", \"6777.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"505feaf1ae70ead2d7ab78ea257d7342\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that InteractiveBrokers brokerage model does not support index options exercise\n    /// </summary>\n    public class InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Option _option;\n\n        private OptionContract _contract;\n\n        private bool _marketOrderDone;\n\n        private bool _triedExercise;\n\n        private bool _automaticallyExercised;\n\n        private decimal _initialCash = 200000;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 30);\n            SetCash(_initialCash);\n\n            SetBrokerageModel(new InteractiveBrokersBrokerageModel());\n\n            var index = AddIndex(\"SPX\", Resolution.Hour, fillForward: true);\n            var indexOption = AddIndexOption(index.Symbol, Resolution.Hour, fillForward: true);\n            indexOption.SetFilter(filterFunc => filterFunc.CallsOnly());\n\n            _option = indexOption;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_triedExercise || !_option.Exchange.ExchangeOpen)\n            {\n                return;\n            }\n\n            if (_contract == null)\n            {\n                OptionChain contracts;\n                if (!slice.OptionChains.TryGetValue(_option.Symbol, out contracts) || !contracts.Any())\n                {\n                    return;\n                }\n\n                _contract = contracts.First();\n            }\n\n            var expiry = _contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone).Date;\n\n            if (UtcTime.Date < expiry && !_marketOrderDone)\n            {\n                if (MarketOrder(_contract.Symbol, 1).Status != OrderStatus.Filled)\n                {\n                    throw new RegressionTestException(\"Expected market order to fill immediately\");\n                }\n\n                _marketOrderDone = true;\n\n                return;\n            }\n\n            if (!_triedExercise && UtcTime.Date == expiry)\n            {\n                if (ExerciseOption(_contract.Symbol, 1).Status == OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Expected index option to not be exercisable on its expiration date. \" +\n                                        $\"Time: {UtcTime}. Expiry: {_contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone)}\");\n                }\n\n                _triedExercise = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // The manual exercise failed and we are not placing any other orders, so this is the automatic exercise\n            if (orderEvent.Status == OrderStatus.Filled &&\n                _marketOrderDone &&\n                _triedExercise &&\n                UtcTime.Date >= _contract.Expiry.ConvertToUtc(_option.Exchange.TimeZone).Date)\n            {\n                var profit = Portfolio.TotalPortfolioValue - _initialCash;\n                if (profit < 0)\n                {\n                    throw new RegressionTestException($\"Expected profit to be positive. Actual: {profit}\");\n                }\n\n                _automaticallyExercised = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_triedExercise)\n            {\n                throw new RegressionTestException(\"Expected to try to exercise index option before and on expiry\");\n            }\n\n            if (!_automaticallyExercised || Portfolio.Cash <= _initialCash)\n            {\n                throw new RegressionTestException(\"Expected index option to have ben automatically exercised on expiry and to have received cash\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all time slices of algorithm\n        /// </summary>\n        public long DataPoints => 1108;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"2.19%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"36.041%\"},\n            {\"Drawdown\", \"3.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"204383\"},\n            {\"Net Profit\", \"2.192%\"},\n            {\"Sharpe Ratio\", \"4.088\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"89.872%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.177\"},\n            {\"Annual Variance\", \"0.031\"},\n            {\"Information Ratio\", \"4.102\"},\n            {\"Tracking Error\", \"0.177\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$420000.00\"},\n            {\"Lowest Capacity Asset\", \"SPX XL80P3GHIA9A|SPX 31\"},\n            {\"Portfolio Turnover\", \"1.09%\"},\n            {\"Drawdown Recovery\", \"10\"},\n            {\"OrderListHash\", \"e913c917ccb2641d70e8fffb47df4f02\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/InternalSubscriptionHistoryRequestAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting data returned by a history requests uses internal subscriptions correctly\n    /// </summary>\n    public class InternalSubscriptionHistoryRequestAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"AAPL\", Resolution.Hour);\n            SetBenchmark(\"SPY\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"AAPL\", 1);\n\n                var spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n                var history = History(new[] { spy }, TimeSpan.FromDays(10));\n                if (!history.Any() || !history.All(slice => slice.Bars.All(pair => pair.Value.Period == TimeSpan.FromHours(1))))\n                {\n                    throw new RegressionTestException(\"Unexpected history result for internal subscription\");\n                }\n\n                // we add SPY using Daily > default benchmark using hourly\n                AddEquity(\"SPY\", Resolution.Daily);\n\n                history = History(new[] { spy }, TimeSpan.FromDays(10));\n                if (!history.Any() || !history.All(slice => slice.Bars.All(pair => pair.Value.Period == TimeSpan.FromHours(6.5))))\n                {\n                    throw new RegressionTestException(\"Unexpected history result for user subscription\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 108;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 48;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.768%\"},\n            {\"Drawdown\", \"2.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100382.23\"},\n            {\"Net Profit\", \"0.382%\"},\n            {\"Sharpe Ratio\", \"5.446\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"60.047%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.107\"},\n            {\"Beta\", \"0.548\"},\n            {\"Annual Standard Deviation\", \"0.179\"},\n            {\"Annual Variance\", \"0.032\"},\n            {\"Information Ratio\", \"-6.047\"},\n            {\"Tracking Error\", \"0.165\"},\n            {\"Treynor Ratio\", \"1.78\"},\n            {\"Total Fees\", \"$32.11\"},\n            {\"Estimated Strategy Capacity\", \"$66000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.08%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"fa51af977e55213dc007a38a3d681b62\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IronCondorStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Iron Condor strategy.\n    /// </summary>\n    public class IronCondorStrategyAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        protected override int ExpectedOrdersCount { get; } = 8;\n\n        private OptionStrategy _ironCondor;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            foreach (var group in chain.GroupBy(x => x.Expiry))\n            {\n                var expiry = group.Key;\n                var contracts = group.OrderBy(x => x.Strike).ToList();\n                if (contracts.Count < 4) continue;\n\n                var putContracts = contracts.Where(x => x.Right == OptionRight.Put).ToList();\n                if (putContracts.Count < 2) continue;\n                var longPutStrike = putContracts[0].Strike;\n                var shortPutStrike = putContracts[1].Strike;\n\n                var callContracts = contracts.Where(x => x.Right == OptionRight.Call && x.Strike > shortPutStrike).ToList();\n                if (callContracts.Count < 2) continue;\n                var shortCallStrike = callContracts[0].Strike;\n                var longCallStrike = callContracts[1].Strike;\n\n                _ironCondor = OptionStrategies.IronCondor(_optionSymbol, longPutStrike, shortPutStrike, shortCallStrike, longCallStrike, expiry);\n                Buy(_ironCondor, 2);\n                break;\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 4)\n            {\n                throw new RegressionTestException($\"Expected position group to have 4 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var orderedStrikes = _ironCondor.OptionLegs.Select(leg => leg.Strike).OrderBy(x => x).ToArray();\n\n            var longPutStrike = orderedStrikes[0];\n            var longPutPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.StrikePrice == longPutStrike);\n            if (longPutPosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected long put position quantity to be 2. Actual: {longPutPosition.Quantity}\");\n            }\n\n            var shortPutStrike = orderedStrikes[1];\n            var shortPutPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.StrikePrice == shortPutStrike);\n            if (shortPutPosition.Quantity != -2)\n            {\n                throw new RegressionTestException($\"Expected short put position quantity to be -2. Actual: {shortPutPosition.Quantity}\");\n            }\n\n            var shortCallStrike = orderedStrikes[2];\n            var shortCallPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.StrikePrice == shortCallStrike);\n            if (shortCallPosition.Quantity != -2)\n            {\n                throw new RegressionTestException($\"Expected short call position quantity to be -2. Actual: {shortCallPosition.Quantity}\");\n            }\n\n            var longCallStrike = orderedStrikes[3];\n            var longCallPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.StrikePrice == longCallStrike);\n            if (longCallPosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected long call position quantity to be 2. Actual: {longCallPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position by selling the strategy\n            Sell(_ironCondor, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999149.6\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$10.40\"},\n            {\"Estimated Strategy Capacity\", \"$4000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"690651f39abc866e9749e12a1096a79c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that IsMarketOpen is working as expected\n    /// </summary>\n    public class IsMarketOpenCheckAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Symbol Symbol { get; set; }\n\n        protected virtual bool ExtendedMarketHours { get; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            Symbol = AddEquity(\"SPY\", Resolution.Minute, extendedMarketHours: ExtendedMarketHours).Symbol;\n        }\n\n        protected void AssertIsMarketOpen(bool expected)\n        {\n            var isMarketOpen = IsMarketOpen(Symbol);\n            Log($\"IsMarketOpen at {Time}?: {isMarketOpen}\");\n            if (isMarketOpen != expected)\n            {\n                throw new RegressionTestException($\"Expected IsMarketOpen to be {expected} at {Time}.\");\n            }\n        }\n\n        protected virtual void ScheduleMarketOpenChecks()\n        {\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(4, 0, 0),\n                () => AssertIsMarketOpen(expected: false));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(9, 29, 59),\n                () => AssertIsMarketOpen(expected: false));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(9, 30, 0),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(15, 59, 59),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(16, 0, 0),\n                () => AssertIsMarketOpen(expected: false));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(21, 0, 0),\n                () => AssertIsMarketOpen(expected: false));\n\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that IsMarketOpen is working as expected\n    /// </summary>\n    public class IsMarketOpenCheckWithExtendedMarketHoursAlgorithm : IsMarketOpenCheckAlgorithm\n    {\n        protected override bool ExtendedMarketHours { get; } = true;\n\n        protected override void ScheduleMarketOpenChecks()\n        {\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(3, 59, 59),\n                () => AssertIsMarketOpen(expected: false));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(4, 0, 0),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(9, 29, 59),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(9, 30, 0),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(15, 59, 59),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(16, 0, 0),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(19, 59, 59),\n                () => AssertIsMarketOpen(expected: true));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(20, 0, 0),\n                () => AssertIsMarketOpen(expected: false));\n\n            Schedule.On(\n                DateRules.EveryDay(Symbol),\n                TimeRules.At(21, 0, 0),\n                () => AssertIsMarketOpen(expected: false));\n\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 9643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LargeQuantityOptionStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that orders for option strategies can be placed with large quantities as long as there is margin available.\n    /// This asserts the expected behavior in GH issue #5693\n    /// </summary>\n    public class LargeQuantityOptionStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            SetSecurityInitializer(x => x.SetMarketPrice(GetLastKnownPrice(x)));\n\n            var equity = AddEquity(\"GOOG\");\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested || !slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                return;\n            }\n\n            var putContractsWithLatestExpiry = chain\n                    // puts only\n                    .Where(x => x.Right == OptionRight.Put)\n                    // contracts with latest expiry\n                    .GroupBy(x => x.Expiry)\n                    .OrderBy(x => x.Key)\n                    .Last()\n                    // ordered by strike\n                    .OrderBy(x => x.Strike)\n                    .ToList();\n\n            if (putContractsWithLatestExpiry.Count < 2)\n            {\n                return;\n            }\n\n            var longContract = putContractsWithLatestExpiry[0];\n            var shortContract = putContractsWithLatestExpiry[1];\n\n            var strategy = OptionStrategies.BearPutSpread(_optionSymbol, shortContract.Strike, longContract.Strike, shortContract.Expiry);\n\n            // Before option strategies orders were place as combo orders, only a quantity up to 18 could be used in this case,\n            // even though the remaining margin was enough to support a larger quantity. See GH issue #5693.\n            // We want to assert that with combo orders, large quantities can be used on option strategies\n            Order(strategy, 19);\n\n            Quit($\"Margin used: {Portfolio.TotalMarginUsed}; Remaining: {Portfolio.MarginRemaining}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var filledOrders = Transactions.GetOrders(x => x.Status == OrderStatus.Filled).ToList();\n\n            if (filledOrders.Count != 2)\n            {\n                throw new RegressionTestException($\"Expected 2 filled orders but found {filledOrders.Count}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2262;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 175;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"95130.3\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$24.70\"},\n            {\"Estimated Strategy Capacity\", \"$6000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMELSHV6AU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"208.51%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"574530af8e007d4b770b3782bbe31b1b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LeveragePrecedenceRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduce GH issue 3784, where *default* <see cref=\"IAlgorithm.UniverseSettings\"/>\n    /// Leverage value took precedence over <see cref=\"IAlgorithm.BrokerageModel\"/>\n    /// </summary>\n    public class LeveragePrecedenceRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            SetBrokerageModel(new TestBrokerageModel());\n\n            _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            SetUniverseSelection(new ManualUniverseSelectionModel(_spy));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 10);\n                Debug(\"Purchased Stock\");\n            }\n\n            if (Securities[_spy].Leverage != 10)\n            {\n                throw new RegressionTestException($\"Expecting leverage to be 10, was {Securities[_spy].Leverage}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.12%\"},\n            {\"Compounding Annual Return\", \"239.838%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101576.33\"},\n            {\"Net Profit\", \"1.576%\"},\n            {\"Sharpe Ratio\", \"8.861\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"0.997\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.544\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.972\"},\n            {\"Total Fees\", \"$65.43\"},\n            {\"Estimated Strategy Capacity\", \"$5600000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"379.43%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"b339a5e17142fe5496d80ee26079d8d0\"}\n        };\n\n        private class TestBrokerageModel : DefaultBrokerageModel\n        {\n            public override decimal GetLeverage(Security security)\n            {\n                return 10;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LimitFillRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template algorithm simply initializes the date range and cash\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"limit orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"updating orders\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class LimitFillRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Second);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.ContainsKey(\"SPY\"))\n            {\n                if (Time.Second == 0 && Time.Minute == 0)\n                {\n                    var goLong = Time < StartDate.AddDays(2);\n                    var negative = goLong ? 1 : -1;\n                    LimitOrder(\"SPY\", negative*10, slice[\"SPY\"].Price);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 234043;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"35\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-5.250%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-0.200\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99931.07\"},\n            {\"Net Profit\", \"-0.069%\"},\n            {\"Sharpe Ratio\", \"-1.105\"},\n            {\"Sortino Ratio\", \"-1.712\"},\n            {\"Probabilistic Sharpe Ratio\", \"42.339%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.60\"},\n            {\"Alpha\", \"-0.223\"},\n            {\"Beta\", \"0.1\"},\n            {\"Annual Standard Deviation\", \"0.023\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-9.985\"},\n            {\"Tracking Error\", \"0.2\"},\n            {\"Treynor Ratio\", \"-0.254\"},\n            {\"Total Fees\", \"$34.00\"},\n            {\"Estimated Strategy Capacity\", \"$180000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"9.86%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b25621656830fb81b093f3c315830ea3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LimitIfTouchedAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place LimitIfTouched orders asynchronously.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />`\n    /// <meta name=\"tag\" content=\"limit if touched order\"/>\n    public class LimitIfTouchedAsyncRegressionAlgorithm : LimitIfTouchedRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LimitIfTouchedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place LimitIfTouched orders.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />`\n    /// <meta name=\"tag\" content=\"limit if touched order\"/>\n    public class LimitIfTouchedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _request;\n        private int _negative;\n\n        // We assert the following occur in FIFO order in OnOrderEvent\n        private readonly Queue<string> _expectedEvents = new Queue<string>(new[]\n        {\n            \"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 399 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $144.6434 LimitPrice: $144.3551 TriggerPrice: $143.61 OrderFee: 1 USD\",\n            \"Time: 10/10/2013 15:57:00 OrderID: 73 EventID: 156 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $145.6636 LimitPrice: $145.6434 TriggerPrice: $144.89 OrderFee: 1 USD\",\n            \"Time: 10/11/2013 15:37:00 OrderID: 74 EventID: 380 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $146.7185 LimitPrice: $146.6723 TriggerPrice: $145.92 OrderFee: 1 USD\"        });\n        protected virtual bool AsynchronousOrders => false;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07); //Set Start Date\n            SetEndDate(2013, 10, 11); //Set End Date\n            SetCash(100000); //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddEquity(\"SPY\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.ContainsKey(\"SPY\"))\n            {\n                return;\n            }\n\n            // After an order is placed, it will decrease in quantity by one for each minute, being cancelled altogether\n            // if not filled within 10 minutes.\n            if (Transactions.GetOpenOrders().Count == 0)\n            {\n                var goLong = Time.Day < 9;\n                _negative = goLong ? 1 : -1;\n                var orderRequest = new SubmitOrderRequest(OrderType.LimitIfTouched, SecurityType.Equity, \"SPY\",\n                    _negative * 10, 0,\n                    slice[\"SPY\"].Price - (decimal) _negative, slice[\"SPY\"].Price - (decimal) 0.25 * _negative, UtcTime,\n                    $\"LIT - Quantity: {_negative * 10}\", asynchronous: AsynchronousOrders);\n                _request = Transactions.AddOrder(orderRequest);\n                return;\n\n            }\n\n            // Order updating if request exists\n            if (_request != null)\n            {\n                if (_request.Quantity == 1)\n                {\n                    Transactions.CancelOpenOrders();\n                    _request = null;\n                    return;\n                }\n\n                var newQuantity = _request.Quantity - _negative;\n                _request.UpdateQuantity(newQuantity, $\"LIT - Quantity: {newQuantity}\");\n                _request.UpdateTriggerPrice(_request.Get(OrderField.TriggerPrice).RoundToSignificantDigits(5));\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                var expected = _expectedEvents.Dequeue();\n\n                if (orderEvent.ToString() != expected)\n                {\n                    throw new RegressionTestException($\"orderEvent {orderEvent.Id} differed from {expected}. Actual {orderEvent}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var ticket in Transactions.GetOrderTickets())\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"75\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.601%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99992.29\"},\n            {\"Net Profit\", \"-0.008%\"},\n            {\"Sharpe Ratio\", \"-34.372\"},\n            {\"Sortino Ratio\", \"-110.972\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.01\"},\n            {\"Beta\", \"-0.001\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.919\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"8.667\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$4400000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.09%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"70e29c5d9168728385ee48b92f2ef56c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for testing limit orders are filled after hours for futures.\n    /// It also asserts that market-on-open orders are not allowed for futures outside of regular market hours\n    /// </summary>\n    public class LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Future _futureContract;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 10);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0,\n                extendedMarketHours: true\n            );\n            _futureContract = AddFutureContract(FuturesChain(_continuousContract.Symbol).First(), extendedMarketHours: true);\n        }\n\n        public override void OnWarmupFinished()\n        {\n            // Right after warm up we should be outside regular market hours\n            if (_futureContract.Exchange.ExchangeOpen)\n            {\n                throw new RegressionTestException(\"We should be outside regular market hours\");\n            }\n\n            // Market on open order should not be allowed for futures outside of regular market hours\n            var futureContractMarketOnOpenOrder = MarketOnOpenOrder(_futureContract.Symbol, 1);\n            if (futureContractMarketOnOpenOrder.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Market on open order should not be allowed for futures outside of regular market hours\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.TimeOfDay.Hours > 17 && !Portfolio.Invested)\n            {\n                // Limit order should be allowed for futures outside of regular market hours.\n                // Use a very high limit price so the limit orders get filled immediately\n                var futureContractLimitOrder = LimitOrder(_futureContract.Symbol, 1, _futureContract.Price * 2m);\n                var continuousContractLimitOrder = LimitOrder(_continuousContract.Mapped, 1, _continuousContract.Price * 2m);\n                if (futureContractLimitOrder.Status == OrderStatus.Invalid || continuousContractLimitOrder.Status == OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Limit order should be allowed for futures outside of regular market hours\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Transactions.GetOrders().Any(order => order.Status != OrderStatus.Filled ))\n            {\n                throw new RegressionTestException(\"Not all orders were filled\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // 13:30 and 21:00 UTC are 9:30 and 17 New york, which are the regular market hours litimits for this security\n            if (orderEvent.Status == OrderStatus.Filled && !Securities[orderEvent.Symbol].Exchange.DateTimeIsOpen(orderEvent.UtcTime) &&\n                (orderEvent.UtcTime.TimeOfDay >= new TimeSpan(13, 30, 0) && orderEvent.UtcTime.TimeOfDay < new TimeSpan(21, 0, 0)))\n            {\n                throw new RegressionTestException($\"Order should have been filled during extended market hours\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50978;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-9.298%\"},\n            {\"Drawdown\", \"2.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99866.4\"},\n            {\"Net Profit\", \"-0.134%\"},\n            {\"Sharpe Ratio\", \"1.959\"},\n            {\"Sortino Ratio\", \"4.863\"},\n            {\"Probabilistic Sharpe Ratio\", \"53.257%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.239\"},\n            {\"Beta\", \"0.695\"},\n            {\"Annual Standard Deviation\", \"0.178\"},\n            {\"Annual Variance\", \"0.032\"},\n            {\"Information Ratio\", \"2.059\"},\n            {\"Tracking Error\", \"0.093\"},\n            {\"Treynor Ratio\", \"0.501\"},\n            {\"Total Fees\", \"$4.30\"},\n            {\"Estimated Strategy Capacity\", \"$25000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VU1EHIDJYLMP\"},\n            {\"Portfolio Turnover\", \"33.58%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5a14a3f8b50e3117d87c69d6b11102fc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LiquidETFUniverseFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template framework algorithm uses framework components to define the algorithm.\n    /// Liquid ETF Competition template\n    /// </summary>\n    /// <meta name=\"tag\" content=\"competition\" />\n    /// <meta name=\"tag\" content=\"alpha stream\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    public class LiquidETFUniverseFrameworkAlgorithm : QCAlgorithm\n    {\n        // List of symbols we want to trade. Set it in OnSecuritiesChanged\n        private readonly List<Symbol> _symbols = new List<Symbol>();\n\n        public override void Initialize()\n        {\n            // Set Start Date so that backtest has 5+ years of data\n            SetStartDate(2014, 11, 1);\n            // No need to set End Date as the final submission will be tested\n            // up until the review date\n\n            // Set $1m Strategy Cash to trade significant AUM\n            SetCash(1000000);\n\n            // Add a relevant benchmark, with the default being SPY\n            SetBenchmark(\"SPY\");\n\n            // Use the Alpha Streams Brokerage Model, developed in conjunction with\n            // funds to model their actual fees, costs, etc.\n            // Please do not add any additional reality modelling, such as Slippage, Fees, Buying Power, etc.\n            SetBrokerageModel(new AlphaStreamsBrokerageModel());\n\n            // Use the LiquidETFUniverse with minute-resolution data\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetUniverseSelection(new LiquidETFUniverse());\n\n            // Optional\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_symbols.All(x => Portfolio[x].Invested))\n            {\n                return;\n            }\n\n            var insights = _symbols.Where(x => Securities[x].Price > 0)\n                .Select(x => Insight.Price(x, TimeSpan.FromDays(1), InsightDirection.Up))\n                .ToArray();\n\n            if (insights.Length > 0)\n            {\n                EmitInsights(insights);\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // Set symbols as the Inverse Energy ETFs\n            foreach (var security in changes.AddedSecurities)\n            {\n                if (LiquidETFUniverse.Energy.Inverse.Contains(security.Symbol))\n                {\n                    _symbols.Add(security.Symbol);\n                }\n            }\n\n            // Print out the information about the groups\n            Log($\"Energy: {LiquidETFUniverse.Energy}\");\n            Log($\"Metals: {LiquidETFUniverse.Metals}\");\n            Log($\"Technology: {LiquidETFUniverse.Technology}\");\n            Log($\"Treasuries: {LiquidETFUniverse.Treasuries}\");\n            Log($\"Volatility: {LiquidETFUniverse.Volatility}\");\n            Log($\"SP500Sectors: {LiquidETFUniverse.SP500Sectors}\");\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/LiquidateAllExceptSpecifiedSymbolRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp.RegressionTests\n{\n    /// <summary>\n    /// Tests liquidating all portfolio holdings except a specific symbol, verifying canceled orders and correct tags.\n    /// </summary>\n    public class LiquidateAllExceptSpecifiedSymbolRegressionAlgorithm : LiquidateRegressionAlgorithm\n    {\n        public override void Rebalance()\n        {\n            // Place a MarketOrder\n            MarketOrder(Ibm, 10);\n\n            // Place a LimitOrder to sell 1 share at a price below the current market price\n            LimitOrder(Ibm, 1, Securities[Ibm].Price - 5);\n\n            // Liquidate the remaining symbols in the portfolio, except for SPY\n            var orderProperties = new OrderProperties { TimeInForce = TimeInForce.GoodTilCanceled };\n            OrderTickets.AddRange(SetHoldings(Spy, 1, true, tag: \"LiquidatedTest\", orderProperties: orderProperties));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Retrieve all orders from the Transactions for analysis\n            var orders = Transactions.GetOrders().ToList();\n\n            // Count orders that were canceled\n            var canceledOrdersCount = orders.Where(order => order.Status == OrderStatus.Canceled).Count();\n\n            // Expectation 1: There should be exactly 4 canceled orders.\n            // This occurs because Rebalance is called twice, and each call to Rebalance\n            // (e.g., LimitOrder or MarketOrder) that get canceled due to the Liquidate call in SetHoldings.\n            if (canceledOrdersCount != 4)\n            {\n                throw new RegressionTestException($\"Expected 4 canceled orders, but found {canceledOrdersCount}.\");\n            }\n\n            // Count orders that were not canceled\n            var nonCanceledOrdersCount = orders.Where(order => order.Status != OrderStatus.Canceled).Count();\n\n            // Expectation 2: There should be exactly 1 non-canceled order after the Liquidate call.\n            // This occurs because all holdings except SPY are liquidated, and a new order is placed for SPY.\n            if (nonCanceledOrdersCount != 1)\n            {\n                throw new RegressionTestException($\"Expected 1 non-canceled order, but found {nonCanceledOrdersCount}.\");\n            }\n\n            if (nonCanceledOrdersCount != OrderTickets.Count)\n            {\n                throw new RegressionTestException($\"Expected {OrderTickets.Count} non-canceled orders, but found {nonCanceledOrdersCount}.\");\n            }\n\n            // Verify all tags are \"LiquidatedTest\"\n            var invalidTags = orders.Where(order => order.Tag != \"LiquidatedTest\").ToList();\n            if (invalidTags.Count != 0)\n            {\n                var invalidTagsDetails = string.Join(\", \", invalidTags.Select(order => $\"OrderID {order.Id}, Tag: {order.Tag}\"));\n                throw new RegressionTestException($\"All orders should have the tag 'LiquidatedTest', but found invalid tags: {invalidTagsDetails}.\");\n            }\n        }\n\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"36.497%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100569.90\"},\n            {\"Net Profit\", \"0.570%\"},\n            {\"Sharpe Ratio\", \"9.031\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"86.638%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"0.559\"},\n            {\"Annual Standard Deviation\", \"0.028\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-8.867\"},\n            {\"Tracking Error\", \"0.023\"},\n            {\"Treynor Ratio\", \"0.447\"},\n            {\"Total Fees\", \"$1.95\"},\n            {\"Estimated Strategy Capacity\", \"$850000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.23%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"611f320cf76c36e8cdcb1938e4154682\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LiquidateRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// A regression test algorithm that places market and limit orders, then liquidates all holdings,\n    /// ensuring orders are canceled and the portfolio is empty.\n    /// </summary>\n    public class LiquidateRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected List<OrderTicket> OrderTickets { get; private set; }\n        protected Symbol Spy { get; private set; }\n        protected Symbol Ibm { get; private set; }\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 4);\n            SetEndDate(2018, 1, 10);\n            Spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            Ibm = AddEquity(\"IBM\", Resolution.Daily).Symbol;\n            OrderTickets = new List<OrderTicket>();\n\n            // Schedule Rebalance method to be called on specific dates\n            Schedule.On(DateRules.On(2018, 1, 5), TimeRules.Midnight, Rebalance);\n            Schedule.On(DateRules.On(2018, 1, 8), TimeRules.Midnight, Rebalance);\n        }\n\n        public virtual void Rebalance()\n        {\n            // Place a MarketOrder\n            MarketOrder(Ibm, 10);\n\n            // Place a LimitOrder to sell 1 share at a price below the current market price\n            LimitOrder(Ibm, 1, Securities[Ibm].Price - 5);\n\n            LimitOrder(Spy, 1, Securities[Spy].Price - 5);\n\n            // Liquidate all remaining holdings immediately\n            PerformLiquidation();\n        }\n\n        public virtual void PerformLiquidation()\n        {\n            Liquidate();\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Check if there are any orders that should have been canceled\n            var orders = Transactions.GetOrders().ToList();\n            var nonCanceledOrdersCount = orders.Where(e => e.Status != OrderStatus.Canceled).Count();\n            if (nonCanceledOrdersCount > 0)\n            {\n                throw new RegressionTestException($\"There are {nonCanceledOrdersCount} orders that should have been cancelled\");\n            }\n\n            if (OrderTickets.Count > 0)\n            {\n                throw new RegressionTestException(\"The number of order tickets must be zero because all orders were cancelled\");\n            }\n\n            // Check if there are any holdings left in the portfolio\n            foreach (var kvp in Portfolio)\n            {\n                var symbol = kvp.Key;\n                var holdings = kvp.Value;\n                if (holdings.Quantity != 0)\n                {\n                    throw new RegressionTestException($\"There are {holdings.Quantity} holdings of {symbol} in the portfolio\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 53;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-10.398\"},\n            {\"Tracking Error\", \"0.045\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9423c872a626fb856b7c377686c28d85\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LiquidateUsingSetHoldingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp.RegressionTests\n{\n    /// <summary>\n    /// A regression test algorithm that uses SetHoldings to liquidate the portfolio by setting holdings to zero.\n    /// </summary>\n    public class LiquidateUsingSetHoldingsRegressionAlgorithm : LiquidateRegressionAlgorithm\n    {\n        public override void PerformLiquidation()\n        {\n            var properties = new OrderProperties { TimeInForce = TimeInForce.GoodTilCanceled };\n            OrderTickets.AddRange(SetHoldings(new List<PortfolioTarget>(), true, tag: \"LiquidatedTest\", orderProperties: properties));\n            var orders = Transactions.GetOrders().ToList();\n            var orderTags = orders.Where(e => e.Tag == \"LiquidatedTest\").ToList();\n            if (orderTags.Count != orders.Count)\n            {\n                throw new RegressionTestException(\"The tag was not set on all orders\");\n            }\n            var orderProperties = orders.Where(e => e.Properties.TimeInForce == TimeInForce.GoodTilCanceled).ToList();\n            if (orderProperties.Count != orders.Count)\n            {\n                throw new RegressionTestException(\"The properties were not set on all orders\");\n            }\n        }\n\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-10.398\"},\n            {\"Tracking Error\", \"0.045\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2cdbee112f22755f26f640c97c305aae\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LiquidatingMultipleOptionStrategiesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that we can open a position on two option strategies for the same underlying and then liquidate both of them.\n    /// This reproduces GH issue #7205.\n    ///\n    /// The algorithm works in two steps:\n    ///     1. Buy a bull call and a bear put spread.\n    ///     2. Liquidate both spreads bough in step 1.\n    ///        - The issue was on this step, the algorithm failed with the following error when attempting to liquidate the first spread:\n    ///            Unable to create group for orders: [5,6]\n    /// </summary>\n    public class LiquidatingMultipleOptionStrategiesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        OptionStrategy _bullCallSpread;\n        OptionStrategy _bearPutSpread;\n        private bool _done;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 25);\n            SetCash(500000);\n\n            var option = AddOption(\"GOOG\");\n            option.SetFilter(universe => universe.StandardsOnly().Strikes(-3, 3).Expiration(0, 180));\n\n            _symbol = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_done || !slice.OptionChains.TryGetValue(_symbol, out var chain))\n            {\n                return;\n            }\n\n            var calls = chain\n                .Where(x => x.Right == OptionRight.Call)\n                .GroupBy(x => x.Expiry)\n                .FirstOrDefault(x => x.Count() > 2)\n                ?.OrderBy(x => x.Strike)\n                ?.ToList();\n            var puts = chain\n                .Where(x => x.Right == OptionRight.Put)\n                .GroupBy(x => x.Expiry)\n                .FirstOrDefault(x => x.Count() > 2)\n                ?.OrderByDescending(x => x.Strike)\n                ?.ToList();\n            if (calls == null || puts == null)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                // Step 1: buy spreads\n\n                _bullCallSpread = OptionStrategies.BullCallSpread(_symbol, calls[0].Strike, calls[1].Strike, calls[0].Expiry);\n                Buy(_bullCallSpread, 1);\n\n                _bearPutSpread = OptionStrategies.BearPutSpread(_symbol, puts[0].Strike, puts[1].Strike, puts[0].Expiry);\n                Buy(_bearPutSpread, 1);\n            }\n            else\n            {\n                // Let's check that we have the right position groups, just to make sure we are good.\n                var positionGroups = Portfolio.Positions.Groups;\n                if (positionGroups.Count != 2)\n                {\n                    throw new RegressionTestException($\"Expected 2 position groups, one for each spread, but found {positionGroups.Count}\");\n                }\n\n                var positionGroupMatchesSpreadStrategy = (IPositionGroup positionGroup, OptionStrategy strategy) =>\n                {\n                    return strategy.OptionLegs.All(leg =>\n                    {\n                        var legSymbol = QuantConnect.Symbol.CreateOption(strategy.Underlying, strategy.CanonicalOption?.ID?.Symbol,\n                            strategy.Underlying.ID.Market, _symbol.ID.OptionStyle, leg.Right, leg.Strike, leg.Expiration);\n                        return positionGroup.Positions.Any(position => position.Symbol == legSymbol);\n                    });\n                };\n                if (!positionGroups.All(group =>\n                        positionGroupMatchesSpreadStrategy(group, _bullCallSpread) || positionGroupMatchesSpreadStrategy(group, _bearPutSpread)))\n                {\n                    throw new RegressionTestException(\"Expected both spreads to have a matching position group in the portfolio.\");\n                }\n\n                // Step 2: liquidate spreads\n\n                Sell(_bullCallSpread, 1);\n                Sell(_bearPutSpread, 1);\n                _done = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_done)\n            {\n                throw new RegressionTestException(\"Expected the algorithm to have bought and sold a Bull Call Spread and a Bear Put Spread.\");\n            }\n\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"The spreads should have been liquidated by the end of the algorithm\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 20263;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"500000\"},\n            {\"End Equity\", \"499592\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$8.00\"},\n            {\"Estimated Strategy Capacity\", \"$13000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.31%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7e6fb74d29704118659d2fcc59b6cd78\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LiveFeaturesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Live Trading Functionality Demonstration algorithm including SMS, Email and Web hook notifications.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"live trading\" />\n    /// <meta name=\"tag\" content=\"alerts\" />\n    /// <meta name=\"tag\" content=\"sms alerts\" />\n    /// <meta name=\"tag\" content=\"web hooks\" />\n    /// <meta name=\"tag\" content=\"email alerts\" />\n    /// <meta name=\"tag\" content=\"runtime statistics\" />\n    public class LiveTradingFeaturesAlgorithm : QCAlgorithm\n    {\n        private bool _isConnected;\n\n        /// <summary>\n        /// Initialise the Algorithm and Prepare Required Data.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(25000);\n\n            //Equity Data for US Markets:\n            AddSecurity(SecurityType.Equity, \"IBM\", Resolution.Second);\n\n            //FOREX Data for Weekends: 24/6\n            AddSecurity(SecurityType.Forex, \"EURUSD\", Resolution.Minute);\n\n            //Custom/Bitcoin Live Data: 24/7\n            AddData<Bitcoin>(\"BTC\", Resolution.Second, TimeZones.Utc);\n\n            //if the algorithm is connected to the brokerage\n            _isConnected = true;\n        }\n\n        /// <summary>\n        /// Raises the data event.\n        /// </summary>\n        /// <param name=\"data\">Data.</param>\n        public override void OnData(Slice data)\n        {\n            if (!Portfolio[\"IBM\"].HoldStock && data.ContainsKey(\"IBM\"))\n            {\n                int quantity = (int)Math.Floor(Portfolio.MarginRemaining / data[\"IBM\"].Close);\n                Order(\"IBM\", quantity);\n                Debug(\"Purchased IBM on \" + Time.ToShortDateString());\n                Notify.Email(\"myemail@gmail.com\", \"Test\", \"Test Body\", \"test attachment\");\n            }\n\n            if (data.TryGet<Bitcoin>(\"BTC\", out var bitcoinData))\n            {\n                if (LiveMode) //Live Mode Property\n                {\n                    //Configurable title header statistics numbers\n                    SetRuntimeStatistic(\"BTC\", bitcoinData.Close.ToStringInvariant(\"C\"));\n                }\n\n                if (!Portfolio.HoldStock)\n                {\n                    Order(\"BTC\", 100);\n\n                    //Send a notification email/SMS/web request on events:\n                    Notify.Email(\"myemail@gmail.com\", \"Test\", \"Test Body\", \"test attachment\");\n                    Notify.Sms(\"+11233456789\", Time.ToStringInvariant(\"u\") + \">> Test message from live BTC server.\");\n                    Notify.Web(\"http://api.quantconnect.com\", Time.ToStringInvariant(\"u\") + \">> Test data packet posted from live BTC server.\");\n                    Notify.Telegram(\"id\", Time.ToStringInvariant(\"u\") + \">> Test message from live BTC server.\");\n                    Notify.Ftp(\"ftp.quantconnect.com\", \"username\", \"password\", \"path/to/file.txt\",\n                        Time.ToStringInvariant(\"u\") + \">> Test file from live BTC server.\");\n                    Notify.Sftp(\"ftp.quantconnect.com\", \"username\", \"password\", \"path/to/file.txt\",\n                        Time.ToStringInvariant(\"u\") + \">> Test file from live BTC server.\");\n                    Notify.Sftp(\"ftp.quantconnect.com\", \"username\", \"privatekey\", \"optionalprivatekeypassphrase\", \"path/to/file.txt\",\n                        Time.ToStringInvariant(\"u\") + \">> Test file from live BTC server.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Brokerage message event handler. This method is called for all types of brokerage messages.\n        /// </summary>\n        public override void OnBrokerageMessage(BrokerageMessageEvent messageEvent)\n        {\n            Debug($\"Brokerage meesage received - {messageEvent.ToString()}\");\n        }\n\n        /// <summary>\n        /// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n        /// </summary>\n        public override void OnBrokerageDisconnect()\n        {\n            _isConnected = false;\n            Debug($\"Brokerage disconnected!\");\n        }\n\n        /// <summary>\n        /// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n        /// </summary>\n        public override void OnBrokerageReconnect()\n        {\n            _isConnected = true;\n            Debug($\"Brokerage reconnected!\");\n        }\n\n        /// <summary>\n        /// Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\n        /// </summary>\n        public class Bitcoin : BaseData\n        {\n            [JsonProperty(\"timestamp\")]\n            public int Timestamp { get; set; }\n            [JsonProperty(\"open\")]\n            public decimal Open { get; set; }\n            [JsonProperty(\"high\")]\n            public decimal High { get; set; }\n            [JsonProperty(\"low\")]\n            public decimal Low { get; set; }\n            [JsonProperty(\"last\")]\n            public decimal Close { get; set; }\n            [JsonProperty(\"bid\")]\n            public decimal Bid { get; set; }\n            [JsonProperty(\"ask\")]\n            public decimal Ask { get; set; }\n            [JsonProperty(\"vwap\")]\n            public decimal WeightedPrice { get; set; }\n            [JsonProperty(\"volume\")]\n            public decimal VolumeBTC { get; set; }\n            public decimal VolumeUSD { get; set; }\n\n            /// <summary>\n            /// The end time of this data. Some data covers spans (trade bars)\n            /// and as such we want to know the entire time span covered\n            /// </summary>\n            /// <remarks>\n            /// This property is overriden to allow different values for Time and EndTime\n            /// if they are set in the Reader. In the base implementation EndTime equals Time\n            /// </remarks>\n            public override DateTime EndTime { get; set; }\n\n            /// <summary>\n            /// 1. DEFAULT CONSTRUCTOR: Custom data types need a default constructor.\n            /// We search for a default constructor so please provide one here. It won't be used for data, just to generate the \"Factory\".\n            /// </summary>\n            public Bitcoin()\n            {\n                Symbol = \"BTC\";\n            }\n\n            /// <summary>\n            /// 2. RETURN THE STRING URL SOURCE LOCATION FOR YOUR DATA:\n            /// This is a powerful and dynamic select source file method. If you have a large dataset, 10+mb we recommend you break it into smaller files. E.g. One zip per year.\n            /// We can accept raw text or ZIP files. We read the file extension to determine if it is a zip file.\n            /// </summary>\n            /// <param name=\"config\">Configuration object</param>\n            /// <param name=\"date\">Date of this source file</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>String URL of source file.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                if (isLiveMode)\n                {\n                    return new SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.Rest);\n                }\n\n                //return \"http://my-ftp-server.com/futures-data-\" + date.ToString(\"Ymd\") + \".zip\";\n                // OR simply return a fixed small data file. Large files will slow down your backtest\n                return new SubscriptionDataSource(\"https://www.quandl.com/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc\", SubscriptionTransportMedium.RemoteFile);\n            }\n\n            /// <summary>\n            /// 3. READER METHOD: Read 1 line from data source and convert it into Object.\n            /// Each line of the CSV File is presented in here. The backend downloads your file, loads it into memory and then line by line\n            /// feeds it into your algorithm\n            /// </summary>\n            /// <param name=\"line\">string line from the data source file submitted above</param>\n            /// <param name=\"config\">Subscription data, symbol name, data type</param>\n            /// <param name=\"date\">Current date we're requesting. This allows you to break up the data source into daily files.</param>\n            /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n            /// <returns>New Bitcoin Object which extends BaseData.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var coin = new Bitcoin();\n                if (isLiveMode)\n                {\n                    //Example Line Format:\n                    //{\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n                    try\n                    {\n                        coin = JsonConvert.DeserializeObject<Bitcoin>(line);\n                        coin.EndTime = DateTime.UtcNow.ConvertFromUtc(config.ExchangeTimeZone);\n                        coin.Value = coin.Close;\n                    }\n                    catch { /* Do nothing, possible error in json decoding */ }\n                    return coin;\n                }\n\n                //Example Line Format:\n                //Date      Open   High    Low     Close   Volume (BTC)    Volume (Currency)   Weighted Price\n                //2011-09-13 5.8    6.0     5.65    5.97    58.37138238,    346.0973893944      5.929230648356\n                try\n                {\n                    string[] data = line.Split(',');\n                    coin.Time = DateTime.Parse(data[0], CultureInfo.InvariantCulture);\n                    coin.Open = Convert.ToDecimal(data[1], CultureInfo.InvariantCulture);\n                    coin.High = Convert.ToDecimal(data[2], CultureInfo.InvariantCulture);\n                    coin.Low = Convert.ToDecimal(data[3], CultureInfo.InvariantCulture);\n                    coin.Close = Convert.ToDecimal(data[4], CultureInfo.InvariantCulture);\n                    coin.VolumeBTC = Convert.ToDecimal(data[5], CultureInfo.InvariantCulture);\n                    coin.VolumeUSD = Convert.ToDecimal(data[6], CultureInfo.InvariantCulture);\n                    coin.WeightedPrice = Convert.ToDecimal(data[7], CultureInfo.InvariantCulture);\n                    coin.Value = coin.Close;\n                }\n                catch { /* Do nothing, skip first title row */ }\n\n                return coin;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Butterfly Call and Short Butterfly Call strategies.\n    /// </summary>\n    public class LongAndShortButterflyCallStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        protected override int ExpectedOrdersCount { get; } = 6;\n\n        private OptionStrategy _butterflyCall;\n        private OptionStrategy _shortButterflyCall;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contractsByExpiry = chain.Where(x => x.Right == OptionRight.Call).GroupBy(x => x.Expiry);\n            foreach (var group in contractsByExpiry)\n            {\n                var expiry = group.Key;\n                var contracts = group.ToList();\n\n                if (contracts.Count < 3)\n                {\n                    continue;\n                }\n\n                var strikes = contracts.Select(x => x.Strike).OrderBy(x => x).ToArray();\n                var atmStrike = contracts.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n                var spread = Math.Min(atmStrike - strikes[0], strikes[^1] - atmStrike);\n                var itmStrike = atmStrike - spread;\n                var otmStrike = atmStrike + spread;\n\n                if (strikes.Contains(otmStrike) && strikes.Contains(itmStrike))\n                {\n                    // Ready to trade\n                    _butterflyCall = OptionStrategies.ButterflyCall(_optionSymbol, otmStrike, atmStrike, itmStrike, expiry);\n                    _shortButterflyCall = OptionStrategies.ShortButterflyCall(_optionSymbol, otmStrike, atmStrike, itmStrike, expiry);\n                    Buy(_butterflyCall, 2);\n                    break;\n                }\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 3)\n            {\n                throw new RegressionTestException($\"Expected position group to have 3 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var higherStrike = _butterflyCall.OptionLegs.Max(leg => leg.Strike);\n            var higherStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.StrikePrice == higherStrike);\n\n            if (higherStrikePosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected higher strike position quantity to be 2. Actual: {higherStrikePosition.Quantity}\");\n            }\n\n            var lowerStrike = _butterflyCall.OptionLegs.Min(leg => leg.Strike);\n            var lowerStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.StrikePrice == lowerStrike);\n\n            if (lowerStrikePosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected lower strike position quantity to be 2. Actual: {lowerStrikePosition.Quantity}\");\n            }\n\n            var middleStrike = _butterflyCall.OptionLegs.Single(leg => leg.Strike < higherStrike && leg.Strike > lowerStrike).Strike;\n            var middleStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.StrikePrice == middleStrike);\n\n            if (middleStrikePosition.Quantity != -4)\n            {\n                throw new RegressionTestException($\"Expected middle strike position quantity to be -4. Actual: {middleStrikePosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a short butterfly call)\n            Buy(_shortButterflyCall, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999229.6\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$10.40\"},\n            {\"Estimated Strategy Capacity\", \"$7000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMEBFLDY|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.17%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"819b008b902a1a0013646a12d31f4ae4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortButterflyPutStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Butterfly Put and Short Butterfly Put strategies.\n    /// </summary>\n    public class LongAndShortButterflyPutStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        protected override int ExpectedOrdersCount { get; } = 6;\n\n        private OptionStrategy _butterflyPut;\n        private OptionStrategy _shortButterflyPut;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contractsByExpiry = chain.Where(x => x.Right == OptionRight.Put).GroupBy(x => x.Expiry);\n            foreach (var group in contractsByExpiry)\n            {\n                var expiry = group.Key;\n                var contracts = group.ToList();\n\n                if (contracts.Count < 3)\n                {\n                    continue;\n                }\n\n                var strikes = contracts.Select(x => x.Strike).OrderBy(x => x).ToArray();\n                var atmStrike = contracts.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Value)).Strike;\n                var spread = Math.Min(atmStrike - strikes[0], strikes[^1] - atmStrike);\n                var itmStrike = atmStrike + spread;\n                var otmStrike = atmStrike - spread;\n\n                if (strikes.Contains(otmStrike) && strikes.Contains(itmStrike))\n                {\n                    // Ready to trade\n                    _butterflyPut = OptionStrategies.ButterflyPut(_optionSymbol, itmStrike, atmStrike, otmStrike, expiry);\n                    _shortButterflyPut = OptionStrategies.ShortButterflyPut(_optionSymbol, itmStrike, atmStrike, otmStrike, expiry);\n                    Buy(_butterflyPut, 2);\n                    break;\n                }\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 3)\n            {\n                throw new RegressionTestException($\"Expected position group to have 3 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var higherStrike = _butterflyPut.OptionLegs.Max(leg => leg.Strike);\n            var higherStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.StrikePrice == higherStrike);\n\n            if (higherStrikePosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected higher strike position quantity to be 2. Actual: {higherStrikePosition.Quantity}\");\n            }\n\n            var lowerStrike = _butterflyPut.OptionLegs.Min(leg => leg.Strike);\n            var lowerStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.StrikePrice == lowerStrike);\n\n            if (lowerStrikePosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected lower strike position quantity to be 2. Actual: {lowerStrikePosition.Quantity}\");\n            }\n\n            var middleStrike = _butterflyPut.OptionLegs.Single(leg => leg.Strike < higherStrike && leg.Strike > lowerStrike).Strike;\n            var middleStrikePosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.StrikePrice == middleStrike);\n\n            if (middleStrikePosition.Quantity != -4)\n            {\n                throw new RegressionTestException($\"Expected middle strike position quantity to be -4. Actual: {middleStrikePosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a short butterfly put)\n            Buy(_shortButterflyPut, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999309.6\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$10.40\"},\n            {\"Estimated Strategy Capacity\", \"$4000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.23%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"cf836c2b04e698db4f69048870f3fb1c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Call Calendar Spread and Short Call Calendar Spread strategies.\n    /// </summary>\n    public class LongAndShortCallCalendarSpreadStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        private OptionStrategy _callCalendarSpread;\n        private OptionStrategy _shortCallCalendarSpread;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contractsByStrike = chain\n                .Where(x => x.Right == OptionRight.Call)\n                .OrderBy(x => Math.Abs(x.Strike - chain.Underlying.Value))\n                .GroupBy(x => x.Strike);\n            foreach (var group in contractsByStrike)\n            {\n                var strike = group.Key;\n                var contracts = group.OrderBy(x => x.Expiry).ToList();\n                if (contracts.Count < 2) continue;\n\n                var nearExpiration = contracts[0].Expiry;\n                var farExpiration = contracts[1].Expiry;\n\n                _callCalendarSpread = OptionStrategies.CallCalendarSpread(_optionSymbol, strike, nearExpiration, farExpiration);\n                _shortCallCalendarSpread = OptionStrategies.ShortCallCalendarSpread(_optionSymbol, strike, nearExpiration, farExpiration);\n                Buy(_callCalendarSpread, 2);\n                break;\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var nearExpiration = _callCalendarSpread.OptionLegs.Min(leg => leg.Expiration);\n            var nearExpirationPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.Date == nearExpiration);\n\n            if (nearExpirationPosition.Quantity != -2)\n            {\n                throw new RegressionTestException($\"Expected near expiration position quantity to be -2. Actual: {nearExpirationPosition.Quantity}\");\n            }\n\n            var farExpiration = _callCalendarSpread.OptionLegs.Max(leg => leg.Expiration);\n            var farExpirationPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Call && x.Symbol.ID.Date == farExpiration);\n\n            if (farExpirationPosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected far expiration position quantity to be 2. Actual: {farExpirationPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a short call calendar spread)\n            Buy(_shortCallCalendarSpread, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999494.8\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.20\"},\n            {\"Estimated Strategy Capacity\", \"$7000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.85%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ee77a60de004210b9ab977f397c70f73\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortPutCalendarSpreadStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Put Calendar Spread and Short Put Calendar Spread strategies.\n    /// </summary>\n    public class LongAndShortPutCalendarSpreadStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        private OptionStrategy _putCalendarSpread;\n        private OptionStrategy _shortPutCalendarSpread;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contractsByStrike = chain\n                .Where(x => x.Right == OptionRight.Put)\n                .OrderBy(x => Math.Abs(x.Strike - chain.Underlying.Value))\n                .GroupBy(x => x.Strike);\n            foreach (var group in contractsByStrike)\n            {\n                var strike = group.Key;\n                var contracts = group.OrderBy(x => x.Expiry).ToList();\n                if (contracts.Count < 2) continue;\n\n                var nearExpiration = contracts[0].Expiry;\n                var farExpiration = contracts[1].Expiry;\n\n                _putCalendarSpread = OptionStrategies.PutCalendarSpread(_optionSymbol, strike, nearExpiration, farExpiration);\n                _shortPutCalendarSpread = OptionStrategies.ShortPutCalendarSpread(_optionSymbol, strike, nearExpiration, farExpiration);\n                Buy(_putCalendarSpread, 2);\n                break;\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var nearExpiration = _putCalendarSpread.OptionLegs.Min(leg => leg.Expiration);\n            var nearExpirationPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.Date == nearExpiration);\n\n            if (nearExpirationPosition.Quantity != -2)\n            {\n                throw new RegressionTestException($\"Expected near expiration position quantity to be -2. Actual: {nearExpirationPosition.Quantity}\");\n            }\n\n            var farExpiration = _putCalendarSpread.OptionLegs.Max(leg => leg.Expiration);\n            var farExpirationPosition = positionGroup.Positions\n                .Single(x => x.Symbol.ID.OptionRight == OptionRight.Put && x.Symbol.ID.Date == farExpiration);\n\n            if (farExpirationPosition.Quantity != 2)\n            {\n                throw new RegressionTestException($\"Expected far expiration position quantity to be 2. Actual: {farExpirationPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a short put calendar spread)\n            Buy(_shortPutCalendarSpread, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999534.8\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.20\"},\n            {\"Estimated Strategy Capacity\", \"$14000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZK4DP4VNQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.87%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c86c7c9e58f41cbea206196e5717ce4f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortStraddleStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Straddle and Short Straddle strategies.\n    /// </summary>\n    public class LongAndShortStraddleStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _straddle;\n        private OptionStrategy _shortStraddle;\n\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contracts = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .GroupBy(x => new { x.Strike, x.Expiry })\n                .FirstOrDefault(group => group.Any(x => x.Right == OptionRight.Call) && group.Any(x => x.Right == OptionRight.Put));\n\n            if (contracts != null)\n            {\n                var contract = contracts.First();\n\n                _straddle = OptionStrategies.Straddle(_optionSymbol, contract.Strike, contract.Expiry);\n                _shortStraddle = OptionStrategies.ShortStraddle(_optionSymbol, contract.Strike, contract.Expiry);\n                Buy(_straddle, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var callPosition = positionGroup.Positions.Single(x => x.Symbol.ID.OptionRight == OptionRight.Call);\n            var putPosition = positionGroup.Positions.Single(x => x.Symbol.ID.OptionRight == OptionRight.Put);\n\n            var expectedCallPositionQuantity = 2;\n            var expectedPutPositionQuantity = 2;\n\n            if (callPosition.Quantity != expectedCallPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected call position quantity to be {expectedCallPositionQuantity}. Actual: {callPosition.Quantity}\");\n            }\n\n            if (putPosition.Quantity != expectedPutPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected put position quantity to be {expectedPutPositionQuantity}. Actual: {putPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We should be able to close the position using the inverse strategy (a short straddle)\n            Buy(_shortStraddle, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"998974.8\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.20\"},\n            {\"Estimated Strategy Capacity\", \"$16000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM92QHN8ZQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.31%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c9b2bbdb35e439484e1ae97cfdfa2977\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongAndShortStrangleStrategiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Strangle and Short Strangle strategies.\n    /// </summary>\n    public class LongAndShortStrangleStrategiesAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _strangle;\n        private OptionStrategy _shortStrangle;\n\n        protected override int ExpectedOrdersCount { get; } = 4;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contracts = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .GroupBy(x => x.Expiry);\n\n\n            OptionContract callContract = null;\n            OptionContract putContract = null;\n            foreach (var group in contracts)\n            {\n                var callContracts = group.Where(x => x.Right == OptionRight.Call).OrderByDescending(x => x.Strike).ToList();\n                var putContracts = group.Where(x => x.Right == OptionRight.Put).OrderBy(x => x.Strike).ToList();\n\n                if (callContracts.Count > 0 && putContracts.Count > 0 && callContracts[0].Strike > putContracts[0].Strike)\n                {\n                    callContract = callContracts[0];\n                    putContract = putContracts[0];\n                    break;\n                }\n            }\n\n            if (callContract != null && putContract != null)\n            {\n                _strangle = OptionStrategies.Strangle(_optionSymbol, callContract.Strike, putContract.Strike, callContract.Expiry);\n                _shortStrangle = OptionStrategies.ShortStrangle(_optionSymbol, callContract.Strike, putContract.Strike, callContract.Expiry);\n                Buy(_strangle, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 2)\n            {\n                throw new RegressionTestException($\"Expected position group to have 2 positions. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var callPosition = positionGroup.Positions.Single(x => x.Symbol.ID.OptionRight == OptionRight.Call);\n            var putPosition = positionGroup.Positions.Single(x => x.Symbol.ID.OptionRight == OptionRight.Put);\n\n            var expectedCallPositionQuantity = 2;\n            var expectedPutPositionQuantity = 2;\n\n            if (callPosition.Quantity != expectedCallPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected call position quantity to be {expectedCallPositionQuantity}. Actual: {callPosition.Quantity}\");\n            }\n\n            if (putPosition.Quantity != expectedPutPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected put position quantity to be {expectedPutPositionQuantity}. Actual: {putPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // Now we should be able to close the position using the inverse strategy (a short strangle)\n            Buy(_shortStrangle, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999194.8\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.20\"},\n            {\"Estimated Strategy Capacity\", \"$15000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMELSHV6AU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.21%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7037493f637362745f993c1dc940bd05\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/LongOnlyAlphaStreamAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic template framework algorithm uses framework components to define the algorithm.\n    /// Shows EqualWeightingPortfolioConstructionModel.LongOnly() application\n    /// </summary>\n    /// <meta name=\"tag\" content=\"alpha streams\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"algorithm framework\" />\n    public class LongOnlyAlphaStreamAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            // 1. Required: \n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            // 2. Required: Alpha Streams Models:\n            SetBrokerageModel(BrokerageName.AlphaStreams);\n\n            // 3. Required: Significant AUM Capacity\n            SetCash(1000000);\n\n            // Only SPY will be traded\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Resolution.Daily, PortfolioBias.Long));\n            SetExecution(new ImmediateExecutionModel());\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            // set algorithm framework models\n            SetUniverseSelection(\n                new ManualUniverseSelectionModel(\n                    new[] {\"SPY\", \"IBM\"}\n                        .Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA))\n                )\n            );\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested) return;\n\n            EmitInsights(\n                Insight.Price(\"SPY\", TimeSpan.FromDays(1), InsightDirection.Up),\n                Insight.Price(\"IBM\", TimeSpan.FromDays(1), InsightDirection.Down)\n            );\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                if (Securities[orderEvent.Symbol].Holdings.IsShort)\n                {\n                    throw new RegressionTestException(\"Invalid position, should not be short\");\n                }\n                Debug($\"Purchased Stock: {orderEvent}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7843;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.99%\"},\n            {\"Average Loss\", \"-0.60%\"},\n            {\"Compounding Annual Return\", \"216.678%\"},\n            {\"Drawdown\", \"2.300%\"},\n            {\"Expectancy\", \"0.318\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1014847.05\"},\n            {\"Net Profit\", \"1.485%\"},\n            {\"Sharpe Ratio\", \"7.265\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"64.957%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.64\"},\n            {\"Alpha\", \"-0.36\"},\n            {\"Beta\", \"1.003\"},\n            {\"Annual Standard Deviation\", \"0.223\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-100.088\"},\n            {\"Tracking Error\", \"0.004\"},\n            {\"Treynor Ratio\", \"1.617\"},\n            {\"Total Fees\", \"$309.75\"},\n            {\"Estimated Strategy Capacity\", \"$15000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"179.37%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"15b25d354d282abb9adfcc80bd4d67bc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MACDTrendAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Simple indicator demonstration algorithm of MACD\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    public class MACDTrendAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _previous;\n        private MovingAverageConvergenceDivergence _macd;\n        private readonly string _symbol = \"SPY\";\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2004, 01, 01);\n            SetEndDate(2015, 01, 01);\n\n            AddSecurity(SecurityType.Equity, _symbol, Resolution.Daily);\n\n            // define our daily macd(12,26) with a 9 day signal\n            _macd = MACD(_symbol, 12, 26, 9, MovingAverageType.Exponential, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // only once per day\n            if (_previous.Date == Time.Date) return;\n\n            if (!_macd.IsReady) return;\n\n            var holding = Portfolio[_symbol];\n\n            var signalDeltaPercent = (_macd - _macd.Signal)/_macd.Fast;\n            var tolerance = 0.0025m;\n\n            // if our macd is greater than our signal, then let's go long\n            if (holding.Quantity <= 0 && signalDeltaPercent > tolerance) // 0.01%\n            {\n                // longterm says buy as well\n                SetHoldings(_symbol, 1.0);\n            }\n            // of our macd is less than our signal, then let's go short\n            else if (holding.Quantity >= 0 && signalDeltaPercent < -tolerance)\n            {\n                Liquidate(_symbol);\n            }\n\n            // plot both lines\n            Plot(\"MACD\", _macd, _macd.Signal);\n            if (slice.Bars.ContainsKey(_symbol))\n            {\n                Plot(_symbol, \"Open\", slice[_symbol].Open);\n            }\n            Plot(_symbol, _macd.Fast, _macd.Slow);\n\n            _previous = Time;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 22136;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"85\"},\n            {\"Average Win\", \"4.78%\"},\n            {\"Average Loss\", \"-4.16%\"},\n            {\"Compounding Annual Return\", \"2.952%\"},\n            {\"Drawdown\", \"34.900%\"},\n            {\"Expectancy\", \"0.228\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"137751.04\"},\n            {\"Net Profit\", \"37.751%\"},\n            {\"Sharpe Ratio\", \"0.029\"},\n            {\"Sortino Ratio\", \"0.022\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.141%\"},\n            {\"Loss Rate\", \"43%\"},\n            {\"Win Rate\", \"57%\"},\n            {\"Profit-Loss Ratio\", \"1.15\"},\n            {\"Alpha\", \"-0.015\"},\n            {\"Beta\", \"0.411\"},\n            {\"Annual Standard Deviation\", \"0.103\"},\n            {\"Annual Variance\", \"0.011\"},\n            {\"Information Ratio\", \"-0.34\"},\n            {\"Tracking Error\", \"0.123\"},\n            {\"Treynor Ratio\", \"0.007\"},\n            {\"Total Fees\", \"$468.54\"},\n            {\"Estimated Strategy Capacity\", \"$950000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.09%\"},\n            {\"Drawdown Recovery\", \"1931\"},\n            {\"OrderListHash\", \"0257edfddd889d6fe3779883138aebc5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MacdAlphaModelFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"MacdAlphaModel\"/>.\n    /// </summary>\n    public class MacdAlphaModelFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetAlpha(new MacdAlphaModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            const int expected = 4;\n            if (Insights.TotalCount != expected)\n            {\n                throw new RegressionTestException($\"The total number of insights should be {expected}. Actual: {Insights.TotalCount}\");\n            }\n        }\n\n        public override int AlgorithmHistoryDataPoints => 136;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"29\"},\n            {\"Average Win\", \"0.36%\"},\n            {\"Average Loss\", \"-0.49%\"},\n            {\"Compounding Annual Return\", \"30.410%\"},\n            {\"Drawdown\", \"1.800%\"},\n            {\"Expectancy\", \"0.335\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102206.31\"},\n            {\"Net Profit\", \"2.206%\"},\n            {\"Sharpe Ratio\", \"3.159\"},\n            {\"Sortino Ratio\", \"5.45\"},\n            {\"Probabilistic Sharpe Ratio\", \"75.413%\"},\n            {\"Loss Rate\", \"23%\"},\n            {\"Win Rate\", \"77%\"},\n            {\"Profit-Loss Ratio\", \"0.73\"},\n            {\"Alpha\", \"0.275\"},\n            {\"Beta\", \"-0.371\"},\n            {\"Annual Standard Deviation\", \"0.065\"},\n            {\"Annual Variance\", \"0.004\"},\n            {\"Information Ratio\", \"0.14\"},\n            {\"Tracking Error\", \"0.091\"},\n            {\"Treynor Ratio\", \"-0.55\"},\n            {\"Total Fees\", \"$65.88\"},\n            {\"Estimated Strategy Capacity\", \"$7500000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"16.15%\"},\n            {\"Drawdown Recovery\", \"9\"},\n            {\"OrderListHash\", \"028da9558692fed9991723beeb8eeb23\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ManualContinuousFuturesPositionRolloverFromSymbolChangedEventHandlerRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the new symbol, on a security changed event,\n    /// is added to the securities collection and is tradable.\n    /// This specific algorithm tests the manual rollover with the symbol changed event\n    /// that is received in the <see cref=\"OnSymbolChangedEvents(SymbolChangedEvents)\"/> handler.\n    /// </summary>\n    public class ManualContinuousFuturesPositionRolloverFromSymbolChangedEventHandlerRegressionAlgorithm\n        : ManualContinuousFuturesPositionRolloverRegressionAlgorithm\n    {\n        public override void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged)\n        {\n            if (!Portfolio.Invested)\n            {\n                return;\n            }\n\n            ManualPositionsRollover(symbolsChanged);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ManualContinuousFuturesPositionRolloverRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing System.Globalization;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing Futures = QuantConnect.Securities.Futures;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the new symbol, on a security changed event,\n    /// is added to the securities collection and is tradable.\n    /// This specific algorithm tests the manual rollover with the symbol changed event\n    /// that is received in the slice in <see cref=\"OnData(Slice)\"/>.\n    /// </summary>\n    public class ManualContinuousFuturesPositionRolloverRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 7, 1);\n            SetEndDate(2014, 1, 1);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0\n            );\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                Order(_continuousContract.Mapped, 1);\n            }\n            else\n            {\n                ManualPositionsRollover(slice.SymbolChangedEvents);\n            }\n        }\n\n        protected void ManualPositionsRollover(SymbolChangedEvents symbolChangedEvents)\n        {\n            foreach (var changedEvent in symbolChangedEvents.Values)\n            {\n                Debug($\"{Time} - SymbolChanged event: {changedEvent}\");\n\n                // This access will throw if any of the symbols are not in the securities collection\n                var oldSecurity = Securities[changedEvent.OldSymbol];\n                var newSecurity = Securities[changedEvent.NewSymbol];\n\n                if (!oldSecurity.Invested) continue;\n\n                // Rolling over: liquidate any position of the old mapped contract and switch to the newly mapped contract\n                var quantity = oldSecurity.Holdings.Quantity;\n                var tag = $\"Rollover - Symbol changed at {Time.ToString(CultureInfo.GetCultureInfo(\"en-US\"))}: {changedEvent.OldSymbol} -> {changedEvent.NewSymbol}\";\n                Liquidate(symbol: oldSecurity.Symbol, tag: tag);\n                Order(newSecurity.Symbol, quantity, tag: tag);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Transactions.OrdersCount < 3)\n            {\n                throw new RegressionTestException(\"Expected at least 3 orders.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 162575;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"7.01%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"15.617%\"},\n            {\"Drawdown\", \"1.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"107578.9\"},\n            {\"Net Profit\", \"7.579%\"},\n            {\"Sharpe Ratio\", \"1.706\"},\n            {\"Sortino Ratio\", \"0.919\"},\n            {\"Probabilistic Sharpe Ratio\", \"88.924%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.08\"},\n            {\"Beta\", \"0.094\"},\n            {\"Annual Standard Deviation\", \"0.059\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-1.246\"},\n            {\"Tracking Error\", \"0.094\"},\n            {\"Treynor Ratio\", \"1.06\"},\n            {\"Total Fees\", \"$6.45\"},\n            {\"Estimated Strategy Capacity\", \"$2900000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VMKLFZIH2MTD\"},\n            {\"Portfolio Turnover\", \"1.37%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"7591ea8b91c4aa958b305555fea96862\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm illustrating how to manually set market hours and symbol properties database entries to be picked up by the algorithm's securities.\n    /// This specific case illustrates how to do it for CFDs to match InteractiveBrokers brokerage, which has different market hours\n    /// depending on the CFD underlying asset.\n    /// </summary>\n    public class ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 07);\n            SetCash(100000);\n\n            SetBrokerageModel(Brokerages.BrokerageName.InteractiveBrokersBrokerage);\n\n            // Some brokerages like InteractiveBrokers make a difference on CFDs depending on the underlying (equity, index, metal, forex).\n            // Depending on this, the market hours can be different. In order to be more specific with the market hours,\n            // we can set the MarketHoursDatabase entry for the CFDs.\n\n            // Equity CFDs are usually traded the same hours as the equity market.\n            var equityMarketHoursEntry = MarketHoursDatabase.GetEntry(Market.USA, (string)null, SecurityType.Equity);\n            MarketHoursDatabase.SetEntry(Market.InteractiveBrokers, null, SecurityType.Cfd,\n                equityMarketHoursEntry.ExchangeHours, equityMarketHoursEntry.DataTimeZone);\n\n            // The same can be done for the symbol properties, in case they are different depending on the underlying\n            var equitySymbolProperties = SymbolPropertiesDatabase.GetSymbolProperties(Market.USA, null, SecurityType.Equity, Currencies.USD);\n            SymbolPropertiesDatabase.SetEntry(Market.InteractiveBrokers, null, SecurityType.Cfd, equitySymbolProperties);\n\n            var spyCfd = AddCfd(\"SPY\", market: Market.InteractiveBrokers);\n\n            if (!ReferenceEquals(spyCfd.Exchange.Hours, equityMarketHoursEntry.ExchangeHours))\n            {\n                throw new RegressionTestException(\"Expected the SPY CFD market hours to be the same as the underlying equity market hours.\");\n            }\n\n            if (!ReferenceEquals(spyCfd.SymbolProperties, equitySymbolProperties))\n            {\n                throw new RegressionTestException(\"Expected the SPY CFD symbol properties to be the same as the underlying equity symbol properties.\");\n            }\n\n            // We can also do it for a specific ticker:\n            var audUsdForexMarketHoursEntry = MarketHoursDatabase.GetEntry(Market.Oanda, (string)null, SecurityType.Forex);\n            MarketHoursDatabase.SetEntry(Market.InteractiveBrokers, \"AUDUSD\", SecurityType.Cfd,\n                audUsdForexMarketHoursEntry.ExchangeHours, audUsdForexMarketHoursEntry.DataTimeZone);\n\n            var audUsdForexSymbolProperties = SymbolPropertiesDatabase.GetSymbolProperties(Market.Oanda, \"AUDUSD\", SecurityType.Forex, Currencies.USD);\n            SymbolPropertiesDatabase.SetEntry(Market.InteractiveBrokers, \"AUDUSD\", SecurityType.Cfd, audUsdForexSymbolProperties);\n\n            var audUsdCfd = AddCfd(\"AUDUSD\", market: Market.InteractiveBrokers);\n\n            if (!ReferenceEquals(audUsdCfd.Exchange.Hours, audUsdForexMarketHoursEntry.ExchangeHours))\n            {\n                throw new RegressionTestException(\"Expected the AUDUSD CFD market hours to be the same as the underlying forex market hours.\");\n            }\n\n            if (!ReferenceEquals(audUsdCfd.SymbolProperties, audUsdForexSymbolProperties))\n            {\n                throw new RegressionTestException(\"Expected the AUDUSD CFD symbol properties to be the same as the underlying forex symbol properties.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MappedBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm using a benchmark security which should be mapped from SPWR to SPWRA during the backtest\n    /// </summary>\n    public class MappedBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2008, 08, 20);\n            SetEndDate(2008, 10, 1);\n\n            SetBenchmark(\"SPWR\");\n            AddEquity(\"SPY\", Resolution.Hour);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 430;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-50.371%\"},\n            {\"Drawdown\", \"12.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"92136.86\"},\n            {\"Net Profit\", \"-7.863%\"},\n            {\"Sharpe Ratio\", \"-1.217\"},\n            {\"Sortino Ratio\", \"-1.275\"},\n            {\"Probabilistic Sharpe Ratio\", \"15.177%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.286\"},\n            {\"Beta\", \"0.262\"},\n            {\"Annual Standard Deviation\", \"0.335\"},\n            {\"Annual Variance\", \"0.112\"},\n            {\"Information Ratio\", \"0.074\"},\n            {\"Tracking Error\", \"0.721\"},\n            {\"Treynor Ratio\", \"-1.551\"},\n            {\"Total Fees\", \"$5.10\"},\n            {\"Estimated Strategy Capacity\", \"$180000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.30%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"a27fe8cbd54877fe74d0536e685196fa\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarginCallClosedMarketRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Margin model regression algorithm testing <see cref=\"PatternDayTradingMarginModel\"/> and\n    /// margin calls being triggered when the market is about to close, GH issue 4064.\n    /// Brother too <see cref=\"NoMarginCallExpectedRegressionAlgorithm\"/>\n    /// </summary>\n    public class MarginCallClosedMarketRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _marginCall;\n        private Symbol _spy;\n        private decimal _closedMarketLeverage;\n        private decimal _openMarketLeverage;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var security = AddEquity(\"SPY\", Resolution.Minute);\n            _spy = security.Symbol;\n\n            _closedMarketLeverage = 2;\n            _openMarketLeverage = 5;\n            security.BuyingPowerModel = new PatternDayTradingMarginModel(_closedMarketLeverage, _openMarketLeverage);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, _openMarketLeverage);\n            }\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            _marginCall++;\n            foreach (var order in requests.ToList())\n            {\n                var quantityHold = Securities[_spy].Holdings.Quantity;\n                // we should reduce our position by the same relation between the open and closed market leverage\n                var expectedFinalQuantity = quantityHold * _closedMarketLeverage / _openMarketLeverage;\n\n                var actualFinalQuantity = quantityHold + order.Quantity;\n\n                // leave a 1% margin for are expected calculations\n                if (Math.Abs(expectedFinalQuantity - actualFinalQuantity) > (quantityHold * 0.01m))\n                {\n                    throw new RegressionTestException($\"Expected {expectedFinalQuantity} final quantity but was {actualFinalQuantity}\");\n                }\n\n                if (!Securities[_spy].Exchange.ExchangeOpen\n                    || !Securities[_spy].Exchange.ClosingSoon)\n                {\n                    throw new RegressionTestException($\"Expected exchange to be open: {Securities[_spy].Exchange.ExchangeOpen} and to be closing soon: {Securities[_spy].Exchange.ClosingSoon}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_marginCall != 1)\n            {\n                throw new RegressionTestException($\"We expected a single margin call to happen, {_marginCall} occurred\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.39%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"1750.998%\"},\n            {\"Drawdown\", \"5.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103801.65\"},\n            {\"Net Profit\", \"3.802%\"},\n            {\"Sharpe Ratio\", \"18.012\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.762%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"4.101\"},\n            {\"Beta\", \"2.017\"},\n            {\"Annual Standard Deviation\", \"0.449\"},\n            {\"Annual Variance\", \"0.201\"},\n            {\"Information Ratio\", \"26.993\"},\n            {\"Tracking Error\", \"0.226\"},\n            {\"Treynor Ratio\", \"4.008\"},\n            {\"Total Fees\", \"$27.50\"},\n            {\"Estimated Strategy Capacity\", \"$22000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"158.79%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"a6d4b7e1b4255477e693d6773996b6fe\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarginCallEventsAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm showcases two margin related event handlers.\n    /// OnMarginCallWarning: Fired when a portfolio's remaining margin dips below 5% of the total portfolio value\n    /// OnMarginCall: Fired immediately before margin call orders are execued, this gives the algorithm a change to regain margin on its own through liquidation\n    /// </summary>\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    /// <meta name=\"tag\" content=\"margin models\" />\n    public class MarginCallEventsAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);  //Set Start Date\n            SetEndDate(2013, 12, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Second);\n\n            // cranking up the leverage increases the odds of a margin call when the security falls in value\n            Securities[\"SPY\"].SetLeverage(100);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                Liquidate();\n                SetHoldings(\"SPY\", 100);\n            }\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            // this code gets called BEFORE the orders are placed, so we can try to liquidate some of our positions\n            // before we get the margin call orders executed. We could also modify these orders by changing their\n            // quantities\n            foreach (var order in requests.ToList())\n            {\n                // liquidate an extra 10% each time we get a margin call to give us more padding\n                var newQuantity = (int)(order.Quantity * 1.1m);\n                requests.Remove(order);\n                requests.Add(new SubmitOrderRequest(order.OrderType, order.SecurityType, order.Symbol, newQuantity, order.StopPrice, order.LimitPrice, Time, \"OnMarginCall\"));\n            }\n        }\n\n        /// <summary>\n        /// Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue\n        /// </summary>\n        public override void OnMarginCallWarning()\n        {\n            // this code gets called when the margin remaining drops below 5% of our total portfolio value, it gives the algorithm\n            // a chance to prevent a margin call from occurring\n\n            // prevent margin calls by responding to the warning and increasing margin remaining\n            var spyHoldings = Securities[\"SPY\"].Holdings.Quantity;\n            var shares = (int)(-spyHoldings * .005m);\n            Error($\"{Time.ToStringInvariant()} - OnMarginCallWarning(): Liquidating {shares.ToStringInvariant()} shares of SPY to avoid margin call.\");\n            MarketOrder(\"SPY\", shares);\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/MarginRemainingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm reproduces GH issue 3763 (performing just 1 trade)\n    /// </summary>\n    public class MarginRemainingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private Security _appl;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2007, 1, 1);\n            SetEndDate(2010, 1, 1);\n\n            _spy = AddEquity(\"SPY\", Resolution.Daily, leverage: 1).Symbol;\n            _appl = AddEquity(\"AAPL\", Resolution.Daily, leverage: 1);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Noon, () =>\n            {\n                Plot(\"Info\", \"Portfolio.MarginRemaining\", Portfolio.MarginRemaining);\n                Plot(\"Info\", \"Portfolio.Cash\", Portfolio.Cash);\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                // 70% SPY\n                SetHoldings(_spy, 0.7);\n                Debug(\"Purchased Stock SPY\");\n            }\n\n            if (Portfolio.MarginRemaining <= 0)\n            {\n                throw new RegressionTestException($\"Unexpected margin remaining value {Portfolio.MarginRemaining}\");\n            }\n\n            // in the 2009 dip buy AAPL\n            if (Time.Year == 2009 && !_appl.Invested)\n            {\n                // 30% SPY\n                SetHoldings(_appl.Symbol, 0.3);\n                Debug(\"Purchased Stock AAPL\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6800;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"6.056%\"},\n            {\"Drawdown\", \"42.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"119303.75\"},\n            {\"Net Profit\", \"19.304%\"},\n            {\"Sharpe Ratio\", \"0.162\"},\n            {\"Sortino Ratio\", \"0.183\"},\n            {\"Probabilistic Sharpe Ratio\", \"7.738%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.057\"},\n            {\"Beta\", \"0.708\"},\n            {\"Annual Standard Deviation\", \"0.177\"},\n            {\"Annual Variance\", \"0.031\"},\n            {\"Information Ratio\", \"0.8\"},\n            {\"Tracking Error\", \"0.087\"},\n            {\"Treynor Ratio\", \"0.04\"},\n            {\"Total Fees\", \"$45.18\"},\n            {\"Estimated Strategy Capacity\", \"$410000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.09%\"},\n            {\"Drawdown Recovery\", \"707\"},\n            {\"OrderListHash\", \"39bdab2dcde5bed30c6fc3200d39e83c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketImpactSlippageModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class MarketImpactSlippageModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 13);\n            SetCash(10000000);\n\n            var spy = AddEquity(\"SPY\", Resolution.Daily);\n            var aapl = AddEquity(\"AAPL\", Resolution.Daily);\n\n            spy.SetSlippageModel(new MarketImpactSlippageModel(this));\n            aapl.SetSlippageModel(new MarketImpactSlippageModel(this));\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            SetHoldings(\"SPY\", 0.5d);\n            SetHoldings(\"AAPL\", -0.5d);\n        }\n\n        /// <summary>\n        /// OnOrderEvent is called whenever an order is updated\n        /// </summary>\n        /// <param name=\"orderEvent\">Order Event</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            { \n                Debug($\"Price: {Securities[orderEvent.Symbol].Price}, filled price: {orderEvent.FillPrice}, quantity: {orderEvent.FillQuantity}\");\n            }\n            \n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 53;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 506;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.04%\"},\n            {\"Compounding Annual Return\", \"-93.847%\"},\n            {\"Drawdown\", \"4.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9649796.02\"},\n            {\"Net Profit\", \"-3.502%\"},\n            {\"Sharpe Ratio\", \"-2.93\"},\n            {\"Sortino Ratio\", \"-2.869\"},\n            {\"Probabilistic Sharpe Ratio\", \"7.351%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-3.355\"},\n            {\"Beta\", \"1.244\"},\n            {\"Annual Standard Deviation\", \"0.306\"},\n            {\"Annual Variance\", \"0.094\"},\n            {\"Information Ratio\", \"-20.203\"},\n            {\"Tracking Error\", \"0.142\"},\n            {\"Treynor Ratio\", \"-0.722\"},\n            {\"Total Fees\", \"$1859.00\"},\n            {\"Estimated Strategy Capacity\", \"$470000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"21.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"bee21851fd1ac425df8e01169d0db355\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of a MarketOnClose order in asynchronous mode\n    /// </summary>\n    public class MarketOnCloseOrderAsyncRegressionAlgorithm : MarketOnCloseOrderRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderBufferCheckRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the check for market on close orders time buffer\n    /// is done properly regardless of the algorithm and exchange time zones.\n    /// </summary>\n    public class MarketOnCloseOrderBufferCheckRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly TimeSpan _buffer = TimeSpan.FromMinutes(10);\n\n        private Symbol _symbol;\n        private OrderTicket _validOrderTicket;\n        private OrderTicket _invalidOrderTicket;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            // Let's set the algorithm time zone to one that is ahead of the security's exchange time zone to test the MOC orders buffer check.\n            SetTimeZone(TimeZones.London);\n\n            _symbol = AddEquity(\"SPY\").Symbol;\n\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = _buffer;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_validOrderTicket != null && _invalidOrderTicket != null)\n            {\n                return;\n            }\n\n            var security = Securities[_symbol];\n            var nextUtcMarketCloseTime = security.Exchange.Hours\n                .GetNextMarketClose(security.LocalTime, false)\n                .ConvertToUtc(security.Exchange.TimeZone);\n\n            var latestSubmissionTime = nextUtcMarketCloseTime - _buffer;\n            // Place an order when we are close to the latest allowed submission time\n            if (_validOrderTicket == null && UtcTime >= latestSubmissionTime - TimeSpan.FromMinutes(5) && UtcTime <= latestSubmissionTime)\n            {\n                _validOrderTicket = MarketOnCloseOrder(_symbol, 1);\n\n                if (_validOrderTicket.Status == OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException(\"MOC order placed at the last minute was expected to be valid.\");\n                }\n            }\n\n            // Place an order when we are past the latest allowed submission time\n            if (_invalidOrderTicket == null && UtcTime > latestSubmissionTime)\n            {\n                _invalidOrderTicket = MarketOnCloseOrder(_symbol, 1);\n\n                if (_invalidOrderTicket.Status != OrderStatus.Invalid ||\n                    _invalidOrderTicket.SubmitRequest.Response.ErrorCode != OrderResponseErrorCode.MarketOnCloseOrderTooLate)\n                {\n                    throw new RegressionTestException(\n                        \"MOC order placed after the latest allowed submission time was not rejected or the reason was not the submission time\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Set it back to default for other regressions\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = Orders.MarketOnCloseOrder.DefaultSubmissionTimeBuffer;\n\n            if (_validOrderTicket == null)\n            {\n                throw new RegressionTestException(\"Valid MOC order was not placed\");\n            }\n\n            // Verify that our good order filled\n            if (_validOrderTicket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"MOC order failed to fill\");\n            }\n\n            if (_invalidOrderTicket == null)\n            {\n                throw new RegressionTestException(\"Invalid MOC order was not placed\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 795;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99999\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$67000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.14%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e44ec9a38c118cc34a487dcfa645a658\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test is a version of <see cref=\"MarketOnCloseOrderBufferRegressionAlgorithm\"/>\n    /// where we test market-on-close modeling with data from the post market.\n    /// </summary>\n    public class MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _validOrderTicket;\n        private OrderTicket _invalidOrderTicket;\n        private OrderTicket _validOrderTicketAtMidnight;\n        private OrderTicket _validOrderTicketExtendedMarketHours;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7); //Set Start Date\n            SetEndDate(2013, 10, 8); //Set End Date\n\n            var ticker = \"SPY\";\n            AddEquity(ticker, Resolution.Minute, extendedMarketHours: true);\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.Midnight, () =>\n            {\n                _validOrderTicketAtMidnight = MarketOnCloseOrder(\"SPY\", 2);\n            });\n\n            // Modify our submission buffer time to 10 minutes\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = TimeSpan.FromMinutes(10);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Test our ability to submit MarketOnCloseOrders\n            // Because we set our buffer to 10 minutes, any order placed\n            // before 3:50PM should be accepted, any after marked invalid\n            if (Time.Hour == 15 && Time.Minute == 49 && _validOrderTicket == null)\n            {\n                // Will not throw an order error and execute\n                _validOrderTicket = MarketOnCloseOrder(\"SPY\", 2);\n            }\n\n            if (Time.Hour == 15 && Time.Minute == 51 && _invalidOrderTicket == null)\n            {\n                // Will throw an order error and be marked invalid\n                _invalidOrderTicket = MarketOnCloseOrder(\"SPY\", 2);\n            }\n\n            if (Time.Hour == 16 && Time.Minute == 48 && _validOrderTicketExtendedMarketHours == null)\n            {\n                // Will not throw an order error and execute\n                _validOrderTicketExtendedMarketHours = MarketOnCloseOrder(\"SPY\", 2);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Set it back to default for other regressions\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = Orders.MarketOnCloseOrder.DefaultSubmissionTimeBuffer;\n\n            // Verify that our good order filled\n            if (_validOrderTicket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Valid order failed to fill\");\n            }\n\n            // Verify our order was marked invalid\n            if (_invalidOrderTicket.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException(\"Invalid order was not rejected\");\n            }\n\n            // Verify that our second good order filled\n            if (_validOrderTicketExtendedMarketHours.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Valid order during extended market hours failed to fill\");\n            }\n\n            // Verify that our third good order filled\n            if (_validOrderTicketAtMidnight.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Valid order at midnight failed to fill\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3862;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99996.08\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$910000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.43%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"df8ee16902d30659c4b1411075e9fc23\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderBufferRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class MarketOnCloseOrderBufferRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private OrderTicket _validOrderTicket;\n        private OrderTicket _invalidOrderTicket;\n        private OrderTicket _validOrderTicketExtendedMarketHours;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7); //Set Start Date\n            SetEndDate(2013, 10, 8); //Set End Date\n\n            var ticker = \"SPY\";\n            AddEquity(ticker, Resolution.Minute);\n\n            Schedule.On(DateRules.Today, TimeRules.At(17,00), () =>\n            {\n                _validOrderTicketExtendedMarketHours = MarketOnCloseOrder(\"SPY\", 2);\n            });\n\n            // Modify our submission buffer time to 10 minutes\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = TimeSpan.FromMinutes(10);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Test our ability to submit MarketOnCloseOrders\n            // Because we set our buffer to 10 minutes, any order placed\n            // before 3:50PM should be accepted, any after marked invalid\n            if (Time.Hour == 15 && Time.Minute == 49 && _validOrderTicket == null)\n            {\n                // Will not throw an order error and execute\n                _validOrderTicket = MarketOnCloseOrder(\"SPY\", 2);\n            }\n\n            if (Time.Hour == 15 && Time.Minute == 51 && _invalidOrderTicket == null)\n            {\n                // Will throw an order error and be marked invalid\n                _invalidOrderTicket = MarketOnCloseOrder(\"SPY\", 2);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Set it back to default for other regressions\n            Orders.MarketOnCloseOrder.SubmissionTimeBuffer = Orders.MarketOnCloseOrder.DefaultSubmissionTimeBuffer;\n\n            // Verify that our good order filled\n            if (_validOrderTicket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Valid order failed to fill\");\n            }\n\n            // Verify our order was marked invalid\n            if (_invalidOrderTicket.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException(\"Invalid order was not rejected\");\n            }\n\n            // Verify that our second good order filled\n            if (_validOrderTicketExtendedMarketHours.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Valid order during extended market hours failed to fill\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99994.65\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$18000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.29%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"105d3eb1a9b673ce88238a93a63d6d08\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that MarketOnClose orders are filled with official close price.\n    /// </summary>\n    public class MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 8);\n            SetCash(1000000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Tick, extendedMarketHours: true, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n\n            Schedule.On(DateRules.EveryDay(_symbol),\n                TimeRules.BeforeMarketClose(_symbol, 20),\n                () => MarketOnCloseOrder(_symbol, 1));\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Debug(orderEvent.ToString());\n\n                if (!string.IsNullOrEmpty(orderEvent.Message))\n                {\n                    throw new RegressionTestException($\"OrderEvent.Message should be empty, but is '{orderEvent.Message}'\");\n                }\n\n                var order = Transactions.GetOrderById(orderEvent.OrderId);\n                if (!string.IsNullOrEmpty(order.Tag))\n                {\n                    throw new RegressionTestException($\"Order.Tag should be empty, but is '{order.Tag}'\");\n                }\n\n                var expectedFillPrice = orderEvent.UtcTime.Date == StartDate.Date ? 167.42m : 165.48m;\n                if (orderEvent.FillPrice != expectedFillPrice)\n                {\n                    throw new RegressionTestException(\n                        $\"Expected {orderEvent.UtcTime.Date} order fill price to be {expectedFillPrice} but was {orderEvent.FillPrice}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var orders = Transactions.GetOrders().ToList();\n\n            // We expect 2 orders, one for each day\n            var expectedOrdersCount = 2;\n            if (orders.Count != expectedOrdersCount)\n            {\n                throw new RegressionTestException($\"Expected {expectedOrdersCount} orders, but found {orders.Count}\");\n            }\n\n            if (orders.Any(x => x.Status != OrderStatus.Filled))\n            {\n                throw new RegressionTestException(\n                    $\"Expected all orders to be filled, but found {orders.Count(x => x.Status != OrderStatus.Filled)} unfilled orders\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7077871;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999997\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9d53c0501981b8d3aa922bbc45b6e80f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnCloseOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of a MarketOnClose order\n    /// </summary>\n    public class MarketOnCloseOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private OrderTicket _ticket;\n\n        protected virtual bool AsynchronousOrders => false;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 03, 01);\n            SetEndDate(2021, 03, 03);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.Noon, () =>\n            {\n                _ticket = MarketOnCloseOrder(_symbol, 1, asynchronous: AsynchronousOrders);\n                if (_ticket.Status != OrderStatus.New && _ticket.Status != OrderStatus.Submitted)\n                {\n                    throw new RegressionTestException($\"Expected the MarketOnClose order to be New or Submitted, instead found {_ticket.Status}\");\n                }\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_ticket == null)\n            {\n                throw new RegressionTestException(\"Expected to have placed a MarketOnClose order\");\n            }\n\n            if (_ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException($\"Expected the MarketOnClose order to be filled, instead found {_ticket.Status}\");\n            }\n\n            if (_ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n            {\n                throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.832%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99993.90\"},\n            {\"Net Profit\", \"-0.006%\"},\n            {\"Sharpe Ratio\", \"-22.06\"},\n            {\"Sortino Ratio\", \"-22.06\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"0.008\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"15.221\"},\n            {\"Tracking Error\", \"0.061\"},\n            {\"Treynor Ratio\", \"-1.348\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$53000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1add16936335a9c85b72eed80dcacb39\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnOpenOnCloseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of the Market On Close order for US Equities.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    public class MarketOnOpenOnCloseAlgorithm : QCAlgorithm\n    {\n        private bool _submittedMarketOnCloseToday;\n        private Security _security;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Second, fillForward: true, extendedMarketHours: true);\n\n            _security = Securities[\"SPY\"];\n        }\n\n        private DateTime last = DateTime.MinValue;\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Time.Date != last.Date) // each morning submit a market on open order\n            {\n                _submittedMarketOnCloseToday = false;\n                MarketOnOpenOrder(\"SPY\", 100);\n                last = Time;\n            }\n            if (!_submittedMarketOnCloseToday && _security.Exchange.ExchangeOpen) // once the exchange opens submit a market on close order\n            {\n                _submittedMarketOnCloseToday = true;\n                MarketOnCloseOrder(\"SPY\", -100);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            Console.WriteLine(Time + \" - \" + order.Type + \" - \" + orderEvent.Status + \":: \" + orderEvent);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnOpenOrderAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of MarketOnOpen orders in asynchronous mode.\n    /// </summary>\n    public class MarketOnOpenOrderAsyncRegressionAlgorithm : MarketOnOpenOrderRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that MarketOnOpen orders are filled with official open price.\n    /// </summary>\n    public class MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 8);\n            SetCash(1000000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Tick, extendedMarketHours: true, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n\n            Schedule.On(DateRules.EveryDay(_symbol),\n                TimeRules.At(new TimeSpan(6, 0, 0), TimeZone),\n                () => MarketOnOpenOrder(_symbol, 1));\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log(orderEvent.ToString());\n\n                if (!string.IsNullOrEmpty(orderEvent.Message))\n                {\n                    throw new RegressionTestException($\"OrderEvent.Message should be empty, but is '{orderEvent.Message}'\");\n                }\n\n                var order = Transactions.GetOrderById(orderEvent.OrderId);\n                if (!string.IsNullOrEmpty(order.Tag))\n                {\n                    throw new RegressionTestException($\"Order.Tag should be empty, but is '{order.Tag}'\");\n                }\n\n                var expectedFillPrice = orderEvent.UtcTime.Date == StartDate.Date ? 167.43m : 167.45m;\n                if (orderEvent.FillPrice != expectedFillPrice)\n                {\n                    throw new RegressionTestException(\n                        $\"Expected {orderEvent.UtcTime.Date} order fill price to be {expectedFillPrice} but was {orderEvent.FillPrice}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var orders = Transactions.GetOrders().ToList();\n\n            // We expect 2 orders, one for each day\n            var expectedOrdersCount = 2;\n            if (orders.Count != expectedOrdersCount)\n            {\n                throw new RegressionTestException($\"Expected {expectedOrdersCount} orders, but found {orders.Count}\");\n            }\n\n            if (orders.Any(x => x.Status != OrderStatus.Filled))\n            {\n                throw new RegressionTestException(\n                    $\"Expected all orders to be filled, but found {orders.Count(x => x.Status != OrderStatus.Filled)} unfilled orders\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7077871;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999995.02\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e1d37155b945867337ae64a1807bf0ce\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOnOpenOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of MarketOnOpen orders.\n    /// </summary>\n    public class MarketOnOpenOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private List<OrderTicket> _tickets = new();\n\n        protected virtual bool AsynchronousOrders => false;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 03, 01);\n            SetEndDate(2021, 03, 03);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            Schedule.On(DateRules.Tomorrow, TimeRules.Midnight, () =>\n            {\n                _tickets.Add(MarketOnOpenOrder(_symbol, 1, asynchronous: AsynchronousOrders));\n\n                var marketOrderTicket = MarketOrder(_symbol, 1, asynchronous: AsynchronousOrders);\n                _tickets.Add(marketOrderTicket);\n\n                if (marketOrderTicket.OrderType != OrderType.MarketOnOpen)\n                {\n                    throw new RegressionTestException($\"Expected order type to be MarketOnOpen, but was {marketOrderTicket.OrderType}\");\n                }\n\n                foreach (var ticket in _tickets)\n                {\n                    if (ticket.Status != OrderStatus.New && ticket.Status != OrderStatus.Submitted)\n                    {\n                        throw new RegressionTestException($\"Expected tickets status to be New or Submitted, but one was {ticket.Status}\");\n                    }\n                }\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_tickets.Count == 0)\n            {\n                throw new RegressionTestException(\"Expected to have submitted orders, but did not\");\n            }\n\n            foreach (var ticket in _tickets)\n            {\n                if (ticket.Status != OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Expected tickets status to be Filled, but one was {ticket.Status}\");\n                }\n\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-2.547%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99981.16\"},\n            {\"Net Profit\", \"-0.019%\"},\n            {\"Sharpe Ratio\", \"-147.421\"},\n            {\"Sortino Ratio\", \"-147.421\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.023\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"14.89\"},\n            {\"Tracking Error\", \"0.061\"},\n            {\"Treynor Ratio\", \"-9.006\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$1400000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.26%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"56a7b3ac0475f32f06c567b494741b0d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MarketOrdersAreSupportedOnExtendedHoursForFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that market orders are supported on extended market hours for futures.\n    /// </summary>\n    public class MarketOrdersAreSupportedOnExtendedHoursForFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Future _continuousContract;\n        private Future _futureContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 6);\n            SetEndDate(2013, 10, 10);\n\n            _continuousContract = AddFuture(Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0,\n                extendedMarketHours: true\n            );\n            _futureContract = AddFutureContract(FuturesChain(_continuousContract.Symbol).First(),\n                extendedMarketHours: true);\n        }\n        public override void OnData(Slice slice)\n        {\n            if (Time.TimeOfDay.Hours > 18 && !Portfolio.Invested)\n            {\n                var futureContractMarketOrder = MarketOrder(_futureContract.Symbol, 1);\n                var continuousContractMarketOrder = MarketOrder(_continuousContract.Mapped, 1);\n                if (futureContractMarketOrder.Status == OrderStatus.Invalid || continuousContractMarketOrder.Status == OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Market orders should be allowed for futures outside of regular market hours\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Transactions.GetOrders().Any(order => order.Status != OrderStatus.Filled ))\n            {\n                throw new RegressionTestException(\"Not all orders were filled\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // 13:30 and 21:00 UTC are 9:30 and 17 New york, which are the regular market hours litimits for this security\n            if (orderEvent.Status == OrderStatus.Filled && !Securities[orderEvent.Symbol].Exchange.DateTimeIsOpen(orderEvent.UtcTime) &&\n                (orderEvent.UtcTime.TimeOfDay >= new TimeSpan(13, 30, 0) && orderEvent.UtcTime.TimeOfDay < new TimeSpan(21, 0, 0)))\n            {\n                throw new RegressionTestException($\"Order should have been filled during extended market hours\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50978;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.626%\"},\n            {\"Drawdown\", \"2.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99991.4\"},\n            {\"Net Profit\", \"-0.009%\"},\n            {\"Sharpe Ratio\", \"1.959\"},\n            {\"Sortino Ratio\", \"4.862\"},\n            {\"Probabilistic Sharpe Ratio\", \"53.257%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.239\"},\n            {\"Beta\", \"0.694\"},\n            {\"Annual Standard Deviation\", \"0.177\"},\n            {\"Annual Variance\", \"0.031\"},\n            {\"Information Ratio\", \"2.05\"},\n            {\"Tracking Error\", \"0.093\"},\n            {\"Treynor Ratio\", \"0.501\"},\n            {\"Total Fees\", \"$4.30\"},\n            {\"Estimated Strategy Capacity\", \"$15000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VU1EHIDJYLMP\"},\n            {\"Portfolio Turnover\", \"33.51%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"523d76e17b23ee0c94ded9f826cb8c22\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"MaximumDrawdownPercentPerSecurity\"/> Risk Management Model\n    /// </summary>\n    public class MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)));\n\n            SetRiskManagement(new MaximumDrawdownPercentPerSecurity(0.004m));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 304;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.41%\"},\n            {\"Compounding Annual Return\", \"-4.899%\"},\n            {\"Drawdown\", \"1.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99592.55\"},\n            {\"Net Profit\", \"-0.407%\"},\n            {\"Sharpe Ratio\", \"-3.521\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.370%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.04\"},\n            {\"Beta\", \"-0.012\"},\n            {\"Annual Standard Deviation\", \"0.012\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-4.647\"},\n            {\"Tracking Error\", \"0.05\"},\n            {\"Treynor Ratio\", \"3.644\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$74000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"6.66%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ab2645a4eeb3bbd6b2862df5260d86b4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"MaximumDrawdownPercentPortfolio\"/> Risk Management Model\n    /// </summary>\n    public class MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)));\n            \n            // define risk management model as a composite of several risk management models\n            SetRiskManagement(new CompositeRiskManagementModel(\n                new MaximumDrawdownPercentPortfolio(0.01m), // Avoid loss of initial capital\n                new MaximumDrawdownPercentPortfolio(0.015m, true) // Avoid profit losses\n            ));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 304;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"2.43%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.465%\"},\n            {\"Drawdown\", \"2.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102436.11\"},\n            {\"Net Profit\", \"2.436%\"},\n            {\"Sharpe Ratio\", \"2.474\"},\n            {\"Sortino Ratio\", \"2.224\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.764%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.124\"},\n            {\"Beta\", \"0.558\"},\n            {\"Annual Standard Deviation\", \"0.093\"},\n            {\"Annual Variance\", \"0.009\"},\n            {\"Information Ratio\", \"0.429\"},\n            {\"Tracking Error\", \"0.092\"},\n            {\"Treynor Ratio\", \"0.413\"},\n            {\"Total Fees\", \"$6.56\"},\n            {\"Estimated Strategy Capacity\", \"$57000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"6.63%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"bad8a363acf7188f901bd4ebc1897d31\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Show example of how to use the <see cref=\"MaximumSectorExposureRiskManagementModel\"/> Risk Management Model\n    /// </summary>\n    public class MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 2, 1);  //Set Start Date\n            SetEndDate(2014, 5, 1);    //Set End Date\n\n            // set algorithm framework models\n            var tickers = new string[] { \"AAPL\", \"MSFT\", \"GOOG\", \"AIG\", \"BAC\" };\n            SetUniverseSelection(new FineFundamentalUniverseSelectionModel(\n                coarse => coarse.Where(x => tickers.Contains(x.Symbol.Value)).Select(x => x.Symbol),\n                fine => fine.Select(x => x.Symbol)\n            ));\n\n            // define risk management model such that maximum weight of a single sector be 10%\n            // Number of of trades changed from 34 to 30 when using the MaximumSectorExposureRiskManagementModel\n            SetRiskManagement(new MaximumSectorExposureRiskManagementModel(0.1m));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // The MaximumSectorExposureRiskManagementModel does not expire insights\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 555;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"15\"},\n            {\"Average Win\", \"0.09%\"},\n            {\"Average Loss\", \"-0.16%\"},\n            {\"Compounding Annual Return\", \"-2.427%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"-0.544\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99396.26\"},\n            {\"Net Profit\", \"-0.604%\"},\n            {\"Sharpe Ratio\", \"-1.264\"},\n            {\"Sortino Ratio\", \"-0.962\"},\n            {\"Probabilistic Sharpe Ratio\", \"11.917%\"},\n            {\"Loss Rate\", \"71%\"},\n            {\"Win Rate\", \"29%\"},\n            {\"Profit-Loss Ratio\", \"0.60\"},\n            {\"Alpha\", \"-0.038\"},\n            {\"Beta\", \"0.078\"},\n            {\"Annual Standard Deviation\", \"0.019\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.24\"},\n            {\"Tracking Error\", \"0.092\"},\n            {\"Treynor Ratio\", \"-0.312\"},\n            {\"Total Fees\", \"$18.92\"},\n            {\"Estimated Strategy Capacity\", \"$96000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.80%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"34eff097cfac686aedf205bc2eaab4d4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"MaximumUnrealizedProfitPercentPerSecurity\"/> Risk Management Model\n    /// </summary>\n    public class MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)));\n            \n            SetRiskManagement(new MaximumUnrealizedProfitPercentPerSecurity(0.004m));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 304;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.73%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"9.396%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100732.58\"},\n            {\"Net Profit\", \"0.733%\"},\n            {\"Sharpe Ratio\", \"2.696\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"90.684%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.054\"},\n            {\"Beta\", \"0.021\"},\n            {\"Annual Standard Deviation\", \"0.022\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.56\"},\n            {\"Tracking Error\", \"0.052\"},\n            {\"Treynor Ratio\", \"2.791\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$46000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"6.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e954f20bd08ee776fa710a325715354e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MeanReversionPortfolioAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http, //www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.DataLibrary.Tests\n{\n    /// <summary>\n    /// Example algorithm of using MeanReversionPortfolioConstructionModel\n    /// </summary>\n    public class MeanReversionPortfolioAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2020, 9, 1);\n            SetEndDate(2021, 2, 28);\n            SetCash(100000);\n            \n            SetSecurityInitializer(security => security.SetMarketPrice(GetLastKnownPrice(security)));\n\n            foreach (var ticker in new List<string>{\"SPY\", \"AAPL\"})\n            {\n                AddEquity(ticker, Resolution.Daily);\n            }\n            \n            AddAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new MeanReversionPortfolioConstructionModel());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1113;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 52;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"60\"},\n            {\"Average Win\", \"1.88%\"},\n            {\"Average Loss\", \"-0.79%\"},\n            {\"Compounding Annual Return\", \"8.069%\"},\n            {\"Drawdown\", \"11.900%\"},\n            {\"Expectancy\", \"0.748\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103872.25\"},\n            {\"Net Profit\", \"3.872%\"},\n            {\"Sharpe Ratio\", \"0.349\"},\n            {\"Sortino Ratio\", \"0.375\"},\n            {\"Probabilistic Sharpe Ratio\", \"29.228%\"},\n            {\"Loss Rate\", \"48%\"},\n            {\"Win Rate\", \"52%\"},\n            {\"Profit-Loss Ratio\", \"2.37\"},\n            {\"Alpha\", \"-0.085\"},\n            {\"Beta\", \"1.234\"},\n            {\"Annual Standard Deviation\", \"0.238\"},\n            {\"Annual Variance\", \"0.057\"},\n            {\"Information Ratio\", \"-0.331\"},\n            {\"Tracking Error\", \"0.16\"},\n            {\"Treynor Ratio\", \"0.067\"},\n            {\"Total Fees\", \"$114.36\"},\n            {\"Estimated Strategy Capacity\", \"$700000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"18.24%\"},\n            {\"Drawdown Recovery\", \"63\"},\n            {\"OrderListHash\", \"22337335b8bbfb4fc1093879c3ddd4d8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MeanVarianceOptimizationFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class MeanVarianceOptimizationFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private IEnumerable<Symbol> _symbols = (new[] { \"AIG\", \"BAC\", \"IBM\", \"SPY\" }).Select(s => QuantConnect.Symbol.Create(s, SecurityType.Equity, Market.USA));\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            Settings.RebalancePortfolioOnInsightChanges = false;\n\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n\n            // set algorithm framework models\n            SetUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelector));\n            SetAlpha(new HistoricalReturnsAlphaModel(resolution: Resolution.Daily));\n            SetPortfolioConstruction(new MeanVarianceOptimizationPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        public IEnumerable<Symbol> CoarseSelector(IEnumerable<CoarseFundamental> coarse)\n        {\n            int last = Time.Day > 8 ? 3 : _symbols.Count();\n            return _symbols.Take(last);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"{orderEvent}\");\n            }\n        }\n\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14082;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 256;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"-0.26%\"},\n            {\"Compounding Annual Return\", \"508.196%\"},\n            {\"Drawdown\", \"1.800%\"},\n            {\"Expectancy\", \"-0.495\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102503.88\"},\n            {\"Net Profit\", \"2.504%\"},\n            {\"Sharpe Ratio\", \"13.426\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"68.684%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.01\"},\n            {\"Alpha\", \"1.414\"},\n            {\"Beta\", \"1.255\"},\n            {\"Annual Standard Deviation\", \"0.29\"},\n            {\"Annual Variance\", \"0.084\"},\n            {\"Information Ratio\", \"19.88\"},\n            {\"Tracking Error\", \"0.096\"},\n            {\"Treynor Ratio\", \"3.102\"},\n            {\"Total Fees\", \"$22.57\"},\n            {\"Estimated Strategy Capacity\", \"$4200000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"30.22%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"cfaa49669725a950334b55a495e130ce\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MinimumOrderMarginRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the effect of <see cref=\"IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage\"/>.\n    /// Setting a minimum order size of 1% of portfolio reduces order count significantly\n    /// </summary>\n    public class MinimumOrderMarginRegressionAlgorithm : NoMinimumOrderMarginRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n            Settings.MinimumOrderMarginPortfolioPercentage = 0.01m;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"39.100%\"},\n            {\"Drawdown\", \"0.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100422.84\"},\n            {\"Net Profit\", \"0.423%\"},\n            {\"Sharpe Ratio\", \"5.498\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.498%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.186\"},\n            {\"Beta\", \"0.248\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-9.989\"},\n            {\"Tracking Error\", \"0.167\"},\n            {\"Treynor Ratio\", \"1.223\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$150000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4.98%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"8774049eb5141a2b6956d9432426f837\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MinimumOrderSizeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm asserts that the minimum order size is respected at the moment of\n    /// place an order or update an order\n    /// </summary>\n    public class MinimumOrderSizeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _sentOrders;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 1);\n            SetEndDate(2013, 10, 1);\n            SetBrokerageModel(Brokerages.BrokerageName.Bitfinex, AccountType.Cash);\n            AddCrypto(\"BTCUSD\", Resolution.Hour);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_sentOrders)\n            {\n                _sentOrders = true;\n\n                // Place an order that will fail because of the size\n                var invalidOrder = MarketOrder(\"BTCUSD\", 0.00002);\n                if (invalidOrder.Status != OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException(\"Invalid order expected, order size is less than allowed\");\n                }\n\n                // Update an order that fails because of the size\n                var validOrderOne = LimitOrder(\"BTCUSD\", 0.0002, Securities[\"BTCUSD\"].Price - 0.1m,  tag: \"NotUpdated\");\n                validOrderOne.Update(new UpdateOrderFields()\n                {\n                    Quantity = 0.00002m,\n                    Tag = \"Updated\"\n                });\n\n                // Place and update an order that will succeed\n                var validOrderTwo = LimitOrder(\"BTCUSD\", 0.0002, Securities[\"BTCUSD\"].Price - 0.1m, tag: \"NotUpdated\");\n                validOrderTwo.Update(new UpdateOrderFields()\n                {\n                    Quantity = 0.002m,\n                    Tag = \"Updated\"\n                });\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n\n            // Update of validOrderOne is expected to fail\n            if( (order.Id == 2) && (order.LastUpdateTime != null) && (order.Tag == \"Updated\"))\n            {\n                throw new RegressionTestException(\"Order update expected to fail\");\n            }\n\n            // Update of validOrdertwo is expected to succeed\n            if ((order.Id == 3) && (order.LastUpdateTime != null) && (order.Tag == \"NotUpdated\"))\n            {\n                throw new RegressionTestException(\"Order update expected to succeed\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 54;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 4;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.0\"},\n            {\"End Equity\", \"100000.00\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD E3\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c4eb9c8722ee647ec2925cf7b936ce69\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MissingTickDataAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class MissingTickDataAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 08);\n\n            var spy = AddEquity(\"SPY\", Resolution.Tick).Symbol;\n\n            var start = new DateTime(2013, 10, 07, 15, 0, 0);\n\n            var slices = History(new[] { spy }, start, start.AddSeconds(10), Resolution.Tick).ToList();\n            var tickCountInSliceHistoryCall = slices.Sum(x => x.Ticks[spy].Count);\n\n            var ticks = History<Tick>(spy, start, start.AddSeconds(10), Resolution.Tick).ToList();\n            var tickCountInTickHistoryCall = ticks.Count;\n\n            if (tickCountInSliceHistoryCall != tickCountInTickHistoryCall)\n            {\n                throw new RegressionTestException($@\"Tick count mismatch in Slice and Tick history calls: History() returned {\n                    tickCountInSliceHistoryCall} ticks, while History<Tick>() returned {tickCountInTickHistoryCall} ticks\");\n            }\n\n            // Early quit, we already tested what we wanted\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1610;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MovingAverageCrossAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this example we look at the canonical 15/30 day moving average cross. This algorithm\n    /// will go long when the 15 crosses above the 30 and will liquidate when the 15 crosses\n    /// back below the 30.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"moving average cross\" />\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    public class MovingAverageCrossAlgorithm : QCAlgorithm\n    {\n        private string _symbol = \"SPY\";\n        private DateTime _previous;\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private SimpleMovingAverage[] _ribbon;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // set up our analysis span\n            SetStartDate(2009, 01, 01);\n            SetEndDate(2015, 01, 01);\n\n            // request SPY data with minute resolution\n            AddSecurity(SecurityType.Equity, _symbol, Resolution.Minute);\n\n            // create a 15 day exponential moving average\n            _fast = EMA(_symbol, 15, Resolution.Daily);\n\n            // create a 30 day exponential moving average\n            _slow = EMA(_symbol, 30, Resolution.Daily);\n\n            var ribbonCount = 8;\n            var ribbonInterval = 15;\n            _ribbon = Enumerable.Range(0, ribbonCount).Select(x => SMA(_symbol, (x + 1)*ribbonInterval, Resolution.Daily)).ToArray();\n        }\n\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public void OnData(TradeBars data)\n        {\n            // a couple things to notice in this method:\n            //  1. We never need to 'update' our indicators with the data, the engine takes care of this for us\n            //  2. We can use indicators directly in math expressions\n            //  3. We can easily plot many indicators at the same time\n\n            // wait for our slow ema to fully initialize\n            if (!_slow.IsReady) return;\n\n            // only once per day\n            if (_previous.Date == Time.Date) return;\n\n            // define a small tolerance on our checks to avoid bouncing\n            const decimal tolerance = 0.00015m;\n            var holdings = Portfolio[_symbol].Quantity;\n\n            // we only want to go long if we're currently short or flat\n            if (holdings <= 0)\n            {\n                // if the fast is greater than the slow, we'll go long\n                if (_fast > _slow * (1 + tolerance))\n                {\n                    Log(\"BUY  >> \" + Securities[_symbol].Price);\n                    SetHoldings(_symbol, 1.0);\n                }\n            }\n\n            // we only want to liquidate if we're currently long\n            // if the fast is less than the slow we'll liquidate our long\n            if (holdings > 0 && _fast < _slow)\n            {\n                Log(\"SELL >> \" + Securities[_symbol].Price);\n                Liquidate(_symbol);\n            }\n\n            Plot(_symbol, \"Price\", data[_symbol].Price);\n\n            // easily plot indicators, the series name will be the name of the indicator\n            Plot(_symbol, _fast, _slow);\n            Plot(\"Ribbon\", _ribbon);\n\n            _previous = Time;\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/MultiResolutionConsolidators.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of multi resolution usage, consolidating data and updating indicators\n    /// </summary>\n    public class MultiResolutionConsolidators : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SimpleMovingAverage _dailySma;\n        private SimpleMovingAverage _hourSma;\n        private TradeBar _multipleDayConsolidatedBar;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n            var aapl = AddEquity(\"AAPL\", Resolution.Hour).Symbol;\n\n            _hourSma = SMA(aapl, 4);\n            _dailySma = SMA(aapl, 2, Resolution.Daily);\n\n            Consolidate(aapl, TimeSpan.FromDays(3), (TradeBar bar) =>\n            {\n                _multipleDayConsolidatedBar = bar;\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_dailySma != 15.5451787650333045000m)\n            {\n                throw new RegressionTestException($\"Unexpected daily sma value {_dailySma}\");\n            }\n            if (_multipleDayConsolidatedBar.Close != 15.382277817551523m || _multipleDayConsolidatedBar.Period != TimeSpan.FromDays(3))\n            {\n                throw new RegressionTestException($\"Unexpected trade bar {_multipleDayConsolidatedBar}\");\n            }\n            if (_hourSma != 15.57601923567305925m)\n            {\n                throw new RegressionTestException($\"Unexpected hour sma value {_hourSma}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5864;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MultiUniverseSharedSecurityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing the root issue of GH #6885, where multiple universes share the same security using different configurations\n    /// </summary>\n    public class MultiUniverseSharedSecurityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n\n            // the universe bellow will use 'Hour' resolution so that the data feed configuration is different that the above\n            UniverseSettings.Resolution = Resolution.Hour;\n            AddUniverse(\"my-universe\", x =>\n            {\n                if (x.Day == 8)\n                {\n                    return new List<string> { \"SPY\" };\n                }\n                return Enumerable.Empty<string>();\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var spy = Securities[\"SPY\"];\n            if (!spy.IsTradable || spy.Price == 0)\n            {\n                throw new RegressionTestException(\"'SPY' should always be tradable and have a price even if removed by the custom universe!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4309;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/MultipleSymbolConsolidationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example structure for structuring an algorithm with indicator and consolidator data for many tickers.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"consolidating data\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    public class MultipleSymbolConsolidationAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// This is the period of bars we'll be creating\n        /// </summary>\n        private readonly TimeSpan _barPeriod = TimeSpan.FromMinutes(10);\n        /// <summary>\n        /// This is the period of our sma indicators\n        /// </summary>\n        private readonly int _simpleMovingAveragePeriod = 10;\n        /// <summary>\n        /// This is the number of consolidated bars we'll hold in symbol data for reference\n        /// </summary>\n        private readonly int _rollingWindowSize = 10;\n        /// <summary>\n        /// Holds all of our data keyed by each symbol\n        /// </summary>\n        private readonly Dictionary<string, SymbolData> _data = new Dictionary<string, SymbolData>();\n        /// <summary>\n        /// Contains all of our equity symbols\n        /// </summary>\n        private IReadOnlyList<string> _equitySymbols = new List<string>\n        {\n            \"AAPL\",\n            \"SPY\",\n            \"IBM\"\n        };\n        /// <summary>\n        /// Contains all of our forex symbols\n        /// </summary>\n        private IReadOnlyList<string> _forexSymbols = new List<string>\n        {\n            \"EURUSD\",\n            \"USDJPY\",\n            \"EURGBP\",\n            \"EURCHF\",\n            \"USDCAD\",\n            \"USDCHF\",\n            \"AUDUSD\",\n            \"NZDUSD\",\n        };\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        /// <seealso cref=\"QCAlgorithm.SetStartDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetEndDate(System.DateTime)\"/>\n        /// <seealso cref=\"QCAlgorithm.SetCash(decimal)\"/>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 12, 01);\n            SetEndDate(2015, 02, 01);\n\n            // initialize our equity data\n            foreach (var symbol in _equitySymbols)\n            {\n                var equity = AddEquity(symbol);\n                _data.Add(symbol, new SymbolData(equity.Symbol, _barPeriod, _rollingWindowSize));\n            }\n\n            // initialize our forex data\n            foreach (var symbol in _forexSymbols)\n            {\n                var forex = AddForex(symbol);\n                _data.Add(symbol, new SymbolData(forex.Symbol, _barPeriod, _rollingWindowSize));\n            }\n\n            // loop through all our symbols and request data subscriptions and initialize indicatora\n            foreach (var kvp in _data)\n            {\n                // this is required since we're using closures below, for more information\n                // see: http://stackoverflow.com/questions/14907987/access-to-foreach-variable-in-closure-warning\n                var symbolData = kvp.Value;\n\n                // define a consolidator to consolidate data for this symbol on the requested period\n                var consolidator = symbolData.Symbol.SecurityType == SecurityType.Equity\n                    ? (IDataConsolidator)new TradeBarConsolidator(_barPeriod)\n                    : (IDataConsolidator)new QuoteBarConsolidator(_barPeriod);\n\n                // define our indicator\n                symbolData.SMA = new SimpleMovingAverage(CreateIndicatorName(symbolData.Symbol, \"SMA\" + _simpleMovingAveragePeriod, Resolution.Minute), _simpleMovingAveragePeriod);\n                // wire up our consolidator to update the indicator\n                consolidator.DataConsolidated += (sender, baseData) =>\n                {\n                    // 'bar' here is our newly consolidated data\n                    var bar = (IBaseDataBar)baseData;\n                    // update the indicator\n                    symbolData.SMA.Update(bar.Time, bar.Close);\n                    // we're also going to add this bar to our rolling window so we have access to it later\n                    symbolData.Bars.Add(bar);\n                };\n\n                // we need to add this consolidator so it gets auto updates\n                SubscriptionManager.AddConsolidator(symbolData.Symbol, consolidator);\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">TradeBars IDictionary object with your stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // loop through each symbol in our structure\n            foreach (var symbolData in _data.Values)\n            {\n                // this check proves that this symbol was JUST updated prior to this OnData function being called\n                if (symbolData.IsReady && symbolData.WasJustUpdated(Time))\n                {\n                    if (!Portfolio[symbolData.Symbol].Invested)\n                    {\n                        MarketOrder(symbolData.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>Method is called 10 minutes before closing to allow user to close out position.</remarks>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            int i = 0;\n            foreach (var kvp in _data.OrderBy(x => x.Value.Symbol))\n            {\n                // we have too many symbols to plot them all, so plot ever other\n                if (kvp.Value.IsReady && ++i%2 == 0)\n                {\n                    Plot(kvp.Value.Symbol.ToString(), kvp.Value.SMA);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Contains data pertaining to a symbol in our algorithm\n        /// </summary>\n        public class SymbolData\n        {\n            /// <summary>\n            /// This symbol the other data in this class is associated with\n            /// </summary>\n            public Symbol Symbol { get; init; }\n            /// <summary>\n            /// A rolling window of data, data needs to be pumped into Bars by using Bars.Update( tradeBar ) and\n            /// can be accessed like:\n            ///  mySymbolData.Bars[0] - most first recent piece of data\n            ///  mySymbolData.Bars[5] - the sixth most recent piece of data (zero based indexing)\n            /// </summary>\n            public RollingWindow<IBaseDataBar> Bars { get; init; }\n            /// <summary>\n            /// The period used when populating the Bars rolling window.\n            /// </summary>\n            public TimeSpan BarPeriod { get; init; }\n            /// <summary>\n            /// The simple moving average indicator for our symbol\n            /// </summary>\n            public SimpleMovingAverage SMA { get; set; }\n\n            /// <summary>\n            /// Initializes a new instance of SymbolData\n            /// </summary>\n            public SymbolData(Symbol symbol, TimeSpan barPeriod, int windowSize)\n            {\n                Symbol = symbol;\n                BarPeriod = barPeriod;\n                Bars = new RollingWindow<IBaseDataBar>(windowSize);\n            }\n\n            /// <summary>\n            /// Returns true if all the data in this instance is ready (indicators, rolling windows, ect...)\n            /// </summary>\n            public bool IsReady\n            {\n                get { return Bars.IsReady && SMA.IsReady; }\n            }\n\n            /// <summary>\n            /// Returns true if the most recent trade bar time matches the current time minus the bar's period; this\n            /// indicates that Update() was just called on this instance.\n            /// </summary>\n            /// <param name=\"current\">The current algorithm time</param>\n            /// <returns>True if this instance was just updated with new data, false otherwise</returns>\n            public bool WasJustUpdated(DateTime current)\n            {\n                return Bars.Count > 0 && Bars[0].Time == current - BarPeriod;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NakedCallStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Naked Call strategy.\n    /// </summary>\n    public class NakedCallStrategyAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _nakedCall;\n\n        protected override int ExpectedOrdersCount { get; } = 2;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contract = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .FirstOrDefault();\n\n            if (contract != null)\n            {\n                _nakedCall = OptionStrategies.NakedCall(_optionSymbol, contract.Strike, contract.Expiry);\n                Buy(_nakedCall, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 1)\n            {\n                throw new RegressionTestException($\"Expected position group to have 1 position. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var optionPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Option);\n            if (optionPosition.Symbol.ID.OptionRight != OptionRight.Call)\n            {\n                throw new RegressionTestException($\"Expected option position to be a call. Actual: {optionPosition.Symbol.ID.OptionRight}\");\n            }\n\n            var expectedOptionPositionQuantity = -2;\n\n            if (optionPosition.Quantity != expectedOptionPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected option position quantity to be {expectedOptionPositionQuantity}. Actual: {optionPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We can liquidate by selling the strategy\n            Sell(_nakedCall, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999657.4\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.60\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM92QHN8ZQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.19%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6942c6b893f9d77dce3c2f7b5e753718\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NakedPutStrategyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// In this case, the algorithm tests the Naked Put strategy.\n    /// </summary>\n    public class NakedPutStrategyAlgorithm : OptionStrategyFactoryMethodsBaseAlgorithm\n    {\n        private OptionStrategy _nakedPut;\n\n        protected override int ExpectedOrdersCount { get; } = 2;\n\n        protected override void TradeStrategy(OptionChain chain)\n        {\n            var contract = chain\n                .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                .ThenByDescending(x => x.Expiry)\n                .FirstOrDefault();\n\n            if (contract != null)\n            {\n                _nakedPut = OptionStrategies.NakedPut(_optionSymbol, contract.Strike, contract.Expiry);\n                Buy(_nakedPut, 2);\n            }\n        }\n\n        protected override void AssertStrategyPositionGroup(IPositionGroup positionGroup)\n        {\n            if (positionGroup.Positions.Count() != 1)\n            {\n                throw new RegressionTestException($\"Expected position group to have 1 position. Actual: {positionGroup.Positions.Count()}\");\n            }\n\n            var optionPosition = positionGroup.Positions.Single(x => x.Symbol.SecurityType == SecurityType.Option);\n            if (optionPosition.Symbol.ID.OptionRight != OptionRight.Put)\n            {\n                throw new RegressionTestException($\"Expected option position to be a put. Actual: {optionPosition.Symbol.ID.OptionRight}\");\n            }\n\n            var expectedOptionPositionQuantity = -2;\n\n            if (optionPosition.Quantity != expectedOptionPositionQuantity)\n            {\n                throw new RegressionTestException($@\"Expected option position quantity to be {expectedOptionPositionQuantity}. Actual: {optionPosition.Quantity}\");\n            }\n        }\n\n        protected override void LiquidateStrategy()\n        {\n            // We can liquidate by selling the strategy\n            Sell(_nakedPut, 2);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2298;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999377.4\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.60\"},\n            {\"Estimated Strategy Capacity\", \"$10000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.13%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"699eda4fdbcfa625cc7cb6c4ccbbd7ba\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that naked short option strategies with margin requirements that cannot be met result in invalid orders.\n    /// Also, for valid naked short positions, the algorithm asserts that part of the position can be liquidated.\n    /// </summary>\n    public class NakedShortOptionStrategyOverMarginAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int _quantityOverMargin = 50;\n        private const int _quantity = 5;\n        private const int _quantityToLiquidate = 2;\n\n        private Symbol _optionSymbol;\n\n        private OptionStrategy _optionStrategy;\n\n        private bool _done;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(1000000);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n\n            SetBenchmark(\"GOOG\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_done)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    var atmStraddle = chain\n                        .OrderBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Expiry)\n                        .FirstOrDefault();\n\n                    if (atmStraddle != null)\n                    {\n                        _optionStrategy = OptionStrategies.Straddle(_optionSymbol, atmStraddle.Strike, atmStraddle.Expiry);\n\n                        // This is invalid, margin is not enough\n                        Sell(_optionStrategy, _quantityOverMargin);\n\n                        // Margin is enough for this one\n                        Sell(_optionStrategy, _quantity);\n                    }\n                }\n            }\n            else\n            {\n                Buy(_optionStrategy, _quantityToLiquidate);\n                _done = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug(orderEvent.ToString());\n\n            if (orderEvent.Quantity == _quantityOverMargin && orderEvent.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Orders with quantity {_quantityOverMargin} should be invalid\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Make sure only 4 orders where placed, 2 for the strategy and 2 for the liquidation.\n            // The first combo order should have been invalid.\n            var filledOrdersCount = Transactions.GetOrders(o => o.Status.IsFill()).Count();\n            var expectedFilledOrdersCount = 2 * _optionStrategy.OptionLegs.Count;\n            if (filledOrdersCount != expectedFilledOrdersCount)\n            {\n                throw new RegressionTestException($\"Expected {expectedFilledOrdersCount} filled orders, found {filledOrdersCount}\");\n            }\n\n            var expectedQuantity = Math.Abs(_quantity - _quantityToLiquidate);\n            var positionGroup = Portfolio.Positions.Groups.Single();\n            if (positionGroup.Quantity != expectedQuantity)\n            {\n                throw new RegressionTestException($\"Expected position quantity to be {expectedQuantity} but was {positionGroup.Quantity}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15012;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"998775.9\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.10\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"7.50%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"67fba235c5efade156e60ed66e4b8031\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NamedArgumentsRegression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression Definition for Python NamedArgumentsRegression\n    /// Used to test PythonNet kwargs\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class NamedArgumentsRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 17);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n            // Futures Resolution: Tick, Second, Minute\n            // Options Resolution: Minute Only.\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            // There are other assets with similar methods. See \"Selecting Options\" etc for more details.\n            // AddFuture, AddForex, AddCfd, AddOption\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", percentage: 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 72;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"424.375%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104486.22\"},\n            {\"Net Profit\", \"4.486%\"},\n            {\"Sharpe Ratio\", \"17.304\"},\n            {\"Sortino Ratio\", \"35.217\"},\n            {\"Probabilistic Sharpe Ratio\", \"96.835%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.249\"},\n            {\"Beta\", \"1.015\"},\n            {\"Annual Standard Deviation\", \"0.141\"},\n            {\"Annual Variance\", \"0.02\"},\n            {\"Information Ratio\", \"-19\"},\n            {\"Tracking Error\", \"0.011\"},\n            {\"Treynor Ratio\", \"2.403\"},\n            {\"Total Fees\", \"$3.49\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"10.01%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"70f21e930175a2ec9d465b21edc1b6d9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NikkeiIndexRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm using nikkei index\n    /// </summary>\n    public class NikkeiIndexRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        private ExponentialMovingAverage _emaSlow;\n        private ExponentialMovingAverage _emaFast;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 14);\n            SetEndDate(2021, 1, 15);\n            SetCash(1000000);\n\n            _security = AddIndex(\"N225\");\n\n            var symbol = _security.Symbol;\n            _emaSlow = EMA(symbol, 80);\n            _emaFast = EMA(symbol, 200);\n\n            Settings.DailyPreciseEndTime = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_emaSlow.IsReady || !_emaFast.IsReady)\n            {\n                throw new RegressionTestException(\"Indicators are not ready!\");\n            }\n            if (!_security.HasData)\n            {\n                throw new RegressionTestException(\"Security does not have data!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 443;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NoMarginCallExpectedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Margin model regression algorithm testing <see cref=\"PatternDayTradingMarginModel\"/> and\n    /// margin calls NOT being triggered when the market is about to close, GH issue 4064.\n    /// Brother too <see cref=\"MarginCallClosedMarketRegressionAlgorithm\"/>\n    /// </summary>\n    public class NoMarginCallExpectedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _marginCall;\n        private Symbol _spy;\n        private decimal _closedMarketLeverage;\n        private decimal _openMarketLeverage;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var security = AddEquity(\"SPY\", Resolution.Minute);\n            _spy = security.Symbol;\n\n            _closedMarketLeverage = 2;\n            _openMarketLeverage = 5;\n            security.BuyingPowerModel = new PatternDayTradingMarginModel(_closedMarketLeverage, _openMarketLeverage);\n\n            Schedule.On(\n                DateRules.EveryDay(_spy),\n                // 15 minutes before market close, because PatternDayTradingMarginModel starts using closed\n                // market leverage 10 minutes before market closes.\n                TimeRules.BeforeMarketClose(_spy, 15),\n                () => {\n                    // before market close we reduce our position to closed market leverage\n                    SetHoldings(_spy, _closedMarketLeverage);\n                }\n            );\n\n            Schedule.On(\n                DateRules.EveryDay(_spy),\n                TimeRules.AfterMarketOpen(_spy, 1), // 1 min so that price is set\n                () => {\n                    // at market open we increase our position to open market leverage\n                    SetHoldings(_spy, _openMarketLeverage);\n                }\n            );\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            _marginCall++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_marginCall != 0)\n            {\n                throw new RegressionTestException($\"We expected NO margin call to happen, {_marginCall} occurred\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"10\"},\n            {\"Average Win\", \"2.45%\"},\n            {\"Average Loss\", \"-1.97%\"},\n            {\"Compounding Annual Return\", \"9636.014%\"},\n            {\"Drawdown\", \"9.800%\"},\n            {\"Expectancy\", \"0.346\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"106028.40\"},\n            {\"Net Profit\", \"6.028%\"},\n            {\"Sharpe Ratio\", \"42.843\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"63.954%\"},\n            {\"Loss Rate\", \"40%\"},\n            {\"Win Rate\", \"60%\"},\n            {\"Profit-Loss Ratio\", \"1.24\"},\n            {\"Alpha\", \"28.365\"},\n            {\"Beta\", \"3.698\"},\n            {\"Annual Standard Deviation\", \"0.833\"},\n            {\"Annual Variance\", \"0.693\"},\n            {\"Information Ratio\", \"54.921\"},\n            {\"Tracking Error\", \"0.614\"},\n            {\"Treynor Ratio\", \"9.645\"},\n            {\"Total Fees\", \"$109.26\"},\n            {\"Estimated Strategy Capacity\", \"$8400000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"633.17%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"07c47cca3bc30019a6fd6420d3ce8ee5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NoMarginCallOutsideRegularHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that ensures margin call orders are only triggered during regular market hours.\n    /// This test sets up a short position that would cause a margin call near market close.\n    /// The algorithm is expected to throw an exception if margin call orders are submitted while the market is closed.\n    /// </summary>\n    public class NoMarginCallOutsideRegularHoursRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        Symbol _spy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            // Set portfolio to fully allocated for margin call triggering\n            Settings.FreePortfolioValuePercentage = 0m;\n            var equity = AddEquity(\"SPY\", Resolution.Minute, extendedMarketHours: true);\n            equity.BuyingPowerModel = new PatternDayTradingMarginModel(2m, 4m);\n            _spy = equity.Symbol;\n        }\n\n        /// <summary>\n        /// Sets a short position large enough to trigger a margin call.\n        /// The position is opened just before market close to simulate after-hours behavior.\n        /// </summary>\n        public override void OnData(Slice data)\n        {\n            if (!Portfolio.Invested && Time.Hour == 15 && Time.Minute == 48)\n            {\n                SetHoldings(_spy, -2.1m);\n            }\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            foreach (var request in requests)\n            {\n                var security = Portfolio.Securities[request.Symbol];\n\n                // Ensure margin call orders only happen when the exchange is open\n                if (!security.Exchange.ExchangeOpen)\n                {\n                    throw new RegressionTestException(\"Margin calls should not occur outside regular market hours!\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 9643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-93.216%\"},\n            {\"Drawdown\", \"7.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96499.74\"},\n            {\"Net Profit\", \"-3.500%\"},\n            {\"Sharpe Ratio\", \"-2.407\"},\n            {\"Sortino Ratio\", \"-5.131\"},\n            {\"Probabilistic Sharpe Ratio\", \"18.859%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"2.363\"},\n            {\"Beta\", \"-1.662\"},\n            {\"Annual Standard Deviation\", \"0.382\"},\n            {\"Annual Variance\", \"0.146\"},\n            {\"Information Ratio\", \"-4.824\"},\n            {\"Tracking Error\", \"0.6\"},\n            {\"Treynor Ratio\", \"0.554\"},\n            {\"Total Fees\", \"$7.24\"},\n            {\"Estimated Strategy Capacity\", \"$14000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"41.81%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6cc0fe6a302a15043b93b6c04336771b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NoMinimumOrderMarginRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the effect of No <see cref=\"IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage\"/>\n    /// causing multiple trades to be filled, see <see cref=\"MinimumOrderMarginRegressionAlgorithm\"/> instead\n    /// </summary>\n    public class NoMinimumOrderMarginRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            SetHoldings(\"SPY\", 0.25);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"38.897%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"-0.118\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100420.97\"},\n            {\"Net Profit\", \"0.421%\"},\n            {\"Sharpe Ratio\", \"5.45\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.350%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.76\"},\n            {\"Alpha\", \"-0.19\"},\n            {\"Beta\", \"0.249\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-10.01\"},\n            {\"Tracking Error\", \"0.167\"},\n            {\"Treynor Ratio\", \"1.213\"},\n            {\"Total Fees\", \"$5.00\"},\n            {\"Estimated Strategy Capacity\", \"$63000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"5.15%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"72d5203e9911bad556de371750fe0278\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NoUniverseSelectorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Custom data universe selection regression algorithm asserting it's behavior. See GH issue #6396\n    /// </summary>\n    public class NoUniverseSelectorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 03, 31);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse<CoarseFundamental>();\n        }\n\n        public void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            var activeAndWithDataSecurities = ActiveSecurities.Count(x => x.Value.HasData);\n            // we want 1/N allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (security.HasData)\n                {\n                    SetHoldings(security.Symbol, 1m / activeAndWithDataSecurities);\n                }\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 42596;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"15\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-50.972%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98449.86\"},\n            {\"Net Profit\", \"-1.550%\"},\n            {\"Sharpe Ratio\", \"-4.375\"},\n            {\"Sortino Ratio\", \"-3.048\"},\n            {\"Probabilistic Sharpe Ratio\", \"2.821%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.766\"},\n            {\"Beta\", \"0.896\"},\n            {\"Annual Standard Deviation\", \"0.099\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-12.019\"},\n            {\"Tracking Error\", \"0.067\"},\n            {\"Treynor Ratio\", \"-0.486\"},\n            {\"Total Fees\", \"$17.93\"},\n            {\"Estimated Strategy Capacity\", \"$220000.00\"},\n            {\"Lowest Capacity Asset\", \"BNO UN3IMQ2JU1YD\"},\n            {\"Portfolio Turnover\", \"14.29%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f751fd0ba1203f81e6b40f0cb74d959f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NonDynamicOptionsFilterRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that universe selection is not dynamic by default, that is, selection happens only on market open by default.\n    /// </summary>\n    public class NonDynamicOptionsFilterRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"AAPL\";\n\n        private Symbol _optionSymbol;\n\n        private int _securitiesChangedCount;\n\n        private int _previouslyAddedOptionsCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180 * 3));\n\n            SetBenchmark(equity.Symbol);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (++_securitiesChangedCount < 3)\n            {\n                // This is the universe selection, which we expect to happen twice, on market open of each day\n\n                if (_securitiesChangedCount == 1)\n                {\n                    var underlying = changes.AddedSecurities.Where(security => security.Symbol == _optionSymbol.Underlying).SingleOrDefault();\n                    if (underlying == null)\n                    {\n                        throw new RegressionTestException(\"Unexpected security changes: on the first OnSecuritiesChanged callback, we expect the underlying to be added.\");\n                    }\n                }\n\n                // Check the changes\n                if (changes.AddedSecurities.Count <= 1)\n                {\n                    throw new RegressionTestException(\"Unexpected security changes count: \" +\n                        \"on first and second OnSecuritiesChanged callbacks we expect options to be added\");\n                }\n\n                if (changes.AddedSecurities.Where(security => security.Symbol != _optionSymbol.Underlying)\n                        .Any(security => !security.Symbol.HasCanonical() || security.Symbol.Canonical != _optionSymbol))\n                {\n                    throw new RegressionTestException(\"Unexpected security added: \" +\n                        $\"on first and second OnSecuritiesChanged callbacks we expect only {UnderlyingTicker} options to be added\");\n                }\n\n                if (_securitiesChangedCount == 2)\n                {\n                    // The options added the previous day should be removed\n                    if (changes.RemovedSecurities.Count != _previouslyAddedOptionsCount)\n                    {\n                        throw new RegressionTestException(\"Unexpected security changes count: \" +\n                            \"on the second OnSecuritiesChanged callback we expect the previous day selection to be removed.\");\n                    }\n                }\n\n                // Subtract 1 to account for the underlying\n                _previouslyAddedOptionsCount = changes.AddedSecurities.Count - 1;\n            }\n            else\n            {\n                throw new RegressionTestException($\"Unexpected call to OnSecuritiesChanged: we expect only 3 OnSecuritiesChanged callbacks for this algorithm\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_securitiesChangedCount != 2)\n            {\n                throw new RegressionTestException($\"Unexpected number of calls to OnSecuritiesChanged: {_securitiesChangedCount}. \" +\n                    \"We expect only 3 OnSecuritiesChanged callbacks for this algorithm\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 55702;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-19.236\"},\n            {\"Tracking Error\", \"0.147\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NullBuyingPowerOptionBullCallSpreadAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Shows how setting to use the SecurityMarginModel.Null (or BuyingPowerModel.Null)\n    /// to disable the sufficient margin call verification.\n    /// See also: <see cref=\"OptionEquityBullCallSpreadRegressionAlgorithm\"/>\n    /// </summary>\n    /// <meta name=\"tag\" content=\"reality model\" />\n    public class NullBuyingPowerOptionBullCallSpreadAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(200000);\n\n            SetSecurityInitializer(security => security.MarginModel = SecurityMarginModel.Null);\n            Portfolio.SetPositions(SecurityPositionGroupModel.Null);\n\n            var equity = AddEquity(\"GOOG\");\n            var option = AddOption(equity.Symbol);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsMarketOpen(_optionSymbol) &&\n                slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                var callContracts = chain\n                    .Where(contract => contract.Right == OptionRight.Call).ToList();\n\n                var expiry = callContracts.Min(x => x.Expiry);\n\n                callContracts = callContracts\n                    .Where(x => x.Expiry == expiry)\n                    .OrderBy(x => x.Strike)\n                    .ToList();\n\n                var longCall = callContracts.First();\n                var shortCall = callContracts.First(contract => contract.Strike > longCall.Strike);\n\n                const int quantity = 1000;\n\n                var tickets = new[]\n                {\n                    MarketOrder(shortCall.Symbol, -quantity),\n                    MarketOrder(longCall.Symbol, quantity)\n                };\n\n                foreach (var ticket in tickets)\n                {\n                    if (ticket.Status != OrderStatus.Filled)\n                    {\n                        throw new RegressionTestException($\"There should be no restriction on buying {ticket.Quantity} of {ticket.Symbol} with BuyingPowerModel.Null\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.TotalMarginUsed != 0)\n            {\n                throw new RegressionTestException(\"The TotalMarginUsed should be zero to avoid margin calls.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"108700\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1300.00\"},\n            {\"Estimated Strategy Capacity\", \"$36000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2888.68%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8a2ee1e491737ecabd775ad5afbe2e4b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NullMarginComboOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of specifying a null position group allowing us to fill a combo order which would be invalid if not\n    /// </summary>\n    public class NullMarginComboOrderRegressionAlgorithm : NullMarginMultipleOrdersRegressionAlgorithm\n    {\n        protected override void PlaceTrades(OptionContract optionContract)\n        {\n            var orderLegs = new List<Leg>()\n            {\n                Leg.Create(optionContract.Symbol, -1),\n                Leg.Create(optionContract.Symbol.Underlying, 100),\n            };\n            var tickets = ComboMarketOrder(orderLegs, 10).ToList();\n\n            AssertState(tickets[0], 2, 1010);\n            AssertState(tickets[1], 2, 1010);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10658.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$11.50\"},\n            {\"Estimated Strategy Capacity\", \"$13000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"7580.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"06de8022dfcb44c5eb0a2199bd7a7232\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NullMarginMultipleOrdersRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of specifying a null position group allowing us to fill orders which would be invalid if not\n    /// </summary>\n    public class NullMarginMultipleOrdersRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _placedTrades;\n        protected Symbol OptionSymbol { get; private set; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(10000);\n\n            OverrideMarginModels();\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            OptionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n        }\n\n        protected virtual void OverrideMarginModels()\n        {\n            Portfolio.SetPositions(SecurityPositionGroupModel.Null);\n            SetSecurityInitializer(security =>\n            {\n                security.SetBuyingPowerModel(new ConstantBuyingPowerModel(1));\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(OptionSymbol) && slice.OptionChains.TryGetValue(OptionSymbol, out chain))\n                {\n                    // we find at the money (ATM) call contract with farthest expiration\n                    var atmContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .First();\n\n                    if (!_placedTrades)\n                    {\n                        _placedTrades = true;\n                        PlaceTrades(atmContracts);\n                    }\n                }\n            }\n        }\n\n        protected virtual void PlaceTrades(OptionContract optionContract)\n        {\n            AssertState(MarketOrder(optionContract.Symbol.Underlying, 1000), 1, 1000);\n            AssertState(MarketOrder(optionContract.Symbol, -10), 2, 1010);\n        }\n\n        protected virtual void AssertState(OrderTicket ticket, int expectedGroupCount, int expectedMarginUsed)\n        {\n            if (ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException($\"Unexpected order status {ticket.Status} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.Positions.Groups.Count != expectedGroupCount)\n            {\n                throw new RegressionTestException($\"Unexpected position group count {Portfolio.Positions.Groups.Count} for symbol {ticket.Symbol} and quantity {ticket.Quantity}\");\n            }\n            if (Portfolio.TotalMarginUsed != expectedMarginUsed)\n            {\n                throw new RegressionTestException($\"Unexpected margin used {expectedMarginUsed}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10658.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$11.50\"},\n            {\"Estimated Strategy Capacity\", \"$13000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"7580.62%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4b36a135ed647a66c1ef3f1d9439cf02\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NullOptionAssignmentRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm assering we can disable automatic option assignment\n    /// </summary>\n    public class NullOptionAssignmentRegressionAlgorithm : OptionAssignmentRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetSecurityInitializer((security) =>\n            {\n                var option = security as Option;\n                option?.SetOptionAssignmentModel(new NullOptionAssignmentModel());\n            });\n\n            base.Initialize();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"9.48%\"},\n            {\"Average Loss\", \"-16.73%\"},\n            {\"Compounding Annual Return\", \"-25.790%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"-0.478\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99538\"},\n            {\"Net Profit\", \"-0.462%\"},\n            {\"Sharpe Ratio\", \"-6.902\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.713%\"},\n            {\"Loss Rate\", \"67%\"},\n            {\"Win Rate\", \"33%\"},\n            {\"Profit-Loss Ratio\", \"0.57\"},\n            {\"Alpha\", \"-0.009\"},\n            {\"Beta\", \"-0.023\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"10.521\"},\n            {\"Tracking Error\", \"0.018\"},\n            {\"Treynor Ratio\", \"0.211\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"26.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5d0637a25841a3eb1344e8564792acb7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/NumeraiSignalExportDemonstrationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm sends an array of current portfolio targets to Numerai API\n    /// every time the ema indicators crosses between themselves. \n    /// See (https://docs.numer.ai/numerai-signals/signals-overview) for more information\n    /// about accepted symbols, signals, etc.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"securities and portfolio\" />\n    public class NumeraiSignalExportDemonstrationAlgorithm : QCAlgorithm\n    {\n        private readonly List<Security> _securities = new();\n        private Symbol _etfSymbol;\n        public override void Initialize()\n        {\n            SetStartDate(2020, 10, 7);   // Set Start Date\n            SetEndDate(2020, 10, 12);    // Set End Date\n            SetCash(100000);             // Set Strategy Cash\n\n            SetSecurityInitializer(new BrokerageModelSecurityInitializer(BrokerageModel, new FuncSecuritySeeder(GetLastKnownPrices)));\n\n            // Add the CRSP US Total Market Index constituents, which represents approximately 100% of the investable US Equity market\n            _etfSymbol = AddEquity(\"VTI\").Symbol;\n            AddUniverse(Universe.ETF(_etfSymbol));\n\n            // Create a Scheduled Event to submit signals every trading day at 13:00 UTC\n            Schedule.On(DateRules.EveryDay(_etfSymbol), TimeRules.At(13, 0, TimeZones.Utc), SubmitSignals);\n\n            // Add the Numerai signal export provider\n            // Numerai Public ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n            // and created a API key. See (https://signals.numer.ai/account)\n            var numeraiPublicId = \"\";\n\n            // Numerai Secret ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n            // and created a API key. See (https://signals.numer.ai/account)\n            var numeraiSecretId = \"\";\n\n            // Numerai Model ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n            // and created a model. See (https://signals.numer.ai/models)\n            var numeraiModelId = \"\";\n\n            var numeraiFilename = \"\"; // (Optional) Replace this value with your submission filename \n\n            // Disable automatic exports as we manually set them\n            SignalExport.AutomaticExportTimeSpan = null;\n\n            // Set Numerai signal export provider\n            SignalExport.AddSignalExportProvider(new NumeraiSignalExport(numeraiPublicId, numeraiSecretId, numeraiModelId, numeraiFilename));\n        }\n\n        public void SubmitSignals()\n        {\n            // Select the subset of ETF constituents we can trade\n            var symbols = _securities.Where(security => security.HasData)\n                            .Select(security => security.Symbol)\n                            .OrderBy(symbol => symbol)\n                            .ToList();\n            if (symbols.Count == 0)\n            {\n                return;\n            }\n\n            // Get historical data\n            // var history = History(symbols, 22, Resolution.Daily);\n\n            // Create portfolio targets\n            //  Numerai requires that at least one of the signals have a unique weight\n            //  To ensure they are all unique, this demo gives a linear allocation to each symbol (ie. 1/55, 2/55, ..., 10/55)\n            var denominator = symbols.Count * (symbols.Count + 1) / 2.0m; // sum of 1, 2, ..., symbols.Count\n            var targets = symbols.Select((symbol, i) => new PortfolioTarget(symbol, (i + 1) / denominator)).ToList();\n\n            // (Optional) Place trades\n            SetHoldings(targets);\n\n            // Send signals to Numerai\n            var success = SignalExport.SetTargetPortfolio(targets.ToArray());\n            if (!success)\n            {\n                Debug($\"Couldn't send targets at {Time}\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (_securities.Contains(security))\n                {\n                    _securities.Remove(security);\n                }\n            }\n\n            foreach (var security in changes.AddedSecurities)\n            {\n                if (security.Symbol != _etfSymbol)\n                {\n                    _securities.Add(security);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ObjectStoreExampleAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Storage;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm showcases some features of the <see cref=\"IObjectStore\"/> feature.\n    /// One use case is to make consecutive backtests run faster by caching the results of\n    /// potentially time consuming operations. In this example, we save the results of a\n    /// history call. This pattern can be equally applied to a machine learning model being\n    /// trained and then saving the model weights in the object store.\n    /// </summary>\n    public class ObjectStoreExampleAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string SPY_Close_ObjectStore_Key = \"spy_close\";\n        private Symbol SPY;\n        private Identity SPY_Close;\n        private ExponentialMovingAverage SPY_Close_EMA10;\n        private ExponentialMovingAverage SPY_Close_EMA50;\n\n        // track last year of close and EMA10/EMA50\n        private readonly RollingWindow<IndicatorDataPoint> SPY_Close_History = new RollingWindow<IndicatorDataPoint>(252);\n        private readonly RollingWindow<IndicatorDataPoint> SPY_Close_EMA10_History = new RollingWindow<IndicatorDataPoint>(252);\n        private readonly RollingWindow<IndicatorDataPoint> SPY_Close_EMA50_History = new RollingWindow<IndicatorDataPoint>(252);\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            SPY = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            // define indicators on SPY daily closing prices\n            SPY_Close = Identity(SPY, Resolution.Daily);\n            SPY_Close_EMA10 = SPY_Close.EMA(10);\n            SPY_Close_EMA50 = SPY_Close.EMA(50);\n\n            // each time an indicator is updated, push the value into our history rolling windows\n            SPY_Close.Updated += (sender, args) =>\n            {\n                // each time we receive new closing price data, push our window to the object store\n                SPY_Close_History.Add(args);\n            };\n\n            SPY_Close_EMA10.Updated += (sender, args) => SPY_Close_EMA10_History.Add(args);\n            SPY_Close_EMA50.Updated += (sender, args) => SPY_Close_EMA50_History.Add(args);\n\n            if (ObjectStore.ContainsKey(SPY_Close_ObjectStore_Key))\n            {\n                // our object store has our historical data saved, read the data\n                // and push it through the indicators to warm everything up\n                var values = ObjectStore.ReadJson<IndicatorDataPoint[]>(SPY_Close_ObjectStore_Key);\n                Debug($\"{SPY_Close_ObjectStore_Key} key exists in object store. Count: {values.Length}\");\n\n                foreach (var value in values)\n                {\n                    SPY_Close.Update(value);\n                }\n            }\n            else\n            {\n                Debug($\"{SPY_Close_ObjectStore_Key} key does not exist in object store. Fetching history...\");\n\n                // if our object store doesn't have our data, fetch the history to initialize\n                // we're pulling the last year's worth of SPY daily trade bars to fee into our indicators\n                var history = History(SPY, TimeSpan.FromDays(365), Resolution.Daily);\n\n                foreach (var tradeBar in history)\n                {\n                    SPY_Close.Update(tradeBar.EndTime, tradeBar.Close);\n                }\n\n                // save our warm up data so next time we don't need to issue the history request\n                var array = SPY_Close_History.Reverse().ToArray();\n                ObjectStore.SaveJson(SPY_Close_ObjectStore_Key, array);\n\n                // Can also use ObjectStore.SaveBytes(key, byte[])\n                // and to read  ObjectStore.ReadBytes(key) => byte[]\n\n                // we can also get a file path for our data. some ML libraries require model\n                // weights to be loaded directly from a file path. The object store can provide\n                // a file path for any key by: ObjectStore.GetFilePath(key) => string (file path)\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (SPY_Close_EMA10 > SPY_Close && SPY_Close_EMA10 > SPY_Close_EMA50)\n            {\n                SetHoldings(SPY, 1m);\n            }\n            else if (SPY_Close_EMA10 < SPY_Close && SPY_Close_EMA10 < SPY_Close_EMA50)\n            {\n                SetHoldings(SPY, -1m);\n            }\n            else if (Portfolio[SPY].IsLong)\n            {\n                if (SPY_Close_EMA10 < SPY_Close_EMA50)\n                {\n                    Liquidate(SPY);\n                }\n            }\n            else if (Portfolio[SPY].IsShort)\n            {\n                if (SPY_Close_EMA10 > SPY_Close_EMA50)\n                {\n                    Liquidate(SPY);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 249;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnEndOfDayAddDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm verifying OnEndOfDay callbacks are called as expected for AddData symbols. See GH issue 4001.\n    /// </summary>\n    public class OnEndOfDayAddDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _count = 0;\n        private Symbol _spy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol != _spy)\n            {\n                throw new RegressionTestException($\"Unexpected 'OnEndOfDay(Symbol symbol)' symbol {symbol}\");\n            }\n            _count++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Monday to Friday\n            if (_count != 5)\n            {\n                throw new RegressionTestException($\"Unexpected 'OnEndOfDay(Symbol symbol)' calls {_count}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnEndOfDayInternalSecurityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that reproduces an issue where on end of day events would be removed when an internal security is removed\n    /// </summary>\n    public class OnEndOfDayInternalSecurityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<DateTime, HashSet<Symbol>> _onEndOfDaySymbols = new();\n        private Future _futureGold;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 15);\n            SetEndDate(2013, 10, 20);\n\n            _futureGold = AddFuture(Futures.Metals.Gold, Resolution.Daily);\n            _futureGold.SetFilter(0, 182);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var changedEvent in slice.SymbolChangedEvents.Values)\n            {\n                Debug($\"{Time} {changedEvent}\");\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (Time.Day == 15)\n            {\n                return;\n            }\n            Debug($\"{Time} {symbol}\");\n            if (!_onEndOfDaySymbols.TryGetValue(Time, out var symbols))\n            {\n                _onEndOfDaySymbols[Time] = symbols = new();\n            }\n            symbols.Add(symbol);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onEndOfDaySymbols.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected {_onEndOfDaySymbols.Count} on end of day symbols call\");\n            }\n\n            if (_onEndOfDaySymbols.Any(x => x.Value.Count != 5))\n            {\n                throw new RegressionTestException($\"Expected 5 symbols on end of day, but found \" +\n                    $\"{string.Join(\", \", _onEndOfDaySymbols.Select(x => $\"{x.Key:yyyyMMdd}: {x.Value.Count}\"))}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 88;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-133.472\"},\n            {\"Tracking Error\", \"0.065\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnEndOfDayRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Test algorithm verifying OnEndOfDay callbacks are called as expected. See GH issue 2865.\n    /// </summary>\n    public class OnEndOfDayRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spySymbol;\n        private Symbol _bacSymbol;\n        private Symbol _ibmSymbol;\n        private int _onEndOfDaySpyCallCount;\n        private int _onEndOfDayBacCallCount;\n        private int _onEndOfDayIbmCallCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spySymbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            _bacSymbol = QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA);\n            _ibmSymbol = QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n\n            AddUniverse(\"my-universe-name\", time =>\n            {\n                if (time.Day == 8)\n                {\n                    return new List<string> { _spySymbol.Value, _ibmSymbol.Value };\n                }\n                return new List<string> { _spySymbol.Value };\n            });\n        }\n\n        /// <summary>\n        /// We expect it to be called for the universe selected <see cref=\"Symbol\"/>\n        /// and the post initialize manually added equity <see cref=\"Symbol\"/>\n        /// </summary>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol == _spySymbol)\n            {\n                if (_onEndOfDaySpyCallCount == 0)\n                {\n                    // just the first time\n                    SetHoldings(_spySymbol, 0.5);\n                    AddEquity(\"BAC\");\n                }\n                _onEndOfDaySpyCallCount++;\n            }\n            else if (symbol == _bacSymbol)\n            {\n                if (_onEndOfDayBacCallCount == 0)\n                {\n                    // just the first time\n                    SetHoldings(_bacSymbol, 0.5);\n                }\n                _onEndOfDayBacCallCount++;\n            }\n            else if (symbol == _ibmSymbol)\n            {\n                _onEndOfDayIbmCallCount++;\n            }\n            Log($\"OnEndOfDay({symbol}) called: {UtcTime}.\" +\n                $\" SPY count: {_onEndOfDaySpyCallCount}.\" +\n                $\" IBM count: {_onEndOfDayIbmCallCount}.\" +\n                $\" BAC count: {_onEndOfDayBacCallCount}\");\n        }\n\n        /// <summary>\n        /// Assert expected behavior\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onEndOfDaySpyCallCount != 5)\n            {\n                throw new RegressionTestException($\"OnEndOfDay(SPY) unexpected count call {_onEndOfDaySpyCallCount}\");\n            }\n            if (_onEndOfDayBacCallCount != 4)\n            {\n                throw new RegressionTestException($\"OnEndOfDay(BAC) unexpected count call {_onEndOfDayBacCallCount}\");\n            }\n            if (_onEndOfDayIbmCallCount != 1)\n            {\n                throw new RegressionTestException($\"OnEndOfDay(IBM) unexpected count call {_onEndOfDayIbmCallCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7868;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"489.968%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102295.22\"},\n            {\"Net Profit\", \"2.295%\"},\n            {\"Sharpe Ratio\", \"15.661\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"78.483%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.604\"},\n            {\"Beta\", \"0.954\"},\n            {\"Annual Standard Deviation\", \"0.223\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"22.254\"},\n            {\"Tracking Error\", \"0.068\"},\n            {\"Treynor Ratio\", \"3.656\"},\n            {\"Total Fees\", \"$22.11\"},\n            {\"Estimated Strategy Capacity\", \"$5600000.00\"},\n            {\"Lowest Capacity Asset\", \"NB R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.96%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"17eb374f011ccb57a28cef4b9a4585d8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnOrderEventExceptionRegression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression Algorithm for testing engine behavior with throwing errors in OnOrderEvent\n    /// Should result in a RunTimeError status.\n    /// Reference GH Issue #4947\n    /// </summary>\n    public class OnOrderEventExceptionRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// OnOrderEvent is called whenever an order is updated\n        /// </summary>\n        /// <param name=\"orderEvent\">Order Event</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            throw new RegressionTestException(\"OnOrderEvent exception\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 12;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.RuntimeError;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99948.97\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$57000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnWarmupFinishedNoWarmup.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting <see cref=\"OnWarmupFinished\"/> is called even if no warmup period is set\n    /// </summary>\n    public class OnWarmupFinishedNoWarmup : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _onWarmupFinished;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        public override void OnWarmupFinished()\n        {\n            _onWarmupFinished++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onWarmupFinished != 1)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(OnWarmupFinished)} call count {_onWarmupFinished}!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OnWarmupFinishedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting <see cref=\"OnWarmupFinished\"/> is being called\n    /// </summary>\n    public class OnWarmupFinishedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _onWarmupFinished;\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n            SetWarmup(TimeSpan.FromDays(1));\n        }\n\n        public override void OnWarmupFinished()\n        {\n            _onWarmupFinished++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onWarmupFinished != 1)\n            {\n                throw new RegressionTestException($\"Unexpected {nameof(OnWarmupFinished)} call count {_onWarmupFinished}!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-57.739\"},\n            {\"Tracking Error\", \"0.178\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OpenInterestFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Futures framework algorithm that uses open interest to select the active contract.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"futures\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class OpenInterestFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private static readonly HashSet<DateTime> ExpectedExpiryDates = new HashSet<DateTime>\n        {\n            new DateTime(2013, 12, 27),\n            new DateTime(2014, 02, 26)\n        };\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Tick;\n\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 11);\n            SetCash(10000000);\n\n            // set framework models\n            SetUniverseSelection(\n                new OpenInterestFutureUniverseSelectionModel(\n                    this,\n                    t => new[] {QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX)},\n                    null,\n                    ExpectedExpiryDates.Count\n                )\n            );\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Transactions.OrdersCount == 0 && slice.HasData)\n            {\n                var matched = slice.Keys.Where(s => !s.IsCanonical() && !ExpectedExpiryDates.Contains(s.ID.Date)).ToList();\n                if (matched.Count != 0)\n                {\n                    throw new RegressionTestException($\"{matched.Count}/{slice.Keys.Count} were unexpected expiry date(s): \" + string.Join(\", \", matched.Select(x => x.ID.Date)));\n                }\n\n                foreach (var symbol in slice.Keys)\n                {\n                    MarketOrder(symbol, 1);\n                }\n            }\n            else if (Portfolio.Any(p => p.Value.Invested))\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        ///     This is used by the regression test system to indicate if the open source Lean repository has the required data to\n        ///     run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        ///     This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 526055;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 232;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-0.020%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9999980.12\"},\n            {\"Net Profit\", \"0.000%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-57.739\"},\n            {\"Tracking Error\", \"0.178\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.88\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GC VOFJUCDY9XNH\"},\n            {\"Portfolio Turnover\", \"1.32%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4a7e699024771890b97c4ab74365e4b7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OpeningBreakoutAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    ///\n    /// QCU: Opening Breakout Algorithm\n    ///\n    /// In this algorithm we attempt to provide a working algorithm that\n    /// addresses many of the primary algorithm concerns. These concerns\n    /// are:\n    ///\n    ///     1. Signal Generation.\n    ///             This algorithm aims to generate signals for an opening\n    ///             breakout move before 10am. Signals are generated by\n    ///             producing the opening five minute bar, and then trading\n    ///             in the direction of the breakout from that bar.\n    ///\n    ///     2. Position Sizing.\n    ///             Positions are sized using recently the average true range.\n    ///             The higher the recently movement, the smaller position.\n    ///             This helps to reduce the risk of losing a lot on a single\n    ///             transaction.\n    ///\n    ///     3. Active Stop Loss.\n    ///             Stop losses are maintained at a fixed global percentage to\n    ///             limit maximum losses per day, while also a trailing stop\n    ///             loss is implemented using the parabolic stop and reverse\n    ///             in order to gauge exit points.\n    ///\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    public class OpeningBreakoutAlgorithm : QCAlgorithm\n    {\n#pragma warning disable 00162 // File contains unreachable code when EnableOrderUpdateLogging is false\n\n        // the equity symbol we're trading\n        private const string symbol = \"SPY\";\n\n        // plotting and logging control\n        private const bool EnablePlotting = true;\n        private const bool EnableOrderUpdateLogging = false;\n        private const int PricePlotFrequencyInSeconds = 15;\n\n        // risk control\n        private const decimal MaximumLeverage = 4;\n        private const decimal GlobalStopLossPercent = 0.001m;\n        private const decimal PercentProfitStartPsarTrailingStop = 0.0003m;\n        private const decimal MaximumPorfolioRiskPercentPerPosition = .0025m;\n\n        // entrance criteria\n        private const int OpeningSpanInMinutes = 3;\n        private const decimal BreakoutThresholdPercent = 0.00005m;\n        private const decimal AtrVolatilityThresholdPercent = 0.00275m;\n        private const decimal StdVolatilityThresholdPercent = 0.005m;\n\n        // this is the security we're trading\n        private Security _security;\n\n        // define our indicators used for trading decisions\n        private AverageTrueRange ATR14;\n        private StandardDeviation STD14;\n        private AverageDirectionalIndex ADX14;\n        private ParabolicStopAndReverse PSARMin;\n\n        // smoothed values\n        private ExponentialMovingAverage _smoothedSTD14;\n        private ExponentialMovingAverage _smoothedATR14;\n\n        // working variable to control our algorithm\n\n        // this flag is used to run some code only once after the algorithm is warmed up\n        private bool FinishedWarmup;\n        // this is used to record the last time we closed a position\n        private DateTime LastExitTime;\n        // this is our opening n minute bar\n        private TradeBar OpeningBarRange;\n        // this is the ticket from our market order (entrance)\n        private OrderTicket MarketTicket;\n        // this is the ticket from our stop loss order (exit)\n        private OrderTicket StopLossTicket;\n        // this flag is used to indicate we've switched from a global, non changing\n        // stop loss to a dynamic trailing stop using the PSAR\n        private bool EnablePsarTrailingStop;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            // initialize algorithm level parameters\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            //SetStartDate(2014, 01, 01);\n            //SetEndDate(2014, 06, 01);\n            SetCash(100000);\n\n            // leverage tradier $1 traders\n            SetBrokerageModel(BrokerageName.TradierBrokerage);\n\n            // request high resolution equity data\n            AddSecurity(SecurityType.Equity, symbol, Resolution.Second);\n\n            // save off our security so we can reference it quickly later\n            _security = Securities[symbol];\n\n            // Set our max leverage\n            _security.SetLeverage(MaximumLeverage);\n\n            // define our longer term indicators\n            ADX14 = ADX(symbol, 28, Resolution.Hour);\n            STD14 = STD(symbol, 14, Resolution.Daily);\n            ATR14 = ATR(symbol, 14, resolution: Resolution.Daily);\n            PSARMin = new ParabolicStopAndReverse(symbol, afStart: 0.0001m, afIncrement: 0.0001m);\n\n            // smooth our ATR over a week, we'll use this to determine if recent volatilty warrants entrance\n            var oneWeekInMarketHours = (int)(5*6.5);\n            _smoothedATR14 = new ExponentialMovingAverage(\"Smoothed_\" + ATR14.Name, oneWeekInMarketHours).Of(ATR14);\n            // smooth our STD over a week as well\n            _smoothedSTD14 = new ExponentialMovingAverage(\"Smoothed_\"+STD14.Name, oneWeekInMarketHours).Of(STD14);\n\n            // initialize our charts\n            var chart = new Chart(symbol);\n            chart.AddSeries(new Series(ADX14.Name, SeriesType.Line, 0));\n            chart.AddSeries(new Series(\"Enter\", SeriesType.Scatter, 0));\n            chart.AddSeries(new Series(\"Exit\", SeriesType.Scatter, 0));\n            chart.AddSeries(new Series(PSARMin.Name, SeriesType.Scatter, 0));\n            AddChart(chart);\n\n            var history = History(symbol, 20, Resolution.Daily);\n            foreach (var bar in history)\n            {\n                ADX14.Update(bar);\n                ATR14.Update(bar);\n                STD14.Update(bar.EndTime, bar.Close);\n            }\n\n            // schedule an event to run every day at five minutes after our symbol's market open\n            Schedule.Event(\"MarketOpenSpan\")\n                .EveryDay(symbol)\n                .AfterMarketOpen(symbol, minutesAfterOpen: OpeningSpanInMinutes)\n                .Run(MarketOpeningSpanHandler);\n\n            Schedule.Event(\"MarketOpen\")\n                .EveryDay(symbol)\n                .AfterMarketOpen(symbol, minutesAfterOpen: -1)\n                .Run(() => PSARMin.Reset());\n        }\n\n        /// <summary>\n        /// This function is scheduled to be run every day at the specified number of minutes after market open\n        /// </summary>\n        public void MarketOpeningSpanHandler()\n        {\n            // request the last n minutes of data in minute bars, we're going to\n            // define the opening rang\n            var history = History(symbol, OpeningSpanInMinutes, Resolution.Minute);\n\n            // this is our bar size\n            var openingSpan = TimeSpan.FromMinutes(OpeningSpanInMinutes);\n\n            // we only care about the high and low here\n            OpeningBarRange = new TradeBar\n            {\n                // time values\n                Time = Time - openingSpan,\n                EndTime = Time,\n                Period = openingSpan,\n                // high and low\n                High = _security.Close,\n                Low = _security.Close\n            };\n\n            // aggregate the high/low for the opening range\n            foreach (var tradeBar in history)\n            {\n                OpeningBarRange.Low = Math.Min(OpeningBarRange.Low, tradeBar.Low);\n                OpeningBarRange.High = Math.Max(OpeningBarRange.High, tradeBar.High);\n            }\n\n            // widen the bar when looking for breakouts\n            OpeningBarRange.Low *= 1 - BreakoutThresholdPercent;\n            OpeningBarRange.High *= 1 + BreakoutThresholdPercent;\n\n            Log(\"---------\" + Time.Date + \"---------\");\n            Log(\"OpeningBarRange: Low: \" + OpeningBarRange.Low.SmartRounding() + \" High: \" + OpeningBarRange.High.SmartRounding());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice data)\n        {\n            // we don't need to run any of this during our warmup phase\n            if (IsWarmingUp) return;\n\n            // when we're done warming up, register our indicators to start plotting\n            if (!IsWarmingUp && !FinishedWarmup)\n            {\n                // this is a run once flag for when we're finished warmup\n                FinishedWarmup = true;\n\n                // plot our hourly indicators automatically, wait for them to ready\n                PlotIndicator(\"ADX\", ADX14);\n                PlotIndicator(\"ADX\", ADX14.NegativeDirectionalIndex, ADX14.PositiveDirectionalIndex);\n\n                PlotIndicator(\"ATR\", true, ATR14);\n                PlotIndicator(\"STD\", true, STD14);\n                PlotIndicator(\"ATR\", true, _smoothedATR14);\n            }\n\n            // update our PSAR\n            PSARMin.Update((TradeBar) _security.GetLastData());\n\n            // plot price until an hour after we close so we can see our execution skillz\n            if (ShouldPlot)\n            {\n                // we can plot price more often if we want\n                Plot(symbol, \"Price\", _security.Close);\n                // only plot psar on the minute\n                if (PSARMin.IsReady)\n                {\n                    Plot(symbol, PSARMin);\n                }\n            }\n\n            // first wait for our opening range bar to be set to today\n            if (OpeningBarRange == null || OpeningBarRange.EndTime.Date != Time.Date || OpeningBarRange.EndTime == Time) return;\n\n            // we only trade max once per day, so if we've already exited the stop loss, bail\n            if (StopLossTicket != null && StopLossTicket.Status == OrderStatus.Filled)\n            {\n                // null these out to signal that we're done trading for the day\n                OpeningBarRange = null;\n                StopLossTicket = null;\n                return;\n            }\n\n            // now that we have our opening bar, test to see if we're already in a position\n            if (!_security.Invested)\n            {\n                ScanForEntrance();\n            }\n            else\n            {\n                // if we haven't exited yet then manage our stop loss, this controls our exit point\n                if (_security.Invested)\n                {\n                    ManageStopLoss();\n                }\n                else if (StopLossTicket != null && StopLossTicket.Status.IsOpen())\n                {\n                    StopLossTicket.Cancel();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Scans for a breakout from the opening range bar\n        /// </summary>\n        private void ScanForEntrance()\n        {\n            // scan for entrances, we only want to do this before 10am\n            if (Time.TimeOfDay.Hours >= 10) return;\n\n            // expect capture 10% of the daily range\n            var expectedCaptureRange = 0.1m*ATR14;\n\n            var allowedDollarLoss = MaximumPorfolioRiskPercentPerPosition * Portfolio.TotalPortfolioValue;\n\n            var shares = (int) (allowedDollarLoss/expectedCaptureRange);\n\n            // determine a position size based on an acceptable loss in proporton to our total portfolio value\n            //var shares = (int) (MaximumLeverage*MaximumPorfolioRiskPercentPerPosition*Portfolio.TotalPortfolioValue/(0.4m*ATR14));\n\n            // max out at a little below our stated max, prevents margin calls and such\n            var maxShare = (int) CalculateOrderQuantity(symbol, MaximumLeverage);\n            shares = Math.Min(shares, maxShare);\n\n            // min out at 1x leverage\n            //var minShare = CalculateOrderQuantity(symbol, MaximumLeverage/2m);\n            //shares = Math.Max(shares, minShare);\n\n            // we're looking for a breakout of the opening range bar in the direction of the medium term trend\n            if (ShouldEnterLong)\n            {\n                // breakout to the upside, go long (fills synchronously)\n                MarketTicket = MarketOrder(symbol, shares);\n                Log(\"Enter long @ \" + MarketTicket.AverageFillPrice.SmartRounding() + \" Shares: \" + shares);\n                Plot(symbol, \"Enter\", MarketTicket.AverageFillPrice);\n\n                // we'll start with a global, non-trailing stop loss\n                EnablePsarTrailingStop = false;\n\n                // submit stop loss order for max loss on the trade\n                var stopPrice = _security.Low*(1 - GlobalStopLossPercent);\n                StopLossTicket = StopMarketOrder(symbol, -shares, stopPrice);\n                if (EnableOrderUpdateLogging)\n                {\n                    Log(\"Submitted stop loss @ \" + stopPrice.SmartRounding());\n                }\n            }\n            else if (ShouldEnterShort)\n            {\n                // breakout to the downside, go short\n                MarketTicket = MarketOrder(symbol, - -shares);\n                Log(\"Enter short @ \" + MarketTicket.AverageFillPrice.SmartRounding());\n                Plot(symbol, \"Enter\", MarketTicket.AverageFillPrice);\n\n                // we'll start with a global, non-trailing stop loss\n                EnablePsarTrailingStop = false;\n\n                // submit stop loss order for max loss on the trade\n                var stopPrice = _security.High*(1 + GlobalStopLossPercent);\n                StopLossTicket = StopMarketOrder(symbol, -shares, stopPrice);\n                if (EnableOrderUpdateLogging)\n                {\n                    Log(\"Submitted stop loss @ \" + stopPrice.SmartRounding() + \" Shares: \" + shares);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Manages our stop loss ticket\n        /// </summary>\n        private void ManageStopLoss()\n        {\n            // if we've already exited then no need to do more\n            if (StopLossTicket == null || StopLossTicket.Status == OrderStatus.Filled) return;\n\n            // only do this once per minute\n            //if (Time.RoundDown(TimeSpan.FromMinutes(1)) != Time) return;\n\n            // get the current stop price\n            var stopPrice = StopLossTicket.Get(OrderField.StopPrice);\n\n            // check for enabling the psar trailing stop\n            if (ShouldEnablePsarTrailingStop(stopPrice))\n            {\n                EnablePsarTrailingStop = true;\n                Log(\"Enabled PSAR trailing stop @ ProfitPercent: \" + _security.Holdings.UnrealizedProfitPercent.SmartRounding());\n            }\n\n            // we've trigger the psar trailing stop, so start updating our stop loss tick\n            if (EnablePsarTrailingStop && PSARMin.IsReady)\n            {\n                StopLossTicket.Update(new UpdateOrderFields {StopPrice = PSARMin});\n                Log(\"Submitted stop loss @ \" + PSARMin.Current.Value.SmartRounding());\n            }\n        }\n\n        /// <summary>\n        /// This event handler is fired for each and every order event the algorithm\n        /// receives. We'll perform some logging and house keeping here\n        /// </summary>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // print debug messages for all order events\n            if (LiveMode || orderEvent.Status.IsFill() || EnableOrderUpdateLogging)\n            {\n                LiveDebug(\"Filled: \" + orderEvent.FillQuantity + \" Price: \" + orderEvent.FillPrice);\n            }\n\n            // if this is a fill and we now don't own any stock, that means we've closed for the day\n            if (!_security.Invested && orderEvent.Status == OrderStatus.Filled)\n            {\n                // reset values for tomorrow\n                LastExitTime = Time;\n                var ticket = Transactions.GetOrderTickets(x => x.OrderId == orderEvent.OrderId).Single();\n                Plot(symbol, \"Exit\", ticket.AverageFillPrice);\n            }\n        }\n\n        /// <summary>\n        /// If we're still invested by the end of the day, liquidate\n        /// </summary>\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol == _security.Symbol && _security.Invested)\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not we should plot. This is used\n        /// to provide enough plot points but not too many, we don't\n        /// need to plot every second in backtests to get an idea of\n        /// how good or bad our algorithm is performing\n        /// </summary>\n        public bool ShouldPlot\n        {\n            get\n            {\n                // always in live\n                if (LiveMode) return true;\n                // set in top to override plotting during long backtests\n                if (!EnablePlotting) return false;\n                // every 30 seconds in backtest\n                if (Time.RoundDown(TimeSpan.FromSeconds(PricePlotFrequencyInSeconds)) != Time) return false;\n                // always if we're invested\n                if (_security.Invested) return true;\n                // always if it's before noon\n                if (Time.TimeOfDay.Hours < 10.25) return true;\n                // for an hour after our exit\n                if (Time - LastExitTime < TimeSpan.FromMinutes(30)) return true;\n\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// In live mode it's nice to push messages to the debug window\n        /// as well as the log, this allows easy real time inspection of\n        /// how the algorithm is performing\n        /// </summary>\n        public void LiveDebug(object msg)\n        {\n            if (msg == null) return;\n\n            if (LiveMode)\n            {\n                Debug(msg.ToString());\n                Log(msg.ToString());\n            }\n            else\n            {\n                Log(msg.ToString());\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not we should end a long position\n        /// </summary>\n        private bool ShouldEnterLong\n        {\n            // check to go in the same direction of longer term trend and opening break out\n            get\n            {\n                return IsUptrend\n                    && HasEnoughRecentVolatility\n                    && _security.Close > OpeningBarRange.High;\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not we're currently in a medium term up trend\n        /// </summary>\n        private bool IsUptrend\n        {\n            get { return ADX14 > 20 && ADX14.PositiveDirectionalIndex > ADX14.NegativeDirectionalIndex; }\n        }\n\n        /// <summary>\n        /// Determines whether or not we should enter a short position\n        /// </summary>\n        private bool ShouldEnterShort\n        {\n            // check to go in the same direction of longer term trend and opening break out\n            get\n            {\n                return IsDowntrend\n                    && HasEnoughRecentVolatility\n                    && _security.Close < OpeningBarRange.Low;\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not we're currently in a medium term down trend\n        /// </summary>\n        private bool IsDowntrend\n        {\n            get { return ADX14 > 20 && ADX14.NegativeDirectionalIndex > ADX14.PositiveDirectionalIndex; }\n        }\n\n        /// <summary>\n        /// Determines whether or not there's been enough recent volatility for\n        /// this strategy to work\n        /// </summary>\n        private bool HasEnoughRecentVolatility\n        {\n            get\n            {\n                return _smoothedATR14 > _security.Close*AtrVolatilityThresholdPercent\n                    || _smoothedSTD14 > _security.Close*StdVolatilityThresholdPercent;\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not we should enable the psar trailing stop\n        /// </summary>\n        /// <param name=\"stopPrice\">current stop price of our stop loss tick</param>\n        private bool ShouldEnablePsarTrailingStop(decimal stopPrice)\n        {\n            // no need to enable if it's already enabled\n            return !EnablePsarTrailingStop\n                // once we're up a certain percentage, we'll use PSAR to control our stop\n                && _security.Holdings.UnrealizedProfitPercent > PercentProfitStartPsarTrailingStop\n                // make sure the PSAR is on the right side\n                && PsarIsOnRightSideOfPrice\n                // make sure the PSAR is more profitable than our global loss\n                && IsPsarMoreProfitableThanStop(stopPrice);\n        }\n\n        /// <summary>\n        /// Determines whether or not the PSAR is on the right side of price depending on our long/short\n        /// </summary>\n        private bool PsarIsOnRightSideOfPrice\n        {\n            get\n            {\n                return (_security.Holdings.IsLong && PSARMin < _security.Close)\n                    || (_security.Holdings.IsShort && PSARMin > _security.Close);\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not the PSAR stop price is better than the specified stop price\n        /// </summary>\n        private bool IsPsarMoreProfitableThanStop(decimal stopPrice)\n        {\n            return (_security.Holdings.IsLong && PSARMin > stopPrice)\n                || (_security.Holdings.IsShort && PSARMin < stopPrice);\n        }\n#pragma warning restore 00162\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionAssignmentRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm verifies automatic option contract assignment behavior.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class OptionAssignmentRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security Stock;\n\n        private Security CallOption;\n        private Symbol CallOptionSymbol;\n\n        private Security PutOption;\n        private Symbol PutOptionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n            Stock = AddEquity(\"GOOG\", Resolution.Minute);\n\n            var contracts = OptionChain(Stock.Symbol).ToList();\n\n            PutOptionSymbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Put)\n                .OrderBy(c => c.ID.Date)\n                .First(c => c.ID.StrikePrice == 800m);\n\n            CallOptionSymbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Call)\n                .OrderBy(c => c.ID.Date)\n                .First(c => c.ID.StrikePrice == 600m);\n\n            PutOption = AddOptionContract(PutOptionSymbol);\n            CallOption = AddOptionContract(CallOptionSymbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && Stock.Price != 0 && PutOption.Price != 0 && CallOption.Price != 0)\n            {\n                // this gets executed on start and after each auto-assignment, finally ending with expiration assignment\n                if (Time < PutOptionSymbol.ID.Date)\n                {\n                    MarketOrder(PutOptionSymbol, -1);\n                }\n\n                if (Time < CallOptionSymbol.ID.Date)\n                {\n                    MarketOrder(CallOptionSymbol, -1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4026;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"32\"},\n            {\"Average Win\", \"9.60%\"},\n            {\"Average Loss\", \"-16.91%\"},\n            {\"Compounding Annual Return\", \"-84.836%\"},\n            {\"Drawdown\", \"2.900%\"},\n            {\"Expectancy\", \"-0.608\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97114\"},\n            {\"Net Profit\", \"-2.886%\"},\n            {\"Sharpe Ratio\", \"-7.473\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.125%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"0.57\"},\n            {\"Alpha\", \"-0.016\"},\n            {\"Beta\", \"0.458\"},\n            {\"Annual Standard Deviation\", \"0.014\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.991\"},\n            {\"Tracking Error\", \"0.015\"},\n            {\"Treynor Ratio\", \"-0.229\"},\n            {\"Total Fees\", \"$16.00\"},\n            {\"Estimated Strategy Capacity\", \"$710000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ20WLZZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"218.80%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"590ba58e303f1f60f855f458300d08af\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionAssignmentStatisticsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting final trade statistics for options assignment\n    ///\n    /// Expected win/loss rate statistics for the regression algorithm:\n    ///     Loss Rate 25%\n    ///     Win Rate 75%\n    /// </summary>\n    public class OptionAssignmentStatisticsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _goog;\n        private Security _googCall600;\n        private Symbol _googCall600Symbol;\n        private Security _googCall650;\n        private Symbol _googCall650Symbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            _goog = AddEquity(\"GOOG\", Resolution.Minute);\n\n            var contracts = OptionChain(_goog.Symbol).ToList();\n\n            _googCall600Symbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Call)\n                .OrderBy(c => c.ID.Date)\n                .First(c => c.ID.StrikePrice == 600m);\n            _googCall600 = AddOptionContract(_googCall600Symbol);\n            _googCall600[\"closed\"] = false;\n\n            _googCall650Symbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Call)\n                .OrderBy(c => c.ID.Date)\n                .First(c => c.ID.StrikePrice == 650m);\n            _googCall650 = AddOptionContract(_googCall650Symbol);\n            _googCall650[\"closed\"] = false;\n            _googCall650[\"bought\"] = false;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (Time < _googCall600Symbol.ID.Date)\n                {\n                    // This option assignment is expected to be a losing trade. The option is ITM but the premium paid is higher than the pay off\n                    MarketOrder(_googCall600Symbol, 1);\n                }\n\n                if (Time < _googCall650Symbol.ID.Date && !(bool)_googCall650[\"bought\"])\n                {\n                    // This option assignment is expected to be a winning trade\n                    LimitOrder(_googCall650Symbol, 1, 0.95m * _googCall650.Price);\n                    // This is to avoid placing another order for this option\n                    _googCall650[\"bought\"] = true;\n                }\n            }\n            else if (_goog.Invested && (bool)_googCall600[\"closed\"] && (bool)_googCall650[\"closed\"])\n            {\n                Liquidate(_goog.Symbol);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled && orderEvent.Symbol.SecurityType.IsOption())\n            {\n                Securities[orderEvent.Symbol][\"closed\"] = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            AssertTradeStatistics();\n            AssertPortfolioStatistics();\n        }\n\n        private void AssertTradeStatistics()\n        {\n            var trades = TradeBuilder.ClosedTrades;\n\n            if (trades.Count != 4)\n            {\n                throw new RegressionTestException($@\"AssertTradeStatistics(): Expected 4 closed trades: 2 for the options, 2 for the underlying. Actual: {\n                    trades.Count}\");\n            }\n\n            var statistics = new TradeStatistics(trades);\n\n            if (statistics.TotalNumberOfTrades != 4)\n            {\n                throw new RegressionTestException($@\"AssertTradeStatistics(): Expected 4 total trades: 2 for the options, 2 for the underlying. Actual: {\n                    statistics.TotalNumberOfTrades}\");\n            }\n\n            if (statistics.NumberOfWinningTrades != 3)\n            {\n                throw new RegressionTestException($@\"AssertTradeStatistics(): Expected 3 winning trades (the ITM 650 strike option and the underlying trades). Actual {\n                    statistics.NumberOfWinningTrades}\");\n            }\n\n            if (statistics.NumberOfLosingTrades != 1)\n            {\n                throw new RegressionTestException($@\"AssertTradeStatistics(): Expected 1 losing trade (the 600 strike option). Actual {\n                    statistics.NumberOfLosingTrades}\");\n            }\n\n            if (statistics.WinRate != 0.75m)\n            {\n                throw new RegressionTestException($\"AssertTradeStatistics(): Expected win rate to be 0.75. Actual {statistics.WinRate}\");\n            }\n\n            if (statistics.LossRate != 0.25m)\n            {\n                throw new RegressionTestException($\"AssertTradeStatistics(): Expected loss rate to be 0.25. Actual {statistics.LossRate}\");\n            }\n\n            if (statistics.WinLossRatio != 3)\n            {\n                throw new RegressionTestException($\"AssertTradeStatistics(): Expected win-loss ratio to be 3. Actual {statistics.WinLossRatio}\");\n            }\n\n            // Let's assert the trades per symbol just to be sure\n\n            // We expect the first option (600 strike) to be a losing trade\n            var googCall600Trade = trades.Where(t => t.Symbol == _googCall600Symbol).FirstOrDefault();\n            if (googCall600Trade == null)\n            {\n                throw new RegressionTestException(\"AssertTradeStatistics(): Expected a closed trade for the 600 strike option\");\n            }\n            if (googCall600Trade.IsWin)\n            {\n                throw new RegressionTestException(\"AssertTradeStatistics(): Expected the 600 strike option to be a losing trade\");\n            }\n\n            // We expect the second option (650 strike) to be a winning trade\n            var googCall650Trade = trades.Where(t => t.Symbol == _googCall650Symbol).FirstOrDefault();\n            if (googCall650Trade == null)\n            {\n                throw new RegressionTestException(\"AssertTradeStatistics(): Expected a closed trade for the 650 strike option\");\n            }\n            if (!googCall650Trade.IsWin)\n            {\n                throw new RegressionTestException(\"AssertTradeStatistics(): Expected the 650 strike option to be a winning trade\");\n            }\n\n            // We expect the both underlying trades to be winning trades\n            var googTrades = trades.Where(t => t.Symbol == _goog.Symbol).ToList();\n            if (googTrades.Count != 2)\n            {\n                throw new RegressionTestException(\n                    $@\"AssertTradeStatistics(): Expected 2 closed trades for the underlying, one for each option assignment. Actual: {\n                        googTrades.Count}\");\n            }\n            if (googTrades.Any(x => !x.IsWin || x.ProfitLoss < 0))\n            {\n                throw new RegressionTestException(\"AssertTradeStatistics(): Expected both underlying trades to be winning trades\");\n            }\n        }\n\n        private void AssertPortfolioStatistics()\n        {\n            // First, let's check the transactions, which are used to build the portfolio statistics\n\n            // We expected 2 winning transactions (one of the options assignment and the underlying liquidation)\n            // and 1 losing transaction (the other option assignment)\n            if (Transactions.WinCount != 2)\n            {\n                throw new RegressionTestException($\"AssertPortfolioStatistics(): Expected 2 winning transactions. Actual {Transactions.WinCount}\");\n            }\n            if (Transactions.LossCount != 1)\n            {\n                throw new RegressionTestException($\"AssertPortfolioStatistics(): Expected 1 losing transaction. Actual {Transactions.LossCount}\");\n            }\n\n            var portfolioStatistics = Statistics.TotalPerformance.PortfolioStatistics;\n\n            if (portfolioStatistics.WinRate != 2m / 3m)\n            {\n                throw new RegressionTestException($\"AssertPortfolioStatistics(): Expected win rate to be 2/3. Actual {portfolioStatistics.WinRate}\");\n            }\n\n            if (portfolioStatistics.LossRate != 1m / 3m)\n            {\n                throw new RegressionTestException($\"AssertPortfolioStatistics(): Expected loss rate to be 1/3. Actual {portfolioStatistics.LossRate}\");\n            }\n\n            var expectedAverageWinRate = 0.32962000910479m;\n            if (!AreEqual(expectedAverageWinRate, portfolioStatistics.AverageWinRate))\n            {\n                throw new RegressionTestException($@\"AssertPortfolioStatistics(): Expected average win rate to be {expectedAverageWinRate}. Actual {\n                    portfolioStatistics.AverageWinRate}\");\n            }\n\n            var expectedAverageLossRate = -0.13556638257576m;\n            if (!AreEqual(expectedAverageLossRate, portfolioStatistics.AverageLossRate))\n            {\n                throw new RegressionTestException($@\"AssertPortfolioStatistics(): Expected average loss rate to be {expectedAverageLossRate}. Actual {\n                    portfolioStatistics.AverageLossRate}\");\n            }\n\n            var expectedProfitLossRatio = 2.43142881621545m;\n            if (!AreEqual(expectedProfitLossRatio, portfolioStatistics.ProfitLossRatio))\n            {\n                throw new RegressionTestException($@\"AssertPortfolioStatistics(): Expected profit loss ratio to be {expectedProfitLossRatio}. Actual {\n                    portfolioStatistics.ProfitLossRatio}\");\n            }\n\n            var totalNetProfit = -0.00697m;\n            if (!AreEqual(totalNetProfit, portfolioStatistics.TotalNetProfit))\n            {\n                throw new RegressionTestException($@\"AssertPortfolioStatistics(): Expected total net profit to be {totalNetProfit}. Actual {\n                    portfolioStatistics.TotalNetProfit}\");\n            }\n        }\n\n        private static bool AreEqual(decimal expected, decimal actual)\n        {\n            return Math.Abs(expected - actual) < 1e-12m;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4359;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"32.96%\"},\n            {\"Average Loss\", \"-13.56%\"},\n            {\"Compounding Annual Return\", \"-36.270%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"1.288\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99303\"},\n            {\"Net Profit\", \"-0.697%\"},\n            {\"Sharpe Ratio\", \"-8.675\"},\n            {\"Sortino Ratio\", \"-6.769\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.012%\"},\n            {\"Loss Rate\", \"33%\"},\n            {\"Win Rate\", \"67%\"},\n            {\"Profit-Loss Ratio\", \"2.43\"},\n            {\"Alpha\", \"-0.011\"},\n            {\"Beta\", \"0.825\"},\n            {\"Annual Standard Deviation\", \"0.02\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.705\"},\n            {\"Tracking Error\", \"0.014\"},\n            {\"Treynor Ratio\", \"-0.207\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"50.31%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"65544a2eaccc912e8c81519f5975da1a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainApisConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that the option chain APIs return consistent values.\n    /// See <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> and <see cref=\"QCAlgorithm.OptionChainProvider\"/>\n    /// </summary>\n    public class OptionChainApisConsistencyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual DateTime TestDate => new DateTime(2015, 12, 25);\n\n        public override void Initialize()\n        {\n            SetStartDate(TestDate);\n            SetEndDate(TestDate);\n\n            var option = GetOption();\n\n            var optionChainFromAlgorithmApi = OptionChain(option.Symbol).Contracts.Keys.ToList();\n\n            var exchangeTime = UtcTime.ConvertFromUtc(option.Exchange.TimeZone);\n            var optionChainFromProviderApi = OptionChainProvider.GetOptionContractList(option.Symbol, exchangeTime).Order().ToList();\n\n            if (optionChainFromAlgorithmApi.Count == 0)\n            {\n                throw new RegressionTestException(\"No options in chain from algorithm API\");\n            }\n\n            if (optionChainFromProviderApi.Count == 0)\n            {\n                throw new RegressionTestException(\"No options in chain from provider API\");\n            }\n\n            if (optionChainFromAlgorithmApi.Count != optionChainFromProviderApi.Count)\n            {\n                throw new RegressionTestException($\"Expected {optionChainFromProviderApi.Count} options in chain from provider API, \" +\n                    $\"but got {optionChainFromAlgorithmApi.Count}\");\n            }\n\n            for (var i = 0; i < optionChainFromAlgorithmApi.Count; i++)\n            {\n                var symbol1 = optionChainFromAlgorithmApi[i];\n                var symbol2 = optionChainFromProviderApi[i];\n\n                if (symbol1 != symbol2)\n                {\n                    throw new RegressionTestException($\"Expected {symbol2} in chain from provider API, but got {symbol1}\");\n                }\n            }\n        }\n\n        protected virtual Option GetOption()\n        {\n            return AddOption(\"GOOG\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 2021;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public virtual AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm checks if all the option chain data coming to the algo is consistent with current securities manager state\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"filter selection\" />\n    public class OptionChainConsistencyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private readonly Symbol _optionSymbol = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Option, Market.USA);\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(10000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.IncludeWeeklys()\n                                    .Strikes(-2, +2)\n                                    .Expiration(TimeSpan.Zero, TimeSpan.FromDays(10)));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // check if data is consistent\n                    foreach (var o in chain)\n                    {\n                        if (!Securities.ContainsKey(o.Symbol))\n                        {\n                            // inconsistency found: option chains contains contract information that is not available in securities manager and not available for trading\n                            throw new RegressionTestException(\"inconsistency found: option chains contains contract \" +\n                                $\"{o.Symbol.Value} that is not available in securities manager and not available for trading\"\n                            );\n                        }\n                    }\n\n                    // trade\n                    var contract = (\n                        from optionContract in chain.OrderByDescending(x => x.Strike)\n                        where optionContract.Right == OptionRight.Call\n                        where optionContract.Expiry == Time.Date\n                        where optionContract.Strike < chain.Underlying.Price\n                        select optionContract\n                        ).Skip(2).FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                        MarketOnCloseOrder(contract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14325;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"9613\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$5000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W6NBKPFL4KO6|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"9.93%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"29e41c0e2a316485a2761c4e56189585\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> method\n    /// to get an option chain, which contains additional data besides the symbols, including prices, implied volatility and greeks.\n    /// It also shows how this data can be used to filter the contracts based on certain criteria.\n    /// </summary>\n    public class OptionChainFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var goog = AddEquity(\"GOOG\").Symbol;\n\n            _optionContract = OptionChain(goog)\n                // Get contracts expiring within 10 days, with an implied volatility greater than 0.5 and a delta less than 0.5\n                .Where(contractData => contractData.ID.Date - Time <= TimeSpan.FromDays(10) &&\n                    contractData.ImpliedVolatility > 0.5m &&\n                    contractData.Greeks.Delta < 0.5m)\n                // Get the contract with the latest expiration date\n                .OrderByDescending(x => x.ID.Date)\n                .First();\n\n            AddOptionContract(_optionContract);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(_optionContract, 1);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1057;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"210\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96041\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$209.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W6U7PD1F77AE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"85.46%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8ee1c7a1574ae0ad6f231ad0b7d15310\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainIncludeWeeklysByDefaultRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Verifies that weekly option contracts are included when no standard contracts are available.\n    /// </summary>\n    public class OptionChainIncludeWeeklysByDefaultRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Option _option;\n        private Symbol _optionSymbol;\n        private int _weeklyCount;\n        private int _totalCount;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            _option = AddOption(\"GOOG\");\n            _optionSymbol = _option.Symbol;\n\n            _option.SetFilter((optionFilter) =>\n            {\n                return optionFilter.Strikes(-8, +8).Expiration(0, 0);\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            OptionChain chain;\n            if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n            {\n                _totalCount += chain.Contracts.Count;\n                foreach (var contract in chain.Contracts.Values)\n                {\n                    if (!OptionSymbol.IsStandard(contract.Symbol))\n                    {\n                        _weeklyCount++;\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_weeklyCount == 0)\n            {\n                throw new RegressionTestException(\"No weekly contracts found\");\n            }\n            if (_totalCount != _weeklyCount)\n            {\n                throw new RegressionTestException(\"When no standard option expirations are available, the option chain must fall back to weekly contracts only\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 22702;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainProviderAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of the Option Chain Provider -- a much faster mechanism for manually specifying the option contracts you'd like to receive\n    /// data for and manually subscribing to them.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"selecting options\" />\n    /// <meta name=\"tag\" content=\"manual selection\" />\n    public class OptionChainProviderAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _equitySymbol;\n        private Symbol _optionContract = string.Empty;\n        private readonly HashSet<Symbol> _contractsAdded = new HashSet<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n            var equity = AddEquity(\"GOOG\", Resolution.Minute);\n            equity.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            _equitySymbol = equity.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio[_equitySymbol].Invested)\n            {\n                MarketOrder(_equitySymbol, 100);\n            }\n\n            if (!(Securities.ContainsKey(_optionContract) && Portfolio[_optionContract].Invested))\n            {\n                var contracts = OptionChainProvider.GetOptionContractList(_equitySymbol, slice.Time);\n                var underlyingPrice = Securities[_equitySymbol].Price;\n                // filter the out-of-money call options from the contract list which expire in 10 to 30 days from now on\n                var otmCalls = (from symbol in contracts\n                                where symbol.ID.OptionRight == OptionRight.Call\n                                where symbol.ID.StrikePrice - underlyingPrice > 0\n                                where ((symbol.ID.Date - slice.Time).TotalDays < 30 && (symbol.ID.Date - slice.Time).TotalDays > 10)\n                                select symbol);\n\n                if (otmCalls.Count() != 0)\n                {\n                    _optionContract = otmCalls.OrderBy(x => x.ID.Date)\n                                          .ThenBy(x => (x.ID.StrikePrice - underlyingPrice))\n                                          .FirstOrDefault();\n                    if (_contractsAdded.Add(_optionContract))\n                    {\n                        // use AddOptionContract() to subscribe the data for specified contract\n                        AddOptionContract(_optionContract, Resolution.Minute);\n                    }\n                }\n                else _optionContract = string.Empty;\n            }\n            if (Securities.ContainsKey(_optionContract) && !Portfolio[_optionContract].Invested)\n            {\n                MarketOrder(_optionContract, -1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 881;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99890\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$6300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W723A0UBBS5I|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"76.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"20963045be4abe2ce837a0261329462d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainSubscriptionRemovalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #3914 where the option chain subscriptions wouldn't get removed\n    /// </summary>\n    public class OptionChainSubscriptionRemovalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _optionCount;\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n\n            // this line is the key of this test it changed the behavior if the resolution used\n            // is < that Minute which is the Option resolution\n            AddEquity(\"SPY\", Resolution.Second);\n            SetUniverseSelection(new TestOptionUniverseSelectionModel(SelectOptionChainSymbols));\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _optionCount += changes.AddedSecurities.Count(security => security.Symbol.SecurityType == SecurityType.Option);\n\n            Log($\"{GetStatusLog()} CHANGES: {changes}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_optionCount != 45)\n            {\n                throw new RegressionTestException($\"Unexpected option count {_optionCount}, expected 45\");\n            }\n        }\n\n        private static IEnumerable<Symbol> SelectOptionChainSymbols(DateTime utcTime)\n        {\n            var newYorkTime = utcTime.ConvertFromUtc(TimeZones.NewYork);\n            if (newYorkTime.Date < new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"TWX\", SecurityType.Option, Market.USA, \"?TWX\");\n            }\n\n            if (newYorkTime.Date >= new DateTime(2014, 06, 06))\n            {\n                yield return QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA, \"?AAPL\");\n            }\n        }\n\n        private string GetStatusLog()\n        {\n            Plot(\"Status\", \"UniverseCount\", UniverseManager.Count);\n            Plot(\"Status\", \"SubscriptionCount\", SubscriptionManager.Subscriptions.Count());\n            Plot(\"Status\", \"ActiveSymbolsCount\", UniverseManager.ActiveSecurities.Count);\n\n            // why 50? we select 15 option contracts, which add trade/quote/openInterest = 45 + SPY & underlying trade/quote + universe subscription => 50\n            if (SubscriptionManager.Subscriptions.Count() > 50)\n            {\n                throw new RegressionTestException(\"Subscriptions aren't getting removed as expected!\");\n            }\n\n            return $\"{Time} | UniverseCount {UniverseManager.Count}. \" +\n                $\"SubscriptionCount {SubscriptionManager.Subscriptions.Count()}. \" +\n                $\"ActiveSymbols {string.Join(\",\", UniverseManager.ActiveSecurities.Keys)}\";\n        }\n\n        class TestOptionUniverseSelectionModel : OptionUniverseSelectionModel\n        {\n            public TestOptionUniverseSelectionModel(Func<DateTime, IEnumerable<Symbol>> optionChainSymbolSelector)\n                : base(TimeSpan.FromDays(1), optionChainSymbolSelector)\n            {\n            }\n\n            protected override OptionFilterUniverse Filter(OptionFilterUniverse filter)\n            {\n                return filter.StandardsOnly().BackMonth().Contracts(contracts => contracts.Take(15));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2155694;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.639\"},\n            {\"Tracking Error\", \"0.037\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainUniverseImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Asserts that Option Chain universe selection happens right away after algorithm starts and a bar of the underlying is received\n    /// </summary>\n    public class OptionChainUniverseImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        private bool _firstOnDataCallDone;\n        private int _securityChangesCallCount;\n\n        private bool _firstSelectionDone;\n        private int _selectedOptionsCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(10000);\n\n            var option = AddOption(\"GOOG\", Resolution.Minute);\n\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(universe =>\n            {\n                if (!_firstSelectionDone)\n                {\n                    _firstSelectionDone = true;\n\n                    if (universe.LocalTime.ConvertTo(option.Exchange.TimeZone, TimeZone) != StartDate)\n                    {\n                        throw new Exception(\"Option chain universe selection time was not the expected start date\");\n                    }\n\n                    if (_firstOnDataCallDone)\n                    {\n                        throw new RegressionTestException(\"Option chain universe selection time was set after OnData was called\");\n                    }\n                }\n\n                var selection = universe\n                    .IncludeWeeklys()\n                    .Strikes(-2, +2)\n                    .Expiration(TimeSpan.Zero, TimeSpan.FromDays(10));\n\n                _selectedOptionsCount = selection.Count();\n\n                return selection;\n            });\n\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!IsMarketOpen(_optionSymbol.Underlying))\n            {\n                return;\n            }\n\n            if (!_firstOnDataCallDone)\n            {\n                _firstOnDataCallDone = true;\n\n                if (!slice.ContainsKey(_optionSymbol.Underlying))\n                {\n                    throw new RegressionTestException($\"Expected to find {_optionSymbol.Underlying} in first slice\");\n                }\n\n                if (!slice.OptionChains.ContainsKey(_optionSymbol))\n                {\n                    throw new RegressionTestException($\"Expected to find {_optionSymbol} in first slice's Option Chain\");\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time} :: {changes}\");\n            _securityChangesCallCount++;\n\n            if (_securityChangesCallCount == 1)\n            {\n                // The first time, only the underlying should have been added\n                if (changes.RemovedSecurities.Count != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected securities changes on first OnSecuritiesChanged event. \" +\n                        $\"Expected no removed securities but got {changes.RemovedSecurities.Count}.\");\n                }\n\n                var addedSecuritySymbol = changes.AddedSecurities.SingleOrDefault(x => x.Symbol == _optionSymbol.Underlying).Symbol;\n                if (addedSecuritySymbol != _optionSymbol.Underlying)\n                {\n                    throw new RegressionTestException($\"Expected to find {_optionSymbol.Underlying} in first OnSecuritiesChanged event\");\n                }\n\n                var addedOptions = changes.AddedSecurities\n                    .Where(x => x.Symbol.SecurityType == SecurityType.Option && x.Symbol.Canonical == _optionSymbol)\n                    .ToList();\n                if (addedOptions.Count != _selectedOptionsCount || addedOptions.Count != changes.AddedSecurities.Count - 1)\n                {\n                    throw new RegressionTestException($\"Expected {_selectedOptionsCount} options to be added in the first OnSecuritiesChanged event, \" +\n                        $\"but found {addedOptions.Count}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_firstOnDataCallDone)\n            {\n                throw new RegressionTestException(\"OnData was never called\");\n            }\n\n            if (_securityChangesCallCount != 1)\n            {\n                throw new RegressionTestException($\"Expected OnSecuritiesChanged to be called once, but was actually called {_securityChangesCallCount} times\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14325;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainUniverseRemovalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduces GH issue #5079, where option chain universes would sometimes not get removed from the\n    /// UniverseManager causing new universes not to get added\n    /// </summary>\n    public class OptionChainUniverseRemovalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n        private int _optionCount;\n        private Symbol _lastEquityAdded;\n        private Symbol _aapl;\n        private int _onSecuritiesChangedCallCount;\n\n        public override void Initialize()\n        {\n            _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 10);\n\n            var toggle = true;\n            var selectionUniverse = AddUniverse(enumerable =>\n            {\n                if (toggle)\n                {\n                    toggle = false;\n                    return new []{ _aapl };\n                }\n                toggle = true;\n                return Enumerable.Empty<Symbol>();\n            });\n\n            AddUniverseOptions(selectionUniverse, universe =>\n            {\n                if (universe.Underlying == null)\n                {\n                    throw new RegressionTestException(\"Underlying data point is null! This shouldn't happen, each OptionChainUniverse handles and should provide this\");\n                }\n                return universe.IncludeWeeklys()\n                    .BackMonth() // back month so that they don't get removed because of being delisted\n                    .Contracts(contracts => contracts.Take(5));\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None ||\n                _changes.AddedSecurities.Any(security => security.Price == 0))\n            {\n                return;\n            }\n\n            Debug(GetStatusLog());\n\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (!security.Symbol.HasUnderlying)\n                {\n                    _lastEquityAdded = security.Symbol;\n                }\n                else\n                {\n                    // options added should all match prev added security\n                    if (security.Symbol.Underlying != _lastEquityAdded)\n                    {\n                        throw new RegressionTestException($\"Unexpected symbol added {security.Symbol}\");\n                    }\n\n                    _optionCount++;\n                }\n            }\n            _changes = SecurityChanges.None;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{GetStatusLog()}. CHANGES {changes}\");\n            _onSecuritiesChangedCallCount++;\n            if (Time.Day == 6)\n            {\n                if (Time.Hour != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected SecurityChanges time: {Time} {changes}\");\n                }\n\n                if (changes.RemovedSecurities.Count != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected removals: {changes}\");\n                }\n\n                if (_onSecuritiesChangedCallCount == 1)\n                {\n                    // first we expect the equity to get Added\n                    if (changes.AddedSecurities.Count != 1 || changes.AddedSecurities[0].Symbol != _aapl)\n                    {\n                        throw new RegressionTestException($\"Unexpected SecurityChanges: {changes}\");\n                    }\n                }\n                else\n                {\n                    // later we expect the options to be Added\n                    if (changes.AddedSecurities.Count != 5 || changes.AddedSecurities.Any(security => security.Symbol.SecurityType != SecurityType.Option))\n                    {\n                        throw new RegressionTestException($\"Unexpected SecurityChanges: {changes}\");\n                    }\n                }\n            }\n            // We expect the equity to get Removed\n            else if (Time.Day == 7)\n            {\n                if (Time.Hour != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected SecurityChanges time: {Time} {changes}\");\n                }\n\n                // Options can be selected/deselected on this day, but the equity should be removed\n\n                if (changes.RemovedSecurities.Count == 0 || !changes.RemovedSecurities.Any(x => x.Symbol == _aapl))\n                {\n                    throw new RegressionTestException($\"Unexpected SecurityChanges: {changes}\");\n                }\n            }\n            // We expect the options to get Removed, happens in the next loop after removing the equity\n            else if (Time.Day == 9)\n            {\n                if (Time.Hour != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected SecurityChanges time: {Time} {changes}\");\n                }\n\n                // later we expect the options to be Removed\n                if (changes.RemovedSecurities.Count != 6\n                    // the removal of the raw underlying subscription from the option chain universe\n                    || changes.RemovedSecurities.Single(security => security.Symbol.SecurityType != SecurityType.Option).Symbol != _aapl\n                    // the removal of the 5 option contracts\n                    || changes.RemovedSecurities.Count(security => security.Symbol.SecurityType == SecurityType.Option) != 5)\n                {\n                    throw new RegressionTestException($\"Unexpected SecurityChanges: {changes}\");\n                }\n            }\n\n            _changes += changes;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_optionCount == 0)\n            {\n                throw new RegressionTestException(\"Option universe chain did not add any option!\");\n            }\n            if (UniverseManager.Any(pair => pair.Value.DisposeRequested))\n            {\n                throw new RegressionTestException(\"There shouldn't be any disposed universe, they should be removed and replaced by new universes\");\n            }\n        }\n\n        private string GetStatusLog()\n        {\n            Plot(\"Status\", \"UniverseCount\", UniverseManager.Count);\n            Plot(\"Status\", \"SubscriptionCount\", SubscriptionManager.Subscriptions.Count());\n            Plot(\"Status\", \"ActiveSymbolsCount\", UniverseManager.ActiveSecurities.Count);\n\n            return $\"{Time} | UniverseCount {UniverseManager.Count}. \" +\n                $\"SubscriptionCount {SubscriptionManager.Subscriptions.Count()}. \" +\n                $\"ActiveSymbols {string.Join(\",\", UniverseManager.ActiveSecurities.Keys)}\";\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17966;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.522\"},\n            {\"Tracking Error\", \"0.006\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainedAndUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm making sure that the added universe selection does not remove the option chain during it's daily refresh\n    /// </summary>\n    public class OptionChainedAndUniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aaplOption;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n\n            var option = AddOption(\"AAPL\");\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, 1).Expiration(0, 35));\n            _aaplOption = option.Symbol;\n            AddUniverseSelection(new DailyUniverseSelectionModel(\"MyCustomSelectionModel\", time => new[] { \"AAPL\" }, this));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                Buy(\"AAPL\", 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var config = SubscriptionManager.Subscriptions.ToList();\n            if (config.All(dataConfig => dataConfig.Symbol != \"AAPL\"))\n            {\n                throw new RegressionTestException(\"Was expecting configurations for AAPL\");\n            }\n            if (config.All(dataConfig => dataConfig.Symbol.SecurityType != SecurityType.Option))\n            {\n                throw new RegressionTestException($\"Was expecting configurations for {_aaplOption}\");\n            }\n        }\n\n        private class DailyUniverseSelectionModel : CustomUniverseSelectionModel\n        {\n            private DateTime _lastRefresh;\n            private IAlgorithm _algorithm;\n\n            public DailyUniverseSelectionModel(string name, Func<DateTime, IEnumerable<string>> selector, IAlgorithm algorithm) : base(name, selector)\n            {\n                _algorithm = algorithm;\n            }\n\n            public override DateTime GetNextRefreshTimeUtc()\n            {\n                if (_lastRefresh != _algorithm.Time.Date)\n                {\n                    _lastRefresh = _algorithm.Time.Date;\n                    return DateTime.MinValue;\n                }\n                return DateTime.MaxValue;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19701;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.524%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100007.16\"},\n            {\"Net Profit\", \"0.007%\"},\n            {\"Sharpe Ratio\", \"-3.983\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"79.393%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0\"},\n            {\"Beta\", \"-0.007\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.436\"},\n            {\"Tracking Error\", \"0.037\"},\n            {\"Treynor Ratio\", \"0.431\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$4200000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"87f55de4577d35a6ff70a7fd335e14a4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test the OptionChainedUniverseSelectionModel class\n    /// </summary>\n    public class OptionChainedUniverseSelectionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 6);\n            SetCash(100000);\n\n            var universe = AddUniverse(\"my-minute-universe-name\", time => new List<string> { \"AAPL\", \"TWX\" });\n\n            AddUniverseSelection(new OptionChainedUniverseSelectionModel(universe, u => u.StandardsOnly().Strikes(-2, +2)\n                                   // Expiration method accepts TimeSpan objects or integer for days.\n                                   // The following statements yield the same filtering criteria\n                                   .Expiration(0, 180)));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsMarketOpen(\"AAPL\") && IsMarketOpen(\"TWX\"))\n            {\n                var values = slice.OptionChains.Where(x => (x.Key == \"?AAPL\" || x.Key == \"?TWX\")).Select(x => x.Value);\n\n                foreach (var chain in values)\n                {\n                    // we find at the money (ATM) put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Right)\n                        .FirstOrDefault();\n\n                    if (atmContract != null)\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 49264;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100051\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$110000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL 2ZTXYLO9EV0AU|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"8.85%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"32f3cebb622264a2d6fd84c552ff4d0e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionChainsMultipleFullDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChains(IEnumerable{Symbol})\"/> method\n    /// to get multiple option chains, which contains additional data besides the symbols, including prices, implied volatility and greeks.\n    /// It also shows how this data can be used to filter the contracts based on certain criteria.\n    /// </summary>\n    public class OptionChainsMultipleFullDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _googOptionContract;\n        private Symbol _spxOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var goog = AddEquity(\"GOOG\").Symbol;\n            var spx = AddIndex(\"SPX\").Symbol;\n\n            var chains = OptionChains(new[] { goog, spx });\n\n            _googOptionContract = GetContract(chains, goog, TimeSpan.FromDays(10));\n            _spxOptionContract = GetContract(chains, spx, TimeSpan.FromDays(60));\n\n            AddOptionContract(_googOptionContract);\n            AddIndexOptionContract(_spxOptionContract);\n        }\n\n        private Symbol GetContract(OptionChains chains, Symbol underlying, TimeSpan expirySpan)\n        {\n            return chains\n                .Where(kvp => kvp.Key.Underlying == underlying)\n                .Select(kvp => kvp.Value)\n                .Single()\n                // Get contracts expiring within a given span, with an implied volatility greater than 0.5 and a delta less than 0.5\n                .Where(contractData => contractData.ID.Date - Time <= expirySpan &&\n                    contractData.ImpliedVolatility > 0.5m &&\n                    contractData.Greeks.Delta < 0.5m)\n                // Get the contract with the latest expiration date\n                .OrderByDescending(x => x.ID.Date)\n                .First();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Do some trading with the selected contract for sample purposes\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(_googOptionContract, 1);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1059;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 2;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"210\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96041\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$209.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W6U7PD1F77AE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"85.46%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8ee1c7a1574ae0ad6f231ad0b7d15310\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionDataNullReferenceRegressionAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm is a regression test for issue #2018 and PR #2038.\n    /// </summary>\n    public class OptionDataNullReferenceRegressionAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2016, 12, 1);\n            SetEndDate(2017, 1, 1);\n            SetCash(500000);\n\n            AddEquity(\"DUST\");\n\n            var option = AddOption(\"DUST\");\n\n            option.SetFilter(u => u.IncludeWeeklys()\n                                   .Strikes(-1, +1)\n                                   .Expiration(TimeSpan.FromDays(25), TimeSpan.FromDays(100)));\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionDelistedDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class OptionDelistedDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private readonly List<Symbol> _delisted = new List<Symbol>();\n        private readonly List<Symbol> _toBeDelisted = new List<Symbol>();\n        private bool _executed;\n        public override void Initialize()\n        {\n            SetStartDate(2016, 01, 15);  //Set Start Date\n            SetEndDate(2016, 01, 19);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            AddOption(UnderlyingTicker);\n        }\n\n        public override void OnData(Slice data)\n        {\n            _executed = true;\n            if (Time.Minute == 0)\n            {\n                foreach (var d in data)\n                {\n                    if (_delisted.Contains(d.Key))\n                    {\n                        throw new RegressionTestException(\"We shouldn't be recieving data from an already delisted symbol\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_executed)\n            {\n                Debug(\"CUSTOM OnEndOfAlgorithm\");\n                if (_delisted.Count != 20)\n                {\n                    throw new RegressionTestException(\"Expecting exactly 20 delisted events\");\n                }\n                if (_toBeDelisted.Count != 20)\n                {\n                    throw new RegressionTestException(\"Expecting exactly 20 to be delisted warning events\");\n                }\n            }\n            base.OnEndOfAlgorithm();\n        }\n\n        public void OnData(Delistings data)\n        {\n            foreach (var kvp in data)\n            {\n                var symbol = kvp.Key;\n                var delisting = kvp.Value;\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    _toBeDelisted.Add(symbol);\n                    Debug($\"OnData(Delistings): {Time}: {symbol} will be delisted at end of day today.\");\n                }\n                if (delisting.Type == DelistingType.Delisted)\n                {\n                    _delisted.Add(symbol);\n                    Debug($\"OnData(Delistings): {Time}: {symbol} has been delisted.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 22;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.25\"},\n            {\"Tracking Error\", \"0.01\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for equity option strategy regression algorithms which holds some basic shared setup logic\n    /// </summary>\n    public abstract class OptionEquityBaseStrategyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected decimal _paidFees { get; set; }\n        protected Symbol _optionSymbol { get; set; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(200000);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                                   // Expiration method accepts TimeSpan objects or integer for days.\n                                   // The following statements yield the same filtering criteria\n                                   .Expiration(0, 180));\n        }\n\n        protected void AssertOptionStrategyIsPresent(string name, int? quantity = null)\n        {\n            if (Portfolio.Positions.Groups.Where(group => group.BuyingPowerModel is OptionStrategyPositionGroupBuyingPowerModel)\n                .Count(group => ((OptionStrategyPositionGroupBuyingPowerModel)@group.BuyingPowerModel).ToString() == name\n                    && (!quantity.HasValue || Math.Abs(group.Quantity) == quantity)) != 1)\n            {\n                throw new RegressionTestException($\"Option strategy: '{name}' was not found!\");\n            }\n        }\n\n        protected void AssertDefaultGroup(Symbol symbol, decimal quantity)\n        {\n            if (Portfolio.Positions.Groups.Where(group => group.BuyingPowerModel is SecurityPositionGroupBuyingPowerModel)\n                .Count(group => group.Positions.Any(position => position.Symbol == symbol && position.Quantity == quantity)) != 1)\n            {\n                throw new RegressionTestException($\"Default groupd for symbol '{symbol}' and quantity '{quantity}' was not found!\");\n            }\n        }\n\n        protected decimal GetPriceSpreadDifference(params Symbol[] symbols)\n        {\n            var spreadPaid = 0m;\n            foreach (var symbol in symbols)\n            {\n                var security = Securities[symbol];\n                var actualQuantity = security.Holdings.AbsoluteQuantity;\n                var spread = 0m;\n                if (security.Holdings.IsLong)\n                {\n                    if (security.AskPrice != 0)\n                    {\n                        spread = security.Price - security.Holdings.AveragePrice;\n                    }\n                }\n                else if (security.BidPrice != 0)\n                {\n                    spread = security.Holdings.AveragePrice - security.Price;\n                }\n                spreadPaid += spread * actualQuantity * security.SymbolProperties.ContractMultiplier;\n            }\n\n            return spreadPaid;\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                _paidFees += orderEvent.OrderFee.Value.Amount;\n                if (orderEvent.Symbol.SecurityType.IsOption())\n                {\n                    var security = Securities[orderEvent.Symbol];\n                    var premiumPaid = orderEvent.Quantity * orderEvent.FillPrice * security.SymbolProperties.ContractMultiplier;\n                    Log($\"{orderEvent}. Premium paid: {premiumPaid}\");\n                    return;\n                }\n            }\n            Log($\"{orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bear Call Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBearCallLadderRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call);\n                    var expiry = callContracts.Min(x => x.Expiry);\n                    callContracts = callContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = callContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 3) return;\n\n                    var lowStrikeCall = callContracts.First(contract => contract.Strike == callContracts.Min(x => x.Strike));\n                    var midStrikeCall = callContracts.First(contract => contract.Strike > lowStrikeCall.Strike && contract.Expiry == lowStrikeCall.Expiry);\n                    var highStrikeCall = callContracts.First(contract => contract.Strike > midStrikeCall.Strike && contract.Expiry == lowStrikeCall.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(lowStrikeCall.Symbol, -5);\n                    MarketOrder(midStrikeCall.Symbol, 5);\n                    MarketOrder(highStrikeCall.Symbol, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearCallLadder.Name, 5);\n\n                    var expectedMarginUsage = (midStrikeCall.Strike - lowStrikeCall.Strike) * Securities[lowStrikeCall.Symbol].SymbolProperties.ContractMultiplier * 5;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikeCall.Symbol, midStrikeCall.Symbol, highStrikeCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198540.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$47000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.48%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a573795b3fb76288c1e8b71b1f2bc928\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bear Call Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBearCallSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var shortCall = callContracts.First();\n                    var longCall = callContracts.First(contract => contract.Strike > shortCall.Strike && contract.Expiry == shortCall.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(shortCall.Symbol, -5);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n\n                    MarketOrder(longCall.Symbol, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearCallSpread.Name, 5);\n\n                    var expectedMarginUsage = (longCall.Strike - shortCall.Strike) * Securities[longCall.Symbol].SymbolProperties.ContractMultiplier * 5;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(longCall.Symbol, shortCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"200093.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$6.50\"},\n            {\"Estimated Strategy Capacity\", \"$5400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM95TALCX2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"28.44%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d5354d8376960b0b11a80bc1a164a6a3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBearCallSpreadSetHoldingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bear Call Spread option strategy using SetHoldings and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    /// <remarks>SetHoldings percentage calculation is using the default position group so it fails to determine the correct value,\n    /// either way Lean has to detect the option strategy been executed and margin used has to get reduced</remarks>\n    public class OptionEquityBearCallSpreadSetHoldingsRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetCash(1000000);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var shortCall = callContracts.First();\n                    var longCall = callContracts.First(contract => contract.Strike > shortCall.Strike && contract.Expiry == shortCall.Expiry);\n\n                    SetHoldings(shortCall.Symbol, -0.05m);\n                    var freeMargin = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name,\n                        (int)Math.Abs(Securities[shortCall.Symbol].Holdings.Quantity));\n\n                    SetHoldings(longCall.Symbol, +0.05m);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearCallSpread.Name);\n\n                    if (freeMargin >= freeMarginPostTrade)\n                    {\n                        throw new RegressionTestException(\"We expect the margin used to actually be lower once we perform the second trade\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"998807.85\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$7.15\"},\n            {\"Estimated Strategy Capacity\", \"$45000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM95TALCX2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"6.17%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"735ec0801dd3dcf9e03eaf3b67931910\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bear Put Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBearPutLadderRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put);\n                    var expiry = putContracts.Min(x => x.Expiry);\n                    putContracts = putContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = putContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 3) return;\n\n                    var lowStrikePut = putContracts.First();\n                    var midStrikePut = putContracts.First(contract => contract.Strike > lowStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n                    var highStrikePut = putContracts.First(contract => contract.Strike > midStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(highStrikePut.Symbol, 5);\n                    MarketOrder(midStrikePut.Symbol, -5);\n                    MarketOrder(lowStrikePut.Symbol, -5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearPutLadder.Name, 5);\n\n                    var putSecurity = (Option)Securities[lowStrikePut.Symbol];\n                    var undPrice = chain.Underlying.Price;\n                    var expectedMarginUsage = 78884m;\n\n                    if (expectedMarginUsage > Portfolio.TotalMarginUsed + 1e-8m || expectedMarginUsage < Portfolio.TotalMarginUsed - 1e-8m)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikePut.Symbol, midStrikePut.Symbol, highStrikePut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198940.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$1100000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"9.45%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"344a4a84239e83eda686ea21d086b6fd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bear Put Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBearPutSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var longPut = putContracts.Last();\n                    var shortPut = putContracts.First(contract => contract.Strike < longPut.Strike && contract.Expiry == longPut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(shortPut.Symbol, -10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 10);\n                    MarketOrder(longPut.Symbol, 10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearPutSpread.Name, 10);\n\n                    var expectedMarginUsage = Math.Max((shortPut.Strike - longPut.Strike) * Securities[longPut.Symbol].SymbolProperties.ContractMultiplier * 10, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(longPut.Symbol, shortPut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198787\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZK7GI2ZL2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"13.43%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0d10d7319b27523377bb53bbd9702552\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Box Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBoxSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var buySidePut = contracts.First(contract => contract.Right == OptionRight.Put);\n\n                    var sellSidePut = contracts.Last(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike > buySidePut.Strike);\n\n                    var buySideCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike == buySidePut.Strike);\n\n                    var sellSideCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike == sellSidePut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(buySideCall.Symbol, +10);\n                    MarketOrder(buySidePut.Symbol, -10);\n\n                    MarketOrder(sellSideCall.Symbol, -10);\n                    MarketOrder(sellSidePut.Symbol, +10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BoxSpread.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0m;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(buySidePut.Symbol, buySideCall.Symbol,\n                        sellSidePut.Symbol, sellSideCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197624\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$64000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"27.98%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"153196ec52843cf95d979e14d18b98b5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bull Call Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBullCallLadderRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call);\n                    var expiry = callContracts.Min(x => x.Expiry);\n                    callContracts = callContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = callContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 3) return;\n\n                    var lowStrikeCall = callContracts.First();\n                    var midStrikeCall = callContracts.First(contract => contract.Strike > lowStrikeCall.Strike && contract.Expiry == lowStrikeCall.Expiry);\n                    var highStrikeCall = callContracts.First(contract => contract.Strike > midStrikeCall.Strike && contract.Expiry == lowStrikeCall.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(lowStrikeCall.Symbol, 5);\n                    MarketOrder(midStrikeCall.Symbol, -5);\n                    MarketOrder(highStrikeCall.Symbol, -5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallLadder.Name, 5);\n\n                    var callSecurity = (Option)Securities[highStrikeCall.Symbol];\n                    var undPrice = chain.Underlying.Price;\n                    var expectedMarginUsage = 80899m;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception($\"Unexpect margin used!:{Portfolio.TotalMarginUsed}\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikeCall.Symbol, midStrikeCall.Symbol, highStrikeCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199790.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$51000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.09%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9412b7091b1e677c662a6bd8acc688a7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bull Call Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBullCallSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var longCall = callContracts.First();\n                    var shortCall = callContracts.First(contract => contract.Strike > longCall.Strike && contract.Expiry == longCall.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(shortCall.Symbol, -5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n                    MarketOrder(longCall.Symbol, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallSpread.Name, 5);\n\n                    var expectedMarginUsage = Math.Max((longCall.Strike - shortCall.Strike) * Securities[longCall.Symbol].SymbolProperties.ContractMultiplier * 5, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(longCall.Symbol, shortCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199145.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.50\"},\n            {\"Estimated Strategy Capacity\", \"$5400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM95TALCX2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"28.20%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8e7710ac4b8287b4746beddbc5ce9611\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bull Put Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBullPutLadderRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put);\n                    var expiry = putContracts.Min(x => x.Expiry);\n                    putContracts = putContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = putContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 3) return;\n\n                    var lowStrikePut = putContracts.First();\n                    var midStrikePut = putContracts.First(contract => contract.Strike > lowStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n                    var highStrikePut = putContracts.First(contract => contract.Strike > midStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(highStrikePut.Symbol, -5);\n                    MarketOrder(midStrikePut.Symbol, 5);\n                    MarketOrder(lowStrikePut.Symbol, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullPutLadder.Name, 5);\n\n                    var expectedMarginUsage = (highStrikePut.Strike - midStrikePut.Strike) * Securities[highStrikePut.Symbol].SymbolProperties.ContractMultiplier * 5;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikePut.Symbol, midStrikePut.Symbol, highStrikePut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199290.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$1400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"9.76%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c94aea4f3f3af337890d430a47a078e2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityBullPutSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Bull Put Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityBullPutSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put)\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var shortPut = putContracts.Last();\n                    var longPut = putContracts.First(contract => contract.Strike < shortPut.Strike && contract.Expiry == shortPut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(shortPut.Symbol, -10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 10);\n                    MarketOrder(longPut.Symbol, 10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullPutSpread.Name, 10);\n\n                    var expectedMarginUsage = Math.Max((shortPut.Strike - longPut.Strike) * Securities[longPut.Symbol].SymbolProperties.ContractMultiplier * 10, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(longPut.Symbol, shortPut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198887\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$2300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZK7GI2ZL2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"13.47%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"674e63d3d499cc9b6c3be48c92786536\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityCallBackspreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Long Call Backspread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityCallBackspreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call);\n                    var expiry = callContracts.Min(x => x.Expiry);\n                    callContracts = callContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = callContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 2) return;\n\n                    var lowStrikeCall = callContracts.First();\n                    var highStrikeCall = callContracts.First(contract => contract.Strike > lowStrikeCall.Strike && contract.Expiry == expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    var optionStrategy = OptionStrategies.CallBackspread(_optionSymbol, lowStrikeCall.Strike, highStrikeCall.Strike, expiry);\n                    Buy(optionStrategy, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    // It is a combination of bear call spread and long call\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearCallSpread.Name, 5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n\n                    // Should only involve the bear call spread part\n                    var expectedMarginUsage = (highStrikeCall.Strike - lowStrikeCall.Strike) * Securities[highStrikeCall.Symbol].SymbolProperties.ContractMultiplier * 5;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception($\"Unexpect margin used!:{Portfolio.TotalMarginUsed}\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikeCall.Symbol, highStrikeCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198565.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$47000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.81%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d6c330a7840e7294bfa1bc6572d418bd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Call Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityCallButterflyRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var distanceBetweenStrikes = 2.5m;\n                    var lowerCall = contracts.First();\n                    var middleCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == lowerCall.Strike + distanceBetweenStrikes);\n                    var highestCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == middleCall.Strike + distanceBetweenStrikes);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(lowerCall.Symbol, 10);\n                    MarketOrder(middleCall.Symbol, -20);\n                    MarketOrder(highestCall.Symbol, 10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(lowerCall.Symbol, middleCall.Symbol, highestCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198024\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$69000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"30.35%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1f9515dab3cf62b5e1d9026a2d27a994\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Call Calendar Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityCallCalendarSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .OrderBy(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var shortCall = contracts.First();\n                    var longCall = contracts.First(contract => contract.Expiry > shortCall.Expiry && contract.Strike == shortCall.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(shortCall.Symbol, -10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 10);\n                    MarketOrder(longCall.Symbol, +10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CallCalendarSpread.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(shortCall.Symbol, longCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199287\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$23000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"26.19%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2c84b684c855e060a2dced86497181e0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Conversion option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityConversionRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var call = contracts.Last(contract => contract.Right == OptionRight.Call);\n                    var put = contracts.Single(contract => contract.Right == OptionRight.Put && contract.Expiry == call.Expiry\n                        && contract.Strike == call.Strike);\n                    var underlying = call.Symbol.Underlying;\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(underlying, 100);\n                    MarketOrder(call.Symbol, -1);\n                    MarketOrder(put.Symbol, 1);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Conversion.Name, 1);\n\n                    var callInTheMoneyAmount = ((Option)Securities[call.Symbol]).GetIntrinsicValue(Securities[underlying].Price);\n                    var expectedMarginUsage = (callInTheMoneyAmount + 0.1m * call.Strike) * 100;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(call.Symbol, put.Symbol, underlying);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199859\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$1600000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"38.88%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"af86d222380d975e533a88b92b16f280\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityCoveredCallRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Covered Call option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityCoveredCallRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) call contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .Where(contract => contract.Right == OptionRight.Call && chain.Underlying.Price < contract.Strike)\n                        .OrderBy(x => x.Strike)\n                        .First();\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    // covered call\n                    MarketOrder(atmContract.Symbol, -5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n                    MarketOrder(atmContract.Symbol.Underlying, 500);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CoveredCall.Name, 5);\n\n                    var underlyingMarginRequirements = Securities[atmContract.Symbol.Underlying].BuyingPowerModel\n                        .GetInitialMarginRequirement(new InitialMarginParameters(Securities[atmContract.Symbol.Underlying], 500));\n\n                    var expectedMarginUsage = underlyingMarginRequirements;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(atmContract.Symbol, atmContract.Symbol.Underlying);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199479.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.75\"},\n            {\"Estimated Strategy Capacity\", \"$1100000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"201.44%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7bbdaa6bb6a8e92177dbab76992cfea6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityCoveredPutRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Covered Put option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityCoveredPutRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) Put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .Where(contract => contract.Right == OptionRight.Put && chain.Underlying.Price > contract.Strike)\n                        .OrderBy(x => x.Strike)\n                        .First();\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    // covered put\n                    MarketOrder(atmContract.Symbol, -10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 10);\n                    MarketOrder(atmContract.Symbol.Underlying, -1000);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CoveredPut.Name, 10);\n\n                    var underlyingMarginRequirements = Securities[atmContract.Symbol.Underlying].BuyingPowerModel\n                        .GetInitialMarginRequirement(new InitialMarginParameters(Securities[atmContract.Symbol.Underlying], -1000));\n                    var inTheMoneyAmount = 0;\n                    var expectedMarginUsage = inTheMoneyAmount + Math.Abs(underlyingMarginRequirements.Value);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(atmContract.Symbol, atmContract.Symbol.Underlying);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199628.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$11.50\"},\n            {\"Estimated Strategy Capacity\", \"$550000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"399.81%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"89db7ece35155c62319cbbb810d9a58e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Iron Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityIronButterflyRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var outOfTheMoneyPut = contracts.Where(contract => contract.Right == OptionRight.Put)\n                        .OrderBy(contract => contract.Strike)\n                        .Skip(1)\n                        .First();\n\n                    var atTheMoneyPut = contracts.OrderBy(contract => Math.Abs(contract.Strike - chain.Underlying.Price))\n                        .First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == outOfTheMoneyPut.Expiry);\n\n                    var atTheMoneyCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == outOfTheMoneyPut.Expiry\n                        && contract.Strike == atTheMoneyPut.Strike);\n\n                    var outOfTheMoneyCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == outOfTheMoneyPut.Expiry\n                        && contract.Strike == atTheMoneyPut.Strike * 2 - outOfTheMoneyPut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(outOfTheMoneyPut.Symbol, +10);\n                    MarketOrder(atTheMoneyPut.Symbol, -10);\n\n                    MarketOrder(atTheMoneyCall.Symbol, -10);\n                    MarketOrder(outOfTheMoneyCall.Symbol, +10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.IronButterfly.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = (atTheMoneyPut.Strike - outOfTheMoneyPut.Strike) * Securities[atTheMoneyPut.Symbol].SymbolProperties.ContractMultiplier * 10;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(outOfTheMoneyPut.Symbol, atTheMoneyPut.Symbol,\n                        atTheMoneyCall.Symbol, outOfTheMoneyCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198074\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$500000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"26.45%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"cbf6f38a1ad909fa68c926edaae45f7a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Iron Condor option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityIronCondorRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var oufOfTheMoneyPut = contracts.First(contract => contract.Right == OptionRight.Put);\n\n                    var lessOufOfTheMoneyPut = contracts.First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > oufOfTheMoneyPut.Strike);\n\n                    var oufOfTheMoneyCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > chain.Underlying.Price);\n\n                    var moreOufOfTheMoneyCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > oufOfTheMoneyCall.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(oufOfTheMoneyPut.Symbol, +10);\n                    MarketOrder(lessOufOfTheMoneyPut.Symbol, -10);\n\n                    MarketOrder(oufOfTheMoneyCall.Symbol, -10);\n                    MarketOrder(moreOufOfTheMoneyCall.Symbol, +10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.IronCondor.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = (lessOufOfTheMoneyPut.Strike - oufOfTheMoneyPut.Strike) * Securities[lessOufOfTheMoneyPut.Symbol].SymbolProperties.ContractMultiplier * 10; ;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(oufOfTheMoneyPut.Symbol, lessOufOfTheMoneyPut.Symbol,\n                        oufOfTheMoneyCall.Symbol, moreOufOfTheMoneyCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197524\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$480000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"25.26%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"21935ddaaa9549064bbeeca2cd7ba4ac\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Jelly Roll option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityJellyRollRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Strike)\n                        .First()\n                        .OrderBy(x => x.Expiry)\n                        .ToList();\n\n                    var nearPut = contracts.First(contract => contract.Right == OptionRight.Put);\n\n                    var farPut = contracts.First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry > nearPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var nearCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == nearPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var farCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == farPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(nearPut.Symbol, +1);\n                    MarketOrder(nearCall.Symbol, -1);\n\n                    MarketOrder(farPut.Symbol, -1);\n                    MarketOrder(farCall.Symbol, +1);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.JellyRoll.Name, 1);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var undPrice = farPut.UnderlyingLastPrice;\n                    var expectedMarginUsage = 17646.8m;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(nearPut.Symbol, nearCall.Symbol, farPut.Symbol, farCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199731\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$180000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.70%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b3857d494d146a638a8e70d313d0e724\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityProtectiveCollarRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Protective Collar option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityProtectiveCollarRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var call = contracts.Last(contract => contract.Right == OptionRight.Call);\n                    var put = contracts.First(contract => contract.Right == OptionRight.Put && contract.Expiry == call.Expiry\n                        && contract.Strike < call.Strike);\n                    var underlying = call.Symbol.Underlying;\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(underlying, 100);\n                    MarketOrder(call.Symbol, -1);\n                    MarketOrder(put.Symbol, 1);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ProtectiveCollar.Name, 1);\n\n                    var putOutOfTheMoneyAmount = ((Option)Securities[put.Symbol]).OutOfTheMoneyAmount(Securities[underlying].Price);\n                    var expectedMarginUsage = Math.Min(putOutOfTheMoneyAmount + 0.1m * put.Strike, 0.25m * call.Strike) * 100;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(call.Symbol, put.Symbol, underlying);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199859\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$1600000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"38.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"531dca5eb401dc71132dbdfeec71a4f2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityPutBackspreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Long Put Backspread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityPutBackspreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put);\n                    var expiry = putContracts.Min(x => x.Expiry);\n                    putContracts = putContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = putContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 2) return;\n\n                    var lowStrikePut = putContracts.First();\n                    var highStrikePut = putContracts.First(contract => contract.Strike > lowStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    var optionStrategy = OptionStrategies.PutBackspread(_optionSymbol, highStrikePut.Strike, lowStrikePut.Strike, expiry);\n                    Buy(optionStrategy, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    // It is a combination of bull put spread and long put\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullPutSpread.Name, 5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 5);\n\n                    // Should only involve the bull put spread part\n                    var expectedMarginUsage = (highStrikePut.Strike - lowStrikePut.Strike) * Securities[highStrikePut.Symbol].SymbolProperties.ContractMultiplier * 5;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikePut.Symbol, highStrikePut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199015.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$1100000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"9.15%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7da2977580a65c43f696a3e013fb8035\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Put Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityPutButterflyRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put)\n                        .GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var distanceBetweenStrikes = 2.5m;\n                    var lowerPut = contracts.First();\n                    var middlePut = contracts.First(contract => contract.Expiry == lowerPut.Expiry && contract.Strike == lowerPut.Strike + distanceBetweenStrikes);\n                    var highestPut = contracts.First(contract => contract.Expiry == lowerPut.Expiry && contract.Strike == middlePut.Strike + distanceBetweenStrikes);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(lowerPut.Symbol, 10);\n                    MarketOrder(middlePut.Symbol, -20);\n                    MarketOrder(highestPut.Symbol, 10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyPut.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(lowerPut.Symbol, middlePut.Symbol, highestPut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197124\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$280000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"25.77%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e4d100d6e96ad81660b800f09267a623\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityPutCalendarSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Put Calendar Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityPutCalendarSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put)\n                        .OrderBy(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var shortPut = contracts.First();\n                    var longPut = contracts.First(contract => contract.Expiry > shortPut.Expiry && contract.Strike == shortPut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    MarketOrder(shortPut.Symbol, -10);\n                    MarketOrder(longPut.Symbol, +10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.PutCalendarSpread.Name, 10);\n\n                    var expectedMarginUsage = Math.Max((shortPut.Strike - longPut.Strike) * Securities[longPut.Symbol].SymbolProperties.ContractMultiplier * 10, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(longPut.Symbol, shortPut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199137\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZK7GI2ZL2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"21.14%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"250cf48cc95b03dd9db84ab9ba18a0c4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Reverse Conversion option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityReverseConversionRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var call = contracts.Last(contract => contract.Right == OptionRight.Call);\n                    var put = contracts.Single(contract => contract.Right == OptionRight.Put && contract.Expiry == call.Expiry\n                        && contract.Strike == call.Strike);\n                    var underlying = call.Symbol.Underlying;\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(underlying, -100);\n                    MarketOrder(call.Symbol, 1);\n                    MarketOrder(put.Symbol, -1);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ReverseConversion.Name, 1);\n\n                    var putInTheMoneyAmount = ((Option)Securities[put.Symbol]).GetIntrinsicValue(Securities[underlying].Price);\n                    var expectedMarginUsage = (putInTheMoneyAmount + 0.1m * call.Strike) * 100;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(call.Symbol, put.Symbol, underlying);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199801\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$7400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"38.84%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5e0bf1da18d2ef159f3771de4bdcc4b9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Box Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortBoxSpreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var buySidePut = contracts.Last(contract => contract.Right == OptionRight.Put);\n\n                    var sellSidePut = contracts.First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike < buySidePut.Strike);\n\n                    var buySideCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike == buySidePut.Strike);\n\n                    var sellSideCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == buySidePut.Expiry\n                        && contract.Strike == sellSidePut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(buySideCall.Symbol, +10);\n                    MarketOrder(buySidePut.Symbol, -10);\n\n                    MarketOrder(sellSideCall.Symbol, -10);\n                    MarketOrder(sellSidePut.Symbol, +10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortBoxSpread.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    var commissionFees = 10m * 0.65m * 4m;\n                    var orderCosts = sellSideCall.AskPrice - buySideCall.BidPrice + buySidePut.AskPrice - sellSidePut.BidPrice;\n                    var closeCost = commissionFees + orderCosts * 1000m;\n\n                    var strikeDifference = buySideCall.Strike - sellSideCall.Strike;\n\n                    var expectedMarginUsage = Math.Max(1.02m * closeCost, strikeDifference * 1000m);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(buySidePut.Symbol, buySideCall.Symbol,\n                        sellSidePut.Symbol, sellSideCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197924\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$23000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"28.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4f1e402bd285c0ac07a5611fe4776c5f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Butterfly Call option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortButterflyCallRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var distanceBetweenStrikes = 2.5m;\n                    var lowerCall = contracts.First();\n                    var middleCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == lowerCall.Strike + distanceBetweenStrikes);\n                    var highestCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == middleCall.Strike + distanceBetweenStrikes);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(lowerCall.Symbol, -10);\n                    MarketOrder(middleCall.Symbol, 20);\n                    MarketOrder(highestCall.Symbol, -10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortButterflyCall.Name, 10);\n\n                    var expectedMarginUsage = Math.Max((middleCall.Strike - lowerCall.Strike) * Securities[lowerCall.Symbol].SymbolProperties.ContractMultiplier * 10, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(middleCall.Symbol, lowerCall.Symbol, highestCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197624\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$23000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"30.26%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3e3d9bdac468c34733ae06ddbc4db4d8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Put Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortButterflyPutRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put)\n                        .GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var distanceBetweenStrikes = 2.5m;\n                    var lowerPut = contracts.First();\n                    var middlePut = contracts.First(contract => contract.Expiry == lowerPut.Expiry && contract.Strike == lowerPut.Strike + distanceBetweenStrikes);\n                    var highestPut = contracts.First(contract => contract.Expiry == lowerPut.Expiry && contract.Strike == middlePut.Strike + distanceBetweenStrikes);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(lowerPut.Symbol, -10);\n                    MarketOrder(middlePut.Symbol, 20);\n                    MarketOrder(highestPut.Symbol, -10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortButterflyPut.Name, 10);\n\n                    var expectedMarginUsage = Math.Max((middlePut.Strike - lowerPut.Strike) * Securities[middlePut.Symbol].SymbolProperties.ContractMultiplier * 10, 0);\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(lowerPut.Symbol, middlePut.Symbol, highestPut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"198124\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$890000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"25.69%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9e1b1c3724e5981b74cb03a5c7064914\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortCallBackspreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Call Backspread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortCallBackspreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var callContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call);\n                    var expiry = callContracts.Min(x => x.Expiry);\n                    callContracts = callContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = callContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 2) return;\n\n                    var lowStrikeCall = callContracts.First();\n                    var highStrikeCall = callContracts.First(contract => contract.Strike > lowStrikeCall.Strike && contract.Expiry == lowStrikeCall.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    var optionStrategy = OptionStrategies.ShortCallBackspread(_optionSymbol, lowStrikeCall.Strike, highStrikeCall.Strike, expiry);\n                    Buy(optionStrategy, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    // It is a combination of bull call spread and naked call\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallSpread.Name, 5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n\n                    // Should only involve the naked call part\n                    var security = Securities[highStrikeCall.Symbol];\n                    var expectedMarginUsage = security.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(security, -5)).Value;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikeCall.Symbol, highStrikeCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199915.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$53000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.48%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8174f45d8e7ca380e7e064cecaf3124d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Iron Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortIronButterflyRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var outOfTheMoneyPut = contracts.Where(contract => contract.Right == OptionRight.Put)\n                        .OrderBy(contract => contract.Strike)\n                        .Skip(1)\n                        .First();\n\n                    var atTheMoneyPut = contracts.OrderBy(contract => Math.Abs(contract.Strike - chain.Underlying.Price))\n                        .First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == outOfTheMoneyPut.Expiry);\n\n                    var atTheMoneyCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == outOfTheMoneyPut.Expiry\n                        && contract.Strike == atTheMoneyPut.Strike);\n\n                    var outOfTheMoneyCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == outOfTheMoneyPut.Expiry\n                        && contract.Strike == atTheMoneyPut.Strike * 2 - outOfTheMoneyPut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(outOfTheMoneyPut.Symbol, -10);\n                    MarketOrder(atTheMoneyPut.Symbol, +10);\n\n                    MarketOrder(atTheMoneyCall.Symbol, +10);\n                    MarketOrder(outOfTheMoneyCall.Symbol, -10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortIronButterfly.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(outOfTheMoneyPut.Symbol, atTheMoneyPut.Symbol,\n                        atTheMoneyCall.Symbol, outOfTheMoneyCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197174\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$150000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"26.63%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"782c4d80f0d098b0a6dccfe54aa74e23\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortIronCondorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Iron Condor option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortIronCondorRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var oufOfTheMoneyPut = contracts.First(contract => contract.Right == OptionRight.Put);\n\n                    var lessOufOfTheMoneyPut = contracts.First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > oufOfTheMoneyPut.Strike);\n\n                    var oufOfTheMoneyCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > chain.Underlying.Price);\n\n                    var moreOufOfTheMoneyCall = contracts.First(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == oufOfTheMoneyPut.Expiry\n                        && contract.Strike > oufOfTheMoneyCall.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(oufOfTheMoneyPut.Symbol, -10);\n                    MarketOrder(lessOufOfTheMoneyPut.Symbol, +10);\n\n                    MarketOrder(oufOfTheMoneyCall.Symbol, +10);\n                    MarketOrder(moreOufOfTheMoneyCall.Symbol, -10);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortIronCondor.Name, 10);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var expectedMarginUsage = 0;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(oufOfTheMoneyPut.Symbol, lessOufOfTheMoneyPut.Symbol,\n                        oufOfTheMoneyCall.Symbol, moreOufOfTheMoneyCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197624\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$26.00\"},\n            {\"Estimated Strategy Capacity\", \"$150000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"25.35%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"35e7dd1e08bd0b9f4645740b72851d1f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Jelly Roll option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortJellyRollRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain.GroupBy(x => x.Strike)\n                        .First()\n                        .OrderBy(x => x.Expiry)\n                        .ToList();\n\n                    var nearPut = contracts.First(contract => contract.Right == OptionRight.Put);\n\n                    var farPut = contracts.First(contract => contract.Right == OptionRight.Put\n                        && contract.Expiry > nearPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var nearCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == nearPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var farCall = contracts.Single(contract => contract.Right == OptionRight.Call\n                        && contract.Expiry == farPut.Expiry\n                        && contract.Strike == nearPut.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(nearPut.Symbol, -1);\n                    MarketOrder(nearCall.Symbol, +1);\n\n                    MarketOrder(farPut.Symbol, +1);\n                    MarketOrder(farCall.Symbol, -1);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ShortJellyRoll.Name, 1);\n\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    var undPrice = farPut.UnderlyingLastPrice;\n                    var expectedMarginUsage = 18530.8m;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception($\"Unexpect margin used!:{Portfolio.TotalMarginUsed}\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(nearPut.Symbol, nearCall.Symbol, farPut.Symbol, farCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199741\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$110000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.70%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"858390f60e75ee2a501d9570ad37a925\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityShortPutBackspreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Short Put Backspread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityShortPutBackspreadRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var putContracts = chain\n                        .Where(contract => contract.Right == OptionRight.Put);\n                    var expiry = putContracts.Min(x => x.Expiry);\n                    putContracts = putContracts.Where(x => x.Expiry == expiry)\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    var strike = putContracts.Select(x => x.Strike).Distinct();\n                    if (strike.Count() < 2) return;\n\n                    var lowStrikePut = putContracts.First();\n                    var highStrikePut = putContracts.First(contract => contract.Strike > lowStrikePut.Strike && contract.Expiry == lowStrikePut.Expiry);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n\n                    var optionStrategy = OptionStrategies.ShortPutBackspread(_optionSymbol, highStrikePut.Strike, lowStrikePut.Strike, expiry);\n                    Buy(optionStrategy, 5);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    // It is a combination of bear put spread and naked put\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BearPutSpread.Name, 5);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 5);\n\n                    // Should only involve the naked put part\n                    var security = Securities[lowStrikePut.Symbol];\n                    var expectedMarginUsage = security.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(security, -5)).Value;\n\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new Exception(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceLadderDifference = GetPriceSpreadDifference(lowStrikePut.Symbol, highStrikePut.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceLadderDifference))\n                    {\n                        throw new Exception(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199165.25\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$9.75\"},\n            {\"Estimated Strategy Capacity\", \"$1200000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZL2DIPERQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"8.84%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"eeef2acb2fcf1b166d8884fcf8b49bbd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityStraddleRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Straddle option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityStraddleRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var call = contracts.Last(contract => contract.Right == OptionRight.Call);\n                    var put = contracts.Last(contract => contract.Right == OptionRight.Put && contract.Expiry == call.Expiry\n                        && contract.Strike == call.Strike);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(call.Symbol, 10);\n                    MarketOrder(put.Symbol, 10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Straddle.Name, 10);\n\n                    // Long straddles have no margin requirement\n                    var expectedMarginUsage = 0m;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(put.Symbol, call.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197787\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$270000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"14.41%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b70cd0519217e6970f4aaaa04331ca68\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityStrangleRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity Strangle option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionEquityStrangleRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contracts = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => x.Strike)\n                        .ToList();\n\n                    var oufOfTheMoneyCall = contracts.Last(contract => contract.Right == OptionRight.Call && contract.Strike > chain.Underlying.Price);\n                    var oufOfTheMoneyPut = contracts.Last(contract => contract.Right == OptionRight.Put && contract.Expiry == oufOfTheMoneyCall.Expiry\n                        && contract.Strike < chain.Underlying.Price);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(oufOfTheMoneyPut.Symbol, 10);\n                    MarketOrder(oufOfTheMoneyCall.Symbol, 10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Strangle.Name, 10);\n\n                    // Long strangles have no margin requirement\n                    var expectedMarginUsage = 0m;\n                    if (expectedMarginUsage != Portfolio.TotalMarginUsed)\n                    {\n                        throw new RegressionTestException(\"Unexpect margin used!\");\n                    }\n\n                    // we payed the ask and value using the assets price\n                    var priceSpreadDifference = GetPriceSpreadDifference(oufOfTheMoneyPut.Symbol, oufOfTheMoneyCall.Symbol);\n                    if (initialMargin != (freeMarginPostTrade + expectedMarginUsage + _paidFees - priceSpreadDifference))\n                    {\n                        throw new RegressionTestException(\"Unexpect margin remaining!\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"197937\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$13.00\"},\n            {\"Estimated Strategy Capacity\", \"$250000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"13.14%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a8bc714c098862047c37ce9389e252a5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert that the option strategy matcher works as expected\n    /// </summary>\n    public class OptionEquityStrategyMatcherRegressionAlgorithm : OptionEquityBaseStrategyRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            AddEquity(\"SPY\", Resolution.Hour);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain) && Securities[\"SPY\"].HasData)\n                {\n                    var contracts = chain\n                        .Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    // let's setup and trade a butterfly call\n                    var distanceBetweenStrikes = 2.5m;\n                    var lowerCall = contracts.First();\n                    var middleCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == lowerCall.Strike + distanceBetweenStrikes);\n                    var highestCall = contracts.First(contract => contract.Expiry == lowerCall.Expiry && contract.Strike == middleCall.Strike + distanceBetweenStrikes);\n\n                    var initialMargin = Portfolio.MarginRemaining;\n                    MarketOrder(lowerCall.Symbol, 10);\n                    MarketOrder(middleCall.Symbol, -20);\n                    MarketOrder(highestCall.Symbol, 10);\n                    var freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n\n                    // let's make some trades to add some noise\n                    MarketOrder(_optionSymbol.Underlying, 490);\n                    freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n                    AssertDefaultGroup(_optionSymbol.Underlying, 490);\n\n                    LimitOrder(_optionSymbol.Underlying, 100, Securities[_optionSymbol.Underlying].AskPrice);\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n                    AssertDefaultGroup(_optionSymbol.Underlying, 490);\n\n                    MarketOrder(lowerCall.Symbol, 5);\n                    freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n                    AssertDefaultGroup(_optionSymbol.Underlying, 490);\n                    // naked call for the lowerCall contract\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 5);\n\n                    MarketOrder(middleCall.Symbol, -5);\n                    freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CoveredCall.Name, 4);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallSpread.Name, 1);\n                    AssertDefaultGroup(_optionSymbol.Underlying, 90);\n                    // naked call for the lowerCall contract\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 4);\n\n                    // trade some other asset\n                    MarketOrder(\"SPY\", 200);\n                    freeMarginPostTrade = Portfolio.MarginRemaining;\n\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 10);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CoveredCall.Name, 4);\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallSpread.Name, 1);\n                    AssertDefaultGroup(_optionSymbol.Underlying, 90);\n                    // naked call for the lowerCall contract\n                    AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 4);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15204;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199576.82\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$36.95\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMEBFLDY|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"274.86%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6d0e54c4897844ae98e478045bbd1569\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests option exercise and assignment functionality\n    /// We open two positions and go with them into expiration. We expect to see our long position exercised and short position assigned.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    public class OptionExerciseAssignRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private readonly Symbol _optionSymbol = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Option, Market.USA);\n        private bool _assignedOption = false;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.IncludeWeeklys()\n                                   .Strikes(-2, +2)\n                                   .Expiration(TimeSpan.Zero, TimeSpan.FromDays(10)));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_assignedOption)\n            {\n                throw new RegressionTestException(\"In the end, short ITM option position was not assigned.\");\n            }\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // find the second call strike under market price expiring today\n                    var contracts = (\n                        from optionContract in chain.OrderByDescending(x => x.Strike)\n                        where optionContract.Right == OptionRight.Call\n                        where optionContract.Expiry == Time.Date\n                        where optionContract.Strike < chain.Underlying.Price\n                        select optionContract\n                        ).Take(2);\n\n                    if (contracts.Any())\n                    {\n                        MarketOrder(contracts.FirstOrDefault().Symbol, 1);\n                        MarketOrder(contracts.Skip(1).FirstOrDefault().Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n        public override void OnAssignmentOrderEvent(OrderEvent assignmentEvent)\n        {\n            Log(assignmentEvent.ToString());\n            _assignedOption = true;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 26483;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.30%\"},\n            {\"Average Loss\", \"-0.32%\"},\n            {\"Compounding Annual Return\", \"-22.695%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99648\"},\n            {\"Net Profit\", \"-0.352%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0.92\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"30.10%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b7830811367ced9052c1623875787637\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExerciseOnExpiryAndNonTradableDateRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that options are automatically exercised on expiry regardless on whether\n    /// the day after expiration is tradable or not.\n    /// This specific algorithm works with contracts added manually.\n    /// </summary>\n    public class OptionExerciseOnExpiryAndNonTradableDateRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spxOption1;\n        private Symbol _spxOption2;\n        private bool _tradedOptions;\n        private bool _exercisedOption1;\n        private bool _exercisedOption2;\n\n        public override void Initialize()\n        {\n            SetStartDate(2023, 6, 25);\n            SetEndDate(2023, 7, 10);\n\n            var spx = AddIndex(\"SPX\").Symbol;\n\n            _spxOption1 = QuantConnect.Symbol.CreateOption(\n                spx,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                4445m,\n                // Next day is tradable\n                new DateTime(2023, 6, 30));\n\n            _spxOption2 = QuantConnect.Symbol.CreateOption(\n                spx,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                4445m,\n                // Next day is a holiday\n                new DateTime(2023, 7, 3));\n\n            InitializeOptions(spx, [_spxOption1, _spxOption2]);\n        }\n\n        protected virtual void InitializeOptions(Symbol underlying, Symbol[] options)\n        {\n            AddIndexOptionContract(_spxOption1);\n            AddIndexOptionContract(_spxOption2);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_tradedOptions)\n            {\n                Buy(_spxOption1, 1);\n                Buy(_spxOption2, 1);\n                _tradedOptions = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n            if (Transactions.GetOrderById(orderEvent.OrderId) is OptionExerciseOrder order)\n            {\n                _exercisedOption1 |= order.Symbol == _spxOption1;\n                _exercisedOption2 |= order.Symbol == _spxOption2;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_exercisedOption1 || !_exercisedOption2)\n            {\n                throw new RegressionTestException(\"Expected both options to be exercised\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 16640;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.58%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"31.165%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101172\"},\n            {\"Net Profit\", \"1.172%\"},\n            {\"Sharpe Ratio\", \"4.049\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"94.902%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.041\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"5.34\"},\n            {\"Tracking Error\", \"0.041\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"SPXW Y9T7LPL21B5A|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"4\"},\n            {\"OrderListHash\", \"a1f4c8031a753d2b73655adf94f9889b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExerciseOnExpiryAndNonTradableDateWithOptionSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that options are automatically exercised on expiry regardless on whether\n    /// the day after expiration is tradable or not.\n    /// This specific algorithm works with contracts added by selection using the option security filter.\n    /// </summary>\n    public class OptionExerciseOnExpiryAndNonTradableDateWithOptionSelectionRegressionAlgorithm\n        : OptionExerciseOnExpiryAndNonTradableDateRegressionAlgorithm\n    {\n        protected override void InitializeOptions(Symbol underlying, Symbol[] options)\n        {\n            AddIndexOption(underlying, options[0].ID.Symbol)\n                .SetFilter(u => u.IncludeWeeklys().Contracts(contracts => options));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 16649;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExerciseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue #5610\n    /// </summary>\n    public class OptionExerciseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _equity, _option;\n        private Symbol _contractSymbol;\n        private bool _purchasedUnderlying;\n        private int quantity = 20;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 9);\n            SetCash(1000000);\n\n            _equity = AddEquity(\"AAPL\", Resolution.Minute).Symbol;\n            var option = AddOption(\"AAPL\", Resolution.Minute);\n            _option = option.Symbol;\n\n            option.SetFilter(universe => from contract in universe\n                                .WeeklysOnly()\n                                .Strikes(-5, +5)\n                                .Expiration(TimeSpan.Zero, TimeSpan.FromDays(29))\n                                         select contract.Symbol);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"Order Symbol: {orderEvent.Symbol}; Quantity: {orderEvent.Quantity}; Status: {orderEvent.Status}\");\n\n            if (orderEvent.Symbol == _equity && orderEvent.Status == OrderStatus.Filled)\n            {\n                _purchasedUnderlying = true;\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_contractSymbol != null)\n            {\n                return;\n            }\n\n            // Buy the underlying for our covered put\n            if (slice.ContainsKey(_equity) && !_purchasedUnderlying)\n            {\n                MarketOrder(_equity, 100 * quantity);\n            }\n\n            // Buy a contract and exercise it immediately\n            if (_purchasedUnderlying && slice.OptionChains.TryGetValue(_option, out OptionChain chain))\n            {\n                var contract = chain\n                    .Where(x => x.Right == OptionRight.Put)\n                    .OrderByDescending(x => x.Strike - slice[_equity].Price)\n                    .FirstOrDefault();\n\n                _contractSymbol = contract.Symbol;\n                MarketOrder(_contractSymbol, quantity);\n\n                // Exercise option\n                Log(\"Quantity before: \" + Portfolio[_equity].Quantity);\n                ExerciseOption(_contractSymbol, quantity);\n                Log(\"Quantity after: \" + Portfolio[_equity].Quantity);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio[_equity].Quantity != 0)\n            {\n                throw new RegressionTestException(\"Regression equity holdings should be zero after exercise.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 105730;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"2.13%\"},\n            {\"Average Loss\", \"-2.21%\"},\n            {\"Compounding Annual Return\", \"-11.379%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-0.019\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"998677\"},\n            {\"Net Profit\", \"-0.132%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.96\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$23.00\"},\n            {\"Estimated Strategy Capacity\", \"$420000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL 2ZQA0P58YK8UE|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"66.12%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8e667d067b15819e8626d2157ce7b0b5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExpiryDateOnHolidayCase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class OptionExpiryDateOnHolidayCase : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"SPY\";\n        public Symbol Underlying { get; init; } = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Equity, Market.USA);\n        private readonly Symbol _optionSymbol = QuantConnect.Symbol.Create(UnderlyingTicker, SecurityType.Option, Market.USA);\n        private OptionContract _optionContract;\n        private List<Delisting> _delistings = new List<Delisting>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 4, 15);\n            SetEndDate(2014, 4, 22);\n            SetCash(startingCash: 100000);\n\n            var equity = AddEquity(UnderlyingTicker);\n            equity.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            var option = AddOption(UnderlyingTicker);\n            option.SetFilter(f => f.Expiration(TimeSpan.Zero, TimeSpan.FromDays(30)));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            OptionChain chain;\n            if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n            {\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    _optionContract = chain.FirstOrDefault(c => c.Expiry.Date == new DateTime(2014, 04, 19) && c.OpenInterest > 0);\n                    if (_optionContract != null) MarketOrder(_optionContract.Symbol, 1);\n                }\n            }\n\n            Delisting delisting;\n            if (slice.Delistings.TryGetValue(_optionContract.Symbol, out delisting))\n            {\n                Log(delisting.ToString());\n                _delistings.Add(delisting);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!(_delistings.Count == 2 &&\n                  _delistings.Any(d => d.Type == DelistingType.Warning) &&\n                  _delistings.Any(d => d.Type == DelistingType.Delisted)))\n            {\n                throw new RegressionTestException($\"Option contract {_optionContract.Symbol} was not correctly delisted.\");\n            }\n\n            if (_delistings.FirstOrDefault(d => d.Type == DelistingType.Warning).EndTime.Date !=\n                new DateTime(2014, 04, 16))\n            {\n                throw new RegressionTestException($\"Option contract {_optionContract.Symbol} delisting warning was not fired the right date.\");\n            }\n\n            if (_delistings.FirstOrDefault(d => d.Type == DelistingType.Delisted).EndTime.Date !=\n                new DateTime(2014, 04, 17))\n            {\n                throw new RegressionTestException($\"Option contract {_optionContract.Symbol} was not delisted the right date.\");\n            }\n\n            if (Portfolio[_optionContract.Symbol].Invested)\n            {\n                throw new RegressionTestException($\"Option contract {_optionContract.Symbol} was not wasn't liquidated as part of delisting.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.54%\"},\n            {\"Compounding Annual Return\", \"23.156%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Net Profit\", \"0.448%\"},\n            {\"Sharpe Ratio\", \"15.59\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.171\"},\n            {\"Beta\", \"-0.65\"},\n            {\"Annual Standard Deviation\", \"0.01\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"13.971\"},\n            {\"Tracking Error\", \"0.01\"},\n            {\"Treynor Ratio\", \"-0.248\"},\n            {\"Total Fees\", \"$1.00\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionExpiryDateTodayRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered option asserting that greeks can be accessed\n    /// and have are not all zero, the same day as the contract expiration date.\n    /// </summary>\n    public class OptionExpiryDateTodayRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n        private bool _triedGreeksCalculation;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 9);\n            SetEndDate(2014, 06, 15);\n\n            var option = AddOption(\"AAPL\", Resolution.Minute);\n            option.SetFilter((universeFilter) =>\n            {\n                return universeFilter.IncludeWeeklys().Strikes(-2, +2).Expiration(0, 10);\n            });\n            option.PriceModel = OptionPriceModels.BlackScholes();\n            _optionSymbol = option.Symbol;\n\n            SetWarmUp(TimeSpan.FromDays(3));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp || Time.Hour > 10)\n            {\n                return;\n            }\n\n            foreach (var kvp in slice.OptionChains)\n            {\n                if (kvp.Key != _optionSymbol)\n                {\n                    continue;\n                }\n\n                var chain = kvp.Value;\n                // Find the call options expiring today\n                var contracts = chain\n                    .Where(contract => contract.Expiry.Date == Time.Date && contract.Strike < chain.Underlying.Price)\n                    .ToList();\n\n                if (contracts.Count == 0)\n                {\n                    return;\n                }\n\n                _triedGreeksCalculation = true;\n\n                foreach (var contract in contracts)\n                {\n                    var greeks = contract.Greeks;\n                    if (greeks.Delta == 0m && greeks.Gamma == 0m && greeks.Theta == 0m && greeks.Vega == 0m && greeks.Rho == 0m)\n                    {\n                        throw new RegressionTestException($\"Expected greeks to not be zero simultaneously for {contract.Symbol} at contract expiration date {contract.Expiry}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_triedGreeksCalculation)\n            {\n                throw new RegressionTestException(\"Expected to have tried greeks calculation\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 66655;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.176\"},\n            {\"Tracking Error\", \"0.071\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionGreeksRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue #7408\n    /// </summary>\n    public class OptionGreeksRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _itmCallSymbol, _otmCallSymbol, _itmPutSymbol, _otmPutSymbol;\n        private const decimal error = 0.1m;\n\n        public override void Initialize()\n        {\n            SetStartDate(2023, 8, 2);\n            SetEndDate(2023, 8, 4);\n            SetCash(1000000);\n\n            var equity = AddEquity(\"SPY\", Resolution.Minute);\n            equity.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(30);\n\n            _itmCallSymbol = QuantConnect.Symbol.CreateOption(equity.Symbol, Market.USA, OptionStyle.American, OptionRight.Call, 430, new DateTime(2023, 9, 1));\n            _otmCallSymbol = QuantConnect.Symbol.CreateOption(equity.Symbol, Market.USA, OptionStyle.American, OptionRight.Call, 470, new DateTime(2023, 9, 1));\n            _itmPutSymbol = QuantConnect.Symbol.CreateOption(equity.Symbol, Market.USA, OptionStyle.American, OptionRight.Put, 430, new DateTime(2023, 9, 1));\n            _otmPutSymbol = QuantConnect.Symbol.CreateOption(equity.Symbol, Market.USA, OptionStyle.American, OptionRight.Put, 470, new DateTime(2023, 9, 1));\n\n            AddOptionContract(_itmCallSymbol, Resolution.Minute);\n            AddOptionContract(_otmCallSymbol, Resolution.Minute);\n            AddOptionContract(_itmPutSymbol, Resolution.Minute);\n            AddOptionContract(_otmPutSymbol, Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var kvp in slice.OptionChains)\n            {\n                var chain = kvp.Value;\n                if (chain == null)\n                {\n                    continue;\n                }\n\n                foreach (var contractKvp in chain.Contracts)\n                {\n                    var symbol = contractKvp.Key;\n                    var contract = contractKvp.Value;\n                    var delta = contract.Greeks.Delta;\n                    decimal expected;\n\n                    // Values from CBOE\n                    if (symbol == _itmCallSymbol)\n                    {\n                        expected = 0.78901m;\n                    }\n                    else if (symbol == _otmCallSymbol)\n                    {\n                        expected = 0.09627m;\n                    }\n                    else if (symbol == _itmPutSymbol)\n                    {\n                        expected = -0.18395m;\n                    }\n                    else\n                    {\n                        expected = -0.99989m;\n                    }\n\n                    if (delta >= expected + error || delta <= expected - error)\n                    {\n                        throw new RegressionTestException($\"{symbol.Value} greeks not calculated accurately! Expected: {expected}, Estimation: {delta}\");\n                    }\n                }\n\n                Quit();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionIndicatorsMirrorContractsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing MathNet.Numerics.RootFinding;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm illustrating the usage of the <see cref=\"OptionIndicatorBase\"/> indicators with mirror-paired contracts\n    /// </summary>\n    public class OptionIndicatorsMirrorContractsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private ImpliedVolatility _impliedVolatility;\n        private Delta _delta;\n        private Gamma _gamma;\n        private Vega _vega;\n        private Theta _theta;\n        private Rho _rho;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 9);\n            SetCash(100000);\n\n            var equity = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n            var option = QuantConnect.Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Put, 650m, new DateTime(2014, 6, 21));\n            AddOptionContract(option, Resolution.Daily);\n            // add the call counter side of the mirrored pair\n            var mirrorOption = QuantConnect.Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 650m, new DateTime(2014, 6, 21));\n            AddOptionContract(mirrorOption, Resolution.Daily);\n\n            _delta = D(option, mirrorOption, optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n            _gamma = G(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _vega = V(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _theta = T(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _rho = R(option, mirrorOption, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n\n            // A custom IV indicator with custom calculation of IV\n            var riskFreeRateModel = new InterestRateProvider();\n            var dividendYieldModel = new DividendYieldProvider(equity);\n            _impliedVolatility = new CustomImpliedVolatility(option, mirrorOption, riskFreeRateModel, dividendYieldModel);\n            RegisterIndicator(option, _impliedVolatility, new QuoteBarConsolidator(TimeSpan.FromDays(1)));\n            RegisterIndicator(mirrorOption, _impliedVolatility, new QuoteBarConsolidator(TimeSpan.FromDays(1)));\n            RegisterIndicator(equity, _impliedVolatility, new TradeBarConsolidator(TimeSpan.FromDays(1)));\n\n            // custom IV smoothing function: assume the lower IV is more \"fair\"\n            Func<decimal, decimal, decimal> smoothingFunc = (iv, mirrorIv) => Math.Min(iv, mirrorIv);\n            // set the smoothing function\n            _delta.ImpliedVolatility.SetSmoothingFunction(smoothingFunc);\n            _gamma.ImpliedVolatility.SetSmoothingFunction(smoothingFunc);\n            _vega.ImpliedVolatility.SetSmoothingFunction(smoothingFunc);\n            _theta.ImpliedVolatility.SetSmoothingFunction(smoothingFunc);\n            _rho.ImpliedVolatility.SetSmoothingFunction(smoothingFunc);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_impliedVolatility.IsReady || !_delta.IsReady || !_gamma.IsReady || !_vega.IsReady || !_theta.IsReady || !_rho.IsReady)\n            {\n                throw new RegressionTestException(\"Expected IV/greeks calculated\");\n            }\n            Debug(@$\"Implied Volatility: {_impliedVolatility},\nDelta: {_delta},\nGamma: {_gamma},\nVega: {_vega},\nTheta: {_theta},\nRho: {_rho}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 51;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.639\"},\n            {\"Tracking Error\", \"0.037\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n\n    public class CustomImpliedVolatility : ImpliedVolatility\n    {\n        public CustomImpliedVolatility(Symbol option, Symbol mirrorOption, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n            : base(option, riskFreeRateModel, dividendYieldModel, mirrorOption)\n        {\n            SetSmoothingFunction((iv, mirrorIV) => iv);\n        }\n\n        protected override decimal CalculateIV(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var optionPrice = (double)Price.Current.Value;\n            var mirrorOptionPrice = (double)OppositePrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n\n            double result;\n\n            // we demonstate put-call parity calculation here, but note that it is not suitable for American options\n            try\n            {\n                Func<double, double> f = (vol) =>\n                {\n                    var callBlackPrice = OptionGreekIndicatorsHelper.BlackTheoreticalPrice(\n                        vol, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, OptionRight.Call);\n                    var putBlackPrice = OptionGreekIndicatorsHelper.BlackTheoreticalPrice(\n                        vol, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, OptionRight.Put);\n                    return optionPrice + mirrorOptionPrice - callBlackPrice - putBlackPrice;\n                };\n                return Convert.ToDecimal(Brent.FindRoot(f, 1e-7d, 2.0d, 1e-4d, 100));\n            }\n            catch\n            {\n                Log.Error(\"ImpliedVolatility.CalculateIV(): Fail to converge, returning 0.\");\n                return 0m;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionIndicatorsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm illustrating the usage of the <see cref=\"OptionIndicatorBase\"/> indicators\n    /// </summary>\n    public class OptionIndicatorsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private ImpliedVolatility _impliedVolatility;\n        private Delta _delta;\n        private Gamma _gamma;\n        private Vega _vega;\n        private Theta _theta;\n        private Rho _rho;\n\n        protected virtual string ExpectedGreeks { get; set; } = \"Implied Volatility: 0.44529,Delta: -0.00921,Gamma: 0.00036,Vega: 0.03636,Theta: -0.03747,Rho: 0.00047\";\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 7);\n            SetCash(100000);\n\n            AddEquity(\"AAPL\", Resolution.Minute);\n            var option = QuantConnect.Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Put, 505m, new DateTime(2014, 6, 27));\n            AddOptionContract(option, Resolution.Minute);\n\n            InitializeIndicators(option);\n        }\n\n        protected void InitializeIndicators(Symbol option)\n        {\n            _impliedVolatility = IV(option);\n            _delta = D(option, optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n            _gamma = G(option, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _vega = V(option, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _theta = T(option, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n            _rho = R(option, optionModel: OptionPricingModelType.ForwardTree, ivModel: OptionPricingModelType.BlackScholes);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_impliedVolatility == 0m || _delta == 0m || _gamma == 0m || _vega == 0m || _theta == 0m || _rho == 0m)\n            {\n                throw new RegressionTestException(\"Expected IV/greeks calculated\");\n            }\n            var result = @$\"Implied Volatility: {_impliedVolatility},Delta: {_delta},Gamma: {_gamma},Vega: {_vega},Theta: {_theta},Rho: {_rho}\";\n\n            Debug(result);\n            if (result != ExpectedGreeks)\n            {\n                throw new RegressionTestException($\"Unexpected greek values {result}. Expected {ExpectedGreeks}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 1974;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionModelsConsistencyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that when setting custom models for canonical options, a one-time warning is sent\n    /// informing the user that the contracts models are different (not the custom ones).\n    /// </summary>\n    public class OptionModelsConsistencyRegressionAlgorithm : QCAlgorithm\n    {\n        public override void Initialize()\n        {\n            var security = InitializeAlgorithm();\n            SetModels(security);\n\n            SetBenchmark(x => 0);\n        }\n\n        protected virtual Security InitializeAlgorithm()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            option.SetFilter(u => u.Strikes(-2, +2).Expiration(0, 180));\n\n            return option;\n        }\n\n        protected virtual void SetModels(Security security)\n        {\n            security.SetFillModel(new CustomFillModel());\n            security.SetFeeModel(new CustomFeeModel());\n            security.SetBuyingPowerModel(new CustomBuyingPowerModel());\n            security.SetSlippageModel(new CustomSlippageModel());\n            security.SetVolatilityModel(new CustomVolatilityModel());\n            security.SettlementModel = new CustomSettlementModel();\n        }\n\n        public class CustomFillModel : FillModel\n        {\n        }\n\n        public class CustomFeeModel : FeeModel\n        {\n        }\n\n        public class CustomBuyingPowerModel : BuyingPowerModel\n        {\n        }\n\n        public class CustomSlippageModel : ConstantSlippageModel\n        {\n            public CustomSlippageModel() : base(0)\n            {\n            }\n        }\n\n        public class CustomVolatilityModel : BaseVolatilityModel\n        {\n        }\n\n        public class CustomSettlementModel : ImmediateSettlementModel\n        {\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual Language[] Languages { get; } = { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 475777;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionNoTimeInUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of a zero time in universe setting. Related to GH issue #6653\n    /// </summary>\n    public class OptionNoTimeInUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, +1)\n                                   // Expiration method accepts TimeSpan objects or integer for days.\n                                   // The following statements yield the same filtering criteria\n                                   .Expiration(0, 60));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            var optionContracts = slice.OptionChains.GetValue(_optionSymbol);\n            var underlyingPrice = Securities[_optionSymbol.Underlying].Price;\n            var strikes = optionContracts.Select(o => o.Strike)\n                // when the strike matches the underlying price it's not taken into account in the +1 -1 range\n                .Where(strike => strike != underlyingPrice)\n                .ToHashSet();\n\n            if (strikes.Count > 2)\n            {\n                throw new RegressionTestException($\"At {Time} found {strikes.Count}. Underlying: {underlyingPrice}. Strikes: [{string.Join(\",\", strikes)}]\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8151;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionOTMExpiryOrderHasZeroPriceRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests Out of The Money (OTM) future option expiry for calls.\n    /// We expect 2 orders from the algorithm, which are:\n    ///\n    ///   * Initial entry, buy ES Call Option (expiring OTM)\n    ///     - contract expires worthless, not exercised, so never opened a position in the underlying\n    ///\n    ///   * Liquidation of worthless ES call option (expiring OTM). The option exercise order fill price must be zero.\n    /// </summary>\n    /// <remarks>\n    /// Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n    /// See related issue: https://github.com/QuantConnect/Lean/issues/4854\n    /// </remarks>\n    public class OptionOTMExpiryOrderHasZeroPriceRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _es19m20;\n        private Symbol _esOption;\n        private Symbol _expectedContract;\n\n        private decimal _cashAfterMarketOrder;\n        private string _firstOptionExerciseOrderEventMessage;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 5);\n            SetEndDate(2020, 6, 30);\n\n            _es19m20 = AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(\n                    Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                Resolution.Minute).Symbol;\n\n            // Select a future option call expiring OTM, and adds it to the algorithm.\n            _esOption = AddFutureOptionContract(OptionChain(_es19m20)\n                .Where(x => x.ID.StrikePrice >= 3300m && x.ID.OptionRight == OptionRight.Call)\n                .OrderBy(x => x.ID.StrikePrice)\n                .Take(1)\n                .Single(), Resolution.Minute).Symbol;\n\n            _expectedContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3300m, new DateTime(2020, 6, 19));\n            if (_esOption != _expectedContract)\n            {\n                throw new RegressionTestException($\"Contract {_expectedContract} was not found in the chain\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(_esOption, 1);\n                _cashAfterMarketOrder = Portfolio.Cash;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled)\n            {\n                // There's lots of noise with OnOrderEvent, but we're only interested in fills.\n                return;\n            }\n\n            if (!Securities.ContainsKey(orderEvent.Symbol))\n            {\n                throw new RegressionTestException($\"Order event Symbol not found in Securities collection: {orderEvent.Symbol}\");\n            }\n\n            var security = Securities[orderEvent.Symbol];\n            if (security.Symbol == _es19m20)\n            {\n                throw new RegressionTestException(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\");\n            }\n\n            if (_cashAfterMarketOrder > 0)\n            {\n                // This is the exercise order fill event\n                if (orderEvent.IsInTheMoney || orderEvent.FillPrice != 0)\n                {\n                    throw new RegressionTestException($\"Expected exercise order event fill price to be zero and to be marked as OTM, \" +\n                        $\"but was the fill price was {orderEvent.FillPrice} and IsInTheMoney = {orderEvent.IsInTheMoney}\");\n                }\n            }\n\n            if (Transactions.GetOrderById(orderEvent.OrderId).Type == OrderType.OptionExercise && _firstOptionExerciseOrderEventMessage == default)\n            {\n                _firstOptionExerciseOrderEventMessage = orderEvent.Message;\n            }\n        }\n\n        /// <summary>\n        /// Ran at the end of the algorithm to ensure the algorithm has no holdings\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">The algorithm has holdings</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException($\"Expected no holdings at end of algorithm, but are invested in: {string.Join(\", \", Portfolio.Keys)}\");\n            }\n\n            // No change in cash is expected, only the market order fill price\n            if (Portfolio.Cash != _cashAfterMarketOrder)\n            {\n                throw new RegressionTestException($\"Expected no change in cash after the market order. Cash in portfolio: {Portfolio.Cash}. Cash in portfolio after the market order: {_cashAfterMarketOrder}\");\n            }\n\n            var orders = Transactions.GetOrders().ToList();\n            if (orders.Count != 2)\n            {\n                throw new RegressionTestException($\"Expected 2 orders (market order and OTM option exercise), but found: {orders.Count}\");\n            }\n\n            var exerciseOrder = orders.Find(x => x.Type == OrderType.OptionExercise);\n            if (!_firstOptionExerciseOrderEventMessage.Contains(\"OTM\", StringComparison.InvariantCulture) || exerciseOrder.Price != 0)\n            {\n                throw new RegressionTestException($\"Expected the OTM exercise order to have price = 0, but was: {exerciseOrder.Price}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 212198;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-3.85%\"},\n            {\"Compounding Annual Return\", \"-7.754%\"},\n            {\"Drawdown\", \"4.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"96148.58\"},\n            {\"Net Profit\", \"-3.851%\"},\n            {\"Sharpe Ratio\", \"-1.221\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.131%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.063\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0.052\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-0.198\"},\n            {\"Tracking Error\", \"0.377\"},\n            {\"Treynor Ratio\", \"-23.065\"},\n            {\"Total Fees\", \"$1.42\"},\n            {\"Estimated Strategy Capacity\", \"$180000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XFH59UPHL5L0|ES XFH59UK0MYO1\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d84cd529c8535b576d63c0f9c29635c3\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/OptionOpenInterestRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Options Open Interest data regression test.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class OptionOpenInterestRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            // this test opens position in the first day of trading, lives through stock split (7 for 1), and closes adjusted position on the second day\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 06);\n            SetCash(1000000);\n\n            var option = AddOption(\"TWX\");\n\n            option.SetFilter(-10, +10, TimeSpan.Zero, TimeSpan.FromDays(365 * 2));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"TWX\");\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach (var chain in slice.OptionChains)\n                {\n                    foreach (var contract in chain.Value)\n                    {\n                        if (contract.Symbol.ID.StrikePrice == 72.5m &&\n                            contract.Symbol.ID.OptionRight == OptionRight.Call &&\n                            contract.Symbol.ID.Date == new DateTime(2016, 01, 15))\n                        {\n                            var history = History<OpenInterest>(contract.Symbol, TimeSpan.FromDays(1)).ToList();\n                            if (history.Count == 0)\n                            {\n                                throw new RegressionTestException(\"Regression test failed: open interest history request is empty\");\n                            }\n\n                            var security = Securities[contract.Symbol];\n                            var openInterestCache = security.Cache.GetData<OpenInterest>();\n                            if (openInterestCache == null)\n                            {\n                                throw new RegressionTestException(\"Regression test failed: current open interest isn't in the security cache\");\n                            }\n\n                            if (slice.Time.Date == new DateTime(2014, 06, 05) && (contract.OpenInterest != 50 || security.OpenInterest != 50))\n                            {\n                                throw new RegressionTestException(\"Regression test failed: current open interest was not correctly loaded and is not equal to 50\");\n                            }\n                            if (slice.Time.Date == new DateTime(2014, 06, 06) && (contract.OpenInterest != 70 || security.OpenInterest != 70))\n                            {\n                                throw new RegressionTestException(\"Regression test failed: current open interest was not correctly loaded and is not equal to 70\");\n                            }\n                            if (slice.Time.Date == new DateTime(2014, 06, 06))\n                            {\n                                MarketOrder(contract.Symbol, 1);\n                                MarketOnCloseOrder(contract.Symbol, -1);\n                            }\n                        }\n                    }\n\n                    // We should be able to access the open interest of the contract\n                    if (chain.Value.All(contract => contract.OpenInterest == 0))\n                    {\n                        throw new RegressionTestException(\"Regression test failed: open interest is zero for all contracts\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 256364;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 77028;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999898\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"AOL W78ZERDZOC1Y|AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"020bab5fcb635e1378f404364e9495a2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionOrdersOnSplitRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that option orders are not allowed on split dates\n    /// </summary>\n    public class OptionOrdersOnSplitRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n\n        private OrderTicket _ticket;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 11);\n            SetCash(100000);\n\n            _aapl = AddEquity(\"AAPL\", Resolution.Minute, extendedMarketHours: true, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n\n            var option = AddOption(_aapl, Resolution.Minute);\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, +1).Expiration(0, 365));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.TryGetValue(_aapl, out var split))\n            {\n                Debug($\"Split: {Time} - {split}\");\n\n                if (split.Type == SplitType.SplitOccurred)\n                {\n                    var contract = Securities.Values\n                        .Where(x => x.Type.IsOption() && !x.Symbol.IsCanonical())\n                        .OrderBy(x => x.Symbol.ID.StrikePrice)\n                        .First();\n                    _ticket = MarketOrder(contract.Symbol, 1);\n\n                    // The actual error received now is \"zero price\" since it's midnight and the selection options have not been updated yet\n                    if (_ticket.Status != OrderStatus.Invalid ||\n                        _ticket.SubmitRequest.Response.IsSuccess ||\n                        _ticket.SubmitRequest.Response.ErrorCode != OrderResponseErrorCode.SecurityPriceZero ||\n                        !_ticket.SubmitRequest.Response.ErrorMessage.Contains(\"The security does not have an accurate price as it has not yet received a bar of data\", StringComparison.InvariantCulture))\n                    {\n                        throw new RegressionTestException(\n                            $\"Expected invalid order ticket with error code {nameof(OrderResponseErrorCode.SecurityPriceZero)}, \" +\n                            $\"but received {_ticket.SubmitRequest.Response.ErrorCode} - {_ticket.SubmitRequest.Response.ErrorMessage}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_ticket == null)\n            {\n                throw new RegressionTestException(\"Expected invalid order ticket with error code OptionOrderOnStockSplit, but no order was submitted\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 67775;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.491\"},\n            {\"Tracking Error\", \"0.042\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base regression algorithm exercising different style options with option price models that might\n    /// or might not support them. Also, if the option style is supported, greeks are asserted to be accesible and have valid values.\n    /// </summary>\n    public abstract class OptionPriceModelForOptionStylesBaseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _optionStyleIsSupported;\n        private Option _option;\n        private bool _checkGreeks;\n        private bool _triedGreeksCalculation;\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp)\n            {\n                return;\n            }\n\n            foreach (var kvp in slice.OptionChains)\n            {\n                if (kvp.Key != _option?.Symbol)\n                {\n                    continue;\n                }\n\n                CheckGreeks(kvp.Value);\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            _checkGreeks = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_triedGreeksCalculation)\n            {\n                throw new RegressionTestException(\"Expected greeks to be accessed\");\n            }\n        }\n\n        protected void Init(Option option, bool optionStyleIsSupported)\n        {\n            _option = option;\n            _optionStyleIsSupported = optionStyleIsSupported;\n            _checkGreeks = true;\n            _triedGreeksCalculation = false;\n        }\n\n\n        public void CheckGreeks(OptionChain contracts)\n        {\n            if (!_checkGreeks || !contracts.Any())\n            {\n                return;\n            }\n\n            _checkGreeks = false;\n            _triedGreeksCalculation = true;\n\n            foreach (var contract in contracts)\n            {\n                Greeks greeks = null;\n                try\n                {\n                    greeks = contract.Greeks;\n\n                    // Greeks should have not been successfully accessed if the option style is not supported\n                    if (!_optionStyleIsSupported)\n                    {\n                        throw new RegressionTestException($\"Expected greeks not to be calculated for {contract.Symbol.Value}, an {_option.Style} style option, using {_option?.PriceModel.GetType().Name}, which does not support them, but they were\");\n\n                    }\n                }\n                catch (ArgumentException)\n                {\n                    // ArgumentException is only expected if the option style is not supported\n                    if (_optionStyleIsSupported)\n                    {\n                        throw new RegressionTestException($\"Expected greeks to be calculated for {contract.Symbol.Value}, an {_option.Style} style option, using {_option?.PriceModel.GetType().Name}, which supports them, but they were not\");\n                    }\n                }\n\n                // Greeks should be valid if they were successfuly accessed for supported option style\n                if (_optionStyleIsSupported)\n                {\n                    if (greeks == null ||\n                        (greeks.Delta == 0m && greeks.Gamma == 0m && greeks.Theta == 0m && greeks.Vega == 0m && greeks.Rho == 0m))\n                    {\n                        throw new RegressionTestException($\"Expected greeks to not be zero simultaneously for {contract.Symbol.Value}, an {_option.Style} style option, using {_option?.PriceModel.GetType().Name}, but they were\");\n                    }\n\n                    // Delta can be {-1, 0, 1} if the price is too wild, rho can be 0 if risk free rate is 0\n                    // Vega can be 0 if the price is very off from theoretical price, Gamma = 0 if Delta belongs to {-1, 1}\n                    if (((contract.Right == OptionRight.Call && (greeks.Delta < 0m || greeks.Delta > 1m || greeks.Rho < 0m))\n                        || (contract.Right == OptionRight.Put && (greeks.Delta < -1m || greeks.Delta > 0m || greeks.Rho > 0m))\n                        || greeks.Vega < 0m || greeks.Gamma < 0m))\n                    {\n                        throw new RegressionTestException($\"Expected greeks to have valid values. Greeks were: Delta: {greeks.Delta}, Rho: {greeks.Rho}, Theta: {greeks.Theta}, Vega: {greeks.Vega}, Gamma: {greeks.Gamma}\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        abstract public long DataPoints { get; }\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        abstract public int AlgorithmHistoryDataPoints { get; }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        abstract public AlgorithmStatus AlgorithmStatus { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        abstract public Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered American style option, using an option price model\n    /// that supports American style options and asserting that the option price model is used.\n    /// </summary>\n    public class OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm : OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 9);\n            SetEndDate(2014, 6, 9);\n\n            var option = AddOption(\"AAPL\", Resolution.Minute);\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, 1).Expiration(0, 35));\n\n            // BaroneAdesiWhaley model supports American style options\n            option.PriceModel = OptionPriceModels.QuantLib.BaroneAdesiWhaley();\n\n            SetWarmup(2, Resolution.Daily);\n\n            Init(option, optionStyleIsSupported: true);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15787;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered American style option, using an option price model\n    /// that supports American style options and asserting that the option price model is used.\n    /// </summary>\n    public class OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm : OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // We want to match the start time of the base algorithm: Base algorithm warmup is 2 bar of daily resolution.\n            // So to match the same start time we go back 4 days, we need to account for a single weekend. This is calculated by 'Time.GetStartTimeForTradeBars'\n            SetWarmup(TimeSpan.FromDays(4));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 19697;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an index covered European style option, using an option price model\n    /// that supports European style options and asserting that the option price model is used.\n    /// </summary>\n    public class OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm : OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 14);\n            SetEndDate(2021, 1, 14);\n\n            var option = AddIndexOption(\"SPX\", Resolution.Hour);\n            // BlackScholes model supports European style options\n            option.PriceModel = OptionPriceModels.BlackScholes();\n\n            SetWarmup(7, Resolution.Daily);\n\n            Init(option, optionStyleIsSupported: true);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 177;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an index covered European style option, using an option price model\n    /// that supports European style options and asserting that the option price model is used.\n    /// </summary>\n    public class OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm : OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // We want to match the start time of the base algorithm. SPX index options data time zone is chicago, algorithm time zone is new york (default).\n            // Base algorithm warmup is 7 bar of daily resolution starts at 23 PM new york time of T-1. So to match the same start time\n            // we go back a 9 day + 23 hours, we need to account for a single weekend. This is calculated by 'Time.GetStartTimeForTradeBars'\n            SetWarmup(TimeSpan.FromHours(24 * 9 + 23));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 639;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered American style option, using an option price model that does not support American style options and asserting that the option price model is not used.\n    /// </summary>\n    public class OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm : OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 9);\n            SetEndDate(2014, 6, 9);\n\n            var option = AddOption(\"AAPL\", Resolution.Minute);\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, 1).Expiration(0, 35));\n\n            // QL BlackSholes model does not support American style options\n            option.PriceModel = OptionPriceModels.QuantLib.BlackScholes();\n\n            SetWarmup(2, Resolution.Daily);\n\n            Init(option, optionStyleIsSupported: false);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 15787;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered American style option, using an option price model that does not support American style options and asserting that the option price model is not used.\n    /// </summary>\n    public class OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm : OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // We want to match the start time of the base algorithm: Base algorithm warmup is 2 bar of daily resolution.\n            // So to match the same start time we go back 4 days, we need to account for a single weekend. This is calculated by 'Time.GetStartTimeForTradeBars'\n            SetWarmup(TimeSpan.FromDays(4));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 19697;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered European style option, using an option price model\n    /// that does not support European style options and asserting that the option price model is not used.\n    /// </summary>\n    public class OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm : OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 14);\n            SetEndDate(2021, 1, 14);\n\n            var option = AddIndexOption(\"SPX\", Resolution.Hour);\n            // BaroneAdesiWhaley model does not support European style options\n            option.PriceModel = OptionPriceModels.QuantLib.BaroneAdesiWhaley();\n\n            SetWarmup(7, Resolution.Daily);\n\n            Init(option, optionStyleIsSupported: false);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 177;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm exercising an equity covered European style option, using an option price model\n    /// that does not support European style options and asserting that the option price model is not used.\n    /// </summary>\n    public class OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm : OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // We want to match the start time of the base algorithm. SPX index options data time zone is chicago, algorithm time zone is new york (default).\n            // Base algorithm warmup is 7 bar of daily resolution starts at 23 PM new york time of T-1. So to match the same start time\n            // we go back a 9 day + 23 hours, we need to account for a single weekend. This is calculated by 'Time.GetStartTimeForTradeBars'\n            SetWarmup(TimeSpan.FromHours(24 * 9 + 23));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 639;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is an option split regression algorithm\n    /// </summary>\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class OptionRenameDailyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n        private Symbol _contractSymbol;\n        private Symbol _underlyingSymbol;\n\n        public override void Initialize()\n        {\n            // this test opens position in the first day of trading, lives through stock rename (NWSA->FOXA), dividends, and closes adjusted position on the third day\n            SetStartDate(2013, 06, 27);\n            SetEndDate(2013, 07, 02);\n            SetCash(1000000);\n\n            var option = AddOption(\"NWSA\", Resolution.Daily);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(-1, +1, TimeSpan.Zero, TimeSpan.MaxValue);\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"NWSA\");\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var dividend in slice.Dividends.Values)\n            {\n                if (dividend.ReferencePrice != 32.6m || dividend.Distribution != 3.82m)\n                {\n                    throw new RegressionTestException($\"{Time} - Invalid dividend {dividend}\");\n                }\n            }\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    var contract =\n                        chain.OrderBy(x => x.Expiry)\n                        .Where(x => x.Right == OptionRight.Call && x.Strike == 33 && x.Expiry.Date == new DateTime(2013, 08, 17))\n                        .FirstOrDefault();\n\n                    if (contract != null)\n                    {\n                        // Buying option\n                        _contractSymbol = contract.Symbol;\n                        Buy(_contractSymbol, 1);\n\n                        // Buying the underlying stock\n                        _underlyingSymbol = contract.Symbol.Underlying;\n                        Buy(_underlyingSymbol, 100);\n\n                        // Check\n                        if (slice.Time != new DateTime(2013, 6, 27, 16, 0, 0))\n                        {\n                            throw new RegressionTestException($\"Received first contract at {slice.Time}; Expected at 6/28/2013 12AM.\");\n                        }\n\n                        if (contract.AskPrice != 1.15m)\n                        {\n                            throw new RegressionTestException(\"Current ask price was not loaded from NWSA backtest file and is not $1.1\");\n                        }\n\n                        if (contract.UnderlyingSymbol.Value != \"NWSA\")\n                        {\n                            throw new RegressionTestException(\"Contract underlying symbol was not NWSA as expected\");\n                        }\n                    }\n                }\n            }\n            else if (slice.Time == new DateTime(2013, 7, 2, 16, 0, 0)) // The end\n            {\n                // selling positions\n                Liquidate();\n\n                // checks\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    if (chain.Underlying.Symbol.Value != \"FOXA\")\n                    {\n                        throw new RegressionTestException(\"Chain underlying symbol was not FOXA as expected\");\n                    }\n\n                    var contract =\n                        chain.OrderBy(x => x.Expiry)\n                        .Where(x => x.Right == OptionRight.Call && x.Strike == 33 && x.Expiry.Date == new DateTime(2013, 08, 17))\n                        .FirstOrDefault();\n\n                    if (contract.BidPrice != 0.05m)\n                    {\n                        throw new RegressionTestException(\"Current bid price was not loaded from FOXA file and is not $0.05\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 871;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.289%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999955\"},\n            {\"Net Profit\", \"-0.004%\"},\n            {\"Sharpe Ratio\", \"-9.76\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"32.662%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.264\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"NWSA VJ5IKAXUC6NA|NWSA T3MO1488O0H1\"},\n            {\"Portfolio Turnover\", \"0.06%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"bab17a4489f3ecf79df28e661de80a9f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is an option split regression algorithm\n    /// </summary>\n    /// <meta name=\"tag\" content=\"options\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class OptionRenameRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            // this test opens position in the first day of trading, lives through stock rename (NWSA->FOXA), dividends, and closes adjusted position on the third day\n            SetStartDate(2013, 06, 28);\n            SetEndDate(2013, 07, 02);\n            SetCash(1000000);\n\n            var option = AddOption(\"TFCFA\");\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(-1, +1, TimeSpan.Zero, TimeSpan.MaxValue);\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"TFCFA\");\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var dividend in slice.Dividends.Values)\n            {\n                if (dividend.ReferencePrice != 32.6m || dividend.Distribution != 3.82m)\n                {\n                    throw new RegressionTestException($\"{Time} - Invalid dividend {dividend}\");\n                }\n            }\n            if (!Portfolio.Invested)\n            {\n                if (Time.Day == 28 && Time.Hour > 9 && Time.Minute > 0)\n                {\n                    OptionChain chain;\n                    if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                    {\n                        var contract =\n                            chain.OrderBy(x => x.Expiry)\n                            .Where(x => x.Right == OptionRight.Call && x.Strike == 33 && x.Expiry.Date == new DateTime(2013, 08, 17))\n                            .FirstOrDefault();\n\n                        if (contract != null)\n                        {\n                            // Buying option\n                            Buy(contract.Symbol, 1);\n\n                            // Buying the underlying stock\n                            var underlyingSymbol = contract.Symbol.Underlying;\n                            Buy(underlyingSymbol, 100);\n\n                            // checks\n                            if (contract.AskPrice != 1.1m)\n                            {\n                                throw new RegressionTestException(\"Regression test failed: current ask price was not loaded from NWSA backtest file and is not $1.1\");\n                            }\n                        }\n                    }\n                }\n            }\n            else\n            {\n                if (Time.Day == 2 && Time.Hour > 14 && Time.Minute > 0)\n                {\n                    // selling positions\n                    Liquidate();\n\n                    // checks\n                    OptionChain chain;\n                    if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                    {\n                        var contract =\n                            chain.OrderBy(x => x.Expiry)\n                            .Where(x => x.Right == OptionRight.Call && x.Strike == 33 && x.Expiry.Date == new DateTime(2013, 08, 17))\n                            .FirstOrDefault();\n\n                        if (contract.BidPrice != 0.05m)\n                        {\n                            throw new RegressionTestException(\"Regression test failed: current bid price was not loaded from FOXA file and is not $0.05\");\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 19290;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.02%\"},\n            {\"Compounding Annual Return\", \"-0.492%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999937\"},\n            {\"Net Profit\", \"-0.006%\"},\n            {\"Sharpe Ratio\", \"-9.182\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"29.496%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.318\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$8600000.00\"},\n            {\"Lowest Capacity Asset\", \"NWSA VJ5IKAXUC6NA|NWSA T3MO1488O0H1\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"9e6589151844ae971e04a44a72fb80cd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the resolution being used for options universe and it's data respecting universe settings\n    /// </summary>\n    public class OptionResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            var option = AddOption(\"GOOG\");\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n            _optionSymbol = option.Symbol;\n\n            if (UniverseManager.TryGetValue(option.Symbol, out var universe)\n                && (universe.Configuration.Resolution != Resolution.Daily || universe.UniverseSettings.Resolution != Resolution.Daily))\n            {\n                throw new RegressionTestException(\"Unexpected universe resolution configuration!\");\n            }\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Right)\n                        .FirstOrDefault();\n\n                    if (atmContract != null)\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4294;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2a63ba11c7395ae4f7b710aa3a64c71a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the margin call events are fired when trading options\n    /// </summary>\n    public class OptionShortCallMarginCallEventsAlgorithm : OptionsMarginCallEventsAlgorithmBase\n    {\n        private Symbol _optionSymbol;\n\n        protected override int OriginalQuantity => -10;\n        protected override int ExpectedOrdersCount => 2;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 30);\n            SetCash(160000);\n\n            var equitySymbol = AddEquity(\"GOOG\").Symbol;\n\n            var option = AddOption(equitySymbol);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2)\n                .Expiration(0, 180));\n\n            Portfolio.MarginCallModel = new CustomMarginCallModel(Portfolio, DefaultOrderProperties);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderByDescending(x => x.Strike)\n                        .ToList();\n\n                    MarketOrder(callContracts[0].Symbol, OriginalQuantity);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 46957;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.07%\"},\n            {\"Compounding Annual Return\", \"9.935%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"160000\"},\n            {\"End Equity\", \"160332.5\"},\n            {\"Net Profit\", \"0.208%\"},\n            {\"Sharpe Ratio\", \"5.427\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.221%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.067\"},\n            {\"Beta\", \"-0.023\"},\n            {\"Annual Standard Deviation\", \"0.012\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.089\"},\n            {\"Tracking Error\", \"0.088\"},\n            {\"Treynor Ratio\", \"-2.981\"},\n            {\"Total Fees\", \"$7.50\"},\n            {\"Estimated Strategy Capacity\", \"$66000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"039fb1adfb5366ea629e3f5e0646ab8b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionSplitRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is an option split regression algorithm\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    public class OptionSplitRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            // this test opens position in the first day of trading, lives through stock split (7 for 1), and closes adjusted position on the second day\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n            SetCash(1000000);\n\n            var option = AddOption(\"AAPL\");\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.IncludeWeeklys()\n                       .Strikes(-2, +2)\n                       .Expiration(TimeSpan.Zero, TimeSpan.FromDays(365 * 2)));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"AAPL\");\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (Time.Hour > 9 && Time.Minute > 0)\n                {\n                    OptionChain chain;\n                    if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                    {\n                        var contract =\n                            chain.OrderBy(x => x.Expiry)\n                            .Where(x => x.Right == OptionRight.Call && x.Strike == 650)\n                            .Skip(1)\n                            .FirstOrDefault();\n\n                        if (contract != null)\n                        {\n                            Buy(contract.Symbol, 1);\n                        }\n                    }\n                }\n            }\n            else\n            {\n                if (Time.Day > 6 && Time.Hour > 14 && Time.Minute > 0)\n                {\n                    Liquidate();\n                }\n            }\n\n            if (Portfolio.Invested)\n            {\n                var holdings = Portfolio.Securities.Where(x => x.Value.Holdings.AbsoluteQuantity != 0).First().Value.Holdings.AbsoluteQuantity;\n\n                if (Time.Day == 6 && holdings != 1)\n                {\n                    throw new RegressionTestException($\"Expected position quantity of 1 but was {holdings.ToStringInvariant()}\");\n                }\n                if (Time.Day == 9 && holdings != 7)\n                {\n                    throw new RegressionTestException($\"Expected position quantity of 7 but was {holdings.ToStringInvariant()}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 124202;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.02%\"},\n            {\"Compounding Annual Return\", \"-1.512%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999833\"},\n            {\"Net Profit\", \"-0.017%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-19.236\"},\n            {\"Tracking Error\", \"0.147\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$88000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL VRCWOCTRVDJA|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.04%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"6753be1c117f9528f920eb84976a070f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionSplitWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This is an option split warmup regression algorithm\n    /// Asserts that splits during warmup while holding an option contract does not throw an exception\n    /// </summary>\n    public class OptionSplitWarmupRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _gotSplitEvent;\n        private Security _optionContract;\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 09);\n            SetEndDate(2014, 06, 09);\n\n            var option = AddOption(\"AAPL\");\n            option.SetFilter(u => u.StandardsOnly().Strikes(-1, 1).Expiration(0, 35));\n            _optionSymbol = option.Symbol;\n\n            var optionContractSymbol = OptionChain(_optionSymbol)\n                .Where(contractData => contractData.ID.Date - Time <= TimeSpan.FromDays(10))\n                .OrderByDescending(x => x.ID.Date)\n                .First();\n\n            _optionContract = AddOptionContract(optionContractSymbol);\n            _optionContract.Holdings.SetHoldings(100, 10);\n            SetWarmup(4);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp)\n            {\n                _gotSplitEvent |= slice.Splits.Any(s => s.Value.Symbol == \"AAPL\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_gotSplitEvent)\n            {\n                throw new RegressionTestException(\"Split didn't happen during warmup!\");\n            }\n            if (_optionContract.Holdings.Quantity != 10)\n            {\n                throw new RegressionTestException(\"Unexpected option contract holdings!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 29166;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"123025\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFactoryMethodsBaseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This base algorithm demonstrates how to use OptionStrategies helper class to batch send orders for common strategies.\n    /// </summary>\n    public abstract class OptionStrategyFactoryMethodsBaseAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected Symbol _optionSymbol { get; set; }\n\n        protected abstract int ExpectedOrdersCount { get; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(1000000);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n\n            SetBenchmark(\"GOOG\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    TradeStrategy(chain);\n                }\n            }\n            else\n            {\n                // Verify that the strategy was traded\n                var positionGroup = Portfolio.Positions.Groups.Single();\n\n                var buyingPowerModel = positionGroup.BuyingPowerModel as OptionStrategyPositionGroupBuyingPowerModel;\n                if (buyingPowerModel == null)\n                {\n                    throw new RegressionTestException($@\"Expected position group buying power model type: {nameof(OptionStrategyPositionGroupBuyingPowerModel)}. Actual: {positionGroup.BuyingPowerModel.GetType()}\");\n                }\n\n                AssertStrategyPositionGroup(positionGroup);\n\n                // Now we should be able to close the position\n                LiquidateStrategy();\n\n                // We can quit now, no more testing required\n                Quit();\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Expected no holdings at end of algorithm\");\n            }\n\n            var ordersCount = Transactions.GetOrders((order) => order.Status == OrderStatus.Filled).Count();\n            if (ordersCount != ExpectedOrdersCount)\n            {\n                throw new RegressionTestException($@\"Expected {ExpectedOrdersCount} orders to have been submitted and filled, half for buying the strategy and the other half for the liquidation. Actual {ordersCount}\");\n            }\n        }\n\n        protected abstract void TradeStrategy(OptionChain chain);\n\n        protected abstract void AssertStrategyPositionGroup(IPositionGroup positionGroup);\n\n        protected abstract void LiquidateStrategy();\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public abstract bool CanRunLocally { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public abstract List<Language> Languages { get; }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public abstract long DataPoints { get; }\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public abstract int AlgorithmHistoryDataPoints { get; }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseBaseAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base class for equity option strategy filter universe regression algorithms which holds some basic shared setup logic\n    /// </summary>\n    public abstract class OptionStrategyFilteringUniverseBaseAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// The filter function\n        /// </summary>\n        protected Func<OptionFilterUniverse, OptionFilterUniverse> FilterFunc { get; set; }\n\n        /// <summary>\n        /// The option symbol\n        /// </summary>\n        protected Symbol OptionSymbol { get; set; }\n\n        /// <summary>\n        /// Expected data count\n        /// </summary>\n        protected int ExpectedCount { get; set; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(200000);\n\n            var equity = AddEquity(\"GOOG\", leverage: 4);\n            var option = AddOption(equity.Symbol);\n            OptionSymbol = option.Symbol;\n\n            // set our strategy filter for this option chain\n            option.SetFilter(FilterFunc);\n        }\n\n        protected void AssertOptionStrategyIsPresent(string name, int? quantity = null)\n        {\n            if (Portfolio.Positions.Groups.Where(group => group.BuyingPowerModel is OptionStrategyPositionGroupBuyingPowerModel)\n                .Count(group => ((OptionStrategyPositionGroupBuyingPowerModel)@group.BuyingPowerModel).ToString() == name\n                    && (!quantity.HasValue || Math.Abs(group.Quantity) == quantity)) != 1)\n            {\n                throw new RegressionTestException($\"Option strategy: '{name}' was not found!\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(OptionSymbol, out chain) && chain.Any())\n                {\n                    TestFiltering(chain);\n                }\n            }\n        }\n\n        protected abstract void TestFiltering(OptionChain chain);\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new List<Language> { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Box Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().BoxSpread(28, 5);\n            ExpectedCount = 4;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var higherStrike = 752.50m;\n            var lowerStrike = 742.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var otmCall = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var itmCall = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Call &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            var itmPut = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var otmPut = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            if (itmCall == null || otmCall == null || itmPut == null || otmPut == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.BoxSpread(OptionSymbol, higherStrike, lowerStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(itmCall.Symbol, +1);\n            MarketOrder(otmCall.Symbol, -1);\n            MarketOrder(itmPut.Symbol, +1);\n            MarketOrder(otmPut.Symbol, -1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BoxSpread.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 6324;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199341\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$3600000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPQ5YXFD2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"3.66%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b8f487d284100b6fe8cf84b0bcbd5941\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Call Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().CallButterfly(28, 5);\n            ExpectedCount = 3;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Call;\n            var otmStrike = 752.50m;\n            var atmStrike = 747.50m;\n            var itmStrike = 742.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var otmContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == otmStrike &&\n                x.Expiry == expiry\n            );\n            var atmContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == atmStrike &&\n                x.Expiry == expiry\n            );\n            var itmContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == itmStrike &&\n                x.Expiry == expiry\n            );\n            if (otmContract == null || atmContract == null || itmContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.CallButterfly(OptionSymbol, otmStrike, atmStrike, itmStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(otmContract.Symbol, +1);\n            MarketOrder(atmContract.Symbol, -2);\n            MarketOrder(itmContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyCall.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5903;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199296.7\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.30\"},\n            {\"Estimated Strategy Capacity\", \"$4000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7FVK9Q8A51I|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"3.86%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8588e9d994886ac2d6118ec7bd99a37b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseCallCalendarSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Call Calendar Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseCallCalendarSpreadRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().CallCalendarSpread(0, 28, 42);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Call;\n            var strike = 747.50m;\n            var nearExpiry = new DateTime(2016, 1, 22);\n            var farExpiry = new DateTime(2016, 2, 5);\n\n            var nearExpiryContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == nearExpiry\n            );\n            var farExpiryContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == farExpiry\n            );\n            if (nearExpiryContract == null || farExpiryContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.CallCalendarSpread(OptionSymbol, strike, nearExpiry, farExpiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(nearExpiryContract.Symbol, -1);\n            MarketOrder(farExpiryContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.CallCalendarSpread.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5410;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199623\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$1700000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7TNTL2V1FRA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.58%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"89f5088049017cdefcda5b924f142ce6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Call Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().CallLadder(28, 5, 0, -10);\n            ExpectedCount = 3;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Call;\n            var higherStrike = 752.50m;\n            var middleStrike = 747.50m;\n            var lowerStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var higherStrikeContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var middleStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == middleStrike &&\n                x.Expiry == expiry\n            );\n            var lowerStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            if (higherStrikeContract == null || middleStrikeContract == null || lowerStrikeContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.BullCallLadder(OptionSymbol, lowerStrike, middleStrike, higherStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(higherStrikeContract.Symbol, -1);\n            MarketOrder(middleStrikeContract.Symbol, -1);\n            MarketOrder(lowerStrikeContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallLadder.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5903;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199512\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$11000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7FVKA6RNLZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.97%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a6e4aef493f4429caa9e7495e944a77a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Call Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().CallSpread(28, 5, -10);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Call;\n            var higherStrike = 752.50m;\n            var lowerStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var higherStrikeContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var lowerStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            if (higherStrikeContract == null || lowerStrikeContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.BullCallSpread(OptionSymbol, lowerStrike, higherStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(higherStrikeContract.Symbol, -1);\n            MarketOrder(lowerStrikeContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullCallSpread.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199643\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$10000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7FVKA6RNLZA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.09%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0e99ad3d24cce65429344fcbc810923d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Conversion type option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseConversionRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().Conversion(28, -5);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var strike = 742.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var callContract = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            var putContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            if (callContract == null || putContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.Conversion(OptionSymbol, strike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(putContract.Symbol, -1);\n            MarketOrder(chain.Underlying.Symbol, -1 * Securities[_optionSymbol].SymbolProperties.ContractMultiplier);\n            MarketOrder(callContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Conversion.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199559\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$15000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7FVK9Q8A51I|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"39.39%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c5615899d622d94d8b1d8a8a416977f6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Iron Condor option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().IronCondor(28, 5, 10);\n            ExpectedCount = 4;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var farCallStrike = 757.50m;\n            var nearCallStrike = 752.50m;\n            var nearPutStrike = 742.50m;\n            var farPutStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var farCall = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == farCallStrike &&\n                x.Expiry == expiry\n            );\n            var nearCall = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Call &&\n                x.Strike == nearCallStrike &&\n                x.Expiry == expiry\n            );\n            var nearPut = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == nearPutStrike &&\n                x.Expiry == expiry\n            );\n            var farPut = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == farPutStrike &&\n                x.Expiry == expiry\n            );\n            if (farCall == null || nearCall == null || nearPut == null || farPut == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.IronCondor(OptionSymbol, farPutStrike, nearPutStrike, nearCallStrike, farCallStrike, expiry);\n            Buy(strategy, 1);\n            \n            /* we can obtain the same result from market orders\n            MarketOrder(farCall.Symbol, +1);\n            MarketOrder(nearCall.Symbol, -1);\n            MarketOrder(nearPut.Symbol, -1);\n            MarketOrder(farPut.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.IronCondor.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 6324;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199661\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$3400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPH5V7YE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.76%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8a30c50c7eb8b1b63067a6c17481ea9f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Jelly Roll option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().JellyRoll(0, 28, 42);\n            ExpectedCount = 4;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var strike = 747.50m;\n            var nearExpiry = new DateTime(2016, 1, 22);\n            var farExpiry = new DateTime(2016, 2, 5);\n\n            var nearCallExpiryContract = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == strike &&\n                x.Expiry == nearExpiry\n            );\n            var farCallExpiryContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Call &&\n                x.Strike == strike &&\n                x.Expiry == farExpiry\n            );\n            var nearPutExpiryContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == strike &&\n                x.Expiry == nearExpiry\n            );\n            var farPutExpiryContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == strike &&\n                x.Expiry == farExpiry\n            );\n            if (nearCallExpiryContract == null || farCallExpiryContract == null || nearPutExpiryContract == null || farPutExpiryContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.JellyRoll(OptionSymbol, strike, nearExpiry, farExpiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(nearCallExpiryContract.Symbol, -1);\n            MarketOrder(farCallExpiryContract.Symbol, +1);\n            MarketOrder(farPutExpiryContract.Symbol, -1);\n            MarketOrder(nearPutExpiryContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.JellyRoll.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 6041;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199291\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$3200000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7TNTL2V1FRA|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.92%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"7f6c8cf903d0982b244c4c7fc55f9941\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Protective Collar option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().ProtectiveCollar(28, 10, 5);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var callStrike = 757.50m;\n            var putStrike = 752.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var callContract = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == callStrike &&\n                x.Expiry == expiry\n            );\n            var putContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == putStrike &&\n                x.Expiry == expiry\n            );\n            if (callContract == null || putContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.ProtectiveCollar(OptionSymbol, callStrike, putStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(putContract.Symbol, +1);\n            MarketOrder(chain.Underlying.Symbol, +1 * Securities[_optionSymbol].SymbolProperties.ContractMultiplier);\n            MarketOrder(callContract.Symbol, -1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ProtectiveCollar.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199644\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$38000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPQ5YXFD2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"39.24%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"92255bb1d24205b620441d2bb1f21f04\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Put Butterfly option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().PutButterfly(28, 5);\n            ExpectedCount = 3;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Put;\n            var otmStrike = 742.50m;\n            var atmStrike = 747.50m;\n            var itmStrike = 752.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var otmContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == otmStrike &&\n                x.Expiry == expiry\n            );\n            var atmContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == atmStrike &&\n                x.Expiry == expiry\n            );\n            var itmContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == itmStrike &&\n                x.Expiry == expiry\n            );\n            if (otmContract == null || atmContract == null || itmContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.PutButterfly(OptionSymbol, itmStrike, atmStrike, otmStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(otmContract.Symbol, +1);\n            MarketOrder(atmContract.Symbol, -2);\n            MarketOrder(itmContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.ButterflyPut.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5903;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199351.7\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.30\"},\n            {\"Estimated Strategy Capacity\", \"$3400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPQ5YXFD2|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"3.43%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f7baa1f5e8b8a9f59563487c1cdd08fa\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniversePutCalendarSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Put Calendar Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniversePutCalendarSpreadRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().PutCalendarSpread(0, 28, 42);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Put;\n            var strike = 747.50m;\n            var nearExpiry = new DateTime(2016, 1, 22);\n            var farExpiry = new DateTime(2016, 2, 5);\n\n            var nearExpiryContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == nearExpiry\n            );\n            var farExpiryContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == farExpiry\n            );\n            if (nearExpiryContract == null || farExpiryContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.PutCalendarSpread(OptionSymbol, strike, nearExpiry, farExpiry);\n            Buy(strategy, 1);\n            \n            /* we can obtain the same result from market orders\n            MarketOrder(nearExpiryContract.Symbol, -1);\n            MarketOrder(farExpiryContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.PutCalendarSpread.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5271;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199608\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$9100000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPXP8OW6|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.36%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e7c580fc19e2cc545c96277031b9d9ed\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniversePutLadderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Put Ladder option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniversePutLadderRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().PutLadder(28, 5, -5, -10);\n            ExpectedCount = 3;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Put;\n            var higherStrike = 752.50m;\n            var middleStrike = 742.50m;\n            var lowerStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var higherStrikeContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var middleStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == middleStrike &&\n                x.Expiry == expiry\n            );\n            var lowerStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            if (higherStrikeContract == null || middleStrikeContract == null || lowerStrikeContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.BullPutLadder(OptionSymbol, higherStrike, middleStrike, lowerStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(higherStrikeContract.Symbol, -1);\n            MarketOrder(middleStrikeContract.Symbol, +1);\n            MarketOrder(lowerStrikeContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullPutLadder.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5903;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199492\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$2900000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPH5V7YE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2.43%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e8cbf8de4fe77a51f7b09c123d865d09\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniversePutSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Put Spread option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniversePutSpreadRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().PutSpread(28, 5, -10);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Put;\n            var higherStrike = 752.50m;\n            var lowerStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var higherStrikeContract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == higherStrike &&\n                x.Expiry == expiry\n            );\n            var lowerStrikeContract = chain.SingleOrDefault(x =>\n                x.Right == right &&\n                x.Strike == lowerStrike &&\n                x.Expiry == expiry\n            );\n            if (higherStrikeContract == null || lowerStrikeContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.BullPutSpread(OptionSymbol, higherStrike, lowerStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(lowerStrikeContract.Symbol, +1);\n            MarketOrder(higherStrikeContract.Symbol, -1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.BullPutSpread.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199638\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$1900000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPH5V7YE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.60%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4631d091180d27a2eaa4cdc06c6f4044\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseSingleCallRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Naked Call option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseSingleCallRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().NakedCall(28, 0);\n            ExpectedCount = 1;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Call;\n            var strike = 747.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var contract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            if (contract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.NakedCall(OptionSymbol, strike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(contract.Symbol, -1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedCall.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5061;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199869\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$9500000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W7FVK9YHYVIE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"0.87%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"50acbede042747f30c4fe8cae47a84c0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseSinglePutRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Naked Put option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseSinglePutRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().NakedPut(28, 0);\n            ExpectedCount = 1;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var right = OptionRight.Put;\n            var strike = 747.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var contract = chain.SingleOrDefault(x => \n                x.Right == right &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            if (contract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.NakedPut(OptionSymbol, strike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(contract.Symbol, -1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.NakedPut.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5061;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199809\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$8100000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPXP8OW6|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"0.77%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c16233245f4266df677d9bf5d0ec2e43\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseStraddleRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Straddle option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseStraddleRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().Straddle(28);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var strike = 747.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var callContract = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            var putContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == strike &&\n                x.Expiry == expiry\n            );\n            if (callContract == null || putContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.Straddle(OptionSymbol, strike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(callContract.Symbol, +1);\n            MarketOrder(putContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Straddle.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199628\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$2400000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPXP8OW6|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.99%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"cb036434acd9a61cb85bd4b2b5671b79\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm of filtering with Strangle option strategy and asserting it's being detected by Lean and works as expected\n    /// </summary>\n    public class OptionStrategyFilteringUniverseStrangleRegressionAlgorithm : OptionStrategyFilteringUniverseBaseAlgorithm\n    {\n        public override void Initialize()\n        {\n            FilterFunc = u => u.IncludeWeeklys().Strangle(28, 5, -10);\n            ExpectedCount = 2;\n\n            base.Initialize();\n        }\n\n        protected override void TestFiltering(OptionChain chain)\n        {\n            var count = chain.Count();\n            if (count != ExpectedCount)\n            {\n                throw new RegressionTestException($\"Number of contract returned does not match expectation, {count}, {ExpectedCount}\");\n            }\n\n            var callStrike = 752.50m;\n            var putStrike = 737.50m;\n            var expiry = new DateTime(2016, 1, 22);\n\n            var callContract = chain.SingleOrDefault(x => \n                x.Right == OptionRight.Call &&\n                x.Strike == callStrike &&\n                x.Expiry == expiry\n            );\n            var putContract = chain.SingleOrDefault(x =>\n                x.Right == OptionRight.Put &&\n                x.Strike == putStrike &&\n                x.Expiry == expiry\n            );\n            if (callContract == null || putContract == null)\n            {\n                throw new RegressionTestException($\"No contract returned match condition\");\n            }\n\n            var strategy = OptionStrategies.Strangle(OptionSymbol, callStrike, putStrike, expiry);\n            Buy(strategy, 1);\n\n            /* we can obtain the same result from market orders\n            MarketOrder(putContract.Symbol, +1);\n            MarketOrder(callContract.Symbol, +1);\n            */\n\n            AssertOptionStrategyIsPresent(OptionStrategyDefinitions.Strangle.Name, 1);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5482;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200000\"},\n            {\"End Equity\", \"199653\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$2000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306JVPPH5V7YE|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.64%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e0599c7737867243d62b3b3311535842\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionStrategyMarginCallEventsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the margin call events are fired when trading options strategies\n    /// </summary>\n    public class OptionStrategyMarginCallEventsAlgorithm : OptionsMarginCallEventsAlgorithmBase\n    {\n        private Symbol _optionSymbol;\n        private OptionStrategy _optionStrategy;\n\n        protected override int OriginalQuantity => -50;\n        protected override int ExpectedOrdersCount => 4;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 30);\n            // -50 of a straddle will use almost all of 900k, so will eventually trigger margin call\n            SetCash(900000);\n\n            var equity = AddEquity(\"GOOG\");\n            var option = AddOption(equity.Symbol);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.Strikes(-2, +2)\n                .Expiration(0, 180));\n\n            Portfolio.MarginCallModel = new CustomMarginCallModel(Portfolio, DefaultOrderProperties);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderByDescending(x => x.Strike)\n                        .ToList();\n\n                    var expiry = callContracts[0].Expiry;\n                    var strike = callContracts[0].Strike;\n\n                    _optionStrategy = OptionStrategies.Straddle(_optionSymbol, strike, expiry);\n                    Order(_optionStrategy, OriginalQuantity);\n                }\n            }\n        }\n\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            base.OnMarginCall(requests);\n\n            var positionGroup = Portfolio.Positions.Groups.Single();\n            foreach (var request in requests)\n            {\n                var position = positionGroup.GetPosition(request.Symbol);\n                // We expect the margin call to be for one unit of the strategy in the opposite direction\n                var expectedQuantity = -Math.Sign(position.Quantity) * 1;\n                if (request.Quantity != expectedQuantity)\n                {\n                    throw new RegressionTestException($\"Expected margin call order quantity to be {expectedQuantity} but was {request.Quantity}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 3132879;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-4.893%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Net Profit\", \"-0.092%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.681\"},\n            {\"Tracking Error\", \"0.092\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1252.00\"},\n            {\"Estimated Strategy Capacity\", \"$130000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.17%\"},\n            {\"OrderListHash\", \"681be68373c2f38e51456d7f8010e7d3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionSymbolCanonicalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test asserting behavior of <see cref=\"Symbol.Canonical\"/>\n    /// </summary>\n    public class OptionSymbolCanonicalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionContract;\n        private Symbol _canonicalOptionContract;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n\n            var equitySymbol = AddEquity(\"TWX\").Symbol;\n            var contracts = OptionChain(equitySymbol).ToList();\n\n            var callOptionSymbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Call)\n                .OrderBy(c => c.ID.Date)\n                .First();\n            _optionContract = AddOptionContract(callOptionSymbol).Symbol;\n            _canonicalOptionContract = _optionContract.Canonical;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!ReferenceEquals(_canonicalOptionContract, _optionContract.Canonical))\n            {\n                throw new RegressionTestException(\"Canonical Symbol reference changed!\");\n            }\n\n            _canonicalOptionContract = _optionContract.Canonical;\n            if (slice.OptionChains.ContainsKey(_optionContract.Canonical))\n            {\n                var chain = slice.OptionChains[_optionContract.Canonical];\n                if (!Portfolio.Invested)\n                {\n                    MarketOrder(_optionContract, 1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4713;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-11.148%\"},\n            {\"Drawdown\", \"0.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99849\"},\n            {\"Net Profit\", \"-0.151%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.639\"},\n            {\"Tracking Error\", \"0.037\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$5700000.00\"},\n            {\"Lowest Capacity Asset\", \"AOL VRKS95ENPM9Y|AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.59%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4351c4e0db0da9c6c9e032a08ee861ff\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionTimeSliceRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test time slice irregularities when adding options\n    /// after algorithm initialization\n    /// </summary>\n    public class OptionTimeSliceRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private Symbol _optionSymbol;\n        private DateTime _lastSliceTime = DateTime.MinValue;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 9);\n\n            var aapl = AddEquity(\"aapl\", Resolution.Minute);\n            aapl.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            _symbol = aapl.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Compare our previous slice time to this slice\n            // Because of issues with Delisting data we have to let Auxiliary data pass through GH #5207\n            if (Time.Ticks - _lastSliceTime.Ticks < 1000 && slice.Values.Any(x => x.DataType != MarketDataType.Auxiliary))\n            {\n                throw new RegressionTestException($\"Emitted two slices within 1000 ticks of each other.\");\n            }\n\n            // Store our slice time\n            _lastSliceTime = Time;\n\n            var underlyingPrice = Securities[_symbol].Price;\n            var contractSymbol = OptionChain(_symbol)\n                .Where(x => x.ID.StrikePrice - underlyingPrice > 0)\n                .OrderBy(x => x.ID.Date)\n                .FirstOrDefault();\n\n            if (contractSymbol != null)\n            {\n                _optionSymbol = AddOptionContract(contractSymbol).Symbol;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_optionSymbol == null)\n            {\n                throw new RegressionTestException(\"No option symbol was added!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10869;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 788;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n\n"
  },
  {
    "path": "Algorithm.CSharp/OptionUniverseFilterGreeksRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the option universe filter by greeks and other options data feature\n    /// </summary>\n    public class OptionUniverseFilterGreeksRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n        private bool _optionChainReceived;\n\n        protected decimal MinDelta { get; set; }\n        protected decimal MaxDelta { get; set; }\n        protected decimal MinGamma { get; set; }\n        protected decimal MaxGamma { get; set; }\n        protected decimal MinVega { get; set; }\n        protected decimal MaxVega { get; set; }\n        protected decimal MinTheta { get; set; }\n        protected decimal MaxTheta { get; set; }\n        protected decimal MinRho { get; set; }\n        protected decimal MaxRho { get; set; }\n        protected decimal MinIv { get; set; }\n        protected decimal MaxIv { get; set; }\n        protected long MinOpenInterest { get; set; }\n        protected long MaxOpenInterest { get; set; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            AddEquity(UnderlyingTicker);\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            MinDelta = 0.5m;\n            MaxDelta = 1.5m;\n            MinGamma = 0.0001m;\n            MaxGamma = 0.0006m;\n            MinVega = 0.01m;\n            MaxVega = 1.5m;\n            MinTheta = -730m;\n            MaxTheta = -182.5m;\n            MinRho = 0.5m;\n            MaxRho = 3.0m;\n            MinIv = 1.0m;\n            MaxIv = 3.0m;\n            MinOpenInterest = 100;\n            MaxOpenInterest = 500;\n\n            option.SetFilter(u =>\n            {\n                var totalContracts = u.Count();\n\n                var filteredUniverse = OptionFilter(u);\n                var filteredContracts = filteredUniverse.Count();\n\n                if (filteredContracts == totalContracts)\n                {\n                    throw new RegressionTestException($\"Expected filtered universe to have less contracts than original universe.\" +\n                        $\"Filtered contracts count ({filteredContracts}) is equal to total contracts count ({totalContracts})\");\n                }\n\n                return filteredUniverse;\n            });\n        }\n\n        protected virtual OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)\n        {\n            // Contracts can be filtered by greeks, implied volatility, open interest:\n            return universe\n                .Delta(MinDelta, MaxDelta)\n                .Gamma(MinGamma, MaxGamma)\n                .Vega(MinVega, MaxVega)\n                .Theta(MinTheta, MaxTheta)\n                .Rho(MinRho, MaxRho)\n                .ImpliedVolatility(MinIv, MaxIv)\n                .OpenInterest(MinOpenInterest, MaxOpenInterest);\n\n            // Note: there are also shortcuts for these filter methods:\n            /*\n            return u => universe\n                .D(MinDelta, MaxDelta)\n                .G(MinGamma, MaxGamma)\n                .V(MinVega, MaxVega)\n                .T(MinTheta, MaxTheta)\n                .R(MinRho, MaxRho)\n                .IV(MinIv, MaxIv)\n                .OI(MinOpenInterest, MaxOpenInterest);\n            */\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain) && chain.Contracts.Count > 0)\n            {\n                Log($\"[{Time}] :: Received option chain with {chain.Contracts.Count} contracts\");\n                _optionChainReceived = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_optionChainReceived)\n            {\n                throw new RegressionTestException(\"Option chain was not received.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7113;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionUniverseFilterGreeksShortcutsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the option universe filter by greeks and other options data feature\n    /// </summary>\n    public class OptionUniverseFilterGreeksShortcutsRegressionAlgorithm : OptionUniverseFilterGreeksRegressionAlgorithm\n    {\n        protected override OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)\n        {\n            // Contracts can be filtered by greeks, implied volatility, open interest:\n            return universe\n                .D(MinDelta, MaxDelta)\n                .G(MinGamma, MaxGamma)\n                .V(MinVega, MaxVega)\n                .T(MinTheta, MaxTheta)\n                .R(MinRho, MaxRho)\n                .IV(MinIv, MaxIv)\n                .OI(MinOpenInterest, MaxOpenInterest);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7113;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing static QuantConnect.Securities.OptionFilterUniverseEx;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the option universe filter feature that allows accessing the option universe data,\n    /// including greeks, open interest and implied volatility, and filtering the contracts based on this data, in a Linq fashion.\n    /// </summary>\n    public class OptionUniverseFilterOptionsDataLinqRegressionAlgorithm : OptionUniverseFilterGreeksRegressionAlgorithm\n    {\n        protected override OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)\n        {\n            // The filter used for the option security will be equivalent to the following commented one below,\n            // but it is more flexible and allows for more complex filtering:\n\n            // return universe\n            //    .Delta(MinDelta, MaxDelta)\n            //    .Gamma(MinGamma, MaxGamma)\n            //    .Vega(MinVega, MaxVega)\n            //    .Theta(MinTheta, MaxTheta)\n            //    .Rho(MinRho, MaxRho)\n            //    .ImpliedVolatility(MinIv, MaxIv)\n            //    .OpenInterest(MinOpenInterest, MaxOpenInterest);\n\n            return universe\n                // This requires the following using statement in order to avoid ambiguity with the System.Linq namespace:\n                // using static QuantConnect.Securities.OptionFilterUniverseEx;\n                .Where(contractData =>\n                {\n                    // The contracts received here will already be filtered by the strikes and expirations,\n                    // since those filters where applied before this one.\n\n                    // Can access the contract data here and do some filtering based on it is needed:\n                    var greeks = contractData.Greeks;\n                    var iv = contractData.ImpliedVolatility;\n                    var openInterest = contractData.OpenInterest;\n\n                    // More complex math can be done here for filtering, but will be simple here for demonstration sake:\n                    return greeks.Delta > MinDelta && greeks.Delta < MaxDelta &&\n                        greeks.Gamma > MinGamma && greeks.Gamma < MaxGamma &&\n                        greeks.Vega > MinVega && greeks.Vega < MaxVega &&\n                        greeks.Theta > MinTheta && greeks.Theta < MaxTheta &&\n                        greeks.Rho > MinRho && greeks.Rho < MaxRho &&\n                        iv > MinIv && iv < MaxIv &&\n                        openInterest > MinOpenInterest && openInterest < MaxOpenInterest;\n                })\n                .Select(contractData =>\n                {\n                    // Can also select the contracts here, returning a different or mapped one if needed (e.g. the mirror contract call <-> put):\n                    return contractData.Symbol;\n                });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionUniverseFilterOptionsDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm demonstrating the option universe filter feature that allows accessing the option universe data,\n    /// including greeks, open interest and implied volatility, and filtering the contracts based on this data.\n    /// </summary>\n    public class OptionUniverseFilterOptionsDataRegressionAlgorithm : OptionUniverseFilterGreeksRegressionAlgorithm\n    {\n        protected override OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)\n        {\n            // The filter used for the option security will be equivalent to the following commented one below,\n            // but it is more flexible and allows for more complex filtering:\n\n            //return universe\n            //    .Delta(MinDelta, MaxDelta)\n            //    .Gamma(MinGamma, MaxGamma)\n            //    .Vega(MinVega, MaxVega)\n            //    .Theta(MinTheta, MaxTheta)\n            //    .Rho(MinRho, MaxRho)\n            //    .ImpliedVolatility(MinIv, MaxIv)\n            //    .OpenInterest(MinOpenInterest, MaxOpenInterest);\n\n            return universe.Contracts(contracts =>\n            {\n                // These contracts list will already be filtered by the strikes and expirations,\n                // since those filters where applied before this one.\n\n                return contracts\n                    .Where(contract =>\n                    {\n                        // Can access the contract data here and do some filtering based on it is needed:\n                        var greeks = contract.Greeks;\n                        var iv = contract.ImpliedVolatility;\n                        var openInterest = contract.OpenInterest;\n\n                        // More complex math can be done here for filtering, but will be simple here for demonstration sake:\n                        return greeks.Delta > MinDelta && greeks.Delta < MaxDelta &&\n                            greeks.Gamma > MinGamma && greeks.Gamma < MaxGamma &&\n                            greeks.Vega > MinVega && greeks.Vega < MaxVega &&\n                            greeks.Theta > MinTheta && greeks.Theta < MaxTheta &&\n                            greeks.Rho > MinRho && greeks.Rho < MaxRho &&\n                            iv > MinIv && iv < MaxIv &&\n                            openInterest > MinOpenInterest && openInterest < MaxOpenInterest;\n                    })\n                    .Select(contract => contract.Symbol);\n            });\n        }\n\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionUniverseHistoryRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing history requests for <see cref=\"OptionUniverse\"/> type work as expected\n    /// and return the same data as the option chain provider.\n    /// </summary>\n    public class OptionUniverseHistoryRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 25);\n            SetEndDate(2015, 12, 25);\n\n            var option = AddOption(\"GOOG\").Symbol;\n\n            var historicalOptionsData = History<OptionUniverse>(option, 3, Resolution.Daily).ToList();\n\n            if (historicalOptionsData.Count != 3)\n            {\n                throw new RegressionTestException($\"Expected 3 option chains from history request, but got {historicalOptionsData.Count}\");\n            }\n\n            foreach (var historyOptionUniverse in historicalOptionsData)\n            {\n                var date = historyOptionUniverse.EndTime;\n                var chain = OptionChainProvider.GetOptionContractList(option, date).ToList();\n\n                if (chain.Count == 0)\n                {\n                    throw new RegressionTestException($\"No options in chain on {date}\");\n                }\n\n                if (chain.Count != historyOptionUniverse.Data.Count)\n                {\n                    throw new RegressionTestException($\"Expected {chain.Count} options in chain on {date}, but got {historyOptionUniverse.Data.Count}\");\n                }\n\n                for (var i = 0; i < chain.Count; i++)\n                {\n                    if (historyOptionUniverse.Data[i].Symbol != chain[i])\n                    {\n                        throw new RegressionTestException($\"Missing option contract {chain[i]} on {date}\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2021;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 6;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionsAutomaticSeedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that option contracts added via universe selection get automatically seeded by default\n    /// </summary>\n    public class OptionsAutomaticSeedRegressionAlgorithm : AutomaticSeedBaseRegressionAlgorithm\n    {\n        private bool _contractsAdded;\n\n        protected override bool ShouldHaveTradeData => true;\n        protected override bool ShouldHaveQuoteData => true;\n        protected override bool ShouldHaveOpenInterestData => true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 28);\n            SetEndDate(2015, 12, 28);\n            SetCash(100000);\n\n            Settings.SeedInitialPrices = true;\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            var equity = AddEquity(\"GOOG\");\n\n            // This security should haven been seeded right away\n            if (!equity.HasData || equity.Price == 0)\n            {\n                throw new RegressionTestException(\"Equity security was not seeded\");\n            }\n\n            var option = AddOption(equity.Symbol);\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.TimeOfDay.Hours > 12)\n            {\n                var anotherEquity = AddEquity(\"SPY\", Resolution.Daily);\n\n                // This security should haven been seeded right away\n                if (!anotherEquity.HasData || anotherEquity.Price == 0)\n                {\n                    throw new RegressionTestException(\"Equity security was not seeded\");\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(changes);\n\n            if (!_contractsAdded)\n            {\n                foreach (var addedSecurity in changes.AddedSecurities)\n                {\n                    // Just making sure we had the data to select and seed options\n                    _contractsAdded |= addedSecurity.Symbol.SecurityType == SecurityType.Option;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_contractsAdded)\n            {\n                throw new RegressionTestException(\"No option contracts were added\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 4044;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 218;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionsExpiredContractRegression.cs",
    "content": "/* \n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test if expired options contracts chains are making their\n    /// way into the timeslices being delivered to OnData()\n    /// </summary>\n    public class OptionsExpiredContractRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _receivedData;\n\n        /// <summary>\n        /// Initializes the algorithm state.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2016, 1, 20);\n            SetCash(1000000);\n\n            // Subscribe to GOOG Options\n            var option = AddOption(\"GOOG\");\n            option.SetFilter(x => x.StandardsOnly().CallsOnly().Strikes(0, 1).Expiration(0, 30));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var chain in slice.OptionChains)\n            {\n                _receivedData = true;\n\n                foreach (var contract in chain.Value.OrderBy(x => x.Expiry))\n                {\n                    if (contract.Expiry.Date < Time.Date)\n                    {\n                        throw new RegressionTestException($\"Received expired contract {contract} expired: {contract.Expiry} current time: {Time}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedData)\n            {\n                throw new RegressionTestException(\"No Options chains were received in this regression\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 29379;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1000000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"3.945\"},\n            {\"Tracking Error\", \"0.152\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OptionsMarginCallEventsAlgorithmBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Base algorithm to assert that the margin call events are fired when trading options\n    /// </summary>\n    public abstract class OptionsMarginCallEventsAlgorithmBase : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _onMarginCallWarningCount;\n        private int _onMarginCallCount;\n        private bool _firstOrderEventReceived;\n\n        protected abstract int OriginalQuantity { get; }\n\n        protected abstract int ExpectedOrdersCount { get; }\n\n        public override void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            Debug($\"OnMarginCall at {Time}\");\n            _onMarginCallCount++;\n        }\n\n        public override void OnMarginCallWarning()\n        {\n            Debug($\"OnMarginCallWarning at {Time}\");\n            _onMarginCallWarningCount++;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled && !_firstOrderEventReceived)\n            {\n                _firstOrderEventReceived = true;\n                // Make sure the algorithms implementing this class place orders with the expected quantity for\n                // the check in the OnEndOfAlgorithm method to be accurate.\n                if (orderEvent.Quantity != OriginalQuantity)\n                {\n                    throw new RegressionTestException($\"Expected order quantity to be {OriginalQuantity} but was {orderEvent.Quantity}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Portfolio should be invested\");\n            }\n\n            if (_onMarginCallCount != 1)\n            {\n                throw new RegressionTestException($\"OnMarginCall was called {_onMarginCallCount} times, expected 1\");\n            }\n\n            if (_onMarginCallWarningCount == 0)\n            {\n                throw new RegressionTestException(\"OnMarginCallWarning was not called\");\n            }\n\n            var orders = Transactions.GetOrders().ToList();\n            if (orders.Count != ExpectedOrdersCount)\n            {\n                throw new RegressionTestException($\"Expected {ExpectedOrdersCount} orders, found {orders.Count}\");\n            }\n\n            if (orders.Any(order => !order.Status.IsFill()))\n            {\n                throw new RegressionTestException(\"All orders should be filled\");\n            }\n\n            var finalStrategyQuantity = Portfolio.Positions.Groups.First().Quantity;\n            if (Math.Abs(OriginalQuantity) <= Math.Abs(finalStrategyQuantity))\n            {\n                throw new RegressionTestException($@\"Strategy position group quantity should have been decreased from the original quantity {OriginalQuantity\n                    }, but was {finalStrategyQuantity}\");\n            }\n        }\n\n        protected class CustomMarginCallModel : DefaultMarginCallModel\n        {\n            // Setting margin buffer to 0 so we make sure the margin call orders are generated. Otherwise, they will only\n            // be generated if the used margin is > 110%TVP, which is unlikely for this case\n            public CustomMarginCallModel(SecurityPortfolioManager portfolio, IOrderProperties defaultOrderProperties)\n                : base(portfolio, defaultOrderProperties, 0m)\n            {\n            }\n        }\n\n        public abstract bool CanRunLocally { get; }\n        public abstract List<Language> Languages { get; }\n        public abstract long DataPoints { get; }\n        public abstract int AlgorithmHistoryDataPoints { get; }\n        public abstract AlgorithmStatus AlgorithmStatus { get; }\n        public abstract Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OrderImmutabilityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests that orders are unchangeable from the QCAlgorithm Layer\n    /// Orders should only be modifiable via their ticket and only in permitted ways\n    /// </summary>\n    /// <meta name=\"tag\" content=\"backtesting brokerage\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    /// <meta name=\"tag\" content=\"options\" />\n    public class OrderImmutabilityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private OrderTicket _ticket;\n        private Order _originalOrder;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 09);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                _ticket = LimitOrder(_spy, 10, 100);\n                Debug(\"Purchased Stock\");\n\n                // Here we will show how to correctly change an order, we will then verify at End of Algorithm!\n                // First get the order as it is now, should be a copy, so it wont be updated!\n                _originalOrder = Transactions.GetOrderById(_ticket.OrderId);\n\n                // Create an UpdateOrderRequest and send it to the ticket\n                var updateFields = new UpdateOrderFields { Quantity = 20, Tag = \"Pepe\", LimitPrice = slice[_spy].Low};\n                var response = _ticket.Update(updateFields);\n\n                // Test order time\n                if (_originalOrder.Time != UtcTime)\n                {\n                    Error(\"Order Time should be UtcTime!\");\n                    throw new RegressionTestException(\"Order Time should be UtcTime!\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// All order events get pushed through this function\n        /// This function will test that what we get from Transactions is indeed a clone\n        /// The only authentic way to change the order is to change through the order ticket!\n        /// </summary>\n        /// <param name=\"orderEvent\">OrderEvent object that contains all the information about the event</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n\n            // Get the order twice, since they are clones they should NOT be the same\n            var orderV1 = Transactions.GetOrderById(orderEvent.OrderId);\n            var orderV2 = Transactions.GetOrderById(orderEvent.OrderId);\n\n            if (orderV1 == orderV2)\n            {\n                Error(\"Orders should be clones, hence not equal!\");\n                throw new RegressionTestException(\"Orders should be clones, hence not equal!\");\n            }\n\n            // Try and manipulate orderV2 using the only external accessor BrokerID, since we\n            // are changing a clone the BrokerIDs should not be the same\n            orderV2.BrokerId.Add(\"FAKE BROKER ID\");\n            var orderV3 = Transactions.GetOrderById(orderEvent.OrderId);\n\n            if (orderV2.BrokerId.SequenceEqual(orderV3.BrokerId))\n            {\n                Error(\"Broker IDs should not be the same!\");\n                throw new RegressionTestException(\"Broker IDs should not be the same!\");\n            }\n\n            //Try and manipulate the orderV1 using UpdateOrderRequest\n            //NOTICE: Orders should only be updated through their tickets!\n            var updateFields = new UpdateOrderFields { Quantity = 99, Tag = \"Pepe2!\" };\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderEvent.OrderId, updateFields);\n            orderV1.ApplyUpdateOrderRequest(updateRequest);\n            var orderV4 = Transactions.GetOrderById(orderEvent.OrderId);\n\n            if (orderV4.Quantity == orderV1.Quantity)\n            {\n                Error(\"Order quantity should not be the same!\");\n                throw new RegressionTestException(\"Order quantity should not be the same!\");\n            }\n\n            if (orderV4.Tag == orderV1.Tag)\n            {\n                Error(\"Order tag should not be the same!\");\n                throw new RegressionTestException(\"Order tag should not be the same!\");\n            }\n        }\n\n        /// <summary>\n        /// Will run at End of Algorithm\n        /// We will be using this to check our order was updated!\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            //Get an updated copy of the order and compare to our original\n            var updatedOrder = Transactions.GetOrderById(_ticket.OrderId);\n\n            if (updatedOrder.Quantity == _originalOrder.Quantity)\n            {\n                Error(\"Quantities should have been updated!\");\n                throw new RegressionTestException(\"Quantities should have been updated!\");\n            }\n\n            if (updatedOrder.Tag == _originalOrder.Tag)\n            {\n                Error(\"Tag should have been updated!\");\n                throw new RegressionTestException(\"Tag should have been updated!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 32;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-4.030%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99969.95\"},\n            {\"Net Profit\", \"-0.030%\"},\n            {\"Sharpe Ratio\", \"-11.996\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.024\"},\n            {\"Beta\", \"0.027\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.399\"},\n            {\"Tracking Error\", \"0.132\"},\n            {\"Treynor Ratio\", \"-1.634\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$25000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.96%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"711cbe45c5d704f02f5b1107de9bc5d8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OrderSubmissionDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// </summary>\n    public class OrderSubmissionDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<string, OrderSubmissionData> _orderSubmissionData = new Dictionary<string, OrderSubmissionData>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            \n            AddEquity(\"SPY\");\n            AddForex(\"EURUSD\", Resolution.Hour);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Noon, () =>\n            {\n                Liquidate();\n                foreach (var ticker in new[] {\"SPY\", \"EURUSD\"})\n                {\n                    PlaceTrade(ticker);\n                }\n            });\n        }\n        private void PlaceTrade(string ticker)\n        {\n            var ticket = MarketOrder(ticker, 1000);\n            var order = Transactions.GetOrderById(ticket.OrderId);\n            var data = order.OrderSubmissionData;\n            if (data == null || data.AskPrice == 0 || data.BidPrice == 0 || data.LastPrice == 0)\n            {\n                throw new RegressionTestException(\"Invalid Order Submission data detected\");\n            }\n\n            if (_orderSubmissionData.ContainsKey(ticker))\n            {\n                var previous = _orderSubmissionData[ticker];\n                if (previous.AskPrice == data.AskPrice || previous.BidPrice == data.BidPrice || previous.LastPrice == data.LastPrice)\n                {\n                    throw new RegressionTestException(\"Order Submission data didn't change\");\n                }\n            }\n            _orderSubmissionData[ticker] = data;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10708;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"18\"},\n            {\"Average Win\", \"0.83%\"},\n            {\"Average Loss\", \"-0.90%\"},\n            {\"Compounding Annual Return\", \"273.871%\"},\n            {\"Drawdown\", \"3.200%\"},\n            {\"Expectancy\", \"0.203\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"101715.67\"},\n            {\"Net Profit\", \"1.716%\"},\n            {\"Sharpe Ratio\", \"11.391\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.016%\"},\n            {\"Loss Rate\", \"38%\"},\n            {\"Win Rate\", \"62%\"},\n            {\"Profit-Loss Ratio\", \"0.93\"},\n            {\"Alpha\", \"0.82\"},\n            {\"Beta\", \"1.464\"},\n            {\"Annual Standard Deviation\", \"0.326\"},\n            {\"Annual Variance\", \"0.106\"},\n            {\"Information Ratio\", \"16.804\"},\n            {\"Tracking Error\", \"0.103\"},\n            {\"Treynor Ratio\", \"2.535\"},\n            {\"Total Fees\", \"$45.00\"},\n            {\"Estimated Strategy Capacity\", \"$20000000.00\"},\n            {\"Lowest Capacity Asset\", \"EURUSD 8G\"},\n            {\"Portfolio Turnover\", \"264.72%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"705cad7cbcf7fc0d38367dbaad3556f5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OrderTicketAssignmentDemoAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration on how to access order tickets right after placing an order.\n    /// </summary>\n    public class OrderTicketAssignmentDemoAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n\n        private OrderTicket _ticket;\n\n        private int _tradeCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n\n            Consolidate(_symbol, TimeSpan.FromHours(1), (TradeBar bar) =>\n            {\n                // Reset _ticket to null on each new bar\n                _ticket = null;\n                _ticket = MarketOrder(_symbol, 1, asynchronous: true);\n                Debug($\"{Time}: Buy: Price {bar.Price}, orderId: {_ticket.OrderId}\");\n                _tradeCount++;\n            });\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // We cannot access _ticket directly because it is assigned asynchronously:\n            // this order event could be triggered before _ticket is assigned.\n            var ticket = orderEvent.Ticket;\n            if (ticket == null)\n            {\n                throw new RegressionTestException(\"Expected order ticket in order event to not be null\");\n            }\n            if (orderEvent.Status == OrderStatus.Submitted && _ticket != null)\n            {\n                throw new RegressionTestException(\"Field _ticket not expected no be assigned on the first order event\");\n            }\n\n            Debug(ticket.ToString());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Just checking that orders were placed\n            if (!Portfolio.Invested || _tradeCount != Transactions.OrdersCount)\n            {\n                throw new RegressionTestException($\"Expected the portfolio to have holdings and to have {_tradeCount} trades, but had {Transactions.OrdersCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"35\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"3.632%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100045.62\"},\n            {\"Net Profit\", \"0.046%\"},\n            {\"Sharpe Ratio\", \"4.618\"},\n            {\"Sortino Ratio\", \"13.697\"},\n            {\"Probabilistic Sharpe Ratio\", \"73.517%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.025\"},\n            {\"Beta\", \"0.027\"},\n            {\"Annual Standard Deviation\", \"0.006\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.991\"},\n            {\"Tracking Error\", \"0.217\"},\n            {\"Treynor Ratio\", \"1.042\"},\n            {\"Total Fees\", \"$34.00\"},\n            {\"Estimated Strategy Capacity\", \"$36000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.99%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"ac3803a8abaf1d1e77e009c418ba68e2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/OrderTicketDemoAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we submit/update/cancel each order type\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"managing orders\" />\n    /// <meta name=\"tag\" content=\"order tickets\" />\n    /// <meta name=\"tag\" content=\"updating orders\" />\n    public class OrderTicketDemoAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string symbol = \"SPY\";\n        private readonly List<OrderTicket> _openMarketOnOpenOrders = new List<OrderTicket>();\n        private readonly List<OrderTicket> _openMarketOnCloseOrders = new List<OrderTicket>();\n        private readonly List<OrderTicket> _openLimitOrders = new List<OrderTicket>();\n        private readonly List<OrderTicket> _openStopMarketOrders = new List<OrderTicket>();\n        private readonly List<OrderTicket> _openStopLimitOrders = new List<OrderTicket>();\n        private readonly List<OrderTicket> _openTrailingStopOrders = new List<OrderTicket>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // MARKET ORDERS\n\n            MarketOrders();\n\n            // LIMIT ORDERS\n\n            LimitOrders();\n\n            // STOP MARKET ORDERS\n\n            StopMarketOrders();\n\n            // STOP LIMIT ORDERS\n\n            StopLimitOrders();\n\n            // TRAILING STOP ORDERS\n\n            TrailingStopOrders();\n\n            // MARKET ON OPEN ORDERS\n\n            MarketOnOpenOrders();\n\n            // MARKET ON CLOSE ORDERS\n\n            MarketOnCloseOrders();\n        }\n\n        /// <summary>\n        /// MarketOrders are the only orders that are processed synchronously by default, so\n        /// they'll fill by the next line of code. This behavior equally applies to live mode.\n        /// You can opt out of this behavior by specifying the 'asynchronous' parameter as true.\n        /// </summary>\n        private void MarketOrders()\n        {\n            if (TimeIs(7, 9, 31))\n            {\n                Log(\"Submitting MarketOrder\");\n\n                // submit a market order to buy 10 shares, this function returns an OrderTicket object\n                // we submit the order with asynchronous:false, so it block until it is filled\n                var newTicket = MarketOrder(symbol, 10, asynchronous: false);\n                if (newTicket.Status != OrderStatus.Filled)\n                {\n                    Log(\"Synchronous market order was not filled synchronously!\");\n                    Quit();\n                }\n\n                // we can also submit the ticket asynchronously. In a backtest, we'll still perform\n                // the fill before the next time events for your algorithm. here we'll submit the order\n                // asynchronously and try to cancel it, sometimes it will, sometimes it will be filled\n                // first.\n                newTicket = MarketOrder(symbol, 10, asynchronous: true);\n                var response = newTicket.Cancel(\"Attempt to cancel async order\");\n                if (response.IsSuccess)\n                {\n                    Log(\"Successfully canceled async market order: \" + newTicket.OrderId);\n                }\n                else\n                {\n                    Log(\"Unable to cancel async market order: \" + response.ErrorCode);\n                }\n            }\n        }\n\n        /// <summary>\n        /// LimitOrders are always processed asynchronously. Limit orders are used to\n        /// set 'good' entry points for an order. For example, you may wish to go\n        /// long a stock, but want a good price, so can place a LimitOrder to buy with\n        /// a limit price below the current market price. Likewise the opposite is true\n        /// when selling, you can place a LimitOrder to sell with a limit price above the\n        /// current market price to get a better sale price.\n        /// You can submit requests to update or cancel the LimitOrder at any time.\n        /// The 'LimitPrice' for an order can be retrieved from the ticket using the\n        /// OrderTicket.Get(OrderField) method, for example:\n        /// <code>\n        /// var currentLimitPrice = orderTicket.Get(OrderField.LimitPrice);\n        /// </code>\n        /// </summary>\n        private void LimitOrders()\n        {\n            if (TimeIs(7, 12, 0))\n            {\n                Log(\"Submitting LimitOrder\");\n\n                // submit a limit order to buy 10 shares at .1% below the bar's close\n                var close = Securities[symbol].Close;\n                var newTicket = LimitOrder(symbol, 10, close * .999m);\n                _openLimitOrders.Add(newTicket);\n\n                // submit another limit order to sell 10 shares at .1% above the bar's close\n                newTicket = LimitOrder(symbol, -10, close * 1.001m);\n                _openLimitOrders.Add(newTicket);\n            }\n\n            // when we submitted new limit orders we placed them into this list,\n            // so while there's two entries they're still open and need processing\n            if (_openLimitOrders.Count == 2)\n            {\n                var openOrders = _openLimitOrders;\n\n                // check if either is filled and cancel the other\n                var longOrder = openOrders[0];\n                var shortOrder = openOrders[1];\n                if (CheckPairOrdersForFills(longOrder, shortOrder))\n                {\n                    _openLimitOrders.Clear();\n                    return;\n                }\n\n                // if neither order has filled, bring in the limits by a penny\n\n                var newLongLimit = longOrder.Get(OrderField.LimitPrice) + 0.01m;\n                var newShortLimit = shortOrder.Get(OrderField.LimitPrice) - 0.01m;\n                Log($\"Updating limits - Long: {newLongLimit.ToStringInvariant(\"0.00\")} Short: {newShortLimit.ToStringInvariant(\"0.00\")}\");\n\n                longOrder.Update(new UpdateOrderFields\n                {\n                    // we could change the quantity, but need to specify it\n                    //Quantity =\n                    LimitPrice = newLongLimit,\n                    Tag = \"Update #\" + (longOrder.UpdateRequests.Count + 1)\n                });\n                shortOrder.Update(new UpdateOrderFields\n                {\n                    LimitPrice = newShortLimit,\n                    Tag = \"Update #\" + (shortOrder.UpdateRequests.Count + 1)\n                });\n            }\n        }\n\n        /// <summary>\n        /// StopMarketOrders work in the opposite way that limit orders do.\n        /// When placing a long trade, the stop price must be above current\n        /// market price. In this way it's a 'stop loss' for a short trade.\n        /// When placing a short trade, the stop price must be below current\n        /// market price. In this way it's a 'stop loss' for a long trade.\n        /// You can submit requests to update or cancel the StopMarketOrder at any time.\n        /// The 'StopPrice' for an order can be retrieved from the ticket using the\n        /// OrderTicket.Get(OrderField) method, for example:\n        /// <code>\n        /// var currentStopPrice = orderTicket.Get(OrderField.StopPrice);\n        /// </code>\n        /// </summary>\n        private void StopMarketOrders()\n        {\n            if (TimeIs(7, 12 + 4, 0))\n            {\n                Log(\"Submitting StopMarketOrder\");\n\n                // a long stop is triggered when the price rises above the value\n                // so we'll set a long stop .25% above the current bar's close\n\n                var close = Securities[symbol].Close;\n                var stopPrice = close * 1.0025m;\n                var newTicket = StopMarketOrder(symbol, 10, stopPrice);\n                _openStopMarketOrders.Add(newTicket);\n\n                // a short stop is triggered when the price falls below the value\n                // so we'll set a short stop .25% below the current bar's close\n\n                stopPrice = close * .9975m;\n                newTicket = StopMarketOrder(symbol, -10, stopPrice);\n                _openStopMarketOrders.Add(newTicket);\n            }\n\n            // when we submitted new stop market orders we placed them into this list,\n            // so while there's two entries they're still open and need processing\n            if (_openStopMarketOrders.Count == 2)\n            {\n                // check if either is filled and cancel the other\n                var longOrder = _openStopMarketOrders[0];\n                var shortOrder = _openStopMarketOrders[1];\n                if (CheckPairOrdersForFills(longOrder, shortOrder))\n                {\n                    _openStopMarketOrders.Clear();\n                    return;\n                }\n\n                // if neither order has filled, bring in the stops by a penny\n\n                var newLongStop = longOrder.Get(OrderField.StopPrice) - 0.01m;\n                var newShortStop = shortOrder.Get(OrderField.StopPrice) + 0.01m;\n                Log($\"Updating stops - Long: {newLongStop.ToStringInvariant(\"0.00\")} Short: {newShortStop.ToStringInvariant(\"0.00\")}\");\n\n                longOrder.Update(new UpdateOrderFields\n                {\n                    // we could change the quantity, but need to specify it\n                    //Quantity =\n                    StopPrice = newLongStop,\n                    Tag = \"Update #\" + (longOrder.UpdateRequests.Count + 1)\n                });\n                shortOrder.Update(new UpdateOrderFields\n                {\n                    StopPrice = newShortStop,\n                    Tag = \"Update #\" + (shortOrder.UpdateRequests.Count + 1)\n                });\n            }\n        }\n\n        /// <summary>\n        /// StopLimitOrders work as a combined stop and limit order. First, the\n        /// price must pass the stop price in the same way a StopMarketOrder works,\n        /// but then we're also guaranteed a fill price at least as good as the\n        /// limit price. This order type can be beneficial in gap down scenarios\n        /// where a StopMarketOrder would have triggered and given the not as beneficial\n        /// gapped down price, whereas the StopLimitOrder could protect you from\n        /// getting the gapped down price through prudent placement of the limit price.\n        /// You can submit requests to update or cancel the StopLimitOrder at any time.\n        /// The 'StopPrice' or 'LimitPrice' for an order can be retrieved from the ticket\n        /// using the OrderTicket.Get(OrderField) method, for example:\n        /// <code>\n        /// var currentStopPrice = orderTicket.Get(OrderField.StopPrice);\n        /// var currentLimitPrice = orderTicket.Get(OrderField.LimitPrice);\n        /// </code>\n        /// </summary>\n        private void StopLimitOrders()\n        {\n            if (TimeIs(8, 12, 1))\n            {\n                Log(\"Submitting StopLimitOrder\");\n\n                // a long stop is triggered when the price rises above the value\n                // so we'll set a long stop .25% above the current bar's close\n                // now we'll also be setting a limit, this means we are guaranteed\n                // to get at least the limit price for our fills, so make the limit\n                // price a little softer than the stop price\n\n                var close = Securities[symbol].Close;\n                var stopPrice = close * 1.001m;\n                var limitPrice = close - 0.03m;\n                var newTicket = StopLimitOrder(symbol, 10, stopPrice, limitPrice);\n                _openStopLimitOrders.Add(newTicket);\n\n                // a short stop is triggered when the price falls below the value\n                // so we'll set a short stop .25% below the current bar's close\n                // now we'll also be setting a limit, this means we are guaranteed\n                // to get at least the limit price for our fills, so make the limit\n                // price a little softer than the stop price\n\n                stopPrice = close * .999m;\n                limitPrice = close + 0.03m;\n                newTicket = StopLimitOrder(symbol, -10, stopPrice, limitPrice);\n                _openStopLimitOrders.Add(newTicket);\n            }\n\n            // when we submitted new stop limit orders we placed them into this list,\n            // so while there's two entries they're still open and need processing\n            if (_openStopLimitOrders.Count == 2)\n            {\n                // check if either is filled and cancel the other\n                var longOrder = _openStopLimitOrders[0];\n                var shortOrder = _openStopLimitOrders[1];\n                if (CheckPairOrdersForFills(longOrder, shortOrder))\n                {\n                    _openStopLimitOrders.Clear();\n                    return;\n                }\n\n                // if neither order has filled, bring in the stops/limits in by a penny\n\n                var newLongStop = longOrder.Get(OrderField.StopPrice) - 0.01m;\n                var newLongLimit = longOrder.Get(OrderField.LimitPrice) + 0.01m;\n                var newShortStop = shortOrder.Get(OrderField.StopPrice) + 0.01m;\n                var newShortLimit = shortOrder.Get(OrderField.LimitPrice) - 0.01m;\n                Log($\"Updating stops  - Long: {newLongStop.ToStringInvariant(\"0.00\")} Short: {newShortStop.ToStringInvariant(\"0.00\")}\");\n                Log($\"Updating limits - Long: {newLongLimit.ToStringInvariant(\"0.00\")} Short: {newShortLimit.ToStringInvariant(\"0.00\")}\");\n\n                longOrder.Update(new UpdateOrderFields\n                {\n                    // we could change the quantity, but need to specify it\n                    //Quantity =\n                    StopPrice = newLongStop,\n                    LimitPrice = newLongLimit,\n                    Tag = \"Update #\" + (longOrder.UpdateRequests.Count + 1)\n                });\n                shortOrder.Update(new UpdateOrderFields\n                {\n                    StopPrice = newShortStop,\n                    LimitPrice = newShortLimit,\n                    Tag = \"Update #\" + (shortOrder.UpdateRequests.Count + 1)\n                });\n            }\n        }\n\n        /// <summary>\n        /// TrailingStopOrders work the same way as StopMarketOrders, except\n        /// their stop price is adjusted to a certain amount, keeping it a certain\n        /// fixed distance from/to the market price, depending on the order direction,\n        /// which allows to preserve profits and protecting against losses.\n        /// The stop price can be accessed just as with StopMarketOrders, and\n        /// the trailing amount can be accessed with the OrderTicket.Get(OrderField), for example:\n        /// <code>\n        /// var currentTrailingAmount = orderTicket.Get(OrderField.StopPrice);\n        /// var trailingAsPercentage = orderTicket.Get<bool>(OrderField.TrailingAsPercentage);\n        /// </code>\n        /// </summary>\n        private void TrailingStopOrders()\n        {\n            if (TimeIs(7, 12, 0))\n            {\n                Log(\"Submitting TrailingStopOrder\");\n\n                // a long stop is triggered when the price rises above the value\n                // so we'll set a long stop .25% above the current bar's close\n\n                var close = Securities[symbol].Close;\n                var stopPrice = close * 1.0025m;\n                var newTicket = TrailingStopOrder(symbol, 10, stopPrice, trailingAmount: 0.0025m, trailingAsPercentage: true);\n                _openTrailingStopOrders.Add(newTicket);\n\n                // a short stop is triggered when the price falls below the value\n                // so we'll set a short stop .25% below the current bar's close\n\n                stopPrice = close * .9975m;\n                newTicket = TrailingStopOrder(symbol, -10, stopPrice, trailingAmount: 0.0025m, trailingAsPercentage: true);\n                _openTrailingStopOrders.Add(newTicket);\n            }\n\n            // when we submitted new stop market orders we placed them into this list,\n            // so while there's two entries they're still open and need processing\n            else if (_openTrailingStopOrders.Count == 2)\n            {\n                // check if either is filled and cancel the other\n                var longOrder = _openTrailingStopOrders[0];\n                var shortOrder = _openTrailingStopOrders[1];\n                if (CheckPairOrdersForFills(longOrder, shortOrder))\n                {\n                    _openTrailingStopOrders.Clear();\n                    return;\n                }\n\n                // if neither order has filled in the last 5 minutes, bring in the trailing percentage by 0.01%\n                if ((UtcTime - longOrder.Time).TotalMinutes % 5 != 0)\n                {\n                    return;\n                }\n                var longTrailingPercentage = longOrder.Get(OrderField.TrailingAmount);\n                var newLongTrailingPercentage = Math.Max(longTrailingPercentage - 0.0001m, 0.0001m);\n                var shortTrailingPercentage = shortOrder.Get(OrderField.TrailingAmount);\n                var newShortTrailingPercentage = Math.Max(shortTrailingPercentage - 0.0001m, 0.0001m);\n                Log($\"Updating trailing percentages - Long: {newLongTrailingPercentage.ToStringInvariant(\"0.000\")} Short: {newShortTrailingPercentage.ToStringInvariant(\"0.000\")}\");\n\n                longOrder.Update(new UpdateOrderFields\n                {\n                    // we could change the quantity, but need to specify it\n                    //Quantity =\n                    TrailingAmount = newLongTrailingPercentage,\n                    Tag = \"Update #\" + (longOrder.UpdateRequests.Count + 1)\n                });\n                shortOrder.Update(new UpdateOrderFields\n                {\n                    TrailingAmount = newShortTrailingPercentage,\n                    Tag = \"Update #\" + (shortOrder.UpdateRequests.Count + 1)\n                });\n            }\n        }\n\n        /// <summary>\n        /// MarketOnCloseOrders are always executed at the next market's closing\n        /// price. The only properties that can be updated are the quantity and\n        /// order tag properties.\n        /// </summary>\n        private void MarketOnCloseOrders()\n        {\n            if (TimeIs(9, 12, 0))\n            {\n                Log(\"Submitting MarketOnCloseOrder\");\n\n                // open a new position or triple our existing position\n                var qty = Portfolio[symbol].Quantity;\n                qty = qty == 0 ? 100 : 2*qty;\n\n                var newTicket = MarketOnCloseOrder(symbol, qty);\n                _openMarketOnCloseOrders.Add(newTicket);\n            }\n\n            if (_openMarketOnCloseOrders.Count == 1 && Time.Minute == 59)\n            {\n                var ticket = _openMarketOnCloseOrders[0];\n                // check for fills\n                if (ticket.Status == OrderStatus.Filled)\n                {\n                    _openMarketOnCloseOrders.Clear();\n                    return;\n                }\n\n                var quantity = ticket.Quantity + 1;\n                Log(\"Updating quantity  - New Quantity: \" + quantity);\n\n                // we can update the quantity and tag\n                ticket.Update(new UpdateOrderFields\n                {\n                    Quantity = quantity,\n                    Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                });\n            }\n\n            if (TimeIs(EndDate.Day, 12 + 3, 45))\n            {\n                Log(\"Submitting MarketOnCloseOrder to liquidate end of algorithm\");\n\n                MarketOnCloseOrder(symbol, -Portfolio[symbol].Quantity, tag: \"Liquidate end of algorithm\");\n            }\n        }\n\n        /// <summary>\n        /// MarketOnOpenOrders are always executed at the next market's opening\n        /// price. The only properties that can be updated are the quantity and\n        /// order tag properties.\n        /// </summary>\n        private void MarketOnOpenOrders()\n        {\n            if (TimeIs(8, 14 + 2, 0))\n            {\n                Log(\"Submitting MarketOnOpenOrder\");\n\n                // its EOD, let's submit a market on open order to short even more!\n                var newTicket = MarketOnOpenOrder(symbol, 50);\n                _openMarketOnOpenOrders.Add(newTicket);\n            }\n\n            if (_openMarketOnOpenOrders.Count == 1 && Time.Minute == 59)\n            {\n                var ticket = _openMarketOnOpenOrders[0];\n\n                // check for fills\n                if (ticket.Status == OrderStatus.Filled)\n                {\n                    _openMarketOnOpenOrders.Clear();\n                    return;\n                }\n\n                var quantity = ticket.Quantity + 1;\n                Log(\"Updating quantity  - New Quantity: \" + quantity);\n\n                // we can update the quantity and tag\n                ticket.Update(new UpdateOrderFields\n                {\n                    Quantity = quantity,\n                    Tag = \"Update #\" + (ticket.UpdateRequests.Count + 1)\n                });\n            }\n\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            Log($\"{Time}: {order.Type}: {orderEvent}\");\n\n            if (orderEvent.Quantity == 0)\n            {\n                throw new RegressionTestException(\"OrderEvent quantity is Not expected to be 0, it should hold the current order Quantity\");\n            }\n            if (orderEvent.Quantity != order.Quantity)\n            {\n                throw new RegressionTestException(\"OrderEvent quantity should hold the current order Quantity\");\n            }\n            if (order is LimitOrder && orderEvent.LimitPrice == 0\n                || order is StopLimitOrder && orderEvent.LimitPrice == 0)\n            {\n                throw new RegressionTestException(\"OrderEvent LimitPrice is Not expected to be 0 for LimitOrder and StopLimitOrder\");\n            }\n            if (order is StopMarketOrder && orderEvent.StopPrice == 0)\n            {\n                throw new RegressionTestException(\"OrderEvent StopPrice is Not expected to be 0 for StopMarketOrder\");\n            }\n\n            // We can access the order ticket from the order event\n            if (orderEvent.Ticket == null)\n            {\n                throw new RegressionTestException(\"OrderEvent Ticket was not set\");\n            }\n            if (orderEvent.OrderId != orderEvent.Ticket.OrderId)\n            {\n                throw new RegressionTestException(\"OrderEvent.OrderId and orderEvent.Ticket.OrderId do not match\");\n            }\n        }\n\n        private bool CheckPairOrdersForFills(OrderTicket longOrder, OrderTicket shortOrder)\n        {\n            if (longOrder.Status == OrderStatus.Filled)\n            {\n                Log(shortOrder.OrderType + \": Cancelling short order, long order is filled.\");\n                shortOrder.Cancel(\"Long filled.\");\n                return true;\n            }\n            if (shortOrder.Status == OrderStatus.Filled)\n            {\n                Log(longOrder.OrderType + \": Cancelling long order, short order is filled.\");\n                longOrder.Cancel(\"Short filled\");\n                return true;\n            }\n            return false;\n        }\n\n        private bool TimeIs(int day, int hour, int minute)\n        {\n            return Time.Day == day && Time.Hour == hour && Time.Minute == minute;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Func<OrderTicket, bool> basicOrderTicketFilter = x => x.Symbol == symbol;\n\n            var filledOrders = Transactions.GetOrders(x => x.Status == OrderStatus.Filled);\n            var orderTickets = Transactions.GetOrderTickets(basicOrderTicketFilter);\n            var openOrders = Transactions.GetOpenOrders(x => x.Symbol == symbol);\n            var openOrderTickets = Transactions.GetOpenOrderTickets(basicOrderTicketFilter);\n            var remainingOpenOrders = Transactions.GetOpenOrdersRemainingQuantity(basicOrderTicketFilter);\n\n            if (filledOrders.Count() != 9 || orderTickets.Count() != 12)\n            {\n                throw new RegressionTestException($\"There were expected 9 filled orders and 12 order tickets\");\n            }\n            if (openOrders.Count != 0 || openOrderTickets.Any())\n            {\n                throw new RegressionTestException($\"No open orders or tickets were expected\");\n            }\n            if (remainingOpenOrders != 0m)\n            {\n                throw new RegressionTestException($\"No remaining quantity to be filled from open orders was expected\");\n            }\n\n            var symbolOpenOrders = Transactions.GetOpenOrders(symbol).Count;\n            var symbolOpenOrdersTickets = Transactions.GetOpenOrderTickets(symbol).Count();\n            var symbolOpenOrdersRemainingQuantity = Transactions.GetOpenOrdersRemainingQuantity(symbol);\n\n            if (symbolOpenOrders != 0 || symbolOpenOrdersTickets != 0)\n            {\n                throw new RegressionTestException($\"No open orders or tickets were expected\");\n            }\n            if (symbolOpenOrdersRemainingQuantity != 0)\n            {\n                throw new RegressionTestException($\"No remaining quantity to be filled from open orders was expected\");\n            }\n\n            var defaultOrders = Transactions.GetOrders();\n            var defaultOrderTickets = Transactions.GetOrderTickets();\n            var defaultOpenOrders = Transactions.GetOpenOrders();\n            var defaultOpenOrderTickets = Transactions.GetOpenOrderTickets();\n            var defaultOpenOrdersRemaining = Transactions.GetOpenOrdersRemainingQuantity();\n\n            if (defaultOrders.Count() != 12 || defaultOrderTickets.Count() != 12)\n            {\n                throw new RegressionTestException($\"There were expected 12 orders and 12 order tickets\");\n            }\n            if (defaultOpenOrders.Count != 0 || defaultOpenOrderTickets.Any())\n            {\n                throw new RegressionTestException($\"No open orders or tickets were expected\");\n            }\n            if (defaultOpenOrdersRemaining != 0m)\n            {\n                throw new RegressionTestException($\"No remaining quantity to be filled from open orders was expected\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"12\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"73.899%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100709.93\"},\n            {\"Net Profit\", \"0.710%\"},\n            {\"Sharpe Ratio\", \"12.469\"},\n            {\"Sortino Ratio\", \"429.347\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.495%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.188\"},\n            {\"Beta\", \"0.189\"},\n            {\"Annual Standard Deviation\", \"0.045\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-7.802\"},\n            {\"Tracking Error\", \"0.181\"},\n            {\"Treynor Ratio\", \"2.971\"},\n            {\"Total Fees\", \"$9.00\"},\n            {\"Estimated Strategy Capacity\", \"$50000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"7.01%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"236df5da8408fdd11445a88425ea9ab7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ParameterizedAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Parameters;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of the parameter system of QuantConnect. Using parameters you can pass the values required into C# algorithms for optimization.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"optimization\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    public class ParameterizedAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // We place attributes on top of our fields or properties that should receive\n        // their values from the job. The values 100 and 200 are just default values that\n        // are only used if the parameters do not exist.\n        [Parameter(\"ema-fast\")]\n        private int _fastPeriod = 100;\n\n        [Parameter(\"ema-slow\")]\n        private int _slowPeriod = 200;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100*1000);\n\n            AddSecurity(SecurityType.Equity, \"SPY\");\n\n            _fast = EMA(\"SPY\", _fastPeriod);\n            _slow = EMA(\"SPY\", _slowPeriod);\n        }\n\n        public override void OnData(Slice data)\n        {\n            // wait for our indicators to ready\n            if (!_fast.IsReady || !_slow.IsReady) return;\n\n            if (_fast > _slow*1.001m)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n            else if (_fast < _slow*0.999m)\n            {\n                Liquidate(\"SPY\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"286.047%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101742.04\"},\n            {\"Net Profit\", \"1.742%\"},\n            {\"Sharpe Ratio\", \"23.023\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.266\"},\n            {\"Beta\", \"0.356\"},\n            {\"Annual Standard Deviation\", \"0.086\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-0.044\"},\n            {\"Tracking Error\", \"0.147\"},\n            {\"Treynor Ratio\", \"5.531\"},\n            {\"Total Fees\", \"$3.45\"},\n            {\"Estimated Strategy Capacity\", \"$48000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.72%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1fd15c0ef2042df5cd6e6d590000318e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Framework algorithm that uses the <see cref=\"PearsonCorrelationPairsTradingAlphaModel\"/>.\n    /// This model extendes <see cref=\"BasePairsTradingAlphaModel\"/> and uses Pearson correlation\n    /// to rank the pairs trading candidates and use the best candidate to trade.\n    /// </summary>\n    public class PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var symbols = new[] { \"SPY\", \"AIG\", \"BAC\", \"IBM\" }\n                .Select(ticker => QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA))\n                .ToList();\n\n            // Manually add SPY and AIG when the algorithm starts\n            SetUniverseSelection(new ManualUniverseSelectionModel(symbols.Take(2)));\n\n            // At midnight, add all securities every day except on the last data\n            // With this procedure, the Alpha Model will experience multiple universe changes\n            AddUniverseSelection(new ScheduledUniverseSelectionModel(\n                DateRules.EveryDay(), TimeRules.Midnight,\n                dt => dt < EndDate.AddDays(-1) ? symbols : Enumerable.Empty<Symbol>()));\n\n            SetAlpha(new PearsonCorrelationPairsTradingAlphaModel(252, Resolution.Daily));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n            SetRiskManagement(new NullRiskManagementModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // We have removed all securities from the universe. The Alpha Model should remove the consolidator\n            var consolidatorCount = SubscriptionManager.Subscriptions.Sum(s => s.Consolidators.Count);\n            if (consolidatorCount > 0)\n            {\n                throw new RegressionTestException($\"The number of consolidator is should be zero. Actual: {consolidatorCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14089;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1008;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.99%\"},\n            {\"Average Loss\", \"-0.84%\"},\n            {\"Compounding Annual Return\", \"24.021%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0.089\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100295.35\"},\n            {\"Net Profit\", \"0.295%\"},\n            {\"Sharpe Ratio\", \"4.205\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"61.706%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.18\"},\n            {\"Alpha\", \"0.08\"},\n            {\"Beta\", \"0.06\"},\n            {\"Annual Standard Deviation\", \"0.047\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-8.305\"},\n            {\"Tracking Error\", \"0.214\"},\n            {\"Treynor Ratio\", \"3.313\"},\n            {\"Total Fees\", \"$31.60\"},\n            {\"Estimated Strategy Capacity\", \"$3200000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"80.47%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"476d54ac7295563a79add3a80310a0a8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for testing that period-based history requests are not allowed with tick resolution\n    /// </summary>\n    public class PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n\n            var spy = AddEquity(\"SPY\", Resolution.Tick).Symbol;\n\n            // Tick resolution is not allowed for period-based history requests\n            AssertThatHistoryThrowsForTickResolution(() => History<Tick>(spy, 1),\n                \"Tick history call with implicit tick resolution\");\n            AssertThatHistoryThrowsForTickResolution(() => History<Tick>(spy, 1, Resolution.Tick),\n                \"Tick history call with explicit tick resolution\");\n            AssertThatHistoryThrowsForTickResolution(() => History<Tick>(new [] { spy }, 1),\n                \"Tick history call with symbol array with implicit tick resolution\");\n            AssertThatHistoryThrowsForTickResolution(() => History<Tick>(new [] { spy }, 1, Resolution.Tick),\n                \"Tick history call with symbol array with explicit tick resolution\");\n\n            var history = History<Tick>(spy, TimeSpan.FromHours(12));\n            if (!history.Any())\n            {\n                throw new RegressionTestException(\"On history call with implicit tick resolution: history returned no results\");\n            }\n\n            history = History<Tick>(spy, TimeSpan.FromHours(12), Resolution.Tick);\n            if (!history.Any())\n            {\n                throw new RegressionTestException(\"On history call with explicit tick resolution: history returned no results\");\n            }\n\n            // We already tested what we wanted to test, we can quit now\n            Quit();\n        }\n\n        private void AssertThatHistoryThrowsForTickResolution(Action historyCall, string historyCallDescription)\n        {\n            try\n            {\n                historyCall();\n                throw new RegressionTestException($\"{historyCallDescription}: expected an exception to be thrown\");\n            }\n            catch (InvalidOperationException)\n            {\n                // expected\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 12;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PeriodConsolidatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of a period consolidator\n    /// </summary>\n    public class PeriodConsolidatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Queue<string> _periodConsolidation = new();\n        private Queue<string> _countConsolidation = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            \n            var symbol = AddEquity(\"SPY\").Symbol;\n\n            var periodConsolidator = new TradeBarConsolidator(Resolution.Minute.ToTimeSpan());\n            periodConsolidator.DataConsolidated += PeriodConsolidator_DataConsolidated;\n            var countConsolidator = new TradeBarConsolidator(1);\n            countConsolidator.DataConsolidated += CountConsolidator_DataConsolidated;\n\n            SubscriptionManager.AddConsolidator(symbol, periodConsolidator);\n            SubscriptionManager.AddConsolidator(symbol, countConsolidator);\n        }\n\n        private void PeriodConsolidator_DataConsolidated(object sender, TradeBar e)\n        {\n            _periodConsolidation.Enqueue($\"{Time} - {e.EndTime} {e}\");\n        }\n        private void CountConsolidator_DataConsolidated(object sender, TradeBar e)\n        {\n            _countConsolidation.Enqueue($\"{Time} - {e.EndTime} {e}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_countConsolidation.Count == 0 || _countConsolidation.Count != _periodConsolidation.Count)\n            {\n                throw new RegressionTestException($\"Unexpected consolidated data count. Period: {_periodConsolidation.Count} Count: {_countConsolidation.Count}\");\n            }\n\n            while (_countConsolidation.TryDequeue(out var countData))\n            {\n                var periodData = _periodConsolidation.Dequeue();\n                if (periodData != countData)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidated data. Period: '{periodData}' != Count: '{countData}'\");\n                }\n            }\n            _periodConsolidation.Clear();\n            _countConsolidation.Clear();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PersistentCustomDataUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Adds a universe with a custom data type and retrieves historical data \n    /// while preserving the custom data type.\n    /// </summary>\n    public class PersistentCustomDataUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _universeSymbol;\n        private bool _dataReceived;\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 6, 1);\n            SetEndDate(2018, 6, 19);\n\n            var universe = AddUniverse<StockDataSource>(\"my-stock-data-source\", Resolution.Daily, UniverseSelector);\n            _universeSymbol = universe.Symbol;\n            RetrieveHistoricalData();\n        }\n\n        private IEnumerable<Symbol> UniverseSelector(IEnumerable<BaseData> data)\n        {\n            foreach (var item in data.OfType<StockDataSource>())\n            {\n                yield return item.Symbol;\n            }\n        }\n\n        private void RetrieveHistoricalData()\n        {\n            var history = History<StockDataSource>(_universeSymbol, new DateTime(2018, 1, 1), new DateTime(2018, 6, 1), Resolution.Daily).ToList();\n            if (history.Count == 0)\n            {\n                throw new RegressionTestException($\"No historical data received for the symbol {_universeSymbol}.\");\n            }\n\n            // Ensure all values are of type StockDataSource\n            foreach (var item in history)\n            {\n                if (item is not StockDataSource)\n                {\n                    throw new RegressionTestException($\"Unexpected data type in history. Expected StockDataSource but received {item.GetType().Name}.\");\n                }\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.ContainsKey(_universeSymbol))\n            {\n                throw new RegressionTestException($\"No data received for the universe symbol: {_universeSymbol}.\");\n            }\n            if (!_dataReceived)\n            {\n                RetrieveHistoricalData();\n            }\n            _dataReceived = true;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_dataReceived)\n            {\n                throw new RegressionTestException(\"No data was received after the universe selection.\");\n            }\n        }\n\n\n        /// <summary>\n        /// Our custom data type that defines where to get and how to read our backtest and live data.\n        /// </summary>\n        public class StockDataSource : BaseData\n        {\n            public List<string> Symbols { get; set; }\n\n            public StockDataSource()\n            {\n                Symbols = new List<string>();\n            }\n\n            public override DateTime EndTime\n            {\n                get { return Time + Period; }\n                set { Time = value - Period; }\n            }\n\n            public TimeSpan Period\n            {\n                get { return QuantConnect.Time.OneDay; }\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = Path.Combine(\"..\", \"..\", \"..\", \"Tests\", \"TestData\", \"daily-stock-picker-backtest.csv\");\n                return new SubscriptionDataSource(source);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                if (string.IsNullOrWhiteSpace(line) || !char.IsDigit(line[0]))\n                {\n                    return null;\n                }\n\n                var stocks = new StockDataSource { Symbol = config.Symbol };\n\n                try\n                {\n                    var csv = line.ToCsv();\n                    stocks.Time = DateTime.ParseExact(csv[0], \"yyyyMMdd\", null);\n                    stocks.Symbols.AddRange(csv[1..]);\n                }\n                catch (FormatException)\n                {\n                    return null;\n                }\n\n                return stocks;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8767;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 298;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-3.9\"},\n            {\"Tracking Error\", \"0.045\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioOptimizationNumericsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing MathNet.Numerics.LinearAlgebra;\nusing MathNet.Numerics.Statistics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\nusing QuantConnect.Indicators;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm uses Math.NET Numerics library, specifically Linear Algebra object (Vector and Matrix) and operations, in order to solve a portfolio optimization problem.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"portfolio optimization\" />\n    public class PortfolioOptimizationNumericsAlgorithm : QCAlgorithm\n    {\n        private const double _targetReturn = 0.1;\n        private const double _riskFreeRate = 0.01;\n        private double _lagrangeMultiplier;\n        private double _portfolioRisk;\n        private Matrix<double> Sigma;\n        private List<SymbolData> SymbolDataList;\n\n        public Vector<double> DiscountMeanVector\n        {\n            get\n            {\n                if (SymbolDataList == null)\n                {\n                    return null;\n                }\n\n                return\n                    Vector<double>.Build.DenseOfArray(SymbolDataList.Select(x => (double)x.Return).ToArray()) -\n                    Vector<double>.Build.Dense(SymbolDataList.Count, _riskFreeRate);\n            }\n        }\n\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddEquity(\"SPY\", Resolution.Daily);\n            AddEquity(\"AIG\", Resolution.Daily);\n            AddEquity(\"BAC\", Resolution.Daily);\n            AddEquity(\"IBM\", Resolution.Daily);\n\n            var allHistoryBars = new List<double[]>();\n            SymbolDataList = new List<SymbolData>();\n\n            foreach (var security in Securities)\n            {\n                var history = History(security.Key, TimeSpan.FromDays(365));\n                allHistoryBars.Add(history.Select(x => (double)x.Value).ToArray());\n                SymbolDataList.Add(new SymbolData(security.Key, history));\n            }\n\n            // Diagonal Matrix with each security risk (standard deviation)\n            var S = Matrix<double>.Build.DenseOfDiagonalArray(SymbolDataList.Select(x => (double)x.Risk).ToArray());\n\n            // Computes Correlation Matrix (using Math.NET Numerics Statistics)\n            var R = MathNet.Numerics.Statistics.Correlation.PearsonMatrix(allHistoryBars);\n\n            // Computes Covariance Matrix (using Math.NET Numerics Linear Algebra)\n            Sigma = S * R * S;\n\n            ComputeLagrangeMultiplier();\n            ComputeWeights();\n            ComputePortfolioRisk();\n\n            Log($\"Lagrange Multiplier: {_lagrangeMultiplier.ToStringInvariant(\"7:F4\")}\");\n            Log($\"Portfolio Risk:      {_portfolioRisk.ToStringInvariant(\"7:P2\")} \");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                foreach (var symbolData in SymbolDataList.OrderBy(x => x.Weight))\n                {\n                    SetHoldings(symbolData.Symbol, symbolData.Weight);\n                    Debug(\"Purchased Stock: \" + symbolData);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Computes Lagrange Multiplier\n        /// </summary>\n        private void ComputeLagrangeMultiplier()\n        {\n            var denominatorMatrix = DiscountMeanVector * Sigma.Inverse() * DiscountMeanVector.ToColumnMatrix();\n\n            _lagrangeMultiplier = (_targetReturn - _riskFreeRate) / denominatorMatrix.ToArray().First();\n        }\n\n        /// <summary>\n        /// Computes weight for each risky asset\n        /// </summary>\n        private void ComputeWeights()\n        {\n            var weights = _lagrangeMultiplier * Sigma.Inverse() * DiscountMeanVector.ToColumnMatrix();\n\n            for (var i = 0; i < weights.RowCount; i++)\n            {\n                SymbolDataList[i].SetWeight(weights.ToArray()[i, 0]);\n            }\n        }\n\n        /// <summary>\n        /// Computes Portfolio Risk\n        /// </summary>\n        private void ComputePortfolioRisk()\n        {\n            var weights = Vector<double>.Build.DenseOfArray(SymbolDataList.Select(x => (double)x.Return).ToArray());\n            var portfolioVarianceMatrix = weights * Sigma * weights.ToColumnMatrix();\n            _portfolioRisk = Math.Sqrt(portfolioVarianceMatrix.ToArray().First());\n        }\n\n        /// <summary>\n        /// Symbol Data class to store security data (Return, Risk, Weight)\n        /// </summary>\n        class SymbolData\n        {\n            private RateOfChange ROC = new RateOfChange(2);\n            private SimpleMovingAverage SMA;\n            private StandardDeviation STD;\n            public Symbol Symbol { get; private set; }\n            public decimal Return { get { return SMA.Current; }  }\n            public decimal Risk { get { return STD.Current; } }\n            public decimal Weight { get; private set; }\n\n            public SymbolData(Symbol symbol, IEnumerable<BaseData> history)\n            {\n                Symbol = symbol;\n                SMA = new SimpleMovingAverage(365).Of(ROC);\n                STD = new StandardDeviation(365).Of(ROC);\n\n                foreach (var data in history)\n                {\n                    Update(data);\n                }\n            }\n\n            public void Update(BaseData data)\n            {\n                ROC.Update(data.Time, data.Value);\n            }\n\n            public void SetWeight(double value)\n            {\n                Weight = (decimal)value;\n            }\n\n            public override string ToString()\n            {\n                return Invariant($\"{Symbol.Value}: {Weight,10:P2}\\t{Return,10:P2}\\t{Risk,10:P2}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing portfolio construction model control over rebalancing,\n    /// specifying a custom rebalance function that returns null in some cases, see GH 4075.\n    /// </summary>\n    public class PortfolioRebalanceOnCustomFuncRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _lastRebalanceTime;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2015, 1, 1);\n            SetEndDate(2018, 1, 1);\n\n            Settings.RebalancePortfolioOnInsightChanges = false;\n            Settings.RebalancePortfolioOnSecurityChanges = false;\n\n            SetUniverseSelection(new CustomUniverseSelectionModel(\"CustomUniverseSelectionModel\",\n                time => new List<string> { \"AAPL\", \"IBM\", \"FB\", \"SPY\", \"AIG\", \"BAC\", \"BNO\" }\n            ));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(\n                time =>\n                {\n                    // for performance only run rebalance logic once a week\n                    if (time.DayOfWeek != DayOfWeek.Monday)\n                    {\n                        return null;\n                    }\n\n                    if (_lastRebalanceTime == default(DateTime))\n                    {\n                        // initial rebalance\n                        _lastRebalanceTime = time;\n                        return time;\n                    }\n\n                    var deviation = 0m;\n                    var count = Securities.Values.Count(security => security.Invested);\n                    if (count > 0)\n                    {\n                        _lastRebalanceTime = time;\n                        var portfolioValuePerSecurity = Portfolio.TotalPortfolioValue / count;\n                        foreach (var security in Securities.Values.Where(security => security.Invested))\n                        {\n                            var reservedBuyingPowerForCurrentPosition = security.BuyingPowerModel.GetReservedBuyingPowerForPosition(\n                                                                            new ReservedBuyingPowerForPositionParameters(security)).AbsoluteUsedBuyingPower\n                                                                        // see GH issue 4107\n                                                                        * security.BuyingPowerModel.GetLeverage(security);\n                            // we sum up deviation for each security\n                            deviation += (portfolioValuePerSecurity - reservedBuyingPowerForCurrentPosition) / portfolioValuePerSecurity;\n                        }\n\n                        // if securities are deviated 1.5% from their theoretical share of TotalPortfolioValue we rebalance\n                        if (deviation >= 0.015m)\n                        {\n                            return time;\n                        }\n                    }\n                    return null;\n                }));\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                if (UtcTime - _lastRebalanceTime > TimeSpan.Zero || UtcTime.DayOfWeek != DayOfWeek.Monday)\n                {\n                    throw new RegressionTestException($\"{UtcTime} {orderEvent.Symbol} {UtcTime - _lastRebalanceTime}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 11379;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"16\"},\n            {\"Average Win\", \"0.02%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"13.451%\"},\n            {\"Drawdown\", \"24.500%\"},\n            {\"Expectancy\", \"6.478\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"145958.59\"},\n            {\"Net Profit\", \"45.959%\"},\n            {\"Sharpe Ratio\", \"0.697\"},\n            {\"Sortino Ratio\", \"0.77\"},\n            {\"Probabilistic Sharpe Ratio\", \"30.183%\"},\n            {\"Loss Rate\", \"25%\"},\n            {\"Win Rate\", \"75%\"},\n            {\"Profit-Loss Ratio\", \"8.97\"},\n            {\"Alpha\", \"0.01\"},\n            {\"Beta\", \"1.1\"},\n            {\"Annual Standard Deviation\", \"0.127\"},\n            {\"Annual Variance\", \"0.016\"},\n            {\"Information Ratio\", \"0.285\"},\n            {\"Tracking Error\", \"0.06\"},\n            {\"Treynor Ratio\", \"0.081\"},\n            {\"Total Fees\", \"$24.50\"},\n            {\"Estimated Strategy Capacity\", \"$3600000.00\"},\n            {\"Lowest Capacity Asset\", \"BNO UN3IMQ2JU1YD\"},\n            {\"Portfolio Turnover\", \"0.10%\"},\n            {\"Drawdown Recovery\", \"489\"},\n            {\"OrderListHash\", \"47fb0abc2f7af436ed0faeb8eb64eeb3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioRebalanceOnDateRulesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing portfolio construction model control over rebalancing,\n    /// specifying a date rules, see GH 4075.\n    /// </summary>\n    public class PortfolioRebalanceOnDateRulesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            // let's use 0 minimum order margin percentage so we can assert trades are only submitted immediately after rebalance on Wednesday\n            // if not, due to TPV variations happening every day we might no cross the minimum on wednesday but yes another day of the week\n            Settings.MinimumOrderMarginPortfolioPercentage = 0m;\n\n            SetStartDate(2015, 1, 1);\n            SetEndDate(2017, 1, 1);\n\n            Settings.RebalancePortfolioOnInsightChanges = false;\n            Settings.RebalancePortfolioOnSecurityChanges = false;\n\n            SetUniverseSelection(new CustomUniverseSelectionModel(\n                \"CustomUniverseSelectionModel\",\n                time => new List<string> { \"AAPL\", \"IBM\", \"FB\", \"SPY\" }\n            ));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(DateRules.Every(DayOfWeek.Wednesday)));\n            SetExecution(new ImmediateExecutionModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                Debug($\"{orderEvent}\");\n                if (UtcTime.DayOfWeek != DayOfWeek.Wednesday)\n                {\n                    throw new RegressionTestException($\"{UtcTime} {orderEvent.Symbol} {UtcTime.DayOfWeek}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6072;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"346\"},\n            {\"Average Win\", \"0.06%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"10.796%\"},\n            {\"Drawdown\", \"18.300%\"},\n            {\"Expectancy\", \"1.277\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"122745.47\"},\n            {\"Net Profit\", \"22.745%\"},\n            {\"Sharpe Ratio\", \"0.535\"},\n            {\"Sortino Ratio\", \"0.625\"},\n            {\"Probabilistic Sharpe Ratio\", \"23.534%\"},\n            {\"Loss Rate\", \"24%\"},\n            {\"Win Rate\", \"76%\"},\n            {\"Profit-Loss Ratio\", \"1.98\"},\n            {\"Alpha\", \"0.031\"},\n            {\"Beta\", \"1.015\"},\n            {\"Annual Standard Deviation\", \"0.14\"},\n            {\"Annual Variance\", \"0.02\"},\n            {\"Information Ratio\", \"0.448\"},\n            {\"Tracking Error\", \"0.072\"},\n            {\"Treynor Ratio\", \"0.074\"},\n            {\"Total Fees\", \"$350.77\"},\n            {\"Estimated Strategy Capacity\", \"$91000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.31%\"},\n            {\"Drawdown Recovery\", \"365\"},\n            {\"OrderListHash\", \"1da61b0a1129e5eab9bc36bd9dae6f40\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing portfolio construction model control over rebalancing,\n    /// when setting 'PortfolioConstructionModel.RebalanceOnInsightChanges' to false, see GH 4075.\n    /// </summary>\n    public class PortfolioRebalanceOnInsightChangesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, DateTime> _lastOrderFilled;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2015, 1, 1);\n            SetEndDate(2017, 1, 1);\n\n            Settings.RebalancePortfolioOnInsightChanges = false;\n\n            SetUniverseSelection(new CustomUniverseSelectionModel(\"CustomUniverseSelectionModel\",\n                time => new List<string> { \"FB\", \"SPY\", \"AAPL\", \"IBM\" }));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(\n                time => time.AddDays(30)));\n            SetExecution(new ImmediateExecutionModel());\n\n            _lastOrderFilled = new Dictionary<Symbol, DateTime>();\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                DateTime lastOrderFilled;\n                if (_lastOrderFilled.TryGetValue(orderEvent.Symbol, out lastOrderFilled))\n                {\n                    if (UtcTime - lastOrderFilled < TimeSpan.FromDays(30))\n                    {\n                        throw new RegressionTestException($\"{UtcTime} {orderEvent.Symbol} {UtcTime - lastOrderFilled}\");\n                    }\n                }\n                _lastOrderFilled[orderEvent.Symbol] = UtcTime;\n\n                Debug($\"{orderEvent}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6072;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"80\"},\n            {\"Average Win\", \"0.16%\"},\n            {\"Average Loss\", \"-0.08%\"},\n            {\"Compounding Annual Return\", \"10.558%\"},\n            {\"Drawdown\", \"18.100%\"},\n            {\"Expectancy\", \"1.741\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"122219.42\"},\n            {\"Net Profit\", \"22.219%\"},\n            {\"Sharpe Ratio\", \"0.521\"},\n            {\"Sortino Ratio\", \"0.615\"},\n            {\"Probabilistic Sharpe Ratio\", \"22.822%\"},\n            {\"Loss Rate\", \"12%\"},\n            {\"Win Rate\", \"88%\"},\n            {\"Profit-Loss Ratio\", \"2.11\"},\n            {\"Alpha\", \"0.029\"},\n            {\"Beta\", \"1.029\"},\n            {\"Annual Standard Deviation\", \"0.141\"},\n            {\"Annual Variance\", \"0.02\"},\n            {\"Information Ratio\", \"0.432\"},\n            {\"Tracking Error\", \"0.071\"},\n            {\"Treynor Ratio\", \"0.072\"},\n            {\"Total Fees\", \"$84.60\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.23%\"},\n            {\"Drawdown Recovery\", \"365\"},\n            {\"OrderListHash\", \"c55abc0a7257979180968944cf9b73d5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioRebalanceOnSecurityChangesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing portfolio construction model control over rebalancing,\n    /// when setting 'PortfolioConstructionModel.RebalanceOnSecurityChanges' to false, see GH 4075.\n    /// </summary>\n    public class PortfolioRebalanceOnSecurityChangesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _generatedInsightsCount;\n        private Dictionary<Symbol, DateTime> _lastOrderFilled;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2015, 1, 1);\n            SetEndDate(2017, 1, 1);\n\n            Settings.RebalancePortfolioOnSecurityChanges = false;\n            Settings.RebalancePortfolioOnInsightChanges = false;\n\n            SetUniverseSelection(new CustomUniverseSelectionModel(\"CustomUniverseSelectionModel\",\n                time =>\n                {\n                    if (new[] { DayOfWeek.Friday, DayOfWeek.Thursday }.Contains(time.DayOfWeek))\n                    {\n                        return new List<string> { \"FB\", \"SPY\" };\n                    }\n                    return new List<string> { \"AAPL\", \"IBM\" };\n                }\n            ));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(\n                time => time.AddDays(30)));\n            SetExecution(new ImmediateExecutionModel());\n\n            _lastOrderFilled = new Dictionary<Symbol, DateTime>();\n\n            InsightsGenerated += (_, e) => _generatedInsightsCount += e.Insights.Length;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                DateTime lastOrderFilled;\n                if (_lastOrderFilled.TryGetValue(orderEvent.Symbol, out lastOrderFilled))\n                {\n                    if (UtcTime - lastOrderFilled < TimeSpan.FromDays(30))\n                    {\n                        throw new RegressionTestException($\"{UtcTime} {orderEvent.Symbol} {UtcTime - lastOrderFilled}\");\n                    }\n                }\n                _lastOrderFilled[orderEvent.Symbol] = UtcTime;\n\n                Debug($\"{orderEvent}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Insights.Count == _generatedInsightsCount)\n            {\n                // The number of insights is modified by the Portfolio Construction Model,\n                // since it removes expired insights and insights from removed securities \n                throw new RegressionTestException($\"The number of insights in the insight manager should be different of the number of all insights generated ({_generatedInsightsCount})\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5485;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"64\"},\n            {\"Average Win\", \"2.71%\"},\n            {\"Average Loss\", \"-2.34%\"},\n            {\"Compounding Annual Return\", \"2.256%\"},\n            {\"Drawdown\", \"25.500%\"},\n            {\"Expectancy\", \"0.079\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"104560.59\"},\n            {\"Net Profit\", \"4.561%\"},\n            {\"Sharpe Ratio\", \"0.117\"},\n            {\"Sortino Ratio\", \"0.106\"},\n            {\"Probabilistic Sharpe Ratio\", \"8.398%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"1.16\"},\n            {\"Alpha\", \"-0.01\"},\n            {\"Beta\", \"0.569\"},\n            {\"Annual Standard Deviation\", \"0.125\"},\n            {\"Annual Variance\", \"0.016\"},\n            {\"Information Ratio\", \"-0.243\"},\n            {\"Tracking Error\", \"0.117\"},\n            {\"Treynor Ratio\", \"0.026\"},\n            {\"Total Fees\", \"$271.25\"},\n            {\"Estimated Strategy Capacity\", \"$44000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4.37%\"},\n            {\"Drawdown Recovery\", \"57\"},\n            {\"OrderListHash\", \"d6286db83c9d034251491fae4c937d76\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/PortfolioTargetTagsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm demonstrating the portfolio target tags usage\n    /// </summary>\n    public class PortfolioTargetTagsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _targetsTagChecked;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null));\n\n            SetPortfolioConstruction(new CustomPortfolioConstructionModel());\n            SetExecution(new CustomExecutionModel(() => _targetsTagChecked = true));\n            SetRiskManagement(new CustomRiskManagementModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_targetsTagChecked)\n            {\n                throw new RegressionTestException(\"The portfolio targets tag were not checked\");\n            }\n        }\n\n        private class CustomPortfolioConstructionModel : EqualWeightingPortfolioConstructionModel\n        {\n            public CustomPortfolioConstructionModel() : base(Resolution.Daily)\n            {\n            }\n\n            public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                var targets = base.CreateTargets(algorithm, insights);\n                foreach (var target in targets)\n                {\n                    yield return new PortfolioTarget(target.Symbol, target.Quantity, tag: GeneratePortfolioTargetTag(target));\n                }\n            }\n\n            public static string GeneratePortfolioTargetTag(IPortfolioTarget target)\n            {\n                return $\"Portfolio target tag: {target.Symbol} - {target.Quantity}\";\n            }\n        }\n\n        private class CustomRiskManagementModel : MaximumDrawdownPercentPerSecurity\n        {\n            public CustomRiskManagementModel() : base(0.01m)\n            {\n            }\n\n            public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n            {\n                var riskManagedTargets = base.ManageRisk(algorithm, targets);\n                foreach (var target in riskManagedTargets)\n                {\n                    yield return new PortfolioTarget(target.Symbol, target.Quantity,\n                        tag: CustomPortfolioConstructionModel.GeneratePortfolioTargetTag(target));\n                }\n            }\n        }\n\n        private class CustomExecutionModel : ImmediateExecutionModel\n        {\n            private Action _targetsTagCheckedCallback;\n\n            public CustomExecutionModel(Action targetsTagCheckedCallback)\n            {\n                _targetsTagCheckedCallback = targetsTagCheckedCallback;\n            }\n\n            public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n            {\n                if (targets.Length > 0)\n                {\n                    _targetsTagCheckedCallback();\n                }\n\n                foreach (var target in targets)\n                {\n                    var expectedTag = CustomPortfolioConstructionModel.GeneratePortfolioTargetTag(target);\n                    if (target.Tag != expectedTag)\n                    {\n                        throw new RegressionTestException($\"Unexpected portfolio target tag: {target.Tag} - Expected: {expectedTag}\");\n                    }\n                }\n\n                base.Execute(algorithm, targets);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.01%\"},\n            {\"Compounding Annual Return\", \"261.134%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101655.30\"},\n            {\"Net Profit\", \"1.655%\"},\n            {\"Sharpe Ratio\", \"8.472\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.840%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.091\"},\n            {\"Beta\", \"1.006\"},\n            {\"Annual Standard Deviation\", \"0.224\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"-33.445\"},\n            {\"Tracking Error\", \"0.002\"},\n            {\"Treynor Ratio\", \"1.885\"},\n            {\"Total Fees\", \"$10.32\"},\n            {\"Estimated Strategy Capacity\", \"$27000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"59.86%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"059f940ee51f03f94eb0f13ae4b93134\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ProcessSplitSymbolsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This test algorithm reproduces GH issue 2848 where an exception is thrown\n    /// in the AlgorithmManager.ProcessSplitSymbols when removing the equity having a split\n    /// </summary>\n    public class ProcessSplitSymbolsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _aapl;\n        private Security _goog;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);  //Set Start Date\n            SetEndDate(2014, 06, 09);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            _aapl = AddEquity(\"AAPL\", Resolution.Daily);\n            _goog = AddEquity(\"GOOG\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Time == new DateTime(2014, 06, 06))\n            {\n                RemoveSecurity(_aapl.Symbol);\n            }\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_goog.Symbol, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 35;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"76.334%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100727.83\"},\n            {\"Net Profit\", \"0.728%\"},\n            {\"Sharpe Ratio\", \"6.14\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"71.723%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"1.02\"},\n            {\"Beta\", \"-1.043\"},\n            {\"Annual Standard Deviation\", \"0.094\"},\n            {\"Annual Variance\", \"0.009\"},\n            {\"Information Ratio\", \"1.332\"},\n            {\"Tracking Error\", \"0.114\"},\n            {\"Treynor Ratio\", \"-0.553\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$46000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"20.10%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"fd92ba2e36a1e755593fcc9791e97928\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Algorithm.CSharp\")]\n[assembly: AssemblyProduct(\"QuantConnect.Algorithm.CSharp\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"886e964c-d7a8-4301-b24f-10e7965e7dd8\")]"
  },
  {
    "path": "Algorithm.CSharp/QLOptionPricingModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to override the option pricing model with the\n    /// <see cref=\"QLOptionPriceModel\"/> for a given option security.\n    /// </summary>\n    public class QLOptionPricingModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _checked;\n\n        private Option _option;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var equity = AddEquity(\"GOOG\");\n            _option = AddOption(equity.Symbol);\n            _option.SetFilter(u => u.Strikes(-2, +2).Expiration(0, 180));\n\n            // Set the option price model to the default QL model\n            _option.SetPriceModel(QLOptionPriceModelProvider.Instance.GetOptionPriceModel(_option.Symbol));\n\n            if (_option.PriceModel is not QLOptionPriceModel)\n            {\n                throw new RegressionTestException(\"Option pricing model was not set to QLOptionPriceModel, which should be the default\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_checked  && slice.OptionChains.TryGetValue(_option.Symbol, out var chain))\n            {\n                if (_option.PriceModel is not QLOptionPriceModel)\n                {\n                    throw new RegressionTestException(\"Option pricing model was not set to QLOptionPriceModel\");\n                }\n\n                foreach (var contract in chain)\n                {\n                    var theoreticalPrice = contract.TheoreticalPrice;\n                    var iv = contract.ImpliedVolatility;\n                    var greeks = contract.Greeks;\n\n                    Log($\"{contract.Symbol}:: Theoretical Price: {theoreticalPrice}, IV: {iv}, \" +\n                           $\"Delta: {greeks.Delta}, Gamma: {greeks.Gamma}, Vega: {greeks.Vega}, \" +\n                           $\"Theta: {greeks.Theta}, Rho: {greeks.Rho}, Lambda: {greeks.Lambda}\");\n                                 \n                    _checked |= true;\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_checked)\n            {\n                throw new RegressionTestException(\"Option chain was never received.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 37131;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Algorithm.CSharp</RootNamespace>\n    <AssemblyName>QuantConnect.Algorithm.CSharp</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Algorithm.CSharp Project - A collection of C# algorithm demonstrations for how to use the API</Description>\n    <NoWarn>CS0618;CA1062;CA1002</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'DebugDocker|AnyCPU'\">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>portable</DebugType>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"Accord\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Fuzzy\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.MachineLearning\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Math\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Statistics\" Version=\"3.6.0\" />\n    <PackageReference Include=\"DynamicInterop\" Version=\"0.9.1\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm.Framework\\QuantConnect.Algorithm.Framework.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Algorithm.CSharp/QuitAfterInitializationRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm is expected to stop executing after Initialization. Related to GH 6168 issue\n    /// </summary>\n    public class QuitAfterInitializationRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _stopped;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_stopped)\n            {\n                throw new RegressionTestException(\"Algorithm should of stopped!\");\n            }\n            _stopped = true;\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 16;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>();\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/QuitInInitializationRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm is expected to stop executing after Initialization. Related to GH 6168 issue\n    /// </summary>\n    public class QuitInInitializationRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            Quit();\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            throw new RegressionTestException(\"Algorithm should of stopped!\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>();\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RangeConsolidatorAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of how to use RangeConsolidator\n    /// </summary>\n    public class RangeConsolidatorAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private RangeBar _firstDataConsolidated;\n        protected virtual int Range => 100;\n        protected virtual Resolution Resolution => Resolution.Daily;\n\n        public override void Initialize()\n         {\n            SetStartAndEndDates();\n            AddEquity(\"SPY\", Resolution);\n            var rangeConsolidator = CreateRangeConsolidator();\n            rangeConsolidator.DataConsolidated += OnDataConsolidated;\n            _firstDataConsolidated = null;\n\n            SubscriptionManager.AddConsolidator(\"SPY\", rangeConsolidator);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_firstDataConsolidated == null)\n            {\n                throw new RegressionTestException(\"The consolidator should have consolidated at least one RangeBar, but it did not consolidated any one\");\n            }\n        }\n\n        protected virtual void OnDataConsolidated(Object sender, RangeBar rangeBar)\n        {\n            if (_firstDataConsolidated == null)\n            {\n                _firstDataConsolidated = rangeBar;\n            }\n            // Log($\"{rangeBar.Open} {rangeBar.High} {rangeBar.Low} {rangeBar.Close}\");\n\n            if (Math.Round(rangeBar.High - rangeBar.Low, 2) != (Range * 0.01m)) // The minimum price change for SPY is 0.01, therefore the range size of each bar equals Range * 0.01\n            {\n                throw new RegressionTestException($\"The difference between the High and Low for all RangeBar's should be {Range * 0.01m}, but for this RangeBar was {Math.Round(rangeBar.High - rangeBar.Low), 2}\");\n            }\n        }\n\n        protected virtual void SetStartAndEndDates()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n        }\n\n        protected virtual RangeConsolidator CreateRangeConsolidator()\n        {\n            return new RangeConsolidator(Range);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RangeConsolidatorWithTickAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm of how to use RangeConsolidator with Tick resolution\n    /// </summary>\n    public class RangeConsolidatorWithTickAlgorithm : RangeConsolidatorAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Tick;\n        protected override int Range => 5;\n\n        protected override void SetStartAndEndDates()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 07);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 2857175;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RawDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we demonstrate how to use the raw data for our securities\n    /// and verify that the behavior is correct.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class RawDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string Ticker = \"GOOGL\";\n        private CorporateFactorProvider _factorFile;\n        private readonly IEnumerator<decimal> _expectedRawPrices = new List<decimal> { 1158.72m,\n            1131.97m, 1114.28m, 1120.15m, 1114.51m, 1134.89m, 1135.1m, 571.50m, 545.25m, 540.63m }.GetEnumerator();\n        private Symbol _googl;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 3, 25);      //Set Start Date\n            SetEndDate(2014, 4, 7);         //Set End Date\n            SetCash(100000);                            //Set Strategy Cash\n\n            // Set our DataNormalizationMode to raw\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            _googl = AddEquity(Ticker, Resolution.Daily).Symbol;\n\n            // Get our factor file for this regression\n            var dataProvider =\n                Composer.Instance.GetExportedValueByTypeName<IDataProvider>(Config.Get(\"data-provider\",\n                    \"DefaultDataProvider\"));\n\n            var mapFileProvider = new LocalDiskMapFileProvider();\n            mapFileProvider.Initialize(dataProvider);\n            var factorFileProvider = new LocalDiskFactorFileProvider();\n            factorFileProvider.Initialize(mapFileProvider, dataProvider);\n            _factorFile = factorFileProvider.Get(_googl) as CorporateFactorProvider;\n\n            // Prime our expected values\n            _expectedRawPrices.MoveNext();\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_googl, 1);\n            }\n\n            if (slice.Bars.ContainsKey(_googl))\n            {\n                var googlData = slice.Bars[_googl];\n\n                // Assert our volume matches what we expected\n                if (_expectedRawPrices.Current != googlData.Close)\n                {\n                    // Our values don't match lets try and give a reason why\n                    var dayFactor = _factorFile.GetPriceFactor(googlData.Time, DataNormalizationMode.Adjusted);\n                    var probableRawPrice = googlData.Close / dayFactor; // Undo adjustment\n\n                    if (_expectedRawPrices.Current == probableRawPrice)\n                    {\n                        throw new RegressionTestException($\"Close price was incorrect; it appears to be the adjusted value\");\n                    }\n                    else\n                    {\n                        throw new RegressionTestException($\"Close price was incorrect; Data may have changed.\");\n                    }\n                }\n\n                // Move to our next expected value\n                _expectedRawPrices.MoveNext();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 91;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-85.376%\"},\n            {\"Drawdown\", \"6.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"93054.5\"},\n            {\"Net Profit\", \"-6.946%\"},\n            {\"Sharpe Ratio\", \"-2.925\"},\n            {\"Sortino Ratio\", \"-2.881\"},\n            {\"Probabilistic Sharpe Ratio\", \"3.662%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.379\"},\n            {\"Beta\", \"1.959\"},\n            {\"Annual Standard Deviation\", \"0.257\"},\n            {\"Annual Variance\", \"0.066\"},\n            {\"Information Ratio\", \"-2.874\"},\n            {\"Tracking Error\", \"0.195\"},\n            {\"Treynor Ratio\", \"-0.384\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$140000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOG T1AZ164W5VTX\"},\n            {\"Portfolio Turnover\", \"7.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"2284e1b9e7d44577d77987dfe56d3e8d\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RawPricesCoarseUniverseAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we demonstrate how to use the coarse fundamental data to\n    /// define a universe as the top dollar volume and set the algorithm to use\n    /// raw prices\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class RawPricesCoarseUniverseAlgorithm : QCAlgorithm\n    {\n        private const int NumberOfSymbols = 5;\n\n        public override void Initialize()\n        {\n            // what resolution should the data *added* to the universe be?\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 01, 01);\n            SetEndDate(2015, 01, 01);\n            SetCash(50000);\n\n            // Set the security initializer with the characteristics defined in CustomSecurityInitializer\n            SetSecurityInitializer(CustomSecurityInitializer);\n\n            // this add universe method accepts a single parameter that is a function that\n            // accepts an IEnumerable<CoarseFundamental> and returns IEnumerable<Symbol>\n            AddUniverse(CoarseSelectionFunction);\n        }\n\n        /// <summary>\n        /// Initialize the security with raw prices and zero fees \n        /// </summary>\n        /// <param name=\"security\">Security which characteristics we want to change</param>\n        private void CustomSecurityInitializer(Security security)\n        {\n            security.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            security.SetFeeModel(new ConstantFeeModel(0));\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n        public static IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top5 = sortedByDollarVolume.Take(NumberOfSymbols);\n\n            // we need to return only the symbol objects\n            return top5.Select(x => x.Symbol);\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want 20% allocation in each security in our universe\n            foreach (var security in changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.2m);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"OnOrderEvent({UtcTime:o}):: {orderEvent}\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/RawPricesUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// In this algorithm we demonstrate how to use the UniverseSettings\n    /// to define the data normalization mode (raw)\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class RawPricesUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            // what resolution should the data *added* to the universe be?\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Use raw prices\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n\n            SetStartDate(2014,3,24);\n            SetEndDate(2014,4,7);\n            SetCash(50000);\n\n            // Set the security initializer with zero fees and price initial seed\n            var securitySeeder = new FuncSecuritySeeder(GetLastKnownPrices);\n            SetSecurityInitializer(new CompositeSecurityInitializer(\n                new FuncSecurityInitializer(x => x.SetFeeModel(new ConstantFeeModel(0))),\n                new FuncSecurityInitializer(security => securitySeeder.SeedSecurity(security))));\n\n            AddUniverse(\"MyUniverse\", Resolution.Daily, SelectionFunction);\n        }\n\n        public IEnumerable<string> SelectionFunction(DateTime dateTime)\n        {\n            return dateTime.Day % 2 == 0\n                ? new[] { \"SPY\", \"IWM\", \"QQQ\" }\n                : new[] { \"AIG\", \"BAC\", \"IBM\" };\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want 20% allocation in each security in our universe\n            foreach (var security in changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 0.2m);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 156;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 150;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"57\"},\n            {\"Average Win\", \"0.18%\"},\n            {\"Average Loss\", \"-0.24%\"},\n            {\"Compounding Annual Return\", \"-47.380%\"},\n            {\"Drawdown\", \"2.500%\"},\n            {\"Expectancy\", \"-0.352\"},\n            {\"Start Equity\", \"50000\"},\n            {\"End Equity\", \"48726.48\"},\n            {\"Net Profit\", \"-2.547%\"},\n            {\"Sharpe Ratio\", \"-3.372\"},\n            {\"Sortino Ratio\", \"-3.889\"},\n            {\"Probabilistic Sharpe Ratio\", \"10.352%\"},\n            {\"Loss Rate\", \"63%\"},\n            {\"Win Rate\", \"37%\"},\n            {\"Profit-Loss Ratio\", \"0.75\"},\n            {\"Alpha\", \"-0.208\"},\n            {\"Beta\", \"0.815\"},\n            {\"Annual Standard Deviation\", \"0.086\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-4.871\"},\n            {\"Tracking Error\", \"0.039\"},\n            {\"Treynor Ratio\", \"-0.357\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$230000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"77.40%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4fb8ffbdfd2cce69ac28b0d0992d7198\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegisterIndicatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing data type bugs in the RegisterIndicator API. Related to GH 4205.\n    /// </summary>\n    public class RegisterIndicatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<IIndicator> _indicators;\n        private Symbol _symbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 01, 05);\n            SetEndDate(2020, 01, 10);\n\n            var SP500 = QuantConnect.Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            _symbol = FutureChainProvider.GetFutureContractList(SP500, StartDate.AddDays(1)).First();\n            AddFutureContract(_symbol);\n\n            // this collection will hold all indicators and at the end of the algorithm we will assert that all of them are ready\n            _indicators = new List<IIndicator>();\n\n            // Test the different APIs for IndicatorBase<QuoteBar> works correctly.\n            // Should be able to determine the correct consolidator and not throw an exception\n            var indicator = new CustomIndicator();\n            RegisterIndicator(_symbol, indicator, Resolution.Minute);\n            _indicators.Add(indicator);\n\n            // specifying a selector and using resolution\n            var indicator2 = new CustomIndicator();\n            RegisterIndicator(_symbol, indicator2, Resolution.Minute, data => (QuoteBar) data);\n            _indicators.Add(indicator2);\n\n            // specifying a selector and using timeSpan\n            var indicator3 = new CustomIndicator();\n            RegisterIndicator(_symbol, indicator3, TimeSpan.FromMinutes(1), data => (QuoteBar)data);\n            _indicators.Add(indicator3);\n\n            // directly sending in the desired consolidator\n            var indicator4 = new SimpleMovingAverage(10);\n            var consolidator = ResolveConsolidator(_symbol, Resolution.Minute, typeof(QuoteBar));\n            RegisterIndicator(_symbol, indicator4, consolidator);\n            _indicators.Add(indicator4);\n\n            // directly sending in the desired consolidator and specifying a selector\n            var indicator5 = new SimpleMovingAverage(10);\n            var consolidator2 = ResolveConsolidator(_symbol, Resolution.Minute, typeof(QuoteBar));\n            RegisterIndicator(_symbol, indicator5, consolidator2,\n                data =>\n                {\n                    var quoteBar = data as QuoteBar;\n                    return quoteBar.High - quoteBar.Low;\n                });\n            _indicators.Add(indicator5);\n\n            // Now make sure default data type TradeBar works correctly and does not throw an exception\n            // Specifying resolution and selector\n            var movingAverage = new SimpleMovingAverage(10);\n            RegisterIndicator(_symbol, movingAverage, Resolution.Minute, data => data.Value);\n            _indicators.Add(movingAverage);\n\n            // Specifying resolution\n            var movingAverage2 = new SimpleMovingAverage(10);\n            RegisterIndicator(_symbol, movingAverage2, Resolution.Minute);\n            _indicators.Add(movingAverage2);\n\n            // Specifying TimeSpan\n            var movingAverage3 = new SimpleMovingAverage(10);\n            RegisterIndicator(_symbol, movingAverage3, TimeSpan.FromMinutes(1));\n            _indicators.Add(movingAverage3);\n\n            // Specifying TimeSpan and selector\n            var movingAverage4 = new SimpleMovingAverage(10);\n            RegisterIndicator(_symbol, movingAverage4, TimeSpan.FromMinutes(1), data => data.Value);\n            _indicators.Add(movingAverage4);\n\n            // Test custom data is able to register correctly and indicators updated\n            var smaCustomData = new SimpleMovingAverage(1);\n            var symbol = AddData<CustomDataRegressionAlgorithm.Bitcoin>(\"BTC\", Resolution.Minute).Symbol;\n            RegisterIndicator(symbol, smaCustomData, TimeSpan.FromMinutes(1), data => data.Value);\n            _indicators.Add(smaCustomData);\n\n            var smaCustomData2 = new SimpleMovingAverage(1);\n            RegisterIndicator(symbol, smaCustomData2, Resolution.Minute);\n            _indicators.Add(smaCustomData2);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 0.5);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_indicators.Any(indicator => !indicator.IsReady))\n            {\n                throw new RegressionTestException(\"All indicators should be ready\");\n            }\n            Log($\"Total of {_indicators.Count} are ready\");\n        }\n\n        private class CustomIndicator : IndicatorBase<QuoteBar>\n        {\n            private bool _isReady;\n            public override bool IsReady => _isReady;\n            public CustomIndicator() : base(\"Jose\")\n            {\n            }\n            protected override decimal ComputeNextValue(QuoteBar input)\n            {\n                _isReady = true;\n                return input.Close;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6803;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"22662.692%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"109332.4\"},\n            {\"Net Profit\", \"9.332%\"},\n            {\"Sharpe Ratio\", \"157.927\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.713%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"103.354\"},\n            {\"Beta\", \"1.96\"},\n            {\"Annual Standard Deviation\", \"0.663\"},\n            {\"Annual Variance\", \"0.439\"},\n            {\"Information Ratio\", \"159.787\"},\n            {\"Tracking Error\", \"0.651\"},\n            {\"Treynor Ratio\", \"53.381\"},\n            {\"Total Fees\", \"$15.05\"},\n            {\"Estimated Strategy Capacity\", \"$1900000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES XCZJLC9NOB29\"},\n            {\"Portfolio Turnover\", \"171.57%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d814db6d5a9c97ee6de477ea06cd3834\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm used for regression tests purposes\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class RegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            SetCash(10000000);\n\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Tick);\n            AddSecurity(SecurityType.Equity, \"BAC\", Resolution.Minute);\n            AddSecurity(SecurityType.Equity, \"AIG\", Resolution.Hour);\n            AddSecurity(SecurityType.Equity, \"IBM\", Resolution.Daily);\n        }\n\n        private DateTime lastTradeTradeBars;\n        private TimeSpan tradeEvery = TimeSpan.FromMinutes(1);\n        public override void OnData(Slice slice)\n        {\n            if (Time - lastTradeTradeBars < tradeEvery) return;\n            lastTradeTradeBars = Time;\n\n            foreach (var kvp in slice.Bars)\n            {\n                var symbol = kvp.Key;\n                var bar = kvp.Value;\n\n                if (bar.IsFillForward)\n                {\n                    // only trade on new data\n                    continue;\n                }\n\n                var holdings = Portfolio[symbol];\n                if (!holdings.Invested)\n                {\n                    MarketOrder(symbol, 10);\n                }\n                else\n                {\n                    MarketOrder(symbol, -holdings.Quantity);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 6879791;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"119\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9999850.26\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$119.00\"},\n            {\"Estimated Strategy Capacity\", \"$26000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.08%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8ac2506392feb9423f1a970846e70982\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionChannelAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression Channel algorithm simply initializes the date range and cash\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"indicator classes\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"plotting indicators\" />\n    public class RegressionChannelAlgorithm : QCAlgorithm\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private SecurityHolding _holdings;\n        private RegressionChannel _rc;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2009, 1, 1);  //Set Start Date\n            SetEndDate(2015, 1, 1);    //Set End Date\n            SetCash(100000);           //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            var equity = AddEquity(_spy, Resolution.Minute);\n            _holdings = equity.Holdings;\n            _rc = RC(_spy, 30, 2, Resolution.Daily);\n\n            var stockPlot = new Chart(\"Trade Plot\");\n            stockPlot.AddSeries(new Series(\"Buy\", SeriesType.Scatter, 0));\n            stockPlot.AddSeries(new Series(\"Sell\", SeriesType.Scatter, 0));\n            stockPlot.AddSeries(new Series(\"UpperChannel\", SeriesType.Line, 0));\n            stockPlot.AddSeries(new Series(\"LowerChannel\", SeriesType.Line, 0));\n            stockPlot.AddSeries(new Series(\"Regression\", SeriesType.Line, 0));\n            AddChart(stockPlot);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public void OnData(TradeBars data)\n        {\n            if (!_rc.IsReady || !data.ContainsKey(_spy)) return;\n            var value = data[_spy].Value;\n\n            if (_holdings.Quantity <= 0 && value < _rc.LowerChannel)\n            {\n                SetHoldings(_spy, 1);\n                Plot(\"Trade Plot\", \"Buy\", value);\n            }\n\n            if (_holdings.Quantity >= 0 && value > _rc.UpperChannel)\n            {\n                SetHoldings(_spy, -1);\n                Plot(\"Trade Plot\", \"Sell\", value);\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol == _spy)\n            {\n                Plot(\"Trade Plot\", \"UpperChannel\", _rc.UpperChannel);\n                Plot(\"Trade Plot\", \"LowerChannel\", _rc.LowerChannel);\n                Plot(\"Trade Plot\", \"Regression\", _rc.LinearRegression);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Collective2IndexOptionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp.RegressionTests\n{\n    public class Collective2IndexOptionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Collective2 APIv4 KEY: This value is provided by Collective2 in your account section (See https://collective2.com/account-info)\n        /// See API documentation at https://trade.collective2.com/c2-api\n        /// </summary>\n        private const string _collective2ApiKey = \"YOUR APIV4 KEY\";\n\n        /// <summary>\n        /// Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page\n        /// </summary>\n        private const int _collective2SystemId = 0;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n        private Symbol _symbol;\n        private bool _firstCall = true;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 1, 4);\n            SetEndDate(2021, 1, 18);\n            SetCash(100000);\n\n            var underlying = AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Create an SPXW option contract with a specific strike price and expiration date\n            var option = QuantConnect.Symbol.CreateOption(\n                underlying,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3800m,\n                new DateTime(2021, 1, 04));\n\n            _symbol = AddIndexOptionContract(option, Resolution.Minute).Symbol;\n\n            _fast = EMA(underlying, 10, Resolution.Minute);\n            _slow = EMA(underlying, 50, Resolution.Minute);\n\n            // Disable automatic exports as we manually set them\n            SignalExport.AutomaticExportTimeSpan = null;\n            // Set up the Collective2 Signal Export with the provided API key and system ID\n            SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));\n\n            // Set warm-up period for the indicators\n            SetWarmUp(50);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Execute only on the first data call to set initial portfolio\n            if (_firstCall)\n            {\n                SetHoldings(_symbol, 0.1);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n                _firstCall = false;\n            }\n\n            // If the fast EMA crosses above the slow EMA, open a long position\n            if (_fast > _slow && !Portfolio.Invested)\n            {\n                MarketOrder(_symbol, 1);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n            }\n\n            // If the fast EMA crosses below the slow EMA, open a short position\n            else if (_fast < _slow && Portfolio.Invested)\n            {\n                MarketOrder(_symbol, -1);\n                SignalExport.SetTargetPortfolioFromPortfolio();\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4544;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"10\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-0.468%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99985\"},\n            {\"Net Profit\", \"-0.015%\"},\n            {\"Sharpe Ratio\", \"-15.229\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.781%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.003\"},\n            {\"Beta\", \"-0.001\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.216\"},\n            {\"Tracking Error\", \"0.103\"},\n            {\"Treynor Ratio\", \"5.946\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$8000.00\"},\n            {\"Lowest Capacity Asset\", \"SPXW XKX6S2GMDZSE|SPX 31\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ad9c0f3aa3b311065df12bcff9a2b4de\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CorrelationLastComputedValueRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp.RegressionTests\n{\n    /// <summary>\n    /// Validates the <see cref=\"Correlation\"/> indicator by ensuring no mismatch between the last computed value \n    /// and the expected value. Also verifies proper functionality across different time zones.\n    /// </summary>\n    public class CorrelationLastComputedValueRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Correlation _correlationPearson;\n        private decimal _lastCorrelationValue;\n        private decimal _totalCount;\n        private decimal _matchingCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 05, 08);\n            SetEndDate(2017, 06, 15);\n\n            EnableAutomaticIndicatorWarmUp = true;\n            AddCrypto(\"BTCUSD\", Resolution.Daily);\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            _correlationPearson = C(\"BTCUSD\", \"SPY\", 3, CorrelationType.Pearson, Resolution.Daily);\n            if (!_correlationPearson.IsReady)\n            {\n                throw new RegressionTestException(\"Correlation indicator was expected to be ready\");\n            }\n            _lastCorrelationValue = _correlationPearson.Current.Value;\n            _totalCount = 0;\n            _matchingCount = 0;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_lastCorrelationValue == _correlationPearson[1].Value)\n            {\n                _matchingCount++;\n            }\n            Debug($\"CorrelationPearson between BTCUSD and SPY - Current: {_correlationPearson[0].Value}, Previous: {_correlationPearson[1].Value}\");\n            _lastCorrelationValue = _correlationPearson.Current.Value;\n            _totalCount++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_totalCount == 0)\n            {\n                throw new RegressionTestException(\"No data points were processed.\");\n            }\n            if (_totalCount != _matchingCount)\n            {\n                throw new RegressionTestException(\"Mismatch in the last computed CorrelationPearson values.\");\n            }\n            Debug($\"{_totalCount} data points were processed, {_matchingCount} matched the last computed value.\");\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5798;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 21;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.616\"},\n            {\"Tracking Error\", \"0.111\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CustomData/CustomDataIconicTypesAddDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm ensures that added data matches expectations\n    /// </summary>\n    public class CustomDataIconicTypesAddDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _googlEquity;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            var twxEquity = AddEquity(\"TWX\", Resolution.Daily).Symbol;\n            var customTwxSymbol = AddData<LinkedData>(twxEquity, Resolution.Daily).Symbol;\n\n            _googlEquity = AddEquity(\"GOOGL\", Resolution.Daily).Symbol;\n            var customGooglSymbol = AddData<LinkedData>(\"GOOGL\", Resolution.Daily).Symbol;\n\n            var unlinkedDataSymbol = AddData<UnlinkedData>(\"GOOGL\", Resolution.Daily).Symbol;\n            var unlinkedDataSymbolUnderlyingEquity = QuantConnect.Symbol.Create(\"MSFT\", SecurityType.Equity, Market.USA);\n            var unlinkedDataSymbolUnderlying = AddData<UnlinkedData>(unlinkedDataSymbolUnderlyingEquity, Resolution.Daily).Symbol;\n\n            var optionSymbol = AddOption(\"TWX\", Resolution.Minute).Symbol;\n            var customOptionSymbol = AddData<LinkedData>(optionSymbol, Resolution.Daily).Symbol;\n\n            if (customTwxSymbol.Underlying != twxEquity)\n            {\n                throw new RegressionTestException($\"Underlying symbol for {customTwxSymbol} is not equal to TWX equity. Expected {twxEquity} got {customTwxSymbol.Underlying}\");\n            }\n            if (customGooglSymbol.Underlying != _googlEquity)\n            {\n                throw new RegressionTestException($\"Underlying symbol for {customGooglSymbol} is not equal to GOOGL equity. Expected {_googlEquity} got {customGooglSymbol.Underlying}\");\n            }\n            if (unlinkedDataSymbol.HasUnderlying)\n            {\n                throw new RegressionTestException($\"Unlinked data type (no underlying) has underlying when it shouldn't. Found {unlinkedDataSymbol.Underlying}\");\n            }\n            if (!unlinkedDataSymbolUnderlying.HasUnderlying)\n            {\n                throw new RegressionTestException(\"Unlinked data type (with underlying) has no underlying Symbol even though we added with Symbol\");\n            }\n            if (unlinkedDataSymbolUnderlying.Underlying != unlinkedDataSymbolUnderlyingEquity)\n            {\n                throw new RegressionTestException($\"Unlinked data type underlying does not equal equity Symbol added. Expected {unlinkedDataSymbolUnderlyingEquity} got {unlinkedDataSymbolUnderlying.Underlying}\");\n            }\n            if (customOptionSymbol.Underlying != optionSymbol)\n            {\n                throw new RegressionTestException(\"Option symbol not equal to custom underlying symbol. Expected {optionSymbol} got {customOptionSymbol.Underlying}\");\n            }\n\n            try\n            {\n                var customDataNoCache = AddData<LinkedData>(\"AAPL\", Resolution.Daily);\n                throw new RegressionTestException(\"AAPL was found in the SymbolCache, though it should be missing\");\n            }\n            catch (InvalidOperationException)\n            {\n                // This is exactly what we wanted. AAPL shouldn't have been found in the SymbolCache, and because\n                // LinkedData is mappable, we threw\n                return;\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !Transactions.GetOpenOrders().Any())\n            {\n                SetHoldings(_googlEquity, 0.5);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 49;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"34.800%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100382.52\"},\n            {\"Net Profit\", \"0.383%\"},\n            {\"Sharpe Ratio\", \"2.947\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"56.825%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.515\"},\n            {\"Beta\", \"0.396\"},\n            {\"Annual Standard Deviation\", \"0.091\"},\n            {\"Annual Variance\", \"0.008\"},\n            {\"Information Ratio\", \"-12.534\"},\n            {\"Tracking Error\", \"0.136\"},\n            {\"Treynor Ratio\", \"0.677\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOG T1AZ164W5VTX\"},\n            {\"Portfolio Turnover\", \"10.02%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"150b29938b60fbc747a3ff8065498bf3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CustomData/CustomDataIconicTypesDefaultResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests the performance related GH issue 3772\n    /// </summary>\n    public class CustomDataIconicTypesDefaultResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 11);\n            SetEndDate(2013, 10, 12);\n            var spy = AddEquity(\"SPY\").Symbol;\n\n            var types = new[]\n            {\n                typeof(UnlinkedDataTradeBar),\n                typeof(DailyUnlinkedData),\n                typeof(DailyLinkedData)\n            };\n\n            foreach (var type in types)\n            {\n                var custom = AddData(type, spy);\n\n                if (SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(custom.Symbol)\n                    .Any(config => config.Resolution != Resolution.Daily))\n                {\n                    throw new RegressionTestException(\"Was expecting resolution to be set to Daily\");\n                }\n\n                try\n                {\n                    AddData(type, spy, Resolution.Tick);\n                    throw new RegressionTestException(\"Was expecting an ArgumentException to be thrown\");\n                }\n                catch (ArgumentException)\n                {\n                    // expected, these custom types don't support tick resolution\n                }\n            }\n\n            var security = AddData<HourlyDefaultResolutionUnlinkedData>(spy);\n            if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(security.Symbol)\n                .Any(config => config.Resolution != Resolution.Hour))\n            {\n                throw new RegressionTestException(\"Was expecting resolution to be set to Hour\");\n            }\n\n            var option = AddOption(\"AAPL\");\n            if (SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(option.Symbol)\n                .Any(config => config.Resolution != Resolution.Daily))\n            {\n                throw new RegressionTestException(\"Was expecting resolution to be set to Daily\");\n            }\n        }\n\n        private class DailyUnlinkedData : UnlinkedData\n        {\n            public override List<Resolution> SupportedResolutions()\n            {\n                return DailyResolution;\n            }\n        }\n\n        private class DailyLinkedData : LinkedData\n        {\n            public override List<Resolution> SupportedResolutions()\n            {\n                return DailyResolution;\n            }\n        }\n\n        private class HourlyDefaultResolutionUnlinkedData : UnlinkedData\n        {\n            public override Resolution DefaultResolution()\n            {\n                return Resolution.Hour;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 796;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm ensures that data added via coarse selection (underlying) is present in ActiveSecurities\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />d\n    public class CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _customSymbols = new List<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 3, 24);\n            SetEndDate(2014, 4, 7);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelector));\n        }\n\n        public IEnumerable<Symbol> CoarseSelector(IEnumerable<CoarseFundamental> coarse)\n        {\n            var symbols = new[]\n            {\n                QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"GOOGL\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n            };\n\n            _customSymbols.Clear();\n\n            foreach (var symbol in symbols)\n            {\n                _customSymbols.Add(AddData<LinkedData>(symbol, Resolution.Daily).Symbol);\n            }\n\n            return symbols;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && Transactions.GetOpenOrders().Count == 0)\n            {\n                var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n                SetHoldings(aapl, 0.5);\n            }\n\n            foreach (var customSymbol in _customSymbols)\n            {\n                if (!ActiveSecurities.ContainsKey(customSymbol.Underlying))\n                {\n                    throw new RegressionTestException($\"Custom data underlying ({customSymbol.Underlying}) Symbol was not found in active securities\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78123;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-33.427%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98341.86\"},\n            {\"Net Profit\", \"-1.658%\"},\n            {\"Sharpe Ratio\", \"-4.844\"},\n            {\"Sortino Ratio\", \"-5.768\"},\n            {\"Probabilistic Sharpe Ratio\", \"5.401%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.215\"},\n            {\"Beta\", \"0.503\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-3.027\"},\n            {\"Tracking Error\", \"0.054\"},\n            {\"Treynor Ratio\", \"-0.529\"},\n            {\"Total Fees\", \"$14.45\"},\n            {\"Estimated Strategy Capacity\", \"$460000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b5acd2b6fb8c80cdd488ec5a616b07ee\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm ensures that data added via OnSecuritiesChanged (underlying) is present in ActiveSecurities\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _customSymbols = new List<Symbol>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 3, 24);\n            SetEndDate(2014, 4, 7);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelector));\n        }\n\n        public IEnumerable<Symbol> CoarseSelector(IEnumerable<CoarseFundamental> coarse)\n        {\n            return new[]\n            {\n                QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"FB\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"GOOGL\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n            };\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && Transactions.GetOpenOrders().Count == 0)\n            {\n                var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n                SetHoldings(aapl, 0.5);\n            }\n\n            foreach (var customSymbol in _customSymbols)\n            {\n                if (!ActiveSecurities.ContainsKey(customSymbol.Underlying))\n                {\n                    throw new RegressionTestException($\"Custom data underlying ({customSymbol.Underlying}) Symbol was not found in active securities\");\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            bool iterated = false;\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!iterated)\n                {\n                    _customSymbols.Clear();\n                    iterated = true;\n                }\n                _customSymbols.Add(AddData<LinkedData>(added.Symbol, Resolution.Daily).Symbol);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78123;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-33.427%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98341.86\"},\n            {\"Net Profit\", \"-1.658%\"},\n            {\"Sharpe Ratio\", \"-4.844\"},\n            {\"Sortino Ratio\", \"-5.768\"},\n            {\"Probabilistic Sharpe Ratio\", \"5.401%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.215\"},\n            {\"Beta\", \"0.503\"},\n            {\"Annual Standard Deviation\", \"0.055\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-3.027\"},\n            {\"Tracking Error\", \"0.054\"},\n            {\"Treynor Ratio\", \"-0.529\"},\n            {\"Total Fees\", \"$14.45\"},\n            {\"Estimated Strategy Capacity\", \"$460000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b5acd2b6fb8c80cdd488ec5a616b07ee\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/CustomData/CustomDataUnlinkedTradeBarIconicTypeConsolidationRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests the consolidation of custom data with random data\n    /// </summary>\n    public class CustomDataUnlinkedTradeBarIconicTypeConsolidationRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _vix;\n        private BollingerBands _bb;\n        private bool _invested;\n\n        /// <summary>\n        /// Initializes the algorithm with fake \"VIX\" data\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _vix = AddData<IncrementallyGeneratedCustomData>(\"VIX\", Resolution.Daily).Symbol;\n            _bb = BB(_vix, 30, 2, MovingAverageType.Simple, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_bb.Current.Value == 0)\n            {\n                throw new RegressionTestException(\"Bollinger Band value is zero when we expect non-zero value.\");\n            }\n\n            if (!_invested && _bb.Current.Value > 0.05m)\n            {\n                MarketOrder(_vix, 1);\n                _invested = true;\n            }\n        }\n\n        /// <summary>\n        /// Incrementally updating data\n        /// </summary>\n        public class IncrementallyGeneratedCustomData : UnlinkedDataTradeBar\n        {\n            private const decimal _start = 10.01m;\n            private static decimal _step;\n\n            /// <summary>\n            /// Gets the source of the subscription. In this case, we set it to existing\n            /// equity data so that we can pass fake data from Reader\n            /// </summary>\n            /// <param name=\"config\">Subscription configuration</param>\n            /// <param name=\"date\">Date we're making this request</param>\n            /// <param name=\"isLiveMode\">Is live mode</param>\n            /// <returns>Source of subscription</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(Path.Combine(Globals.DataFolder, \"equity\", \"usa\", \"minute\", \"spy\", $\"{date:yyyyMMdd}_trade.zip#{date:yyyyMMdd}_spy_minute_trade.csv\"), SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n            }\n\n            /// <summary>\n            /// Reads the data, which in this case is fake incremental data\n            /// </summary>\n            /// <param name=\"config\">Subscription configuration</param>\n            /// <param name=\"line\">Line of data</param>\n            /// <param name=\"date\">Date of the request</param>\n            /// <param name=\"isLiveMode\">Is live mode</param>\n            /// <returns>Incremental BaseData instance</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var unlinkedBar = new UnlinkedDataTradeBar();\n                _step += 0.10m;\n                var open = _start + _step;\n                var close = _start + _step + 0.02m;\n                var high = close;\n                var low = open;\n\n                return new IncrementallyGeneratedCustomData\n                {\n                    Open = open,\n                    High = high,\n                    Low = low,\n                    Close = close,\n                    Time = date,\n                    Symbol = new Symbol(\n                        SecurityIdentifier.GenerateBase(typeof(IncrementallyGeneratedCustomData), \"VIX\", Market.USA, false),\n                        \"VIX\"),\n                    Period = unlinkedBar.Period,\n                    DataType = unlinkedBar.DataType\n                };\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        /// <remarks>\n        /// Unable to be tested in Python, due to pythonnet not supporting overriding of methods from Python\n        /// </remarks>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4171;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"28.248%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100330\"},\n            {\"Net Profit\", \"0.330%\"},\n            {\"Sharpe Ratio\", \"315.406\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.22\"},\n            {\"Beta\", \"0.002\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-7.886\"},\n            {\"Tracking Error\", \"0.222\"},\n            {\"Treynor Ratio\", \"144.512\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"VIX.IncrementallyGeneratedCustomData 2S\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"a3abee8c47244710f63c596af48a7951\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests the delisting of the composite Symbol (ETF symbol) and the removal of\n    /// the universe and the symbol from the algorithm.\n    /// </summary>\n    public class ETFConstituentUniverseCompositeDelistingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool AddETFSubscription { get; set; } = true;\n\n        private Symbol _gdvd;\n        private Symbol _aapl;\n        private DateTime _delistingDate;\n        private int _universeSymbolCount;\n        private bool _universeSelectionDone;\n        private bool _universeAdded;\n        private bool _universeRemoved;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            _delistingDate = new DateTime(2021, 1, 21);\n\n            _aapl = AddEquity(\"AAPL\", Resolution.Hour).Symbol;\n            if (AddETFSubscription)\n            {\n                Log(\"Adding ETF constituent universe Symbol by using AddEquity(...)\");\n                _gdvd = AddEquity(\"GDVD\", Resolution.Hour).Symbol;\n            }\n            else\n            {\n                Log(\"Adding ETF constituent universe Symbol by using Symbol.Create(...)\");\n                _gdvd = QuantConnect.Symbol.Create(\"GDVD\", SecurityType.Equity, Market.USA);\n            }\n\n            AddUniverse(Universe.ETF(_gdvd, universeFilterFunc: FilterETFs));\n        }\n\n        private IEnumerable<Symbol> FilterETFs(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            _universeSelectionDone = true;\n\n            if (UtcTime.Date > _delistingDate)\n            {\n                throw new RegressionTestException($\"Performing constituent universe selection on {UtcTime:yyyy-MM-dd HH:mm:ss.fff} after composite ETF has been delisted\");\n            }\n\n            var constituentSymbols = constituents.Select(x => x.Symbol);\n            _universeSymbolCount = constituentSymbols.Distinct().Count();\n\n            return constituentSymbols;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (UtcTime.Date > _delistingDate && slice.Keys.Any(x => x != _aapl))\n            {\n                throw new RegressionTestException($\"Received unexpected slice in OnData(...) after universe was deselected\");\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_aapl, 0.5m);\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Count != 0 && UtcTime > _delistingDate)\n            {\n                throw new RegressionTestException(\"New securities added after ETF constituents were delisted\");\n            }\n\n            // if we added the etf subscription it will get added and delisted and send us a addition/removal event\n            var expectedChangesCount = _universeSymbolCount;\n\n            if (_universeSelectionDone)\n            {\n                // manually added securities are added right away, the etf universe selection happens a few days later when data available\n                // AAPL was already added so it wont be counted\n                _universeAdded |= changes.AddedSecurities.Count == (expectedChangesCount - 1);\n            }\n\n            // TODO: shouldn't be sending AAPL as a removed security since it was added by another universe\n            _universeRemoved |= changes.RemovedSecurities.Count == (expectedChangesCount + (AddETFSubscription ? 1 : 0)) &&\n                UtcTime.Date >= _delistingDate &&\n                UtcTime.Date < EndDate;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_universeAdded)\n            {\n                throw new RegressionTestException(\"ETF constituent universe was never added to the algorithm\");\n            }\n            if (!_universeRemoved)\n            {\n                throw new RegressionTestException(\"ETF constituent universe was not removed from the algorithm after delisting\");\n            }\n            if (ActiveSecurities.Count > 2)\n            {\n                throw new RegressionTestException($\"Expected less than 2 securities after algorithm ended, found {Securities.Count}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 826;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"26.315%\"},\n            {\"Drawdown\", \"5.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"103892.62\"},\n            {\"Net Profit\", \"3.893%\"},\n            {\"Sharpe Ratio\", \"1.291\"},\n            {\"Sortino Ratio\", \"1.876\"},\n            {\"Probabilistic Sharpe Ratio\", \"53.929%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.13\"},\n            {\"Beta\", \"0.697\"},\n            {\"Annual Standard Deviation\", \"0.139\"},\n            {\"Annual Variance\", \"0.019\"},\n            {\"Information Ratio\", \"0.889\"},\n            {\"Tracking Error\", \"0.122\"},\n            {\"Treynor Ratio\", \"0.257\"},\n            {\"Total Fees\", \"$2.04\"},\n            {\"Estimated Strategy Capacity\", \"$260000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.83%\"},\n            {\"Drawdown Recovery\", \"23\"},\n            {\"OrderListHash\", \"cdf9a800c8ec7d5f9f750f32c2622f5a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests the delisting of the composite Symbol (ETF symbol) and the removal of\n    /// the universe and the symbol from the algorithm, without adding a subscription via AddEquity\n    /// </summary>\n    public class ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF : ETFConstituentUniverseCompositeDelistingRegressionAlgorithm\n    {\n        protected override bool AddETFSubscription { get; set; } = false;\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 623;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFilterFunctionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests a custom filter function when creating an ETF constituents universe for SPY\n    /// </summary>\n    public class ETFConstituentUniverseFilterFunctionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, ETFConstituentUniverse> _etfConstituentData = new Dictionary<Symbol, ETFConstituentUniverse>();\n        \n        private Symbol _aapl;\n        private Symbol _spy;\n        private bool _filtered;\n        private bool _securitiesChanged;\n        private bool _receivedData;\n        private bool _etfRebalanced;\n        private int _rebalanceCount;\n        private int _rebalanceAssetCount;\n        \n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n            \n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            \n            AddUniverse(Universe.ETF(_spy, universeFilterFunc: FilterETFs));\n        }\n\n        /// <summary>\n        /// Filters ETFs, performing some sanity checks\n        /// </summary>\n        /// <param name=\"constituents\">Constituents of the ETF universe added above</param>\n        /// <returns>Constituent Symbols to add to algorithm</returns>\n        /// <exception cref=\"ArgumentException\">Constituents collection was not structured as expected</exception>\n        private IEnumerable<Symbol> FilterETFs(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            var constituentsData = constituents.ToList();\n            _etfConstituentData = constituentsData.ToDictionary(x => x.Symbol, x => x);\n            \n            var constituentsSymbols = constituentsData.Select(x => x.Symbol).ToList();\n            if (constituentsData.Count == 0)\n            {\n                throw new ArgumentException($\"Constituents collection is empty on {UtcTime:yyyy-MM-dd HH:mm:ss.fff}\");\n            }\n            if (!constituentsSymbols.Contains(_aapl))\n            {\n                throw new ArgumentException(\"AAPL is not in the constituents data provided to the algorithm\");\n            }\n\n            var aaplData = constituentsData.Single(x => x.Symbol == _aapl);\n            if (aaplData.Weight == 0m)\n            {\n                throw new ArgumentException(\"AAPL weight is expected to be a non-zero value\");\n            }\n\n            _filtered = true;\n            _etfRebalanced = true;\n            \n            return constituentsSymbols;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_filtered && slice.Bars.Count != 0 && slice.Bars.ContainsKey(_aapl))\n            {\n                throw new RegressionTestException(\"AAPL TradeBar data added to algorithm before constituent universe selection took place\");\n            }\n\n            if (slice.Bars.Count == 1 && slice.Bars.ContainsKey(_spy))\n            {\n                return;\n            }\n            \n            if (slice.Bars.Count != 0 && !slice.Bars.ContainsKey(_aapl))\n            {\n                throw new RegressionTestException($\"Expected AAPL TradeBar data in OnData on {UtcTime:yyyy-MM-dd HH:mm:ss}\");\n            }\n\n            _receivedData = true;\n            // If the ETF hasn't changed its weights, then let's not update our holdings\n            if (!_etfRebalanced)\n            {\n                return;\n            }\n\n            foreach (var bar in slice.Bars.Values)\n            {\n                if (_etfConstituentData.TryGetValue(bar.Symbol, out var constituentData) && \n                    constituentData.Weight != null && \n                    constituentData.Weight >= 0.0001m)\n                {\n                    // If the weight of the constituent is less than 1%, then it will be set to 1%\n                    // If the weight of the constituent exceeds more than 5%, then it will be capped to 5%\n                    // Otherwise, if the weight falls in between, then we use that value.\n                    var boundedWeight = Math.Max(0.01m, Math.Min(constituentData.Weight.Value, 0.05m));\n                    SetHoldings(bar.Symbol, boundedWeight);\n                    \n                    if (_etfRebalanced)\n                    {\n                        _rebalanceCount++;\n                    }\n                    _etfRebalanced = false;\n                    _rebalanceAssetCount++;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Checks if new securities have been added to the algorithm after universe selection has occurred\n        /// </summary>\n        /// <param name=\"changes\">Security changes</param>\n        /// <exception cref=\"ArgumentException\">Expected number of stocks were not added to the algorithm</exception>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (_filtered && !_securitiesChanged && changes.AddedSecurities.Count < 500)\n            {\n                throw new ArgumentException($\"Added SPY S&P 500 ETF to algorithm, but less than 500 equities were loaded (added {changes.AddedSecurities.Count} securities)\");\n            }\n\n            _securitiesChanged = true;\n        }\n\n        /// <summary>\n        /// Ensures that all expected events were triggered by the end of the algorithm\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">An expected event didn't happen</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_rebalanceCount != 2)\n            {\n                throw new RegressionTestException($\"Expected 2 rebalances, instead rebalanced: {_rebalanceCount}\");\n            }\n            if (_rebalanceAssetCount != 8)\n            {\n                throw new RegressionTestException($\"Invested in {_rebalanceAssetCount} assets (expected 8)\");\n            }\n            if (!_filtered)\n            {\n                throw new RegressionTestException(\"Universe selection was never triggered\");\n            }\n            if (!_securitiesChanged)\n            {\n                throw new RegressionTestException(\"Security changes never propagated to the algorithm\");\n            }\n            if (!_receivedData)\n            {\n                throw new RegressionTestException(\"Data was never loaded for the S&P 500 constituent AAPL\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2722;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"1.989%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100322.52\"},\n            {\"Net Profit\", \"0.323%\"},\n            {\"Sharpe Ratio\", \"0.838\"},\n            {\"Sortino Ratio\", \"1.122\"},\n            {\"Probabilistic Sharpe Ratio\", \"50.081%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.005\"},\n            {\"Beta\", \"0.098\"},\n            {\"Annual Standard Deviation\", \"0.014\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.614\"},\n            {\"Tracking Error\", \"0.096\"},\n            {\"Treynor Ratio\", \"0.123\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"16\"},\n            {\"OrderListHash\", \"7231bcc4d5304546a25e4dcc9f11ed5f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests ETF constituents universe selection with the algorithm framework models (Alpha, PortfolioConstruction, Execution)\n    /// </summary>\n    public class ETFConstituentUniverseFrameworkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<ETFConstituentUniverse> ConstituentData = new List<ETFConstituentUniverse>();\n\n        /// <summary>\n        /// Initializes the algorithm, setting up the framework classes and ETF constituent universe settings\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n\n            SetAlpha(new ETFConstituentAlphaModel());\n            SetPortfolioConstruction(new ETFConstituentPortfolioModel());\n            SetExecution(new ETFConstituentExecutionModel());\n\n            var spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n            AddUniverseWrapper(spy);\n        }\n\n        protected virtual void AddUniverseWrapper(Symbol symbol)\n        {\n            var universe = AddUniverse(Universe.ETF(symbol, UniverseSettings, FilterETFConstituents));\n\n            var historicalData = History(universe, 1).ToList();\n            if (historicalData.Count != 1)\n            {\n                throw new RegressionTestException($\"Unexpected history count {historicalData.Count}! Expected 1\");\n            }\n            foreach (var universeDataCollection in historicalData)\n            {\n                if (universeDataCollection.Data.Count < 200)\n                {\n                    throw new RegressionTestException($\"Unexpected universe DataCollection count {universeDataCollection.Data.Count}! Expected > 200\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Filters ETF constituents\n        /// </summary>\n        /// <param name=\"constituents\">ETF constituents</param>\n        /// <returns>ETF constituent Symbols that we want to include in the algorithm</returns>\n        public IEnumerable<Symbol> FilterETFConstituents(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            var constituentData = constituents\n                .Where(x => (x.Weight ?? 0m) >= 0.001m)\n                .ToList();\n\n            ConstituentData = constituentData;\n\n            return constituentData\n                .Select(x => x.Symbol)\n                .ToList();\n        }\n\n        /// <summary>\n        /// no-op for performance\n        /// </summary>\n        public override void OnData(Slice data)\n        {\n        }\n\n        /// <summary>\n        /// Alpha model for ETF constituents, where we generate insights based on the weighting\n        /// of the ETF constituent\n        /// </summary>\n        private class ETFConstituentAlphaModel : IAlphaModel\n        {\n            public void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n            }\n\n            /// <summary>\n            /// Creates new insights based on constituent data and their weighting\n            /// in their respective ETF\n            /// </summary>\n            public IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                var algo = (ETFConstituentUniverseFrameworkRegressionAlgorithm) algorithm;\n\n                foreach (var constituent in algo.ConstituentData)\n                {\n                    if (!data.Bars.ContainsKey(constituent.Symbol) &&\n                        !data.QuoteBars.ContainsKey(constituent.Symbol))\n                    {\n                        continue;\n                    }\n\n                    var insightDirection = constituent.Weight != null && constituent.Weight >= 0.01m\n                        ? InsightDirection.Up\n                        : InsightDirection.Down;\n\n                    yield return new Insight(\n                        algorithm.UtcTime,\n                        constituent.Symbol,\n                        TimeSpan.FromDays(1),\n                        InsightType.Price,\n                        insightDirection,\n                        1 * (double)insightDirection,\n                        1.0,\n                        weight: (double)(constituent.Weight ?? 0));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Generates targets for ETF constituents, which will be set to the weighting\n        /// of the constituent in their respective ETF\n        /// </summary>\n        private class ETFConstituentPortfolioModel : IPortfolioConstructionModel\n        {\n            private bool _hasAdded;\n\n            /// <summary>\n            /// Securities changed, detects if we've got new additions to the universe\n            /// so that we don't try to trade every loop\n            /// </summary>\n            public void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                _hasAdded = changes.AddedSecurities.Count != 0;\n            }\n\n            /// <summary>\n            /// Creates portfolio targets based on the insights provided to us by the alpha model.\n            /// Emits portfolio targets setting the quantity to the weight of the constituent\n            /// in its respective ETF.\n            /// </summary>\n            public IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                if (!_hasAdded)\n                {\n                    yield break;\n                }\n\n                foreach (var insight in insights)\n                {\n                    yield return new PortfolioTarget(insight.Symbol, (decimal) (insight.Weight ?? 0));\n                    _hasAdded = false;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Executes based on ETF constituent weighting\n        /// </summary>\n        private class ETFConstituentExecutionModel : IExecutionModel\n        {\n            /// <summary>\n            /// Liquidates if constituents have been removed from the universe\n            /// </summary>\n            public void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                foreach (var change in changes.RemovedSecurities)\n                {\n                    algorithm.Liquidate(change.Symbol);\n                }\n            }\n\n            /// <summary>\n            /// Creates orders for constituents that attempts to add\n            /// the weighting of the constituent in our portfolio. The\n            /// resulting algorithm portfolio weight might not be equal\n            /// to the leverage of the ETF (1x, 2x, 3x, etc.)\n            /// </summary>\n            public void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n            {\n                foreach (var target in targets)\n                {\n                    algorithm.SetHoldings(target.Symbol, target.Quantity);\n                }\n            }\n\n            public void OnOrderEvent(QCAlgorithm algorithm, OrderEvent orderEvent)\n            {\n\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2436;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"3.006%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100485.34\"},\n            {\"Net Profit\", \"0.485%\"},\n            {\"Sharpe Ratio\", \"1.055\"},\n            {\"Sortino Ratio\", \"1.53\"},\n            {\"Probabilistic Sharpe Ratio\", \"53.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.012\"},\n            {\"Beta\", \"0.096\"},\n            {\"Annual Standard Deviation\", \"0.017\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.544\"},\n            {\"Tracking Error\", \"0.096\"},\n            {\"Treynor Ratio\", \"0.191\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$1400000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.12%\"},\n            {\"Drawdown Recovery\", \"22\"},\n            {\"OrderListHash\", \"5d1e80a607d65ba4c7329f6f0b86999f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFrameworkRegressionAlgorithmNewUniverseModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Selection;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests ETF constituents universe selection with the algorithm framework models (Alpha, PortfolioConstruction, Execution)\n    /// </summary>\n    public class ETFConstituentUniverseFrameworkRegressionAlgorithmNewUniverseModel : ETFConstituentUniverseFrameworkRegressionAlgorithm\n    {\n        protected override void AddUniverseWrapper(Symbol symbol)\n        {\n            AddUniverseSelection(new ETFConstituentsUniverseSelectionModel(symbol, universeFilterFunc: FilterETFConstituents));\n        }\n\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseImmediateSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Assert that ETF universe selection happens right away after algorithm starts\n    /// </summary>\n    public class ETFConstituentUniverseImmediateSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _constituents = new();\n\n        private Symbol _spy;\n        private bool _filtered;\n        private bool _securitiesChanged;\n\n        private bool _firstOnData = true;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            AddUniverse(Universe.ETF(_spy, universeFilterFunc: FilterETFs));\n        }\n\n        /// <summary>\n        /// Filters ETFs, performing some sanity checks\n        /// </summary>\n        /// <param name=\"constituents\">Constituents of the ETF universe added above</param>\n        /// <returns>Constituent Symbols to add to algorithm</returns>\n        /// <exception cref=\"ArgumentException\">Constituents collection was not structured as expected</exception>\n        private IEnumerable<Symbol> FilterETFs(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            _filtered = true;\n            _constituents = constituents.Select(x => x.Symbol).Distinct().ToList();\n\n            return _constituents;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_firstOnData)\n            {\n                if (!_filtered)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away. \" +\n                        \"The first OnData call should have had happened after the universe selection\");\n                }\n\n                _firstOnData = false;\n            }\n        }\n\n        /// <summary>\n        /// Checks if new securities have been added to the algorithm after universe selection has occurred\n        /// </summary>\n        /// <param name=\"changes\">Security changes</param>\n        /// <exception cref=\"ArgumentException\">Expected number of stocks were not added to the algorithm</exception>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (!_filtered)\n            {\n                throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n            }\n\n            if (!_securitiesChanged)\n            {\n                // Selection should be happening right on algorithm start\n                if (Time != StartDate)\n                {\n                    throw new RegressionTestException(\"Universe selection should have been triggered right away\");\n                }\n\n                // All constituents should have been added to the algorithm.\n                // Plus the ETF itself.\n                if (changes.AddedSecurities.Count != _constituents.Count + 1)\n                {\n                    throw new RegressionTestException($\"Expected {_constituents.Count + 1} stocks to be added to the algorithm, \" +\n                        $\"instead added: {changes.AddedSecurities.Count}\");\n                }\n\n                if (!_constituents.All(constituent => changes.AddedSecurities.Any(security => security.Symbol == constituent)))\n                {\n                    throw new RegressionTestException(\"Not all constituents were added to the algorithm\");\n                }\n\n                _securitiesChanged = true;\n            }\n        }\n\n        /// <summary>\n        /// Ensures that all expected events were triggered by the end of the algorithm\n        /// </summary>\n        /// <exception cref=\"RegressionTestException\">An expected event didn't happen</exception>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_firstOnData || !_filtered || !_securitiesChanged)\n            {\n                throw new RegressionTestException(\"Expected events didn't happen\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2722;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.695\"},\n            {\"Tracking Error\", \"0.105\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseMappedCompositeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests the mapping of the ETF symbol that has a constituent universe attached to it and ensures\n    /// that data is loaded after the mapping event takes place.\n    /// </summary>\n    public class ETFConstituentUniverseMappedCompositeRegressionAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n        private Symbol _qqq;\n        private Dictionary<DateTime, int> _filterDateConstituentSymbolCount = new Dictionary<DateTime, int>();\n        private Dictionary<DateTime, bool> _constituentDataEncountered = new Dictionary<DateTime, bool>();\n        private HashSet<Symbol> _constituentSymbols = new HashSet<Symbol>();\n        private bool _mappingEventOccurred;\n        \n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2011, 2, 1);\n            SetEndDate(2011, 4, 4);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            _aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            _qqq = AddEquity(\"QQQ\", Resolution.Daily).Symbol;\n            AddUniverse(Universe.ETF(_qqq, universeFilterFunc: FilterETFs));\n        }\n\n        private IEnumerable<Symbol> FilterETFs(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            var constituentSymbols = constituents.Select(x => x.Symbol).ToHashSet();\n            if (!constituentSymbols.Contains(_aapl))\n            {\n                throw new RegressionTestException(\"AAPL not found in QQQ constituents\");\n            }\n            \n            _filterDateConstituentSymbolCount[UtcTime.Date] = constituentSymbols.Count;\n            foreach (var symbol in constituentSymbols)\n            {\n                _constituentSymbols.Add(symbol);\n            }\n            \n            return constituentSymbols;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.SymbolChangedEvents.Count != 0)\n            {\n                foreach (var symbolChanged in slice.SymbolChangedEvents.Values)\n                {\n                    if (symbolChanged.Symbol != _qqq)\n                    {\n                        throw new RegressionTestException($\"Mapped symbol is not QQQ. Instead, found: {symbolChanged.Symbol}\");\n                    }\n                    if (symbolChanged.OldSymbol != \"QQQQ\")\n                    {\n                        throw new RegressionTestException($\"Old QQQ Symbol is not QQQQ. Instead, found: {symbolChanged.OldSymbol}\");\n                    }\n                    if (symbolChanged.NewSymbol != \"QQQ\")\n                    {\n                        throw new RegressionTestException($\"New QQQ Symbol is not QQQ. Instead, found: {symbolChanged.NewSymbol}\");\n                    }\n                    \n                    _mappingEventOccurred = true;\n                }\n            }\n            \n            if (slice.Keys.Count == 1 && slice.ContainsKey(_qqq))\n            {\n                return;\n            }\n            \n            if (!_constituentDataEncountered.ContainsKey(UtcTime.Date))\n            {\n                _constituentDataEncountered[UtcTime.Date] = false;\n            }\n\n            if (_constituentSymbols.Intersect(slice.Keys).Any())\n            {\n                _constituentDataEncountered[UtcTime.Date] = true;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_aapl, 0.5m);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_filterDateConstituentSymbolCount.Count != 2)\n            {\n                throw new RegressionTestException($\"ETF constituent filtering function was not called 2 times (actual: {_filterDateConstituentSymbolCount.Count}\");\n            }\n            if (!_mappingEventOccurred)\n            {\n                throw new RegressionTestException(\"No mapping/SymbolChangedEvent occurred. Expected for QQQ to be mapped from QQQQ -> QQQ\");\n            }\n\n            foreach (var kvp in _filterDateConstituentSymbolCount)\n            {\n                if (kvp.Value < 25)\n                {\n                    throw new RegressionTestException($\"Expected 25 or more constituents in filter function on {kvp.Key:yyyy-MM-dd HH:mm:ss.fff}, found {kvp.Value}\");\n                }\n            }\n\n            foreach (var kvp in _constituentDataEncountered)\n            {\n                if (!kvp.Value)\n                {\n                    throw new RegressionTestException($\"Received data in OnData(...) but it did not contain any constituent data on {kvp.Key:yyyy-MM-dd HH:mm:ss.fff}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 751;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-9.739%\"},\n            {\"Drawdown\", \"4.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98257.31\"},\n            {\"Net Profit\", \"-1.743%\"},\n            {\"Sharpe Ratio\", \"-0.95\"},\n            {\"Sortino Ratio\", \"-0.832\"},\n            {\"Probabilistic Sharpe Ratio\", \"17.000%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.118\"},\n            {\"Beta\", \"0.445\"},\n            {\"Annual Standard Deviation\", \"0.078\"},\n            {\"Annual Variance\", \"0.006\"},\n            {\"Information Ratio\", \"-2.01\"},\n            {\"Tracking Error\", \"0.086\"},\n            {\"Treynor Ratio\", \"-0.166\"},\n            {\"Total Fees\", \"$22.93\"},\n            {\"Estimated Strategy Capacity\", \"$74000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.80%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"0737aa7f8928927464e9068b1d500e7f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseRSIAlphaModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm demonstrating the usage of the RSI indicator\n    /// in combination with ETF constituents data to replicate the weighting\n    /// of the ETF's assets in our own account.\n    /// </summary>\n    public class ETFConstituentUniverseRSIAlphaModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2021, 1, 31);\n            SetCash(100000);\n            \n            SetAlpha(new ConstituentWeightedRsiAlphaModel());\n            SetPortfolioConstruction(new InsightWeightingPortfolioConstructionModel());\n            SetExecution(new ImmediateExecutionModel());\n\n            var spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            \n            // We load hourly data for ETF constituents in this algorithm\n            UniverseSettings.Resolution = Resolution.Hour;\n            Settings.MinimumOrderMarginPortfolioPercentage = 0.01m;\n\n            AddUniverse(Universe.ETF(spy, UniverseSettings, FilterETFConstituents));\n        }\n\n        /// <summary>\n        /// Filters ETF constituents and adds the resulting Symbols to the ETF constituent universe\n        /// </summary>\n        /// <param name=\"constituents\">ETF constituents, i.e. the components of the ETF and their weighting</param>\n        /// <returns>Symbols to add to universe</returns>\n        public IEnumerable<Symbol> FilterETFConstituents(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            return constituents\n                .Where(x => x.Weight != null && x.Weight >= 0.001m)\n                .Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// Alpha model making use of the RSI indicator and ETF constituent weighting to determine\n        /// which assets we should invest in and the direction of investment\n        /// </summary>\n        private class ConstituentWeightedRsiAlphaModel : AlphaModel\n        {\n            private Dictionary<Symbol, SymbolData> _rsiSymbolData = new Dictionary<Symbol, SymbolData>();\n\n            /// <summary>\n            /// Receives new data and emits new <see cref=\"Insight\"/> instances\n            /// </summary>\n            /// <param name=\"algorithm\">Algorithm</param>\n            /// <param name=\"data\">Current data</param>\n            /// <returns>Enumerable of insights for assets to invest with a specific weight</returns>\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                // Cast first, and then access the constituents collection defined in our algorithm.\n                var algoConstituents = data.Bars.Keys\n                    .Where(x => algorithm.Securities[x].Cache.HasData(typeof(ETFConstituentUniverse)))\n                    .Select(x => algorithm.Securities[x].Cache.GetData<ETFConstituentUniverse>())\n                    .ToList();\n                \n                if (algoConstituents.Count == 0 || data.Bars.Count == 0)\n                {\n                    // Don't do anything if we have no data we can work with\n                    yield break;\n                }\n                \n                var constituents = algoConstituents\n                    .ToDictionary(x => x.Symbol, x => x);\n\n                foreach (var bar in data.Bars.Values)\n                {\n                    if (!constituents.ContainsKey(bar.Symbol))\n                    {\n                        // Dealing with a manually added equity, which in this case is SPY\n                        continue;\n                    }\n                    \n                    if (!_rsiSymbolData.ContainsKey(bar.Symbol))\n                    {\n                        // First time we're initializing the RSI.\n                        // It won't be ready now, but it will be\n                        // after 7 data points.\n                        var constituent = constituents[bar.Symbol];\n                        _rsiSymbolData[bar.Symbol] = new SymbolData(bar.Symbol, algorithm, constituent, 7);\n                    }\n                }\n\n                // Let's make sure all RSI indicators are ready before we emit any insights.\n                var allReady = _rsiSymbolData.All(kvp => kvp.Value.Rsi.IsReady);\n                if (!allReady)\n                {\n                    // We're still warming up the RSI indicators.\n                    yield break;\n                }\n\n                foreach (var kvp in _rsiSymbolData)\n                {\n                    var symbol = kvp.Key;\n                    var symbolData = kvp.Value;\n                    \n                    var averageLoss = symbolData.Rsi.AverageLoss.Current.Value;\n                    var averageGain = symbolData.Rsi.AverageGain.Current.Value;\n                    \n                    // If we've lost more than gained, then we think it's going to go down more\n                    var direction = averageLoss > averageGain\n                        ? InsightDirection.Down\n                        : InsightDirection.Up;\n\n                    // Set the weight of the insight as the weight of the ETF's\n                    // holding. The InsightWeightingPortfolioConstructionModel\n                    // will rebalance our portfolio to have the same percentage\n                    // of holdings in our algorithm that the ETF has.\n                    yield return Insight.Price(\n                        symbol,\n                        TimeSpan.FromDays(1),\n                        direction,\n                        (double)(direction == InsightDirection.Down\n                            ? averageLoss\n                            : averageGain),\n                        weight: (double?) symbolData.Constituent.Weight);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper class to access ETF constituent data and RSI indicators\n        /// for a single Symbol\n        /// </summary>\n        private class SymbolData\n        {\n            /// <summary>\n            /// Symbol this data belongs to\n            /// </summary>\n            public Symbol Symbol { get; }\n            \n            /// <summary>\n            /// Symbol's constituent data for the ETF it belongs to\n            /// </summary>\n            public ETFConstituentUniverse Constituent { get; }\n            \n            /// <summary>\n            /// RSI indicator for the Symbol's price data\n            /// </summary>\n            public RelativeStrengthIndex Rsi { get; }\n            \n            /// <summary>\n            /// Creates a new instance of SymbolData\n            /// </summary>\n            /// <param name=\"symbol\">The symbol to add data for</param>\n            /// <param name=\"constituent\">ETF constituent data</param>\n            /// <param name=\"period\">RSI period</param>\n            public SymbolData(Symbol symbol, QCAlgorithm algorithm, ETFConstituentUniverse constituent, int period)\n            {\n                Symbol = symbol;\n                Constituent = constituent;\n                Rsi = algorithm.RSI(symbol, period, MovingAverageType.Exponential, Resolution.Hour);\n            }\n        }\n        \n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2722;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"55\"},\n            {\"Average Win\", \"0.09%\"},\n            {\"Average Loss\", \"-0.05%\"},\n            {\"Compounding Annual Return\", \"3.321%\"},\n            {\"Drawdown\", \"0.500%\"},\n            {\"Expectancy\", \"0.047\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100535.45\"},\n            {\"Net Profit\", \"0.535%\"},\n            {\"Sharpe Ratio\", \"1.377\"},\n            {\"Sortino Ratio\", \"1.963\"},\n            {\"Probabilistic Sharpe Ratio\", \"60.081%\"},\n            {\"Loss Rate\", \"63%\"},\n            {\"Win Rate\", \"37%\"},\n            {\"Profit-Loss Ratio\", \"1.83\"},\n            {\"Alpha\", \"0.022\"},\n            {\"Beta\", \"-0.024\"},\n            {\"Annual Standard Deviation\", \"0.015\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.46\"},\n            {\"Tracking Error\", \"0.109\"},\n            {\"Treynor Ratio\", \"-0.878\"},\n            {\"Total Fees\", \"$55.00\"},\n            {\"Estimated Strategy Capacity\", \"$440000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"11.16%\"},\n            {\"Drawdown Recovery\", \"19\"},\n            {\"OrderListHash\", \"8a25d215ea8cd5781953695e8ae93e56\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RemoveUnderlyingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing issue #7697 unhanded division by zero in DefaultOptionAssignmentModel.IsDeepInTheMoney due to remove underlying of option\n    /// </summary>\n    public class RemoveUnderlyingRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n        private bool _boughtOption;\n        private bool _removedUnderlying;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 24);\n\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n            option.SetFilter(u => u.IncludeWeeklys()\n                                   .Strikes(-2, 0)\n                                   .Expiration(TimeSpan.Zero, TimeSpan.FromDays(2)));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_boughtOption && !Portfolio.Invested)\n            {\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    var contract = (\n                        from optionContract in chain.OrderByDescending(x => x.Strike)\n                        where optionContract.Right == OptionRight.Put\n                        select optionContract\n                        ).FirstOrDefault();\n                    if (contract != null)\n                    {\n                        MarketOrder(contract.Symbol, -1);\n                        _boughtOption = true;\n                    }\n                }\n            }\n            else if (Portfolio.Invested && Time.Day == 24 && Time.Hour == 0 && !_removedUnderlying)\n            {\n                _removedUnderlying = true;\n                RemoveSecurity(_optionSymbol.Underlying);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15886;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99961.5\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$28000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 305RBQ2BZGA4M|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"0.07%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"35f9749f41b6fd30dfcd6b74f172a93a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ResolutionSwitchingAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Adds daily data, then switches over to minute data after a few days.\n    /// This is to test the behavior of the sampling that occurs while the algorithm\n    /// is executing and its final alignment to the benchmark series in the <see cref=\"StatisticsBuilder\"/> class.\n    /// </summary>\n    /// <remarks>\n    /// -=-=-= WARNING =-=-=-\n    ///\n    /// if you are a user of the platform looking for how to switch the resolution of a symbol, we recommend\n    /// you add data in a high resolution (i.e. minute, second) and use a <see cref=\"TradeBarConsolidator\"/> to aggregate the\n    /// data to your desired resolution.\n    ///\n    /// This algorithm exists to test the internals of LEAN, and should not be used in any algorithm.\n    ///\n    /// -=-=-= WARNING =-=-=-\n    /// </remarks>\n    public class ResolutionSwitchingAlgorithm : QCAlgorithm\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested &&\n                // Wait for the security to be re-added in the OnSecuritiesChanged event before trying to trade it\n                Securities.TryGetValue(_spy, out var security) && security.IsTradable)\n            {\n                MarketOrder(_spy, 651); // QTY 651 is equal to `SetHoldings(_spy, 1)`\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                AddEquity(\"SPY\", Resolution.Minute);\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (UtcTime.Date == new DateTime(2013, 10, 9))\n            {\n                RemoveSecurity(symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that a position opened with a combo order is properly closed with another combo order in the opposite direction.\n    /// </summary>\n    public class RevertComboOrderPositionsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int _comboQuantity = 10;\n\n        private Option _option;\n\n        private List<Leg> _orderLegs;\n\n        private List<OrderTicket> _entryOrderTickets = new();\n        private List<OrderTicket> _exitOrderTickets = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(10000);\n\n            var equitySymbol = AddEquity(\"GOOG\", leverage: 4, fillForward: true).Symbol;\n            _option = AddOption(equitySymbol, fillForward: true);\n            _option.SetFilter(optionFilterUniverse => optionFilterUniverse\n                .StandardsOnly()\n                .Strikes(-2, 2)\n                .Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_orderLegs == null)\n            {\n                OptionChain chain;\n                if (IsMarketOpen(_option.Symbol) && slice.OptionChains.TryGetValue(_option.Symbol, out chain))\n                {\n                    var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                        .GroupBy(x => x.Expiry)\n                        .OrderBy(grouping => grouping.Key)\n                        .First()\n                        .OrderBy(x => x.Strike)\n                        .ToList();\n\n                    // Let's wait until we have at least three contracts\n                    if (callContracts.Count < 3)\n                    {\n                        return;\n                    }\n\n                    Debug(\"Placing entry combo market order\");\n                    _orderLegs = new List<Leg>()\n                    {\n                        Leg.Create(callContracts[0].Symbol, 1),\n                        Leg.Create(callContracts[1].Symbol, -2),\n                        Leg.Create(callContracts[2].Symbol, 1)\n                    };\n                    _entryOrderTickets = ComboMarketOrder(_orderLegs, _comboQuantity);\n                }\n            }\n            else if (Portfolio.Invested && _exitOrderTickets.Count == 0)\n            {\n                Debug(\"Placing exit combo limit order\");\n                var entryOrderFillPrice = GetComboOrderFillPrice(_entryOrderTickets);\n                _exitOrderTickets = ComboLimitOrder(_orderLegs, -_comboQuantity, -entryOrderFillPrice * 1.05m);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                // The multiplier depends on whether this order belongs either to the entry or exit combo order\n                var multiplier = _exitOrderTickets.Count > 0 ? -1 : 1;\n                var expectedQuantity = multiplier * _comboQuantity * _orderLegs.Where(leg => leg.Symbol == orderEvent.Symbol).Single().Quantity;\n                if (orderEvent.Quantity != expectedQuantity)\n                {\n                    throw new RegressionTestException($\"Order event quantity {orderEvent.Quantity} does not match expected quantity {expectedQuantity}\");\n                }\n                if (orderEvent.FillQuantity != expectedQuantity)\n                {\n                    throw new RegressionTestException(\n                        $\"Order event fill quantity {orderEvent.FillQuantity} does not match expected fill quantity {expectedQuantity}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.Invested)\n            {\n                throw new RegressionTestException(\"Portfolio should not be invested at the end of the algorithm.\");\n            }\n\n            if (_entryOrderTickets.Count == 0 || _entryOrderTickets.Any(ticket => ticket.Status != OrderStatus.Filled))\n            {\n                throw new RegressionTestException(\"Entry order was not filled\");\n            }\n\n            if (_exitOrderTickets.Count == 0 || _exitOrderTickets.Any(ticket => ticket.Status != OrderStatus.Filled))\n            {\n                throw new RegressionTestException(\"Exit order was not filled\");\n            }\n\n            for (var i = 0; i < _orderLegs.Count; i++)\n            {\n                var leg = _orderLegs[i];\n                var entryOrderTicket = _entryOrderTickets[i];\n                var exitOrderTicket = _exitOrderTickets[i];\n\n                var expectedEntryQuantity = leg.Quantity * _comboQuantity;\n                if (entryOrderTicket.Quantity != expectedEntryQuantity || entryOrderTicket.QuantityFilled != expectedEntryQuantity)\n                {\n                    throw new RegressionTestException($@\"Entry order ticket quantity and filled quantity do not match expected quantity for leg {i}. Expected: {expectedEntryQuantity}. Actual quantity: {entryOrderTicket.Quantity}. Actual filled quantity: {entryOrderTicket.QuantityFilled}\");\n                }\n\n                var expectedExitQuantity = -expectedEntryQuantity;\n                if (exitOrderTicket.Quantity != expectedExitQuantity || exitOrderTicket.QuantityFilled != expectedExitQuantity)\n                {\n                    throw new RegressionTestException($@\"Exit order ticket quantity and filled quantity do not match expected quantity for leg {i}. Expected: {expectedExitQuantity}. Actual quantity: {exitOrderTicket.Quantity}. Actual filled quantity: {exitOrderTicket.QuantityFilled}\");\n                }\n            }\n        }\n\n        private decimal GetComboOrderFillPrice(List<OrderTicket> orderTickets)\n        {\n            return orderTickets.Aggregate(0m, (accumulatedPrice, ticket) =>\n            {\n                var legQuantity = _orderLegs.Where(leg => leg.Symbol == ticket.Symbol).Single().Quantity;\n                return accumulatedPrice + ticket.AverageFillPrice * legQuantity;\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15023;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"5764\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$36.00\"},\n            {\"Estimated Strategy Capacity\", \"$15000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"2088.83%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"89a786ad77fd17f19037676d3fc66d94\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http, //www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.DataLibrary.Tests\n{\n    /// <summary>\n    /// Example algorithm of using RiskParityPortfolioConstructionModel\n    /// </summary>\n    public class RiskParityPortfolioAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 2, 21);\n            SetEndDate(2021, 3, 30);\n            SetCash(100000);\n            SetSecurityInitializer(security => security.SetMarketPrice(GetLastKnownPrice(security)));\n\n            AddEquity(\"SPY\", Resolution.Daily);\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            AddAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new RiskParityPortfolioConstructionModel());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 252;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 514;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"31\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"5.057%\"},\n            {\"Drawdown\", \"4.900%\"},\n            {\"Expectancy\", \"-0.273\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100509.82\"},\n            {\"Net Profit\", \"0.510%\"},\n            {\"Sharpe Ratio\", \"0.265\"},\n            {\"Sortino Ratio\", \"0.371\"},\n            {\"Probabilistic Sharpe Ratio\", \"39.108%\"},\n            {\"Loss Rate\", \"58%\"},\n            {\"Win Rate\", \"42%\"},\n            {\"Profit-Loss Ratio\", \"0.75\"},\n            {\"Alpha\", \"-0.092\"},\n            {\"Beta\", \"1.22\"},\n            {\"Annual Standard Deviation\", \"0.2\"},\n            {\"Annual Variance\", \"0.04\"},\n            {\"Information Ratio\", \"-0.748\"},\n            {\"Tracking Error\", \"0.088\"},\n            {\"Treynor Ratio\", \"0.043\"},\n            {\"Total Fees\", \"$31.65\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.08%\"},\n            {\"Drawdown Recovery\", \"14\"},\n            {\"OrderListHash\", \"6194b89f404d05e8ba437ce38f4bc4a4\"}\n        };\n\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RiskParityPortfolioWeightsCheckAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http, //www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.DataLibrary.Tests\n{\n    /// <summary>\n    /// Example algorithm of using RiskParityPortfolioConstructionModel.\n    /// Reproduces https://github.com/QuantConnect/Lean/issues/7476\n    /// </summary>\n    public class RiskParityPortfolioWeightsCheckAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private CustomRiskParityPortfolioConstructionModel _portfolioConstructionModel;\n\n        public override void Initialize()\n        {\n            SetStartDate(2021, 2, 21);\n            SetEndDate(2021, 3, 30);\n            SetCash(100000);\n            SetSecurityInitializer(security => security.SetMarketPrice(GetLastKnownPrice(security)));\n\n            AddEquity(\"SPY\", Resolution.Daily);\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            AddAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n\n            _portfolioConstructionModel = new CustomRiskParityPortfolioConstructionModel();\n            SetPortfolioConstruction(_portfolioConstructionModel);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var kvp in _portfolioConstructionModel.Weights)\n            {\n                var weights = kvp.Value;\n                if (weights.Count < 2)\n                {\n                    throw new RegressionTestException($\"Expected multiple different weigths from the PCM for {kvp.Key}\");\n                }\n            }\n        }\n\n        private class CustomRiskParityPortfolioConstructionModel : RiskParityPortfolioConstructionModel\n        {\n            public Dictionary<Symbol, HashSet<double>> Weights { get; } = new();\n\n            protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n            {\n                var result = base.DetermineTargetPercent(activeInsights);\n                foreach (var kvp in result)\n                {\n                    if (!Weights.TryGetValue(kvp.Key.Symbol, out var symbolWeigths))\n                    {\n                        symbolWeigths = new HashSet<double>();\n                        Weights[kvp.Key.Symbol] = symbolWeigths;\n                    }\n\n                    symbolWeigths.Add(kvp.Value);\n                }\n\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 252;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 514;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"31\"},\n            {\"Average Win\", \"0.01%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"5.057%\"},\n            {\"Drawdown\", \"4.900%\"},\n            {\"Expectancy\", \"-0.273\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100509.82\"},\n            {\"Net Profit\", \"0.510%\"},\n            {\"Sharpe Ratio\", \"0.265\"},\n            {\"Sortino Ratio\", \"0.371\"},\n            {\"Probabilistic Sharpe Ratio\", \"39.108%\"},\n            {\"Loss Rate\", \"58%\"},\n            {\"Win Rate\", \"42%\"},\n            {\"Profit-Loss Ratio\", \"0.75\"},\n            {\"Alpha\", \"-0.092\"},\n            {\"Beta\", \"1.22\"},\n            {\"Annual Standard Deviation\", \"0.2\"},\n            {\"Annual Variance\", \"0.04\"},\n            {\"Information Ratio\", \"-0.748\"},\n            {\"Tracking Error\", \"0.088\"},\n            {\"Treynor Ratio\", \"0.043\"},\n            {\"Total Fees\", \"$31.65\"},\n            {\"Estimated Strategy Capacity\", \"$1200000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.08%\"},\n            {\"Drawdown Recovery\", \"14\"},\n            {\"OrderListHash\", \"6194b89f404d05e8ba437ce38f4bc4a4\"}\n        };\n\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RollOutFrontMonthToBackMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that we can liquidate an existing option position with an option strategy.\n    ///\n    /// This specific case rolls out a front month put to a back month put using a calendar spread, working in two steps:\n    ///     1. Short front month put\n    ///     2. Roll out front month put to back month put using a calendar spread.\n    /// </summary>\n    public class RollOutFrontMonthToBackMonthOptionUsingCalendarSpreadRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private Symbol _frontMonthPutSymbol;\n        private Symbol _backMonthPutSymbol;\n        private decimal _atmStrike;\n        private bool _done;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(500000);\n\n            var option = AddOption(\"GOOG\", Resolution.Minute);\n            option.SetFilter(universe => universe.StandardsOnly().Strikes(-1, 1).Expiration(0, 62));\n\n            _symbol = option.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_done || !slice.OptionChains.TryGetValue(_symbol, out var chain) || !chain.Any())\n            {\n                return;\n            }\n\n            var isFirstStep = !Portfolio.Invested;\n            if (isFirstStep)\n            {\n                _atmStrike = chain.MinBy(x => Math.Abs(x.Strike - chain.Underlying.Price)).Strike;\n            }\n\n            var puts = chain.Where(x => x.Strike == _atmStrike && x.Right == OptionRight.Put).ToList();\n\n            if (isFirstStep)\n            {\n                if (puts.Count == 0)\n                {\n                    return;\n                }\n\n                // Step 1: short front month put\n                _frontMonthPutSymbol = puts.MinBy(x => x.Expiry).Symbol;\n                Sell(_frontMonthPutSymbol, 1);\n            }\n            else if (puts.Count > 1)\n            {\n                // Step 2: roll out front month put to back month put using a calendar spread.\n                // Near expiry contract would be the same we shorted in step 1 (closets expiry, same strike),\n                // which we want to roll out to the farther expiry\n                var frontMonthExpiry = puts[0].Expiry;\n                var backMonthExpiry = puts[puts.Count - 1].Expiry;\n                var optionStrategy = OptionStrategies.PutCalendarSpread(_symbol, _atmStrike, frontMonthExpiry, backMonthExpiry);\n                var tickets = Sell(optionStrategy, 1);\n\n                if (!tickets.Any(ticket => ticket.Symbol == _frontMonthPutSymbol && ticket.Quantity == 1))\n                {\n                    throw new RegressionTestException($\"Expected to find a ticket for {_frontMonthPutSymbol} with quantity {-Securities[_frontMonthPutSymbol].Holdings.Quantity}\");\n                }\n\n                _backMonthPutSymbol = tickets.First(ticket => ticket.Symbol != _frontMonthPutSymbol).Symbol;\n                _done = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_done)\n            {\n                throw new RegressionTestException(\"Expected the algorithm to have bought and sold a Bull Call Spread and a Bear Put Spread.\");\n            }\n\n            if (Portfolio.Positions.Groups.Count != 1)\n            {\n                throw new RegressionTestException($\"Expected 1 position group, found {Portfolio.Positions.Groups.Count}\");\n            }\n\n            var positions = Portfolio.Positions.Groups.Single().Positions.ToList();\n            if (positions.Count != 1)\n            {\n                throw new RegressionTestException($\"Expected 1 position in the position group, found {positions.Count}\");\n            }\n\n            // The position should correspond to the far expiry contract\n            var position = positions[0];\n            if (position.Symbol != _backMonthPutSymbol)\n            {\n                throw new RegressionTestException($\"Expected final portfolio position to be {_backMonthPutSymbol}, found {position.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8151;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"500000\"},\n            {\"End Equity\", \"499792\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$190000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 306CZK4DP4VNQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"1.19%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"860bacced1208f152cfc0aad369a111e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RollingWindowAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Using rolling windows for efficient storage of historical data; which automatically clears after a period of time.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"warm up\" />\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"rolling windows\" />\n    public class RollingWindowAlgorithm : QCAlgorithm\n    {\n        private RollingWindow<TradeBar> _window;\n        private RollingWindow<IndicatorDataPoint> _smaWin;\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013,10,1);  // Set Start Date\n            SetEndDate(2013,11,1);    // Set End Date\n            SetCash(100000);          // Set Strategy Cash\n\n            // Find more symbols here: http://quantconnect.com/data\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            // Creates a Rolling Window indicator to keep the 2 TradeBar\n            _window = new RollingWindow<TradeBar>(2);    // For other security types, use QuoteBar\n\n            // Creates an indicator and adds to a rolling window when it is updated\n            var sma = SMA(\"SPY\", 5);\n            sma.Updated += (sender, updated) => _smaWin.Add(updated);\n            _smaWin = new RollingWindow<IndicatorDataPoint>(5);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // Add SPY TradeBar in rollling window\n            _window.Add(slice[\"SPY\"]);\n\n            // Wait for windows to be ready.\n            if (!_window.IsReady || !_smaWin.IsReady) return;\n\n            var currBar = _window[0];                   // Current bar had index zero.\n            var pastBar = _window[1];                   // Past bar has index one.\n            Log($\"Price: {pastBar.Time} -> {pastBar.Close} ... {currBar.Time} -> {currBar.Close}\");\n\n            var currSma = _smaWin[0];                   // Current SMA had index zero.\n            var pastSma = _smaWin[_smaWin.Count - 1];   // Oldest SMA has index of window count minus 1.\n            Log($\"SMA: {pastSma.Time} -> {pastSma.Value} ... {currSma.Time} -> {currSma.Value}\");\n\n            if (!Portfolio.Invested && currSma > pastSma)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/RsiAlphaModelFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to assert the behavior of <see cref=\"RsiAlphaModel\"/>.\n    /// </summary>\n    public class RsiAlphaModelFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetAlpha(new RsiAlphaModel());\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // We have removed all securities from the universe. The Alpha Model should remove the consolidator\n            var consolidatorCount = SubscriptionManager.Subscriptions.Sum(s => s.Consolidators.Count);\n            if (consolidatorCount > 0)\n            {\n                throw new RegressionTestException($\"The number of consolidators should be zero. Actual: {consolidatorCount}\");\n            }\n        }\n\n        public override long DataPoints => 772;\n\n        public override int AlgorithmHistoryDataPoints => 56;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"28\"},\n            {\"Average Win\", \"0.14%\"},\n            {\"Average Loss\", \"-0.08%\"},\n            {\"Compounding Annual Return\", \"0.234%\"},\n            {\"Drawdown\", \"1.900%\"},\n            {\"Expectancy\", \"0.186\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100019.20\"},\n            {\"Net Profit\", \"0.019%\"},\n            {\"Sharpe Ratio\", \"-0.1\"},\n            {\"Sortino Ratio\", \"-0.126\"},\n            {\"Probabilistic Sharpe Ratio\", \"37.678%\"},\n            {\"Loss Rate\", \"57%\"},\n            {\"Win Rate\", \"43%\"},\n            {\"Profit-Loss Ratio\", \"1.77\"},\n            {\"Alpha\", \"0.059\"},\n            {\"Beta\", \"-0.335\"},\n            {\"Annual Standard Deviation\", \"0.048\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-2.498\"},\n            {\"Tracking Error\", \"0.078\"},\n            {\"Treynor Ratio\", \"0.014\"},\n            {\"Total Fees\", \"$62.12\"},\n            {\"Estimated Strategy Capacity\", \"$30000000.00\"},\n            {\"Lowest Capacity Asset\", \"NB R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.67%\"},\n            {\"Drawdown Recovery\", \"7\"},\n            {\"OrderListHash\", \"ddd8bbb62bc3d6306d7e388d383c872a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example demonstrates how to add options for a given underlying equity security. It also\n    /// shows how you can prefilter contracts easily based on strikes and expirations, and how you\n    /// can inspect the option chain to pick a specific option contract to trade.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\"/>\n    /// <meta name=\"tag\" content=\"options\"/>\n    /// <meta name=\"tag\" content=\"filter selection\"/>\n    public class SamcoBasicTemplateOptionsAlgorithm : QCAlgorithm\n    {\n        private const string UnderlyingTicker = \"NIFTY\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetTimeZone(TimeZones.Kolkata);\n            SetBrokerageModel(BrokerageName.Samco, AccountType.Margin);\n            SetAccountCurrency(Currencies.INR);\n\n            var equity = AddEquity(UnderlyingTicker, market: Market.India);\n            var option = AddOption(equity.Symbol, market: Market.India);\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            option.SetFilter(u => u.Strikes(-2, +2)\n                                   // Expiration method accepts TimeSpan objects or integer for\n                                   // days. The following statements yield the same filtering criteria\n                                   .Expiration(0, 180));\n            // .Expiration(TimeSpan.Zero, TimeSpan.FromDays(180)));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for\n        /// receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n            {\n                OptionChain chain;\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out chain))\n                {\n                    // we find at the money (ATM) put contract with farthest expiration\n                    var atmContract = chain\n                        .OrderByDescending(x => x.Expiry)\n                        .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                        .ThenByDescending(x => x.Right)\n                        .FirstOrDefault();\n\n                    if (atmContract != null)\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to\n        /// this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <remarks>\n        /// This method can be called asynchronously and so should only be used by seasoned C#\n        /// experts. Ensure you use proper locks on thread-unsafe objects\n        /// </remarks>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean\n        /// repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = false;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is\n        /// written in.\n        /// </summary>\n        public Language[] Languages { get; } = { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are\n        /// from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Fitness Score\", \"0\"},\n            {\"Kelly Criterion Estimate\", \"0\"},\n            {\"Kelly Criterion Probability Value\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Return Over Maximum Drawdown\", \"0\"},\n            {\"Portfolio Turnover\", \"0\"},\n            {\"Total Insights Generated\", \"0\"},\n            {\"Total Insights Closed\", \"0\"},\n            {\"Total Insights Analysis Completed\", \"0\"},\n            {\"Long Insight Count\", \"0\"},\n            {\"Short Insight Count\", \"0\"},\n            {\"Long/Short Ratio\", \"100%\"},\n            {\"Estimated Monthly Alpha Value\", \"$0\"},\n            {\"Total Accumulated Estimated Alpha Value\", \"$0\"},\n            {\"Mean Population Estimated Insight Value\", \"$0\"},\n            {\"Mean Population Direction\", \"0%\"},\n            {\"Mean Population Magnitude\", \"0%\"},\n            {\"Rolling Averaged Population Direction\", \"0%\"},\n            {\"Rolling Averaged Population Magnitude\", \"0%\"},\n            {\"OrderListHash\", \"1130102123\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScaledFillForwardDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test algorithm reproduces issue https://github.com/QuantConnect/Lean/issues/4834\n    /// fixed in PR https://github.com/QuantConnect/Lean/pull/4836\n    /// Adjusted data of fill forward bars should use original scale factor\n    /// </summary>\n    public class ScaledFillForwardDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private TradeBar _lastRealBar;\n        private Symbol _twx;\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 9);\n\n            _twx = AddEquity(\"TWX\", Resolution.Minute, extendedMarketHours: true).Symbol;\n            Schedule.On(DateRules.EveryDay(_twx), TimeRules.Every(TimeSpan.FromHours(1)), PlotPrice);\n        }\n\n        private void PlotPrice()\n        {\n            Plot($\"{_twx}\", \"Ask\", Securities[_twx].AskPrice);\n            Plot($\"{_twx}\", \"Bid\", Securities[_twx].BidPrice);\n            Plot($\"{_twx}\", \"Price\", Securities[_twx].Price);\n            Plot(\"Portfolio.TPV\", \"Value\", Portfolio.TotalPortfolioValue);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var current = slice.Bars.FirstOrDefault().Value;\n            if (current != null)\n            {\n                if (Time == new DateTime(2014, 06, 09, 4, 1, 0) && !Portfolio.Invested)\n                {\n                    if (!current.IsFillForward)\n                    {\n                        throw new RegressionTestException($\"Was expecting a first fill forward bar {Time}\");\n                    }\n\n                    // trade on the first bar after a factor price scale change. +10 so we fill ASAP. Limit so it fills in extended market hours\n                    LimitOrder(_twx, 1000, _lastRealBar.Close + 10);\n                }\n\n                if (_lastRealBar == null || !current.IsFillForward)\n                {\n                    _lastRealBar = current;\n                }\n                else if (_lastRealBar.Close != current.Close)\n                {\n                    throw new RegressionTestException($\"FillForwarded data point at {Time} was scaled. Actual: {current.Close}; Expected: {_lastRealBar.Close}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_lastRealBar == null)\n            {\n                throw new RegressionTestException($\"Not all expected data points were received.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5507;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"45.475%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100497.59\"},\n            {\"Net Profit\", \"0.498%\"},\n            {\"Sharpe Ratio\", \"9.126\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.977%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.439\"},\n            {\"Beta\", \"-0.184\"},\n            {\"Annual Standard Deviation\", \"0.039\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-1.093\"},\n            {\"Tracking Error\", \"0.059\"},\n            {\"Treynor Ratio\", \"-1.956\"},\n            {\"Total Fees\", \"$5.00\"},\n            {\"Estimated Strategy Capacity\", \"$26000.00\"},\n            {\"Lowest Capacity Asset\", \"AOL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"12.68%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"409eed1832c1cf1db6afaa160e85c639\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScaledRawDataNormalizationModeNotAllowedSecuritiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the <see cref=\"DataNormalizationMode.ScaledRaw\"/> data normalization mode is not allowed for adding subscriptions.\n    /// </summary>\n    public class ScaledRawDataNormalizationModeNotAllowedSecuritiesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2014, 9, 1);\n            SetEndDate(2014, 9, 30);\n            SetCash(100000);\n\n            // Cannot add securities with DataNormalizationMode.ScaledRaw.\n            // The DataManager should throw for this subscription\n            AddEquity(\"AAPL\", Resolution.Daily, dataNormalizationMode: DataNormalizationMode.ScaledRaw);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Running;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScaledRawHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the <see cref=\"DataNormalizationMode.ScaledRaw\"/> data normalization mode is allowed history requests and\n    /// that prices are adjusted to the last factor before the history end date.\n    /// </summary>\n    public class ScaledRawHistoryAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n\n        private DateTime _lastSplitOrDividendDate;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 1, 1);\n            SetEndDate(2014, 12, 31);\n            SetCash(100000);\n            SetBenchmark(x => 0);\n\n            _aapl = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.ContainsKey(_aapl))\n            {\n                _lastSplitOrDividendDate = slice.Splits[_aapl].Time;\n            }\n\n            if (slice.Dividends.ContainsKey(_aapl))\n            {\n                _lastSplitOrDividendDate = slice.Dividends[_aapl].Time;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_lastSplitOrDividendDate == DateTime.MinValue)\n            {\n                throw new RegressionTestException(\"No split or dividend was found in the algorithm.\");\n            }\n\n            var start = Time.AddMonths(-18);\n            var end = Time;\n            var rawHistory = History(new[] { _aapl }, start, end, dataNormalizationMode: DataNormalizationMode.Raw).ToList();\n            var scaledRawHistory = History(new[] { _aapl }, start, end, dataNormalizationMode: DataNormalizationMode.ScaledRaw).ToList();\n\n            if (rawHistory.Count == 0 || scaledRawHistory.Count != rawHistory.Count)\n            {\n                throw new RegressionTestException($@\"Expected history results to not be empty and have the same count. Raw: {rawHistory.Count\n                    }, ScaledRaw: {scaledRawHistory.Count}\");\n            }\n\n            for (var i = 0; i < rawHistory.Count; i++)\n            {\n                var rawBar = rawHistory[i].Bars[_aapl];\n                var scaledRawBar = scaledRawHistory[i].Bars[_aapl];\n\n                if (rawBar.Time < _lastSplitOrDividendDate)\n                {\n                    if (rawBar.Open == scaledRawBar.Open || rawBar.High == scaledRawBar.High || rawBar.Low == scaledRawBar.Low || rawBar.Close == scaledRawBar.Close)\n                    {\n                        throw new RegressionTestException($@\"Expected history results to be different at {rawBar.Time\n                            } before the last split or dividend date {_lastSplitOrDividendDate}\");\n                    }\n                }\n                else if (rawBar.Open != scaledRawBar.Open || rawBar.High != scaledRawBar.High || rawBar.Low != scaledRawBar.Low || rawBar.Close != scaledRawBar.Close)\n                {\n                    throw new RegressionTestException($@\"Expected history results to be the same at {rawBar.Time} after the last split or dividend date {_lastSplitOrDividendDate}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 515;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 760;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScheduledEventsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of the Scheduled Events features available in QuantConnect.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"scheduled events\" />\n    /// <meta name=\"tag\" content=\"date rules\" />\n    /// <meta name=\"tag\" content=\"time rules\" />\n    public class ScheduledEventsAlgorithm : QCAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Minute);\n\n            // events are scheduled using date and time rules\n            // date rules specify on what dates and event will fire\n            // time rules specify at what time on thos dates the event will fire\n\n            // schedule an event to fire at a specific date/time\n            Schedule.On(DateRules.On(2013, 10, 7), TimeRules.At(13, 0), () =>\n            {\n                Log(\"SpecificTime: Fired at : \" + Time);\n            });\n\n            // schedule an event to fire every trading day for a security\n            // the time rule here tells it to fire 10 minutes after SPY's market open\n            Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.AfterMarketOpen(\"SPY\", 10), () =>\n            {\n                Log(\"EveryDay.SPY 10 min after open: Fired at: \" + Time);\n            });\n\n            // schedule an event to fire every trading day for a security\n            // the time rule here tells it to fire 10 minutes before SPY's market close\n            Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.BeforeMarketClose(\"SPY\", 10), () =>\n            {\n                Log(\"EveryDay.SPY 10 min before close: Fired at: \" + Time);\n            });\n\n            // schedule an event to fire on a single day of the week\n            Schedule.On(DateRules.Every(DayOfWeek.Wednesday), TimeRules.At(12, 0), () =>\n            {\n                Log(\"Wed at 12pm: Fired at: \" + Time);\n            });\n\n            // schedule an event to fire on certain days of the week\n            Schedule.On(DateRules.Every(DayOfWeek.Monday, DayOfWeek.Friday), TimeRules.At(12, 0), () =>\n            {\n                Log(\"Mon/Fri at 12pm: Fired at: \" + Time);\n            });\n\n\n            // the scheduling methods return the ScheduledEvent object which can be used for other things\n            // here I set the event up to check the portfolio value every 10 minutes, and liquidate if we have too many losses\n            Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromMinutes(10)), () =>\n            {\n                // if we have over 1000 dollars in unrealized losses, liquidate\n                if (Portfolio.TotalUnrealizedProfit < -1000)\n                {\n                    Log(\"Liquidated due to unrealized losses at: \" + Time);\n                    Liquidate();\n                }\n            });\n\n            // schedule an event to fire at the beginning of the month, the symbol is optional if\n            // specified, it will fire the first trading day for that symbol of the month, if not specified\n            // it will fire on the first day of the month\n            Schedule.On(DateRules.MonthStart(\"SPY\"), TimeRules.AfterMarketOpen(\"SPY\"), () =>\n            {\n                // good spot for rebalancing code?\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScheduledEventsOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduces GH issue 4131, we assert order events are executed in order\n    /// event outside market ours\n    /// </summary>\n    public class ScheduledEventsOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _scheduledEventCount;\n        private int _afterMarketOpenEventCount;\n        private Symbol _spy;\n        private DateTime _lastTime = DateTime.MinValue;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            _spy = AddEquity(\"SPY\").Symbol;\n\n            var test = 0;\n            var dateRule = DateRules.EveryDay(_spy);\n\n            var aEventCount = 0;\n            var bEventCount = 0;\n            var cEventCount = 0;\n\n            var symbol = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            Schedule.On(DateRules.WeekStart(symbol), TimeRules.AfterMarketOpen(symbol), AfterMarketOpen);\n\n            // we add each twice and assert the order in which they are added is also respected for events at the same time\n            for (var i = 0; i < 2; i++)\n            {\n                var id = i;\n                Schedule.On(dateRule, TimeRules.At(9, 25), (name, time) =>\n                {\n                    // for id 0 event count should always be 0, for id 1 should be 1\n                    if (aEventCount != id)\n                    {\n                        throw new RegressionTestException($\"Scheduled event triggered out of order: {Time} expected id {id} but was {aEventCount}\");\n                    }\n                    aEventCount++;\n                    // goes from 0 to 1\n                    aEventCount %= 2;\n                    AssertScheduledEventTime();\n                    Debug($\"{Time} :: Test: {test}\"); test++;\n                });\n                Schedule.On(dateRule, TimeRules.BeforeMarketClose(_spy, 5), (name, time) =>\n                {\n                    // for id 0 event count should always be 0, for id 1 should be 1\n                    if (bEventCount != id)\n                    {\n                        throw new RegressionTestException($\"Scheduled event triggered out of order: {Time} expected id {id} but was {bEventCount}\");\n                    }\n                    bEventCount++;\n                    // goes from 0 to 1\n                    bEventCount %= 2;\n                    AssertScheduledEventTime();\n                    Debug($\"{Time} :: Test: {test}\"); test++;\n                });\n                Schedule.On(dateRule, TimeRules.At(16, 5), (name, time) =>\n                {\n                    // for id 0 event count should always be 0, for id 1 should be 1\n                    if (cEventCount != id)\n                    {\n                        throw new RegressionTestException($\"Scheduled event triggered out of order: {Time} expected id {id} but was {cEventCount}\");\n                    }\n                    cEventCount++;\n                    // goes from 0 to 1\n                    cEventCount %= 2;\n                    AssertScheduledEventTime();\n                    Debug($\"{Time} :: Test: {test}\"); test = 0;\n                });\n            }\n        }\n\n        private void AssertScheduledEventTime()\n        {\n            if (_lastTime > Time)\n            {\n                throw new RegressionTestException($\"Scheduled event time shouldn't go backwards, last time {_lastTime}, current {Time}\");\n            }\n            _lastTime = Time;\n            _scheduledEventCount++;\n        }\n\n        private void AfterMarketOpen()\n        {\n            _afterMarketOpenEventCount++;\n            if (Time.TimeOfDay != TimeSpan.FromHours(9.5))\n            {\n                throw new RegressionTestException($\"AfterMarketOpen unexpected event time: {Time}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_scheduledEventCount != 28)\n            {\n                throw new RegressionTestException($\"OnEndOfAlgorithm expected scheduled events but was {_scheduledEventCount}\");\n            }\n            if (_afterMarketOpenEventCount != 1)\n            {\n                throw new RegressionTestException($\"OnEndOfAlgorithm expected after MarketOpenEvent count {_afterMarketOpenEventCount}\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScheduledQueuingAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class TachyonDynamicGearbox : QCAlgorithm\n    {\n        private int numberOfSymbols;\n        private int numberOfSymbolsFine;\n        private Queue<Symbol> queue;\n        private int dequeueSize;\n        \n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 9, 1);\n            SetEndDate(2020, 9, 2);\n            SetCash(100000);\n            \n            numberOfSymbols = 2000;\n            numberOfSymbolsFine = 1000;\n            SetUniverseSelection(new FineFundamentalUniverseSelectionModel(CoarseSelectionFunction, FineSelectionFunction));\n            \n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            \n            SetExecution(new ImmediateExecutionModel());\n            \n            queue = new Queue<Symbol>();\n            dequeueSize = 100;\n            \n            AddEquity(\"SPY\", Resolution.Minute);\n            Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.At(0, 0), FillQueue);\n            Schedule.On(DateRules.EveryDay(\"SPY\"), TimeRules.Every(TimeSpan.FromMinutes(60)), TakeFromQueue);\n        }\n\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            var sortedByDollarVolume = coarse\n                .Where(x => x.HasFundamentalData)\n                .OrderByDescending(x => x.DollarVolume);\n            return sortedByDollarVolume.Take(numberOfSymbols).Select(x => x.Symbol);\n        }\n        \n        public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            \n            var sortedByPeRatio = fine.OrderByDescending(x => x.ValuationRatios.PERatio);\n            var topFine = sortedByPeRatio.Take(numberOfSymbolsFine);\n            return topFine.Select(x => x.Symbol);\n        }\n        \n        private void FillQueue() {\n            var securities = ActiveSecurities.Values.Where(x => x.Fundamentals != null);\n            \n            // Fill queue with symbols sorted by PE ratio (decreasing order)\n            queue.Clear();\n            var sortedByPERatio = securities.OrderByDescending(x => x.Fundamentals.ValuationRatios.PERatio);\n            foreach (Security security in sortedByPERatio)\n                queue.Enqueue(security.Symbol);\n        }\n        \n        private void TakeFromQueue() {\n            List<Symbol> symbols = new List<Symbol>();\n            for (int i = 0; i < Math.Min(dequeueSize, queue.Count); i++)\n                symbols.Add(queue.Dequeue());\n            History(symbols, 10, Resolution.Daily);\n            \n            Log(\"Symbols at \" + Time + \": \" + string.Join(\", \", symbols.Select(x => x.ToString())));\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/ScheduledUniverseRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of a ScheduledUniverse\n    /// </summary>\n    public class ScheduledUniverseRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private readonly Queue<DateTime> _selectionTime = new(new[] {\n            new DateTime(2013, 10, 7, 1, 0, 0),\n            new DateTime(2013, 10, 8, 1, 0, 0)\n        });\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            AddUniverse(new ScheduledUniverse(DateRules.EveryDay(), TimeRules.At(1, 0), SelectAssets));\n        }\n\n        private IEnumerable<Symbol> SelectAssets(DateTime time)\n        {\n            Debug($\"Universe selection called: {Time}\");\n            var expectedTime = _selectionTime.Dequeue();\n            if (expectedTime != Time)\n            {\n                throw new RegressionTestException($\"Unexpected selection time {Time} expected {expectedTime}\");\n            }\n\n            return new[] { _spy };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionTime.Count > 0)\n            {\n                throw new RegressionTestException(\"Unexpected selection times\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1584;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-87.920%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98824.68\"},\n            {\"Net Profit\", \"-1.175%\"},\n            {\"Sharpe Ratio\", \"-5.981\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.002\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.13\"},\n            {\"Annual Variance\", \"0.017\"},\n            {\"Information Ratio\", \"2.618\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"-0.778\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"33.21%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ScheduledUniverseSelectionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for testing <see cref=\"ScheduledUniverseSelectionModel\"/> scheduling functions\n    /// </summary>\n    public class ScheduledUniverseSelectionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2017, 01, 01);\n            SetEndDate(2017, 02, 01);\n\n            // selection will run on mon/tues/thurs at 00:00/12:00\n            SetUniverseSelection(new ScheduledUniverseSelectionModel(\n                DateRules.Every(DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Thursday),\n                TimeRules.Every(TimeSpan.FromHours(12)),\n                SelectSymbols\n            ));\n\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1)));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n        }\n\n        private IEnumerable<Symbol> SelectSymbols(DateTime dateTime)\n        {\n            Log($\"SelectSymbols() {Time}\");\n            if (dateTime.DayOfWeek == DayOfWeek.Monday || dateTime.DayOfWeek == DayOfWeek.Tuesday)\n            {\n                yield return QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            }\n            else if (dateTime.DayOfWeek == DayOfWeek.Wednesday)\n            {\n                // given the date/time rules specified in Initialize, this symbol will never be selected (not invoked on wednesdays)\n                yield return QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            }\n            else\n            {\n                yield return QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            }\n\n            if (dateTime.DayOfWeek == DayOfWeek.Tuesday || dateTime.DayOfWeek == DayOfWeek.Thursday)\n            {\n                yield return QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda);\n            }\n            else if (dateTime.DayOfWeek == DayOfWeek.Friday)\n            {\n                // given the date/time rules specified in Initialize, this symbol will never be selected (every 6 hours never lands on hour==1)\n                yield return QuantConnect.Symbol.Create(\"EURGBP\", SecurityType.Forex, Market.Oanda);\n            }\n            else\n            {\n                yield return QuantConnect.Symbol.Create(\"NZDUSD\", SecurityType.Forex, Market.Oanda);\n            }\n        }\n\n        // some days of the week have different behavior the first time -- less securities to remove\n        private readonly HashSet<DayOfWeek> _seenDays = new HashSet<DayOfWeek>();\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Console.WriteLine($\"{Time}: {changes}\");\n\n            switch (Time.DayOfWeek)\n            {\n                case DayOfWeek.Monday:\n                    ExpectAdditions(changes, \"SPY\", \"NZDUSD\");\n                    if (_seenDays.Add(DayOfWeek.Monday))\n                    {\n                        ExpectRemovals(changes, null);\n                    }\n                    else\n                    {\n                        ExpectRemovals(changes, \"EURUSD\", \"IBM\");\n                    }\n                    break;\n\n                case DayOfWeek.Tuesday:\n                    ExpectAdditions(changes, \"EURUSD\");\n                    if (_seenDays.Add(DayOfWeek.Tuesday))\n                    {\n                        ExpectRemovals(changes, \"NZDUSD\");\n                    }\n                    else\n                    {\n                        ExpectRemovals(changes, \"NZDUSD\");\n                    }\n                    break;\n\n                case DayOfWeek.Wednesday:\n                    // selection function not invoked on wednesdays\n                    ExpectAdditions(changes, null);\n                    ExpectRemovals(changes, null);\n                    break;\n\n                case DayOfWeek.Thursday:\n                    ExpectAdditions(changes, \"IBM\");\n                    ExpectRemovals(changes, \"SPY\");\n                    break;\n\n                case DayOfWeek.Friday:\n                    // selection function not invoked on fridays\n                    ExpectAdditions(changes, null);\n                    ExpectRemovals(changes, null);\n                    break;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{Time}: {orderEvent}\");\n        }\n\n        private void ExpectAdditions(SecurityChanges changes, params string[] tickers)\n        {\n            if (tickers == null && changes.AddedSecurities.Count > 0)\n            {\n                throw new RegressionTestException($\"{Time}: Expected no additions: {Time.DayOfWeek}\");\n            }\n            if (tickers == null)\n            {\n                return;\n            }\n\n            foreach (var ticker in tickers)\n            {\n                if (changes.AddedSecurities.All(s => s.Symbol.Value != ticker))\n                {\n                    throw new RegressionTestException($\"{Time}: Expected {ticker} to be added: {Time.DayOfWeek}\");\n                }\n            }\n        }\n\n        private void ExpectRemovals(SecurityChanges changes, params string[] tickers)\n        {\n            if (tickers == null && changes.RemovedSecurities.Count > 0)\n            {\n                throw new RegressionTestException($\"{Time}: Expected no removals: {Time.DayOfWeek}\");\n            }\n\n            if (tickers == null)\n            {\n                return;\n            }\n\n            foreach (var ticker in tickers)\n            {\n                if (changes.RemovedSecurities.All(s => s.Symbol.Value != ticker))\n                {\n                    throw new RegressionTestException($\"{Time}: Expected {ticker} to be removed: {Time.DayOfWeek}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 989;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"59\"},\n            {\"Average Win\", \"0.28%\"},\n            {\"Average Loss\", \"-0.20%\"},\n            {\"Compounding Annual Return\", \"73.882%\"},\n            {\"Drawdown\", \"1.100%\"},\n            {\"Expectancy\", \"0.749\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"105049.17\"},\n            {\"Net Profit\", \"5.049%\"},\n            {\"Sharpe Ratio\", \"7.048\"},\n            {\"Sortino Ratio\", \"10.495\"},\n            {\"Probabilistic Sharpe Ratio\", \"96.425%\"},\n            {\"Loss Rate\", \"27%\"},\n            {\"Win Rate\", \"73%\"},\n            {\"Profit-Loss Ratio\", \"1.39\"},\n            {\"Alpha\", \"0.458\"},\n            {\"Beta\", \"0.044\"},\n            {\"Annual Standard Deviation\", \"0.066\"},\n            {\"Annual Variance\", \"0.004\"},\n            {\"Information Ratio\", \"3.893\"},\n            {\"Tracking Error\", \"0.083\"},\n            {\"Treynor Ratio\", \"10.5\"},\n            {\"Total Fees\", \"$35.53\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"EURUSD 8G\"},\n            {\"Portfolio Turnover\", \"87.56%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"9af211e68f600642a2aaa58f3bec6380\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example algorithm defines its own custom coarse/fine fundamental selection model\n    /// with equally weighted portfolio and a maximum sector exposure\n    /// </summary>\n    public class SectorExposureRiskFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 04, 07);\n            SetCash(100000);\n\n            SetUniverseSelection(new FineFundamentalUniverseSelectionModel(SelectCoarse, SelectFine));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, QuantConnect.Time.OneDay));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetRiskManagement(new MaximumSectorExposureRiskManagementModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                Debug($\"Order event: {orderEvent}. Holding value: {Securities[orderEvent.Symbol].Holdings.AbsoluteHoldingsValue}\");\n            }\n        }\n\n        private IEnumerable<Symbol> SelectCoarse(IEnumerable<CoarseFundamental> coarse)\n        {\n            var tickers = Time.Date < new DateTime(2014, 4, 1)\n                ? new[] { \"AAPL\", \"AIG\", \"IBM\" }\n                : new[] { \"GOOG\", \"BAC\", \"SPY\" };\n\n            return tickers.Select(x => QuantConnect.Symbol.Create(x, SecurityType.Equity, Market.USA));\n        }\n\n        private IEnumerable<Symbol> SelectFine(IEnumerable<FineFundamental> fine) => fine.Select(f => f.Symbol);\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7246;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"16\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"-0.09%\"},\n            {\"Compounding Annual Return\", \"-89.499%\"},\n            {\"Drawdown\", \"8.300%\"},\n            {\"Expectancy\", \"-0.831\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"91718.76\"},\n            {\"Net Profit\", \"-8.281%\"},\n            {\"Sharpe Ratio\", \"-3.238\"},\n            {\"Sortino Ratio\", \"-2.445\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.000%\"},\n            {\"Loss Rate\", \"83%\"},\n            {\"Win Rate\", \"17%\"},\n            {\"Profit-Loss Ratio\", \"0.02\"},\n            {\"Alpha\", \"-0.762\"},\n            {\"Beta\", \"0.276\"},\n            {\"Annual Standard Deviation\", \"0.252\"},\n            {\"Annual Variance\", \"0.063\"},\n            {\"Information Ratio\", \"-2.402\"},\n            {\"Tracking Error\", \"0.26\"},\n            {\"Treynor Ratio\", \"-2.954\"},\n            {\"Total Fees\", \"$25.93\"},\n            {\"Estimated Strategy Capacity\", \"$54000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"11.09%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"370ce70c920470fa54d855d700a7bf48\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SectorWeightingFrameworkAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example algorithm defines its own custom coarse/fine fundamental selection model\n    /// with sector weighted portfolio\n    /// </summary>\n    public class SectorWeightingFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Dictionary<Symbol, decimal> _targets = new Dictionary<Symbol, decimal>();\n\n        public override void Initialize()\n        {\n            // Set requested data resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 04, 02);\n            SetEndDate(2014, 04, 06);\n            SetCash(100000);\n\n            SetUniverseSelection(new FineFundamentalUniverseSelectionModel(SelectCoarse, SelectFine));\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, QuantConnect.Time.OneDay));\n            SetPortfolioConstruction(new SectorWeightingPortfolioConstructionModel());\n\n            Func<string, Symbol> toSymbol = t => QuantConnect.Symbol.Create(t, SecurityType.Equity, Market.USA);\n            _targets.Add(toSymbol(\"AAPL\"), .25m);\n            _targets.Add(toSymbol(\"AIG\"), .5m);\n            _targets.Add(toSymbol(\"IBM\"), .25m);\n            _targets.Add(toSymbol(\"GOOG\"), .5m);\n            _targets.Add(toSymbol(\"BAC\"), .5m);\n            _targets.Add(toSymbol(\"SPY\"), 0);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status.IsFill())\n            {\n                var symbol = orderEvent.Symbol;\n                var security = Securities[symbol];\n\n                var absoluteBuyingPower = security.BuyingPowerModel\n                    .GetReservedBuyingPowerForPosition(new ReservedBuyingPowerForPositionParameters(security))\n                    .AbsoluteUsedBuyingPower   // See GH issue 4107\n                    * security.BuyingPowerModel.GetLeverage(security);\n\n                var portfolioShare = absoluteBuyingPower / Portfolio.TotalPortfolioValue;\n\n                Debug($\"Order event: {orderEvent}. Absolute buying power: {absoluteBuyingPower}\");\n\n                // Checks whether the portfolio share of a given symbol matches its target\n                // Only considers the buy orders, because holding value is zero otherwise\n                if (Math.Abs(_targets[symbol] - portfolioShare) > 0.01m && orderEvent.Direction == OrderDirection.Buy)\n                {\n                    throw new RegressionTestException($\"Target for {symbol}: expected {_targets[symbol]}, actual: {portfolioShare}\");\n                }\n            }\n        }\n\n        private IEnumerable<Symbol> SelectCoarse(IEnumerable<CoarseFundamental> coarse)\n        {\n            return Time.Date < new DateTime(2014, 4, 4)\n                // IndustryTemplateCode of AAPL and IBM is N and AIG is I\n                ? _targets.Keys.Take(3)\n                // IndustryTemplateCode of GOOG is N and BAC is B. SPY have no fundamentals\n                : _targets.Keys.Skip(3);\n        }\n\n        private IEnumerable<Symbol> SelectFine(IEnumerable<FineFundamental> fine) => fine.Select(f => f.Symbol);\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 52;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"9\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-67.218%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99087.50\"},\n            {\"Net Profit\", \"-0.912%\"},\n            {\"Sharpe Ratio\", \"-12.084\"},\n            {\"Sortino Ratio\", \"-12.084\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.291\"},\n            {\"Beta\", \"0.491\"},\n            {\"Annual Standard Deviation\", \"0.057\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"2.114\"},\n            {\"Tracking Error\", \"0.059\"},\n            {\"Treynor Ratio\", \"-1.41\"},\n            {\"Total Fees\", \"$14.98\"},\n            {\"Estimated Strategy Capacity\", \"$150000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"33.44%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"e3f762555cf5848a2e79c1e23b11ca32\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityCustomPropertiesAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to use custom security properties.\n    /// In this algorithm we trade a security based on the values of a slow and fast EMAs which are stored in the security itself.\n    /// </summary>\n    public class SecurityCustomPropertiesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Equity _spy;\n        private dynamic _dynamicSpy;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute);\n\n            // Using the dynamic interface to store our indicator as a custom property\n            _dynamicSpy = _spy;\n            _dynamicSpy.SlowEma = EMA(_spy.Symbol, 30, Resolution.Minute);\n\n            // Using the generic interface to store our indicator as a custom property\n            _spy.Add(\"FastEma\", EMA(_spy.Symbol, 60, Resolution.Minute));\n\n            // Using the indexer to store our indicator as a custom property\n            _spy[\"BB\"] = BB(_spy.Symbol, 20, 1, MovingAverageType.Simple, Resolution.Minute);\n\n            // Fee factor to be used by the custom fee model\n            _dynamicSpy.FeeFactor = 0.00002m;\n            _spy.SetFeeModel(new CustomFeeModel());\n\n            // This property will be used to store the prices used to calculate the fees in order to assert the correct fee factor is used.\n            _dynamicSpy.OrdersFeesPrices = new Dictionary<int, decimal>();\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_dynamicSpy.FastEma.IsReady)\n            {\n                return;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                // Using the dynamic interface to access the custom properties\n                if (_dynamicSpy.SlowEma > _dynamicSpy.FastEma)\n                {\n                    SetHoldings(_spy.Symbol, 1);\n                }\n            }\n            // Using the generic interface to access the custom properties\n            else if (_spy.Get<ExponentialMovingAverage>(\"SlowEma\") < _spy.Get<ExponentialMovingAverage>(\"FastEma\"))\n            {\n                Liquidate(_spy.Symbol);\n            }\n\n            // Using the indexer to access the custom properties\n            var bb = _spy[\"BB\"] as BollingerBands;\n            Plot(\"BB\", bb.UpperBand, bb.MiddleBand, bb.LowerBand);\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                var fee = orderEvent.OrderFee;\n                var expectedFee = _dynamicSpy.OrdersFeesPrices[orderEvent.OrderId] * orderEvent.AbsoluteFillQuantity * _dynamicSpy.FeeFactor;\n                if (fee.Value.Amount != expectedFee)\n                {\n                    throw new RegressionTestException($\"Custom fee model failed to set the correct fee. Expected: {expectedFee}. Actual: {fee.Value.Amount}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Transactions.OrdersCount == 0)\n            {\n                throw new RegressionTestException(\"No orders executed\");\n            }\n        }\n\n        /// <summary>\n        /// This custom fee is implemented for demonstration purposes only.\n        /// </summary>\n        private class CustomFeeModel : FeeModel\n        {\n            public CustomFeeModel()\n            {\n            }\n\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                var security = parameters.Security;\n                // custom fee math using the fee factor stored in security instance\n                var hasFeeFactor = security.TryGet<decimal>(\"FeeFactor\", out var feeFactor);\n                if (!hasFeeFactor)\n                {\n                    feeFactor = 0.00001m;\n                }\n\n                // Store the price used to calculate the fee for this order\n                ((dynamic)security).OrdersFeesPrices[parameters.Order.Id] = security.Price;\n\n                var fee = Math.Max(1m, security.Price * parameters.Order.AbsoluteQuantity * feeFactor);\n\n                return new OrderFee(new CashAmount(fee, \"USD\"));\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"31\"},\n            {\"Average Win\", \"0.43%\"},\n            {\"Average Loss\", \"-0.08%\"},\n            {\"Compounding Annual Return\", \"84.608%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0.628\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100786.91\"},\n            {\"Net Profit\", \"0.787%\"},\n            {\"Sharpe Ratio\", \"12.062\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"88.912%\"},\n            {\"Loss Rate\", \"73%\"},\n            {\"Win Rate\", \"27%\"},\n            {\"Profit-Loss Ratio\", \"5.11\"},\n            {\"Alpha\", \"0.258\"},\n            {\"Beta\", \"0.342\"},\n            {\"Annual Standard Deviation\", \"0.077\"},\n            {\"Annual Variance\", \"0.006\"},\n            {\"Information Ratio\", \"-7.082\"},\n            {\"Tracking Error\", \"0.147\"},\n            {\"Treynor Ratio\", \"2.73\"},\n            {\"Total Fees\", \"$59.78\"},\n            {\"Estimated Strategy Capacity\", \"$7300000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"597.29%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"947ae7fbc63fb8cc499f96ac92ee3394\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the behavior of the algorithm when a security is removed and re-added.\n    /// It asserts that the securities are marked as non-tradable when removed and that they are tradable when re-added.\n    /// It also asserts that the algorithm receives the correct security changed events for the added and removed securities.\n    ///\n    /// Additionally, it tests that the security is initialized after every addition, and no more.\n    ///\n    /// This specific algorithm tests this behavior for equities.\n    /// </summary>\n    public class SecurityInitializationOnReAdditionForEquityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        private Queue<DateTime> _tradableDates;\n        private bool _securityWasRemoved;\n        private Dictionary<Security, int> _securityInializationCounts = new();\n\n        protected virtual DateTime StartTimeToUse => new DateTime(2013, 10, 05);\n\n        protected virtual DateTime EndTimeToUse => new DateTime(2013, 10, 30);\n\n        public override void Initialize()\n        {\n            SetStartDate(StartTimeToUse);\n            SetEndDate(EndTimeToUse);\n\n            var seeder = new FuncSecuritySeeder((security) =>\n            {\n                if (!_securityInializationCounts.TryGetValue(security, out var count))\n                {\n                    count = 0;\n                }\n                _securityInializationCounts[security] = count + 1;\n\n                Debug($\"[{Time}] Seeding {security.Symbol}\");\n                return GetLastKnownPrices(security);\n            });\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n\n            _security = AddSecurityImpl();\n\n            _tradableDates = new(QuantConnect.Time.EachTradeableDay(_security.Exchange.Hours, StartDate, EndDate));\n\n            Schedule.On(DateRules.EveryDay(_security.Symbol), TimeRules.Midnight, () =>\n            {\n                var currentTradableDate = _tradableDates.Dequeue();\n                if (currentTradableDate != Time.Date)\n                {\n                    throw new RegressionTestException($\"Expected the current tradable date to be {Time.Date}. Got {currentTradableDate}\");\n                }\n\n                if (Time == StartDate)\n                {\n                    return;\n                }\n\n                // Before we remove the security let's check that it was not initialized again\n                AssertSecurityInitializationCount(_securityInializationCounts, _security);\n\n                // Remove the security every day\n                Debug($\"[{Time}] Removing the security\");\n                _securityWasRemoved = RemoveSecurity(_security.Symbol);\n\n                if (!_securityWasRemoved)\n                {\n                    throw new RegressionTestException($\"Expected the security to be removed\");\n                }\n\n                if (_security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the security to be not tradable after removing it\");\n                }\n            });\n        }\n\n        private Security AddSecurityImpl()\n        {\n            _securityInializationCounts.Clear();\n            var security = AddSecurity();\n\n            if (_security != null && !ReferenceEquals(_security, security))\n            {\n                throw new RegressionTestException($\"Expected the security to be the same as the original security\");\n            }\n\n            AssertSecurityInitializationCount(_securityInializationCounts, security);\n\n            return security;\n        }\n\n        protected virtual Security AddSecurity()\n        {\n            return AddEquity(\"SPY\");\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (_securityWasRemoved)\n            {\n                if (changes.AddedSecurities.Count > 0)\n                {\n                    throw new RegressionTestException($\"Expected no securities to be added. Got {changes.AddedSecurities.Count}\");\n                }\n\n                if (!changes.RemovedSecurities.Contains(_security))\n                {\n                    throw new RegressionTestException($\"Expected the security to be removed. Got {changes.RemovedSecurities.Count}\");\n                }\n\n                _securityWasRemoved = false;\n\n                // Add the security back\n                Debug($\"[{Time}] Re-adding the security\");\n                var reAddedSecurity = AddSecurityImpl();\n\n                if (!ReferenceEquals(reAddedSecurity, _security))\n                {\n                    throw new RegressionTestException($\"Expected the re-added security to be the same as the original security\");\n                }\n\n                if (!reAddedSecurity.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the re-added security to be tradable\");\n                }\n            }\n            else if (!changes.AddedSecurities.Contains(_security))\n            {\n                throw new RegressionTestException($\"Expected the security to be added back\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_tradableDates.Count > 0)\n            {\n                throw new RegressionTestException($\"Expected no more tradable dates. Still have {_tradableDates.Count}\");\n            }\n        }\n\n        protected virtual void AssertSecurityInitializationCount(Dictionary<Security, int>  securityInializationCounts, Security security)\n        {\n            if (securityInializationCounts.Count != 1)\n            {\n                throw new RegressionTestException($\"Expected only one security to be initialized. Got {securityInializationCounts.Count}\");\n            }\n\n            if (!securityInializationCounts.TryGetValue(security, out var count) || count != 1)\n            {\n                throw new RegressionTestException($\"Expected the security to be initialized once and once only, \" +\n                    $\"but was initialized {count} times\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 4072;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 2948;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-5.028\"},\n            {\"Tracking Error\", \"0.11\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityInitializationOnReAdditionForManuallyAddedFutureContractRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the behavior of the algorithm when a security is removed and re-added.\n    /// It asserts that the securities are marked as non-tradable when removed and that they are tradable when re-added.\n    /// It also asserts that the algorithm receives the correct security changed events for the added and removed securities.\n    ///\n    /// Additionally, it tests that the security is initialized after every addition, and no more.\n    ///\n    /// This specific algorithm tests this behavior for manually added future contracts.\n    /// </summary>\n    public class SecurityInitializationOnReAdditionForManuallyAddedFutureContractRegressionAlgorithm : SecurityInitializationOnReAdditionForEquityRegressionAlgorithm\n    {\n        private static readonly Symbol _futureContractSymbol = QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2013, 12, 20));\n\n        protected override DateTime StartTimeToUse => new DateTime(2013, 10, 07);\n\n        protected override DateTime EndTimeToUse => new DateTime(2013, 10, 17);\n\n        protected override Security AddSecurity()\n        {\n            return AddFutureContract(_futureContractSymbol, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 101;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 80;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.029\"},\n            {\"Tracking Error\", \"0.155\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityInitializationOnReAdditionForManuallyAddedOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the behavior of the algorithm when a security is removed and re-added.\n    /// It asserts that the securities are marked as non-tradable when removed and that they are tradable when re-added.\n    /// It also asserts that the algorithm receives the correct security changed events for the added and removed securities.\n    ///\n    /// Additionally, it tests that the security is initialized after every addition, and no more.\n    ///\n    /// This specific algorithm tests this behavior for manually added option contracts.\n    /// </summary>\n    public class SecurityInitializationOnReAdditionForManuallyAddedOptionRegressionAlgorithm : SecurityInitializationOnReAdditionForEquityRegressionAlgorithm\n    {\n        private static readonly Symbol _optionContractSymbol = QuantConnect.Symbol.CreateOption(\n            QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n            Market.USA,\n            OptionStyle.American,\n            OptionRight.Call,\n            342.9m,\n            new DateTime(2014, 07, 19));\n\n        private int _securityAdditionsCount;\n\n        protected override DateTime StartTimeToUse => new DateTime(2014, 06, 04);\n\n        protected override DateTime EndTimeToUse => new DateTime(2014, 06, 20);\n\n        protected override Security AddSecurity()\n        {\n            _securityAdditionsCount++;\n            return AddOptionContract(_optionContractSymbol, Resolution.Daily);\n        }\n\n        protected override void AssertSecurityInitializationCount(Dictionary<Security, int> securityInializationCounts, Security security)\n        {\n            // The first time the contract is added, the underlying equity will be added and initialized as well.\n            // The following times the contract is added, the underlying equity will not be added again.\n            var expectedSecuritiesInitialized = 1;\n            if (_securityAdditionsCount == 1)\n            {\n                expectedSecuritiesInitialized = 2;\n            }\n\n            if (securityInializationCounts.Count != expectedSecuritiesInitialized)\n            {\n                throw new RegressionTestException($\"Expected {expectedSecuritiesInitialized} security to be initialized. \" +\n                    $\"Got {securityInializationCounts.Count}\");\n            }\n\n            if (!securityInializationCounts.TryGetValue(security, out var count) || count != 1)\n            {\n                throw new RegressionTestException($\"Expected the option contract to be initialized once and once only, \" +\n                    $\"but was initialized {count} times\");\n            }\n\n            if (expectedSecuritiesInitialized == 2 &&\n                !securityInializationCounts.TryGetValue(Securities[security.Symbol.Underlying], out count) || count != 1)\n            {\n                throw new RegressionTestException($\"Expected the underlying security to be initialized once and once only, \" +\n                    $\"but was initialized {count} times\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 139;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.27\"},\n            {\"Tracking Error\", \"0.056\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the behavior of the algorithm when a security is removed and re-added.\n    /// It asserts that the securities are marked as non-tradable when removed and that they are tradable when re-added.\n    /// It also asserts that the algorithm receives the correct security changed events for the added and removed securities.\n    ///\n    /// Additionally, it tests that the security is initialized after every addition, and no more.\n    ///\n    /// This specific algorithm tests this behavior for option contracts that are selected, deselected and re-selected.\n    /// </summary>\n    public class SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _canonicalOption;\n        private List<Symbol> _contractsToSelect;\n        private HashSet<Option> _selectedContracts = new();\n        private bool _selectSingle;\n        private int _selectionsCount;\n\n        private Dictionary<Security, int> _securityInializationCounts = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 04);\n            SetEndDate(2014, 06, 20);\n            SetCash(100000);\n\n            var seeder = new FuncSecuritySeeder((security) =>\n            {\n                if (security is Option option)\n                {\n                    if (!_securityInializationCounts.TryGetValue(security, out var count))\n                    {\n                        count = 0;\n                    }\n                    _securityInializationCounts[security] = count + 1;\n                }\n\n                Debug($\"[{Time}] Seeding {security.Symbol}\");\n                return GetLastKnownPrices(security);\n            });\n\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n\n            var equitySymbol = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            _contractsToSelect = new List<Symbol>()\n            {\n                QuantConnect.Symbol.CreateOption(equitySymbol, Market.USA, OptionStyle.American, OptionRight.Call, 335.7m, new DateTime(2014, 07, 19)),\n                QuantConnect.Symbol.CreateOption(equitySymbol, Market.USA, OptionStyle.American, OptionRight.Call, 335.7m, new DateTime(2015, 01, 17))\n            };\n\n            var option = AddOption(equitySymbol, Resolution.Daily);\n            option.SetFilter(u => u.Contracts(contracts =>\n            {\n                _selectionsCount++;\n                _securityInializationCounts.Clear();\n\n                List<Symbol> selected;\n                if (_selectSingle)\n                {\n                    _selectSingle = false;\n                    selected = _contractsToSelect.Take(1).ToList();\n                }\n                else\n                {\n                    _selectSingle = true;\n                    selected = _contractsToSelect;\n                }\n\n                Log($\"[{Time}] [{UtcTime}] Selecting {string.Join(\", \", selected.Select(x => x.Value))}\");\n                return selected;\n            }));\n\n            _canonicalOption = option.Symbol;\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.AddedSecurities)\n            {\n                if (!security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the security to be tradable. Symbol: {security.Symbol}\");\n                }\n            }\n\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the security to be not tradable. Symbol: {security.Symbol}\");\n                }\n            }\n\n            var underlyingEquity = changes.AddedSecurities.FirstOrDefault(x => x.Symbol == _canonicalOption.Underlying);\n            if (Time == StartDate)\n            {\n                if (underlyingEquity == null)\n                {\n                    throw new RegressionTestException($\"Expected the underlying equity to be added. \" +\n                        $\"Added: {string.Join(\", \", changes.AddedSecurities.Select(x => x.Symbol.Value))}\");\n                }\n            }\n            else if (underlyingEquity != null)\n            {\n                throw new RegressionTestException($\"Expected the underlying equity to not be added. \" +\n                    $\"Added: {string.Join(\", \", changes.AddedSecurities.Select(x => x.Symbol.Value))}\");\n            }\n\n            var addedContracts = changes.AddedSecurities.OfType<Option>().ToList();\n            if (addedContracts.Any(x => !_securityInializationCounts.TryGetValue(x, out var count) || count != 1))\n            {\n                throw new RegressionTestException($\"Expected all contracts to be initialized. Added: {string.Join(\", \", addedContracts.Select(x => x.Symbol.Value))}, Initialized: {string.Join(\", \", _securityInializationCounts.Select(x => $\"{x.Key.Symbol.Value} - {x.Value}\"))}\");\n            }\n\n            // The first contract will be selected always, so we expect it to be added only once\n            var firstAddedContract = changes.AddedSecurities.FirstOrDefault(x => x.Symbol == _contractsToSelect[0]) as Option;\n            if (firstAddedContract == null)\n            {\n                if (_selectedContracts.Contains(firstAddedContract))\n                {\n                    throw new RegressionTestException($\"Expected the first contract to be added only once\");\n                }\n            }\n\n            // _selectSingle flag was set to true, so we expect both contracts to be selected\n            if (_selectSingle)\n            {\n                if (!changes.AddedSecurities.Any(x => x.Symbol == _contractsToSelect[1]))\n                {\n                    throw new RegressionTestException($\"Expected the second contract to be added\");\n                }\n            }\n            else\n            {\n                if (changes.AddedSecurities.Any(x => x.Symbol == _contractsToSelect[1]))\n                {\n                    throw new RegressionTestException($\"Expected the second contract to not be added\");\n                }\n\n                var removedContract = changes.RemovedSecurities.FirstOrDefault(x => x.Symbol == _contractsToSelect[1]);\n\n                if (removedContract == null)\n                {\n                    throw new RegressionTestException($\"Expected the second contract to be removed\");\n                }\n\n                if (removedContract.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the second contract to be not tradable since it was removed\");\n                }\n            }\n\n            foreach (var security in changes.AddedSecurities.OfType<Option>())\n            {\n                _selectedContracts.Add(security);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionsCount == 0)\n            {\n                throw new RegressionTestException(\"Expected at least one selection\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 39254;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-6.27\"},\n            {\"Tracking Error\", \"0.056\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityInitializationOnReAdditionForUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the behavior of the algorithm when a security is removed and re-added.\n    /// It asserts that the securities are marked as non-tradable when removed and that they are tradable when re-added.\n    /// It also asserts that the algorithm receives the correct security changed events for the added and removed securities.\n    ///\n    /// Additionally, it tests that the security is initialized after every addition, and no more.\n    ///\n    /// This specific algorithm tests this behavior for securities selected, deselected and re-selected from universes.\n    /// </summary>\n    public class SecurityInitializationOnReAdditionForUniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _symbolsToSelect;\n        private List<Symbol> _selectedSymbols;\n        private int _selectionsCount;\n\n        private Dictionary<Security, int> _securityInializationCounts = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 04, 07);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            var seeder = new FuncSecuritySeeder((security) =>\n            {\n                if (!_securityInializationCounts.TryGetValue(security, out var count))\n                {\n                    count = 0;\n                }\n                _securityInializationCounts[security] = count + 1;\n\n                Debug($\"[{Time}] Seeding {security.Symbol}\");\n                return GetLastKnownPrices(security);\n            });\n\n            SetSecurityInitializer(security => seeder.SeedSecurity(security));\n\n            _symbolsToSelect = new List<Symbol>()\n            {\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IWM\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n            };\n\n            AddUniverse(\"MyUniverse\", Resolution.Daily, SelectionFunction);\n        }\n\n        private IEnumerable<string> SelectionFunction(DateTime dateTime)\n        {\n            _securityInializationCounts.Clear();\n            _selectionsCount++;\n\n            _selectedSymbols = _symbolsToSelect.Skip(dateTime.Day % 2 == 0 ? 0 : 3).Take(3).ToList();\n            return _selectedSymbols.Select(x => x.Value);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.AddedSecurities)\n            {\n                if (!security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the security to be tradable. Symbol: {security.Symbol}\");\n                }\n            }\n\n            foreach (var security in changes.RemovedSecurities)\n            {\n                if (security.IsTradable)\n                {\n                    throw new RegressionTestException($\"Expected the security to be not tradable. Symbol: {security.Symbol}\");\n                }\n            }\n\n            if (changes.AddedSecurities.Count != _selectedSymbols.Count ||\n                changes.AddedSecurities.Any(x => !_selectedSymbols.Contains(x.Symbol)))\n            {\n                throw new RegressionTestException($\"Expected the added securities to be the selected ones. \" +\n                    $\"Added: {string.Join(\", \", changes.AddedSecurities.Select(x => x.Symbol.Value))}, \" +\n                    $\"Selected: {string.Join(\", \", _selectedSymbols)}\");\n            }\n\n            if (changes.AddedSecurities.Count != _securityInializationCounts.Count ||\n                changes.AddedSecurities.Any(x => !_securityInializationCounts.TryGetValue(x, out var count) || count != 1))\n            {\n                throw new RegressionTestException($\"Expected all contracts to be initialized. \" +\n                    $\"Added: {string.Join(\", \", changes.AddedSecurities.Select(x => x.Symbol.Value))}, \" +\n                    $\"Initialized: {string.Join(\", \", _securityInializationCounts.Select(x => $\"{x.Key.Symbol.Value} - {x.Value}\"))}\");\n            }\n\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                var expectedDeselectedSymbols = _symbolsToSelect.Where(x => !_selectedSymbols.Contains(x)).ToList();\n\n                if (changes.RemovedSecurities.Count != expectedDeselectedSymbols.Count ||\n                    changes.RemovedSecurities.Any(x => !expectedDeselectedSymbols.Contains(x.Symbol)))\n                {\n                    throw new RegressionTestException($\"Expected the removed securities to be the deselected ones. \" +\n                        $\"Removed: {string.Join(\", \", changes.RemovedSecurities.Select(x => x.Symbol.Value))}, \" +\n                        $\"Deselected: {string.Join(\", \", expectedDeselectedSymbols)}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionsCount < 2)\n            {\n                throw new RegressionTestException(\"Expected at least two selections\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 128;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 150;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0.97\"},\n            {\"Tracking Error\", \"0.097\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySeederRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue #5921. Asserting a security can be warmup correctly on initialize\n    /// </summary>\n    public class SecuritySeederRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n            SetSecurityInitializer(new BrokerageModelSecurityInitializer(BrokerageModel,\n                new FuncSecuritySeeder(GetLastKnownPrices)));\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                if (!addedSecurity.HasData\n                    || addedSecurity.AskPrice == 0\n                    || addedSecurity.BidPrice == 0\n                    || addedSecurity.BidSize == 0\n                    || addedSecurity.AskSize == 0\n                    || addedSecurity.Price == 0\n                    || addedSecurity.Volume == 0\n                    || addedSecurity.High == 0\n                    || addedSecurity.Low == 0\n                    || addedSecurity.Open == 0\n                    || addedSecurity.Close == 0)\n                {\n                    throw new RegressionTestException($\"Security {addedSecurity.Symbol} was not warmed up!\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2369;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 10;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"307.471%\"},\n            {\"Drawdown\", \"1.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101031.62\"},\n            {\"Net Profit\", \"1.032%\"},\n            {\"Sharpe Ratio\", \"66.263\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.116\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.242\"},\n            {\"Annual Variance\", \"0.058\"},\n            {\"Information Ratio\", \"-198.985\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"16.083\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$31000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"33.62%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"00636a25aed88acd2171c6221c747716\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionDailyNoPreciseEndTimeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionDailyNoPreciseEndTimeRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n        protected override bool DailyPreciseEndTime => false;\n\n        protected override void ConfigureSchedule()\n        {\n            Schedule.On(DateRules.EveryDay(), TimeRules.At(0, 0, 1), ValidateSessionBars);\n        }\n\n        protected override void ValidateSessionBars()\n        {\n            if (ProcessedDataCount == 0)\n            {\n                return;\n            }\n            var session = Security.Session;\n            PreviousSessionBar = new TradeBar(CurrentDate, Security.Symbol, Open, High, Low, Close, Volume);\n\n            // At this point the data was consolidated so we can check the previous session bar (index 1)\n            if (session[1].Open != Open\n                || session[1].High != High\n                || session[1].Low != Low\n                || session[1].Close != Close\n                || session[1].Volume != Volume)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n        }\n\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 48;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionExtendedMarketHoursRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Minute;\n        protected override bool ExtendedMarketHours => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 9643;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to validate Security.Session functionality.\n    /// Verifies that daily session bars (Open, High, Low, Close, Volume) are correctly\n    /// </summary>\n    public class SecuritySessionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected int ProcessedDataCount { get; set; }\n        protected bool SecurityWasRemoved { get; set; }\n        protected decimal Open { get; set; }\n        protected decimal High { get; set; }\n        protected decimal Low { get; set; }\n        protected decimal Close { get; set; }\n        protected decimal Volume { get; set; }\n        protected Security Security { get; set; }\n        protected virtual Resolution Resolution => Resolution.Hour;\n        protected virtual bool DailyPreciseEndTime => true;\n        protected virtual bool ExtendedMarketHours => false;\n        protected TradeBar PreviousSessionBar { get; set; }\n        protected DateTime CurrentDate { get; set; }\n\n        /// <summary>\n        /// Initialise the data\n        /// </summary>\n        public override void Initialize()\n        {\n            AddSecurityInitializer((security) =>\n            {\n                // activate session tracking\n                security.Session.Size = 3;\n            });\n            Settings.DailyPreciseEndTime = DailyPreciseEndTime;\n            InitializeSecurity();\n\n            // Check initial session values\n            var session = Security.Session;\n            if (session == null)\n            {\n                throw new RegressionTestException(\"Security.Session is null\");\n            }\n            if (session.Open != 0\n                || session.High != 0\n                || session.Low != 0\n                || session.Close != 0\n                || session.Volume != 0\n                || session.OpenInterest != 0)\n            {\n                throw new RegressionTestException(\"Session should start with all zero values.\");\n            }\n            ProcessedDataCount = 0;\n            Low = decimal.MaxValue;\n            CurrentDate = StartDate;\n            ConfigureSchedule();\n        }\n\n        public virtual void InitializeSecurity()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            Security = AddEquity(\"SPY\", Resolution, extendedMarketHours: ExtendedMarketHours);\n        }\n\n        protected virtual void ConfigureSchedule()\n        {\n            Schedule.On(DateRules.EveryDay(), TimeRules.AfterMarketClose(Security.Symbol, 1), ValidateSessionBars);\n        }\n\n        protected virtual void ValidateSessionBars()\n        {\n            if (ProcessedDataCount == 0)\n            {\n                return;\n            }\n            var session = Security.Session;\n            // At this point the data was consolidated (market close)\n\n            // Save previous session bar\n            PreviousSessionBar = new TradeBar(CurrentDate, Security.Symbol, Open, High, Low, Close, Volume);\n\n            if (SecurityWasRemoved)\n            {\n                PreviousSessionBar = null;\n                SecurityWasRemoved = false;\n                return;\n            }\n\n            // Check current session values\n            if (session.Open != Open\n                || session.High != High\n                || session.Low != Low\n                || session.Close != Close\n                || session.Volume != Volume)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n        }\n\n        protected virtual bool IsWithinMarketHours(DateTime currentDateTime)\n        {\n            var marketOpen = Security.Exchange.Hours.GetNextMarketOpen(currentDateTime.Date, false).TimeOfDay;\n            var marketClose = Security.Exchange.Hours.GetNextMarketClose(currentDateTime.Date, false).TimeOfDay;\n            var currentTime = currentDateTime.TimeOfDay;\n            return (marketOpen < currentTime && currentTime <= marketClose) || (!DailyPreciseEndTime && Resolution == Resolution.Daily);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (ProcessedDataCount == 0)\n            {\n                CurrentDate = slice.Time;\n            }\n            if (!IsWithinMarketHours(slice.Time) || !slice.ContainsKey(Security.Symbol))\n            {\n                // Skip data outside market hours\n                return;\n            }\n\n            // Accumulate data within regular market hours\n            // to later compare against the Session values\n            AccumulateSessionData(slice);\n            ProcessedDataCount++;\n        }\n\n        protected virtual void AccumulateSessionData(Slice slice)\n        {\n            var symbol = Security.Symbol;\n            if (CurrentDate.Date == slice.Time.Date)\n            {\n                // Same trading day\n                if (Open == 0)\n                {\n                    Open = slice[symbol].Open;\n                }\n                High = Math.Max(High, slice[symbol].High);\n                Low = Math.Min(Low, slice[symbol].Low);\n                Close = slice[symbol].Close;\n                Volume += slice[symbol].Volume;\n            }\n            else\n            {\n                // New trading day\n\n                if (PreviousSessionBar != null)\n                {\n                    var session = Security.Session;\n                    if (PreviousSessionBar.Open != session[1].Open\n                        || PreviousSessionBar.High != session[1].High\n                        || PreviousSessionBar.Low != session[1].Low\n                        || PreviousSessionBar.Close != session[1].Close\n                        || PreviousSessionBar.Volume != session[1].Volume)\n                    {\n                        throw new RegressionTestException(\"Mismatch in previous session bar (OHLCV)\");\n                    }\n                }\n\n                // This is the first data point of the new session\n                Open = slice[symbol].Open;\n                Close = slice[symbol].Close;\n                High = slice[symbol].High;\n                Low = slice[symbol].Low;\n                Volume = slice[symbol].Volume;\n                CurrentDate = slice.Time;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 78;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithChangeOfResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to validate Security.Session functionality.\n    /// Verifies that daily session bars (Open, High, Low, Close, Volume) are correctly after resolution change\n    /// </summary>\n    public class SecuritySessionWithChangeOfResolutionRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Count > 0)\n            {\n                Security = AddEquity(\"SPY\", Resolution.Minute);\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (UtcTime.Date == new DateTime(2013, 10, 7))\n            {\n                var session = Security.Session;\n                // Check before removal\n                if (session.Open != Open\n                || session.High != High\n                || session.Low != Low\n                || session.Close != Close\n                || session.Volume != Volume)\n                {\n                    throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n                }\n                RemoveSecurity(symbol);\n                SecurityWasRemoved = true;\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 3172;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithDailyResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionWithDailyResolutionRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        protected override Resolution Resolution => Resolution.Daily;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 48;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithFutureContractRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Common;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionWithFutureContractRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        private Future _futureContract;\n        private MarketHourAwareConsolidator _continuousContractConsolidator;\n        private MarketHourAwareConsolidator _futureContractConsolidator;\n        private decimal _previousContinuousContractOpenInterest;\n        private decimal _previousFutureContractOpenInterest;\n        public override void InitializeSecurity()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            Security = AddFuture(Futures.Metals.Gold, Resolution.Minute, extendedMarketHours: ExtendedMarketHours);\n            _futureContract = AddFutureContract(FuturesChain(Security.Symbol).OrderBy(x => x.Symbol.ID.Date).First());\n\n            // Manually add consolidators to simulate Session behavior\n            _continuousContractConsolidator = new MarketHourAwareConsolidator(false, Resolution.Daily, typeof(QuoteBar), TickType.Quote, false);\n            _futureContractConsolidator = new MarketHourAwareConsolidator(false, Resolution.Daily, typeof(QuoteBar), TickType.Quote, false);\n            SubscriptionManager.AddConsolidator(Security.Symbol, _continuousContractConsolidator, TickType.Quote);\n            SubscriptionManager.AddConsolidator(_futureContract.Symbol, _futureContractConsolidator, TickType.Quote);\n        }\n\n        protected override void AccumulateSessionData(Slice slice)\n        {\n            if (CurrentDate.Date != slice.Time.Date)\n            {\n                // Check the previous session bar for the continuous contract and future contract\n\n                var consolidated = (QuoteBar)_continuousContractConsolidator.Consolidated;\n                var futureSession = Security.Session;\n                if (futureSession[1].Open != consolidated.Open\n                    || futureSession[1].High != consolidated.High\n                    || futureSession[1].Low != consolidated.Low\n                    || futureSession[1].Close != consolidated.Close\n                    || futureSession[1].OpenInterest != _previousContinuousContractOpenInterest)\n                {\n                    throw new RegressionTestException(\"Mismatch in previous session bar (OHLCV)\");\n                }\n\n                consolidated = (QuoteBar)_futureContractConsolidator.Consolidated;\n                var futureContractSession = _futureContract.Session;\n                if (futureContractSession[1].Open != consolidated.Open\n                    || futureContractSession[1].High != consolidated.High\n                    || futureContractSession[1].Low != consolidated.Low\n                    || futureContractSession[1].Close != consolidated.Close\n                    || futureContractSession[1].OpenInterest != _previousFutureContractOpenInterest)\n                {\n                    throw new RegressionTestException(\"Mismatch in previous session bar (OHLCV)\");\n                }\n                CurrentDate = slice.Time;\n            }\n        }\n\n        protected override void ValidateSessionBars()\n        {\n            // Check the current session bar for the continuous contract and future contract\n\n            var futureSession = Security.Session;\n            _previousContinuousContractOpenInterest = Security.OpenInterest;\n            var workingData = (QuoteBar)_continuousContractConsolidator.WorkingData;\n            if (futureSession.Open != workingData.Open\n                || futureSession.High != workingData.High\n                || futureSession.Low != workingData.Low\n                || futureSession.Close != workingData.Close\n                || futureSession.OpenInterest != Security.OpenInterest)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n\n            var futureContractSession = _futureContract.Session;\n            _previousFutureContractOpenInterest = _futureContract.OpenInterest;\n            workingData = (QuoteBar)_futureContractConsolidator.WorkingData;\n            if (futureContractSession.Open != workingData.Open\n                || futureContractSession.High != workingData.High\n                || futureContractSession.Low != workingData.Low\n                || futureContractSession.Close != workingData.Close\n                || futureSession.OpenInterest != _futureContract.OpenInterest)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 7296;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithFuturesExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionWithFuturesExtendedMarketHoursRegressionAlgorithm : SecuritySessionWithFuturesRegressionAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 388962;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithFuturesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to validate <see cref=\"SecurityCache.Session\"/> with Futures.\n    /// Ensures OHLCV are consistent with Tick data.\n    /// </summary>\n    public class SecuritySessionWithFuturesRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        private decimal _bidPrice;\n        private decimal _askPrice;\n        private decimal _bidHigh;\n        private decimal _bidLow;\n        private decimal _askLow;\n        private decimal _askHigh;\n        private decimal _previousOpenInterest;\n\n        public override void InitializeSecurity()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            Security = AddFuture(Futures.Metals.Gold, Resolution.Tick, extendedMarketHours: ExtendedMarketHours);\n            _bidLow = decimal.MaxValue;\n            _askLow = decimal.MaxValue;\n        }\n\n        protected override bool IsWithinMarketHours(DateTime currentDateTime)\n        {\n            return Security.Exchange.Hours.IsOpen(currentDateTime, false);\n        }\n\n        protected override void AccumulateSessionData(Slice slice)\n        {\n            var symbol = Security.Symbol;\n            foreach (var tick in slice.Ticks[symbol])\n            {\n                if (tick.TickType == TickType.Trade)\n                {\n                    Volume += tick.Quantity;\n                }\n                if (CurrentDate.Date == tick.Time.Date)\n                {\n                    if (tick.BidPrice != 0)\n                    {\n                        _bidPrice = tick.BidPrice;\n                        _bidLow = Math.Min(_bidLow, tick.BidPrice);\n                        _bidHigh = Math.Max(_bidHigh, tick.BidPrice);\n                    }\n                    if (tick.AskPrice != 0)\n                    {\n                        _askPrice = tick.AskPrice;\n                        _askLow = Math.Min(_askLow, tick.AskPrice);\n                        _askHigh = Math.Max(_askHigh, tick.AskPrice);\n                    }\n                    if (_bidPrice != 0 && _askPrice != 0)\n                    {\n                        var midPrice = (_bidPrice + _askPrice) / 2;\n                        if (Open == 0)\n                        {\n                            Open = midPrice;\n                        }\n                        Close = midPrice;\n                    }\n                    if (_bidHigh != 0 && _askHigh != 0)\n                    {\n                        High = Math.Max(High, (_bidHigh + _askHigh) / 2);\n                    }\n                    if (_bidLow != decimal.MaxValue && _askLow != decimal.MaxValue)\n                    {\n                        Low = Math.Min(Low, (_bidLow + _askLow) / 2);\n                    }\n                }\n                else\n                {\n                    // New trading day\n                    if (PreviousSessionBar != null)\n                    {\n                        var session = Security.Session;\n                        if (PreviousSessionBar.Open != session[1].Open\n                            || PreviousSessionBar.High != session[1].High\n                            || PreviousSessionBar.Low != session[1].Low\n                            || PreviousSessionBar.Close != session[1].Close\n                            || PreviousSessionBar.Volume != session[1].Volume\n                            || _previousOpenInterest != session[1].OpenInterest)\n                        {\n                            throw new RegressionTestException(\"Mismatch in previous session bar (OHLCV)\");\n                        }\n                    }\n\n                    // This is the first data point of the new session\n                    Open = (_bidPrice + _askPrice) / 2;\n                    Low = decimal.MaxValue;\n                    _bidLow = decimal.MaxValue;\n                    _askLow = decimal.MaxValue;\n                    Volume = 0;\n                    CurrentDate = tick.Time.Date;\n                }\n            }\n        }\n\n        protected override void ValidateSessionBars()\n        {\n            // At this point the data was consolidated\n            var session = Security.Session;\n\n            // Save previous session bar\n            PreviousSessionBar = new TradeBar(CurrentDate, Security.Symbol, Open, High, Low, Close, Volume);\n            _previousOpenInterest = Security.OpenInterest;\n\n            // Check current session values\n            if (session.Open != Open\n                || session.High != High\n                || session.Low != Low\n                || session.Close != Close\n                || session.Volume != Volume\n                || session.OpenInterest != Security.OpenInterest)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 180093;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecuritySessionWithOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Common;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class SecuritySessionWithOptionRegressionAlgorithm : SecuritySessionRegressionAlgorithm\n    {\n        private MarketHourAwareConsolidator _optionContractConsolidator;\n        private decimal _previousOpenInterest;\n        public override void InitializeSecurity()\n        {\n            SetStartDate(2014, 06, 06);\n            SetEndDate(2014, 06, 09);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n\n            var aapl = QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            var _contract = OptionChain(aapl)\n                .OrderBy(symbol => symbol.ID.OptionRight)\n                .ThenBy(symbol => symbol.ID.StrikePrice)\n                .ThenBy(symbol => symbol.ID.Date)\n                .ThenBy(symbol => symbol.ID)\n                .FirstOrDefault(optionContract => optionContract.ID.OptionRight == OptionRight.Call);\n            Security = AddOptionContract(_contract);\n\n            // Manually add consolidators to simulate Session behavior\n            _optionContractConsolidator = new MarketHourAwareConsolidator(false, Resolution.Daily, typeof(QuoteBar), TickType.Quote, false);\n            SubscriptionManager.AddConsolidator(_contract.Symbol, _optionContractConsolidator, TickType.Quote);\n        }\n\n        protected override void AccumulateSessionData(Slice slice)\n        {\n            if (CurrentDate.Date != slice.Time.Date)\n            {\n                // Check the previous session bar\n                var consolidated = (QuoteBar)_optionContractConsolidator.Consolidated;\n                var futureSession = Security.Session;\n                if (futureSession[1].Open != consolidated.Open\n                    || futureSession[1].High != consolidated.High\n                    || futureSession[1].Low != consolidated.Low\n                    || futureSession[1].Close != consolidated.Close\n                    || futureSession[1].OpenInterest != _previousOpenInterest)\n                {\n                    throw new RegressionTestException(\"Mismatch in previous session bar (OHLCV)\");\n                }\n                CurrentDate = slice.Time;\n            }\n        }\n\n        protected override void ValidateSessionBars()\n        {\n            var futureSession = Security.Session;\n\n            _previousOpenInterest = Security.OpenInterest;\n            var workingData = (QuoteBar)_optionContractConsolidator.WorkingData;\n            if (futureSession.Open != workingData.Open\n                || futureSession.High != workingData.High\n                || futureSession.Low != workingData.Low\n                || futureSession.Close != workingData.Close\n                || futureSession.OpenInterest != Security.OpenInterest)\n            {\n                throw new RegressionTestException(\"Mismatch in current session bar (OHLCV)\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 3147;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.486\"},\n            {\"Tracking Error\", \"0.008\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SecurityToSymbolRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm show casing ad asserting security to symbol implicit conversion\n    /// </summary>\n    public class SecurityToSymbolRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var asset = AddEquity(\"SPY\", Resolution.Minute);\n\n            Schedule.On(DateRules.EveryDay(asset), TimeRules.AfterMarketOpen(asset, 1), () =>\n            {\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(asset, 1);\n                }\n            });\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"271.453%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101691.92\"},\n            {\"Net Profit\", \"1.692%\"},\n            {\"Sharpe Ratio\", \"8.854\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.005\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.222\"},\n            {\"Annual Variance\", \"0.049\"},\n            {\"Information Ratio\", \"-14.565\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"1.97\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test used for testing setting an account currency different than USD\n    /// and trading a Security in quote currency different than account currency.\n    /// Uses CashBuyingPowerModel as BuyingPowerModel.\n    /// </summary>\n    public class SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _btcUsd;\n        private Security _btcEur;\n        private int _step;\n        private decimal _expectedOrderQuantity;\n        private decimal _previousHoldingsFees;\n        private int _previousClosedTradesCount;\n        private decimal _initialCapital;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 04, 04);  //Set Start Date\n            SetEndDate(2018, 04, 04);    //Set End Date\n            SetAccountCurrency(\"EUR\");   // Change account currency\n            // We have no account currency, this is useful so using SetHoldings()\n            // target quantity is a reachable value since it uses Portfolio.TotalPortfolioValue\n            SetCash(0);\n            _initialCapital = 10000;\n            SetCash(\"USD\", _initialCapital);\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            _btcUsd = AddCrypto(\"BTCUSD\");\n            _btcEur = AddCrypto(\"BTCEUR\");\n            if (!(_btcUsd.BuyingPowerModel is CashBuyingPowerModel)\n                || !(_btcEur.BuyingPowerModel is CashBuyingPowerModel))\n            {\n                throw new RegressionTestException(\"This regression algorithm is expected to test the CashBuyingPowerModel\");\n            }\n\n            // Second call to change account currency will be ignored\n            SetAccountCurrency(\"ARG\");\n            if (AccountCurrency != \"EUR\")\n            {\n                throw new RegressionTestException($\"Unexpected account currency value {AccountCurrency}\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Log($\"OnData(): Current execution step: {_step}\");\n            switch (_step)\n            {\n                case 0:\n                    _step++;\n\n                    var res = Buy(_btcEur.Symbol, 1);\n                    if (res.Status != OrderStatus.Invalid\n                        && res.OrderEvents.First().Message.Contains(\"Reason: Your portfolio holds 0 EUR\"))\n                    {\n                        throw new RegressionTestException($\"We shouldn't be able to buy {_btcEur.Symbol}\" +\n                            \" because we don't own any EUR\");\n                    }\n\n                    UpdateExpectedOrderQuantity(0.5m);\n                    SetHoldings(_btcUsd.Symbol, 0.5);\n                    break;\n                case 1:\n                    _step++;\n                    UpdateExpectedOrderQuantity(1);\n                    SetHoldings(_btcUsd.Symbol, 1);\n                    break;\n                case 2:\n                    _step++;\n                    UpdateExpectedOrderQuantity(0);\n                    SetHoldings(_btcUsd.Symbol, 0);\n                    break;\n                case 3:\n                    // buying power model does not allow shorting, this will not work\n                    _step++;\n                    UpdateExpectedOrderQuantity(-0.5m);\n                    SetHoldings(_btcUsd.Symbol, -0.5);\n                    break;\n                case 4:\n                    // buying power model does not allow shorting, this will not work\n                    _step++;\n                    UpdateExpectedOrderQuantity(-1);\n                    SetHoldings(_btcUsd.Symbol, -1);\n                    break;\n                case 5:\n                    _step++;\n                    UpdateExpectedOrderQuantity(0);\n                    SetHoldings(_btcUsd.Symbol, 0);\n                    break;\n            }\n        }\n\n        private void UpdateExpectedOrderQuantity(decimal target)\n        {\n            _expectedOrderQuantity = (Portfolio.TotalPortfolioValueLessFreeBuffer * target - _btcUsd.Holdings.HoldingsValue)\n                / (_btcUsd.Price * _btcUsd.QuoteCurrency.ConversionRate);\n            _expectedOrderQuantity--; // minus 1 per fees\n            _expectedOrderQuantity -= _expectedOrderQuantity % _btcUsd.SymbolProperties.LotSize;\n            _expectedOrderQuantity = _expectedOrderQuantity.Normalize();\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.CashBook[\"BTC\"].Amount != 0)\n            {\n                throw new RegressionTestException($\"Unexpected BTC ending cash amount: {Portfolio.CashBook[\"BTC\"].Amount}.\");\n            }\n            if (Portfolio.CashBook[\"EUR\"].Amount != 0)\n            {\n                throw new RegressionTestException($\"Unexpected EUR ending cash amount: {Portfolio.CashBook[\"EUR\"].Amount}.\");\n            }\n\n            var expectedAmount = _initialCapital\n                + Portfolio.CashBook.Convert(Portfolio.TotalProfit, \"EUR\", \"USD\")\n                - Portfolio.CashBook.Convert(Portfolio.TotalFees, \"EUR\", \"USD\");\n            var amount = Portfolio.CashBook[\"USD\"].Amount;\n            // there could be a small difference due to conversion rates\n            // leave 0.5% for error\n            if (Math.Abs(expectedAmount - amount) > Math.Abs(expectedAmount) * 0.005m)\n            {\n                throw new RegressionTestException($\"Unexpected USD ending cash amount: {amount}. Expected {expectedAmount}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"OnOrderEvent(): New filled order event: {orderEvent}\");\n                // leave 1 unit as error in expected value\n                if (Math.Abs(orderEvent.FillQuantity - _expectedOrderQuantity) > 1)\n                {\n                    throw new RegressionTestException($\"Unexpected order event fill quantity: {orderEvent.FillQuantity}. \" +\n                        $\"Expected {_expectedOrderQuantity}\");\n                }\n\n                var orderFeeInAccountCurrency = Portfolio.CashBook.ConvertToAccountCurrency(orderEvent.OrderFee.Value).Amount;\n                var expectedOrderFee = _btcUsd.Holdings.TotalFees - _previousHoldingsFees;\n\n                // just to verify let calculate the order fee using taker fee\n                var calculatedOrderFee = Portfolio.CashBook.ConvertToAccountCurrency(\n                    orderEvent.AbsoluteFillQuantity * 0.003m * orderEvent.FillPrice,\n                    orderEvent.OrderFee.Value.Currency);\n\n                if (orderEvent.OrderFee.Value.Currency == AccountCurrency\n                    // leave 0.00001m as error in expected fee value\n                    || Math.Abs(expectedOrderFee - orderFeeInAccountCurrency) > 0.00001m\n                    || Math.Abs(expectedOrderFee - calculatedOrderFee) > 0.00001m)\n                {\n                    throw new RegressionTestException($\"Unexpected order fee: {orderFeeInAccountCurrency}. \" +\n                        $\"Expected {expectedOrderFee}. Calculated Order Fee {calculatedOrderFee}\");\n                }\n\n                if (!TradeBuilder.HasOpenPosition(_btcUsd.Symbol))\n                {\n                    var lastTrade = TradeBuilder.ClosedTrades.Last();\n\n                    var expectedProfitLoss = (lastTrade.ExitPrice - lastTrade.EntryPrice)\n                        * lastTrade.Quantity\n                        * _btcUsd.QuoteCurrency.ConversionRate\n                        * (lastTrade.Direction == TradeDirection.Long ? 1 : -1);\n\n                    if (Math.Abs(expectedProfitLoss - lastTrade.ProfitLoss) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected last trade ProfitLoss: {lastTrade.ProfitLoss}. \" +\n                            $\"Expected {expectedProfitLoss}\");\n                    }\n\n                    // There is a difference in what does Holdings and TradeBuilder consider LastTrade\n                    if (TradeBuilder.ClosedTrades.Count - _previousClosedTradesCount > 1)\n                    {\n                        var trade = TradeBuilder.ClosedTrades[_previousClosedTradesCount];\n                        expectedProfitLoss += trade.ProfitLoss;\n                    }\n\n                    if (Math.Abs(_btcUsd.Holdings.LastTradeProfit - expectedProfitLoss) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected Holdings.NetProfit: {_btcUsd.Holdings.LastTradeProfit}. \" +\n                            $\"Expected {expectedProfitLoss}\");\n                    }\n                }\n\n                _previousHoldingsFees = _btcUsd.Holdings.TotalFees;\n                _previousClosedTradesCount = TradeBuilder.ClosedTrades.Count;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7201;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 15;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"8141.93\"},\n            {\"End Equity\", \"8087.60\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€48.58\"},\n            {\"Estimated Strategy Capacity\", \"€9000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"200.21%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"407df5c68369b6d1aa21506a762f3bbd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetAccountCurrencySecurityMarginModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test used for testing setting an account currency different than USD\n    /// and trading a Security in quote currency different than account currency.\n    /// Uses SecurityMarginModel as BuyingPowerModel.\n    /// </summary>\n    public class SetAccountCurrencySecurityMarginModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _spy;\n        private int _step;\n        private decimal _expectedOrderQuantity;\n        private decimal _previousHoldingsFees;\n        private int _previousClosedTradesCount;\n        private decimal _initialCapital;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 15);    //Set End Date\n            SetAccountCurrency(\"EUR\");   // Change account currency\n            _initialCapital = Portfolio.CashBook[\"EUR\"].Amount;\n\n            _spy = AddEquity(\"SPY\", Resolution.Daily);\n            if (!(_spy.BuyingPowerModel is SecurityMarginModel))\n            {\n                throw new RegressionTestException(\"This regression algorithm is expected to test the SecurityMarginModel\");\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Log($\"OnData(): Current execution step: {_step}\");\n            switch (_step)\n            {\n                case 0:\n                    _step++;\n                    UpdateExpectedOrderQuantity(0.5m);\n                    SetHoldings(_spy.Symbol, 0.5);\n                    break;\n                case 1:\n                    _step++;\n                    UpdateExpectedOrderQuantity(1);\n                    SetHoldings(_spy.Symbol, 1);\n                    break;\n                case 2:\n                    _step++;\n                    UpdateExpectedOrderQuantity(0);\n                    SetHoldings(_spy.Symbol, 0);\n                    break;\n                case 3:\n                    _step++;\n                    UpdateExpectedOrderQuantity(-0.5m);\n                    SetHoldings(_spy.Symbol, -0.5);\n                    break;\n                case 4:\n                    _step++;\n                    UpdateExpectedOrderQuantity(-1);\n                    SetHoldings(_spy.Symbol, -1);\n                    break;\n                case 5:\n                    _step++;\n                    UpdateExpectedOrderQuantity(0);\n                    SetHoldings(_spy.Symbol, 0);\n                    break;\n            }\n        }\n\n        private void UpdateExpectedOrderQuantity(decimal target)\n        {\n            _expectedOrderQuantity = (Portfolio.TotalPortfolioValueLessFreeBuffer * target - _spy.Holdings.HoldingsValue)\n                / (_spy.Price * _spy.QuoteCurrency.ConversionRate);\n            _expectedOrderQuantity--; // minus 1 per fees\n            _expectedOrderQuantity -= _expectedOrderQuantity % _spy.SymbolProperties.LotSize;\n            _expectedOrderQuantity = _expectedOrderQuantity.Normalize();\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.CashBook[\"EUR\"].Amount != _initialCapital)\n            {\n                throw new RegressionTestException($\"Unexpected EUR ending cash amount: {Portfolio.CashBook[\"EUR\"].Amount}.\");\n            }\n            var expectedAmount = Portfolio.CashBook.Convert(Portfolio.TotalProfit, \"EUR\", \"USD\")\n                - Portfolio.CashBook.Convert(Portfolio.TotalFees, \"EUR\", \"USD\");\n            var amount = Portfolio.CashBook[\"USD\"].Amount;\n            // there could be a small difference due to conversion rates\n            // leave 1% for error\n            if (Math.Abs(expectedAmount - amount) > Math.Abs(expectedAmount) * 0.01m)\n            {\n                throw new RegressionTestException($\"Unexpected USD ending cash amount: {amount}. Expected {expectedAmount}\");\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log($\"OnOrderEvent(): New filled order event: {orderEvent}\");\n                // leave 1 unit as error in expected value\n                if (Math.Abs(orderEvent.FillQuantity - _expectedOrderQuantity) > 2)\n                {\n                    throw new RegressionTestException($\"Unexpected order event fill quantity: {orderEvent.FillQuantity}. \" +\n                        $\"Expected {_expectedOrderQuantity}\");\n                }\n\n                var orderFeeInAccountCurrency = Portfolio.CashBook.ConvertToAccountCurrency(orderEvent.OrderFee.Value).Amount;\n                var expectedOrderFee = _spy.Holdings.TotalFees - _previousHoldingsFees;\n                if (orderEvent.OrderFee.Value.Currency == AccountCurrency\n                    // leave 0.00001m as error in expected fee value\n                    || Math.Abs(expectedOrderFee - orderFeeInAccountCurrency) > 0.00001m)\n                {\n                    throw new RegressionTestException($\"Unexpected order fee: {orderFeeInAccountCurrency}. \" +\n                        $\"Expected {expectedOrderFee}\");\n                }\n\n                if (!TradeBuilder.HasOpenPosition(_spy.Symbol))\n                {\n                    var lastTrade = TradeBuilder.ClosedTrades.Last();\n\n                    var expectedProfitLoss = (lastTrade.ExitPrice - lastTrade.EntryPrice)\n                        * lastTrade.Quantity\n                        * _spy.QuoteCurrency.ConversionRate\n                        * (lastTrade.Direction == TradeDirection.Long ? 1 : -1);\n\n                    if (Math.Abs(expectedProfitLoss - lastTrade.ProfitLoss) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected last trade ProfitLoss: {lastTrade.ProfitLoss}. \" +\n                            $\"Expected {expectedProfitLoss}\");\n                    }\n\n                    // There is a difference in what does Holdings and TradeBuilder consider LastTrade\n                    if (TradeBuilder.ClosedTrades.Count - _previousClosedTradesCount > 1)\n                    {\n                        var trade = TradeBuilder.ClosedTrades[_previousClosedTradesCount];\n                        expectedProfitLoss += trade.ProfitLoss;\n                    }\n\n                    if (Math.Abs(_spy.Holdings.LastTradeProfit - expectedProfitLoss) > 1)\n                    {\n                        throw new RegressionTestException($\"Unexpected Holdings.NetProfit: {_spy.Holdings.LastTradeProfit}. \" +\n                            $\"Expected {expectedProfitLoss}\");\n                    }\n                }\n\n                _previousHoldingsFees = _spy.Holdings.TotalFees;\n                _previousClosedTradesCount = TradeBuilder.ClosedTrades.Count;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 73;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0.41%\"},\n            {\"Average Loss\", \"-0.85%\"},\n            {\"Compounding Annual Return\", \"-15.354%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"-0.260\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99551.92\"},\n            {\"Net Profit\", \"-0.448%\"},\n            {\"Sharpe Ratio\", \"-1.459\"},\n            {\"Sortino Ratio\", \"-2.624\"},\n            {\"Probabilistic Sharpe Ratio\", \"33.732%\"},\n            {\"Loss Rate\", \"50%\"},\n            {\"Win Rate\", \"50%\"},\n            {\"Profit-Loss Ratio\", \"0.48\"},\n            {\"Alpha\", \"-0.349\"},\n            {\"Beta\", \"0.34\"},\n            {\"Annual Standard Deviation\", \"0.084\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-6.601\"},\n            {\"Tracking Error\", \"0.119\"},\n            {\"Treynor Ratio\", \"-0.361\"},\n            {\"Total Fees\", \"€13.70\"},\n            {\"Estimated Strategy Capacity\", \"€790000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"40.00%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"a267868d506c93c1ff229e485d7744ba\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetCashOnDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.CurrencyConversion;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test reproduces the issue where a Cash instance is added\n    /// during execution by the BrokerageTransactionHandler, in this case the\n    /// algorithm will be adding it in OnData() to reproduce the same scenario.\n    /// </summary>\n    public class SetCashOnDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private bool _added;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 12, 01);  //Set Start Date\n            SetEndDate(2014, 12, 21);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            AddEquity(\"SPY\", Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_added)\n            {\n                _added = true;\n                // this should not be done by users but could be done by the BrokerageTransactionHandler\n                // Users: see and use SetCash()\n                Portfolio.CashBook.Add(\"EUR\", 10,0);\n            }\n            else\n            {\n                var cash = Portfolio.CashBook[\"EUR\"];\n                if (Time > new DateTime(2014, 12, 2, 16, 0, 0))\n                {\n                    if (cash.CurrencyConversion.GetType() == typeof(ConstantCurrencyConversion) || cash.ConversionRate == 0)\n                    {\n                        throw new RegressionTestException(\"Expected 'EUR' Cash to be fully set\");\n                    }\n                }\n\n                var eurUsdSubscription = SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(QuantConnect.Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda),\n                        includeInternalConfigs: true)\n                    .Single();\n                if (!eurUsdSubscription.IsInternalFeed)\n                {\n                    throw new RegressionTestException(\"Unexpected not internal 'EURUSD' Subscription\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 144;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"14.647%\"},\n            {\"Drawdown\", \"4.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100819.38\"},\n            {\"Net Profit\", \"0.819%\"},\n            {\"Sharpe Ratio\", \"0.717\"},\n            {\"Sortino Ratio\", \"1.053\"},\n            {\"Probabilistic Sharpe Ratio\", \"46.877%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.001\"},\n            {\"Beta\", \"0.996\"},\n            {\"Annual Standard Deviation\", \"0.149\"},\n            {\"Annual Variance\", \"0.022\"},\n            {\"Information Ratio\", \"1.091\"},\n            {\"Tracking Error\", \"0.001\"},\n            {\"Treynor Ratio\", \"0.108\"},\n            {\"Total Fees\", \"$2.75\"},\n            {\"Estimated Strategy Capacity\", \"$690000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4.50%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"a87b5796613e060569335f95ec560bdc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetCustomSettlementModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test we can specify a custom settlement model using Security.SetSettlementModel() method\n    /// </summary>\n    public class SetCustomSettlementModelRegressionAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _spy;\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(10000);\n            _spy = AddEquity(\"SPY\", Resolution.Daily);\n            _spy.SetSettlementModel(new CustomSettlementModel());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.CashBook[Currencies.USD].Amount == 10000)\n            {\n                var parameters = new ApplyFundsSettlementModelParameters(Portfolio, _spy, Time, new CashAmount(101, Currencies.USD), null);\n                _spy.SettlementModel.ApplyFunds(parameters);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (Portfolio.CashBook[Currencies.USD].Amount != 10101)\n            {\n                throw new RegressionTestException($\"It was expected to have 10101 USD in Portfolio, but was {Portfolio.CashBook[Currencies.USD].Amount}\");\n            }\n\n            var parameters = new ScanSettlementModelParameters(Portfolio, _spy, new DateTime(2013, 10, 6));\n            _spy.SettlementModel.Scan(parameters);\n\n            if (Portfolio.CashBook[Currencies.USD].Amount != 10000)\n            {\n                throw new RegressionTestException($\"It was expected to have 10000 USD in Portfolio, but was {Portfolio.CashBook[Currencies.USD].Amount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 48;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"119.460%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000\"},\n            {\"End Equity\", \"10101\"},\n            {\"Net Profit\", \"1.010%\"},\n            {\"Sharpe Ratio\", \"-5.989\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.411\"},\n            {\"Beta\", \"-0.033\"},\n            {\"Annual Standard Deviation\", \"0.079\"},\n            {\"Annual Variance\", \"0.006\"},\n            {\"Information Ratio\", \"-10.086\"},\n            {\"Tracking Error\", \"0.243\"},\n            {\"Treynor Ratio\", \"14.619\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n\n    public class CustomSettlementModel : ISettlementModel\n    {\n        private string _currency;\n        private decimal _amount;\n        public void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            _currency = applyFundsParameters.CashAmount.Currency;\n            _amount = applyFundsParameters.CashAmount.Amount;\n            applyFundsParameters.Portfolio.CashBook[_currency].AddAmount(_amount);\n        }\n\n        public void Scan(ScanSettlementModelParameters settlementParameters)\n        {\n            if (settlementParameters.UtcTime == new DateTime(2013, 10, 6))\n            {\n                settlementParameters.Portfolio.CashBook[_currency].AddAmount(-_amount);\n            }\n        }\n\n        /// <summary>\n        /// Gets the unsettled cash amount for the security\n        /// </summary>\n        public CashAmount GetUnsettledCash()\n        {\n            return default;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetDataNormalizationModeOnAddSecurityAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm has examples of how to add an securities indicating the <see cref=\"DataNormalizationMode\"/>\n    /// with the <see cref=\"QCAlgorithm.AddSecurity\"/> method.\n    /// </summary>\n    public class SetDataNormalizationModeOnAddSecurityAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly DataNormalizationMode _spyNormalizationMode = DataNormalizationMode.Raw;\n        private readonly DataNormalizationMode _ibmNormalizationMode = DataNormalizationMode.Adjusted;\n        private readonly DataNormalizationMode _aigNormalizationMode = DataNormalizationMode.TotalReturn;\n\n        private readonly DataNormalizationMode _esNormalizationMode = DataNormalizationMode.BackwardsRatio;\n        private readonly DataNormalizationMode _btcustdNormalizationMode = DataNormalizationMode.ForwardPanamaCanal;\n\n        private Dictionary<Equity, Tuple<decimal, decimal>> _priceRanges = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var spyEquity = AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Minute, dataNormalizationMode: _spyNormalizationMode);\n            CheckEquityDataNormalizationMode(spyEquity, _spyNormalizationMode);\n            _priceRanges.Add(spyEquity as Equity, new Tuple<decimal, decimal>(167.28m, 168.37m));\n\n            var ibmEquity = AddSecurity(SecurityType.Equity, \"IBM\", Resolution.Minute, dataNormalizationMode: _ibmNormalizationMode);\n            CheckEquityDataNormalizationMode(ibmEquity, _ibmNormalizationMode);\n            _priceRanges.Add(ibmEquity as Equity, new Tuple<decimal, decimal>(135.864131052m, 136.819606508m));\n\n            var aigEquity = AddSecurity(SecurityType.Equity, \"AIG\", Resolution.Minute, dataNormalizationMode: _aigNormalizationMode);\n            CheckEquityDataNormalizationMode(aigEquity, _aigNormalizationMode);\n            _priceRanges.Add(aigEquity as Equity, new Tuple<decimal, decimal>(48.73m, 49.10m));\n\n            var esFutures = AddSecurity(SecurityType.Future, \"ES\", Resolution.Minute, dataNormalizationMode: _esNormalizationMode);\n            CheckEquityDataNormalizationMode(esFutures, _esNormalizationMode);\n\n            var btsustdCryto = AddSecurity(SecurityType.Crypto,  \"BTCUSDT\", Resolution.Minute, dataNormalizationMode: _btcustdNormalizationMode);\n            CheckEquityDataNormalizationMode(btsustdCryto, _btcustdNormalizationMode);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var kvp in _priceRanges)\n            {\n                var security = kvp.Key;\n                var minExpectedPrice = kvp.Value.Item1;\n                var maxExpectedPrice = kvp.Value.Item2;\n\n                if (security.HasData && (security.Price < minExpectedPrice || security.Price > maxExpectedPrice))\n                {\n                    throw new RegressionTestException($\"{security.Symbol}: Price {security.Price} is  out of expected range [{minExpectedPrice}, {maxExpectedPrice}]\");\n                }\n            }\n        }\n\n        private void CheckEquityDataNormalizationMode(Security security, DataNormalizationMode expectedNormalizationMode)\n        {\n            var subscriptions = SubscriptionManager.Subscriptions.Where(x => x.Symbol == security.Symbol);\n            if (subscriptions.Any(x => x.DataNormalizationMode != expectedNormalizationMode))\n            {\n                throw new RegressionTestException($\"Expected {security.Symbol} to have data normalization mode {expectedNormalizationMode} but was {subscriptions.First().DataNormalizationMode}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5072;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetEquityDataNormalizationModeOnAddEquity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm has examples of how to add an equity indicating the <see cref=\"DataNormalizationMode\"/>\n    /// directly with the <see cref=\"QCAlgorithm.AddEquity\"/> method instead of using the <see cref=\"Equity.SetDataNormalizationMode\"/> method.\n    /// </summary>\n    public class SetEquityDataNormalizationModeOnAddEquity : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly DataNormalizationMode _spyNormalizationMode = DataNormalizationMode.Raw;\n        private readonly DataNormalizationMode _ibmNormalizationMode = DataNormalizationMode.Adjusted;\n        private readonly DataNormalizationMode _aigNormalizationMode = DataNormalizationMode.TotalReturn;\n        private Dictionary<Equity, Tuple<decimal, decimal>> _priceRanges = new Dictionary<Equity, Tuple<decimal, decimal>>();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 7);\n\n            var spyEquity = AddEquity(\"SPY\", Resolution.Minute, dataNormalizationMode: _spyNormalizationMode);\n            CheckEquityDataNormalizationMode(spyEquity, _spyNormalizationMode);\n            _priceRanges.Add(spyEquity, new Tuple<decimal, decimal>(167.28m, 168.37m));\n\n            var ibmEquity = AddEquity(\"IBM\", Resolution.Minute, dataNormalizationMode: _ibmNormalizationMode);\n            CheckEquityDataNormalizationMode(ibmEquity, _ibmNormalizationMode);\n            _priceRanges.Add(ibmEquity, new Tuple<decimal, decimal>(135.864131052m, 136.819606508m));\n\n            var aigEquity = AddEquity(\"AIG\", Resolution.Minute, dataNormalizationMode: _aigNormalizationMode);\n            CheckEquityDataNormalizationMode(aigEquity, _aigNormalizationMode);\n            _priceRanges.Add(aigEquity, new Tuple<decimal, decimal>(48.73m, 49.10m));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var kvp in _priceRanges)\n            {\n                var equity = kvp.Key;\n                var minExpectedPrice = kvp.Value.Item1;\n                var maxExpectedPrice = kvp.Value.Item2;\n\n                if (equity.HasData && (equity.Price < minExpectedPrice || equity.Price > maxExpectedPrice))\n                {\n                    throw new RegressionTestException($\"{equity.Symbol}: Price {equity.Price} is  out of expected range [{minExpectedPrice}, {maxExpectedPrice}]\");\n                }\n            }\n        }\n\n        private void CheckEquityDataNormalizationMode(Equity equity, DataNormalizationMode expectedNormalizationMode)\n        {\n            var subscriptions = SubscriptionManager.Subscriptions.Where(x => x.Symbol == equity.Symbol);\n            if (subscriptions.Any(x => x.DataNormalizationMode != expectedNormalizationMode))\n            {\n                throw new RegressionTestException($\"Expected {equity.Symbol} to have data normalization mode {expectedNormalizationMode} but was {subscriptions.First().DataNormalizationMode}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2355;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingReturnsOrderTicketsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Validates that SetHoldings returns the correct number of order tickets on each execution.\n    /// </summary>\n    public class SetHoldingReturnsOrderTicketsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private Symbol _ibm;\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 4);\n            SetEndDate(2018, 1, 10);\n            _spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            _ibm = AddEquity(\"IBM\", Resolution.Daily).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var tickets = SetHoldings(new List<PortfolioTarget> { new(_spy, 0.8m), new(_ibm, 0.2m) });\n\n            if (!Portfolio.Invested)\n            {\n                // Ensure exactly 2 tickets are created when the portfolio is not yet invested\n                if (tickets.Count != 2)\n                {\n                    throw new RegressionTestException(\"Expected 2 tickets, got \" + tickets.Count);\n                }\n            }\n            else if (tickets.Count != 0)\n            {\n                // Ensure no tickets are created when the portfolio is already invested\n                throw new RegressionTestException(\"Expected 0 tickets, got \" + tickets.Count);\n            }\n        }\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 53;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"43.490%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100661.71\"},\n            {\"Net Profit\", \"0.662%\"},\n            {\"Sharpe Ratio\", \"12.329\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"97.100%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.108\"},\n            {\"Beta\", \"0.424\"},\n            {\"Annual Standard Deviation\", \"0.024\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"-5.097\"},\n            {\"Tracking Error\", \"0.03\"},\n            {\"Treynor Ratio\", \"0.707\"},\n            {\"Total Fees\", \"$2.56\"},\n            {\"Estimated Strategy Capacity\", \"$170000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"14.24%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"587e1a69d3c83cbd9907f9f9586697e1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the SetHolding trading API precision, using asynchronous orders\n    /// </summary>\n    public class SetHoldingsAsyncRegressionAlgorithm : SetHoldingsRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm tests the behavior of SetHoldings for futures, see GH issue 4027\n    /// </summary>\n    public class SetHoldingsFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _contractSymbol;\n        private bool _invertedPosition;\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n            SetCash(1000000);\n\n            var future = AddFuture(Futures.Indices.SP500EMini);\n\n            // set our expiry filter for this futures chain\n            future.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_invertedPosition)\n            {\n                foreach (var chain in slice.FutureChains)\n                {\n                    // find the front contract expiring no earlier than in 90 days\n                    var contract = (\n                        from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                        where futuresContract.Expiry > Time.Date.AddDays(90)\n                        select futuresContract\n                    ).FirstOrDefault();\n\n                    // if found, trade it\n                    if (contract != null)\n                    {\n                        _contractSymbol = contract.Symbol;\n\n                        try\n                        {\n                            SetHoldings(_contractSymbol, 1.1);\n                            throw new RegressionTestException(\"We expect invalid target for futures to throw an exception\");\n                        }\n                        catch (InvalidOperationException)\n                        {\n                            // expected\n                        }\n\n                        try\n                        {\n                            SetHoldings(_contractSymbol, -1.1);\n                            throw new RegressionTestException(\"We expect invalid target for futures to throw an exception\");\n                        }\n                        catch (InvalidOperationException)\n                        {\n                            // expected\n                        }\n\n                        SetHoldings(_contractSymbol, 1);\n                    }\n                }\n            }\n            else\n            {\n                if (!_invertedPosition)\n                {\n                    // lets reverse our position now\n                    SetHoldings(_contractSymbol, -1);\n                    _invertedPosition = true;\n                }\n                else\n                {\n                    Liquidate();\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled && Portfolio.Invested)\n            {\n                Log($\"{orderEvent} - Portfolio.MarginRemaining {Portfolio.MarginRemaining}\");\n\n                if (Portfolio.TotalHoldingsValue / Portfolio.TotalPortfolioValue < 10)\n                {\n                    throw new RegressionTestException(\"Expected to be trading using the futures margin leverage\");\n                }\n\n                var security = Securities[_contractSymbol];\n                var model = security.BuyingPowerModel as FutureMarginModel;\n                var marginUsed = model.MaintenanceOvernightMarginRequirement * security.Holdings.AbsoluteQuantity;\n\n                if ((Portfolio.TotalMarginUsed - marginUsed) != 0)\n                {\n                    throw new RegressionTestException($\"We expect TotalMarginUsed to be {marginUsed}, but was {Portfolio.TotalMarginUsed}\");\n                }\n\n                var initialMarginRequired = model.InitialOvernightMarginRequirement * security.Holdings.AbsoluteQuantity;\n\n                if (Portfolio.TotalPortfolioValue - initialMarginRequired > model.InitialOvernightMarginRequirement * security.SymbolProperties.LotSize)\n                {\n                    throw new RegressionTestException(\"We expect to be trading using the biggest position we can, there seems to be room for another contract\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 14920;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-1.34%\"},\n            {\"Compounding Annual Return\", \"-95.782%\"},\n            {\"Drawdown\", \"2.600%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"974316.1\"},\n            {\"Net Profit\", \"-2.568%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-66.775\"},\n            {\"Tracking Error\", \"0.243\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2033.90\"},\n            {\"Estimated Strategy Capacity\", \"$530000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"2690.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"f33db020caac94864efec448e79bce97\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing GH feature 3790, using SetHoldings with a collection of targets\n    /// which will be ordered by margin impact before being executed, with the objective of avoiding any\n    /// margin errors\n    /// Asserts that liquidateExistingHoldings equal false does not close positions inadvertedly (GH 7008) \n    /// </summary>\n    public class SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm : SetHoldingsMultipleTargetsRegressionAlgorithm\n    {\n        public override void OnData(Slice data)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(new List<PortfolioTarget> { new(\"SPY\", 0.8m), new(\"IBM\", 0.2m) },\n                    liquidateExistingHoldings: true);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"300.863%\"},\n            {\"Drawdown\", \"2.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101791.04\"},\n            {\"Net Profit\", \"1.791%\"},\n            {\"Sharpe Ratio\", \"9.746\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.282%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.21\"},\n            {\"Beta\", \"0.995\"},\n            {\"Annual Standard Deviation\", \"0.223\"},\n            {\"Annual Variance\", \"0.05\"},\n            {\"Information Ratio\", \"7.104\"},\n            {\"Tracking Error\", \"0.028\"},\n            {\"Treynor Ratio\", \"2.186\"},\n            {\"Total Fees\", \"$3.76\"},\n            {\"Estimated Strategy Capacity\", \"$40000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.93%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"b56516b18612ece304dfd566f8b2e2f6\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsMarketOnOpenRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm reproduces GH issue 3781\n    /// </summary>\n    public class SetHoldingsMarketOnOpenRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\");\n            _aapl = AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                if (Securities[_aapl].HasData)\n                {\n                    SetHoldings(_aapl, 1);\n                    var orderTicket = Transactions.GetOpenOrderTickets(_aapl).Single();\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                var orderTickets = Transactions.GetOpenOrderTickets(_aapl).Single();\n            }\n            else\n            {\n                // should be filled\n                var orderTickets = Transactions.GetOpenOrderTickets(_aapl).ToList(ticket => ticket);\n                if (!orderTickets.IsNullOrEmpty())\n                {\n                    throw new RegressionTestException($\"We don't expect any open order tickets: {orderTickets[0]}\");\n                }\n            }\n\n            if (orderEvent.OrderId > 1)\n            {\n                throw new RegressionTestException($\"We only expect 1 order to be placed: {orderEvent}\");\n            }\n            Debug($\"OnOrderEvent: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5504;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"67.376%\"},\n            {\"Drawdown\", \"1.800%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100660.71\"},\n            {\"Net Profit\", \"0.661%\"},\n            {\"Sharpe Ratio\", \"2.515\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"54.049%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.772\"},\n            {\"Beta\", \"0.66\"},\n            {\"Annual Standard Deviation\", \"0.212\"},\n            {\"Annual Variance\", \"0.045\"},\n            {\"Information Ratio\", \"-8.483\"},\n            {\"Tracking Error\", \"0.17\"},\n            {\"Treynor Ratio\", \"0.806\"},\n            {\"Total Fees\", \"$32.32\"},\n            {\"Estimated Strategy Capacity\", \"$240000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"20.39%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"9d9883e51ef7e9f15062e368cb60617c\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsMultipleTargetsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing GH feature 3790, using SetHoldings with a collection of targets\n    /// which will be ordered by margin impact before being executed, with the objective of avoiding any\n    /// margin errors\n    /// </summary>\n    public class SetHoldingsMultipleTargetsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private Symbol _ibm;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            // use leverage 1 so we test the margin impact ordering\n            _spy = AddEquity(\"SPY\", Resolution.Minute, Market.USA, false, 1).Symbol;\n            _ibm = AddEquity(\"IBM\", Resolution.Minute, Market.USA, false, 1).Symbol;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice data)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(new List<PortfolioTarget> { new PortfolioTarget(_spy, 0.8m), new PortfolioTarget(_ibm, 0.2m) });\n            }\n            else\n            {\n                SetHoldings(new List<PortfolioTarget> { new PortfolioTarget(_ibm, 0.8m), new PortfolioTarget(_spy, 0.2m) });\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 7842;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"11\"},\n            {\"Average Win\", \"0.00%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"353.938%\"},\n            {\"Drawdown\", \"2.300%\"},\n            {\"Expectancy\", \"-0.749\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101952.99\"},\n            {\"Net Profit\", \"1.953%\"},\n            {\"Sharpe Ratio\", \"11.757\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"65.582%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"0.00\"},\n            {\"Alpha\", \"0.96\"},\n            {\"Beta\", \"0.993\"},\n            {\"Annual Standard Deviation\", \"0.248\"},\n            {\"Annual Variance\", \"0.062\"},\n            {\"Information Ratio\", \"8.324\"},\n            {\"Tracking Error\", \"0.114\"},\n            {\"Treynor Ratio\", \"2.942\"},\n            {\"Total Fees\", \"$15.02\"},\n            {\"Estimated Strategy Capacity\", \"$2600000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"44.15%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"14d509658aa542a210a3d6d41c05cd22\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SetHoldingsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm testing the SetHolding trading API precision\n    /// </summary>\n    public class SetHoldingsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected virtual bool AsynchronousOrders => false;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 0.1m, asynchronous: AsynchronousOrders);\n                SetHoldings(\"SPY\", 0.2d, asynchronous: AsynchronousOrders);\n                SetHoldings(\"SPY\", 0.3f, asynchronous: AsynchronousOrders);\n                SetHoldings(\"SPY\", 1, asynchronous: AsynchronousOrders);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var orders = Transactions.GetOrders(x => x.Symbol == QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)).ToList();\n\n            if (orders.Count != 4)\n            {\n                throw new RegressionTestException($\"Expected 4 orders, found {orders.Count}\");\n            }\n\n            foreach (var order in orders)\n            {\n                if (order.Status != OrderStatus.Filled)\n                {\n                    throw new RegressionTestException($\"Order {order.Id} was not filled. Status: {order.Status}\");\n                }\n            }\n\n            foreach (var ticket in Transactions.GetOrderTickets())\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1582;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98822.71\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$5.41\"},\n            {\"Estimated Strategy Capacity\", \"$2800000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"49.82%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"23bf9784138d7f8f43acb295647943cc\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ShortInterestFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm showing and asserting the usage of the <see cref=\"ShortMarginInterestRateModel\"/>\n    /// paired with a <see cref=\"IShortableProvider\"/> instance, for example <see cref=\"InteractiveBrokersShortableProvider\"/>\n    /// </summary>\n    public class ShortInterestFeeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _short;\n        private Security _long;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            _short = AddEquity(\"SPY\", Resolution.Hour);\n            _long = AddEquity(\"AAPL\", Resolution.Hour);\n\n            foreach (var security in new[] { _short, _long})\n            {\n                security.SetShortableProvider(new LocalDiskShortableProvider(\"testbrokerage\"));\n                security.MarginInterestRateModel = new ShortMarginInterestRateModel();\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", -0.5);\n                SetHoldings(\"AAPL\", 0.5);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (((ShortMarginInterestRateModel)_short.MarginInterestRateModel).Amount >= 0)\n            {\n                throw new RegressionTestException(\"Expected short fee interest rate to be charged\");\n            }\n\n            if (((ShortMarginInterestRateModel)_long.MarginInterestRateModel).Amount <= 0)\n            {\n                throw new RegressionTestException(\"Expected short fee interest rate to be earned\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 113;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-35.339%\"},\n            {\"Drawdown\", \"1.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99444.09\"},\n            {\"Net Profit\", \"-0.556%\"},\n            {\"Sharpe Ratio\", \"-2.211\"},\n            {\"Sortino Ratio\", \"-2.634\"},\n            {\"Probabilistic Sharpe Ratio\", \"35.604%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.256\"},\n            {\"Beta\", \"-0.22\"},\n            {\"Annual Standard Deviation\", \"0.081\"},\n            {\"Annual Variance\", \"0.007\"},\n            {\"Information Ratio\", \"-7.72\"},\n            {\"Tracking Error\", \"0.279\"},\n            {\"Treynor Ratio\", \"0.813\"},\n            {\"Total Fees\", \"$17.77\"},\n            {\"Estimated Strategy Capacity\", \"$130000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.97%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"39c20060e6271685d3e48359e9077bfe\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ShortableProviderOrdersRejectedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Tests that orders are denied if they exceed the max shortable quantity.\n    /// </summary>\n    public class ShortableProviderOrdersRejectedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _spy;\n        private Security _aig;\n        private readonly List<OrderTicket> _ordersAllowed = new List<OrderTicket>();\n        private readonly List<OrderTicket> _ordersDenied = new List<OrderTicket>();\n        private bool _initialize;\n        private OrderEvent _lastOrderEvent;\n        private bool _invalidatedAllowedOrder;\n        private bool _invalidatedNewOrderWithPortfolioHoldings;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 4);\n            SetEndDate(2013, 10, 11);\n            SetCash(10000000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute);\n            _aig = AddEquity(\"AIG\", Resolution.Minute);\n\n            _spy.SetShortableProvider(new RegressionTestShortableProvider());\n            _aig.SetShortableProvider(new RegressionTestShortableProvider());\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_initialize)\n            {\n                HandleOrder(LimitOrder(_spy.Symbol, -1001, 10000m)); // Should be canceled, exceeds the max shortable quantity\n                var orderTicket = LimitOrder(_spy.Symbol, -1000, 10000m);\n                HandleOrder(orderTicket); // Allowed, orders at or below 1000 should be accepted\n                HandleOrder(LimitOrder(_spy.Symbol, -10, 0.01m)); // Should be canceled, the total quantity we would be short would exceed the max shortable quantity.\n\n                var response = orderTicket.UpdateQuantity(-999); // should be allowed, we are reducing the quantity we want to short\n                if(!response.IsSuccess)\n                {\n                    throw new RegressionTestException(\"Order update should of succeeded!\");\n                }\n                _initialize = true;\n                return;\n            }\n\n            if (!_invalidatedAllowedOrder)\n            {\n                if (_ordersAllowed.Count != 1)\n                {\n                    throw new RegressionTestException($\"Expected 1 successful order, found: {_ordersAllowed.Count}\");\n                }\n                if (_ordersDenied.Count != 2)\n                {\n                    throw new RegressionTestException($\"Expected 2 failed orders, found: {_ordersDenied.Count}\");\n                }\n\n                var allowedOrder = _ordersAllowed[0];\n                var orderUpdate = new UpdateOrderFields()\n                {\n                    LimitPrice = 0.01m,\n                    Quantity = -1001,\n                    Tag = \"Testing updating and exceeding maximum quantity\"\n                };\n\n                var response = allowedOrder.Update(orderUpdate);\n                if (response.ErrorCode != OrderResponseErrorCode.ExceedsShortableQuantity)\n                {\n                    throw new RegressionTestException($\"Expected order to fail due to exceeded shortable quantity, found: {response.ErrorCode.ToString()}\");\n                }\n\n                var cancelResponse = allowedOrder.Cancel();\n                if (cancelResponse.IsError)\n                {\n                    throw new RegressionTestException(\"Expected to be able to cancel open order after bad qty update\");\n                }\n\n                _invalidatedAllowedOrder = true;\n                _ordersDenied.Clear();\n                _ordersAllowed.Clear();\n                return;\n            }\n\n            if (!_invalidatedNewOrderWithPortfolioHoldings)\n            {\n                HandleOrder(MarketOrder(_spy.Symbol, -1000)); // Should succeed, no holdings and no open orders to stop this\n                var spyShares = Portfolio[_spy.Symbol].Quantity;\n                if (spyShares != -1000m)\n                {\n                    throw new RegressionTestException($\"Expected -1000 shares in portfolio, found: {spyShares}\");\n                }\n\n                HandleOrder(LimitOrder(_spy.Symbol, -1, 0.01m)); // Should fail, portfolio holdings are at the max shortable quantity.\n                if (_ordersDenied.Count != 1)\n                {\n                    throw new RegressionTestException($\"Expected limit order to fail due to existing holdings, but found {_ordersDenied.Count} failures\");\n                }\n\n                _ordersAllowed.Clear();\n                _ordersDenied.Clear();\n\n                HandleOrder(MarketOrder(_aig.Symbol, -1001));\n                if (_ordersAllowed.Count != 1)\n                {\n                    throw new RegressionTestException($\"Expected market order of -1001 BAC to not fail\");\n                }\n\n                _invalidatedNewOrderWithPortfolioHoldings = true;\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            _lastOrderEvent = orderEvent;\n        }\n\n        private void HandleOrder(OrderTicket orderTicket)\n        {\n            if (orderTicket.SubmitRequest.Status == OrderRequestStatus.Error)\n            {\n                if (_lastOrderEvent == null || _lastOrderEvent.Status != OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Expected order event with invalid status for ticket {orderTicket}\");\n                }\n\n                _lastOrderEvent = null;\n                _ordersDenied.Add(orderTicket);\n                return;\n            }\n\n            _ordersAllowed.Add(orderTicket);\n        }\n\n        private class RegressionTestShortableProvider : LocalDiskShortableProvider\n        {\n            public RegressionTestShortableProvider() : base(\"testbrokerage\")\n            {\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 9410;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-1.623%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000000\"},\n            {\"End Equity\", \"9996563.97\"},\n            {\"Net Profit\", \"-0.034%\"},\n            {\"Sharpe Ratio\", \"-3.52\"},\n            {\"Sortino Ratio\", \"-3.476\"},\n            {\"Probabilistic Sharpe Ratio\", \"33.979%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.006\"},\n            {\"Beta\", \"-0.022\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.082\"},\n            {\"Tracking Error\", \"0.179\"},\n            {\"Treynor Ratio\", \"0.616\"},\n            {\"Total Fees\", \"$10.01\"},\n            {\"Estimated Strategy Capacity\", \"$99000000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.23%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"6d92f0811c31864dfaaccd9eb2edac52\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SingleOptionPositionGroupBuyingPowerModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that for single-asset position groups, the buying power models\n    /// (<see cref=\"PositionGroupBuyingPowerModel\"/>, <see cref=\"SecurityPositionGroupBuyingPowerModel\"/>, and <see cref=\"BuyingPowerModel\"/>)\n    /// compute the same quantity for a given delta buying power.\n    /// </summary>\n    public class SingleOptionPositionGroupBuyingPowerModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 23);\n            SetEndDate(2015, 12, 30);\n            SetCash(1000000);\n\n            var equitySymbol = AddEquity(\"GOOG\").Symbol;\n\n            var option = AddOption(equitySymbol);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.StandardsOnly().Strikes(-2, +2).Expiration(0, 180));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested || !slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                return;\n            }\n\n            var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)\n                .GroupBy(x => x.Expiry)\n                .OrderBy(grouping => grouping.Key)\n                .First()\n                .OrderByDescending(x => x.Strike)\n                .ToList();\n            var contractSymbol = callContracts[0].Symbol;\n\n            // 1. Test starting from a long position\n            var quantity = 10;\n            MarketOrder(contractSymbol, quantity);\n\n            var security = Securities[contractSymbol];\n            var positionGroup = Portfolio.Positions.Groups.Single();\n\n            TestQuantityForDeltaBuyingPowerForPositionGroup(positionGroup, security);\n\n            // 2. Test starting from a short position\n            quantity = -10;\n            MarketOrder(contractSymbol, quantity - positionGroup.Quantity);\n\n            positionGroup = Portfolio.Positions.Groups.Single();\n            if (positionGroup.Positions.Single().Quantity != quantity)\n            {\n                throw new RegressionTestException($@\"Expected position group quantity to be {quantity} but was {positionGroup.Quantity}\");\n            }\n\n            TestQuantityForDeltaBuyingPowerForPositionGroup(positionGroup, security);\n        }\n\n        private void TestQuantityForDeltaBuyingPowerForPositionGroup(IPositionGroup positionGroup, Security security)\n        {\n            var absQuantity = Math.Abs(positionGroup.Quantity);\n            var initialMarginPerUnit = positionGroup.BuyingPowerModel.GetInitialMarginRequirement(Portfolio, positionGroup) / absQuantity;\n\n            for (var expectedQuantity = 1; expectedQuantity <= absQuantity; expectedQuantity++)\n            {\n                // Test going in the same direction (longer or shorter):\n                // positive delta and expected quantity, to increment the position towards the current side\n                var deltaBuyingPower = initialMarginPerUnit * expectedQuantity * 1.05m;\n                // Adjust the delta buying power:\n                // GetMaximumLotsForDeltaBuyingPower will add the delta buying power to the maintenance margin and used that as a target margin,\n                // but then GetMaximumLotsForTargetBuyingPower will work with initial margin requirement so we make sure the resulting quantity\n                // can be ordered. In order to match this, we need to adjust the delta buying power by the difference between the initial margin\n                // requirement  and maintenance margin.\n                PerfomQuantityCalculations(positionGroup, security, expectedQuantity, deltaBuyingPower, increasing: true);\n\n                // Test going towards the opposite side until liquidated:\n                // negative delta and expected quantity to reduce the position\n                deltaBuyingPower = -initialMarginPerUnit * expectedQuantity * 0.95m;\n                PerfomQuantityCalculations(positionGroup, security, -expectedQuantity, deltaBuyingPower, increasing: false);\n            }\n        }\n\n        private void PerfomQuantityCalculations(IPositionGroup positionGroup, Security security, int expectedQuantity,\n            decimal deltaBuyingPower, bool increasing)\n        {\n            var absQuantity = Math.Abs(positionGroup.Quantity);\n            var initialMarginPerUnit = positionGroup.BuyingPowerModel.GetInitialMarginRequirement(Portfolio, positionGroup) / absQuantity;\n            var maintenanceMarginPerUnit = positionGroup.BuyingPowerModel.GetMaintenanceMargin(Portfolio, positionGroup) / absQuantity;\n            var deltaBuyingPowerAdjustment = (initialMarginPerUnit - maintenanceMarginPerUnit) * absQuantity;\n\n            var positionQuantityForDeltaWithPositionGroupBuyingPowerModel = positionGroup.BuyingPowerModel\n                .GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(Portfolio, positionGroup,\n                    deltaBuyingPower + deltaBuyingPowerAdjustment, minimumOrderMarginPortfolioPercentage: 0)).NumberOfLots;\n\n            Debug($\"Expected quantity: {expectedQuantity}  --  Actual: {positionQuantityForDeltaWithPositionGroupBuyingPowerModel}\");\n\n            if (positionQuantityForDeltaWithPositionGroupBuyingPowerModel != expectedQuantity)\n            {\n                throw new RegressionTestException($@\"Expected position quantity for delta buying power to be {expectedQuantity} but was {positionQuantityForDeltaWithPositionGroupBuyingPowerModel}\");\n            }\n\n            var position = positionGroup.Positions.Single();\n            var sign = (increasing ? +1 : -1) * Math.Sign(position.Quantity);\n            var signedDeltaBuyingPower = sign * Math.Abs(deltaBuyingPower);\n            var positionQuantityForDeltaWithSecurityPositionGroupBuyingPowerModel = new SecurityPositionGroupBuyingPowerModel()\n                .GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(Portfolio, positionGroup,\n                    signedDeltaBuyingPower + deltaBuyingPowerAdjustment, minimumOrderMarginPortfolioPercentage: 0)).NumberOfLots;\n\n            var positionQuantityForDeltaWithSecurityBuyingPowerModel = security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(\n                new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(Portfolio, security, signedDeltaBuyingPower + deltaBuyingPowerAdjustment,\n                    minimumOrderMarginPortfolioPercentage: 0)).Quantity;\n\n            var expectedSingleSecurityModelsQuantity = sign * Math.Abs(expectedQuantity);\n\n            if (positionQuantityForDeltaWithSecurityPositionGroupBuyingPowerModel != expectedSingleSecurityModelsQuantity ||\n                positionQuantityForDeltaWithSecurityBuyingPowerModel != expectedSingleSecurityModelsQuantity)\n            {\n                throw new RegressionTestException($@\"Expected order quantity for delta buying power calls from default buying power models to return {expectedSingleSecurityModelsQuantity}. Results were:\" +\n                    $\"    \\nSecurityPositionGroupBuyingPowerModel: {positionQuantityForDeltaWithSecurityPositionGroupBuyingPowerModel}\" +\n                    $\"    \\nBuyingPowerModel: {positionQuantityForDeltaWithSecurityBuyingPowerModel}\\n\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 46957;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.11%\"},\n            {\"Compounding Annual Return\", \"-2.788%\"},\n            {\"Drawdown\", \"0.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999380.5\"},\n            {\"Net Profit\", \"-0.062%\"},\n            {\"Sharpe Ratio\", \"-8.624\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.982%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.032\"},\n            {\"Beta\", \"0.007\"},\n            {\"Annual Standard Deviation\", \"0.004\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.051\"},\n            {\"Tracking Error\", \"0.084\"},\n            {\"Treynor Ratio\", \"-4.737\"},\n            {\"Total Fees\", \"$19.50\"},\n            {\"Estimated Strategy Capacity\", \"$49000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV W78ZFMML4BUU|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"0.45%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"8b8bafd11c0c2a868dbbc28db36d4ce0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SmaCrossUniverseSelectionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing System.Collections.Concurrent;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Provides an example where WarmUpIndicator method is used to warm up indicators\n    /// after their security is added and before (Universe Selection scenario)\n    /// </summary>\n    public class SmaCrossUniverseSelectionAlgorithm : QCAlgorithm\n    {\n        private const int _count = 10;\n        private const decimal _tolerance = 0.01m;\n        private const decimal _targetPercent = 1m / _count;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Leverage = 2.0m;\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2018, 01, 01);\n            SetEndDate(2019, 01, 01);\n            SetCash(1000000);\n\n            Settings.AutomaticIndicatorWarmUp = true;\n\n            var ibm = AddEquity(\"IBM\", Resolution.Tick).Symbol;\n            var ibmSma = SMA(ibm, 40);\n            Log($\"{ibmSma.Name}: {ibmSma.Current.Time} - {ibmSma}. IsReady? {ibmSma.IsReady}\");\n\n            var spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n            var spySma = SMA(spy, 10);     // Data point indicator\n            var spyAtr = ATR(spy, 10);     // Bar indicator\n            var spyVwap = VWAP(spy, 10);   // TradeBar indicator\n            Log($\"SPY    - Is ready? SMA: {spySma.IsReady}, ATR: {spyAtr.IsReady}, VWAP: {spyVwap.IsReady}\");\n\n            var eur = AddForex(\"EURUSD\", Resolution.Hour).Symbol;\n            var eurSma = SMA(eur, 20, Resolution.Daily);\n            var eurAtr = ATR(eur, 20, resolution: Resolution.Daily);\n            Log($\"EURUSD - Is ready? SMA: {eurSma.IsReady}, ATR: {eurAtr.IsReady}\");\n\n            AddUniverse(coarse =>\n            {\n                var averages = new ConcurrentDictionary<Symbol, IndicatorBase<IndicatorDataPoint>>();\n\n                return (from cf in coarse\n                        where cf.HasFundamentalData\n                        // grab the SMA instance for this symbol\n                        let avg = averages.GetOrAdd(cf.Symbol, sym =>\n                        {\n                            var sma = new SimpleMovingAverage(100);\n                            WarmUpIndicator(cf.Symbol, sma, Resolution.Daily);\n                            return sma;\n                        })\n                        // Update returns true when the indicators are ready, so don't accept until they are\n                        where avg.Update(cf.EndTime, cf.AdjustedPrice)\n                        // only pick symbols who have their price over their 100 day sma\n                        where avg > cf.AdjustedPrice * _tolerance\n                        // prefer symbols with a larger delta by percentage between the two averages\n                        orderby (avg - cf.AdjustedPrice) / ((avg + cf.AdjustedPrice) / 2m) descending\n                        // we only need to return the symbol and return 'Count' symbols\n                        select cf.Symbol).Take(_count);\n            });\n\n            // Since the indicators are ready, we will receive error messages\n            // reporting that the algorithm manager is trying to add old information\n            SetWarmUp(10);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities.Where(x => x.Invested))\n            {\n                Liquidate(security.Symbol);\n            }\n\n            foreach (var security in changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, _targetPercent);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SparseDataRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing an issue with sparse data which would cause auxiliary data to be emitted out of order\n    /// </summary>\n    public class SparseDataRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _gotDividend;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2010, 2, 22);\n            SetEndDate(2010, 2, 27);\n            AddEquity(\"TAPA\", Resolution.Hour);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            foreach (var dividend in slice.Dividends)\n            {\n                Debug($\"{Time}. {dividend.Value}\");\n                _gotDividend = true;\n                if (Time != dividend.Value.Time || Time.Day != 24)\n                {\n                    throw new RegressionTestException(\"Got a dividend at an unexpected point in time\");\n                }\n            }\n            foreach (var tradeBar in slice.Bars)\n            {\n                Debug($\"{Time}. {tradeBar.Value}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_gotDividend)\n            {\n                throw new RegressionTestException(\"Never got a dividend!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 74;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"1.376\"},\n            {\"Tracking Error\", \"0.14\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SplitEquityRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\nusing QuantConnect.Util;\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Simple regression algorithm asserting certain order fields update properly when a\n    /// split in the data happens\n    /// </summary>\n    public class SplitEquityRegressionAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n        private List<OrderTicket> _tickets = new();\n\n        private decimal _marketPriceAtLatestSplit;\n        private decimal _splitFactor;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 5);\n            SetEndDate(2014, 6, 11);\n            SetCash(100000);\n\n            _aapl = AddEquity(\"AAPL\", Resolution.Hour, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.ContainsKey(_aapl))\n            {\n                var split = slice.Splits[_aapl];\n                _splitFactor = split.SplitFactor;\n                _marketPriceAtLatestSplit = Securities[_aapl].Price;\n            }\n\n            if (Transactions.GetOrders().IsNullOrEmpty())\n            {\n                _tickets.Add(LimitIfTouchedOrder(_aapl, 10, 10, 10));\n                _tickets.Add(LimitOrder(_aapl, 10, 5));\n                _tickets.Add(StopLimitOrder(_aapl, 10, 15, 15));\n                _tickets.Add(TrailingStopOrder(_aapl, 10, 1000, 60m, trailingAsPercentage: false));\n                _tickets.Add(TrailingStopOrder(_aapl, 10, 1000, 0.1m, trailingAsPercentage: true));\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var ticket in _tickets)\n            {\n                if (ticket.Quantity != 69.0m)\n                {\n                    throw new RegressionTestException($\"The Quantity of order with ID: {ticket.OrderId} should be 69, but was {ticket.Quantity}\");\n                }\n\n                switch (ticket.OrderType)\n                {\n                    case OrderType.LimitIfTouched:\n                        if (ticket.Get(OrderField.TriggerPrice) != 1.43m)\n                        {\n                            throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Trigger Price equal to 1.43, but was {ticket.Get(OrderField.TriggerPrice)}\");\n                        }\n\n                        if (ticket.Get(OrderField.LimitPrice) != 1.43m)\n                        {\n                            throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Limit Price equal to 1.43, but was {ticket.Get(OrderField.LimitPrice)}\");\n                        }\n                        break;\n\n                    case OrderType.Limit:\n                        if (ticket.Get(OrderField.LimitPrice) != 0.7143m)\n                        {\n                            throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Limit Price equal to 0.7143, but was {ticket.Get(OrderField.LimitPrice)}\");\n                        }\n                        break;\n\n                    case OrderType.StopLimit:\n                        if (ticket.Get(OrderField.StopPrice) != 2.14m)\n                        {\n                            throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Stop Price equal to 2.14, but was {ticket.Get(OrderField.StopPrice)}\");\n                        }\n                        break;\n\n                    case OrderType.TrailingStop:\n                        var stopPrice = ticket.Get(OrderField.StopPrice);\n                        var trailingAmount = ticket.Get(OrderField.TrailingAmount);\n\n                        if (ticket.Get<bool>(OrderField.TrailingAsPercentage))\n                        {\n                            // We only expect one stop price update in this algorithm\n                            if (Math.Abs(stopPrice - _marketPriceAtLatestSplit) > 0.1m * stopPrice)\n                            {\n                                throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Stop Price equal to 2.14, but was {ticket.Get(OrderField.StopPrice)}\");\n                            }\n\n                            // Trailing amount unchanged since it's a percentage\n                            if (trailingAmount != 0.1m)\n                            {\n                                throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Trailing Amount equal to 0.214m, but was {trailingAmount}\");\n                            }\n                        }\n                        else\n                        {\n                            // We only expect one stop price update in this algorithm\n                            if (Math.Abs(stopPrice - _marketPriceAtLatestSplit) > 60m * _splitFactor)\n                            {\n                                throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Stop Price equal to 2.14, but was {ticket.Get(OrderField.StopPrice)}\");\n                            }\n\n                            if (trailingAmount != 8.57m)\n                            {\n                                throw new RegressionTestException($\"Order with ID: {ticket.OrderId} should have a Trailing Amount equal to 8.57m, but was {trailingAmount}\");\n                            }\n                        }\n                        break;\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 80;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"5\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.491\"},\n            {\"Tracking Error\", \"0.042\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1433d839e97cd82fc9b051cfd98f166f\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SplitOnTradeBuilderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test for asserting that splits are applied to the <see cref=\"QCAlgorithm.TradeBuilder\"/>\n    /// </summary>\n    public class SplitOnTradeBuilderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private Split _split;\n        private OrderEvent _buyFillEvent;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 11);\n            SetCash(100000);\n            SetBenchmark(x => 0);\n\n            _symbol = AddEquity(\"AAPL\", Resolution.Hour, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.TryGetValue(_symbol, out var split) && split.Type == SplitType.SplitOccurred)\n            {\n                _split = split;\n                Debug($\"Split occurred on {split.Time}: {split}\");\n            }\n\n            if (slice.ContainsKey(_symbol))\n            {\n                if (!Portfolio.Invested)\n                {\n                    if (_split == null)\n                    {\n                        Buy(_symbol, 100);\n                    }\n                }\n                else if (_split != null)\n                {\n                    Liquidate(_symbol);\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled && orderEvent.Direction == OrderDirection.Buy)\n            {\n                _buyFillEvent = orderEvent;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_split == null)\n            {\n                throw new RegressionTestException(\"No split occurred.\");\n            }\n\n            if (_buyFillEvent == null)\n            {\n                throw new RegressionTestException(\"Buy order either never filled or was never placed.\");\n            }\n\n            if (TradeBuilder.ClosedTrades.Count != 1)\n            {\n                throw new RegressionTestException($\"Expected 1 closed trade, but found {TradeBuilder.ClosedTrades.Count}\");\n            }\n\n            var trade = TradeBuilder.ClosedTrades[0];\n\n            var expectedEntryPrice = _buyFillEvent.FillPrice * _split.SplitFactor;\n            if (trade.EntryPrice != expectedEntryPrice)\n            {\n                throw new RegressionTestException($\"Expected closed trade entry price of {expectedEntryPrice}, but found {trade.EntryPrice}\");\n            }\n\n            var expectedTradeQuantity = (int)(_buyFillEvent.FillQuantity / _split.SplitFactor);\n            if (trade.Quantity != expectedTradeQuantity)\n            {\n                throw new RegressionTestException($\"Expected closed trade quantity of {expectedTradeQuantity}, but found {trade.Quantity}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 31;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.09%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"6.103%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100092.01\"},\n            {\"Net Profit\", \"0.092%\"},\n            {\"Sharpe Ratio\", \"7.379\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.713%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.023\"},\n            {\"Annual Variance\", \"0.001\"},\n            {\"Information Ratio\", \"7.707\"},\n            {\"Tracking Error\", \"0.023\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$4.50\"},\n            {\"Estimated Strategy Capacity\", \"$61000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"21.61%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"be48105b9ce730de7bd4e4908f8c3ef5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SplitPartialShareRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the split is handled correctly. Specifically GH issue #5765, where cash\n    /// difference applied due to share count difference was using the split reference price instead of the new price,\n    /// increasing cash holdings by a higher amount than it should have\n    /// </summary>\n    public class SplitPartialShareRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private decimal _cash;\n        private SplitType? _splitType;\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 09);\n\n            UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n\n            AddEquity(\"AAPL\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            foreach (var dataSplit in slice.Splits)\n            {\n                if (_splitType == null || _splitType < dataSplit.Value.Type)\n                {\n                    _splitType = dataSplit.Value.Type;\n\n                    if (_splitType == SplitType.Warning && _cash != Portfolio.CashBook[Currencies.USD].Amount)\n                    {\n                        throw new RegressionTestException(\"Unexpected cash amount change before split\");\n                    }\n\n                    if (_splitType == SplitType.SplitOccurred)\n                    {\n                        var newCash = Portfolio.CashBook[Currencies.USD].Amount;\n                        if (_cash == newCash || newCash - _cash >= dataSplit.Value.SplitFactor * dataSplit.Value.ReferencePrice)\n                        {\n                            throw new RegressionTestException(\"Unexpected cash amount change after split\");\n                        }\n                    }\n                }\n                else\n                {\n                    throw new RegressionTestException($\"Unexpected split event {dataSplit.Value.Type}\");\n                }\n            }\n\n            if (!Portfolio.Invested)\n            {\n                Buy(\"AAPL\", 1);\n                _cash = Portfolio.CashBook[Currencies.USD].Amount;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_splitType == null)\n            {\n                throw new RegressionTestException(\"No split was emitted!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2371;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.562%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100007.16\"},\n            {\"Net Profit\", \"0.007%\"},\n            {\"Sharpe Ratio\", \"-3.983\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"79.393%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0\"},\n            {\"Beta\", \"-0.007\"},\n            {\"Annual Standard Deviation\", \"0.001\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-11.436\"},\n            {\"Tracking Error\", \"0.037\"},\n            {\"Treynor Ratio\", \"0.431\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$4200000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"87f55de4577d35a6ff70a7fd335e14a4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for the SpreadExecutionModel.\n    /// This algorithm shows how the execution model works to \n    /// submit orders only when the price is on desirably tight spread.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class SpreadExecutionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(\n                QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)));\n\n            // using hourly rsi to generate more insights\n            SetAlpha(new RsiAlphaModel(14, Resolution.Hour));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new SpreadExecutionModel());\n\n            InsightsGenerated += OnInsightsGenerated;\n        }\n\n        private void OnInsightsGenerated(IAlgorithm algorithm, GeneratedInsightsCollection eventdata)\n        {\n            Log($\"{Time}: {string.Join(\", \", eventdata)}\");\n        }\n\n        /// <summary>\n        /// Order fill event handler. On an order fill update the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event details containing details of the events</param>\n        /// <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>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"Purchased Stock: {orderEvent.Symbol}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 56;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"19\"},\n            {\"Average Win\", \"0.62%\"},\n            {\"Average Loss\", \"-0.19%\"},\n            {\"Compounding Annual Return\", \"398.867%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"1.395\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102076.08\"},\n            {\"Net Profit\", \"2.076%\"},\n            {\"Sharpe Ratio\", \"10.465\"},\n            {\"Sortino Ratio\", \"21.499\"},\n            {\"Probabilistic Sharpe Ratio\", \"70.084%\"},\n            {\"Loss Rate\", \"44%\"},\n            {\"Win Rate\", \"56%\"},\n            {\"Profit-Loss Ratio\", \"3.31\"},\n            {\"Alpha\", \"0.533\"},\n            {\"Beta\", \"1.115\"},\n            {\"Annual Standard Deviation\", \"0.261\"},\n            {\"Annual Variance\", \"0.068\"},\n            {\"Information Ratio\", \"8.837\"},\n            {\"Tracking Error\", \"0.086\"},\n            {\"Treynor Ratio\", \"2.453\"},\n            {\"Total Fees\", \"$40.66\"},\n            {\"Estimated Strategy Capacity\", \"$1900000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"146.73%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"36ab6f7236250f7a064b77af9b4870c4\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StableCoinsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// A demonstration algorithm to check there can be placed an order of a pair not present\n    /// in the brokerage using the conversion between stablecoins\n    /// </summary>\n    public class StableCoinsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2018, 5, 1);\n            SetEndDate(2018, 5, 2);\n            SetCash(\"USDT\", 200000000);\n            SetBrokerageModel(Brokerages.BrokerageName.Binance, AccountType.Cash);\n            AddCrypto(\"BTCUSDT\", Resolution.Hour, Market.Binance);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"BTCUSDT\", 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 4;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"200100000.00\"},\n            {\"End Equity\", \"206873962.29\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$199400.35\"},\n            {\"Estimated Strategy Capacity\", \"$740000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSDT 18N\"},\n            {\"Portfolio Turnover\", \"49.27%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"221fcdb14599be6654a7b0d072135607\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for the StandardDeviationExecutionModel.\n    /// This algorithm shows how the execution model works to split up orders and submit them only when\n    /// the price is 2 standard deviations from the 60min mean (default model settings).\n    /// </summary>\n    public class StandardDeviationExecutionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(1000000);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(\n                QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)\n            ));\n\n            // using hourly rsi to generate more insights\n            SetAlpha(new RsiAlphaModel(14, Resolution.Hour));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new StandardDeviationExecutionModel());\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{Time}: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => -1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"201\"},\n            {\"Average Win\", \"0.04%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"1331.217%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"132.060\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1034608.74\"},\n            {\"Net Profit\", \"3.461%\"},\n            {\"Sharpe Ratio\", \"38.665\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"99.757%\"},\n            {\"Loss Rate\", \"1%\"},\n            {\"Win Rate\", \"99%\"},\n            {\"Profit-Loss Ratio\", \"133.61\"},\n            {\"Alpha\", \"6.068\"},\n            {\"Beta\", \"0.798\"},\n            {\"Annual Standard Deviation\", \"0.198\"},\n            {\"Annual Variance\", \"0.039\"},\n            {\"Information Ratio\", \"57.99\"},\n            {\"Tracking Error\", \"0.098\"},\n            {\"Treynor Ratio\", \"9.578\"},\n            {\"Total Fees\", \"$260.38\"},\n            {\"Estimated Strategy Capacity\", \"$400000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"76.30%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b9b3d15cb605213622465aacf0049703\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StartingCapitalRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm reproduces GH issue 1859: 'Non-USD cash added during\n    /// Initialize not counted as starting capital in backtesting'\n    /// </summary>\n    public class StartingCapitalRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 4); //Set Start Date\n            SetEndDate(2018, 4, 4); //Set End Date\n\n            SetCash(10000);\n            SetCash(\"EUR\", 10000);\n            SetCash(\"BTC\", 10000);\n            SetCash(\"ETH\", 10000);\n\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            AddCrypto(\"BTCUSD\");\n            _symbol = AddCrypto(\"ETHUSD\").Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                Buy(_symbol, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7201;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 25;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"77011732.10\"},\n            {\"End Equity\", \"71490762.61\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.21\"},\n            {\"Estimated Strategy Capacity\", \"$170000.00\"},\n            {\"Lowest Capacity Asset\", \"ETHUSD 2XR\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"563e667ab49944c44f57b7f20a444b2e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StatisticsResultsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of how to access the statistics results from within an algorithm through the <see cref=\"Statistics\"/> property.\n    /// </summary>\n    public class StatisticsResultsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string MostTradedSecurityStatistic = \"Most Traded Security\";\n        private const string MostTradedSecurityTradeCountStatistic = \"Most Traded Security Trade Count\";\n\n        private Symbol _spy;\n\n        private Symbol _ibm;\n\n        private ExponentialMovingAverage _fastSpyEma;\n\n        private ExponentialMovingAverage _slowSpyEma;\n\n        private ExponentialMovingAverage _fastIbmEma;\n\n        private ExponentialMovingAverage _slowIbmEma;\n\n        private Dictionary<Symbol, int> _tradeCounts = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            _ibm = AddEquity(\"IBM\", Resolution.Minute).Symbol;\n\n            _fastSpyEma = EMA(_spy, 30, Resolution.Minute);\n            _slowSpyEma = EMA(_spy, 60, Resolution.Minute);\n\n            _fastIbmEma = EMA(_spy, 10, Resolution.Minute);\n            _slowIbmEma = EMA(_spy, 30, Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_slowSpyEma.IsReady) return;\n\n            if (_fastSpyEma > _slowSpyEma)\n            {\n                SetHoldings(_spy, 0.5);\n            }\n            else if (Securities[_spy].Invested)\n            {\n                Liquidate(_spy);\n            }\n\n            if (_fastIbmEma > _slowIbmEma)\n            {\n                SetHoldings(_ibm, 0.2);\n            }\n            else if (Securities[_ibm].Invested)\n            {\n                Liquidate(_ibm);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                // We can access the statistics summary at runtime\n                var statistics = Statistics.Summary;\n                var statisticsStr = string.Join(\"\\n\\t\", statistics.Select(kvp => $\"{kvp.Key}: {kvp.Value}\"));\n                Debug($\"\\nStatistics after fill:\\n\\t{statisticsStr}\");\n\n                // Access a single statistic\n                Log($\"Total trades so far: {statistics[PerformanceMetrics.TotalOrders]}\");\n                Log($\"Sharpe Ratio: {statistics[PerformanceMetrics.SharpeRatio]}\");\n\n                // --------\n\n                // We can also set custom summary statistics:\n\n                KeyValuePair<Symbol, int> mostTradeSecurityKvp;\n\n                // Before the first fill event, our custom statistics should not be set in the summary\n                if (_tradeCounts.All(kvp => kvp.Value == 0))\n                {\n                    if (statistics.ContainsKey(MostTradedSecurityStatistic))\n                    {\n                        throw new RegressionTestException($\"Statistic {MostTradedSecurityStatistic} should not be set yet\");\n                    }\n                    if (statistics.ContainsKey(MostTradedSecurityTradeCountStatistic))\n                    {\n                        throw new RegressionTestException($\"Statistic {MostTradedSecurityTradeCountStatistic} should not be set yet\");\n                    }\n                }\n                else\n                {\n                    // The current most traded security should be set in the summary\n                    mostTradeSecurityKvp = _tradeCounts.MaxBy(kvp => kvp.Value);\n                    CheckMostTradedSecurityStatistic(statistics, mostTradeSecurityKvp.Key, mostTradeSecurityKvp.Value);\n                }\n\n                // Update the trade count\n                var tradeCount = _tradeCounts.GetValueOrDefault(orderEvent.Symbol);\n                _tradeCounts[orderEvent.Symbol] = tradeCount + 1;\n\n                // Set the most traded security\n                mostTradeSecurityKvp = _tradeCounts.MaxBy(kvp => kvp.Value);\n                SetSummaryStatistic(MostTradedSecurityStatistic, mostTradeSecurityKvp.Key);\n                SetSummaryStatistic(MostTradedSecurityTradeCountStatistic, mostTradeSecurityKvp.Value);\n\n                // Re-calculate statistics:\n                statistics = Statistics.Summary;\n\n                // Let's keep track of our custom summary statistics after the update\n                CheckMostTradedSecurityStatistic(statistics, mostTradeSecurityKvp.Key, mostTradeSecurityKvp.Value);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var statistics = Statistics.Summary;\n            if (!statistics.ContainsKey(MostTradedSecurityStatistic))\n            {\n                throw new RegressionTestException($\"Statistic {MostTradedSecurityStatistic} should be in the summary statistics\");\n            }\n            if (!statistics.ContainsKey(MostTradedSecurityTradeCountStatistic))\n            {\n                throw new RegressionTestException($\"Statistic {MostTradedSecurityTradeCountStatistic} should be in the summary statistics\");\n            }\n            var mostTradeSecurityKvp = _tradeCounts.MaxBy(kvp => kvp.Value);\n            CheckMostTradedSecurityStatistic(statistics, mostTradeSecurityKvp.Key, mostTradeSecurityKvp.Value);\n        }\n\n        private void CheckMostTradedSecurityStatistic(Dictionary<string, string> statistics, Symbol mostTradedSecurity, int tradeCount)\n        {\n            var mostTradedSecurityStatistic = statistics[MostTradedSecurityStatistic];\n            var mostTradedSecurityTradeCountStatistic = statistics[MostTradedSecurityTradeCountStatistic];\n            Log($\"Most traded security: {mostTradedSecurityStatistic}\");\n            Log($\"Most traded security trade count: {mostTradedSecurityTradeCountStatistic}\");\n\n            if (mostTradedSecurityStatistic != mostTradedSecurity)\n            {\n                throw new RegressionTestException($\"Most traded security should be {mostTradedSecurity} but it is {mostTradedSecurityStatistic}\");\n            }\n            if (mostTradedSecurityTradeCountStatistic != tradeCount.ToStringInvariant())\n            {\n                throw new RegressionTestException($\"Most traded security trade count should be {tradeCount} but it is {mostTradedSecurityTradeCountStatistic}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7843;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"94\"},\n            {\"Average Win\", \"0.09%\"},\n            {\"Average Loss\", \"-0.03%\"},\n            {\"Compounding Annual Return\", \"18.903%\"},\n            {\"Drawdown\", \"0.800%\"},\n            {\"Expectancy\", \"0.135\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100221.61\"},\n            {\"Net Profit\", \"0.222%\"},\n            {\"Sharpe Ratio\", \"6.406\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"69.072%\"},\n            {\"Loss Rate\", \"70%\"},\n            {\"Win Rate\", \"30%\"},\n            {\"Profit-Loss Ratio\", \"2.73\"},\n            {\"Alpha\", \"-0.144\"},\n            {\"Beta\", \"0.264\"},\n            {\"Annual Standard Deviation\", \"0.059\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-9.751\"},\n            {\"Tracking Error\", \"0.164\"},\n            {\"Treynor Ratio\", \"1.43\"},\n            {\"Total Fees\", \"$114.39\"},\n            {\"Estimated Strategy Capacity\", \"$1100000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"549.26%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"Most Traded Security\", \"IBM\"},\n            {\"Most Traded Security Trade Count\", \"63\"},\n            {\"OrderListHash\", \"8dd77e35338a81410a5b68dc8345f402\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StochasticIndicatorAndSubIndicatorsWarmUpRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test ensures that the Stochastic indicator and its sub-indicators  \n    /// are properly initialized, warmed up, and returning meaningful values.  \n    /// It verifies that they do not return zero after warm-up.\n    /// </summary>\n    public class StochasticIndicatorAndSubIndicatorsWarmUpRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _dataPointsReceived;\n        private Symbol _spy;\n        private Stochastic _stochasticIndicator;\n        private Stochastic _stochasticHistory;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 2, 1);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            var dailyConsolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));\n            _stochasticIndicator = new Stochastic(\"FIRST\", 14, 3, 3);\n            RegisterIndicator(_spy, _stochasticIndicator, dailyConsolidator);\n\n            WarmUpIndicator(_spy, _stochasticIndicator, TimeSpan.FromDays(1));\n\n            _stochasticHistory = new Stochastic(\"SECOND\", 14, 3, 3);\n            RegisterIndicator(_spy, _stochasticHistory, dailyConsolidator);\n\n            // The warm-up period for the Stochastic indicator is calculated as:\n            // period + kPeriod + dPeriod - 2 = 14 + 3 + 3 - 2 = 18\n            // To ensure the indicator is fully warmed up, we request a history length\n            // significantly greater than 18.\n            var periods = 50;\n            // Get historical data for warming up the stochasticHistory\n            var history = History(_spy, periods, Resolution.Daily);\n\n            // Warm up STO indicator\n            foreach (var bar in history)\n            {\n                _stochasticHistory.Update(bar);\n            }\n\n            var indicators = new List<IIndicator>() { _stochasticIndicator, _stochasticHistory };\n\n            // Ensure both indicators are ready\n            foreach (var indicator in indicators)\n            {\n                if (!indicator.IsReady)\n                {\n                    throw new RegressionTestException($\"{indicator.Name} should be ready, but it is not. Number of samples: {indicator.Samples}\");\n                }\n            }\n\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n\n            if (slice.ContainsKey(_spy))\n            {\n                _dataPointsReceived = true;\n                if (_stochasticIndicator.StochK.Current.Value == decimal.Zero || _stochasticHistory.StochK.Current.Value == decimal.Zero || _stochasticIndicator.FastStoch.Current.Value == decimal.Zero)\n                {\n                    throw new RegressionTestException(\"The stochastic indicators should be ready by now and start returning values different from zero.\");\n                }\n\n                if (_stochasticIndicator.StochK.Current.Value != _stochasticHistory.StochK.Current.Value)\n                {\n                    throw new RegressionTestException($\"Stoch K values of indicators differ: {_stochasticIndicator.Name}.StochK: {_stochasticIndicator.StochK.Current.Value} | {_stochasticHistory.Name}.StochK: {_stochasticHistory.StochK.Current.Value}\");\n                }\n\n                if (_stochasticIndicator.StochD.Current.Value != _stochasticHistory.StochD.Current.Value)\n                {\n                    throw new RegressionTestException($\"Stoch D values of indicators differ: {_stochasticIndicator.Name}.StochD: {_stochasticIndicator.StochD.Current.Value} | {_stochasticHistory.Name}.StochD: {_stochasticHistory.StochD.Current.Value}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            // Ensure that at least one data point was received\n            if (!_dataPointsReceived)\n            {\n                throw new RegressionTestException(\"No data points received\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 302;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 68;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.016\"},\n            {\"Tracking Error\", \"0.101\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StochasticIndicatorWarmsUpProperlyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm that asserts Stochastic indicator, registered with a different resolution consolidator,\n    /// is warmed up properly by calling QCAlgorithm.WarmUpIndicator\n    /// </summary>\n    public class StochasticIndicatorWarmsUpProperlyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _dataPointsReceived;\n        private Symbol _spy;\n        private RelativeStrengthIndex _rsi;\n        private RelativeStrengthIndex _rsiHistory;\n        private Stochastic _sto;\n        private Stochastic _stoHistory;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 1, 1);\n            SetEndDate(2020, 2, 1);\n\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            var dailyConsolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));\n            _rsi = new RelativeStrengthIndex(14, MovingAverageType.Wilders);\n            _sto = new Stochastic(\"FIRST\", 10, 3, 3);\n            RegisterIndicator(_spy, _rsi, dailyConsolidator);\n            RegisterIndicator(_spy, _sto, dailyConsolidator);\n\n            WarmUpIndicator(_spy, _rsi, TimeSpan.FromDays(1));\n            WarmUpIndicator(_spy, _sto, TimeSpan.FromDays(1));\n\n            _rsiHistory = new RelativeStrengthIndex(14, MovingAverageType.Wilders);\n            _stoHistory = new Stochastic(\"SECOND\", 10, 3, 3);\n            RegisterIndicator(_spy, _rsiHistory, dailyConsolidator);\n            RegisterIndicator(_spy, _stoHistory, dailyConsolidator);\n\n            var history = History(_spy, Math.Max(_rsiHistory.WarmUpPeriod, _stoHistory.WarmUpPeriod), Resolution.Daily);\n\n            // Warm up RSI indicator\n            foreach (var bar in history)\n            {\n                _rsiHistory.Update(bar.EndTime, bar.Close);\n            }\n\n            // Warm up STO indicator\n            foreach (var bar in history.TakeLast(_stoHistory.WarmUpPeriod))\n            {\n                _stoHistory.Update(bar);\n            }\n\n            var indicators = new List<IIndicator>() { _rsi, _sto, _rsiHistory, _stoHistory };\n\n            foreach (var indicator in indicators)\n            {\n                if (!indicator.IsReady)\n                {\n                    throw new RegressionTestException($\"{indicator.Name} should be ready, but it is not. Number of samples: {indicator.Samples}\");\n                }\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp) return;\n\n            if (slice.ContainsKey(_spy))\n            {\n                _dataPointsReceived = true;\n\n                if (_rsi.Current.Value != _rsiHistory.Current.Value)\n                {\n                    throw new RegressionTestException($\"Values of indicators differ: {_rsi.Name}: {_rsi.Current.Value} | {_rsiHistory.Name}: {_rsiHistory.Current.Value}\");\n                }\n\n                if (_sto.StochK.Current.Value != _stoHistory.StochK.Current.Value)\n                {\n                    throw new RegressionTestException($\"Stoch K values of indicators differ: {_sto.Name}.StochK: {_sto.StochK.Current.Value} | {_stoHistory.Name}.StochK: {_stoHistory.StochK.Current.Value}\");\n                }\n\n                if (_sto.StochD.Current.Value != _stoHistory.StochD.Current.Value)\n                {\n                    throw new RegressionTestException($\"Stoch D values of indicators differ: {_sto.Name}.StochD: {_sto.StochD.Current.Value} | {_stoHistory.Name}.StochD: {_stoHistory.StochD.Current.Value}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_dataPointsReceived)\n            {\n                throw new Exception(\"No data points received\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 302;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 44;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.016\"},\n            {\"Tracking Error\", \"0.101\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StopLimitOrderRegressionAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place stop limit orders.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"stop limit order\"/>\n    public class StopLimitOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private OrderTicket _buyOrderTicket;\n        private OrderTicket _sellOrderTicket;\n\n        private const decimal _tolerance = 0.001m;\n        private const int _fastPeriod = 30;\n        private const int _slowPeriod = 60;\n\n        private ExponentialMovingAverage _fast;\n        private ExponentialMovingAverage _slow;\n\n        protected virtual bool AsynchronousOrders => false;\n\n        public bool IsReady { get { return _fast.IsReady && _slow.IsReady; } }\n        public bool TrendIsUp { get { return IsReady && _fast > _slow * (1 + _tolerance); } }\n        public bool TrendIsDown { get { return IsReady && _fast < _slow * (1 + _tolerance); } }\n\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 01, 01);\n            SetEndDate(2017, 01, 01);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n\n            _fast = EMA(_symbol, _fastPeriod, Resolution.Daily);\n            _slow = EMA(_symbol, _slowPeriod, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!IsReady)\n            {\n                return;\n            }\n\n            var security = Securities[_symbol];\n            if (_buyOrderTicket == null && TrendIsUp)\n            {\n                _buyOrderTicket = StopLimitOrder(_symbol, 100, stopPrice: security.High * 1.10m, limitPrice: security.High * 1.11m, asynchronous: AsynchronousOrders);\n            }\n            else if (_buyOrderTicket.Status == OrderStatus.Filled && _sellOrderTicket == null && TrendIsDown)\n            {\n                _sellOrderTicket = StopLimitOrder(_symbol, -100, stopPrice: security.Low * 0.99m, limitPrice: security.Low * 0.98m, asynchronous: AsynchronousOrders);\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                var order = Transactions.GetOrderById(orderEvent.OrderId);\n                if (!((StopLimitOrder)order).StopTriggered)\n                {\n                    throw new RegressionTestException(\"StopLimitOrder StopTriggered should haven been set if the order filled.\");\n                }\n\n                if (orderEvent.Direction == OrderDirection.Buy)\n                {\n                    var limitPrice = _buyOrderTicket.Get(OrderField.LimitPrice);\n                    if (orderEvent.FillPrice > limitPrice)\n                    {\n                        throw new RegressionTestException($@\"Buy stop limit order should have filled with price less than or equal to the limit price {\n                            limitPrice}. Fill price: {orderEvent.FillPrice}\");\n                    }\n                }\n                else\n                {\n                    var limitPrice = _sellOrderTicket.Get(OrderField.LimitPrice);\n                    if (orderEvent.FillPrice < limitPrice)\n                    {\n                        throw new RegressionTestException($@\"Sell stop limit order should have filled with price greater than or equal to the limit price {\n                            limitPrice}. Fill price: {orderEvent.FillPrice}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_buyOrderTicket == null || _sellOrderTicket == null)\n            {\n                throw new RegressionTestException(\"Expected two orders (buy and sell) to have been filled at the end of the algorithm.\");\n            }\n\n            if (_buyOrderTicket.Status != OrderStatus.Filled || _sellOrderTicket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException(\"Expected the two orders (buy and sell) to have been filled at the end of the algorithm.\");\n            }\n\n            foreach (var ticket in Transactions.GetOrderTickets())\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 8061;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"1.28%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0.318%\"},\n            {\"Drawdown\", \"1.500%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101277.61\"},\n            {\"Net Profit\", \"1.278%\"},\n            {\"Sharpe Ratio\", \"-0.791\"},\n            {\"Sortino Ratio\", \"-0.433\"},\n            {\"Probabilistic Sharpe Ratio\", \"4.702%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.009\"},\n            {\"Beta\", \"0.03\"},\n            {\"Annual Standard Deviation\", \"0.008\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.963\"},\n            {\"Tracking Error\", \"0.104\"},\n            {\"Treynor Ratio\", \"-0.199\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$6100000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.02%\"},\n            {\"Drawdown Recovery\", \"39\"},\n            {\"OrderListHash\", \"f315858f3f9e6a983cfcf887237f70fd\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StopLimitOrderRegressionAsyncAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place stop limit orders asynchronously.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"stop limit order\"/>\n    public class StopLimitOrderAsyncRegressionAlgorithm : StopLimitOrderRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StopLossOnOrderEventRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test algorithm reproduces GH issue 3239, where the stopLoss order\n    /// place on <see cref=\"OnOrderEvent\"/> was not being filled.\n    /// </summary>\n    public class StopLossOnOrderEventRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private bool _alreadyTraded;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            _spy = AddEquity(\"SPY\").Symbol;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{orderEvent}\");\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            if (order.Tag == \"Entry\" && orderEvent.Status == OrderStatus.Filled)\n            {\n                // Entry short $2 below\n                var stopPrice = orderEvent.FillPrice - 2;\n                var currencySymbol = Currencies.GetCurrencySymbol(order.PriceCurrency);\n                Debug($\"Enter short at {orderEvent.FillPrice} set STOPLOSS at {currencySymbol}{stopPrice}\");\n                StopMarketOrder(order.Symbol, -order.Quantity, stopPrice, tag: \"StopLoss\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_alreadyTraded)\n            {\n                _alreadyTraded = true;\n                MarketOrder(_spy, -100, false, \"Entry\");\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0.00%\"},\n            {\"Compounding Annual Return\", \"-0.359%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99995.41\"},\n            {\"Net Profit\", \"-0.005%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$18000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"5.79%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d448232662a0cada4bf83ef8334bcb5b\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StopMarketOrderAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of a StopMarket order in asynchronous mode.\n    /// </summary>\n    public class StopMarketOrderAsyncRegressionAlgorithm : StopMarketOrderRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StopMarketOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating the use of a StopMarket order.\n    /// </summary>\n    public class StopMarketOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private OrderTicket _ticket;\n\n        protected virtual bool AsynchronousOrders => false;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2021, 03, 01);\n            SetEndDate(2021, 03, 03);\n            SetCash(100000);\n\n            var security = AddEquity(\"SPY\", Resolution.Hour);\n            _symbol = security.Symbol;\n\n            Schedule.On(DateRules.Today, TimeRules.Noon, () =>\n            {\n                var stopPrice = security.Price - 2;\n                _ticket = StopMarketOrder(_symbol, 1, stopPrice, asynchronous: AsynchronousOrders);\n                if (_ticket.Status != OrderStatus.New && _ticket.Status != OrderStatus.Submitted)\n                {\n                    throw new RegressionTestException($\"Expected the StopMarket order to be New or Submitted, instead found {_ticket.Status}\");\n                }\n            });\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_ticket == null)\n            {\n                throw new RegressionTestException(\"Expected to have placed a StopMarket order\");\n            }\n\n            if (_ticket.Status != OrderStatus.Filled)\n            {\n                throw new RegressionTestException($\"Expected the StopMarket order to be filled, instead found {_ticket.Status}\");\n            }\n\n            if (_ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n            {\n                throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 50;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-1.217%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99991.05\"},\n            {\"Net Profit\", \"-0.009%\"},\n            {\"Sharpe Ratio\", \"-54.552\"},\n            {\"Sortino Ratio\", \"-54.552\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.009\"},\n            {\"Beta\", \"0.004\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"15.122\"},\n            {\"Tracking Error\", \"0.061\"},\n            {\"Treynor Ratio\", \"-3.333\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$21000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.13%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d811ec9b64f5dc3d80d1b4db2a98a765\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StressSymbols.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public static class StressSymbols\n    {\n        /// <summary>\n        /// The forex symbols.\n        /// </summary>\n        public static HashSet<string> ForexSymbols = new HashSet<string>(SymbolPropertiesDatabase\n            .FromDataFolder()\n            .GetSymbolPropertiesList(Market.Oanda, SecurityType.Forex)\n            .Select(x => x.Key.Symbol));\n\n        /// <summary>\n        /// The stock symbols.\n        /// </summary>\n        public static HashSet<string> StockSymbols = new HashSet<string>\n        {\n            \"A\",\n            \"AA\",\n            \"AADR\",\n            \"AAMC\",\n            \"AAME\",\n            \"AAN\",\n            \"AAOI\",\n            \"AAON\",\n            \"AAP\",\n            \"AAPL\",\n            \"AAT\",\n            \"AAU\",\n            \"AAV\",\n            \"AAWW\",\n            \"AAXJ\",\n            \"AB\",\n            \"ABAX\",\n            \"ABB\",\n            \"ABBV\",\n            \"ABC\",\n            \"ABCB\",\n            \"ABCD\",\n            \"ABCO\",\n            \"ABFS\",\n            \"ABG\",\n            \"ABI\",\n            \"ABIO\",\n            \"ABM\",\n            \"ABMD\",\n            \"ABR\",\n            \"ABT\",\n            \"ABTL\",\n            \"ABV.C\",\n            \"ABV\",\n            \"ABX\",\n            \"ACAD\",\n            \"ACAS\",\n            \"ACAT\",\n            \"ACC\",\n            \"ACCL\",\n            \"ACCO\",\n            \"ACE\",\n            \"ACET\",\n            \"ACFC\",\n            \"ACFN\",\n            \"ACG\",\n            \"ACGL\",\n            \"ACH\",\n            \"ACHC\",\n            \"ACHN\",\n            \"ACI\",\n            \"ACIW\",\n            \"ACLS\",\n            \"ACM\",\n            \"ACMP\",\n            \"ACN\",\n            \"ACNB\",\n            \"ACO\",\n            \"ACOR\",\n            \"ACP\",\n            \"ACPW\",\n            \"ACRE\",\n            \"ACRX\",\n            \"ACST\",\n            \"ACT\",\n            \"ACTG\",\n            \"ACTS\",\n            \"ACTV\",\n            \"ACU\",\n            \"ACUR\",\n            \"ACW\",\n            \"ACWI\",\n            \"ACWV\",\n            \"ACWX\",\n            \"ACXM\",\n            \"ACY\",\n            \"ADAT\",\n            \"ADBE\",\n            \"ADC\",\n            \"ADEP\",\n            \"ADES\",\n            \"ADGE\",\n            \"ADHD\",\n            \"ADI\",\n            \"ADK\",\n            \"ADM\",\n            \"ADNC\",\n            \"ADP\",\n            \"ADRA\",\n            \"ADRA\",\n            \"ADRD\",\n            \"ADRE\",\n            \"ADRU\",\n            \"ADS\",\n            \"ADSK\",\n            \"ADT\",\n            \"ADTN\",\n            \"ADUS\",\n            \"ADVS\",\n            \"ADX\",\n            \"AE\",\n            \"AEB\",\n            \"AEC\",\n            \"AED\",\n            \"AEE\",\n            \"AEF\",\n            \"AEG\",\n            \"AEGN\",\n            \"AEGR\",\n            \"AEH\",\n            \"AEHR\",\n            \"AEIS\",\n            \"AEK\",\n            \"AEL\",\n            \"AEM\",\n            \"AEM\",\n            \"AEO\",\n            \"AEP\",\n            \"AEPI\",\n            \"AER\",\n            \"AES\",\n            \"AET\",\n            \"AETI\",\n            \"AEV\",\n            \"AEY\",\n            \"AEZS\",\n            \"AF\",\n            \"AFA\",\n            \"AFAM\",\n            \"AFB\",\n            \"AFC\",\n            \"AFCE\",\n            \"AFCE\",\n            \"AFFX\",\n            \"AFG\",\n            \"AFH\",\n            \"AFK\",\n            \"AFL\",\n            \"AFM\",\n            \"AFOP\",\n            \"AFQ\",\n            \"AFSD\",\n            \"AFSI\",\n            \"AFT\",\n            \"AFW\",\n            \"AG\",\n            \"AGC\",\n            \"AGCO\",\n            \"AGD\",\n            \"AGEN\",\n            \"AGG\",\n            \"AGI\",\n            \"AGII\",\n            \"AGIIL\",\n            \"AGIO\",\n            \"AGLS\",\n            \"AGM\",\n            \"AGN\",\n            \"AGN\",\n            \"AGNC\",\n            \"AGNCP\",\n            \"AGNCP\",\n            \"AGO\",\n            \"AGQ\",\n            \"AGRO\",\n            \"AGU\",\n            \"AGX\",\n            \"AGYS\",\n            \"AGZ\",\n            \"AH\",\n            \"AHC\",\n            \"AHGP\",\n            \"AHH\",\n            \"AHL\",\n            \"AHPI\",\n            \"AHS\",\n            \"AHT\",\n            \"AI\",\n            \"AIA\",\n            \"AIB\",\n            \"AIF\",\n            \"AIG\",\n            \"AIMC\",\n            \"AIN\",\n            \"AINV\",\n            \"AIQ\",\n            \"AIR\",\n            \"AIRM\",\n            \"AIRT\",\n            \"AIT\",\n            \"AIV\",\n            \"AIXG\",\n            \"AIY\",\n            \"AIY\",\n            \"AIZ\",\n            \"AJB\",\n            \"AJG\",\n            \"AJG\",\n            \"AKAM\",\n            \"AKG\",\n            \"AKO.A\",\n            \"AKO.B\",\n            \"AKP\",\n            \"AKR\",\n            \"AKRX\",\n            \"AKS\",\n            \"AL\",\n            \"ALB\",\n            \"ALCO\",\n            \"ALCS\",\n            \"ALD\",\n            \"ALDW\",\n            \"ALE\",\n            \"ALEX\",\n            \"ALFA\",\n            \"ALG\",\n            \"ALGN\",\n            \"ALGT\",\n            \"ALIM\",\n            \"ALJ\",\n            \"ALJ\",\n            \"ALK\",\n            \"ALKS\",\n            \"ALL\",\n            \"ALLB\",\n            \"ALLB\",\n            \"ALLT\",\n            \"ALN\",\n            \"ALNY\",\n            \"ALOG\",\n            \"ALOT\",\n            \"ALR\",\n            \"ALSK\",\n            \"ALSN\",\n            \"ALTI\",\n            \"ALTR\",\n            \"ALTV\",\n            \"ALU\",\n            \"ALV\",\n            \"ALVR\",\n            \"ALX\",\n            \"ALXA\",\n            \"ALXN\",\n            \"AMAG\",\n            \"AMAP\",\n            \"AMAT\",\n            \"AMBA\",\n            \"AMBC\",\n            \"AMBCW\",\n            \"AMBI\",\n            \"AMBT\",\n            \"AMCC\",\n            \"AMCF\",\n            \"AMCN\",\n            \"AMCO\",\n            \"AMCX\",\n            \"AMD\",\n            \"AME\",\n            \"AMED\",\n            \"AMG\",\n            \"AMG\",\n            \"AMGN\",\n            \"AMH\",\n            \"AMIC\",\n            \"AMID\",\n            \"AMJ\",\n            \"AMKR\",\n            \"AMLP\",\n            \"AMNB\",\n            \"AMOT\",\n            \"AMOV\",\n            \"AMP\",\n            \"AMPE\",\n            \"AMRB\",\n            \"AMRC\",\n            \"AMRE\",\n            \"AMRI\",\n            \"AMRN\",\n            \"AMRS\",\n            \"AMSC\",\n            \"AMSF\",\n            \"AMSG\",\n            \"AMSWA\",\n            \"AMT\",\n            \"AMTD\",\n            \"AMTG\",\n            \"AMU\",\n            \"AMWD\",\n            \"AMX\",\n            \"AMZN\",\n            \"AN\",\n            \"ANAC\",\n            \"ANAD\",\n            \"ANAT\",\n            \"ANCB\",\n            \"ANCI\",\n            \"ANCX\",\n            \"ANDA\",\n            \"ANDAU\",\n            \"ANDE\",\n            \"ANEN\",\n            \"ANF\",\n            \"ANFI\",\n            \"ANGI\",\n            \"ANGL\",\n            \"ANGO\",\n            \"ANH\",\n            \"ANIK\",\n            \"ANIP\",\n            \"ANLY\",\n            \"ANN\",\n            \"ANR\",\n            \"ANSS\",\n            \"ANTH\",\n            \"ANV\",\n            \"ANW\",\n            \"AOA\",\n            \"AOD\",\n            \"AOI\",\n            \"AOK\",\n            \"AOL\",\n            \"AOM\",\n            \"AON\",\n            \"AOR\",\n            \"AOS\",\n            \"AOSL\",\n            \"AP\",\n            \"APA\",\n            \"APAGF\",\n            \"APAM\",\n            \"APB\",\n            \"APC\",\n            \"APD\",\n            \"APEI\",\n            \"APF\",\n            \"APFC\",\n            \"APH\",\n            \"API\",\n            \"APL\",\n            \"APO\",\n            \"APOG\",\n            \"APOL\",\n            \"APP\",\n            \"APPY\",\n            \"APRI\",\n            \"APSA\",\n            \"APT\",\n            \"APTS\",\n            \"APU\",\n            \"APWC\",\n            \"AQQ\",\n            \"AQU\",\n            \"ARAY\",\n            \"ARC\",\n            \"ARCC\",\n            \"ARCI\",\n            \"ARCO\",\n            \"ARCP\",\n            \"ARCW\",\n            \"ARDC\",\n            \"ARDNA\",\n            \"ARE\",\n            \"AREX\",\n            \"ARG\",\n            \"ARGT\",\n            \"ARI\",\n            \"ARIA\",\n            \"ARII\",\n            \"ARK\",\n            \"ARKR\",\n            \"ARL\",\n            \"ARLP\",\n            \"ARMH\",\n            \"ARN\",\n            \"ARNA\",\n            \"ARO\",\n            \"AROW\",\n            \"ARP\",\n            \"ARPI\",\n            \"ARQL\",\n            \"ARR\",\n            \"ARRS\",\n            \"ARRY\",\n            \"ARSD\",\n            \"ARTC\",\n            \"ARTNA\",\n            \"ARTW\",\n            \"ARTX\",\n            \"ARU\",\n            \"ARUN\",\n            \"ARW\",\n            \"ARWR\",\n            \"ARX\",\n            \"ARY\",\n            \"ASA\",\n            \"ASBB\",\n            \"ASBC\",\n            \"ASBCW\",\n            \"ASBI\",\n            \"ASC\",\n            \"ASCMA\",\n            \"ASEA\",\n            \"ASEI\",\n            \"ASFI\",\n            \"ASG\",\n            \"ASGN\",\n            \"ASH\",\n            \"ASIA\",\n            \"ASM\",\n            \"ASMI\",\n            \"ASML\",\n            \"ASNA\",\n            \"ASP\",\n            \"ASPS\",\n            \"ASR\",\n            \"ASRV\",\n            \"ASRVP\",\n            \"ASTC\",\n            \"ASTE\",\n            \"ASTI\",\n            \"ASTM\",\n            \"ASTX\",\n            \"ASUR\",\n            \"ASX\",\n            \"ASYS\",\n            \"AT\",\n            \"ATAI\",\n            \"ATAX\",\n            \"ATE\",\n            \"ATEA\",\n            \"ATEC\",\n            \"ATHL\",\n            \"ATHN\",\n            \"ATHX\",\n            \"ATI\",\n            \"ATK\",\n            \"ATL\",\n            \"ATLC\",\n            \"ATLO\",\n            \"ATLS\",\n            \"ATMI\",\n            \"ATML\",\n            \"ATMP\",\n            \"ATNI\",\n            \"ATNY\",\n            \"ATO\",\n            \"ATOS\",\n            \"ATR\",\n            \"ATRC\",\n            \"ATRI\",\n            \"ATRM\",\n            \"ATRO\",\n            \"ATRS\",\n            \"ATSG\",\n            \"ATTU\",\n            \"ATU\",\n            \"ATV\",\n            \"ATVI\",\n            \"ATW\",\n            \"ATX\",\n            \"AU\",\n            \"AUBN\",\n            \"AUD\",\n            \"AUDC\",\n            \"AUMN\",\n            \"AUNZ\",\n            \"AUO\",\n            \"AUQ\",\n            \"AUSE\",\n            \"AUXL\",\n            \"AUY\",\n            \"AV\",\n            \"AVA\",\n            \"AVAV\",\n            \"AVB\",\n            \"AVD\",\n            \"AVEO\",\n            \"AVG\",\n            \"AVGO\",\n            \"AVHI\",\n            \"AVID\",\n            \"AVIV\",\n            \"AVK\",\n            \"AVL\",\n            \"AVNR\",\n            \"AVNW\",\n            \"AVP\",\n            \"AVT\",\n            \"AVV\",\n            \"AVX\",\n            \"AVY\",\n            \"AWAY\",\n            \"AWC\",\n            \"AWF\",\n            \"AWH\",\n            \"AWI\",\n            \"AWK\",\n            \"AWP\",\n            \"AWR\",\n            \"AWRE\",\n            \"AWX\",\n            \"AXAS\",\n            \"AXDX\",\n            \"AXE\",\n            \"AXGN\",\n            \"AXHE\",\n            \"AXJL\",\n            \"AXL\",\n            \"AXLL\",\n            \"AXP\",\n            \"AXR\",\n            \"AXS\",\n            \"AXTE\",\n            \"AXTI\",\n            \"AXU\",\n            \"AXX\",\n            \"AYI\",\n            \"AYN\",\n            \"AYR\",\n            \"AYT\",\n            \"AZC\",\n            \"AZN\",\n            \"AZO\",\n            \"AZPN\",\n            \"AZZ\",\n            \"B\",\n            \"BA\",\n            \"BAA\",\n            \"BAB\",\n            \"BABS\",\n            \"BABY\",\n            \"BAC\",\n            \"BAF\",\n            \"BAGL\",\n            \"BAGR\",\n            \"BAH\",\n            \"BAK\",\n            \"BAL\",\n            \"BALT\",\n            \"BAM\",\n            \"BAMM\",\n            \"BANC\",\n            \"BANCL\",\n            \"BANCP\",\n            \"BANF\",\n            \"BANR\",\n            \"BAP\",\n            \"BARL\",\n            \"BAS\",\n            \"BAX\",\n            \"BAXS\",\n            \"BBBY\",\n            \"BBCN\",\n            \"BBD\",\n            \"BBDO\",\n            \"BBEP\",\n            \"BBF\",\n            \"BBG\",\n            \"BBGI\",\n            \"BBH\",\n            \"BBK\",\n            \"BBL\",\n            \"BBN\",\n            \"BBNK\",\n            \"BBOX\",\n            \"BBRG\",\n            \"BBRY\",\n            \"BBSI\",\n            \"BBT\",\n            \"BBVA\",\n            \"BBW\",\n            \"BBX\",\n            \"BBY\",\n            \"BC\",\n            \"BCA\",\n            \"BCC\",\n            \"BCE\",\n            \"BCEI\",\n            \"BCF\",\n            \"BCH\",\n            \"BCO\",\n            \"BCOM\",\n            \"BCOR\",\n            \"BCOV\",\n            \"BCPC\",\n            \"BCR\",\n            \"BCRX\",\n            \"BCS\",\n            \"BCSB\",\n            \"BCV\",\n            \"BCX\",\n            \"BDBD\",\n            \"BDC\",\n            \"BDCL\",\n            \"BDCS\",\n            \"BDD\",\n            \"BDE\",\n            \"BDGE\",\n            \"BDJ\",\n            \"BDL\",\n            \"BDMS\",\n            \"BDN\",\n            \"BDR\",\n            \"BDSI\",\n            \"BDX\",\n            \"BEAM\",\n            \"BEAT\",\n            \"BEAV\",\n            \"BEBE\",\n            \"BECN\",\n            \"BEE\",\n            \"BELFA\",\n            \"BELFB\",\n            \"BEN\",\n            \"BEP\",\n            \"BERK\",\n            \"BERY\",\n            \"BF.A\",\n            \"BF.B\",\n            \"BFAM\",\n            \"BFIN\",\n            \"BFK\",\n            \"BFO\",\n            \"BFOR\",\n            \"BFR\",\n            \"BFS\",\n            \"BFY\",\n            \"BFZ\",\n            \"BG\",\n            \"BGB\",\n            \"BGC\",\n            \"BGCA\",\n            \"BGCP\",\n            \"BGFV\",\n            \"BGG\",\n            \"BGH\",\n            \"BGI\",\n            \"BGMD\",\n            \"BGR\",\n            \"BGS\",\n            \"BGT\",\n            \"BGX\",\n            \"BGY\",\n            \"BH\",\n            \"BHB\",\n            \"BHD\",\n            \"BHE\",\n            \"BHI\",\n            \"BHK\",\n            \"BHL\",\n            \"BHLB\",\n            \"BHP\",\n            \"BHV\",\n            \"BHY\",\n            \"BIB\",\n            \"BID\",\n            \"BIDU\",\n            \"BIE\",\n            \"BIF\",\n            \"BIG\",\n            \"BIIB\",\n            \"BIK\",\n            \"BIL\",\n            \"BIN\",\n            \"BIND\",\n            \"BIO\",\n            \"BIOA\",\n            \"BIOD\",\n            \"BIOF\",\n            \"BIOL\",\n            \"BIOS\",\n            \"BIP\",\n            \"BIRT\",\n            \"BIS\",\n            \"BIT\",\n            \"BITA\",\n            \"BIV\",\n            \"BIZD\",\n            \"BJK\",\n            \"BJRI\",\n            \"BJZ\",\n            \"BK\",\n            \"BKCC\",\n            \"BKD\",\n            \"BKE\",\n            \"BKEP\",\n            \"BKEPP\",\n            \"BKF\",\n            \"BKH\",\n            \"BKK\",\n            \"BKLN\",\n            \"BKMU\",\n            \"BKN\",\n            \"BKR\",\n            \"BKS\",\n            \"BKSC\",\n            \"BKT\",\n            \"BKU\",\n            \"BKW\",\n            \"BKYF\",\n            \"BLC\",\n            \"BLDP\",\n            \"BLDR\",\n            \"BLE\",\n            \"BLH\",\n            \"BLIN\",\n            \"BLJ\",\n            \"BLK\",\n            \"BLKB\",\n            \"BLL\",\n            \"BLMN\",\n            \"BLMT\",\n            \"BLOX\",\n            \"BLRX\",\n            \"BLT\",\n            \"BLUE\",\n            \"BLV\",\n            \"BLW\",\n            \"BLX\",\n            \"BMA\",\n            \"BME\",\n            \"BMO\",\n            \"BMR\",\n            \"BMRC\",\n            \"BMRN\",\n            \"BMS\",\n            \"BMTC\",\n            \"BMY\",\n            \"BNA\",\n            \"BNCL\",\n            \"BNCN\",\n            \"BND\",\n            \"BNDX\",\n            \"BNFT\",\n            \"BNJ\",\n            \"BNNY\",\n            \"BNO\",\n            \"BNS\",\n            \"BNSO\",\n            \"BNY\",\n            \"BOBE\",\n            \"BOCH\",\n            \"BODY\",\n            \"BOE\",\n            \"BOFI\",\n            \"BOH\",\n            \"BOI\",\n            \"BOIL\",\n            \"BOKF\",\n            \"BOLT\",\n            \"BONA\",\n            \"BOND\",\n            \"BONE\",\n            \"BONT\",\n            \"BOOM\",\n            \"BORN\",\n            \"BOS\",\n            \"BOSC\",\n            \"BOTA\",\n            \"BOTJ\",\n            \"BOXC\",\n            \"BP\",\n            \"BPFH\",\n            \"BPFHP\",\n            \"BPFHW\",\n            \"BPHX\",\n            \"BPI\",\n            \"BPK\",\n            \"BPL\",\n            \"BPO\",\n            \"BPOP\",\n            \"BPOPM\",\n            \"BPOPN\",\n            \"BPS\",\n            \"BPT\",\n            \"BPY\",\n            \"BPZ\",\n            \"BQH\",\n            \"BQR\",\n            \"BQY\",\n            \"BR\",\n            \"BRAF\",\n            \"BRAQ\",\n            \"BRAZ\",\n            \"BRC\",\n            \"BRCD\",\n            \"BRCM\",\n            \"BRD\",\n            \"BRE\",\n            \"BREW\",\n            \"BRF\",\n            \"BRFS\",\n            \"BRID\",\n            \"BRK.A\",\n            \"BRK.B\",\n            \"BRKL\",\n            \"BRKR\",\n            \"BRKS\",\n            \"BRLI\",\n            \"BRN\",\n            \"BRO\",\n            \"BRP\",\n            \"BRS\",\n            \"BRSS\",\n            \"BRT\",\n            \"BRXX\",\n            \"BRY\",\n            \"BRZU\",\n            \"BSAC\",\n            \"BSBR\",\n            \"BSCD\",\n            \"BSCE\",\n            \"BSCF\",\n            \"BSCG\",\n            \"BSCH\",\n            \"BSCI\",\n            \"BSCJ\",\n            \"BSCK\",\n            \"BSCL\",\n            \"BSCM\",\n            \"BSD\",\n            \"BSDM\",\n            \"BSE\",\n            \"BSET\",\n            \"BSFT\",\n            \"BSI\",\n            \"BSJD\",\n            \"BSJE\",\n            \"BSJF\",\n            \"BSJG\",\n            \"BSJH\",\n            \"BSJI\",\n            \"BSJJ\",\n            \"BSJK\",\n            \"BSL\",\n            \"BSMX\",\n            \"BSP\",\n            \"BSPM\",\n            \"BSQR\",\n            \"BSRR\",\n            \"BSTC\",\n            \"BSV\",\n            \"BSX\",\n            \"BT\",\n            \"BTA\",\n            \"BTAL\",\n            \"BTE\",\n            \"BTF\",\n            \"BTG\",\n            \"BTH\",\n            \"BTI\",\n            \"BTN\",\n            \"BTO\",\n            \"BTT\",\n            \"BTU\",\n            \"BTUI\",\n            \"BTX\",\n            \"BTZ\",\n            \"BUD\",\n            \"BUI\",\n            \"BUND\",\n            \"BUNL\",\n            \"BUR\",\n            \"BURL\",\n            \"BUSE\",\n            \"BV\",\n            \"BVN\",\n            \"BVSN\",\n            \"BVX\",\n            \"BWA\",\n            \"BWC\",\n            \"BWEN\",\n            \"BWG\",\n            \"BWINB\",\n            \"BWLD\",\n            \"BWP\",\n            \"BWS\",\n            \"BWX\",\n            \"BWZ\",\n            \"BX\",\n            \"BXC\",\n            \"BXE\",\n            \"BXMT\",\n            \"BXP\",\n            \"BXS\",\n            \"BXUB\",\n            \"BYD\",\n            \"BYFC\",\n            \"BYI\",\n            \"BYM\",\n            \"BZ\",\n            \"BZC\",\n            \"BZF\",\n            \"BZH\",\n            \"BZM\",\n            \"BZQ\",\n            \"C\",\n            \"CA\",\n            \"CAAS\",\n            \"CAB\",\n            \"CAC\",\n            \"CACB\",\n            \"CACC\",\n            \"CACH\",\n            \"CACI\",\n            \"CADC\",\n            \"CADX\",\n            \"CAE\",\n            \"CAF\",\n            \"CAFI\",\n            \"CAG\",\n            \"CAH\",\n            \"CAJ\",\n            \"CAK\",\n            \"CAKE\",\n            \"CALD\",\n            \"CALI\",\n            \"CALL\",\n            \"CALM\",\n            \"CALX\",\n            \"CAM\",\n            \"CAMP\",\n            \"CAMT\",\n            \"CANE\",\n            \"CAP\",\n            \"CAPE\",\n            \"CAR\",\n            \"CARB\",\n            \"CART\",\n            \"CARV\",\n            \"CARZ\",\n            \"CAS\",\n            \"CASH\",\n            \"CASM\",\n            \"CASS\",\n            \"CASY\",\n            \"CAT\",\n            \"CATM\",\n            \"CATO\",\n            \"CATY\",\n            \"CAVM\",\n            \"CAW\",\n            \"CB\",\n            \"CBA\",\n            \"CBAK\",\n            \"CBB\",\n            \"CBD\",\n            \"CBEY\",\n            \"CBF\",\n            \"CBG\",\n            \"CBI\",\n            \"CBIN\",\n            \"CBK\",\n            \"CBL\",\n            \"CBLI\",\n            \"CBM\",\n            \"CBMX\",\n            \"CBMXW\",\n            \"CBNJ\",\n            \"CBNK\",\n            \"CBOE\",\n            \"CBPO\",\n            \"CBR\",\n            \"CBRL\",\n            \"CBRX\",\n            \"CBS.A\",\n            \"CBS\",\n            \"CBSH\",\n            \"CBST\",\n            \"CBT\",\n            \"CBU\",\n            \"CBZ\",\n            \"CCA\",\n            \"CCBG\",\n            \"CCC\",\n            \"CCCL\",\n            \"CCCR\",\n            \"CCE\",\n            \"CCF\",\n            \"CCG\",\n            \"CCH\",\n            \"CCI\",\n            \"CCIH\",\n            \"CCIX\",\n            \"CCJ\",\n            \"CCK\",\n            \"CCL\",\n            \"CCM\",\n            \"CCMP\",\n            \"CCNE\",\n            \"CCO\",\n            \"CCOI\",\n            \"CCRN\",\n            \"CCSC\",\n            \"CCU\",\n            \"CCUR\",\n            \"CCV\",\n            \"CCXI\",\n            \"CDE\",\n            \"CDI\",\n            \"CDNS\",\n            \"CDR\",\n            \"CDTI\",\n            \"CDW\",\n            \"CDXS\",\n            \"CDY\",\n            \"CDZI\",\n            \"CE\",\n            \"CEA\",\n            \"CEB\",\n            \"CEC\",\n            \"CECE\",\n            \"CECO\",\n            \"CEDU\",\n            \"CEE\",\n            \"CEF\",\n            \"CEL\",\n            \"CELG\",\n            \"CELGZ\",\n            \"CEM\",\n            \"CEMI\",\n            \"CEMP\",\n            \"CEN\",\n            \"CENT\",\n            \"CENTA\",\n            \"CENX\",\n            \"CEO\",\n            \"CEP\",\n            \"CERE\",\n            \"CERN\",\n            \"CERS\",\n            \"CET\",\n            \"CETV\",\n            \"CEV\",\n            \"CEVA\",\n            \"CEW\",\n            \"CF\",\n            \"CFBK\",\n            \"CFD\",\n            \"CFFI\",\n            \"CFFN\",\n            \"CFI\",\n            \"CFN\",\n            \"CFNB\",\n            \"CFNL\",\n            \"CFP\",\n            \"CFR\",\n            \"CFT\",\n            \"CFX\",\n            \"CG\",\n            \"CGA\",\n            \"CGEN\",\n            \"CGG\",\n            \"CGI\",\n            \"CGIX\",\n            \"CGNX\",\n            \"CGO\",\n            \"CGR\",\n            \"CGW\",\n            \"CGX\",\n            \"CH\",\n            \"CHA\",\n            \"CHC\",\n            \"CHCI\",\n            \"CHCO\",\n            \"CHD\",\n            \"CHDN\",\n            \"CHDX\",\n            \"CHE\",\n            \"CHEF\",\n            \"CHEP\",\n            \"CHEV\",\n            \"CHFC\",\n            \"CHFN\",\n            \"CHGS\",\n            \"CHH\",\n            \"CHI\",\n            \"CHIE\",\n            \"CHII\",\n            \"CHIM\",\n            \"CHIQ\",\n            \"CHIX\",\n            \"CHK\",\n            \"CHKE\",\n            \"CHKP\",\n            \"CHKR\",\n            \"CHL\",\n            \"CHLC\",\n            \"CHLN\",\n            \"CHMG\",\n            \"CHMI\",\n            \"CHMT\",\n            \"CHN\",\n            \"CHNR\",\n            \"CHOC\",\n            \"CHOP\",\n            \"CHRM\",\n            \"CHRW\",\n            \"CHS\",\n            \"CHSCO\",\n            \"CHSCP\",\n            \"CHSP\",\n            \"CHT\",\n            \"CHTP\",\n            \"CHTR\",\n            \"CHU\",\n            \"CHUY\",\n            \"CHW\",\n            \"CHXF\",\n            \"CHXX\",\n            \"CHY\",\n            \"CHYR\",\n            \"CI\",\n            \"CIA\",\n            \"CIB\",\n            \"CIDM\",\n            \"CIE\",\n            \"CIEN\",\n            \"CIF\",\n            \"CIFC\",\n            \"CIG.C\",\n            \"CIG\",\n            \"CII\",\n            \"CIK\",\n            \"CIM\",\n            \"CIMT\",\n            \"CINF\",\n            \"CIR\",\n            \"CIS\",\n            \"CISAU\",\n            \"CISG\",\n            \"CIT\",\n            \"CITZ\",\n            \"CIU\",\n            \"CJES\",\n            \"CJJD\",\n            \"CKEC\",\n            \"CKH\",\n            \"CKP\",\n            \"CKSW\",\n            \"CKX\",\n            \"CL\",\n            \"CLB\",\n            \"CLBH\",\n            \"CLC\",\n            \"CLCT\",\n            \"CLD\",\n            \"CLDT\",\n            \"CLDX\",\n            \"CLF\",\n            \"CLFD\",\n            \"CLGX\",\n            \"CLH\",\n            \"CLI\",\n            \"CLIR\",\n            \"CLM\",\n            \"CLMS\",\n            \"CLMT\",\n            \"CLNE\",\n            \"CLNT\",\n            \"CLNY\",\n            \"CLR\",\n            \"CLRO\",\n            \"CLRX\",\n            \"CLS\",\n            \"CLSN\",\n            \"CLUB\",\n            \"CLV\",\n            \"CLVS\",\n            \"CLW\",\n            \"CLWT\",\n            \"CLX\",\n            \"CLY\",\n            \"CM\",\n            \"CMA\",\n            \"CMBS\",\n            \"CMC\",\n            \"CMCO\",\n            \"CMCSA\",\n            \"CMCSK\",\n            \"CME\",\n            \"CMF\",\n            \"CMFO\",\n            \"CMG\",\n            \"CMGE\",\n            \"CMI\",\n            \"CMK\",\n            \"CMLP\",\n            \"CMLS\",\n            \"CMN\",\n            \"CMO\",\n            \"CMP\",\n            \"CMRE\",\n            \"CMRX\",\n            \"CMS\",\n            \"CMT\",\n            \"CMTL\",\n            \"CMU\",\n            \"CNA\",\n            \"CNAT\",\n            \"CNBC\",\n            \"CNBKA\",\n            \"CNC\",\n            \"CNCO\",\n            \"CNDA\",\n            \"CNDO\",\n            \"CNET\",\n            \"CNHI\",\n            \"CNI\",\n            \"CNIT\",\n            \"CNK\",\n            \"CNL\",\n            \"CNMD\",\n            \"CNO\",\n            \"CNOB\",\n            \"CNP\",\n            \"CNQ\",\n            \"CNQR\",\n            \"CNR\",\n            \"CNS\",\n            \"CNSI\",\n            \"CNSL\",\n            \"CNTF\",\n            \"CNTY\",\n            \"CNW\",\n            \"CNX\",\n            \"CNYD\",\n            \"CO\",\n            \"COA\",\n            \"COB\",\n            \"COBK\",\n            \"COBO\",\n            \"COBR\",\n            \"COBZ\",\n            \"COCO\",\n            \"CODE\",\n            \"CODI\",\n            \"COF\",\n            \"COG\",\n            \"COGO\",\n            \"COH\",\n            \"COHR\",\n            \"COHU\",\n            \"COKE\",\n            \"COL\",\n            \"COLB\",\n            \"COLE\",\n            \"COLM\",\n            \"CONE\",\n            \"CONN\",\n            \"COO\",\n            \"COOL\",\n            \"COP\",\n            \"COPX\",\n            \"COR\",\n            \"CORE\",\n            \"CORN\",\n            \"CORP\",\n            \"CORR\",\n            \"CORT\",\n            \"COSI\",\n            \"COST\",\n            \"COT\",\n            \"COTY\",\n            \"COV\",\n            \"COVR\",\n            \"COVS\",\n            \"COW\",\n            \"COWN\",\n            \"COY\",\n            \"CP\",\n            \"CPA\",\n            \"CPAC\",\n            \"CPAH\",\n            \"CPB\",\n            \"CPE\",\n            \"CPF\",\n            \"CPGI\",\n            \"CPHC\",\n            \"CPHD\",\n            \"CPHI\",\n            \"CPI\",\n            \"CPIX\",\n            \"CPK\",\n            \"CPL\",\n            \"CPLA\",\n            \"CPLP\",\n            \"CPN\",\n            \"CPRT\",\n            \"CPRX\",\n            \"CPSI\",\n            \"CPSL\",\n            \"CPSS\",\n            \"CPST\",\n            \"CPT\",\n            \"CPTA\",\n            \"CPWR\",\n            \"CQB\",\n            \"CQP\",\n            \"CQQQ\",\n            \"CR\",\n            \"CRAI\",\n            \"CRAY\",\n            \"CRD.A\",\n            \"CRD.B\",\n            \"CRDC\",\n            \"CRDS\",\n            \"CREE\",\n            \"CREG\",\n            \"CRESW\",\n            \"CRESY\",\n            \"CRF\",\n            \"CRH\",\n            \"CRI\",\n            \"CRIS\",\n            \"CRK\",\n            \"CRL\",\n            \"CRM\",\n            \"CRMB\",\n            \"CRMBU\",\n            \"CRMBW\",\n            \"CRMD\",\n            \"CRME\",\n            \"CRMT\",\n            \"CRNT\",\n            \"CROC\",\n            \"CROX\",\n            \"CRR\",\n            \"CRRB\",\n            \"CRRC\",\n            \"CRRS\",\n            \"CRS\",\n            \"CRT\",\n            \"CRTX\",\n            \"CRUS\",\n            \"CRV\",\n            \"CRVL\",\n            \"CRVP\",\n            \"CRWN\",\n            \"CRWS\",\n            \"CRY\",\n            \"CRZO\",\n            \"CS\",\n            \"CSBK\",\n            \"CSC\",\n            \"CSCB\",\n            \"CSCD\",\n            \"CSCO\",\n            \"CSD\",\n            \"CSE\",\n            \"CSFL\",\n            \"CSFS\",\n            \"CSG\",\n            \"CSGP\",\n            \"CSGS\",\n            \"CSH\",\n            \"CSI\",\n            \"CSII\",\n            \"CSIQ\",\n            \"CSJ\",\n            \"CSL\",\n            \"CSLS\",\n            \"CSM\",\n            \"CSMA\",\n            \"CSMB\",\n            \"CSMN\",\n            \"CSOD\",\n            \"CSP\",\n            \"CSPI\",\n            \"CSQ\",\n            \"CSRE\",\n            \"CSS\",\n            \"CST\",\n            \"CSTE\",\n            \"CSTM\",\n            \"CSU\",\n            \"CSUN\",\n            \"CSV\",\n            \"CSWC\",\n            \"CSX\",\n            \"CTAS\",\n            \"CTB\",\n            \"CTBI\",\n            \"CTC\",\n            \"CTCH\",\n            \"CTCM\",\n            \"CTCT\",\n            \"CTF\",\n            \"CTG\",\n            \"CTHR\",\n            \"CTIC\",\n            \"CTL\",\n            \"CTNN\",\n            \"CTO\",\n            \"CTP\",\n            \"CTQ\",\n            \"CTR\",\n            \"CTRL\",\n            \"CTRN\",\n            \"CTRP\",\n            \"CTRX\",\n            \"CTS\",\n            \"CTSH\",\n            \"CTU\",\n            \"CTW\",\n            \"CTWS\",\n            \"CTX\",\n            \"CTXS\",\n            \"CTY\",\n            \"CU\",\n            \"CUB\",\n            \"CUBA\",\n            \"CUBE\",\n            \"CUBI\",\n            \"CUBIL\",\n            \"CUI\",\n            \"CUK\",\n            \"CUNB\",\n            \"CUR\",\n            \"CURE\",\n            \"CUT\",\n            \"CUTR\",\n            \"CUZ\",\n            \"CVA\",\n            \"CVBF\",\n            \"CVC\",\n            \"CVCO\",\n            \"CVCY\",\n            \"CVD\",\n            \"CVE\",\n            \"CVG\",\n            \"CVGI\",\n            \"CVGW\",\n            \"CVI\",\n            \"CVLT\",\n            \"CVLY\",\n            \"CVM\",\n            \"CVO\",\n            \"CVOL\",\n            \"CVR\",\n            \"CVRR\",\n            \"CVS\",\n            \"CVT\",\n            \"CVTI\",\n            \"CVU\",\n            \"CVV\",\n            \"CVX\",\n            \"CVY\",\n            \"CW\",\n            \"CWB\",\n            \"CWBC\",\n            \"CWCO\",\n            \"CWEI\",\n            \"CWH\",\n            \"CWHN\",\n            \"CWHO\",\n            \"CWI\",\n            \"CWST\",\n            \"CWT\",\n            \"CWTR\",\n            \"CWZ\",\n            \"CX\",\n            \"CXA\",\n            \"CXDC\",\n            \"CXE\",\n            \"CXH\",\n            \"CXM\",\n            \"CXO\",\n            \"CXW\",\n            \"CY\",\n            \"CYAN\",\n            \"CYB\",\n            \"CYBE\",\n            \"CYBX\",\n            \"CYCC\",\n            \"CYD\",\n            \"CYE\",\n            \"CYH\",\n            \"CYN\",\n            \"CYNI\",\n            \"CYNO\",\n            \"CYOU\",\n            \"CYS\",\n            \"CYT\",\n            \"CYTK\",\n            \"CYTR\",\n            \"CYTX\",\n            \"CZA\",\n            \"CZFC\",\n            \"CZNC\",\n            \"CZR\",\n            \"CZWI\",\n            \"CZZ\",\n            \"D\",\n            \"DAC\",\n            \"DAEG\",\n            \"DAG\",\n            \"DAIO\",\n            \"DAKT\",\n            \"DAL\",\n            \"DAN\",\n            \"DANG\",\n            \"DAR\",\n            \"DARA\",\n            \"DATA\",\n            \"DATE\",\n            \"DAVE\",\n            \"DB\",\n            \"DBA\",\n            \"DBB\",\n            \"DBC\",\n            \"DBD\",\n            \"DBE\",\n            \"DBEF\",\n            \"DBEM\",\n            \"DBGR\",\n            \"DBJP\",\n            \"DBL\",\n            \"DBLE\",\n            \"DBLEP\",\n            \"DBO\",\n            \"DBP\",\n            \"DBS\",\n            \"DBU\",\n            \"DBV\",\n            \"DCA\",\n            \"DCE\",\n            \"DCI\",\n            \"DCIN\",\n            \"DCIX\",\n            \"DCM\",\n            \"DCNG\",\n            \"DCO\",\n            \"DCOM\",\n            \"DCT\",\n            \"DCTH\",\n            \"DCUA\",\n            \"DCUB\",\n            \"DD\",\n            \"DDC\",\n            \"DDD\",\n            \"DDE\",\n            \"DDF\",\n            \"DDG\",\n            \"DDM\",\n            \"DDP\",\n            \"DDR\",\n            \"DDS\",\n            \"DDT\",\n            \"DE\",\n            \"DECK\",\n            \"DEE\",\n            \"DEF\",\n            \"DEG\",\n            \"DEI\",\n            \"DEJ\",\n            \"DEL\",\n            \"DELL\",\n            \"DEM\",\n            \"DENN\",\n            \"DEO\",\n            \"DEPO\",\n            \"DES\",\n            \"DEST\",\n            \"DEW\",\n            \"DEX\",\n            \"DF\",\n            \"DFE\",\n            \"DFJ\",\n            \"DFP\",\n            \"DFRG\",\n            \"DFS\",\n            \"DFT\",\n            \"DFZ\",\n            \"DG\",\n            \"DGAS\",\n            \"DGAZ\",\n            \"DGI\",\n            \"DGICA\",\n            \"DGICB\",\n            \"DGII\",\n            \"DGIT\",\n            \"DGL\",\n            \"DGLD\",\n            \"DGLY\",\n            \"DGP\",\n            \"DGRE\",\n            \"DGRS\",\n            \"DGRW\",\n            \"DGS\",\n            \"DGSE\",\n            \"DGX\",\n            \"DGZ\",\n            \"DHF\",\n            \"DHG\",\n            \"DHI\",\n            \"DHIL\",\n            \"DHR\",\n            \"DHRM\",\n            \"DHS\",\n            \"DHT\",\n            \"DHX\",\n            \"DHY\",\n            \"DIA\",\n            \"DIG\",\n            \"DIM\",\n            \"DIN\",\n            \"DIOD\",\n            \"DIS\",\n            \"DISCA\",\n            \"DISCK\",\n            \"DISH\",\n            \"DIV\",\n            \"DJCI\",\n            \"DJCO\",\n            \"DJP\",\n            \"DK\",\n            \"DKL\",\n            \"DKS\",\n            \"DKT\",\n            \"DL\",\n            \"DLA\",\n            \"DLB\",\n            \"DLBS\",\n            \"DLHC\",\n            \"DLIA\",\n            \"DLLR\",\n            \"DLN\",\n            \"DLPH\",\n            \"DLR\",\n            \"DLS\",\n            \"DLTR\",\n            \"DLX\",\n            \"DM\",\n            \"DMB\",\n            \"DMD\",\n            \"DMF\",\n            \"DMLP\",\n            \"DMND\",\n            \"DMO\",\n            \"DMRC\",\n            \"DNB\",\n            \"DNDN\",\n            \"DNI\",\n            \"DNKN\",\n            \"DNL\",\n            \"DNN\",\n            \"DNO\",\n            \"DNP\",\n            \"DNR\",\n            \"DNY\",\n            \"DO\",\n            \"DOC\",\n            \"DOD\",\n            \"DOG\",\n            \"DOL\",\n            \"DOLE\",\n            \"DOM\",\n            \"DON\",\n            \"DOO\",\n            \"DOOR\",\n            \"DORM\",\n            \"DOV\",\n            \"DOW\",\n            \"DOX\",\n            \"DPD\",\n            \"DPG\",\n            \"DPK\",\n            \"DPM\",\n            \"DPO\",\n            \"DPS\",\n            \"DPW\",\n            \"DPZ\",\n            \"DQ\",\n            \"DRAD\",\n            \"DRAM\",\n            \"DRC\",\n            \"DRCO\",\n            \"DRD\",\n            \"DRE\",\n            \"DRGS\",\n            \"DRH\",\n            \"DRI\",\n            \"DRII\",\n            \"DRIV\",\n            \"DRL\",\n            \"DRN\",\n            \"DRQ\",\n            \"DRR\",\n            \"DRRX\",\n            \"DRTX\",\n            \"DRU\",\n            \"DRV\",\n            \"DRW\",\n            \"DRWI\",\n            \"DRYS\",\n            \"DSCI\",\n            \"DSCO\",\n            \"DSGX\",\n            \"DSI\",\n            \"DSKX\",\n            \"DSL\",\n            \"DSLV\",\n            \"DSM\",\n            \"DSPG\",\n            \"DSS\",\n            \"DST\",\n            \"DSU\",\n            \"DSUM\",\n            \"DSW\",\n            \"DSWL\",\n            \"DSX\",\n            \"DTD\",\n            \"DTE\",\n            \"DTF\",\n            \"DTH\",\n            \"DTK\",\n            \"DTLK\",\n            \"DTN\",\n            \"DTO\",\n            \"DTQ\",\n            \"DTSI\",\n            \"DTT\",\n            \"DTV\",\n            \"DTYL\",\n            \"DTYS\",\n            \"DTZ\",\n            \"DUA\",\n            \"DUC\",\n            \"DUG\",\n            \"DUK\",\n            \"DUKH\",\n            \"DUST\",\n            \"DV\",\n            \"DVA\",\n            \"DVAX\",\n            \"DVCR\",\n            \"DVD\",\n            \"DVHI\",\n            \"DVM\",\n            \"DVN\",\n            \"DVR\",\n            \"DVY\",\n            \"DVYA\",\n            \"DVYE\",\n            \"DVYL\",\n            \"DW\",\n            \"DWA\",\n            \"DWAS\",\n            \"DWCH\",\n            \"DWM\",\n            \"DWRE\",\n            \"DWSN\",\n            \"DWTI\",\n            \"DWX\",\n            \"DX\",\n            \"DXB\",\n            \"DXCM\",\n            \"DXD\",\n            \"DXJ\",\n            \"DXJS\",\n            \"DXLG\",\n            \"DXM\",\n            \"DXPE\",\n            \"DXPS\",\n            \"DXR\",\n            \"DXYN\",\n            \"DY\",\n            \"DYAX\",\n            \"DYN\",\n            \"DYNT\",\n            \"DYY\",\n            \"DZK\",\n            \"DZZ\",\n            \"E\",\n            \"EA\",\n            \"EAA\",\n            \"EAB\",\n            \"EAC\",\n            \"EAD\",\n            \"EAE\",\n            \"EAPS\",\n            \"EARN\",\n            \"EAT\",\n            \"EBAY\",\n            \"EBF\",\n            \"EBIX\",\n            \"EBMT\",\n            \"EBND\",\n            \"EBR.B\",\n            \"EBR\",\n            \"EBS\",\n            \"EBSB\",\n            \"EBTC\",\n            \"EC\",\n            \"ECA\",\n            \"ECF\",\n            \"ECH\",\n            \"ECHO\",\n            \"ECL\",\n            \"ECOL\",\n            \"ECOM\",\n            \"ECON\",\n            \"ECPG\",\n            \"ECT\",\n            \"ECTE\",\n            \"ECYT\",\n            \"ED\",\n            \"EDAP\",\n            \"EDC\",\n            \"EDD\",\n            \"EDE\",\n            \"EDF\",\n            \"EDG\",\n            \"EDGW\",\n            \"EDI\",\n            \"EDIV\",\n            \"EDMC\",\n            \"EDN\",\n            \"EDR\",\n            \"EDS\",\n            \"EDT\",\n            \"EDU\",\n            \"EDUC\",\n            \"EDV\",\n            \"EDZ\",\n            \"EE\",\n            \"EEA\",\n            \"EEB\",\n            \"EEFT\",\n            \"EEH\",\n            \"EEI\",\n            \"EELV\",\n            \"EEM\",\n            \"EEMA\",\n            \"EEMV\",\n            \"EEP\",\n            \"EEQ\",\n            \"EES\",\n            \"EET\",\n            \"EEV\",\n            \"EFA\",\n            \"EFAV\",\n            \"EFC\",\n            \"EFF\",\n            \"EFG\",\n            \"EFII\",\n            \"EFM\",\n            \"EFO\",\n            \"EFR\",\n            \"EFSC\",\n            \"EFT\",\n            \"EFU\",\n            \"EFUT\",\n            \"EFV\",\n            \"EFX\",\n            \"EFZ\",\n            \"EGAN\",\n            \"EGAS\",\n            \"EGBN\",\n            \"EGF\",\n            \"EGHT\",\n            \"EGI\",\n            \"EGL\",\n            \"EGLE\",\n            \"EGN\",\n            \"EGO\",\n            \"EGOV\",\n            \"EGP\",\n            \"EGPT\",\n            \"EGRW\",\n            \"EGT\",\n            \"EGY\",\n            \"EHI\",\n            \"EHTH\",\n            \"EIA\",\n            \"EIDO\",\n            \"EIG\",\n            \"EIHI\",\n            \"EIM\",\n            \"EIO\",\n            \"EIP\",\n            \"EIRL\",\n            \"EIS\",\n            \"EIV\",\n            \"EIX\",\n            \"EJ\",\n            \"EL\",\n            \"ELA\",\n            \"ELB\",\n            \"ELD\",\n            \"ELGX\",\n            \"ELJ\",\n            \"ELLI\",\n            \"ELLO\",\n            \"ELMD\",\n            \"ELN\",\n            \"ELNK\",\n            \"ELON\",\n            \"ELOS\",\n            \"ELP\",\n            \"ELRC\",\n            \"ELS\",\n            \"ELSE\",\n            \"ELU\",\n            \"ELX\",\n            \"ELY\",\n            \"EMAN\",\n            \"EMB\",\n            \"EMC\",\n            \"EMCB\",\n            \"EMCF\",\n            \"EMCG\",\n            \"EMCI\",\n            \"EMD\",\n            \"EMDR\",\n            \"EME\",\n            \"EMES\",\n            \"EMEY\",\n            \"EMF\",\n            \"EMFT\",\n            \"EMHD\",\n            \"EMI\",\n            \"EMIF\",\n            \"EMITF\",\n            \"EMJ\",\n            \"EMKR\",\n            \"EML\",\n            \"EMLC\",\n            \"EMLP\",\n            \"EMMS\",\n            \"EMMT\",\n            \"EMN\",\n            \"EMO\",\n            \"EMR\",\n            \"EMXX\",\n            \"EMZ\",\n            \"ENB\",\n            \"END\",\n            \"ENDP\",\n            \"ENG\",\n            \"ENGN\",\n            \"ENH\",\n            \"ENI\",\n            \"ENJ\",\n            \"ENL\",\n            \"ENMD\",\n            \"ENOC\",\n            \"ENPH\",\n            \"ENR\",\n            \"ENS\",\n            \"ENSG\",\n            \"ENT\",\n            \"ENTA\",\n            \"ENTG\",\n            \"ENTR\",\n            \"ENV\",\n            \"ENVI\",\n            \"ENX\",\n            \"ENY\",\n            \"ENZ\",\n            \"ENZL\",\n            \"ENZN\",\n            \"ENZY\",\n            \"EOC\",\n            \"EOD\",\n            \"EOG\",\n            \"EOI\",\n            \"EONC\",\n            \"EOPN\",\n            \"EOS\",\n            \"EOT\",\n            \"EOX\",\n            \"EPAM\",\n            \"EPAX\",\n            \"EPAY\",\n            \"EPB\",\n            \"EPD\",\n            \"EPHE\",\n            \"EPI\",\n            \"EPIQ\",\n            \"EPL\",\n            \"EPM\",\n            \"EPOL\",\n            \"EPP\",\n            \"EPR\",\n            \"EPS\",\n            \"EPU\",\n            \"EPV\",\n            \"EPZM\",\n            \"EQIX\",\n            \"EQL\",\n            \"EQM\",\n            \"EQR\",\n            \"EQT\",\n            \"EQU\",\n            \"EQY\",\n            \"ERA\",\n            \"ERB\",\n            \"ERC\",\n            \"ERF\",\n            \"ERH\",\n            \"ERIC\",\n            \"ERIE\",\n            \"ERII\",\n            \"ERJ\",\n            \"EROC\",\n            \"ERS\",\n            \"ERUS\",\n            \"ERX\",\n            \"ERY\",\n            \"ESBA\",\n            \"ESBF\",\n            \"ESBK\",\n            \"ESC\",\n            \"ESCA\",\n            \"ESD\",\n            \"ESE\",\n            \"ESEA\",\n            \"ESGR\",\n            \"ESI\",\n            \"ESIO\",\n            \"ESL\",\n            \"ESLT\",\n            \"ESMC\",\n            \"ESP\",\n            \"ESPR\",\n            \"ESR\",\n            \"ESRT\",\n            \"ESRX\",\n            \"ESS\",\n            \"ESSA\",\n            \"ESSX\",\n            \"ESTE\",\n            \"ESV\",\n            \"ESXB\",\n            \"ESYS\",\n            \"ETAK\",\n            \"ETB\",\n            \"ETE\",\n            \"ETF\",\n            \"ETFC\",\n            \"ETG\",\n            \"ETH\",\n            \"ETJ\",\n            \"ETM\",\n            \"ETN\",\n            \"ETO\",\n            \"ETP\",\n            \"ETR\",\n            \"ETRM\",\n            \"ETUB\",\n            \"ETV\",\n            \"ETW\",\n            \"ETX\",\n            \"ETY\",\n            \"EUFN\",\n            \"EUM\",\n            \"EUO\",\n            \"EUSA\",\n            \"EV\",\n            \"EVAC\",\n            \"EVAL\",\n            \"EVBN\",\n            \"EVBS\",\n            \"EVC\",\n            \"EVEP\",\n            \"EVER\",\n            \"EVF\",\n            \"EVG\",\n            \"EVHC\",\n            \"EVI\",\n            \"EVJ\",\n            \"EVK\",\n            \"EVM\",\n            \"EVN\",\n            \"EVO\",\n            \"EVOK\",\n            \"EVOL\",\n            \"EVP\",\n            \"EVR\",\n            \"EVRY\",\n            \"EVT\",\n            \"EVTC\",\n            \"EVV\",\n            \"EVY\",\n            \"EW\",\n            \"EWA\",\n            \"EWBC\",\n            \"EWC\",\n            \"EWD\",\n            \"EWEM\",\n            \"EWG\",\n            \"EWH\",\n            \"EWI\",\n            \"EWJ\",\n            \"EWK\",\n            \"EWL\",\n            \"EWM\",\n            \"EWN\",\n            \"EWO\",\n            \"EWP\",\n            \"EWQ\",\n            \"EWRI\",\n            \"EWRM\",\n            \"EWRS\",\n            \"EWS\",\n            \"EWSS\",\n            \"EWT\",\n            \"EWU\",\n            \"EWV\",\n            \"EWW\",\n            \"EWX\",\n            \"EWY\",\n            \"EWZ\",\n            \"EWZS\",\n            \"EXA\",\n            \"EXAC\",\n            \"EXAM\",\n            \"EXAR\",\n            \"EXAS\",\n            \"EXC\",\n            \"EXD\",\n            \"EXE\",\n            \"EXEL\",\n            \"EXFO\",\n            \"EXG\",\n            \"EXH\",\n            \"EXI\",\n            \"EXK\",\n            \"EXL\",\n            \"EXLP\",\n            \"EXLS\",\n            \"EXP\",\n            \"EXPD\",\n            \"EXPE\",\n            \"EXPO\",\n            \"EXPR\",\n            \"EXR\",\n            \"EXT\",\n            \"EXTR\",\n            \"EXXI\",\n            \"EZA\",\n            \"EZCH\",\n            \"EZJ\",\n            \"EZM\",\n            \"EZPW\",\n            \"EZU\",\n            \"F\",\n            \"FAB\",\n            \"FAC\",\n            \"FAD\",\n            \"FAF\",\n            \"FALC\",\n            \"FAM\",\n            \"FAN\",\n            \"FANG\",\n            \"FARM\",\n            \"FARO\",\n            \"FAS\",\n            \"FAST\",\n            \"FATE\",\n            \"FAUS\",\n            \"FAV\",\n            \"FAX\",\n            \"FAZ\",\n            \"FB\",\n            \"FBC\",\n            \"FBG\",\n            \"FBHS\",\n            \"FBIZ\",\n            \"FBMI\",\n            \"FBMS\",\n            \"FBNC\",\n            \"FBNK\",\n            \"FBP\",\n            \"FBR\",\n            \"FBRC\",\n            \"FBSS\",\n            \"FBT\",\n            \"FBZ\",\n            \"FC\",\n            \"FCAN\",\n            \"FCAP\",\n            \"FCBC\",\n            \"FCCO\",\n            \"FCCY\",\n            \"FCE.A\",\n            \"FCE.B\",\n            \"FCEL\",\n            \"FCF\",\n            \"FCFS\",\n            \"FCG\",\n            \"FCH\",\n            \"FCHI\",\n            \"FCLF\",\n            \"FCN\",\n            \"FCNCA\",\n            \"FCO\",\n            \"FCS\",\n            \"FCSC\",\n            \"FCT\",\n            \"FCTY\",\n            \"FCVA\",\n            \"FCX\",\n            \"FCY\",\n            \"FCZA\",\n            \"FDD\",\n            \"FDEF\",\n            \"FDI\",\n            \"FDL\",\n            \"FDM\",\n            \"FDML\",\n            \"FDN\",\n            \"FDO\",\n            \"FDP\",\n            \"FDS\",\n            \"FDT\",\n            \"FDTS\",\n            \"FDUS\",\n            \"FDX\",\n            \"FE\",\n            \"FEEU\",\n            \"FEI\",\n            \"FEIC\",\n            \"FEIM\",\n            \"FELE\",\n            \"FEM\",\n            \"FEMS\",\n            \"FEN\",\n            \"FENG\",\n            \"FEO\",\n            \"FEP\",\n            \"FES\",\n            \"FET\",\n            \"FEU\",\n            \"FEX\",\n            \"FEYE\",\n            \"FEZ\",\n            \"FF\",\n            \"FFA\",\n            \"FFBC\",\n            \"FFBCW\",\n            \"FFBH\",\n            \"FFC\",\n            \"FFCO\",\n            \"FFG\",\n            \"FFHL\",\n            \"FFIC\",\n            \"FFIN\",\n            \"FFIV\",\n            \"FFKT\",\n            \"FFKY\",\n            \"FFNW\",\n            \"FFR\",\n            \"FGB\",\n            \"FGD\",\n            \"FGM\",\n            \"FGP\",\n            \"FHCO\",\n            \"FHK\",\n            \"FHN\",\n            \"FHY\",\n            \"FI\",\n            \"FIBK\",\n            \"FICO\",\n            \"FIEU\",\n            \"FIF\",\n            \"FIG\",\n            \"FIGY\",\n            \"FII\",\n            \"FILL\",\n            \"FINL\",\n            \"FINU\",\n            \"FIO\",\n            \"FIRE\",\n            \"FIS\",\n            \"FISH\",\n            \"FISI\",\n            \"FISV\",\n            \"FITB\",\n            \"FIVE\",\n            \"FIW\",\n            \"FIX\",\n            \"FIZZ\",\n            \"FJP\",\n            \"FKO\",\n            \"FKU\",\n            \"FL\",\n            \"FLC\",\n            \"FLDM\",\n            \"FLEX\",\n            \"FLIC\",\n            \"FLIR\",\n            \"FLL\",\n            \"FLML\",\n            \"FLO\",\n            \"FLOT\",\n            \"FLOW\",\n            \"FLR\",\n            \"FLRN\",\n            \"FLS\",\n            \"FLT\",\n            \"FLTR\",\n            \"FLTX\",\n            \"FLWS\",\n            \"FLXS\",\n            \"FLY\",\n            \"FM\",\n            \"FMBI\",\n            \"FMC\",\n            \"FMD\",\n            \"FMER\",\n            \"FMF\",\n            \"FMI\",\n            \"FMK\",\n            \"FMN\",\n            \"FMNB\",\n            \"FMO\",\n            \"FMS\",\n            \"FMX\",\n            \"FMY\",\n            \"FN\",\n            \"FNB\",\n            \"FNDA\",\n            \"FNDB\",\n            \"FNDC\",\n            \"FNDE\",\n            \"FNDF\",\n            \"FNDX\",\n            \"FNF\",\n            \"FNFG\",\n            \"FNGN\",\n            \"FNHC\",\n            \"FNI\",\n            \"FNK\",\n            \"FNLC\",\n            \"FNP\",\n            \"FNSR\",\n            \"FNV\",\n            \"FNX\",\n            \"FNY\",\n            \"FOE\",\n            \"FOF\",\n            \"FOL\",\n            \"FOLD\",\n            \"FONR\",\n            \"FOR\",\n            \"FORD\",\n            \"FORM\",\n            \"FORR\",\n            \"FORTY\",\n            \"FORX\",\n            \"FOSL\",\n            \"FOX\",\n            \"FOXA\",\n            \"FOXF\",\n            \"FPA\",\n            \"FPE\",\n            \"FPF\",\n            \"FPO\",\n            \"FPP\",\n            \"FPRX\",\n            \"FPT\",\n            \"FPX\",\n            \"FR\",\n            \"FRA\",\n            \"FRAK\",\n            \"FRAN\",\n            \"FRBK\",\n            \"FRC\",\n            \"FRD\",\n            \"FRED\",\n            \"FREE\",\n            \"FRF\",\n            \"FRGI\",\n            \"FRI\",\n            \"FRM\",\n            \"FRME\",\n            \"FRN\",\n            \"FRNK\",\n            \"FRO\",\n            \"FRP\",\n            \"FRS\",\n            \"FRT\",\n            \"FRX\",\n            \"FSBK\",\n            \"FSBW\",\n            \"FSC\",\n            \"FSCE\",\n            \"FSCFL\",\n            \"FSD\",\n            \"FSE\",\n            \"FSFG\",\n            \"FSFR\",\n            \"FSG\",\n            \"FSGI\",\n            \"FSI\",\n            \"FSL\",\n            \"FSLR\",\n            \"FSM\",\n            \"FSP\",\n            \"FSRV\",\n            \"FSS\",\n            \"FST\",\n            \"FSTR\",\n            \"FSYS\",\n            \"FT\",\n            \"FTA\",\n            \"FTC\",\n            \"FTCS\",\n            \"FTEK\",\n            \"FTF\",\n            \"FTI\",\n            \"FTK\",\n            \"FTNT\",\n            \"FTR\",\n            \"FTSL\",\n            \"FTT\",\n            \"FTW\",\n            \"FTY\",\n            \"FU\",\n            \"FUBC\",\n            \"FUD\",\n            \"FUEL\",\n            \"FUL\",\n            \"FULL\",\n            \"FULT\",\n            \"FUN\",\n            \"FUNC\",\n            \"FUND\",\n            \"FUR\",\n            \"FURX\",\n            \"FVD\",\n            \"FVE\",\n            \"FVI\",\n            \"FVL\",\n            \"FWDB\",\n            \"FWDD\",\n            \"FWDI\",\n            \"FWLT\",\n            \"FWM\",\n            \"FWRD\",\n            \"FXA\",\n            \"FXB\",\n            \"FXC\",\n            \"FXCB\",\n            \"FXCM\",\n            \"FXD\",\n            \"FXE\",\n            \"FXEN\",\n            \"FXF\",\n            \"FXG\",\n            \"FXH\",\n            \"FXI\",\n            \"FXL\",\n            \"FXN\",\n            \"FXO\",\n            \"FXP\",\n            \"FXR\",\n            \"FXS\",\n            \"FXU\",\n            \"FXY\",\n            \"FXZ\",\n            \"FYC\",\n            \"FYT\",\n            \"FYX\",\n            \"G\",\n            \"GA\",\n            \"GAB\",\n            \"GABC\",\n            \"GAF\",\n            \"GAGA\",\n            \"GAI\",\n            \"GAIA\",\n            \"GAIN\",\n            \"GAINP\",\n            \"GAL\",\n            \"GALE\",\n            \"GALT\",\n            \"GALTU\",\n            \"GALTW\",\n            \"GAM\",\n            \"GAME\",\n            \"GARS\",\n            \"GAS\",\n            \"GASL\",\n            \"GASS\",\n            \"GASX\",\n            \"GAT\",\n            \"GAZ\",\n            \"GB\",\n            \"GBAB\",\n            \"GBB\",\n            \"GBCI\",\n            \"GBDC\",\n            \"GBF\",\n            \"GBL\",\n            \"GBLI\",\n            \"GBNK\",\n            \"GBR\",\n            \"GBX\",\n            \"GCA\",\n            \"GCAP\",\n            \"GCC\",\n            \"GCE\",\n            \"GCH\",\n            \"GCI\",\n            \"GCO\",\n            \"GCOM\",\n            \"GCV\",\n            \"GCVRZ\",\n            \"GD\",\n            \"GDAY\",\n            \"GDF\",\n            \"GDL\",\n            \"GDO\",\n            \"GDOT\",\n            \"GDP\",\n            \"GDV\",\n            \"GDX\",\n            \"GDXJ\",\n            \"GE\",\n            \"GEB\",\n            \"GEF.B\",\n            \"GEF\",\n            \"GEH\",\n            \"GEK\",\n            \"GEL\",\n            \"GEMS\",\n            \"GENC\",\n            \"GENE\",\n            \"GENT\",\n            \"GEO\",\n            \"GEOS\",\n            \"GEQ\",\n            \"GERN\",\n            \"GES\",\n            \"GEVA\",\n            \"GEVO\",\n            \"GEX\",\n            \"GF\",\n            \"GFA\",\n            \"GFED\",\n            \"GFF\",\n            \"GFI\",\n            \"GFIG\",\n            \"GFN\",\n            \"GFNCP\",\n            \"GFY\",\n            \"GG\",\n            \"GGAL\",\n            \"GGB\",\n            \"GGE\",\n            \"GGG\",\n            \"GGGG\",\n            \"GGM\",\n            \"GGN\",\n            \"GGOV\",\n            \"GGP\",\n            \"GGS\",\n            \"GGT\",\n            \"GHDX\",\n            \"GHI\",\n            \"GHL\",\n            \"GHM\",\n            \"GHY\",\n            \"GIB\",\n            \"GIFI\",\n            \"GIG\",\n            \"GIGA\",\n            \"GIGM\",\n            \"GII\",\n            \"GIII\",\n            \"GIL\",\n            \"GILD\",\n            \"GILT\",\n            \"GIM\",\n            \"GIMO\",\n            \"GIS\",\n            \"GIVE\",\n            \"GIVN\",\n            \"GJO\",\n            \"GJR\",\n            \"GJV\",\n            \"GK\",\n            \"GKM\",\n            \"GKNT\",\n            \"GLAD\",\n            \"GLADP\",\n            \"GLBS\",\n            \"GLBZ\",\n            \"GLCB\",\n            \"GLCH\",\n            \"GLD\",\n            \"GLDC\",\n            \"GLDD\",\n            \"GLDI\",\n            \"GLDX\",\n            \"GLF\",\n            \"GLL\",\n            \"GLNG\",\n            \"GLO\",\n            \"GLOG\",\n            \"GLOW\",\n            \"GLP\",\n            \"GLPW\",\n            \"GLQ\",\n            \"GLRE\",\n            \"GLT\",\n            \"GLTR\",\n            \"GLU\",\n            \"GLUU\",\n            \"GLV\",\n            \"GLW\",\n            \"GM\",\n            \"GMA\",\n            \"GMAN\",\n            \"GMCR\",\n            \"GME\",\n            \"GMED\",\n            \"GMF\",\n            \"GMK\",\n            \"GML\",\n            \"GMLP\",\n            \"GMM\",\n            \"GMO\",\n            \"GMT\",\n            \"GNAT\",\n            \"GNC\",\n            \"GNCMA\",\n            \"GNE\",\n            \"GNI\",\n            \"GNK\",\n            \"GNMK\",\n            \"GNR\",\n            \"GNRC\",\n            \"GNT\",\n            \"GNTX\",\n            \"GNVC\",\n            \"GNW\",\n            \"GOF\",\n            \"GOGO\",\n            \"GOL\",\n            \"GOLD\",\n            \"GOM\",\n            \"GOOD\",\n            \"GOODN\",\n            \"GOODO\",\n            \"GOODP\",\n            \"GOOG\",\n            \"GORO\",\n            \"GOV\",\n            \"GOVT\",\n            \"GPC\",\n            \"GPI\",\n            \"GPIC\",\n            \"GPK\",\n            \"GPL\",\n            \"GPM\",\n            \"GPN\",\n            \"GPOR\",\n            \"GPRC\",\n            \"GPRE\",\n            \"GPS\",\n            \"GPT\",\n            \"GPX\",\n            \"GRA\",\n            \"GRAM\",\n            \"GRC\",\n            \"GREK\",\n            \"GRES\",\n            \"GRF\",\n            \"GRFS\",\n            \"GRH\",\n            \"GRI\",\n            \"GRIF\",\n            \"GRMN\",\n            \"GRN\",\n            \"GRO\",\n            \"GROW\",\n            \"GRP.U\",\n            \"GRPN\",\n            \"GRR\",\n            \"GRT\",\n            \"GRVY\",\n            \"GRX\",\n            \"GS\",\n            \"GSB\",\n            \"GSBC\",\n            \"GSC\",\n            \"GSE\",\n            \"GSF\",\n            \"GSG\",\n            \"GSH\",\n            \"GSI\",\n            \"GSIG\",\n            \"GSIT\",\n            \"GSJ\",\n            \"GSJK\",\n            \"GSK\",\n            \"GSL\",\n            \"GSM\",\n            \"GSOL\",\n            \"GSP\",\n            \"GSS\",\n            \"GST\",\n            \"GSV\",\n            \"GSVC\",\n            \"GSY\",\n            \"GT\",\n            \"GTAA\",\n            \"GTAT\",\n            \"GTE\",\n            \"GTI\",\n            \"GTIM\",\n            \"GTIP\",\n            \"GTIV\",\n            \"GTLS\",\n            \"GTN.A\",\n            \"GTN\",\n            \"GTPPP\",\n            \"GTS\",\n            \"GTT\",\n            \"GTU\",\n            \"GTWN\",\n            \"GTXI\",\n            \"GTY\",\n            \"GUA\",\n            \"GUID\",\n            \"GULF\",\n            \"GUNR\",\n            \"GUR\",\n            \"GURE\",\n            \"GURU\",\n            \"GUT\",\n            \"GV\",\n            \"GVA\",\n            \"GVI\",\n            \"GVP\",\n            \"GWAY\",\n            \"GWL\",\n            \"GWPH\",\n            \"GWR\",\n            \"GWRE\",\n            \"GWW\",\n            \"GWX\",\n            \"GXC\",\n            \"GXF\",\n            \"GXG\",\n            \"GXP\",\n            \"GY\",\n            \"GYB\",\n            \"GYLD\",\n            \"GYRO\",\n            \"GZT\",\n            \"H\",\n            \"HA\",\n            \"HAE\",\n            \"HAFC\",\n            \"HAIN\",\n            \"HAL\",\n            \"HALL\",\n            \"HALO\",\n            \"HAO\",\n            \"HAP\",\n            \"HAR\",\n            \"HAS\",\n            \"HASI\",\n            \"HAST\",\n            \"HAUP\",\n            \"HAV\",\n            \"HAWK\",\n            \"HAYN\",\n            \"HBAN\",\n            \"HBANP\",\n            \"HBC\",\n            \"HBCP\",\n            \"HBHC\",\n            \"HBI\",\n            \"HBIO\",\n            \"HBM\",\n            \"HBMD\",\n            \"HBNC\",\n            \"HBOS\",\n            \"HCA\",\n            \"HCAP\",\n            \"HCBK\",\n            \"HCC\",\n            \"HCCI\",\n            \"HCI\",\n            \"HCJ\",\n            \"HCKT\",\n            \"HCLP\",\n            \"HCN\",\n            \"HCOM\",\n            \"HCP\",\n            \"HCS\",\n            \"HCSG\",\n            \"HD\",\n            \"HDB\",\n            \"HDG\",\n            \"HDGE\",\n            \"HDNG\",\n            \"HDS\",\n            \"HDSN\",\n            \"HDV\",\n            \"HDY\",\n            \"HE\",\n            \"HEB\",\n            \"HECO\",\n            \"HEDJ\",\n            \"HEES\",\n            \"HEI.A\",\n            \"HEI\",\n            \"HELE\",\n            \"HEOP\",\n            \"HEP\",\n            \"HEQ\",\n            \"HERO\",\n            \"HES\",\n            \"HF\",\n            \"HFBC\",\n            \"HFBL\",\n            \"HFC\",\n            \"HFFC\",\n            \"HFWA\",\n            \"HGG\",\n            \"HGH\",\n            \"HGI\",\n            \"HGR\",\n            \"HGSH\",\n            \"HGT\",\n            \"HH\",\n            \"HHC\",\n            \"HHS\",\n            \"HHY\",\n            \"HI\",\n            \"HIBB\",\n            \"HIFS\",\n            \"HIG\",\n            \"HIH\",\n            \"HIHO\",\n            \"HII\",\n            \"HIIQ\",\n            \"HIL\",\n            \"HILL\",\n            \"HILO\",\n            \"HIMX\",\n            \"HIO\",\n            \"HIS\",\n            \"HITK\",\n            \"HITT\",\n            \"HIW\",\n            \"HIX\",\n            \"HJJ\",\n            \"HJN\",\n            \"HJR\",\n            \"HJV\",\n            \"HK\",\n            \"HKTV\",\n            \"HL\",\n            \"HLF\",\n            \"HLIT\",\n            \"HLS\",\n            \"HLSS\",\n            \"HLX\",\n            \"HMA\",\n            \"HMC\",\n            \"HME\",\n            \"HMG\",\n            \"HMH\",\n            \"HMIN\",\n            \"HMN\",\n            \"HMNF\",\n            \"HMNY\",\n            \"HMPR\",\n            \"HMST\",\n            \"HMSY\",\n            \"HMTV\",\n            \"HMY\",\n            \"HNH\",\n            \"HNI\",\n            \"HNP\",\n            \"HNR\",\n            \"HNRG\",\n            \"HNSN\",\n            \"HNT\",\n            \"HNW\",\n            \"HOFT\",\n            \"HOG\",\n            \"HOLI\",\n            \"HOLL\",\n            \"HOLX\",\n            \"HOMB\",\n            \"HOME\",\n            \"HON\",\n            \"HOS\",\n            \"HOT\",\n            \"HOTR\",\n            \"HOV\",\n            \"HOVNP\",\n            \"HP\",\n            \"HPCCP\",\n            \"HPF\",\n            \"HPI\",\n            \"HPJ\",\n            \"HPOL\",\n            \"HPP\",\n            \"HPQ\",\n            \"HPS\",\n            \"HPT\",\n            \"HPTX\",\n            \"HPY\",\n            \"HQH\",\n            \"HQL\",\n            \"HR\",\n            \"HRB\",\n            \"HRC\",\n            \"HRG\",\n            \"HRL\",\n            \"HRS\",\n            \"HRT\",\n            \"HRZN\",\n            \"HSA\",\n            \"HSC\",\n            \"HSH\",\n            \"HSIC\",\n            \"HSII\",\n            \"HSKA\",\n            \"HSNI\",\n            \"HSOL\",\n            \"HSON\",\n            \"HSP\",\n            \"HSPX\",\n            \"HST\",\n            \"HSTM\",\n            \"HSY\",\n            \"HT\",\n            \"HTA\",\n            \"HTBI\",\n            \"HTBK\",\n            \"HTBX\",\n            \"HTCH\",\n            \"HTCO\",\n            \"HTD\",\n            \"HTF\",\n            \"HTGC\",\n            \"HTGY\",\n            \"HTGZ\",\n            \"HTH\",\n            \"HTHT\",\n            \"HTLD\",\n            \"HTLF\",\n            \"HTM\",\n            \"HTR\",\n            \"HTS\",\n            \"HTSI\",\n            \"HTWR\",\n            \"HTY\",\n            \"HTZ\",\n            \"HUB.A\",\n            \"HUB.B\",\n            \"HUBG\",\n            \"HUM\",\n            \"HUN\",\n            \"HURC\",\n            \"HURN\",\n            \"HUSA\",\n            \"HUSE\",\n            \"HVB\",\n            \"HVPW\",\n            \"HVT.A\",\n            \"HVT\",\n            \"HW\",\n            \"HWAY\",\n            \"HWBK\",\n            \"HWCC\",\n            \"HWKN\",\n            \"HXL\",\n            \"HXM\",\n            \"HY\",\n            \"HYB\",\n            \"HYD\",\n            \"HYEM\",\n            \"HYF\",\n            \"HYG\",\n            \"HYGS\",\n            \"HYI\",\n            \"HYL\",\n            \"HYLD\",\n            \"HYLS\",\n            \"HYMB\",\n            \"HYS\",\n            \"HYT\",\n            \"HYV\",\n            \"HZNP\",\n            \"HZO\",\n            \"I\",\n            \"IACI\",\n            \"IAE\",\n            \"IAF\",\n            \"IAG\",\n            \"IAI\",\n            \"IAK\",\n            \"IART\",\n            \"IAT\",\n            \"IAU\",\n            \"IBA\",\n            \"IBB\",\n            \"IBCA\",\n            \"IBCB\",\n            \"IBCD\",\n            \"IBCP\",\n            \"IBCPO\",\n            \"IBDA\",\n            \"IBDB\",\n            \"IBDC\",\n            \"IBIO\",\n            \"IBKC\",\n            \"IBKR\",\n            \"IBM\",\n            \"IBN\",\n            \"IBND\",\n            \"IBOC\",\n            \"IBTX\",\n            \"ICA\",\n            \"ICAD\",\n            \"ICB\",\n            \"ICCC\",\n            \"ICE\",\n            \"ICEL\",\n            \"ICF\",\n            \"ICFI\",\n            \"ICGE\",\n            \"ICH\",\n            \"ICLN\",\n            \"ICLR\",\n            \"ICN\",\n            \"ICOL\",\n            \"ICON\",\n            \"ICPT\",\n            \"ICUI\",\n            \"IDA\",\n            \"IDCC\",\n            \"IDE\",\n            \"IDG\",\n            \"IDHB\",\n            \"IDHQ\",\n            \"IDI\",\n            \"IDIX\",\n            \"IDLV\",\n            \"IDN\",\n            \"IDOG\",\n            \"IDRA\",\n            \"IDSA\",\n            \"IDSY\",\n            \"IDT\",\n            \"IDTI\",\n            \"IDU\",\n            \"IDV\",\n            \"IDX\",\n            \"IDXJ\",\n            \"IDXX\",\n            \"IEC\",\n            \"IEF\",\n            \"IEFA\",\n            \"IEH\",\n            \"IEI\",\n            \"IEMG\",\n            \"IEO\",\n            \"IEP\",\n            \"IESC\",\n            \"IESM\",\n            \"IEV\",\n            \"IEX\",\n            \"IEZ\",\n            \"IF\",\n            \"IFAS\",\n            \"IFEU\",\n            \"IFF\",\n            \"IFGL\",\n            \"IFMI\",\n            \"IFN\",\n            \"IFNA\",\n            \"IFON\",\n            \"IFSM\",\n            \"IFT\",\n            \"IG\",\n            \"IGA\",\n            \"IGC\",\n            \"IGD\",\n            \"IGE\",\n            \"IGF\",\n            \"IGI\",\n            \"IGK\",\n            \"IGLD\",\n            \"IGM\",\n            \"IGN\",\n            \"IGOI\",\n            \"IGOV\",\n            \"IGR\",\n            \"IGS\",\n            \"IGT\",\n            \"IGTE\",\n            \"IGV\",\n            \"IHC\",\n            \"IHD\",\n            \"IHE\",\n            \"IHF\",\n            \"IHG\",\n            \"IHI\",\n            \"IHS\",\n            \"IHY\",\n            \"IID\",\n            \"IIF\",\n            \"III\",\n            \"IIIN\",\n            \"IIJI\",\n            \"IILG\",\n            \"IIM\",\n            \"IIN\",\n            \"IIVI\",\n            \"IJH\",\n            \"IJJ\",\n            \"IJK\",\n            \"IJR\",\n            \"IJS\",\n            \"IJT\",\n            \"IKAN\",\n            \"IKGH\",\n            \"IKNX\",\n            \"IL\",\n            \"ILB\",\n            \"ILF\",\n            \"ILMN\",\n            \"ILTB\",\n            \"IM\",\n            \"IMAX\",\n            \"IMCB\",\n            \"IMF\",\n            \"IMGN\",\n            \"IMH\",\n            \"IMI\",\n            \"IMKTA\",\n            \"IMLP\",\n            \"IMMR\",\n            \"IMMU\",\n            \"IMMY\",\n            \"IMN\",\n            \"IMO\",\n            \"IMOS\",\n            \"IMPV\",\n            \"IMRS\",\n            \"IMUC\",\n            \"INAP\",\n            \"INB\",\n            \"INBK\",\n            \"INCO\",\n            \"INCY\",\n            \"IND\",\n            \"INDB\",\n            \"INDL\",\n            \"INDY\",\n            \"INF\",\n            \"INFA\",\n            \"INFI\",\n            \"INFN\",\n            \"INFU\",\n            \"INFY\",\n            \"ING\",\n            \"INGR\",\n            \"ININ\",\n            \"INKM\",\n            \"INN\",\n            \"INO\",\n            \"INOC\",\n            \"INOD\",\n            \"INP\",\n            \"INPH\",\n            \"INS\",\n            \"INSM\",\n            \"INSY\",\n            \"INT\",\n            \"INTC\",\n            \"INTG\",\n            \"INTL\",\n            \"INTLL\",\n            \"INTT\",\n            \"INTU\",\n            \"INTX\",\n            \"INUV\",\n            \"INVE\",\n            \"INVN\",\n            \"INWK\",\n            \"INXN\",\n            \"INXX\",\n            \"INY\",\n            \"INZ\",\n            \"IO\",\n            \"IOC\",\n            \"IOO\",\n            \"IOSP\",\n            \"IOT\",\n            \"IP\",\n            \"IPAR\",\n            \"IPAS\",\n            \"IPB\",\n            \"IPCC\",\n            \"IPCI\",\n            \"IPCM\",\n            \"IPD\",\n            \"IPDN\",\n            \"IPE\",\n            \"IPF\",\n            \"IPFF\",\n            \"IPG\",\n            \"IPGP\",\n            \"IPHI\",\n            \"IPHS\",\n            \"IPI\",\n            \"IPK\",\n            \"IPN\",\n            \"IPS\",\n            \"IPU\",\n            \"IPXL\",\n            \"IQI\",\n            \"IQNT\",\n            \"IR\",\n            \"IRBT\",\n            \"IRC\",\n            \"IRDM\",\n            \"IRE\",\n            \"IRET\",\n            \"IRF\",\n            \"IRG\",\n            \"IRIX\",\n            \"IRL\",\n            \"IRM\",\n            \"IRR\",\n            \"IRS\",\n            \"IRT\",\n            \"IRV\",\n            \"IRWD\",\n            \"IRY\",\n            \"ISBC\",\n            \"ISCA\",\n            \"ISD\",\n            \"ISF\",\n            \"ISG\",\n            \"ISH\",\n            \"ISHG\",\n            \"ISIG\",\n            \"ISIL\",\n            \"ISIS\",\n            \"ISL\",\n            \"ISLE\",\n            \"ISM\",\n            \"ISNS\",\n            \"ISP\",\n            \"ISR\",\n            \"ISRA\",\n            \"ISRG\",\n            \"ISRL\",\n            \"ISS\",\n            \"ISSC\",\n            \"ISSI\",\n            \"IST\",\n            \"ISTB\",\n            \"IT\",\n            \"ITA\",\n            \"ITB\",\n            \"ITC\",\n            \"ITE\",\n            \"ITG\",\n            \"ITI\",\n            \"ITIC\",\n            \"ITIP\",\n            \"ITLY\",\n            \"ITM\",\n            \"ITMN\",\n            \"ITOT\",\n            \"ITR\",\n            \"ITRI\",\n            \"ITRN\",\n            \"ITT\",\n            \"ITUB\",\n            \"ITW\",\n            \"IVAC\",\n            \"IVAN\",\n            \"IVC\",\n            \"IVE\",\n            \"IVH\",\n            \"IVOG\",\n            \"IVOO\",\n            \"IVOV\",\n            \"IVR\",\n            \"IVV\",\n            \"IVW\",\n            \"IVZ\",\n            \"IWB\",\n            \"IWC\",\n            \"IWD\",\n            \"IWF\",\n            \"IWL\",\n            \"IWM\",\n            \"IWN\",\n            \"IWO\",\n            \"IWP\",\n            \"IWR\",\n            \"IWS\",\n            \"IWV\",\n            \"IWW\",\n            \"IWX\",\n            \"IWY\",\n            \"IWZ\",\n            \"IX\",\n            \"IXC\",\n            \"IXG\",\n            \"IXJ\",\n            \"IXN\",\n            \"IXP\",\n            \"IXUS\",\n            \"IXYS\",\n            \"IYC\",\n            \"IYE\",\n            \"IYF\",\n            \"IYG\",\n            \"IYH\",\n            \"IYJ\",\n            \"IYK\",\n            \"IYM\",\n            \"IYR\",\n            \"IYT\",\n            \"IYW\",\n            \"IYY\",\n            \"IYZ\",\n            \"JACK\",\n            \"JACQW\",\n            \"JAH\",\n            \"JAKK\",\n            \"JASO\",\n            \"JAXB\",\n            \"JAZZ\",\n            \"JBHT\",\n            \"JBI\",\n            \"JBL\",\n            \"JBLU\",\n            \"JBN\",\n            \"JBR\",\n            \"JBSS\",\n            \"JBT\",\n            \"JCE\",\n            \"JCI\",\n            \"JCOM\",\n            \"JCP\",\n            \"JCS\",\n            \"JCTCF\",\n            \"JDD\",\n            \"JDST\",\n            \"JDSU\",\n            \"JE\",\n            \"JEC\",\n            \"JEQ\",\n            \"JFBI\",\n            \"JFC\",\n            \"JFR\",\n            \"JGBD\",\n            \"JGBS\",\n            \"JGG\",\n            \"JGT\",\n            \"JGV\",\n            \"JHI\",\n            \"JHP\",\n            \"JHS\",\n            \"JHX\",\n            \"JIVE\",\n            \"JJC\",\n            \"JJG\",\n            \"JJS\",\n            \"JJSF\",\n            \"JJU\",\n            \"JKD\",\n            \"JKE\",\n            \"JKF\",\n            \"JKG\",\n            \"JKH\",\n            \"JKHY\",\n            \"JKI\",\n            \"JKJ\",\n            \"JKK\",\n            \"JKL\",\n            \"JKS\",\n            \"JLA\",\n            \"JLL\",\n            \"JLS\",\n            \"JMBA\",\n            \"JMF\",\n            \"JMI\",\n            \"JMP\",\n            \"JMPB\",\n            \"JMT\",\n            \"JNJ\",\n            \"JNK\",\n            \"JNPR\",\n            \"JNS\",\n            \"JNUG\",\n            \"JNY\",\n            \"JO\",\n            \"JOB\",\n            \"JOBS\",\n            \"JOE\",\n            \"JOEZ\",\n            \"JOF\",\n            \"JONE\",\n            \"JOSB\",\n            \"JOUT\",\n            \"JOY\",\n            \"JPC\",\n            \"JPG\",\n            \"JPI\",\n            \"JPM\",\n            \"JPNL\",\n            \"JPNS\",\n            \"JPS\",\n            \"JPW\",\n            \"JPZ\",\n            \"JQC\",\n            \"JRCC\",\n            \"JRI\",\n            \"JRJC\",\n            \"JRN\",\n            \"JRO\",\n            \"JRS\",\n            \"JSC\",\n            \"JSD\",\n            \"JSM\",\n            \"JSN\",\n            \"JST\",\n            \"JTA\",\n            \"JTD\",\n            \"JTP\",\n            \"JTPY\",\n            \"JUNR\",\n            \"JVA\",\n            \"JW.A\",\n            \"JW.B\",\n            \"JWN\",\n            \"JXI\",\n            \"JXSB\",\n            \"JZJ\",\n            \"JZK\",\n            \"JZT\",\n            \"K\",\n            \"KAI\",\n            \"KALU\",\n            \"KAMN\",\n            \"KAP\",\n            \"KAR\",\n            \"KB\",\n            \"KBALB\",\n            \"KBE\",\n            \"KBH\",\n            \"KBIO\",\n            \"KBR\",\n            \"KBWB\",\n            \"KBWC\",\n            \"KBWD\",\n            \"KBWI\",\n            \"KBWP\",\n            \"KBWR\",\n            \"KBWX\",\n            \"KBWY\",\n            \"KCAP\",\n            \"KCC\",\n            \"KCE\",\n            \"KCG\",\n            \"KCLI\",\n            \"KDN\",\n            \"KED\",\n            \"KEF\",\n            \"KEG\",\n            \"KELYA\",\n            \"KEM\",\n            \"KEP\",\n            \"KEQU\",\n            \"KERX\",\n            \"KEX\",\n            \"KEY\",\n            \"KEYW\",\n            \"KF\",\n            \"KFFB\",\n            \"KFH\",\n            \"KFI\",\n            \"KFN\",\n            \"KFRC\",\n            \"KFS\",\n            \"KFY\",\n            \"KFYP\",\n            \"KGC\",\n            \"KGJI\",\n            \"KHI\",\n            \"KID\",\n            \"KIE\",\n            \"KIM\",\n            \"KINS\",\n            \"KIO\",\n            \"KIOR\",\n            \"KIPO\",\n            \"KIPS\",\n            \"KIRK\",\n            \"KKD\",\n            \"KKR\",\n            \"KLAC\",\n            \"KLD\",\n            \"KLIC\",\n            \"KMB\",\n            \"KMDA\",\n            \"KME\",\n            \"KMF\",\n            \"KMG\",\n            \"KMI\",\n            \"KMM\",\n            \"KMP\",\n            \"KMPR\",\n            \"KMR\",\n            \"KMT\",\n            \"KMX\",\n            \"KND\",\n            \"KNDI\",\n            \"KNL\",\n            \"KNM\",\n            \"KNOP\",\n            \"KNX\",\n            \"KO\",\n            \"KOF\",\n            \"KOG\",\n            \"KOL\",\n            \"KOLD\",\n            \"KONA\",\n            \"KONE\",\n            \"KONG\",\n            \"KOOL\",\n            \"KOP\",\n            \"KOPN\",\n            \"KORS\",\n            \"KORU\",\n            \"KOS\",\n            \"KR\",\n            \"KRA\",\n            \"KRC\",\n            \"KRE\",\n            \"KRFT\",\n            \"KRG\",\n            \"KRNY\",\n            \"KRO\",\n            \"KROO\",\n            \"KRU\",\n            \"KS\",\n            \"KSM\",\n            \"KSS\",\n            \"KST\",\n            \"KSU\",\n            \"KT\",\n            \"KTCC\",\n            \"KTEC\",\n            \"KTF\",\n            \"KTH\",\n            \"KTN\",\n            \"KTOS\",\n            \"KTP\",\n            \"KUTV\",\n            \"KVHI\",\n            \"KW\",\n            \"KWEB\",\n            \"KWK\",\n            \"KWN\",\n            \"KWR\",\n            \"KWT\",\n            \"KXI\",\n            \"KYE\",\n            \"KYN\",\n            \"KYO\",\n            \"KYTH\",\n            \"L\",\n            \"LABC\",\n            \"LABL\",\n            \"LACO\",\n            \"LAD\",\n            \"LAG\",\n            \"LAKE\",\n            \"LAMR\",\n            \"LANC\",\n            \"LAND\",\n            \"LAQ\",\n            \"LARK\",\n            \"LAS\",\n            \"LAWS\",\n            \"LAYN\",\n            \"LAZ\",\n            \"LBAI\",\n            \"LBF\",\n            \"LBIX\",\n            \"LBJ\",\n            \"LBND\",\n            \"LBTYA\",\n            \"LBTYK\",\n            \"LBY\",\n            \"LCAV\",\n            \"LCC\",\n            \"LCI\",\n            \"LCM\",\n            \"LCNB\",\n            \"LCUT\",\n            \"LDF\",\n            \"LDK\",\n            \"LDL\",\n            \"LDOS\",\n            \"LDP\",\n            \"LDR\",\n            \"LEA\",\n            \"LEAP\",\n            \"LECO\",\n            \"LEDS\",\n            \"LEE\",\n            \"LEG\",\n            \"LEI\",\n            \"LEMB\",\n            \"LEN.B\",\n            \"LEN\",\n            \"LEO\",\n            \"LF\",\n            \"LFC\",\n            \"LFL\",\n            \"LFUS\",\n            \"LFVN\",\n            \"LG\",\n            \"LGCY\",\n            \"LGF\",\n            \"LGI\",\n            \"LGL\",\n            \"LGLV\",\n            \"LGND\",\n            \"LGP\",\n            \"LH\",\n            \"LHCG\",\n            \"LHO\",\n            \"LIFE\",\n            \"LII\",\n            \"LIME\",\n            \"LIN\",\n            \"LINC\",\n            \"LINE\",\n            \"LINTA\",\n            \"LION\",\n            \"LIOX\",\n            \"LIQD\",\n            \"LIT\",\n            \"LITB\",\n            \"LIVE\",\n            \"LIWA\",\n            \"LKFN\",\n            \"LKQ\",\n            \"LL\",\n            \"LLEN\",\n            \"LLL\",\n            \"LLNW\",\n            \"LLTC\",\n            \"LLY\",\n            \"LM\",\n            \"LMAT\",\n            \"LMCA\",\n            \"LMIA\",\n            \"LMNR\",\n            \"LMNX\",\n            \"LMOS\",\n            \"LMT\",\n            \"LNBB\",\n            \"LNC\",\n            \"LNCE\",\n            \"LNCO\",\n            \"LND\",\n            \"LNDC\",\n            \"LNG\",\n            \"LNKD\",\n            \"LNN\",\n            \"LNT\",\n            \"LO\",\n            \"LOAN\",\n            \"LOCK\",\n            \"LOCM\",\n            \"LODE\",\n            \"LOGI\",\n            \"LOGM\",\n            \"LOJN\",\n            \"LON\",\n            \"LONG\",\n            \"LOPE\",\n            \"LOR\",\n            \"LORL\",\n            \"LOV\",\n            \"LOW\",\n            \"LPDX\",\n            \"LPHI\",\n            \"LPI\",\n            \"LPL\",\n            \"LPLA\",\n            \"LPLT\",\n            \"LPNT\",\n            \"LPS\",\n            \"LPSB\",\n            \"LPSN\",\n            \"LPTH\",\n            \"LPTN\",\n            \"LPX\",\n            \"LQD\",\n            \"LQDT\",\n            \"LRAD\",\n            \"LRCX\",\n            \"LRE\",\n            \"LRN\",\n            \"LRY\",\n            \"LSBI\",\n            \"LSBK\",\n            \"LSC\",\n            \"LSCC\",\n            \"LSE\",\n            \"LSG\",\n            \"LSI\",\n            \"LSTR\",\n            \"LTBR\",\n            \"LTC\",\n            \"LTD\",\n            \"LTL\",\n            \"LTM\",\n            \"LTON\",\n            \"LTPZ\",\n            \"LTRE\",\n            \"LTRX\",\n            \"LTS\",\n            \"LTXC\",\n            \"LUB\",\n            \"LUK\",\n            \"LULU\",\n            \"LUNA\",\n            \"LUV\",\n            \"LUX\",\n            \"LVL\",\n            \"LVLT\",\n            \"LVNTA\",\n            \"LVNTB\",\n            \"LVS\",\n            \"LWAY\",\n            \"LWC\",\n            \"LXFR\",\n            \"LXFT\",\n            \"LXK\",\n            \"LXP\",\n            \"LXRX\",\n            \"LXU\",\n            \"LYB\",\n            \"LYG\",\n            \"LYTS\",\n            \"LYV\",\n            \"LZB\",\n            \"M\",\n            \"MA\",\n            \"MAA\",\n            \"MAB\",\n            \"MAC\",\n            \"MACK\",\n            \"MAG\",\n            \"MAGS\",\n            \"MAIN\",\n            \"MAKO\",\n            \"MAN\",\n            \"MANH\",\n            \"MANT\",\n            \"MANU\",\n            \"MAR\",\n            \"MARK\",\n            \"MARPS\",\n            \"MAS\",\n            \"MASC\",\n            \"MASI\",\n            \"MAT\",\n            \"MATH\",\n            \"MATR\",\n            \"MATW\",\n            \"MATX\",\n            \"MAV\",\n            \"MBB\",\n            \"MBFI\",\n            \"MBG\",\n            \"MBI\",\n            \"MBII\",\n            \"MBIS\",\n            \"MBLX\",\n            \"MBRG\",\n            \"MBT\",\n            \"MBTF\",\n            \"MBVT\",\n            \"MBWM\",\n            \"MCA\",\n            \"MCBC\",\n            \"MCBI\",\n            \"MCBK\",\n            \"MCC\",\n            \"MCD\",\n            \"MCEP\",\n            \"MCF\",\n            \"MCGC\",\n            \"MCHI\",\n            \"MCHP\",\n            \"MCHX\",\n            \"MCI\",\n            \"MCK\",\n            \"MCN\",\n            \"MCO\",\n            \"MCOX\",\n            \"MCP\",\n            \"MCR\",\n            \"MCRI\",\n            \"MCRL\",\n            \"MCRO\",\n            \"MCRS\",\n            \"MCS\",\n            \"MCV\",\n            \"MCY\",\n            \"MCZ\",\n            \"MD\",\n            \"MDAS\",\n            \"MDC\",\n            \"MDCA\",\n            \"MDCI\",\n            \"MDCO\",\n            \"MDD\",\n            \"MDGN\",\n            \"MDIV\",\n            \"MDLZ\",\n            \"MDM\",\n            \"MDP\",\n            \"MDR\",\n            \"MDRX\",\n            \"MDSO\",\n            \"MDT\",\n            \"MDU\",\n            \"MDVN\",\n            \"MDW\",\n            \"MDXG\",\n            \"MDY\",\n            \"MDYG\",\n            \"MDYV\",\n            \"MEA\",\n            \"MEAS\",\n            \"MED\",\n            \"MEET\",\n            \"MEG\",\n            \"MEI\",\n            \"MEIL\",\n            \"MEILW\",\n            \"MEIP\",\n            \"MELA\",\n            \"MELI\",\n            \"MEMP\",\n            \"MEN\",\n            \"MENT\",\n            \"MEOH\",\n            \"MERC\",\n            \"MERU\",\n            \"MES\",\n            \"MET\",\n            \"METR\",\n            \"MFA\",\n            \"MFC\",\n            \"MFD\",\n            \"MFG\",\n            \"MFI\",\n            \"MFL\",\n            \"MFLR\",\n            \"MFLX\",\n            \"MFM\",\n            \"MFNC\",\n            \"MFO\",\n            \"MFRI\",\n            \"MFRM\",\n            \"MFSF\",\n            \"MFT\",\n            \"MFV\",\n            \"MG\",\n            \"MGA\",\n            \"MGAM\",\n            \"MGC\",\n            \"MGCD\",\n            \"MGEE\",\n            \"MGF\",\n            \"MGH\",\n            \"MGI\",\n            \"MGIC\",\n            \"MGJ\",\n            \"MGK\",\n            \"MGLN\",\n            \"MGM\",\n            \"MGN\",\n            \"MGPI\",\n            \"MGR\",\n            \"MGRC\",\n            \"MGT\",\n            \"MGU\",\n            \"MGV\",\n            \"MGYR\",\n            \"MHD\",\n            \"MHE\",\n            \"MHF\",\n            \"MHFI\",\n            \"MHGC\",\n            \"MHH\",\n            \"MHI\",\n            \"MHK\",\n            \"MHLD\",\n            \"MHLDO\",\n            \"MHN\",\n            \"MHNA\",\n            \"MHNB\",\n            \"MHO\",\n            \"MHR\",\n            \"MHW\",\n            \"MHY\",\n            \"MIC\",\n            \"MICT\",\n            \"MIDD\",\n            \"MIDU\",\n            \"MIDZ\",\n            \"MIE\",\n            \"MIG\",\n            \"MIL\",\n            \"MILL\",\n            \"MIN\",\n            \"MINC\",\n            \"MIND\",\n            \"MINI\",\n            \"MINT\",\n            \"MITK\",\n            \"MITL\",\n            \"MITT\",\n            \"MIW\",\n            \"MIXT\",\n            \"MIY\",\n            \"MJC\",\n            \"MJI\",\n            \"MJN\",\n            \"MKC\",\n            \"MKL\",\n            \"MKSI\",\n            \"MKTG\",\n            \"MKTO\",\n            \"MKTX\",\n            \"MLAB\",\n            \"MLG\",\n            \"MLHR\",\n            \"MLI\",\n            \"MLM\",\n            \"MLN\",\n            \"MLNK\",\n            \"MLNX\",\n            \"MLP\",\n            \"MLPA\",\n            \"MLPC\",\n            \"MLPG\",\n            \"MLPI\",\n            \"MLPJ\",\n            \"MLPL\",\n            \"MLPN\",\n            \"MLPX\",\n            \"MLPY\",\n            \"MLR\",\n            \"MLU\",\n            \"MLVF\",\n            \"MM\",\n            \"MMC\",\n            \"MMD\",\n            \"MMF\",\n            \"MMLP\",\n            \"MMM\",\n            \"MMP\",\n            \"MMS\",\n            \"MMSI\",\n            \"MMT\",\n            \"MMU\",\n            \"MMV\",\n            \"MMYT\",\n            \"MN\",\n            \"MNA\",\n            \"MNDL\",\n            \"MNDO\",\n            \"MNE\",\n            \"MNGA\",\n            \"MNI\",\n            \"MNK\",\n            \"MNKD\",\n            \"MNOV\",\n            \"MNP\",\n            \"MNR\",\n            \"MNRK\",\n            \"MNRO\",\n            \"MNST\",\n            \"MNTA\",\n            \"MNTG\",\n            \"MNTX\",\n            \"MO\",\n            \"MOAT\",\n            \"MOBI\",\n            \"MOCO\",\n            \"MOD\",\n            \"MODN\",\n            \"MOFG\",\n            \"MOG.A\",\n            \"MOH\",\n            \"MOL\",\n            \"MOLX\",\n            \"MOLXA\",\n            \"MON\",\n            \"MONT\",\n            \"MONY\",\n            \"MOO\",\n            \"MORL\",\n            \"MORN\",\n            \"MORT\",\n            \"MOS\",\n            \"MOSY\",\n            \"MOV\",\n            \"MOVE\",\n            \"MPA\",\n            \"MPAA\",\n            \"MPB\",\n            \"MPC\",\n            \"MPEL\",\n            \"MPET\",\n            \"MPG\",\n            \"MPLX\",\n            \"MPO\",\n            \"MPV\",\n            \"MPW\",\n            \"MPWR\",\n            \"MPX\",\n            \"MQT\",\n            \"MQY\",\n            \"MR\",\n            \"MRC\",\n            \"MRCC\",\n            \"MRCY\",\n            \"MRF\",\n            \"MRGE\",\n            \"MRH\",\n            \"MRIN\",\n            \"MRK\",\n            \"MRLN\",\n            \"MRO\",\n            \"MRTN\",\n            \"MRTX\",\n            \"MRVL\",\n            \"MS\",\n            \"MSA\",\n            \"MSB\",\n            \"MSBF\",\n            \"MSC\",\n            \"MSCA\",\n            \"MSCC\",\n            \"MSCI\",\n            \"MSD\",\n            \"MSEX\",\n            \"MSF\",\n            \"MSFG\",\n            \"MSFT\",\n            \"MSG\",\n            \"MSI\",\n            \"MSJ\",\n            \"MSK\",\n            \"MSL\",\n            \"MSLI\",\n            \"MSM\",\n            \"MSN\",\n            \"MSO\",\n            \"MSON\",\n            \"MSP\",\n            \"MSPD\",\n            \"MSTR\",\n            \"MSTX\",\n            \"MSZ\",\n            \"MT\",\n            \"MTB\",\n            \"MTCN\",\n            \"MTD\",\n            \"MTDR\",\n            \"MTEX\",\n            \"MTG\",\n            \"MTGE\",\n            \"MTH\",\n            \"MTK\",\n            \"MTL\",\n            \"MTN\",\n            \"MTOR\",\n            \"MTR\",\n            \"MTRN\",\n            \"MTRX\",\n            \"MTS\",\n            \"MTSC\",\n            \"MTSI\",\n            \"MTSL\",\n            \"MTSN\",\n            \"MTT\",\n            \"MTU\",\n            \"MTUM\",\n            \"MTW\",\n            \"MTX\",\n            \"MTY\",\n            \"MTZ\",\n            \"MU\",\n            \"MUA\",\n            \"MUAC\",\n            \"MUAD\",\n            \"MUAE\",\n            \"MUAF\",\n            \"MUB\",\n            \"MUC\",\n            \"MUE\",\n            \"MUH\",\n            \"MUI\",\n            \"MUJ\",\n            \"MUNI\",\n            \"MUR\",\n            \"MUS\",\n            \"MUSA\",\n            \"MUX\",\n            \"MVC\",\n            \"MVCB\",\n            \"MVF\",\n            \"MVG\",\n            \"MVIS\",\n            \"MVO\",\n            \"MVT\",\n            \"MVV\",\n            \"MW\",\n            \"MWA\",\n            \"MWE\",\n            \"MWG\",\n            \"MWIV\",\n            \"MWO\",\n            \"MWR\",\n            \"MWV\",\n            \"MWW\",\n            \"MX\",\n            \"MXA\",\n            \"MXC\",\n            \"MXE\",\n            \"MXF\",\n            \"MXI\",\n            \"MXIM\",\n            \"MXL\",\n            \"MXN\",\n            \"MXT\",\n            \"MXWL\",\n            \"MY\",\n            \"MYC\",\n            \"MYCC\",\n            \"MYD\",\n            \"MYE\",\n            \"MYF\",\n            \"MYGN\",\n            \"MYI\",\n            \"MYJ\",\n            \"MYL\",\n            \"MYM\",\n            \"MYN\",\n            \"MYP\",\n            \"MYRG\",\n            \"MYY\",\n            \"MZA\",\n            \"MZF\",\n            \"MZOR\",\n            \"MZZ\",\n            \"N\",\n            \"NAC\",\n            \"NAD\",\n            \"NAFC\",\n            \"NAGS\",\n            \"NAI\",\n            \"NAII\",\n            \"NAK\",\n            \"NAN\",\n            \"NANO\",\n            \"NASB\",\n            \"NASH\",\n            \"NAT\",\n            \"NATH\",\n            \"NATI\",\n            \"NATL\",\n            \"NATR\",\n            \"NAUH\",\n            \"NAV\",\n            \"NAVB\",\n            \"NAVG\",\n            \"NAZ\",\n            \"NBB\",\n            \"NBBC\",\n            \"NBCB\",\n            \"NBD\",\n            \"NBG\",\n            \"NBH\",\n            \"NBHC\",\n            \"NBIX\",\n            \"NBL\",\n            \"NBN\",\n            \"NBO\",\n            \"NBR\",\n            \"NBS\",\n            \"NBTB\",\n            \"NBTF\",\n            \"NBW\",\n            \"NBY\",\n            \"NC\",\n            \"NCA\",\n            \"NCB\",\n            \"NCBC\",\n            \"NCI\",\n            \"NCIT\",\n            \"NCLH\",\n            \"NCMI\",\n            \"NCO\",\n            \"NCP\",\n            \"NCQ\",\n            \"NCR\",\n            \"NCS\",\n            \"NCT\",\n            \"NCTY\",\n            \"NCU\",\n            \"NCV\",\n            \"NCZ\",\n            \"NDAQ\",\n            \"NDLS\",\n            \"NDP\",\n            \"NDRO\",\n            \"NDSN\",\n            \"NDZ\",\n            \"NE\",\n            \"NEA\",\n            \"NECB\",\n            \"NED\",\n            \"NEE\",\n            \"NEM\",\n            \"NEN\",\n            \"NEO\",\n            \"NEOG\",\n            \"NEON\",\n            \"NEPT\",\n            \"NES\",\n            \"NETC\",\n            \"NETE\",\n            \"NEU\",\n            \"NEV\",\n            \"NEWL\",\n            \"NEWP\",\n            \"NEWS\",\n            \"NEWT\",\n            \"NFBK\",\n            \"NFEC\",\n            \"NFG\",\n            \"NFJ\",\n            \"NFLX\",\n            \"NFO\",\n            \"NFX\",\n            \"NG\",\n            \"NGD\",\n            \"NGE\",\n            \"NGG\",\n            \"NGL\",\n            \"NGLS\",\n            \"NGPC\",\n            \"NGS\",\n            \"NGVC\",\n            \"NGX\",\n            \"NGZ\",\n            \"NHC\",\n            \"NHF\",\n            \"NHI\",\n            \"NHS\",\n            \"NHTB\",\n            \"NI\",\n            \"NIB\",\n            \"NICE\",\n            \"NICK\",\n            \"NID\",\n            \"NIE\",\n            \"NIHD\",\n            \"NILE\",\n            \"NIM\",\n            \"NINE\",\n            \"NIO\",\n            \"NIQ\",\n            \"NJ\",\n            \"NJR\",\n            \"NJV\",\n            \"NKA\",\n            \"NKE\",\n            \"NKG\",\n            \"NKSH\",\n            \"NKTR\",\n            \"NKX\",\n            \"NKY\",\n            \"NL\",\n            \"NLNK\",\n            \"NLP\",\n            \"NLR\",\n            \"NLS\",\n            \"NLSN\",\n            \"NLST\",\n            \"NLY\",\n            \"NM\",\n            \"NMA\",\n            \"NMFC\",\n            \"NMI\",\n            \"NML\",\n            \"NMM\",\n            \"NMO\",\n            \"NMR\",\n            \"NMRX\",\n            \"NMT\",\n            \"NMY\",\n            \"NMZ\",\n            \"NNA\",\n            \"NNBR\",\n            \"NNC\",\n            \"NNI\",\n            \"NNJ\",\n            \"NNN\",\n            \"NNP\",\n            \"NNVC\",\n            \"NNY\",\n            \"NOA\",\n            \"NOAH\",\n            \"NOC\",\n            \"NOG\",\n            \"NOK\",\n            \"NOM\",\n            \"NOR\",\n            \"NORW\",\n            \"NOV\",\n            \"NOVB\",\n            \"NOW\",\n            \"NP\",\n            \"NPBC\",\n            \"NPD\",\n            \"NPF\",\n            \"NPI\",\n            \"NPK\",\n            \"NPM\",\n            \"NPN\",\n            \"NPO\",\n            \"NPP\",\n            \"NPSP\",\n            \"NPT\",\n            \"NPTN\",\n            \"NPV\",\n            \"NPY\",\n            \"NQ\",\n            \"NQC\",\n            \"NQI\",\n            \"NQJ\",\n            \"NQM\",\n            \"NQP\",\n            \"NQS\",\n            \"NQU\",\n            \"NR\",\n            \"NRCIA\",\n            \"NRCIB\",\n            \"NRF\",\n            \"NRG\",\n            \"NRGM\",\n            \"NRGY\",\n            \"NRIM\",\n            \"NRK\",\n            \"NRO\",\n            \"NRP\",\n            \"NRT\",\n            \"NRZ\",\n            \"NS\",\n            \"NSC\",\n            \"NSEC\",\n            \"NSH\",\n            \"NSIT\",\n            \"NSL\",\n            \"NSLP\",\n            \"NSM\",\n            \"NSP\",\n            \"NSPH\",\n            \"NSPR\",\n            \"NSR\",\n            \"NSS\",\n            \"NSSC\",\n            \"NSTG\",\n            \"NSU\",\n            \"NSYS\",\n            \"NTAP\",\n            \"NTC\",\n            \"NTCT\",\n            \"NTE\",\n            \"NTES\",\n            \"NTG\",\n            \"NTGR\",\n            \"NTI\",\n            \"NTIC\",\n            \"NTK\",\n            \"NTL\",\n            \"NTLS\",\n            \"NTN\",\n            \"NTRI\",\n            \"NTRS\",\n            \"NTS\",\n            \"NTSC\",\n            \"NTT\",\n            \"NTWK\",\n            \"NTX\",\n            \"NTZ\",\n            \"NU\",\n            \"NUAN\",\n            \"NUC\",\n            \"NUCL\",\n            \"NUE\",\n            \"NUGT\",\n            \"NUJ\",\n            \"NUM\",\n            \"NUO\",\n            \"NURO\",\n            \"NUS\",\n            \"NUTR\",\n            \"NUV\",\n            \"NUVA\",\n            \"NUW\",\n            \"NVAX\",\n            \"NVC\",\n            \"NVDA\",\n            \"NVDQ\",\n            \"NVE\",\n            \"NVEC\",\n            \"NVEEW\",\n            \"NVG\",\n            \"NVGN\",\n            \"NVMI\",\n            \"NVO\",\n            \"NVR\",\n            \"NVS\",\n            \"NVSL\",\n            \"NVTL\",\n            \"NVX\",\n            \"NVY\",\n            \"NWBI\",\n            \"NWBO\",\n            \"NWBOW\",\n            \"NWE\",\n            \"NWFL\",\n            \"NWL\",\n            \"NWLI\",\n            \"NWN\",\n            \"NWPX\",\n            \"NWS\",\n            \"NWSA\",\n            \"NWY\",\n            \"NX\",\n            \"NXC\",\n            \"NXJ\",\n            \"NXK\",\n            \"NXM\",\n            \"NXN\",\n            \"NXP\",\n            \"NXPI\",\n            \"NXQ\",\n            \"NXR\",\n            \"NXST\",\n            \"NXTM\",\n            \"NXZ\",\n            \"NY\",\n            \"NYC\",\n            \"NYCB\",\n            \"NYF\",\n            \"NYH\",\n            \"NYLD\",\n            \"NYMT\",\n            \"NYMTP\",\n            \"NYMX\",\n            \"NYNY\",\n            \"NYT\",\n            \"NYV\",\n            \"NYX\",\n            \"NZF\",\n            \"NZH\",\n            \"O\",\n            \"OABC\",\n            \"OAK\",\n            \"OAKS\",\n            \"OAS\",\n            \"OB\",\n            \"OBAS\",\n            \"OBCI\",\n            \"OBT\",\n            \"OC\",\n            \"OCC\",\n            \"OCFC\",\n            \"OCIP\",\n            \"OCIR\",\n            \"OCLR\",\n            \"OCLS\",\n            \"OCN\",\n            \"OCR\",\n            \"OCRX\",\n            \"OCZ\",\n            \"ODC\",\n            \"ODFL\",\n            \"ODP\",\n            \"OEF\",\n            \"OEH\",\n            \"OESX\",\n            \"OFC\",\n            \"OFED\",\n            \"OFF\",\n            \"OFG\",\n            \"OFIX\",\n            \"OFLX\",\n            \"OFS\",\n            \"OGE\",\n            \"OGEN\",\n            \"OGXI\",\n            \"OHI\",\n            \"OHRP\",\n            \"OI\",\n            \"OIA\",\n            \"OIBR.C\",\n            \"OIBR\",\n            \"OIH\",\n            \"OII\",\n            \"OIIM\",\n            \"OIL\",\n            \"OILT\",\n            \"OILZ\",\n            \"OINK\",\n            \"OIS\",\n            \"OKE\",\n            \"OKS\",\n            \"OKSB\",\n            \"OLBK\",\n            \"OLED\",\n            \"OLEM\",\n            \"OLN\",\n            \"OLO\",\n            \"OLP\",\n            \"OMAB\",\n            \"OMC\",\n            \"OMCL\",\n            \"OME\",\n            \"OMED\",\n            \"OMER\",\n            \"OMEX\",\n            \"OMG\",\n            \"OMI\",\n            \"OMN\",\n            \"OMX\",\n            \"ONB\",\n            \"ONCY\",\n            \"ONE\",\n            \"ONEF\",\n            \"ONEK\",\n            \"ONEQ\",\n            \"ONFC\",\n            \"ONN\",\n            \"ONNN\",\n            \"ONP\",\n            \"ONTX\",\n            \"ONTY\",\n            \"ONVI\",\n            \"ONVO\",\n            \"OPAY\",\n            \"OPEN\",\n            \"OPHC\",\n            \"OPHT\",\n            \"OPK\",\n            \"OPLK\",\n            \"OPOF\",\n            \"OPTR\",\n            \"OPTT\",\n            \"OPXA\",\n            \"OPY\",\n            \"ORA\",\n            \"ORAN\",\n            \"ORB\",\n            \"ORBC\",\n            \"ORBK\",\n            \"ORBT\",\n            \"ORC\",\n            \"ORCL\",\n            \"OREX\",\n            \"ORI\",\n            \"ORIG\",\n            \"ORIT\",\n            \"ORLY\",\n            \"ORM\",\n            \"ORMP\",\n            \"ORN\",\n            \"ORRF\",\n            \"OSBC\",\n            \"OSBCP\",\n            \"OSHC\",\n            \"OSIR\",\n            \"OSIS\",\n            \"OSK\",\n            \"OSM\",\n            \"OSN\",\n            \"OSTK\",\n            \"OSUR\",\n            \"OTEL\",\n            \"OTEX\",\n            \"OTIV\",\n            \"OTTR\",\n            \"OUTR\",\n            \"OVAS\",\n            \"OVBC\",\n            \"OVLY\",\n            \"OVRL\",\n            \"OVTI\",\n            \"OWW\",\n            \"OXBT\",\n            \"OXF\",\n            \"OXGN\",\n            \"OXLC\",\n            \"OXM\",\n            \"OXY\",\n            \"OZM\",\n            \"OZRK\",\n            \"P\",\n            \"PAA\",\n            \"PAAS\",\n            \"PAC\",\n            \"PACB\",\n            \"PACD\",\n            \"PACQW\",\n            \"PACR\",\n            \"PACT\",\n            \"PACW\",\n            \"PAG\",\n            \"PAGG\",\n            \"PAI\",\n            \"PAL\",\n            \"PALL\",\n            \"PAM\",\n            \"PAMT\",\n            \"PANW\",\n            \"PAR\",\n            \"PATH\",\n            \"PATK\",\n            \"PATR\",\n            \"PAY\",\n            \"PAYX\",\n            \"PB\",\n            \"PBA\",\n            \"PBCP\",\n            \"PBCT\",\n            \"PBD\",\n            \"PBE\",\n            \"PBF\",\n            \"PBH\",\n            \"PBHC\",\n            \"PBI\",\n            \"PBIB\",\n            \"PBIP\",\n            \"PBJ\",\n            \"PBM\",\n            \"PBMD\",\n            \"PBNY\",\n            \"PBP\",\n            \"PBPB\",\n            \"PBR.A\",\n            \"PBR\",\n            \"PBS\",\n            \"PBSK\",\n            \"PBT\",\n            \"PBW\",\n            \"PBY\",\n            \"PBYI\",\n            \"PCAR\",\n            \"PCBK\",\n            \"PCC\",\n            \"PCCC\",\n            \"PCEF\",\n            \"PCF\",\n            \"PCG\",\n            \"PCH\",\n            \"PCI\",\n            \"PCK\",\n            \"PCL\",\n            \"PCLN\",\n            \"PCM\",\n            \"PCMI\",\n            \"PCN\",\n            \"PCO\",\n            \"PCOM\",\n            \"PCP\",\n            \"PCQ\",\n            \"PCRX\",\n            \"PCTI\",\n            \"PCY\",\n            \"PCYC\",\n            \"PCYG\",\n            \"PCYO\",\n            \"PDCE\",\n            \"PDCO\",\n            \"PDEX\",\n            \"PDFS\",\n            \"PDH\",\n            \"PDI\",\n            \"PDII\",\n            \"PDLI\",\n            \"PDM\",\n            \"PDN\",\n            \"PDO\",\n            \"PDP\",\n            \"PDS\",\n            \"PDT\",\n            \"PEB\",\n            \"PEBK\",\n            \"PEBO\",\n            \"PED\",\n            \"PEG\",\n            \"PEGA\",\n            \"PEGI\",\n            \"PEI\",\n            \"PEIX\",\n            \"PEJ\",\n            \"PENN\",\n            \"PENX\",\n            \"PEO\",\n            \"PEOP\",\n            \"PEP\",\n            \"PER\",\n            \"PERF\",\n            \"PERI\",\n            \"PERY\",\n            \"PES\",\n            \"PESI\",\n            \"PETM\",\n            \"PETS\",\n            \"PETX\",\n            \"PEY\",\n            \"PEZ\",\n            \"PF\",\n            \"PFBC\",\n            \"PFBI\",\n            \"PFBX\",\n            \"PFD\",\n            \"PFE\",\n            \"PFEM\",\n            \"PFF\",\n            \"PFG\",\n            \"PFH\",\n            \"PFI\",\n            \"PFIG\",\n            \"PFIN\",\n            \"PFK\",\n            \"PFL\",\n            \"PFLT\",\n            \"PFM\",\n            \"PFMT\",\n            \"PFN\",\n            \"PFO\",\n            \"PFPT\",\n            \"PFS\",\n            \"PFSI\",\n            \"PFSW\",\n            \"PFX\",\n            \"PFXF\",\n            \"PG\",\n            \"PGC\",\n            \"PGEM\",\n            \"PGF\",\n            \"PGH\",\n            \"PGHY\",\n            \"PGI\",\n            \"PGJ\",\n            \"PGM\",\n            \"PGNX\",\n            \"PGP\",\n            \"PGR\",\n            \"PGRX\",\n            \"PGTI\",\n            \"PGX\",\n            \"PGZ\",\n            \"PH\",\n            \"PHA\",\n            \"PHB\",\n            \"PHD\",\n            \"PHDG\",\n            \"PHF\",\n            \"PHG\",\n            \"PHH\",\n            \"PHI\",\n            \"PHII\",\n            \"PHIIK\",\n            \"PHK\",\n            \"PHM\",\n            \"PHMD\",\n            \"PHO\",\n            \"PHT\",\n            \"PHX\",\n            \"PHYS\",\n            \"PICB\",\n            \"PICK\",\n            \"PICO\",\n            \"PID\",\n            \"PIE\",\n            \"PII\",\n            \"PIKE\",\n            \"PIM\",\n            \"PIN\",\n            \"PINC\",\n            \"PIO\",\n            \"PIP\",\n            \"PIR\",\n            \"PIY\",\n            \"PIZ\",\n            \"PJA\",\n            \"PJC\",\n            \"PJH\",\n            \"PJL\",\n            \"PJP\",\n            \"PKB\",\n            \"PKBK\",\n            \"PKD\",\n            \"PKE\",\n            \"PKG\",\n            \"PKI\",\n            \"PKO\",\n            \"PKOH\",\n            \"PKT\",\n            \"PKW\",\n            \"PKX\",\n            \"PKY\",\n            \"PL\",\n            \"PLAB\",\n            \"PLBC\",\n            \"PLCC\",\n            \"PLCE\",\n            \"PLCM\",\n            \"PLD\",\n            \"PLG\",\n            \"PLL\",\n            \"PLM\",\n            \"PLMT\",\n            \"PLND\",\n            \"PLNR\",\n            \"PLOW\",\n            \"PLP\",\n            \"PLPC\",\n            \"PLPM\",\n            \"PLT\",\n            \"PLUG\",\n            \"PLUS\",\n            \"PLW\",\n            \"PLX\",\n            \"PLXS\",\n            \"PLXT\",\n            \"PM\",\n            \"PMBC\",\n            \"PMC\",\n            \"PMCS\",\n            \"PMD\",\n            \"PME\",\n            \"PMF\",\n            \"PMFG\",\n            \"PML\",\n            \"PMM\",\n            \"PMO\",\n            \"PMR\",\n            \"PMT\",\n            \"PMTC\",\n            \"PMX\",\n            \"PNBK\",\n            \"PNC\",\n            \"PNF\",\n            \"PNFP\",\n            \"PNG\",\n            \"PNI\",\n            \"PNK\",\n            \"PNM\",\n            \"PNNT\",\n            \"PNQI\",\n            \"PNR\",\n            \"PNRA\",\n            \"PNTA\",\n            \"PNTR\",\n            \"PNW\",\n            \"PNX\",\n            \"PNY\",\n            \"PODD\",\n            \"POL\",\n            \"POM\",\n            \"POOL\",\n            \"POPE\",\n            \"POR\",\n            \"POST\",\n            \"POT\",\n            \"POWI\",\n            \"POWL\",\n            \"POWR\",\n            \"POZN\",\n            \"PPA\",\n            \"PPBI\",\n            \"PPC\",\n            \"PPG\",\n            \"PPH\",\n            \"PPHM\",\n            \"PPL\",\n            \"PPLT\",\n            \"PPO\",\n            \"PPP\",\n            \"PPR\",\n            \"PPS\",\n            \"PPT\",\n            \"PPX\",\n            \"PQ\",\n            \"PRA\",\n            \"PRAA\",\n            \"PRAN\",\n            \"PRB\",\n            \"PRCP\",\n            \"PRE\",\n            \"PRF\",\n            \"PRFT\",\n            \"PRFZ\",\n            \"PRGN\",\n            \"PRGO\",\n            \"PRGS\",\n            \"PRGX\",\n            \"PRH\",\n            \"PRI\",\n            \"PRIM\",\n            \"PRIS.B\",\n            \"PRIS\",\n            \"PRK\",\n            \"PRKR\",\n            \"PRLB\",\n            \"PRLS\",\n            \"PRMW\",\n            \"PRO\",\n            \"PROV\",\n            \"PRPH\",\n            \"PRSC\",\n            \"PRSS\",\n            \"PRTA\",\n            \"PRTS\",\n            \"PRU\",\n            \"PRXI\",\n            \"PRXL\",\n            \"PRY\",\n            \"PSA\",\n            \"PSAU\",\n            \"PSB\",\n            \"PSCC\",\n            \"PSCD\",\n            \"PSCE\",\n            \"PSCF\",\n            \"PSCH\",\n            \"PSCI\",\n            \"PSCM\",\n            \"PSCT\",\n            \"PSCU\",\n            \"PSDV\",\n            \"PSE\",\n            \"PSEC\",\n            \"PSEM\",\n            \"PSF\",\n            \"PSI\",\n            \"PSIX\",\n            \"PSJ\",\n            \"PSK\",\n            \"PSL\",\n            \"PSLV\",\n            \"PSMI\",\n            \"PSMT\",\n            \"PSO\",\n            \"PSP\",\n            \"PSQ\",\n            \"PST\",\n            \"PSTB\",\n            \"PSTI\",\n            \"PSTR\",\n            \"PSUN\",\n            \"PSX\",\n            \"PSXP\",\n            \"PT\",\n            \"PTCT\",\n            \"PTEK\",\n            \"PTEN\",\n            \"PTF\",\n            \"PTGI\",\n            \"PTH\",\n            \"PTIE\",\n            \"PTIX\",\n            \"PTLA\",\n            \"PTM\",\n            \"PTN\",\n            \"PTNR\",\n            \"PTNT\",\n            \"PTP\",\n            \"PTR\",\n            \"PTRY\",\n            \"PTSI\",\n            \"PTSX\",\n            \"PTX\",\n            \"PTY\",\n            \"PUI\",\n            \"PUK\",\n            \"PULB\",\n            \"PULS\",\n            \"PVA\",\n            \"PVD\",\n            \"PVFC\",\n            \"PVG\",\n            \"PVH\",\n            \"PVI\",\n            \"PVR\",\n            \"PVTB\",\n            \"PVTBP\",\n            \"PVTD\",\n            \"PW\",\n            \"PWB\",\n            \"PWC\",\n            \"PWE\",\n            \"PWOD\",\n            \"PWR\",\n            \"PWRD\",\n            \"PWV\",\n            \"PWX\",\n            \"PWZ\",\n            \"PX\",\n            \"PXD\",\n            \"PXE\",\n            \"PXF\",\n            \"PXH\",\n            \"PXI\",\n            \"PXJ\",\n            \"PXLG\",\n            \"PXLV\",\n            \"PXLW\",\n            \"PXMC\",\n            \"PXMG\",\n            \"PXMV\",\n            \"PXN\",\n            \"PXQ\",\n            \"PXR\",\n            \"PXSG\",\n            \"PXSV\",\n            \"PYB\",\n            \"PYC\",\n            \"PYK\",\n            \"PYN\",\n            \"PYS\",\n            \"PYT\",\n            \"PYY\",\n            \"PYZ\",\n            \"PZA\",\n            \"PZB\",\n            \"PZC\",\n            \"PZD\",\n            \"PZE\",\n            \"PZG\",\n            \"PZI\",\n            \"PZN\",\n            \"PZT\",\n            \"PZZA\",\n            \"PZZI\",\n            \"Q\",\n            \"QABA\",\n            \"QADA\",\n            \"QADB\",\n            \"QAI\",\n            \"QBAK\",\n            \"QCCO\",\n            \"QCLN\",\n            \"QCOM\",\n            \"QCOR\",\n            \"QCRH\",\n            \"QDEF\",\n            \"QDEL\",\n            \"QEP\",\n            \"QEPM\",\n            \"QGEN\",\n            \"QID\",\n            \"QIHU\",\n            \"QIWI\",\n            \"QKLS\",\n            \"QLD\",\n            \"QLGC\",\n            \"QLIK\",\n            \"QLTA\",\n            \"QLTI\",\n            \"QLTY\",\n            \"QLYS\",\n            \"QMM\",\n            \"QMN\",\n            \"QNST\",\n            \"QPACW\",\n            \"QQEW\",\n            \"QQQ\",\n            \"QQQC\",\n            \"QQQE\",\n            \"QQQX\",\n            \"QQXT\",\n            \"QRE\",\n            \"QRM\",\n            \"QSII\",\n            \"QTEC\",\n            \"QTM\",\n            \"QTWW\",\n            \"QUAD\",\n            \"QUAL\",\n            \"QUIK\",\n            \"QUMU\",\n            \"R\",\n            \"RAD\",\n            \"RADA\",\n            \"RAI\",\n            \"RAIL\",\n            \"RALS\",\n            \"RALY\",\n            \"RAS\",\n            \"RATE\",\n            \"RAVN\",\n            \"RAX\",\n            \"RBA\",\n            \"RBC\",\n            \"RBCAA\",\n            \"RBCN\",\n            \"RBL\",\n            \"RBPAA\",\n            \"RBS\",\n            \"RBY\",\n            \"RCAP\",\n            \"RCD\",\n            \"RCI\",\n            \"RCII\",\n            \"RCKB\",\n            \"RCKY\",\n            \"RCL\",\n            \"RCMT\",\n            \"RCON\",\n            \"RCPT\",\n            \"RCS\",\n            \"RDA\",\n            \"RDC\",\n            \"RDCM\",\n            \"RDEN\",\n            \"RDHL\",\n            \"RDI\",\n            \"RDIV\",\n            \"RDN\",\n            \"RDNT\",\n            \"RDS.A\",\n            \"RDS.B\",\n            \"RDWR\",\n            \"RDY\",\n            \"RE\",\n            \"RECN\",\n            \"RECV\",\n            \"REDF\",\n            \"REE\",\n            \"REED\",\n            \"REFR\",\n            \"REG\",\n            \"REGI\",\n            \"REGN\",\n            \"REI\",\n            \"REIS\",\n            \"REK\",\n            \"RELL\",\n            \"RELV\",\n            \"REM\",\n            \"REMX\",\n            \"REMY\",\n            \"REN\",\n            \"RENN\",\n            \"RENT\",\n            \"RES\",\n            \"RESI\",\n            \"RETL\",\n            \"REV\",\n            \"REW\",\n            \"REX\",\n            \"REXI\",\n            \"REXR\",\n            \"REXX\",\n            \"REZ\",\n            \"RF\",\n            \"RFG\",\n            \"RFI\",\n            \"RFIL\",\n            \"RFMD\",\n            \"RFP\",\n            \"RFV\",\n            \"RGA\",\n            \"RGC\",\n            \"RGCO\",\n            \"RGDO\",\n            \"RGDX\",\n            \"RGEN\",\n            \"RGLD\",\n            \"RGLS\",\n            \"RGP\",\n            \"RGR\",\n            \"RGRA\",\n            \"RGRC\",\n            \"RGS\",\n            \"RH\",\n            \"RHI\",\n            \"RHP\",\n            \"RHS\",\n            \"RHT\",\n            \"RIC\",\n            \"RICK\",\n            \"RIF\",\n            \"RIG\",\n            \"RIGL\",\n            \"RING\",\n            \"RIO\",\n            \"RIOM\",\n            \"RIT\",\n            \"RITT\",\n            \"RIVR\",\n            \"RJA\",\n            \"RJD\",\n            \"RJET\",\n            \"RJF\",\n            \"RJI\",\n            \"RJN\",\n            \"RJZ\",\n            \"RKH\",\n            \"RKT\",\n            \"RKUS\",\n            \"RL\",\n            \"RLD\",\n            \"RLGT\",\n            \"RLGY\",\n            \"RLH\",\n            \"RLI\",\n            \"RLJ\",\n            \"RLJE\",\n            \"RLOC\",\n            \"RLOG\",\n            \"RLY\",\n            \"RM\",\n            \"RMAX\",\n            \"RMBS\",\n            \"RMCF\",\n            \"RMD\",\n            \"RMGN\",\n            \"RMT\",\n            \"RMTI\",\n            \"RNA\",\n            \"RNDY\",\n            \"RNE\",\n            \"RNET\",\n            \"RNF\",\n            \"RNG\",\n            \"RNN\",\n            \"RNO\",\n            \"RNP\",\n            \"RNR\",\n            \"RNST\",\n            \"RNWK\",\n            \"ROC\",\n            \"ROCK\",\n            \"ROCM\",\n            \"ROG\",\n            \"ROIA\",\n            \"ROIAK\",\n            \"ROIC\",\n            \"ROICW\",\n            \"ROK\",\n            \"ROL\",\n            \"ROLL\",\n            \"ROM\",\n            \"ROMA\",\n            \"ROOF\",\n            \"ROP\",\n            \"ROSE\",\n            \"ROSG\",\n            \"ROST\",\n            \"ROVI\",\n            \"ROX\",\n            \"ROYL\",\n            \"ROYT\",\n            \"RP\",\n            \"RPAI\",\n            \"RPG\",\n            \"RPI\",\n            \"RPM\",\n            \"RPRX\",\n            \"RPT\",\n            \"RPTP\",\n            \"RPV\",\n            \"RPXC\",\n            \"RQI\",\n            \"RRC\",\n            \"RRD\",\n            \"RRGB\",\n            \"RRMS\",\n            \"RRST\",\n            \"RRTS\",\n            \"RS\",\n            \"RSCO\",\n            \"RSE\",\n            \"RSG\",\n            \"RSH\",\n            \"RSO\",\n            \"RSOL\",\n            \"RSP\",\n            \"RST\",\n            \"RSTI\",\n            \"RSX\",\n            \"RSXJ\",\n            \"RSYS\",\n            \"RT\",\n            \"RTEC\",\n            \"RTH\",\n            \"RTI\",\n            \"RTIX\",\n            \"RTK\",\n            \"RTL\",\n            \"RTM\",\n            \"RTN\",\n            \"RUDR\",\n            \"RUE\",\n            \"RUK\",\n            \"RUSHA\",\n            \"RUSHB\",\n            \"RUSL\",\n            \"RUSS\",\n            \"RUTH\",\n            \"RVBD\",\n            \"RVLT\",\n            \"RVM\",\n            \"RVP\",\n            \"RVSB\",\n            \"RVT\",\n            \"RWC\",\n            \"RWG\",\n            \"RWJ\",\n            \"RWK\",\n            \"RWL\",\n            \"RWM\",\n            \"RWO\",\n            \"RWR\",\n            \"RWT\",\n            \"RWW\",\n            \"RWX\",\n            \"RXD\",\n            \"RXI\",\n            \"RXL\",\n            \"RXN\",\n            \"RY\",\n            \"RYAAY\",\n            \"RYE\",\n            \"RYF\",\n            \"RYH\",\n            \"RYJ\",\n            \"RYL\",\n            \"RYN\",\n            \"RYT\",\n            \"RYU\",\n            \"RZA\",\n            \"RZG\",\n            \"RZV\",\n            \"S\",\n            \"SA\",\n            \"SAA\",\n            \"SAAS\",\n            \"SAEX\",\n            \"SAFM\",\n            \"SAFT\",\n            \"SAH\",\n            \"SAIA\",\n            \"SAIC\",\n            \"SAL\",\n            \"SALE\",\n            \"SALM\",\n            \"SAM\",\n            \"SAMG\",\n            \"SAN\",\n            \"SAND\",\n            \"SANM\",\n            \"SANW\",\n            \"SAP\",\n            \"SAPE\",\n            \"SAQ\",\n            \"SAR\",\n            \"SARA\",\n            \"SASR\",\n            \"SATS\",\n            \"SAVE\",\n            \"SB\",\n            \"SBAC\",\n            \"SBB\",\n            \"SBBX\",\n            \"SBCF\",\n            \"SBFG\",\n            \"SBGI\",\n            \"SBGL\",\n            \"SBH\",\n            \"SBI\",\n            \"SBLK\",\n            \"SBND\",\n            \"SBNY\",\n            \"SBR\",\n            \"SBRA\",\n            \"SBRAP\",\n            \"SBS\",\n            \"SBSA\",\n            \"SBSI\",\n            \"SBUX\",\n            \"SBW\",\n            \"SBY\",\n            \"SCBT\",\n            \"SCC\",\n            \"SCCO\",\n            \"SCD\",\n            \"SCG\",\n            \"SCHA\",\n            \"SCHB\",\n            \"SCHC\",\n            \"SCHD\",\n            \"SCHE\",\n            \"SCHF\",\n            \"SCHG\",\n            \"SCHH\",\n            \"SCHL\",\n            \"SCHM\",\n            \"SCHN\",\n            \"SCHO\",\n            \"SCHP\",\n            \"SCHR\",\n            \"SCHV\",\n            \"SCHW\",\n            \"SCHX\",\n            \"SCHZ\",\n            \"SCI\",\n            \"SCIF\",\n            \"SCIN\",\n            \"SCJ\",\n            \"SCL\",\n            \"SCLN\",\n            \"SCM\",\n            \"SCMP\",\n            \"SCO\",\n            \"SCOK\",\n            \"SCON\",\n            \"SCOR\",\n            \"SCPB\",\n            \"SCR\",\n            \"SCS\",\n            \"SCSC\",\n            \"SCSS\",\n            \"SCT\",\n            \"SCTY\",\n            \"SCU\",\n            \"SCVL\",\n            \"SCX\",\n            \"SCZ\",\n            \"SD\",\n            \"SDA\",\n            \"SDD\",\n            \"SDIV\",\n            \"SDLP\",\n            \"SDOG\",\n            \"SDOW\",\n            \"SDP\",\n            \"SDR\",\n            \"SDRL\",\n            \"SDS\",\n            \"SDT\",\n            \"SDY\",\n            \"SDYL\",\n            \"SE\",\n            \"SEA\",\n            \"SEAC\",\n            \"SEAS\",\n            \"SEB\",\n            \"SED\",\n            \"SEE\",\n            \"SEED\",\n            \"SEF\",\n            \"SEIC\",\n            \"SEM\",\n            \"SEMG\",\n            \"SENEA\",\n            \"SENEB\",\n            \"SEP\",\n            \"SEV\",\n            \"SF\",\n            \"SFB\",\n            \"SFBC\",\n            \"SFE\",\n            \"SFG\",\n            \"SFI\",\n            \"SFK\",\n            \"SFL\",\n            \"SFLY\",\n            \"SFM\",\n            \"SFN\",\n            \"SFNC\",\n            \"SFST\",\n            \"SFUN\",\n            \"SFY\",\n            \"SGA\",\n            \"SGAR\",\n            \"SGB\",\n            \"SGC\",\n            \"SGEN\",\n            \"SGF\",\n            \"SGG\",\n            \"SGI\",\n            \"SGK\",\n            \"SGL\",\n            \"SGMA\",\n            \"SGMO\",\n            \"SGMS\",\n            \"SGNT\",\n            \"SGOC\",\n            \"SGOL\",\n            \"SGRP\",\n            \"SGU\",\n            \"SGY\",\n            \"SGYP\",\n            \"SGZA\",\n            \"SH\",\n            \"SHBI\",\n            \"SHEN\",\n            \"SHFL\",\n            \"SHG\",\n            \"SHI\",\n            \"SHIP\",\n            \"SHLD\",\n            \"SHLM\",\n            \"SHLO\",\n            \"SHM\",\n            \"SHN\",\n            \"SHO\",\n            \"SHOO\",\n            \"SHOR\",\n            \"SHOS\",\n            \"SHPG\",\n            \"SHV\",\n            \"SHW\",\n            \"SHY\",\n            \"SI\",\n            \"SIAL\",\n            \"SIBC\",\n            \"SID\",\n            \"SIEB\",\n            \"SIF\",\n            \"SIFI\",\n            \"SIFY\",\n            \"SIG\",\n            \"SIGA\",\n            \"SIGI\",\n            \"SIGM\",\n            \"SIJ\",\n            \"SIL\",\n            \"SILC\",\n            \"SILJ\",\n            \"SIM\",\n            \"SIMG\",\n            \"SIMO\",\n            \"SINA\",\n            \"SINO\",\n            \"SIR\",\n            \"SIRI\",\n            \"SIRO\",\n            \"SIVB\",\n            \"SIVR\",\n            \"SIX\",\n            \"SJB\",\n            \"SJI\",\n            \"SJM\",\n            \"SJNK\",\n            \"SJR\",\n            \"SJT\",\n            \"SJW\",\n            \"SKBI\",\n            \"SKF\",\n            \"SKH\",\n            \"SKK\",\n            \"SKM\",\n            \"SKS\",\n            \"SKT\",\n            \"SKUL\",\n            \"SKX\",\n            \"SKY\",\n            \"SKYW\",\n            \"SKYY\",\n            \"SLA\",\n            \"SLAB\",\n            \"SLB\",\n            \"SLCA\",\n            \"SLF\",\n            \"SLG\",\n            \"SLGN\",\n            \"SLH\",\n            \"SLI\",\n            \"SLM\",\n            \"SLMAP\",\n            \"SLMBP\",\n            \"SLP\",\n            \"SLRA\",\n            \"SLRC\",\n            \"SLTC\",\n            \"SLTM\",\n            \"SLV\",\n            \"SLVO\",\n            \"SLVP\",\n            \"SLW\",\n            \"SLX\",\n            \"SLXP\",\n            \"SLY\",\n            \"SLYG\",\n            \"SLYV\",\n            \"SM\",\n            \"SMA\",\n            \"SMB\",\n            \"SMCI\",\n            \"SMDD\",\n            \"SMED\",\n            \"SMF\",\n            \"SMFG\",\n            \"SMG\",\n            \"SMH\",\n            \"SMI\",\n            \"SMIT\",\n            \"SMLP\",\n            \"SMLV\",\n            \"SMM\",\n            \"SMMU\",\n            \"SMN\",\n            \"SMP\",\n            \"SMPL\",\n            \"SMRT\",\n            \"SMS\",\n            \"SMSI\",\n            \"SMT\",\n            \"SMTC\",\n            \"SMTX\",\n            \"SN\",\n            \"SNA\",\n            \"SNAK\",\n            \"SNBC\",\n            \"SNCR\",\n            \"SNDK\",\n            \"SNE\",\n            \"SNFCA\",\n            \"SNH\",\n            \"SNHN\",\n            \"SNHY\",\n            \"SNI\",\n            \"SNLN\",\n            \"SNMX\",\n            \"SNN\",\n            \"SNP\",\n            \"SNPS\",\n            \"SNSS\",\n            \"SNTA\",\n            \"SNTS\",\n            \"SNV\",\n            \"SNX\",\n            \"SNY\",\n            \"SO\",\n            \"SOCB\",\n            \"SOCL\",\n            \"SODA\",\n            \"SOHO\",\n            \"SOHU\",\n            \"SOIL\",\n            \"SOL\",\n            \"SON\",\n            \"SONA\",\n            \"SONC\",\n            \"SONS\",\n            \"SOQ\",\n            \"SOR\",\n            \"SORL\",\n            \"SOXL\",\n            \"SOXS\",\n            \"SOXX\",\n            \"SOYB\",\n            \"SPA\",\n            \"SPAN\",\n            \"SPAR\",\n            \"SPB\",\n            \"SPCB\",\n            \"SPDC\",\n            \"SPE\",\n            \"SPEX\",\n            \"SPF\",\n            \"SPFF\",\n            \"SPG\",\n            \"SPGH\",\n            \"SPH\",\n            \"SPHB\",\n            \"SPHD\",\n            \"SPHQ\",\n            \"SPHS\",\n            \"SPIL\",\n            \"SPLK\",\n            \"SPLP\",\n            \"SPLS\",\n            \"SPLV\",\n            \"SPN\",\n            \"SPNC\",\n            \"SPNS\",\n            \"SPPI\",\n            \"SPPP\",\n            \"SPPR\",\n            \"SPPRO\",\n            \"SPR\",\n            \"SPRD\",\n            \"SPRO\",\n            \"SPRT\",\n            \"SPSC\",\n            \"SPTN\",\n            \"SPU\",\n            \"SPW\",\n            \"SPWR\",\n            \"SPXH\",\n            \"SPXL\",\n            \"SPXS\",\n            \"SPXU\",\n            \"SPY\",\n            \"SPYG\",\n            \"SPYV\",\n            \"SQI\",\n            \"SQM\",\n            \"SQNM\",\n            \"SQNS\",\n            \"SQQQ\",\n            \"SR\",\n            \"SRC\",\n            \"SRCE\",\n            \"SRCL\",\n            \"SRDX\",\n            \"SRE\",\n            \"SREV\",\n            \"SRF\",\n            \"SRI\",\n            \"SRLN\",\n            \"SRPT\",\n            \"SRS\",\n            \"SRT\",\n            \"SRTY\",\n            \"SRV\",\n            \"SSBI\",\n            \"SSD\",\n            \"SSD\",\n            \"SSFN\",\n            \"SSG\",\n            \"SSH\",\n            \"SSI\",\n            \"SSL\",\n            \"SSLT\",\n            \"SSN\",\n            \"SSNC\",\n            \"SSNI\",\n            \"SSO\",\n            \"SSP\",\n            \"SSRI\",\n            \"SSS\",\n            \"SSTK\",\n            \"SSW\",\n            \"SSY\",\n            \"SSYS\",\n            \"ST\",\n            \"STAA\",\n            \"STAG\",\n            \"STAN\",\n            \"STB\",\n            \"STBA\",\n            \"STBZ\",\n            \"STC\",\n            \"STCK\",\n            \"STE\",\n            \"STEI\",\n            \"STEL\",\n            \"STEM\",\n            \"STFC\",\n            \"STI\",\n            \"STIP\",\n            \"STJ\",\n            \"STK\",\n            \"STKL\",\n            \"STL\",\n            \"STLD\",\n            \"STLY\",\n            \"STM\",\n            \"STML\",\n            \"STMP\",\n            \"STN\",\n            \"STNG\",\n            \"STNR\",\n            \"STO\",\n            \"STON\",\n            \"STP\",\n            \"STPP\",\n            \"STPZ\",\n            \"STR\",\n            \"STRA\",\n            \"STRI\",\n            \"STRL\",\n            \"STRM\",\n            \"STRN\",\n            \"STRP\",\n            \"STRS\",\n            \"STRT\",\n            \"STRZA\",\n            \"STS\",\n            \"STSA\",\n            \"STSI\",\n            \"STT\",\n            \"STV\",\n            \"STWD\",\n            \"STX\",\n            \"STXS\",\n            \"STZ.B\",\n            \"STZ\",\n            \"SU\",\n            \"SUB\",\n            \"SUBK\",\n            \"SUI\",\n            \"SUMR\",\n            \"SUNE\",\n            \"SUNS\",\n            \"SUP\",\n            \"SUPN\",\n            \"SUPX\",\n            \"SURG\",\n            \"SUSP\",\n            \"SUSQ\",\n            \"SUSS\",\n            \"SUTR\",\n            \"SVA\",\n            \"SVBI\",\n            \"SVBL\",\n            \"SVLC\",\n            \"SVM\",\n            \"SVNT\",\n            \"SVT\",\n            \"SVU\",\n            \"SVVC\",\n            \"SVXY\",\n            \"SWC\",\n            \"SWFT\",\n            \"SWHC\",\n            \"SWI\",\n            \"SWIR\",\n            \"SWJ\",\n            \"SWK\",\n            \"SWKS\",\n            \"SWM\",\n            \"SWN\",\n            \"SWS\",\n            \"SWSH\",\n            \"SWU\",\n            \"SWX\",\n            \"SWY\",\n            \"SWZ\",\n            \"SXC\",\n            \"SXCP\",\n            \"SXE\",\n            \"SXI\",\n            \"SXL\",\n            \"SXT\",\n            \"SYA\",\n            \"SYBT\",\n            \"SYBTP\",\n            \"SYK\",\n            \"SYKE\",\n            \"SYLD\",\n            \"SYMC\",\n            \"SYMM\",\n            \"SYMX\",\n            \"SYN\",\n            \"SYNA\",\n            \"SYNC\",\n            \"SYNL\",\n            \"SYNM\",\n            \"SYNT\",\n            \"SYPR\",\n            \"SYRG\",\n            \"SYT\",\n            \"SYUT\",\n            \"SYX\",\n            \"SYY\",\n            \"SZC\",\n            \"SZO\",\n            \"SZYM\",\n            \"T\",\n            \"TA\",\n            \"TAC\",\n            \"TACT\",\n            \"TAHO\",\n            \"TAI\",\n            \"TAIT\",\n            \"TAL\",\n            \"TAM\",\n            \"TAN\",\n            \"TANN\",\n            \"TAO\",\n            \"TAOM\",\n            \"TAP\",\n            \"TARO\",\n            \"TAS\",\n            \"TASR\",\n            \"TAST\",\n            \"TAT\",\n            \"TATT\",\n            \"TAX\",\n            \"TAXI\",\n            \"TAYC\",\n            \"TAYCO\",\n            \"TAYCP\",\n            \"TAYD\",\n            \"TBAC\",\n            \"TBAR\",\n            \"TBBK\",\n            \"TBF\",\n            \"TBI\",\n            \"TBNK\",\n            \"TBOW\",\n            \"TBT\",\n            \"TBX\",\n            \"TBZ\",\n            \"TC\",\n            \"TCAP\",\n            \"TCB\",\n            \"TCBI\",\n            \"TCBIL\",\n            \"TCBIP\",\n            \"TCBK\",\n            \"TCC\",\n            \"TCCA\",\n            \"TCCO\",\n            \"TCFC\",\n            \"TCHI\",\n            \"TCI\",\n            \"TCK\",\n            \"TCO\",\n            \"TCP\",\n            \"TCPC\",\n            \"TCRD\",\n            \"TCX\",\n            \"TD\",\n            \"TDA\",\n            \"TDC\",\n            \"TDD\",\n            \"TDE\",\n            \"TDF\",\n            \"TDG\",\n            \"TDH\",\n            \"TDI\",\n            \"TDIV\",\n            \"TDJ\",\n            \"TDN\",\n            \"TDS\",\n            \"TDTF\",\n            \"TDTT\",\n            \"TDV\",\n            \"TDW\",\n            \"TDX\",\n            \"TDY\",\n            \"TE\",\n            \"TEAR\",\n            \"TECD\",\n            \"TECH\",\n            \"TECL\",\n            \"TECS\",\n            \"TECUA\",\n            \"TECUB\",\n            \"TEF\",\n            \"TEG\",\n            \"TEI\",\n            \"TEL\",\n            \"TELK\",\n            \"TEN\",\n            \"TENZ\",\n            \"TEO\",\n            \"TEP\",\n            \"TER\",\n            \"TESO\",\n            \"TESS\",\n            \"TEU\",\n            \"TEVA\",\n            \"TEX\",\n            \"TFCO\",\n            \"TFG\",\n            \"TFI\",\n            \"TFM\",\n            \"TFSL\",\n            \"TFX\",\n            \"TG\",\n            \"TGA\",\n            \"TGB\",\n            \"TGC\",\n            \"TGD\",\n            \"TGE\",\n            \"TGH\",\n            \"TGI\",\n            \"TGP\",\n            \"TGR\",\n            \"TGS\",\n            \"TGT\",\n            \"TGTX\",\n            \"TGX\",\n            \"THC\",\n            \"THD\",\n            \"THFF\",\n            \"THG\",\n            \"THGA\",\n            \"THHY\",\n            \"THI\",\n            \"THLD\",\n            \"THM\",\n            \"THO\",\n            \"THOR\",\n            \"THR\",\n            \"THRD\",\n            \"THRK\",\n            \"THRM\",\n            \"THRX\",\n            \"THS\",\n            \"THST\",\n            \"THTI\",\n            \"TI.A\",\n            \"TI\",\n            \"TIBX\",\n            \"TICC\",\n            \"TIF\",\n            \"TIGR\",\n            \"TILE\",\n            \"TILT\",\n            \"TINY\",\n            \"TIP\",\n            \"TIPT\",\n            \"TIPX\",\n            \"TIPZ\",\n            \"TIS\",\n            \"TISA\",\n            \"TISI\",\n            \"TITN\",\n            \"TIVO\",\n            \"TJX\",\n            \"TK\",\n            \"TKC\",\n            \"TKF\",\n            \"TKMR\",\n            \"TKR\",\n            \"TLAB\",\n            \"TLF\",\n            \"TLH\",\n            \"TLI\",\n            \"TLK\",\n            \"TLLP\",\n            \"TLM\",\n            \"TLO\",\n            \"TLP\",\n            \"TLR\",\n            \"TLT\",\n            \"TLTD\",\n            \"TLTE\",\n            \"TLYS\",\n            \"TM\",\n            \"TMF\",\n            \"TMH\",\n            \"TMHC\",\n            \"TMK\",\n            \"TMNG\",\n            \"TMO\",\n            \"TMP\",\n            \"TMS\",\n            \"TMUS\",\n            \"TMV\",\n            \"TNA\",\n            \"TNAV\",\n            \"TNC\",\n            \"TNDQ\",\n            \"TNGO\",\n            \"TNH\",\n            \"TNK\",\n            \"TNP\",\n            \"TNXP\",\n            \"TOFC\",\n            \"TOK\",\n            \"TOL\",\n            \"TOO\",\n            \"TOPS\",\n            \"TORM\",\n            \"TOT\",\n            \"TOWN\",\n            \"TOWR\",\n            \"TPC\",\n            \"TPGI\",\n            \"TPH\",\n            \"TPI\",\n            \"TPL\",\n            \"TPLM\",\n            \"TPRE\",\n            \"TPS\",\n            \"TPX\",\n            \"TPZ\",\n            \"TQNT\",\n            \"TQQQ\",\n            \"TR\",\n            \"TRAK\",\n            \"TRC\",\n            \"TRCB\",\n            \"TREE\",\n            \"TREX\",\n            \"TRF\",\n            \"TRGP\",\n            \"TRGT\",\n            \"TRI\",\n            \"TRIB\",\n            \"TRIP\",\n            \"TRIT\",\n            \"TRK\",\n            \"TRLA\",\n            \"TRMB\",\n            \"TRMK\",\n            \"TRMR\",\n            \"TRN\",\n            \"TRND\",\n            \"TRNM\",\n            \"TRNO\",\n            \"TRNS\",\n            \"TRNX\",\n            \"TROV\",\n            \"TROW\",\n            \"TROX\",\n            \"TRP\",\n            \"TRQ\",\n            \"TRR\",\n            \"TRS\",\n            \"TRST\",\n            \"TRT\",\n            \"TRV\",\n            \"TRW\",\n            \"TRX\",\n            \"TS\",\n            \"TSC\",\n            \"TSCO\",\n            \"TSEM\",\n            \"TSH\",\n            \"TSI\",\n            \"TSL\",\n            \"TSLA\",\n            \"TSLF\",\n            \"TSM\",\n            \"TSN\",\n            \"TSO\",\n            \"TSPT\",\n            \"TSRA\",\n            \"TSRE\",\n            \"TSRO\",\n            \"TSS\",\n            \"TST\",\n            \"TSU\",\n            \"TSYS\",\n            \"TTC\",\n            \"TTEC\",\n            \"TTEK\",\n            \"TTF\",\n            \"TTFS\",\n            \"TTGT\",\n            \"TTHI\",\n            \"TTI\",\n            \"TTM\",\n            \"TTMI\",\n            \"TTP\",\n            \"TTPH\",\n            \"TTS\",\n            \"TTT\",\n            \"TTWO\",\n            \"TU\",\n            \"TUC\",\n            \"TUES\",\n            \"TUMI\",\n            \"TUP\",\n            \"TUR\",\n            \"TUZ\",\n            \"TV\",\n            \"TVC\",\n            \"TVE\",\n            \"TVIX\",\n            \"TVIZ\",\n            \"TW\",\n            \"TWC\",\n            \"TWER\",\n            \"TWGP\",\n            \"TWI\",\n            \"TWIN\",\n            \"TWM\",\n            \"TWMC\",\n            \"TWN\",\n            \"TWO\",\n            \"TWTC\",\n            \"TWX\",\n            \"TX\",\n            \"TXI\",\n            \"TXMD\",\n            \"TXN\",\n            \"TXRH\",\n            \"TXT\",\n            \"TXTR\",\n            \"TY\",\n            \"TYBS\",\n            \"TYC\",\n            \"TYG\",\n            \"TYL\",\n            \"TYN\",\n            \"TYNS\",\n            \"TYO\",\n            \"TYPE\",\n            \"TYY\",\n            \"TZA\",\n            \"TZD\",\n            \"TZE\",\n            \"TZG\",\n            \"TZI\",\n            \"TZL\",\n            \"TZO\",\n            \"TZOO\",\n            \"TZV\",\n            \"TZY\",\n            \"UA\",\n            \"UACL\",\n            \"UAL\",\n            \"UAM\",\n            \"UAMY\",\n            \"UAN\",\n            \"UBA\",\n            \"UBC\",\n            \"UBCP\",\n            \"UBFO\",\n            \"UBG\",\n            \"UBIC\",\n            \"UBN\",\n            \"UBNK\",\n            \"UBNT\",\n            \"UBOH\",\n            \"UBP\",\n            \"UBS\",\n            \"UBSH\",\n            \"UBSI\",\n            \"UBT\",\n            \"UCBI\",\n            \"UCC\",\n            \"UCD\",\n            \"UCFC\",\n            \"UCI\",\n            \"UCO\",\n            \"UCP\",\n            \"UCTT\",\n            \"UDN\",\n            \"UDNT\",\n            \"UDOW\",\n            \"UDR\",\n            \"UEC\",\n            \"UEIC\",\n            \"UEPS\",\n            \"UFCS\",\n            \"UFI\",\n            \"UFPI\",\n            \"UFPT\",\n            \"UFS\",\n            \"UG\",\n            \"UGA\",\n            \"UGAZ\",\n            \"UGE\",\n            \"UGI\",\n            \"UGL\",\n            \"UGLD\",\n            \"UGP\",\n            \"UHAL\",\n            \"UHN\",\n            \"UHS\",\n            \"UHT\",\n            \"UIHC\",\n            \"UIL\",\n            \"UIS\",\n            \"UJB\",\n            \"UKK\",\n            \"UKW\",\n            \"UL\",\n            \"ULBI\",\n            \"ULE\",\n            \"ULTA\",\n            \"ULTI\",\n            \"ULTR\",\n            \"UMBF\",\n            \"UMC\",\n            \"UMDD\",\n            \"UMH\",\n            \"UMPQ\",\n            \"UMX\",\n            \"UN\",\n            \"UNAM\",\n            \"UNB\",\n            \"UNF\",\n            \"UNFI\",\n            \"UNG\",\n            \"UNH\",\n            \"UNIS\",\n            \"UNL\",\n            \"UNM\",\n            \"UNP\",\n            \"UNS\",\n            \"UNT\",\n            \"UNTD\",\n            \"UNTK\",\n            \"UNXL\",\n            \"UPG\",\n            \"UPI\",\n            \"UPIP\",\n            \"UPL\",\n            \"UPRO\",\n            \"UPS\",\n            \"UPV\",\n            \"UQM\",\n            \"URA\",\n            \"URBN\",\n            \"URE\",\n            \"URG\",\n            \"URI\",\n            \"URR\",\n            \"URRE\",\n            \"URS\",\n            \"URTH\",\n            \"URTY\",\n            \"URZ\",\n            \"USA\",\n            \"USAC\",\n            \"USAK\",\n            \"USAP\",\n            \"USAT\",\n            \"USATP\",\n            \"USB\",\n            \"USBI\",\n            \"USCI\",\n            \"USCR\",\n            \"USD\",\n            \"USEG\",\n            \"USG\",\n            \"USL\",\n            \"USLM\",\n            \"USLV\",\n            \"USM\",\n            \"USMD\",\n            \"USMI\",\n            \"USMO\",\n            \"USMV\",\n            \"USNA\",\n            \"USO\",\n            \"USPH\",\n            \"UST\",\n            \"USTR\",\n            \"USU\",\n            \"USV\",\n            \"UTEK\",\n            \"UTF\",\n            \"UTG\",\n            \"UTHR\",\n            \"UTI\",\n            \"UTIW\",\n            \"UTL\",\n            \"UTMD\",\n            \"UTSI\",\n            \"UTX\",\n            \"UUP\",\n            \"UUPT\",\n            \"UUU\",\n            \"UVE\",\n            \"UVSP\",\n            \"UVT\",\n            \"UVU\",\n            \"UVV\",\n            \"UVXY\",\n            \"UWC\",\n            \"UWM\",\n            \"UWN\",\n            \"UWTI\",\n            \"UXI\",\n            \"UYG\",\n            \"UYM\",\n            \"UZA\",\n            \"V\",\n            \"VAC\",\n            \"VAL\",\n            \"VALE.P\",\n            \"VALE\",\n            \"VALU\",\n            \"VAR\",\n            \"VASC\",\n            \"VAW\",\n            \"VB\",\n            \"VBF\",\n            \"VBFC\",\n            \"VBK\",\n            \"VBR\",\n            \"VC\",\n            \"VCBI\",\n            \"VCF\",\n            \"VCI\",\n            \"VCIT\",\n            \"VCLK\",\n            \"VCLT\",\n            \"VCO\",\n            \"VCR\",\n            \"VCRA\",\n            \"VCSH\",\n            \"VCV\",\n            \"VDC\",\n            \"VDE\",\n            \"VDSI\",\n            \"VE\",\n            \"VEA\",\n            \"VECO\",\n            \"VEGI\",\n            \"VELT\",\n            \"VET\",\n            \"VEU\",\n            \"VFC\",\n            \"VFH\",\n            \"VFL\",\n            \"VG\",\n            \"VGI\",\n            \"VGIT\",\n            \"VGK\",\n            \"VGLT\",\n            \"VGM\",\n            \"VGR\",\n            \"VGSH\",\n            \"VGT\",\n            \"VGZ\",\n            \"VHC\",\n            \"VHI\",\n            \"VHT\",\n            \"VIA\",\n            \"VIAB\",\n            \"VIAS\",\n            \"VICL\",\n            \"VICR\",\n            \"VIFL\",\n            \"VIG\",\n            \"VII\",\n            \"VIIX\",\n            \"VIIZ\",\n            \"VIMC\",\n            \"VIOG\",\n            \"VIOO\",\n            \"VIOV\",\n            \"VIP\",\n            \"VIPS\",\n            \"VIRC\",\n            \"VIS\",\n            \"VISN\",\n            \"VITC\",\n            \"VIV\",\n            \"VIVO\",\n            \"VIXM\",\n            \"VIXY\",\n            \"VKI\",\n            \"VKQ\",\n            \"VLCCF\",\n            \"VLGEA\",\n            \"VLO\",\n            \"VLRS\",\n            \"VLT\",\n            \"VLTC\",\n            \"VLUE\",\n            \"VLY\",\n            \"VMBS\",\n            \"VMC\",\n            \"VMEM\",\n            \"VMI\",\n            \"VMM\",\n            \"VMO\",\n            \"VMW\",\n            \"VNDA\",\n            \"VNET\",\n            \"VNM\",\n            \"VNO\",\n            \"VNOD\",\n            \"VNQ\",\n            \"VNQI\",\n            \"VNR\",\n            \"VNRAP\",\n            \"VNTV\",\n            \"VO\",\n            \"VOC\",\n            \"VOCS\",\n            \"VOD\",\n            \"VOE\",\n            \"VOLC\",\n            \"VONE\",\n            \"VONG\",\n            \"VONV\",\n            \"VOO\",\n            \"VOOG\",\n            \"VOOV\",\n            \"VOT\",\n            \"VOX\",\n            \"VOXX\",\n            \"VOYA\",\n            \"VPFG\",\n            \"VPG\",\n            \"VPHM\",\n            \"VPL\",\n            \"VPRT\",\n            \"VPU\",\n            \"VPV\",\n            \"VQT\",\n            \"VR\",\n            \"VRA\",\n            \"VRML\",\n            \"VRNG\",\n            \"VRNGW\",\n            \"VRNM\",\n            \"VRNT\",\n            \"VRS\",\n            \"VRSK\",\n            \"VRSN\",\n            \"VRTA\",\n            \"VRTB\",\n            \"VRTS\",\n            \"VRTU\",\n            \"VRTX\",\n            \"VRX\",\n            \"VSAT\",\n            \"VSB\",\n            \"VSCI\",\n            \"VSCP\",\n            \"VSEC\",\n            \"VSH\",\n            \"VSI\",\n            \"VSR\",\n            \"VSS\",\n            \"VSTM\",\n            \"VT\",\n            \"VTA\",\n            \"VTG\",\n            \"VTHR\",\n            \"VTI\",\n            \"VTIP\",\n            \"VTN\",\n            \"VTNC\",\n            \"VTNR\",\n            \"VTR\",\n            \"VTRB\",\n            \"VTSS\",\n            \"VTUS\",\n            \"VTV\",\n            \"VTWG\",\n            \"VTWO\",\n            \"VTWV\",\n            \"VUG\",\n            \"VV\",\n            \"VVC\",\n            \"VVI\",\n            \"VVR\",\n            \"VVTV\",\n            \"VVUS\",\n            \"VWO\",\n            \"VWOB\",\n            \"VXF\",\n            \"VXUS\",\n            \"VXX\",\n            \"VXZ\",\n            \"VYFC\",\n            \"VYM\",\n            \"VZ\",\n            \"WAB\",\n            \"WABC\",\n            \"WAC\",\n            \"WAFD\",\n            \"WAG\",\n            \"WAGE\",\n            \"WAIR\",\n            \"WAL\",\n            \"WASH\",\n            \"WAT\",\n            \"WAVX\",\n            \"WAYN\",\n            \"WBB\",\n            \"WBC\",\n            \"WBCO\",\n            \"WBK\",\n            \"WBMD\",\n            \"WBS\",\n            \"WCC\",\n            \"WCG\",\n            \"WCIC\",\n            \"WCN\",\n            \"WD\",\n            \"WDAY\",\n            \"WDC\",\n            \"WDFC\",\n            \"WDIV\",\n            \"WDR\",\n            \"WDTI\",\n            \"WEA\",\n            \"WEAT\",\n            \"WEC\",\n            \"WEN\",\n            \"WERN\",\n            \"WES\",\n            \"WETF\",\n            \"WEX\",\n            \"WEYS\",\n            \"WF\",\n            \"WFBI\",\n            \"WFC\",\n            \"WFD\",\n            \"WFM\",\n            \"WFT\",\n            \"WG\",\n            \"WGA\",\n            \"WGL\",\n            \"WGO\",\n            \"WGP\",\n            \"WH\",\n            \"WHF\",\n            \"WHFBL\",\n            \"WHG\",\n            \"WHLR\",\n            \"WHR\",\n            \"WHX\",\n            \"WHZ\",\n            \"WIA\",\n            \"WIBC\",\n            \"WIFI\",\n            \"WILC\",\n            \"WILN\",\n            \"WIN\",\n            \"WINA\",\n            \"WIP\",\n            \"WIRE\",\n            \"WIT\",\n            \"WITE\",\n            \"WIW\",\n            \"WLB\",\n            \"WLDN\",\n            \"WLFC\",\n            \"WLH\",\n            \"WLK\",\n            \"WLL\",\n            \"WLP\",\n            \"WLT\",\n            \"WM\",\n            \"WMAR\",\n            \"WMB\",\n            \"WMC\",\n            \"WMCR\",\n            \"WMGI\",\n            \"WMGIZ\",\n            \"WMK\",\n            \"WMS\",\n            \"WMT\",\n            \"WMW\",\n            \"WNC\",\n            \"WNR\",\n            \"WNS\",\n            \"WOOD\",\n            \"WOOF\",\n            \"WOR\",\n            \"WPC\",\n            \"WPCS\",\n            \"WPO\",\n            \"WPP\",\n            \"WPPGY\",\n            \"WPRT\",\n            \"WPS\",\n            \"WPT\",\n            \"WPX\",\n            \"WPZ\",\n            \"WR\",\n            \"WRB\",\n            \"WRD\",\n            \"WRE\",\n            \"WRES\",\n            \"WRI\",\n            \"WRLD\",\n            \"WRN\",\n            \"WSBC\",\n            \"WSBF\",\n            \"WSCI\",\n            \"WSFS\",\n            \"WSH\",\n            \"WSM\",\n            \"WSO\",\n            \"WSR\",\n            \"WST\",\n            \"WSTC\",\n            \"WSTG\",\n            \"WSTL\",\n            \"WTBA\",\n            \"WTFC\",\n            \"WTFCW\",\n            \"WTI\",\n            \"WTM\",\n            \"WTR\",\n            \"WTS\",\n            \"WTSL\",\n            \"WTT\",\n            \"WTW\",\n            \"WU\",\n            \"WVFC\",\n            \"WVVI\",\n            \"WWAV\",\n            \"WWD\",\n            \"WWE\",\n            \"WWW\",\n            \"WWWW\",\n            \"WX\",\n            \"WY\",\n            \"WYN\",\n            \"WYNN\",\n            \"WYY\",\n            \"X\",\n            \"XAA\",\n            \"XAR\",\n            \"XBI\",\n            \"XBKS\",\n            \"XCO\",\n            \"XEC\",\n            \"XEL\",\n            \"XES\",\n            \"XFP\",\n            \"XFR\",\n            \"XGTI\",\n            \"XGTIW\",\n            \"XHB\",\n            \"XHS\",\n            \"XIN\",\n            \"XIV\",\n            \"XKE\",\n            \"XL\",\n            \"XLB\",\n            \"XLE\",\n            \"XLF\",\n            \"XLG\",\n            \"XLI\",\n            \"XLK\",\n            \"XLNX\",\n            \"XLP\",\n            \"XLRN\",\n            \"XLS\",\n            \"XLU\",\n            \"XLV\",\n            \"XLY\",\n            \"XME\",\n            \"XMLV\",\n            \"XMPT\",\n            \"XNPT\",\n            \"XNY\",\n            \"XOM\",\n            \"XOMA\",\n            \"XON\",\n            \"XONE\",\n            \"XOOM\",\n            \"XOP\",\n            \"XOVR\",\n            \"XOXO\",\n            \"XPH\",\n            \"XPL\",\n            \"XPLR\",\n            \"XPO\",\n            \"XPP\",\n            \"XRA\",\n            \"XRAY\",\n            \"XRM\",\n            \"XRS\",\n            \"XRSC\",\n            \"XRT\",\n            \"XRTX\",\n            \"XRX\",\n            \"XSD\",\n            \"XSLV\",\n            \"XSW\",\n            \"XTEX\",\n            \"XTL\",\n            \"XTLB\",\n            \"XTN\",\n            \"XTXI\",\n            \"XUE\",\n            \"XVG\",\n            \"XVZ\",\n            \"XWES\",\n            \"XXIA\",\n            \"XXV\",\n            \"XYL\",\n            \"Y\",\n            \"YANG\",\n            \"YAO\",\n            \"YCL\",\n            \"YCS\",\n            \"YDIV\",\n            \"YDKN\",\n            \"YELP\",\n            \"YGE\",\n            \"YHOO\",\n            \"YINN\",\n            \"YMLI\",\n            \"YMLP\",\n            \"YNDX\",\n            \"YOD\",\n            \"YOKU\",\n            \"YONG\",\n            \"YORW\",\n            \"YPF\",\n            \"YRCW\",\n            \"YUM\",\n            \"YUME\",\n            \"YXI\",\n            \"YY\",\n            \"YYY\",\n            \"YZC\",\n            \"Z\",\n            \"ZA\",\n            \"ZAGG\",\n            \"ZAZA\",\n            \"ZBB\",\n            \"ZBK\",\n            \"ZBRA\",\n            \"ZEP\",\n            \"ZEUS\",\n            \"ZF\",\n            \"ZFC\",\n            \"ZGNX\",\n            \"ZHNE\",\n            \"ZIGO\",\n            \"ZINC\",\n            \"ZION\",\n            \"ZIONW\",\n            \"ZIONZ\",\n            \"ZIOP\",\n            \"ZIPR\",\n            \"ZIV\",\n            \"ZIXI\",\n            \"ZLC\",\n            \"ZLCS\",\n            \"ZLTQ\",\n            \"ZMH\",\n            \"ZN\",\n            \"ZNGA\",\n            \"ZNH\",\n            \"ZOLT\",\n            \"ZOOM\",\n            \"ZQK\",\n            \"ZROZ\",\n            \"ZSL\",\n            \"ZTR\",\n            \"ZTS\",\n            \"ZUMZ\",\n            \"ZX\"\n        };\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/StressSymbolsAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Randomly selects the specified number of symbols from the lists below\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class StressSymbolsAlgorithm : QCAlgorithm\n    {\n        public const int TickSymbolsToRun = 0;\n        public const int SecondSymbolsToRun = 0;\n        public const int MinuteSymbolsToRun = 0;\n        public const int HourSymbolsToRun = 0;\n        public const int DailySymbolsToRun = 1000;\n\n        /// <summary>\n        /// Add Hundreds of Stock and Forex Symbol\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2001, 10, 07);\n            SetEndDate(2010, 10, 11);\n            SetCash(250000);\n\n            var allSymbols = StressSymbols.StockSymbols.ToList();//.Concat(ForexSymbols).ToList();\n            if (TickSymbolsToRun + SecondSymbolsToRun + HourSymbolsToRun + DailySymbolsToRun > allSymbols.Count)\n            {\n                throw new RegressionTestException(\"Too many symbols, all symbols: \" + allSymbols.Count);\n            }\n\n\n            var hash = new HashSet<string> {\"DNY\", \"MLNK\"};\n            var ticks = GetRandomSymbols(allSymbols, hash, TickSymbolsToRun).ToList();\n            var seconds = GetRandomSymbols(allSymbols, hash, SecondSymbolsToRun).ToList();\n            var minutes = GetRandomSymbols(allSymbols, hash, MinuteSymbolsToRun).ToList();\n            var hours = GetRandomSymbols(allSymbols, hash, HourSymbolsToRun).ToList();\n            var daily = GetRandomSymbols(allSymbols, hash, DailySymbolsToRun).ToList();\n\n            AddSecurity(ticks, Resolution.Tick);\n            AddSecurity(seconds, Resolution.Second);\n            AddSecurity(minutes, Resolution.Minute);\n            AddSecurity(hours, Resolution.Hour);\n            AddSecurity(daily, Resolution.Daily);\n\n            //SetUniverse(coarse => coarse.Take(1));\n        }\n\n        private void AddSecurity(IEnumerable<string> symbols, Resolution resolution)\n        {\n            foreach (var symbol in symbols)\n            {\n                var securityType = StressSymbols.ForexSymbols.Contains(symbol) ? SecurityType.Forex : SecurityType.Equity;\n                AddSecurity(securityType, symbol, resolution);\n            }\n        }\n\n        private IEnumerable<string> GetRandomSymbols(List<string> allSymbols, HashSet<string> hash, int numberOfSymbols)\n        {\n            return Enumerable.Range(0, numberOfSymbols).Select(x => GetRandomItem(allSymbols, hash));\n        }\n\n        private readonly Random _random = new Random();\n        private string GetRandomItem(IReadOnlyList<string> list, HashSet<string> hash)\n        {\n            var count = 0;\n            string item;\n            do\n            {\n                item = list[_random.Next(list.Count)];\n                count++;\n            }\n            while (!hash.Add(item) && count < list.Count*2);\n            return item;\n        }\n\n        /// <summary>\n        /// data event handler\n        /// </summary>\n        public override void OnData(Slice slice)\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.CSharp/StrictEndTimeLowerResolutionFillForwardRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting fill forwarded data behavior for consolidators and indicators.\n    /// 1. Test that the on-consolidated event is not called for fill forwarded data in identity and higher period consolidators\n    /// 2. Test that the intra-day fill-forwarded data is not fed to indicators\n    /// </summary>\n    public class StrictEndTimeLowerResolutionFillForwardRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _aapl;\n\n        private BaseData _lastNonFilledForwardedData;\n        private int _dataCount;\n        private int _indicatorUpdateCount;\n\n        protected virtual bool ExtendedMarketHours => false;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 30);\n\n            Settings.DailyPreciseEndTime = true;\n\n            // Fill forward resolution will be minute\n            AddEquity(\"SPY\", Resolution.Minute);\n            _aapl = AddEquity(\"AAPL\", Resolution.Daily, extendedMarketHours: ExtendedMarketHours);\n\n            var tradableDates = QuantConnect.Time.EachTradeableDayInTimeZone(_aapl.Exchange.Hours, StartDate, EndDate,\n                _aapl.Exchange.TimeZone, _aapl.IsExtendedMarketHours).ToList();\n\n            TestIdentityConsolidator(tradableDates);\n            TestHigherPeriodConsolidator(tradableDates);\n            TestIndicator(tradableDates);\n        }\n\n        private void TestIdentityConsolidator(List<DateTime> tradableDates)\n        {\n            var i = 0;\n            var consolidator = Consolidate<TradeBar>(_aapl.Symbol, TimeSpan.FromDays(1), (bar) =>\n            {\n                var expectedDate = tradableDates[i++];\n                var schedule = LeanData.GetDailyCalendar(expectedDate.AddDays(1), _aapl.Exchange, false);\n\n                if (bar.Time != schedule.Start || bar.EndTime != schedule.End)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidated bar time. \" +\n                        $\"Expected: [{schedule.Start} - {schedule.End}], Actual: [{bar.Time} - {bar.EndTime}]\");\n                }\n\n                Debug($\"Consolidated (identity) :: {bar}\");\n            });\n\n            if (consolidator is not IdentityDataConsolidator<TradeBar>)\n            {\n                throw new RegressionTestException($\"Unexpected consolidator type. \" +\n                    $\"Expected {typeof(IdentityDataConsolidator<TradeBar>)} but was {consolidator.GetType()}\");\n            }\n        }\n\n        private void TestHigherPeriodConsolidator(List<DateTime> tradableDates)\n        {\n            var i = 0;\n            // Add a consolidator to assert that fill forward data is not used\n            Consolidate<TradeBar>(_aapl.Symbol, TimeSpan.FromDays(2), (bar) =>\n            {\n                var expectedStartDate = tradableDates[i++];\n                var startDateSchedule = LeanData.GetDailyCalendar(expectedStartDate.AddDays(1), _aapl.Exchange, false);\n\n                var expectedStartTime = startDateSchedule.Start;\n                var expectedEndTime = expectedStartTime.AddDays(2);\n\n                if (bar.Time != expectedStartTime || bar.EndTime != expectedEndTime)\n                {\n                    throw new RegressionTestException($\"Unexpected consolidated bar time. \" +\n                        $\"Expected: [{expectedStartTime} - {expectedEndTime}], Actual: [{bar.Time} - {bar.EndTime}]\");\n                }\n\n                if (tradableDates[i] == expectedStartDate.AddDays(1))\n                {\n                    i++;\n                }\n\n                Debug($\"Consolidated (2 days) :: {bar}\");\n            });\n        }\n\n        private void TestIndicator(List<DateTime> tradableDates)\n        {\n            var i = 0;\n            EMA(_aapl.Symbol, 3, Resolution.Daily).Updated += (sender, data) =>\n            {\n                _indicatorUpdateCount++;\n\n                var expectedEndTime = _aapl.Exchange.Hours.GetNextMarketClose(tradableDates[i++], false);\n                if (data.EndTime != expectedEndTime)\n                {\n                    throw new RegressionTestException($\"Unexpected EMA time. Expected: {expectedEndTime}, Actual: {data.EndTime}\");\n                }\n\n                Debug($\"EMA :: [{data.EndTime}] {data}\");\n            };\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.TryGetValue(_aapl.Symbol, out var data))\n            {\n                var baseData = data as BaseData;\n                if (!baseData.IsFillForward)\n                {\n                    _lastNonFilledForwardedData = baseData;\n                }\n\n                var timeInExchangeTz = UtcTime.ConvertFromUtc(_aapl.Exchange.TimeZone);\n                var daySchedule = LeanData.GetDailyCalendar(timeInExchangeTz, _aapl.Exchange, false);\n\n                if (timeInExchangeTz == daySchedule.End)\n                {\n                    if (baseData.IsFillForward)\n                    {\n                        throw new RegressionTestException(\"End of day data should not be fill forward for daily subscription when data is available\");\n                    }\n                }\n                else\n                {\n                    if (!baseData.IsFillForward\n                        || _lastNonFilledForwardedData == null\n                        || _lastNonFilledForwardedData.Time.Date != baseData.Time.Date\n                        || _lastNonFilledForwardedData.EndTime.Date != baseData.EndTime.Date)\n                    {\n                        throw new RegressionTestException(\"Data should be fill forward to minute resolution during the day\");\n                    }\n                }\n\n                _dataCount++;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var tradableDates = QuantConnect.Time.EachTradeableDay(_aapl, StartDate.AddDays(1), EndDate, ExtendedMarketHours);\n            var tradableDatesCount = 1;\n            var expectedDataCount = 1; // One for the first day\n            foreach (var date in tradableDates)\n            {\n                tradableDatesCount++;\n                var hours = _aapl.Exchange.Hours.GetMarketHours(date);\n                foreach (var segment in hours.Segments)\n                {\n                    if (ExtendedMarketHours || segment.State == MarketHoursState.Market)\n                    {\n                        expectedDataCount += (int)(segment.End - segment.Start).TotalMinutes;\n                    }\n                }\n            }\n\n            if (_dataCount != expectedDataCount)\n            {\n                throw new RegressionTestException($\"Unexpected data count. Expected: {expectedDataCount}, Actual: {_dataCount}\");\n            }\n\n            if (_indicatorUpdateCount != tradableDatesCount)\n            {\n                throw new RegressionTestException($\"Unexpected indicator update count. Expected: {tradableDatesCount}, Actual: {_indicatorUpdateCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 20805;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-7.12\"},\n            {\"Tracking Error\", \"0.109\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StrictEndTimeLowerResolutionFillForwardWithExtendedMarketHoursRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting fill forwarded data behavior for consolidators and indicators.\n    /// 1. Test that the on-consolidated event is not called for fill forwarded data in identity and higher period consolidators\n    /// 2. Test that the intra-day fill-forwarded data is not fed to indicators\n    /// </summary>\n    public class StrictEndTimeLowerResolutionFillForwardWithExtendedMarketHoursRegressionAlgorithm : StrictEndTimeLowerResolutionFillForwardRegressionAlgorithm\n    {\n        protected override bool ExtendedMarketHours => true;\n\n        public override long DataPoints => 30495;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/StringToSymbolImplicitConversionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Related to GH issue 4275, reproduces a failed string to symbol implicit conversion asserting the exception\n    /// thrown contains the used ticker\n    /// </summary>\n    public class StringToSymbolImplicitConversionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            AddEquity(\"SPY\", Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var ticket = MarketOrder(\"PEPE\", 1);\n\n            if (ticket.Status != OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Expected order to be invalid since PEPE is not a valid ticker, but was {ticket.Status}\");\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1583;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98824.68\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"49.82%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/SwitchDataModeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression test algorithm reproduces issue https://github.com/QuantConnect/Lean/issues/4031 \n    /// fixed in PR https://github.com/QuantConnect/Lean/pull/4650\n    /// Adjusted data have already been all loaded by the workers so DataNormalizationMode change has no effect in the data itself\n    /// </summary>\n    public class SwitchDataModeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"AAPL\";\n\n        private readonly Dictionary<DateTime, decimal?> _expectedCloseValues = new Dictionary<DateTime, decimal?>() {\n            { new DateTime(2014, 6, 6, 9, 57, 0), 20.83533m},\n            { new DateTime(2014, 6, 6, 9, 58, 0), 20.83565m},\n            { new DateTime(2014, 6, 6, 9, 59, 0), 648.37m},\n            { new DateTime(2014, 6, 6, 10, 0, 0), 647.86m},\n            { new DateTime(2014, 6, 6, 10, 1, 0), 646.83m},\n            { new DateTime(2014, 6, 6, 10, 2, 0), 647.79m},\n            { new DateTime(2014, 6, 6, 10, 3, 0), 646.92m}\n        };\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 6, 6);\n            SetEndDate(2014, 6, 6);\n\n            var aapl = AddEquity(UnderlyingTicker, Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Hour == 9 && Time.Minute == 58)\n            {\n                var option = AddOption(UnderlyingTicker);\n                option.SetFilter(u => u.StandardsOnly().Strikes(-1, 1).Expiration(0, 35));\n            }\n\n            AssertValue(slice);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_expectedCloseValues.Count > 0)\n            {\n                throw new RegressionTestException($\"Not all expected data points were received.\");\n            }\n        }\n\n        private void AssertValue(Slice data)\n        {\n            decimal? value;\n            if (_expectedCloseValues.TryGetValue(data.Time, out value))\n            {\n                if (data.Bars.FirstOrDefault().Value?.Close.SmartRounding() != value)\n                {\n                    throw new RegressionTestException($\"Expected tradebar price, expected {value} but was {data.Bars.First().Value.Close.SmartRounding()}\");\n                }\n\n                _expectedCloseValues.Remove(data.Time);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7562;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickDataFilteringAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration of filtering tick data so easier to use. Tick data has lots of glitchy, spikey data which should be filtered out before usagee.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"filtering\" />\n    /// <meta name=\"tag\" content=\"tick data\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"ticks event\" />\n    public class TickDataFilteringAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private DateTime _orderTime;\n\n        /// <summary>\n        /// Initialize the tick filtering example algorithm\n        /// </summary>\n        public override void Initialize()\n        {\n            SetCash(25000);\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 07);\n            var spy = AddEquity(\"SPY\", Resolution.Tick);\n\n            //Add our custom data filter.\n            spy.SetDataFilter(new TickExchangeDataFilter(this));\n        }\n\n        /// <summary>\n        /// Data arriving here will now be filtered.\n        /// </summary>\n        /// <param name=\"slice\">Ticks data array</param>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.ContainsKey(\"SPY\")) return;\n            var spyTickList = slice[\"SPY\"];\n\n            //Ticks return a list of ticks this second\n            foreach (var tick in spyTickList)\n            {\n                Debug(tick.Exchange);\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"SPY\", 1);\n                _orderTime = Time;\n            }\n            // Let's shortcut to reduce regression test duration\n            else if (Time - _orderTime > TimeSpan.FromMinutes(5))\n            {\n                Quit();\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 26983;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"25000\"},\n            {\"End Equity\", \"25009.41\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"99.55%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"96e039d2b3ee8fccf0e161367ee78629\"}\n        };\n    }\n\n    /// <summary>\n    /// Exchange filter class\n    /// </summary>\n    public class TickExchangeDataFilter : ISecurityDataFilter\n    {\n        private IAlgorithm _algo;\n\n        /// <summary>\n        /// Save instance of the algorithm namespace\n        /// </summary>\n        /// <param name=\"algo\"></param>\n        public TickExchangeDataFilter(IAlgorithm algo)\n        {\n            _algo = algo;\n        }\n\n        /// <summary>\n        /// Filter out a tick from this vehicle, with this new data:\n        /// </summary>\n        /// <param name=\"vehicle\">New data packet:</param>\n        /// <param name=\"asset\">Vehicle of this filter.</param>\n        public bool Filter(Security vehicle, BaseData data)\n        {\n            // TRUE -->  Accept Tick\n            // FALSE --> Reject Tick\n            var tick = data as Tick;\n\n            // This is a tick bar\n            if (tick != null)\n            {\n                if (tick.Exchange == Exchange.ARCA)\n                {\n                    return true;\n                }\n            }\n\n            //Only allow those exchanges through.\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that historical data can be requested with tick resolution without requiring\n    /// a tick resolution subscription\n    /// </summary>\n    public class TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 8);\n            SetEndDate(2013, 10, 8);\n\n            // Subscribing SPY and IBM with daily and hour resolution instead of tick resolution\n            var spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            var ibm = AddEquity(\"IBM\", Resolution.Hour).Symbol;\n\n            // Requesting history for SPY and IBM (separately) with tick resolution\n            var spyHistory = History<Tick>(spy, TimeSpan.FromDays(1), Resolution.Tick);\n            if (!spyHistory.Any())\n            {\n                throw new RegressionTestException(\"SPY tick history is empty\");\n            }\n\n            var ibmHistory = History<Tick>(ibm, TimeSpan.FromDays(1), Resolution.Tick);\n            if (!ibmHistory.Any())\n            {\n                throw new RegressionTestException(\"IBM tick history is empty\");\n            }\n\n            // Requesting history for SPY and IBM (together) with tick resolution\n            var spyIbmHistory = History<Tick>(new [] { spy, ibm }, TimeSpan.FromDays(1), Resolution.Tick);\n            if (!spyIbmHistory.Any())\n            {\n                throw new RegressionTestException(\"Compound SPY and IBM tick history is empty\");\n            }\n\n            Quit();\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 32;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickQuoteBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the TickQuoteBarConsolidator with tick data.\n    /// The SubscriptionManager.AddConsolidator method uses a null TickType since none is specified.\n    /// It checks if data consolidation occurs as expected for the given time period. If consolidation does not happen, a RegressionTestException is thrown.\n    /// </summary>\n    public class TickQuoteBarConsolidatorWithDefaultTickTypeRegressionAlgorithm : TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm\n    {\n        protected override void AddConsolidator(TickQuoteBarConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the TickQuoteBarConsolidator with tick data.\n    /// The SubscriptionManager.AddConsolidator method uses a Quote TickType\n    /// It checks if data consolidation occurs as expected for the given time period. If consolidation does not happen, a RegressionTestException is thrown.\n    /// </summary>\n    public class TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, TickQuoteBarConsolidator> _consolidators = new Dictionary<Symbol, TickQuoteBarConsolidator>();\n        private bool _itWasConsolidated;\n        protected Future GoldFuture { get; set; }\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 9);\n\n            GoldFuture = AddFuture(\"GC\", Resolution.Tick, Market.COMEX);\n            GoldFuture.SetFilter(0, 180);\n        }\n\n        private void OnConsolidated(object sender, QuoteBar bar)\n        {\n            _itWasConsolidated = true;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_consolidators.ContainsKey(GoldFuture.Mapped))\n            {\n                var consolidator = new TickQuoteBarConsolidator(TimeSpan.FromSeconds(10));\n                consolidator.DataConsolidated += OnConsolidated;\n                AddConsolidator(consolidator);\n                _consolidators[GoldFuture.Mapped] = consolidator;\n            }\n        }\n\n        protected virtual void AddConsolidator(TickQuoteBarConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator, TickType.Quote);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_itWasConsolidated)\n            {\n                throw new RegressionTestException(\"TickQuoteBarConsolidator did not consolidate any data.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1082920;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.524\"},\n            {\"Tracking Error\", \"0.136\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the TickConsolidator with tick data.\n    /// The SubscriptionManager.AddConsolidator method uses a null TickType since none is specified.\n    /// It checks if data consolidation occurs as expected for the given time period. If consolidation does not happen, a RegressionTestException is thrown.\n    /// </summary>\n    public class TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Dictionary<Symbol, TickConsolidator> _consolidators = new Dictionary<Symbol, TickConsolidator>();\n        protected bool ItWasConsolidated { get; set; }\n        protected Future GoldFuture { get; set; }\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 9);\n\n            GoldFuture = AddFuture(\"GC\", Resolution.Tick, Market.COMEX);\n            GoldFuture.SetFilter(0, 180);\n        }\n\n        private void OnConsolidated(object sender, TradeBar bar)\n        {\n            ItWasConsolidated = true;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!_consolidators.ContainsKey(GoldFuture.Mapped))\n            {\n                var consolidator = new TickConsolidator(TimeSpan.FromSeconds(10));\n                consolidator.DataConsolidated += OnConsolidated;\n                AddConsolidator(consolidator);\n                _consolidators[GoldFuture.Mapped] = consolidator;\n            }\n        }\n\n        protected virtual void AddConsolidator(TickConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!ItWasConsolidated)\n            {\n                throw new RegressionTestException(\"TickConsolidator did not consolidate any data.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1082920;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"5.524\"},\n            {\"Tracking Error\", \"0.136\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickTradeBarConsolidatorWithQuoteTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the TickConsolidator with tick data.\n    /// The SubscriptionManager.AddConsolidator method uses a Quote TickType\n    /// It checks if data consolidation does not occur when the algorithm is running. If consolidation happens, a RegressionTestException is thrown.\n    /// </summary>\n    public class TickTradeBarConsolidatorWithQuoteTickTypeRegressionAlgorithm : TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm\n    {\n        protected override void AddConsolidator(TickConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator, TickType.Quote);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (ItWasConsolidated)\n            {\n                throw new RegressionTestException(\"TickConsolidator should not have consolidated Quote ticks.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TickTradeBarConsolidatorWithTradeTickTypeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm tests the functionality of the TickConsolidator with tick data.\n    /// The SubscriptionManager.AddConsolidator method uses a Trade TickType\n    /// It checks if data consolidation occurs as expected for the given time period. If consolidation does not happen, a RegressionTestException is thrown.\n    /// </summary>\n    public class TickTradeBarConsolidatorWithTradeTickTypeRegressionAlgorithm : TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm\n    {\n        protected override void AddConsolidator(TickConsolidator consolidator)\n        {\n            SubscriptionManager.AddConsolidator(GoldFuture.Mapped, consolidator, TickType.Trade);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TiingoPriceAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.Tiingo;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This example algorithm shows how to import and use Tiingo daily prices data.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"strategy example\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"custom data\" />\n    /// <meta name=\"tag\" content=\"tiingo\" />\n    public class TiingoPriceAlgorithm : QCAlgorithm\n    {\n        private const string Ticker = \"AAPL\";\n        private Symbol _symbol;\n\n        private ExponentialMovingAverage _emaFast;\n        private ExponentialMovingAverage _emaSlow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2017, 1, 1);\n            SetEndDate(2017, 12, 31);\n            SetCash(100000);\n\n            // Set your Tiingo API Token here\n            Tiingo.SetAuthCode(\"my-tiingo-api-token\");\n\n            _symbol = AddData<TiingoPrice>(Ticker, Resolution.Daily).Symbol;\n\n            _emaFast = EMA(_symbol, 5);\n            _emaSlow = EMA(_symbol, 10);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // Extract Tiingo data from the slice\n            var tiingoData = slice.Get<TiingoPrice>();\n            foreach (var row in tiingoData.Values)\n            {\n                Log($\"{Time} - {row.Symbol.Value} - {row.Close} {row.Value} {row.Price} - EmaFast:{_emaFast} - EmaSlow:{_emaSlow}\");\n            }\n\n            // Simple EMA cross\n            if (!Portfolio.Invested && _emaFast > _emaSlow)\n            {\n                SetHoldings(_symbol, 1);\n            }\n            else if (Portfolio.Invested && _emaFast < _emaSlow)\n            {\n                Liquidate(_symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TimeInForceAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration algorithm of time in force order settings.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    public class TimeInForceAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _symbol;\n        private OrderTicket _gtcOrderTicket1, _gtcOrderTicket2;\n        private OrderTicket _dayOrderTicket1, _dayOrderTicket2;\n        private OrderTicket _gtdOrderTicket1, _gtdOrderTicket2;\n        private readonly Dictionary<int, OrderStatus> _expectedOrderStatuses = new Dictionary<int, OrderStatus>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            // The default time in force setting for all orders is GoodTilCancelled (GTC),\n            // uncomment this line to set a different time in force.\n            // We currently only support GTC, DAY, GTD.\n            // DefaultOrderProperties.TimeInForce = TimeInForce.Day;\n\n            _symbol = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_gtcOrderTicket1 == null)\n            {\n                // These GTC orders will never expire and will not be canceled automatically.\n\n                DefaultOrderProperties.TimeInForce = TimeInForce.GoodTilCanceled;\n\n                // this order will not be filled before the end of the backtest\n                _gtcOrderTicket1 = LimitOrder(_symbol, 10, 100m);\n                _expectedOrderStatuses.Add(_gtcOrderTicket1.OrderId, OrderStatus.Submitted);\n\n                // this order will be filled before the end of the backtest\n                _gtcOrderTicket2 = LimitOrder(_symbol, 10, 160m);\n                _expectedOrderStatuses.Add(_gtcOrderTicket2.OrderId, OrderStatus.Filled);\n            }\n\n            if (_dayOrderTicket1 == null)\n            {\n                // These DAY orders will expire at market close,\n                // if not filled by then they will be canceled automatically.\n\n                DefaultOrderProperties.TimeInForce = TimeInForce.Day;\n\n                // this order will not be filled before market close and will be canceled\n                _dayOrderTicket1 = LimitOrder(_symbol, 10, 140m);\n                _expectedOrderStatuses.Add(_dayOrderTicket1.OrderId, OrderStatus.Canceled);\n\n                // this order will be filled before market close\n                _dayOrderTicket2 = LimitOrder(_symbol, 10, 180m);\n                _expectedOrderStatuses.Add(_dayOrderTicket2.OrderId, OrderStatus.Filled);\n            }\n\n            if (_gtdOrderTicket1 == null)\n            {\n                // These GTD orders will expire on October 10th at market close,\n                // if not filled by then they will be canceled automatically.\n\n                DefaultOrderProperties.TimeInForce = TimeInForce.GoodTilDate(new DateTime(2013, 10, 10));\n\n                // this order will not be filled before expiry and will be canceled\n                _gtdOrderTicket1 = LimitOrder(_symbol, 10, 100m);\n                _expectedOrderStatuses.Add(_gtdOrderTicket1.OrderId, OrderStatus.Canceled);\n\n                // this order will be filled before expiry\n                _gtdOrderTicket2 = LimitOrder(_symbol, 10, 160m);\n                _expectedOrderStatuses.Add(_gtdOrderTicket2.OrderId, OrderStatus.Filled);\n            }\n        }\n\n        /// <summary>\n        /// Order event handler. This handler will be called for all order events, including submissions, fills, cancellations.\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event instance containing details of the event</param>\n        /// <remarks>This method can be called asynchronously, ensure you use proper locks on thread-unsafe objects</remarks>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"{Time} {orderEvent}\");\n        }\n\n        /// <summary>\n        /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation.\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var kvp in _expectedOrderStatuses)\n            {\n                var orderId = kvp.Key;\n                var expectedStatus = kvp.Value;\n\n                var order = Transactions.GetOrderById(orderId);\n\n                if (order.Status != expectedStatus)\n                {\n                    throw new RegressionTestException($\"Invalid status for order {orderId} - Expected: {expectedStatus}, actual: {order.Status}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"6\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"5.659%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100070.41\"},\n            {\"Net Profit\", \"0.070%\"},\n            {\"Sharpe Ratio\", \"4.241\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"67.468%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.044\"},\n            {\"Beta\", \"0.043\"},\n            {\"Annual Standard Deviation\", \"0.01\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-9.086\"},\n            {\"Tracking Error\", \"0.213\"},\n            {\"Treynor Ratio\", \"0.944\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$44000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.87%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"a0588650916ed396fb5793375118e7b3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TimeRulesDefaultTimeZoneRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which reproduces GH issue 3740.\n    /// We assert the methods are triggered at the correct algorithm time\n    /// </summary>\n    public class TimeRulesDefaultTimeZoneRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _scheduleEventEveryCallCount;\n        private int _scheduleEventNoonCallCount;\n        private int _scheduleEventMidnightCallCount;\n        private int _selectionMethodCallCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2017, 01, 01);\n            SetEndDate(2017, 02, 01);\n\n            SetUniverseSelection(new ScheduledUniverseSelectionModel(\n                DateRules.EveryDay(),\n                TimeRules.At(9, 31),\n                SelectSymbolsAt\n            ));\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(6)), () =>\n            {\n                _scheduleEventEveryCallCount++;\n                if (Time.Hour != 0\n                    && Time.Hour != 6\n                    && Time.Hour != 12\n                    && Time.Hour != 18)\n                {\n                    throw new RegressionTestException($\"Unexpected every 6 hours scheduled event time: {Time}\");\n                }\n            });\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Noon, () =>\n            {\n                _scheduleEventNoonCallCount++;\n                if (Time.Hour != 12)\n                {\n                    throw new RegressionTestException($\"Unexpected Noon scheduled event time: {Time}\");\n                }\n            });\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Midnight, () =>\n            {\n                _scheduleEventMidnightCallCount++;\n                if (Time.Hour != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected Midnight scheduled event time: {Time}\");\n                }\n            });\n        }\n\n        private IEnumerable<Symbol> SelectSymbolsAt(DateTime dateTime)\n        {\n            _selectionMethodCallCount++;\n            Log($\"SelectSymbolsAt {Time}\");\n            if (Time.TimeOfDay != new TimeSpan(9, 31, 0))\n            {\n                throw new RegressionTestException($\"Expected 'SelectSymbolsAt' to be called at 9:31 algorithm time: {Time}\");\n            }\n            yield break;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionMethodCallCount != 32)\n            {\n                throw new RegressionTestException($\"Unexpected universe selection call count: {_selectionMethodCallCount}\");\n            }\n            if (_scheduleEventEveryCallCount != 130)\n            {\n                throw new RegressionTestException($\"Unexpected scheduled event call count: {_scheduleEventEveryCallCount}\");\n            }\n            if (_scheduleEventNoonCallCount != 32)\n            {\n                throw new RegressionTestException($\"Unexpected scheduled event call count: {_scheduleEventNoonCallCount}\");\n            }\n            if (_scheduleEventMidnightCallCount != 33)\n            {\n                throw new RegressionTestException($\"Unexpected scheduled event call count: {_scheduleEventMidnightCallCount}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 187;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-2.962\"},\n            {\"Tracking Error\", \"0.052\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TotalPortfolioValueRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm aims to test the TotalPortfolioValue,\n    /// verifying its correctly updated (GH issue 3272)\n    /// </summary>\n    public class  TotalPortfolioValueRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _symbols = new List<Symbol>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2016, 1, 1);\n            SetEndDate(2017, 1, 1);\n            SetCash(100000);\n\n            var securitiesToAdd = new List<string>\n            {\n                \"SPY\", \"AAPL\", \"AAA\", \"GOOG\", \"GOOGL\", \"IBM\", \"QQQ\", \"FB\", \"WM\", \"WMI\", \"BAC\", \"USO\", \"IWM\", \"EEM\", \"BNO\", \"AIG\"\n            };\n            foreach (var symbolStr in securitiesToAdd)\n            {\n                var security = AddEquity(symbolStr, Resolution.Daily);\n                security.SetLeverage(100);\n                _symbols.Add(security.Symbol);\n            }\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.Invested)\n            {\n                Liquidate();\n            }\n            else\n            {\n                foreach (var symbol in _symbols)\n                {\n                    SetHoldings(symbol, 10m / _symbols.Count);\n                }\n\n                // We will add some cash just for testing, users should not do this\n                var totalPortfolioValueSnapshot = Portfolio.TotalPortfolioValue;\n                var accountCurrencyCash = Portfolio.CashBook[AccountCurrency];\n                var existingAmount = accountCurrencyCash.Amount;\n\n                // increase cash amount\n                Portfolio.CashBook.Add(AccountCurrency, existingAmount * 1.1m, 1);\n\n                if (totalPortfolioValueSnapshot * 1.1m != Portfolio.TotalPortfolioValue)\n                {\n                    throw new RegressionTestException($\"Unexpected TotalPortfolioValue {Portfolio.TotalPortfolioValue}.\" +\n                        $\" Expected: {totalPortfolioValueSnapshot * 1.1m}\");\n                }\n\n                // lets remove part of what we added\n                Portfolio.CashBook[AccountCurrency].AddAmount(-existingAmount * 0.05m);\n\n                if (totalPortfolioValueSnapshot * 1.05m != Portfolio.TotalPortfolioValue)\n                {\n                    throw new RegressionTestException($\"Unexpected TotalPortfolioValue {Portfolio.TotalPortfolioValue}.\" +\n                        $\" Expected: {totalPortfolioValueSnapshot * 1.05m}\");\n                }\n\n                // lets set amount back to original value\n                Portfolio.CashBook[AccountCurrency].SetAmount(existingAmount);\n                if (totalPortfolioValueSnapshot != Portfolio.TotalPortfolioValue)\n                {\n                    throw new RegressionTestException($\"Unexpected TotalPortfolioValue {Portfolio.TotalPortfolioValue}.\" +\n                        $\" Expected: {totalPortfolioValueSnapshot}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5331;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3752\"},\n            {\"Average Win\", \"0.63%\"},\n            {\"Average Loss\", \"-0.73%\"},\n            {\"Compounding Annual Return\", \"-5.190%\"},\n            {\"Drawdown\", \"58.600%\"},\n            {\"Expectancy\", \"0.007\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"94814.26\"},\n            {\"Net Profit\", \"-5.186%\"},\n            {\"Sharpe Ratio\", \"0.439\"},\n            {\"Sortino Ratio\", \"0.44\"},\n            {\"Probabilistic Sharpe Ratio\", \"23.379%\"},\n            {\"Loss Rate\", \"46%\"},\n            {\"Win Rate\", \"54%\"},\n            {\"Profit-Loss Ratio\", \"0.86\"},\n            {\"Alpha\", \"-0.014\"},\n            {\"Beta\", \"4.75\"},\n            {\"Annual Standard Deviation\", \"0.811\"},\n            {\"Annual Variance\", \"0.658\"},\n            {\"Information Ratio\", \"0.372\"},\n            {\"Tracking Error\", \"0.746\"},\n            {\"Treynor Ratio\", \"0.075\"},\n            {\"Total Fees\", \"$18907.56\"},\n            {\"Estimated Strategy Capacity\", \"$410000.00\"},\n            {\"Lowest Capacity Asset\", \"BNO UN3IMQ2JU1YD\"},\n            {\"Portfolio Turnover\", \"601.23%\"},\n            {\"Drawdown Recovery\", \"237\"},\n            {\"OrderListHash\", \"7e35def0ca91b89579b42cf23ef941e2\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TradeStationBrokerageTradeWithOutsideRegularMarketHoursParameter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates extended market hours trading.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"assets\" />\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class TradeStationBrokerageTradeWithOutsideRegularMarketHoursParameter : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Equity _spy;\n\n        private readonly TradeStationOrderProperties _tradeStationOrderProperties = new() { OutsideRegularTradingHours = true };\n\n        /// <summary>\n        /// Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            SetBrokerageModel(BrokerageName.TradeStation, AccountType.Margin);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute, extendedMarketHours: true);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.At(3, 50), () => StopLimitOrder(_spy.Symbol, 5, 200m, 201m, orderProperties: _tradeStationOrderProperties));\n            Schedule.On(DateRules.EveryDay(), TimeRules.At(3, 55), () => LimitOrder(_spy.Symbol, 5, 200m, orderProperties: _tradeStationOrderProperties));\n        }\n\n        /// <summary>\n        /// Order events are triggered on order status changes. There are many order events including non-fill messages.\n        /// </summary>\n        /// <param name=\"orderEvent\">OrderEvent object with details about the order status</param>\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            var isLimitOrder = order.Type == OrderType.Limit;\n\n            if (orderEvent.Status == OrderStatus.Invalid && isLimitOrder)\n            {\n                throw new RegressionTestException(\"Limit order was incorrectly rejected during extended market hours.\");\n            }\n\n            if (orderEvent.Status != OrderStatus.Invalid && !isLimitOrder)\n            {\n                throw new RegressionTestException(\"Non-limit order was unexpectedly processed outside regular market hours.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = [Language.CSharp];\n\n        /// <summary>\n        /// Data Points count of all TimeSlices of algorithm\n        /// </summary>\n        public long DataPoints => 9643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new()\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4.287%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100055.60\"},\n            {\"Net Profit\", \"0.056%\"},\n            {\"Sharpe Ratio\", \"8.327\"},\n            {\"Sortino Ratio\", \"59.174\"},\n            {\"Probabilistic Sharpe Ratio\", \"97.096%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.001\"},\n            {\"Beta\", \"0.014\"},\n            {\"Annual Standard Deviation\", \"0.003\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.872\"},\n            {\"Tracking Error\", \"0.219\"},\n            {\"Treynor Ratio\", \"2.053\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$6300000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.58%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"17daf701f7408999f77a3afe125aa175\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TradingNotAddedEquitiesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that equities can be traded even if they are not added to the algorithm.\n    /// They will be automatically added as tradable securities an seeded when an order is placed for them.\n    /// </summary>\n    public class TradingNotAddedEquitiesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _equitySymbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 04);\n            SetEndDate(2013, 10, 04);\n            SetCash(1000000);\n\n            // We won't trade IBM, but we need data to trigger the SPY trade in OnData\n            AddEquity(\"IBM\");\n        }\n\n        protected void AssertSecurityIsAdded(Symbol symbol)\n        {\n            if (!Securities.TryGetValue(symbol, out var security) || ActiveSecurities.ContainsKey(symbol) || !security.IsTradable)\n            {\n                throw new RegressionTestException($\"Contract {symbol} was not added as tradable security\");\n            }\n        }\n\n        protected void AssertSecurityIsNotAdded(Symbol symbol)\n        {\n            if (Securities.TryGetValue(symbol, out var security) && ActiveSecurities.ContainsKey(symbol) && security.IsTradable)\n            {\n                throw new RegressionTestException($\"Contract {symbol} was added as tradable security when it should not have been\");\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                AssertSecurityIsNotAdded(_equitySymbol);\n                \n                var ticket = Buy(_equitySymbol, 1);\n                if (ticket.Status == OrderStatus.Invalid)\n                {\n                    throw new RegressionTestException($\"Order for {_equitySymbol} was rejected\");\n                }\n\n                AssertSecurityIsAdded(_equitySymbol);\n\n                // We are done\n                Quit();\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public virtual bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 10;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 7;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public virtual AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999999\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$1.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.01%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"0bb919a1b4258ad8983506f2843f4db5\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TradingNotAddedOptionsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting that options can be traded even if they are not added to the algorithm.\n    /// They will be automatically added as tradable securities an seeded when an order is placed for them.\n    /// </summary>\n    public class TradingNotAddedOptionsRegressionAlgorithm : TradingNotAddedEquitiesRegressionAlgorithm\n    {\n        private Symbol _optionSymbol;\n        private Symbol _deselectedContractSymbol;\n        private Symbol _notSelectedContractSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 28);\n            SetCash(1000000);\n\n            var option = AddOption(\"GOOG\");\n            _optionSymbol = option.Symbol;\n\n            // set our strike/expiry filter for this option chain\n            // SetFilter method accepts TimeSpan objects or integer for days.\n            // The following statements yield the same filtering criteria\n            option.SetFilter(u => u.StandardsOnly()\n                .Strikes(-2, +2)\n                .Expiration(7, 180)\n                .Contracts(contracts =>\n                {\n                    if (_deselectedContractSymbol == null)\n                    {\n                        var contractsList = contracts.ToList();\n                        _deselectedContractSymbol = contractsList.First(x => x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice == 750m && x.ID.Date.Date == new DateTime(2016, 06, 17));\n                        // This contract will never be selected so it's never added to the Securities collection\n                        _notSelectedContractSymbol = contractsList.OrderByDescending(x => x.ID.Date).First();\n\n                        return contractsList.Where(x => x != _notSelectedContractSymbol);\n                    }\n\n                    // Filter out the contract we selected last time, we don't want it to be selected so it's marked as not tradable\n                    return contracts.Where(x => x != _deselectedContractSymbol && x != _notSelectedContractSymbol);\n                }));\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(\"GOOG\");\n        }\n\n        private void AssertTradeContract(Symbol symbol)\n        {\n            var ticket = Sell(symbol, 1);\n            if (ticket.Status == OrderStatus.Invalid)\n            {\n                throw new RegressionTestException($\"Deselected contract {symbol} was not traded when it should have been\");\n            }\n\n            AssertSecurityIsAdded(symbol);\n\n            // Now let's remove it and try to trade it again, but in a strategy\n            RemoveSecurity(symbol);\n            AssertSecurityIsNotAdded(symbol);\n\n            var strategy = OptionStrategies.Straddle(_optionSymbol, symbol.ID.StrikePrice, symbol.ID.Date);\n            if (strategy.OptionLegs.Count != 2 ||\n                strategy.OptionLegs.Any(leg => leg.Symbol == null) ||\n                !strategy.OptionLegs.Any(leg => leg.Symbol == symbol) ||\n                !strategy.OptionLegs.Any(leg => leg.Symbol == symbol.GetMirrorOptionSymbol()))\n            {\n                throw new RegressionTestException(\"Option leg symbols were not set\");\n            }\n\n            var tickets = Sell(strategy, 1);\n            if (tickets.Count == 0 || tickets.Any(x => x.Status == OrderStatus.Invalid))\n            {\n                throw new RegressionTestException($\"Deselected contract {symbol} was not traded as part of the strategy when it should have been\");\n            }\n            AssertSecurityIsAdded(symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time.Day == 24)\n            {\n                if (_deselectedContractSymbol == null || _notSelectedContractSymbol == null)\n                {\n                    throw new RegressionTestException(\"Trading contracts were not set\");\n                }\n\n                if (!Securities.TryGetValue(_deselectedContractSymbol, out var deselectedContract))\n                {\n                    throw new RegressionTestException($\"Deselected contract {_deselectedContractSymbol} is tradable\");\n                }\n            }\n            else if (Time.Day == 28 && !Portfolio.Invested)\n            {\n                if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n                {\n                    if (_deselectedContractSymbol == null || _notSelectedContractSymbol == null)\n                    {\n                        throw new RegressionTestException(\"Trading contracts were not set\");\n                    }\n\n                    AssertSecurityIsNotAdded(_deselectedContractSymbol);\n                    AssertSecurityIsNotAdded(_notSelectedContractSymbol);\n\n                    // Now we have _deselectedContractSymbol which was selected in a previous date but deselected for today.\n                    // Let's trade it\n                    AssertTradeContract(_deselectedContractSymbol);\n\n                    // Let's do the same with _notSelectedContractSymbol which was never selected\n                    AssertTradeContract(_notSelectedContractSymbol);\n\n                    // We are done testing\n                    Quit();\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log(orderEvent.ToString());\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public override bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public override List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 14642;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 22;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.02%\"},\n            {\"Compounding Annual Return\", \"-5.436%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"999327\"},\n            {\"Net Profit\", \"-0.067%\"},\n            {\"Sharpe Ratio\", \"-9.644\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-7.772\"},\n            {\"Tracking Error\", \"0.005\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$8.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"GOOCV WBGM92QHN8ZQ|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"0.86%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"fc224d8177907f98e3381d2d58067b48\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TrailingStopOrderAsyncRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place trailing stop orders asynchronously.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"trailing stop order\"/>\n    public class TrailingStopOrderAsyncRegressionAlgorithm : TrailingStopOrderRegressionAlgorithm\n    {\n        protected override bool AsynchronousOrders => true;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TrailingStopOrderRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Basic algorithm demonstrating how to place trailing stop orders.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"trading and orders\" />\n    /// <meta name=\"tag\" content=\"placing orders\" />\n    /// <meta name=\"tag\" content=\"trailing stop order\"/>\n    public class TrailingStopOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const decimal BuyTrailingAmount = 2m;\n        private const decimal SellTrailingAmount = 0.5m;\n\n        private Symbol _symbol;\n        private OrderTicket _buyOrderTicket;\n        private OrderTicket _sellOrderTicket;\n        private Slice _previousSlice;\n        protected virtual bool AsynchronousOrders => false;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _symbol = AddEquity(\"SPY\").Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!slice.ContainsKey(_symbol))\n            {\n                return;\n            }\n\n            if (_buyOrderTicket == null)\n            {\n                _buyOrderTicket = TrailingStopOrder(_symbol, 100, trailingAmount: BuyTrailingAmount, trailingAsPercentage: false, asynchronous: AsynchronousOrders);\n            }\n            else if (_buyOrderTicket.Status != OrderStatus.Filled)\n            {\n                var stopPrice = _buyOrderTicket.Get(OrderField.StopPrice);\n\n                // Get the previous bar to compare to the stop price,\n                // because stop price update attempt with the current slice data happens after OnData.\n                var low = _previousSlice.QuoteBars.TryGetValue(_symbol, out var quoteBar)\n                    ? quoteBar.Ask.Low\n                    : _previousSlice.Bars[_symbol].Low;\n\n                var stopPriceToMarketPriceDistance = stopPrice - low;\n                if (stopPriceToMarketPriceDistance > BuyTrailingAmount)\n                {\n                    throw new RegressionTestException($\"StopPrice {stopPrice} should be within {BuyTrailingAmount} of the previous low price {low} at all times.\");\n                }\n            }\n\n            if (_sellOrderTicket == null)\n            {\n                if (Portfolio.Invested)\n                {\n                    _sellOrderTicket = TrailingStopOrder(_symbol, -100, trailingAmount: SellTrailingAmount, trailingAsPercentage: false, asynchronous: AsynchronousOrders);\n                }\n            }\n            else if (_sellOrderTicket.Status != OrderStatus.Filled)\n            {\n                var stopPrice = _sellOrderTicket.Get(OrderField.StopPrice);\n\n                // Get the previous bar to compare to the stop price,\n                // because stop price update attempt with the current slice data happens after OnData.\n                var high = _previousSlice.QuoteBars.TryGetValue(_symbol, out var quoteBar)\n                    ? quoteBar.Bid.High\n                    : _previousSlice.Bars[_symbol].High;\n\n                var stopPriceToMarketPriceDistance = high - stopPrice;\n                if (stopPriceToMarketPriceDistance > SellTrailingAmount)\n                {\n                    throw new RegressionTestException($\"StopPrice {stopPrice} should be within {SellTrailingAmount} of the previous high price {high} at all times.\");\n                }\n            }\n\n            _previousSlice = slice;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                if (orderEvent.Direction == OrderDirection.Buy)\n                {\n                    var stopPrice = _buyOrderTicket.Get(OrderField.StopPrice);\n                    if (orderEvent.FillPrice < stopPrice)\n                    {\n                        throw new RegressionTestException($@\"Buy trailing stop order should have filled with price greater than or equal to the stop price {\n                            stopPrice}. Fill price: {orderEvent.FillPrice}\");\n                    }\n                }\n                else\n                {\n                    var stopPrice = _sellOrderTicket.Get(OrderField.StopPrice);\n                    if (orderEvent.FillPrice > stopPrice)\n                    {\n                        throw new RegressionTestException($@\"Sell trailing stop order should have filled with price less than or equal to the stop price {\n                            stopPrice}. Fill price: {orderEvent.FillPrice}\");\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var ticket in Transactions.GetOrderTickets())\n            {\n                if (ticket.SubmitRequest.Asynchronous != AsynchronousOrders)\n                {\n                    throw new RegressionTestException(\"Expected all orders to have the same asynchronous flag as the algorithm.\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally => true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0.02%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"1.833%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100023.22\"},\n            {\"Net Profit\", \"0.023%\"},\n            {\"Sharpe Ratio\", \"3.926\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"95.977%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.007\"},\n            {\"Beta\", \"0.007\"},\n            {\"Annual Standard Deviation\", \"0.002\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.907\"},\n            {\"Tracking Error\", \"0.221\"},\n            {\"Treynor Ratio\", \"1.031\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$36000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"5.79%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d56bac89a568c3a45cac595e69a35875\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TrailingStopRiskFrameworkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Framework.Risk;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Show cases how to use the <see cref=\"TrailingStopRiskManagementModel\"/>\n    /// </summary>\n    public class TrailingStopRiskFrameworkRegressionAlgorithm : BaseFrameworkRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)));\n\n            SetRiskManagement(new TrailingStopRiskManagementModel(0.01m));\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 304;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new ()\n        {\n            { \"Total Orders\", \"2\" },\n            { \"Average Win\", \"0%\" },\n            { \"Average Loss\", \"-0.41%\" },\n            { \"Compounding Annual Return\", \"-4.899%\" },\n            { \"Drawdown\", \"1.100%\" },\n            { \"Expectancy\", \"-1\" },\n            { \"Net Profit\", \"-0.407%\" },\n            { \"Sharpe Ratio\", \"-3.521\"},\n            { \"Probabilistic Sharpe Ratio\", \"0.370%\" },\n            { \"Loss Rate\", \"100%\" },\n            { \"Win Rate\", \"0%\" },\n            { \"Profit-Loss Ratio\", \"0\" },\n            { \"Alpha\", \"-0.04\" },\n            { \"Beta\", \"-0.012\" },\n            { \"Annual Standard Deviation\", \"0.012\" },\n            { \"Annual Variance\", \"0\" },\n            { \"Information Ratio\", \"-4.647\" },\n            { \"Tracking Error\", \"0.05\" },\n            { \"Treynor Ratio\", \"3.644\" },\n            { \"Total Fees\", \"$2.00\" },\n            { \"Estimated Strategy Capacity\", \"$74000000.00\" },\n            { \"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\" },\n            { \"Portfolio Turnover\", \"6.66%\" },\n            { \"OrderListHash\", \"ab2645a4eeb3bbd6b2862df5260d86b4\" }\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TrainingExampleAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm showing how to use QCAlgorithm.Train method\n    /// <meta name=\"tag\" content=\"using quantconnect\" />\n    /// <meta name=\"tag\" content=\"training\" />\n    /// </summary>\n    public class TrainingExampleAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Queue<DateTime> _trainTimes = new();\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 14);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            // Set TrainingMethod to be executed immediately\n            Train(TrainingMethod);\n\n            // Set TrainingMethod to be executed at 8:00 am every Sunday\n            Train(DateRules.Every(DayOfWeek.Sunday), TimeRules.At(8, 0), TrainingMethod);\n        }\n\n        private void TrainingMethod()\n        {\n            Log($\"Start training at {Time}\");\n            // Use the historical data to train the machine learning model\n            var history = History(\"SPY\", 200, Resolution.Daily);\n\n            // ML code:\n\n\n            // let's keep this to assert in the end of the algorithm\n            _trainTimes.Enqueue(Time);\n        }\n\n        /// <summary>\n        /// Let's assert the behavior of our traning schedule\n        /// </summary>\n        public override void OnEndOfAlgorithm()\n        {\n            if (_trainTimes.Count != 2)\n            {\n                throw new RegressionTestException($\"Unexpected train count: {_trainTimes.Count}\");\n            }\n            if (_trainTimes.Dequeue() != StartDate\n                || _trainTimes.Dequeue() != new DateTime(2013, 10, 13, 8, 0, 0))\n            {\n                throw new RegressionTestException($\"Unexpected train times!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 56;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-7.357\"},\n            {\"Tracking Error\", \"0.161\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TrainingInitializeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm is expected to fail and verifies that a training event\n    /// created in Initialize will get run AND it will cause the algorithm to fail if it\n    /// exceeds the \"algorithm-manager-time-loop-maximum\" config value, which the regression\n    /// test sets to 0.5 minutes.\n    /// </summary>\n    public class TrainingInitializeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            // this should cause the algorithm to fail\n            // the regression test sets the time limit to 30 seconds and there's one extra\n            // minute in the bucket, so a two minute sleep should result in RuntimeError\n            Train(() => Thread.Sleep(TimeSpan.FromMinutes(2.5)));\n\n            // DateRules.Tomorrow combined with TimeRules.Midnight enforces that this event schedule will\n            // have exactly one time, which will fire between the first data point and the next day at\n            // midnight. So after the first data point, it will run this event and sleep long enough to\n            // exceed the static max algorithm time loop time and begin to consume from the leaky bucket\n            // the regression test sets the \"algorithm-manager-time-loop-maximum\" value to 30 seconds\n            Train(DateRules.Tomorrow, TimeRules.Midnight, () =>\n            {\n                // this will consume the single 'minute' available in the leaky bucket\n                // and the regression test will confirm that the leaky bucket is empty\n                Thread.Sleep(TimeSpan.FromMinutes(1));\n            });\n        }\n\n        public bool CanRunLocally => false;\n        public List<Language> Languages => new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 0;\n\n        /// </summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.RuntimeError;\n\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>();\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/TwoLegCurrencyConversionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm which tests that a two leg currency conversion happens correctly\n    /// </summary>\n    public class TwoLegCurrencyConversionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _ethUsdSymbol;\n        private Symbol _ltcUsdSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2018, 04, 04);\n            SetEndDate(2018, 04, 04);\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n\n            // GDAX doesn't have LTCETH or ETHLTC, but they do have ETHUSD and LTCUSD to form a path between ETH and LTC\n            SetAccountCurrency(\"ETH\");\n            SetCash(\"ETH\", 100000);\n            SetCash(\"LTC\", 100000);\n            SetCash(\"USD\", 100000);\n\n            _ethUsdSymbol = AddCrypto(\"ETHUSD\", Resolution.Minute).Symbol;\n            _ltcUsdSymbol = AddCrypto(\"LTCUSD\", Resolution.Minute).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                MarketOrder(_ltcUsdSymbol, 1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var ltcCash = Portfolio.CashBook[\"LTC\"];\n\n            var conversionSymbols = ltcCash.CurrencyConversion.ConversionRateSecurities\n                .Select(x => x.Symbol)\n                .ToList();\n\n            if (conversionSymbols.Count != 2)\n            {\n                throw new RegressionTestException(\n                    $\"Expected two conversion rate securities for LTC to ETH, is {conversionSymbols.Count}\");\n            }\n\n            if (conversionSymbols[0] != _ltcUsdSymbol)\n            {\n                throw new RegressionTestException(\n                    $\"Expected first conversion rate security from LTC to ETH to be {_ltcUsdSymbol}, is {conversionSymbols[0]}\");\n            }\n\n            if (conversionSymbols[1] != _ethUsdSymbol)\n            {\n                throw new RegressionTestException(\n                    $\"Expected second conversion rate security from LTC to ETH to be {_ethUsdSymbol}, is {conversionSymbols[1]}\");\n            }\n\n            var ltcUsdValue = Securities[_ltcUsdSymbol].GetLastData().Value;\n            var ethUsdValue = Securities[_ethUsdSymbol].GetLastData().Value;\n\n            var expectedConversionRate = ltcUsdValue / ethUsdValue;\n            var actualConversionRate = ltcCash.ConversionRate;\n\n            if (actualConversionRate != expectedConversionRate)\n            {\n                throw new RegressionTestException(\n                    $\"Expected conversion rate from LTC to ETH to be {expectedConversionRate}, is {actualConversionRate}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 5765;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"132337.76\"},\n            {\"End Equity\", \"131620.05\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"Ξ0.00\"},\n            {\"Estimated Strategy Capacity\", \"Ξ2000.00\"},\n            {\"Lowest Capacity Asset\", \"LTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"0.00%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"c5d6001a28b12bd2d6c714a9aaa3aa07\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseOnlyRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Asserts that algorithms can be universe-only, that is, universe selection is performed even if the ETF security is not explicitly added.\n    /// Reproduces https://github.com/QuantConnect/Lean/issues/7473\n    /// </summary>\n    public class UniverseOnlyRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _selectionDone;\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 12, 1);\n            SetEndDate(2020, 12, 12);\n            SetCash(100000);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Add universe without a security added\n            AddUniverse(Universe.ETF(\"GDVD\", UniverseSettings, FilterUniverse));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_selectionDone)\n            {\n                throw new RegressionTestException(\"Universe selection was not performed\");\n            }\n        }\n\n        private IEnumerable<Symbol> FilterUniverse(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            _selectionDone = true;\n            return constituents.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 61;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"4.947\"},\n            {\"Tracking Error\", \"0.006\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSelectedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of Universe.Selected collection\n    /// </summary>\n    public class UniverseSelectedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _selectionCount;\n        private Universe _universe;\n\n        private readonly Queue<List<Symbol>> _expectedSymbols = new(new[]\n        {\n            new List<Symbol> { GetSymbol(\"SPY\") },\n            new List<Symbol> { GetSymbol(\"AAPL\"), GetSymbol(\"IWM\") },\n            new List<Symbol> { GetSymbol(\"FB\"), GetSymbol(\"AAPL\"), GetSymbol(\"QQQ\") },\n        });\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 03, 27);\n\n            _universe = AddUniverse(SelectionFunction);\n        }\n\n        public IEnumerable<Symbol> SelectionFunction(IEnumerable<Fundamental> fundamentals)\n        {\n            var sortedByDollarVolume = fundamentals.OrderByDescending(x => x.DollarVolume);\n\n            var top = sortedByDollarVolume.Skip(_selectionCount++).Take(_selectionCount).ToList();\n\n            return top.Select(x => x.Symbol);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_universe.Selected.Contains(QuantConnect.Symbol.Create(\"TSLA\", SecurityType.Equity, Market.USA)))\n            {\n                throw new RegressionTestException($\"TSLA shouldn't of been selected\");\n            }\n\n            if (Time.Date < new DateTime(2014, 03, 28))\n            {\n                var expectedSymbols = _expectedSymbols.Dequeue();\n\n                if (!Enumerable.SequenceEqual(expectedSymbols, _universe.Selected))\n                {\n                    throw new RegressionTestException($\"Unexpected selected symbols\");\n                }\n            }\n\n            Buy(_universe.Selected.First(), 1);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_selectionCount != 3)\n            {\n                throw new RegressionTestException($\"Unexpected selection count {_selectionCount}\");\n            }\n            if (_universe.Selected.Count != 3 || _universe.Selected.Count == _universe.Members.Count)\n            {\n                throw new RegressionTestException($\"Unexpected universe selected count {_universe.Selected.Count}\");\n            }\n        }\n\n        private static Symbol GetSymbol(string ticker) => QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 28319;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-0.508%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99995.81\"},\n            {\"Net Profit\", \"-0.004%\"},\n            {\"Sharpe Ratio\", \"-83.691\"},\n            {\"Sortino Ratio\", \"-83.691\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.011\"},\n            {\"Beta\", \"0.003\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"12.051\"},\n            {\"Tracking Error\", \"0.057\"},\n            {\"Treynor Ratio\", \"-4.776\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$390000000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.06%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"15ad776b527fdd43aae394badef6d206\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSelectionDefinitionsAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm shows some of the various helper methods available when defining universes\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"coarse universes\" />\n    public class UniverseSelectionDefinitionsAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SecurityChanges _changes = SecurityChanges.None;\n        private bool _onSecuritiesChangedWasCalled;\n\n        public override void Initialize()\n        {\n            // subscriptions added via universe selection will have this resolution\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 24);\n            SetEndDate(2014, 03, 28);\n            SetCash(100*1000);\n\n            // add universe for the top 3 stocks by dollar volume\n            AddUniverse(Universe.Top(3));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate securities that fell out of our universe\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // invest in securities just added to our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (!security.Invested)\n                {\n                    MarketOrder(security.Symbol, 10);\n                }\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_onSecuritiesChangedWasCalled)\n            {\n                throw new RegressionTestException($\"OnSecuritiesChanged() method was never called!\");\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _onSecuritiesChangedWasCalled = true;\n            _changes = changes;\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 35413;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"7\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-5.668%\"},\n            {\"Drawdown\", \"0.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99920.10\"},\n            {\"Net Profit\", \"-0.080%\"},\n            {\"Sharpe Ratio\", \"-12.528\"},\n            {\"Sortino Ratio\", \"-11.575\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.058\"},\n            {\"Beta\", \"0.042\"},\n            {\"Annual Standard Deviation\", \"0.005\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-0.968\"},\n            {\"Tracking Error\", \"0.09\"},\n            {\"Treynor Ratio\", \"-1.342\"},\n            {\"Total Fees\", \"$7.00\"},\n            {\"Estimated Strategy Capacity\", \"$3700000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"1.06%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"4b589eb854896e3516fb9ebcde6fd6c1\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Universe Selection regression algorithm simulates an edge case. In one week, Google listed two new symbols, delisted one of them and changed tickers.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private HashSet<Symbol> _delistedSymbols = new HashSet<Symbol>();\n        private SecurityChanges _changes;\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 22);  //Set Start Date\n            SetEndDate(2014, 04, 07);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n\n            // security that exists with no mappings\n            AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Daily);\n            // security that doesn't exist until half way in backtest (comes in as GOOCV)\n            AddSecurity(SecurityType.Equity, \"GOOG\", Resolution.Daily);\n\n            AddUniverse(coarse =>\n            {\n                // select the various google symbols over the period\n                return from c in coarse\n                       let sym = c.Symbol.Value\n                       where sym == \"GOOG\" || sym == \"GOOCV\" || sym == \"GOOAV\" || sym == \"GOOGL\"\n                       select c.Symbol;\n\n                // Before March 28th 2014:\n                // - Only GOOG  T1AZ164W5VTX existed\n                // On March 28th 2014\n                // - GOOAV VP83T1ZUHROL and GOOCV VP83T1ZUHROL are listed\n                // On April 02nd 2014\n                // - GOOAV VP83T1ZUHROL is delisted\n                // - GOOG  T1AZ164W5VTX becomes GOOGL\n                // - GOOCV VP83T1ZUHROL becomes GOOG\n            });\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            // can access the current set of active securitie through UniverseManager.ActiveSecurities\n            Log(Time + \": Active Securities: \" + string.Join(\", \", UniverseManager.ActiveSecurities.Keys));\n\n            // verify we don't receive data for inactive securities\n            var inactiveSymbols = slice.Keys\n                .Where(sym => !UniverseManager.ActiveSecurities.ContainsKey(sym))\n                // on daily data we'll get the last data point and the delisting at the same time\n                .Where(sym => !slice.Delistings.ContainsKey(sym) || slice.Delistings[sym].Type != DelistingType.Delisted)\n                .ToList();\n            if (inactiveSymbols.Any())\n            {\n                var symbols = string.Join(\", \", inactiveSymbols);\n                throw new RegressionTestException($\"Received data for non-active security: {symbols}.\");\n            }\n\n            if (Transactions.OrdersCount == 0)\n            {\n                MarketOrder(\"SPY\", 100);\n            }\n\n            foreach (var kvp in slice.Delistings)\n            {\n                _delistedSymbols.Add(kvp.Key);\n            }\n\n            if (_changes != null && _changes.AddedSecurities.All(x => slice.Bars.ContainsKey(x.Symbol)))\n            {\n                foreach (var security in _changes.AddedSecurities)\n                {\n                    Log(Time + \": Added Security: \" + security.Symbol.ID);\n                    MarketOnOpenOrder(security.Symbol, 100);\n                }\n                foreach (var security in _changes.RemovedSecurities)\n                {\n                    Log(Time + \": Removed Security: \" + security.Symbol.ID);\n                    if (!_delistedSymbols.Contains(security.Symbol))\n                    {\n                        MarketOnOpenOrder(security.Symbol, -100);\n                    }\n                }\n                _changes = null;\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Submitted)\n            {\n                Log(Time + \": Submitted: \" + Transactions.GetOrderById(orderEvent.OrderId));\n            }\n            if (orderEvent.Status.IsFill())\n            {\n                Log(Time + \": Filled: \" + Transactions.GetOrderById(orderEvent.OrderId));\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var security in Portfolio.Securities.Values.Where(x => x.Invested))\n            {\n                // At the end, we should hold 100 shares of:\n                // - SPY                (bought on March, 25th 2014),\n                // - GOOG  T1AZ164W5VTX (bought on March, 26th 2014),\n                // - GOOCV VP83T1ZUHROL (bought on March, 28th 2014).\n                AssertQuantity(security, 100);\n            }\n        }\n\n        private void AssertQuantity(Security security, int expected)\n        {\n            var actual = security.Holdings.Quantity;\n            if (actual != expected)\n            {\n                var symbol = security.Symbol;\n                throw new RegressionTestException($\"{symbol}({symbol.ID}) expected {expected.ToStringInvariant()}, but received {actual.ToStringInvariant()}.\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78092;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0.14%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-59.145%\"},\n            {\"Drawdown\", \"4.100%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"95916.61\"},\n            {\"Net Profit\", \"-4.083%\"},\n            {\"Sharpe Ratio\", \"-2.753\"},\n            {\"Sortino Ratio\", \"-3.15\"},\n            {\"Probabilistic Sharpe Ratio\", \"12.507%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.306\"},\n            {\"Beta\", \"1.175\"},\n            {\"Annual Standard Deviation\", \"0.175\"},\n            {\"Annual Variance\", \"0.031\"},\n            {\"Information Ratio\", \"-2.391\"},\n            {\"Tracking Error\", \"0.139\"},\n            {\"Treynor Ratio\", \"-0.41\"},\n            {\"Total Fees\", \"$3.00\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOAV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"11.26%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"b9c45830fc218afd9de9ce729afc6200\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSelectionSymbolCacheRemovalRegressionTest.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing github issue #5191 where the symbol was removed from the cache\n    /// even if a subscription is still present\n    /// </summary>\n    public class UniverseSelectionSymbolCacheRemovalRegressionTest : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _optionWasRemoved;\n        private Symbol _optionContract;\n        private Symbol _equitySymbol;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 05);\n            SetEndDate(2014, 06, 23);\n\n            AddEquity(\"AAPL\", Resolution.Daily);\n            _equitySymbol = AddEquity(\"TWX\", Resolution.Minute).Symbol;\n\n            var contracts = OptionChain(_equitySymbol).ToList();\n\n            var callOptionSymbol = contracts\n                .Where(c => c.ID.OptionRight == OptionRight.Call)\n                .OrderBy(c => c.ID.Date)\n                .First();\n            _optionContract = AddOptionContract(callOptionSymbol).Symbol;\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            var symbol = SymbolCache.GetSymbol(\"TWX\");\n            if (symbol == null)\n            {\n                throw new RegressionTestException(\"Unexpected removal of symbol from cache!\");\n            }\n\n            foreach (var dataDelisting in slice.Delistings.Where(pair => pair.Value.Type == DelistingType.Delisted))\n            {\n                if (dataDelisting.Key != _optionContract)\n                {\n                    throw new RegressionTestException(\"Unexpected delisting event!\");\n                }\n                _optionWasRemoved = true;\n            }\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"AAPL\", 0.1);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_optionWasRemoved)\n            {\n                throw new RegressionTestException(\"Option contract was not removed!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 24289;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 1;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-4.228%\"},\n            {\"Drawdown\", \"0.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99779.30\"},\n            {\"Net Profit\", \"-0.221%\"},\n            {\"Sharpe Ratio\", \"-3.185\"},\n            {\"Sortino Ratio\", \"-4.277\"},\n            {\"Probabilistic Sharpe Ratio\", \"17.836%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.047\"},\n            {\"Beta\", \"0.053\"},\n            {\"Annual Standard Deviation\", \"0.012\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-4.592\"},\n            {\"Tracking Error\", \"0.047\"},\n            {\"Treynor Ratio\", \"-0.714\"},\n            {\"Total Fees\", \"$2.39\"},\n            {\"Estimated Strategy Capacity\", \"$2900000000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.53%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"ff4e9e05d7a60c96ccc6e7541d200168\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSharingSecurityDifferentSubscriptionRequestRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm has two different Universe using the same Security but with\n    /// different SubscriptionDataConfig. One of them will add and remove it in a toggle fashion and it should also remove the\n    /// corresponding SubscriptionDataConfig.\n    /// Also will test manually adding and removing a security.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UniverseSharingSecurityDifferentSubscriptionRequestRegressionAlgorithm\n        : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private readonly Symbol _aig = QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA);\n        private int _onDataCalls;\n        private bool _alreadyRemoved;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000); //Set Strategy Cash\n\n            AddEquity(\"SPY\");\n            AddEquity(\"AIG\");\n\n            UniverseSettings.Resolution = Resolution.Minute;\n            UniverseSettings.ExtendedMarketHours = true;\n            AddUniverse(SecurityType.Equity,\n                \"SecondUniverse\",\n                Resolution.Daily,\n                Market.USA,\n                UniverseSettings,\n                time => time.Day % 2 == 0 ? new[] { \"SPY\" } : Enumerable.Empty<string>()\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            _onDataCalls++;\n\n            if (_alreadyRemoved)\n            {\n                var config = SubscriptionManager\n                    .SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_aig);\n                if (config.Any())\n                {\n                    throw new RegressionTestException($\"Unexpected SubscriptionDataConfig: {config}\");\n                }\n            }\n\n            if (!_alreadyRemoved)\n            {\n                _alreadyRemoved = true;\n                var config = SubscriptionManager\n                    .SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(_aig);\n                if (!config.Any())\n                {\n                    throw new RegressionTestException(\"Expecting to find a SubscriptionDataConfig for AIG\");\n                }\n                RemoveSecurity(_aig);\n            }\n\n            var isExtendedMarketHours = SubscriptionManager\n                .SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(_spy)\n                .IsExtendedMarketHours();\n\n            if (Time.Day % 2 == 0)\n            {\n                if (!isExtendedMarketHours)\n                {\n                    throw new RegressionTestException($\"Unexpected isExtendedMarketHours value: {false}\");\n                }\n            }\n            else\n            {\n                if (isExtendedMarketHours)\n                {\n                    throw new RegressionTestException($\"Unexpected isExtendedMarketHours value: {true}\");\n                }\n\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onDataCalls == 0)\n            {\n                throw new RegressionTestException($\"Unexpected OnData() calls count {_onDataCalls}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7001;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-57.739\"},\n            {\"Tracking Error\", \"0.178\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSharingSubscriptionRequestRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm has two different Universe using the same SubscriptionDataConfig.\n    /// One of them will add and remove it in a toggle fashion but since it will still be consumed\n    /// by the other Universe it should not be removed.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UniverseSharingSubscriptionRequestRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private readonly Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        private int _onDataCalls;\n        private bool _restOneDay;\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01); //Set Start Date\n            SetEndDate(2013, 10, 30); //Set End Date\n            SetCash(100000); //Set Strategy Cash\n\n            AddEquity(\"SPY\", Resolution.Daily);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse(SecurityType.Equity,\n                \"SecondUniverse\",\n                Resolution.Daily,\n                Market.USA,\n                UniverseSettings,\n                time => time.Day % 3 == 0 ? new[] { \"SPY\" } : Enumerable.Empty<string>()\n            );\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.Count != 1)\n            {\n                throw new RegressionTestException($\"Unexpected data count {slice.Count}\");\n            }\n            Debug($\"{slice.Time}. Data count {slice.Count}. Data {slice.Bars.First().Value}\");\n            _onDataCalls++;\n\n            if (_restOneDay)\n            {\n                // let a day pass before trading again, this will cause\n                // \"SecondUniverse\" remove request to be applied\n                _restOneDay = false;\n            }\n            else if(!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n            else\n            {\n                SetHoldings(_spy, 0);\n                Debug(\"Sell Stock\");\n                _restOneDay = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_onDataCalls != 22)\n            {\n                throw new RegressionTestException($\"Unexpected OnData() calls count {_onDataCalls}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 206;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"15\"},\n            {\"Average Win\", \"0.30%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"29.578%\"},\n            {\"Drawdown\", \"0.700%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"102128.38\"},\n            {\"Net Profit\", \"2.128%\"},\n            {\"Sharpe Ratio\", \"4.345\"},\n            {\"Sortino Ratio\", \"7.134\"},\n            {\"Probabilistic Sharpe Ratio\", \"91.767%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"100%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.073\"},\n            {\"Beta\", \"0.292\"},\n            {\"Annual Standard Deviation\", \"0.045\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-2.681\"},\n            {\"Tracking Error\", \"0.083\"},\n            {\"Treynor Ratio\", \"0.666\"},\n            {\"Total Fees\", \"$47.53\"},\n            {\"Estimated Strategy Capacity\", \"$760000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"46.41%\"},\n            {\"Drawdown Recovery\", \"7\"},\n            {\"OrderListHash\", \"224b0ff29c5b287ecffaaa257e594ef3\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseSharingSubscriptionTradableRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm has two different Universe using the same SubscriptionDataConfig.\n    /// Reproduces GH issue 3877: 1- universe 'TestUniverse' selects and deselects SPY. 2- UserDefinedUniverse\n    /// reselects SPY, which should be marked as tradable.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UniverseSharingSubscriptionTradableRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n        private int _reselectedSpy = -1;\n        private DateTime lastDataTime = DateTime.MinValue;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 01);\n            SetEndDate(2013, 10, 30);\n            AddEquity(\"AAPL\", Resolution.Daily);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            AddUniverse(SecurityType.Equity,\n                \"TestUniverse\",\n                Resolution.Daily,\n                Market.USA,\n                UniverseSettings,\n                time => time.Day == 1 ? new[] {\"SPY\"} : Enumerable.Empty<string>());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (lastDataTime == slice.Time)\n            {\n                throw new RegressionTestException(\"Duplicate time for current data and last data slice\");\n            }\n\n            lastDataTime = slice.Time;\n\n            if (_reselectedSpy == 0)\n            {\n                if (!Securities[_spy].IsTradable)\n                {\n                    throw new RegressionTestException($\"{_spy} should be tradable\");\n                }\n\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(_spy, 1);\n                }\n            }\n\n            if (_reselectedSpy == 1)\n            {\n                // SPY should be re added in the next loop\n                _reselectedSpy = 0;\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.RemovedSecurities.Any())\n            {\n                // OnSecuritiesChanged is called before OnData, so SPY will still not be\n                // present\n                _reselectedSpy = 1;\n                _spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n\n                if (!Securities[_spy].IsTradable)\n                {\n                    throw new RegressionTestException($\"{_spy} should be tradable\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 229;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"84.550%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"105106.43\"},\n            {\"Net Profit\", \"5.106%\"},\n            {\"Sharpe Ratio\", \"5.253\"},\n            {\"Sortino Ratio\", \"11.491\"},\n            {\"Probabilistic Sharpe Ratio\", \"88.500%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.157\"},\n            {\"Beta\", \"0.922\"},\n            {\"Annual Standard Deviation\", \"0.103\"},\n            {\"Annual Variance\", \"0.011\"},\n            {\"Information Ratio\", \"4.703\"},\n            {\"Tracking Error\", \"0.026\"},\n            {\"Treynor Ratio\", \"0.588\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$700000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"3.30%\"},\n            {\"Drawdown Recovery\", \"3\"},\n            {\"OrderListHash\", \"032561818d8c8c17b30d3c9b0d52fa17\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UniverseUnchangedRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm used to test a fine and coarse selection methods\n    /// returning <see cref=\"Universe.Unchanged\"/>\n    /// </summary>\n    public class UniverseUnchangedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbolsFine = 2;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            // Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n            // Commented so regression algorithm is more sensitive\n            //Settings.MinimumOrderMarginPortfolioPercentage = 0.005m;\n\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 04, 07);\n\n            SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1), 0.025, null));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n        }\n\n        public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            // the first and second selection\n            if (Time.Date <= new DateTime(2014, 3, 26))\n            {\n                return new List<Symbol>\n                {\n                    QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                    QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                    QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA)\n                };\n            }\n            // will skip fine selection\n            return Universe.Unchanged;\n        }\n\n        public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            // just the first selection\n            if (Time.Date == new DateTime(2014, 3, 25))\n            {\n                var sortedByPeRatio = fine.OrderByDescending(x => x.ValuationRatios.PERatio);\n                var topFine = sortedByPeRatio.Take(NumberOfSymbolsFine);\n                return topFine.Select(x => x.Symbol);\n            }\n            // the second selection will return unchanged, in the following fine selection will be skipped\n            return Universe.Unchanged;\n        }\n\n        // assert security changes, throw if called more than once\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes.AddedSecurities.Count != 2\n                || Time != new DateTime(2014, 3, 25)\n                || changes.AddedSecurities.All(security => security.Symbol != QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA))\n                || changes.AddedSecurities.All(security => security.Symbol != QuantConnect.Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA)))\n            {\n                throw new RegressionTestException(\"Unexpected security changes\");\n            }\n            Log($\"OnSecuritiesChanged({Time:o}):: {changes}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 63891;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"-45.405%\"},\n            {\"Drawdown\", \"2.300%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"97705.34\"},\n            {\"Net Profit\", \"-2.295%\"},\n            {\"Sharpe Ratio\", \"-3.77\"},\n            {\"Sortino Ratio\", \"-4.881\"},\n            {\"Probabilistic Sharpe Ratio\", \"10.598%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.233\"},\n            {\"Beta\", \"0.705\"},\n            {\"Annual Standard Deviation\", \"0.097\"},\n            {\"Annual Variance\", \"0.009\"},\n            {\"Information Ratio\", \"-2.374\"},\n            {\"Tracking Error\", \"0.075\"},\n            {\"Treynor Ratio\", \"-0.52\"},\n            {\"Total Fees\", \"$19.98\"},\n            {\"Estimated Strategy Capacity\", \"$100000000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"7.33%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"62cae7349a5294699d7d71ac4ec42b09\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UnregisterIndicatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example and regression algorithm asserting the behavior of registering and unregistering an indicator from the engine\n    /// </summary>\n    public class UnregisterIndicatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol[] _symbols;\n        private IndicatorBase _trin;\n        private IndicatorBase _trin2;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            var spy = AddEquity(\"SPY\");\n            var ibm = AddEquity(\"IBM\");\n\n            _symbols = new[] { spy.Symbol, ibm.Symbol };\n            _trin = TRIN(_symbols, Resolution.Minute);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if(_trin.IsReady)\n            {\n                _trin.Reset();\n                UnregisterIndicator(_trin);\n\n                // let's create a new one with a differente resolution\n                _trin2 = TRIN(_symbols, Resolution.Hour);\n            }\n\n            if (_trin2 != null && _trin2.IsReady)\n            {\n                if (_trin.IsReady)\n                {\n                    throw new RegressionTestException(\"Indicator should of stop getting updates!\");\n                }\n\n                if(!Portfolio.Invested)\n                {\n                    SetHoldings(_symbols[0], 0.5m);\n                    SetHoldings(_symbols[1], 0.5m);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7843;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"232.884%\"},\n            {\"Drawdown\", \"2.000%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101549.48\"},\n            {\"Net Profit\", \"1.549%\"},\n            {\"Sharpe Ratio\", \"10.888\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"66.376%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.565\"},\n            {\"Beta\", \"0.992\"},\n            {\"Annual Standard Deviation\", \"0.232\"},\n            {\"Annual Variance\", \"0.054\"},\n            {\"Information Ratio\", \"7.761\"},\n            {\"Tracking Error\", \"0.071\"},\n            {\"Treynor Ratio\", \"2.544\"},\n            {\"Total Fees\", \"$3.54\"},\n            {\"Estimated Strategy Capacity\", \"$1200000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"19.99%\"},\n            {\"Drawdown Recovery\", \"2\"},\n            {\"OrderListHash\", \"b24d340c2ca279f0b220bad94e946516\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.CurrencyConversion;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the unsettled cash book is updated correctly when the quote currency is not the account currency.\n    /// Reproduces GH issue #6859.\n    /// </summary>\n    public class UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        private decimal _lastUnsettledCash;\n\n        private DateTime _lastUnsettledCashUpdatedDate;\n\n        private DateTime _lastTradeDate;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 08);\n\n            SetAccountCurrency(\"EUR\");\n            SetCash(100000);\n\n            SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Time - _lastTradeDate < TimeSpan.FromHours(1))\n            {\n                return;\n            }\n\n            _lastTradeDate = Time;\n\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 0.1);\n            }\n            else\n            {\n                Liquidate();\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status == OrderStatus.Filled && orderEvent.Direction == OrderDirection.Sell)\n            {\n                Debug($\"OrderEvent: {orderEvent}\");\n                Debug($\"CashBook:\\n{Portfolio.CashBook}\\n\");\n                Debug($\"UnsettledCashBook:\\n{Portfolio.UnsettledCashBook}\\n\");\n\n                if (!Portfolio.UnsettledCashBook.TryGetValue(orderEvent.FillPriceCurrency, out var unsettledCash))\n                {\n                    throw new RegressionTestException($\"Unsettled cash entry for {orderEvent.FillPriceCurrency} not found\");\n                }\n\n                // Clear _lastUnsettledCash if the settlement period has elapsed\n                if (orderEvent.UtcTime.Date >= _lastUnsettledCashUpdatedDate.AddDays(Equity.DefaultSettlementDays).Date)\n                {\n                    _lastUnsettledCash = 0;\n                }\n\n                var expectedUnsettledCash = Math.Abs(orderEvent.FillPrice * orderEvent.FillQuantity);\n                var actualUnsettledCash = unsettledCash.Amount - _lastUnsettledCash;\n                if (actualUnsettledCash != expectedUnsettledCash)\n                {\n                    throw new RegressionTestException($\"Expected unsettled cash to be {expectedUnsettledCash} but was {actualUnsettledCash}\");\n                }\n\n                _lastUnsettledCash = unsettledCash.Amount;\n                _lastUnsettledCashUpdatedDate = orderEvent.UtcTime;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            foreach (var kvp in Portfolio.CashBook)\n            {\n                var symbol = kvp.Key;\n                var cash = kvp.Value;\n                var unsettledCash = Portfolio.UnsettledCashBook[symbol];\n\n                if (unsettledCash.ConversionRate != cash.ConversionRate)\n                {\n                    throw new RegressionTestException($@\"Unsettled cash conversion rate for {symbol} is {unsettledCash.ConversionRate} but should be {cash.ConversionRate}\");\n                }\n\n                var accountCurrency = Portfolio.CashBook.AccountCurrency;\n\n                if (unsettledCash.Symbol == accountCurrency)\n                {\n                    if (unsettledCash.ConversionRate != 1)\n                    {\n                        throw new RegressionTestException($@\"Conversion rate for {unsettledCash.Symbol} (the account currency) in the UnsettledCashBook should be 1 but was {unsettledCash.ConversionRate}.\");\n                    }\n\n                    if (unsettledCash.CurrencyConversion.GetType() != typeof(ConstantCurrencyConversion) ||\n                        unsettledCash.CurrencyConversion.SourceCurrency != accountCurrency ||\n                        unsettledCash.CurrencyConversion.DestinationCurrency != accountCurrency)\n                    {\n                        throw new RegressionTestException($@\"Currency conversion for {unsettledCash.Symbol} (the account currency) in the UnsettledCashBook should be an identity conversion of type {nameof(ConstantCurrencyConversion)}\");\n                    }\n                }\n                else\n                {\n                    if (unsettledCash.CurrencyConversion.GetType() != typeof(SecurityCurrencyConversion))\n                    {\n                        throw new RegressionTestException($@\"Currency conversion for {unsettledCash.Symbol} in the UnsettledCashBook should be of type {nameof(SecurityCurrencyConversion)}\");\n                    }\n\n                    var sourceCurrency = unsettledCash.CurrencyConversion.SourceCurrency;\n                    var destinationCurrency = unsettledCash.CurrencyConversion.DestinationCurrency;\n\n                    if (!(\n                        (sourceCurrency == accountCurrency && destinationCurrency == unsettledCash.Symbol) ||\n                        (sourceCurrency == unsettledCash.Symbol && destinationCurrency == accountCurrency)\n                        ))\n                    {\n                        throw new RegressionTestException($@\"Currency conversion for {unsettledCash.Symbol} in UnsettledCashBook is not correct. Source and destination currency should have been {accountCurrency} and {unsettledCash.Symbol} or vice versa but were {sourceCurrency} and {destinationCurrency}.\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1561;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 50;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"14\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99981.05\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"€10.32\"},\n            {\"Estimated Strategy Capacity\", \"€7700000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"69.61%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"ee7f00badd1a38ca21e51f610ba88044\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Provides a regression baseline focused on updating orders\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UpdateOrderLiveTestAlgorithm : QCAlgorithm\n    {\n        private static readonly Random Random = new Random();\n\n        private const decimal ImmediateCancelPercentage = 0.05m;\n\n        private int _lastMinute = -1;\n        private Security _security;\n        private int _quantity = 5;\n        private string _symbol = \"SPY\";\n        private const int DeltaQuantity = 1;\n\n        private const decimal StopPercentage = 0.025m;\n        private const decimal StopPercentageDelta = 0.005m;\n        private const decimal LimitPercentage = 0.025m;\n        private const decimal LimitPercentageDelta = 0.005m;\n\n        private const SecurityType SecType = SecurityType.Equity;\n\n        private readonly CircularQueue<OrderType> _orderTypesQueue = new CircularQueue<OrderType>(new []\n        {\n            OrderType.MarketOnOpen,\n            OrderType.MarketOnClose,\n            OrderType.StopLimit,\n            OrderType.StopMarket,\n            OrderType.Limit,\n            OrderType.Market\n        });\n\n        private readonly List<OrderTicket> _tickets = new List<OrderTicket>();\n\n        private readonly HashSet<int> _immediateCancellations = new HashSet<int>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 07);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecType, _symbol, Resolution.Second);\n            _security = Securities[_symbol];\n\n            _orderTypesQueue.CircleCompleted += (sender, args) =>\n            {\n                // flip our signs\n                _quantity *= -1;\n            };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!_security.HasData)\n            {\n                Log(\"::::: NO DATA :::::\");\n                return;\n            }\n\n            // each month make an action\n            if (Time.Minute != _lastMinute && Time.Second == 0)\n            {\n                Log(\"\");\n                Log(\"--------------Minute: \" + Time.Minute);\n                Log(\"\");\n                _lastMinute = Time.Minute;\n                // we'll submit the next type of order from the queue\n                var orderType = _orderTypesQueue.Dequeue();\n                Log(\"ORDER TYPE:: \" + orderType);\n                var isLong = _quantity > 0;\n                var stopPrice = isLong ? (1 + StopPercentage) * _security.High : (1 - StopPercentage) * _security.Low;\n                var limitPrice = isLong ? (1 - LimitPercentage) * stopPrice : (1 + LimitPercentage) * stopPrice;\n                if (orderType == OrderType.Limit)\n                {\n                    limitPrice = !isLong ? (1 + LimitPercentage) * _security.High : (1 - LimitPercentage) * _security.Low;\n                }\n                var request = new SubmitOrderRequest(orderType, SecType, Securities[_symbol].Symbol, _quantity, stopPrice, limitPrice, Time, orderType.ToString());\n                var ticket = Transactions.AddOrder(request);\n                _tickets.Add(ticket);\n                if ((decimal)Random.NextDouble() < ImmediateCancelPercentage)\n                {\n                    Log(\"Immediate cancellation requested!\");\n                    _immediateCancellations.Add(ticket.OrderId);\n                }\n            }\n            else if (_tickets.Count > 0)\n            {\n                var ticket = _tickets.Last();\n                if (Time.Second > 15 && Time.Second < 30)\n                {\n                    if (ticket.UpdateRequests.Count == 0 && ticket.Status.IsOpen())\n                    {\n                        Log(ticket.ToString());\n                        ticket.Update(new UpdateOrderFields\n                        {\n                            Quantity = ticket.Quantity + Math.Sign(_quantity) * DeltaQuantity,\n                            Tag = \"Change quantity: \" + Time\n                        });\n                        Log(\"UPDATE1:: \" + ticket.UpdateRequests.Last());\n                    }\n                }\n                else if (Time.Second > 29 && Time.Second < 45)\n                {\n                    if (ticket.UpdateRequests.Count == 1 && ticket.Status.IsOpen())\n                    {\n                        Log(ticket.ToString());\n                        ticket.Update(new UpdateOrderFields\n                        {\n                            LimitPrice = _security.Price * (1 - Math.Sign(ticket.Quantity) * LimitPercentageDelta),\n                            StopPrice = _security.Price * (1 + Math.Sign(ticket.Quantity) * StopPercentageDelta),\n                            Tag = \"Change prices: \" + Time\n                        });\n                        Log(\"UPDATE2:: \" + ticket.UpdateRequests.Last());\n                    }\n                }\n                else\n                {\n                    if (ticket.UpdateRequests.Count == 2 && ticket.Status.IsOpen())\n                    {\n                        Log(ticket.ToString());\n                        ticket.Cancel(Time + \" and is still open!\");\n                        Log(\"CANCELLED:: \" + ticket.CancelRequest);\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (_immediateCancellations.Contains(orderEvent.OrderId))\n            {\n                _immediateCancellations.Remove(orderEvent.OrderId);\n                Transactions.CancelOrder(orderEvent.OrderId);\n            }\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log(\"FILLED:: \" + Transactions.GetOrderById(orderEvent.OrderId) + \" FILL PRICE:: \" + orderEvent.FillPrice.SmartRounding());\n            }\n            else\n            {\n                Log(orderEvent.ToString());\n            }\n        }\n\n        private new void Log(string msg)\n        {\n            // redirect live logs to debug window\n            if (LiveMode)\n            {\n                Debug(msg);\n            }\n            else\n            {\n                base.Log(msg);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Provides a regression baseline focused on updating orders\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class UpdateOrderRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int LastMonth = -1;\n        private Security Security;\n        private int Quantity = 100;\n        private const int DeltaQuantity = 10;\n\n        private const decimal StopPercentage = 0.025m;\n        private const decimal StopPercentageDelta = 0.005m;\n        private const decimal LimitPercentage = 0.025m;\n        private const decimal LimitPercentageDelta = 0.005m;\n\n        private const string symbol = \"SPY\";\n        private const SecurityType SecType = SecurityType.Equity;\n\n        private readonly CircularQueue<OrderType> _orderTypesQueue = new CircularQueue<OrderType>(Enum.GetValues(typeof(OrderType))\n                                                                        .OfType<OrderType>()\n                                                                        .Where (x => x != OrderType.OptionExercise && x != OrderType.LimitIfTouched\n                                                                            && x != OrderType.ComboMarket && x != OrderType.ComboLimit && x != OrderType.ComboLegLimit));\n        private readonly List<OrderTicket> _tickets = new List<OrderTicket>();\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 01, 01);  //Set Start Date\n            SetEndDate(2015, 01, 01);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecType, symbol, Resolution.Daily);\n            Security = Securities[symbol];\n\n            _orderTypesQueue.CircleCompleted += (sender, args) =>\n            {\n                // flip our signs when we've gone through all the order types\n                Quantity *= -1;\n            };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!slice.Bars.ContainsKey(symbol)) return;\n\n            // each month make an action\n            if (Time.Month != LastMonth)\n            {\n                // we'll submit the next type of order from the queue\n                var orderType = _orderTypesQueue.Dequeue();\n                //Log(\"\");\n                Log($\"\\r\\n--------------MONTH: {Time.ToStringInvariant(\"MMMM\")}:: {orderType}\\r\\n\");\n                //Log(\"\");\n                LastMonth = Time.Month;\n                Log(\"ORDER TYPE:: \" + orderType);\n                var isLong = Quantity > 0;\n                var stopPrice = isLong ? (1 + StopPercentage)*slice.Bars[symbol].High : (1 - StopPercentage)*slice.Bars[symbol].Low;\n                var limitPrice = isLong ? (1 - LimitPercentage)*stopPrice : (1 + LimitPercentage)*stopPrice;\n                if (orderType == OrderType.Limit)\n                {\n                    limitPrice = !isLong ? (1 + LimitPercentage) * slice.Bars[symbol].High : (1 - LimitPercentage) * slice.Bars[symbol].Low;\n                }\n                var request = new SubmitOrderRequest(orderType, SecType, symbol, Quantity, stopPrice, limitPrice, 0, 0.01m, true, UtcTime,\n                    ((int)orderType).ToString(CultureInfo.InvariantCulture));\n                var ticket = Transactions.AddOrder(request);\n                _tickets.Add(ticket);\n            }\n            else if (_tickets.Count > 0)\n            {\n                var ticket = _tickets.Last();\n                if (Time.Day > 8 && Time.Day < 14)\n                {\n                    if (ticket.UpdateRequests.Count == 0 && ticket.Status.IsOpen())\n                    {\n                        Log(\"TICKET:: \" + ticket);\n                        ticket.Update(new UpdateOrderFields\n                        {\n                            Quantity = ticket.Quantity + Math.Sign(Quantity)*DeltaQuantity,\n                            Tag = \"Change quantity: \" + Time.Day\n                        });\n                        Log(\"UPDATE1:: \" + ticket.UpdateRequests.Last());\n                    }\n                }\n                else if (Time.Day > 13 && Time.Day < 20)\n                {\n                    if (ticket.UpdateRequests.Count == 1 && ticket.Status.IsOpen())\n                    {\n                        Log(\"TICKET:: \" + ticket);\n                        ticket.Update(new UpdateOrderFields\n                        {\n                            LimitPrice = Security.Price*(1 - Math.Sign(ticket.Quantity)*LimitPercentageDelta),\n                            StopPrice = ticket.OrderType != OrderType.TrailingStop\n                                ? Security.Price*(1 + Math.Sign(ticket.Quantity)*StopPercentageDelta)\n                                : null,\n                            Tag = \"Change prices: \" + Time.Day\n                        });\n                        Log(\"UPDATE2:: \" + ticket.UpdateRequests.Last());\n                    }\n                }\n                else\n                {\n                    if (ticket.UpdateRequests.Count == 2 && ticket.Status.IsOpen())\n                    {\n                        Log(\"TICKET:: \" + ticket);\n                        ticket.Cancel(Time.Day + \" and is still open!\");\n                        Log(\"CANCELLED:: \" + ticket.CancelRequest);\n                    }\n                }\n            }\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            // if the order time isn't equal to the algo time, then the modified time on the order should be updated\n            var order = Transactions.GetOrderById(orderEvent.OrderId);\n            var ticket = Transactions.GetOrderTicket(orderEvent.OrderId);\n            if (order.Status == OrderStatus.Canceled && order.CanceledTime != orderEvent.UtcTime)\n            {\n                throw new RegressionTestException(\"Expected canceled order CanceledTime to equal canceled order event time.\");\n            }\n\n            // fills update LastFillTime\n            if ((order.Status == OrderStatus.Filled || order.Status == OrderStatus.PartiallyFilled) && order.LastFillTime != orderEvent.UtcTime)\n            {\n                throw new RegressionTestException(\"Expected filled order LastFillTime to equal fill order event time.\");\n            }\n\n            // check the ticket to see if the update was successfully processed\n            if (ticket.UpdateRequests.Any(ur => ur.Response?.IsSuccess == true) && order.CreatedTime != UtcTime && order.LastUpdateTime == null)\n            {\n                throw new RegressionTestException(\"Expected updated order LastUpdateTime to equal submitted update order event time\");\n            }\n\n            if (orderEvent.Status == OrderStatus.Filled)\n            {\n                Log(\"FILLED:: \" + Transactions.GetOrderById(orderEvent.OrderId) + \" FILL PRICE:: \" + orderEvent.FillPrice.SmartRounding());\n            }\n            else\n            {\n                Log(orderEvent.ToString());\n                Log(\"TICKET:: \" + ticket);\n            }\n        }\n\n        private new void Log(string msg)\n        {\n            if (LiveMode) Debug(msg);\n            else base.Log(msg);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 4030;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"24\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-2.00%\"},\n            {\"Compounding Annual Return\", \"-15.280%\"},\n            {\"Drawdown\", \"30.100%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"71786.23\"},\n            {\"Net Profit\", \"-28.214%\"},\n            {\"Sharpe Ratio\", \"-1.107\"},\n            {\"Sortino Ratio\", \"-1.357\"},\n            {\"Probabilistic Sharpe Ratio\", \"0.024%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.03\"},\n            {\"Beta\", \"-0.952\"},\n            {\"Annual Standard Deviation\", \"0.1\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-1.375\"},\n            {\"Tracking Error\", \"0.189\"},\n            {\"Treynor Ratio\", \"0.117\"},\n            {\"Total Fees\", \"$20.00\"},\n            {\"Estimated Strategy Capacity\", \"$1000000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"0.50%\"},\n            {\"Drawdown Recovery\", \"47\"},\n            {\"OrderListHash\", \"290d228f253e9cf8b6d7de194664ce55\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/UserDefinedUniverseAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm shows how you can handle universe selection in anyway you like,\n    /// at any time you like. This algorithm has a list of 10 stocks that it rotates\n    /// through every hour.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"universes\" />\n    /// <meta name=\"tag\" content=\"custom universes\" />\n    public class UserDefinedUniverseAlgorithm : QCAlgorithm\n    {\n        private static readonly IReadOnlyList<string> Symbols = new List<string>\n        {\n            \"SPY\", \"GOOG\", \"IBM\", \"AAPL\", \"MSFT\", \"CSCO\", \"ADBE\", \"WMT\",\n        };\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            SetStartDate(2015, 01, 01);\n            SetEndDate(2015, 12, 01);\n\n            AddUniverse(\"my-universe-name\", Resolution.Hour, time =>\n            {\n                var hour = time.Hour;\n                var index = hour%Symbols.Count;\n                return new List<string> {Symbols[index]};\n            });\n        }\n\n        public override void OnData(Slice slice)\n        {\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                if (removed.Invested)\n                {\n                    Liquidate(removed.Symbol);\n                }\n            }\n\n            foreach (var added in changes.AddedSecurities)\n            {\n                SetHoldings(added.Symbol, 1/(decimal)changes.AddedSecurities.Count);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/VBaseSignalExportDemonstrationAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing PortfolioTarget = QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm sends a list of portfolio targets to vBsase API\n    /// </summary>\n    public class VBaseSignalExportDemonstrationAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// vBase API KEY: This value is provided by vBase in your profile section\n        /// See API documentation at https://docs.vbase.com/getting-started/rest-api-user-guide\n        /// </summary>\n        private const string _vbaseApiKey = \"YOUR API KEY\";\n        private const string _vbaseCollectionName = \"YOUR COLLECTION\";\n        private bool _sentSignal;\n        private List<Symbol> _symbols = new()\n        {\n            QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n            QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n        };\n\n        /// <summary>\n        /// Stamping of predefined portfolio targets\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            foreach (var item in _symbols)\n            {\n                AddEquity(item);\n            }\n\n            // Add vBase signal export provider\n            SignalExport.AddSignalExportProvider(new VBaseSignalExport(_vbaseApiKey, _vbaseCollectionName));\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (_sentSignal)\n            {\n                return;\n            }\n            _sentSignal = true;\n\n            var targets = new[]\n            {\n                new PortfolioTarget(_symbols[0], 0.25m), // 0.25 of the portfolio in SPY\n                new PortfolioTarget(_symbols[1], 0.75m) // 0.75 of the portfolio in IBM\n            };\n\n            SignalExport.SetTargetPortfolio(targets);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 7843;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/VolatilityModelsWithRawDataAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that the volatility models don't have big jumps due to price discontinuities on splits and dividends when using raw data\n    /// </summary>\n    public class VolatilityModelsWithRawDataAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _aapl;\n\n        private int _splitsCount;\n        private int _dividendsCount;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 1, 1);\n            SetEndDate(2014, 12, 31);\n            SetCash(100000);\n\n            var equity = AddEquity(\"AAPL\", Resolution.Daily, dataNormalizationMode: DataNormalizationMode.Raw);\n            equity.SetVolatilityModel(new StandardDeviationOfReturnsVolatilityModel(7));\n\n            _aapl = equity.Symbol;\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (slice.Splits.ContainsKey(_aapl))\n            {\n                _splitsCount++;\n            }\n\n            if (slice.Dividends.ContainsKey(_aapl))\n            {\n                _dividendsCount++;\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            if (symbol != _aapl)\n            {\n                return;\n            }\n\n            // This is expected only in this case, 0.6 is not a magical number of any kind.\n            // Just making sure we don't get big jumps on volatility\n            if (Securities[_aapl].VolatilityModel.Volatility > 0.6m)\n            {\n                throw new RegressionTestException(\n                    \"Expected volatility to stay less than 0.6 (not big jumps due to price discontinuities on splits and dividends), \" +\n                    $\"but got {Securities[_aapl].VolatilityModel.Volatility}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_splitsCount == 0 || _dividendsCount == 0)\n            {\n                throw new RegressionTestException($\"Expected to receive at least one split and one dividend, but got {_splitsCount} splits and {_dividendsCount} dividends\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 2021;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 40;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-1.025\"},\n            {\"Tracking Error\", \"0.094\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/VolumeRenkoConsolidatorAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demostrates the use of <see cref=\"VolumeRenkoConsolidator\"/> for creating constant volume bar\n    /// </summary>\n    /// <meta name=\"tag\" content=\"renko\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    /// <meta name=\"tag\" content=\"consolidating data\" />\n    public class VolumeRenkoConsolidatorAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy, _ibm;\n        private VolumeRenkoConsolidator _tradebarVolumeConsolidator, _tickVolumeConsolidator;\n        private SimpleMovingAverage _sma = new SimpleMovingAverage(10);\n        private bool _tickConsolidated = false;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 7);\n            SetEndDate(2013, 10, 11);\n            SetCash(100000);\n\n            _spy = AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            _tradebarVolumeConsolidator = new VolumeRenkoConsolidator(1000000);\n            _tradebarVolumeConsolidator.DataConsolidated += (sender, bar) => {\n                _sma.Update(bar.EndTime, bar.Value);\n                Debug($\"SPY {bar.Time} to {bar.EndTime} :: O:{bar.Open} H:{bar.High} L:{bar.Low} C:{bar.Close} V:{bar.Volume}\");\n                if (bar.Volume != 1000000)\n                {\n                    throw new RegressionTestException(\"Volume of consolidated bar does not match set value!\");\n                }\n            };\n\n            _ibm = AddEquity(\"IBM\", Resolution.Tick).Symbol;\n            _tickVolumeConsolidator = new VolumeRenkoConsolidator(1000000);\n            _tickVolumeConsolidator.DataConsolidated += (sender, bar) => {\n                Debug($\"IBM {bar.Time} to {bar.EndTime} :: O:{bar.Open} H:{bar.High} L:{bar.Low} C:{bar.Close} V:{bar.Volume}\");\n                if (bar.Volume != 1000000)\n                {\n                    throw new RegressionTestException(\"Volume of consolidated bar does not match set value!\");\n                }\n                _tickConsolidated = true;\n            };\n\n            var history = History<TradeBar>(new[] {_spy}, 1000, Resolution.Minute);\n            foreach (var slice in history)\n            {\n                _tradebarVolumeConsolidator.Update(slice[_spy]);\n            }\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Update by TradeBar\n            if (slice.Bars.ContainsKey(_spy))\n            {\n                _tradebarVolumeConsolidator.Update(slice.Bars[_spy]);\n            }\n\n            // Update by Tick\n            if (slice.Ticks.ContainsKey(_ibm))\n            {\n                foreach (var tick in slice.Ticks[_ibm])\n                {\n                    _tickVolumeConsolidator.Update(tick);\n                }\n            }\n\n            if (_sma.IsReady && _sma.Current.Value < Securities[_spy].Price)\n            {\n                SetHoldings(_spy, 1m);\n            }\n            else\n            {\n                SetHoldings(_spy, 0m);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_tickConsolidated)\n            {\n                throw new RegressionTestException(\"Tick consolidator was never been called\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 698706;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 390;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"225\"},\n            {\"Average Win\", \"0.25%\"},\n            {\"Average Loss\", \"-0.05%\"},\n            {\"Compounding Annual Return\", \"-48.296%\"},\n            {\"Drawdown\", \"3.000%\"},\n            {\"Expectancy\", \"-0.190\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99160.18\"},\n            {\"Net Profit\", \"-0.840%\"},\n            {\"Sharpe Ratio\", \"-0.987\"},\n            {\"Sortino Ratio\", \"-7.639\"},\n            {\"Probabilistic Sharpe Ratio\", \"41.344%\"},\n            {\"Loss Rate\", \"87%\"},\n            {\"Win Rate\", \"13%\"},\n            {\"Profit-Loss Ratio\", \"5.05\"},\n            {\"Alpha\", \"-2.224\"},\n            {\"Beta\", \"1.009\"},\n            {\"Annual Standard Deviation\", \"0.234\"},\n            {\"Annual Variance\", \"0.055\"},\n            {\"Information Ratio\", \"-33.249\"},\n            {\"Tracking Error\", \"0.066\"},\n            {\"Treynor Ratio\", \"-0.229\"},\n            {\"Total Fees\", \"$765.34\"},\n            {\"Estimated Strategy Capacity\", \"$4100000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"4497.77%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"bc7753018280859a55ca9834f21c511a\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/VolumeShareSlippageModelAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Example algorithm implementing VolumeShareSlippageModel.\n    /// </summary>\n    public class VolumeShareSlippageModelAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<Symbol> _longs = new();\n        private List<Symbol> _shorts = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2020, 11, 29);\n            SetEndDate(2020, 12, 2);\n            // To set the slippage model to limit to fill only 30% volume of the historical volume, with 5% slippage impact.\n            SetSecurityInitializer((security) => security.SetSlippageModel(new VolumeShareSlippageModel(0.3m, 0.05m)));\n\n            // Create SPY symbol to explore its constituents.\n            var spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            UniverseSettings.Resolution = Resolution.Daily;\n            // Add universe to trade on the most and least weighted stocks among SPY constituents.\n            AddUniverse(Universe.ETF(spy, universeFilterFunc: Selection));\n        }\n\n        private IEnumerable<Symbol> Selection(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            var sortedByDollarVolume = constituents.OrderBy(x => x.Weight).ToList();\n            // Add the 10 most weighted stocks to the universe to long later.\n            _longs = sortedByDollarVolume.TakeLast(10)\n                .Select(x => x.Symbol)\n                .ToList();\n            // Add the 10 least weighted stocks to the universe to short later.\n            _shorts = sortedByDollarVolume.Take(10)\n                .Select(x => x.Symbol)\n                .ToList();\n\n            return _longs.Union(_shorts);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Equally invest into the selected stocks to evenly dissipate capital risk.\n            // Dollar neutral of long and short stocks to eliminate systematic risk, only capitalize the popularity gap.\n            var targets = _longs.Select(symbol => new PortfolioTarget(symbol, 0.05m)).ToList();\n            targets.AddRange(_shorts.Select(symbol => new PortfolioTarget(symbol, -0.05m)).ToList());\n\n            // Liquidate the ones not being the most and least popularity stocks to release fund for higher expected return trades.\n            SetHoldings(targets, liquidateExistingHoldings: true);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 1035;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"4\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"20.900%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100190.84\"},\n            {\"Net Profit\", \"0.191%\"},\n            {\"Sharpe Ratio\", \"9.794\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.297\"},\n            {\"Beta\", \"-0.064\"},\n            {\"Annual Standard Deviation\", \"0.017\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-18.213\"},\n            {\"Tracking Error\", \"0.099\"},\n            {\"Treynor Ratio\", \"-2.695\"},\n            {\"Total Fees\", \"$4.00\"},\n            {\"Estimated Strategy Capacity\", \"$4400000000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"4.22%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"9d2bd0df7c094c393e77f72b7739bfa0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm for the VolumeWeightedAveragePriceExecutionModel.\n    /// This algorithm shows how the execution model works to split up orders and submit them only when\n    /// the price is on the favorable side of the intraday VWAP.\n    /// </summary>\n    public class VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Minute;\n\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n            SetCash(1000000);\n\n            SetUniverseSelection(new ManualUniverseSelectionModel(\n                QuantConnect.Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA)\n            ));\n\n            // using hourly rsi to generate more insights\n            SetAlpha(new RsiAlphaModel(14, Resolution.Hour));\n            SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());\n            SetExecution(new VolumeWeightedAveragePriceExecutionModel());\n\n            InsightsGenerated += (algorithm, data) => Log($\"{Time}: {string.Join(\" | \", data.Insights.Select(insight => insight))}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Log($\"{Time}: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15643;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 56;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"239\"},\n            {\"Average Win\", \"0.05%\"},\n            {\"Average Loss\", \"-0.01%\"},\n            {\"Compounding Annual Return\", \"434.257%\"},\n            {\"Drawdown\", \"1.300%\"},\n            {\"Expectancy\", \"1.938\"},\n            {\"Start Equity\", \"1000000\"},\n            {\"End Equity\", \"1021655.71\"},\n            {\"Net Profit\", \"2.166%\"},\n            {\"Sharpe Ratio\", \"11.638\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"70.318%\"},\n            {\"Loss Rate\", \"31%\"},\n            {\"Win Rate\", \"69%\"},\n            {\"Profit-Loss Ratio\", \"3.26\"},\n            {\"Alpha\", \"0.85\"},\n            {\"Beta\", \"1.059\"},\n            {\"Annual Standard Deviation\", \"0.253\"},\n            {\"Annual Variance\", \"0.064\"},\n            {\"Information Ratio\", \"10.466\"},\n            {\"Tracking Error\", \"0.092\"},\n            {\"Treynor Ratio\", \"2.778\"},\n            {\"Total Fees\", \"$399.15\"},\n            {\"Estimated Strategy Capacity\", \"$470000.00\"},\n            {\"Lowest Capacity Asset\", \"AIG R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"130.79%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"7a14c40f79d36294f931cd4b1f9e7179\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmUpAfterInitializeRegression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test warming up after initialize behavior, should throw if used outside of initialize\n    /// Reference GH Issue #4939\n    /// </summary>\n    public class WarmUpAfterInitializeRegression : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);\n            var equity = AddEquity(\"SPY\");\n        }\n\n        public override void OnData(Slice slice)\n        {\n            // Should throw and set Algorithm status to be runtime error\n            SetWarmUp(TimeSpan.FromDays(2));\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 10;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.RuntimeError;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Demonstration algorithm for the Warm Up feature with basic indicators.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"warm up\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class WarmupAlgorithm : QCAlgorithm\n    {\n        private bool _first = true;\n        private string _symbol = \"SPY\";\n        private const int FastPeriod = 60;\n        private const int SlowPeriod = 3600;\n        private ExponentialMovingAverage _fast, _slow;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Equity, _symbol, Resolution.Second);\n\n            _fast = EMA(_symbol, FastPeriod);\n            _slow = EMA(_symbol, SlowPeriod);\n\n            SetWarmup(SlowPeriod);\n        }\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_first && !IsWarmingUp)\n            {\n                _first = false;\n                Debug(\"Fast: \" + _fast.Samples);\n                Debug(\"Slow: \" + _slow.Samples);\n            }\n            if (_fast > _slow)\n            {\n                SetHoldings(_symbol, 1);\n            }\n            else\n            {\n                SetHoldings(_symbol, -1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupConversionRatesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This regression algorithm is a test case for validation of conversion rates during warm up.\n    /// </summary>\n    public class WarmupConversionRatesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 4, 5);\n            SetEndDate(2018, 4, 5);\n            SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);\n            SetCash(10000);\n\n            SetWarmUp(TimeSpan.FromDays(1));\n            AddCrypto(\"BTCEUR\");\n            AddCrypto(\"LTCUSD\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (Portfolio.CashBook[\"EUR\"].ConversionRate == 0\n                || Portfolio.CashBook[\"BTC\"].ConversionRate == 0\n                || Portfolio.CashBook[\"LTC\"].ConversionRate == 0)\n            {\n                Log($\"BTCEUR current price: {Securities[\"BTCEUR\"].Price}\");\n                Log($\"LTCUSD current price: {Securities[\"LTCUSD\"].Price}\");\n                Log($\"EUR conversion rate: {Portfolio.CashBook[\"EUR\"].ConversionRate}\");\n                Log($\"BTC conversion rate: {Portfolio.CashBook[\"BTC\"].ConversionRate}\");\n                Log($\"LTC conversion rate: {Portfolio.CashBook[\"LTC\"].ConversionRate}\");\n\n                throw new RegressionTestException(\"Conversion rate is 0\");\n            }\n\n            if (IsWarmingUp) return;\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(\"LTCUSD\", 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 17277;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 20;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"10000.00\"},\n            {\"End Equity\", \"9884.48\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$29.84\"},\n            {\"Estimated Strategy Capacity\", \"$410000.00\"},\n            {\"Lowest Capacity Asset\", \"LTCUSD 2XR\"},\n            {\"Portfolio Turnover\", \"100.61%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"716b5757844f607d1402a5571f015aea\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupDailyResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected\n    /// </summary>\n    public class WarmupDailyResolutionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private long _previousSampleCount;\n        private bool _warmedUpTradeBars;\n        private bool _warmedUpQuoteBars;\n\n        protected SimpleMovingAverage Sma { get; set; }\n        protected TimeSpan ExpectedDataSpan { get; set; }\n        protected TimeSpan ExpectedWarmupDataSpan { get; set; }\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 10);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Hour);\n            ExpectedDataSpan = Resolution.Hour.ToTimeSpan();\n\n            SetWarmUp(TimeSpan.FromDays(3), Resolution.Daily);\n            ExpectedWarmupDataSpan = TimeSpan.FromHours(6.5);\n\n            Sma = SMA(\"SPY\", 2);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            if (Sma.Samples <= _previousSampleCount)\n            {\n                throw new RegressionTestException(\"Indicator was not updated!\");\n            }\n            _previousSampleCount = Sma.Samples;\n\n            var tradeBars = slice.Get<TradeBar>();\n            tradeBars.TryGetValue(\"SPY\", out var trade);\n\n            var quoteBars = slice.Get<QuoteBar>();\n            quoteBars.TryGetValue(\"SPY\", out var quote);\n\n            var expectedPeriod = ExpectedDataSpan;\n            if (Time <= StartDate)\n            {\n                expectedPeriod = ExpectedWarmupDataSpan;\n                if (trade != null && trade.IsFillForward || quote != null && quote.IsFillForward)\n                {\n                    throw new RegressionTestException(\"Unexpected fill forwarded data!\");\n                }\n            }\n\n            if (expectedPeriod == TimeSpan.FromHours(6.5))\n            {\n                // let's assert the data's time are what we expect\n                if (trade != null && trade.EndTime.Hour != 16)\n                {\n                    throw new RegressionTestException($\"Unexpected data end time! {trade.EndTime}\");\n                }\n                if (quote != null && quote.EndTime.Hour != 16)\n                {\n                    throw new RegressionTestException($\"Unexpected data end time! {quote.EndTime}\");\n                }\n            }\n            else\n            {\n                // let's assert the data's time are what we expect\n                if (trade != null && trade.EndTime.Ticks % expectedPeriod.Ticks != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected data end time! {trade.EndTime}\");\n                }\n                if (quote != null && quote.EndTime.Ticks % expectedPeriod.Ticks != 0)\n                {\n                    throw new RegressionTestException($\"Unexpected data end time! {quote.EndTime}\");\n                }\n            }\n\n            if (trade != null)\n            {\n                _warmedUpTradeBars |= IsWarmingUp;\n                if (trade.Period != expectedPeriod)\n                {\n                    throw new RegressionTestException($\"Unexpected period for trade data point {trade.Period} expected {expectedPeriod}. IsWarmingUp: {IsWarmingUp}\");\n                }\n            }\n            if (quote != null)\n            {\n                _warmedUpQuoteBars |= IsWarmingUp;\n                if (quote.Period != expectedPeriod)\n                {\n                    throw new RegressionTestException($\"Unexpected period for quote data point {quote.Period} expected {expectedPeriod}. IsWarmingUp: {IsWarmingUp}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_warmedUpTradeBars)\n            {\n                throw new RegressionTestException(\"Did not assert data during warmup!\");\n            }\n\n            if (ExpectedWarmupDataSpan == TimeSpan.FromHours(6.5))\n            {\n                if (_warmedUpQuoteBars)\n                {\n                    throw new RegressionTestException(\"We should of not gotten any quote bar during warmup for daily resolution!\");\n                }\n            }\n            else if (!_warmedUpQuoteBars)\n            {\n                throw new RegressionTestException(\"Did not assert data during warmup!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 36;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupDataTypesBarCountWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class WarmupDataTypesBarCountWarmupRegressionAlgorithm : WarmupDataTypesRegressionAlgorithm\n    {\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            // We want to match the start time of the base algorithm: Base algorithm warmup is 24 bars of hour resolution.\n            // So to match the same start time we go back 5 days + a few hours, we need to account for weekends. This is calculated by 'Time.GetStartTimeForTradeBars'\n            // Each day has 7 hour bars => 3 complete days 21 hours + 2 weekend days + 3 hours of the previous day (24 PM - 11 hours = 13 PM - 13/14/15 hour bars)\n            SetWarmUp(24 * 5 + 11);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 5299;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupDataTypesRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue 6263. Where some data types would get dropped from the warmup feed\n    /// </summary>\n    public class WarmupDataTypesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _equityGotTradeBars;\n        private bool _equityGotQuoteBars;\n\n        private bool _cryptoGotTradeBars;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            AddEquity(\"SPY\", Resolution.Minute, fillForward: false);\n            AddCrypto(\"BTCUSD\", Resolution.Hour, market: Market.Bitfinex, fillForward: false);\n\n            SetWarmUp(24, Resolution.Hour);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Debug($\"[{Time}] Warmup: {IsWarmingUp}. Invested: {Portfolio.Invested} {string.Join(\",\", Securities.Select(pair => $\"{pair.Key.Value}:{pair.Value.Price}\"))}\");\n            if (IsWarmingUp)\n            {\n                _equityGotTradeBars |= slice.Bars.ContainsKey(\"SPY\");\n                _equityGotQuoteBars |= slice.QuoteBars.ContainsKey(\"SPY\");\n\n                _cryptoGotTradeBars |= slice.Bars.ContainsKey(\"BTCUSD\");\n            }\n            else\n            {\n                if (!Portfolio.Invested)\n                {\n                    AddEquity(\"AAPL\", Resolution.Hour);\n                    SetHoldings(\"BTCUSD\", 0.3);\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_equityGotTradeBars || !_cryptoGotTradeBars)\n            {\n                throw new RegressionTestException(\"Did not get any TradeBar during warmup\");\n            }\n            // we don't have quote bars for equity in daily/hour resolutions\n            if (!_equityGotQuoteBars && !Settings.WarmupResolution.HasValue)\n            {\n                throw new RegressionTestException(\"Did not get any QuoteBar during warmup\");\n            }\n            if (Securities[\"AAPL\"].Price == 0)\n            {\n                throw new RegressionTestException(\"Security added after warmup didn't get any data!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 3764;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 5;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"106.090%\"},\n            {\"Drawdown\", \"0.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.0\"},\n            {\"End Equity\", \"100596.13\"},\n            {\"Net Profit\", \"0.596%\"},\n            {\"Sharpe Ratio\", \"123.324\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.394\"},\n            {\"Beta\", \"0.029\"},\n            {\"Annual Standard Deviation\", \"0.007\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-65.071\"},\n            {\"Tracking Error\", \"0.236\"},\n            {\"Treynor Ratio\", \"29.932\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$3000.00\"},\n            {\"Lowest Capacity Asset\", \"BTCUSD E3\"},\n            {\"Portfolio Turnover\", \"9.97%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"98661718a82110916cdeceed756c5d37\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupFutureRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of future warmup\n    /// </summary>\n    public class WarmupFutureRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        // S&P 500 EMini futures\n        private const string RootSP500 = Futures.Indices.SP500EMini;\n        private readonly Symbol SP500 = QuantConnect.Symbol.Create(RootSP500, SecurityType.Future, Market.CME);\n\n        protected List<DateTime> ContinuousWarmupTimes { get; } = new();\n        protected List<DateTime> ChainWarmupTimes { get; } = new();\n\n        /// <summary>\n        /// Initialize your algorithm and add desired assets.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 10);\n\n            var futureSP500 = AddFuture(RootSP500);\n            futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));\n\n            SetWarmUp(1, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if(IsWarmingUp && slice.ContainsKey(SP500))\n            {\n                if (Securities[SP500].AskPrice == 0)\n                {\n                    throw new RegressionTestException(\"Continuous contract price is not set!\");\n                }\n                ContinuousWarmupTimes.Add(Time);\n            }\n\n            foreach (var chain in slice.FutureChains)\n            {\n                // find the front contract expiring no earlier than in 90 days\n                var contract = (\n                    from futuresContract in chain.Value.OrderBy(x => x.Expiry)\n                    where futuresContract.Expiry > Time.Date.AddDays(90)\n                    select futuresContract\n                ).FirstOrDefault();\n\n                // if found, trade it\n                if (contract != null)\n                {\n                    if (IsWarmingUp)\n                    {\n                        if (contract.AskPrice == 0)\n                        {\n                            throw new RegressionTestException(\"Contract price is not set!\");\n                        }\n                        ChainWarmupTimes.Add(Time);\n                    }\n                    else if (!Portfolio.Invested && IsMarketOpen(contract.Symbol))\n                    {\n                        MarketOrder(contract.Symbol, 1);\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            AssertDataTime(new DateTime(2013, 10, 07, 20, 0, 0), new DateTime(2013, 10, 08, 20, 0, 0), ChainWarmupTimes);\n            AssertDataTime(new DateTime(2013, 10, 07, 20, 0, 0), new DateTime(2013, 10, 08, 20, 0, 0), ContinuousWarmupTimes);\n        }\n\n        protected void AssertDataTime(DateTime start, DateTime end, List<DateTime> times)\n        {\n            var count = 0;\n            do\n            {\n                if (Securities[SP500].Exchange.Hours.IsOpen(start.AddMinutes(-1), false))\n                {\n                    if (times[count] != start)\n                    {\n                        throw new RegressionTestException($\"Unexpected time {times[count]} expected {start}\");\n                    }\n                    // if the market is closed there will be no data, so stop moving the index counter\n                    count++;\n                }\n                if (Settings.WarmupResolution.HasValue)\n                {\n                    start = start.Add(Settings.WarmupResolution.Value.ToTimeSpan());\n                }\n                else\n                {\n                    start = start.AddMinutes(1);\n                }\n            }\n            while (start < end);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 14938;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"112.304%\"},\n            {\"Drawdown\", \"1.400%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100620.7\"},\n            {\"Net Profit\", \"0.621%\"},\n            {\"Sharpe Ratio\", \"47.958\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-3.383\"},\n            {\"Beta\", \"0.742\"},\n            {\"Annual Standard Deviation\", \"0.18\"},\n            {\"Annual Variance\", \"0.032\"},\n            {\"Information Ratio\", \"-120.79\"},\n            {\"Tracking Error\", \"0.063\"},\n            {\"Treynor Ratio\", \"11.64\"},\n            {\"Total Fees\", \"$2.15\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"ES VP274HSU1AF5\"},\n            {\"Portfolio Turnover\", \"28.05%\"},\n            {\"Drawdown Recovery\", \"1\"},\n            {\"OrderListHash\", \"1b8fcad46bd578e36bbecdf922b2deb0\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupFutureTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class WarmupFutureTimeSpanWarmupRegressionAlgorithm : WarmupFutureRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetWarmUp(TimeSpan.FromHours(24 + 4));\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            AssertDataTime(new DateTime(2013, 10, 07, 0, 0, 0), new DateTime(2013, 10, 08, 0, 0, 0), ChainWarmupTimes);\n            AssertDataTime(new DateTime(2013, 10, 07, 0, 0, 0), new DateTime(2013, 10, 08, 0, 0, 0), ContinuousWarmupTimes);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 19892;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupHistoryAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm demonstrates using the history provider to retrieve data\n    /// to warm up indicators before data is received.\n    /// </summary>\n    /// <meta name=\"tag\" content=\"indicators\" />\n    /// <meta name=\"tag\" content=\"history\" />\n    /// <meta name=\"tag\" content=\"history and warm up\" />\n    /// <meta name=\"tag\" content=\"using data\" />\n    public class WarmupHistoryAlgorithm : QCAlgorithm\n    {\n        private ExponentialMovingAverage fast, slow;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n            // Find more symbols here: http://quantconnect.com/data\n            AddSecurity(SecurityType.Forex, \"EURUSD\", Resolution.Second);\n\n            fast = EMA(\"EURUSD\", 60);\n            slow = EMA(\"EURUSD\", 3600);\n\n            // 3601 because rolling window waits for one to fall off the back to be considered ready\n            var history = History<QuoteBar>(\"EURUSD\", 3601);\n            foreach (var bar in history)\n            {\n                fast.Update(bar.EndTime, bar.Close);\n                slow.Update(bar.EndTime, bar.Close);\n            }\n\n            Log($\"FAST IS {(fast.IsReady ? \"\" : \"NOT\")} READY. Samples: {fast.Samples.ToStringInvariant()}\");\n            Log($\"SLOW IS {(slow.IsReady ? \"\" : \"NOT\")} READY. Samples: {slow.Samples.ToStringInvariant()}\");\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (fast > slow)\n            {\n                SetHoldings(\"EURUSD\", 1);\n            }\n            else\n            {\n                SetHoldings(\"EURUSD\", -1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupIndicatorRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// This algorithm reproduces GH issue 2404, exception: `This is a forward only indicator`\n    /// </summary>\n    public class WarmupIndicatorRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 11, 1);\n            SetEndDate(2013, 12, 10);    //Set End Date\n            SetWarmup(TimeSpan.FromDays(30));\n\n            _spy = AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            var renkoConsolidator = new ClassicRenkoConsolidator(2m);\n            renkoConsolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                if (IsWarmingUp) return;\n                if (!Portfolio.Invested)\n                {\n                    SetHoldings(_spy, 1.0);\n                }\n                Log($\"CLOSE - {consolidated.Time:o} - {consolidated.Open} {consolidated.Close}\");\n            };\n            var sma = new SimpleMovingAverage(\"SMA\", 3);\n            RegisterIndicator(_spy, sma, renkoConsolidator);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 397;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"11.962%\"},\n            {\"Drawdown\", \"1.200%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"101236.75\"},\n            {\"Net Profit\", \"1.237%\"},\n            {\"Sharpe Ratio\", \"1.636\"},\n            {\"Sortino Ratio\", \"3.633\"},\n            {\"Probabilistic Sharpe Ratio\", \"62.183%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0.001\"},\n            {\"Beta\", \"0.425\"},\n            {\"Annual Standard Deviation\", \"0.047\"},\n            {\"Annual Variance\", \"0.002\"},\n            {\"Information Ratio\", \"-1.856\"},\n            {\"Tracking Error\", \"0.054\"},\n            {\"Treynor Ratio\", \"0.18\"},\n            {\"Total Fees\", \"$3.23\"},\n            {\"Estimated Strategy Capacity\", \"$810000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.48%\"},\n            {\"Drawdown Recovery\", \"10\"},\n            {\"OrderListHash\", \"be8d7533a3c80d8c768d51a5d5098143\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionBarCountRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected\n    /// </summary>\n    public class WarmupLowerResolutionBarCountRegressionAlgorithm : WarmupLowerResolutionTimeSpanRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n\n            AddEquity(\"SPY\", Resolution.Second);\n            SetWarmUp(60 * 6 + 30, Resolution.Minute);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionBarCountSettingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected\n    /// </summary>\n    public class WarmupLowerResolutionBarCountSettingRegressionAlgorithm : WarmupLowerResolutionTimeSpanRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n\n            AddEquity(\"SPY\", Resolution.Second);\n            SetWarmUp(60 * 6 + 30);\n            Settings.WarmupResolution = Resolution.Minute;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected using options\n    /// </summary>\n    public class WarmupLowerResolutionOptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private List<DateTime> _optionWarmupTimes = new();\n        private const string UnderlyingTicker = \"AAPL\";\n        private Symbol _optionSymbol;\n\n        public override void Initialize()\n        {\n            SetStartDate(2014, 06, 09);\n            SetEndDate(2014, 06, 09);\n\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.Strikes(-5, +5).Expiration(0, 180).IncludeWeeklys());\n            SetWarmUp(TimeSpan.FromDays(3), Resolution.Daily);\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (IsWarmingUp)\n            {\n                foreach (var data in slice.Values)\n                {\n                    var dataSpan = data.EndTime - data.Time;\n                    if (dataSpan != TimeSpan.FromHours(6.5))\n                    {\n                        throw new RegressionTestException($\"Unexpected bar span! {data}: {dataSpan}\");\n                    }\n                }\n            }\n\n            if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                // we find at the money (ATM) put contract with farthest expiration\n                var atmContract = chain\n                    .OrderByDescending(x => x.Expiry)\n                    .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                    .ThenByDescending(x => x.Right)\n                    .FirstOrDefault();\n\n                if (atmContract != null)\n                {\n                    if (IsWarmingUp)\n                    {\n                        if (atmContract.LastPrice == 0)\n                        {\n                            throw new RegressionTestException(\"Contract price is not set!\");\n                        }\n                        _optionWarmupTimes.Add(Time);\n                    }\n                    else if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            Debug($\"{Time}-{changes}\");\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var start = new DateTime(2014, 06, 06, 16, 0, 0);\n            var end = new DateTime(2014, 06, 07, 0, 0, 0);\n            var count = 0;\n            do\n            {\n                if (_optionWarmupTimes[count] != start)\n                {\n                    throw new RegressionTestException($\"Unexpected time {_optionWarmupTimes[count]} expected {start}\");\n                }\n                count++;\n                start = start.AddDays(1);\n            }\n            while (start < end);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 96178;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"3\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99908\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$5000.00\"},\n            {\"Lowest Capacity Asset\", \"AAPL 2ZTXYMUME4W6E|AAPL R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"1.08%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"94523a9f34b004d45970aa5ed06f8672\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting coarse universe selection behaves correctly during warmup when <see cref=\"IAlgorithmSettings.WarmupResolution\"/> is set\n    /// </summary>\n    public class WarmupLowerResolutionSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n        private Queue<DateTime> _selection = new Queue<DateTime>(new[]\n        {\n            new DateTime(2014, 03, 24),\n\n            new DateTime(2014, 03, 25),\n            new DateTime(2014, 03, 26),\n            new DateTime(2014, 03, 27),\n            new DateTime(2014, 03, 28),\n            new DateTime(2014, 03, 29),\n\n            new DateTime(2014, 04, 01),\n            new DateTime(2014, 04, 02),\n            new DateTime(2014, 04, 03),\n            new DateTime(2014, 04, 04),\n            new DateTime(2014, 04, 05),\n        });\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            SetStartDate(2014, 03, 26);\n            SetEndDate(2014, 04, 07);\n\n            AddUniverse(CoarseSelectionFunction);\n            SetWarmup(2, Resolution.Daily);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n        private IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            var expected = _selection.Dequeue();\n            if (expected != Time && !LiveMode)\n            {\n                throw new RegressionTestException($\"Unexpected selection time: {Time}. Expected {expected}\");\n            }\n\n            Debug($\"Coarse selection happening at {Time} {IsWarmingUp}\");\n            return new[] { _spy };\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var expectedDataSpan = QuantConnect.Time.OneHour;\n            if (Time <= StartDate)\n            {\n                expectedDataSpan = TimeSpan.FromHours(6.5);\n            }\n\n            foreach (var data in slice.Values)\n            {\n                var dataSpan = data.EndTime - data.Time;\n                if (dataSpan != expectedDataSpan)\n                {\n                    throw new RegressionTestException($\"Unexpected bar span! {data}: {dataSpan} Expected {expectedDataSpan}\");\n                }\n            }\n\n            Debug($\"OnData({UtcTime:o}): {IsWarmingUp}. {string.Join(\", \", slice.Values.OrderBy(x => x.Symbol))}\");\n\n            if (!Portfolio.Invested && !IsWarmingUp)\n            {\n                SetHoldings(_spy, 1m);\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 78098;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"-32.091%\"},\n            {\"Drawdown\", \"2.600%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98631.08\"},\n            {\"Net Profit\", \"-1.369%\"},\n            {\"Sharpe Ratio\", \"-0.749\"},\n            {\"Sortino Ratio\", \"-0.822\"},\n            {\"Probabilistic Sharpe Ratio\", \"35.938%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0\"},\n            {\"Beta\", \"0.997\"},\n            {\"Annual Standard Deviation\", \"0.097\"},\n            {\"Annual Variance\", \"0.009\"},\n            {\"Information Ratio\", \"0.644\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"-0.073\"},\n            {\"Total Fees\", \"$3.06\"},\n            {\"Estimated Strategy Capacity\", \"$120000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"7.75%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"520072ff9cd8239e46c8cf78b67ed4c7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionTimeSpanRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected\n    /// </summary>\n    public class WarmupLowerResolutionTimeSpanRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private bool _warmedUpTradeBars;\n        private bool _warmedUpQuoteBars;\n\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n\n            AddEquity(\"SPY\", Resolution.Second);\n            SetWarmUp(TimeSpan.FromDays(1), Resolution.Minute);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var tradeBars = slice.Get<TradeBar>();\n            tradeBars.TryGetValue(\"SPY\", out var trade);\n\n            var quoteBars = slice.Get<QuoteBar>();\n            quoteBars.TryGetValue(\"SPY\", out var quote);\n\n            var expectedPeriod = TimeSpan.FromSeconds(1);\n            if (IsWarmingUp)\n            {\n                expectedPeriod = TimeSpan.FromMinutes(1);\n                if (trade != null && trade.IsFillForward || quote != null && quote.IsFillForward)\n                {\n                    throw new RegressionTestException(\"Unexpected fill forwarded data!\");\n                }\n            }\n\n            if (trade != null)\n            {\n                _warmedUpTradeBars |= IsWarmingUp;\n                if (trade.Period != expectedPeriod)\n                {\n                    throw new RegressionTestException($\"Unexpected period for trade data point {trade.Period} expected {expectedPeriod}. IsWarmingUp: {IsWarmingUp}\");\n                }\n            }\n            if (quote != null)\n            {\n                _warmedUpQuoteBars |= IsWarmingUp;\n                if (quote.Period != expectedPeriod)\n                {\n                    throw new RegressionTestException($\"Unexpected period for quote data point {quote.Period} expected {expectedPeriod}. IsWarmingUp: {IsWarmingUp}\");\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if(!_warmedUpTradeBars || !_warmedUpQuoteBars)\n            {\n                throw new RegressionTestException(\"Did not assert data during warmup!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 95175;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupLowerResolutionTimeSpanSettingRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting warming up with a lower resolution for speed is respected\n    /// </summary>\n    public class WarmupLowerResolutionTimeSpanSettingRegressionAlgorithm : WarmupLowerResolutionTimeSpanRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 09);\n\n            AddEquity(\"SPY\", Resolution.Second);\n            SetWarmUp(TimeSpan.FromDays(1));\n            Settings.WarmupResolution = Resolution.Minute;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupMinuteResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    internal class WarmupMinuteResolutionRegressionAlgorithm : WarmupDailyResolutionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 10);\n            SetEndDate(2013, 10, 11);\n\n            AddEquity(\"SPY\", Resolution.Second);\n            ExpectedDataSpan = Resolution.Second.ToTimeSpan();\n\n            SetWarmUp(TimeSpan.FromDays(3), Resolution.Minute);\n            ExpectedWarmupDataSpan = Resolution.Minute.ToTimeSpan();\n\n            Sma = SMA(\"SPY\", 2);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 97515;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupOptionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of option warmup\n    /// </summary>\n    public class WarmupOptionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const string UnderlyingTicker = \"GOOG\";\n        private Symbol _optionSymbol;\n\n        protected List<DateTime> OptionWarmupTimes { get; } = new();\n\n        public override void Initialize()\n        {\n            SetStartDate(2015, 12, 24);\n            SetEndDate(2015, 12, 24);\n            SetCash(100000);\n\n            var option = AddOption(UnderlyingTicker);\n            _optionSymbol = option.Symbol;\n\n            option.SetFilter(u => u.Strikes(-5, +5).Expiration(0, 180).IncludeWeeklys());\n            SetWarmUp(TimeSpan.FromDays(1));\n        }\n\n        /// <summary>\n        /// Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data keyed by symbol string</param>\n        public override void OnData(Slice slice)\n        {\n            if (slice.OptionChains.TryGetValue(_optionSymbol, out var chain))\n            {\n                // we find at the money (ATM) put contract with farthest expiration\n                var atmContract = chain\n                    .OrderByDescending(x => x.Expiry)\n                    .ThenBy(x => Math.Abs(chain.Underlying.Price - x.Strike))\n                    .ThenByDescending(x => x.Right)\n                    .FirstOrDefault();\n\n                if (atmContract != null)\n                {\n                    // during warmup, using daily resolution (with the same TZ as the algorithm) the last bar.EndTime of warmup\n                    // overlaps with the algorithm start time, considered not to be in warmup anymore.\n                    // This bar would also be emitted by lean if no warmup was set and daily resolution used, see 'BasicTemplateDailyAlgorithm'\n                    if (Time <= StartDate)\n                    {\n                        if(atmContract.LastPrice == 0)\n                        {\n                            throw new RegressionTestException(\"Contract price is not set!\");\n                        }\n                        OptionWarmupTimes.Add(Time);\n                    }\n                    else if (!Portfolio.Invested && IsMarketOpen(_optionSymbol))\n                    {\n                        // if found, trade it\n                        MarketOrder(atmContract.Symbol, 1);\n                        MarketOnCloseOrder(atmContract.Symbol, -1);\n                    }\n                }\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var start = new DateTime(2015, 12, 23, 9, 31, 0);\n            var end = new DateTime(2015, 12, 23, 16, 0, 0);\n            var count = 0;\n            do\n            {\n                if (OptionWarmupTimes[count] != start)\n                {\n                    throw new RegressionTestException($\"Unexpected time {OptionWarmupTimes[count]} expected {start}\");\n                }\n                count++;\n                start = start.AddMinutes(1);\n            }\n            while (start < end);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 107498;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99718\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$2.00\"},\n            {\"Estimated Strategy Capacity\", \"$1300000.00\"},\n            {\"Lowest Capacity Asset\", \"GOOCV 30AKMEIPOX2DI|GOOCV VP83T1ZUHROL\"},\n            {\"Portfolio Turnover\", \"10.71%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"19ba1220073493495880581b38df2da9\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupOptionResolutionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting the behavior of option warmup\n    /// </summary>\n    public class WarmupOptionResolutionRegressionAlgorithm : WarmupOptionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            SetWarmUp(1, Resolution.Daily);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            var start = new DateTime(2015, 12, 23, 16, 0, 0);\n            var end = new DateTime(2015, 12, 24, 0, 0, 0);\n            var count = 0;\n            do\n            {\n                if (OptionWarmupTimes[count] != start)\n                {\n                    throw new RegressionTestException($\"Unexpected time {OptionWarmupTimes[count]} expected {start}\");\n                }\n                count++;\n                start = start.AddDays(1);\n            }\n            while (start < end);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 84590;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupScheduledEventsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue 1046. Where scheduled events wouldn't work during warmup\n    /// </summary>\n    public class WarmupScheduledEventsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Queue<DateTime> _onEndOfDayScheduledEvents = new(new[]\n        {\n            new DateTime(2013, 10, 04, 15, 50, 0),\n            new DateTime(2013, 10, 07, 15, 50, 0),\n\n            new DateTime(2013, 10, 08, 15, 50, 0),\n        });\n\n        private Queue<DateTime> _scheduledEvents = new (new[]\n        {\n            new DateTime(2013, 10, 04, 18, 0, 0),\n            new DateTime(2013, 10, 05, 0, 0, 0),\n            new DateTime(2013, 10, 05, 6, 0, 0),\n            new DateTime(2013, 10, 05, 12, 0, 0),\n            new DateTime(2013, 10, 05, 18, 0, 0),\n            new DateTime(2013, 10, 06, 0, 0, 0),\n            new DateTime(2013, 10, 06, 6, 0, 0),\n            new DateTime(2013, 10, 06, 12, 0, 0),\n            new DateTime(2013, 10, 06, 18, 0, 0),\n            new DateTime(2013, 10, 07, 0, 0, 0),\n            new DateTime(2013, 10, 07, 6, 0, 0),\n            new DateTime(2013, 10, 07, 12, 0, 0),\n            new DateTime(2013, 10, 07, 18, 0, 0),\n\n            new DateTime(2013, 10, 08, 0, 0, 0),\n            new DateTime(2013, 10, 08, 6, 0, 0),\n            new DateTime(2013, 10, 08, 12, 0, 0)\n        });\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 08);\n            SetEndDate(2013, 10, 08);\n\n            AddEquity(\"SPY\", Resolution.Minute, fillForward: false);\n\n            Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(6)), () =>\n            {\n                Debug($\"Scheduled event happening at {Time}. IsWarmingUp: {IsWarmingUp}\");\n                if (!LiveMode)\n                {\n                    var expected = _scheduledEvents.Dequeue();\n                    if (expected != Time)\n                    {\n                        throw new RegressionTestException($\"Unexpected scheduled event time: {Time}. Expected {expected}\");\n                    }\n\n                    if (expected.Day > 7 && IsWarmingUp)\n                    {\n                        throw new RegressionTestException(\"Algorithm should be warming up on the 7th!\");\n                    }\n                }\n            });\n\n            SetWarmUp(9, Resolution.Hour);\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_scheduledEvents.Count != 0)\n            {\n                throw new RegressionTestException(\"Some scheduled event was not fired!\");\n            }\n            if (_onEndOfDayScheduledEvents.Count != 0)\n            {\n                throw new RegressionTestException(\"Some OnEndOfDay scheduled event was not fired!\");\n            }\n        }\n\n        public override void OnEndOfDay(Symbol symbol)\n        {\n            Debug($\"OnEndOfDay scheduled event happening at {Time}. IsWarmingUp: {IsWarmingUp}\");\n            var expected = _onEndOfDayScheduledEvents.Dequeue();\n            if (expected != Time)\n            {\n                throw new RegressionTestException($\"Unexpected OnEndOfDay scheduled event time: {Time}. Expected {expected}\");\n            }\n            if (expected.Day > 7 && IsWarmingUp)\n            {\n                throw new RegressionTestException(\"Algorithm should be warming up on the 7th!\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 819;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupScheduledEventsTimeSpanWarmupRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm reproducing GH issue 1046. Where scheduled events wouldn't work during warmup\n    /// </summary>\n    public class WarmupScheduledEventsTimeSpanWarmupRegressionAlgorithm : WarmupScheduledEventsRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            SetWarmUp(60 * 8 + 30);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 1831;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupSelectionBarCountRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    public class WarmupSelectionBarCountRegressionAlgorithm : WarmupSelectionRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            base.Initialize();\n            SetWarmup(2);\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 78085;\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting universe selection happens during warmup\n    /// </summary>\n    public class WarmupSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private const int NumberOfSymbols = 3;\n        private Queue<DateTime> _selection = new Queue<DateTime>(new[]\n        {\n            new DateTime(2014, 03, 24),\n\n            new DateTime(2014, 03, 25),\n            new DateTime(2014, 03, 26),\n            new DateTime(2014, 03, 27),\n            new DateTime(2014, 03, 28),\n            new DateTime(2014, 03, 29),\n\n            new DateTime(2014, 04, 01),\n            new DateTime(2014, 04, 02),\n            new DateTime(2014, 04, 03),\n            new DateTime(2014, 04, 04),\n            new DateTime(2014, 04, 05),\n        });\n\n        // initialize our changes to nothing\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        public override void Initialize()\n        {\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            SetStartDate(2014, 03, 26);\n            SetEndDate(2014, 04, 07);\n\n            AddUniverse(CoarseSelectionFunction);\n            SetWarmup(2, Resolution.Daily);\n        }\n\n        // sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n        private IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            Debug($\"Coarse selection happening at {Time} {IsWarmingUp}\");\n            var expected = _selection.Dequeue();\n            if (expected != Time && !LiveMode)\n            {\n                throw new RegressionTestException($\"Unexpected selection time: {Time}. Expected {expected}\");\n            }\n\n            // sort descending by daily dollar volume\n            var sortedByDollarVolume = coarse.OrderByDescending(x => x.DollarVolume);\n\n            // take the top entries from our sorted collection\n            var top = sortedByDollarVolume.Take(NumberOfSymbols);\n\n            // we need to return only the symbol objects\n            return top.Select(x => x.Symbol);\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            Debug($\"OnData({UtcTime:o}): {IsWarmingUp}. {string.Join(\", \", slice.Values.OrderBy(x => x.Symbol))}\");\n\n            // if we have no changes, do nothing\n            if (_changes == SecurityChanges.None || IsWarmingUp)\n            {\n                return;\n            }\n\n            // liquidate removed securities\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we want 1/N allocation in each security in our universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                SetHoldings(security.Symbol, 1m / NumberOfSymbols);\n            }\n\n            _changes = SecurityChanges.None;\n        }\n\n        // this event fires whenever we have changes to our universe\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n            Debug($\"OnSecuritiesChanged({UtcTime:o}):: {changes}\");\n        }\n\n        public override void OnOrderEvent(OrderEvent orderEvent)\n        {\n            Debug($\"OnOrderEvent({UtcTime:o}):: {orderEvent}\");\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 78067;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0.64%\"},\n            {\"Average Loss\", \"-0.13%\"},\n            {\"Compounding Annual Return\", \"11.057%\"},\n            {\"Drawdown\", \"0.900%\"},\n            {\"Expectancy\", \"0.938\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100374.24\"},\n            {\"Net Profit\", \"0.374%\"},\n            {\"Sharpe Ratio\", \"1.048\"},\n            {\"Sortino Ratio\", \"1.627\"},\n            {\"Probabilistic Sharpe Ratio\", \"50.929%\"},\n            {\"Loss Rate\", \"67%\"},\n            {\"Win Rate\", \"33%\"},\n            {\"Profit-Loss Ratio\", \"4.81\"},\n            {\"Alpha\", \"0.088\"},\n            {\"Beta\", \"0.152\"},\n            {\"Annual Standard Deviation\", \"0.073\"},\n            {\"Annual Variance\", \"0.005\"},\n            {\"Information Ratio\", \"1.369\"},\n            {\"Tracking Error\", \"0.109\"},\n            {\"Treynor Ratio\", \"0.504\"},\n            {\"Total Fees\", \"$43.94\"},\n            {\"Estimated Strategy Capacity\", \"$620000000.00\"},\n            {\"Lowest Capacity Asset\", \"FB V6OIPNZEM8V9\"},\n            {\"Portfolio Turnover\", \"15.44%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"e401e24ad8c273d99611d79d59e804d7\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WarmupTrainRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm asserting \"Train\" works as expected when enabling warmup, see GH issue #6410\n    /// </summary>\n    public class WarmupTrainRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _trained;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2018, 1, 1);\n            SetEndDate(2018, 1, 5);\n            foreach (var symbol in new string[] { \"EURUSD\", \"USDJPY\" })\n            {\n                AddForex(symbol, Resolution.Minute, Market.Oanda);\n            }\n\n            Train(TrainMethod);\n            SetWarmUp(100);\n        }\n\n        private void TrainMethod()\n        {\n            _trained++;\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if(_trained != 1)\n            {\n                throw new RegressionTestException($\"Unexpected train count {_trained}\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 36;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 48;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000.00\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-175.891\"},\n            {\"Tracking Error\", \"0.021\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/WeeklyUniverseSelectionRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test universe additions and removals with open positions\n    /// </summary>\n    /// <meta name=\"tag\" content=\"regression test\" />\n    public class WeeklyUniverseSelectionRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private SecurityChanges _changes = SecurityChanges.None;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 1);  //Set Start Date\n            SetEndDate(2013, 10, 31);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            UniverseSettings.Resolution = Resolution.Hour;\n\n            // select IBM once a week, empty universe the other days\n            AddUniverse(\"my-custom-universe\", dt => dt.Day % 7 == 0 ? new List<string> { \"IBM\" } : Enumerable.Empty<string>());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">TradeBars dictionary object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (_changes == SecurityChanges.None) return;\n\n            // liquidate securities removed from our universe\n            foreach (var security in _changes.RemovedSecurities)\n            {\n                if (security.Invested)\n                {\n                    Log(Time + \" Liquidate \" + security.Symbol.Value);\n                    Liquidate(security.Symbol);\n                }\n            }\n\n            // we'll simply go long each security we added to the universe\n            foreach (var security in _changes.AddedSecurities)\n            {\n                if (!security.Invested)\n                {\n                    Log(Time + \" Buy \" + security.Symbol.Value);\n                    SetHoldings(security.Symbol, 1);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Object containing AddedSecurities and RemovedSecurities</param>\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _changes = changes;\n            Log(Time + \" \" + changes);\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 247;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"8\"},\n            {\"Average Win\", \"0.64%\"},\n            {\"Average Loss\", \"-0.53%\"},\n            {\"Compounding Annual Return\", \"-10.774%\"},\n            {\"Drawdown\", \"2.200%\"},\n            {\"Expectancy\", \"-0.448\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99046.76\"},\n            {\"Net Profit\", \"-0.953%\"},\n            {\"Sharpe Ratio\", \"-1.559\"},\n            {\"Sortino Ratio\", \"-1.723\"},\n            {\"Probabilistic Sharpe Ratio\", \"19.083%\"},\n            {\"Loss Rate\", \"75%\"},\n            {\"Win Rate\", \"25%\"},\n            {\"Profit-Loss Ratio\", \"1.21\"},\n            {\"Alpha\", \"-0.159\"},\n            {\"Beta\", \"0.208\"},\n            {\"Annual Standard Deviation\", \"0.054\"},\n            {\"Annual Variance\", \"0.003\"},\n            {\"Information Ratio\", \"-4.529\"},\n            {\"Tracking Error\", \"0.098\"},\n            {\"Treynor Ratio\", \"-0.402\"},\n            {\"Total Fees\", \"$29.44\"},\n            {\"Estimated Strategy Capacity\", \"$5600000.00\"},\n            {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"25.73%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"1c1b9bae86e4ff7598b34ce40a2410e8\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/YearlyUniverseSelectionScheduleRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm for scheduled universe selection GH 3890\n    /// </summary>\n    public class YearlyUniverseSelectionScheduleRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private int _yearlyDateSelection;\n        private readonly Symbol _symbol = QuantConnect.Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2014, 03, 25);\n            SetEndDate(2014, 05, 10);\n            UniverseSettings.Resolution = Resolution.Daily;\n\n            AddUniverse(DateRules.YearStart(), SelectionFunction);\n        }\n\n        public IEnumerable<Symbol> SelectionFunction(IEnumerable<Fundamental> coarse)\n        {\n            _yearlyDateSelection++;\n            if (Time != StartDate)\n            {\n                throw new RegressionTestException($\"SelectionFunction_SpecificDate unexpected selection: {Time}\");\n            }\n            return new[] { _symbol };\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_symbol, 1);\n                Debug($\"Purchased Stock {_symbol}\");\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (_yearlyDateSelection != 1)\n            {\n                throw new RegressionTestException($\"Initial yearly selection didn't happen!\");\n            }\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 271;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"4.334%\"},\n            {\"Drawdown\", \"3.900%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100532.22\"},\n            {\"Net Profit\", \"0.532%\"},\n            {\"Sharpe Ratio\", \"0.28\"},\n            {\"Sortino Ratio\", \"0.283\"},\n            {\"Probabilistic Sharpe Ratio\", \"39.422%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"-0.022\"},\n            {\"Beta\", \"1.018\"},\n            {\"Annual Standard Deviation\", \"0.099\"},\n            {\"Annual Variance\", \"0.01\"},\n            {\"Information Ratio\", \"-2.462\"},\n            {\"Tracking Error\", \"0.009\"},\n            {\"Treynor Ratio\", \"0.027\"},\n            {\"Total Fees\", \"$3.07\"},\n            {\"Estimated Strategy Capacity\", \"$920000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"2.20%\"},\n            {\"Drawdown Recovery\", \"5\"},\n            {\"OrderListHash\", \"87438e51988f37757a2d7f97389483ea\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ZeroDTEIndexOptionsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that options are selected every day and that selection for 0DTE contracts works as expected,\n    /// always including the contracts that expire the same date the option chain belongs to.\n    /// </summary>\n    public class ZeroDTEIndexOptionsRegressionAlgorithm : ZeroDTEOptionsRegressionAlgorithm\n    {\n        public override void Initialize()\n        {\n            SetStartDate(2021, 01, 15);\n            SetEndDate(2021, 01, 15);\n            SetCash(100000);\n\n            var index = AddIndex(\"SPX\");\n            var indexOption = AddIndexOption(index.Symbol);\n\n            indexOption.SetFilter(u => u.IncludeWeeklys().Expiration(0, 0));\n            _option = indexOption;\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(index.Symbol);\n\n            _selectionDays = new List<DateTime>()\n            {\n                new DateTime(2021, 01, 15),\n            };\n        }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public override long DataPoints => 27;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public override int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public override AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ZeroDTEOptionsRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Algorithm asserting that options are selected every day and that selection for 0DTE contracts works as expected,\n    /// always including the contracts that expire the same date the option chain belongs to.\n    /// </summary>\n    public class ZeroDTEOptionsRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        protected List<DateTime> _selectionDays;\n        private int _currentSelectionDayIndex;\n\n        private int _previouslyAddedContracts;\n        private bool _selectionChecked;\n\n        protected Option _option;\n\n        public override void Initialize()\n        {\n            SetStartDate(2024, 01, 01);\n            SetEndDate(2024, 01, 10);\n            SetCash(100000);\n\n            var equity = AddEquity(\"SPY\");\n            var option = AddOption(equity.Symbol);\n\n            option.SetFilter(u => u.IncludeWeeklys().Expiration(0, 0));\n            _option = option;\n\n            // use the underlying equity as the benchmark\n            SetBenchmark(equity.Symbol);\n\n            _selectionDays = new List<DateTime>()\n            {\n                new DateTime(2024, 01, 01), // Sunday midnight, already Monday 1st, it's a holiday. Selection happens for Tuesday here\n                new DateTime(2024, 01, 03), // Wednesday, midnight\n                new DateTime(2024, 01, 04),\n                new DateTime(2024, 01, 05),\n                new DateTime(2024, 01, 06), // Friday midnight, selection happens for Monday here\n                new DateTime(2024, 01, 09), // Monday midnight, already Tuesday, selection happens for Tuesday here\n                new DateTime(2024, 01, 10),\n            };\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            var exchangeTime = UtcTime.ConvertFromUtc(_option.Exchange.TimeZone);\n\n            // Selection happens at midnight\n            if (exchangeTime.TimeOfDay == TimeSpan.Zero)\n            {\n                _selectionChecked = true;\n\n                // We expect selection every trading day\n                if (Time.Date != _selectionDays[_currentSelectionDayIndex++])\n                {\n                    throw new RegressionTestException($\"Unexpected date. Expected {_selectionDays[_currentSelectionDayIndex]} but was {Time.Date}\");\n                }\n\n                var addedOptions = changes.AddedSecurities.Where(x => x.Symbol.SecurityType == _option.Symbol.SecurityType && !x.Symbol.IsCanonical()).ToList();\n\n                if (addedOptions.Count == 0)\n                {\n                    throw new RegressionTestException(\"No options were added\");\n                }\n\n                var removedOptions = changes.RemovedSecurities.Where(x => x.Symbol.SecurityType == _option.Symbol.SecurityType && !x.Symbol.IsCanonical()).ToList();\n\n                // Since we are selecting only 0DTE contracts, they must be deselected that same day\n                if (removedOptions.Count != _previouslyAddedContracts)\n                {\n                    throw new RegressionTestException($\"Unexpected number of removed contracts. Expected {_previouslyAddedContracts} but was {removedOptions.Count}\");\n                }\n                _previouslyAddedContracts = addedOptions.Count;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_selectionChecked)\n            {\n                throw new RegressionTestException(\"Selection was not checked\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public virtual List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public virtual long DataPoints => 227;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public virtual int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public virtual AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"0\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"100000\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$0\"},\n            {\"Lowest Capacity Asset\", \"\"},\n            {\"Portfolio Turnover\", \"0%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ZeroFeeRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression test algorithm where custom a <see cref=\"FeeModel\"/> returns <see cref=\"OrderFee.Zero\"/>\n    /// </summary>\n    public class ZeroFeeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Security _security;\n        // Adding this so we only trade once, so math is easier and clear\n        private bool _alreadyTraded;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 11);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            _security = AddEquity(\"SPY\", Resolution.Minute);\n            _security.FeeModel = new ZeroFeeModel();\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested && !_alreadyTraded)\n            {\n                _alreadyTraded = true;\n                SetHoldings(_security.Symbol, 1);\n                Debug(\"Purchased Stock\");\n            }\n            else\n            {\n                Liquidate(_security.Symbol);\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            Log($\"TotalPortfolioValue: {Portfolio.TotalPortfolioValue}\");\n            Log($\"CashBook: {Portfolio.CashBook}\");\n            Log($\"Holdings.TotalCloseProfit: {_security.Holdings.TotalCloseProfit()}\");\n\n            if (Portfolio.CashBook[\"USD\"].Amount - _security.Holdings.LastTradeProfit != 100000)\n            {\n                throw new RegressionTestException(\"Unexpected USD cash amount: \" +\n                    $\"{Portfolio.CashBook[\"USD\"].Amount}\");\n            }\n            if (Portfolio.CashBook.ContainsKey(Currencies.NullCurrency))\n            {\n                throw new RegressionTestException(\"Unexpected NullCurrency cash\");\n            }\n\n            var closedTrade = TradeBuilder.ClosedTrades[0];\n            if (closedTrade.TotalFees != 0)\n            {\n                throw new RegressionTestException($\"Unexpected closed trades total fees {closedTrade.TotalFees}\");\n            }\n            if (_security.Holdings.TotalFees != 0)\n            {\n                throw new RegressionTestException($\"Unexpected closed trades total fees {closedTrade.TotalFees}\");\n            }\n        }\n\n        internal class ZeroFeeModel : FeeModel\n        {\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                return OrderFee.Zero;\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 3943;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"2\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"-0.05%\"},\n            {\"Compounding Annual Return\", \"-3.660%\"},\n            {\"Drawdown\", \"0.000%\"},\n            {\"Expectancy\", \"-1\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"99952.34\"},\n            {\"Net Profit\", \"-0.048%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"100%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"-8.91\"},\n            {\"Tracking Error\", \"0.223\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$0.00\"},\n            {\"Estimated Strategy Capacity\", \"$18000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"39.91%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"5bd6d98c36a3344f7383557bc375cf83\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Algorithm.CSharp/ZeroedBenchmarkRegressionAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Regression algorithm to test zeroed benchmark through BrokerageModel override\n    /// </summary>\n    public class ZeroedBenchmarkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n    {\n        private Symbol _spy;\n\n        /// <summary>\n        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        /// </summary>\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);  //Set Start Date\n            SetEndDate(2013, 10, 08);    //Set End Date\n            SetCash(100000);             //Set Strategy Cash\n\n            // Add equity\n            _spy = AddEquity(\"SPY\", Resolution.Hour).Symbol;\n\n            // Use our Test Brokerage Model with zeroed default benchmark\n            SetBrokerageModel(new TestBrokerageModel());\n        }\n\n        /// <summary>\n        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        /// </summary>\n        /// <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n        public override void OnData(Slice slice)\n        {\n            if (!Portfolio.Invested)\n            {\n                SetHoldings(_spy, 1);\n                Debug(\"Purchased Stock\");\n            }\n        }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        public bool CanRunLocally { get; } = true;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        public List<Language> Languages { get; } = new() { Language.CSharp, Language.Python };\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        public long DataPoints => 15;\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => 0;\n\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\n        {\n            {\"Total Orders\", \"1\"},\n            {\"Average Win\", \"0%\"},\n            {\"Average Loss\", \"0%\"},\n            {\"Compounding Annual Return\", \"0%\"},\n            {\"Drawdown\", \"0%\"},\n            {\"Expectancy\", \"0\"},\n            {\"Start Equity\", \"100000\"},\n            {\"End Equity\", \"98666.01\"},\n            {\"Net Profit\", \"0%\"},\n            {\"Sharpe Ratio\", \"0\"},\n            {\"Sortino Ratio\", \"0\"},\n            {\"Probabilistic Sharpe Ratio\", \"0%\"},\n            {\"Loss Rate\", \"0%\"},\n            {\"Win Rate\", \"0%\"},\n            {\"Profit-Loss Ratio\", \"0\"},\n            {\"Alpha\", \"0\"},\n            {\"Beta\", \"0\"},\n            {\"Annual Standard Deviation\", \"0\"},\n            {\"Annual Variance\", \"0\"},\n            {\"Information Ratio\", \"0\"},\n            {\"Tracking Error\", \"0\"},\n            {\"Treynor Ratio\", \"0\"},\n            {\"Total Fees\", \"$3.44\"},\n            {\"Estimated Strategy Capacity\", \"$110000000.00\"},\n            {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n            {\"Portfolio Turnover\", \"49.90%\"},\n            {\"Drawdown Recovery\", \"0\"},\n            {\"OrderListHash\", \"60747dce5c2aed393b7dccc258d2c9b5\"}\n        };\n\n        internal class TestBrokerageModel : DefaultBrokerageModel\n        {\n            public override IBenchmark GetBenchmark(SecurityManager securities)\n            {\n                return new FuncBenchmark(x => 0);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/BasePairsTradingAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing static System.FormattableString;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// This alpha model is designed to accept every possible pair combination\n    /// from securities selected by the universe selection model\n    /// This model generates alternating long ratio/short ratio insights emitted as a group\n    /// </summary>\n    public class BasePairsTradingAlphaModel : AlphaModel\n    {\n        private readonly int _lookback;\n        private readonly Resolution _resolution;\n        private readonly TimeSpan _predictionInterval;\n        private readonly decimal _threshold;\n        private readonly Dictionary<Tuple<Symbol, Symbol>, PairData> _pairs;\n\n        /// <summary>\n        /// List of security objects present in the universe\n        /// </summary>\n        public HashSet<Security> Securities { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BasePairsTradingAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"lookback\">Lookback period of the analysis</param>\n        /// <param name=\"resolution\">Analysis resolution</param>\n        /// <param name=\"threshold\">The percent [0, 100] deviation of the ratio from the mean before emitting an insight</param>\n        public BasePairsTradingAlphaModel(\n            int lookback = 1,\n            Resolution resolution = Resolution.Daily,\n            decimal threshold = 1m\n            )\n        {\n            _lookback = lookback;\n            _resolution = resolution;\n            _threshold = threshold;\n            _predictionInterval = _resolution.ToTimeSpan().Multiply(_lookback);\n            _pairs = new Dictionary<Tuple<Symbol, Symbol>, PairData>();\n\n            Securities = new HashSet<Security>();\n            Name = Invariant($\"{nameof(BasePairsTradingAlphaModel)}({_lookback},{_resolution},{_threshold.Normalize()})\");\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            var insights = new List<Insight>();\n\n            foreach (var kvp in _pairs)\n            {\n                insights.AddRange(kvp.Value.GetInsightGroup());\n            }\n\n            return insights;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            NotifiedSecurityChanges.UpdateCollection(Securities, changes);\n\n            UpdatePairs(algorithm);\n\n            // Remove pairs that has assets that were removed from the universe\n            foreach (var security in changes.RemovedSecurities)\n            {\n                var symbol = security.Symbol;\n                var keys = _pairs.Keys.Where(k => k.Item1 == symbol || k.Item2 == symbol).ToList();\n\n                foreach (var key in keys)\n                {\n                    var pair = _pairs[key];\n                    pair.Dispose();\n                    _pairs.Remove(key);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Check whether the assets pass a pairs trading test\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"asset1\">The first asset's symbol in the pair</param>\n        /// <param name=\"asset2\">The second asset's symbol in the pair</param>\n        /// <returns>True if the statistical test for the pair is successful</returns>\n        public virtual bool HasPassedTest(QCAlgorithm algorithm, Symbol asset1, Symbol asset2)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(HasPassedTest), out bool result, algorithm, asset1, asset2))\n            {\n                return result;\n            }\n\n            return true;\n        }\n\n        private void UpdatePairs(QCAlgorithm algorithm)\n        {\n            var assets = Securities.Select(x => x.Symbol).ToArray();\n\n            for (var i = 0; i < assets.Length; i++)\n            {\n                var assetI = assets[i];\n\n                for (var j = i + 1; j < assets.Length; j++)\n                {\n                    var assetJ = assets[j];\n\n                    var pairSymbol = Tuple.Create(assetI, assetJ);\n                    var invert = Tuple.Create(assetJ, assetI);\n\n                    if (_pairs.ContainsKey(pairSymbol) || _pairs.ContainsKey(invert))\n                    {\n                        continue;\n                    }\n\n                    if (!HasPassedTest(algorithm, assetI, assetJ))\n                    {\n                        continue;\n                    }\n\n                    var pairData = new PairData(algorithm, assetI, assetJ, _predictionInterval, _threshold);\n                    _pairs.Add(pairSymbol, pairData);\n                }\n            }\n        }\n\n        private class PairData : IDisposable\n        {\n            private enum State\n            {\n                ShortRatio,\n                FlatRatio,\n                LongRatio\n            };\n\n            private State _state = State.FlatRatio;\n\n            private readonly QCAlgorithm _algorithm;\n            private readonly Symbol _asset1;\n            private readonly Symbol _asset2;\n\n            private readonly IDataConsolidator _identityConsolidator1;\n            private readonly IDataConsolidator _identityConsolidator2;\n\n            private readonly IndicatorBase<IndicatorDataPoint> _asset1Price;\n            private readonly IndicatorBase<IndicatorDataPoint> _asset2Price;\n            private readonly IndicatorBase<IndicatorDataPoint> _ratio;\n            private readonly IndicatorBase<IndicatorDataPoint> _mean;\n            private readonly IndicatorBase<IndicatorDataPoint> _upperThreshold;\n            private readonly IndicatorBase<IndicatorDataPoint> _lowerThreshold;\n            private readonly TimeSpan _predictionInterval;\n\n            /// <summary>\n            /// Create a new pair\n            /// </summary>\n            /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n            /// <param name=\"asset1\">The first asset's symbol in the pair</param>\n            /// <param name=\"asset2\">The second asset's symbol in the pair</param>\n            /// <param name=\"period\">Period over which this insight is expected to come to fruition</param>\n            /// <param name=\"threshold\">The percent [0, 100] deviation of the ratio from the mean before emitting an insight</param>\n            public PairData(QCAlgorithm algorithm, Symbol asset1, Symbol asset2, TimeSpan period, decimal threshold)\n            {\n                _algorithm = algorithm;\n                _asset1 = asset1;\n                _asset2 = asset2;\n\n                // Created the Identity indicator for a given Symbol and\n                // the consolidator it is registered to. The consolidator reference \n                // will be used to remove it from SubscriptionManager\n                (Identity, IDataConsolidator) CreateIdentityIndicator(Symbol symbol)\n                {\n                    var resolution = algorithm.SubscriptionManager\n                        .SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(symbol)\n                        .Min(x => x.Resolution);\n\n                    var name = algorithm.CreateIndicatorName(symbol, \"close\", resolution);\n                    var identity = new Identity(name);\n\n                    var consolidator = algorithm.ResolveConsolidator(symbol, resolution);\n                    algorithm.RegisterIndicator(symbol, identity, consolidator);\n\n                    return (identity, consolidator);\n                }\n\n                (_asset1Price, _identityConsolidator1) = CreateIdentityIndicator(asset1);\n                (_asset2Price, _identityConsolidator2) = CreateIdentityIndicator(asset2);\n\n                _ratio = _asset1Price.Over(_asset2Price);\n                _mean = new ExponentialMovingAverage(500).Of(_ratio);\n\n                var upper = new ConstantIndicator<IndicatorDataPoint>(\"ct\", 1 + threshold / 100m);\n                _upperThreshold = _mean.Times(upper, \"UpperThreshold\");\n\n                var lower = new ConstantIndicator<IndicatorDataPoint>(\"ct\", 1 - threshold / 100m);\n                _lowerThreshold = _mean.Times(lower, \"LowerThreshold\");\n\n                _predictionInterval = period;\n            }\n\n            /// <summary>\n            /// On disposal, remove the consolidators from the subscription manager\n            /// </summary>\n            public void Dispose()\n            {\n                _algorithm.SubscriptionManager.RemoveConsolidator(_asset1, _identityConsolidator1);\n                _algorithm.SubscriptionManager.RemoveConsolidator(_asset2, _identityConsolidator2);\n            }\n\n            /// <summary>\n            /// Gets the insights group for the pair\n            /// </summary>\n            /// <returns>Insights grouped by an unique group id</returns>\n            public IEnumerable<Insight> GetInsightGroup()\n            {\n                if (!_mean.IsReady)\n                {\n                    return Enumerable.Empty<Insight>();\n                }\n\n                // don't re-emit the same direction\n                if (_state != State.LongRatio && _ratio > _upperThreshold)\n                {\n                    _state = State.LongRatio;\n\n                    // asset1/asset2 is more than 2 std away from mean, short asset1, long asset2\n                    var shortAsset1 = Insight.Price(_asset1, _predictionInterval, InsightDirection.Down);\n                    var longAsset2 = Insight.Price(_asset2, _predictionInterval, InsightDirection.Up);\n\n                    // creates a group id and set the GroupId property on each insight object\n                    return Insight.Group(shortAsset1, longAsset2);\n                }\n\n                // don't re-emit the same direction\n                if (_state != State.ShortRatio && _ratio < _lowerThreshold)\n                {\n                    _state = State.ShortRatio;\n\n                    // asset1/asset2 is less than 2 std away from mean, long asset1, short asset2\n                    var longAsset1 = Insight.Price(_asset1, _predictionInterval, InsightDirection.Up);\n                    var shortAsset2 = Insight.Price(_asset2, _predictionInterval, InsightDirection.Down);\n\n                    // creates a group id and set the GroupId property on each insight object\n                    return Insight.Group(longAsset1, shortAsset2);\n                }\n\n                return Enumerable.Empty<Insight>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/BasePairsTradingAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom enum import Enum\n\nclass BasePairsTradingAlphaModel(AlphaModel):\n    '''This alpha model is designed to accept every possible pair combination\n    from securities selected by the universe selection model\n    This model generates alternating long ratio/short ratio insights emitted as a group'''\n\n    def __init__(self, lookback = 1,\n            resolution = Resolution.DAILY,\n            threshold = 1):\n        ''' Initializes a new instance of the PairsTradingAlphaModel class\n        Args:\n            lookback: Lookback period of the analysis\n            resolution: Analysis resolution\n            threshold: The percent [0, 100] deviation of the ratio from the mean before emitting an insight'''\n        self.lookback = lookback\n        self.resolution = resolution\n        self.threshold = threshold\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), self.lookback)\n\n        self.pairs = dict()\n        self.securities = set()\n\n        self.name = f'{self.__class__.__name__}({self.lookback},{resolution},{Extensions.normalize_to_str(threshold)})'\n\n\n    def update(self, algorithm, data):\n        ''' Updates this alpha model with the latest data from the algorithm.\n        This is called each time the algorithm receives data for subscribed securities\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n\n        for key, pair in self.pairs.items():\n            insights.extend(pair.get_insight_group())\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed.\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        for security in changes.added_securities:\n            self.securities.add(security)\n\n        for security in changes.removed_securities:\n            if security in self.securities:\n                self.securities.remove(security)\n\n        self.update_pairs(algorithm)\n\n        for security in changes.removed_securities:\n            keys = [k for k in self.pairs.keys() if security.symbol in k]\n            for key in keys:\n                self.pairs.pop(key).dispose()\n\n    def update_pairs(self, algorithm):\n\n        symbols = sorted([x.symbol for x in self.securities])\n\n        for i in range(0, len(symbols)):\n            asset_i = symbols[i]\n\n            for j in range(1 + i, len(symbols)):\n                asset_j = symbols[j]\n\n                pair_symbol = (asset_i, asset_j)\n                invert = (asset_j, asset_i)\n\n                if pair_symbol in self.pairs or invert in self.pairs:\n                    continue\n\n                if not self.has_passed_test(algorithm, asset_i, asset_j):\n                    continue\n\n                pair = self.Pair(algorithm, asset_i, asset_j, self.prediction_interval, self.threshold)\n                self.pairs[pair_symbol] = pair\n\n    def has_passed_test(self, algorithm, asset1, asset2):\n        '''Check whether the assets pass a pairs trading test\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            asset1: The first asset's symbol in the pair\n            asset2: The second asset's symbol in the pair\n        Returns:\n            True if the statistical test for the pair is successful'''\n        return True\n\n    class Pair:\n\n        class State(Enum):\n            SHORT_RATIO = -1\n            FLAT_RATIO = 0\n            LONG_RATIO = 1\n\n        def __init__(self, algorithm, asset1, asset2, prediction_interval, threshold):\n            '''Create a new pair\n            Args:\n                algorithm: The algorithm instance that experienced the change in securities\n                asset1: The first asset's symbol in the pair\n                asset2: The second asset's symbol in the pair\n                prediction_interval: Period over which this insight is expected to come to fruition\n                threshold: The percent [0, 100] deviation of the ratio from the mean before emitting an insight'''\n            self.state = self.State.FLAT_RATIO\n\n            self.algorithm = algorithm\n            self.asset1 = asset1\n            self.asset2 = asset2\n\n            # Created the Identity indicator for a given Symbol and\n            # the consolidator it is registered to. The consolidator reference\n            # will be used to remove it from SubscriptionManager\n            def create_identity_indicator(symbol: Symbol):\n                resolution = min([x.resolution for x in algorithm.subscription_manager.subscription_data_config_service.get_subscription_data_configs(symbol)])\n\n                name = algorithm.create_indicator_name(symbol, \"close\", resolution)\n                identity = Identity(name)\n\n                consolidator = algorithm.resolve_consolidator(symbol, resolution)\n                algorithm.register_indicator(symbol, identity, consolidator)\n\n                return identity, consolidator\n\n            self.asset1_price, self.identity_consolidator1 = create_identity_indicator(asset1);\n            self.asset2_price, self.identity_consolidator2 = create_identity_indicator(asset2);\n\n            self.ratio = IndicatorExtensions.over(self.asset1_price, self.asset2_price)\n            self.mean = IndicatorExtensions.of(ExponentialMovingAverage(500), self.ratio)\n\n            upper = ConstantIndicator[IndicatorDataPoint](\"ct\", 1 + threshold / 100)\n            self.upper_threshold = IndicatorExtensions.times(self.mean, upper)\n\n            lower = ConstantIndicator[IndicatorDataPoint](\"ct\", 1 - threshold / 100)\n            self.lower_threshold = IndicatorExtensions.times(self.mean, lower)\n\n            self.prediction_interval = prediction_interval\n\n        def dispose(self):\n            '''\n            On disposal, remove the consolidators from the subscription manager\n            '''\n            self.algorithm.subscription_manager.remove_consolidator(self.asset1, self.identity_consolidator1)\n            self.algorithm.subscription_manager.remove_consolidator(self.asset2, self.identity_consolidator2)\n\n        def get_insight_group(self):\n            '''Gets the insights group for the pair\n            Returns:\n                Insights grouped by an unique group id'''\n\n            if not self.mean.is_ready:\n                return []\n\n            # don't re-emit the same direction\n            if self.state is not self.State.LONG_RATIO and self.ratio > self.upper_threshold:\n                self.state = self.State.LONG_RATIO\n\n                # asset1/asset2 is more than 2 std away from mean, short asset1, long asset2\n                short_asset_1 = Insight.price(self.asset1, self.prediction_interval, InsightDirection.DOWN)\n                long_asset_2 = Insight.price(self.asset2, self.prediction_interval, InsightDirection.UP)\n\n                # creates a group id and set the GroupId property on each insight object\n                return Insight.group(short_asset_1, long_asset_2)\n\n            # don't re-emit the same direction\n            if self.state is not self.State.SHORT_RATIO and self.ratio < self.lower_threshold:\n                self.state = self.State.SHORT_RATIO\n\n                # asset1/asset2 is less than 2 std away from mean, long asset1, short asset2\n                long_asset_1 = Insight.price(self.asset1, self.prediction_interval, InsightDirection.UP)\n                short_asset_2 = Insight.price(self.asset2, self.prediction_interval, InsightDirection.DOWN)\n\n                # creates a group id and set the GroupId property on each insight object\n                return Insight.group(long_asset_1, short_asset_2)\n\n            return []\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/ConstantAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing static System.FormattableString;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IAlphaModel\"/> that always returns the same insight for each security\n    /// </summary>\n    public class ConstantAlphaModel : AlphaModel\n    {\n        private readonly InsightType _type;\n        private readonly InsightDirection _direction;\n        private readonly TimeSpan _period;\n        private readonly double? _magnitude;\n        private readonly double? _confidence;\n        private readonly double? _weight;\n        private readonly HashSet<Security> _securities;\n        private readonly Dictionary<Symbol, DateTime> _insightsTimeBySymbol;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"type\">The type of insight</param>\n        /// <param name=\"direction\">The direction of the insight</param>\n        /// <param name=\"period\">The period over which the insight with come to fruition</param>\n        /// <param name=\"magnitude\">The predicted change in magnitude as a +- percentage</param>\n        /// <param name=\"confidence\">The confidence in the insight</param>\n        /// <param name=\"weight\">The portfolio weight of the insights</param>\n        public ConstantAlphaModel(InsightType type, InsightDirection direction, TimeSpan period, double? magnitude = null, double? confidence = null, double? weight = null)\n        {\n            _type = type;\n            _direction = direction;\n            _period = period;\n\n            // Optional\n            _magnitude = magnitude;\n            _confidence = confidence;\n            _weight = weight;\n\n            _securities = new HashSet<Security>();\n            _insightsTimeBySymbol = new Dictionary<Symbol, DateTime>();\n\n            Name = $\"{nameof(ConstantAlphaModel)}({type},{direction},{period}\";\n            if (magnitude.HasValue)\n            {\n                Name += Invariant($\",{magnitude.Value}\");\n            }\n\n            if (confidence.HasValue)\n            {\n                Name += Invariant($\",{confidence.Value}\");\n            }\n\n            Name += \")\";\n        }\n\n        /// <summary>\n        /// Creates a constant insight for each security as specified via the constructor\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            foreach (var security in _securities)\n            {\n                // security price could be zero until we get the first data point. e.g. this could happen\n                // when adding both forex and equities, we will first get a forex data point\n                if (security.Price != 0\n                    && ShouldEmitInsight(algorithm.UtcTime, security.Symbol))\n                {\n                    yield return new Insight(security.Symbol, _period, _type, _direction, _magnitude, _confidence, weight: _weight);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            NotifiedSecurityChanges.UpdateCollection(_securities, changes);\n\n            // this will allow the insight to be re-sent when the security re-joins the universe\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                _insightsTimeBySymbol.Remove(removed.Symbol);\n            }\n        }\n\n        /// <summary>\n        /// Determine if its time to emit insight for this symbol\n        /// </summary>\n        /// <param name=\"utcTime\">Time of the insight</param>\n        /// <param name=\"symbol\">The symbol to emit an insight for</param>\n        protected virtual bool ShouldEmitInsight(DateTime utcTime, Symbol symbol)\n        {\n            if (symbol.IsCanonical())\n            {\n                // canonical futures & options are none tradable\n                return false;\n            }\n            DateTime generatedTimeUtc;\n            if (_insightsTimeBySymbol.TryGetValue(symbol, out generatedTimeUtc))\n            {\n                // we previously emitted a insight for this symbol, check it's period to see\n                // if we should emit another insight\n                if (utcTime - generatedTimeUtc < _period)\n                {\n                    return false;\n                }\n            }\n\n            // we either haven't emitted a insight for this symbol or the previous\n            // insight's period has expired, so emit a new insight now for this symbol\n            _insightsTimeBySymbol[symbol] = utcTime;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/ConstantAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass ConstantAlphaModel(AlphaModel):\n    ''' Provides an implementation of IAlphaModel that always returns the same insight for each security'''\n\n    def __init__(self, type, direction, period, magnitude = None, confidence = None, weight = None):\n        '''Initializes a new instance of the ConstantAlphaModel class\n        Args:\n            type: The type of insight\n            direction: The direction of the insight\n            period: The period over which the insight with come to fruition\n            magnitude: The predicted change in magnitude as a +- percentage\n            confidence: The confidence in the insight\n            weight: The portfolio weight of the insights'''\n        self.type = type\n        self.direction = direction\n        self.period = period\n        self.magnitude = magnitude\n        self.confidence = confidence\n        self.weight = weight\n        self.securities = []\n        self.insights_time_by_symbol = {}\n\n        self.Name = '{}({},{},{}'.format(self.__class__.__name__, type, direction, strfdelta(period))\n        if magnitude is not None:\n            self.Name += ',{}'.format(magnitude)\n        if confidence is not None:\n            self.Name += ',{}'.format(confidence)\n\n        self.Name += ')'\n\n\n    def update(self, algorithm, data):\n        ''' Creates a constant insight for each security as specified via the constructor\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n\n        for security in self.securities:\n            # security price could be zero until we get the first data point. e.g. this could happen\n            # when adding both forex and equities, we will first get a forex data point\n            if security.price != 0 and self.should_emit_insight(algorithm.utc_time, security.symbol):\n                insights.append(Insight(security.symbol, self.period, self.type, self.direction, self.magnitude, self.confidence, weight = self.weight))\n\n        return insights\n\n\n    def on_securities_changed(self, algorithm, changes):\n        ''' Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for added in changes.added_securities:\n            self.securities.append(added)\n\n        # this will allow the insight to be re-sent when the security re-joins the universe\n        for removed in changes.removed_securities:\n            if removed in self.securities:\n                self.securities.remove(removed)\n            if removed.symbol in self.insights_time_by_symbol:\n                self.insights_time_by_symbol.pop(removed.symbol)\n\n\n    def should_emit_insight(self, utc_time, symbol):\n        if symbol.is_canonical():\n            # canonical futures & options are none tradable\n            return False\n\n        generated_time_utc = self.insights_time_by_symbol.get(symbol)\n\n        if generated_time_utc is not None:\n            # we previously emitted a insight for this symbol, check it's period to see\n            # if we should emit another insight\n            if utc_time - generated_time_utc < self.period:\n                return False\n\n        # we either haven't emitted a insight for this symbol or the previous\n        # insight's period has expired, so emit a new insight now for this symbol\n        self.insights_time_by_symbol[symbol] = utc_time\n        return True\n\ndef strfdelta(tdelta):\n    d = tdelta.days\n    h, rem = divmod(tdelta.seconds, 3600)\n    m, s = divmod(rem, 60)\n    return \"{}.{:02d}:{:02d}:{:02d}\".format(d,h,m,s)\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/EmaCrossAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Alpha model that uses an EMA cross to create insights\n    /// </summary>\n    public class EmaCrossAlphaModel : AlphaModel\n    {\n        private readonly int _fastPeriod;\n        private readonly int _slowPeriod;\n        private readonly Resolution _resolution;\n        private readonly int _predictionInterval;\n\n        /// <summary>\n        /// This is made protected for testing purposes\n        /// </summary>\n        protected Dictionary<Symbol, SymbolData> SymbolDataBySymbol { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EmaCrossAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"fastPeriod\">The fast EMA period</param>\n        /// <param name=\"slowPeriod\">The slow EMA period</param>\n        /// <param name=\"resolution\">The resolution of data sent into the EMA indicators</param>\n        public EmaCrossAlphaModel(\n            int fastPeriod = 12,\n            int slowPeriod = 26,\n            Resolution resolution = Resolution.Daily\n            )\n        {\n            _fastPeriod = fastPeriod;\n            _slowPeriod = slowPeriod;\n            _resolution = resolution;\n            _predictionInterval = fastPeriod;\n            SymbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n            Name = $\"{nameof(EmaCrossAlphaModel)}({fastPeriod},{slowPeriod},{resolution})\";\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            var insights = new List<Insight>();\n            foreach (var symbolData in SymbolDataBySymbol.Values)\n            {\n                if (symbolData.Fast.IsReady && symbolData.Slow.IsReady)\n                {\n                    var insightPeriod = _resolution.ToTimeSpan().Multiply(_predictionInterval);\n                    if (symbolData.FastIsOverSlow)\n                    {\n                        if (symbolData.Slow > symbolData.Fast)\n                        {\n                            insights.Add(Insight.Price(symbolData.Symbol, insightPeriod, InsightDirection.Down));\n                        }\n                    }\n                    else if (symbolData.SlowIsOverFast)\n                    {\n                        if (symbolData.Fast > symbolData.Slow)\n                        {\n                            insights.Add(Insight.Price(symbolData.Symbol, insightPeriod, InsightDirection.Up));\n                        }\n                    }\n                }\n\n                symbolData.FastIsOverSlow = symbolData.Fast > symbolData.Slow;\n            }\n\n            return insights;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                SymbolData symbolData;\n                if (!SymbolDataBySymbol.TryGetValue(added.Symbol, out symbolData))\n                {\n                    SymbolDataBySymbol[added.Symbol] = new SymbolData(added, _fastPeriod, _slowPeriod, algorithm, _resolution);\n                }\n                else\n                {\n                    // a security that was already initialized was re-added, reset the indicators\n                    symbolData.Fast.Reset();\n                    symbolData.Slow.Reset();\n                }\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                SymbolData symbolData;\n                if (SymbolDataBySymbol.TryGetValue(removed.Symbol, out symbolData))\n                {\n                    // clean up our consolidators\n                    symbolData.RemoveConsolidators();\n                    SymbolDataBySymbol.Remove(removed.Symbol);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Contains data specific to a symbol required by this model\n        /// </summary>\n        public class SymbolData\n        {\n            private readonly QCAlgorithm _algorithm;\n            private readonly IDataConsolidator _fastConsolidator;\n            private readonly IDataConsolidator _slowConsolidator;\n            private readonly ExponentialMovingAverage _fast;\n            private readonly ExponentialMovingAverage _slow;\n            private readonly Security _security;\n\n            /// <summary>\n            /// Symbol associated with the data\n            /// </summary>\n            public Symbol Symbol => _security.Symbol;\n\n            /// <summary>\n            /// Fast Exponential Moving Average (EMA)\n            /// </summary>\n            public ExponentialMovingAverage Fast => _fast;\n\n            /// <summary>\n            /// Slow Exponential Moving Average (EMA)\n            /// </summary>\n            public ExponentialMovingAverage Slow => _slow;\n\n            /// <summary>\n            /// True if the fast is above the slow, otherwise false.\n            /// This is used to prevent emitting the same signal repeatedly\n            /// </summary>\n            public bool FastIsOverSlow { get; set; }\n\n            /// <summary>\n            /// Flag indicating if the Slow EMA is over the Fast one\n            /// </summary>\n            public bool SlowIsOverFast => !FastIsOverSlow;\n\n            /// <summary>\n            /// Initializes an instance of the class SymbolData with the given arguments\n            /// </summary>\n            public SymbolData(\n                Security security,\n                int fastPeriod,\n                int slowPeriod,\n                QCAlgorithm algorithm,\n                Resolution resolution)\n            {\n                _algorithm = algorithm;\n                _security = security;\n\n                _fastConsolidator = algorithm.ResolveConsolidator(security.Symbol, resolution);\n                _slowConsolidator = algorithm.ResolveConsolidator(security.Symbol, resolution);\n\n                algorithm.SubscriptionManager.AddConsolidator(security.Symbol, _fastConsolidator);\n                algorithm.SubscriptionManager.AddConsolidator(security.Symbol, _slowConsolidator);\n\n                // create fast/slow EMAs\n                _fast = new ExponentialMovingAverage(security.Symbol, fastPeriod, ExponentialMovingAverage.SmoothingFactorDefault(fastPeriod));\n                _slow = new ExponentialMovingAverage(security.Symbol, slowPeriod, ExponentialMovingAverage.SmoothingFactorDefault(slowPeriod));\n\n                algorithm.RegisterIndicator(security.Symbol, _fast, _fastConsolidator);\n                algorithm.RegisterIndicator(security.Symbol, _slow, _slowConsolidator);\n\n                algorithm.WarmUpIndicator(security.Symbol, _fast, resolution);\n                algorithm.WarmUpIndicator(security.Symbol, _slow, resolution);\n            }\n\n            /// <summary>\n            /// Remove Fast and Slow consolidators\n            /// </summary>\n            public void RemoveConsolidators()\n            {\n                _algorithm.SubscriptionManager.RemoveConsolidator(Symbol, _fastConsolidator);\n                _algorithm.SubscriptionManager.RemoveConsolidator(Symbol, _slowConsolidator);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/EmaCrossAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass EmaCrossAlphaModel(AlphaModel):\n    '''Alpha model that uses an EMA cross to create insights'''\n\n    def __init__(self,\n                 fast_period = 12,\n                 slow_period = 26,\n                 resolution = Resolution.DAILY):\n        '''Initializes a new instance of the EmaCrossAlphaModel class\n        Args:\n            fast_period: The fast EMA period\n            slow_period: The slow EMA period'''\n        self.fast_period = fast_period\n        self.slow_period = slow_period\n        self.resolution = resolution\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(resolution), fast_period)\n        self.symbol_data_by_symbol = {}\n\n        self.name = '{}({},{},{})'.format(self.__class__.__name__, fast_period, slow_period, resolution)\n\n\n    def update(self, algorithm, data):\n        '''Updates this alpha model with the latest data from the algorithm.\n        This is called each time the algorithm receives data for subscribed securities\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n        for symbol, symbol_data in self.symbol_data_by_symbol.items():\n            if symbol_data.fast.is_ready and symbol_data.slow.is_ready:\n\n                if symbol_data.fast_is_over_slow:\n                    if symbol_data.slow > symbol_data.fast:\n                        insights.append(Insight.price(symbol_data.symbol, self.prediction_interval, InsightDirection.DOWN))\n\n                elif symbol_data.slow_is_over_fast:\n                    if symbol_data.fast > symbol_data.slow:\n                        insights.append(Insight.price(symbol_data.symbol, self.prediction_interval, InsightDirection.UP))\n\n            symbol_data.fast_is_over_slow = symbol_data.fast > symbol_data.slow\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for added in changes.added_securities:\n            symbol_data = self.symbol_data_by_symbol.get(added.symbol)\n            if symbol_data is None:\n                symbol_data = SymbolData(added, self.fast_period, self.slow_period, algorithm, self.resolution)\n                self.symbol_data_by_symbol[added.symbol] = symbol_data\n            else:\n                # a security that was already initialized was re-added, reset the indicators\n                symbol_data.fast.reset()\n                symbol_data.slow.reset()\n\n        for removed in changes.removed_securities:\n            data = self.symbol_data_by_symbol.pop(removed.symbol, None)\n            if data is not None:\n                # clean up our consolidators\n                data.remove_consolidators()\n\n\nclass SymbolData:\n    '''Contains data specific to a symbol required by this model'''\n    def __init__(self, security, fast_period, slow_period, algorithm, resolution):\n        self.security = security\n        self.symbol = security.symbol\n        self.algorithm = algorithm\n\n        self.fast_consolidator = algorithm.resolve_consolidator(security.symbol, resolution)\n        self.slow_consolidator = algorithm.resolve_consolidator(security.symbol, resolution)\n\n        algorithm.subscription_manager.add_consolidator(security.symbol, self.fast_consolidator)\n        algorithm.subscription_manager.add_consolidator(security.symbol, self.slow_consolidator)\n\n        # create fast/slow EMAs\n        self.fast = ExponentialMovingAverage(security.symbol, fast_period, ExponentialMovingAverage.smoothing_factor_default(fast_period))\n        self.slow = ExponentialMovingAverage(security.symbol, slow_period, ExponentialMovingAverage.smoothing_factor_default(slow_period))\n\n        algorithm.register_indicator(security.symbol, self.fast, self.fast_consolidator);\n        algorithm.register_indicator(security.symbol, self.slow, self.slow_consolidator);\n\n        algorithm.warm_up_indicator(security.symbol, self.fast, resolution);\n        algorithm.warm_up_indicator(security.symbol, self.slow, resolution);\n\n        # True if the fast is above the slow, otherwise false.\n        # This is used to prevent emitting the same signal repeatedly\n        self.fast_is_over_slow = False\n\n    def remove_consolidators(self):\n        self.algorithm.subscription_manager.remove_consolidator(self.security.symbol, self.fast_consolidator)\n        self.algorithm.subscription_manager.remove_consolidator(self.security.symbol, self.slow_consolidator)\n\n    @property\n    def slow_is_over_fast(self):\n        return not self.fast_is_over_slow\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Alpha model that uses historical returns to create insights\n    /// </summary>\n    public class HistoricalReturnsAlphaModel : AlphaModel\n    {\n        private readonly int _lookback;\n        private readonly Resolution _resolution;\n        private readonly TimeSpan _predictionInterval;\n        private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol;\n        private readonly  InsightCollection _insightCollection;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoricalReturnsAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"resolution\">The resolution of historical data</param>\n        public HistoricalReturnsAlphaModel(\n            int lookback = 1,\n            Resolution resolution = Resolution.Daily\n            )\n        {\n            _lookback = lookback;\n            _resolution = resolution;\n            _predictionInterval = _resolution.ToTimeSpan().Multiply(_lookback);\n            _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n            _insightCollection = new InsightCollection();\n            Name = $\"{nameof(HistoricalReturnsAlphaModel)}({lookback},{resolution})\";\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            var insights = new List<Insight>();\n            foreach (var (symbol, symbolData) in _symbolDataBySymbol)\n            {\n                if (symbolData.CanEmit())\n                {\n                    var direction = InsightDirection.Flat;\n                    var magnitude = (double)symbolData.ROC.Current.Value;\n                    if (magnitude > 0) direction = InsightDirection.Up;\n                    if (magnitude < 0) direction = InsightDirection.Down;\n                    \n                    if (direction == InsightDirection.Flat)\n                    {\n                        CancelInsights(algorithm, symbol);\n                        continue;\n                    }\n\n                    insights.Add(Insight.Price(symbolData.Security.Symbol, _predictionInterval, direction, magnitude, null));\n                }\n            }\n            _insightCollection.AddRange(insights);\n            return insights;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            // clean up data for removed securities\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                SymbolData data;\n                if (_symbolDataBySymbol.TryGetValue(removed.Symbol, out data))\n                {\n                    _symbolDataBySymbol.Remove(removed.Symbol);\n                    algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator);\n                }\n\n                CancelInsights(algorithm, removed.Symbol);\n            }\n\n            // initialize data for added securities\n            var addedSymbols = new List<Symbol>();\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!_symbolDataBySymbol.ContainsKey(added.Symbol))\n                {\n                    var symbolData = new SymbolData(algorithm, added, _lookback, _resolution);\n                    _symbolDataBySymbol[added.Symbol] = symbolData;\n                    addedSymbols.Add(symbolData.Security.Symbol);\n                }\n            }\n\n            if (addedSymbols.Count > 0)\n            {\n                // warmup our indicators by pushing history through the consolidators\n                algorithm.History(addedSymbols, _lookback, _resolution)\n                .PushThrough(bar =>\n                {\n                    SymbolData symbolData;\n                    if (_symbolDataBySymbol.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData.ROC.Update(bar.EndTime, bar.Value);\n                    }\n                });\n            }\n        }\n\n        private void CancelInsights(QCAlgorithm algorithm, Symbol symbol)\n        {\n            if (_insightCollection.TryGetValue(symbol, out var insights))\n            {\n                algorithm.Insights.Cancel(insights);\n                _insightCollection.Clear(new[] { symbol });\n            }\n        }\n\n        /// <summary>\n        /// Contains data specific to a symbol required by this model\n        /// </summary>\n        private class SymbolData\n        {\n            public Security Security;\n            public IDataConsolidator Consolidator;\n            public RateOfChange ROC;\n            public long previous = 0;\n\n            public SymbolData(QCAlgorithm algorithm, Security security, int lookback, Resolution resolution)\n            {\n                Security = security;\n                Consolidator = algorithm.ResolveConsolidator(security.Symbol, resolution);\n                algorithm.SubscriptionManager.AddConsolidator(security.Symbol, Consolidator);\n                ROC = new RateOfChange(security.Symbol.ToString(), lookback);\n                algorithm.RegisterIndicator(security.Symbol, ROC, Consolidator);\n            }\n\n            public bool CanEmit()\n            {\n                if (previous == ROC.Samples) return false;\n                previous = ROC.Samples;\n                return ROC.IsReady;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass HistoricalReturnsAlphaModel(AlphaModel):\n    '''Uses Historical returns to create insights.'''\n\n    def __init__(self, *args, **kwargs):\n        '''Initializes a new default instance of the HistoricalReturnsAlphaModel class.\n        Args:\n            lookback(int): Historical return lookback period\n            resolution: The resolution of historical data'''\n        self.lookback = kwargs['lookback'] if 'lookback' in kwargs else 1\n        self.resolution = kwargs['resolution'] if 'resolution' in kwargs else Resolution.DAILY\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), self.lookback)\n        self._symbol_data_by_symbol = {}\n        self.insight_collection = InsightCollection()\n\n    def update(self, algorithm, data):\n        '''Updates this alpha model with the latest data from the algorithm.\n        This is called each time the algorithm receives data for subscribed securities\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            if symbol_data.can_emit:\n\n                direction = InsightDirection.FLAT\n                magnitude = symbol_data.return_\n                if magnitude > 0: direction = InsightDirection.UP\n                if magnitude < 0: direction = InsightDirection.DOWN\n\n                if direction == InsightDirection.FLAT:\n                    self.cancel_insights(algorithm, symbol)\n                    continue\n\n                insights.append(Insight.price(symbol, self.prediction_interval, direction, magnitude, None))\n\n        self.insight_collection.add_range(insights)\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        # clean up data for removed securities\n        for removed in changes.removed_securities:\n            symbol_data = self._symbol_data_by_symbol.pop(removed.symbol, None)\n            if symbol_data is not None:\n                symbol_data.remove_consolidators(algorithm)\n            self.cancel_insights(algorithm, removed.symbol)\n\n        # initialize data for added securities\n        symbols = [ x.symbol for x in changes.added_securities ]\n        history = algorithm.history(symbols, self.lookback, self.resolution)\n        if history.empty: return\n\n        tickers = history.index.levels[0]\n        for ticker in tickers:\n            symbol = SymbolCache.get_symbol(ticker)\n\n            if symbol not in self._symbol_data_by_symbol:\n                symbol_data = SymbolData(symbol, self.lookback)\n                self._symbol_data_by_symbol[symbol] = symbol_data\n                symbol_data.register_indicators(algorithm, self.resolution)\n                symbol_data.warm_up_indicators(history.loc[ticker])\n\n    def cancel_insights(self, algorithm, symbol):\n        if not self.insight_collection.contains_key(symbol):\n            return\n        insights = self.insight_collection[symbol]\n        algorithm.insights.cancel(insights)\n        self.insight_collection.clear([ symbol ]);\n\n\nclass SymbolData:\n    '''Contains data specific to a symbol required by this model'''\n    def __init__(self, symbol, lookback):\n        self.symbol = symbol\n        self.roc = RateOfChange('{}.roc({})'.format(symbol, lookback), lookback)\n        self.consolidator = None\n        self.previous = 0\n\n    def register_indicators(self, algorithm, resolution):\n        self.consolidator = algorithm.resolve_consolidator(self.symbol, resolution)\n        algorithm.register_indicator(self.symbol, self.roc, self.consolidator)\n\n    def remove_consolidators(self, algorithm):\n        if self.consolidator is not None:\n            algorithm.subscription_manager.remove_consolidator(self.symbol, self.consolidator)\n\n    def warm_up_indicators(self, history):\n        for tuple in history.itertuples():\n            self.roc.update(tuple.Index, tuple.close)\n\n    @property\n    def return_(self):\n        return float(self.roc.current.value)\n\n    @property\n    def can_emit(self):\n        if self.previous == self.roc.samples:\n            return False\n\n        self.previous = self.roc.samples\n        return self.roc.is_ready\n\n    def __str__(self, **kwargs):\n        return '{}: {:.2%}'.format(self.roc.name, (1 + self.return_)**252 - 1)\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/MacdAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Defines a custom alpha model that uses MACD crossovers. The MACD signal line is\n    /// used to generate up/down insights if it's stronger than the bounce threshold.\n    /// If the MACD signal is within the bounce threshold then a flat price insight is returned.\n    /// </summary>\n    public class MacdAlphaModel : AlphaModel\n    {\n        private readonly int _fastPeriod;\n        private readonly int _slowPeriod;\n        private readonly int _signalPeriod;\n        private readonly MovingAverageType _movingAverageType;\n        private readonly Resolution _resolution;\n        private const decimal BounceThresholdPercent = 0.01m;\n        private InsightCollection _insightCollection = new();\n\n        /// <summary>\n        /// Dictionary containing basic information for each symbol present as key\n        /// </summary>\n        protected Dictionary<Symbol, SymbolData> _symbolData { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MacdAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"fastPeriod\">The MACD fast period</param>\n        /// <param name=\"slowPeriod\">The MACD slow period</param>\n        /// <param name=\"signalPeriod\">The smoothing period for the MACD signal</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use in the MACD</param>\n        /// <param name=\"resolution\">The resolution of data sent into the MACD indicator</param>\n        public MacdAlphaModel(\n            int fastPeriod = 12,\n            int slowPeriod = 26,\n            int signalPeriod = 9,\n            MovingAverageType movingAverageType = MovingAverageType.Exponential,\n            Resolution resolution = Resolution.Daily\n            )\n        {\n            _fastPeriod = fastPeriod;\n            _slowPeriod = slowPeriod;\n            _signalPeriod = signalPeriod;\n            _movingAverageType = movingAverageType;\n            _resolution = resolution;\n            _symbolData = new Dictionary<Symbol, SymbolData>();\n            Name = $\"{nameof(MacdAlphaModel)}({fastPeriod},{slowPeriod},{signalPeriod},{movingAverageType},{resolution})\";\n        }\n\n        /// <summary>\n        /// Determines an insight for each security based on it's current MACD signal\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            foreach (var sd in _symbolData.Values)\n            {\n                if (sd.Security.Price == 0)\n                {\n                    continue;\n                }\n\n                var direction = InsightDirection.Flat;\n                var normalizedSignal = sd.MACD.Signal / sd.Security.Price;\n                if (normalizedSignal > BounceThresholdPercent)\n                {\n                    direction = InsightDirection.Up;\n                }\n                else if (normalizedSignal < -BounceThresholdPercent)\n                {\n                    direction = InsightDirection.Down;\n                }\n\n                // ignore signal for same direction as previous signal\n                if (direction == sd.PreviousDirection)\n                {\n                    continue;\n                }\n\n                sd.PreviousDirection = direction;\n\n                if (direction == InsightDirection.Flat)\n                {\n                    CancelInsights(algorithm, sd.Security.Symbol);\n                    continue;\n                }\n\n                var insightPeriod = _resolution.ToTimeSpan().Multiply(_fastPeriod);\n                var insight = Insight.Price(sd.Security.Symbol, insightPeriod, direction);\n                _insightCollection.Add(insight);\n\n                yield return insight;\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed.\n        /// This initializes the MACD for each added security and cleans up the indicator for each removed security.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (_symbolData.ContainsKey(added.Symbol))\n                {\n                    continue;\n                }\n                _symbolData.Add(added.Symbol, new SymbolData(algorithm, added, _fastPeriod, _slowPeriod, _signalPeriod, _movingAverageType, _resolution));\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                var symbol = removed.Symbol;\n\n                SymbolData data;\n                if (_symbolData.TryGetValue(symbol, out data))\n                {\n                    // clean up our consolidator\n                    algorithm.SubscriptionManager.RemoveConsolidator(symbol, data.Consolidator);\n                    _symbolData.Remove(symbol);\n                }\n\n                // remove from insight collection manager\n                CancelInsights(algorithm, symbol);\n            }\n        }\n\n        private void CancelInsights(QCAlgorithm algorithm, Symbol symbol)\n        {\n            if (_insightCollection.TryGetValue(symbol, out var insights))\n            {\n                algorithm.Insights.Cancel(insights);\n                _insightCollection.Clear(new[] { symbol });\n            }\n        }\n\n        /// <summary>\n        /// Class representing basic data of a symbol\n        /// </summary>\n        public class SymbolData\n        {\n            /// <summary>\n            /// Previous direction property\n            /// </summary>\n            public InsightDirection? PreviousDirection { get; set; }\n\n            /// <summary>\n            /// Security of the Symbol Data\n            /// </summary>\n            public Security Security { get; init; }\n\n            /// <summary>\n            /// Consolidator property\n            /// </summary>\n            public IDataConsolidator Consolidator { get; init; }\n\n            /// <summary>\n            /// Moving Average Convergence Divergence indicator\n            /// </summary>\n            public MovingAverageConvergenceDivergence MACD { get; init; }\n\n            /// <summary>\n            /// Initializes an instance of the SymbolData class with the given arguments\n            /// </summary>\n            public SymbolData(QCAlgorithm algorithm, Security security, int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType movingAverageType, Resolution resolution)\n            {\n                Security = security;\n                Consolidator = algorithm.ResolveConsolidator(security.Symbol, resolution);\n                algorithm.SubscriptionManager.AddConsolidator(security.Symbol, Consolidator);\n\n                MACD = new MovingAverageConvergenceDivergence(fastPeriod, slowPeriod, signalPeriod, movingAverageType);\n\n                algorithm.RegisterIndicator(security.Symbol, MACD, Consolidator);\n                algorithm.WarmUpIndicator(security.Symbol, MACD, resolution);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/MacdAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MacdAlphaModel(AlphaModel):\n    '''Defines a custom alpha model that uses MACD crossovers. The MACD signal line\n    is used to generate up/down insights if it's stronger than the bounce threshold.\n    If the MACD signal is within the bounce threshold then a flat price insight is returned.'''\n\n    def __init__(self,\n                 fastPeriod = 12,\n                 slowPeriod = 26,\n                 signalPeriod = 9,\n                 movingAverageType = MovingAverageType.Exponential,\n                 resolution = Resolution.Daily):\n        ''' Initializes a new instance of the MacdAlphaModel class\n        Args:\n            fastPeriod: The MACD fast period\n            slowPeriod: The MACD slow period</param>\n            signalPeriod: The smoothing period for the MACD signal\n            movingAverageType: The type of moving average to use in the MACD'''\n        self.fastPeriod = fastPeriod\n        self.slowPeriod = slowPeriod\n        self.signalPeriod = signalPeriod\n        self.movingAverageType = movingAverageType\n        self.resolution = resolution\n        self.insightPeriod = Time.Multiply(Extensions.ToTimeSpan(resolution), fastPeriod)\n        self.bounceThresholdPercent = 0.01\n        self.insightCollection = InsightCollection()\n        self.symbolData = {}\n\n        self.Name = '{}({},{},{},{},{})'.format(self.__class__.__name__, fastPeriod, slowPeriod, signalPeriod, movingAverageType, resolution)\n\n\n    def Update(self, algorithm, data):\n        ''' Determines an insight for each security based on it's current MACD signal\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n\n        for key, sd in self.symbolData.items():\n            if sd.Security.Price == 0:\n                continue\n\n            direction = InsightDirection.Flat\n            normalized_signal = sd.MACD.Signal.Current.Value / sd.Security.Price\n\n            if normalized_signal > self.bounceThresholdPercent:\n                direction = InsightDirection.Up\n            elif normalized_signal < -self.bounceThresholdPercent:\n                direction = InsightDirection.Down\n\n            # ignore signal for same direction as previous signal\n            if direction == sd.PreviousDirection:\n                continue\n\n            sd.PreviousDirection = direction\n\n            if direction == InsightDirection.Flat:\n                self.CancelInsights(algorithm, sd.Security.Symbol)\n                continue\n\n            insight = Insight.Price(sd.Security.Symbol, self.insightPeriod, direction)\n            insights.append(insight)\n            self.insightCollection.Add(insight)\n\n        return insights\n\n\n    def OnSecuritiesChanged(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed.\n        This initializes the MACD for each added security and cleans up the indicator for each removed security.\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for added in changes.AddedSecurities:\n            self.symbolData[added.Symbol] = SymbolData(algorithm, added, self.fastPeriod, self.slowPeriod, self.signalPeriod, self.movingAverageType, self.resolution)\n\n        for removed in changes.RemovedSecurities:\n            symbol = removed.Symbol\n\n            data = self.symbolData.pop(symbol, None)\n            if data is not None:\n                # clean up our consolidator\n                algorithm.SubscriptionManager.RemoveConsolidator(symbol, data.Consolidator)\n\n            # remove from insight collection manager\n            self.CancelInsights(algorithm, symbol)\n\n    def CancelInsights(self, algorithm, symbol):\n        if not self.insightCollection.ContainsKey(symbol):\n            return\n        insights = self.insightCollection[symbol]\n        algorithm.Insights.Cancel(insights)\n        self.insightCollection.Clear([ symbol ]);\n\n\nclass SymbolData:\n    def __init__(self, algorithm, security, fastPeriod, slowPeriod, signalPeriod, movingAverageType, resolution):\n        self.Security = security\n        self.MACD = MovingAverageConvergenceDivergence(fastPeriod, slowPeriod, signalPeriod, movingAverageType)\n\n        self.Consolidator = algorithm.ResolveConsolidator(security.Symbol, resolution)\n        algorithm.RegisterIndicator(security.Symbol, self.MACD, self.Consolidator)\n        algorithm.WarmUpIndicator(security.Symbol, self.MACD, resolution)\n\n        self.PreviousDirection = None\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/PearsonCorrelationPairsTradingAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing MathNet.Numerics.Statistics;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// This alpha model is designed to rank every pair combination by its pearson correlation\n    /// and trade the pair with the hightest correlation\n    /// This model generates alternating long ratio/short ratio insights emitted as a group\n    /// </summary>\n    public class PearsonCorrelationPairsTradingAlphaModel : BasePairsTradingAlphaModel\n    {\n        private readonly int _lookback;\n        private readonly Resolution _resolution;\n        private readonly double _minimumCorrelation;\n        private Tuple<Symbol, Symbol> _bestPair;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PearsonCorrelationPairsTradingAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"lookback\">Lookback period of the analysis</param>\n        /// <param name=\"resolution\">Analysis resolution</param>\n        /// <param name=\"threshold\">The percent [0, 100] deviation of the ratio from the mean before emitting an insight</param>\n        /// <param name=\"minimumCorrelation\">The minimum correlation to consider a tradable pair</param>\n        public PearsonCorrelationPairsTradingAlphaModel(int lookback = 15, Resolution resolution = Resolution.Minute, decimal threshold = 1m, double minimumCorrelation = .5)\n            : base(lookback, resolution, threshold)\n        {\n            _lookback = lookback;\n            _resolution = resolution;\n            _minimumCorrelation = minimumCorrelation;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            NotifiedSecurityChanges.UpdateCollection(Securities, changes);\n\n            var symbols = Securities.Select(x => x.Symbol).ToArray();\n\n            var history = algorithm.History(symbols, _lookback, _resolution);\n\n            var vectors = GetPriceVectors(history);\n\n            if (vectors.LongLength == 0)\n            {\n                algorithm.Debug($\"PearsonCorrelationPairsTradingAlphaModel.OnSecuritiesChanged(): The requested historical data does not have series of prices with the same date/time. Please consider increasing the looback period. Current lookback: {_lookback}\");\n            }\n            else\n            {\n                var pearsonMatrix = Correlation.PearsonMatrix(vectors).UpperTriangle();\n\n                var maxValue = pearsonMatrix.Enumerate().Where(x => Math.Abs(x) < 1).Max();\n                if (maxValue >= _minimumCorrelation)\n                {\n                    var maxTuple = pearsonMatrix.Find(x => x == maxValue);\n                    _bestPair = Tuple.Create(symbols[maxTuple.Item1], symbols[maxTuple.Item2]);\n                }\n            }\n\n            base.OnSecuritiesChanged(algorithm, changes);\n        }\n\n        /// <summary>\n        /// Check whether the assets pass a pairs trading test\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"asset1\">The first asset's symbol in the pair</param>\n        /// <param name=\"asset2\">The second asset's symbol in the pair</param>\n        /// <returns>True if the statistical test for the pair is successful</returns>\n        public override bool HasPassedTest(QCAlgorithm algorithm, Symbol asset1, Symbol asset2)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(HasPassedTest), out bool result, algorithm, asset1, asset2))\n            {\n                return result;\n            }\n\n            return _bestPair != null && asset1 == _bestPair.Item1 && asset2 == _bestPair.Item2;\n        }\n\n        private double[][] GetPriceVectors(IEnumerable<Slice> slices)\n        {\n            var symbols = Securities.Select(x => x.Symbol).ToArray();\n            var timeZones = Securities.ToDictionary(x => x.Symbol, y => y.Exchange.TimeZone);\n\n            // Special case: daily data and securities from different timezone\n            var isDailyAndMultipleTimeZone = _resolution == Resolution.Daily && timeZones.Values.Distinct().Count() > 1;\n\n            var bars = new List<BaseData>();\n\n            if (isDailyAndMultipleTimeZone)\n            {\n                bars.AddRange(slices\n                    .GroupBy(x => x.Time.Date)\n                    .Where(x => x.Sum(k => k.Count) == symbols.Length)\n                    .SelectMany(x => x.SelectMany(y => y.Values)));\n            }\n            else\n            {\n                bars.AddRange(slices\n                    .Where(x => x.Count == symbols.Length)\n                    .SelectMany(x => x.Values));\n            }\n\n            return bars\n                .GroupBy(x => x.Symbol)\n                .Select(x =>\n                {\n                    var array = x.Select(b => Math.Log((double)b.Price)).ToArray();\n                    if (array.Length > 1)\n                    {\n                        for (var i = array.Length - 1; i > 0; i--)\n                        {\n                            array[i] = array[i] - array[i - 1];\n                        }\n                        array[0] = array[1];\n                        return array;\n                    }\n                    else\n                    {\n                        return new double[0];\n                    }\n                }).ToArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/PearsonCorrelationPairsTradingAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.BasePairsTradingAlphaModel import BasePairsTradingAlphaModel\nfrom scipy.stats import pearsonr\n\nclass PearsonCorrelationPairsTradingAlphaModel(BasePairsTradingAlphaModel):\n    ''' This alpha model is designed to rank every pair combination by its pearson correlation\n    and trade the pair with the hightest correlation\n    This model generates alternating long ratio/short ratio insights emitted as a group'''\n\n    def __init__(self, lookback = 15,\n            resolution = Resolution.MINUTE,\n            threshold = 1,\n            minimum_correlation = .5):\n        '''Initializes a new instance of the PearsonCorrelationPairsTradingAlphaModel class\n        Args:\n            lookback: lookback period of the analysis\n            resolution: analysis resolution\n            threshold: The percent [0, 100] deviation of the ratio from the mean before emitting an insight\n            minimum_correlation: The minimum correlation to consider a tradable pair'''\n        super().__init__(lookback, resolution, threshold)\n        self.lookback = lookback\n        self.resolution = resolution\n        self.minimum_correlation = minimum_correlation\n        self.best_pair = ()\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed.\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        for security in changes.added_securities:\n            self.securities.add(security)\n\n        for security in changes.removed_securities:\n            if security in self.securities:\n                self.securities.remove(security)\n\n        symbols = sorted([ x.symbol for x in self.securities ])\n\n        history = algorithm.history(symbols, self.lookback, self.resolution)\n\n        if not history.empty:\n            history = history.close.unstack(level=0)\n\n            df = self.get_price_dataframe(history)\n            stop = len(df.columns)\n\n            corr = dict()\n\n            for i in range(0, stop):\n                for j in range(i+1, stop):\n                    if (j, i) not in corr:\n                        corr[(i, j)] = pearsonr(df.iloc[:,i], df.iloc[:,j])[0]\n\n            corr = sorted(corr.items(), key = lambda kv: kv[1])\n            if corr[-1][1] >= self.minimum_correlation:\n                self.best_pair = (symbols[corr[-1][0][0]], symbols[corr[-1][0][1]])\n\n        super().on_securities_changed(algorithm, changes)\n\n    def has_passed_test(self, algorithm, asset1, asset2):\n        '''Check whether the assets pass a pairs trading test\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            asset1: The first asset's symbol in the pair\n            asset2: The second asset's symbol in the pair\n        Returns:\n            True if the statistical test for the pair is successful'''\n        return self.best_pair is not None and self.best_pair[0] == asset1 and self.best_pair[1] == asset2\n\n    def get_price_dataframe(self, df):\n        timezones = { x.symbol.value: x.exchange.time_zone for x in self.securities }\n\n        # Use log prices\n        df = np.log(df)\n\n        is_single_timeZone = len(set(timezones.values())) == 1\n\n        if not is_single_timeZone:\n            series_dict = dict()\n\n            for column in df:\n                # Change the dataframe index from data time to UTC time\n                to_utc = lambda x: Extensions.convert_to_utc(x, timezones[column])\n                if self.resolution == Resolution.DAILY:\n                    to_utc = lambda x: Extensions.convert_to_utc(x, timezones[column]).date()\n\n                data = df[[column]]\n                data.index = data.index.map(to_utc)\n                series_dict[column] = data[column]\n\n            df = pd.DataFrame(series_dict).dropna()\n\n        return (df - df.shift(1)).dropna()\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/RsiAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Uses Wilder's RSI to create insights. Using default settings, a cross over below 30 or above 70 will\n    /// trigger a new insight.\n    /// </summary>\n    public class RsiAlphaModel : AlphaModel\n    {\n        private readonly Dictionary<Symbol, SymbolData> _symbolDataBySymbol = new Dictionary<Symbol, SymbolData>();\n\n        private readonly int _period;\n        private readonly Resolution _resolution;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RsiAlphaModel\"/> class\n        /// </summary>\n        /// <param name=\"period\">The RSI indicator period</param>\n        /// <param name=\"resolution\">The resolution of data sent into the RSI indicator</param>\n        public RsiAlphaModel(\n            int period = 14,\n            Resolution resolution = Resolution.Daily\n            )\n        {\n            _period = period;\n            _resolution = resolution;\n            Name = $\"{nameof(RsiAlphaModel)}({_period},{_resolution})\";\n        }\n\n        /// <summary>\n        /// Updates this alpha model with the latest data from the algorithm.\n        /// This is called each time the algorithm receives data for subscribed securities\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"data\">The new data available</param>\n        /// <returns>The new insights generated</returns>\n        public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n        {\n            var insights = new List<Insight>();\n            foreach (var kvp in _symbolDataBySymbol)\n            {\n                var symbol = kvp.Key;\n                var rsi = kvp.Value.RSI;\n                var previousState = kvp.Value.State;\n                var state = GetState(rsi, previousState);\n\n                if (state != previousState && rsi.IsReady)\n                {\n                    var insightPeriod = _resolution.ToTimeSpan().Multiply(_period);\n\n                    switch (state)\n                    {\n                        case State.TrippedLow:\n                            insights.Add(Insight.Price(symbol, insightPeriod, InsightDirection.Up));\n                            break;\n\n                        case State.TrippedHigh:\n                            insights.Add(Insight.Price(symbol, insightPeriod, InsightDirection.Down));\n                            break;\n                    }\n                }\n\n                kvp.Value.State = state;\n            }\n\n            return insights;\n        }\n\n        /// <summary>\n        /// Cleans out old security data and initializes the RSI for any newly added securities.\n        /// This functional also seeds any new indicators using a history request.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            // clean up data for removed securities\n            foreach (var security in changes.RemovedSecurities)\n            {\n                SymbolData symbolData;\n                if (_symbolDataBySymbol.TryGetValue(security.Symbol, out symbolData))\n                {\n                    _symbolDataBySymbol.Remove(security.Symbol);\n                    symbolData.Dispose();\n                }\n            }\n\n            // initialize data for added securities\n            var addedSymbols = new List<Symbol>();\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!_symbolDataBySymbol.ContainsKey(added.Symbol))\n                {\n                    var symbolData = new SymbolData(algorithm, added.Symbol, _period, _resolution);\n                    _symbolDataBySymbol[added.Symbol] = symbolData;\n                    addedSymbols.Add(added.Symbol);\n                }\n            }\n\n            if (addedSymbols.Count > 0)\n            {\n                // warmup our indicators by pushing history through the consolidators\n                algorithm.History(addedSymbols, _period, _resolution)\n                    .PushThrough(data =>\n                    {\n                        SymbolData symbolData;\n                        if (_symbolDataBySymbol.TryGetValue(data.Symbol, out symbolData))\n                        {\n                            symbolData.Update(data);\n                        }\n                    });\n            }\n        }\n\n        /// <summary>\n        /// Determines the new state. This is basically cross-over detection logic that\n        /// includes considerations for bouncing using the configured bounce tolerance.\n        /// </summary>\n        private State GetState(RelativeStrengthIndex rsi, State previous)\n        {\n            if (rsi > 70m)\n            {\n                return State.TrippedHigh;\n            }\n\n            if (rsi < 30m)\n            {\n                return State.TrippedLow;\n            }\n\n            if (previous == State.TrippedLow)\n            {\n                if (rsi > 35m)\n                {\n                    return State.Middle;\n                }\n            }\n\n            if (previous == State.TrippedHigh)\n            {\n                if (rsi < 65m)\n                {\n                    return State.Middle;\n                }\n            }\n\n            return previous;\n        }\n\n        /// <summary>\n        /// Contains data specific to a symbol required by this model\n        /// </summary>\n        private class SymbolData : IDisposable\n        {\n            public State State { get; set; }\n            public RelativeStrengthIndex RSI { get; }\n            private Symbol _symbol { get; }\n            private QCAlgorithm _algorithm;\n            private IDataConsolidator _consolidator;\n\n            public SymbolData(QCAlgorithm algorithm, Symbol symbol, int period, Resolution resolution)\n            {\n                _algorithm = algorithm;\n                _symbol = symbol;\n                State = State.Middle;\n\n                RSI = new RelativeStrengthIndex(period, MovingAverageType.Wilders);\n                _consolidator = _algorithm.ResolveConsolidator(symbol, resolution);\n                algorithm.RegisterIndicator(symbol, RSI, _consolidator);\n            }\n\n            public void Update(BaseData bar)\n            {\n                _consolidator.Update(bar);\n            }\n\n            public void Dispose()\n            {\n                _algorithm.SubscriptionManager.RemoveConsolidator(_symbol, _consolidator);\n            }\n        }\n\n        /// <summary>\n        /// Defines the state. This is used to prevent signal spamming and aid in bounce detection.\n        /// </summary>\n        private enum State\n        {\n            TrippedLow,\n            Middle,\n            TrippedHigh\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Alphas/RsiAlphaModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Logging import *\nfrom enum import Enum\n\nclass RsiAlphaModel(AlphaModel):\n    '''Uses Wilder's RSI to create insights.\n    Using default settings, a cross over below 30 or above 70 will trigger a new insight.'''\n\n    def __init__(self,\n                 period = 14,\n                 resolution = Resolution.DAILY):\n        '''Initializes a new instance of the RsiAlphaModel class\n        Args:\n            period: The RSI indicator period'''\n        self.period = period\n        self.resolution = resolution\n        self.insight_period = Time.multiply(Extensions.to_time_span(resolution), period)\n        self.symbol_data_by_symbol ={}\n\n        self.name = '{}({},{})'.format(self.__class__.__name__, period, resolution)\n\n    def update(self, algorithm, data):\n        '''Updates this alpha model with the latest data from the algorithm.\n        This is called each time the algorithm receives data for subscribed securities\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n        insights = []\n        for symbol, symbol_data in self.symbol_data_by_symbol.items():\n            rsi = symbol_data.rsi\n            previous_state = symbol_data.state\n            state = self.get_state(rsi, previous_state)\n\n            if state != previous_state and rsi.is_ready:\n                if state == State.TRIPPED_LOW:\n                    insights.append(Insight.price(symbol, self.insight_period, InsightDirection.UP))\n                if state == State.TRIPPED_HIGH:\n                    insights.append(Insight.price(symbol, self.insight_period, InsightDirection.DOWN))\n\n            symbol_data.state = state\n\n        return insights\n\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Cleans out old security data and initializes the RSI for any newly added securities.\n        Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        # clean up data for removed securities\n        for security in changes.removed_securities:\n            symbol_data = self.symbol_data_by_symbol.pop(security.symbol, None)\n            if symbol_data:\n                symbol_data.dispose()\n\n        # initialize data for added securities\n        added_symbols = []\n        for security in changes.added_securities:\n            symbol = security.symbol\n            if symbol not in self.symbol_data_by_symbol:\n                symbol_data = SymbolData(algorithm, symbol, self.period, self.resolution)\n                self.symbol_data_by_symbol[symbol] = symbol_data\n                added_symbols.append(symbol)\n\n        if added_symbols:\n            history = algorithm.history[TradeBar](added_symbols, self.period, self.resolution)\n            for trade_bars in history:\n                for bar in trade_bars.values():\n                    self.symbol_data_by_symbol[bar.symbol].update(bar)\n\n\n    def get_state(self, rsi, previous):\n        ''' Determines the new state. This is basically cross-over detection logic that\n        includes considerations for bouncing using the configured bounce tolerance.'''\n        if rsi.current.value > 70:\n            return State.TRIPPED_HIGH\n        if rsi.current.value < 30:\n            return State.TRIPPED_LOW\n        if previous == State.TRIPPED_LOW:\n            if rsi.current.value > 35:\n                return State.MIDDLE\n        if previous == State.TRIPPED_HIGH:\n            if rsi.current.value < 65:\n                return State.MIDDLE\n\n        return previous\n\n\nclass SymbolData:\n    '''Contains data specific to a symbol required by this model'''\n    def __init__(self, algorithm, symbol, period, resolution):\n        self.algorithm = algorithm\n        self.symbol = symbol\n        self.state = State.MIDDLE\n\n        self.rsi = RelativeStrengthIndex(period, MovingAverageType.WILDERS)\n        self.consolidator = algorithm.resolve_consolidator(symbol, resolution)\n        algorithm.register_indicator(symbol, self.rsi, self.consolidator)\n\n    def update(self, bar):\n        self.consolidator.update(bar)\n\n    def dispose(self):\n        self.algorithm.subscription_manager.remove_consolidator(self.symbol, self.consolidator)\n\n\nclass State(Enum):\n    '''Defines the state. This is used to prevent signal spamming and aid in bounce detection.'''\n    TRIPPED_LOW = 0\n    MIDDLE = 1\n    TRIPPED_HIGH = 2\n"
  },
  {
    "path": "Algorithm.Framework/Execution/SpreadExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Execution model that submits orders while the current spread is in desirably tight extent.\n    /// </summary>\n    /// <remarks>Note this execution model will not work using <see cref=\"Resolution.Daily\"/>\n    /// since Exchange.ExchangeOpen will be false, suggested resolution is <see cref=\"Resolution.Minute\"/></remarks>\n    public class SpreadExecutionModel : ExecutionModel\n    {\n        private readonly decimal _acceptingSpreadPercent;\n        private readonly PortfolioTargetCollection _targetsCollection;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SpreadExecutionModel\"/> class\n        /// </summary>\n        /// <param name=\"acceptingSpreadPercent\">Maximum spread accepted comparing to current price in percentage.</param>\n        /// <param name=\"asynchronous\">If true, orders will be submitted asynchronously</param>\n        public SpreadExecutionModel(decimal acceptingSpreadPercent = 0.005m, bool asynchronous = true)\n            : base(asynchronous)\n        {\n            _acceptingSpreadPercent = Math.Abs(acceptingSpreadPercent);\n            _targetsCollection = new PortfolioTargetCollection();\n        }\n\n        /// <summary>\n        /// Submit orders for the specified portfolio targets if the spread is tighter/equal to preset level\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets to be ordered</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            // update the complete set of portfolio targets with the new targets\n            _targetsCollection.AddRange(targets);\n\n            // for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n            if (!_targetsCollection.IsEmpty)\n            {\n                foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                {\n                    var symbol = target.Symbol;\n                    // calculate remaining quantity to be ordered\n                    var unorderedQuantity = OrderSizing.GetUnorderedQuantity(algorithm, target);\n\n                    if (unorderedQuantity != 0)\n                    {\n                        // get security object\n                        var security = algorithm.Securities[symbol];\n\n                        // check order entry conditions\n                        if (PriceIsFavorable(security))\n                        {\n                            algorithm.MarketOrder(symbol, unorderedQuantity, Asynchronous, target.Tag);\n                        }\n                    }\n                }\n\n                _targetsCollection.ClearFulfilled(algorithm);\n            }\n        }\n\n        /// <summary>\n        /// Determines if the current spread is equal or tighter than preset level\n        /// </summary>\n        protected virtual bool PriceIsFavorable(Security security)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(PriceIsFavorable), out bool result, security))\n            {\n                return result;\n            }\n\n            // Has to be in opening hours of exchange to avoid extreme spread in OTC period\n            // Price has to be larger than zero to avoid zero division error, or negative price causing the spread percentage lower than preset value by accident\n            return security.Exchange.ExchangeOpen\n                && security.Price > 0 && security.AskPrice > 0 && security.BidPrice > 0\n                && (security.AskPrice - security.BidPrice) / security.Price <= _acceptingSpreadPercent;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Execution/SpreadExecutionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass SpreadExecutionModel(ExecutionModel):\n    '''Execution model that submits orders while the current spread is tight.\n       Note this execution model will not work using Resolution.DAILY since Exchange.exchange_open will be false, suggested resolution is Minute\n    '''\n\n    def __init__(self, accepting_spread_percent=0.005, asynchronous=True):\n        '''Initializes a new instance of the SpreadExecutionModel class'''\n        super().__init__(asynchronous)\n        self.targets_collection = PortfolioTargetCollection()\n\n        # Gets or sets the maximum spread compare to current price in percentage.\n        self.accepting_spread_percent = Math.abs(accepting_spread_percent)\n\n    def execute(self, algorithm, targets):\n        '''Executes market orders if the spread percentage to price is in desirable range.\n       Args:\n           algorithm: The algorithm instance\n           targets: The portfolio targets'''\n        # update the complete set of portfolio targets with the new targets\n        self.targets_collection.add_range(targets)\n\n        # for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n        if not self.targets_collection.is_empty:\n            for target in self.targets_collection.order_by_margin_impact(algorithm):\n                symbol = target.symbol\n\n                # calculate remaining quantity to be ordered\n                unordered_quantity = OrderSizing.get_unordered_quantity(algorithm, target)\n\n                # check order entry conditions\n                if unordered_quantity != 0:\n                    # get security information\n                    security = algorithm.securities[symbol]\n                    if self.spread_is_favorable(security):\n                        algorithm.market_order(symbol, unordered_quantity, self.asynchronous, target.tag)\n\n            self.targets_collection.clear_fulfilled(algorithm)\n\n    def spread_is_favorable(self, security):\n        '''Determines if the spread is in desirable range.'''\n        # Price has to be larger than zero to avoid zero division error, or negative price causing the spread percentage < 0 by error\n        # Has to be in opening hours of exchange to avoid extreme spread in OTC period\n        return security.exchange.exchange_open \\\n            and security.price > 0 and security.ask_price > 0 and security.bid_price > 0 \\\n            and (security.ask_price - security.bid_price) / security.price <= self.accepting_spread_percent\n"
  },
  {
    "path": "Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Execution model that submits orders while the current market prices is at least the configured number of standard\n    /// deviations away from the mean in the favorable direction (below/above for buy/sell respectively)\n    /// </summary>\n    public class StandardDeviationExecutionModel : ExecutionModel\n    {\n        private readonly int _period;\n        private readonly decimal _deviations;\n        private readonly Resolution _resolution;\n        private readonly PortfolioTargetCollection _targetsCollection;\n        private readonly Dictionary<Symbol, SymbolData> _symbolData;\n\n        /// <summary>\n        /// Gets or sets the maximum order value in units of the account currency.\n        /// This defaults to $20,000. For example, if purchasing a stock with a price\n        /// of $100, then the maximum order size would be 200 shares.\n        /// </summary>\n        public decimal MaximumOrderValue { get; set; } = 20 * 1000;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StandardDeviationExecutionModel\"/> class\n        /// </summary>\n        /// <param name=\"period\">Period of the standard deviation indicator</param>\n        /// <param name=\"deviations\">The number of deviations away from the mean before submitting an order</param>\n        /// <param name=\"resolution\">The resolution of the STD and SMA indicators</param>\n        /// <param name=\"asynchronous\">If true, orders should be submitted asynchronously</param>\n        public StandardDeviationExecutionModel(\n            int period = 60,\n            decimal deviations = 2m,\n            Resolution resolution = Resolution.Minute,\n            bool asynchronous = true\n            )\n            : base(asynchronous)\n        {\n            _period = period;\n            _deviations = deviations;\n            _resolution = resolution;\n            _targetsCollection = new PortfolioTargetCollection();\n            _symbolData = new Dictionary<Symbol, SymbolData>();\n        }\n\n        /// <summary>\n        /// Executes market orders if the standard deviation of price is more than the configured number of deviations\n        /// in the favorable direction.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            _targetsCollection.AddRange(targets);\n\n            // for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n            if (!_targetsCollection.IsEmpty)\n            {\n                foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                {\n                    var symbol = target.Symbol;\n\n                    // calculate remaining quantity to be ordered\n                    var unorderedQuantity = OrderSizing.GetUnorderedQuantity(algorithm, target);\n\n                    // fetch our symbol data containing our STD/SMA indicators\n                    SymbolData data;\n                    if (!_symbolData.TryGetValue(symbol, out data))\n                    {\n                        continue;\n                    }\n\n                    // check order entry conditions\n                    if (data.STD.IsReady && PriceIsFavorable(data, unorderedQuantity))\n                    {\n                        // Adjust order size to respect the maximum total order value\n                        var orderSize = OrderSizing.GetOrderSizeForMaximumValue(data.Security, MaximumOrderValue, unorderedQuantity);\n\n                        if (orderSize != 0)\n                        {\n                            algorithm.MarketOrder(symbol, orderSize, Asynchronous, target.Tag);\n                        }\n                    }\n                }\n\n                _targetsCollection.ClearFulfilled(algorithm);\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                // initialize new securities\n                if (!_symbolData.ContainsKey(added.Symbol))\n                {\n                    _symbolData[added.Symbol] = new SymbolData(algorithm, added, _period, _resolution);\n                }\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                // clean up data from removed securities\n                SymbolData data;\n                if (_symbolData.TryGetValue(removed.Symbol, out data))\n                {\n                    if (IsSafeToRemove(algorithm, removed.Symbol))\n                    {\n                        _symbolData.Remove(removed.Symbol);\n                        algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if the current price is more than the configured number of standard deviations\n        /// away from the mean in the favorable direction.\n        /// </summary>\n        protected virtual bool PriceIsFavorable(SymbolData data, decimal unorderedQuantity)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(PriceIsFavorable), out bool result, data, unorderedQuantity))\n            {\n                return result;\n            }\n\n            var deviations = _deviations * data.STD;\n            return unorderedQuantity > 0\n                ? data.Security.BidPrice < data.SMA - deviations\n                : data.Security.AskPrice > data.SMA + deviations;\n        }\n\n        /// <summary>\n        /// Determines if it's safe to remove the associated symbol data\n        /// </summary>\n        protected virtual bool IsSafeToRemove(QCAlgorithm algorithm, Symbol symbol)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(IsSafeToRemove), out bool result, algorithm, symbol))\n            {\n                return result;\n            }\n\n            // confirm the security isn't currently a member of any universe\n            return !algorithm.UniverseManager.Any(kvp => kvp.Value.ContainsMember(symbol));\n        }\n\n        /// <summary>\n        /// Symbol Data for this Execution Model\n        /// </summary>\n        protected class SymbolData\n        {\n            /// <summary>\n            /// Security\n            /// </summary>\n            public Security Security { get; }\n\n            /// <summary>\n            /// Standard Deviation\n            /// </summary>\n            public StandardDeviation STD { get; }\n\n            /// <summary>\n            /// Simple Moving Average\n            /// </summary>\n            public SimpleMovingAverage SMA { get; }\n\n            /// <summary>\n            /// Data Consolidator\n            /// </summary>\n            public IDataConsolidator Consolidator { get; }\n\n            /// <summary>\n            /// Initialize an instance of <see cref=\"SymbolData\"/>\n            /// </summary>\n            /// <param name=\"algorithm\">Algorithm for this security</param>\n            /// <param name=\"security\">The security we are using</param>\n            /// <param name=\"period\">Period of the SMA and STD</param>\n            /// <param name=\"resolution\">Resolution for this symbol</param>\n            public SymbolData(QCAlgorithm algorithm, Security security, int period, Resolution resolution)\n            {\n                Security = security;\n                Consolidator = algorithm.ResolveConsolidator(security.Symbol, resolution);\n\n                var smaName = algorithm.CreateIndicatorName(security.Symbol, \"SMA\" + period, resolution);\n                SMA = new SimpleMovingAverage(smaName, period);\n                algorithm.RegisterIndicator(security.Symbol, SMA, Consolidator);\n\n                var stdName = algorithm.CreateIndicatorName(security.Symbol, \"STD\" + period, resolution);\n                STD = new StandardDeviation(stdName, period);\n                algorithm.RegisterIndicator(security.Symbol, STD, Consolidator);\n\n                // warmup our indicators by pushing history through the indicators\n                foreach (var bar in algorithm.History(Security.Symbol, period, resolution))\n                {\n                    SMA.Update(bar.EndTime, bar.Value);\n                    STD.Update(bar.EndTime, bar.Value);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Execution/StandardDeviationExecutionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass StandardDeviationExecutionModel(ExecutionModel):\n    '''Execution model that submits orders while the current market prices is at least the configured number of standard\n     deviations away from the mean in the favorable direction (below/above for buy/sell respectively)'''\n\n    def __init__(self,\n                 period = 60,\n                 deviations = 2,\n                 resolution = Resolution.MINUTE,\n                 asynchronous=True):\n        '''Initializes a new instance of the StandardDeviationExecutionModel class\n        Args:\n            period: Period of the standard deviation indicator\n            deviations: The number of deviations away from the mean before submitting an order\n            resolution: The resolution of the STD and SMA indicators\n            asynchronous: If True, orders will be submitted asynchronously.'''\n        super().__init__(asynchronous)\n        self.period = period\n        self.deviations = deviations\n        self.resolution = resolution\n        self.targets_collection = PortfolioTargetCollection()\n        self._symbol_data = {}\n\n        # Gets or sets the maximum order value in units of the account currency.\n        # This defaults to $20,000. For example, if purchasing a stock with a price\n        # of $100, then the maximum order size would be 200 shares.\n        self.maximum_order_value = 20000\n\n\n    def execute(self, algorithm, targets):\n        '''Executes market orders if the standard deviation of price is more\n       than the configured number of deviations in the favorable direction.\n       Args:\n           algorithm: The algorithm instance\n           targets: The portfolio targets'''\n        self.targets_collection.add_range(targets)\n\n        # for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n        if not self.targets_collection.is_empty:\n            for target in self.targets_collection.order_by_margin_impact(algorithm):\n                symbol = target.symbol\n\n                # calculate remaining quantity to be ordered\n                unordered_quantity = OrderSizing.get_unordered_quantity(algorithm, target)\n\n                # fetch our symbol data containing our STD/SMA indicators\n                data = self._symbol_data.get(symbol, None)\n                if data is None: return\n\n                # check order entry conditions\n                if data.std.is_ready and self.price_is_favorable(data, unordered_quantity):\n                    # Adjust order size to respect the maximum total order value\n                    order_size = OrderSizing.get_order_size_for_maximum_value(data.security, self.maximum_order_value, unordered_quantity)\n\n                    if order_size != 0:\n                        algorithm.market_order(symbol, order_size, self.asynchronous, target.tag)\n\n            self.targets_collection.clear_fulfilled(algorithm)\n\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for added in changes.added_securities:\n            if added.symbol not in self._symbol_data:\n                self._symbol_data[added.symbol] = SymbolData(algorithm, added, self.period, self.resolution)\n\n        for removed in changes.removed_securities:\n            # clean up data from removed securities\n            symbol = removed.symbol\n            if symbol in self._symbol_data:\n                if self.is_safe_to_remove(algorithm, symbol):\n                    data = self._symbol_data.pop(symbol)\n                    algorithm.subscription_manager.remove_consolidator(symbol, data.consolidator)\n\n\n    def price_is_favorable(self, data, unordered_quantity):\n        '''Determines if the current price is more than the configured\n       number of standard deviations away from the mean in the favorable direction.'''\n        sma = data.sma.current.value\n        deviations = self.deviations * data.std.current.value\n        if unordered_quantity > 0:\n            return data.security.bid_price < sma - deviations\n        else:\n            return data.security.ask_price > sma + deviations\n\n\n    def is_safe_to_remove(self, algorithm, symbol):\n        '''Determines if it's safe to remove the associated symbol data'''\n        # confirm the security isn't currently a member of any universe\n        return not any([kvp.value.contains_member(symbol) for kvp in algorithm.universe_manager])\n\nclass SymbolData:\n    def __init__(self, algorithm, security, period, resolution):\n        symbol = security.symbol\n        self.security = security\n        self.consolidator = algorithm.resolve_consolidator(symbol, resolution)\n\n        sma_name = algorithm.create_indicator_name(symbol, f\"SMA{period}\", resolution)\n        self.sma = SimpleMovingAverage(sma_name, period)\n        algorithm.register_indicator(symbol, self.sma, self.consolidator)\n\n        std_name = algorithm.create_indicator_name(symbol, f\"STD{period}\", resolution)\n        self.std = StandardDeviation(std_name, period)\n        algorithm.register_indicator(symbol, self.std, self.consolidator)\n\n        # warmup our indicators by pushing history through the indicators\n        bars = algorithm.history[self.consolidator.input_type](symbol, period, resolution)\n        for bar in bars:\n            self.sma.update(bar.end_time, bar.close)\n            self.std.update(bar.end_time, bar.close)\n"
  },
  {
    "path": "Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Algorithm.Framework.Execution\n{\n    /// <summary>\n    /// Execution model that submits orders while the current market price is more favorable that the current volume weighted average price.\n    /// </summary>\n    public class VolumeWeightedAveragePriceExecutionModel : ExecutionModel\n    {\n        private readonly PortfolioTargetCollection _targetsCollection = new PortfolioTargetCollection();\n        private readonly Dictionary<Symbol, SymbolData> _symbolData = new Dictionary<Symbol, SymbolData>();\n\n        /// <summary>\n        /// Gets or sets the maximum order quantity as a percentage of the current bar's volume.\n        /// This defaults to 0.01m = 1%. For example, if the current bar's volume is 100, then\n        /// the maximum order size would equal 1 share.\n        /// </summary>\n        public decimal MaximumOrderQuantityPercentVolume { get; set; } = 0.01m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeWeightedAveragePriceExecutionModel\"/> class.\n        /// </summary>\n        /// <param name=\"asynchronous\">If true, orders will be submitted asynchronously</param>\n        public VolumeWeightedAveragePriceExecutionModel(bool asynchronous = true)\n            : base(asynchronous)\n        {\n        }\n\n        /// <summary>\n        /// Submit orders for the specified portfolio targets.\n        /// This model is free to delay or spread out these orders as it sees fit\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The portfolio targets to be ordered</param>\n        public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            // update the complete set of portfolio targets with the new targets\n            _targetsCollection.AddRange(targets);\n\n            // for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n            if (!_targetsCollection.IsEmpty)\n            {\n                foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))\n                {\n                    var symbol = target.Symbol;\n\n                    // calculate remaining quantity to be ordered\n                    var unorderedQuantity = OrderSizing.GetUnorderedQuantity(algorithm, target);\n\n                    // fetch our symbol data containing our VWAP indicator\n                    SymbolData data;\n                    if (!_symbolData.TryGetValue(symbol, out data))\n                    {\n                        continue;\n                    }\n\n                    // check order entry conditions\n                    if (PriceIsFavorable(data, unorderedQuantity))\n                    {\n                        // adjust order size to respect maximum order size based on a percentage of current volume\n                        var orderSize = OrderSizing.GetOrderSizeForPercentVolume(\n                            data.Security, MaximumOrderQuantityPercentVolume, unorderedQuantity);\n\n                        if (orderSize != 0)\n                        {\n                            algorithm.MarketOrder(data.Security.Symbol, orderSize, Asynchronous, target.Tag);\n                        }\n                    }\n                }\n\n                _targetsCollection.ClearFulfilled(algorithm);\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!_symbolData.ContainsKey(added.Symbol))\n                {\n                    _symbolData[added.Symbol] = new SymbolData(algorithm, added);\n                }\n            }\n\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                // clean up removed security data\n                SymbolData data;\n                if (_symbolData.TryGetValue(removed.Symbol, out data))\n                {\n                    if (IsSafeToRemove(algorithm, removed.Symbol))\n                    {\n                        _symbolData.Remove(removed.Symbol);\n                        algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if it's safe to remove the associated symbol data\n        /// </summary>\n        protected virtual bool IsSafeToRemove(QCAlgorithm algorithm, Symbol symbol)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(IsSafeToRemove), out bool result, algorithm, symbol))\n            {\n                return result;\n            }\n\n            // confirm the security isn't currently a member of any universe\n            return !algorithm.UniverseManager.Any(kvp => kvp.Value.ContainsMember(symbol));\n        }\n\n        /// <summary>\n        /// Determines if the current price is better than VWAP\n        /// </summary>\n        protected virtual bool PriceIsFavorable(SymbolData data, decimal unorderedQuantity)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(PriceIsFavorable), out bool result, data, unorderedQuantity))\n            {\n                return result;\n            }\n\n            if (unorderedQuantity > 0)\n            {\n                if (data.Security.BidPrice < data.VWAP)\n                {\n                    return true;\n                }\n            }\n            else\n            {\n                if (data.Security.AskPrice > data.VWAP)\n                {\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Symbol data for this Execution Model\n        /// </summary>\n        protected class SymbolData\n        {\n            /// <summary>\n            /// Security\n            /// </summary>\n            public Security Security { get; }\n\n            /// <summary>\n            /// VWAP Indicator\n            /// </summary>\n            public IntradayVwap VWAP { get; }\n\n            /// <summary>\n            /// Data Consolidator\n            /// </summary>\n            public IDataConsolidator Consolidator { get; }\n\n            /// <summary>\n            /// Initialize a new instance of <see cref=\"SymbolData\"/>\n            /// </summary>\n            public SymbolData(QCAlgorithm algorithm, Security security)\n            {\n                Security = security;\n                Consolidator = algorithm.ResolveConsolidator(security.Symbol, security.Resolution);\n                var name = algorithm.CreateIndicatorName(security.Symbol, \"VWAP\", security.Resolution);\n                VWAP = new IntradayVwap(name);\n\n                algorithm.RegisterIndicator(security.Symbol, VWAP, Consolidator, bd => (BaseData)bd);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass VolumeWeightedAveragePriceExecutionModel(ExecutionModel):\n    '''Execution model that submits orders while the current market price is more favorable that the current volume weighted average price.'''\n\n    def __init__(self, asynchronous=True):\n        '''Initializes a new instance of the VolumeWeightedAveragePriceExecutionModel class'''\n        super().__init__(asynchronous)\n        self.targets_collection = PortfolioTargetCollection()\n        self.symbol_data = {}\n\n        # Gets or sets the maximum order quantity as a percentage of the current bar's volume.\n        # This defaults to 0.01m = 1%. For example, if the current bar's volume is 100,\n        # then the maximum order size would equal 1 share.\n        self.maximum_order_quantity_percent_volume = 0.01\n\n\n    def execute(self, algorithm, targets):\n        '''Executes market orders if the standard deviation of price is more\n       than the configured number of deviations in the favorable direction.\n       Args:\n           algorithm: The algorithm instance\n           targets: The portfolio targets'''\n        # update the complete set of portfolio targets with the new targets\n        self.targets_collection.add_range(targets)\n\n        # for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call\n        if not self.targets_collection.is_empty:\n            for target in self.targets_collection.order_by_margin_impact(algorithm):\n                symbol = target.symbol\n\n                # calculate remaining quantity to be ordered\n                unordered_quantity = OrderSizing.get_unordered_quantity(algorithm, target)\n\n                # fetch our symbol data containing our VWAP indicator\n                data = self.symbol_data.get(symbol, None)\n                if data is None: return\n\n                # check order entry conditions\n                if self.price_is_favorable(data, unordered_quantity):\n                    # adjust order size to respect maximum order size based on a percentage of current volume\n                    order_size = OrderSizing.get_order_size_for_percent_volume(data.security, self.maximum_order_quantity_percent_volume, unordered_quantity)\n\n                    if order_size != 0:\n                        algorithm.market_order(symbol, order_size, self.asynchronous, target.tag)\n\n            self.targets_collection.clear_fulfilled(algorithm)\n\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for removed in changes.removed_securities:\n            # clean up removed security data\n            if removed.symbol in self.symbol_data:\n                if self.is_safe_to_remove(algorithm, removed.symbol):\n                    data = self.symbol_data.pop(removed.symbol)\n                    algorithm.subscription_manager.remove_consolidator(removed.symbol, data.consolidator)\n\n        for added in changes.added_securities:\n            if added.symbol not in self.symbol_data:\n                self.symbol_data[added.symbol] = SymbolData(algorithm, added)\n\n\n    def price_is_favorable(self, data, unordered_quantity):\n        '''Determines if the current price is more than the configured\n       number of standard deviations away from the mean in the favorable direction.'''\n        if unordered_quantity > 0:\n            if data.security.bid_price < data.vwap:\n                return True\n        else:\n            if data.security.ask_price > data.vwap:\n                return True\n\n        return False\n\n    def is_safe_to_remove(self, algorithm, symbol):\n        '''Determines if it's safe to remove the associated symbol data'''\n        # confirm the security isn't currently a member of any universe\n        return not any([kvp.value.contains_member(symbol) for kvp in algorithm.universe_manager])\n\nclass SymbolData:\n    def __init__(self, algorithm, security):\n        self.security = security\n        self.consolidator = algorithm.resolve_consolidator(security.symbol, security.resolution)\n        name = algorithm.create_indicator_name(security.symbol, \"VWAP\", security.resolution)\n        self._vwap = IntradayVwap(name)\n        algorithm.register_indicator(security.symbol, self._vwap, self.consolidator)\n\n    @property\n    def vwap(self):\n       return self._vwap.value\n\nclass IntradayVwap:\n    '''Defines the canonical intraday VWAP indicator'''\n    def __init__(self, name):\n        self.name = name\n        self.value = 0.0\n        self.last_date = datetime.min\n        self.sum_of_volume = 0.0\n        self.sum_of_price_times_volume = 0.0\n\n    @property\n    def is_ready(self):\n        return self.sum_of_volume > 0.0\n\n    def update(self, input):\n        '''Computes the new VWAP'''\n        success, volume, average_price = self.get_volume_and_average_price(input)\n        if not success:\n            return self.is_ready\n\n        # reset vwap on daily boundaries\n        if self.last_date != input.end_time.date():\n            self.sum_of_volume = 0.0\n            self.sum_of_price_times_volume = 0.0\n            self.last_date = input.end_time.date()\n\n        # running totals for Σ PiVi / Σ Vi\n        self.sum_of_volume += volume\n        self.sum_of_price_times_volume += average_price * volume\n\n        if self.sum_of_volume == 0.0:\n           # if we have no trade volume then use the current price as VWAP\n           self.value = input.value\n           return self.is_ready\n\n        self.value = self.sum_of_price_times_volume / self.sum_of_volume\n        return self.is_ready\n\n    def get_volume_and_average_price(self, input):\n        '''Determines the volume and price to be used for the current input in the VWAP computation'''\n\n        if type(input) is Tick:\n            if input.tick_type == TickType.TRADE:\n                return True, float(input.quantity), float(input.last_price)\n\n        if type(input) is TradeBar:\n            if not input.is_fill_forward:\n                average_price = float(input.high + input.low + input.close) / 3\n                return True, float(input.volume), average_price\n\n        return False, 0.0, 0.0\n"
  },
  {
    "path": "Algorithm.Framework/NotifiedSecurityChanges.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework\n{\n    /// <summary>\n    /// Provides convenience methods for updating collections in responses to securities changed events\n    /// </summary>\n    public static class NotifiedSecurityChanges\n    {\n        /// <summary>\n        /// Adds and removes the security changes to/from the collection\n        /// </summary>\n        /// <param name=\"securities\">The securities collection to be updated with the changes</param>\n        /// <param name=\"changes\">The changes to be applied to the securities collection</param>\n        public static void UpdateCollection(ICollection<Security> securities, SecurityChanges changes)\n        {\n            Update(changes, securities.Add, removed => securities.Remove(removed));\n        }\n\n        /// <summary>\n        /// Adds and removes the security changes to/from the collection\n        /// </summary>\n        /// <param name=\"securities\">The securities collection to be updated with the changes</param>\n        /// <param name=\"changes\">The changes to be applied to the securities collection</param>\n        /// <param name=\"valueFactory\">Delegate used to create instances of <typeparamref name=\"TValue\"/> from a <see cref=\"Security\"/> object</param>\n        public static void UpdateCollection<TValue>(ICollection<TValue> securities, SecurityChanges changes, Func<Security, TValue> valueFactory)\n        {\n            Update(changes, added => securities.Add(valueFactory(added)), removed => securities.Remove(valueFactory(removed)));\n        }\n\n        /// <summary>\n        /// Adds and removes the security changes to/from the collection\n        /// </summary>\n        /// <param name=\"dictionary\">The securities collection to be updated with the changes</param>\n        /// <param name=\"changes\">The changes to be applied to the securities collection</param>\n        /// <param name=\"valueFactory\">Factory for creating dictonary values for a key</param>\n        public static void UpdateDictionary<TValue>(\n            IDictionary<Security, TValue> dictionary,\n            SecurityChanges changes,\n            Func<Security, TValue> valueFactory\n            )\n        {\n            UpdateDictionary(dictionary, changes, security => security, valueFactory);\n        }\n\n        /// <summary>\n        /// Adds and removes the security changes to/from the collection\n        /// </summary>\n        /// <param name=\"dictionary\">The securities collection to be updated with the changes</param>\n        /// <param name=\"changes\">The changes to be applied to the securities collection</param>\n        /// <param name=\"valueFactory\">Factory for creating dictonary values for a key</param>\n        public static void UpdateDictionary<TValue>(\n            IDictionary<Symbol, TValue> dictionary,\n            SecurityChanges changes,\n            Func<Security, TValue> valueFactory\n            )\n        {\n            UpdateDictionary(dictionary, changes, security => security.Symbol, valueFactory);\n        }\n\n        /// <summary>\n        /// Most generic form of <see cref=\"UpdateCollection\"/>\n        /// </summary>\n        /// <typeparam name=\"TKey\">The dictionary's key type</typeparam>\n        /// <typeparam name=\"TValue\">The dictionary's value type</typeparam>\n        /// <param name=\"dictionary\">The dictionary to update</param>\n        /// <param name=\"changes\">The <seealso cref=\"SecurityChanges\"/> to apply to the dictionary</param>\n        /// <param name=\"keyFactory\">Selector pulling <typeparamref name=\"TKey\"/> from a <seealso cref=\"Security\"/></param>\n        /// <param name=\"valueFactory\">Selector pulling <typeparamref name=\"TValue\"/> from a <seealso cref=\"Security\"/></param>\n        public static void UpdateDictionary<TKey, TValue>(\n            IDictionary<TKey, TValue> dictionary,\n            SecurityChanges changes,\n            Func<Security, TKey> keyFactory,\n            Func<Security, TValue> valueFactory\n            )\n        {\n            Update(changes,\n                added => dictionary.Add(keyFactory(added), valueFactory(added)),\n                removed =>\n                {\n                    var key = keyFactory(removed);\n                    var entry = dictionary[key];\n                    dictionary.Remove(key);\n\n                    // give the entry a chance to clean up after itself\n                    var disposable = entry as IDisposable;\n                    disposable.DisposeSafely();\n                });\n        }\n\n        /// <summary>\n        /// Invokes the provided <paramref name=\"add\"/> and <paramref name=\"remove\"/> functions for each\n        /// </summary>\n        /// <param name=\"changes\">The security changes to process</param>\n        /// <param name=\"add\">Function called for each added security</param>\n        /// <param name=\"remove\">Function called for each removed security</param>\n        public static void Update(SecurityChanges changes, Action<Security> add, Action<Security> remove)\n        {\n            foreach (var added in changes.AddedSecurities)\n            {\n                add(added);\n            }\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                remove(removed);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/AccumulativeInsightPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that allocates percent of account\n    /// to each insight, defaulting to 3%.\n    /// For insights of direction <see cref=\"InsightDirection.Up\"/>, long targets are returned and\n    /// for insights of direction <see cref=\"InsightDirection.Down\"/>, short targets are returned.\n    /// By default, no rebalancing shall be done.\n    /// Rules:\n    ///    1. On active Up insight, increase position size by percent\n    ///    2. On active Down insight, decrease position size by percent\n    ///    3. On active Flat insight, move by percent towards 0\n    ///    4. On expired insight, and no other active insight, emits a 0 target'''\n    /// </summary>\n    public class AccumulativeInsightPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private readonly PortfolioBias _portfolioBias;\n        private readonly double _percent;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias, percent)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc = null,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : base(rebalancingFunc)\n        {\n            _portfolioBias = portfolioBias;\n            _percent = Math.Abs(percent);\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,\n                portfolioBias,\n                percent)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : this((Func<DateTime, DateTime?>)null,\n                portfolioBias,\n                percent)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n        \n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : this(dt => dt.Add(timeSpan), portfolioBias, percent)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"AccumulativeInsightPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"resolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"percent\">The percentage amount of the portfolio value to allocate\n        /// to a single insight. The value of percent should be in the range [0,1].\n        /// The default value is 0.03.</param>\n        public AccumulativeInsightPortfolioConstructionModel(Resolution resolution,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            double percent = 0.03)\n            : this(resolution.ToTimeSpan(), portfolioBias, percent)\n        {\n        }\n\n        /// <summary>\n        /// Gets the target insights to calculate a portfolio target percent for\n        /// </summary>\n        /// <returns>An enumerable of the target insights</returns>\n        protected override List<Insight> GetTargetInsights()\n        {\n            return Algorithm.Insights.GetActiveInsights(Algorithm.UtcTime).Where(ShouldCreateTargetForInsight)\n                .OrderBy(insight => insight.GeneratedTimeUtc)\n                .ToList();\n        }\n\n        /// <summary>\n        /// Determines the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var percentPerSymbol = new Dictionary<Symbol, double>();\n\n            foreach (var insight in activeInsights)\n            {\n                double targetPercent;\n                if (percentPerSymbol.TryGetValue(insight.Symbol, out targetPercent))\n                {\n                    if (insight.Direction == InsightDirection.Flat)\n                    {\n                        // We received a Flat\n                        // if adding or subtracting will push past 0, then make it 0\n                        if (Math.Abs(targetPercent) < _percent)\n                        {\n                            targetPercent = 0;\n                        }\n                        else\n                        {\n                            // otherwise, we flatten by percent\n                            targetPercent += (targetPercent > 0 ? -_percent : _percent);\n                        }\n                    }\n                }\n                targetPercent += _percent * (int)insight.Direction;\n\n                // adjust to respect portfolio bias\n                if (_portfolioBias != PortfolioBias.LongShort\n                    && Math.Sign(targetPercent) != (int)_portfolioBias)\n                {\n                    targetPercent = 0;\n                }\n\n                percentPerSymbol[insight.Symbol] = targetPercent;\n            }\n\n            return activeInsights.DistinctBy(insight => insight.Symbol)\n                .ToDictionary(insight => insight, insight => percentPerSymbol[insight.Symbol]);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/AccumulativeInsightPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\n\nclass AccumulativeInsightPortfolioConstructionModel(EqualWeightingPortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that allocates percent of account\n    to each insight, defaulting to 3%.\n    For insights of direction InsightDirection.UP, long targets are returned and\n    for insights of direction InsightDirection.DOWN, short targets are returned.\n    By default, no rebalancing shall be done.\n    Rules:\n        1. On active Up insight, increase position size by percent\n        2. On active Down insight, decrease position size by percent\n        3. On active Flat insight, move by percent towards 0\n        4. On expired insight, and no other active insight, emits a 0 target'''\n\n    def __init__(self,  rebalance = None, portfolio_bias = PortfolioBias.LONG_SHORT, percent = 0.03):\n        '''Initialize a new instance of AccumulativeInsightPortfolioConstructionModel\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)\n            percent: percent of portfolio to allocate to each position'''\n        super().__init__(rebalance)\n        self.portfolio_bias = portfolio_bias\n        self.percent = abs(percent)\n        self.sign = lambda x: -1 if x < 0 else (1 if x > 0 else 0)\n\n    def determine_target_percent(self, active_insights):\n        '''Will determine the target percent for each insight\n        Args:\n            active_insights: The active insights to generate a target for'''\n        percent_per_symbol = {}\n\n        insights = sorted(self.algorithm.insights.get_active_insights(self.current_utc_time), key=lambda insight: insight.generated_time_utc)\n\n        for insight in insights:\n            target_percent = 0\n            if insight.symbol in percent_per_symbol:\n                target_percent = percent_per_symbol[insight.symbol]\n                if insight.direction == InsightDirection.FLAT:\n                    # We received a Flat\n                    # if adding or subtracting will push past 0, then make it 0\n                    if abs(target_percent) < self.percent:\n                        target_percent = 0\n                    else:\n                        # otherwise, we flatten by percent\n                        target_percent += (-self.percent if target_percent > 0 else self.percent)\n            target_percent += self.percent * insight.direction\n\n            # adjust to respect portfolio bias\n            if self.portfolio_bias != PortfolioBias.LONG_SHORT and self.sign(target_percent) != self.portfolio_bias:\n                target_percent = 0\n\n            percent_per_symbol[insight.symbol] = target_percent\n\n        return dict((insight, percent_per_symbol[insight.symbol]) for insight in active_insights)\n\n    def create_targets(self, algorithm, insights):\n        '''Create portfolio targets from the specified insights\n        Args:\n            algorithm: The algorithm instance\n            insights: The insights to create portfolio targets from\n        Returns:\n            An enumerable of portfolio targets to be sent to the execution model'''\n        self.current_utc_time = algorithm.utc_time\n        return super().create_targets(algorithm, insights)\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Base alpha streams portfolio construction model\n    /// </summary>\n    public class AlphaStreamsPortfolioConstructionModel : IPortfolioConstructionModel\n    {\n        /// <summary>\n        /// Get's the weight for an alpha\n        /// </summary>\n        /// <param name=\"alphaId\">The algorithm instance that experienced the change in securities</param>\n        /// <returns>The alphas weight</returns>\n        public virtual decimal GetAlphaWeight(string alphaId)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public virtual void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        /// <summary>\n        /// Create portfolio targets from the specified insights\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"insights\">The insights to create portfolio targets from</param>\n        /// <returns>An enumerable of portfolio targets to be sent to the execution model</returns>\n        public virtual IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Statistics;\nusing Accord.Math;\nusing Python.Runtime;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of Black-Litterman portfolio optimization. The model adjusts equilibrium market\n    /// returns by incorporating views from multiple alpha models and therefore to get the optimal risky portfolio\n    /// reflecting those views. If insights of all alpha models have None magnitude or there are linearly dependent\n    /// vectors in link matrix of views, the expected return would be the implied excess equilibrium return.\n    /// The interval of weights in optimization method can be changed based on the long-short algorithm.\n    /// The default model uses the 0.0025 as weight-on-views scalar parameter tau. The optimization method\n    /// maximizes the Sharpe ratio with the weight range from -1 to 1.\n    /// </summary>\n    public class BlackLittermanOptimizationPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private readonly IPortfolioOptimizer _optimizer;\n        private readonly PortfolioBias _portfolioBias;\n        private readonly Resolution _resolution;\n        private readonly double _riskFreeRate;\n        private readonly double _delta;\n        private readonly int _lookback;\n        private readonly double _tau;\n        private readonly int _period;\n\n        private readonly Dictionary<Symbol, ReturnsSymbolData> _symbolDataDict;\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        public BlackLittermanOptimizationPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : this(dt => dt.Add(timeSpan), portfolioBias, lookback, period, resolution, riskFreeRate, delta, tau, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalanceResolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        public BlackLittermanOptimizationPortfolioConstructionModel(Resolution rebalanceResolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalanceResolution.ToTimeSpan(), portfolioBias, lookback, period, resolution, riskFreeRate, delta, tau, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        public BlackLittermanOptimizationPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,\n                portfolioBias,\n                lookback,\n                period,\n                resolution,\n                riskFreeRate,\n                delta,\n                tau,\n                optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        public BlackLittermanOptimizationPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias, lookback, period, resolution, riskFreeRate, delta, tau, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public BlackLittermanOptimizationPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : this((Func<DateTime, DateTime?>)null, portfolioBias, lookback, period, resolution, riskFreeRate, delta, tau, optimizer)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"delta\">The risk aversion coeffficient of the market portfolio</param>\n        /// <param name=\"tau\">The model parameter indicating the uncertainty of the CAPM prior</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If no algorithm is explicitly provided then the default will be max Sharpe ratio optimization.</param>\n        public BlackLittermanOptimizationPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double riskFreeRate = 0.0,\n            double delta = 2.5,\n            double tau = 0.05,\n            IPortfolioOptimizer optimizer = null)\n            : base(rebalancingFunc)\n        {\n            _lookback = lookback;\n            _period = period;\n            _resolution = resolution;\n            _riskFreeRate = riskFreeRate;\n            _delta = delta;\n            _tau = tau;\n\n            var lower = portfolioBias == PortfolioBias.Long ? 0 : -1;\n            var upper = portfolioBias == PortfolioBias.Short ? 0 : 1;\n            _optimizer = optimizer ?? new MaximumSharpeRatioPortfolioOptimizer(lower, upper, riskFreeRate);\n            _portfolioBias = portfolioBias;\n            _symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return FilterInvalidInsightMagnitude(Algorithm, new []{ insight }).Length != 0;\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var targets = new Dictionary<Insight, double>();\n\n            if (TryGetViews(activeInsights, out var P, out var Q))\n            {\n                // Updates the ReturnsSymbolData with insights\n                foreach (var insight in activeInsights)\n                {\n                    if (_symbolDataDict.TryGetValue(insight.Symbol, out var symbolData))\n                    {\n                        if (insight.Magnitude == null)\n                        {\n                            Algorithm.SetRunTimeError(new ArgumentNullException(\"BlackLittermanOptimizationPortfolioConstructionModel does not accept \\'null\\' as Insight.Magnitude. Please make sure your Alpha Model is generating Insights with the Magnitude property set.\"));\n                            return targets;\n                        }\n                        symbolData.Add(insight.GeneratedTimeUtc, insight.Magnitude.Value.SafeDecimalCast());\n                    }\n                }\n                // Get symbols' returns\n                var symbols = activeInsights.Select(x => x.Symbol).Distinct().ToList();\n                var returns = _symbolDataDict.FormReturnsMatrix(symbols);\n\n                // Calculate posterior estimate of the mean and uncertainty in the mean\n                var Π = GetEquilibriumReturns(returns, out var Σ);\n\n                ApplyBlackLittermanMasterFormula(ref Π, ref Σ, P, Q);\n\n                // Create portfolio targets from the specified insights\n                var W = _optimizer.Optimize(returns, Π, Σ);\n                var sidx = 0;\n                foreach (var symbol in symbols)\n                {\n                    var weight = W[sidx];\n\n                    // don't trust the optimizer\n                    if (_portfolioBias != PortfolioBias.LongShort\n                        && Math.Sign(weight) != (int)_portfolioBias)\n                    {\n                        weight = 0;\n                    }\n                    targets[activeInsights.First(insight => insight.Symbol == symbol)] = weight;\n\n                    sidx++;\n                }\n            }\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Gets the target insights to calculate a portfolio target percent for\n        /// </summary>\n        /// <returns>An enumerable of the target insights</returns>\n        protected override List<Insight> GetTargetInsights()\n        {\n            // Get insight that haven't expired of each symbol that is still in the universe\n            var activeInsights = Algorithm.Insights.GetActiveInsights(Algorithm.UtcTime).Where(ShouldCreateTargetForInsight);\n\n            // Get the last generated active insight for each symbol\n            return (from insight in activeInsights\n                    group insight by new { insight.Symbol, insight.SourceModel } into g\n                    select g.OrderBy(x => x.GeneratedTimeUtc).Last())\n                    .OrderBy(x => x.Symbol).ToList();\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(algorithm, changes);\n\n            foreach (var symbol in changes.RemovedSecurities.Select(x => x.Symbol))\n            {\n                if (_symbolDataDict.ContainsKey(symbol))\n                {\n                    _symbolDataDict[symbol].Reset();\n                    _symbolDataDict.Remove(symbol);\n                }\n            }\n\n            // initialize data for added securities\n            var addedSymbols = changes.AddedSecurities.ToDictionary(x => x.Symbol, x => x.Exchange.TimeZone);\n            algorithm.History(addedSymbols.Keys, _lookback * _period, _resolution)\n                .PushThrough(bar =>\n                {\n                    ReturnsSymbolData symbolData;\n                    if (!_symbolDataDict.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData = new ReturnsSymbolData(bar.Symbol, _lookback, _period);\n                        _symbolDataDict.Add(bar.Symbol, symbolData);\n                    }\n                    // Convert the data timestamp to UTC\n                    var utcTime = bar.EndTime.ConvertToUtc(addedSymbols[bar.Symbol]);\n                    symbolData.Update(utcTime, bar.Value);\n                });\n        }\n\n        /// <summary>\n        /// Calculate equilibrium returns and covariance\n        /// </summary>\n        /// <param name=\"returns\">Matrix of returns where each column represents a security and each row returns for the given date/time (size: K x N)</param>\n        /// <param name=\"Σ\">Multi-dimensional array of double with the portfolio covariance of returns (size: K x K).</param>\n        /// <returns>Array of double of equilibrium returns</returns>\n        public virtual double[] GetEquilibriumReturns(double[,] returns, out double[,] Σ)\n        {\n            // equal weighting scheme\n            var W = Vector.Create(returns.GetLength(1), 1.0 / returns.GetLength(1));\n            // annualized covariance\n            Σ = returns.Covariance().Multiply(252);\n            //annualized return\n            var annualReturn = W.Dot(Elementwise.Add(returns.Mean(0), 1.0).Pow(252.0).Subtract(1.0));\n            //annualized variance of return\n            var annualVariance = W.Dot(Σ.Dot(W));\n            // the risk aversion coefficient\n            var riskAversion = (annualReturn - _riskFreeRate) / annualVariance;\n            // the implied excess equilibrium return Vector (N x 1 column vector)\n            return Σ.Dot(W).Multiply(riskAversion);\n        }\n\n        /// <summary>\n        /// Generate views from multiple alpha models\n        /// </summary>\n        /// <param name=\"insights\">Array of insight that represent the investors' views</param>\n        /// <param name=\"P\">A matrix that identifies the assets involved in the views (size: K x N)</param>\n        /// <param name=\"Q\">A view vector (size: K x 1)</param>\n        protected bool TryGetViews(ICollection<Insight> insights, out double[,] P, out double[] Q)\n        {\n            try\n            {\n                var symbols = insights.Select(insight => insight.Symbol).ToHashSet();\n\n                var tmpQ = insights.GroupBy(insight => insight.SourceModel)\n                    .Select(values =>\n                    {\n                        var upInsightsSum = values.Where(i => i.Direction == InsightDirection.Up).Sum(i => Math.Abs(i.Magnitude.Value));\n                        var dnInsightsSum = values.Where(i => i.Direction == InsightDirection.Down).Sum(i => Math.Abs(i.Magnitude.Value));\n                        return new { View = values.Key, Q = upInsightsSum > dnInsightsSum ? upInsightsSum : dnInsightsSum };\n                    })\n                    .Where(x => x.Q != 0)\n                    .ToDictionary(k => k.View, v => v.Q);\n\n                var tmpP = insights.GroupBy(insight => insight.SourceModel)\n                    .Select(values =>\n                    {\n                        var q = tmpQ[values.Key];\n                        var results = values.ToDictionary(x => x.Symbol, insight =>\n                        {\n                            var value = (int)insight.Direction * Math.Abs(insight.Magnitude.Value);\n                            return value / q;\n                        });\n                        // Add zero for other symbols that are listed but active insight\n                        foreach (var symbol in symbols)\n                        {\n                            if (!results.ContainsKey(symbol))\n                            {\n                                results.Add(symbol, 0d);\n                            }\n                        }\n                        return new { View = values.Key, Results = results };\n                    })\n                    .Where(r => !r.Results.Select(v => Math.Abs(v.Value)).Sum().IsNaNOrZero())\n                    .ToDictionary(k => k.View, v => v.Results);\n\n                P = Matrix.Create(tmpP.Select(d => d.Value.Values.ToArray()).ToArray());\n                Q = tmpQ.Values.ToArray();\n            }\n            catch\n            {\n                P = null;\n                Q = null;\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Apply Black-Litterman master formula\n        /// http://www.blacklitterman.org/cookbook.html\n        /// </summary>\n        /// <param name=\"Π\">Prior/Posterior mean array</param>\n        /// <param name=\"Σ\">Prior/Posterior covariance matrix</param>\n        /// <param name=\"P\">A matrix that identifies the assets involved in the views (size: K x N)</param>\n        /// <param name=\"Q\">A view vector (size: K x 1)</param>\n        private void ApplyBlackLittermanMasterFormula(ref double[] Π, ref double[,] Σ, double[,] P, double[] Q)\n        {\n            // Create the diagonal covariance matrix of error terms from the expressed views\n            var eye = Matrix.Diagonal(Q.GetLength(0), 1);\n            var Ω = Elementwise.Multiply(P.Dot(Σ).DotWithTransposed(P).Multiply(_tau), eye);\n            if (Ω.Determinant() != 0)\n            {\n                // Define matrices Στ and A to avoid recalculations\n                var Στ = Σ.Multiply(_tau);\n                var A = Στ.DotWithTransposed(P).Dot(P.Dot(Στ).DotWithTransposed(P).Add(Ω).Inverse());\n\n                // Compute posterior estimate of the mean: Black-Litterman \"master equation\"\n                Π = Π.Add(A.Dot(Q.Subtract(P.Dot(Π))));\n\n                // Compute posterior estimate of the uncertainty in the mean\n                var M = Στ.Subtract(A.Dot(P).Dot(Στ));\n                Σ = Σ.Add(M).Multiply(_delta);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.MaximumSharpeRatioPortfolioOptimizer import MaximumSharpeRatioPortfolioOptimizer\nfrom itertools import groupby\nfrom numpy import dot, transpose\nfrom numpy.linalg import inv\n\n### <summary>\n### Provides an implementation of Black-Litterman portfolio optimization. The model adjusts equilibrium market\n### returns by incorporating views from multiple alpha models and therefore to get the optimal risky portfolio\n### reflecting those views. If insights of all alpha models have None magnitude or there are linearly dependent\n### vectors in link matrix of views, the expected return would be the implied excess equilibrium return.\n### The interval of weights in optimization method can be changed based on the long-short algorithm.\n### The default model uses the 0.0025 as weight-on-views scalar parameter tau and\n### MaximumSharpeRatioPortfolioOptimizer that accepts a 63-row matrix of 1-day returns.\n### </summary>\nclass BlackLittermanOptimizationPortfolioConstructionModel(PortfolioConstructionModel):\n    def __init__(self,\n                 rebalance = Resolution.DAILY,\n                 portfolio_bias = PortfolioBias.LONG_SHORT,\n                 lookback = 1,\n                 period = 63,\n                 resolution = Resolution.DAILY,\n                 risk_free_rate = 0,\n                 delta = 2.5,\n                 tau = 0.05,\n                 optimizer = None):\n        \"\"\"Initialize the model\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)\n            lookback(int): Historical return lookback period\n            period(int): The time interval of history price to calculate the weight\n            resolution: The resolution of the history price\n            risk_free_rate(float): The risk free rate\n            delta(float): The risk aversion coeffficient of the market portfolio\n            tau(float): The model parameter indicating the uncertainty of the CAPM prior\"\"\"\n        super().__init__()\n        self.lookback = lookback\n        self.period = period\n        self.resolution = resolution\n        self.risk_free_rate = risk_free_rate\n        self.delta = delta\n        self.tau = tau\n        self.portfolio_bias = portfolio_bias\n\n        lower = 0 if portfolio_bias == PortfolioBias.LONG else -1\n        upper = 0 if portfolio_bias == PortfolioBias.SHORT else 1\n        self.optimizer = MaximumSharpeRatioPortfolioOptimizer(lower, upper, risk_free_rate) if optimizer is None else optimizer\n\n        self.sign = lambda x: -1 if x < 0 else (1 if x > 0 else 0)\n        self.symbol_data_by_symbol = {}\n\n        # If the argument is an instance of Resolution or Timedelta\n        # Redefine rebalancing_func\n        rebalancing_func = rebalance\n        if isinstance(rebalance, Resolution):\n            rebalance = Extensions.to_time_span(rebalance)\n        if isinstance(rebalance, timedelta):\n            rebalancing_func = lambda dt: dt + rebalance\n        if rebalancing_func:\n            self.set_rebalancing_func(rebalancing_func)\n\n    def should_create_target_for_insight(self, insight):\n        return PortfolioConstructionModel.filter_invalid_insight_magnitude(self.algorithm, [ insight ])\n\n    def determine_target_percent(self, last_active_insights):\n        targets = {}\n\n        # Get view vectors\n        p, q = self.get_views(last_active_insights)\n        if p is not None:\n            returns = dict()\n            # Updates the BlackLittermanSymbolData with insights\n            # Create a dictionary keyed by the symbols in the insights with an pandas.Series as value to create a data frame\n            for insight in last_active_insights:\n                symbol = insight.symbol\n                symbol_data = self.symbol_data_by_symbol.get(symbol, self.BlackLittermanSymbolData(symbol, self.lookback, self.period))\n                if insight.magnitude is None:\n                    self.algorithm.set_run_time_error(ArgumentNullException('BlackLittermanOptimizationPortfolioConstructionModel does not accept \\'None\\' as Insight.magnitude. Please make sure your Alpha Model is generating Insights with the Magnitude property set.'))\n                    return targets\n                symbol_data.add(insight.generated_time_utc, insight.magnitude)\n                returns[symbol] = symbol_data.return_\n\n            returns = pd.DataFrame(returns)\n\n            # Calculate prior estimate of the mean and covariance\n            pi, sigma = self.get_equilibrium_return(returns)\n\n            # Calculate posterior estimate of the mean and covariance\n            pi, sigma = self.apply_blacklitterman_master_formula(pi, sigma, p, q)\n\n            # Create portfolio targets from the specified insights\n            weights = self.optimizer.optimize(returns, pi, sigma)\n            weights = pd.Series(weights, index = sigma.columns)\n\n            for symbol, weight in weights.items():\n                for insight in last_active_insights:\n                    if str(insight.symbol) == str(symbol):\n                        # don't trust the optimizer\n                        if self.portfolio_bias != PortfolioBias.LONG_SHORT and self.sign(weight) != self.portfolio_bias:\n                            weight = 0\n                        targets[insight] = weight\n                        break\n\n        return targets\n\n    def get_target_insights(self):\n        # Get insight that haven't expired of each symbol that is still in the universe\n        active_insights = filter(self.should_create_target_for_insight,\n            self.algorithm.insights.get_active_insights(self.algorithm.utc_time))\n\n        # Get the last generated active insight for each symbol\n        last_active_insights = []\n        for source_model, f in groupby(sorted(active_insights, key = lambda ff: ff.source_model), lambda fff: fff.source_model):\n            for symbol, g in groupby(sorted(list(f), key = lambda gg: gg.symbol), lambda ggg: ggg.symbol):\n                last_active_insights.append(sorted(g, key = lambda x: x.generated_time_utc)[-1])\n        return last_active_insights\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        # Get removed symbol and invalidate them in the insight collection\n        super().on_securities_changed(algorithm, changes)\n\n        for security in changes.removed_securities:\n            symbol = security.symbol\n            symbol_data = self.symbol_data_by_symbol.pop(symbol, None)\n            if symbol_data is not None:\n                symbol_data.reset()\n\n        # initialize data for added securities\n        added_symbols = { x.symbol: x.exchange.time_zone for x in changes.added_securities }\n        history = algorithm.history(list(added_symbols.keys()), self.lookback * self.period, self.resolution)\n\n        if history.empty:\n            return\n\n        history = history.close.unstack(0)\n        symbols = history.columns\n\n        for symbol, timezone in added_symbols.items():\n            if str(symbol) not in symbols:\n                continue\n\n            symbol_data = self.symbol_data_by_symbol.get(symbol, self.BlackLittermanSymbolData(symbol, self.lookback, self.period))\n            for time, close in history[symbol].items():\n                utc_time = Extensions.convert_to_utc(time, timezone)\n                symbol_data.update(utc_time, close)\n\n            self.symbol_data_by_symbol[symbol] = symbol_data\n\n    def apply_blacklitterman_master_formula(self, Pi, Sigma, P, Q):\n        '''Apply Black-Litterman master formula\n        http://www.blacklitterman.org/cookbook.html\n        Args:\n            Pi: Prior/Posterior mean array\n            Sigma: Prior/Posterior covariance matrix\n            P: A matrix that identifies the assets involved in the views (size: K x N)\n            Q: A view vector (size: K x 1)'''\n        ts = self.tau * Sigma\n\n        # Create the diagonal Sigma matrix of error terms from the expressed views\n        omega = np.dot(np.dot(P, ts), P.T) * np.eye(Q.shape[0])\n        if np.linalg.det(omega) == 0:\n            return Pi, Sigma\n\n        A = np.dot(np.dot(ts, P.T), inv(np.dot(np.dot(P, ts), P.T) + omega))\n\n        Pi = np.squeeze(np.asarray((\n            np.expand_dims(Pi, axis=0).T +\n            np.dot(A, (Q - np.expand_dims(np.dot(P, Pi.T), axis=1))))\n            ))\n\n        M = ts - np.dot(np.dot(A, P), ts)\n        Sigma = (Sigma + M) * self.delta\n\n        return Pi, Sigma\n\n    def get_equilibrium_return(self, returns):\n        '''Calculate equilibrium returns and covariance\n        Args:\n            returns: Matrix of returns where each column represents a security and each row returns for the given date/time (size: K x N)\n        Returns:\n            equilibrium_return: Array of double of equilibrium returns\n            cov: Multi-dimensional array of double with the portfolio covariance of returns (size: K x K)'''\n\n        size = len(returns.columns)\n        # equal weighting scheme\n        W = np.array([1/size]*size)\n        # the covariance matrix of excess returns (N x N matrix)\n        cov = returns.cov()*252\n        # annualized return\n        annual_return = np.sum(((1 + returns.mean())**252 -1) * W)\n        # annualized variance of return\n        annual_variance = dot(W.T, dot(cov, W))\n        # the risk aversion coefficient\n        risk_aversion = (annual_return - self.risk_free_rate ) / annual_variance\n        # the implied excess equilibrium return Vector (N x 1 column vector)\n        equilibrium_return = dot(dot(risk_aversion, cov), W)\n\n        return equilibrium_return, cov\n\n    def get_views(self, insights):\n        '''Generate views from multiple alpha models\n        Args\n            insights: Array of insight that represent the investors' views\n        Returns\n            P: A matrix that identifies the assets involved in the views (size: K x N)\n            Q: A view vector (size: K x 1)'''\n        try:\n            P = {}\n            Q = {}\n            symbols = set(insight.symbol for insight in insights)\n\n            for model, group in groupby(insights, lambda x: x.source_model):\n                group = list(group)\n\n                up_insights_sum = 0.0\n                dn_insights_sum = 0.0\n                for insight in group:\n                    if insight.direction == InsightDirection.UP:\n                        up_insights_sum = up_insights_sum + np.abs(insight.magnitude)\n                    if insight.direction == InsightDirection.DOWN:\n                        dn_insights_sum = dn_insights_sum + np.abs(insight.magnitude)\n\n                q = up_insights_sum if up_insights_sum > dn_insights_sum else dn_insights_sum\n                if q == 0:\n                    continue\n\n                Q[model] = q\n\n                # generate the link matrix of views: P\n                P[model] = dict()\n                for insight in group:\n                    value = insight.direction * np.abs(insight.magnitude)\n                    P[model][insight.symbol] = value / q\n                # Add zero for other symbols that are listed but active insight\n                for symbol in symbols:\n                    if symbol not in P[model]:\n                        P[model][symbol] = 0\n\n            Q = np.array([[x] for x in Q.values()])\n            if len(Q) > 0:\n                P = np.array([list(x.values()) for x in P.values()])\n                return P, Q\n        except:\n            pass\n\n        return None, None\n\n\n    class BlackLittermanSymbolData:\n        '''Contains data specific to a symbol required by this model'''\n        def __init__(self, symbol, lookback, period):\n            self._symbol = symbol\n            self.roc = RateOfChange(f'{symbol}.roc({lookback})', lookback)\n            self.roc.updated += self.on_rate_of_change_updated\n            self.window = RollingWindow(period)\n\n        def reset(self):\n            self.roc.updated -= self.on_rate_of_change_updated\n            self.roc.reset()\n            self.window.reset()\n\n        def update(self, utc_time, close):\n            self.roc.update(utc_time, close)\n\n        def on_rate_of_change_updated(self, roc, value):\n            if roc.is_ready:\n                self.window.add(value)\n\n        def add(self, time, value):\n            if self.window.samples > 0 and self.window[0].end_time == time:\n                return\n\n            item = IndicatorDataPoint(self._symbol, time, value)\n            self.window.add(item)\n\n        @property\n        def return_(self):\n            return pd.Series(\n                data = [x.value for x in self.window],\n                index = [x.end_time for x in self.window])\n\n        @property\n        def is_ready(self):\n            return self.window.is_ready\n\n        def __str__(self, **kwargs):\n            return f'{self.roc.name}: {(1 + self.window[0])**252 - 1:.2%}'\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/ConfidenceWeightedPortfolioConstructionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that generates percent targets based on the\n    /// <see cref=\"Insight.Confidence\"/>. The target percent holdings of each Symbol is given by the <see cref=\"Insight.Confidence\"/>\n    /// from the last active <see cref=\"Insight\"/> for that symbol.\n    /// For insights of direction <see cref=\"InsightDirection.Up\"/>, long targets are returned and for insights of direction\n    /// <see cref=\"InsightDirection.Down\"/>, short targets are returned.\n    /// If the sum of all the last active <see cref=\"Insight\"/> per symbol is bigger than 1, it will factor down each target\n    /// percent holdings proportionally so the sum is 1.\n    /// It will ignore <see cref=\"Insight\"/> that have no <see cref=\"Insight.Confidence\"/> value.\n    /// </summary>\n    public class ConfidenceWeightedPortfolioConstructionModel : InsightWeightingPortfolioConstructionModel\n    {\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public ConfidenceWeightedPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingDateRules, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public ConfidenceWeightedPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalance, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public ConfidenceWeightedPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingFunc, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public ConfidenceWeightedPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingFunc, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public ConfidenceWeightedPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(timeSpan, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"ConfidenceWeightedPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"resolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public ConfidenceWeightedPortfolioConstructionModel(Resolution resolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(resolution, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return insight.Confidence.HasValue;\n        }\n\n        /// <summary>\n        /// Method that will determine which member will be used to compute the weights and gets its value\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>The value of the selected insight member</returns>\n        protected override double GetValue(Insight insight) => insight.Confidence ?? 0;\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/ConfidenceWeightedPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom InsightWeightingPortfolioConstructionModel import InsightWeightingPortfolioConstructionModel\n\nclass ConfidenceWeightedPortfolioConstructionModel(InsightWeightingPortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that generates percent targets based on the\n    Insight.CONFIDENCE. The target percent holdings of each Symbol is given by the Insight.CONFIDENCE from the last\n    active Insight for that symbol.\n    For insights of direction InsightDirection.UP, long targets are returned and for insights of direction\n    InsightDirection.DOWN, short targets are returned.\n    If the sum of all the last active Insight per symbol is bigger than 1, it will factor down each target\n    percent holdings proportionally so the sum is 1.\n    It will ignore Insight that have no Insight.CONFIDENCE value.'''\n\n    def __init__(self, rebalance = Resolution.DAILY, portfolio_bias = PortfolioBias.LONG_SHORT):\n        '''Initialize a new instance of ConfidenceWeightedPortfolioConstructionModel\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)'''\n        super().__init__(rebalance, portfolio_bias)\n\n    def should_create_target_for_insight(self, insight):\n        '''Method that will determine if the portfolio construction model should create a\n        target for this insight\n        Args:\n            insight: The insight to create a target for'''\n        # Ignore insights that don't have Confidence value\n        return insight.confidence is not None\n\n    def get_value(self, insight):\n        '''Method that will determine which member will be used to compute the weights and gets its value\n        Args:\n            insight: The insight to create a target for\n        Returns:\n            The value of the selected insight member'''\n        return insight.confidence\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/EqualWeightingPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that gives equal weighting to all\n    /// securities. The target percent holdings of each security is 1/N where N is the number of securities. For\n    /// insights of direction <see cref=\"InsightDirection.Up\"/>, long targets are returned and for insights of direction\n    /// <see cref=\"InsightDirection.Down\"/>, short targets are returned.\n    /// </summary>\n    public class EqualWeightingPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private readonly PortfolioBias _portfolioBias;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public EqualWeightingPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public EqualWeightingPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingFunc)\n        {\n            _portfolioBias = portfolioBias;\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public EqualWeightingPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public EqualWeightingPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : this((Func<DateTime, DateTime?>)null, portfolioBias)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public EqualWeightingPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : this(dt => dt.Add(timeSpan), portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"EqualWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"resolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public EqualWeightingPortfolioConstructionModel(Resolution resolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : this(resolution.ToTimeSpan(), portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var result = new Dictionary<Insight, double>(activeInsights.Count);\n\n            // give equal weighting to each security\n            var count = activeInsights.Count(x => x.Direction != InsightDirection.Flat && RespectPortfolioBias(x));\n            var percent = count == 0 ? 0 : 1m / count;\n            foreach (var insight in activeInsights)\n            {\n                result[insight] =\n                    (double)((int)(RespectPortfolioBias(insight) ? insight.Direction : InsightDirection.Flat)\n                             * percent);\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Method that will determine if a given insight respects the portfolio bias\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the insight respects the portfolio bias</returns>\n        protected bool RespectPortfolioBias(Insight insight)\n        {\n            return _portfolioBias == PortfolioBias.LongShort || (int)insight.Direction == (int)_portfolioBias;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/EqualWeightingPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass EqualWeightingPortfolioConstructionModel(PortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that gives equal weighting to all securities.\n    The target percent holdings of each security is 1/N where N is the number of securities.\n    For insights of direction InsightDirection.UP, long targets are returned and\n    for insights of direction InsightDirection.DOWN, short targets are returned.'''\n\n    def __init__(self, rebalance = Resolution.DAILY, portfolio_bias = PortfolioBias.LONG_SHORT):\n        '''Initialize a new instance of EqualWeightingPortfolioConstructionModel\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)'''\n        super().__init__()\n        self.portfolio_bias = portfolio_bias\n\n        # If the argument is an instance of Resolution or Timedelta\n        # Redefine rebalancing_func\n        rebalancing_func = rebalance\n        if isinstance(rebalance, Resolution):\n            rebalance = Extensions.to_time_span(rebalance)\n        if isinstance(rebalance, timedelta):\n            rebalancing_func = lambda dt: dt + rebalance\n        if rebalancing_func:\n            self.set_rebalancing_func(rebalancing_func)\n\n    def determine_target_percent(self, active_insights):\n        '''Will determine the target percent for each insight\n        Args:\n            active_insights: The active insights to generate a target for'''\n        result = {}\n\n        # give equal weighting to each security\n        count = sum(x.direction != InsightDirection.FLAT and self.respect_portfolio_bias(x) for x in active_insights)\n        percent = 0 if count == 0 else 1.0 / count\n        for insight in active_insights:\n            result[insight] = (insight.direction if self.respect_portfolio_bias(insight) else InsightDirection.FLAT) * percent\n        return result\n\n    def respect_portfolio_bias(self, insight):\n        '''Method that will determine if a given insight respects the portfolio bias\n        Args:\n            insight: The insight to create a target for\n        '''\n        return self.portfolio_bias == PortfolioBias.LONG_SHORT or insight.direction == self.portfolio_bias\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/InsightWeightingPortfolioConstructionModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that generates percent targets based on the\n    /// <see cref=\"Insight.Weight\"/>. The target percent holdings of each Symbol is given by the <see cref=\"Insight.Weight\"/>\n    /// from the last active <see cref=\"Insight\"/> for that symbol.\n    /// For insights of direction <see cref=\"InsightDirection.Up\"/>, long targets are returned and for insights of direction\n    /// <see cref=\"InsightDirection.Down\"/>, short targets are returned.\n    /// If the sum of all the last active <see cref=\"Insight\"/> per symbol is bigger than 1, it will factor down each target\n    /// percent holdings proportionally so the sum is 1.\n    /// It will ignore <see cref=\"Insight\"/> that have no <see cref=\"Insight.Weight\"/> value.\n    /// </summary>\n    public class InsightWeightingPortfolioConstructionModel : EqualWeightingPortfolioConstructionModel\n    {\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public InsightWeightingPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingDateRules, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public InsightWeightingPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalance, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public InsightWeightingPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingFunc, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public InsightWeightingPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(rebalancingFunc, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public InsightWeightingPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(timeSpan, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"InsightWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"resolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        public InsightWeightingPortfolioConstructionModel(Resolution resolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort)\n            : base(resolution, portfolioBias)\n        {\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return insight.Weight.HasValue;\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var result = new Dictionary<Insight, double>();\n            // We will adjust weights proportionally in case the sum is > 1 so it sums to 1.\n            var weightSums = activeInsights.Where(RespectPortfolioBias).Sum(insight => GetValue(insight));\n            var weightFactor = 1.0;\n            if (weightSums > 1)\n            {\n                weightFactor = 1 / weightSums;\n            }\n            foreach (var insight in activeInsights)\n            {\n                result[insight] = (int)(RespectPortfolioBias(insight) ? insight.Direction : InsightDirection.Flat)\n                                  * GetValue(insight)\n                                  * weightFactor;\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Method that will determine which member will be used to compute the weights and gets its value\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>The value of the selected insight member</returns>\n        protected virtual double GetValue(Insight insight) => insight.Weight != null ? Math.Abs((double)insight.Weight) : 0;\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/InsightWeightingPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\n\nclass InsightWeightingPortfolioConstructionModel(EqualWeightingPortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that generates percent targets based on the\n    Insight.WEIGHT. The target percent holdings of each Symbol is given by the Insight.WEIGHT from the last\n    active Insight for that symbol.\n    For insights of direction InsightDirection.UP, long targets are returned and for insights of direction\n    InsightDirection.DOWN, short targets are returned.\n    If the sum of all the last active Insight per symbol is bigger than 1, it will factor down each target\n    percent holdings proportionally so the sum is 1.\n    It will ignore Insight that have no Insight.WEIGHT value.'''\n\n    def __init__(self, rebalance = Resolution.DAILY, portfolio_bias = PortfolioBias.LONG_SHORT):\n        '''Initialize a new instance of InsightWeightingPortfolioConstructionModel\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)'''\n        super().__init__(rebalance, portfolio_bias)\n\n    def should_create_target_for_insight(self, insight):\n        '''Method that will determine if the portfolio construction model should create a\n        target for this insight\n        Args:\n            insight: The insight to create a target for'''\n        # Ignore insights that don't have Weight value\n        return insight.weight is not None\n\n    def determine_target_percent(self, active_insights):\n        '''Will determine the target percent for each insight\n        Args:\n            active_insights: The active insights to generate a target for'''\n        result = {}\n\n        # We will adjust weights proportionally in case the sum is > 1 so it sums to 1.\n        weight_sums = sum(self.get_value(insight) for insight in active_insights if self.respect_portfolio_bias(insight))\n        weight_factor = 1.0\n        if weight_sums > 1:\n            weight_factor = 1 / weight_sums\n        for insight in active_insights:\n            result[insight] = (insight.direction if self.respect_portfolio_bias(insight) else InsightDirection.FLAT) * self.get_value(insight) * weight_factor\n        return result\n\n    def get_value(self, insight):\n        '''Method that will determine which member will be used to compute the weights and gets its value\n        Args:\n            insight: The insight to create a target for\n        Returns:\n            The value of the selected insight member'''\n        return abs(insight.weight)\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Accord.Math;\nusing Accord.Math.Optimization;\nusing Accord.Statistics;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of a portfolio optimizer that maximizes the portfolio Sharpe Ratio.\n    /// The interval of weights in optimization method can be changed based on the long-short algorithm.\n    /// The default model uses flat risk free rate and weight for an individual security range from -1 to 1.\n    /// </summary>\n    public class MaximumSharpeRatioPortfolioOptimizer : IPortfolioOptimizer\n    {\n        private double _lower;\n        private double _upper;\n        private double _riskFreeRate;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"MaximumSharpeRatioPortfolioOptimizer\"/>\n        /// </summary>\n        /// <param name=\"lower\">Lower constraint</param>\n        /// <param name=\"upper\">Upper constraint</param>\n        /// <param name=\"riskFreeRate\"></param>\n        public MaximumSharpeRatioPortfolioOptimizer(double lower = -1, double upper = 1, double riskFreeRate = 0.0)\n        {\n            _lower = lower;\n            _upper = upper;\n            _riskFreeRate = riskFreeRate;\n        }\n\n        /// <summary>\n        /// Sum of all weight is one: 1^T w = 1 / Σw = 1\n        /// </summary>\n        /// <param name=\"size\">number of variables</param>\n        /// <returns>linear constraint object</returns>\n        protected LinearConstraint GetBudgetConstraint(int size)\n        {\n            return new LinearConstraint(size)\n            {\n                CombinedAs = Vector.Create(size, 1.0),\n                ShouldBe = ConstraintType.EqualTo,\n                Value = 1.0\n            };\n        }\n\n        /// <summary>\n        /// Boundary constraints on weights: lw ≤ w ≤ up\n        /// </summary>\n        /// <param name=\"size\">number of variables</param>\n        /// <returns>enumeration of linear constraint objects</returns>\n        protected IEnumerable<LinearConstraint> GetBoundaryConditions(int size)\n        {\n            for (int i = 0; i < size; i++)\n            {\n                yield return new LinearConstraint(1)\n                {\n                    VariablesAtIndices = new int[] { i },\n                    ShouldBe = ConstraintType.GreaterThanOrEqualTo,\n                    Value = _lower\n                };\n                yield return new LinearConstraint(1)\n                {\n                    VariablesAtIndices = new int[] { i },\n                    ShouldBe = ConstraintType.LesserThanOrEqualTo,\n                    Value = _upper\n                };\n            }\n        }\n\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Array of double with the portfolio annualized expected returns (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n        {\n            covariance = covariance ?? historicalReturns.Covariance();\n            var returns = (expectedReturns ?? historicalReturns.Mean(0)).Subtract(_riskFreeRate);\n\n            var size = covariance.GetLength(0);\n            var x0 = Vector.Create(size, 1.0 / size);\n            var k = returns.Dot(x0);\n\n            var constraints = new List<LinearConstraint>\n            {\n                // Sharpe Maximization under Quadratic Constraints\n                // https://quant.stackexchange.com/questions/18521/sharpe-maximization-under-quadratic-constraints\n                // (µ − r_f)^T w = k\n                new LinearConstraint(size)\n                {\n                    CombinedAs = returns,\n                    ShouldBe = ConstraintType.EqualTo,\n                    Value = k\n                }\n            };\n\n            // Σw = 1\n            constraints.Add(GetBudgetConstraint(size));\n\n            // lw ≤ w ≤ up\n            constraints.AddRange(GetBoundaryConditions(size));\n\n            // Setup solver\n            var optfunc = new QuadraticObjectiveFunction(covariance, Vector.Create(size, 0.0));\n            var solver = new GoldfarbIdnani(optfunc, constraints);\n\n            // Solve problem\n            var success = solver.Minimize(Vector.Copy(x0));\n            var sharpeRatio = returns.Dot(solver.Solution) / solver.Value;\n            return success ? solver.Solution : x0;\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom scipy.optimize import minimize\n\n### <summary>\n### Provides an implementation of a portfolio optimizer that maximizes the portfolio Sharpe Ratio.\n### The interval of weights in optimization method can be changed based on the long-short algorithm.\n### The default model uses flat risk free rate and weight for an individual security range from -1 to 1.'''\n### </summary>\nclass MaximumSharpeRatioPortfolioOptimizer:\n    '''Provides an implementation of a portfolio optimizer that maximizes the portfolio Sharpe Ratio.\n   The interval of weights in optimization method can be changed based on the long-short algorithm.\n   The default model uses flat risk free rate and weight for an individual security range from -1 to 1.'''\n    def __init__(self,\n                 minimum_weight = -1,\n                 maximum_weight = 1,\n                 risk_free_rate = 0):\n        '''Initialize the MaximumSharpeRatioPortfolioOptimizer\n        Args:\n            minimum_weight(float): The lower bounds on portfolio weights\n            maximum_weight(float): The upper bounds on portfolio weights\n            risk_free_rate(float): The risk free rate'''\n        self.minimum_weight = minimum_weight\n        self.maximum_weight = maximum_weight\n        self.risk_free_rate = risk_free_rate\n        self.expected_returns = []\n\n    def optimize(self, historical_returns, expected_returns = None, covariance = None):\n        '''\n        Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        args:\n            historical_returns: Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).\n            expected_returns: Array of double with the portfolio annualized expected returns (size: K x 1).\n            covariance: Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).\n        Returns:\n            Array of double with the portfolio weights (size: K x 1)\n        '''\n        if covariance is None:\n            covariance = historical_returns.cov()\n        if expected_returns is None:\n            expected_returns = historical_returns.mean()\n        expected_returns = expected_returns - self.risk_free_rate\n\n        size = covariance.columns.size   # K x 1\n        x0 = np.array(size * [1. / size])\n        k = expected_returns.dot(x0)\n\n        # Sharpe Maximization under Quadratic Constraints\n        # https://quant.stackexchange.com/questions/18521/sharpe-maximization-under-quadratic-constraints\n        # (µ − r_f)^T w = k\n        constraints = [\n            {'type': 'eq', 'fun': lambda weights: expected_returns.dot(weights) - k}]\n\n        # Σw = 1\n        constraints.append(\n            {'type': 'eq', 'fun': lambda weights: self.get_budget_constraint(weights)})\n\n        opt = minimize(lambda weights: self.portfolio_variance(weights, covariance),   # Objective function\n                       x0,                                                        # Initial guess\n                       bounds = self.get_boundary_conditions(size),               # Bounds for variables: lw ≤ w ≤ up\n                       constraints = constraints,                                 # Constraints definition\n                       method='SLSQP')        # Optimization method:  Sequential Least SQuares Programming\n        sharpe_ratio = expected_returns.dot(opt['x']) / opt.fun\n\n        return opt['x'] if opt['success'] else x0\n\n    def portfolio_variance(self, weights, covariance):\n        '''Computes the portfolio variance\n        Args:\n            weighs: Portfolio weights\n            covariance: Covariance matrix of historical returns'''\n        variance = np.dot(weights.T, np.dot(covariance, weights))\n        if variance == 0 and np.any(weights):\n            # variance can't be zero, with non zero weights\n            raise ValueError(f'MaximumSharpeRatioPortfolioOptimizer.portfolio_variance: Volatility cannot be zero. Weights: {weights}')\n        return variance\n\n    def get_boundary_conditions(self, size):\n        '''Creates the boundary condition for the portfolio weights'''\n        return tuple((self.minimum_weight, self.maximum_weight) for x in range(size))\n\n    def get_budget_constraint(self, weights):\n        '''Defines a budget constraint: the sum of the weights equals unity'''\n        return np.sum(weights) - 1\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MeanReversionPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Math;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Implementation of On-Line Moving Average Reversion (OLMAR)\n    /// </summary>\n    /// <remarks>Li, B., Hoi, S. C. (2012). On-line portfolio selection with moving average reversion. arXiv preprint arXiv:1206.4626.\n    /// Available at https://arxiv.org/ftp/arxiv/papers/1206/1206.4626.pdf</remarks>\n    /// <remarks>Using windowSize = 1 => Passive Aggressive Mean Reversion (PAMR) Portfolio</remarks>\n    public class MeanReversionPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private int _numOfAssets;\n        private double[] _weightVector;\n        private decimal _reversionThreshold;\n        private int _windowSize;\n        private Resolution _resolution;\n        private Dictionary<Symbol, MeanReversionSymbolData> _symbolData = new();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias, reversionThreshold, windowSize, resolution)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"rebalanceResolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(Resolution rebalanceResolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : this(rebalanceResolution.ToTimeSpan(), portfolioBias, reversionThreshold, windowSize, resolution)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : this(dt => dt.Add(timeSpan), portfolioBias, reversionThreshold, windowSize, resolution)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : this((Func<DateTime, DateTime?>)null, portfolioBias, reversionThreshold, windowSize, resolution)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,\n                   portfolioBias, reversionThreshold, windowSize, resolution)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MeanReversionPortfolioConstructionModel\"/> class\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"reversionThreshold\">Reversion threshold</param>\n        /// <param name=\"windowSize\">Window size of mean price</param>\n        /// <param name=\"resolution\">The resolution of the history price and rebalancing</param>\n        public MeanReversionPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            decimal reversionThreshold = 1, \n            int windowSize = 20, \n            Resolution resolution = Resolution.Daily)\n            : base(rebalancingFunc)\n        {\n            if (portfolioBias == PortfolioBias.Short)\n            {\n                throw new ArgumentException(\"Long position must be allowed in MeanReversionPortfolioConstructionModel.\");\n            }\n            \n            _reversionThreshold = reversionThreshold;\n            _resolution = resolution;\n            _windowSize = windowSize;\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">list of active insights</param>\n        /// <return>dictionary of insight and respective target weight</return>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var targets = new Dictionary<Insight, double>();\n\n            // If we have no insights or non-ready just return an empty target list\n            if (activeInsights.IsNullOrEmpty() || \n                !activeInsights.All(x => _symbolData[x.Symbol].IsReady()))\n            {\n                return targets;\n            }\n\n            var numOfAssets = activeInsights.Count;\n            if (_numOfAssets != numOfAssets)\n            {\n                _numOfAssets = numOfAssets;\n                // Initialize price vector and portfolio weightings vector\n                _weightVector = Enumerable.Repeat((double) 1/_numOfAssets, _numOfAssets).ToArray();\n            }\n\n            // Get price relatives vs expected price (SMA)\n            var priceRelatives = GetPriceRelatives(activeInsights);     // \\tilde{x}_{t+1}\n\n            // Get step size of next portfolio\n            // \\bar{x}_{t+1} = 1^T * \\tilde{x}_{t+1} / m\n            // \\lambda_{t+1} = max( 0, ( b_t * \\tilde{x}_{t+1} - \\epsilon ) / ||\\tilde{x}_{t+1}  - \\bar{x}_{t+1} * 1|| ^ 2 )\n            var nextPrediction = priceRelatives.Average();      // \\bar{x}_{t+1}\n            var assetsMeanDev = priceRelatives.Select(x => x - nextPrediction).ToArray();\n            var secondNorm = Math.Pow(assetsMeanDev.Euclidean(), 2);\n            double stepSize;        // \\lambda_{t+1}\n            \n            if (secondNorm == 0d)\n            {\n                stepSize = 0d;\n            }\n            else\n            {\n                stepSize = (_weightVector.InnerProduct(priceRelatives) - (double)_reversionThreshold) / secondNorm;\n                stepSize = Math.Max(0d, stepSize);\n            }\n\n            // Get next portfolio weightings\n            // b_{t+1} = b_t - step_size * ( \\tilde{x}_{t+1}  - \\bar{x}_{t+1} * 1 )\n            var nextPortfolio = _weightVector.Select((x, i) => x - assetsMeanDev[i] * stepSize);\n            // Normalize\n            var normalizedPortfolioWeightVector = SimplexProjection(nextPortfolio);\n            // Save normalized result for the next portfolio step\n            _weightVector = normalizedPortfolioWeightVector;\n\n            // Update portfolio state\n            for (int i = 0; i < _numOfAssets; i++)\n            {\n                targets.Add(activeInsights[i], normalizedPortfolioWeightVector[i]);\n            }\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Get price relatives with reference level of SMA\n        /// </summary>\n        /// <param name=\"activeInsights\">list of active insights</param>\n        /// <return>array of price relatives vector</return>\n        protected virtual double[] GetPriceRelatives(List<Insight> activeInsights)\n        {\n            var numOfInsights = activeInsights.Count;\n\n            // Initialize a price vector of the next prices relatives' projection\n            var nextPriceRelatives = new double[numOfInsights];\n\n            for (int i = 0; i < numOfInsights; i++)\n            {\n                var insight = activeInsights[i];\n                var symbolData = _symbolData[insight.Symbol];\n\n                nextPriceRelatives[i] = insight.Magnitude != null ?\n                            1 + (double)insight.Magnitude * (int)insight.Direction:\n                            (double)symbolData.Identity.Current.Value / (double)symbolData.Sma.Current.Value;\n            }\n\n            return nextPriceRelatives;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(algorithm, changes);\n\n            // clean up data for removed securities\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                _symbolData.Remove(removed.Symbol, out var symbolData);\n                symbolData.Reset();\n            }\n\n            // initialize data for added securities\n            var symbols = changes.AddedSecurities.Select(x => x.Symbol);\n\n            foreach(var symbol in symbols)\n            {\n                if (!_symbolData.ContainsKey(symbol))\n                {\n                    _symbolData.Add(symbol, new MeanReversionSymbolData(algorithm, symbol, _windowSize, _resolution));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Cumulative Sum of a given sequence\n        /// </summary>\n        /// <param name=\"sequence\">sequence to obtain cumulative sum</param>\n        /// <return>cumulative sum</return>\n        public static IEnumerable<double> CumulativeSum(IEnumerable<double> sequence)\n        {\n            double sum = 0;\n            foreach(var item in sequence)\n            {\n                sum += item;\n                yield return sum;\n            }        \n        }\n\n        /// <summary>\n        /// Normalize the updated portfolio into weight vector:\n        /// v_{t+1} = arg min || v - v_{t+1} || ^ 2\n        /// </summary>\n        /// <remark>Duchi, J., Shalev-Shwartz, S., Singer, Y., and Chandra, T. (2008, July). \n        /// Efficient projections onto the l1-ball for learning in high dimensions.\n        /// In Proceedings of the 25th international conference on Machine learning (pp. 272-279).</remark>\n        /// <param name=\"vector\">unnormalized weight vector</param>\n        /// <param name=\"total\">regulator, default to be 1, making it a probabilistic simplex</param>\n        /// <return>normalized weight vector</return>\n        public static double[] SimplexProjection(IEnumerable<double> vector, double total = 1)\n        {\n            if (total <= 0)\n            {\n                throw new ArgumentException(\"Total must be > 0 for Euclidean Projection onto the Simplex.\");\n            }\n\n            // Sort v into u in descending order\n            var mu = vector.OrderByDescending(x => x).ToArray();\n            var sv = CumulativeSum(mu).ToArray();\n\n            var rho = Enumerable.Range(0, vector.Count()).Where(i => mu[i] > (sv[i] - total) / (i+1)).Last();\n            var theta = (sv[rho] - total) / (rho + 1);\n            var w = vector.Select(x => Math.Max(x - theta, 0d)).ToArray();\n            return w;\n        }\n\n        private class MeanReversionSymbolData\n        {\n            public Identity Identity;\n            public SimpleMovingAverage Sma;\n\n            public MeanReversionSymbolData(QCAlgorithm algo, Symbol symbol, int windowSize, Resolution resolution)\n            {\n                // Indicator of price\n                Identity = algo.Identity(symbol, resolution);\n                // Moving average indicator for mean reversion level\n                Sma = algo.SMA(symbol, windowSize, resolution);\n\n                // Warmup indicator\n                algo.WarmUpIndicator(symbol, Identity, resolution);\n                algo.WarmUpIndicator(symbol, Sma, resolution);\n            }\n\n            public void Reset()\n            {\n                Identity.Reset();\n                Sma.Reset();\n            }\n            \n            public bool IsReady()\n            {\n                return (Identity.IsReady & Sma.IsReady);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MeanReversionPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Implementation of On-Line Moving Average Reversion (OLMAR)\n### </summary>\n### <remarks>Li, B., Hoi, S. C. (2012). On-line portfolio selection with moving average reversion. arXiv preprint arXiv:1206.4626.\n### Available at https://arxiv.org/ftp/arxiv/papers/1206/1206.4626.pdf</remarks>\n### <remarks>Using windowSize = 1 => Passive Aggressive Mean Reversion (PAMR) Portfolio</remarks>\nclass MeanReversionPortfolioConstructionModel(PortfolioConstructionModel):\n    \n    def __init__(self,\n                 rebalance = Resolution.Daily,\n                 portfolioBias = PortfolioBias.LongShort,\n                 reversion_threshold = 1,\n                 window_size = 20,\n                 resolution = Resolution.Daily):\n        \"\"\"Initialize the model\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolioBias: Specifies the bias of the portfolio (Short, Long/Short, Long)\n            reversion_threshold: Reversion threshold\n            window_size: Window size of mean price calculation\n            resolution: The resolution of the history price and rebalancing\n        \"\"\"\n        super().__init__()\n        if portfolioBias == PortfolioBias.Short:\n            raise ArgumentException(\"Long position must be allowed in MeanReversionPortfolioConstructionModel.\")\n            \n        self.reversion_threshold = reversion_threshold\n        self.window_size = window_size\n        self.resolution = resolution\n\n        self.num_of_assets = 0\n        # Initialize a dictionary to store stock data\n        self.symbol_data = {}\n\n        # If the argument is an instance of Resolution or Timedelta\n        # Redefine rebalancingFunc\n        rebalancingFunc = rebalance\n        if isinstance(rebalance, int):\n            rebalance = Extensions.ToTimeSpan(rebalance)\n        if isinstance(rebalance, timedelta):\n            rebalancingFunc = lambda dt: dt + rebalance\n        if rebalancingFunc:\n            self.SetRebalancingFunc(rebalancingFunc)\n\n    def DetermineTargetPercent(self, activeInsights):\n        \"\"\"Will determine the target percent for each insight\n        Args:\n            activeInsights: list of active insights\n        Returns:\n            dictionary of insight and respective target weight\n        \"\"\"\n        targets = {}\n\n        # If we have no insights or non-ready just return an empty target list\n        if len(activeInsights) == 0 or not all([self.symbol_data[x.Symbol].IsReady for x in activeInsights]):\n            return targets\n\n        num_of_assets = len(activeInsights)\n        if self.num_of_assets != num_of_assets:\n            self.num_of_assets = num_of_assets\n            # Initialize portfolio weightings vector\n            self.weight_vector = np.ones(num_of_assets) * (1/num_of_assets)\n            \n        ### Get price relatives vs expected price (SMA)\n        price_relatives = self.GetPriceRelatives(activeInsights)     # \\tilde{x}_{t+1}\n\n        ### Get step size of next portfolio\n        # \\bar{x}_{t+1} = 1^T * \\tilde{x}_{t+1} / m\n        # \\lambda_{t+1} = max( 0, ( b_t * \\tilde{x}_{t+1} - \\epsilon ) / ||\\tilde{x}_{t+1}  - \\bar{x}_{t+1} * 1|| ^ 2 )\n        next_prediction = price_relatives.mean()        # \\bar{x}_{t+1}\n        assets_mean_dev = price_relatives - next_prediction\n        second_norm = (np.linalg.norm(assets_mean_dev)) ** 2\n        \n        if second_norm == 0.0:\n            step_size = 0\n        else:\n            step_size = (np.dot(self.weight_vector, price_relatives) - self.reversion_threshold) / second_norm\n            step_size = max(0, step_size)       # \\lambda_{t+1}\n\n        ### Get next portfolio weightings\n        # b_{t+1} = b_t - step_size * ( \\tilde{x}_{t+1}  - \\bar{x}_{t+1} * 1 )\n        next_portfolio = self.weight_vector - step_size * assets_mean_dev\n        # Normalize\n        normalized_portfolio_weight_vector = self.SimplexProjection(next_portfolio)\n        # Save normalized result for the next portfolio step\n        self.weight_vector = normalized_portfolio_weight_vector\n\n        # Update portfolio state\n        for i, insight in enumerate(activeInsights):\n            targets[insight] = normalized_portfolio_weight_vector[i]\n\n        return targets\n    \n    def GetPriceRelatives(self, activeInsights):\n        \"\"\"Get price relatives with reference level of SMA\n        Args:\n            activeInsights: list of active insights\n        Returns:\n            array of price relatives vector\n        \"\"\"        \n        # Initialize a price vector of the next prices relatives' projection\n        next_price_relatives = np.zeros(len(activeInsights))\n\n        ### Get next price relative predictions\n        # Using the previous price to simulate assumption of instant reversion\n        for i, insight in enumerate(activeInsights):\n            symbol_data = self.symbol_data[insight.Symbol]\n            next_price_relatives[i] = 1 + insight.Magnitude * insight.Direction \\\n                if insight.Magnitude is not None \\\n                else symbol_data.Identity.Current.Value / symbol_data.Sma.Current.Value\n        \n        return next_price_relatives\n\n    def OnSecuritiesChanged(self, algorithm, changes):\n        \"\"\"Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm\n        \"\"\"\n        # clean up data for removed securities\n        super().OnSecuritiesChanged(algorithm, changes)\n        for removed in changes.RemovedSecurities:\n            symbol_data = self.symbol_data.pop(removed.Symbol, None)\n            symbol_data.Reset()\n\n        # initialize data for added securities\n        symbols = [ x.Symbol for x in changes.AddedSecurities ]\n\n        for symbol in symbols:\n            if symbol not in self.symbol_data:\n                self.symbol_data[symbol] = self.MeanReversionSymbolData(algorithm, symbol, self.window_size, self.resolution)\n\n    def SimplexProjection(self, vector, total=1):\n        \"\"\"Normalize the updated portfolio into weight vector:\n        v_{t+1} = arg min || v - v_{t+1} || ^ 2\n        Implementation from:\n        Duchi, J., Shalev-Shwartz, S., Singer, Y., & Chandra, T. (2008, July). \n            Efficient projections onto the l 1-ball for learning in high dimensions.\n            In Proceedings of the 25th international conference on Machine learning \n            (pp. 272-279).\n        Args:\n            vector: unnormalized weight vector\n            total: total weight of output, default to be 1, making it a probabilistic simplex\n        \"\"\"\n        if total <= 0:\n            raise ArgumentException(\"Total must be > 0 for Euclidean Projection onto the Simplex.\")\n            \n        vector = np.asarray(vector)\n\n        # Sort v into u in descending order\n        mu = np.sort(vector)[::-1]\n        sv = np.cumsum(mu)\n\n        rho = np.where(mu > (sv - total) / np.arange(1, len(vector) + 1))[0][-1]\n        theta = (sv[rho] - total) / (rho + 1)\n        w = (vector - theta)\n        w[w < 0] = 0\n        return w\n\n    class MeanReversionSymbolData:\n        def __init__(self, algo, symbol, window_size, resolution):\n            # Indicator of price\n            self.Identity = algo.Identity(symbol, resolution)\n            # Moving average indicator for mean reversion level\n            self.Sma = algo.SMA(symbol, window_size, resolution)\n            \n            # Warmup indicator\n            algo.WarmUpIndicator(symbol, self.Identity, resolution)\n            algo.WarmUpIndicator(symbol, self.Sma, resolution)\n\n        def Reset(self):\n            self.Identity.Reset()\n            self.Sma.Reset()\n        \n        @property\n        def IsReady(self):\n            return self.Identity.IsReady and self.Sma.IsReady"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Math;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of Mean-Variance portfolio optimization based on modern portfolio theory.\n    /// The interval of weights in optimization method can be changed based on the long-short algorithm.\n    /// The default model uses the last three months daily price to calculate the optimal weight\n    /// with the weight range from -1 to 1 and minimize the portfolio variance with a target return of 2%\n    /// </summary>\n    public class MeanVarianceOptimizationPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private readonly int _lookback;\n        private readonly int _period;\n        private readonly Resolution _resolution;\n        private readonly PortfolioBias _portfolioBias;\n        private readonly IPortfolioOptimizer _optimizer;\n        private readonly Dictionary<Symbol, ReturnsSymbolData> _symbolDataDict;\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public MeanVarianceOptimizationPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias, lookback, period, resolution, targetReturn, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalanceResolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public MeanVarianceOptimizationPortfolioConstructionModel(Resolution rebalanceResolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalanceResolution.ToTimeSpan(), portfolioBias, lookback, period, resolution, targetReturn, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public MeanVarianceOptimizationPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            IPortfolioOptimizer optimizer = null)\n            : this(dt => dt.Add(timeSpan), portfolioBias, lookback, period, resolution, targetReturn, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public MeanVarianceOptimizationPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            PyObject optimizer = null)\n            : this((Func<DateTime, DateTime?>)null, portfolioBias, lookback, period, resolution, targetReturn, null)\n        {\n            SetRebalancingFunc(rebalance);\n\n            if (optimizer != null)\n            {\n                if (optimizer.TryConvert<IPortfolioOptimizer>(out var csharpOptimizer))\n                {\n                    _optimizer = csharpOptimizer;\n                }\n                else\n                {\n                    _optimizer = new PortfolioOptimizerPythonWrapper(optimizer);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public MeanVarianceOptimizationPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,\n                portfolioBias,\n                lookback,\n                period,\n                resolution,\n                targetReturn,\n                optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"targetReturn\">The target portfolio return</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public MeanVarianceOptimizationPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 63,\n            Resolution resolution = Resolution.Daily,\n            double targetReturn = 0.02,\n            IPortfolioOptimizer optimizer = null)\n            : base(rebalancingFunc)\n        {\n            _lookback = lookback;\n            _period = period;\n            _resolution = resolution;\n            _portfolioBias = portfolioBias;\n\n            var lower = portfolioBias == PortfolioBias.Long ? 0 : -1;\n            var upper = portfolioBias == PortfolioBias.Short ? 0 : 1;\n            _optimizer = optimizer ?? new MinimumVariancePortfolioOptimizer(lower, upper, targetReturn);\n\n            _symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            var filteredInsight = FilterInvalidInsightMagnitude(Algorithm, new[] { insight }).FirstOrDefault();\n            if (filteredInsight == null)\n            {\n                return false;\n            }\n\n            ReturnsSymbolData data;\n            if (_symbolDataDict.TryGetValue(insight.Symbol, out data))\n            {\n                if (!insight.Magnitude.HasValue)\n                {\n                    Algorithm.SetRunTimeError(\n                        new ArgumentNullException(\n                            insight.Symbol.Value,\n                            \"MeanVarianceOptimizationPortfolioConstructionModel does not accept 'null' as Insight.Magnitude. \" +\n                            \"Please checkout the selected Alpha Model specifications: \" + insight.SourceModel));\n                    return false;\n                }\n                data.Add(Algorithm.Time, insight.Magnitude.Value.SafeDecimalCast());\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var targets = new Dictionary<Insight, double>();\n\n            // If we have no insights just return an empty target list\n            if (activeInsights.IsNullOrEmpty())\n            {\n                return targets;\n            }\n\n            var symbols = activeInsights.Select(x => x.Symbol).ToList();\n\n            // Get symbols' returns, we use simple return according to\n            // Meucci, Attilio, Quant Nugget 2: Linear vs. Compounded Returns – Common Pitfalls in Portfolio Management (May 1, 2010). \n            // GARP Risk Professional, pp. 49-51, April 2010 , Available at SSRN: https://ssrn.com/abstract=1586656\n            var returns = _symbolDataDict.FormReturnsMatrix(symbols);\n\n            // The optimization method processes the data frame\n            var w = _optimizer.Optimize(returns);\n\n            // process results\n            if (w.Length > 0)\n            {\n                var sidx = 0;\n                foreach (var symbol in symbols)\n                {\n                    var weight = w[sidx];\n\n                    // don't trust the optimizer\n                    if (_portfolioBias != PortfolioBias.LongShort\n                        && Math.Sign(weight) != (int)_portfolioBias)\n                    {\n                        weight = 0;\n                    }\n\n                    targets[activeInsights.First(insight => insight.Symbol == symbol)] = weight;\n\n                    sidx++;\n                }\n            }\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(algorithm, changes);\n            // clean up data for removed securities\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                ReturnsSymbolData data;\n                if (_symbolDataDict.TryGetValue(removed.Symbol, out data))\n                {\n                    _symbolDataDict.Remove(removed.Symbol);\n                }\n            }\n\n            if (changes.AddedSecurities.Count == 0)\n                return;\n\n            // initialize data for added securities\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!_symbolDataDict.ContainsKey(added.Symbol))\n                {\n                    var symbolData = new ReturnsSymbolData(added.Symbol, _lookback, _period);\n                    _symbolDataDict[added.Symbol] = symbolData;\n                }\n            }\n\n            // warmup our indicators by pushing history through the consolidators\n            algorithm.History(changes.AddedSecurities.Select(security => security.Symbol), _lookback * _period, _resolution)\n                .PushThrough(bar =>\n                {\n                    ReturnsSymbolData symbolData;\n                    if (_symbolDataDict.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData.Update(bar.EndTime, bar.Value);\n                    }\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.MinimumVariancePortfolioOptimizer import MinimumVariancePortfolioOptimizer\n\n### <summary>\n### Provides an implementation of Mean-Variance portfolio optimization based on modern portfolio theory.\n### The default model uses the MinimumVariancePortfolioOptimizer that accepts a 63-row matrix of 1-day returns.\n### </summary>\nclass MeanVarianceOptimizationPortfolioConstructionModel(PortfolioConstructionModel):\n    def __init__(self,\n                 rebalance = Resolution.DAILY,\n                 portfolio_bias = PortfolioBias.LONG_SHORT,\n                 lookback = 1,\n                 period = 63,\n                 resolution = Resolution.DAILY,\n                 target_return = 0.02,\n                 optimizer = None):\n        \"\"\"Initialize the model\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)\n            lookback(int): Historical return lookback period\n            period(int): The time interval of history price to calculate the weight\n            resolution: The resolution of the history price\n            optimizer(class): Method used to compute the portfolio weights\"\"\"\n        super().__init__()\n        self.lookback = lookback\n        self.period = period\n        self.resolution = resolution\n        self.portfolio_bias = portfolio_bias\n        self.sign = lambda x: -1 if x < 0 else (1 if x > 0 else 0)\n\n        lower = 0 if portfolio_bias == PortfolioBias.LONG else -1\n        upper = 0 if portfolio_bias == PortfolioBias.SHORT else 1\n        self.optimizer = MinimumVariancePortfolioOptimizer(lower, upper, target_return) if optimizer is None else optimizer\n\n        self.symbol_data_by_symbol = {}\n\n        # If the argument is an instance of Resolution or Timedelta\n        # Redefine rebalancing_func\n        rebalancing_func = rebalance\n        if isinstance(rebalance, Resolution):\n            rebalance = Extensions.to_time_span(rebalance)\n        if isinstance(rebalance, timedelta):\n            rebalancing_func = lambda dt: dt + rebalance\n        if rebalancing_func:\n            self.set_rebalancing_func(rebalancing_func)\n\n    def should_create_target_for_insight(self, insight):\n        if len(PortfolioConstructionModel.filter_invalid_insight_magnitude(self.algorithm, [insight])) == 0:\n            return False\n\n        symbol_data = self.symbol_data_by_symbol.get(insight.symbol)\n        if insight.magnitude is None:\n            self.algorithm.set_run_time_error(ArgumentNullException('MeanVarianceOptimizationPortfolioConstructionModel does not accept \\'None\\' as Insight.magnitude. Please checkout the selected Alpha Model specifications.'))\n            return False\n        symbol_data.add(self.algorithm.time, insight.magnitude)\n\n        return True\n\n    def determine_target_percent(self, active_insights):\n        \"\"\"\n         Will determine the target percent for each insight\n        Args:\n        Returns:\n        \"\"\"\n        targets = {}\n\n        # If we have no insights just return an empty target list\n        if len(active_insights) == 0:\n            return targets\n\n        symbols = [insight.symbol for insight in active_insights]\n\n        # Create a dictionary keyed by the symbols in the insights with an pandas.series as value to create a data frame\n        returns = { str(symbol.id) : data.return_ for symbol, data in self.symbol_data_by_symbol.items() if symbol in symbols }\n        returns = pd.DataFrame(returns)\n\n        # The portfolio optimizer finds the optional weights for the given data\n        weights = self.optimizer.optimize(returns)\n        weights = pd.Series(weights, index = returns.columns)\n\n        # Create portfolio targets from the specified insights\n        for insight in active_insights:\n            weight = weights[str(insight.symbol.id)]\n\n            # don't trust the optimizer\n            if self.portfolio_bias != PortfolioBias.LONG_SHORT and self.sign(weight) != self.portfolio_bias:\n                weight = 0\n            targets[insight] = weight\n\n        return targets\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        # clean up data for removed securities\n        super().on_securities_changed(algorithm, changes)\n        for removed in changes.removed_securities:\n            symbol_data = self.symbol_data_by_symbol.pop(removed.symbol, None)\n            symbol_data.reset()\n\n        # initialize data for added securities\n        symbols = [x.symbol for x in changes.added_securities]\n        for symbol in [x for x in symbols if x not in self.symbol_data_by_symbol]:\n            self.symbol_data_by_symbol[symbol] = self.MeanVarianceSymbolData(symbol, self.lookback, self.period)\n\n        history = algorithm.history[TradeBar](symbols, self.lookback * self.period, self.resolution)\n        for bars in history:\n            for symbol, bar in bars.items():\n                symbol_data = self.symbol_data_by_symbol.get(symbol).update(bar.end_time, bar.value)\n\n    class MeanVarianceSymbolData:\n        '''Contains data specific to a symbol required by this model'''\n        def __init__(self, symbol, lookback, period):\n            self._symbol = symbol\n            self.roc = RateOfChange(f'{symbol}.roc({lookback})', lookback)\n            self.roc.updated += self.on_rate_of_change_updated\n            self.window = RollingWindow(period)\n\n        def reset(self):\n            self.roc.updated -= self.on_rate_of_change_updated\n            self.roc.reset()\n            self.window.reset()\n\n        def update(self, time, value):\n            return self.roc.update(time, value)\n\n        def on_rate_of_change_updated(self, roc, value):\n            if roc.is_ready:\n                self.window.add(value)\n\n        def add(self, time, value):\n            item = IndicatorDataPoint(self._symbol, time, value)\n            self.window.add(item)\n\n        # Get symbols' returns, we use simple return according to\n        # Meucci, Attilio, Quant Nugget 2: Linear vs. Compounded Returns – Common Pitfalls in Portfolio Management (May 1, 2010).\n        # GARP Risk Professional, pp. 49-51, April 2010 , Available at SSRN: https://ssrn.com/abstract=1586656\n        @property\n        def return_(self):\n            return pd.Series(\n                data = [x.value for x in self.window],\n                index = [x.end_time for x in self.window])\n\n        @property\n        def is_ready(self):\n            return self.window.is_ready\n\n        def __str__(self, **kwargs):\n            return '{}: {:.2%}'.format(self.roc.name, self.window[0])\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Math;\nusing Accord.Math.Optimization;\nusing Accord.Statistics;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of a minimum variance portfolio optimizer that calculate the optimal weights\n    /// with the weight range from -1 to 1 and minimize the portfolio variance with a target return of 2%\n    /// </summary>\n    /// <remarks>The budged constrain is scaled down/up to ensure that the sum of the absolute value of the weights is 1.</remarks>\n    public class MinimumVariancePortfolioOptimizer : IPortfolioOptimizer\n    {\n        private double _lower;\n        private double _upper;\n        private double _targetReturn;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"MinimumVariancePortfolioOptimizer\"/>\n        /// </summary>\n        /// <param name=\"lower\">Lower bound</param>\n        /// <param name=\"upper\">Upper bound</param>\n        /// <param name=\"targetReturn\">Target return</param>\n        public MinimumVariancePortfolioOptimizer(double lower = -1, double upper = 1, double targetReturn = 0.02)\n        {\n            _lower = lower;\n            _upper = upper;\n            _targetReturn = targetReturn;\n        }\n\n        /// <summary>\n        /// Sum of all weight is one: 1^T w = 1 / Σw = 1\n        /// </summary>\n        /// <param name=\"size\">number of variables</param>\n        /// <returns>linear constaraint object</returns>\n        protected LinearConstraint GetBudgetConstraint(int size)\n        {\n            return new LinearConstraint(size)\n            {\n                CombinedAs = Vector.Create(size, 1.0),\n                ShouldBe = ConstraintType.EqualTo,\n                Value = 1.0\n            };\n        }\n\n        /// <summary>\n        /// Boundary constraints on weights: lw ≤ w ≤ up\n        /// </summary>\n        /// <param name=\"size\">number of variables</param>\n        /// <returns>enumeration of linear constaraint objects</returns>\n        protected IEnumerable<LinearConstraint> GetBoundaryConditions(int size)\n        {\n            for (var i = 0; i < size; i++)\n            {\n                yield return new LinearConstraint(1)\n                {\n                    VariablesAtIndices = new[] { i },\n                    ShouldBe = ConstraintType.GreaterThanOrEqualTo,\n                    Value = _lower\n                };\n                yield return new LinearConstraint(1)\n                {\n                    VariablesAtIndices = new[] { i },\n                    ShouldBe = ConstraintType.LesserThanOrEqualTo,\n                    Value = _upper\n                };\n            }\n        }\n\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Array of double with the portfolio annualized expected returns (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n        {\n            covariance ??=  historicalReturns.Covariance();\n            var size = covariance.GetLength(0);\n            var returns = expectedReturns ?? historicalReturns.Mean(0);\n\n            var constraints = new List<LinearConstraint>\n            {\n                // w^T µ ≥ β\n                new (size)\n                {\n                    CombinedAs = returns,\n                    ShouldBe = ConstraintType.EqualTo,\n                    Value = _targetReturn\n                },\n                // Σw = 1\n                GetBudgetConstraint(size),\n            };\n            \n            // lw ≤ w ≤ up\n            constraints.AddRange(GetBoundaryConditions(size));\n\n            // Setup solver\n            var optfunc = new QuadraticObjectiveFunction(covariance, Vector.Create(size, 0.0));\n            var solver = new GoldfarbIdnani(optfunc, constraints);\n\n            // Solve problem\n            var x0 = Vector.Create(size, 1.0 / size);\n            var success = solver.Minimize(Vector.Copy(x0));\n            if (!success) return x0;\n\n            // We cannot accept NaN\n            var solution = solver.Solution\n                .Select(x => x.IsNaNOrInfinity() ? 0 : x).ToArray();\n\n            // Scale the solution to ensure that the sum of the absolute weights is 1\n            var sumOfAbsoluteWeights = solution.Abs().Sum();\n            if (sumOfAbsoluteWeights.IsNaNOrZero()) return x0;\n\n            return solution.Divide(sumOfAbsoluteWeights);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom scipy.optimize import minimize\n\n### <summary>\n### Provides an implementation of a portfolio optimizer that calculate the optimal weights\n### with the weight range from -1 to 1 and minimize the portfolio variance with a target return of 2%\n### </summary>\n### <remarks>The budged constrain is scaled down/up to ensure that the sum of the absolute value of the weights is 1.</remarks>\nclass MinimumVariancePortfolioOptimizer:\n    '''Provides an implementation of a portfolio optimizer that calculate the optimal weights\n    with the weight range from -1 to 1 and minimize the portfolio variance with a target return of 2%'''\n    def __init__(self,\n                 minimum_weight = -1,\n                 maximum_weight = 1,\n                 target_return = 0.02):\n        '''Initialize the MinimumVariancePortfolioOptimizer\n        Args:\n            minimum_weight(float): The lower bounds on portfolio weights\n            maximum_weight(float): The upper bounds on portfolio weights\n            target_return(float): The target portfolio return'''\n        self.minimum_weight = minimum_weight\n        self.maximum_weight = maximum_weight\n        self.target_return = target_return\n\n    def optimize(self, historical_returns, expected_returns = None, covariance = None):\n        '''\n        Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        args:\n            historical_returns: Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).\n            expected_returns: Array of double with the portfolio annualized expected returns (size: K x 1).\n            covariance: Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).\n        Returns:\n            Array of double with the portfolio weights (size: K x 1)\n        '''\n        if covariance is None:\n            covariance = historical_returns.cov()\n        if expected_returns is None:\n            expected_returns = historical_returns.mean()\n\n        size = historical_returns.columns.size   # K x 1\n        x0 = np.array(size * [1. / size])\n\n        constraints = [\n            {'type': 'eq', 'fun': lambda weights: self.get_budget_constraint(weights)},\n            {'type': 'eq', 'fun': lambda weights: self.get_target_constraint(weights, expected_returns)}]\n\n        # https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html\n        opt = minimize(lambda weights: self.portfolio_variance(weights, covariance),     # Objective function\n                       x0,                                                        # Initial guess\n                       bounds = self.get_boundary_conditions(size),               # Bounds for variables\n                       constraints = constraints,                                 # Constraints definition\n                       method='SLSQP')     # Optimization method:  Sequential Least Squares Programming (SLSQP)\n\n        if not opt['success']: return x0\n\n        # Scale the solution to ensure that the sum of the absolute weights is 1\n        sum_of_absolute_weights = np.sum(np.abs(opt['x']))\n        return opt['x'] / sum_of_absolute_weights\n\n    def portfolio_variance(self, weights, covariance):\n        '''Computes the portfolio variance\n        Args:\n            weighs: Portfolio weights\n            covariance: Covariance matrix of historical returns'''\n        variance = np.dot(weights.T, np.dot(covariance, weights))\n        if variance == 0 and np.any(weights):\n            # variance can't be zero, with non zero weights\n            raise ValueError(f'MinimumVariancePortfolioOptimizer.portfolio_variance: Volatility cannot be zero. Weights: {weights}')\n        return variance\n\n    def get_boundary_conditions(self, size):\n        '''Creates the boundary condition for the portfolio weights'''\n        return tuple((self.minimum_weight, self.maximum_weight) for x in range(size))\n\n    def get_budget_constraint(self, weights):\n        '''Defines a budget constraint: the sum of the weights equals unity'''\n        return np.sum(weights) - 1\n\n    def get_target_constraint(self, weights, expected_returns):\n        '''Ensure that the portfolio return target a given return'''\n        return np.dot(np.matrix(expected_returns), np.matrix(weights).T).item() - self.target_return\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/PortfolioOptimizerPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Python wrapper for custom portfolio optimizer\n    /// </summary>\n    public class PortfolioOptimizerPythonWrapper : BasePythonWrapper<IPortfolioOptimizer>, IPortfolioOptimizer\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"portfolioOptimizer\">The python model to wrapp</param>\n        public PortfolioOptimizerPythonWrapper(PyObject portfolioOptimizer)\n            : base(portfolioOptimizer)\n        {\n        }\n\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Array of double with the portfolio annualized expected returns (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n        {\n            return InvokeMethod<double[]>(nameof(Optimize), historicalReturns, expectedReturns, covariance);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/ReturnsSymbolData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Contains returns specific to a symbol required for optimization model\n    /// </summary>\n    public class ReturnsSymbolData\n    {\n        private readonly Symbol _symbol;\n        private readonly RateOfChange _roc;\n        private readonly RollingWindow<IndicatorDataPoint> _window;\n\n        /// <summary>\n        /// The symbol's asset rate of change indicator\n        /// </summary>\n        public RateOfChange ROC { get {  return _roc; } }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReturnsSymbolData\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the data that updates the indicators</param>\n        /// <param name=\"lookback\">Look-back period for the RateOfChange indicator</param>\n        /// <param name=\"period\">Size of rolling window that contains historical RateOfChange</param>\n        public ReturnsSymbolData(Symbol symbol, int lookback, int period)\n        {\n            _symbol = symbol;\n            _roc = new RateOfChange($\"{_symbol}.ROC({lookback})\", lookback);\n            _window = new RollingWindow<IndicatorDataPoint>(period);\n            _roc.Updated += OnRateOfChangeUpdated;\n        }\n\n        /// <summary>\n        /// Historical returns\n        /// </summary>\n        public Dictionary<DateTime, double> Returns => _window.ToDictionary(x => x.EndTime, x => (double) x.Value);\n\n        /// <summary>\n        /// Adds an item to this window and shifts all other elements\n        /// </summary>\n        /// <param name=\"time\">The time associated with the value</param>\n        /// <param name=\"value\">The value to use to update this window</param>\n        public void Add(DateTime time, decimal value)\n        {\n            var item = new IndicatorDataPoint(_symbol, time, value);\n            AddToWindow(item);\n        }\n\n        /// <summary>\n        /// Updates the state of the RateOfChange with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"time\">The time associated with the value</param>\n        /// <param name=\"value\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        public bool Update(DateTime time, decimal value)\n        {\n            return _roc.Update(time, value);\n        }\n\n        /// <summary>\n        /// Resets all indicators of this object to its initial state\n        /// </summary>\n        public void Reset()\n        {\n            _roc.Updated -= OnRateOfChangeUpdated;\n            _roc.Reset();\n            _window.Reset();\n        }\n\n        /// <summary>\n        /// When the RateOfChange is updated, adds the new value to the RollingWindow\n        /// </summary>\n        /// <param name=\"roc\"></param>\n        /// <param name=\"updated\"></param>\n        private void OnRateOfChangeUpdated(object roc, IndicatorDataPoint updated)\n        {\n            if (_roc.IsReady)\n            {\n                AddToWindow(updated);\n            }\n        }\n\n        private void AddToWindow(IndicatorDataPoint updated)\n        {\n            if (_window.Samples > 0 && _window[0].EndTime == updated.EndTime)\n            {\n                // this could happen with fill forward bars in the history request\n                return;\n            }\n\n            _window.Add(updated);\n        }\n    }\n\n    /// <summary>\n    /// Extension methods for <see cref=\"ReturnsSymbolData\"/>\n    /// </summary>\n    public static class ReturnsSymbolDataExtensions\n    {\n        /// <summary>\n        /// Converts a dictionary of <see cref=\"ReturnsSymbolData\"/> keyed by <see cref=\"Symbol\"/> into a matrix\n        /// </summary>\n        /// <param name=\"symbolData\">Dictionary of <see cref=\"ReturnsSymbolData\"/> keyed by <see cref=\"Symbol\"/> to be converted into a matrix</param>\n        /// <param name=\"symbols\">List of <see cref=\"Symbol\"/> to be included in the matrix</param>\n        public static double[,] FormReturnsMatrix(this Dictionary<Symbol, ReturnsSymbolData> symbolData, IEnumerable<Symbol> symbols)\n        {\n            var returnsByDate = (from s in symbols join sd in symbolData on s equals sd.Key select sd.Value.Returns).ToList();\n\n            // Consolidate by date\n            var alldates = returnsByDate.SelectMany(r => r.Keys).Distinct().ToList();\n\n            var max = symbolData.Count == 0 ? 0 : symbolData.Max(kvp => kvp.Value.Returns.Count);\n\n            // Perfect match between the dates in the ReturnsSymbolData objects\n            if (max == alldates.Count)\n            {\n                return Accord.Math.Matrix.Create(alldates\n                    // if a return date isn't found for a symbol we use 'double.NaN'\n                    .Select(d => returnsByDate.Select(s => s.GetValueOrDefault(d, double.NaN)).ToArray())\n                    .Where(r => !r.Select(Math.Abs).Sum().IsNaNOrZero()) // remove empty rows\n                    .ToArray());\n            }\n\n            // If it is not a match, we assume that each index correspond to the same point in time\n            var returnsByIndex = returnsByDate.Select((doubles, i) => doubles.Values.ToArray());\n\n            return Accord.Math.Matrix.Create(Enumerable.Range(0, max)\n                // there is no guarantee that all symbols have the same amount of returns so we need to check range and use 'double.NaN' if required as above\n                .Select(d => returnsByIndex.Select(s => s.Length < (d + 1) ? double.NaN : s[d]).ToArray())\n                .Where(r => !r.Select(Math.Abs).Sum().IsNaNOrZero()) // remove empty rows\n                .ToArray());\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Math;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Risk Parity Portfolio Construction Model\n    /// </summary>\n    /// <remarks>Spinu, F. (2013). An algorithm for computing risk parity weights. Available at SSRN 2297383.\n    /// Available at https://papers.ssrn.com/sol3/Papers.cfm?abstract_id=2297383</remarks>\n    public class RiskParityPortfolioConstructionModel : PortfolioConstructionModel\n    {\n        private readonly int _lookback;\n        private readonly int _period;\n        private readonly Resolution _resolution;\n        private readonly IPortfolioOptimizer _optimizer;\n        private readonly Dictionary<Symbol, ReturnsSymbolData> _symbolDataDict;\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time in UTC</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public RiskParityPortfolioConstructionModel(IDateRule rebalancingDateRules,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingDateRules.ToFunc(), portfolioBias, lookback, period, resolution, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalanceResolution\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public RiskParityPortfolioConstructionModel(Resolution rebalanceResolution = Resolution.Daily,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalanceResolution.ToTimeSpan(), portfolioBias, lookback, period, resolution, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public RiskParityPortfolioConstructionModel(TimeSpan timeSpan,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : this(dt => dt.Add(timeSpan), portfolioBias, lookback, period, resolution, optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public RiskParityPortfolioConstructionModel(PyObject rebalance,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : this((Func<DateTime, DateTime?>)null, portfolioBias, lookback, period, resolution, optimizer)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public RiskParityPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,\n                portfolioBias,\n                lookback,\n                period,\n                resolution,\n                optimizer)\n        {\n        }\n\n        /// <summary>\n        /// Initialize the model\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance.</param>\n        /// <param name=\"portfolioBias\">Specifies the bias of the portfolio (Short, Long/Short, Long)</param>\n        /// <param name=\"lookback\">Historical return lookback period</param>\n        /// <param name=\"period\">The time interval of history price to calculate the weight</param>\n        /// <param name=\"resolution\">The resolution of the history price</param>\n        /// <param name=\"optimizer\">The portfolio optimization algorithm. If the algorithm is not provided then the default will be mean-variance optimization.</param>\n        public RiskParityPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc,\n            PortfolioBias portfolioBias = PortfolioBias.LongShort,\n            int lookback = 1,\n            int period = 252,\n            Resolution resolution = Resolution.Daily,\n            IPortfolioOptimizer optimizer = null)\n            : base(rebalancingFunc)\n        {\n            if (portfolioBias == PortfolioBias.Short)\n            {\n                throw new ArgumentException(\"Long position must be allowed in RiskParityPortfolioConstructionModel.\");\n            }\n\n            _lookback = lookback;\n            _period = period;\n            _resolution = resolution;\n\n            _optimizer = optimizer ?? new RiskParityPortfolioOptimizer();\n\n            _symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var targets = new Dictionary<Insight, double>();\n\n            // If we have no insights just return an empty target list\n            if (activeInsights.IsNullOrEmpty())\n            {\n                return targets;\n            }\n\n            var symbols = activeInsights.Select(x => x.Symbol).ToList();\n\n            // Get symbols' returns\n            var returns = _symbolDataDict.FormReturnsMatrix(symbols);\n\n            // The optimization method processes the data frame\n            var w = _optimizer.Optimize(returns);\n\n            // process results\n            if (w.Length > 0)\n            {\n                var sidx = 0;\n                foreach (var symbol in symbols)\n                {\n                    var weight = w[sidx];\n                    targets[activeInsights.First(insight => insight.Symbol == symbol)] = weight;\n\n                    sidx++;\n                }\n            }\n\n            return targets;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            base.OnSecuritiesChanged(algorithm, changes);\n            // clean up data for removed securities\n            foreach (var removed in changes.RemovedSecurities)\n            {\n                _symbolDataDict.Remove(removed.Symbol, out var removedSymbolData);\n                algorithm.UnregisterIndicator(removedSymbolData.ROC);\n            }\n\n            if (changes.AddedSecurities.Count == 0)\n            {\n                return;\n            }\n\n            // initialize data for added securities\n            foreach (var added in changes.AddedSecurities)\n            {\n                if (!_symbolDataDict.ContainsKey(added.Symbol))\n                {\n                    var symbolData = new ReturnsSymbolData(added.Symbol, _lookback, _period);\n                    _symbolDataDict[added.Symbol] = symbolData;\n                    algorithm.RegisterIndicator(added.Symbol, symbolData.ROC, _resolution);\n                }\n            }\n\n            // warmup our indicators by pushing history through the consolidators\n            algorithm.History(changes.AddedSecurities.Select(security => security.Symbol), _lookback * _period, _resolution)\n                .PushThrough(bar =>\n                {\n                    ReturnsSymbolData symbolData;\n                    if (_symbolDataDict.TryGetValue(bar.Symbol, out symbolData))\n                    {\n                        symbolData.Update(bar.EndTime, bar.Value);\n                    }\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.RiskParityPortfolioOptimizer import RiskParityPortfolioOptimizer\n\n### <summary>\n### Risk Parity Portfolio Construction Model\n### </summary>\n### <remarks>Spinu, F. (2013). An algorithm for computing risk parity weights. Available at SSRN 2297383.\n### Available at https://papers.ssrn.com/sol3/Papers.cfm?abstract_id=2297383</remarks>\nclass RiskParityPortfolioConstructionModel(PortfolioConstructionModel):\n    def __init__(self,\n                 rebalance = Resolution.DAILY,\n                 portfolio_bias = PortfolioBias.LONG_SHORT,\n                 lookback = 1,\n                 period = 252,\n                 resolution = Resolution.DAILY,\n                 optimizer = None):\n        \"\"\"Initialize the model\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.\n            portfolio_bias: Specifies the bias of the portfolio (Short, Long/Short, Long)\n            lookback(int): Historical return lookback period\n            period(int): The time interval of history price to calculate the weight\n            resolution: The resolution of the history price\n            optimizer(class): Method used to compute the portfolio weights\"\"\"\n        super().__init__()\n        if portfolio_bias == PortfolioBias.SHORT:\n            raise ArgumentException(\"Long position must be allowed in RiskParityPortfolioConstructionModel.\")\n\n        self.lookback = lookback\n        self.period = period\n        self.resolution = resolution\n        self.sign = lambda x: -1 if x < 0 else (1 if x > 0 else 0)\n\n        self.optimizer = RiskParityPortfolioOptimizer() if optimizer is None else optimizer\n\n        self._symbol_data_by_symbol = {}\n\n        # If the argument is an instance of Resolution or Timedelta\n        # Redefine rebalancing_func\n        rebalancing_func = rebalance\n        if isinstance(rebalance, int):\n            rebalance = Extensions.to_time_span(rebalance)\n        if isinstance(rebalance, timedelta):\n            rebalancing_func = lambda dt: dt + rebalance\n        if rebalancing_func:\n            self.set_rebalancing_func(rebalancing_func)\n\n    def determine_target_percent(self, active_insights):\n        \"\"\"Will determine the target percent for each insight\n        Args:\n            active_insights: list of active insights\n        Returns:\n            dictionary of insight and respective target weight\n        \"\"\"\n        targets = {}\n\n        # If we have no insights just return an empty target list\n        if len(active_insights) == 0:\n            return targets\n\n        symbols = [insight.symbol for insight in active_insights]\n\n        # Create a dictionary keyed by the symbols in the insights with an pandas.series as value to create a data frame\n        returns = { str(symbol) : data.return_ for symbol, data in self._symbol_data_by_symbol.items() if symbol in symbols }\n        returns = pd.DataFrame(returns)\n\n        # The portfolio optimizer finds the optional weights for the given data\n        weights = self.optimizer.optimize(returns)\n        weights = pd.Series(weights, index = returns.columns)\n\n        # Create portfolio targets from the specified insights\n        for insight in active_insights:\n            targets[insight] = weights[str(insight.symbol)]\n\n        return targets\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n\n        # clean up data for removed securities\n        super().on_securities_changed(algorithm, changes)\n        for removed in changes.removed_securities:\n            symbol_data = self._symbol_data_by_symbol.pop(removed.symbol, None)\n            symbol_data.reset()\n            algorithm.unregister_indicator(symbol_data.roc)\n\n        # initialize data for added securities\n        symbols = [ x.symbol for x in changes.added_securities ]\n        history = algorithm.history(symbols, self.lookback * self.period, self.resolution)\n        if history.empty: return\n\n        tickers = history.index.levels[0]\n        for ticker in tickers:\n            symbol = SymbolCache.get_symbol(ticker)\n\n            if symbol not in self._symbol_data_by_symbol:\n                symbol_data = self.RiskParitySymbolData(symbol, self.lookback, self.period)\n                symbol_data.warm_up_indicators(history.loc[ticker])\n                self._symbol_data_by_symbol[symbol] = symbol_data\n                algorithm.register_indicator(symbol, symbol_data.roc, self.resolution)\n\n    class RiskParitySymbolData:\n        '''Contains data specific to a symbol required by this model'''\n        def __init__(self, symbol, lookback, period):\n            self._symbol = symbol\n            self.roc = RateOfChange(f'{symbol}.roc({lookback})', lookback)\n            self.roc.updated += self.on_rate_of_change_updated\n            self.window = RollingWindow(period)\n\n        def reset(self):\n            self.roc.updated -= self.on_rate_of_change_updated\n            self.roc.reset()\n            self.window.reset()\n\n        def warm_up_indicators(self, history):\n            for tuple in history.itertuples():\n                self.roc.update(tuple.Index, tuple.close)\n\n        def on_rate_of_change_updated(self, roc, value):\n            if roc.is_ready:\n                self.window.add(value)\n\n        def add(self, time, value):\n            item = IndicatorDataPoint(self._symbol, time, value)\n            self.window.add(item)\n\n        @property\n        def return_(self):\n            return pd.Series(\n                data = [x.value for x in self.window],\n                index = [x.end_time for x in self.window])\n\n        @property\n        def is_ready(self):\n            return self.window.is_ready\n\n        def __str__(self, **kwargs):\n            return '{}: {:.2%}'.format(self.roc.name, self.window[0])\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/RiskParityPortfolioOptimizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Accord.Math;\nusing Accord.Statistics;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of a risk parity portfolio optimizer that calculate the optimal weights\n    /// with the weight range from 0 to 1 and equalize the risk carried by each asset\n    /// </summary>\n    public class RiskParityPortfolioOptimizer : IPortfolioOptimizer\n    {\n        private double _lower = 1e-05;\n        private double _upper = Double.MaxValue;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"RiskParityPortfolioOptimizer\"/>\n        /// </summary>\n        /// <param name=\"lower\">The lower bounds on portfolio weights</param>\n        /// <param name=\"upper\">The upper bounds on portfolio weights</param>\n        public RiskParityPortfolioOptimizer(double? lower = null, double? upper = null)\n        {\n            _lower = lower ?? _lower;     // has to be greater than or equal to 0\n            _upper = upper ?? _upper;\n        }\n\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Risk budget vector (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n        {\n            covariance = covariance ?? historicalReturns.Covariance();\n            var size = covariance.GetLength(0);\n\n            // Optimization Problem\n            // minimize_{x >= 0} f(x) = 1/2 * x^T.S.x - b^T.log(x)\n            // b = 1 / num_of_assets (equal budget of risk)\n            // df(x)/dx = S.x - b / x\n            // H(x) = S + Diag(b / x^2)\n            expectedReturns = expectedReturns ?? Vector.Create(size, 1d / size);\n            var solution = RiskParityNewtonMethodOptimization(size, covariance, expectedReturns);\n            \n            // Normalize weights: w = x / x^T.1\n            solution = Elementwise.Divide(solution, solution.Sum());\n            // Make sure the vector is within range\n            return solution.Select(x => Math.Clamp(x, _lower, _upper)).ToArray();\n                \n        }\n\n        /// <summary>\n        /// Newton method of minimization\n        /// </summary>\n        /// <param name=\"numberOfVariables\">The number of variables (size of weight vector).</param>\n        /// <param name=\"covariance\">Covariance matrix (size: K x K).</param>\n        /// <param name=\"budget\">The risk budget (size: K x 1).</param>\n        /// <param name=\"tolerance\">Tolerance level of objective difference with previous steps to accept minimization result.</param>\n        /// <param name=\"maximumIteration\">Maximum iteration per optimization.</param>\n        /// <returns>Array of double of argumented minimization</returns>\n        protected double[] RiskParityNewtonMethodOptimization(int numberOfVariables, double[,] covariance, double[] budget, double tolerance = 1e-11, int maximumIteration = 15000)\n        {\n            if (numberOfVariables < 1 || numberOfVariables > 1000)\n            {\n                throw new ArgumentException(\"Argument \\\"numberOfVariables\\\" must be a positive integer between 1 and 1000\");\n            }\n            else if (numberOfVariables == 1) \n            {\n                return new double[]{1d};\n            }\n            \n            Func<double[], double> objective = (x) => 0.5 * Matrix.Dot(Matrix.Dot(x, covariance), x) - Matrix.Dot(budget, Elementwise.Log(x));\n            Func<double[], double[]> gradient = (x) => Elementwise.Subtract(Matrix.Dot(covariance, x), Elementwise.Divide(budget, x));\n            Func<double[], double[,]> hessian = (x) => Elementwise.Add(covariance, Matrix.Diagonal(Elementwise.Divide(budget, Elementwise.Multiply(x, x))));\n            var weight = Vector.Create(numberOfVariables, 1d / numberOfVariables);\n            var newObjective = Double.MinValue;\n            var oldObjective = Double.MaxValue;\n            var iter = 0;\n\n            while (Math.Abs(newObjective - oldObjective) > tolerance && iter < maximumIteration)\n            {\n                // Store old objective value\n                oldObjective = newObjective;\n\n                // Get parameters for Newton method gradient descend\n                var invHess = Matrix.Inverse(hessian(weight));\n                var jacobian = gradient(weight);\n\n                // Get next weight vector\n                // x^{k + 1} = x^{k} - H^{-1}(x^{k}).df(x^{k}))\n                weight = Elementwise.Subtract(weight, Matrix.Dot(invHess, jacobian));\n\n                // Store new objective value\n                newObjective = objective(weight);\n\n                iter++;\n            }\n\n            return weight;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/RiskParityPortfolioOptimizer.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom scipy.optimize import *\n\n### <summary>\n### Provides an implementation of a risk parity portfolio optimizer that calculate the optimal weights \n### with the weight range from 0 to 1 and equalize the risk carried by each asset\n### </summary>\nclass RiskParityPortfolioOptimizer:\n    \n    def __init__(self, \n                 minimum_weight = 1e-05, \n                 maximum_weight = sys.float_info.max):\n        '''Initialize the RiskParityPortfolioOptimizer\n        Args:\n            minimum_weight(float): The lower bounds on portfolio weights\n            maximum_weight(float): The upper bounds on portfolio weights'''\n        self.minimum_weight = minimum_weight if minimum_weight >= 1e-05 else 1e-05\n        self.maximum_weight = maximum_weight if maximum_weight >= minimum_weight else minimum_weight\n\n    def optimize(self, historical_returns, budget = None, covariance = None):\n        '''\n        Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        args:\n            historical_returns: Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).\n            budget: Risk budget vector (size: K x 1).\n            covariance: Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).\n        Returns:\n            Array of double with the portfolio weights (size: K x 1)\n        '''\n        if covariance is None:\n            covariance = np.cov(historical_returns.T)\n\n        size = historical_returns.columns.size   # K x 1\n        \n        # Optimization Problem\n        # minimize_{x >= 0} f(x) = 1/2 * x^T.S.x - b^T.log(x)\n        # b = 1 / num_of_assets (equal budget of risk)\n        # df(x)/dx = S.x - b / x\n        # H(x) = S + Diag(b / x^2)\n        # lw <= x <= up\n        x0 = np.array(size * [1. / size])\n        budget = budget if budget is not None else x0\n        objective = lambda weights: 0.5 * weights.T @ covariance @ weights - budget.T @ np.log(weights)\n        gradient = lambda weights: covariance @ weights - budget / weights\n        hessian = lambda weights: covariance + np.diag((budget / weights**2).flatten())\n        solver = minimize(objective, jac=gradient, hess=hessian, x0=x0, method=\"Newton-CG\")\n\n        if not solver[\"success\"]: return x0\n        # Normalize weights: w = x / x^T.1\n        return np.clip(solver[\"x\"]/np.sum(solver[\"x\"]), self.minimum_weight, self.maximum_weight)\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/SectorWeightingPortfolioConstructionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioConstructionModel\"/> that generates percent targets based on the\n    /// <see cref=\"CompanyReference.IndustryTemplateCode\"/>. \n    /// The target percent holdings of each sector is 1/S where S is the number of sectors and\n    /// the target percent holdings of each security is 1/N where N is the number of securities of each sector.\n    /// For insights of direction <see cref=\"InsightDirection.Up\"/>, long targets are returned and for insights of direction\n    /// <see cref=\"InsightDirection.Down\"/>, short targets are returned.\n    /// It will ignore <see cref=\"Insight\"/> for symbols that have no <see cref=\"CompanyReference.IndustryTemplateCode\"/> value.\n    /// </summary>\n    public class SectorWeightingPortfolioConstructionModel : EqualWeightingPortfolioConstructionModel\n    {\n        private readonly Dictionary<Symbol, string> _sectorCodeBySymbol = new Dictionary<Symbol, string>();\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingDateRules\">The date rules used to define the next expected rebalance time\n        /// in UTC</param>\n        public SectorWeightingPortfolioConstructionModel(IDateRule rebalancingDateRules)\n            : base(rebalancingDateRules.ToFunc())\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        public SectorWeightingPortfolioConstructionModel(Func<DateTime, DateTime?> rebalancingFunc)\n            : base(rebalancingFunc)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalancingFunc\">For a given algorithm UTC DateTime returns the next expected rebalance UTC time.\n        /// Returning current time will trigger rebalance. If null will be ignored</param>\n        public SectorWeightingPortfolioConstructionModel(Func<DateTime, DateTime> rebalancingFunc)\n            : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"rebalance\">Rebalancing func or if a date rule, timedelta will be converted into func.\n        /// For a given algorithm UTC DateTime the func returns the next expected rebalance time\n        /// or null if unknown, in which case the function will be called again in the next loop. Returning current time\n        /// will trigger rebalance. If null will be ignored</param>\n        /// <remarks>This is required since python net can not convert python methods into func nor resolve the correct\n        /// constructor for the date rules parameter.\n        /// For performance we prefer python algorithms using the C# implementation</remarks>\n        public SectorWeightingPortfolioConstructionModel(PyObject rebalance)\n            : this((Func<DateTime, DateTime?>)null)\n        {\n            SetRebalancingFunc(rebalance);\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"timeSpan\">Rebalancing frequency</param>\n        public SectorWeightingPortfolioConstructionModel(TimeSpan timeSpan)\n            : this(dt => dt.Add(timeSpan))\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SectorWeightingPortfolioConstructionModel\"/>\n        /// </summary>\n        /// <param name=\"resolution\">Rebalancing frequency</param>\n        public SectorWeightingPortfolioConstructionModel(Resolution resolution = Resolution.Daily)\n            : this(resolution.ToTimeSpan())\n        {\n        }\n\n        /// <summary>\n        /// Method that will determine if the portfolio construction model should create a\n        /// target for this insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to create a target for</param>\n        /// <returns>True if the portfolio should create a target for the insight</returns>\n        protected override bool ShouldCreateTargetForInsight(Insight insight)\n        {\n            return _sectorCodeBySymbol.ContainsKey(insight.Symbol);\n        }\n\n        /// <summary>\n        /// Will determine the target percent for each insight\n        /// </summary>\n        /// <param name=\"activeInsights\">The active insights to generate a target for</param>\n        /// <returns>A target percent for each insight</returns>\n        protected override Dictionary<Insight, double> DetermineTargetPercent(List<Insight> activeInsights)\n        {\n            var result = new Dictionary<Insight, double>();\n\n            var insightBySectorCode = new Dictionary<string, List<Insight>>();\n\n            foreach (var insight in activeInsights)\n            {\n                if (insight.Direction == InsightDirection.Flat)\n                {\n                    result[insight] = 0;\n                    continue;\n                }\n\n                List<Insight> insights;\n                var sectorCode = _sectorCodeBySymbol[insight.Symbol];\n                if (insightBySectorCode.TryGetValue(sectorCode, out insights))\n                {\n                    insights.Add(insight);\n                }\n                else\n                {\n                    insightBySectorCode[sectorCode] = new List<Insight> { insight };\n                }\n            }\n\n            // give equal weighting to each sector\n            var sectorPercent = insightBySectorCode.Count == 0 ? 0 : 1m / insightBySectorCode.Count;\n\n            foreach (var kvp in insightBySectorCode)\n            {\n                var insights = kvp.Value;\n\n                // give equal weighting to each security\n                var count = insights.Count;\n                var percent = count == 0 ? 0 : sectorPercent / count;\n\n                foreach (var insight in insights)\n                {\n                    result[insight] = (double)((int)insight.Direction * percent);\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            foreach (var security in changes.RemovedSecurities)\n            {\n                // Removes the symbol from the _sectorCodeBySymbol dictionary\n                // since we cannot emit PortfolioTarget for removed securities\n                var symbol = security.Symbol;\n                if (_sectorCodeBySymbol.ContainsKey(symbol))\n                {\n                    _sectorCodeBySymbol.Remove(symbol);\n                }\n            }\n\n            foreach (var security in changes.AddedSecurities)\n            {\n                var sectorCode = GetSectorCode(security);\n                if (!string.IsNullOrEmpty(sectorCode))\n                {\n                    _sectorCodeBySymbol[security.Symbol] = sectorCode;\n                }\n            }\n            base.OnSecuritiesChanged(algorithm, changes);\n        }\n\n        /// <summary>\n        /// Gets the sector code\n        /// </summary>\n        /// <param name=\"security\">The security to create a sector code for</param>\n        /// <returns>The value of the sector code for the security</returns>\n        /// <remarks>Other sectors can be defined using <see cref=\"AssetClassification\"/></remarks>\n        protected virtual string GetSectorCode(Security security)\n        {\n            return security.Fundamentals?.CompanyReference.IndustryTemplateCode;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/SectorWeightingPortfolioConstructionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\n\nclass SectorWeightingPortfolioConstructionModel(EqualWeightingPortfolioConstructionModel):\n    '''Provides an implementation of IPortfolioConstructionModel that\n   generates percent targets based on the CompanyReference.industry_template_code.\n   The target percent holdings of each sector is 1/S where S is the number of sectors and\n   the target percent holdings of each security is 1/N where N is the number of securities of each sector.\n   For insights of direction InsightDirection.UP, long targets are returned and for insights of direction\n   InsightDirection.DOWN, short targets are returned.\n   It will ignore Insight for symbols that have no CompanyReference.industry_template_code'''\n\n    def __init__(self, rebalance = Resolution.DAILY):\n        '''Initialize a new instance of InsightWeightingPortfolioConstructionModel\n        Args:\n            rebalance: Rebalancing parameter. If it is a timedelta, date rules or Resolution, it will be converted into a function.\n                              If None will be ignored.\n                              The function returns the next expected rebalance time for a given algorithm UTC DateTime.\n                              The function returns null if unknown, in which case the function will be called again in the\n                              next loop. Returning current time will trigger rebalance.'''\n        super().__init__(rebalance)\n        self.sector_code_by_symbol = dict()\n\n    def should_create_target_for_insight(self, insight):\n        '''Method that will determine if the portfolio construction model should create a\n        target for this insight\n        Args:\n            insight: The insight to create a target for'''\n        return insight.symbol in self.sector_code_by_symbol\n\n    def determine_target_percent(self, active_insights):\n        '''Will determine the target percent for each insight\n        Args:\n            active_insights: The active insights to generate a target for'''\n        result = dict()\n\n        insight_by_sector_code = dict()\n\n        for insight in active_insights:\n            if insight.direction == InsightDirection.FLAT:\n                result[insight] = 0\n                continue\n\n            sector_code = self.sector_code_by_symbol.get(insight.symbol)\n            insights = insight_by_sector_code.pop(sector_code, list())\n\n            insights.append(insight)\n            insight_by_sector_code[sector_code] = insights\n\n        # give equal weighting to each sector\n        sector_percent = 0 if len(insight_by_sector_code) == 0 else 1.0 / len(insight_by_sector_code)\n\n        for _, insights in insight_by_sector_code.items():\n            # give equal weighting to each security\n            count = len(insights)\n            percent = 0 if count == 0 else sector_percent / count\n            for insight in insights:\n                result[insight] = insight.direction * percent\n\n        return result\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for security in changes.removed_securities:\n            # Removes the symbol from the self.sector_code_by_symbol dictionary\n            # since we cannot emit PortfolioTarget for removed securities\n            self.sector_code_by_symbol.pop(security.symbol, None)\n\n        for security in changes.added_securities:\n            sector_code = self.get_sector_code(security)\n            if sector_code:\n                self.sector_code_by_symbol[security.symbol] = sector_code\n\n        super().on_securities_changed(algorithm, changes)\n\n    def get_sector_code(self, security):\n        '''Gets the sector code\n        Args:\n            security: The security to create a sector code for\n        Returns:\n            The value of the sector code for the security\n        Remarks:\n            Other sectors can be defined using AssetClassification'''\n        fundamentals = security.fundamentals\n        company_reference = security.fundamentals.company_reference if fundamentals else None\n        return company_reference.industry_template_code if company_reference else None\n"
  },
  {
    "path": "Algorithm.Framework/Portfolio/UnconstrainedMeanVariancePortfolioOptimizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.Math;\nusing Accord.Statistics;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of a portfolio optimizer with unconstrained mean variance.\n    /// </summary>\n    public class UnconstrainedMeanVariancePortfolioOptimizer : IPortfolioOptimizer\n    {\n        /// <summary>\n        /// Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        /// </summary>\n        /// <param name=\"historicalReturns\">Matrix of historical returns where each column represents a security and each row returns for the given date/time (size: K x N).</param>\n        /// <param name=\"expectedReturns\">Array of double with the portfolio annualized expected returns (size: K x 1).</param>\n        /// <param name=\"covariance\">Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        /// <returns>Array of double with the portfolio weights (size: K x 1)</returns>\n        public double[] Optimize(double[,] historicalReturns, double[] expectedReturns = null, double[,] covariance = null)\n        {\n            var Π = (expectedReturns ?? historicalReturns.Mean(0));\n            var Σ = covariance ?? historicalReturns.Covariance();\n            return Π.Dot(Σ.Inverse());\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Portfolio/UnconstrainedMeanVariancePortfolioOptimizer.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom numpy import dot\nfrom numpy.linalg import inv\n\n### <summary>\n### Provides an implementation of a portfolio optimizer with unconstrained mean variance.'''\n### </summary>\nclass UnconstrainedMeanVariancePortfolioOptimizer:\n    '''Provides an implementation of a portfolio optimizer with unconstrained mean variance.'''\n    def optimize(self, historical_returns, expected_returns = None, covariance = None):\n        '''\n        Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns\n        args:\n            historical_returns: Matrix of historical returns where each column represents a security and each row returns for the given date/time (size: K x N).\n            expected_returns: Array of double with the portfolio annualized expected returns (size: K x 1).\n            covariance: Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).</param>\n        Returns:\n            Array of double with the portfolio weights (size: K x 1)\n        '''\n        if expected_returns is None:\n            expected_returns = historical_returns.mean()\n        if covariance is None:\n            covariance = historical_returns.cov()\n\n        return expected_returns.dot(inv(covariance))\n"
  },
  {
    "path": "Algorithm.Framework/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Algorithm.Framework\")]\n[assembly: AssemblyProduct(\"QuantConnect.Algorithm.Framework\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"75981418-7246-4b91-b136-482728e02901\")]"
  },
  {
    "path": "Algorithm.Framework/QuantConnect.Algorithm.Framework.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Algorithm.Framework</RootNamespace>\n    <AssemblyName>QuantConnect.Algorithm.Framework</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Algorithm.Framework.xml</DocumentationFile>\n    <PackageTags>Library</PackageTags>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Algorithm.Framework Project - The core QCAlgorithm framework implementation</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"Accord\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Math\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Statistics\" Version=\"3.6.0\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Portfolio\\BlackLittermanOptimizationPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\ConfidenceWeightedPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\AccumulativeInsightPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\RiskParityPortfolioOptimizer.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\SectorWeightingPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\InsightWeightingPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\UnconstrainedMeanVariancePortfolioOptimizer.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\MaximumSharpeRatioPortfolioOptimizer.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\MeanReversionPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\MeanVarianceOptimizationPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\MinimumVariancePortfolioOptimizer.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\RiskParityPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\PearsonCorrelationPairsTradingAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\HistoricalReturnsAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\BasePairsTradingAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Execution\\VolumeWeightedAveragePriceExecutionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Execution\\StandardDeviationExecutionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Execution\\SpreadExecutionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Portfolio\\EqualWeightingPortfolioConstructionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\TrailingStopRiskManagementModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\MaximumDrawdownPercentPortfolio.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\MaximumUnrealizedProfitPercentPerSecurity.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\MaximumDrawdownPercentPerSecurity.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Risk\\MaximumSectorExposureRiskManagementModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\ETFConstituentsUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\EmaCrossUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\FutureUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\OptionUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\QC500UniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Selection\\FundamentalUniverseSelectionModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\ConstantAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\RsiAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\EmaCrossAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Alphas\\MacdAlphaModel.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that limits the drawdown\n    /// per holding to the specified percentage\n    /// </summary>\n    public class MaximumDrawdownPercentPerSecurity : RiskManagementModel\n    {\n        private readonly decimal _maximumDrawdownPercent;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaximumDrawdownPercentPerSecurity\"/> class\n        /// </summary>\n        /// <param name=\"maximumDrawdownPercent\">The maximum percentage drawdown allowed for any single security holding,\n        /// defaults to 5% drawdown per security</param>\n        public MaximumDrawdownPercentPerSecurity(\n            decimal maximumDrawdownPercent = 0.05m\n            )\n        {\n            _maximumDrawdownPercent = -Math.Abs(maximumDrawdownPercent);\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            foreach (var kvp in algorithm.Securities)\n            {\n                var security = kvp.Value;\n\n                if (!security.Invested)\n                {\n                    continue;\n                }\n\n                var pnl = security.Holdings.UnrealizedProfitPercent;\n                if (pnl < _maximumDrawdownPercent)\n                {\n                    var symbol = security.Symbol;\n\n                    // Cancel insights\n                    algorithm.Insights.Cancel(new[] { symbol });\n                    \n                    // liquidate\n                    yield return new PortfolioTarget(symbol, 0);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MaximumDrawdownPercentPerSecurity(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that limits the drawdown per holding to the specified percentage'''\n\n    def __init__(self, maximum_drawdown_percent = 0.05):\n        '''Initializes a new instance of the MaximumDrawdownPercentPerSecurity class\n        Args:\n            maximum_drawdown_percent: The maximum percentage drawdown allowed for any single security holding'''\n        self.maximum_drawdown_percent = -abs(maximum_drawdown_percent)\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance\n            targets: The current portfolio targets to be assessed for risk'''\n        targets = []\n        for kvp in algorithm.securities:\n            security = kvp.value\n\n            if not security.invested:\n                continue\n\n            pnl = security.holdings.unrealized_profit_percent\n            if pnl < self.maximum_drawdown_percent:\n                symbol = security.symbol\n\n                # Cancel insights\n                algorithm.insights.cancel([symbol])\n\n                # liquidate\n                targets.append(PortfolioTarget(symbol, 0))\n\n        return targets\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumDrawdownPercentPortfolio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that limits the drawdown of the portfolio\n    /// to the specified percentage. Once this is triggered the algorithm will need to be manually restarted.\n    /// </summary>\n    public class MaximumDrawdownPercentPortfolio : RiskManagementModel\n    {\n        private readonly decimal _maximumDrawdownPercent;\n        private decimal _portfolioHigh;\n        private bool _initialised = false;\n        private bool _isTrailing;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaximumDrawdownPercentPortfolio\"/> class\n        /// </summary>\n        /// <param name=\"maximumDrawdownPercent\">The maximum percentage drawdown allowed for algorithm portfolio\n        /// compared with starting value, defaults to 5% drawdown</param>\n        /// <param name=\"isTrailing\">If \"false\", the drawdown will be relative to the starting value of the portfolio.\n        /// If \"true\", the drawdown will be relative the last maximum portfolio value</param>\n        public MaximumDrawdownPercentPortfolio(decimal maximumDrawdownPercent = 0.05m, bool isTrailing = false)\n        {\n            _maximumDrawdownPercent = -Math.Abs(maximumDrawdownPercent);\n            _isTrailing = isTrailing;\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            var currentValue = algorithm.Portfolio.TotalPortfolioValue;\n\n            if (!_initialised)\n            {\n                _portfolioHigh = currentValue; // Set initial portfolio value\n                _initialised = true;\n            }\n\n            // Update trailing high value if in trailing mode\n            if (_isTrailing && (_portfolioHigh < currentValue))\n            {\n                _portfolioHigh = currentValue;\n                yield break; // return if new high reached\n            }\n\n            var pnl = GetTotalDrawdownPercent(currentValue);\n            if (pnl < _maximumDrawdownPercent && targets.Length != 0)\n            {\n                // reset the trailing high value for restart investing on next rebalcing period\n                _initialised = false;\n                foreach (var target in targets)\n                {\n                    var symbol = target.Symbol;\n                    \n                    // Cancel insights\n                    algorithm.Insights.Cancel(new[] { symbol });\n\n                    // liquidate\n                    yield return new PortfolioTarget(symbol, 0);\n                }\n            }\n        }\n\n        private decimal GetTotalDrawdownPercent(decimal currentValue)\n        {\n            return (currentValue / _portfolioHigh) - 1.0m;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumDrawdownPercentPortfolio.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MaximumDrawdownPercentPortfolio(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that limits the drawdown of the portfolio to the specified percentage.'''\n\n    def __init__(self, maximum_drawdown_percent = 0.05, is_trailing = False):\n        '''Initializes a new instance of the MaximumDrawdownPercentPortfolio class\n        Args:\n            maximum_drawdown_percent: The maximum percentage drawdown allowed for algorithm portfolio compared with starting value, defaults to 5% drawdown</param>\n            is_trailing: If \"false\", the drawdown will be relative to the starting value of the portfolio.\n                        If \"true\", the drawdown will be relative the last maximum portfolio value'''\n        self.maximum_drawdown_percent = -abs(maximum_drawdown_percent)\n        self.is_trailing = is_trailing\n        self.initialised = False\n        self.portfolio_high = 0\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance\n            targets: The current portfolio targets to be assessed for risk'''\n        current_value = algorithm.portfolio.total_portfolio_value\n\n        if not self.initialised:\n            self.portfolio_high = current_value   # Set initial portfolio value\n            self.initialised = True\n\n        # Update trailing high value if in trailing mode\n        if self.is_trailing and self.portfolio_high < current_value:\n            self.portfolio_high = current_value\n            return []   # return if new high reached\n\n        pnl = self.get_total_drawdown_percent(current_value)\n        if pnl < self.maximum_drawdown_percent and len(targets) != 0:\n            self.initialised = False # reset the trailing high value for restart investing on next rebalcing period\n\n            risk_adjusted_targets = []\n            for target in targets:\n                symbol = target.symbol\n\n                # Cancel insights\n                algorithm.insights.cancel([symbol])\n\n                # liquidate\n                risk_adjusted_targets.append(PortfolioTarget(symbol, 0))\n            return risk_adjusted_targets\n\n        return []\n\n    def get_total_drawdown_percent(self, current_value):\n        return (float(current_value) / float(self.portfolio_high)) - 1.0\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumSectorExposureRiskManagementModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that limits\n    /// the sector exposure to the specified percentage\n    /// </summary>\n    public class MaximumSectorExposureRiskManagementModel : RiskManagementModel\n    {\n        private readonly decimal _maximumSectorExposure;\n        private readonly PortfolioTargetCollection _targetsCollection;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaximumSectorExposureRiskManagementModel\"/> class\n        /// </summary>\n        /// <param name=\"maximumSectorExposure\">The maximum exposure for any sector, defaults to 20% sector exposure.</param>\n        public MaximumSectorExposureRiskManagementModel(\n            decimal maximumSectorExposure = 0.20m\n            )\n        {\n            if (maximumSectorExposure <= 0)\n            {\n                throw new ArgumentOutOfRangeException(\"MaximumSectorExposureRiskManagementModel: the maximum sector exposure cannot be a non-positive value.\");\n            }\n\n            _maximumSectorExposure = maximumSectorExposure;\n            _targetsCollection = new PortfolioTargetCollection();\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            var maximumSectorExposureValue = algorithm.Portfolio.TotalPortfolioValue * _maximumSectorExposure;\n\n            _targetsCollection.AddRange(targets);\n\n            // Group the securities by their sector\n            var groupBySector = algorithm.UniverseManager.ActiveSecurities\n                .Where(x => x.Value.Fundamentals != null && x.Value.Fundamentals.HasFundamentalData)\n                .GroupBy(x => x.Value.Fundamentals.CompanyReference.IndustryTemplateCode);\n\n            foreach (var securities in groupBySector)\n            {\n                // Compute the sector absolute holdings value\n                // If the construction model has created a target, we consider that\n                // value to calculate the security absolute holding value\n                var sectorAbsoluteHoldingsValue = 0m;\n\n                foreach (var security in securities)\n                {\n                    var absoluteHoldingsValue = security.Value.Holdings.AbsoluteHoldingsValue;\n\n                    IPortfolioTarget target;\n                    if (_targetsCollection.TryGetValue(security.Value.Symbol, out target))\n                    {\n                        absoluteHoldingsValue = security.Value.Price * Math.Abs(target.Quantity) *\n                            security.Value.SymbolProperties.ContractMultiplier *\n                            security.Value.QuoteCurrency.ConversionRate;\n                    }\n\n                    sectorAbsoluteHoldingsValue += absoluteHoldingsValue;\n                }\n\n                // If the ratio between the sector absolute holdings value and the maximum sector exposure value\n                // exceeds the unity, it means we need to reduce each security of that sector by that ratio\n                // Otherwise, it means that the sector exposure is below the maximum and there is nothing to do.\n                var ratio = sectorAbsoluteHoldingsValue / maximumSectorExposureValue;\n                if (ratio > 1)\n                {\n                    foreach (var security in securities)\n                    {\n                        var quantity = security.Value.Holdings.Quantity;\n                        var symbol = security.Value.Symbol;\n\n                        IPortfolioTarget target;\n                        if (_targetsCollection.TryGetValue(symbol, out target))\n                        {\n                            quantity = target.Quantity;\n                        }\n\n                        if (quantity != 0)\n                        {\n                            yield return new PortfolioTarget(symbol, quantity / ratio);\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance that experienced the change in securities</param>\n        /// <param name=\"changes\">The security additions and removals from the algorithm</param>\n        public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n        {\n            var anyFundamentalData = algorithm.ActiveSecurities\n                .Any(kvp => kvp.Value.Fundamentals != null && kvp.Value.Fundamentals.HasFundamentalData);\n\n            if (!anyFundamentalData)\n            {\n                throw new Exception(\"MaximumSectorExposureRiskManagementModel.OnSecuritiesChanged: Please select a portfolio selection model that selects securities with fundamental data.\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumSectorExposureRiskManagementModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom itertools import groupby\n\nclass MaximumSectorExposureRiskManagementModel(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that that limits the sector exposure to the specified percentage'''\n\n    def __init__(self, maximum_sector_exposure = 0.20):\n        '''Initializes a new instance of the MaximumSectorExposureRiskManagementModel class\n        Args:\n            maximum_drawdown_percent: The maximum exposure for any sector, defaults to 20% sector exposure.'''\n        if maximum_sector_exposure <= 0:\n            raise ValueError('MaximumSectorExposureRiskManagementModel: the maximum sector exposure cannot be a non-positive value.')\n\n        self.maximum_sector_exposure = maximum_sector_exposure\n        self.targets_collection = PortfolioTargetCollection()\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance'''\n        maximum_sector_exposure_value = float(algorithm.portfolio.total_portfolio_value) * self.maximum_sector_exposure\n\n        self.targets_collection.add_range(targets)\n\n        risk_targets = list()\n\n        # Group the securities by their sector\n        filtered = list(filter(lambda x: x.value.fundamentals is not None and x.value.fundamentals.has_fundamental_data, algorithm.universe_manager.active_securities))\n        filtered.sort(key = lambda x: x.value.fundamentals.company_reference.industry_template_code)\n        group_by_sector = groupby(filtered, lambda x: x.value.fundamentals.company_reference.industry_template_code)\n\n        for code, securities in group_by_sector:\n            # Compute the sector absolute holdings value\n            # If the construction model has created a target, we consider that\n            # value to calculate the security absolute holding value\n            quantities = {}\n            sector_absolute_holdings_value = 0\n\n            for security in securities:\n                symbol = security.value.symbol\n                quantities[symbol] = security.value.holdings.quantity\n                absolute_holdings_value = security.value.holdings.absolute_holdings_value\n\n                if self.targets_collection.contains_key(symbol):\n                    quantities[symbol] = self.targets_collection[symbol].quantity\n\n                    absolute_holdings_value = (security.value.price * abs(quantities[symbol]) *\n                        security.value.symbol_properties.contract_multiplier *\n                        security.value.quote_currency.conversion_rate)\n\n                sector_absolute_holdings_value += absolute_holdings_value\n\n            # If the ratio between the sector absolute holdings value and the maximum sector exposure value\n            # exceeds the unity, it means we need to reduce each security of that sector by that ratio\n            # Otherwise, it means that the sector exposure is below the maximum and there is nothing to do.\n            ratio = float(sector_absolute_holdings_value) / maximum_sector_exposure_value\n\n            if ratio > 1:\n                for symbol, quantity in quantities.items():\n                    if quantity != 0:\n                        risk_targets.append(PortfolioTarget(symbol, float(quantity) / ratio))\n\n        return risk_targets\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        any_fundamental_data = any([\n            kvp.value.fundamentals is not None and\n            kvp.value.fundamentals.has_fundamental_data for kvp in algorithm.active_securities\n            ])\n\n        if not any_fundamental_data:\n            raise Exception(\"MaximumSectorExposureRiskManagementModel.on_securities_changed: Please select a portfolio selection model that selects securities with fundamental data.\")\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumUnrealizedProfitPercentPerSecurity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that limits the unrealized profit\n    /// per holding to the specified percentage\n    /// </summary>\n    public class MaximumUnrealizedProfitPercentPerSecurity : RiskManagementModel\n    {\n        private readonly decimal _maximumUnrealizedProfitPercent;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaximumUnrealizedProfitPercentPerSecurity\"/> class\n        /// </summary>\n        /// <param name=\"maximumUnrealizedProfitPercent\">The maximum percentage unrealized profit allowed for any single security holding,\n        /// defaults to 5% drawdown per security</param>\n        public MaximumUnrealizedProfitPercentPerSecurity(\n            decimal maximumUnrealizedProfitPercent = 0.05m\n            )\n        {\n            _maximumUnrealizedProfitPercent = Math.Abs(maximumUnrealizedProfitPercent);\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            foreach (var kvp in algorithm.Securities)\n            {\n                var security = kvp.Value;\n\n                if (!security.Invested)\n                {\n                    continue;\n                }\n\n                var pnl = security.Holdings.UnrealizedProfitPercent;\n                if (pnl > _maximumUnrealizedProfitPercent)\n                {\n                    var symbol = security.Symbol;\n\n                    // Cancel insights\n                    algorithm.Insights.Cancel(new[] { symbol });\n\n                    // liquidate\n                    yield return new PortfolioTarget(symbol, 0);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Risk/MaximumUnrealizedProfitPercentPerSecurity.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MaximumUnrealizedProfitPercentPerSecurity(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that limits the unrealized profit per holding to the specified percentage'''\n\n    def __init__(self, maximum_unrealized_profit_percent = 0.05):\n        '''Initializes a new instance of the MaximumUnrealizedProfitPercentPerSecurity class\n        Args:\n            maximum_unrealized_profit_percent: The maximum percentage unrealized profit allowed for any single security holding, defaults to 5% drawdown per security'''\n        self.maximum_unrealized_profit_percent = abs(maximum_unrealized_profit_percent)\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance\n            targets: The current portfolio targets to be assessed for risk'''\n        targets = []\n        for kvp in algorithm.securities:\n            security = kvp.value\n\n            if not security.invested:\n                continue\n\n            pnl = security.holdings.unrealized_profit_percent\n            if pnl > self.maximum_unrealized_profit_percent:\n                symbol = security.symbol\n\n                # Cancel insights\n                algorithm.insights.cancel([ symbol ]);\n\n                # liquidate\n                targets.append(PortfolioTarget(symbol, 0))\n\n        return targets\n"
  },
  {
    "path": "Algorithm.Framework/Risk/TrailingStopRiskManagementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Algorithm.Framework.Risk\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRiskManagementModel\"/> that limits the maximum possible loss\n    /// measured from the highest unrealized profit\n    /// </summary>\n    public class TrailingStopRiskManagementModel : RiskManagementModel\n    {\n        private readonly decimal _maximumDrawdownPercent;\n        private readonly Dictionary<Symbol, HoldingsState> _trailingAbsoluteHoldingsState = new Dictionary<Symbol, HoldingsState>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrailingStopRiskManagementModel\"/> class\n        /// </summary>\n        /// <param name=\"maximumDrawdownPercent\">The maximum percentage relative drawdown allowed for algorithm portfolio compared with the highest unrealized profit, defaults to 5% drawdown per security</param>\n        public TrailingStopRiskManagementModel(decimal maximumDrawdownPercent = 0.05m)\n        {\n            _maximumDrawdownPercent = Math.Abs(maximumDrawdownPercent);\n        }\n\n        /// <summary>\n        /// Manages the algorithm's risk at each time step\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targets\">The current portfolio targets to be assessed for risk</param>\n        public override IEnumerable<IPortfolioTarget> ManageRisk(QCAlgorithm algorithm, IPortfolioTarget[] targets)\n        {\n            foreach (var kvp in algorithm.Securities)\n            {\n                var symbol = kvp.Key;\n                var security = kvp.Value;\n\n                // Remove if not invested\n                if (!security.Invested)\n                {\n                    _trailingAbsoluteHoldingsState.Remove(symbol);\n                    continue;\n                }\n\n                var position = security.Holdings.IsLong ? PositionSide.Long : PositionSide.Short;\n                var absoluteHoldingsValue = security.Holdings.AbsoluteHoldingsValue;\n                HoldingsState trailingAbsoluteHoldingsState;\n\n                // Add newly invested security (if doesn't exist) or reset holdings state (if position changed)\n                if (!_trailingAbsoluteHoldingsState.TryGetValue(symbol, out trailingAbsoluteHoldingsState) ||\n                    position != trailingAbsoluteHoldingsState.Position)\n                {\n                    _trailingAbsoluteHoldingsState[symbol] = trailingAbsoluteHoldingsState = new HoldingsState(position, security.Holdings.AbsoluteHoldingsCost);\n                }\n\n                var trailingAbsoluteHoldingsValue = trailingAbsoluteHoldingsState.AbsoluteHoldingsValue;\n\n                // Check for new max (for long position) or min (for short position) absolute holdings value\n                if ((position == PositionSide.Long && trailingAbsoluteHoldingsValue < absoluteHoldingsValue) ||\n                    (position == PositionSide.Short && trailingAbsoluteHoldingsValue > absoluteHoldingsValue))\n                {\n                    trailingAbsoluteHoldingsState.AbsoluteHoldingsValue = absoluteHoldingsValue;\n                    continue;\n                }\n\n                var drawdown = Math.Abs((trailingAbsoluteHoldingsValue - absoluteHoldingsValue) / trailingAbsoluteHoldingsValue);\n\n                if (_maximumDrawdownPercent < drawdown)\n                {\n                    // Cancel insights\n                    algorithm.Insights.Cancel(new[] { symbol });\n\n                    _trailingAbsoluteHoldingsState.Remove(symbol);\n                    // liquidate\n                    yield return new PortfolioTarget(symbol, 0);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper class used to store holdings state for the <see cref=\"TrailingStopRiskManagementModel\"/>\n        /// in <see cref=\"ManageRisk\"/>\n        /// </summary>\n        private class HoldingsState\n        {\n            public PositionSide Position;\n            public decimal AbsoluteHoldingsValue;\n\n            public HoldingsState(PositionSide position, decimal absoluteHoldingsValue)\n            {\n                Position = position;\n                AbsoluteHoldingsValue = absoluteHoldingsValue;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Risk/TrailingStopRiskManagementModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass TrailingStopRiskManagementModel(RiskManagementModel):\n    '''Provides an implementation of IRiskManagementModel that limits the maximum possible loss\n    measured from the highest unrealized profit'''\n    def __init__(self, maximum_drawdown_percent = 0.05):\n        '''Initializes a new instance of the TrailingStopRiskManagementModel class\n        Args:\n            maximum_drawdown_percent: The maximum percentage drawdown allowed for algorithm portfolio compared with the highest unrealized profit, defaults to 5% drawdown'''\n        self.maximum_drawdown_percent = abs(maximum_drawdown_percent)\n        self.trailing_absolute_holdings_state = dict()\n\n    def manage_risk(self, algorithm, targets):\n        '''Manages the algorithm's risk at each time step\n        Args:\n            algorithm: The algorithm instance\n            targets: The current portfolio targets to be assessed for risk'''\n        risk_adjusted_targets = list()\n\n        for kvp in algorithm.securities:\n            symbol = kvp.key\n            security = kvp.value\n\n            # Remove if not invested\n            if not security.invested:\n                self.trailing_absolute_holdings_state.pop(symbol, None)\n                continue\n\n            position = PositionSide.LONG if security.holdings.is_long else PositionSide.SHORT\n            absolute_holdings_value = security.holdings.absolute_holdings_value\n            trailing_absolute_holdings_state = self.trailing_absolute_holdings_state.get(symbol)\n\n            # Add newly invested security (if doesn't exist) or reset holdings state (if position changed)\n            if trailing_absolute_holdings_state == None or position != trailing_absolute_holdings_state.position:\n                self.trailing_absolute_holdings_state[symbol] = trailing_absolute_holdings_state = self.HoldingsState(position, security.holdings.absolute_holdings_cost)\n\n            trailing_absolute_holdings_value = trailing_absolute_holdings_state.absolute_holdings_value\n\n            # Check for new max (for long position) or min (for short position) absolute holdings value\n            if ((position == PositionSide.LONG and trailing_absolute_holdings_value < absolute_holdings_value) or\n                (position == PositionSide.SHORT and trailing_absolute_holdings_value > absolute_holdings_value)):\n                self.trailing_absolute_holdings_state[symbol].absolute_holdings_value = absolute_holdings_value\n                continue\n\n            drawdown = abs((trailing_absolute_holdings_value - absolute_holdings_value) / trailing_absolute_holdings_value)\n\n            if self.maximum_drawdown_percent < drawdown:\n                # Cancel insights\n                algorithm.insights.cancel([ symbol ]);\n\n                self.trailing_absolute_holdings_state.pop(symbol, None)\n                # liquidate\n                risk_adjusted_targets.append(PortfolioTarget(symbol, 0))\n\n        return risk_adjusted_targets\n\n    class HoldingsState:\n        def __init__(self, position, absolute_holdings_value):\n            self.position = position\n            self.absolute_holdings_value = absolute_holdings_value\n"
  },
  {
    "path": "Algorithm.Framework/Selection/CoarseFundamentalUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Portfolio selection model that uses coarse selectors. For US equities only.\n    /// </summary>\n    public class CoarseFundamentalUniverseSelectionModel : FundamentalUniverseSelectionModel\n    {\n        private readonly Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> _coarseSelector;\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public CoarseFundamentalUniverseSelectionModel(\n            Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> coarseSelector,\n            UniverseSettings universeSettings = null\n            )\n            : base(false, universeSettings)\n        {\n            _coarseSelector = coarseSelector;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public CoarseFundamentalUniverseSelectionModel(\n            PyObject coarseSelector,\n            UniverseSettings universeSettings = null\n            )\n            : base(false, universeSettings)\n        {\n            if (coarseSelector.TrySafeAs<Func<IEnumerable<CoarseFundamental>, object>>(out var func))\n            {\n                _coarseSelector = func.ConvertToUniverseSelectionSymbolDelegate();\n            }\n        }\n\n        /// <inheritdoc />\n        public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectCoarse), out IEnumerable<Symbol> result, algorithm, coarse))\n            {\n                return result;\n            }\n            return _coarseSelector(coarse);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/ETFConstituentsUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe selection model that selects the constituents of an ETF.\n    /// </summary>\n    public class ETFConstituentsUniverseSelectionModel : UniverseSelectionModel\n    {\n        private readonly Symbol _etfSymbol;\n        private readonly UniverseSettings _universeSettings;\n        private readonly Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> _universeFilterFunc;\n        private Universe _universe;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfSymbol\">Symbol of the ETF to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            Symbol etfSymbol,\n            UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            _etfSymbol = etfSymbol;\n            _universeSettings = universeSettings;\n            _universeFilterFunc = universeFilterFunc;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfSymbol\">Symbol of the ETF to get constituents for</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            Symbol etfSymbol,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n            : this(etfSymbol, null, universeFilterFunc)\n        { }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfSymbol\">Symbol of the ETF to get constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            Symbol etfSymbol,\n            UniverseSettings universeSettings = null,\n            PyObject universeFilterFunc = null) :\n            this(etfSymbol, universeSettings, universeFilterFunc.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>())\n        { }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfTicker\">The string ETF ticker symbol</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            string etfTicker,\n            UniverseSettings universeSettings,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n        {\n            _etfSymbol = SymbolCache.TryGetSymbol(etfTicker, out var symbol)\n                && symbol.SecurityType == SecurityType.Equity\n                ? symbol : Symbol.Create(etfTicker, SecurityType.Equity, Market.USA);\n\n            _universeSettings = universeSettings;\n            _universeFilterFunc = universeFilterFunc;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfTicker\">The string ETF ticker symbol</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            string etfTicker,\n            Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)\n            : this(etfTicker, null, universeFilterFunc)\n        { }\n\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ETFConstituentsUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"etfTicker\">The string ETF ticker symbol</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"universeFilterFunc\">Function to filter universe results</param>\n        public ETFConstituentsUniverseSelectionModel(\n            string etfTicker,\n            UniverseSettings universeSettings = null,\n            PyObject universeFilterFunc = null) :\n            this(etfTicker, universeSettings, universeFilterFunc.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>())\n        { }\n\n        /// <summary>\n        /// Creates a new ETF constituents universe using this class's selection function\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universe defined by this model</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            _universe ??= algorithm?.Universe.ETF(_etfSymbol, _universeSettings, _universeFilterFunc);\n            return new[] { _universe };\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/ETFConstituentsUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.UniverseSelectionModel import UniverseSelectionModel\n\nclass ETFConstituentsUniverseSelectionModel(UniverseSelectionModel):\n    '''Universe selection model that selects the constituents of an ETF.'''\n\n    def __init__(self,\n                 etf_symbol,\n                 universe_settings = None,\n                 universe_filter_func = None):\n        '''Initializes a new instance of the ETFConstituentsUniverseSelectionModel class\n        Args:\n            etfSymbol: Symbol of the ETF to get constituents for\n            universeSettings: Universe settings\n            universeFilterFunc: Function to filter universe results'''\n        if type(etf_symbol) is str:\n            symbol = SymbolCache.try_get_symbol(etf_symbol, None)\n            if symbol[0] and symbol[1].security_type == SecurityType.EQUITY:\n                self.etf_symbol = symbol[1]\n            else:\n                self.etf_symbol = Symbol.create(etf_symbol, SecurityType.EQUITY, Market.USA)\n        else:\n            self.etf_symbol = etf_symbol\n        self.universe_settings = universe_settings\n        self.universe_filter_function = universe_filter_func\n\n        self.universe = None\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates a new ETF constituents universe using this class's selection function\n        Args:\n            algorithm: The algorithm instance to create universes for\n        Returns:\n            The universe defined by this model'''\n        if self.universe is None:\n            self.universe = algorithm.universe.etf(self.etf_symbol, self.universe_settings, self.universe_filter_function)\n        return [self.universe]\n"
  },
  {
    "path": "Algorithm.Framework/Selection/EmaCrossUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FundamentalUniverseSelectionModel\"/> that subscribes\n    /// to symbols with the larger delta by percentage between the two exponential moving average\n    /// </summary>\n    public class EmaCrossUniverseSelectionModel : FundamentalUniverseSelectionModel\n    {\n        private const decimal _tolerance = 0.01m;\n        private readonly int _fastPeriod;\n        private readonly int _slowPeriod;\n        private readonly int _universeCount;\n\n        // holds our coarse fundamental indicators by symbol\n        private readonly ConcurrentDictionary<Symbol, SelectionData> _averages;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EmaCrossUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"fastPeriod\">Fast EMA period</param>\n        /// <param name=\"slowPeriod\">Slow EMA period</param>\n        /// <param name=\"universeCount\">Maximum number of members of this universe selection</param>\n        /// <param name=\"universeSettings\">The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings</param>\n        public EmaCrossUniverseSelectionModel(\n            int fastPeriod = 100,\n            int slowPeriod = 300,\n            int universeCount = 500,\n            UniverseSettings universeSettings = null)\n            : base(false, universeSettings)\n        {\n            _fastPeriod = fastPeriod;\n            _slowPeriod = slowPeriod;\n            _universeCount = universeCount;\n            _averages = new ConcurrentDictionary<Symbol, SelectionData>();\n        }\n\n        /// <summary>\n        /// Defines the coarse fundamental selection function.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"coarse\">The coarse fundamental data used to perform filtering</param>\n        /// <returns>An enumerable of symbols passing the filter</returns>\n        public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectCoarse), out IEnumerable<Symbol> result, algorithm, coarse))\n            {\n                return result;\n            }\n\n            return (from cf in coarse\n                        // grab th SelectionData instance for this symbol\n                    let avg = _averages.GetOrAdd(cf.Symbol, sym => new SelectionData(_fastPeriod, _slowPeriod))\n                    // Update returns true when the indicators are ready, so don't accept until they are\n                    where avg.Update(cf.EndTime, cf.AdjustedPrice)\n                    // only pick symbols who have their _fastPeriod-day ema over their _slowPeriod-day ema\n                    where avg.Fast > avg.Slow * (1 + _tolerance)\n                    // prefer symbols with a larger delta by percentage between the two averages\n                    orderby avg.ScaledDelta descending\n                    // we only need to return the symbol and return 'Count' symbols\n                    select cf.Symbol).Take(_universeCount);\n        }\n\n        // class used to improve readability of the coarse selection function\n        private class SelectionData\n        {\n            public readonly ExponentialMovingAverage Fast;\n            public readonly ExponentialMovingAverage Slow;\n\n            public SelectionData(int fastPeriod, int slowPeriod)\n            {\n                Fast = new ExponentialMovingAverage(fastPeriod);\n                Slow = new ExponentialMovingAverage(slowPeriod);\n            }\n\n            // computes an object score of how much large the fast is than the slow\n            public decimal ScaledDelta => (Fast - Slow) / ((Fast + Slow) / 2m);\n\n            // updates the EMAFast and EMASlow indicators, returning true when they're both ready\n            public bool Update(DateTime time, decimal value) => Fast.Update(time, value) & Slow.Update(time, value);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/EmaCrossUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\nclass EmaCrossUniverseSelectionModel(FundamentalUniverseSelectionModel):\n    '''Provides an implementation of FundamentalUniverseSelectionModel that subscribes to\n    symbols with the larger delta by percentage between the two exponential moving average'''\n\n    def __init__(self,\n                 fastPeriod = 100,\n                 slowPeriod = 300,\n                 universeCount = 500,\n                 universeSettings = None):\n        '''Initializes a new instance of the EmaCrossUniverseSelectionModel class\n        Args:\n            fastPeriod: Fast EMA period\n            slowPeriod: Slow EMA period\n            universeCount: Maximum number of members of this universe selection\n            universeSettings: The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings'''\n        super().__init__(False, universeSettings)\n        self.fast_period = fastPeriod\n        self.slow_period = slowPeriod\n        self.universe_count = universeCount\n        self.tolerance = 0.01\n        # holds our coarse fundamental indicators by symbol\n        self.averages = {}\n\n    def select_coarse(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        '''Defines the coarse fundamental selection function.\n        Args:\n            algorithm: The algorithm instance\n            fundamental: The coarse fundamental data used to perform filtering</param>\n        Returns:\n            An enumerable of symbols passing the filter'''\n        filtered = []\n\n        for cf in fundamental:\n            if cf.symbol not in self.averages:\n                self.averages[cf.symbol] = self.SelectionData(cf.symbol, self.fast_period, self.slow_period)\n\n            # grab th SelectionData instance for this symbol\n            avg = self.averages.get(cf.symbol)\n\n            # Update returns true when the indicators are ready, so don't accept until they are\n            # and only pick symbols who have their fastPeriod-day ema over their slowPeriod-day ema\n            if avg.update(cf.end_time, cf.adjusted_price) and avg.fast > avg.slow * (1 + self.tolerance):\n                filtered.append(avg)\n\n        # prefer symbols with a larger delta by percentage between the two averages\n        filtered = sorted(filtered, key=lambda avg: avg.scaled_delta, reverse = True)\n\n        # we only need to return the symbol and return 'universeCount' symbols\n        return [x.symbol for x in filtered[:self.universe_count]]\n\n    # class used to improve readability of the coarse selection function\n    class SelectionData:\n        def __init__(self, symbol, fast_period, slow_period):\n            self.symbol = symbol\n            self.fast_ema = ExponentialMovingAverage(fast_period)\n            self.slow_ema = ExponentialMovingAverage(slow_period)\n\n        @property\n        def fast(self):\n            return float(self.fast_ema.current.value)\n\n        @property\n        def slow(self):\n            return float(self.slow_ema.current.value)\n\n        # computes an object score of how much large the fast is than the slow\n        @property\n        def scaled_delta(self):\n            return (self.fast - self.slow) / ((self.fast + self.slow) / 2)\n\n        # updates the EMAFast and EMASlow indicators, returning true when they're both ready\n        def update(self, time, value):\n            return self.slow_ema.update(time, value) & self.fast_ema.update(time, value)\n"
  },
  {
    "path": "Algorithm.Framework/Selection/EnergyETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following Energy ETFs at their inception date\n    /// 1998-12-22   XLE    Energy Select Sector SPDR Fund\n    /// 2000-06-16   IYE    iShares U.S. Energy ETF\n    /// 2004-09-29   VDE    Vanguard Energy ETF\n    /// 2006-04-10   USO    United States Oil Fund\n    /// 2006-06-22   XES    SPDR S&amp;P Oil &amp; Gas Equipment &amp; Services ETF\n    /// 2006-06-22   XOP    SPDR S&amp;P Oil &amp; Gas Exploration &amp; Production ETF\n    /// 2007-04-18   UNG    United States Natural Gas Fund\n    /// 2008-06-25   ICLN   iShares Global Clean Energy ETF\n    /// 2008-11-06   ERX    Direxion Daily Energy Bull 3X Shares\n    /// 2008-11-06   ERY    Direxion Daily Energy Bear 3x Shares\n    /// 2008-11-25   SCO    ProShares UltraShort Bloomberg Crude Oil\n    /// 2008-11-25   UCO    ProShares Ultra Bloomberg Crude Oil\n    /// 2009-06-02   AMJ    JPMorgan Alerian MLP Index ETN\n    /// 2010-06-02   BNO    United States Brent Oil Fund\n    /// 2010-08-25   AMLP   Alerian MLP ETF\n    /// 2011-12-21   OIH    VanEck Vectors Oil Services ETF\n    /// 2012-02-08   DGAZ   VelocityShares 3x Inverse Natural Gas\n    /// 2012-02-08   UGAZ   VelocityShares 3x Long Natural Gas\n    /// 2012-02-15   TAN    Invesco Solar ETF\n    /// </summary>\n\tpublic class EnergyETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the EnergyETFUniverse class\n        /// </summary>\n        public EnergyETFUniverse() :\n            base(\n                \"qc-energy-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"XLE\", new DateTime(1998, 12, 22)},\n                    {\"IYE\", new DateTime(2000, 6, 16)},\n                    {\"VDE\", new DateTime(2004, 9, 29)},\n                    {\"USO\", new DateTime(2006, 4, 10)},\n                    {\"XES\", new DateTime(2006, 6, 22)},\n                    {\"XOP\", new DateTime(2006, 6, 22)},\n                    {\"UNG\", new DateTime(2007, 4, 18)},\n                    {\"ICLN\", new DateTime(2008, 6, 25)},\n                    {\"ERX\", new DateTime(2008, 11, 6)},\n                    {\"ERY\", new DateTime(2008, 11, 6)},\n                    {\"SCO\", new DateTime(2008, 11, 25)},\n                    {\"UCO\", new DateTime(2008, 11, 25)},\n                    {\"AMJ\", new DateTime(2009, 6, 2)},\n                    {\"BNO\", new DateTime(2010, 6, 2)},\n                    {\"AMLP\", new DateTime(2010, 8, 25)},\n                    {\"OIH\", new DateTime(2011, 12, 21)},\n                    {\"DGAZ\", new DateTime(2012, 2, 8)},\n                    {\"UGAZ\", new DateTime(2012, 2, 8)},\n                    {\"TAN\", new DateTime(2012, 2, 15)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Selection/FineFundamentalUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Portfolio selection model that uses coarse/fine selectors. For US equities only.\n    /// </summary>\n    public class FineFundamentalUniverseSelectionModel : FundamentalUniverseSelectionModel\n    {\n        private readonly Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> _coarseSelector;\n        private readonly Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> _fineSelector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <param name=\"fineSelector\">Selects symbols from the provided fine data set (this set has already been filtered according to the coarse selection)</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FineFundamentalUniverseSelectionModel(\n            Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> coarseSelector,\n            Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> fineSelector,\n            UniverseSettings universeSettings = null)\n            : base(true, universeSettings)\n        {\n            _coarseSelector = coarseSelector;\n            _fineSelector = fineSelector;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <param name=\"fineSelector\">Selects symbols from the provided fine data set (this set has already been filtered according to the coarse selection)</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FineFundamentalUniverseSelectionModel(\n            PyObject coarseSelector,\n            PyObject fineSelector,\n            UniverseSettings universeSettings = null\n            )\n            : base(true, universeSettings)\n        {\n            Func<IEnumerable<FineFundamental>, object> fineFunc;\n            Func<IEnumerable<CoarseFundamental>, object> coarseFunc;\n            if (fineSelector.TrySafeAs(out fineFunc) &&\n                coarseSelector.TrySafeAs(out coarseFunc))\n            {\n                _fineSelector = fineFunc.ConvertToUniverseSelectionSymbolDelegate();\n                _coarseSelector = coarseFunc.ConvertToUniverseSelectionSymbolDelegate();\n            }\n        }\n\n        /// <inheritdoc />\n        public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectCoarse), out IEnumerable<Symbol> result, algorithm, coarse))\n            {\n                return result;\n            }\n\n            return _coarseSelector(coarse);\n        }\n\n        /// <inheritdoc />\n        public override IEnumerable<Symbol> SelectFine(QCAlgorithm algorithm, IEnumerable<FineFundamental> fine)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectFine), out IEnumerable<Symbol> result, algorithm, fine))\n            {\n                return result;\n            }\n\n            return _fineSelector(fine);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides a base class for defining equity coarse/fine fundamental selection models\n    /// </summary>\n    public class FundamentalUniverseSelectionModel : UniverseSelectionModel\n    {\n        private readonly string _market;\n        private readonly bool _fundamentalData;\n        private readonly bool _filterFineData;\n        private readonly UniverseSettings _universeSettings;\n        private readonly Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> _selector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        public FundamentalUniverseSelectionModel()\n            : this(Market.USA, null)\n        {\n            _fundamentalData = true;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(string market, UniverseSettings universeSettings)\n        {\n            _market = market;\n            _fundamentalData = true;\n            _universeSettings = universeSettings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(UniverseSettings universeSettings)\n           : this(Market.USA, universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"selector\">Selects symbols from the provided fundamental data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(string market, Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector, UniverseSettings universeSettings = null)\n        {\n            _market = market;\n            _selector = selector;\n            _fundamentalData = true;\n            _universeSettings = universeSettings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"selector\">Selects symbols from the provided fundamental data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector, UniverseSettings universeSettings = null)\n           : this(Market.USA, selector, universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"selector\">Selects symbols from the provided fundamental data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(string market, PyObject selector, UniverseSettings universeSettings = null) : this(universeSettings)\n        {\n            _market = market;\n            Func<IEnumerable<Fundamental>, object> selectorFunc;\n            if (selector.TrySafeAs(out selectorFunc))\n            {\n                _selector = selectorFunc.ConvertToUniverseSelectionSymbolDelegate();\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"selector\">Selects symbols from the provided fundamental data set</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FundamentalUniverseSelectionModel(PyObject selector, UniverseSettings universeSettings = null)\n           : this(Market.USA, selector, universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"filterFineData\">True to also filter using fine fundamental data, false to only filter on coarse data</param>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'FundamentalUniverseSelectionModel()'\")]\n        protected FundamentalUniverseSelectionModel(bool filterFineData)\n            : this(filterFineData, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"filterFineData\">True to also filter using fine fundamental data, false to only filter on coarse data</param>\n        /// <param name=\"universeSettings\">The settings used when adding symbols to the algorithm, specify null to use algorithm.UniverseSettings</param>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'FundamentalUniverseSelectionModel(UniverseSettings)'\")]\n        protected FundamentalUniverseSelectionModel(bool filterFineData, UniverseSettings universeSettings)\n        {\n            _market = Market.USA;\n            _filterFineData = filterFineData;\n            _universeSettings = universeSettings;\n        }\n\n        /// <summary>\n        /// Creates a new fundamental universe using this class's selection functions\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universe defined by this model</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            if (_fundamentalData)\n            {\n                var universeSettings = _universeSettings ?? algorithm.UniverseSettings;\n                yield return new FundamentalUniverseFactory(_market, universeSettings, fundamental => Select(algorithm, fundamental));\n            }\n            else\n            {\n                // for backwards compatibility\n                var universe = CreateCoarseFundamentalUniverse(algorithm);\n                if (_filterFineData)\n                {\n                    if (universe.UniverseSettings.Asynchronous.HasValue && universe.UniverseSettings.Asynchronous.Value)\n                    {\n                        throw new ArgumentException(\"Asynchronous universe setting is not supported for coarse & fine selections, please use the new Fundamental single pass selection\");\n                    }\n#pragma warning disable CS0618 // Type or member is obsolete\n                    universe = new FineFundamentalFilteredUniverse(universe, fine => SelectFine(algorithm, fine));\n#pragma warning restore CS0618 // Type or member is obsolete\n                }\n                yield return universe;\n            }\n        }\n\n        /// <summary>\n        /// Creates the coarse fundamental universe object.\n        /// This is provided to allow more flexibility when creating coarse universe.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>The coarse fundamental universe</returns>\n        public virtual Universe CreateCoarseFundamentalUniverse(QCAlgorithm algorithm)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(CreateCoarseFundamentalUniverse), out Universe result, algorithm))\n            {\n                return result;\n            }\n\n            var universeSettings = _universeSettings ?? algorithm.UniverseSettings;\n            return new CoarseFundamentalUniverse(universeSettings, coarse =>\n            {\n                // if we're using fine fundamental selection than exclude symbols without fine data\n                if (_filterFineData)\n                {\n                    coarse = coarse.Where(c => c.HasFundamentalData);\n                }\n\n#pragma warning disable CS0618 // Type or member is obsolete\n                return SelectCoarse(algorithm, coarse);\n#pragma warning restore CS0618 // Type or member is obsolete\n            });\n        }\n\n        /// <summary>\n        /// Defines the fundamental selection function.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"fundamental\">The fundamental data used to perform filtering</param>\n        /// <returns>An enumerable of symbols passing the filter</returns>\n        public virtual IEnumerable<Symbol> Select(QCAlgorithm algorithm, IEnumerable<Fundamental> fundamental)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Select), out IEnumerable<Symbol> result, algorithm, fundamental))\n            {\n                return result;\n            }\n\n            if (_selector == null)\n            {\n                throw new NotImplementedException(\"If inheriting, please override the 'Select' fundamental function, else provide it as a constructor parameter\");\n            }\n            return _selector(fundamental);\n        }\n\n        /// <summary>\n        /// Defines the coarse fundamental selection function.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"coarse\">The coarse fundamental data used to perform filtering</param>\n        /// <returns>An enumerable of symbols passing the filter</returns>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'Select(QCAlgorithm, IEnumerable<Fundamental>)'\")]\n        public virtual IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectCoarse), out IEnumerable<Symbol> result, algorithm, coarse))\n            {\n                return result;\n            }\n\n            throw new NotImplementedException(\"Please override the 'Select' fundamental function\");\n        }\n\n        /// <summary>\n        /// Defines the fine fundamental selection function.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"fine\">The fine fundamental data used to perform filtering</param>\n        /// <returns>An enumerable of symbols passing the filter</returns>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'Select(QCAlgorithm, IEnumerable<Fundamental>)'\")]\n        public virtual IEnumerable<Symbol> SelectFine(QCAlgorithm algorithm, IEnumerable<FineFundamental> fine)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectFine), out IEnumerable<Symbol> result, algorithm, fine))\n            {\n                return result;\n            }\n\n            // default impl performs no filtering of fine data\n            return fine.Select(f => f.Symbol);\n        }\n\n        /// <summary>\n        /// Convenience method for creating a selection model that uses only coarse data\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <returns>A new universe selection model that will select US equities according to the selection function specified</returns>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'Fundamental(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>>)'\")]\n        public static IUniverseSelectionModel Coarse(Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> coarseSelector)\n        {\n            return new CoarseFundamentalUniverseSelectionModel(coarseSelector);\n        }\n\n        /// <summary>\n        /// Convenience method for creating a selection model that uses coarse and fine data\n        /// </summary>\n        /// <param name=\"coarseSelector\">Selects symbols from the provided coarse data set</param>\n        /// <param name=\"fineSelector\">Selects symbols from the provided fine data set (this set has already been filtered according to the coarse selection)</param>\n        /// <returns>A new universe selection model that will select US equities according to the selection functions specified</returns>\n        [Obsolete(\"Fine and Coarse selection are merged, please use 'Fundamental(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>>)'\")]\n        public static IUniverseSelectionModel Fine(Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> coarseSelector, Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> fineSelector)\n        {\n            return new FineFundamentalUniverseSelectionModel(coarseSelector, fineSelector);\n        }\n\n        /// <summary>\n        /// Convenience method for creating a selection model that uses fundamental data\n        /// </summary>\n        /// <param name=\"selector\">Selects symbols from the provided fundamental data set</param>\n        /// <returns>A new universe selection model that will select US equities according to the selection functions specified</returns>\n        public static IUniverseSelectionModel Fundamental(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector)\n        {\n            return new FundamentalUniverseSelectionModel(selector);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass FundamentalUniverseSelectionModel:\n    '''Provides a base class for defining equity coarse/fine fundamental selection models'''\n    \n    def __init__(self,\n                 filter_fine_data = None,\n                 universe_settings = None):\n        '''Initializes a new instance of the FundamentalUniverseSelectionModel class\n        Args:\n            filter_fine_data: [Obsolete] Fine and Coarse selection are merged\n            universeSettings: The settings used when adding symbols to the algorithm, specify null to use algorithm.universe_settings'''\n        self.filter_fine_data = filter_fine_data\n        if self.filter_fine_data == None:\n            self.fundamental_data = True\n        else:\n            self.fundamental_data = False\n        self.market = Market.USA\n        self.universe_settings = universe_settings\n\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates a new fundamental universe using this class's selection functions\n        Args:\n            algorithm: The algorithm instance to create universes for\n        Returns:\n            The universe defined by this model'''\n        if self.fundamental_data:\n            universe_settings = algorithm.universe_settings if self.universe_settings is None else self.universe_settings\n            # handle both 'Select' and 'select' for backwards compatibility\n            selection = lambda fundamental: self.select(algorithm, fundamental)\n            if hasattr(self, \"Select\") and callable(self.Select):\n                selection = lambda fundamental: self.Select(algorithm, fundamental)\n            universe = FundamentalUniverseFactory(self.market, universe_settings, selection)\n            return [universe]\n        else:\n            universe = self.create_coarse_fundamental_universe(algorithm)\n            if self.filter_fine_data:\n                if universe.universe_settings.asynchronous:\n                    raise ValueError(\"Asynchronous universe setting is not supported for coarse & fine selections, please use the new Fundamental single pass selection\")\n                selection = lambda fine: self.select_fine(algorithm, fine)\n                if hasattr(self, \"SelectFine\") and callable(self.SelectFine):\n                    selection = lambda fine: self.SelectFine(algorithm, fine)\n                universe = FineFundamentalFilteredUniverse(universe, selection)\n            return [universe]\n\n\n    def create_coarse_fundamental_universe(self, algorithm: QCAlgorithm) -> Universe:\n        '''Creates the coarse fundamental universe object.\n        This is provided to allow more flexibility when creating coarse universe.\n        Args:\n            algorithm: The algorithm instance\n        Returns:\n            The coarse fundamental universe'''\n        universe_settings = algorithm.universe_settings if self.universe_settings is None else self.universe_settings\n        return CoarseFundamentalUniverse(universe_settings, lambda coarse: self.filtered_select_coarse(algorithm, coarse))\n\n\n    def filtered_select_coarse(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        '''Defines the coarse fundamental selection function.\n        If we're using fine fundamental selection than exclude symbols without fine data\n        Args:\n            algorithm: The algorithm instance\n            coarse: The coarse fundamental data used to perform filtering\n        Returns:\n            An enumerable of symbols passing the filter'''\n        if self.filter_fine_data:\n            fundamental = filter(lambda c: c.has_fundamental_data, fundamental)\n        if hasattr(self, \"SelectCoarse\") and callable(self.SelectCoarse):\n            # handle both 'select_coarse' and 'SelectCoarse' for backwards compatibility\n            return self.SelectCoarse(algorithm, fundamental)\n        return self.select_coarse(algorithm, fundamental)\n\n\n    def select(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        '''Defines the fundamental selection function.\n        Args:\n            algorithm: The algorithm instance\n            fundamental: The fundamental data used to perform filtering\n        Returns:\n            An enumerable of symbols passing the filter'''\n        raise NotImplementedError(\"Please overrride the 'select' fundamental function\")\n\n\n    def select_coarse(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        '''Defines the coarse fundamental selection function.\n        Args:\n            algorithm: The algorithm instance\n            coarse: The coarse fundamental data used to perform filtering\n        Returns:\n            An enumerable of symbols passing the filter'''\n        raise NotImplementedError(\"Please overrride the 'select' fundamental function\")\n\n\n    def select_fine(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        '''Defines the fine fundamental selection function.\n        Args:\n            algorithm: The algorithm instance\n            fine: The fine fundamental data used to perform filtering\n        Returns:\n            An enumerable of symbols passing the filter'''\n        return [f.symbol for f in fundamental]\n"
  },
  {
    "path": "Algorithm.Framework/Selection/FutureUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing Python.Runtime;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that subscribes to future chains\n    /// </summary>\n    public class FutureUniverseSelectionModel : UniverseSelectionModel\n    {\n        private DateTime _nextRefreshTimeUtc;\n        private readonly TimeSpan _refreshInterval;\n        private readonly UniverseSettings _universeSettings;\n        private readonly Func<DateTime, IEnumerable<Symbol>> _futureChainSymbolSelector;\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public override DateTime GetNextRefreshTimeUtc() => _nextRefreshTimeUtc;\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        public FutureUniverseSelectionModel(TimeSpan refreshInterval, Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector)\n            : this(refreshInterval, futureChainSymbolSelector, null)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\\\n        public FutureUniverseSelectionModel(TimeSpan refreshInterval, PyObject futureChainSymbolSelector)\n            : this(refreshInterval, futureChainSymbolSelector.SafeAs<Func<DateTime, IEnumerable<Symbol>>>(), null)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\\\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FutureUniverseSelectionModel(TimeSpan refreshInterval, PyObject futureChainSymbolSelector, UniverseSettings universeSettings)\n            : this(refreshInterval, futureChainSymbolSelector.SafeAs<Func<DateTime, IEnumerable<Symbol>>>(), universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FutureUniverseSelectionModel(\n            TimeSpan refreshInterval,\n            Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector,\n            UniverseSettings universeSettings\n            )\n        {\n            _nextRefreshTimeUtc = DateTime.MinValue;\n\n            _refreshInterval = refreshInterval;\n            _universeSettings = universeSettings;\n            _futureChainSymbolSelector = futureChainSymbolSelector;\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            _nextRefreshTimeUtc = algorithm.UtcTime + _refreshInterval;\n\n            var uniqueSymbols = new HashSet<Symbol>();\n            foreach (var futureSymbol in _futureChainSymbolSelector(algorithm.UtcTime))\n            {\n                if (futureSymbol.SecurityType != SecurityType.Future)\n                {\n                    throw new ArgumentException(\"FutureChainSymbolSelector must return future symbols.\");\n                }\n\n                // prevent creating duplicate future chains -- one per symbol\n                if (uniqueSymbols.Add(futureSymbol))\n                {\n                    foreach (var universe in algorithm.CreateFutureChain(futureSymbol, Filter, _universeSettings))\n                    {\n                        yield return universe;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Defines the future chain universe filter\n        /// </summary>\n        protected virtual FutureFilterUniverse Filter(FutureFilterUniverse filter)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Filter), out FutureFilterUniverse result, filter))\n            {\n                return result;\n            }\n            // NOP\n            return filter;\n        }\n    }\n\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that subscribes to future chains\n    /// </summary>\n    public class FuturesUniverseSelectionModel : FutureUniverseSelectionModel\n    {\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        public FuturesUniverseSelectionModel(TimeSpan refreshInterval, Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector)\n            : base(refreshInterval, futureChainSymbolSelector)\n        {\n        }\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FutureUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public FuturesUniverseSelectionModel(TimeSpan refreshInterval,\n            Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector,\n            UniverseSettings universeSettings)\n            : base(refreshInterval, futureChainSymbolSelector, universeSettings)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/FutureUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Selection.UniverseSelectionModel import UniverseSelectionModel\n\nclass FutureUniverseSelectionModel(UniverseSelectionModel):\n    '''Provides an implementation of IUniverseSelectionMode that subscribes to future chains'''\n    def __init__(self,\n                 refreshInterval,\n                 futureChainSymbolSelector,\n                 universeSettings = None):\n        '''Creates a new instance of FutureUniverseSelectionModel\n        Args:\n            refreshInterval: Time interval between universe refreshes</param>\n            futureChainSymbolSelector: Selects symbols from the provided future chain\n            universeSettings: Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed'''\n        self.next_refresh_time_utc = datetime.min\n\n        self.refresh_interval = refreshInterval\n        self.future_chain_symbol_selector = futureChainSymbolSelector\n        self.universe_settings = universeSettings\n\n    def get_next_refresh_time_utc(self):\n        '''Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.'''\n        return self.next_refresh_time_utc\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates a new fundamental universe using this class's selection functions\n        Args:\n            algorithm: The algorithm instance to create universes for\n        Returns:\n            The universe defined by this model'''\n        self.next_refresh_time_utc = algorithm.utc_time + self.refresh_interval\n\n        unique_symbols = set()\n        for future_symbol in self.future_chain_symbol_selector(algorithm.utc_time):\n            if future_symbol.SecurityType != SecurityType.FUTURE:\n                raise ValueError(\"futureChainSymbolSelector must return future symbols.\")\n\n            # prevent creating duplicate future chains -- one per symbol\n            if future_symbol not in unique_symbols:\n                unique_symbols.add(future_symbol)\n                selection = self.filter\n                if hasattr(self, \"Filter\") and callable(self.Filter):\n                    selection = self.Filter\n                for universe in Extensions.create_future_chain(algorithm, future_symbol, selection, self.universe_settings):\n                    yield universe\n\n    def filter(self, filter):\n        '''Defines the future chain universe filter'''\n        # NOP\n        return filter\n"
  },
  {
    "path": "Algorithm.Framework/Selection/InceptionDateUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Inception Date Universe that accepts a Dictionary of DateTime keyed by String that represent\n    /// the Inception date for each ticker\n    /// </summary>\n    public class InceptionDateUniverseSelectionModel : CustomUniverseSelectionModel\n    {\n        private readonly Queue<KeyValuePair<string, DateTime>> _queue;\n        private readonly List<string> _symbols;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InceptionDateUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"tickersByDate\">Dictionary of DateTime keyed by String that represent the Inception date for each ticker</param>\n        public InceptionDateUniverseSelectionModel(string name, Dictionary<string, DateTime> tickersByDate) :\n            base(name, (Func<DateTime, IEnumerable<string>>)null)\n        {\n            _queue = new Queue<KeyValuePair<string, DateTime>>(tickersByDate);\n            _symbols = new List<string>();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InceptionDateUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"name\">A unique name for this universe</param>\n        /// <param name=\"tickersByDate\">Dictionary of DateTime keyed by String that represent the Inception date for each ticker</param>\n        public InceptionDateUniverseSelectionModel(string name, PyObject tickersByDate) :\n            this(name, tickersByDate.ConvertToDictionary<string, DateTime>())\n        {\n        }\n\n        /// <summary>\n        /// Returns all tickers that are trading at current algorithm Time\n        /// </summary>\n        public override IEnumerable<string> Select(QCAlgorithm algorithm, DateTime date)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Select), out IEnumerable<string> result, algorithm, date))\n            {\n                return result;\n            }\n\n            // Move Symbols that are trading from the queue to a list \n            var added = new List<string>();\n            while (_queue.TryPeek(out var keyValuePair) && keyValuePair.Value <= date)\n            {\n                added.Add(_queue.Dequeue().Key);\n            }\n\n            // If no pending for addition found, return Universe Unchanged\n            // Otherwise adds to list of current tickers and return it\n            if (added.Count == 0)\n            {\n                return Universe.Unchanged;\n            }\n\n            _symbols.AddRange(added);\n            return _symbols;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/LiquidETFUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following ETFs at their inception date\n    /// </summary>\n    public class LiquidETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Represents the Energy ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping Energy = new Grouping(\n            new[]\n            {\n                \"VDE\", \"USO\", \"XES\", \"XOP\", \"UNG\", \"ICLN\", \"ERX\",\n                \"UCO\", \"AMJ\", \"BNO\", \"AMLP\", \"UGAZ\", \"TAN\"\n            },\n            new[] {\"ERY\", \"SCO\", \"DGAZ\" }\n        );\n\n        /// <summary>\n        /// Represents the Metals ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping Metals = new Grouping(\n            new[] {\"GLD\", \"IAU\", \"SLV\", \"GDX\", \"AGQ\", \"PPLT\", \"NUGT\", \"USLV\", \"UGLD\", \"JNUG\"},\n            new[] {\"DUST\", \"JDST\"}\n        );\n\n        /// <summary>\n        /// Represents the Technology ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping Technology = new Grouping(\n            new[] {\"QQQ\", \"IGV\", \"QTEC\", \"FDN\", \"FXL\", \"TECL\", \"SOXL\", \"SKYY\", \"KWEB\"},\n            new[] {\"TECS\", \"SOXS\"}\n        );\n\n        /// <summary>\n        /// Represents the Treasuries ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping Treasuries = new Grouping(\n            new[]\n            {\n                \"IEF\", \"SHY\", \"TLT\", \"IEI\", \"TLH\", \"BIL\", \"SPTL\",\n                \"TMF\", \"SCHO\", \"SCHR\", \"SPTS\", \"GOVT\"\n            },\n            new[] {\"SHV\", \"TBT\", \"TBF\", \"TMV\"}\n        );\n\n        /// <summary>\n        /// Represents the Volatility ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping Volatility = new Grouping(\n            new[] {\"TVIX\", \"VIXY\", \"SPLV\", \"UVXY\", \"EEMV\", \"EFAV\", \"USMV\"},\n            new[] {\"SVXY\"}\n        );\n\n        /// <summary>\n        /// Represents the SP500 Sectors ETF Category which can be used to access the list of Long and Inverse symbols\n        /// </summary>\n        public static readonly Grouping SP500Sectors = new Grouping(\n            new[] {\"XLB\", \"XLE\", \"XLF\", \"XLI\", \"XLK\", \"XLP\", \"XLU\", \"XLV\", \"XLY\"},\n            new string[0]\n        );\n\n        /// <summary>\n        /// Initializes a new instance of the LiquidETFUniverse class\n        /// </summary>\n        public LiquidETFUniverse() :\n            base(\n                \"qc-liquid-etf-basket\",\n                SP500Sectors\n                    .Concat(Energy)\n                    .Concat(Metals)\n                    .Concat(Technology)\n                    .Concat(Treasuries)\n                    .Concat(Volatility)\n                    // Convert the concatenated list of Symbol into a Dictionary of DateTime keyed by Symbol\n                    // For equities, Symbol.ID is the first date the security is traded.\n                    .ToDictionary(x => x.Value, x => x.ID.Date)\n            )\n        {\n\n        }\n\n        /// <summary>\n        /// Represent a collection of ETF symbols that is grouped according to a given criteria\n        /// </summary>\n        public class Grouping : List<Symbol>\n        {\n            /// <summary>\n            /// List of Symbols that follow the components direction\n            /// </summary>\n            public List<Symbol> Long { get; init; }\n\n            /// <summary>\n            /// List of Symbols that follow the components inverse direction\n            /// </summary>\n            public List<Symbol> Inverse { get; init; }\n\n            /// <summary>\n            /// Creates a new instance of <see cref=\"Grouping\"/>.\n            /// </summary>\n            /// <param name=\"longTickers\">List of tickers of ETFs that follows the components direction</param>\n            /// <param name=\"inverseTickers\">List of tickers of ETFs that follows the components inverse direction</param>\n            public Grouping(IEnumerable<string> longTickers, IEnumerable<string> inverseTickers)\n            {\n                Long = longTickers.Select(x => Symbol.Create(x, SecurityType.Equity, Market.USA)).ToList();\n                Inverse = inverseTickers.Select(x => Symbol.Create(x, SecurityType.Equity, Market.USA)).ToList();\n                AddRange(Long);\n                AddRange(Inverse);\n            }\n\n            /// <summary>\n            /// Returns a string that represents the current object.\n            /// </summary>\n            /// <returns>\n            /// A string that represents the current object.\n            /// </returns>\n            public override string ToString()\n            {\n                if (Count == 0)\n                {\n                    return \"No Symbols\";\n                }\n\n                var longSymbols = Long.Count == 0\n                    ? string.Empty\n                    : $\" Long: {string.Join(\",\", Long.Select(x => x.Value))}\";\n\n                var inverseSymbols = Inverse.Count == 0\n                    ? string.Empty\n                    : $\" Inverse: {string.Join(\",\", Inverse.Select(x => x.Value))}\";\n\n                return $\"{Count} symbols:{longSymbols}{inverseSymbols}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/MetalsETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following Metals ETFs at their inception date\n    /// 2004-11-18   GLD    SPDR Gold Trust\n    /// 2005-01-28   IAU    iShares Gold Trust\n    /// 2006-04-28   SLV    iShares Silver Trust\n    /// 2006-05-22   GDX    VanEck Vectors Gold Miners ETF\n    /// 2008-12-04   AGQ    ProShares Ultra Silver\n    /// 2009-11-11   GDXJ   VanEck Vectors Junior Gold Miners ETF\n    /// 2010-01-08   PPLT   Aberdeen Standard Platinum Shares ETF\n    /// 2010-12-08   NUGT   Direxion Daily Gold Miners Bull 3X Shares\n    /// 2010-12-08   DUST   Direxion Daily Gold Miners Bear 3X Shares\n    /// 2011-10-17   USLV   VelocityShares 3x Long Silver ETN\n    /// 2011-10-17   UGLD   VelocityShares 3x Long Gold ETN\n    /// 2013-10-03   JNUG   Direxion Daily Junior Gold Miners Index Bull 3x Shares\n    /// 2013-10-03   JDST   Direxion Daily Junior Gold Miners Index Bear 3X Shares\n    /// </summary>\n    public class MetalsETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the MetalsETFUniverse class\n        /// </summary>\n        public MetalsETFUniverse() :\n            base(\n                \"qc-metals-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"GLD\", new DateTime(2004, 11, 18)},\n                    {\"IAU\", new DateTime(2005, 1, 28)},\n                    {\"SLV\", new DateTime(2006, 4, 28)},\n                    {\"GDX\", new DateTime(2006, 5, 22)},\n                    {\"AGQ\", new DateTime(2008, 12, 4)},\n                    {\"GDXJ\", new DateTime(2009, 11, 11)},\n                    {\"PPLT\", new DateTime(2010, 1, 8)},\n                    {\"NUGT\", new DateTime(2010, 12, 8)},\n                    {\"DUST\", new DateTime(2010, 12, 8)},\n                    {\"USLV\", new DateTime(2011, 10, 17)},\n                    {\"UGLD\", new DateTime(2011, 10, 17)},\n                    {\"JNUG\", new DateTime(2013, 10, 3)},\n                    {\"JDST\", new DateTime(2013, 10, 3)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Selection/OpenInterestFutureUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    ///     Selects contracts in a futures universe, sorted by open interest.  This allows the selection to identifiy current\n    ///     active contract.\n    /// </summary>\n    public class OpenInterestFutureUniverseSelectionModel : FutureUniverseSelectionModel\n    {\n        private readonly int? _chainContractsLookupLimit;\n        private readonly IAlgorithm _algorithm;\n        private readonly int? _resultsLimit;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n\n        /// <summary>\n        ///     Creates a new instance of <see cref=\"OpenInterestFutureUniverseSelectionModel\" />\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        /// <param name=\"chainContractsLookupLimit\">Limit on how many contracts to query for open interest</param>\n        /// <param name=\"resultsLimit\">Limit on how many contracts will be part of the universe</param>\n        public OpenInterestFutureUniverseSelectionModel(IAlgorithm algorithm, Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector, int? chainContractsLookupLimit = 6,\n            int? resultsLimit = 1) : base(TimeSpan.FromDays(1), futureChainSymbolSelector)\n        {\n            _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            if (algorithm == null)\n            {\n                throw new ArgumentNullException(nameof(algorithm));\n            }\n\n            _algorithm = algorithm;\n            _resultsLimit = resultsLimit;\n            _chainContractsLookupLimit = chainContractsLookupLimit;\n        }\n\n        /// <summary>\n        ///     Creates a new instance of <see cref=\"OpenInterestFutureUniverseSelectionModel\" />\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm</param>\n        /// <param name=\"futureChainSymbolSelector\">Selects symbols from the provided future chain</param>\n        /// <param name=\"chainContractsLookupLimit\">Limit on how many contracts to query for open interest</param>\n        /// <param name=\"resultsLimit\">Limit on how many contracts will be part of the universe</param>\n        public OpenInterestFutureUniverseSelectionModel(IAlgorithm algorithm, PyObject futureChainSymbolSelector, int? chainContractsLookupLimit = 6,\n            int? resultsLimit = 1) : this(algorithm, ConvertFutureChainSymbolSelectorToFunc(futureChainSymbolSelector), chainContractsLookupLimit, resultsLimit)\n        {\n        }\n\n        /// <summary>\n        /// Defines the future chain universe filter\n        /// </summary>\n        protected override FutureFilterUniverse Filter(FutureFilterUniverse filter)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Filter), out FutureFilterUniverse result, filter))\n            {\n                return result;\n            }\n\n            // Remove duplicated keys\n            return filter.Contracts(FilterByOpenInterest(\n                filter.DistinctBy(x => x).ToDictionary(x => x.Symbol, x => _marketHoursDatabase.GetEntry(x.ID.Market, x, x.ID.SecurityType))));\n        }\n\n        /// <summary>\n        ///     Filters a set of contracts based on open interest.\n        /// </summary>\n        /// <param name=\"contracts\">Contracts to filter</param>\n        /// <returns>Filtered set</returns>\n        public IEnumerable<Symbol> FilterByOpenInterest(IReadOnlyDictionary<Symbol, MarketHoursDatabase.Entry> contracts)\n        {\n            var symbols = new List<Symbol>(_chainContractsLookupLimit.HasValue ? contracts.Keys.OrderBy(x => x.ID.Date).Take(_chainContractsLookupLimit.Value) : contracts.Keys);\n            var openInterest = symbols.GroupBy(x => contracts[x]).SelectMany(g => GetOpenInterest(g.Key, g.Select(i => i))).ToDictionary(x => x.Key, x => x.Value);\n\n            if (openInterest.Count == 0)\n            {\n                _algorithm.Error(\n                    $\"{nameof(OpenInterestFutureUniverseSelectionModel)}.{nameof(FilterByOpenInterest)}: Failed to get historical open interest, no symbol will be selected.\"\n                );\n                return Enumerable.Empty<Symbol>();\n            }\n\n            var filtered = openInterest.OrderByDescending(x => x.Value).ThenBy(x => x.Key.ID.Date).Select(x => x.Key);\n            if (_resultsLimit.HasValue)\n            {\n                filtered = filtered.Take(_resultsLimit.Value);\n            }\n\n            return filtered;\n        }\n\n        private Dictionary<Symbol, decimal> GetOpenInterest(MarketHoursDatabase.Entry marketHours, IEnumerable<Symbol> symbols)\n        {\n            var current = _algorithm.UtcTime;\n            var exchangeHours = marketHours.ExchangeHours;\n            var endTime = Instant.FromDateTimeUtc(_algorithm.UtcTime).InZone(exchangeHours.TimeZone).ToDateTimeUnspecified();\n            var previousDay = Time.GetStartTimeForTradeBars(exchangeHours, endTime, Time.OneDay, 1, true, marketHours.DataTimeZone);\n            var requests = symbols.Select(\n                    symbol => new HistoryRequest(\n                        previousDay,\n                        current,\n                        typeof(Tick),\n                        symbol,\n                        Resolution.Tick,\n                        exchangeHours,\n                        exchangeHours.TimeZone,\n                        null,\n                        true,\n                        false,\n                        DataNormalizationMode.Raw,\n                        TickType.OpenInterest\n                    )\n                )\n                .ToArray();\n            return _algorithm.HistoryProvider.GetHistory(requests, exchangeHours.TimeZone)\n                .Where(s => s.HasData && s.Ticks.Keys.Count > 0)\n                .SelectMany(s => s.Ticks.Select(x => new Tuple<Symbol, Tick>(x.Key, x.Value.LastOrDefault())))\n                .GroupBy(x => x.Item1)\n                .ToDictionary(x => x.Key, x => x.OrderByDescending(i => i.Item2.Time).LastOrDefault().Item2.Value);\n        }\n\n        /// <summary>\n        /// Converts future chain symbol selector, provided as a Python lambda function, to a managed func\n        /// </summary>\n        /// <param name=\"futureChainSymbolSelector\">Python lambda function that selects symbols from the provided future chain</param>\n        /// <returns>Given Python future chain symbol selector as a func objet</returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        private static Func<DateTime, IEnumerable<Symbol>> ConvertFutureChainSymbolSelectorToFunc(PyObject futureChainSymbolSelector)\n        {\n            if (futureChainSymbolSelector.TrySafeAs(out Func<DateTime, IEnumerable<Symbol>> futureSelector))\n            {\n                return futureSelector;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"FutureUniverseSelectionModel.ConvertFutureChainSymbolSelectorToFunc: {futureChainSymbolSelector.Repr()} is not a valid argument.\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/OptionUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IUniverseSelectionModel\"/> that subscribes to option chains\n    /// </summary>\n    public class OptionUniverseSelectionModel : UniverseSelectionModel\n    {\n        private DateTime _nextRefreshTimeUtc;\n        private readonly TimeSpan _refreshInterval;\n        private readonly UniverseSettings _universeSettings;\n        private readonly Func<DateTime, IEnumerable<Symbol>> _optionChainSymbolSelector;\n\n        /// <summary>\n        /// Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.\n        /// </summary>\n        public override DateTime GetNextRefreshTimeUtc() => _nextRefreshTimeUtc;\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"optionChainSymbolSelector\">Selects symbols from the provided option chain</param>\n        public OptionUniverseSelectionModel(TimeSpan refreshInterval, Func<DateTime, IEnumerable<Symbol>> optionChainSymbolSelector)\n            : this(refreshInterval, optionChainSymbolSelector, null)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"optionChainSymbolSelector\">Selects symbols from the provided option chain</param>\n        public OptionUniverseSelectionModel(TimeSpan refreshInterval, PyObject optionChainSymbolSelector)\n            : this(refreshInterval, optionChainSymbolSelector.SafeAs<Func<DateTime, IEnumerable<Symbol>>>(), null)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"optionChainSymbolSelector\">Selects symbols from the provided option chain</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public OptionUniverseSelectionModel(TimeSpan refreshInterval, PyObject optionChainSymbolSelector, UniverseSettings universeSettings)\n            : this(refreshInterval, optionChainSymbolSelector.SafeAs<Func<DateTime, IEnumerable<Symbol>>>(), universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionUniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"refreshInterval\">Time interval between universe refreshes</param>\n        /// <param name=\"optionChainSymbolSelector\">Selects symbols from the provided option chain</param>\n        /// <param name=\"universeSettings\">Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed</param>\n        public OptionUniverseSelectionModel(\n            TimeSpan refreshInterval,\n            Func<DateTime, IEnumerable<Symbol>> optionChainSymbolSelector,\n            UniverseSettings universeSettings\n            )\n        {\n            _nextRefreshTimeUtc = DateTime.MinValue;\n\n            _refreshInterval = refreshInterval;\n            _universeSettings = universeSettings;\n            _optionChainSymbolSelector = optionChainSymbolSelector;\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            _nextRefreshTimeUtc = algorithm.UtcTime + _refreshInterval;\n\n            var uniqueUnderlyingSymbols = new HashSet<Symbol>();\n            foreach (var optionSymbol in _optionChainSymbolSelector(algorithm.UtcTime))\n            {\n                if (!optionSymbol.SecurityType.IsOption())\n                {\n                    throw new ArgumentException(\"optionChainSymbolSelector must return option, index options, or futures options symbols.\");\n                }\n\n                // prevent creating duplicate option chains -- one per underlying\n                if (uniqueUnderlyingSymbols.Add(optionSymbol.Underlying))\n                {\n                    yield return algorithm.CreateOptionChain(optionSymbol, Filter, _universeSettings);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Defines the option chain universe filter\n        /// </summary>\n        protected virtual OptionFilterUniverse Filter(OptionFilterUniverse filter)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(Filter), out OptionFilterUniverse result, filter))\n            {\n                return result;\n            }\n\n            // NOP\n            return filter;\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/OptionUniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.UniverseSelectionModel import UniverseSelectionModel\n\nclass OptionUniverseSelectionModel(UniverseSelectionModel):\n    '''Provides an implementation of IUniverseSelectionMode that subscribes to option chains'''\n    def __init__(self,\n                 refreshInterval,\n                 optionChainSymbolSelector,\n                 universeSettings = None):\n        '''Creates a new instance of OptionUniverseSelectionModel\n        Args:\n            refreshInterval: Time interval between universe refreshes</param>\n            optionChainSymbolSelector: Selects symbols from the provided option chain\n            universeSettings: Universe settings define attributes of created subscriptions, such as their resolution and the minimum time in universe before they can be removed'''\n        self.next_refresh_time_utc = datetime.min\n\n        self.refresh_interval = refreshInterval\n        self.option_chain_symbol_selector = optionChainSymbolSelector\n        self.universe_settings = universeSettings\n\n    def get_next_refresh_time_utc(self):\n        '''Gets the next time the framework should invoke the `CreateUniverses` method to refresh the set of universes.'''\n        return self.next_refresh_time_utc\n\n    def create_universes(self, algorithm: QCAlgorithm) -> list[Universe]:\n        '''Creates a new fundamental universe using this class's selection functions\n        Args:\n            algorithm: The algorithm instance to create universes for\n        Returns:\n            The universe defined by this model'''\n        self.next_refresh_time_utc = (algorithm.utc_time + self.refresh_interval).date()\n\n        uniqueUnderlyingSymbols = set()\n        for option_symbol in self.option_chain_symbol_selector(algorithm.utc_time):\n            if not Extensions.is_option(option_symbol.security_type):\n                raise ValueError(\"optionChainSymbolSelector must return option, index options, or futures options symbols.\")\n\n            # prevent creating duplicate option chains -- one per underlying\n            if option_symbol.underlying not in uniqueUnderlyingSymbols:\n                uniqueUnderlyingSymbols.add(option_symbol.underlying)\n                selection = self.filter\n                if hasattr(self, \"Filter\") and callable(self.Filter):\n                    selection = self.Filter\n                yield Extensions.create_option_chain(algorithm, option_symbol, selection, self.universe_settings)\n\n    def filter(self, filter):\n        '''Defines the option chain universe filter'''\n        # NOP\n        return filter\n"
  },
  {
    "path": "Algorithm.Framework/Selection/QC500UniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Defines the QC500 universe as a universe selection model for framework algorithm\n    /// For details: https://github.com/QuantConnect/Lean/pull/1663\n    /// </summary>\n    public class QC500UniverseSelectionModel : FundamentalUniverseSelectionModel\n    {\n        private const int _numberOfSymbolsCoarse = 1000;\n        private const int _numberOfSymbolsFine = 500;\n\n        // rebalances at the start of each month\n        private int _lastMonth = -1;\n        private readonly Dictionary<Symbol, double> _dollarVolumeBySymbol = new();\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"QC500UniverseSelectionModel\"/>\n        /// </summary>\n        public QC500UniverseSelectionModel()\n            : base(true)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QC500UniverseSelectionModel\"/>\n        /// </summary>\n        /// <param name=\"universeSettings\">Universe settings defines what subscription properties will be applied to selected securities</param>\n        public QC500UniverseSelectionModel(UniverseSettings universeSettings)\n            : base(true, universeSettings)\n        {\n        }\n\n        /// <summary>\n        /// Performs coarse selection for the QC500 constituents.\n        /// The stocks must have fundamental data\n        /// The stock must have positive previous-day close price\n        /// The stock must have positive volume on the previous trading day\n        /// </summary>\n        public override IEnumerable<Symbol> SelectCoarse(QCAlgorithm algorithm, IEnumerable<CoarseFundamental> coarse)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectCoarse), out IEnumerable<Symbol> result, algorithm, coarse))\n            {\n                return result;\n            }\n\n            if (algorithm.Time.Month == _lastMonth)\n            {\n                return Universe.Unchanged;\n            }\n\n            var sortedByDollarVolume =\n                (from x in coarse\n                 where x.HasFundamentalData && x.Volume > 0 && x.Price > 0\n                 orderby x.DollarVolume descending\n                 select x).Take(_numberOfSymbolsCoarse).ToList();\n\n            _dollarVolumeBySymbol.Clear();\n            foreach (var x in sortedByDollarVolume)\n            {\n                _dollarVolumeBySymbol[x.Symbol] = x.DollarVolume;\n            }\n\n            // If no security has met the QC500 criteria, the universe is unchanged.\n            // A new selection will be attempted on the next trading day as _lastMonth is not updated\n            if (_dollarVolumeBySymbol.Count == 0)\n            {\n                return Universe.Unchanged;\n            }\n\n            return _dollarVolumeBySymbol.Keys;\n        }\n\n        /// <summary>\n        /// Performs fine selection for the QC500 constituents\n        /// The company's headquarter must in the U.S.\n        /// The stock must be traded on either the NYSE or NASDAQ\n        /// At least half a year since its initial public offering\n        /// The stock's market cap must be greater than 500 million\n        /// </summary>\n        public override IEnumerable<Symbol> SelectFine(QCAlgorithm algorithm, IEnumerable<FineFundamental> fine)\n        {\n            // Check if this method was overridden in Python\n            if (TryInvokePythonOverride(nameof(SelectFine), out IEnumerable<Symbol> result, algorithm, fine))\n            {\n                return result;\n            }\n\n            var filteredFine =\n                (from x in fine\n                 where x.CompanyReference.CountryId == \"USA\" &&\n                       (x.CompanyReference.PrimaryExchangeID == \"NYS\" || x.CompanyReference.PrimaryExchangeID == \"NAS\") &&\n                       (algorithm.Time - x.SecurityReference.IPODate).Days > 180 &&\n                       x.MarketCap > 500000000m\n                 select x).ToList();\n\n            var count = filteredFine.Count;\n\n            // If no security has met the QC500 criteria, the universe is unchanged.\n            // A new selection will be attempted on the next trading day as _lastMonth is not updated\n            if (count == 0)\n            {\n                return Universe.Unchanged;\n            }\n\n            // Update _lastMonth after all QC500 criteria checks passed\n            _lastMonth = algorithm.Time.Month;\n\n            var percent = _numberOfSymbolsFine / (double)count;\n\n            // select stocks with top dollar volume in every single sector\n            var topFineBySector =\n                (from x in filteredFine\n                     // Group by sector\n                 group x by x.CompanyReference.IndustryTemplateCode into g\n                 let y = from item in g\n                         orderby _dollarVolumeBySymbol[item.Symbol] descending\n                         select item\n                 let c = (int)Math.Ceiling(y.Count() * percent)\n                 select new { g.Key, Value = y.Take(c) }\n                 ).ToDictionary(x => x.Key, x => x.Value);\n\n            return topFineBySector.SelectMany(x => x.Value)\n                .OrderByDescending(x => _dollarVolumeBySymbol[x.Symbol])\n                .Take(_numberOfSymbolsFine)\n                .Select(x => x.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/QC500UniverseSelectionModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\nfrom itertools import groupby\nfrom math import ceil\n\nclass QC500UniverseSelectionModel(FundamentalUniverseSelectionModel):\n    '''Defines the QC500 universe as a universe selection model for framework algorithm\n    For details: https://github.com/QuantConnect/Lean/pull/1663'''\n\n    def __init__(self, filterFineData = True, universeSettings = None):\n        '''Initializes a new default instance of the QC500UniverseSelectionModel'''\n        super().__init__(filterFineData, universeSettings)\n        self.number_of_symbols_coarse = 1000\n        self.number_of_symbols_fine = 500\n        self.dollar_volume_by_symbol = {}\n        self.last_month = -1\n\n    def select_coarse(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]):\n        '''Performs coarse selection for the QC500 constituents.\n        The stocks must have fundamental data\n        The stock must have positive previous-day close price\n        The stock must have positive volume on the previous trading day'''\n        if algorithm.time.month == self.last_month:\n            return Universe.UNCHANGED\n\n        sorted_by_dollar_volume = sorted([x for x in fundamental if x.has_fundamental_data and x.volume > 0 and x.price > 0],\n                                     key = lambda x: x.dollar_volume, reverse=True)[:self.number_of_symbols_coarse]\n\n        self.dollar_volume_by_symbol = {x.Symbol:x.dollar_volume for x in sorted_by_dollar_volume}\n\n        # If no security has met the QC500 criteria, the universe is unchanged.\n        # A new selection will be attempted on the next trading day as self.lastMonth is not updated\n        if len(self.dollar_volume_by_symbol) == 0:\n            return Universe.UNCHANGED\n\n        # return the symbol objects our sorted collection\n        return list(self.dollar_volume_by_symbol.keys())\n\n    def select_fine(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]):\n        '''Performs fine selection for the QC500 constituents\n        The company's headquarter must in the U.S.\n        The stock must be traded on either the NYSE or NASDAQ\n        At least half a year since its initial public offering\n        The stock's market cap must be greater than 500 million'''\n\n        sorted_by_sector = sorted([x for x in fundamental if x.company_reference.country_id == \"USA\"\n                                        and x.company_reference.primary_exchange_id in [\"NYS\",\"NAS\"]\n                                        and (algorithm.time - x.security_reference.ipo_date).days > 180\n                                        and x.market_cap > 5e8],\n                               key = lambda x: x.company_reference.industry_template_code)\n\n        count = len(sorted_by_sector)\n\n        # If no security has met the QC500 criteria, the universe is unchanged.\n        # A new selection will be attempted on the next trading day as self.lastMonth is not updated\n        if count == 0:\n            return Universe.UNCHANGED\n\n        # Update self.lastMonth after all QC500 criteria checks passed\n        self.last_month = algorithm.time.month\n\n        percent = self.number_of_symbols_fine / count\n        sorted_by_dollar_volume = []\n\n        # select stocks with top dollar volume in every single sector\n        for code, g in groupby(sorted_by_sector, lambda x: x.company_reference.industry_template_code):\n            y = sorted(g, key = lambda x: self.dollar_volume_by_symbol[x.Symbol], reverse = True)\n            c = ceil(len(y) * percent)\n            sorted_by_dollar_volume.extend(y[:c])\n\n        sorted_by_dollar_volume = sorted(sorted_by_dollar_volume, key = lambda x: self.dollar_volume_by_symbol[x.Symbol], reverse=True)\n        return [x.Symbol for x in sorted_by_dollar_volume[:self.number_of_symbols_fine]]\n"
  },
  {
    "path": "Algorithm.Framework/Selection/SP500SectorsETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following SP500 Sectors ETFs at their inception date\n    /// 1998-12-22   XLB   Materials Select Sector SPDR ETF\n    /// 1998-12-22   XLE   Energy Select Sector SPDR Fund\n    /// 1998-12-22   XLF   Financial Select Sector SPDR Fund\n    /// 1998-12-22   XLI   Industrial Select Sector SPDR Fund\n    /// 1998-12-22   XLK   Technology Select Sector SPDR Fund\n    /// 1998-12-22   XLP   Consumer Staples Select Sector SPDR Fund\n    /// 1998-12-22   XLU   Utilities Select Sector SPDR Fund\n    /// 1998-12-22   XLV   Health Care Select Sector SPDR Fund\n    /// 1998-12-22   XLY   Consumer Discretionary Select Sector SPDR Fund\n    /// </summary>\n    public class SP500SectorsETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the SP500SectorsETFUniverse class\n        /// </summary>\n        public SP500SectorsETFUniverse() :\n            base(\n                \"qc-sp500-sectors-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"XLB\", new DateTime(1998, 12, 22)},\n                    {\"XLE\", new DateTime(1998, 12, 22)},\n                    {\"XLF\", new DateTime(1998, 12, 22)},\n                    {\"XLI\", new DateTime(1998, 12, 22)},\n                    {\"XLK\", new DateTime(1998, 12, 22)},\n                    {\"XLP\", new DateTime(1998, 12, 22)},\n                    {\"XLU\", new DateTime(1998, 12, 22)},\n                    {\"XLV\", new DateTime(1998, 12, 22)},\n                    {\"XLY\", new DateTime(1998, 12, 22)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Selection/ScheduledUniverseSelectionModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Defines a universe selection model that invokes a selector function on a specific scheduled given by an <see cref=\"IDateRule\"/> and an <see cref=\"ITimeRule\"/>\n    /// </summary>\n    public class ScheduledUniverseSelectionModel : UniverseSelectionModel\n    {\n        private readonly IDateRule _dateRule;\n        private readonly ITimeRule _timeRule;\n        private readonly Func<DateTime, IEnumerable<Symbol>> _selector;\n        private readonly DateTimeZone _timeZone;\n        private readonly UniverseSettings _settings;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverseSelectionModel\"/> class using the algorithm's time zone\n        /// </summary>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverseSelectionModel(IDateRule dateRule, ITimeRule timeRule, Func<DateTime, IEnumerable<Symbol>> selector, UniverseSettings settings = null)\n        {\n            _dateRule = dateRule;\n            _timeRule = timeRule;\n            _selector = selector;\n            _settings = settings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone the date/time rules are in</param>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverseSelectionModel(DateTimeZone timeZone, IDateRule dateRule, ITimeRule timeRule, Func<DateTime, IEnumerable<Symbol>> selector, UniverseSettings settings = null)\n        {\n            _timeZone = timeZone;\n            _dateRule = dateRule;\n            _timeRule = timeRule;\n            _selector = selector;\n            _settings = settings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverseSelectionModel\"/> class using the algorithm's time zone\n        /// </summary>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverseSelectionModel(IDateRule dateRule, ITimeRule timeRule, PyObject selector, UniverseSettings settings = null)\n            : this(null, dateRule, timeRule, selector, settings)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverseSelectionModel\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone the date/time rules are in</param>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverseSelectionModel(DateTimeZone timeZone, IDateRule dateRule, ITimeRule timeRule, PyObject selector, UniverseSettings settings = null)\n        {\n            Func<DateTime, object> func;\n            selector.TrySafeAs(out func);\n            _timeZone = timeZone;\n            _dateRule = dateRule;\n            _timeRule = timeRule;\n            _selector = func.ConvertSelectionSymbolDelegate();\n            _settings = settings;\n        }\n\n        /// <summary>\n        /// Creates the universes for this algorithm. Called once after <see cref=\"IAlgorithm.Initialize\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <returns>The universes to be used by the algorithm</returns>\n        public override IEnumerable<Universe> CreateUniverses(QCAlgorithm algorithm)\n        {\n            yield return new ScheduledUniverse(\n                // by default ITimeRule yields in UTC\n                _timeZone ?? TimeZones.Utc,\n                _dateRule,\n                _timeRule,\n                _selector,\n                _settings ?? algorithm.UniverseSettings\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Algorithm.Framework/Selection/TechnologyETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following Technology ETFs at their inception date\n    /// 1998-12-22   XLK    Technology Select Sector SPDR Fund\n    /// 1999-03-10   QQQ    Invesco QQQ\n    /// 2001-07-13   SOXX   iShares PHLX Semiconductor ETF\n    /// 2001-07-13   IGV    iShares Expanded Tech-Software Sector ETF\n    /// 2004-01-30   VGT    Vanguard Information Technology ETF\n    /// 2006-04-25   QTEC   First Trust NASDAQ 100 Technology\n    /// 2006-06-23   FDN    First Trust Dow Jones Internet Index\n    /// 2007-05-10   FXL    First Trust Technology AlphaDEX Fund\n    /// 2008-12-17   TECL   Direxion Daily Technology Bull 3X Shares\n    /// 2008-12-17   TECS   Direxion Daily Technology Bear 3X Shares\n    /// 2010-03-11   SOXL   Direxion Daily Semiconductor Bull 3x Shares\n    /// 2010-03-11   SOXS   Direxion Daily Semiconductor Bear 3x Shares\n    /// 2011-07-06   SKYY   First Trust ISE Cloud Computing Index Fund\n    /// 2011-12-21   SMH    VanEck Vectors Semiconductor ETF\n    /// 2013-08-01   KWEB   KraneShares CSI China Internet ETF\n    /// 2013-10-24   FTEC   Fidelity MSCI Information Technology Index ETF\n    /// </summary>\n    public class TechnologyETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the TechnologyETFUniverse class\n        /// </summary>\n        public TechnologyETFUniverse() :\n            base(\n                \"qc-technology-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"XLK\", new DateTime(1998, 12, 22)},\n                    {\"QQQ\", new DateTime(1999, 3, 10)},\n                    {\"SOXX\", new DateTime(2001, 7, 13)},\n                    {\"IGV\", new DateTime(2001, 7, 13)},\n                    {\"VGT\", new DateTime(2004, 1, 30)},\n                    {\"QTEC\", new DateTime(2006, 4, 25)},\n                    {\"FDN\", new DateTime(2006, 6, 23)},\n                    {\"FXL\", new DateTime(2007, 5, 10)},\n                    {\"TECL\", new DateTime(2008, 12, 17)},\n                    {\"TECS\", new DateTime(2008, 12, 17)},\n                    {\"SOXL\", new DateTime(2010, 3, 11)},\n                    {\"SOXS\", new DateTime(2010, 3, 11)},\n                    {\"SKYY\", new DateTime(2011, 7, 6)},\n                    {\"SMH\", new DateTime(2011, 12, 21)},\n                    {\"KWEB\", new DateTime(2013, 8, 1)},\n                    {\"FTEC\", new DateTime(2013, 10, 24)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Selection/USTreasuriesETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following US Treasuries ETFs at their inception date\n    /// 2002-07-26   IEF    iShares 7-10 Year Treasury Bond ETF\n    /// 2002-07-26   SHY    iShares 1-3 Year Treasury Bond ETF\n    /// 2002-07-26   TLT    iShares 20+ Year Treasury Bond ETF\n    /// 2007-01-11   SHV    iShares Short Treasury Bond ETF\n    /// 2007-01-11   IEI    iShares 3-7 Year Treasury Bond ETF\n    /// 2007-01-11   TLH    iShares 10-20 Year Treasury Bond ETF\n    /// 2007-12-10   EDV    Vanguard Ext Duration Treasury ETF\n    /// 2007-05-30   BIL    SPDR Barclays 1-3 Month T-Bill ETF\n    /// 2007-05-30   SPTL   SPDR Portfolio Long Term Treasury ETF\n    /// 2008-05-01   TBT    UltraShort Barclays 20+ Year Treasury\n    /// 2009-04-16   TMF    Direxion Daily 20-Year Treasury Bull 3X\n    /// 2009-04-16   TMV    Direxion Daily 20-Year Treasury Bear 3X\n    /// 2009-08-20   TBF    ProShares Short 20+ Year Treasury\n    /// 2009-11-23   VGSH   Vanguard Short-Term Treasury ETF\n    /// 2009-11-23   VGIT   Vanguard Intermediate-Term Treasury ETF\n    /// 2009-11-24   VGLT   Vanguard Long-Term Treasury ETF\n    /// 2010-08-06   SCHO   Schwab Short-Term U.S. Treasury ETF\n    /// 2010-08-06   SCHR   Schwab Intermediate-Term U.S. Treasury ETF\n    /// 2011-12-01   SPTS   SPDR Portfolio Short Term Treasury ETF\n    /// 2012-02-24   GOVT   iShares U.S. Treasury Bond ETF\n    /// </summary>\n    public class USTreasuriesETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the USTreasuriesETFUniverse class\n        /// </summary>\n        public USTreasuriesETFUniverse() :\n            base(\n                \"qc-us-treasuries-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"IEF\", new DateTime(2002, 7, 26)},\n                    {\"SHY\", new DateTime(2002, 7, 26)},\n                    {\"TLT\", new DateTime(2002, 7, 26)},\n                    {\"IEI\", new DateTime(2007, 1, 11)},\n                    {\"SHV\", new DateTime(2007, 1, 11)},\n                    {\"TLH\", new DateTime(2007, 1, 11)},\n                    {\"EDV\", new DateTime(2007, 12, 10)},\n                    {\"BIL\", new DateTime(2007, 5, 30)},\n                    {\"SPTL\", new DateTime(2007, 5, 30)},\n                    {\"TBT\", new DateTime(2008, 5, 1)},\n                    {\"TMF\", new DateTime(2009, 4, 16)},\n                    {\"TMV\", new DateTime(2009, 4, 16)},\n                    {\"TBF\", new DateTime(2009, 8, 20)},\n                    {\"VGSH\", new DateTime(2009, 11, 23)},\n                    {\"VGIT\", new DateTime(2009, 11, 23)},\n                    {\"VGLT\", new DateTime(2009, 11, 24)},\n                    {\"SCHO\", new DateTime(2010, 8, 6)},\n                    {\"SCHR\", new DateTime(2010, 8, 6)},\n                    {\"SPTS\", new DateTime(2011, 12, 1)},\n                    {\"GOVT\", new DateTime(2012, 2, 24)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Framework/Selection/VolatilityETFUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Selection\n{\n    /// <summary>\n    /// Universe Selection Model that adds the following Volatility ETFs at their inception date\n    /// 2010-02-11   SQQQ   ProShares UltraPro ShortQQQ\n    /// 2010-02-11   TQQQ   ProShares UltraProQQQ\n    /// 2010-11-30   TVIX   VelocityShares Daily 2x VIX Short Term ETN\n    /// 2011-01-04   VIXY   ProShares VIX Short-Term Futures ETF\n    /// 2011-05-05   SPLV   Invesco S&amp;P 500® Low Volatility ETF\n    /// 2011-10-04   SVXY   ProShares Short VIX Short-Term Futures\n    /// 2011-10-04   UVXY   ProShares Ultra VIX Short-Term Futures\n    /// 2011-10-20   EEMV   iShares Edge MSCI Min Vol Emerging Markets ETF\n    /// 2011-10-20   EFAV   iShares Edge MSCI Min Vol EAFE ETF\n    /// 2011-10-20   USMV   iShares Edge MSCI Min Vol USA ETF\n    /// </summary>\n    public class VolatilityETFUniverse : InceptionDateUniverseSelectionModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the VolatilityETFUniverse class\n        /// </summary>\n        public VolatilityETFUniverse() :\n            base(\n                \"qc-volatility-etf-basket\",\n                new Dictionary<string, DateTime>()\n                {\n                    {\"SQQQ\", new DateTime(2010, 2, 11)},\n                    {\"TQQQ\", new DateTime(2010, 2, 11)},\n                    {\"TVIX\", new DateTime(2010, 11, 30)},\n                    {\"VIXY\", new DateTime(2011, 1, 4)},\n                    {\"SPLV\", new DateTime(2011, 5, 5)},\n                    {\"SVXY\", new DateTime(2011, 10, 4)},\n                    {\"UVXY\", new DateTime(2011, 10, 4)},\n                    {\"EEMV\", new DateTime(2011, 10, 20)},\n                    {\"EFAV\", new DateTime(2011, 10, 20)},\n                    {\"USMV\", new DateTime(2011, 10, 20)}\n                }\n            )\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using 'AccumulativeInsightPortfolioConstructionModel.py' and 'ConstantAlphaModel'\n### generating a constant 'Insight'\n### </summary>\nclass AccumulativeInsightPortfolioRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, 0.25))\n        self.set_portfolio_construction(AccumulativeInsightPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n    def on_end_of_algorithm(self):\n        # holdings value should be 0.03 - to avoid price fluctuation issue we compare with 0.06 and 0.01\n        if (self.portfolio.total_holdings_value > self.portfolio.total_portfolio_value * 0.06\n            or self.portfolio.total_holdings_value < self.portfolio.total_portfolio_value * 0.01):\n            raise ValueError(\"Unexpected Total Holdings Value: \" + str(self.portfolio.total_holdings_value))\n"
  },
  {
    "path": "Algorithm.Python/AddAlphaModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using 'QCAlgorithm.add_alpha_model()'\n### </summary>\nclass AddAlphaModelAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        fb = Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA)\n        ibm = Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA)\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel([ spy, fb, ibm ]))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        self.add_alpha(OneTimeAlphaModel(spy))\n        self.add_alpha(OneTimeAlphaModel(fb))\n        self.add_alpha(OneTimeAlphaModel(ibm))\n\nclass OneTimeAlphaModel(AlphaModel):\n    def __init__(self, symbol):\n        self.symbol = symbol\n        self.triggered = False\n\n    def update(self, algorithm, data):\n        insights = []\n        if not self.triggered:\n            self.triggered = True\n            insights.append(Insight.price(\n                self.symbol,\n                Resolution.DAILY,\n                1,\n                InsightDirection.DOWN))\n        return insights\n"
  },
  {
    "path": "Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests that we receive the expected data when\n### we add future option contracts individually using <see cref=\"AddFutureOptionContract\"/>\n### </summary>\nclass AddFutureOptionContractDataStreamingRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.on_data_reached = False\n        self.invested = False\n        self.symbols_received = []\n        self.expected_symbols_received = []\n        self.data_received = {}\n\n        self.set_start_date(2020, 1, 4)\n        self.set_end_date(2020, 1, 8)\n\n        self.es20h20 = self.add_future_contract(\n            Symbol.create_future(Futures.Indices.SP_500_E_MINI, Market.CME, datetime(2020, 3, 20)),\n            Resolution.MINUTE).symbol\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(Futures.Indices.SP_500_E_MINI, Market.CME, datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Get option contract lists for 2020/01/05 (timedelta(days=1)) because Lean has local data for that date\n        option_chains = list(self.option_chain_provider.get_option_contract_list(self.es20h20, self.time + timedelta(days=1)))\n        option_chains += self.option_chain_provider.get_option_contract_list(self.es19m20, self.time + timedelta(days=1))\n\n        for option_contract in option_chains:\n            self.expected_symbols_received.append(self.add_future_option_contract(option_contract, Resolution.MINUTE).symbol)\n\n    def on_data(self, data: Slice):\n        if not data.has_data:\n            return\n\n        self.on_data_reached = True\n        has_option_quote_bars = False\n\n        for qb in data.quote_bars.values():\n            if qb.symbol.security_type != SecurityType.FUTURE_OPTION:\n                continue\n\n            has_option_quote_bars = True\n\n            self.symbols_received.append(qb.symbol)\n            if qb.symbol not in self.data_received:\n                self.data_received[qb.symbol] = []\n\n            self.data_received[qb.symbol].append(qb)\n\n        if self.invested or not has_option_quote_bars:\n            return\n\n        if data.contains_key(self.es20h20) and data.contains_key(self.es19m20):\n            self.set_holdings(self.es20h20, 0.2)\n            self.set_holdings(self.es19m20, 0.2)\n\n            self.invested = True\n\n    def on_end_of_algorithm(self):\n        self.symbols_received = list(set(self.symbols_received))\n        self.expected_symbols_received = list(set(self.expected_symbols_received))\n\n        if not self.on_data_reached:\n            raise AssertionError(\"OnData() was never called.\")\n        if len(self.symbols_received) != len(self.expected_symbols_received):\n            raise AssertionError(f\"Expected {len(self.expected_symbols_received)} option contracts Symbols, found {len(self.symbols_received)}\")\n\n        missing_symbols = [expected_symbol.value for expected_symbol in self.expected_symbols_received if expected_symbol not in self.symbols_received]\n        if any(missing_symbols):\n            raise AssertionError(f'Symbols: \"{\", \".join(missing_symbols)}\" were not found in OnData')\n\n        for expected_symbol in self.expected_symbols_received:\n            data = self.data_received[expected_symbol]\n            for data_point in data:\n                data_point.end_time = datetime(1970, 1, 1)\n\n            non_dupe_data_count = len(set(data))\n            if non_dupe_data_count < 1000:\n                raise AssertionError(f\"Received too few data points. Expected >=1000, found {non_dupe_data_count} for {expected_symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests that we only receive the option chain for a single future contract\n### in the option universe filter.\n### </summary>\nclass AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.invested = False\n        self.on_data_reached = False\n        self.option_filter_ran = False\n        self.symbols_received = []\n        self.expected_symbols_received = []\n        self.data_received = {}\n\n        self.set_start_date(2020, 1, 4)\n        self.set_end_date(2020, 1, 8)\n\n        self.es = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.MINUTE, Market.CME)\n        self.es.set_filter(lambda future_filter: future_filter.expiration(0, 365).expiration_cycle([3, 6]))\n\n        self.add_future_option(self.es.symbol, self.option_contract_universe_filter_function)\n\n    def option_contract_universe_filter_function(self, option_contracts: OptionFilterUniverse) -> OptionFilterUniverse:\n        self.option_filter_ran = True\n\n        expiry_dates = list(set([x.symbol.underlying.id.date for x in option_contracts]))\n        expiry = None if not any(expiry_dates) else expiry_dates[0]\n\n        symbols = [x.symbol.underlying for x in option_contracts]\n        symbol = None if not any(symbols) else symbols[0]\n\n        if expiry is None or symbol is None:\n            raise AssertionError(\"Expected a single Option contract in the chain, found 0 contracts\")\n\n        self.expected_symbols_received.extend([x.symbol for x in option_contracts])\n\n        return option_contracts\n\n    def on_data(self, data: Slice):\n        if not data.has_data:\n            return\n\n        self.on_data_reached = True\n        has_option_quote_bars = False\n\n        for qb in data.quote_bars.values():\n            if qb.symbol.security_type != SecurityType.FUTURE_OPTION:\n                continue\n\n            has_option_quote_bars = True\n\n            self.symbols_received.append(qb.symbol)\n            if qb.symbol not in self.data_received:\n                self.data_received[qb.symbol] = []\n\n            self.data_received[qb.symbol].append(qb)\n\n        if self.invested or not has_option_quote_bars:\n            return\n\n        for chain in sorted(data.option_chains.values(), key=lambda chain: chain.symbol.underlying.id.date):\n            future_invested = False\n            option_invested = False\n\n            for option in chain.contracts.keys():\n                if future_invested and option_invested:\n                    return\n\n                future = option.underlying\n\n                if not option_invested and data.contains_key(option):\n                    self.market_order(option, 1)\n                    self.invested = True\n                    option_invested = True\n\n                if not future_invested and data.contains_key(future):\n                    self.market_order(future, 1)\n                    self.invested = True\n                    future_invested = True\n\n    def on_end_of_algorithm(self):\n        super().on_end_of_algorithm()\n        self.symbols_received = list(set(self.symbols_received))\n        self.expected_symbols_received = list(set(self.expected_symbols_received))\n\n        if not self.option_filter_ran:\n            raise AssertionError(\"Option chain filter was never ran\")\n        if not self.on_data_reached:\n            raise AssertionError(\"OnData() was never called.\")\n        if len(self.symbols_received) != len(self.expected_symbols_received):\n            raise AssertionError(f\"Expected {len(self.expected_symbols_received)} option contracts Symbols, found {len(self.symbols_received)}\")\n\n        missing_symbols = [expected_symbol for expected_symbol in self.expected_symbols_received if expected_symbol not in self.symbols_received]\n        if any(missing_symbols):\n            raise AssertionError(f'Symbols: \"{\", \".join(missing_symbols)}\" were not found in OnData')\n\n        for expected_symbol in self.expected_symbols_received:\n            data = self.data_received[expected_symbol]\n            for data_point in data:\n                data_point.end_time = datetime(1970, 1, 1)\n\n            non_dupe_data_count = len(set(data))\n            if non_dupe_data_count < 1000:\n                raise AssertionError(f\"Received too few data points. Expected >=1000, found {non_dupe_data_count} for {expected_symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/AddFutureUniverseSelectionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to use the FutureUniverseSelectionModel to select futures contracts for a given underlying asset.\n### The model is set to update daily, and the algorithm ensures that the selected contracts meet specific criteria.\n### This also includes a check to ensure that only future contracts are added to the algorithm's universe.\n### </summary>\nclass AddFutureUniverseSelectionModelRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 10)\n        \n        self.set_universe_selection(FutureUniverseSelectionModel(\n            timedelta(days=1),\n            lambda time: [ Symbol.create(Futures.Indices.SP_500_E_MINI, SecurityType.FUTURE, Market.CME) ]\n        ))\n    \n    def on_securities_changed(self, changes):\n        if len(changes.added_securities) > 0:\n            for security in changes.added_securities:\n                if security.symbol.security_type != SecurityType.FUTURE:\n                    raise RegressionTestException(f\"Expected future security, but found '{security.symbol.security_type}'\")\n                if security.symbol.id.symbol != \"ES\":\n                    raise RegressionTestException(f\"Expected future symbol 'ES', but found '{security.symbol.id.symbol}'\")\n\n    def on_end_of_algorithm(self):\n        if len(self.active_securities) == 0:\n            raise RegressionTestException(\"No active securities found. Expected at least one active security\")"
  },
  {
    "path": "Algorithm.Python/AddOptionContractExpiresRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### We add an option contract using 'QCAlgorithm.add_option_contract' and place a trade, the underlying\n### gets deselected from the universe selection but should still be present since we manually added the option contract.\n### Later we call 'QCAlgorithm.remove_option_contract' and expect both option and underlying to be removed.\n### </summary>\nclass AddOptionContractExpiresRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 30)\n\n        self._expiration = datetime(2014, 6, 21)\n        self._option = None\n        self._traded = False\n\n        self._twx = Symbol.create(\"TWX\", SecurityType.EQUITY, Market.USA)\n\n        self.add_universe(\"my-daily-universe-name\", self.selector)\n\n    def selector(self, time):\n        return [ \"AAPL\" ]\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self._option == None:\n            chain = self.option_chain(self._twx)\n            options = sorted(chain, key=lambda x: x.id.symbol)\n\n            option = next((option\n                           for option in options\n                           if option.id.date == self._expiration and\n                           option.id.option_right == OptionRight.CALL and\n                           option.id.option_style == OptionStyle.AMERICAN), None)\n            if option != None:\n                self._option = self.add_option_contract(option).symbol\n\n        if self._option != None and self.securities[self._option].price != 0 and not self._traded:\n            self._traded = True\n            self.buy(self._option, 1)\n\n        if self.time > self._expiration and self.securities[self._twx].invested:\n                # we liquidate the option exercised position\n                self.liquidate(self._twx)\n"
  },
  {
    "path": "Algorithm.Python/AddOptionContractFromUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### We add an option contract using 'QCAlgorithm.add_option_contract' and place a trade, the underlying\n### gets deselected from the universe selection but should still be present since we manually added the option contract.\n### Later we call 'QCAlgorithm.remove_option_contract' and expect both option and underlying to be removed.\n### </summary>\nclass AddOptionContractFromUniverseRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 9)\n\n        self._expiration = datetime(2014, 6, 21)\n        self._security_changes = None\n        self._option = None\n        self._traded = False\n\n        self._twx = Symbol.create(\"TWX\", SecurityType.EQUITY, Market.USA)\n        self._aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.universe_settings.data_normalization_mode = DataNormalizationMode.RAW\n\n        self.add_universe(self.selector, self.selector)\n\n    def selector(self, fundamental):\n        if self.time <= datetime(2014, 6, 5):\n            return  [ self._twx ]\n        return [ self._aapl ]\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self._option != None and self.securities[self._option].price != 0 and not self._traded:\n            self._traded = True\n            self.buy(self._option, 1)\n\n        if self.time == datetime(2014, 6, 6, 14, 0, 0):\n            # liquidate & remove the option\n            self.remove_option_contract(self._option)\n\n    def on_securities_changed(self, changes):\n        # keep track of all removed and added securities\n        if self._security_changes == None:\n            self._security_changes = changes\n        else:\n            self._security_changes += changes\n\n        if any(security.symbol.security_type == SecurityType.OPTION for security in changes.added_securities):\n            return\n\n        for addedSecurity in changes.added_securities:\n            option_chain = self.option_chain(addedSecurity.symbol)\n            options = sorted(option_chain, key=lambda x: x.id.symbol)\n\n            option = next((option\n                           for option in options\n                           if option.id.date == self._expiration and\n                           option.id.option_right == OptionRight.CALL and\n                           option.id.option_style == OptionStyle.AMERICAN), None)\n\n            self.add_option_contract(option)\n\n            # just keep the first we got\n            if self._option == None:\n                self._option = option\n"
  },
  {
    "path": "Algorithm.Python/AddOptionUniverseSelectionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to use the OptionUniverseSelectionModel to select options contracts based on specified conditions.\n### The model is updated daily and selects different options based on the current date.\n### The algorithm ensures that only valid option contracts are selected for the universe.\n### </summary>\nclass AddOptionUniverseSelectionModelRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 6)\n        self.option_count = 0\n        \n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_universe_selection(OptionUniverseSelectionModel(\n            timedelta(days=1),\n            self.select_option_chain_symbols\n        ))\n    \n    def select_option_chain_symbols(self, utc_time):\n        new_york_time = Extensions.convert_from_utc(utc_time, TimeZones.NEW_YORK)\n        if new_york_time.date() < datetime(2014, 6, 6).date():\n            return [ Symbol.create(\"TWX\", SecurityType.OPTION, Market.USA) ]\n        \n        if new_york_time.date() >= datetime(2014, 6, 6).date():\n            return [ Symbol.create(\"AAPL\", SecurityType.OPTION, Market.USA) ]\n\n    def on_securities_changed(self, changes):\n        if len(changes.added_securities) > 0:\n            for security in changes.added_securities:\n                symbol = security.symbol.underlying if security.symbol.underlying else security.Symbol\n                if symbol.value != \"AAPL\" and symbol.value != \"TWX\":\n                    raise RegressionTestException(f\"Unexpected security {security.Symbol}\")\n                \n                if security.symbol.security_type == SecurityType.OPTION:\n                    self.option_count += 1\n\n    def on_end_of_algorithm(self):\n        if len(self.active_securities) == 0:\n            raise RegressionTestException(\"No active securities found. Expected at least one active security\")\n        if self.option_count == 0:\n            raise RegressionTestException(\"The option count should be greater than 0\")"
  },
  {
    "path": "Algorithm.Python/AddRemoveSecurityRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates the runtime addition and removal of securities from your algorithm.\n### With LEAN it is possible to add and remove securities after the initialization.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"assets\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass AddRemoveSecurityRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n\n        self._last_action = None\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if self._last_action is not None and self._last_action.date() == self.time.date():\n            return\n\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", .5)\n            self._last_action = self.time\n\n        if self.time.weekday() == 1:\n            self.add_equity(\"AIG\")\n            self.add_equity(\"BAC\")\n            self._last_action = self.time\n\n        if self.time.weekday() == 2:\n            self.set_holdings(\"AIG\", .25)\n            self.set_holdings(\"BAC\", .25)\n            self._last_action = self.time\n\n        if self.time.weekday() == 3:\n            self.remove_security(\"AIG\")\n            self.remove_security(\"BAC\")\n            self._last_action = self.time\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.SUBMITTED:\n            self.debug(\"{0}: Submitted: {1}\".format(self.time, self.transactions.get_order_by_id(order_event.order_id)))\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(\"{0}: Filled: {1}\".format(self.time, self.transactions.get_order_by_id(order_event.order_id)))\n"
  },
  {
    "path": "Algorithm.Python/AddRiskManagementAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using 'QCAlgorithm.add_risk_management(IRiskManagementModel)'\n### </summary>\nclass AddRiskManagementAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        # Both setting methods should work\n        risk_model = CompositeRiskManagementModel(MaximumDrawdownPercentPortfolio(0.02))\n        risk_model.add_risk_management(MaximumUnrealizedProfitPercentPerSecurity(0.01))\n\n        self.set_risk_management(MaximumDrawdownPercentPortfolio(0.02))\n        self.add_risk_management(MaximumUnrealizedProfitPercentPerSecurity(0.01))\n\n"
  },
  {
    "path": "Algorithm.Python/AddUniverseSelectionModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using 'QCAlgorithm.add_universe_selection(IUniverseSelectionModel)'\n### </summary>\nclass AddUniverseSelectionModelAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,8)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # set algorithm framework models\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        self.set_universe_selection(ManualUniverseSelectionModel([ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]))\n        self.add_universe_selection(ManualUniverseSelectionModel([ Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA) ]))\n        self.add_universe_selection(ManualUniverseSelectionModel(\n                Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA), # duplicate will be ignored\n                Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA)))\n\n    def on_end_of_algorithm(self):\n        if self.universe_manager.count != 3:\n            raise ValueError(\"Unexpected universe count\")\n        if self.universe_manager.active_securities.count != 3:\n            raise ValueError(\"Unexpected active securities\")\n"
  },
  {
    "path": "Algorithm.Python/AlgorithmModeAndDeploymentTargetAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm asserting the correct values for the deployment target and algorithm mode.\n### </summary>\nclass AlgorithmModeAndDeploymentTargetAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        #translate commented code from c# to python\n        self.debug(f\"Algorithm Mode: {self.algorithm_mode}. Is Live Mode: {self.live_mode}. Deployment Target: {self.deployment_target}.\")\n\n        if self.algorithm_mode != AlgorithmMode.BACKTESTING:\n            raise AssertionError(f\"Algorithm mode is not backtesting. Actual: {self.algorithm_mode}\")\n\n        if self.live_mode:\n            raise AssertionError(\"Algorithm should not be live\")\n\n        if self.deployment_target != DeploymentTarget.LOCAL_PLATFORM:\n            raise AssertionError(f\"Algorithm deployment target is not local. Actual{self.deployment_target}\")\n\n        # For a live deployment these checks should pass:\n        # if self.algorithm_mode != AlgorithmMode.LIVE: raise AssertionError(\"Algorithm mode is not live\")\n        # if not self.live_mode: raise AssertionError(\"Algorithm should be live\")\n\n        # For a cloud deployment these checks should pass:\n        # if self.deployment_target != DeploymentTarget.CLOUD_PLATFORM: raise AssertionError(\"Algorithm deployment target is not cloud\")\n\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/AllShortableSymbolsCoarseSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests filtering in coarse selection by shortable quantity\n### </summary>\nclass AllShortableSymbolsCoarseSelectionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self._20140325 = datetime(2014, 3, 25)\n        self._20140326 = datetime(2014, 3, 26)\n        self._20140327 = datetime(2014, 3, 27)\n        self._20140328 = datetime(2014, 3, 28)\n        self._20140329 = datetime(2014, 3, 29)\n        self.last_trade_date = date(1,1,1)\n\n        self._aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n        self._bac = Symbol.create(\"BAC\", SecurityType.EQUITY, Market.USA)\n        self._gme = Symbol.create(\"GME\", SecurityType.EQUITY, Market.USA)\n        self._goog = Symbol.create(\"GOOG\", SecurityType.EQUITY, Market.USA)\n        self._qqq = Symbol.create(\"QQQ\", SecurityType.EQUITY, Market.USA)\n        self._spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n\n        self.coarse_selected = { self._20140325: False, self._20140326: False, self._20140327:False, self._20140328:False }\n        self.expected_symbols = { self._20140325: [ self._bac, self._qqq, self._spy ],\n                                self._20140326: [ self._spy ],\n                                self._20140327: [ self._aapl, self._bac, self._gme, self._qqq, self._spy ],\n                                self._20140328: [ self._goog ],\n                                self._20140329: []}\n\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 3, 29)\n        self.set_cash(10000000)\n        self.shortable_provider = RegressionTestShortableProvider()\n        self.security = self.add_equity(self._spy)\n\n        self.add_universe(self.coarse_selection)\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_brokerage_model(AllShortableSymbolsRegressionAlgorithmBrokerageModel(self.shortable_provider))\n\n    def on_data(self, data):\n        if self.time.date() == self.last_trade_date:\n            return\n\n        for (symbol, security) in {x.key: x.value for x in sorted(self.active_securities, key = lambda kvp:kvp.key)}.items():\n            if security.invested:\n                continue\n            shortable_quantity = security.shortable_provider.shortable_quantity(symbol, self.time)\n            if not shortable_quantity:\n                raise AssertionError(f\"Expected {symbol} to be shortable on {self.time.strftime('%Y%m%d')}\")\n\n            \"\"\"\n            Buy at least once into all Symbols. Since daily data will always use\n            MOO orders, it makes the testing of liquidating buying into Symbols difficult.\n            \"\"\"\n            self.market_order(symbol, -shortable_quantity)\n            self.last_trade_date = self.time.date()\n\n    def coarse_selection(self, coarse):\n        shortable_symbols = self.shortable_provider.all_shortable_symbols(self.time)\n        selected_symbols = list(sorted(filter(lambda x: (x in shortable_symbols.keys()) and (shortable_symbols[x] >= 500), map(lambda x: x.symbol, coarse)), key= lambda x: x.value))\n\n        expected_missing = 0\n        if self.time.date() == self._20140327.date():\n            gme = Symbol.create(\"GME\", SecurityType.EQUITY, Market.USA)\n            if gme not in shortable_symbols.keys():\n                raise AssertionError(\"Expected unmapped GME in shortable symbols list on 2014-03-27\")\n            if \"GME\" not in list(map(lambda x: x.symbol.value, coarse)):\n                raise AssertionError(\"Expected mapped GME in coarse symbols on 2014-03-27\")\n\n            expected_missing = 1\n\n        missing = list(filter(lambda x: x not in selected_symbols, self.expected_symbols[self.time]))\n        if len(missing) != expected_missing:\n            raise AssertionError(f\"Expected Symbols selected on {self.time.strftime('%Y%m%d')} to match expected Symbols, but the following Symbols were missing: {', '.join(list(map(lambda x:x.value, missing)))}\")\n\n        self.coarse_selected[self.time] = True\n        return selected_symbols\n\n    def on_end_of_algorithm(self):\n        if not all(x for x in self.coarse_selected.values()):\n            raise AssertionError(f\"Expected coarse selection on all dates, but didn't run on: {', '.join(list(map(lambda x: x[0].strftime('%Y%m%d'), filter(lambda x:not x[1], self.coarse_selected.items()))))}\")\n\nclass AllShortableSymbolsRegressionAlgorithmBrokerageModel(DefaultBrokerageModel):\n    def __init__(self, shortable_provider):\n        self.shortable_provider = shortable_provider\n        super().__init__()\n\n    def get_shortable_provider(self, security):\n        return self.shortable_provider\n\nclass RegressionTestShortableProvider(LocalDiskShortableProvider):\n    def __init__(self):\n        super().__init__(\"testbrokerage\")\n\n    \"\"\"\n    Gets a list of all shortable Symbols, including the quantity shortable as a Dictionary.\n    \"\"\"\n    def all_shortable_symbols(self, localtime):\n        shortable_data_directory = os.path.join(Globals.data_folder, \"equity\", Market.USA, \"shortable\", self.brokerage)\n        all_symbols = {}\n\n        \"\"\"\n        Check backwards up to one week to see if we can source a previous file.\n        If not, then we return a list of all Symbols with quantity set to zero.\n        \"\"\"\n        i = 0\n        while i <= 7:\n            shortable_list_file = os.path.join(shortable_data_directory, \"dates\", f\"{(localtime - timedelta(days=i)).strftime('%Y%m%d')}.csv\")\n\n            for line in Extensions.read_lines(self.data_provider, shortable_list_file):\n                csv = line.split(',')\n                ticker = csv[0]\n\n                symbol = Symbol(SecurityIdentifier.generate_equity(ticker, Market.USA, mapping_resolve_date = localtime), ticker)\n                quantity = int(csv[1])\n                all_symbols[symbol] = quantity\n\n            if len(all_symbols) > 0:\n                return all_symbols\n\n            i += 1\n\n        # Return our empty dictionary if we did not find a file to extract\n        return all_symbols\n"
  },
  {
    "path": "Algorithm.Python/Alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport scipy.stats as sp\nfrom Risk.NullRiskManagementModel import NullRiskManagementModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\n\nclass ContingentClaimsAnalysisDefaultPredictionAlpha(QCAlgorithm):\n    ''' Contingent Claim Analysis is put forth by Robert Merton, recepient of the Noble Prize in Economics in 1997 for his work in contributing to\n    Black-Scholes option pricing theory, which says that the equity market value of stockholders’ equity is given by the Black-Scholes solution\n    for a European call option. This equation takes into account Debt, which in CCA is the equivalent to a strike price in the BS solution. The probability\n    of default on corporate debt can be calculated as the N(-d2) term, where d2 is a function of the interest rate on debt(µ), face value of the debt (B), value of the firm's assets (V),\n    standard deviation of the change in a firm's asset value (σ), the dividend and interest payouts due (D), and the time to maturity of the firm's debt(τ). N(*) is the cumulative\n    distribution function of a standard normal distribution, and calculating N(-d2) gives us the probability of the firm's assets being worth less\n    than the debt of the company at the time that the debt reaches maturity -- that is, the firm doesn't have enough in assets to pay off its debt and defaults.\n\n    We use a Fine/Coarse Universe Selection model to select small cap stocks, who we postulate are more likely to default\n    on debt in general than blue-chip companies, and extract Fundamental data to plug into the CCA formula.\n    This Alpha emits insights based on whether or not a company is likely to default given its probability of default vs a default probability threshold that we set arbitrarily.\n\n    Prob. default (on principal B at maturity T) = Prob(VT < B) = 1 - N(d2) = N(-d2) where -d2(µ) = -{ln(V/B) + [(µ - D) - ½σ2]τ}/ σ √τ.\n        N(d) = (univariate) cumulative standard normal distribution function (from -inf to d)\n        B = face value (principal) of the debt\n        D = dividend + interest payout\n        V = value of firm’s assets\n        σ (sigma) = standard deviation of firm value changes (returns in V)\n        τ (tau)  = time to debt’s maturity\n        µ (mu) = interest rate\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    sourced so the community and client funds can see an example of an alpha.'''\n\n    def initialize(self):\n\n        ## Set requested data resolution and variables to help with Universe Selection control\n        self.universe_settings.resolution = Resolution.DAILY\n        self.month = -1\n\n        ## Declare single variable to be passed in multiple places -- prevents issue with conflicting start dates declared in different places\n        self.set_start_date(2018,1,1)\n        self.set_cash(100000)\n\n        ## SPDR Small Cap ETF is a better benchmark than the default SP500\n        self.set_benchmark('IJR')\n\n        ## Set Universe Selection Model\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(self.coarse_selection_function, self.fine_selection_function))\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n        ## Set CCA Alpha Model\n        self.set_alpha(ContingentClaimsAnalysisAlphaModel())\n\n        ## Set Portfolio Construction Model\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\n    def coarse_selection_function(self, coarse):\n        ## Boolean controls so that our symbol universe is only updated once per month\n        if self.time.month == self.month:\n            return Universe.UNCHANGED\n        self.month = self.time.month\n\n        ## Sort by dollar volume, lowest to highest\n        sorted_by_dollar_volume = sorted([x for x in coarse if x.has_fundamental_data],\n            key=lambda x: x.dollar_volume, reverse=True)\n\n        ## Return smallest 750 -- idea is that smaller companies are most likely to go bankrupt than blue-chip companies\n        ## Filter for assets with fundamental data\n        return [x.symbol for x in sorted_by_dollar_volume[:750]]\n\n    def fine_selection_function(self, fine):\n\n            def is_valid(x):\n                statement = x.financial_statements\n                sheet = statement.balance_sheet\n                total_assets = sheet.total_assets\n                ratios = x.operation_ratios\n\n                return total_assets.one_month > 0 and \\\n                        total_assets.three_months > 0 and \\\n                        total_assets.six_months  > 0 and \\\n                        total_assets.twelve_months > 0 and \\\n                        sheet.current_liabilities.twelve_months > 0 and \\\n                        sheet.interest_payable.twelve_months > 0 and \\\n                        ratios.total_assets_growth.one_year > 0 and \\\n                        statement.income_statement.gross_dividend_payment.twelve_months > 0 and \\\n                        ratios.roa.one_year > 0\n\n            return [x.symbol for x in sorted(fine, key=lambda x: is_valid(x))]\n\n\nclass ContingentClaimsAnalysisAlphaModel(AlphaModel):\n\n    def __init__(self, *args, **kwargs):\n        self.probability_of_default_by_symbol = {}\n        self.default_threshold = kwargs['default_threshold'] if 'default_threshold' in kwargs else 0.25\n\n    def update(self, algorithm, data):\n        '''Updates this alpha model with the latest data from the algorithm.\n        This is called each time the algorithm receives data for subscribed securities\n        Args:\n            algorithm: The algorithm instance\n            data: The new data available\n        Returns:\n            The new insights generated'''\n\n        ## Build a list to hold our insights\n        insights = []\n\n        for symbol, pod in self.probability_of_default_by_symbol.items():\n\n            ## If Prob. of Default is greater than our set threshold, then emit an insight indicating that this asset is trending downward\n            if pod >= self.default_threshold and pod != 1.0:\n                insights.append(Insight.price(symbol, timedelta(30), InsightDirection.DOWN, pod, None))\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n\n        for removed in changes.removed_securities:\n            self.probability_of_default_by_symbol.pop(removed.symbol, None)\n\n        # initialize data for added securities\n        symbols = [ x.symbol for x in changes.added_securities ]\n\n        for symbol in symbols:\n            if symbol not in self.probability_of_default_by_symbol:\n                ## CCA valuation\n                pod = self.get_probability_of_default(algorithm, symbol)\n                if pod is not None:\n                    self.probability_of_default_by_symbol[symbol] = pod\n\n    def get_probability_of_default(self, algorithm, symbol):\n        '''This model applies options pricing theory, Black-Scholes specifically,\n        to fundamental data to give the probability of a default'''\n        security = algorithm.securities[symbol]\n        if security.fundamentals is None or security.fundamentals.financial_statements is None or security.fundamentals.operation_ratios is None:\n            return None\n\n        statement = security.fundamentals.financial_statements\n        sheet = statement.balance_sheet\n        total_assets = sheet.total_assets\n\n        tau = 360   ## Days\n        mu = security.fundamentals.operation_ratios.roa.one_year\n        V = total_assets.twelve_months\n        B = sheet.current_liabilities.twelve_months\n        D = statement.income_statement.gross_dividend_payment.twelve_months + sheet.interest_payable.twelve_months\n\n        series = pd.Series(\n            [\n                total_assets.one_month,\n                total_assets.three_months,\n                total_assets.six_months,\n                V\n            ])\n        sigma = series.iloc[series.nonzero()[0]]\n        sigma = np.std(sigma.pct_change()[1:len(sigma)])\n\n        d2 = ((np.log(V) - np.log(B)) + ((mu - D) - 0.5*sigma**2.0)*tau)/ (sigma*np.sqrt(tau))\n        return sp.norm.cdf(-d2)\n"
  },
  {
    "path": "Algorithm.Python/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n'''\n    Energy prices, especially Oil and Natural Gas, are in general fairly correlated,\n    meaning they typically move in the same direction as an overall trend. This Alpha\n    uses this idea and implements an Alpha Model that takes Natural Gas ETF price\n    movements as a leading indicator for Crude Oil ETF price movements. We take the\n    Natural Gas/Crude Oil ETF pair with the highest historical price correlation and\n    then create insights for Crude Oil depending on whether or not the Natural Gas ETF price change\n    is above/below a certain threshold that we set (arbitrarily).\n\n\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    sourced so the community and client funds can see an example of an alpha.\n'''\n\nfrom AlgorithmImports import *\n\nclass GasAndCrudeOilEnergyCorrelationAlpha(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2018, 1, 1)   #Set Start Date\n        self.set_cash(100000)            #Set Strategy Cash\n\n        natural_gas = [Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in ['UNG','BOIL','FCG']]\n        crude_oil = [Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in ['USO','UCO','DBO']]\n\n        ## Set Universe Selection\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_universe_selection( ManualUniverseSelectionModel(natural_gas + crude_oil) )\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        ## Custom Alpha Model\n        self.set_alpha(PairsAlphaModel(leading = natural_gas, following = crude_oil, history_days = 90, resolution = Resolution.MINUTE))\n\n        ## Equal-weight our positions, in this case 100% in USO\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(resolution = Resolution.MINUTE))\n\n        ## Immediate Execution Fill Model\n        self.set_execution(CustomExecutionModel())\n\n        ## Null Risk-Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(f'Purchased Stock: {order_event.symbol}')\n\n    def on_end_of_algorithm(self):\n        for kvp in self.portfolio:\n            if kvp.value.invested:\n                self.log(f'Invested in: {kvp.key}')\n\n\nclass PairsAlphaModel(AlphaModel):\n    '''This Alpha model assumes that the ETF for natural gas is a good leading-indicator\n        of the price of the crude oil ETF. The model will take in arguments for a threshold\n        at which the model triggers an insight, the length of the look-back period for evaluating\n        rate-of-change of UNG prices, and the duration of the insight'''\n\n    def __init__(self, *args, **kwargs):\n        self.leading = kwargs.get('leading', [])\n        self.following = kwargs.get('following', [])\n        self.history_days = kwargs.get('history_days', 90) ## In days\n        self.lookback = kwargs.get('lookback', 5)\n        self.resolution = kwargs.get('resolution', Resolution.HOUR)\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), 5) ## Arbitrary\n        self.difference_trigger = kwargs.get('difference_trigger', 0.75)\n        self._symbol_data_by_symbol = {}\n        self.next_update = None\n\n    def update(self, algorithm, data):\n\n        if (self.next_update is None) or (algorithm.time > self.next_update):\n            self.correlation_pairs_selection()\n            self.next_update = algorithm.time + timedelta(30)\n\n        magnitude = round(self.pairs[0].rate_of_return / 100, 6)\n\n        ## Check if Natural Gas returns are greater than the threshold we've set\n        if self.pairs[0].rate_of_return > self.difference_trigger:\n            return [Insight.price(self.pairs[1].symbol, self.prediction_interval, InsightDirection.UP, magnitude)]\n        if self.pairs[0].rate_of_return < -self.difference_trigger:\n            return [Insight.price(self.pairs[1].symbol, self.prediction_interval, InsightDirection.DOWN, magnitude)]\n\n        return []\n\n    def correlation_pairs_selection(self):\n        ## Get returns for each natural gas/oil ETF\n        daily_return = {}\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            daily_return[symbol] = symbol_data.daily_return_array\n\n        ## Estimate coefficients of different correlation measures\n        tau = pd.DataFrame.from_dict(daily_return).corr(method='kendall')\n\n        ## Calculate the pair with highest historical correlation\n        max_corr = -1\n        for x in self.leading:\n            df = tau[[x]].loc[self.following]\n            corr = float(df.max())\n            if corr > max_corr:\n                self.pairs = (\n                    self._symbol_data_by_symbol[x],\n                    self._symbol_data_by_symbol[df.idxmax()[0]])\n                max_corr = corr\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Event fired each time the we add/remove securities from the data feed\n        Args:\n            algorithm: The algorithm instance that experienced the change in securities\n            changes: The security additions and removals from the algorithm'''\n        for removed in changes.removed_securities:\n            symbol_data = self._symbol_data_by_symbol.pop(removed.symbol, None)\n            if symbol_data is not None:\n                symbol_data.remove_consolidators(algorithm)\n\n        # initialize data for added securities\n        symbols = [ x.symbol for x in changes.added_securities ]\n        history = algorithm.history(symbols, self.history_days + 1, Resolution.DAILY)\n        if history.empty: return\n\n        tickers = history.index.levels[0]\n        for ticker in tickers:\n            symbol = SymbolCache.get_symbol(ticker)\n            if symbol not in self._symbol_data_by_symbol:\n                symbol_data = SymbolData(symbol, self.history_days, self.lookback, self.resolution, algorithm)\n                self._symbol_data_by_symbol[symbol] = symbol_data\n                symbol_data.update_daily_rate_of_change(history.loc[ticker])\n\n        history = algorithm.history(symbols, self.lookback, self.resolution)\n        if history.empty: return\n        for ticker in tickers:\n            symbol = SymbolCache.get_symbol(ticker)\n            if symbol in self._symbol_data_by_symbol:\n                self._symbol_data_by_symbol[symbol].update_rate_of_change(history.loc[ticker])\n\nclass SymbolData:\n    '''Contains data specific to a symbol required by this model'''\n    def __init__(self, symbol, daily_lookback, lookback, resolution, algorithm):\n        self.symbol = symbol\n\n        self.daily_return = RateOfChangePercent(f'{symbol}.daily_rocp({1})', 1)\n        self.daily_consolidator = algorithm.resolve_consolidator(symbol, Resolution.DAILY)\n        self.daily_return_history = RollingWindow(daily_lookback)\n\n        def updatedaily_return_history(s, e):\n            self.daily_return_history.add(e)\n\n        self.daily_return.updated += updatedaily_return_history\n        algorithm.register_indicator(symbol, self.daily_return, self.daily_consolidator)\n\n        self.rocp = RateOfChangePercent(f'{symbol}.rocp({lookback})', lookback)\n        self.consolidator = algorithm.resolve_consolidator(symbol, resolution)\n        algorithm.register_indicator(symbol, self.rocp, self.consolidator)\n\n    def remove_consolidators(self, algorithm):\n        algorithm.subscription_manager.remove_consolidator(self.symbol, self.consolidator)\n        algorithm.subscription_manager.remove_consolidator(self.symbol, self.daily_consolidator)\n\n    def update_rate_of_change(self, history):\n        for tuple in history.itertuples():\n            self.rocp.update(tuple.Index, tuple.close)\n\n    def update_daily_rate_of_change(self, history):\n        for tuple in history.itertuples():\n            self.daily_return.update(tuple.Index, tuple.close)\n\n    @property\n    def rate_of_return(self):\n        return float(self.rocp.current.value)\n\n    @property\n    def daily_return_array(self):\n        return pd.Series({x.end_time: x.value for x in self.daily_return_history})\n\n    def __repr__(self):\n        return f\"{self.rocp.name} - {self.daily_return}\"\n\n\nclass CustomExecutionModel(ExecutionModel):\n    '''Provides an implementation of IExecutionModel that immediately submits market orders to achieve the desired portfolio targets'''\n\n    def __init__(self):\n        '''Initializes a new instance of the ImmediateExecutionModel class'''\n        self.targets_collection = PortfolioTargetCollection()\n        self.previous_symbol = None\n\n    def execute(self, algorithm, targets):\n        '''Immediately submits orders for the specified portfolio targets.\n        Args:\n            algorithm: The algorithm instance\n            targets: The portfolio targets to be ordered'''\n\n        self.targets_collection.add_range(targets)\n\n        for target in self.targets_collection.order_by_margin_impact(algorithm):\n            open_quantity = sum([x.quantity for x in algorithm.transactions.get_open_orders(target.symbol)])\n            existing = algorithm.securities[target.symbol].holdings.quantity + open_quantity\n            quantity = target.quantity - existing\n            ## Liquidate positions in Crude Oil ETF that is no longer part of the highest-correlation pair\n            if (str(target.symbol) != str(self.previous_symbol)) and (self.previous_symbol is not None):\n                algorithm.liquidate(self.previous_symbol)\n            if quantity != 0:\n                algorithm.market_order(target.symbol, quantity)\n                self.previous_symbol = target.symbol\n        self.targets_collection.clear_fulfilled(algorithm)\n"
  },
  {
    "path": "Algorithm.Python/Alphas/GlobalEquityMeanReversionIBSAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# Equity indices exhibit mean reversion in daily returns. The Internal Bar Strength indicator (IBS),\n# which relates the closing price of a security to its daily range can be used to identify overbought\n# and oversold securities.\n#\n# This alpha ranks 33 global equity ETFs on its IBS value the previous day and predicts for the following day\n# that the ETF with the highest IBS value will decrease in price, and the ETF with the lowest IBS value\n# will increase in price.\n#\n# Source: Kakushadze, Zura, and Juan Andrés Serur. “4. Exchange-Traded Funds (ETFs).” 151 Trading Strategies, Palgrave Macmillan, 2018, pp. 90–91.\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n#\n\nclass GlobalEquityMeanReversionIBSAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)\n\n        self.set_cash(100000)\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # Global Equity ETF tickers\n        tickers = [\"ECH\",\"EEM\",\"EFA\",\"EPHE\",\"EPP\",\"EWA\",\"EWC\",\"EWG\",\n                   \"EWH\",\"EWI\",\"EWJ\",\"EWL\",\"EWM\",\"EWM\",\"EWO\",\"EWP\",\n                   \"EWQ\",\"EWS\",\"EWT\",\"EWU\",\"EWY\",\"EWZ\",\"EZA\",\"FXI\",\n                   \"GXG\",\"IDX\",\"ILF\",\"EWM\",\"QQQ\",\"RSX\",\"SPY\",\"THD\"]\n\n        symbols = [Symbol.create(ticker, SecurityType.EQUITY, Market.USA) for ticker in tickers]\n\n        # Manually curated universe\n        self.universe_settings.resolution = Resolution.DAILY\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n\n        # Use GlobalEquityMeanReversionAlphaModel to establish insights\n        self.set_alpha(MeanReversionIBSAlphaModel())\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        # Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass MeanReversionIBSAlphaModel(AlphaModel):\n    '''Uses ranking of Internal Bar Strength (IBS) to create direction prediction for insights'''\n\n    def __init__(self, *args, **kwargs):\n        lookback = kwargs['lookback'] if 'lookback' in kwargs else 1\n        resolution = kwargs['resolution'] if 'resolution' in kwargs else Resolution.DAILY\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(resolution), lookback)\n        self.number_of_stocks = kwargs['number_of_stocks'] if 'number_of_stocks' in kwargs else 2\n\n    def update(self, algorithm, data):\n\n        insights = []\n        symbols_ibs = dict()\n        returns = dict()\n\n        for security in algorithm.active_securities.values:\n            if security.has_data:\n                high = security.high\n                low = security.low\n                hilo = high - low\n\n                # Do not consider symbol with zero open and avoid division by zero\n                if security.open * hilo != 0:\n                    # Internal bar strength (IBS)\n                    symbols_ibs[security.symbol] = (security.close - low)/hilo\n                    returns[security.symbol] = security.close/security.open-1\n\n        # Number of stocks cannot be higher than half of symbols_ibs length\n        number_of_stocks = min(int(len(symbols_ibs)/2), self.number_of_stocks)\n        if number_of_stocks == 0:\n            return []\n\n        # Rank securities with the highest IBS value\n        ordered = sorted(symbols_ibs.items(), key=lambda kv: (round(kv[1], 6), kv[0]), reverse=True)\n        high_ibs = dict(ordered[0:number_of_stocks])   # Get highest IBS\n        low_ibs = dict(ordered[-number_of_stocks:])    # Get lowest IBS\n\n        # Emit \"down\" insight for the securities with the highest IBS value\n        for key,value in high_ibs.items():\n            insights.append(Insight.price(key, self.prediction_interval, InsightDirection.DOWN, abs(returns[key]), None))\n\n        # Emit \"up\" insight for the securities with the lowest IBS value\n        for key,value in low_ibs.items():\n            insights.append(Insight.price(key, self.prediction_interval, InsightDirection.UP, abs(returns[key]), None))\n\n        return insights\n"
  },
  {
    "path": "Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\nfrom math import ceil\nfrom itertools import chain\n\nclass GreenblattMagicFormulaAlpha(QCAlgorithm):\n    ''' Alpha Streams: Benchmark Alpha: Pick stocks according to Joel Greenblatt's Magic Formula\n    This alpha picks stocks according to Joel Greenblatt's Magic Formula.\n    First, each stock is ranked depending on the relative value of the ratio EV/EBITDA. For example, a stock\n    that has the lowest EV/EBITDA ratio in the security universe receives a score of one while a stock that has\n    the tenth lowest EV/EBITDA score would be assigned 10 points.\n\n    Then, each stock is ranked and given a score for the second valuation ratio, Return on Capital (ROC).\n    Similarly, a stock that has the highest ROC value in the universe gets one score point.\n    The stocks that receive the lowest combined score are chosen for insights.\n\n    Source: Greenblatt, J. (2010) The Little Book That Beats the Market\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    sourced so the community and client funds can see an example of an alpha.'''\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)\n        self.set_cash(100000)\n\n        #Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # select stocks using MagicFormulaUniverseSelectionModel\n        self.set_universe_selection(GreenBlattMagicFormulaUniverseSelectionModel())\n\n        # Use MagicFormulaAlphaModel to establish insights\n        self.set_alpha(RateOfChangeAlphaModel())\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\nclass RateOfChangeAlphaModel(AlphaModel):\n    '''Uses Rate of Change (ROC) to create magnitude prediction for insights.'''\n\n    def __init__(self, *args, **kwargs):\n        self.lookback = kwargs.get('lookback', 1)\n        self.resolution = kwargs.get('resolution', Resolution.DAILY)\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), self.lookback)\n        self._symbol_data_by_symbol = {}\n\n    def update(self, algorithm, data):\n        insights = []\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            if symbol_data.can_emit:\n                insights.append(Insight.price(symbol, self.prediction_interval, InsightDirection.UP, symbol_data.returns, None))\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n\n        # clean up data for removed securities\n        for removed in changes.removed_securities:\n            symbol_data = self._symbol_data_by_symbol.pop(removed.symbol, None)\n            if symbol_data is not None:\n                symbol_data.remove_consolidators(algorithm)\n\n        # initialize data for added securities\n        symbols = [ x.symbol for x in changes.added_securities\n            if x.symbol not in self._symbol_data_by_symbol]\n\n        history = algorithm.history(symbols, self.lookback, self.resolution)\n        if history.empty: return\n\n        for symbol in symbols:\n            symbol_data = SymbolData(algorithm, symbol, self.lookback, self.resolution)\n            self._symbol_data_by_symbol[symbol] = symbol_data\n            symbol_data.warm_up_indicators(history.loc[symbol])\n\n\nclass SymbolData:\n    '''Contains data specific to a symbol required by this model'''\n    def __init__(self, algorithm, symbol, lookback, resolution):\n        self.previous = 0\n        self._symbol = symbol\n        self.roc = RateOfChange(f'{symbol}.roc({lookback})', lookback)\n        self.consolidator = algorithm.resolve_consolidator(symbol, resolution)\n        algorithm.register_indicator(symbol, self.roc, self.consolidator)\n\n    def remove_consolidators(self, algorithm):\n        algorithm.subscription_manager.remove_consolidator(self._symbol, self.consolidator)\n\n    def warm_up_indicators(self, history):\n        for tuple in history.itertuples():\n            self.roc.update(tuple.Index, tuple.close)\n\n    @property\n    def returns(self):\n        return self.roc.current.value\n\n    @property\n    def can_emit(self):\n        if self.previous == self.roc.samples:\n            return False\n\n        self.previous = self.roc.samples\n        return self.roc.is_ready\n\n    def __str__(self, **kwargs):\n        return f'{self.roc.name}: {(1 + self.returns)**252 - 1:.2%}'\n\n\nclass GreenBlattMagicFormulaUniverseSelectionModel(FundamentalUniverseSelectionModel):\n    '''Defines a universe according to Joel Greenblatt's Magic Formula, as a universe selection model for the framework algorithm.\n       From the universe QC500, stocks are ranked using the valuation ratios, Enterprise Value to EBITDA (EV/EBITDA) and Return on Assets (ROA).\n    '''\n\n    def __init__(self,\n                 filter_fine_data = True,\n                 universe_settings = None):\n        '''Initializes a new default instance of the MagicFormulaUniverseSelectionModel'''\n        super().__init__(filter_fine_data, universe_settings)\n\n        # Number of stocks in Coarse Universe\n        self.number_of_symbols_coarse = 500\n        # Number of sorted stocks in the fine selection subset using the valuation ratio, EV to EBITDA (EV/EBITDA)\n        self.number_of_symbols_fine = 20\n        # Final number of stocks in security list, after sorted by the valuation ratio, Return on Assets (ROA)\n        self.number_of_symbols_in_portfolio = 10\n\n        self.last_month = -1\n        self.dollar_volume_by_symbol = {}\n\n    def select_coarse(self, algorithm, coarse):\n        '''Performs coarse selection for constituents.\n        The stocks must have fundamental data'''\n        month = algorithm.time.month\n        if month == self.last_month:\n            return Universe.UNCHANGED\n        self.last_month = month\n\n        # sort the stocks by dollar volume and take the top 1000\n        top = sorted([x for x in coarse if x.has_fundamental_data],\n                    key=lambda x: x.dollar_volume, reverse=True)[:self.number_of_symbols_coarse]\n\n        self.dollar_volume_by_symbol = { i.symbol: i.dollar_volume for i in top }\n\n        return list(self.dollar_volume_by_symbol.keys())\n\n\n    def select_fine(self, algorithm, fine):\n        '''QC500: Performs fine selection for the coarse selection constituents\n        The company's headquarter must in the U.S.\n        The stock must be traded on either the NYSE or NASDAQ\n        At least half a year since its initial public offering\n        The stock's market cap must be greater than 500 million\n\n        Magic Formula: Rank stocks by Enterprise Value to EBITDA (EV/EBITDA)\n        Rank subset of previously ranked stocks (EV/EBITDA), using the valuation ratio Return on Assets (ROA)'''\n\n        # QC500:\n        ## The company's headquarter must in the U.S.\n        ## The stock must be traded on either the NYSE or NASDAQ\n        ## At least half a year since its initial public offering\n        ## The stock's market cap must be greater than 500 million\n        filtered_fine = [x for x in fine if x.company_reference.country_id == \"USA\"\n                                        and (x.company_reference.primary_exchange_id == \"NYS\" or x.company_reference.primary_exchange_id == \"NAS\")\n                                        and (algorithm.time - x.security_reference.ipo_date).days > 180\n                                        and x.earning_reports.basic_average_shares.three_months * x.earning_reports.basic_eps.twelve_months * x.valuation_ratios.pe_ratio > 5e8]\n        count = len(filtered_fine)\n        if count == 0: return []\n\n        my_dict = dict()\n        percent = self.number_of_symbols_fine / count\n\n        # select stocks with top dollar volume in every single sector\n        for key in [\"N\", \"M\", \"U\", \"T\", \"B\", \"I\"]:\n            value = [x for x in filtered_fine if x.company_reference.industry_template_code == key]\n            value = sorted(value, key=lambda x: self.dollar_volume_by_symbol[x.symbol], reverse = True)\n            my_dict[key] = value[:ceil(len(value) * percent)]\n\n        # stocks in QC500 universe\n        top_fine = chain.from_iterable(my_dict.values())\n\n        #  Magic Formula:\n        ## Rank stocks by Enterprise Value to EBITDA (EV/EBITDA)\n        ## Rank subset of previously ranked stocks (EV/EBITDA), using the valuation ratio Return on Assets (ROA)\n\n        # sort stocks in the security universe of QC500 based on Enterprise Value to EBITDA valuation ratio\n        sorted_by_ev_to_ebitda = sorted(top_fine, key=lambda x: x.valuation_ratios.ev_to_ebitda , reverse=True)\n\n        # sort subset of stocks that have been sorted by Enterprise Value to EBITDA, based on the valuation ratio Return on Assets (ROA)\n        sorted_by_roa = sorted(sorted_by_ev_to_ebitda[:self.number_of_symbols_fine], key=lambda x: x.valuation_ratios.forward_roa, reverse=False)\n\n        # retrieve list of securites in portfolio\n        return [f.symbol for f in sorted_by_roa[:self.number_of_symbols_in_portfolio]]\n"
  },
  {
    "path": "Algorithm.Python/Alphas/IntradayReversalCurrencyMarketsAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# Reversal strategy that goes long when price crosses below SMA and Short when price crosses above SMA.\n# The trading strategy is implemented only between 10AM - 3PM (NY time). Research suggests this is due to\n# institutional trades during market hours which need hedging with the USD. Source paper:\n# LeBaron, Zhao: Intraday Foreign Exchange Reversals\n# http://people.brandeis.edu/~blebaron/wps/fxnyc.pdf\n# http://www.fma.org/Reno/Papers/ForeignExchangeReversalsinNewYorkTime.PDF\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n#\n\nclass IntradayReversalCurrencyMarketsAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2015, 1, 1)\n        self.set_cash(100000)\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # Select resolution\n        resolution = Resolution.HOUR\n\n        # Reversion on the USD.\n        symbols = [Symbol.create(\"EURUSD\", SecurityType.FOREX, Market.OANDA)]\n\n        # Set requested data resolution\n        self.universe_settings.resolution = resolution\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(IntradayReversalAlphaModel(5, resolution))\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        # Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n        #Set WarmUp for Indicators\n        self.set_warm_up(20)\n\n\nclass IntradayReversalAlphaModel(AlphaModel):\n    '''Alpha model that uses a Price/SMA Crossover to create insights on Hourly Frequency.\n    Frequency: Hourly data with 5-hour simple moving average.\n    Strategy:\n    Reversal strategy that goes Long when price crosses below SMA and Short when price crosses above SMA.\n    The trading strategy is implemented only between 10AM - 3PM (NY time)'''\n\n    # Initialize variables\n    def __init__(self, period_sma = 5, resolution = Resolution.HOUR):\n        self.period_sma = period_sma\n        self.resolution = resolution\n        self.cache = {} # Cache for SymbolData\n        self.name = 'IntradayReversalAlphaModel'\n\n    def update(self, algorithm, data):\n        # Set the time to close all positions at 3PM\n        time_to_close = algorithm.time.replace(hour=15, minute=1, second=0)\n\n        insights = []\n        for kvp in algorithm.active_securities:\n\n            symbol = kvp.key\n\n            if self.should_emit_insight(algorithm, symbol) and symbol in self.cache:\n\n                price = kvp.value.price\n                symbol_data = self.cache[symbol]\n\n                direction = InsightDirection.UP if symbol_data.is_uptrend(price) else InsightDirection.DOWN\n\n                # Ignore signal for same direction as previous signal (when no crossover)\n                if direction == symbol_data.previous_direction:\n                    continue\n\n                # Save the current Insight Direction to check when the crossover happens\n                symbol_data.previous_direction = direction\n\n                # Generate insight\n                insights.append(Insight.price(symbol, time_to_close, direction))\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        '''Handle creation of the new security and its cache class.\n        Simplified in this example as there is 1 asset.'''\n        for security in changes.added_securities:\n            self.cache[security.symbol] = SymbolData(algorithm, security.symbol, self.period_sma, self.resolution)\n\n    def should_emit_insight(self, algorithm, symbol):\n        '''Time to control when to start and finish emitting (10AM to 3PM)'''\n        time_of_day = algorithm.time.time()\n        return algorithm.securities[symbol].has_data and time_of_day >= time(10) and time_of_day <= time(15)\n\n\nclass SymbolData:\n\n    def __init__(self, algorithm, symbol, period_sma, resolution):\n        self.previous_direction = InsightDirection.FLAT\n        self.price_sma = algorithm.sma(symbol, period_sma, resolution)\n\n    def is_uptrend(self, price):\n        return self.price_sma.is_ready and price < round(self.price_sma.current.value * 1.001, 6)\n"
  },
  {
    "path": "Algorithm.Python/Alphas/MeanReversionLunchBreakAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# Academic research suggests that stock market participants generally place their orders at the market open and close.\n# Intraday trading volume is J-Shaped, where the minimum trading volume of the day is during lunch-break. Stocks become\n# more volatile as order flow is reduced and tend to mean-revert during lunch-break.\n#\n# This alpha aims to capture the mean-reversion effect of ETFs during lunch-break by ranking 20 ETFs\n# on their return between the close of the previous day to 12:00 the day after and predicting mean-reversion\n# in price during lunch-break.\n#\n# Source:  Lunina, V. (June 2011). The Intraday Dynamics of Stock Returns and Trading Activity: Evidence from OMXS 30 (Master's Essay, Lund University).\n# Retrieved from http://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=1973850&fileOId=1973852\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n#\n\nclass MeanReversionLunchBreakAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)\n\n        self.set_cash(100000)\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # Use Hourly Data For Simplicity\n        self.universe_settings.resolution = Resolution.HOUR\n        self.set_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selection_function))\n\n        # Use MeanReversionLunchBreakAlphaModel to establish insights\n        self.set_alpha(MeanReversionLunchBreakAlphaModel())\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        # Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n    # Sort the data by daily dollar volume and take the top '20' ETFs\n    def coarse_selection_function(self, coarse):\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n        filtered = [ x.symbol for x in sorted_by_dollar_volume if not x.has_fundamental_data ]\n        return filtered[:20]\n\n\nclass MeanReversionLunchBreakAlphaModel(AlphaModel):\n    '''Uses the price return between the close of previous day to 12:00 the day after to\n    predict mean-reversion of stock price during lunch break and creates direction prediction\n    for insights accordingly.'''\n\n    def __init__(self, *args, **kwargs):\n        lookback = kwargs['lookback'] if 'lookback' in kwargs else 1\n        self.resolution = Resolution.HOUR\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), lookback)\n        self._symbol_data_by_symbol = dict()\n\n    def update(self, algorithm, data):\n\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            if data.bars.contains_key(symbol):\n                bar = data.bars.get(symbol)\n                symbol_data.update(bar.end_time, bar.close)\n\n        return [] if algorithm.time.hour != 12 else \\\n               [x.insight for x in self._symbol_data_by_symbol.values()]\n\n    def on_securities_changed(self, algorithm, changes):\n        for security in changes.removed_securities:\n            self._symbol_data_by_symbol.pop(security.symbol, None)\n\n        # Retrieve price history for all securities in the security universe\n        # and update the indicators in the SymbolData object\n        symbols = [x.symbol for x in changes.added_securities]\n        history = algorithm.history(symbols, 1, self.resolution)\n        if history.empty:\n            algorithm.debug(f\"No data on {algorithm.time}\")\n            return\n        history = history.close.unstack(level = 0)\n\n        for ticker, values in history.items():\n            symbol = next((x for x in symbols if str(x) == ticker ), None)\n            if symbol in self._symbol_data_by_symbol or symbol is None: continue\n            self._symbol_data_by_symbol[symbol] = self.SymbolData(symbol, self.prediction_interval)\n            self._symbol_data_by_symbol[symbol].update(values.index[0], values[0])\n\n\n    class SymbolData:\n        def __init__(self, symbol, period):\n            self._symbol = symbol\n            self.period = period\n            # Mean value of returns for magnitude prediction\n            self.mean_of_price_change = IndicatorExtensions.sma(RateOfChangePercent(1),3)\n            # Price change from close price the previous day\n            self.price_change = RateOfChangePercent(3)\n\n        def update(self, time, value):\n            return self.mean_of_price_change.update(time, value) and \\\n                   self.price_change.update(time, value)\n\n        @property\n        def insight(self):\n            direction = InsightDirection.DOWN if self.price_change.current.value > 0 else InsightDirection.UP\n            margnitude = abs(self.mean_of_price_change.current.value)\n            return Insight.price(self._symbol, self.period, direction, margnitude, None)\n"
  },
  {
    "path": "Algorithm.Python/Alphas/MortgageRateVolatilityAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n'''\n    This Alpha Model uses Wells Fargo 30-year Fixed Rate Mortgage data from Quandl to \n    generate Insights about the movement of Real Estate ETFs. Mortgage rates can provide information \n    regarding the general price trend of real estate, and ETFs provide good continuous-time instruments \n    to measure the impact against. Volatility in mortgage rates tends to put downward pressure on real \n    estate prices, whereas stable mortgage rates, regardless of true rate, lead to stable or higher real\n    estate prices. This Alpha model seeks to take advantage of this correlation by emitting insights\n    based on volatility and rate deviation from its historic mean.\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    sourced so the community and client funds can see an example of an alpha.\n'''\n\nfrom AlgorithmImports import *\n\nclass MortgageRateVolatilityAlpha(QCAlgorithmFramework):\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.set_start_date(2017, 1, 1)   #Set Start Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.DAILY\n        \n        ## Universe of six liquid real estate ETFs\n        etfs = ['VNQ', 'REET', 'TAO', 'FREL', 'SRET', 'HIPS']\n        symbols = [ Symbol.create(etf, SecurityType.EQUITY, Market.USA) for etf in etfs ]\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols) )\n            \n        self.set_alpha(MortgageRateVolatilityAlphaModel(self))\n        \n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel()) \n        \n        self.set_execution(ImmediateExecutionModel())\n        \n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass MortgageRateVolatilityAlphaModel(AlphaModel):\n    \n    def __init__(self, algorithm, indicator_period = 15, insight_magnitude = 0.005, deviations = 2):\n        ## Add Quandl data for a Well's Fargo 30-year Fixed Rate mortgage\n        self.mortgage_rate = algorithm.add_data(QuandlMortgagePriceColumns, 'WFC/PR_GOV_30YFIXEDVA_APR').symbol\n        self.indicator_period = indicator_period\n        self.insight_duration = TimeSpan.from_days(indicator_period)\n        self.insight_magnitude = insight_magnitude\n        self.deviations = deviations\n        \n        ## Add indicators for the mortgage rate -- Standard Deviation and Simple Moving Average\n        self.mortgage_rate_std = algorithm.std(self.mortgage_rate, indicator_period)\n        self.mortgage_rate_sma = algorithm.sma(self.mortgage_rate, indicator_period)\n        \n        ## Use a history call to warm-up the indicators\n        self.warmup_indicators(algorithm)\n    \n    def update(self, algorithm, data):\n        insights = []\n        \n        ## Return empty list if data slice doesn't contain monrtgage rate data\n        if self.mortgage_rate not in data.keys():\n            return []\n\n        ## Extract current mortgage rate, the current STD indicator value, and current SMA value\n        mortgage_rate = data[self.mortgage_rate].value\n        deviation = self.deviations * self.mortgage_rate_std.current.value\n        sma = self.mortgage_rate_sma.current.value\n        \n        ## If volatility in mortgage rates is high, then we emit an Insight to sell\n        if (mortgage_rate < sma - deviation) or (mortgage_rate > sma + deviation):\n            ## Emit insights for all securities that are currently in the Universe,\n            ## except for the Quandl Symbol\n            insights = [Insight(security, self.insight_duration, InsightType.PRICE, InsightDirection.DOWN, self.insight_magnitude, None) \\\n                        for security in algorithm.active_securities.keys if security != self.mortgage_rate]\n        \n        ## If volatility in mortgage rates is low, then we emit an Insight to buy\n        if (mortgage_rate < sma - deviation/2) or (mortgage_rate > sma + deviation/2):\n            insights = [Insight(security, self.insight_duration, InsightType.PRICE, InsightDirection.UP, self.insight_magnitude, None) \\\n                        for security in algorithm.active_securities.keys if security != self.mortgage_rate]\n        \n        return insights\n    \n    def warmup_indicators(self, algorithm):\n        ## Make a history call and update the indicators\n        history = algorithm.history(self.mortgage_rate, self.indicator_period, Resolution.DAILY)\n        for index, row in history.iterrows():\n            self.mortgage_rate_std.update(index[1], row['value'])\n            self.mortgage_rate_sma.update(index[1], row['value'])\n    \nclass QuandlMortgagePriceColumns(PythonQuandl):\n    \n    def __init__(self):\n        ## Rename the Quandl object column to the data we want, which is the 'Value' column\n        ## of the CSV that our API call returns\n        self.value_column_name = \"Value\"\n"
  },
  {
    "path": "Algorithm.Python/Alphas/PriceGapMeanReversionAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass PriceGapMeanReversionAlpha(QCAlgorithm):\n    '''The motivating idea for this Alpha Model is that a large price gap (here we use true outliers --\n    price gaps that whose absolutely values are greater than 3 * Volatility) is due to rebound\n    back to an appropriate price or at least retreat from its brief extreme. Using a Coarse Universe selection\n    function, the algorithm selects the top x-companies by Dollar Volume (x can be any number you choose)\n    to trade with, and then uses the Standard Deviation of the 100 most-recent closing prices to determine\n    which price movements are outliers that warrant emitting insights.\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n    sourced so the community and client funds can see an example of an alpha.'''\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)   #Set Start Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        ## Initialize variables to be used in controlling frequency of universe selection\n        self.week = -1\n\n        ## Manual Universe Selection\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selection_function))\n\n        ## Set trading fees to $0\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        ## Set custom Alpha Model\n        self.set_alpha(PriceGapMeanReversionAlphaModel())\n\n        ## Set equal-weighting Portfolio Construction Model\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\n    def coarse_selection_function(self, coarse):\n        ## If it isn't a new week, return the same symbols\n        current_week = self.time.isocalendar()[1]\n        if current_week == self.week:\n            return Universe.UNCHANGED\n        self.week = current_week\n\n        ## If its a new week, then re-filter stocks by Dollar Volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        return [ x.symbol for x in sorted_by_dollar_volume[:25] ]\n\n\nclass PriceGapMeanReversionAlphaModel(AlphaModel):\n\n    def __init__(self, *args, **kwargs):\n        ''' Initialize variables and dictionary for Symbol Data to support algorithm's function '''\n        self.lookback = 100\n        self.resolution = kwargs['resolution'] if 'resolution' in kwargs else Resolution.MINUTE\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), 5) ## Arbitrary\n        self._symbol_data_by_symbol = {}\n\n    def update(self, algorithm, data):\n        insights = []\n\n        ## Loop through all Symbol Data objects\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            ## Evaluate whether or not the price jump is expected to rebound\n            if not symbol_data.is_trend(data):\n                continue\n\n            ## Emit insights accordingly to the price jump sign\n            direction = InsightDirection.DOWN if symbol_data.price_jump > 0 else InsightDirection.UP\n            insights.append(Insight.price(symbol, self.prediction_interval, direction, symbol_data.price_jump, None))\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        # Clean up data for removed securities\n        for removed in changes.removed_securities:\n            symbol_data = self._symbol_data_by_symbol.pop(removed.symbol, None)\n            if symbol_data is not None:\n                symbol_data.remove_consolidators(algorithm)\n\n        symbols = [x.symbol for x in changes.added_securities\n            if x.symbol not in self._symbol_data_by_symbol]\n\n        history = algorithm.history(symbols, self.lookback, self.resolution)\n        if history.empty: return\n\n        ## Create and initialize SymbolData objects\n        for symbol in symbols:\n            symbol_data = SymbolData(algorithm, symbol, self.lookback, self.resolution)\n            symbol_data.warm_up_indicators(history.loc[symbol])\n            self._symbol_data_by_symbol[symbol] = symbol_data\n\n\nclass SymbolData:\n    def __init__(self, algorithm, symbol, lookback, resolution):\n        self._symbol = symbol\n        self.close = 0\n        self.last_price = 0\n        self.price_jump = 0\n        self.consolidator = algorithm.resolve_consolidator(symbol, resolution)\n        self.volatility = StandardDeviation(f'{symbol}.std({lookback})', lookback)\n        algorithm.register_indicator(symbol, self.volatility, self.consolidator)\n\n    def remove_consolidators(self, algorithm):\n        algorithm.subscription_manager.remove_consolidator(self._symbol, self.consolidator)\n\n    def warm_up_indicators(self, history):\n        self.close = history.iloc[-1].close\n        for tuple in history.itertuples():\n            self.volatility.update(tuple.Index, tuple.close)\n\n    def is_trend(self, data):\n\n        ## Check for any data events that would return a NoneBar in the Alpha Model Update() method\n        if not data.bars.contains_key(self._symbol):\n            return False\n\n        self.last_price = self.close\n        self.close = data.bars[self._symbol].close\n        self.price_jump = (self.close / self.last_price) - 1\n        return abs(100*self.price_jump) > 3*self.volatility.current.value\n"
  },
  {
    "path": "Algorithm.Python/Alphas/RebalancingLeveragedETFAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Alpha Benchmark Strategy capitalizing on ETF rebalancing causing momentum during trending markets.\n### </summary>\n### <meta name=\"tag\" content=\"alphastream\" />\n### <meta name=\"tag\" content=\"etf\" />\n### <meta name=\"tag\" content=\"algorithm framework\" />\nclass RebalancingLeveragedETFAlpha(QCAlgorithm):\n    ''' Alpha Streams: Benchmark Alpha: Leveraged ETF Rebalancing\n        Strategy by Prof. Shum, reposted by Ernie Chan.\n        Source: http://epchan.blogspot.com/2012/10/a-leveraged-etfs-strategy.html'''\n\n    def initialize(self):\n\n        self.set_start_date(2017, 6, 1)\n        self.set_end_date(2018, 8, 1)\n        self.set_cash(100000)\n\n        underlying = [\"SPY\",\"QLD\",\"DIA\",\"IJR\",\"MDY\",\"IWM\",\"QQQ\",\"IYE\",\"EEM\",\"IYW\",\"EFA\",\"GAZB\",\"SLV\",\"IEF\",\"IYM\",\"IYF\",\"IYH\",\"IYR\",\"IYC\",\"IBB\",\"FEZ\",\"USO\",\"TLT\"]\n        ultra_long =  [\"SSO\",\"UGL\",\"DDM\",\"SAA\",\"MZZ\",\"UWM\",\"QLD\",\"DIG\",\"EET\",\"ROM\",\"EFO\",\"BOIL\",\"AGQ\",\"UST\",\"UYM\",\"UYG\",\"RXL\",\"URE\",\"UCC\",\"BIB\",\"ULE\",\"UCO\",\"UBT\"]\n        ultra_short = [\"SDS\",\"GLL\",\"DXD\",\"SDD\",\"MVV\",\"TWM\",\"QID\",\"DUG\",\"EEV\",\"REW\",\"EFU\",\"KOLD\",\"ZSL\",\"PST\",\"SMN\",\"SKF\",\"RXD\",\"SRS\",\"SCC\",\"BIS\",\"EPV\",\"SCO\",\"TBT\"]\n\n        groups = []\n        for i in range(len(underlying)):\n            group = ETFGroup(self.add_equity(underlying[i], Resolution.MINUTE).symbol,\n                              self.add_equity(ultra_long[i], Resolution.MINUTE).symbol,\n                              self.add_equity(ultra_short[i], Resolution.MINUTE).symbol)\n            groups.append(group)\n\n        # Manually curated universe\n        self.set_universe_selection(ManualUniverseSelectionModel())\n        # Select the demonstration alpha model\n        self.set_alpha(RebalancingLeveragedETFAlphaModel(groups))\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        # Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass RebalancingLeveragedETFAlphaModel(AlphaModel):\n\n    '''\n        If the underlying ETF has experienced a return >= 1% since the previous day's close up to the current time at 14:15,\n        then buy it's ultra ETF right away, and exit at the close. If the return is <= -1%, sell it's ultra-short ETF.\n    '''\n\n    def __init__(self, ETFgroups):\n\n        self.etfgroups = ETFgroups\n        self.date = datetime.min.date\n        self.name = \"RebalancingLeveragedETFAlphaModel\"\n\n    def update(self, algorithm, data):\n        '''Scan to see if the returns are greater than 1% at 2.15pm to emit an insight.'''\n\n        insights = []\n        magnitude = 0.0005\n        # Paper suggests leveraged ETF's rebalance from 2.15pm - to close\n        # giving an insight period of 105 minutes.\n        period = timedelta(minutes=105)\n\n        # Get yesterday's close price at the market open\n        if algorithm.time.date() != self.date:\n            self.date = algorithm.time.date()\n            # Save yesterday's price and reset the signal\n            for group in self.etfgroups:\n                history = algorithm.history([group.underlying], 1, Resolution.DAILY)\n                group.yesterday_close = None if history.empty else history.loc[str(group.underlying)]['close'][0]\n\n        # Check if the returns are > 1% at 14.15\n        if algorithm.time.hour == 14 and algorithm.time.minute == 15:\n            for group in self.etfgroups:\n                if group.yesterday_close == 0 or group.yesterday_close is None: continue\n                returns = round((algorithm.portfolio[group.underlying].price - group.yesterday_close) / group.yesterday_close, 10)\n                if returns > 0.01:\n                    insights.append(Insight.price(group.ultra_long, period, InsightDirection.UP, magnitude))\n                elif returns < -0.01:\n                    insights.append(Insight.price(group.ultra_short, period, InsightDirection.DOWN, magnitude))\n\n        return insights\n\nclass ETFGroup:\n    '''\n    Group the underlying ETF and it's ultra ETFs\n    Args:\n        underlying: The underlying index ETF\n        ultra_long: The long-leveraged version of underlying ETF\n        ultra_short: The short-leveraged version of the underlying ETF\n    '''\n    def __init__(self,underlying, ultra_long, ultra_short):\n        self.underlying = underlying\n        self.ultra_long = ultra_long\n        self.ultra_short = ultra_short\n        self.yesterday_close = 0\n"
  },
  {
    "path": "Algorithm.Python/Alphas/ShareClassMeanReversionAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# A number of companies publicly trade two different classes of shares\n# in US equity markets. If both assets trade with reasonable volume, then\n# the underlying driving forces of each should be similar or the same. Given\n# this, we can create a relatively dollar-neutral long/short portfolio using\n# the dual share classes. Theoretically, any deviation of this portfolio from\n# its mean-value should be corrected, and so the motivating idea is based on\n# mean-reversion. Using a Simple Moving Average indicator, we can\n# compare the value of this portfolio against its SMA and generate insights\n# to buy the under-valued symbol and sell the over-valued symbol.\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n# sourced so the community and client funds can see an example of an alpha.\n#\n\nclass ShareClassMeanReversionAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2019, 1, 1)   #Set Start Date\n        self.set_cash(100000)           #Set Strategy Cash\n        self.set_warm_up(20)\n\n        ## Setup Universe settings and tickers to be used\n        tickers = ['VIA','VIAB']\n        self.universe_settings.resolution = Resolution.MINUTE\n        symbols = [ Symbol.create(ticker, SecurityType.EQUITY, Market.USA) for ticker in tickers]\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))  ## Set $0 fees to mimic High-Frequency Trading\n\n        ## Set Manual Universe Selection\n        self.set_universe_selection( ManualUniverseSelectionModel(symbols) )\n\n        ## Set Custom Alpha Model\n        self.set_alpha(ShareClassMeanReversionAlphaModel(tickers = tickers))\n\n        ## Set Equal Weighting Portfolio Construction Model\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass ShareClassMeanReversionAlphaModel(AlphaModel):\n    ''' Initialize helper variables for the algorithm'''\n\n    def __init__(self, *args, **kwargs):\n        self.sma = SimpleMovingAverage(10)\n        self.position_window = RollingWindow(2)\n        self.alpha = None\n        self.beta = None\n        if 'tickers' not in kwargs:\n            raise AssertionError('ShareClassMeanReversionAlphaModel: Missing argument: \"tickers\"')\n        self.tickers = kwargs['tickers']\n        self.position_value = None\n        self.invested = False\n        self.liquidate = 'liquidate'\n        self.long_symbol = self.tickers[0]\n        self.short_symbol = self.tickers[1]\n        self.resolution = kwargs['resolution'] if 'resolution' in kwargs else Resolution.MINUTE\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(self.resolution), 5) ## Arbitrary\n        self.insight_magnitude = 0.001\n\n    def update(self, algorithm, data):\n        insights = []\n\n        ## Check to see if either ticker will return a NoneBar, and skip the data slice if so\n        for security in algorithm.securities:\n            if self.data_event_occured(data, security.key):\n                return insights\n\n        ## If Alpha and Beta haven't been calculated yet, then do so\n        if (self.alpha is None) or (self.beta is None):\n           self.calculate_alpha_beta(algorithm, data)\n           algorithm.log('Alpha: ' + str(self.alpha))\n           algorithm.log('Beta: ' + str(self.beta))\n\n        ## If the SMA isn't fully warmed up, then perform an update\n        if not self.sma.is_ready:\n            self.update_indicators(data)\n            return insights\n\n        ## Update indicator and Rolling Window for each data slice passed into Update() method\n        self.update_indicators(data)\n\n        ## Check to see if the portfolio is invested. If no, then perform value comparisons and emit insights accordingly\n        if not self.invested:\n            if self.position_value >= self.sma.current.value:\n                insights.append(Insight(self.long_symbol, self.prediction_interval, InsightType.PRICE, InsightDirection.DOWN, self.insight_magnitude, None))\n                insights.append(Insight(self.short_symbol, self.prediction_interval, InsightType.PRICE, InsightDirection.UP, self.insight_magnitude, None))\n\n                ## Reset invested boolean\n                self.invested = True\n\n            elif self.position_value < self.sma.current.value:\n                insights.append(Insight(self.long_symbol, self.prediction_interval, InsightType.PRICE, InsightDirection.UP, self.insight_magnitude, None))\n                insights.append(Insight(self.short_symbol, self.prediction_interval, InsightType.PRICE, InsightDirection.DOWN, self.insight_magnitude, None))\n\n                ## Reset invested boolean\n                self.invested = True\n\n        ## If the portfolio is invested and crossed back over the SMA, then emit flat insights\n        elif self.invested and self.crossed_mean():\n            ## Reset invested boolean\n            self.invested = False\n\n        return Insight.group(insights)\n\n    def data_event_occured(self, data, symbol):\n        ## Helper function to check to see if data slice will contain a symbol\n        if data.splits.contains_key(symbol) or \\\n           data.dividends.contains_key(symbol) or \\\n           data.delistings.contains_key(symbol) or \\\n           data.symbol_changed_events.contains_key(symbol):\n            return True\n\n    def update_indicators(self, data):\n        ## Calculate position value and update the SMA indicator and Rolling Window\n        self.position_value = (self.alpha * data[self.long_symbol].close) - (self.beta * data[self.short_symbol].close)\n        self.sma.update(data[self.long_symbol].end_time, self.position_value)\n        self.position_window.add(self.position_value)\n\n    def crossed_mean(self):\n        ## Check to see if the position value has crossed the SMA and then return a boolean value\n        if (self.position_window[0] >= self.sma.current.value) and (self.position_window[1] < self.sma.current.value):\n            return True\n        elif (self.position_window[0] < self.sma.current.value) and (self.position_window[1] >= self.sma.current.value):\n            return True\n        else:\n            return False\n\n    def calculate_alpha_beta(self, algorithm, data):\n        ## Calculate Alpha and Beta, the initial number of shares for each security needed to achieve a 50/50 weighting\n        self.alpha = algorithm.calculate_order_quantity(self.long_symbol, 0.5)\n        self.beta = algorithm.calculate_order_quantity(self.short_symbol, 0.5)\n"
  },
  {
    "path": "Algorithm.Python/Alphas/SykesShortMicroCapAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\nclass SykesShortMicroCapAlpha(QCAlgorithm):\n    ''' Alpha Streams: Benchmark Alpha: Identify \"pumped\" penny stocks and predict that the price of a \"pumped\" penny stock reverts to mean\n\n    This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open\n   sourced so the community and client funds can see an example of an alpha.'''\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)\n        self.set_cash(100000)\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # select stocks using PennyStockUniverseSelectionModel\n        self.universe_settings.resolution = Resolution.DAILY\n        self.universe_settings.schedule.on(self.date_rules.month_start())\n        self.set_universe_selection(PennyStockUniverseSelectionModel())\n\n        # Use SykesShortMicroCapAlphaModel to establish insights\n        self.set_alpha(SykesShortMicroCapAlphaModel())\n\n        # Equally weigh securities in portfolio, based on insights\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        # Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass SykesShortMicroCapAlphaModel(AlphaModel):\n    '''Uses ranking of intraday percentage difference between open price and close price to create magnitude and direction prediction for insights'''\n\n    def __init__(self, *args, **kwargs):\n        lookback = kwargs['lookback'] if 'lookback' in kwargs else 1\n        resolution = kwargs['resolution'] if 'resolution' in kwargs else Resolution.DAILY\n        self.prediction_interval = Time.multiply(Extensions.to_time_span(resolution), lookback)\n        self.number_of_stocks = kwargs['number_of_stocks'] if 'number_of_stocks' in kwargs else 10\n\n    def update(self, algorithm, data):\n        insights = []\n        symbols_ret = dict()\n\n        for security in algorithm.active_securities.values:\n            if security.has_data:\n                open_ = security.open\n                if open_ != 0:\n                    # Intraday price change for penny stocks\n                    symbols_ret[security.symbol] = security.close / open_ - 1\n\n        # Rank penny stocks on one day price change and retrieve list of ten \"pumped\" penny stocks\n        pumped_stocks = dict(sorted(symbols_ret.items(),\n                                   key = lambda kv: (-round(kv[1], 6), kv[0]))[:self.number_of_stocks])\n\n        # Emit \"down\" insight for \"pumped\" penny stocks\n        for symbol, value in pumped_stocks.items():\n            insights.append(Insight.price(symbol, self.prediction_interval, InsightDirection.DOWN, abs(value), None))\n\n        return insights\n\n\nclass PennyStockUniverseSelectionModel(FundamentalUniverseSelectionModel):\n    '''Defines a universe of penny stocks, as a universe selection model for the framework algorithm:\n    The stocks must have fundamental data\n    The stock must have positive previous-day close price\n    The stock must have volume between $1000000 and $10000 on the previous trading day\n    The stock must cost less than $5'''\n    def __init__(self):\n        super().__init__()\n\n        # Number of stocks in Coarse Universe\n        self.number_of_symbols_coarse = 500\n\n    def select(self, algorithm, fundamental):\n        # sort the stocks by dollar volume and take the top 500\n        top = sorted([x for x in fundamental if x.has_fundamental_data\n                                       and 5 > x.price > 0\n                                       and 1000000 > x.volume > 10000],\n                    key=lambda x: x.dollar_volume, reverse=True)[:self.number_of_symbols_coarse]\n\n        return [x.symbol for x in top]\n"
  },
  {
    "path": "Algorithm.Python/Alphas/TriangleExchangeRateArbitrageAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# In a perfect market, you could buy 100 EUR worth of USD, sell 100 EUR worth of GBP,\n# and then use the GBP to buy USD and wind up with the same amount in USD as you received when\n# you bought them with EUR. This relationship is expressed by the Triangle Exchange Rate, which is\n#\n#     Triangle Exchange Rate = (A/B) * (B/C) * (C/A)\n#\n# where (A/B) is the exchange rate of A-to-B. In a perfect market, TER = 1, and so when\n# there is a mispricing in the market, then TER will not be 1 and there exists an arbitrage opportunity.\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n#\n\nclass TriangleExchangeRateArbitrageAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2019, 2, 1)   #Set Start Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        ## Select trio of currencies to trade where\n        ## Currency A = USD\n        ## Currency B = EUR\n        ## Currency C = GBP\n        currencies = ['EURUSD','EURGBP','GBPUSD']\n        symbols = [ Symbol.create(currency, SecurityType.FOREX, Market.OANDA) for currency in currencies]\n\n        ## Manual universe selection with tick-resolution data\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_universe_selection( ManualUniverseSelectionModel(symbols) )\n\n        self.set_alpha(ForexTriangleArbitrageAlphaModel(Resolution.MINUTE, symbols))\n\n        ## Set Equal Weighting Portfolio Construction Model\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass ForexTriangleArbitrageAlphaModel(AlphaModel):\n\n    def __init__(self, insight_resolution, symbols):\n        self.insight_period = Time.multiply(Extensions.to_time_span(insight_resolution), 5)\n        self._symbols = symbols\n\n    def update(self, algorithm, data):\n        ## Check to make sure all currency symbols are present\n        if len(data.keys()) < 3:\n            return []\n\n        ## Extract QuoteBars for all three Forex securities\n        bar_a = data[self._symbols[0]]\n        bar_b = data[self._symbols[1]]\n        bar_c = data[self._symbols[2]]\n\n        ## Calculate the triangle exchange rate\n        ## Bid(Currency A -> Currency B) * Bid(Currency B -> Currency C) * Bid(Currency C -> Currency A)\n        ## If exchange rates are priced perfectly, then this yield 1. If it is different than 1, then an arbitrage opportunity exists\n        triangle_rate = bar_a.ask.close / bar_b.bid.close / bar_c.ask.close\n\n        ## If the triangle rate is significantly different than 1, then emit insights\n        if triangle_rate > 1.0005:\n            return Insight.group(\n                [\n                    Insight.price(self._symbols[0], self.insight_period, InsightDirection.UP, 0.0001, None),\n                    Insight.price(self._symbols[1], self.insight_period, InsightDirection.DOWN, 0.0001, None),\n                    Insight.price(self._symbols[2], self.insight_period, InsightDirection.UP, 0.0001, None)\n                ] )\n\n        return []\n"
  },
  {
    "path": "Algorithm.Python/Alphas/TripleLeverageETFPairVolatilityDecayAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# Leveraged ETFs (LETF) promise a fixed leverage ratio with respect to an underlying asset or an index.\n# A Triple-Leveraged ETF allows speculators to amplify their exposure to the daily returns of an underlying index by a factor of 3.\n#\n# Increased volatility generally decreases the value of a LETF over an extended period of time as daily compounding is amplified.\n#\n# This alpha emits short-biased insight to capitalize on volatility decay for each listed pair of TL-ETFs, by rebalancing the\n# ETFs with equal weights each day.\n#\n# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.\n#\n\nclass TripleLeverageETFPairVolatilityDecayAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2018, 1, 1)\n\n        self.set_cash(100000)\n\n        # Set zero transaction fees\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n\n        # 3X ETF pair tickers\n        ultra_long = Symbol.create(\"UGLD\", SecurityType.EQUITY, Market.USA)\n        ultra_short = Symbol.create(\"DGLD\", SecurityType.EQUITY, Market.USA)\n\n        # Manually curated universe\n        self.universe_settings.resolution = Resolution.DAILY\n        self.set_universe_selection(ManualUniverseSelectionModel([ultra_long, ultra_short]))\n\n        # Select the demonstration alpha model\n        self.set_alpha(RebalancingTripleLeveragedETFAlphaModel(ultra_long, ultra_short))\n\n        ## Set Equal Weighting Portfolio Construction Model\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Set Immediate Execution Model\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Set Null Risk Management Model\n        self.set_risk_management(NullRiskManagementModel())\n\n\nclass RebalancingTripleLeveragedETFAlphaModel(AlphaModel):\n    '''\n        Rebalance a pair of 3x leveraged ETFs and predict that the value of both ETFs in each pair will decrease.\n    '''\n\n    def __init__(self, ultra_long, ultra_short):\n        # Giving an insight period 1 days.\n        self.period = timedelta(1)\n\n        self.magnitude = 0.001\n        self.ultra_long = ultra_long\n        self.ultra_short = ultra_short\n\n        self.name = \"RebalancingTripleLeveragedETFAlphaModel\"\n\n    def update(self, algorithm, data):\n\n        return Insight.group(\n            [\n                Insight.price(self.ultra_long, self.period, InsightDirection.DOWN, self.magnitude),\n                Insight.price(self.ultra_short, self.period, InsightDirection.DOWN, self.magnitude)\n            ] )\n"
  },
  {
    "path": "Algorithm.Python/Alphas/VIXDualThrustAlpha.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n#\n# This is a demonstration algorithm. It trades UVXY.\n# Dual Thrust alpha model is used to produce insights.\n# Those input parameters have been chosen that gave acceptable results on a series\n# of random backtests run for the period from Oct, 2016 till Feb, 2019.\n#\n\nclass VIXDualThrustAlpha(QCAlgorithm):\n\n    def initialize(self):\n\n        # -- STRATEGY INPUT PARAMETERS --\n        self.k1 = 0.63\n        self.k2 = 0.63\n        self.range_period = 20\n        self.consolidator_bars = 30\n\n        # Settings\n        self.set_start_date(2018, 10, 1)\n        self.set_security_initializer(lambda security: security.set_fee_model(ConstantFeeModel(0)))\n        self.set_brokerage_model(BrokerageName.INTERACTIVE_BROKERS_BROKERAGE, AccountType.MARGIN)\n\n        # Universe Selection\n        self.universe_settings.resolution = Resolution.MINUTE   # it's minute by default, but lets leave this param here\n        symbols = [Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)]\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n\n        # Warming up\n        resolution_in_time_span =  Extensions.to_time_span(self.universe_settings.resolution)\n        warm_up_time_span = Time.multiply(resolution_in_time_span, self.consolidator_bars)\n        self.set_warm_up(warm_up_time_span)\n\n        # Alpha Model\n        self.set_alpha(DualThrustAlphaModel(self.k1, self.k2, self.range_period, self.universe_settings.resolution, self.consolidator_bars))\n\n        ## Portfolio Construction\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        ## Execution\n        self.set_execution(ImmediateExecutionModel())\n\n        ## Risk Management\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.03))\n\n\nclass DualThrustAlphaModel(AlphaModel):\n    '''Alpha model that uses dual-thrust strategy to create insights\n    https://medium.com/@FMZ_Quant/dual-thrust-trading-strategy-2cc74101a626\n    or here:\n    https://www.quantconnect.com/tutorials/strategy-library/dual-thrust-trading-algorithm'''\n\n    def __init__(self,\n                 k1,\n                 k2,\n                 range_period,\n                 resolution = Resolution.DAILY,\n                 bars_to_consolidate = 1):\n        '''Initializes a new instance of the class\n        Args:\n            k1: Coefficient for upper band\n            k2: Coefficient for lower band\n            range_period: Amount of last bars to calculate the range\n            resolution: The resolution of data sent into the EMA indicators\n            bars_to_consolidate: If we want alpha to work on trade bars whose length is different\n                from the standard resolution - 1m 1h etc. - we need to pass this parameters along\n                with proper data resolution'''\n\n        # coefficient that used to determine upper and lower borders of a breakout channel\n        self.k1 = k1\n        self.k2 = k2\n\n        # period the range is calculated over\n        self.range_period = range_period\n\n        # initialize with empty dict.\n        self._symbol_data_by_symbol = dict()\n\n        # time for bars we make the calculations on\n        resolution_in_time_span =  Extensions.to_time_span(resolution)\n        self.consolidator_time_span = Time.multiply(resolution_in_time_span, bars_to_consolidate)\n\n        # in 5 days after emission an insight is to be considered expired\n        self.period = timedelta(5)\n\n    def update(self, algorithm, data):\n        insights = []\n\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            if not symbol_data.is_ready:\n                continue\n\n            holding = algorithm.portfolio[symbol]\n            price = algorithm.securities[symbol].price\n\n            # buying condition\n            # - (1) price is above upper line\n            # - (2) and we are not long. this is a first time we crossed the line lately\n            if price > symbol_data.upper_line and not holding.is_long:\n                insight_close_time_utc = algorithm.utc_time + self.period\n                insights.append(Insight.price(symbol, insight_close_time_utc, InsightDirection.UP))\n\n            # selling condition\n            # - (1) price is lower that lower line\n            # - (2) and we are not short. this is a first time we crossed the line lately\n            if price < symbol_data.lower_line and not holding.is_short:\n                insight_close_time_utc = algorithm.utc_time + self.period\n                insights.append(Insight.price(symbol, insight_close_time_utc, InsightDirection.DOWN))\n\n        return insights\n\n    def on_securities_changed(self, algorithm, changes):\n        # added\n        for symbol in [x.symbol for x in changes.added_securities]:\n            if symbol not in self._symbol_data_by_symbol:\n                # add symbol/symbol_data pair to collection\n                symbol_data = self.SymbolData(symbol, self.k1, self.k2, self.range_period, self.consolidator_time_span)\n                self._symbol_data_by_symbol[symbol] = symbol_data\n                # register consolidator\n                algorithm.subscription_manager.add_consolidator(symbol, symbol_data.get_consolidator())\n\n        # removed\n        for symbol in [x.symbol for x in changes.removed_securities]:\n            symbol_data = self._symbol_data_by_symbol.pop(symbol, None)\n            if symbol_data is None:\n                algorithm.error(\"Unable to remove data from collection: DualThrustAlphaModel\")\n            else:\n                # unsubscribe consolidator from data updates\n                algorithm.subscription_manager.remove_consolidator(symbol, symbol_data.get_consolidator())\n\n\n    class SymbolData:\n        '''Contains data specific to a symbol required by this model'''\n        def __init__(self, symbol, k1, k2, range_period, consolidator_resolution):\n\n            self.symbol = symbol\n            self.range_window = RollingWindow(range_period)\n            self.consolidator = TradeBarConsolidator(consolidator_resolution)\n\n            def on_data_consolidated(sender, consolidated):\n                # add new tradebar to\n                self.range_window.add(consolidated)\n\n                if self.range_window.is_ready:\n                    hh = max([x.high for x in self.range_window])\n                    hc = max([x.close for x in self.range_window])\n                    lc = min([x.close for x in self.range_window])\n                    ll = min([x.low for x in self.range_window])\n\n                    range = max([hh - lc, hc - ll])\n                    self.upper_line = consolidated.close + k1 * range\n                    self.lower_line = consolidated.close - k2 * range\n\n            # event fired at new consolidated trade bar\n            self.consolidator.data_consolidated += on_data_consolidated\n\n        # Returns the interior consolidator\n        def get_consolidator(self):\n            return self.consolidator\n\n        @property\n        def is_ready(self):\n            return self.range_window.is_ready\n"
  },
  {
    "path": "Algorithm.Python/AsynchronousUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom FundamentalRegressionAlgorithm import FundamentalRegressionAlgorithm\n\n### <summary>\n### Example algorithm using the asynchronous universe selection functionality\n### </summary>\nclass AsynchronousUniverseRegressionAlgorithm(FundamentalRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.universe_settings.asynchronous = True\n"
  },
  {
    "path": "Algorithm.Python/AutoRegressiveIntegratedMovingAverageRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n# <summary>\n# Regression algorithm to test the behaviour of ARMA versus AR models at the same order of differencing.\n# In particular, an ARIMA(1,1,1) and ARIMA(1,1,0) are instantiated while orders are placed if their difference\n# is sufficiently large (which would be due to the inclusion of the MA(1) term).\n# </summary>\nclass AutoRegressiveIntegratedMovingAverageRegressionAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013, 1, 7)\n        self.set_end_date(2013, 12, 11)\n        self.settings.automatic_indicator_warm_up = True\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self._arima = self.arima(\"SPY\", 1, 1, 1, 50)\n        self._ar = self.arima(\"SPY\", 1, 1, 0, 50)\n        self._last = None\n\n    def on_data(self, data: Slice) -> None:\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self._arima.is_ready:\n            if abs(self._arima.current.value - self._ar.current.value) > 1:\n                if self._arima.current.value > self._last:\n                    self.market_order(\"SPY\", 1)\n                else:\n                    self.market_order(\"SPY\", -1)\n            self._last = self._arima.current.value\n"
  },
  {
    "path": "Algorithm.Python/AuxiliaryDataHandlersRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm using and asserting the behavior of auxiliary data handlers\n### </summary>\nclass AuxiliaryDataHandlersRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2007, 5, 16)\n        self.set_end_date(2015, 1, 1)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # will get delisted\n        self.add_equity(\"AAA.1\")\n\n        # get's remapped\n        self.add_equity(\"SPWR\")\n\n        # has a split & dividends\n        self.add_equity(\"AAPL\")\n\n    def on_delistings(self, delistings: Delistings):\n        self._on_delistings_called = True\n\n    def on_symbol_changed_events(self, symbolsChanged: SymbolChangedEvents):\n        self._on_symbol_changed_events = True\n\n    def on_splits(self, splits: Splits):\n        self._on_splits = True\n\n    def on_dividends(self, dividends: Dividends):\n        self._on_dividends = True\n\n    def on_end_of_algorithm(self):\n        if not self._on_delistings_called:\n            raise ValueError(\"OnDelistings was not called!\")\n        if not self._on_symbol_changed_events:\n            raise ValueError(\"OnSymbolChangedEvents was not called!\")\n        if not self._on_splits:\n            raise ValueError(\"OnSplits was not called!\")\n        if not self._on_dividends:\n            raise ValueError(\"OnDividends was not called!\")\n"
  },
  {
    "path": "Algorithm.Python/BaseFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Abstract regression framework algorithm for multiple framework regression tests\n### </summary>\nclass BaseFrameworkRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 1)\n        self.set_end_date(2014, 6, 30)\n\n        self.universe_settings.resolution = Resolution.HOUR\n        self.universe_settings.data_normalization_mode = DataNormalizationMode.RAW\n\n        symbols = [Symbol.create(ticker, SecurityType.EQUITY, Market.USA)\n            for ticker in [\"AAPL\", \"AIG\", \"BAC\", \"SPY\"]]\n\n        # Manually add AAPL and AIG when the algorithm starts\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols[:2]))\n\n        # At midnight, add all securities every day except on the last data\n        # With this procedure, the Alpha Model will experience multiple universe changes\n        self.add_universe_selection(ScheduledUniverseSelectionModel(\n            self.date_rules.every_day(), self.time_rules.midnight,\n            lambda dt: symbols if dt < self.end_date - timedelta(1) else []))\n\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(31), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n    def on_end_of_algorithm(self):\n        # The base implementation checks for active insights\n        insights_count = len(self.insights.get_insights(lambda insight: insight.is_active(self.utc_time)))\n        if insights_count != 0:\n            raise AssertionError(f\"The number of active insights should be 0. Actual: {insights_count}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicCSharpIntegrationTemplateAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass BasicCSharpIntegrationTemplateAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        \n        self.add_equity(\"SPY\", Resolution.SECOND)\n        \n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n            ## Calculate value of sin(10) for both python and C#\n            self.debug(f'According to Python, the value of sin(10) is {np.sin(10)}')\n            self.debug(f'According to C#, the value of sin(10) is {Math.sin(10)}')\n"
  },
  {
    "path": "Algorithm.Python/BasicSetAccountCurrencyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic algorithm using SetAccountCurrency\n### </summary>\nclass BasicSetAccountCurrencyAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2018, 4, 4)  #Set Start Date\n        self.set_end_date(2018, 4, 4)    #Set End Date\n        self.set_brokerage_model(BrokerageName.GDAX, AccountType.CASH)\n        self.set_account_currency_and_amount()\n\n        self._btc_eur = self.add_crypto(\"BTCEUR\").symbol\n\n    def set_account_currency_and_amount(self):\n        # Before setting any cash or adding a Security call SetAccountCurrency\n        self.set_account_currency(\"EUR\")\n        self.set_cash(100000)           #Set Strategy Cash\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(self._btc_eur, 1)\n"
  },
  {
    "path": "Algorithm.Python/BasicSetAccountCurrencyWithAmountAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BasicSetAccountCurrencyAlgorithm import BasicSetAccountCurrencyAlgorithm\n\n### <summary>\n### Basic algorithm using SetAccountCurrency with an amount\n### </summary>\nclass BasicSetAccountCurrencyWithAmountAlgorithm(BasicSetAccountCurrencyAlgorithm):\n    def set_account_currency_and_amount(self):\n        # Before setting any cash or adding a Security call SetAccountCurrency\n        self.set_account_currency(\"EUR\", 200000)\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm simply initializes the date range and cash. This is a skeleton\n### framework you can use for designing an algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.debug(\"numpy test >>> print numpy.pi: \" + str(np.pi))\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateAxosAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm for the Axos brokerage\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateAxosAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.set_brokerage_model(BrokerageName.AXOS)\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            # will set 25% of our buying power with a market order\n            self.set_holdings(\"SPY\", 0.25)\n            self.debug(\"Purchased SPY!\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateCfdAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\r\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n\r\nfrom AlgorithmImports import *\r\n\r\n### <summary>\r\n### The demonstration algorithm shows some of the most common order methods when working with CFD assets.\r\n### </summary>\r\n### <meta name=\"tag\" content=\"using data\" />\r\n### <meta name=\"tag\" content=\"using quantconnect\" />\r\n### <meta name=\"tag\" content=\"trading and orders\" />\r\n\r\nclass BasicTemplateCfdAlgorithm(QCAlgorithm):\r\n\r\n    def initialize(self):\r\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\r\n        self.set_account_currency('EUR')\r\n\r\n        self.set_start_date(2019, 2, 20)\r\n        self.set_end_date(2019, 2, 21)\r\n        self.set_cash('EUR', 100000)\r\n\r\n        self._symbol = self.add_cfd('DE30EUR').symbol\r\n\r\n        # Historical Data\r\n        history = self.history(self._symbol, 60, Resolution.DAILY)\r\n        self.log(f\"Received {len(history)} bars from CFD historical data call.\")\r\n\r\n    def on_data(self, data):\r\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\r\n        Arguments:\r\n            slice: Slice object keyed by symbol containing the stock data\r\n        '''\r\n        # Access Data\r\n        if data.quote_bars.contains_key(self._symbol):\r\n            quote_bar = data.quote_bars[self._symbol]\r\n            self.log(f\"{quote_bar.end_time} :: {quote_bar.close}\")\r\n\r\n        if not self.portfolio.invested:\r\n            self.set_holdings(self._symbol, 1)\r\n\r\n    def on_order_event(self, order_event):\r\n        self.debug(\"{} {}\".format(self.time, order_event.to_string()))\r\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic Continuous Futures Template Algorithm\n### </summary>\nclass BasicTemplateContinuousFutureAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 7, 1)\n        self.set_end_date(2014, 1, 1)\n\n        self._continuous_contract = self.add_future(Futures.Indices.SP_500_E_MINI,\n                                                  data_normalization_mode = DataNormalizationMode.BACKWARDS_RATIO,\n                                                  data_mapping_mode = DataMappingMode.LAST_TRADING_DAY,\n                                                  contract_depth_offset = 0)\n\n        self._fast = self.sma(self._continuous_contract.symbol, 4, Resolution.DAILY)\n        self._slow = self.sma(self._continuous_contract.symbol, 10, Resolution.DAILY)\n        self._current_contract = None\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        for changed_event in data.symbol_changed_events.values():\n            if changed_event.symbol == self._continuous_contract.symbol:\n                self.log(f\"SymbolChanged event: {changed_event}\")\n\n        if not self.portfolio.invested:\n            if self._fast.current.value > self._slow.current.value:\n                self._current_contract = self.securities[self._continuous_contract.mapped]\n                self.buy(self._current_contract.symbol, 1)\n        elif self._fast.current.value < self._slow.current.value:\n            self.liquidate()\n\n        # We check exchange hours because the contract mapping can call OnData outside of regular hours.\n        if self._current_contract is not None and self._current_contract.symbol != self._continuous_contract.mapped and self._continuous_contract.exchange.exchange_open:\n            self.log(f\"{self.time} - rolling position from {self._current_contract.symbol} to {self._continuous_contract.mapped}\")\n\n            current_position_size = self._current_contract.holdings.quantity\n            self.liquidate(self._current_contract.symbol)\n            self.buy(self._continuous_contract.mapped, current_position_size)\n            self._current_contract = self.securities[self._continuous_contract.mapped]\n\n    def on_order_event(self, order_event):\n        self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n\n    def on_securities_changed(self, changes):\n        self.debug(f\"{self.time}-{changes}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic Continuous Futures Template Algorithm with extended market hours\n### </summary>\nclass BasicTemplateContinuousFutureWithExtendedMarketAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 7, 1)\n        self.set_end_date(2014, 1, 1)\n\n        self._continuous_contract = self.add_future(Futures.Indices.SP_500_E_MINI,\n                                                  data_normalization_mode = DataNormalizationMode.BACKWARDS_RATIO,\n                                                  data_mapping_mode = DataMappingMode.LAST_TRADING_DAY,\n                                                  contract_depth_offset = 0,\n                                                  extended_market_hours = True)\n\n        self._fast = self.sma(self._continuous_contract.symbol, 4, Resolution.DAILY)\n        self._slow = self.sma(self._continuous_contract.symbol, 10, Resolution.DAILY)\n        self._current_contract = None\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        for changed_event in data.symbol_changed_events.values():\n            if changed_event.symbol == self._continuous_contract.symbol:\n                self.log(f\"SymbolChanged event: {changed_event}\")\n\n        if not self.is_market_open(self._continuous_contract.symbol):\n            return\n\n        if not self.portfolio.invested:\n            if self._fast.current.value > self._slow.current.value:\n                self._current_contract = self.securities[self._continuous_contract.mapped]\n                self.buy(self._current_contract.symbol, 1)\n        elif self._fast.current.value < self._slow.current.value:\n            self.liquidate()\n\n        if self._current_contract is not None and self._current_contract.symbol != self._continuous_contract.mapped:\n            self.log(f\"{Time} - rolling position from {self._current_contract.symbol} to {self._continuous_contract.mapped}\")\n\n            current_position_size = self._current_contract.holdings.quantity\n            self.liquidate(self._current_contract.symbol)\n            self.buy(self._continuous_contract.mapped, current_position_size)\n            self._current_contract = self.securities[self._continuous_contract.mapped]\n\n    def on_order_event(self, order_event):\n        self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n\n    def on_securities_changed(self, changes):\n        self.debug(f\"{self.time}-{changes}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateCryptoAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### The demonstration algorithm shows some of the most common order methods when working with Crypto assets.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateCryptoAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2018, 4, 4)  #Set Start Date\n        self.set_end_date(2018, 4, 4)    #Set End Date\n\n        # Although typically real brokerages as GDAX only support a single account currency,\n        # here we add both USD and EUR to demonstrate how to handle non-USD account currencies.\n        # Set Strategy Cash (USD)\n        self.set_cash(10000)\n\n        # Set Strategy Cash (EUR)\n        # EUR/USD conversion rate will be updated dynamically\n        self.set_cash(\"EUR\", 10000)\n\n        # Add some coins as initial holdings\n        # When connected to a real brokerage, the amount specified in SetCash\n        # will be replaced with the amount in your actual account.\n        self.set_cash(\"BTC\", 1)\n        self.set_cash(\"ETH\", 5)\n\n        self.set_brokerage_model(BrokerageName.GDAX, AccountType.CASH)\n\n        # You can uncomment the following lines when live trading with GDAX,\n        # to ensure limit orders will only be posted to the order book and never executed as a taker (incurring fees).\n        # Please note this statement has no effect in backtesting or paper trading.\n        # self.default_order_properties = GDAXOrderProperties()\n        # self.default_order_properties.post_only = True\n\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_crypto(\"BTCUSD\", Resolution.MINUTE)\n        self.add_crypto(\"ETHUSD\", Resolution.MINUTE)\n        self.add_crypto(\"BTCEUR\", Resolution.MINUTE)\n        symbol = self.add_crypto(\"LTCUSD\", Resolution.MINUTE).symbol\n\n        # create two moving averages\n        self.fast = self.ema(symbol, 30, Resolution.MINUTE)\n        self.slow = self.ema(symbol, 60, Resolution.MINUTE)\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n\n        # Note: all limit orders in this algorithm will be paying taker fees,\n        # they shouldn't, but they do (for now) because of this issue:\n        # https://github.com/QuantConnect/Lean/issues/1852\n\n        if self.time.hour == 1 and self.time.minute == 0:\n            # Sell all ETH holdings with a limit order at 1% above the current price\n            limit_price = round(self.securities[\"ETHUSD\"].price * 1.01, 2)\n            quantity = self.portfolio.cash_book[\"ETH\"].amount\n            self.limit_order(\"ETHUSD\", -quantity, limit_price)\n\n        elif self.time.hour == 2 and self.time.minute == 0:\n            # Submit a buy limit order for BTC at 5% below the current price\n            usd_total = self.portfolio.cash_book[\"USD\"].amount\n            limit_price = round(self.securities[\"BTCUSD\"].price * 0.95, 2)\n            # use only half of our total USD\n            quantity = usd_total * 0.5 / limit_price\n            self.limit_order(\"BTCUSD\", quantity, limit_price)\n\n        elif self.time.hour == 2 and self.time.minute == 1:\n            # Get current USD available, subtracting amount reserved for buy open orders\n            usd_total = self.portfolio.cash_book[\"USD\"].amount\n            usd_reserved = sum(x.quantity * x.limit_price for x\n                in [x for x in self.transactions.get_open_orders()\n                    if x.direction == OrderDirection.BUY\n                        and x.type == OrderType.LIMIT\n                        and (x.symbol.value == \"BTCUSD\" or x.symbol.value == \"ETHUSD\")])\n            usd_available = usd_total - usd_reserved\n            self.debug(\"usd_available: {}\".format(usd_available))\n\n            # Submit a marketable buy limit order for ETH at 1% above the current price\n            limit_price = round(self.securities[\"ETHUSD\"].price * 1.01, 2)\n\n            # use all of our available USD\n            quantity = usd_available / limit_price\n\n            # this order will be rejected (for now) because of this issue:\n            # https://github.com/QuantConnect/Lean/issues/1852\n            self.limit_order(\"ETHUSD\", quantity, limit_price)\n\n            # use only half of our available USD\n            quantity = usd_available * 0.5 / limit_price\n            self.limit_order(\"ETHUSD\", quantity, limit_price)\n\n        elif self.time.hour == 11 and self.time.minute == 0:\n            # Liquidate our BTC holdings (including the initial holding)\n            self.set_holdings(\"BTCUSD\", 0)\n\n        elif self.time.hour == 12 and self.time.minute == 0:\n            # Submit a market buy order for 1 BTC using EUR\n            self.buy(\"BTCEUR\", 1)\n\n            # Submit a sell limit order at 10% above market price\n            limit_price = round(self.securities[\"BTCEUR\"].price * 1.1, 2)\n            self.limit_order(\"BTCEUR\", -1, limit_price)\n\n        elif self.time.hour == 13 and self.time.minute == 0:\n            # Cancel the limit order if not filled\n            self.transactions.cancel_open_orders(\"BTCEUR\")\n\n        elif self.time.hour > 13:\n            # To include any initial holdings, we read the LTC amount from the cashbook\n            # instead of using Portfolio[\"LTCUSD\"].quantity\n\n            if self.fast > self.slow:\n                if self.portfolio.cash_book[\"LTC\"].amount == 0:\n                    self.buy(\"LTCUSD\", 10)\n            else:\n                if self.portfolio.cash_book[\"LTC\"].amount > 0:\n                    self.liquidate(\"LTCUSD\")\n\n    def on_order_event(self, order_event):\n        self.debug(\"{} {}\".format(self.time, order_event.to_string()))\n\n    def on_end_of_algorithm(self):\n        self.log(\"{} - TotalPortfolioValue: {}\".format(self.time, self.portfolio.total_portfolio_value))\n        self.log(\"{} - CashBook: {}\".format(self.time, self.portfolio.cash_book))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Minute resolution regression algorithm trading Coin and USDT binance futures long and short asserting the behavior\n### </summary>\nclass BasicTemplateCryptoFutureAlgorithm(QCAlgorithm):\n    # <summary>\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    # </summary>\n\n    def initialize(self):\n        self.set_start_date(2022, 12, 13)\n        self.set_end_date(2022, 12, 13)\n\n        self.set_time_zone(TimeZones.UTC)\n\n        try:\n            self.set_brokerage_model(BrokerageName.BINANCE_FUTURES, AccountType.CASH)\n        except:\n            # expected, we don't allow cash account type\n            pass\n\n        self.set_brokerage_model(BrokerageName.BINANCE_FUTURES, AccountType.MARGIN)\n\n        self.btc_usd = self.add_crypto_future(\"BTCUSD\")\n        self.ada_usdt = self.add_crypto_future(\"ADAUSDT\")\n\n        self.fast = self.ema(self.btc_usd.symbol, 30, Resolution.MINUTE)\n        self.slow = self.ema(self.btc_usd.symbol, 60, Resolution.MINUTE)\n\n        self.interest_per_symbol = {self.btc_usd.symbol: 0, self.ada_usdt.symbol: 0}\n\n        self.set_cash(1000000)\n\n        # the amount of BTC we need to hold to trade 'BTCUSD'\n        self.btc_usd.base_currency.set_amount(0.005)\n        # the amount of USDT we need to hold to trade 'ADAUSDT'\n        self.ada_usdt.quote_currency.set_amount(200)\n\n    # <summary>\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    # </summary>\n    # <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n    def on_data(self, slice):\n        interest_rates = slice.Get(MarginInterestRate)\n        for interest_rate in interest_rates:\n            self.interest_per_symbol[interest_rate.key] += 1\n            self.cached_interest_rate = self.securities[interest_rate.key].cache.get_data(MarginInterestRate)\n            if self.cached_interest_rate != interest_rate.value:\n                raise AssertionError(f\"Unexpected cached margin interest rate for {interest_rate.key}!\")\n            \n        if self.fast > self.slow:\n            if self.portfolio.invested == False and self.transactions.orders_count == 0:\n                self.ticket = self.buy(self.btc_usd.symbol, 50)\n                if self.ticket.status != OrderStatus.INVALID:\n                    raise AssertionError(f\"Unexpected valid order {self.ticket}, should fail due to margin not sufficient\")\n                \n                self.buy(self.btc_usd.symbol, 1)\n\n                self.margin_used = self.portfolio.total_margin_used\n                self.btc_usd_holdings = self.btc_usd.holdings\n                # Coin futures value is 100 USD\n                self.holdings_value_btc_usd = 100\n\n                if abs(self.btc_usd_holdings.total_sale_volume - self.holdings_value_btc_usd) > 1:\n                    raise AssertionError(f\"Unexpected TotalSaleVolume {self.btc_usd_holdings.total_sale_volume}\")\n                \n                if abs(self.btc_usd_holdings.absolute_holdings_cost - self.holdings_value_btc_usd) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {self.btc_usd_holdings.holdings_cost}\")\n                \n                # margin used is based on the maintenance rate\n                if BuyingPowerModelExtensions.get_maintenance_margin(self.btc_usd.buying_power_model, self.btc_usd) != self.margin_used:\n                    raise AssertionError(f\"Unexpected margin used {self.margin_used}\")\n                \n                self.buy(self.ada_usdt.symbol, 1000)\n\n                self.margin_used = self.portfolio.total_margin_used - self.margin_used\n                self.ada_usdt_holdings = self.ada_usdt.holdings\n\n                # USDT/BUSD futures value is based on it's price\n                self.holdings_value_usdt = self.ada_usdt.price * self.ada_usdt.symbol_properties.contract_multiplier * 1000\n\n                if abs(self.ada_usdt_holdings.total_sale_volume - self.holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected TotalSaleVolume {self.ada_usdt_holdings.total_sale_volume}\")\n                \n                if abs(self.ada_usdt_holdings.absolute_holdings_cost - self.holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {self.ada_usdt_holdings.holdings_cost}\")\n                \n                if BuyingPowerModelExtensions.get_maintenance_margin(self.ada_usdt.buying_power_model, self.ada_usdt) != self.margin_used:\n                    raise AssertionError(f\"Unexpected margin used {self.margin_used}\")\n                \n                # position just opened should be just spread here\n                self.profit = self.portfolio.total_unrealized_profit\n                \n                if (5 - abs(self.profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n\n                if (self.portfolio.total_profit != 0):\n                    raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n                \n        else:\n            if self.time.hour > 10 and self.transactions.orders_count == 3:\n                self.sell(self.btc_usd.symbol, 3)\n                self.btc_usd_holdings = self.btc_usd.holdings\n                if abs(self.btc_usd_holdings.absolute_holdings_cost - 100 * 2) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {self.btc_usd_holdings.holdings_cost}\")\n\n                self.sell(self.ada_usdt.symbol, 3000)\n                ada_usdt_holdings = self.ada_usdt.holdings\n\n                # USDT/BUSD futures value is based on it's price\n                holdings_value_usdt = self.ada_usdt.price * self.ada_usdt.symbol_properties.contract_multiplier * 2000\n\n                if abs(ada_usdt_holdings.absolute_holdings_cost - holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {ada_usdt_holdings.holdings_cost}\")\n\n                # position just opened should be just spread here\n                profit = self.portfolio.total_unrealized_profit\n                if (5 - abs(profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n                # we barely did any difference on the previous trade\n                if (5 - abs(self.portfolio.total_profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n\n                                            \n    def on_end_of_algorithm(self):\n        if self.interest_per_symbol[self.ada_usdt.symbol] != 1:\n                raise AssertionError(f\"Unexpected interest rate count {self.interest_per_symbol[self.ada_usdt.symbol]}\")\n        if self.interest_per_symbol[self.btc_usd.symbol] != 3:\n                raise AssertionError(f\"Unexpected interest rate count {self.interest_per_symbol[self.btc_usd.symbol]}\")\n\n    def on_order_event(self, order_event):\n        self.debug(\"{0} {1}\".format(self.time, order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Hourly regression algorithm trading ADAUSDT binance futures long and short asserting the behavior\n### </summary>\nclass BasicTemplateCryptoFutureHourlyAlgorithm(QCAlgorithm):\n    # <summary>\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    # </summary>\n\n    def initialize(self):\n        self.set_start_date(2022, 12, 13)\n        self.set_end_date(2022, 12, 13)\n\n        self.set_time_zone(TimeZones.UTC)\n\n        try:\n            self.set_brokerage_model(BrokerageName.BINANCE_COIN_FUTURES, AccountType.CASH)\n        except:\n            # expected, we don't allow cash account type\n            pass\n\n        self.set_brokerage_model(BrokerageName.BINANCE_COIN_FUTURES, AccountType.MARGIN)\n\n        self.ada_usdt = self.add_crypto_future(\"ADAUSDT\", Resolution.HOUR)\n\n        self.fast = self.ema(self.ada_usdt.symbol, 3, Resolution.HOUR)\n        self.slow = self.ema(self.ada_usdt.symbol, 6, Resolution.HOUR)\n\n        self.interest_per_symbol = {self.ada_usdt.symbol: 0}\n\n        # Default USD cash, set 1M but it wont be used\n        self.set_cash(1000000)\n\n        # the amount of USDT we need to hold to trade 'ADAUSDT'\n        self.ada_usdt.quote_currency.set_amount(200)\n\n    # <summary>\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    # </summary>\n    # <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n    def on_data(self, slice):\n        interest_rates = slice.get(MarginInterestRate);\n        for interest_rate in interest_rates:\n            self.interest_per_symbol[interest_rate.key] += 1\n            self.cached_interest_rate = self.securities[interest_rate.key].cache.get_data(MarginInterestRate)\n            if self.cached_interest_rate != interest_rate.value:\n                raise AssertionError(f\"Unexpected cached margin interest rate for {interest_rate.key}!\")\n\n        if self.fast > self.slow:\n            if self.portfolio.invested == False and self.transactions.orders_count == 0:\n                self.ticket = self.buy(self.ada_usdt.symbol, 100000)\n                if self.ticket.status != OrderStatus.INVALID:\n                    raise AssertionError(f\"Unexpected valid order {self.ticket}, should fail due to margin not sufficient\")\n\n                self.buy(self.ada_usdt.symbol, 1000)\n\n                self.margin_used = self.portfolio.total_margin_used\n\n                self.ada_usdt_holdings = self.ada_usdt.holdings\n\n                # USDT/BUSD futures value is based on it's price\n                self.holdings_value_usdt = self.ada_usdt.price * self.ada_usdt.symbol_properties.contract_multiplier * 1000\n\n                if abs(self.ada_usdt_holdings.total_sale_volume - self.holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected TotalSaleVolume {self.ada_usdt_holdings.total_sale_volume}\")\n\n                if abs(self.ada_usdt_holdings.absolute_holdings_cost - self.holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {self.ada_usdt_holdings.holdings_cost}\")\n\n                if BuyingPowerModelExtensions.get_maintenance_margin(self.ada_usdt.buying_power_model, self.ada_usdt) != self.margin_used:\n                    raise AssertionError(f\"Unexpected margin used {self.margin_used}\")\n\n                # position just opened should be just spread here\n                self.profit = self.portfolio.total_unrealized_profit\n\n                if (5 - abs(self.profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n\n                if (self.portfolio.total_profit != 0):\n                    raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n\n        else:\n            # let's revert our position and double\n            if self.time.hour > 10 and self.transactions.orders_count == 2:\n                self.sell(self.ada_usdt.symbol, 3000)\n\n                self.ada_usdt_holdings = self.ada_usdt.holdings\n\n                # USDT/BUSD futures value is based on it's price\n                self.holdings_value_usdt = self.ada_usdt.price * self.ada_usdt.symbol_properties.contract_multiplier * 2000\n\n                if abs(self.ada_usdt_holdings.absolute_holdings_cost - self.holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {self.ada_usdt_holdings.holdings_cost}\")\n\n                # position just opened should be just spread here\n                self.profit = self.portfolio.total_unrealized_profit\n                if (5 - abs(self.profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n\n                # we barely did any difference on the previous trade\n                if (5 - abs(self.portfolio.total_profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n\n            if self.time.hour >= 22 and self.transactions.orders_count == 3:\n                self.liquidate()\n\n    def on_end_of_algorithm(self):\n        if self.interest_per_symbol[self.ada_usdt.symbol] != 1:\n                raise AssertionError(f\"Unexpected interest rate count {self.interest_per_symbol[self.ada_usdt.symbol]}\")\n\n    def on_order_event(self, order_event):\n        self.debug(\"{0} {1}\".format(self.time, order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateDailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of requesting daily resolution data for US Equities.\n### This is a simple regression test algorithm using a skeleton algorithm and requesting daily data.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\nclass BasicTemplateDailyAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,8)   #Set Start Date\n        self.set_end_date(2013,10,17)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n            self.debug(\"Purchased Stock\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateEurexFuturesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm tests and demonstrates EUREX futures subscription and trading:\n### - It tests contracts rollover by adding a continuous future and asserting that mapping happens at some point.\n### - It tests basic trading by buying a contract and holding it until expiration.\n### - It tests delisting and asserts the holdings are liquidated after that.\n### </summary>\nclass BasicTemplateEurexFuturesAlgorithm(QCAlgorithm):\n    def __init__(self):\n        super().__init__()\n        self._continuous_contract = None\n        self._mapped_symbol = None\n        self._contract_to_trade = None\n        self._mappings_count = 0\n        self._bought_quantity = 0\n        self._liquidated_quantity = 0\n        self._delisted = False\n\n    def initialize(self):\n        self.set_start_date(2024, 5, 30)\n        self.set_end_date(2024, 6, 23)\n\n        self.set_account_currency(Currencies.EUR);\n        self.set_cash(1000000)\n\n        self._continuous_contract = self.add_future(\n            Futures.Indices.EURO_STOXX_50,\n            Resolution.MINUTE,\n            data_normalization_mode=DataNormalizationMode.BACKWARDS_RATIO,\n            data_mapping_mode=DataMappingMode.FIRST_DAY_MONTH,\n            contract_depth_offset=0,\n        )\n        self._continuous_contract.set_filter(timedelta(days=0), timedelta(days=180))\n        self._mapped_symbol = self._continuous_contract.mapped\n\n        benchmark = self.add_index(\"SX5E\")\n        self.set_benchmark(benchmark.symbol)\n\n        func_seeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(lambda security: func_seeder.seed_security(security))\n\n    def on_data(self, slice):\n        for changed_event in slice.symbol_changed_events.values():\n            self._mappings_count += 1\n            if self._mappings_count > 1:\n                raise AssertionError(f\"{self.time} - Unexpected number of symbol changed events (mappings): {self._mappings_count}. Expected only 1.\")\n\n            self.debug(f\"{self.time} - SymbolChanged event: {changed_event}\")\n\n            if changed_event.old_symbol != str(self._mapped_symbol.id):\n                raise AssertionError(f\"{self.time} - Unexpected symbol changed event old symbol: {changed_event}\")\n\n            if changed_event.new_symbol != str(self._continuous_contract.mapped.id):\n                raise AssertionError(f\"{self.time} - Unexpected symbol changed event new symbol: {changed_event}\")\n\n            # Let's trade the previous mapped contract, so we can hold it until expiration for testing\n            # (will be sooner than the new mapped contract)\n            self._contract_to_trade = self._mapped_symbol\n            self._mapped_symbol = self._continuous_contract.mapped\n\n        # Let's trade after the mapping is done\n        if self._contract_to_trade is not None and self._bought_quantity == 0 and self.securities[self._contract_to_trade].exchange.exchange_open:\n            self.buy(self._contract_to_trade, 1)\n\n        if self._contract_to_trade is not None and slice.delistings.contains_key(self._contract_to_trade):\n            delisting = slice.delistings[self._contract_to_trade]\n            if delisting.type == DelistingType.DELISTED:\n                self._delisted = True\n\n                if self.portfolio.invested:\n                    raise AssertionError(f\"{self.time} - Portfolio should not be invested after the traded contract is delisted.\")\n\n    def on_order_event(self, order_event):\n        if order_event.symbol != self._contract_to_trade:\n            raise AssertionError(f\"{self.time} - Unexpected order event symbol: {order_event.symbol}. Expected {self._contract_to_trade}\")\n\n        if order_event.direction == OrderDirection.BUY:\n            if order_event.status == OrderStatus.FILLED:\n                if self._bought_quantity != 0 and self._liquidated_quantity != 0:\n                    raise AssertionError(f\"{self.time} - Unexpected buy order event status: {order_event.status}\")\n\n                self._bought_quantity = order_event.quantity\n        elif order_event.direction == OrderDirection.SELL:\n            if order_event.status == OrderStatus.FILLED:\n                if self._bought_quantity <= 0 and self._liquidated_quantity != 0:\n                    raise AssertionError(f\"{self.time} - Unexpected sell order event status: {order_event.status}\")\n\n                self._liquidated_quantity = order_event.quantity\n                if self._liquidated_quantity != -self._bought_quantity:\n                    raise AssertionError(f\"{self.time} - Unexpected liquidated quantity: {self._liquidated_quantity}. Expected: {-self._bought_quantity}\")\n\n    def on_securities_changed(self, changes):\n        for added_security in changes.added_securities:\n            if added_security.symbol.security_type == SecurityType.FUTURE and added_security.symbol.is_canonical():\n                self._mapped_symbol = self._continuous_contract.mapped\n\n    def on_end_of_algorithm(self):\n        if self._mappings_count == 0:\n            raise AssertionError(f\"Unexpected number of symbol changed events (mappings): {self._mappings_count}. Expected 1.\")\n\n        if not self._delisted:\n            raise AssertionError(\"Contract was not delisted\")\n\n        # Make sure we traded and that the position was liquidated on delisting\n        if self._bought_quantity <= 0 or self._liquidated_quantity >= 0:\n            raise AssertionError(f\"Unexpected sold quantity: {self._bought_quantity} and liquidated quantity: {self._liquidated_quantity}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFillForwardAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass BasicTemplateFillForwardAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        \n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,11,30)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_security(SecurityType.EQUITY, \"ASUR\", Resolution.SECOND)\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        \n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"ASUR\", 1)\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateForexAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating FOREX asset types and requesting history on them in bulk. As FOREX uses\n### QuoteBars you should request slices\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"forex\" />\nclass BasicTemplateForexAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # Set the cash we'd like to use for our backtest\n        self.set_cash(100000)\n\n        # Start and end dates for the backtest.\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        # Add FOREX contract you want to trade\n        # find available contracts here https://www.quantconnect.com/data#forex/oanda/cfd\n        self.add_forex(\"EURUSD\", Resolution.MINUTE)\n        self.add_forex(\"GBPUSD\", Resolution.MINUTE)\n        self.add_forex(\"EURGBP\", Resolution.MINUTE)\n\n        self.history(5, Resolution.DAILY)\n        self.history(5, Resolution.HOUR)\n        self.history(5, Resolution.MINUTE)\n\n        history = self.history(TimeSpan.from_seconds(5), Resolution.SECOND)\n\n        for data in sorted(history, key=lambda x: x.time):\n            for key in data.keys():\n                self.log(str(key.value) + \": \" + str(data.time) + \" > \" + str(data[key].value))\n\n    def on_data(self, data):\n        # Print to console to verify that data is coming in\n        for key in data.keys():\n            self.log(str(key.value) + \": \" + str(data.time) + \" > \" + str(data[key].value))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template framework algorithm uses framework components to define the algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateFrameworkAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # Find more symbols here: http://quantconnect.com/data\n        # Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.\n        # Futures Resolution: Tick, Second, Minute\n        # Options Resolution: Minute Only.\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n\n        # We can define how often the EWPCM will rebalance if no new insight is submitted using:\n        # Resolution Enum:\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Resolution.DAILY))\n        # timedelta\n        # self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(timedelta(2)))\n        # A lamdda datetime -> datetime. In this case, we can use the pre-defined func at Expiry helper class\n        # self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Expiry.END_OF_WEEK))\n\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n\n        self.debug(\"numpy test >>> print numpy.pi: \" + str(np.pi))\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFutureOptionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\r\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n\r\nfrom AlgorithmImports import *\r\n\r\n### <summary>\r\n### The demonstration algorithm shows some of the most common order methods when working with FutureOption assets.\r\n### </summary>\r\n### <meta name=\"tag\" content=\"using data\" />\r\n### <meta name=\"tag\" content=\"using quantconnect\" />\r\n### <meta name=\"tag\" content=\"trading and orders\" />\r\n\r\nclass BasicTemplateFutureOptionAlgorithm(QCAlgorithm):\r\n\r\n    def initialize(self):\r\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\r\n        self.set_start_date(2022, 1, 1)\r\n        self.set_end_date(2022, 2, 1)\r\n        self.set_cash(100000)\r\n\r\n        gold_futures = self.add_future(Futures.Metals.GOLD, Resolution.MINUTE)\r\n        gold_futures.set_filter(0, 180)\r\n        self._symbol = gold_futures.symbol\r\n        self.add_future_option(self._symbol, lambda universe: universe.strikes(-5, +5)\r\n                                                                    .calls_only()\r\n                                                                    .back_month()\r\n                                                                    .only_apply_filter_at_market_open())\r\n\r\n        # Historical Data\r\n        history = self.history(self._symbol, 60, Resolution.DAILY)\r\n        self.log(f\"Received {len(history)} bars from {self._symbol} FutureOption historical data call.\")\r\n\r\n    def on_data(self, data):\r\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\r\n        Arguments:\r\n            slice: Slice object keyed by symbol containing the stock data\r\n        '''\r\n        # Access Data\r\n        for kvp in data.option_chains:\r\n            underlying_future_contract = kvp.key.underlying\r\n            chain = kvp.value\r\n\r\n            if not chain: continue\r\n\r\n            for contract in chain:\r\n                self.log(f\"\"\"Canonical Symbol: {kvp.key}; \r\n                    Contract: {contract}; \r\n                    Right: {contract.right}; \r\n                    Expiry: {contract.expiry}; \r\n                    Bid price: {contract.bid_price}; \r\n                    Ask price: {contract.ask_price}; \r\n                    Implied Volatility: {contract.implied_volatility}\"\"\")\r\n\r\n            if not self.portfolio.invested:\r\n                atm_strike = sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike))[0].strike\r\n                selected_contract = sorted([contract for contract in chain if contract.strike == atm_strike], \\\r\n                           key = lambda x: x.expiry, reverse=True)[0]\r\n                self.market_order(selected_contract.symbol, 1)\r\n\r\n    def on_order_event(self, order_event):\r\n        self.debug(\"{} {}\".format(self.time, order_event.to_string()))\r\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFutureRolloverAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm for trading continuous future\n### </summary>\nclass BasicTemplateFutureRolloverAlgorithm(QCAlgorithm):\n\n    ### <summary>\n    ### Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    ### </summary>\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 12, 10)\n        self.set_cash(1000000)\n\n        self._symbol_data_by_symbol = {}\n        \n        futures = [\n            Futures.Indices.SP_500_E_MINI\n        ]\n\n        for future in futures:\n            # Requesting data\n            continuous_contract = self.add_future(future,\n                resolution = Resolution.DAILY,\n                extended_market_hours = True,\n                data_normalization_mode = DataNormalizationMode.BACKWARDS_RATIO,\n                data_mapping_mode = DataMappingMode.OPEN_INTEREST,\n                contract_depth_offset = 0\n            )\n            \n            symbol_data = SymbolData(self, continuous_contract)\n            self._symbol_data_by_symbol[continuous_contract.symbol] = symbol_data\n\n    ### <summary>\n    ### on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    ### </summary>\n    ### <param name=\"slice\">Slice object keyed by symbol containing the stock data</param>\n    def on_data(self, slice):\n        for symbol, symbol_data in self._symbol_data_by_symbol.items():\n            # Call SymbolData.update() method to handle new data slice received\n            symbol_data.update(slice)\n            \n            # Check if information in SymbolData class and new slice data are ready for trading\n            if not symbol_data.is_ready or not slice.bars.contains_key(symbol):\n                return\n            \n            ema_current_value = symbol_data.EMA.current.value\n            if ema_current_value < symbol_data.price and not symbol_data.is_long:\n                self.market_order(symbol_data.mapped, 1)\n            elif ema_current_value > symbol_data.price and not symbol_data.is_short:\n                self.market_order(symbol_data.mapped, -1)\n    \n### <summary>\n### Abstracted class object to hold information (state, indicators, methods, etc.) from a Symbol/Security in a multi-security algorithm\n### </summary>\nclass SymbolData:\n    \n    ### <summary>\n    ### Constructor to instantiate the information needed to be hold\n    ### </summary>\n    def __init__(self, algorithm, future):\n        self._algorithm = algorithm\n        self._future = future\n        self.EMA = algorithm.ema(future.symbol, 20, Resolution.DAILY)\n        self.price = 0\n        self.is_long = False\n        self.is_short = False\n\n        self.reset()\n    \n    @property\n    def symbol(self):\n        return self._future.symbol\n    \n    @property\n    def mapped(self):\n        return self._future.mapped\n    \n    @property\n    def is_ready(self):\n        return self.mapped is not None and self.EMA.is_ready\n    \n    ### <summary>\n    ### Handler of new slice of data received\n    ### </summary>\n    def update(self, slice):\n        if slice.symbol_changed_events.contains_key(self.symbol):\n            changed_event = slice.symbol_changed_events[self.symbol]\n            old_symbol = changed_event.old_symbol\n            new_symbol = changed_event.new_symbol\n            tag = f\"Rollover - Symbol changed at {self._algorithm.time}: {old_symbol} -> {new_symbol}\"\n            quantity = self._algorithm.portfolio[old_symbol].quantity\n\n            # Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract\n            self._algorithm.liquidate(old_symbol, tag = tag)\n            self._algorithm.market_order(new_symbol, quantity, tag = tag)\n\n            self.reset()\n        \n        self.price = slice.bars[self.symbol].price if slice.bars.contains_key(self.symbol) else self.price\n        self.is_long = self._algorithm.portfolio[self.mapped].is_long\n        self.is_short = self._algorithm.portfolio[self.mapped].is_short\n        \n    ### <summary>\n    ### reset RollingWindow/indicator to adapt to newly mapped contract, then warm up the RollingWindow/indicator\n    ### </summary>\n    def reset(self):\n        self.EMA.reset()\n        self._algorithm.warm_up_indicator(self.symbol, self.EMA, Resolution.DAILY)\n            \n    ### <summary>\n    ### disposal method to remove consolidator/update method handler, and reset RollingWindow/indicator to free up memory and speed\n    ### </summary>\n    def dispose(self):\n        self.EMA.reset()\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add futures for a given underlying asset.\n### It also shows how you can prefilter contracts easily based on expirations, and how you\n### can inspect the futures chain to pick a specific contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 10)\n        self.set_cash(1000000)\n\n        self.contract_symbol = None\n\n        # Subscribe and set our expiry filter for the futures chain\n        futureSP500 = self.add_future(Futures.Indices.SP_500_E_MINI)\n        future_gold = self.add_future(Futures.Metals.GOLD)\n\n        # set our expiry filter for this futures chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        futureSP500.set_filter(timedelta(0), timedelta(182))\n        future_gold.set_filter(0, 182)\n\n        benchmark = self.add_equity(\"SPY\")\n        self.set_benchmark(benchmark.symbol)\n\n        seeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(lambda security: seeder.seed_security(security))\n\n    def on_data(self,slice):\n        if not self.portfolio.invested:\n            for chain in slice.future_chains:\n                 # Get contracts expiring no earlier than in 90 days\n                contracts = list(filter(lambda x: x.expiry > self.time + timedelta(90), chain.value))\n\n                # if there is any contract, trade the front contract\n                if len(contracts) == 0: continue\n                front = sorted(contracts, key = lambda x: x.expiry, reverse=True)[0]\n\n                self.contract_symbol = front.symbol\n                self.market_order(front.symbol , 1)\n        else:\n            self.liquidate()\n\n    def on_end_of_algorithm(self):\n        # Get the margin requirements\n        buying_power_model = self.securities[self.contract_symbol].buying_power_model\n        name = type(buying_power_model).__name__\n        if name != 'FutureMarginModel':\n            raise AssertionError(f\"Invalid buying power model. Found: {name}. Expected: FutureMarginModel\")\n\n        initial_overnight = buying_power_model.initial_overnight_margin_requirement\n        maintenance_overnight = buying_power_model.maintenance_overnight_margin_requirement\n        initial_intraday = buying_power_model.initial_intraday_margin_requirement\n        maintenance_intraday = buying_power_model.maintenance_intraday_margin_requirement\n\n    def on_securities_changed(self, changes):\n        for added_security in changes.added_securities:\n            if added_security.symbol.security_type == SecurityType.FUTURE and not added_security.symbol.is_canonical() and not added_security.has_data:\n                raise AssertionError(f\"Future contracts did not work up as expected: {added_security.symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesConsolidationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### A demonstration of consolidating futures data into larger bars for your algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesConsolidationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(1000000)\n\n        # Subscribe and set our expiry filter for the futures chain\n        futureSP500 = self.add_future(Futures.Indices.SP_500_E_MINI)\n        # set our expiry filter for this future chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        futureSP500.set_filter(0, 182)\n        # future.set_filter(timedelta(0), timedelta(182))\n\n        self.consolidators = dict()\n\n    def on_data(self,slice):\n        pass\n\n    def on_data_consolidated(self, sender, quote_bar):\n        self.log(\"OnDataConsolidated called on \" + str(self.time))\n        self.log(str(quote_bar))\n        \n    def on_securities_changed(self, changes):\n        for security in changes.added_securities:\n            consolidator = QuoteBarConsolidator(timedelta(minutes=5))\n            consolidator.data_consolidated += self.on_data_consolidated\n            self.subscription_manager.add_consolidator(security.symbol, consolidator)\n            self.consolidators[security.symbol] = consolidator\n            \n        for security in changes.removed_securities:\n            consolidator = self.consolidators.pop(security.symbol)\n            self.subscription_manager.remove_consolidator(security.symbol, consolidator)\n            consolidator.data_consolidated -= self.on_data_consolidated\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesDailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add futures with daily resolution.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesDailyAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2014, 10, 10)\n        self.set_cash(1000000)\n\n        resolution = self.get_resolution()\n        extended_market_hours = self.get_extended_market_hours()\n\n        # Subscribe and set our expiry filter for the futures chain\n        self.future_sp500 = self.add_future(Futures.Indices.SP_500_E_MINI, resolution, extended_market_hours=extended_market_hours)\n        self.future_gold = self.add_future(Futures.Metals.GOLD, resolution, extended_market_hours=extended_market_hours)\n\n        # set our expiry filter for this futures chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        self.future_sp500.set_filter(timedelta(0), timedelta(182))\n        self.future_gold.set_filter(0, 182)\n\n    def on_data(self,slice):\n        if not self.portfolio.invested:\n            for chain in slice.future_chains:\n                 # Get contracts expiring no earlier than in 90 days\n                contracts = list(filter(lambda x: x.expiry > self.time + timedelta(90), chain.value))\n\n                # if there is any contract, trade the front contract\n                if len(contracts) == 0: continue\n                contract = sorted(contracts, key = lambda x: x.expiry)[0]\n\n                # if found, trade it.\n                self.market_order(contract.symbol, 1)\n        # Same as above, check for cases like trading on a friday night.\n        elif all(x.exchange.hours.is_open(self.time, True) for x in self.securities.values() if x.invested):\n            self.liquidate()\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        if len(changes.removed_securities) > 0 and \\\n            self.portfolio.invested and \\\n            all(x.exchange.hours.is_open(self.time, True) for x in self.securities.values() if x.invested):\n            self.liquidate()\n\n    def get_resolution(self):\n        return Resolution.DAILY\n\n    def get_extended_market_hours(self):\n        return False\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Alphas.ConstantAlphaModel import ConstantAlphaModel\nfrom Selection.FutureUniverseSelectionModel import FutureUniverseSelectionModel\n\n### <summary>\n### Basic template futures framework algorithm uses framework components\n### to define an algorithm that trades futures.\n### </summary>\nclass BasicTemplateFuturesFrameworkAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.universe_settings.extended_market_hours = self.get_extended_market_hours()\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        # set framework models\n        self.set_universe_selection(FrontMonthFutureUniverseSelectionModel(self.select_future_chain_symbols))\n        self.set_alpha(ConstantFutureContractAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(SingleSharePortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n\n    def select_future_chain_symbols(self, utc_time):\n        new_york_time = Extensions.convert_from_utc(utc_time, TimeZones.NEW_YORK)\n        if new_york_time.date() < date(2013, 10, 9):\n            return [ Symbol.create(Futures.Indices.SP_500_E_MINI, SecurityType.FUTURE, Market.CME) ]\n        else:\n            return [ Symbol.create(Futures.Metals.GOLD, SecurityType.FUTURE, Market.COMEX) ]\n\n    def get_extended_market_hours(self):\n        return False\n\nclass FrontMonthFutureUniverseSelectionModel(FutureUniverseSelectionModel):\n    '''Creates futures chain universes that select the front month contract and runs a user\n    defined future_chain_symbol_selector every day to enable choosing different futures chains'''\n    def __init__(self, select_future_chain_symbols):\n        super().__init__(timedelta(1), select_future_chain_symbols)\n\n    def filter(self, filter):\n        '''Defines the futures chain universe filter'''\n        return (filter.front_month()\n                      .only_apply_filter_at_market_open())\n\nclass ConstantFutureContractAlphaModel(ConstantAlphaModel):\n    '''Implementation of a constant alpha model that only emits insights for future symbols'''\n    def __init__(self, _type, direction, period):\n        super().__init__(_type, direction, period)\n\n    def should_emit_insight(self, utc_time, symbol):\n        # only emit alpha for future symbols and not underlying equity symbols\n        if symbol.security_type != SecurityType.FUTURE:\n            return False\n\n        return super().should_emit_insight(utc_time, symbol)\n\nclass SingleSharePortfolioConstructionModel(PortfolioConstructionModel):\n    '''Portfolio construction model that sets target quantities to 1 for up insights and -1 for down insights'''\n    def create_targets(self, algorithm, insights):\n        targets = []\n        for insight in insights:\n            targets.append(PortfolioTarget(insight.symbol, insight.direction))\n        return targets\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom BasicTemplateFuturesFrameworkAlgorithm import BasicTemplateFuturesFrameworkAlgorithm\n\n### <summary>\n### Basic template futures framework algorithm uses framework components\n### to define an algorithm that trades futures.\n### </summary>\nclass BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm(BasicTemplateFuturesFrameworkAlgorithm):\n\n    def get_extended_market_hours(self):\n        return True\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to get access to futures history for a given root symbol.\n### It also shows how you can prefilter contracts easily based on expirations, and inspect the futures\n### chain to pick a specific contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesHistoryAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 9)\n        self.set_cash(1000000)\n\n        extended_market_hours = self.get_extended_market_hours()\n\n        # Subscribe and set our expiry filter for the futures chain\n        # find the front contract expiring no earlier than in 90 days\n        future_es = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.MINUTE, extended_market_hours=extended_market_hours)\n        future_es.set_filter(timedelta(0), timedelta(182))\n\n        future_gc = self.add_future(Futures.Metals.GOLD, Resolution.MINUTE, extended_market_hours=extended_market_hours)\n        future_gc.set_filter(timedelta(0), timedelta(182))\n\n        self.set_benchmark(lambda x: 1000000)\n\n        self.schedule.on(self.date_rules.every_day(), self.time_rules.every(timedelta(hours=1)), self.make_history_call)\n        self._success_count = 0\n\n    def make_history_call(self):\n        history = self.history(self.securities.keys(), 10, Resolution.MINUTE)\n        if len(history) < 10:\n            raise AssertionError(f'Empty history at {self.time}')\n        self._success_count += 1\n\n    def on_end_of_algorithm(self):\n        if self._success_count < self.get_expected_history_call_count():\n            raise AssertionError(f'Scheduled Event did not assert history call as many times as expected: {self._success_count}/49')\n\n    def on_data(self,slice):\n        if self.portfolio.invested: return\n        for chain in slice.future_chains:\n            for contract in chain.value:\n                self.log(f'{contract.symbol.value},' +\n                         f'Bid={contract.bid_price} ' +\n                         f'Ask={contract.ask_price} ' +\n                         f'Last={contract.last_price} ' +\n                         f'OI={contract.open_interest}')\n\n    def on_securities_changed(self, changes):\n        for change in changes.added_securities:\n            history = self.history(change.symbol, 10, Resolution.MINUTE).sort_index(level='time', ascending=False)[:3]\n\n            for index, row in history.iterrows():\n                self.log(f'History: {index[1]} : {index[2]:%m/%d/%Y %I:%M:%S %p} > {row.close}')\n\n    def on_order_event(self, order_event):\n        # Order fill event handler. On an order fill update the resulting information is passed to this method.\n        # Order event details containing details of the events\n        self.log(f'{order_event}')\n\n    def get_extended_market_hours(self):\n        return False\n\n    def get_expected_history_call_count(self):\n        return 42\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom BasicTemplateFuturesHistoryAlgorithm import BasicTemplateFuturesHistoryAlgorithm\n\n### <summary>\n### This example demonstrates how to get access to futures history for a given root symbol with extended market hours.\n### It also shows how you can prefilter contracts easily based on expirations, and inspect the futures\n### chain to pick a specific contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm(BasicTemplateFuturesHistoryAlgorithm):\n\n    def get_extended_market_hours(self):\n        return True\n\n    def get_expected_history_call_count(self):\n        return 49\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesHourlyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BasicTemplateFuturesDailyAlgorithm import BasicTemplateFuturesDailyAlgorithm\n\n### <summary>\n### This example demonstrates how to add futures with hourly resolution.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesHourlyAlgorithm(BasicTemplateFuturesDailyAlgorithm):\n\n    def get_resolution(self):\n        return Resolution.HOUR\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add futures for a given underlying asset.\n### It also shows how you can prefilter contracts easily based on expirations, and how you\n### can inspect the futures chain to pick a specific contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesWithExtendedMarketAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 10)\n        self.set_cash(1000000)\n\n        self.contract_symbol = None\n\n        # Subscribe and set our expiry filter for the futures chain\n        self.future_sp500 = self.add_future(Futures.Indices.SP_500_E_MINI, extended_market_hours = True)\n        self.future_gold = self.add_future(Futures.Metals.GOLD, extended_market_hours = True)\n\n        # set our expiry filter for this futures chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        self.future_sp500.set_filter(timedelta(0), timedelta(182))\n        self.future_gold.set_filter(0, 182)\n\n        benchmark = self.add_equity(\"SPY\")\n        self.set_benchmark(benchmark.symbol)\n\n        seeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(lambda security: seeder.seed_security(security))\n\n    def on_data(self,slice):\n        if not self.portfolio.invested:\n            for chain in slice.future_chains:\n                 # Get contracts expiring no earlier than in 90 days\n                contracts = list(filter(lambda x: x.expiry > self.time + timedelta(90), chain.value))\n\n                # if there is any contract, trade the front contract\n                if len(contracts) == 0: continue\n                front = sorted(contracts, key = lambda x: x.expiry, reverse=True)[0]\n\n                self.contract_symbol = front.symbol\n                self.market_order(front.symbol , 1)\n        else:\n            self.liquidate()\n\n    def on_end_of_algorithm(self):\n        # Get the margin requirements\n        buying_power_model = self.securities[self.contract_symbol].buying_power_model\n        name = type(buying_power_model).__name__\n        if name != 'FutureMarginModel':\n            raise AssertionError(f\"Invalid buying power model. Found: {name}. Expected: FutureMarginModel\")\n\n        initial_overnight = buying_power_model.initial_overnight_margin_requirement\n        maintenance_overnight = buying_power_model.maintenance_overnight_margin_requirement\n        initial_intraday = buying_power_model.initial_intraday_margin_requirement\n        maintenance_intraday = buying_power_model.maintenance_intraday_margin_requirement\n\n    def on_securities_changed(self, changes):\n        for added_security in changes.added_securities:\n            if added_security.symbol.security_type == SecurityType.FUTURE and not added_security.symbol.is_canonical() and not added_security.has_data:\n                raise AssertionError(f\"Future contracts did not work up as expected: {added_security.symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesWithExtendedMarketDailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BasicTemplateFuturesDailyAlgorithm import BasicTemplateFuturesDailyAlgorithm\n\n### <summary>\n### This example demonstrates how to add futures with daily resolution and extended market hours.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesWithExtendedMarketDailyAlgorithm(BasicTemplateFuturesDailyAlgorithm):\n    def get_extended_market_hours(self):\n        return True\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BasicTemplateFuturesHourlyAlgorithm import BasicTemplateFuturesHourlyAlgorithm\n\n### <summary>\n### This example demonstrates how to add futures with hourly resolution and extended market hours.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm(BasicTemplateFuturesHourlyAlgorithm):\n    def get_extended_market_hours(self):\n        return True\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIndexAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\nclass BasicTemplateIndexAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 18)\n        self.set_cash(1000000)\n\n        # Use indicator for signal; but it cannot be traded\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Trade on SPX ITM calls\n        self.spx_option = Symbol.create_option(\n            self.spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.CALL,\n            3200,\n            datetime(2021, 1, 15)\n        )\n\n        self.add_index_option_contract(self.spx_option, Resolution.MINUTE)\n\n        self.ema_slow = self.ema(self.spx, 80)\n        self.ema_fast = self.ema(self.spx, 200)\n\n    def on_data(self, data: Slice):\n        if self.spx not in data.bars or self.spx_option not in data.bars:\n            return\n\n        if not self.ema_slow.is_ready:\n            return\n\n        if self.ema_fast > self.ema_slow:\n            self.set_holdings(self.spx_option, 1)\n        else:\n            self.liquidate()\n\n    def on_end_of_algorithm(self) -> None:\n        if self.portfolio[self.spx].total_sale_volume > 0:\n            raise AssertionError(\"Index is not tradable.\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIndexDailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\nclass BasicTemplateIndexDailyAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2021, 1, 1)\n        self.set_end_date(2021, 1, 18)\n        self.set_cash(1000000)\n\n        # Use indicator for signal; but it cannot be traded\n        self.spx = self.add_index(\"SPX\", Resolution.DAILY).symbol\n\n        # Trade on SPX ITM calls\n        self.spx_option = Symbol.create_option(\n            self.spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.CALL,\n            3200,\n            datetime(2021, 1, 15)\n        )\n\n        self.add_index_option_contract(self.spx_option, Resolution.DAILY)\n\n        self.ema_slow = self.ema(self.spx, 80)\n        self.ema_fast = self.ema(self.spx, 200)\n\n        self.ExpectedBarCount = 10\n        self.BarCounter = 0\n\n        self.settings.daily_precise_end_time = True\n\n    def on_data(self, data: Slice):\n        if not self.portfolio.invested:\n            # SPX Index is not tradable, but we can trade an option\n            self.market_order(self.spx_option, 1)\n        else:\n            self.liquidate()\n\n        # Count how many slices we receive with SPX data in it to assert later\n        if data.contains_key(self.spx):\n            self.BarCounter = self.BarCounter + 1\n\n    def OnEndOfAlgorithm(self):\n        if self.BarCounter != self.ExpectedBarCount:\n            raise ValueError(f\"Bar Count {self.BarCounter} is not expected count of {self.ExpectedBarCount}\")\n\n        for symbol in [ self.spx_option, self.spx ]:\n            history = self.history(symbol, 10)\n            if len(history) != 10:\n                raise ValueError(f\"Unexpected history count: {len(history)}\")\n            if any(x for x in history.index.get_level_values('time') if x.time() != time(15, 15, 0)):\n                raise ValueError(f\"Unexpected history data time\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIndexOptionsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\nclass BasicTemplateIndexOptionsAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 2, 1)\n        self.set_cash(1000000)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        spx_options = self.add_index_option(self.spx, Resolution.MINUTE)\n        spx_options.set_filter(lambda x: x.calls_only())\n\n        self.ema_slow = self.ema(self.spx, 80)\n        self.ema_fast = self.ema(self.spx, 200)\n\n    def on_data(self, data: Slice) -> None:\n        if self.spx not in data.bars or not self.ema_slow.is_ready:\n            return\n\n        for chain in data.option_chains.values():\n            for contract in chain.contracts.values():\n                if self.portfolio.invested:\n                    continue\n\n                if (self.ema_fast > self.ema_slow and contract.right == OptionRight.CALL) or \\\n                    (self.ema_fast < self.ema_slow and contract.right == OptionRight.PUT):\n\n                    self.liquidate(self.invert_option(contract.symbol))\n                    self.market_order(contract.symbol, 1)\n\n    def on_end_of_algorithm(self) -> None:\n        if self.portfolio[self.spx].total_sale_volume > 0:\n            raise AssertionError(\"Index is not tradable.\")\n\n        if self.portfolio.total_sale_volume == 0:\n            raise AssertionError(\"Trade volume should be greater than zero by the end of this algorithm\")\n\n    def invert_option(self, symbol: Symbol) -> Symbol:\n        return Symbol.create_option(\n            symbol.underlying,\n            symbol.id.market,\n            symbol.id.option_style,\n            OptionRight.PUT if symbol.id.option_right == OptionRight.CALL else OptionRight.CALL,\n            symbol.id.strike_price,\n            symbol.id.date\n        )\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIndiaAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template framework algorithm uses framework components to define the algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateIndiaAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_account_currency(\"INR\")  #Set Account Currency \n        self.set_start_date(2019, 1, 23)  #Set Start Date\n        self.set_end_date(2019, 10, 31)   #Set End Date\n        self.set_cash(100000)            #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"YESBANK\", Resolution.MINUTE, Market.INDIA)\n        self.debug(\"numpy test >>> print numpy.pi: \" + str(np.pi))\n\n        # Set Order Properties as per the requirements for order placement\n        self.default_order_properties = IndiaOrderProperties(Exchange.NSE)\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.market_order(\"YESBANK\", 1)\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIndiaIndexAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic Template India Index Algorithm uses framework components to define the algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateIndiaIndexAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_account_currency(\"INR\") #Set Account Currency\n        self.set_start_date(2019, 1, 1)  #Set Start Date\n        self.set_end_date(2019, 1, 5)    #Set End Date\n        self.set_cash(1000000)          #Set Strategy Cash\n\n        # Use indicator for signal; but it cannot be traded\n        self.nifty = self.add_index(\"NIFTY50\", Resolution.MINUTE, Market.INDIA).symbol\n        # Trade Index based ETF\n        self.nifty_etf = self.add_equity(\"JUNIORBEES\", Resolution.MINUTE, Market.INDIA).symbol\n   \n        # Set Order Properties as per the requirements for order placement\n        self.default_order_properties = IndiaOrderProperties(Exchange.NSE)\n\n        # Define indicator\n        self._ema_slow = self.ema(self.nifty, 80)\n        self._ema_fast = self.ema(self.nifty, 200)\n\n        self.debug(\"numpy test >>> print numpy.pi: \" + str(np.pi))\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n\n        if not data.bars.contains_key(self.nifty) or not data.bars.contains_key(self.nifty_etf):\n            return\n\n        if not self._ema_slow.is_ready:\n            return\n\n        if self._ema_fast > self._ema_slow:\n            if not self.portfolio.invested:\n                self.market_ticket = self.market_order(self.nifty_etf, 1)\n        else:\n            self.liquidate()\n\n\n    def on_end_of_algorithm(self):\n        if self.portfolio[self.nifty].total_sale_volume > 0:\n            raise AssertionError(\"Index is not tradable.\")\n\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateIntrinioEconomicData.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom QuantConnect.Data.Custom.Intrinio import *\n\nclass BasicTemplateIntrinioEconomicData(QCAlgorithm):\n\n    def initialize(self):\n        '''initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2010, 1, 1)  #Set Start Date\n        self.set_end_date(2013, 12, 31)  #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # Set your Intrinio user and password.\n        IntrinioConfig.set_user_and_password(\"intrinio-username\", \"intrinio-password\")\n        # The Intrinio user and password can be also defined in the config.json file for local backtest.\n\n        # Set Intrinio config to make 1 call each minute, default is 1 call each 5 seconds.\n        #(1 call each minute is the free account limit for historical_data endpoint)\n        IntrinioConfig.set_time_interval_between_calls(timedelta(minutes = 1))\n\n        # United States Oil Fund LP\n        self.uso = self.add_equity(\"USO\", Resolution.DAILY).symbol\n        self.securities[self.uso].set_leverage(2)\n        # United States Brent Oil Fund LP\n        self.bno = self.add_equity(\"BNO\", Resolution.DAILY).symbol\n        self.securities[self.bno].set_leverage(2)\n\n        self.add_data(IntrinioEconomicData, \"$DCOILWTICO\", Resolution.DAILY)\n        self.add_data(IntrinioEconomicData, \"$DCOILBRENTEU\", Resolution.DAILY)\n\n        self.ema_wti = self.ema(\"$DCOILWTICO\", 10)\n\n\n    def on_data(self, slice):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if (slice.contains_key(\"$DCOILBRENTEU\") or slice.contains_key(\"$DCOILWTICO\")):\n            spread = slice[\"$DCOILBRENTEU\"].value - slice[\"$DCOILWTICO\"].value\n        else:\n            return\n\n        if ((spread > 0 and not self.portfolio[self.bno].is_long) or\n            (spread < 0 and not self.portfolio[self.uso].is_short)):\n            sign = math.copysign(1, spread)\n            self.set_holdings(self.bno, 0.25 * sign)\n            self.set_holdings(self.uso, -0.25 * sign)\n\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateLibrary.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic Template Library Class\n###\n### Library classes are snippets of code/classes you can reuse between projects. They are\n### added to projects on compile. This can be useful for reusing indicators, math functions,\n### risk modules etc. Make sure you import the class in your algorithm. You need\n### to name the file the module you'll be importing (not main.cs).\n### importing.\n### </summary>\nclass BasicTemplateLibrary:\n\n    '''\n    To use this library place this at the top:\n    from BasicTemplateLibrary import BasicTemplateLibrary\n\n    Then instantiate the function:\n    x = BasicTemplateLibrary()\n    x.add(1,2)\n    '''\n    def add(self, a, b):\n        return a + b\n\n    def subtract(self, a, b):\n        return a - b\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionEquityStrategyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to execute a Call Butterfly option equity strategy\n### It adds options for a given underlying equity security, and shows how you can prefilter contracts easily based on strikes and expirations\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BasicTemplateOptionEquityStrategyAlgorithm(QCAlgorithm):\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self) -> None:\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n\n        equity = self.add_equity(self.underlying_ticker)\n        option = self.add_option(self.underlying_ticker)\n        self._option_symbol = option.symbol\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(lambda u: (u.standards_only().strikes(-2, +2)\n                                     # Expiration method accepts TimeSpan objects or integer for days.\n                                     # The following statements yield the same filtering criteria\n                                     .expiration(0, 180)))\n\n    def on_data(self, slice: Slice) -> None:\n        if self.portfolio.invested or not self.is_market_open(self._option_symbol):\n            return\n\n        chain = slice.option_chains.get(self._option_symbol)\n        if not chain:\n            return\n\n        grouped_by_expiry = dict()\n        for contract in [contract for contract in chain if contract.right == OptionRight.CALL]:\n            grouped_by_expiry.setdefault(int(contract.expiry.timestamp()), []).append(contract)\n\n        first_expiry = list(sorted(grouped_by_expiry))[0]\n        call_contracts = sorted(grouped_by_expiry[first_expiry], key = lambda x: x.strike)\n        \n        expiry = call_contracts[0].expiry\n        lower_strike = call_contracts[0].strike\n        middle_strike = call_contracts[1].strike\n        higher_strike = call_contracts[2].strike\n\n        option_strategy = OptionStrategies.call_butterfly(self._option_symbol, higher_strike, middle_strike, lower_strike, expiry)\n                    \n        self.order(option_strategy, 10)\n\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionStrategyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrate how to use Option Strategies (e.g. OptionStrategies.STRADDLE) helper classes to batch send orders for common strategies.\n### It also shows how you can prefilter contracts easily based on strikes and expirations, and how you can inspect the\n### option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"option strategies\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionStrategyAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # Set the cash we'd like to use for our backtest\n        self.set_cash(1000000)\n\n        # Start and end dates for the backtest.\n        self.set_start_date(2015,12,24)\n        self.set_end_date(2015,12,24)\n\n        # Add assets you'd like to see\n        option = self.add_option(\"GOOG\")\n        self.option_symbol = option.symbol\n\n        # set our strike/expiry filter for this option chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        option.set_filter(lambda u: (u.standards_only().strikes(-2, +2).expiration(0, 180)))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(\"GOOG\")\n\n    def on_data(self,slice):\n        if not self.portfolio.invested:\n            for kvp in slice.option_chains:\n                chain = kvp.value\n                contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                                                 key = lambda x: x.expiry, reverse=False)\n\n                if len(contracts) == 0: continue\n                atm_straddle = contracts[0]\n                if atm_straddle != None:\n                    self.sell(OptionStrategies.straddle(self.option_symbol, atm_straddle.strike, atm_straddle.expiry), 2)\n        else:\n            self.liquidate()\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionTradesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add options for a given underlying equity security.\n### It also shows how you can prefilter contracts easily based on strikes and expirations.\n### It also shows how you can inspect the option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionTradesAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        option = self.add_option(\"GOOG\")\n\n        # add the initial contract filter \n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        option.set_filter(-2, +2, 0, 10)\n        # option.set_filter(-2, +2, timedelta(0), timedelta(10))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(\"GOOG\")\n\n    def on_data(self,slice):\n        if not self.portfolio.invested:\n            for kvp in slice.option_chains:\n                chain = kvp.value\n                # find the second call strike under market price expiring today\n                contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                                                 key = lambda x: x.expiry, reverse=False)\n\n                if len(contracts) == 0: continue\n                if contracts[0] != None:\n                    self.market_order(contracts[0].symbol, 1)\n        else:\n            self.liquidate()\n\n        for kpv in slice.bars:\n            self.log(\"---> OnData: {0}, {1}, {2}\".format(self.time, kpv.key.value, str(kpv.value.close)))\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add options for a given underlying equity security.\n### It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n### can inspect the option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionsAlgorithm(QCAlgorithm):\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        equity = self.add_equity(self.underlying_ticker)\n        option = self.add_option(self.underlying_ticker)\n        self.option_symbol = option.symbol\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(lambda u: (u.standards_only().strikes(-2, +2)\n                                     # Expiration method accepts TimeSpan objects or integer for days.\n                                     # The following statements yield the same filtering criteria\n                                     .expiration(0, 180)))\n                                     #.expiration(TimeSpan.zero, TimeSpan.from_days(180))))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(equity.symbol)\n\n    def on_data(self, slice):\n        if self.portfolio.invested or not self.is_market_open(self.option_symbol): return\n\n        chain = slice.option_chains.get(self.option_symbol)\n        if not chain:\n            return\n\n        # we sort the contracts to find at the money (ATM) contract with farthest expiration\n        contracts = sorted(sorted(sorted(chain, \\\n            key = lambda x: abs(chain.underlying.price - x.strike)), \\\n            key = lambda x: x.expiry, reverse=True), \\\n            key = lambda x: x.right, reverse=True)\n\n        # if found, trade it\n        if len(contracts) == 0: return\n        symbol = contracts[0].symbol\n        self.market_order(symbol, 1)\n        self.market_on_close_order(symbol, -1)\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsConsolidationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### A demonstration of consolidating options data into larger bars for your algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\n### <meta name=\"tag\" content=\"options\" />\nclass BasicTemplateOptionsConsolidationAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(1000000)\n\n        # Subscribe and set our filter for the options chain\n        option = self.add_option('SPY')\n        # set our strike/expiry filter for this option chain\n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        option.set_filter(-2, +2, 0, 180)\n        # option.set_filter(-2, +2, timedelta(0), timedelta(180))\n        self.consolidators = dict()\n\n    def on_quote_bar_consolidated(self, sender, quote_bar):\n        self.log(\"OnQuoteBarConsolidated called on \" + str(self.time))\n        self.log(str(quote_bar))\n\n    def on_trade_bar_consolidated(self, sender, trade_bar):\n        self.log(\"OnTradeBarConsolidated called on \" + str(self.time))\n        self.log(str(trade_bar))\n\n    def on_securities_changed(self, changes):\n        for security in changes.added_securities:\n            if security.type == SecurityType.EQUITY:\n                trade_bar_consolidator = TradeBarConsolidator(timedelta(minutes=5))\n                trade_bar_consolidator.data_consolidated += self.on_trade_bar_consolidated\n                self.subscription_manager.add_consolidator(security.symbol, trade_bar_consolidator)\n                self.consolidators[security.symbol] = trade_bar_consolidator\n            else:\n                quote_bar_consolidator = QuoteBarConsolidator(timedelta(minutes=5))\n                quote_bar_consolidator.data_consolidated += self.on_quote_bar_consolidated\n                self.subscription_manager.add_consolidator(security.symbol, quote_bar_consolidator)\n                self.consolidators[security.symbol] = quote_bar_consolidator\n\n        for security in changes.removed_securities:\n            consolidator = self.consolidators.pop(security.symbol)\n            self.subscription_manager.remove_consolidator(security.symbol, consolidator)\n\n            if security.type == SecurityType.EQUITY:\n                consolidator.data_consolidated -= self.on_trade_bar_consolidated\n            else:\n                consolidator.data_consolidated -= self.on_quote_bar_consolidated\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsDailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add options for a given underlying equity security.\n### It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n### can inspect the option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionsDailyAlgorithm(QCAlgorithm):\n    underlying_ticker = \"AAPL\"\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 15)\n        self.set_end_date(2016, 2, 1)\n        self.set_cash(100000)\n        self.option_expired = False\n\n        equity = self.add_equity(self.underlying_ticker, Resolution.DAILY)\n        option = self.add_option(self.underlying_ticker, Resolution.DAILY)\n        self.option_symbol = option.symbol\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(lambda u: (u.calls_only().expiration(0, 60)))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(equity.symbol)\n\n    def on_data(self,slice):\n        if self.portfolio.invested: return\n\n        chain = slice.option_chains.get(self.option_symbol)\n        if not chain:\n            return\n\n        # Grab us the contract nearest expiry\n        contracts = sorted(chain, key = lambda x: x.expiry)\n\n        # if found, trade it\n        if len(contracts) == 0: return\n        symbol = contracts[0].symbol\n        self.market_order(symbol, 1)\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n\n        # Check for our expected OTM option expiry\n        if \"OTM\" in order_event.message:\n\n            # Assert it is at midnight 1/16 (5AM UTC)\n            if order_event.utc_time.month != 1 and order_event.utc_time.day != 16 and order_event.utc_time.hour != 5:\n                raise AssertionError(f\"Expiry event was not at the correct time, {order_event.utc_time}\")\n\n            self.option_expired = True\n\n    def on_end_of_algorithm(self):\n        # Assert we had our option expire and fill a liquidation order\n        if not self.option_expired:\n            raise AssertionError(\"Algorithm did not process the option expiration like expected\")\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsFilterUniverseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add options for a given underlying equity security.\n### It also shows how you can prefilter contracts easily based on strikes and expirations.\n### It also shows how you can inspect the option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionsFilterUniverseAlgorithm(QCAlgorithm):\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 28)\n        self.set_cash(100000)\n\n        equity = self.add_equity(self.underlying_ticker)\n        option = self.add_option(self.underlying_ticker)\n        self.option_symbol = option.symbol\n\n        # Set our custom universe filter\n        option.set_filter(self.filter_function)\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(equity.symbol)\n\n    def filter_function(self, universe):\n        #Expires today, is a call, and is within 10 dollars of the current price\n        universe = universe.weeklys_only().expiration(0, 1)\n        return [symbol for symbol in universe \n                if symbol.id.option_right != OptionRight.PUT \n                and -10 < universe.underlying.price - symbol.id.strike_price < 10]\n\n    def on_data(self, slice):\n        if self.portfolio.invested: return\n\n        for kvp in slice.option_chains:\n            \n            if kvp.key != self.option_symbol: continue\n\n            # Get the first call strike under market price expiring today\n            chain = kvp.value\n            contracts = [option for option in sorted(chain, key = lambda x:x.strike, reverse = True)\n                         if option.expiry.date() == self.time.date()\n                         and option.strike < chain.underlying.price]\n            \n            if contracts:\n                self.market_order(contracts[0].symbol, 1)\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Alphas.ConstantAlphaModel import ConstantAlphaModel\nfrom Selection.OptionUniverseSelectionModel import OptionUniverseSelectionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\nfrom Risk.NullRiskManagementModel import NullRiskManagementModel\n\n\n### <summary>\n### Basic template options framework algorithm uses framework components\n### to define an algorithm that trades options.\n### </summary>\nclass BasicTemplateOptionsFrameworkAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 9)\n        self.set_cash(100000)\n\n        # set framework models\n        self.set_universe_selection(EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel(self.select_option_chain_symbols))\n        self.set_alpha(ConstantOptionContractAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(hours = 0.5)))\n        self.set_portfolio_construction(SingleSharePortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n\n    def select_option_chain_symbols(self, utc_time):\n        new_york_time = Extensions.convert_from_utc(utc_time, TimeZones.NEW_YORK)\n        ticker = \"TWX\" if new_york_time.date() < date(2014, 6, 6) else \"AAPL\"\n        return [ Symbol.create(ticker, SecurityType.OPTION, Market.USA, f\"?{ticker}\") ]\n\nclass EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel(OptionUniverseSelectionModel):\n    '''Creates option chain universes that select only the earliest expiry ATM weekly put contract\n    and runs a user defined option_chain_symbol_selector every day to enable choosing different option chains'''\n    def __init__(self, select_option_chain_symbols):\n        super().__init__(timedelta(1), select_option_chain_symbols)\n\n    def filter(self, filter):\n        '''Defines the option chain universe filter'''\n        return (filter.strikes(+1, +1)\n                      # Expiration method accepts timedelta objects or integer for days.\n                      # The following statements yield the same filtering criteria\n                      .expiration(0, 7)\n                      # .expiration(timedelta(0), timedelta(7))\n                      .weeklys_only()\n                      .puts_only()\n                      .only_apply_filter_at_market_open())\n\nclass ConstantOptionContractAlphaModel(ConstantAlphaModel):\n    '''Implementation of a constant alpha model that only emits insights for option symbols'''\n    def __init__(self, type, direction, period):\n        super().__init__(type, direction, period)\n\n    def should_emit_insight(self, utc_time, symbol):\n        # only emit alpha for option symbols and not underlying equity symbols\n        if symbol.security_type != SecurityType.OPTION:\n            return False\n\n        return super().should_emit_insight(utc_time, symbol)\n\nclass SingleSharePortfolioConstructionModel(PortfolioConstructionModel):\n    '''Portfolio construction model that sets target quantities to 1 for up insights and -1 for down insights'''\n    def create_targets(self, algorithm, insights):\n        targets = []\n        for insight in insights:\n            targets.append(PortfolioTarget(insight.symbol, insight.direction))\n        return targets\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example demonstrating how to access to options history for a given underlying equity security.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\n### <meta name=\"tag\" content=\"history\" />\nclass BasicTemplateOptionsHistoryAlgorithm(QCAlgorithm):\n    ''' This example demonstrates how to get access to options history for a given underlying equity security.'''\n\n    def initialize(self):\n        # this test opens position in the first day of trading, lives through stock split (7 for 1), and closes adjusted position on the second day\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(1000000)\n\n        option = self.add_option(\"GOOG\")\n        # add the initial contract filter \n        # SetFilter method accepts timedelta objects or integer for days.\n        # The following statements yield the same filtering criteria\n        option.set_filter(-2, +2, 0, 180)\n        # option.set_filter(-2,2, timedelta(0), timedelta(180))\n\n        # set the pricing model for Greeks and volatility\n        # find more pricing models https://www.quantconnect.com/lean/documentation/topic27704.html\n        option.price_model = OptionPriceModels.black_scholes()\n        # set the warm-up period for the pricing model\n        self.set_warm_up(TimeSpan.from_days(4))\n        # set the benchmark to be the initial cash\n        self.set_benchmark(lambda x: 1000000)\n\n    def on_data(self,slice):\n        if self.is_warming_up: return\n        if not self.portfolio.invested:\n            for chain in slice.option_chains:\n                volatility = self.securities[chain.key.underlying].volatility_model.volatility\n                for contract in chain.value:\n                    self.log(\"{0},Bid={1} Ask={2} Last={3} OI={4} sigma={5:.3f} NPV={6:.3f} \\\n                              delta={7:.3f} gamma={8:.3f} vega={9:.3f} beta={10:.2f} theta={11:.2f} IV={12:.2f}\".format(\n                    contract.symbol.value,\n                    contract.bid_price,\n                    contract.ask_price,\n                    contract.last_price,\n                    contract.open_interest,\n                    volatility,\n                    contract.theoretical_price,\n                    contract.greeks.delta,\n                    contract.greeks.gamma,\n                    contract.greeks.vega,\n                    contract.greeks.rho,\n                    contract.greeks.theta / 365,\n                    contract.implied_volatility))\n\n    def on_securities_changed(self, changes):\n        for change in changes.added_securities:\n            # only print options price\n            if change.symbol.value == \"GOOG\": return\n            history = self.history(change.symbol, 10, Resolution.MINUTE).sort_index(level='time', ascending=False)[:3]\n            for index, row in history.iterrows():\n                self.log(\"History: \" + str(index[3])\n                        + \": \" + index[4].strftime(\"%m/%d/%Y %I:%M:%S %p\")\n                        + \" > \" + str(row.close))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsHourlyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add options for a given underlying equity security.\n### It also shows how you can prefilter contracts easily based on strikes and expirations, and how you\n### can inspect the option chain to pick a specific option contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass BasicTemplateOptionsHourlyAlgorithm(QCAlgorithm):\n    underlying_ticker = \"AAPL\"\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 6)\n        self.set_end_date(2014, 6, 9)\n        self.set_cash(100000)\n\n        equity = self.add_equity(self.underlying_ticker, Resolution.HOUR)\n        option = self.add_option(self.underlying_ticker, Resolution.HOUR)\n        self.option_symbol = option.symbol\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(lambda u: (u.standards_only().strikes(-2, +2)\n                                     # Expiration method accepts TimeSpan objects or integer for days.\n                                     # The following statements yield the same filtering criteria\n                                     .expiration(0, 180)))\n                                     #.expiration(TimeSpan.zero, TimeSpan.from_days(180))))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(equity.symbol)\n\n    def on_data(self,slice):\n        if self.portfolio.invested or not self.is_market_open(self.option_symbol): return\n\n        chain = slice.option_chains.get(self.option_symbol)\n        if not chain:\n            return\n\n        # we sort the contracts to find at the money (ATM) contract with farthest expiration\n        contracts = sorted(sorted(sorted(chain, \\\n            key = lambda x: abs(chain.underlying.price - x.strike)), \\\n            key = lambda x: x.expiry, reverse=True), \\\n            key = lambda x: x.right, reverse=True)\n\n        # if found, trade it\n        if len(contracts) == 0 or not self.is_market_open(contracts[0].symbol): return\n        symbol = contracts[0].symbol\n        self.market_order(symbol, 1)\n        self.market_on_close_order(symbol, -1)\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateOptionsPriceModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example demonstrating how to define an option price model.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\n### <meta name=\"tag\" content=\"option price model\" />\nclass BasicTemplateOptionsPriceModel(QCAlgorithm):\n    '''Example demonstrating how to define an option price model.'''\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2020, 1, 5)\n        self.set_cash(100000)\n\n        # Add the option\n        option = self.add_option(\"AAPL\")\n        self.option_symbol = option.symbol\n\n        # Add the initial contract filter\n        option.set_filter(-3, +3, 0, 31)\n\n        # Define the Option Price Model\n        option.price_model = OptionPriceModels.QuantLib.crank_nicolson_fd()\n        #option.price_model = OptionPriceModels.QuantLib.black_scholes()\n        #option.price_model = OptionPriceModels.QuantLib.additive_equiprobabilities()\n        #option.price_model = OptionPriceModels.QuantLib.barone_adesi_whaley()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_cox_ross_rubinstein()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_jarrow_rudd()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_joshi()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_leisen_reimer()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_tian()\n        #option.price_model = OptionPriceModels.QuantLib.binomial_trigeorgis()\n        #option.price_model = OptionPriceModels.QuantLib.bjerksund_stensland()\n        #option.price_model = OptionPriceModels.QuantLib.integral()\n\n        # Set warm up with 30 trading days to warm up the underlying volatility model\n        self.set_warm_up(30, Resolution.DAILY)\n\n\n    def on_data(self,slice):\n        '''OnData will test whether the option contracts has a non-zero Greeks.delta'''\n\n        if self.is_warming_up or not slice.option_chains.contains_key(self.option_symbol):\n            return\n\n        chain = slice.option_chains[self.option_symbol]\n        if not any([x for x in chain if x.greeks.delta != 0]):\n            self.log(f'No contract with Delta != 0')\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to add and trade SPX index weekly options\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"indexes\" />\nclass BasicTemplateSPXWeeklyIndexOptionsAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 10)\n        self.set_cash(1000000)\n\n        # regular option SPX contracts\n        self.spx_options = self.add_index_option(\"SPX\")\n        self.spx_options.set_filter(lambda u: (u.strikes(0, 1).expiration(0, 30)))\n\n        # weekly option SPX contracts\n        spxw = self.add_index_option(\"SPX\", \"SPXW\")\n        # set our strike/expiry filter for this option chain\n        spxw.set_filter(lambda u: (u.strikes(0, 1)\n                                     # single week ahead since there are many SPXW contracts and we want to preserve performance\n                                     .expiration(0, 7)\n                                     .include_weeklys()))\n\n        self.spxw_option = spxw.symbol\n\n    def on_data(self,slice):\n        if self.portfolio.invested: return\n\n        chain = slice.option_chains.get(self.spxw_option)\n        if not chain:\n            return\n\n        # we sort the contracts to find at the money (ATM) contract with closest expiration\n        contracts = sorted(sorted(sorted(chain, \\\n            key = lambda x: x.expiry), \\\n            key = lambda x: abs(chain.underlying.price - x.strike)), \\\n            key = lambda x: x.right, reverse=True)\n\n        # if found, buy until it expires\n        if len(contracts) == 0: return\n        symbol = contracts[0].symbol\n        self.market_order(symbol, 1)\n\n    def on_order_event(self, order_event):\n        self.debug(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/BasicTemplateTradableIndexAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\nfrom BasicTemplateIndexAlgorithm import BasicTemplateIndexAlgorithm\n\nclass BasicTemplateTradableIndexAlgorithm(BasicTemplateIndexAlgorithm):\n    ticket: OrderTicket | None = None\n    def initialize(self) -> None:\n        super().initialize()\n        self.securities[self.spx].is_tradable = True\n        \n    def on_data(self, data: Slice):\n        super().on_data(data)\n        if not self.ticket:\n            self.ticket = self.market_order(self.spx, 1)\n\n    def on_end_of_algorithm(self) -> None:\n        if self.ticket and self.ticket.status != OrderStatus.FILLED:\n            raise AssertionError(\"Index is tradable.\")\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/BasicTemplateBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Benchmark Algorithm: The minimalist basic template algorithm benchmark strategy.\n### </summary>\n### <remarks>\n### All new projects in the cloud are created with the basic template algorithm. It uses a minute algorithm\n### </remarks>\nclass BasicTemplateBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2000, 1, 1)\n        self.set_end_date(2022, 1, 1)\n        self.set_benchmark(lambda x: 1)\n        self.add_equity(\"SPY\")\n    \n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n            self.debug(\"Purchased Stock\")\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/CoarseFineUniverseSelectionBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass CoarseFineUniverseSelectionBenchmark(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2017, 11, 1)\n        self.set_end_date(2018, 3, 1)\n        self.set_cash(50000)\n\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n\n        self.number_of_symbols = 150\n        self.number_of_symbols_fine = 40\n        self._changes = None\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n\n        selected = [x for x in coarse if (x.has_fundamental_data)]\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(selected, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.number_of_symbols] ]\n\n    # sort the data by P/E ratio and take the top 'NumberOfSymbolsFine'\n    def fine_selection_function(self, fine):\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(fine, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:self.number_of_symbols_fine] ]\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self._changes is None: return\n\n        # liquidate removed securities\n        for security in self._changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        for security in self._changes.added_securities:\n            self.set_holdings(security.symbol, 0.02)\n        self._changes = None\n\n    def on_securities_changed(self, changes):\n        self._changes = changes\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/EmptyEquityAndOptions400Benchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Benchmark Algorithm: Loading and synchronization of 500 equity minute symbols and their options.\n### </summary>\nclass EmptyEquityAndOptions400Benchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2022, 5, 11)\n        self.set_end_date(2022, 5, 12)\n        self.equity_symbols = [\n\n\"MARK\", \"TSN\", \"DT\", \"RDW\", \"CVE\", \"NXPI\", \"FIVN\", \"CLX\", \"SPXL\", \"BKSY\", \"NUGT\", \"CF\", \"NEGG\",\n\"RH\", \"SIRI\", \"ITUB\", \"CSX\", \"AUR\", \"LIDR\", \"CMPS\", \"DHI\", \"GLW\", \"NTES\", \"CIFR\", \"S\", \"HSBC\",\n\"HIPO\", \"WTRH\", \"AMRN\", \"BIIB\", \"RIO\", \"EDIT\", \"TEAM\", \"CNK\", \"BUD\", \"MILE\", \"AEHR\", \"DOCN\",\n\"CLSK\", \"BROS\", \"MLCO\", \"SBLK\", \"ICLN\", \"OPK\", \"CNC\", \"SKX\", \"SESN\", \"VRM\", \"ASML\", \"BBAI\",\n\"HON\", \"MRIN\", \"BLMN\", \"NTNX\", \"POWW\", \"FOUR\", \"HOG\", \"GOGO\", \"MGNI\", \"GENI\", \"XPDI\",\n\"DG\", \"PSX\", \"RRC\", \"CORT\", \"MET\", \"UMC\", \"INMD\", \"RBAC\", \"ISRG\", \"BOX\", \"DVAX\", \"CRVS\", \"HLT\",\n\"BKNG\", \"BENE\", \"CLVS\", \"ESSC\", \"PTRA\", \"BE\", \"FPAC\", \"YETI\", \"DOCS\", \"DB\", \"EBON\", \"RDS.B\",\n\"ERIC\", \"BSIG\", \"INTU\", \"MNTS\", \"BCTX\", \"BLU\", \"FIS\", \"MAC\", \"WMB\", \"TTWO\", \"ARDX\", \"SWBI\",\n\"ELY\", \"INDA\", \"REAL\", \"ACI\", \"APRN\", \"BHP\", \"CPB\", \"SLQT\", \"ARKF\", \"TSP\", \"OKE\", \"NVTA\", \"META\",\n\"CSTM\", \"KMX\", \"IBB\", \"AGEN\", \"WOOF\", \"MJ\", \"HYZN\", \"RSI\", \"JCI\", \"EXC\", \"HPE\", \"SI\", \"WPM\",\n\"PRTY\", \"BBD\", \"FVRR\", \"CANO\", \"INDI\", \"MDLZ\", \"KOLD\", \"AMBA\", \"SOXS\", \"RSX\", \"ZEN\", \"PUBM\",\n\"VLDR\", \"CI\", \"ISEE\", \"GEO\", \"BKR\", \"DHR\", \"GRPN\", \"NRXP\", \"ACN\", \"MAT\", \"BODY\", \"ENDP\",\n\"SHPW\", \"AVIR\", \"GPN\", \"BILL\", \"BZ\", \"CERN\", \"ARVL\", \"DNMR\", \"NTR\", \"FSM\", \"BMBL\", \"PAAS\",\n\"INVZ\", \"ANF\", \"CL\", \"XP\", \"CS\", \"KD\", \"WW\", \"AHT\", \"GRTX\", \"XLC\", \"BLDP\", \"HTA\", \"APT\", \"BYSI\",\n\"ENB\", \"TRIT\", \"VTNR\", \"AVCT\", \"SLI\", \"CP\", \"CAH\", \"ALLY\", \"FIGS\", \"PXD\", \"TPX\", \"ZI\", \"BKLN\", \"SKIN\",\n\"LNG\", \"NU\", \"CX\", \"GSM\", \"NXE\", \"REI\", \"MNDT\", \"IP\", \"BLOK\", \"IAA\", \"TIP\", \"MCHP\", \"EVTL\", \"BIGC\",\n\"IGV\", \"LOTZ\", \"EWC\", \"DRI\", \"PSTG\", \"APLS\", \"KIND\", \"BBIO\", \"APPH\", \"FIVE\", \"LSPD\", \"SHAK\",\n\"COMM\", \"NAT\", \"VFC\", \"AMT\", \"VRTX\", \"RGS\", \"DD\", \"GBIL\", \"LICY\", \"ACHR\", \"FLR\", \"HGEN\", \"TECL\",\n\"SEAC\", \"NVS\", \"NTAP\", \"ML\", \"SBSW\", \"XRX\", \"UA\", \"NNOX\", \"SFT\", \"FE\", \"APP\", \"KEY\", \"CDEV\",\n\"DPZ\", \"BARK\", \"SPR\", \"CNQ\", \"XL\", \"AXSM\", \"ECH\", \"RNG\", \"AMLP\", \"ENG\", \"BTI\", \"REKR\",\n\"STZ\", \"BK\", \"HEAR\", \"LEV\", \"SKT\", \"HBI\", \"ALB\", \"CAG\", \"MNKD\", \"NMM\", \"BIRD\", \"CIEN\", \"SILJ\",\n\"STNG\", \"GUSH\", \"GIS\", \"PRPL\", \"SDOW\", \"GNRC\", \"ERX\", \"GES\", \"CPE\", \"FBRX\", \"WM\", \"ESTC\",\n\"GOED\", \"STLD\", \"LILM\", \"JNK\", \"BOIL\", \"ALZN\", \"IRBT\", \"KOPN\", \"AU\", \"TPR\", \"RWLK\", \"TROX\",\n\"TMO\", \"AVDL\", \"XSPA\", \"JKS\", \"PACB\", \"LOGI\", \"BLK\", \"REGN\", \"CFVI\", \"EGHT\", \"ATNF\", \"PRU\",\n\"URBN\", \"KMB\", \"SIX\", \"CME\", \"ENVX\", \"NVTS\", \"CELH\", \"CSIQ\", \"GSL\", \"PAA\", \"WU\", \"MOMO\",\n\"TOL\", \"WEN\", \"GTE\", \"EXAS\", \"GDRX\", \"PVH\", \"BFLY\", \"SRTY\", \"UDOW\", \"NCR\", \"ALTO\", \"CRTD\",\n\"GOCO\", \"ALK\", \"TTM\", \"DFS\", \"VFF\", \"ANTM\", \"FREY\", \"WY\", \"ACWI\", \"PNC\", \"SYY\", \"SNY\", \"CRK\",\n\"SO\", \"XXII\", \"PBF\", \"AER\", \"RKLY\", \"SOL\", \"CND\", \"MPLX\", \"JNPR\", \"FTCV\", \"CLR\", \"XHB\", \"YY\",\n\"POSH\", \"HIMS\", \"LIFE\", \"XENE\", \"ADM\", \"ROST\", \"MIR\", \"NRG\", \"AAP\", \"SSYS\", \"KBH\", \"KKR\", \"PLAN\",\n\"DUK\", \"WIMI\", \"DBRG\", \"WSM\", \"LTHM\", \"OVV\", \"CFLT\", \"EWT\", \"UNFI\", \"TX\", \"EMR\", \"IMGN\", \"K\",\n\"ONON\", \"UNIT\", \"LEVI\", \"ADTX\", \"UPWK\", \"DBA\", \"VOO\", \"FATH\", \"URI\", \"MPW\", \"JNUG\", \"RDFN\",\n\"OSCR\", \"WOLF\", \"SYF\", \"GOGL\", \"HES\", \"PHM\", \"CWEB\", \"ALDX\", \"BTWN\", \"AFL\", \"PPL\", \"CIM\"\n\n        ]\n\n        self.set_warm_up(TimeSpan.from_days(1))\n        for ticker in self.equity_symbols:\n            option = self.add_option(ticker)\n            option.set_filter(1, 7, timedelta(0), timedelta(90))\n        \n        self.add_equity(\"SPY\")\n\n    def on_data(self, slice):\n        if self.is_warming_up: return\n        self.quit(\"The end!\")\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/EmptyMinute400EquityBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass EmptyMinute400EquityBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 9, 1)\n        self.set_end_date(2015, 12, 1)\n\n        for symbol in Symbols().equity.all()[:400]:\n            self.add_security(SecurityType.EQUITY, symbol)\n    \n    def on_data(self, data):\n        pass\n    \nclass Symbols(object):\n    \n    def __init__(self):\n        self.equity = self.Equity()\n    \n    class Equity(object):       \n        def all(self):\n            return [\n                    \"SPY\",\n                    \"AAPL\",\n                    \"FB\",\n                    \"VXX\",\n                    \"VRX\",\n                    \"NFLX\",\n                    \"UVXY\",\n                    \"QQQ\",\n                    \"IWM\",\n                    \"BABA\",\n                    \"GILD\",\n                    \"XIV\",\n                    \"XOM\",\n                    \"CVX\",\n                    \"MSFT\",\n                    \"GE\",\n                    \"SLB\",\n                    \"JPM\",\n                    \"XLE\",\n                    \"DIS\",\n                    \"AMZN\",\n                    \"TWTR\",\n                    \"PFE\",\n                    \"C\",\n                    \"BAC\",\n                    \"ABBV\",\n                    \"JNJ\",\n                    \"HAL\",\n                    \"XLV\",\n                    \"INTC\",\n                    \"WFC\",\n                    \"V\",\n                    \"YHOO\",\n                    \"COP\",\n                    \"MYL\",\n                    \"AGN\",\n                    \"WMT\",\n                    \"KMI\",\n                    \"MRK\",\n                    \"TSLA\",\n                    \"GDX\",\n                    \"LLY\",\n                    \"FCX\",\n                    \"CAT\",\n                    \"CELG\",\n                    \"QCOM\",\n                    \"MCD\",\n                    \"CMCSA\",\n                    \"XOP\",\n                    \"CVS\",\n                    \"AMGN\",\n                    \"DOW\",\n                    \"AAL\",\n                    \"APC\",\n                    \"SUNE\",\n                    \"MU\",\n                    \"VLO\",\n                    \"SBUX\",\n                    \"WMB\",\n                    \"PG\",\n                    \"EOG\",\n                    \"DVN\",\n                    \"BMY\",\n                    \"APA\",\n                    \"UNH\",\n                    \"EEM\",\n                    \"IBM\",\n                    \"NKE\",\n                    \"T\",\n                    \"HD\",\n                    \"UNP\",\n                    \"DAL\",\n                    \"ENDP\",\n                    \"CSCO\",\n                    \"OXY\",\n                    \"MRO\",\n                    \"MDT\",\n                    \"TXN\",\n                    \"WLL\",\n                    \"ORCL\",\n                    \"GOOGL\",\n                    \"UAL\",\n                    \"WYNN\",\n                    \"MS\",\n                    \"HZNP\",\n                    \"BIIB\",\n                    \"VZ\",\n                    \"GM\",\n                    \"NBL\",\n                    \"TWX\",\n                    \"SWKS\",\n                    \"JD\",\n                    \"HCA\",\n                    \"AVGO\",\n                    \"YUM\",\n                    \"KO\",\n                    \"GOOG\",\n                    \"GS\",\n                    \"PEP\",\n                    \"AIG\",\n                    \"EMC\",\n                    \"BIDU\",\n                    \"CLR\",\n                    \"PYPL\",\n                    \"LVS\",\n                    \"SWN\",\n                    \"AXP\",\n                    \"ATVI\",\n                    \"RRC\",\n                    \"WBA\",\n                    \"MPC\",\n                    \"NXPI\",\n                    \"ETE\",\n                    \"NOV\",\n                    \"FOXA\",\n                    \"SNDK\",\n                    \"DIA\",\n                    \"UTX\",\n                    \"DD\",\n                    \"WDC\",\n                    \"AA\",\n                    \"M\",\n                    \"FXI\",\n                    \"RIG\",\n                    \"MA\",\n                    \"DUST\",\n                    \"TGT\",\n                    \"AET\",\n                    \"EBAY\",\n                    \"LUV\",\n                    \"EFA\",\n                    \"BRK.B\",\n                    \"BA\",\n                    \"MET\",\n                    \"LYB\",\n                    \"SVXY\",\n                    \"UWTI\",\n                    \"HON\",\n                    \"HPQ\",\n                    \"OAS\",\n                    \"ABT\",\n                    \"MO\",\n                    \"ESRX\",\n                    \"TEVA\",\n                    \"STX\",\n                    \"IBB\",\n                    \"F\",\n                    \"CBS\",\n                    \"TLT\",\n                    \"PM\",\n                    \"ESV\",\n                    \"NE\",\n                    \"PSX\",\n                    \"SCHW\",\n                    \"MON\",\n                    \"HES\",\n                    \"GPRO\",\n                    \"TVIX\",\n                    \"MNK\",\n                    \"NVDA\",\n                    \"NFX\",\n                    \"USO\",\n                    \"NUGT\",\n                    \"EWZ\",\n                    \"LOW\",\n                    \"UA\",\n                    \"TNA\",\n                    \"XLY\",\n                    \"MMM\",\n                    \"PXD\",\n                    \"VIAB\",\n                    \"MDLZ\",\n                    \"NEM\",\n                    \"USB\",\n                    \"MUR\",\n                    \"ETN\",\n                    \"FEYE\",\n                    \"PTEN\",\n                    \"OIH\",\n                    \"UPS\",\n                    \"CHK\",\n                    \"DHR\",\n                    \"RAI\",\n                    \"TQQQ\",\n                    \"CCL\",\n                    \"BRCM\",\n                    \"DG\",\n                    \"JBLU\",\n                    \"CRM\",\n                    \"ADBE\",\n                    \"COG\",\n                    \"PBR\",\n                    \"HP\",\n                    \"BHI\",\n                    \"BK\",\n                    \"TJX\",\n                    \"DE\",\n                    \"COF\",\n                    \"INCY\",\n                    \"DHI\",\n                    \"ABC\",\n                    \"XLI\",\n                    \"ZTS\",\n                    \"BP\",\n                    \"IYR\",\n                    \"PNC\",\n                    \"CNX\",\n                    \"XLF\",\n                    \"LRCX\",\n                    \"GG\",\n                    \"RDS.A\",\n                    \"WFM\",\n                    \"TSO\",\n                    \"ANTM\",\n                    \"KSS\",\n                    \"EA\",\n                    \"PRU\",\n                    \"RAD\",\n                    \"WFT\",\n                    \"XBI\",\n                    \"THC\",\n                    \"VWO\",\n                    \"CTSH\",\n                    \"ABX\",\n                    \"VMW\",\n                    \"CSX\",\n                    \"ACN\",\n                    \"EMR\",\n                    \"SE\",\n                    \"MJN\",\n                    \"SKX\",\n                    \"ACE\",\n                    \"P\",\n                    \"CMI\",\n                    \"CL\",\n                    \"CAH\",\n                    \"EXC\",\n                    \"DUK\",\n                    \"AMAT\",\n                    \"AEM\",\n                    \"FTI\",\n                    \"STT\",\n                    \"ILMN\",\n                    \"HOG\",\n                    \"KR\",\n                    \"EXPE\",\n                    \"VRTX\",\n                    \"IVV\",\n                    \"CAM\",\n                    \"GPS\",\n                    \"MCK\",\n                    \"ADSK\",\n                    \"CMCSK\",\n                    \"HTZ\",\n                    \"MGM\",\n                    \"DLTR\",\n                    \"STI\",\n                    \"CYH\",\n                    \"MOS\",\n                    \"CNQ\",\n                    \"GLW\",\n                    \"KEY\",\n                    \"KORS\",\n                    \"SIRI\",\n                    \"EPD\",\n                    \"SU\",\n                    \"DFS\",\n                    \"TMO\",\n                    \"TAP\",\n                    \"HST\",\n                    \"NBR\",\n                    \"EQT\",\n                    \"XLU\",\n                    \"BSX\",\n                    \"COST\",\n                    \"CTRP\",\n                    \"HFC\",\n                    \"VNQ\",\n                    \"TRV\",\n                    \"POT\",\n                    \"CERN\",\n                    \"LLTC\",\n                    \"DO\",\n                    \"ADI\",\n                    \"BAX\",\n                    \"AMT\",\n                    \"URI\",\n                    \"UCO\",\n                    \"ECA\",\n                    \"MAS\",\n                    \"ALL\",\n                    \"PCAR\",\n                    \"VIPS\",\n                    \"ATW\",\n                    \"SPXU\",\n                    \"LNKD\",\n                    \"X\",\n                    \"TSM\",\n                    \"SO\",\n                    \"BBT\",\n                    \"SYF\",\n                    \"VFC\",\n                    \"CXO\",\n                    \"IR\",\n                    \"PWR\",\n                    \"GLD\",\n                    \"LNG\",\n                    \"ETP\",\n                    \"JNPR\",\n                    \"MAT\",\n                    \"KLAC\",\n                    \"XLK\",\n                    \"TRIP\",\n                    \"AEP\",\n                    \"VTR\",\n                    \"ROST\",\n                    \"RDC\",\n                    \"CF\",\n                    \"FAS\",\n                    \"HCN\",\n                    \"AR\",\n                    \"SM\",\n                    \"WPX\",\n                    \"D\",\n                    \"HOT\",\n                    \"PRGO\",\n                    \"ALXN\",\n                    \"CNC\",\n                    \"VALE\",\n                    \"JCP\",\n                    \"GDXJ\",\n                    \"OKE\",\n                    \"ADM\",\n                    \"JOY\",\n                    \"TSN\",\n                    \"MAR\",\n                    \"KHC\",\n                    \"NSC\",\n                    \"CMA\",\n                    \"COH\",\n                    \"GMCR\",\n                    \"FL\",\n                    \"FITB\",\n                    \"BHP\",\n                    \"JWN\",\n                    \"DNR\",\n                    \"PBF\",\n                    \"XLNX\"]\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/EmptySPXOptionChainBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass EmptySPXOptionChainBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2018, 1, 1)\n        self.set_end_date(2020, 6, 1)\n        self._index = self.add_index(\"SPX\")\n        option = self.add_option(self._index)\n        option.set_filter(lambda u: u.include_weeklys().strikes(-30, 30).expiration(0, 7))\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/EmptySingleSecuritySecondEquityBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Benchmark Algorithm: Pure processing of 1 equity second resolution with the same benchmark.\n### </summary>\n### <remarks>\n### This should eliminate the synchronization part of LEAN and focus on measuring the performance of a single datafeed and event handling system.\n### </remarks>\nclass EmptySingleSecuritySecondEquityBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2008, 1, 1)\n        self.set_end_date(2008, 6, 1)\n        self.set_benchmark(lambda x: 1)\n        self.add_equity(\"SPY\", Resolution.SECOND)\n    \n    def on_data(self, data):\n        pass\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/HistoryRequestBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass HistoryRequestBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2010, 1, 1)\n        self.set_end_date(2018, 1, 1)\n        self.set_cash(10000)\n        self._symbol = self.add_equity(\"SPY\").symbol\n\n    def on_end_of_day(self, symbol):\n        minute_history = self.history([self._symbol], 60, Resolution.MINUTE)\n        last_hour_high = 0\n        for index, row in minute_history.loc[\"SPY\"].iterrows():\n            if last_hour_high < row[\"high\"]:\n                last_hour_high = row[\"high\"]\n\n        daily_history = self.history([self._symbol], 1, Resolution.DAILY).loc[\"SPY\"].head()\n        daily_history_high = daily_history[\"high\"]\n        daily_history_low = daily_history[\"low\"]\n        daily_history_open = daily_history[\"open\"]\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/IndicatorRibbonBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndicatorRibbonBenchmark(QCAlgorithm):\n\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self):\n        self.set_start_date(2010, 1, 1)  #Set Start Date\n        self.set_end_date(2018, 1, 1)    #Set End Date\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n        count = 50\n        offset = 5\n        period = 15\n        self._ribbon = []\n        # define our sma as the base of the ribbon\n        self._sma = SimpleMovingAverage(period)\n        \n        for x in range(count):\n            # define our offset to the zero sma, these various offsets will create our 'displaced' ribbon\n            delay = Delay(offset*(x+1))\n            # define an indicator that takes the output of the sma and pipes it into our delay indicator\n            delayed_sma = IndicatorExtensions.of(delay, self._sma)\n            # register our new 'delayed_sma' for automatic updates on a daily resolution\n            self.register_indicator(self._spy, delayed_sma, Resolution.DAILY)\n            self._ribbon.append(delayed_sma)\n\n    def on_data(self, data):\n        # wait for our entire ribbon to be ready\n        if not all(x.is_ready for x in self._ribbon): return\n        for x in self._ribbon:\n            value = x.current.value\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/ScheduledEventsBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass ScheduledEventsBenchmark(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2011, 1, 1)\n        self.set_end_date(2022, 1, 1)\n        self.set_cash(100000)\n        self.add_equity(\"SPY\")\n\n        for i in range(300):\n            self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", i), self.rebalance)\n            self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.before_market_close(\"SPY\", i), self.rebalance)\n\n    def on_data(self, data):\n        pass\n\n    def rebalance(self):\n        pass\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/StatefulCoarseUniverseSelectionBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass StatefulCoarseUniverseSelectionBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2017, 1, 1)\n        self.set_end_date(2019, 1, 1)\n        self.set_cash(50000)\n\n        self.add_universe(self.coarse_selection_function)\n        self.number_of_symbols = 250\n        self._black_list = []\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n\n        selected = [x for x in coarse if (x.has_fundamental_data)]\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(selected, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.number_of_symbols] if not (x.symbol in self._black_list) ]\n\n    def on_data(self, slice):\n        if slice.has_data:\n            symbol = slice.keys()[0]\n            if symbol:\n                if len(self._black_list) > 50:\n                    self._black_list.pop(0)\n                self._black_list.append(symbol)\n\n    def on_securities_changed(self, changes):\n        # if we have no changes, do nothing\n        if changes is None: return\n\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, 0.001)\n"
  },
  {
    "path": "Algorithm.Python/Benchmarks/StatelessCoarseUniverseSelectionBenchmark.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass StatelessCoarseUniverseSelectionBenchmark(QCAlgorithm):\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2017, 1, 1)\n        self.set_end_date(2019, 1, 1)\n        self.set_cash(50000)\n\n        self.add_universe(self.coarse_selection_function)\n        self.number_of_symbols = 250\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n\n        selected = [x for x in coarse if (x.has_fundamental_data)]\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(selected, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.number_of_symbols] ]\n\n    def on_securities_changed(self, changes):\n        # if we have no changes, do nothing\n        if changes is None: return\n\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, 0.001)\n"
  },
  {
    "path": "Algorithm.Python/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Alphas.HistoricalReturnsAlphaModel import HistoricalReturnsAlphaModel\nfrom Portfolio.BlackLittermanOptimizationPortfolioConstructionModel import *\nfrom Portfolio.UnconstrainedMeanVariancePortfolioOptimizer import UnconstrainedMeanVariancePortfolioOptimizer\nfrom Risk.NullRiskManagementModel import NullRiskManagementModel\n\n### <summary>\n### Black-Litterman framework algorithm\n### Uses the HistoricalReturnsAlphaModel and the BlackLittermanPortfolioConstructionModel\n### to create an algorithm that rebalances the portfolio according to Black-Litterman portfolio optimization\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass BlackLittermanPortfolioOptimizationFrameworkAlgorithm(QCAlgorithm):\n    '''Black-Litterman Optimization algorithm.'''\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self._symbols = [ Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in [ 'AIG', 'BAC', 'IBM', 'SPY' ] ]\n\n        optimizer = UnconstrainedMeanVariancePortfolioOptimizer()\n\n        # set algorithm framework models\n        self.set_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selector))\n        self.set_alpha(HistoricalReturnsAlphaModel(resolution = Resolution.DAILY))\n        self.set_portfolio_construction(BlackLittermanOptimizationPortfolioConstructionModel(optimizer = optimizer))\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n    def coarse_selector(self, coarse):\n        # Drops SPY after the 8th\n        last = 3 if self.time.day > 8 else len(self._symbols)\n\n        return self._symbols[0:last]\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(order_event)\n"
  },
  {
    "path": "Algorithm.Python/BrokerageActivityEventHandlingAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm to demostrate the event handlers of Brokerage activities\n### </summary>\n### <meta name=\"tag\" content=\"using quantconnect\" />\nclass BrokerageActivityEventHandlingAlgorithm(QCAlgorithm):\n\n    ### <summary>\n    ### Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    ### </summary>\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    ### <summary>\n    ### on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    ### </summary>\n    ### <param name=\"data\">Slice object keyed by symbol containing the stock data</param>\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n    ### <summary>\n    ### Brokerage message event handler. This method is called for all types of brokerage messages.\n    ### </summary>\n    def on_brokerage_message(self, message_event):\n        self.debug(f\"Brokerage meesage received - {message_event.to_string()}\")\n\n    ### <summary>\n    ### Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n    ### </summary>\n    def on_brokerage_disconnect(self):\n        self.debug(f\"Brokerage disconnected!\")\n\n    ### <summary>\n    ### Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n    ### </summary>\n    def on_brokerage_reconnect(self):\n        self.debug(f\"Brokerage reconnected!\")\n"
  },
  {
    "path": "Algorithm.Python/BrokerageModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstrate the usage of the BrokerageModel property to help improve backtesting\n### accuracy through simulation of a specific brokerage's rules around restrictions\n### on submitting orders as well as fee structure.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"brokerage models\" />\nclass BrokerageModelAlgorithm(QCAlgorithm):\n    def initialize(self):\n\n        self.set_cash(100000)            # Set Strategy Cash\n        self.set_start_date(2013,10,7)    # Set Start Date\n        self.set_end_date(2013,10,11)     # Set End Date\n        self.add_equity(\"SPY\", Resolution.SECOND)\n        \n        # there's two ways to set your brokerage model. The easiest would be to call\n        # self.set_brokerage_model( BrokerageName ) # BrokerageName is an enum\n        # self.set_brokerage_model(BrokerageName.INTERACTIVE_BROKERS_BROKERAGE)\n        # self.set_brokerage_model(BrokerageName.DEFAULT)\n\n        # the other way is to call SetBrokerageModel( IBrokerageModel ) with your\n        # own custom model. I've defined a simple extension to the default brokerage\n        # model to take into account a requirement to maintain 500 cash in the account at all times\n        self.set_brokerage_model(MinimumAccountBalanceBrokerageModel(self,500.00))\n        self.last = 1   \n        \n    def on_data(self, slice):\n        # Simple buy and hold template\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", self.last)\n            if self.portfolio[\"SPY\"].quantity == 0:\n                # each time we fail to purchase we'll decrease our set holdings percentage\n                self.debug(str(self.time) + \" - Failed to purchase stock\")\n                self.last *= 0.95\n            else:\n                self.debug(\"{} - Purchased Stock @ SetHoldings( {} )\".format(self.time, self.last))\n\n\nclass MinimumAccountBalanceBrokerageModel(DefaultBrokerageModel):\n    '''Custom brokerage model that requires clients to maintain a minimum cash balance'''\n    def __init__(self, algorithm, minimum_account_balance):\n        self.algorithm = algorithm\n        self.minimum_account_balance = minimum_account_balance\n    \n    def can_submit_order(self,security, order, message):\n        '''Prevent orders which would bring the account below a minimum cash balance'''\n        message = None\n        # we want to model brokerage requirement of minimum_account_balance cash value in account\n        order_cost = order.get_value(security)\n        cash = self.algorithm.portfolio.cash\n        cash_after_order = cash - order_cost\n        if cash_after_order < self.minimum_account_balance:\n            # return a message describing why we're not allowing this order\n            message = BrokerageMessageEvent(BrokerageMessageType.WARNING, \"InsufficientRemainingCapital\", \"Account must maintain a minimum of ${0} USD at all times. Order ID: {1}\".format(self.minimum_account_balance, order.id))\n            self.algorithm.error(str(message))\n            return False\n        return True\n"
  },
  {
    "path": "Algorithm.Python/BubbleAlgorithm.py",
    "content": " # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Strategy example algorithm using CAPE - a bubble indicator dataset saved in dropbox. CAPE is based on a macroeconomic indicator(CAPE Ratio),\n### we are looking for entry/exit points for momentum stocks CAPE data: January 1990 - December 2014\n### Goals:\n### Capitalize in overvalued markets by generating returns with momentum and selling before the crash\n### Capitalize in undervalued markets by purchasing stocks at bottom of trough\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"custom data\" />\nclass BubbleAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_cash(100000)\n        self.set_start_date(1998,1,1)\n        self.set_end_date(2014,6,1)\n        self._symbols = []\n        self._macd_dic, self._rsi_dic = {},{}\n        self._new_low, self._curr_cape = None, None\n        self._counter, self._counter2 = 0, 0\n        self._c, self._c_copy = np.empty([4]), np.empty([4])\n        self._symbols.append(\"SPY\")\n        # add CAPE data\n        self.add_data(Cape, \"CAPE\")\n        \n        # # Present Social Media Stocks:\n        # self._symbols.append(\"FB\"), self._symbols.append(\"LNKD\"),self._symbols.append(\"GRPN\"), self._symbols.append(\"TWTR\")\n        # self.set_start_date(2011, 1, 1)\n        # self.set_end_date(2014, 12, 1)\n        \n        # # 2008 Financials\n        # self._symbols.append(\"C\"), self._symbols.append(\"AIG\"), self._symbols.append(\"BAC\"), self._symbols.append(\"HBOS\")\n        # self.set_start_date(2003, 1, 1)\n        # self.set_end_date(2011, 1, 1)\n        \n        # # 2000 Dot.com\n        # self._symbols.append(\"IPET\"), self._symbols.append(\"WBVN\"), self._symbols.append(\"GCTY\")\n        # self.set_start_date(1998, 1, 1)\n        # self.set_end_date(2000, 1, 1)\n        \n        \n        for stock in self._symbols:\n            self.add_security(SecurityType.EQUITY, stock, Resolution.MINUTE)\n            self._macd = self.macd(stock, 12, 26, 9, MovingAverageType.EXPONENTIAL, Resolution.DAILY)\n            self._macd_dic[stock] = self._macd\n            self._rsi = self.rsi(stock, 14, MovingAverageType.EXPONENTIAL, Resolution.DAILY)\n            self._rsi_dic[stock] = self._rsi\n        \n    # Trying to find if current Cape is the lowest Cape in three months to indicate selling period\n    def on_data(self, data):\n        \n        if self._curr_cape and self._new_low is not None:   \n            try:\n                # Bubble territory\n                if self._curr_cape > 20 and self._new_low == False:\n                    for stock in self._symbols:\n                    # Order stock based on MACD\n                    # During market hours, stock is trading, and sufficient cash\n                        if self.securities[stock].holdings.quantity == 0 and self._rsi_dic[stock].current.value < 70 \\\n                        and self.securities[stock].price != 0 \\\n                        and self.portfolio.cash > self.securities[stock].price * 100 \\\n                        and self.time.hour == 9 and self.time.minute == 31:\n                            self.buy_stock(stock)\n                    # Utilize RSI for overbought territories and liquidate that stock\n                        if self._rsi_dic[stock].current.value > 70 and self.securities[stock].holdings.quantity > 0 \\\n                        and self.time.hour == 9 and self.time.minute == 31:\n                            self.sell_stock(stock)\n                           \n                # Undervalued territory            \n                elif self._new_low:\n                    for stock in self._symbols:\n                        # Sell stock based on MACD\n                        if self.securities[stock].holdings.quantity > 0 and self._rsi_dic[stock].current.value > 30 \\\n                        and self.time.hour == 9 and self.time.minute == 31:\n                            self.sell_stock(stock)\n                        # Utilize RSI and MACD to understand oversold territories\n                        elif self.securities[stock].holdings.quantity == 0 and self._rsi_dic[stock].current.value < 30 \\\n                        and self.securities[stock].price != 0 and self.portfolio.cash > self.securities[stock].price * 100 \\\n                        and self.time.hour == 9 and self.time.minute == 31:\n                            self.buy_stock(stock)\n                \n                # Cape Ratio is missing from original data\n                # Most recent cape data is most likely to be missing \n                elif self._curr_cape == 0:\n                    self.debug(\"Exiting due to no CAPE!\")\n                    self.quit(\"CAPE ratio not supplied in data, exiting.\")\n                \n            except:\n                # Do nothing\n                return None       \n\n        if not data.contains_key(\"CAPE\"): return\n        self._new_low = False\n        # Adds first four Cape Ratios to array c\n        self._curr_cape = data[\"CAPE\"].cape\n        if self._counter < 4:\n            self._c[self._counter] = self._curr_cape\n            self._counter +=1\n        # Replaces oldest Cape with current Cape\n        # Checks to see if current Cape is lowest in the previous quarter\n        # Indicating a sell off\n        else:\n            self._c_copy = self._c  \n            self._c_copy = np.sort(self._c_copy)\n            if self._c_copy[0] > self._curr_cape:\n                self._new_low = True\n            self._c[self._counter2] = self._curr_cape\n            self._counter2 += 1\n            if self._counter2 == 4: self._counter2 = 0\n        self.debug(\"Current Cape: \" + str(self._curr_cape) + \" on \" + str(self.time))\n        if self._new_low:\n            self.debug(\"New Low has been hit on \" + str(self.time))\n\n    # Buy this symbol\n    def buy_stock(self,symbol):\n        s = self.securities[symbol].holdings\n        if self._macd_dic[symbol].current.value>0:\n            self.set_holdings(symbol, 1)\n            self.debug(\"Purchasing: \" + str(symbol) + \"   MACD: \" + str(self._macd_dic[symbol]) + \"   RSI: \" + str(self._rsi_dic[symbol])\n                    + \"   Price: \" + str(round(self.securities[symbol].price, 2)) + \"   Quantity: \" + str(s.quantity))\n\n    # Sell this symbol\n    def sell_stock(self,symbol):\n        s = self.securities[symbol].holdings\n        if s.quantity > 0 and self._macd_dic[symbol].current.value < 0:\n            self.liquidate(symbol)\n            self.debug(\"Selling: \" + str(symbol) + \" at sell MACD: \" + str(self._macd_dic[symbol]) + \"   RSI: \" + str(self._rsi_dic[symbol])\n                    + \"   Price: \" + str(round(self.securities[symbol].price, 2)) + \"   Profit from sale: \" + str(s.last_trade_profit))\n\n\n# CAPE Ratio for SP500 PE Ratio for avg inflation adjusted earnings for previous ten years Custom Data from DropBox\n# Original Data from: http://www.econ.yale.edu/~shiller/data.htm\nclass Cape(PythonData):\n    \n    # Return the URL string source of the file. This will be converted to a stream\n    # <param name=\"config\">Configuration object</param>\n    # <param name=\"date\">Date of this source file</param>\n    # <param name=\"is_live_mode\">true if we're in live mode, false for backtesting mode</param>\n    # <returns>String URL of source file.</returns>\n\n    def get_source(self, config, date, is_live_mode):\n        # Remember to add the \"?dl=1\" for dropbox links\n        return SubscriptionDataSource(\"https://www.dropbox.com/s/ggt6blmib54q36e/CAPE.csv?dl=1\", SubscriptionTransportMedium.REMOTE_FILE)\n    \n    \n    ''' Reader Method : using set of arguments we specify read out type. Enumerate until \n        the end of the data stream or file. E.g. Read CSV file line by line and convert into data types. '''\n        \n    # <returns>BaseData type set by Subscription Method.</returns>\n    # <param name=\"config\">Config.</param>\n    # <param name=\"line\">Line.</param>\n    # <param name=\"date\">Date.</param>\n    # <param name=\"is_live_mode\">true if we're in live mode, false for backtesting mode</param>\n    \n    def reader(self, config, line, date, is_live_mode):\n        if not (line.strip() and line[0].isdigit()): return None\n    \n        # New Nifty object\n        index = Cape()\n        index.symbol = config.symbol\n    \n        try:\n            # Example File Format:\n            # Date   |  Price |  Div  | Earning | CPI  | FractionalDate | Interest Rate | RealPrice | RealDiv | RealEarnings | CAPE\n            # 2014.06  1947.09  37.38   103.12   238.343    2014.37          2.6           1923.95     36.94        101.89     25.55\n            data = line.split(',')\n            # Dates must be in the format YYYY-MM-DD. If your data source does not have this format, you must use\n            # DateTime.parse_exact() and explicit declare the format your data source has.\n            index.time = datetime.strptime(data[0], \"%Y-%m\")\n            index[\"Cape\"] = float(data[10]) \n            index.value = data[10]\n            \n    \n        except ValueError:\n                # Do nothing\n                return None\n    \n        return index\n"
  },
  {
    "path": "Algorithm.Python/BybitCryptoFuturesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom cmath import isclose\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating and ensuring that Bybit crypto futures brokerage model works as expected\n### </summary>\nclass BybitCryptoFuturesRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2022, 12, 13)\n        self.set_end_date(2022, 12, 13)\n\n        # Set strategy cash (USD)\n        self.set_cash(100000)\n\n        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)\n\n        # Translate lines 44-59 to Python:\n\n        self.add_crypto(\"BTCUSDT\", Resolution.MINUTE)\n\n        self.btc_usdt = self.add_crypto_future(\"BTCUSDT\", Resolution.MINUTE)\n        self.btc_usd = self.add_crypto_future(\"BTCUSD\", Resolution.MINUTE)\n\n        # create two moving averages\n        self.fast = self.ema(self.btc_usdt.symbol, 30, Resolution.MINUTE)\n        self.slow = self.ema(self.btc_usdt.symbol, 60, Resolution.MINUTE)\n\n        self.interest_per_symbol = {}\n        self.interest_per_symbol[self.btc_usd.symbol] = 0\n        self.interest_per_symbol[self.btc_usdt.symbol] = 0\n\n        # the amount of USDT we need to hold to trade 'BTCUSDT'\n        self.btc_usdt.quote_currency.set_amount(200)\n        # the amount of BTC we need to hold to trade 'BTCUSD'\n        self.btc_usd.base_currency.set_amount(0.005)\n\n    def on_data(self, data):\n        interest_rates = data.get[MarginInterestRate]()\n        for interest_rate in interest_rates:\n            self.interest_per_symbol[interest_rate.key] += 1\n\n            cached_interest_rate = self.securities[interest_rate.key].cache.get_data(MarginInterestRate)\n            if cached_interest_rate != interest_rate.value:\n                raise AssertionError(f\"Unexpected cached margin interest rate for {interest_rate.key}!\")\n\n        if not self.slow.is_ready:\n            return\n\n        if self.fast > self.slow:\n            if not self.portfolio.invested and self.transactions.orders_count == 0:\n                ticket = self.buy(self.btc_usd.symbol, 1000)\n                if ticket.status != OrderStatus.INVALID:\n                    raise AssertionError(f\"Unexpected valid order {ticket}, should fail due to margin not sufficient\")\n\n                self.buy(self.btc_usd.symbol, 100)\n\n                margin_used = self.portfolio.total_margin_used\n                btc_usd_holdings = self.btc_usd.holdings\n\n                # Coin futures value is 100 USD\n                holdings_value_btc_usd = 100\n                if abs(btc_usd_holdings.total_sale_volume - holdings_value_btc_usd) > 1:\n                    raise AssertionError(f\"Unexpected TotalSaleVolume {btc_usd_holdings.total_sale_volume}\")\n                if abs(btc_usd_holdings.absolute_holdings_cost - holdings_value_btc_usd) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {btc_usd_holdings.holdings_cost}\")\n                if not isclose(self.btc_usd.buying_power_model.get_maintenance_margin(MaintenanceMarginParameters.for_current_holdings(self.btc_usd)).value, margin_used):\n                    raise AssertionError(f\"Unexpected margin used {margin_used}\")\n\n                self.buy(self.btc_usdt.symbol, 0.01)\n\n                margin_used = self.portfolio.total_margin_used - margin_used\n                btc_usdt_holdings = self.btc_usdt.holdings\n\n                # USDT futures value is based on it's price\n                holdings_value_usdt = self.btc_usdt.price * self.btc_usdt.symbol_properties.contract_multiplier * 0.01\n\n                if abs(btc_usdt_holdings.total_sale_volume - holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected TotalSaleVolume {btc_usdt_holdings.total_sale_volume}\")\n                if abs(btc_usdt_holdings.absolute_holdings_cost - holdings_value_usdt) > 1:\n                    raise AssertionError(f\"Unexpected holdings cost {btc_usdt_holdings.holdings_cost}\")\n                if not isclose(self.btc_usdt.buying_power_model.get_maintenance_margin(MaintenanceMarginParameters.for_current_holdings(self.btc_usdt)).value, margin_used):\n                    raise AssertionError(f\"Unexpected margin used {margin_used}\")\n\n                 # position just opened should be just spread here\n                unrealized_profit = self.portfolio.total_unrealized_profit\n                if (5 - abs(unrealized_profit)) < 0:\n                    raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n\n                if self.portfolio.total_profit != 0:\n                    raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n        # let's revert our position\n        elif self.transactions.orders_count == 3:\n            self.sell(self.btc_usd.symbol, 300)\n\n            btc_usd_holdings = self.btc_usd.holdings\n            if abs(btc_usd_holdings.absolute_holdings_cost - 100 * 2) > 1:\n                raise AssertionError(f\"Unexpected holdings cost {btc_usd_holdings.holdings_cost}\")\n\n            self.sell(self.btc_usdt.symbol, 0.03)\n\n            # USDT futures value is based on it's price\n            holdings_value_usdt = self.btc_usdt.price * self.btc_usdt.symbol_properties.contract_multiplier * 0.02\n            if abs(self.btc_usdt.holdings.absolute_holdings_cost - holdings_value_usdt) > 1:\n                raise AssertionError(f\"Unexpected holdings cost {self.btc_usdt.holdings.holdings_cost}\")\n\n            # position just opened should be just spread here\n            profit = self.portfolio.total_unrealized_profit\n            if (5 - abs(profit)) < 0:\n                raise AssertionError(f\"Unexpected TotalUnrealizedProfit {self.portfolio.total_unrealized_profit}\")\n            # we barely did any difference on the previous trade\n            if (5 - abs(self.portfolio.total_profit)) < 0:\n                raise AssertionError(f\"Unexpected TotalProfit {self.portfolio.total_profit}\")\n\n    def on_order_event(self, order_event):\n        self.debug(\"{} {}\".format(self.time, order_event.to_string()))\n\n    def on_end_of_algorithm(self):\n        self.log(f\"{self.time} - TotalPortfolioValue: {self.portfolio.total_portfolio_value}\")\n        self.log(f\"{self.time} - CashBook: {self.portfolio.cash_book}\")\n\n        if any(x == 0 for x in self.interest_per_symbol.values()):\n            raise AssertionError(\"Expected interest rate data for all symbols\")\n"
  },
  {
    "path": "Algorithm.Python/BybitCryptoRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected\n### </summary>\nclass BybitCryptoRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2022, 12, 13)\n        self.set_end_date(2022, 12, 13)\n\n        # Set account currency (USDT)\n        self.set_account_currency(\"USDT\")\n\n        # Set strategy cash (USD)\n        self.set_cash(100000)\n\n        # Add some coin as initial holdings\n        # When connected to a real brokerage, the amount specified in SetCash\n        # will be replaced with the amount in your actual account.\n        self.set_cash(\"BTC\", 1)\n\n        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.CASH)\n\n        self.btc_usdt = self.add_crypto(\"BTCUSDT\").symbol\n\n        # create two moving averages\n        self.fast = self.ema(self.btc_usdt, 30, Resolution.MINUTE)\n        self.slow = self.ema(self.btc_usdt, 60, Resolution.MINUTE)\n\n        self.liquidated = False\n\n    def on_data(self, data):\n        if self.portfolio.cash_book[\"USDT\"].conversion_rate == 0 or self.portfolio.cash_book[\"BTC\"].conversion_rate == 0:\n            self.log(f\"USDT conversion rate: {self.portfolio.cash_book['USDT'].conversion_rate}\")\n            self.log(f\"BTC conversion rate: {self.portfolio.cash_book['BTC'].conversion_rate}\")\n\n            raise AssertionError(\"Conversion rate is 0\")\n\n        if not self.slow.is_ready:\n            return\n\n        btc_amount = self.portfolio.cash_book[\"BTC\"].amount\n        if self.fast > self.slow:\n            if btc_amount == 1 and not self.liquidated:\n                self.buy(self.btc_usdt, 1)\n        else:\n            if btc_amount > 1:\n                self.liquidate(self.btc_usdt)\n                self.liquidated = True\n            elif btc_amount > 0 and self.liquidated and len(self.transactions.get_open_orders()) == 0:\n                # Place a limit order to sell our initial BTC holdings at 1% above the current price\n                limit_price = round(self.securities[self.btc_usdt].price * 1.01, 2)\n                self.limit_order(self.btc_usdt, -btc_amount, limit_price)\n\n    def on_order_event(self, order_event):\n        self.debug(\"{} {}\".format(self.time, order_event.to_string()))\n\n    def on_end_of_algorithm(self):\n        self.log(f\"{self.time} - TotalPortfolioValue: {self.portfolio.total_portfolio_value}\")\n        self.log(f\"{self.time} - CashBook: {self.portfolio.cash_book}\")\n\n        btc_amount = self.portfolio.cash_book[\"BTC\"].amount\n        if btc_amount > 0:\n            raise AssertionError(f\"BTC holdings should be zero at the end of the algorithm, but was {btc_amount}\")\n"
  },
  {
    "path": "Algorithm.Python/BybitCustomDataCryptoRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import time\nimport os\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected with custom data types\n### </summary>\nclass BybitCustomDataCryptoRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2022, 12, 13)\n        self.set_end_date(2022, 12, 13)\n\n        self.set_account_currency(\"USDT\")\n        self.set_cash(100000)\n\n        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.CASH)\n\n        symbol = self.add_crypto(\"BTCUSDT\").symbol\n        self._btc_usdt = self.add_data(CustomCryptoData, symbol, Resolution.MINUTE).symbol\n\n        # create two moving averages\n        self._fast = self.ema(self._btc_usdt, 30, Resolution.MINUTE)\n        self._slow = self.ema(self._btc_usdt, 60, Resolution.MINUTE)\n\n    def on_data(self, data: Slice) -> None:\n        if not self._slow.is_ready:\n            return\n\n        if self._fast.current.value > self._slow.current.value:\n            if self.transactions.orders_count == 0:\n                self.buy(self._btc_usdt, 1)\n        else:\n            if self.transactions.orders_count == 1:\n                self.liquidate(self._btc_usdt)\n\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        self.debug(f\"{self.time} {order_event}\")\n\nclass CustomCryptoData(PythonData):\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        tick_type_string = Extensions.tick_type_to_lower(config.tick_type)\n        formatted_date = date.strftime(\"%Y%m%d\")\n        source = os.path.join(Globals.data_folder, \"crypto\", \"bybit\", \"minute\",\n                              config.symbol.value.lower(), f\"{formatted_date}_{tick_type_string}.zip\")\n\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LOCAL_FILE, FileFormat.CSV)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> BaseData:\n        csv = line.split(',')\n\n        data = CustomCryptoData()\n        data.symbol = config.symbol\n\n        data_datetime = datetime.combine(date.date(), time()) + timedelta(milliseconds=int(csv[0]))\n        data.time = Extensions.convert_to(data_datetime, config.data_time_zone, config.exchange_time_zone)\n        data.end_time = data.time + timedelta(minutes=1)\n\n        data[\"Open\"] = float(csv[1])\n        data[\"High\"] = float(csv[2])\n        data[\"Low\"] = float(csv[3])\n        data[\"Close\"] = float(csv[4])\n        data[\"Volume\"] = float(csv[5])\n        data.value = float(csv[4])\n\n        return data\n"
  },
  {
    "path": "Algorithm.Python/CallbackCommandRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass InvalidCommand():\n    variable = 10\n\nclass VoidCommand():\n    quantity = 0\n    target = []\n    parameters = {}\n    targettime = None\n\n    def run(self, algo: IAlgorithm) -> bool:\n        if not self.targettime or self.targettime != algo.time:\n            return False\n        tag = self.parameters[\"tag\"]\n        algo.order(self.target[0], self.get_quantity(), tag=tag)\n        return True\n\n    def get_quantity(self):\n        return self.quantity\n\nclass BoolCommand(Command):\n    something_else = {}\n    array_test = []\n    result = False\n\n    def run(self, algo) -> bool:\n        trade_ibm = self.my_custom_method()\n        if trade_ibm:\n            algo.debug(f\"BoolCommand.run: {str(self)}\")\n            algo.buy(\"IBM\", 1)\n        return trade_ibm\n\n    def my_custom_method(self):\n        return self.result\n\n### <summary>\n### Regression algorithm asserting the behavior of different callback commands call\n### </summary>\nclass CallbackCommandRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        self.add_equity(\"SPY\")\n        self.add_equity(\"IBM\")\n        self.add_equity(\"BAC\")\n\n        self.add_command(VoidCommand)\n        self.add_command(BoolCommand)\n\n        threw_exception = False\n        try:\n            self.add_command(InvalidCommand)\n        except:\n            threw_exception = True\n        if not threw_exception:\n            raise ValueError('InvalidCommand did not throw!')\n\n        bool_command = BoolCommand()\n        bool_command.result = True\n        bool_command.something_else = { \"Property\": 10 }\n        bool_command.array_test = [ \"SPY\", \"BTCUSD\" ]\n        link = self.link(bool_command)\n        if \"&command%5barray_test%5d%5b0%5d=SPY&command%5barray_test%5d%5b1%5d=BTCUSD&command%5bresult%5d=True&command%5bsomething_else%5d%5bProperty%5d=10&command%5b%24type%5d=BoolCommand\" not in link:\n            raise ValueError(f'Invalid link was generated! {link}')\n\n        potential_command = VoidCommand()\n        potential_command.target = [ \"BAC\" ]\n        potential_command.quantity = 10\n        potential_command.parameters = { \"tag\": \"Signal X\" }\n\n        command_link = self.link(potential_command)\n        if \"&command%5btarget%5d%5b0%5d=BAC&command%5bquantity%5d=10&command%5bparameters%5d%5btag%5d=Signal+X&command%5b%24type%5d=VoidCommand\" not in command_link:\n            raise ValueError(f'Invalid link was generated! {command_link}')\n        self.notify.email(\"email@address\", \"Trade Command Event\", f\"Signal X trade\\nFollow link to trigger: {command_link}\")\n\n        untyped_command_link = self.link({ \"symbol\": \"SPY\", \"parameters\": { \"quantity\": 10 } })\n        if \"&command%5bsymbol%5d=SPY&command%5bparameters%5d%5bquantity%5d=10\" not in untyped_command_link:\n            raise ValueError(f'Invalid link was generated! {untyped_command_link}')\n        self.notify.email(\"email@address\", \"Untyped Command Event\", f\"Signal Y trade\\nFollow link to trigger: {untyped_command_link}\")\n\n        # We need to create a project on QuantConnect to test the broadcast_command method\n        # and use the project_id in the broadcast_command call\n        self.project_id = 21805137\n\n        # All live deployments receive the broadcasts below\n        broadcast_result = self.broadcast_command(potential_command)\n        broadcast_result2 = self.broadcast_command({ \"symbol\": \"SPY\", \"parameters\": { \"quantity\": 10 } })\n\n    def on_command(self, data: object) -> bool:\n        self.debug(f\"on_command: {str(data)}\")\n        self.buy(data.symbol, data.parameters[\"quantity\"])\n        return True # False, None\n"
  },
  {
    "path": "Algorithm.Python/CanLiquidateWithOrderPropertiesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test we can liquidate our portfolio holdings using order properties\n### </summary>\nclass CanLiquidateWithOrderPropertiesRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 6)\n        self.set_cash(100000)\n        \n        self.open_exchange = datetime(2014, 6, 6, 10, 0, 0)\n        self.close_exchange = datetime(2014, 6, 6, 16, 0, 0)\n        self.add_equity(\"AAPL\", resolution = Resolution.MINUTE)\n    \n    def on_data(self, slice):\n        if self.time > self.open_exchange and self.time < self.close_exchange:\n            if not self.portfolio.invested:\n                self.market_order(\"AAPL\", 10)\n            else:\n                order_properties = OrderProperties()\n                order_properties.time_in_force = TimeInForce.DAY\n                tickets = self.liquidate(asynchronous = True, order_properties = order_properties)\n                for ticket in tickets:\n                    if ticket.submit_request.order_properties.time_in_force != TimeInForce.DAY:\n                        raise AssertionError(f\"The TimeInForce for all orders should be daily, but it was {ticket.submit_request.order_properties.time_in_force}\")\n"
  },
  {
    "path": "Algorithm.Python/CapmAlphaRankingFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### CapmAlphaRankingFrameworkAlgorithm: example of custom scheduled universe selection model\n### Universe Selection inspired by https://www.quantconnect.com/tutorials/strategy-library/capm-alpha-ranking-strategy-on-dow-30-companies\n### </summary>\nclass CapmAlphaRankingFrameworkAlgorithm(QCAlgorithm):\n    '''CapmAlphaRankingFrameworkAlgorithm: example of custom scheduled universe selection model'''\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2016, 1, 1)   #Set Start Date\n        self.set_end_date(2017, 1, 1)     #Set End Date\n        self.set_cash(100000)            #Set Strategy Cash\n\n        # set algorithm framework models\n        self.set_universe_selection(CapmAlphaRankingUniverseSelectionModel())\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n\nclass CapmAlphaRankingUniverseSelectionModel(UniverseSelectionModel):\n    '''This universe selection model picks stocks with the highest alpha: interception of the linear regression against a benchmark.'''\n\n    period = 21\n    benchmark = \"SPY\"\n\n    # Symbols of Dow 30 companies.\n    _symbols = [Symbol.create(x, SecurityType.EQUITY, Market.USA)\n               for x in [\"AAPL\", \"AXP\", \"BA\", \"CAT\", \"CSCO\", \"CVX\", \"DD\", \"DIS\", \"GE\", \"GS\",\n                         \"HD\", \"IBM\", \"INTC\", \"JPM\", \"KO\", \"MCD\", \"MMM\", \"MRK\", \"MSFT\",\n                         \"NKE\",\"PFE\", \"PG\", \"TRV\", \"UNH\", \"UTX\", \"V\", \"VZ\", \"WMT\", \"XOM\"]]\n\n    def create_universes(self, algorithm):\n\n        # Adds the benchmark to the user defined universe\n        benchmark = algorithm.add_equity(self.benchmark, Resolution.DAILY)\n\n        # Defines a schedule universe that fires after market open when the month starts\n        return [ ScheduledUniverse(\n            benchmark.exchange.time_zone,\n            algorithm.date_rules.month_start(self.benchmark),\n            algorithm.time_rules.after_market_open(self.benchmark),\n            lambda datetime: self.select_pair(algorithm, datetime),\n            algorithm.universe_settings)]\n\n    def select_pair(self, algorithm, date):\n        '''Selects the pair (two stocks) with the highest alpha'''\n        dictionary = dict()\n        benchmark = self._get_returns(algorithm, self.benchmark)\n        ones = np.ones(len(benchmark))\n\n        for symbol in self._symbols:\n            prices = self._get_returns(algorithm, symbol)\n            if prices is None: continue\n            A = np.vstack([prices, ones]).T\n\n            # Calculate the Least-Square fitting to the returns of a given symbol and the benchmark\n            ols = np.linalg.lstsq(A, benchmark)[0]\n            dictionary[symbol] = ols[1]\n\n        # Returns the top 2 highest alphas\n        ordered_dictionary = sorted(dictionary.items(), key= lambda x: x[1], reverse=True)\n        return [x[0] for x in ordered_dictionary[:2]]\n\n    def _get_returns(self, algorithm, symbol):\n\n        history = algorithm.history([symbol], self.period, Resolution.DAILY)\n        if history.empty: return None\n\n        window = RollingWindow(self.period)\n        rate_of_change = RateOfChange(1)\n\n        def roc_updated(s, item):\n            window.add(item.value)\n\n        rate_of_change.updated += roc_updated\n\n        history = history.close.reset_index(level=0, drop=True).items()\n\n        for time, value in history:\n            rate_of_change.update(time, value)\n\n        return [ x for x in window]\n"
  },
  {
    "path": "Algorithm.Python/ClassicRangeConsolidatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom AlgorithmImports import *\nfrom RangeConsolidatorAlgorithm import RangeConsolidatorAlgorithm\n\n### <summary>\n### Example algorithm of how to use ClassicRangeConsolidator\n### </summary>\nclass ClassicRangeConsolidatorAlgorithm(RangeConsolidatorAlgorithm):\n    def create_range_consolidator(self) -> ClassicRangeConsolidator:\n        return ClassicRangeConsolidator(self.get_range())\n    \n    def on_data_consolidated(self, sender: object, range_bar: RangeBar):\n        super().on_data_consolidated(sender, range_bar)\n\n        if range_bar.volume == 0:\n            raise AssertionError(\"All RangeBar's should have non-zero volume, but this doesn't\")\n\n"
  },
  {
    "path": "Algorithm.Python/ClassicRangeConsolidatorWithTickAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom RangeConsolidatorWithTickAlgorithm import RangeConsolidatorWithTickAlgorithm\n\n### <summary>\n### Example algorithm of how to use ClassicRangeConsolidator with Tick resolution\n### </summary>\nclass ClassicRangeConsolidatorWithTickAlgorithm(RangeConsolidatorWithTickAlgorithm):\n    def create_range_consolidator(self):\n        return ClassicRangeConsolidator(self.get_range())\n    \n    def on_data_consolidated(self, sender, range_bar):\n        super().on_data_consolidated(sender, range_bar)\n\n        if range_bar.volume == 0:\n            raise AssertionError(\"All RangeBar's should have non-zero volume, but this doesn't\")\n"
  },
  {
    "path": "Algorithm.Python/ClassicRenkoConsolidatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to initialize and use the Classic RenkoConsolidator\n### </summary>\n### <meta name=\"tag\" content=\"renko\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\nclass ClassicRenkoConsolidatorAlgorithm(QCAlgorithm):\n    '''Demonstration of how to initialize and use the RenkoConsolidator'''\n\n    def initialize(self) -> None:\n        self.set_start_date(2012, 1, 1)\n        self.set_end_date(2013, 1, 1)\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n        # this is the simple constructor that will perform the\n        # renko logic to the Value property of the data it receives.\n\n        # break SPY into $2.5 renko bricks and send that data to our 'OnRenkoBar' method\n        renko_close = ClassicRenkoConsolidator(2.5)\n        renko_close.data_consolidated += self.handle_renko_close\n        self.subscription_manager.add_consolidator(\"SPY\", renko_close)\n\n        # this is the full constructor that can accept a value selector and a volume selector\n        # this allows us to perform the renko logic on values other than Close, even computed values!\n\n        # break SPY into (2*o + h + l + 3*c)/7\n        renko7bar = ClassicRenkoConsolidator(2.5, lambda x: (2 * x.open + x.high + x.low + 3 * x.close) / 7, lambda x: x.volume)\n        renko7bar.data_consolidated += self.handle_renko7_bar\n        self.subscription_manager.add_consolidator(\"SPY\", renko7bar)\n\n\n    # We're doing our analysis in the on_renko_bar method, but the framework verifies that this method exists, so we define it.\n    def on_data(self, data: Slice) -> None:\n        pass\n\n\n    def handle_renko_close(self, sender: object, data: RenkoBar) -> None:\n        '''This function is called by our renko_close consolidator defined in Initialize()\n        Args:\n            data: The new renko bar produced by the consolidator'''\n        if not self.portfolio.invested:\n            self.set_holdings(data.symbol, 1)\n\n        self.log(f\"CLOSE - {data.time} - {data.open} {data.close}\")\n\n\n    def handle_renko7_bar(self, sender: object, data: RenkoBar) -> None:\n        '''This function is called by our renko7bar consolidator defined in Initialize()\n        Args:\n            data: The new renko bar produced by the consolidator'''\n        if self.portfolio.invested:\n            self.liquidate(data.symbol)\n        self.log(f\"7BAR - {data.time} - {data.open} {data.close}\")\n"
  },
  {
    "path": "Algorithm.Python/CoarseFineAsyncUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting that using separate coarse & fine selection with async universe settings is not allowed\n### </summary>\nclass CoarseFineAsyncUniverseRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        self.universe_settings.asynchronous = True\n\n        threw_exception = False\n        try:\n            self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n        except:\n            # expected\n            threw_exception = True\n            pass\n\n        if not threw_exception:\n            raise ValueError(\"Expected exception to be thrown for AddUniverse\")\n\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(self.coarse_selection_function, self.fine_selection_function))\n\n    def coarse_selection_function(self, coarse):\n        return []\n\n    def fine_selection_function(self, fine):\n        return []\n"
  },
  {
    "path": "Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of using coarse and fine universe selection together to filter down a smaller universe of stocks.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"fine universes\" />\nclass CoarseFineFundamentalComboAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014,1,1)  #Set Start Date\n        self.set_end_date(2015,1,1)    #Set End Date\n        self.set_cash(50000)            #Set Strategy Cash\n\n        # what resolution should the data *added* to the universe be?\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # this add universe method accepts two parameters:\n        # - coarse selection function: accepts an IEnumerable<CoarseFundamental> and returns an IEnumerable<Symbol>\n        # - fine selection function: accepts an IEnumerable<FineFundamental> and returns an IEnumerable<Symbol>\n        self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n\n        self.__number_of_symbols = 5\n        self.__number_of_symbols_fine = 2\n        self._changes = None\n\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.__number_of_symbols] ]\n\n    # sort the data by P/E ratio and take the top 'NumberOfSymbolsFine'\n    def fine_selection_function(self, fine):\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(fine, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:self.__number_of_symbols_fine] ]\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self._changes is None: return\n\n        # liquidate removed securities\n        for security in self._changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # we want 20% allocation in each security in our universe\n        for security in self._changes.added_securities:\n            self.set_holdings(security.symbol, 0.2)\n\n        self._changes = None\n\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self._changes = changes\n"
  },
  {
    "path": "Algorithm.Python/CoarseFineFundamentalRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to define a universe as a combination of use the coarse fundamental data and fine fundamental data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass CoarseFineFundamentalRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014,3,24)   #Set Start Date\n        self.set_end_date(2014,4,7)      #Set End Date\n        self.set_cash(50000)            #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # this add universe method accepts two parameters:\n        # - coarse selection function: accepts an List[CoarseFundamental] and returns an List[Symbol]\n        # - fine selection function: accepts an List[FineFundamental] and returns an List[Symbol]\n        self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n\n        self.changes = None\n        self.number_of_symbols_fine = 2\n\n    # return a list of three fixed symbol objects\n    def coarse_selection_function(self, coarse):\n        tickers = [ \"GOOG\", \"BAC\", \"SPY\" ]\n\n        if self.time.date() < date(2014, 4, 1):\n            tickers = [ \"AAPL\", \"AIG\", \"IBM\" ]\n\n        return [ Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in tickers ]\n\n\n    # sort the data by market capitalization and take the top 'number_of_symbols_fine'\n    def fine_selection_function(self, fine):\n        # sort descending by market capitalization\n        sorted_by_market_cap = sorted(fine, key=lambda x: x.market_cap, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_market_cap[:self.number_of_symbols_fine] ]\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self.changes is None: return\n\n        # liquidate removed securities\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n                self.debug(\"Liquidated Stock: \" + str(security.symbol.value))\n\n        # we want 50% allocation in each security in our universe\n        for security in self.changes.added_securities:\n            if (security.fundamentals.earning_ratios.equity_per_share_growth.one_year > 0.25):\n                self.set_holdings(security.symbol, 0.5)\n                self.debug(\"Purchased Stock: \" + str(security.symbol.value))\n\n        self.changes = None\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self.changes = changes\n"
  },
  {
    "path": "Algorithm.Python/CoarseFineOptionUniverseChainRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to chain a coarse and fine universe selection with an option chain universe selection model\n### that will add and remove an'OptionChainUniverse' for each symbol selected on fine\n### </summary>\nclass CoarseFineOptionUniverseChainRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014,6,4)\n        # TWX is selected the 4th and 5th and aapl after that.\n        # If the algo ends on the 6th, TWX subscriptions will not be removed before OnEndOfAlgorithm is called:\n        #   - 6th: AAPL is selected, TWX is removed but subscriptions are not removed because the securities are invested.\n        #      - TWX and its options are liquidated.\n        #   - 7th: Since options universe selection is daily now, TWX subscriptions are removed the next day (7th)\n        self.set_end_date(2014,6,7)\n\n        self.universe_settings.resolution = Resolution.MINUTE\n        self._twx = Symbol.create(\"TWX\", SecurityType.EQUITY, Market.USA)\n        self._aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n        self._last_equity_added = None\n        self._changes = SecurityChanges.NONE\n        self._option_count = 0\n\n        universe = self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n\n        self.add_universe_options(universe, self.option_filter_function)\n\n    def option_filter_function(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:\n        universe.include_weeklys().front_month()\n\n        contracts = list()\n        for contract in universe:\n            if len(contracts) == 5:\n                break\n            contracts.append(contract)\n        return universe.contracts(contracts)\n\n    def coarse_selection_function(self, coarse: list[CoarseFundamental]) -> list[Symbol]:\n        if self.time <= datetime(2014,6,5):\n            return [ self._twx ]\n        return [ self._aapl ]\n\n    def fine_selection_function(self, fine: list[FineFundamental]) -> list[Symbol]:\n        if self.time <= datetime(2014,6,5):\n            return [ self._twx ]\n        return [ self._aapl ]\n\n    def on_data(self, data: Slice) -> None:\n        if self._changes == SecurityChanges.NONE or any(security.price == 0 for security in self._changes.added_securities):\n            return\n\n        # liquidate removed securities\n        for security in self._changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        for security in self._changes.added_securities:\n            if not security.symbol.has_underlying:\n                self._last_equity_added = security.symbol\n            else:\n                # options added should all match prev added security\n                if security.symbol.underlying != self._last_equity_added:\n                    raise ValueError(f\"Unexpected symbol added {security.symbol}\")\n                self._option_count += 1\n\n            self.set_holdings(security.symbol, 0.05)\n        self._changes = SecurityChanges.NONE\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        if self._changes == SecurityChanges.NONE:\n            self._changes = changes\n            return\n        self._changes = self._changes + changes\n\n    def on_end_of_algorithm(self) -> None:\n        if self._option_count == 0:\n            raise ValueError(\"Option universe chain did not add any option!\")\n"
  },
  {
    "path": "Algorithm.Python/CoarseFundamentalTop3Algorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of using coarse and fine universe selection together to filter down a smaller universe of stocks.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"fine universes\" />\nclass CoarseFundamentalTop3Algorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014,3,24)    #Set Start Date\n        self.set_end_date(2014,4,7)      #Set End Date\n        self.set_cash(50000)            #Set Strategy Cash\n\n        # what resolution should the data *added* to the universe be?\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # this add universe method accepts a single parameter that is a function that\n        # accepts an IEnumerable<CoarseFundamental> and returns IEnumerable<Symbol>\n        self.add_universe(self.coarse_selection_function)\n\n        self.__number_of_symbols = 3\n        self._changes = None\n\n\n    # sort the data by daily dollar volume and take the top '__number_of_symbols'\n    def coarse_selection_function(self, coarse):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.__number_of_symbols] ]\n\n\n    def on_data(self, data):\n\n        self.log(f\"OnData({self.utc_time}): Keys: {', '.join([key.value for key in data.keys()])}\")\n\n        # if we have no changes, do nothing\n        if self._changes is None: return\n\n        # liquidate removed securities\n        for security in self._changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # we want 1/N allocation in each security in our universe\n        for security in self._changes.added_securities:\n            self.set_holdings(security.symbol, 1 / self.__number_of_symbols)\n\n        self._changes = None\n\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self._changes = changes\n        self.log(f\"OnSecuritiesChanged({self.utc_time}):: {changes}\")\n\n    def on_order_event(self, fill):\n        self.log(f\"OnOrderEvent({self.utc_time}):: {fill}\")\n"
  },
  {
    "path": "Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm sends a list of portfolio targets from algorithm's Portfolio\n### to Collective2 API every time the ema indicators crosses between themselves.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\nclass Collective2PortfolioSignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        ''' Initialize the date and add all equity symbols present in list _symbols '''\n\n        self.set_start_date(2013, 10, 7)   #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n\n        # Symbols accepted by Collective2. Collective2 accepts stock, future, forex and US stock option symbols\n        self.add_equity(\"GOOG\")\n        self._symbols = [\n            Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA, None, None),\n            Symbol.create(\"EURUSD\", SecurityType.FOREX, Market.OANDA, None, None),\n            Symbol.create_future(\"ES\", Market.CME, datetime(2023, 12, 15), None),\n            Symbol.create_option(\"GOOG\", Market.USA, OptionStyle.AMERICAN, OptionRight.CALL, 130, datetime(2023, 9, 1))\n        ]\n        for item in self._symbols:\n            self.add_security(item)\n\n        self.fast = self.ema(\"SPY\", 10)\n        self.slow = self.ema(\"SPY\", 100)\n\n        # Initialize these flags, to check when the ema indicators crosses between themselves\n        self.ema_fast_is_not_set = True\n        self.ema_fast_was_above = False\n\n        # Collective2 APIv4 KEY: This value is provided by Collective2 in their webpage in your account section (See https://collective2.com/account-info)\n        # See API documentation at https://trade.collective2.com/c2-api\n        self.collective2_apikey = \"YOUR APIV4 KEY\"\n\n        # Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page\n        self.collective2_system_id = 0\n\n        # Disable automatic exports as we manually set them\n        self.signal_export.automatic_export_time_span = None\n\n        # Set Collective2 signal export provider\n        self.signal_export.add_signal_export_provider(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))\n\n        self.first_call = True\n\n        self.set_warm_up(100)\n\n    def on_data(self, data):\n        ''' Reduce the quantity of holdings for one security and increase the holdings to the another\n        one when the EMA's indicators crosses between themselves, then send a signal to Collective2 API '''\n        if self.is_warming_up: return\n\n        # Place an order as soon as possible to send a signal.\n        if self.first_call:\n            self.set_holdings(\"SPY\", 0.1)\n            self.signal_export.set_target_portfolio_from_portfolio()\n            self.first_call = False\n\n        fast = self.fast.current.value\n        slow = self.slow.current.value\n\n        # Set the value of flag _ema_fast_was_above, to know when the ema indicators crosses between themselves\n        if self.ema_fast_is_not_set == True:\n            if fast > slow *1.001:\n                self.ema_fast_was_above = True\n            else:\n                self.ema_fast_was_above = False\n            self.ema_fast_is_not_set = False\n\n        # Check whether ema fast and ema slow crosses. If they do, set holdings to SPY\n        # or reduce its holdings, and send signals to Collective2 API from your Portfolio\n        if fast > slow * 1.001 and (not self.ema_fast_was_above):\n            self.set_holdings(\"SPY\", 0.1)\n            self.signal_export.set_target_portfolio_from_portfolio()\n        elif fast < slow * 0.999 and (self.ema_fast_was_above):\n            self.set_holdings(\"SPY\", 0.01)\n            self.signal_export.set_target_portfolio_from_portfolio()\n"
  },
  {
    "path": "Algorithm.Python/Collective2SignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm sends a list of portfolio targets to Collective2 API every time the ema indicators crosses between themselves.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\nclass Collective2SignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        ''' Initialize the date and add all equity symbols present in list _symbols '''\n\n        self.set_start_date(2013, 10, 7)   #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n\n        # Symbols accepted by Collective2. Collective2 accepts stock, future, forex and US stock option symbols\n        self.add_equity(\"GOOG\")\n        self._symbols = [\n            Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"EURUSD\", SecurityType.FOREX, Market.OANDA),\n            Symbol.create_future(\"ES\", Market.CME, datetime(2023, 12, 15)),\n            Symbol.create_option(\"GOOG\", Market.USA, OptionStyle.AMERICAN, OptionRight.CALL, 130, datetime(2023, 9, 1))\n        ]\n        self.targets = []\n\n        # Create a new PortfolioTarget for each symbol, assign it an initial amount of 0.05 and save it in self.targets list\n        for item in self._symbols:\n            symbol = self.add_security(item).symbol\n            if symbol.security_type == SecurityType.EQUITY or symbol.security_type == SecurityType.FOREX:\n                self.targets.append(PortfolioTarget(symbol, 0.05))\n            else:\n                self.targets.append(PortfolioTarget(symbol, 1))\n\n        self.fast = self.ema(\"SPY\", 10)\n        self.slow = self.ema(\"SPY\", 100)\n\n        # Initialize these flags, to check when the ema indicators crosses between themselves\n        self.ema_fast_is_not_set = True\n        self.ema_fast_was_above = False\n\n        # Set Collective2 export provider\n        # Collective2 APIv4 KEY: This value is provided by Collective2 in your account section (See https://collective2.com/account-info)\n        # See API documentation at https://trade.collective2.com/c2-api\n        self.collective2_apikey = \"YOUR APIV4 KEY\"\n\n        # Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page\n        self.collective2_system_id = 0\n\n        # Disable automatic exports as we manually set them\n        self.signal_export.automatic_export_time_span = None\n\n        # If using the Collective2 white-label API, you can specify it in the constructor with the optional parameter `use_white_label_api`:\n        # e.g. Collective2SignalExport(self.collective2_apikey, self.collective2_system_id, use_white_label_api=True)\n        # The API url can also be overridden by setting the Destination property:\n        # e.g. Collective2SignalExport(self.collective2_apikey, self.collective2_system_id) { Destination = new Uri(\"your url\") }\n        self.signal_export.add_signal_export_provider(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))\n\n        self.first_call = True\n\n        self.set_warm_up(100)\n\n    def on_data(self, data):\n        ''' Reduce the quantity of holdings for one security and increase the holdings to the another\n        one when the EMA's indicators crosses between themselves, then send a signal to Collective2 API '''\n        if self.is_warming_up: return\n\n        # Place an order as soon as possible to send a signal.\n        if self.first_call:\n            self.set_holdings(\"SPY\", 0.1)\n            self.targets[0] = PortfolioTarget(self.portfolio[\"SPY\"].symbol, 0.1)\n            self.signal_export.set_target_portfolio(self.targets)\n            self.first_call = False\n\n        fast = self.fast.current.value\n        slow = self.slow.current.value\n\n        # Set the value of flag _ema_fast_was_above, to know when the ema indicators crosses between themselves\n        if self.ema_fast_is_not_set == True:\n            if fast > slow *1.001:\n                self.ema_fast_was_above = True\n            else:\n                self.ema_fast_was_above = False\n            self.ema_fast_is_not_set = False\n\n        # Check whether ema fast and ema slow crosses. If they do, set holdings to SPY\n        # or reduce its holdings, change its value in self.targets list and send signals\n        #  to Collective2 API from self.targets\n        if fast > slow * 1.001 and (not self.ema_fast_was_above):\n            self.set_holdings(\"SPY\", 0.1)\n            self.targets[0] = PortfolioTarget(self.portfolio[\"SPY\"].symbol, 0.1)\n            self.signal_export.set_target_portfolio(self.targets)\n        elif fast < slow * 0.999 and (self.ema_fast_was_above):\n            self.set_holdings(\"SPY\", 0.01)\n            self.targets[0] = PortfolioTarget(self.portfolio[\"SPY\"].symbol, 0.01)\n            self.signal_export.set_target_portfolio(self.targets)\n"
  },
  {
    "path": "Algorithm.Python/ComboOrderTicketDemoAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport itertools\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm for testing submit/update/cancel for combo orders\n### </summary>\nclass ComboOrderTicketDemoAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        equity = self.add_equity(\"GOOG\", leverage=4, fill_forward=True)\n        option = self.add_option(equity.symbol, fill_forward=True)\n        self._option_symbol = option.symbol\n\n        option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))\n\n        self._open_market_orders = []\n        self._open_leg_limit_orders = []\n        self._open_limit_orders = []\n\n        self._order_legs = None\n\n    def on_data(self, data: Slice) -> None:\n        if self._order_legs is None:\n            if self.is_market_open(self._option_symbol):\n                chain = data.option_chains.get(self._option_symbol)\n                if chain:\n                    call_contracts = [contract for contract in chain if contract.right == OptionRight.CALL]\n                    call_contracts_by_expiry = [(key, list(group)) for key, group in itertools.groupby(call_contracts, key=lambda x: x.expiry)]\n                    call_contracts_by_expiry.sort(key=lambda x: x[0])\n                    call_contracts = call_contracts_by_expiry[0][1]\n                    call_contracts.sort(key=lambda x: x.strike)\n\n                    if len(call_contracts) < 3:\n                        return\n\n                    quantities = [1, -2, 1]\n                    self._order_legs = []\n                    for i, contract in enumerate(call_contracts[:3]):\n                        leg = Leg.create(contract.symbol, quantities[i])\n                        self._order_legs.append(leg)\n        else:\n            # COMBO MARKET ORDERS\n            self.combo_market_orders()\n            # COMBO LIMIT ORDERS\n            self.combo_limit_orders()\n            # COMBO LEG LIMIT ORDERS\n            self.combo_leg_limit_orders()\n\n    def combo_market_orders(self) -> None:\n        if len(self._open_market_orders) != 0 or self._order_legs is None:\n            return\n\n        self.log(\"Submitting combo market orders\")\n\n        tickets = self.combo_market_order(self._order_legs, 2, asynchronous=False)\n        self._open_market_orders.extend(tickets)\n\n        tickets = self.combo_market_order(self._order_legs, 2, asynchronous=True)\n        self._open_market_orders.extend(tickets)\n\n        for ticket in tickets:\n            response = ticket.cancel(\"Attempt to cancel combo market order\")\n            if response.is_success:\n                raise AssertionError(\"Combo market orders should fill instantly, they should not be cancelable in backtest mode: \" + response.order_id)\n\n    def combo_limit_orders(self) -> None:\n        if len(self._open_limit_orders) == 0:\n            self.log(\"Submitting ComboLimitOrder\")\n\n            current_price = sum([leg.quantity * self.securities[leg.symbol].close for leg in self._order_legs])\n\n            tickets = self.combo_limit_order(self._order_legs, 2, current_price + 1.5)\n            self._open_limit_orders.extend(tickets)\n\n            # These won't fill, we will test cancel with this\n            tickets = self.combo_limit_order(self._order_legs, -2, current_price + 3)\n            self._open_limit_orders.extend(tickets)\n        else:\n            combo1 = self._open_limit_orders[:len(self._order_legs)]\n            combo2 = self._open_limit_orders[-len(self._order_legs):]\n\n            # check if either is filled and cancel the other\n            if self.check_group_orders_for_fills(combo1, combo2):\n                return\n\n            # if neither order has filled, bring in the limits by a penny\n\n            ticket = combo1[0]\n            new_limit = round(ticket.get(OrderField.LIMIT_PRICE) + 0.01, 2)\n            self.debug(f\"Updating limits - Combo 1 {ticket.order_id}: {new_limit:.2f}\")\n            fields = UpdateOrderFields()\n            fields.limit_price = new_limit\n            fields.tag = f\"Update #{len(ticket.update_requests) + 1}\"\n            ticket.update(fields)\n\n            ticket = combo2[0]\n            new_limit = round(ticket.get(OrderField.LIMIT_PRICE) - 0.01, 2)\n            self.debug(f\"Updating limits - Combo 2 {ticket.order_id}: {new_limit:.2f}\")\n            fields.limit_price = new_limit\n            fields.tag = f\"Update #{len(ticket.update_requests) + 1}\"\n            ticket.update(fields)\n\n    def combo_leg_limit_orders(self) -> None:\n        if len(self._open_leg_limit_orders) == 0:\n            self.log(\"Submitting ComboLegLimitOrder\")\n\n            # submit a limit order to buy 2 shares at .1% below the bar's close\n            for leg in self._order_legs:\n                close = self.securities[leg.symbol].close\n                leg.order_price = close * .999\n\n            tickets = self.combo_leg_limit_order(self._order_legs, quantity=2)\n            self._open_leg_limit_orders.extend(tickets)\n\n            # submit another limit order to sell 2 shares at .1% above the bar's close\n            for leg in self._order_legs:\n                close = self.securities[leg.symbol].close\n                leg.order_price = close * 1.001\n\n            tickets = self.combo_leg_limit_order(self._order_legs, -2)\n            self._open_leg_limit_orders.extend(tickets)\n        else:\n            combo1 = self._open_leg_limit_orders[:len(self._order_legs)]\n            combo2 = self._open_leg_limit_orders[-len(self._order_legs):]\n\n            # check if either is filled and cancel the other\n            if self.check_group_orders_for_fills(combo1, combo2):\n                return\n\n            # if neither order has filled, bring in the limits by a penny\n\n            for ticket in combo1:\n                new_limit = round(ticket.get(OrderField.LIMIT_PRICE) + (1 if ticket.quantity > 0 else -1) * 0.01, 2)\n                self.debug(f\"Updating limits - Combo #1: {new_limit:.2f}\")\n                fields = UpdateOrderFields()\n                fields.limit_price = new_limit\n                fields.tag = f\"Update #{len(ticket.update_requests) + 1}\"\n                ticket.update(fields)\n\n            for ticket in combo2:\n                new_limit = round(ticket.get(OrderField.LIMIT_PRICE) + (1 if ticket.quantity > 0 else -1) * 0.01, 2)\n                self.debug(f\"Updating limits - Combo #2: {new_limit:.2f}\")\n                fields.limit_price = new_limit\n                fields.tag = f\"Update #{len(ticket.update_requests) + 1}\"\n                ticket.update(fields)\n\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        order = self.transactions.get_order_by_id(order_event.order_id)\n\n        if order_event.quantity == 0:\n            raise AssertionError(\"OrderEvent quantity is Not expected to be 0, it should hold the current order Quantity\")\n\n        if order_event.quantity != order.quantity:\n            raise AssertionError(\"OrderEvent quantity should hold the current order Quantity. \"\n                            f\"Got {order_event.quantity}, expected {order.quantity}\")\n\n        if order.type == OrderType.COMBO_LEG_LIMIT and order_event.limit_price == 0:\n            raise AssertionError(\"OrderEvent.LIMIT_PRICE is not expected to be 0 for ComboLegLimitOrder\")\n\n    def check_group_orders_for_fills(self, combo1: list[OrderTicket], combo2: list[OrderTicket]) -> bool:\n        if all(x.status == OrderStatus.FILLED for x in combo1):\n            self.log(f\"{combo1[0].order_type}: Canceling combo #2, combo #1 is filled.\")\n            if any(OrderExtensions.is_open(x.status) for x in combo2):\n                for ticket in combo2:\n                    ticket.cancel(\"Combo #1 filled.\")\n            return True\n\n        if all(x.status == OrderStatus.FILLED for x in combo2):\n            self.log(f\"{combo2[0].order_type}: Canceling combo #1, combo #2 is filled.\")\n            if any(OrderExtensions.is_open(x.status) for x in combo1):\n                for ticket in combo1:\n                    ticket.cancel(\"Combo #2 filled.\")\n            return True\n\n        return False\n\n    def on_end_of_algorithm(self) -> None:\n        filled_orders = list(self.transactions.get_orders(lambda x: x.status == OrderStatus.FILLED))\n        order_tickets = list(self.transactions.get_order_tickets())\n        open_orders = self.transactions.get_open_orders()\n        open_order_tickets = list(self.transactions.get_open_order_tickets())\n        remaining_open_orders = self.transactions.get_open_orders_remaining_quantity()\n\n        # 6 market, 6 limit, 6 leg limit.\n        # Out of the 6 limit orders, 3 are expected to be canceled.\n        expected_orders_count = 18\n        expected_fills_count = 15\n        if len(filled_orders) != expected_fills_count or len(order_tickets) != expected_orders_count:\n            raise AssertionError(f\"There were expected {expected_fills_count} filled orders and {expected_orders_count} order tickets, but there were {len(filled_orders)} filled orders and {len(order_tickets)} order tickets\")\n\n        filled_combo_market_orders = [x for x in filled_orders if x.type == OrderType.COMBO_MARKET]\n        filled_combo_limit_orders = [x for x in filled_orders if x.type == OrderType.COMBO_LIMIT]\n        filled_combo_leg_limit_orders = [x for x in filled_orders if x.type == OrderType.COMBO_LEG_LIMIT]\n        if len(filled_combo_market_orders) != 6 or len(filled_combo_limit_orders) != 3 or len(filled_combo_leg_limit_orders) != 6:\n            raise AssertionError(\"There were expected 6 filled market orders, 3 filled combo limit orders and 6 filled combo leg limit orders, \"\n                            f\"but there were {len(filled_combo_market_orders)} filled market orders, {len(filled_combo_limit_orders)} filled \"\n                            f\"combo limit orders and {len(filled_combo_leg_limit_orders)} filled combo leg limit orders\")\n\n        if len(open_orders) != 0 or len(open_order_tickets) != 0:\n            raise AssertionError(\"No open orders or tickets were expected\")\n\n        if remaining_open_orders != 0:\n            raise AssertionError(\"No remaining quantity to be filled from open orders was expected\")\n"
  },
  {
    "path": "Algorithm.Python/ComboOrdersFillModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm that implements a fill model with combo orders\n### <meta name=\"tag\" content=\"trading and orders\" />\n### </summary>\nclass ComboOrdersFillModelAlgorithm(QCAlgorithm):\n    '''Basic template algorithm that implements a fill model with combo orders'''\n\n    def initialize(self) -> None:\n        self.set_start_date(2019, 1, 1)\n        self.set_end_date(2019, 1, 20)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.ibm = self.add_equity(\"IBM\", Resolution.HOUR)\n\n        # Set the fill model\n        self.spy.set_fill_model(CustomPartialFillModel())\n        self.ibm.set_fill_model(CustomPartialFillModel())\n\n        self._order_types = {}\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            legs = [Leg.create(self.spy.symbol, 1), Leg.create(self.ibm.symbol, -1)]\n            self.combo_market_order(legs, 100)\n            self.combo_limit_order(legs, 100, round(self.spy.bid_price))\n\n            legs = [Leg.create(self.spy.symbol, 1, round(self.spy.bid_price) + 1), Leg.create(self.ibm.symbol, -1, round(self.ibm.bid_price) + 1)]\n            self.combo_leg_limit_order(legs, 100)\n\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        if order_event.status == OrderStatus.FILLED:\n            order_type = self.transactions.get_order_by_id(order_event.order_id).type\n            if order_type == OrderType.COMBO_MARKET and order_event.absolute_fill_quantity != 50:\n                raise AssertionError(f\"The absolute quantity filled for all combo market orders should be 50, but for order {order_event.order_id} was {order_event.absolute_fill_quantity}\")\n            elif order_type == OrderType.COMBO_LIMIT and order_event.absolute_fill_quantity != 20:\n                raise AssertionError(f\"The absolute quantity filled for all combo limit orders should be 20, but for order {order_event.order_id} was {order_event.absolute_fill_quantity}\")\n            elif order_type == OrderType.COMBO_LEG_LIMIT and order_event.absolute_fill_quantity != 10:\n                raise AssertionError(f\"The absolute quantity filled for all combo leg limit orders should be 10, but for order {order_event.order_id} was {order_event.absolute_fill_quantity}\")\n\n            self._order_types[order_type] = 1\n\n    def on_end_of_algorithm(self) -> None:\n        if len(self._order_types) != 3:\n            raise AssertionError(f\"Just 3 different types of order were submitted in this algorithm, but the amount of order types was {len(self._order_types)}\")\n\n        if OrderType.COMBO_MARKET not in self._order_types.keys():\n            raise AssertionError(f\"One Combo Market Order should have been submitted but it was not\")\n\n        if OrderType.COMBO_LIMIT not in self._order_types.keys():\n            raise AssertionError(f\"One Combo Limit Order should have been submitted but it was not\")\n\n        if OrderType.COMBO_LEG_LIMIT not in self._order_types.keys():\n            raise AssertionError(f\"One Combo Leg Limit Order should have been submitted but it was not\")\n\n\nclass CustomPartialFillModel(FillModel):\n    '''Implements a custom fill model that inherit from FillModel. Overrides combo_market_fill, combo_limit_fill and combo_leg_limit_fill\n       methods to test FillModelPythonWrapper works as expected'''\n\n    def __init__(self) -> None:\n        self.absolute_remaining_by_order_id = {}\n\n    def fill_orders_partially(self, parameters: FillModelParameters, fills: list[OrderEvent], quantity: int) -> list[OrderEvent]:\n        partial_fills = []\n        if len(fills) == 0:\n            return partial_fills\n\n        for kvp, fill in zip(sorted(parameters.securities_for_orders, key=lambda x: x.key.id), fills):\n            order = kvp.key\n\n            absolute_remaining = self.absolute_remaining_by_order_id.get(order.id, order.absolute_quantity)\n\n            # Set the fill amount\n            fill.fill_quantity = np.sign(order.quantity) * quantity\n\n            if (min(abs(fill.fill_quantity), absolute_remaining) == absolute_remaining):\n                fill.fill_quantity = np.sign(order.quantity) * absolute_remaining\n                fill.status = OrderStatus.FILLED\n                self.absolute_remaining_by_order_id.pop(order.id, None)\n            else:\n                fill.status = OrderStatus.PARTIALLY_FILLED\n                self.absolute_remaining_by_order_id[order.id] = absolute_remaining - abs(fill.fill_quantity)\n                price = fill.fill_price\n                # self.algorithm.debug(f\"{self.algorithm.time} - Partial Fill - Remaining {self.absolute_remaining_by_order_id[order.id]} Price - {price}\")\n\n            partial_fills.append(fill)\n\n        return partial_fills\n\n    def combo_market_fill(self, order: Order, parameters: FillModelParameters) -> list[OrderEvent]:\n        fills = super().combo_market_fill(order, parameters)\n        partial_fills = self.fill_orders_partially(parameters, fills, 50)\n        return partial_fills\n\n    def combo_limit_fill(self, order: Order, parameters: FillModelParameters) -> list[OrderEvent]:\n        fills = super().combo_limit_fill(order, parameters)\n        partial_fills = self.fill_orders_partially(parameters, fills, 20)\n        return partial_fills\n\n    def combo_leg_limit_fill(self, order: Order, parameters: FillModelParameters) -> list[OrderEvent]:\n        fills = super().combo_leg_limit_fill(order, parameters)\n        partial_fills = self.fill_orders_partially(parameters, fills, 10)\n        return partial_fills\n"
  },
  {
    "path": "Algorithm.Python/CompleteOrderTagUpdateAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm asserting that closed orders can be updated with a new tag\n### </summary>\nclass CompleteOrderTagUpdateAlgorithm(QCAlgorithm):\n\n    _tag_after_fill = \"This is the tag set after order was filled.\"\n    _tag_after_canceled = \"This is the tag set after order was canceled.\"\n\n    def initialize(self) -> None:\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        self._market_order_ticket = None\n        self._limit_order_ticket = None\n\n        self._quantity = 100\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            if self._limit_order_ticket is None:\n                # a limit order to test the tag update after order was canceled.\n\n                # low price, we don't want it to fill since we are canceling it\n                self._limit_order_ticket = self.limit_order(self._spy, 100, self.securities[self._spy].price * 0.1)\n                self._limit_order_ticket.cancel()\n            else:\n                # a market order to test the tag update after order was filled.\n                self.buy(self._spy, self._quantity)\n\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        if order_event.status == OrderStatus.CANCELED:\n            if not self._limit_order_ticket or order_event.order_id != self._limit_order_ticket.order_id:\n                raise AssertionError(\"The only canceled order should have been the limit order.\")\n\n            # update canceled order tag\n            self.update_order_tag(self._limit_order_ticket, self._tag_after_canceled, \"Error updating order tag after canceled\")\n        elif order_event.status == OrderStatus.FILLED:\n            self._market_order_ticket = list(self.transactions.get_order_tickets(lambda x: x.order_type == OrderType.MARKET))[0]\n            if not self._market_order_ticket or order_event.order_id != self._market_order_ticket.order_id:\n                raise AssertionError(\"The only filled order should have been the market order.\")\n\n            # update filled order tag\n            self.update_order_tag(self._market_order_ticket, self._tag_after_fill, \"Error updating order tag after fill\")\n\n    def on_end_of_algorithm(self) -> None:\n        # check the filled order\n        self.assert_order_tag_update(self._market_order_ticket, self._tag_after_fill, \"filled\")\n        if self._market_order_ticket.quantity != self._quantity or self._market_order_ticket.quantity_filled != self._quantity:\n            raise AssertionError(\"The market order quantity should not have been updated.\")\n\n        # check the canceled order\n        self.assert_order_tag_update(self._limit_order_ticket, self._tag_after_canceled, \"canceled\")\n\n    def assert_order_tag_update(self, ticket: OrderTicket, expected_tag: str, order_action: str) -> None:\n        if ticket is None:\n            raise AssertionError(f\"The order ticket was not set for the {order_action} order\")\n\n        if ticket.tag != expected_tag:\n            raise AssertionError(f\"Order ticket tag was not updated after order was {order_action}\")\n\n        order = self.transactions.get_order_by_id(ticket.order_id)\n        if order.tag != expected_tag:\n            raise AssertionError(f\"Order tag was not updated after order was {order_action}\")\n\n    def update_order_tag(self, ticket: OrderTicket, tag: str, error_message_prefix: str) -> None:\n        update_fields = UpdateOrderFields()\n        update_fields.tag = tag\n        response = ticket.update(update_fields)\n\n        if response.is_error:\n            raise AssertionError(f\"{error_message_prefix}: {response.error_message}\")\n"
  },
  {
    "path": "Algorithm.Python/CompositeAlphaModelFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Alphas.RsiAlphaModel import RsiAlphaModel\nfrom Alphas.EmaCrossAlphaModel import EmaCrossAlphaModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\n\n### <summary>\n### Show cases how to use the CompositeAlphaModel to define.\n### </summary>\nclass CompositeAlphaModelFrameworkAlgorithm(QCAlgorithm):\n    '''Show cases how to use the CompositeAlphaModel to define.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # even though we're using a framework algorithm, we can still add our securities\n        # using the AddEquity/Forex/Crypto/ect methods and then pass them into a manual\n        # universe selection model using securities.keys()\n        self.add_equity(\"SPY\")\n        self.add_equity(\"IBM\")\n        self.add_equity(\"BAC\")\n        self.add_equity(\"AIG\")\n\n        # define a manual universe of all the securities we manually registered\n        self.set_universe_selection(ManualUniverseSelectionModel())\n\n        # define alpha model as a composite of the rsi and ema cross models\n        self.set_alpha(CompositeAlphaModel(RsiAlphaModel(), EmaCrossAlphaModel()))\n\n        # default models for the rest\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n"
  },
  {
    "path": "Algorithm.Python/CompositeIndicatorWorksAsExpectedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm tests the functionality of the CompositeIndicator\n### using either a lambda expression or a method reference.\n### </summary>\nclass CompositeIndicatorWorksAsExpectedRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 4)\n        self.set_end_date(2013, 10, 5)\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        close  = self.identity(\"SPY\", Resolution.MINUTE, Field.CLOSE)\n        low = self.min(\"SPY\", 420, Resolution.MINUTE, Field.LOW)\n        self.composite_min_direct = CompositeIndicator(\"CompositeMinDirect\", close, low, lambda l, r: IndicatorResult(min(l.current.value, r.current.value)))\n        self.composite_min_method = CompositeIndicator(\"CompositeMinMethod\", close, low, self.composer)\n\n        self.data_received = False\n\n    def composer(self, l, r):\n        return IndicatorResult(min(l.current.value, r.current.value))\n\n    def on_data(self, data):\n        self.data_received = True\n        if self.composite_min_direct.current.value != self.composite_min_method.current.value:\n            raise AssertionError(f\"Values of indicators differ: {self.composite_min_direct.current.value} | {self.composite_min_method.current.value}\")\n        \n    def on_end_of_algorithm(self):\n        if not self.data_received:\n            raise AssertionError(\"No data was processed during the algorithm execution.\")\n"
  },
  {
    "path": "Algorithm.Python/CompositeRiskManagementModelFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Show cases how to use the CompositeRiskManagementModel.\n### </summary>\nclass CompositeRiskManagementModelFrameworkAlgorithm(QCAlgorithm):\n    '''Show cases how to use the CompositeRiskManagementModel.'''\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel([Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)]))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        # define risk management model as a composite of several risk management models\n        self.set_risk_management(CompositeRiskManagementModel(\n            MaximumUnrealizedProfitPercentPerSecurity(0.01),\n            MaximumDrawdownPercentPerSecurity(0.01)\n        ))\n"
  },
  {
    "path": "Algorithm.Python/ConfidenceWeightedFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using 'ConfidenceWeightedPortfolioConstructionModel' and 'ConstantAlphaModel'\n### generating a constant 'Insight' with a 0.25 confidence\n### </summary>\nclass ConfidenceWeightedFrameworkAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, 0.25))\n        self.set_portfolio_construction(ConfidenceWeightedPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n    def on_end_of_algorithm(self):\n        # holdings value should be 0.25 - to avoid price fluctuation issue we compare with 0.28 and 0.23\n        if (self.portfolio.total_holdings_value > self.portfolio.total_portfolio_value * 0.28\n            or self.portfolio.total_holdings_value < self.portfolio.total_portfolio_value * 0.23):\n            raise ValueError(\"Unexpected Total Holdings Value: \" + str(self.portfolio.total_holdings_value))\n"
  },
  {
    "path": "Algorithm.Python/ConsolidateDifferentTickTypesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm asserts we can consolidate Tick data with different tick types\n### </summary>\nclass ConsolidateDifferentTickTypesRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2013, 10, 7)\n        self.set_cash(1000000)\n\n        equity = self.add_equity(\"SPY\", Resolution.TICK, Market.USA)\n        quote_consolidator = self.consolidate(equity.symbol, Resolution.TICK, TickType.QUOTE, lambda tick : self.on_quote_tick(tick))\n        self.there_is_at_least_one_quote_tick = False\n\n        trade_consolidator = self.consolidate(equity.symbol, Resolution.TICK, TickType.TRADE, lambda tick : self.on_trade_tick(tick))\n        self.there_is_at_least_one_trade_tick = False\n\n        # Tick consolidators with max count\n        self.consolidate(TradeBar, equity.symbol, 10, TickType.TRADE, lambda trade_bar: self.on_trade_tick_max_count(trade_bar))\n        self._there_is_at_least_one_trade_bar = False\n\n        self.consolidate(QuoteBar, equity.symbol, 10, TickType.QUOTE, lambda quote_bar: self.on_quote_tick_max_count(quote_bar))\n        self._there_is_at_least_one_quote_bar = False\n\n        self._consolidation_count = 0\n\n    def on_trade_tick_max_count(self, trade_bar):\n        self._there_is_at_least_one_trade_bar = True\n        if type(trade_bar) != TradeBar:\n            raise AssertionError(f\"The type of the bar should be Trade, but was {type(trade_bar)}\")\n\n    def on_quote_tick_max_count(self, quote_bar):\n        self._there_is_at_least_one_quote_bar = True\n        if type(quote_bar) != QuoteBar:\n            raise AssertionError(f\"The type of the bar should be Quote, but was {type(quote_bar)}\")\n\n        self._consolidation_count += 1\n        # Let's shortcut to reduce regression test duration: algorithms using tick data are too long\n        if self._consolidation_count >= 1000:\n            self.quit()\n\n    def on_quote_tick(self, tick):\n        self.there_is_at_least_one_quote_tick = True\n        if tick.tick_type != TickType.QUOTE:\n            raise AssertionError(f\"The type of the tick should be Quote, but was {tick.tick_type}\")\n\n    def on_trade_tick(self, tick):\n        self.there_is_at_least_one_trade_tick = True\n        if tick.tick_type != TickType.TRADE:\n            raise AssertionError(f\"The type of the tick should be Trade, but was {tick.tick_type}\")\n\n    def on_end_of_algorithm(self):\n        if not self.there_is_at_least_one_quote_tick:\n            raise AssertionError(f\"There should have been at least one tick in OnQuoteTick() method, but there wasn't\")\n\n        if not self.there_is_at_least_one_trade_tick:\n            raise AssertionError(f\"There should have been at least one tick in OnTradeTick() method, but there wasn't\")\n\n        if not self._there_is_at_least_one_trade_bar:\n            raise AssertionError(\"There should have been at least one bar in OnTradeTickMaxCount() method, but there wasn't\")\n\n        if not self._there_is_at_least_one_quote_bar:\n            raise AssertionError(\"There should have been at least one bar in OnQuoteTickMaxCount() method, but there wasn't\")\n\n"
  },
  {
    "path": "Algorithm.Python/ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm asserts the consolidated US equity daily bars from the hour bars exactly matches\n### the daily bars returned from the database\n### </summary>\nclass ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 5, 1)\n        self.set_end_date(2020, 6, 5)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.HOUR).symbol\n\n        # We will use these two indicators to compare the daily consolidated bars equals\n        # the ones returned from the database. We use this specific type of indicator as\n        # it depends on its previous values. Thus, if at some point the bars received by\n        # the indicators differ, so will their final values\n        self._rsi = RelativeStrengthIndex(\"First\", 15, MovingAverageType.WILDERS)\n        self.register_indicator(self.spy, self._rsi, Resolution.DAILY, selector= lambda bar: (bar.close + bar.open) / 2)\n\n        # We won't register this indicator as we will update it manually at the end of the\n        # month, so that we can compare the values of the indicator that received consolidated\n        # bars and the values of this one\n        self._rsi_timedelta = RelativeStrengthIndex(\"Second\", 15, MovingAverageType.WILDERS)\n        self._values = {}\n        self.count = 0\n        self._indicators_compared = False\n\n    def on_data(self, data: Slice):\n        if self.is_warming_up:\n            return\n\n        if data.contains_key(self.spy) and data[self.spy] != None:\n            if self.time.month == self.end_date.month:\n                history = self.history[TradeBar](self.spy, self.count, Resolution.DAILY)\n                for bar in history:\n                    time = bar.end_time.strftime('%Y-%m-%d')\n                    average = (bar.close + bar.open) / 2\n                    self._rsi_timedelta.update(bar.end_time, average)\n                    if self._rsi_timedelta.current.value != self._values[time]:\n                        raise AssertionError(f\"Both {self._rsi.name} and {self._rsi_timedelta.name} should have the same values, but they differ. {self._rsi.name}: {self._values[time]} | {self._rsi_timedelta.name}: {self._rsi_timedelta.current.value}\")\n                self._indicators_compared = True\n                self.quit()\n            else:\n                time = self.time.strftime('%Y-%m-%d')\n                self._values[time] = self._rsi.current.value\n\n                # Since the symbol resolution is hour and the symbol is equity, we know the last bar received in a day will\n                # be at the market close, this is 16h. We need to count how many daily bars were consolidated in order to know\n                # how many we need to request from the history\n                if self.time.hour == 16:\n                    self.count += 1\n\n    def on_end_of_algorithm(self):\n        if not self._indicators_compared:\n            raise AssertionError(f\"Indicators {self._rsi.name} and {self._rsi_timedelta.name} should have been compared, but they were not. Please make sure the indicators are getting SPY data\")\n"
  },
  {
    "path": "Algorithm.Python/ConsolidateRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomDataRegressionAlgorithm import Bitcoin\n\n### <summary>\n### Regression algorithm reproducing data type bugs in the Consolidate API. Related to GH 4205.\n### </summary>\nclass ConsolidateRegressionAlgorithm(QCAlgorithm):\n\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 1, 20)\n\n        SP500 = Symbol.create(Futures.Indices.SP_500_E_MINI, SecurityType.FUTURE, Market.CME)\n        symbol = list(sorted(self.futures_chain(SP500).contracts.keys(), key=lambda symbol: symbol.id.date))[0]\n        self._future = self.add_future_contract(symbol)\n\n        tradable_dates_count = len(list(Time.each_tradeable_day_in_time_zone(self._future.exchange.hours,\n                                                                             self.start_date,\n                                                                             self.end_date,\n                                                                             self._future.exchange.time_zone,\n                                                                             False)))\n        self._expected_consolidation_counts = []\n\n        self.consolidate(symbol, Calendar.MONTHLY, lambda bar: self.update_monthly_consolidator(bar)) # shouldn't consolidate\n\n        self.consolidate(symbol, Calendar.WEEKLY, TickType.TRADE, lambda bar: self.update_weekly_consolidator(bar))\n\n        self.consolidate(symbol, Resolution.DAILY, lambda bar: self.update_trade_bar(bar, 0))\n        self._expected_consolidation_counts.append(tradable_dates_count)\n\n        self.consolidate(symbol, Resolution.DAILY, TickType.QUOTE, lambda bar: self.update_quote_bar(bar, 1))\n        self._expected_consolidation_counts.append(tradable_dates_count)\n\n        self.consolidate(symbol, timedelta(1), lambda bar: self.update_trade_bar(bar, 2))\n        self._expected_consolidation_counts.append(tradable_dates_count - 1)\n\n        self.consolidate(symbol, timedelta(1), TickType.QUOTE, lambda bar: self.update_quote_bar(bar, 3))\n        self._expected_consolidation_counts.append(tradable_dates_count - 1)\n\n        # sending None tick type\n        self.consolidate(symbol, timedelta(1), None, lambda bar: self.update_trade_bar(bar, 4))\n        self._expected_consolidation_counts.append(tradable_dates_count - 1)\n\n        self.consolidate(symbol, Resolution.DAILY, None, lambda bar: self.update_trade_bar(bar, 5))\n        self._expected_consolidation_counts.append(tradable_dates_count)\n\n        self._consolidation_counts = [0] * len(self._expected_consolidation_counts)\n        self._smas = [SimpleMovingAverage(10) for x in self._consolidation_counts]\n        self._last_sma_updates = [datetime.min for x in self._consolidation_counts]\n        self._monthly_consolidator_sma = SimpleMovingAverage(10)\n        self._monthly_consolidation_count = 0\n        self._weekly_consolidator_sma = SimpleMovingAverage(10)\n        self._weekly_consolidation_count = 0\n        self._last_weekly_sma_update = datetime.min\n\n        # custom data\n        self._custom_data_consolidator = 0\n        custom_symbol = self.add_data(Bitcoin, \"BTC\", Resolution.MINUTE).symbol\n        self.consolidate(custom_symbol, timedelta(1), lambda bar: self.increment_counter(1))\n\n    def increment_counter(self, id):\n        if id == 1:\n            self._custom_data_consolidator += 1\n\n    def update_trade_bar(self, bar, position):\n        self._smas[position].update(bar.end_time, bar.volume)\n        self._last_sma_updates[position] = bar.end_time\n        self._consolidation_counts[position] += 1\n\n    def update_quote_bar(self, bar, position):\n        self._smas[position].update(bar.end_time, bar.ask.high)\n        self._last_sma_updates[position] = bar.end_time\n        self._consolidation_counts[position] += 1\n\n    def update_monthly_consolidator(self, bar):\n        self._monthly_consolidator_sma.update(bar.end_time, bar.volume)\n        self._monthly_consolidation_count += 1\n\n    def update_weekly_consolidator(self, bar):\n        self._weekly_consolidator_sma.update(bar.end_time, bar.volume)\n        self._last_weekly_sma_update = bar.end_time\n        self._weekly_consolidation_count += 1\n\n    def on_end_of_algorithm(self):\n        for i, expected_consolidation_count in enumerate(self._expected_consolidation_counts):\n            consolidation_count = self._consolidation_counts[i]\n            if consolidation_count != expected_consolidation_count:\n                raise ValueError(f\"Unexpected consolidation count for index {i}: expected {expected_consolidation_count} but was {consolidation_count}\")\n\n        expected_weekly_consolidations = (self.end_date - self.start_date).days // 7\n        if self._weekly_consolidation_count != expected_weekly_consolidations:\n            raise ValueError(f\"Expected {expected_weekly_consolidations} weekly consolidations but found {self._weekly_consolidation_count}\")\n\n        if self._custom_data_consolidator == 0:\n            raise ValueError(\"Custom data consolidator did not consolidate any data\")\n\n        for i, sma in enumerate(self._smas):\n            if sma.samples != self._expected_consolidation_counts[i]:\n                raise AssertionError(f\"Expected {self._expected_consolidation_counts[i]} samples in each SMA but found {sma.samples} in SMA in index {i}\")\n\n            last_update = self._last_sma_updates[i]\n            if sma.current.time != last_update:\n                raise AssertionError(f\"Expected SMA in index {i} to have been last updated at {last_update} but was {sma.current.time}\")\n\n        if self._monthly_consolidation_count != 0 or self._monthly_consolidator_sma.samples != 0:\n            raise AssertionError(\"Expected monthly consolidator to not have consolidated any data\")\n\n        if self._weekly_consolidator_sma.samples != expected_weekly_consolidations:\n            raise AssertionError(f\"Expected {expected_weekly_consolidations} samples in the weekly consolidator SMA but found {self._weekly_consolidator_sma.samples}\")\n\n        if self._weekly_consolidator_sma.current.time != self._last_weekly_sma_update:\n            raise AssertionError(f\"Expected weekly consolidator SMA to have been last updated at {self._last_weekly_sma_update} but was {self._weekly_consolidator_sma.current.time}\")\n\n    # on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    def on_data(self, data):\n        if not self.portfolio.invested and self._future.has_data:\n           self.set_holdings(self._future.symbol, 0.5)\n"
  },
  {
    "path": "Algorithm.Python/ConsolidateWithSizeAttributeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests various overloads of the Consolidate method\n### using RenkoBar, VolumeRenkoBar, and RangeBar types,\n### as well as common bars like TradeBar and QuoteBar with a maxCount parameter.\n### It ensures each overload behaves as expected and that the appropriate consolidator instances are correctly created and triggered.\n### </summary>\nclass ConsolidateWithSizeAttributeRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n        self.set_cash(100000)\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.sma_indicators = [\n            SimpleMovingAverage(\"RenkoBarSMA\", 10),\n            SimpleMovingAverage(\"VolumeRenkoBarSMA\", 10),\n            SimpleMovingAverage(\"RangeBarSMA\", 10),\n            SimpleMovingAverage(\"TradeBarSMA\", 10),\n            SimpleMovingAverage(\"QuoteBarSMA\", 10),\n            SimpleMovingAverage(\"BaseDataSMA\", 10)\n        ]\n        self.consolidators = [\n            self.consolidate(RenkoBar, \"SPY\", 0.1, None, lambda bar: self.update_with_renko_bar(bar, 0)),\n            self.consolidate(VolumeRenkoBar, \"SPY\", 10000, None, lambda bar: self.update_with_volume_renko_bar(bar, 1)),\n            self.consolidate(RangeBar, \"SPY\", 12, None, lambda bar: self.update_with_range_bar(bar, 2)),\n            \n            # Trade and Quote consolidators with max count\n            self.consolidate(TradeBar, \"SPY\", 10, None, lambda bar: self.update_with_trade_bar(bar, 3)),\n            self.consolidate(QuoteBar, \"SPY\", 10, None, lambda bar: self.update_with_quote_bar(bar, 4)),\n            self.consolidate(BaseData, \"SPY\", 10, None, lambda bar: self.update_with_base_data(bar, 5))\n        ]\n    \n    def update_with_base_data(self, base_data, position):\n        self.sma_indicators[position].update(base_data.end_time, base_data.value)\n        if type(base_data) != TradeBar:\n            raise AssertionError(f\"The type of the bar should be Trade, but was {type(base_data)}\")\n    \n    def update_with_trade_bar(self, trade_bar, position):\n        self.sma_indicators[position].update(trade_bar.end_time, trade_bar.high)\n        if type(trade_bar) != TradeBar:\n            raise AssertionError(f\"The type of the bar should be Trade, but was {type(trade_bar)}\")\n\n    def update_with_quote_bar(self, quote_bar, position):\n        self.sma_indicators[position].update(quote_bar.end_time, quote_bar.high)\n        if type(quote_bar) != QuoteBar:\n            raise AssertionError(f\"The type of the bar should be Quote, but was {type(quote_bar)}\")\n\n    def update_with_renko_bar(self, renko_bar, position):\n        self.sma_indicators[position].update(renko_bar.end_time, renko_bar.high)\n        if type(renko_bar) != RenkoBar:\n            raise AssertionError(f\"The type of the bar should be Renko, but was {type(renko_bar)}\")\n\n    def update_with_volume_renko_bar(self, volume_renko_bar, position):\n        self.sma_indicators[position].update(volume_renko_bar.end_time, volume_renko_bar.high)\n        if type(volume_renko_bar) != VolumeRenkoBar:\n            raise AssertionError(f\"The type of the bar should be VolumeRenko, but was {type(volume_renko_bar)}\")\n\n    def update_with_range_bar(self, range_bar, position):\n        self.sma_indicators[position].update(range_bar.end_time, range_bar.high)\n        if type(range_bar) != RangeBar:\n            raise AssertionError(f\"The type of the bar should be Range, but was {type(range_bar)}\")\n\n    def on_end_of_algorithm(self):\n        # Verifies that each SMA was updated and is ready, confirming the Consolidate overloads functioned correctly.\n        for sma in self.sma_indicators:\n            if (sma.samples == 0):\n                raise AssertionError(f'The indicator {sma.name} did not receive any updates. This indicates the associated consolidator was not triggered.')\n            if (not sma.is_ready):\n                raise AssertionError(f'The indicator {sma.name} is not ready. It received only {sma.samples} samples, but requires at least {sma.period} to be ready.')\n        \n        expected_consolidator_types = [\n            RenkoConsolidator,\n            VolumeRenkoConsolidator,\n            RangeConsolidator,\n            TradeBarConsolidator,\n            QuoteBarConsolidator,\n            BaseDataConsolidator\n        ]\n\n        for i in range(len(self.consolidators)):\n            consolidator = self.consolidators[i]\n            if type(consolidator) != expected_consolidator_types[i]:\n                raise AssertionError(f\"Expected consolidator type {expected_consolidator_types[i]} but received {type(consolidator)}\")\n"
  },
  {
    "path": "Algorithm.Python/ConsolidatorStartTimeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom collections import deque\n\n### <summary>\n### Regression algorithm show casing and asserting the behavior of creating a consolidator specifying the start time\n### </summary>\nclass ConsolidatorStartTimeRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 4)\n        self.set_end_date(2013, 10, 4)\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        consolidator = TradeBarConsolidator(timedelta(hours=1), start_time=timedelta(hours=9, minutes=30))\n        consolidator.data_consolidated += self.bar_handler\n        self.subscription_manager.add_consolidator(\"SPY\", consolidator)\n\n        self._expectedConsolidationTime = deque()\n        self._expectedConsolidationTime.append(time(14, 30))\n        self._expectedConsolidationTime.append(time(13, 30))\n        self._expectedConsolidationTime.append(time(12, 30))\n        self._expectedConsolidationTime.append(time(11, 30))\n        self._expectedConsolidationTime.append(time(10, 30))\n        self._expectedConsolidationTime.append(time(9, 30))\n\n    def bar_handler(self, _, bar):\n        if self.time != bar.end_time:\n            raise RegressionTestException(f\"Unexpected consolidation time {bar.Time} != {Time}!\")\n\n        self.debug(f\"{self.time} - Consolidation\")\n        expected = self._expectedConsolidationTime.pop()\n        if bar.time.time() != expected:\n            raise RegressionTestException(f\"Unexpected consolidation time {bar.time.time()} != {expected}!\")\n\n        if bar.period != timedelta(hours=1):\n            raise RegressionTestException(f\"Unexpected consolidation period {bar.period}!\")\n\n    def on_end_of_algorithm(self):\n        if len(self._expectedConsolidationTime) > 0:\n            raise RegressionTestException(\"Unexpected consolidation times!\")\n"
  },
  {
    "path": "Algorithm.Python/ConstituentsQC500GeneratorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to estimate constituents of QC500 index based on the company fundamentals\n### The algorithm creates a default tradable and liquid universe containing 500 US equities\n### which are chosen at the first trading day of each month.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"fine universes\" />\nclass ConstituentsQC500GeneratorAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2018, 1, 1)   # Set Start Date\n        self.set_end_date(2019, 1, 1)     # Set End Date\n        self.set_cash(100000)            # Set Strategy Cash\n\n        # Add QC500 Universe\n        self.add_universe(self.universe.qc_500)\n"
  },
  {
    "path": "Algorithm.Python/ConstituentsUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Test algorithm using a 'ConstituentsUniverse' with test data\n### </summary>\nclass ConstituentsUniverseRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)  #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n\n        self._appl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n        self._spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        self._qqq = Symbol.create(\"QQQ\", SecurityType.EQUITY, Market.USA)\n        self._fb = Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA)\n        self._step = 0\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        custom_universe_symbol = Symbol(SecurityIdentifier.generate_constituent_identifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.EQUITY,\n                    Market.USA),\n                \"constituents-universe-qctest\")\n\n        self.add_universe(ConstituentsUniverse(custom_universe_symbol, self.universe_settings))\n\n    def on_data(self, data):\n        self._step = self._step + 1\n        if self._step == 1:\n            if not data.contains_key(self._qqq) or not data.contains_key(self._appl):\n                raise ValueError(\"Unexpected symbols found, step: \" + str(self._step))\n            if data.count != 2:\n                raise ValueError(\"Unexpected data count, step: \" + str(self._step))\n            # AAPL will be deselected by the ConstituentsUniverse\n            # but it shouldn't be removed since we hold it\n            self.set_holdings(self._appl, 0.5)\n        elif self._step == 2:\n            if not data.contains_key(self._appl):\n                raise ValueError(\"Unexpected symbols found, step: \" + str(self._step))\n            if data.count != 1:\n                raise ValueError(\"Unexpected data count, step: \" + str(self._step))\n            # AAPL should now be released\n            # note: takes one extra loop because the order is executed on market open\n            self.liquidate()\n        elif self._step == 3:\n            if not data.contains_key(self._fb) or not data.contains_key(self._spy) or not data.contains_key(self._appl):\n                raise ValueError(\"Unexpected symbols found, step: \" + str(self._step))\n            if data.count != 3:\n                raise ValueError(\"Unexpected data count, step: \" + str(self._step))\n        elif self._step == 4:\n            if not data.contains_key(self._fb) or not data.contains_key(self._spy):\n                raise ValueError(\"Unexpected symbols found, step: \" + str(self._step))\n            if data.count != 2:\n                raise ValueError(\"Unexpected data count, step: \" + str(self._step))\n\n    def on_end_of_algorithm(self):\n        # First selection is on the midnight of the 8th, start getting data from the 8th to the 11th\n        if self._step != 4:\n            raise ValueError(\"Unexpected step count: \" + str(self._step))\n\n    def  OnSecuritiesChanged(self, changes):\n        for added in changes.added_securities:\n            self.log(f\"{self.time} AddedSecurities \" + str(added))\n\n        for removed in changes.removed_securities:\n            self.log(f\"{self.time} RemovedSecurities \" + str(removed) + str(self._step))\n            # we are currently notifying the removal of AAPl twice,\n            # when deselected and when finally removed (since it stayed pending)\n            if removed.symbol == self._appl and self._step != 1 and self._step != 2 or removed.symbol == self._qqq and self._step != 1:\n                raise ValueError(\"Unexpected removal step count: \" + str(self._step))\n"
  },
  {
    "path": "Algorithm.Python/ContinuousFutureModelsConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionModelsConsistencyRegressionAlgorithm import OptionModelsConsistencyRegressionAlgorithm\n\n### <summary>\n### Regression algorithm asserting that when setting custom models for canonical future, a one-time warning is sent\n### informing the user that the contracts models are different (not the custom ones).\n### </summary>\nclass ContinuousFutureModelsConsistencyRegressionAlgorithm(OptionModelsConsistencyRegressionAlgorithm):\n\n    def initialize_algorithm(self) -> Security:\n        self.set_start_date(2013, 7, 1)\n        self.set_end_date(2014, 1, 1)\n\n        continuous_contract = self.add_future(Futures.Indices.SP_500_E_MINI,\n                                             data_normalization_mode=DataNormalizationMode.BACKWARDS_PANAMA_CANAL,\n                                             data_mapping_mode=DataMappingMode.OPEN_INTEREST,\n                                             contract_depth_offset=1)\n\n        return continuous_contract\n"
  },
  {
    "path": "Algorithm.Python/ContinuousFutureRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Continuous Futures Regression algorithm. Asserting and showcasing the behavior of adding a continuous future\n### </summary>\nclass ContinuousFutureRegressionAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 7, 1)\n        self.set_end_date(2014, 1, 1)\n\n        self._previous_mapped_contract_symbols = []\n        self._last_date_log = -1\n        self._continuous_contract = self.add_future(Futures.Indices.SP_500_E_MINI,\n                                                  data_normalization_mode = DataNormalizationMode.BACKWARDS_RATIO,\n                                                  data_mapping_mode = DataMappingMode.LAST_TRADING_DAY,\n                                                  contract_depth_offset= 0)\n        self._current_mapped_symbol = self._continuous_contract.symbol\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        currently_mapped_security = self.securities[self._continuous_contract.mapped]\n        if len(data.keys()) != 1:\n            raise ValueError(f\"We are getting data for more than one symbols! {','.join(data.keys())}\")\n\n        for changed_event in data.symbol_changed_events.values():\n            if changed_event.symbol == self._continuous_contract.symbol:\n                self._previous_mapped_contract_symbols.append(self.symbol(changed_event.old_symbol))\n                self.log(f\"SymbolChanged event: {changed_event}\")\n\n                if self._current_mapped_symbol == self._continuous_contract.mapped:\n                    raise ValueError(f\"Continuous contract current symbol did not change! {self._continuous_contract.mapped}\")\n\n        if self._last_date_log != self.time.month and currently_mapped_security.has_data:\n            self._last_date_log = self.time.month\n\n            self.log(f\"{self.time}- {currently_mapped_security.get_last_data()}\")\n            if self.portfolio.invested:\n                self.liquidate()\n            else:\n                # This works because we set this contract as tradable, even if it's a canonical security\n                self.buy(currently_mapped_security.symbol, 1)\n\n            if self.time.month == 1 and self.time.year == 2013:\n                response = self.history( [ self._continuous_contract.symbol ], 60 * 24 * 90)\n                if response.empty:\n                    raise ValueError(\"Unexpected empty history response\")\n\n        self._current_mapped_symbol = self._continuous_contract.mapped\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n\n    def on_securities_changed(self, changes):\n        self.debug(f\"{self.time}-{changes}\")\n\n    def on_end_of_algorithm(self):\n        expected_mapping_counts = 2\n        if len(self._previous_mapped_contract_symbols) != expected_mapping_counts:\n            raise ValueError(f\"Unexpected symbol changed events: {len(self._previous_mapped_contract_symbols)}, was expecting {expected_mapping_counts}\")\n\n        delisted_securities = [\n            [security for security in self.securities.total if security.symbol == symbol][0]\n            for symbol in self._previous_mapped_contract_symbols\n        ]\n        marked_delisted_securities = [security for security in delisted_securities if security.is_delisted and not security.is_tradable]\n        if len(marked_delisted_securities) != len(delisted_securities):\n            raise ValueError(f\"Not all delisted contracts are properly marked as delisted and non-tradable: \"\n                             f\"only {len(marked_delisted_securities)} are marked, was expecting {len(delisted_securities)}\")\n"
  },
  {
    "path": "Algorithm.Python/ConvertToFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration algorithm showing how to easily convert an old algorithm into the framework.\n###\n###  1. When making orders, also create insights for the correct direction (up/down/flat), can also set insight prediction period/magnitude/direction\n###  2. Emit insights before placing any trades\n###  3. Profit :)\n###  </summary>\n###  <meta name=\"tag\" content=\"indicators\" />\n###  <meta name=\"tag\" content=\"indicator classes\" />\n###  <meta name=\"tag\" content=\"plotting indicators\" />\nclass ConvertToFrameworkAlgorithm(QCAlgorithm):\n    '''Demonstration algorithm showing how to easily convert an old algorithm into the framework.'''\n\n    fast_ema_period = 12\n    slow_ema_period = 26\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2004, 1, 1)\n        self.set_end_date(2015, 1, 1)\n\n        self._symbol = self.add_security(SecurityType.EQUITY, 'SPY', Resolution.DAILY).symbol\n\n        # define our daily macd(12,26) with a 9 day signal\n        self._macd = self.macd(self._symbol, self.fast_ema_period, self.slow_ema_period, 9, MovingAverageType.EXPONENTIAL, Resolution.DAILY)\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        Args:\n            data: Slice object with your stock data'''\n        # wait for our indicator to be ready\n        if not self._macd.is_ready or not data.contains_key(self._symbol) or data[self._symbol] is None: return\n\n        holding = self.portfolio[self._symbol]\n\n        signal_delta_percent = float(self._macd.current.value - self._macd.signal.current.value) / float(self._macd.fast.current.value)\n        tolerance = 0.0025\n\n        # if our macd is greater than our signal, then let's go long\n        if holding.quantity <= 0 and signal_delta_percent > tolerance:\n            # 1. Call emit_insights with insights created in correct direction, here we're going long\n            #    The emit_insights method can accept multiple insights separated by commas\n            self.emit_insights(\n                # Creates an insight for our symbol, predicting that it will move up within the fast ema period number of days\n                Insight.price(self._symbol, timedelta(self.fast_ema_period), InsightDirection.UP)\n            )\n\n            # longterm says buy as well\n            self.set_holdings(self._symbol, 1)\n\n        # if our macd is less than our signal, then let's go short\n        elif holding.quantity >= 0 and signal_delta_percent < -tolerance:\n            # 1. Call emit_insights with insights created in correct direction, here we're going short\n            #    The emit_insights method can accept multiple insights separated by commas\n            self.emit_insights(\n                # Creates an insight for our symbol, predicting that it will move down within the fast ema period number of days\n                Insight.price(self._symbol, timedelta(self.fast_ema_period), InsightDirection.DOWN)\n            )\n\n            self.set_holdings(self._symbol, -1)\n\n        # if we wanted to liquidate our positions\n        ## 1. Call emit_insights with insights create in the correct direction -- Flat\n\n        #self.emit_insights(\n            # Creates an insight for our symbol, predicting that it will move down or up within the fast ema period number of days, depending on our current position\n            # Insight.price(self._symbol, timedelta(self.fast_ema_period), InsightDirection.FLAT)\n        #)\n\n        # self.liquidate()\n\n        # plot both lines\n        self.plot(\"MACD\", self._macd, self._macd.signal)\n        self.plot(self._symbol.value, self._macd.fast, self._macd.slow)\n        self.plot(self._symbol.value, \"Open\", data[self._symbol].open)\n"
  },
  {
    "path": "Algorithm.Python/CorrectConsolidatedBarTypeForTickTypesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm asserting that consolidated bars are of type `QuoteBar` when `QCAlgorithm.consolidate()` is called with `tick_type=TickType.QUOTE`\n### </summary>\nclass CorrectConsolidatedBarTypeForTickTypesAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n\n        symbol = self.add_equity(\"SPY\", Resolution.TICK).symbol\n\n        self.consolidate(symbol, timedelta(minutes=1), TickType.QUOTE, self.quote_tick_consolidation_handler)\n        self.consolidate(symbol, timedelta(minutes=1), TickType.TRADE, self.trade_tick_consolidation_handler)\n\n        self.quote_tick_consolidation_handler_called = False\n        self.trade_tick_consolidation_handler_called = False\n\n    def on_data(self, slice: Slice) -> None:\n        if self.time.hour > 9:\n            self.quit(\"Early quit to save time\")\n\n    def on_end_of_algorithm(self):\n        if not self.quote_tick_consolidation_handler_called:\n            raise AssertionError(\"quote_tick_consolidation_handler was not called\")\n\n        if not self.trade_tick_consolidation_handler_called:\n            raise AssertionError(\"trade_tick_consolidation_handler was not called\")\n\n    def quote_tick_consolidation_handler(self, consolidated_bar: QuoteBar) -> None:\n        if type(consolidated_bar) != QuoteBar:\n            raise AssertionError(f\"Expected the consolidated bar to be of type {QuoteBar} but was {type(consolidated_bar)}\")\n\n        self.quote_tick_consolidation_handler_called = True\n\n    def trade_tick_consolidation_handler(self, consolidated_bar: TradeBar) -> None:\n        if type(consolidated_bar) != TradeBar:\n            raise AssertionError(f\"Expected the consolidated bar to be of type {TradeBar} but was {type(consolidated_bar)}\")\n\n        self.trade_tick_consolidation_handler_called = True\n"
  },
  {
    "path": "Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Covered and Protective Call strategies.\n### </summary>\nclass CoveredAndProtectiveCallStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                           key = lambda x: x.expiry, reverse=True)\n\n        if len(contracts) == 0: return\n        contract = contracts[0]\n        if contract != None:\n            self._covered_call = OptionStrategies.covered_call(option_symbol, contract.strike, contract.expiry)\n            self._protective_call = OptionStrategies.protective_call(option_symbol, contract.strike, contract.expiry)\n            self.buy(self._covered_call, 2)\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        option_position = [position for position in positions if position.symbol.security_type == SecurityType.OPTION][0]\n        if option_position.symbol.id.option_right != OptionRight.CALL:\n            raise AssertionError(f\"Expected option position to be a call. Actual: {option_position.symbol.id.option_right}\")\n\n        underlying_position = [position for position in positions if position.symbol.security_type == SecurityType.EQUITY][0]\n        expected_option_position_quantity = -2\n        expected_underlying_position_quantity = 2 * self.securities[option_symbol].symbol_properties.contract_multiplier\n\n        if option_position.quantity != expected_option_position_quantity:\n            raise AssertionError(f\"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}\")\n\n        if underlying_position.quantity != expected_underlying_position_quantity:\n            raise AssertionError(f\"Expected underlying position quantity to be {expected_underlying_position_quantity}. Actual: {underlying_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We should be able to close the position using the inverse strategy (a protective call)\n        self.buy(self._protective_call, 2)\n"
  },
  {
    "path": "Algorithm.Python/CoveredAndProtectivePutStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Covered and Protective Put strategies.\n### </summary>\nclass CoveredAndProtectivePutStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                           key = lambda x: x.expiry, reverse=True)\n\n        if len(contracts) == 0: return\n        contract = contracts[0]\n        if contract != None:\n            self._covered_put = OptionStrategies.covered_put(option_symbol, contract.strike, contract.expiry)\n            self._protective_put = OptionStrategies.protective_put(option_symbol, contract.strike, contract.expiry)\n            self.buy(self._covered_put, 2)\n\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        option_position = [position for position in positions if position.symbol.security_type == SecurityType.OPTION][0]\n        if option_position.symbol.id.option_right != OptionRight.PUT:\n            raise AssertionError(f\"Expected option position to be a put. Actual: {option_position.symbol.id.option_right}\")\n\n        underlying_position = [position for position in positions if position.symbol.security_type == SecurityType.EQUITY][0]\n        expected_option_position_quantity = -2\n        expected_underlying_position_quantity = -2 * self.securities[option_symbol].symbol_properties.contract_multiplier\n\n        if option_position.quantity != expected_option_position_quantity:\n            raise AssertionError(f\"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}\")\n\n        if underlying_position.quantity != expected_underlying_position_quantity:\n            raise AssertionError(f\"Expected underlying position quantity to be {expected_underlying_position_quantity}. Actual: {underlying_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We should be able to close the position using the inverse strategy (a protective put)\n        self.buy(self._protective_put, 2)\n"
  },
  {
    "path": "Algorithm.Python/CrunchDAOSignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm sends portfolio targets to CrunchDAO API once a week.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\nclass CrunchDAOSignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    crunch_universe = []\n\n    def initialize(self) -> None:\n        self.set_start_date(2023, 5, 22)\n        self.set_end_date(2023, 5, 26)\n        self.set_cash(1_000_000)\n\n        # Disable automatic exports as we manually set them\n        self.signal_export.automatic_export_time_span = None\n\n        # Connect to CrunchDAO\n        api_key = \"\"            # Your CrunchDAO API key\n        model = \"\"              # The Id of your CrunchDAO model\n        submission_name = \"\"    # A name for the submission to distinguish it from your other submissions\n        comment = \"\"            # A comment for the submission\n        self.signal_export.add_signal_export_provider(CrunchDAOSignalExport(api_key, model, submission_name, comment))\n\n        self.set_security_initializer(BrokerageModelSecurityInitializer(self.brokerage_model, FuncSecuritySeeder(self.get_last_known_prices)))\n\n        # Add a custom data universe to read the CrunchDAO skeleton\n        self.add_universe(CrunchDaoSkeleton, \"CrunchDaoSkeleton\", Resolution.DAILY, self.select_symbols)\n\n        # Create a Scheduled Event to submit signals every monday before the market opens\n        self._week = -1\n        self.schedule.on(\n            self.date_rules.every([DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY]),\n            self.time_rules.at(13, 15, TimeZones.UTC),\n            self.submit_signals)\n\n        self.settings.minimum_order_margin_portfolio_percentage = 0\n\n        self.set_warm_up(timedelta(45))\n\n    def select_symbols(self, data: list[CrunchDaoSkeleton]) -> list[Symbol]:\n        return [x.symbol for x in data]\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        for security in changes.removed_securities:\n            if security in self.crunch_universe:\n                self.crunch_universe.remove(security)\n        self.crunch_universe.extend(changes.added_securities)\n\n    def submit_signals(self) -> None:\n        if self.is_warming_up:\n            return\n\n        # Submit signals once per week\n        week_num = self.time.isocalendar()[1]\n        if self._week == week_num:\n            return\n        self._week = week_num\n\n        symbols = [security.symbol for security in self.crunch_universe if security.price > 0]\n\n        # Get historical price data\n        # close_prices = self.history(symbols, 22, Resolution.DAILY).close.unstack(0)\n\n        # Create portfolio targets\n        weight_by_symbol = {symbol: 1/len(symbols) for symbol in symbols} # Add your logic here\n        targets = [PortfolioTarget(symbol, weight) for symbol, weight in weight_by_symbol.items()]\n\n        # (Optional) Place trades\n        self.set_holdings(targets)\n\n        # Send signals to CrunchDAO\n        success = self.signal_export.set_target_portfolio(targets)\n        if not success:\n            self.debug(f\"Couldn't send targets at {self.time}\")\n\n\nclass CrunchDaoSkeleton(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        return SubscriptionDataSource(\"https://tournament.crunchdao.com/data/skeleton.csv\", SubscriptionTransportMedium.REMOTE_FILE)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> DynamicData:\n        if not line[0].isdigit():\n            return None\n        skeleton = CrunchDaoSkeleton()\n        skeleton.symbol = config.symbol\n\n        try:\n            csv = line.split(',')\n            skeleton.end_time = datetime.strptime(csv[0], \"%Y-%m-%d\")\n            skeleton.symbol =  Symbol(SecurityIdentifier.generate_equity(csv[1], Market.USA, mapping_resolve_date=skeleton.time), csv[1])\n            skeleton[\"Ticker\"] = csv[1]\n\n        except ValueError:\n            # Do nothing\n            return None\n\n        return skeleton\n"
  },
  {
    "path": "Algorithm.Python/CustomBenchmarkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Shows how to set a custom benchmark for you algorithms\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"benchmarks\" />\nclass CustomBenchmarkAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.SECOND)\n        \n        # Disabling the benchmark / setting to a fixed value \n        # self.set_benchmark(lambda x: 0)\n        \n        # Set the benchmark to AAPL US Equity\n        self.set_benchmark(Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA))\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n            self.debug(\"Purchased Stock\")\n\n        tuple_result = SymbolCache.try_get_symbol(\"AAPL\", None)\n        if tuple_result[0]:\n            raise AssertionError(\"Benchmark Symbol is not expected to be added to the Symbol cache\")\n"
  },
  {
    "path": "Algorithm.Python/CustomBenchmarkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomBrokerageModelRegressionAlgorithm import CustomBrokerageModel\n\n### <summary>\n### Regression algorithm to test we can specify a custom benchmark model, and override some of its methods\n### </summary>\nclass CustomBenchmarkRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_brokerage_model(CustomBrokerageModelWithCustomBenchmark())\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.update_request_submitted = False\n\n    def on_data(self, slice):\n        benchmark = self.benchmark.evaluate(self.time)\n        if (self.time.day % 2 == 0) and (benchmark != 1):\n            raise AssertionError(f\"Benchmark should be 1, but was {benchmark}\")\n\n        if (self.time.day % 2 == 1) and (benchmark != 2):\n            raise AssertionError(f\"Benchmark should be 2, but was {benchmark}\")\n\nclass CustomBenchmark:\n    def evaluate(self, time):\n        if time.day % 2 == 0:\n            return 1\n        else:\n            return 2\n\nclass CustomBrokerageModelWithCustomBenchmark(CustomBrokerageModel):\n    def get_benchmark(self, securities):\n        return CustomBenchmark()\n"
  },
  {
    "path": "Algorithm.Python/CustomBrokerageModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test we can specify a custom brokerage model, and override some of its methods\n### </summary>\nclass CustomBrokerageModelRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_brokerage_model(CustomBrokerageModel())\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.add_equity(\"AIG\", Resolution.DAILY)\n        self.update_request_submitted = False\n\n        if self.brokerage_model.default_markets[SecurityType.EQUITY] != Market.USA:\n            raise AssertionError(f\"The default market for Equity should be {Market.USA}\")\n        if self.brokerage_model.default_markets[SecurityType.CRYPTO] != Market.BINANCE:\n            raise AssertionError(f\"The default market for Crypto should be {Market.BINANCE}\")\n\n    def on_data(self, slice):\n        if not self.portfolio.invested:\n            self.market_order(\"SPY\", 100.0)\n            self.aig_ticket = self.market_order(\"AIG\", 100.0)\n\n    def on_order_event(self, order_event):\n        spy_ticket = self.transactions.get_order_ticket(order_event.order_id)\n        if self.update_request_submitted == False:\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.quantity = spy_ticket.quantity + 10\n            spy_ticket.update(update_order_fields)\n            self.spy_ticket = spy_ticket\n            self.update_request_submitted = True\n\n    def on_end_of_algorithm(self):\n        submit_expected_message = \"BrokerageModel declared unable to submit order: [2] Information - Code:  - Symbol AIG can not be submitted\"\n        if self.aig_ticket.submit_request.response.error_message != submit_expected_message:\n            raise AssertionError(f\"Order with ID: {self.aig_ticket.order_id} should not have submitted symbol AIG\")\n        update_expected_message = \"OrderID: 1 Information - Code:  - This order can not be updated\"\n        if self.spy_ticket.update_requests[0].response.error_message != update_expected_message:\n            raise AssertionError(f\"Order with ID: {self.spy_ticket.order_id} should have been updated\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    default_markets = { SecurityType.EQUITY: Market.USA, SecurityType.CRYPTO : Market.BINANCE  }\n\n    def can_submit_order(self, security: Security, order: Order, message: BrokerageMessageEvent):\n        if security.symbol.value == \"AIG\":\n            message = BrokerageMessageEvent(BrokerageMessageType.INFORMATION, \"\", \"Symbol AIG can not be submitted\")\n            return False, message\n        return True, None\n\n    def can_update_order(self, security: Security, order: Order, request: UpdateOrderRequest, message: BrokerageMessageEvent):\n        message = BrokerageMessageEvent(BrokerageMessageType.INFORMATION, \"\", \"This order can not be updated\")\n        return False, message\n"
  },
  {
    "path": "Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating the usage of custom brokerage message handler and the new brokerage-side order handling/filtering.\n### This test is supposed to be ran by the CustomBrokerageMessageHandlerTests unit test fixture.\n###\n### All orders are sent from the brokerage, none of them will be placed by the algorithm.\n### </summary>\nclass CustomBrokerageSideOrderHandlingRegressionAlgorithm(QCAlgorithm):\n    '''Algorithm demonstrating the usage of custom brokerage message handler and the new brokerage-side order handling/filtering.\n     This test is supposed to be ran by the CustomBrokerageMessageHandlerTests unit test fixture.\n\n     All orders are sent from the brokerage, none of them will be placed by the algorithm.'''\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self.set_brokerage_message_handler(CustomBrokerageMessageHandler(self))\n\n        self._spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n\n    def on_end_of_algorithm(self):\n        # The security should have been added\n        if not self.securities.contains_key(self._spy):\n            raise AssertionError(\"Expected security to have been added\")\n\n        if self.transactions.orders_count == 0:\n            raise AssertionError(\"Expected orders to be added from brokerage side\")\n\n        if len(list(self.portfolio.positions.groups)) != 1:\n            raise AssertionError(\"Expected only one position\")\n\nclass CustomBrokerageMessageHandler(DefaultBrokerageMessageHandler):\n    def __init__(self, algorithm):\n        self._algorithm = algorithm\n\n    def handle_message(self, message):\n        self._algorithm.debug(f\"{self._algorithm.time} Event: {message.message}\")\n\n    def handle_order(self, event_args):\n        order = event_args.order\n        if order.tag is None or not order.tag.isdigit():\n            raise AssertionError(\"Expected all new brokerage-side orders to have a valid tag\")\n\n        # We will only process orders with even tags\n        return int(order.tag) % 2 == 0\n"
  },
  {
    "path": "Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating the usage of custom brokerage message handler and the new brokerage-side order handling/filtering.\n### This test is supposed to be ran by the CustomBrokerageMessageHandlerTests unit test fixture.\n###\n### All orders are sent from the brokerage, none of them will be placed by the algorithm.\n### </summary>\nclass CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm(QCAlgorithm):\n    '''Algorithm demonstrating the usage of custom brokerage message handler and the new brokerage-side order handling/filtering.\n     This test is supposed to be ran by the CustomBrokerageMessageHandlerTests unit test fixture.\n\n     All orders are sent from the brokerage, none of them will be placed by the algorithm.'''\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self.set_brokerage_message_handler(CustomBrokerageMessageHandler(self))\n\n        self._spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n\n    def on_end_of_algorithm(self):\n        # The security should have been added\n        if not self.securities.contains_key(self._spy):\n            raise AssertionError(\"Expected security to have been added\")\n\n        if self.transactions.orders_count == 0:\n            raise AssertionError(\"Expected orders to be added from brokerage side\")\n\n        if len(list(self.portfolio.positions.groups)) != 1:\n            raise AssertionError(\"Expected only one position\")\n\nclass CustomBrokerageMessageHandler(DefaultBrokerageMessageHandler):\n    def __init__(self, algorithm):\n        super().__init__(algorithm)\n        self._algorithm = algorithm\n\n    def handle_order(self, event_args):\n        order = event_args.order\n        if order.tag is None or not order.tag.isdigit():\n            raise AssertionError(\"Expected all new brokerage-side orders to have a valid tag\")\n\n        # We will only process orders with even tags\n        return int(order.tag) % 2 == 0\n"
  },
  {
    "path": "Algorithm.Python/CustomBuyingPowerModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of using custom buying power model in backtesting.\n### QuantConnect allows you to model all orders as deeply and accurately as you need.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"transaction fees and slippage\" />\n### <meta name=\"tag\" content=\"custom buying power models\" />\nclass CustomBuyingPowerModelAlgorithm(QCAlgorithm):\n    '''Demonstration of using custom buying power model in backtesting.\n    QuantConnect allows you to model all orders as deeply and accurately as you need.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,1)   # Set Start Date\n        self.set_end_date(2013,10,31)    # Set End Date\n        security = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.spy = security.symbol\n\n        # set the buying power model\n        security.set_buying_power_model(CustomBuyingPowerModel())\n\n    def on_data(self, slice):\n        if self.portfolio.invested:\n            return\n\n        quantity = self.calculate_order_quantity(self.spy, 1)\n        if quantity % 100 != 0:\n            raise AssertionError(f'CustomBuyingPowerModel only allow quantity that is multiple of 100 and {quantity} was found')\n\n        # We normally get insufficient buying power model, but the\n        # CustomBuyingPowerModel always says that there is sufficient buying power for the orders\n        self.market_order(self.spy, quantity * 10)\n\n\nclass CustomBuyingPowerModel(BuyingPowerModel):\n    def get_maximum_order_quantity_for_target_buying_power(self, parameters):\n        quantity = super().get_maximum_order_quantity_for_target_buying_power(parameters).quantity\n        quantity = np.floor(quantity / 100) * 100\n        return GetMaximumOrderQuantityResult(quantity)\n\n    def has_sufficient_buying_power_for_order(self, parameters):\n        return HasSufficientBuyingPowerForOrderResult(True)\n\n    # Let's always return 0 as the maintenance margin so we avoid margin call orders\n    def get_maintenance_margin(self, parameters):\n        return MaintenanceMargin(0)\n\n    # Override this as well because the base implementation calls GetMaintenanceMargin (overridden)\n    # because in C# it wouldn't resolve the overridden Python method\n    def get_reserved_buying_power_for_position(self, parameters):\n        return parameters.result_in_account_currency(0)\n"
  },
  {
    "path": "Algorithm.Python/CustomChartingAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating custom charting support in QuantConnect.\n### The entire charting system of quantconnect is adaptable. You can adjust it to draw whatever you'd like.\n### Charts can be stacked, or overlayed on each other. Series can be candles, lines or scatter plots.\n### Even the default behaviours of QuantConnect can be overridden.\n### </summary>\n### <meta name=\"tag\" content=\"charting\" />\n### <meta name=\"tag\" content=\"adding charts\" />\n### <meta name=\"tag\" content=\"series types\" />\n### <meta name=\"tag\" content=\"plotting indicators\" />\nclass CustomChartingAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2016,1,1)\n        self.set_end_date(2017,1,1)\n        self.set_cash(100000)\n\n        spy = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n\n        # In your initialize method:\n        # Chart - Master Container for the Chart:\n        stock_plot = Chart(\"Trade Plot\")\n        # On the Trade Plotter Chart we want 3 series: trades and price:\n        stock_plot.add_series(Series(\"Buy\", SeriesType.SCATTER, 0))\n        stock_plot.add_series(Series(\"Sell\", SeriesType.SCATTER, 0))\n        stock_plot.add_series(Series(\"Price\", SeriesType.LINE, 0))\n        self.add_chart(stock_plot)\n\n        # On the Average Cross Chart we want 2 series, slow MA and fast MA\n        avg_cross = Chart(\"Average Cross\")\n        avg_cross.add_series(Series(\"FastMA\", SeriesType.LINE, 0))\n        avg_cross.add_series(Series(\"SlowMA\", SeriesType.LINE, 0))\n        self.add_chart(avg_cross)\n\n        # There's support for candlestick charts built-in:\n        weekly_spy_plot = Chart(\"Weekly SPY\")\n        spy_candlesticks = CandlestickSeries(\"SPY\")\n        weekly_spy_plot.add_series(spy_candlesticks)\n        self.add_chart(weekly_spy_plot)\n\n        self.consolidate(spy, Calendar.WEEKLY, lambda bar: self.plot(\"Weekly SPY\", \"SPY\", bar))\n\n        self.fast_ma = 0\n        self.slow_ma = 0\n        self.last_price = 0\n        self.resample = datetime.min\n        self.resample_period = (self.end_date - self.start_date) / 2000\n\n    def on_data(self, slice):\n        if slice[\"SPY\"] is None: return\n\n        self.last_price = slice[\"SPY\"].close\n        if self.fast_ma == 0: self.fast_ma = self.last_price\n        if self.slow_ma == 0: self.slow_ma = self.last_price\n        self.fast_ma = (0.01 * self.last_price) + (0.99 * self.fast_ma)\n        self.slow_ma = (0.001 * self.last_price) + (0.999 * self.slow_ma)\n\n\n        if self.time > self.resample:\n            self.resample = self.time  + self.resample_period\n            self.plot(\"Average Cross\", \"FastMA\", self.fast_ma)\n            self.plot(\"Average Cross\", \"SlowMA\", self.slow_ma)\n\n        # On the 5th days when not invested buy:\n        if not self.portfolio.invested and self.time.day % 13 == 0:\n        \tself.order(\"SPY\", (int)(self.portfolio.margin_remaining / self.last_price))\n        \tself.plot(\"Trade Plot\", \"Buy\", self.last_price)\n        elif self.time.day % 21 == 0 and self.portfolio.invested:\n            self.plot(\"Trade Plot\", \"Sell\", self.last_price)\n            self.liquidate()\n\n    def on_end_of_day(self, symbol):\n       #Log the end of day prices:\n       self.plot(\"Trade Plot\", \"Price\", self.last_price)\n"
  },
  {
    "path": "Algorithm.Python/CustomConsolidatorRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass CustomConsolidatorRegressionAlgorithm(QCAlgorithm):\n    '''Custom Consolidator Regression Algorithm shows some examples of how to build custom \n    consolidators in Python.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,4)  \n        self.set_end_date(2013,10,11)    \n        self.set_cash(100000)  \n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        #Create 5 day QuoteBarConsolidator; set consolidated function; add to subscription manager\n        five_day_consolidator = QuoteBarConsolidator(timedelta(days=5))\n        five_day_consolidator.data_consolidated += self.on_quote_bar_data_consolidated\n        self.subscription_manager.add_consolidator(\"SPY\", five_day_consolidator)\n\n        #Create a 3:10PM custom quote bar consolidator\n        timed_consolidator = DailyTimeQuoteBarConsolidator(time(hour=15, minute=10))\n        timed_consolidator.data_consolidated += self.on_quote_bar_data_consolidated\n        self.subscription_manager.add_consolidator(\"SPY\", timed_consolidator)\n\n        #Create our entirely custom 2 day quote bar consolidator\n        self.custom_consolidator = CustomQuoteBarConsolidator(timedelta(days=2))\n        self.custom_consolidator.data_consolidated += (self.on_quote_bar_data_consolidated)\n        self.subscription_manager.add_consolidator(\"SPY\", self.custom_consolidator)\n\n        #Create an indicator and register a consolidator to it\n        self.moving_average = SimpleMovingAverage(5)\n        self.custom_consolidator2 = CustomQuoteBarConsolidator(timedelta(hours=1))\n        self.register_indicator(\"SPY\", self.moving_average, self.custom_consolidator2)\n\n\n    def on_quote_bar_data_consolidated(self, sender, bar):\n        '''Function assigned to be triggered by consolidators.\n        Designed to post debug messages to show how the examples work, including\n        which consolidator is posting, as well as its values.\n\n        If using an inherited class and not overwriting OnDataConsolidated\n        we expect to see the super C# class as the sender type.\n\n        Using sender.period only works when all consolidators have a Period value.\n        '''\n        \n        consolidator_info = str(type(sender)) + str(sender.period)\n       \n        self.debug(\"Bar Type: \" + consolidator_info)\n        self.debug(\"Bar Range: \" + bar.time.ctime() + \" - \" + bar.end_time.ctime())\n        self.debug(\"Bar value: \" + str(bar.close))\n    \n    def on_data(self, slice):\n        test = slice.get_values()\n\n        if self.custom_consolidator.consolidated and slice.contains_key(\"SPY\"):\n            data = slice['SPY']\n            \n            if self.moving_average.is_ready:\n                if data.value > self.moving_average.current.price:\n                    self.set_holdings(\"SPY\", .5)\n                else :\n                    self.set_holdings(\"SPY\", 0)\n            \n\n\nclass DailyTimeQuoteBarConsolidator(QuoteBarConsolidator):\n    '''A custom QuoteBar consolidator that inherits from C# class QuoteBarConsolidator. \n\n    This class shows an example of building on top of an existing consolidator class, it is important\n    to note that this class can leverage the functions of QuoteBarConsolidator but its private fields\n    (_period, _workingbar, etc.) are separate from this Python. For that reason if we want Scan() to work\n    we must overwrite the function with our desired Scan function and trigger OnDataConsolidated().\n    \n    For this particular example we implemented the scan method to trigger a consolidated bar\n    at close_time everyday'''\n\n    def __init__(self, close_time):\n        self.close_time = close_time\n        self.working_bar = None\n    \n    def update(self, data):\n        '''Updates this consolidator with the specified data'''\n\n        #If we don't have bar yet, create one\n        if self.working_bar is None:\n            self.working_bar = QuoteBar(data.time,data.symbol,data.bid,data.last_bid_size,\n                data.ask,data.last_ask_size)\n\n        #Update bar using QuoteBarConsolidator's AggregateBar()\n        self.aggregate_bar(self.working_bar, data)\n        \n\n    def scan(self, time):\n        '''Scans this consolidator to see if it should emit a bar due yet'''\n\n        if self.working_bar is None:\n            return\n\n        #If its our desired bar end time take the steps to \n        if time.hour == self.close_time.hour and time.minute == self.close_time.minute:\n\n            #Set end time\n            self.working_bar.end_time = time\n\n            #Emit event using QuoteBarConsolidator's OnDataConsolidated()\n            self.on_data_consolidated(self.working_bar)\n\n            #Reset the working bar to None\n            self.working_bar = None\n\nclass CustomQuoteBarConsolidator(PythonConsolidator):\n    '''A custom quote bar consolidator that inherits from PythonConsolidator and implements \n    the IDataConsolidator interface, it must implement all of IDataConsolidator. Reference \n    PythonConsolidator.cs and DataConsolidatorPythonWrapper.PY for more information.\n\n    This class shows how to implement a consolidator from scratch in Python, this gives us more\n    freedom to determine the behavior of the consolidator but can't leverage any of the built in\n    functions of an inherited class.\n    \n    For this example we implemented a Quotebar from scratch'''\n\n    def __init__(self, period):\n\n        #IDataConsolidator required vars for all consolidators\n        self.consolidated = None        #Most recently consolidated piece of data.\n        self.working_data = None         #Data being currently consolidated\n        self.input_type = QuoteBar       #The type consumed by this consolidator\n        self.output_type = QuoteBar      #The type produced by this consolidator\n\n        #Consolidator Variables\n        self.period = period\n    \n    def update(self, data):\n        '''Updates this consolidator with the specified data'''\n        \n        #If we don't have bar yet, create one\n        if self.working_data is None:\n            self.working_data = QuoteBar(data.time,data.symbol,data.bid,data.last_bid_size,\n                data.ask,data.last_ask_size,self.period)\n\n        #Update bar using QuoteBar's update()\n        self.working_data.update(data.value, data.bid.close, data.ask.close, 0, \n            data.last_bid_size, data.last_ask_size)\n\n    def scan(self, time):\n        '''Scans this consolidator to see if it should emit a bar due to time passing'''\n\n        if self.period is not None and self.working_data is not None:\n            if time - self.working_data.time >= self.period:\n\n                #Trigger the event handler with a copy of self and the data\n                self.on_data_consolidated(self, self.working_data)\n\n                #Set the most recent consolidated piece of data and then clear the working_data\n                self.consolidated = self.working_data\n                self.working_data = None\n"
  },
  {
    "path": "Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to demonstrate the use of SetBenchmark() with custom data\n### </summary>\nclass CustomDataBenchmarkRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2017, 8, 18)  # Set Start Date\n        self.set_end_date(2017, 8, 21)  # Set End Date\n        self.set_cash(100000)  # Set Strategy Cash\n\n        self.add_equity(\"SPY\", Resolution.HOUR)\n        # Load benchmark data\n        self.custom_symbol = self.add_data(ExampleCustomData, \"ExampleCustomData\", Resolution.HOUR).symbol\n        self.set_benchmark(self.custom_symbol)\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n    def on_end_of_algorithm(self):\n        security_benchmark = self.benchmark\n        if security_benchmark.security.price == 0:\n            raise AssertionError(\"Security benchmark price was not expected to be zero\")\n\nclass ExampleCustomData(PythonData):\n\n    def get_source(self, config, date, is_live):\n        source = \"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\"\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.REMOTE_FILE)\n\n    def reader(self, config, line, date, is_live):\n        data = line.split(',')\n        obj_data = ExampleCustomData()\n        obj_data.symbol = config.symbol\n        obj_data.time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S') + timedelta(hours=20)\n        obj_data.value = float(data[4])\n        obj_data[\"Open\"] = float(data[1])\n        obj_data[\"High\"] = float(data[2])\n        obj_data[\"Low\"] = float(data[3])\n        obj_data[\"Close\"] = float(data[4])\n        return obj_data\n"
  },
  {
    "path": "Algorithm.Python/CustomDataBitcoinAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport pytz\n\n### <summary>\n### Demonstration of using an external custom datasource. LEAN Engine is incredibly flexible and allows you to define your own data source.\n### This includes any data source which has a TIME and VALUE. These are the *only* requirements. To demonstrate this we're loading in \"Bitcoin\" data.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"crypto\" />\nclass CustomDataBitcoinAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2011, 9, 13)\n        self.set_end_date(datetime.now().date() - timedelta(1))\n        self.set_cash(100000)\n\n        # Define the symbol and \"type\" of our generic data:\n        self.add_data(Bitcoin, \"BTC\")\n\n\n    def on_data(self, data):\n        if not data.contains_key(\"BTC\"): return\n\n        close = data[\"BTC\"].close\n\n        # If we don't have any weather \"SHARES\" -- invest\"\n        if not self.portfolio.invested:\n            # Weather used as a tradable asset, like stocks, futures etc.\n            # It's only OK to use SetHoldings with crypto when using custom data. When trading with built-in crypto data, \n            # use the cashbook. Reference https://github.com/QuantConnect/Lean/blob/master/Algorithm.python/BasicTemplateCryptoAlgorithm.py \n            self.set_holdings(\"BTC\", 1) \n            self.debug(\"Buying BTC 'Shares': BTC: {0}\".format(close))\n\n        self.debug(\"Time: {0} {1}\".format(datetime.now(), close))\n\n\nclass Bitcoin(PythonData):\n    '''Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data'''\n\n    def get_source(self, config, date, is_live_mode):\n        if is_live_mode:\n            return SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.REST)\n\n        #return \"http://my-ftp-server.com/futures-data-\" + date.to_string(\"Ymd\") + \".zip\"\n        # OR simply return a fixed small data file. Large files will slow down your backtest\n        return SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\", SubscriptionTransportMedium.REMOTE_FILE)\n\n\n    def reader(self, config, line, date, is_live_mode):\n        coin = Bitcoin()\n        coin.symbol = config.symbol\n\n        if is_live_mode:\n            # Example Line Format:\n            # {\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n            try:\n                live_btc = json.loads(line)\n\n                # If value is zero, return None\n                value = live_btc[\"last\"]\n                if value == 0: return None\n\n                coin.end_time =  datetime.now(pytz.timezone(str(config.exchange_time_zone)))\n                coin.value = value\n                coin[\"Open\"] = float(live_btc[\"open\"])\n                coin[\"High\"] = float(live_btc[\"high\"])\n                coin[\"Low\"] = float(live_btc[\"low\"])\n                coin[\"Close\"] = float(live_btc[\"last\"])\n                coin[\"Ask\"] = float(live_btc[\"ask\"])\n                coin[\"Bid\"] = float(live_btc[\"bid\"])\n                coin[\"VolumeBTC\"] = float(live_btc[\"volume\"])\n                coin[\"WeightedPrice\"] = float(live_btc[\"vwap\"])\n                return coin\n            except ValueError:\n                # Do nothing, possible error in json decoding\n                return None\n\n        # Example Line Format:\n        # Date      Open   High    Low     Close   Volume (BTC)    Volume (Currency)   Weighted Price\n        # 2011-09-13 5.8    6.0     5.65    5.97    58.37138238,    346.0973893944      5.929230648356\n        if not (line.strip() and line[0].isdigit()): return None\n\n        try:\n            data = line.split(',')\n\n            # If value is zero, return None\n            value = data[4]\n            if value == 0: return None\n\n            coin.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            coin.end_time = coin.time + timedelta(days=1)\n            coin.value = value\n            coin[\"Open\"] = float(data[1])\n            coin[\"High\"] = float(data[2])\n            coin[\"Low\"] = float(data[3])\n            coin[\"Close\"] = float(data[4])\n            coin[\"VolumeBTC\"] = float(data[5])\n            coin[\"VolumeUSD\"] = float(data[6])\n            coin[\"WeightedPrice\"] = float(data[7])\n            return coin\n\n        except ValueError:\n            # Do nothing, possible error in json decoding\n            return None\n"
  },
  {
    "path": "Algorithm.Python/CustomDataIconicTypesAddDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\n\n### <summary>\n### Regression algorithm checks that adding data via AddData\n### works as expected\n### </summary>\nclass CustomDataIconicTypesAddDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        twx_equity = self.add_equity(\"TWX\", Resolution.DAILY).symbol\n        custom_twx_symbol = self.add_data(LinkedData, twx_equity, Resolution.DAILY).symbol\n\n        self.googl_equity = self.add_equity(\"GOOGL\", Resolution.DAILY).symbol\n        custom_googl_symbol = self.add_data(LinkedData, \"GOOGL\", Resolution.DAILY).symbol\n\n        unlinked_data_symbol = self.add_data(UnlinkedData, \"GOOGL\", Resolution.DAILY).symbol\n        unlinked_data_symbol_underlying_equity = Symbol.create(\"MSFT\", SecurityType.EQUITY, Market.USA)\n        unlinked_data_symbol_underlying = self.add_data(UnlinkedData, unlinked_data_symbol_underlying_equity, Resolution.DAILY).symbol\n\n        option_symbol = self.add_option(\"TWX\", Resolution.MINUTE).symbol\n        custom_option_symbol = self.add_data(LinkedData, option_symbol, Resolution.DAILY).symbol\n\n        if custom_twx_symbol.underlying != twx_equity:\n            raise AssertionError(f\"Underlying symbol for {custom_twx_symbol} is not equal to TWX equity. Expected {twx_equity} got {custom_twx_symbol.underlying}\")\n        if custom_googl_symbol.underlying != self.googl_equity:\n            raise AssertionError(f\"Underlying symbol for {custom_googl_symbol} is not equal to GOOGL equity. Expected {self.googl_equity} got {custom_googl_symbol.underlying}\")\n        if unlinked_data_symbol.has_underlying:\n            raise AssertionError(f\"Unlinked data type (no underlying) has underlying when it shouldn't. Found {unlinked_data_symbol.underlying}\")\n        if not unlinked_data_symbol_underlying.has_underlying:\n            raise AssertionError(\"Unlinked data type (with underlying) has no underlying Symbol even though we added with Symbol\")\n        if unlinked_data_symbol_underlying.underlying != unlinked_data_symbol_underlying_equity:\n            raise AssertionError(f\"Unlinked data type underlying does not equal equity Symbol added. Expected {unlinked_data_symbol_underlying_equity} got {unlinked_data_symbol_underlying.underlying}\")\n        if custom_option_symbol.underlying != option_symbol:\n            raise AssertionError(f\"Option symbol not equal to custom underlying symbol. Expected {option_symbol} got {custom_option_symbol.underlying}\")\n\n        try:\n            custom_data_no_cache = self.add_data(LinkedData, \"AAPL\", Resolution.DAILY)\n            raise AssertionError(\"AAPL was found in the SymbolCache, though it should be missing\")\n        except InvalidOperationException as e:\n            return\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested and len(self.transactions.get_open_orders()) == 0:\n            self.set_holdings(self.googl_equity, 0.5)\n"
  },
  {
    "path": "Algorithm.Python/CustomDataIndicatorExtensionsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom HistoryAlgorithm import *\n\n### <summary>\n### The algorithm creates new indicator value with the existing indicator method by Indicator Extensions\n### Demonstration of using the external custom data to request the IBM and SPY daily data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"plotting indicators\" />\n### <meta name=\"tag\" content=\"charting\" />\nclass CustomDataIndicatorExtensionsAlgorithm(QCAlgorithm):\n\n    # Initialize the data and resolution you require for your strategy\n    def initialize(self):\n\n        self.set_start_date(2014,1,1)\n        self.set_end_date(2018,1,1)\n        self.set_cash(25000)\n\n        self.ibm = 'IBM'\n        self.spy = 'SPY'\n\n        # Define the symbol and \"type\" of our generic data\n        self.add_data(CustomDataEquity, self.ibm, Resolution.DAILY)\n        self.add_data(CustomDataEquity, self.spy, Resolution.DAILY)\n\n        # Set up default Indicators, these are just 'identities' of the closing price\n        self.ibm_sma = self.sma(self.ibm, 1, Resolution.DAILY)\n        self.spy_sma = self.sma(self.spy, 1, Resolution.DAILY)\n\n        # This will create a new indicator whose value is sma_s_p_y / sma_i_b_m\n        self.ratio = IndicatorExtensions.over(self.spy_sma, self.ibm_sma)\n\n        # Plot indicators each time they update using the PlotIndicator function\n        self.plot_indicator(\"Ratio\", self.ratio)\n        self.plot_indicator(\"Data\", self.ibm_sma, self.spy_sma)\n\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    def on_data(self, data):\n\n        # Wait for all indicators to fully initialize\n        if not (self.ibm_sma.is_ready and self.spy_sma.is_ready and self.ratio.is_ready): return\n        if not self.portfolio.invested and self.ratio.current.value > 1:\n            self.market_order(self.ibm, 100)\n        elif self.ratio.current.value < 1:\n                self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\n\nclass CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 4, 7)\n        self.set_cash(100000)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.add_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selector))\n\n    def coarse_selector(self, coarse):\n        symbols = [\n            Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"BAC\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"GOOGL\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"GOOG\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA),\n        ]\n\n        self.custom_symbols = []\n\n        for symbol in symbols:\n            self.custom_symbols.append(self.add_data(LinkedData, symbol, Resolution.DAILY).symbol)\n\n        return symbols\n\n    def on_data(self, data):\n        if not self.portfolio.invested and len(self.transactions.get_open_orders()) == 0:\n            aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n            self.set_holdings(aapl, 0.5)\n\n        for custom_symbol in self.custom_symbols:\n            if not self.active_securities.contains_key(custom_symbol.underlying):\n                raise AssertionError(f\"Custom data undelrying ({custom_symbol.underlying}) Symbol was not found in active securities\")\n"
  },
  {
    "path": "Algorithm.Python/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\n\nclass CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 4, 7)\n        self.set_cash(100000)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.add_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selector))\n\n    def coarse_selector(self, coarse):\n        return [\n            Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"BAC\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"GOOGL\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"GOOG\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA),\n        ]\n\n    def on_data(self, data):\n        if not self.portfolio.invested and len(self.transactions.get_open_orders()) == 0:\n            aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n            self.set_holdings(aapl, 0.5)\n\n        for custom_symbol in self.custom_symbols:\n            if not self.active_securities.contains_key(custom_symbol.underlying):\n                raise AssertionError(f\"Custom data undelrying ({custom_symbol.underlying}) Symbol was not found in active securities\")\n\n    def on_securities_changed(self, changes):\n        iterated = False\n\n        for added in changes.added_securities:\n            if not iterated:\n                self.custom_symbols = []\n                iterated = True\n\n            self.custom_symbols.append(self.add_data(LinkedData, added.symbol, Resolution.DAILY).symbol)\n"
  },
  {
    "path": "Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm demonstrating the use of custom data sourced from multiple \"files\" in the object store\n### </summary>\nclass CustomDataMultiFileObjectStoreRegressionAlgorithm(QCAlgorithm):\n    custom_data = \"2017-08-18 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-18 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-18 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-18 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-18 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-18 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-18 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-18 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-18 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-18 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-18 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-18 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-18 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-18 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-18 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-18 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\\n2017-08-19 01:00:00,5771.75,5792.9,5738.6,5760.2,140394424,5894.04\\n2017-08-19 02:00:00,5709.35,5729.85,5683.1,5699.1,142041404,5462.45\\n2017-08-19 03:00:00,5748.95,5819.4,5739.4,5808.4,124410018,5121.33\\n2017-08-19 04:00:00,5820.4,5854.9,5770.25,5850.05,107160887,4560.84\\n2017-08-19 05:00:00,5841.9,5863.4,5804.3,5813.6,117541145,4591.91\\n2017-08-19 06:00:00,5805.75,5828.4,5777.9,5822.25,115539008,4643.17\\n2017-08-19 07:00:00,5754.15,5755,5645.65,5655.9,198400131,7148\\n2017-08-19 08:00:00,5639.9,5686.15,5616.85,5667.65,182410583,6697.18\\n2017-08-19 09:00:00,5638.05,5640,5566.25,5590.25,193488581,6308.88\\n2017-08-19 10:00:00,5606.95,5666.25,5570.25,5609.1,196571543,6792.49\\n2017-08-19 11:00:00,5627.95,5635.25,5579.35,5588.7,160095940,5939.3\\n2017-08-19 12:00:00,5647.95,5699.35,5630.95,5682.35,239029425,9184.29\\n2017-08-19 13:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-19 14:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-19 15:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-19 16:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-19 17:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-19 18:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-19 19:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-19 20:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-19 21:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-19 22:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-19 23:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-21 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-21 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-21 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-21 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-21 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-21 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-21 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-21 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-21 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-21 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-21 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-21 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-21 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-21 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-21 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\"\n\n    def initialize(self):\n        self.set_start_date(2017, 8, 18)\n        self.set_end_date(2017, 8, 21)\n        self.set_cash(100000)\n\n        self.set_benchmark(lambda x: 0)\n\n        self.custom_symbol = self.add_data(ExampleCustomData, \"ExampleCustomData\", Resolution.HOUR).symbol\n\n        # Saving data here for demonstration and regression testing purposes.\n        # In real scenarios, data has to be saved to the object store before the algorithm starts.\n        # Note: The data is stored in separate files for each date.\n        data = {}\n        for line in self.custom_data.split('\\n'):\n            csv = line.split(',')\n            time = datetime.strptime(csv[0], '%Y-%m-%d %H:%M:%S').date()\n            if time not in data:\n                data[time] = line\n            else:\n                data[time] += '\\n' + line\n\n        for date, date_data in data.items():\n            self.object_store.save(self.get_custom_data_key(date), date_data)\n\n        self.received_data = []\n\n    def on_data(self, slice: Slice):\n        if slice.contains_key(self.custom_symbol):\n            custom_data = slice.get(ExampleCustomData, self.custom_symbol)\n            if custom_data.price == 0:\n                raise AssertionError(\"Custom data price was not expected to be zero\")\n\n            self.received_data.append(custom_data)\n\n    def on_end_of_algorithm(self):\n        if not self.received_data:\n            raise AssertionError(\"Custom data was not fetched\")\n\n        custom_security = self.securities[self.custom_symbol]\n        if custom_security is None or custom_security.price == 0:\n            raise AssertionError(\"Expected the custom security to be added to the algorithm securities and to have a price that is not zero\")\n\n        # Make sure history requests work as expected\n        history = self.history(ExampleCustomData, self.custom_symbol, self.start_date, self.end_date, Resolution.HOUR)\n\n        if history.shape[0] != len(self.received_data):\n            raise AssertionError(\"History request returned more or less data than expected\")\n\n        for i in range(len(self.received_data)):\n            received_data = self.received_data[i]\n            if (history.index[i][0] != received_data.symbol or\n                history.index[i][1] != received_data.time or\n                history[[\"value\"]].values[i][0] != received_data.value or\n                history[[\"open\"]].values[i][0] != received_data.open or\n                history[[\"high\"]].values[i][0] != received_data.high or\n                history[[\"low\"]].values[i][0] != received_data.low or\n                history[[\"close\"]].values[i][0] != received_data.close):\n                raise AssertionError(\"History request returned different data than expected\")\n\n    @staticmethod\n    def get_custom_data_key(date: date) -> str:\n        return f\"CustomData/ExampleCustomData{date.strftime('%Y%m%d')}\"\n\nclass ExampleCustomData(PythonData):\n    CustomDataKey = \"\"\n\n    def get_source(self, config, date, is_live):\n        return SubscriptionDataSource(CustomDataMultiFileObjectStoreRegressionAlgorithm.get_custom_data_key(date.date()),\n                                      SubscriptionTransportMedium.OBJECT_STORE,\n                                      FileFormat.CSV)\n\n    def reader(self, config, line, date, is_live):\n        data = line.split(',')\n        obj_data = ExampleCustomData()\n        obj_data.symbol = config.symbol\n        obj_data.time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S')\n        obj_data.value = float(data[4])\n        obj_data[\"Open\"] = float(data[1])\n        obj_data[\"High\"] = float(data[2])\n        obj_data[\"Low\"] = float(data[3])\n        obj_data[\"Close\"] = float(data[4])\n        return obj_data\n"
  },
  {
    "path": "Algorithm.Python/CustomDataNIFTYAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This demonstration imports indian NSE index \"NIFTY\" as a tradable security in addition to the USDINR currency pair. We move into the\n### NSE market when the economy is performing well.\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"custom data\" />\nclass CustomDataNIFTYAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2008, 1, 8)\n        self.set_end_date(2014, 7, 25)\n        self.set_cash(100000)\n\n        # Define the symbol and \"type\" of our generic data:\n        rupee = self.add_data(DollarRupee, \"USDINR\", Resolution.DAILY).symbol\n        nifty = self.add_data(Nifty, \"NIFTY\", Resolution.DAILY).symbol\n\n        self.settings.automatic_indicator_warm_up = True\n        rupee_sma = self.sma(rupee, 20)\n        nifty_sma = self.sma(rupee, 20)\n        self.log(f\"SMA - Is ready? USDINR: {rupee_sma.is_ready} NIFTY: {nifty_sma.is_ready}\")\n\n        self.minimum_correlation_history = 50\n        self.today = CorrelationPair()\n        self.prices = []\n\n\n    def on_data(self, data):\n        if data.contains_key(\"USDINR\"):\n            self.today = CorrelationPair(self.time)\n            self.today.currency_price = data[\"USDINR\"].close\n\n        if not data.contains_key(\"NIFTY\"): return\n\n        self.today.nifty_price = data[\"NIFTY\"].close\n\n        if self.today.date() == data[\"NIFTY\"].time.date():\n            self.prices.append(self.today)\n            if len(self.prices) > self.minimum_correlation_history:\n                self.prices.pop(0)\n\n        # Strategy\n        if self.time.weekday() != 2: return\n\n        cur_qnty = self.portfolio[\"NIFTY\"].quantity\n        quantity = int(self.portfolio.margin_remaining * 0.9 / data[\"NIFTY\"].close)\n        hi_nifty = max(price.nifty_price for price in self.prices)\n        lo_nifty = min(price.nifty_price for price in self.prices)\n\n        if data[\"NIFTY\"].open >= hi_nifty:\n            code = self.order(\"NIFTY\",  quantity - cur_qnty)\n            self.debug(\"LONG  {0} Time: {1} Quantity: {2} Portfolio: {3} Nifty: {4} Buying Power: {5}\".format(code, self.time, quantity, self.portfolio[\"NIFTY\"].quantity, data[\"NIFTY\"].close, self.portfolio.total_portfolio_value))\n        elif data[\"NIFTY\"].open <= lo_nifty:\n            code = self.order(\"NIFTY\", -quantity - cur_qnty)\n            self.debug(\"SHORT {0} Time: {1} Quantity: {2} Portfolio: {3} Nifty: {4} Buying Power: {5}\".format(code, self.time, quantity, self.portfolio[\"NIFTY\"].quantity, data[\"NIFTY\"].close, self.portfolio.total_portfolio_value))\n\n\nclass Nifty(PythonData):\n    '''NIFTY Custom Data Class'''\n    def get_source(self, config, date, is_live_mode):\n        return SubscriptionDataSource(\"https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1\", SubscriptionTransportMedium.REMOTE_FILE)\n\n\n    def reader(self, config, line, date, is_live_mode):\n        if not (line.strip() and line[0].isdigit()): return None\n\n        # New Nifty object\n        index = Nifty()\n        index.symbol = config.symbol\n\n        try:\n            # Example File Format:\n            # Date,       Open       High        Low       Close     Volume      Turnover\n            # 2011-09-13  7792.9    7799.9     7722.65    7748.7    116534670    6107.78\n            data = line.split(',')\n            index.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            index.end_time = index.time + timedelta(days=1)\n            index.value = data[4]\n            index[\"Open\"] = float(data[1])\n            index[\"High\"] = float(data[2])\n            index[\"Low\"] = float(data[3])\n            index[\"Close\"] = float(data[4])\n\n\n        except ValueError:\n                # Do nothing\n                return None\n\n        return index\n\n\nclass DollarRupee(PythonData):\n    '''Dollar Rupe is a custom data type we create for this algorithm'''\n    def get_source(self, config, date, is_live_mode):\n        return SubscriptionDataSource(\"https://www.dropbox.com/s/m6ecmkg9aijwzy2/USDINR.csv?dl=1\", SubscriptionTransportMedium.REMOTE_FILE)\n\n    def reader(self, config, line, date, is_live_mode):\n        if not (line.strip() and line[0].isdigit()): return None\n\n        # New USDINR object\n        currency = DollarRupee()\n        currency.symbol = config.symbol\n\n        try:\n            data = line.split(',')\n            currency.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            currency.end_time = currency.time + timedelta(days=1)\n            currency.value = data[1]\n            currency[\"Close\"] = float(data[1])\n\n        except ValueError:\n            # Do nothing\n            return None\n\n        return currency\n\n\nclass CorrelationPair:\n    '''Correlation Pair is a helper class to combine two data points which we'll use to perform the correlation.'''\n    def __init__(self, *args):\n        self.nifty_price = 0        # Nifty price for this correlation pair\n        self.currency_price = 0     # Currency price for this correlation pair\n        self._date = datetime.min    # Date of the correlation pair\n        if len(args) > 0: self._date = args[0]\n\n    def date(self):\n        return self._date.date()\n"
  },
  {
    "path": "Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm demonstrating the use of custom data sourced from the object store\n### </summary>\nclass CustomDataObjectStoreRegressionAlgorithm(QCAlgorithm):\n    custom_data = \"2017-08-18 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-18 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-18 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-18 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-18 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-18 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-18 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-18 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-18 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-18 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-18 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-18 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-18 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-18 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-18 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-18 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-18 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-18 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-18 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\\n2017-08-19 01:00:00,5771.75,5792.9,5738.6,5760.2,140394424,5894.04\\n2017-08-19 02:00:00,5709.35,5729.85,5683.1,5699.1,142041404,5462.45\\n2017-08-19 03:00:00,5748.95,5819.4,5739.4,5808.4,124410018,5121.33\\n2017-08-19 04:00:00,5820.4,5854.9,5770.25,5850.05,107160887,4560.84\\n2017-08-19 05:00:00,5841.9,5863.4,5804.3,5813.6,117541145,4591.91\\n2017-08-19 06:00:00,5805.75,5828.4,5777.9,5822.25,115539008,4643.17\\n2017-08-19 07:00:00,5754.15,5755,5645.65,5655.9,198400131,7148\\n2017-08-19 08:00:00,5639.9,5686.15,5616.85,5667.65,182410583,6697.18\\n2017-08-19 09:00:00,5638.05,5640,5566.25,5590.25,193488581,6308.88\\n2017-08-19 10:00:00,5606.95,5666.25,5570.25,5609.1,196571543,6792.49\\n2017-08-19 11:00:00,5627.95,5635.25,5579.35,5588.7,160095940,5939.3\\n2017-08-19 12:00:00,5647.95,5699.35,5630.95,5682.35,239029425,9184.29\\n2017-08-19 13:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-19 14:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-19 15:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-19 16:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-19 17:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-19 18:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-19 19:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-19 20:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-19 21:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-19 22:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-19 23:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\\n2017-08-21 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\\n2017-08-21 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\\n2017-08-21 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\\n2017-08-21 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\\n2017-08-21 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\\n2017-08-21 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\\n2017-08-21 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\\n2017-08-21 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\\n2017-08-21 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\\n2017-08-21 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\\n2017-08-21 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\\n2017-08-21 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\\n2017-08-21 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\\n2017-08-21 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\\n2017-08-21 20:00:00,5895,5956.55,5869.5,5921.4,114174694,4961.54\\n2017-08-21 21:00:00,5900.05,5972.7,5871.3,5881,118346364,4888.65\\n2017-08-21 22:00:00,5907.9,5931.65,5857.4,5878,100130739,4304.75\\n2017-08-21 23:00:00,5848.75,5868.05,5780.35,5788.8,180902123,6695.57\"\n\n    def initialize(self):\n        self.set_start_date(2017, 8, 18)\n        self.set_end_date(2017, 8, 21)\n        self.set_cash(100000)\n\n        self.set_benchmark(lambda x: 0)\n\n        ExampleCustomData.custom_data_key = self.get_custom_data_key()\n\n        self.custom_symbol = self.add_data(ExampleCustomData, \"ExampleCustomData\", Resolution.HOUR).symbol\n\n        # Saving data here for demonstration and regression testing purposes.\n        # In real scenarios, data has to be saved to the object store before the algorithm starts.\n        self.save_data_to_object_store()\n\n        self.received_data = []\n\n    def on_data(self, slice: Slice):\n        if slice.contains_key(self.custom_symbol):\n            custom_data = slice.get(ExampleCustomData, self.custom_symbol)\n            if custom_data.price == 0:\n                raise AssertionError(\"Custom data price was not expected to be zero\")\n\n            self.received_data.append(custom_data)\n\n    def on_end_of_algorithm(self):\n        if not self.received_data:\n            raise AssertionError(\"Custom data was not fetched\")\n\n        custom_security = self.securities[self.custom_symbol]\n        if custom_security is None or custom_security.price == 0:\n            raise AssertionError(\"Expected the custom security to be added to the algorithm securities and to have a price that is not zero\")\n\n        # Make sure history requests work as expected\n        history = self.history(ExampleCustomData, self.custom_symbol, self.start_date, self.end_date, Resolution.HOUR)\n\n        if history.shape[0] != len(self.received_data):\n            raise AssertionError(\"History request returned more or less data than expected\")\n\n        for i in range(len(self.received_data)):\n            received_data = self.received_data[i]\n            if (history.index[i][0] != received_data.symbol or\n                history.index[i][1] != received_data.time or\n                history[[\"value\"]].values[i][0] != received_data.value or\n                history[[\"open\"]].values[i][0] != received_data.open or\n                history[[\"high\"]].values[i][0] != received_data.high or\n                history[[\"low\"]].values[i][0] != received_data.low or\n                history[[\"close\"]].values[i][0] != received_data.close):\n                raise AssertionError(\"History request returned different data than expected\")\n\n    def get_custom_data_key(self):\n        return \"CustomData/ExampleCustomData\"\n\n    def save_data_to_object_store(self):\n        self.object_store.save(self.get_custom_data_key(), self.custom_data)\n\nclass ExampleCustomData(PythonData):\n    custom_data_key = \"\"\n\n    def get_source(self, config, date, is_live):\n        return SubscriptionDataSource(self.custom_data_key, SubscriptionTransportMedium.OBJECT_STORE, FileFormat.CSV)\n\n    def reader(self, config, line, date, is_live):\n        data = line.split(',')\n        obj_data = ExampleCustomData()\n        obj_data.symbol = config.symbol\n        obj_data.time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S')\n        obj_data.value = float(data[4])\n        obj_data[\"Open\"] = float(data[1])\n        obj_data[\"High\"] = float(data[2])\n        obj_data[\"Low\"] = float(data[3])\n        obj_data[\"Close\"] = float(data[4])\n        return obj_data\n"
  },
  {
    "path": "Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport json\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test to demonstrate setting custom Symbol Properties and Market Hours for a custom data import\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"importing data\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"crypto\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass CustomDataPropertiesRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2020, 1, 5)   # Set Start Date\n        self.set_end_date(2020, 1, 10)    # Set End Date\n        self.set_cash(100000)             # Set Strategy Cash\n\n        # Define our custom data properties and exchange hours\n        ticker = 'BTC'\n        properties = SymbolProperties(\"Bitcoin\", \"USD\", 1, 0.01, 0.01, ticker)\n        exchange_hours = SecurityExchangeHours.always_open(TimeZones.NEW_YORK)\n\n        # Add the custom data to our algorithm with our custom properties and exchange hours\n        self._bitcoin = self.add_data(Bitcoin, ticker, properties, exchange_hours, leverage=1, fill_forward=False)\n\n        # Verify our symbol properties were changed and loaded into this security\n        if self._bitcoin.symbol_properties != properties :\n            raise AssertionError(\"Failed to set and retrieve custom SymbolProperties for BTC\")\n\n        # Verify our exchange hours were changed and loaded into this security\n        if self._bitcoin.exchange.hours != exchange_hours :\n            raise AssertionError(\"Failed to set and retrieve custom ExchangeHours for BTC\")\n\n        # For regression purposes on AddData overloads, this call is simply to ensure Lean can accept this\n        # with default params and is not routed to a breaking function.\n        self.add_data(Bitcoin, \"BTCUSD\")\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            if data['BTC'].close != 0 :\n                self.order('BTC', self.portfolio.margin_remaining/abs(data['BTC'].close + 1))\n\n    def on_end_of_algorithm(self) -> None:\n        #Reset our Symbol property value, for testing purposes.\n        self.symbol_properties_database.set_entry(Market.USA, self.market_hours_database.get_database_symbol_key(self._bitcoin.symbol), SecurityType.BASE,\n            SymbolProperties.get_default(\"USD\"))\n\n\nclass Bitcoin(PythonData):\n    '''Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data'''\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        if is_live_mode:\n            return SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.REST)\n\n        #return \"http://my-ftp-server.com/futures-data-\" + date.to_string(\"Ymd\") + \".zip\"\n        # OR simply return a fixed small data file. Large files will slow down your backtest\n        subscription = SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/nasdaq/api/v3/datatables/QDL/BITFINEX.csv?code=BTCUSD&api_key=WyAazVXnq7ATy_fefTqm\")\n        subscription.sort = True\n        return subscription\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> DynamicData:\n        coin = Bitcoin()\n        coin.symbol = config.symbol\n\n        if is_live_mode:\n            # Example Line Format:\n            # {\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n            try:\n                live_btc = json.loads(line)\n\n                # If value is zero, return None\n                value = live_btc[\"last\"]\n                if value == 0: return coin\n\n                coin.time = datetime.now()\n                coin.value = value\n                coin[\"Open\"] = float(live_btc[\"open\"])\n                coin[\"High\"] = float(live_btc[\"high\"])\n                coin[\"Low\"] = float(live_btc[\"low\"])\n                coin[\"Close\"] = float(live_btc[\"last\"])\n                coin[\"Ask\"] = float(live_btc[\"ask\"])\n                coin[\"Bid\"] = float(live_btc[\"bid\"])\n                coin[\"VolumeBTC\"] = float(live_btc[\"volume\"])\n                coin[\"WeightedPrice\"] = float(live_btc[\"vwap\"])\n                return coin\n            except ValueError:\n                # Do nothing, possible error in json decoding\n                return coin\n\n        # Example Line Format:\n        #code    date        high     low      mid      last     bid      ask      volume\n        #BTCUSD  2024-10-08  63248.0  61940.0  62246.5  62245.0  62246.0  62247.0       5.929230648356\n        if not (line.strip() and line[7].isdigit()): return coin\n\n        try:\n            data = line.split(',')\n            coin.time = datetime.strptime(data[1], \"%Y-%m-%d\")\n            coin.end_time = coin.time + timedelta(1)\n            coin.value = float(data[5])\n            coin[\"High\"] = float(data[2])\n            coin[\"Low\"] = float(data[3])\n            coin[\"Mid\"] = float(data[4])\n            coin[\"Close\"] = float(data[5])\n            coin[\"Bid\"] = float(data[6])\n            coin[\"Ask\"] = float(data[7])\n            coin[\"VolumeBTC\"] = float(data[8])\n            return coin\n\n        except ValueError:\n            # Do nothing, possible error in json decoding\n            return coin\n"
  },
  {
    "path": "Algorithm.Python/CustomDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport json\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test to demonstrate importing and trading on custom data.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"importing data\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"crypto\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass CustomDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2020,1,5)   # Set Start Date\n        self.set_end_date(2020,1,10)     # Set End Date\n        self.set_cash(100000)           # Set Strategy Cash\n\n        resolution = Resolution.SECOND if self.live_mode else Resolution.DAILY\n        self.add_data(Bitcoin, \"BTC\", resolution)\n\n        seeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(lambda x: seeder.seed_security(x))\n        self._warmed_up_checked = False\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            if data['BTC'].close != 0 :\n                self.order('BTC', self.portfolio.margin_remaining/abs(data['BTC'].close + 1))\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        changes.filter_custom_securities = False\n        for added_security in changes.added_securities:\n            if added_security.symbol.value == \"BTC\":\n                self._warmed_up_checked = True\n            if not added_security.has_data:\n                raise ValueError(f\"Security {added_security.symbol} was not warmed up!\")\n\n    def on_end_of_algorithm(self) -> None:\n        if not self._warmed_up_checked:\n            raise ValueError(\"Security was not warmed up!\")\n\nclass Bitcoin(PythonData):\n    '''Custom Data Type: Bitcoin data from Quandl - https://data.nasdaq.com/databases/BCHAIN'''\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        if is_live_mode:\n            return SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.REST)\n\n        #return \"http://my-ftp-server.com/futures-data-\" + date.to_string(\"Ymd\") + \".zip\"\n        # OR simply return a fixed small data file. Large files will slow down your backtest\n        subscription = SubscriptionDataSource(\"https://www.quantconnect.com/api/v2/proxy/nasdaq/api/v3/datatables/QDL/BITFINEX.csv?code=BTCUSD&api_key=WyAazVXnq7ATy_fefTqm\")\n        subscription.sort = True\n        return subscription\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> DynamicData:\n        coin = Bitcoin()\n        coin.symbol = config.symbol\n\n        if is_live_mode:\n            # Example Line Format:\n            # {\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n            try:\n                live_btc = json.loads(line)\n\n                # If value is zero, return coin\n                value = live_btc[\"last\"]\n                if value == 0:\n                    return coin\n\n                coin.time = datetime.now()\n                coin.value = value\n                coin[\"Open\"] = float(live_btc[\"open\"])\n                coin[\"High\"] = float(live_btc[\"high\"])\n                coin[\"Low\"] = float(live_btc[\"low\"])\n                coin[\"Close\"] = float(live_btc[\"last\"])\n                coin[\"Ask\"] = float(live_btc[\"ask\"])\n                coin[\"Bid\"] = float(live_btc[\"bid\"])\n                coin[\"VolumeBTC\"] = float(live_btc[\"volume\"])\n                coin[\"WeightedPrice\"] = float(live_btc[\"vwap\"])\n                return coin\n            except ValueError:\n                # Do nothing, possible error in json decoding\n                return coin\n\n        # Example Line Format:\n        # code    date        high     low      mid      last     bid      ask      volume\n        # BTCUSD  2024-10-08  63248.0  61940.0  62246.5  62245.0  62246.0  62247.0  477.91102114\n        if not (line.strip() and line[7].isdigit()): return coin\n\n        try:\n            data = line.split(',')\n            coin.time = datetime.strptime(data[1], \"%Y-%m-%d\")\n            coin.end_time = coin.time + timedelta(days=1)\n            coin.value = float(data[5])\n            coin[\"High\"] = float(data[2])\n            coin[\"Low\"] = float(data[3])\n            coin[\"Mid\"] = float(data[4])\n            coin[\"Close\"] = float(data[5])\n            coin[\"Bid\"] = float(data[6])\n            coin[\"Ask\"] = float(data[7])\n            coin[\"VolumeBTC\"] = float(data[8])\n            return coin\n\n        except ValueError:\n            # Do nothing, possible error in json decoding\n            return coin\n"
  },
  {
    "path": "Algorithm.Python/CustomDataSecurityCacheGetDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomDataRegressionAlgorithm import Bitcoin\n\n### <summary>\n### Regression algorithm used to verify that get_data(type) correctly retrieves\n### the latest custom data stored in the security cache.\n### </summary>\nclass CustomDataSecurityCacheGetDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2020,1,5)\n        self.set_end_date(2020,1,10)\n\n        self.add_data(Bitcoin, \"BTC\", Resolution.DAILY)\n\n        seeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(lambda x: seeder.seed_security(x))\n\n    def on_data(self, data: Slice) -> None:\n        bitcoin = self.securities['BTC'].cache.get_data(Bitcoin)\n        if bitcoin is None:\n            raise RegressionTestException(\"Expected Bitcoin data in cache, but none was found\")\n        if bitcoin.value == 0:\n            raise RegressionTestException(\"Expected Bitcoin value to be non-zero\")\n        \n        bitcoin_from_slice = list(data.get(Bitcoin).values())[0]\n        if bitcoin_from_slice != bitcoin:\n            raise RegressionTestException(\"Expected cached Bitcoin to match the one from Slice\")\n"
  },
  {
    "path": "Algorithm.Python/CustomDataTypeHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### </summary>\nclass CustomDataTypeHistoryAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2017, 8, 20)\n        self.set_end_date(2017, 8, 20)\n\n        self._symbol = self.add_data(CustomDataType, \"CustomDataType\", Resolution.HOUR).symbol\n\n        history = list(self.history[CustomDataType](self._symbol, 48, Resolution.HOUR))\n\n        if len(history) == 0:\n            raise AssertionError(\"History request returned no data\")\n\n        self._assert_history_data(history)\n\n        history2 = list(self.history[CustomDataType]([self._symbol], 48, Resolution.HOUR))\n\n        if len(history2) != len(history):\n            raise AssertionError(\"History requests returned different data\")\n\n        self._assert_history_data([y.values()[0] for y in history2])\n\n    def _assert_history_data(self, history:  List[PythonData]) -> None:\n        expected_keys = ['open', 'close', 'high', 'low', 'some_property']\n        if any(any(not x[key] for key in expected_keys)\n               or x[\"some_property\"] != \"some property value\"\n               for x in history):\n            raise AssertionError(\"History request returned data without the expected properties\")\n\nclass CustomDataType(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        source = \"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\"\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.REMOTE_FILE)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        if not (line.strip()):\n            return None\n\n        data = line.split(',')\n        obj_data = CustomDataType()\n        obj_data.symbol = config.symbol\n\n        try:\n            obj_data.time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S') + timedelta(hours=20)\n            obj_data[\"open\"] = float(data[1])\n            obj_data[\"high\"] = float(data[2])\n            obj_data[\"low\"] = float(data[3])\n            obj_data[\"close\"] = float(data[4])\n            obj_data.value = obj_data[\"close\"]\n\n            # property for asserting the correct data is fetched\n            obj_data[\"some_property\"] = \"some property value\"\n        except ValueError:\n            return None\n\n        return obj_data\n"
  },
  {
    "path": "Algorithm.Python/CustomDataUniverseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm shows how to grab symbols from an external api each day\n### and load data using the universe selection feature. In this example we\n### define a custom data type for the NYSE top gainers and then short the\n### top 2 gainers each day\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"custom universes\" />\nclass CustomDataUniverseAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        # Data ADDED via universe selection is added with Daily resolution.\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2015,1,5)\n        self.set_end_date(2015,7,1)\n        self.set_cash(100000)\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.set_benchmark(\"SPY\")\n\n        # add a custom universe data source (defaults to usa-equity)\n        self.add_universe(NyseTopGainers, \"universe-nyse-top-gainers\", Resolution.DAILY, self.nyse_top_gainers)\n    \n    def nyse_top_gainers(self, data):\n        return [ x.symbol for x in data if x[\"TopGainersRank\"] <= 2 ]\n\n\n    def on_data(self, slice):\n        pass\n    \n    def on_securities_changed(self, changes):\n        self._changes = changes\n\n        for security in changes.removed_securities:\n            #  liquidate securities that have been removed\n            if security.invested:\n                self.liquidate(security.symbol)\n                self.log(\"Exit {0} at {1}\".format(security.symbol, security.close))\n\n        for security in changes.added_securities:\n            # enter short positions on new securities\n            if not security.invested and security.close != 0:\n                qty = self.calculate_order_quantity(security.symbol, -0.25)\n                self.market_on_open_order(security.symbol, qty)\n                self.log(\"Enter {0} at {1}\".format(security.symbol, security.close))\n\n        \nclass NyseTopGainers(PythonData):\n    def __init__(self):\n        self.count = 0\n        self.last_date = datetime.min\n\n    def get_source(self, config, date, is_live_mode):\n        url = \"http://www.wsj.com/mdc/public/page/2_3021-gainnyse-gainer.html\" if is_live_mode else \\\n            \"https://www.dropbox.com/s/vrn3p38qberw3df/nyse-gainers.csv?dl=1\"\n\n        return SubscriptionDataSource(url, SubscriptionTransportMedium.REMOTE_FILE)\n    \n    def reader(self, config, line, date, is_live_mode):\n        \n        if not is_live_mode:\n            # backtest gets data from csv file in dropbox\n            if not (line.strip() and line[0].isdigit()): return None\n            csv = line.split(',')\n            nyse = NyseTopGainers()\n            nyse.time = datetime.strptime(csv[0], \"%Y%m%d\")\n            nyse.end_time = nyse.time + timedelta(1)\n            nyse.symbol = Symbol.create(csv[1], SecurityType.EQUITY, Market.USA)\n            nyse[\"TopGainersRank\"] = int(csv[2])\n            return nyse\n\n        if self.last_date != date:\n            # reset our counter for the new day\n            self.last_date = date\n            self.count = 0\n        \n        # parse the html into a symbol\n        if not line.startswith('<a href=\\\"/public/quotes/main.html?symbol='):\n            # we're only looking for lines that contain the symbols\n            return None\n        \n        last_close_paren = line.rfind(')')\n        last_open_paren = line.rfind('(')\n        if last_open_paren == -1 or last_close_paren == -1:\n            return None\n\n        symbol_string = line[last_open_paren + 1:last_close_paren]\n        nyse = NyseTopGainers()\n        nyse.time = date\n        nyse.end_time = nyse.time + timedelta(1)\n        nyse.symbol = Symbol.create(symbol_string, SecurityType.EQUITY, Market.USA)\n        nyse[\"TopGainersRank\"] = self.count\n        self.count = self.count + 1\n        return nyse\n"
  },
  {
    "path": "Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Custom data universe selection regression algorithm asserting it's behavior. See GH issue #6396\n### </summary>\nclass CustomDataUniverseRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 3, 31)\n\n        self.current_underlying_symbols = set()\n        self.universe_settings.resolution = Resolution.DAILY\n        self.add_universe(CoarseFundamental, \"custom-data-universe\", self.selection)\n\n        self._selection_time = [datetime(2014, 3, 24), datetime(2014, 3, 25), datetime(2014, 3, 26),\n                              datetime(2014, 3, 27), datetime(2014, 3, 28), datetime(2014, 3, 29)]\n\n    def selection(self, coarse):\n        self.debug(f\"Universe selection called: {self.time} Count: {len(coarse)}\")\n\n        expected_time = self._selection_time.pop(0)\n        if expected_time != self.time:\n            raise ValueError(f\"Unexpected selection time {self.time} expected {expected_time}\")\n\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        underlying_symbols = [ x.symbol for x in sorted_by_dollar_volume[:10] ]\n        custom_symbols = []\n        for symbol in underlying_symbols:\n            custom_symbols.append(Symbol.create_base(MyPyCustomData, symbol))\n        return underlying_symbols + custom_symbols\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            custom_data = data.get(MyPyCustomData)\n            if len(custom_data) > 0:\n                for symbol in sorted(self.current_underlying_symbols, key=lambda x: x.id.symbol):\n                    if not self.securities[symbol].has_data:\n                        continue\n                    self.set_holdings(symbol, 1 / len(self.current_underlying_symbols))\n\n                    if len([x for x in custom_data.keys() if x.underlying == symbol]) == 0:\n                        raise ValueError(f\"Custom data was not found for symbol {symbol}\")\n\n    def on_end_of_algorithm(self):\n        if len(self._selection_time) != 0:\n            raise ValueError(f\"Unexpected selection times, missing {len(self._selection_time)}\")\n\n    def on_securities_changed(self, changes):\n        for security in changes.added_securities:\n            if security.symbol.security_type == SecurityType.BASE:\n                continue\n            self.current_underlying_symbols.add(security.symbol)\n\n        for security in changes.removed_securities:\n            if (security.symbol.security_type == SecurityType.BASE or\n                # This check can be removed after GH issue #9055 is resolved\n                not security.symbol in self.current_underlying_symbols):\n                continue\n            self.current_underlying_symbols.remove(security.symbol)\n\nclass MyPyCustomData(PythonData):\n\n    def get_source(self, config, date, is_live_mode):\n        source = f\"{Globals.data_folder}/equity/usa/daily/{LeanData.generate_zip_file_name(config.symbol, date, config.resolution, config.tick_type)}\"\n        return SubscriptionDataSource(source)\n\n    def reader(self, config, line, date, is_live_mode):\n        csv = line.split(',')\n        _scaleFactor = 1 / 10000\n\n        custom = MyPyCustomData()\n        custom.symbol = config.symbol\n        custom.time =  datetime.strptime(csv[0], '%Y%m%d %H:%M')\n        custom.open = float(csv[1]) * _scaleFactor\n        custom.high = float(csv[2]) * _scaleFactor\n        custom.low = float(csv[3]) * _scaleFactor\n        custom.close = float(csv[4]) * _scaleFactor\n        custom.value = float(csv[4]) * _scaleFactor\n        custom.period = Time.ONE_DAY\n        custom.end_time = custom.time + custom.period\n\n        return custom\n"
  },
  {
    "path": "Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Custom data universe selection regression algorithm asserting it's behavior. Similar to CustomDataUniverseRegressionAlgorithm but with a custom schedule\n### </summary>\nclass CustomDataUniverseScheduledRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 3, 31)\n\n        self.current_underlying_symbols = []\n        self._selection_time = [datetime(2014, 3, 25), datetime(2014, 3, 27), datetime(2014, 3, 29)]\n        self.universe_settings.resolution = Resolution.DAILY\n        self.universe_settings.schedule.on(self.date_rules.on(self._selection_time))\n        self.add_universe(CoarseFundamental, \"custom-data-universe\", self.universe_settings, self.selection)\n\n        # This use case is also valid/same because it will use the algorithm settings by default\n        # self.add_universe(CoarseFundamental, \"custom-data-universe\", self.selection)\n\n    def selection(self, coarse):\n        self.debug(f\"Universe selection called: {self.time} Count: {len(coarse)}\")\n\n        expected_time = self._selection_time.pop(0)\n        if expected_time != self.time:\n            raise ValueError(f\"Unexpected selection time {self.time} expected {expected_time}\")\n\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        underlying_symbols = [ x.symbol for x in sorted_by_dollar_volume[:10] ]\n        custom_symbols = []\n        for symbol in underlying_symbols:\n            custom_symbols.append(Symbol.create_base(MyPyCustomData, symbol))\n        return underlying_symbols + custom_symbols\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            custom_data = data.get(MyPyCustomData)\n            if len(custom_data) > 0:\n                for symbol in self.current_underlying_symbols:\n                    self.set_holdings(symbol, 1 / len(self.current_underlying_symbols))\n\n                    if len([x for x in custom_data.keys() if x.underlying == symbol]) == 0:\n                        raise ValueError(f\"Custom data was not found for symbol {symbol}\")\n        # equity daily data arrives at 16 pm but custom data is set to arrive at midnight\n        self.current_underlying_symbols = [symbol for symbol in data.keys() if symbol.security_type is SecurityType.EQUITY]\n\n    def on_end_of_algorithm(self):\n        if len(self._selection_time) != 0:\n            raise ValueError(f\"Unexpected selection times, missing {len(self._selection_time)}\")\n\nclass MyPyCustomData(PythonData):\n\n    def get_source(self, config, date, is_live_mode):\n        source = f\"{Globals.data_folder}/equity/usa/daily/{LeanData.generate_zip_file_name(config.symbol, date, config.resolution, config.tick_type)}\"\n        return SubscriptionDataSource(source)\n\n    def reader(self, config, line, date, is_live_mode):\n        csv = line.split(',')\n        _scaleFactor = 1 / 10000\n\n        custom = MyPyCustomData()\n        custom.symbol = config.symbol\n        custom.time =  datetime.strptime(csv[0], '%Y%m%d %H:%M')\n        custom.open = float(csv[1]) * _scaleFactor\n        custom.high = float(csv[2]) * _scaleFactor\n        custom.low = float(csv[3]) * _scaleFactor\n        custom.close = float(csv[4]) * _scaleFactor\n        custom.value = float(csv[4]) * _scaleFactor\n        custom.period = Time.ONE_DAY\n        custom.end_time = custom.time + custom.period\n\n        return custom\n"
  },
  {
    "path": "Algorithm.Python/CustomDataUsingMapFileRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm demonstrating use of map files with custom data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"rename event\" />\n### <meta name=\"tag\" content=\"map\" />\n### <meta name=\"tag\" content=\"mapping\" />\n### <meta name=\"tag\" content=\"map files\" />\nclass CustomDataUsingMapFileRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        self.set_start_date(2013, 6, 27)\n        self.set_end_date(2013, 7, 2)\n\n        self.initial_mapping = False\n        self.execution_mapping = False\n        self.foxa = Symbol.create(\"FOXA\", SecurityType.EQUITY, Market.USA)\n        self._symbol = self.add_data(CustomDataUsingMapping, self.foxa).symbol\n\n        for config in self.subscription_manager.subscription_data_config_service.get_subscription_data_configs(self._symbol):\n            if config.resolution != Resolution.MINUTE:\n                raise ValueError(\"Expected resolution to be set to Minute\")\n\n    def on_data(self, slice):\n        date = self.time.date()\n        if slice.symbol_changed_events.contains_key(self._symbol):\n            mapping_event = slice.symbol_changed_events[self._symbol]\n            self.log(\"{0} - Ticker changed from: {1} to {2}\".format(str(self.time), mapping_event.old_symbol, mapping_event.new_symbol))\n\n            if date == datetime(2013, 6, 27).date():\n                # we should Not receive the initial mapping event\n                if mapping_event.new_symbol != \"NWSA\" or mapping_event.old_symbol != \"FOXA\":\n                    raise AssertionError(\"Unexpected mapping event mapping_event\")\n                self.initial_mapping = True\n\n            if date == datetime(2013, 6, 29).date():\n                if mapping_event.new_symbol != \"FOXA\" or mapping_event.old_symbol != \"NWSA\":\n                    raise AssertionError(\"Unexpected mapping event mapping_event\")\n                self.set_holdings(self._symbol, 1)\n                self.execution_mapping = True\n\n    def on_end_of_algorithm(self):\n        if self.initial_mapping:\n            raise AssertionError(\"The ticker generated the initial rename event\")\n        if not self.execution_mapping:\n            raise AssertionError(\"The ticker did not rename throughout the course of its life even though it should have\")\n\nclass CustomDataUsingMapping(PythonData):\n    '''Test example custom data showing how to enable the use of mapping.\n    Implemented as a wrapper of existing NWSA->FOXA equity'''\n\n    def get_source(self, config, date, is_live_mode):\n        return TradeBar().get_source(SubscriptionDataConfig(config, CustomDataUsingMapping,\n            # create a new symbol as equity so we find the existing data files\n            Symbol.create(config.mapped_symbol, SecurityType.EQUITY, config.market)),\n            date,\n            is_live_mode)\n\n    def reader(self, config, line, date, is_live_mode):\n        return TradeBar.parse_equity(config, line, date)\n\n    def requires_mapping(self):\n        '''True indicates mapping should be done'''\n        return True\n\n    def is_sparse_data(self):\n        '''Indicates that the data set is expected to be sparse'''\n        return True\n\n    def default_resolution(self):\n        '''Gets the default resolution for this data and security type'''\n        return Resolution.MINUTE\n\n    def supported_resolutions(self):\n        '''Gets the supported resolution for this data and security type'''\n        return [ Resolution.MINUTE ]\n"
  },
  {
    "path": "Algorithm.Python/CustomDataZippedObjectStoreRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n\nfrom AlgorithmImports import *\n\nfrom CustomDataObjectStoreRegressionAlgorithm import *\n\n### <summary>\n### Regression algorithm demonstrating the use of zipped custom data sourced from the object store\n### </summary>\nclass CustomDataZippedObjectStoreRegressionAlgorithm(CustomDataObjectStoreRegressionAlgorithm):\n\n    def get_custom_data_key(self):\n        return \"CustomData/ExampleCustomData.zip\"\n\n    def save_data_to_object_store(self):\n        self.object_store.save_bytes(self.get_custom_data_key(), Compression.zip_bytes(list(bytes(self.custom_data, 'utf-8')), 'data'))\n\n"
  },
  {
    "path": "Algorithm.Python/CustomIndicatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom collections import deque\n\n### <summary>\n### Demonstrates how to create a custom indicator and register it for automatic updated\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"custom indicator\" />\nclass CustomIndicatorAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.add_equity(\"SPY\", Resolution.SECOND)\n\n        # Create a QuantConnect indicator and a python custom indicator for comparison\n        self._sma = self.sma(\"SPY\", 60, Resolution.MINUTE)\n        self._custom = CustomSimpleMovingAverage('custom', 60)\n\n        # The python custom class must inherit from PythonIndicator to enable Updated event handler\n        self._custom.updated += self.custom_updated\n\n        self._custom_window = RollingWindow(5)\n        self.register_indicator(\"SPY\", self._custom, Resolution.MINUTE)\n        self.plot_indicator('CSMA', self._custom)\n\n    def custom_updated(self, sender: object, updated: IndicatorDataPoint) -> None:\n        self._custom_window.add(updated)\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n        if self.time.second == 0:\n            self.log(f\"   sma -> IsReady: {self._sma.is_ready}. Value: {self._sma.current.value}\")\n            self.log(f\"custom -> IsReady: {self._custom.is_ready}. Value: {self._custom.value}\")\n\n        # Regression test: test fails with an early quit\n        diff = abs(self._custom.value - self._sma.current.value)\n        if diff > 1e-10:\n            self.quit(f\"Quit: indicators difference is {diff}\")\n\n    def on_end_of_algorithm(self) -> None:\n        for item in self._custom_window:\n            self.log(f'{item}')\n\n# Python implementation of SimpleMovingAverage.\n# Represents the traditional simple moving average indicator (SMA).\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name: str, period: int) -> None:\n        super().__init__()\n        self.name = name\n        self.value = 0\n        self._queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def update(self, input: IndicatorDataPoint) -> bool:\n        self._queue.appendleft(input.value)\n        count = len(self._queue)\n        self.value = np.sum(self._queue) / count\n        return count == self._queue.maxlen\n"
  },
  {
    "path": "Algorithm.Python/CustomIndicatorWithExtensionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom collections import deque\nfrom math import isclose\n\nclass CustomIndicatorWithExtensionAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 9)\n        self.set_end_date(2013, 10, 9)\n\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        self._sma_values = []\n        self._period = 10\n\n        self._sma = self.sma(self._spy, self._period, Resolution.MINUTE)\n        self._sma.updated += self.on_sma_updated\n\n        self._custom_sma = CustomSimpleMovingAverage(\"My SMA\", self._period)\n        self._ext = IndicatorExtensions.of(self._custom_sma, self._sma)\n        self._ext.updated += self.on_indicator_extension_updated\n\n        self._sma_minus_custom = IndicatorExtensions.minus(self._sma, self._custom_sma)\n        self._sma_minus_custom.updated += self.on_minus_updated\n\n        self._sma_was_updated = False\n        self._custom_sma_was_updated = False\n        self._sma_minus_custom_was_updated = False\n\n    def on_sma_updated(self, sender: object, updated: IndicatorDataPoint) -> None:\n        self._sma_was_updated = True\n\n        if self._sma.is_ready:\n            self._sma_values.append(self._sma.current.value)\n\n    def on_indicator_extension_updated(self, sender: object, updated: IndicatorDataPoint) -> None:\n        self._custom_sma_was_updated = True\n\n        sma_last_values = self._sma_values[-self._period:]\n        expected = sum(sma_last_values) / len(sma_last_values)\n\n        if not isclose(expected, self._custom_sma.value):\n            raise AssertionError(f\"Expected the custom SMA to calculate the moving average of the last {self._period} values of the SMA. \"\n                            f\"Current expected: {expected}. Actual {self._custom_sma.value}.\")\n\n        self.debug(f\"{self._sma.current.value} :: {self._custom_sma.value} :: {updated}\")\n\n    def on_minus_updated(self, sender: object, updated: IndicatorDataPoint) -> None:\n        self._sma_minus_custom_was_updated = True\n\n        expected = self._sma.current.value - self._custom_sma.value\n\n        if not isclose(expected, self._sma_minus_custom.current.value):\n            raise AssertionError(f\"Expected the composite minus indicator to calculate the difference between the SMA and custom SMA indicators. \"\n                            f\"Expected: {expected}. Actual {self._sma_minus_custom.current.value}.\")\n\n    def on_end_of_algorithm(self) -> None:\n        if not (self._sma_was_updated and self._custom_sma_was_updated and self._sma_minus_custom_was_updated):\n            raise AssertionError(\"Expected all indicators to have been updated.\")\n\n# Custom indicator\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name: str, period: int) -> None:\n        self.name = name\n        self.value = 0\n        self.warm_up_period = period\n        self._queue = deque(maxlen=period)\n\n    def update(self, input: BaseData) -> bool:\n        self._queue.appendleft(input.value)\n        count = len(self._queue)\n        self.value = sum(self._queue) / count\n\n        return count == self._queue.maxlen\n"
  },
  {
    "path": "Algorithm.Python/CustomMarginInterestRateModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of using custom margin interest rate model in backtesting.\n### </summary>\nclass CustomMarginInterestRateModelAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 1)\n        self.set_end_date(2013, 10, 31)\n\n        security = self.add_equity(\"SPY\", Resolution.HOUR)\n        self._spy = security.symbol\n\n        # set the margin interest rate model\n        self._margin_interest_rate_model = CustomMarginInterestRateModel()\n        security.set_margin_interest_rate_model(self._margin_interest_rate_model)\n\n        self._cash_after_order = 0\n\n    def on_data(self, data: Slice):\n        if not self.portfolio.invested:\n            self.set_holdings(self._spy, 1)\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status == OrderStatus.FILLED:\n            self._cash_after_order = self.portfolio.cash\n\n    def on_end_of_algorithm(self):\n        if self._margin_interest_rate_model.call_count == 0:\n            raise AssertionError(\"CustomMarginInterestRateModel was not called\")\n\n        expected_cash = self._cash_after_order * pow(1 + self._margin_interest_rate_model.interest_rate, self._margin_interest_rate_model.call_count)\n\n        if abs(self.portfolio.cash - expected_cash) > 1e-10:\n            raise AssertionError(f\"Expected cash {expected_cash} but got {self.portfolio.cash}\")\n\n\nclass CustomMarginInterestRateModel:\n    def __init__(self):\n        self.interest_rate = 0.01\n        self.call_count = 0\n\n    def apply_margin_interest_rate(self, parameters: MarginInterestRateParameters):\n        security = parameters.security\n        position_value = security.holdings.get_quantity_value(security.holdings.quantity)\n\n        if position_value.amount > 0:\n            position_value.cash.add_amount(self.interest_rate * position_value.cash.amount)\n            self.call_count += 1\n"
  },
  {
    "path": "Algorithm.Python/CustomModelsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport random\n\n### <summary>\n### Demonstration of using custom fee, slippage, fill, and buying power models for modelling transactions in backtesting.\n### QuantConnect allows you to model all orders as deeply and accurately as you need.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"transaction fees and slippage\" />\n### <meta name=\"tag\" content=\"custom buying power models\" />\n### <meta name=\"tag\" content=\"custom transaction models\" />\n### <meta name=\"tag\" content=\"custom slippage models\" />\n### <meta name=\"tag\" content=\"custom fee models\" />\nclass CustomModelsAlgorithm(QCAlgorithm):\n    '''Demonstration of using custom fee, slippage, fill, and buying power models for modelling transactions in backtesting.\n    QuantConnect allows you to model all orders as deeply and accurately as you need.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,1)   # Set Start Date\n        self.set_end_date(2013,10,31)    # Set End Date\n        self.security = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.spy = self.security.symbol\n\n        # set our models\n        self.security.set_fee_model(CustomFeeModel(self))\n        self.security.set_fill_model(CustomFillModel(self))\n        self.security.set_slippage_model(CustomSlippageModel(self))\n        self.security.set_buying_power_model(CustomBuyingPowerModel(self))\n\n    def on_data(self, data):\n        open_orders = self.transactions.get_open_orders(self.spy)\n        if len(open_orders) != 0: return\n\n        if self.time.day > 10 and self.security.holdings.quantity <= 0:\n            quantity = self.calculate_order_quantity(self.spy, .5)\n            self.log(f\"MarketOrder: {quantity}\")\n            self.market_order(self.spy, quantity, True)   # async needed for partial fill market orders\n\n        elif self.time.day > 20 and self.security.holdings.quantity >= 0:\n            quantity = self.calculate_order_quantity(self.spy, -.5)\n            self.log(f\"MarketOrder: {quantity}\")\n            self.market_order(self.spy, quantity, True)   # async needed for partial fill market orders\n\n# If we want to use methods from other models, you need to inherit from one of them\nclass CustomFillModel(ImmediateFillModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n        self.absolute_remaining_by_order_id = {}\n        self.random = Random(387510346)\n\n    def market_fill(self, asset, order):\n        absolute_remaining = order.absolute_quantity\n\n        if order.id in self.absolute_remaining_by_order_id.keys():\n            absolute_remaining = self.absolute_remaining_by_order_id[order.id]\n\n        fill = super().market_fill(asset, order)\n        absolute_fill_quantity = int(min(absolute_remaining, self.random.next(0, 2*int(order.absolute_quantity))))\n        fill.fill_quantity = np.sign(order.quantity) * absolute_fill_quantity\n\n        if absolute_remaining == absolute_fill_quantity:\n            fill.status = OrderStatus.FILLED\n            if self.absolute_remaining_by_order_id.get(order.id):\n                self.absolute_remaining_by_order_id.pop(order.id)\n        else:\n            absolute_remaining = absolute_remaining - absolute_fill_quantity\n            self.absolute_remaining_by_order_id[order.id] = absolute_remaining\n            fill.status = OrderStatus.PARTIALLY_FILLED\n        self.algorithm.log(f\"CustomFillModel: {fill}\")\n        return fill\n\nclass CustomFeeModel(FeeModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n\n    def get_order_fee(self, parameters):\n        # custom fee math\n        fee = max(1, parameters.security.price\n                  * parameters.order.absolute_quantity\n                  * 0.00001)\n        self.algorithm.log(f\"CustomFeeModel: {fee}\")\n        return OrderFee(CashAmount(fee, \"USD\"))\n\nclass CustomSlippageModel:\n    def __init__(self, algorithm):\n        self.algorithm = algorithm\n\n    def get_slippage_approximation(self, asset, order):\n        # custom slippage math\n        slippage = asset.price * 0.0001 * np.log10(2*float(order.absolute_quantity))\n        self.algorithm.log(f\"CustomSlippageModel: {slippage}\")\n        return slippage\n\nclass CustomBuyingPowerModel(BuyingPowerModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n\n    def has_sufficient_buying_power_for_order(self, parameters):\n        # custom behavior: this model will assume that there is always enough buying power\n        has_sufficient_buying_power_for_order_result = HasSufficientBuyingPowerForOrderResult(True)\n        self.algorithm.log(f\"CustomBuyingPowerModel: {has_sufficient_buying_power_for_order_result.is_sufficient}\")\n        return has_sufficient_buying_power_for_order_result\n\n# The simple fill model shows how to implement a simpler version of\n# the most popular order fills: Market, Stop Market and Limit\nclass SimpleCustomFillModel(FillModel):\n    def __init__(self):\n        super().__init__()\n\n    def _create_order_event(self, asset, order):\n        utc_time = Extensions.convert_to_utc(asset.local_time, asset.exchange.time_zone)\n        return OrderEvent(order, utc_time, OrderFee.ZERO)\n\n    def _set_order_event_to_filled(self, fill, fill_price, fill_quantity):\n        fill.status = OrderStatus.FILLED\n        fill.fill_quantity = fill_quantity\n        fill.fill_price = fill_price\n        return fill\n\n    def _get_trade_bar(self, asset, order_direction):\n        trade_bar = asset.cache.get_data(TradeBar)\n        if trade_bar: return trade_bar\n\n        # Tick-resolution data doesn't have TradeBar, use the asset price\n        price = asset.price\n        return TradeBar(asset.local_time, asset.symbol, price, price, price, price, 0)\n\n    def market_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED: return fill\n\n        return self._set_order_event_to_filled(fill,\n            asset.cache.ask_price \\\n                if order.direction == OrderDirection.BUY else asset.cache.bid_price,\n            order.quantity)\n\n    def stop_market_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED: return fill\n\n        stop_price = order.stop_price\n        trade_bar = self._get_trade_bar(asset, order.direction)\n\n        if order.direction == OrderDirection.SELL and trade_bar.low < stop_price:\n            return self._set_order_event_to_filled(fill, stop_price, order.quantity)\n\n        if order.direction == OrderDirection.BUY and trade_bar.high > stop_price:\n            return self._set_order_event_to_filled(fill, stop_price, order.quantity)\n\n        return fill\n\n    def limit_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED: return fill\n\n        limit_price = order.limit_price\n        trade_bar = self._get_trade_bar(asset, order.direction)\n\n        if order.direction == OrderDirection.SELL and trade_bar.high > limit_price:\n            return self._set_order_event_to_filled(fill, limit_price, order.quantity)\n\n        if order.direction == OrderDirection.BUY and trade_bar.low < limit_price:\n            return self._set_order_event_to_filled(fill, limit_price, order.quantity)\n\n        return fill\n"
  },
  {
    "path": "Algorithm.Python/CustomModelsPEP8Algorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport random\n\n### <summary>\n### Demonstration of using custom fee, slippage, fill, and buying power models for modeling transactions in backtesting.\n### QuantConnect allows you to model all orders as deeply and accurately as you need.\n### This example illustrates how Lean exports its API to Python conforming to PEP8 style guide.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"transaction fees and slippage\" />\n### <meta name=\"tag\" content=\"custom buying power models\" />\n### <meta name=\"tag\" content=\"custom transaction models\" />\n### <meta name=\"tag\" content=\"custom slippage models\" />\n### <meta name=\"tag\" content=\"custom fee models\" />\nclass CustomModelsPEP8Algorithm(QCAlgorithm):\n    '''Demonstration of using custom fee, slippage, fill, and buying power models for modeling transactions in backtesting.\n    QuantConnect allows you to model all orders as deeply and accurately as you need.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,1)   # Set Start Date\n        self.set_end_date(2013,10,31)    # Set End Date\n        self.security = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.spy = self.security.symbol\n\n        # set our models\n        self.security.set_fee_model(CustomFeeModelPEP8(self))\n        self.security.set_fill_model(CustomFillModelPEP8(self))\n        self.security.set_slippage_model(CustomSlippageModelPEP8(self))\n        self.security.set_buying_power_model(CustomBuyingPowerModelPEP8(self))\n\n    def on_data(self, data):\n        open_orders = self.transactions.get_open_orders(self.spy)\n        if len(open_orders) != 0: return\n        if self.time.day > 10 and self.security.holdings.quantity <= 0:\n            quantity = self.calculate_order_quantity(self.spy, .5)\n            self.log(f\"MarketOrder: {quantity}\")\n            self.market_order(self.spy, quantity, True)   # async needed for partial fill market orders\n        elif self.time.day > 20 and self.security.holdings.quantity >= 0:\n            quantity = self.calculate_order_quantity(self.spy, -.5)\n            self.log(f\"MarketOrder: {quantity}\")\n            self.market_order(self.spy, quantity, True)   # async needed for partial fill market orders\n\nclass CustomFillModelPEP8(ImmediateFillModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n        self.absolute_remaining_by_order_id = {}\n        self.random = Random(387510346)\n\n    def market_fill(self, asset, order):\n        absolute_remaining = order.absolute_quantity\n\n        if order.id in self.absolute_remaining_by_order_id.keys():\n            absolute_remaining = self.absolute_remaining_by_order_id[order.id]\n\n        fill = super().market_fill(asset, order)\n        absolute_fill_quantity = int(min(absolute_remaining, self.random.next(0, 2*int(order.absolute_quantity))))\n        fill.fill_quantity = np.sign(order.quantity) * absolute_fill_quantity\n\n        if absolute_remaining == absolute_fill_quantity:\n            fill.status = OrderStatus.FILLED\n            if self.absolute_remaining_by_order_id.get(order.id):\n                self.absolute_remaining_by_order_id.pop(order.id)\n        else:\n            absolute_remaining = absolute_remaining - absolute_fill_quantity\n            self.absolute_remaining_by_order_id[order.id] = absolute_remaining\n            fill.status = OrderStatus.PARTIALLY_FILLED\n        self.algorithm.log(f\"CustomFillModel: {fill}\")\n        return fill\n\nclass CustomFeeModelPEP8(FeeModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n\n    def get_order_fee(self, parameters):\n        # custom fee math\n        fee = max(1, parameters.security.price\n                  * parameters.order.absolute_quantity\n                  * 0.00001)\n        self.algorithm.log(f\"CustomFeeModel: {fee}\")\n        return OrderFee(CashAmount(fee, \"USD\"))\n\nclass CustomSlippageModelPEP8:\n    def __init__(self, algorithm):\n        self.algorithm = algorithm\n\n    def get_slippage_approximation(self, asset, order):\n        # custom slippage math\n        slippage = asset.price * 0.0001 * np.log10(2*float(order.absolute_quantity))\n        self.algorithm.log(f\"CustomSlippageModel: {slippage}\")\n        return slippage\n\nclass CustomBuyingPowerModelPEP8(BuyingPowerModel):\n    def __init__(self, algorithm):\n        super().__init__()\n        self.algorithm = algorithm\n\n    def has_sufficient_buying_power_for_order(self, parameters):\n        # custom behavior: this model will assume that there is always enough buying power\n        has_sufficient_buying_power_for_order_result = HasSufficientBuyingPowerForOrderResult(True)\n        self.algorithm.log(f\"CustomBuyingPowerModel: {has_sufficient_buying_power_for_order_result.is_sufficient}\")\n        return has_sufficient_buying_power_for_order_result\n\nclass SimpleCustomFillModelPEP8(FillModel):\n    def __init__(self):\n        super().__init__()\n\n    def _create_order_event(self, asset, order):\n        utc_time = Extensions.convert_to_utc(asset.local_time, asset.exchange.time_zone)\n        return OrderEvent(order, utc_time, OrderFee.ZERO)\n\n    def _set_order_event_to_filled(self, fill, fill_price, fill_quantity):\n        fill.status = OrderStatus.FILLED\n        fill.fill_quantity = fill_quantity\n        fill.fill_price = fill_price\n        return fill\n\n    def _get_trade_bar(self, asset, order_direction):\n        trade_bar = asset.cache.get_data(TradeBar)\n        if trade_bar:\n            return trade_bar\n\n        price = asset.price\n        return TradeBar(asset.local_time, asset.symbol, price, price, price, price, 0)\n\n    def market_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED:\n            return fill\n\n        fill_price = asset.cache.ask_price if order.direction == OrderDirection.BUY else asset.cache.bid_price\n        return self._set_order_event_to_filled(fill, fill_price, order.quantity)\n\n    def stop_market_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED:\n            return fill\n\n        stop_price = order.stop_price\n        trade_bar = self._get_trade_bar(asset, order.direction)\n\n        if order.direction == OrderDirection.SELL and trade_bar.low < stop_price:\n            return self._set_order_event_to_filled(fill, stop_price, order.quantity)\n\n        if order.direction == OrderDirection.BUY and trade_bar.high > stop_price:\n            return self._set_order_event_to_filled(fill, stop_price, order.quantity)\n\n        return fill\n\n    def limit_fill(self, asset, order):\n        fill = self._create_order_event(asset, order)\n        if order.status == OrderStatus.CANCELED:\n            return fill\n\n        limit_price = order.limit_price\n        trade_bar = self._get_trade_bar(asset, order.direction)\n\n        if order.direction == OrderDirection.SELL and trade_bar.high > limit_price:\n            return self._set_order_event_to_filled(fill, limit_price, order.quantity)\n\n        if order.direction == OrderDirection.BUY and trade_bar.low < limit_price:\n            return self._set_order_event_to_filled(fill, limit_price, order.quantity)\n\n        return fill\n"
  },
  {
    "path": "Algorithm.Python/CustomOptionAssignmentRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionAssignmentRegressionAlgorithm import *\n\n### <summary>\n### Regression algorithm asserting we can specify a custom option assignment\n### </summary>\nclass CustomOptionAssignmentRegressionAlgorithm(OptionAssignmentRegressionAlgorithm):\n    def initialize(self):\n        self.set_security_initializer(self.custom_security_initializer)\n        super().initialize()\n\n    def custom_security_initializer(self, security):\n        if Extensions.is_option(security.symbol.security_type):\n            # we have to be 10% in the money to get assigned\n            security.set_option_assignment_model(PyCustomOptionAssignmentModel(0.1))\n\n    def on_data(self, data):\n        super().on_data(data)\n\nclass PyCustomOptionAssignmentModel(DefaultOptionAssignmentModel):\n    def __init__(self, required_in_the_money_percent):\n        super().__init__(required_in_the_money_percent)\n\n    def get_assignment(self, parameters):\n        result = super().get_assignment(parameters)\n        result.tag = \"Custom Option Assignment\"\n        return result\n"
  },
  {
    "path": "Algorithm.Python/CustomOptionExerciseModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionAssignmentRegressionAlgorithm import OptionAssignmentRegressionAlgorithm\n\n### <summary>\n### Regression algorithm asserting we can specify a custom option exercise model\n### </summary>\nclass CustomOptionExerciseModelRegressionAlgorithm(OptionAssignmentRegressionAlgorithm):\n    def initialize(self):\n        self.set_security_initializer(self.custom_security_initializer)\n        super().initialize()\n\n    def custom_security_initializer(self, security):\n        if Extensions.is_option(security.symbol.security_type):\n            security.set_option_exercise_model(CustomExerciseModel())\n\n    def on_data(self, data):\n        super().on_data(data)\n\nclass CustomExerciseModel(DefaultExerciseModel):\n    def option_exercise(self, option: Option, order: OptionExerciseOrder):\n        order_event = OrderEvent(\n            order.id,\n            option.symbol,\n            Extensions.convert_to_utc(option.local_time, option.exchange.time_zone),\n            OrderStatus.FILLED,\n            Extensions.get_order_direction(order.quantity),\n            0.0,\n            order.quantity,\n            OrderFee.ZERO,\n            \"Tag\"\n        )\n        order_event.is_assignment = False\n        return [ order_event ]\n"
  },
  {
    "path": "Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test the creation and usage of a custom option price model\n### </summary>\nclass CustomOptionPriceModelRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        option = self.add_option(\"GOOG\")\n        self._option_symbol = option.symbol\n\n        option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))\n        self._option_price_model = CustomOptionPriceModel()\n        option.set_price_model(self._option_price_model)\n\n    def on_data(self, slice):\n        if self.portfolio.invested:\n            return\n\n        chain = slice.option_chains.get(self._option_symbol)\n        if not chain:\n            return\n\n        contracts = sorted(sorted(sorted(chain, \\\n            key = lambda x: abs(chain.underlying.price - x.strike)), \\\n            key = lambda x: x.expiry, reverse=True), \\\n            key = lambda x: x.right, reverse=True)\n\n        if len(contracts) == 0:\n            return\n        \n        if (contracts[0].theoretical_price > 0):\n            self.market_order(contracts[0].symbol, 1)\n    \n    def on_end_of_algorithm(self):\n        if self._option_price_model.evaluation_count == 0:\n            raise RegressionTestException(\"CustomOptionPriceModel.Evaluate() was never called\")\n\nclass CustomOptionPriceModel():\n    def __init__(self):\n        self.evaluation_count = 0\n\n    def evaluate(self, parameters):\n        self.evaluation_count += 1\n        contract = parameters.contract\n        underlying = contract.underlying_last_price\n        strike = contract.strike\n        greeks = Greeks(0.5, 0.2, 0.15, 0.05, 0.1, 2.0)\n        \n        if contract.right == OptionRight.CALL:\n            intrinsic = max(0, underlying - strike)\n        else:\n            intrinsic = max(0, strike - underlying)\n            # Delta and Rho are negative for a put\n            greeks.delta *= -1\n            greeks.rho *= -1\n        \n        theoretical_price = intrinsic + 1.0\n        implied_volatility = 0.2\n        \n        return OptionPriceModelResult(theoretical_price, implied_volatility, greeks)\n"
  },
  {
    "path": "Algorithm.Python/CustomPartialFillModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm that implements a fill model with partial fills\n### <meta name=\"tag\" content=\"trading and orders\" />\n### </summary>\nclass CustomPartialFillModelAlgorithm(QCAlgorithm):\n    '''Basic template algorithm that implements a fill model with partial fills'''\n\n    def initialize(self):\n        self.set_start_date(2019, 1, 1)\n        self.set_end_date(2019, 3, 1)\n\n        equity = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.spy = equity.symbol\n        self.holdings = equity.holdings\n\n        # Set the fill model\n        equity.set_fill_model(CustomPartialFillModel(self))\n\n\n    def on_data(self, data):\n        open_orders = self.transactions.get_open_orders(self.spy)\n        if len(open_orders) != 0: return\n\n        if self.time.day > 10 and self.holdings.quantity <= 0:\n            self.market_order(self.spy, 105, True)\n\n        elif self.time.day > 20 and self.holdings.quantity >= 0:\n            self.market_order(self.spy, -100, True)\n\n\nclass CustomPartialFillModel(FillModel):\n    '''Implements a custom fill model that inherit from FillModel. Override the MarketFill method to simulate partially fill orders'''\n\n    def __init__(self, algorithm):\n        self.algorithm = algorithm\n        self.absolute_remaining_by_order_id = {}\n\n    def market_fill(self, asset, order):\n        absolute_remaining = self.absolute_remaining_by_order_id.get(order.id, order. AbsoluteQuantity)\n\n        # Create the object\n        fill = super().market_fill(asset, order)\n\n        # Set the fill amount\n        fill.fill_quantity = np.sign(order.quantity) * 10\n\n        if (min(abs(fill.fill_quantity), absolute_remaining) == absolute_remaining):\n            fill.fill_quantity = np.sign(order.quantity) * absolute_remaining\n            fill.status = OrderStatus.FILLED\n            self.absolute_remaining_by_order_id.pop(order.id, None)\n        else:\n            fill.status = OrderStatus.PARTIALLY_FILLED\n            self.absolute_remaining_by_order_id[order.id] = absolute_remaining - abs(fill.fill_quantity)\n            price = fill.fill_price\n            # self.algorithm.debug(f\"{self.algorithm.time} - Partial Fill - Remaining {self.absolute_remaining_by_order_id[order.id]} Price - {price}\")\n\n        return fill\n"
  },
  {
    "path": "Algorithm.Python/CustomPortfolioOptimizerRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom MeanVarianceOptimizationFrameworkAlgorithm import MeanVarianceOptimizationFrameworkAlgorithm\n\n### <summary>\n### Regression algorithm asserting we can specify a custom portfolio\n### optimizer with a MeanVarianceOptimizationPortfolioConstructionModel\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass CustomPortfolioOptimizerRegressionAlgorithm(MeanVarianceOptimizationFrameworkAlgorithm):\n    def initialize(self):\n        super().initialize()\n        self.set_portfolio_construction(MeanVarianceOptimizationPortfolioConstructionModel(timedelta(days=1), PortfolioBias.LONG_SHORT, 1, 63, Resolution.DAILY, 0.02, CustomPortfolioOptimizer()))\n\nclass CustomPortfolioOptimizer:\n    def optimize(self, historical_returns, expected_returns, covariance):\n        return [0.5]*(np.array(historical_returns)).shape[1]\n"
  },
  {
    "path": "Algorithm.Python/CustomSecurityDataFilterRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting we can specify a custom security data filter\n### </summary>\nclass CustomSecurityDataFilterRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_cash(2500000)\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,7)\n\n        security = self.add_security(SecurityType.EQUITY, \"SPY\")\n        security.set_data_filter(CustomDataFilter())\n        self.data_points = 0\n\n    def on_data(self, data):\n        self.data_points += 1\n        self.set_holdings(\"SPY\", 0.2)\n        if self.data_points > 5:\n            raise AssertionError(\"There should not be more than 5 data points, but there were \" + str(self.data_points))\n\n\nclass CustomDataFilter(SecurityDataFilter):\n    def filter(self, vehicle: Security, data: BaseData) -> bool:\n        \"\"\"\n        Skip data after 9:35am\n        \"\"\"\n        if data.time >= datetime(2013,10,7,9,35,0):\n            return False\n        else:\n            return True\n"
  },
  {
    "path": "Algorithm.Python/CustomSecurityInitializerAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm shows how to set a custom security initializer.\n### A security initializer is run immediately after a new security object\n### has been created and can be used to security models and other settings,\n### such as data normalization mode\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass CustomSecurityInitializerAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        \n        # set our initializer to our custom type\n        self.set_brokerage_model(BrokerageName.INTERACTIVE_BROKERS_BROKERAGE)\n        \n        func_security_seeder = FuncSecuritySeeder(self.custom_seed_function)\n        self.set_security_initializer(CustomSecurityInitializer(self.brokerage_model, func_security_seeder, DataNormalizationMode.RAW))\n        \n        self.set_start_date(2013,10,1)\n        self.set_end_date(2013,11,1)\n\n        self.add_equity(\"SPY\", Resolution.HOUR)\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n    def custom_seed_function(self, security):\n\n        resolution = Resolution.HOUR\n\n        df = self.history(security.symbol, 1, resolution)\n        if df.empty:\n            return None\n\n        last_bar = df.unstack(level=0).iloc[-1]\n        date_time = last_bar.name.to_pydatetime()\n        open = last_bar.open.values[0]\n        high = last_bar.high.values[0]\n        low = last_bar.low.values[0]\n        close = last_bar.close.values[0]\n        volume = last_bar.volume.values[0]\n        return TradeBar(date_time, security.symbol, open, high, low, close, volume, Extensions.to_time_span(resolution))\n\n\nclass CustomSecurityInitializer(BrokerageModelSecurityInitializer):\n    '''Our custom initializer that will set the data normalization mode.\n    We sub-class the BrokerageModelSecurityInitializer so we can also\n    take advantage of the default model/leverage setting behaviors'''\n\n    def __init__(self, brokerage_model, security_seeder, data_normalization_mode):\n        '''Initializes a new instance of the CustomSecurityInitializer class with the specified normalization mode\n        brokerage_model -- The brokerage model used to get fill/fee/slippage/settlement models\n        security_seeder -- The security seeder to be used\n        data_normalization_mode -- The desired data normalization mode'''\n        self.base = BrokerageModelSecurityInitializer(brokerage_model, security_seeder)\n        self.data_normalization_mode = data_normalization_mode\n\n    def initialize(self, security):\n        '''Initializes the specified security by setting up the models\n        security -- The security to be initialized\n        seed_security -- True to seed the security, false otherwise'''\n        # first call the default implementation\n        self.base.initialize(security)\n\n        # now apply our data normalization mode\n        security.set_data_normalization_mode(self.data_normalization_mode)\n"
  },
  {
    "path": "Algorithm.Python/CustomSettlementModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomBrokerageModelRegressionAlgorithm import CustomBrokerageModel\n\n### <summary>\n### Regression algorithm to test we can specify a custom settlement model, and override some of its methods\n### </summary>\nclass CustomSettlementModelRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(10000)\n        self.spy = self.add_equity(\"SPY\", Resolution.DAILY)\n        self.set_settlement_model(self.spy)\n\n    def set_settlement_model(self, security):\n        self.set_brokerage_model(CustomBrokerageModelWithCustomSettlementModel())\n\n    def on_data(self, slice):\n        if self.portfolio.cash_book[Currencies.USD].amount == 10000:\n            parameters = ApplyFundsSettlementModelParameters(self.portfolio, self.spy, self.time, CashAmount(101, Currencies.USD), None)\n            self.spy.settlement_model.apply_funds(parameters)\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.cash_book[Currencies.USD].amount != 10101:\n            raise AssertionError(f\"It was expected to have 10101 USD in Portfolio, but was {self.portfolio.cash_book[Currencies.USD].amount}\")\n        parameters = ScanSettlementModelParameters(self.portfolio, self.spy, datetime(2013, 10, 6))\n        self.spy.settlement_model.scan(parameters)\n        if self.portfolio.cash_book[Currencies.USD].amount != 10000:\n            raise AssertionError(f\"It was expected to have 10000 USD in Portfolio, but was {self.portfolio.cash_book[Currencies.USD].amount}\")\n\nclass CustomSettlementModel:\n    def apply_funds(self, parameters):\n        self.currency = parameters.cash_amount.currency\n        self.amount = parameters.cash_amount.amount\n        parameters.portfolio.cash_book[self.currency].add_amount(self.amount)\n\n    def scan(self, parameters):\n        if parameters.utc_time == datetime(2013, 10, 6):\n            parameters.portfolio.cash_book[self.currency].add_amount(-self.amount)\n\n    def get_unsettled_cash(self):\n        return None\n\nclass CustomBrokerageModelWithCustomSettlementModel(CustomBrokerageModel):\n    def get_settlement_model(self, security):\n        return CustomSettlementModel()\n"
  },
  {
    "path": "Algorithm.Python/CustomShortableProviderRegressionAlgorithm.py",
    "content": "### QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n### Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n###\n### Licensed under the Apache License, Version 2.0 (the \"License\");\n### you may not use this file except in compliance with the License.\n### You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n###\n### Unless required by applicable law or agreed to in writing, software\n### distributed under the License is distributed on an \"AS IS\" BASIS,\n### WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n### See the License for the specific language governing permissions and\n### limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting we can specify a custom Shortable Provider\n### </summary>\nclass CustomShortableProviderRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_cash(10000000)\n        self.set_start_date(2013,10,4)\n        self.set_end_date(2013,10,6)\n        self._spy = self.add_security(SecurityType.EQUITY, \"SPY\", Resolution.DAILY)\n        self._spy.set_shortable_provider(CustomShortableProvider())\n\n    def on_data(self, data: Slice) -> None:\n        spy_shortable_quantity = self._spy.shortable_provider.shortable_quantity(self._spy.symbol, self.time)\n        if spy_shortable_quantity and spy_shortable_quantity > 1000:\n            self._order_id = self.sell(\"SPY\", int(spy_shortable_quantity)).order_id\n\n    def on_end_of_algorithm(self) -> None:\n        transactions = self.transactions.orders_count\n        if transactions != 1:\n            raise AssertionError(\"Algorithm should have just 1 order, but was \" + str(transactions))\n\n        order_quantity = self.transactions.get_order_by_id(self._order_id).quantity\n        if order_quantity != -1001:\n            raise AssertionError(f\"Quantity of order {self._order_id} should be -1001 but was {order_quantity}\")\n        \n        fee_rate = self._spy.shortable_provider.fee_rate(self._spy.symbol, self.time)\n        if fee_rate != 0.0025:\n            raise AssertionError(f\"Fee rate should be 0.0025, but was {fee_rate}\")\n        rebate_rate = self._spy.shortable_provider.rebate_rate(self._spy.symbol, self.time)\n        if rebate_rate != 0.0507:\n            raise AssertionError(f\"Rebate rate should be 0.0507, but was {rebate_rate}\")\n\nclass CustomShortableProvider(NullShortableProvider):\n    def fee_rate(self, symbol: Symbol, local_time: datetime) -> float:\n        return 0.0025\n    def rebate_rate(self, symbol: Symbol, local_time: datetime) -> float:\n        return 0.0507\n    def shortable_quantity(self, symbol: Symbol, local_time: datetime) -> int:\n        if local_time < datetime(2013,10,4,16,0,0):\n            return 10\n        return 1001\n"
  },
  {
    "path": "Algorithm.Python/CustomSignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### his algorithm sends a list of portfolio targets to custom endpoint\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\nclass CustomSignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        ''' Initialize the date and add all equity symbols present in list _symbols '''\n\n        self.set_start_date(2013, 10, 7)   #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n\n        # Our custom signal export accepts all asset types\n        self.add_equity(\"SPY\", Resolution.SECOND)\n        self.add_crypto(\"BTCUSD\", Resolution.SECOND)\n        self.add_forex(\"EURUSD\", Resolution.SECOND)\n        self.add_future_contract(Symbol.create_future(\"ES\", Market.CME, datetime(2023, 12, 15)))\n        self.add_option_contract(Symbol.create_option(\"SPY\", Market.USA, OptionStyle.AMERICAN, OptionRight.CALL, 130, datetime(2023, 9, 1)))\n\n        # Set CustomSignalExport signal export provider.\n        self.signal_export.add_signal_export_provider(CustomSignalExport())\n\n    def on_data(self, data: Slice) -> None:\n        '''Buy and hold EURUSD and SPY'''\n        for ticker in [ \"SPY\", \"EURUSD\", \"BTCUSD\" ]:\n            if not self.portfolio[ticker].invested and self.securities[ticker].has_data:\n                self.set_holdings(ticker, 0.5)\n\nfrom requests import post\nclass CustomSignalExport:\n    def send(self, parameters: SignalExportTargetParameters) -> bool:\n        targets = [PortfolioTarget.percent(parameters.algorithm, x.symbol, x.quantity)\n                   for x in parameters.targets]\n        data = [ {'symbol' : x.symbol.value, 'quantity': x.quantity} for x in targets ]\n        response = post(\"http://localhost:5000/\", json = data)\n        result = response.json()\n        success = result.get('success', False)\n        parameters.algorithm.log(f\"Send #{len(parameters.targets)} targets. Success: {success}\")\n        return success\n\n    def dispose(self):\n        pass\n\n'''\n# To test the algorithm, you can create a simple Python Flask application (app.py) and run flask\n# $ flask --app app run\n\n# app.py:\nfrom flask import Flask, request, jsonify\nfrom json import loads\napp = Flask(__name__)\n@app.post('/')\ndef handle_positions():\n    result = loads(request.data)\n    print(result)\n    return jsonify({'success': True,'message': f'{len(result)} positions received'})\nif __name__ == '__main__':\n    app.run(debug=True)\n'''\n"
  },
  {
    "path": "Algorithm.Python/CustomUniverseSelectionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\n### <summary>\n### Regression algorithm showing how to implement a custom universe selection model and asserting it's behavior\n### </summary>\nclass CustomUniverseSelectionModelRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014,3,24)\n        self.set_end_date(2014,4,7)\n\n        self.universe_settings.resolution = Resolution.DAILY\n        self.set_universe_selection(MyCustomUniverseSelectionModel())\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            for kvp in self.active_securities:\n                self.set_holdings(kvp.key, 0.1)\n\nclass MyCustomUniverseSelectionModel(FundamentalUniverseSelectionModel):\n\n    def __init__(self, universe_settings = None):\n        super().__init__(universe_settings)\n        self._selected = False\n\n    def select(self, algorithm, fundamental):\n        if not self._selected:\n            self._selected = True\n            return [ Symbol.create('AAPL', SecurityType.EQUITY, Market.USA) ]\n        return Universe.UNCHANGED\n"
  },
  {
    "path": "Algorithm.Python/CustomVolatilityModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example of custom volatility model \n### </summary>\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"reality modelling\" />\nclass CustomVolatilityModelAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2015,7,15)     #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.equity = self.add_equity(\"SPY\", Resolution.DAILY)\n        self.equity.set_volatility_model(CustomVolatilityModel(10))\n\n\n    def on_data(self, data):\n        if not self.portfolio.invested and self.equity.volatility_model.volatility > 0:\n            self.set_holdings(\"SPY\", 1)\n\n\n# Python implementation of StandardDeviationOfReturnsVolatilityModel\n# Computes the annualized sample standard deviation of daily returns as the volatility of the security\n# https://github.com/QuantConnect/Lean/blob/master/Common/Securities/Volatility/StandardDeviationOfReturnsVolatilityModel.cs\nclass CustomVolatilityModel():\n    def __init__(self, periods):\n        self.last_update = datetime.min\n        self.last_price = 0\n        self.needs_update = False\n        self.period_span = timedelta(1)\n        self.window = RollingWindow(periods)\n\n        # Volatility is a mandatory attribute\n        self.volatility = 0\n\n    # Updates this model using the new price information in the specified security instance\n    # Update is a mandatory method\n    def update(self, security, data):\n        time_since_last_update = data.end_time - self.last_update\n        if time_since_last_update >= self.period_span and data.price > 0:\n            if self.last_price > 0:\n                self.window.add(float(data.price / self.last_price) - 1.0)\n                self.needs_update = self.window.is_ready\n            self.last_update = data.end_time\n            self.last_price = data.price\n\n        if self.window.count < 2:\n            self.volatility = 0\n            return\n\n        if self.needs_update:\n            self.needs_update = False\n            std = np.std([ x for x in self.window ])\n            self.volatility = std * np.sqrt(252.0)\n\n    # Returns history requirements for the volatility model expressed in the form of history request\n    # GetHistoryRequirements is a mandatory method\n    def get_history_requirements(self, security, utc_time):\n        # For simplicity's sake, we will not set a history requirement \n        return None\n"
  },
  {
    "path": "Algorithm.Python/CustomWarmUpPeriodIndicatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom collections import deque\n\n### <summary>\n### Regression test to check python indicator is keeping backwards compatibility \n### with indicators that do not set WarmUpPeriod or do not inherit from PythonIndicator class.\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"custom indicator\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass CustomWarmUpPeriodIndicatorAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.add_equity(\"SPY\", Resolution.SECOND)\n\n        # Create three python indicators\n        # - custom_not_warm_up does not define WarmUpPeriod parameter\n        # - custom_warm_up defines WarmUpPeriod parameter\n        # - custom_not_inherit defines WarmUpPeriod parameter but does not inherit from PythonIndicator class\n        # - csharp_indicator defines WarmUpPeriod parameter and represents the traditional LEAN C# indicator\n        self._custom_not_warm_up = CSMANotWarmUp('custom_not_warm_up', 60)\n        self._custom_warm_up = CSMAWithWarmUp('custom_warm_up', 60)\n        self._custom_not_inherit = CustomSMA('custom_not_inherit', 60)\n        self._csharp_indicator = SimpleMovingAverage('csharp_indicator', 60)\n\n        # Register the daily data of \"SPY\" to automatically update the indicators\n        self.register_indicator(\"SPY\", self._custom_warm_up, Resolution.MINUTE)\n        self.register_indicator(\"SPY\", self._custom_not_warm_up, Resolution.MINUTE)\n        self.register_indicator(\"SPY\", self._custom_not_inherit, Resolution.MINUTE)\n        self.register_indicator(\"SPY\", self._csharp_indicator, Resolution.MINUTE)\n\n        # Warm up custom_warm_up indicator\n        self.warm_up_indicator(\"SPY\", self._custom_warm_up, Resolution.MINUTE)\n\n        # Check custom_warm_up indicator has already been warmed up with the requested data\n        assert(self._custom_warm_up.is_ready), \"custom_warm_up indicator was expected to be ready\"\n        assert(self._custom_warm_up.samples == 60), \"custom_warm_up indicator was expected to have processed 60 datapoints already\"\n\n        # Try to warm up custom_not_warm_up indicator. It's expected from LEAN to skip the warm up process\n        # because this indicator doesn't define WarmUpPeriod parameter\n        self.warm_up_indicator(\"SPY\", self._custom_not_warm_up, Resolution.MINUTE)\n\n        # Check custom_not_warm_up indicator is not ready and is using the default WarmUpPeriod value\n        assert(not self._custom_not_warm_up.is_ready), \"custom_not_warm_up indicator wasn't expected to be warmed up\"\n        assert(self._custom_not_warm_up.warm_up_period == 0), \"custom_not_warm_up indicator WarmUpPeriod parameter was expected to be 0\"\n\n        # Warm up custom_not_inherit indicator. Though it does not inherit from PythonIndicator class,\n        # it defines WarmUpPeriod parameter so it's expected to be warmed up from LEAN\n        self.warm_up_indicator(\"SPY\", self._custom_not_inherit, Resolution.MINUTE)\n\n        # Check custom_not_inherit indicator has already been warmed up with the requested data\n        assert(self._custom_not_inherit.is_ready), \"custom_not_inherit indicator was expected to be ready\"\n        assert(self._custom_not_inherit.samples == 60), \"custom_not_inherit indicator was expected to have processed 60 datapoints already\"\n\n        # Warm up csharp_indicator\n        self.warm_up_indicator(\"SPY\", self._csharp_indicator, Resolution.MINUTE)\n\n        # Check csharp_indicator indicator has already been warmed up with the requested data\n        assert(self._csharp_indicator.is_ready), \"csharp_indicator indicator was expected to be ready\"\n        assert(self._csharp_indicator.samples == 60), \"csharp_indicator indicator was expected to have processed 60 datapoints already\"\n\n    def on_data(self, data: Slice) -> None:\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n        if self.time.second == 0:\n            # Compute the difference between indicators values\n            diff = abs(self._custom_not_warm_up.current.value - self._custom_warm_up.current.value)\n            diff += abs(self._custom_not_inherit.value - self._custom_not_warm_up.current.value)\n            diff += abs(self._custom_not_inherit.value - self._custom_warm_up.current.value)\n            diff += abs(self._csharp_indicator.current.value - self._custom_warm_up.current.value)\n            diff += abs(self._csharp_indicator.current.value - self._custom_not_warm_up.current.value)\n            diff += abs(self._csharp_indicator.current.value - self._custom_not_inherit.value)\n\n            # Check custom_not_warm_up indicator is ready when the number of samples is bigger than its WarmUpPeriod parameter\n            assert(self._custom_not_warm_up.is_ready == (self._custom_not_warm_up.samples >= 60)), \"custom_not_warm_up indicator was expected to be ready when the number of samples were bigger that its WarmUpPeriod parameter\"\n\n            # Check their values are the same. We only need to check if custom_not_warm_up indicator is ready because the other ones has already been asserted to be ready\n            assert(diff <= 1e-10 or (not self._custom_not_warm_up.is_ready)), f\"The values of the indicators are not the same. Indicators difference is {diff}\"\n            \n# Python implementation of SimpleMovingAverage.\n# Represents the traditional simple moving average indicator (SMA) without Warm Up Period parameter defined\nclass CSMANotWarmUp(PythonIndicator):\n    def __init__(self, name: str, period: int) -> None:\n        super().__init__()\n        self.name = name\n        self.value = 0\n        self._queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def update(self, input: IndicatorDataPoint) -> bool:\n        self._queue.appendleft(input.value)\n        count = len(self._queue)\n        self.value = np.sum(self._queue) / count\n        return count == self._queue.maxlen\n\n# Python implementation of SimpleMovingAverage.\n# Represents the traditional simple moving average indicator (SMA) With Warm Up Period parameter defined\nclass CSMAWithWarmUp(CSMANotWarmUp):\n    def __init__(self, name: str, period: int) -> None:\n        super().__init__(name, period)\n        self.warm_up_period = period\n\n# Custom python implementation of SimpleMovingAverage.\n# Represents the traditional simple moving average indicator (SMA)\nclass CustomSMA():\n    def __init__(self, name: str, period: int) -> None:\n        self.name = name\n        self.value = 0\n        self._queue = deque(maxlen=period)\n        self.warm_up_period = period\n        self.is_ready = False\n        self.samples = 0\n\n    # Update method is mandatory\n    def update(self, input: IndicatorDataPoint) -> bool:\n        self.samples += 1\n        self._queue.appendleft(input.value)\n        count = len(self._queue)\n        self.value = np.sum(self._queue) / count\n        if count == self._queue.maxlen:\n            self.is_ready = True\n        return self.is_ready\n"
  },
  {
    "path": "Algorithm.Python/DailyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Uses daily data and a simple moving average cross to place trades and an ema for stop placement\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass DailyAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,1,1)    #Set Start Date\n        self.set_end_date(2014,1,1)      #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.add_equity(\"IBM\", Resolution.HOUR, leverage=1)\n        self._macd = self.macd(\"SPY\", 12, 26, 9, MovingAverageType.WILDERS, Resolution.DAILY, Field.CLOSE)\n        self._ema = self.ema(\"IBM\", 15 * 6, Resolution.HOUR, Field.SEVEN_BAR)\n        self._last_action = self.start_date\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self._macd.is_ready: return\n        bar = data.bars.get(\"IBM\")\n        if not bar: return\n        if self._last_action.date() == self.time.date(): return\n\n        self._last_action = self.time\n        quantity = self.portfolio[\"SPY\"].quantity\n\n        if quantity <= 0 and self._macd.current.value > self._macd.signal.current.value and bar.price > self._ema.current.value:\n            self.set_holdings(\"IBM\", 0.25)\n        if quantity >= 0 and self._macd.current.value < self._macd.signal.current.value and bar.price < self._ema.current.value:\n            self.set_holdings(\"IBM\", -0.25)\n"
  },
  {
    "path": "Algorithm.Python/DataConsolidationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm giving an introduction into using IDataConsolidators.\n### This is an advanced QC concept and requires a certain level of comfort using C# and its event system.\n###\n### What is an IDataConsolidator?\n### IDataConsolidator is a plugin point that can be used to transform your data more easily.\n### In this example we show one of the simplest consolidators, the TradeBarConsolidator.\n### This type is capable of taking a timespan to indicate how long each bar should be, or an\n### integer to indicate how many bars should be aggregated into one.\n###\n### When a new 'consolidated' piece of data is produced by the IDataConsolidator, an event is fired\n### with the argument of the new data.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\nclass DataConsolidationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 7)  #Set Start Date\n        self.set_end_date(2013, 12, 7)  #Set End Date\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n        self.add_forex(\"EURUSD\", Resolution.HOUR)\n\n        # define our 30 minute trade bar consolidator. we can\n        # access the 30 minute bar from the DataConsolidated events\n        thirty_minute_consolidator = TradeBarConsolidator(timedelta(minutes=30))\n\n        # attach our event handler. the event handler is a function that will\n        # be called each time we produce a new consolidated piece of data.\n        thirty_minute_consolidator.data_consolidated += self.thirty_minute_bar_handler\n\n        # this call adds our 30 minute consolidator to\n        # the manager to receive updates from the engine\n        self.subscription_manager.add_consolidator(\"SPY\", thirty_minute_consolidator)\n\n        # here we'll define a slightly more complex consolidator. what we're trying to produce is\n        # a 3 day bar. Now we could just use a single TradeBarConsolidator like above and pass in\n        # TimeSpan.from_days(3), but in reality that's not what we want. For time spans of longer than\n        # a day we'll get incorrect results around weekends and such. What we really want are tradeable\n        # days. So we'll create a daily consolidator, and then wrap it with a 3 count consolidator.\n\n        # first define a one day trade bar -- this produces a consolidated piece of data after a day has passed\n        one_day_consolidator = TradeBarConsolidator(timedelta(1))\n\n        # next define our 3 count trade bar -- this produces a consolidated piece of data after it sees 3 pieces of data\n        three_count_consolidator = TradeBarConsolidator(3)\n\n        # here we combine them to make a new, 3 day trade bar. The SequentialConsolidator allows composition of\n        # consolidators. It takes the consolidated output of one consolidator (in this case, the one_day_consolidator)\n        # and pipes it through to the three_count_consolidator.  His output will be a 3 day bar.\n        three_one_day_bar = SequentialConsolidator(one_day_consolidator, three_count_consolidator)\n\n        # attach our handler\n        three_one_day_bar.data_consolidated += self.three_day_bar_consolidated_handler\n\n        # this call adds our 3 day to the manager to receive updates from the engine\n        self.subscription_manager.add_consolidator(\"SPY\", three_one_day_bar)\n\n        # Custom monthly consolidator\n        custom_monthly_consolidator = TradeBarConsolidator(self.custom_monthly)\n        custom_monthly_consolidator.data_consolidated += self.custom_monthly_handler\n        self.subscription_manager.add_consolidator(\"SPY\", custom_monthly_consolidator)\n\n        # API convenience method for easily receiving consolidated data\n        self.consolidate(\"SPY\", timedelta(minutes=45), self.forty_five_minute_bar_handler)\n        self.consolidate(\"SPY\", Resolution.HOUR, self.hour_bar_handler)\n        self.consolidate(\"EURUSD\", Resolution.DAILY, self.daily_eur_usd_bar_handler)\n\n        # API convenience method for easily receiving weekly-consolidated data\n        self.consolidate(\"SPY\", Calendar.WEEKLY, self.calendar_trade_bar_handler)\n        self.consolidate(\"EURUSD\", Calendar.WEEKLY, self.calendar_quote_bar_handler)\n\n        # API convenience method for easily receiving monthly-consolidated data\n        self.consolidate(\"SPY\", Calendar.MONTHLY, self.calendar_trade_bar_handler)\n        self.consolidate(\"EURUSD\", Calendar.MONTHLY, self.calendar_quote_bar_handler)\n\n        # API convenience method for easily receiving quarterly-consolidated data\n        self.consolidate(\"SPY\", Calendar.QUARTERLY, self.calendar_trade_bar_handler)\n        self.consolidate(\"EURUSD\", Calendar.QUARTERLY, self.calendar_quote_bar_handler)\n\n        # API convenience method for easily receiving yearly-consolidated data\n        self.consolidate(\"SPY\", Calendar.YEARLY, self.calendar_trade_bar_handler)\n        self.consolidate(\"EURUSD\", Calendar.YEARLY, self.calendar_quote_bar_handler)\n\n        # some securities may have trade and quote data available, so we can choose it based on TickType:\n        #self.consolidate(\"BTCUSD\", Resolution.HOUR, TickType.TRADE, self.hour_bar_handler)   # to get TradeBar\n        #self.consolidate(\"BTCUSD\", Resolution.HOUR, TickType.QUOTE, self.hour_bar_handler)   # to get QuoteBar (default)\n\n        self.consolidated_hour = False\n        self.consolidated45_minute = False\n        self.__last = None\n\n    def on_data(self, data):\n        '''We need to declare this method'''\n        pass\n\n\n    def on_end_of_day(self, symbol):\n        # close up shop each day and reset our 'last' value so we start tomorrow fresh\n        self.liquidate(\"SPY\")\n        self.__last = None\n\n    def thirty_minute_bar_handler(self, sender, consolidated):\n        '''This is our event handler for our 30 minute trade bar defined above in Initialize(). So each time the\n        consolidator produces a new 30 minute bar, this function will be called automatically. The 'sender' parameter\n         will be the instance of the IDataConsolidator that invoked the event, but you'll almost never need that!'''\n\n        if self.__last is not None and consolidated.close > self.__last.close:\n            self.log(f\"{consolidated.time} >> SPY >> LONG  >> 100 >> {self.portfolio['SPY'].quantity}\")\n            self.order(\"SPY\", 100)\n\n        elif self.__last is not None and consolidated.close < self.__last.close:\n            self.log(f\"{consolidated.time} >> SPY >> SHORT  >> 100 >> {self.portfolio['SPY'].quantity}\")\n            self.order(\"SPY\", -100)\n\n        self.__last = consolidated\n\n\n    def three_day_bar_consolidated_handler(self, sender, consolidated):\n        ''' This is our event handler for our 3 day trade bar defined above in Initialize(). So each time the\n        consolidator produces a new 3 day bar, this function will be called automatically. The 'sender' parameter\n        will be the instance of the IDataConsolidator that invoked the event, but you'll almost never need that!'''\n        self.log(f\"{consolidated.time} >> Plotting!\")\n        self.plot(consolidated.symbol.value, \"3HourBar\", consolidated.close)\n\n    def forty_five_minute_bar_handler(self, consolidated):\n        ''' This is our event handler for our 45 minute consolidated defined using the Consolidate method'''\n        self.consolidated45_minute = True\n        self.log(f\"{consolidated.end_time} >> FortyFiveMinuteBarHandler >> {consolidated.close}\")\n\n    def hour_bar_handler(self, consolidated):\n        '''This is our event handler for our one hour consolidated defined using the Consolidate method'''\n        self.consolidated_hour = True\n        self.log(f\"{consolidated.end_time} >> FortyFiveMinuteBarHandler >> {consolidated.close}\")\n\n    def daily_eur_usd_bar_handler(self, consolidated):\n        '''This is our event handler for our daily consolidated defined using the Consolidate method'''\n        self.log(f\"{consolidated.end_time} EURUSD Daily consolidated.\")\n\n    def calendar_trade_bar_handler(self, trade_bar):\n        self.log(f'{self.time} :: {trade_bar.time} {trade_bar.close}')\n\n    def calendar_quote_bar_handler(self, quote_bar):\n        self.log(f'{self.time} :: {quote_bar.time} {quote_bar.close}')\n\n    def custom_monthly(self, dt):\n        '''Custom Monthly Func'''\n        start = dt.replace(day=1).date()\n        end = dt.replace(day=28) + timedelta(4)\n        end = (end - timedelta(end.day-1)).date()\n        return CalendarInfo(start, end - start)\n\n    def custom_monthly_handler(self, sender, consolidated):\n        '''This is our event handler Custom Monthly function'''\n        self.log(f\"{consolidated.time} >> CustomMonthlyHandler >> {consolidated.close}\")\n\n    def on_end_of_algorithm(self):\n        if not self.consolidated_hour:\n            raise AssertionError(\"Expected hourly consolidator to be fired.\")\n\n        if not self.consolidated45_minute:\n            raise AssertionError(\"Expected 45-minute consolidator to be fired.\")\n"
  },
  {
    "path": "Algorithm.Python/DefaultSchedulingSymbolRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting a default symbol is created using equity market when scheduling if none found\n### </summary>\nclass DefaultSchedulingSymbolRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        # implicitly figured usa equity\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(\"AAPL\"), self._implicit_check)\n\n        # picked up from cache\n        self.add_index(\"SPX\")\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.before_market_close(\"SPX\", extended_market_close = True), self._explicit_check)\n\n    def _implicit_check(self):\n        self._implicitChecked = True\n        if self.time.time() != time(9, 30, 0):\n            raise RegressionTestException(f\"Unexpected time of day {self.time.time()}\")\n\n    def _explicit_check(self):\n        self._explicitChecked = True\n        if self.time.time() != time(16, 15, 0):\n            raise RegressionTestException(f\"Unexpected time of day {self.time.time()}\")\n\n    def on_end_of_algorithm(self):\n        if not self._explicitChecked or not self._implicitChecked:\n            raise RegressionTestException(\"Failed to run expected checks!\")\n"
  },
  {
    "path": "Algorithm.Python/DelistingEventsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of using the Delisting event in your algorithm. Assets are delisted on their last day of trading, or when their contract expires.\n### This data is not included in the open source project.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"data event handlers\" />\n### <meta name=\"tag\" content=\"delisting event\" />\nclass DelistingEventsAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2007, 5, 15)  #Set Start Date\n        self.set_end_date(2007, 5, 25)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"AAA.1\", Resolution.DAILY)\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self.transactions.orders_count == 0:\n            self.set_holdings(\"AAA.1\", 1)\n            self.debug(\"Purchased stock\")\n\n        for kvp in data.bars:\n            symbol = kvp.key\n            value = kvp.value\n\n            self.log(\"OnData(Slice): {0}: {1}: {2}\".format(self.time, symbol, value.close))\n\n        # the slice can also contain delisting data: data.delistings in a dictionary string->Delisting\n\n        aaa = self.securities[\"AAA.1\"]\n        if aaa.is_delisted and aaa.is_tradable:\n            raise AssertionError(\"Delisted security must NOT be tradable\")\n\n        if not aaa.is_delisted and not aaa.is_tradable:\n            raise AssertionError(\"Securities must be marked as tradable until they're delisted or removed from the universe\")\n\n        for kvp in data.delistings:\n            symbol = kvp.key\n            value = kvp.value\n\n            if value.type == DelistingType.WARNING:\n                self.log(\"OnData(Delistings): {0}: {1} will be delisted at end of day today.\".format(self.time, symbol))\n\n                # liquidate on delisting warning\n                self.set_holdings(symbol, 0)\n\n            if value.type == DelistingType.DELISTED:\n                self.log(\"OnData(Delistings): {0}: {1} has been delisted.\".format(self.time, symbol))\n\n                # fails because the security has already been delisted and is no longer tradable\n                self.set_holdings(symbol, 1)\n\n\n    def on_order_event(self, order_event):\n        self.log(\"OnOrderEvent(OrderEvent): {0}: {1}\".format(self.time, order_event))\n"
  },
  {
    "path": "Algorithm.Python/DescendingCustomDataObjectStoreRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n\nfrom AlgorithmImports import *\n\n\n### <summary>\n### The regression algorithm showcases the utilization of a custom data source with the Sort flag set to true.\n### This means that the source initially provides data in descending order, which is then organized into ascending order and returned in the 'on_data' function.\n### </summary>\nclass DescendingCustomDataObjectStoreRegressionAlgorithm(QCAlgorithm):\n    descending_custom_data = [\n        \"2024-10-03 19:00:00,173.5,176.0,172.0,175.2,120195681,4882.29\",\n        \"2024-10-02 18:00:00,174.0,177.0,173.0,175.8,116275729,4641.97\",\n        \"2024-10-01 17:00:00,175.0,178.0,172.5,174.5,127707078,6591.27\",\n        \"2024-09-30 11:00:00,174.8,176.5,172.8,175.0,127707078,6591.27\",\n        \"2024-09-27 10:00:00,172.5,175.0,171.5,173.5,120195681,4882.29\",\n        \"2024-09-26 09:00:00,171.0,172.5,170.0,171.8,117516350,4820.53\",\n        \"2024-09-25 08:00:00,169.5,172.0,169.0,171.0,110427867,4661.55\",\n        \"2024-09-24 07:00:00,170.0,171.0,168.0,169.5,127624733,4823.52\",\n        \"2024-09-23 06:00:00,172.0,173.5,169.5,171.5,123586417,4303.93\",\n        \"2024-09-20 05:00:00,168.0,171.0,167.5,170.5,151929179,5429.87\",\n        \"2024-09-19 04:00:00,170.5,171.5,166.0,167.0,160523863,5219.24\",\n        \"2024-09-18 03:00:00,173.0,174.0,169.0,172.0,145721790,5163.09\",\n        \"2024-09-17 02:00:00,171.0,173.5,170.0,172.5,144794030,5405.72\",\n        \"2024-09-16 01:00:00,168.0,171.0,167.0,170.0,214402430,8753.33\",\n        \"2024-09-13 16:00:00,173.5,176.0,172.0,175.2,120195681,4882.29\",\n        \"2024-09-12 15:00:00,174.5,177.5,173.5,176.5,171728134,7774.83\",\n        \"2024-09-11 14:00:00,175.0,178.0,174.0,175.5,191516153,8349.59\",\n        \"2024-09-10 13:00:00,174.5,176.0,173.0,174.0,151162819,5915.8\",\n        \"2024-09-09 12:00:00,176.0,178.0,175.0,177.0,116275729,4641.97\"\n    ]\n\n    def initialize(self) -> None:\n        self.set_start_date(2024, 9, 9)\n        self.set_end_date(2024, 10, 3)\n        self.set_cash(100000)\n\n        self.set_benchmark(lambda x: 0)\n\n        SortCustomData.custom_data_key = self.get_custom_data_key()\n\n        self._custom_symbol = self.add_data(SortCustomData, \"SortCustomData\", Resolution.DAILY).symbol\n\n        # Saving data here for demonstration and regression testing purposes.\n        # In real scenarios, data has to be saved to the object store before the algorithm starts.\n        self.object_store.save(self.get_custom_data_key(), \"\\n\".join(self.descending_custom_data))\n\n        self.received_data = []\n\n    def on_data(self, slice: Slice) -> None:\n        if slice.contains_key(self._custom_symbol):\n            custom_data = slice.get(SortCustomData, self._custom_symbol)\n            if custom_data.open == 0 or custom_data.high == 0 or custom_data.low == 0 or custom_data.close == 0 or custom_data.price == 0:\n                raise AssertionError(\"One or more custom data fields (open, high, low, close, price) are zero.\")\n\n            self.received_data.append(custom_data)\n\n    def on_end_of_algorithm(self) -> None:\n        if not self.received_data:\n            raise AssertionError(\"Custom data was not fetched\")\n\n        # Make sure history requests work as expected\n        history = self.history(SortCustomData, self._custom_symbol, self.start_date, self.end_date, Resolution.DAILY)\n\n        if history.shape[0] != len(self.received_data):\n            raise AssertionError(\"History request returned more or less data than expected\")\n\n        # Iterate through the history collection, checking if the time is in ascending order.\n        for i in range(len(history) - 1):\n            # [1] - time\n            if history.index[i][1] > history.index[i + 1][1]:\n                raise AssertionError(\n                    f\"Order failure: {history.index[i][1]} > {history.index[i + 1][1]} at index {i}.\")\n\n    def get_custom_data_key(self) -> str:\n        return \"CustomData/SortCustomData\"\n\n\nclass SortCustomData(PythonData):\n    custom_data_key = \"\"\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        subscription = SubscriptionDataSource(self.custom_data_key, SubscriptionTransportMedium.OBJECT_STORE,\n                                              FileFormat.CSV)\n        # Indicate that the data from the subscription will be returned in descending order.\n        subscription.sort = True\n        return subscription\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> DynamicData:\n        data = line.split(',')\n        obj_data = SortCustomData()\n        obj_data.symbol = config.symbol\n        obj_data.time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S')\n        obj_data.value = float(data[4])\n        obj_data[\"Open\"] = float(data[1])\n        obj_data[\"High\"] = float(data[2])\n        obj_data[\"Low\"] = float(data[3])\n        obj_data[\"Close\"] = float(data[4])\n        return obj_data\n"
  },
  {
    "path": "Algorithm.Python/DisplacedMovingAverageRibbon.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Constructs a displaced moving average ribbon and buys when all are lined up, liquidates when they all line down\n### Ribbons are great for visualizing trends\n### Signals are generated when they all line up in a paricular direction\n### A buy signal is when the values of the indicators are increasing (from slowest to fastest).\n### A sell signal is when the values of the indicators are decreasing (from slowest to fastest).\n### </summary>\n### <meta name=\"tag\" content=\"charting\" />\n### <meta name=\"tag\" content=\"plotting indicators\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\nclass DisplacedMovingAverageRibbon(QCAlgorithm):\n\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self):\n        self.set_start_date(2009, 1, 1)  #Set Start Date\n        self.set_end_date(2015, 1, 1)    #Set End Date\n        self._spy = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n        count = 6\n        offset = 5\n        period = 15\n        self._ribbon = []\n        # define our sma as the base of the ribbon\n        self._sma = SimpleMovingAverage(period)\n        \n        for x in range(count):\n            # define our offset to the zero sma, these various offsets will create our 'displaced' ribbon\n            delay = Delay(offset*(x+1))\n            # define an indicator that takes the output of the sma and pipes it into our delay indicator\n            delayed_sma = IndicatorExtensions.of(delay, self._sma)\n            # register our new 'delayed_sma' for automatic updates on a daily resolution\n            self.register_indicator(self._spy, delayed_sma, Resolution.DAILY)\n            # plot indicators each time they update using the plot_indicator function\n            self.plot_indicator(\"Ribbon\", delayed_sma) \n            self._ribbon.append(delayed_sma)\n        self._previous = datetime.min\n\n    # on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    def on_data(self, data):\n        \n        if not data[self._spy]: return\n        # wait for our entire ribbon to be ready\n        if not all(x.is_ready for x in self._ribbon): return\n        # only once per day\n        if self._previous.date() == self.time.date(): return\n        self.plot(\"Ribbon\", \"Price\", data[self._spy].price)\n\n        # check for a buy signal\n        values = [x.current.value for x in self._ribbon]\n        holding = self.portfolio[self._spy]\n        if (holding.quantity <= 0 and self.is_ascending(values)):\n            self.set_holdings(self._spy, 1.0)\n        elif (holding.quantity > 0 and self.is_descending(values)):\n            self.liquidate(self._spy)\n        self._previous = self.time\n    \n    # Returns true if the specified values are in ascending order\n    def is_ascending(self, values):\n        last = None\n        for val in values:\n            if not last:\n                last = val\n                continue\n            if last < val:\n                return False\n            last = val\n        return True\n    \n    # Returns true if the specified values are in Descending order\n    def is_descending(self, values):\n        last = None\n        for val in values:\n            if not last:\n                last = val\n                continue\n            if last > val:\n                return False\n            last = val\n        return True\n"
  },
  {
    "path": "Algorithm.Python/DividendAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of payments for cash dividends in backtesting. When data normalization mode is set\n### to \"Raw\" the dividends are paid as cash directly into your portfolio.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"data event handlers\" />\n### <meta name=\"tag\" content=\"dividend event\" />\nclass DividendAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(1998,1,1)  #Set Start Date\n        self.set_end_date(2006,1,21)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        equity = self.add_equity(\"MSFT\", Resolution.DAILY)\n        equity.set_data_normalization_mode(DataNormalizationMode.RAW)\n\n        # this will use the Tradier Brokerage open order split behavior\n        # forward split will modify open order to maintain order value\n        # reverse split open orders will be cancelled\n        self.set_brokerage_model(BrokerageName.TRADIER_BROKERAGE)\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        bar = data[\"MSFT\"]\n        if self.transactions.orders_count == 0:\n            self.set_holdings(\"MSFT\", .5)\n            # place some orders that won't fill, when the split comes in they'll get modified to reflect the split\n            quantity = self.calculate_order_quantity(\"MSFT\", .25)\n            self.debug(f\"Purchased Stock: {bar.price}\")\n            self.stop_market_order(\"MSFT\", -quantity, bar.low/2)\n            self.limit_order(\"MSFT\", -quantity, bar.high*2)\n\n        if data.dividends.contains_key(\"MSFT\"):\n            dividend = data.dividends[\"MSFT\"]\n            self.log(f\"{self.time} >> DIVIDEND >> {dividend.symbol} - {dividend.distribution} - {self.portfolio.cash} - {self.portfolio['MSFT'].price}\")\n\n        if data.splits.contains_key(\"MSFT\"):\n            split = data.splits[\"MSFT\"]\n            self.log(f\"{self.time} >> SPLIT >> {split.symbol} - {split.split_factor} - {self.portfolio.cash} - {self.portfolio['MSFT'].price}\")\n\n    def on_order_event(self, order_event):\n        # orders get adjusted based on split events to maintain order value\n        order = self.transactions.get_order_by_id(order_event.order_id)\n        self.log(f\"{self.time} >> ORDER >> {order}\")\n"
  },
  {
    "path": "Algorithm.Python/DropboxBaseDataUniverseSelectionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm we show how you can easily use the universe selection feature to fetch symbols\n### to be traded using the BaseData custom data system in combination with the AddUniverse{T} method.\n### AddUniverse{T} requires a function that will return the symbols to be traded.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"custom universes\" />\nclass DropboxBaseDataUniverseSelectionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2017, 7, 6)\n        self.set_end_date(2018, 7, 4)\n\n        universe = self.add_universe(StockDataSource, self.stock_data_source)\n\n        historical_selection_data = self.history(universe, 3)\n        if len(historical_selection_data) != 3:\n            raise ValueError(f\"Unexpected universe data count {len(historical_selection_data)}\")\n\n        for universe_data in historical_selection_data[\"symbols\"]:\n            if len(universe_data) != 5:\n                raise ValueError(f\"Unexpected universe data receieved\")\n\n        self._changes = None\n\n    def stock_data_source(self, data: list[DynamicData]) -> list[Symbol]:\n        list = []\n        for item in data:\n            for symbol in item[\"Symbols\"]:\n                list.append(symbol)\n        return list\n\n    def on_data(self, slice: Slice) -> None:\n        if slice.bars.count == 0:\n           return\n        if not self._changes:\n           return\n\n        # start fresh\n        self.liquidate()\n\n        percentage = 1 / slice.bars.count\n        for trade_bar in slice.bars.values():\n            self.set_holdings(trade_bar.symbol, percentage)\n\n        # reset changes\n        self._changes = None\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        self._changes = changes\n\nclass StockDataSource(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        url = \"https://www.dropbox.com/s/2l73mu97gcehmh7/daily-stock-picker-live.csv?dl=1\" if is_live_mode else \\\n            \"https://www.dropbox.com/s/ae1couew5ir3z9y/daily-stock-picker-backtest.csv?dl=1\"\n        return SubscriptionDataSource(url, SubscriptionTransportMedium.REMOTE_FILE)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> DynamicData:\n        if not (line.strip() and line[0].isdigit()):\n            return None\n\n        stocks = StockDataSource()\n        stocks.symbol = config.symbol\n\n        csv = line.split(',')\n        if is_live_mode:\n            stocks.time = date\n            stocks[\"Symbols\"] = csv\n        else:\n            stocks.time = datetime.strptime(csv[0], \"%Y%m%d\")\n            stocks[\"Symbols\"] = csv[1:]\n        return stocks\n"
  },
  {
    "path": "Algorithm.Python/DropboxCoarseFineAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm, we fetch a list of tickers with corresponding dates from a file on Dropbox.\n### We then create a fine fundamental universe which contains those symbols on their respective dates.###\n### </summary>\n### <meta name=\"tag\" content=\"download\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"custom data\" />\nclass DropboxCoarseFineAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2019, 9, 23) # Set Start Date\n        self.set_end_date(2019, 9, 30) # Set End Date\n        self.set_cash(100000)  # Set Strategy Cash\n        self.add_universe(self.select_coarse, self.select_fine)\n\n        self.universe_data = None\n        self.next_update = datetime(1, 1, 1) # Minimum datetime\n        self.url = \"https://www.dropbox.com/s/x2sb9gaiicc6hm3/tickers_with_dates.csv?dl=1\"\n\n    def on_end_of_day(self, symbol: Symbol) -> None:\n        self.debug(f\"{self.time.date()} {symbol.value} with Market Cap: ${self.securities[symbol].fundamentals.market_cap}\")\n\n    def select_coarse(self, coarse):\n        return self.get_symbols()\n\n    def select_fine(self, fine):\n        symbols = self.get_symbols()\n\n        # Return symbols from our list which have a market capitalization of at least 10B\n        return [f.symbol for f in fine if f.market_cap > 1e10 and f.symbol in symbols]\n\n    def get_symbols(self):\n\n        # In live trading update every 12 hours\n        if self.live_mode:\n            if self.time < self.next_update:\n                # Return today's row\n                return self.universe_data[self.time.date()]\n            # When updating set the new reset time.\n            self.next_update = self.time + timedelta(hours=12)\n            self.universe_data = self.parse(self.url)\n\n        # In backtest load once if not set, then just use the dates.\n        if not self.universe_data:\n            self.universe_data = self.parse(self.url)\n\n        # Check if contains the row we need\n        if self.time.date() not in self.universe_data:\n            return Universe.UNCHANGED\n\n        return self.universe_data[self.time.date()]\n\n\n    def parse(self, url):\n        # Download file from url as string\n        file = self.download(url).split(\"\\n\")\n\n        # # Remove formatting characters\n        data = [x.replace(\"\\r\", \"\").replace(\" \", \"\") for x in file]\n\n        # # Split data by date and symbol\n        split_data = [x.split(\",\") for x in data]\n\n        # Dictionary to hold list of active symbols for each date, keyed by date\n        symbols_by_date = {}\n\n        # Parse data into dictionary\n        for arr in split_data:\n            date = datetime.strptime(arr[0], \"%Y%m%d\").date()\n            symbols = [Symbol.create(ticker, SecurityType.EQUITY, Market.USA) for ticker in arr[1:]]\n            symbols_by_date[date] = symbols\n\n        return symbols_by_date\n\n    def on_securities_changed(self, changes):\n        self.log(f\"Added Securities: {[security.symbol.value for security in changes.added_securities]}\")\n"
  },
  {
    "path": "Algorithm.Python/DropboxUniverseSelectionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport base64\n\n### <summary>\n### In this algorithm we show how you can easily use the universe selection feature to fetch symbols\n### to be traded using the BaseData custom data system in combination with the AddUniverse{T} method.\n### AddUniverse{T} requires a function that will return the symbols to be traded.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"custom universes\" />\nclass DropboxUniverseSelectionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2017, 7, 4)\n        self.set_end_date(2018, 7, 4)\n\n        self._backtest_symbols_per_day = {}\n        self._current_universe = []\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.add_universe(\"my-dropbox-universe\", self.selector)\n\n    def selector(self, date: datetime) -> list[str]:\n        # handle live mode file format\n        if self.live_mode:\n            # fetch the file from dropbox\n            str = self.download(\"https://www.dropbox.com/s/2l73mu97gcehmh7/daily-stock-picker-live.csv?dl=1\")\n            # if we have a file for today, return symbols, else leave universe unchanged\n            self._current_universe = str.split(',') if len(str) > 0 else self._current_universe\n            return self._current_universe\n\n        # backtest - first cache the entire file\n        if len(self._backtest_symbols_per_day) == 0:\n\n            # No need for headers for authorization with dropbox, these two lines are for example purposes \n            byte_key = base64.b64encode(\"UserName:Password\".encode('ASCII'))\n            # The headers must be passed to the Download method as dictionary\n            headers = { 'Authorization' : f'Basic ({byte_key.decode(\"ASCII\")})' }\n\n            str = self.download(\"https://www.dropbox.com/s/ae1couew5ir3z9y/daily-stock-picker-backtest.csv?dl=1\", headers)\n            for line in str.splitlines():\n                data = line.split(',')\n                self._backtest_symbols_per_day[data[0]] = data[1:]\n\n        index = date.strftime(\"%Y%m%d\")\n        self._current_universe = self._backtest_symbols_per_day.get(index, self._current_universe)\n\n        return self._current_universe\n\n    def on_data(self, slice: Slice) -> None:\n        if slice.bars.count == 0:\n            return\n        if not self._changes:\n            return\n\n        # start fresh\n        self.liquidate()\n\n        percentage = 1 / slice.bars.count\n        for trade_bar in slice.bars.values():\n            self.set_holdings(trade_bar.symbol, percentage)\n\n        # reset changes\n        self._changes = None\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        self._changes = changes\n"
  },
  {
    "path": "Algorithm.Python/DynamicSecurityDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\n\n### <summary>\n### Provides an example algorithm showcasing the Security.data features\n### </summary>\nclass DynamicSecurityDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 10, 22)\n        self.set_end_date(2015, 10, 30)\n\n        ticker = \"GOOGL\"\n        self._equity = self.add_equity(ticker, Resolution.DAILY)\n\n        custom_linked_equity = self.add_data(LinkedData, ticker, Resolution.DAILY)\n\n        first_linked_data = LinkedData()\n        first_linked_data.count = 100\n        first_linked_data.symbol = custom_linked_equity.symbol\n        first_linked_data.end_time = self.start_date\n\n        second_linked_data = LinkedData()\n        second_linked_data.count = 100\n        second_linked_data.symbol = custom_linked_equity.symbol\n        second_linked_data.end_time = self.start_date\n\n        # Adding linked data manually to cache for example purposes, since\n        # LinkedData is a type used for testing and doesn't point to any real data.\n        custom_linked_equity_type = list(custom_linked_equity.subscriptions)[0].type\n        custom_linked_data = list[LinkedData]()\n        custom_linked_data.append(first_linked_data)\n        custom_linked_data.append(second_linked_data)\n        self._equity.cache.add_data_list(custom_linked_data, custom_linked_equity_type, False)\n\n    def on_data(self, data):\n        # The Security object's Data property provides convenient access\n        # to the various types of data related to that security. You can\n        # access not only the security's price data, but also any custom\n        # data that is mapped to the security, such as our SEC reports.\n\n        # 1. Get the most recent data point of a particular type:\n        # 1.a Using the generic method, Get(T): => T\n        custom_linked_data = self._equity.data.get(LinkedData)\n        self.log(f\"{self.time}: LinkedData: {custom_linked_data}\")\n\n        # 2. Get the list of data points of a particular type for the most recent time step:\n        # 2.a Using the generic method, GetAll(T): => IReadOnlyList<T>\n        custom_linked_data_list = self._equity.data.get_all(LinkedData)\n        self.log(f\"{self.time}: LinkedData: {len(custom_linked_data_list)}\")\n\n        if not self.portfolio.invested:\n            self.buy(self._equity.symbol, 10)\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests the delisting of the composite Symbol (ETF symbol) and the removal of\n### the universe and the symbol from the algorithm.\n### </summary>\nclass ETFConstituentUniverseCompositeDelistingRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.universe_symbol_count = 0\n        self.universe_selection_done = False\n        self.universe_added = False\n        self.universe_removed = False\n\n        self.universe_settings.resolution = Resolution.HOUR\n        self.delisting_date = date(2021, 1, 21)\n\n        self.aapl = self.add_equity(\"AAPL\", Resolution.HOUR).symbol\n        self.gdvd = self.add_equity(\"GDVD\", Resolution.HOUR).symbol\n\n        self.add_universe(self.universe.etf(self.gdvd, self.universe_settings, self.filter_etfs))\n\n    def filter_etfs(self, constituents):\n        self.universe_selection_done = True\n\n        if self.utc_time.date() > self.delisting_date:\n            raise AssertionError(f\"Performing constituent universe selection on {self.utc_time.strftime('%Y-%m-%d %H:%M:%S.%f')} after composite ETF has been delisted\")\n\n        constituent_symbols = [i.symbol for i in constituents]\n        self.universe_symbol_count = len(set(constituent_symbols))\n\n        return constituent_symbols\n\n    def on_data(self, data):\n        if self.utc_time.date() > self.delisting_date and any([i != self.aapl for i in data.keys()]):\n            raise AssertionError(\"Received unexpected slice in OnData(...) after universe was deselected\")\n\n        if not self.portfolio.invested:\n            self.set_holdings(self.aapl, 0.5)\n\n    def on_securities_changed(self, changes):\n        if len(changes.added_securities) != 0 and self.utc_time.date() > self.delisting_date:\n            raise AssertionError(\"New securities added after ETF constituents were delisted\")\n\n        # Since we added the etf subscription it will get delisted and send us a removal event\n        expected_changes_count = self.universe_symbol_count\n\n        if self.universe_selection_done:\n            # \"_universe_symbol_count + 1\" because selection is done right away,\n            # so AddedSecurities includes all ETF constituents (including APPL) plus GDVD\n            self.universe_added = self.universe_added or len(changes.added_securities) == (expected_changes_count - 1)\n\n        # TODO: shouldn't be sending AAPL as a removed security since it was added by another universe\n        self.universe_removed = self.universe_removed or (\n            len(changes.removed_securities) == (expected_changes_count + 1) and\n            self.utc_time.date() >= self.delisting_date and\n            self.utc_time.date() < self.end_date.date())\n\n    def on_end_of_algorithm(self):\n        if not self.universe_added:\n            raise AssertionError(\"ETF constituent universe was never added to the algorithm\")\n        if not self.universe_removed:\n            raise AssertionError(\"ETF constituent universe was not removed from the algorithm after delisting\")\n        if len(self.active_securities) > 2:\n            raise AssertionError(f\"Expected less than 2 securities after algorithm ended, found {len(self.securities)}\")\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests the delisting of the composite Symbol (ETF symbol) and the removal of\n### the universe and the symbol from the algorithm, without adding a subscription via AddEquity\n### </summary>\nclass ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.universe_symbol_count = 0\n        self.universe_selection_done = False\n        self.universe_added = False\n        self.universe_removed = False\n\n        self.universe_settings.resolution = Resolution.HOUR\n        self.delisting_date = date(2021, 1, 21)\n\n        self.aapl = self.add_equity(\"AAPL\", Resolution.HOUR).symbol\n        self.gdvd = Symbol.create(\"GDVD\", SecurityType.EQUITY, Market.USA)\n\n        self.add_universe(self.universe.etf(self.gdvd, self.universe_settings, self.filter_etfs))\n\n    def filter_etfs(self, constituents):\n        self.universe_selection_done = True\n\n        if self.utc_time.date() > self.delisting_date:\n            raise AssertionError(f\"Performing constituent universe selection on {self.utc_time.strftime('%Y-%m-%d %H:%M:%S.%f')} after composite ETF has been delisted\")\n\n        constituent_symbols = [i.symbol for i in constituents]\n        self.universe_symbol_count = len(set(constituent_symbols))\n\n        return constituent_symbols\n\n    def on_data(self, data):\n        if self.utc_time.date() > self.delisting_date and any([i != self.aapl for i in data.keys()]):\n            raise AssertionError(\"Received unexpected slice in OnData(...) after universe was deselected\")\n\n        if not self.portfolio.invested:\n            self.set_holdings(self.aapl, 0.5)\n\n    def on_securities_changed(self, changes):\n        if len(changes.added_securities) != 0 and self.utc_time.date() > self.delisting_date:\n            raise AssertionError(\"New securities added after ETF constituents were delisted\")\n\n        if self.universe_selection_done:\n            self.universe_added = self.universe_added or len(changes.added_securities) == self.universe_symbol_count - 1\n\n        # TODO: shouldn't be sending AAPL as a removed security since it was added by another universe\n        self.universe_removed = self.universe_removed or (\n            len(changes.removed_securities) == self.universe_symbol_count and\n            self.utc_time.date() >= self.delisting_date and\n            self.utc_time.date() < self.end_date.date())\n\n    def on_end_of_algorithm(self):\n        if not self.universe_added:\n            raise AssertionError(\"ETF constituent universe was never added to the algorithm\")\n        if not self.universe_removed:\n            raise AssertionError(\"ETF constituent universe was not removed from the algorithm after delisting\")\n        if len(self.active_securities) > 2:\n            raise AssertionError(f\"Expected less than 2 securities after algorithm ended, found {len(self.securities)}\")\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseFilterFunctionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests a custom filter function when creating an ETF constituents universe for SPY\n### </summary>\nclass ETFConstituentUniverseFilterFunctionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.filtered = False\n        self.securities_changed = False\n        self.received_data = False\n        self.etf_constituent_data = {}\n        self.etf_rebalanced = False\n        self.rebalance_count = 0\n        self.rebalance_asset_count = 0\n\n        self.universe_settings.resolution = Resolution.HOUR\n\n        self.spy = self.add_equity(\"SPY\", Resolution.HOUR).symbol\n        self.aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n\n        self.add_universe(self.universe.etf(self.spy, self.universe_settings, self.filter_etfs))\n\n    def filter_etfs(self, constituents):\n        constituents_data = list(constituents)\n        constituents_symbols = [i.symbol for i in constituents_data]\n        self.etf_constituent_data = {i.symbol: i for i in constituents_data}\n\n        if len(constituents_data) == 0:\n            raise AssertionError(f\"Constituents collection is empty on {self.utc_time.strftime('%Y-%m-%d %H:%M:%S.%f')}\")\n        if self.aapl not in constituents_symbols:\n            raise AssertionError(\"AAPL is not int he constituents data provided to the algorithm\")\n\n        aapl_data = [i for i in constituents_data if i.symbol == self.aapl][0]\n        if aapl_data.weight == 0.0:\n            raise AssertionError(\"AAPL weight is expected to be a non-zero value\")\n\n        self.filtered = True\n        self.etf_rebalanced = True\n\n        return constituents_symbols\n\n    def on_data(self, data):\n        if not self.filtered and len(data.bars) != 0 and self.aapl in data.bars:\n            raise AssertionError(\"AAPL TradeBar data added to algorithm before constituent universe selection took place\")\n\n        if len(data.bars) == 1 and self.spy in data.bars:\n            return\n\n        if len(data.bars) != 0 and self.aapl not in data.bars:\n            raise AssertionError(f\"Expected AAPL TradeBar data on {self.utc_time.strftime('%Y-%m-%d %H:%M:%S.%f')}\")\n\n        self.received_data = True\n\n        if not self.etf_rebalanced:\n            return\n\n        for bar in data.bars.values():\n            constituent_data = self.etf_constituent_data.get(bar.symbol)\n            if constituent_data is not None and constituent_data.weight is not None and constituent_data.weight >= 0.0001:\n                # If the weight of the constituent is less than 1%, then it will be set to 1%\n                # If the weight of the constituent exceeds more than 5%, then it will be capped to 5%\n                # Otherwise, if the weight falls in between, then we use that value.\n                bounded_weight = max(0.01, min(constituent_data.weight, 0.05))\n\n                self.set_holdings(bar.symbol, bounded_weight)\n\n                if self.etf_rebalanced:\n                    self.rebalance_count += 1\n\n                self.etf_rebalanced = False\n                self.rebalance_asset_count += 1\n\n\n    def on_securities_changed(self, changes):\n        if self.filtered and not self.securities_changed and len(changes.added_securities) < 500:\n            raise AssertionError(f\"Added SPY S&P 500 ETF to algorithm, but less than 500 equities were loaded (added {len(changes.added_securities)} securities)\")\n\n        self.securities_changed = True\n\n    def on_end_of_algorithm(self):\n        if self.rebalance_count != 2:\n            raise AssertionError(f\"Expected 2 rebalance, instead rebalanced: {self.rebalance_count}\")\n\n        if self.rebalance_asset_count != 8:\n            raise AssertionError(f\"Invested in {self.rebalance_asset_count} assets (expected 8)\")\n\n        if not self.filtered:\n            raise AssertionError(\"Universe selection was never triggered\")\n\n        if not self.securities_changed:\n            raise AssertionError(\"Security changes never propagated to the algorithm\")\n\n        if not self.received_data:\n            raise AssertionError(\"Data was never loaded for the S&P 500 constituent AAPL\")\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nconstituent_data = []\n\n### <summary>\n### Alpha model for ETF constituents, where we generate insights based on the weighting\n### of the ETF constituent\n### </summary>\nclass ETFConstituentAlphaModel(AlphaModel):\n    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:\n        pass\n\n    ### <summary>\n    ### Creates new insights based on constituent data and their weighting\n    ### in their respective ETF\n    ### </summary>\n    def update(self, algorithm: QCAlgorithm, data: Slice) -> list[Insight]:\n        global constituent_data\n        insights = []\n\n        for constituent in constituent_data:\n            if constituent.symbol not in data.bars and \\\n                constituent.symbol not in data.quote_bars:\n\n                continue\n\n            insight_direction = InsightDirection.UP if constituent.weight is not None and constituent.weight >= 0.01 else InsightDirection.DOWN\n\n            insights.append(Insight(\n                algorithm.utc_time,\n                constituent.symbol,\n                timedelta(days=1),\n                InsightType.PRICE,\n                insight_direction,\n                float(1 * int(insight_direction)),\n                1.0,\n                weight=float(0 if constituent.weight is None else constituent.weight)\n            ))\n\n        return insights\n\n### <summary>\n### Generates targets for ETF constituents, which will be set to the weighting\n### of the constituent in their respective ETF\n### </summary>\nclass ETFConstituentPortfolioModel(PortfolioConstructionModel):\n    def __init__(self) -> None:\n        self.has_added = False\n\n    ### <summary>\n    ### Securities changed, detects if we've got new additions to the universe\n    ### so that we don't try to trade every loop\n    ### </summary>\n    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:\n        self.has_added = len(changes.added_securities) != 0\n\n    ### <summary>\n    ### Creates portfolio targets based on the insights provided to us by the alpha model.\n    ### Emits portfolio targets setting the quantity to the weight of the constituent\n    ### in its respective ETF.\n    ### </summary>\n    def create_targets(self, algorithm: QCAlgorithm, insights: list[Insight]) -> list[PortfolioTarget]:\n        if not self.has_added:\n            return []\n\n        final_insights = []\n        for insight in insights:\n            final_insights.append(PortfolioTarget(insight.symbol, float(0 if insight.weight is None else insight.weight)))\n            self.has_added = False\n\n        return final_insights\n\n### <summary>\n### Executes based on ETF constituent weighting\n### </summary>\nclass ETFConstituentExecutionModel(ExecutionModel):\n    ### <summary>\n    ### Liquidates if constituents have been removed from the universe\n    ### </summary>\n    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:\n        for change in changes.removed_securities:\n            algorithm.liquidate(change.symbol)\n\n    ### <summary>\n    ### Creates orders for constituents that attempts to add\n    ### the weighting of the constituent in our portfolio. The\n    ### resulting algorithm portfolio weight might not be equal\n    ### to the leverage of the ETF (1x, 2x, 3x, etc.)\n    ### </summary>\n    def execute(self, algorithm: QCAlgorithm, targets: list[IPortfolioTarget]) -> None:\n        for target in targets:\n            algorithm.set_holdings(target.symbol, target.quantity)\n\n### <summary>\n### Tests ETF constituents universe selection with the algorithm framework models (Alpha, PortfolioConstruction, Execution)\n### </summary>\nclass ETFConstituentUniverseFrameworkRegressionAlgorithm(QCAlgorithm):\n    ### <summary>\n    ### Initializes the algorithm, setting up the framework classes and ETF constituent universe settings\n    ### </summary>\n    def initialize(self) -> None:\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.set_alpha(ETFConstituentAlphaModel())\n        self.set_portfolio_construction(ETFConstituentPortfolioModel())\n        self.set_execution(ETFConstituentExecutionModel())\n\n        self.universe_settings.resolution = Resolution.HOUR\n        universe = self.add_universe(self.universe.etf(\"SPY\", self.universe_settings, self.filter_etf_constituents))\n\n        historical_data = self.history(universe, 1, flatten=True)\n        if len(historical_data) < 200:\n            raise ValueError(f\"Unexpected universe DataCollection count {len(historical_data)}! Expected > 200\")\n\n    ### <summary>\n    ### Filters ETF constituents\n    ### </summary>\n    ### <param name=\"constituents\">ETF constituents</param>\n    ### <returns>ETF constituent Symbols that we want to include in the algorithm</returns>\n    def filter_etf_constituents(self, constituents: list[ETFConstituentUniverse]) -> list[Symbol]:\n        global constituent_data\n\n        constituent_data_local = [i for i in constituents if i.weight and i.weight >= 0.001]\n        constituent_data = list(constituent_data_local)\n\n        return [i.symbol for i in constituent_data_local]\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseMappedCompositeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests the mapping of the ETF symbol that has a constituent universe attached to it and ensures\n### that data is loaded after the mapping event takes place.\n### </summary>\nclass ETFConstituentUniverseFilterFunctionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2011, 2, 1)\n        self.set_end_date(2011, 4, 4)\n        self.set_cash(100000)\n\n        self.filter_date_constituent_symbol_count = {}\n        self.constituent_data_encountered = {}\n        self.constituent_symbols = []\n        self.mapping_event_occurred = False\n\n        self.universe_settings.resolution = Resolution.HOUR\n\n        self.aapl = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n        self.qqq = self.add_equity(\"QQQ\", Resolution.DAILY).symbol\n\n        self.add_universe(self.universe.etf(self.qqq, self.universe_settings, self.filter_etfs))\n\n    def filter_etfs(self, constituents):\n        constituent_symbols = [i.symbol for i in constituents]\n\n        if self.aapl not in constituent_symbols:\n            raise AssertionError(\"AAPL not found in QQQ constituents\")\n\n        self.filter_date_constituent_symbol_count[self.utc_time.date()] = len(constituent_symbols)\n        for symbol in constituent_symbols:\n            self.constituent_symbols.append(symbol)\n\n        self.constituent_symbols = list(set(self.constituent_symbols))\n        return constituent_symbols\n\n    def on_data(self, data):\n        if len(data.symbol_changed_events) != 0:\n            for symbol_changed in data.symbol_changed_events.values():\n                if symbol_changed.symbol != self.qqq:\n                    raise AssertionError(f\"Mapped symbol is not QQQ. Instead, found: {symbol_changed.symbol}\")\n                if symbol_changed.old_symbol != \"QQQQ\":\n                    raise AssertionError(f\"Old QQQ Symbol is not QQQQ. Instead, found: {symbol_changed.old_symbol}\")\n                if symbol_changed.new_symbol != \"QQQ\":\n                    raise AssertionError(f\"New QQQ Symbol is not QQQ. Instead, found: {symbol_changed.new_symbol}\")\n\n                self.mapping_event_occurred = True\n\n        if self.qqq in data and len([i for i in data.keys()]) == 1:\n            return\n\n        if self.utc_time.date() not in self.constituent_data_encountered:\n            self.constituent_data_encountered[self.utc_time.date()] = False\n        \n        if len([i for i in data.keys() if i in self.constituent_symbols]) != 0:\n            self.constituent_data_encountered[self.utc_time.date()] = True\n\n        if not self.portfolio.invested:\n            self.set_holdings(self.aapl, 0.5)\n\n    def on_end_of_algorithm(self):\n        if len(self.filter_date_constituent_symbol_count) != 2:\n            raise AssertionError(f\"ETF constituent filtering function was not called 2 times (actual: {len(self.filter_date_constituent_symbol_count)}\")\n\n        if not self.mapping_event_occurred:\n            raise AssertionError(\"No mapping/SymbolChangedEvent occurred. Expected for QQQ to be mapped from QQQQ -> QQQ\")\n\n        for constituent_date, constituents_count in self.filter_date_constituent_symbol_count.items():\n            if constituents_count < 25:\n                raise AssertionError(f\"Expected 25 or more constituents in filter function on {constituent_date}, found {constituents_count}\")\n\n        for constituent_date, constituent_encountered in self.constituent_data_encountered.items():\n            if not constituent_encountered:\n                raise AssertionError(f\"Received data in OnData(...) but it did not contain any constituent data on {constituent_date.strftime('%Y-%m-%d %H:%M:%S.%f')}\")\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentUniverseRSIAlphaModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm demonstrating the usage of the RSI indicator\n### in combination with ETF constituents data to replicate the weighting\n### of the ETF's assets in our own account.\n### </summary>\nclass ETFConstituentUniverseRSIAlphaModelAlgorithm(QCAlgorithm):\n    ### <summary>\n    ### Initialize the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    ### </summary>\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.set_alpha(ConstituentWeightedRsiAlphaModel())\n        self.set_portfolio_construction(InsightWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        spy = self.add_equity(\"SPY\", Resolution.HOUR).symbol\n\n        # We load hourly data for ETF constituents in this algorithm\n        self.universe_settings.resolution = Resolution.HOUR\n        self.settings.minimum_order_margin_portfolio_percentage = 0.01\n\n        self.add_universe(self.universe.etf(spy, self.universe_settings, self.filter_etf_constituents))\n\n    ### <summary>\n    ### Filters ETF constituents\n    ### </summary>\n    ### <param name=\"constituents\">ETF constituents</param>\n    ### <returns>ETF constituent Symbols that we want to include in the algorithm</returns>\n    def filter_etf_constituents(self, constituents):\n        return [i.symbol for i in constituents if i.weight is not None and i.weight >= 0.001]\n\n\n### <summary>\n### Alpha model making use of the RSI indicator and ETF constituent weighting to determine\n### which assets we should invest in and the direction of investment\n### </summary>\nclass ConstituentWeightedRsiAlphaModel(AlphaModel):\n    def __init__(self, max_trades=None):\n        self.rsi_symbol_data = {}\n\n    def update(self, algorithm: QCAlgorithm, data: Slice):\n        algo_constituents = []\n        for bar_symbol in data.bars.keys():\n            if not algorithm.securities[bar_symbol].cache.has_data(ETFConstituentUniverse):\n                continue\n\n            constituent_data = algorithm.securities[bar_symbol].cache.get_data(ETFConstituentUniverse)\n            algo_constituents.append(constituent_data)\n\n        if len(algo_constituents) == 0 or len(data.bars) == 0:\n            # Don't do anything if we have no data we can work with\n            return []\n\n        constituents = {i.symbol:i for i in algo_constituents}\n\n        for bar in data.bars.values():\n            if bar.symbol not in constituents:\n                # Dealing with a manually added equity, which in this case is SPY\n                continue\n\n            if bar.symbol not in self.rsi_symbol_data:\n                # First time we're initializing the RSI.\n                # It won't be ready now, but it will be\n                # after 7 data points\n                constituent = constituents[bar.symbol]\n                self.rsi_symbol_data[bar.symbol] = SymbolData(bar.symbol, algorithm, constituent, 7)\n\n        all_ready = all([sd.rsi.is_ready for sd in self.rsi_symbol_data.values()])\n        if not all_ready:\n            # We're still warming up the RSI indicators.\n            return []\n\n        insights = []\n\n        for symbol, symbol_data in self.rsi_symbol_data.items():\n            average_loss = symbol_data.rsi.average_loss.current.value\n            average_gain = symbol_data.rsi.average_gain.current.value\n\n            # If we've lost more than gained, then we think it's going to go down more\n            direction = InsightDirection.DOWN if average_loss > average_gain else InsightDirection.UP\n\n            # Set the weight of the insight as the weight of the ETF's\n            # holding. The InsightWeightingPortfolioConstructionModel\n            # will rebalance our portfolio to have the same percentage\n            # of holdings in our algorithm that the ETF has.\n            insights.append(Insight.price(\n                symbol,\n                timedelta(days=1),\n                direction,\n                float(average_loss if direction == InsightDirection.DOWN else average_gain),\n                weight=float(symbol_data.constituent.weight)\n            ))\n        \n        return insights\n\n\nclass SymbolData:\n    def __init__(self, symbol, algorithm, constituent, period):\n        self.symbol = symbol\n        self.constituent = constituent\n        self.rsi = algorithm.rsi(symbol, period, MovingAverageType.EXPONENTIAL, Resolution.HOUR)\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentsFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.ETFConstituentsUniverseSelectionModel import *\n\n### <summary>\n### Demonstration of using the ETFConstituentsUniverseSelectionModel\n### </summary>\nclass ETFConstituentsFrameworkAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2020, 12, 7)\n        self.set_cash(100000)\n\n        self.universe_settings.resolution = Resolution.DAILY\n        symbol = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        self.add_universe_selection(ETFConstituentsUniverseSelectionModel(symbol, self.universe_settings, self.etf_constituents_filter))\n\n        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(days=1)))\n\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n\n    def etf_constituents_filter(self, constituents: List[ETFConstituentData]) -> List[Symbol]:\n        # Get the 10 securities with the largest weight in the index\n        selected = sorted([c for c in constituents if c.weight],\n            key=lambda c: c.weight, reverse=True)[:8]\n        return [c.symbol for c in selected]\n\n"
  },
  {
    "path": "Algorithm.Python/ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.ETFConstituentsUniverseSelectionModel import *\nfrom ETFConstituentsFrameworkAlgorithm import ETFConstituentsFrameworkAlgorithm\n\n### <summary>\n### Demonstration of using the ETFConstituentsUniverseSelectionModel with simple ticker\n### </summary>\nclass ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm(ETFConstituentsFrameworkAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        \n        self.set_universe_selection(ETFConstituentsUniverseSelectionModel(\"SPY\", self.universe_settings, self.etf_constituents_filter))\n"
  },
  {
    "path": "Algorithm.Python/ETFGlobalRotationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Strategy example using a portfolio of ETF Global Rotation\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"momentum\" />\n### <meta name=\"tag\" content=\"using data\" />\n\n### <summary>\n### Strategy example using a portfolio of ETF Global Rotation\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"momentum\" />\n### <meta name=\"tag\" content=\"using data\" />\nclass ETFGlobalRotationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_cash(25000)\n        self.set_start_date(2007,1,1)\n        self.last_rotation_time = datetime.min\n        self.rotation_interval = timedelta(days=30)\n        self.first = True\n\n        # these are the growth symbols we'll rotate through\n        growth_symbols =[\"MDY\", # US S&P mid cap 400\n                        \"IEV\", # i_shares S&P europe 350\n                        \"EEM\", # i_shared MSCI emerging markets\n                        \"ILF\", # i_shares S&P latin america\n                        \"EPP\" ] # i_shared MSCI Pacific ex-Japan\n\n        # these are the safety symbols we go to when things are looking bad for growth\n        safety_symbols = [\"EDV\", \"SHY\"] # \"EDV\" Vangaurd TSY 25yr, \"SHY\" Barclays Low Duration TSY\n        # we'll hold some computed data in these guys\n        self.symbol_data = []\n        for symbol in list(set(growth_symbols) | set(safety_symbols)):\n            self.add_security(SecurityType.EQUITY, symbol, Resolution.MINUTE)\n            self.one_month_performance = self.mom(symbol, 30, Resolution.DAILY)\n            self.three_month_performance = self.mom(symbol, 90, Resolution.DAILY)\n            self.symbol_data.append((symbol, self.one_month_performance, self.three_month_performance))\n\n    def on_data(self, data):\n        # the first time we come through here we'll need to do some things such as allocation\n        # and initializing our symbol data\n\n        if self.first:\n            self.first = False\n            self.last_rotation_time = self.time\n            return\n        delta = self.time - self.last_rotation_time\n        if delta > self.rotation_interval:\n            self.last_rotation_time = self.time\n\n            ordered_obj_scores = sorted(self.symbol_data, key=lambda x: Score(x[1].current.value,x[2].current.value).objective_score(), reverse=True)\n            for x in ordered_obj_scores:\n                self.log(\">>SCORE>>\" + x[0] + \">>\" + str(Score(x[1].current.value,x[2].current.value).objective_score()))\n            # pick which one is best from growth and safety symbols\n            best_growth = ordered_obj_scores[0]\n            if Score(best_growth[1].current.value,best_growth[2].current.value).objective_score() > 0:\n                if (self.portfolio[best_growth[0]].quantity == 0):\n                    self.log(\"PREBUY>>LIQUIDATE>>\")\n                    self.liquidate()\n                self.log(\">>BUY>>\" + str(best_growth[0]) + \"@\" + str(100 * best_growth[1].current.value))\n                qty = self.portfolio.margin_remaining / self.securities[best_growth[0]].close\n                self.market_order(best_growth[0], int(qty))\n            else:\n            # if no one has a good objective score then let's hold cash this month to be safe\n                self.log(\">>LIQUIDATE>>CASH\")\n                self.liquidate()\n\nclass Score(object):\n\n    def __init__(self,one_month_performance_value,three_month_performance_value):\n        self.one_month_performance = one_month_performance_value\n        self.three_month_performance = three_month_performance_value\n\n    def objective_score(self):\n        weight1 = 100\n        weight2 = 75\n        return (weight1 * self.one_month_performance + weight2 * self.three_month_performance) / (weight1 + weight2)\n"
  },
  {
    "path": "Algorithm.Python/EmaCrossAlphaModelFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Alphas.EmaCrossAlphaModel import EmaCrossAlphaModel\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"EmaCrossAlphaModel\"/>.\n### </summary>\nclass EmaCrossAlphaModelFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_alpha(EmaCrossAlphaModel())\n\n    def on_end_of_algorithm(self):\n        pass\n"
  },
  {
    "path": "Algorithm.Python/EmaCrossFuturesFrontMonthAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to implement a cross moving average for the futures front contract\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"indicator\" />\n### <meta name=\"tag\" content=\"futures\" />\nclass EmaCrossFuturesFrontMonthAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 10)\n        self.set_cash(1000000)\n\n        future = self.add_future(Futures.Metals.GOLD)\n\n        # Only consider the front month contract\n        # Update the universe once per day to improve performance\n        future.set_filter(lambda x: x.front_month().only_apply_filter_at_market_open())\n\n        # Symbol of the current contract\n        self._symbol = None\n\n        # Create two exponential moving averages\n        self.fast = ExponentialMovingAverage(100)\n        self.slow = ExponentialMovingAverage(300)\n        self.tolerance = 0.001\n        self.consolidator = None\n\n        # Add a custom chart to track the EMA cross\n        chart = Chart('EMA Cross')\n        chart.add_series(Series('Fast', SeriesType.LINE, 0))\n        chart.add_series(Series('Slow', SeriesType.LINE, 0))\n        self.add_chart(chart)\n\n    def on_data(self,slice):\n\n        holding = None if self._symbol is None else self.portfolio.get(self._symbol)\n        if holding is not None:\n            # Buy the futures' front contract when the fast EMA is above the slow one\n            if self.fast.current.value > self.slow.current.value * (1 + self.tolerance):\n                if not holding.invested:\n                    self.set_holdings(self._symbol, .1)\n                    self.plot_ema()\n            elif holding.invested:\n                self.liquidate(self._symbol)\n                self.plot_ema()\n\n    def on_securities_changed(self, changes):\n        if len(changes.removed_securities) > 0:\n            # Remove the consolidator for the previous contract\n            # and reset the indicators\n            if self._symbol is not None and self.consolidator is not None:\n                self.subscription_manager.remove_consolidator(self._symbol, self.consolidator)\n                self.fast.reset()\n                self.slow.reset()\n            # We don't need to call Liquidate(_symbol),\n            # since its positions are liquidated because the contract has expired.\n\n        # Only one security will be added: the new front contract\n        self._symbol = changes.added_securities[0].symbol\n\n        # Create a new consolidator and register the indicators to it\n        self.consolidator = self.resolve_consolidator(self._symbol, Resolution.MINUTE)\n        self.register_indicator(self._symbol, self.fast, self.consolidator)\n        self.register_indicator(self._symbol, self.slow, self.consolidator)\n\n        #  Warm up the indicators\n        self.warm_up_indicator(self._symbol, self.fast, Resolution.MINUTE)\n        self.warm_up_indicator(self._symbol, self.slow, Resolution.MINUTE)\n\n        self.plot_ema()\n\n    def plot_ema(self):\n        self.plot('EMA Cross', 'Fast', self.fast.current.value)\n        self.plot('EMA Cross', 'Slow', self.slow.current.value)\n"
  },
  {
    "path": "Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm we demonstrate how to perform some technical analysis as\n### part of your coarse fundamental universe selection\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\nclass EmaCrossUniverseSelectionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2010,1,1)  #Set Start Date\n        self.set_end_date(2015,1,1)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.DAILY\n        self.universe_settings.leverage = 2\n\n        self.coarse_count = 10\n        self.averages = { }\n\n        # this add universe method accepts two parameters:\n        # - coarse selection function: accepts an IEnumerable<CoarseFundamental> and returns an IEnumerable<Symbol>\n        self.add_universe(self.coarse_selection_function)\n\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n\n        # We are going to use a dictionary to refer the object that will keep the moving averages\n        for cf in coarse:\n            if cf.symbol not in self.averages:\n                self.averages[cf.symbol] = SymbolData(cf.symbol)\n\n            # Updates the SymbolData object with current EOD price\n            avg = self.averages[cf.symbol]\n            avg.update(cf.end_time, cf.adjusted_price)\n\n        # Filter the values of the dict: we only want up-trending securities\n        values = list(filter(lambda x: x.is_uptrend, self.averages.values()))\n\n        # Sorts the values of the dict: we want those with greater difference between the moving averages\n        values.sort(key=lambda x: x.scale, reverse=True)\n\n        for x in values[:self.coarse_count]:\n            self.log('symbol: ' + str(x.symbol.value) + '  scale: ' + str(x.scale))\n\n        # we need to return only the symbol objects\n        return [ x.symbol for x in values[:self.coarse_count] ]\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # we want 20% allocation in each security in our universe\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, 0.1)\n\n\nclass SymbolData(object):\n    def __init__(self, symbol):\n        self._symbol = symbol\n        self.tolerance = 1.01\n        self.fast = ExponentialMovingAverage(100)\n        self.slow = ExponentialMovingAverage(300)\n        self.is_uptrend = False\n        self.scale = 0\n\n    def update(self, time, value):\n        if self.fast.update(time, value) and self.slow.update(time, value):\n            fast = self.fast.current.value\n            slow = self.slow.current.value\n            self.is_uptrend = fast > slow * self.tolerance\n\n        if self.is_uptrend:\n            self.scale = (fast - slow) / ((fast + slow) / 2.0)\n"
  },
  {
    "path": "Algorithm.Python/EmaCrossUniverseSelectionFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.ConstantAlphaModel import ConstantAlphaModel\nfrom Selection.EmaCrossUniverseSelectionModel import EmaCrossUniverseSelectionModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\n\n### <summary>\n### Framework algorithm that uses the EmaCrossUniverseSelectionModel to\n### select the universe based on a moving average cross.\n### </summary>\nclass EmaCrossUniverseSelectionFrameworkAlgorithm(QCAlgorithm):\n    '''Framework algorithm that uses the EmaCrossUniverseSelectionModel to select the universe based on a moving average cross.'''\n\n    def initialize(self):\n\n        self.set_start_date(2013,1,1)\n        self.set_end_date(2015,1,1)\n        self.set_cash(100000)\n\n        fast_period = 100\n        slow_period = 300\n        count = 10\n\n        self.universe_settings.leverage = 2.0\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_universe_selection(EmaCrossUniverseSelectionModel(fast_period, slow_period, count))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1), None, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n"
  },
  {
    "path": "Algorithm.Python/ExecutionModelOrderEventsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm demonstrating how to get order events in custom execution models\n### and asserting that they match the algorithm's order events.\n### </summary>\nclass ExecutionModelOrderEventsRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self._order_events = []\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self.set_universe_selection(ManualUniverseSelectionModel(Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes=20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Resolution.DAILY))\n\n        self._execution_model = CustomImmediateExecutionModel()\n        self.set_execution(self._execution_model)\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n\n    def on_order_event(self, order_event):\n        self._order_events.append(order_event)\n\n    def on_end_of_algorithm(self):\n        if len(self._execution_model.order_events) != len(self._order_events):\n            raise Exception(f\"Order events count mismatch. Execution model: {len(self._execution_model.order_events)}, Algorithm: {len(self._order_events)}\")\n\n        for i, (model_event, algo_event) in enumerate(zip(self._execution_model.order_events, self._order_events)):\n            if (model_event.id != algo_event.id or\n                model_event.order_id != algo_event.order_id or\n                model_event.status != algo_event.status):\n                raise Exception(f\"Order event mismatch at index {i}. Execution model: {model_event}, Algorithm: {algo_event}\")\n\nclass CustomImmediateExecutionModel(ExecutionModel):\n    def __init__(self):\n        self._targets_collection = PortfolioTargetCollection()\n        self._order_tickets = {}\n        self.order_events = []\n\n    def execute(self, algorithm, targets):\n        self._targets_collection.add_range(targets)\n        if not self._targets_collection.is_empty:\n            for target in self._targets_collection.order_by_margin_impact(algorithm):\n                security = algorithm.securities[target.symbol]\n\n                # calculate remaining quantity to be ordered\n                quantity = OrderSizing.get_unordered_quantity(algorithm, target, security, True)\n\n                if (quantity != 0 and\n                    BuyingPowerModelExtensions.above_minimum_order_margin_portfolio_percentage(security.buying_power_model,\n                        security, quantity, algorithm.portfolio, algorithm.settings.minimum_order_margin_portfolio_percentage)):\n                    ticket = algorithm.market_order(security.symbol, quantity, asynchronous=True, tag=target.tag)\n                    self._order_tickets[ticket.order_id] = ticket\n\n            self._targets_collection.clear_fulfilled(algorithm)\n\n    def on_order_event(self, algorithm, order_event):\n        algorithm.log(f\"{algorithm.time} - Order event received: {order_event}\")\n\n        # This method will get events for all orders, but if we save the tickets in Execute we can filter\n        # to process events for orders placed by this model\n        if order_event.order_id in self._order_tickets:\n            ticket = self._order_tickets[order_event.order_id]\n            if order_event.status.is_fill():\n                algorithm.debug(f\"Purchased Stock: {order_event.symbol}\")\n            if order_event.status.is_closed():\n                del self._order_tickets[order_event.order_id]\n\n        self.order_events.append(order_event)\n"
  },
  {
    "path": "Algorithm.Python/ExpiryHelperAlphaModelFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Expiry Helper algorithm uses Expiry helper class in an Alpha Model\n### </summary>\nclass ExpiryHelperAlphaModelFrameworkAlgorithm(QCAlgorithm):\n    '''Expiry Helper framework algorithm uses Expiry helper class in an Alpha Model'''\n\n    def initialize(self) -> None:\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.HOUR\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2014,1,1)      #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(self.ExpiryHelperAlphaModel())\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n\n        self.insights_generated += self.on_insights_generated\n\n    def on_insights_generated(self, s: IAlgorithm, e: GeneratedInsightsCollection) -> None:\n        for insight in e.insights:\n            self.log(f\"{e.date_time_utc.isoweekday()}: Close Time {insight.close_time_utc} {insight.close_time_utc.isoweekday()}\")\n\n    class ExpiryHelperAlphaModel(AlphaModel):\n        _next_update = None\n        _direction = InsightDirection.UP\n\n        def update(self, algorithm: QCAlgorithm, data: Slice) -> list[Insight]:\n            if self._next_update and self._next_update > algorithm.time:\n                return []\n\n            expiry = Expiry.END_OF_DAY\n\n            # Use the Expiry helper to calculate a date/time in the future\n            self._next_update = expiry(algorithm.time)\n\n            weekday = algorithm.time.isoweekday()\n\n            insights = []\n            for symbol in data.bars.keys():\n                # Expected CloseTime: next month on the same day and time\n                if weekday == 1:\n                    insights.append(Insight.price(symbol, Expiry.ONE_MONTH, self._direction))\n                # Expected CloseTime: next month on the 1st at market open time\n                elif weekday == 2:\n                    insights.append(Insight.price(symbol, Expiry.END_OF_MONTH, self._direction))\n                # Expected CloseTime: next Monday at market open time\n                elif weekday == 3:\n                    insights.append(Insight.price(symbol, Expiry.END_OF_WEEK, self._direction))\n                # Expected CloseTime: next day (Friday) at market open time\n                elif weekday == 4:\n                    insights.append(Insight.price(symbol, Expiry.END_OF_DAY, self._direction))\n\n            return insights\n"
  },
  {
    "path": "Algorithm.Python/ExtendedMarketTradingRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates extended market hours trading.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"assets\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass ExtendedMarketTradingRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE, Market.USA, True, 1, True)\n\n        self._last_action = None\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if self._last_action is not None and self._last_action.date() == self.time.date():\n            return\n\n        spy_bar = data.bars['SPY']\n\n        if not self.in_market_hours():\n            self.limit_order(\"SPY\", 10, spy_bar.low)\n            self._last_action = self.time\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n        if self.in_market_hours():\n            raise AssertionError(\"Order processed during market hours.\")\n\n    def in_market_hours(self):\n        now = self.time.time()\n        open = time(9,30,0)\n        close = time(16,0,0)\n        return (open < now) and (close > now)\n\n"
  },
  {
    "path": "Algorithm.Python/FilterUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm is for testing a custom Python filter for options\n### that returns a OptionFilterUniverse.\n### </summary>\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"filter selection\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass FilterUniverseRegressionAlgorithm(QCAlgorithm):\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 28)\n        self.set_cash(100000)\n\n        equity = self.add_equity(self.underlying_ticker)\n        option = self.add_option(self.underlying_ticker)\n        self.option_symbol = option.symbol\n\n        # Set our custom universe filter\n        option.set_filter(self.filter_function)\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(equity.symbol)\n\n    def filter_function(self, universe):\n        universe = universe.weeklys_only().strikes(-5, +5).calls_only().expiration(0, 1)\n        return universe\n\n    def on_data(self,slice):\n        if self.portfolio.invested: return\n\n        for kvp in slice.option_chains:\n            \n            if kvp.key != self.option_symbol: continue\n\n            chain = kvp.value\n            contracts = [option for option in sorted(chain, key = lambda x:x.strike, reverse = True)]\n            \n            if contracts:\n                self.market_order(contracts[0].symbol, 1)\n\n"
  },
  {
    "path": "Algorithm.Python/FilteredIdentityAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm of the Identity indicator with the filtering enhancement. Filtering is used to check\n### the output of the indicator before returning it.\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\nclass FilteredIdentityAlgorithm(QCAlgorithm):\n    ''' Example algorithm of the Identity indicator with the filtering enhancement '''\n    \n    def initialize(self):\n        \n        self.set_start_date(2014,5,2)       # Set Start Date\n        self.set_end_date(self.start_date)   # Set End Date\n        self.set_cash(100000)              # Set Stratgy Cash\n \n        # Find more symbols here: http://quantconnect.com/data\n        security = self.add_forex(\"EURUSD\", Resolution.TICK)\n\n        self._symbol = security.symbol\n        self._identity = self.filtered_identity(self._symbol, filter=self.filter)\n    \n    def filter(self, data):\n        '''Filter function: True if data is not an instance of Tick. If it is, true if TickType is Trade\n        data -- Data for applying the filter'''\n        if isinstance(data, Tick):\n            return data.tick_type == TickType.TRADE\n        return True\n        \n    def on_data(self, data):\n        # Since we are only accepting TickType.TRADE,\n        # this indicator will never be ready\n        if not self._identity.is_ready: return\n        if not self.portfolio.invested:\n            self.set_holdings(self._symbol, 1)\n            self.debug(\"Purchased Stock\")\n"
  },
  {
    "path": "Algorithm.Python/FinancialAdvisorDemoAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates how to submit orders to a Financial Advisor account group, allocation profile or a single managed account.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"financial advisor\" />\nclass FinancialAdvisorDemoAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must be initialized.\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.SECOND).symbol\n\n        # The default order properties can be set here to choose the FA settings\n        # to be automatically used in any order submission method (such as SetHoldings, Buy, Sell and Order)\n\n        # Use a default FA Account Group with an Allocation Method\n        self.default_order_properties = InteractiveBrokersOrderProperties()\n        # account group created manually in IB/TWS\n        self.default_order_properties.fa_group = \"TestGroupEQ\"\n        # supported allocation methods are: EqualQuantity, NetLiq, AvailableEquity, PctChange\n        self.default_order_properties.fa_method = \"EqualQuantity\"\n\n        # set a default FA Allocation Profile\n        # DefaultOrderProperties = InteractiveBrokersOrderProperties()\n        # allocation profile created manually in IB/TWS\n        # self.default_order_properties.fa_profile = \"TestProfileP\"\n\n        # send all orders to a single managed account\n        # DefaultOrderProperties = InteractiveBrokersOrderProperties()\n        # a sub-account linked to the Financial Advisor master account\n        # self.default_order_properties.account = \"DU123456\"\n\n    def on_data(self, data):\n        # on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        if not self.portfolio.invested:\n            # when logged into IB as a Financial Advisor, this call will use order properties\n            # set in the DefaultOrderProperties property of QCAlgorithm\n            self.set_holdings(\"SPY\", 1)\n"
  },
  {
    "path": "Algorithm.Python/FineFundamentalFilteredUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm which tests a fine fundamental filtered universe,\n### related to GH issue 4127\n### </summary>\nclass FineFundamentalFilteredUniverseRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014, 10, 8)\n        self.set_end_date(2014, 10, 13)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        symbol = Symbol(SecurityIdentifier.generate_constituent_identifier(\"constituents-universe-qctest\", SecurityType.EQUITY, Market.USA), \"constituents-universe-qctest\")\n        self.add_universe(ConstituentsUniverse(symbol, self.universe_settings), self.fine_selection_function)\n\n    def fine_selection_function(self, fine):\n        return [ x.symbol for x in fine if x.company_profile != None and x.company_profile.headquarter_city != None and x.company_profile.headquarter_city.lower() == \"cupertino\" ]\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            if data.keys()[0].value != \"AAPL\":\n                raise ValueError(f\"Unexpected symbol was added to the universe: {data.keys()[0]}\")\n            self.set_holdings(data.keys()[0], 1)\n"
  },
  {
    "path": "Algorithm.Python/ForwardDataOnlyFillModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example of custom fill model for security to only fill bars of data obtained after the order was placed. This is to encourage more\n### pessimistic fill models and eliminate the possibility to fill on old market data that may not be relevant.\n### </summary>\nclass ForwardDataOnlyFillModelAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013,10,1)\n        self.set_end_date(2013,10,31)\n\n        self.security = self.add_equity(\"SPY\", Resolution.HOUR)\n        self.security.set_fill_model(ForwardDataOnlyFillModel())\n\n        self.schedule.on(self.date_rules.week_start(), self.time_rules.after_market_open(self.security.symbol), self.trade)\n\n    def trade(self):\n        if not self.portfolio.invested:\n            if self.time.hour != 9 or self.time.minute != 30:\n                raise AssertionError(f\"Unexpected event time {self.time}\")\n\n            ticket = self.buy(\"SPY\", 1)\n            if ticket.status != OrderStatus.SUBMITTED:\n                raise AssertionError(f\"Unexpected order status {ticket.status}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        self.debug(f\"OnOrderEvent:: {order_event}\")\n        if order_event.status == OrderStatus.FILLED and (self.time.hour != 10 or self.time.minute != 0):\n            raise AssertionError(f\"Unexpected fill time {self.time}\")\n\nclass ForwardDataOnlyFillModel(EquityFillModel):\n    def fill(self, parameters: FillModelParameters):\n        order_local_time = Extensions.convert_from_utc(parameters.order.time, parameters.security.exchange.time_zone)\n        for data_type in [ QuoteBar, TradeBar, Tick ]:\n            data = parameters.security.cache.get_data(data_type)\n            if not data is None and order_local_time <= data.end_time:\n                return super().fill(parameters)\n        return Fill([])\n"
  },
  {
    "path": "Algorithm.Python/FractionalQuantityRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm for fractional forex pair\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass FractionalQuantityRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_start_date(2015, 11, 12)\n        self.set_end_date(2016, 4, 1)\n        self.set_cash(100000)\n        self.set_brokerage_model(BrokerageName.GDAX, AccountType.CASH)\n\n        self.set_time_zone(TimeZones.UTC)\n\n        security = self.add_security(SecurityType.CRYPTO, \"BTCUSD\", Resolution.DAILY, Market.GDAX, False, 1, True)\n\n        ### The default buying power model for the Crypto security type is now CashBuyingPowerModel.\n        ### Since this test algorithm uses leverage we need to set a buying power model with margin.\n        security.set_buying_power_model(SecurityMarginModel(3.3))\n\n        con = TradeBarConsolidator(1)\n        self.subscription_manager.add_consolidator(\"BTCUSD\", con)\n        con.data_consolidated += self.data_consolidated\n        self.set_benchmark(security.symbol)\n\n    def data_consolidated(self, sender, bar):\n        quantity = math.floor((self.portfolio.cash + self.portfolio.total_fees) / abs(bar.value + 1))\n        btc_qnty = float(self.portfolio[\"BTCUSD\"].quantity)\n\n        if not self.portfolio.invested:\n            self.order(\"BTCUSD\", quantity)\n        elif btc_qnty == quantity:\n            self.order(\"BTCUSD\", 0.1)\n        elif btc_qnty == quantity + 0.1:\n            self.order(\"BTCUSD\", 0.01)\n        elif btc_qnty == quantity + 0.11:\n            self.order(\"BTCUSD\", -0.02)\n        elif btc_qnty == quantity + 0.09:\n            # should fail (below minimum order quantity)\n            self.order(\"BTCUSD\", 0.00001)\n            self.set_holdings(\"BTCUSD\", -2.0)\n            self.set_holdings(\"BTCUSD\", 2.0)\n            self.quit()\n"
  },
  {
    "path": "Algorithm.Python/FuncRiskFreeRateInterestRateModelWithPythonLambda.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Asserts we can use a Python lambda function as a FuncRiskFreeRateInterestRateModel\n### </summary>\nclass FuncRiskFreeRateInterestRateModelWithPythonLambda(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 5, 28)\n        self.set_end_date(2020, 6, 28)\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.model = FuncRiskFreeRateInterestRateModel(lambda dt: 1 if dt.date != datetime(2020, 5, 28) else 0)\n\n    def on_data(self, slice):\n        if self.time.date == datetime(2020, 5, 28) and self.model.get_interest_rate(self.time) != 0:\n            raise AssertionError(f\"Risk free interest rate should be 0, but was {self.model.get_interest_rate(self.time)}\")\n        elif self.time.date != datetime(2020, 5, 28) and self.model.get_interest_rate(self.time) != 1:\n            raise AssertionError(f\"Risk free interest rate should be 1, but was {self.model.get_interest_rate(self.time)}\")\n"
  },
  {
    "path": "Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test algorithm for scheduled universe selection GH 3890\n### </summary>\nclass FundamentalCustomSelectionTimeRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self._month_start_selection = 0\n        self._month_end_selection = 0\n        self._specific_date_selection = 0\n        self._symbol = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 5, 10)\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Test use case A\n        self.add_universe(self.date_rules.month_start(), self.selection_function__month_start)\n\n        # Test use case B\n        other_settings = UniverseSettings(self.universe_settings)\n        other_settings.schedule.on(self.date_rules.month_end())\n\n        self.add_universe(FundamentalUniverse.usa(self.selection_function__month_end, other_settings))\n\n        # Test use case C\n        self.universe_settings.schedule.on(self.date_rules.on(datetime(2014, 5, 9)))\n        self.add_universe(FundamentalUniverse.usa(self.selection_function__specific_date))\n\n    def selection_function__specific_date(self, coarse):\n        self._specific_date_selection += 1\n        if self.time != datetime(2014, 5, 9):\n            raise ValueError(\"SelectionFunction_SpecificDate unexpected selection: \" + str(self.time))\n        return [ self._symbol ]\n\n    def selection_function__month_start(self, coarse):\n        self._month_start_selection += 1\n        if self._month_start_selection == 1:\n            if self.time != self.start_date:\n                raise ValueError(\"Month Start Unexpected initial selection: \" + str(self.time))\n        elif self.time != datetime(2014, 4, 1) and self.time != datetime(2014, 5, 1):\n            raise ValueError(\"Month Start unexpected selection: \" + str(self.time))\n        return [ self._symbol ]\n\n    def selection_function__month_end(self, coarse):\n        self._month_end_selection += 1\n        if self._month_end_selection == 1:\n            if self.time != self.start_date:\n                raise ValueError(\"Month End unexpected initial selection: \" + str(self.time))\n        elif self.time != datetime(2014, 3, 31) and self.time != datetime(2014, 4, 30):\n            raise ValueError(\"Month End unexpected selection: \" + str(self.time))\n        return [ self._symbol ]\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(self._symbol, 1)\n\n    def on_end_of_algorithm(self):\n        if self._month_end_selection != 3:\n            raise ValueError(\"Month End unexpected selection count: \" + str(self._month_end_selection))\n        if self._month_start_selection != 3:\n            raise ValueError(\"Month Start unexpected selection count: \" + str(self._month_start_selection))\n        if self._specific_date_selection != 1:\n            raise ValueError(\"Specific date unexpected selection count: \" + str(self._month_start_selection))\n"
  },
  {
    "path": "Algorithm.Python/FundamentalRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to define a universe using the fundamental data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass FundamentalRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 26)\n        self.set_end_date(2014, 4, 7)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self._universe = self.add_universe(self.selection_function)\n\n        # before we add any symbol\n        self.assert_fundamental_universe_data()\n\n        self.add_equity(\"SPY\")\n        self.add_equity(\"AAPL\")\n\n        # Request fundamental data for symbols at current algorithm time\n        ibm = Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA)\n        ibm_fundamental = self.fundamentals(ibm)\n        if self.time != self.start_date or self.time != ibm_fundamental.end_time:\n            raise ValueError(f\"Unexpected Fundamental time {ibm_fundamental.end_time}\")\n        if ibm_fundamental.price == 0:\n            raise ValueError(f\"Unexpected Fundamental IBM price!\")\n        nb = Symbol.create(\"NB\", SecurityType.EQUITY, Market.USA)\n        fundamentals = self.fundamentals([ nb, ibm ])\n        if len(fundamentals) != 2:\n            raise ValueError(f\"Unexpected Fundamental count {len(fundamentals)}! Expected 2\")\n\n        # Request historical fundamental data for symbols\n        history = self.history(Fundamental, timedelta(days=2))\n        if len(history) != 4:\n            raise ValueError(f\"Unexpected Fundamental history count {len(history)}! Expected 4\")\n\n        for ticker in [ \"AAPL\", \"SPY\" ]:\n            data = history.loc[ticker]\n            if data[\"value\"][0] == 0:\n                raise ValueError(f\"Unexpected {data} fundamental data\")\n        if Object.reference_equals(data.earningreports.iloc[0], data.earningreports.iloc[1]):\n            raise ValueError(f\"Unexpected fundamental data instance duplication\")\n        if data.earningreports.iloc[0]._time_provider.get_utc_now() == data.earningreports.iloc[1]._time_provider.get_utc_now():\n            raise ValueError(f\"Unexpected fundamental data instance duplication\")\n\n        self.assert_fundamental_universe_data()\n\n        self.changes = None\n        self.number_of_symbols_fundamental = 2\n\n    def assert_fundamental_universe_data(self):\n        # Case A\n        universe_data = self.history(self._universe.data_type, [self._universe.symbol], timedelta(days=2), flatten=True)\n        self.assert_fundamental_history(universe_data, \"A\")\n\n        # Case B (sugar on A)\n        universe_data_per_time = self.history(self._universe, timedelta(days=2), flatten=True)\n        self.assert_fundamental_history(universe_data_per_time, \"B\")\n\n        # Case C: Passing through the unvierse type and symbol\n        enumerable_of_data_dictionary = self.history[self._universe.data_type]([self._universe.symbol], 100)\n        for selection_collection_for_a_day in enumerable_of_data_dictionary:\n            self.assert_fundamental_enumerator(selection_collection_for_a_day[self._universe.symbol], \"C\")\n\n    def assert_fundamental_history(self, df, case_name):\n        dates = df.index.get_level_values('time').unique()\n        if dates.shape[0] != 2:\n            raise ValueError(f\"Unexpected Fundamental universe dates count {dates.shape[0]}! Expected 2\")\n\n        for date in dates:\n            sub_df = df.loc[date]\n            if sub_df.shape[0] < 7000:\n                raise ValueError(f\"Unexpected historical Fundamentals data count {sub_df.shape[0]} case {case_name}! Expected > 7000\")\n\n    def assert_fundamental_enumerator(self, enumerable, case_name):\n        data_point_count = 0\n        for fundamental in enumerable:\n            data_point_count += 1\n            if type(fundamental) is not Fundamental:\n                raise ValueError(f\"Unexpected Fundamentals data type {type(fundamental)} case {case_name}! {str(fundamental)}\")\n        if data_point_count < 7000:\n            raise ValueError(f\"Unexpected historical Fundamentals data count {data_point_count} case {case_name}! Expected > 7000\")\n\n    # return a list of three fixed symbol objects\n    def selection_function(self, fundamental):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted([x for x in fundamental if x.price > 1],\n            key=lambda x: x.dollar_volume, reverse=True)\n\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(sorted_by_dollar_volume, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:self.number_of_symbols_fundamental] ]\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self.changes is None: return\n\n        # liquidate removed securities\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n                self.debug(\"Liquidated Stock: \" + str(security.symbol.value))\n\n        # we want 50% allocation in each security in our universe\n        for security in self.changes.added_securities:\n            self.set_holdings(security.symbol, 0.02)\n\n        self.changes = None\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self.changes = changes\n"
  },
  {
    "path": "Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to define a universe using the fundamental data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass FundamentalUniverseSelectionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 4, 7)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.add_equity(\"SPY\")\n        self.add_equity(\"AAPL\")\n\n        self.set_universe_selection(FundamentalUniverseSelectionModel(self.select))\n\n        self.changes = None\n        self.number_of_symbols_fundamental = 10\n\n    # return a list of three fixed symbol objects\n    def selection_function(self, fundamental):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted([x for x in fundamental if x.price > 1],\n            key=lambda x: x.dollar_volume, reverse=True)\n\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(sorted_by_dollar_volume, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:self.number_of_symbols_fundamental] ]\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self.changes is None: return\n\n        # liquidate removed securities\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n                self.debug(\"Liquidated Stock: \" + str(security.symbol.value))\n\n        # we want 50% allocation in each security in our universe\n        for security in self.changes.added_securities:\n            self.set_holdings(security.symbol, 0.02)\n\n        self.changes = None\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self.changes = changes\n\n    def select(self, fundamental):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted([x for x in fundamental if x.has_fundamental_data and x.price > 1],\n            key=lambda x: x.dollar_volume, reverse=True)\n\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(sorted_by_dollar_volume, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:2] ]\n"
  },
  {
    "path": "Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\n### <summary>\n### Demonstration of how to define a universe using the fundamental data\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass FundamentalUniverseSelectionRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 26)\n        self.set_end_date(2014, 4, 7)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.add_equity(\"SPY\")\n        self.add_equity(\"AAPL\")\n\n        self.set_universe_selection(FundamentalUniverseSelectionModelTest())\n\n        self.changes = None\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if self.changes is None: return\n\n        # liquidate removed securities\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n                self.debug(\"Liquidated Stock: \" + str(security.symbol.value))\n\n        # we want 50% allocation in each security in our universe\n        for security in self.changes.added_securities:\n            self.set_holdings(security.symbol, 0.02)\n\n        self.changes = None\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self.changes = changes\n\nclass FundamentalUniverseSelectionModelTest(FundamentalUniverseSelectionModel):\n\n    def select(self, algorithm, fundamental):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted([x for x in fundamental if x.price > 1],\n            key=lambda x: x.dollar_volume, reverse=True)\n\n        # sort descending by P/E ratio\n        sorted_by_pe_ratio = sorted(sorted_by_dollar_volume, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n\n        # take the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_pe_ratio[:2] ]\n"
  },
  {
    "path": "Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm asserts that futures have data at extended market hours when this is enabled.\n### </summary>\nclass FutureContractsExtendedMarketHoursRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2013, 10, 11)\n\n        es_future_symbol = Symbol.create_future(Futures.Indices.SP_500_E_MINI, Market.CME, datetime(2013, 12, 20))\n        self._es = self.add_future_contract(es_future_symbol, Resolution.HOUR, fill_forward=True, extended_market_hours=True)\n\n        gc_future_symbol = Symbol.create_future(Futures.Metals.GOLD, Market.COMEX, datetime(2013, 10, 29))\n        self._gc = self.add_future_contract(gc_future_symbol, Resolution.HOUR, fill_forward=True, extended_market_hours=False)\n\n        self._es_ran_on_regular_hours = False\n        self._es_ran_on_extended_hours = False\n        self._gc_ran_on_regular_hours = False\n        self._gc_ran_on_extended_hours = False\n\n    def on_data(self, slice):\n        slice_symbols = set(slice.keys())\n        slice_symbols.update(slice.bars.keys())\n        slice_symbols.update(slice.ticks.keys())\n        slice_symbols.update(slice.quote_bars.keys())\n        slice_symbols.update([x.canonical for x in slice_symbols])\n\n        es_is_in_regular_hours = self._es.exchange.hours.is_open(self.time, False)\n        es_is_in_extended_hours = not es_is_in_regular_hours and self._es.exchange.hours.is_open(self.time, True)\n        slice_has_es_data = self._es.symbol in slice_symbols\n        self._es_ran_on_regular_hours |= es_is_in_regular_hours and slice_has_es_data\n        self._es_ran_on_extended_hours |= es_is_in_extended_hours and slice_has_es_data\n\n        gc_is_in_regular_hours = self._gc.exchange.hours.is_open(self.time, False)\n        gc_is_in_extended_hours = not gc_is_in_regular_hours and self._gc.exchange.hours.is_open(self.time, True)\n        slice_has_gc_data = self._gc.symbol in slice_symbols\n        self._gc_ran_on_regular_hours |= gc_is_in_regular_hours and slice_has_gc_data\n        self._gc_ran_on_extended_hours |= gc_is_in_extended_hours and slice_has_gc_data\n\n    def on_end_of_algorithm(self):\n        if not self._es_ran_on_regular_hours:\n            raise AssertionError(f\"Algorithm should have run on regular hours for {self._es.symbol} future, which enabled extended market hours\")\n\n        if not self._es_ran_on_extended_hours:\n            raise AssertionError(f\"Algorithm should have run on extended hours for {self._es.symbol} future, which enabled extended market hours\")\n\n        if not self._gc_ran_on_regular_hours:\n            raise AssertionError(f\"Algorithm should have run on regular hours for {self._gc.symbol} future, which did not enable extended market hours\")\n\n        if self._gc_ran_on_extended_hours:\n            raise AssertionError(f\"Algorithm should have not run on extended hours for {self._gc.symbol} future, which did not enable extended market hours\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionBuySellCallIntradayRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) future option calls across different strike prices.\n### We expect 6 orders from the algorithm, which are:\n###\n###   * (1) Initial entry, buy ES Call Option (ES19M20 expiring ITM)\n###   * (2) Initial entry, sell ES Call Option at different strike (ES20H20 expiring ITM)\n###   * [2] Option assignment, opens a position in the underlying (ES20H20, Qty: -1)\n###   * [2] Future contract liquidation, due to impending expiry\n###   * [1] Option exercise, receive 1 ES19M20 future contract\n###   * [1] Liquidate ES19M20 contract, due to expiry\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionBuySellCallIntradayRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es20h20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 3, 20)\n            ),\n            Resolution.MINUTE).symbol\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)\n            ),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_options = [\n            self.add_future_option_contract(i, Resolution.MINUTE).symbol\n            for i in (list(self.option_chain(self.es19m20)) + list(self.option_chain(self.es20h20)))\n            if i.id.strike_price == 3200.0 and i.id.option_right == OptionRight.CALL\n        ]\n\n        self.expected_contracts = [\n            Symbol.create_option(self.es20h20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3200.0, datetime(2020, 3, 20)),\n            Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3200.0, datetime(2020, 6, 19))\n        ]\n\n        for es_option in self.es_options:\n            if es_option not in self.expected_contracts:\n                raise AssertionError(f\"Contract {es_option} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.schedule_callback_buy)\n\n    def schedule_callback_buy(self):\n        self.market_order(self.es_options[0], 1)\n        self.market_order(self.es_options[1], -1)\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) future option expiry for calls.\n### We expect 3 orders from the algorithm, which are:\n###\n###   * Initial entry, buy ES Call Option (expiring ITM)\n###   * Option exercise, receiving ES future contracts\n###   * Future contract liquidation, due to impending expiry\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionCallITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)\n            ),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted([x for x in self.option_chain(self.es19m20) if x.id.strike_price <= 3200.0 and x.id.option_right == OptionRight.CALL],\n                       key=lambda x: x.id.strike_price, reverse=True)\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3200.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.schedule_callback)\n\n    def schedule_callback(self):\n        self.market_order(self.es_option, 1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n            elif delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            self.assert_future_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n        elif security.symbol == self.expected_contract:\n            # Expected contract is ES19H21 Call Option expiring ITM @ 3250\n            self.assert_future_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{self.time} -- {order_event.symbol} :: Price: {self.securities[order_event.symbol].holdings.price} Qty: {self.securities[order_event.symbol].holdings.quantity} Direction: {order_event.direction} Msg: {order_event.message}\")\n\n    def assert_future_option_order_exercise(self, order_event: OrderEvent, future: Security, option_contract: Security):\n        expected_liquidation_time_utc = datetime(2020, 6, 20, 4, 0, 0)\n\n        if order_event.direction == OrderDirection.SELL and future.holdings.quantity != 0:\n            # We expect the contract to have been liquidated immediately\n            raise AssertionError(f\"Did not liquidate existing holdings for Symbol {future.symbol}\")\n        if order_event.direction == OrderDirection.SELL and order_event.utc_time.replace(tzinfo=None) != expected_liquidation_time_utc:\n            raise AssertionError(f\"Liquidated future contract, but not at the expected time. Expected: {expected_liquidation_time_utc} - found {order_event.utc_time.replace(tzinfo=None)}\")\n\n        # No way to detect option exercise orders or any other kind of special orders\n        # other than matching strings, for now.\n        if \"Option Exercise\" in order_event.message:\n            if order_event.fill_price != 3200.0:\n                raise AssertionError(\"Option did not exercise at expected strike price (3200)\")\n\n            if future.holdings.quantity != 1:\n                # Here, we expect to have some holdings in the underlying, but not in the future option anymore.\n                raise AssertionError(f\"Exercised option contract, but we have no holdings for Future {future.symbol}\")\n\n            if option_contract.holdings.quantity != 0:\n                raise AssertionError(f\"Exercised option contract, but we have holdings for Option contract {option_contract.symbol}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after a filled option exercise\")\n\n        if \"Exercise\" in order_event.message and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after exercising option contract {option.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) future option expiry for calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy ES Call Option (expiring OTM)\n###     - contract expires worthless, not exercised, so never opened a position in the underlying\n###\n###   * Liquidation of worthless ES call option (expiring OTM)\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\n### <remarks>\n### Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n### See related issue: https://github.com/QuantConnect/Lean/issues/4854\n### </remarks>\nclass FutureOptionCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20)\n                     if x.id.strike_price >= 3300.0 and x.id.option_right == OptionRight.CALL],\n                    key=lambda x: x.id.strike_price\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3300.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        # Place order after regular market opens\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, 1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            raise AssertionError(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\")\n\n        # Expected contract is ES19M20 Call Option expiring OTM @ 3300\n        if (security.symbol == self.expected_contract):\n            self.assert_future_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(\"Holdings were found after a filled option exercise\")\n\n        if order_event.direction == OrderDirection.SELL and \"OTM\" not in order_event.message:\n            raise AssertionError(\"Contract did not expire OTM\")\n\n        if \"Exercise\" in order_event.message:\n            raise AssertionError(\"Exercised option, even though it expires OTM\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionChainFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> method\n### to get a future option chain.\n### </summary>\nclass FutureOptionChainFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 6)\n        self.set_end_date(2020, 1, 6)\n\n        future_contract = self.add_future_contract(\n            Symbol.create_future(Futures.Indices.SP_500_E_MINI, Market.CME, datetime(2020, 3, 20)),\n            Resolution.MINUTE).symbol\n\n        option_chain = self.option_chain(future_contract, flatten=True)\n\n        # Demonstration using data frame:\n        df = option_chain.data_frame\n        # Get contracts expiring within 4 months, with the latest expiration date, highest strike and lowest price\n        contracts = df.loc[(df.expiry <= self.time + timedelta(days=120))]\n        contracts = contracts.sort_values(['expiry', 'strike', 'lastprice'], ascending=[False, False, True])\n        self._option_contract = contracts.index[0]\n\n        self.add_future_option_contract(self._option_contract)\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.set_holdings(self._option_contract, 0.5)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChains(IEnumerable{Symbol})\"/> method\n### to get multiple future option chains.\n### </summary>\nclass FutureOptionChainsMultipleFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 6)\n        self.set_end_date(2020, 1, 6)\n\n        es_future_contract = self.add_future_contract(\n            Symbol.create_future(Futures.Indices.SP_500_E_MINI, Market.CME, datetime(2020, 3, 20)),\n            Resolution.MINUTE).symbol\n\n        gc_future_contract = self.add_future_contract(\n            Symbol.create_future(Futures.Metals.GOLD, Market.COMEX, datetime(2020, 4, 28)),\n            Resolution.MINUTE).symbol\n\n        chains = self.option_chains([es_future_contract, gc_future_contract], flatten=True)\n\n        self._es_option_contract = self.get_contract(chains, es_future_contract)\n        self._gc_option_contract = self.get_contract(chains, gc_future_contract)\n\n        self.add_future_option_contract(self._es_option_contract)\n        self.add_future_option_contract(self._gc_option_contract)\n\n    def get_contract(self, chains: OptionChains, underlying: Symbol) -> Symbol:\n        df = chains.data_frame\n\n        # Index by the requested underlying, by getting all data with canonicals which underlying is the requested underlying symbol:\n        canonicals = df.index.get_level_values('canonical')\n        condition = [canonical for canonical in canonicals if canonical.underlying == underlying]\n        contracts = df.loc[condition]\n\n        # Get contracts expiring within 4 months, with the latest expiration date, highest strike and lowest price\n        contracts = contracts.loc[(df.expiry <= self.time + timedelta(days=120))]\n        contracts = contracts.sort_values(['expiry', 'strike', 'lastprice'], ascending=[False, False, True])\n\n        return contracts.index[0][1]\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.set_holdings(self._es_option_contract, 0.25)\n            self.set_holdings(self._gc_option_contract, 0.25)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionContinuousFutureRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm that validates that when using a continuous future (without a filter)\n### the option chains are correctly populated using the mapped symbol.\n### </summary>\nclass FutureOptionContinuousFutureRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 1, 4)\n        self.set_end_date(2020, 1, 8)\n        \n        self.future = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.MINUTE, Market.CME)\n        self.set_filter()\n        \n        self.add_future_option(self.future.symbol, lambda universe: universe.strikes(-1, 1))\n        \n        self._has_any_option_chain_for_mapped_symbol = False\n\n    def set_filter(self):\n        \"\"\"Set future filter - override in derived classes for filtered version\"\"\"\n        pass\n\n    def on_data(self, slice: Slice):\n        if len(slice.option_chains) == 0:\n            return\n\n        self.validate_option_chains(slice)\n        \n        # OptionChain for mapped symbol\n        chain = slice.option_chains[self.future.mapped]\n        if chain is None or not any(chain):\n            raise RegressionTestException(\"No option chain found for mapped symbol during algorithm execution\")\n\n        # Mark that we successfully received a non-empty OptionChain for mapped symbol\n        self._has_any_option_chain_for_mapped_symbol = True\n    \n    def validate_option_chains(self, slice: Slice):\n        if len(slice.option_chains) != 1:\n            raise RegressionTestException(\"Expected only one option chain for the mapped symbol\")\n\n    def on_end_of_algorithm(self):\n        if not self._has_any_option_chain_for_mapped_symbol:\n            raise RegressionTestException(\"No non-empty option chain found for mapped symbol during algorithm execution\")"
  },
  {
    "path": "Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests using FutureOptions daily resolution\n### </summary>\nclass FutureOptionDailyRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 7)\n        self.set_end_date(2020, 1, 8)\n        resolution = Resolution.DAILY\n\n        # Add our underlying future contract\n        self.es = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 3, 20)\n            ),\n            resolution).symbol\n\n        # Attempt to fetch a specific ITM future option contract\n        es_options = [\n            self.add_future_option_contract(x, resolution).symbol\n            for x in self.option_chain(self.es)\n            if x.id.strike_price == 3200 and x.id.option_right == OptionRight.CALL\n        ]\n        self.es_option = es_options[0]\n\n        # Validate it is the expected contract\n        expected_contract = Symbol.create_option(self.es, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3200, datetime(2020, 3, 20))\n        if self.es_option != expected_contract:\n            raise AssertionError(f\"Contract {self.es_option} was not the expected contract {expected_contract}\")\n\n        # Schedule a purchase of this contract tomorrow at 10AM when the market is open\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.at(10,0,0), self.schedule_callback_buy)\n\n        # Schedule liquidation at 2pm tomorrow when the market is open\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.at(14,0,0), self.schedule_callback_liquidate)\n\n    def schedule_callback_buy(self):\n        self.market_order(self.es_option, 1)\n\n    def on_data(self, slice):\n        # Assert we are only getting data at 4PM NY, for ES future market closes at 16pm NY\n        if slice.time.hour != 17:\n            raise AssertionError(f\"Expected data at 5PM each day; instead was {slice.time}\")\n\n    def schedule_callback_liquidate(self):\n        self.liquidate()\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionHourlyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests using FutureOptions daily resolution\n### </summary>\nclass FutureOptionHourlyRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 7)\n        self.set_end_date(2020, 1, 8)\n        resolution = Resolution.HOUR\n\n        # Add our underlying future contract\n        self.es = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 3, 20)\n            ),\n            resolution).symbol\n\n        # Attempt to fetch a specific ITM future option contract\n        es_options = [\n            self.add_future_option_contract(x, resolution).symbol for x in (self.option_chain_provider.get_option_contract_list(self.es, self.time)) if x.id.strike_price == 3200 and x.id.option_right == OptionRight.CALL\n        ]\n        self.es_option = es_options[0]\n\n        # Validate it is the expected contract\n        expected_contract = Symbol.create_option(self.es, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3200, datetime(2020, 3, 20))\n        if self.es_option != expected_contract:\n            raise AssertionError(f\"Contract {self.es_option} was not the expected contract {expected_contract}\")\n\n        # Schedule a purchase of this contract at noon\n        self.schedule.on(self.date_rules.today, self.time_rules.noon, self.schedule_callback_buy)\n\n        # Schedule liquidation at 2pm when the market is open\n        self.schedule.on(self.date_rules.today, self.time_rules.at(17,0,0), self.schedule_callback_liquidate)\n\n    def schedule_callback_buy(self):\n        self.ticket = self.market_order(self.es_option, 1)\n\n    def on_data(self, slice):\n        # Assert we are only getting data at 7PM (12AM UTC)\n        if slice.time.minute != 0:\n            raise AssertionError(f\"Expected data only on hourly intervals; instead was {slice.time}\")\n\n    def schedule_callback_liquidate(self):\n        self.liquidate()\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n\n        if self.ticket.status != OrderStatus.FILLED:\n            raise AssertionError(\"Future option order failed to fill correctly\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm.py",
    "content": "### QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n### Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n###\n### Licensed under the Apache License, Version 2.0 (the \"License\");\n### you may not use this file except in compliance with the License.\n### You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n###\n### Unless required by applicable law or agreed to in writing, software\n### distributed under the License is distributed on an \"AS IS\" BASIS,\n### WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n### See the License for the specific language governing permissions and\n### limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression test tests for the loading of futures options contracts with a contract month of 2020-03 can live\n### and be loaded from the same ZIP file that the 2020-04 contract month Future Option contract lives in.\n### </summary>\nclass FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.expected_symbols = {\n            self._create_option(datetime(2020, 3, 26), OptionRight.CALL, 1650.0): False,\n            self._create_option(datetime(2020, 3, 26), OptionRight.PUT, 1540.0): False,\n            self._create_option(datetime(2020, 2, 25), OptionRight.CALL, 1600.0): False,\n            self._create_option(datetime(2020, 2, 25), OptionRight.PUT, 1545.0): False\n        }\n\n        # Required for FOPs to use extended hours, until GH #6491 is addressed\n        self.universe_settings.extended_market_hours = True\n\n        self.set_start_date(2020, 1, 4)\n        self.set_end_date(2020, 1, 6)\n\n        gold_futures = self.add_future(\"GC\", Resolution.MINUTE, Market.COMEX, extended_market_hours=True)\n        gold_futures.set_filter(0, 365)\n\n        self.add_future_option(gold_futures.symbol)\n\n    def on_data(self, data: Slice):\n        for symbol in data.quote_bars.keys():\n            # Check that we are in regular hours, we can place a market order (on extended hours, limit orders should be used)\n            if symbol in self.expected_symbols and self.is_in_regular_hours(symbol):\n                invested = self.expected_symbols[symbol]\n                if not invested:\n                    self.market_order(symbol, 1)\n\n                self.expected_symbols[symbol] = True\n\n    def on_end_of_algorithm(self):\n        not_encountered = [str(k) for k,v in self.expected_symbols.items() if not v]\n        if any(not_encountered):\n            raise AssertionError(f\"Expected all Symbols encountered and invested in, but the following were not found: {', '.join(not_encountered)}\")\n\n        if not self.portfolio.invested:\n            raise AssertionError(\"Expected holdings at the end of algorithm, but none were found.\")\n\n    def is_in_regular_hours(self, symbol):\n        return self.securities[symbol].exchange.exchange_open\n\n    def _create_option(self, expiry: datetime, option_right: OptionRight, strike_price: float) -> Symbol:\n        return Symbol.create_option(\n            Symbol.create_future(\"GC\", Market.COMEX, datetime(2020, 4, 28)),\n            Market.COMEX,\n            OptionStyle.AMERICAN,\n            option_right,\n            strike_price,\n            expiry\n        )\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) future option expiry for puts.\n### We expect 3 orders from the algorithm, which are:\n###\n###   * Initial entry, buy ES Put Option (expiring ITM) (buy, qty 1)\n###   * Option exercise, receiving short ES future contracts (sell, qty -1)\n###   * Future contract liquidation, due to impending expiry (buy qty 1)\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionPutITMExpiryRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)\n            ),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted([x for x in self.option_chain(self.es19m20) if x.id.strike_price >= 3300.0 and x.id.option_right == OptionRight.PUT],\n                       key=lambda x: x.id.strike_price)\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.PUT, 3300.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.schedule_callback)\n\n    def schedule_callback(self):\n        self.market_order(self.es_option, 1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n            elif delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            self.assert_future_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n        elif security.symbol == self.expected_contract:\n            # Expected contract is ES19M20 Call Option expiring ITM @ 3250\n            self.assert_future_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{self.time} -- {order_event.symbol} :: Price: {self.securities[order_event.symbol].holdings.price} Qty: {self.securities[order_event.symbol].holdings.quantity} Direction: {order_event.direction} Msg: {order_event.message}\")\n\n    def assert_future_option_order_exercise(self, order_event: OrderEvent, future: Security, option_contract: Security):\n        expected_liquidation_time_utc = datetime(2020, 6, 20, 4, 0, 0)\n\n        if order_event.direction == OrderDirection.BUY and future.holdings.quantity != 0:\n            # We expect the contract to have been liquidated immediately\n            raise AssertionError(f\"Did not liquidate existing holdings for Symbol {future.symbol}\")\n        if order_event.direction == OrderDirection.BUY and order_event.utc_time.replace(tzinfo=None) != expected_liquidation_time_utc:\n            raise AssertionError(f\"Liquidated future contract, but not at the expected time. Expected: {expected_liquidation_time_utc} - found {order_event.utc_time.replace(tzinfo=None)}\")\n\n        # No way to detect option exercise orders or any other kind of special orders\n        # other than matching strings, for now.\n        if \"Option Exercise\" in order_event.message:\n            if order_event.fill_price != 3300.0:\n                raise AssertionError(\"Option did not exercise at expected strike price (3300)\")\n\n            if future.holdings.quantity != -1:\n                # Here, we expect to have some holdings in the underlying, but not in the future option anymore.\n                raise AssertionError(f\"Exercised option contract, but we have no holdings for Future {future.symbol}\")\n\n            if option_contract.holdings.quantity != 0:\n                raise AssertionError(f\"Exercised option contract, but we have holdings for Option contract {option_contract.symbol}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after a filled option exercise\")\n\n        if \"Exercise\" in order_event.message and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after exercising option contract {option.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) future option expiry for puts.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy ES Put Option (expiring OTM)\n###     - contract expires worthless, not exercised, so never opened a position in the underlying\n###\n###   * Liquidation of worthless ES Put OTM contract\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\n### <remarks>\n### Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n### </remarks>\nclass FutureOptionPutOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20) if x.id.strike_price <= 3150.0 and x.id.option_right == OptionRight.PUT],\n                    key=lambda x: x.id.strike_price,\n                    reverse=True\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.PUT, 3150.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, 1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            raise AssertionError(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\")\n\n        # Expected contract is ES19M20 Put Option expiring OTM @ 3200\n        if (security.symbol == self.expected_contract):\n            self.assert_future_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(\"Holdings were found after a filled option exercise\")\n\n        if order_event.direction == OrderDirection.SELL and \"OTM\" not in order_event.message:\n            raise AssertionError(\"Contract did not expire OTM\")\n\n        if \"Exercise\" in order_event.message:\n            raise AssertionError(\"Exercised option, even though it expires OTM\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) future option expiry for short calls.\n### We expect 3 orders from the algorithm, which are:\n###\n###   * Initial entry, sell ES Call Option (expiring ITM)\n###   * Option assignment, sell 1 contract of the underlying (ES)\n###   * Future contract expiry, liquidation (buy 1 ES future)\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionShortCallITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20) if x.id.strike_price <= 3100.0 and x.id.option_right == OptionRight.CALL],\n                    key=lambda x: x.id.strike_price,\n                    reverse=True\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3100.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, -1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            self.assert_future_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n\n        elif security.symbol == self.expected_contract:\n            self.assert_future_option_contract_order(order_event, security)\n\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n    def assert_future_option_order_exercise(self, order_event: OrderEvent, future: Security, option_contract: Security):\n        if \"Assignment\" in order_event.message:\n            if order_event.fill_price != 3100.0:\n                raise AssertionError(\"Option was not assigned at expected strike price (3100)\")\n\n            if order_event.direction != OrderDirection.SELL or future.holdings.quantity != -1:\n                raise AssertionError(f\"Expected Qty: -1 futures holdings for assigned future {future.symbol}, found {future.holdings.quantity}\")\n\n            return\n\n        if order_event.direction == OrderDirection.BUY and future.holdings.quantity != 0:\n            # We buy back the underlying at expiration, so we expect a neutral position then\n            raise AssertionError(f\"Expected no holdings when liquidating future contract {future.symbol}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.is_assignment and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after option contract was assigned: {option.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) future option expiry for short calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell ES Call Option (expiring OTM)\n###     - Profit the option premium, since the option was not assigned.\n###\n###   * Liquidation of ES call OTM contract on the last trade date\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionShortCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20) if x.id.strike_price >= 3400.0 and x.id.option_right == OptionRight.CALL],\n                    key=lambda x: x.id.strike_price\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.CALL, 3400.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, -1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            raise AssertionError(f\"Expected no order events for underlying Symbol {security.symbol}\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_future_option_contract_order(order_event, security)\n\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option_contract: Security):\n        if order_event.direction == OrderDirection.SELL and option_contract.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option_contract.symbol}\")\n\n        if order_event.direction == OrderDirection.BUY and option_contract.holdings.quantity != 0:\n            raise AssertionError(\"Expected no options holdings after closing position\")\n\n        if order_event.is_assignment:\n            raise AssertionError(f\"Assignment was not expected for {order_event.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) future option expiry for short puts.\n### We expect 3 orders from the algorithm, which are:\n###\n###   * Initial entry, sell ES Put Option (expiring ITM)\n###   * Option assignment, buy 1 contract of the underlying (ES)\n###   * Future contract expiry, liquidation (sell 1 ES future)\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionShortPutITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20) if x.id.strike_price <= 3400.0 and x.id.option_right == OptionRight.PUT],\n                    key=lambda x: x.id.strike_price,\n                    reverse=True\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.PUT, 3400.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, -1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            self.assert_future_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n\n        elif security.symbol == self.expected_contract:\n            self.assert_future_option_contract_order(order_event, security)\n\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n    def assert_future_option_order_exercise(self, order_event: OrderEvent, future: Security, option_contract: Security):\n        if \"Assignment\" in order_event.message:\n            if order_event.fill_price != 3400.0:\n                raise AssertionError(\"Option was not assigned at expected strike price (3400)\")\n\n            if order_event.direction != OrderDirection.BUY or future.holdings.quantity != 1:\n                raise AssertionError(f\"Expected Qty: 1 futures holdings for assigned future {future.symbol}, found {future.holdings.quantity}\")\n\n            return\n\n        if order_event.direction == OrderDirection.SELL and future.holdings.quantity != 0:\n            # We buy back the underlying at expiration, so we expect a neutral position then\n            raise AssertionError(f\"Expected no holdings when liquidating future contract {future.symbol}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.is_assignment and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after option contract was assigned: {option.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) future option expiry for short puts.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell ES Put Option (expiring OTM)\n###     - Profit the option premium, since the option was not assigned.\n###\n###   * Liquidation of ES put OTM contract on the last trade date\n###\n### Additionally, we test delistings for future options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass FutureOptionShortPutOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 6, 30)\n\n        self.es19m20 = self.add_future_contract(\n            Symbol.create_future(\n                Futures.Indices.SP_500_E_MINI,\n                Market.CME,\n                datetime(2020, 6, 19)),\n            Resolution.MINUTE).symbol\n\n        # Select a future option expiring ITM, and adds it to the algorithm.\n        self.es_option = self.add_future_option_contract(\n            list(\n                sorted(\n                    [x for x in self.option_chain(self.es19m20) if x.id.strike_price <= 3000.0 and x.id.option_right == OptionRight.PUT],\n                    key=lambda x: x.id.strike_price,\n                    reverse=True\n                )\n            )[0], Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.es19m20, Market.CME, OptionStyle.AMERICAN, OptionRight.PUT, 3000.0, datetime(2020, 6, 19))\n        if self.es_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.es19m20, 1), self.scheduled_market_order)\n\n    def scheduled_market_order(self):\n        self.market_order(self.es_option, -1)\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2020, 6, 19):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2020, 6, 20):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if not self.securities.contains_key(order_event.symbol):\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.es19m20:\n            raise AssertionError(f\"Expected no order events for underlying Symbol {security.symbol}\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_future_option_contract_order(order_event, security)\n\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{order_event}\")\n\n    def assert_future_option_contract_order(self, order_event: OrderEvent, option_contract: Security):\n        if order_event.direction == OrderDirection.SELL and option_contract.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option_contract.symbol}\")\n\n        if order_event.direction == OrderDirection.BUY and option_contract.holdings.quantity != 0:\n            raise AssertionError(\"Expected no options holdings after closing position\")\n\n        if order_event.is_assignment:\n            raise AssertionError(f\"Assignment was not expected for {order_event.symbol}\")\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join([str(i.id) for i in self.portfolio.keys()])}\")\n"
  },
  {
    "path": "Algorithm.Python/FutureOptionWithFutureFilterRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom FutureOptionContinuousFutureRegressionAlgorithm import FutureOptionContinuousFutureRegressionAlgorithm\n\n### <summary>\n### Regression algorithm that validates that when using a Future with filter\n### the option chains are correctly populated and are unique\n### </summary>\nclass FutureOptionWithFutureFilterRegressionAlgorithm(FutureOptionContinuousFutureRegressionAlgorithm):\n    def set_filter(self):\n        \"\"\"Set future filter for specific contracts\"\"\"\n        self.future.set_filter(0, 368)\n    \n    def validate_option_chains(self, slice: Slice):\n        future_contracts_with_option_chains = 0\n        for future_chain in slice.future_chains.values():\n            for future_contract in future_chain:\n                # Not all future contracts have option chains, so we need to check if the contract is in the option chain\n                if future_contract.symbol in slice.option_chains:\n                    chain = slice.option_chains[future_contract.symbol]\n                    if len(chain) == 0:\n                        raise RegressionTestException(\"Expected at least one option contract for {}\".format(chain.symbol))\n                    future_contracts_with_option_chains += 1\n        \n        if future_contracts_with_option_chains < 1:\n            raise RegressionTestException(\"Expected at least two future contracts with option chains, but found {}\".format(future_contracts_with_option_chains))"
  },
  {
    "path": "Algorithm.Python/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n# <summary>\n# This example demonstrates how to create future 'stop_market_order' in extended Market Hours time\n# </summary>\n\nclass FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm(QCAlgorithm):\n    # Keep new created instance of stop_market_order\n    _stop_market_ticket = None\n    \n    # Initialize the Algorithm and Prepare Required Data\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2013, 10, 12)\n\n        # Add mini SP500 future with extended Market hours flag\n        self._sp_500_e_mini = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.MINUTE, extended_market_hours=True)\n\n        # Init new schedule event with params: every_day, 19:00:00 PM, what should to do\n        self.schedule.on(self.date_rules.every_day(),self.time_rules.at(19, 0),self.make_market_and_stop_market_order)\n\n    # This method is opened 2 new orders by scheduler\n    def make_market_and_stop_market_order(self) -> None:\n        # Don't place orders at the end of the last date, the market-on-stop order won't have time to fill\n        if self.time.date() == self.end_date.date() - timedelta(1) or  not self._sp_500_e_mini.mapped:\n            return\n\n        self.market_order(self._sp_500_e_mini.mapped, 1)\n        self._stop_market_ticket = self.stop_market_order(self._sp_500_e_mini.mapped, -1, self._sp_500_e_mini.price * 1.1)\n\n    # New Data Event handler receiving all subscription data in a single event\n    def on_data(self, slice: Slice) -> None:\n        if (self._stop_market_ticket == None or self._stop_market_ticket.status != OrderStatus.SUBMITTED):\n            return None\n\n        self.stop_price = self._stop_market_ticket.get(OrderField.STOP_PRICE)\n        self.bar = self.securities[self._stop_market_ticket.symbol].cache.get_data()\n\n    # An order fill update the resulting information is passed to this method.\n    def on_order_event(self, order_event: OrderEvent) -> None:\n        if self.transactions.get_order_by_id(order_event.order_id).type is not OrderType.STOP_MARKET:\n            return None\n\n        if order_event.status == OrderStatus.FILLED:\n            # Get Exchange Hours for specific security\n            exchange_hours = self.market_hours_database.get_exchange_hours(self._sp_500_e_mini.subscription_data_config)\n\n            # Validate, Exchange is opened explicitly\n            if (not exchange_hours.is_open(order_event.utc_time, self._sp_500_e_mini.is_extended_market_hours)):\n                raise AssertionError(\"The Exchange hours was closed, verify 'extended_market_hours' flag in Initialize() when added new security(ies)\")\n\n    def on_end_of_algorithm(self) -> None:\n        self.stop_market_orders = self.transactions.get_orders(lambda o: o.type is OrderType.STOP_MARKET)\n\n        for o in self.stop_market_orders:\n            if o.status != OrderStatus.FILLED:\n                raise AssertionError(\"The Algorithms was not handled any StopMarketOrders\")\n"
  },
  {
    "path": "Algorithm.Python/FutureUniverseHistoryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing history requests for <see cref=\"FutureUniverse\"/> type work as expected\n### and return the same data as the futures chain provider.\n### </summary>\nclass OptionUniverseHistoryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 11)\n        self.set_end_date(2013, 10, 11)\n\n        future = self.add_future(Futures.Indices.SP_500_E_MINI).symbol\n\n        historical_futures_data_df = self.history(FutureUniverse, future, 3, flatten=True)\n\n        # Level 0 of the multi-index is the date, we expect 3 dates, 3 future chains\n        if historical_futures_data_df.index.levshape[0] != 3:\n            raise RegressionTestException(f\"Expected 3 futures chains from history request, \"\n                                          f\"but got {historical_futures_data_df.index.levshape[1]}\")\n\n        for date in historical_futures_data_df.index.levels[0]:\n            expected_chain = list(self.future_chain_provider.get_future_contract_list(future, date))\n            expected_chain_count = len(expected_chain)\n\n            actual_chain = historical_futures_data_df.loc[date]\n            actual_chain_count = len(actual_chain)\n\n            if expected_chain_count != actual_chain_count:\n                raise RegressionTestException(f\"Expected {expected_chain_count} futures in chain on {date}, \"\n                                              f\"but got {actual_chain_count}\")\n\n            for i, symbol in enumerate(actual_chain.index):\n                expected_symbol = expected_chain[i]\n                if symbol != expected_symbol:\n                    raise RegressionTestException(f\"Expected symbol {expected_symbol} at index \"\n                                                  f\" {i} on {date}, but got {symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Tests delistings for Futures and Futures Options to ensure that they are delisted at the expected times.\n### </summary>\nclass FuturesAndFutures_optionsExpiryTimeAndLiquidationRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.invested = False\n        self.liquidated = 0\n        self.delistings_received = 0\n\n        self.expected_expiry_warning_time = datetime(2020, 6, 19)\n        self.expected_expiry_delisting_time = datetime(2020, 6, 20)\n        self.expected_liquidation_time = datetime(2020, 6, 20)\n\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 12, 1)\n        self.set_cash(100000)\n\n        es = Symbol.create_future(\n            \"ES\",\n            Market.CME,\n            datetime(2020, 6, 19)\n        )\n\n        es_option = Symbol.create_option(\n            es,\n            Market.CME,\n            OptionStyle.AMERICAN,\n            OptionRight.PUT,\n            3400.0,\n            datetime(2020, 6, 19)\n        )\n\n        self.es_future = self.add_future_contract(es, Resolution.MINUTE).symbol\n        self.es_future_option = self.add_future_option_contract(es_option, Resolution.MINUTE).symbol\n\n    def on_data(self, data: Slice):\n        for delisting in data.delistings.values():\n            self.delistings_received += 1\n\n            if delisting.type == DelistingType.WARNING and delisting.time != self.expected_expiry_warning_time:\n                raise AssertionError(f\"Expiry warning with time {delisting.time} but is expected to be {self.expected_expiry_warning_time}\")\n\n            if delisting.type == DelistingType.WARNING and delisting.time != datetime(self.time.year, self.time.month, self.time.day):\n                raise AssertionError(f\"Delisting warning received at an unexpected date: {self.time} - expected {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED and delisting.time != self.expected_expiry_delisting_time:\n                raise AssertionError(f\"Delisting occurred at unexpected time: {delisting.time} - expected: {self.expected_expiry_delisting_time}\")\n\n            if delisting.type == DelistingType.DELISTED and delisting.time != datetime(self.time.year, self.time.month, self.time.day):\n                raise AssertionError(f\"Delisting notice received at an unexpected date: {self.time} - expected {delisting.time}\")\n\n        if not self.invested and \\\n            (self.es_future in data.bars or self.es_future in data.quote_bars) and \\\n            (self.es_future_option in data.bars or self.es_future_option in data.quote_bars):\n\n            self.invested = True\n\n            self.market_order(self.es_future, 1)\n            self.market_order(self.es_future_option, 1)\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.direction != OrderDirection.SELL or order_event.status != OrderStatus.FILLED:\n            return\n\n        # * Future Liquidation\n        # * Future Option Exercise\n        # * We expect NO Underlying Future Liquidation because we already hold a Long future position so the FOP Put selling leaves us breakeven\n        self.liquidated += 1\n        if order_event.symbol.security_type == SecurityType.FUTURE_OPTION and self.expected_liquidation_time != self.time:\n            raise AssertionError(f\"Expected to liquidate option {order_event.symbol} at {self.expected_liquidation_time}, instead liquidated at {self.time}\")\n\n        if order_event.symbol.security_type == SecurityType.FUTURE and \\\n            (self.expected_liquidation_time - timedelta(minutes=1)) != self.time and \\\n            self.expected_liquidation_time != self.time:\n\n            raise AssertionError(f\"Expected to liquidate future {order_event.symbol} at {self.expected_liquidation_time} (+1 minute), instead liquidated at {self.time}\")\n\n    def on_end_of_algorithm(self):\n        if not self.invested:\n            raise AssertionError(\"Never invested in ES futures and FOPs\")\n\n        if self.delistings_received != 4:\n            raise AssertionError(f\"Expected 4 delisting events received, found: {self.delistings_received}\")\n\n        if self.liquidated != 2:\n            raise AssertionError(f\"Expected 3 liquidation events, found {self.liquidated}\")\n"
  },
  {
    "path": "Algorithm.Python/FuturesChainFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.FuturesChain(Symbol, bool)\"/>\n### method to get a future chain.\n### </summary>\nclass FuturesChainFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n\n        future = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.MINUTE).symbol\n\n        chain = self.futures_chain(future, flatten=True)\n\n        # Demonstration using data frame:\n        df = chain.data_frame\n\n        for index, row in df.iterrows():\n            if row['bidprice'] == 0 and row['askprice'] == 0 and row['volume'] == 0:\n                raise AssertionError(\"FuturesChain() returned contract with no data.\");\n\n        # Get contracts expiring within 6 months, with the latest expiration date, and lowest price\n        contracts = df.loc[(df.expiry <= self.time + timedelta(days=180))]\n        contracts = contracts.sort_values(['expiry', 'lastprice'], ascending=[False, True])\n        self._future_contract = contracts.index[0]\n\n        self.add_future_contract(self._future_contract)\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.set_holdings(self._future_contract, 0.5)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/FuturesChainsMultipleFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.FuturesChains(IEnumerable{Symbol}, bool)\"/>\n### method to get multiple futures chains.\n### </summary>\nclass FuturesChainsMultipleFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n\n        es_future = self.add_future(Futures.Indices.SP_500_E_MINI).symbol\n        gc_future = self.add_future(Futures.Metals.GOLD).symbol\n\n        chains = self.futures_chains([es_future, gc_future], flatten=True)\n\n        self._es_contract = self.get_contract(chains, es_future)\n        self._gc_contract = self.get_contract(chains, gc_future)\n\n        self.add_future_contract(self._es_contract)\n        self.add_future_contract(self._gc_contract)\n\n    def get_contract(self, chains: FuturesChains, canonical: Symbol) -> Symbol:\n        df = chains.data_frame\n\n        # Index by the requested underlying, by getting all data with canonicals which underlying is the requested underlying symbol:\n        canonicals = df.index.get_level_values('canonical')\n        condition = [symbol for symbol in canonicals if symbol == canonical]\n        contracts = df.loc[condition]\n\n        # Get contracts expiring within 6 months, with the latest expiration date, and lowest price\n        contracts = contracts.loc[(df.expiry <= self.time + timedelta(days=180))]\n        contracts = contracts.sort_values(['expiry', 'lastprice'], ascending=[False, True])\n\n        return contracts.index[0][1]\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.set_holdings(self._es_contract, 0.25)\n            self.set_holdings(self._gc_contract, 0.25)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/FuturesExtendedMarketHoursRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm asserts that futures have data at extended market hours when this is enabled.\n### </summary>\nclass FuturesExtendedMarketHoursRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2013, 10, 11)\n\n        self._es = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.HOUR, fill_forward=True, extended_market_hours=True)\n        self._es.set_filter(0, 180)\n\n        self._gc = self.add_future(Futures.Metals.GOLD, Resolution.HOUR, fill_forward=True, extended_market_hours=False)\n        self._gc.set_filter(0, 180)\n\n        self._es_ran_on_regular_hours = False\n        self._es_ran_on_extended_hours = False\n        self._gc_ran_on_regular_hours = False\n        self._gc_ran_on_extended_hours = False\n\n    def on_data(self, slice):\n        slice_symbols = set(slice.keys())\n        slice_symbols.update(slice.bars.keys())\n        slice_symbols.update(slice.ticks.keys())\n        slice_symbols.update(slice.quote_bars.keys())\n        slice_symbols.update([x.canonical for x in slice_symbols])\n\n        es_is_in_regular_hours = self._es.exchange.hours.is_open(self.time, False)\n        es_is_in_extended_hours = not es_is_in_regular_hours and self._es.exchange.hours.is_open(self.time, True)\n        slice_has_e_s_data = self._es.symbol in slice_symbols\n        self._es_ran_on_regular_hours |= es_is_in_regular_hours and slice_has_e_s_data\n        self._es_ran_on_extended_hours |= es_is_in_extended_hours and slice_has_e_s_data\n\n        gc_is_in_regular_hours = self._gc.exchange.hours.is_open(self.time, False)\n        gc_is_in_extended_hours = not gc_is_in_regular_hours and self._gc.exchange.hours.is_open(self.time, True)\n        slice_has_g_c_data = self._gc.symbol in slice_symbols\n        self._gc_ran_on_regular_hours |= gc_is_in_regular_hours and slice_has_g_c_data\n        self._gc_ran_on_extended_hours |= gc_is_in_extended_hours and slice_has_g_c_data\n\n        time_of_day = self.time.time()\n        current_time_is_regular_hours = (time_of_day >= time(9, 30, 0) and time_of_day < time(16, 15, 0)) or (time_of_day >= time(16, 30, 0) and time_of_day < time(17, 0, 0))\n        current_time_is_extended_hours = not current_time_is_regular_hours and (time_of_day < time(9, 30, 0) or time_of_day >= time(18, 0, 0))\n        if es_is_in_regular_hours != current_time_is_regular_hours or es_is_in_extended_hours != current_time_is_extended_hours:\n            raise AssertionError(\"At {Time}, {_es.symbol} is either in regular hours but current time is in extended hours, or viceversa\")\n\n    def on_end_of_algorithm(self):\n        if not self._es_ran_on_regular_hours:\n            raise AssertionError(f\"Algorithm should have run on regular hours for {self._es.symbol} future, which enabled extended market hours\")\n\n        if not self._es_ran_on_extended_hours:\n            raise AssertionError(f\"Algorithm should have run on extended hours for {self._es.symbol} future, which enabled extended market hours\")\n\n        if not self._gc_ran_on_regular_hours:\n            raise AssertionError(f\"Algorithm should have run on regular hours for {self._gc.symbol} future, which did not enable extended market hours\")\n\n        if self._gc_ran_on_extended_hours:\n            raise AssertionError(f\"Algorithm should have not run on extended hours for {self._gc.symbol} future, which did not enable extended market hours\")\n"
  },
  {
    "path": "Algorithm.Python/FuturesMomentumAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### EMA cross with SP500 E-mini futures\n### In this example, we demostrate how to trade futures contracts using\n### a equity to generate the trading signals\n### It also shows how you can prefilter contracts easily based on expirations.\n### It also shows how you can inspect the futures chain to pick a specific contract to trade.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"futures\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"strategy example\" />\nclass FuturesMomentumAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2016, 1, 1)\n        self.set_end_date(2016, 8, 18)\n        self.set_cash(100000)\n        fast_period = 20\n        slow_period = 60\n        self._tolerance = 1 + 0.001\n        self.is_up_trend = False\n        self.is_down_trend = False\n        self.set_warm_up(max(fast_period, slow_period))\n\n        # Adds SPY to be used in our EMA indicators\n        equity = self.add_equity(\"SPY\", Resolution.DAILY)\n        self._fast = self.ema(equity.symbol, fast_period, Resolution.DAILY)\n        self._slow = self.ema(equity.symbol, slow_period, Resolution.DAILY)\n        # Adds the future that will be traded and\n        # set our expiry filter for this futures chain\n        future = self.add_future(Futures.Indices.SP_500_E_MINI)\n        future.set_filter(timedelta(0), timedelta(182))\n\n    def on_data(self, slice):\n        if self._slow.is_ready and self._fast.is_ready:\n            self.is_up_trend = self._fast.current.value > self._slow.current.value * self._tolerance\n            self.is_down_trend = self._fast.current.value < self._slow.current.value * self._tolerance\n            if (not self.portfolio.invested) and self.is_up_trend:\n                for chain in slice.futures_chains:\n                    # find the front contract expiring no earlier than in 90 days\n                    contracts = list(filter(lambda x: x.expiry > self.time + timedelta(90), chain.value))\n                    # if there is any contract, trade the front contract\n                    if len(contracts) == 0: continue\n                    contract = sorted(contracts, key = lambda x: x.expiry, reverse=True)[0]\n                    self.market_order(contract.symbol , 1)\n\n            if self.portfolio.invested and self.is_down_trend:\n                self.liquidate()\n\n    def on_end_of_day(self, symbol):\n        if self.is_up_trend:\n            self.plot(\"Indicator Signal\", \"EOD\",1)\n        elif self.is_down_trend:\n            self.plot(\"Indicator Signal\", \"EOD\",-1)\n        elif self._slow.is_ready and self._fast.is_ready:\n            self.plot(\"Indicator Signal\", \"EOD\",0)\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/G10CurrencySelectionModelFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Selection.ManualUniverseSelectionModel import ManualUniverseSelectionModel\n\nclass G10CurrencySelectionModel(ManualUniverseSelectionModel):\n    '''Provides an implementation of IUniverseSelectionModel that simply subscribes to G10 currencies'''\n    def __init__(self):\n        '''Initializes a new instance of the G10CurrencySelectionModel class\n        using the algorithm's security initializer and universe settings'''\n        super().__init__([Symbol.create(x, SecurityType.FOREX, Market.OANDA)\n                            for x in [ \"EURUSD\",\n                                    \"GBPUSD\",\n                                    \"USDJPY\",\n                                    \"AUDUSD\",\n                                    \"NZDUSD\",\n                                    \"USDCAD\",\n                                    \"USDCHF\",\n                                    \"USDNOK\",\n                                    \"USDSEK\" ]])\n\n### <summary>\n### Framework algorithm that uses the G10CurrencySelectionModel,\n### a Universe Selection Model that inherits from ManualUniverseSelectionModel\n### </summary>\nclass G10CurrencySelectionModelFrameworkAlgorithm(QCAlgorithm):\n    '''Framework algorithm that uses the G10CurrencySelectionModel,\n    a Universe Selection Model that inherits from ManualUniverseSelectionMode'''\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # set algorithm framework models\n        self.set_universe_selection(G10CurrencySelectionModel())\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(\"Purchased Stock: {0}\".format(order_event.symbol))\n"
  },
  {
    "path": "Algorithm.Python/GetParameterRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm for testing parameterized regression algorithms get valid parameters.\n### </summary>\nclass GetParameterRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.check_parameter(None, self.get_parameter(\"non-existing\"), \"GetParameter(\\\"non-existing\\\")\")\n        self.check_parameter(\"100\", self.get_parameter(\"non-existing\", \"100\"), \"GetParameter(\\\"non-existing\\\", \\\"100\\\")\")\n        self.check_parameter(100, self.get_parameter(\"non-existing\", 100), \"GetParameter(\\\"non-existing\\\", 100)\")\n        self.check_parameter(100.0, self.get_parameter(\"non-existing\", 100.0), \"GetParameter(\\\"non-existing\\\", 100.0)\")\n\n        self.check_parameter(\"10\", self.get_parameter(\"ema-fast\"), \"GetParameter(\\\"ema-fast\\\")\")\n        self.check_parameter(10, self.get_parameter(\"ema-fast\", 100), \"GetParameter(\\\"ema-fast\\\", 100)\")\n        self.check_parameter(10.0, self.get_parameter(\"ema-fast\", 100.0), \"GetParameter(\\\"ema-fast\\\", 100.0)\")\n\n        self.quit()\n\n    def check_parameter(self, expected, actual, call):\n        if expected == None and actual != None:\n            raise AssertionError(f\"{call} should have returned null but returned {actual} ({type(actual)})\")\n\n        if expected != None and actual == None:\n            raise AssertionError(f\"{call} should have returned {expected} ({type(expected)}) but returned null\")\n\n        if expected != None and actual != None and type(expected) != type(actual) or expected != actual:\n            raise AssertionError(f\"{call} should have returned {expected} ({type(expected)}) but returned {actual} ({type(actual)})\")\n"
  },
  {
    "path": "Algorithm.Python/HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Alphas.HistoricalReturnsAlphaModel import HistoricalReturnsAlphaModel\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"HistoricalReturnsAlphaModel\"/>.\n### </summary>\nclass HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_alpha(HistoricalReturnsAlphaModel())\n\n    def on_end_of_algorithm(self):\n        expected = 78\n        if self.insights.total_count != expected:\n            raise AssertionError(f\"The total number of insights should be {expected}. Actual: {self.insights.total_count}\")\n"
  },
  {
    "path": "Algorithm.Python/HistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates the various ways you can call the History function,\n### what it returns, and what you can do with the returned values.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"warm up\" />\nclass HistoryAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013,10, 8)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        IBM = self.add_data(CustomDataEquity, \"IBM\", Resolution.DAILY)\n        # specifying the exchange will allow the history methods that accept a number of bars to return to work properly\n        IBM.exchange = EquityExchange()\n\n        # we can get history in initialize to set up indicators and such\n        self.daily_sma = SimpleMovingAverage(14)\n\n        # get the last calendar year's worth of SPY data at the configured resolution (daily)\n        trade_bar_history = self.history([self.securities[\"SPY\"].symbol], timedelta(365))\n        self.assert_history_count(\"History<TradeBar>([\\\"SPY\\\"], timedelta(365))\", trade_bar_history, 250)\n\n        # get the last calendar day's worth of SPY data at the specified resolution\n        trade_bar_history = self.history([\"SPY\"], timedelta(1), Resolution.MINUTE)\n        self.assert_history_count(\"History([\\\"SPY\\\"], timedelta(1), Resolution.MINUTE)\", trade_bar_history, 390)\n\n        # get the last 14 bars of SPY at the configured resolution (daily)\n        trade_bar_history = self.history([\"SPY\"], 14)\n        self.assert_history_count(\"History([\\\"SPY\\\"], 14)\", trade_bar_history, 14)\n\n        # get the last 14 minute bars of SPY\n        trade_bar_history = self.history([\"SPY\"], 14, Resolution.MINUTE)\n        self.assert_history_count(\"History([\\\"SPY\\\"], 14, Resolution.MINUTE)\", trade_bar_history, 14)\n\n        # get the historical data from last current day to this current day in minute resolution\n        # with Fill Forward and Extended Market options\n        interval_bar_history = self.history([\"SPY\"], self.time - timedelta(1), self.time, Resolution.MINUTE, True, True)\n        self.assert_history_count(\"History([\\\"SPY\\\"], self.time - timedelta(1), self.time, Resolution.MINUTE, True, True)\", interval_bar_history, 960)\n\n        # get the historical data from last current day to this current day in minute resolution\n        # with Extended Market option\n        interval_bar_history = self.history([\"SPY\"], self.time - timedelta(1), self.time, Resolution.MINUTE, False, True)\n        self.assert_history_count(\"History([\\\"SPY\\\"], self.time - timedelta(1), self.time, Resolution.MINUTE, False, True)\", interval_bar_history, 919)\n\n        # get the historical data from last current day to this current day in minute resolution\n        # with Fill Forward option\n        interval_bar_history = self.history([\"SPY\"], self.time - timedelta(1), self.time, Resolution.MINUTE, True, False)\n        self.assert_history_count(\"History([\\\"SPY\\\"], self.time - timedelta(1), self.time, Resolution.MINUTE, True, False)\", interval_bar_history, 390)\n\n        # get the historical data from last current day to this current day in minute resolution\n        interval_bar_history = self.history([\"SPY\"], self.time - timedelta(1), self.time, Resolution.MINUTE, False, False)\n        self.assert_history_count(\"History([\\\"SPY\\\"], self.time - timedelta(1), self.time, Resolution.MINUTE, False, False)\", interval_bar_history, 390)\n\n        # we can loop over the return value from these functions and we get TradeBars\n        # we can use these TradeBars to initialize indicators or perform other math\n        for index, trade_bar in trade_bar_history.loc[\"SPY\"].iterrows():\n            self.daily_sma.update(index, trade_bar[\"close\"])\n\n        # get the last calendar year's worth of custom_data data at the configured resolution (daily)\n        custom_data_history = self.history(CustomDataEquity, \"IBM\", timedelta(365))\n        self.assert_history_count(\"History(CustomDataEquity, \\\"IBM\\\", timedelta(365))\", custom_data_history, 250)\n\n        # get the last 10 bars of IBM at the configured resolution (daily)\n        custom_data_history = self.history(CustomDataEquity, \"IBM\", 14)\n        self.assert_history_count(\"History(CustomDataEquity, \\\"IBM\\\", 14)\", custom_data_history, 14)\n\n        # we can loop over the return values from these functions and we'll get Custom data\n        # this can be used in much the same way as the trade_bar_history above\n        self.daily_sma.reset()\n        for index, custom_data in custom_data_history.loc[\"IBM\"].iterrows():\n            self.daily_sma.update(index, custom_data[\"value\"])\n\n        # get the last 10 bars worth of Custom data for the specified symbols at the configured resolution (daily)\n        all_custom_data = self.history(CustomDataEquity, self.securities.keys(), 14)\n        self.assert_history_count(\"History(CustomDataEquity, self.securities.keys(), 14)\", all_custom_data, 14 * 2)\n\n        # NOTE: Using different resolutions require that they are properly implemented in your data type. If your\n        #  custom data source has different resolutions, it would need to be implemented in the GetSource and\n        #  Reader methods properly.\n        #custom_data_history = self.history(CustomDataEquity, \"IBM\", timedelta(7), Resolution.MINUTE)\n        #custom_data_history = self.history(CustomDataEquity, \"IBM\", 14, Resolution.MINUTE)\n        #all_custom_data = self.history(CustomDataEquity, timedelta(365), Resolution.MINUTE)\n        #all_custom_data = self.history(CustomDataEquity, self.securities.keys(), 14, Resolution.MINUTE)\n        #all_custom_data = self.history(CustomDataEquity, self.securities.keys(), timedelta(1), Resolution.MINUTE)\n        #all_custom_data = self.history(CustomDataEquity, self.securities.keys(), 14, Resolution.MINUTE)\n\n        # get the last calendar year's worth of all custom_data data\n        all_custom_data = self.history(CustomDataEquity, self.securities.keys(), timedelta(365))\n        self.assert_history_count(\"History(CustomDataEquity, self.securities.keys(), timedelta(365))\", all_custom_data, 250 * 2)\n\n        # we can also access the return value from the multiple symbol functions to request a single\n        # symbol and then loop over it\n        single_symbol_custom = all_custom_data.loc[\"IBM\"]\n        self.assert_history_count(\"all_custom_data.loc[\\\"IBM\\\"]\", single_symbol_custom, 250)\n        for  custom_data in single_symbol_custom:\n            # do something with 'IBM.custom_data_equity' custom_data data\n            pass\n\n        custom_data_spyvalues = all_custom_data.loc[\"IBM\"][\"value\"]\n        self.assert_history_count(\"all_custom_data.loc[\\\"IBM\\\"][\\\"value\\\"]\", custom_data_spyvalues, 250)\n        for value in custom_data_spyvalues:\n            # do something with 'IBM.custom_data_equity' value data\n            pass\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n    def assert_history_count(self, method_call, trade_bar_history, expected):\n        count = len(trade_bar_history.index)\n        if count != expected:\n            raise AssertionError(\"{} expected {}, but received {}\".format(method_call, expected, count))\n\n\nclass CustomDataEquity(PythonData):\n    def get_source(self, config, date, is_live):\n        zip_file_name = LeanData.generate_zip_file_name(config.Symbol, date, config.Resolution, config.TickType)\n        source = Globals.data_folder + \"/equity/usa/daily/\" + zip_file_name\n        return SubscriptionDataSource(source)\n\n    def reader(self, config, line, date, is_live):\n        if line == None:\n            return None\n\n        custom_data = CustomDataEquity()\n        custom_data.symbol = config.symbol\n\n        csv = line.split(\",\")\n        custom_data.time = datetime.strptime(csv[0], '%Y%m%d %H:%M')\n        custom_data.end_time = custom_data.time + timedelta(days=1)\n        custom_data.value = float(csv[1])\n        return custom_data\n"
  },
  {
    "path": "Algorithm.Python/HistoryAuxiliaryDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting the behavior of auxiliary data history requests\n### </summary>\nclass HistoryAuxiliaryDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2021, 1, 1)\n        self.set_end_date(2021, 1, 5)\n\n        aapl = self.add_equity(\"AAPL\", Resolution.DAILY).symbol\n\n        # multi symbol request\n        spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        multi_symbol_request = self.history(Dividend, [ aapl, spy ], 360, Resolution.DAILY)\n        if len(multi_symbol_request) != 12:\n                raise ValueError(f\"Unexpected multi symbol dividend count: {len(multi_symbol_request)}\")\n\n        # continuous future mapping requests\n        sp500 = Symbol.create(Futures.Indices.SP_500_E_MINI, SecurityType.FUTURE, Market.CME)\n        continuous_future_open_interest_mapping = self.history(SymbolChangedEvent, sp500, datetime(2007, 1, 1), datetime(2012, 1, 1), data_mapping_mode = DataMappingMode.OPEN_INTEREST)\n        if len(continuous_future_open_interest_mapping) != 9:\n                raise ValueError(f\"Unexpected continuous future mapping event count: {len(continuous_future_open_interest_mapping)}\")\n        continuous_future_last_trading_day_mapping = self.history(SymbolChangedEvent, sp500, datetime(2007, 1, 1), datetime(2012, 1, 1), data_mapping_mode = DataMappingMode.LAST_TRADING_DAY)\n        if len(continuous_future_last_trading_day_mapping) != 9:\n                raise ValueError(f\"Unexpected continuous future mapping event count: {len(continuous_future_last_trading_day_mapping)}\")\n\n        dividend = self.history(Dividend, aapl, 360)\n        self.debug(str(dividend))\n        if len(dividend) != 6:\n            raise ValueError(f\"Unexpected dividend count: {len(dividend)}\")\n        for distribution in dividend.distribution:\n            if distribution == 0:\n                raise ValueError(f\"Unexpected distribution: {distribution}\")\n\n        split = self.history(Split, aapl, 360)\n        self.debug(str(split))\n        if len(split) != 2:\n            raise ValueError(f\"Unexpected split count: {len(split)}\")\n        for splitfactor in split.splitfactor:\n            if splitfactor == 0:\n                raise ValueError(f\"Unexpected splitfactor: {splitfactor}\")\n\n        symbol = Symbol.create(\"BTCUSD\", SecurityType.CRYPTO_FUTURE, Market.BINANCE)\n        margin_interest = self.history(MarginInterestRate, symbol, 24 * 3, Resolution.HOUR)\n        self.debug(str(margin_interest))\n        if len(margin_interest) != 8:\n            raise ValueError(f\"Unexpected margin interest count: {len(margin_interest)}\")\n        for interestrate in margin_interest.interestrate:\n            if interestrate == 0:\n                raise ValueError(f\"Unexpected interestrate: {interestrate}\")\n\n        # last trading date on 2007-05-18\n        delisted_symbol = Symbol.create(\"AAA.1\", SecurityType.EQUITY, Market.USA)\n        delistings = self.history(Delisting, delisted_symbol, datetime(2007, 5, 15), datetime(2007, 5, 21))\n        self.debug(str(delistings))\n        if len(delistings) != 2:\n            raise ValueError(f\"Unexpected delistings count: {len(delistings)}\")\n        if delistings.iloc[0].type != DelistingType.WARNING:\n            raise ValueError(f\"Unexpected delisting: {delistings.iloc[0]}\")\n        if delistings.iloc[1].type != DelistingType.DELISTED:\n            raise ValueError(f\"Unexpected delisting: {delistings.iloc[1]}\")\n\n        # get's remapped:\n        # 2008-09-30 spwr -> spwra\n        # 2011-11-17 spwra -> spwr\n        remapped_symbol = Symbol.create(\"SPWR\", SecurityType.EQUITY, Market.USA)\n        symbol_changed_events = self.history(SymbolChangedEvent, remapped_symbol, datetime(2007, 1, 1), datetime(2012, 1, 1))\n        self.debug(str(symbol_changed_events))\n        if len(symbol_changed_events) != 2:\n            raise ValueError(f\"Unexpected SymbolChangedEvents count: {len(symbol_changed_events)}\")\n        first_event = symbol_changed_events.iloc[0]\n        if first_event.oldsymbol != \"SPWR\" or first_event.newsymbol != \"SPWRA\" or symbol_changed_events.index[0][1] != datetime(2008, 9, 30):\n            raise ValueError(f\"Unexpected SymbolChangedEvents: {first_event}\")\n        second_event = symbol_changed_events.iloc[1]\n        if second_event.newsymbol != \"SPWR\" or second_event.oldsymbol != \"SPWRA\" or symbol_changed_events.index[1][1] != datetime(2011, 11, 17):\n            raise ValueError(f\"Unexpected SymbolChangedEvents: {second_event}\")\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"AAPL\", 1)\n"
  },
  {
    "path": "Algorithm.Python/HistoryTickRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting that tick history request includes both trade and quote data\n### </summary>\nclass HistoryTickRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 12)\n        self.set_end_date(2013, 10, 13)\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.TICK).symbol\n\n        trades_count = 0\n        quotes_count = 0\n        for point in self.history[Tick](self._symbol, timedelta(days=1), Resolution.TICK):\n            if point.tick_type == TickType.TRADE:\n                trades_count += 1\n            elif point.tick_type == TickType.QUOTE:\n                quotes_count += 1\n\n            if trades_count > 0 and quotes_count > 0:\n                # We already found at least one tick of each type, we can exit the loop\n                break\n\n        if trades_count == 0 or quotes_count == 0:\n            raise AssertionError(\"Expected to find at least one tick of each type (quote and trade)\")\n\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/HistoryWithCustomDataSourceRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test illustrating how history from custom data sources can be requested. The <see cref=\"QCAlgorithm.history\"/> method used in this\n### example also allows to specify other parameters than just the resolution, such as the data normalization mode, the data mapping mode, etc.\n### </summary>\nclass HistoryWithCustomDataSourceRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 6)\n\n        self.aapl = self.add_data(CustomData, \"AAPL\", Resolution.MINUTE).symbol\n        self.spy = self.add_data(CustomData, \"SPY\", Resolution.MINUTE).symbol\n\n    def on_end_of_algorithm(self):\n        aapl_history = self.history(CustomData, self.aapl, self.start_date, self.end_date, Resolution.MINUTE,\n            fill_forward=False, extended_market_hours=False, data_normalization_mode=DataNormalizationMode.RAW).droplevel(0, axis=0)\n        spy_history = self.history(CustomData, self.spy, self.start_date, self.end_date, Resolution.MINUTE,\n            fill_forward=False, extended_market_hours=False, data_normalization_mode=DataNormalizationMode.RAW).droplevel(0, axis=0)\n\n        if aapl_history.size == 0 or spy_history.size == 0:\n            raise AssertionError(\"At least one of the history results is empty\")\n\n        # Check that both resutls contain the same data, since CustomData fetches APPL data regardless of the symbol\n        if not aapl_history.equals(spy_history):\n            raise AssertionError(\"Histories are not equal\")\n\nclass CustomData(PythonData):\n    '''Custom data source for the regression test algorithm, which returns AAPL equity data regardless of the symbol requested.'''\n\n    def get_source(self, config, date, is_live_mode):\n        return TradeBar().get_source(\n            SubscriptionDataConfig(\n                config,\n                CustomData,\n                # Create a new symbol as equity so we find the existing data files\n                # Symbol.create(config.mapped_symbol, SecurityType.EQUITY, config.market)),\n                Symbol.create(\"AAPL\", SecurityType.EQUITY, config.market)),\n            date,\n            is_live_mode)\n\n    def reader(self, config, line, date, is_live_mode):\n        trade_bar = TradeBar.parse_equity(config, line, date)\n        data = CustomData()\n        data.Symbol = config.symbol\n        data.time = trade_bar.time\n        data.value = trade_bar.value\n        data.close = trade_bar.close\n        data.open = trade_bar.open\n        data.high = trade_bar.high\n        data.low = trade_bar.low\n        data.volume = trade_bar.volume\n\n        return data\n"
  },
  {
    "path": "Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating how to request history data for continuous contracts with different depth offsets.\n### </summary>\nclass HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2014, 1, 1)\n        self._continuous_contract_symbol = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.DAILY).symbol\n\n    def on_end_of_algorithm(self):\n        contract_depth_offsets = range(3)\n        history_results = [\n            self.history([self._continuous_contract_symbol], self.start_date, self.end_date, Resolution.DAILY, contract_depth_offset=contract_depth_offset)\n                .droplevel(0, axis=0)\n                .loc[self._continuous_contract_symbol]\n                .close\n            for contract_depth_offset in contract_depth_offsets\n        ]\n\n        if any(x.size == 0 or x.size != history_results[0].size for x in history_results):\n            raise AssertionError(\"History results are empty or bar counts did not match\")\n\n        # Check that prices at each time are different for different contract depth offsets\n        for j in range(history_results[0].size):\n            close_prices = set(history_results[i][j] for i in range(len(history_results)))\n            if len(close_prices) != len(contract_depth_offsets):\n                raise AssertionError(\"History results close prices should have been different for each data mapping mode at each time\")\n"
  },
  {
    "path": "Algorithm.Python/HistoryWithDifferentDataMappingModeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating how to request history data for different data mapping modes.\n### </summary>\nclass HistoryWithDifferentDataMappingModeRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 6)\n        self.set_end_date(2014, 1, 1)\n        self._continuous_contract_symbol = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.DAILY).symbol\n\n    def on_end_of_algorithm(self):\n        history_results = [\n            self.history([self._continuous_contract_symbol], self.start_date, self.end_date, Resolution.DAILY, data_mapping_mode=data_mapping_mode)\n                .droplevel(0, axis=0)\n                .loc[self._continuous_contract_symbol]\n                .close\n            for data_mapping_mode in DataMappingMode\n        ]\n\n        if any(x.size != history_results[0].size for x in history_results):\n            raise AssertionError(\"History results bar count did not match\")\n\n        # Check that close prices at each time are different for different data mapping modes\n        for j in range(history_results[0].size):\n            close_prices = set(history_results[i][j] for i in range(len(history_results)))\n            if len(close_prices) != len(DataMappingMode):\n                raise AssertionError(\"History results close prices should have been different for each data mapping mode at each time\")\n"
  },
  {
    "path": "Algorithm.Python/HistoryWithDifferentDataNormalizationModeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm illustrating how to request history data for different data normalization modes.\n### </summary>\nclass HistoryWithDifferentDataNormalizationModeRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2014, 1, 1)\n        self.aapl_equity_symbol = self.add_equity(\"AAPL\", Resolution.DAILY).symbol\n        self.es_future_symbol = self.add_future(Futures.Indices.SP_500_E_MINI, Resolution.DAILY).symbol\n\n    def on_end_of_algorithm(self):\n        equity_data_normalization_modes = [\n            DataNormalizationMode.RAW,\n            DataNormalizationMode.ADJUSTED,\n            DataNormalizationMode.SPLIT_ADJUSTED\n        ]\n        self.check_history_results_for_data_normalization_modes(self.aapl_equity_symbol, self.start_date, self.end_date, Resolution.DAILY,\n            equity_data_normalization_modes)\n\n        future_data_normalization_modes = [\n            DataNormalizationMode.RAW,\n            DataNormalizationMode.BACKWARDS_RATIO,\n            DataNormalizationMode.BACKWARDS_PANAMA_CANAL,\n            DataNormalizationMode.FORWARD_PANAMA_CANAL\n        ]\n        self.check_history_results_for_data_normalization_modes(self.es_future_symbol, self.start_date, self.end_date, Resolution.DAILY,\n            future_data_normalization_modes)\n\n    def check_history_results_for_data_normalization_modes(self, symbol, start, end, resolution, data_normalization_modes):\n        history_results = [self.history([symbol], start, end, resolution, data_normalization_mode=x) for x in data_normalization_modes]\n        history_results = [x.droplevel(0, axis=0) for x in history_results] if len(history_results[0].index.levels) == 3 else history_results\n        history_results = [x.loc[symbol].close for x in history_results]\n\n        if any(x.size == 0 or x.size != history_results[0].size for x in history_results):\n            raise AssertionError(f\"History results for {symbol} have different number of bars\")\n\n        # Check that, for each history result, close prices at each time are different for these securities (AAPL and ES)\n        for j in range(history_results[0].size):\n            close_prices = set(history_results[i][j] for i in range(len(history_results)))\n            if len(close_prices) != len(data_normalization_modes):\n                raise AssertionError(f\"History results for {symbol} have different close prices at the same time\")\n"
  },
  {
    "path": "Algorithm.Python/HourReverseSplitRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test for consistency of hour data over a reverse split event in US equities.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass HourReverseSplitRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 11, 7)\n        self.set_end_date(2013, 11, 8)\n        self.set_cash(100000)\n        self.set_benchmark(lambda x: 0)\n\n        self._symbol = self.add_equity(\"VXX.1\", Resolution.HOUR).symbol\n    \n    def on_data(self, slice):\n        if slice.bars.count == 0: return\n        if (not self.portfolio.invested) and self.time.date() == self.end_date.date():\n            self.buy(self._symbol, 1)\n"
  },
  {
    "path": "Algorithm.Python/HourSplitRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test for consistency of hour data over a reverse split event in US equities.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass HourSplitRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 6)\n        self.set_end_date(2014, 6, 9)\n        self.set_cash(100000)\n        self.set_benchmark(lambda x: 0)\n\n        self._symbol = self.add_equity(\"AAPL\", Resolution.HOUR).symbol\n    \n    def on_data(self, slice):\n        if slice.bars.count == 0: return\n        if (not self.portfolio.invested) and self.time.date() == self.end_date.date():\n            self.buy(self._symbol, 1)\n"
  },
  {
    "path": "Algorithm.Python/ImmediateExecutionModelWorksWithBinanceFeeModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# region imports\nfrom AlgorithmImports import *\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\nfrom QuantConnect.Orders import OrderEvent\n# endregion\n\n### <summary>\n### Regression algorithm to test ImmediateExecutionModel places orders with the\n### correct quantity (taking into account the fee's) so that the fill quantity\n### is the expected one.\n### </summary>\nclass ImmediateExecutionModelWorksWithBinanceFeeModel(QCAlgorithm):\n\n    def Initialize(self):\n        # *** initial configurations and backtest ***\n        self.set_start_date(2022, 12, 13)  # Set Start Date\n        self.set_end_date(2022, 12, 14)  # Set End Date\n        self.set_account_currency(\"BUSD\") # Set Account Currency\n        self.set_cash(\"BUSD\", 100000, 1)  # Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        symbols = [ Symbol.create(\"BTCBUSD\", SecurityType.CRYPTO, Market.BINANCE) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Resolution.MINUTE))\n        self.set_execution(ImmediateExecutionModel())\n        \n        \n        self.set_brokerage_model(BrokerageName.BINANCE, AccountType.MARGIN)\n    \n    def on_order_event(self, order_event: OrderEvent) -> None:\n        if order_event.status == OrderStatus.FILLED:\n            if abs(order_event.quantity - 5.8) > 0.01:\n                raise AssertionError(f\"The expected quantity was 5.8 but the quantity from the order was {order_event.quantity}\")\n"
  },
  {
    "path": "Algorithm.Python/InceptionDateSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test universe additions and removals with open positions\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass InceptionDateSelectionRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013,10,1)\n        self.set_end_date(2013,10,31)\n        self.set_cash(100000)\n\n        self.changes = None\n        self.universe_settings.resolution = Resolution.HOUR\n\n        # select IBM once a week, empty universe the other days\n        self.add_universe_selection(CustomUniverseSelectionModel(\"my-custom-universe\", lambda dt: [\"IBM\"] if dt.day % 7 == 0 else []))\n        # Adds SPY 5 days after StartDate and keep it in Universe\n        self.add_universe_selection(InceptionDateUniverseSelectionModel(\"spy-inception\", {\"SPY\": self.start_date + timedelta(5)}))\n\n\n    def on_data(self, slice):\n        if self.changes is None:\n           return\n\n        # we'll simply go long each security we added to the universe\n        for security in self.changes.added_securities:\n            self.set_holdings(security.symbol, .5)\n\n        self.changes = None\n\n    def on_securities_changed(self, changes):\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            self.liquidate(security.symbol, \"Removed from Universe\")\n\n        self.changes = changes\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#region imports\nfrom AlgorithmImports import *\n#endregion\n\nclass IndexOptionBearCallSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2021, 1, 1)\n        self.set_cash(100000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"VIX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"VIXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.strikes(-5, 5).expiration(15, 45))\n        \n        self.vixw = option.symbol\n        self.tickets = []\n\n    def on_data(self, slice: Slice) -> None:\n        if not self.portfolio[self.spy].invested:\n            self.market_order(self.spy, 100)\n        \n        # Return if hedge position presents\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]):\n            return\n\n        # Return if hedge position presents\n        chain = slice.option_chains.get(self.vixw)\n        if not chain: return\n\n        # Get the nearest expiry date of the contracts\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the call Option contracts with the nearest expiry and sort by strike price\n        calls = sorted([i for i in chain if i.expiry == expiry and i.right == OptionRight.CALL], \n                        key=lambda x: x.strike)\n        if len(calls) < 2: return\n        \n        # Buy the bear call spread\n        bear_call_spread = OptionStrategies.bear_call_spread(self.vixw, calls[0].strike, calls[-1].strike, expiry)\n        self.tickets = self.buy(bear_call_spread, 1)\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndexOptionBearPutSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2022, 1, 1)\n        self.set_end_date(2022, 7, 1)\n        self.set_cash(100000)\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.weeklys_only().strikes(5, 10).expiration(0, 0))\n        \n        self.spxw = option.symbol\n        self.tickets = []\n\n    def on_data(self, slice: Slice) -> None:\n        # Return if open position exists\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]):\n            return\n\n        # Get option chain\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get the nearest expiry date of the contracts\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the put Option contracts with the nearest expiry and sort by strike price\n        puts = sorted([i for i in chain if i.expiry == expiry and i.right == OptionRight.PUT], \n                        key=lambda x: x.strike)\n        if len(puts) < 2: return\n\n        # Buy the bear put spread\n        bear_put_spread = OptionStrategies.bear_put_spread(self.spxw, puts[-1].strike, puts[0].strike, expiry)\n        self.tickets = self.buy(bear_put_spread, 1)"
  },
  {
    "path": "Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#region imports\nfrom AlgorithmImports import *\n#endregion\n\nclass IndexOptionBullCallSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2021, 1, 1)\n        self.set_cash(100000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.weeklys_only().strikes(-5, 5).expiration(40, 60))\n        \n        self.spxw = option.symbol\n        self.tickets: list[OrderTicket] = list()\n\n    def on_data(self, slice: Slice) -> None:\n        if not self.portfolio[self.spy].invested:\n            self.market_order(self.spy, 100)\n        \n        # Return if hedge position presents\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]):\n            return\n\n        # Return if hedge position presents\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get the nearest expiry date of the contracts\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the call Option contracts with the nearest expiry and sort by strike price\n        calls = sorted([i for i in chain if i.expiry == expiry and i.right == OptionRight.CALL], \n                        key=lambda x: x.strike)\n        if len(calls) < 2: return\n\n        # Buy the bull call spread\n        bull_call_spread = OptionStrategies.bull_call_spread(self.spxw, calls[0].strike, calls[-1].strike, expiry)\n        self.tickets = self.buy(bull_call_spread, 1)\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndexOptionBullPutSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2019, 1, 1)\n        self.set_end_date(2020, 1, 1)\n        self.set_cash(100000)\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.weeklys_only().strikes(-10, -5).expiration(0, 0))\n        \n        self.spxw = option.symbol\n        self.tickets = []\n\n    def on_data(self, slice: Slice) -> None:\n        # Return if open position exists\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]):\n            return\n\n        # Get option chain\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get the nearest expiry date of the contracts\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the put Option contracts with the nearest expiry and sort by strike price\n        puts = sorted([i for i in chain if i.expiry == expiry and i.right == OptionRight.PUT], \n                        key=lambda x: x.strike)\n        if len(puts) < 2: return\n\n        # Buy the bull put spread\n        bull_call_spread = OptionStrategies.bull_put_spread(self.spxw, puts[-1].strike, puts[0].strike, expiry)\n        self.tickets = self.buy(bull_call_spread, 1)"
  },
  {
    "path": "Algorithm.Python/IndexOptionBuySellCallIntradayRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option calls across different strike prices.\n### We expect 4* orders from the algorithm, which are:\n###\n###   * (1) Initial entry, buy SPX Call Option (SPXF21 expiring ITM)\n###   * (2) Initial entry, sell SPX Call Option at different strike (SPXF21 expiring ITM)\n###   * [2] Option assignment, settle into cash\n###   * [1] Option exercise, settle into cash\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n###\n### * Assignments are counted as orders\n### </summary>\nclass IndexOptionBuySellCallIntradayRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        spx_options = list(sorted([\n            self.add_index_option_contract(i, Resolution.MINUTE).symbol \\\n                for i in self.option_chain(spx)\\\n                    if (i.id.strike_price == 3700 or i.id.strike_price == 3800) and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1],\n            key=lambda x: x.id.strike_price\n        ))\n\n        expectedContract3700 = Symbol.create_option(\n            spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.CALL,\n            3700,\n            datetime(2021, 1, 15)\n        )\n\n        expectedContract3800 = Symbol.create_option(\n            spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.CALL,\n            3800,\n            datetime(2021, 1, 15)\n        )\n\n        if len(spx_options) != 2:\n            raise AssertionError(f\"Expected 2 index options symbols from chain provider, found {spx_options.count}\")\n\n        if spx_options[0] != expectedContract3700:\n            raise AssertionError(f\"Contract {expectedContract3700} was not found in the chain, found instead: {spx_options[0]}\")\n\n        if spx_options[1] != expectedContract3800:\n            raise AssertionError(f\"Contract {expectedContract3800} was not found in the chain, found instead: {spx_options[1]}\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(spx, 1), lambda: self.after_market_open_trade(spx_options))\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.noon, lambda: self.liquidate())\n\n    def after_market_open_trade(self, spx_options):\n        self.market_order(spx_options[0], 1)\n        self.market_order(spx_options[1], -1)\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionCallButterflyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#region imports\nfrom AlgorithmImports import *\n#endregion\n\nclass IndexOptionCallButterflyAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2021, 1, 1)\n        self.set_cash(1000000)\n\n        self.vxz = self.add_equity(\"VXZ\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.include_weeklys().strikes(-3, 3).expiration(15, 45))\n\n        self.spxw = option.symbol\n        self.multiplier = option.symbol_properties.contract_multiplier\n        self.tickets = []\n\n    def on_data(self, slice: Slice) -> None:\n        # The order of magnitude per SPXW order's value is 10000 times of VXZ\n        if not self.portfolio[self.vxz].invested:\n            self.market_order(self.vxz, 10000)\n        \n        # Return if any opening index option position\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]): return\n\n        # Get the OptionChain\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get nearest expiry date\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the call Option contracts with nearest expiry and sort by strike price\n        calls = [x for x in chain if x.expiry == expiry and x.right == OptionRight.CALL]\n        if len(calls) < 3: return\n        sorted_call_strikes = sorted([x.strike for x in calls])\n\n        # Select ATM call\n        atm_strike = min([abs(x - chain.underlying.value) for x in sorted_call_strikes])\n\n        # Get the strike prices for the ITM & OTM contracts, make sure they're in equidistance\n        spread = min(atm_strike - sorted_call_strikes[0], sorted_call_strikes[-1] - atm_strike)\n        itm_strike = atm_strike - spread\n        otm_strike = atm_strike + spread\n        if otm_strike not in sorted_call_strikes or itm_strike not in sorted_call_strikes: return\n        \n        # Buy the call butterfly\n        call_butterfly = OptionStrategies.call_butterfly(self.spxw, otm_strike, atm_strike, itm_strike, expiry)\n        price = sum([abs(self.securities[x.symbol].price * x.quantity) * self.multiplier for x in call_butterfly.underlying_legs])\n        if price > 0:\n            quantity = int(self.portfolio.total_portfolio_value // price)\n            self.tickets = self.buy(call_butterfly, quantity, asynchronous=True)\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndexOptionCallCalendarSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2021, 1, 1)\n        self.set_cash(50000)\n\n        self.vxz = self.add_equity(\"VXZ\", Resolution.MINUTE).symbol\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"VIX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"VIXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.strikes(-2, 2).expiration(15, 45))\n        \n        self.vixw = option.symbol\n        self.multiplier = option.symbol_properties.contract_multiplier\n        self.legs = []\n        self.expiry = datetime.max\n\n    def on_data(self, slice: Slice) -> None:\n        # Liquidate if the shorter term option is about to expire\n        if self.expiry < self.time + timedelta(2) and all([slice.contains_key(x.symbol) for x in self.legs]):\n            self.liquidate()\n        # Return if there is any opening position\n        elif [leg for leg in self.legs if self.portfolio[leg.symbol].invested]:\n            return\n\n        # Get the OptionChain\n        chain = slice.option_chains.get(self.vixw)\n        if not chain: return\n\n        # Get ATM strike price\n        strike = sorted(chain, key = lambda x: abs(x.strike - chain.underlying.value))[0].strike\n        \n        # Select the ATM call Option contracts and sort by expiration date\n        calls = sorted([i for i in chain if i.strike == strike and i.right == OptionRight.CALL], \n                        key=lambda x: x.expiry)\n        if len(calls) < 2: return\n        self.expiry = calls[0].expiry\n\n        # Create combo order legs\n        self.legs = [\n            Leg.create(calls[0].symbol, -1),\n            Leg.create(calls[-1].symbol, 1),\n            Leg.create(self.vxz, -100),\n            Leg.create(self.spy, -10)\n        ]\n        quantity = self.portfolio.total_portfolio_value // \\\n            sum([abs(self.securities[x.symbol].price * x.quantity * \n                 (self.multiplier if x.symbol.id.security_type == SecurityType.INDEX_OPTION else 1))\n                 for x in self.legs])\n        self.combo_market_order(self.legs, -quantity, asynchronous=True)"
  },
  {
    "path": "Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option expiry for calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy SPX Call Option (expiring ITM)\n###   * Option exercise, settles into cash\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionCallITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(100000)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select an index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price <= 3200 and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price, reverse=True))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_option_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.CALL, 3200, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_option_contract:\n            raise AssertionError(f\"Contract {self.expected_option_contract} was not found in the chain\")\n\n        self.schedule.on(\n            self.date_rules.tomorrow,\n            self.time_rules.after_market_open(self.spx, 1),\n            lambda: self.market_order(self.spx_option, 1)\n        )\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            self.assert_index_option_order_exercise(order_event, security, self.securities[self.expected_option_contract])\n        elif security.symbol == self.expected_option_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n        self.log(f\"{self.time} -- {order_event.symbol} :: Price: {self.securities[order_event.symbol].holdings.price} Qty: {self.securities[order_event.symbol].holdings.quantity} Direction: {order_event.direction} Msg: {order_event.message}\")\n\n    def assert_index_option_order_exercise(self, order_event: OrderEvent, index: Security, option_contract: Security):\n        # No way to detect option exercise orders or any other kind of special orders\n        # other than matching strings, for now.\n        if \"Option Exercise\" in order_event.message:\n            if order_event.fill_price != 3200:\n                raise AssertionError(\"Option did not exercise at expected strike price (3200)\")\n\n            if option_contract.holdings.quantity != 0:\n                raise AssertionError(f\"Exercised option contract, but we have holdings for Option contract {option_contract.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after a filled option exercise\")\n        if \"Exercise\" in order_event.message and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after exercising option contract {option.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option expiry for calls.\n### We test to make sure that index options have greeks enabled, same as equity options.\n### </summary>\nclass IndexOptionCallITMGreeksExpiryRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.on_data_calls = 0\n        self.invested = False\n\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        spx = self.add_index(\"SPX\", Resolution.MINUTE)\n        spx.volatility_model = StandardDeviationOfReturnsVolatilityModel(60, Resolution.MINUTE, timedelta(minutes=1))\n        self.spx = spx.symbol\n\n        # Select a index option call expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price <= 3200 and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price, reverse=True))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE)\n\n        self.spx_option.price_model = OptionPriceModels.black_scholes()\n\n        self.expected_option_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.CALL, 3200, datetime(2021, 1, 15))\n        if self.spx_option.symbol != self.expected_option_contract:\n            raise AssertionError(f\"Contract {self.expected_option_contract} was not found in the chain\")\n\n    def on_data(self, data: Slice):\n        # Let the algo warmup, but without using SetWarmup. Otherwise, we get\n        # no contracts in the option chain\n        if self.invested or self.on_data_calls < 40:\n            self.on_data_calls += 1\n            return\n\n        self.on_data_calls += 1\n\n        if data.option_chains.count == 0:\n            return\n\n        if all([any([c.symbol not in data for c in o.contracts.values()]) for o in data.option_chains.values()]):\n            return\n\n        if len(list(list(data.option_chains.values())[0].contracts.values())) == 0:\n            raise AssertionError(f\"No contracts found in the option {list(data.option_chains.keys())[0]}\")\n\n        deltas = [i.greeks.delta for i in self.sort_by_max_volume(data)]\n        gammas = [i.greeks.gamma for i in self.sort_by_max_volume(data)] #data.option_chains.values().order_by_descending(y => y.contracts.values().sum(x => x.volume)).first().contracts.values().select(x => x.greeks.gamma).to_list()\n        rho = [i.greeks.rho for i in self.sort_by_max_volume(data)] #data.option_chains.values().order_by_descending(y => y.contracts.values().sum(x => x.volume)).first().contracts.values().select(x => x.greeks.rho).to_list()\n        theta = [i.greeks.theta for i in self.sort_by_max_volume(data)] #data.option_chains.values().order_by_descending(y => y.contracts.values().sum(x => x.volume)).first().contracts.values().select(x => x.greeks.theta).to_list()\n        vega = [i.greeks.vega for i in self.sort_by_max_volume(data)] #data.option_chains.values().order_by_descending(y => y.contracts.values().sum(x => x.volume)).first().contracts.values().select(x => x.greeks.vega).to_list()\n\n        # The commented out test cases all return zero.\n        # This is because of failure to evaluate the greeks in the option pricing model, most likely\n        # due to us not clearing the default 30 day requirement for the volatility model to start being updated.\n        if any([i for i in deltas if i == 0]):\n            raise AssertionError(\"Option contract Delta was equal to zero\")\n\n        # Delta is 1, therefore we expect a gamma of 0\n        if any([i for i in gammas if i == 0]):\n            raise AssertionError(\"Option contract Gamma was equal to zero\")\n\n        if any([i for i in rho if i == 0]):\n            raise AssertionError(\"Option contract Rho was equal to zero\")\n\n        if any([i for i in theta if i == 0]):\n            raise AssertionError(\"Option contract Theta was equal to zero\")\n\n        # The strike is far away from the underlying asset's price, and we're very close to expiry.\n        # Zero is an expected value here.\n        if any([i for i in vega if vega == 0]):\n            raise AggregateException(\"Option contract Vega was equal to zero\")\n\n        if not self.invested:\n            self.set_holdings(list(list(data.option_chains.values())[0].contracts.values())[0].symbol, 1)\n            self.invested = True\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n\n        if not self.invested:\n            raise AssertionError(f\"Never checked greeks, maybe we have no option data?\")\n\n    def sort_by_max_volume(self, data: Slice):\n        chain = [i for i in sorted(list(data.option_chains.values()), key=lambda x: sum([j.volume for j in x.contracts.values()]), reverse=True)][0]\n        return chain.contracts.values()\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) index option expiry for calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy SPX Call Option (expiring OTM)\n###     - contract expires worthless, not exercised, so never opened a position in the underlying\n###\n###   * Liquidation of worthless SPX call option (expiring OTM)\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\n### <remarks>\n### Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n### See related issue: https://github.com/QuantConnect/Lean/issues/4854\n### </remarks>\nclass IndexOptionCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option call expiring OTM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price >= 4250 and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(\n            self.spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.CALL,\n            4250,\n            datetime(2021, 1, 15)\n        )\n\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(\n            self.date_rules.tomorrow,\n            self.time_rules.after_market_open(self.spx, 1),\n            lambda: self.market_order(self.spx_option, 1)\n        )\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            raise AssertionError(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(\"Holdings were found after a filled option exercise\")\n        if order_event.direction == OrderDirection.SELL and not \"OTM\" in order_event.message:\n            raise AssertionError(\"Contract did not expire OTM\")\n        if \"Exercise\" in order_event.message:\n            raise AssertionError(\"Exercised option, even though it expires OTM\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionChainApisConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import datetime\nfrom AlgorithmImports import *\n\nfrom OptionChainApisConsistencyRegressionAlgorithm import OptionChainApisConsistencyRegressionAlgorithm\n\n### <summary>\n### Regression algorithm asserting that the option chain APIs return consistent values for index options.\n### See QCAlgorithm.OptionChain(Symbol) and QCAlgorithm.OptionChainProvider\n### </summary>\nclass IndexOptionChainApisConsistencyRegressionAlgorithm(OptionChainApisConsistencyRegressionAlgorithm):\n\n    def get_test_date(self) -> datetime:\n        return datetime(2021, 1, 4)\n\n    def get_option(self) -> Option:\n        return self.add_index_option(\"SPX\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionIronCondorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#region imports\nfrom AlgorithmImports import *\n#endregion\n\nclass IndexOptionIronCondorAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2019, 9, 1)\n        self.set_end_date(2019, 11, 1)\n        self.set_cash(100000)\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.weeklys_only().strikes(-5, 5).expiration(0, 14))\n        self.spxw = option.symbol\n\n        self._bb = self.bb(index, 10, 2, resolution=Resolution.DAILY)\n        self.warm_up_indicator(index, self._bb)\n\n    def on_data(self, slice: Slice) -> None:\n        if self.portfolio.invested: return\n\n        # Get the OptionChain\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get the closest expiry date\n        expiry = min([x.expiry for x in chain])\n        contracts = [x for x in chain if x.expiry == expiry]\n\n        # Separate the call and put contracts and sort by Strike to find OTM contracts\n        calls = sorted([x for x in contracts if x.right == OptionRight.CALL], key=lambda x: x.strike, reverse=True)\n        puts = sorted([x for x in contracts if x.right == OptionRight.PUT], key=lambda x: x.strike)\n        if len(calls) < 3 or len(puts) < 3: return\n\n        # Create combo order legs\n        price = self._bb.price.current.value\n        quantity = 1\n        if price > self._bb.upper_band.current.value or price < self._bb.lower_band.current.value:\n            quantity = -1\n\n        legs = [\n            Leg.create(calls[0].symbol, quantity),\n            Leg.create(puts[0].symbol, quantity),\n            Leg.create(calls[2].symbol, -quantity),\n            Leg.create(puts[2].symbol, -quantity)\n        ]\n\n        self.combo_market_order(legs, 10, asynchronous=True)\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionModelsConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionModelsConsistencyRegressionAlgorithm import OptionModelsConsistencyRegressionAlgorithm\n\n### <summary>\n### Algorithm asserting that when setting custom models for canonical index options, a one-time warning is sent\n### informing the user that the contracts models are different (not the custom ones).\n### </summary>\nclass IndexOptionModelsConsistencyRegressionAlgorithm(OptionModelsConsistencyRegressionAlgorithm):\n\n    def initialize_algorithm(self) -> Security:\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 5)\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE)\n        option = self.add_index_option(index.symbol, \"SPX\", Resolution.MINUTE)\n        option.set_filter(lambda u: u.strikes(-5, +5).expiration(0, 360))\n\n        return option\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionPutButterflyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#region imports\nfrom AlgorithmImports import *\n#endregion\n\nclass IndexOptionPutButterflyAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2021, 1, 1)\n        self.set_cash(1000000)\n\n        self.vxz = self.add_equity(\"VXZ\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"SPXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.include_weeklys().strikes(-3, 3).expiration(15, 45))\n\n        self.spxw = option.symbol\n        self.multiplier = option.symbol_properties.contract_multiplier\n        self.tickets = []\n\n    def on_data(self, slice: Slice) -> None:\n        # The order of magnitude per SPXW order's value is 10000 times of VXZ\n        if not self.portfolio[self.vxz].invested:\n            self.market_order(self.vxz, 10000)\n        \n        # Return if any opening index option position\n        if any([self.portfolio[x.symbol].invested for x in self.tickets]): return\n\n        # Get the OptionChain\n        chain = slice.option_chains.get(self.spxw)\n        if not chain: return\n\n        # Get nearest expiry date\n        expiry = min([x.expiry for x in chain])\n        \n        # Select the put Option contracts with nearest expiry and sort by strike price\n        puts = [x for x in chain if x.expiry == expiry and x.right == OptionRight.PUT]\n        if len(puts) < 3: return\n        sorted_put_strikes = sorted([x.strike for x in puts])\n\n        # Select ATM put\n        atm_strike = min([abs(x - chain.underlying.value) for x in sorted_put_strikes])\n\n        # Get the strike prices for the ITM & OTM contracts, make sure they're in equidistance\n        spread = min(atm_strike - sorted_put_strikes[0], sorted_put_strikes[-1] - atm_strike)\n        otm_strike = atm_strike - spread\n        itm_strike = atm_strike + spread\n        if otm_strike not in sorted_put_strikes or itm_strike not in sorted_put_strikes: return\n        \n        # Buy the put butterfly\n        put_butterfly = OptionStrategies.put_butterfly(self.spxw, itm_strike, atm_strike, otm_strike, expiry)\n        price = sum([abs(self.securities[x.symbol].price * x.quantity) * self.multiplier for x in put_butterfly.underlying_legs])\n        if price > 0:\n            quantity = int(self.portfolio.total_portfolio_value // price)\n            self.tickets = self.buy(put_butterfly, quantity, asynchronous=True)\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionPutCalendarSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndexOptionPutCalendarSpreadAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)\n        self.set_end_date(2023, 1, 1)\n        self.set_cash(50000)\n\n        self.vxz = self.add_equity(\"VXZ\", Resolution.MINUTE).symbol\n\n        index = self.add_index(\"VIX\", Resolution.MINUTE).symbol\n        option = self.add_index_option(index, \"VIXW\", Resolution.MINUTE)\n        option.set_filter(lambda x: x.strikes(-2, 2).expiration(15, 45))\n        \n        self.vixw = option.symbol\n        self.tickets = []\n        self.expiry = datetime.max\n\n    def on_data(self, slice: Slice) -> None:\n        if not self.portfolio[self.vxz].invested:\n            self.market_order(self.vxz, 100)\n        \n        index_options_invested = [leg for leg in self.tickets if self.portfolio[leg.symbol].invested]\n        # Liquidate if the shorter term option is about to expire\n        if self.expiry < self.time + timedelta(2) and all([slice.contains_key(x.symbol) for x in self.tickets]):\n            for holding in index_options_invested:\n                self.liquidate(holding.symbol)\n        # Return if there is any opening index option position\n        elif index_options_invested:\n            return\n\n        # Get the OptionChain\n        chain = slice.option_chains.get(self.vixw)\n        if not chain: return\n\n        # Get ATM strike price\n        strike = sorted(chain, key = lambda x: abs(x.strike - chain.underlying.value))[0].strike\n        \n        # Select the ATM put Option contracts and sort by expiration date\n        puts = sorted([i for i in chain if i.strike == strike and i.right == OptionRight.PUT], \n                        key=lambda x: x.expiry)\n        if len(puts) < 2: return\n        self.expiry = puts[0].expiry\n\n        # Sell the put calendar spread\n        put_calendar_spread = OptionStrategies.put_calendar_spread(self.vixw, strike, self.expiry, puts[-1].expiry)\n        self.tickets = self.sell(put_calendar_spread, 1, asynchronous=True)"
  },
  {
    "path": "Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option expiry for puts.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy ES Put Option (expiring ITM) (buy, qty 1)\n###   * Option exercise, receiving cash (sell, qty -1)\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionPutITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price >= 4200 and i.id.option_right == OptionRight.PUT and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.PUT, 4200, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.spx, 1), lambda: self.market_order(self.spx_option, 1))\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            self.assert_index_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n        elif security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_order_exercise(self, order_event: OrderEvent, index: Security, option_contract: Security):\n        expected_liquidation_time_utc = datetime(2021, 1, 15)\n\n        if order_event.direction == OrderDirection.BUY and order_event.utc_time != expected_liquidation_time_utc:\n            raise AssertionError(f\"Liquidated index option contract, but not at the expected time. Expected: {expected_liquidation_time_utc} - found {order_event.utc_time}\")\n\n        # No way to detect option exercise orders or any other kind of special orders\n        # other than matching strings, for now.\n        if \"Option Exercise\" in order_event.message:\n            if order_event.fill_price != 3300:\n                raise AssertionError(\"Option did not exercise at expected strike price (3300)\")\n\n            if option_contract.holdings.quantity != 0:\n                raise AssertionError(f\"Exercised option contract, but we have holdings for Option contract {option_contract.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after a filled option exercise\")\n        if \"Exercise\" in order_event.message and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after exercising option contract {option.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) index option expiry for calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, buy SPX Call Option (expiring OTM)\n###     - contract expires worthless, not exercised, so never opened a position in the underlying\n###\n###   * Liquidation of worthless SPX call option (expiring OTM)\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\n### <remarks>\n### Total Trades in regression algorithm should be 1, but expiration is counted as a trade.\n### See related issue: https://github.com/QuantConnect/Lean/issues/4854\n### </remarks>\nclass IndexOptionCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option call expiring OTM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price <= 3200 and i.id.option_right == OptionRight.PUT and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price, reverse=True))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(\n            self.spx,\n            Market.USA,\n            OptionStyle.EUROPEAN,\n            OptionRight.PUT,\n            3200,\n            datetime(2021, 1, 15)\n        )\n\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(\n            self.date_rules.tomorrow,\n            self.time_rules.after_market_open(self.spx, 1),\n            lambda: self.market_order(self.spx_option, 1)\n        )\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            raise AssertionError(\"Invalid state: did not expect a position for the underlying to be opened, since this contract expires OTM\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.BUY and option.holdings.quantity != 1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != 0:\n            raise AssertionError(\"Holdings were found after a filled option exercise\")\n        if order_event.direction == OrderDirection.SELL and not \"OTM\" in order_event.message:\n            raise AssertionError(\"Contract did not expire OTM\")\n        if \"Exercise\" in order_event.message:\n            raise AssertionError(\"Exercised option, even though it expires OTM\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option expiry for short calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell SPX Call Option (expiring ITM)\n###   * Option assignment\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionShortCallITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(1000000)\n\n        self.portfolio.set_margin_call_model(MarginCallModel.NULL);\n\n        # avoid getting assigned\n        self.set_security_initializer(CompositeSecurityInitializer(self.security_initializer, FuncSecurityInitializer(self.custom_security_initializer)))\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_option_filtered = [i for i in self.spx_options if i.id.strike_price <= 3200 and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option = list(sorted(self.spx_option_filtered, key=lambda x: x.id.strike_price, reverse=True))[0].symbol\n        self.add_index_option_contract(self.spx_option, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.CALL, 3200, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract self.expected_contract was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.spx, 1), lambda: self.market_order(self.spx_option, -1))\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            self.assert_index_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n        elif security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_order_exercise(self, order_event: OrderEvent, index: Security, option_contract: Security):\n        if \"Assignment\" in order_event.message:\n            if order_event.fill_price != 3200:\n                raise AssertionError(\"Option was not assigned at expected strike price (3200)\")\n\n            if order_event.direction != OrderDirection.SELL or index.holdings.quantity != 0:\n                raise AssertionError(f\"Expected Qty: 0 index holdings for assigned index option {index.symbol}, found {index.holdings.quantity}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.is_assignment and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after option contract was assigned: {option.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n\n    def custom_security_initializer(self, security):\n        if Extensions.is_option(security.symbol.security_type):\n            security.set_option_assignment_model(NullOptionAssignmentModel())\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) index option expiry for short calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell SPX Call Option (expiring OTM)\n###     - Profit the option premium, since the option was not assigned.\n###\n###   * Liquidation of SPX call OTM contract on the last trade date\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionShortCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price >= 4250 and i.id.option_right == OptionRight.CALL and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.CALL, 4250, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.spx, 1), lambda: self.market_order(self.spx_option, -1))\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            raise AssertionError(f\"Expected no order events for underlying Symbol {security.symbol}\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option_contract: Security):\n        if order_event.direction == OrderDirection.SELL and option_contract.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option_contract.symbol}\")\n        if order_event.direction == OrderDirection.BUY and option_contract.holdings.quantity != 0:\n            raise AssertionError(\"Expected no options holdings after closing position\")\n        if order_event.is_assignment:\n            raise AssertionError(f\"Assignment was not expected for {order_event.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests In The Money (ITM) index option expiry for short calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell SPX Call Option (expiring ITM)\n###   * Option assignment\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionShortCallITMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n        self.set_cash(1000000)\n\n        self.portfolio.set_margin_call_model(MarginCallModel.NULL);\n\n        # avoid getting assigned\n        self.set_security_initializer(CompositeSecurityInitializer(self.security_initializer, FuncSecurityInitializer(self.custom_security_initializer)))\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price <= 4200 and i.id.option_right == OptionRight.PUT and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price, reverse=True))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.PUT, 4200, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract self.expected_contract was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.spx, 1), lambda: self.market_order(self.spx_option, -1))\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            self.assert_index_option_order_exercise(order_event, security, self.securities[self.expected_contract])\n        elif security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_order_exercise(self, order_event: OrderEvent, index: Security, option_contract: Security):\n        if \"Assignment\" in order_event.message:\n            if order_event.fill_price != 4200:\n                raise AssertionError(\"Option was not assigned at expected strike price (4200)\")\n\n            if order_event.direction != OrderDirection.SELL or index.holdings.quantity != 0:\n                raise AssertionError(f\"Expected Qty: 0 index holdings for assigned index option {index.symbol}, found {index.holdings.quantity}\")\n\n        elif index.holdings.quantity != 0:\n            raise AssertionError(f\"Expected no holdings in index: {index.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option: Security):\n        if order_event.direction == OrderDirection.SELL and option.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option.symbol}\")\n\n        if order_event.is_assignment and option.holdings.quantity != 0:\n            raise AssertionError(f\"Holdings were found after option contract was assigned: {option.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n\n    def custom_security_initializer(self, security):\n        if Extensions.is_option(security.symbol.security_type):\n            security.set_option_assignment_model(NullOptionAssignmentModel())\n"
  },
  {
    "path": "Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests Out of The Money (OTM) index option expiry for short calls.\n### We expect 2 orders from the algorithm, which are:\n###\n###   * Initial entry, sell SPX Call Option (expiring OTM)\n###     - Profit the option premium, since the option was not assigned.\n###\n###   * Liquidation of SPX call OTM contract on the last trade date\n###\n### Additionally, we test delistings for index options and assert that our\n### portfolio holdings reflect the orders the algorithm has submitted.\n### </summary>\nclass IndexOptionShortCallOTMExpiryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2021, 1, 4)\n        self.set_end_date(2021, 1, 31)\n\n        self.spx = self.add_index(\"SPX\", Resolution.MINUTE).symbol\n\n        # Select a index option expiring ITM, and adds it to the algorithm.\n        self.spx_options = list(self.option_chain(self.spx))\n        self.spx_options = [i for i in self.spx_options if i.id.strike_price <= 3200 and i.id.option_right == OptionRight.PUT and i.id.date.year == 2021 and i.id.date.month == 1]\n        self.spx_option_contract = list(sorted(self.spx_options, key=lambda x: x.id.strike_price, reverse=True))[0]\n        self.spx_option = self.add_index_option_contract(self.spx_option_contract, Resolution.MINUTE).symbol\n\n        self.expected_contract = Symbol.create_option(self.spx, Market.USA, OptionStyle.EUROPEAN, OptionRight.PUT, 3200, datetime(2021, 1, 15))\n        if self.spx_option != self.expected_contract:\n            raise AssertionError(f\"Contract {self.expected_contract} was not found in the chain\")\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.after_market_open(self.spx, 1), lambda: self.market_order(self.spx_option, -1))\n\n    def on_data(self, data: Slice):\n        # Assert delistings, so that we can make sure that we receive the delisting warnings at\n        # the expected time. These assertions detect bug #4872\n        for delisting in data.delistings.values():\n            if delisting.type == DelistingType.WARNING:\n                if delisting.time != datetime(2021, 1, 15):\n                    raise AssertionError(f\"Delisting warning issued at unexpected date: {delisting.time}\")\n\n            if delisting.type == DelistingType.DELISTED:\n                if delisting.time != datetime(2021, 1, 16):\n                    raise AssertionError(f\"Delisting happened at unexpected date: {delisting.time}\")\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status != OrderStatus.FILLED:\n            # There's lots of noise with OnOrderEvent, but we're only interested in fills.\n            return\n\n        if order_event.symbol not in self.securities:\n            raise AssertionError(f\"Order event Symbol not found in Securities collection: {order_event.symbol}\")\n\n        security = self.securities[order_event.symbol]\n        if security.symbol == self.spx:\n            raise AssertionError(f\"Expected no order events for underlying Symbol {security.symbol}\")\n\n        if security.symbol == self.expected_contract:\n            self.assert_index_option_contract_order(order_event, security)\n        else:\n            raise AssertionError(f\"Received order event for unknown Symbol: {order_event.symbol}\")\n\n    def assert_index_option_contract_order(self, order_event: OrderEvent, option_contract: Security):\n        if order_event.direction == OrderDirection.SELL and option_contract.holdings.quantity != -1:\n            raise AssertionError(f\"No holdings were created for option contract {option_contract.symbol}\")\n        if order_event.direction == OrderDirection.BUY and option_contract.holdings.quantity != 0:\n            raise AssertionError(\"Expected no options holdings after closing position\")\n        if order_event.is_assignment:\n            raise AssertionError(f\"Assignment was not expected for {order_event.symbol}\")\n\n    ### <summary>\n    ### Ran at the end of the algorithm to ensure the algorithm has no holdings\n    ### </summary>\n    ### <exception cref=\"Exception\">The algorithm has holdings</exception>\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(f\"Expected no holdings at end of algorithm, but are invested in: {', '.join(self.portfolio.keys())}\")\n"
  },
  {
    "path": "Algorithm.Python/IndiaDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template framework algorithm uses framework components to define the algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass IndiaDataRegressionAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        \n        self.set_account_currency(\"INR\")\n        self.set_start_date(2004, 5, 20)\n        self.set_end_date(2016, 7, 26) \n        self._mapping_symbol = self.add_equity(\"3MINDIA\", Resolution.DAILY, Market.INDIA).symbol\n        self._split_and_dividend_symbol = self.add_equity(\"CCCL\", Resolution.DAILY, Market.INDIA).symbol\n        self._received_warning_event = False\n        self._received_occurred_event = False\n        self._initial_mapping = False\n        self._execution_mapping = False\n        self.debug(\"numpy test >>> print numpy.pi: \" + str(np.pi))\n\n    def on_dividends(self, dividends: Dividends):\n        if dividends.contains_key(self._split_and_dividend_symbol):\n            dividend = dividends[self._split_and_dividend_symbol]\n            if ((self.time.year == 2010 and self.time.month == 6 and self.time.day == 15) and\n                    (dividend.price != 0.5 or dividend.reference_price != 88.8 or dividend.distribution != 0.5)):\n                raise AssertionError(\"Did not receive expected dividend values\")\n\n    def on_splits(self, splits: Splits):\n        if splits.contains_key(self._split_and_dividend_symbol):\n            split = splits[self._split_and_dividend_symbol]\n            if split.type == SplitType.WARNING:\n                self._received_warning_event = True\n            elif split.type == SplitType.SPLIT_OCCURRED:\n                self._received_occurred_event = True\n                if split.price != 421.0 or split.reference_price != 421.0 or split.split_factor != 0.2:\n                    raise AssertionError(\"Did not receive expected price values\")\n\n    def on_symbol_changed_events(self, symbols_changed: SymbolChangedEvents):\n        if symbols_changed.contains_key(self._mapping_symbol):\n                mapping_event = [x.value for x in symbols_changed if x.key.security_type == 1][0]\n                if self.time.year == 1999 and self.time.month == 1 and self.time.day == 1:\n                    self._initial_mapping = True\n                elif self.time.year == 2004 and self.time.month == 6 and self.time.day == 15:\n                    if mapping_event.new_symbol == \"3MINDIA\" and mapping_event.old_symbol == \"BIRLA3M\":\n                        self._execution_mapping = True\n    \n    def on_end_of_algorithm(self):\n        if self._initial_mapping:\n            raise AssertionError(\"The ticker generated the initial rename event\")\n\n        if not self._execution_mapping:\n            raise AssertionError(\"The ticker did not rename throughout the course of its life even though it should have\")\n        \n        if not self._received_occurred_event:\n            raise AssertionError(\"Did not receive expected split event\")\n\n        if not self._received_warning_event:\n            raise AssertionError(\"Did not receive expected split warning event\")\n"
  },
  {
    "path": "Algorithm.Python/IndicatorExtensionsSMAWithCustomIndicatorsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndicatorExtensionsSMAWithCustomIndicatorsRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 2, 20)\n        self.set_end_date(2020, 4, 20)\n        self.qqq = self.add_equity(\"QQQ\", Resolution.DAILY).symbol\n        self.range_indicator = RangeIndicator(\"range1\")\n        self.range_sma = IndicatorExtensions.sma(self.range_indicator, 5)\n\n        self.range_indicator_2 = RangeIndicator2(\"range2\")\n        self.range_sma_2 = IndicatorExtensions.sma(self.range_indicator_2, 5)\n\n    def on_data(self, data):\n        self.range_indicator.update(data.bars.get(self.qqq))\n        self.range_indicator_2.update(data.bars.get(self.qqq))\n\n        self.debug(f\"{self.range_indicator.name} {self.range_indicator.value}\")\n        self.debug(f\"{self.range_sma.name} {self.range_sma.current.value}\")\n\n        self.debug(f\"{self.range_indicator_2.name} {self.range_indicator_2.value}\")\n        self.debug(f\"{self.range_sma_2.name} {self.range_sma_2.current.value}\")\n\n    def on_end_of_algorithm(self):\n        if not self.range_sma.is_ready:\n            raise AssertionError(f\"{self.range_sma.name} should have been ready at the end of the algorithm, but it wasn't. The indicator received {self.range_sma.samples} samples.\")\n\n        if not self.range_sma_2.is_ready:\n            raise AssertionError(f\"{self.range_sma_2.name} should have been ready at the end of the algorithm, but it wasn't. The indicator received {self.range_sma_2.samples} samples.\")\n\nclass RangeIndicator(PythonIndicator):\n    def __init__(self, name):\n        self.name = name\n        self.time = datetime.min\n        self.value = 0\n        self.is_ready = False\n\n    @property\n    def is_ready(self):\n        return self._is_ready\n\n    @is_ready.setter\n    def is_ready(self, value):\n        self._is_ready = value\n\n    def update(self, bar: TradeBar):\n        if bar is None:\n            return False\n\n        self.value = bar.high - bar.low\n        self.time = bar.time\n        self.is_ready = True\n        self.on_updated(IndicatorDataPoint(bar.end_time, self.value))\n        return True\n\nclass RangeIndicator2(PythonIndicator):\n    def __init__(self, name):\n        self.name = name\n        self.time = datetime.min\n        self.value = 0\n        self._is_ready = False\n\n    @property\n    def is_ready(self):\n        return self._is_ready\n\n    def update(self, bar: TradeBar):\n        if bar is None:\n            return False\n\n        self.value = bar.high - bar.low\n        self.time = bar.time\n        self._is_ready = True\n        self.on_updated(IndicatorDataPoint(bar.end_time, self.value))\n        return True\n"
  },
  {
    "path": "Algorithm.Python/IndicatorHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration algorithm of indicators history window usage\n### </summary>\nclass IndicatorHistoryAlgorithm(QCAlgorithm):\n    '''Demonstration algorithm of indicators history window usage.'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013, 1, 1)\n        self.set_end_date(2014, 12, 31)\n        self.set_cash(25000)\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n\n        self.bollinger_bands = self.bb(self._symbol, 20, 2.0, resolution=Resolution.DAILY)\n        # Let's keep BB values for a 20 day period\n        self.bollinger_bands.window.size = 20\n        # Also keep the same period of data for the middle band\n        self.bollinger_bands.middle_band.window.size = 20\n\n    def on_data(self, slice: Slice):\n        # Let's wait for our indicator to fully initialize and have a full window of history data\n        if not self.bollinger_bands.window.is_ready: return\n\n        # We can access the current and oldest (in our period) values of the indicator\n        self.log(f\"Current BB value: {self.bollinger_bands[0].end_time} - {self.bollinger_bands[0].value}\")\n        self.log(f\"Oldest BB value: {self.bollinger_bands[self.bollinger_bands.window.count - 1].end_time} - \"\n                 f\"{self.bollinger_bands[self.bollinger_bands.window.count - 1].value}\")\n\n        # Let's log the BB values for the last 20 days, for demonstration purposes on how it can be enumerated\n        for data_point in self.bollinger_bands:\n            self.log(f\"BB @{data_point.end_time}: {data_point.value}\")\n\n        # We can also do the same for internal indicators:\n        middle_band = self.bollinger_bands.middle_band\n        self.log(f\"Current BB Middle Band value: {middle_band[0].end_time} - {middle_band[0].value}\")\n        self.log(f\"Oldest BB Middle Band value: {middle_band[middle_band.window.count - 1].end_time} - \"\n                 f\"{middle_band[middle_band.window.count - 1].value}\")\n        for data_point in middle_band:\n            self.log(f\"BB Middle Band @{data_point.end_time}: {data_point.value}\")\n\n        # We are done now!\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/IndicatorHistoryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting the behavior of the indicator history api\n### </summary>\nclass IndicatorHistoryRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm asserting the behavior of the indicator history api'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013, 1, 1)\n        self.set_end_date(2014, 12, 31)\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n\n    def on_data(self, slice: Slice):\n        self.bollinger_bands = BollingerBands(\"BB\", 20, 2.0, MovingAverageType.SIMPLE)\n\n        if self.bollinger_bands.window.is_ready:\n            raise ValueError(\"Unexpected ready bollinger bands state\")\n\n        indicatorHistory = self.indicator_history(self.bollinger_bands, self._symbol, 50)\n        \n        self.debug(f\"indicatorHistory: {indicatorHistory}\")\n\n        self.debug(f\"data_frame: {indicatorHistory.data_frame}\")\n\n        if not self.bollinger_bands.window.is_ready:\n            raise ValueError(\"Unexpected not ready bollinger bands state\")\n\n        # we ask for 50 data points\n        if indicatorHistory.count != 50:\n            raise ValueError(f\"Unexpected indicators values {indicatorHistory.count}\")\n\n        for indicatorDataPoints in indicatorHistory:\n            middle_band = indicatorDataPoints[\"middle_band\"]\n            self.debug(f\"BB @{indicatorDataPoints.current}: middle_band: {middle_band} upper_band: {indicatorDataPoints.upper_band}\")\n            if indicatorDataPoints == 0:\n                raise ValueError(f\"Unexpected indicators point {indicatorDataPoints}\")\n\n        currentValues = indicatorHistory.current\n        if len(currentValues) != 50 or len([x for x in currentValues if x.value == 0]) > 0:\n            raise ValueError(f\"Unexpected indicators current values {len(currentValues)}\")\n        upperBandPoints = indicatorHistory[\"upper_band\"]\n        if len(upperBandPoints) != 50 or len([x for x in upperBandPoints if x.value == 0]) > 0:\n            raise ValueError(f\"Unexpected indicators upperBandPoints values {len(upperBandPoints)}\")\n\n        # We are done now!\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/IndicatorSelectorsWorkWithDifferentOptions.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests that we can use selectors in the indicators\n### that need quote data\n### </summary>\nclass IndicatorSelectorWorksWithDifferentOptions(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 6, 7)\n        self.set_end_date(2013, 11, 8)\n\n        self.equity = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n        self.option = self.add_option(\"NWSA\", Resolution.MINUTE).symbol\n        self.aapl = self.add_equity(\"AAPL\", Resolution.DAILY).symbol\n        self.aapl_points = []\n        self.aapl_last_date = date(1,1,1)\n        self.eurusd = self.add_forex(\"EURUSD\", Resolution.DAILY).symbol\n        self.eurusd_points = []\n        self.eurusd_last_date = date(1,1,1)\n        future = self.add_future(\"GC\", Resolution.DAILY, Market.COMEX)\n        self.future = future.symbol\n        self.future_contract = None\n        self.future_points = []\n        future.set_filter(0, 120)\n        self.option = Symbol.create_option(\"NWSA\", Market.USA, OptionStyle.AMERICAN, OptionRight.PUT, 33, datetime(2013, 7, 20))\n        self.add_option_contract(self.option, Resolution.MINUTE)\n\n        self.option_indicator = self.identity(self.option, Resolution.MINUTE, Field.VOLUME, \"Volume.\")\n\n        self.bid_close_indicator = self.identity(self.equity, Resolution.MINUTE, Field.BID_CLOSE, \"Bid.Close.\")\n        self.bid_open_indicator = self.identity(self.equity, Resolution.MINUTE, Field.BID_OPEN, \"Bid.Open.\")\n        self.bid_low_indicator = self.identity(self.equity, Resolution.MINUTE, Field.BID_LOW, \"Bid.Low.\")\n        self.bid_high_indicator = self.identity(self.equity, Resolution.MINUTE, Field.BID_HIGH, \"Bid.High.\")\n\n        self.ask_close_indicator = self.identity(self.equity, Resolution.MINUTE, Field.ASK_CLOSE, \"Ask.Close.\")\n        self.ask_open_indicator = self.identity(self.equity, Resolution.MINUTE, Field.ASK_OPEN, \"Ask.Open.\")\n        self.ask_low_indicator = self.identity(self.equity, Resolution.MINUTE, Field.ASK_LOW, \"Ask.Low.\")\n        self.ask_high_indicator = self.identity(self.equity, Resolution.MINUTE, Field.ASK_HIGH, \"Ask.High.\")\n\n        self.quotebars_found = False\n        self.tradebars_found = False\n\n        self.tradebar_history_indicator = self.identity(self.aapl, Resolution.DAILY)\n        self.quotebar_history_indicator = self.identity(self.eurusd, Resolution.DAILY)\n\n    def on_data(self, slice):\n        if self.aapl_last_date != self.time.date():\n            bars = slice.get(TradeBar)\n            if self.aapl in bars.keys():\n                datapoint = bars[self.aapl]\n                if datapoint and datapoint.volume != 0:\n                    self.aapl_last_date = self.time.date()\n                    self.aapl_points.append(datapoint.volume)\n\n        if self.eurusd_last_date != self.time.date() and (self.eurusd in slice.quote_bars.keys()):\n            self.eurusd_last_date = self.time.date()\n            self.eurusd_points.append(slice.quote_bars[self.eurusd].bid.close)\n\n        if self.equity in slice.quote_bars.keys():\n            self.quotebars_found = True\n            if slice.quote_bars[\"SPY\"].bid.close != self.bid_close_indicator.current.value:\n                close_value = slice.quote_bars[\"SPY\"].bid.close\n                raise AssertionError(f\"{self.bid_close_indicator.__name__} should have been {close_value}, but was {self.bid_close_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].bid.open != self.bid_open_indicator.current.value:\n                open_value = slice.quote_bars[\"SPY\"].bid.open\n                raise AssertionError(f\"{self.bid_open_indicator.__name__} should have been {open_value}, but was {self.bid_open_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].bid.low != self.bid_low_indicator.current.value:\n                low_value = slice.quote_bars[\"SPY\"].bid.low\n                raise AssertionError(f\"{self.bid_low_indicator.__name__} should have been {low_value}, but was {self.bid_low_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].bid.high != self.bid_high_indicator.current.value:\n                high_value = slice.quote_bars[\"SPY\"].bid.high\n                raise AssertionError(f\"{self.bid_high_indicator.__name__} should have been {high_value}, but was {self.bid_high_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].ask.close != self.ask_close_indicator.current.value:\n                close_value = slice.quote_bars[\"SPY\"].ask.close\n                raise AssertionError(f\"{self.ask_close_indicator.__name__} should have been {close_value}, but was {self.ask_close_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].ask.open != self.ask_open_indicator.current.value:\n                open_value = slice.quote_bars[\"SPY\"].bid.open\n                raise AssertionError(f\"{self.ask_open_indicator.__name__} should have been {open_value}, but was {self.ask_open_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].ask.low != self.ask_low_indicator.current.value:\n                low_value = slice.quote_bars[\"SPY\"].bid.low\n                raise AssertionError(f\"{self.ask_low_indicator.__name__} should have been {low_value}, but was {self.ask_low_indicator.current.value}\")\n\n            if slice.quote_bars[\"SPY\"].ask.high != self.ask_high_indicator.current.value:\n                high_value = slice.quote_bars[\"SPY\"].bid.high\n                raise AssertionError(f\"{self.ask_high_indicator.__name__} should have been {high_value}, but was {self.ask_high_indicator.current.value}\")\n\n        if (self.option.canonical in slice.option_chains.keys()) and (self.option in slice.option_chains[self.option.canonical].trade_bars.keys()):\n            self.tradebars_found = True\n            if self.option_indicator.current.value != slice.option_chains[self.option.canonical].trade_bars[self.option].volume:\n                volume = slice.option_chains[self.option.canonical].trade_bars[self.option].volume\n                raise AssertionError(f\"{self.option_indicator.__name__} should have been {volume}, but was {self.option_indicator.current.value}\")\n\n        if (self.future in slice.futures_chains.keys()):\n            if self.future_contract == None:\n                self.future_contract = slice.future_chains[self.future].trade_bars.values()[0].symbol\n            if self.future_contract in slice.future_chains[self.future].trade_bars:\n                value = slice.future_chains[self.future].trade_bars[self.future_contract]\n                if value.volume != 0:\n                    self.future_points.append(value.volume)\n\n    def on_end_of_algorithm(self):\n        if not self.quotebars_found:\n            raise AssertionError(\"At least one quote bar should have been found, but none was found\")\n\n        if not self.tradebars_found:\n            raise AssertionError(\"At least one trade bar should have been found, but none was found\")\n\n        future_indicator = Identity(\"\")\n        backtest_days = (self.end_date - self.start_date).days\n        future_volume_history = self.indicator_history(future_indicator, self.future_contract, backtest_days, Resolution.DAILY, Field.VOLUME).current\n        future_volume_history_values = list(map(lambda x: x.value, future_volume_history))\n        future_volume_history_values = list(filter(lambda x: x != 0, future_volume_history_values))\n        if abs(sum(future_volume_history_values)/len(future_volume_history_values) - sum(self.future_points)/len(self.future_points)) > 0.001:\n            raise AssertionError(f\"No history indicator future data point was found using Field.Volume selector! {self.future_points}\")\n\n        volume_history = self.indicator_history(self.tradebar_history_indicator, self.aapl, 109, Resolution.DAILY, Field.VOLUME).current\n        volume_history_values = list(map(lambda x: x.value, volume_history))\n\n        if abs(sum(volume_history_values)/len(volume_history_values) - sum(self.aapl_points)/len(self.aapl_points)) > 0.001:\n            raise AssertionError(\"No history indicator data point was found using Field.Volume selector!\")\n\n        bid_close_history = self.indicator_history(self.quotebar_history_indicator, self.eurusd, 132, Resolution.DAILY, Field.BID_CLOSE).current\n        bid_close_history_values = list(map(lambda x: x.value, bid_close_history))\n        if abs(sum(bid_close_history_values)/len(bid_close_history_values) - sum(self.eurusd_points)/len(self.eurusd_points)) > 0.001:\n            raise AssertionError(\"No history indicator data point was found using Field.BidClose selector!\")\n"
  },
  {
    "path": "Algorithm.Python/IndicatorSuiteAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm simply initializes the date range and cash. This is a skeleton\n### framework you can use for designing an algorithm.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass IndicatorSuiteAlgorithm(QCAlgorithm):\n    '''Demonstration algorithm of popular indicators and plotting them.'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self._symbol = \"SPY\"\n        self._symbol2 = \"GOOG\"\n        self.custom_symbol = \"IBM\"\n        self.price = 0.0\n\n        self.set_start_date(2013, 1, 1)  #Set Start Date\n        self.set_end_date(2014, 12, 31)    #Set End Date\n        self.set_cash(25000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n\n        self.add_equity(self._symbol, Resolution.DAILY)\n        self.add_equity(self._symbol2, Resolution.DAILY)\n        self.add_data(CustomData, self.custom_symbol, Resolution.DAILY)\n\n        # Set up default Indicators, these indicators are defined on the Value property of incoming data (except ATR and AROON which use the full TradeBar object)\n        self.indicators = {\n            'BB' : self.bb(self._symbol, 20, 1, MovingAverageType.SIMPLE, Resolution.DAILY),\n            'RSI' : self.rsi(self._symbol, 14, MovingAverageType.SIMPLE, Resolution.DAILY),\n            'EMA' : self.ema(self._symbol, 14, Resolution.DAILY),\n            'SMA' : self.sma(self._symbol, 14, Resolution.DAILY),\n            'MACD' : self.macd(self._symbol, 12, 26, 9, MovingAverageType.SIMPLE, Resolution.DAILY),\n            'MOM' : self.mom(self._symbol, 20, Resolution.DAILY),\n            'MOMP' : self.momp(self._symbol, 20, Resolution.DAILY),\n            'STD' : self.std(self._symbol, 20, Resolution.DAILY),\n            # by default if the symbol is a tradebar type then it will be the min of the low property\n            'MIN' : self.min(self._symbol, 14, Resolution.DAILY),\n            # by default if the symbol is a tradebar type then it will be the max of the high property\n            'MAX' : self.max(self._symbol, 14, Resolution.DAILY),\n            'ATR' : self.atr(self._symbol, 14, MovingAverageType.SIMPLE, Resolution.DAILY),\n            'AROON' : self.aroon(self._symbol, 20, Resolution.DAILY),\n            'B' : self.b(self._symbol, self._symbol2, 14)\n        }\n\n        #  Here we're going to define indicators using 'selector' functions. These 'selector' functions will define what data gets sent into the indicator\n        #  These functions have a signature like the following: decimal Selector(BaseData base_data), and can be defined like: base_data => base_data.value\n        #  We'll define these 'selector' functions to select the Low value\n        #\n        #  For more information on 'anonymous functions' see: http:#en.wikipedia.org/wiki/Anonymous_function\n        #                                                     https:#msdn.microsoft.com/en-us/library/bb397687.aspx\n        #\n        self.selector_indicators = {\n            'BB' : self.bb(self._symbol, 20, 1, MovingAverageType.SIMPLE, Resolution.DAILY, Field.LOW),\n            'RSI' :self.rsi(self._symbol, 14, MovingAverageType.SIMPLE, Resolution.DAILY, Field.LOW),\n            'EMA' :self.ema(self._symbol, 14, Resolution.DAILY, Field.LOW),\n            'SMA' :self.sma(self._symbol, 14, Resolution.DAILY, Field.LOW),\n            'MACD' : self.macd(self._symbol, 12, 26, 9, MovingAverageType.SIMPLE, Resolution.DAILY, Field.LOW),\n            'MOM' : self.mom(self._symbol, 20, Resolution.DAILY, Field.LOW),\n            'MOMP' : self.momp(self._symbol, 20, Resolution.DAILY, Field.LOW),\n            'STD' : self.std(self._symbol, 20, Resolution.DAILY, Field.LOW),\n            'MIN' : self.min(self._symbol, 14, Resolution.DAILY, Field.HIGH),\n            'MAX' : self.max(self._symbol, 14, Resolution.DAILY, Field.LOW),\n            # ATR and AROON are special in that they accept a TradeBar instance instead of a decimal, we could easily project and/or transform the input TradeBar\n            # before it gets sent to the ATR/AROON indicator, here we use a function that will multiply the input trade bar by a factor of two\n            'ATR' : self.atr(self._symbol, 14, MovingAverageType.SIMPLE, Resolution.DAILY, self.selector_double__trade_bar),\n            'AROON' : self.aroon(self._symbol, 20, Resolution.DAILY, self.selector_double__trade_bar)\n        }\n\n        # Custom Data Indicator:\n        self.rsi_custom = self.rsi(self.custom_symbol, 14, MovingAverageType.SIMPLE, Resolution.DAILY)\n        self.min_custom = self.min(self.custom_symbol, 14, Resolution.DAILY)\n        self.max_custom = self.max(self.custom_symbol, 14, Resolution.DAILY)\n\n        # in addition to defining indicators on a single security, you can all define 'composite' indicators.\n        # these are indicators that require multiple inputs. the most common of which is a ratio.\n        # suppose we seek the ratio of BTC to SPY, we could write the following:\n        spy_close = Identity(self._symbol)\n        ibm_close = Identity(self.custom_symbol)\n\n        # this will create a new indicator whose value is IBM/SPY\n        self.ratio = IndicatorExtensions.over(ibm_close, spy_close)\n\n        # we can also easily plot our indicators each time they update using th PlotIndicator function\n        self.plot_indicator(\"Ratio\", self.ratio)\n\n        # The following methods will add multiple charts to the algorithm output.\n        # Those chatrs names will be used later to plot different series in a particular chart.\n        # For more information on Lean Charting see: https://www.quantconnect.com/docs#Charting\n        Chart('BB')\n        Chart('STD')\n        Chart('ATR')\n        Chart('AROON')\n        Chart('MACD')\n        Chart('Averages')\n        # Here we make use of the Schelude method to update the plots once per day at market close.\n        self.schedule.on(self.date_rules.every_day(), self.time_rules.before_market_close(self._symbol), self.update_plots)\n\n    def on_data(self, data: Slice):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n\n        if (#not data.bars.contains_key(self._symbol) or\n            not self.indicators['BB'].is_ready or\n            not self.indicators['RSI'].is_ready):\n            return\n\n        if not data.bars.contains_key(self._symbol):\n            return\n\n        self.price = data[self._symbol].close\n\n        if not self.portfolio.hold_stock:\n            quantity = int(self.portfolio.cash / self.price)\n            self.order(self._symbol, quantity)\n            self.debug('Purchased SPY on ' + self.time.strftime('%Y-%m-%d'))\n\n    def update_plots(self):\n        if not self.indicators['BB'].is_ready or not self.indicators['STD'].is_ready:\n            return\n\n        # Plots can also be created just with this one line command.\n        self.plot('RSI', self.indicators['RSI'])\n        # Custom data indicator\n        self.plot('RSI-FB', self.rsi_custom)\n\n        # Here we make use of the chats decalred in the Initialize method, plotting multiple series\n        # in each chart.\n        self.plot('STD', 'STD', self.indicators['STD'].current.value)\n\n        self.plot('BB', 'Price', self.price)\n        self.plot('BB', 'BollingerUpperBand', self.indicators['BB'].upper_band.current.value)\n        self.plot('BB', 'BollingerMiddleBand', self.indicators['BB'].middle_band.current.value)\n        self.plot('BB', 'BollingerLowerBand', self.indicators['BB'].lower_band.current.value)\n\n\n        self.plot('AROON', 'Aroon', self.indicators['AROON'].current.value)\n        self.plot('AROON', 'AroonUp', self.indicators['AROON'].aroon_up.current.value)\n        self.plot('AROON', 'AroonDown', self.indicators['AROON'].aroon_down.current.value)\n\n        # The following Plot method calls are commented out because of the 10 series limit for backtests\n        #self.plot('ATR', 'ATR', self.indicators['ATR'].current.value)\n        #self.plot('ATR', 'ATRDoubleBar', self.selector_indicators['ATR'].current.value)\n        #self.plot('Averages', 'SMA', self.indicators['SMA'].current.value)\n        #self.plot('Averages', 'EMA', self.indicators['EMA'].current.value)\n        #self.plot('MOM', self.indicators['MOM'].current.value)\n        #self.plot('MOMP', self.indicators['MOMP'].current.value)\n        #self.plot('MACD', 'MACD', self.indicators['MACD'].current.value)\n        #self.plot('MACD', 'MACDSignal', self.indicators['MACD'].signal.current.value)\n\n    def selector_double__trade_bar(self, bar):\n        trade_bar = TradeBar()\n        trade_bar.close = 2 * bar.close\n        trade_bar.data_type = bar.data_type\n        trade_bar.high = 2 * bar.high\n        trade_bar.low = 2 * bar.low\n        trade_bar.open = 2 * bar.open\n        trade_bar.symbol = bar.symbol\n        trade_bar.time = bar.time\n        trade_bar.value = 2 * bar.value\n        trade_bar.period = bar.period\n        return trade_bar\n\n\nclass CustomData(PythonData):\n    def get_source(self, config, date, is_live):\n        zip_file_name = LeanData.generate_zip_file_name(config.Symbol, date, config.Resolution, config.TickType)\n        source = Globals.data_folder + \"/equity/usa/daily/\" + zip_file_name\n        return SubscriptionDataSource(source)\n\n    def reader(self, config, line, date, is_live):\n        if line == None:\n            return None\n\n        custom_data = CustomData()\n        custom_data.symbol = config.symbol\n\n        csv = line.split(\",\")\n        custom_data.time = datetime.strptime(csv[0], '%Y%m%d %H:%M')\n        custom_data.end_time = custom_data.time + timedelta(days=1)\n        custom_data.value = float(csv[1]) / 10000.0\n        return custom_data\n"
  },
  {
    "path": "Algorithm.Python/IndicatorWarmupAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression test for history and warm up using the data available in open source.\n### </summary>\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"warm up\" />\nclass IndicatorWarmupAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 8)   #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(1000000)            #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n        self.add_equity(\"IBM\")\n        self.add_equity(\"BAC\")\n        self.add_equity(\"GOOG\", Resolution.DAILY)\n        self.add_equity(\"GOOGL\", Resolution.DAILY)\n\n        self.__sd = { }\n        for security in self.securities:\n            self.__sd[security.key] = self.SymbolData(security.key, self)\n\n        # we want to warm up our algorithm\n        self.set_warmup(self.SymbolData.REQUIRED_BARS_WARMUP)\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        # we are only using warmup for indicator spooling, so wait for us to be warm then continue\n        if self.is_warming_up: return\n\n        for sd in self.__sd.values():\n            last_price_time = sd.close.current.time\n            if self.round_down(last_price_time, sd.security.subscription_data_config.increment):\n                sd.update()\n\n    def on_order_event(self, fill):\n        sd = self.__sd.get(fill.symbol, None)\n        if sd is not None:\n            sd.on_order_event(fill)\n\n    def round_down(self, time, increment):\n        if increment.days != 0:\n            return time.hour == 0 and time.minute == 0 and time.second == 0\n        else:\n            return time.second == 0\n\n    class SymbolData:\n        REQUIRED_BARS_WARMUP = 40\n        PERCENT_TOLERANCE = 0.001\n        PERCENT_GLOBAL_STOP_LOSS = 0.01\n        LOT_SIZE = 10\n\n        def __init__(self, symbol, algorithm):\n            self.symbol = symbol\n            self.__algorithm = algorithm   # if we're receiving daily\n\n            self.__current_stop_loss = None\n\n            self.security = algorithm.securities[symbol]\n            self.close = algorithm.identity(symbol)\n            self._adx = algorithm.adx(symbol, 14)\n            self._ema = algorithm.ema(symbol, 14)\n            self._macd = algorithm.macd(symbol, 12, 26, 9)\n\n            self.is_ready = self.close.is_ready and self._adx.is_ready and self._ema.is_ready and self._macd.is_ready\n            self.is_uptrend = False\n            self.is_downtrend = False\n\n        def update(self):\n            self.is_ready = self.close.is_ready and self._adx.is_ready and self._ema.is_ready and self._macd.is_ready\n\n            tolerance = 1 - self.PERCENT_TOLERANCE\n            self.is_uptrend = self._macd.signal.current.value > self._macd.current.value * tolerance and\\\n                self._ema.current.value > self.close.current.value * tolerance\n\n            self.is_downtrend = self._macd.signal.current.value < self._macd.current.value * tolerance and\\\n                self._ema.current.value < self.close.current.value * tolerance\n\n            self.try_enter()\n            self.try_exit()\n\n        def try_enter(self):\n            # can't enter if we're already in\n            if self.security.invested: return False\n\n            qty = 0\n            limit = 0.0\n\n            if self.is_uptrend:\n                # 100 order lots\n                qty = self.LOT_SIZE\n                limit = self.security.low\n            elif self.is_downtrend:\n                qty = -self.LOT_SIZE\n                limit = self.security.high\n\n            if qty != 0:\n                ticket = self.__algorithm.limit_order(self.symbol, qty, limit, tag=\"TryEnter at: {0}\".format(limit))\n\n        def try_exit(self):\n            # can't exit if we haven't entered\n            if not self.security.invested: return\n\n            limit = 0\n            qty = self.security.holdings.quantity\n            exit_tolerance = 1 + 2 * self.PERCENT_TOLERANCE\n            if self.security.holdings.is_long and self.close.current.value * exit_tolerance < self._ema.current.value:\n                limit = self.security.high\n            elif self.security.holdings.is_short and self.close.current.value > self._ema.current.value * exit_tolerance:\n                limit = self.security.low\n\n            if limit != 0:\n                ticket = self.__algorithm.limit_order(self.symbol, -qty, limit, tag=\"TryExit at: {0}\".format(limit))\n\n        def on_order_event(self, fill):\n            if fill.status != OrderStatus.FILLED: return\n\n            qty = self.security.holdings.quantity\n\n            # if we just finished entering, place a stop loss as well\n            if self.security.invested:\n                stop = fill.fill_price*(1 - self.PERCENT_GLOBAL_STOP_LOSS) if self.security.holdings.is_long \\\n                    else fill.fill_price*(1 + self.PERCENT_GLOBAL_STOP_LOSS)\n\n                self.__current_stop_loss = self.__algorithm.stop_market_order(self.symbol, -qty, stop, tag=\"StopLoss at: {0}\".format(stop))\n\n            # check for an exit, cancel the stop loss\n            elif (self.__current_stop_loss is not None and self.__current_stop_loss.status is not OrderStatus.FILLED):\n                # cancel our current stop loss\n                self.__current_stop_loss.cancel(\"Exited position\")\n                self.__current_stop_loss = None\n"
  },
  {
    "path": "Algorithm.Python/IndicatorWithRenkoBarsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regrssion algorithm to assert we can update indicators that inherit from IndicatorBase<TradeBar> with RenkoBar's\n### </summary>\n### <meta name=\"tag\" content=\"renko\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\nclass IndicatorWithRenkoBarsRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 9)\n\n        self.add_equity(\"SPY\")\n        self.add_equity(\"AIG\")\n\n        spy_renko_consolidator = RenkoConsolidator(0.1)\n        spy_renko_consolidator.data_consolidated += self.on_spy_data_consolidated\n\n        aig_renko_consolidator = RenkoConsolidator(0.05)\n        aig_renko_consolidator.data_consolidated += self.on_aig_data_consolidated\n\n        self.subscription_manager.add_consolidator(\"SPY\", spy_renko_consolidator)\n        self.subscription_manager.add_consolidator(\"AIG\", aig_renko_consolidator)\n\n        self._mi = MassIndex(\"MassIndex\", 9, 25)\n        self._wasi = WilderAccumulativeSwingIndex(\"WilderAccumulativeSwingIndex\", 8)\n        self._wsi = WilderSwingIndex(\"WilderSwingIndex\", 8)\n        self._b = Beta(\"Beta\", 3, \"AIG\", \"SPY\")\n        self._indicators = [self._mi, self._wasi, self._wsi, self._b]\n\n    def on_spy_data_consolidated(self, sender: object, renko_bar: RenkoBar) -> None:\n        self._mi.update(renko_bar)\n        self._wasi.update(renko_bar)\n        self._wsi.update(renko_bar)\n        self._b.update(renko_bar)\n\n    def on_aig_data_consolidated(self, sender: object, renko_bar: RenkoBar) -> None:\n        self._b.update(renko_bar)\n\n    def on_end_of_algorithm(self) -> None:\n        for indicator in self._indicators:\n            if not indicator.is_ready:\n                raise AssertionError(f\"{indicator.name} indicator should be ready\")\n            elif indicator.current.value == 0:\n                raise AssertionError(f\"The current value of the {indicator.name} indicator should be different than zero\")\n"
  },
  {
    "path": "Algorithm.Python/IndustryStandardSecurityIdentifiersRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm illustrating how to get a security's industry-standard identifier from its `Symbol`\n### </summary>\nclass IndustryStandardSecurityIdentifiersRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 5)\n\n        equity = self.add_equity(\"AAPL\").symbol\n\n        cusip = equity.cusip\n        composite_figi = equity.composite_figi\n        sedol = equity.sedol\n        isin = equity.isin\n        cik = equity.cik\n\n        self.check_symbol_representation(cusip, \"CUSIP\")\n        self.check_symbol_representation(composite_figi, \"Composite FIGI\")\n        self.check_symbol_representation(sedol, \"SEDOL\")\n        self.check_symbol_representation(isin, \"ISIN\")\n        self.check_symbol_representation(f\"{cik}\", \"CIK\")\n\n        # Check Symbol API vs QCAlgorithm API\n        self.check_ap_is_symbol_representations(cusip, self.cusip(equity), \"CUSIP\")\n        self.check_ap_is_symbol_representations(composite_figi, self.composite_figi(equity), \"Composite FIGI\")\n        self.check_ap_is_symbol_representations(sedol, self.sedol(equity), \"SEDOL\")\n        self.check_ap_is_symbol_representations(isin, self.isin(equity), \"ISIN\")\n        self.check_ap_is_symbol_representations(f\"{cik}\", f\"{self.cik(equity)}\", \"CIK\")\n\n        self.log(f\"\\n_aapl CUSIP: {cusip}\"\n                 f\"\\n_aapl Composite FIGI: {composite_figi}\"\n                 f\"\\n_aapl SEDOL: {sedol}\"\n                 f\"\\n_aapl ISIN: {isin}\"\n                 f\"\\n_aapl CIK: {cik}\")\n\n    def check_symbol_representation(self, symbol: str, standard: str) -> None:\n        if not symbol:\n            raise AssertionError(f\"{standard} symbol representation is null or empty\")\n\n    def check_ap_is_symbol_representations(self, symbol_api_symbol: str, algorithm_api_symbol: str, standard: str) -> None:\n        if symbol_api_symbol != algorithm_api_symbol:\n            raise AssertionError(f\"Symbol API {standard} symbol representation ({symbol_api_symbol}) does not match \"\n                            f\"QCAlgorithm API {standard} symbol representation ({algorithm_api_symbol})\")\n"
  },
  {
    "path": "Algorithm.Python/InsightScoringRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm showing how to define a custom insight scoring function and using the insight manager\n### </summary>\nclass InsightScoringRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm showing how to define a custom insight evaluator'''\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        \n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Resolution.DAILY))\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.01))\n        \n        # we specify a custom insight evaluator\n        self.insights.set_insight_score_function(CustomInsightScoreFunction(self.securities))\n\n    def on_end_of_algorithm(self):\n        all_insights = self.insights.get_insights(lambda insight: True)\n\n        if len(all_insights) != 100 or len(self.insights.get_insights()) != 100:\n            raise ValueError(f'Unexpected insight count found {all_insights.count}')\n\n        if sum(1 for insight in all_insights if insight.score.magnitude == 0 or insight.score.direction == 0) < 5:\n            raise ValueError(f'Insights not scored!')\n\n        if sum(1 for insight in all_insights if insight.score.is_final_score) < 99:\n            raise ValueError(f'Insights not finalized!')\n\nclass CustomInsightScoreFunction():\n\n    def __init__(self, securities):\n        self._securities = securities\n        self._open_insights = {}\n\n    def score(self, insight_manager, utc_time):\n        open_insights = insight_manager.get_active_insights(utc_time)\n\n        for insight in open_insights:\n            self._open_insights[insight.id] = insight\n\n        to_remove = []\n        for open_insight in self._open_insights.values():\n            security = self._securities[open_insight.symbol]\n            open_insight.reference_value_final = security.price\n\n            score = open_insight.reference_value_final - open_insight.reference_value\n            open_insight.score.set_score(InsightScoreType.DIRECTION, score, utc_time)\n            open_insight.score.set_score(InsightScoreType.MAGNITUDE, score * 2, utc_time)\n            open_insight.estimated_value = score * 100\n\n            if open_insight.is_expired(utc_time):\n                open_insight.score.finalize(utc_time)\n                to_remove.append(open_insight)\n\n        # clean up\n        for insight_to_remove in to_remove:\n            self._open_insights.pop(insight_to_remove.id)\n"
  },
  {
    "path": "Algorithm.Python/InsightTagAlphaRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Selection.ManualUniverseSelectionModel import ManualUniverseSelectionModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\n\n### <summary>\n### Test algorithm generating insights with custom tags\n### </summary>\nclass InsightTagAlphaRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        self.fb = Symbol.create(\"FB\", SecurityType.EQUITY, Market.USA)\n        self.ibm = Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA)\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel([self.spy, self.fb, self.ibm]))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        self.add_alpha(OneTimeAlphaModel(self.spy))\n        self.add_alpha(OneTimeAlphaModel(self.fb))\n        self.add_alpha(OneTimeAlphaModel(self.ibm))\n\n        self.insights_generated += self.on_insights_generated_verifier\n\n        self._symbols_with_generated_insights = []\n\n    def on_insights_generated_verifier(self, algorithm: IAlgorithm, insights_collection: GeneratedInsightsCollection) -> None:\n        for insight in insights_collection.insights:\n            if insight.tag != OneTimeAlphaModel.generate_insight_tag(insight.symbol):\n                raise AssertionError(\"Unexpected insight tag was emitted\")\n\n            self._symbols_with_generated_insights.append(insight.symbol)\n\n    def on_end_of_algorithm(self) -> None:\n        if len(self._symbols_with_generated_insights) != 3:\n            raise AssertionError(\"Unexpected number of symbols with generated insights\")\n\n        if not self.spy in self._symbols_with_generated_insights:\n            raise AssertionError(\"SPY symbol was not found in symbols with generated insights\")\n\n        if not self.fb in self._symbols_with_generated_insights:\n            raise AssertionError(\"FB symbol was not found in symbols with generated insights\")\n\n        if not self.ibm in self._symbols_with_generated_insights:\n            raise AssertionError(\"IBM symbol was not found in symbols with generated insights\")\n\nclass OneTimeAlphaModel(AlphaModel):\n    def __init__(self, symbol):\n        self._symbol = symbol\n        self.triggered = False\n\n    def update(self, algorithm, data):\n        insights = []\n        if not self.triggered:\n            self.triggered = True\n            insights.append(Insight.price(\n                self._symbol,\n                Resolution.DAILY,\n                1,\n                InsightDirection.DOWN,\n                tag=OneTimeAlphaModel.generate_insight_tag(self._symbol)))\n        return insights\n\n    @staticmethod\n    def generate_insight_tag(symbol: Symbol) -> str:\n        return f\"Insight generated for {symbol}\"\n"
  },
  {
    "path": "Algorithm.Python/InsightWeightingFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Selection.ManualUniverseSelectionModel import ManualUniverseSelectionModel\nfrom Alphas.ConstantAlphaModel import ConstantAlphaModel\nfrom Portfolio.InsightWeightingPortfolioConstructionModel import InsightWeightingPortfolioConstructionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\n\n### <summary>\n### Test algorithm using 'InsightWeightingPortfolioConstructionModel' and 'ConstantAlphaModel'\n### generating a constant 'Insight' with a 0.25 weight\n### </summary>\nclass InsightWeightingFrameworkAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None, 0.25))\n        self.set_portfolio_construction(InsightWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n    def on_end_of_algorithm(self):\n        # holdings value should be 0.25 - to avoid price fluctuation issue we compare with 0.28 and 0.23\n        if (self.portfolio.total_holdings_value > self.portfolio.total_portfolio_value * 0.28\n            or self.portfolio.total_holdings_value < self.portfolio.total_portfolio_value * 0.23):\n            raise ValueError(\"Unexpected Total Holdings Value: \" + str(self.portfolio.total_holdings_value))\n"
  },
  {
    "path": "Algorithm.Python/IronCondorStrategyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport itertools\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Iron Condor strategy.\n### </summary>\nclass IronCondorStrategyAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 8\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol) -> None:\n        for expiry, group in itertools.groupby(chain, lambda x: x.expiry):\n            contracts = sorted(group, key=lambda x: x.strike)\n            if len(contracts) < 4:\n                continue\n\n            put_contracts = [x for x in contracts if x.right == OptionRight.PUT]\n            if len(put_contracts) < 2:\n                continue\n            long_put_strike = put_contracts[0].strike\n            short_put_strike = put_contracts[1].strike\n\n            call_contracts = [x for x in contracts if x.right == OptionRight.CALL and x.strike > short_put_strike]\n            if len(call_contracts) < 2:\n                continue\n            short_call_strike = call_contracts[0].strike\n            long_call_strike = call_contracts[1].strike\n\n            self._iron_condor = OptionStrategies.iron_condor(option_symbol, long_put_strike, short_put_strike, short_call_strike, long_call_strike, expiry)\n            self.buy(self._iron_condor, 2)\n            return\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol) -> None:\n        positions = list(position_group.positions)\n        if len(positions) != 4:\n            raise AssertionError(f\"Expected position group to have 4 positions. Actual: {len(positions)}\")\n\n        ordered_strikes = sorted((leg.strike for leg in self._iron_condor.option_legs))\n\n        long_put_strike = ordered_strikes[0]\n        long_put_position = next((x for x in position_group.positions\n                                if x.symbol.id.option_right == OptionRight.PUT and x.symbol.id.strike_price == long_put_strike),\n                               None)\n        if not long_put_position or long_put_position.quantity != 2:\n            raise AssertionError(f\"Expected long put position quantity to be 2. Actual: {long_put_position.quantity}\")\n\n        short_put_strike = ordered_strikes[1]\n        short_put_position = next((x for x in position_group.positions\n                                 if x.symbol.id.option_right == OptionRight.PUT and x.symbol.id.strike_price == short_put_strike),\n                                None)\n        if not short_put_position or short_put_position.quantity != -2:\n            raise AssertionError(f\"Expected short put position quantity to be -2. Actual: {short_put_position.quantity}\")\n\n        short_call_strike = ordered_strikes[2]\n        short_call_position = next((x for x in position_group.positions\n                                  if x.symbol.id.option_right == OptionRight.CALL and x.symbol.id.strike_price == short_call_strike),\n                                 None)\n        if not short_call_position or short_call_position.quantity != -2:\n            raise AssertionError(f\"Expected short call position quantity to be -2. Actual: {short_call_position.quantity}\")\n\n        long_call_strike = ordered_strikes[3]\n        long_call_position = next((x for x in position_group.positions\n                                 if x.symbol.id.option_right == OptionRight.CALL and x.symbol.id.strike_price == long_call_strike),\n                                None)\n        if not long_call_position or long_call_position.quantity != 2:\n            raise AssertionError(f\"Expected long call position quantity to be 2. Actual: {long_call_position.quantity}\")\n\n    def liquidate_strategy(self) -> None:\n        # We should be able to close the position by selling the strategy\n        self.sell(self._iron_condor, 2)\n"
  },
  {
    "path": "Algorithm.Python/KerasNeuralNetworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom keras.models import *\nfrom tensorflow import keras\nfrom keras import Sequential\nfrom keras.layers import Dense, Activation\nfrom keras.optimizers import SGD\n\nclass KerasNeuralNetworkAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2019, 1, 1)   # Set Start Date\n        self.set_end_date(2020, 4, 1)     # Set End Date\n        self.set_cash(100000)            # Set Strategy Cash\n\n        self._model_by_symbol = {}\n\n        for ticker in [\"SPY\", \"QQQ\", \"TLT\"]:\n            symbol = self.add_equity(ticker).symbol\n\n            # Read the model saved in the ObjectStore\n            for kvp in self.object_store:\n                key = f'{symbol}_model'\n                if not (key == kvp.key and kvp.value):\n                    continue\n                file_path = self.object_store.get_file_path(kvp.key)\n                self._model_by_symbol[symbol] = keras.models.load_model(file_path)\n                self.debug(f'Model for {symbol} sucessfully retrieved. File {file_path}. Size {len(kvp.value)}. Weights {self._model_by_symbol[symbol].get_weights()}')\n\n        # Look-back period for training set\n        self._lookback = 30\n\n        # Train Neural Network every monday\n        self.train(\n            self.date_rules.every(DayOfWeek.MONDAY),\n            self.time_rules.after_market_open(\"SPY\"),\n            self.neural_network_training)\n\n        # Place trades on Monday, 30 minutes after the market is open\n        self.schedule.on(\n            self.date_rules.every_day(\"SPY\"),\n            self.time_rules.after_market_open(\"SPY\", 30),\n            self.trade)\n\n    def on_end_of_algorithm(self) -> None:\n        ''' Save the data and the mode using the ObjectStore '''\n        for symbol, model in self._model_by_symbol.items():\n            key = f'{symbol}_model.keras'\n            file = self.object_store.get_file_path(key)\n            model.save(file)\n            self.object_store.save(key)\n            self.debug(f'Model for {symbol} sucessfully saved in the ObjectStore')\n\n    def neural_network_training(self) -> None:\n        '''Train the Neural Network and save the model in the ObjectStore'''\n        symbols = self.securities.keys()\n\n        # Daily historical data is used to train the machine learning model\n        history = self.history(symbols, self._lookback + 1, Resolution.DAILY)\n        history = history.open.unstack(0)\n\n        for symbol in symbols:\n            if symbol not in history:\n                continue\n\n            predictor = history[symbol][:-1]\n            predictand = history[symbol][1:]\n\n            # build a neural network from the 1st layer to the last layer\n            model = Sequential()\n\n            model.add(Dense(10, input_dim = 1))\n            model.add(Activation('relu'))\n            model.add(Dense(1))\n\n            sgd = SGD(learning_rate = 0.01)   # learning rate = 0.01\n\n            # choose loss function and optimizing method\n            model.compile(loss='mse', optimizer=sgd)\n\n            # pick an iteration number large enough for convergence\n            for step in range(200):\n                # training the model\n                cost = model.train_on_batch(predictor, predictand)\n\n            self._model_by_symbol[symbol] = model\n\n    def trade(self) -> None:\n        '''\n        Predict the price using the trained model and out-of-sample data\n        Enter or exit positions based on relationship of the open price of the current bar and the prices defined by the machine learning model.\n        Liquidate if the open price is below the sell price and buy if the open price is above the buy price\n        '''\n        target = 1 / len(self.securities)\n\n        for symbol, model in self._model_by_symbol.items():\n            if symbol not in self.current_slice.bars:\n                continue\n            \n            # Get the out-of-sample history\n            history = self.history(symbol, self._lookback, Resolution.DAILY)\n            history = history.open.unstack(0)[symbol]\n\n            # Get the final predicted price\n            prediction = model.predict(history)[0][-1]\n            history_std = np.std(history)\n\n            holding = self.portfolio[symbol]\n            open_price = self.current_slice.bars[symbol].open\n\n            # Follow the trend\n            if holding.invested:\n                if open_price < prediction - history_std:\n                    self.liquidate(symbol)\n            else:\n                if open_price > prediction + history_std:\n                    self.set_holdings(symbol, target)\n"
  },
  {
    "path": "Algorithm.Python/LimitFillRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic template algorithm simply initializes the date range and cash\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"limit orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"updating orders\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass LimitFillRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.SECOND)\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if data.contains_key(\"SPY\"):\n            if self.is_round_hour(self.time):\n                negative = 1 if self.time < (self.start_date + timedelta(days=2)) else -1\n                self.limit_order(\"SPY\", negative*10, data[\"SPY\"].price)\n\n    def is_round_hour(self, date_time):\n        '''Verify whether datetime is round hour'''\n        return date_time.minute == 0 and date_time.second == 0\n\n    def on_order_event(self, order_event):\n        self.debug(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/LimitIfTouchedAsyncRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom LimitIfTouchedRegressionAlgorithm import LimitIfTouchedRegressionAlgorithm\n\n### <summary>\n### Basic algorithm demonstrating how to place LimitIfTouched orders asynchronously.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />`\n### <meta name=\"tag\" content=\"limit if touched order\"/>\nclass LimitIfTouchedAsyncRegressionAlgorithm(LimitIfTouchedRegressionAlgorithm):\n\n    asynchronous_orders = True\n"
  },
  {
    "path": "Algorithm.Python/LimitIfTouchedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom collections import deque\n\n### <summary>\n### Basic algorithm demonstrating how to place LimitIfTouched orders.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />`\n### <meta name=\"tag\" content=\"limit if touched order\"/>\nclass LimitIfTouchedRegressionAlgorithm(QCAlgorithm):\n\n    asynchronous_orders = False\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n        self.add_equity(\"SPY\")\n\n        self.expected_events = deque([\n            \"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 399 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $144.6434 LimitPrice: $144.3551 TriggerPrice: $143.61 OrderFee: 1 USD\",\n            \"Time: 10/10/2013 15:57:00 OrderID: 73 EventID: 156 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $145.6636 LimitPrice: $145.6434 TriggerPrice: $144.89 OrderFee: 1 USD\",\n            \"Time: 10/11/2013 15:37:00 OrderID: 74 EventID: 380 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $146.7185 LimitPrice: $146.6723 TriggerPrice: $145.92 OrderFee: 1 USD\"\n        ])\n\n    def on_data(self, data):\n        if data.contains_key(\"SPY\"):\n            if len(self.transactions.get_open_orders()) == 0:\n                self._negative = 1 if self.time.day < 9 else -1\n                order_request = SubmitOrderRequest(OrderType.LIMIT_IF_TOUCHED, SecurityType.EQUITY, \"SPY\",\n                                                  self._negative * 10, 0,\n                                                  data[\"SPY\"].price - self._negative,\n                                                  data[\"SPY\"].price - 0.25 * self._negative, self.utc_time,\n                                                  f\"LIT - Quantity: {self._negative * 10}\",\n                                                  asynchronous=self.asynchronous_orders)\n                self._request = self.transactions.add_order(order_request)\n                return\n\n            if self._request is not None:\n                if self._request.quantity == 1:\n                    self.transactions.cancel_open_orders()\n                    self._request = None\n                    return\n\n                new_quantity = int(self._request.quantity - self._negative)\n                self._request.update_quantity(new_quantity, f\"LIT - Quantity: {new_quantity}\")\n                self._request.update_trigger_price(Extensions.round_to_significant_digits(self._request.get(OrderField.TRIGGER_PRICE), 5))\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            expected = self.expected_events.popleft()\n            if str(order_event) != expected:\n                raise AssertionError(f\"order_event {order_event.id} differed from {expected}. Actual {order_event}\")\n\n    def on_end_of_algorithm(self):\n        for ticket in self.transactions.get_order_tickets():\n            if ticket.submit_request.asynchronous != self.asynchronous_orders:\n                raise AssertionError(\"Expected all orders to have the same asynchronous flag as the algorithm.\")\n"
  },
  {
    "path": "Algorithm.Python/LiquidETFUniverseFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\n\n### <summary>\n### Basic template framework algorithm uses framework components to define the algorithm.\n### Liquid ETF Competition template\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass LiquidETFUniverseFrameworkAlgorithm(QCAlgorithm):\n    '''Basic template framework algorithm uses framework components to define the algorithm.'''\n\n    def initialize(self):\n        # Set Start Date so that backtest has 5+ years of data\n        self.set_start_date(2014, 11, 1)\n        # No need to set End Date as the final submission will be tested\n        # up until the review date\n\n        # Set $1m Strategy Cash to trade significant AUM\n        self.set_cash(1000000)\n\n        # Add a relevant benchmark, with the default being SPY\n        self.set_benchmark('SPY')\n\n        # Use the Alpha Streams Brokerage Model, developed in conjunction with\n        # funds to model their actual fees, costs, etc.\n        # Please do not add any additional reality modelling, such as Slippage, Fees, Buying Power, etc.\n        self.set_brokerage_model(AlphaStreamsBrokerageModel())\n\n        # Use the LiquidETFUniverse with minute-resolution data\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_universe_selection(LiquidETFUniverse())\n\n        # Optional\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n\n        # List of symbols we want to trade. Set it in OnSecuritiesChanged\n        self._symbols = []\n\n    def on_data(self, slice):\n\n        if all([self.portfolio[x].invested for x in self._symbols]):\n            return\n\n        # Emit insights\n        insights = [Insight.price(x, timedelta(1), InsightDirection.UP)\n            for x in self._symbols if self.securities[x].price > 0]\n\n        if len(insights) > 0:\n            self.emit_insights(insights)\n\n    def on_securities_changed(self, changes):\n\n        # Set symbols as the Inverse Energy ETFs\n        for security in changes.added_securities:\n            if security.symbol in LiquidETFUniverse.ENERGY.inverse:\n                self._symbols.append(security.symbol)\n\n        # Print out the information about the groups\n        self.log(f'Energy: {LiquidETFUniverse.ENERGY}')\n        self.log(f'Metals: {LiquidETFUniverse.METALS}')\n        self.log(f'Technology: {LiquidETFUniverse.TECHNOLOGY}')\n        self.log(f'Treasuries: {LiquidETFUniverse.TREASURIES}')\n        self.log(f'Volatility: {LiquidETFUniverse.VOLATILITY}')\n        self.log(f'SP500Sectors: {LiquidETFUniverse.SP_500_SECTORS}')\n"
  },
  {
    "path": "Algorithm.Python/LiveFeaturesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Live Trading Functionality Demonstration algorithm including SMS, Email and Web hook notifications.\n### </summary>\n### <meta name=\"tag\" content=\"live trading\" />\n### <meta name=\"tag\" content=\"alerts\" />\n### <meta name=\"tag\" content=\"sms alerts\" />\n### <meta name=\"tag\" content=\"web hooks\" />\n### <meta name=\"tag\" content=\"email alerts\" />\n### <meta name=\"tag\" content=\"runtime statistics\" />\n\nclass LiveTradingFeaturesAlgorithm(QCAlgorithm):\n\n    ### Initialize the Algorithm and Prepare Required Data\n    def initialize(self):\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(25000)\n\n        ##Equity Data for US Markets\n        self.add_security(SecurityType.EQUITY, 'IBM', Resolution.SECOND)\n\n        ##FOREX Data for Weekends: 24/6\n        self.add_security(SecurityType.FOREX, 'EURUSD', Resolution.MINUTE)\n\n        ##Custom/Bitcoin Live Data: 24/7\n        self.add_data(Bitcoin, 'BTC', Resolution.SECOND, TimeZones.UTC)\n\n        ##if the algorithm is connected to the brokerage\n        self.is_connected = True\n\n    ### Raises the data event\n    def on_data(self, data):\n        if (not self.portfolio['IBM'].hold_stock) and data.contains_key('IBM'):\n            quantity = int(np.floor(self.portfolio.margin_remaining / data['IBM'].close))\n            self.market_order('IBM',quantity)\n            self.debug('Purchased IBM on ' + str(self.time.strftime(\"%m/%d/%Y\")))\n            self.notify.email(\"myemail@gmail.com\", \"Test\", \"Test Body\", \"test attachment\")\n\n        if \"BTC\" in data:\n            btcData = data['BTC']\n            if self.live_mode:\n                self.set_runtime_statistic('BTC', str(btcData.close))\n\n            if not self.portfolio.hold_stock:\n                self.market_order('BTC', 100)\n\n                ##Send a notification email/SMS/web request on events:\n                self.notify.email(\"myemail@gmail.com\", \"Test\", \"Test Body\", \"test attachment\")\n                self.notify.sms(\"+11233456789\", str(btcData.time) + \">> Test message from live BTC server.\")\n                self.notify.web(\"http://api.quantconnect.com\", str(btcData.time) + \">> Test data packet posted from live BTC server.\")\n                self.notify.ftp(\"ftp.quantconnect.com\", \"username\", \"password\", \"path/to/file.txt\",\n                                str(btcData.time) + \">> Test file from live BTC server.\")\n                self.notify.sftp(\"ftp.quantconnect.com\", \"username\", \"password\", \"path/to/file.txt\",\n                                 str(btcData.time) + \">> Test file from live BTC server.\")\n                self.notify.sftp(\"ftp.quantconnect.com\", \"username\", \"privatekey\", \"optionalprivatekeypassphrase\", \"path/to/file.txt\",\n                                 str(btcData.time) + \">> Test file from live BTC server.\")\n\n    # Brokerage message event handler. This method is called for all types of brokerage messages.\n    def on_brokerage_message(self, message_event):\n        self.debug(f\"Brokerage meesage received - {message_event.to_string()}\")\n\n    # Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n    def on_brokerage_disconnect(self):\n        self.is_connected = False\n        self.debug(f\"Brokerage disconnected!\")\n\n    # Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n    def on_brokerage_reconnect(self):\n        self.is_connected = True\n        self.debug(f\"Brokerage reconnected!\")\n\n###Custom Data Type: Bitcoin data from Quandl - http://www.quandl.com/help/api-for-bitcoin-data\nclass Bitcoin(PythonData):\n\n    def get_source(self, config, date, is_live_mode):\n        if is_live_mode:\n            return SubscriptionDataSource(\"https://www.bitstamp.net/api/ticker/\", SubscriptionTransportMedium.REST)\n\n        return SubscriptionDataSource(\"https://www.quandl.com/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc\", SubscriptionTransportMedium.REMOTE_FILE)\n\n\n    def reader(self, config, line, date, is_live_mode):\n        coin = Bitcoin()\n        coin.symbol = config.symbol\n\n        if is_live_mode:\n            # Example Line Format:\n            # {\"high\": \"441.00\", \"last\": \"421.86\", \"timestamp\": \"1411606877\", \"bid\": \"421.96\", \"vwap\": \"428.58\", \"volume\": \"14120.40683975\", \"low\": \"418.83\", \"ask\": \"421.99\"}\n            try:\n                live_btc = json.loads(line)\n\n                # If value is zero, return None\n                value = live_btc[\"last\"]\n                if value == 0: return None\n\n                coin.time = datetime.now()\n                coin.value = value\n                coin[\"Open\"] = float(live_btc[\"open\"])\n                coin[\"High\"] = float(live_btc[\"high\"])\n                coin[\"Low\"] = float(live_btc[\"low\"])\n                coin[\"Close\"] = float(live_btc[\"last\"])\n                coin[\"Ask\"] = float(live_btc[\"ask\"])\n                coin[\"Bid\"] = float(live_btc[\"bid\"])\n                coin[\"VolumeBTC\"] = float(live_btc[\"volume\"])\n                coin[\"WeightedPrice\"] = float(live_btc[\"vwap\"])\n                return coin\n            except ValueError:\n                # Do nothing, possible error in json decoding\n                return None\n\n        # Example Line Format:\n        # Date      Open   High    Low     Close   Volume (BTC)    Volume (Currency)   Weighted Price\n        # 2011-09-13 5.8    6.0     5.65    5.97    58.37138238,    346.0973893944      5.929230648356\n        if not (line.strip() and line[0].isdigit()): return None\n\n        try:\n            data = line.split(',')\n            coin.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            coin.value = float(data[4])\n            coin[\"Open\"] = float(data[1])\n            coin[\"High\"] = float(data[2])\n            coin[\"Low\"] = float(data[3])\n            coin[\"Close\"] = float(data[4])\n            coin[\"VolumeBTC\"] = float(data[5])\n            coin[\"VolumeUSD\"] = float(data[6])\n            coin[\"WeightedPrice\"] = float(data[7])\n            return coin\n\n        except ValueError:\n            # Do nothing, possible error in json decoding\n            return None\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport itertools\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Butterfly Call and Short Butterfly Call strategies.\n### </summary>\nclass LongAndShortButterflyCallStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 6\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        call_contracts = (contract for contract in chain if contract.right == OptionRight.CALL)\n\n        for expiry, group in itertools.groupby(call_contracts, lambda x: x.expiry):\n            contracts = list(group)\n            if len(contracts) < 3:\n                continue\n\n            strikes = sorted([contract.strike for contract in contracts])\n            atm_strike = min(strikes, key=lambda strike: abs(strike - chain.underlying.price))\n            spread = min(atm_strike - strikes[0], strikes[-1] - atm_strike)\n            itm_strike = atm_strike - spread\n            otm_strike = atm_strike + spread\n\n            if otm_strike in strikes and itm_strike in strikes:\n                # Ready to trade\n                self._butterfly_call = OptionStrategies.butterfly_call(option_symbol, otm_strike, atm_strike, itm_strike, expiry)\n                self._short_butterfly_call = OptionStrategies.short_butterfly_call(option_symbol, otm_strike, atm_strike, itm_strike, expiry)\n                self.buy(self._butterfly_call, 2)\n                return\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 3:\n            raise AssertionError(f\"Expected position group to have 3 positions. Actual: {len(positions)}\")\n\n        higher_strike = max(leg.strike for leg in self._butterfly_call.option_legs)\n        higher_strike_position = next((position for position in positions\n                                      if position.symbol.id.option_right == OptionRight.CALL and position.symbol.id.strike_price == higher_strike),\n                                     None)\n\n        if higher_strike_position and higher_strike_position.quantity != 2:\n            raise AssertionError(f\"Expected higher strike position quantity to be 2. Actual: {higher_strike_position.quantity}\")\n\n        lower_strike = min(leg.strike for leg in self._butterfly_call.option_legs)\n        lower_strike_position = next((position for position in positions\n                                    if position.symbol.id.option_right == OptionRight.CALL and position.symbol.id.strike_price == lower_strike),\n                                   None)\n\n        if lower_strike_position and lower_strike_position.quantity != 2:\n            raise AssertionError(f\"Expected lower strike position quantity to be 2. Actual: {lower_strike_position.quantity}\")\n\n        middle_strike = [leg.strike for leg in self._butterfly_call.option_legs if leg.strike < higher_strike and leg.strike > lower_strike][0]\n        middle_strike_position = next((position for position in positions\n                                     if position.symbol.id.option_right == OptionRight.CALL and position.symbol.id.strike_price == middle_strike),\n                                    None)\n\n        if middle_strike_position and middle_strike_position.quantity != -4:\n            raise AssertionError(f\"Expected middle strike position quantity to be -4. Actual: {middle_strike_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We should be able to close the position using the inverse strategy (a short butterfly call)\n        self.buy(self._short_butterfly_call, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport itertools\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Butterfly Put and Short Butterfly Put strategies.\n### </summary>\nclass LongAndShortButterflyPutStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 6\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol) -> None:\n        put_contracts = (contract for contract in chain if contract.right == OptionRight.PUT)\n\n        for expiry, group in itertools.groupby(put_contracts, lambda x: x.expiry):\n            contracts = list(group)\n            if len(contracts) < 3:\n                continue\n\n            strikes = sorted([contract.strike for contract in contracts])\n            atm_strike = min(strikes, key=lambda strike: abs(strike - chain.underlying.price))\n            spread = min(atm_strike - strikes[0], strikes[-1] - atm_strike)\n            itm_strike = atm_strike + spread\n            otm_strike = atm_strike - spread\n\n            if otm_strike in strikes and itm_strike in strikes:\n                # Ready to trade\n                self._butterfly_put = OptionStrategies.butterfly_put(option_symbol, itm_strike, atm_strike, otm_strike, expiry)\n                self._short_butterfly_put = OptionStrategies.short_butterfly_put(option_symbol, itm_strike, atm_strike, otm_strike, expiry)\n                self.buy(self._butterfly_put, 2)\n                return\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol) -> None:\n        positions = list(position_group.positions)\n        if len(positions) != 3:\n            raise AssertionError(f\"Expected position group to have 3 positions. Actual: {len(positions)}\")\n\n        higher_strike = max(leg.strike for leg in self._butterfly_put.option_legs)\n        higher_strike_position = next((position for position in positions\n                                      if position.symbol.id.option_right == OptionRight.PUT and position.symbol.id.strike_price == higher_strike),\n                                     None)\n\n        if not higher_strike_position or higher_strike_position.quantity != 2:\n            raise AssertionError(f\"Expected higher strike position quantity to be 2. Actual: {higher_strike_position.quantity}\")\n\n        lower_strike = min(leg.strike for leg in self._butterfly_put.option_legs)\n        lower_strike_position = next((position for position in positions\n                                    if position.symbol.id.option_right == OptionRight.PUT and position.symbol.id.strike_price == lower_strike),\n                                   None)\n\n        if not lower_strike_position or lower_strike_position.quantity != 2:\n            raise AssertionError(f\"Expected lower strike position quantity to be 2. Actual: {lower_strike_position.quantity}\")\n\n        middle_strike = [leg.strike for leg in self._butterfly_put.option_legs if leg.strike < higher_strike and leg.strike > lower_strike][0]\n        middle_strike_position = next((position for position in positions\n                                     if position.symbol.id.option_right == OptionRight.PUT and position.symbol.id.strike_price == middle_strike),\n                                    None)\n\n        if not middle_strike_position or middle_strike_position.quantity != -4:\n            raise AssertionError(f\"Expected middle strike position quantity to be -4. Actual: {middle_strike_position.quantity}\")\n\n    def liquidate_strategy(self) -> None:\n        # We should be able to close the position using the inverse strategy (a short butterfly put)\n        self.buy(self._short_butterfly_put, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport itertools\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Call Calendar Spread and Short Call Calendar Spread strategies.\n### </summary>\nclass LongAndShortCallCalendarSpreadStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol) -> None:\n        call_contracts = sorted((contract for contract in chain if contract.right == OptionRight.CALL),\n                           key=lambda x: abs(x.strike - chain.underlying.value))\n        for strike, group in itertools.groupby(call_contracts, lambda x: x.strike):\n            contracts = sorted(group, key=lambda x: x.expiry)\n            if len(contracts) < 2:\n                continue\n\n            self._near_expiration = contracts[0].expiry\n            self._far_expiration = contracts[1].expiry\n\n            self._call_calendar_spread = OptionStrategies.call_calendar_spread(option_symbol, strike, self._near_expiration, self._far_expiration)\n            self._short_call_calendar_spread = OptionStrategies.short_call_calendar_spread(option_symbol, strike, self._near_expiration, self._far_expiration)\n            self.buy(self._call_calendar_spread, 2)\n            return\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol) -> None:\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        near_expiration_position = next((position for position in positions\n                                       if position.symbol.id.option_right == OptionRight.CALL and position.symbol.id.date == self._near_expiration),\n                                      None)\n        if not near_expiration_position or near_expiration_position.quantity != -2:\n            raise AssertionError(f\"Expected near expiration position to be -2. Actual: {near_expiration_position.quantity}\")\n\n        far_expiration_position = next((position for position in positions\n                                      if position.symbol.id.option_right == OptionRight.CALL and position.symbol.id.date == self._far_expiration),\n                                     None)\n        if not far_expiration_position or far_expiration_position.quantity != 2:\n            raise AssertionError(f\"Expected far expiration position to be 2. Actual: {far_expiration_position.quantity}\")\n\n    def liquidate_strategy(self) -> None:\n        # We should be able to close the position using the inverse strategy (a short call calendar spread)\n        self.buy(self._short_call_calendar_spread, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortPutCalendarSpreadStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport itertools\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Put Calendar Spread and Short Put Calendar Spread strategies.\n### </summary>\nclass LongAndShortPutCalendarSpreadStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol) -> None:\n        put_contracts = sorted((contract for contract in chain if contract.right == OptionRight.PUT),\n                              key=lambda x: abs(x.strike - chain.underlying.value))\n        for strike, group in itertools.groupby(put_contracts, lambda x: x.strike):\n            contracts = sorted(group, key=lambda x: x.expiry)\n            if len(contracts) < 2:\n                continue\n\n            self._near_expiration = contracts[0].expiry\n            self._far_expiration = contracts[1].expiry\n\n            self._put_calendar_spread = OptionStrategies.put_calendar_spread(option_symbol, strike, self._near_expiration, self._far_expiration)\n            self._short_put_calendar_spread = OptionStrategies.short_put_calendar_spread(option_symbol, strike, self._near_expiration, self._far_expiration)\n            self.buy(self._put_calendar_spread, 2)\n            return\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol) -> None:\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        near_expiration_position = next((position for position in positions\n                                       if position.symbol.id.option_right == OptionRight.PUT and position.symbol.id.date == self._near_expiration),\n                                      None)\n        if not near_expiration_position or near_expiration_position.quantity != -2:\n            raise AssertionError(f\"Expected near expiration position to be -2. Actual: {near_expiration_position.quantity}\")\n\n        far_expiration_position = next((position for position in positions\n                                      if position.symbol.id.option_right == OptionRight.PUT and position.symbol.id.date == self._far_expiration),\n                                     None)\n        if not far_expiration_position or far_expiration_position.quantity != 2:\n            raise AssertionError(f\"Expected far expiration position to be 2. Actual: {far_expiration_position.quantity}\")\n\n    def liquidate_strategy(self) -> None:\n        # We should be able to close the position using the inverse strategy (a short put calendar spread)\n        self.buy(self._short_put_calendar_spread, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortStraddleStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport itertools\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Straddle and Short Straddle strategies.\n### </summary>\nclass LongAndShortStraddleStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key=lambda x: abs(chain.underlying.price - x.strike)),\n                           key=lambda x: x.expiry, reverse=True)\n        grouped_contracts = [list(group) for _, group in itertools.groupby(contracts, lambda x: (x.strike, x.expiry))]\n        filtered_grouped_contracts = (group\n                            for group in grouped_contracts\n                            if (any(contract.right == OptionRight.CALL for contract in group) and\n                                any(contract.right == OptionRight.PUT for contract in group)))\n        contracts = next(filtered_grouped_contracts, [])\n\n        if len(contracts) == 0:\n            return\n\n        contract = contracts[0]\n        if contract is not None:\n            self._straddle = OptionStrategies.straddle(option_symbol, contract.strike, contract.expiry)\n            self._short_straddle = OptionStrategies.short_straddle(option_symbol, contract.strike, contract.expiry)\n            self.buy(self._straddle, 2)\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        call_position = next((position for position in positions if position.symbol.id.option_right == OptionRight.CALL), None)\n        if call_position is None:\n            raise AssertionError(\"Expected position group to have a call position\")\n\n        put_position = next((position for position in positions if position.symbol.id.option_right == OptionRight.PUT), None)\n        if put_position is None:\n            raise AssertionError(\"Expected position group to have a put position\")\n\n        expected_call_position_quantity = 2\n        expected_put_position_quantity = 2\n\n        if call_position.quantity != expected_call_position_quantity:\n            raise AssertionError(f\"Expected call position quantity to be {expected_call_position_quantity}. Actual: {call_position.quantity}\")\n\n        if put_position.quantity != expected_put_position_quantity:\n            raise AssertionError(f\"Expected put position quantity to be {expected_put_position_quantity}. Actual: {put_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We should be able to close the position using the inverse strategy (a short straddle)\n        self.buy(self._short_straddle, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongAndShortStrangleStrategiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport itertools\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Strangle and Short Strangle strategies.\n### </summary>\nclass LongAndShortStrangleStrategiesAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 4\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key=lambda x: abs(chain.underlying.price - x.strike)),\n                           key=lambda x: x.expiry, reverse=True)\n        grouped_contracts = (list(group) for _, group in itertools.groupby(contracts, lambda x: x.expiry))\n\n        call_contract = None\n        put_contract = None\n        for group in grouped_contracts:\n            call_contracts = sorted((contract for contract in group if contract.right == OptionRight.CALL),\n                                   key=lambda x: x.strike, reverse=True)\n            put_contracts = sorted((contract for contract in group if contract.right == OptionRight.PUT),\n                                  key=lambda x: x.strike)\n\n            if len(call_contracts) > 0 and len(put_contracts) > 0 and call_contracts[0].strike > put_contracts[0].strike:\n                call_contract = call_contracts[0]\n                put_contract = put_contracts[0]\n                break\n\n        if call_contract is not None and put_contract is not None:\n            self._strangle = OptionStrategies.strangle(option_symbol, call_contract.strike, put_contract.strike, call_contract.expiry)\n            self._short_strangle = OptionStrategies.short_strangle(option_symbol, call_contract.strike, put_contract.strike,\n                                                                  call_contract.expiry)\n            self.buy(self._strangle, 2)\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 2:\n            raise AssertionError(f\"Expected position group to have 2 positions. Actual: {len(positions)}\")\n\n        call_position = next((position for position in positions if position.symbol.id.option_right == OptionRight.CALL), None)\n        if call_position is None:\n            raise AssertionError(\"Expected position group to have a call position\")\n\n        put_position = next((position for position in positions if position.symbol.id.option_right == OptionRight.PUT), None)\n        if put_position is None:\n            raise AssertionError(\"Expected position group to have a put position\")\n\n        expected_call_position_quantity = 2\n        expected_put_position_quantity = 2\n\n        if call_position.quantity != expected_call_position_quantity:\n            raise AssertionError(f\"Expected call position quantity to be {expected_call_position_quantity}. Actual: {call_position.quantity}\")\n\n        if put_position.quantity != expected_put_position_quantity:\n            raise AssertionError(f\"Expected put position quantity to be {expected_put_position_quantity}. Actual: {put_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We should be able to close the position using the inverse strategy (a short strangle)\n        self.buy(self._short_strangle, 2)\n"
  },
  {
    "path": "Algorithm.Python/LongOnlyAlphaStreamAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\nfrom Selection.ManualUniverseSelectionModel import ManualUniverseSelectionModel\n\n### <summary>\n### Basic template framework algorithm uses framework components to define the algorithm.\n### Shows EqualWeightingPortfolioConstructionModel.long_only() application\n### </summary>\n### <meta name=\"tag\" content=\"alpha streams\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"algorithm framework\" />\nclass LongOnlyAlphaStreamAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # 1. Required:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        # 2. Required: Alpha Streams Models:\n        self.set_brokerage_model(BrokerageName.ALPHA_STREAMS)\n\n        # 3. Required: Significant AUM Capacity\n        self.set_cash(1000000)\n\n        # Only SPY will be traded\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Resolution.DAILY, PortfolioBias.LONG))\n        self.set_execution(ImmediateExecutionModel())\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        # Set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(\n            [Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in [\"SPY\", \"IBM\"]]))\n\n    def on_data(self, slice):\n        if self.portfolio.invested: return\n\n        self.emit_insights(\n            [\n                Insight.price(\"SPY\", timedelta(1), InsightDirection.UP),\n                Insight.price(\"IBM\", timedelta(1), InsightDirection.DOWN)\n            ])\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            if self.securities[order_event.symbol].holdings.is_short:\n                raise ValueError(\"Invalid position, should not be short\")\n            self.debug(order_event)\n"
  },
  {
    "path": "Algorithm.Python/MACDTrendAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Simple indicator demonstration algorithm of MACD\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"plotting indicators\" />\nclass MACDTrendAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2004, 1, 1)    #Set Start Date\n        self.set_end_date(2015, 1, 1)      #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n        # define our daily macd(12,26) with a 9 day signal\n        self.__macd = self.macd(\"SPY\", 12, 26, 9, MovingAverageType.EXPONENTIAL, Resolution.DAILY)\n        self.__previous = datetime.min\n        self.plot_indicator(\"MACD\", True, self.__macd, self.__macd.signal)\n        self.plot_indicator(\"SPY\", self.__macd.fast, self.__macd.slow)\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        # wait for our macd to fully initialize\n        if not self.__macd.is_ready: return\n\n        # only once per day\n        if self.__previous.date() == self.time.date(): return\n\n        # define a small tolerance on our checks to avoid bouncing\n        tolerance = 0.0025\n\n        holdings = self.portfolio[\"SPY\"].quantity\n\n        signal_delta_percent = (self.__macd.current.value - self.__macd.signal.current.value)/self.__macd.fast.current.value\n\n        # if our macd is greater than our signal, then let's go long\n        if holdings <= 0 and signal_delta_percent > tolerance:  # 0.01%\n            # longterm says buy as well\n            self.set_holdings(\"SPY\", 1.0)\n\n        # of our macd is less than our signal, then let's go short\n        elif holdings >= 0 and signal_delta_percent < -tolerance:\n            self.liquidate(\"SPY\")\n\n\n        self.__previous = self.time\n"
  },
  {
    "path": "Algorithm.Python/MacdAlphaModelFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Alphas.MacdAlphaModel import MacdAlphaModel\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"MacdAlphaModel\"/>.\n### </summary>\nclass MacdAlphaModelFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_alpha(MacdAlphaModel())\n\n    def on_end_of_algorithm(self):\n        expected = 4\n        if self.insights.total_count != expected:\n           raise AssertionError(f\"The total number of insights should be {expected}. Actual: {self.insights.total_count}\")\n"
  },
  {
    "path": "Algorithm.Python/ManuallyRemovedConsolidatorsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm asserting that the consolidators are removed from the SubscriptionManager.\n### This makes sure that we don't lose references to python consolidators when\n### they are wrapped in a DataConsolidatorPythonWrapper.\n### </summary>\nclass ManuallyRemovedConsolidatorsAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        self.consolidators = []\n\n        self.spy = self.add_equity(\"SPY\").symbol\n\n        # Case 1: consolidator registered through a RegisterIndicator() call,\n        # which will wrap the consolidator instance in a DataConsolidatorPythonWrapper\n        consolidator = self.resolve_consolidator(self.spy, Resolution.MINUTE)\n        self.consolidators.append(consolidator)\n\n        indicator_name = self.create_indicator_name(self.spy, \"close\", Resolution.MINUTE)\n        identity = Identity(indicator_name)\n        self.indicator = self.register_indicator(self.spy, identity, consolidator)\n\n        # Case 2: consolidator registered directly through the SubscriptionManager\n        consolidator = self.resolve_consolidator(self.spy, Resolution.MINUTE)\n        self.consolidators.append(consolidator)\n        self.subscription_manager.add_consolidator(self.spy, consolidator)\n\n        # Case 3: custom python consolidator not derived from IDataConsolidator\n        consolidator = CustomQuoteBarConsolidator(timedelta(hours=1))\n        self.consolidators.append(consolidator)\n        self.subscription_manager.add_consolidator(self.spy, consolidator)\n\n    def on_end_of_algorithm(self) -> None:\n        # Remove the first consolidator\n\n        for i in range(3):\n            consolidator = self.consolidators[i]\n            self.remove_consolidator(consolidator, expected_consolidator_count=2 - i)\n\n    def remove_consolidator(self, consolidator: IDataConsolidator, expected_consolidator_count: int) -> None:\n        self.subscription_manager.remove_consolidator(self.spy, consolidator)\n\n        consolidator_count = sum(s.consolidators.count for s in self.subscription_manager.subscriptions)\n        if consolidator_count != expected_consolidator_count:\n            raise AssertionError(f\"Unexpected number of consolidators after removal. \"\n                            f\"Expected: {expected_consolidator_count}. Actual: {consolidator_count}\")\n\nclass CustomQuoteBarConsolidator(PythonConsolidator):\n    '''A custom quote bar consolidator that inherits from PythonConsolidator and implements\n    the IDataConsolidator interface, it must implement all of IDataConsolidator. Reference\n    PythonConsolidator.cs and DataConsolidatorPythonWrapper.PY for more information.\n\n    This class shows how to implement a consolidator from scratch in Python, this gives us more\n    freedom to determine the behavior of the consolidator but can't leverage any of the built in\n    functions of an inherited class.\n\n    For this example we implemented a Quotebar from scratch'''\n\n    def __init__(self, period):\n\n        #IDataConsolidator required vars for all consolidators\n        self.consolidated = None        #Most recently consolidated piece of data.\n        self.working_data = None         #Data being currently consolidated\n        self.input_type = QuoteBar       #The type consumed by this consolidator\n        self.output_type = QuoteBar      #The type produced by this consolidator\n\n        #Consolidator Variables\n        self.period = period\n\n    def update(self, data):\n        '''Updates this consolidator with the specified data'''\n\n        #If we don't have bar yet, create one\n        if self.working_data is None:\n            self.working_data = QuoteBar(data.time,data.symbol,data.bid,data.last_bid_size,\n                data.ask,data.last_ask_size,self.period)\n\n        #Update bar using QuoteBar's update()\n        self.working_data.update(data.value, data.bid.close, data.ask.close, 0,\n            data.last_bid_size, data.last_ask_size)\n\n    def scan(self, time):\n        '''Scans this consolidator to see if it should emit a bar due to time passing'''\n\n        if self.period is not None and self.working_data is not None:\n            if time - self.working_data.time >= self.period:\n\n                #Trigger the event handler with a copy of self and the data\n                self.on_data_consolidated(self, self.working_data)\n\n                #Set the most recent consolidated piece of data and then clear the working_data\n                self.consolidated = self.working_data\n                self.working_data = None\n"
  },
  {
    "path": "Algorithm.Python/ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport Newtonsoft.Json as json\n\n### <summary>\n### Algorithm illustrating how to manually set market hours and symbol properties database entries to be picked up by the algorithm's securities.\n### This specific case illustrates how to do it for CFDs to match InteractiveBrokers brokerage, which has different market hours\n### depending on the CFD underlying asset.\n### </summary>\nclass ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm(QCAlgorithm):\n    '''\n    Algorithm illustrating how to manually set market hours and symbol properties database entries to be picked up by the algorithm's securities.\n    This specific case illustrates how to do it for CFDs to match InteractiveBrokers brokerage, which has different market hours\n    depending on the CFD underlying asset.\n    '''\n\n    def initialize(self):\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self.set_brokerage_model(BrokerageName.INTERACTIVE_BROKERS_BROKERAGE)\n\n        # Some brokerages like InteractiveBrokers make a difference on CFDs depending on the underlying (equity, index, metal, forex).\n        # Depending on this, the market hours can be different. In order to be more specific with the market hours,\n        # we can set the MarketHoursDatabase entry for the CFDs.\n\n        # Equity CFDs are usually traded the same hours as the equity market.\n        equity_market_hours_entry = self.market_hours_database.get_entry(Market.USA, Symbol.EMPTY, SecurityType.EQUITY)\n        self.market_hours_database.set_entry(Market.INTERACTIVE_BROKERS, \"\", SecurityType.CFD, equity_market_hours_entry.exchange_hours, equity_market_hours_entry.data_time_zone)\n\n        # The same can be done for the symbol properties, in case they are different depending on the underlying\n        equity_symbol_properties = self.symbol_properties_database.get_symbol_properties(Market.USA, Symbol.EMPTY, SecurityType.EQUITY, Currencies.USD)\n        self.symbol_properties_database.set_entry(Market.INTERACTIVE_BROKERS, \"\", SecurityType.CFD, equity_symbol_properties)\n\n        spy_cfd = self.add_cfd(\"SPY\", market=Market.INTERACTIVE_BROKERS)\n\n        if json.JsonConvert.serialize_object(spy_cfd.exchange.hours) != json.JsonConvert.serialize_object(equity_market_hours_entry.exchange_hours):\n            raise AssertionError(\"Expected the SPY CFD market hours to be the same as the underlying equity market hours.\")\n\n        if json.JsonConvert.serialize_object(spy_cfd.symbol_properties) != json.JsonConvert.serialize_object(equity_symbol_properties):\n            raise AssertionError(\"Expected the SPY CFD symbol properties to be the same as the underlying equity symbol properties.\")\n\n        # We can also do it for a specific ticker\n        aud_usd_forex_market_hours_entry = self.market_hours_database.get_entry(Market.OANDA, Symbol.EMPTY, SecurityType.FOREX)\n        self.market_hours_database.set_entry(Market.INTERACTIVE_BROKERS, \"AUDUSD\", SecurityType.CFD, aud_usd_forex_market_hours_entry.exchange_hours, aud_usd_forex_market_hours_entry.data_time_zone)\n\n        aud_usd_forex_symbol_properties = self.symbol_properties_database.get_symbol_properties(Market.OANDA, \"AUDUSD\", SecurityType.FOREX, Currencies.USD)\n        self.symbol_properties_database.set_entry(Market.INTERACTIVE_BROKERS, \"AUDUSD\", SecurityType.CFD, aud_usd_forex_symbol_properties)\n\n        aud_usd_cfd = self.add_cfd(\"AUDUSD\", market=Market.INTERACTIVE_BROKERS)\n\n        if json.JsonConvert.serialize_object(aud_usd_cfd.exchange.hours) != json.JsonConvert.serialize_object(aud_usd_forex_market_hours_entry.exchange_hours):\n            raise AssertionError(\"Expected the AUDUSD CFD market hours to be the same as the underlying forex market hours.\")\n\n        if json.JsonConvert.serialize_object(aud_usd_cfd.symbol_properties) != json.JsonConvert.serialize_object(aud_usd_forex_symbol_properties):\n            raise AssertionError(\"Expected the AUDUSD CFD symbol properties to be the same as the underlying forex symbol properties.\")\n"
  },
  {
    "path": "Algorithm.Python/MarginCallEventsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm showcases two margin related event handlers.\n### OnMarginCallWarning: Fired when a portfolio's remaining margin dips below 5% of the total portfolio value\n### OnMarginCall: Fired immediately before margin call orders are execued, this gives the algorithm a change to regain margin on its own through liquidation\n### </summary>\n### <meta name=\"tag\" content=\"securities and portfolio\" />\n### <meta name=\"tag\" content=\"margin models\" />\nclass MarginCallEventsAlgorithm(QCAlgorithm):\n    \"\"\"\n    This algorithm showcases two margin related event handlers.\n    on_margin_call_warning: Fired when a portfolio's remaining margin dips below 5% of the total portfolio value\n    on_margin_call: Fired immediately before margin call orders are execued, this gives the algorithm a change to regain margin on its own through liquidation\n    \"\"\"\n\n    def initialize(self):\n        self.set_cash(100000)\n        self.set_start_date(2013,10,1)\n        self.set_end_date(2013,12,11)\n        self.add_equity(\"SPY\", Resolution.SECOND)\n        # cranking up the leverage increases the odds of a margin call\n        # when the security falls in value\n        self.securities[\"SPY\"].set_leverage(100)\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\",100)\n\n    def on_margin_call(self, requests):\n        # Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        # <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        # this code gets called BEFORE the orders are placed, so we can try to liquidate some of our positions\n        # before we get the margin call orders executed. We could also modify these orders by changing their quantities\n        for order in requests:\n\n            # liquidate an extra 10% each time we get a margin call to give us more padding\n            new_quantity = int(order.quantity * 1.1)\n            requests.remove(order)\n            requests.append(SubmitOrderRequest(order.order_type, order.security_type, order.symbol, new_quantity, order.stop_price, order.limit_price, self.time, \"on_margin_call\"))\n\n        return requests\n\n    def on_margin_call_warning(self):\n        # Margin call warning event handler.\n        # This method is called when portfolio.margin_remaining is under 5% of your portfolio.total_portfolio_value\n        # a chance to prevent a margin call from occurring\n\n        spy_holdings = self.securities[\"SPY\"].holdings.quantity\n        shares = int(-spy_holdings * 0.005)\n        self.error(\"{0} - on_margin_call_warning(): Liquidating {1} shares of SPY to avoid margin call.\".format(self.time, shares))\n        self.market_order(\"SPY\", shares)\n"
  },
  {
    "path": "Algorithm.Python/MarketImpactSlippageModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MarketImpactSlippageModelRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 13)\n        self.set_cash(10000000)\n\n        spy = self.add_equity(\"SPY\", Resolution.DAILY)\n        aapl = self.add_equity(\"AAPL\", Resolution.DAILY)\n\n        spy.set_slippage_model(MarketImpactSlippageModel(self))\n        aapl.set_slippage_model(MarketImpactSlippageModel(self))\n\n    def on_data(self, data):\n        self.set_holdings(\"SPY\", 0.5)\n        self.set_holdings(\"AAPL\", -0.5)\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(f\"Price: {self.securities[order_event.symbol].price}, filled price: {order_event.fill_price}, quantity: {order_event.fill_quantity}\")\n"
  },
  {
    "path": "Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm(QCAlgorithm):\n    '''This regression test is a version of \"MarketOnCloseOrderBufferRegressionAlgorithm\"\n     where we test market-on-close modeling with data from the post market.'''\n    _valid_order_ticket = None\n    _invalid_order_ticket = None\n    _valid_order_ticket_extended_market_hours = None\n\n    def initialize(self) -> None:\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,8)    #Set End Date\n\n        self.add_equity(\"SPY\", Resolution.MINUTE, extended_market_hours = True)\n\n        def moc_at_mid_night():\n            self._valid_order_ticket_at_midnight = self.market_on_close_order(\"SPY\", 2)\n\n        self.schedule.on(self.date_rules.tomorrow, self.time_rules.midnight, moc_at_mid_night)\n\n        # Modify our submission buffer time to 10 minutes\n        MarketOnCloseOrder.submission_time_buffer = timedelta(minutes=10)\n\n    def on_data(self, data: Slice) -> None:\n        # Test our ability to submit MarketOnCloseOrders\n        # Because we set our buffer to 10 minutes, any order placed\n        # before 3:50PM should be accepted, any after marked invalid\n\n        # Will not throw an order error and execute\n        if self.time.hour == 15 and self.time.minute == 49 and not self._valid_order_ticket:\n            self._valid_order_ticket = self.market_on_close_order(\"SPY\", 2)\n\n        # Will throw an order error and be marked invalid\n        if self.time.hour == 15 and self.time.minute == 51 and not self._invalid_order_ticket:\n            self._invalid_order_ticket = self.market_on_close_order(\"SPY\", 2)\n\n        # Will not throw an order error and execute\n        if self.time.hour == 16 and self.time.minute == 48 and not self._valid_order_ticket_extended_market_hours:\n            self._valid_order_ticket_extended_market_hours = self.market_on_close_order(\"SPY\", 2)\n\n    def on_end_of_algorithm(self) -> None:\n        # Set it back to default for other regressions\n        MarketOnCloseOrder.submission_time_buffer = MarketOnCloseOrder.DEFAULT_SUBMISSION_TIME_BUFFER\n\n        if self._valid_order_ticket.status != OrderStatus.FILLED:\n            raise AssertionError(\"Valid order failed to fill\")\n\n        if self._invalid_order_ticket.status != OrderStatus.INVALID:\n            raise AssertionError(\"Invalid order was not rejected\")\n\n        if self._valid_order_ticket_extended_market_hours.status != OrderStatus.FILLED:\n            raise AssertionError(\"Valid order during extended market hours failed to fill\")\n"
  },
  {
    "path": "Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass MarketOnCloseOrderBufferRegressionAlgorithm(QCAlgorithm):\n    _valid_order_ticket = None\n    _invalid_order_ticket = None\n\n    def initialize(self) -> None:\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,8)    #Set End Date\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        def moc_at_post_market():\n            self._valid_order_ticket_extended_market_hours = self.market_on_close_order(\"SPY\", 2)\n\n        self.schedule.on(self.date_rules.today, self.time_rules.at(17,0), moc_at_post_market)\n                \n        # Modify our submission buffer time to 10 minutes\n        MarketOnCloseOrder.submission_time_buffer = timedelta(minutes=10)\n\n    def on_data(self, data: Slice) -> None:\n        # Test our ability to submit MarketOnCloseOrders\n        # Because we set our buffer to 10 minutes, any order placed\n        # before 3:50PM should be accepted, any after marked invalid\n\n        # Will not throw an order error and execute\n        if self.time.hour == 15 and self.time.minute == 49 and not self._valid_order_ticket:\n            self._valid_order_ticket = self.market_on_close_order(\"SPY\", 2)\n\n        # Will throw an order error and be marked invalid\n        if self.time.hour == 15 and self.time.minute == 51 and not self._invalid_order_ticket:\n            self._invalid_order_ticket = self.market_on_close_order(\"SPY\", 2)\n\n    def on_end_of_algorithm(self) -> None:\n        # Set it back to default for other regressions\n        MarketOnCloseOrder.submission_time_buffer = MarketOnCloseOrder.DEFAULT_SUBMISSION_TIME_BUFFER\n\n        if self._valid_order_ticket.status != OrderStatus.FILLED:\n            raise AssertionError(\"Valid order failed to fill\")\n\n        if self._invalid_order_ticket.status != OrderStatus.INVALID:\n            raise AssertionError(\"Invalid order was not rejected\")\n\n        if self._valid_order_ticket_extended_market_hours.status != OrderStatus.FILLED:\n            raise AssertionError(\"Valid order during extended market hours failed to fill\")\n"
  },
  {
    "path": "Algorithm.Python/MarketOnOpenOnCloseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of the Market On Close order for US Equities.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\nclass MarketOnOpenOnCloseAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.equity = self.add_equity(\"SPY\", Resolution.SECOND, fill_forward = True, extended_market_hours = True)\n        self.__submitted_market_on_close_today = False\n        self.__last = datetime.min\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if self.time.date() != self.__last.date():   # each morning submit a market on open order\n            self.__submitted_market_on_close_today = False\n            self.market_on_open_order(\"SPY\", 100)\n            self.__last = self.time\n\n        if not self.__submitted_market_on_close_today and self.equity.exchange.exchange_open:   # once the exchange opens submit a market on close order\n            self.__submitted_market_on_close_today = True\n            self.market_on_close_order(\"SPY\", -100)\n\n    def on_order_event(self, fill):\n        order = self.transactions.get_order_by_id(fill.order_id)\n        self.log(\"{0} - {1}:: {2}\".format(self.time, order.type, fill))\n"
  },
  {
    "path": "Algorithm.Python/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Risk.MaximumDrawdownPercentPerSecurity import MaximumDrawdownPercentPerSecurity\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"MaximumDrawdownPercentPerSecurity\"/>.\n### </summary>\nclass MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_universe_selection(ManualUniverseSelectionModel(Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)))\n\n        self.set_risk_management(MaximumDrawdownPercentPerSecurity(0.004))\n\n"
  },
  {
    "path": "Algorithm.Python/MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Risk.CompositeRiskManagementModel import CompositeRiskManagementModel\nfrom Risk.MaximumDrawdownPercentPortfolio import MaximumDrawdownPercentPortfolio\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"MaximumDrawdownPercentPortfolio\"/>.\n### </summary>\nclass MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_universe_selection(ManualUniverseSelectionModel(Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)))\n\n        # define risk management model as a composite of several risk management models\n        self.set_risk_management(CompositeRiskManagementModel(\n            MaximumDrawdownPercentPortfolio(0.01),         # Avoid loss of initial capital\n            MaximumDrawdownPercentPortfolio(0.015, True)   # Avoid profit losses\n            ))\n"
  },
  {
    "path": "Algorithm.Python/MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Risk.MaximumSectorExposureRiskManagementModel import MaximumSectorExposureRiskManagementModel\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"MaximumSectorExposureRiskManagementModel\"/>.\n### </summary>\nclass MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2014, 2, 1)  #Set Start Date\n        self.set_end_date(2014, 5, 1)    #Set End Date\n\n        # set algorithm framework models\n        tickers = [ \"AAPL\", \"MSFT\", \"GOOG\", \"AIG\", \"BAC\" ]\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(\n            lambda coarse: [ x.symbol for x in coarse if x.symbol.value in tickers ],\n            lambda fine: [ x.symbol for x in fine ]\n        ))\n\n        # define risk management model such that maximum weight of a single sector be 10%\n        # Number of of trades changed from 34 to 30 when using the MaximumSectorExposureRiskManagementModel\n        self.set_risk_management(MaximumSectorExposureRiskManagementModel(0.1))\n\n    def on_end_of_algorithm(self):\n        pass\n"
  },
  {
    "path": "Algorithm.Python/MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Risk.MaximumUnrealizedProfitPercentPerSecurity import MaximumUnrealizedProfitPercentPerSecurity\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"MaximumUnrealizedProfitPercentPerSecurity\"/>.\n### </summary>\nclass MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_universe_selection(ManualUniverseSelectionModel(Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)))\n\n        self.set_risk_management(MaximumUnrealizedProfitPercentPerSecurity(0.004))\n"
  },
  {
    "path": "Algorithm.Python/MeanReversionPortfolioAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.MeanReversionPortfolioConstructionModel import *\n\nclass MeanReversionPortfolioAlgorithm(QCAlgorithm):\n    '''Example algorithm of using MeanReversionPortfolioConstructionModel'''\n\n    def initialize(self):\n        # Set starting date, cash and ending date of the backtest\n        self.set_start_date(2020, 9, 1)\n        self.set_end_date(2021, 2, 28)\n        self.set_cash(100000)\n\n        self.set_security_initializer(lambda security: security.set_market_price(self.get_last_known_price(security)))\n        \n        # Subscribe to data of the selected stocks\n        self._symbols = [self.add_equity(ticker, Resolution.DAILY).symbol for ticker in [\"SPY\", \"AAPL\"]]\n\n        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(MeanReversionPortfolioConstructionModel())\n"
  },
  {
    "path": "Algorithm.Python/MeanVarianceOptimizationFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.MeanVarianceOptimizationPortfolioConstructionModel import *\n\n### <summary>\n### Mean Variance Optimization algorithm\n### Uses the HistoricalReturnsAlphaModel and the MeanVarianceOptimizationPortfolioConstructionModel\n### to create an algorithm that rebalances the portfolio according to modern portfolio theory\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass MeanVarianceOptimizationFrameworkAlgorithm(QCAlgorithm):\n    '''Mean Variance Optimization algorithm.'''\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.settings.rebalance_portfolio_on_insight_changes = False\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self._symbols = [ Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in [ 'AIG', 'BAC', 'IBM', 'SPY' ] ]\n\n        # set algorithm framework models\n        self.set_universe_selection(CoarseFundamentalUniverseSelectionModel(self.coarse_selector))\n        self.set_alpha(HistoricalReturnsAlphaModel(resolution = Resolution.DAILY))\n        self.set_portfolio_construction(MeanVarianceOptimizationPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n    def coarse_selector(self, coarse):\n        # Drops SPY after the 8th\n        last = 3 if self.time.day > 8 else len(self._symbols)\n\n        return self._symbols[0:last]\n\n    def on_order_event(self,  order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/MovingAverageCrossAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this example we look at the canonical 15/30 day moving average cross. This algorithm\n### will go long when the 15 crosses above the 30 and will liquidate when the 15 crosses\n### back below the 30.\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"moving average cross\" />\n### <meta name=\"tag\" content=\"strategy example\" />\nclass MovingAverageCrossAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2009, 1, 1)    #Set Start Date\n        self.set_end_date(2015, 1, 1)      #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n\n        # create a 15 day exponential moving average\n        self.fast = self.ema(\"SPY\", 15, Resolution.DAILY)\n\n        # create a 30 day exponential moving average\n        self.slow = self.ema(\"SPY\", 30, Resolution.DAILY)\n\n        self.previous = None\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        # a couple things to notice in this method:\n        #  1. We never need to 'update' our indicators with the data, the engine takes care of this for us\n        #  2. We can use indicators directly in math expressions\n        #  3. We can easily plot many indicators at the same time\n\n        # wait for our slow ema to fully initialize\n        if not self.slow.is_ready:\n            return\n\n        # only once per day\n        if self.previous is not None and self.previous.date() == self.time.date():\n            return\n\n        # define a small tolerance on our checks to avoid bouncing\n        tolerance = 0.00015\n\n        holdings = self.portfolio[\"SPY\"].quantity\n\n        # we only want to go long if we're currently short or flat\n        if holdings <= 0:\n            # if the fast is greater than the slow, we'll go long\n            if self.fast.current.value > self.slow.current.value *(1 + tolerance):\n                self.log(\"BUY  >> {0}\".format(self.securities[\"SPY\"].price))\n                self.set_holdings(\"SPY\", 1.0)\n\n        # we only want to liquidate if we're currently long\n        # if the fast is less than the slow we'll liquidate our long\n        if holdings > 0 and self.fast.current.value < self.slow.current.value:\n            self.log(\"SELL >> {0}\".format(self.securities[\"SPY\"].price))\n            self.liquidate(\"SPY\")\n\n        self.previous = self.time\n"
  },
  {
    "path": "Algorithm.Python/MultipleSymbolConsolidationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example structure for structuring an algorithm with indicator and consolidator data for many tickers.\n### </summary>\n### <meta name=\"tag\" content=\"consolidating data\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"strategy example\" />\nclass MultipleSymbolConsolidationAlgorithm(QCAlgorithm):\n\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self) -> None:\n        # This is the period of bars we'll be creating\n        bar_period = TimeSpan.from_minutes(10)\n        # This is the period of our sma indicators\n        sma_period = 10\n        # This is the number of consolidated bars we'll hold in symbol data for reference\n        rolling_window_size = 10\n        # Holds all of our data keyed by each symbol\n        self._data = {}\n        # Contains all of our equity symbols\n        equity_symbols = [\"AAPL\",\"SPY\",\"IBM\"]\n        # Contains all of our forex symbols\n        forex_symbols = [\"EURUSD\", \"USDJPY\", \"EURGBP\", \"EURCHF\", \"USDCAD\", \"USDCHF\", \"AUDUSD\",\"NZDUSD\"]\n\n        self.set_start_date(2014, 12, 1)\n        self.set_end_date(2015, 2, 1)\n\n        # initialize our equity data\n        for symbol in equity_symbols:\n            equity = self.add_equity(symbol)\n            self._data[symbol] = SymbolData(equity.symbol, bar_period, rolling_window_size)\n\n        # initialize our forex data\n        for symbol in forex_symbols:\n            forex = self.add_forex(symbol)\n            self._data[symbol] = SymbolData(forex.symbol, bar_period, rolling_window_size)\n\n        # loop through all our symbols and request data subscriptions and initialize indicator\n        for symbol, symbol_data in self._data.items():\n            # define the indicator\n            symbol_data.sma = SimpleMovingAverage(self.create_indicator_name(symbol, \"sma\" + str(sma_period), Resolution.MINUTE), sma_period)\n            # define a consolidator to consolidate data for this symbol on the requested period\n\n            if symbol_data._symbol.security_type == SecurityType.EQUITY:\n                tb_consolidator = TradeBarConsolidator(bar_period)\n                tb_consolidator.data_consolidated += self.on_trade_bar_consolidated\n                # we need to add this consolidator so it gets auto updates\n                self.subscription_manager.add_consolidator(symbol_data._symbol, tb_consolidator)\n            else:\n                qb_consolidator = QuoteBarConsolidator(bar_period)\n                qb_consolidator.data_consolidated += self.on_quote_bar_consolidated\n                # we need to add this consolidator so it gets auto updates\n                self.subscription_manager.add_consolidator(symbol_data._symbol, qb_consolidator)\n\n    def on_trade_bar_consolidated(self, sender: object, bar: TradeBar) -> None:\n        self._on_data_consolidated(sender, bar)\n\n    def on_quote_bar_consolidated(self, sender: object, bar: QuoteBar) -> None:\n        self._on_data_consolidated(sender, bar)\n\n    def _on_data_consolidated(self, sender: object, bar: TradeBar | QuoteBar) -> None:\n        self._data[bar.symbol.value].sma.update(bar.time, bar.close)\n        self._data[bar.symbol.value].bars.add(bar)\n\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    # Argument \"data\": Slice object, dictionary object with your stock data\n    def on_data(self, data: Slice) -> None:\n        # loop through each symbol in our structure\n        for symbol in self._data.keys():\n            symbol_data = self._data[symbol]\n            # this check proves that this symbol was JUST updated prior to this OnData function being called\n            if symbol_data.is_ready() and symbol_data.was_just_updated(self.time):\n                if not self.portfolio[symbol].invested:\n                    self.market_order(symbol, 1)\n\n    # End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n    # Method is called 10 minutes before closing to allow user to close out position.\n    def on_end_of_day(self, symbol: Symbol) -> None:\n        i = 0\n        for symbol_key in sorted(self._data.keys()):\n            symbol_data = self._data[symbol_key]\n            # we have too many symbols to plot them all, so plot every other\n            i += 1\n            if symbol_data.is_ready() and i%2 == 0:\n                self.plot(symbol_key, symbol_key, symbol_data.sma.current.value)\n\n\nclass SymbolData(object):\n\n    def __init__(self, symbol: Symbol, bar_period: timedelta, window_size: int) -> None:\n        self._symbol = symbol\n        # The period used when population the Bars rolling window\n        self.bar_period = bar_period\n        # A rolling window of data, data needs to be pumped into Bars by using Bars.update( trade_bar ) and can be accessed like:\n        # my_symbol_data.bars[0] - most first recent piece of data\n        # my_symbol_data.bars[5] - the sixth most recent piece of data (zero based indexing)\n        self.bars = RollingWindow(window_size)\n        # The simple moving average indicator for our symbol\n        self.sma = None\n\n    # Returns true if all the data in this instance is ready (indicators, rolling windows, ect...)\n    def is_ready(self) -> bool:\n        return self.bars.is_ready and self.sma.is_ready\n\n    # Returns true if the most recent trade bar time matches the current time minus the bar's period, this\n    # indicates that update was just called on this instance\n    def was_just_updated(self, current: datetime) -> bool:\n        return self.bars.count > 0 and self.bars[0].time == current - self.bar_period\n"
  },
  {
    "path": "Algorithm.Python/NLTKSentimentTradingAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport nltk\n# for details of NLTK, please visit https://www.nltk.org/index.html\n\nclass NLTKSentimentTradingAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2018, 1, 1)  # Set Start Date\n        self.set_end_date(2019, 1, 1) # Set End Date\n        self.set_cash(100000)  # Set Strategy Cash\n\n        spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.text = self.get_text() # Get custom text data for creating trading signals\n        self._symbols = [spy.symbol] # This can be extended to multiple symbols\n\n        # for what extra models needed to download, please use code nltk.download()\n        nltk.download('punkt')\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 30), self.trade)\n\n    def trade(self):\n        current_time = f'{self.time.year}-{self.time.month}-{self.time.day}'\n        current_text = self.text.loc[current_time][0]\n        words = nltk.word_tokenize(current_text)\n\n        # users should decide their own positive and negative words\n        positive_word = 'Up'\n        negative_word = 'Down'\n\n        for holding in self.portfolio.values():\n            # liquidate if it contains negative words\n            if negative_word in words and holding.invested:\n                self.liquidate(holding.symbol)\n\n            # buy if it contains positive words\n            if positive_word in words and not holding.invested:\n                self.set_holdings(holding.symbol, 1 / len(self._symbols))\n\n    def get_text(self):\n        # import custom data\n        # Note: dl must be 1, or it will not download automatically\n        url = 'https://www.dropbox.com/s/7xgvkypg6uxp6xl/EconomicNews.csv?dl=1'\n        data = self.download(url).split('\\n')\n\n        headline = [x.split(',')[1] for x in data][1:]\n        date = [x.split(',')[0] for x in data][1:]\n\n        # create a pd dataframe with 1st col being date and 2nd col being headline (content of the text)\n        df = pd.DataFrame(headline, index = date, columns = ['headline'])\n        return df\n"
  },
  {
    "path": "Algorithm.Python/NakedCallStrategyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Naked Call strategy.\n### </summary>\nclass NakedCallStrategyAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 2\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                           key = lambda x: x.expiry, reverse=True)\n\n        if len(contracts) == 0: return\n        contract = contracts[0]\n        if contract != None:\n            self._naked_call = OptionStrategies.naked_call(option_symbol, contract.strike, contract.expiry)\n            self.buy(self._naked_call, 2)\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 1:\n            raise AssertionError(f\"Expected position group to have 1 positions. Actual: {len(positions)}\")\n\n        option_position = [position for position in positions if position.symbol.security_type == SecurityType.OPTION][0]\n        if option_position.symbol.id.option_right != OptionRight.CALL:\n            raise AssertionError(f\"Expected option position to be a call. Actual: {option_position.symbol.id.option_right}\")\n\n        expected_option_position_quantity = -2\n\n        if option_position.quantity != expected_option_position_quantity:\n            raise AssertionError(f\"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # We can liquidate by selling the strategy\n        self.sell(self._naked_call, 2)\n"
  },
  {
    "path": "Algorithm.Python/NakedPutStrategyAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionStrategyFactoryMethodsBaseAlgorithm import *\n\n### <summary>\n### This algorithm demonstrate how to use OptionStrategies helper class to batch send orders for common strategies.\n### In this case, the algorithm tests the Naked Put strategy.\n### </summary>\nclass NakedPutStrategyAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):\n\n    def expected_orders_count(self) -> int:\n        return 2\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol):\n        contracts = sorted(sorted(chain, key = lambda x: abs(chain.underlying.price - x.strike)),\n                           key = lambda x: x.expiry, reverse=True)\n\n        if len(contracts) == 0: return\n        contract = contracts[0]\n        if contract != None:\n            self._naked_put = OptionStrategies.naked_put(option_symbol, contract.strike, contract.expiry)\n            self.buy(self._naked_put, 2)\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):\n        positions = list(position_group.positions)\n        if len(positions) != 1:\n            raise AssertionError(f\"Expected position group to have 1 positions. Actual: {len(positions)}\")\n\n        option_position = [position for position in positions if position.symbol.security_type == SecurityType.OPTION][0]\n        if option_position.symbol.id.option_right != OptionRight.PUT:\n            raise AssertionError(f\"Expected option position to be a put. Actual: {option_position.symbol.id.option_right}\")\n\n        expected_option_position_quantity = -2\n\n        if option_position.quantity != expected_option_position_quantity:\n            raise AssertionError(f\"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}\")\n\n    def liquidate_strategy(self):\n        # Now we can liquidate by selling the strategy\n        self.sell(self._naked_put, 2)\n"
  },
  {
    "path": "Algorithm.Python/NamedArgumentsRegression.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of requesting daily resolution data for US Equities.\n### This is a simple regression test algorithm using a skeleton algorithm and requesting daily data.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\nclass NamedArgumentsRegression(QCAlgorithm):\n    '''Regression algorithm that makes use of PythonNet kwargs'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        #Use named args for setting up our algorithm\n        self.set_start_date(month=10,day=8,year=2013)   #Set Start Date\n        self.set_end_date(month=10,day=17,year=2013)    #Set End Date\n        self.set_cash(starting_cash=100000)           #Set Strategy Cash\n\n        #Check our values\n        if self.start_date.year != 2013 or self.start_date.month != 10 or self.start_date.day != 8:\n            raise AssertionError(f\"Start date was incorrect! Expected 10/8/2013 Recieved {self.start_date}\")\n\n        if self.end_date.year != 2013 or self.end_date.month != 10 or self.end_date.day != 17:\n            raise AssertionError(f\"End date was incorrect! Expected 10/17/2013 Recieved {self.end_date}\")\n\n        if self.portfolio.cash != 100000:\n            raise AssertionError(f\"Portfolio cash was incorrect! Expected 100000 Recieved {self.portfolio.cash}\")\n\n        # Use named args for addition of this security to our algorithm\n        symbol = self.add_equity(resolution=Resolution.DAILY, ticker=\"SPY\").symbol\n\n        # Check our subscriptions for the symbol and check its resolution\n        for config in self.subscription_manager.subscription_data_config_service.get_subscription_data_configs(symbol):\n            if config.resolution != Resolution.DAILY:\n                raise AssertionError(f\"Resolution was not correct on security\")\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(symbol=\"SPY\", percentage=1)\n            self.debug(message=\"Purchased Stock\")\n"
  },
  {
    "path": "Algorithm.Python/NoUniverseSelectorRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Custom data universe selection regression algorithm asserting it's behavior. See GH issue #6396\n### </summary>\nclass NoUniverseSelectorRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 3, 31)\n\n        self.universe_settings.resolution = Resolution.DAILY\n        self.add_universe(CoarseFundamental)\n        self.changes = None\n\n    def on_data(self, data):\n        # if we have no changes, do nothing\n        if not self.changes: return\n\n        # liquidate removed securities\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        active_and_with_data_securities = sum(x.value.has_data for x in self.active_securities)\n        # we want 1/N allocation in each security in our universe\n        for security in self.changes.added_securities:\n            if security.has_data:\n                self.set_holdings(security.symbol, 1 / active_and_with_data_securities)\n        self.changes = None\n\n    def on_securities_changed(self, changes):\n        self.changes = changes\n"
  },
  {
    "path": "Algorithm.Python/NullBuyingPowerOptionBullCallSpreadAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Shows how setting to use the SecurityMarginModel.null (or BuyingPowerModel.NULL)\n### to disable the sufficient margin call verification.\n### See also: <see cref=\"OptionEquityBullCallSpreadRegressionAlgorithm\"/>\n### </summary>\n### <meta name=\"tag\" content=\"reality model\" />\nclass NullBuyingPowerOptionBullCallSpreadAlgorithm(QCAlgorithm):\n    def initialize(self):\n\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(200000)\n\n        self.set_security_initializer(lambda security: security.set_margin_model(SecurityMarginModel.NULL))\n        self.portfolio.set_positions(SecurityPositionGroupModel.NULL)\n\n        equity = self.add_equity(\"GOOG\")\n        option = self.add_option(equity.symbol)\n        self.option_symbol = option.symbol\n\n        option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))\n        \n    def on_data(self, slice):\n        if self.portfolio.invested or not self.is_market_open(self.option_symbol):\n            return\n       \n        chain = slice.option_chains.get(self.option_symbol)\n        if chain:\n            call_contracts = [x for x in chain if x.right == OptionRight.CALL]\n\n            expiry = min(x.expiry for x in call_contracts)\n\n            call_contracts = sorted([x for x in call_contracts if x.expiry == expiry],\n                key = lambda x: x.strike)\n\n            long_call = call_contracts[0]\n            short_call = [x for x in call_contracts if x.strike > long_call.strike][0]\n\n            quantity = 1000\n\n            tickets = [\n                self.market_order(short_call.symbol, -quantity),\n                self.market_order(long_call.symbol, quantity)\n            ]\n                \n            for ticket in tickets:\n                if ticket.status != OrderStatus.FILLED:\n                    raise AssertionError(f\"There should be no restriction on buying {ticket.quantity} of {ticket.symbol} with BuyingPowerModel.NULL\")\n\n\n    def on_end_of_algorithm(self) -> None:\n        if self.portfolio.total_margin_used != 0:\n            raise AssertionError(\"The TotalMarginUsed should be zero to avoid margin calls.\")\n"
  },
  {
    "path": "Algorithm.Python/NullMarginMultipleOrdersRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting the behavior of specifying a null position group allowing us to fill orders which would be invalid if not\n### </summary>\nclass NullMarginMultipleOrdersRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(10000)\n\n        # override security position group model\n        self.portfolio.set_positions(SecurityPositionGroupModel.NULL)\n        # override margin requirements\n        self.set_security_initializer(lambda security: security.set_buying_power_model(ConstantBuyingPowerModel(1)))\n\n        equity = self.add_equity(\"GOOG\", leverage=4, fill_forward=True)\n        option = self.add_option(equity.symbol, fill_forward=True)\n        self._option_symbol = option.symbol\n\n        option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))\n\n    def on_data(self, data: Slice):\n        if not self.portfolio.invested:\n            if self.is_market_open(self._option_symbol):\n                chain = data.option_chains.get(self._option_symbol)\n                if chain:\n                    call_contracts = [contract for contract in chain if contract.right == OptionRight.CALL]\n                    call_contracts.sort(key=lambda x: (x.expiry, 1/ x.strike), reverse=True)\n\n                    option_contract = call_contracts[0]\n                    self.market_order(option_contract.symbol.underlying, 1000)\n                    self.market_order(option_contract.symbol, -10)\n\n                    if self.portfolio.total_margin_used != 1010:\n                        raise ValueError(f\"Unexpected margin used {self.portfolio.total_margin_used}\")\n"
  },
  {
    "path": "Algorithm.Python/NullOptionAssignmentRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionAssignmentRegressionAlgorithm import *\n\n### <summary>\n### Regression algorithm assering we can disable automatic option assignment\n### </summary>\nclass NullOptionAssignmentRegressionAlgorithm(OptionAssignmentRegressionAlgorithm):\n    def initialize(self):\n        self.set_security_initializer(self.custom_security_initializer)\n        super().initialize()\n\n    def on_data(self, data):\n        super().on_data(data)\n\n    def custom_security_initializer(self, security):\n        if Extensions.is_option(security.symbol.security_type):\n            security.set_option_assignment_model(NullOptionAssignmentModel())\n"
  },
  {
    "path": "Algorithm.Python/NumeraiSignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm sends a list of current portfolio targets to Numerai API before each trading day\n### See (https://docs.numer.ai/numerai-signals/signals-overview) for more information\n### about accepted symbols, signals, etc.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"securities and portfolio\" />\nclass NumeraiSignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    _securities = []\n\n    def initialize(self) -> None:\n        ''' Initialize the date and add all equity symbols present in list _symbols '''\n\n        self.set_start_date(2020, 10, 7)   #Set Start Date\n        self.set_end_date(2020, 10, 12)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n\n        self.set_security_initializer(BrokerageModelSecurityInitializer(self.brokerage_model, FuncSecuritySeeder(self.get_last_known_prices)))\n\n        # Add the CRSP US Total Market Index constituents, which represents approximately 100% of the investable US Equity market\n        self.etf_symbol = self.add_equity(\"VTI\").symbol\n        self.add_universe(self.universe.etf(self.etf_symbol))\n\n        # Create a Scheduled Event to submit signals every trading day at 13:00 UTC\n        self.schedule.on(self.date_rules.every_day(self.etf_symbol), self.time_rules.at(13, 0, TimeZones.UTC), self.submit_signals)\n\n        # Set Numerai signal export provider\n        # Numerai Public ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n        # and created a API key. See (https://signals.numer.ai/account)\n        numerai_public_id = \"\"\n\n        # Numerai Secret ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n        # and created a API key. See (https://signals.numer.ai/account)\n        numerai_secret_id = \"\"\n\n        # Numerai Model ID: This value is provided by Numerai Signals in their main webpage once you've logged in\n        # and created a model. See (https://signals.numer.ai/models)\n        numerai_model_id = \"\"\n\n        numerai_filename = \"\" # (Optional) Replace this value with your submission filename \n\n        # Disable automatic exports as we manually set them\n        self.signal_export.automatic_export_time_span = None\n\n        # Set Numerai signal export provider\n        self.signal_export.add_signal_export_provider(NumeraiSignalExport(numerai_public_id, numerai_secret_id, numerai_model_id, numerai_filename))\n\n\n    def submit_signals(self) -> None:\n        # Select the subset of ETF constituents we can trade\n        symbols = sorted([security.symbol for security in self._securities if security.has_data])\n        if len(symbols) == 0:\n            return\n\n        # Get historical data\n        # close_prices = self.history(symbols, 22, Resolution.DAILY).close.unstack(0)\n        \n        # Create portfolio targets\n        #  Numerai requires that at least one of the signals have a unique weight\n        #  To ensure they are all unique, this demo gives a linear allocation to each symbol (ie. 1/55, 2/55, ..., 10/55)\n        denominator = len(symbols) * (len(symbols) + 1) / 2 # sum of 1, 2, ..., len(symbols)\n        targets = [PortfolioTarget(symbol, (i+1) / denominator) for i, symbol in enumerate(symbols)]\n\n        # (Optional) Place trades\n        self.set_holdings(targets)\n\n        # Send signals to Numerai\n        success = self.signal_export.set_target_portfolio(targets)\n        if not success:\n            self.debug(f\"Couldn't send targets at {self.time}\")\n\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        for security in changes.removed_securities:\n            if security in self._securities:\n                self._securities.remove(security)\n                \n        self._securities.extend([security for security in changes.added_securities if security.symbol != self.etf_symbol])\n"
  },
  {
    "path": "Algorithm.Python/ObjectStoreExampleAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom io import StringIO\n\nclass ObjectStoreExampleAlgorithm(QCAlgorithm):\n    '''This algorithm showcases some features of the IObjectStore feature.\n    One use case is to make consecutive backtests run faster by caching the results of\n    potentially time consuming operations. In this example, we save the results of a\n    history call. This pattern can be equally applied to a machine learning model being\n    trained and then saving the model weights in the object store.\n    '''\n    spy_close_object_store_key = \"spy_close\"\n    spy_close_history = RollingWindow(252)\n    spy_close_ema10_history = RollingWindow(252)\n    spy_close_ema50_history = RollingWindow(252)\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        self.SPY = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        self.spy_close = self.identity(self.SPY, Resolution.DAILY)\n        self.spy_close_ema10 = IndicatorExtensions.ema(self.spy_close, 10)\n        self.spy_close_ema50 = IndicatorExtensions.ema(self.spy_close, 50)\n\n        # track last year of close and EMA10/EMA50\n        self.spy_close.updated += lambda _, args: self.spy_close_history.add(args)\n        self.spy_close_ema10.updated += lambda _, args: self.spy_close_ema10_history.add(args)\n        self.spy_close_ema50.updated += lambda _, args: self.spy_close_ema50_history.add(args)\n\n        if self.object_store.contains_key(self.spy_close_object_store_key):\n            # our object store has our historical data saved, read the data\n            # and push it through the indicators to warm everything up\n            values = self.object_store.read(self.spy_close_object_store_key)\n            self.debug(f'{self.spy_close_object_store_key} key exists in object store.')\n\n            history = pd.read_csv(StringIO(values), header=None, index_col=0, squeeze=True)\n            history.index = pd.to_datetime(history.index)\n            for time, close in history.items():\n                self.spy_close.update(time, close)\n\n        else:\n            self.debug(f'{self.spy_close_object_store_key} key does not exist in object store. Fetching history...')\n\n            # if our object store doesn't have our data, fetch the history to initialize\n            # we're pulling the last year's worth of SPY daily trade bars to fee into our indicators\n            history = self.history(self.SPY, timedelta(365), Resolution.DAILY).close.unstack(0).squeeze()\n\n            for time, close in history.items():\n                self.spy_close.update(time, close)\n\n            # save our warm up data so next time we don't need to issue the history request\n            self.object_store.save(self.spy_close_object_store_key,\n                '\\n'.join(reversed([f'{x.end_time},{x.value}' for x in self.spy_close_history])))\n\n            # Can also use ObjectStore.save_bytes(key, byte[])\n            # and to read  ObjectStore.read_bytes(key) => byte[]\n\n            # we can also get a file path for our data. some ML libraries require model\n            # weights to be loaded directly from a file path. The object store can provide\n            # a file path for any key by: ObjectStore.get_file_path(key) => string (file path)\n\n    def on_data(self, slice):\n\n        close = self.spy_close\n        ema10 = self.spy_close_ema10\n        ema50 = self.spy_close_ema50\n\n        if ema10 > close and ema10 > ema50:\n            self.set_holdings(self.SPY, 1)\n\n        elif ema10 < close and ema10 < ema50:\n            self.set_holdings(self.SPY, -1)\n\n        elif ema10 < ema50 and self.portfolio[self.SPY].is_long:\n            self.liquidate(self.SPY)\n\n        elif ema10 > ema50 and self.portfolio[self.SPY].is_short:\n            self.liquidate(self.SPY)\n"
  },
  {
    "path": "Algorithm.Python/OnEndOfDayRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0.  Copyright 2014 QuantConnect\n# Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass OnEndOfDayRegressionAlgorithm(QCAlgorithm):\n    '''Test algorithm verifying OnEndOfDay callbacks are called as expected. See GH issue 2865.'''\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self._spy_symbol = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        self._bac_symbol = Symbol.create(\"BAC\", SecurityType.EQUITY, Market.USA)\n        self._ibm_symbol = Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA)\n        self._on_end_of_day_spy_call_count = 0\n        self._on_end_of_day_bac_call_count = 0\n        self._on_end_of_day_ibm_call_count = 0\n\n        self.add_universe('my_universe_name', self.selection)\n\n    def selection(self, time):\n        if time.day == 8:\n            return [self._spy_symbol.value, self._ibm_symbol.value]\n        return [self._spy_symbol.value]\n\n    def on_end_of_day(self, symbol):\n        '''We expect it to be called on each day after the first selection process\n        happens and the algorithm has a security in it\n        '''\n        if symbol == self._spy_symbol:\n            if self._on_end_of_day_spy_call_count == 0:\n                # just the first time\n                self.set_holdings(self._spy_symbol, 0.5)\n                self.add_equity(\"BAC\")\n            self._on_end_of_day_spy_call_count += 1\n        if symbol == self._bac_symbol:\n            if self._on_end_of_day_bac_call_count == 0:\n                # just the first time\n                self.set_holdings(self._bac_symbol, 0.5)\n            self._on_end_of_day_bac_call_count += 1\n        if symbol == self._ibm_symbol:\n            self._on_end_of_day_ibm_call_count += 1\n\n        self.log(\"OnEndOfDay() called: \" + str(self.utc_time)\n                + \". SPY count \" + str(self._on_end_of_day_spy_call_count)\n                + \". BAC count \" + str(self._on_end_of_day_bac_call_count)\n                + \". IBM count \" + str(self._on_end_of_day_ibm_call_count))\n\n    def on_end_of_algorithm(self):\n        '''Assert expected behavior'''\n        if self._on_end_of_day_spy_call_count != 5:\n            raise ValueError(\"OnEndOfDay(SPY) unexpected count call \" + str(self._on_end_of_day_spy_call_count))\n        if self._on_end_of_day_bac_call_count != 4:\n            raise ValueError(\"OnEndOfDay(BAC) unexpected count call \" + str(self._on_end_of_day_bac_call_count))\n        if self._on_end_of_day_ibm_call_count != 1:\n            raise ValueError(\"OnEndOfDay(IBM) unexpected count call \" + str(self._on_end_of_day_ibm_call_count))\n"
  },
  {
    "path": "Algorithm.Python/OnWarmupFinishedNoWarmup.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n###  Regression algorithm asserting \"OnWarmupFinished\" is called even if no warmup period is set\n### </summary>\nclass OnWarmupFinishedNoWarmup(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self._on_warmup_finished = 0\n\n    def on_warmup_finished(self):\n        self._on_warmup_finished += 1\n\n    def on_end_of_algorithm(self):\n        if self._on_warmup_finished != 1:\n            raise AssertionError(f\"Unexpected OnWarmupFinished call count {self._on_warmup_finished}\")\n"
  },
  {
    "path": "Algorithm.Python/OnWarmupFinishedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting 'OnWarmupFinished' is being called\n### </summary>\nclass OnWarmupFinishedRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 8)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.set_warmup(timedelta(days = 1))\n        self._on_warmup_finished = 0\n    \n    def on_warmup_finished(self):\n        self._on_warmup_finished += 1\n    \n    def on_end_of_algorithm(self):\n        if self._on_warmup_finished != 1:\n            raise AssertionError(f\"Unexpected OnWarmupFinished call count {self._on_warmup_finished}\")\n"
  },
  {
    "path": "Algorithm.Python/OpenInterestFuturesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Futures framework algorithm that uses open interest to select the active contract.\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"futures\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass OpenInterestFuturesRegressionAlgorithm(QCAlgorithm):\n\n    expected_expiry_dates = {datetime(2013, 12, 27), datetime(2014,2,26)}\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.TICK\n        self.set_start_date(2013,10,8)\n        self.set_end_date(2013,10,11)\n        self.set_cash(10000000)\n\n        # set framework models\n        universe = OpenInterestFutureUniverseSelectionModel(self, lambda date_time: [Symbol.create(Futures.Metals.GOLD, SecurityType.FUTURE, Market.COMEX)], None, len(self.expected_expiry_dates))\n        self.set_universe_selection(universe)\n\n    def on_data(self,data):\n        if self.transactions.orders_count == 0 and data.has_data:\n            matched = list(filter(lambda s: not (s.id.date in self.expected_expiry_dates) and not s.is_canonical(), data.keys()))\n            if len(matched) != 0:\n                raise AssertionError(f\"{len(matched)}/{len(data.keys())} were unexpected expiry date(s): \" + \", \".join(list(map(lambda x: x.id.date, matched))))\n\n            for symbol in data.keys():\n                self.market_order(symbol, 1)\n        elif any(p.value.invested for p in self.portfolio):\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/OptionAssignmentRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm verifies automatic option contract assignment behavior.\n### </summary>\nclass OptionAssignmentRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 23)\n        self.set_end_date(2015, 12, 28)\n        self.set_cash(100000)\n        self.stock = self.add_equity(\"GOOG\", Resolution.MINUTE)\n\n        contracts = list(self.option_chain(self.stock.symbol))\n\n        self.put_option_symbol = sorted(\n            [c for c in contracts if c.id.option_right == OptionRight.PUT and c.id.strike_price == 800],\n            key=lambda c: c.id.date\n        )[0]\n\n        self.call_option_symbol = sorted(\n            [c for c in contracts if c.id.option_right == OptionRight.CALL and c.id.strike_price == 600],\n            key=lambda c: c.id.date\n        )[0]\n\n        self.put_option = self.add_option_contract(self.put_option_symbol)\n        self.call_option = self.add_option_contract(self.call_option_symbol)\n\n    def on_data(self, data):\n        if not self.portfolio.invested and self.stock.price != 0 and self.put_option.price != 0 and self.call_option.price != 0:\n            #this gets executed on start and after each auto-assignment, finally ending with expiration assignment\n            if self.time < self.put_option_symbol.id.date:\n                self.market_order(self.put_option_symbol, -1)\n\n            if self.time < self.call_option_symbol.id.date:\n                self.market_order(self.call_option_symbol, -1)\n"
  },
  {
    "path": "Algorithm.Python/OptionChainApisConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import datetime\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting that the option chain APIs return consistent values.\n### See QCAlgorithm.OptionChain(Symbol) and QCAlgorithm.OptionChainProvider\n### </summary>\nclass OptionChainApisConsistencyRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        test_date = self.get_test_date()\n\n        self.set_start_date(test_date)\n        self.set_end_date(test_date)\n\n        option = self.get_option()\n\n        option_chain_from_algorithm_api = self.option_chain(option.symbol).contracts.keys()\n\n        exchange_time = Extensions.convert_from_utc(self.utc_time, option.exchange.time_zone)\n        option_chain_from_provider_api = list(sorted(self.option_chain_provider.get_option_contract_list(option.symbol, exchange_time)))\n\n        if len(option_chain_from_algorithm_api) == 0:\n            raise AssertionError(\"No options in chain from algorithm API\")\n\n        if len(option_chain_from_provider_api) == 0:\n            raise AssertionError(\"No options in chain from provider API\")\n\n        if len(option_chain_from_algorithm_api) != len(option_chain_from_provider_api):\n            raise AssertionError(f\"Expected {len(option_chain_from_provider_api)} options in chain from provider API, \"\n                                 f\"but got {len(option_chain_from_algorithm_api)}\")\n\n        for i in range(len(option_chain_from_algorithm_api)):\n            symbol1 = option_chain_from_algorithm_api[i]\n            symbol2 = option_chain_from_provider_api[i]\n\n            if symbol1 != symbol2:\n                raise AssertionError(f\"Expected {symbol2} in chain from provider API, but got {symbol1}\")\n\n    def get_test_date(self) -> datetime:\n        return datetime(2015, 12, 25)\n\n    def get_option(self) -> Option:\n        return self.add_option(\"GOOG\")\n"
  },
  {
    "path": "Algorithm.Python/OptionChainConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm checks if all the option chain data coming to the algo is consistent with current securities manager state\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"filter selection\" />\nclass OptionChainConsistencyRegressionAlgorithm(QCAlgorithm):\n\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self):\n\n        self.set_cash(10000)\n        self.set_start_date(2015,12,24)\n        self.set_end_date(2015,12,24)\n\n        self.equity = self.add_equity(self.underlying_ticker)\n        self.option = self.add_option(self.underlying_ticker)\n\n        # set our strike/expiry filter for this option chain\n        self.option.set_filter(self.universe_func)\n\n        self.set_benchmark(self.equity.symbol)\n\n    def on_data(self, slice):\n        if self.portfolio.invested: return\n        for kvp in slice.option_chains:\n            chain = kvp.value\n            for o in chain:\n                if not self.securities.contains_key(o.symbol):\n                    self.log(\"Inconsistency found: option chains contains contract {0} that is not available in securities manager and not available for trading\".format(o.symbol.value))           \n\n            contracts = filter(lambda x: x.expiry.date() == self.time.date() and\n                                         x.strike < chain.underlying.price and\n                                         x.right == OptionRight.CALL, chain)\n\n            sorted_contracts = sorted(contracts, key = lambda x: x.strike, reverse = True)\n\n            if len(sorted_contracts) > 2:\n                self.market_order(sorted_contracts[2].symbol, 1)\n                self.market_on_close_order(sorted_contracts[2].symbol, -1)\n\n    # set our strike/expiry filter for this option chain\n    def universe_func(self, universe):\n        return universe.include_weeklys().strikes(-2, 2).expiration(timedelta(0), timedelta(10))\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/OptionChainFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom datetime import timedelta\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChain(Symbol)\"/> method\n### to get an option chain, which contains additional data besides the symbols, including prices, implied volatility and greeks.\n### It also shows how this data can be used to filter the contracts based on certain criteria.\n### </summary>\nclass OptionChainFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        goog = self.add_equity(\"GOOG\").symbol\n\n        option_chain = self.option_chain(goog, flatten=True)\n\n        # Demonstration using data frame:\n        df = option_chain.data_frame\n        # Get contracts expiring within 10 days, with an implied volatility greater than 0.5 and a delta less than 0.5\n        contracts = df.loc[(df.expiry <= self.time + timedelta(days=10)) & (df.impliedvolatility > 0.5) & (df.delta < 0.5)]\n\n        # Get the contract with the latest expiration date.\n        # Note: the result of df.loc[] is a series, and its name is a tuple with a single element (contract symbol)\n        self._option_contract = contracts.loc[contracts.expiry.idxmax()].name\n\n        self.add_option_contract(self._option_contract)\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.market_order(self._option_contract, 1)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/OptionChainIncludeWeeklysByDefaultRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Verifies that weekly option contracts are included when no standard contracts are available.\n### </summary>\nclass OptionChainIncludeWeeklysByDefaultRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n\n        self.option = self.add_option(\"GOOG\")\n        self.option_symbol = self.option.Symbol\n\n        self.option.set_filter(lambda u: u.strikes(-8, 8).expiration(0, 0))\n\n        self.weekly_count = 0\n        self.total_count = 0\n\n    def on_data(self, data):\n        chain = data.option_chains.get(self.option_symbol)\n        if chain:\n            self.total_count += len(chain.contracts)\n            for contract in chain.contracts.values():\n                if not OptionSymbol.is_standard(contract.symbol):\n                    self.weekly_count += 1\n    \n    def on_end_of_algorithm(self):\n        if self.weekly_count == 0:\n            raise RegressionTestException(\"No weekly contracts found\")\n        \n        if self.total_count != self.weekly_count:\n            raise RegressionTestException(\"When no standard option expirations are available, the option chain must fall back to weekly contracts only\")"
  },
  {
    "path": "Algorithm.Python/OptionChainProviderAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of the Option Chain Provider -- a much faster mechanism for manually specifying the option contracts you'd like to recieve\n### data for and manually subscribing to them.\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"selecting options\" />\n### <meta name=\"tag\" content=\"manual selection\" />\n\nclass OptionChainProviderAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n        # add the underlying asset\n        self.equity = self.add_equity(\"GOOG\", Resolution.MINUTE)\n        self.equity.set_data_normalization_mode(DataNormalizationMode.RAW)\n        # initialize the option contract with empty string\n        self.contract = str()\n        self.contracts_added = set()\n\n    def on_data(self, data):\n\n        if not self.portfolio[self.equity.symbol].invested:\n            self.market_order(self.equity.symbol, 100)\n\n        if not (self.securities.contains_key(self.contract) and self.portfolio[self.contract].invested):\n            self.contract = self.options_filter(data)\n\n        if self.securities.contains_key(self.contract) and not self.portfolio[self.contract].invested:\n            self.market_order(self.contract, -1)\n\n    def options_filter(self, data):\n        ''' OptionChainProvider gets a list of option contracts for an underlying symbol at requested date.\n            Then you can manually filter the contract list returned by GetOptionContractList.\n            The manual filtering will be limited to the information included in the Symbol\n            (strike, expiration, type, style) and/or prices from a History call '''\n\n        contracts = self.option_chain_provider.get_option_contract_list(self.equity.symbol, data.time)\n        self.underlying_price = self.securities[self.equity.symbol].price\n        # filter the out-of-money call options from the contract list which expire in 10 to 30 days from now on\n        otm_calls = [i for i in contracts if i.id.option_right == OptionRight.CALL and\n                                            i.id.strike_price - self.underlying_price > 0 and\n                                            10 < (i.id.date - data.time).days < 30]\n        if len(otm_calls) > 0:\n            contract = sorted(sorted(otm_calls, key = lambda x: x.id.date),\n                                                     key = lambda x: x.id.strike_price - self.underlying_price)[0]\n            if contract not in self.contracts_added:\n                self.contracts_added.add(contract)\n                # use AddOptionContract() to subscribe the data for specified contract\n                self.add_option_contract(contract, Resolution.MINUTE)\n            return contract\n        else:\n            return str()\n"
  },
  {
    "path": "Algorithm.Python/OptionChainedUniverseSelectionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test the OptionChainedUniverseSelectionModel class\n### </summary>\nclass OptionChainedUniverseSelectionModelRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.MINUTE\n        self.set_start_date(2014, 6, 6)\n        self.set_end_date(2014, 6, 6)\n        self.set_cash(100000)\n\n        universe = self.add_universe(\"my-minute-universe-name\", lambda time: [ \"AAPL\", \"TWX\" ])\n        self.add_universe_selection(\n            OptionChainedUniverseSelectionModel(\n                universe,\n                lambda u: (u.standards_only().strikes(-2, +2)\n                                     # Expiration method accepts TimeSpan objects or integer for days.\n                                     # The following statements yield the same filtering criteria\n                                     .expiration(0, 180))\n            )\n        )\n\n    def on_data(self, slice):\n        if self.portfolio.invested or not (self.is_market_open(\"AAPL\") and self.is_market_open(\"TWX\")): return\n        values = list(map(lambda x: x.value, filter(lambda x: x.key == \"?AAPL\" or x.key == \"?TWX\",  slice.option_chains)))\n        for chain in values:\n            # we sort the contracts to find at the money (ATM) contract with farthest expiration\n            contracts = sorted(sorted(sorted(chain, \\\n                key = lambda x: abs(chain.underlying.price - x.strike)), \\\n                key = lambda x: x.expiry, reverse=True), \\\n                key = lambda x: x.right, reverse=True)\n\n            # if found, trade it\n            if len(contracts) == 0: return\n            symbol = contracts[0].symbol\n            self.market_order(symbol, 1)\n            self.market_on_close_order(symbol, -1)\n"
  },
  {
    "path": "Algorithm.Python/OptionChainsMultipleFullDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom datetime import timedelta\n\n### <summary>\n### Regression algorithm illustrating the usage of the <see cref=\"QCAlgorithm.OptionChains(IEnumerable{Symbol})\"/> method\n### to get multiple option chains, which contains additional data besides the symbols, including prices, implied volatility and greeks.\n### It also shows how this data can be used to filter the contracts based on certain criteria.\n### </summary>\nclass OptionChainsMultipleFullDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        goog = self.add_equity(\"GOOG\").symbol\n        spx = self.add_index(\"SPX\").symbol\n\n        chains = self.option_chains([goog, spx], flatten=True)\n\n        self._goog_option_contract = self.get_contract(chains, goog, timedelta(days=10))\n        self._spx_option_contract = self.get_contract(chains, spx, timedelta(days=60))\n\n        self.add_option_contract(self._goog_option_contract)\n        self.add_index_option_contract(self._spx_option_contract)\n\n    def get_contract(self, chains: OptionChains, underlying: Symbol, expiry_span: timedelta) -> Symbol:\n        df = chains.data_frame\n\n        # Index by the requested underlying, by getting all data with canonicals which underlying is the requested underlying symbol:\n        canonicals = df.index.get_level_values('canonical')\n        condition = [canonical for canonical in canonicals if canonical.underlying == underlying]\n        df = df.loc[condition]\n\n        # Get contracts expiring in the next 10 days with an implied volatility greater than 0.5 and a delta less than 0.5\n        contracts = df.loc[(df.expiry <= self.time + expiry_span) & (df.impliedvolatility > 0.5) & (df.delta < 0.5)]\n\n        # Select the contract with the latest expiry date\n        contracts.sort_values(by='expiry', ascending=False, inplace=True)\n\n        # Get the symbol: the resulting series name is a tuple (canonical symbol, contract symbol)\n        return contracts.iloc[0].name[1]\n\n    def on_data(self, data):\n        # Do some trading with the selected contract for sample purposes\n        if not self.portfolio.invested:\n            self.market_order(self._goog_option_contract, 1)\n        else:\n            self.liquidate()\n"
  },
  {
    "path": "Algorithm.Python/OptionDataNullReferenceRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm is a regression test for issue #2018 and PR #2038.\n### </summary>\nclass OptionDataNullReferenceRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2016, 12, 1)\n        self.set_end_date(2017, 1, 1)\n        self.set_cash(500000)\n\n        self.add_equity(\"DUST\")\n\n        option = self.add_option(\"DUST\")\n\n        option.set_filter(self.universe_func)\n\n    def universe_func(self, universe):\n        return universe.include_weeklys().strikes(-1, +1).expiration(timedelta(25), timedelta(100))\n"
  },
  {
    "path": "Algorithm.Python/OptionExerciseAssignRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests option exercise and assignment functionality\n### We open two positions and go with them into expiration. We expect to see our long position exercised and short position assigned.\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"options\" />\nclass OptionExerciseAssignRegressionAlgorithm(QCAlgorithm):\n\n    underlying_ticker = \"GOOG\"\n\n    def initialize(self):\n        self.set_cash(100000)\n        self.set_start_date(2015,12,24)\n        self.set_end_date(2015,12,28)\n\n        self.equity = self.add_equity(self.underlying_ticker)\n        self.option = self.add_option(self.underlying_ticker)\n\n        # set our strike/expiry filter for this option chain\n        self.option.set_filter(self.universe_func)\n\n        self.set_benchmark(self.equity.symbol)\n        self._assigned_option = False\n\n    def on_data(self, slice):\n        if self.portfolio.invested: return\n        for kvp in slice.option_chains:\n            chain = kvp.value\n            # find the call options expiring today\n            contracts = filter(lambda x:\n                               x.expiry.date() == self.time.date() and\n                               x.strike < chain.underlying.price and\n                               x.right == OptionRight.CALL, chain)\n            \n            # sorted the contracts by their strikes, find the second strike under market price \n            sorted_contracts = sorted(contracts, key = lambda x: x.strike, reverse = True)[:2]\n\n            if sorted_contracts:\n                self.market_order(sorted_contracts[0].symbol, 1)\n                self.market_order(sorted_contracts[1].symbol, -1)\n\n    # set our strike/expiry filter for this option chain\n    def universe_func(self, universe):\n        return universe.include_weeklys().strikes(-2, 2).expiration(timedelta(0), timedelta(10))\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n\n    def on_assignment_order_event(self, assignment_event):\n        self.log(str(assignment_event))\n        self._assigned_option = True\n"
  },
  {
    "path": "Algorithm.Python/OptionIndicatorsMirrorContractsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom scipy.optimize import brentq\n\nclass OptionIndicatorsMirrorContractsRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 9)\n        self.set_cash(100000)\n\n        equity = self.add_equity(\"AAPL\", Resolution.DAILY).symbol\n        option = Symbol.create_option(\"AAPL\", Market.USA, OptionStyle.AMERICAN, OptionRight.PUT, 650, datetime(2014, 6, 21))\n        self.add_option_contract(option, Resolution.DAILY)\n        # add the call counter side of the mirrored pair\n        mirror_option = Symbol.create_option(\"AAPL\", Market.USA, OptionStyle.AMERICAN, OptionRight.CALL, 650, datetime(2014, 6, 21))\n        self.add_option_contract(mirror_option, Resolution.DAILY)\n\n        self._delta = self.d(option, mirror_option, option_model = OptionPricingModelType.BINOMIAL_COX_ROSS_RUBINSTEIN, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self._gamma = self.g(option, mirror_option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self._vega = self.v(option, mirror_option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self._theta = self.t(option, mirror_option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self._rho = self.r(option, mirror_option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n\n        # A custom IV indicator with custom calculation of IV\n        risk_free_rate_model = InterestRateProvider()\n        dividend_yield_model = DividendYieldProvider(equity)\n        self._implied_volatility = CustomImpliedVolatility(option, mirror_option, risk_free_rate_model, dividend_yield_model)\n        self.register_indicator(option, self._implied_volatility, QuoteBarConsolidator(timedelta(1)))\n        self.register_indicator(mirror_option, self._implied_volatility, QuoteBarConsolidator(timedelta(1)))\n        self.register_indicator(equity, self._implied_volatility, TradeBarConsolidator(timedelta(1)))\n\n        # custom IV smoothing function: assume the lower IV is more \"fair\"\n        smoothing_func = lambda iv, mirror_iv: min(iv, mirror_iv)\n        # set the smoothing function\n        self._delta.implied_volatility.set_smoothing_function(smoothing_func)\n        self._gamma.implied_volatility.set_smoothing_function(smoothing_func)\n        self._vega.implied_volatility.set_smoothing_function(smoothing_func)\n        self._theta.implied_volatility.set_smoothing_function(smoothing_func)\n        self._rho.implied_volatility.set_smoothing_function(smoothing_func)\n\n    def on_end_of_algorithm(self) -> None:\n        if not self._implied_volatility.is_ready or not self._delta.is_ready or not self._gamma.is_ready \\\n        or not self._vega.is_ready or not self._theta.is_ready or not self._rho.is_ready:\n            raise AssertionError(\"Expected IV/greeks calculated\")\n\n        self.debug(f\"\"\"Implied Volatility: {self._implied_volatility.current.value},\nDelta: {self._delta.current.value},\nGamma: {self._gamma.current.value},\nVega: {self._vega.current.value},\nTheta: {self._theta.current.value},\nRho: {self._rho.current.value}\"\"\")\n\nclass CustomImpliedVolatility(ImpliedVolatility):\n    def __init__(self, option, mirror_option, risk_free_rate_model, dividend_yield_model):\n        super().__init__(option, risk_free_rate_model, dividend_yield_model, mirror_option)\n        self.set_smoothing_function(lambda iv, mirror_iv: iv)\n\n    def calculate_iv(self, time_till_expiry: float) -> float:\n        try:\n            return brentq(self.f, 1e-7, 2.0, args=(time_till_expiry), xtol=1e-4, maxiter=100)\n        except:\n            print(\"ImpliedVolatility.calculate_i_v(): Fail to converge, returning 0.\")\n            return 0.0\n\n    # we demonstate put-call parity calculation here, but note that it is not suitable for American options\n    def f(self, vol: float, time_till_expiry: float) -> float:\n        call_black_price = OptionGreekIndicatorsHelper.black_theoretical_price(\n            vol, self.underlying_price.current.value, self.strike, time_till_expiry, self.risk_free_rate.current.value, self.dividend_yield.current.value, OptionRight.CALL)\n        put_black_price = OptionGreekIndicatorsHelper.black_theoretical_price(\n            vol, self.underlying_price.current.value, self.strike, time_till_expiry, self.risk_free_rate.current.value, self.dividend_yield.current.value, OptionRight.PUT)\n        return self.price.current.value + self.opposite_price.current.value - call_black_price - put_black_price\n"
  },
  {
    "path": "Algorithm.Python/OptionIndicatorsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass OptionIndicatorsRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 5)\n        self.set_end_date(2014, 6, 7)\n        self.set_cash(100000)\n\n        self.add_equity(\"AAPL\", Resolution.MINUTE)\n        option = Symbol.create_option(\"AAPL\", Market.USA, OptionStyle.AMERICAN, OptionRight.PUT, 505, datetime(2014, 6, 27))\n        self.add_option_contract(option, Resolution.MINUTE)\n\n        self.implied_volatility = self.iv(option, option_model = OptionPricingModelType.BLACK_SCHOLES)\n        self.delta = self.d(option, option_model = OptionPricingModelType.BINOMIAL_COX_ROSS_RUBINSTEIN, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self.gamma = self.g(option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self.vega = self.v(option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self.theta = self.t(option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n        self.rho = self.r(option, option_model = OptionPricingModelType.FORWARD_TREE, iv_model = OptionPricingModelType.BLACK_SCHOLES)\n\n    def on_end_of_algorithm(self):\n        if self.implied_volatility.current.value == 0 or self.delta.current.value == 0 or self.gamma.current.value == 0 \\\n        or self.vega.current.value == 0 or self.theta.current.value == 0 or self.rho.current.value == 0:\n            raise AssertionError(\"Expected IV/greeks calculated\")\n\n        self.debug(f\"\"\"Implied Volatility: {self.implied_volatility.current.value},\nDelta: {self.delta.current.value},\nGamma: {self.gamma.current.value},\nVega: {self.vega.current.value},\nTheta: {self.theta.current.value},\nRho: {self.rho.current.value}\"\"\")\n"
  },
  {
    "path": "Algorithm.Python/OptionModelsConsistencyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm asserting that when setting custom models for canonical securities, a one-time warning is sent\n### informing the user that the contracts models are different (not the custom ones).\n### </summary>\nclass OptionModelsConsistencyRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        security = self.initialize_algorithm()\n        self.set_models(security)\n\n        # Using a custom security initializer derived from BrokerageModelSecurityInitializer\n        # to check that the models are correctly set in the security even when the\n        # security initializer is derived from said class in Python\n        self.set_security_initializer(CustomSecurityInitializer(self.brokerage_model, SecuritySeeder.NULL))\n\n        self.set_benchmark(lambda x: 0)\n\n    def initialize_algorithm(self) -> Security:\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n\n        equity = self.add_equity(\"GOOG\", leverage=4)\n        option = self.add_option(equity.symbol)\n        option.set_filter(lambda u: u.strikes(-2, +2).expiration(0, 180))\n\n        return option\n\n    def set_models(self, security: Security) -> None:\n        security.set_fill_model(CustomFillModel())\n        security.set_fee_model(CustomFeeModel())\n        security.set_buying_power_model(CustomBuyingPowerModel())\n        security.set_slippage_model(CustomSlippageModel())\n        security.set_volatility_model(CustomVolatilityModel())\n\nclass CustomSecurityInitializer(BrokerageModelSecurityInitializer):\n    def __init__(self, brokerage_model: IBrokerageModel, security_seeder: ISecuritySeeder):\n        super().__init__(brokerage_model, security_seeder)\n\nclass CustomFillModel(FillModel):\n    pass\n\nclass CustomFeeModel(FeeModel):\n    pass\n\nclass CustomBuyingPowerModel(BuyingPowerModel):\n    pass\n\nclass CustomSlippageModel(ConstantSlippageModel):\n    def __init__(self):\n        super().__init__(0)\n\nclass CustomVolatilityModel(BaseVolatilityModel):\n    pass\n"
  },
  {
    "path": "Algorithm.Python/OptionOpenInterestRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Options Open Interest data regression test.\n### </summary>\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass OptionOpenInterestRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_cash(1000000)\n        self.set_start_date(2014,6,5)\n        self.set_end_date(2014,6,6)\n\n        option = self.add_option(\"TWX\")\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(-10, 10, timedelta(0), timedelta(365*2))\n\n        # use the underlying equity as the benchmark\n        self.set_benchmark(\"TWX\")\n\n    def on_data(self, slice):\n        if not self.portfolio.invested:\n            for chain in slice.option_chains:\n                for contract in chain.value:\n                    if float(contract.symbol.id.strike_price) == 72.5 and \\\n                       contract.symbol.id.option_right == OptionRight.CALL and \\\n                       contract.symbol.id.date == datetime(2016, 1, 15):\n\n                        history = self.history(OpenInterest, contract.symbol, timedelta(1))[\"openinterest\"]\n                        if len(history.index) == 0 or 0 in history.values:\n                            raise ValueError(\"Regression test failed: open interest history request is empty\")\n\n                        security = self.securities[contract.symbol]\n                        open_interest_cache = security.cache.get_data(OpenInterest)\n                        if open_interest_cache == None:\n                            raise ValueError(\"Regression test failed: current open interest isn't in the security cache\")\n                        if slice.time.date() == datetime(2014, 6, 5).date() and (contract.open_interest != 50 or security.open_interest != 50):\n                            raise ValueError(\"Regression test failed: current open interest was not correctly loaded and is not equal to 50\")\n                        if slice.time.date() == datetime(2014, 6, 6).date() and (contract.open_interest != 70 or security.open_interest != 70):\n                            raise ValueError(\"Regression test failed: current open interest was not correctly loaded and is not equal to 70\")\n                        if slice.time.date() == datetime(2014, 6, 6).date():\n                            self.market_order(contract.symbol, 1)\n                            self.market_on_close_order(contract.symbol, -1)\n\n                if all(contract.open_interest == 0 for contract in chain.value):\n                    raise ValueError(\"Regression test failed: open interest is zero for all contracts\")\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Base regression algorithm exercising different style options with option price models that might\n### or might not support them. Also, if the option style is supported, greeks are asserted to be accesible and have valid values.\n### </summary>\nclass OptionPriceModelForOptionStylesBaseRegressionAlgorithm(QCAlgorithm):\n    def __init__(self) -> None:\n        super().__init__()\n        self._option_style_is_supported = False\n        self._check_greeks = True\n        self._tried_greeks_calculation = False\n        self._option = None\n\n    def on_data(self, slice: Slice) -> None:\n        if self.is_warming_up:\n            return\n\n        for kvp in slice.option_chains:\n            if not self._option or kvp.key != self._option.symbol:\n                continue\n\n            self.check_greeks([contract for contract in kvp.value])\n\n    def on_end_of_day(self, symbol: Symbol) -> None:\n        self._check_greeks = True\n\n    def on_end_of_algorithm(self) -> None:\n        if not self._tried_greeks_calculation:\n            raise AssertionError(\"Expected greeks to be accessed\")\n\n    def init(self, option: Option, option_style_is_supported: bool) -> None:\n        self._option = option\n        self._option_style_is_supported = option_style_is_supported\n        self._check_greeks = True\n        self._tried_greeks_calculation = False\n\n    def check_greeks(self, contracts: list[OptionContract]) -> None:\n        if not self._check_greeks or len(contracts) == 0 or not self._option:\n            return\n\n        self._check_greeks = False\n        self._tried_greeks_calculation = True\n\n        for contract in contracts:\n            greeks = None\n            try:\n                greeks = contract.greeks\n\n                # Greeks should have not been successfully accessed if the option style is not supported\n                option_style_str = 'American' if self._option.style == OptionStyle.AMERICAN else 'European'\n                if not self._option_style_is_supported:\n                    raise AssertionError(f'Expected greeks not to be calculated for {contract.symbol.value}, an {option_style_str} style option, using {type(self._option.price_model).__name__}, which does not support them, but they were')\n            except ArgumentException:\n                # ArgumentException is only expected if the option style is not supported\n                if self._option_style_is_supported:\n                    raise AssertionError(f'Expected greeks to be calculated for {contract.symbol.value}, an {option_style_str} style option, using {type(self._option.price_model).__name__}, which supports them, but they were not')\n\n            # Greeks should be valid if they were successfuly accessed for supported option style\n            # Delta can be {-1, 0, 1} if the price is too wild, rho can be 0 if risk free rate is 0\n            # Vega can be 0 if the price is very off from theoretical price, Gamma = 0 if Delta belongs to {-1, 1}\n            if (self._option_style_is_supported\n                and (not greeks\n                    or ((contract.right == OptionRight.CALL and (greeks.delta < 0.0 or greeks.delta > 1.0 or greeks.rho < 0.0))\n                        or (contract.right == OptionRight.PUT and (greeks.delta < -1.0 or greeks.delta > 0.0 or greeks.rho > 0.0))\n                        or greeks.theta == 0.0 or greeks.vega < 0.0 or greeks.gamma < 0.0))):\n                raise AssertionError(f'Expected greeks to have valid values. Greeks were: Delta: {greeks.delta}, Rho: {greeks.rho}, Theta: {greeks.theta}, Vega: {greeks.vega}, Gamma: {greeks.gamma}')\n\n\n\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForOptionStylesBaseRegressionAlgorithm import OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered American style option, using an option price model\n### that supports American style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm(OptionPriceModelForOptionStylesBaseRegressionAlgorithm):\n    def initialize(self):\n        self.set_start_date(2014, 6, 9)\n        self.set_end_date(2014, 6, 9)\n\n        option = self.add_option(\"AAPL\", Resolution.MINUTE)\n        option.set_filter(lambda u: u.standards_only().strikes(-1, 1).expiration(0, 35))\n\n        # BaroneAdesiWhaley model supports American style options\n        option.price_model = OptionPriceModels.QuantLib.barone_adesi_whaley()\n\n        self.set_warmup(2, Resolution.DAILY)\n\n        self.init(option, option_style_is_supported=True)\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm import OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered American style option, using an option price model\n### that supports American style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm(OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm):\n    def initialize(self):\n        OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.initialize(self)\n\n        # We want to match the start time of the base algorithm: Base algorithm warmup is 2 bar of daily resolution.\n        # So to match the same start time we go back 4 days, we need to account for a single weekend. This is calculated by 'Time.GET_START_TIME_FOR_TRADE_BARS'\n        self.set_warmup(TimeSpan.from_days(4))\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForOptionStylesBaseRegressionAlgorithm import OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered European style option, using an option price model\n### that supports European style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm(OptionPriceModelForOptionStylesBaseRegressionAlgorithm):\n    def initialize(self):\n        self.set_start_date(2021, 1, 14)\n        self.set_end_date(2021, 1, 14)\n\n        option = self.add_index_option(\"SPX\", Resolution.HOUR)\n        # BlackScholes model supports European style options\n        option.price_model = OptionPriceModels.black_scholes()\n\n        self.set_warmup(7, Resolution.DAILY)\n\n        self.init(option, option_style_is_supported=True)\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm import OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered European style option, using an option price model\n### that supports European style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm(OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm):\n    def initialize(self):\n        OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.initialize(self)\n\n        # We want to match the start time of the base algorithm. SPX index options data time zone is chicago, algorithm time zone is new york (default).\n        # Base algorithm warmup is 7 bar of daily resolution starts at 23 PM new york time of T-1. So to match the same start time\n        # we go back a 9 day + 23 hours, we need to account for a single weekend. This is calculated by 'Time.GET_START_TIME_FOR_TRADE_BARS'\n        self.set_warmup(TimeSpan.from_hours(24 * 9 + 23))\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForOptionStylesBaseRegressionAlgorithm import OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered American style option, using an option price model\n### that supports American style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm(OptionPriceModelForOptionStylesBaseRegressionAlgorithm):\n    def initialize(self):\n        self.set_start_date(2014, 6, 9)\n        self.set_end_date(2014, 6, 9)\n\n        option = self.add_option(\"AAPL\", Resolution.MINUTE)\n        option.set_filter(lambda u: u.standards_only().strikes(-1, 1).expiration(0, 35))\n\n        # BlackSholes model does not support American style options\n        option.price_model = OptionPriceModels.QuantLib.black_scholes()\n\n        self.set_warmup(2, Resolution.DAILY)\n\n        self.init(option, option_style_is_supported=False)\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm import OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered American style option, using an option price model\n### that supports American style options and asserting that the option price model is used.\n### </summary>\nclass OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm(OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm):\n    def initialize(self):\n        OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.initialize(self)\n\n        # We want to match the start time of the base algorithm: Base algorithm warmup is 2 bar of daily resolution.\n        # So to match the same start time we go back 4 days, we need to account for a single weekend. This is calculated by 'Time.GET_START_TIME_FOR_TRADE_BARS'\n        self.set_warmup(TimeSpan.from_days(4))\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForOptionStylesBaseRegressionAlgorithm import OptionPriceModelForOptionStylesBaseRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered European style option, using an option price model\n### that does not support European style options and asserting that the option price model is not used.\n### </summary>\nclass OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm(OptionPriceModelForOptionStylesBaseRegressionAlgorithm):\n    def initialize(self):\n        self.set_start_date(2021, 1, 14)\n        self.set_end_date(2021, 1, 14)\n\n        option = self.add_index_option(\"SPX\", Resolution.HOUR)\n        # BaroneAdesiWhaley model does not support European style options\n        option.price_model = OptionPriceModels.QuantLib.barone_adesi_whaley()\n\n        self.set_warmup(7, Resolution.DAILY)\n\n        self.init(option, option_style_is_supported=False)\n"
  },
  {
    "path": "Algorithm.Python/OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm import OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm exercising an equity covered European style option, using an option price model\n### that does not support European style options and asserting that the option price model is not used.\n### </summary>\nclass OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm(OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm):\n    def initialize(self):\n        OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.initialize(self)\n\n        # We want to match the start time of the base algorithm. SPX index options data time zone is chicago, algorithm time zone is new york (default).\n        # Base algorithm warmup is 7 bar of daily resolution starts at 23 PM new york time of T-1. So to match the same start time\n        # we go back a 9 day + 23 hours, we need to account for a single weekend. This is calculated by 'Time.GET_START_TIME_FOR_TRADE_BARS'\n        self.set_warmup(TimeSpan.from_hours(24 * 9 + 23))\n"
  },
  {
    "path": "Algorithm.Python/OptionRenameRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This is an option split regression algorithm\n### </summary>\n### <meta name=\"tag\" content=\"options\" />\n### <meta name=\"tag\" content=\"regression test\" />\nclass OptionRenameRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_cash(1000000)\n        self.set_start_date(2013,6,28)\n        self.set_end_date(2013,7,2)\n        option = self.add_option(\"TFCFA\")\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(-1, 1, timedelta(0), timedelta(3650))\n        # use the underlying equity as the benchmark\n        self.set_benchmark(\"TFCFA\")\n\n    def on_data(self, slice):\n        ''' Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event\n        <param name=\"slice\">The current slice of data keyed by symbol string</param> '''\n        if not self.portfolio.invested: \n            for kvp in slice.option_chains:\n                chain = kvp.value\n                if self.time.day == 28 and self.time.hour > 9 and self.time.minute > 0:\n    \n                    contracts = [i for i in sorted(chain, key=lambda x:x.expiry) \n                                         if i.right ==  OptionRight.CALL and \n                                            i.strike == 33 and\n                                            i.expiry.date() == datetime(2013,8,17).date()]\n                    if contracts:\n                        # Buying option\n                        contract = contracts[0]\n                        self.buy(contract.symbol, 1)\n                        # Buy the undelying stock\n                        underlying_symbol = contract.symbol.underlying\n                        self.buy (underlying_symbol, 100)\n                        # check\n                        if float(contract.ask_price) != 1.1:\n                            raise ValueError(\"Regression test failed: current ask price was not loaded from NWSA backtest file and is not $1.1\")\n        elif self.time.day == 2 and self.time.hour > 14 and self.time.minute > 0:\n            for kvp in slice.option_chains:\n                chain = kvp.value\n                self.liquidate()\n                contracts = [i for i in sorted(chain, key=lambda x:x.expiry) \n                                        if i.right ==  OptionRight.CALL and \n                                           i.strike == 33 and\n                                           i.expiry.date() == datetime(2013,8,17).date()]\n            if contracts:\n                contract = contracts[0]\n                self.log(\"Bid Price\" + str(contract.bid_price))\n                if float(contract.bid_price) != 0.05:\n                    raise ValueError(\"Regression test failed: current bid price was not loaded from FOXA file and is not $0.05\")\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/OptionSplitRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm tests option exercise and assignment functionality\n### We open two positions and go with them into expiration. We expect to see our long position exercised and short position assigned.\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\n### <meta name=\"tag\" content=\"options\" />\nclass OptionSplitRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        # this test opens position in the first day of trading, lives through stock split (7 for 1),\n        # and closes adjusted position on the second day\n\n        self.set_cash(1000000)\n        self.set_start_date(2014,6,6)\n        self.set_end_date(2014,6,9)\n\n        option = self.add_option(\"AAPL\")\n\n        # set our strike/expiry filter for this option chain\n        option.set_filter(self.universe_func)\n\n        self.set_benchmark(\"AAPL\")\n        self.contract = None\n\n    def on_data(self, slice):\n        if not self.portfolio.invested:\n            if self.time.hour > 9 and self.time.minute > 0:\n                for kvp in slice.option_chains:\n                    chain = kvp.value\n                    contracts = filter(lambda x: x.strike == 650 and x.right ==  OptionRight.CALL, chain)\n                    sorted_contracts = sorted(contracts, key = lambda x: x.expiry)\n\n                if len(sorted_contracts) > 1:\n                    self.contract = sorted_contracts[1]\n                    self.buy(self.contract.symbol, 1)\n\n        elif self.time.day > 6 and self.time.hour > 14 and self.time.minute > 0:\n            self.liquidate()\n\n        if self.portfolio.invested:\n            options_hold = [x for x in self.portfolio.securities if x.value.holdings.absolute_quantity != 0]\n            holdings = options_hold[0].value.holdings.absolute_quantity\n            if self.time.day == 6 and holdings != 1:\n                self.log(\"Expected position quantity of 1 but was {0}\".format(holdings))\n            if self.time.day == 9 and holdings != 7:\n                self.log(\"Expected position quantity of 7 but was {0}\".format(holdings))\n\n    # set our strike/expiry filter for this option chain\n    def universe_func(self, universe):\n        return universe.include_weeklys().strikes(-2, 2).expiration(timedelta(0), timedelta(365*2))\n\n    def on_order_event(self, order_event):\n        self.log(str(order_event))\n"
  },
  {
    "path": "Algorithm.Python/OptionStrategyFactoryMethodsBaseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Securities.Positions import IPositionGroup\n\n### <summary>\n### This base algorithm demonstrates how to use OptionStrategies helper class to batch send orders for common strategies.\n### </summary>\nclass OptionStrategyFactoryMethodsBaseAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(1000000)\n\n        option = self.add_option(\"GOOG\")\n        self._option_symbol = option.symbol\n\n        option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))\n\n        self.set_benchmark(\"GOOG\")\n\n    def on_data(self, slice):\n        if not self.portfolio.invested:\n            chain = slice.option_chains.get(self._option_symbol)\n            if chain is not None:\n                self.trade_strategy(chain, self._option_symbol)\n        else:\n            # Verify that the strategy was traded\n            position_group = list(self.portfolio.positions.groups)[0]\n\n            buying_power_model = position_group.buying_power_model\n            if not isinstance(buying_power_model, OptionStrategyPositionGroupBuyingPowerModel):\n                raise AssertionError(\"Expected position group buying power model type: OptionStrategyPositionGroupBuyingPowerModel. \"\n                                f\"Actual: {type(position_group.buying_power_model).__name__}\")\n\n            self.assert_strategy_position_group(position_group, self._option_symbol)\n\n            # Now we should be able to close the position\n            self.liquidate_strategy()\n\n            # We can quit now, no more testing required\n            self.quit()\n\n    def on_end_of_algorithm(self):\n        if self.portfolio.invested:\n            raise AssertionError(\"Expected no holdings at end of algorithm\")\n\n        orders_count = len(list(self.transactions.get_orders(lambda order: order.status == OrderStatus.FILLED)))\n        if orders_count != self.expected_orders_count():\n            raise AssertionError(f\"Expected {self.expected_orders_count()} orders to have been submitted and filled, \"\n                            f\"half for buying the strategy and the other half for the liquidation. Actual {orders_count}\")\n\n    def expected_orders_count(self) -> int:\n        raise NotImplementedError(\"ExpectedOrdersCount method is not implemented\")\n\n    def trade_strategy(self, chain: OptionChain, option_symbol: Symbol) -> None:\n        raise NotImplementedError(\"TradeStrategy method is not implemented\")\n\n    def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol) -> None:\n        raise NotImplementedError(\"AssertStrategyPositionGroup method is not implemented\")\n\n    def liquidate_strategy(self) -> None:\n        raise NotImplementedError(\"LiquidateStrategy method is not implemented\")\n"
  },
  {
    "path": "Algorithm.Python/OptionUniverseFilterGreeksRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm demonstrating the option universe filter by greeks and other options data feature\n### </summary>\nclass OptionUniverseFilterGreeksRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        underlying_ticker = \"GOOG\"\n        self.add_equity(underlying_ticker)\n        option = self.add_option(underlying_ticker)\n        self.option_symbol = option.symbol\n\n        self._min_delta = 0.5\n        self._max_delta = 1.5\n        self._min_gamma = 0.0001\n        self._max_gamma = 0.0006\n        self._min_vega = 0.01\n        self._max_vega = 1.5\n        self._min_theta = -730.0\n        self._max_theta = -182.5\n        self._min_rho = 0.5\n        self._max_rho = 3.0\n        self._min_iv = 1.0\n        self._max_iv = 3.0\n        self._min_open_interest = 100\n        self._max_open_interest = 500\n\n        option.set_filter(self.main_filter)\n        self.option_chain_received = False\n\n    def main_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:\n        total_contracts = len(list(universe))\n\n        filtered_universe = self.option_filter(universe)\n        filtered_contracts = len(list(filtered_universe))\n\n        if filtered_contracts == total_contracts:\n            raise AssertionError(f\"Expected filtered universe to have less contracts than original universe. \"\n                                 f\"Filtered contracts count ({filtered_contracts}) is equal to total contracts count ({total_contracts})\")\n\n        return filtered_universe\n\n    def option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:\n        # Contracts can be filtered by greeks, implied volatility, open interest:\n        return universe \\\n            .delta(self._min_delta, self._max_delta) \\\n            .gamma(self._min_gamma, self._max_gamma) \\\n            .vega(self._min_vega, self._max_vega) \\\n            .theta(self._min_theta, self._max_theta) \\\n            .rho(self._min_rho, self._max_rho) \\\n            .implied_volatility(self._min_iv, self._max_iv) \\\n            .open_interest(self._min_open_interest, self._max_open_interest)\n\n        # Note: there are also shortcuts for these filter methods:\n        '''\n        return universe \\\n            .d(self._min_delta, self._max_delta) \\\n            .g(self._min_gamma, self._max_gamma) \\\n            .v(self._min_vega, self._max_vega) \\\n            .t(self._min_theta, self._max_theta) \\\n            .r(self._min_rho, self._max_rho) \\\n            .iv(self._min_iv, self._max_iv) \\\n            .oi(self._min_open_interest, self._max_open_interest)\n        '''\n\n    def on_data(self, slice: Slice) -> None:\n        chain = slice.option_chains.get(self.option_symbol)\n        if chain and len(chain.contracts) > 0:\n            self.option_chain_received = True\n\n    def on_end_of_algorithm(self) -> None:\n        if not self.option_chain_received:\n            raise AssertionError(\"Option chain was not received.\")\n"
  },
  {
    "path": "Algorithm.Python/OptionUniverseFilterGreeksShortcutsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionUniverseFilterGreeksRegressionAlgorithm import OptionUniverseFilterGreeksRegressionAlgorithm\n\n### <summary>\n### Regression algorithm demonstrating the option universe filter by greeks and other options data feature\n### </summary>\nclass OptionUniverseFilterGreeksShortcutsRegressionAlgorithm(OptionUniverseFilterGreeksRegressionAlgorithm):\n\n    def option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:\n        # Contracts can be filtered by greeks, implied volatility, open interest:\n        return universe \\\n            .d(self._min_delta, self._max_delta) \\\n            .g(self._min_gamma, self._max_gamma) \\\n            .v(self._min_vega, self._max_vega) \\\n            .t(self._min_theta, self._max_theta) \\\n            .r(self._min_rho, self._max_rho) \\\n            .iv(self._min_iv, self._max_iv) \\\n            .oi(self._min_open_interest, self._max_open_interest)\n"
  },
  {
    "path": "Algorithm.Python/OptionUniverseFilterOptionsDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom OptionUniverseFilterGreeksRegressionAlgorithm import OptionUniverseFilterGreeksRegressionAlgorithm\n\n### <summary>\n### Regression algorithm demonstrating the option universe filter feature that allows accessing the option universe data,\n### including greeks, open interest and implied volatility, and filtering the contracts based on this data.\n### </summary>\nclass OptionUniverseFilterOptionsDataRegressionAlgorithm(OptionUniverseFilterGreeksRegressionAlgorithm):\n\n    def option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:\n        # The filter used for the option security will be equivalent to the following commented one below,\n        # but it is more flexible and allows for more complex filtering:\n\n        '''\n        return universe \\\n            .delta(self._min_delta, self._max_delta) \\\n            .gamma(self._min_gamma, self._max_gamma) \\\n            .vega(self._min_vega, self._max_vega) \\\n            .theta(self._min_theta, self._max_theta) \\\n            .rho(self._min_rho, self._max_rho) \\\n            .implied_volatility(self._min_iv, self._max_iv) \\\n            .open_interest(self._min_open_interest, self._max_open_interest)\n        '''\n\n        # These contracts list will already be filtered by the strikes and expirations,\n        # since those filters where applied before this one.\n        return universe \\\n            .contracts(lambda contracts: [\n                contract for contract in contracts\n                # Can access the contract data here and do some filtering based on it is needed.\n                # More complex math can be done here for filtering, but will be simple here for demonstration sake:\n                if (contract.Greeks.Delta > self._min_delta and contract.Greeks.Delta < self._max_delta and\n                    contract.Greeks.Gamma > self._min_gamma and contract.Greeks.Gamma < self._max_gamma and\n                    contract.Greeks.Vega > self._min_vega and contract.Greeks.Vega < self._max_vega and\n                    contract.Greeks.Theta > self._min_theta and contract.Greeks.Theta < self._max_theta and\n                    contract.Greeks.Rho > self._min_rho and contract.Greeks.Rho < self._max_rho and\n                    contract.ImpliedVolatility > self._min_iv and contract.ImpliedVolatility < self._max_iv and\n                    contract.OpenInterest > self._min_open_interest and contract.OpenInterest < self._max_open_interest)\n                ])\n"
  },
  {
    "path": "Algorithm.Python/OptionUniverseHistoryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing history requests for <see cref=\"OptionUniverse\"/> type work as expected\n### and return the same data as the option chain provider.\n### </summary>\nclass OptionUniverseHistoryRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 25)\n        self.set_end_date(2015, 12, 25)\n\n        option = self.add_option(\"GOOG\").symbol\n\n        historical_options_data_df = self.history(option, 3, flatten=True)\n\n        # Level 0 of the multi-index is the date, we expect 3 dates, 3 option chains\n        if historical_options_data_df.index.levshape[0] != 3:\n            raise AssertionError(f\"Expected 3 option chains from history request, but got {historical_options_data_df.index.levshape[1]}\")\n\n        for date in historical_options_data_df.index.levels[0]:\n            expected_chain = list(self.option_chain_provider.get_option_contract_list(option, date))\n            expected_chain_count = len(expected_chain)\n\n            actual_chain = historical_options_data_df.loc[date]\n            actual_chain_count = len(actual_chain)\n\n            if expected_chain_count != actual_chain_count:\n                raise AssertionError(f\"Expected {expected_chain_count} options in chain on {date}, but got {actual_chain_count}\")\n\n            for i, symbol in enumerate(actual_chain.index):\n                expected_symbol = expected_chain[i]\n                if symbol != expected_symbol:\n                    raise AssertionError(f\"Expected symbol {expected_symbol} at index {i} on {date}, but got {symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/OrderTicketAssignmentDemoAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import timedelta\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration on how to access order tickets right after placing an order.\n### </summary>\nclass OrderTicketAssignmentDemoAlgorithm(QCAlgorithm):\n    '''Demonstration on how to access order tickets right after placing an order.'''\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self._symbol = self.add_equity(\"SPY\").symbol\n\n        self.trade_count = 0\n        self.consolidate(self._symbol, timedelta(hours=1), self.hour_consolidator)\n\n    def hour_consolidator(self, bar: TradeBar):\n        # Reset self.ticket to None on each new bar\n        self.ticket = None\n        self.ticket = self.market_order(self._symbol, 1, asynchronous=True)\n        self.debug(f\"{self.time}: Buy: Price {bar.price}, order_id: {self.ticket.order_id}\")\n        self.trade_count += 1\n\n    def on_order_event(self, order_event: OrderEvent):\n        # We cannot access self.ticket directly because it is assigned asynchronously:\n        # this order event could be triggered before self.ticket is assigned.\n        ticket = order_event.ticket\n        if ticket is None:\n            raise AssertionError(\"Expected order ticket in order event to not be null\")\n        if order_event.status == OrderStatus.SUBMITTED and self.ticket is not None:\n            raise AssertionError(\"Field self.ticket not expected no be assigned on the first order event\")\n\n        self.debug(ticket.to_string())\n\n    def on_end_of_algorithm(self):\n        # Just checking that orders were placed\n        if not self.portfolio.invested or self.trade_count != self.transactions.orders_count:\n            raise AssertionError(f\"Expected the portfolio to have holdings and to have {self.trade_count} trades, but had {self.transactions.orders_count}\")\n"
  },
  {
    "path": "Algorithm.Python/OrderTicketDemoAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm we submit/update/cancel each order type\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"managing orders\" />\n### <meta name=\"tag\" content=\"order tickets\" />\n### <meta name=\"tag\" content=\"updating orders\" />\nclass OrderTicketDemoAlgorithm(QCAlgorithm):\n    '''In this algorithm we submit/update/cancel each order type'''\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        equity = self.add_equity(\"SPY\")\n        self.spy = equity.symbol\n\n        self.__open_market_on_open_orders = []\n        self.__open_market_on_close_orders = []\n        self.__open_limit_orders = []\n        self.__open_stop_market_orders = []\n        self.__open_stop_limit_orders = []\n        self.__open_trailing_stop_orders = []\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        # MARKET ORDERS\n        self.market_orders()\n\n        # LIMIT ORDERS\n        self.limit_orders()\n\n        # STOP MARKET ORDERS\n        self.stop_market_orders()\n\n        # STOP LIMIT ORDERS\n        self.stop_limit_orders()\n\n        # TRAILING STOP ORDERS\n        self.trailing_stop_orders()\n\n        # MARKET ON OPEN ORDERS\n        self.market_on_open_orders()\n\n        # MARKET ON CLOSE ORDERS\n        self.market_on_close_orders()\n\n\n    def market_orders(self):\n        ''' MarketOrders are the only orders that are processed synchronously by default, so\n        they'll fill by the next line of code. This behavior equally applies to live mode.\n        You can opt out of this behavior by specifying the 'asynchronous' parameter as True.'''\n        if self.time_is(7, 9, 31):\n            self.log(\"Submitting MarketOrder\")\n\n            # submit a market order to buy 10 shares, this function returns an OrderTicket object\n            # we submit the order with asynchronous = False, so it block until it is filled\n            new_ticket = self.market_order(self.spy, 10, asynchronous = False)\n            if new_ticket.status != OrderStatus.FILLED:\n                self.log(\"Synchronous market order was not filled synchronously!\")\n                self.quit()\n\n            # we can also submit the ticket asynchronously. In a backtest, we'll still perform the fill\n            # before the next time events for your algorithm. here we'll submit the order asynchronously\n            # and try to cancel it, sometimes it will, sometimes it will be filled first.\n            new_ticket = self.market_order(self.spy, 10, asynchronous = True)\n            response = new_ticket.cancel(\"Attempt to cancel async order\")\n            if response.is_success:\n                self.log(\"Successfully canceled async market order: {0}\".format(new_ticket.order_id))\n            else:\n                self.log(\"Unable to cancel async market order: {0}\".format(response.error_code))\n\n\n    def limit_orders(self):\n        '''LimitOrders are always processed asynchronously. Limit orders are used to\n        set 'good' entry points for an order. For example, you may wish to go\n        long a stock, but want a good price, so can place a LimitOrder to buy with\n        a limit price below the current market price. Likewise the opposite is True\n        when selling, you can place a LimitOrder to sell with a limit price above the\n        current market price to get a better sale price.\n        You can submit requests to update or cancel the LimitOrder at any time.\n        The 'LimitPrice' for an order can be retrieved from the ticket using the\n        OrderTicket.get(OrderField) method, for example:\n        Code:\n            current_limit_price = order_ticket.get(OrderField.LIMIT_PRICE)'''\n        if self.time_is(7, 12, 0):\n            self.log(\"Submitting LimitOrder\")\n\n            # submit a limit order to buy 10 shares at .1% below the bar's close\n            close = self.securities[self.spy.value].close\n            new_ticket = self.limit_order(self.spy, 10, close * .999)\n            self.__open_limit_orders.append(new_ticket)\n\n            # submit another limit order to sell 10 shares at .1% above the bar's close\n            new_ticket = self.limit_order(self.spy, -10, close * 1.001)\n            self.__open_limit_orders.append(new_ticket)\n\n        # when we submitted new limit orders we placed them into this list,\n        # so while there's two entries they're still open and need processing\n        if len(self.__open_limit_orders) == 2:\n            open_orders = self.__open_limit_orders\n\n            # check if either is filled and cancel the other\n            long_order = open_orders[0]\n            short_order = open_orders[1]\n            if self.check_pair_orders_for_fills(long_order, short_order):\n                self.__open_limit_orders = []\n                return\n\n            # if neither order has filled, bring in the limits by a penny\n            new_long_limit = long_order.get(OrderField.LIMIT_PRICE) + 0.01\n            new_short_limit = short_order.get(OrderField.LIMIT_PRICE) - 0.01\n            self.log(\"Updating limits - Long: {0:.2f} Short: {1:.2f}\".format(new_long_limit, new_short_limit))\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.limit_price = new_long_limit\n            update_order_fields.tag = \"Update #{0}\".format(len(long_order.update_requests) + 1)\n            long_order.update(update_order_fields)\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.limit_price = new_short_limit\n            update_order_fields.tag = \"Update #{0}\".format(len(short_order.update_requests) + 1)\n            short_order.update(update_order_fields)\n\n\n    def stop_market_orders(self):\n        '''StopMarketOrders work in the opposite way that limit orders do.\n        When placing a long trade, the stop price must be above current\n        market price. In this way it's a 'stop loss' for a short trade.\n        When placing a short trade, the stop price must be below current\n        market price. In this way it's a 'stop loss' for a long trade.\n        You can submit requests to update or cancel the StopMarketOrder at any time.\n        The 'StopPrice' for an order can be retrieved from the ticket using the\n        OrderTicket.get(OrderField) method, for example:\n        Code:\n            current_stop_price = order_ticket.get(OrderField.STOP_PRICE)'''\n        if self.time_is(7, 12 + 4, 0):\n            self.log(\"Submitting StopMarketOrder\")\n\n            # a long stop is triggered when the price rises above the value\n            # so we'll set a long stop .25% above the current bar's close\n            close = self.securities[self.spy.value].close\n            new_ticket = self.stop_market_order(self.spy, 10, close * 1.0025)\n            self.__open_stop_market_orders.append(new_ticket)\n\n            # a short stop is triggered when the price falls below the value\n            # so we'll set a short stop .25% below the current bar's close\n            new_ticket = self.stop_market_order(self.spy, -10, close * .9975)\n            self.__open_stop_market_orders.append(new_ticket)\n\n        # when we submitted new stop market orders we placed them into this list,\n        # so while there's two entries they're still open and need processing\n        if len(self.__open_stop_market_orders) == 2:\n            # check if either is filled and cancel the other\n            long_order = self.__open_stop_market_orders[0]\n            short_order = self.__open_stop_market_orders[1]\n            if self.check_pair_orders_for_fills(long_order, short_order):\n                self.__open_stop_market_orders = []\n                return\n\n            # if neither order has filled, bring in the stops by a penny\n            new_long_stop = long_order.get(OrderField.STOP_PRICE) - 0.01\n            new_short_stop = short_order.get(OrderField.STOP_PRICE) + 0.01\n            self.log(\"Updating stops - Long: {0:.2f} Short: {1:.2f}\".format(new_long_stop, new_short_stop))\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.stop_price = new_long_stop\n            update_order_fields.tag = \"Update #{0}\".format(len(long_order.update_requests) + 1)\n            long_order.update(update_order_fields)\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.stop_price = new_short_stop\n            update_order_fields.tag = \"Update #{0}\".format(len(short_order.update_requests) + 1)\n            short_order.update(update_order_fields)\n            self.log(\"Updated price - Long: {0} Short: {1}\".format(long_order.get(OrderField.STOP_PRICE), short_order.get(OrderField.STOP_PRICE)))\n\n\n    def stop_limit_orders(self):\n        '''StopLimitOrders work as a combined stop and limit order. First, the\n        price must pass the stop price in the same way a StopMarketOrder works,\n        but then we're also guaranteed a fill price at least as good as the\n        limit price. This order type can be beneficial in gap down scenarios\n        where a StopMarketOrder would have triggered and given the not as beneficial\n        gapped down price, whereas the StopLimitOrder could protect you from\n        getting the gapped down price through prudent placement of the limit price.\n        You can submit requests to update or cancel the StopLimitOrder at any time.\n        The 'StopPrice' or 'LimitPrice' for an order can be retrieved from the ticket\n        using the OrderTicket.get(OrderField) method, for example:\n        Code:\n            current_stop_price = order_ticket.get(OrderField.STOP_PRICE)\n            current_limit_price = order_ticket.get(OrderField.LIMIT_PRICE)'''\n        if self.time_is(8, 12, 1):\n            self.log(\"Submitting StopLimitOrder\")\n\n            # a long stop is triggered when the price rises above the\n            # value so we'll set a long stop .25% above the current bar's\n            # close now we'll also be setting a limit, this means we are\n            # guaranteed to get at least the limit price for our fills,\n            # so make the limit price a little higher than the stop price\n\n            close = self.securities[self.spy.value].close\n            new_ticket = self.stop_limit_order(self.spy, 10, close * 1.001, close - 0.03)\n            self.__open_stop_limit_orders.append(new_ticket)\n\n            # a short stop is triggered when the price falls below the\n            # value so we'll set a short stop .25% below the current bar's\n            # close now we'll also be setting a limit, this means we are\n            # guaranteed to get at least the limit price for our fills,\n            # so make the limit price a little softer than the stop price\n\n            new_ticket = self.stop_limit_order(self.spy, -10, close * .999, close + 0.03)\n            self.__open_stop_limit_orders.append(new_ticket)\n\n        # when we submitted new stop limit orders we placed them into this list,\n        # so while there's two entries they're still open and need processing\n        if len(self.__open_stop_limit_orders) == 2:\n            long_order = self.__open_stop_limit_orders[0]\n            short_order = self.__open_stop_limit_orders[1]\n            if self.check_pair_orders_for_fills(long_order, short_order):\n                self.__open_stop_limit_orders = []\n                return\n\n            # if neither order has filled, bring in the stops/limits in by a penny\n\n            new_long_stop = long_order.get(OrderField.STOP_PRICE) - 0.01\n            new_long_limit = long_order.get(OrderField.LIMIT_PRICE) + 0.01\n            new_short_stop = short_order.get(OrderField.STOP_PRICE) + 0.01\n            new_short_limit = short_order.get(OrderField.LIMIT_PRICE) - 0.01\n            self.log(\"Updating stops  - Long: {0:.2f} Short: {1:.2f}\".format(new_long_stop, new_short_stop))\n            self.log(\"Updating limits - Long: {0:.2f}  Short: {1:.2f}\".format(new_long_limit, new_short_limit))\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.stop_price = new_long_stop\n            update_order_fields.limit_price = new_long_limit\n            update_order_fields.tag = \"Update #{0}\".format(len(long_order.update_requests) + 1)\n            long_order.update(update_order_fields)\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.stop_price = new_short_stop\n            update_order_fields.limit_price = new_short_limit\n            update_order_fields.tag = \"Update #{0}\".format(len(short_order.update_requests) + 1)\n            short_order.update(update_order_fields)\n\n\n    def trailing_stop_orders(self):\n        '''TrailingStopOrders work the same way as StopMarketOrders, except\n        their stop price is adjusted to a certain amount, keeping it a certain\n        fixed distance from/to the market price, depending on the order direction,\n        which allows to preserve profits and protecting against losses.\n        The stop price can be accessed just as with StopMarketOrders, and\n        the trailing amount can be accessed with the OrderTicket.get(OrderField), for example:\n        Code:\n            current_trailing_amount = order_ticket.get(OrderField.STOP_PRICE)\n            trailing_as_percentage = order_ticket.get[bool](OrderField.TRAILING_AS_PERCENTAGE)'''\n        if self.time_is(7, 12, 0):\n            self.log(\"Submitting TrailingStopOrder\")\n\n            # a long stop is triggered when the price rises above the\n            # value so we'll set a long stop .25% above the current bar's\n\n            close = self.securities[self.spy.value].close\n            stop_price = close * 1.0025\n            new_ticket = self.trailing_stop_order(self.spy, 10, stop_price, trailing_amount=0.0025, trailing_as_percentage=True)\n            self.__open_trailing_stop_orders.append(new_ticket)\n\n            # a short stop is triggered when the price falls below the\n            # value so we'll set a short stop .25% below the current bar's\n\n            stop_price = close * .9975\n            new_ticket = self.trailing_stop_order(self.spy, -10, stop_price, trailing_amount=0.0025, trailing_as_percentage=True)\n            self.__open_trailing_stop_orders.append(new_ticket)\n\n        # when we submitted new stop market orders we placed them into this list,\n        # so while there's two entries they're still open and need processing\n        elif len(self.__open_trailing_stop_orders) == 2:\n            long_order = self.__open_trailing_stop_orders[0]\n            short_order = self.__open_trailing_stop_orders[1]\n            if self.check_pair_orders_for_fills(long_order, short_order):\n                self.__open_trailing_stop_orders = []\n                return\n\n            # if neither order has filled in the last 5 minutes, bring in the trailing percentage by 0.01%\n            if ((self.utc_time - long_order.time).total_seconds() / 60) % 5 != 0:\n                return\n\n            long_trailing_percentage = long_order.get(OrderField.TRAILING_AMOUNT)\n            new_long_trailing_percentage = max(long_trailing_percentage - 0.0001, 0.0001)\n            short_trailing_percentage = short_order.get(OrderField.TRAILING_AMOUNT)\n            new_short_trailing_percentage = max(short_trailing_percentage - 0.0001, 0.0001)\n            self.log(\"Updating trailing percentages - Long: {0:.3f} Short: {1:.3f}\".format(new_long_trailing_percentage, new_short_trailing_percentage))\n\n            update_order_fields = UpdateOrderFields()\n            # we could change the quantity, but need to specify it\n            #Quantity =\n            update_order_fields.trailing_amount = new_long_trailing_percentage\n            update_order_fields.tag = \"Update #{0}\".format(len(long_order.update_requests) + 1)\n            long_order.update(update_order_fields)\n\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.trailing_amount = new_short_trailing_percentage\n            update_order_fields.tag = \"Update #{0}\".format(len(short_order.update_requests) + 1)\n            short_order.update(update_order_fields)\n\n\n    def market_on_close_orders(self):\n        '''MarketOnCloseOrders are always executed at the next market's closing price.\n        The only properties that can be updated are the quantity and order tag properties.'''\n        if self.time_is(9, 12, 0):\n            self.log(\"Submitting MarketOnCloseOrder\")\n\n            # open a new position or triple our existing position\n            qty = self.portfolio[self.spy.value].quantity\n            qty = 100 if qty == 0 else 2*qty\n\n            new_ticket = self.market_on_close_order(self.spy, qty)\n            self.__open_market_on_close_orders.append(new_ticket)\n\n        if len(self.__open_market_on_close_orders) == 1 and self.time.minute == 59:\n            ticket = self.__open_market_on_close_orders[0]\n            # check for fills\n            if ticket.status == OrderStatus.FILLED:\n                self.__open_market_on_close_orders = []\n                return\n\n            quantity = ticket.quantity + 1\n            self.log(\"Updating quantity  - New Quantity: {0}\".format(quantity))\n\n            # we can update the quantity and tag\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.quantity = quantity\n            update_order_fields.tag = \"Update #{0}\".format(len(ticket.update_requests) + 1)\n            ticket.update(update_order_fields)\n\n        if self.time_is(self.end_date.day, 12 + 3, 45):\n            self.log(\"Submitting MarketOnCloseOrder to liquidate end of algorithm\")\n            self.market_on_close_order(self.spy, -self.portfolio[self.spy.value].quantity, tag=\"Liquidate end of algorithm\")\n\n\n    def market_on_open_orders(self):\n        '''MarketOnOpenOrders are always executed at the next\n        market's opening price. The only properties that can\n        be updated are the quantity and order tag properties.'''\n        if self.time_is(8, 14 + 2, 0):\n            self.log(\"Submitting MarketOnOpenOrder\")\n\n            # its EOD, let's submit a market on open order to short even more!\n            new_ticket = self.market_on_open_order(self.spy, 50)\n            self.__open_market_on_open_orders.append(new_ticket)\n\n        if len(self.__open_market_on_open_orders) == 1 and self.time.minute == 59:\n            ticket = self.__open_market_on_open_orders[0]\n\n            # check for fills\n            if ticket.status == OrderStatus.FILLED:\n                self.__open_market_on_open_orders = []\n                return\n\n            quantity = ticket.quantity + 1\n            self.log(\"Updating quantity  - New Quantity: {0}\".format(quantity))\n\n            # we can update the quantity and tag\n            update_order_fields = UpdateOrderFields()\n            update_order_fields.quantity = quantity\n            update_order_fields.tag = \"Update #{0}\".format(len(ticket.update_requests) + 1)\n            ticket.update(update_order_fields)\n\n\n    def on_order_event(self, order_event):\n        order = self.transactions.get_order_by_id(order_event.order_id)\n        self.log(\"{0}: {1}: {2}\".format(self.time, order.type, order_event))\n\n        if order_event.quantity == 0:\n            raise AssertionError(\"OrderEvent quantity is Not expected to be 0, it should hold the current order Quantity\")\n\n        if order_event.quantity != order.quantity:\n            raise AssertionError(\"OrderEvent quantity should hold the current order Quantity\")\n\n        if (type(order) is LimitOrder and order_event.limit_price == 0 or\n            type(order) is StopLimitOrder and order_event.limit_price == 0):\n            raise AssertionError(\"OrderEvent LimitPrice is Not expected to be 0 for LimitOrder and StopLimitOrder\")\n\n        if type(order) is StopMarketOrder and order_event.stop_price == 0:\n            raise AssertionError(\"OrderEvent StopPrice is Not expected to be 0 for StopMarketOrder\")\n\n        # We can access the order ticket from the order event\n        if order_event.ticket is None:\n            raise AssertionError(\"OrderEvent Ticket was not set\")\n        if order_event.order_id != order_event.ticket.order_id:\n            raise AssertionError(\"OrderEvent.ORDER_ID and order_event.ticket.order_id do not match\")\n\n    def check_pair_orders_for_fills(self, long_order, short_order):\n        if long_order.status == OrderStatus.FILLED:\n            self.log(\"{0}: Cancelling short order, long order is filled.\".format(short_order.order_type))\n            short_order.cancel(\"Long filled.\")\n            return True\n\n        if short_order.status == OrderStatus.FILLED:\n            self.log(\"{0}: Cancelling long order, short order is filled.\".format(long_order.order_type))\n            long_order.cancel(\"Short filled\")\n            return True\n\n        return False\n\n\n    def time_is(self, day, hour, minute):\n        return self.time.day == day and self.time.hour == hour and self.time.minute == minute\n\n    def on_end_of_algorithm(self):\n        basic_order_ticket_filter = lambda x: x.symbol == self.spy\n\n        filled_orders = self.transactions.get_orders(lambda x: x.status == OrderStatus.FILLED)\n        order_tickets = self.transactions.get_order_tickets(basic_order_ticket_filter)\n        open_orders = self.transactions.get_open_orders(lambda x: x.symbol == self.spy)\n        open_order_tickets = self.transactions.get_open_order_tickets(basic_order_ticket_filter)\n        remaining_open_orders = self.transactions.get_open_orders_remaining_quantity(basic_order_ticket_filter)\n\n        # The type returned by self.transactions.get_orders() is iterable and not a list\n        # that's why we use sum() to get the size of the iterable object type\n        filled_orders_size = sum(1 for order in filled_orders)\n        order_tickets_size = sum(1 for ticket in order_tickets)\n        open_order_tickets_size = sum(1 for ticket in open_order_tickets)\n\n        assert(filled_orders_size == 9 and order_tickets_size == 12), \"There were expected 9 filled orders and 12 order tickets\"\n        assert(not (len(open_orders) or open_order_tickets_size)), \"No open orders or tickets were expected\"\n        assert(not remaining_open_orders), \"No remaining quantity to be filled from open orders was expected\"\n\n        spy_open_orders = self.transactions.get_open_orders(self.spy)\n        spy_open_order_tickets = self.transactions.get_open_order_tickets(self.spy)\n        spy_open_order_tickets_size = sum(1 for tickets in spy_open_order_tickets)\n        spy_open_orders_remaining_quantity = self.transactions.get_open_orders_remaining_quantity(self.spy)\n\n        assert(not (len(spy_open_orders) or spy_open_order_tickets_size)), \"No open orders or tickets were expected\"\n        assert(not spy_open_orders_remaining_quantity), \"No remaining quantity to be filled from open orders was expected\"\n\n        default_orders = self.transactions.get_orders()\n        default_order_tickets = self.transactions.get_order_tickets()\n        default_open_orders = self.transactions.get_open_orders()\n        default_open_order_tickets = self.transactions.get_open_order_tickets()\n        default_open_orders_remaining = self.transactions.get_open_orders_remaining_quantity()\n\n        default_orders_size = sum(1 for order in default_orders)\n        default_order_tickets_size = sum(1 for ticket in default_order_tickets)\n        default_open_order_tickets_size = sum(1 for ticket in default_open_order_tickets)\n\n        assert(default_orders_size == 12 and default_order_tickets_size == 12), \"There were expected 12 orders and 12 order tickets\"\n        assert(not (len(default_open_orders) or default_open_order_tickets_size)), \"No open orders or tickets were expected\"\n        assert(not default_open_orders_remaining), \"No remaining quantity to be filled from open orders was expected\"\n"
  },
  {
    "path": "Algorithm.Python/PEP8StyleBasicAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass PEP8StyleBasicAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE, extended_market_hours=False, fill_forward=True).symbol\n\n        # Test accessing a constant (QCAlgorithm.MaxTagsCount)\n        self.debug(\"MaxTagsCount: \" + str(self.MAX_TAGS_COUNT))\n\n    def on_data(self, slice):\n        if not self.portfolio.invested:\n            self.set_holdings(self.spy, 1)\n            self.debug(\"Purchased Stock\")\n\n    def on_order_event(self, order_event):\n        self.log(f\"{self.time} :: {order_event}\")\n\n    def on_end_of_algorithm(self):\n        self.log(\"Algorithm ended!\")\n\n        if not self.portfolio.invested:\n            raise AssertionError(\"Algorithm should have been invested at the end of the algorithm\")\n\n        # let's do some logging to do more pep8 style testing\n        self.log(\"-----------------------------------------------------------------------------------------\")\n        self.log(f\"{self.spy.value} last price: {self.securities[self.spy].price}\")\n        self.log(f\"{self.spy.value} holdings: \"\n                 f\"{self.securities[self.spy].holdings.quantity}@{self.securities[self.spy].holdings.price}=\"\n                 f\"{self.securities[self.spy].holdings.holdings_value}\")\n        self.log(\"-----------------------------------------------------------------------------------------\")\n"
  },
  {
    "path": "Algorithm.Python/PandasDataFrameFromMultipleTickTypeTickHistoryRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm for asserting that tick history that includes multiple tick types (trade, quote) is correctly converted to a pandas\n### dataframe without raising exceptions. The main exception in this case was a \"non-unique multi-index\" error due to trades adn quote ticks with\n### duplicated timestamps.\n### </summary>\nclass PandasDataFrameFromMultipleTickTypeTickHistoryRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 8)\n\n        spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        subscriptions = [x for x in self.subscription_manager.subscriptions if x.symbol == spy]\n        if len(subscriptions) != 2:\n            raise AssertionError(f\"Expected 2 subscriptions, but found {len(subscriptions)}\")\n\n        history = pd.DataFrame()\n        try:\n            history = self.history(Tick, spy, timedelta(days=1), Resolution.TICK)\n        except Exception as e:\n            raise AssertionError(f\"History call failed: {e}\")\n\n        if history.shape[0] == 0:\n            raise AssertionError(\"SPY tick history is empty\")\n\n        if not np.array_equal(history.columns.to_numpy(), ['askprice', 'asksize', 'bidprice', 'bidsize', 'exchange', 'lastprice', 'quantity']):\n            raise AssertionError(\"Unexpected columns in SPY tick history\")\n\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/PandasDataFrameHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates the various ways to handle History pandas DataFrame\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"warm up\" />\nclass PandasDataFrameHistoryAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 6, 9)   # Set Start Date\n        self.set_end_date(2014, 6, 9)     # Set End Date\n\n        self.spy = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n        self.eur = self.add_forex(\"EURUSD\", Resolution.DAILY).symbol\n\n        aapl = self.add_equity(\"AAPL\", Resolution.MINUTE).symbol\n        self.option = Symbol.create_option(aapl, Market.USA, OptionStyle.AMERICAN, OptionRight.CALL, 750, datetime(2014, 10, 18))\n        self.add_option_contract(self.option)\n\n        sp1 = self.add_data(QuandlFuture,\"CHRIS/CME_SP1\", Resolution.DAILY)\n        sp1.exchange = EquityExchange()\n        self.sp1 = sp1.symbol\n\n        self.add_universe(self.coarse_selection)\n\n    def coarse_selection(self, coarse):\n        if self.portfolio.invested:\n            return Universe.UNCHANGED\n\n        selected = [x.symbol for x in coarse if x.symbol.value in [\"AAA\", \"AIG\", \"BAC\"]]\n        if len(selected) == 0:\n            return Universe.UNCHANGED\n\n        universe_history = self.history(selected, 10, Resolution.DAILY)\n        for symbol in selected:\n            self.assert_history_index(universe_history, \"close\", 10, \"\", symbol)\n\n        return selected\n\n\n    def on_data(self, data):\n        if self.portfolio.invested:\n            return\n\n        # we can get history in initialize to set up indicators and such\n        self.spy_daily_sma = SimpleMovingAverage(14)\n\n        # get the last calendar year's worth of SPY data at the configured resolution (daily)\n        trade_bar_history = self.history([\"SPY\"], timedelta(365))\n        self.assert_history_index(trade_bar_history, \"close\", 251, \"SPY\", self.spy)\n\n        # get the last calendar year's worth of EURUSD data at the configured resolution (daily)\n        quote_bar_history = self.history([\"EURUSD\"], timedelta(298))\n        self.assert_history_index(quote_bar_history, \"bidclose\", 251, \"EURUSD\", self.eur)\n\n        option_history = self.history([self.option], timedelta(3))\n        option_history.index = option_history.index.droplevel(level=[0,1,2])\n        self.assert_history_index(option_history, \"bidclose\", 390, \"\", self.option)\n\n        # get the last calendar year's worth of quandl data at the configured resolution (daily)\n        quandl_history = self.history(QuandlFuture, \"CHRIS/CME_SP1\", timedelta(365))\n        self.assert_history_index(quandl_history, \"settle\", 251, \"CHRIS/CME_SP1\", self.sp1)\n\n        # we can loop over the return value from these functions and we get TradeBars\n        # we can use these TradeBars to initialize indicators or perform other math\n        self.spy_daily_sma.reset()\n        for index, trade_bar in trade_bar_history.loc[\"SPY\"].iterrows():\n            self.spy_daily_sma.update(index, trade_bar[\"close\"])\n\n        # we can loop over the return values from these functions and we'll get Quandl data\n        # this can be used in much the same way as the trade_bar_history above\n        self.spy_daily_sma.reset()\n        for index, quandl in quandl_history.loc[\"CHRIS/CME_SP1\"].iterrows():\n            self.spy_daily_sma.update(index, quandl[\"settle\"])\n\n        self.set_holdings(self.eur, 1)\n\n    def assert_history_index(self, df, column, expected, ticker, symbol):\n\n        if df.empty:\n            raise AssertionError(f\"Empty history data frame for {symbol}\")\n        if column not in df:\n            raise AssertionError(f\"Could not unstack df. Columns: {', '.join(df.columns)} | {column}\")\n\n        value = df.iat[0,0]\n        df2 = df.xs(df.index.get_level_values('time')[0], level='time')\n        df3 = df[column].unstack(level=0)\n\n        try:\n\n            # str(Symbol.ID)\n            self.assert_history_count(f\"df.iloc[0]\", df.iloc[0], len(df.columns))\n            self.assert_history_count(f\"df.loc[str({symbol.id})]\", df.loc[str(symbol.id)], expected)\n            self.assert_history_count(f\"df.xs(str({symbol.id}))\", df.xs(str(symbol.id)), expected)\n            self.assert_history_count(f\"df.at[(str({symbol.id}),), '{column}']\", list(df.at[(str(symbol.id),), column]), expected)\n            self.assert_history_count(f\"df2.loc[str({symbol.id})]\", df2.loc[str(symbol.id)], len(df2.columns))\n            self.assert_history_count(f\"df3[str({symbol.id})]\", df3[str(symbol.id)], expected)\n            self.assert_history_count(f\"df3.get(str({symbol.id}))\", df3.get(str(symbol.id)), expected)\n\n            # str(Symbol)\n            self.assert_history_count(f\"df.loc[str({symbol})]\", df.loc[str(symbol)], expected)\n            self.assert_history_count(f\"df.xs(str({symbol}))\", df.xs(str(symbol)), expected)\n            self.assert_history_count(f\"df.at[(str({symbol}),), '{column}']\", list(df.at[(str(symbol),), column]), expected)\n            self.assert_history_count(f\"df2.loc[str({symbol})]\", df2.loc[str(symbol)], len(df2.columns))\n            self.assert_history_count(f\"df3[str({symbol})]\", df3[str(symbol)], expected)\n            self.assert_history_count(f\"df3.get(str({symbol}))\", df3.get(str(symbol)), expected)\n\n            # str : Symbol.VALUE\n            if len(ticker) == 0:\n                return\n            self.assert_history_count(f\"df.loc[{ticker}]\", df.loc[ticker], expected)\n            self.assert_history_count(f\"df.xs({ticker})\", df.xs(ticker), expected)\n            self.assert_history_count(f\"df.at[(ticker,), '{column}']\", list(df.at[(ticker,), column]), expected)\n            self.assert_history_count(f\"df2.loc[{ticker}]\", df2.loc[ticker], len(df2.columns))\n            self.assert_history_count(f\"df3[{ticker}]\", df3[ticker], expected)\n            self.assert_history_count(f\"df3.get({ticker})\", df3.get(ticker), expected)\n\n        except Exception as e:\n            symbols = set(df.index.get_level_values(level='symbol'))\n            raise AssertionError(f\"{symbols}, {symbol.id}, {symbol}, {ticker}. {e}\")\n\n\n    def assert_history_count(self, method_call, trade_bar_history, expected):\n        if isinstance(trade_bar_history, list):\n            count = len(trade_bar_history)\n        else:\n            count = len(trade_bar_history.index)\n        if count != expected:\n            raise AssertionError(f\"{method_call} expected {expected}, but received {count}\")\n\n\nclass QuandlFuture(PythonQuandl):\n    '''Custom quandl data type for setting customized value column name. Value column is used for the primary trading calculations and charting.'''\n    def __init__(self):\n        self.value_column_name = \"Settle\"\n"
  },
  {
    "path": "Algorithm.Python/ParameterizedAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of the parameter system of QuantConnect. Using parameters you can pass the values required into C# algorithms for optimization.\n### </summary>\n### <meta name=\"tag\" content=\"optimization\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\nclass ParameterizedAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 7)   #Set Start Date\n        self.set_end_date(2013, 10, 11)    #Set End Date\n        self.set_cash(100000)             #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n\n        # Receive parameters from the Job\n        fast_period = self.get_parameter(\"ema-fast\", 100)\n        slow_period = self.get_parameter(\"ema-slow\", 200)\n\n        self.fast = self.ema(\"SPY\", fast_period)\n        self.slow = self.ema(\"SPY\", slow_period)\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n\n        # wait for our indicators to ready\n        if not self.fast.is_ready or not self.slow.is_ready:\n            return\n\n        fast = self.fast.current.value\n        slow = self.slow.current.value\n\n        if fast > slow * 1.001:\n            self.set_holdings(\"SPY\", 1)\n        elif fast < slow * 0.999:\n            self.liquidate(\"SPY\")\n"
  },
  {
    "path": "Algorithm.Python/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.PearsonCorrelationPairsTradingAlphaModel import PearsonCorrelationPairsTradingAlphaModel\n\n### <summary>\n### Framework algorithm that uses the PearsonCorrelationPairsTradingAlphaModel.\n### This model extendes BasePairsTradingAlphaModel and uses Pearson correlation\n### to rank the pairs trading candidates and use the best candidate to trade.\n### </summary>\nclass PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm(QCAlgorithm):\n    '''Framework algorithm that uses the PearsonCorrelationPairsTradingAlphaModel.\n    This model extendes BasePairsTradingAlphaModel and uses Pearson correlation\n    to rank the pairs trading candidates and use the best candidate to trade.'''\n\n    def initialize(self):\n\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n\n        symbols = [Symbol.create(ticker, SecurityType.EQUITY, Market.USA)\n            for ticker in [\"SPY\", \"AIG\", \"BAC\", \"IBM\"]]\n\n        # Manually add SPY and AIG when the algorithm starts\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols[:2]))\n\n        # At midnight, add all securities every day except on the last data\n        # With this procedure, the Alpha Model will experience multiple universe changes\n        self.add_universe_selection(ScheduledUniverseSelectionModel(\n            self.date_rules.every_day(), self.time_rules.midnight,\n            lambda dt: symbols if dt.day <= (self.end_date - timedelta(1)).day else []))\n\n        self.set_alpha(PearsonCorrelationPairsTradingAlphaModel(252, Resolution.DAILY))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(ImmediateExecutionModel())\n        self.set_risk_management(NullRiskManagementModel())\n\n    def on_end_of_algorithm(self) -> None:\n        # We have removed all securities from the universe. The Alpha Model should remove the consolidator\n        consolidator_count = sum(s.consolidators.count for s in self.subscription_manager.subscriptions)\n        if consolidator_count > 0:\n            raise AssertionError(f\"The number of consolidator should be zero. Actual: {consolidator_count}\")\n"
  },
  {
    "path": "Algorithm.Python/PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm for testing that period-based history requests are not allowed with tick resolution\n### </summary>\nclass PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 9)\n\n        spy = self.add_equity(\"SPY\", Resolution.TICK).symbol\n\n        # Tick resolution is not allowed for period-based history requests\n        self.assert_that_history_throws_for_tick_resolution(lambda: self.history[Tick](spy, 1),\n            \"Tick history call with implicit tick resolution\")\n        self.assert_that_history_throws_for_tick_resolution(lambda: self.history[Tick](spy, 1, Resolution.TICK),\n            \"Tick history call with explicit tick resolution\")\n        self.assert_that_history_throws_for_tick_resolution(lambda: self.history[Tick]([spy], 1),\n            \"Tick history call with symbol array with implicit tick resolution\")\n        self.assert_that_history_throws_for_tick_resolution(lambda: self.history[Tick]([spy], 1, Resolution.TICK),\n            \"Tick history call with symbol array with explicit tick resolution\")\n\n        history = self.history[Tick](spy, TimeSpan.from_hours(12))\n        # Check whether history has data without enumerating the whole list\n        if not any(x for x in history):\n            raise AssertionError(\"On history call with implicit tick resolution: history returned no results\")\n\n        history = self.history[Tick](spy, TimeSpan.from_hours(12), Resolution.TICK)\n        if not any(x for x in history):\n            raise AssertionError(\"On history call with explicit tick resolution: history returned no results\")\n\n        # We already tested what we wanted to test, we can quit now\n        self.quit()\n\n    def assert_that_history_throws_for_tick_resolution(self, history_call, history_call_description):\n        try:\n            history_call()\n            raise AssertionError(f\"{history_call_description}: expected an exception to be thrown\")\n        except InvalidOperationException:\n            # expected\n            pass\n"
  },
  {
    "path": "Algorithm.Python/PersistentCustomDataUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import timedelta\nfrom AlgorithmImports import *\n\n### <summary>\n### Adds a universe with a custom data type and retrieves historical data \n### while preserving the custom data type.\n### </summary>\nclass PersistentCustomDataUniverseRegressionAlgorithm(QCAlgorithm):\n\n    def Initialize(self):\n        self.set_start_date(2018, 6, 1)\n        self.set_end_date(2018, 6, 19)\n\n        universe = self.add_universe(StockDataSource, \"my-stock-data-source\", Resolution.DAILY, self.universe_selector)\n        self._universe_symbol = universe.symbol\n        self.retrieve_historical_data()\n        self._data_received = False\n\n    def universe_selector(self, data):\n        return [x.symbol for x in data]\n    \n    def retrieve_historical_data(self):\n        history = list(self.history[StockDataSource](self._universe_symbol, datetime(2018, 1, 1), datetime(2018, 6, 1), Resolution.DAILY))\n        if (len(history) == 0):\n            raise AssertionError(f\"No historical data received for symbol {self._universe_symbol}.\")\n\n        # Ensure all values are of type StockDataSource\n        for item in history:\n            if not isinstance(item, StockDataSource):\n                raise AssertionError(f\"Unexpected data type in history. Expected StockDataSource but received {type(item).__name__}.\")\n    \n    def OnData(self, slice: Slice):\n        if self._universe_symbol not in slice:\n            raise AssertionError(f\"No data received for the universe symbol: {self._universe_symbol}.\")\n        if (not self._data_received):\n            self.retrieve_historical_data()\n        self._data_received = True\n        \n    def OnEndOfAlgorithm(self) -> None:\n        if not self._data_received:\n            raise AssertionError(\"No data was received after the universe selection.\")\n\nclass StockDataSource(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        source = \"../../../Tests/TestData/daily-stock-picker-backtest.csv\"\n        return SubscriptionDataSource(source)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        if not (line.strip() and line[0].isdigit()): return None\n\n        stocks = StockDataSource()\n        stocks.symbol = config.symbol\n\n        try:\n            csv = line.split(',')\n            stocks.time = datetime.strptime(csv[0], \"%Y%m%d\")\n            stocks.end_time = stocks.time + self.period\n            stocks[\"Symbols\"] = csv[1:]\n\n        except ValueError:\n            return None\n\n        return stocks\n    @property\n    def period(self) -> timedelta:\n        return timedelta(days=1)\n"
  },
  {
    "path": "Algorithm.Python/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing portfolio construction model control over rebalancing,\n### specifying a custom rebalance function that returns null in some cases, see GH 4075.\n### </summary>\nclass PortfolioRebalanceOnCustomFuncRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2015, 1, 1)\n        self.set_end_date(2018, 1, 1)\n\n        self.settings.rebalance_portfolio_on_insight_changes = False\n        self.settings.rebalance_portfolio_on_security_changes = False\n\n        self.set_universe_selection(CustomUniverseSelectionModel(\"CustomUniverseSelectionModel\", lambda time: [ \"AAPL\", \"IBM\", \"FB\", \"SPY\", \"AIG\", \"BAC\", \"BNO\" ]))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, TimeSpan.from_minutes(20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(self.rebalance_function))\n        self.set_execution(ImmediateExecutionModel())\n        self.last_rebalance_time = self.start_date\n\n    def rebalance_function(self, time):\n        # for performance only run rebalance logic once a week, monday\n        if time.weekday() != 0:\n            return None\n\n        if self.last_rebalance_time == self.start_date:\n            # initial rebalance\n            self.last_rebalance_time = time\n            return time\n\n        deviation = 0\n        count = sum(1 for security in self.securities.values() if security.invested)\n        if count > 0:\n            self.last_rebalance_time = time\n            portfolio_value_per_security = self.portfolio.total_portfolio_value / count\n            for security in self.securities.values():\n                if not security.invested:\n                    continue\n                reserved_buying_power_for_current_position = (security.buying_power_model.get_reserved_buying_power_for_position(\n                    ReservedBuyingPowerForPositionParameters(security)).absolute_used_buying_power\n                                                         * security.buying_power_model.get_leverage(security)) # see GH issue 4107\n                # we sum up deviation for each security\n                deviation += (portfolio_value_per_security - reserved_buying_power_for_current_position) / portfolio_value_per_security\n\n            # if securities are deviated 1.5% from their theoretical share of TotalPortfolioValue we rebalance\n            if deviation >= 0.015:\n                return time\n        return None\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.SUBMITTED:\n            if self.utc_time != self.last_rebalance_time or self.utc_time.weekday() != 0:\n                raise ValueError(f\"{self.utc_time} {order_event.symbol}\")\n"
  },
  {
    "path": "Algorithm.Python/PortfolioRebalanceOnDateRulesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing portfolio construction model control over rebalancing,\n### specifying a date rules, see GH 4075.\n### </summary>\nclass PortfolioRebalanceOnDateRulesRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        # let's use 0 minimum order margin percentage so we can assert trades are only submitted immediately after rebalance on Wednesday\n        # if not, due to TPV variations happening every day we might no cross the minimum on wednesday but yes another day of the week\n        self.settings.minimum_order_margin_portfolio_percentage = 0\n\n        self.set_start_date(2015,1,1)\n        self.set_end_date(2017,1,1)\n\n        self.settings.rebalance_portfolio_on_insight_changes = False\n        self.settings.rebalance_portfolio_on_security_changes = False\n\n        self.set_universe_selection(CustomUniverseSelectionModel(\"CustomUniverseSelectionModel\", lambda time: [ \"AAPL\", \"IBM\", \"FB\", \"SPY\" ]))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, TimeSpan.from_minutes(20), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(self.date_rules.every(DayOfWeek.WEDNESDAY)))\n        self.set_execution(ImmediateExecutionModel())\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.SUBMITTED:\n            self.debug(str(order_event))\n            if self.utc_time.weekday() != 2:\n                raise ValueError(str(self.utc_time) + \" \" + str(order_event.symbol) + \" \" + str(self.utc_time.weekday()))\n"
  },
  {
    "path": "Algorithm.Python/PortfolioTargetTagsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm demonstrating the portfolio target tags usage\n### </summary>\nclass PortfolioTargetTagsRegressionAlgorithm(QCAlgorithm):\n    '''Algorithm demonstrating the portfolio target tags usage'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        symbols = [ Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA) ]\n\n        # set algorithm framework models\n        self.set_universe_selection(ManualUniverseSelectionModel(symbols))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))\n\n        self.set_portfolio_construction(CustomPortfolioConstructionModel())\n        self.set_risk_management(CustomRiskManagementModel())\n        self.set_execution(CustomExecutionModel(self.set_target_tags_checked))\n\n        self.target_tags_checked = False\n\n    def set_target_tags_checked(self):\n        self.target_tags_checked = True\n\n    def on_end_of_algorithm(self):\n        if not self.target_tags_checked:\n            raise AssertionError(\"The portfolio targets tag were not checked\")\n\nclass CustomPortfolioConstructionModel(EqualWeightingPortfolioConstructionModel):\n    def __init__(self):\n        super().__init__(Resolution.DAILY)\n\n    def create_targets(self, algorithm: QCAlgorithm, insights: List[Insight]) -> List[IPortfolioTarget]:\n        targets = super().create_targets(algorithm, insights)\n        return CustomPortfolioConstructionModel.add_p_portfolio_targets_tags(targets)\n\n    @staticmethod\n    def generate_portfolio_target_tag(target: IPortfolioTarget) -> str:\n        return f\"Portfolio target tag: {target.symbol} - {target.quantity:g}\"\n\n    @staticmethod\n    def add_p_portfolio_targets_tags(targets: Iterable[IPortfolioTarget]) -> List[IPortfolioTarget]:\n        return [PortfolioTarget(target.symbol, target.quantity, CustomPortfolioConstructionModel.generate_portfolio_target_tag(target))\n                for target in targets]\n\nclass CustomRiskManagementModel(MaximumDrawdownPercentPerSecurity):\n    def __init__(self):\n        super().__init__(0.01)\n\n    def manage_risk(self, algorithm: QCAlgorithm, targets: List[IPortfolioTarget]) -> List[IPortfolioTarget]:\n        risk_managed_targets = super().manage_risk(algorithm, targets)\n        return CustomPortfolioConstructionModel.add_p_portfolio_targets_tags(risk_managed_targets)\n\nclass CustomExecutionModel(ImmediateExecutionModel):\n    def __init__(self, targets_tag_checked_callback: Callable) -> None:\n        super().__init__()\n        self.targets_tag_checked_callback = targets_tag_checked_callback\n\n    def execute(self, algorithm: QCAlgorithm, targets: List[IPortfolioTarget]) -> None:\n        if len(targets) > 0:\n            self.targets_tag_checked_callback()\n\n        for target in targets:\n            expected_tag = CustomPortfolioConstructionModel.generate_portfolio_target_tag(target)\n            if target.tag != expected_tag:\n                raise AssertionError(f\"Unexpected portfolio target tag: {target.tag} - Expected: {expected_tag}\")\n\n        super().execute(algorithm, targets)\n"
  },
  {
    "path": "Algorithm.Python/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Algorithm.Python\")]\n[assembly: AssemblyProduct(\"QuantConnect.Algorithm.Python\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"7007a02a-8d01-4a85-84e4-fcd58dc943e2\")]"
  },
  {
    "path": "Algorithm.Python/PythonAlgorithm.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Python\n{\n    /*  This is a place holder project for the build script & python file configurations.\n     *  \n     *  It compiles to a DLL which is deleted after compilation by the python builder.\n     */\n}\n"
  },
  {
    "path": "Algorithm.Python/PythonDictionaryFeatureRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm showing that Slice, Securities and Portfolio behave as a Python Dictionary\n### </summary>\nclass PythonDictionaryFeatureRegressionAlgorithm(QCAlgorithm):\n    '''Example algorithm showing that Slice, Securities and Portfolio behave as a Python Dictionary'''\n\n    def initialize(self):\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.spy_symbol = self.add_equity(\"SPY\").symbol\n        self.ibm_symbol = self.add_equity(\"IBM\").symbol\n        self.aig_symbol = self.add_equity(\"AIG\").symbol\n        self.aapl_symbol = Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)\n\n        date_rules = self.date_rules.on(2013, 10, 7)\n        self.schedule.on(date_rules, self.time_rules.at(13, 0), self.test_securities_dictionary)\n        self.schedule.on(date_rules, self.time_rules.at(14, 0), self.test_portfolio_dictionary)\n        self.schedule.on(date_rules, self.time_rules.at(15, 0), self.test_slice_dictionary)\n\n    def test_slice_dictionary(self):\n        slice = self.current_slice\n\n        symbols = ', '.join([f'{x}' for x in slice.keys()])\n        slice_data = ', '.join([f'{x}' for x in slice.values()])\n        slice_bars = ', '.join([f'{x}' for x in slice.bars.values()])\n\n        if \"SPY\" not in slice:\n            raise AssertionError('SPY (string) is not in Slice')\n\n        if self.spy_symbol not in slice:\n            raise AssertionError('SPY (Symbol) is not in Slice')\n\n        spy = slice.get(self.spy_symbol)\n        if spy is None:\n            raise AssertionError('SPY is not in Slice')\n\n        for symbol, bar in slice.bars.items():\n            self.plot(symbol, 'Price', bar.close)\n\n\n    def test_securities_dictionary(self):\n        symbols = ', '.join([f'{x}' for x in self.securities.keys()])\n        leverages = ', '.join([str(x.get_last_data()) for x in self.securities.values()])\n\n        if \"IBM\" not in self.securities:\n            raise AssertionError('IBM (string) is not in Securities')\n\n        if self.ibm_symbol not in self.securities:\n            raise AssertionError('IBM (Symbol) is not in Securities')\n\n        ibm = self.securities.get(self.ibm_symbol)\n        if ibm is None:\n            raise AssertionError('ibm is None')\n\n        aapl = self.securities.get(self.aapl_symbol)\n        if aapl is not None:\n            raise AssertionError('aapl is not None')\n\n        for symbol, security in self.securities.items():\n            self.plot(symbol, 'Price', security.price)\n\n    def test_portfolio_dictionary(self):\n        symbols = ', '.join([f'{x}' for x in self.portfolio.keys()])\n        leverages = ', '.join([f'{x.symbol}: {x.leverage}' for x in self.portfolio.values()])\n\n        if \"AIG\" not in self.securities:\n            raise AssertionError('AIG (string) is not in Portfolio')\n\n        if self.aig_symbol not in self.securities:\n            raise AssertionError('AIG (Symbol) is not in Portfolio')\n\n        aig = self.portfolio.get(self.aig_symbol)\n        if aig is None:\n            raise AssertionError('aig is None')\n\n        aapl = self.portfolio.get(self.aapl_symbol)\n        if aapl is not None:\n            raise AssertionError('aapl is not None')\n\n        for symbol, holdings in self.portfolio.items():\n            msg = f'{symbol}: {holdings.leverage}'\n\n    def on_end_of_algorithm(self):\n\n        portfolio_copy = self.portfolio.copy()\n        try:\n            self.portfolio.clear()  # Throws exception\n        except Exception as e:\n            self.debug(e)\n\n        bar = self.securities.pop(\"SPY\")\n        length = len(self.securities)\n        if length != 2:\n            raise AssertionError(f'After popping SPY, Securities should have 2 elements, {length} found')\n\n        securities_copy = self.securities.copy()\n        self.securities.clear()    # Does not throw\n\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1/3)\n            self.set_holdings(\"IBM\", 1/3)\n            self.set_holdings(\"AIG\", 1/3)\n"
  },
  {
    "path": "Algorithm.Python/PytorchNeuralNetworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport torch\nimport torch.nn.functional as F\n\nclass PytorchNeuralNetworkAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)  # Set Start Date\n        self.set_end_date(2013, 10, 8) # Set End Date\n        \n        self.set_cash(100000)  # Set Strategy Cash\n        \n        # add symbol\n        spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n        self._symbols = [spy.symbol] # using a list can extend to condition for multiple symbols\n        \n        self._lookback = 30 # days of historical data (look back)\n        \n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 28), self.net_train) # train the NN\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 30), self.trade)\n    \n    def net_train(self) -> None:\n        # Daily historical data is used to train the machine learning model\n        history = self.history(self._symbols, self._lookback + 1, Resolution.DAILY)\n        \n        # dicts that store prices for training\n        self.prices_x = {} \n        self.prices_y = {}\n        \n        # dicts that store prices for sell and buy\n        self.sell_prices = {}\n        self.buy_prices = {}\n        \n        for symbol in self._symbols:\n            if not history.empty:\n                # x: preditors; y: response\n                self.prices_x[symbol] = list(history.loc[symbol.value]['open'])[:-1]\n                self.prices_y[symbol] = list(history.loc[symbol.value]['open'])[1:]\n                \n        for symbol in self._symbols:\n            # if this symbol has historical data\n            if symbol in self.prices_x:\n                net = Net(n_feature=1, n_hidden=10, n_output=1)     # define the network\n                optimizer = torch.optim.SGD(net.parameters(), lr=0.2)\n                loss_func = torch.nn.MSELoss()  # this is for regression mean squared loss\n                \n                for t in range(200):\n                    # Get data and do preprocessing\n                    x = torch.from_numpy(np.array(self.prices_x[symbol])).float()\n                    y = torch.from_numpy(np.array(self.prices_y[symbol])).float()\n                    \n                    # unsqueeze data (see pytorch doc for details)\n                    x = x.unsqueeze(1) \n                    y = y.unsqueeze(1)\n                \n                    prediction = net(x)     # input x and predict based on x\n\n                    loss = loss_func(prediction, y)     # must be (1. nn output, 2. target)\n\n                    optimizer.zero_grad()   # clear gradients for next train\n                    loss.backward()         # backpropagation, compute gradients\n                    optimizer.step()        # apply gradients\n            \n            # Follow the trend    \n            self.buy_prices[symbol] = net(y)[-1] + np.std(y.data.numpy())\n            self.sell_prices[symbol] = net(y)[-1] - np.std(y.data.numpy())\n        \n    def trade(self) -> None:\n        ''' \n        Enter or exit positions based on relationship of the open price of the current bar and the prices defined by the machine learning model.\n        Liquidate if the open price is below the sell price and buy if the open price is above the buy price \n        ''' \n        for holding in self.portfolio.values():\n            bar = self.current_slice.bars.get(holding.symbol, None)\n            if bar and bar.open < self.sell_prices[holding.symbol] and holding.invested:\n                self.liquidate(holding.symbol)\n            elif bar and bar.open > self.buy_prices[holding.symbol] and not holding.invested:\n                self.set_holdings(holding.symbol, 1 / len(self._symbols))\n\n            \n        \n# class for Pytorch NN model\nclass Net(torch.nn.Module):\n    def __init__(self, n_feature: int, n_hidden: int, n_output: int) -> None:\n        super(Net, self).__init__()\n        self.hidden = torch.nn.Linear(n_feature, n_hidden)   # hidden layer\n        self.predict = torch.nn.Linear(n_hidden, n_output)   # output layer\n    \n    def forward(self, x: torch.Tensor) -> torch.Tensor:\n        x = F.relu(self.hidden(x))      # activation function for hidden layer\n        x = self.predict(x)             # linear output\n        return x\n"
  },
  {
    "path": "Algorithm.Python/QLOptionPricingModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example demonstrates how to override the option pricing model with the\n### <see cref=\"QLOptionPriceModel\"/> for a given option security.\n### </summary>\nclass QLOptionPricingModelRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2015, 12, 24)\n        self.set_end_date(2015, 12, 24)\n        self.set_cash(100000)\n\n        equity = self.add_equity(\"GOOG\")\n        self._option = self.add_option(equity.symbol)\n        self._option.set_filter(lambda u: u.strikes(-2, +2).expiration(0, 180))\n\n        # Set the option price model to the default QL model\n        self._option.set_price_model(QLOptionPriceModelProvider.INSTANCE.get_option_price_model(self._option.symbol))\n\n        if not isinstance(self._option.price_model, QLOptionPriceModel):\n            raise Exception(\"Option pricing model was not set to QLOptionPriceModel, which should be the default\")\n\n        self._checked = False\n\n    def on_data(self, slice):\n        if self._checked:\n            return;\n\n        chain = slice.option_chains.get(self._option.symbol)\n        if chain is not None:\n            if not isinstance(self._option.price_model, QLOptionPriceModel):\n                raise Exception(\"Option pricing model was not set to QLOptionPriceModel\");\n\n            for contract in chain:\n                theoretical_price = contract.theoretical_price\n                iv = contract.implied_volatility\n                greeks = contract.greeks\n                self.log(f\"{contract.symbol}:: Theoretical Price: {theoretical_price}, IV: {iv}, \" +\n                       f\"Delta: {greeks.delta}, Gamma: {greeks.gamma}, Vega: {greeks.vega}, \" +\n                       f\"Theta: {greeks.theta}, Rho: {greeks.rho}, Lambda: {greeks.lambda_}\")\n                self._checked = True\n\n    def on_end_of_algorithm(self):\n        if not self._checked:\n            raise Exception(\"Option chain was never received.\")\n"
  },
  {
    "path": "Algorithm.Python/QuantConnect.Algorithm.Python.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Algorithm.Python</RootNamespace>\n    <AssemblyName>QuantConnect.Algorithm.Python</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Algorithm.Python Project - A collection of Py algorithm demonstrations for how to use the API</Description>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PostBuildEvent Condition=\"'$(OS)' == 'Windows_NT' \">\n      build\n    </PostBuildEvent>\n    <PostBuildEvent Condition=\"'$(OS)' != 'Windows_NT'\">\n      ./build.sh\n    </PostBuildEvent>\n  </PropertyGroup>\n  <ItemGroup>\n    <None Remove=\"CustomDataTypeHistoryAlgorithm.py\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"OptionUniverseFilterGreeksShortcutsRegressionAlgorithm.py\" />\n    <Content Include=\"OptionUniverseFilterOptionsDataRegressionAlgorithm.py\" />\n    <Content Include=\"OptionUniverseFilterGreeksRegressionAlgorithm.py\" />\n    <Content Include=\"FutureUniverseHistoryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionChainFullDataRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionChainsMultipleFullDataRegressionAlgorithm.py\" />\n    <Content Include=\"FuturesChainFullDataRegressionAlgorithm.py\" />\n    <Content Include=\"FuturesChainsMultipleFullDataRegressionAlgorithm.py\" />\n    <Content Include=\"OptionUniverseHistoryRegressionAlgorithm.py\" />\n    <Content Include=\"FundamentalUniverseSelectionAlgorithm.py\" />\n    <Content Include=\"AccumulativeInsightPortfolioRegressionAlgorithm.py\" />\n    <Content Include=\"CustomDataTypeHistoryAlgorithm.py\" />\n    <Content Include=\"CorrectConsolidatedBarTypeForTickTypesAlgorithm.py\" />\n    <Content Include=\"IndustryStandardSecurityIdentifiersRegressionAlgorithm.py\" />\n    <Content Include=\"AddAlphaModelAlgorithm.py\" />\n    <Content Include=\"AddFutureOptionContractDataStreamingRegressionAlgorithm.py\" />\n    <Content Include=\"AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py\" />\n    <Content Include=\"AddOptionContractExpiresRegressionAlgorithm.py\" />\n    <Content Include=\"AddOptionContractFromUniverseRegressionAlgorithm.py\" />\n    <Content Include=\"CustomMarginInterestRateModelAlgorithm.py\" />\n    <Content Include=\"CustomPartialFillModelAlgorithm.py\" />\n    <Content Include=\"AddRiskManagementAlgorithm.py\" />\n    <Content Include=\"AddUniverseSelectionModelAlgorithm.py\" />\n    <Content Include=\"IndicatorWithRenkoBarsRegressionAlgorithm.py\" />\n    <Content Include=\"Alphas\\ContingentClaimsAnalysisDefaultPredictionAlpha.py\" />\n    <Content Include=\"Alphas\\GasAndCrudeOilEnergyCorrelationAlpha.py\" />\n    <Content Include=\"Alphas\\GlobalEquityMeanReversionIBSAlpha.py\" />\n    <Content Include=\"Alphas\\IntradayReversalCurrencyMarketsAlpha.py\" />\n    <Content Include=\"Alphas\\GreenblattMagicFormulaAlpha.py\" />\n    <Content Include=\"Alphas\\MeanReversionLunchBreakAlpha.py\" />\n    <Content Include=\"Alphas\\PriceGapMeanReversionAlpha.py\" />\n    <Content Include=\"Alphas\\SykesShortMicroCapAlpha.py\" />\n    <Content Include=\"Alphas\\RebalancingLeveragedETFAlpha.py\" />\n    <Content Include=\"Alphas\\TriangleExchangeRateArbitrageAlpha.py\" />\n    <Content Include=\"Alphas\\ShareClassMeanReversionAlpha.py\" />\n    <Content Include=\"Alphas\\TripleLeverageETFPairVolatilityDecayAlpha.py\" />\n    <Content Include=\"Alphas\\VIXDualThrustAlpha.py\" />\n    <Content Include=\"BasicCSharpIntegrationTemplateAlgorithm.py\" />\n    <Content Include=\"BasicSetAccountCurrencyAlgorithm.py\" />\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"InceptionDateSelectionRegressionAlgorithm.py\" />\n    <None Include=\"PandasDataFrameHistoryAlgorithm.py\" />\n    <None Include=\"CustomDataIconicTypesAddDataRegressionAlgorithm.py\" />\n    <None Include=\"TrainingExampleAlgorithm.py\" />\n    <None Include=\"LongOnlyAlphaStreamAlgorithm.py\" />\n    <Content Include=\"BasicTemplateOptionsConsolidationAlgorithm.py\" />\n    <None Include=\"BasicTemplateOptionsPriceModel.py\" />\n    <Content Include=\"CoarseFineOptionUniverseChainRegressionAlgorithm.py\" />\n    <Content Include=\"ConsolidateRegressionAlgorithm.py\" />\n    <Content Include=\"CustomConsolidatorRegressionAlgorithm.py\" />\n    <Content Include=\"CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py\" />\n    <Content Include=\"CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py\" />\n    <None Include=\"CustomBuyingPowerModelAlgorithm.py\" />\n    <Content Include=\"CustomDataPropertiesRegressionAlgorithm.py\" />\n    <Content Include=\"ConfidenceWeightedFrameworkAlgorithm.py\" />\n    <Content Include=\"DynamicSecurityDataRegressionAlgorithm.py\" />\n    <Content Include=\"ExtendedMarketTradingRegressionAlgorithm.py\" />\n    <Content Include=\"FilterUniverseRegressionAlgorithm.py\" />\n    <Content Include=\"FineFundamentalFilteredUniverseRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionBuySellCallIntradayRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionCallITMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionCallOTMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionPutITMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionPutOTMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionShortCallITMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionShortCallOTMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionShortPutITMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FutureOptionShortPutOTMExpiryRegressionAlgorithm.py\" />\n    <Content Include=\"FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.py\" />\n    <Content Include=\"KerasNeuralNetworkAlgorithm.py\" />\n    <Content Include=\"CustomDataUsingMapFileRegressionAlgorithm.py\" />\n    <Content Include=\"LiquidETFUniverseFrameworkAlgorithm.py\" />\n    <Content Include=\"ObjectStoreExampleAlgorithm.py\" />\n    <Content Include=\"LiveFeaturesAlgorithm.py\" />\n    <Content Include=\"PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py\" />\n    <Content Include=\"PortfolioRebalanceOnDateRulesRegressionAlgorithm.py\" />\n    <Content Include=\"PythonDictionaryFeatureRegressionAlgorithm.py\" />\n    <Content Include=\"RegisterIndicatorRegressionAlgorithm.py\" />\n    <Content Include=\"SectorWeightingFrameworkAlgorithm.py\" />\n    <Content Include=\"SetHoldingsMultipleTargetsRegressionAlgorithm.py\" />\n    <Content Include=\"ShortableProviderOrdersRejectedRegressionAlgorithm.py\" />\n    <Content Include=\"SliceGetByTypeRegressionAlgorithm.py\" />\n    <Content Include=\"StringToSymbolImplicitConversionRegressionAlgorithm.py\" />\n    <Content Include=\"TalibIndicatorsAlgorithm.py\" />\n    <Content Include=\"OnEndOfDayRegressionAlgorithm.py\" />\n    <None Include=\"TrainingInitializeRegressionAlgorithm.py\" />\n    <Content Include=\"UniverseUnchangedRegressionAlgorithm.py\" />\n    <None Include=\"NLTKSentimentTradingAlgorithm.py\" />\n    <None Include=\"PytorchNeuralNetworkAlgorithm.py\" />\n    <None Include=\"RawPricesUniverseRegressionAlgorithm.py\" />\n    <None Include=\"CapmAlphaRankingFrameworkAlgorithm.py\" />\n    <None Include=\"ScikitLearnLinearRegressionAlgorithm.py\" />\n    <None Include=\"SmaCrossUniverseSelectionAlgorithm.py\" />\n    <Content Include=\"Benchmarks\\StatefulCoarseUniverseSelectionBenchmark.py\" />\n    <Content Include=\"Benchmarks\\StatelessCoarseUniverseSelectionBenchmark.py\" />\n    <Content Include=\"ConstituentsUniverseRegressionAlgorithm.py\" />\n    <Content Include=\"G10CurrencySelectionModelFrameworkAlgorithm.py\" />\n    <Content Include=\"ExpiryHelperAlphaModelFrameworkAlgorithm.py\" />\n    <Content Include=\"BasicTemplateFuturesFrameworkAlgorithm.py\" />\n    <Content Include=\"BasicTemplateOptionsFrameworkAlgorithm.py\" />\n    <Content Include=\"InsightWeightingFrameworkAlgorithm.py\" />\n    <None Include=\"CompositeRiskManagementModelFrameworkAlgorithm.py\" />\n    <None Include=\"BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py\" />\n    <None Include=\"TensorFlowNeuralNetworkAlgorithm.py\" />\n    <None Include=\"TiingoPriceAlgorithm.py\" />\n    <None Include=\"PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py\" />\n    <None Include=\"UniverseSelectionDefinitionsAlgorithm.py\" />\n    <None Include=\"ConstituentsQC500GeneratorAlgorithm.py\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"AddRemoveSecurityRegressionAlgorithm.py\" />\n    <None Include=\"BasicTemplateAlgorithm.py\" />\n    <None Include=\"BasicTemplateCryptoAlgorithm.py\" />\n    <None Include=\"BasicTemplateDailyAlgorithm.py\" />\n    <None Include=\"BasicTemplateFillForwardAlgorithm.py\" />\n    <None Include=\"BasicTemplateForexAlgorithm.py\" />\n    <None Include=\"BasicTemplateFrameworkAlgorithm.py\" />\n    <None Include=\"BasicTemplateFuturesAlgorithm.py\" />\n    <None Include=\"BasicTemplateFuturesConsolidationAlgorithm.py\" />\n    <None Include=\"BasicTemplateFuturesHistoryAlgorithm.py\" />\n    <None Include=\"BasicTemplateIntrinioEconomicData.py\" />\n    <None Include=\"BasicTemplateLibrary.py\" />\n    <None Include=\"BasicTemplateOptionsAlgorithm.py\" />\n    <None Include=\"BasicTemplateOptionsFilterUniverseAlgorithm.py\" />\n    <None Include=\"BasicTemplateOptionsHistoryAlgorithm.py\" />\n    <None Include=\"BasicTemplateOptionStrategyAlgorithm.py\" />\n    <None Include=\"BasicTemplateOptionTradesAlgorithm.py\" />\n    <None Include=\"BrokerageModelAlgorithm.py\" />\n    <None Include=\"BubbleAlgorithm.py\" />\n    <None Include=\"build.sh\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"build.bat\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"CoarseFineFundamentalComboAlgorithm.py\" />\n    <None Include=\"CoarseFineFundamentalRegressionAlgorithm.py\" />\n    <None Include=\"CoarseFundamentalTop3Algorithm.py\" />\n    <None Include=\"CompositeAlphaModelFrameworkAlgorithm.py\" />\n    <None Include=\"CustomBenchmarkAlgorithm.py\" />\n    <None Include=\"CustomChartingAlgorithm.py\" />\n    <None Include=\"CustomDataBitcoinAlgorithm.py\" />\n    <None Include=\"CustomDataIndicatorExtensionsAlgorithm.py\" />\n    <None Include=\"CustomDataNIFTYAlgorithm.py\" />\n    <None Include=\"CustomDataRegressionAlgorithm.py\" />\n    <None Include=\"CustomDataUniverseAlgorithm.py\" />\n    <None Include=\"CustomIndicatorAlgorithm.py\" />\n    <None Include=\"CustomModelsAlgorithm.py\" />\n    <None Include=\"CustomSecurityInitializerAlgorithm.py\" />\n    <None Include=\"CustomVolatilityModelAlgorithm.py\" />\n    <None Include=\"DailyAlgorithm.py\" />\n    <None Include=\"DataConsolidationAlgorithm.py\" />\n    <None Include=\"DelistingEventsAlgorithm.py\" />\n    <None Include=\"DisplacedMovingAverageRibbon.py\" />\n    <None Include=\"DividendAlgorithm.py\" />\n    <None Include=\"DropboxBaseDataUniverseSelectionAlgorithm.py\" />\n    <None Include=\"DropboxUniverseSelectionAlgorithm.py\" />\n    <None Include=\"DropboxCoarseFineAlgorithm.py\" />\n    <None Include=\"EmaCrossAlphaModelFrameworkRegressionAlgorithm.py\" />\n    <None Include=\"EmaCrossFuturesFrontMonthAlgorithm.py\" />\n    <None Include=\"EmaCrossUniverseSelectionAlgorithm.py\" />\n    <None Include=\"EmaCrossUniverseSelectionFrameworkAlgorithm.py\" />\n    <None Include=\"ETFGlobalRotationAlgorithm.py\" />\n    <None Include=\"FilteredIdentityAlgorithm.py\" />\n    <None Include=\"FinancialAdvisorDemoAlgorithm.py\" />\n    <None Include=\"FractionalQuantityRegressionAlgorithm.py\" />\n    <None Include=\"FuturesMomentumAlgorithm.py\" />\n    <None Include=\"HistoryAlgorithm.py\" />\n    <None Include=\"IndicatorWarmupAlgorithm.py\" />\n    <None Include=\"HourReverseSplitRegressionAlgorithm.py\" />\n    <None Include=\"HourSplitRegressionAlgorithm.py\" />\n    <None Include=\"IndicatorSuiteAlgorithm.py\" />\n    <None Include=\"LimitFillRegressionAlgorithm.py\" />\n    <None Include=\"MACDTrendAlgorithm.py\" />\n    <None Include=\"main.py\" />\n    <None Include=\"MarginCallEventsAlgorithm.py\" />\n    <None Include=\"MarketOnOpenOnCloseAlgorithm.py\" />\n    <None Include=\"MarketOnCloseOrderBufferRegressionAlgorithm.py\" />\n    <None Include=\"MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.py\" />\n    <None Include=\"MeanVarianceOptimizationFrameworkAlgorithm.py\" />\n    <None Include=\"MovingAverageCrossAlgorithm.py\" />\n    <None Include=\"MultipleSymbolConsolidationAlgorithm.py\" />\n    <None Include=\"OptionChainConsistencyRegressionAlgorithm.py\" />\n    <None Include=\"OptionChainProviderAlgorithm.py\" />\n    <None Include=\"OptionExerciseAssignRegressionAlgorithm.py\" />\n    <None Include=\"OptionOpenInterestRegressionAlgorithm.py\" />\n    <None Include=\"OptionRenameRegressionAlgorithm.py\" />\n    <None Include=\"OptionSplitRegressionAlgorithm.py\" />\n    <None Include=\"OrderTicketDemoAlgorithm.py\" />\n    <None Include=\"ParameterizedAlgorithm.py\" />\n    <None Include=\"readme.md\" />\n    <None Include=\"RawPricesCoarseUniverseAlgorithm.py\" />\n    <None Include=\"RegressionAlgorithm.py\" />\n    <None Include=\"RegressionChannelAlgorithm.py\" />\n    <None Include=\"ClassicRenkoConsolidatorAlgorithm.py\" />\n    <None Include=\"RollingWindowAlgorithm.py\" />\n    <None Include=\"ScheduledEventsAlgorithm.py\" />\n    <None Include=\"ScheduledQueuingAlgorithm.py\" />\n    <None Include=\"ScheduledUniverseSelectionModelRegressionAlgorithm.py\" />\n    <None Include=\"SectorExposureRiskFrameworkAlgorithm.py\" />\n    <None Include=\"StandardDeviationExecutionModelRegressionAlgorithm.py\" />\n    <None Include=\"TimeInForceAlgorithm.py\" />\n    <None Include=\"TrailingStopRiskFrameworkRegressionAlgorithm.py\" />\n    <None Include=\"UniverseSelectionRegressionAlgorithm.py\" />\n    <None Include=\"UpdateOrderRegressionAlgorithm.py\" />\n    <None Include=\"UserDefinedUniverseAlgorithm.py\" />\n    <None Include=\"VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py\" />\n    <None Include=\"WarmupAlgorithm.py\" />\n    <None Include=\"WarmupHistoryAlgorithm.py\" />\n    <None Include=\"WeeklyUniverseSelectionRegressionAlgorithm.py\" />\n    <None Include=\"Benchmarks\\BasicTemplateBenchmark.py\" />\n    <None Include=\"Benchmarks\\EmptyMinute400EquityBenchmark.py\" />\n    <None Include=\"Benchmarks\\EmptySingleSecuritySecondEquityBenchmark.py\" />\n    <None Include=\"Benchmarks\\HistoryRequestBenchmark.py\" />\n    <None Include=\"Benchmarks\\CoarseFineUniverseSelectionBenchmark.py\" />\n    <None Include=\"Benchmarks\\IndicatorRibbonBenchmark.py\" />\n    <None Include=\"Benchmarks\\ScheduledEventsBenchmark.py\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"ConvertToFrameworkAlgorithm.py\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"OptionDataNullReferenceRegressionAlgorithm.py\" />\n  </ItemGroup>\n  <PropertyGroup>\n    <PostBuildEvent Condition=\"'$(OS)' == 'Windows_NT' \">\n      build\n    </PostBuildEvent>\n    <PostBuildEvent Condition=\"'$(OS)' != 'Windows_NT'\">\n      ./build.sh\n    </PostBuildEvent>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "Algorithm.Python/QuantConnect.Algorithm.PythonTools.pyproj",
    "content": "<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>4a5ded1f-3e34-40e2-b1f2-9a8a02195508</ProjectGuid>\n    <ProjectHome>.</ProjectHome>\n    <StartupFile>\n    </StartupFile>\n    <SearchPath>\n    </SearchPath>\n    <WorkingDirectory>.</WorkingDirectory>\n    <OutputPath>.</OutputPath>\n    <Name>QuantConnect.Algorithm.PythonTools</Name>\n    <RootNamespace>QuantConnect.Algorithm.PythonTools</RootNamespace>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\n    <DebugSymbols>true</DebugSymbols>\n    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\n    <DebugSymbols>true</DebugSymbols>\n    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"AccumulativeInsightPortfolioRegressionAlgorithm.py\" />\n    <Compile Include=\"AddAlphaModelAlgorithm.py\" />\n    <Compile Include=\"AddRemoveSecurityRegressionAlgorithm.py\" />\n    <Compile Include=\"AddRiskManagementAlgorithm.py\" />\n    <Compile Include=\"AddUniverseSelectionModelAlgorithm.py\" />\n    <Compile Include=\"BasicCSharpIntegrationTemplateAlgorithm.py\" />\n    <Compile Include=\"BasicSetAccountCurrencyAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateConstituentUniverseAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateCryptoAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFuturesFrameworkAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateIntrinioEconomicData.py\" />\n    <Compile Include=\"BasicTemplateOptionsConsolidationAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionsFrameworkAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionsPriceModel.py\" />\n    <Compile Include=\"BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py\" />\n    <Compile Include=\"CapmAlphaRankingFrameworkAlgorithm.py\" />\n    <Compile Include=\"CoarseFundamentalTop3Algorithm.py\" />\n    <Compile Include=\"CompositeAlphaModelFrameworkAlgorithm.py\" />\n    <Compile Include=\"CompositeRiskManagementModelFrameworkAlgorithm.py\" />\n    <Compile Include=\"ConfidenceWeightedFrameworkAlgorithm.py\" />\n    <Compile Include=\"ConsolidateRegressionAlgorithm.py\" />\n    <Compile Include=\"ConstituentsUniverseRegressionAlgorithm.py\" />\n    <Compile Include=\"ConvertToFrameworkAlgorithm.py\" />\n    <Compile Include=\"CustomBuyingPowerModelAlgorithm.py\" />\n    <Compile Include=\"CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomDataIconicTypesAddDataRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomDataIndicatorExtensionsAlgorithm.py\" />\n    <Compile Include=\"CustomDataUsingMapFileRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomIndicatorAlgorithm.py\" />\n    <Compile Include=\"CustomVolatilityModelAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateDailyAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFillForwardAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateForexAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFrameworkAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFuturesAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFuturesConsolidationAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateFuturesHistoryAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateLibrary.py\" />\n    <Compile Include=\"BasicTemplateOptionsAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionsFilterUniverseAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionsHistoryAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionStrategyAlgorithm.py\" />\n    <Compile Include=\"BasicTemplateOptionTradesAlgorithm.py\" />\n    <Compile Include=\"BrokerageModelAlgorithm.py\" />\n    <Compile Include=\"BubbleAlgorithm.py\" />\n    <Compile Include=\"CoarseFineFundamentalComboAlgorithm.py\" />\n    <Compile Include=\"CoarseFineFundamentalRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomBenchmarkAlgorithm.py\" />\n    <Compile Include=\"CustomChartingAlgorithm.py\" />\n    <Compile Include=\"CustomDataBitcoinAlgorithm.py\" />\n    <Compile Include=\"CustomDataNIFTYAlgorithm.py\" />\n    <Compile Include=\"CustomDataRegressionAlgorithm.py\" />\n    <Compile Include=\"CustomDataUniverseAlgorithm.py\" />\n    <Compile Include=\"CustomModelsAlgorithm.py\" />\n    <Compile Include=\"CustomSecurityInitializerAlgorithm.py\" />\n    <Compile Include=\"DailyAlgorithm.py\" />\n    <Compile Include=\"DataConsolidationAlgorithm.py\" />\n    <Compile Include=\"DelistingEventsAlgorithm.py\" />\n    <Compile Include=\"DisplacedMovingAverageRibbon.py\" />\n    <Compile Include=\"DividendAlgorithm.py\" />\n    <Compile Include=\"DropboxBaseDataUniverseSelectionAlgorithm.py\" />\n    <Compile Include=\"DropboxCoarseFineAlgorithm.py\" />\n    <Compile Include=\"DropboxUniverseSelectionAlgorithm.py\" />\n    <Compile Include=\"EmaCrossFuturesFrontMonthAlgorithm.py\" />\n    <Compile Include=\"EmaCrossUniverseSelectionAlgorithm.py\" />\n    <Compile Include=\"EmaCrossUniverseSelectionFrameworkAlgorithm.py\" />\n    <Compile Include=\"ETFGlobalRotationAlgorithm.py\" />\n    <Compile Include=\"ExpiryHelperAlphaModelFrameworkAlgorithm.py\" />\n    <Compile Include=\"FilteredIdentityAlgorithm.py\" />\n    <Compile Include=\"FinancialAdvisorDemoAlgorithm.py\" />\n    <Compile Include=\"FractionalQuantityRegressionAlgorithm.py\" />\n    <Compile Include=\"FuturesMomentumAlgorithm.py\" />\n    <Compile Include=\"G10CurrencySelectionModelFrameworkAlgorithm.py\" />\n    <Compile Include=\"HistoryAlgorithm.py\" />\n    <Compile Include=\"HourReverseSplitRegressionAlgorithm.py\" />\n    <Compile Include=\"HourSplitRegressionAlgorithm.py\" />\n    <Compile Include=\"InceptionDateSelectionRegressionAlgorithm.py\" />\n    <Compile Include=\"IndicatorSuiteAlgorithm.py\" />\n    <Compile Include=\"IndicatorWarmupAlgorithm.py\" />\n    <Compile Include=\"InsightWeightingFrameworkAlgorithm.py\" />\n    <Compile Include=\"KerasNeuralNetworkAlgorithm.py\" />\n    <Compile Include=\"LimitFillRegressionAlgorithm.py\" />\n    <Compile Include=\"LiquidETFUniverseFrameworkAlgorithm.py\" />\n    <Compile Include=\"LiveFeaturesAlgorithm.py\" />\n    <Compile Include=\"LongOnlyAlphaStreamAlgorithm.py\" />\n    <Compile Include=\"MACDTrendAlgorithm.py\" />\n    <Compile Include=\"main.py\" />\n    <Compile Include=\"MarginCallEventsAlgorithm.py\" />\n    <Compile Include=\"MarketOnOpenOnCloseAlgorithm.py\" />\n    <Compile Include=\"MaximumPortfolioDrawdownFrameworkAlgorithm.py\" />\n    <Compile Include=\"MeanVarianceOptimizationFrameworkAlgorithm.py\" />\n    <Compile Include=\"MovingAverageCrossAlgorithm.py\" />\n    <Compile Include=\"MultipleSymbolConsolidationAlgorithm.py\" />\n    <Compile Include=\"NLTKSentimentTradingAlgorithm.py\" />\n    <Compile Include=\"ObjectStoreExampleAlgorithm.py\" />\n    <Compile Include=\"OnEndOfDayRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionChainConsistencyRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionChainProviderAlgorithm.py\" />\n    <Compile Include=\"OptionDataNullReferenceRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionExerciseAssignRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionOpenInterestRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionRenameRegressionAlgorithm.py\" />\n    <Compile Include=\"OptionSplitRegressionAlgorithm.py\" />\n    <Compile Include=\"OrderTicketDemoAlgorithm.py\" />\n    <Compile Include=\"PandasDataFrameHistoryAlgorithm.py\" />\n    <Compile Include=\"ParameterizedAlgorithm.py\" />\n    <Compile Include=\"PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py\" />\n    <Compile Include=\"PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py\" />\n    <Compile Include=\"PortfolioRebalanceOnDateRulesRegressionAlgorithm.py\" />\n    <Compile Include=\"PythonDictionaryFeatureRegressionAlgorithm.py\" />\n    <Compile Include=\"PytorchNeuralNetworkAlgorithm.py\" />\n    <Compile Include=\"QuandlFuturesDataAlgorithm.py\" />\n    <Compile Include=\"QuandlImporterAlgorithm.py\" />\n    <Compile Include=\"RawPricesCoarseUniverseAlgorithm.py\" />\n    <Compile Include=\"RawPricesUniverseRegressionAlgorithm.py\" />\n    <Compile Include=\"RegisterIndicatorRegressionAlgorithm.py\" />\n    <Compile Include=\"RegressionAlgorithm.py\" />\n    <Compile Include=\"RegressionChannelAlgorithm.py\" />\n    <Compile Include=\"RenkoConsolidatorAlgorithm.py\" />\n    <Compile Include=\"RollingWindowAlgorithm.py\" />\n    <Compile Include=\"ScheduledEventsAlgorithm.py\" />\n    <Compile Include=\"ScheduledUniverseSelectionModelRegressionAlgorithm.py\" />\n    <Compile Include=\"ScikitLearnLinearRegressionAlgorithm.py\" />\n    <Compile Include=\"SectorExposureRiskFrameworkAlgorithm.py\" />\n    <Compile Include=\"SectorWeightingFrameworkAlgorithm.py\" />\n    <Compile Include=\"SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm.py\" />\n    <Compile Include=\"SetHoldingsMultipleTargetsRegressionAlgorithm.py\" />\n    <Compile Include=\"SmaCrossUniverseSelectionAlgorithm.py\" />\n    <Compile Include=\"StandardDeviationExecutionModelRegressionAlgorithm.py\" />\n    <Compile Include=\"TalibIndicatorsAlgorithm.py\" />\n    <Compile Include=\"TensorFlowNeuralNetworkAlgorithm.py\" />\n    <Compile Include=\"TiingoPriceAlgorithm.py\" />\n    <Compile Include=\"TimeInForceAlgorithm.py\" />\n    <Compile Include=\"TrailingStopRiskFrameworkAlgorithm.py\" />\n    <Compile Include=\"TrainingExampleAlgorithm.py\" />\n    <Compile Include=\"TrainingInitializeRegressionAlgorithm.py\" />\n    <Compile Include=\"UncorrelatedUniverseSelectionFrameworkAlgorithm.py\" />\n    <Compile Include=\"UniverseSelectionDefinitionsAlgorithm.py\" />\n    <Compile Include=\"UniverseSelectionRegressionAlgorithm.py\" />\n    <Compile Include=\"UniverseUnchangedRegressionAlgorithm.py\" />\n    <Compile Include=\"UpdateOrderRegressionAlgorithm.py\" />\n    <Compile Include=\"UserDefinedUniverseAlgorithm.py\" />\n    <Compile Include=\"VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py\" />\n    <Compile Include=\"WarmupAlgorithm.py\" />\n    <Compile Include=\"WarmupHistoryAlgorithm.py\" />\n    <Compile Include=\"WeeklyUniverseSelectionRegressionAlgorithm.py\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\Python Tools\\Microsoft.PythonTools.targets\" />\n  <!-- Uncomment the CoreCompile target to enable the Build command in\n       Visual Studio and specify your pre- and post-build commands in\n       the BeforeBuild and AfterBuild targets below. -->\n  <!--<Target Name=\"CoreCompile\" />-->\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n</Project>"
  },
  {
    "path": "Algorithm.Python/QuitAfterInitializationRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n###  This regression algorithm is expected to stop executing after Initialization. Related to GH 6168 issue\n### </summary>\nclass QuitAfterInitializationRegressionAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self._stopped = False\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self._stopped:\n            raise ValueError(\"Algorithm should of stopped!\")\n        self._stopped = True\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/QuitInInitializationRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n###  This regression algorithm is expected to stop executing after Initialization. Related to GH 6168 issue\n### </summary>\nclass QuitInInitializationRegressionAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)  #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.quit()\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        raise ValueError(\"Algorithm should of stopped!\")\n"
  },
  {
    "path": "Algorithm.Python/RangeConsolidatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm of how to use RangeConsolidator\n### </summary>\nclass RangeConsolidatorAlgorithm(QCAlgorithm):\n    def get_resolution(self) -> Resolution:\n        return Resolution.DAILY\n\n    def get_range(self) -> int:\n        return 100\n\n    def initialize(self) -> None:\n        self.set_start_and_end_dates()\n        self.add_equity(\"SPY\", self.get_resolution())\n        range_consolidator = self.create_range_consolidator()\n        range_consolidator.data_consolidated += self.on_data_consolidated\n        self._first_data_consolidated = None\n\n        self.subscription_manager.add_consolidator(\"SPY\", range_consolidator)\n\n    def set_start_and_end_dates(self) -> None:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n    def on_end_of_algorithm(self) -> None:\n        if not self._first_data_consolidated:\n            raise AssertionError(\"The consolidator should have consolidated at least one RangeBar, but it did not consolidated any one\")\n\n    def create_range_consolidator(self) -> RangeConsolidator:\n        return RangeConsolidator(self.get_range())\n\n    def on_data_consolidated(self, sender: object, range_bar: RangeBar) -> None:\n        if not self._first_data_consolidated:\n            self._first_data_consolidated = range_bar\n\n        if round(range_bar.high - range_bar.low, 2) != self.get_range() * 0.01: # The minimum price change for SPY is 0.01, therefore the range size of each bar equals Range * 0.01\n            raise AssertionError(f\"The difference between the High and Low for all RangeBar's should be {self.get_range() * 0.01}, but for this RangeBar was {round(range_bar.low - range_bar.high, 2)}\")\n"
  },
  {
    "path": "Algorithm.Python/RangeConsolidatorWithTickAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom RangeConsolidatorAlgorithm import RangeConsolidatorAlgorithm\n\n### <summary>\n### Example algorithm of how to use RangeConsolidator with Tick resolution\n### </summary>\nclass RangeConsolidatorWithTickAlgorithm(RangeConsolidatorAlgorithm):\n    def get_range(self):\n        return 5\n\n    def get_resolution(self):\n        return Resolution.TICK\n\n    def set_start_and_end_dates(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n"
  },
  {
    "path": "Algorithm.Python/RawDataRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Auxiliary import *\nfrom QuantConnect.Lean.Engine.DataFeeds import DefaultDataProvider\n\n_ticker = \"GOOGL\"\n_expected_raw_prices = [ 1158.72,\n1131.97, 1114.28, 1120.15, 1114.51, 1134.89, 1135.1, 571.50, 545.25, 540.63 ]\n\n# <summary>\n# In this algorithm we demonstrate how to use the raw data for our securities\n# and verify that the behavior is correct.\n# </summary>\n# <meta name=\"tag\" content=\"using data\" />\n# <meta name=\"tag\" content=\"regression test\" />\nclass RawDataRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 4, 7)\n        self.set_cash(100000)\n\n        # Set our DataNormalizationMode to raw\n        self.universe_settings.data_normalization_mode = DataNormalizationMode.RAW\n        self._googl = self.add_equity(_ticker, Resolution.DAILY).symbol\n\n        # Get our factor file for this regression\n        data_provider = DefaultDataProvider()\n        map_file_provider = LocalDiskMapFileProvider()\n        map_file_provider.initialize(data_provider)\n        factor_file_provider = LocalDiskFactorFileProvider()\n        factor_file_provider.initialize(map_file_provider, data_provider)\n\n        # Get our factor file for this regression\n        self._factor_file = factor_file_provider.get(self._googl)\n\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(self._googl, 1)\n\n        if data.bars.contains_key(self._googl):\n            googl_data = data.bars[self._googl]\n\n            # Assert our volume matches what we expected\n            expected_raw_price = _expected_raw_prices.pop(0)\n            if expected_raw_price != googl_data.close:\n                # Our values don't match lets try and give a reason why\n                day_factor = self._factor_file.get_price_factor(googl_data.time, DataNormalizationMode.ADJUSTED)\n                probable_raw_price = googl_data.close / day_factor  # Undo adjustment\n\n                raise AssertionError(\"Close price was incorrect; it appears to be the adjusted value\"\n                    if expected_raw_price == probable_raw_price else\n                   \"Close price was incorrect; Data may have changed.\")\n"
  },
  {
    "path": "Algorithm.Python/RawPricesCoarseUniverseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm we demonstrate how to use the coarse fundamental data to define a universe as the top dollar volume and set the algorithm to use raw prices\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"fine universes\" />\nclass RawPricesCoarseUniverseAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # what resolution should the data *added* to the universe be?\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2014,1,1)    #Set Start Date\n        self.set_end_date(2015,1,1)      #Set End Date\n        self.set_cash(50000)            #Set Strategy Cash\n\n        # Set the security initializer with the characteristics defined in CustomSecurityInitializer\n        self.set_security_initializer(self.custom_security_initializer)\n\n        # this add universe method accepts a single parameter that is a function that\n        # accepts an IEnumerable<CoarseFundamental> and returns IEnumerable<Symbol>\n        self.add_universe(self.coarse_selection_function)\n\n        self.__number_of_symbols = 5\n\n    def custom_security_initializer(self, security):\n        '''Initialize the security with raw prices and zero fees \n        Args:\n            security: Security which characteristics we want to change'''\n        security.set_data_normalization_mode(DataNormalizationMode.RAW)\n        security.set_fee_model(ConstantFeeModel(0))\n\n    # sort the data by daily dollar volume and take the top 'NumberOfSymbols'\n    def coarse_selection_function(self, coarse):\n        # sort descending by daily dollar volume\n        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True)\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.__number_of_symbols] ]\n\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # we want 20% allocation in each security in our universe\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, 0.2)\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.log(f\"OnOrderEvent({self.utc_time}):: {order_event}\")\n"
  },
  {
    "path": "Algorithm.Python/RawPricesUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### In this algorithm we demonstrate how to use the UniverseSettings\n### to define the data normalization mode (raw)\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\n### <meta name=\"tag\" content=\"fine universes\" />\nclass RawPricesUniverseRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # what resolution should the data *added* to the universe be?\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Use raw prices\n        self.universe_settings.data_normalization_mode = DataNormalizationMode.RAW\n\n        self.set_start_date(2014,3,24)    #Set Start Date\n        self.set_end_date(2014,4,7)      #Set End Date\n        self.set_cash(50000)            #Set Strategy Cash\n\n        # Set the security initializer with zero fees and price initial seed\n        securitySeeder = FuncSecuritySeeder(self.get_last_known_prices)\n        self.set_security_initializer(CompositeSecurityInitializer(\n            FuncSecurityInitializer(lambda x: x.set_fee_model(ConstantFeeModel(0))),\n            FuncSecurityInitializer(lambda security: securitySeeder.seed_security(security))))\n\n        self.add_universe(\"MyUniverse\", Resolution.DAILY, self.selection_function)\n\n\n    def selection_function(self, date_time):\n        if date_time.day % 2 == 0:\n            return [\"SPY\", \"IWM\", \"QQQ\"]\n        else:\n            return [\"AIG\", \"BAC\", \"IBM\"]\n\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        # liquidate removed securities\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # we want 20% allocation in each security in our universe\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, 0.2)\n"
  },
  {
    "path": "Algorithm.Python/RegisterIndicatorRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomDataRegressionAlgorithm import Bitcoin\n\n### <summary>\n### Regression algorithm reproducing data type bugs in the RegisterIndicator API. Related to GH 4205.\n### </summary>\nclass RegisterIndicatorRegressionAlgorithm(QCAlgorithm):\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self):\n        self.set_start_date(2020, 1, 5)\n        self.set_end_date(2020, 1, 10)\n\n        SP500 = Symbol.create(Futures.Indices.SP_500_E_MINI, SecurityType.FUTURE, Market.CME)\n        self._symbol = _symbol = self.future_chain_provider.get_future_contract_list(SP500, (self.start_date + timedelta(days=1)))[0]\n        self.add_future_contract(_symbol)\n\n        # this collection will hold all indicators and at the end of the algorithm we will assert that all of them are ready\n        self._indicators = []\n\n        # this collection will be used to determine if the Selectors were called, we will assert so at the end of algorithm\n        self._selector_called = [ False, False, False, False, False, False ]\n\n        # First we will test that we can register our custom indicator using a QuoteBar consolidator\n        indicator = CustomIndicator()\n        consolidator = self.resolve_consolidator(_symbol, Resolution.MINUTE, QuoteBar)\n        self.register_indicator(_symbol, indicator, consolidator)\n        self._indicators.append(indicator)\n\n        indicator2 = CustomIndicator()\n        # We use the TimeDelta overload to fetch the consolidator\n        consolidator = self.resolve_consolidator(_symbol, timedelta(minutes=1), QuoteBar)\n        # We specify a custom selector to be used\n        self.register_indicator(_symbol, indicator2, consolidator, lambda bar: self.set_selector_called(0) and bar)\n        self._indicators.append(indicator2)\n\n        # We use a IndicatorBase<IndicatorDataPoint> with QuoteBar data and a custom selector\n        indicator3 = SimpleMovingAverage(10)\n        consolidator = self.resolve_consolidator(_symbol, timedelta(minutes=1), QuoteBar)\n        self.register_indicator(_symbol, indicator3, consolidator, lambda bar: self.set_selector_called(1) and (bar.ask.high - bar.bid.low))\n        self._indicators.append(indicator3)\n\n        # We test default consolidator resolution works correctly\n        moving_average = SimpleMovingAverage(10)\n        # Using Resolution, specifying custom selector and explicitly using TradeBar.volume\n        self.register_indicator(_symbol, moving_average, Resolution.MINUTE, lambda bar: self.set_selector_called(2) and bar.volume)\n        self._indicators.append(moving_average)\n\n        moving_average2 = SimpleMovingAverage(10)\n        # Using Resolution\n        self.register_indicator(_symbol, moving_average2, Resolution.MINUTE)\n        self._indicators.append(moving_average2)\n\n        moving_average3 = SimpleMovingAverage(10)\n        # Using timedelta\n        self.register_indicator(_symbol, moving_average3, timedelta(minutes=1))\n        self._indicators.append(moving_average3)\n\n        moving_average4 = SimpleMovingAverage(10)\n        # Using time_delta, specifying custom selector and explicitly using TradeBar.volume\n        self.register_indicator(_symbol, moving_average4, timedelta(minutes=1), lambda bar: self.set_selector_called(3) and bar.volume)\n        self._indicators.append(moving_average4)\n\n        # Test custom data is able to register correctly and indicators updated\n        symbol_custom = self.add_data(Bitcoin, \"BTC\", Resolution.MINUTE).symbol\n\n        sma_custom_data = SimpleMovingAverage(1)\n        self.register_indicator(symbol_custom, sma_custom_data, timedelta(minutes=1), lambda bar: self.set_selector_called(4) and bar.volume)\n        self._indicators.append(sma_custom_data)\n\n        sma_custom_data2 = SimpleMovingAverage(1)\n        self.register_indicator(symbol_custom, sma_custom_data2, Resolution.MINUTE)\n        self._indicators.append(sma_custom_data2)\n\n        sma_custom_data3 = SimpleMovingAverage(1)\n        consolidator = self.resolve_consolidator(symbol_custom, timedelta(minutes=1))\n        self.register_indicator(symbol_custom, sma_custom_data3, consolidator, lambda bar: self.set_selector_called(5) and bar.volume)\n        self._indicators.append(sma_custom_data3)\n\n    def set_selector_called(self, position):\n        self._selector_called[position] = True\n        return True\n\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    def on_data(self, data):\n        if not self.portfolio.invested:\n           self.set_holdings(self._symbol, 0.5)\n\n    def on_end_of_algorithm(self):\n        if any(not was_called for was_called in self._selector_called):\n            raise ValueError(\"All selectors should of been called\")\n        if any(not indicator.is_ready for indicator in self._indicators):\n            raise ValueError(\"All indicators should be ready\")\n        self.log(f'Total of {len(self._indicators)} are ready')\n\nclass CustomIndicator(PythonIndicator):\n    def __init__(self):\n        super().__init__()\n        self.name = \"Jose\"\n        self.value = 0\n\n    def update(self, input):\n        self.value = input.ask.high\n        return True\n"
  },
  {
    "path": "Algorithm.Python/RegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Algorithm used for regression tests purposes\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass RegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,8)    #Set End Date\n        self.set_cash(10000000)         #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.TICK)\n        self.add_equity(\"BAC\", Resolution.MINUTE)\n        self.add_equity(\"AIG\", Resolution.HOUR)\n        self.add_equity(\"IBM\", Resolution.DAILY)\n\n        self.__last_trade_ticks = self.start_date\n        self.__last_trade_trade_bars = self.__last_trade_ticks\n        self.__trade_every = timedelta(minutes=1)\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if self.time - self.__last_trade_trade_bars < self.__trade_every:\n            return\n        self.__last_trade_trade_bars = self.time\n\n        for kvp in data.bars:\n            bar = kvp.Value\n            if bar.is_fill_forward:\n                continue\n\n            symbol = kvp.key\n            holdings = self.portfolio[symbol]\n\n            if not holdings.invested:\n                self.market_order(symbol, 10)\n            else:\n                self.market_order(symbol, -holdings.quantity)\n"
  },
  {
    "path": "Algorithm.Python/RegressionChannelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression Channel algorithm simply initializes the date range and cash\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"indicator classes\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"plotting indicators\" />\nclass RegressionChannelAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n\n        self.set_cash(100000)\n        self.set_start_date(2009,1,1)\n        self.set_end_date(2015,1,1)\n\n        equity = self.add_equity(\"SPY\", Resolution.MINUTE)\n        self._spy = equity.symbol\n        self._holdings = equity.holdings\n        self._rc = self.rc(self._spy, 30, 2, Resolution.DAILY)\n\n        stock_plot = Chart(\"Trade Plot\")\n        stock_plot.add_series(Series(\"Buy\", SeriesType.SCATTER, 0))\n        stock_plot.add_series(Series(\"Sell\", SeriesType.SCATTER, 0))\n        stock_plot.add_series(Series(\"UpperChannel\", SeriesType.LINE, 0))\n        stock_plot.add_series(Series(\"LowerChannel\", SeriesType.LINE, 0))\n        stock_plot.add_series(Series(\"Regression\", SeriesType.LINE, 0))\n        self.add_chart(stock_plot)\n\n    def on_data(self, data):\n        if (not self._rc.is_ready) or (not data.contains_key(self._spy)): return\n        if data[self._spy] is None: return\n        value = data[self._spy].value\n        if self._holdings.quantity <= 0 and value < self._rc.lower_channel.current.value:\n            self.set_holdings(self._spy, 1)\n            self.plot(\"Trade Plot\", \"Buy\", value)\n        if self._holdings.quantity >= 0 and value > self._rc.upper_channel.current.value:\n            self.set_holdings(self._spy, -1)\n            self.plot(\"Trade Plot\", \"Sell\", value)\n\n    def on_end_of_day(self, symbol):\n        self.plot(\"Trade Plot\", \"UpperChannel\", self._rc.upper_channel.current.value)\n        self.plot(\"Trade Plot\", \"LowerChannel\", self._rc.lower_channel.current.value)\n        self.plot(\"Trade Plot\", \"Regression\", self._rc.linear_regression.current.value)\n"
  },
  {
    "path": "Algorithm.Python/RiskParityPortfolioAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.RiskParityPortfolioConstructionModel import *\n\nclass RiskParityPortfolioAlgorithm(QCAlgorithm):\n    '''Example algorithm of using RiskParityPortfolioConstructionModel'''\n\n    def initialize(self):\n        self.set_start_date(2021, 2, 21)  # Set Start Date\n        self.set_end_date(2021, 3, 30)\n        self.set_cash(100000)  # Set Strategy Cash\n        self.set_security_initializer(lambda security: security.set_market_price(self.get_last_known_price(security)))\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        self.add_equity(\"AAPL\", Resolution.DAILY)\n\n        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(RiskParityPortfolioConstructionModel())\n"
  },
  {
    "path": "Algorithm.Python/RollingWindowAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Using rolling windows for efficient storage of historical data; which automatically clears after a period of time.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"warm up\" />\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"rolling windows\" />\nclass RollingWindowAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,1)  #Set Start Date\n        self.set_end_date(2013,11,1)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n        # Creates a Rolling Window indicator to keep the 2 TradeBar\n        self._window = RollingWindow(2)    # For other security types, use QuoteBar\n\n        # Creates an indicator and adds to a rolling window when it is updated\n        self._sma = self.sma(\"SPY\", 5)\n        self._sma.updated += self._sma_updated\n        self._sma_win = RollingWindow(5)\n\n\n    def _sma_updated(self, sender, updated):\n        '''Adds updated values to rolling window'''\n        self._sma_win.add(updated)\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n\n        # Add SPY TradeBar in rollling window\n        self._window.add(data[\"SPY\"])\n\n        # Wait for windows to be ready.\n        if not (self._window.is_ready and self._sma_win.is_ready): return\n\n        curr_bar = self._window[0]                        # Current bar had index zero.\n        past_bar = self._window[1]                        # Past bar has index one.\n        self.log(f\"Price: {past_bar.time} -> {past_bar.close} ... {curr_bar.time} -> {curr_bar.close}\")\n\n        curr_sma = self._sma_win[0]                       # Current SMA had index zero.\n        past_sma = self._sma_win[self._sma_win.count-1]   # Oldest SMA has index of window count minus 1.\n        self.log(f\"SMA:   {past_sma.time} -> {past_sma.value} ... {curr_sma.time} -> {curr_sma.value}\")\n\n        if not self.portfolio.invested and curr_sma.value > past_sma.value:\n            self.set_holdings(\"SPY\", 1)\n"
  },
  {
    "path": "Algorithm.Python/RsiAlphaModelFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Alphas.RsiAlphaModel import RsiAlphaModel\n\n### <summary>\n### Regression algorithm to assert the behavior of <see cref=\"RsiAlphaModel\"/>.\n### </summary>\nclass RsiAlphaModelFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n\n    def initialize(self):\n        super().initialize()\n        self.set_alpha(RsiAlphaModel())\n\n    def on_end_of_algorithm(self):\n        # We have removed all securities from the universe. The Alpha Model should remove the consolidator\n        consolidator_count = sum([s.consolidators.count for s in self.subscription_manager.subscriptions])\n        if consolidator_count > 0:\n            raise AssertionError(f\"The number of consolidators should be zero. Actual: {consolidator_count}\")\n"
  },
  {
    "path": "Algorithm.Python/ScheduledEventsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of the Scheduled Events features available in QuantConnect.\n### </summary>\n### <meta name=\"tag\" content=\"scheduled events\" />\n### <meta name=\"tag\" content=\"date rules\" />\n### <meta name=\"tag\" content=\"time rules\" />\nclass ScheduledEventsAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\")\n\n        # events are scheduled using date and time rules\n        # date rules specify on what dates and event will fire\n        # time rules specify at what time on thos dates the event will fire\n\n        # schedule an event to fire at a specific date/time\n        self.schedule.on(self.date_rules.on(2013, 10, 7), self.time_rules.at(13, 0), self.specific_time)\n\n        # schedule an event to fire every trading day for a security the\n        # time rule here tells it to fire 10 minutes after SPY's market open\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 10), self.every_day_after_market_open)\n\n        # schedule an event to fire every trading day for a security the\n        # time rule here tells it to fire 10 minutes before SPY's market close\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.before_market_close(\"SPY\", 10), self.every_day_after_market_close)\n\n        # schedule an event to fire on a single day of the week\n        self.schedule.on(self.date_rules.every(DayOfWeek.WEDNESDAY), self.time_rules.at(12, 0), self.every_wed_at_noon)\n\n        # schedule an event to fire on certain days of the week\n        self.schedule.on(self.date_rules.every(DayOfWeek.MONDAY, DayOfWeek.FRIDAY), self.time_rules.at(12, 0), self.every_mon_fri_at_noon)\n\n        # the scheduling methods return the ScheduledEvent object which can be used for other things here I set\n        # the event up to check the portfolio value every 10 minutes, and liquidate if we have too many losses\n        self.schedule.on(self.date_rules.every_day(), self.time_rules.every(timedelta(minutes=10)), self.liquidate_unrealized_losses)\n\n        # schedule an event to fire at the beginning of the month, the symbol is optional\n        # if specified, it will fire the first trading day for that symbol of the month,\n        # if not specified it will fire on the first day of the month\n        self.schedule.on(self.date_rules.month_start(\"SPY\"), self.time_rules.after_market_open(\"SPY\"), self.rebalancing_code)\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n\n    def specific_time(self):\n        self.log(f\"SpecificTime: Fired at : {self.time}\")\n\n\n    def every_day_after_market_open(self):\n        self.log(f\"EveryDay.SPY 10 min after open: Fired at: {self.time}\")\n\n\n    def every_day_after_market_close(self):\n        self.log(f\"EveryDay.SPY 10 min before close: Fired at: {self.time}\")\n\n\n    def every_wed_at_noon(self):\n        self.log(f\"Wed at 12pm: Fired at: {self.time}\")\n\n\n    def every_mon_fri_at_noon(self):\n        self.log(f\"Mon/Fri at 12pm: Fired at: {self.time}\")\n\n\n    def liquidate_unrealized_losses(self):\n        ''' if we have over 1000 dollars in unrealized losses, liquidate'''\n        if self.portfolio.total_unrealized_profit < -1000:\n            self.log(f\"Liquidated due to unrealized losses at: {self.time}\")\n            self.liquidate()\n\n\n    def rebalancing_code(self):\n        ''' Good spot for rebalancing code?'''\n        pass\n"
  },
  {
    "path": "Algorithm.Python/ScheduledQueuingAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom queue import Queue\n\nclass ScheduledQueuingAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2020, 9, 1)\n        self.set_end_date(2020, 9, 2)\n        self.set_cash(100000)\n\n        self.__number_of_symbols = 2000\n        self.__number_of_symbols_fine = 1000\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(self.coarse_selection_function, self.fine_selection_function, None))\n\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        self.set_execution(ImmediateExecutionModel())\n\n        self._queue = Queue()\n        self._dequeue_size = 100\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.at(0, 0), self.fill_queue)\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.every(timedelta(minutes=60)), self.take_from_queue)\n\n    def coarse_selection_function(self, coarse: list[CoarseFundamental]) -> list[Symbol]:\n        has_fundamentals = [security for security in coarse if security.has_fundamental_data]\n        sorted_by_dollar_volume = sorted(has_fundamentals, key=lambda x: x.dollar_volume, reverse=True)\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.__number_of_symbols] ]\n\n    def fine_selection_function(self, fine: list[FineFundamental]) -> list[Symbol]:\n        sorted_by_pe_ratio = sorted(fine, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n        return [ x.symbol for x in sorted_by_pe_ratio[:self.__number_of_symbols_fine] ]\n\n    def fill_queue(self) -> None:\n        securities = [security for security in self.active_securities.values() if security.fundamentals]\n\n        # Fill queue with symbols sorted by PE ratio (decreasing order)\n        self._queue.queue.clear()\n        sorted_by_pe_ratio = sorted(securities, key=lambda x: x.fundamentals.valuation_ratios.pe_ratio, reverse=True)\n        for security in sorted_by_pe_ratio:\n            self._queue.put(security.symbol)\n\n    def take_from_queue(self) -> None:\n        symbols = [self._queue.get() for _ in range(min(self._dequeue_size, self._queue.qsize()))]\n        self.history(symbols, 10, Resolution.DAILY)\n\n        self.log(f\"Symbols at {self.time}: {[str(symbol) for symbol in symbols]}\")\n"
  },
  {
    "path": "Algorithm.Python/ScheduledUniverseRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting the behavior of a ScheduledUniverse\n### </summary>\nclass BasicTemplateAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10, 8)\n        \n        self._spy = Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA)\n        self._selection_time =[ datetime(2013, 10, 7, 1, 0, 0), datetime(2013, 10, 8, 1, 0, 0)]\n\n        self.add_universe(ScheduledUniverse(self.date_rules.every_day(), self.time_rules.at(1, 0), self.select_assets))\n\n\n    def select_assets(self, time):\n        self.debug(f\"Universe selection called: {Time}\")\n        expected_time = self._selection_time.pop(0)\n        if expected_time != self.time:\n            raise ValueError(f\"Unexpected selection time {self.time} expected {expected_time}\")\n\n        return [ self._spy ]\n    \n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(self._spy, 1)\n\n    def on_end_of_algorithm(self):\n        if len(self._selection_time) > 0:\n            raise ValueError(\"Unexpected selection times\")\n"
  },
  {
    "path": "Algorithm.Python/ScheduledUniverseSelectionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm for testing ScheduledUniverseSelectionModel scheduling functions.\n### </summary>\nclass ScheduledUniverseSelectionModelRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm for testing ScheduledUniverseSelectionModel scheduling functions.'''\n\n    def initialize(self):\n\n        self.universe_settings.resolution = Resolution.HOUR\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n        self.set_start_date(2017, 1, 1)\n        self.set_end_date(2017, 2, 1)\n\n        # selection will run on mon/tues/thurs at 00:00/06:00/12:00/18:00\n        self.set_universe_selection(ScheduledUniverseSelectionModel(\n            self.date_rules.every(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.THURSDAY),\n            self.time_rules.every(timedelta(hours = 12)),\n            self.select_symbols\n            ))\n\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        # some days of the week have different behavior the first time -- less securities to remove\n        self.seen_days = []\n\n    def select_symbols(self, dateTime):\n\n        symbols = []\n        weekday = dateTime.weekday()\n\n        if weekday == 0 or weekday == 1:\n            symbols.append(Symbol.create('SPY', SecurityType.EQUITY, Market.USA))\n        elif weekday == 2:\n            # given the date/time rules specified in Initialize, this symbol will never be selected (not invoked on wednesdays)\n            symbols.append(Symbol.create('AAPL', SecurityType.EQUITY, Market.USA))\n        else:\n            symbols.append(Symbol.create('IBM', SecurityType.EQUITY, Market.USA))\n\n        if weekday == 1 or weekday == 3:\n            symbols.append(Symbol.create('EURUSD', SecurityType.FOREX, Market.OANDA))\n        elif weekday == 4:\n            # given the date/time rules specified in Initialize, this symbol will never be selected (every 6 hours never lands on hour==1)\n            symbols.append(Symbol.create('EURGBP', SecurityType.FOREX, Market.OANDA))\n        else:\n            symbols.append(Symbol.create('NZDUSD', SecurityType.FOREX, Market.OANDA))\n\n        return symbols\n\n    def on_securities_changed(self, changes):\n        self.log(\"{}: {}\".format(self.time, changes))\n\n        weekday = self.time.weekday()\n\n        if weekday == 0:\n            self.expect_additions(changes, 'SPY', 'NZDUSD')\n            if weekday not in self.seen_days:\n                self.seen_days.append(weekday)\n                self.expect_removals(changes, None)\n            else:\n                self.expect_removals(changes, 'EURUSD', 'IBM')\n\n        if weekday == 1:\n            self.expect_additions(changes, 'EURUSD')\n            if weekday not in self.seen_days:\n                self.seen_days.append(weekday)\n                self.expect_removals(changes, 'NZDUSD')\n            else:\n                self.expect_removals(changes, 'NZDUSD')\n\n        if weekday == 2 or weekday == 4:\n            # selection function not invoked on wednesdays (2) or friday (4)\n            self.expect_additions(changes, None)\n            self.expect_removals(changes, None)\n\n        if weekday == 3:\n            self.expect_additions(changes, \"IBM\")\n            self.expect_removals(changes, \"SPY\")\n\n\n    def on_order_event(self, orderEvent):\n        self.log(\"{}: {}\".format(self.time, orderEvent))\n\n    def expect_additions(self, changes, *tickers):\n        if tickers is None and changes.added_securities.count > 0:\n            raise AssertionError(\"{}: Expected no additions: {}\".format(self.time, self.time.weekday()))\n\n        for ticker in tickers:\n            if ticker is not None and ticker not in [s.symbol.value for s in changes.added_securities]:\n                raise AssertionError(\"{}: Expected {} to be added: {}\".format(self.time, ticker, self.time.weekday()))\n\n    def expect_removals(self, changes, *tickers):\n        if tickers is None and changes.removed_securities.count > 0:\n            raise AssertionError(\"{}: Expected no removals: {}\".format(self.time, self.time.weekday()))\n\n        for ticker in tickers:\n            if ticker is not None and ticker not in [s.symbol.value for s in changes.removed_securities]:\n                raise AssertionError(\"{}: Expected {} to be removed: {}\".format(self.time, ticker, self.time.weekday()))\n"
  },
  {
    "path": "Algorithm.Python/ScikitLearnLinearRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom sklearn.linear_model import LinearRegression\n\nclass ScikitLearnLinearRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)  # Set Start Date\n        self.set_end_date(2013, 10, 8) # Set End Date\n\n        self.lookback = 30 # number of previous days for training\n\n        self.set_cash(100000)  # Set Strategy Cash\n        spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        self.symbols = [ spy.symbol ] # In the future, we can include more symbols to the list in this way\n\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 28), self.regression)\n        self.schedule.on(self.date_rules.every_day(\"SPY\"), self.time_rules.after_market_open(\"SPY\", 30), self.trade)\n\n\n    def regression(self):\n        # Daily historical data is used to train the machine learning model\n        history = self.history(self.symbols, self.lookback, Resolution.DAILY)\n\n        # price dictionary:    key: symbol; value: historical price\n        self.prices = {}\n        # slope dictionary:    key: symbol; value: slope\n        self.slopes = {}\n\n        for symbol in self.symbols:\n            if not history.empty:\n                # get historical open price\n                self.prices[symbol] = list(history.loc[symbol.value]['open'])\n\n        # A is the design matrix\n        A = range(self.lookback + 1)\n\n        for symbol in self.symbols:\n            if symbol in self.prices:\n                # response\n                Y = self.prices[symbol]\n                # features\n                X = np.column_stack([np.ones(len(A)), A])\n\n                # data preparation\n                length = min(len(X), len(Y))\n                X = X[-length:]\n                Y = Y[-length:]\n                A = A[-length:]\n\n                # fit the linear regression\n                reg = LinearRegression().fit(X, Y)\n\n                # run linear regression y = ax + b\n                b = reg.intercept_\n                a = reg.coef_[1]\n\n                # store slopes for symbols\n                self.slopes[symbol] = a/b\n\n\n    def trade(self):\n        # if there is no open price\n        if not self.prices:\n            return\n\n        thod_buy = 0.001 # threshold of slope to buy\n        thod_liquidate = -0.001 # threshold of slope to liquidate\n\n        for holding in self.portfolio.values():\n            slope = self.slopes[holding.symbol]\n            # liquidate when slope smaller than thod_liquidate\n            if holding.invested and slope < thod_liquidate:\n                self.liquidate(holding.symbol)\n\n        for symbol in self.symbols:\n            # buy when slope larger than thod_buy\n            if self.slopes[symbol] > thod_buy:\n                self.set_holdings(symbol, 1 / len(self.symbols))\n"
  },
  {
    "path": "Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Alphas.ConstantAlphaModel import ConstantAlphaModel\nfrom Execution.ImmediateExecutionModel import ImmediateExecutionModel\nfrom Risk.MaximumSectorExposureRiskManagementModel import MaximumSectorExposureRiskManagementModel\n\n### <summary>\n### This example algorithm defines its own custom coarse/fine fundamental selection model\n### with equally weighted portfolio and a maximum sector exposure.\n### </summary>\nclass SectorExposureRiskFrameworkAlgorithm(QCAlgorithm):\n    '''This example algorithm defines its own custom coarse/fine fundamental selection model\n### with equally weighted portfolio and a maximum sector exposure.'''\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 4, 7)\n        self.set_cash(100000)\n\n        # set algorithm framework models\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(self.select_coarse, self.select_fine))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_risk_management(MaximumSectorExposureRiskManagementModel())\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(f\"Order event: {order_event}. Holding value: {self.securities[order_event.symbol].holdings.absolute_holdings_value}\")\n\n    def select_coarse(self, coarse):\n        tickers = [\"AAPL\", \"AIG\", \"IBM\"] if self.time.date() < date(2014, 4, 1) else [ \"GOOG\", \"BAC\", \"SPY\" ]\n        return [Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in tickers]\n\n    def select_fine(self, fine):\n        return [f.symbol for f in fine]\n"
  },
  {
    "path": "Algorithm.Python/SectorWeightingFrameworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This example algorithm defines its own custom coarse/fine fundamental selection model\n### with sector weighted portfolio.\n### </summary>\nclass SectorWeightingFrameworkAlgorithm(QCAlgorithm):\n    '''This example algorithm defines its own custom coarse/fine fundamental selection model\n    with sector weighted portfolio.'''\n\n    def initialize(self):\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2014, 4, 2)\n        self.set_end_date(2014, 4, 6)\n        self.set_cash(100000)\n\n        # set algorithm framework models\n        self.set_universe_selection(FineFundamentalUniverseSelectionModel(self.select_coarse, self.select_fine))\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(1)))\n        self.set_portfolio_construction(SectorWeightingPortfolioConstructionModel())\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            self.debug(f\"Order event: {order_event}. Holding value: {self.securities[order_event.symbol].holdings.absolute_holdings_value}\")\n\n    def select_coarse(self, coarse):\n        # IndustryTemplateCode of AAPL, IBM and GOOG is N, AIG is I, BAC is B. SPY have no fundamentals\n        tickers = [\"AAPL\", \"AIG\", \"IBM\"] if self.time.date() < date(2014, 4, 4) else [ \"GOOG\", \"BAC\", \"SPY\" ]\n        return [Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in tickers]\n\n    def select_fine(self, fine):\n        return [f.symbol for f in fine]\n"
  },
  {
    "path": "Algorithm.Python/SecurityCustomPropertiesAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom cmath import isclose\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration of how to use custom security properties.\n### In this algorithm we trade a security based on the values of a slow and fast EMAs which are stored in the security itself.\n### </summary>\nclass SecurityCustomPropertiesAlgorithm(QCAlgorithm):\n    '''Demonstration of how to use custom security properties.\n    In this algorithm we trade a security based on the values of a slow and fast EMAs which are stored in the security itself.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        # Using the dynamic interface to store our indicator as a custom property.\n        self.spy.slow_ema = self.ema(self.spy.symbol, 30, Resolution.MINUTE)\n\n        # Using the generic interface to store our indicator as a custom property.\n        self.spy.add(\"fast_ema\", self.ema(self.spy.symbol, 60, Resolution.MINUTE))\n\n        # Using the indexer to store our indicator as a custom property\n        self.spy[\"bb\"] = self.bb(self.spy.symbol, 20, 1, MovingAverageType.SIMPLE, Resolution.MINUTE)\n\n        # Fee factor to be used by the custom fee model\n        self.spy.fee_factor = 0.00002\n        self.spy.set_fee_model(CustomFeeModel())\n\n        # This property will be used to store the prices used to calculate the fees in order to assert the correct fee factor is used.\n        self.spy.orders_fees_prices = {}\n\n    def on_data(self, data):\n        if not self.spy.fast_ema.is_ready:\n            return\n\n        if not self.portfolio.invested:\n            # Using the property and the generic interface to access our indicator\n            if self.spy.slow_ema > self.spy.fast_ema:\n                self.set_holdings(self.spy.symbol, 1)\n        else:\n            if self.spy.get[ExponentialMovingAverage](\"slow_ema\") < self.spy.get[ExponentialMovingAverage](\"fast_ema\"):\n                self.liquidate(self.spy.symbol)\n\n        # Using the indexer to access our indicator\n        bb: BollingerBands = self.spy[\"bb\"]\n        self.plot(\"bb\", bb.upper_band, bb.middle_band, bb.lower_band)\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            fee = order_event.order_fee\n            expected_fee = self.spy.orders_fees_prices[order_event.order_id] * order_event.absolute_fill_quantity * self.spy.fee_factor\n            if not isclose(fee.value.amount, expected_fee, rel_tol=1e-15):\n                raise AssertionError(f\"Custom fee model failed to set the correct fee. Expected: {expected_fee}. Actual: {fee.value.amount}\")\n\n    def on_end_of_algorithm(self):\n        if self.transactions.orders_count == 0:\n            raise AssertionError(\"No orders executed\")\n\nclass CustomFeeModel(FeeModel):\n    '''This custom fee is implemented for demonstration purposes only.'''\n\n    def get_order_fee(self, parameters):\n        security = parameters.security\n        # custom fee math using the fee factor stored in security instance\n        fee_factor = security.fee_factor\n        if fee_factor is None:\n            fee_factor = 0.00001\n\n        # Store the price used to calculate the fee for this order\n        security[\"orders_fees_prices\"][parameters.order.id] = security.price\n\n        fee = max(1.0, security.price * parameters.order.absolute_quantity * fee_factor)\n\n        return OrderFee(CashAmount(fee, \"USD\"))\n"
  },
  {
    "path": "Algorithm.Python/SecurityDynamicPropertyPythonClassAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom collections import deque\n\nimport numpy as np\n\n### <summary>\n### Algorithm asserting that security dynamic properties keep Python references to the Python class they are instances of,\n### specifically when this class is a subclass of a C# class.\n### </summary>\nclass SecurityDynamicPropertyPythonClassAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        custom_sma = CustomSimpleMovingAverage('custom', 60)\n        self._spy.custom_sma = custom_sma\n        custom_sma.security = self._spy\n\n        self.register_indicator(self._spy.symbol, self._spy.custom_sma, Resolution.MINUTE)\n\n    def on_warmup_finished(self) -> None:\n        if type(self._spy.custom_sma) != CustomSimpleMovingAverage:\n            raise AssertionError(\"spy.custom_sma is not an instance of CustomSimpleMovingAverage\")\n\n        if not self._spy.custom_sma.security:\n            raise AssertionError(\"spy.custom_sma.security is None\")\n        else:\n            self.debug(f\"spy.custom_sma.security.symbol: {self._spy.custom_sma.security.symbol}\")\n\n    def on_data(self, slice: Slice) -> None:\n        if self._spy.custom_sma.is_ready:\n            self.debug(f\"CustomSMA: {self._spy.custom_sma.current.value}\")\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name: str, period: int) -> None:\n        super().__init__()\n        self.name = name\n        self.value = 0\n        self._queue = deque(maxlen=period)\n\n    def update(self, input: IndicatorDataPoint) -> bool:\n        self._queue.appendleft(input.value)\n        count = len(self._queue)\n        self.value = np.sum(self._queue) / count\n        return count == self._queue.maxlen\n"
  },
  {
    "path": "Algorithm.Python/SecuritySeederRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm reproducing GH issue #5921. Asserting a security can be warmup correctly on initialize\n### </summary>\nclass SecuritySeederRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 8)\n        self.set_end_date(2013,10,10)\n\n        self.set_security_initializer(BrokerageModelSecurityInitializer(self.brokerage_model,\n                                                                        FuncSecuritySeeder(self.get_last_known_prices)))\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\n    def on_securities_changed(self, changes):\n        for added_security in changes.added_securities:\n            if not added_security.has_data \\\n                or added_security.ask_price == 0 \\\n                or added_security.bid_price == 0 \\\n                or added_security.bid_size == 0 \\\n                or added_security.ask_size == 0 \\\n                or added_security.price == 0 \\\n                or added_security.volume == 0 \\\n                or added_security.high == 0 \\\n                or added_security.low == 0 \\\n                or added_security.open == 0 \\\n                or added_security.close == 0:\n                raise ValueError(f\"Security {added_security.symbol} was not warmed up!\")\n"
  },
  {
    "path": "Algorithm.Python/SecuritySessionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to validate SecurityCache.Session functionality.\n### Verifies that daily session bars (Open, High, Low, Close, Volume) are correctly\n### </summary>\nclass SecuritySessionRegressionAlgorithm(QCAlgorithm):\n    \n    def initialize(self):\n        self.add_security_initializer(self.initialize_session_tracking)\n        self.initialize_security()\n\n        # Check initial session values\n        session = self.security.session\n        if session is None:\n            raise RegressionTestException(\"Security.Session is none\")\n        if (session.open != 0\n            or session.high != 0\n            or session.low != 0\n            or session.close != 0\n            or session.volume != 0\n            or session.open_interest != 0):\n            raise RegressionTestException(\"Session should start with all zero values.\")\n            \n        self.security_was_removed = False\n        self.open = self.close = self.high = self.volume = 0\n        self.low = float('inf')\n        self.current_date = self.start_date\n        self.previous_session_bar = None\n\n        self.schedule.on(\n            self.date_rules.every_day(),\n            self.time_rules.after_market_close(self.security.symbol, 1),\n            self.validate_session_bars\n        )\n\n    def initialize_security(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.security = self.add_equity(\"SPY\", Resolution.HOUR)\n\n    def initialize_session_tracking(self, security):\n        # activate session tracking\n        security.session.size = 3\n\n    def _are_equal(self, value1, value2):\n        tolerance = 1e-10\n        return abs(value1 - value2) <= tolerance\n    \n    def validate_session_bars(self):\n        session = self.security.session\n        # At this point the data was consolidated (market close)\n\n        # Save previous session bar\n        self.previous_session_bar = {\n            'date': self.current_date,\n            'open': self.open,\n            'high': self.high,\n            'low': self.low,\n            'close': self.close,\n            'volume': self.volume\n        }\n\n        if self.security_was_removed:\n            self.previous_session_bar = None\n            self.security_was_removed = False\n            return\n\n        # Check current session values\n        if (not self._are_equal(session.open, self.open)\n            or not self._are_equal(session.high, self.high)\n            or not self._are_equal(session.low, self.low)\n            or not self._are_equal(session.close, self.close)\n            or not self._are_equal(session.volume, self.volume)):\n            raise RegressionTestException(\"Mismatch in current session bar (OHLCV)\")\n\n    def is_within_market_hours(self, current_date_time):\n        market_open = self.security.exchange.hours.get_next_market_open(current_date_time.date(), False).time()\n        market_close = self.security.exchange.hours.get_next_market_close(current_date_time.date(), False).time()\n        current_time = current_date_time.time()\n        return market_open < current_time <= market_close\n\n    def on_data(self, data):\n        if not self.is_within_market_hours(data.time):\n            # Skip data outside market hours\n            return\n\n        # Accumulate data within regular market hours\n        # to later compare against the Session values\n        self.accumulate_session_data(data)\n\n    def accumulate_session_data(self, data):\n        symbol = self.security.symbol\n        if self.current_date.date() == data.time.date():\n            # Same trading day\n            if self.open == 0:\n                self.open = data[symbol].open\n            self.high = max(self.high, data[symbol].high)\n            self.low = min(self.low, data[symbol].low)\n            self.close = data[symbol].close\n            self.volume += data[symbol].volume\n        else:\n            # New trading day\n\n            if self.previous_session_bar is not None:\n                session = self.security.session\n                if (self.previous_session_bar['open'] != session[1].open\n                    or self.previous_session_bar['high'] != session[1].high\n                    or self.previous_session_bar['low'] != session[1].low\n                    or self.previous_session_bar['close'] != session[1].close\n                    or self.previous_session_bar['volume'] != session[1].volume):\n                    raise RegressionTestException(\"Mismatch in previous session bar (OHLCV)\")\n\n            # This is the first data point of the new session\n            self.open = data[symbol].open\n            self.close = data[symbol].close\n            self.high = data[symbol].high\n            self.low = data[symbol].low\n            self.volume = data[symbol].volume\n            self.current_date = data.time\n"
  },
  {
    "path": "Algorithm.Python/SecuritySessionWithChangeOfResolutionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom SecuritySessionRegressionAlgorithm import SecuritySessionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm to validate SecurityCache.Session functionality.\n### Verifies that daily session bars (Open, High, Low, Close, Volume) are correctly after resolution change\n### </summary>\nclass SecuritySessionWithChangeOfResolutionRegressionAlgorithm(SecuritySessionRegressionAlgorithm):\n    def on_securities_changed(self, changes: SecurityChanges):\n        if changes.removed_securities:\n            self.security = self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    def on_end_of_day(self, symbol: Symbol):\n        if self.utc_time.date() == datetime(2013, 10, 7).date():\n            session = self.security.session\n\n            # Check before removal\n            if (\n                session.open != self.open\n                or session.high != self.high\n                or session.low != self.low\n                or session.close != self.close\n                or session.volume != self.volume\n            ):\n                raise RegressionTestException(\"Mismatch in current session bar (OHLCV)\")\n\n            self.remove_security(symbol)\n            self.security_was_removed = True"
  },
  {
    "path": "Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom SecuritySessionRegressionAlgorithm import SecuritySessionRegressionAlgorithm\n\n### <summary>\n### Regression algorithm to validate SecurityCache.Session with Futures.\n### Ensures OHLCV are consistent with Tick data.\n### </summary>\nclass SecuritySessionWithFuturesRegressionAlgorithm(SecuritySessionRegressionAlgorithm):\n    def initialize_security(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 8)\n        self.security = self.add_future(Futures.Metals.GOLD, Resolution.TICK)\n        self.bid_price = 0\n        self.ask_price = 0\n        self.bid_high = 0\n        self.bid_low = float('inf')\n        self.ask_low = float('inf')\n        self.ask_high = 0\n        self.previous_open_interest = 0\n\n    def is_within_market_hours(self, current_date_time):\n        return self.security.exchange.hours.is_open(current_date_time, False)\n\n    def accumulate_session_data(self, data):\n        symbol = self.security.symbol\n            \n        for tick in data.ticks[symbol]:\n            if tick.tick_type == TickType.TRADE:\n                self.volume += tick.quantity\n                \n            if self.current_date.date() == tick.time.date():\n                # Same trading day\n                if tick.bid_price != 0:\n                    self.bid_price = tick.bid_price\n                    self.bid_low = min(self.bid_low, tick.bid_price)\n                    self.bid_high = max(self.bid_high, tick.bid_price)\n                    \n                if tick.ask_price != 0:\n                    self.ask_price = tick.ask_price\n                    self.ask_low = min(self.ask_low, tick.ask_price)\n                    self.ask_high = max(self.ask_high, tick.ask_price)\n                    \n                if self.bid_price != 0 and self.ask_price != 0:\n                    mid_price = (self.bid_price + self.ask_price) / 2\n                    if self.open == 0:\n                        self.open = mid_price\n                    self.close = mid_price\n                    \n                if self.bid_high != 0 and self.ask_high != 0:\n                    self.high = max(self.high, (self.bid_high + self.ask_high) / 2)\n                    \n                if self.bid_low != float('inf') and self.ask_low != float('inf'):\n                    self.low = min(self.low, (self.bid_low + self.ask_low) / 2)\n                    \n            else:\n                # New trading day\n                if self.previous_session_bar is not None:\n                    session = self.security.session\n                    if (self.previous_session_bar['open'] != session[1].open\n                        or self.previous_session_bar['high'] != session[1].high\n                        or self.previous_session_bar['low'] != session[1].low\n                        or self.previous_session_bar['close'] != session[1].close\n                        or self.previous_session_bar['volume'] != session[1].volume\n                        or self.previous_session_bar['open_interest'] != session[1].open_interest):\n                        raise RegressionTestException(\"Mismatch in previous session bar (OHLCV)\")\n\n                # This is the first data point of the new session\n                self.open = (self.bid_price + self.ask_price) / 2\n                self.low = float('inf')\n                self.bid_low = float('inf')\n                self.ask_low = float('inf')\n                self.volume = 0\n                self.current_date = tick.time\n        \n    def validate_session_bars(self):\n        session = self.security.session\n        # At this point the data was consolidated (market close)\n\n        # Save previous session bar\n        self.previous_session_bar = {\n            'date': self.current_date,\n            'open': self.open,\n            'high': self.high,\n            'low': self.low,\n            'close': self.close,\n            'volume': self.volume,\n            'open_interest': self.security.open_interest\n        }\n\n        if self.security_was_removed:\n            self.previous_session_bar = None\n            self.security_was_removed = False\n            return\n\n        # Check current session values\n        if (not self._are_equal(session.open, self.open)\n            or not self._are_equal(session.high, self.high)\n            or not self._are_equal(session.low, self.low)\n            or not self._are_equal(session.close, self.close)\n            or not self._are_equal(session.volume, self.volume)\n            or not self._are_equal(session.open_interest, self.security.open_interest)):\n            raise RegressionTestException(\"Mismatch in current session bar (OHLCV)\")"
  },
  {
    "path": "Algorithm.Python/SecurityToSymbolRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm show casing ad asserting security to symbol implicit conversion\n### </summary>\nclass SecurityToSymbolRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n\n        asset = self.add_equity(\"SPY\", Resolution.MINUTE)\n\n        self.schedule.on(self.date_rules.every_day(asset), self.time_rules.after_market_open(asset, 1), lambda: None if self.portfolio.invested else self.set_holdings(asset, 1))\n"
  },
  {
    "path": "Algorithm.Python/SelectUniverseSymbolsFromIDRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting that universe symbols selection can be done by returning the symbol IDs in the selection function\n### </summary>\nclass SelectUniverseSymbolsFromIDRegressionAlgorithm(QCAlgorithm):\n    '''\n    Regression algorithm asserting that universe symbols selection can be done by returning the symbol IDs in the selection function\n    '''\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 24)\n        self.set_end_date(2014, 3, 26)\n        self.set_cash(100000)\n\n        self._securities = []\n        self.universe_settings.resolution = Resolution.DAILY\n        self.add_universe(self.select_symbol)\n\n    def select_symbol(self, fundamental):\n        symbols = [x.symbol for x in fundamental]\n\n        if not symbols:\n            return []\n\n        self.log(f\"Symbols: {', '.join([str(s) for s in symbols])}\")\n        # Just for testing, but more filtering could be done here as shown below:\n        #symbols = [x.symbol for x in fundamental if x.asset_classification.morningstar_sector_code == MorningstarSectorCode.TECHNOLOGY]\n\n        history = self.history(symbols, datetime(1998, 1, 1), self.time, Resolution.DAILY)\n\n        all_time_highs = history['high'].unstack(0).max()\n        last_closes = history['close'].unstack(0).iloc[-1]\n        security_ids = (last_closes / all_time_highs).sort_values().index[-5:]\n\n        return security_ids\n\n    def on_securities_changed(self, changes):\n        self._securities.extend(changes.added_securities)\n\n    def on_end_of_algorithm(self):\n        if not self._securities:\n            raise AssertionError(\"No securities were selected\")\n"
  },
  {
    "path": "Algorithm.Python/SetCustomSettlementModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom CustomSettlementModelRegressionAlgorithm import CustomSettlementModel, CustomSettlementModelRegressionAlgorithm\n\n### <summary>\n### Regression algorithm to test we can specify a custom settlement model using Security.set_settlement_model() method\n### (without a custom brokerage model)\n### </summary>\nclass SetCustomSettlementModelRegressionAlgorithm(CustomSettlementModelRegressionAlgorithm):\n    def set_settlement_model(self, security):\n        security.set_settlement_model(CustomSettlementModel())\n"
  },
  {
    "path": "Algorithm.Python/SetEquityDataNormalizationModeOnAddEquity.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This regression algorithm has examples of how to add an equity indicating the <see cref=\"DataNormalizationMode\"/>\n### directly with the <see cref=\"QCAlgorithm.add_equity\"/> method instead of using the <see cref=\"Equity.SET_DATA_NORMALIZATION_MODE\"/> method.\n### </summary>\nclass SetEquityDataNormalizationModeOnAddEquity(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n\n        spy_normalization_mode = DataNormalizationMode.RAW\n        ibm_normalization_mode = DataNormalizationMode.ADJUSTED\n        aig_normalization_mode = DataNormalizationMode.TOTAL_RETURN\n\n        self._price_ranges = {}\n\n        spy_equity = self.add_equity(\"SPY\", Resolution.MINUTE, data_normalization_mode=spy_normalization_mode)\n        self.check_equity_data_normalization_mode(spy_equity, spy_normalization_mode)\n        self._price_ranges[spy_equity] = (167.28, 168.37)\n\n        ibm_equity = self.add_equity(\"IBM\", Resolution.MINUTE, data_normalization_mode=ibm_normalization_mode)\n        self.check_equity_data_normalization_mode(ibm_equity, ibm_normalization_mode)\n        self._price_ranges[ibm_equity] = (135.864131052, 136.819606508)\n\n        aig_equity = self.add_equity(\"AIG\", Resolution.MINUTE, data_normalization_mode=aig_normalization_mode)\n        self.check_equity_data_normalization_mode(aig_equity, aig_normalization_mode)\n        self._price_ranges[aig_equity] = (48.73, 49.10)\n\n    def on_data(self, slice):\n        for equity, (min_expected_price, max_expected_price) in self._price_ranges.items():\n            if equity.has_data and (equity.price < min_expected_price or equity.price > max_expected_price):\n                raise AssertionError(f\"{equity.symbol}: Price {equity.price} is out of expected range [{min_expected_price}, {max_expected_price}]\")\n\n    def check_equity_data_normalization_mode(self, equity, expected_normalization_mode):\n        subscriptions = [x for x in self.subscription_manager.subscriptions if x.symbol == equity.symbol]\n        if any([x.data_normalization_mode != expected_normalization_mode for x in subscriptions]):\n            raise AssertionError(f\"Expected {equity.symbol} to have data normalization mode {expected_normalization_mode} but was {subscriptions[0].data_normalization_mode}\")\n\n\n"
  },
  {
    "path": "Algorithm.Python/SetHoldingsAsyncRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom SetHoldingsRegressionAlgorithm import SetHoldingsRegressionAlgorithm\n\n### <summary>\n### Regression algorithm testing the SetHolding trading API precision, using asynchronous orders\n### </summary>\nclass SetHoldingsAsyncRegressionAlgorithm(SetHoldingsRegressionAlgorithm):\n\n    asynchronous_orders = True\n"
  },
  {
    "path": "Algorithm.Python/SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom SetHoldingsMultipleTargetsRegressionAlgorithm import SetHoldingsMultipleTargetsRegressionAlgorithm\n\n### <summary>\n### Regression algorithm testing GH feature 3790, using SetHoldings with a collection of targets\n### which will be ordered by margin impact before being executed, with the objective of avoiding any\n### margin errors\n### Asserts that liquidate_existing_holdings equal false does not close positions inadvertedly (GH 7008) \n### </summary>\nclass SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm(SetHoldingsMultipleTargetsRegressionAlgorithm):\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings([PortfolioTarget(self._spy, 0.8), PortfolioTarget(self._ibm, 0.2)],\n                             liquidate_existing_holdings=True)\n"
  },
  {
    "path": "Algorithm.Python/SetHoldingsMultipleTargetsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing GH feature 3790, using SetHoldings with a collection of targets\n### which will be ordered by margin impact before being executed, with the objective of avoiding any\n### margin errors\n### </summary>\nclass SetHoldingsMultipleTargetsRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n\n        # use leverage 1 so we test the margin impact ordering\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE, Market.USA, False, 1).symbol\n        self._ibm = self.add_equity(\"IBM\", Resolution.MINUTE, Market.USA, False, 1).symbol\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings([PortfolioTarget(self._spy, 0.8), PortfolioTarget(self._ibm, 0.2)])\n        else:\n            self.set_holdings([PortfolioTarget(self._ibm, 0.8), PortfolioTarget(self._spy, 0.2)])\n"
  },
  {
    "path": "Algorithm.Python/SetHoldingsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm testing the SetHolding trading API precision\n### </summary>\nclass SetHoldingsRegressionAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    asynchronous_orders = False\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 8)\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 0.1, asynchronous=self.asynchronous_orders)\n            self.set_holdings(\"SPY\", float(0.20), asynchronous=self.asynchronous_orders)\n            self.set_holdings(\"SPY\", np.float64(0.30), asynchronous=self.asynchronous_orders)\n            self.set_holdings(\"SPY\", 1, asynchronous=self.asynchronous_orders)\n\n    def on_end_of_algorithm(self):\n        for ticket in self.transactions.get_order_tickets():\n            if ticket.submit_request.asynchronous != self.asynchronous_orders:\n                raise AssertionError(\"Expected all orders to have the same asynchronous flag as the algorithm.\")\n"
  },
  {
    "path": "Algorithm.Python/ShortInterestFeeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example algorithm showing and asserting the usage of the \"ShortMarginInterestRateModel\"\n### paired with a \"IShortableProvider\" instance, for example \"InteractiveBrokersShortableProvider\"\n### </summary>\nclass ShortInterestFeeRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n\n        self._short = self.add_equity(\"SPY\", Resolution.HOUR)\n        self._long = self.add_equity(\"AAPL\", Resolution.HOUR)\n\n        for security in [ self._short, self._long]:\n            security.set_shortable_provider(LocalDiskShortableProvider(\"testbrokerage\"))\n            security.margin_interest_rate_model = ShortMarginInterestRateModel()\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", -0.5)\n            self.set_holdings(\"AAPL\", 0.5)\n\n    def on_end_of_algorithm(self):\n        if self._short.margin_interest_rate_model.amount >= 0:\n            raise RegressionTestException(\"Expected short fee interest rate to be charged\")\n\n        if self._long.margin_interest_rate_model.amount <= 0:\n            raise RegressionTestException(\"Expected short fee interest rate to be earned\")\n"
  },
  {
    "path": "Algorithm.Python/ShortableProviderOrdersRejectedRegressionAlgorithm.py",
    "content": "### QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n### Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n###\n### Licensed under the Apache License, Version 2.0 (the \"License\");\n### you may not use this file except in compliance with the License.\n### You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n###\n### Unless required by applicable law or agreed to in writing, software\n### distributed under the License is distributed on an \"AS IS\" BASIS,\n### WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n### See the License for the specific language governing permissions and\n### limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass RegressionTestShortableProvider(LocalDiskShortableProvider):\n    def __init__(self):\n        super().__init__(\"testbrokerage\")\n\n### <summary>\n### Tests that orders are denied if they exceed the max shortable quantity.\n### </summary>\nclass ShortableProviderOrdersRejectedRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.orders_allowed = []\n        self.orders_denied = []\n        self.initialized = False\n        self.invalidated_allowed_order = False\n        self.invalidated_new_order_with_portfolio_holdings = False\n\n        self.set_start_date(2013, 10, 4)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(10000000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.aig = self.add_equity(\"AIG\", Resolution.MINUTE)\n\n        self.spy.set_shortable_provider(RegressionTestShortableProvider())\n        self.aig.set_shortable_provider(RegressionTestShortableProvider())\n\n    def on_data(self, data):\n        if not self.initialized:\n            self.handle_order(self.limit_order(self.spy.symbol, -1001, 10000)) # Should be canceled, exceeds the max shortable quantity\n            order_ticket = self.limit_order(self.spy.symbol, -1000, 10000)\n            self.handle_order(order_ticket) # Allowed, orders at or below 1000 should be accepted\n            self.handle_order(self.limit_order(self.spy.symbol, -10, 0.01)) # Should be canceled, the total quantity we would be short would exceed the max shortable quantity.\n\n            response = order_ticket.update_quantity(-999) # should be allowed, we are reducing the quantity we want to short\n            if not response.is_success:\n                raise ValueError(\"Order update should of succeeded!\")\n\n            self.initialized = True\n            return\n\n        if not self.invalidated_allowed_order:\n            if len(self.orders_allowed) != 1:\n                raise AssertionError(f\"Expected 1 successful order, found: {len(self.orders_allowed)}\")\n            if len(self.orders_denied) != 2:\n                raise AssertionError(f\"Expected 2 failed orders, found: {len(self.orders_denied)}\")\n\n            allowed_order = self.orders_allowed[0]\n            order_update = UpdateOrderFields()\n            order_update.limit_price = 0.01\n            order_update.quantity = -1001\n            order_update.tag = \"Testing updating and exceeding maximum quantity\"\n\n            response = allowed_order.update(order_update)\n            if response.error_code != OrderResponseErrorCode.EXCEEDS_SHORTABLE_QUANTITY:\n                raise AssertionError(f\"Expected order to fail due to exceeded shortable quantity, found: {response.error_code}\")\n\n            cancel_response = allowed_order.cancel()\n            if cancel_response.is_error:\n                raise AssertionError(\"Expected to be able to cancel open order after bad qty update\")\n\n            self.invalidated_allowed_order = True\n            self.orders_denied.clear()\n            self.orders_allowed.clear()\n            return\n\n        if not self.invalidated_new_order_with_portfolio_holdings:\n            self.handle_order(self.market_order(self.spy.symbol, -1000)) # Should succeed, no holdings and no open orders to stop this\n            spy_shares = self.portfolio[self.spy.symbol].quantity\n            if spy_shares != -1000:\n                raise AssertionError(f\"Expected -1000 shares in portfolio, found: {spy_shares}\")\n\n            self.handle_order(self.limit_order(self.spy.symbol, -1, 0.01)) # Should fail, portfolio holdings are at the max shortable quantity.\n            if len(self.orders_denied) != 1:\n                raise AssertionError(f\"Expected limit order to fail due to existing holdings, but found {len(self.orders_denied)} failures\")\n\n            self.orders_allowed.clear()\n            self.orders_denied.clear()\n\n            self.handle_order(self.market_order(self.aig.symbol, -1001))\n            if len(self.orders_allowed) != 1:\n                raise AssertionError(f\"Expected market order of -1001 BAC to not fail\")\n\n            self.invalidated_new_order_with_portfolio_holdings = True\n\n    def handle_order(self, order_ticket):\n        if order_ticket.submit_request.status == OrderRequestStatus.ERROR:\n            self.orders_denied.append(order_ticket)\n            return\n\n        self.orders_allowed.append(order_ticket)\n"
  },
  {
    "path": "Algorithm.Python/SliceGetByTypeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\ntrade_flag = False\n\n### <summary>\n### Regression algorithm asserting slice.get() works for both the alpha and the algorithm\n### </summary>\nclass SliceGetByTypeRegressionAlgorithm(QCAlgorithm):\n    def initialize(self) -> None:\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n        self.set_alpha(TestAlphaModel())\n\n    def on_data(self, data: Slice) -> None:\n        if \"SPY\" in data:\n            tb = data.get(TradeBar)[\"SPY\"]\n            global trade_flag\n            if not self.portfolio.invested and trade_flag:\n                self.set_holdings(\"SPY\", 1)\n\nclass TestAlphaModel(AlphaModel):\n    def update(self, algorithm: QCAlgorithm, data: Slice) -> list[Insight]:\n        insights = []\n\n        if \"SPY\" in data:\n            tb = data.get(TradeBar)[\"SPY\"]\n            global trade_flag\n            trade_flag = True\n\n        return insights"
  },
  {
    "path": "Algorithm.Python/SmaCrossUniverseSelectionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass SmaCrossUniverseSelectionAlgorithm(QCAlgorithm):\n    '''Provides an example where WarmUpIndicator method is used to warm up indicators\n    after their security is added and before (Universe Selection scenario)'''\n\n    _count = 10\n    _tolerance = 0.01\n    _target_percent = 1 / _count\n    _averages = dict()\n\n    def initialize(self) -> None:\n        self.universe_settings.leverage = 2\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2018, 1, 1)\n        self.set_end_date(2019, 1, 1)\n        self.set_cash(1000000)\n\n        self.settings.automatic_indicator_warm_up = True\n\n        ibm = self.add_equity(\"IBM\", Resolution.HOUR).symbol\n        ibm_sma = self.sma(ibm, 40)\n        self.log(f\"{ibm_sma.name}: {ibm_sma.current.time} - {ibm_sma}. IsReady? {ibm_sma.is_ready}\")\n\n        spy = self.add_equity(\"SPY\", Resolution.HOUR).symbol\n        spy_sma = self.sma(spy, 10)     # Data point indicator\n        spy_atr = self.atr(spy, 10,)    # Bar indicator\n        spy_vwap = self.vwap(spy, 10)   # TradeBar indicator\n        self.log(f\"SPY    - Is ready? SMA: {spy_sma.is_ready}, ATR: {spy_atr.is_ready}, VWAP: {spy_vwap.is_ready}\")\n\n        eur = self.add_forex(\"EURUSD\", Resolution.HOUR).symbol\n        eur_sma = self.sma(eur, 20, Resolution.DAILY)\n        eur_atr = self.atr(eur, 20, MovingAverageType.SIMPLE, Resolution.DAILY)\n        self.log(f\"EURUSD - Is ready? SMA: {eur_sma.is_ready}, ATR: {eur_atr.is_ready}\")\n\n        self.add_universe(self.coarse_sma_selector)\n\n        # Since the indicators are ready, we will receive error messages\n        # reporting that the algorithm manager is trying to add old information\n        self.set_warm_up(10)\n\n    def coarse_sma_selector(self, coarse: list[Fundamental]) -> list[Symbol]:\n        score = dict()\n        for cf in coarse:\n            if not cf.has_fundamental_data:\n               continue\n            symbol = cf.symbol\n            price = cf.adjusted_price\n            # grab the SMA instance for this symbol\n            avg = self._averages.setdefault(symbol, SimpleMovingAverage(100))\n            self.warm_up_indicator(symbol, avg, Resolution.DAILY)\n            # Update returns true when the indicators are ready, so don't accept until they are\n            if avg.update(cf.end_time, price):\n               value = avg.current.value\n               # only pick symbols who have their price over their 100 day sma\n               if value > price * self._tolerance:\n                    score[symbol] = (value - price) / ((value + price) / 2)\n\n        # prefer symbols with a larger delta by percentage between the two _averages\n        sorted_score = sorted(score.items(), key=lambda kvp: kvp[1], reverse=True)\n        return [x[0] for x in sorted_score[:self._count]]\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        for security in changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        for security in changes.added_securities:\n            self.set_holdings(security.symbol, self._target_percent)\n"
  },
  {
    "path": "Algorithm.Python/SpreadExecutionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.RsiAlphaModel import RsiAlphaModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.SpreadExecutionModel import SpreadExecutionModel\n\n### <summary>\n### Regression algorithm for the SpreadExecutionModel.\n### This algorithm shows how the execution model works to\n### submit orders only when the price is on desirably tight spread.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass SpreadExecutionModelRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm for the SpreadExecutionModel.\n    This algorithm shows how the execution model works to\n    submit orders only when the price is on desirably tight spread.'''\n\n    def initialize(self):\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n\n        self.set_universe_selection(ManualUniverseSelectionModel([\n            Symbol.create('AIG', SecurityType.EQUITY, Market.USA),\n            Symbol.create('BAC', SecurityType.EQUITY, Market.USA),\n            Symbol.create('IBM', SecurityType.EQUITY, Market.USA),\n            Symbol.create('SPY', SecurityType.EQUITY, Market.USA)\n        ]))\n\n        # using hourly rsi to generate more insights\n        self.set_alpha(RsiAlphaModel(14, Resolution.HOUR))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(SpreadExecutionModel())\n\n        self.insights_generated += self.on_insights_generated\n\n    def on_insights_generated(self, algorithm, data):\n        self.log(f\"{self.time}: {', '.join(str(x) for x in data.insights)}\")\n\n    def on_order_event(self, order_event):\n        self.log(f\"{self.time}: {order_event}\")\n"
  },
  {
    "path": "Algorithm.Python/StableCoinsRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### A demonstration algorithm to check there can be placed an order of a pair not present\n### in the brokerage using the conversion between stablecoins\n### </summary>\nclass StableCoinsRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2018, 5, 1)\n        self.set_end_date(2018, 5, 2)\n        self.set_cash(\"USDT\", 200000000)\n        self.set_brokerage_model(BrokerageName.BINANCE, AccountType.CASH)\n        self.add_crypto(\"BTCUSDT\", Resolution.HOUR, Market.BINANCE)\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.set_holdings(\"BTCUSDT\", 1)\n"
  },
  {
    "path": "Algorithm.Python/StandardDeviationExecutionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.RsiAlphaModel import RsiAlphaModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.StandardDeviationExecutionModel import StandardDeviationExecutionModel\n\n### <summary>\n### Regression algorithm for the StandardDeviationExecutionModel.\n### This algorithm shows how the execution model works to split up orders and submit them\n### only when the price is 2 standard deviations from the 60min mean (default model settings).\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass StandardDeviationExecutionModelRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm for the StandardDeviationExecutionModel.\n    This algorithm shows how the execution model works to split up orders and submit them\n    only when the price is 2 standard deviations from the 60min mean (default model settings).'''\n\n    def initialize(self):\n        ''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        # Set requested data resolution\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(1000000)\n\n        self.set_universe_selection(ManualUniverseSelectionModel([\n            Symbol.create('AIG', SecurityType.EQUITY, Market.USA),\n            Symbol.create('BAC', SecurityType.EQUITY, Market.USA),\n            Symbol.create('IBM', SecurityType.EQUITY, Market.USA),\n            Symbol.create('SPY', SecurityType.EQUITY, Market.USA)\n        ]))\n\n        self.set_alpha(RsiAlphaModel(14, Resolution.HOUR))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(StandardDeviationExecutionModel())\n\n    def on_order_event(self, order_event):\n        self.log(f\"{self.time}: {order_event}\")\n"
  },
  {
    "path": "Algorithm.Python/StatisticsResultsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom System.Collections.Generic import Dictionary\n\n### <summary>\n### Demonstration of how to access the statistics results from within an algorithm through the `Statistics` property.\n### </summary>\nclass StatisticsResultsAlgorithm(QCAlgorithm):\n\n    most_traded_security_statistic = \"Most Traded Security\"\n    most_traded_security_trade_count_statistic = \"Most Traded Security Trade Count\"\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self.spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n        self.ibm = self.add_equity(\"IBM\", Resolution.MINUTE).symbol\n\n        self.fast_spy_ema = self.ema(self.spy, 30, Resolution.MINUTE)\n        self.slow_spy_ema = self.ema(self.spy, 60, Resolution.MINUTE)\n\n        self.fast_ibm_ema = self.ema(self.spy, 10, Resolution.MINUTE)\n        self.slow_ibm_ema = self.ema(self.spy, 30, Resolution.MINUTE)\n\n        self.trade_counts = {self.spy: 0, self.ibm: 0}\n\n    def on_data(self, data: Slice):\n        if not self.slow_spy_ema.is_ready: return\n\n        if self.fast_spy_ema > self.slow_spy_ema:\n            self.set_holdings(self.spy, 0.5)\n        elif self.securities[self.spy].invested:\n            self.liquidate(self.spy)\n\n        if self.fast_ibm_ema > self.slow_ibm_ema:\n            self.set_holdings(self.ibm, 0.2)\n        elif self.securities[self.ibm].invested:\n            self.liquidate(self.ibm)\n\n    def on_order_event(self, order_event):\n        if order_event.status == OrderStatus.FILLED:\n            # We can access the statistics summary at runtime\n            statistics = self.statistics.summary\n            statistics_str = \"\".join([f\"{kvp.key}: {kvp.value}\" for kvp in statistics])\n            self.debug(f\"Statistics after fill:{statistics_str}\")\n\n            # Access a single statistic\n            self.log(f\"Total trades so far: {statistics[PerformanceMetrics.TOTAL_ORDERS]}\")\n            self.log(f\"Sharpe Ratio: {statistics[PerformanceMetrics.SHARPE_RATIO]}\")\n\n            # --------\n\n            # We can also set custom summary statistics:\n\n            if all(count == 0 for count in self.trade_counts.values()):\n                if StatisticsResultsAlgorithm.most_traded_security_statistic in statistics:\n                    raise AssertionError(f\"Statistic {StatisticsResultsAlgorithm.most_traded_security_statistic} should not be set yet\")\n                if StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic in statistics:\n                    raise AssertionError(f\"Statistic {StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic} should not be set yet\")\n            else:\n                # The current most traded security should be set in the summary\n                most_trade_security, most_trade_security_trade_count = self.get_most_trade_security()\n                self.check_most_traded_security_statistic(statistics, most_trade_security, most_trade_security_trade_count)\n\n            # Update the trade count\n            self.trade_counts[order_event.symbol] += 1\n\n            # Set the most traded security\n            most_trade_security, most_trade_security_trade_count = self.get_most_trade_security()\n            self.set_summary_statistic(StatisticsResultsAlgorithm.most_traded_security_statistic, str(most_trade_security))\n            self.set_summary_statistic(StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic, most_trade_security_trade_count)\n\n            # Re-calculate statistics:\n            statistics = self.statistics.summary\n\n            # Let's keep track of our custom summary statistics after the update\n            self.check_most_traded_security_statistic(statistics, most_trade_security, most_trade_security_trade_count)\n\n    def on_end_of_algorithm(self):\n        statistics = self.statistics.summary\n        if StatisticsResultsAlgorithm.most_traded_security_statistic not in statistics:\n            raise AssertionError(f\"Statistic {StatisticsResultsAlgorithm.most_traded_security_statistic} should be in the summary statistics\")\n        if StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic not in statistics:\n            raise AssertionError(f\"Statistic {StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic} should be in the summary statistics\")\n\n        most_trade_security, most_trade_security_trade_count = self.get_most_trade_security()\n        self.check_most_traded_security_statistic(statistics, most_trade_security, most_trade_security_trade_count)\n\n    def check_most_traded_security_statistic(self, statistics: Dictionary[str, str], most_traded_security: Symbol, trade_count: int):\n        most_traded_security_statistic = statistics[StatisticsResultsAlgorithm.most_traded_security_statistic]\n        most_traded_security_trade_count_statistic = statistics[StatisticsResultsAlgorithm.most_traded_security_trade_count_statistic]\n        self.log(f\"Most traded security: {most_traded_security_statistic}\")\n        self.log(f\"Most traded security trade count: {most_traded_security_trade_count_statistic}\")\n\n        if most_traded_security_statistic != most_traded_security:\n            raise AssertionError(f\"Most traded security should be {most_traded_security} but it is {most_traded_security_statistic}\")\n\n        if most_traded_security_trade_count_statistic != str(trade_count):\n            raise AssertionError(f\"Most traded security trade count should be {trade_count} but it is {most_traded_security_trade_count_statistic}\")\n\n    def get_most_trade_security(self) -> tuple[Symbol, int]:\n        most_trade_security = max(self.trade_counts, key=lambda symbol: self.trade_counts[symbol])\n        most_trade_security_trade_count = self.trade_counts[most_trade_security]\n        return most_trade_security, most_trade_security_trade_count\n\n"
  },
  {
    "path": "Algorithm.Python/StochasticIndicatorWarmsUpProperlyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import timedelta\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm that asserts Stochastic indicator, registered with a different resolution consolidator,\n### is warmed up properly by calling QCAlgorithm.WarmUpIndicator\n### </summary>\nclass StochasticIndicatorWarmsUpProperlyRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2020, 1, 1)  # monday = holiday..\n        self.set_end_date(2020, 2, 1)\n        self.set_cash(100000)\n\n        self.data_points_received = False\n        self.spy = self.add_equity(\"SPY\", Resolution.HOUR).symbol\n\n        self.daily_consolidator = TradeBarConsolidator(timedelta(days=1))\n\n        self._rsi = RelativeStrengthIndex(14, MovingAverageType.WILDERS)\n        self._sto = Stochastic(\"FIRST\", 10, 3, 3)\n        self.register_indicator(self.spy, self._rsi, self.daily_consolidator)\n        self.register_indicator(self.spy, self._sto, self.daily_consolidator)\n\n        # warm_up indicator\n        self.warm_up_indicator(self.spy, self._rsi, timedelta(days=1))\n        self.warm_up_indicator(self.spy, self._sto, timedelta(days=1))\n        \n\n        self._rsi_history = RelativeStrengthIndex(14, MovingAverageType.WILDERS)\n        self._sto_history = Stochastic(\"SECOND\", 10, 3, 3)\n        self.register_indicator(self.spy, self._rsi_history, self.daily_consolidator)\n        self.register_indicator(self.spy, self._sto_history, self.daily_consolidator)\n\n        # history warm up\n        history = self.history[TradeBar](self.spy, max(self._rsi_history.warm_up_period, self._sto_history.warm_up_period), Resolution.DAILY)\n        for bar in history:\n            self._rsi_history.update(bar.end_time, bar.close)\n            if self._rsi_history.samples == 1:\n                continue\n            self._sto_history.update(bar)\n\n        indicators = [self._rsi, self._sto, self._rsi_history, self._sto_history]\n        for indicator in indicators:\n            if not indicator.is_ready:\n                raise AssertionError(f\"{indicator.name} should be ready, but it is not. Number of samples: {indicator.samples}\")\n\n    def on_data(self, data: Slice):\n        if self.is_warming_up:\n            return\n\n        if data.contains_key(self.spy):\n            self.data_points_received = True\n            if self._rsi.current.value != self._rsi_history.current.value:\n                raise AssertionError(f\"Values of indicators differ: {self._rsi.name}: {self._rsi.current.value} | {self._rsi_history.name}: {self._rsi_history.current.value}\")\n            \n            if self._sto.stoch_k.current.value != self._sto_history.stoch_k.current.value:\n                raise AssertionError(f\"Stoch K values of indicators differ: {self._sto.name}.StochK: {self._sto.stoch_k.current.value} | {self._sto_history.name}.StochK: {self._sto_history.stoch_k.current.value}\")\n            \n            if self._sto.stoch_d.current.value != self._sto_history.stoch_d.current.value:\n                raise AssertionError(f\"Stoch D values of indicators differ: {self._sto.name}.StochD: {self._sto.stoch_d.current.value} | {self._sto_history.name}.StochD: {self._sto_history.stoch_d.current.value}\")\n\n    def on_end_of_algorithm(self):\n        if not self.data_points_received:\n            raise AssertionError(\"No data points received\")\n"
  },
  {
    "path": "Algorithm.Python/StopLimitOrderAsyncRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom StopLimitOrderRegressionAlgorithm import StopLimitOrderRegressionAlgorithm\n\n### <summary>\n### Basic algorithm demonstrating how to place stop limit orders asynchronously.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"stop limit order\"/>\nclass StopLimitOrderAsyncRegressionAlgorithm(StopLimitOrderRegressionAlgorithm):\n    '''Basic algorithm demonstrating how to place stop limit orders.'''\n\n    asynchronous_orders = True\n"
  },
  {
    "path": "Algorithm.Python/StopLimitOrderRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic algorithm demonstrating how to place stop limit orders.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"stop limit order\"/>\nclass StopLimitOrderRegressionAlgorithm(QCAlgorithm):\n    '''Basic algorithm demonstrating how to place stop limit orders.'''\n\n    tolerance = 0.001\n    fast_period = 30\n    slow_period = 60\n    asynchronous_orders = False\n\n    def initialize(self):\n        self.set_start_date(2013, 1, 1)\n        self.set_end_date(2017, 1, 1)\n        self.set_cash(100000)\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n\n        self._fast = self.ema(self._symbol, self.fast_period, Resolution.DAILY)\n        self._slow = self.ema(self._symbol, self.slow_period, Resolution.DAILY)\n\n        self._buy_order_ticket: OrderTicket = None\n        self._sell_order_ticket: OrderTicket = None\n        self._previous_slice: Slice = None\n\n    def on_data(self, slice: Slice):\n        if not self.is_ready():\n            return\n\n        security = self.securities[self._symbol]\n        if self._buy_order_ticket is None and self.trend_is_up():\n            self._buy_order_ticket = self.stop_limit_order(self._symbol, 100, stop_price=security.high * 1.10, limit_price=security.high * 1.11, asynchronous=self.asynchronous_orders)\n        elif self._buy_order_ticket.status == OrderStatus.FILLED and self._sell_order_ticket is None and self.trend_is_down():\n            self._sell_order_ticket = self.stop_limit_order(self._symbol, -100, stop_price=security.low * 0.99, limit_price=security.low * 0.98, asynchronous=self.asynchronous_orders)\n\n    def on_order_event(self, order_event: OrderEvent):\n        if order_event.status == OrderStatus.FILLED:\n            order = self.transactions.get_order_by_id(order_event.order_id)\n            if not order.stop_triggered:\n                raise AssertionError(\"StopLimitOrder StopTriggered should haven been set if the order filled.\")\n\n            if order_event.direction == OrderDirection.BUY:\n                limit_price = self._buy_order_ticket.get(OrderField.LIMIT_PRICE)\n                if order_event.fill_price > limit_price:\n                    raise AssertionError(f\"Buy stop limit order should have filled with price less than or equal to the limit price {limit_price}. \"\n                                    f\"Fill price: {order_event.fill_price}\")\n            else:\n                limit_price = self._sell_order_ticket.get(OrderField.LIMIT_PRICE)\n                if order_event.fill_price < limit_price:\n                    raise AssertionError(f\"Sell stop limit order should have filled with price greater than or equal to the limit price {limit_price}. \"\n                                    f\"Fill price: {order_event.fill_price}\")\n\n    def on_end_of_algorithm(self):\n        for ticket in self.transactions.get_order_tickets():\n            if ticket.submit_request.asynchronous != self.asynchronous_orders:\n                raise AssertionError(\"Expected all orders to have the same asynchronous flag as the algorithm.\")\n\n    def is_ready(self):\n        return self._fast.is_ready and self._slow.is_ready\n\n    def trend_is_up(self):\n        return self.is_ready() and self._fast.current.value > self._slow.current.value * (1 + self.tolerance)\n\n    def trend_is_down(self):\n        return self.is_ready() and self._fast.current.value < self._slow.current.value * (1 + self.tolerance)\n"
  },
  {
    "path": "Algorithm.Python/StringToSymbolImplicitConversionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Related to GH issue 4275, reproduces a failed string to symbol implicit conversion asserting the exception\n### thrown contains the used ticker\n### </summary>\nclass StringToSymbolImplicitConversionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10, 8)\n\n        self.add_equity(\"SPY\", Resolution.MINUTE)\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        ticket = self.market_order(\"PEPE\", 1)\n\n        if ticket.status != OrderStatus.INVALID:\n            raise Exception(f\"Expected order to be invalid since PEPE is not a valid ticker, but was {ticket.status}\")\n\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n"
  },
  {
    "path": "Algorithm.Python/TalibIndicatorsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport talib\n\nclass CalibratedResistanceAtmosphericScrubbers(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 1, 2)\n        self.set_end_date(2020, 1, 6) \n        self.set_cash(100000) \n        self.add_equity(\"SPY\", Resolution.HOUR)\n        \n        self.rolling_window = pd.DataFrame()\n        self.dema_period = 3\n        self.sma_period = 3\n        self.wma_period = 3\n        self.window_size = self.dema_period * 2\n        self.set_warm_up(self.window_size)\n        \n    def on_data(self, data):\n        if \"SPY\" not in data.bars:\n            return\n        \n        close = data[\"SPY\"].close\n        \n        if self.is_warming_up:\n            # Add latest close to rolling window\n            row = pd.DataFrame({\"close\": [close]}, index=[data.time])\n            self.rolling_window = pd.concat([self.rolling_window, row]).iloc[-self.window_size:]\n            \n            # If we have enough closing data to start calculating indicators...\n            if self.rolling_window.shape[0] == self.window_size:\n                closes = self.rolling_window['close'].values\n                \n                # Add indicator columns to DataFrame\n                self.rolling_window['DEMA'] = talib.DEMA(closes, self.dema_period)\n                self.rolling_window['EMA'] = talib.EMA(closes, self.sma_period)\n                self.rolling_window['WMA'] = talib.WMA(closes, self.wma_period)\n            return\n        \n        closes = np.append(self.rolling_window['close'].values, close)[-self.window_size:]\n        \n        # Update talib indicators time series with the latest close\n        row = pd.DataFrame({\"close\": close,\n                            \"DEMA\" : talib.DEMA(closes, self.dema_period)[-1],\n                            \"EMA\"  : talib.EMA(closes, self.sma_period)[-1],\n                            \"WMA\"  : talib.WMA(closes, self.wma_period)[-1]},\n                            index=[data.time])\n        \n        self.rolling_window = pd.concat([self.rolling_window, row]).iloc[-self.window_size:]\n\n        \n    def on_end_of_algorithm(self):\n        self.log(f\"\\nRolling Window:\\n{self.rolling_window.to_string()}\\n\")\n        self.log(f\"\\nLatest Values:\\n{self.rolling_window.iloc[-1].to_string()}\\n\")\n"
  },
  {
    "path": "Algorithm.Python/TensorFlowNeuralNetworkAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nimport tensorflow.compat.v1 as tf\n\nclass TensorFlowNeuralNetworkAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_start_date(2013, 10, 7)  # Set Start Date\n        self.set_end_date(2013, 10, 8) # Set End Date\n        \n        self.set_cash(100000)  # Set Strategy Cash\n        spy = self.add_equity(\"SPY\", Resolution.MINUTE) # Add Equity\n        \n        self.symbols = [spy.symbol] # potential trading symbols pool (in this algorithm there is only 1). \n        self.lookback = 30 # number of previous days for training\n        \n        self.schedule.on(self.date_rules.every(DayOfWeek.MONDAY), self.time_rules.after_market_open(\"SPY\", 28), self.net_train) # train the neural network 28 mins after market open\n        self.schedule.on(self.date_rules.every(DayOfWeek.MONDAY), self.time_rules.after_market_open(\"SPY\", 30), self.trade) # trade 30 mins after market open\n        \n    def add_layer(self, inputs: tf.Tensor, in_size: int, out_size: int, activation_function: tf.keras.layers.Activation = None) -> tf.Tensor:\n        # add one more layer and return the output of this layer\n        # this is one NN with only one hidden layer\n        weights = tf.Variable(tf.random_normal([in_size, out_size]))\n        biases = tf.Variable(tf.zeros([1, out_size]) + 0.1)\n        wx_plus_b = tf.matmul(inputs, weights) + biases\n        if activation_function is None:\n            outputs = wx_plus_b\n        else:\n            outputs = activation_function(wx_plus_b)\n        return outputs\n    \n    def net_train(self) -> None:\n        # Daily historical data is used to train the machine learning model\n        history = self.history(self.symbols, self.lookback + 1, Resolution.DAILY)\n        \n        # model: use prices_x to fit prices_y; key: symbol; value: according price\n        self.prices_x, self.prices_y = {}, {}\n        \n        # key: symbol; values: prices for sell or buy \n        self.sell_prices, self.buy_prices = {}, {}\n        \n        for symbol in self.symbols:\n            if not history.empty:\n                # Daily historical data is used to train the machine learning model \n                # use open prices to predict the next days'\n                self.prices_x[symbol] = list(history.loc[symbol.value]['open'][:-1])\n                self.prices_y[symbol] = list(history.loc[symbol.value]['open'][1:])\n        \n        for symbol in self.symbols:\n            if symbol in self.prices_x:\n                # create numpy array\n                x_data = np.array(self.prices_x[symbol]).astype(np.float32).reshape((-1,1))\n                y_data = np.array(self.prices_y[symbol]).astype(np.float32).reshape((-1,1))\n                \n                # define placeholder for inputs to network\n                tf.disable_v2_behavior()\n                xs = tf.placeholder(tf.float32, [None, 1])\n                ys = tf.placeholder(tf.float32, [None, 1])\n                \n                # add hidden layer\n                l1 = self.add_layer(xs, 1, 10, activation_function=tf.nn.relu)\n                # add output layer\n                prediction = self.add_layer(l1, 10, 1, activation_function=None)\n                \n                # the error between prediciton and real data\n                loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction),\n                                     reduction_indices=[1]))\n                # use gradient descent and square error\n                train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)\n                \n                # the following is precedure for tensorflow\n                sess = tf.Session()\n                \n                init = tf.global_variables_initializer()\n                sess.run(init)\n                \n                for i in range(200):\n                    # training\n                    sess.run(train_step, feed_dict={xs: x_data, ys: y_data})\n            \n            # predict today's price\n            y_pred_final = sess.run(prediction, feed_dict = {xs: y_data})[0][-1]\n            \n            # get sell prices and buy prices as trading signals\n            self.sell_prices[symbol] = y_pred_final - np.std(y_data)\n            self.buy_prices[symbol] = y_pred_final + np.std(y_data)\n        \n    def trade(self) -> None:\n        ''' \n        Enter or exit positions based on relationship of the open price of the current bar and the prices defined by the machine learning model.\n        Liquidate if the open price is below the sell price and buy if the open price is above the buy price \n        ''' \n        for holding in self.portfolio.values():\n            if holding.symbol not in self.current_slice.bars:\n                return\n            \n            if self.current_slice.bars[holding.symbol].open < self.sell_prices[holding.symbol] and holding.invested:\n                self.liquidate(holding.symbol)\n            \n            if self.current_slice.bars[holding.symbol].open > self.buy_prices[holding.symbol] and not holding.invested:\n                self.set_holdings(holding.symbol, 1 / len(self.symbols))\n"
  },
  {
    "path": "Algorithm.Python/TickDataFilteringAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import timedelta\nfrom AlgorithmImports import *\n\n# <summary>\n# Demonstration of filtering tick data so easier to use. Tick data has lots of glitchy, spikey data which should be filtered out before usagee.\n# </summary>\n# <meta name=\"tag\" content=\"filtering\" />\n# <meta name=\"tag\" content=\"tick data\" />\n# <meta name=\"tag\" content=\"using data\" />\n# <meta name=\"tag\" content=\"ticks event\" />\nclass TickDataFilteringAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 7)\n        self.set_cash(25000)\n        spy = self.add_equity(\"SPY\", Resolution.TICK)\n\n        #Add our custom data filter.\n        spy.set_data_filter(TickExchangeDataFilter(self))\n\n        self._order_time = None\n\n    # <summary>\n    # Data arriving here will now be filtered.\n    # </summary>\n    # <param name=\"data\">Ticks data array</param>\n    def on_data(self, data):\n        if not data.contains_key(\"SPY\"):\n            return\n\n        spy_tick_list = data[\"SPY\"]\n\n        # Ticks return a list of ticks this second\n        for tick in spy_tick_list:\n            self.debug(tick.exchange)\n\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n            self._order_time = self.time\n        # Let's shortcut to reduce regression test duration\n        elif self.time - self._order_time > timedelta(minutes=5):\n            self.quit()\n\n# <summary>\n# Exchange filter class\n# </summary>\nclass TickExchangeDataFilter(SecurityDataFilter):\n\n    # <summary>\n    # Save instance of the algorithm namespace\n    # </summary>\n    # <param name=\"algo\"></param>\n    def __init__(self, algo: IAlgorithm):\n        self.algo = algo\n        super().__init__()\n\n    # <summary>\n    # Filter out a tick from this vehicle, with this new data:\n    # </summary>\n    # <param name=\"data\">New data packet:</param>\n    # <param name=\"asset\">Vehicle of this filter.</param>\n    def filter(self, asset: Security, data: BaseData):\n        # TRUE -->  Accept Tick\n        # FALSE --> Reject Tick\n\n        if isinstance(data, Tick):\n            if data.exchange == str(Exchange.ARCA):\n                return True\n\n        return False\n"
  },
  {
    "path": "Algorithm.Python/TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom datetime import timedelta\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting that historical data can be requested with tick resolution without requiring\n### a tick resolution subscription\n### </summary>\nclass TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 8)\n        self.set_end_date(2013, 10, 8)\n\n        # Subscribing SPY and IBM with daily and hour resolution instead of tick resolution\n        spy = self.add_equity(\"SPY\", Resolution.DAILY).symbol\n        ibm = self.add_equity(\"IBM\", Resolution.HOUR).symbol\n\n        # Requesting history for SPY and IBM (separately) with tick resolution\n        spy_history = self.history[Tick](spy, timedelta(days=1), Resolution.TICK)\n        if not any(spy_history):\n            raise AssertionError(\"SPY tick history is empty\")\n\n        ibm_history = self.history[Tick](ibm, timedelta(days=1), Resolution.TICK)\n        if not any(ibm_history):\n            raise AssertionError(\"IBM tick history is empty\")\n\n        # Requesting history for SPY and IBM (together) with tick resolution\n        spy_ibm_history = self.history[Tick]([spy, ibm], timedelta(days=1), Resolution.TICK)\n        if not any(spy_ibm_history):\n            raise AssertionError(\"Compound SPY and IBM tick history is empty\")\n\n        self.quit()\n"
  },
  {
    "path": "Algorithm.Python/TiingoPriceAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.Tiingo import TiingoPrice\n\n### <summary>\n### This example algorithm shows how to import and use Tiingo daily prices data.\n### </summary>\n### <meta name=\"tag\" content=\"strategy example\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"custom data\" />\n### <meta name=\"tag\" content=\"tiingo\" />\nclass TiingoPriceAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n        self.set_start_date(2017, 1, 1)\n        self.set_end_date(2017, 12, 31)\n        self.set_cash(100000)\n\n        # Set your Tiingo API Token here\n        Tiingo.set_auth_code(\"my-tiingo-api-token\")\n\n        self._equity = self.add_equity(\"AAPL\").symbol\n        self._aapl = self.add_data(TiingoPrice, self._equity, Resolution.DAILY).symbol\n\n        self._ema_fast = self.ema(self._equity, 5)\n        self._ema_slow = self.ema(self._equity, 10)\n\n\n    def on_data(self, slice):\n        # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        if not slice.contains_key(self._equity): return\n\n        # Extract Tiingo data from the slice\n        row = slice[self._equity]\n\n        if not row:\n            return\n\n        if self._ema_fast.is_ready and self._ema_slow.is_ready:\n            self.log(f\"{self.time} - {row.symbol.value} - {row.close} {row.value} {row.price} - EmaFast:{self._ema_fast} - EmaSlow:{self._ema_slow}\")\n\n        # Simple EMA cross\n        if not self.portfolio.invested and self._ema_fast > self._ema_slow:\n            self.set_holdings(self._equity, 1)\n\n        elif self.portfolio.invested and self._ema_fast < self._ema_slow:\n            self.liquidate(self._equity)\n"
  },
  {
    "path": "Algorithm.Python/TimeInForceAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration algorithm of time in force order settings.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass TimeInForceAlgorithm(QCAlgorithm):\n\n    # Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.\n    def initialize(self):\n\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        # The default time in force setting for all orders is GoodTilCancelled (GTC),\n        # uncomment this line to set a different time in force.\n        # We currently only support GTC and DAY.\n        # self.default_order_properties.time_in_force = TimeInForce.day\n\n        self._symbol = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n\n        self._gtc_order_ticket1 = None\n        self._gtc_order_ticket2 = None\n        self._day_order_ticket1 = None\n        self._day_order_ticket2 = None\n        self._gtd_order_ticket1 = None\n        self._gtd_order_ticket2 = None\n        self._expected_order_statuses = {}\n\n    # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n    # Arguments:\n    #    data: Slice object keyed by symbol containing the stock data\n    def on_data(self, data):\n\n        if not self._gtc_order_ticket1:\n            # These GTC orders will never expire and will not be canceled automatically.\n\n            self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED\n\n            # this order will not be filled before the end of the backtest\n            self._gtc_order_ticket1 = self.limit_order(self._symbol, 10, 100)\n            self._expected_order_statuses[self._gtc_order_ticket1.order_id] = OrderStatus.SUBMITTED\n\n            # this order will be filled before the end of the backtest\n            self._gtc_order_ticket2 = self.limit_order(self._symbol, 10, 160)\n            self._expected_order_statuses[self._gtc_order_ticket2.order_id] = OrderStatus.FILLED\n\n        if not self._day_order_ticket1:\n            # These DAY orders will expire at market close,\n            # if not filled by then they will be canceled automatically.\n\n            self.default_order_properties.time_in_force = TimeInForce.DAY\n\n            # this order will not be filled before market close and will be canceled\n            self._day_order_ticket1 = self.limit_order(self._symbol, 10, 140)\n            self._expected_order_statuses[self._day_order_ticket1.order_id] = OrderStatus.CANCELED\n\n            # this order will be filled before market close\n            self._day_order_ticket2 = self.limit_order(self._symbol, 10, 180)\n            self._expected_order_statuses[self._day_order_ticket2.order_id] = OrderStatus.FILLED\n\n        if not self._gtd_order_ticket1:\n            # These GTD orders will expire on October 10th at market close,\n            # if not filled by then they will be canceled automatically.\n\n            self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_DATE(datetime(2013, 10, 10))\n\n            # this order will not be filled before expiry and will be canceled\n            self._gtd_order_ticket1 = self.limit_order(self._symbol, 10, 100)\n            self._expected_order_statuses[self._gtd_order_ticket1.order_id] = OrderStatus.CANCELED\n\n            # this order will be filled before expiry\n            self._gtd_order_ticket2 = self.limit_order(self._symbol, 10, 160)\n            self._expected_order_statuses[self._gtd_order_ticket2.order_id] = OrderStatus.FILLED\n\n    # Order event handler. This handler will be called for all order events, including submissions, fills, cancellations.\n    # This method can be called asynchronously, ensure you use proper locks on thread-unsafe objects\n    def on_order_event(self, orderEvent):\n        self.debug(f\"{self.time} {orderEvent}\")\n\n    # End of algorithm run event handler. This method is called at the end of a backtest or live trading operation.\n    def on_end_of_algorithm(self):\n        for orderId, expectedStatus in self._expected_order_statuses.items():\n            order = self.transactions.get_order_by_id(orderId)\n            if order.status != expectedStatus:\n                raise AssertionError(f\"Invalid status for order {orderId} - Expected: {expectedStatus}, actual: {order.status}\")\n"
  },
  {
    "path": "Algorithm.Python/TrailingStopOrderAsyncRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom TrailingStopOrderRegressionAlgorithm import TrailingStopOrderRegressionAlgorithm\n\n### <summary>\n### Basic algorithm demonstrating how to place trailing stop orders asynchronously.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"trailing stop order\"/>\nclass TrailingStopOrderAsyncRegressionAlgorithm(TrailingStopOrderRegressionAlgorithm):\n    '''Basic algorithm demonstrating how to place trailing stop orders.'''\n\n    asynchronous_orders = True\n"
  },
  {
    "path": "Algorithm.Python/TrailingStopOrderRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Basic algorithm demonstrating how to place trailing stop orders.\n### </summary>\n### <meta name=\"tag\" content=\"trading and orders\" />\n### <meta name=\"tag\" content=\"placing orders\" />\n### <meta name=\"tag\" content=\"trailing stop order\"/>\nclass TrailingStopOrderRegressionAlgorithm(QCAlgorithm):\n    '''Basic algorithm demonstrating how to place trailing stop orders.'''\n\n    buy_trailing_amount = 2\n    sell_trailing_amount = 0.5\n    asynchronous_orders = False\n\n    def initialize(self):\n\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)\n\n        self._symbol = self.add_equity(\"SPY\").symbol\n\n        self._buy_order_ticket: OrderTicket = None\n        self._sell_order_ticket: OrderTicket = None\n        self._previous_slice: Slice = None\n\n    def on_data(self, slice: Slice):\n        if not slice.contains_key(self._symbol):\n            return\n\n        if self._buy_order_ticket is None:\n            self._buy_order_ticket = self.trailing_stop_order(self._symbol, 100, trailing_amount=self.buy_trailing_amount, trailing_as_percentage=False, asynchronous=self.asynchronous_orders)\n        elif self._buy_order_ticket.status != OrderStatus.FILLED:\n            stop_price = self._buy_order_ticket.get(OrderField.STOP_PRICE)\n\n            # Get the previous bar to compare to the stop price,\n            # because stop price update attempt with the current slice data happens after OnData.\n            low = self._previous_slice.quote_bars[self._symbol].ask.low if self._previous_slice.quote_bars.contains_key(self._symbol) \\\n                else self._previous_slice.bars[self._symbol].low\n\n            stop_price_to_market_price_distance = stop_price - low\n            if stop_price_to_market_price_distance > self.buy_trailing_amount:\n                raise AssertionError(f\"StopPrice {stop_price} should be within {self.buy_trailing_amount} of the previous low price {low} at all times.\")\n\n        if self._sell_order_ticket is None:\n            if self.portfolio.invested:\n                self._sell_order_ticket = self.trailing_stop_order(self._symbol, -100, trailing_amount=self.sell_trailing_amount, trailing_as_percentage=False, asynchronous=self.asynchronous_orders)\n        elif self._sell_order_ticket.status != OrderStatus.FILLED:\n            stop_price = self._sell_order_ticket.get(OrderField.STOP_PRICE)\n\n            # Get the previous bar to compare to the stop price,\n            # because stop price update attempt with the current slice data happens after OnData.\n            high = self._previous_slice.quote_bars[self._symbol].bid.high if self._previous_slice.quote_bars.contains_key(self._symbol) \\\n                    else self._previous_slice.bars[self._symbol].high\n            stop_price_to_market_price_distance = high - stop_price\n            if stop_price_to_market_price_distance > self.sell_trailing_amount:\n                raise AssertionError(f\"StopPrice {stop_price} should be within {self.sell_trailing_amount} of the previous high price {high} at all times.\")\n\n        self._previous_slice = slice\n\n    def on_order_event(self, orderEvent: OrderEvent):\n        if orderEvent.status == OrderStatus.FILLED:\n            if orderEvent.direction == OrderDirection.BUY:\n                stop_price = self._buy_order_ticket.get(OrderField.STOP_PRICE)\n                if orderEvent.fill_price < stop_price:\n                    raise AssertionError(f\"Buy trailing stop order should have filled with price greater than or equal to the stop price {stop_price}. \"\n                                    f\"Fill price: {orderEvent.fill_price}\")\n            else:\n                stop_price = self._sell_order_ticket.get(OrderField.STOP_PRICE)\n                if orderEvent.fill_price > stop_price:\n                    raise AssertionError(f\"Sell trailing stop order should have filled with price less than or equal to the stop price {stop_price}. \"\n                                    f\"Fill price: {orderEvent.fill_price}\")\n\n    def on_end_of_algorithm(self):\n        for ticket in self.transactions.get_order_tickets():\n            if ticket.submit_request.asynchronous != self.asynchronous_orders:\n                raise AssertionError(\"Expected all orders to have the same asynchronous flag as the algorithm.\")\n"
  },
  {
    "path": "Algorithm.Python/TrailingStopRiskFrameworkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom BaseFrameworkRegressionAlgorithm import BaseFrameworkRegressionAlgorithm\nfrom Risk.TrailingStopRiskManagementModel import TrailingStopRiskManagementModel\n\nclass TrailingStopRiskFrameworkRegressionAlgorithm(BaseFrameworkRegressionAlgorithm):\n    '''Show example of how to use the TrailingStopRiskManagementModel'''\n\n    def initialize(self):\n        super().initialize()\n        self.set_universe_selection(ManualUniverseSelectionModel([Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA)]))\n\n        self.set_risk_management(TrailingStopRiskManagementModel(0.01))\n"
  },
  {
    "path": "Algorithm.Python/TrainingExampleAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom time import sleep\n\n### <summary>\n### Example algorithm showing how to use QCAlgorithm.train method\n### </summary>\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"training\" />\nclass TrainingExampleAlgorithm(QCAlgorithm):\n    '''Example algorithm showing how to use QCAlgorithm.train method'''\n\n    def initialize(self):\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 14)\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n        # Set TrainingMethod to be executed immediately\n        self.train(self.training_method)\n\n        # Set TrainingMethod to be executed at 8:00 am every Sunday\n        self.train(self.date_rules.every(DayOfWeek.SUNDAY), self.time_rules.at(8 , 0), self.training_method)\n\n    def training_method(self):\n\n        self.log(f'Start training at {self.time}')\n        # Use the historical data to train the machine learning model\n        history = self.history([\"SPY\"], 200, Resolution.DAILY)\n\n        # ML code:\n        pass\n"
  },
  {
    "path": "Algorithm.Python/TrainingInitializeRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom time import sleep\n\n### <summary>\n### This regression algorithm is expected to fail and verifies that a training event\n### created in Initialize will get run AND it will cause the algorithm to fail if it\n### exceeds the \"algorithm-manager-time-loop-maximum\" config value, which the regression\n### test sets to 0.5 minutes.\n### </summary>\nclass TrainingInitializeRegressionAlgorithm(QCAlgorithm):\n    '''Example algorithm showing how to use QCAlgorithm.train method'''\n\n    def initialize(self):\n\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n\n        self.add_equity(\"SPY\", Resolution.DAILY)\n\n        # this should cause the algorithm to fail\n        # the regression test sets the time limit to 30 seconds and there's one extra\n        # minute in the bucket, so a two minute sleep should result in RuntimeError\n        self.train(lambda: sleep(150))\n\n        # DateRules.tomorrow combined with TimeRules.midnight enforces that this event schedule will\n        # have exactly one time, which will fire between the first data point and the next day at\n        # midnight. So after the first data point, it will run this event and sleep long enough to\n        # exceed the static max algorithm time loop time and begin to consume from the leaky bucket\n        # the regression test sets the \"algorithm-manager-time-loop-maximum\" value to 30 seconds\n        self.train(self.date_rules.tomorrow, self.time_rules.midnight, lambda: sleep(60))\n                    # this will consume the single 'minute' available in the leaky bucket\n                    # and the regression test will confirm that the leaky bucket is empty\n"
  },
  {
    "path": "Algorithm.Python/TwoLegCurrencyConversionRegressionAlgorithm.py",
    "content": "### QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n### Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n###\n### Licensed under the Apache License, Version 2.0 (the \"License\");\n### you may not use this file except in compliance with the License.\n### You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n###\n### Unless required by applicable law or agreed to in writing, software\n### distributed under the License is distributed on an \"AS IS\" BASIS,\n### WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n### See the License for the specific language governing permissions and\n### limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm which tests that a two leg currency conversion happens correctly\n### </summary>\nclass TwoLegCurrencyConversionRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2018, 4, 4)\n        self.set_end_date(2018, 4, 4)\n        self.set_brokerage_model(BrokerageName.GDAX, AccountType.CASH)\n        # GDAX doesn't have LTCETH or ETHLTC, but they do have ETHUSD and LTCUSD to form a path between ETH and LTC\n        self.set_account_currency(\"ETH\")\n        self.set_cash(\"ETH\", 100000)\n        self.set_cash(\"LTC\", 100000)\n        self.set_cash(\"USD\", 100000)\n\n        self._eth_usd_symbol = self.add_crypto(\"ETHUSD\", Resolution.MINUTE).symbol\n        self._ltc_usd_symbol = self.add_crypto(\"LTCUSD\", Resolution.MINUTE).symbol\n\n    def on_data(self, data):\n        if not self.portfolio.invested:\n            self.market_order(self._ltc_usd_symbol, 1)\n\n    def on_end_of_algorithm(self):\n        ltc_cash = self.portfolio.cash_book[\"LTC\"]\n\n        conversion_symbols = [x.symbol for x in ltc_cash.currency_conversion.conversion_rate_securities]\n\n        if len(conversion_symbols) != 2:\n            raise ValueError(\n                f\"Expected two conversion rate securities for LTC to ETH, is {len(conversion_symbols)}\")\n\n        if conversion_symbols[0] != self._ltc_usd_symbol:\n            raise ValueError(\n                f\"Expected first conversion rate security from LTC to ETH to be {self._ltc_usd_symbol}, is {conversion_symbols[0]}\")\n\n        if conversion_symbols[1] != self._eth_usd_symbol:\n            raise ValueError(\n                f\"Expected second conversion rate security from LTC to ETH to be {self._eth_usd_symbol}, is {conversion_symbols[1]}\")\n\n        ltc_usd_value = self.securities[self._ltc_usd_symbol].get_last_data().value\n        eth_usd_value = self.securities[self._eth_usd_symbol].get_last_data().value\n\n        expected_conversion_rate = ltc_usd_value / eth_usd_value\n        actual_conversion_rate = ltc_cash.conversion_rate\n\n        if actual_conversion_rate != expected_conversion_rate:\n            raise ValueError(\n                f\"Expected conversion rate from LTC to ETH to be {expected_conversion_rate}, is {actual_conversion_rate}\")\n"
  },
  {
    "path": "Algorithm.Python/UniverseOnlyRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Asserts that algorithms can be universe-only, that is, universe selection is performed even if the ETF security is not explicitly added.\n### Reproduces https://github.com/QuantConnect/Lean/issues/7473\n### </summary>\nclass UniverseOnlyRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2020, 12, 1)\n        self.set_end_date(2020, 12, 12)\n        self.set_cash(100000)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Add universe without a security added\n        self.add_universe(self.universe.etf(\"GDVD\", self.universe_settings, self.filter_universe))\n\n        self.selection_done = False\n\n    def filter_universe(self, constituents: List[ETFConstituentData]) -> List[Symbol]:\n        self.selection_done = True\n        return [x.symbol for x in constituents]\n\n    def on_end_of_algorithm(self):\n        if not self.selection_done:\n            raise AssertionError(\"Universe selection was not performed\")\n"
  },
  {
    "path": "Algorithm.Python/UniverseSelectedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm asserting the behavior of Universe.SELECTED collection\n### </summary>\nclass UniverseSelectedRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2014, 3, 25)\n        self.set_end_date(2014, 3, 27)\n\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self._universe = self.add_universe(self.selection_function)\n        self.selection_count = 0\n\n    def selection_function(self, fundamentals):\n        sorted_by_dollar_volume = sorted(fundamentals, key=lambda x: x.dollar_volume, reverse=True)\n\n        sorted_by_dollar_volume = sorted_by_dollar_volume[self.selection_count:]\n        self.selection_count = self.selection_count + 1\n\n        # return the symbol objects of the top entries from our sorted collection\n        return [ x.symbol for x in sorted_by_dollar_volume[:self.selection_count] ]\n\n    def on_data(self, data):\n        if Symbol.create(\"TSLA\", SecurityType.EQUITY, Market.USA) in self._universe.selected:\n            raise ValueError(f\"TSLA shouldn't of been selected\")\n\n        self.buy(next(iter(self._universe.selected)), 1)\n\n    def on_end_of_algorithm(self):\n        if self.selection_count != 3:\n            raise ValueError(f\"Unexpected selection count {self.selection_count}\")\n        if self._universe.selected.count != 3 or self._universe.selected.count == self._universe.members.count:\n            raise ValueError(f\"Unexpected universe selected count {self._universe.selected.count}\")\n"
  },
  {
    "path": "Algorithm.Python/UniverseSelectionDefinitionsAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm shows some of the various helper methods available when defining universes\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"coarse universes\" />\nclass UniverseSelectionDefinitionsAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        # subscriptions added via universe selection will have this resolution\n        self.universe_settings.resolution = Resolution.DAILY\n\n        self.set_start_date(2014,3,24)    # Set Start Date\n        self.set_end_date(2014,3,28)     # Set End Date\n        self.set_cash(100000)            # Set Strategy Cash\n\n        # add universe for the top 3 stocks by dollar volume\n        self.add_universe(self.universe.top(3))\n\n        self.changes = None\n        self.on_securities_changed_was_called = False\n\n    def on_data(self, data):\n        if self.changes is None: return\n\n        # liquidate securities that fell out of our universe\n        for security in self.changes.removed_securities:\n            if security.invested:\n                self.liquidate(security.symbol)\n\n        # invest in securities just added to our universe\n        for security in self.changes.added_securities:\n            if not security.invested:\n                self.market_order(security.symbol, 10)\n\n        self.changes = None\n\n    # this event fires whenever we have changes to our universe\n    def on_securities_changed(self, changes):\n        self.changes = changes\n        self.on_securities_changed_was_called = True\n\n    def on_end_of_algorithm(self):\n        if not self.on_securities_changed_was_called:\n            raise AssertionError(\"OnSecuritiesChanged() method was never called!\")\n"
  },
  {
    "path": "Algorithm.Python/UniverseSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Universe Selection regression algorithm simulates an edge case. In one week, Google listed two new symbols, delisted one of them and changed tickers.\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass UniverseSelectionRegressionAlgorithm(QCAlgorithm):\n    \n    def initialize(self):\n        \n        self.set_start_date(2014,3,22)   #Set Start Date\n        self.set_end_date(2014,4,7)      #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        # security that exists with no mappings\n        self.add_equity(\"SPY\", Resolution.DAILY)\n        # security that doesn't exist until half way in backtest (comes in as GOOCV)\n        self.add_equity(\"GOOG\", Resolution.DAILY)\n\n        self.universe_settings.resolution = Resolution.DAILY\n        self.add_universe(self.coarse_selection_function)\n\n        self.delisted_symbols = []\n        self.changes = None\n\n\n    def coarse_selection_function(self, coarse):\n        return [ c.symbol for c in coarse if c.symbol.value == \"GOOG\" or c.symbol.value == \"GOOCV\" or c.symbol.value == \"GOOAV\" or c.symbol.value == \"GOOGL\" ]\n\n\n    def on_data(self, data):\n        if self.transactions.orders_count == 0:\n            self.market_order(\"SPY\", 100)\n\n        for kvp in data.delistings:\n            self.delisted_symbols.append(kvp.key)\n        \n        if self.changes is None:\n            return\n\n        if not all(data.bars.contains_key(x.symbol) for x in self.changes.added_securities):\n            return \n        \n        for security in self.changes.added_securities:\n            self.log(\"{0}: Added Security: {1}\".format(self.time, security.symbol))\n            self.market_on_open_order(security.symbol, 100)\n\n        for security in self.changes.removed_securities:\n            self.log(\"{0}: Removed Security: {1}\".format(self.time, security.symbol))\n            if security.symbol not in self.delisted_symbols:\n                self.log(\"Not in delisted: {0}:\".format(security.symbol))\n                self.market_on_open_order(security.symbol, -100)\n\n        self.changes = None \n\n\n    def on_securities_changed(self, changes):\n        self.changes = changes\n\n\n    def on_order_event(self, orderEvent):\n        if orderEvent.status == OrderStatus.SUBMITTED:\n            self.log(\"{0}: Submitted: {1}\".format(self.time, self.transactions.get_order_by_id(orderEvent.order_id)))\n        if orderEvent.status == OrderStatus.FILLED:\n            self.log(\"{0}: Filled: {1}\".format(self.time, self.transactions.get_order_by_id(orderEvent.order_id)))\n"
  },
  {
    "path": "Algorithm.Python/UniverseUnchangedRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm used to test a fine and coarse selection methods returning Universe.UNCHANGED\n### </summary>\nclass UniverseUnchangedRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.DAILY\n\n        # Order margin value has to have a minimum of 0.5% of Portfolio value, allows filtering out small trades and reduce fees.\n        # Commented so regression algorithm is more sensitive\n        #self.settings.minimum_order_margin_portfolio_percentage = 0.005\n        self.set_start_date(2014,3,25)\n        self.set_end_date(2014,4,7)\n\n        self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(days = 1), 0.025, None))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n\n        self.add_universe(self.coarse_selection_function, self.fine_selection_function)\n\n        self.number_of_symbols_fine = 2\n\n    def coarse_selection_function(self, coarse):\n        # the first and second selection\n        if self.time.date() <= date(2014, 3, 26):\n            tickers = [ \"AAPL\", \"AIG\", \"IBM\" ]\n            return [ Symbol.create(x, SecurityType.EQUITY, Market.USA) for x in tickers ]\n\n        # will skip fine selection\n        return Universe.UNCHANGED\n\n    def fine_selection_function(self, fine):\n        if self.time.date() == date(2014, 3, 25):\n            sorted_by_pe_ratio = sorted(fine, key=lambda x: x.valuation_ratios.pe_ratio, reverse=True)\n            return [ x.symbol for x in sorted_by_pe_ratio[:self.number_of_symbols_fine] ]\n\n        # the second selection will return unchanged, in the following fine selection will be skipped\n        return Universe.UNCHANGED\n\n    # assert security changes, throw if called more than once\n    def on_securities_changed(self, changes):\n        added_symbols = [ x.symbol for x in changes.added_securities ]\n        if (len(changes.added_securities) != 2\n            or self.time.date() != date(2014, 3, 25)\n            or Symbol.create(\"AAPL\", SecurityType.EQUITY, Market.USA) not in added_symbols\n            or Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA) not in added_symbols):\n            raise ValueError(\"Unexpected security changes\")\n        self.log(f\"OnSecuritiesChanged({self.time}):: {changes}\")\n"
  },
  {
    "path": "Algorithm.Python/UnregisterIndicatorRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Example and regression algorithm asserting the behavior of registering and unregistering an indicator from the engine\n### </summary>\nclass UnregisterIndicatorRegressionAlgorithm(QCAlgorithm):\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n\n        spy = self.add_equity(\"SPY\")\n        ibm = self.add_equity(\"IBM\")\n\n        self._symbols = [ spy.symbol, ibm.symbol ]\n        self._trin = self.trin(self._symbols, Resolution.MINUTE)\n        self._trin2 = None\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if self._trin.is_ready:\n            self._trin.reset()\n            self.unregister_indicator(self._trin)\n\n            # let's create a new one with a differente resolution\n            self._trin2 = self.trin(self._symbols, Resolution.HOUR)\n\n        if not self._trin2 is None and self._trin2.is_ready:\n            if self._trin.is_ready:\n                raise ValueError(\"Indicator should of stop getting updates!\")\n\n            if not self.portfolio.invested:\n                self.set_holdings(self._symbols[0], 0.5)\n                self.set_holdings(self._symbols[1], 0.5)\n"
  },
  {
    "path": "Algorithm.Python/UpdateOrderRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom math import copysign\n\n### <summary>\n### Provides a regression baseline focused on updating orders\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass UpdateOrderRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,1,1)    #Set Start Date\n        self.set_end_date(2015,1,1)      #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n\n        self.security = self.add_equity(\"SPY\", Resolution.DAILY)\n\n        self.last_month = -1\n        self.quantity = 100\n        self.delta_quantity = 10\n\n        self.stop_percentage = 0.025\n        self.stop_percentage_delta = 0.005\n        self.limit_percentage = 0.025\n        self.limit_percentage_delta = 0.005\n\n        order_type_enum = [OrderType.MARKET, OrderType.LIMIT, OrderType.STOP_MARKET, OrderType.STOP_LIMIT, OrderType.MARKET_ON_OPEN, OrderType.MARKET_ON_CLOSE, OrderType.TRAILING_STOP]\n        self.order_types_queue = CircularQueue[OrderType](order_type_enum)\n        self.order_types_queue.circle_completed += self.on_circle_completed\n        self.tickets = []\n\n\n    def on_circle_completed(self, sender, event):\n        '''Flip our signs when we've gone through all the order types'''\n        self.quantity *= -1\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if not data.bars.contains_key(\"SPY\"):\n            return\n\n        if self.time.month != self.last_month:\n            # we'll submit the next type of order from the queue\n            order_type = self.order_types_queue.dequeue()\n            self.log(\"\\r\\n--------------MONTH: {0}:: {1}\".format(self.time.strftime(\"%B\"), order_type))\n            self.last_month = self.time.month\n            self.log(\"ORDER TYPE:: {0}\".format(order_type))\n            is_long = self.quantity > 0\n            stop_price = (1 + self.stop_percentage)*data[\"SPY\"].high if is_long else (1 - self.stop_percentage)*data[\"SPY\"].low\n            limit_price = (1 - self.limit_percentage)*stop_price if is_long else (1 + self.limit_percentage)*stop_price\n\n            if order_type == OrderType.LIMIT:\n                limit_price = (1 + self.limit_percentage)*data[\"SPY\"].high if not is_long else (1 - self.limit_percentage)*data[\"SPY\"].low\n\n            request = SubmitOrderRequest(order_type, self.security.symbol.security_type, \"SPY\", self.quantity, stop_price, limit_price, 0, 0.01, True,\n                                         self.utc_time, str(int(order_type)))\n            ticket = self.transactions.add_order(request)\n            self.tickets.append(ticket)\n\n        elif len(self.tickets) > 0:\n            ticket = self.tickets[-1]\n\n            if self.time.day > 8 and self.time.day < 14:\n                if len(ticket.update_requests) == 0 and ticket.status is not OrderStatus.FILLED:\n                    self.log(\"TICKET:: {0}\".format(ticket))\n                    update_order_fields = UpdateOrderFields()\n                    update_order_fields.quantity = ticket.quantity + copysign(self.delta_quantity, self.quantity)\n                    update_order_fields.tag = \"Change quantity: {0}\".format(self.time.day)\n                    ticket.update(update_order_fields)\n\n            elif self.time.day > 13 and self.time.day < 20:\n                if len(ticket.update_requests) == 1 and ticket.status is not OrderStatus.FILLED:\n                    self.log(\"TICKET:: {0}\".format(ticket))\n                    update_order_fields = UpdateOrderFields()\n                    update_order_fields.limit_price = self.security.price*(1 - copysign(self.limit_percentage_delta, ticket.quantity))\n                    update_order_fields.stop_price = self.security.price*(1 + copysign(self.stop_percentage_delta, ticket.quantity)) if ticket.order_type != OrderType.TRAILING_STOP else None\n                    update_order_fields.tag = \"Change prices: {0}\".format(self.time.day)\n                    ticket.update(update_order_fields)\n            else:\n                if len(ticket.update_requests) == 2 and ticket.status is not OrderStatus.FILLED:\n                    self.log(\"TICKET:: {0}\".format(ticket))\n                    ticket.cancel(\"{0} and is still open!\".format(self.time.day))\n                    self.log(\"CANCELLED:: {0}\".format(ticket.cancel_request))\n\n\n    def on_order_event(self, orderEvent):\n        order = self.transactions.get_order_by_id(orderEvent.order_id)\n        ticket = self.transactions.get_order_ticket(orderEvent.order_id)\n\n        #order cancelations update CanceledTime\n        if order.status == OrderStatus.CANCELED and order.canceled_time != orderEvent.utc_time:\n            raise ValueError(\"Expected canceled order CanceledTime to equal canceled order event time.\")\n\n        #fills update LastFillTime\n        if (order.status == OrderStatus.FILLED or order.status == OrderStatus.PARTIALLY_FILLED) and order.last_fill_time != orderEvent.utc_time:\n            raise ValueError(\"Expected filled order LastFillTime to equal fill order event time.\")\n\n        # check the ticket to see if the update was successfully processed\n        if len([ur for ur in ticket.update_requests if ur.response is not None and ur.response.is_success]) > 0 and order.created_time != self.utc_time and order.last_update_time is None:\n            raise ValueError(\"Expected updated order LastUpdateTime to equal submitted update order event time\")\n\n        if orderEvent.status == OrderStatus.FILLED:\n            self.log(\"FILLED:: {0} FILL PRICE:: {1}\".format(self.transactions.get_order_by_id(orderEvent.order_id), orderEvent.fill_price))\n        else:\n            self.log(orderEvent.to_string())\n            self.log(\"TICKET:: {0}\".format(ticket))\n"
  },
  {
    "path": "Algorithm.Python/UserDefinedUniverseAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm shows how you can handle universe selection in anyway you like,\n### at any time you like. This algorithm has a list of 10 stocks that it rotates\n### through every hour.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"universes\" />\n### <meta name=\"tag\" content=\"custom universes\" />\nclass UserDefinedUniverseAlgorithm(QCAlgorithm):\n\n\tdef initialize(self) -> None:\n\t\tself.set_cash(100000)\n\t\tself.set_start_date(2015, 1, 1)\n\t\tself.set_end_date(2015, 12, 1)\n\t\tself._symbols = [\"SPY\", \"GOOG\", \"IBM\", \"AAPL\", \"MSFT\", \"CSCO\", \"ADBE\", \"WMT\"]\n\n\t\tself.universe_settings.resolution = Resolution.HOUR\n\t\tself.add_universe('my_universe_name', Resolution.HOUR, self.selection)\n\n\tdef selection(self, time: datetime) -> list[str]:\n\t\tindex = time.hour % len(self._symbols)\n\t\treturn [self._symbols[index]]\n\n\tdef on_securities_changed(self, changes: SecurityChanges) -> None:\n\t\tfor removed in changes.removed_securities:\n\t\t\tif removed.invested:\n\t\t\t\tself.liquidate(removed.symbol)\n\n\t\tfor added in changes.added_securities:\n\t\t\tself.set_holdings(added.symbol, 1/len(changes.added_securities))\n"
  },
  {
    "path": "Algorithm.Python/VBaseSignalExportDemonstrationAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n###  This algorithm sends a list of portfolio targets to vBsase API\n### </summary>\nclass VBaseSignalExportDemonstrationAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        ''' Initialize the date'''\n        self.set_start_date(2013,10, 7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(100000)             # Set Strategy Cash\n\n        self.vbase_apikey = \"YOUR VBASE API KEY\"\n        self.vbase_collection_name = \"YOUR VBASE COLLECTION NAME\"\n\n        self._symbols = [\n            Symbol.create(\"SPY\", SecurityType.EQUITY, Market.USA),\n            Symbol.create(\"IBM\", SecurityType.EQUITY, Market.USA)\n        ]\n\n        for symbol in self._symbols:\n            self.add_equity(symbol)\n\n        self._sentSignal = False\n        self.signal_export.add_signal_export_provider(VBaseSignalExport(self.vbase_apikey, self.vbase_collection_name))\n\n    def on_data(self, data):\n        if self._sentSignal:\n            return\n        self._sentSignal = True\n\n        self.targets = []\n\n        self.targets.append(PortfolioTarget(self._symbols[0], 0.25)) # SPY 25% of the portfolio\n        self.targets.append(PortfolioTarget(self._symbols[1], 0.75)) # IBM 75% of the portfolio\n\n        self.signal_export.set_target_portfolio(self.targets)\n"
  },
  {
    "path": "Algorithm.Python/VolumeRenkoConsolidatorAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demostrates the use of <see cref=\"VolumeRenkoConsolidator\"/> for creating constant volume bar\n### </summary>\n### <meta name=\"tag\" content=\"renko\" />\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"consolidating data\" />\nclass VolumeRenkoConsolidatorAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_start_date(2013, 10, 7)\n        self.set_end_date(2013, 10, 11)\n        self.set_cash(100000)\n\n        self._sma = SimpleMovingAverage(10)\n        self._tick_consolidated = False\n\n        self._spy = self.add_equity(\"SPY\", Resolution.MINUTE).symbol\n        self._tradebar_volume_consolidator = VolumeRenkoConsolidator(1000000)\n        self._tradebar_volume_consolidator.data_consolidated += self.on_spy_data_consolidated\n\n        self._ibm = self.add_equity(\"IBM\", Resolution.TICK).symbol\n        self._tick_volume_consolidator = VolumeRenkoConsolidator(1000000)\n        self._tick_volume_consolidator.data_consolidated += self.on_ibm_data_consolidated\n\n        history = self.history[TradeBar](self._spy, 1000, Resolution.MINUTE)\n        for bar in history:\n            self._tradebar_volume_consolidator.update(bar)\n\n    def on_spy_data_consolidated(self, sender, bar):\n        self._sma.update(bar.end_time, bar.value)\n        self.debug(f\"SPY {bar.time} to {bar.end_time} :: O:{bar.open} H:{bar.high} L:{bar.low} C:{bar.close} V:{bar.volume}\")\n        if bar.volume != 1000000:\n            raise AssertionError(\"Volume of consolidated bar does not match set value!\")\n\n    def on_ibm_data_consolidated(self, sender, bar):\n        self.debug(f\"IBM {bar.time} to {bar.end_time} :: O:{bar.open} H:{bar.high} L:{bar.low} C:{bar.close} V:{bar.volume}\")\n        if bar.volume != 1000000:\n            raise AssertionError(\"Volume of consolidated bar does not match set value!\")\n        self._tick_consolidated = True\n\n    def on_data(self, slice):\n        # Update by TradeBar\n        if slice.bars.contains_key(self._spy):\n            self._tradebar_volume_consolidator.update(slice.bars[self._spy])\n\n        # Update by Tick\n        if slice.ticks.contains_key(self._ibm):\n            for tick in slice.ticks[self._ibm]:\n                self._tick_volume_consolidator.update(tick)\n\n        if self._sma.is_ready and self._sma.current.value < self.securities[self._spy].price:\n            self.set_holdings(self._spy, 1)\n        else:\n            self.set_holdings(self._spy, 0)\n            \n    def on_end_of_algorithm(self):\n        if not self._tick_consolidated:\n            raise AssertionError(\"Tick consolidator was never been called\")\n"
  },
  {
    "path": "Algorithm.Python/VolumeShareSlippageModelAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Orders.Slippage.VolumeShareSlippageModel import VolumeShareSlippageModel\n\n### <summary>\n### Example algorithm implementing VolumeShareSlippageModel.\n### </summary>\nclass VolumeShareSlippageModelAlgorithm(QCAlgorithm):\n    _longs = []\n    _shorts = []\n\n    def initialize(self) -> None:\n        self.set_start_date(2020, 11, 29)\n        self.set_end_date(2020, 12, 2)\n        # To set the slippage model to limit to fill only 30% volume of the historical volume, with 5% slippage impact.\n        self.set_security_initializer(lambda security: security.set_slippage_model(VolumeShareSlippageModel(0.3, 0.05)))\n\n        self.universe_settings.resolution = Resolution.DAILY\n        # Add universe to trade on the most and least weighted stocks among SPY constituents.\n        self.add_universe(self.universe.etf(\"SPY\", universe_filter_func=self.selection))\n\n    def selection(self, constituents: list[ETFConstituentUniverse]) -> list[Symbol]:\n        sorted_by_weight = sorted(constituents, key=lambda c: c.weight)\n        # Add the 10 most weighted stocks to the universe to long later.\n        self._longs = [c.symbol for c in sorted_by_weight[-10:]]\n        # Add the 10 least weighted stocks to the universe to short later.\n        self._shorts = [c.symbol for c in sorted_by_weight[:10]]\n\n        return self._longs + self._shorts\n\n    def on_data(self, slice: Slice) -> None:\n        # Equally invest into the selected stocks to evenly dissipate capital risk.\n        # Dollar neutral of long and short stocks to eliminate systematic risk, only capitalize the popularity gap.\n        targets = [PortfolioTarget(symbol, 0.05) for symbol in self._longs]\n        targets += [PortfolioTarget(symbol, -0.05) for symbol in self._shorts]\n\n        # Liquidate the ones not being the most and least popularity stocks to release fund for higher expected return trades.\n        self.set_holdings(targets, liquidate_existing_holdings=True)\n"
  },
  {
    "path": "Algorithm.Python/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom Alphas.RsiAlphaModel import RsiAlphaModel\nfrom Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel\nfrom Execution.VolumeWeightedAveragePriceExecutionModel import VolumeWeightedAveragePriceExecutionModel\n\n### <summary>\n### Regression algorithm for the VolumeWeightedAveragePriceExecutionModel.\n### This algorithm shows how the execution model works to split up orders and\n### submit them only when the price is on the favorable side of the intraday VWAP.\n### </summary>\n### <meta name=\"tag\" content=\"using data\" />\n### <meta name=\"tag\" content=\"using quantconnect\" />\n### <meta name=\"tag\" content=\"trading and orders\" />\nclass VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm(QCAlgorithm):\n    '''Regression algorithm for the VolumeWeightedAveragePriceExecutionModel.\n    This algorithm shows how the execution model works to split up orders and\n    submit them only when the price is on the favorable side of the intraday VWAP.'''\n\n    def initialize(self):\n\n        self.universe_settings.resolution = Resolution.MINUTE\n\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,11)\n        self.set_cash(1000000)\n\n        self.set_universe_selection(ManualUniverseSelectionModel([\n            Symbol.create('AIG', SecurityType.EQUITY, Market.USA),\n            Symbol.create('BAC', SecurityType.EQUITY, Market.USA),\n            Symbol.create('IBM', SecurityType.EQUITY, Market.USA),\n            Symbol.create('SPY', SecurityType.EQUITY, Market.USA)\n        ]))\n\n        # using hourly rsi to generate more insights\n        self.set_alpha(RsiAlphaModel(14, Resolution.HOUR))\n        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())\n        self.set_execution(VolumeWeightedAveragePriceExecutionModel())\n\n        self.insights_generated += self.on_insights_generated\n\n    def on_insights_generated(self, algorithm, data):\n        self.log(f\"{self.time}: {', '.join(str(x) for x in data.insights)}\")\n\n    def on_order_event(self, orderEvent):\n        self.log(f\"{self.time}: {orderEvent}\")\n"
  },
  {
    "path": "Algorithm.Python/WarmupAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Demonstration algorithm for the Warm Up feature with basic indicators.\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"warm up\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"using data\" />\nclass WarmupAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2013,10,8)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.SECOND)\n\n        fast_period = 60\n        slow_period = 3600\n\n        self.fast = self.ema(\"SPY\", fast_period)\n        self.slow = self.ema(\"SPY\", slow_period)\n\n        self.set_warmup(slow_period)\n        self.first = True\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n        if self.first and not self.is_warming_up:\n            self.first = False\n            self.log(\"Fast: {0}\".format(self.fast.samples))\n            self.log(\"Slow: {0}\".format(self.slow.samples))\n\n        if self.fast.current.value > self.slow.current.value:\n            self.set_holdings(\"SPY\", 1)\n        else:\n            self.set_holdings(\"SPY\", -1)\n"
  },
  {
    "path": "Algorithm.Python/WarmupHistoryAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### This algorithm demonstrates using the history provider to retrieve data\n### to warm up indicators before data is received.\n### </summary>\n### <meta name=\"tag\" content=\"indicators\" />\n### <meta name=\"tag\" content=\"history\" />\n### <meta name=\"tag\" content=\"history and warm up\" />\n### <meta name=\"tag\" content=\"using data\" />\nclass WarmupHistoryAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n\n        self.set_start_date(2014,5,2)   #Set Start Date\n        self.set_end_date(2014,5,2)     #Set End Date\n        self.set_cash(100000)          #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        forex = self.add_forex(\"EURUSD\", Resolution.SECOND)\n        forex = self.add_forex(\"NZDUSD\", Resolution.SECOND)\n\n        fast_period = 60\n        slow_period = 3600\n        self.fast = self.ema(\"EURUSD\", fast_period)\n        self.slow = self.ema(\"EURUSD\", slow_period)\n\n        # \"slow_period + 1\" because rolling window waits for one to fall off the back to be considered ready\n        # History method returns a dict with a pandas.data_frame\n        history = self.history([\"EURUSD\", \"NZDUSD\"], slow_period + 1)\n\n        # prints out the tail of the dataframe\n        self.log(str(history.loc[\"EURUSD\"].tail()))\n        self.log(str(history.loc[\"NZDUSD\"].tail()))\n\n        for index, row in history.loc[\"EURUSD\"].iterrows():\n            self.fast.update(index, row[\"close\"])\n            self.slow.update(index, row[\"close\"])\n\n        self.log(\"FAST {0} READY. Samples: {1}\".format(\"IS\" if self.fast.is_ready else \"IS NOT\", self.fast.samples))\n        self.log(\"SLOW {0} READY. Samples: {1}\".format(\"IS\" if self.slow.is_ready else \"IS NOT\", self.slow.samples))\n\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''\n\n        if self.fast.current.value > self.slow.current.value:\n            self.set_holdings(\"EURUSD\", 1)\n        else:\n            self.set_holdings(\"EURUSD\", -1)\n"
  },
  {
    "path": "Algorithm.Python/WeeklyUniverseSelectionRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test universe additions and removals with open positions\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass WeeklyUniverseSelectionRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self) -> None:\n        self.set_cash(100000)\n        self.set_start_date(2013,10,1)\n        self.set_end_date(2013,10,31)\n\n        self.universe_settings.resolution = Resolution.HOUR\n\n        # select IBM once a week, empty universe the other days\n        self.add_universe(\"my-custom-universe\", lambda dt: [\"IBM\"] if dt.day % 7 == 0 else [])\n\n    def on_data(self, slice: Slice) -> None:\n        if not self._changes:\n            return\n\n        # liquidate removed securities\n        for security in self._changes.removed_securities:\n            if security.invested:\n                self.log(\"{} Liquidate {}\".format(self.time, security.symbol))\n                self.liquidate(security.symbol)\n\n        # we'll simply go long each security we added to the universe\n        for security in self._changes.added_securities:\n            if not security.invested:\n                self.log(\"{} Buy {}\".format(self.time, security.symbol))\n                self.set_holdings(security.symbol, 1)\n\n        self._changes = None\n\n    def on_securities_changed(self, changes: SecurityChanges) -> None:\n        self._changes = changes\n"
  },
  {
    "path": "Algorithm.Python/ZeroedBenchmarkRegressionAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\n### <summary>\n### Regression algorithm to test zeroed benchmark through BrokerageModel override\n### </summary>\n### <meta name=\"tag\" content=\"regression test\" />\nclass ZeroedBenchmarkRegressionAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.set_cash(100000)\n        self.set_start_date(2013,10,7)\n        self.set_end_date(2013,10,8)\n\n        # Add Equity\n        self.add_equity(\"SPY\", Resolution.HOUR)\n\n        # Use our Test Brokerage Model with zerod default benchmark\n        self.set_brokerage_model(TestBrokerageModel())\n\n    def on_data(self, data):\n        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n\n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n\nclass TestBrokerageModel(DefaultBrokerageModel):\n\n    def get_benchmark(self, securities):\n        return FuncBenchmark(self.func)\n\n    def func(self, datetime):\n        return 0\n"
  },
  {
    "path": "Algorithm.Python/build.bat",
    "content": "REM Python Compile the Algorithm with all the files in current directory\nnPython -m compileall -lq ..\\..\\\n\nREM Copy to the Lean Algorithm Project\ncopy ..\\..\\__pycache__\\*.pyc ..\\..\\..\\Launcher\\bin\\Debug >NUL\ncopy ..\\..\\__pycache__\\*.pyc ..\\..\\..\\Launcher\\bin\\Release >NUL\ncopy ..\\..\\__pycache__\\*.pyc ..\\..\\..\\Tests\\bin\\Debug >NUL\n\nREM Script intentionally discards errors. This line ensures the exit code is 0."
  },
  {
    "path": "Algorithm.Python/main.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); \n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass BasicTemplateAlgorithm(QCAlgorithm):\n    '''Basic template algorithm simply initializes the date range and cash'''\n\n    def initialize(self):\n        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''\n        \n        self.set_start_date(2013,10,7)   #Set Start Date\n        self.set_end_date(2013,10,11)    #Set End Date\n        self.set_cash(100000)           #Set Strategy Cash\n        # Find more symbols here: http://quantconnect.com/data\n        self.add_equity(\"SPY\", Resolution.SECOND)\n\n    def on_data(self, data):\n        '''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.\n        \n        Arguments:\n            data: Slice object keyed by symbol containing the stock data\n        '''\n        if not self.portfolio.invested:\n            self.set_holdings(\"SPY\", 1)\n"
  },
  {
    "path": "Algorithm.Python/readme.md",
    "content": "# QuantConnect Python Algorithm Project\n\nThis document contains information regarding how to use Python with the Lean engine, this includes how to use Python Autocomplete, setting up Lean for Python algorithms, PythonNet compilation for devs, and what imports to use to replicate the web IDE experience in your local development.\n\n<br />\n\n\n------\n# Local Python Autocomplete\nTo enable autocomplete for your local Python IDE, install the `quantconnect-stubs` package from PyPI using the following command:\n```\npip install quantconnect-stubs\n```\n\nTo update your autocomplete to the latest version, you can run the following command:\n```\npip install --upgrade quantconnect-stubs\n```\n\nCopy and paste the imports found [here](#python-autocomplete-imports) to the top of your project file to enable autocomplete.\n\nIn addition, you can use [Skylight](https://www.quantconnect.com/skylight) to automatically sync local changes to the cloud.\n\n<br />\n\n------\n\n# Setup Lean Locally with Python\nBefore setting up python support, follow the [installation instructions](https://github.com/QuantConnect/Lean#installation-instructions) to get LEAN running C# algorithms on your machine. \n\n\n## Installing Python 3.11:\n\nNext we must prepare a Python installation for Lean to use. Follow the instructions for your OS.\n\n<br />\n\n### [Windows](https://github.com/QuantConnect/Lean#windows)\n\n1. Use the Windows x86-64 MSI **Python 3.11.11** installer from [python.org](https://www.python.org/downloads/release/python-31111/) or [Anaconda](https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Windows-x86_64.exe) for Windows installer.\n2. When asked to select the features to be installed, make sure you select \"Add python.exe to Path\"\n3. Create `PYTHONNET_PYDLL` environment variable to the location of your python dll in your installation (e.g. `C:\\Dev\\Python311\\python311.dll` or `C:\\Anaconda3\\python311.dll`):\n   - Right mouse button on My Computer. Click Properties.\n   - Click Advanced System Settings -> Environment Variables -> System Variables\n   - Click **New**. \n        - Name: `PYTHONNET_PYDLL`\n        - Value: `{python dll location}`\n4. Install [pandas=2.2.3](https://pandas.pydata.org/) and its [dependencies](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies).\n5. Install [wrapt=1.16.0](https://pypi.org/project/wrapt/) module.\n6. Reboot computer to ensure changes are propagated.\n\n<br />\n\n### [macOS](https://github.com/QuantConnect/Lean#macos)\n\n1. Use the macOS x86-64 package installer from [Anaconda](https://repo.anaconda.com/archive/Anaconda3-2024.02-1-MacOSX-x86_64.pkg) and follow \"[Installing on macOS](https://docs.anaconda.com/anaconda/install/mac-os)\" instructions from Anaconda documentation page.\n2. Set `PYTHONNET_PYDLL` environment variable to the location of your python dll in your installation directory (e.g. `/Users/{your_user_name}/anaconda3/lib/libpython3.11.dylib`):\n   - Open `~/.bash-profile` with a text editor of your choice.\n   - Add a new line to the file containing \n   ```\n   export PYTHONNET_PYDLL=\"/{your}/{path}/{here}/libpython3.11.dylib\"\n   ```\n   - Save your changes, and either restart your terminal *or* execute \n   ```\n   source ~/.bash-profile\n   ```\n2. Install [pandas=2.2.3](https://pandas.pydata.org/) and its [dependencies](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies).\n3. Install [wrapt=1.16.0](https://pypi.org/project/wrapt/) module.\n\n<br />\n\n### [Linux](https://github.com/QuantConnect/Lean#linux-debian-ubuntu)\n\n1. Install Python using miniconda by following these commands; by default, **miniconda** is installed in the users home directory (`$HOME`):\n```\nexport PATH=\"$HOME/miniconda3/bin:$PATH\"\nwget https://cdn.quantconnect.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh\nbash Miniconda3-py311_24.9.2-0-Linux-x86_64.sh -b -p /opt/miniconda3\nrm -rf Miniconda3-py311_24.9.2-0-Linux-x86_64.sh\n```\n2. Create a new Python environment with the needed dependencies\n```\nconda create -n qc_lean python=3.11.11 pandas=2.2.3 wrapt=1.16.0\n```\n3. Set `PYTHONNET_PYDLL` environment variable to location of your python dll in your installation directory (e.g. `/home/{your_user_name}/miniconda3/envs/qc_lean/lib/libpython3.11.so`):\n   - Open `/etc/environment` with a text editor of your choice.\n   - Add a new line to the file containing \n   ```\n   PYTHONNET_PYDLL=\"/home/{your_user_name}/miniconda3/envs/qc_lean/lib/libpython3.11.so\"\n   ```\n   - Save your changes, and logout or reboot to reflect these changes\n\n\n\n<br />\n\n\n## Run Python Algorithms\n\n1. Update the [config](https://github.com/QuantConnect/Lean/blob/master/Launcher/config.json) to run a python algorithm:\n    ```json\n    \"algorithm-type-name\": \"BasicTemplateAlgorithm\",\n    \"algorithm-language\": \"Python\",\n    \"algorithm-location\": \"../../../Algorithm.Python/BasicTemplateAlgorithm.py\",\n    ```\n 2. Build LEAN.\n 3. Run LEAN. You should see the same result of the C# algorithm you tested earlier.\n\n------\n\n# Python.NET development - Python.Runtime.dll compilation\n\nLEAN users do **not** need to compile `Python.Runtime.dll`. The information below is targeted to developers who wish to improve it. Download [QuantConnect/pythonnet](https://github.com/QuantConnect/pythonnet/) github clone or downloading the zip. If downloading the zip - unzip to a local pathway.\n\n**Note:** QuantConnect's version of pythonnet is an enhanced version of [pythonnet](https://github.com/pythonnet/pythonnet) with added support for `System.Decimal` and `System.DateTime`.\n\nBelow are some examples of build commands that create a suitable `Python.Runtime.dll`.\n\n```\nmsbuild pythonnet.sln /nologo /v:quiet /t:Clean;Rebuild \n```\n\nOR\n\n```\ndotnet build pythonnet.sln\n```\n\n------\n\n# Python Autocomplete Imports\nAdding `from AlgorithmImports import *` to the top of your Python file is enough to enable autocomplete and import the required types for the algorithm at runtime.\n\n\n# Known Issues\n- Python can sometimes have issues when paired with our quantconnect stubs package on Windows. This issue can cause modules not to be found because `site-packages` directory is not present in the python path. If you have the required modules installed and are seeing errors about them not being found, please try the following steps:\n    - remove stubs -> pip uninstall quantconnect-stubs\n    - reinstall stubs -> pip install quantconnect-stubs\n"
  },
  {
    "path": "AlgorithmFactory/DebuggerHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing System.Threading;\nusing System.Diagnostics;\nusing QuantConnect.Python;\nusing QuantConnect.Logging;\nusing QuantConnect.Configuration;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.AlgorithmFactory\n{\n    /// <summary>\n    /// Helper class used to start a new debugging session\n    /// </summary>\n    public static class DebuggerHelper\n    {\n        private static readonly ConcurrentQueue<Py.GILState> _threadsState = new();\n\n        /// <summary>\n        /// The different implemented debugging methods\n        /// </summary>\n        public enum DebuggingMethod\n        {\n            /// <summary>\n            /// Local debugging through cmdline.\n            /// <see cref=\"Language.Python\"/> will use built in 'pdb'\n            /// </summary>\n            LocalCmdline,\n\n            /// <summary>\n            /// Visual studio local debugging.\n            /// <see cref=\"Language.Python\"/> will use 'Python Tools for Visual Studio',\n            /// attach manually selecting `Python` code type.\n            /// </summary>\n            VisualStudio,\n\n            /// <summary>\n            ///  Python Tool for Visual Studio Debugger for remote python debugging.\n            /// <see cref=\"Language.Python\"/>. Deprecated, routes to DebugPy which\n            /// is it's replacement. Used in the same way.\n            /// </summary>\n            PTVSD,\n\n            /// <summary>\n            ///  DebugPy - a debugger for Python.\n            /// <see cref=\"Language.Python\"/> can use  `Python Extension` in VS Code\n            /// or attach to Python in Visual Studio\n            /// </summary>\n            DebugPy,\n\n            /// <summary>\n            ///  PyCharm PyDev Debugger for remote python debugging.\n            /// <see cref=\"Language.Python\"/> will use 'Python Debug Server' in PyCharm\n            /// </summary>\n            PyCharm\n        }\n\n        /// <summary>\n        /// Will start a new debugging session\n        /// </summary>\n        /// <param name=\"language\">The algorithms programming language</param>\n        /// <param name=\"workersInitializationCallback\">Optionally, the debugging method will set an action which the data stack workers should execute\n        /// so we can debug code executed by them, this is specially important for python.</param>\n        public static void Initialize(Language language, out Action workersInitializationCallback)\n        {\n            workersInitializationCallback = null;\n            if (language == Language.Python)\n            {\n                DebuggingMethod debuggingType;\n                Enum.TryParse(Config.Get(\"debugging-method\", DebuggingMethod.LocalCmdline.ToString()), true, out debuggingType);\n\n                Log.Trace(\"DebuggerHelper.Initialize(): initializing python...\");\n                PythonInitializer.Initialize();\n                Log.Trace(\"DebuggerHelper.Initialize(): python initialization done\");\n\n                using (Py.GIL())\n                {\n                    Log.Trace(\"DebuggerHelper.Initialize(): starting...\");\n                    switch (debuggingType)\n                    {\n                        case DebuggingMethod.LocalCmdline:\n                            PythonEngine.RunSimpleString(\"import pdb; pdb.set_trace()\");\n                            break;\n\n                        case DebuggingMethod.VisualStudio:\n                            Log.Trace(\"DebuggerHelper.Initialize(): waiting for debugger to attach...\");\n                            PythonEngine.RunSimpleString(@\"import sys; import time;\nwhile not sys.gettrace():\n    time.sleep(0.25)\");\n                            break;\n\n                        case DebuggingMethod.PTVSD:\n                            Log.Trace(\"DebuggerHelper.Initialize(): waiting for PTVSD debugger to attach at localhost:5678...\");\n                            PythonEngine.RunSimpleString(\"import ptvsd; ptvsd.enable_attach(); ptvsd.wait_for_attach()\");\n                            break;\n\n                        case DebuggingMethod.DebugPy:\n                            PythonEngine.RunSimpleString(@\"import debugpy\nfrom AlgorithmImports import *\nfrom QuantConnect.Logging import *\n\nLog.Trace(\"\"DebuggerHelper.Initialize(): debugpy waiting for attach at port 5678...\"\");\n\ndebugpy.listen(('0.0.0.0', 5678))\ndebugpy.wait_for_client()\");\n                            workersInitializationCallback = DebugpyThreadInitialization;\n                            break;\n\n                        case DebuggingMethod.PyCharm:\n                            Log.Trace(\"DebuggerHelper.Initialize(): Attempting to connect to Pycharm PyDev debugger server...\");\n                            PythonEngine.RunSimpleString(@\"import pydevd_pycharm;  import time;\ncount = 1\nwhile count <= 10:\n    try:\n        pydevd_pycharm.settrace('localhost', port=6000, stdoutToServer=True, stderrToServer=True, suspend=False)\n        print('SUCCESS: Connected to local program')\n        break\n    except ConnectionRefusedError:\n        pass\n\n    try:    \n        pydevd_pycharm.settrace('host.docker.internal', port=6000, stdoutToServer=True, stderrToServer=True, suspend=False)\n        print('SUCCESS: Connected to docker container')\n        break\n    except ConnectionRefusedError:\n        pass\n\n    print('\\n')\n    print('Failed: Ensure your PyCharm Debugger is actively waiting for a connection at port 6000!')\n    print('Try ' + count.__str__() + ' out of 10')\n    print('\\n')\n    count += 1\n    time.sleep(3)\");\n                            break;\n                    }\n                    Log.Trace(\"DebuggerHelper.Initialize(): started\");\n                }\n            }\n            else if(language == Language.CSharp)\n            {\n                if (Debugger.IsAttached)\n                {\n                    Log.Trace(\"DebuggerHelper.Initialize(): debugger is already attached, triggering initial break.\");\n                }\n                else\n                {\n                    Log.Trace(\"DebuggerHelper.Initialize(): waiting for debugger to attach...\");\n                    while (!Debugger.IsAttached)\n                    {\n                        Thread.Sleep(250);\n                    }\n                    Log.Trace(\"DebuggerHelper.Initialize(): debugger attached\");\n                }\n            }\n            else\n            {\n                throw new NotImplementedException($\"DebuggerHelper.Initialize(): not implemented for {language}\");\n            }\n        }\n\n        /// <summary>\n        /// For each thread we need to create it's python state, we do this by taking the GIL and we later release it by calling 'BeginAllowThreads'\n        /// but we do not dispose of it. If we did, the state of the debugpy calls we do here are lost. So we keep a reference of the GIL we've\n        /// created so it's not picked up the C# garbage collector and disposed off, which would clear the py thread state.\n        /// </summary>\n        private static void DebugpyThreadInitialization()\n        {\n            _threadsState.Enqueue(Py.GIL());\n            PythonEngine.BeginAllowThreads();\n\n            Log.Debug($\"DebuggerHelper.Initialize({Thread.CurrentThread.Name}): initializing debugpy for thread...\");\n            using (Py.GIL())\n            {\n                PythonEngine.RunSimpleString(\"import debugpy;debugpy.debug_this_thread();debugpy.trace_this_thread(True)\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "AlgorithmFactory/Loader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Security.Policy;\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing QuantConnect.Configuration;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.AlgorithmFactory\n{\n    /// <summary>\n    /// Loader creates and manages the memory and exception space of the algorithm, ensuring if it explodes the Lean Engine is intact.\n    /// </summary>\n    [ClassInterface(ClassInterfaceType.AutoDual)]\n    public class Loader : MarshalByRefObject\n    {\n        // True if we are in a debugging session\n        private readonly bool _debugging;\n\n        // Defines the maximum amount of time we will allow for instantiating an instance of IAlgorithm\n        private readonly TimeSpan _loaderTimeLimit;\n\n        // Language of the loader class.\n        private readonly Language _language;\n\n        // Defines how we resolve a list of type names into a single type name to be instantiated\n        private readonly Func<List<string>, string> _multipleTypeNameResolverFunction;\n\n        // The worker thread instance the loader will use if not null\n        private readonly WorkerThread _workerThread;\n\n        /// <summary>\n        /// Memory space of the user algorithm\n        /// </summary>\n        public AppDomain appDomain { get; set; }\n\n        /// <summary>\n        /// The algorithm's interface type that we'll be trying to load\n        /// </summary>\n        private static readonly Type AlgorithmInterfaceType = typeof (IAlgorithm);\n\n        /// <summary>\n        /// The full type name of QCAlgorithm, this is so we don't pick him up when querying for types\n        /// </summary>\n        private const string AlgorithmBaseTypeFullName = \"QuantConnect.Algorithm.QCAlgorithm\";\n\n        /// <summary>\n        /// The full type name of QCAlgorithmFramework, this is so we don't pick him up when querying for types\n        /// </summary>\n        private const string FrameworkBaseTypeFullName = \"QuantConnect.Algorithm.Framework.QCAlgorithmFramework\";\n\n        /// <summary>\n        /// Creates a new loader with a 10 second maximum load time that forces exactly one derived type to be found\n        /// </summary>\n        public Loader()\n            : this(false, Language.CSharp, TimeSpan.FromSeconds(10), names => names.SingleOrDefault())\n        {\n        }\n\n        /// <summary>\n        /// Creates a new loader with the specified configuration\n        /// </summary>\n        /// <param name=\"debugging\">True if we are debugging</param>\n        /// <param name=\"language\">Which language are we trying to load</param>\n        /// <param name=\"loaderTimeLimit\">\n        /// Used to limit how long it takes to create a new instance\n        /// </param>\n        /// <param name=\"multipleTypeNameResolverFunction\">\n        /// Used to resolve multiple type names found in assembly to a single type name, if null, defaults to names => names.SingleOrDefault()\n        ///\n        /// When we search an assembly for derived types of IAlgorithm, sometimes the assembly will contain multiple matching types. This is the case\n        /// for the QuantConnect.Algorithm assembly in this solution.  In order to pick the correct type, consumers must specify how to pick the type,\n        /// that's what this function does, it picks the correct type from the list of types found within the assembly.\n        /// </param>\n        /// <param name=\"workerThread\">The worker thread instance the loader should use</param>\n        public Loader(bool debugging, Language language, TimeSpan loaderTimeLimit, Func<List<string>, string> multipleTypeNameResolverFunction, WorkerThread workerThread = null)\n        {\n            _debugging = debugging;\n            _language = language;\n            _workerThread = workerThread;\n            if (multipleTypeNameResolverFunction == null)\n            {\n                throw new ArgumentNullException(nameof(multipleTypeNameResolverFunction));\n            }\n\n            _loaderTimeLimit = loaderTimeLimit;\n            _multipleTypeNameResolverFunction = multipleTypeNameResolverFunction;\n        }\n\n\n        /// <summary>\n        /// Creates a new instance of the specified class in the library, safely.\n        /// </summary>\n        /// <param name=\"assemblyPath\">Location of the DLL</param>\n        /// <param name=\"algorithmInstance\">Output algorithm instance</param>\n        /// <param name=\"errorMessage\">Output error message on failure</param>\n        /// <returns>Bool true on successfully loading the class.</returns>\n        public bool TryCreateAlgorithmInstance(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)\n        {\n            //Default initialisation of Assembly.\n            algorithmInstance = null;\n            errorMessage = \"\";\n\n            //First most basic check:\n            if (!File.Exists(assemblyPath))\n            {\n                return false;\n            }\n\n            switch (_language)\n            {\n                case Language.Python:\n                    TryCreatePythonAlgorithm(assemblyPath, out algorithmInstance, out errorMessage);\n                    break;\n\n                default:\n                    TryCreateILAlgorithm(assemblyPath, out algorithmInstance, out errorMessage);\n                    break;\n            }\n\n            //Successful load.\n            return algorithmInstance != null;\n        }\n\n        /// <summary>\n        /// Create a new instance of a python algorithm\n        /// </summary>\n        /// <param name=\"assemblyPath\"></param>\n        /// <param name=\"algorithmInstance\"></param>\n        /// <param name=\"errorMessage\"></param>\n        /// <returns></returns>\n        private bool TryCreatePythonAlgorithm(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)\n        {\n            algorithmInstance = null;\n            errorMessage = string.Empty;\n\n            //File does not exist.\n            if (!File.Exists(assemblyPath))\n            {\n                errorMessage = $\"Loader.TryCreatePythonAlgorithm(): Unable to find py file: {assemblyPath}\";\n                return false;\n            }\n\n            var pythonFile = new FileInfo(assemblyPath);\n            var moduleName = pythonFile.Name.Replace(\".pyc\", \"\").Replace(\".py\", \"\");\n\n            try\n            {\n                PythonInitializer.Initialize();\n\n                algorithmInstance = new AlgorithmPythonWrapper(moduleName);\n\n                // we need stdout for debugging\n                if (!_debugging && Config.GetBool(\"mute-python-library-logging\", true))\n                {\n                    using (Py.GIL())\n                    {\n                        PythonEngine.Exec(\n                            @\"\nimport logging, os, sys\nsys.stdout = open(os.devnull, 'w')\nlogging.captureWarnings(True)\"\n                        );\n                    }\n                }\n            }\n            catch (Exception e)\n            {\n                Log.Error(e);\n                errorMessage = $\"Loader.TryCreatePythonAlgorithm(): Unable to import python module {assemblyPath}. {e.Message}\";\n                return false;\n            }\n\n            //Successful load.\n            return true;\n        }\n\n        /// <summary>\n        /// Create a generic IL algorithm\n        /// </summary>\n        /// <param name=\"assemblyPath\"></param>\n        /// <param name=\"algorithmInstance\"></param>\n        /// <param name=\"errorMessage\"></param>\n        /// <returns></returns>\n        private bool TryCreateILAlgorithm(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)\n        {\n            errorMessage = \"\";\n            algorithmInstance = null;\n\n            try\n            {\n                byte[] debugInformationBytes = null;\n\n                // if the assembly is located in the base directory then don't bother loading the pdbs\n                // manually, they'll be loaded automatically by the .NET runtime.\n                var directoryName = new FileInfo(assemblyPath).DirectoryName;\n                if (directoryName != null && directoryName.TrimEnd(Path.DirectorySeparatorChar) != AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar))\n                {\n                    // see if the pdb exists\n                    var mdbFilename = assemblyPath + \".mdb\";\n                    var pdbFilename = assemblyPath.Substring(0, assemblyPath.Length - 4) + \".pdb\";\n                    if (File.Exists(pdbFilename))\n                    {\n                        debugInformationBytes = File.ReadAllBytes(pdbFilename);\n                    }\n                    // see if the mdb exists\n                    if (File.Exists(mdbFilename))\n                    {\n                        debugInformationBytes = File.ReadAllBytes(mdbFilename);\n                    }\n                }\n\n                //Load the assembly:\n                Assembly assembly;\n                if (debugInformationBytes == null)\n                {\n                    Log.Trace(\"Loader.TryCreateILAlgorithm(): Loading only the algorithm assembly\");\n                    assembly = Assembly.LoadFrom(assemblyPath);\n                }\n                else\n                {\n                    Log.Trace(\"Loader.TryCreateILAlgorithm(): Loading debug information with algorithm\");\n                    var assemblyBytes = File.ReadAllBytes(assemblyPath);\n                    assembly = Assembly.Load(assemblyBytes, debugInformationBytes);\n                }\n\n                //Get the list of extention classes in the library:\n                var types = GetExtendedTypeNames(assembly);\n                Log.Debug(\"Loader.TryCreateILAlgorithm(): Assembly types: \" + string.Join(\",\", types));\n\n                //No extensions, nothing to load.\n                if (types.Count == 0)\n                {\n                    errorMessage = \"Algorithm type was not found.\";\n                    Log.Error(\"Loader.TryCreateILAlgorithm(): Types array empty, no algorithm type found.\");\n                    return false;\n                }\n\n                if (types.Count > 1)\n                {\n                    // reshuffle type[0] to the resolved typename\n                    types[0] = _multipleTypeNameResolverFunction.Invoke(types);\n\n                    if (string.IsNullOrEmpty(types[0]))\n                    {\n                        errorMessage = \"Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.\";\n                        Log.Error($\"Loader.TryCreateILAlgorithm(): {errorMessage}\");\n                        return false;\n                    }\n                }\n                //Load the assembly into this AppDomain:\n                algorithmInstance = (IAlgorithm)assembly.CreateInstance(types[0], true);\n\n                if (algorithmInstance != null)\n                {\n                    Log.Trace(\"Loader.TryCreateILAlgorithm(): Loaded \" + algorithmInstance.GetType().Name);\n                }\n\n            }\n            catch (ReflectionTypeLoadException err)\n            {\n                Log.Error(err);\n                Log.Error(\"Loader.TryCreateILAlgorithm(1): \" + err.LoaderExceptions[0]);\n                if (err.InnerException != null) errorMessage = err.InnerException.Message;\n            }\n            catch (Exception err)\n            {\n                errorMessage = \"Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.\";\n                Log.Error($\"Loader.TryCreateILAlgorithm(): {errorMessage}\\n{err.InnerException ?? err}\");\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get a list of all the matching type names in this DLL assembly:\n        /// </summary>\n        /// <param name=\"assembly\">Assembly dll we're loading.</param>\n        /// <returns>String list of types available.</returns>\n        public static List<string> GetExtendedTypeNames(Assembly assembly)\n        {\n            var types = new List<string>();\n            try\n            {\n                Type[] assemblyTypes;\n                try\n                {\n                    assemblyTypes = assembly.GetTypes();\n                }\n                catch (ReflectionTypeLoadException e)\n                {\n                    // We may want to exclude possible null values\n                    // See https://stackoverflow.com/questions/7889228/how-to-prevent-reflectiontypeloadexception-when-calling-assembly-gettypes\n                    assemblyTypes = e.Types.Where(t => t != null).ToArray();\n\n                    var countTypesNotLoaded = e.LoaderExceptions.Length;\n                    Log.Error($\"Loader.GetExtendedTypeNames(): Unable to load {countTypesNotLoaded} of the requested types, \" +\n                              \"see below for more details on what causes an issue:\");\n\n                    foreach (Exception inner in e.LoaderExceptions)\n                    {\n                        Log.Error($\"Loader.GetExtendedTypeNames(): {inner.Message}\");\n                    }\n                }\n\n                if (assemblyTypes != null && assemblyTypes.Length > 0)\n                {\n                    types = (from t in assemblyTypes\n                             where t.IsClass                                    // require class\n                             where !t.IsAbstract                                // require concrete impl\n                             where AlgorithmInterfaceType.IsAssignableFrom(t)   // require derived from IAlgorithm\n                             where t.FullName != AlgorithmBaseTypeFullName      // require not equal to QuantConnect.QCAlgorithm\n                             where t.FullName != FrameworkBaseTypeFullName      // require not equal to QuantConnect.QCAlgorithmFramework\n                             where t.GetConstructor(Type.EmptyTypes) != null    // require default ctor\n                             select t.FullName).ToList();\n                }\n                else\n                {\n                    Log.Error(\"API.GetExtendedTypeNames(): No types found in assembly.\");\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return types;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the class in the library, safely.\n        /// </summary>\n        /// <param name=\"assemblyPath\">Location of the DLL</param>\n        /// <param name=\"ramLimit\">Limit of the RAM for this process</param>\n        /// <param name=\"algorithmInstance\">Output algorithm instance</param>\n        /// <param name=\"errorMessage\">Output error message on failure</param>\n        /// <returns>bool success</returns>\n        public bool TryCreateAlgorithmInstanceWithIsolator(string assemblyPath, int ramLimit, out IAlgorithm algorithmInstance, out string errorMessage)\n        {\n            IAlgorithm instance = null;\n            var error = string.Empty;\n\n            var success = false;\n            var isolator = new Isolator();\n            var complete = isolator.ExecuteWithTimeLimit(_loaderTimeLimit, () =>\n            {\n                success = TryCreateAlgorithmInstance(assemblyPath, out instance, out error);\n            }, ramLimit, sleepIntervalMillis:100, workerThread:_workerThread);\n\n            algorithmInstance = instance;\n            errorMessage = error;\n\n            // if the isolator stopped us early add that to our error message\n            if (!complete)\n            {\n                errorMessage = \"Failed to create algorithm instance within 10 seconds. Try re-building algorithm. \" + error;\n            }\n\n            return complete && success && algorithmInstance != null;\n        }\n\n        #pragma warning disable CS1574\n        /// <summary>\n        /// Unload this factory's appDomain.\n        /// </summary>\n        /// <remarks>Not used in lean engine. Running the library in an app domain is 10x slower.</remarks>\n        /// <seealso cref=\"AppDomain.CreateDomain(string, Evidence, string, string, bool, AppDomainInitializer, string[])\"/>\n        #pragma warning restore CS1574\n        public void Unload() {\n            if (appDomain != null)\n            {\n                AppDomain.Unload(appDomain);\n                appDomain = null;\n            }\n        }\n\n    } // End Algorithm Factory Class\n\n} // End QC Namespace.\n"
  },
  {
    "path": "AlgorithmFactory/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.AlgorithmFactory\")]\n[assembly: AssemblyProduct(\"QuantConnect.AlgorithmFactory\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a6f998dd-5a08-4a8e-ad94-96749b61df9e\")]"
  },
  {
    "path": "AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Exceptions;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Notifications;\nusing QuantConnect.Orders;\nusing QuantConnect.Python;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing QuantConnect.Storage;\nusing QuantConnect.Statistics;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\nusing QuantConnect.Commands;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing Common.Util;\n\nnamespace QuantConnect.AlgorithmFactory.Python.Wrappers\n{\n    /// <summary>\n    /// Creates and wraps the algorithm written in python.\n    /// </summary>\n    public class AlgorithmPythonWrapper : BasePythonWrapper<IAlgorithm>, IAlgorithm\n    {\n        private readonly dynamic _onData;\n        private readonly dynamic _onMarginCall;\n        private readonly QCAlgorithm _baseAlgorithm;\n\n        // QCAlgorithm methods that might be implemented in the python algorithm:\n        // We keep them to avoid the BasePythonWrapper caching and eventual lookup overhead since these methods are called quite frequently\n        private dynamic _onBrokerageDisconnect;\n        private dynamic _onBrokerageMessage;\n        private dynamic _onBrokerageReconnect;\n        private dynamic _onSplits;\n        private dynamic _onDividends;\n        private dynamic _onDelistings;\n        private dynamic _onSymbolChangedEvents;\n        private dynamic _onEndOfDay;\n        private dynamic _onMarginCallWarning;\n        private dynamic _onOrderEvent;\n        private dynamic _onCommand;\n        private dynamic _onAssignmentOrderEvent;\n        private dynamic _onSecuritiesChanged;\n        private dynamic _onFrameworkSecuritiesChanged;\n\n        /// <summary>\n        /// True if the underlying python algorithm implements \"OnEndOfDay\"\n        /// </summary>\n        public bool IsOnEndOfDayImplemented { get; }\n\n        /// <summary>\n        /// True if the underlying python algorithm implements \"OnEndOfDay(symbol)\"\n        /// </summary>\n        public bool IsOnEndOfDaySymbolImplemented { get; }\n\n        /// <summary>\n        /// The wrapped algorithm instance cast to <see cref=\"QCAlgorithm\"/>\n        /// </summary>\n        public QCAlgorithm BaseAlgorithm => _baseAlgorithm;\n\n        /// <summary>\n        /// <see cref = \"AlgorithmPythonWrapper\"/> constructor.\n        /// Creates and wraps the algorithm written in python.\n        /// </summary>\n        /// <param name=\"moduleName\">Name of the module that can be found in the PYTHONPATH</param>\n        public AlgorithmPythonWrapper(string moduleName)\n            : base(false)\n        {\n            try\n            {\n                using (Py.GIL())\n                {\n                    Logging.Log.Trace($\"AlgorithmPythonWrapper(): Python version {PythonEngine.Version}: Importing python module {moduleName}\");\n\n                    var module = Py.Import(moduleName);\n\n                    Logging.Log.Trace($\"AlgorithmPythonWrapper(): {moduleName} successfully imported.\");\n\n                    var pyList = module.Dir();\n                    foreach (var name in pyList)\n                    {\n                        Type type;\n                        var attr = module.GetAttr(name.ToString());\n                        var repr = attr.Repr().GetStringBetweenChars('\\'', '\\'');\n\n                        if (repr.StartsWith(moduleName) &&                // Must be defined in the module\n                            attr.TryConvert(out type, true) &&                  // Must be a Type\n                            typeof(QCAlgorithm).IsAssignableFrom(type))   // Must inherit from QCAlgorithm\n                        {\n                            Logging.Log.Trace(\"AlgorithmPythonWrapper(): Creating IAlgorithm instance.\");\n\n                            SetPythonInstance(attr.Invoke());\n                            var dynAlgorithm = Instance as dynamic;\n\n                            // Set pandas\n                            dynAlgorithm.SetPandasConverter();\n\n                            // IAlgorithm reference for LEAN internal C# calls (without going from C# to Python and back)\n                            _baseAlgorithm = dynAlgorithm.AsManagedObject(type);\n\n                            // determines whether OnData method was defined or inherits from QCAlgorithm\n                            // If it is not, OnData from the base class will not be called\n                            _onData = Instance.GetPythonMethod(\"OnData\");\n\n                            _onMarginCall = Instance.GetPythonMethod(\"OnMarginCall\");\n\n                            using PyObject endOfDayMethod = Instance.GetPythonMethod(\"OnEndOfDay\");\n                            if (endOfDayMethod != null)\n                            {\n                                // Since we have a EOD method implemented\n                                // Determine which one it is by inspecting its arg count\n                                var argCount = endOfDayMethod.GetPythonArgCount();\n                                switch (argCount)\n                                {\n                                    case 0: // EOD()\n                                        IsOnEndOfDayImplemented = true;\n                                        break;\n                                    case 1: // EOD(Symbol)\n                                        IsOnEndOfDaySymbolImplemented = true;\n                                        break;\n                                }\n\n                                // Its important to note that even if both are implemented\n                                // python will only use the last implemented, meaning only one will\n                                // be used and seen.\n                            }\n\n                            // Initialize the python methods\n                            _onBrokerageDisconnect = Instance.GetMethod(\"OnBrokerageDisconnect\");\n                            _onBrokerageMessage = Instance.GetMethod(\"OnBrokerageMessage\");\n                            _onBrokerageReconnect = Instance.GetMethod(\"OnBrokerageReconnect\");\n                            _onSplits = Instance.GetMethod(\"OnSplits\");\n                            _onDividends = Instance.GetMethod(\"OnDividends\");\n                            _onDelistings = Instance.GetMethod(\"OnDelistings\");\n                            _onSymbolChangedEvents = Instance.GetMethod(\"OnSymbolChangedEvents\");\n                            _onEndOfDay = Instance.GetMethod(\"OnEndOfDay\");\n                            _onCommand = Instance.GetMethod(\"OnCommand\");\n                            _onMarginCallWarning = Instance.GetMethod(\"OnMarginCallWarning\");\n                            _onOrderEvent = Instance.GetMethod(\"OnOrderEvent\");\n                            _onAssignmentOrderEvent = Instance.GetMethod(\"OnAssignmentOrderEvent\");\n                            _onSecuritiesChanged = Instance.GetMethod(\"OnSecuritiesChanged\");\n                            _onFrameworkSecuritiesChanged = Instance.GetMethod(\"OnFrameworkSecuritiesChanged\");\n                        }\n                        attr.Dispose();\n                    }\n                    module.Dispose();\n                    pyList.Dispose();\n                    // If _algorithm could not be set, throw exception\n                    if (Instance == null)\n                    {\n                        throw new Exception(\"Please ensure that one class inherits from QCAlgorithm.\");\n                    }\n                }\n            }\n            catch (Exception e)\n            {\n                // perform exception interpretation for error in module import\n                var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n                e = interpreter.Interpret(e, interpreter);\n\n                throw new Exception($\"AlgorithmPythonWrapper(): {interpreter.GetExceptionMessageHeader(e)}\");\n            }\n        }\n\n        /// <summary>\n        /// AlgorithmId for the backtest\n        /// </summary>\n        public string AlgorithmId => _baseAlgorithm.AlgorithmId;\n\n        /// <summary>\n        /// Gets the function used to define the benchmark. This function will return\n        /// the value of the benchmark at a requested date/time\n        /// </summary>\n        public IBenchmark Benchmark => _baseAlgorithm.Benchmark;\n\n        /// <summary>\n        /// Gets the brokerage message handler used to decide what to do\n        /// with each message sent from the brokerage\n        /// </summary>\n        public IBrokerageMessageHandler BrokerageMessageHandler\n        {\n            get\n            {\n                return _baseAlgorithm.BrokerageMessageHandler;\n            }\n\n            set\n            {\n                SetBrokerageMessageHandler(value);\n            }\n        }\n\n        /// <summary>\n        /// Gets the brokerage model used to emulate a real brokerage\n        /// </summary>\n        public IBrokerageModel BrokerageModel => _baseAlgorithm.BrokerageModel;\n\n        /// <summary>\n        /// Gets the brokerage name.\n        /// </summary>\n        public BrokerageName BrokerageName => _baseAlgorithm.BrokerageName;\n\n        /// <summary>\n        /// Gets the risk free interest rate model used to get the interest rates\n        /// </summary>\n        public IRiskFreeInterestRateModel RiskFreeInterestRateModel => _baseAlgorithm.RiskFreeInterestRateModel;\n\n        /// <summary>\n        /// Debug messages from the strategy:\n        /// </summary>\n        public ConcurrentQueue<string> DebugMessages => _baseAlgorithm.DebugMessages;\n\n        /// <summary>\n        /// Get Requested Backtest End Date\n        /// </summary>\n        public DateTime EndDate => _baseAlgorithm.EndDate;\n\n        /// <summary>\n        /// Error messages from the strategy:\n        /// </summary>\n        public ConcurrentQueue<string> ErrorMessages => _baseAlgorithm.ErrorMessages;\n\n        /// <summary>\n        /// Gets or sets the history provider for the algorithm\n        /// </summary>\n        public IHistoryProvider HistoryProvider\n        {\n            get\n            {\n                return _baseAlgorithm.HistoryProvider;\n            }\n\n            set\n            {\n                SetHistoryProvider(value);\n            }\n        }\n\n        /// <summary>\n        /// Gets whether or not this algorithm is still warming up\n        /// </summary>\n        public bool IsWarmingUp => _baseAlgorithm.IsWarmingUp;\n\n        /// <summary>\n        /// Algorithm is running on a live server.\n        /// </summary>\n        public bool LiveMode => _baseAlgorithm.LiveMode;\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        public AlgorithmMode AlgorithmMode => _baseAlgorithm.AlgorithmMode;\n\n        /// <summary>\n        /// Deployment target, either local or cloud.\n        /// </summary>\n        public DeploymentTarget DeploymentTarget => _baseAlgorithm.DeploymentTarget;\n\n        /// <summary>\n        /// Log messages from the strategy:\n        /// </summary>\n        public ConcurrentQueue<string> LogMessages => _baseAlgorithm.LogMessages;\n\n        /// <summary>\n        /// Public name for the algorithm.\n        /// </summary>\n        /// <remarks>Not currently used but preserved for API integrity</remarks>\n        public string Name\n        {\n            get\n            {\n                return _baseAlgorithm.Name;\n            }\n            set\n            {\n                _baseAlgorithm.Name = value;\n            }\n        }\n\n        /// <summary>\n        /// A list of tags associated with the algorithm or the backtest, useful for categorization\n        /// </summary>\n        public HashSet<string> Tags\n        {\n            get\n            {\n                return _baseAlgorithm.Tags;\n            }\n            set\n            {\n                _baseAlgorithm.Tags = value;\n            }\n        }\n\n        /// <summary>\n        /// Event fired algorithm's name is changed\n        /// </summary>\n        public event AlgorithmEvent<string> NameUpdated\n        {\n            add\n            {\n                _baseAlgorithm.NameUpdated += value;\n            }\n\n            remove\n            {\n                _baseAlgorithm.NameUpdated -= value;\n            }\n        }\n\n        /// <summary>\n        /// Event fired when the tag collection is updated\n        /// </summary>\n        public event AlgorithmEvent<HashSet<string>> TagsUpdated\n        {\n            add\n            {\n                _baseAlgorithm.TagsUpdated += value;\n            }\n\n            remove\n            {\n                _baseAlgorithm.TagsUpdated -= value;\n            }\n        }\n\n        /// <summary>\n        /// Notification manager for storing and processing live event messages\n        /// </summary>\n        public NotificationManager Notify => _baseAlgorithm.Notify;\n\n        /// <summary>\n        /// Security portfolio management class provides wrapper and helper methods for the Security.Holdings class such as\n        /// IsLong, IsShort, TotalProfit\n        /// </summary>\n        /// <remarks>Portfolio is a wrapper and helper class encapsulating the Securities[].Holdings objects</remarks>\n        public SecurityPortfolioManager Portfolio => _baseAlgorithm.Portfolio;\n\n        /// <summary>\n        /// Gets the run time error from the algorithm, or null if none was encountered.\n        /// </summary>\n        public Exception RunTimeError\n        {\n            get\n            {\n                return _baseAlgorithm.RunTimeError;\n            }\n\n            set\n            {\n                SetRunTimeError(value);\n            }\n        }\n\n        /// <summary>\n        /// Customizable dynamic statistics displayed during live trading:\n        /// </summary>\n        public ConcurrentDictionary<string, string> RuntimeStatistics => _baseAlgorithm.RuntimeStatistics;\n\n        /// <summary>\n        /// Gets schedule manager for adding/removing scheduled events\n        /// </summary>\n        public ScheduleManager Schedule => _baseAlgorithm.Schedule;\n\n        /// <summary>\n        /// Security object collection class stores an array of objects representing representing each security/asset\n        /// we have a subscription for.\n        /// </summary>\n        /// <remarks>It is an IDictionary implementation and can be indexed by symbol</remarks>\n        public SecurityManager Securities => _baseAlgorithm.Securities;\n\n        /// <summary>\n        /// Gets an instance that is to be used to initialize newly created securities.\n        /// </summary>\n        public ISecurityInitializer SecurityInitializer => _baseAlgorithm.SecurityInitializer;\n\n        /// <summary>\n        /// Gets the Trade Builder to generate trades from executions\n        /// </summary>\n        public ITradeBuilder TradeBuilder => _baseAlgorithm.TradeBuilder;\n\n        /// <summary>\n        /// Gets the user settings for the algorithm\n        /// </summary>\n        public IAlgorithmSettings Settings => _baseAlgorithm.Settings;\n\n        /// <summary>\n        /// Gets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        public IOptionChainProvider OptionChainProvider => _baseAlgorithm.OptionChainProvider;\n\n        /// <summary>\n        /// Gets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        public IFutureChainProvider FutureChainProvider => _baseAlgorithm.FutureChainProvider;\n\n        /// <summary>\n        /// Gets the object store, used for persistence\n        /// </summary>\n        public ObjectStore ObjectStore => _baseAlgorithm.ObjectStore;\n\n        /// <summary>\n        /// Returns the current Slice object\n        /// </summary>\n        public Slice CurrentSlice => _baseAlgorithm.CurrentSlice;\n\n        /// <summary>\n        /// Algorithm start date for backtesting, set by the SetStartDate methods.\n        /// </summary>\n        public DateTime StartDate => _baseAlgorithm.StartDate;\n\n        /// <summary>\n        /// Gets or sets the current status of the algorithm\n        /// </summary>\n        public AlgorithmStatus Status\n        {\n            get\n            {\n                return _baseAlgorithm.Status;\n            }\n\n            set\n            {\n                SetStatus(value);\n            }\n        }\n\n        /// <summary>\n        /// Set the state of a live deployment\n        /// </summary>\n        /// <param name=\"status\">Live deployment status</param>\n        public void SetStatus(AlgorithmStatus status) => _baseAlgorithm.SetStatus(status);\n\n        /// <summary>\n        /// Set the available <see cref=\"TickType\"/> supported by each <see cref=\"SecurityType\"/> in <see cref=\"SecurityManager\"/>\n        /// </summary>\n        /// <param name=\"availableDataTypes\">>The different <see cref=\"TickType\"/> each <see cref=\"Security\"/> supports</param>\n        public void SetAvailableDataTypes(Dictionary<SecurityType, List<TickType>> availableDataTypes) => _baseAlgorithm.SetAvailableDataTypes(availableDataTypes);\n\n        /// <summary>\n        /// Sets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"optionChainProvider\">The option chain provider</param>\n        public void SetOptionChainProvider(IOptionChainProvider optionChainProvider) => _baseAlgorithm.SetOptionChainProvider(optionChainProvider);\n\n        /// <summary>\n        /// Sets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"futureChainProvider\">The future chain provider</param>\n        public void SetFutureChainProvider(IFutureChainProvider futureChainProvider) => _baseAlgorithm.SetFutureChainProvider(futureChainProvider);\n\n        /// <summary>\n        /// Event fired when an algorithm generates a insight\n        /// </summary>\n        public event AlgorithmEvent<GeneratedInsightsCollection> InsightsGenerated\n        {\n            add\n            {\n                _baseAlgorithm.InsightsGenerated += value;\n            }\n\n            remove\n            {\n                _baseAlgorithm.InsightsGenerated -= value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the time keeper instance\n        /// </summary>\n        public ITimeKeeper TimeKeeper => _baseAlgorithm.TimeKeeper;\n\n        /// <summary>\n        /// Data subscription manager controls the information and subscriptions the algorithms recieves.\n        /// Subscription configurations can be added through the Subscription Manager.\n        /// </summary>\n        public SubscriptionManager SubscriptionManager => _baseAlgorithm.SubscriptionManager;\n\n        /// <summary>\n        /// The project id associated with this algorithm if any\n        /// </summary>\n        public int ProjectId\n        {\n            set\n            {\n                _baseAlgorithm.ProjectId = value;\n            }\n            get\n            {\n                return _baseAlgorithm.ProjectId;\n            }\n        }\n\n        /// <summary>\n        /// Current date/time in the algorithm's local time zone\n        /// </summary>\n        public DateTime Time => _baseAlgorithm.Time;\n\n        /// <summary>\n        /// Gets the time zone of the algorithm\n        /// </summary>\n        public DateTimeZone TimeZone => _baseAlgorithm.TimeZone;\n\n        /// <summary>\n        /// Security transaction manager class controls the store and processing of orders.\n        /// </summary>\n        /// <remarks>The orders and their associated events are accessible here. When a new OrderEvent is recieved the algorithm portfolio is updated.</remarks>\n        public SecurityTransactionManager Transactions => _baseAlgorithm.Transactions;\n\n        /// <summary>\n        /// Gets the collection of universes for the algorithm\n        /// </summary>\n        public UniverseManager UniverseManager => _baseAlgorithm.UniverseManager;\n\n        /// <summary>\n        /// Gets the subscription settings to be used when adding securities via universe selection\n        /// </summary>\n        public UniverseSettings UniverseSettings => _baseAlgorithm.UniverseSettings;\n\n        /// <summary>\n        /// Current date/time in UTC.\n        /// </summary>\n        public DateTime UtcTime => _baseAlgorithm.UtcTime;\n\n        /// <summary>\n        /// Gets the account currency\n        /// </summary>\n        public string AccountCurrency => _baseAlgorithm.AccountCurrency;\n\n        /// <summary>\n        /// Gets the insight manager\n        /// </summary>\n        public InsightManager Insights => _baseAlgorithm.Insights;\n\n        /// <summary>\n        /// Sets the statistics service instance to be used by the algorithm\n        /// </summary>\n        /// <param name=\"statisticsService\">The statistics service instance</param>\n        public void SetStatisticsService(IStatisticsService statisticsService) => _baseAlgorithm.SetStatisticsService(statisticsService);\n\n        /// <summary>\n        /// The current statistics for the running algorithm.\n        /// </summary>\n        public StatisticsResults Statistics => _baseAlgorithm.Statistics;\n\n        /// <summary>\n        /// SignalExport - Allows sending export signals to different 3rd party API's. For example, it allows to send signals\n        /// to Collective2, CrunchDAO and Numerai API's\n        /// </summary>\n        public SignalExportManager SignalExport => ((QCAlgorithm)_baseAlgorithm).SignalExport;\n\n        /// <summary>\n        /// The execution model\n        /// </summary>\n        public IExecutionModel Execution => ((QCAlgorithm)_baseAlgorithm).Execution;\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"securityType\">SecurityType Enum: Equity, Commodity, FOREX or Future</param>\n        /// <param name=\"symbol\">Symbol Representation of the MarketType, e.g. AAPL</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily.</param>\n        /// <param name=\"market\">The market the requested security belongs to, such as 'usa' or 'fxcm'</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        public Security AddSecurity(SecurityType securityType, string symbol, Resolution? resolution, string market, bool? fillForward, decimal leverage, bool? extendedMarketHours,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null)\n            => _baseAlgorithm.AddSecurity(securityType, symbol, resolution, market, fillForward, leverage, extendedMarketHours, dataMappingMode, dataNormalizationMode);\n\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The security Symbol</param>\n        /// <param name=\"resolution\">Resolution of the MarketType required: MarketData, Second or Minute</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <returns>The new Security that was added to the algorithm</returns>\n        public Security AddSecurity(Symbol symbol, Resolution? resolution = null, bool? fillForward = null, decimal leverage = Security.NullLeverage, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int contractDepthOffset = 0)\n            => _baseAlgorithm.AddSecurity(symbol, resolution, fillForward, leverage, extendedMarketHours, dataMappingMode, dataNormalizationMode, contractDepthOffset);\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Future\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The futures contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <returns>The new <see cref=\"Future\"/> security</returns>\n        public Future AddFutureContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true, decimal leverage = 0m,\n            bool extendedMarketHours = false)\n            => _baseAlgorithm.AddFutureContract(symbol, resolution, fillForward, leverage, extendedMarketHours);\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Option\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <returns>The new <see cref=\"Option\"/> security</returns>\n        public Option AddOptionContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true, decimal leverage = 0m, bool extendedMarketHours = false)\n            => _baseAlgorithm.AddOptionContract(symbol, resolution, fillForward, leverage, extendedMarketHours);\n\n        /// <summary>\n        /// Invoked at the end of every time step. This allows the algorithm\n        /// to process events before advancing to the next time step.\n        /// </summary>\n        public void OnEndOfTimeStep()\n        {\n            _baseAlgorithm.OnEndOfTimeStep();\n        }\n\n        /// <summary>\n        /// Send debug message\n        /// </summary>\n        /// <param name=\"message\">String message</param>\n        public void Debug(string message) => _baseAlgorithm.Debug(message);\n\n        /// <summary>\n        /// Send an error message for the algorithm\n        /// </summary>\n        /// <param name=\"message\">String message</param>\n        public void Error(string message) => _baseAlgorithm.Error(message);\n\n        /// <summary>\n        /// Add a Chart object to algorithm collection\n        /// </summary>\n        /// <param name=\"chart\">Chart object to add to collection.</param>\n        public void AddChart(Chart chart) => _baseAlgorithm.AddChart(chart);\n\n        /// <summary>\n        /// Get the chart updates since the last request:\n        /// </summary>\n        /// <param name=\"clearChartData\"></param>\n        /// <returns>List of Chart Updates</returns>\n        public IEnumerable<Chart> GetChartUpdates(bool clearChartData = false) => _baseAlgorithm.GetChartUpdates(clearChartData);\n\n        /// <summary>\n        /// Gets whether or not this algorithm has been locked and fully initialized\n        /// </summary>\n        public bool GetLocked() => _baseAlgorithm.GetLocked();\n\n        /// <summary>\n        /// Gets a read-only dictionary with all current parameters\n        /// </summary>\n        public ReadOnlyExtendedDictionary<string, string> GetParameters() => _baseAlgorithm.GetParameters();\n\n        /// <summary>\n        /// Gets the parameter with the specified name. If a parameter with the specified name does not exist,\n        /// the given default value is returned if any, else null\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        public string GetParameter(string name, string defaultValue = null) => _baseAlgorithm.GetParameter(name, defaultValue);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as an integer. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        public int GetParameter(string name, int defaultValue) => _baseAlgorithm.GetParameter(name, defaultValue);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a double. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        public double GetParameter(string name, double defaultValue) => _baseAlgorithm.GetParameter(name, defaultValue);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a decimal. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        public decimal GetParameter(string name, decimal defaultValue) => _baseAlgorithm.GetParameter(name, defaultValue);\n\n        /// <summary>\n        /// Initialise the Algorithm and Prepare Required Data:\n        /// </summary>\n        public void Initialize()\n        {\n            InvokeMethod(nameof(Initialize));\n        }\n\n        /// <summary>\n        /// Liquidate your portfolio holdings\n        /// </summary>\n        /// <param name=\"symbol\">Specific asset to liquidate, defaults to all</param>\n        /// <param name=\"asynchronous\">Flag to indicate if the symbols should be liquidated asynchronously</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this</param>\n        /// <param name=\"orderProperties\">Order properties to use</param>\n        public List<OrderTicket> Liquidate(Symbol symbol = null, bool asynchronous = false, string tag = \"Liquidated\", IOrderProperties orderProperties = null) => _baseAlgorithm.Liquidate(symbol, asynchronous, tag, orderProperties);\n\n        /// <summary>\n        /// Save entry to the Log\n        /// </summary>\n        /// <param name=\"message\">String message</param>\n        public void Log(string message) => _baseAlgorithm.Log(message);\n\n        /// <summary>\n        /// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n        /// </summary>\n        public void OnBrokerageDisconnect()\n        {\n            _onBrokerageDisconnect();\n        }\n\n        /// <summary>\n        /// Brokerage message event handler. This method is called for all types of brokerage messages.\n        /// </summary>\n        public void OnBrokerageMessage(BrokerageMessageEvent messageEvent)\n        {\n            _onBrokerageMessage(messageEvent);\n        }\n\n        /// <summary>\n        /// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n        /// </summary>\n        public void OnBrokerageReconnect()\n        {\n            _onBrokerageReconnect();\n        }\n\n        /// <summary>\n        /// v3.0 Handler for all data types\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data</param>\n        public void OnData(Slice slice)\n        {\n            if (_onData != null)\n            {\n                using (Py.GIL())\n                {\n                    _onData(slice);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Used to send data updates to algorithm framework models\n        /// </summary>\n        /// <param name=\"slice\">The current data slice</param>\n        public void OnFrameworkData(Slice slice)\n        {\n            _baseAlgorithm.OnFrameworkData(slice);\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a split event\n        /// </summary>\n        /// <param name=\"splits\">The current time slice splits</param>\n        public void OnSplits(Splits splits)\n        {\n            _onSplits(splits);\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a dividend event\n        /// </summary>\n        /// <param name=\"dividends\">The current time slice dividends</param>\n        public void OnDividends(Dividends dividends)\n        {\n            _onDividends(dividends);\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a delistings event\n        /// </summary>\n        /// <param name=\"delistings\">The current time slice delistings</param>\n        public void OnDelistings(Delistings delistings)\n        {\n            _onDelistings(delistings);\n        }\n\n        /// <summary>\n        /// Event handler to be called when there's been a symbol changed event\n        /// </summary>\n        /// <param name=\"symbolsChanged\">The current time slice symbol changed events</param>\n        public void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged)\n        {\n            _onSymbolChangedEvents(symbolsChanged);\n        }\n\n        /// <summary>\n        /// Call this event at the end of the algorithm running.\n        /// </summary>\n        public void OnEndOfAlgorithm()\n        {\n            InvokeMethod(nameof(OnEndOfAlgorithm));\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>Method is called 10 minutes before closing to allow user to close out position.</remarks>\n        /// <remarks>Deprecated because different assets have different market close times,\n        /// and because Python does not support two methods with the same name</remarks>\n        [Obsolete(\"This method is deprecated. Please use this overload: OnEndOfDay(Symbol symbol)\")]\n        [StubsIgnore]\n        public void OnEndOfDay()\n        {\n            try\n            {\n                _onEndOfDay();\n            }\n            // If OnEndOfDay is not defined in the script, but OnEndOfDay(Symbol) is, a python exception occurs\n            // Only throws if there is an error in its implementation body\n            catch (PythonException exception)\n            {\n                if (!exception.Message.Contains(\"OnEndOfDay() missing 1 required positional argument\"))\n                {\n                    _baseAlgorithm.SetRunTimeError(exception);\n                }\n            }\n        }\n\n        /// <summary>\n        /// End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).\n        /// </summary>\n        /// <remarks>\n        /// This method is left for backwards compatibility and is invoked via <see cref=\"OnEndOfDay(Symbol)\"/>, if that method is\n        /// override then this method will not be called without a called to base.OnEndOfDay(string)\n        /// </remarks>\n        /// <param name=\"symbol\">Asset symbol for this end of day event. Forex and equities have different closing hours.</param>\n        [StubsAvoidImplicits]\n        public void OnEndOfDay(Symbol symbol)\n        {\n            try\n            {\n                _onEndOfDay(symbol);\n            }\n            // If OnEndOfDay(Symbol) is not defined in the script, but OnEndOfDay is, a python exception occurs\n            // Only throws if there is an error in its implementation body\n            catch (PythonException exception)\n            {\n                if (!exception.Message.Contains(\"OnEndOfDay() takes 1 positional argument but 2 were given\"))\n                {\n                    _baseAlgorithm.SetRunTimeError(exception);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        public void OnMarginCall(List<SubmitOrderRequest> requests)\n        {\n            using (Py.GIL())\n            {\n                var result = InvokeMethod(nameof(OnMarginCall), requests);\n\n                if (_onMarginCall != null)\n                {\n                    // If the method does not return or returns a non-iterable PyObject, throw an exception\n                    if (result == null || !result.IsIterable())\n                    {\n                        throw new Exception(\"OnMarginCall must return a non-empty list of SubmitOrderRequest\");\n                    }\n\n                    requests.Clear();\n\n                    using var iterator = result.GetIterator();\n                    foreach (PyObject pyRequest in iterator)\n                    {\n                        SubmitOrderRequest request;\n                        if (TryConvert(pyRequest, out request))\n                        {\n                            requests.Add(request);\n                        }\n                    }\n\n                    // If the PyObject is an empty list or its items are not SubmitOrderRequest objects, throw an exception\n                    if (requests.Count == 0)\n                    {\n                        throw new Exception(\"OnMarginCall must return a non-empty list of SubmitOrderRequest\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue\n        /// </summary>\n        public void OnMarginCallWarning()\n        {\n            _onMarginCallWarning();\n        }\n\n        /// <summary>\n        /// EXPERTS ONLY:: [-!-Async Code-!-]\n        /// New order event handler: on order status changes (filled, partially filled, cancelled etc).\n        /// </summary>\n        /// <param name=\"newEvent\">Event information</param>\n        public void OnOrderEvent(OrderEvent newEvent)\n        {\n            _onOrderEvent(newEvent);\n        }\n\n        /// <summary>\n        /// Generic untyped command call handler\n        /// </summary>\n        /// <param name=\"data\">The associated data</param>\n        /// <returns>True if success, false otherwise. Returning null will disable command feedback</returns>\n        public bool? OnCommand(dynamic data)\n        {\n            return _onCommand(data);\n        }\n\n        /// <summary>\n        /// Will submit an order request to the algorithm\n        /// </summary>\n        /// <param name=\"request\">The request to submit</param>\n        /// <remarks>Will run order prechecks, which include making sure the algorithm is not warming up, security is added and has data among others</remarks>\n        /// <returns>The order ticket</returns>\n        public OrderTicket SubmitOrderRequest(SubmitOrderRequest request)\n        {\n            return _baseAlgorithm.SubmitOrderRequest(request);\n        }\n\n        /// <summary>\n        /// Option assignment event handler. On an option assignment event for short legs the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"assignmentEvent\">Option exercise event details containing details of the assignment</param>\n        /// <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>\n        public void OnAssignmentOrderEvent(OrderEvent assignmentEvent)\n        {\n            _onAssignmentOrderEvent(assignmentEvent);\n        }\n\n        /// <summary>\n        /// Event fired each time the we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        public void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            _onSecuritiesChanged(changes);\n        }\n\n        /// <summary>\n        /// Used to send security changes to algorithm framework models\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        public void OnFrameworkSecuritiesChanged(SecurityChanges changes)\n        {\n            _onFrameworkSecuritiesChanged(changes);\n        }\n\n        /// <summary>\n        /// Called by setup handlers after Initialize and allows the algorithm a chance to organize\n        /// the data gather in the Initialize method\n        /// </summary>\n        public void PostInitialize()\n        {\n            _baseAlgorithm.PostInitialize();\n        }\n\n        /// <summary>\n        /// Called when the algorithm has completed initialization and warm up.\n        /// </summary>\n        public void OnWarmupFinished()\n        {\n            InvokeMethod(nameof(OnWarmupFinished));\n        }\n\n        /// <summary>\n        /// Removes the security with the specified symbol. This will cancel all\n        /// open orders and then liquidate any existing holdings\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be removed</param>\n        /// <param name=\"tag\">Optional tag to indicate the cause of removal</param>\n        public bool RemoveSecurity(Symbol symbol, string tag = null) => _baseAlgorithm.RemoveSecurity(symbol, tag);\n\n        /// <summary>\n        /// Set the algorithm Id for this backtest or live run. This can be used to identify the order and equity records.\n        /// </summary>\n        /// <param name=\"algorithmId\">unique 32 character identifier for backtest or live server</param>\n        public void SetAlgorithmId(string algorithmId) => _baseAlgorithm.SetAlgorithmId(algorithmId);\n\n        /// <summary>\n        /// Sets the implementation used to handle messages from the brokerage.\n        /// The default implementation will forward messages to debug or error\n        /// and when a <see cref=\"BrokerageMessageType.Error\"/> occurs, the algorithm\n        /// is stopped.\n        /// </summary>\n        /// <param name=\"handler\">The message handler to use</param>\n        public void SetBrokerageMessageHandler(IBrokerageMessageHandler handler) => _baseAlgorithm.SetBrokerageMessageHandler(handler);\n\n        /// <summary>\n        /// Sets the brokerage model used to resolve transaction models, settlement models,\n        /// and brokerage specified ordering behaviors.\n        /// </summary>\n        /// <param name=\"brokerageModel\">The brokerage model used to emulate the real\n        /// brokerage</param>\n        public void SetBrokerageModel(IBrokerageModel brokerageModel) => _baseAlgorithm.SetBrokerageModel(brokerageModel);\n\n        /// <summary>\n        /// Sets the account currency cash symbol this algorithm is to manage, as well\n        /// as the starting cash in this currency if given\n        /// </summary>\n        /// <remarks>Has to be called during <see cref=\"Initialize\"/> before\n        /// calling <see cref=\"SetCash(decimal)\"/> or adding any <see cref=\"Security\"/></remarks>\n        /// <param name=\"accountCurrency\">The account currency cash symbol to set</param>\n        /// <param name=\"startingCash\">The account currency starting cash to set</param>\n        public void SetAccountCurrency(string accountCurrency, decimal? startingCash = null) => _baseAlgorithm.SetAccountCurrency(accountCurrency, startingCash);\n\n        /// <summary>\n        /// Set the starting capital for the strategy\n        /// </summary>\n        /// <param name=\"startingCash\">decimal starting capital, default $100,000</param>\n        public void SetCash(decimal startingCash) => _baseAlgorithm.SetCash(startingCash);\n\n        /// <summary>\n        /// Set the cash for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The cash symbol to set</param>\n        /// <param name=\"startingCash\">Decimal cash value of portfolio</param>\n        /// <param name=\"conversionRate\">The current conversion rate for the</param>\n        public void SetCash(string symbol, decimal startingCash, decimal conversionRate = 0) => _baseAlgorithm.SetCash(symbol, startingCash, conversionRate);\n\n        /// <summary>\n        /// Set the DateTime Frontier: This is the master time and is\n        /// </summary>\n        /// <param name=\"time\"></param>\n        public void SetDateTime(DateTime time) => _baseAlgorithm.SetDateTime(time);\n\n        /// <summary>\n        /// Set the start date for the backtest\n        /// </summary>\n        /// <param name=\"start\">Datetime Start date for backtest</param>\n        /// <remarks>Must be less than end date and within data available</remarks>\n        public void SetStartDate(DateTime start) => _baseAlgorithm.SetStartDate(start);\n\n        /// <summary>\n        /// Set the end date for a backtest.\n        /// </summary>\n        /// <param name=\"end\">Datetime value for end date</param>\n        /// <remarks>Must be greater than the start date</remarks>\n        public void SetEndDate(DateTime end) => _baseAlgorithm.SetEndDate(end);\n\n        /// <summary>\n        /// Get the last known price using the history provider.\n        /// Useful for seeding securities with the correct price\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for which to retrieve historical data</param>\n        /// <returns>A single <see cref=\"BaseData\"/> object with the last known price</returns>\n        public BaseData GetLastKnownPrice(Symbol symbol) => _baseAlgorithm.GetLastKnownPrice(symbol);\n\n        /// <summary>\n        /// Yields data to warmup a security for all it's subscribed data types\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for which to retrieve historical data</param>\n        /// <returns>Securities historical data</returns>\n        public IEnumerable<BaseData> GetLastKnownPrices(Symbol symbol) => _baseAlgorithm.GetLastKnownPrices(symbol);\n\n        /// <summary>\n        /// Yields data to warm up multiple securities for all their subscribed data types\n        /// </summary>\n        /// <param name=\"symbols\">The symbols we want to get seed data for</param>\n        /// <returns>Securities historical data</returns>\n        public DataDictionary<IEnumerable<BaseData>> GetLastKnownPrices(IEnumerable<Symbol> symbols) => _baseAlgorithm.GetLastKnownPrices(symbols);\n\n        /// <summary>\n        /// Set the runtime error\n        /// </summary>\n        /// <param name=\"exception\">Represents error that occur during execution</param>\n        public void SetRunTimeError(Exception exception) => _baseAlgorithm.SetRunTimeError(exception);\n\n        /// <summary>\n        /// Sets <see cref=\"IsWarmingUp\"/> to false to indicate this algorithm has finished its warm up\n        /// </summary>\n        public void SetFinishedWarmingUp()\n        {\n            _baseAlgorithm.SetFinishedWarmingUp();\n\n            // notify the algorithm\n            OnWarmupFinished();\n        }\n\n        /// <summary>\n        /// Set the historical data provider\n        /// </summary>\n        /// <param name=\"historyProvider\">Historical data provider</param>\n        public void SetHistoryProvider(IHistoryProvider historyProvider) => _baseAlgorithm.SetHistoryProvider(historyProvider);\n\n        /// <summary>\n        /// Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode.\n        /// </summary>\n        /// <param name=\"live\">Bool live mode flag</param>\n        public void SetLiveMode(bool live) => _baseAlgorithm.SetLiveMode(live);\n\n        /// <summary>\n        /// Sets the algorithm running mode\n        /// </summary>\n        /// <param name=\"algorithmMode\">Algorithm mode</param>\n        public void SetAlgorithmMode(AlgorithmMode algorithmMode) => _baseAlgorithm.SetAlgorithmMode(algorithmMode);\n\n        /// <summary>\n        /// Sets the algorithm deployment target\n        /// </summary>\n        /// <param name=\"deploymentTarget\">Deployment target</param>\n        public void SetDeploymentTarget(DeploymentTarget deploymentTarget) => _baseAlgorithm.SetDeploymentTarget(deploymentTarget);\n\n        /// <summary>\n        /// Set the algorithm as initialized and locked. No more cash or security changes.\n        /// </summary>\n        public void SetLocked() => _baseAlgorithm.SetLocked();\n\n        /// <summary>\n        /// Set the maximum number of orders the algorithm is allowed to process.\n        /// </summary>\n        /// <param name=\"max\">Maximum order count int</param>\n        public void SetMaximumOrders(int max) => _baseAlgorithm.SetMaximumOrders(max);\n\n        /// <summary>\n        /// Sets the parameters from the dictionary\n        /// </summary>\n        /// <param name=\"parameters\">Dictionary containing the parameter names to values</param>\n        public void SetParameters(Dictionary<string, string> parameters) => _baseAlgorithm.SetParameters(parameters);\n\n        /// <summary>\n        /// Tries to convert a PyObject into a C# object\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the C# object</typeparam>\n        /// <param name=\"pyObject\">PyObject to be converted</param>\n        /// <param name=\"result\">C# object that of type T</param>\n        /// <returns>True if successful conversion</returns>\n        private bool TryConvert<T>(PyObject pyObject, out T result)\n        {\n            result = default(T);\n            var type = (Type)pyObject.GetPythonType().AsManagedObject(typeof(Type));\n\n            if (type == typeof(T))\n            {\n                result = (T)pyObject.AsManagedObject(typeof(T));\n            }\n\n            return type == typeof(T);\n        }\n\n        /// <summary>\n        /// Returns a <see cref = \"string\"/> that represents the current <see cref = \"AlgorithmPythonWrapper\"/> object.\n        /// </summary>\n        /// <returns></returns>\n        public override string ToString()\n        {\n            if (Instance == null)\n            {\n                return base.ToString();\n            }\n            using (Py.GIL())\n            {\n                return Instance.Repr();\n            }\n        }\n\n        /// <summary>\n        /// Sets the current slice\n        /// </summary>\n        /// <param name=\"slice\">The Slice object</param>\n        public void SetCurrentSlice(Slice slice)\n        {\n            _baseAlgorithm.SetCurrentSlice(slice);\n        }\n\n        /// <summary>\n        /// Provide the API for the algorithm.\n        /// </summary>\n        /// <param name=\"api\">Initiated API</param>\n        public void SetApi(IApi api) => _baseAlgorithm.SetApi(api);\n\n        /// <summary>\n        /// Sets the object store\n        /// </summary>\n        /// <param name=\"objectStore\">The object store</param>\n        public void SetObjectStore(IObjectStore objectStore) => _baseAlgorithm.SetObjectStore(objectStore);\n\n        /// <summary>\n        /// Determines if the Symbol is shortable at the brokerage\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check if shortable</param>\n        /// <param name=\"shortQuantity\">Order's quantity to check if it is currently shortable, taking into account current holdings and open orders</param>\n        /// <param name=\"updateOrderId\">Optionally the id of the order being updated. When updating an order\n        /// we want to ignore it's submitted short quantity and use the new provided quantity to determine if we\n        /// can perform the update</param>\n        /// <returns>True if the symbol can be shorted by the requested quantity</returns>\n        public bool Shortable(Symbol symbol, decimal shortQuantity, int? updateOrderId = null)\n        {\n            return _baseAlgorithm.Shortable(symbol, shortQuantity, updateOrderId);\n        }\n\n        /// <summary>\n        /// Gets the quantity shortable for the given asset\n        /// </summary>\n        /// <returns>\n        /// Quantity shortable for the given asset. Zero if not\n        /// shortable, or a number greater than zero if shortable.\n        /// </returns>\n        public long ShortableQuantity(Symbol symbol)\n        {\n            return _baseAlgorithm.ShortableQuantity(symbol);\n        }\n\n        /// <summary>\n        /// Converts the string 'ticker' symbol into a full <see cref=\"Symbol\"/> object\n        /// This requires that the string 'ticker' has been added to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The ticker symbol. This should be the ticker symbol\n        /// as it was added to the algorithm</param>\n        /// <returns>The symbol object mapped to the specified ticker</returns>\n        public Symbol Symbol(string ticker) => _baseAlgorithm.Symbol(ticker);\n\n        /// <summary>\n        /// For the given symbol will resolve the ticker it used at the current algorithm date\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get the ticker for</param>\n        /// <returns>The mapped ticker for a symbol</returns>\n        public string Ticker(Symbol symbol) => _baseAlgorithm.Ticker(symbol);\n\n        /// <summary>\n        /// Sets name to the currently running backtest\n        /// </summary>\n        /// <param name=\"name\">The name for the backtest</param>\n        public void SetName(string name)\n        {\n            _baseAlgorithm.SetName(name);\n        }\n\n        /// <summary>\n        /// Adds a tag to the algorithm\n        /// </summary>\n        /// <param name=\"tag\">The tag to add</param>\n        public void AddTag(string tag)\n        {\n            _baseAlgorithm.AddTag(tag);\n        }\n\n        /// <summary>\n        /// Sets the tags for the algorithm\n        /// </summary>\n        /// <param name=\"tags\">The tags</param>\n        public void SetTags(HashSet<string> tags)\n        {\n            _baseAlgorithm.SetTags(tags);\n        }\n\n        /// <summary>\n        /// Run a callback command instance\n        /// </summary>\n        /// <param name=\"command\">The callback command instance</param>\n        /// <returns>The command result</returns>\n        public CommandResultPacket RunCommand(CallbackCommand command) => _baseAlgorithm.RunCommand(command);\n\n        /// <summary>\n        /// Gets the default order properties\n        /// </summary>\n        public IOrderProperties DefaultOrderProperties => _baseAlgorithm.DefaultOrderProperties;\n\n        /// <summary>\n        /// Dispose of this instance\n        /// </summary>\n        public override void Dispose()\n        {\n            using var _ = Py.GIL();\n            _onBrokerageDisconnect?.Dispose();\n            _onBrokerageMessage?.Dispose();\n            _onBrokerageReconnect?.Dispose();\n            _onSplits?.Dispose();\n            _onDividends?.Dispose();\n            _onDelistings?.Dispose();\n            _onSymbolChangedEvents?.Dispose();\n            _onEndOfDay?.Dispose();\n            _onMarginCallWarning?.Dispose();\n            _onOrderEvent?.Dispose();\n            _onCommand?.Dispose();\n            _onAssignmentOrderEvent?.Dispose();\n            _onSecuritiesChanged?.Dispose();\n            _onFrameworkSecuritiesChanged?.Dispose();\n\n            _onData?.Dispose();\n            _onMarginCall?.Dispose();\n            base.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.AlgorithmFactory</RootNamespace>\n    <AssemblyName>QuantConnect.AlgorithmFactory</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.AlgorithmFactory.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Algorithm.AlgorithmFactory Project - Factory for instantiation of QCAlgorithm algorithm objects to be used with LEAN</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Api/Api.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Http;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Orders;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\nusing QuantConnect.Notifications;\nusing Python.Runtime;\nusing System.Threading;\nusing System.Net.Http.Headers;\nusing System.Collections.Concurrent;\nusing System.Text;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// QuantConnect.com Interaction Via API.\n    /// </summary>\n    public class Api : IApi, IDownloadProvider\n    {\n        private readonly BlockingCollection<Lazy<HttpClient>> _clientPool;\n        private string _dataFolder;\n\n        /// <summary>\n        /// Serializer settings to use\n        /// </summary>\n        protected JsonSerializerSettings SerializerSettings { get; set; } = new()\n        {\n            ContractResolver = new DefaultContractResolver\n            {\n                NamingStrategy = new CamelCaseNamingStrategy\n                {\n                    ProcessDictionaryKeys = false,\n                    OverrideSpecifiedNames = true\n                }\n            }\n        };\n\n        /// <summary>\n        /// Returns the underlying API connection\n        /// </summary>\n        protected ApiConnection ApiConnection { get; private set; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"Api\"/>\n        /// </summary>\n        public Api()\n        {\n            _clientPool = new BlockingCollection<Lazy<HttpClient>>(new ConcurrentQueue<Lazy<HttpClient>>(), 5);\n            for (int i = 0; i < _clientPool.BoundedCapacity; i++)\n            {\n                _clientPool.Add(new Lazy<HttpClient>());\n            }\n        }\n\n        /// <summary>\n        /// Initialize the API with the given variables\n        /// </summary>\n        public virtual void Initialize(int userId, string token, string dataFolder)\n        {\n            ApiConnection = CreateApiConnection(userId, token);\n            _dataFolder = dataFolder?.Replace(\"\\\\\", \"/\", StringComparison.InvariantCulture);\n\n            //Allow proper decoding of orders from the API.\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = { new OrderJsonConverter() }\n            };\n        }\n\n        /// <summary>\n        /// Check if Api is successfully connected with correct credentials\n        /// </summary>\n        public bool Connected => ApiConnection.Connected;\n\n        /// <summary>\n        /// Create a project with the specified name and language via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"name\">Project name</param>\n        /// <param name=\"language\">Programming language to use</param>\n        /// <param name=\"organizationId\">Optional param for specifying organization to create project under.\n        /// If none provided web defaults to preferred.</param>\n        /// <returns>Project object from the API.</returns>\n\n        public ProjectResponse CreateProject(string name, Language language, string organizationId = null)\n        {\n            object payload = string.IsNullOrEmpty(organizationId)\n                ? new { name, language }\n                : new { name, language, organizationId };\n            TryJsonPost(\"projects/create\", out ProjectResponse result, payload);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Get details about a single project\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project</param>\n        /// <returns><see cref=\"ProjectResponse\"/> that contains information regarding the project</returns>\n\n        public ProjectResponse ReadProject(int projectId)\n        {\n            TryJsonPost(\"projects/read\", out ProjectResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// List details of all projects\n        /// </summary>\n        /// <returns><see cref=\"ProjectResponse\"/> that contains information regarding the project</returns>\n\n        public ProjectResponse ListProjects()\n        {\n            TryJsonPost(\"projects/read\", out ProjectResponse result);\n            return result;\n        }\n\n\n        /// <summary>\n        /// Add a file to a project\n        /// </summary>\n        /// <param name=\"projectId\">The project to which the file should be added</param>\n        /// <param name=\"name\">The name of the new file</param>\n        /// <param name=\"content\">The content of the new file</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes information about the newly created file</returns>\n\n        public RestResponse AddProjectFile(int projectId, string name, string content)\n        {\n            TryJsonPost(\"files/create\", out RestResponse result, new { projectId, name, content });\n            return result;\n        }\n\n        /// <summary>\n        /// Update the name of a file\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"oldFileName\">The current name of the file</param>\n        /// <param name=\"newFileName\">The new name for the file</param>\n        /// <returns><see cref=\"RestResponse\"/> indicating success</returns>\n\n        public RestResponse UpdateProjectFileName(int projectId, string oldFileName, string newFileName)\n        {\n            var payload = new\n            {\n                projectId,\n                name = oldFileName,\n                newName = newFileName\n            };\n            TryJsonPost(\"files/update\", out RestResponse result, payload);\n            return result;\n        }\n\n\n        /// <summary>\n        /// Update the contents of a file\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"fileName\">The name of the file that should be updated</param>\n        /// <param name=\"newFileContents\">The new contents of the file</param>\n        /// <returns><see cref=\"RestResponse\"/> indicating success</returns>\n\n        public RestResponse UpdateProjectFileContent(int projectId, string fileName, string newFileContents)\n        {\n            var payload = new\n            {\n                projectId,\n                name = fileName,\n                content = newFileContents\n            };\n            TryJsonPost(\"files/update\", out RestResponse result, payload);\n            return result;\n        }\n\n\n        /// <summary>\n        /// Read all files in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes the information about all files in the project</returns>\n\n        public ProjectFilesResponse ReadProjectFiles(int projectId)\n        {\n            TryJsonPost(\"files/read\", out ProjectFilesResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Read all nodes in a project.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the nodes refer</param>\n        /// <returns><see cref=\"ProjectNodesResponse\"/> that includes the information about all nodes in the project</returns>\n        public ProjectNodesResponse ReadProjectNodes(int projectId)\n        {\n            TryJsonPost(\"projects/nodes/read\", out ProjectNodesResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Update the active state of some nodes to true.\n        /// If you don't provide any nodes, all the nodes become inactive and AutoSelectNode is true.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the nodes refer</param>\n        /// <param name=\"nodes\">List of node ids to update</param>\n        /// <returns><see cref=\"ProjectNodesResponse\"/> that includes the information about all nodes in the project</returns>\n        public ProjectNodesResponse UpdateProjectNodes(int projectId, string[] nodes)\n        {\n            TryJsonPost(\"projects/nodes/update\", out ProjectNodesResponse result, new { projectId, nodes });\n            return result;\n        }\n\n        /// <summary>\n        /// Read a file in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"fileName\">The name of the file</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes the file information</returns>\n\n        public ProjectFilesResponse ReadProjectFile(int projectId, string fileName)\n        {\n            TryJsonPost(\"files/read\", out ProjectFilesResponse result, new { projectId, name = fileName });\n            return result;\n        }\n\n        /// <summary>\n        /// Gets a list of LEAN versions with their corresponding basic descriptions\n        /// </summary>\n        public VersionsResponse ReadLeanVersions()\n        {\n            TryPost(\"lean/versions/read\", out VersionsResponse result);\n            return result;\n        }\n\n        /// <summary>\n        /// Delete a file in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"name\">The name of the file that should be deleted</param>\n        /// <returns><see cref=\"RestResponse\"/> that includes the information about all files in the project</returns>\n\n        public RestResponse DeleteProjectFile(int projectId, string name)\n        {\n            TryJsonPost(\"files/delete\", out RestResponse result, new { projectId, name });\n            return result;\n        }\n\n        /// <summary>\n        /// Delete a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id we own and wish to delete</param>\n        /// <returns>RestResponse indicating success</returns>\n\n        public RestResponse DeleteProject(int projectId)\n        {\n            TryJsonPost(\"projects/delete\", out RestResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Create a new compile job request for this project id.\n        /// </summary>\n        /// <param name=\"projectId\">Project id we wish to compile.</param>\n        /// <returns>Compile object result</returns>\n\n        public Compile CreateCompile(int projectId)\n        {\n            TryJsonPost(\"compile/create\", out Compile result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Read a compile packet job result.\n        /// </summary>\n        /// <param name=\"projectId\">Project id we sent for compile</param>\n        /// <param name=\"compileId\">Compile id return from the creation request</param>\n        /// <returns><see cref=\"Compile\"/></returns>\n\n        public Compile ReadCompile(int projectId, string compileId)\n        {\n            TryJsonPost(\"compile/read\", out Compile result, new { projectId, compileId });\n            return result;\n        }\n\n        /// <summary>\n        /// Sends a notification\n        /// </summary>\n        /// <param name=\"notification\">The notification to send</param>\n        /// <param name=\"projectId\">The project id</param>\n        /// <returns><see cref=\"RestResponse\"/> containing success response and errors</returns>\n        public virtual RestResponse SendNotification(Notification notification, int projectId)\n        {\n            throw new NotImplementedException($\"{nameof(Api)} does not support sending notifications\");\n        }\n\n        /// <summary>\n        /// Create a new backtest request and get the id.\n        /// </summary>\n        /// <param name=\"projectId\">Id for the project to backtest</param>\n        /// <param name=\"compileId\">Compile id for the project</param>\n        /// <param name=\"backtestName\">Name for the new backtest</param>\n        /// <returns><see cref=\"Backtest\"/>t</returns>\n\n        public Backtest CreateBacktest(int projectId, string compileId, string backtestName)\n        {\n            TryJsonPost(\"backtests/create\",\n                out BacktestResponseWrapper result,\n                new\n                {\n                    projectId,\n                    compileId,\n                    backtestName\n                });\n\n            // Use API Response values for Backtest Values\n            result.Backtest.Success = result.Success;\n            result.Backtest.Errors = result.Errors;\n\n            // Return only the backtest object\n            return result.Backtest;\n        }\n\n        /// <summary>\n        /// Read out a backtest in the project id specified.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to read</param>\n        /// <param name=\"backtestId\">Specific backtest id to read</param>\n        /// <param name=\"getCharts\">True will return backtest charts</param>\n        /// <returns><see cref=\"Backtest\"/></returns>\n\n        public Backtest ReadBacktest(int projectId, string backtestId, bool getCharts = true)\n        {\n            TryJsonPost(\"backtests/read\", out BacktestResponseWrapper result, new { projectId, backtestId });\n\n            if (result == null)\n            {\n                // api call failed\n                return null;\n            }\n\n            if (!result.Success)\n            {\n                // place an empty place holder so we can return any errors back to the user and not just null\n                result.Backtest = new Backtest { BacktestId = backtestId };\n            }\n            // Go fetch the charts if the backtest is completed and success\n            else if (getCharts && result.Backtest.Completed)\n            {\n                // For storing our collected charts\n                var updatedCharts = new Dictionary<string, Chart>();\n\n                // Create backtest requests for each chart that is empty\n                foreach (var chart in result.Backtest.Charts)\n                {\n                    if (!chart.Value.Series.IsNullOrEmpty())\n                    {\n                        continue;\n                    }\n\n                    var payload = new\n                    {\n                        projectId,\n                        backtestId,\n                        name = chart.Key,\n                        count = 100\n                    };\n                    if (TryJsonPost(\"backtests/chart/read\", out ReadChartResponse chartResponse, payload) && chartResponse.Success)\n                    {\n                        updatedCharts.Add(chart.Key, chartResponse.Chart);\n                    }\n                }\n\n                // Update our result\n                foreach (var updatedChart in updatedCharts)\n                {\n                    result.Backtest.Charts[updatedChart.Key] = updatedChart.Value;\n                }\n            }\n\n            // Use API Response values for Backtest Values\n            result.Backtest.Success = result.Success;\n            result.Backtest.Errors = result.Errors;\n\n            // Return only the backtest object\n            return result.Backtest;\n        }\n\n        /// <summary>\n        /// Returns the orders of the specified backtest and project id.\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the orders</param>\n        /// <param name=\"backtestId\">Id of the backtest from which to read the orders</param>\n        /// <param name=\"start\">Starting index of the orders to be fetched. Required if end > 100</param>\n        /// <param name=\"end\">Last index of the orders to be fetched. Note that end - start must be less than 100</param>\n        /// <remarks>Will throw an <see cref=\"WebException\"/> if there are any API errors</remarks>\n        /// <returns>The list of <see cref=\"Order\"/></returns>\n\n        public List<ApiOrderResponse> ReadBacktestOrders(int projectId, string backtestId, int start = 0, int end = 100)\n        {\n            using var request = ApiUtils.CreateJsonPostRequest(\"backtests/orders/read\", new\n            {\n                start,\n                end,\n                projectId,\n                backtestId\n            });\n\n            return MakeRequestOrThrow<OrdersResponseWrapper>(request, nameof(ReadBacktestOrders)).Orders;\n        }\n\n        /// <summary>\n        /// Returns a requested chart object from a backtest\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the request</param>\n        /// <param name=\"name\">The requested chart name</param>\n        /// <param name=\"start\">The Utc start seconds timestamp of the request</param>\n        /// <param name=\"end\">The Utc end seconds timestamp of the request</param>\n        /// <param name=\"count\">The number of data points to request</param>\n        /// <param name=\"backtestId\">Associated Backtest ID for this chart request</param>\n        /// <returns>The chart</returns>\n        public ReadChartResponse ReadBacktestChart(int projectId, string name, int start, int end, uint count, string backtestId)\n        {\n            const string resource = \"backtests/chart/read\";\n            // Serialize just once\n            var payloadStr = JsonConvert.SerializeObject(new\n            {\n                projectId,\n                name,\n                start,\n                end,\n                count,\n                backtestId,\n            });\n            TryJsonPost(resource, out ReadChartResponse result, payloadStr);\n\n            if (result.Chart == null)\n            {\n                var finish = DateTime.UtcNow.AddMinutes(1);\n                while (DateTime.UtcNow < finish && result.Chart == null)\n                {\n                    Thread.Sleep(5000);\n                    TryJsonPost(resource, out result, payloadStr);\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Update a backtest name\n        /// </summary>\n        /// <param name=\"projectId\">Project for the backtest we want to update</param>\n        /// <param name=\"backtestId\">Backtest id we want to update</param>\n        /// <param name=\"name\">Name we'd like to assign to the backtest</param>\n        /// <param name=\"note\">Note attached to the backtest</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n\n        public RestResponse UpdateBacktest(int projectId, string backtestId, string name = null, string note = \"\")\n        {\n            object payload = string.IsNullOrEmpty(name)\n                ? new { projectId, backtestId, note }\n                : new { projectId, backtestId, note, name };\n            TryJsonPost(\"backtests/update\", out RestResponse result, payload);\n            return result;\n        }\n\n        /// <summary>\n        /// List all the backtest summaries for a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id we'd like to get a list of backtest for</param>\n        /// <param name=\"includeStatistics\">True for include statistics in the response, false otherwise</param>\n        /// <returns><see cref=\"BacktestList\"/></returns>\n\n        public BacktestSummaryList ListBacktests(int projectId, bool includeStatistics = true)\n        {\n            TryJsonPost(\"backtests/list\", out BacktestSummaryList result, new { projectId, includeStatistics });\n            return result;\n        }\n\n        /// <summary>\n        /// Delete a backtest from the specified project and backtestId.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the backtest we want to delete</param>\n        /// <param name=\"backtestId\">Backtest id we want to delete</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n\n        public RestResponse DeleteBacktest(int projectId, string backtestId)\n        {\n            TryJsonPost(\"backtests/delete\", out RestResponse result, new { projectId, backtestId });\n            return result;\n        }\n\n        /// <summary>\n        /// Updates the tags collection for a backtest\n        /// </summary>\n        /// <param name=\"projectId\">Project for the backtest we want to update</param>\n        /// <param name=\"backtestId\">Backtest id we want to update</param>\n        /// <param name=\"tags\">The new backtest tags</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse UpdateBacktestTags(int projectId, string backtestId, IReadOnlyCollection<string> tags)\n        {\n            TryJsonPost(\"backtests/tags/update\", out RestResponse result, new { projectId, backtestId, tags });\n            return result;\n        }\n\n        /// <summary>\n        /// Read out the insights of a backtest\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the backtest</param>\n        /// <param name=\"backtestId\">Backtest id from which we want to get the insights</param>\n        /// <param name=\"start\">Starting index of the insights to be fetched</param>\n        /// <param name=\"end\">Last index of the insights to be fetched. Note that end - start must be less than 100</param>\n        /// <returns><see cref=\"InsightResponse\"/></returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        public InsightResponse ReadBacktestInsights(int projectId, string backtestId, int start = 0, int end = 0)\n        {\n            //var reque\n            var diff = end - start;\n            if (diff > 100)\n            {\n                throw new ArgumentException($\"The difference between the start and end index of the insights must be smaller than 100, but it was {diff}.\");\n            }\n            else if (end == 0)\n            {\n                end = start + 100;\n            }\n\n            TryJsonPost(\"backtests/insights/read\", out InsightResponse result, new { projectId, backtestId, start, end });\n            return result;\n        }\n\n        /// <summary>\n        /// Create a live algorithm.\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project on QuantConnect</param>\n        /// <param name=\"compileId\">Id of the compilation on QuantConnect</param>\n        /// <param name=\"nodeId\">Id of the node that will run the algorithm</param>\n        /// <param name=\"brokerageSettings\">Dictionary with brokerage specific settings. Each brokerage requires certain specific credentials\n        ///                         in order to process the given orders. Each key in this dictionary represents a required field/credential\n        ///                         to provide to the brokerage API and its value represents the value of that field. For example: \"brokerageSettings: {\n        ///                         \"id\": \"Binance\", \"binance-api-secret\": \"123ABC\", \"binance-api-key\": \"ABC123\"}. It is worth saying,\n        ///                         that this dictionary must always contain an entry whose key is \"id\" and its value is the name of the brokerage\n        ///                         (see <see cref=\"Brokerages.BrokerageName\"/>)</param>\n        /// <param name=\"versionId\">The version of the Lean used to run the algorithm.\n        ///                         -1 is master, however, sometimes this can create problems with live deployments.\n        ///                         If you experience problems using, try specifying the version of Lean you would like to use.</param>\n        /// <param name=\"dataProviders\">Dictionary with data providers credentials. Each data provider requires certain credentials\n        ///                         in order to retrieve data from their API. Each key in this dictionary describes a data provider name\n        ///                         and its corresponding value is another dictionary with the required key-value pairs of credential\n        ///                         names and values. For example: \"dataProviders: { \"InteractiveBrokersBrokerage\" : { \"id\": 12345, \"environment\" : \"paper\",\n        ///                         \"username\": \"testUsername\", \"password\": \"testPassword\"}}\"</param>\n        /// <returns>Information regarding the new algorithm <see cref=\"CreateLiveAlgorithmResponse\"/></returns>\n        public CreateLiveAlgorithmResponse CreateLiveAlgorithm(int projectId,\n                                                 string compileId,\n                                                 string nodeId,\n                                                 Dictionary<string, object> brokerageSettings,\n                                                 string versionId = \"-1\",\n                                                 Dictionary<string, object> dataProviders = null)\n        {\n            var payload = new LiveAlgorithmApiSettingsWrapper(\n                projectId,\n                compileId,\n                nodeId,\n                brokerageSettings,\n                versionId,\n                dataProviders);\n            TryJsonPost(\"live/create\", out CreateLiveAlgorithmResponse result, payload);\n            return result;\n        }\n\n        /// <summary>\n        /// Create a live algorithm.\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project on QuantConnect</param>\n        /// <param name=\"compileId\">Id of the compilation on QuantConnect</param>\n        /// <param name=\"nodeId\">Id of the node that will run the algorithm</param>\n        /// <param name=\"brokerageSettings\">Python Dictionary with brokerage specific settings. Each brokerage requires certain specific credentials\n        ///                         in order to process the given orders. Each key in this dictionary represents a required field/credential\n        ///                         to provide to the brokerage API and its value represents the value of that field. For example: \"brokerageSettings: {\n        ///                         \"id\": \"Binance\", \"binance-api-secret\": \"123ABC\", \"binance-api-key\": \"ABC123\"}. It is worth saying,\n        ///                         that this dictionary must always contain an entry whose key is \"id\" and its value is the name of the brokerage\n        ///                         (see <see cref=\"Brokerages.BrokerageName\"/>)</param>\n        /// <param name=\"versionId\">The version of the Lean used to run the algorithm.\n        ///                         -1 is master, however, sometimes this can create problems with live deployments.\n        ///                         If you experience problems using, try specifying the version of Lean you would like to use.</param>\n        /// <param name=\"dataProviders\">Python Dictionary with data providers credentials. Each data provider requires certain credentials\n        ///                         in order to retrieve data from their API. Each key in this dictionary describes a data provider name\n        ///                         and its corresponding value is another dictionary with the required key-value pairs of credential\n        ///                         names and values. For example: \"dataProviders: { \"InteractiveBrokersBrokerage\" : { \"id\": 12345, \"environment\" : \"paper\",\n        ///                         \"username\": \"testUsername\", \"password\": \"testPassword\"}}\"</param>\n        /// <returns>Information regarding the new algorithm <see cref=\"CreateLiveAlgorithmResponse\"/></returns>\n\n        public CreateLiveAlgorithmResponse CreateLiveAlgorithm(int projectId, string compileId, string nodeId, PyObject brokerageSettings, string versionId = \"-1\", PyObject dataProviders = null)\n        {\n            return CreateLiveAlgorithm(projectId, compileId, nodeId, ConvertToDictionary(brokerageSettings), versionId, dataProviders != null ? ConvertToDictionary(dataProviders) : null);\n        }\n\n        /// <summary>\n        /// Converts a given Python dictionary into a C# <see cref=\"Dictionary{string, object}\"/>\n        /// </summary>\n        /// <param name=\"brokerageSettings\">Python dictionary to be converted</param>\n        private static Dictionary<string, object> ConvertToDictionary(PyObject brokerageSettings)\n        {\n            using (Py.GIL())\n            {\n                var stringBrokerageSettings = brokerageSettings.ToString();\n                return JsonConvert.DeserializeObject<Dictionary<string, object>>(stringBrokerageSettings);\n            }\n        }\n\n        /// <summary>\n        /// Get a list of live running algorithms for user\n        /// </summary>\n        /// <param name=\"status\">Filter the statuses of the algorithms returned from the api</param>\n        /// <returns><see cref=\"LiveList\"/></returns>\n        public LiveList ListLiveAlgorithms(AlgorithmStatus? status = null)\n        {\n            // Only the following statuses are supported by the Api\n            if (status.HasValue &&\n                status != AlgorithmStatus.Running &&\n                status != AlgorithmStatus.RuntimeError &&\n                status != AlgorithmStatus.Stopped &&\n                status != AlgorithmStatus.Liquidated)\n            {\n                throw new ArgumentException(\n                    \"The Api only supports Algorithm Statuses of Running, Stopped, RuntimeError and Liquidated\");\n            }\n\n            var payload = status.HasValue\n                ? new { status = status.ToString() }\n                : null;\n            TryJsonPost(\"live/list\", out LiveList result, payload);\n            return result;\n        }\n\n        /// <summary>\n        /// Read out a live algorithm in the project id specified.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to read</param>\n        /// <param name=\"deployId\">Specific instance id to read</param>\n        /// <returns><see cref=\"LiveAlgorithmResults\"/></returns>\n\n        public LiveAlgorithmResults ReadLiveAlgorithm(int projectId, string deployId)\n        {\n            TryJsonPost(\"live/read\", out LiveAlgorithmResults result, new { projectId, deployId });\n            return result;\n        }\n\n        /// <summary>\n        /// Read out the portfolio state of a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the live algorithm</param>\n        /// <returns><see cref=\"PortfolioResponse\"/></returns>\n        public PortfolioResponse ReadLivePortfolio(int projectId)\n        {\n            TryJsonPost(\"live/portfolio/read\", out PortfolioResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Returns the orders of the specified project id live algorithm.\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the live orders</param>\n        /// <param name=\"start\">Starting index of the orders to be fetched. Required if end > 100</param>\n        /// <param name=\"end\">Last index of the orders to be fetched. Note that end - start must be less than 100</param>\n        /// <remarks>Will throw an <see cref=\"WebException\"/> if there are any API errors</remarks>\n        /// <returns>The list of <see cref=\"Order\"/></returns>\n\n        public List<ApiOrderResponse> ReadLiveOrders(int projectId, int start = 0, int end = 100)\n        {\n            using var request = ApiUtils.CreateJsonPostRequest(\"live/orders/read\", new\n            {\n                start,\n                end,\n                projectId\n            });\n\n            return MakeRequestOrThrow<OrdersResponseWrapper>(request, nameof(ReadLiveOrders)).Orders;\n        }\n\n        /// <summary>\n        /// Liquidate a live algorithm from the specified project and deployId.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the live instance we want to stop</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n\n        public RestResponse LiquidateLiveAlgorithm(int projectId)\n        {\n            TryJsonPost(\"live/update/liquidate\", out RestResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Stop a live algorithm from the specified project and deployId.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the live instance we want to stop</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse StopLiveAlgorithm(int projectId)\n        {\n            TryJsonPost(\"live/update/stop\", out RestResponse result, new { projectId });\n            return result;\n        }\n\n        /// <summary>\n        /// Create a live command\n        /// </summary>\n        /// <param name=\"projectId\">Project for the live instance we want to run the command against</param>\n        /// <param name=\"command\">The command to run</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse CreateLiveCommand(int projectId, object command)\n        {\n            TryJsonPost(\"live/commands/create\", out RestResponse result, new { projectId, command });\n            return result;\n        }\n\n        /// <summary>\n        /// Broadcast a live command\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID of the projects we would like to broadcast the command to</param>\n        /// <param name=\"excludeProjectId\">Project for the live instance we want to exclude from the broadcast list</param>\n        /// <param name=\"command\">The command to run</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse BroadcastLiveCommand(string organizationId, int? excludeProjectId, object command)\n        {\n            TryJsonPost(\"live/commands/broadcast\", out RestResponse result, new { organizationId, excludeProjectId, command });\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the logs of a specific live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Project Id of the live running algorithm</param>\n        /// <param name=\"algorithmId\">Algorithm Id of the live running algorithm</param>\n        /// <param name=\"startLine\">Start line of logs to read</param>\n        /// <param name=\"endLine\">End line of logs to read</param>\n        /// <returns><see cref=\"LiveLog\"/> List of strings that represent the logs of the algorithm</returns>\n        public LiveLog ReadLiveLogs(int projectId, string algorithmId, int startLine, int endLine)\n        {\n            var logLinesNumber = endLine - startLine;\n            if (logLinesNumber > 250)\n            {\n                throw new ArgumentException($\"The maximum number of log lines allowed is 250. But the number of log lines was {logLinesNumber}.\");\n            }\n\n            TryJsonPost(\"live/logs/read\",\n                out LiveLog result,\n                new\n                {\n                    format = \"json\",\n                    projectId,\n                    algorithmId,\n                    startLine,\n                    endLine,\n                });\n            return result;\n        }\n\n        /// <summary>\n        /// Returns a chart object from a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the request</param>\n        /// <param name=\"name\">The requested chart name</param>\n        /// <param name=\"start\">The Utc start seconds timestamp of the request</param>\n        /// <param name=\"end\">The Utc end seconds timestamp of the request</param>\n        /// <param name=\"count\">The number of data points to request</param>\n        /// <returns>The chart</returns>\n        public ReadChartResponse ReadLiveChart(int projectId, string name, int start, int end, uint count)\n        {\n            const string resource = \"live/chart/read\";\n            var payloadStr = JsonConvert.SerializeObject(new\n            {\n                projectId,\n                name,\n                start,\n                end,\n                count\n            });\n            TryJsonPost(resource, out ReadChartResponse result, payloadStr);\n\n            if (result.Chart == null)\n            {\n                var finish = DateTime.UtcNow.AddMinutes(1);\n                while (DateTime.UtcNow < finish && result.Chart == null)\n                {\n                    Thread.Sleep(5000);\n                    TryJsonPost(resource, out result, payloadStr);\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Read out the insights of a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the live algorithm</param>\n        /// <param name=\"start\">Starting index of the insights to be fetched</param>\n        /// <param name=\"end\">Last index of the insights to be fetched. Note that end - start must be less than 100</param>\n        /// <returns><see cref=\"InsightResponse\"/></returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        public InsightResponse ReadLiveInsights(int projectId, int start = 0, int end = 0)\n        {\n            var diff = end - start;\n            if (diff > 100)\n            {\n                throw new ArgumentException($\"The difference between the start and end index of the insights must be smaller than 100, but it was {diff}.\");\n            }\n            else if (end == 0)\n            {\n                end = start + 100;\n            }\n\n            TryJsonPost(\"live/insights/read\", out InsightResponse result, new { projectId, start, end });\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the link to the downloadable data.\n        /// </summary>\n        /// <param name=\"filePath\">File path representing the data requested</param>\n        /// <param name=\"organizationId\">Organization to download from</param>\n        /// <returns><see cref=\"DataLink\"/> to the downloadable data.</returns>\n        public DataLink ReadDataLink(string filePath, string organizationId)\n        {\n            if (filePath == null)\n            {\n                throw new ArgumentException(\"Api.ReadDataLink(): Filepath must not be null\");\n            }\n\n            // Prepare filePath for request\n            filePath = FormatPathForDataRequest(filePath);\n\n            TryJsonPost(\"data/read\",\n                out DataLink result,\n                new\n                {\n                    format = \"link\",\n                    filePath,\n                    organizationId\n                });\n            return result;\n        }\n\n        /// <summary>\n        /// Get valid data entries for a given filepath from data/list\n        /// </summary>\n        /// <returns></returns>\n        public DataList ReadDataDirectory(string filePath)\n        {\n            if (filePath == null)\n            {\n                throw new ArgumentException(\"Api.ReadDataDirectory(): Filepath must not be null\");\n            }\n\n            // Prepare filePath for request\n            filePath = FormatPathForDataRequest(filePath);\n\n            // Verify the filePath for this request is at least three directory deep\n            // (requirement of endpoint)\n            if (filePath.Count(x => x == '/') < 3)\n            {\n                throw new ArgumentException($\"Api.ReadDataDirectory(): Data directory requested must be at least\" +\n                    $\" three directories deep. FilePath: {filePath}\");\n            }\n\n            TryJsonPost(\"data/list\", out DataList result, new { filePath });\n            return result;\n        }\n\n        /// <summary>\n        /// Gets data prices from data/prices\n        /// </summary>\n        public DataPricesList ReadDataPrices(string organizationId)\n        {\n            TryJsonPost(\"data/prices\", out DataPricesList result, new { organizationId });\n            return result;\n        }\n\n        /// <summary>\n        /// Read out the report of a backtest in the project id specified.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to read</param>\n        /// <param name=\"backtestId\">Specific backtest id to read</param>\n        /// <returns><see cref=\"BacktestReport\"/></returns>\n        public BacktestReport ReadBacktestReport(int projectId, string backtestId)\n        {\n            var payloadStr = JsonConvert.SerializeObject(new { backtestId, projectId });\n            var report = new BacktestReport();\n            var finish = DateTime.UtcNow.AddMinutes(1);\n            while (DateTime.UtcNow < finish && !report.Success)\n            {\n                Thread.Sleep(10000);\n                using var request = ApiUtils.CreateJsonPostRequest(\"backtests/read/report\", payloadStr);\n                ApiConnection.TryRequest(request, out report);\n            }\n            return report;\n        }\n\n        /// <summary>\n        /// Method to purchase and download data from QuantConnect\n        /// </summary>\n        /// <param name=\"filePath\">File path representing the data requested</param>\n        /// <param name=\"organizationId\">Organization to buy the data with</param>\n        /// <returns>A <see cref=\"bool\"/> indicating whether the data was successfully downloaded or not.</returns>\n\n        public bool DownloadData(string filePath, string organizationId)\n        {\n            // Get a link to the data\n            var dataLink = ReadDataLink(filePath, organizationId);\n\n            // Make sure the link was successfully retrieved\n            if (!dataLink.Success)\n            {\n                Log.Trace($\"Api.DownloadData(): Failed to get link for {filePath}. \" +\n                    $\"Errors: {string.Join(',', dataLink.Errors)}\");\n                return false;\n            }\n\n            // Make sure the directory exist before writing\n            var directory = Path.GetDirectoryName(filePath);\n            if (!Directory.Exists(directory))\n            {\n                Directory.CreateDirectory(directory);\n            }\n\n            var client = BorrowClient();\n            try\n            {\n                // Download the file\n                var uri = new Uri(dataLink.Link);\n                using var dataStream = client.Value.GetStreamAsync(uri);\n\n                using var fileStream = new FileStream(FileExtension.ToNormalizedPath(filePath), FileMode.Create);\n                dataStream.Result.CopyTo(fileStream);\n            }\n            catch\n            {\n                Log.Error($\"Api.DownloadData(): Failed to download zip for path ({filePath})\");\n                return false;\n            }\n            finally\n            {\n                ReturnClient(client);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get the algorithm status from the user with this algorithm id.\n        /// </summary>\n        /// <param name=\"algorithmId\">String algorithm id we're searching for.</param>\n        /// <returns>Algorithm status enum</returns>\n\n        public virtual AlgorithmControl GetAlgorithmStatus(string algorithmId)\n        {\n            return new AlgorithmControl()\n            {\n                ChartSubscription = \"*\"\n            };\n        }\n\n        /// <summary>\n        /// Algorithm passes back its current status to the UX.\n        /// </summary>\n        /// <param name=\"status\">Status of the current algorithm</param>\n        /// <param name=\"algorithmId\">String algorithm id we're setting.</param>\n        /// <param name=\"message\">Message for the algorithm status event</param>\n        /// <returns>Algorithm status enum</returns>\n\n        public virtual void SetAlgorithmStatus(string algorithmId, AlgorithmStatus status, string message = \"\")\n        {\n            //\n        }\n\n        /// <summary>\n        /// Send the statistics to storage for performance tracking.\n        /// </summary>\n        /// <param name=\"algorithmId\">Identifier for algorithm</param>\n        /// <param name=\"unrealized\">Unrealized gainloss</param>\n        /// <param name=\"fees\">Total fees</param>\n        /// <param name=\"netProfit\">Net profi</param>\n        /// <param name=\"holdings\">Algorithm holdings</param>\n        /// <param name=\"equity\">Total equity</param>\n        /// <param name=\"netReturn\">Net return for the deployment</param>\n        /// <param name=\"volume\">Volume traded</param>\n        /// <param name=\"trades\">Total trades since inception</param>\n        /// <param name=\"sharpe\">Sharpe ratio since inception</param>\n\n        public virtual void SendStatistics(string algorithmId, decimal unrealized, decimal fees, decimal netProfit, decimal holdings, decimal equity, decimal netReturn, decimal volume, int trades, double sharpe)\n        {\n            //\n        }\n\n        /// <summary>\n        /// Local implementation for downloading data to algorithms\n        /// </summary>\n        /// <param name=\"address\">URL to download</param>\n        /// <param name=\"headers\">KVP headers</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns></returns>\n        public virtual string Download(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password)\n        {\n            return Encoding.UTF8.GetString(DownloadBytes(address, headers, userName, password));\n        }\n\n        /// <summary>\n        /// Local implementation for downloading data to algorithms\n        /// </summary>\n        /// <param name=\"address\">URL to download</param>\n        /// <param name=\"headers\">KVP headers</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns>A stream from which the data can be read</returns>\n        /// <remarks>Stream.Close() most be called to avoid running out of resources</remarks>\n        public virtual byte[] DownloadBytes(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password)\n        {\n            var client = BorrowClient();\n            try\n            {\n                client.Value.DefaultRequestHeaders.Clear();\n\n                // Add a user agent header in case the requested URI contains a query.\n                client.Value.DefaultRequestHeaders.TryAddWithoutValidation(\"user-agent\", \"QCAlgorithm.Download(): User Agent Header\");\n\n                if (headers != null)\n                {\n                    foreach (var header in headers)\n                    {\n                        client.Value.DefaultRequestHeaders.TryAddWithoutValidation(header.Key, header.Value);\n                    }\n                }\n\n                if (!userName.IsNullOrEmpty() || !password.IsNullOrEmpty())\n                {\n                    var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($\"{userName}:{password}\"));\n                    client.Value.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(\"Basic\", credentials);\n                }\n\n                return client.Value.GetByteArrayAsync(new Uri(address)).Result;\n            }\n            catch (Exception exception)\n            {\n                var message = $\"Api.DownloadBytes(): Failed to download data from {address}\";\n                if (!userName.IsNullOrEmpty() || !password.IsNullOrEmpty())\n                {\n                    message += $\" with username: {userName} and password: {(string.IsNullOrEmpty(password) ? \"\" : new string('*', password.Length))}\";\n                }\n\n                throw new WebException($\"{message}. Please verify the source for missing http:// or https://\", exception);\n            }\n            finally\n            {\n                client.Value.DefaultRequestHeaders.Clear();\n                ReturnClient(client);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public virtual void Dispose()\n        {\n            // Dispose of the HttpClient pool\n            _clientPool.CompleteAdding();\n            foreach (var client in _clientPool.GetConsumingEnumerable())\n            {\n                if (client.IsValueCreated)\n                {\n                    client.Value.DisposeSafely();\n                }\n            }\n            _clientPool.DisposeSafely();\n            ApiConnection?.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Generate a secure hash for the authorization headers.\n        /// </summary>\n        /// <returns>Time based hash of user token and timestamp.</returns>\n        public static string CreateSecureHash(int timestamp, string token)\n        {\n            // Create a new hash using current UTC timestamp.\n            // Hash must be generated fresh each time.\n            var data = $\"{token}:{timestamp.ToStringInvariant()}\";\n            return data.ToSHA256();\n        }\n\n        /// <summary>\n        /// Will read the organization account status\n        /// </summary>\n        /// <param name=\"organizationId\">The target organization id, if null will return default organization</param>\n        public Account ReadAccount(string organizationId = null)\n        {\n            TryJsonPost(\"account/read\", out Account account, organizationId != null ? new { organizationId } : null);\n            return account;\n        }\n\n        /// <summary>\n        /// Fetch organization data from web API\n        /// </summary>\n        /// <param name=\"organizationId\"></param>\n        /// <returns></returns>\n        public Organization ReadOrganization(string organizationId = null)\n        {\n            TryJsonPost(\"organizations/read\", out OrganizationResponse response, organizationId != null ? new { organizationId } : null);\n            return response.Organization;\n        }\n\n        /// <summary>\n        /// Estimate optimization with the specified parameters via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the project the optimization belongs to</param>\n        /// <param name=\"name\">Name of the optimization</param>\n        /// <param name=\"target\">Target of the optimization, see examples in <see cref=\"PortfolioStatistics\"/></param>\n        /// <param name=\"targetTo\">Target extremum of the optimization, for example \"max\" or \"min\"</param>\n        /// <param name=\"targetValue\">Optimization target value</param>\n        /// <param name=\"strategy\">Optimization strategy, <see cref=\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\"/></param>\n        /// <param name=\"compileId\">Optimization compile ID</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"constraints\">Optimization constraints</param>\n        /// <returns>Estimate object from the API.</returns>\n        public Estimate EstimateOptimization(\n            int projectId,\n            string name,\n            string target,\n            string targetTo,\n            decimal? targetValue,\n            string strategy,\n            string compileId,\n            HashSet<OptimizationParameter> parameters,\n            IReadOnlyList<Constraint> constraints)\n        {\n            TryJsonPost(\"optimizations/estimate\",\n                out EstimateResponseWrapper response,\n                new\n                {\n                    projectId,\n                    name,\n                    target,\n                    targetTo,\n                    targetValue,\n                    strategy,\n                    compileId,\n                    parameters,\n                    constraints\n                },\n                jsonSerializerSettings: SerializerSettings);\n            return response.Estimate;\n        }\n\n        /// <summary>\n        /// Create an optimization with the specified parameters via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the project the optimization belongs to</param>\n        /// <param name=\"name\">Name of the optimization</param>\n        /// <param name=\"target\">Target of the optimization, see examples in <see cref=\"PortfolioStatistics\"/></param>\n        /// <param name=\"targetTo\">Target extremum of the optimization, for example \"max\" or \"min\"</param>\n        /// <param name=\"targetValue\">Optimization target value</param>\n        /// <param name=\"strategy\">Optimization strategy, <see cref=\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\"/></param>\n        /// <param name=\"compileId\">Optimization compile ID</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"constraints\">Optimization constraints</param>\n        /// <param name=\"estimatedCost\">Estimated cost for optimization</param>\n        /// <param name=\"nodeType\">Optimization node type <see cref=\"OptimizationNodes\"/></param>\n        /// <param name=\"parallelNodes\">Number of parallel nodes for optimization</param>\n        /// <returns>BaseOptimization object from the API.</returns>\n        public OptimizationSummary CreateOptimization(\n            int projectId,\n            string name,\n            string target,\n            string targetTo,\n            decimal? targetValue,\n            string strategy,\n            string compileId,\n            HashSet<OptimizationParameter> parameters,\n            IReadOnlyList<Constraint> constraints,\n            decimal estimatedCost,\n            string nodeType,\n            int parallelNodes)\n        {\n            TryJsonPost(\"optimizations/create\",\n                out OptimizationList result,\n                new\n                {\n                    projectId,\n                    name,\n                    target,\n                    targetTo,\n                    targetValue,\n                    strategy,\n                    compileId,\n                    parameters,\n                    constraints,\n                    estimatedCost,\n                    nodeType,\n                    parallelNodes\n                },\n                jsonSerializerSettings: SerializerSettings);\n            return result.Optimizations.FirstOrDefault();\n        }\n\n        /// <summary>\n        /// List all the optimizations for a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id we'd like to get a list of optimizations for</param>\n        /// <returns>A list of BaseOptimization objects, <see cref=\"BaseOptimization\"/></returns>\n        public List<OptimizationSummary> ListOptimizations(int projectId)\n        {\n            TryJsonPost(\"optimizations/list\", out OptimizationList result, new { projectId });\n            return result.Optimizations;\n        }\n\n        /// <summary>\n        /// Read an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to read</param>\n        /// <returns><see cref=\"Optimization\"/></returns>\n        public Optimization ReadOptimization(string optimizationId)\n        {\n            TryJsonPost(\"optimizations/read\", out OptimizationResponseWrapper response, new { optimizationId });\n            return response.Optimization;\n        }\n\n        /// <summary>\n        /// Abort an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to abort</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse AbortOptimization(string optimizationId)\n        {\n            TryJsonPost(\"optimizations/abort\", out RestResponse result, new { optimizationId });\n            return result;\n        }\n\n        /// <summary>\n        /// Update an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id we want to update</param>\n        /// <param name=\"name\">Name we'd like to assign to the optimization</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse UpdateOptimization(string optimizationId, string name = null)\n        {\n            object paylaod = !string.IsNullOrEmpty(name)\n                ? new { optimizationId, name }\n                : new { optimizationId };\n            TryJsonPost(\"optimizations/update\", out RestResponse result, paylaod);\n            return result;\n        }\n\n        /// <summary>\n        /// Delete an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to delete</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse DeleteOptimization(string optimizationId)\n        {\n            TryJsonPost(\"optimizations/delete\", out RestResponse result, new { optimizationId });\n            return result;\n        }\n\n        /// <summary>\n        /// Download the object store files associated with the given organization ID and key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to get the Object Store files from</param>\n        /// <param name=\"keys\">Keys for the Object Store files</param>\n        /// <param name=\"destinationFolder\">Folder in which the object store files will be stored</param>\n        /// <returns>True if the object store files were retrieved correctly, false otherwise</returns>\n        public bool GetObjectStore(string organizationId, List<string> keys, string destinationFolder = null)\n        {\n            TryJsonPost(\"object/get\", out GetObjectStoreResponse result, new { organizationId, keys });\n\n            if (result == null || !result.Success)\n            {\n                Log.Error($\"Api.GetObjectStore(): Failed to get the jobId to request the download URL for the object store files.\"\n                    + (result != null ? $\" Errors: {string.Join(\",\", result.Errors)}\" : \"\"));\n                return false;\n            }\n\n            var jobId = result.JobId;\n            var getUrlPayloadStr = JsonConvert.SerializeObject(new\n            {\n                organizationId,\n                jobId\n            });\n\n            var frontier = DateTime.UtcNow + TimeSpan.FromMinutes(5);\n            while (string.IsNullOrEmpty(result?.Url) && (DateTime.UtcNow < frontier))\n            {\n                Thread.Sleep(3000);\n                TryJsonPost(\"object/get\", out result, getUrlPayloadStr);\n            }\n\n            if (result == null || string.IsNullOrEmpty(result.Url))\n            {\n                Log.Error($\"Api.GetObjectStore(): Failed to get the download URL from the jobId {jobId}.\"\n                    + (result != null ? $\" Errors: {string.Join(\",\", result.Errors)}\" : \"\"));\n                return false;\n            }\n\n            var directory = destinationFolder ?? Directory.GetCurrentDirectory();\n            var client = BorrowClient();\n\n            try\n            {\n                if (client.Value.Timeout != TimeSpan.FromMinutes(20))\n                {\n                    client.Value.Timeout = TimeSpan.FromMinutes(20);\n                }\n\n                // Download the file\n                var uri = new Uri(result.Url);\n                using var byteArray = client.Value.GetByteArrayAsync(uri);\n\n                Compression.UnzipToFolder(byteArray.Result, directory);\n            }\n            catch (Exception e)\n            {\n                Log.Error($\"Api.GetObjectStore(): Failed to download zip for path ({directory}). Error: {e.Message}\");\n                return false;\n            }\n            finally\n            {\n                ReturnClient(client);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get Object Store properties given the organization ID and the Object Store key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to get the Object Store from</param>\n        /// <param name=\"key\">Key for the Object Store file</param>\n        /// <returns><see cref=\"PropertiesObjectStoreResponse\"/></returns>\n        /// <remarks>It does not work when the object store is a directory</remarks>\n        public PropertiesObjectStoreResponse GetObjectStoreProperties(string organizationId, string key)\n        {\n            TryJsonPost(\"object/properties\", out PropertiesObjectStoreResponse result, new { organizationId, key });\n\n            if (result == null || !result.Success)\n            {\n                Log.Error($\"Api.ObjectStore(): Failed to get the properties for the object store key {key}.\" + (result != null ? $\" Errors: {string.Join(\",\", result.Errors)}\" : \"\"));\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Upload files to the Object Store\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to upload the file to</param>\n        /// <param name=\"key\">Key to the Object Store file</param>\n        /// <param name=\"objectData\">File (as an array of bytes) to be uploaded</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse SetObjectStore(string organizationId, string key, byte[] objectData)\n        {\n            // HttpRequestMessage will dispose of the content and MultipartFormDataContent will dispose of its children\n#pragma warning disable CA2000 // Dispose objects before losing scope\n            using var request = new HttpRequestMessage(HttpMethod.Post, \"object/set\")\n            {\n                Content = new MultipartFormDataContent()\n                {\n                    { new StringContent(organizationId), \"organizationId\" },\n                    { new StringContent(key), \"key\" },\n                    { new ByteArrayContent(objectData), \"objectData\", \"objectData\" }\n                }\n            };\n#pragma warning restore CA2000 // Dispose objects before losing scope\n            ApiConnection.TryRequest(request, out RestResponse result);\n            return result;\n        }\n\n        /// <summary>\n        /// Request to delete Object Store metadata of a specific organization and key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to delete the Object Store file from</param>\n        /// <param name=\"key\">Key to the Object Store file</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse DeleteObjectStore(string organizationId, string key)\n        {\n            TryJsonPost(\"object/delete\", out RestResponse result, new { organizationId, key });\n            return result;\n        }\n\n        /// <summary>\n        /// Request to list Object Store files of a specific organization and path\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to list the Object Store files from</param>\n        /// <param name=\"path\">Path to the Object Store files</param>\n        /// <returns><see cref=\"ListObjectStoreResponse\"/></returns>\n        public ListObjectStoreResponse ListObjectStore(string organizationId, string path)\n        {\n            TryJsonPost(\"object/list\", out ListObjectStoreResponse result, new { organizationId, path });\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method to normalize path for api data requests\n        /// </summary>\n        /// <param name=\"filePath\">Filepath to format</param>\n        /// <param name=\"dataFolder\">The data folder to use</param>\n        /// <returns>Normalized path</returns>\n        public static string FormatPathForDataRequest(string filePath, string dataFolder = null)\n        {\n            if (filePath == null)\n            {\n                Log.Error(\"Api.FormatPathForDataRequest(): Cannot format null string\");\n                return null;\n            }\n\n            dataFolder ??= Globals.DataFolder;\n            // Normalize windows paths to linux format\n            dataFolder = dataFolder.Replace(\"\\\\\", \"/\", StringComparison.InvariantCulture);\n            filePath = filePath.Replace(\"\\\\\", \"/\", StringComparison.InvariantCulture);\n\n            // First remove data root directory from path for request if included\n            if (filePath.StartsWith(dataFolder, StringComparison.InvariantCulture))\n            {\n                filePath = filePath.Substring(dataFolder.Length);\n            }\n\n            // Trim '/' from start, this can cause issues for _dataFolders without final directory separator in the config\n            filePath = filePath.TrimStart('/');\n            return filePath;\n        }\n\n        /// <summary>\n        /// Makes a simple POST request to the specified endpoint with the given payload\n        /// </summary>\n        protected bool TryPost<T>(string endpoint, out T result, IEnumerable<KeyValuePair<string, string>> payload = null,\n            ApiConnection apiConnection = null, TimeSpan? timeout = null)\n            where T : RestResponse\n        {\n            using var request = ApiUtils.CreatePostRequest(endpoint, payload);\n\n            return (apiConnection ?? ApiConnection).TryRequest(request, out result, timeout);\n        }\n\n        /// <summary>\n        /// Makes a simple POST request to the specified endpoint with the given payload\n        /// </summary>\n        protected bool TryJsonPost<T>(string endpoint, out T result, object payload = null,\n            ApiConnection apiConnection = null, JsonSerializerSettings jsonSerializerSettings = null, TimeSpan? timeout = null)\n            where T : RestResponse\n        {\n            using var request = ApiUtils.CreateJsonPostRequest(endpoint, payload, jsonSerializerSettings);\n\n            return (apiConnection ?? ApiConnection).TryRequest(request, out result, timeout);\n        }\n\n        /// <summary>\n        /// Create the api connection instance to use\n        /// </summary>\n        protected virtual ApiConnection CreateApiConnection(int userId, string token)\n        {\n            return new ApiConnection(userId, token);\n        }\n\n        /// <summary>\n        /// Helper method that will execute the given api request and throw an exception if it fails\n        /// </summary>\n        private T MakeRequestOrThrow<T>(HttpRequestMessage request, string callerName)\n            where T : RestResponse\n        {\n            if (!ApiConnection.TryRequest(request, out T result))\n            {\n                var errors = string.Empty;\n                if (result != null && result.Errors != null && result.Errors.Count > 0)\n                {\n                    errors = $\". Errors: ['{string.Join(\",\", result.Errors)}']\";\n                }\n                throw new WebException($\"{callerName} api request failed{errors}\");\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Borrows and HTTP client from the pool\n        /// </summary>\n        private Lazy<HttpClient> BorrowClient()\n        {\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(10));\n            return _clientPool.Take(cancellationTokenSource.Token);\n        }\n\n        /// <summary>\n        /// Returns the HTTP client to the pool\n        /// </summary>\n        private void ReturnClient(Lazy<HttpClient> client)\n        {\n            _clientPool.Add(client);\n        }\n    }\n}\n"
  },
  {
    "path": "Api/ApiConnection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing RestSharp;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Text;\nusing System.Collections.Generic;\nusing QuantConnect.Util;\nusing System.IO;\nusing System.Threading;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// API Connection and Hash Manager\n    /// </summary>\n    public class ApiConnection : IDisposable\n    {\n        /// <summary>\n        /// Authorized client to use for requests.\n        /// </summary>\n        private HttpClient _httpClient;\n\n        /// <summary>\n        /// Authorized client to use for requests.\n        /// </summary>\n        [Obsolete(\"RestSharp is deprecated and will be removed in a future release. Please use the SetClient method or the request methods that take an HttpRequestMessage\")]\n        public RestClient Client { get; set; }\n\n        // Authorization Credentials\n        private readonly string _userId;\n        private readonly string _token;\n\n        private LeanAuthenticator _authenticator;\n\n        /// <summary>\n        /// Create a new Api Connection Class.\n        /// </summary>\n        /// <param name=\"userId\">User Id number from QuantConnect.com account. Found at www.quantconnect.com/account </param>\n        /// <param name=\"token\">Access token for the QuantConnect account. Found at www.quantconnect.com/account </param>\n        public ApiConnection(int userId, string token)\n            : this(userId, token, null)\n        {\n        }\n\n        /// <summary>\n        /// Create a new Api Connection Class.\n        /// </summary>\n        /// <param name=\"userId\">User Id number from QuantConnect.com account. Found at www.quantconnect.com/account </param>\n        /// <param name=\"token\">Access token for the QuantConnect account. Found at www.quantconnect.com/account </param>\n        /// <param name=\"baseUrl\">The client's base address</param>\n        /// <param name=\"defaultHeaders\">Default headers for the client</param>\n        /// <param name=\"timeout\">The client timeout in seconds</param>\n        public ApiConnection(int userId, string token, string baseUrl = null, Dictionary<string, string> defaultHeaders = null, int timeout = 0)\n        {\n            _token = token;\n            _userId = userId.ToStringInvariant();\n            SetClient(!string.IsNullOrEmpty(baseUrl) ? baseUrl : Globals.Api, defaultHeaders, timeout);\n        }\n\n        /// <summary>\n        /// Return true if connected successfully.\n        /// </summary>\n        public bool Connected\n        {\n            get\n            {\n                using var request = new HttpRequestMessage(HttpMethod.Get, \"authenticate\");\n                return TryRequest(request, out AuthenticationResponse response) && response.Success;\n            }\n        }\n\n        /// <summary>\n        /// Overrides the current client\n        /// </summary>\n        /// <param name=\"baseUrl\">The client's base address</param>\n        /// <param name=\"defaultHeaders\">Default headers for the client</param>\n        /// <param name=\"timeout\">The client timeout in seconds</param>\n        public void SetClient(string baseUrl, Dictionary<string, string> defaultHeaders = null, int timeout = 0)\n        {\n            if (_httpClient != null)\n            {\n                _httpClient.DisposeSafely();\n            }\n\n            _httpClient = new HttpClient() { BaseAddress = new Uri($\"{baseUrl.TrimEnd('/')}/\") };\n            Client = new RestClient(baseUrl);\n\n            if (defaultHeaders != null)\n            {\n                foreach (var header in defaultHeaders)\n                {\n                    _httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);\n                }\n                Client.AddDefaultHeaders(defaultHeaders);\n            }\n\n            if (timeout > 0)\n            {\n                _httpClient.Timeout = TimeSpan.FromSeconds(timeout);\n                Client.Timeout = timeout * 1000;\n            }\n            else\n            {\n                _httpClient.Timeout = Timeout.InfiniteTimeSpan;\n            }\n        }\n\n        /// <summary>\n        /// Disposes of the HTTP client\n        /// </summary>\n        public void Dispose()\n        {\n            _httpClient.Dispose();\n        }\n\n        /// <summary>\n        /// Place a secure request and get back an object of type T.\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"request\"></param>\n        /// <param name=\"result\">Result object from the </param>\n        /// <returns>T typed object response</returns>\n        [Obsolete(\"RestSharp is deprecated and will be removed in a future release. Please use the TryRequest(HttpRequestMessage)\")]\n        public bool TryRequest<T>(RestRequest request, out T result)\n            where T : RestResponse\n        {\n            var resultTuple = TryRequestAsync<T>(request).SynchronouslyAwaitTaskResult();\n            result = resultTuple.Item2;\n            return resultTuple.Item1;\n        }\n\n        /// <summary>\n        /// Place a secure request and get back an object of type T.\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"request\"></param>\n        /// <param name=\"result\">Result object from the </param>\n        /// <param name=\"timeout\">Timeout for the request</param>\n        /// <returns>T typed object response</returns>\n        public bool TryRequest<T>(HttpRequestMessage request, out T result, TimeSpan? timeout = null)\n            where T : RestResponse\n        {\n            var resultTuple = TryRequestAsync<T>(request, timeout).SynchronouslyAwaitTaskResult();\n            result = resultTuple.Item2;\n            return resultTuple.Item1;\n        }\n\n        /// <summary>\n        /// Place a secure request and get back an object of type T.\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"request\"></param>\n        /// <returns>T typed object response</returns>\n        [Obsolete(\"RestSharp is deprecated and will be removed in a future release. Please use the TryRequestAsync(HttpRequestMessage)\")]\n        public async Task<Tuple<bool, T>> TryRequestAsync<T>(RestRequest request)\n            where T : RestResponse\n        {\n            var responseContent = string.Empty;\n            T result;\n            try\n            {\n                SetAuthenticator(request);\n\n                // Execute the authenticated REST API Call\n                var restsharpResponse = await Client.ExecuteAsync(request).ConfigureAwait(false);\n\n                //Verify success\n                if (restsharpResponse.ErrorException != null)\n                {\n                    Log.Error($\"ApiConnection.TryRequest({request.Resource}): Error: {restsharpResponse.ErrorException.Message}\");\n                    return new Tuple<bool, T>(false, null);\n                }\n\n                if (!restsharpResponse.IsSuccessful)\n                {\n                    Log.Error($\"ApiConnect.TryRequest({request.Resource}): Content: {restsharpResponse.Content}\");\n                }\n\n                responseContent = restsharpResponse.Content;\n                result = responseContent.DeserializeJson<T>();\n\n                if (result == null || !result.Success)\n                {\n                    Log.Debug($\"ApiConnection.TryRequest({request.Resource}): Raw response: '{responseContent}'\");\n                    return new Tuple<bool, T>(false, result);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error($\"ApiConnection.TryRequest({request.Resource}): Error: {err.Message}, Response content: {responseContent}\");\n                return new Tuple<bool, T>(false, null);\n            }\n\n            return new Tuple<bool, T>(true, result);\n        }\n\n        /// <summary>\n        /// Place a secure request and get back an object of type T.\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"request\"></param>\n        /// <param name=\"timeout\">Timeout for the request</param>\n        /// <returns>T typed object response</returns>\n        public async Task<Tuple<bool, T>> TryRequestAsync<T>(HttpRequestMessage request, TimeSpan? timeout = null)\n            where T : RestResponse\n        {\n            HttpResponseMessage response = null;\n            Stream responseContentStream = null;\n            T result = null;\n\n            // Default to 100 seconds (since we disabled the default client timeout)\n            timeout ??= TimeSpan.FromSeconds(100);\n\n            try\n            {\n                if (request.RequestUri.OriginalString.StartsWith('/'))\n                {\n                    request.RequestUri = new Uri(request.RequestUri.ToString().TrimStart('/'), UriKind.Relative);\n                }\n\n                SetAuthenticator(request);\n\n                // Execute the authenticated REST API Call\n                using var cancellationTokenSource = new CancellationTokenSource(timeout.Value);\n                response = await _httpClient.SendAsync(request, cancellationTokenSource.Token).ConfigureAwait(false);\n                responseContentStream = await response.Content.ReadAsStreamAsync(cancellationTokenSource.Token).ConfigureAwait(false);\n\n                result = responseContentStream.DeserializeJson<T>(leaveOpen: true);\n\n                if (!response.IsSuccessStatusCode)\n                {\n                    Log.Error($\"ApiConnect.TryRequest({request.RequestUri}): HTTP Error: {(int)response.StatusCode} {response.ReasonPhrase}. \" +\n                        $\"Content: {GetRawResponseContent(responseContentStream)}\");\n                }\n                if (result == null || !result.Success)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"ApiConnection.TryRequest({request.RequestUri}): Raw response: '{GetRawResponseContent(responseContentStream)}'\");\n                    }\n                    return new Tuple<bool, T>(false, result);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error($\"ApiConnection.TryRequest({request.RequestUri}): Error: {err.Message}, Response content: {GetRawResponseContent(responseContentStream)}\");\n                return new Tuple<bool, T>(false, null);\n            }\n            finally\n            {\n                response?.DisposeSafely();\n                responseContentStream?.DisposeSafely();\n            }\n\n            return new Tuple<bool, T>(true, result);\n        }\n\n        private static string GetRawResponseContent(Stream stream)\n        {\n            if (stream == null)\n            {\n                return string.Empty;\n            }\n\n            try\n            {\n                stream.Position = 0;\n                using var reader = new StreamReader(stream, leaveOpen: true);\n                return reader.ReadToEnd();\n            }\n            catch (Exception)\n            {\n                return string.Empty;\n            }\n        }\n\n        private void SetAuthenticator(RestRequest request)\n        {\n            var base64EncodedAuthenticationString = GetAuthenticatorHeader(out var timeStamp);\n            request.AddOrUpdateHeader(\"Authorization\", $\"Basic {base64EncodedAuthenticationString}\");\n            request.AddOrUpdateHeader(\"Timestamp\", timeStamp);\n        }\n\n        private void SetAuthenticator(HttpRequestMessage request)\n        {\n            request.Headers.Remove(\"Authorization\");\n            request.Headers.Remove(\"Timestamp\");\n\n            var base64EncodedAuthenticationString = GetAuthenticatorHeader(out var timeStamp);\n            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(\"Basic\", base64EncodedAuthenticationString);\n            request.Headers.Add(\"Timestamp\", timeStamp);\n        }\n\n        private string GetAuthenticatorHeader(out string timeStamp)\n        {\n            var newTimeStamp = (int)Time.TimeStamp();\n            var currentAuth = _authenticator;\n            if (currentAuth == null || newTimeStamp - currentAuth.TimeStamp > 7000)\n            {\n                // Generate the hash each request\n                // Add the UTC timestamp to the request header.\n                // Timestamps older than 7200 seconds will not work.\n                var hash = Api.CreateSecureHash(newTimeStamp, _token);\n                var authenticationString = $\"{_userId}:{hash}\";\n                var base64EncodedAuthenticationString = Convert.ToBase64String(Encoding.UTF8.GetBytes(authenticationString));\n                _authenticator = currentAuth = new LeanAuthenticator(newTimeStamp, base64EncodedAuthenticationString);\n            }\n\n            timeStamp = currentAuth.TimeStampStr;\n            return currentAuth.Base64EncodedAuthenticationString;\n        }\n\n        private class LeanAuthenticator\n        {\n            public int TimeStamp { get; }\n            public string TimeStampStr { get; }\n            public string Base64EncodedAuthenticationString { get; }\n            public LeanAuthenticator(int timeStamp, string base64EncodedAuthenticationString)\n            {\n                TimeStamp = timeStamp;\n                TimeStampStr = timeStamp.ToStringInvariant();\n                Base64EncodedAuthenticationString = base64EncodedAuthenticationString;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Api/ApiUtils.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Net.Http;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing System.Net.Http.Headers;\nusing System.Net.Mime;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// API utility methods\n    /// </summary>\n    public static class ApiUtils\n    {\n        /// <summary>\n        /// Creates a POST <see cref=\"HttpRequestMessage\"/> with the specified endpoint and payload as form url encoded content.\n        /// </summary>\n        /// <param name=\"endpoint\">The request endpoint</param>\n        /// <param name=\"payload\">The request payload</param>\n        /// <returns>The POST request</returns>\n        public static HttpRequestMessage CreatePostRequest(string endpoint, IEnumerable<KeyValuePair<string, string>> payload = null)\n        {\n            var request = new HttpRequestMessage(HttpMethod.Post, endpoint);\n            if (payload != null)\n            {\n                request.Content = new FormUrlEncodedContent(payload);\n            }\n\n            return request;\n        }\n\n        /// <summary>\n        /// Creates a POST <see cref=\"HttpRequestMessage\"/> with the specified endpoint and payload as json body\n        /// </summary>\n        /// <param name=\"endpoint\">The request endpoint</param>\n        /// <param name=\"payload\">The request payload</param>\n        /// <param name=\"jsonSerializerSettings\">Settings for the json serializer</param>\n        /// <returns>The POST request</returns>\n        public static HttpRequestMessage CreateJsonPostRequest(string endpoint, object payload = null, JsonSerializerSettings jsonSerializerSettings = null)\n        {\n            var request = new HttpRequestMessage(HttpMethod.Post, endpoint);\n            if (payload != null)\n            {\n                request.Content = new StringContent(payload as string ?? JsonConvert.SerializeObject(payload, jsonSerializerSettings),\n                    new MediaTypeHeaderValue(MediaTypeNames.Application.Json));\n            }\n\n            return request;\n        }\n    }\n}\n"
  },
  {
    "path": "Api/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Api\")]\n[assembly: AssemblyProduct(\"QuantConnect.Api\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"ce3487da-3d41-47fa-b229-0726c57931f9\")]"
  },
  {
    "path": "Api/QuantConnect.Api.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Api</RootNamespace>\n    <AssemblyName>QuantConnect.Api</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <RestorePackages>true</RestorePackages>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Api.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: API Project - C# SDK for interaction with the QuantConnect.com</Description>\n    <NoWarn>CA1062</NoWarn>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n    <PackageReference Include=\"RestSharp\" Version=\"106.12.0\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Brokerages/Authentication/AccessTokenMetaDataRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Represents the base request for obtaining an access token, including brokerage and account information.\n    /// </summary>\n    public abstract class AccessTokenMetaDataRequest\n    {\n        /// <summary>\n        /// Gets the name of the brokerage associated with the access token request.\n        /// The value is normalized to lowercase.\n        /// </summary>\n        public string Brokerage { get; }\n\n        /// <summary>\n        /// Gets the account identifier (e.g., account number) associated with the brokerage.\n        /// </summary>\n        public string AccountId { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccessTokenMetaDataRequest\"/> class.\n        /// </summary>\n        /// <param name=\"brokerage\">The name of the brokerage making the request. Will be normalized to lowercase.</param>\n        /// <param name=\"accountId\">The account number or identifier associated with the brokerage.</param>\n        protected AccessTokenMetaDataRequest(string brokerage, string accountId)\n        {\n#pragma warning disable CA1308 // Normalize strings to uppercase\n            Brokerage = brokerage.ToLowerInvariant();\n#pragma warning restore CA1308 // Normalize strings to uppercase\n            AccountId = accountId;\n        }\n\n        /// <summary>\n        /// Serializes the request into a compact JSON string with camelCase property naming.\n        /// </summary>\n        /// <returns>A JSON string representing the current request.</returns>\n        public string ToJson()\n        {\n            return JsonConvert.SerializeObject(this, new JsonSerializerSettings()\n            {\n                ContractResolver = new CamelCasePropertyNamesContractResolver(),\n                Formatting = Formatting.None\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/AccessTokenMetaDataResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Represents a response containing metadata about an access token issued by Lean.\n    /// </summary>\n    public abstract class AccessTokenMetaDataResponse : RestResponse\n    {\n        /// <summary>\n        /// Gets the access token provided by Lean.\n        /// </summary>\n        public string AccessToken { get; }\n\n        /// <summary>\n        /// Gets the type of the token (e.g., \"Bearer\").\n        /// </summary>\n        public TokenType TokenType { get; }\n\n        /// <summary>\n        /// Gets the UTC expiration timestamp of the access token, with a 1-minute safety buffer applied.\n        /// </summary>\n        public DateTime Expiration { get; protected set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccessTokenMetaDataResponse\"/> class.\n        /// </summary>\n        /// <param name=\"accessToken\">The access token string provided by the authentication service.</param>\n        /// <param name=\"tokenType\">The type of the token (e.g., Bearer).</param>\n        /// <param name=\"expires\">The expiration time of the access token (in UTC), with safety buffer applied.</param>\n        protected AccessTokenMetaDataResponse(string accessToken, TokenType tokenType, DateTime expires)\n        {\n            AccessToken = accessToken;\n            TokenType = tokenType;\n            Expiration = expires;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/LeanOAuthTokenHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Api;\nusing System.Threading;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Handles OAuth token retrieval and caching by interacting with the Lean platform.\n    /// Implements retry and expiration logic for secure HTTP communication.\n    /// </summary>\n    public class LeanOAuthTokenHandler : LeanOAuthTokenHandler<LeanTokenCredentials>\n    {\n        public LeanOAuthTokenHandler(ApiConnection apiClient, OAuthTokenRequest request, TimeSpan tokenLifetime)\n            : base(apiClient, request, tokenLifetime)\n        {\n        }\n    }\n\n    /// <summary>\n    /// Handles OAuth token retrieval and caching by interacting with the Lean platform.\n    /// Implements retry and expiration logic for secure HTTP communication.\n    /// </summary>\n    public class LeanOAuthTokenHandler<T> : LeanTokenHandler<T>\n        where T : LeanTokenCredentials\n    {\n        /// <summary>\n        /// The maximum number of retry attempts when fetching an access token.\n        /// </summary>\n        protected virtual int MaxRetryCount { get; set; } = 3;\n\n        /// <summary>\n        /// The time interval to wait between retry attempts when fetching an access token.\n        /// </summary>\n        protected virtual TimeSpan RetryInterval { get; set; } = TimeSpan.FromSeconds(5);\n\n        /// <summary>\n        /// Lock object used to synchronize token refresh across threads.\n        /// </summary>\n        private readonly Lock _lock = new();\n\n        /// <summary>\n        /// The serialized JSON body representing the token request model.\n        /// </summary>\n        private readonly string _jsonBodyRequest;\n\n        /// <summary>\n        /// The total lifetime of a fetched token, used to compute the expiry timestamp.\n        /// A 1-minute safety buffer is subtracted before the token is considered expired.\n        /// </summary>\n        private readonly TimeSpan _tokenLifetime;\n\n        /// <summary>\n        /// API client for communicating with the Lean platform.\n        /// </summary>\n        private readonly ApiConnection _apiClient;\n\n        /// <summary>\n        /// Stores the current access token and its type used for authenticating requests to the Lean platform.\n        /// Written inside <see cref=\"_lock\"/>; read outside the lock via volatile fast path.\n        /// </summary>\n        private T _tokenCredentials;\n\n        /// <summary>\n        /// The UTC timestamp after which the cached token should be refreshed.\n        /// Always written inside <see cref=\"_lock\"/> before <see cref=\"_tokenCredentials\"/> is set,\n        /// so that a volatile read of <see cref=\"_tokenCredentials\"/> guarantees visibility of this field.\n        /// </summary>\n        private DateTime _tokenExpiresAt;\n\n        /// <summary>\n        /// Some padding before expiration to request a new token\n        /// </summary>\n        public TimeSpan OffsetBeforeExpiration { get; set; } = TimeSpan.FromMinutes(2);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanOAuthTokenHandler\"/> class.\n        /// </summary>\n        /// <param name=\"apiClient\">The API client used to communicate with the Lean platform.</param>\n        /// <param name=\"request\">The request model used to generate the access token.</param>\n        /// <param name=\"tokenLifetime\">\n        /// The expected lifetime of a fetched token. A 1-minute safety buffer is applied before expiry.\n        /// Must be provided explicitly — each brokerage has a different token lifetime.\n        /// </param>\n        public LeanOAuthTokenHandler(ApiConnection apiClient, OAuthTokenRequest request, TimeSpan tokenLifetime)\n        {\n            _apiClient = apiClient;\n            _jsonBodyRequest = request.ToJson();\n            _tokenLifetime = tokenLifetime;\n        }\n\n        /// <summary>\n        /// Retrieves a valid access token from the Lean platform.\n        /// Caches and reuses tokens until expiration to minimize unnecessary requests.\n        /// Retries up to <see cref=\"MaxRetryCount\"/> times on failure, and is thread-safe via double-checked locking.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A token used to observe cancellation requests.</param>\n        /// <returns>A <see cref=\"TokenCredentials\"/> containing the token type and access token string.</returns>\n        public override T GetAccessToken(CancellationToken cancellationToken)\n        {\n            // Fast path: return cached token without acquiring the lock\n            if (_tokenCredentials != null && DateTime.UtcNow < _tokenExpiresAt)\n            {\n                return _tokenCredentials;\n            }\n\n            lock (_lock)\n            {\n                // Second check: another thread may have refreshed while we waited for the lock\n                if (_tokenCredentials != null && DateTime.UtcNow < _tokenExpiresAt)\n                {\n                    return _tokenCredentials;\n                }\n\n                for (var retryCount = 0; retryCount <= MaxRetryCount; retryCount++)\n                {\n                    try\n                    {\n                        using var request = ApiUtils.CreateJsonPostRequest(\"live/auth0/refresh\", _jsonBodyRequest);\n\n                        if (_apiClient.TryRequest<T>(request, out var response))\n                        {\n                            if (response.Success)\n                            {\n                                // Write expiry before credentials — the volatile write of _tokenCredentials\n                                // acts as a release fence, ensuring the fast-path reader sees _tokenExpiresAt.\n                                _tokenExpiresAt = DateTime.UtcNow + _tokenLifetime - OffsetBeforeExpiration;\n                                return _tokenCredentials = response;\n                            }\n                        }\n\n                        Logging.Log.Error($\"LeanOAuthTokenHandler.{nameof(GetAccessToken)}: Failed to retrieve access token. Response: {response}. Last known expiry: {_tokenExpiresAt.ToStringInvariant()}.\");\n                        throw new InvalidOperationException($\"Authentication failed. \" +\n                            $\"Details: {(response?.Errors?.Count > 0 ? string.Join(\",\", response.Errors) : \"empty\")}\");\n                    }\n                    catch when (retryCount < MaxRetryCount)\n                    {\n                        if (cancellationToken.WaitHandle.WaitOne(RetryInterval))\n                        {\n                            throw new OperationCanceledException(\n                                $\"LeanOAuthTokenHandler.{nameof(GetAccessToken)}: Token fetch canceled during wait.\",\n                                cancellationToken);\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        OnAuthenticationFailed(ex);\n                        throw;\n                    }\n                }\n\n                // Unreachable — the loop always returns or throws\n                throw new InvalidOperationException($\"LeanOAuthTokenHandler.{nameof(GetAccessToken)}: Unexpected state in token retry loop.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/LeanTokenCredentials.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Represents credentials required for token-based authentication,\n    /// including the access token and its type (e.g., Bearer).\n    /// </summary>\n    public class LeanTokenCredentials : RestResponse\n    {\n        /// <summary>\n        /// Gets the type of the token (e.g., Bearer).\n        /// </summary>\n        public TokenType TokenType { get; set; }\n\n        /// <summary>\n        /// Gets the token string used for authentication.\n        /// </summary>\n        public string AccessToken { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanTokenCredentials\"/> class.\n        /// </summary>\n        /// <param name=\"tokenType\">The type of the token.</param>\n        /// <param name=\"accessToken\">The token string.</param>\n        public LeanTokenCredentials(TokenType tokenType, string accessToken)\n        {\n            TokenType = tokenType;\n            AccessToken = accessToken;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanTokenCredentials\"/> class.\n        /// </summary>\n        public LeanTokenCredentials()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/LeanTokenHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Net.Http.Headers;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Provides base functionality for token-based HTTP request handling.\n    /// Token acquisition and retry logic are delegated entirely to <see cref=\"GetAccessToken\"/>,\n    /// implemented by derived classes (e.g., <see cref=\"LeanOAuthTokenHandler\"/>).\n    /// </summary>\n    public abstract class LeanTokenHandler<T> : DelegatingHandler\n        where T : LeanTokenCredentials\n    {\n        /// <summary>\n        /// Raised when authentication fails after all retry attempts are exhausted.\n        /// Subscribers can use this to trigger graceful application shutdown.\n        /// </summary>\n        public event EventHandler<Exception> AuthenticationFailed;\n\n        /// <summary>\n        /// A delegate used to construct an <see cref=\"AuthenticationHeaderValue\"/> from a token type and access token string.\n        /// </summary>\n        private readonly Func<TokenType, string, AuthenticationHeaderValue> _createAuthHeader;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanTokenHandler\"/> class.\n        /// </summary>\n        /// <param name=\"createAuthHeader\">\n        /// An optional delegate for creating an <see cref=\"AuthenticationHeaderValue\"/>\n        /// from the token type and access token. If not provided, a default implementation is used.\n        /// </param>\n        protected LeanTokenHandler(Func<TokenType, string, AuthenticationHeaderValue> createAuthHeader = null, HttpClientHandler handler = null)\n            : base(handler ?? new HttpClientHandler())\n        {\n            _createAuthHeader = createAuthHeader ?? ((tokenType, accessToken) => new AuthenticationHeaderValue(tokenType.ToString(), accessToken));\n        }\n\n        /// <summary>\n        /// Retrieves a valid access token for authenticating HTTP requests.\n        /// Must be implemented by derived classes to provide token type and value,\n        /// with optional support for caching and refresh logic.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A cancellation token that can be used to cancel the token retrieval operation.</param>\n        /// <returns>\n        /// A <see cref=\"TokenCredentials\"/> instance containing the token type and access token string.\n        /// </returns>\n        public abstract T GetAccessToken(CancellationToken cancellationToken);\n\n        /// <summary>\n        /// Invokes the <see cref=\"AuthenticationFailed\"/> event.\n        /// Derived classes call this when authentication fails after exhausting all retry attempts.\n        /// </summary>\n        /// <param name=\"exception\">The exception that caused the authentication failure.</param>\n        protected void OnAuthenticationFailed(Exception exception)\n        {\n            AuthenticationFailed?.Invoke(this, exception);\n        }\n\n        /// <summary>\n        /// Sends an HTTP request asynchronously by internally invoking the synchronous <see cref=\"Send(HttpRequestMessage, CancellationToken)\"/> method.\n        /// This is useful for compatibility with components that require an asynchronous pipeline, even though the core logic is synchronous.\n        /// </summary>\n        /// <param name=\"request\">The HTTP request message to send.</param>\n        /// <param name=\"cancellationToken\">A cancellation token to cancel the operation.</param>\n        /// <returns>\n        /// A task representing the asynchronous operation, containing the HTTP response message.\n        /// </returns>\n        protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n        {\n            return Task.FromResult(Send(request, cancellationToken));\n        }\n\n        /// <summary>\n        /// Sends an HTTP request synchronously, applying token-based authentication.\n        /// </summary>\n        /// <param name=\"request\">The HTTP request message to send.</param>\n        /// <param name=\"cancellationToken\">A cancellation token to cancel operation.</param>\n        /// <returns>The HTTP response message.</returns>\n        protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)\n        {\n            var accessToken = GetAccessToken(cancellationToken);\n            request.Headers.Authorization = _createAuthHeader(accessToken.TokenType, accessToken.AccessToken);\n            return base.Send(request, cancellationToken);\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/OAuthTokenHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Api;\nusing System.Threading;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Handles OAuth token retrieval and caching by interacting with the Lean platform.\n    /// Implements retry and expiration logic for secure HTTP communication.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">The request type used to acquire the access token.</typeparam>\n    /// <typeparam name=\"TResponse\">The response type containing access token metadata.</typeparam>\n    public sealed class OAuthTokenHandler<TRequest, TResponse> : TokenHandler\n        where TRequest : AccessTokenMetaDataRequest\n        where TResponse : AccessTokenMetaDataResponse\n    {\n        /// <summary>\n        /// The serialized JSON body representing the token request model.\n        /// </summary>\n        private readonly string _jsonBodyRequest;\n\n        /// <summary>\n        /// Stores metadata about the Lean access token and its expiration details.\n        /// </summary>\n        private TResponse _accessTokenMetaData;\n\n        /// <summary>\n        /// API client for communicating with the Lean platform.\n        /// </summary>\n        private readonly ApiConnection _apiClient;\n\n        /// <summary>\n        /// Stores the current access token and its type used for authenticating requests to the Lean platform.\n        /// </summary>\n        private TokenCredentials _tokenCredentials;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OAuthTokenHandler{TRequest, TResponse}\"/> class.\n        /// </summary>\n        /// <param name=\"apiClient\">The API client used to communicate with the Lean platform.</param>\n        /// <param name=\"modelRequest\">The request model used to generate the access token.</param>\n        public OAuthTokenHandler(ApiConnection apiClient, TRequest modelRequest)\n        {\n            _apiClient = apiClient;\n            _jsonBodyRequest = modelRequest.ToJson();\n        }\n\n        /// <summary>\n        /// Retrieves a valid access token from the Lean platform.\n        /// Caches and reuses tokens until expiration to minimize unnecessary requests.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A token used to observe cancellation requests.</param>\n        /// <returns>A tuple containing the token type and access token string.</returns>\n        public override TokenCredentials GetAccessToken(CancellationToken cancellationToken)\n        {\n            if (_accessTokenMetaData != null && DateTime.UtcNow < _accessTokenMetaData.Expiration)\n            {\n                return _tokenCredentials;\n            }\n\n            try\n            {\n                using var request = ApiUtils.CreateJsonPostRequest(\"live/auth0/refresh\", _jsonBodyRequest);\n\n                if (_apiClient.TryRequest<TResponse>(request, out var response))\n                {\n                    if (response.Success && !string.IsNullOrEmpty(response.AccessToken))\n                    {\n                        _accessTokenMetaData = response;\n                        _tokenCredentials = new(response.TokenType, response.AccessToken);\n                        return _tokenCredentials;\n                    }\n                }\n\n                Logging.Log.Error($\"{nameof(OAuthTokenHandler<TRequest, TResponse>)}.{nameof(GetAccessToken)}: Failed to retrieve access token. Response: {response}. Last known expiration: {_accessTokenMetaData?.Expiration.ToStringInvariant() ?? \"Not requested yet\"}.\");\n                throw new InvalidOperationException($\"Authentication failed. \" +\n                    $\"Details: {(response?.Errors?.Count > 0 ? string.Join(\",\", response.Errors) : \"empty\")}\");\n            }\n            catch (Exception ex)\n            {\n                throw new InvalidOperationException($\"{nameof(OAuthTokenHandler<TRequest, TResponse>)}.{nameof(GetAccessToken)}: {ex.Message}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/OAuthTokenRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Represents a Lean platform token request, including all fields required by the\n    /// <c>live/auth0/refresh</c> endpoint. Optional fields are omitted from JSON when null.\n    /// </summary>\n    public class OAuthTokenRequest\n    {\n        /// <summary>\n        /// Gets the name of the brokerage associated with the access token request.\n        /// The value is normalized to lowercase.\n        /// </summary>\n        public string Brokerage { get; set; }\n\n        /// <summary>\n        /// Gets the account identifier associated with the brokerage.\n        /// </summary>\n        public string AccountId { get; set; }\n\n        /// <summary>\n        /// Gets the OAuth refresh token used to obtain a new access token.\n        /// Omitted from JSON when null.\n        /// </summary>\n        public string RefreshToken { get; set; }\n\n        /// <summary>\n        /// Gets the Lean deploy identifier for brokerages that require it.\n        /// Omitted from JSON when null.\n        /// </summary>\n        public string DeployId { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"OAuthTokenRequest\"/> with all fields.\n        /// Use named parameters to supply only the fields required by the target brokerage.\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage name. Normalized to lowercase.</param>\n        /// <param name=\"accountId\">The account number or identifier.</param>\n        /// <param name=\"refreshToken\">OAuth refresh token; omitted from JSON when null.</param>\n        /// <param name=\"deployId\">Lean deploy identifier; omitted from JSON when null.</param>\n        public OAuthTokenRequest(\n            string brokerage,\n            string accountId,\n            string refreshToken = null,\n            string deployId = null)\n        {\n#pragma warning disable CA1308 // Normalize strings to uppercase\n            Brokerage = brokerage.ToLowerInvariant();\n#pragma warning restore CA1308 // Normalize strings to uppercase\n            AccountId = accountId;\n            RefreshToken = refreshToken;\n            DeployId = deployId;\n        }\n\n        /// <summary>\n        /// Serializes the request into a compact camelCase JSON string.\n        /// Null properties are excluded from the output.\n        /// </summary>\n        /// <returns>A JSON string representing the current request.</returns>\n        public string ToJson()\n        {\n            return JsonConvert.SerializeObject(this, new JsonSerializerSettings()\n            {\n                ContractResolver = new CamelCasePropertyNamesContractResolver(),\n                NullValueHandling = NullValueHandling.Ignore,\n                Formatting = Formatting.None\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/TokenCredentials.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Represents credentials required for token-based authentication,\n    /// including the access token and its type (e.g., Bearer).\n    /// </summary>\n    public class TokenCredentials\n    {\n        /// <summary>\n        /// Gets the type of the token (e.g., Bearer).\n        /// </summary>\n        public TokenType TokenType { get; }\n\n        /// <summary>\n        /// Gets the token string used for authentication.\n        /// </summary>\n        public string AccessToken { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TokenCredentials\"/> class.\n        /// </summary>\n        /// <param name=\"tokenType\">The type of the token.</param>\n        /// <param name=\"accessToken\">The token string.</param>\n        public TokenCredentials(TokenType tokenType, string accessToken)\n        {\n            TokenType = tokenType;\n            AccessToken = accessToken;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/TokenHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Net;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Net.Http.Headers;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Provides base functionality for token-based HTTP request handling, \n    /// including automatic retries and token refresh on unauthorized responses.\n    /// </summary>\n    public abstract class TokenHandler : DelegatingHandler\n    {\n        /// <summary>\n        /// The maximum number of retry attempts for an authenticated request.\n        /// </summary>\n        private readonly int _maxRetryCount = 3;\n\n        /// <summary>\n        /// The time interval to wait between retry attempts for an authenticated request.\n        /// </summary>\n        private readonly TimeSpan _retryInterval;\n\n        /// <summary>\n        /// A delegate used to construct an <see cref=\"AuthenticationHeaderValue\"/> from a token type and access token string.\n        /// </summary>\n        private readonly Func<TokenType, string, AuthenticationHeaderValue> _createAuthHeader;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TokenHandler\"/> class.\n        /// </summary>\n        /// <param name=\"createAuthHeader\">\n        /// An optional delegate for creating an <see cref=\"AuthenticationHeaderValue\"/> \n        /// from the token type and access token. If not provided, a default implementation is used.\n        /// </param>\n        /// <param name=\"retryInterval\">\n        /// An optional time interval to wait between retry attempts when fetching the token or retrying a failed request.\n        /// If <c>null</c>, the default interval of 5 seconds is used.\n        /// </param>\n        protected TokenHandler(Func<TokenType, string, AuthenticationHeaderValue> createAuthHeader = null, TimeSpan? retryInterval = null)\n            : base(new HttpClientHandler())\n        {\n            _createAuthHeader = createAuthHeader ?? ((tokenType, accessToken) => new AuthenticationHeaderValue(tokenType.ToString(), accessToken));\n            _retryInterval = retryInterval ?? TimeSpan.FromSeconds(5);\n        }\n\n        /// <summary>\n        /// Retrieves a valid access token for authenticating HTTP requests.\n        /// Must be implemented by derived classes to provide token type and value,\n        /// with optional support for caching and refresh logic.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A cancellation token that can be used to cancel the token retrieval operation.</param>\n        /// <returns>\n        /// A <see cref=\"TokenCredentials\"/> instance containing the token type and access token string.\n        /// </returns>\n        public abstract TokenCredentials GetAccessToken(CancellationToken cancellationToken);\n\n        /// <summary>\n        /// Sends an HTTP request asynchronously by internally invoking the synchronous <see cref=\"Send(HttpRequestMessage, CancellationToken)\"/> method.\n        /// This is useful for compatibility with components that require an asynchronous pipeline, even though the core logic is synchronous.\n        /// </summary>\n        /// <param name=\"request\">The HTTP request message to send.</param>\n        /// <param name=\"cancellationToken\">A cancellation token to cancel the operation.</param>\n        /// <returns>\n        /// A task representing the asynchronous operation, containing the HTTP response message.\n        /// </returns>\n        protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n        {\n            return Task.FromResult(Send(request, cancellationToken));\n        }\n\n        /// <summary>\n        /// Sends an HTTP request synchronously with retry support.\n        /// This override includes token-based authentication and refresh logic on 401 Unauthorized responses.\n        /// </summary>\n        /// <param name=\"request\">The HTTP request message to send.</param>\n        /// <param name=\"cancellationToken\">A cancellation token to cancel operation.</param>\n        /// <returns>The HTTP response message.</returns>\n        protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)\n        {\n            HttpResponseMessage response = default;\n\n            for (var retryCount = 0; retryCount <= _maxRetryCount; retryCount++)\n            {\n                var accessToken = default(TokenCredentials);\n\n                try\n                {\n                    accessToken = GetAccessToken(cancellationToken);\n                }\n                catch when (retryCount < _maxRetryCount)\n                {\n                    if (cancellationToken.WaitHandle.WaitOne(_retryInterval))\n                    {\n                        throw new OperationCanceledException($\"{nameof(TokenHandler)}.{nameof(Send)}: Token fetch canceled during wait.\", cancellationToken);\n                    }\n                    continue;\n                }\n                catch\n                {\n                    throw;\n                }\n\n                request.Headers.Authorization = _createAuthHeader(accessToken.TokenType, accessToken.AccessToken);\n\n                response = base.Send(request, cancellationToken);\n\n                if (response.IsSuccessStatusCode)\n                {\n                    break;\n                }\n\n                if (response.StatusCode != HttpStatusCode.Unauthorized)\n                {\n                    break;\n                }\n\n                if (cancellationToken.WaitHandle.WaitOne(_retryInterval))\n                {\n                    break;\n                }\n            }\n\n            return response;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Authentication/TokenType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Brokerages.Authentication\n{\n    /// <summary>\n    /// Defines the supported types of access tokens used for authentication.\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum TokenType\n    {\n        /// <summary>\n        /// A Bearer token, typically used for standard HTTP Authorization headers.\n        /// </summary>\n        Bearer = 0,\n\n        /// <summary>\n        /// A Session token, typically used for username/password authorization headers.\n        /// </summary>\n        SessionToken = 1,\n    }\n}\n"
  },
  {
    "path": "Brokerages/Backtesting/BacktestingBrokerage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\nusing System.Collections.Specialized;\n\nnamespace QuantConnect.Brokerages.Backtesting\n{\n    /// <summary>\n    /// Represents a brokerage to be used during backtesting. This is intended to be only be used with the BacktestingTransactionHandler\n    /// </summary>\n    [BrokerageFactory(typeof(BacktestingBrokerageFactory))]\n    public class BacktestingBrokerage : Brokerage\n    {\n        // flag used to indicate whether or not we need to scan for\n        // fills, this is purely a performance concern is ConcurrentDictionary.IsEmpty\n        // is not exactly the fastest operation and Scan gets called at least twice per\n        // time loop\n        private bool _needsScan;\n        private DateTime _nextOptionAssignmentTime;\n        private readonly ConcurrentDictionary<int, Order> _pending;\n        private readonly object _needsScanLock = new object();\n        private readonly HashSet<Symbol> _pendingOptionAssignments = new HashSet<Symbol>();\n\n        /// <summary>\n        /// This is the algorithm under test\n        /// </summary>\n        protected IAlgorithm Algorithm { get; init; }\n\n        /// <summary>\n        /// Creates a new BacktestingBrokerage for the specified algorithm\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public BacktestingBrokerage(IAlgorithm algorithm)\n            : this(algorithm, \"Backtesting Brokerage\")\n        {\n        }\n\n        /// <summary>\n        /// Creates a new BacktestingBrokerage for the specified algorithm\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"name\">The name of the brokerage</param>\n        protected BacktestingBrokerage(IAlgorithm algorithm, string name)\n            : base(name)\n        {\n            Algorithm = algorithm;\n            _pending = new ConcurrentDictionary<int, Order>();\n        }\n\n        /// <summary>\n        /// Gets the connection status\n        /// </summary>\n        /// <remarks>\n        /// The BacktestingBrokerage is always connected\n        /// </remarks>\n        public override bool IsConnected => true;\n\n        /// <summary>\n        /// Gets all open orders on the account\n        /// </summary>\n        /// <returns>The open orders returned from IB</returns>\n        public override List<Order> GetOpenOrders()\n        {\n            return Algorithm.Transactions.GetOpenOrders().ToList();\n        }\n\n        /// <summary>\n        /// Gets all holdings for the account\n        /// </summary>\n        /// <returns>The current holdings from the account</returns>\n        public override List<Holding> GetAccountHoldings()\n        {\n            // grab everything from the portfolio with a non-zero absolute quantity\n            return (from kvp in Algorithm.Portfolio.Securities.OrderBy(x => x.Value.Symbol)\n                    where kvp.Value.Holdings.AbsoluteQuantity > 0\n                    select new Holding(kvp.Value)).ToList();\n        }\n\n        /// <summary>\n        /// Gets the current cash balance for each currency held in the brokerage account\n        /// </summary>\n        /// <returns>The current cash balance for each currency available for trading</returns>\n        public override List<CashAmount> GetCashBalance()\n        {\n            return Algorithm.Portfolio.CashBook.Select(x => new CashAmount(x.Value.Amount, x.Value.Symbol)).ToList();\n        }\n\n        /// <summary>\n        /// Places a new order and assigns a new broker ID to the order\n        /// </summary>\n        /// <param name=\"order\">The order to be placed</param>\n        /// <returns>True if the request for a new order has been placed, false otherwise</returns>\n        public override bool PlaceOrder(Order order)\n        {\n            if (Algorithm.LiveMode)\n            {\n                Log.Trace(\"BacktestingBrokerage.PlaceOrder(): Type: \" + order.Type + \" Symbol: \" + order.Symbol.Value + \" Quantity: \" + order.Quantity);\n            }\n\n            if (order.Status == OrderStatus.New)\n            {\n                lock (_needsScanLock)\n                {\n                    _needsScan = true;\n                    SetPendingOrder(order);\n                }\n\n                AddBrokerageOrderId(order);\n\n                // fire off the event that says this order has been submitted\n                var submitted = new OrderEvent(order,\n                        Algorithm.UtcTime,\n                        OrderFee.Zero)\n                { Status = OrderStatus.Submitted };\n                OnOrderEvent(submitted);\n\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Updates the order with the same ID\n        /// </summary>\n        /// <param name=\"order\">The new order information</param>\n        /// <returns>True if the request was made for the order to be updated, false otherwise</returns>\n        public override bool UpdateOrder(Order order)\n        {\n            if (Algorithm.LiveMode)\n            {\n                Log.Trace(\"BacktestingBrokerage.UpdateOrder(): Symbol: \" + order.Symbol.Value + \" Quantity: \" + order.Quantity + \" Status: \" + order.Status);\n            }\n\n            lock (_needsScanLock)\n            {\n                Order pending;\n                if (!_pending.TryGetValue(order.Id, out pending))\n                {\n                    // can't update something that isn't there\n                    return false;\n                }\n\n                _needsScan = true;\n                SetPendingOrder(order);\n            }\n\n            AddBrokerageOrderId(order);\n\n            // fire off the event that says this order has been updated\n            var updated = new OrderEvent(order,\n                    Algorithm.UtcTime,\n                    OrderFee.Zero)\n            {\n                Status = OrderStatus.UpdateSubmitted\n            };\n            OnOrderEvent(updated);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Cancels the order with the specified ID\n        /// </summary>\n        /// <param name=\"order\">The order to cancel</param>\n        /// <returns>True if the request was made for the order to be canceled, false otherwise</returns>\n        public override bool CancelOrder(Order order)\n        {\n            if (Algorithm.LiveMode)\n            {\n                Log.Trace(\"BacktestingBrokerage.CancelOrder(): Symbol: \" + order.Symbol.Value + \" Quantity: \" + order.Quantity);\n            }\n\n            if (!order.TryGetGroupOrders(TryGetOrder, out var orders))\n            {\n                return false;\n            }\n\n            var result = true;\n            foreach (var orderInGroup in orders)\n            {\n                lock (_needsScanLock)\n                {\n                    if (!_pending.TryRemove(orderInGroup.Id, out var _))\n                    {\n                        // can't cancel something that isn't there,\n                        // let's continue just in case some other order of the group has to be cancelled\n                        result = false;\n                    }\n                }\n\n                AddBrokerageOrderId(orderInGroup);\n\n                // fire off the event that says this order has been canceled\n                var canceled = new OrderEvent(orderInGroup,\n                        Algorithm.UtcTime,\n                        OrderFee.Zero)\n                { Status = OrderStatus.Canceled };\n                OnOrderEvent(canceled);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Scans all the outstanding orders and applies the algorithm model fills to generate the order events\n        /// </summary>\n        public virtual void Scan()\n        {\n            ProcessAssignmentOrders();\n\n            lock (_needsScanLock)\n            {\n                // there's usually nothing in here\n                if (!_needsScan)\n                {\n                    return;\n                }\n\n                var stillNeedsScan = false;\n\n                // process each pending order to produce fills/fire events\n                foreach (var kvp in _pending.OrderBySafe(x => x.Key))\n                {\n                    var order = kvp.Value;\n                    if (order == null)\n                    {\n                        Log.Error(\"BacktestingBrokerage.Scan(): Null pending order found: \" + kvp.Key);\n                        _pending.TryRemove(kvp.Key, out order);\n                        continue;\n                    }\n\n                    if (order.Status.IsClosed())\n                    {\n                        // this should never actually happen as we always remove closed orders as they happen\n                        _pending.TryRemove(order.Id, out var _);\n                        continue;\n                    }\n\n                    // all order fills are processed on the next bar (except for market orders)\n                    if (order.Time == Algorithm.UtcTime && order.Type != OrderType.Market && order.Type != OrderType.ComboMarket && order.Type != OrderType.OptionExercise)\n                    {\n                        stillNeedsScan = true;\n                        continue;\n                    }\n\n                    if (!order.TryGetGroupOrders(TryGetOrder, out var orders))\n                    {\n                        // an Order of the group is missing\n                        stillNeedsScan = true;\n                        continue;\n                    }\n\n                    if(!orders.TryGetGroupOrdersSecurities(Algorithm.Portfolio, out var securities))\n                    {\n                        Log.Error($\"BacktestingBrokerage.Scan(): Unable to process orders: [{string.Join(\",\", orders.Select(o => o.Id))}] The security no longer exists. UtcTime: {Algorithm.UtcTime}\");\n                        // invalidate the order in the algorithm before removing\n                        RemoveOrders(orders, OrderStatus.Invalid);\n                        continue;\n                    }\n\n                    if (!TryOrderPreChecks(securities, out stillNeedsScan))\n                    {\n                        continue;\n                    }\n\n                    // verify sure we have enough cash to perform the fill\n                    HasSufficientBuyingPowerForOrderResult hasSufficientBuyingPowerResult;\n                    try\n                    {\n                        hasSufficientBuyingPowerResult = Algorithm.Portfolio.HasSufficientBuyingPowerForOrder(orders);\n                    }\n                    catch (Exception err)\n                    {\n                        // if we threw an error just mark it as invalid and remove the order from our pending list\n                        RemoveOrders(orders, OrderStatus.Invalid, err.Message);\n\n                        Log.Error(err);\n                        Algorithm.Error($\"Order Error: ids: [{string.Join(\",\", orders.Select(o => o.Id))}], Error executing margin models: {err.Message}\");\n                        continue;\n                    }\n\n                    var fills = new List<OrderEvent>();\n                    //Before we check this queued order make sure we have buying power:\n                    if (hasSufficientBuyingPowerResult.IsSufficient)\n                    {\n                        //Model:\n                        var security = securities[order];\n                        var model = security.FillModel;\n\n                        //Based on the order type: refresh its model to get fill price and quantity\n                        try\n                        {\n                            if (order.Type == OrderType.OptionExercise)\n                            {\n                                var option = (Option)security;\n                                fills.AddRange(option.OptionExerciseModel.OptionExercise(option, order as OptionExerciseOrder));\n                            }\n                            else\n                            {\n                                var context = new FillModelParameters(\n                                    security,\n                                    order,\n                                    Algorithm.SubscriptionManager.SubscriptionDataConfigService,\n                                    Algorithm.Settings.StalePriceTimeSpan,\n                                    securities,\n                                    OnOrderUpdated);\n\n                                // check if the fill should be emitted\n                                var fill = model.Fill(context);\n                                if (fill.All(x => order.TimeInForce.IsFillValid(security, order, x)))\n                                {\n                                    fills.AddRange(fill);\n                                }\n                            }\n\n                            // invoke fee models for completely filled order events\n                            foreach (var fill in fills)\n                            {\n                                if (fill.Status == OrderStatus.Filled)\n                                {\n                                    // this check is provided for backwards compatibility of older user-defined fill models\n                                    // that may be performing fee computation inside the fill model w/out invoking the fee model\n                                    // TODO : This check can be removed in April, 2019 -- a 6-month window to upgrade (also, suspect small % of users, if any are impacted)\n                                    if (fill.OrderFee.Value.Amount == 0m)\n                                    {\n                                        // It could be the case the order is a combo order, then it contains legs with different quantities and security types.\n                                        // Therefore, we need to compute the fees based on the specific leg order and security\n                                        var legKVP = securities.Where(x => x.Key.Id == fill.OrderId).Single();\n                                        fill.OrderFee = legKVP.Value.FeeModel.GetOrderFee(new OrderFeeParameters(legKVP.Value, legKVP.Key));\n                                    }\n                                }\n                            }\n                        }\n                        catch (Exception err)\n                        {\n                            Log.Error(err);\n                            Algorithm.Error($\"Order Error: id: {order.Id}, Transaction model failed to fill for order type: {order.Type} with error: {err.Message}\");\n                        }\n                    }\n                    else if (order.Status == OrderStatus.CancelPending)\n                    {\n                        // the pending CancelOrderRequest will be handled during the next transaction handler run\n                        continue;\n                    }\n                    else\n                    {\n                        // invalidate the order in the algorithm before removing\n                        var message = securities.GetErrorMessage(hasSufficientBuyingPowerResult);\n                        RemoveOrders(orders, OrderStatus.Invalid, message);\n\n                        Algorithm.Error(message);\n                        continue;\n                    }\n\n                    if (fills.Count == 0)\n                    {\n                        continue;\n                    }\n\n                    List<OrderEvent> fillEvents = new(orders.Count);\n                    List<Tuple<Order, OrderEvent>> positionAssignments = new(orders.Count);\n                    foreach (var targetOrder in orders)\n                    {\n                        var orderFills = fills.Where(f => f.OrderId == targetOrder.Id);\n                        foreach (var fill in orderFills)\n                        {\n                            // change in status or a new fill\n                            if (targetOrder.Status != fill.Status || fill.FillQuantity != 0)\n                            {\n                                // we update the order status so we do not re process it if we re enter\n                                // because of the call to OnOrderEvent.\n                                // Note: this is done by the transaction handler but we have a clone of the order\n                                targetOrder.Status = fill.Status;\n                                fillEvents.Add(fill);\n                            }\n\n                            if (fill.IsAssignment)\n                            {\n                                positionAssignments.Add(Tuple.Create(targetOrder, fill));\n                            }\n                        }\n                    }\n\n                    OnOrderEvents(fillEvents);\n                    foreach (var assignment in positionAssignments)\n                    {\n                        assignment.Item2.Message = assignment.Item1.Tag;\n                        OnOptionPositionAssigned(assignment.Item2);\n                    }\n\n                    if (fills.All(x => x.Status.IsClosed()))\n                    {\n                        foreach (var o in orders)\n                        {\n                            _pending.TryRemove(o.Id, out var _);\n                        }\n                    }\n                    else\n                    {\n                        stillNeedsScan = true;\n                    }\n                }\n\n                // if we didn't fill then we need to continue to scan or\n                // if there are still pending orders\n                _needsScan = stillNeedsScan || !_pending.IsEmpty;\n            }\n        }\n\n        /// <summary>\n        /// Invokes the <see cref=\"Brokerage.OnOrderUpdated(OrderUpdateEvent)\" /> event with the given order updates.\n        /// </summary>\n        private void OnOrderUpdated(Order order)\n        {\n            switch (order.Type)\n            {\n                case OrderType.TrailingStop:\n                    OnOrderUpdated(new OrderUpdateEvent { OrderId = order.Id, TrailingStopPrice = ((TrailingStopOrder)order).StopPrice });\n                    break;\n\n                case OrderType.StopLimit:\n                    OnOrderUpdated(new OrderUpdateEvent { OrderId = order.Id, StopTriggered = ((StopLimitOrder)order).StopTriggered });\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to drive option assignment models\n        /// </summary>\n        private void ProcessAssignmentOrders()\n        {\n            if (Algorithm.UtcTime >= _nextOptionAssignmentTime)\n            {\n                _nextOptionAssignmentTime = Algorithm.UtcTime.RoundDown(Time.OneHour) + Time.OneHour;\n\n                foreach (var security in Algorithm.Securities.Values\n                    .Where(security => security.Symbol.SecurityType.IsOption() && security.Holdings.IsShort)\n                    .OrderBy(security => security.Symbol.ID.Symbol))\n                {\n                    var option = (Option)security;\n                    var result = option.OptionAssignmentModel.GetAssignment(new OptionAssignmentParameters(option));\n                    if (result != null && result.Quantity != 0)\n                    {\n                        if (!_pendingOptionAssignments.Add(option.Symbol))\n                        {\n                            throw new InvalidOperationException($\"Duplicate option exercise order request for symbol {option.Symbol}. Please contact support\");\n                        }\n\n                        OnOptionNotification(new OptionNotificationEventArgs(option.Symbol, 0, result.Tag));\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the OrderFilled event\n        /// </summary>\n        /// <param name=\"orderEvents\">The list of order events</param>\n        protected override void OnOrderEvents(List<OrderEvent> orderEvents)\n        {\n            for (int i = 0; i < orderEvents.Count; i++)\n            {\n                _pendingOptionAssignments.Remove(orderEvents[i].Symbol);\n            }\n            base.OnOrderEvents(orderEvents);\n        }\n\n        /// <summary>\n        /// The BacktestingBrokerage is always connected. This is a no-op.\n        /// </summary>\n        public override void Connect()\n        {\n            //NOP\n        }\n\n        /// <summary>\n        /// The BacktestingBrokerage is always connected. This is a no-op.\n        /// </summary>\n        public override void Disconnect()\n        {\n            //NOP\n        }\n\n        /// <summary>\n        /// Sets the pending order as a clone to prevent object reference nastiness\n        /// </summary>\n        /// <param name=\"order\">The order to be added to the pending orders dictionary</param>\n        /// <returns></returns>\n        private void SetPendingOrder(Order order)\n        {\n            _pending[order.Id] = order;\n        }\n\n        /// <summary>\n        /// Process delistings\n        /// </summary>\n        /// <param name=\"delistings\">Delistings to process</param>\n        public void ProcessDelistings(Delistings delistings)\n        {\n            // Process our delistings, important to do options first because of possibility of having future options contracts\n            // and underlying future delisting at the same time.\n            foreach (var delisting in delistings?.Values.OrderBy(x => !x.Symbol.SecurityType.IsOption()))\n            {\n                Log.Debug($\"BacktestingBrokerage.ProcessDelistings(): Delisting {delisting.Type}: {delisting.Symbol.Value}, UtcTime: {Algorithm.UtcTime}, DelistingTime: {delisting.Time}\");\n                if (delisting.Type == DelistingType.Warning)\n                {\n                    // We do nothing with warnings\n                    continue;\n                }\n\n                var security = Algorithm.Securities[delisting.Symbol];\n\n                if (security.Symbol.SecurityType.IsOption())\n                {\n                    // Process the option delisting\n                    OnOptionNotification(new OptionNotificationEventArgs(delisting.Symbol, 0));\n                }\n                else\n                {\n                    // Any other type of delisting\n                    OnDelistingNotification(new DelistingNotificationEventArgs(delisting.Symbol));\n                }\n\n                // the subscription are getting removed from the data feed because they end\n                // remove security from all universes\n                foreach (var ukvp in Algorithm.UniverseManager)\n                {\n                    var universe = ukvp.Value;\n                    if (universe.ContainsMember(security.Symbol))\n                    {\n                        if (universe is UserDefinedUniverse userUniverse)\n                        {\n                            if (userUniverse.Remove(security.Symbol))\n                            {\n                                Algorithm.UniverseManager.Update(userUniverse.Symbol, userUniverse, NotifyCollectionChangedAction.Replace);\n                            }\n                        }\n                        else\n                        {\n                            universe.RemoveMember(Algorithm.UtcTime, security);\n                        }\n                    }\n                }\n                Algorithm.UniverseManager.ProcessChanges();\n\n                if (!Algorithm.IsWarmingUp)\n                {\n                    // Cancel any other orders\n                    var cancelledOrders = Algorithm.Transactions.CancelOpenOrders(delisting.Symbol);\n                    foreach (var cancelledOrder in cancelledOrders)\n                    {\n                        Log.Trace(\"AlgorithmManager.Run(): \" + cancelledOrder);\n                    }\n                }\n            }\n        }\n\n        private void RemoveOrders(List<Order> orders, OrderStatus orderStatus, string message = \"\")\n        {\n            var orderEvents = new List<OrderEvent>(orders.Count);\n            for (var i = 0; i < orders.Count; i++)\n            {\n                var order = orders[i];\n                orderEvents.Add(new OrderEvent(order, Algorithm.UtcTime, OrderFee.Zero, message) { Status = orderStatus });\n                _pending.TryRemove(order.Id, out var _);\n            }\n\n            OnOrderEvents(orderEvents);\n        }\n\n        private bool TryOrderPreChecks(Dictionary<Order, Security> ordersSecurities, out bool stillNeedsScan)\n        {\n            var result = true;\n            stillNeedsScan = false;\n\n            var removedOrdersIds = new HashSet<int>();\n\n            foreach (var kvp in ordersSecurities)\n            {\n                var order = kvp.Key;\n                var security = kvp.Value;\n\n                if (order.Type == OrderType.MarketOnOpen)\n                {\n                    // This is a performance improvement:\n                    // Since MOO should never fill on the same bar or on stale data (see FillModel)\n                    // the order can remain unfilled for multiple 'scans', so we want to avoid\n                    // margin and portfolio calculations since they are expensive\n                    var currentBar = security.GetLastData();\n                    var localOrderTime = order.Time.ConvertFromUtc(security.Exchange.TimeZone);\n                    if (currentBar == null || localOrderTime >= currentBar.EndTime)\n                    {\n                        stillNeedsScan = true;\n                        result = false;\n                        break;\n                    }\n                }\n\n                // check if the time in force handler allows fills\n                if (order.TimeInForce.IsOrderExpired(security, order))\n                {\n                    // We remove all orders in the combo\n                    RemoveOrders(ordersSecurities.Select(kvp => kvp.Key).ToList(), OrderStatus.Canceled, \"The order has expired.\");\n                    result = false;\n                    break;\n                }\n\n                // check if we would actually be able to fill this\n                if (!Algorithm.BrokerageModel.CanExecuteOrder(security, order))\n                {\n                    result = false;\n                    break;\n                }\n            }\n\n            return result;\n        }\n\n        private Order TryGetOrder(int orderId)\n        {\n            _pending.TryGetValue(orderId, out var order);\n            return order;\n        }\n\n        private static void AddBrokerageOrderId(Order order)\n        {\n            var orderId = order.Id.ToStringInvariant();\n            if (!order.BrokerId.Contains(orderId))\n            {\n                order.BrokerId.Add(orderId);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Backtesting/BacktestingBrokerageFactory.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages.Backtesting\n{\n    /// <summary>\n    /// Factory type for the <see cref=\"BacktestingBrokerage\"/>\n    /// </summary>\n    public class BacktestingBrokerageFactory : BrokerageFactory\n    {\n        /// <summary>\n        /// Gets the brokerage data required to run the IB brokerage from configuration\n        /// </summary>\n        /// <remarks>\n        /// The implementation of this property will create the brokerage data dictionary required for\n        /// running live jobs. See <see cref=\"IJobQueueHandler.NextJob\"/>\n        /// </remarks>\n        public override Dictionary<string, string> BrokerageData\n        {\n            get { return new Dictionary<string, string>(); }\n        }\n\n        /// <summary>\n        /// Gets a new instance of the <see cref=\"InteractiveBrokersBrokerageModel\"/>\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider</param>\n        public override IBrokerageModel GetBrokerageModel(IOrderProvider orderProvider) => new InteractiveBrokersBrokerageModel();\n\n        /// <summary>\n        /// Creates a new IBrokerage instance\n        /// </summary>\n        /// <param name=\"job\">The job packet to create the brokerage for</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>A new brokerage instance</returns>\n        public override IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm)\n        {\n            return new BacktestingBrokerage(algorithm);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public override void Dispose()\n        {\n            // NOP\n        }\n\n        /// <summary>\n        ///Initializes a new instance of the <see cref=\"BacktestingBrokerageFactory\"/> class\n        /// </summary>\n        public BacktestingBrokerageFactory()\n            : base(typeof(BacktestingBrokerage))\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/BaseWebsocketsBrokerage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing RestSharp;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading;\n\nnamespace QuantConnect.Brokerages\n{\n\n    /// <summary>\n    /// Provides shared brokerage websockets implementation\n    /// </summary>\n    public abstract class BaseWebsocketsBrokerage : Brokerage\n    {\n        private const int ConnectionTimeout = 30000;\n\n        private IRestClient _restClient;\n        private HttpClient _httpClient;\n\n        /// <summary>\n        /// True if the current brokerage is already initialized\n        /// </summary>\n        protected bool IsInitialized { get; set; }\n\n        /// <summary>\n        /// The websockets client instance\n        /// </summary>\n        protected IWebSocket WebSocket { get; set; }\n\n        /// <summary>\n        /// The rest client instance\n        /// </summary>\n        [Obsolete(\"RestClient is deprecated. Use HttpClient property instead\")]\n        protected IRestClient RestClient\n        {\n            get\n            {\n                if (_restClient == null)\n                {\n                    throw new InvalidOperationException(\"RestClient not initialized\");\n                }\n                return _restClient;\n            }\n            set\n            {\n                _restClient = value;\n            }\n        }\n\n        /// <summary>\n        /// The HTTP client instance\n        /// </summary>\n        protected HttpClient HttpClient\n        {\n            get\n            {\n                if (_httpClient == null)\n                {\n                    throw new InvalidOperationException(\"HttpClient not initialized\");\n                }\n                return _httpClient;\n            }\n            set\n            {\n                _httpClient = value;\n            }\n        }\n\n        /// <summary>\n        /// standard json parsing settings\n        /// </summary>\n        protected JsonSerializerSettings JsonSettings { get; set; }\n\n        /// <summary>\n        /// A list of currently active orders\n        /// </summary>\n        public ConcurrentDictionary<int, Orders.Order> CachedOrderIDs { get; set; }\n\n        /// <summary>\n        /// The api secret\n        /// </summary>\n        protected string ApiSecret { get; set; }\n\n        /// <summary>\n        /// The api key\n        /// </summary>\n        protected string ApiKey { get; set; }\n\n        /// <summary>\n        /// Count subscribers for each (symbol, tickType) combination\n        /// </summary>\n        protected DataQueueHandlerSubscriptionManager SubscriptionManager { get; set; }\n\n        /// <summary>\n        /// Initialize the instance of this class\n        /// </summary>\n        /// <param name=\"wssUrl\">The web socket base url</param>\n        /// <param name=\"websocket\">instance of websockets client</param>\n        /// <param name=\"restClient\">instance of rest client</param>\n        /// <param name=\"apiKey\">api key</param>\n        /// <param name=\"apiSecret\">api secret</param>\n        [Obsolete(\"This Initialize method is deprecated. Use the overload that takes an HttpClient instance instead.\")]\n        protected void Initialize(string wssUrl, IWebSocket websocket, IRestClient restClient, string apiKey, string apiSecret)\n        {\n            if (TryInitialize(wssUrl, websocket, apiKey, apiSecret))\n            {\n                RestClient = restClient;\n            }\n        }\n\n        /// <summary>\n        /// Initialize the instance of this class\n        /// </summary>\n        /// <param name=\"wssUrl\">The web socket base url</param>\n        /// <param name=\"websocket\">Instance of websockets client</param>\n        /// <param name=\"httpClient\">Instance of HTTP client</param>\n        /// <param name=\"apiKey\">Api key</param>\n        /// <param name=\"apiSecret\">Api secret</param>\n        protected void Initialize(string wssUrl, IWebSocket websocket, HttpClient httpClient, string apiKey, string apiSecret)\n        {\n            if (TryInitialize(wssUrl, websocket, apiKey, apiSecret))\n            {\n                HttpClient = httpClient;\n            }\n        }\n\n        private bool TryInitialize(string wssUrl, IWebSocket websocket, string apiKey, string apiSecret)\n        {\n            if (IsInitialized)\n            {\n                return false;\n            }\n            IsInitialized = true;\n            JsonSettings = new JsonSerializerSettings { FloatParseHandling = FloatParseHandling.Decimal };\n            CachedOrderIDs = new ConcurrentDictionary<int, Orders.Order>();\n\n            WebSocket = websocket;\n            WebSocket.Initialize(wssUrl);\n            WebSocket.Message += OnMessage;\n\n            WebSocket.Open += (sender, args) =>\n            {\n                Log.Trace($\"BaseWebsocketsBrokerage(): WebSocket.Open. Subscribing\");\n                Subscribe(GetSubscribed());\n            };\n\n            ApiSecret = apiSecret;\n            ApiKey = apiKey;\n\n            return true;\n        }\n\n        /// <summary>\n        /// Creates an instance of a websockets brokerage\n        /// </summary>\n        /// <param name=\"name\">Name of brokerage</param>\n        protected BaseWebsocketsBrokerage(string name) : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Handles websocket received messages\n        /// </summary>\n        /// <param name=\"sender\"></param>\n        /// <param name=\"e\"></param>\n        protected abstract void OnMessage(object sender, WebSocketMessage e);\n\n        /// <summary>\n        /// Creates wss connection, monitors for disconnection and re-connects when necessary\n        /// </summary>\n        public override void Connect()\n        {\n            if (IsConnected)\n                return;\n\n            Log.Trace(\"BaseWebSocketsBrokerage.Connect(): Connecting...\");\n\n            ConnectSync();\n        }\n\n        /// <summary>\n        /// Handles the creation of websocket subscriptions\n        /// </summary>\n        /// <param name=\"symbols\"></param>\n        protected abstract bool Subscribe(IEnumerable<Symbol> symbols);\n\n        /// <summary>\n        /// Gets a list of current subscriptions\n        /// </summary>\n        /// <returns></returns>\n        protected virtual IEnumerable<Symbol> GetSubscribed()\n        {\n            return SubscriptionManager?.GetSubscribedSymbols() ?? Enumerable.Empty<Symbol>();\n        }\n\n        /// <summary>\n        /// Start websocket connect\n        /// </summary>\n        protected void ConnectSync()\n        {\n            var resetEvent = new ManualResetEvent(false);\n            EventHandler triggerEvent = (o, args) => resetEvent.Set();\n            WebSocket.Open += triggerEvent;\n\n            WebSocket.Connect();\n\n            if (!resetEvent.WaitOne(ConnectionTimeout))\n            {\n                throw new TimeoutException(\"Websockets connection timeout.\");\n            }\n            WebSocket.Open -= triggerEvent;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/BestBidAskUpdatedEventArgs.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Event arguments class for the <see cref=\"DefaultOrderBook.BestBidAskUpdated\"/> event\n    /// </summary>\n    public sealed class BestBidAskUpdatedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the new best bid price\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the new best bid price\n        /// </summary>\n        public decimal BestBidPrice { get; }\n\n        /// <summary>\n        /// Gets the new best bid size\n        /// </summary>\n        public decimal BestBidSize { get; }\n\n        /// <summary>\n        /// Gets the new best ask price\n        /// </summary>\n        public decimal BestAskPrice { get; }\n\n        /// <summary>\n        /// Gets the new best ask size\n        /// </summary>\n        public decimal BestAskSize { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BestBidAskUpdatedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"bestBidPrice\">The newly updated best bid price</param>\n        /// <param name=\"bestBidSize\">>The newly updated best bid size</param>\n        /// <param name=\"bestAskPrice\">The newly updated best ask price</param>\n        /// <param name=\"bestAskSize\">The newly updated best ask size</param>\n        public BestBidAskUpdatedEventArgs(Symbol symbol, decimal bestBidPrice, decimal bestBidSize, decimal bestAskPrice, decimal bestAskSize)\n        {\n            Symbol = symbol;\n            BestBidPrice = bestBidPrice;\n            BestBidSize = bestBidSize;\n            BestAskPrice = bestAskPrice;\n            BestAskSize = bestAskSize;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Brokerage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Threading;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing QuantConnect.Api;\nusing QuantConnect.Brokerages.Authentication;\nusing QuantConnect.Brokerages.CrossZero;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents the base Brokerage implementation. This provides logging on brokerage events.\n    /// </summary>\n    public abstract class Brokerage : IBrokerage\n    {\n        // 7:45 AM (New York time zone)\n        private static readonly TimeSpan LiveBrokerageCashSyncTime = new TimeSpan(7, 45, 0);\n\n        private readonly object _performCashSyncReentranceGuard = new object();\n        private bool _syncedLiveBrokerageCashToday = true;\n        private long _lastSyncTimeTicks = DateTime.UtcNow.Ticks;\n\n        /// <summary>\n        /// Event that fires each time the brokerage order id changes\n        /// </summary>\n        public event EventHandler<BrokerageOrderIdChangedEvent> OrderIdChanged;\n\n        /// <summary>\n        /// Event that fires each time the status for a list of orders change\n        /// </summary>\n        public event EventHandler<List<OrderEvent>> OrdersStatusChanged;\n\n        /// <summary>\n        /// Event that fires each time an order is updated in the brokerage side\n        /// </summary>\n        /// <remarks>\n        /// These are not status changes but mainly price changes, like the stop price of a trailing stop order\n        /// </remarks>\n        public event EventHandler<OrderUpdateEvent> OrderUpdated;\n\n        /// <summary>\n        /// Event that fires each time a short option position is assigned\n        /// </summary>\n        public event EventHandler<OrderEvent> OptionPositionAssigned;\n\n        /// <summary>\n        /// Event that fires each time an option position has changed\n        /// </summary>\n        public event EventHandler<OptionNotificationEventArgs> OptionNotification;\n\n        /// <summary>\n        /// Event that fires each time there's a brokerage side generated order\n        /// </summary>\n        public event EventHandler<NewBrokerageOrderNotificationEventArgs> NewBrokerageOrderNotification;\n\n        /// <summary>\n        /// Event that fires each time a delisting occurs\n        /// </summary>\n        public event EventHandler<DelistingNotificationEventArgs> DelistingNotification;\n\n        /// <summary>\n        /// Event that fires each time a user's brokerage account is changed\n        /// </summary>\n        public event EventHandler<AccountEvent> AccountChanged;\n\n        /// <summary>\n        /// Event that fires when an error is encountered in the brokerage\n        /// </summary>\n        public event EventHandler<BrokerageMessageEvent> Message;\n\n        /// <summary>\n        /// Gets the name of the brokerage\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Returns true if we're currently connected to the broker\n        /// </summary>\n        public abstract bool IsConnected { get; }\n\n        /// <summary>\n        /// Enables or disables concurrent processing of messages to and from the brokerage.\n        /// </summary>\n        public virtual bool ConcurrencyEnabled { get; set; }\n\n        /// <summary>\n        /// Creates a new Brokerage instance with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of the brokerage</param>\n        protected Brokerage(string name)\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        /// Places a new order and assigns a new broker ID to the order\n        /// </summary>\n        /// <param name=\"order\">The order to be placed</param>\n        /// <returns>True if the request for a new order has been placed, false otherwise</returns>\n        public abstract bool PlaceOrder(Order order);\n\n        /// <summary>\n        /// Updates the order with the same id\n        /// </summary>\n        /// <param name=\"order\">The new order information</param>\n        /// <returns>True if the request was made for the order to be updated, false otherwise</returns>\n        public abstract bool UpdateOrder(Order order);\n\n        /// <summary>\n        /// Cancels the order with the specified ID\n        /// </summary>\n        /// <param name=\"order\">The order to cancel</param>\n        /// <returns>True if the request was made for the order to be canceled, false otherwise</returns>\n        public abstract bool CancelOrder(Order order);\n\n        /// <summary>\n        /// Connects the client to the broker's remote servers\n        /// </summary>\n        public abstract void Connect();\n\n        /// <summary>\n        /// Disconnects the client from the broker's remote servers\n        /// </summary>\n        public abstract void Disconnect();\n\n        /// <summary>\n        /// Dispose of the brokerage instance\n        /// </summary>\n        public virtual void Dispose()\n        {\n            // NOP\n        }\n\n        /// <summary>\n        /// Event invocator for the OrderFilled event\n        /// </summary>\n        /// <param name=\"orderEvents\">The list of order events</param>\n        protected virtual void OnOrderEvents(List<OrderEvent> orderEvents)\n        {\n            try\n            {\n                OrdersStatusChanged?.Invoke(this, orderEvents);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the OrderFilled event\n        /// </summary>\n        /// <param name=\"e\">The order event</param>\n        protected virtual void OnOrderEvent(OrderEvent e)\n        {\n            OnOrderEvents(new List<OrderEvent> { e });\n        }\n\n        /// <summary>\n        /// Event invocator for the OrderUpdated event\n        /// </summary>\n        /// <param name=\"e\">The update event</param>\n        protected virtual void OnOrderUpdated(OrderUpdateEvent e)\n        {\n            try\n            {\n                OrderUpdated?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the OrderIdChanged event\n        /// </summary>\n        /// <param name=\"e\">The BrokerageOrderIdChangedEvent</param>\n        protected virtual void OnOrderIdChangedEvent(BrokerageOrderIdChangedEvent e)\n        {\n            try\n            {\n                OrderIdChanged?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the OptionPositionAssigned event\n        /// </summary>\n        /// <param name=\"e\">The OrderEvent</param>\n        protected virtual void OnOptionPositionAssigned(OrderEvent e)\n        {\n            try\n            {\n                Log.Debug(\"Brokerage.OptionPositionAssigned(): \" + e);\n\n                OptionPositionAssigned?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the OptionNotification event\n        /// </summary>\n        /// <param name=\"e\">The OptionNotification event arguments</param>\n        protected virtual void OnOptionNotification(OptionNotificationEventArgs e)\n        {\n            try\n            {\n                Log.Debug(\"Brokerage.OnOptionNotification(): \" + e);\n\n                OptionNotification?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the NewBrokerageOrderNotification event\n        /// </summary>\n        /// <param name=\"e\">The NewBrokerageOrderNotification event arguments</param>\n        protected virtual void OnNewBrokerageOrderNotification(NewBrokerageOrderNotificationEventArgs e)\n        {\n            try\n            {\n                Log.Debug(\"Brokerage.OnNewBrokerageOrderNotification(): \" + e);\n\n                NewBrokerageOrderNotification?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the DelistingNotification event\n        /// </summary>\n        /// <param name=\"e\">The DelistingNotification event arguments</param>\n        protected virtual void OnDelistingNotification(DelistingNotificationEventArgs e)\n        {\n            try\n            {\n                Log.Debug(\"Brokerage.OnDelistingNotification(): \" + e);\n\n                DelistingNotification?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the AccountChanged event\n        /// </summary>\n        /// <param name=\"e\">The AccountEvent</param>\n        protected virtual void OnAccountChanged(AccountEvent e)\n        {\n            try\n            {\n                Log.Trace($\"Brokerage.OnAccountChanged(): {e}\");\n\n                AccountChanged?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the Message event\n        /// </summary>\n        /// <param name=\"e\">The error</param>\n        protected virtual void OnMessage(BrokerageMessageEvent e)\n        {\n            try\n            {\n                if (e.Type == BrokerageMessageType.Error)\n                {\n                    Log.Error(\"Brokerage.OnMessage(): \" + e);\n                }\n                else\n                {\n                    Log.Trace(\"Brokerage.OnMessage(): \" + e);\n                }\n\n                Message?.Invoke(this, e);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"LeanOAuthTokenHandler\"/> and automatically wires it so that\n        /// authentication failures trigger a brokerage error message, causing Lean to shut down gracefully.\n        /// </summary>\n        /// <param name=\"apiClient\">The API client used to communicate with the Lean platform.</param>\n        /// <param name=\"request\">The request model used to generate the access token.</param>\n        /// <param name=\"tokenLifetime\">\n        /// The expected lifetime of a fetched token. A 1-minute safety buffer is applied before expiry.\n        /// Must be provided explicitly — each brokerage has a different token lifetime.\n        /// </param>\n        /// <returns>A configured <see cref=\"LeanOAuthTokenHandler\"/> instance.</returns>\n        protected LeanOAuthTokenHandler<T> CreateOAuthTokenHandler<T>(ApiConnection apiClient, OAuthTokenRequest request, TimeSpan tokenLifetime)\n            where T : LeanTokenCredentials\n        {\n            var handler = new LeanOAuthTokenHandler<T>(apiClient, request, tokenLifetime);\n            handler.AuthenticationFailed += (_, ex) => OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Error, \"OAuthenticationFailed\", ex.Message));\n            return handler;\n        }\n\n        /// <summary>\n        /// Helper method that will try to get the live holdings from the provided brokerage data collection else will default to the algorithm state\n        /// </summary>\n        /// <remarks>Holdings will removed from the provided collection on the first call, since this method is expected to be called only\n        /// once on initialize, after which the algorithm should use Lean accounting</remarks>\n        protected virtual List<Holding> GetAccountHoldings(Dictionary<string, string> brokerageData, IEnumerable<Security> securities)\n        {\n            if (Log.DebuggingEnabled)\n            {\n                Log.Debug(\"Brokerage.GetAccountHoldings(): starting...\");\n            }\n\n            if (brokerageData != null && brokerageData.Remove(\"live-holdings\", out var value) && !string.IsNullOrEmpty(value))\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"Brokerage.GetAccountHoldings(): raw value: {value}\");\n                }\n\n                // remove the key, we really only want to return the cached value on the first request\n                var result = JsonConvert.DeserializeObject<List<Holding>>(value);\n                if (result == null)\n                {\n                    return new List<Holding>();\n                }\n                Log.Trace($\"Brokerage.GetAccountHoldings(): sourcing holdings from provided brokerage data, found {result.Count} entries\");\n                return result;\n            }\n\n            return securities?.Where(security => security.Holdings.AbsoluteQuantity > 0)\n                .OrderBy(security => security.Symbol)\n                .Select(security => new Holding(security)).ToList() ?? new List<Holding>();\n        }\n\n        /// <summary>\n        /// Helper method that will try to get the live cash balance from the provided brokerage data collection else will default to the algorithm state\n        /// </summary>\n        /// <remarks>Cash balance will removed from the provided collection on the first call, since this method is expected to be called only\n        /// once on initialize, after which the algorithm should use Lean accounting</remarks>\n        protected virtual List<CashAmount> GetCashBalance(Dictionary<string, string> brokerageData, CashBook cashBook)\n        {\n            if (Log.DebuggingEnabled)\n            {\n                Log.Debug(\"Brokerage.GetCashBalance(): starting...\");\n            }\n\n            if (brokerageData != null && brokerageData.Remove(\"live-cash-balance\", out var value) && !string.IsNullOrEmpty(value))\n            {\n                // remove the key, we really only want to return the cached value on the first request\n                var result = JsonConvert.DeserializeObject<List<CashAmount>>(value);\n                if (result == null)\n                {\n                    return new List<CashAmount>();\n                }\n                Log.Trace($\"Brokerage.GetCashBalance(): sourcing cash balance from provided brokerage data, found {result.Count} entries\");\n                return result;\n            }\n\n            return cashBook?.Select(x => new CashAmount(x.Value.Amount, x.Value.Symbol)).ToList() ?? new List<CashAmount>();\n        }\n\n        /// <summary>\n        /// Gets all open orders on the account.\n        /// NOTE: The order objects returned do not have QC order IDs.\n        /// </summary>\n        /// <returns>The open orders returned from IB</returns>\n        public abstract List<Order> GetOpenOrders();\n\n        /// <summary>\n        /// Gets all holdings for the account\n        /// </summary>\n        /// <returns>The current holdings from the account</returns>\n        public abstract List<Holding> GetAccountHoldings();\n\n        /// <summary>\n        /// Gets the current cash balance for each currency held in the brokerage account\n        /// </summary>\n        /// <returns>The current cash balance for each currency available for trading</returns>\n        public abstract List<CashAmount> GetCashBalance();\n\n        /// <summary>\n        /// Specifies whether the brokerage will instantly update account balances\n        /// </summary>\n        public virtual bool AccountInstantlyUpdated => false;\n\n        /// <summary>\n        /// Returns the brokerage account's base currency\n        /// </summary>\n        public virtual string AccountBaseCurrency { get; protected set; }\n\n        /// <summary>\n        /// Gets the history for the requested security\n        /// </summary>\n        /// <param name=\"request\">The historical data request</param>\n        /// <returns>An enumerable of bars covering the span specified in the request</returns>\n        public virtual IEnumerable<BaseData> GetHistory(HistoryRequest request)\n        {\n            return Enumerable.Empty<BaseData>();\n        }\n\n        /// <summary>\n        /// Gets the position that might result given the specified order direction and the current holdings quantity.\n        /// This is useful for brokerages that require more specific direction information than provided by the OrderDirection enum\n        /// (e.g. Tradier differentiates Buy/Sell and BuyToOpen/BuyToCover/SellShort/SellToClose)\n        /// </summary>\n        /// <param name=\"orderDirection\">The order direction</param>\n        /// <param name=\"holdingsQuantity\">The current holdings quantity</param>\n        /// <returns>The order position</returns>\n        protected static OrderPosition GetOrderPosition(OrderDirection orderDirection, decimal holdingsQuantity)\n        {\n            return BrokerageExtensions.GetOrderPosition(orderDirection, holdingsQuantity);\n        }\n\n        #region IBrokerageCashSynchronizer implementation\n\n        /// <summary>\n        /// Gets the date of the last sync (New York time zone)\n        /// </summary>\n        protected DateTime LastSyncDate => LastSyncDateTimeUtc.ConvertFromUtc(TimeZones.NewYork).Date;\n\n        /// <summary>\n        /// Gets the datetime of the last sync (UTC)\n        /// </summary>\n        public DateTime LastSyncDateTimeUtc => new DateTime(Interlocked.Read(ref _lastSyncTimeTicks));\n\n        /// <summary>\n        /// Returns whether the brokerage should perform the cash synchronization\n        /// </summary>\n        /// <param name=\"currentTimeUtc\">The current time (UTC)</param>\n        /// <returns>True if the cash sync should be performed</returns>\n        public virtual bool ShouldPerformCashSync(DateTime currentTimeUtc)\n        {\n            // every morning flip this switch back\n            var currentTimeNewYork = currentTimeUtc.ConvertFromUtc(TimeZones.NewYork);\n            if (_syncedLiveBrokerageCashToday && currentTimeNewYork.Date != LastSyncDate)\n            {\n                _syncedLiveBrokerageCashToday = false;\n            }\n\n            return !_syncedLiveBrokerageCashToday && currentTimeNewYork.TimeOfDay >= LiveBrokerageCashSyncTime;\n        }\n\n        /// <summary>\n        /// Synchronizes the cashbook with the brokerage account\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"currentTimeUtc\">The current time (UTC)</param>\n        /// <param name=\"getTimeSinceLastFill\">A function which returns the time elapsed since the last fill</param>\n        /// <returns>True if the cash sync was performed successfully</returns>\n        public virtual bool PerformCashSync(IAlgorithm algorithm, DateTime currentTimeUtc, Func<TimeSpan> getTimeSinceLastFill)\n        {\n            try\n            {\n                // prevent reentrance in this method\n                if (!Monitor.TryEnter(_performCashSyncReentranceGuard))\n                {\n                    Log.Trace(\"Brokerage.PerformCashSync(): Reentrant call, cash sync not performed\");\n                    return false;\n                }\n\n                Log.Trace(\"Brokerage.PerformCashSync(): Sync cash balance\");\n\n                List<CashAmount> balances = null;\n                try\n                {\n                    balances = GetCashBalance();\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err, \"Error in GetCashBalance:\");\n                }\n\n                // empty cash balance is valid, if there was No error/exception\n                if (balances == null)\n                {\n                    Log.Trace(\"Brokerage.PerformCashSync(): No cash balances available, cash sync not performed\");\n                    return false;\n                }\n\n                // Adds currency to the cashbook that the user might have deposited\n                foreach (var balance in balances)\n                {\n                    if (!algorithm.Portfolio.CashBook.ContainsKey(balance.Currency))\n                    {\n                        if (!CashAmountUtil.ShouldAddCashBalance(balance, algorithm.AccountCurrency))\n                        {\n                            Log.Trace($\"Brokerage.PerformCashSync(): Skipping {balance.Currency} cash because quantity is zero\");\n                            continue;\n                        }\n                        Log.Trace($\"Brokerage.PerformCashSync(): Unexpected cash found {balance.Currency} {balance.Amount}\", true);\n                        algorithm.Portfolio.SetCash(balance.Currency, balance.Amount, 0);\n                    }\n                }\n\n                var totalPorfolioValueThreshold = algorithm.Portfolio.TotalPortfolioValue * 0.02m;\n                // if we were returned our balances, update everything and flip our flag as having performed sync today\n                foreach (var kvp in algorithm.Portfolio.CashBook)\n                {\n                    var cash = kvp.Value;\n\n                    //update the cash if the entry if found in the balances\n                    var balanceCash = balances.Find(balance => balance.Currency == cash.Symbol);\n                    if (balanceCash != default(CashAmount))\n                    {\n                        // compare in account currency\n                        var delta = cash.Amount - balanceCash.Amount;\n                        if (cash.ConversionRate == 0 || Math.Abs(algorithm.Portfolio.CashBook.ConvertToAccountCurrency(delta, cash.Symbol)) > totalPorfolioValueThreshold)\n                        {\n                            // log the delta between\n                            Log.Trace($\"Brokerage.PerformCashSync(): {balanceCash.Currency} Delta: {delta:0.00}\", true);\n                        }\n                        algorithm.Portfolio.CashBook[cash.Symbol].SetAmount(balanceCash.Amount);\n                    }\n                    else\n                    {\n                        //Set the cash amount to zero if cash entry not found in the balances\n                        Log.Trace($\"Brokerage.PerformCashSync(): {cash.Symbol} was not found in brokerage cash balance, setting the amount to 0\", true);\n                        algorithm.Portfolio.CashBook[cash.Symbol].SetAmount(0);\n                    }\n                }\n                _syncedLiveBrokerageCashToday = true;\n                _lastSyncTimeTicks = currentTimeUtc.Ticks;\n            }\n            finally\n            {\n                Monitor.Exit(_performCashSyncReentranceGuard);\n            }\n\n            // fire off this task to check if we've had recent fills, if we have then we'll invalidate the cash sync\n            // and do it again until we're confident in it\n            Task.Delay(TimeSpan.FromSeconds(10)).ContinueWith(_ =>\n                {\n                    // we want to make sure this is a good value, so check for any recent fills\n                    if (getTimeSinceLastFill() <= TimeSpan.FromSeconds(20))\n                    {\n                        // this will cause us to come back in and reset cash again until we\n                        // haven't processed a fill for +- 10 seconds of the set cash time\n                        _syncedLiveBrokerageCashToday = false;\n                        //_failedCashSyncAttempts = 0;\n                        Log.Trace(\"Brokerage.PerformCashSync(): Unverified cash sync - resync required.\");\n                    }\n                    else\n                    {\n                        Log.Trace(\"Brokerage.PerformCashSync(): Verified cash sync.\");\n\n                        algorithm.Portfolio.LogMarginInformation();\n                    }\n                });\n\n            return true;\n        }\n\n        #endregion\n\n        #region CrossZeroOrder implementation\n\n        /// <summary>\n        /// A dictionary to store the relationship between brokerage crossing orders and Lean orer id.\n        /// </summary>\n        private readonly ConcurrentDictionary<int, CrossZeroSecondOrderRequest> _leanOrderByBrokerageCrossingOrders = new();\n\n        /// <summary>\n        /// An object used to lock the critical section in the <see cref=\"TryGetOrRemoveCrossZeroOrder\"/> method,\n        /// ensuring thread safety when accessing the order collection.\n        /// </summary>\n        private object _lockCrossZeroObject = new();\n\n        /// <summary>\n        /// A thread-safe dictionary that maps brokerage order IDs to their corresponding Order objects.\n        /// </summary>\n        /// <remarks>\n        /// This ConcurrentDictionary is used to maintain a mapping between Zero Cross brokerage order IDs and Lean Order objects.\n        /// The dictionary is protected and read-only, ensuring that it can only be modified by the class that declares it and cannot\n        /// be assigned a new instance after initialization.\n        /// </remarks>\n        protected ConcurrentDictionary<string, Order> LeanOrderByZeroCrossBrokerageOrderId { get; } = new();\n\n        /// <summary>\n        /// Places an order that crosses zero (transitions from a short position to a long position or vice versa) and returns the response.\n        /// This method should be overridden in a derived class to implement brokerage-specific logic for placing such orders.\n        /// </summary>\n        /// <param name=\"crossZeroOrderRequest\">The request object containing details of the cross zero order to be placed.</param>\n        /// <param name=\"isPlaceOrderWithLeanEvent\">\n        /// A boolean indicating whether the order should be placed with triggering a Lean event.\n        /// Default is <c>true</c>, meaning Lean events will be triggered.\n        /// </param>\n        /// <returns>\n        /// A <see cref=\"CrossZeroOrderResponse\"/> object indicating the result of the order placement.\n        /// </returns>\n        /// <exception cref=\"NotImplementedException\">\n        /// Thrown if the method is not overridden in a derived class.\n        /// </exception>\n        protected virtual CrossZeroOrderResponse PlaceCrossZeroOrder(CrossZeroFirstOrderRequest crossZeroOrderRequest, bool isPlaceOrderWithLeanEvent = true)\n        {\n            throw new NotImplementedException($\"{nameof(PlaceCrossZeroOrder)} method should be overridden in the derived class to handle brokerage-specific logic.\");\n        }\n\n        /// <summary>\n        /// Attempts to place an order that may cross the zero position.\n        /// If the order needs to be split into two parts due to crossing zero,\n        /// this method handles the split and placement accordingly.\n        /// </summary>\n        /// <param name=\"order\">The order to be placed. Must not be <c>null</c>.</param>\n        /// <param name=\"holdingQuantity\">The current holding quantity of the order's symbol.</param>\n        /// <returns>\n        /// <para><c>true</c> if the order crosses zero and the first part was successfully placed;</para>\n        /// <para><c>false</c> if the first part of the order could not be placed;</para>\n        /// <para><c>null</c> if the order does not cross zero.</para>\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">\n        /// Thrown if <paramref name=\"order\"/> is <c>null</c>.\n        /// </exception>\n        protected bool? TryCrossZeroPositionOrder(Order order, decimal holdingQuantity)\n        {\n            if (order == null)\n            {\n                throw new ArgumentNullException(nameof(order), \"The order parameter cannot be null.\");\n            }\n\n            // do we need to split the order into two pieces?\n            var crossesZero = BrokerageExtensions.OrderCrossesZero(holdingQuantity, order.Quantity);\n            if (crossesZero)\n            {\n                // first we need an order to close out the current position\n                var (firstOrderQuantity, secondOrderQuantity) = GetQuantityOnCrossPosition(holdingQuantity, order.Quantity);\n\n                // Note: original quantity - already sell\n                var firstOrderPartRequest = new CrossZeroFirstOrderRequest(order, order.Type, firstOrderQuantity, holdingQuantity,\n                    GetOrderPosition(order.Direction, holdingQuantity));\n\n                // we actually can't place this order until the closingOrder is filled\n                // create another order for the rest, but we'll convert the order type to not be a stop\n                // but a market or a limit order\n                var secondOrderPartRequest = new CrossZeroSecondOrderRequest(order, order.Type, secondOrderQuantity, 0m,\n                    GetOrderPosition(order.Direction, 0m), firstOrderPartRequest);\n\n                _leanOrderByBrokerageCrossingOrders.AddOrUpdate(order.Id, secondOrderPartRequest);\n\n                CrossZeroOrderResponse response;\n                lock (_lockCrossZeroObject)\n                {\n                    // issue the first order to close the position\n                    response = PlaceCrossZeroOrder(firstOrderPartRequest);\n                    if (response.IsOrderPlacedSuccessfully)\n                    {\n                        var orderId = response.BrokerageOrderId;\n                        if (!order.BrokerId.Contains(orderId))\n                        {\n                            order.BrokerId.Add(orderId);\n                        }\n                    }\n                }\n\n                if (!response.IsOrderPlacedSuccessfully)\n                {\n                    OnOrderEvent(new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero, $\"{nameof(Brokerage)}: {response.Message}\")\n                    {\n                        Status = OrderStatus.Invalid\n                    });\n                    // remove the contingent order if we weren't successful in placing the first\n                    //ContingentOrderQueue contingent;\n                    _leanOrderByBrokerageCrossingOrders.TryRemove(order.Id, out _);\n                    return false;\n                }\n                return true;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Determines whether the given Lean order crosses zero quantity based on the initial order quantity.\n        /// </summary>\n        /// <param name=\"leanOrder\">The Lean order to check.</param>\n        /// <param name=\"quantity\">The quantity to be updated based on whether the order crosses zero.</param>\n        /// <returns>\n        /// <c>true</c> if the Lean order does not cross zero quantity; otherwise, <c>false</c>.\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown when the <paramref name=\"leanOrder\"/> is null.</exception>\n        protected bool TryGetUpdateCrossZeroOrderQuantity(Order leanOrder, out decimal quantity)\n        {\n            if (leanOrder == null)\n            {\n                throw new ArgumentNullException(nameof(leanOrder), \"The provided leanOrder cannot be null.\");\n            }\n\n            // Check if the order is a CrossZeroOrder.\n            if (_leanOrderByBrokerageCrossingOrders.TryGetValue(leanOrder.Id, out var crossZeroOrderRequest))\n            {\n                // If it is a CrossZeroOrder, use the first part of the quantity for the update.\n                quantity = crossZeroOrderRequest.FirstPartCrossZeroOrder.OrderQuantity;\n                // If the quantities of the LeanOrder do not match, return false. Don't support.\n                if (crossZeroOrderRequest.LeanOrder.Quantity != leanOrder.Quantity)\n                {\n                    return false;\n                }\n            }\n            else\n            {\n                // If it is not a CrossZeroOrder, use the original order quantity.\n                quantity = leanOrder.Quantity;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Attempts to retrieve or remove a cross-zero order based on the brokerage order ID and its filled status.\n        /// </summary>\n        /// <param name=\"brokerageOrderId\">The unique identifier of the brokerage order.</param>\n        /// <param name=\"leanOrderStatus\">The updated status of the order received from the brokerage</param>\n        /// <param name=\"leanOrder\">\n        /// When this method returns, contains the <see cref=\"Order\"/> object associated with the given brokerage order ID,\n        /// if the operation was successful; otherwise, null.\n        /// This parameter is passed uninitialized.\n        /// </param>\n        /// <returns>\n        /// <c>true</c> if the method successfully retrieves or removes the order; otherwise, <c>false</c>.\n        /// </returns>\n        /// <remarks>\n        /// The method locks on a private object to ensure thread safety while accessing the collection of orders.\n        /// If the order is filled, it is removed from the collection. If the order is partially filled,\n        /// it is retrieved but not removed. If the order is not found, the method returns <c>false</c>.\n        /// </remarks>\n        protected bool TryGetOrRemoveCrossZeroOrder(string brokerageOrderId, OrderStatus leanOrderStatus, out Order leanOrder)\n        {\n            lock (_lockCrossZeroObject)\n            {\n                if (LeanOrderByZeroCrossBrokerageOrderId.TryGetValue(brokerageOrderId, out leanOrder))\n                {\n                    switch (leanOrderStatus)\n                    {\n                        case OrderStatus.Filled:\n                        case OrderStatus.Canceled:\n                        case OrderStatus.Invalid:\n                            LeanOrderByZeroCrossBrokerageOrderId.TryRemove(brokerageOrderId, out var _);\n                            break;\n                    }\n                    return true;\n                }\n                // Return false if the brokerage order ID does not correspond to a cross-zero order\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Attempts to handle any remaining orders that cross the zero boundary.\n        /// </summary>\n        /// <param name=\"leanOrder\">The order object that needs to be processed.</param>\n        /// <param name=\"orderEvent\">The event object containing order event details.</param>\n        protected bool TryHandleRemainingCrossZeroOrder(Order leanOrder, OrderEvent orderEvent)\n        {\n            if (leanOrder != null && orderEvent != null && _leanOrderByBrokerageCrossingOrders.TryGetValue(leanOrder.Id, out var brokerageOrder))\n            {\n                switch (orderEvent.Status)\n                {\n                    case OrderStatus.Filled:\n                        // if we have a contingent that needs to be submitted then we can't respect the 'Filled' state from the order\n                        // because the Lean order hasn't been technically filled yet, so mark it as 'PartiallyFilled'\n                        orderEvent.Status = OrderStatus.PartiallyFilled;\n                        _leanOrderByBrokerageCrossingOrders.Remove(leanOrder.Id, out var _);\n                        break;\n                    case OrderStatus.Canceled:\n                    case OrderStatus.Invalid:\n                        _leanOrderByBrokerageCrossingOrders.Remove(leanOrder.Id, out var _);\n                        return false;\n                    default:\n                        return false;\n                }\n\n                OnOrderEvent(orderEvent);\n\n                Task.Run(() =>\n                {\n#pragma warning disable CA1031 // Do not catch general exception types\n                    try\n                    {\n                        var response = default(CrossZeroOrderResponse);\n                        lock (_lockCrossZeroObject)\n                        {\n                            Log.Trace($\"{nameof(Brokerage)}.{nameof(TryHandleRemainingCrossZeroOrder)}: Submit the second part of cross order by Id:{leanOrder.Id}\");\n                            response = PlaceCrossZeroOrder(brokerageOrder, false);\n\n                            if (response.IsOrderPlacedSuccessfully)\n                            {\n                                // add the new brokerage id for retrieval later\n                                var orderId = response.BrokerageOrderId;\n                                if (!leanOrder.BrokerId.Contains(orderId))\n                                {\n                                    leanOrder.BrokerId.Add(orderId);\n                                }\n\n                                // leanOrder is a clone, here we can add the new brokerage order Id for the second part of the cross zero\n                                OnOrderIdChangedEvent(new BrokerageOrderIdChangedEvent { OrderId = leanOrder.Id, BrokerId = leanOrder.BrokerId });\n                                LeanOrderByZeroCrossBrokerageOrderId.AddOrUpdate(orderId, leanOrder);\n                            }\n                        }\n\n                        if (!response.IsOrderPlacedSuccessfully)\n                        {\n                            // if we failed to place this order I don't know what to do, we've filled the first part\n                            // and failed to place the second... strange. Should we invalidate the rest of the order??\n                            Log.Error($\"{nameof(Brokerage)}.{nameof(TryHandleRemainingCrossZeroOrder)}: Failed to submit contingent order.\");\n                            var message = $\"{leanOrder.Symbol} Failed submitting the second part of cross order for \" +\n                                $\"LeanOrderId: {leanOrder.Id.ToStringInvariant()} Filled - BrokerageOrderId: {response.BrokerageOrderId}. \" +\n                                $\"{response.Message}\";\n                            OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Warning, \"CrossZeroFailed\", message));\n                            OnOrderEvent(new OrderEvent(leanOrder, DateTime.UtcNow, OrderFee.Zero) { Status = OrderStatus.Canceled });\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err);\n                        OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Warning, \"CrossZeroOrderError\", \"Error occurred submitting cross zero order: \" + err.Message));\n                        OnOrderEvent(new OrderEvent(leanOrder, DateTime.UtcNow, OrderFee.Zero) { Status = OrderStatus.Canceled });\n                    }\n#pragma warning restore CA1031 // Do not catch general exception types\n                });\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Calculates the quantities needed to close the current position and establish a new position based on the provided order.\n        /// </summary>\n        /// <param name=\"holdingQuantity\">The quantity currently held in the position that needs to be closed.</param>\n        /// <param name=\"orderQuantity\">The quantity defined in the new order to be established.</param>\n        /// <returns>\n        /// A tuple containing:\n        /// <list type=\"bullet\">\n        /// <item>\n        /// <description>The quantity needed to close the current position (negative value).</description>\n        /// </item>\n        /// <item>\n        /// <description>The quantity needed to establish the new position.</description>\n        /// </item>\n        /// </list>\n        /// </returns>\n        private static (decimal closePostionQunatity, decimal newPositionQuantity) GetQuantityOnCrossPosition(decimal holdingQuantity, decimal orderQuantity)\n        {\n            // first we need an order to close out the current position\n            var firstOrderQuantity = -holdingQuantity;\n            var secondOrderQuantity = orderQuantity - firstOrderQuantity;\n\n            return (firstOrderQuantity, secondOrderQuantity);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Brokerages/BrokerageConcurrentMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Brokerage helper class to lock message stream while executing an action, for example placing an order\n    /// </summary>\n    public class BrokerageConcurrentMessageHandler<T> : IDisposable\n        where T : class\n    {\n        private readonly Action<T> _processMessages;\n        private readonly Queue<T> _messageBuffer;\n        private readonly ILock _lock;\n        private readonly ManualResetEventSlim _messagesProcessedEvent;\n        private readonly int _maxMessageBufferSize;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"processMessages\">The action to call for each new message</param>\n        public BrokerageConcurrentMessageHandler(Action<T> processMessages)\n            : this(processMessages, false)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"processMessages\">The action to call for each new message</param>\n        /// <param name=\"concurrencyEnabled\">Whether to enable concurrent order submission</param>\n        public BrokerageConcurrentMessageHandler(Action<T> processMessages, bool concurrencyEnabled)\n        {\n            _processMessages = processMessages;\n            _messageBuffer = new Queue<T>();\n            _lock = concurrencyEnabled ? new ReaderWriterLockWrapper() : new MonitorWrapper();\n            _messagesProcessedEvent = new ManualResetEventSlim(false);\n            _maxMessageBufferSize = Config.GetInt(\"brokerage-concurrent-message-handler-buffer-size\", 20);\n        }\n\n        /// <summary>\n        /// Disposes of the resources used by this instance\n        /// </summary>\n        public void Dispose()\n        {\n            _lock.Dispose();\n            _messagesProcessedEvent.Dispose();\n        }\n\n        /// <summary>\n        /// Will process or enqueue a message for later processing it\n        /// </summary>\n        /// <param name=\"message\">The new message</param>\n        public void HandleNewMessage(T message)\n        {\n            lock (_messageBuffer)\n            {\n                if (_lock.TryEnterReadLockImmediately())\n                {\n                    try\n                    {\n                        ProcessMessages(message);\n                    }\n                    finally\n                    {\n                        _lock.ExitReadLock();\n                    }\n                }\n                else if (message != default)\n                {\n                    // if someone has the lock just enqueue the new message they will process any remaining messages\n                    // if by chance they are about to free the lock, no worries, we will always process first any remaining message first see 'ProcessMessages'\n                    _messageBuffer.Enqueue(message);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Lock the streaming processing while we're sending orders as sometimes they fill before the call returns.\n        /// </summary>\n        public void WithLockedStream(Action code)\n        {\n            // Let's limit the amount of messages we can buffer, so we wait until\n            // consumers process a full queue of messages before we potentially add more\n            var queueIsFull = false;\n            lock (_messageBuffer)\n            {\n                queueIsFull = _messageBuffer.Count >= _maxMessageBufferSize;\n            }\n            if (queueIsFull)\n            {\n                _messagesProcessedEvent.Wait();\n                _messagesProcessedEvent.Reset();\n            }\n\n            _lock.EnterWriteLock();\n            try\n            {\n                code();\n            }\n            finally\n            {\n                // once we finish our 'code' we will process any message that come through,\n                // to make sure no message get's left behind (race condition between us finishing 'ProcessMessages'\n                // and some message being enqueued to it, we just take a lock on the buffer\n                lock (_messageBuffer)\n                {\n                    var lockedStreams = _lock.CurrentWriteCount;\n\n                    // we release the semaphore first so by the time we release '_messageBuffer' any new message is processed immediately and not enqueued\n                    _lock.ExitWriteLock();\n                    // only process if no other threads will process them after us\n                    if (lockedStreams == 1)\n                    {\n                        ProcessMessages();\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Process any pending message and the provided one if any\n        /// </summary>\n        /// <remarks>To be called owing the stream lock</remarks>\n        private void ProcessMessages(T message = null)\n        {\n            try\n            {\n                if (message != null)\n                {\n                    _messageBuffer.Enqueue(message);\n                }\n\n                // double check there isn't any pending message\n                while (_messageBuffer.TryDequeue(out var e))\n                {\n                    try\n                    {\n                        _processMessages(e);\n                    }\n                    catch (Exception ex)\n                    {\n                        Log.Error(ex);\n                    }\n                }\n            }\n            finally\n            {\n                _messagesProcessedEvent.Set();\n            }\n        }\n\n        private interface ILock : IDisposable\n        {\n            int CurrentWriteCount { get; }\n\n            void ExitReadLock();\n\n            bool TryEnterReadLockImmediately();\n\n            void EnterWriteLock();\n\n            void ExitWriteLock();\n        }\n\n        /// <summary>\n        /// A simple reader/writer lock implementation that allows us to switch the meaning of read and write locks\n        /// so that it can be used for single reader and multiple writers scenario.\n        ///\n        /// We want to allow multiple producers so, for example, a brokerage can be placing multiple orders concurrently,\n        /// since the transaction handler can have multiple threads processing orders.\n        /// But, on the other side, we need to ensure that messages are processed only when no producers are writing\n        /// to the stream (hence only one reader). For example, a brokerage needs the to lock the stream and\n        /// only handle incoming order event messages after it releases the lock, but we now support multiple streams\n        /// (so multiple orders) so we wait for all the current producers to release the lock before processing any messages.\n        /// </summary>\n        private class ReaderWriterLockWrapper : ILock\n        {\n            private readonly ReaderWriterLockSlim _lock;\n\n            public int CurrentWriteCount => _lock.CurrentReadCount;\n\n            public ReaderWriterLockWrapper()\n            {\n                _lock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);\n            }\n            public void ExitReadLock() => _lock.ExitWriteLock();\n            public bool TryEnterReadLockImmediately() => _lock.TryEnterWriteLock(0);\n            public void EnterWriteLock() => _lock.EnterReadLock();\n            public void ExitWriteLock() => _lock.ExitReadLock();\n\n            public void Dispose()\n            {\n                _lock.Dispose();\n            }\n        }\n\n        private class MonitorWrapper : ILock\n        {\n            private readonly object _lockObject;\n\n            private long _currentWriteCount;\n\n            public int CurrentWriteCount => (int)Interlocked.Read(ref _currentWriteCount);\n\n            public MonitorWrapper()\n            {\n                _lockObject = new object();\n            }\n\n            public void ExitReadLock() => Monitor.Exit(_lockObject);\n\n            public bool TryEnterReadLockImmediately() => Monitor.TryEnter(_lockObject);\n\n            public void EnterWriteLock()\n            {\n                Monitor.Enter(_lockObject);\n                Interlocked.Exchange(ref _currentWriteCount, 1);\n            }\n\n            public void ExitWriteLock()\n            {\n                Interlocked.Exchange(ref _currentWriteCount, 0);\n                Monitor.Exit(_lockObject);\n            }\n\n            public void Dispose()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/BrokerageException.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents an error retuned from a broker's server\n    /// </summary>\n    public class BrokerageException : Exception\n    {\n        /// <summary>\n        /// Creates a new BrokerageException with the specified message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public BrokerageException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new BrokerageException with the specified message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"inner\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public BrokerageException(string message, Exception inner)\n            : base(message, inner)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/BrokerageFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides a base implementation of IBrokerageFactory that provides a helper for reading data from a job's brokerage data dictionary\n    /// </summary>\n    public abstract class BrokerageFactory : IBrokerageFactory\n    {\n        private readonly Type _brokerageType;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public abstract void Dispose();\n\n        /// <summary>\n        /// Gets the type of brokerage produced by this factory\n        /// </summary>\n        public Type BrokerageType\n        {\n            get { return _brokerageType; }\n        }\n\n        /// <summary>\n        /// Gets the brokerage data required to run the brokerage from configuration/disk\n        /// </summary>\n        /// <remarks>\n        /// The implementation of this property will create the brokerage data dictionary required for\n        /// running live jobs. See <see cref=\"IJobQueueHandler.NextJob\"/>\n        /// </remarks>\n        public abstract Dictionary<string, string> BrokerageData { get; }\n\n        /// <summary>\n        /// Gets a brokerage model that can be used to model this brokerage's unique behaviors\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider</param>\n        public abstract IBrokerageModel GetBrokerageModel(IOrderProvider orderProvider);\n\n        /// <summary>\n        /// Creates a new IBrokerage instance\n        /// </summary>\n        /// <param name=\"job\">The job packet to create the brokerage for</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>A new brokerage instance</returns>\n        public abstract IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm);\n\n        /// <summary>\n        /// Gets a brokerage message handler\n        /// </summary>\n        public virtual IBrokerageMessageHandler CreateBrokerageMessageHandler(IAlgorithm algorithm, AlgorithmNodePacket job, IApi api)\n        {\n            return new DefaultBrokerageMessageHandler(algorithm, job, api);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageFactory\"/> class for the specified <paramref name=\"brokerageType\"/>\n        /// </summary>\n        /// <param name=\"brokerageType\">The type of brokerage created by this factory</param>\n        protected BrokerageFactory(Type brokerageType)\n        {\n            _brokerageType = brokerageType;\n        }\n\n        /// <summary>\n        /// Reads a value from the brokerage data, adding an error if the key is not found\n        /// </summary>\n        protected static T Read<T>(IReadOnlyDictionary<string, string> brokerageData, string key, ICollection<string> errors)\n            where T : IConvertible\n        {\n            string value;\n            if (!brokerageData.TryGetValue(key, out value))\n            {\n                errors.Add(\"BrokerageFactory.CreateBrokerage(): Missing key: \" + key);\n                return default(T);\n            }\n\n            try\n            {\n                return value.ConvertTo<T>();\n            }\n            catch (Exception err)\n            {\n                errors.Add($\"BrokerageFactory.CreateBrokerage(): Error converting key '{key}' with value '{value}'. {err.Message}\");\n                return default(T);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Brokerages/BrokerageMultiWebSocketEntry.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Helper class for <see cref=\"BrokerageMultiWebSocketSubscriptionManager\"/>\n    /// </summary>\n    public class BrokerageMultiWebSocketEntry\n    {\n        private readonly Dictionary<Symbol, int> _symbolWeights;\n        private readonly List<Symbol> _symbols;\n        private readonly object _locker = new();\n\n        /// <summary>\n        /// Gets the web socket instance\n        /// </summary>\n        public IWebSocket WebSocket { get; }\n\n        /// <summary>\n        /// Gets the sum of symbol weights for this web socket\n        /// </summary>\n        public int TotalWeight { get; private set; }\n\n        /// <summary>\n        /// Gets the number of symbols subscribed\n        /// </summary>\n        public int SymbolCount\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _symbols.Count;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns whether the symbol is subscribed\n        /// </summary>\n        /// <param name=\"symbol\"></param>\n        /// <returns></returns>\n        public bool Contains(Symbol symbol)\n        {\n            lock (_locker)\n            {\n                return _symbols.Contains(symbol);\n            }\n        }\n\n        /// <summary>\n        /// Returns the list of subscribed symbols\n        /// </summary>\n        /// <returns></returns>\n        public IReadOnlyCollection<Symbol> Symbols\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _symbols.ToList();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageMultiWebSocketEntry\"/> class\n        /// </summary>\n        /// <param name=\"symbolWeights\">A dictionary of symbol weights</param>\n        /// <param name=\"webSocket\">The web socket instance</param>\n        public BrokerageMultiWebSocketEntry(Dictionary<Symbol, int> symbolWeights, IWebSocket webSocket)\n        {\n            _symbolWeights = symbolWeights;\n            _symbols = new List<Symbol>();\n\n            WebSocket = webSocket;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageMultiWebSocketEntry\"/> class\n        /// </summary>\n        /// <param name=\"webSocket\">The web socket instance</param>\n        public BrokerageMultiWebSocketEntry(IWebSocket webSocket)\n            : this(null, webSocket)\n        {\n        }\n\n        /// <summary>\n        /// Adds a symbol to the entry\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to add</param>\n        public void AddSymbol(Symbol symbol)\n        {\n            lock (_locker)\n            {\n                _symbols.Add(symbol);\n            }\n\n            if (_symbolWeights != null && _symbolWeights.TryGetValue(symbol, out var weight))\n            {\n                TotalWeight += weight;\n            }\n        }\n\n        /// <summary>\n        /// Removes a symbol from the entry\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to remove</param>\n        public void RemoveSymbol(Symbol symbol)\n        {\n            lock (_locker)\n            {\n                _symbols.Remove(symbol);\n            }\n\n            if (_symbolWeights != null && _symbolWeights.TryGetValue(symbol, out var weight))\n            {\n                TotalWeight -= weight;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Handles brokerage data subscriptions with multiple websocket connections, with optional symbol weighting\n    /// </summary>\n    public class BrokerageMultiWebSocketSubscriptionManager : EventBasedDataQueueHandlerSubscriptionManager, IDisposable\n    {\n        private readonly string _webSocketUrl;\n        private readonly int _maximumSymbolsPerWebSocket;\n        private readonly int _maximumWebSocketConnections;\n        private readonly Func<WebSocketClientWrapper> _webSocketFactory;\n        private readonly Func<IWebSocket, Symbol, bool> _subscribeFunc;\n        private readonly Func<IWebSocket, Symbol, bool> _unsubscribeFunc;\n        private readonly Action<WebSocketMessage> _messageHandler;\n        private readonly RateGate _connectionRateLimiter;\n        private readonly System.Timers.Timer _reconnectTimer;\n\n        private const int ConnectionTimeout = 30000;\n\n        private readonly object _locker = new();\n        private readonly List<BrokerageMultiWebSocketEntry> _webSocketEntries = new();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageMultiWebSocketSubscriptionManager\"/> class\n        /// </summary>\n        /// <param name=\"webSocketUrl\">The URL for websocket connections</param>\n        /// <param name=\"maximumSymbolsPerWebSocket\">The maximum number of symbols per websocket connection</param>\n        /// <param name=\"maximumWebSocketConnections\">The maximum number of websocket connections allowed (if zero, symbol weighting is disabled)</param>\n        /// <param name=\"symbolWeights\">A dictionary for the symbol weights</param>\n        /// <param name=\"webSocketFactory\">A function which returns a new websocket instance</param>\n        /// <param name=\"subscribeFunc\">A function which subscribes a symbol</param>\n        /// <param name=\"unsubscribeFunc\">A function which unsubscribes a symbol</param>\n        /// <param name=\"messageHandler\">The websocket message handler</param>\n        /// <param name=\"webSocketConnectionDuration\">The maximum duration of the websocket connection, TimeSpan.Zero for no duration limit</param>\n        /// <param name=\"connectionRateLimiter\">The rate limiter for creating new websocket connections</param>\n        public BrokerageMultiWebSocketSubscriptionManager(\n            string webSocketUrl,\n            int maximumSymbolsPerWebSocket,\n            int maximumWebSocketConnections,\n            Dictionary<Symbol, int> symbolWeights,\n            Func<WebSocketClientWrapper> webSocketFactory,\n            Func<IWebSocket, Symbol, bool> subscribeFunc,\n            Func<IWebSocket, Symbol, bool> unsubscribeFunc,\n            Action<WebSocketMessage> messageHandler,\n            TimeSpan webSocketConnectionDuration,\n            RateGate connectionRateLimiter = null)\n        {\n            _webSocketUrl = webSocketUrl;\n            _maximumSymbolsPerWebSocket = maximumSymbolsPerWebSocket;\n            _maximumWebSocketConnections = maximumWebSocketConnections;\n            _webSocketFactory = webSocketFactory;\n            _subscribeFunc = subscribeFunc;\n            _unsubscribeFunc = unsubscribeFunc;\n            _messageHandler = messageHandler;\n            // let's use a reasonable default, no API will like to get DOS on reconnections. 50 WS will take 120s\n            _connectionRateLimiter = connectionRateLimiter ?? new RateGate(5, TimeSpan.FromSeconds(12));\n\n            if (_maximumWebSocketConnections > 0)\n            {\n                // symbol weighting enabled, create all websocket instances\n                for (var i = 0; i < _maximumWebSocketConnections; i++)\n                {\n                    var webSocket = CreateWebSocket();\n\n                    _webSocketEntries.Add(new BrokerageMultiWebSocketEntry(symbolWeights, webSocket));\n                }\n            }\n\n            // Some exchanges (e.g. Binance) require a daily restart for websocket connections\n            if (webSocketConnectionDuration != TimeSpan.Zero)\n            {\n                _reconnectTimer = new System.Timers.Timer\n                {\n                    Interval = webSocketConnectionDuration.TotalMilliseconds\n                };\n                _reconnectTimer.Elapsed += (_, _) =>\n                {\n                    List<BrokerageMultiWebSocketEntry> webSocketEntries;\n                    lock (_locker)\n                    {\n                        // let's make a copy so we don't hold the lock\n                        webSocketEntries = _webSocketEntries.ToList();\n                    }\n\n                    Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager(): Restarting {webSocketEntries.Count} websocket connections\");\n\n                    Parallel.ForEach(webSocketEntries, new ParallelOptions { MaxDegreeOfParallelism = 4 }, entry =>\n                    {\n                        if (entry.WebSocket.IsOpen)\n                        {\n                            Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager(): Websocket restart - disconnect: ({entry.WebSocket.GetHashCode()})\");\n                            Disconnect(entry.WebSocket);\n\n                            Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager(): Websocket restart - connect: ({entry.WebSocket.GetHashCode()})\");\n                            Connect(entry.WebSocket);\n                        }\n                    });\n                };\n                _reconnectTimer.Start();\n\n                Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager(): WebSocket connections will be restarted every: {webSocketConnectionDuration}\");\n            }\n        }\n\n        /// <summary>\n        /// Subscribes to the symbols\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to subscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        protected override bool Subscribe(IEnumerable<Symbol> symbols, TickType tickType)\n        {\n            Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager.Subscribe(): {string.Join(\",\", symbols.Select(x => x.Value))}\");\n\n            var success = true;\n\n            foreach (var symbol in symbols)\n            {\n                var webSocket = GetWebSocketForSymbol(symbol);\n\n                success &= _subscribeFunc(webSocket, symbol);\n            }\n\n            return success;\n        }\n\n        /// <summary>\n        /// Unsubscribes from the symbols\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to subscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        protected override bool Unsubscribe(IEnumerable<Symbol> symbols, TickType tickType)\n        {\n            Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager.Unsubscribe(): {string.Join(\",\", symbols.Select(x => x.Value))}\");\n\n            var success = true;\n\n            foreach (var symbol in symbols)\n            {\n                var entry = GetWebSocketEntryBySymbol(symbol);\n                if (entry != null)\n                {\n                    entry.RemoveSymbol(symbol);\n\n                    success &= _unsubscribeFunc(entry.WebSocket, symbol);\n                }\n            }\n\n            return success;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public override void Dispose()\n        {\n            _reconnectTimer?.Stop();\n            _reconnectTimer.DisposeSafely();\n            lock (_locker)\n            {\n                foreach (var entry in _webSocketEntries)\n                {\n                    try\n                    {\n                        entry.WebSocket.Open -= OnOpen;\n                        entry.WebSocket.Message -= EventHandler;\n                        entry.WebSocket.Close();\n                    }\n                    catch (Exception ex)\n                    {\n                        Log.Error(ex);\n                    }\n                }\n                _webSocketEntries.Clear();\n            }\n        }\n\n        private BrokerageMultiWebSocketEntry GetWebSocketEntryBySymbol(Symbol symbol)\n        {\n            lock (_locker)\n            {\n                foreach (var entry in _webSocketEntries.Where(entry => entry.Contains(symbol)))\n                {\n                    return entry;\n                }\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Adds a symbol to an existing or new websocket connection\n        /// </summary>\n        private IWebSocket GetWebSocketForSymbol(Symbol symbol)\n        {\n            BrokerageMultiWebSocketEntry entry;\n\n            lock (_locker)\n            {\n                if (_webSocketEntries.All(x => x.SymbolCount >= _maximumSymbolsPerWebSocket))\n                {\n                    if (_maximumWebSocketConnections > 0)\n                    {\n                        throw new NotSupportedException($\"Maximum symbol count reached for the current configuration [MaxSymbolsPerWebSocket={_maximumSymbolsPerWebSocket}, MaxWebSocketConnections:{_maximumWebSocketConnections}]\");\n                    }\n\n                    // symbol limit reached on all, create new websocket instance\n                    var webSocket = CreateWebSocket();\n\n                    _webSocketEntries.Add(new BrokerageMultiWebSocketEntry(webSocket));\n                }\n\n                // sort by weight ascending, taking into account the symbol limit per websocket\n                _webSocketEntries.Sort((x, y) =>\n                    x.SymbolCount >= _maximumSymbolsPerWebSocket\n                    ? 1\n                    : y.SymbolCount >= _maximumSymbolsPerWebSocket\n                        ? -1\n                        : Math.Sign(x.TotalWeight - y.TotalWeight));\n\n                entry = _webSocketEntries.First();\n            }\n\n            if (!entry.WebSocket.IsOpen)\n            {\n                Connect(entry.WebSocket);\n            }\n\n            entry.AddSymbol(symbol);\n\n            Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager.GetWebSocketForSymbol(): added symbol: {symbol} to websocket: {entry.WebSocket.GetHashCode()} - Count: {entry.SymbolCount}\");\n\n            return entry.WebSocket;\n        }\n\n        /// <summary>\n        /// When we create a websocket we will subscribe to it's events once and initialize it\n        /// </summary>\n        /// <remarks>Note that the websocket is no connected yet <see cref=\"Connect(IWebSocket)\"/></remarks>\n        private IWebSocket CreateWebSocket()\n        {\n            var webSocket = _webSocketFactory();\n            webSocket.Open += OnOpen;\n            webSocket.Message += EventHandler;\n            webSocket.Initialize(_webSocketUrl);\n\n            return webSocket;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void EventHandler(object _, WebSocketMessage message)\n        {\n            _messageHandler(message);\n        }\n\n        private void Connect(IWebSocket webSocket)\n        {\n            var connectedEvent = new ManualResetEvent(false);\n            EventHandler onOpenAction = (_, _) =>\n            {\n                connectedEvent.Set();\n            };\n\n            webSocket.Open += onOpenAction;\n\n            _connectionRateLimiter.WaitToProceed();\n\n            try\n            {\n                webSocket.Connect();\n\n                if (!connectedEvent.WaitOne(ConnectionTimeout))\n                {\n                    throw new TimeoutException($\"BrokerageMultiWebSocketSubscriptionManager.Connect(): WebSocket connection timeout: {webSocket.GetHashCode()}\");\n                }\n            }\n            finally\n            {\n                webSocket.Open -= onOpenAction;\n\n                connectedEvent.DisposeSafely();\n            }\n        }\n\n        private void Disconnect(IWebSocket webSocket)\n        {\n            webSocket.Close();\n        }\n\n        private void OnOpen(object sender, EventArgs e)\n        {\n            var webSocket = (IWebSocket)sender;\n\n            lock (_locker)\n            {\n                foreach (var entry in _webSocketEntries)\n                {\n                    if (entry.WebSocket == webSocket && entry.Symbols.Count > 0)\n                    {\n                        Log.Trace($\"BrokerageMultiWebSocketSubscriptionManager.Connect(): WebSocket opened: {webSocket.GetHashCode()} - Resubscribing existing symbols: {entry.Symbols.Count}\");\n\n                        Task.Factory.StartNew(() =>\n                        {\n                            foreach (var symbol in entry.Symbols)\n                            {\n                                _subscribeFunc(webSocket, symbol);\n                            }\n                        });\n                        break;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/CrossZero/CrossZeroFirstOrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\n\nnamespace QuantConnect.Brokerages.CrossZero\n{\n    /// <summary>\n    /// Represents a first request to cross zero order.\n    /// </summary>\n    public class CrossZeroFirstOrderRequest\n    {\n        /// <summary>\n        /// Gets the original lean order.\n        /// </summary>\n        public Order LeanOrder { get; }\n\n        /// <summary>\n        /// Gets the type of the order.\n        /// </summary>\n        public OrderType OrderType { get; }\n\n        /// <summary>\n        /// Gets the quantity of the order.\n        /// </summary>\n        public decimal OrderQuantity { get; }\n\n        /// <summary>\n        /// Gets the absolute quantity of the order.\n        /// </summary>\n        public decimal AbsoluteOrderQuantity => Math.Abs(OrderQuantity);\n\n        /// <summary>\n        /// Gets the current holding quantity of the order's symbol.\n        /// </summary>\n        public decimal OrderQuantityHolding { get; }\n\n        /// <summary>\n        /// Gets the position of the order.\n        /// </summary>\n        /// <value>\n        /// The position of the order, which depends on the <see cref=\"OrderQuantityHolding\"/>.\n        /// </value>\n        public OrderPosition OrderPosition { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CrossZeroFirstOrderRequest\"/> struct.\n        /// </summary>\n        /// <param name=\"leanOrder\">The lean order.</param>\n        /// <param name=\"orderType\">The type of the order.</param>\n        /// <param name=\"orderQuantity\">The quantity of the order.</param>\n        /// <param name=\"orderQuantityHolding\">The current holding quantity of the order's symbol.</param>\n        /// <param name=\"orderPosition\">The position of the order, which depends on the <paramref name=\"orderQuantityHolding\"/>.</param>\n        public CrossZeroFirstOrderRequest(Order leanOrder, OrderType orderType, decimal orderQuantity, decimal orderQuantityHolding, OrderPosition orderPosition)\n        {\n            LeanOrder = leanOrder;\n            OrderType = orderType;\n            OrderQuantity = orderQuantity;\n            OrderPosition = orderPosition;\n            OrderQuantityHolding = orderQuantityHolding;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/CrossZero/CrossZeroOrderResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages.CrossZero\n{\n    /// <summary>\n    /// Represents a response for a cross zero order request.\n    /// </summary>\n    public readonly struct CrossZeroOrderResponse\n    {\n        /// <summary>\n        /// Gets the brokerage order ID.\n        /// </summary>\n        public string BrokerageOrderId { get; }\n\n        /// <summary>\n        /// Gets a value indicating whether the order was placed successfully.\n        /// </summary>\n        public bool IsOrderPlacedSuccessfully { get; }\n\n        /// <summary>\n        /// Gets the message of the order.\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CrossZeroOrderResponse\"/> struct.\n        /// </summary>\n        /// <param name=\"brokerageOrderId\">The brokerage order ID.</param>\n        /// <param name=\"isOrderPlacedSuccessfully\">if set to <c>true</c> [is order placed successfully].</param>\n        /// <param name=\"message\">The message of the order. This parameter is optional and defaults to <c>null</c>.</param>\n        public CrossZeroOrderResponse(string brokerageOrderId, bool isOrderPlacedSuccessfully, string message = \"\")\n        {\n            Message = message;\n            BrokerageOrderId = brokerageOrderId;\n            IsOrderPlacedSuccessfully = isOrderPlacedSuccessfully;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/CrossZero/CrossZeroSecondOrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Brokerages.CrossZero\n{\n    /// <summary>\n    /// Represents a second request to cross zero order.\n    /// </summary>\n    public class CrossZeroSecondOrderRequest : CrossZeroFirstOrderRequest\n    {\n        /// <summary>\n        /// Gets or sets the first part of CrossZeroOrder.\n        /// </summary>\n        public CrossZeroFirstOrderRequest FirstPartCrossZeroOrder { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CrossZeroFirstOrderRequest\"/> struct.\n        /// </summary>\n        /// <param name=\"leanOrder\">The lean order.</param>\n        /// <param name=\"orderType\">The type of the order.</param>\n        /// <param name=\"orderQuantity\">The quantity of the order.</param>\n        /// <param name=\"orderQuantityHolding\">The current holding quantity of the order's symbol.</param>\n        /// <param name=\"orderPosition\">The position of the order, which depends on the <paramref name=\"orderQuantityHolding\"/>.</param>\n        /// <param name=\"crossZeroFirstOrder\">The first part of the cross zero order.</param>\n        public CrossZeroSecondOrderRequest(Order leanOrder, OrderType orderType, decimal orderQuantity, decimal orderQuantityHolding,\n            OrderPosition orderPosition, CrossZeroFirstOrderRequest crossZeroFirstOrder)\n            : base(leanOrder, ConvertStopCrossingOrderType(orderType), orderQuantity, orderQuantityHolding, orderPosition)\n        {\n            FirstPartCrossZeroOrder = crossZeroFirstOrder;\n        }\n\n        /// <summary>\n        /// Converts a stop order type to its corresponding market or limit order type.\n        /// </summary>\n        /// <param name=\"orderType\">The original order type to be converted.</param>\n        /// <returns>\n        /// The converted order type. If the original order type is <see cref=\"OrderType.StopMarket\"/>, \n        /// it returns <see cref=\"OrderType.Market\"/>. If the original order type is <see cref=\"OrderType.StopLimit\"/>,\n        /// it returns <see cref=\"OrderType.Limit\"/>. Otherwise, it returns the original order type.\n        /// </returns>\n        private static OrderType ConvertStopCrossingOrderType(OrderType orderType) => orderType switch\n        {\n            OrderType.StopMarket => OrderType.Market,\n            OrderType.StopLimit => OrderType.Limit,\n            _ => orderType\n        };\n    }\n}\n"
  },
  {
    "path": "Brokerages/DefaultConnectionHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// A default implementation of <see cref=\"IConnectionHandler\"/>\n    /// which signals disconnection if no data is received for a given time span\n    /// and attempts to reconnect automatically.\n    /// </summary>\n    public class DefaultConnectionHandler : IConnectionHandler\n    {\n        private CancellationTokenSource _cancellationTokenSource;\n        private Thread _connectionMonitorThread;\n\n        private bool _isEnabled;\n        private readonly object _lockerConnectionMonitor = new object();\n        private volatile bool _connectionLost;\n        private DateTime _lastDataReceivedTime;\n\n        /// <summary>\n        /// Event that fires when a connection loss is detected\n        /// </summary>\n        public event EventHandler ConnectionLost;\n\n        /// <summary>\n        /// Event that fires when a lost connection is restored\n        /// </summary>\n        public event EventHandler ConnectionRestored;\n\n        /// <summary>\n        /// Event that fires when a reconnection attempt is required\n        /// </summary>\n        public event EventHandler ReconnectRequested;\n\n        /// <summary>\n        /// The elapsed time with no received data after which a connection loss is reported\n        /// </summary>\n        public TimeSpan MaximumIdleTimeSpan { get; set; } = TimeSpan.FromSeconds(5);\n\n        /// <summary>\n        /// The minimum time in seconds to wait before attempting to reconnect\n        /// </summary>\n        public int MinimumSecondsForNextReconnectionAttempt { get; set; } = 1;\n\n        /// <summary>\n        /// The maximum time in seconds to wait before attempting to reconnect\n        /// </summary>\n        public int MaximumSecondsForNextReconnectionAttempt { get; set; } = 60;\n\n        /// <summary>\n        /// The unique Id for the connection\n        /// </summary>\n        public string ConnectionId { get; private set; }\n\n        /// <summary>\n        /// Returns true if the connection has been lost\n        /// </summary>\n        public bool IsConnectionLost => _connectionLost;\n\n        /// <summary>\n        /// Initializes the connection handler\n        /// </summary>\n        /// <param name=\"connectionId\">The connection id</param>\n        public void Initialize(string connectionId)\n        {\n            ConnectionId = connectionId;\n\n            using var waitHandle = new ManualResetEvent(false);\n\n            _cancellationTokenSource = new CancellationTokenSource();\n\n            _connectionMonitorThread = new Thread(() =>\n            {\n                waitHandle.Set();\n\n                var nextReconnectionAttemptUtcTime = DateTime.UtcNow;\n                var nextReconnectionAttemptSeconds = MinimumSecondsForNextReconnectionAttempt;\n\n                lock (_lockerConnectionMonitor)\n                {\n                    _lastDataReceivedTime = DateTime.UtcNow;\n                }\n\n                try\n                {\n                    while (!_cancellationTokenSource.IsCancellationRequested\n                        && !_cancellationTokenSource.Token.WaitHandle.WaitOne(Time.GetSecondUnevenWait(1000)))\n                    {\n                        if (!_isEnabled) continue;\n\n                        try\n                        {\n                            TimeSpan elapsed;\n                            lock (_lockerConnectionMonitor)\n                            {\n                                elapsed = DateTime.UtcNow - _lastDataReceivedTime;\n                            }\n\n                            if (!_connectionLost && elapsed > MaximumIdleTimeSpan)\n                            {\n                                _connectionLost = true;\n                                nextReconnectionAttemptUtcTime = DateTime.UtcNow.AddSeconds(nextReconnectionAttemptSeconds);\n\n                                OnConnectionLost();\n                            }\n                            else if (_connectionLost)\n                            {\n                                if (elapsed <= MaximumIdleTimeSpan)\n                                {\n                                    _connectionLost = false;\n                                    nextReconnectionAttemptSeconds = MinimumSecondsForNextReconnectionAttempt;\n\n                                    OnConnectionRestored();\n                                }\n                                else\n                                {\n                                    if (DateTime.UtcNow > nextReconnectionAttemptUtcTime)\n                                    {\n                                        // double the interval between attempts (capped to 1 minute)\n                                        nextReconnectionAttemptSeconds = Math.Min(nextReconnectionAttemptSeconds * 2, MaximumSecondsForNextReconnectionAttempt);\n                                        nextReconnectionAttemptUtcTime = DateTime.UtcNow.AddSeconds(nextReconnectionAttemptSeconds);\n\n                                        OnReconnectRequested();\n                                    }\n                                }\n                            }\n                        }\n                        catch (Exception exception)\n                        {\n                            Log.Error($\"Error in DefaultConnectionHandler: {exception}\");\n                        }\n                    }\n                }\n                catch (Exception exception)\n                {\n                    Log.Error(exception);\n                }\n            }) { IsBackground = true };\n\n            _connectionMonitorThread.Start();\n\n            waitHandle.WaitOne();\n        }\n\n        /// <summary>\n        /// Enables/disables monitoring of the connection\n        /// </summary>\n        /// <param name=\"isEnabled\">True to enable monitoring, false otherwise</param>\n        public void EnableMonitoring(bool isEnabled)\n        {\n            // if we are switching to enabled, initialize the last data received time\n            if (!_isEnabled && isEnabled)\n            {\n                KeepAlive(DateTime.UtcNow);\n            }\n\n            _isEnabled = isEnabled;\n        }\n\n        /// <summary>\n        /// Notifies the connection handler that new data was received\n        /// </summary>\n        /// <param name=\"lastDataReceivedTime\">The UTC timestamp of the last data point received</param>\n        public void KeepAlive(DateTime lastDataReceivedTime)\n        {\n            lock (_lockerConnectionMonitor)\n            {\n                _lastDataReceivedTime = lastDataReceivedTime;\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ConnectionLost\"/> event\n        /// </summary>\n        protected virtual void OnConnectionLost()\n        {\n            Log.Error(\"DefaultConnectionHandler.OnConnectionLost(): WebSocket connection lost.\");\n            ConnectionLost?.Invoke(this, EventArgs.Empty);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ConnectionRestored\"/> event\n        /// </summary>\n        protected virtual void OnConnectionRestored()\n        {\n            Log.Trace(\"DefaultConnectionHandler.OnConnectionRestored(): WebSocket connection restored.\");\n            ConnectionRestored?.Invoke(this, EventArgs.Empty);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ReconnectRequested\"/> event\n        /// </summary>\n        protected virtual void OnReconnectRequested()\n        {\n            ReconnectRequested?.Invoke(this, EventArgs.Empty);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _isEnabled = false;\n\n            // request and wait for thread to stop\n            _connectionMonitorThread.StopSafely(TimeSpan.FromSeconds(5), _cancellationTokenSource);\n            _cancellationTokenSource?.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/DefaultOrderBook.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a full order book for a security.\n    /// It contains prices and order sizes for each bid and ask level.\n    /// The best bid and ask prices are also kept up to date.\n    /// </summary>\n    public class DefaultOrderBook : IOrderBookUpdater<decimal, decimal>\n    {\n        private decimal _bestBidPrice;\n        private decimal _bestBidSize;\n        private decimal _bestAskPrice;\n        private decimal _bestAskSize;\n        private readonly object _locker = new object();\n\n        /// <summary>\n        /// Represents bid prices and sizes\n        /// </summary>\n        protected SortedDictionary<decimal, decimal> Bids { get; init; } = new SortedDictionary<decimal, decimal>();\n\n        /// <summary>\n        /// Represents ask prices and sizes\n        /// </summary>\n        protected SortedDictionary<decimal, decimal> Asks { get; init; } = new SortedDictionary<decimal, decimal>();\n\n        /// <summary>\n        /// Represents a unique security identifier of current Order Book\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Event fired each time <see cref=\"BestBidPrice\"/> or <see cref=\"BestAskPrice\"/> are changed\n        /// </summary>\n        public event EventHandler<BestBidAskUpdatedEventArgs> BestBidAskUpdated;\n\n        /// <summary>\n        /// The best bid price\n        /// </summary>\n        public decimal BestBidPrice\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _bestBidPrice;\n                }\n            }\n        }\n\n        /// <summary>\n        /// The best bid size\n        /// </summary>\n        public decimal BestBidSize\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _bestBidSize;\n                }\n            }\n        }\n\n        /// <summary>\n        /// The best ask price\n        /// </summary>\n        public decimal BestAskPrice\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _bestAskPrice;\n                }\n            }\n        }\n\n        /// <summary>\n        /// The best ask size\n        /// </summary>\n        public decimal BestAskSize\n        {\n            get\n            {\n                lock (_locker)\n                {\n                    return _bestAskSize;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultOrderBook\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for the order book</param>\n        public DefaultOrderBook(Symbol symbol)\n        {\n            Symbol = symbol;\n        }\n\n        /// <summary>\n        /// Clears all bid/ask levels and prices.\n        /// </summary>\n        public void Clear()\n        {\n            lock (_locker)\n            {\n                _bestBidPrice = 0;\n                _bestBidSize = 0;\n                _bestAskPrice = 0;\n                _bestAskSize = 0;\n\n                Bids.Clear();\n                Asks.Clear();\n            }\n        }\n\n        /// <summary>\n        /// Updates or inserts a bid price level in the order book\n        /// </summary>\n        /// <param name=\"price\">The bid price level to be inserted or updated</param>\n        /// <param name=\"size\">The new size at the bid price level</param>\n        public void UpdateBidRow(decimal price, decimal size)\n        {\n            lock (_locker)\n            {\n                Bids[price] = size;\n\n                if (_bestBidPrice == 0 || price >= _bestBidPrice)\n                {\n                    _bestBidPrice = price;\n                    _bestBidSize = size;\n\n                    BestBidAskUpdated?.Invoke(this, new BestBidAskUpdatedEventArgs(Symbol, _bestBidPrice, _bestBidSize, _bestAskPrice, _bestAskSize));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Updates or inserts an ask price level in the order book\n        /// </summary>\n        /// <param name=\"price\">The ask price level to be inserted or updated</param>\n        /// <param name=\"size\">The new size at the ask price level</param>\n        public void UpdateAskRow(decimal price, decimal size)\n        {\n            lock (_locker)\n            {\n                Asks[price] = size;\n\n                if (_bestAskPrice == 0 || price <= _bestAskPrice)\n                {\n                    _bestAskPrice = price;\n                    _bestAskSize = size;\n\n                    BestBidAskUpdated?.Invoke(this, new BestBidAskUpdatedEventArgs(Symbol, _bestBidPrice, _bestBidSize, _bestAskPrice, _bestAskSize));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes a bid price level from the order book\n        /// </summary>\n        /// <param name=\"price\">The bid price level to be removed</param>\n        public void RemoveBidRow(decimal price)\n        {\n            lock (_locker)\n            {\n                Bids.Remove(price);\n\n                if (price == _bestBidPrice)\n                {\n                    var priceLevel = Bids.LastOrDefault();\n                    _bestBidPrice = priceLevel.Key;\n                    _bestBidSize = priceLevel.Value;\n\n                    BestBidAskUpdated?.Invoke(this, new BestBidAskUpdatedEventArgs(Symbol, _bestBidPrice, _bestBidSize, _bestAskPrice, _bestAskSize));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes an ask price level from the order book\n        /// </summary>\n        /// <param name=\"price\">The ask price level to be removed</param>\n        public void RemoveAskRow(decimal price)\n        {\n            lock (_locker)\n            {\n                Asks.Remove(price);\n\n                if (price == _bestAskPrice)\n                {\n                    var priceLevel = Asks.FirstOrDefault();\n                    _bestAskPrice = priceLevel.Key;\n                    _bestAskSize = priceLevel.Value;\n\n                    BestBidAskUpdated?.Invoke(this, new BestBidAskUpdatedEventArgs(Symbol, _bestBidPrice, _bestBidSize, _bestAskPrice, _bestAskSize));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Common price level removal method\n        /// </summary>\n        /// <param name=\"priceLevel\"></param>\n        public void RemovePriceLevel(decimal priceLevel)\n        {\n            lock (_locker)\n            {\n                if (Asks.ContainsKey(priceLevel))\n                {\n                    RemoveAskRow(priceLevel);\n                }\n                else if (Bids.ContainsKey(priceLevel))\n                {\n                    RemoveBidRow(priceLevel);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/IConnectionHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides handling of a brokerage or data feed connection\n    /// </summary>\n    public interface IConnectionHandler : IDisposable\n    {\n        /// <summary>\n        /// Event that fires when a connection loss is detected\n        /// </summary>\n        event EventHandler ConnectionLost;\n\n        /// <summary>\n        /// Event that fires when a lost connection is restored\n        /// </summary>\n        event EventHandler ConnectionRestored;\n\n        /// <summary>\n        /// Event that fires when a reconnection attempt is required\n        /// </summary>\n        event EventHandler ReconnectRequested;\n\n        /// <summary>\n        /// Returns true if the connection has been lost\n        /// </summary>\n        bool IsConnectionLost { get; }\n\n        /// <summary>\n        /// Initializes the connection handler\n        /// </summary>\n        /// <param name=\"connectionId\">The connection id</param>\n        void Initialize(string connectionId);\n\n        /// <summary>\n        /// Enables/disables monitoring of the connection\n        /// </summary>\n        /// <param name=\"isEnabled\">True to enable monitoring, false otherwise</param>\n        void EnableMonitoring(bool isEnabled);\n\n        /// <summary>\n        /// Notifies the connection handler that new data was received\n        /// </summary>\n        /// <param name=\"lastDataReceivedTime\">The UTC timestamp of the last data point received</param>\n        void KeepAlive(DateTime lastDataReceivedTime);\n    }\n}\n"
  },
  {
    "path": "Brokerages/IOrderBookUpdater.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents an orderbook updater interface for a security.\n    /// Provides the ability to update orderbook price level and to be alerted about updates\n    /// </summary>\n    /// <typeparam name=\"K\">Price level identifier</typeparam>\n    /// <typeparam name=\"V\">Size at the price level</typeparam>\n    public interface IOrderBookUpdater<K, V>\n    {\n        /// <summary>\n        /// Event fired each time BestBidPrice or BestAskPrice are changed\n        /// </summary>\n        event EventHandler<BestBidAskUpdatedEventArgs> BestBidAskUpdated;\n\n        /// <summary>\n        /// Updates or inserts a bid price level in the order book\n        /// </summary>\n        /// <param name=\"price\">The bid price level to be inserted or updated</param>\n        /// <param name=\"size\">The new size at the bid price level</param>\n        void UpdateBidRow(K price, V size);\n\n        /// <summary>\n        /// Updates or inserts an ask price level in the order book\n        /// </summary>\n        /// <param name=\"price\">The ask price level to be inserted or updated</param>\n        /// <param name=\"size\">The new size at the ask price level</param>\n        void UpdateAskRow(K price, V size);\n\n        /// <summary>\n        /// Removes a bid price level from the order book\n        /// </summary>\n        /// <param name=\"price\">The bid price level to be removed</param>\n        void RemoveBidRow(K price);\n\n        /// <summary>\n        /// Removes an ask price level from the order book\n        /// </summary>\n        /// <param name=\"price\">The ask price level to be removed</param>\n        void RemoveAskRow(K price);\n    }\n}\n"
  },
  {
    "path": "Brokerages/ISymbolMapper.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides the mapping between Lean symbols and brokerage specific symbols.\n    /// </summary>\n    public interface ISymbolMapper\n    {\n        /// <summary>\n        /// Converts a Lean symbol instance to a brokerage symbol\n        /// </summary>\n        /// <param name=\"symbol\">A Lean symbol instance</param>\n        /// <returns>The brokerage symbol</returns>\n        string GetBrokerageSymbol(Symbol symbol);\n\n        /// <summary>\n        /// Converts a brokerage symbol to a Lean symbol instance\n        /// </summary>\n        /// <param name=\"brokerageSymbol\">The brokerage symbol</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"expirationDate\">Expiration date of the security(if applicable)</param>\n        /// <param name=\"strike\">The strike of the security (if applicable)</param>\n        /// <param name=\"optionRight\">The option right of the security (if applicable)</param>\n        /// <returns>A new Lean Symbol instance</returns>\n        Symbol GetLeanSymbol(string brokerageSymbol, SecurityType securityType, string market, DateTime expirationDate = default(DateTime), decimal strike = 0, OptionRight optionRight = 0);\n    }\n}\n"
  },
  {
    "path": "Brokerages/IWebSocket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Wrapper for WebSocket4Net to enhance testability\n    /// </summary>\n    public interface IWebSocket\n    {\n        /// <summary>\n        /// Wraps constructor\n        /// </summary>\n        /// <param name=\"url\">The target websocket url</param>\n        /// <param name=\"sessionToken\">The websocket session token</param>\n        void Initialize(string url, string sessionToken = null);\n\n        /// <summary>\n        /// Wraps send method\n        /// </summary>\n        /// <param name=\"data\"></param>\n        void Send(string data);\n\n        /// <summary>\n        /// Wraps Connect method\n        /// </summary>\n        void Connect();\n\n        /// <summary>\n        /// Wraps Close method\n        /// </summary>\n        void Close();\n\n        /// <summary>\n        /// Wraps IsOpen\n        /// </summary>\n        bool IsOpen { get; }\n\n        /// <summary>\n        /// on message event\n        /// </summary>\n        event EventHandler<WebSocketMessage> Message;\n\n        /// <summary>\n        /// On error event\n        /// </summary>\n        event EventHandler<WebSocketError> Error;\n\n        /// <summary>\n        /// On Open event\n        /// </summary>\n        event EventHandler Open;\n\n        /// <summary>\n        /// On Close event\n        /// </summary>\n        event EventHandler<WebSocketCloseData> Closed;\n    }\n}\n"
  },
  {
    "path": "Brokerages/LevelOneOrderBook/BaseDataEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Brokerages.LevelOneOrderBook\n{\n    /// <summary>\n    /// Provides data for an event that is triggered when a new <see cref=\"BaseData\"/> is received.\n    /// </summary>\n    public sealed class BaseDataEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the <see cref=\"BaseData\"/> data associated with the event.\n        /// </summary>\n        public BaseData BaseData { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataEventArgs\"/> class with the specified <see cref=\"BaseData\"/>.\n        /// </summary>\n        /// <param name=\"tick\">The <see cref=\"BaseData\"/> data associated with the event.</param>\n        public BaseDataEventArgs(BaseData tick)\n        {\n            BaseData = tick;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/LevelOneOrderBook/LevelOneMarketData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Brokerages.LevelOneOrderBook\n{\n    /// <summary>\n    /// Provides real-time tracking of Level 1 market data (top-of-book) for a specific trading symbol.\n    /// Updates include best bid/ask quotes and last trade executions.\n    /// Publishes <see cref=\"Tick\"/> updates to a shared <see cref=\"IDataAggregator\"/> in a thread-safe manner.\n    public class LevelOneMarketData\n    {\n        /// <summary>\n        /// Occurs when a new tick is received, such as a last trade update or a change in bid/ask values.\n        /// </summary>\n        public event EventHandler<BaseDataEventArgs> BaseDataReceived;\n\n        /// <summary>\n        /// Gets the symbol this service is tracking.\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the time zone associated with the symbol's exchange.\n        /// Used for consistent time stamping.\n        /// </summary>\n        public DateTimeZone SymbolDateTimeZone { get; }\n\n        /// <summary>\n        /// Gets the price of the last executed trade.\n        /// </summary>\n        public decimal LastTradePrice { get; private set; }\n\n        /// <summary>\n        /// Gets the size of the last executed trade.\n        /// </summary>\n        public decimal LastTradeSize { get; private set; }\n\n        /// <summary>\n        /// Gets the best available bid price.\n        /// </summary>\n        public decimal BestBidPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the size of the best available bid.\n        /// </summary>\n        public decimal BestBidSize { get; private set; }\n\n        /// <summary>\n        /// Gets the best available ask price.\n        /// </summary>\n        public decimal BestAskPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the size of the best available ask.\n        /// </summary>\n        public decimal BestAskSize { get; private set; }\n\n        /// <summary>\n        /// Gets the latest reported open interest value.\n        /// </summary>\n        public decimal OpenInterest { get; private set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether quote updates with a size of zero should be ignored \n        /// when updating Level 1 market data.\n        ///\n        /// When set to <c>true</c>, incoming bid or ask updates with a size of zero are treated\n        /// as missing or incomplete and will not overwrite the existing known price or size.\n        /// This is typically used for real-time (non-delayed) feeds where a zero size may indicate\n        /// a temporary data gap rather than an actionable market change.\n        ///\n        /// When set to <c>false</c> (default), zero-sized updates are applied normally,\n        /// which is appropriate for delayed feeds or sources where a size of zero has\n        /// semantic meaning (e.g., clearing out a book level).\n        /// </summary>\n        public bool IgnoreZeroSizeUpdates { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LevelOneMarketData\"/> class for a given symbol.\n        /// </summary>\n        /// <param name=\"symbol\">The trading symbol to monitor.</param>\n        public LevelOneMarketData(Symbol symbol)\n        {\n            Symbol = symbol;\n            SymbolDateTimeZone = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType).TimeZone;\n        }\n\n        /// <summary>\n        /// Updates the best bid and ask prices and sizes.\n        /// Constructs and publishes a quote <see cref=\"Tick\"/> to the <see cref=\"IDataAggregator\"/>.\n        /// </summary>\n        /// <param name=\"quoteDateTimeUtc\">The UTC timestamp when the quote was received.</param>\n        /// <param name=\"bidPrice\">The best bid price.</param>\n        /// <param name=\"bidSize\">The size available at the best bid.</param>\n        /// <param name=\"askPrice\">The best ask price.</param>\n        /// <param name=\"askSize\">The size available at the best ask.</param>\n        public void UpdateQuote(DateTime? quoteDateTimeUtc, decimal? bidPrice, decimal? bidSize, decimal? askPrice, decimal? askSize)\n        {\n            if (!IsValidTimestamp(quoteDateTimeUtc))\n            {\n                return;\n            }\n\n            if (BestAskPrice == askPrice && BestAskSize == askSize && BestBidPrice == bidPrice && BestBidSize == bidSize)\n            {\n                return;\n            }\n\n            var isBidUpdated = TryResolvePriceSize(bidPrice, bidSize, BestBidPrice, BestBidSize, out var resolvedBidPrice, out var resolvedBidSize);\n\n            if (isBidUpdated)\n            {\n                BestBidPrice = resolvedBidPrice;\n                BestBidSize = resolvedBidSize;\n            }\n\n            var isAskUpdated = TryResolvePriceSize(askPrice, askSize, BestAskPrice, BestAskSize, out var resolvedAskPrice, out var resolvedAskSize);\n\n            if (isAskUpdated)\n            {\n                BestAskPrice = resolvedAskPrice;\n                BestAskSize = resolvedAskSize;\n            }\n\n            if (isBidUpdated || isAskUpdated)\n            {\n                var lastQuoteTick = new Tick(quoteDateTimeUtc.Value.ConvertFromUtc(SymbolDateTimeZone), Symbol, BestBidSize, BestBidPrice, BestAskSize, BestAskPrice);\n\n                BaseDataReceived?.Invoke(this, new(lastQuoteTick));\n            }\n        }\n\n        /// <summary>\n        /// Updates the last trade price and size.\n        /// Constructs and publishes a trade <see cref=\"Tick\"/> to the <see cref=\"Data.IDataAggregator\"/>.\n        /// </summary>\n        /// <param name=\"tradeDateTimeUtc\">The UTC timestamp when the trade occurred.</param>\n        /// <param name=\"lastQuantity\">The quantity of the last trade.</param>\n        /// <param name=\"lastPrice\">The price at which the last trade occurred.</param>\n        /// <param name=\"saleCondition\">Optional sale condition string.</param>\n        /// <param name=\"exchange\">Optional exchange identifier.</param>\n        public void UpdateLastTrade(DateTime? tradeDateTimeUtc, decimal? lastQuantity, decimal? lastPrice, string saleCondition = \"\", string exchange = \"\")\n        {\n            if (!IsValidTimestamp(tradeDateTimeUtc))\n            {\n                return;\n            }\n\n            if (!TryResolvePriceSize(lastPrice, lastQuantity, LastTradePrice, LastTradeSize, out var newPrice, out var newSize))\n            {\n                return;\n            }\n\n            LastTradePrice = newPrice;\n            LastTradeSize = newSize;\n\n            var lastTradeTick = new Tick(\n                tradeDateTimeUtc.Value.ConvertFromUtc(SymbolDateTimeZone),\n                Symbol,\n                saleCondition,\n                exchange,\n                LastTradeSize,\n                LastTradePrice);\n\n            BaseDataReceived?.Invoke(this, new(lastTradeTick));\n        }\n\n\n        /// <summary>\n        /// Updates the open interest value and publishes a corresponding <see cref=\"Tick\"/>.\n        /// </summary>\n        /// <param name=\"openInterestDateTimeUtc\">The UTC timestamp of the open interest update.</param>\n        /// <param name=\"openInterest\">The reported open interest value.</param>\n        public void UpdateOpenInterest(DateTime? openInterestDateTimeUtc, decimal? openInterest)\n        {\n            if (!IsValidTimestamp(openInterestDateTimeUtc) || !openInterest.HasValue)\n            {\n                return;\n            }\n\n            var openInterestTick = new Tick(openInterestDateTimeUtc.Value.ConvertFromUtc(SymbolDateTimeZone), Symbol, openInterest.Value);\n\n            BaseDataReceived?.Invoke(this, new(openInterestTick));\n        }\n\n        /// <summary>\n        /// Attempts to resolve the effective price and size values for a Level 1 market data update,\n        /// using fallback values when current data is missing, zero, or invalid.\n        /// </summary>\n        /// <param name=\"price\">The incoming price value, if available.</param>\n        /// <param name=\"size\">The incoming size value associated with the price, if available.</param>\n        /// <param name=\"bestPrice\">The last known valid price used as a fallback.</param>\n        /// <param name=\"bestSize\">The last known valid size used as a fallback.</param>\n        /// <param name=\"newPrice\">The resolved price value to be used in the update.</param>\n        /// <param name=\"newSize\">The resolved size value to be used in the update.</param>\n        /// <returns>\n        /// <c>true</c> if a valid (resolved) price and size pair was determined; otherwise, <c>false</c>.\n        /// </returns>\n        private bool TryResolvePriceSize(decimal? price, decimal? size, decimal bestPrice, decimal bestSize, out decimal newPrice, out decimal newSize)\n        {\n            if (size.HasValue && (!IgnoreZeroSizeUpdates || size.Value != 0))\n            {\n                if (price.HasValue && price.Value != 0)\n                {\n                    newPrice = price.Value;\n                    newSize = size.Value;\n                    return true;\n\n                }\n                else if (bestPrice != 0)\n                {\n                    newPrice = bestPrice;\n                    newSize = size.Value;\n                    return true;\n                }\n            }\n            else if (price.HasValue && price.Value != 0)\n            {\n                newPrice = price.Value;\n                newSize = bestSize;\n                return true;\n            }\n            newPrice = default;\n            newSize = default;\n            return false;\n        }\n\n        /// <summary>\n        /// Determines whether the provided timestamp is valid,\n        /// meaning it is non-null and not equal to the default <see cref=\"DateTime\"/> value.\n        /// This is typically used to detect and ignore stale or uninitialized timestamps in market data.\n        /// </summary>\n        /// <param name=\"timestamp\">The timestamp to validate.</param>\n        /// <returns>\n        /// <c>true</c> if the timestamp is not <c>null</c> and not <c>default(DateTime)</c>; otherwise, <c>false</c>.\n        /// </returns>\n        private static bool IsValidTimestamp(DateTime? timestamp)\n        {\n            return timestamp.HasValue && timestamp.Value != default;\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/LevelOneOrderBook/LevelOneServiceManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Brokerages.LevelOneOrderBook\n{\n    /// <summary>\n    /// Manages subscriptions and real-time updates for multiple <see cref=\"LevelOneMarketData\"/> instances.\n    /// Facilitates routing of quote and trade data to a shared <see cref=\"IDataAggregator\"/> in a thread-safe manner.\n    /// </summary>\n    public sealed class LevelOneServiceManager : IDisposable\n    {\n        /// <summary>\n        /// The shared data aggregator that receives all tick updates from subscribed symbols.\n        /// </summary>\n        private readonly IDataAggregator _dataAggregator;\n\n        /// <summary>\n        /// Synchronization lock used to ensure thread safety during updates.\n        /// </summary>\n        private readonly Lock _lock = new();\n\n        /// <summary>\n        /// Maps subscribed symbols to their corresponding <see cref=\"LevelOneMarketData\"/> instances.\n        /// </summary>\n        private readonly ConcurrentDictionary<Symbol, LevelOneMarketData> _levelOneServiceBySymbol = new();\n\n        /// <summary>\n        /// Internal subscription manager used to delegate low-level subscribe/unsubscribe logic.\n        /// </summary>\n        private readonly EventBasedDataQueueHandlerSubscriptionManager _subscriptionManager;\n\n        /// <summary>\n        /// Gets whether there are no active subscriptions.\n        /// </summary>\n        public bool IsEmpty => _levelOneServiceBySymbol.IsEmpty;\n\n        /// <summary>\n        /// Gets the number of currently subscribed symbols.\n        /// </summary>\n        public int Count => _levelOneServiceBySymbol.Count;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LevelOneServiceManager\"/> class.\n        /// </summary>\n        /// <param name=\"dataAggregator\">The aggregator to which all tick data will be published.</param>\n        /// <param name=\"subscribeCallback\">Delegate used to perform symbol subscription logic.</param>\n        /// <param name=\"unsubscribeCallback\">Delegate used to perform symbol unsubscription logic.</param>\n        public LevelOneServiceManager(IDataAggregator dataAggregator, Func<IEnumerable<Symbol>, TickType, bool> subscribeCallback, Func<IEnumerable<Symbol>, TickType, bool> unsubscribeCallback)\n        {\n            _dataAggregator = dataAggregator;\n\n            _subscriptionManager = new EventBasedDataQueueHandlerSubscriptionManager()\n            {\n                SubscribeImpl = (symbols, tickType) => SubscribeCallbackWrapper(symbols, tickType, subscribeCallback),\n                UnsubscribeImpl = (symbols, tickType) => UnsubscribeCallbackWrapper(symbols, tickType, unsubscribeCallback)\n            };\n        }\n\n        /// <summary>\n        /// Subscribes to the specified symbol based on the given <see cref=\"SubscriptionDataConfig\"/>.\n        /// </summary>\n        /// <param name=\"dataConfig\">The subscription configuration containing symbol and type information.</param>\n        public void Subscribe(SubscriptionDataConfig dataConfig)\n        {\n            _subscriptionManager.Subscribe(dataConfig);\n        }\n\n        /// <summary>\n        /// Unsubscribes from the specified symbol and removes its associated service instance.\n        /// </summary>\n        /// <param name=\"dataConfig\">The subscription configuration used for unsubscription.</param>\n        public void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            _subscriptionManager.Unsubscribe(dataConfig);\n        }\n\n        /// <summary>\n        /// Handles incoming quote data for a symbol.\n        /// Deduplicates updates and routes changes to the relevant <see cref=\"LevelOneMarketData\"/> instance.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which quote data is received.</param>\n        /// <param name=\"quoteDateTimeUtc\">The UTC timestamp of the quote.</param>\n        /// <param name=\"bidPrice\">The bid price.</param>\n        /// <param name=\"bidSize\">The size at the bid price.</param>\n        /// <param name=\"askPrice\">The ask price.</param>\n        /// <param name=\"askSize\">The size at the ask price.</param>\n        public void HandleQuote(Symbol symbol, DateTime? quoteDateTimeUtc, decimal? bidPrice, decimal? bidSize, decimal? askPrice, decimal? askSize)\n        {\n            if (TryGetLevelOneMarketData(symbol, out var levelOneMarketData))\n            {\n                levelOneMarketData.UpdateQuote(quoteDateTimeUtc, bidPrice, bidSize, askPrice, askSize);\n            }\n        }\n\n        /// <summary>\n        /// Handles incoming last trade data for a symbol and routes it to the corresponding <see cref=\"LevelOneMarketData\"/> instance.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which trade data is received.</param>\n        /// <param name=\"tradeDateTimeUtc\">The UTC timestamp of the trade.</param>\n        /// <param name=\"lastQuantity\">The trade size.</param>\n        /// <param name=\"lastPrice\">The trade price.</param>\n        /// <param name=\"saleCondition\">Optional sale condition string.</param>\n        /// <param name=\"exchange\">Optional exchange identifier.</param>\n        public void HandleLastTrade(Symbol symbol, DateTime? tradeDateTimeUtc, decimal? lastQuantity, decimal? lastPrice, string saleCondition = \"\", string exchange = \"\")\n        {\n            if (TryGetLevelOneMarketData(symbol, out var levelOneMarketData))\n            {\n                levelOneMarketData.UpdateLastTrade(tradeDateTimeUtc, lastQuantity, lastPrice, saleCondition, exchange);\n            }\n        }\n\n        /// <summary>\n        /// Handles open interest updates for the specified symbol.\n        /// If the symbol is subscribed, forwards the open interest data to the corresponding\n        /// <see cref=\"LevelOneMarketData\"/> instance for publishing.\n        /// </summary>\n        /// <param name=\"symbol\">The trading symbol associated with the open interest update.</param>\n        /// <param name=\"openInterestDateTimeUtc\">The UTC timestamp when the open interest value was observed.</param>\n        /// <param name=\"openInterest\">The reported open interest value.</param>\n        public void HandleOpenInterest(Symbol symbol, DateTime? openInterestDateTimeUtc, decimal? openInterest)\n        {\n            if (TryGetLevelOneMarketData(symbol, out var levelOneMarketData))\n            {\n                levelOneMarketData.UpdateOpenInterest(openInterestDateTimeUtc, openInterest);\n            }\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"LevelOneMarketData.IgnoreZeroSizeUpdates\"/> flag for the specified symbol,\n        /// controlling how zero-sized quote updates are handled for that symbol's market data stream.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose quote update behavior should be configured.</param>\n        /// <param name=\"ignoreZeroSizeUpdates\">\n        /// If <c>true</c>, zero-sized bid or ask updates will be ignored for the given symbol,\n        /// preserving existing book values. If <c>false</c>, zero sizes will be applied as valid updates.\n        /// </param>\n        /// <remarks>\n        /// This is typically used to differentiate between real-time and delayed data feeds, where zero-size\n        /// updates in real-time may indicate incomplete data, but in delayed feeds may represent actual market states.\n        /// </remarks>\n        public void SetIgnoreZeroSizeUpdates(Symbol symbol, bool ignoreZeroSizeUpdates)\n        {\n            if (TryGetLevelOneMarketData(symbol, out var levelOneMarketData))\n            {\n                levelOneMarketData.IgnoreZeroSizeUpdates = ignoreZeroSizeUpdates;\n            }\n        }\n\n        /// <summary>\n        /// Returns subscribed symbols\n        /// </summary>\n        /// <returns>list of <see cref=\"Symbol\"/> currently subscribed</returns>\n        public IEnumerable<Symbol> GetSubscribedSymbols()\n        {\n            return _subscriptionManager.GetSubscribedSymbols();\n        }\n\n        /// <summary>\n        /// Handles BaseData updates emitted by <see cref=\"LevelOneMarketData\"/> instances.\n        /// Forwards the BaseData to the shared data aggregator in a thread-safe manner.\n        /// </summary>\n        /// <param name=\"_\">The originator of the BaseData.</param>\n        /// <param name=\"eventData\">The BaseData event data.</param>\n        private void BaseDataReceived(object _, BaseDataEventArgs eventData)\n        {\n            lock (_lock)\n            {\n                _dataAggregator.Update(eventData.BaseData);\n            }\n        }\n\n        /// <summary>\n        /// Wraps the subscription delegate to attach symbol-specific handlers and track active Level 1 services.\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to subscribe.</param>\n        /// <param name=\"tickType\">The tick type to subscribe for.</param>\n        /// <param name=\"subscribeCallback\">The original subscription logic delegate.</param>\n        /// <returns>True if the subscription was successful; otherwise, false.</returns>\n        private bool SubscribeCallbackWrapper(IEnumerable<Symbol> symbols, TickType tickType, Func<IEnumerable<Symbol>, TickType, bool> subscribeCallback)\n        {\n            if (subscribeCallback(symbols, tickType))\n            {\n                foreach (var symbol in symbols)\n                {\n                    _levelOneServiceBySymbol[symbol] = new(symbol);\n                    _levelOneServiceBySymbol[symbol].BaseDataReceived += BaseDataReceived;\n                }\n\n                return true;\n            }\n\n            Log.Error($\"{nameof(LevelOneServiceManager)}.{nameof(SubscribeCallbackWrapper)}: Failed for symbols: {string.Join(\", \", symbols.Select(s => s.Value))}\");\n            return false;\n        }\n\n        /// <summary>\n        /// Wraps the unsubscription delegate to detach symbol-specific handlers and remove Level 1 service tracking.\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to unsubscribe.</param>\n        /// <param name=\"tickType\">The tick type to unsubscribe from.</param>\n        /// <param name=\"unsubscribeCallback\">The original unsubscription logic delegate.</param>\n        /// <returns>True if the unsubscription was successful; otherwise, false.</returns>\n        private bool UnsubscribeCallbackWrapper(IEnumerable<Symbol> symbols, TickType tickType, Func<IEnumerable<Symbol>, TickType, bool> unsubscribeCallback)\n        {\n            if (unsubscribeCallback(symbols, tickType))\n            {\n                foreach (var symbol in symbols)\n                {\n                    if (_levelOneServiceBySymbol.TryRemove(symbol, out var levelOneService))\n                    {\n                        levelOneService.BaseDataReceived -= BaseDataReceived;\n                    }\n                }\n                return true;\n            }\n\n            Log.Error($\"{nameof(LevelOneServiceManager)}.{nameof(UnsubscribeCallbackWrapper)}: Failed for symbols: {string.Join(\", \", symbols.Select(s => s.Value))}\");\n            return true;\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the <see cref=\"LevelOneMarketData\"/> instance associated with the specified symbol.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market data instance is to be retrieved.</param>\n        /// <param name=\"levelOneMarketData\">\n        /// When this method returns, contains the <see cref=\"LevelOneMarketData\"/> instance associated with the symbol,\n        /// if the symbol is found; otherwise, <c>null</c>.\n        /// </param>\n        /// <returns>\n        /// <c>true</c> if the symbol is found and the associated market data instance is returned;\n        /// otherwise, <c>false</c>. Logs an error if the symbol is not found.\n        /// </returns>\n        private bool TryGetLevelOneMarketData(Symbol symbol, out LevelOneMarketData levelOneMarketData)\n        {\n            if (_levelOneServiceBySymbol.TryGetValue(symbol, out levelOneMarketData))\n            {\n                return true;\n            }\n\n            Log.Error($\"{nameof(LevelOneServiceManager)}.{nameof(HandleLastTrade)}: Symbol {symbol} not found in {nameof(_levelOneServiceBySymbol)}. This could indicate an unexpected symbol or a missing initialization step.\");\n            return false;\n        }\n\n        /// <summary>\n        /// Releases all resources used by the <see cref=\"LevelOneServiceManager\"/>.\n        /// </summary>\n        public void Dispose()\n        {\n            _subscriptionManager.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Paper/PaperBrokerage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages.Paper\n{\n    /// <summary>\n    /// Paper Trading Brokerage\n    /// </summary>\n    public class PaperBrokerage : BacktestingBrokerage\n    {\n        private DateTime _lastScanTime;\n        private readonly LiveNodePacket _job;\n\n        /// <summary>\n        /// Enables or disables concurrent processing of messages to and from the brokerage.\n        /// </summary>\n        public override bool ConcurrencyEnabled { get; set; } = true;\n\n        /// <summary>\n        /// Creates a new PaperBrokerage\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm under analysis</param>\n        /// <param name=\"job\">The job packet</param>\n        public PaperBrokerage(IAlgorithm algorithm, LiveNodePacket job)\n            : base(algorithm, \"Paper Brokerage\")\n        {\n            _job = job;\n        }\n\n        /// <summary>\n        /// Gets the current cash balance for each currency held in the brokerage account\n        /// </summary>\n        /// <returns>The current cash balance for each currency available for trading</returns>\n        public override List<CashAmount> GetCashBalance()\n        {\n            return GetCashBalance(_job.BrokerageData, Algorithm.Portfolio.CashBook);\n        }\n\n        /// <summary>\n        /// Gets all holdings for the account\n        /// </summary>\n        /// <returns>The current holdings from the account</returns>\n        public override List<Holding> GetAccountHoldings()\n        {\n            return base.GetAccountHoldings(_job.BrokerageData, Algorithm.Securities.Values);\n        }\n\n        /// <summary>\n        /// Scans all the outstanding orders and applies the algorithm model fills to generate the order events.\n        /// This override adds dividend detection and application\n        /// </summary>\n        public override void Scan()\n        {\n            // Scan is called twice per time loop, this check enforces that we only check\n            // on the first call for each time loop\n            if (Algorithm.UtcTime != _lastScanTime && Algorithm.CurrentSlice != null)\n            {\n                _lastScanTime = Algorithm.UtcTime;\n\n                // apply each dividend directly to the quote cash holdings of the security\n                // this assumes dividends are paid out in a security's quote cash (reasonable assumption)\n                foreach (var dividend in Algorithm.CurrentSlice.Dividends.Values)\n                {\n                    Security security;\n                    if (Algorithm.Securities.TryGetValue(dividend.Symbol, out security))\n                    {\n                        // compute the total distribution and apply as security's quote currency\n                        var distribution = security.Holdings.Quantity * dividend.Distribution;\n                        security.QuoteCurrency.AddAmount(distribution);\n                    }\n                }\n            }\n\n            base.Scan();\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Paper/PaperBrokerageFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages.Paper\n{\n    /// <summary>\n    /// The factory type for the <see cref=\"PaperBrokerage\"/>\n    /// </summary>\n    public class PaperBrokerageFactory : BrokerageFactory\n    {\n        /// <summary>\n        /// Gets the brokerage data required to run the IB brokerage from configuration\n        /// </summary>\n        /// <remarks>\n        /// The implementation of this property will create the brokerage data dictionary required for\n        /// running live jobs. See <see cref=\"IJobQueueHandler.NextJob\"/>\n        /// </remarks>\n        public override Dictionary<string, string> BrokerageData => new Dictionary<string, string>\n        {\n            { \"live-cash-balance\", Config.Get(\"live-cash-balance\")},\n            { \"live-holdings\", Config.Get(\"live-holdings\")},\n        };\n\n        /// <summary>\n        /// Gets a new instance of the <see cref=\"InteractiveBrokersBrokerageModel\"/>\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider</param>\n        public override IBrokerageModel GetBrokerageModel(IOrderProvider orderProvider) => new DefaultBrokerageModel();\n\n        /// <summary>\n        /// Creates a new IBrokerage instance\n        /// </summary>\n        /// <param name=\"job\">The job packet to create the brokerage for</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>A new brokerage instance</returns>\n        public override IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm)\n        {\n            return new PaperBrokerage(algorithm, job);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public override void Dispose()\n        {\n            // NOP\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PaperBrokerageFactory\"/> class\n        /// </summary>\n        public PaperBrokerageFactory()\n            : base(typeof(PaperBrokerage))\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Brokerages\")]\n[assembly: AssemblyProduct(\"QuantConnect.Brokerages\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"044b87ad-d9f9-45c8-90b3-683de09ac42c\")]"
  },
  {
    "path": "Brokerages/QuantConnect.Brokerages.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Brokerages</RootNamespace>\n    <AssemblyName>QuantConnect.Brokerages</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Brokerages.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Brokerages Project - A collection of brokerages for live trading and backtesting</Description>\n    <NoWarn>CA1062</NoWarn>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NET45</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE;NET45</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"CsvHelper\" Version=\"19.0.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"RestSharp\" Version=\"106.12.0\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Compression\\QuantConnect.Compression.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Brokerages/SymbolPropertiesDatabaseSymbolMapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides the mapping between Lean symbols and brokerage symbols using the symbol properties database\n    /// </summary>\n    public class SymbolPropertiesDatabaseSymbolMapper : ISymbolMapper\n    {\n        private readonly string _market;\n\n        // map Lean symbols to symbol properties\n        private Dictionary<Symbol, SymbolProperties> _symbolPropertiesMap;\n\n        // map brokerage symbols to Lean symbols we do it per security type because they could overlap, for example binance futures and spot\n        private Dictionary<SecurityType, Dictionary<string, Symbol>> _symbolMap;\n\n        // Timestamp of the last successful reload\n        private DateTime _lastReloadTime;\n\n        // Minimum time between reloads\n        private static readonly TimeSpan _minReloadInterval = TimeSpan.FromMinutes(15);\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"SymbolPropertiesDatabaseSymbolMapper\"/> class.\n        /// </summary>\n        /// <param name=\"market\">The Lean market</param>\n        public SymbolPropertiesDatabaseSymbolMapper(string market)\n        {\n            _market = market;\n            TryRefreshMappings();\n        }\n\n        /// <summary>\n        /// Attempts to refresh the mappings if the minimum reload interval has passed\n        /// </summary>\n        /// <returns>True if the mappings were refreshed, false otherwise</returns>\n        private bool TryRefreshMappings()\n        {\n            // Check if enough time has passed since the last reload\n            if (DateTime.UtcNow - _lastReloadTime < _minReloadInterval)\n            {\n                return false;\n            }\n\n            var symbolPropertiesList =\n                SymbolPropertiesDatabase\n                    .FromDataFolder()\n                    .GetSymbolPropertiesList(_market)\n                    .Where(x => !string.IsNullOrWhiteSpace(x.Value.MarketTicker))\n                    .ToList();\n\n            var symbolPropertiesMap =\n                symbolPropertiesList\n                    .ToDictionary(\n                        x => Symbol.Create(x.Key.Symbol, x.Key.SecurityType, x.Key.Market),\n                        x => x.Value);\n\n            var symbolMap = new Dictionary<SecurityType, Dictionary<string, Symbol>>();\n            foreach (var group in symbolPropertiesMap.GroupBy(x => x.Key.SecurityType))\n            {\n                symbolMap[group.Key] = group.ToDictionary(\n                            x => x.Value.MarketTicker,\n                            x => x.Key);\n            }\n\n            _symbolPropertiesMap = symbolPropertiesMap;\n            _symbolMap = symbolMap;\n\n            // Update the last reload time\n            _lastReloadTime = DateTime.UtcNow;\n            return true;\n        }\n\n        /// <summary>\n        /// Converts a Lean symbol instance to a brokerage symbol\n        /// </summary>\n        /// <param name=\"symbol\">A Lean symbol instance</param>\n        /// <returns>The brokerage symbol</returns>\n        public string GetBrokerageSymbol(Symbol symbol)\n        {\n            if (symbol == null || string.IsNullOrWhiteSpace(symbol.Value))\n            {\n                throw new ArgumentException($\"Invalid symbol: {(symbol == null ? \"null\" : symbol.Value)}\");\n            }\n\n            if (symbol.ID.Market != _market)\n            {\n                throw new ArgumentException($\"Invalid market: {symbol.ID.Market}\");\n            }\n\n            // First attempt with current mappings\n            if (!_symbolPropertiesMap.TryGetValue(symbol, out var symbolProperties))\n            {\n                // If not found, try to refresh the mappings and check again\n                if (!TryRefreshMappings() || !_symbolPropertiesMap.TryGetValue(symbol, out symbolProperties))\n                {\n                    throw new ArgumentException($\"Unknown symbol: {symbol.Value}/{symbol.SecurityType}/{symbol.ID.Market}\");\n                }\n            }\n\n            if (string.IsNullOrWhiteSpace(symbolProperties.MarketTicker))\n            {\n                throw new ArgumentException($\"MarketTicker not found in database for symbol: {symbol.Value}\");\n            }\n\n            return symbolProperties.MarketTicker;\n        }\n\n        /// <summary>\n        /// Converts a brokerage symbol to a Lean symbol instance\n        /// </summary>\n        /// <param name=\"brokerageSymbol\">The brokerage symbol</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"expirationDate\">Expiration date of the security(if applicable)</param>\n        /// <param name=\"strike\">The strike of the security (if applicable)</param>\n        /// <param name=\"optionRight\">The option right of the security (if applicable)</param>\n        /// <returns>A new Lean Symbol instance</returns>\n        public Symbol GetLeanSymbol(string brokerageSymbol, SecurityType securityType, string market, DateTime expirationDate = default(DateTime), decimal strike = 0, OptionRight optionRight = OptionRight.Call)\n        {\n            if (string.IsNullOrWhiteSpace(brokerageSymbol))\n            {\n                throw new ArgumentException($\"Invalid brokerage symbol: {brokerageSymbol}\");\n            }\n\n            if (market != _market)\n            {\n                throw new ArgumentException($\"Invalid market: {market}\");\n            }\n\n            // First attempt with current mappings\n            if (!TryGetLeanSymbol(brokerageSymbol, securityType, out var symbol))\n            {\n                // If not found, try to refresh and check again\n                if (!TryRefreshMappings() || !TryGetLeanSymbol(brokerageSymbol, securityType, out symbol))\n                {\n                    throw new ArgumentException($\"Unknown brokerage symbol: {brokerageSymbol}/{securityType}\");\n                }\n            }\n\n            return symbol;\n        }\n\n        private bool TryGetLeanSymbol(string brokerageSymbol, SecurityType securityType, out Symbol symbol)\n        {\n            symbol = null;\n            return _symbolMap.TryGetValue(securityType, out var symbols) && symbols.TryGetValue(brokerageSymbol, out symbol);\n        }\n\n        /// <summary>\n        /// Checks if the Lean symbol is supported by the brokerage\n        /// </summary>\n        /// <param name=\"symbol\">The Lean symbol</param>\n        /// <returns>True if the brokerage supports the symbol</returns>\n        public bool IsKnownLeanSymbol(Symbol symbol)\n        {\n            if (string.IsNullOrWhiteSpace(symbol?.Value))\n            {\n                return false;\n            }\n\n            // First check current mappings\n            if (_symbolPropertiesMap.ContainsKey(symbol))\n            {\n                return true;\n            }\n\n            // If not found, try to refresh and check again\n            return TryRefreshMappings() && _symbolPropertiesMap.ContainsKey(symbol);\n        }\n\n        /// <summary>\n        /// Returns the security type for a brokerage symbol\n        /// </summary>\n        /// <param name=\"brokerageSymbol\">The brokerage symbol</param>\n        /// <returns>The security type</returns>\n        public SecurityType GetBrokerageSecurityType(string brokerageSymbol)\n        {\n            if (string.IsNullOrWhiteSpace(brokerageSymbol))\n            {\n                throw new ArgumentException($\"Invalid brokerage symbol: {brokerageSymbol}\");\n            }\n\n            // First attempt with current mappings\n            var result = GetMatchingSymbols(brokerageSymbol);\n            if (result.Count == 0)\n            {\n                // If not found, try to refresh and check again\n                if (!TryRefreshMappings() || (result = GetMatchingSymbols(brokerageSymbol)).Count == 0)\n                {\n                    throw new ArgumentException($\"Unknown brokerage symbol: {brokerageSymbol}\");\n                }\n            }\n\n            if (result.Count > 1)\n            {\n                throw new ArgumentException($\"Found multiple brokerage symbols: {string.Join(\",\", result)}\");\n            }\n\n            return result[0].SecurityType;\n        }\n\n        private List<Symbol> GetMatchingSymbols(string brokerageSymbol)\n        {\n            return _symbolMap.Select(kvp =>\n            {\n                kvp.Value.TryGetValue(brokerageSymbol, out var symbol);\n                return symbol;\n            }).Where(s => s != null).ToList();\n        }\n\n        /// <summary>\n        /// Checks if the symbol is supported by the brokerage\n        /// </summary>\n        /// <param name=\"brokerageSymbol\">The brokerage symbol</param>\n        /// <returns>True if the brokerage supports the symbol</returns>\n        public bool IsKnownBrokerageSymbol(string brokerageSymbol)\n        {\n            if (string.IsNullOrWhiteSpace(brokerageSymbol))\n            {\n                return false;\n            }\n\n            if (_symbolMap.Any(kvp => kvp.Value.ContainsKey(brokerageSymbol)))\n            {\n                return true;\n            }\n\n            // If not found, try to refresh and check again\n            return TryRefreshMappings() && _symbolMap.Any(kvp => kvp.Value.ContainsKey(brokerageSymbol));\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/WebSocketClientWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\nusing System;\nusing System.IO;\nusing System.Net.WebSockets;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Wrapper for System.Net.Websockets.ClientWebSocket to enhance testability\n    /// </summary>\n    public class WebSocketClientWrapper : IWebSocket\n    {\n        private const int ReceiveBufferSize = 8192;\n\n        private string _url;\n        private string _sessionToken;\n        private CancellationTokenSource _cts;\n        private ClientWebSocket _client;\n        private Task _taskConnect;\n        private object _connectLock = new object();\n        private readonly object _locker = new object();\n\n        /// <summary>\n        /// Wraps constructor\n        /// </summary>\n        /// <param name=\"url\">The target websocket url</param>\n        /// <param name=\"sessionToken\">The websocket session token</param>\n        public void Initialize(string url, string sessionToken = null)\n        {\n            _url = url;\n            _sessionToken = sessionToken;\n        }\n\n        /// <summary>\n        /// Wraps send method\n        /// </summary>\n        /// <param name=\"data\"></param>\n        public void Send(string data)\n        {\n            lock (_locker)\n            {\n                var buffer = new ArraySegment<byte>(Encoding.UTF8.GetBytes(data));\n                _client.SendAsync(buffer, WebSocketMessageType.Text, true, _cts.Token).SynchronouslyAwaitTask();\n            }\n        }\n\n        /// <summary>\n        /// Wraps Connect method\n        /// </summary>\n        public void Connect()\n        {\n            lock (_connectLock)\n            {\n                lock (_locker)\n                {\n                    if (_cts == null)\n                    {\n                        _cts = new CancellationTokenSource();\n\n                        _client = null;\n\n                        _taskConnect = Task.Factory.StartNew(\n                            () =>\n                            {\n                                Log.Trace($\"WebSocketClientWrapper connection task started: {_url}\");\n\n                                try\n                                {\n                                    HandleConnection();\n                                }\n                                catch (Exception e)\n                                {\n                                    Log.Error(e, $\"Error in WebSocketClientWrapper connection task: {_url}: \");\n                                }\n\n                                Log.Trace($\"WebSocketClientWrapper connection task ended: {_url}\");\n                            },\n                            _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);\n                    }\n                }\n\n                var count = 0;\n                do\n                {\n                    // wait for _client to be not null, we need to release the '_locker' lock used by 'HandleConnection'\n                    if (_client != null || _cts.Token.WaitHandle.WaitOne(50))\n                    {\n                        break;\n                    }\n                }\n                while (++count < 100);\n            }\n        }\n\n        /// <summary>\n        /// Wraps Close method\n        /// </summary>\n        public void Close()\n        {\n            lock (_locker)\n            {\n                try\n                {\n                    _cts?.Cancel();\n\n                    try\n                    {\n                        _client?.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, \"\", _cts.Token).SynchronouslyAwaitTask();\n                    }\n                    catch\n                    {\n                        // ignored\n                    }\n\n                    _taskConnect?.Wait(TimeSpan.FromSeconds(5));\n\n                    _cts.DisposeSafely();\n                }\n                catch (Exception e)\n                {\n                    Log.Error($\"WebSocketClientWrapper.Close({_url}): {e}\");\n                }\n\n                _cts = null;\n            }\n\n            if (_client != null)\n            {\n                OnClose(new WebSocketCloseData(0, string.Empty, true));\n            }\n        }\n\n        /// <summary>\n        /// Wraps IsAlive\n        /// </summary>\n        public bool IsOpen => _client?.State == WebSocketState.Open;\n\n        /// <summary>\n        /// Wraps message event\n        /// </summary>\n        public event EventHandler<WebSocketMessage> Message;\n\n        /// <summary>\n        /// Wraps error event\n        /// </summary>\n        public event EventHandler<WebSocketError> Error;\n\n        /// <summary>\n        /// Wraps open method\n        /// </summary>\n        public event EventHandler Open;\n\n        /// <summary>\n        /// Wraps close method\n        /// </summary>\n        public event EventHandler<WebSocketCloseData> Closed;\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"Message\"/> event\n        /// </summary>\n        protected virtual void OnMessage(WebSocketMessage e)\n        {\n            Message?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"Error\"/> event\n        /// </summary>\n        /// <param name=\"e\"></param>\n        protected virtual void OnError(WebSocketError e)\n        {\n            Log.Error(e.Exception, $\"WebSocketClientWrapper.OnError(): (IsOpen:{IsOpen}, State:{_client.State}): {_url}: {e.Message}\");\n            Error?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"Open\"/> event\n        /// </summary>\n        protected virtual void OnOpen()\n        {\n            Log.Trace($\"WebSocketClientWrapper.OnOpen(): Connection opened (IsOpen:{IsOpen}, State:{_client.State}): {_url}\");\n            Open?.Invoke(this, EventArgs.Empty);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"Close\"/> event\n        /// </summary>\n        protected virtual void OnClose(WebSocketCloseData e)\n        {\n            Log.Trace($\"WebSocketClientWrapper.OnClose(): Connection closed (IsOpen:{IsOpen}, State:{_client.State}): {_url}\");\n            Closed?.Invoke(this, e);\n        }\n\n        private void HandleConnection()\n        {\n            var receiveBuffer = new byte[ReceiveBufferSize];\n\n            while (_cts is { IsCancellationRequested: false })\n            {\n                Log.Trace($\"WebSocketClientWrapper.HandleConnection({_url}): Connecting...\");\n\n                const int maximumWaitTimeOnError = 120 * 1000;\n                const int minimumWaitTimeOnError = 2 * 1000;\n                var waitTimeOnError = minimumWaitTimeOnError;\n                using (var connectionCts = CancellationTokenSource.CreateLinkedTokenSource(_cts.Token))\n                {\n                    try\n                    {\n                        lock (_locker)\n                        {\n                            _client.DisposeSafely();\n                            _client = new ClientWebSocket();\n                            if (_sessionToken != null)\n                            {\n                                _client.Options.SetRequestHeader(\"x-session-token\", _sessionToken);\n                            }\n                            _client.ConnectAsync(new Uri(_url), connectionCts.Token).SynchronouslyAwaitTask();\n                        }\n                        OnOpen();\n\n                        while ((_client.State == WebSocketState.Open || _client.State == WebSocketState.CloseSent) &&\n                            !connectionCts.IsCancellationRequested)\n                        {\n                            var messageData = ReceiveMessage(_client, connectionCts.Token, receiveBuffer);\n\n                            if (messageData == null)\n                            {\n                                break;\n                            }\n\n                            // reset wait time\n                            waitTimeOnError = minimumWaitTimeOnError;\n                            OnMessage(new WebSocketMessage(this, messageData));\n                        }\n                    }\n                    catch (OperationCanceledException) { }\n                    catch (ObjectDisposedException) { }\n                    catch (WebSocketException ex)\n                    {\n                        if (!connectionCts.IsCancellationRequested)\n                        {\n                            OnError(new WebSocketError(ex.Message, ex));\n                            connectionCts.Token.WaitHandle.WaitOne(waitTimeOnError);\n\n                            // increase wait time until a maximum value. This is useful during brokerage down times\n                            waitTimeOnError += Math.Min(maximumWaitTimeOnError, waitTimeOnError);\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        if (!connectionCts.IsCancellationRequested)\n                        {\n                            OnError(new WebSocketError(ex.Message, ex));\n                        }\n                    }\n\n                    if (!connectionCts.IsCancellationRequested)\n                    {\n                        connectionCts.Cancel();\n                    }\n                }\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private MessageData ReceiveMessage(\n            ClientWebSocket webSocket,\n            CancellationToken ct,\n            byte[] receiveBuffer)\n        {\n            var buffer = new ArraySegment<byte>(receiveBuffer);\n\n            using (var ms = new MemoryStream())\n            {\n                WebSocketReceiveResult result;\n\n                do\n                {\n                    result = webSocket.ReceiveAsync(buffer, ct).SynchronouslyAwaitTask();\n                    ms.Write(buffer.Array, buffer.Offset, result.Count);\n                }\n                while (!result.EndOfMessage);\n\n                if (result.MessageType == WebSocketMessageType.Binary)\n                {\n                    return new BinaryMessage\n                    {\n                        Data = ms.ToArray(),\n                        Count = result.Count,\n                    };\n                }\n                else if (result.MessageType == WebSocketMessageType.Text)\n                {\n                    return new TextMessage\n                    {\n                        Message = Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Length),\n                    };\n                }\n                else if (result.MessageType == WebSocketMessageType.Close)\n                {\n                    Log.Trace($\"WebSocketClientWrapper.HandleConnection({_url}): WebSocketMessageType.Close - Data: {Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Length)}\");\n                    return null;\n                }\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Defines a message of websocket data\n        /// </summary>\n        public abstract class MessageData\n        {\n            /// <summary>\n            /// Type of message\n            /// </summary>\n            public WebSocketMessageType MessageType { get; set; }\n        }\n\n        /// <summary>\n        /// Defines a text-Type message of websocket data\n        /// </summary>\n        public class TextMessage : MessageData\n        {\n            /// <summary>\n            /// Data contained in message\n            /// </summary>\n            public string Message { get; set; }\n\n            /// <summary>\n            /// Constructs default instance of the TextMessage\n            /// </summary>\n            public TextMessage()\n            {\n                MessageType = WebSocketMessageType.Text;\n            }\n        }\n\n        /// <summary>\n        /// Defines a byte-Type message of websocket data\n        /// </summary>\n        public class BinaryMessage : MessageData\n        {\n            /// <summary>\n            /// Data contained in message\n            /// </summary>\n            public byte[] Data { get; set; }\n\n            /// <summary>\n            /// Count of message\n            /// </summary>\n            public int Count { get; set; }\n\n            /// <summary>\n            /// Constructs default instance of the BinaryMessage\n            /// </summary>\n            public BinaryMessage()\n            {\n                MessageType = WebSocketMessageType.Binary;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Brokerages/WebSocketCloseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Defines data returned from a web socket close event\n    /// </summary>\n    public class WebSocketCloseData\n    {\n        /// <summary>\n        /// Gets the status code for the connection close.\n        /// </summary>\n        public ushort Code { get; }\n\n        /// <summary>\n        /// Gets the reason for the connection close.\n        /// </summary>\n        public string Reason { get; }\n\n        /// <summary>\n        /// Gets a value indicating whether the connection has been closed cleanly.\n        /// </summary>\n        public bool WasClean { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WebSocketCloseData\"/> class\n        /// </summary>\n        /// <param name=\"code\">The status code for the connection close</param>\n        /// <param name=\"reason\">The reaspn for the connection close</param>\n        /// <param name=\"wasClean\">True if the connection has been closed cleanly, false otherwise</param>\n        public WebSocketCloseData(ushort code, string reason, bool wasClean)\n        {\n            Code = code;\n            Reason = reason;\n            WasClean = wasClean;\n        }\n    }\n}"
  },
  {
    "path": "Brokerages/WebSocketError.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Defines data returned from a web socket error\n    /// </summary>\n    public class WebSocketError\n    {\n        /// <summary>\n        /// Gets the message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Gets the exception raised\n        /// </summary>\n        public Exception Exception { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WebSocketError\"/> class\n        /// </summary>\n        /// <param name=\"message\">The message</param>\n        /// <param name=\"exception\">The error</param>\n        public WebSocketError(string message, Exception exception)\n        {\n            Message = message;\n            Exception = exception;\n        }\n    }\n}"
  },
  {
    "path": "Brokerages/WebSocketMessage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Defines a message received at a web socket\n    /// </summary>\n    public class WebSocketMessage\n    {\n        /// <summary>\n        /// Gets the sender websocket instance\n        /// </summary>\n        public IWebSocket WebSocket { get; }\n\n        /// <summary>\n        /// Gets the raw message data as text\n        /// </summary>\n        public WebSocketClientWrapper.MessageData Data { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WebSocketMessage\"/> class\n        /// </summary>\n        /// <param name=\"webSocket\">The sender websocket instance</param>\n        /// <param name=\"data\">The message data</param>\n        public WebSocketMessage(IWebSocket webSocket, WebSocketClientWrapper.MessageData data)\n        {\n            WebSocket = webSocket;\n            Data = data;\n        }\n    }\n}\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributor's Guide\n\nWelcome and thank you for your interest in contributing to the QuantConnect Lean open source project.  This document aims to describe the preferred workflow contributors should follow when contributing new source code to the project. This Git workflow is inspired greatly by the [irON-Parsers Contributors Guide](https://github.com/structureddynamics/irON-Parsers/wiki/Collaboration%3A-git-development-workflow).\n\n# Contributing\n\n## Who is a Collaborator?\n\nA collaborator is someone with write access to the QuantConnect Lean repository. Collaborators merge pull requests from contributors.\n\n## Who is a Contributor?\n\nA contributor can be anyone! It could be you. Continue reading this section if you wish to get involved and contribute back to the QuantConnect Lean open source project!\n\n## Code Style and Testing\n\nCode reviewers will be expecting to see code that follows Microsoft's C# guidelines. There are a few resources available [here](https://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx) and [here](https://msdn.microsoft.com/en-us/library/ff926074.aspx).\n\nAs a point of consistency, we use soft tabs of four spaces to ensure files render correctly in everyone's environment/diff tools.\n\nAll pull requests must be accompanied by unit tests. If it is a new feature, the tests should highlight expected use cases as well as edge cases, if applicable. If it is a bugfix, there should be tests that expose the bug in question.\n\n## Guidelines for Framework Modules Contributions\n\nContributions of [Algorithm Framework](https://www.quantconnect.com/docs/algorithm-framework/overview) Modules needs to follow certain extra patterns, since QuantConnect users can use them in their algorithms.\n\nGenerally modules should do one focused, specific role well. For example, combining risk control logic with [notifications](https://www.quantconnect.com/docs/live-trading/notifications) or placing orders outside execution models violates the general programming rule 'separation of concerns'. Keep each module doing one specific task and if you want to consider additional functionality add event handlers that users can bind to from their Algorithm instance.\n\nBy default production code should be silent unless there is a fatal exception. Because of this, [logging or debugging](https://www.quantconnect.com/docs/algorithm-reference/logging-and-debug) is not allowed inside LEAN framework modules. Additional [charting](https://www.quantconnect.com/docs/algorithm-reference/charting) inside the module consumes the resources and should not be included in a module as well.\n\n## Initial Setup\n\n* Setup a [GitHub](https://github.com/) account\n* [Fork](https://help.github.com/articles/fork-a-repo/) the [repository](https://github.com/QuantConnect/Lean) of the project\n* Clone your fork locally\n\n```bash\n$ git clone https://github.com/username/Lean.git\n```\n\n* Navigate to the QuantConnect Lean directory and add the upstream remote\n\n```bash\n$ cd Lean\n$ git remote add upstream https://github.com/QuantConnect/Lean.git\n```\n\nThe remote upstream branch links your fork of Lean with our master copy, so when you perform a `git pull --rebase` you'll be getting updates from our repository.\n\n## Keeping your master up-to-date!\nNow that you've defined the `remote upstream branch`, you can refresh your local copy of master with the following commands:\n\n```bash\n$ git checkout master\n$ git pull --rebase\n```\n\nThis will checkout your local master branch and then merge changes in from the remote upstream branch. We use [rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) to reduce noise from merge commits.\n\n# Branching Model\n\nIf unfamiliar with git branches, please read this [short guide on branches](https://www.atlassian.com/git/tutorials/using-branches/).\n\nThe following names will be used to differentiate between the different repositories:\n\n* **upstream** - The 'official' QuantConnect Lean [repository](https://github.com/QuantConnect/Lean.git) (what is on QuantConnect's GitHub account)\n* **origin** - Your fork of the official repository on GitHub (what is on your GitHub account)\n* **local** - This will be your local clone of **origin** (what is on your computer)\n\nAs a **contributor** you will push your completed **local** topic branch to **origin**. As a **contributor** you will pull your updates from **upstream**. As a **collaborator** (write-access) you will merge branches from **contributors** into **upstream**.\n\n## Primary Branch\n\nThe upstream repository holds a single primary branch that we maintain:\n\n* **upstream/master** - This is where main development takes place\n\n## Topic Branches\n\nTopic branches are for contributors to develop bug fixes and new features so that they can be easily merged to **master**. They must follow a few simple rules for consistency:\n\n* Must branch off from **master**\n* Must be merged back into **master**\n* Consider using the GitHub issue number in the branch name\n\nTopic branches should exist in your **local** and **origin** repositories only. Submitting a pull request will request a merge from your topic branch to our **upstream/master** branch.\n\n## Working on topic branches\n\nFirst create a new branch for the work you'd like to perform. When naming your branch, please use the following convention: `bug-<issue#>-<description>` or `feature-<issue#>-<description>`:\n\n```bash\n$ git checkout -b bug-123-short-issue-description\nSwitched to a new branch 'bug-123-short-issue-description'\n```\n\nNow perform some work and commit changes. Always review your changes before committing\n\n```bash\n$ git status\n$ git diff\n$ git add --all\n$ git commit\n```\n\nYou can push your changes to your fork's topic branch using:\n\n```bash\n$ git push origin bug-123-short-issue-description\n```\n\nWhen committing, be sure to follow [best practices](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) writing good commit descriptions.\n\nAfter performing some work you'll want to merge in changes from the **upstream/master**. You can use the following two commands in order to assist upstream merging:\n\n```bash\n$ git fetch upstream\n$ git rebase upstream/master bug-123-short-issue-description\n```\n\nThe `git fetch upstream` command will download the **upstream** repository to your computer but not merge it. The `rebase upstream/master bug-123-short-issue-description` command will [rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-commit--amend) your changes on top of **upstream/master**. This will make the review process easier for **collaborators**.\n\n> CAUTION Please note that once you have pushed your branch remotely you MUST NOT rebase!\n\nIf you need to merge changes in after pushing your branch to **origin**, use the following:\n\n```bash\n$ git pull upstream master\n```\n\nWhen topic branches are finished and ready for review, they should be pushed back to **origin**.\n\n```bash\n$ git push origin bug-123-short-issue-description\nTo git@github.com:username/Lean.git\n    * [new branch]       bug-123-short-issue-description -> bug-123-short-issue-description\n```\n\nNow you're ready to send a [pull request](https://help.github.com/articles/using-pull-requests/) from this branch to **upstream/master** and update the GitHub issue tracker to let a collaborator know that your branch is ready to be reviewed and merged.  If extra changes are required as part of the review process, make those changes on the topic branch and re-push. First re-checkout the topic branch you made your original changes on:\n\n```bash\n$ git checkout bug-123-short-issue-description\n```\n\nNow make responses to the review comments, commit, and re-push your changes:\n\n```bash\n$ git add --all\n$ git commit\n$ git push\n```\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/Analysis/InsightManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas.Analysis\n{\n    /// <summary>\n    /// Encapsulates the storage of insights.\n    /// </summary>\n    public class InsightManager : InsightCollection\n    {\n        private readonly IAlgorithm _algorithm;\n        private IInsightScoreFunction _insightScoreFunction;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"algorithm\">The associated algorithm instance</param>\n        public InsightManager(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n        }\n\n        /// <summary>\n        /// Process a new time step handling insights scoring\n        /// </summary>\n        /// <param name=\"utcNow\">The current utc time</param>\n        public void Step(DateTime utcNow)\n        {\n            _insightScoreFunction?.Score(this, utcNow);\n        }\n\n        /// <summary>\n        /// Sets the insight score function to use\n        /// </summary>\n        /// <param name=\"insightScoreFunction\">Model that scores insights</param>\n        public void SetInsightScoreFunction(IInsightScoreFunction insightScoreFunction)\n        {\n            _insightScoreFunction = insightScoreFunction;\n        }\n\n        /// <summary>\n        /// Sets the insight score function to use\n        /// </summary>\n        /// <param name=\"insightScoreFunction\">Model that scores insights</param>\n        public void SetInsightScoreFunction(PyObject insightScoreFunction)\n        {\n            _insightScoreFunction = PythonUtil.CreateInstanceOrWrapper<IInsightScoreFunction>(\n                insightScoreFunction,\n                py => new InsightScoreFunctionPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Expire the insights of the given symbols\n        /// </summary>\n        /// <param name=\"symbols\">Symbol we want to expire insights for</param>\n        public void Expire(IEnumerable<Symbol> symbols)\n        {\n            if (symbols == null)\n            {\n                return;\n            }\n\n            foreach (var symbol in symbols)\n            {\n                if (TryGetValue(symbol, out var insights))\n                {\n                    Expire(insights);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Cancel the insights of the given symbols\n        /// </summary>\n        /// <param name=\"symbols\">Symbol we want to cancel insights for</param>\n        public void Cancel(IEnumerable<Symbol> symbols)\n        {\n            Expire(symbols);\n        }\n\n        /// <summary>\n        /// Expire the given insights\n        /// </summary>\n        /// <param name=\"insights\">Insights to expire</param>\n        public void Expire(IEnumerable<Insight> insights)\n        {\n            if (insights == null)\n            {\n                return;\n            }\n\n            var currentUtcTime = _algorithm.UtcTime;\n            foreach (var insight in insights)\n            {\n                insight.Expire(currentUtcTime);\n            }\n        }\n\n        /// <summary>\n        /// Cancel the given insights\n        /// </summary>\n        /// <param name=\"insights\">Insights to cancel</param>\n        public void Cancel(IEnumerable<Insight> insights)\n        {\n            Expire(insights);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/GeneratedInsightsCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Defines a collection of insights that were generated at the same time step\n    /// </summary>\n    public class GeneratedInsightsCollection\n    {\n        /// <summary>\n        /// The utc date time the insights were generated\n        /// </summary>\n        public DateTime DateTimeUtc { get; }\n\n        /// <summary>\n        /// The generated insights\n        /// </summary>\n        public Insight[] Insights { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GeneratedInsightsCollection\"/> class\n        /// </summary>\n        /// <param name=\"dateTimeUtc\">The utc date time the sinals were generated</param>\n        /// <param name=\"insights\">The generated insights</param>\n        public GeneratedInsightsCollection(DateTime dateTimeUtc, Insight[] insights)\n        {\n            DateTimeUtc = dateTimeUtc;\n            Insights = insights;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/IInsightScoreFunction.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Abstraction in charge of scoring insights\n    /// </summary>\n    public interface IInsightScoreFunction\n    {\n        /// <summary>\n        /// Method to evaluate and score insights for each time step\n        /// </summary>\n        void Score(InsightManager insightManager, DateTime utcTime);\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/Insight.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Algorithm.Framework.Alphas.Serialization;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Defines a alpha prediction for a single symbol generated by the algorithm\n    /// </summary>\n    /// <remarks>\n    /// Serialization of this type is delegated to the <see cref=\"InsightJsonConverter\"/> which uses the <see cref=\"SerializedInsight\"/> as a model.\n    /// </remarks>\n    [JsonConverter(typeof(InsightJsonConverter))]\n    public class Insight\n    {\n        private readonly IPeriodSpecification _periodSpecification;\n\n        /// <summary>\n        /// Gets the unique identifier for this insight\n        /// </summary>\n        public Guid Id { get; protected set; }\n\n        /// <summary>\n        /// Gets the group id this insight belongs to, null if not in a group\n        /// </summary>\n        public Guid? GroupId { get; protected set; }\n\n        /// <summary>\n        /// Gets an identifier for the source model that generated this insight.\n        /// </summary>\n        public string SourceModel { get; set; }\n\n        /// <summary>\n        /// Gets the utc time this insight was generated\n        /// </summary>\n        /// <remarks>\n        /// The algorithm framework handles setting this value appropriately.\n        /// If providing custom <see cref=\"Insight\"/> implementation, be sure\n        /// to set this value to algorithm.UtcTime when the insight is generated.\n        /// </remarks>\n        public DateTime GeneratedTimeUtc { get; set; }\n\n        /// <summary>\n        /// Gets the insight's prediction end time. This is the time when this\n        /// insight prediction is expected to be fulfilled. This time takes into\n        /// account market hours, weekends, as well as the symbol's data resolution\n        /// </summary>\n        public DateTime CloseTimeUtc { get; set; }\n\n        /// <summary>\n        /// Gets the symbol this insight is for\n        /// </summary>\n        public Symbol Symbol { get; private set; }\n\n        /// <summary>\n        /// Gets the type of insight, for example, price insight or volatility insight\n        /// </summary>\n        public InsightType Type { get; private set; }\n\n        /// <summary>\n        /// Gets the initial reference value this insight is predicting against. The value is dependent on the specified <see cref=\"InsightType\"/>\n        /// </summary>\n        public decimal ReferenceValue { get; set; }\n\n        /// <summary>\n        /// Gets the final reference value, used for scoring, this insight is predicting against. The value is dependent on the specified <see cref=\"InsightType\"/>\n        /// </summary>\n        public decimal ReferenceValueFinal { get; set; }\n\n        /// <summary>\n        /// Gets the predicted direction, down, flat or up\n        /// </summary>\n        public InsightDirection Direction { get; private set; }\n\n        /// <summary>\n        /// Gets the period over which this insight is expected to come to fruition\n        /// </summary>\n        public TimeSpan Period { get; internal set; }\n\n        /// <summary>\n        /// Gets the predicted percent change in the insight type (price/volatility)\n        /// </summary>\n        public double? Magnitude { get; private set; }\n\n        /// <summary>\n        /// Gets the confidence in this insight\n        /// </summary>\n        public double? Confidence { get; private set; }\n\n        /// <summary>\n        /// Gets the portfolio weight of this insight\n        /// </summary>\n        public double? Weight { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent scores for this insight\n        /// </summary>\n        public InsightScore Score { get; protected set; }\n\n        /// <summary>\n        /// Gets the estimated value of this insight in the account currency\n        /// </summary>\n        public decimal EstimatedValue { get; set; }\n\n        /// <summary>\n        /// The insight's tag containing additional information\n        /// </summary>\n        public string Tag { get; protected set; }\n\n        /// <summary>\n        /// Determines whether or not this insight is considered expired at the specified <paramref name=\"utcTime\"/>\n        /// </summary>\n        /// <param name=\"utcTime\">The algorithm's current time in UTC. See <see cref=\"IAlgorithm.UtcTime\"/></param>\n        /// <returns>True if this insight is expired, false otherwise</returns>\n        public bool IsExpired(DateTime utcTime)\n        {\n            return CloseTimeUtc < utcTime;\n        }\n\n        /// <summary>\n        /// Determines whether or not this insight is considered active at the specified <paramref name=\"utcTime\"/>\n        /// </summary>\n        /// <param name=\"utcTime\">The algorithm's current time in UTC. See <see cref=\"IAlgorithm.UtcTime\"/></param>\n        /// <returns>True if this insight is active, false otherwise</returns>\n        public bool IsActive(DateTime utcTime)\n        {\n            return !IsExpired(utcTime);\n        }\n\n        /// <summary>\n        /// Expire this insight\n        /// </summary>\n        /// <param name=\"utcTime\">The algorithm's current time in UTC. See <see cref=\"IAlgorithm.UtcTime\"/></param>\n        public void Expire(DateTime utcTime)\n        {\n            if (IsActive(utcTime))\n            {\n                CloseTimeUtc = utcTime.Add(-Time.OneSecond);\n                Period = CloseTimeUtc - GeneratedTimeUtc;\n            }\n        }\n\n        /// <summary>\n        /// Cancel this insight\n        /// </summary>\n        /// <param name=\"utcTime\">The algorithm's current time in UTC. See <see cref=\"IAlgorithm.UtcTime\"/></param>\n        public void Cancel(DateTime utcTime)\n        {\n            Expire(utcTime);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Insight\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"period\">The period over which the prediction will come true</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        public Insight(Symbol symbol, TimeSpan period, InsightType type, InsightDirection direction, string tag = \"\")\n            : this(symbol, period, type, direction, null, null, null, null, tag)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Insight\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"period\">The period over which the prediction will come true</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percentage change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">An identifier defining the model that generated this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        public Insight(Symbol symbol, TimeSpan period, InsightType type, InsightDirection direction, double? magnitude, double? confidence, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            Id = Guid.NewGuid();\n            Score = new InsightScore();\n            SourceModel = sourceModel;\n\n            Symbol = symbol;\n            Type = type;\n            Direction = direction;\n            Period = period;\n\n            // Optional\n            Magnitude = magnitude;\n            Confidence = confidence;\n            Weight = weight;\n            Tag = tag;\n\n            _periodSpecification = new TimeSpanPeriodSpecification(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Insight\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"expiryFunc\">Func that defines the expiry time</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        public Insight(Symbol symbol, Func<DateTime, DateTime> expiryFunc, InsightType type, InsightDirection direction, string tag = \"\")\n            : this(symbol, expiryFunc, type, direction, null, null, null, null, tag)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Insight\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"expiryFunc\">Func that defines the expiry time</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percentage change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">An identifier defining the model that generated this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        public Insight(Symbol symbol, Func<DateTime, DateTime> expiryFunc, InsightType type, InsightDirection direction, double? magnitude, double? confidence, string sourceModel = null, double? weight = null, string tag = \"\")\n            : this(symbol, new FuncPeriodSpecification(expiryFunc), type, direction, magnitude, confidence, sourceModel, weight, tag)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Insight\"/> class.\n        /// This constructor is provided mostly for testing purposes. When running inside an algorithm,\n        /// the generated and close times are set based on the algorithm's time.\n        /// </summary>\n        /// <param name=\"generatedTimeUtc\">The time this insight was generated in utc</param>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"period\">The period over which the prediction will come true</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percentage change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">An identifier defining the model that generated this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        public Insight(DateTime generatedTimeUtc, Symbol symbol, TimeSpan period, InsightType type, InsightDirection direction, double? magnitude, double? confidence, string sourceModel = null, double? weight = null, string tag = \"\")\n            : this(symbol, period, type, direction, magnitude, confidence, sourceModel, weight, tag)\n        {\n            GeneratedTimeUtc = generatedTimeUtc;\n            CloseTimeUtc = generatedTimeUtc + period;\n        }\n\n        /// <summary>\n        /// Private constructor used to keep track of how a user defined the insight period.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"periodSpec\">A specification defining how the insight's period was defined, via time span, via resolution/barcount, via close time</param>\n        /// <param name=\"type\">The type of insight, price/volatility</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percentage change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">An identifier defining the model that generated this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        private Insight(Symbol symbol, IPeriodSpecification periodSpec, InsightType type, InsightDirection direction, double? magnitude, double? confidence, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            Id = Guid.NewGuid();\n            Score = new InsightScore();\n            SourceModel = sourceModel;\n\n            Symbol = symbol;\n            Type = type;\n            Direction = direction;\n\n            // Optional\n            Magnitude = magnitude;\n            Confidence = confidence;\n            Weight = weight;\n            Tag = tag;\n\n            _periodSpecification = periodSpec;\n\n            // keep existing behavior of Insight.Price such that we set the period immediately\n            var period = (periodSpec as TimeSpanPeriodSpecification)?.Period;\n            if (period != null)\n            {\n                Period = period.Value;\n            }\n        }\n\n        /// <summary>\n        /// Sets the insight period and close times if they have not already been set.\n        /// </summary>\n        /// <param name=\"exchangeHours\">The insight's security exchange hours</param>\n        public void SetPeriodAndCloseTime(SecurityExchangeHours exchangeHours)\n        {\n            if (GeneratedTimeUtc == default(DateTime))\n            {\n                throw new InvalidOperationException(Messages.Insight.GeneratedTimeUtcNotSet(this));\n            }\n\n            _periodSpecification.SetPeriodAndCloseTime(this, exchangeHours);\n        }\n\n        /// <summary>\n        /// Creates a deep clone of this insight instance\n        /// </summary>\n        /// <returns>A new insight with identical values, but new instances</returns>\n        public virtual Insight Clone()\n        {\n            return new Insight(Symbol, Period, Type, Direction, Magnitude, Confidence, weight: Weight, tag: Tag)\n            {\n                GeneratedTimeUtc = GeneratedTimeUtc,\n                CloseTimeUtc = CloseTimeUtc,\n                Score = Score,\n                Id = Id,\n                EstimatedValue = EstimatedValue,\n                ReferenceValue = ReferenceValue,\n                ReferenceValueFinal = ReferenceValueFinal,\n                SourceModel = SourceModel,\n                GroupId = GroupId\n            };\n        }\n\n        /// <summary>\n        /// Creates a new insight for predicting the percent change in price over the specified period\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"resolution\">The resolution used to define the insight's period and also used to determine the insight's close time</param>\n        /// <param name=\"barCount\">The number of resolution time steps to make in market hours to compute the insight's closing time</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percent change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">The model generating this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        /// <returns>A new insight object for the specified parameters</returns>\n        public static Insight Price(Symbol symbol, Resolution resolution, int barCount, InsightDirection direction, double? magnitude = null, double? confidence = null, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            if (barCount < 1)\n            {\n                throw new ArgumentOutOfRangeException(nameof(barCount), Messages.Insight.InvalidBarCount);\n            }\n\n            var spec = new ResolutionBarCountPeriodSpecification(resolution, barCount);\n            return new Insight(symbol, spec, InsightType.Price, direction, magnitude, confidence, sourceModel, weight, tag);\n        }\n\n        /// <summary>\n        /// Creates a new insight for predicting the percent change in price over the specified period\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"closeTimeLocal\">The insight's closing time in the security's exchange time zone</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percent change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">The model generating this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        /// <returns>A new insight object for the specified parameters</returns>\n        public static Insight Price(Symbol symbol, DateTime closeTimeLocal, InsightDirection direction, double? magnitude = null, double? confidence = null, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            var spec = closeTimeLocal == Time.EndOfTime ? (IPeriodSpecification)\n                new EndOfTimeCloseTimePeriodSpecification() : new CloseTimePeriodSpecification(closeTimeLocal);\n            return new Insight(symbol, spec, InsightType.Price, direction, magnitude, confidence, sourceModel, weight, tag);\n        }\n\n        /// <summary>\n        /// Creates a new insight for predicting the percent change in price over the specified period\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"period\">The period over which the prediction will come true</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percent change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">The model generating this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        /// <returns>A new insight object for the specified parameters</returns>\n        public static Insight Price(Symbol symbol, TimeSpan period, InsightDirection direction, double? magnitude = null, double? confidence = null, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            if (period < Time.OneSecond)\n            {\n                throw new ArgumentOutOfRangeException(nameof(period), Messages.Insight.InvalidPeriod);\n            }\n\n            var spec = period == Time.EndOfTimeTimeSpan ? (IPeriodSpecification)\n                new EndOfTimeCloseTimePeriodSpecification() : new TimeSpanPeriodSpecification(period);\n            return new Insight(symbol, spec, InsightType.Price, direction, magnitude, confidence, sourceModel, weight, tag);\n        }\n\n        /// <summary>\n        /// Creates a new insight for predicting the percent change in price over the specified period\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this insight is for</param>\n        /// <param name=\"expiryFunc\">Func that defines the expiry time</param>\n        /// <param name=\"direction\">The predicted direction</param>\n        /// <param name=\"magnitude\">The predicted magnitude as a percent change</param>\n        /// <param name=\"confidence\">The confidence in this insight</param>\n        /// <param name=\"sourceModel\">The model generating this insight</param>\n        /// <param name=\"weight\">The portfolio weight of this insight</param>\n        /// <param name=\"tag\">The insight's tag containing additional information</param>\n        /// <returns>A new insight object for the specified parameters</returns>\n        public static Insight Price(Symbol symbol, Func<DateTime, DateTime> expiryFunc, InsightDirection direction, double? magnitude = null, double? confidence = null, string sourceModel = null, double? weight = null, string tag = \"\")\n        {\n            return new Insight(symbol, expiryFunc, InsightType.Price, direction, magnitude, confidence, sourceModel, weight, tag);\n        }\n\n        /// <summary>\n        /// Creates a new, unique group id and sets it on each insight\n        /// </summary>\n        /// <param name=\"insights\">The insights to be grouped</param>\n        public static IEnumerable<Insight> Group(params Insight[] insights)\n        {\n            if (insights == null)\n            {\n                throw new ArgumentNullException(nameof(insights));\n            }\n\n            var groupId = Guid.NewGuid();\n            foreach (var insight in insights)\n            {\n                if (insight.GroupId.HasValue)\n                {\n                    throw new InvalidOperationException(Messages.Insight.InsightAlreadyAssignedToAGroup(insight));\n                }\n\n                insight.GroupId = groupId;\n            }\n            return insights;\n        }\n\n        /// <summary>\n        /// Creates a new, unique group id and sets it on each insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to be grouped</param>\n        public static IEnumerable<Insight> Group(Insight insight) => Group(new[] {insight});\n\n        /// <summary>\n        /// Creates a new <see cref=\"Insight\"/> object from the specified serialized form\n        /// </summary>\n        /// <param name=\"serializedInsight\">The insight DTO</param>\n        /// <returns>A new insight containing the information specified</returns>\n        public static Insight FromSerializedInsight(SerializedInsight serializedInsight)\n        {\n            var sid = SecurityIdentifier.Parse(serializedInsight.Symbol);\n            var insight = new Insight(\n                Time.UnixTimeStampToDateTime(serializedInsight.CreatedTime),\n                new Symbol(sid, serializedInsight.Ticker ?? sid.Symbol),\n                TimeSpan.FromSeconds(serializedInsight.Period),\n                serializedInsight.Type,\n                serializedInsight.Direction,\n                serializedInsight.Magnitude,\n                serializedInsight.Confidence,\n                serializedInsight.SourceModel,\n                serializedInsight.Weight,\n                serializedInsight.Tag\n            )\n            {\n                Id = Guid.Parse(serializedInsight.Id),\n                CloseTimeUtc = Time.UnixTimeStampToDateTime(serializedInsight.CloseTime),\n                EstimatedValue = serializedInsight.EstimatedValue,\n                ReferenceValue = serializedInsight.ReferenceValue,\n                ReferenceValueFinal = serializedInsight.ReferenceValueFinal,\n                GroupId = string.IsNullOrEmpty(serializedInsight.GroupId) ? (Guid?) null : Guid.Parse(serializedInsight.GroupId)\n            };\n\n            // only set score values if non-zero or if they're the final scores\n            if (serializedInsight.ScoreIsFinal)\n            {\n                insight.Score.SetScore(InsightScoreType.Magnitude, serializedInsight.ScoreMagnitude, insight.CloseTimeUtc);\n                insight.Score.SetScore(InsightScoreType.Direction, serializedInsight.ScoreDirection, insight.CloseTimeUtc);\n                insight.Score.Finalize(insight.CloseTimeUtc);\n            }\n            else\n            {\n                if (serializedInsight.ScoreMagnitude != 0)\n                {\n                    insight.Score.SetScore(InsightScoreType.Magnitude, serializedInsight.ScoreMagnitude, insight.CloseTimeUtc);\n                }\n\n                if (serializedInsight.ScoreDirection != 0)\n                {\n                    insight.Score.SetScore(InsightScoreType.Direction, serializedInsight.ScoreDirection, insight.CloseTimeUtc);\n                }\n            }\n\n            return insight;\n        }\n\n        /// <summary>\n        /// Computes the insight closing time from the given generated time, resolution and bar count.\n        /// This will step through market hours using the given resolution, respecting holidays, early closes, weekends, etc..\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange hours of the insight's security</param>\n        /// <param name=\"generatedTimeUtc\">The insight's generated time in utc</param>\n        /// <param name=\"resolution\">The resolution used to 'step-through' market hours to compute a reasonable close time</param>\n        /// <param name=\"barCount\">The number of resolution steps to take</param>\n        /// <returns>The insight's closing time in utc</returns>\n        public static DateTime ComputeCloseTime(SecurityExchangeHours exchangeHours, DateTime generatedTimeUtc, Resolution resolution, int barCount)\n        {\n            if (barCount < 1)\n            {\n                throw new ArgumentOutOfRangeException(nameof(barCount), Messages.Insight.InvalidBarCount);\n            }\n\n            // remap ticks to seconds\n            resolution = resolution == Resolution.Tick ? Resolution.Second : resolution;\n            if (resolution == Resolution.Hour)\n            {\n                // remap hours to minutes to avoid complications w/ stepping through\n                // for example 9->10 is an hour step but market opens at 9:30\n                barCount *= 60;\n                resolution = Resolution.Minute;\n            }\n\n            var barSize = resolution.ToTimeSpan();\n            var startTimeLocal = generatedTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);\n            var closeTimeLocal = Time.GetEndTimeForTradeBars(exchangeHours, startTimeLocal, barSize, barCount, false);\n            return closeTimeLocal.ConvertToUtc(exchangeHours.TimeZone);\n        }\n\n        /// <summary>\n        /// computs the insight closing time from the given generated time and period\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange hours of the insight's security</param>\n        /// <param name=\"generatedTimeUtc\">The insight's generated time in utc</param>\n        /// <param name=\"period\">The insight's period</param>\n        /// <returns>The insight's closing time in utc</returns>\n        public static DateTime ComputeCloseTime(SecurityExchangeHours exchangeHours, DateTime generatedTimeUtc, TimeSpan period)\n        {\n            if (period < Time.OneSecond)\n            {\n                throw new ArgumentOutOfRangeException(nameof(period), Messages.Insight.InvalidPeriod);\n            }\n\n            var barSize = period.ToHigherResolutionEquivalent(false);\n            // remap ticks to seconds\n            barSize = barSize == Resolution.Tick ? Resolution.Second : barSize;\n            // remap hours to minutes to avoid complications w/ stepping through, for example 9->10 is an hour step but market opens at 9:30\n            barSize = barSize == Resolution.Hour ? Resolution.Minute : barSize;\n            var barCount = (int)(period.Ticks / barSize.ToTimeSpan().Ticks);\n            var closeTimeUtc = ComputeCloseTime(exchangeHours, generatedTimeUtc, barSize, barCount);\n            if (closeTimeUtc == generatedTimeUtc)\n            {\n                return ComputeCloseTime(exchangeHours, generatedTimeUtc, Resolution.Second, 1);\n            }\n\n            var totalPeriodUsed = barSize.ToTimeSpan().Multiply(barCount);\n            if (totalPeriodUsed != period)\n            {\n                var delta = period - totalPeriodUsed;\n\n                // interpret the remainder as fractional trading days\n                if (barSize == Resolution.Daily)\n                {\n                    var percentOfDay = delta.Ticks / (double) Time.OneDay.Ticks;\n                    delta = exchangeHours.RegularMarketDuration.Multiply(percentOfDay);\n                }\n\n                if (delta != TimeSpan.Zero)\n                {\n                    // continue stepping forward using minute resolution for the remainder\n                    barCount = (int) (delta.Ticks / Time.OneMinute.Ticks);\n                    if (barCount > 0)\n                    {\n                        closeTimeUtc = ComputeCloseTime(exchangeHours, closeTimeUtc, Resolution.Minute, barCount);\n                    }\n                }\n            }\n\n            return closeTimeUtc;\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.Insight.ToString(this);\n        }\n\n        /// <summary>\n        /// Returns a short string that represents the current object.\n        /// </summary>\n        /// <returns>A string that represents the current object.</returns>\n        public string ShortToString()\n        {\n            return Messages.Insight.ShortToString(this);\n        }\n\n\n        /// <summary>\n        /// Distinguishes between the different ways an insight's period/close times can be specified\n        /// This was really only required since we can't properly acces certain data from within a static\n        /// context (such as Insight.Price) or from within a constructor w/out requiring the users to properly\n        /// fetch the required data and supply it as an argument.\n        /// </summary>\n        private interface IPeriodSpecification\n        {\n            void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours);\n        }\n\n        /// <summary>\n        /// User defined the insight's period using a time span\n        /// </summary>\n        private class TimeSpanPeriodSpecification : IPeriodSpecification\n        {\n            public readonly TimeSpan Period;\n\n            public TimeSpanPeriodSpecification(TimeSpan period)\n            {\n                if (period == TimeSpan.Zero)\n                {\n                    period = Time.OneSecond;\n                }\n\n                Period = period;\n            }\n\n            public void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours)\n            {\n                insight.Period = Period;\n                insight.CloseTimeUtc = ComputeCloseTime(exchangeHours, insight.GeneratedTimeUtc, Period);\n            }\n        }\n\n        /// <summary>\n        /// User defined insight's period using a resolution and bar count\n        /// </summary>\n        private class ResolutionBarCountPeriodSpecification : IPeriodSpecification\n        {\n            public readonly Resolution Resolution;\n            public readonly int BarCount;\n\n            public ResolutionBarCountPeriodSpecification(Resolution resolution, int barCount)\n            {\n                if (resolution == Resolution.Tick)\n                {\n                    resolution = Resolution.Second;\n                }\n\n                if (resolution == Resolution.Hour)\n                {\n                    // remap hours to minutes to avoid errors w/ half hours, for example, 9:30 open\n                    barCount *= 60;\n                    resolution = Resolution.Minute;\n                }\n\n                Resolution = resolution;\n                BarCount = barCount;\n            }\n\n            public void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours)\n            {\n                insight.CloseTimeUtc = ComputeCloseTime(exchangeHours, insight.GeneratedTimeUtc, Resolution, BarCount);\n                insight.Period = insight.CloseTimeUtc - insight.GeneratedTimeUtc;\n            }\n        }\n\n        /// <summary>\n        /// User defined the insight's local closing time\n        /// </summary>\n        private class CloseTimePeriodSpecification : IPeriodSpecification\n        {\n            public readonly DateTime CloseTimeLocal;\n\n            public CloseTimePeriodSpecification(DateTime closeTimeLocal)\n            {\n                CloseTimeLocal = closeTimeLocal;\n            }\n\n            public void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours)\n            {\n                // Prevent close time to be defined to a date/time in closed market\n                var closeTimeLocal = exchangeHours.IsOpen(CloseTimeLocal, false)\n                    ? CloseTimeLocal\n                    : exchangeHours.GetNextMarketOpen(CloseTimeLocal, false);\n\n                insight.CloseTimeUtc = closeTimeLocal.ConvertToUtc(exchangeHours.TimeZone);\n\n                if (insight.GeneratedTimeUtc > insight.CloseTimeUtc)\n                {\n                    throw new ArgumentOutOfRangeException(nameof(closeTimeLocal), $\"Insight closeTimeLocal must not be in the past.\");\n                }\n\n                insight.Period = insight.CloseTimeUtc - insight.GeneratedTimeUtc;\n            }\n        }\n\n        /// <summary>\n        /// Special case for insights which close time is defined by a function\n        /// and want insights to expiry with calendar rules\n        /// </summary>\n        private class FuncPeriodSpecification : IPeriodSpecification\n        {\n            public readonly Func<DateTime, DateTime> _expiryFunc;\n\n            public FuncPeriodSpecification(Func<DateTime, DateTime> expiryFunc)\n            {\n                _expiryFunc = expiryFunc;\n            }\n\n            public void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours)\n            {\n                var closeTimeLocal = insight.GeneratedTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);\n                closeTimeLocal = _expiryFunc(closeTimeLocal);\n\n                // Prevent close time to be defined to a date/time in closed market\n                if (!exchangeHours.IsOpen(closeTimeLocal, false))\n                {\n                    closeTimeLocal = exchangeHours.GetNextMarketOpen(closeTimeLocal, false);\n                }\n\n                insight.CloseTimeUtc = closeTimeLocal.ConvertToUtc(exchangeHours.TimeZone);\n                insight.Period = insight.CloseTimeUtc - insight.GeneratedTimeUtc;\n            }\n        }\n\n        /// <summary>\n        /// Special case for insights where we do not know whats the\n        /// <see cref=\"Period\"/> or <see cref=\"CloseTimeUtc\"/>.\n        /// </summary>\n        private class EndOfTimeCloseTimePeriodSpecification : IPeriodSpecification\n        {\n            public void SetPeriodAndCloseTime(Insight insight, SecurityExchangeHours exchangeHours)\n            {\n                insight.Period = Time.EndOfTimeTimeSpan;\n                insight.CloseTimeUtc = Time.EndOfTime;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides a collection for managing insights. This type provides collection access semantics\n    /// as well as dictionary access semantics through TryGetValue, ContainsKey, and this[symbol]\n    /// </summary>\n    public class InsightCollection : IEnumerable<Insight>\n    {\n        private int _totalInsightCount;\n        private int _openInsightCount;\n        private readonly List<Insight> _insightsComplete = new();\n        private readonly Dictionary<Symbol, List<Insight>> _insights = new();\n\n        /// <summary>\n        /// The open insight count\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                lock (_insights)\n                {\n                    return _openInsightCount;\n                }\n            }\n        }\n\n        /// <summary>\n        /// The total insight count\n        /// </summary>\n        public int TotalCount\n        {\n            get\n            {\n                lock (_insights)\n                {\n                    return _totalInsightCount;\n                }\n            }\n        }\n\n        /// <summary>Adds an item to the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <param name=\"item\">The object to add to the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.</exception>\n        public void Add(Insight item)\n        {\n            lock (_insights)\n            {\n                _openInsightCount++;\n                _totalInsightCount++;\n\n                _insightsComplete.Add(item);\n\n                if (!_insights.TryGetValue(item.Symbol, out var existingInsights))\n                {\n                    _insights[item.Symbol] = existingInsights = new();\n                }\n                existingInsights.Add(item);\n            }\n        }\n\n        /// <summary>\n        /// Adds each item in the specified enumerable of insights to this collection\n        /// </summary>\n        /// <param name=\"insights\">The insights to add to this collection</param>\n        public void AddRange(IEnumerable<Insight> insights)\n        {\n            foreach (var insight in insights)\n            {\n                Add(insight);\n            }\n        }\n\n        /// <summary>Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> contains a specific value.</summary>\n        /// <returns>true if <paramref name=\"item\" /> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />; otherwise, false.</returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        public bool Contains(Insight item)\n        {\n            lock(_insights)\n            {\n                return _insights.TryGetValue(item.Symbol, out var symbolInsights)\n                    && symbolInsights.Contains(item);\n            }\n        }\n\n        /// <summary>\n        /// Determines whether insights exist in this collection for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <returns>True if there are insights for the symbol in this collection</returns>\n        public bool ContainsKey(Symbol symbol)\n        {\n            lock (_insights)\n            {\n                return _insights.TryGetValue(symbol, out var symbolInsights)\n                    && symbolInsights.Count > 0;\n            }\n        }\n\n        /// <summary>Removes the first occurrence of a specific object from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <returns>true if <paramref name=\"item\" /> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />; otherwise, false. This method also returns false if <paramref name=\"item\" /> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</returns>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.</exception>\n        public bool Remove(Insight item)\n        {\n            lock (_insights)\n            {\n                if (_insights.TryGetValue(item.Symbol, out var symbolInsights))\n                {\n                    if (symbolInsights.Remove(item))\n                    {\n                        _openInsightCount--;\n\n                        // remove empty list from dictionary\n                        if (symbolInsights.Count == 0)\n                        {\n                            _insights.Remove(item.Symbol);\n                        }\n                        return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Dictionary accessor returns a list of insights for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <returns>List of insights for the symbol</returns>\n        public List<Insight> this[Symbol symbol]\n        {\n            get\n            {\n                lock(_insights)\n                {\n                    return _insights[symbol]?.ToList();\n                }\n            }\n            set\n            {\n                lock (_insights)\n                {\n                    if (_insights.TryGetValue(symbol, out var existingInsights))\n                    {\n                        _openInsightCount -= existingInsights?.Count ?? 0;\n                    }\n\n                    if (value != null)\n                    {\n                        _openInsightCount += value.Count;\n                        _totalInsightCount += value.Count;\n                    }\n                    _insights[symbol] = value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Attempts to get the list of insights with the specified symbol key\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <param name=\"insights\">The insights for the specified symbol, or null if not found</param>\n        /// <returns>True if insights for the specified symbol were found, false otherwise</returns>\n        public bool TryGetValue(Symbol symbol, out List<Insight> insights)\n        {\n            lock (_insights)\n            {\n                var result = _insights.TryGetValue(symbol, out insights);\n                if (result)\n                {\n                    // for thread safety we need to return a copy of the collection\n                    insights = insights.ToList();\n                }\n                return result;\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<Insight> GetEnumerator()\n        {\n            lock (_insights)\n            {\n                return _insights.SelectMany(kvp => kvp.Value).ToList().GetEnumerator();\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Removes the symbol and its insights\n        /// </summary>\n        /// <param name=\"symbols\">List of symbols that will be removed</param>\n        public void Clear(Symbol[] symbols)\n        {\n            lock (_insights)\n            {\n                foreach (var symbol in symbols)\n                {\n                    if (_insights.Remove(symbol, out var existingInsights))\n                    {\n                        _openInsightCount -= existingInsights.Count;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the next expiry time UTC\n        /// </summary>\n        public DateTime? GetNextExpiryTime()\n        {\n            lock(_insights)\n            {\n                if (_openInsightCount == 0)\n                {\n                    return null;\n                }\n\n                // we can't store expiration time because it can change\n                return _insights.Min(x => x.Value.Min(i => i.CloseTimeUtc));\n            }\n        }\n\n        /// <summary>\n        /// Gets the last generated active insight\n        /// </summary>\n        /// <returns>Collection of insights that are active</returns>\n        public ICollection<Insight> GetActiveInsights(DateTime utcTime)\n        {\n            var activeInsights = new List<Insight>();\n            lock (_insights)\n            {\n                foreach (var kvp in _insights)\n                {\n                    foreach (var insight in kvp.Value)\n                    {\n                        if (insight.IsActive(utcTime))\n                        {\n                            activeInsights.Add(insight);\n                        }\n                    }\n                }\n                return activeInsights;\n            }\n        }\n\n        /// <summary>\n        /// Returns true if there are active insights for a given symbol and time\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <param name=\"utcTime\">Time that determines whether the insight has expired</param>\n        /// <returns></returns>\n        public bool HasActiveInsights(Symbol symbol, DateTime utcTime)\n        {\n            lock (_insights)\n            {\n                if(_insights.TryGetValue(symbol, out var existingInsights))\n                {\n                    return existingInsights.Any(i => i.IsActive(utcTime));\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Remove all expired insights from the collection and retuns them\n        /// </summary>\n        /// <param name=\"utcTime\">Time that determines whether the insight has expired</param>\n        /// <returns>Expired insights that were removed</returns>\n        public ICollection<Insight> RemoveExpiredInsights(DateTime utcTime)\n        {\n            var removedInsights = new List<Insight>();\n            lock (_insights)\n            {\n                foreach (var kvp in _insights)\n                {\n                    foreach (var insight in kvp.Value)\n                    {\n                        if (insight.IsExpired(utcTime))\n                        {\n                            removedInsights.Add(insight);\n                        }\n                    }\n                }\n                foreach (var insight in removedInsights)\n                {\n                    Remove(insight);\n                }\n            }\n            return removedInsights;\n        }\n\n        /// <summary>\n        /// Will remove insights from the complete insight collection\n        /// </summary>\n        /// <param name=\"filter\">The function that will determine which insight to remove</param>\n        public void RemoveInsights(Func<Insight, bool> filter)\n        {\n            lock (_insights)\n            {\n                _insightsComplete.RemoveAll(insight => filter(insight));\n\n                // for consistentcy remove from open insights just in case\n                List<Insight> insightsToRemove = null;\n                foreach (var insights in _insights.Values)\n                {\n                    foreach (var insight in insights)\n                    {\n                        if (filter(insight))\n                        {\n                            insightsToRemove ??= new ();\n                            insightsToRemove.Add(insight);\n                        }\n                    }\n                }\n                if(insightsToRemove != null)\n                {\n                    foreach (var insight in insightsToRemove)\n                    {\n                        Remove(insight);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Will return insights from the complete insight collection\n        /// </summary>\n        /// <param name=\"filter\">The function that will determine which insight to return</param>\n        /// <returns>A new list containing the selected insights</returns>\n        public List<Insight> GetInsights(Func<Insight, bool> filter = null)\n        {\n            lock (_insights)\n            {\n                if(filter == null)\n                {\n                    return _insightsComplete.ToList();\n                }\n                return _insightsComplete.Where(filter).ToList();\n            }\n        }\n\n        /// <summary>\n        /// Will return insights from the complete insight collection\n        /// </summary>\n        /// <param name=\"filter\">The function that will determine which insight to return</param>\n        /// <returns>A new list containing the selected insights</returns>\n        public List<Insight> GetInsights(PyObject filter)\n        {\n            Func<Insight, bool> convertedFilter;\n            if (filter.TrySafeAs(out convertedFilter))\n            {\n                return GetInsights(convertedFilter);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"InsightCollection.GetInsights: {filter.Repr()} is not a valid argument.\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightDirection.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Specifies the predicted direction for a insight (price/volatility)\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter), true)]\n    public enum InsightDirection\n    {\n        /// <summary>\n        /// The value will go down (-1)\n        /// </summary>\n        Down = -1,\n\n        /// <summary>\n        /// The value will stay flat (0)\n        /// </summary>\n        Flat = 0,\n\n        /// <summary>\n        /// The value will go up (1)\n        /// </summary>\n        Up = 1\n    }\n}"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightScore.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Defines the scores given to a particular insight\n    /// </summary>\n    public class InsightScore\n    {\n        /// <summary>\n        /// Gets the time these scores were last updated\n        /// </summary>\n        [JsonProperty]\n        public DateTime UpdatedTimeUtc { get; private set; }\n\n        /// <summary>\n        /// Gets the direction score\n        /// </summary>\n        [JsonProperty]\n        public double Direction { get; private set; }\n\n        /// <summary>\n        /// Gets the magnitude score\n        /// </summary>\n        [JsonProperty]\n        public double Magnitude { get; private set; }\n\n        /// <summary>\n        /// Gets whether or not this is the insight's final score\n        /// </summary>\n        [JsonProperty]\n        public bool IsFinalScore { get; private set; }\n\n        /// <summary>\n        /// Initializes a new, default instance of the <see cref=\"InsightScore\"/> class\n        /// </summary>\n        public InsightScore()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InsightScore\"/> class\n        /// </summary>\n        /// <param name=\"direction\">The insight direction score</param>\n        /// <param name=\"magnitude\">The insight percent change score</param>\n        /// <param name=\"updatedTimeUtc\">The algorithm utc time these scores were computed</param>\n        public InsightScore(double direction, double magnitude, DateTime updatedTimeUtc)\n        {\n            Direction = direction;\n            Magnitude = magnitude;\n            UpdatedTimeUtc = updatedTimeUtc;\n        }\n\n        /// <summary>\n        /// Sets the specified score type with the value\n        /// </summary>\n        /// <param name=\"type\">The score type to be set, Direction/Magnitude</param>\n        /// <param name=\"value\">The new value for the score</param>\n        /// <param name=\"algorithmUtcTime\">The algorithm's utc time at which time the new score was computed</param>\n        public void SetScore(InsightScoreType type, double value, DateTime algorithmUtcTime)\n        {\n            if (IsFinalScore) return;\n\n            UpdatedTimeUtc = algorithmUtcTime;\n\n            switch (type)\n            {\n                case InsightScoreType.Direction:\n                    Direction = Math.Max(0, Math.Min(1, value));\n                    break;\n\n                case InsightScoreType.Magnitude:\n                    Magnitude = Math.Max(0, Math.Min(1, value));\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(type), type, null);\n            }\n        }\n\n        /// <summary>\n        /// Marks the score as finalized, preventing any further updates.\n        /// </summary>\n        /// <param name=\"algorithmUtcTime\">The algorithm's utc time at which time these scores were finalized</param>\n        public void Finalize(DateTime algorithmUtcTime)\n        {\n            IsFinalScore = true;\n            UpdatedTimeUtc = algorithmUtcTime;\n        }\n\n        /// <summary>\n        /// Gets the specified score\n        /// </summary>\n        /// <param name=\"type\">The type of score to get, Direction/Magnitude</param>\n        /// <returns>The requested score</returns>\n        public double GetScore(InsightScoreType type)\n        {\n            switch (type)\n            {\n                case InsightScoreType.Direction:\n                    return Direction;\n\n                case InsightScoreType.Magnitude:\n                    return Magnitude;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(type), type, null);\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.InsightScore.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightScoreFunctionPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// A python implementation insight evaluator wrapper\n    /// </summary>\n    public class InsightScoreFunctionPythonWrapper : BasePythonWrapper<IInsightScoreFunction>, IInsightScoreFunction\n    {\n        /// <summary>\n        /// Creates a new python wrapper instance\n        /// </summary>\n        /// <param name=\"insightEvaluator\">The python instance to wrap</param>\n        public InsightScoreFunctionPythonWrapper(PyObject insightEvaluator)\n            : base(insightEvaluator)\n        {\n        }\n\n        /// <summary>\n        /// Method to evaluate and score insights for each time step\n        /// </summary>\n        public void Score(InsightManager insightManager, DateTime utcTime)\n        {\n            InvokeMethod(nameof(Score), insightManager, utcTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightScoreType.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Defines a specific type of score for a insight\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter), true)]\n    public enum InsightScoreType\n    {\n        /// <summary>\n        /// Directional accuracy (0)\n        /// </summary>\n        Direction,\n\n        /// <summary>\n        /// Magnitude accuracy (1)\n        /// </summary>\n        Magnitude\n    }\n}"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/InsightType.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Specifies the type of insight\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter), true)]\n    public enum InsightType\n    {\n        /// <summary>\n        /// The insight is for a security's price (0)\n        /// </summary>\n        Price,\n\n        /// <summary>\n        /// The insight is for a security's price volatility (1)\n        /// </summary>\n        Volatility\n    }\n}"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/Serialization/InsightJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas.Serialization\n{\n    /// <summary>\n    /// Defines how insights should be serialized to json\n    /// </summary>\n    public class InsightJsonConverter : TypeChangeJsonConverter<Insight, SerializedInsight>\n    {\n        /// <summary>\n        /// Convert the input value to a value to be serialized\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialization</param>\n        /// <returns>A new instance of TResult that is to be serialized</returns>\n        protected override SerializedInsight Convert(Insight value)\n        {\n            return new SerializedInsight(value);\n        }\n\n        /// <summary>\n        /// Converts the input value to be deserialized\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override Insight Convert(SerializedInsight value)\n        {\n            return Insight.FromSerializedInsight(value);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing System;\n\nnamespace QuantConnect.Algorithm.Framework.Alphas.Serialization\n{\n    /// <summary>\n    /// DTO used for serializing an insight that was just generated by an algorithm.\n    /// This type does not contain any of the analysis dependent fields, such as scores\n    /// and estimated value\n    /// </summary>\n    public class SerializedInsight\n    {\n        private double _createdTime;\n\n        /// <summary>\n        /// See <see cref=\"Insight.Id\"/>\n        /// </summary>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.GroupId\"/>\n        /// </summary>\n        public string GroupId { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.SourceModel\"/>\n        /// </summary>\n        public string SourceModel { get; set; }\n\n        /// <summary>\n        /// Pass-through for <see cref=\"CreatedTime\"/>\n        /// </summary>\n        [Obsolete(\"Deprecated as of 2020-01-23. Please use the `CreatedTime` property instead.\")]\n        public double GeneratedTime\n        {\n            get { return _createdTime; }\n            set { _createdTime = value; }\n        }\n\n        /// <summary>\n        /// See <see cref=\"Insight.GeneratedTimeUtc\"/>\n        /// </summary>\n        public double CreatedTime\n        {\n            get { return _createdTime; }\n            set { _createdTime = value; }\n        }\n\n        /// <summary>\n        /// See <see cref=\"Insight.CloseTimeUtc\"/>\n        /// </summary>\n        public double CloseTime { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Symbol\"/>\n        /// The symbol's security identifier string\n        /// </summary>\n        public string Symbol { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Symbol\"/>\n        /// The symbol's ticker at the generated time\n        /// </summary>\n        public string Ticker { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Type\"/>\n        /// </summary>\n        public InsightType Type { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.ReferenceValue\"/>\n        /// </summary>\n        [JsonProperty(\"reference\")]\n        public decimal ReferenceValue { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.ReferenceValueFinal\"/>\n        /// </summary>\n        public decimal ReferenceValueFinal { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Direction\"/>\n        /// </summary>\n        public InsightDirection Direction { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Period\"/>\n        /// </summary>\n        public double Period { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Magnitude\"/>\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public double? Magnitude { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Confidence\"/>\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public double? Confidence { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Weight\"/>\n        /// </summary>\n        public double? Weight { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"InsightScore.IsFinalScore\"/>\n        /// </summary>\n        public bool ScoreIsFinal { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"InsightScore.Magnitude\"/>\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public double ScoreMagnitude { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"InsightScore.Direction\"/>\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public double ScoreDirection { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.EstimatedValue\"/>\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal EstimatedValue { get; set; }\n\n        /// <summary>\n        /// See <see cref=\"Insight.Tag\"/>\n        /// </summary>\n        public string Tag { get; set; }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"SerializedInsight\"/> class\n        /// </summary>\n        public SerializedInsight()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SerializedInsight \"/> class by copying the specified insight\n        /// </summary>\n        /// <param name=\"insight\">The insight to copy</param>\n        public SerializedInsight(Insight insight)\n        {\n            Id = insight.Id.ToStringInvariant(\"N\");\n            SourceModel = insight.SourceModel;\n            GroupId = insight.GroupId?.ToStringInvariant(\"N\");\n            CreatedTime = Time.DateTimeToUnixTimeStamp(insight.GeneratedTimeUtc);\n            CloseTime = Time.DateTimeToUnixTimeStamp(insight.CloseTimeUtc);\n            Symbol = insight.Symbol.ID.ToString();\n            Ticker = insight.Symbol.Value;\n            Type = insight.Type;\n            ReferenceValue = insight.ReferenceValue;\n            ReferenceValueFinal = insight.ReferenceValueFinal;\n            Direction = insight.Direction;\n            Period = insight.Period.TotalSeconds;\n            Magnitude = insight.Magnitude;\n            Confidence = insight.Confidence;\n            ScoreIsFinal = insight.Score.IsFinalScore;\n            ScoreMagnitude = insight.Score.Magnitude;\n            ScoreDirection = insight.Score.Direction;\n            EstimatedValue = insight.EstimatedValue;\n            Weight = insight.Weight;\n            Tag = insight.Tag;\n        }\n\n        #region BackwardsCompatibility\n        [JsonProperty(\"group-id\")]\n        string OldGroupId\n        {\n            set\n            {\n                GroupId = value;\n            }\n        }\n\n        [JsonProperty(\"source-model\")]\n        string OldSourceModel\n        {\n            set\n            {\n                SourceModel = value;\n            }\n        }\n\n        /// <summary>\n        /// Pass-through for <see cref=\"CreatedTime\"/>\n        /// </summary>\n        [JsonProperty(\"generated-time\")]\n        double OldGeneratedTime\n        {\n            set\n            {\n                GeneratedTime = value;\n            }\n        }\n\n        /// <summary>\n        /// See <see cref=\"Insight.GeneratedTimeUtc\"/>\n        /// </summary>\n        [JsonProperty(\"created-time\")]\n        public double OldCreatedTime\n        {\n            set\n            {\n                CreatedTime = value;\n            }\n        }\n\n        /// <summary>\n        /// See <see cref=\"Insight.CloseTimeUtc\"/>\n        /// </summary>\n        [JsonProperty(\"close-time\")]\n        public double OldCloseTime\n        {\n            set\n            {\n                CloseTime = value;\n            }\n        }\n\n        [JsonProperty(\"reference-final\")]\n        decimal OldReferenceValueFinal\n        {\n            set\n            {\n                ReferenceValueFinal = value;\n            }\n        }\n\n        [JsonProperty(\"score-final\")]\n        bool OldScoreIsFinal\n        {\n            set\n            {\n                ScoreIsFinal = value;\n            }\n        }\n\n        [JsonProperty(\"score-magnitude\")]\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        double OldScoreMagnitude\n        {\n            set\n            {\n                ScoreMagnitude = value;\n            }\n        }\n\n        [JsonProperty(\"score-direction\")]\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        double OldScoreDirection\n        {\n            set\n            {\n                ScoreDirection = value;\n            }\n        }\n\n        [JsonProperty(\"estimated-value\")]\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        decimal OldEstimatedValue\n        {\n            set\n            {\n                EstimatedValue = value;\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/IPortfolioTarget.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Represents a portfolio target. This may be a percentage of total portfolio value\n    /// or it may be a fixed number of shares.\n    /// </summary>\n    public interface IPortfolioTarget\n    {\n        /// <summary>\n        /// Gets the symbol of this target\n        /// </summary>\n        Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the quantity of this symbol the algorithm should hold\n        /// </summary>\n        decimal Quantity { get; }\n\n        /// <summary>\n        /// Portfolio target tag with additional information\n        /// </summary>\n        string Tag { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/PortfolioTarget.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPortfolioTarget\"/> that specifies a\n    /// specified quantity of a security to be held by the algorithm\n    /// </summary>\n    public class PortfolioTarget : IPortfolioTarget\n    {\n\n        /// <summary>\n        /// Flag to determine if the minimum order margin portfolio percentage warning should or has already been sent to the user algorithm\n        /// <see cref=\"IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage\"/>\n        /// </summary>\n        public static bool? MinimumOrderMarginPercentageWarningSent { get; set; }\n\n        /// <summary>\n        /// Gets the symbol of this target\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the target quantity for the symbol\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// Portfolio target tag with additional information\n        /// </summary>\n        public string Tag { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PortfolioTarget\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this target is for</param>\n        /// <param name=\"quantity\">The target quantity</param>\n        /// <param name=\"tag\">The target tag with additional information</param>\n        public PortfolioTarget(Symbol symbol, decimal quantity, string tag = \"\")\n        {\n            Symbol = symbol;\n            Quantity = quantity;\n            Tag = tag;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PortfolioTarget\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this target is for</param>\n        /// <param name=\"quantity\">The target quantity</param>\n        /// <param name=\"tag\">The target tag with additional information</param>\n        public PortfolioTarget(Symbol symbol, int quantity, string tag = \"\")\n            : this(symbol, (decimal)quantity, tag)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PortfolioTarget\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this target is for</param>\n        /// <param name=\"insightDirection\">\n        /// The insight direction, which will be used to calculate the target quantity\n        /// (1 for Up, 0 for flat, -1 for down)\n        /// </param>\n        /// <param name=\"tag\">The target tag with additional information</param>\n        public PortfolioTarget(Symbol symbol, InsightDirection insightDirection, string tag = \"\")\n            : this(symbol,\n                  insightDirection switch\n                  {\n                      InsightDirection.Up => 1m,\n                      InsightDirection.Down => -1m,\n                      InsightDirection.Flat => 0m,\n                      _ => throw new ArgumentOutOfRangeException(nameof(insightDirection), insightDirection,\n                          Messages.PortfolioTarget.InvalidInsightDirection(symbol, insightDirection)),\n                  },\n                  tag)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new target for the specified percent\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for getting total portfolio value and current security price</param>\n        /// <param name=\"symbol\">The symbol the target is for</param>\n        /// <param name=\"percent\">The requested target percent of total portfolio value</param>\n        /// <returns>A portfolio target for the specified symbol/percent</returns>\n        public static IPortfolioTarget Percent(IAlgorithm algorithm, Symbol symbol, double percent)\n        {\n            return Percent(algorithm, symbol, percent.SafeDecimalCast());\n        }\n\n        /// <summary>\n        /// Creates a new target for the specified percent\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for getting total portfolio value and current security price</param>\n        /// <param name=\"symbol\">The symbol the target is for</param>\n        /// <param name=\"percent\">The requested target percent of total portfolio value</param>\n        /// <param name=\"tag\">The target tag with additional information</param>\n        /// <returns>A portfolio target for the specified symbol/percent</returns>\n        public static IPortfolioTarget Percent(IAlgorithm algorithm, Symbol symbol, double percent, string tag)\n        {\n            return Percent(algorithm, symbol, percent.SafeDecimalCast(), tag: tag);\n        }\n\n        /// <summary>\n        /// Creates a new target for the specified percent\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance, used for getting total portfolio value and current security price</param>\n        /// <param name=\"symbol\">The symbol the target is for</param>\n        /// <param name=\"percent\">The requested target percent of total portfolio value</param>\n        /// <param name=\"returnDeltaQuantity\">True, result quantity will be the Delta required to reach target percent.\n        /// False, the result quantity will be the Total quantity to reach the target percent, including current holdings</param>\n        /// <param name=\"tag\">The target tag with additional information</param>\n        /// <returns>A portfolio target for the specified symbol/percent</returns>\n        public static IPortfolioTarget Percent(IAlgorithm algorithm, Symbol symbol, decimal percent, bool returnDeltaQuantity = false, string tag = \"\")\n        {\n            var absolutePercentage = Math.Abs(percent);\n            if (absolutePercentage > algorithm.Settings.MaxAbsolutePortfolioTargetPercentage\n                || absolutePercentage != 0 && absolutePercentage < algorithm.Settings.MinAbsolutePortfolioTargetPercentage)\n            {\n                algorithm.Error(Messages.PortfolioTarget.InvalidTargetPercent(algorithm, percent));\n                return null;\n            }\n\n            Security security;\n            try\n            {\n                security = algorithm.Securities[symbol];\n            }\n            catch (KeyNotFoundException)\n            {\n                algorithm.Error(Messages.PortfolioTarget.SymbolNotFound(symbol));\n                return null;\n            }\n\n            if (security.Price == 0)\n            {\n                algorithm.Error(symbol.GetZeroPriceMessage());\n                return null;\n            }\n\n            // Factoring in FreePortfolioValuePercentage.\n            var adjustedPercent = percent * algorithm.Portfolio.TotalPortfolioValueLessFreeBuffer / algorithm.Portfolio.TotalPortfolioValue;\n\n            // we normalize the target buying power by the leverage so we work in the land of margin\n            var targetFinalMarginPercentage = adjustedPercent / security.BuyingPowerModel.GetLeverage(security);\n\n            var positionGroup = algorithm.Portfolio.Positions.GetOrCreateDefaultGroup(security);\n            var result = positionGroup.BuyingPowerModel.GetMaximumLotsForTargetBuyingPower(\n                new GetMaximumLotsForTargetBuyingPowerParameters(algorithm.Portfolio, positionGroup,\n                    targetFinalMarginPercentage, algorithm.Settings.MinimumOrderMarginPortfolioPercentage));\n\n            if (result.IsError)\n            {\n                algorithm.Error(Messages.PortfolioTarget.UnableToComputeOrderQuantityDueToNullResult(symbol, result));\n\n                return null;\n            }\n\n            if (MinimumOrderMarginPercentageWarningSent.HasValue && !MinimumOrderMarginPercentageWarningSent.Value)\n            {\n                // we send the warning once\n                MinimumOrderMarginPercentageWarningSent = true;\n                algorithm.Debug(Messages.BuyingPowerModel.TargetOrderMarginNotAboveMinimum());\n            }\n\n            // be sure to back out existing holdings quantity since the buying power model yields\n            // the required delta quantity to reach a final target portfolio value for a symbol\n            var lotSize = security.SymbolProperties.LotSize;\n            var quantity = result.NumberOfLots * lotSize + (returnDeltaQuantity ? 0 : security.Holdings.Quantity);\n\n            return new PortfolioTarget(symbol, quantity, tag);\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.PortfolioTarget.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/PortfolioTargetCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio\n{\n    /// <summary>\n    /// Provides a collection for managing <see cref=\"IPortfolioTarget\"/>s for each symbol\n    /// </summary>\n    public class PortfolioTargetCollection : ICollection<IPortfolioTarget>, IDictionary<Symbol, IPortfolioTarget>\n    {\n        private List<IPortfolioTarget> _enumerable;\n        private List<KeyValuePair<Symbol, IPortfolioTarget>> _kvpEnumerable;\n        private readonly Dictionary<Symbol, IPortfolioTarget> _targets = new ();\n\n        /// <summary>\n        /// Gets the number of targets in this collection\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                lock (_targets)\n                {\n                    return _targets.Count;\n                }\n            }\n        }\n\n        /// <summary>\n        /// True if there is no target in the collection\n        /// </summary>\n        public bool IsEmpty\n        {\n            get\n            {\n                lock (_targets)\n                {\n                    return _targets.Count == 0;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets `false`. This collection is not read-only.\n        /// </summary>\n        public bool IsReadOnly => false;\n\n        /// <summary>\n        /// Gets the symbol keys for this collection\n        /// </summary>\n        public ICollection<Symbol> Keys\n        {\n            get\n            {\n                lock (_targets)\n                {\n                    return _targets.Keys.ToList();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets all portfolio targets in this collection\n        /// Careful, will return targets for securities that might have no data yet.\n        /// </summary>\n        public ICollection<IPortfolioTarget> Values\n        {\n            get\n            {\n                var result = _enumerable;\n                if (result == null)\n                {\n                    lock (_targets)\n                    {\n                        result = _enumerable = _targets.Values.ToList();\n                    }\n                }\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified target to the collection. If a target for the same symbol\n        /// already exists it wil be overwritten.\n        /// </summary>\n        /// <param name=\"target\">The portfolio target to add</param>\n        public void Add(IPortfolioTarget target)\n        {\n            if (target == null)\n            {\n                return;\n            }\n\n            lock (_targets)\n            {\n                _enumerable = null;\n                _kvpEnumerable = null;\n                _targets[target.Symbol] = target;\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified target to the collection. If a target for the same symbol\n        /// already exists it wil be overwritten.\n        /// </summary>\n        /// <param name=\"target\">The portfolio target to add</param>\n        public void Add(KeyValuePair<Symbol, IPortfolioTarget> target)\n        {\n            Add(target);\n        }\n\n        /// <summary>\n        /// Adds the specified target to the collection. If a target for the same symbol\n        /// already exists it wil be overwritten.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <param name=\"target\">The portfolio target to add</param>\n        public void Add(Symbol symbol, IPortfolioTarget target)\n        {\n            Add(target);\n        }\n\n        /// <summary>\n        /// Adds the specified targets to the collection. If a target for the same symbol\n        /// already exists it will be overwritten.\n        /// </summary>\n        /// <param name=\"targets\">The portfolio targets to add</param>\n        public void AddRange(IEnumerable<IPortfolioTarget> targets)\n        {\n            lock (_targets)\n            {\n                _enumerable = null;\n                _kvpEnumerable = null;\n                foreach (var item in targets)\n                {\n                    _targets[item.Symbol] = item;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified targets to the collection. If a target for the same symbol\n        /// already exists it will be overwritten.\n        /// </summary>\n        /// <param name=\"targets\">The portfolio targets to add</param>\n        public void AddRange(IPortfolioTarget[] targets)\n        {\n            AddRange((IEnumerable<IPortfolioTarget>)targets);\n        }\n\n        /// <summary>\n        /// Removes all portfolio targets from this collection\n        /// </summary>\n        public void Clear()\n        {\n            lock (_targets)\n            {\n                _enumerable = null;\n                _kvpEnumerable = null;\n                _targets.Clear();\n            }\n        }\n\n        /// <summary>\n        /// Removes fulfilled portfolio targets from this collection.\n        /// Will only take into account actual holdings and ignore open orders.\n        /// </summary>\n        public void ClearFulfilled(IAlgorithm algorithm)\n        {\n            foreach (var target in this)\n            {\n                var security = algorithm.Securities[target.Symbol];\n                var holdings = security.Holdings.Quantity;\n                // check to see if we're done with this target\n                if (Math.Abs(target.Quantity - holdings) < security.SymbolProperties.LotSize)\n                {\n                    Remove(target.Symbol);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified target exists in this collection.\n        /// NOTE: This checks for the exact specified target, not by symbol. Use ContainsKey\n        /// to check by symbol.\n        /// </summary>\n        /// <param name=\"target\">The portfolio target to check for existence.</param>\n        /// <returns>True if the target exists, false otherwise</returns>\n        public bool Contains(IPortfolioTarget target)\n        {\n            if (target == null)\n            {\n                return false;\n            }\n\n            lock (_targets)\n            {\n                return _targets.ContainsKey(target.Symbol);\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the specified symbol/target pair exists in this collection\n        /// </summary>\n        /// <param name=\"target\">The symbol/target pair</param>\n        /// <returns>True if the pair exists, false otherwise</returns>\n        public bool Contains(KeyValuePair<Symbol, IPortfolioTarget> target)\n        {\n            return Contains(target);\n        }\n\n        /// <summary>\n        /// Determines whether the specified symbol exists as a key in this collection\n        /// </summary>\n        /// <param name=\"symbol\">The symbol key</param>\n        /// <returns>True if the symbol exists in this collection, false otherwise</returns>\n        public bool ContainsKey(Symbol symbol)\n        {\n            lock (_targets)\n            {\n                return _targets.ContainsKey(symbol);\n            }\n        }\n\n        /// <summary>\n        /// Copies the targets in this collection to the specified array\n        /// </summary>\n        /// <param name=\"array\">The destination array to copy to</param>\n        /// <param name=\"arrayIndex\">The index in the array to start copying to</param>\n        public void CopyTo(IPortfolioTarget[] array, int arrayIndex)\n        {\n            lock (_targets)\n            {\n                _targets.Values.CopyTo(array, arrayIndex);\n            }\n        }\n\n        /// <summary>\n        /// Copies the targets in this collection to the specified array\n        /// </summary>\n        /// <param name=\"array\">The destination array to copy to</param>\n        /// <param name=\"arrayIndex\">The index in the array to start copying to</param>\n        public void CopyTo(KeyValuePair<Symbol, IPortfolioTarget>[] array, int arrayIndex)\n        {\n            WithDictionary(d => d.CopyTo(array, arrayIndex));\n        }\n\n        /// <summary>\n        /// Removes the target for the specified symbol if it exists in this collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to remove</param>\n        /// <returns>True if the symbol's target was removed, false if it doesn't exist in the collection</returns>\n        public bool Remove(Symbol symbol)\n        {\n            lock (_targets)\n            {\n                if (_targets.Remove(symbol))\n                {\n                    _enumerable = null;\n                    _kvpEnumerable = null;\n                    return true;\n                }\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Removes the target for the specified symbol/target pair if it exists in this collection.\n        /// </summary>\n        /// <param name=\"target\">The symbol/target pair to remove</param>\n        /// <returns>True if the symbol's target was removed, false if it doesn't exist in the collection</returns>\n        public bool Remove(KeyValuePair<Symbol, IPortfolioTarget> target)\n        {\n            return Remove(target.Value);\n        }\n\n        /// <summary>\n        /// Removes the target if it exists in this collection.\n        /// </summary>\n        /// <param name=\"target\">The target to remove</param>\n        /// <returns>True if the target was removed, false if it doesn't exist in the collection</returns>\n        public bool Remove(IPortfolioTarget target)\n        {\n            if (target == null)\n            {\n                return false;\n            }\n\n            lock (_targets)\n            {\n                IPortfolioTarget existing;\n                if (_targets.TryGetValue(target.Symbol, out existing))\n                {\n                    // need to confirm that we're removing the requested target and not a different target w/ the same symbol key\n                    if (existing.Equals(target))\n                    {\n                        return Remove(target.Symbol);\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the target for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"target\">The portfolio target for the symbol, or null if not found</param>\n        /// <returns>True if the symbol's target was found, false if it does not exist in this collection</returns>\n        public bool TryGetValue(Symbol symbol, out IPortfolioTarget target)\n        {\n            lock (_targets)\n            {\n                return _targets.TryGetValue(symbol, out target);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the portfolio target for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>The symbol's portfolio target if it exists in this collection, if not a <see cref=\"KeyNotFoundException\"/> will be thrown.</returns>\n        public IPortfolioTarget this[Symbol symbol]\n        {\n            get\n            {\n                lock (_targets)\n                {\n                    return _targets[symbol];\n                }\n            }\n            set\n            {\n                lock (_targets)\n                {\n                    _enumerable = null;\n                    _kvpEnumerable = null;\n                    _targets[symbol] = value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets an enumerator to iterator over the symbol/target key value pairs in this collection.\n        /// </summary>\n        /// <returns>Symbol/target key value pair enumerator</returns>\n        IEnumerator<KeyValuePair<Symbol, IPortfolioTarget>> IEnumerable<KeyValuePair<Symbol, IPortfolioTarget>>.GetEnumerator()\n        {\n            var result = _kvpEnumerable;\n            if (result == null)\n            {\n                lock (_targets)\n                {\n                    _kvpEnumerable = result = _targets.ToList();\n                }\n            }\n            return result.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets an enumerator to iterator over all portfolio targets in this collection.\n        /// This is the default enumerator for this collection.\n        /// </summary>\n        /// <returns>Portfolio targets enumerator</returns>\n        public IEnumerator<IPortfolioTarget> GetEnumerator()\n        {\n            var result = _enumerable;\n            if (result == null)\n            {\n                lock (_targets)\n                {\n                    _enumerable = result = _targets.Values.ToList();\n                }\n            }\n            return result.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets an enumerator to iterator over all portfolio targets in this collection.\n        /// This is the default enumerator for this collection.\n        /// Careful, will return targets for securities that might have no data yet.\n        /// </summary>\n        /// <returns>Portfolio targets enumerator</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Helper function to easily access explicitly implemented interface methods against concurrent dictionary\n        /// </summary>\n        private void WithDictionary(Action<IDictionary<Symbol, IPortfolioTarget>> action)\n        {\n            lock (_targets)\n            {\n                action(_targets);\n            }\n        }\n\n        /// <summary>\n        /// Returned an ordered enumerable where position reducing orders are executed first\n        /// and the remaining orders are executed in decreasing order value.\n        /// Will NOT return targets for securities that have no data yet.\n        /// Will NOT return targets for which current holdings + open orders quantity, sum up to the target quantity\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public IEnumerable<IPortfolioTarget> OrderByMarginImpact(IAlgorithm algorithm)\n        {\n            if (IsEmpty)\n            {\n                return Enumerable.Empty<IPortfolioTarget>();\n            }\n            return this.OrderTargetsByMarginImpact(algorithm);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/BaseSignalExport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Net.Http;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Base class to send signals to different 3rd party API's\n    /// </summary>\n    public abstract class BaseSignalExport : ISignalExportTarget\n    {\n        /// <summary>\n        /// Lazy initialization of HttpClient to be used to sent signals to different 3rd party API's\n        /// </summary>\n        private Lazy<HttpClient> _lazyClient = new Lazy<HttpClient>();\n\n        /// <summary>\n        /// List of all SecurityTypes present in LEAN\n        /// </summary>\n        private HashSet<SecurityType> _defaultAllowedSecurityTypes = new HashSet<SecurityType>\n        {\n            SecurityType.Equity,\n            SecurityType.Forex,\n            SecurityType.Option,\n            SecurityType.Future,\n            SecurityType.FutureOption,\n            SecurityType.Crypto,\n            SecurityType.CryptoFuture,\n            SecurityType.Cfd,\n            SecurityType.IndexOption,\n        };\n\n        /// <summary>\n        /// The name of this signal export\n        /// </summary>\n        protected abstract string Name { get; }\n\n        /// <summary>\n        /// Property to access a HttpClient\n        /// </summary>\n\n        protected HttpClient HttpClient => _lazyClient.Value;\n\n        /// <summary>\n        /// Default hashset of allowed Security types\n        /// </summary>\n        protected virtual HashSet<SecurityType> AllowedSecurityTypes\n        {\n            get => _defaultAllowedSecurityTypes;\n        }\n\n        /// <summary>\n        /// Sends positions to different 3rd party API's\n        /// </summary>\n        /// <param name=\"parameters\">Holdings the user have defined to be sent to certain 3rd party API and the algorithm being ran</param>\n        /// <returns>True if the positions were sent correctly and the 3rd party API sent no errors. False, otherwise</returns>\n        public virtual bool Send(SignalExportTargetParameters parameters)\n        {\n            if (parameters.Targets.Count == 0)\n            {\n                parameters.Algorithm.Debug(\"Portfolio target is empty\");\n                return false;\n            }\n\n            return VerifyTargets(parameters);\n        }\n\n        /// <summary>\n        /// Verifies the security type of every holding in the given list is allowed\n        /// </summary>\n        /// <param name=\"parameters\">Holdings the user have defined to be sent to certain 3rd party API and the algorithm being ran</param>\n        /// <returns>True if all the targets were allowed, false otherwise</returns>\n        private bool VerifyTargets(SignalExportTargetParameters parameters)\n        {\n            foreach (var signal in parameters.Targets)\n            {\n                if (!AllowedSecurityTypes.Contains(signal.Symbol.SecurityType))\n                {\n                    parameters.Algorithm.Debug($\"{signal.Symbol.SecurityType} security type is not supported by {Name}. Allowed security types: [{string.Join(\",\", AllowedSecurityTypes)}]\");\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// If created, dispose of HttpClient we used for the requests to the different 3rd party API's\n        /// </summary>\n        public void Dispose()\n        {\n            if (_lazyClient.IsValueCreated)\n            {\n                _lazyClient.Value.DisposeSafely();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Net.Http;\nusing System.Net.Http.Json;\nusing System.Text;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Exports signals of desired positions to Collective2 API using JSON and HTTPS.\n    /// Accepts signals in quantity(number of shares) i.e symbol:\"SPY\", quant:40\n    /// </summary>\n    public class Collective2SignalExport : BaseSignalExport\n    {\n        /// <summary>\n        /// Hashset of symbols whose market is unknown but have already been seen by\n        /// this signal export manager\n        /// </summary>\n        private HashSet<string> _unknownMarketSymbols;\n\n        /// <summary>\n        /// Hashset of security types seen that are unsupported by C2 API\n        /// </summary>\n        private HashSet<SecurityType> _unknownSecurityTypes;\n\n        /// <summary>\n        /// API key provided by Collective2\n        /// </summary>\n        private readonly string _apiKey;\n\n        /// <summary>\n        /// Trading system's ID number\n        /// </summary>\n        private readonly int _systemId;\n\n        /// <summary>\n        /// Algorithm being ran\n        /// </summary>\n        private IAlgorithm _algorithm;\n\n        /// <summary>\n        /// C2 accepts only standard minilots (10,000 currency units).\n        /// The smallest quantity C2 trades is \"1\" which is a mini-lot. \n        /// Thus, the smallest trade a strategy manager can type into C2 is, for example,\n        /// MarketOrder(\"EURUSD\", 1m)\n        /// which will trade 10,000 Euros.\n        /// No fractions nor numbers smaller than 1 are accepted by C2.\n        /// https://support.collective2.com/hc/en-us/articles/360038042774-Forex-minilots\n        /// </summary>\n        private const int _forexMinilots = 10000;\n\n        /// <summary>\n        /// Flag to track if the minilot warning has already been printed.\n        /// </summary>\n        private bool _isForexMinilotsWarningPrinted;\n\n        /// <summary>\n        /// Flag to track if the warning has already been printed.\n        /// </summary>\n        private bool _isZeroPriceWarningPrinted;\n\n        /// <summary>\n        /// Collective2 API endpoint\n        /// </summary>\n        public Uri Destination { get; set; }\n\n        /// <summary>\n        /// The name of this signal export\n        /// </summary>\n        protected override string Name { get; } = \"Collective2\";\n\n        /// <summary>\n        /// Lazy initialization of Symbol Properties Database\n        /// </summary>\n        private static Lazy<SymbolPropertiesDatabase> _symbolPropertiesDatabase = new (() => SymbolPropertiesDatabase.FromDataFolder());\n\n        /// <summary>\n        /// Lazy initialization of ten seconds rate limiter\n        /// </summary>\n        private static Lazy<RateGate> _tenSecondsRateLimiter = new Lazy<RateGate>(() => new RateGate(100, TimeSpan.FromMilliseconds(1000)));\n\n        /// <summary>\n        /// Lazy initialization of one hour rate limiter\n        /// </summary>\n        private static Lazy<RateGate> _hourlyRateLimiter = new Lazy<RateGate>(() => new RateGate(1000, TimeSpan.FromHours(1)));\n\n        /// <summary>\n        /// Lazy initialization of one day rate limiter\n        /// </summary>\n        private static Lazy<RateGate> _dailyRateLimiter = new Lazy<RateGate>(() => new RateGate(20000, TimeSpan.FromDays(1)));\n\n        /// <summary>\n        /// Collective2SignalExport constructor. It obtains the entry information for Collective2 API requests.\n        /// See API documentation at https://trade.collective2.com/c2-api\n        /// </summary>\n        /// <param name=\"apiKey\">API key provided by Collective2</param>\n        /// <param name=\"systemId\">Trading system's ID number</param>\n        /// <param name=\"useWhiteLabelApi\">Whether to use the white-label API instead of the general one</param>\n        public Collective2SignalExport(string apiKey, int systemId, bool useWhiteLabelApi = false)\n        {\n            _unknownMarketSymbols = new HashSet<string>();\n            _unknownSecurityTypes = new HashSet<SecurityType>();\n            _apiKey = apiKey;\n            _systemId = systemId;\n\n            // SetDesiredPositions: The list of positions that must exist in the strategy. \n            // https://api-docs.collective2.com/apis/general/swagger/strategies/c2_api_strategies/setdesiredpositions_post#strategies/c2_api_strategies/setdesiredpositions_post/t=request&path=positions\n            Destination = new Uri(useWhiteLabelApi\n                ? \"https://api4-wl.collective2.com/Strategies/SetDesiredPositions\"\n                : \"https://api4-general.collective2.com/Strategies/SetDesiredPositions\");\n        }\n\n        /// <summary>\n        /// Creates a JSON message with the desired positions using the expected\n        /// Collective2 API format and then sends it\n        /// </summary>\n        /// <param name=\"parameters\">A list of holdings from the portfolio\n        /// expected to be sent to Collective2 API and the algorithm being ran</param>\n        /// <returns>True if the positions were sent correctly and Collective2 sent no errors, false otherwise</returns>\n        public override bool Send(SignalExportTargetParameters parameters)\n        {\n            if (!base.Send(parameters))\n            {\n                return false;\n            }\n\n            if (!ConvertHoldingsToCollective2(parameters, out List<Collective2Position> positions))\n            {\n                return false;\n            }\n            var message = CreateMessage(positions);\n            _tenSecondsRateLimiter.Value.WaitToProceed();\n            _hourlyRateLimiter.Value.WaitToProceed();\n            _dailyRateLimiter.Value.WaitToProceed();\n            var result = SendPositions(message);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Converts a list of targets to a list of Collective2 positions\n        /// </summary>\n        /// <param name=\"parameters\">A list of targets from the portfolio\n        /// expected to be sent to Collective2 API and the algorithm being ran</param>\n        /// <param name=\"positions\">A list of Collective2 positions</param>\n        /// <returns>True if the given targets could be converted to a Collective2Position list, false otherwise</returns>\n        protected bool ConvertHoldingsToCollective2(SignalExportTargetParameters parameters, out List<Collective2Position> positions)\n        {\n            _algorithm = parameters.Algorithm;\n            var targets = parameters.Targets;\n            positions = [];\n            foreach (var target in targets)\n            {\n                if (target == null)\n                {\n                    _algorithm.Error(\"One portfolio target was null\");\n                    return false;\n                }\n\n                var securityType = GetSecurityTypeAcronym(target.Symbol.SecurityType);\n                if (securityType == null)\n                {\n                    continue;\n                }\n\n                var maturityMonthYear = GetMaturityMonthYear(target.Symbol);\n                if (maturityMonthYear?.Length == 0)\n                {\n                    continue;\n                }\n\n                var exchangeSymbol = new C2ExchangeSymbol\n                {\n                    Symbol = GetSymbol(target.Symbol),\n                    Currency = GetCurrency(_algorithm, target.Symbol),\n                    SecurityExchange = GetMICExchangeCode(target.Symbol),\n                    SecurityType = securityType,\n                    MaturityMonthYear = maturityMonthYear,\n                    PutOrCall = GetPutOrCallValue(target.Symbol),\n                    StrikePrice = GetStrikePrice(target.Symbol)\n                };\n\n                // Quantity must be non-zero.\n                // To close a position, simply omit it from the Positions array.\n                var quantity = ConvertPercentageToQuantity(_algorithm, target);\n                if (quantity == 0)\n                {\n                    continue;\n                }\n\n                positions.Add(new() { ExchangeSymbol = exchangeSymbol, Quantity = quantity });\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Converts a given percentage of a position into the number of shares of it\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm being ran</param>\n        /// <param name=\"target\">Desired position to be sent to the Collective2 API</param>\n        /// <returns>Number of shares hold of the given position</returns>\n        protected int ConvertPercentageToQuantity(IAlgorithm algorithm, PortfolioTarget target)\n        {\n            var numberShares = PortfolioTarget.Percent(algorithm, target.Symbol, target.Quantity);\n            if (numberShares == null)\n            {\n                if (algorithm.Securities.TryGetValue(target.Symbol, out var security) && security.Price == 0 && target.Quantity == 0)\n                {\n                    if (!_isZeroPriceWarningPrinted)\n                    {\n                        _isZeroPriceWarningPrinted = true;\n                        algorithm.Debug($\"Warning: Collective2 failed to calculate target quantity for {target}. The price for {target.Symbol} is 0, and the target quantity is 0. Will return 0 for all similar cases.\");\n                    }\n                    return 0;\n                }\n                throw new InvalidOperationException($\"Collective2 failed to calculate target quantity for {target}\");\n            }\n\n            var quantity = (int)numberShares.Quantity;\n\n            if (target.Symbol.ID.SecurityType == SecurityType.Forex)\n            {\n                quantity /= _forexMinilots;\n                if (!_isForexMinilotsWarningPrinted && quantity == 0)\n                {\n                    _isForexMinilotsWarningPrinted = true;\n                    algorithm.Debug($\"Warning: Collective2 failed to calculate target quantity for {target}. The smallest quantity C2 trades is \\\"1\\\" which is a mini-lot (10,000 currency units), and the target quantity is {numberShares.Quantity}. Will return 0 for all similar cases.\");\n                }\n            }\n\n            return quantity;\n        }\n\n        /// <summary>\n        /// Serializes the list of desired positions with the needed credentials in JSON format\n        /// </summary>\n        /// <param name=\"positions\">List of Collective2 positions to be sent to Collective2 API</param>\n        /// <returns>A JSON request string of the desired positions to be sent by a POST request to Collective2 API</returns>\n        protected string CreateMessage(List<Collective2Position> positions)\n        {\n            var payload = new\n            {\n                StrategyId = _systemId,\n                Positions = positions,\n            };\n\n            var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };\n            var jsonMessage = JsonConvert.SerializeObject(payload, settings);\n            return jsonMessage;\n        }\n\n        /// <summary>\n        /// Sends the desired positions list in JSON format to Collective2 API using a POST request. It logs\n        /// the message retrieved by the Collective2 API if there was a HttpRequestException\n        /// </summary>\n        /// <param name=\"message\">A JSON request string of the desired positions list with the credentials</param>\n        /// <returns>True if the positions were sent correctly and Collective2 API sent no errors, false otherwise</returns>\n        private bool SendPositions(string message)\n        {\n            using var httpMessage = new StringContent(message, Encoding.UTF8, \"application/json\");\n\n            //Add the QuantConnect app header\n            httpMessage.Headers.Add(\"X-AppId\", \"OPA1N90E71\");\n\n            //Add the Authorization header\n            HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(\"Bearer\", _apiKey);\n\n            //Send the message\n            using HttpResponseMessage response = HttpClient.PostAsync(Destination, httpMessage).Result;\n\n            //Parse it\n            var responseObject = response.Content.ReadFromJsonAsync<C2Response>().Result;\n\n            //For debugging purposes, append the message sent to Collective2 to the algorithms log\n            var debuggingMessage = Logging.Log.DebuggingEnabled ? $\" | Message={message}\" : string.Empty;\n\n            if (!response.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"Collective2 API returned the following errors: {string.Join(\",\", PrintErrors(responseObject.ResponseStatus.Errors))}{debuggingMessage}\");\n                return false;\n            }\n            else if (responseObject.Results.Count > 0)\n            {\n                _algorithm.Debug($\"Collective2: NewSignals={string.Join(',', responseObject.Results[0].NewSignals)} | CanceledSignals={string.Join(',', responseObject.Results[0].CanceledSignals)}{debuggingMessage}\");\n            }\n\n            return true;\n        }\n\n        private static string PrintErrors(List<ResponseError> errors)\n        {\n            if (errors?.Count == 0)\n            {\n                return \"NULL\";\n            }\n\n            StringBuilder sb = new StringBuilder();\n            foreach (var error in errors)\n            {\n                sb.AppendLine(CultureInfo.InvariantCulture, $\"({error.ErrorCode}) {error.FieldName}: {error.Message}\");\n            }\n\n            return sb.ToString();\n        }\n\n        /// <summary>\n        /// The main C2 response class for this endpoint\n        /// </summary>\n        private class C2Response\n        {\n            [JsonProperty(PropertyName = \"Results\")]\n            public virtual List<DesiredPositionResponse> Results { get; set; }\n\n\n            [JsonProperty(PropertyName = \"ResponseStatus\")]\n            public ResponseStatus ResponseStatus { get; set; }\n        }\n\n        /// <summary>\n        /// The Results object\n        /// </summary>\n        private class DesiredPositionResponse\n        {\n            [JsonProperty(PropertyName = \"NewSignals\")]\n            public List<long> NewSignals { get; set; } = new List<long>();\n\n\n            [JsonProperty(PropertyName = \"CanceledSignals\")]\n            public List<long> CanceledSignals { get; set; } = new List<long>();\n        }\n\n        /// <summary>\n        /// Returns the given symbol in the expected C2 format\n        /// </summary>\n        private string GetSymbol(Symbol symbol)\n        {\n            if (CurrencyPairUtil.TryDecomposeCurrencyPair(symbol, out var baseCurrency, out var quoteCurrency))\n            {\n                return $\"{baseCurrency}/{quoteCurrency}\";\n            }\n            else if (symbol.SecurityType.IsOption())\n            {\n                return symbol.Underlying.Value;\n            }\n            else\n            {\n                return symbol.ID.Symbol;\n            }\n        }\n\n        /// <summary>\n        /// Returns the Symbol currency. USD for Forex.\n        /// </summary>\n        private string GetCurrency(IAlgorithm algorithm, Symbol symbol)\n        {\n            if (symbol.ID.SecurityType == SecurityType.Forex)\n            {\n                return \"USD\";\n            }\n\n            if (algorithm.Securities.TryGetValue(symbol, out var security))\n            {\n                return security.QuoteCurrency.Symbol;\n            }\n\n            var properties = _symbolPropertiesDatabase.Value.GetSymbolProperties(symbol.ID.Market, symbol, symbol.ID.SecurityType, algorithm.AccountCurrency);\n            return properties.QuoteCurrency;\n        }\n\n        private string GetMICExchangeCode(Symbol symbol)\n        {\n            if (symbol.SecurityType == SecurityType.Equity || symbol.SecurityType.IsOption())\n            {\n                return \"DEFAULT\";\n            }\n\n            switch (symbol.ID.Market)\n            {\n                case Market.India:\n                    return \"XNSE\";\n                case Market.HKFE:\n                    return \"XHKF\";\n                case Market.NYSELIFFE:\n                    return \"XNLI\";\n                case Market.EUREX:\n                    return \"XEUR\";\n                case Market.ICE:\n                    return \"IEPA\";\n                case Market.CBOE:\n                    return \"XCBO\";\n                case Market.CFE:\n                    return \"XCBF\";\n                case Market.CBOT:\n                    return \"XCBT\";\n                case Market.COMEX:\n                    return \"XCEC\";\n                case Market.NYMEX:\n                    return \"XNYM\";\n                case Market.SGX:\n                    return \"XSES\";\n                case Market.FXCM:\n                    return symbol.ID.Market.ToUpper();\n                case Market.OSE:\n                case Market.CME:\n                    return $\"X{symbol.ID.Market.ToUpper()}\";\n                default:\n                    if (_unknownMarketSymbols.Add(symbol.Value))\n                    {\n                        _algorithm.Debug($\"The market of the symbol {symbol.Value} was unexpected: {symbol.ID.Market}. Using 'DEFAULT' as market\");\n                    }\n\n                    return \"DEFAULT\";\n            }\n        }\n\n        /// <summary>\n        /// Returns the given security type in the format C2 expects\n        /// </summary>\n        private string GetSecurityTypeAcronym(SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    return \"CS\";\n                case SecurityType.Future:\n                    return \"FUT\";\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    return \"OPT\";\n                case SecurityType.Forex:\n                    return \"FOR\";\n                default:\n                    if (_unknownSecurityTypes.Add(securityType))\n                    {\n                        _algorithm.Debug($\"Unexpected security type found: {securityType}. Collective2 just accepts: Equity, Future, Option, Index Option and Stock\");\n                    }\n                    return null;\n            }\n        }\n\n        /// <summary>\n        /// Returns the expiration date in the format C2 expects\n        /// </summary>\n        private string GetMaturityMonthYear(Symbol symbol)\n        {\n            var delistingDate = symbol.GetDelistingDate();\n            if (delistingDate == Time.EndOfTime) // The given symbol is equity or forex\n            {\n                return null;\n            }\n\n            if (delistingDate < _algorithm.Securities[symbol].LocalTime.Date) // The given symbol has already expired\n            {\n                _algorithm.Error($\"Instrument {symbol} has already expired. Its delisting date was: {delistingDate}. This signal won't be sent to Collective2.\");\n                return string.Empty;\n            }\n\n            return $\"{delistingDate:yyyyMMdd}\";\n        }\n\n        private int? GetPutOrCallValue(Symbol symbol)\n        {\n            if (symbol.SecurityType.IsOption())\n            {\n                switch (symbol.ID.OptionRight)\n                {\n                    case OptionRight.Put:\n                        return 0;\n                    case OptionRight.Call:\n                        return 1;\n                }\n            }\n\n            return null;\n        }\n\n        private decimal? GetStrikePrice(Symbol symbol)\n        {\n            if (symbol.SecurityType.IsOption())\n            {\n                return symbol.ID.StrikePrice;\n            }\n            else\n            {\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// The C2 ResponseStatus object\n        /// </summary>\n        private class ResponseStatus\n        {\n            /* Example:\n\n                    \"ResponseStatus\":\n                    {\n                      \"ErrorCode\": \"\"401\",\n                      \"Message\": \"\"Unauthorized\",\n                      \"Errors\": [\n                        {\n                          \"ErrorCode\": \"2015\",\n                          \"FieldName\": \"APIKey\",\n                          \"Message\": \"\"Unknown API Key\"\n                        }\n                      ]\n                    }\n            */\n\n\n            [JsonProperty(PropertyName = \"ErrorCode\")]\n            public string ErrorCode { get; set; }\n\n\n            [JsonProperty(PropertyName = \"Message\")]\n            public string Message { get; set; }\n\n\n            [JsonProperty(PropertyName = \"Errors\")]\n            public List<ResponseError> Errors { get; set; }\n\n        }\n\n        /// <summary>\n        /// The ResponseError object\n        /// </summary>\n        private class ResponseError\n        {\n            [JsonProperty(PropertyName = \"ErrorCode\")]\n            public string ErrorCode { get; set; }\n\n\n            [JsonProperty(PropertyName = \"FieldName\")]\n            public string FieldName { get; set; }\n\n\n            [JsonProperty(PropertyName = \"Message\")]\n            public string Message { get; set; }\n        }\n\n        /// <summary>\n        /// Stores position's needed information to be serialized in JSON format\n        /// and then sent to Collective2 API\n        /// </summary>\n        protected class Collective2Position\n        {\n            /// <summary>\n            /// Position symbol\n            /// </summary>\n            [JsonProperty(PropertyName = \"exchangeSymbol\")]\n            public C2ExchangeSymbol ExchangeSymbol { get; set; }\n\n            /// <summary>\n            /// Number of shares/contracts of the given symbol. Positive quantites are long positions\n            /// and negative short positions.\n            /// </summary>\n            [JsonProperty(PropertyName = \"quantity\")]\n            public decimal Quantity { get; set; } // number of shares, not % of the portfolio\n        }\n\n        /// <summary>\n        /// The Collective2 symbol\n        /// </summary>\n        protected class C2ExchangeSymbol\n        {\n            /// <summary>\n            /// The exchange root symbol e.g. AAPL\n            /// </summary>\n            [JsonProperty(PropertyName = \"symbol\")]\n            public string Symbol { get; set; }\n\n            /// <summary>\n            /// The 3-character ISO instrument currency. E.g. 'USD'\n            /// </summary>\n            [JsonProperty(PropertyName = \"currency\")]\n            public string Currency { get; set; }\n\n            /// <summary>\n            /// The MIC Exchange code e.g. DEFAULT (for stocks & options),\n            /// XCME, XEUR, XICE, XLIF, XNYB, XNYM, XASX, XCBF, XCBT, XCEC,\n            /// XKBT, XSES. See details at http://www.iso15022.org/MIC/homepageMIC.htm\n            /// </summary>\n            [JsonProperty(PropertyName = \"securityExchange\")]\n            public string SecurityExchange { get; set; }\n\n\n            /// <summary>\n            /// The SecurityType e.g. 'CS'(Common Stock), 'FUT' (Future), 'OPT' (Option), 'FOR' (Forex)\n            /// </summary>\n            [JsonProperty(PropertyName = \"securityType\")]\n            public string SecurityType { get; set; }\n\n            /// <summary>\n            /// The MaturityMonthYear e.g. '202103' (March 2021), or if the contract requires a day: '20210521' (May 21, 2021)\n            /// </summary>\n            [JsonProperty(PropertyName = \"maturityMonthYear\")]\n            public string MaturityMonthYear { get; set; }\n\n            /// <summary>\n            /// The Option PutOrCall e.g. 0 = Put, 1 = Call\n            /// </summary>\n            [JsonProperty(PropertyName = \"putOrCall\")]\n            public int? PutOrCall { get; set; }\n\n            /// <summary>\n            /// The ISO Option Strike Price. Zero means none\n            /// </summary>\n            [JsonProperty(PropertyName = \"strikePrice\")]\n            public decimal? StrikePrice { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Exports signals of the desired positions to CrunchDAO API.\n    /// Accepts signals in percentage i.e ticker:\"SPY\", date: \"2020-10-04\", signal:0.54\n    /// </summary>\n    public class CrunchDAOSignalExport : BaseSignalExport\n    {\n        /// <summary>\n        /// CrunchDAO API key\n        /// </summary>\n        private readonly string _apiKey;\n\n        /// <summary>\n        /// CrunchDAO API endpoint\n        /// </summary>\n        private readonly Uri _destination;\n\n        /// <summary>\n        /// Model ID or Name\n        /// </summary>\n        private readonly string _model;\n\n        /// <summary>\n        /// Submission Name (Optional)\n        /// </summary>\n        private readonly string _submissionName;\n\n        /// <summary>\n        /// Comment (Optional)\n        /// </summary>\n        private readonly string _comment;\n\n        /// <summary>\n        /// Algorithm being ran\n        /// </summary>\n        private IAlgorithm _algorithm;\n\n        /// <summary>\n        /// HashSet of allowed SecurityTypes for CrunchDAO\n        /// </summary>\n        private readonly HashSet<SecurityType> _allowedSecurityTypes = new()\n        {\n            SecurityType.Equity\n        };\n\n        /// <summary>\n        /// The name of this signal export\n        /// </summary>\n        protected override string Name { get; } = \"CrunchDAO\";\n\n        /// <summary>\n        /// HashSet property of allowed SecurityTypes for CrunchDAO\n        /// </summary>\n        protected override HashSet<SecurityType> AllowedSecurityTypes => _allowedSecurityTypes;\n\n        /// <summary>\n        /// CrunchDAOSignalExport constructor. It obtains the required information for CrunchDAO API requests.\n        /// See (https://colab.research.google.com/drive/1YW1xtHrIZ8ZHW69JvNANWowmxPcnkNu0?authuser=1#scrollTo=aPyWNxtuDc-X)\n        /// </summary>\n        /// <param name=\"apiKey\">API key provided by CrunchDAO</param>\n        /// <param name=\"model\">Model ID or Name</param>\n        /// <param name=\"submissionName\">Submission Name (Optional)</param>\n        /// <param name=\"comment\">Comment (Optional)</param>\n        public CrunchDAOSignalExport(string apiKey, string model, string submissionName = \"\", string comment = \"\")\n        {\n            _apiKey = apiKey;\n            _model = model;\n            _submissionName = submissionName;\n            _comment = comment;\n            _destination = new Uri($\"https://api.tournament.crunchdao.com/v3/alpha-submissions?apiKey={apiKey}\");\n        }\n\n        /// <summary>\n        /// Verifies every holding is a stock, creates a message with the desired positions\n        /// using the expected CrunchDAO API format, verifies there is an open round and then\n        /// sends the positions with the other required body features. If another signal was \n        /// submitted before, it deletes the last signal and sends the new one</summary>\n        /// <param name=\"parameters\">A list of holdings from the portfolio,\n        /// expected to be sent to CrunchDAO API and the algorithm being ran</param>\n        /// <returns>True if the positions were sent to CrunchDAO succesfully and errors were returned, false otherwise</returns>\n        public override bool Send(SignalExportTargetParameters parameters)\n        {\n            if (!base.Send(parameters))\n            {\n                return false;\n            }\n\n            if (!ConvertToCSVFormat(parameters, out string positions))\n            {\n                return false;\n            }\n\n            if (!GetCurrentRoundID(out int currentRoundId))\n            {\n                return false;\n            }\n\n            if (GetLastSubmissionId(currentRoundId, out int lastSubmissionId))\n            {\n                _algorithm.Debug($\"You have already submitted a signal for round {currentRoundId}. Your last submission is going to be overwritten with the new one\");\n                if (!DeleteLastSubmission(lastSubmissionId))\n                {\n                    return false;\n                }\n            }\n\n            var result = SendPositions(positions);\n            return result;\n        }\n\n        /// <summary>\n        /// Converts the list of holdings into a CSV format string\n        /// </summary>\n        /// <param name=\"parameters\">A list of holdings from the portfolio,\n        /// expected to be sent to CrunchDAO API and the algorithm being ran</param>\n        /// <param name=\"positions\">A CSV format string of the given holdings with the required features(ticker, date, signal)</param>\n        /// <returns>True if a string message with the positions could be obtained, false otherwise</returns>\n        protected bool ConvertToCSVFormat(SignalExportTargetParameters parameters, out string positions)\n        {\n            var holdings = parameters.Targets;\n            _algorithm = parameters.Algorithm;\n            positions = \"ticker,date,signal\\n\";\n\n            foreach (var holding in holdings)\n            {\n                if (holding.Quantity < 0 || holding.Quantity > 1)\n                {\n                    _algorithm.Error($\"All signals must be between 0 and 1, but {holding.Symbol.Value} signal was {holding.Quantity}\");\n                    return false;\n                }\n\n                positions += $\"{_algorithm.Ticker(holding.Symbol)},{_algorithm.Securities[holding.Symbol].LocalTime.ToString(\"yyyy-MM-dd\")},{holding.Quantity.ToStringInvariant()}\\n\";\n            }\n            \n            return true;\n        }\n\n        /// <summary>\n        /// Sends the desired positions, with the other required features, to CrunchDAO API using a POST request. It logs\n        /// the message retrieved by the API if there was a HttpRequestException\n        /// </summary>\n        /// <param name=\"positions\">A CSV format string of the given holdings with the required features</param>\n        /// <returns>True if the positions were sent to CrunchDAO successfully and errors were returned. False, otherwise</returns>\n        private bool SendPositions(string positions)\n        {\n            // Create positions stream\n            var positionsStream = new MemoryStream();\n            using var writer = new StreamWriter(positionsStream);\n            writer.Write(positions);\n            writer.Flush();\n            positionsStream.Position = 0;\n\n            // Create the required body features for the POST request\n            using var file = new StreamContent(positionsStream);\n            using var model = new StringContent(_model);\n            using var submissionName = new StringContent(_submissionName);\n            using var comment = new StringContent(_comment);\n\n            // Crete the httpMessage to be sent and add the different POST request body features\n            using var httpMessage = new MultipartFormDataContent\n            {\n                { model, \"model\" },\n                { submissionName, \"label\" },\n                { comment, \"comment\" },\n                { file, \"file\", \"submission.csv\" }\n            };\n\n            // Send the httpMessage\n            using HttpResponseMessage response = HttpClient.PostAsync(_destination, httpMessage).Result;\n            if (response.StatusCode == System.Net.HttpStatusCode.Locked || response.StatusCode == System.Net.HttpStatusCode.Forbidden)\n            {\n                var responseContent = response.Content.ReadAsStringAsync().Result;\n                var parsedResponseContent = JObject.Parse(responseContent);\n                _algorithm.Error($\"CrunchDAO API returned code: {parsedResponseContent[\"code\"]} message:{parsedResponseContent[\"message\"]}\");\n                return false;\n            }\n\n            if (!response.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"CrunchDAO API returned HttpRequestException {response.StatusCode}\");\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Checks if there is an open round, if so it assigns the current round ID to currentRoundId\n        /// parameter\n        /// </summary>\n        /// <param name=\"currentRoundId\">Current round ID</param>\n        /// <returns>True if there is an open round, false otherwise</returns>\n        private bool GetCurrentRoundID(out int currentRoundId)\n        {\n            // Assign a default value to currentRoundId\n            currentRoundId = -1;\n            using HttpResponseMessage roundIdResponse = HttpClient.GetAsync(\"https://api.tournament.crunchdao.com/v2/rounds/@current\").Result;\n            if (roundIdResponse.StatusCode == System.Net.HttpStatusCode.NotFound)\n            {\n                var responseContent = roundIdResponse.Content.ReadAsStringAsync().Result;\n                var parsedResponseContent = JObject.Parse(responseContent);\n                _algorithm.Error($\"CrunchDAO API returned code: {parsedResponseContent[\"code\"]} message:{parsedResponseContent[\"message\"]}\");\n                return false;\n            } \n            else if (!roundIdResponse.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"CrunchDAO API returned HttpRequestException {roundIdResponse.StatusCode}\");\n                return false;\n            }\n\n            var roundIdResponseContent = roundIdResponse.Content.ReadAsStringAsync().Result;\n            currentRoundId = (int)(JObject.Parse(roundIdResponseContent)[\"id\"]);\n            return true;\n        }\n\n        /// <summary>\n        /// Checks if there is a submission for the current round, if so it assigns its ID to\n        /// lastSubmissionId\n        /// </summary>\n        /// <param name=\"currentRoundId\">Current round ID</param>\n        /// <param name=\"lastSubmissionId\">Last submission ID (for the current round)</param>\n        /// <returns>True if there's a submission for the current round, false otherwise</returns>\n        private bool GetLastSubmissionId(int currentRoundId, out int lastSubmissionId)\n        {\n            using HttpResponseMessage submissionIdResponse = HttpClient.GetAsync($\"https://tournament.crunchdao.com/api/v3/alpha-submissions?includeAll=false&roundId={currentRoundId}&apiKey={_apiKey}\").Result;\n\n            if (!submissionIdResponse.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"CrunchDAO API returned the following Error Code: {submissionIdResponse.StatusCode}\");\n                lastSubmissionId = -1;\n                return false;\n            }\n\n            var submissionIdResponseContent = submissionIdResponse.Content.ReadAsStringAsync().Result;\n            var parsedSubmissionIdResponseContent = JArray.Parse(submissionIdResponseContent);\n            if (!parsedSubmissionIdResponseContent.HasValues)\n            {\n                // Default value for lastSubmissionId\n                lastSubmissionId = -1;\n                return false;\n            }\n\n            lastSubmissionId = (int)parsedSubmissionIdResponseContent[0][\"id\"];\n            return true;\n        }\n\n        /// <summary>\n        /// Deletes the last submission for the current round\n        /// </summary>\n        /// <param name=\"lastSubmissionId\">Last submission ID for the current round</param>\n        /// <returns>True if the last submission could be deleted sucessfully, false otherwise</returns>\n        private bool DeleteLastSubmission(int lastSubmissionId)\n        {\n            using HttpResponseMessage deleteSubmissionResponse = HttpClient.DeleteAsync($\"https://tournament.crunchdao.com/api/v3/alpha-submissions/{lastSubmissionId}?&apiKey={_apiKey}\").Result;\n            if (!deleteSubmissionResponse.IsSuccessStatusCode)\n            {\n                var responseContent = deleteSubmissionResponse.Content.ReadAsStringAsync().Result;\n                var parsedResponseContent = JObject.Parse(responseContent);\n                _algorithm.Error($\"CrunchDAO API returned code: {parsedResponseContent[\"code\"]} message:{parsedResponseContent[\"message\"]}. Last submission could not be deleted\");\n                return false;\n            }\n\n            _algorithm.Debug($\"Last submission has been deleted\");\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http;\nusing System.Text;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Exports signals of the desired positions to Numerai API.\n    /// Accepts signals in percentage i.e numerai_ticker:\"IBM US\", signal:0.234\n    /// </summary>\n    /// <remarks>It does not take into account flags as \n    /// NUMERAI_COMPUTE_ID (https://github.com/numerai/numerapi/blob/master/numerapi/signalsapi.py#L164) and \n    /// TRIGGER_ID(https://github.com/numerai/numerapi/blob/master/numerapi/signalsapi.py#L164)</remarks>\n    public class NumeraiSignalExport : BaseSignalExport\n    {\n        /// <summary>\n        /// Numerai API submission endpoint\n        /// </summary>\n        private readonly Uri _destination;\n\n        /// <summary>\n        /// PUBLIC_ID provided by Numerai\n        /// </summary>\n        private readonly string _publicId;\n\n        /// <summary>\n        /// SECRET_ID provided by Numerai\n        /// </summary>\n        private readonly string _secretId;\n\n        /// <summary>\n        /// ID of the Numerai Model being used\n        /// </summary>\n        private readonly string _modelId;\n\n        /// <summary>\n        /// Signal file's name\n        /// </summary>\n        private readonly string _fileName;\n\n        /// <summary>\n        /// Algorithm being ran\n        /// </summary>\n        private IAlgorithm _algorithm;\n\n        /// <summary>\n        /// Dictionary to obtain corresponding Numerai Market name for the given LEAN market name\n        /// </summary>\n        private readonly Dictionary<string, string> _numeraiMarketFormat = new() // There can be stocks from other markets\n        {\n            {Market.USA, \"US\" },\n            {Market.SGX, \"SP\" }\n        };\n\n        /// <summary>\n        /// Hashset of Numerai allowed SecurityTypes\n        /// </summary>\n        private readonly HashSet<SecurityType> _allowedSecurityTypes = new()\n        {\n            SecurityType.Equity\n        };\n\n        /// <summary>\n        /// The name of this signal export\n        /// </summary>\n        protected override string Name { get; } = \"Numerai\";\n\n        /// <summary>\n        /// Hashset property of Numerai allowed SecurityTypes\n        /// </summary>\n        protected override HashSet<SecurityType> AllowedSecurityTypes => _allowedSecurityTypes;\n\n        /// <summary>\n        /// NumeraiSignalExport Constructor. It obtains the required information for Numerai API requests\n        /// </summary>\n        /// <param name=\"publicId\">PUBLIC_ID provided by Numerai</param>\n        /// <param name=\"secretId\">SECRET_ID provided by Numerai</param>\n        /// <param name=\"modelId\">ID of the Numerai Model being used</param>\n        /// <param name=\"fileName\">Signal file's name</param>\n        public NumeraiSignalExport(string publicId, string secretId, string modelId, string fileName = \"predictions.csv\")\n        {\n            _destination = new Uri(\"https://api-tournament.numer.ai\");\n            _publicId = publicId;\n            _secretId = secretId;\n            _modelId = modelId;\n            _fileName = fileName;\n        }\n\n        /// <summary>\n        /// Verifies all the given holdings are accepted by Numerai, creates a message with those holdings in the expected\n        /// Numerai API format and sends them to Numerai API\n        /// </summary>\n        /// <param name=\"parameters\">A list of portfolio holdings expected to be sent to Numerai API and the algorithm being ran</param>\n        /// <returns>True if the positions were sent to Numerai API correctly and no errors were returned, false otherwise</returns>\n        public override bool Send(SignalExportTargetParameters parameters)\n        {\n            if (!base.Send(parameters))\n            {\n                return false;\n            }\n\n            _algorithm = parameters.Algorithm;\n\n            if (parameters.Targets.Count < 10)\n            {\n                _algorithm.Error($\"Numerai Signals API accepts minimum 10 different signals, just found {parameters.Targets.Count}\");\n                return false;\n            }\n\n            if (!ConvertTargetsToNumerai(parameters, out string positions))\n            {\n                return false;\n            }\n            var result = SendPositions(positions);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Verifies each holding's signal is between 0 and 1 (exclusive)\n        /// </summary>\n        /// <param name=\"parameters\">A list of portfolio holdings expected to be sent to Numerai API</param>\n        /// <param name=\"positions\">A message with the desired positions in the expected Numerai API format</param>\n        /// <returns>True if a string message with the positions could be obtained, false otherwise</returns>\n        protected bool ConvertTargetsToNumerai(SignalExportTargetParameters parameters, out string positions)\n        {\n            positions = \"numerai_ticker,signal\\n\";\n            foreach ( var holding in parameters.Targets)\n            {\n                if (holding.Quantity <= 0 || holding.Quantity >= 1)\n                {\n                    _algorithm.Error($\"All signals must be between 0 and 1 (exclusive), but {holding.Symbol.Value} signal was {holding.Quantity}\");\n                    return false;\n                }\n\n                positions += $\"{parameters.Algorithm.Ticker(holding.Symbol)} {_numeraiMarketFormat[holding.Symbol.ID.Market]},{holding.Quantity.ToStringInvariant()}\\n\";\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Sends the given positions message to Numerai API. It first sends an authentication POST request then a\n        /// PUT request to put the positions in certain endpoint and finally sends a submission POST request \n        /// </summary>\n        /// <param name=\"positions\">A message with the desired positions in the expected Numerai API format</param>\n        /// <returns>True if the positions were sent to Numerai API correctly and no errors were returned, false otherwise</returns>\n        private bool SendPositions(string positions)\n        {\n            // AUTHENTICATION REQUEST\n            var authQuery = @\"query($filename: String!\n                  $modelId: String) {\n              submissionUploadSignalsAuth(filename: $filename\n                                        modelId: $modelId) {\n                    filename\n                    url\n                }\n            }\";\n\n            var arguments = new\n            {\n                filename = _fileName,\n                modelId = _modelId\n            };\n            var argumentsMessage = JsonConvert.SerializeObject(arguments);\n\n            using var variables = new StringContent(argumentsMessage, Encoding.UTF8, \"application/json\");\n            using var query = new StringContent(authQuery, Encoding.UTF8, \"application/json\");\n\n            var httpMessage = new MultipartFormDataContent\n            {\n                { query, \"query\"},\n                { variables, \"variables\" }\n            };\n\n            using var authRequest = new HttpRequestMessage(HttpMethod.Post, _destination);\n            authRequest.Headers.Add(\"Accept\", \"application/json\");\n            authRequest.Headers.Add(\"Authorization\", $\"Token {_publicId}${_secretId}\");\n            authRequest.Content = httpMessage;\n            var response = HttpClient.SendAsync(authRequest).Result;\n            var responseContent = response.Content.ReadAsStringAsync().Result;\n            if (!response.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"Numerai API returned HttpRequestException {response.StatusCode}\");\n                return false;\n            }\n\n            var parsedResponseContent = JObject.Parse(responseContent);\n            if (!parsedResponseContent[\"data\"][\"submissionUploadSignalsAuth\"].HasValues)\n            {\n                _algorithm.Error($\"Numerai API returned the following errors: {string.Join(\",\", parsedResponseContent[\"errors\"])}\");\n                return false;\n            }\n\n            var putUrl = new Uri((string)parsedResponseContent[\"data\"][\"submissionUploadSignalsAuth\"][\"url\"]);\n            var submissionFileName = (string)parsedResponseContent[\"data\"][\"submissionUploadSignalsAuth\"][\"filename\"];\n\n            // PUT REQUEST\n            // Create positions stream\n            var positionsStream = new MemoryStream();\n            using var writer = new StreamWriter(positionsStream);\n            writer.Write(positions);\n            writer.Flush();\n            positionsStream.Position = 0;            \n            using var putRequest = new HttpRequestMessage(HttpMethod.Put, putUrl)\n            {\n                Content = new StreamContent(positionsStream)\n            };\n            var putResponse = HttpClient.SendAsync(putRequest).Result;\n\n            // SUBMISSION REQUEST\n            var createQuery = @\"mutation($filename: String!\n                     $modelId: String\n                     $triggerId: String) {\n                createSignalsSubmission(filename: $filename\n                                        modelId: $modelId\n                                        triggerId: $triggerId\n                                        source: \"\"numerapi\"\") {\n                    id\n                    firstEffectiveDate\n                }\n            }\";\n\n            var createArguments = new\n            {\n                filename = submissionFileName,\n                modelId = _modelId\n            };\n            var createArgumentsMessage = JsonConvert.SerializeObject(createArguments);\n\n            using var submissionQuery = new StringContent(createQuery, Encoding.UTF8, \"application/json\");\n            using var submissionVariables = new StringContent(createArgumentsMessage, Encoding.UTF8, \"application/json\");\n\n            var submissionMessage = new MultipartFormDataContent\n            {\n                {submissionQuery, \"query\"},\n                {submissionVariables, \"variables\"}\n            };\n\n            using var submissionRequest = new HttpRequestMessage(HttpMethod.Post, _destination);\n            submissionRequest.Headers.Add(\"Authorization\", $\"Token {_publicId}${_secretId}\");\n            submissionRequest.Content = submissionMessage;\n            var submissionResponse = HttpClient.SendAsync(submissionRequest).Result;\n            var submissionResponseContent = submissionResponse.Content.ReadAsStringAsync().Result;\n            if (!submissionResponse.IsSuccessStatusCode)\n            {\n                _algorithm.Error($\"Numerai API returned HttpRequestException {submissionResponseContent}\");\n                return false;\n            }\n\n            var parsedSubmissionResponseContent = JObject.Parse(submissionResponseContent);\n            if (!parsedSubmissionResponseContent[\"data\"][\"createSignalsSubmission\"].HasValues)\n            {\n                _algorithm.Error($\"Numerai API returned the following errors: {string.Join(\",\", parsedSubmissionResponseContent[\"errors\"])}\");\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Class manager to send portfolio targets to different 3rd party API's\n    /// For example, it allows Collective2, CrunchDAO and Numerai signal export providers\n    /// </summary>\n    public class SignalExportManager\n    {\n        /// <summary>\n        /// Records the time of the first order event of a group of events\n        /// </summary>\n        private ReferenceWrapper<DateTime> _initialOrderEventTimeUtc = new(Time.EndOfTime);\n\n        /// <summary>\n        /// List of signal export providers\n        /// </summary>\n        private List<ISignalExportTarget> _signalExports;\n\n        /// <summary>\n        /// Algorithm being ran\n        /// </summary>\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// Flag to indicate if the user has tried to send signals with live mode off\n        /// </summary>\n        private bool _isLiveWarningModeLog;\n\n        /// <summary>\n        /// Gets the maximim time span elapsed to export signals after an order event \n        /// If null, disable automatic export.\n        /// </summary>\n        public TimeSpan? AutomaticExportTimeSpan { get; set; } = TimeSpan.FromSeconds(5);\n\n        /// <summary>\n        /// SignalExportManager Constructor, obtains the entry information needed to send signals\n        /// and initializes the fields to be used\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm being run</param>\n        public SignalExportManager(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n            _isLiveWarningModeLog = false;\n        }\n\n        /// <summary>\n        /// Adds a new signal exports provider\n        /// </summary>\n        /// <param name=\"signalExport\">Signal export provider</param>\n        public void AddSignalExportProvider(ISignalExportTarget signalExport)\n        {\n            _signalExports ??= [];\n            _signalExports.Add(signalExport);\n        }\n\n        /// <summary>\n        /// Adds a new signal exports provider\n        /// </summary>\n        /// <param name=\"signalExport\">Signal export provider</param>\n        public void AddSignalExportProvider(PyObject signalExport)\n        {\n            var managedSignalExport = PythonUtil.CreateInstanceOrWrapper<ISignalExportTarget>(\n                signalExport,\n                py => new SignalExportTargetPythonWrapper(py)\n            );\n            AddSignalExportProvider(managedSignalExport);\n        }\n\n        /// <summary>\n        /// Adds one or more new signal exports providers\n        /// </summary>\n        /// <param name=\"signalExports\">One or more signal export provider</param>\n        public void AddSignalExportProviders(params ISignalExportTarget[] signalExports)\n        {\n            signalExports.DoForEach(AddSignalExportProvider);\n        }\n\n        /// <summary>\n        /// Adds one or more new signal exports providers\n        /// </summary>\n        /// <param name=\"signalExports\">One or more signal export provider</param>\n        public void AddSignalExportProviders(PyObject signalExports)\n        {\n            using var _ = Py.GIL();\n            if (!signalExports.IsIterable())\n            {\n                AddSignalExportProvider(signalExports);\n                return;\n            }\n            PyList.AsList(signalExports).DoForEach(AddSignalExportProvider);\n        }\n\n        /// <summary>\n        /// Sets the portfolio targets from the algorihtm's Portfolio and sends them with the\n        /// algorithm being ran to the signal exports providers already set\n        /// </summary>\n        /// <returns>True if the target list could be obtained from the algorithm's Portfolio and they\n        /// were successfully sent to the signal export providers</returns>\n        public bool SetTargetPortfolioFromPortfolio()\n        {\n            if (!GetPortfolioTargets(out PortfolioTarget[] targets))\n            {\n                return false;\n            }\n            var result = SetTargetPortfolio(targets);\n            return result;\n        }\n\n        /// <summary>\n        /// Obtains an array of portfolio targets from algorithm's Portfolio and returns them.\n        /// See  <see cref=\"PortfolioTarget.Percent(IAlgorithm, Symbol, decimal, bool, string)\"/> for more\n        /// information about how each symbol quantity was calculated\n        /// </summary>\n        /// <param name=\"targets\">An array of portfolio targets from the algorithm's Portfolio</param>\n        /// <returns>True if TotalPortfolioValue was bigger than zero, false otherwise</returns>\n        protected bool GetPortfolioTargets(out PortfolioTarget[] targets)\n        {\n            var totalPortfolioValue = _algorithm.Portfolio.TotalPortfolioValue;\n            if (totalPortfolioValue <= 0)\n            {\n                _algorithm.Error(\"Total portfolio value was less than or equal to 0\");\n                targets = Array.Empty<PortfolioTarget>();\n                return false;\n            }\n\n            targets = GetPortfolioTargets(totalPortfolioValue).ToArray();\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the portfolio targets with the given entries and sends them with the algorithm\n        /// being ran to the signal exports providers set, as long as the algorithm is in live mode\n        /// </summary>\n        /// <param name=\"portfolioTargets\">One or more portfolio targets to be sent to the defined signal export providers</param>\n        /// <returns>True if the portfolio targets could be sent to the different signal export providers successfully, false otherwise</returns>\n        public bool SetTargetPortfolio(params PortfolioTarget[] portfolioTargets)\n        {\n            if (!_algorithm.LiveMode)\n            {\n                if (!_isLiveWarningModeLog)\n                {\n                    _algorithm.Debug(\"Portfolio targets are only sent in live mode\");\n                    _isLiveWarningModeLog = true;\n                }\n\n                return true;\n            }\n\n            if (_signalExports.IsNullOrEmpty())\n            {\n                return false;\n            }\n\n            if (portfolioTargets == null || portfolioTargets.Length == 0)\n            {\n                _algorithm.Debug(\"No portfolio target given\");\n                return false;\n            }\n\n            var targets = new List<PortfolioTarget>(portfolioTargets);\n            var signalExportTargetParameters = new SignalExportTargetParameters\n            {\n                Targets = targets,\n                Algorithm = _algorithm\n            };\n\n            var result = true;\n            foreach (var signalExport in _signalExports)\n            {\n                result &= signalExport.Send(signalExportTargetParameters);\n            }\n\n            return result;\n        }\n\n        private IEnumerable<PortfolioTarget> GetPortfolioTargets(decimal totalPortfolioValue)\n        {\n            foreach (var holding in _algorithm.Portfolio.Values)\n            {\n                var security = _algorithm.Securities[holding.Symbol];\n\n                // Skip non-tradeable securities except canonical futures as some signal providers\n                // like Collective2 accept them.\n                // See https://collective2.com/api-docs/latest#Basic_submitsignal_format\n                if (!security.IsTradable && !security.Symbol.IsCanonical())\n                {\n                    continue;\n                }\n\n                var marginParameters = new InitialMarginParameters(security, holding.Quantity);\n                var adjustedPercent = Math.Abs(security.BuyingPowerModel.GetInitialMarginRequirement(marginParameters) / totalPortfolioValue);\n\n                // See PortfolioTarget.Percent:\n                // we normalize the target buying power by the leverage so we work in the land of margin\n                var holdingPercent = adjustedPercent * security.BuyingPowerModel.GetLeverage(security);\n\n                // FreePortfolioValue is used for orders not to be rejected due to volatility when using SetHoldings and CalculateOrderQuantity\n                // Then, we need to substract its value from the TotalPortfolioValue and obtain again the holding percentage for our holding\n                var adjustedHoldingPercent = (holdingPercent * totalPortfolioValue) / _algorithm.Portfolio.TotalPortfolioValueLessFreeBuffer;\n                if (holding.Quantity < 0)\n                {\n                    adjustedHoldingPercent *= -1;\n                }\n\n                yield return new PortfolioTarget(holding.Symbol, adjustedHoldingPercent);\n            }\n        }\n\n        /// <summary>\n        /// New order event handler: on order status changes (filled, partially filled, cancelled etc).\n        /// </summary>\n        /// <param name=\"orderEvent\">Event information</param>\n        public void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (_initialOrderEventTimeUtc.Value == Time.EndOfTime && orderEvent.Status.IsFill())\n            {\n                _initialOrderEventTimeUtc = new(orderEvent.UtcTime);\n            }\n        }\n\n        /// <summary>\n        /// Set the target portfolio after order events.\n        /// </summary>\n        /// <param name=\"currentTimeUtc\">The current time of synchronous events</param>\n        public void Flush(DateTime currentTimeUtc)\n        {\n            var initialOrderEventTimeUtc = _initialOrderEventTimeUtc.Value;\n            if (_signalExports.IsNullOrEmpty() || initialOrderEventTimeUtc == Time.EndOfTime || !AutomaticExportTimeSpan.HasValue)\n            {\n                return;\n            }\n\n            if (currentTimeUtc - initialOrderEventTimeUtc < AutomaticExportTimeSpan)\n            {\n                return;\n            }\n\n            try\n            {\n                SetTargetPortfolioFromPortfolio();\n            }\n            catch (Exception exception)\n            {\n                // SetTargetPortfolioFromPortfolio logs all known error on LEAN side.\n                // Exceptions occurs in the ISignalExportTarget.Send method (user-defined).\n                _algorithm.Error($\"Failed to send portfolio target(s). Reason: {exception.Message}.{Environment.NewLine}{exception.StackTrace}\");\n            }\n            _initialOrderEventTimeUtc = new(Time.EndOfTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportTargetParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\n{\n    /// <summary>\n    /// Class to wrap objects needed to send signals to the different 3rd party API's\n    /// </summary>\n    public class SignalExportTargetParameters\n    {\n        /// <summary>\n        /// List of portfolio targets to be sent to some 3rd party API\n        /// </summary>\n        public List<PortfolioTarget> Targets { get; set; }\n\n        /// <summary>\n        /// Algorithm being ran\n        /// </summary>\n        public IAlgorithm Algorithm { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Algorithm/Framework/Portfolio/SignalExports/VBaseSignalExport.cs",
    "content": "/*\r\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\r\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n*/\r\n\r\nusing QuantConnect.Interfaces;\r\nusing QuantConnect.Util;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Net.Http;\r\nusing System.Net.Http.Headers;\r\nusing System.Security.Cryptography;\r\nusing System.Text;\r\nusing System.Threading;\r\n\r\nnamespace QuantConnect.Algorithm.Framework.Portfolio.SignalExports\r\n{\r\n    /// <summary>\r\n    /// Exports signals of desired positions to vBase stamping API using JSON and HTTPS.\r\n    /// Accepts signals in quantity(number of shares) i.e symbol:\"SPY\", quant:40\r\n    /// </summary>\r\n    public class VBaseSignalExport : BaseSignalExport\r\n    {\r\n        private const string ApiBaseUrl = \"https://app.vbase.com/api\";\r\n\r\n        /// <summary>\r\n        /// API key provided by vBase\r\n        /// </summary>\r\n        private readonly string _apiKey;\r\n\r\n        /// <summary>\r\n        /// The collection CID (SHA3-256 hash of collection name) to which we stamp signals\r\n        /// </summary>\r\n        private readonly string _collectionCid;\r\n\r\n        /// <summary>\r\n        /// Whether vBase should store the stamped file (defaults true)\r\n        /// </summary>\r\n        private readonly bool _storeStampedFile;\r\n\r\n        /// <summary>\r\n        /// Whether this request is idempotent (if true only first identical portfolio stored)\r\n        /// </summary>\r\n        private readonly bool _idempotent;\r\n\r\n        /// <summary>\r\n        /// The name of this signal export\r\n        /// </summary>\r\n        protected override string Name => \"vBase\";\r\n\r\n        private static RateGate _requestsRateLimiter;\r\n\r\n        private readonly Uri _stampApiUrl;\r\n\r\n        /// <summary>\r\n        /// Initializes a new instance of the <see cref=\"VBaseSignalExport\"/> class.\r\n        /// </summary>\r\n        /// <param name=\"apiKey\">The API key for vBase authentication.</param>\r\n        /// <param name=\"collectionName\">The target collection name.</param>\r\n        /// <param name=\"storeStampedFile\">Whether to store the stamped file (default true).</param>\r\n        /// <param name=\"idempotent\">\r\n        /// A boolean indicating whether to make the request idempotent.\r\n        /// If the request is idempotent, only the first stamp for a given portfolio will be made.\r\n        /// If the request is not idempotent, a new stamp will be made for each request.\r\n        /// </param>\r\n        public VBaseSignalExport(\r\n            string apiKey,\r\n            string collectionName,\r\n            bool storeStampedFile = true,\r\n            bool idempotent = false)\r\n        {\r\n            _apiKey = apiKey;\r\n\r\n            if (string.IsNullOrWhiteSpace(_apiKey))\r\n            {\r\n                throw new ArgumentException(\"vBaseSignalExport: API key not provided\");\r\n            }\r\n            if (string.IsNullOrWhiteSpace(collectionName))\r\n            {\r\n                throw new ArgumentException(\"vBaseSignalExport: Collection name not provided\");\r\n            }\r\n\r\n            _stampApiUrl = new Uri(ApiBaseUrl.TrimEnd('/') + \"/v1/stamp/\"); ;\r\n\r\n            var collectionCidBytes = SHA3_256.HashData(Encoding.UTF8.GetBytes(collectionName));\r\n            _collectionCid = \"0x\" + collectionCidBytes.ToHexString().ToLowerInvariant();\r\n\r\n            _storeStampedFile = storeStampedFile;\r\n            _idempotent = idempotent;\r\n            _requestsRateLimiter = new RateGate(10, TimeSpan.FromMinutes(5));\r\n        }\r\n\r\n        /// <summary>\r\n        /// Converts targets to CSV and posts them to vBase stamping endpoint\r\n        /// </summary>\r\n        /// <param name=\"parameters\">Signal export parameters (targets + algorithm)</param>\r\n        /// <returns>True if request succeeded</returns>\r\n        public override bool Send(SignalExportTargetParameters parameters)\r\n        {\r\n            if (!base.Send(parameters))\r\n            {\r\n                return false;\r\n            }\r\n\r\n            var csv = BuildCsv(parameters);\r\n            _requestsRateLimiter?.WaitToProceed();\r\n            return Stamp(csv, parameters.Algorithm);\r\n        }\r\n\r\n        /// <summary>\r\n        /// Builds a CSV (sym,wt) for the given targets\r\n        /// </summary>\r\n        /// <param name=\"parameters\">Signal export parameters</param>\r\n        /// <returns>Resulting CSV string</returns>\r\n        protected virtual string BuildCsv(SignalExportTargetParameters parameters)\r\n        {\r\n            var csv = \"sym,wt\\n\";\r\n\r\n            foreach (var target in parameters.Targets)\r\n            {\r\n                csv += $\"{target.Symbol.Value},{target.Quantity.ToStringInvariant()}\\n\";\r\n            }\r\n            return csv;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Sends the CSV payload to the vBase stamping API\r\n        /// </summary>\r\n        private bool Stamp(string csv, IAlgorithm algorithm)\r\n        {\r\n            try\r\n            {\r\n                var contentPairs = new List<KeyValuePair<string, string>>\r\n                {\r\n                    new KeyValuePair<string, string>(\"collectionCid\", _collectionCid),\r\n                    new KeyValuePair<string, string>(\"data\", csv),\r\n                    new KeyValuePair<string, string>(\"storeStampedFile\", _storeStampedFile.ToString()),\r\n                    new KeyValuePair<string, string>(\"idempotent\", _idempotent.ToString())\r\n                };\r\n\r\n                using var httpContent = new FormUrlEncodedContent(contentPairs);\r\n                using var request = new HttpRequestMessage(HttpMethod.Post, _stampApiUrl)\r\n                {\r\n                    Content = httpContent\r\n                };\r\n                request.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", _apiKey);\r\n\r\n                using var response = HttpClient.SendAsync(request).Result;\r\n                var body = response.Content.ReadAsStringAsync().Result;\r\n                if (!response.IsSuccessStatusCode)\r\n                {\r\n                    algorithm.Error($\"vBase API returned {response.StatusCode}. Body: {body}\");\r\n                    return false;\r\n                }\r\n\r\n                return true;\r\n            }\r\n            catch (Exception e)\r\n            {\r\n                algorithm.Error($\"vBase signal export failed: {e.Message}\");\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "Common/AlgorithmConfiguration.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// This class includes algorithm configuration settings and parameters.\n    /// This is used to include configuration parameters in the result packet to be used for report generation.\n    /// </summary>\n    public class AlgorithmConfiguration\n    {\n        /// <summary>\n        /// The algorithm's name\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// List of tags associated with the algorithm\n        /// </summary>\n        public ISet<string> Tags { get; set; }\n\n        /// <summary>\n        /// The algorithm's account currency\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public string AccountCurrency { get; set; }\n\n        /// <summary>\n        /// The algorithm's brokerage model\n        /// </summary>\n        /// <remarks> Required to set the correct brokerage model on report generation.</remarks>\n        public BrokerageName Brokerage { get; set; }\n\n        /// <summary>\n        /// The algorithm's account type\n        /// </summary>\n        /// <remarks> Required to set the correct brokerage model on report generation.</remarks>\n        public AccountType AccountType { get; set; }\n\n        /// <summary>\n        /// The parameters used by the algorithm\n        /// </summary>\n        public IReadOnlyDictionary<string, string> Parameters { get; set; }\n\n        /// <summary>\n        /// Backtest maximum end date\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// The backtest out of sample day count\n        /// </summary>\n        public int OutOfSampleDays { get; set; }\n\n        /// <summary>\n        /// The backtest start date\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime StartDate { get; set; }\n\n        /// <summary>\n        /// The backtest end date\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime EndDate { get; set; }\n\n        /// <summary>\n        /// Number of trading days per year for Algorithm's portfolio statistics.\n        /// </summary>\n        public int TradingDaysPerYear { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmConfiguration\"/> class\n        /// </summary>\n        public AlgorithmConfiguration(string name, ISet<string> tags, string accountCurrency, BrokerageName brokerageName,\n            AccountType accountType, IReadOnlyDictionary<string, string> parameters, DateTime startDate, DateTime endDate,\n            DateTime? outOfSampleMaxEndDate, int outOfSampleDays = 0, int tradingDaysPerYear = 0)\n        {\n            Name = name;\n            Tags = tags;\n            OutOfSampleMaxEndDate = outOfSampleMaxEndDate;\n            TradingDaysPerYear = tradingDaysPerYear;\n            OutOfSampleDays = outOfSampleDays;\n            AccountCurrency = accountCurrency;\n            Brokerage = brokerageName;\n            AccountType = accountType;\n            Parameters = parameters;\n            StartDate = startDate;\n            EndDate = endDate;\n        }\n\n        /// <summary>\n        /// Initializes a new empty instance of the <see cref=\"AlgorithmConfiguration\"/> class\n        /// </summary>\n        public AlgorithmConfiguration()\n        {\n            // use default value for backwards compatibility\n            TradingDaysPerYear = 252;\n        }\n\n        /// <summary>\n        /// Provides a convenience method for creating a <see cref=\"AlgorithmConfiguration\"/> for a given algorithm.\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm for which the configuration object is being created</param>\n        /// <param name=\"backtestNodePacket\">The associated backtest node packet if any</param>\n        /// <returns>A new AlgorithmConfiguration object for the specified algorithm</returns>\n        public static AlgorithmConfiguration Create(IAlgorithm algorithm, BacktestNodePacket backtestNodePacket)\n        {\n            return new AlgorithmConfiguration(\n                algorithm.Name,\n                algorithm.Tags,\n                algorithm.AccountCurrency,\n                BrokerageModel.GetBrokerageName(algorithm.BrokerageModel),\n                algorithm.BrokerageModel.AccountType,\n                algorithm.GetParameters(),\n                algorithm.StartDate,\n                algorithm.EndDate,\n                backtestNodePacket?.OutOfSampleMaxEndDate,\n                backtestNodePacket?.OutOfSampleDays ?? 0,\n                // use value = 252 like default for backwards compatibility\n                algorithm?.Settings?.TradingDaysPerYear ?? 252);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/AlgorithmImports.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\n\n# The runtimeconfig.json is stored alongside start.py, but start.py may be a\n# symlink and the directory start.py is stored in is not necessarily the\n# current working directory. We therefore construct the absolute path to the\n# start.py file, and find the runtimeconfig.json relative to that.\npath = os.path.dirname(os.path.realpath(__file__))\nsys.path.append(path)\n\nfrom clr import AddReference\nAddReference(\"System\")\n\n#Load assemblies\nfor file in os.listdir(path):\n    if file.endswith(\".dll\") and file.startswith(\"QuantConnect.\"):\n        AddReference(file.replace(\".dll\", \"\"))\n\nfrom System import *\nfrom System.Drawing import *\n\nfrom QuantConnect import *\nfrom QuantConnect.Api import *\nfrom QuantConnect.Util import *\nfrom QuantConnect.Data import *\nfrom QuantConnect.Orders import *\nfrom QuantConnect.Python import *\nfrom QuantConnect.Storage import *\nfrom QuantConnect.Research import *\nfrom QuantConnect.Commands import *\nfrom QuantConnect.Algorithm import *\nfrom QuantConnect.Statistics import *\nfrom QuantConnect.Parameters import *\nfrom QuantConnect.Benchmarks import *\nfrom QuantConnect.Brokerages import *\nfrom QuantConnect.Securities import *\nfrom QuantConnect.Indicators import *\nfrom QuantConnect.Interfaces import *\nfrom QuantConnect.Scheduling import *\nfrom QuantConnect.DataSource import *\nfrom QuantConnect.Orders.Fees import *\nfrom QuantConnect.Data.Custom import *\nfrom QuantConnect.Data.Market import *\nfrom QuantConnect.Lean.Engine import *\nfrom QuantConnect.Orders.Fills import *\nfrom QuantConnect.Configuration import *\nfrom QuantConnect.Notifications import *\nfrom QuantConnect.Data.Auxiliary import *\nfrom QuantConnect.Data.Shortable import *\nfrom QuantConnect.Orders.Slippage import *\nfrom QuantConnect.Securities.Forex import *\nfrom QuantConnect.Data.Fundamental import *\nfrom QuantConnect.Securities.Crypto import *\nfrom QuantConnect.Securities.Option import *\nfrom QuantConnect.Securities.Equity import *\nfrom QuantConnect.Securities.Future import *\nfrom QuantConnect.Data.Consolidators import *\nfrom QuantConnect.Orders.TimeInForces import *\nfrom QuantConnect.Algorithm.Framework import *\nfrom QuantConnect.Algorithm.Selection import *\nfrom QuantConnect.Securities.Positions import *\nfrom QuantConnect.Orders.OptionExercise import *\nfrom QuantConnect.Securities.Volatility import *\nfrom QuantConnect.Securities.Interfaces import *\nfrom QuantConnect.Data.UniverseSelection import *\nfrom QuantConnect.Securities.IndexOption import  *\nfrom QuantConnect.Data.Custom.IconicTypes import *\nfrom QuantConnect.Securities.CryptoFuture import *\nfrom QuantConnect.Algorithm.Framework.Risk import *\nfrom QuantConnect.Algorithm.Framework.Alphas import *\nfrom QuantConnect.Algorithm.Framework.Execution import *\nfrom QuantConnect.Algorithm.Framework.Portfolio import *\nfrom QuantConnect.Indicators.CandlestickPatterns import *\nfrom QuantConnect.Algorithm.Framework.Portfolio.SignalExports import *\nfrom QuantConnect.Algorithm.Framework.Selection import *\n\ntry:\n    import numpy as np\n    import pandas as pd\n    import matplotlib.pyplot as plt\nexcept:\n    pass\n\nfrom datetime import date, time, datetime, timedelta\nfrom typing import *\nimport math\nimport json\n\nQCAlgorithmFramework = QCAlgorithm\nQCAlgorithmFrameworkBridge = QCAlgorithm\n"
  },
  {
    "path": "Common/AlgorithmSettings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// This class includes user settings for the algorithm which can be changed in the <see cref=\"IAlgorithm.Initialize\"/> method\n    /// </summary>\n    public class AlgorithmSettings : IAlgorithmSettings\n    {\n        private static TimeSpan _defaultDatabasesRefreshPeriod =\n            TimeSpan.TryParse(Config.Get(\"databases-refresh-period\", \"1.00:00:00\"), out var refreshPeriod) ? refreshPeriod : Time.OneDay;\n\n        // We default this to true so that we don't terminate live algorithms when the\n        // brokerage account has existing holdings for an asset that is not supported by Lean.\n        // Users can override this on initialization so that the algorithm is not terminated when\n        // placing orders for assets without a correct definition or mapping.\n        private static bool _defaultIgnoreUnknownAssetHoldings = Config.GetBool(\"ignore-unknown-asset-holdings\", true);\n\n        /// <summary>\n        /// Gets whether or not WarmUpIndicator is allowed to warm up indicators\n        /// </summary>\n        public bool AutomaticIndicatorWarmUp { get; set; }\n\n        /// <summary>\n        /// True if should rebalance portfolio on security changes. True by default\n        /// </summary>\n        public bool? RebalancePortfolioOnSecurityChanges { get; set; }\n\n        /// <summary>\n        /// True if should rebalance portfolio on new insights or expiration of insights. True by default\n        /// </summary>\n        public bool? RebalancePortfolioOnInsightChanges { get; set; }\n\n        /// <summary>\n        /// The absolute maximum valid total portfolio value target percentage\n        /// </summary>\n        /// <remarks>This setting is currently being used to filter out undesired target percent values,\n        /// caused by the IPortfolioConstructionModel implementation being used.\n        /// For example rounding errors, math operations</remarks>\n        public decimal MaxAbsolutePortfolioTargetPercentage { get; set; }\n\n        /// <summary>\n        /// The absolute minimum valid total portfolio value target percentage\n        /// </summary>\n        /// <remarks>This setting is currently being used to filter out undesired target percent values,\n        /// caused by the IPortfolioConstructionModel implementation being used.\n        /// For example rounding errors, math operations</remarks>\n        public decimal MinAbsolutePortfolioTargetPercentage { get; set; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes\n        /// </summary>\n        /// <remarks>Default value is 0.1% of the portfolio value. This setting is useful to avoid small trading noise when using SetHoldings</remarks>\n        public decimal MinimumOrderMarginPortfolioPercentage { get; set; }\n\n        /// <summary>\n        /// Gets/sets the maximum number of concurrent market data subscriptions available\n        /// </summary>\n        /// <remarks>\n        /// All securities added with <see cref=\"IAlgorithm.AddSecurity\"/> are counted as one,\n        /// with the exception of options and futures where every single contract in a chain counts as one.\n        /// </remarks>\n        [Obsolete(\"This property is deprecated. Please observe data subscription limits set by your brokerage to avoid runtime errors.\")]\n        public int DataSubscriptionLimit { get; set; } = int.MaxValue;\n\n        /// <summary>\n        /// Gets/sets the SetHoldings buffers value.\n        /// The buffer is used for orders not to be rejected due to volatility when using SetHoldings and CalculateOrderQuantity\n        /// </summary>\n        public decimal? FreePortfolioValue { get; set; }\n\n        /// <summary>\n        /// Gets/sets the SetHoldings buffers value percentage.\n        /// This percentage will be used to set the <see cref=\"FreePortfolioValue\"/>\n        /// based on the <see cref=\"SecurityPortfolioManager.TotalPortfolioValue\"/>\n        /// </summary>\n        public decimal FreePortfolioValuePercentage { get; set; }\n\n        /// <summary>\n        /// Gets/sets if Liquidate() is enabled\n        /// </summary>\n        public bool LiquidateEnabled { get; set; }\n\n        /// <summary>\n        /// Gets/sets the minimum time span elapsed to consider a market fill price as stale (defaults to one hour)\n        /// </summary>\n        /// <remarks>\n        /// In the default fill models, a warning message will be added to market order fills\n        /// if this time span (or more) has elapsed since the price was last updated.\n        /// </remarks>\n        /// <seealso cref=\"FillModel\"/>\n        /// <seealso cref=\"ImmediateFillModel\"/>\n        public TimeSpan StalePriceTimeSpan { get; set; }\n\n        /// <summary>\n        /// The warmup resolution to use if any\n        /// </summary>\n        /// <remarks>This allows improving the warmup speed by setting it to a lower resolution than the one added in the algorithm</remarks>\n        public Resolution? WarmupResolution { get; set; }\n\n        /// <summary>\n        /// The warmup resolution to use if any\n        /// </summary>\n        /// <remarks>This allows improving the warmup speed by setting it to a lower resolution than the one added in the algorithm.\n        /// Pass through version to be user friendly</remarks>\n        public Resolution? WarmUpResolution\n        {\n            get\n            {\n                return WarmupResolution;\n            }\n            set\n            {\n                WarmupResolution = value;\n            }\n        }\n\n        /// <summary>\n        /// Number of trading days per year for this Algorithm's portfolio statistics.\n        /// </summary>\n        /// <remarks>Effect on\n        /// <see cref=\"Statistics.PortfolioStatistics.AnnualVariance\"/>,\n        /// <seealso cref=\"Statistics.PortfolioStatistics.AnnualStandardDeviation\"/>,\n        /// <seealso cref=\"Statistics.PortfolioStatistics.SharpeRatio\"/>,\n        /// <seealso cref=\"Statistics.PortfolioStatistics.SortinoRatio\"/>,\n        /// <seealso cref=\"Statistics.PortfolioStatistics.TrackingError\"/>,\n        /// <seealso cref=\"Statistics.PortfolioStatistics.InformationRatio\"/>.\n        /// </remarks>\n        public int? TradingDaysPerYear { get; set; }\n\n        /// <summary>\n        /// True if daily strict end times are enabled\n        /// </summary>\n        public bool DailyPreciseEndTime { get; set; }\n\n        /// <summary>\n        /// True if extended market hours should be used for daily consolidation, when extended market hours is enabled\n        /// </summary>\n        public bool DailyConsolidationUseExtendedMarketHours { get; set; }\n\n        /// <summary>\n        /// Gets the time span used to refresh the market hours and symbol properties databases\n        /// </summary>\n        public TimeSpan DatabasesRefreshPeriod { get; set; }\n\n        /// <summary>\n        /// Determines whether to terminate the algorithm when an asset holding is not supported by Lean or the brokerage.\n        /// Defaults to true, meaning that the algorithm will not be terminated if an asset holding is not supported.\n        /// </summary>\n        public bool IgnoreUnknownAssetHoldings { get; set; }\n\n        /// <summary>\n        /// Performance tracking sample period to use if any, useful to debug performance issues\n        /// </summary>\n        public TimeSpan PerformanceSamplePeriod { get; set; }\n\n        /// <summary>\n        /// Determines whether to seed initial prices for all selected and manually added securities.\n        /// </summary>\n        public bool SeedInitialPrices { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmSettings\"/> class\n        /// </summary>\n        public AlgorithmSettings()\n        {\n            LiquidateEnabled = true;\n            DailyPreciseEndTime = true;\n            FreePortfolioValuePercentage = 0.0025m;\n            // Because the free portfolio value has a trailing behavior by default, let's add a default minimum order margin portfolio percentage\n            // to avoid tiny trades when rebalancing, defaulting to 0.1% of the TPV\n            MinimumOrderMarginPortfolioPercentage = 0.001m;\n            StalePriceTimeSpan = Time.OneHour;\n            MaxAbsolutePortfolioTargetPercentage = 1000000000;\n            MinAbsolutePortfolioTargetPercentage = 0.0000000001m;\n            DatabasesRefreshPeriod = _defaultDatabasesRefreshPeriod;\n            IgnoreUnknownAssetHoldings = _defaultIgnoreUnknownAssetHoldings;\n            SeedInitialPrices = false;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/AlgorithmUtils.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides utility methods for or related to algorithms\n    /// </summary>\n    public static class AlgorithmUtils\n    {\n        /// <summary>\n        /// Seeds the provided securities with their last known prices from the algorithm\n        /// </summary>\n        /// <param name=\"securities\">The securities to seed</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public static void SeedSecurities(IReadOnlyCollection<Security> securities, IAlgorithm algorithm)\n        {\n            var securitiesToSeed = securities.Where(x => x.Price == 0);\n            var data = algorithm.GetLastKnownPrices(securitiesToSeed.Select(x => x.Symbol));\n\n            foreach (var security in securitiesToSeed)\n            {\n                if (data.TryGetValue(security.Symbol, out var seedData))\n                {\n                    foreach (var datum in seedData)\n                    {\n                        security.SetMarketPrice(datum);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Account.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Account information for an organization\n    /// </summary>\n    public class Account : RestResponse\n    {\n        /// <summary>\n        /// The organization Id\n        /// </summary>\n        public string OrganizationId { get; set; }\n\n        /// <summary>\n        /// The current account balance\n        /// </summary>\n        public decimal CreditBalance { get; set; }\n\n        /// <summary>\n        /// The current organizations credit card\n        /// </summary>\n        public Card Card { get; set; }\n    }\n\n    /// <summary>\n    /// Credit card\n    /// </summary>\n    public class Card\n    {\n        /// <summary>\n        /// Credit card brand\n        /// </summary>\n        public string Brand { get; set; }\n\n        /// <summary>\n        /// The credit card expiration\n        /// </summary>\n        [JsonConverter(typeof(Time.MonthYearJsonConverter))]\n        public DateTime Expiration { get; set; }\n\n        /// <summary>\n        /// The last 4 digits of the card\n        /// </summary>\n        [JsonProperty(PropertyName = \"last4\")]\n        public decimal LastFourDigits { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Authentication.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Web;\nusing System.Text;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Helper methods for api authentication and interaction\n    /// </summary>\n    public static class Authentication\n    {\n        /// <summary>\n        /// Generate a secure hash for the authorization headers.\n        /// </summary>\n        /// <returns>Time based hash of user token and timestamp.</returns>\n        public static string Hash(int timestamp)\n        {\n            return Hash(timestamp, Globals.UserToken);\n        }\n\n        /// <summary>\n        /// Generate a secure hash for the authorization headers.\n        /// </summary>\n        /// <returns>Time based hash of user token and timestamp.</returns>\n        public static string Hash(int timestamp, string token)\n        {\n            // Create a new hash using current UTC timestamp.\n            // Hash must be generated fresh each time.\n            var data = $\"{token}:{timestamp.ToStringInvariant()}\";\n            return data.ToSHA256();\n        }\n\n        /// <summary>\n        /// Create an authenticated link for the target endpoint using the optional given payload\n        /// </summary>\n        /// <param name=\"endpoint\">The endpoint</param>\n        /// <param name=\"payload\">The payload</param>\n        /// <returns>The authenticated link to trigger the request</returns>\n        public static string Link(string endpoint, IEnumerable<KeyValuePair<string, object>> payload = null)\n        {\n            var queryString = HttpUtility.ParseQueryString(string.Empty);\n\n            var timestamp = (int)Time.TimeStamp();\n            queryString.Add(\"authorization\", Convert.ToBase64String(Encoding.UTF8.GetBytes($\"{Globals.UserId}:{Hash(timestamp)}\")));\n            queryString.Add(\"timestamp\", timestamp.ToStringInvariant());\n\n            PopulateQueryString(queryString, payload);\n\n            return $\"{Globals.Api}{endpoint.RemoveFromStart(\"/\").RemoveFromEnd(\"/\")}?{queryString}\";\n        }\n\n        /// <summary>\n        /// Helper method to populate a query string with the given payload\n        /// </summary>\n        /// <remarks>Useful for testing purposes</remarks>\n        public static void PopulateQueryString(NameValueCollection queryString, IEnumerable<KeyValuePair<string, object>> payload = null)\n        {\n            if (payload != null)\n            {\n                foreach (var kv in payload)\n                {\n                    AddToQuery(queryString, kv);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Will add the given key value pairs to the query encoded as xform data\n        /// </summary>\n        private static void AddToQuery(NameValueCollection queryString, KeyValuePair<string, object> keyValuePairs)\n        {\n            var objectType = keyValuePairs.Value.GetType();\n            if (objectType.IsValueType || objectType == typeof(string))\n            {\n                // straight\n                queryString.Add(keyValuePairs.Key, keyValuePairs.Value.ToString());\n            }\n            else\n            {\n                // let's take advantage of json to load the properties we should include\n                var serialized = JsonConvert.SerializeObject(keyValuePairs.Value);\n                foreach (var jObject in JObject.Parse(serialized))\n                {\n                    var subKey = $\"{keyValuePairs.Key}[{jObject.Key}]\";\n                    if (jObject.Value is JObject)\n                    {\n                        // inception\n                        AddToQuery(queryString, new KeyValuePair<string, object>(subKey, jObject.Value.ToObject<object>()));\n                    }\n                    else if(jObject.Value is JArray jArray)\n                    {\n                        var counter = 0;\n                        foreach (var value in jArray.ToObject<List<object>>())\n                        {\n                            queryString.Add($\"{subKey}[{counter++}]\", value.ToString());\n                        }\n                    }\n                    else\n                    {\n                        queryString.Add(subKey, jObject.Value.ToString());\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/AuthenticationResponse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Verify if the credentials are OK.\n    /// </summary>\n    public class AuthenticationResponse : RestResponse\n    {\n\n    }\n}"
  },
  {
    "path": "Common/Api/Backtest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// A power gauge for backtests, time and parameters to estimate the overfitting risk\n    /// </summary>\n    public class ResearchGuide\n    {\n        /// <summary>\n        /// Number of minutes used in developing the current backtest\n        /// </summary>\n        public int Minutes { get; set; }\n\n        /// <summary>\n        /// The quantity of backtests run in the project\n        /// </summary>\n        public int BacktestCount { get; set; }\n\n        /// <summary>\n        /// Number of parameters detected\n        /// </summary>\n        public int Parameters { get; set; }\n\n        /// <summary>\n        /// Project ID\n        /// </summary>\n        public int ProjectId { get; set; }\n    }\n\n    /// <summary>\n    /// Base class for backtest result object response\n    /// </summary>\n    public class BasicBacktest : RestResponse\n    {\n        /// <summary>\n        /// Backtest error message\n        /// </summary>\n        public string Error { get; set; }\n\n        /// <summary>\n        /// Backtest error stacktrace\n        /// </summary>\n        public string Stacktrace { get; set; }\n\n        /// <summary>\n        /// Assigned backtest Id\n        /// </summary>\n        public string BacktestId { get; set; }\n\n        /// <summary>\n        /// Status of the backtest\n        /// </summary>\n        public string Status { get; set; }\n\n        /// <summary>\n        /// Name of the backtest\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Backtest creation date and time\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime Created { get; set; }\n\n        /// <summary>\n        /// Progress of the backtest in percent 0-1.\n        /// </summary>\n        public decimal Progress { get; set; }\n\n        /// <summary>\n        /// Optimization task ID, if the backtest is part of an optimization\n        /// </summary>\n        public string OptimizationId { get; set; }\n\n        /// <summary>\n        /// Number of tradeable days\n        /// </summary>\n        public int TradeableDates { get; set; }\n\n        /// <summary>\n        /// Optimization parameters\n        /// </summary>\n        public ParameterSet ParameterSet { get; set; }\n\n        /// <summary>\n        /// Snapshot id of this backtest result\n        /// </summary>\n        public int SnapShotId { get; set; }\n    }\n\n    /// <summary>\n    /// Results object class. Results are exhaust from backtest or live algorithms running in LEAN\n    /// </summary>\n    public class Backtest : BasicBacktest\n    {\n        /// <summary>\n        /// Note on the backtest attached by the user\n        /// </summary>\n        public string Note { get; set; }\n\n        /// <summary>\n        /// Boolean true when the backtest is completed.\n        /// </summary>\n        public bool Completed { get; set; }\n\n        /// <summary>\n        /// Organization ID\n        /// </summary>\n        public string OrganizationId { get; set; }\n\n        /// <summary>\n        /// Rolling window detailed statistics.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public Dictionary<string, AlgorithmPerformance> RollingWindow { get; set; }\n\n        /// <summary>\n        /// Total algorithm performance statistics.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public AlgorithmPerformance TotalPerformance { get; set; }\n\n        /// <summary>\n        /// Charts updates for the live algorithm since the last result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, Chart> Charts { get; set; }\n\n        /// <summary>\n        /// Statistics information sent during the algorithm operations.\n        /// </summary>\n        /// <remarks>Intended for update mode -- send updates to the existing statistics in the result GUI. If statistic key does not exist in GUI, create it</remarks>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> Statistics { get; set; }\n\n        /// <summary>\n        /// Runtime banner/updating statistics in the title banner of the live algorithm GUI.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> RuntimeStatistics { get; set; }\n\n        /// <summary>\n        /// A power gauge for backtests, time and parameters to estimate the overfitting risk\n        /// </summary>\n        public ResearchGuide ResearchGuide { get; set; }\n\n        /// <summary>\n        /// The starting time of the backtest\n        /// </summary>\n        public DateTime? BacktestStart { get; set; }\n\n        /// <summary>\n        /// The ending time of the backtest\n        /// </summary>\n        public DateTime? BacktestEnd { get; set; }\n\n        /// <summary>\n        /// Indicates if the backtest has error during initialization\n        /// </summary>\n        public bool HasInitializeError { get; set; }\n\n        /// <summary>\n        /// The backtest node name\n        /// </summary>\n        public string NodeName { get; set; }\n\n        /// <summary>\n        /// The associated project id\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// End date of out of sample data\n        /// </summary>\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// Number of days of out of sample days\n        /// </summary>\n        public int? OutOfSampleDays { get; set; }\n    }\n\n    /// <summary>\n    /// Result object class for the List Backtest response from the API\n    /// </summary>\n    public class BacktestSummary : BasicBacktest\n    {\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk\n        /// </summary>\n        public decimal? SharpeRatio { get; set; }\n\n        /// <summary>\n        /// Algorithm \"Alpha\" statistic - abnormal returns over the risk free rate and the relationshio (beta) with the benchmark returns\n        /// </summary>\n        public decimal? Alpha { get; set; }\n\n        /// <summary>\n        /// Algorithm \"beta\" statistic - the covariance between the algorithm and benchmark performance, divided by benchmark's variance\n        /// </summary>\n        public decimal? Beta { get; set; }\n\n        /// <summary>\n        /// Annual compounded returns statistic based on the final-starting capital and years\n        /// </summary>\n        public decimal? CompoundingAnnualReturn { get; set; }\n\n        /// <summary>\n        /// Drawdown maximum percentage\n        /// </summary>\n        public decimal? Drawdown { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of losing trades to the total number of trades\n        /// </summary>\n        public decimal? LossRate { get; set; }\n\n        /// <summary>\n        /// Net profit percentage\n        /// </summary>\n        public decimal? NetProfit { get; set; }\n\n        /// <summary>\n        /// Number of parameters in the backtest\n        /// </summary>\n        public int? Parameters { get; set; }\n\n        /// <summary>\n        /// Price-to-sales ratio\n        /// </summary>\n        public decimal? Psr { get; set; }\n\n        /// <summary>\n        /// SecurityTypes present in the backtest\n        /// </summary>\n        public string? SecurityTypes { get; set; }\n\n        /// <summary>\n        /// Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk\n        /// </summary>\n        public decimal? SortinoRatio { get; set; }\n\n        /// <summary>\n        /// Number of trades in the backtest\n        /// </summary>\n        public int? Trades { get; set; }\n\n        /// <summary>\n        /// Treynor ratio statistic is a measurement of the returns earned in excess of that which could have been earned on an investment that has no diversifiable risk\n        /// </summary>\n        public decimal? TreynorRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of winning trades to the total number of trades\n        /// </summary>\n        public decimal? WinRate { get; set; }\n\n        /// <summary>\n        /// Collection of tags for the backtest\n        /// </summary>\n        public List<string> Tags { get; set; }\n    }\n\n    /// <summary>\n    /// Wrapper class for Backtest/* endpoints JSON response\n    /// Currently used by Backtest/Read and Backtest/Create\n    /// </summary>\n    public class BacktestResponseWrapper : RestResponse\n    {\n        /// <summary>\n        /// Backtest Object\n        /// </summary>\n        public Backtest Backtest { get; set; }\n\n        /// <summary>\n        /// Indicates if the backtest is run under debugging mode\n        /// </summary>\n        public bool Debugging { get; set; }\n    }\n\n    /// <summary>\n    /// Collection container for a list of backtests for a project\n    /// </summary>\n    public class BacktestList : RestResponse\n    {\n        /// <summary>\n        /// Collection of summarized backtest objects\n        /// </summary>\n        public List<Backtest> Backtests { get; set; }\n    }\n\n    /// <summary>\n    /// Collection container for a list of backtest summaries for a project\n    /// </summary>\n    public class BacktestSummaryList : RestResponse\n    {\n        /// <summary>\n        /// Collection of summarized backtest summary objects\n        /// </summary>\n        public List<BacktestSummary> Backtests { get; set; }\n\n        /// <summary>\n        /// Number of backtest summaries retrieved in the response\n        /// </summary>\n        public int Count { get; set; }\n    }\n\n    /// <summary>\n    /// Collection container for a list of backtest tags\n    /// </summary>\n    public class BacktestTags : RestResponse\n    {\n        /// <summary>\n        /// Collection of tags for a backtest\n        /// </summary>\n        public List<string> Tags { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/BacktestReport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Backtest Report Response wrapper\n    /// </summary>\n    public class BacktestReport : RestResponse\n    {\n        /// <summary>\n        /// HTML data of the report with embedded base64 images\n        /// </summary>\n        public string Report { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/BaseOptimization.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Util;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// BaseOptimization item from the QuantConnect.com API.\n    /// </summary>\n    public class BaseOptimization : RestResponse\n    {\n        /// <summary>\n        /// Optimization ID\n        /// </summary>\n        public string OptimizationId { get; set; }\n\n        /// <summary>\n        /// Project ID of the project the optimization belongs to\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Name of the optimization\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Status of the optimization\n        /// </summary>\n        [JsonConverter(typeof(StringEnumConverter), converterParameters: typeof(CamelCaseNamingStrategy))]\n        public OptimizationStatus Status { get; set; }\n\n        /// <summary>\n        /// Optimization node type\n        /// </summary>\n        /// <remarks><see cref=\"OptimizationNodes\"/></remarks>\n        public string NodeType { get; set; }\n\n        /// <summary>\n        /// Number of days of out of sample days\n        /// </summary>\n        public int OutOfSampleDays { get; set; }\n\n        /// <summary>\n        /// End date of out of sample data\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// Parameters used in this optimization\n        /// </summary>\n        public List<OptimizationParameter> Parameters { get; set; }\n\n        /// <summary>\n        /// Optimization statistical target\n        /// </summary>\n        public Target Criterion { get; set; }\n    }\n\n    /// <summary>\n    /// Optimization summary response for creating an optimization\n    /// </summary>\n    public class OptimizationSummary: BaseOptimization\n    {\n        /// <summary>\n        /// Date when this optimization was created\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime Created { get; set; }\n\n        /// <summary>\n        /// Price-sales ratio stastic\n        /// </summary>\n        public decimal? PSR { get; set; }\n\n        /// <summary>\n        /// Sharpe ratio statistic\n        /// </summary>\n        public decimal? SharpeRatio { get; set; }\n\n        /// <summary>\n        /// Number of trades\n        /// </summary>\n        public int? Trades { get; set; }\n\n        /// <summary>\n        /// ID of project, were this current project was originally cloned\n        /// </summary>\n        public int? CloneId { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Compile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Response from the compiler on a build event\n    /// </summary>\n    public class Compile : RestResponse\n    {\n        /// <summary>\n        /// Compile Id for a sucessful build\n        /// </summary>\n        public string CompileId { get; set; }\n\n        /// <summary>\n        /// True on successful compile\n        /// </summary>\n        [JsonConverter(typeof(StringEnumConverter))]\n        public CompileState State { get; set; }\n\n        /// <summary>\n        /// Logs of the compilation request\n        /// </summary>\n        public List<string> Logs { get; set; }\n\n        /// <summary>\n        /// Project Id we sent for compile\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Signature key of compilation\n        /// </summary>\n        public string Signature {  get; set; }\n\n        /// <summary>\n        /// Signature order of files to be compiled\n        /// </summary>\n        public List<string> SignatureOrder { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/CompileState.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// State of the compilation request\n    /// </summary>\n    public enum CompileState\n    {\n        /// <summary>\n        /// Compile waiting in the queue to be processed.\n        /// </summary>\n        InQueue,\n\n        /// <summary>\n        /// Compile was built successfully\n        /// </summary>\n        BuildSuccess,\n\n        /// <summary>\n        /// Build error, check logs for more information\n        /// </summary>\n        BuildError\n    }\n}"
  },
  {
    "path": "Common/Api/Data.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\n\n// Collection of response objects for Quantconnect Data/ endpoints\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Data/Read response wrapper, contains link to requested data\n    /// </summary>\n    public class DataLink : RestResponse\n    {\n        /// <summary>\n        /// Url to the data requested\n        /// </summary>\n        public string Link { get; set; }\n\n        /// <summary>\n        /// Remaining QCC balance on account after this transaction\n        /// </summary>\n        public double Balance { get; set; }\n\n        /// <summary>\n        /// QCC Cost for this data link\n        /// </summary>\n        public double Cost { get; set; }\n    }\n\n    /// <summary>\n    /// Data/List response wrapper for available data\n    /// </summary>\n    public class DataList : RestResponse\n    {\n        /// <summary>\n        /// List of all available data from this request\n        /// </summary>\n        [JsonProperty(PropertyName = \"objects\")]\n        public List<string> AvailableData { get; set; }\n    }\n\n    /// <summary>\n    /// Data/Prices response wrapper for prices by vendor\n    /// </summary>\n    public class DataPricesList : RestResponse\n    {\n        /// <summary>\n        /// Collection of prices objects\n        /// </summary>\n        public List<PriceEntry> Prices { get; set; }\n\n        /// <summary>\n        /// The Agreement URL for this Organization\n        /// </summary>\n        [JsonProperty(PropertyName = \"agreement\")]\n        public string AgreementUrl { get; set; }\n\n        /// <summary>\n        /// Get the price in QCC for a given data file\n        /// </summary>\n        /// <param name=\"path\">Lean data path of the file</param>\n        /// <returns>QCC price for data, -1 if no entry found</returns>\n        public int GetPrice(string path)\n        {\n            if (path == null)\n            {\n                return -1;\n            }\n\n            var entry = Prices.FirstOrDefault(x => x.RegEx.IsMatch(path));\n            return entry?.Price ?? -1;\n        }\n    }\n\n    /// <summary>\n    /// Prices entry for Data/Prices response\n    /// </summary>\n    public class PriceEntry\n    {\n        private Regex _regex;\n\n        /// <summary>\n        /// Vendor for this price\n        /// </summary>\n        [JsonProperty(PropertyName = \"vendorName\")]\n        public string Vendor { get; set; }\n\n        /// <summary>\n        /// Regex for this data price entry\n        /// Trims regex open, close, and multiline flag\n        /// because it won't match otherwise\n        /// </summary>\n        public Regex RegEx\n        {\n            get\n            {\n                if (_regex == null && RawRegEx != null)\n                {\n                    _regex = new Regex(RawRegEx.TrimStart('/').TrimEnd('m').TrimEnd('/'), RegexOptions.Compiled);\n                }\n                return _regex;\n            }\n        }\n\n        /// <summary>\n        /// RegEx directly from response\n        /// </summary>\n        [JsonProperty(PropertyName = \"regex\")]\n        public string RawRegEx { get; set; }\n\n        /// <summary>\n        /// The price for this entry in QCC\n        /// </summary>\n        public int? Price { get; set; }\n\n        /// <summary>\n        /// The type associated to this price entry if any\n        /// </summary>\n        public string Type { get; set; }\n\n        /// <summary>\n        /// True if the user is subscribed\n        /// </summary>\n        public bool? Subscribed { get; set; }\n\n        /// <summary>\n        /// The associated product id\n        /// </summary>\n        public int ProductId { get; set; }\n\n        /// <summary>\n        /// The associated data paths\n        /// </summary>\n        public HashSet<string> Paths { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Estimate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Estimate response packet from the QuantConnect.com API.\n    /// </summary>\n    public class Estimate: StringRepresentation\n    {\n        /// <summary>\n        /// Estimate id\n        /// </summary>\n        public string EstimateId { get; set; }\n\n        /// <summary>\n        /// Estimate time in seconds\n        /// </summary>\n        public int Time { get; set; }\n\n        /// <summary>\n        /// Estimate balance in QCC\n        /// </summary>\n        public int Balance { get; set; }\n    }\n\n    /// <summary>\n    /// Wrapper class for Optimizations/* endpoints JSON response\n    /// Currently used by Optimizations/Estimate\n    /// </summary>\n    public class EstimateResponseWrapper : RestResponse\n    {\n        /// <summary>\n        /// Estimate object\n        /// </summary>\n        public Estimate Estimate { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/InsightResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Class containing insights and the number of insights of the live algorithm in the request criteria\n    /// </summary>\n    public class InsightResponse: RestResponse\n    {\n        /// <summary>\n        /// Collection of insights\n        /// </summary>\n        public List<Insight> Insights { get; set; }\n\n        /// <summary>\n        /// Total number of returned insights\n        /// </summary>\n        public int Length { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/LiveAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Class representing the REST response from QC API when creating or reading a live algorithm\n    /// </summary>\n    public class BaseLiveAlgorithm : RestResponse\n    {\n        /// <summary>\n        /// Project id for the live instance\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Unique live algorithm deployment identifier (similar to a backtest id).\n        /// </summary>\n        public string DeployId { get; set; }\n    }\n\n    /// <summary>\n    /// Class representing the REST response from QC API when creating a live algorithm\n    /// </summary>\n    public class CreateLiveAlgorithmResponse : BaseLiveAlgorithm\n    {\n        /// <summary>\n        /// The version of the Lean used to run the algorithm\n        /// </summary>\n        public int VersionId { get; set; }\n\n        /// <summary>\n        /// Id of the node that will run the algorithm\n        /// </summary>\n        public string Source { get; set; }\n\n        /// <summary>\n        /// HTTP status response code\n        /// </summary>\n        public string ResponseCode { get; set; }\n    }\n\n    /// <summary>\n    /// Response from List Live Algorithms request to QuantConnect Rest API.\n    /// </summary>\n    public class LiveAlgorithmSummary : BaseLiveAlgorithm\n    {\n        /// <summary>\n        /// Algorithm status: running, stopped or runtime error.\n        /// </summary>\n        public AlgorithmStatus Status { get; set; }\n\n        /// <summary>\n        /// Datetime the algorithm was launched in UTC.\n        /// </summary>\n        public DateTime Launched { get; set; }\n\n        /// <summary>\n        /// Datetime the algorithm was stopped in UTC, null if its still running.\n        /// </summary>\n        public DateTime? Stopped { get; set; }\n\n        /// <summary>\n        /// Brokerage\n        /// </summary>\n        public string Brokerage { get; set; }\n\n        /// <summary>\n        /// Chart we're subscribed to\n        /// </summary>\n        /// <remarks>\n        /// Data limitations mean we can only stream one chart at a time to the consumer. See which chart you're watching here.\n        /// </remarks>\n        public string Subscription { get; set; }\n\n        /// <summary>\n        /// Live algorithm error message from a crash or algorithm runtime error.\n        /// </summary>\n        public string Error { get; set; }\n    }\n\n    /// <summary>\n    /// List of the live algorithms running which match the requested status\n    /// </summary>\n    public class LiveList : RestResponse\n    {\n        /// <summary>\n        /// Algorithm list matching the requested status.\n        /// </summary>\n        [JsonProperty(PropertyName = \"live\")]\n        public List<LiveAlgorithmSummary> Algorithms { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/LiveAlgorithmResults.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing QuantConnect.Packets;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Details a live algorithm from the \"live/read\" Api endpoint\n    /// </summary>\n    public class LiveAlgorithmResults : RestResponse\n    {\n        /// <summary>\n        /// Error message\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Indicates the status of the algorihtm, i.e. 'Running', 'Stopped'\n        /// </summary>\n        public string Status { get; set; }\n\n        /// <summary>\n        /// Algorithm deployment ID\n        /// </summary>\n        public string DeployId { get; set; }\n\n        /// <summary>\n        /// The snapshot project ID for cloning the live development's source code.\n        /// </summary>\n        public int CloneId { get; set; }\n\n        /// <summary>\n        /// Date the live algorithm was launched\n        /// </summary>\n        public DateTime Launched { get; set; }\n\n        /// <summary>\n        /// Date the live algorithm was stopped\n        /// </summary>\n        public DateTime? Stopped { get; set; }\n\n        /// <summary>\n        /// Brokerage used in the live algorithm\n        /// </summary>\n        public string Brokerage { get; set; }\n\n        /// <summary>\n        /// Security types present in the live algorithm\n        /// </summary>\n        public string SecurityTypes { get; set; }\n\n        /// <summary>\n        /// Name of the project the live algorithm is in\n        /// </summary>\n        public string ProjectName { get; set; }\n\n        /// <summary>\n        /// Name of the data center where the algorithm is physically located.\n        /// </summary>\n        public string Datacenter { get; set; }\n\n        /// <summary>\n        /// Indicates if the algorithm is being live shared\n        /// </summary>\n        public bool Public { get; set; }\n\n        /// <summary>\n        /// Files present in the project in which the algorithm is\n        /// </summary>\n        public List<ProjectFile> Files { get; set; }\n\n        /// <summary>\n        /// Runtime banner/updating statistics in the title banner of the live algorithm GUI.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> RuntimeStatistics { get; set; }\n\n        /// <summary>\n        /// Charts updates for the live algorithm since the last result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, Chart> Charts { get; set; }\n    }\n\n    /// <summary>\n    /// Holds information about the state and operation of the live running algorithm\n    /// </summary>\n    public class LiveResultsData\n    {\n        /// <summary>\n        /// Results version\n        /// </summary>\n        public int Version { get; set; }\n\n        /// <summary>\n        /// Temporal resolution of the results returned from the Api\n        /// </summary>\n        [JsonProperty(PropertyName = \"resolution\"), JsonConverter(typeof(StringEnumConverter))]\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// Class to represent the data groups results return from the Api\n        /// </summary>\n        [JsonProperty(PropertyName = \"results\")]\n        public LiveResult Results { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/LiveAlgorithmResultsJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Custom JsonConverter for LiveResults data for live algorithms\n    /// </summary>\n    public class LiveAlgorithmResultsJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException(\"The LiveAlgorithmResultsJsonConverter does not implement a WriteJson method.\");\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(LiveAlgorithmResults).IsAssignableFrom(objectType);\n        }\n\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            // We don't deserialize the json object directly since it contains properties such as `files` and `charts`\n            // that need to be deserialized in a different way\n            var liveAlgoResults = new LiveAlgorithmResults\n            {\n                Message = jObject[\"message\"].Value<string>(),\n                Status = jObject[\"status\"].Value<string>(),\n                DeployId = jObject[\"deployId\"].Value<string>(),\n                CloneId = jObject[\"cloneId\"].Value<int>(),\n                Launched = jObject[\"launched\"].Value<DateTime>(),\n                Stopped = jObject[\"stopped\"].Value<DateTime?>(),\n                Brokerage = jObject[\"brokerage\"].Value<string>(),\n                SecurityTypes = jObject[\"securityTypes\"].Value<string>(),\n                ProjectName = jObject[\"projectName\"].Value<string>(),\n                Datacenter = jObject[\"datacenter\"].Value<string>(),\n                Public = jObject[\"public\"].Value<bool>(),\n                Success = jObject[\"success\"].Value<bool>()\n            };\n\n            if (!liveAlgoResults.Success)\n            {\n                // Either there was an error in the running algorithm or the algorithm hasn't started\n                liveAlgoResults.Errors = jObject.Last.Children().Select(error => error.ToString()).ToList();\n                return liveAlgoResults;\n            }\n\n            // Deserialize charting data\n            var chartDictionary = new Dictionary<string, Chart>();\n            var charts = jObject[\"charts\"] ?? jObject[\"Charts\"];\n            if (charts != null)\n            {\n                var stringCharts = jObject[\"charts\"]?.ToString() ?? jObject[\"Charts\"].ToString();\n                if(!string.IsNullOrEmpty(stringCharts))\n                {\n                    chartDictionary = JsonConvert.DeserializeObject<Dictionary<string, Chart>>(stringCharts);\n                }\n            }\n\n            // Deserialize files data\n            var projectFiles = new List<ProjectFile>();\n            var files = jObject[\"files\"] ?? jObject[\"Files\"];\n            if (files != null)\n            {\n                var stringFiles = jObject[\"files\"]?.ToString() ?? jObject[\"Files\"].ToString();\n                if (!string.IsNullOrEmpty(stringFiles))\n                {\n                    projectFiles = JsonConvert.DeserializeObject<List<ProjectFile>>(stringFiles);\n                }\n            }\n\n            liveAlgoResults.Charts = chartDictionary;\n            liveAlgoResults.Files = projectFiles;\n\n            return liveAlgoResults;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/LiveAlgorithmSettings.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Helper class to put BaseLiveAlgorithmSettings in proper format.\n    /// </summary>\n    public class LiveAlgorithmApiSettingsWrapper\n    {\n        /// <summary>\n        /// Constructor for LiveAlgorithmApiSettingsWrapper\n        /// </summary>\n        /// <param name=\"projectId\">Id of project from QuantConnect</param>\n        /// <param name=\"compileId\">Id of compilation of project from QuantConnect</param>\n        /// <param name=\"nodeId\">Server type to run live Algorithm</param>\n        /// <param name=\"settings\">Dictionary with brokerage specific settings. Each brokerage requires certain specific credentials\n        ///                         in order to process the given orders. Each key in this dictionary represents a required field/credential\n        ///                         to provide to the brokerage API and its value represents the value of that field. For example: \"brokerageSettings: {\n        ///                         \"id\": \"Binance\", \"binance-api-secret\": \"123ABC\", \"binance-api-key\": \"ABC123\"}. It is worth saying,\n        ///                         that this dictionary must always contain an entry whose key is \"id\" and its value is the name of the brokerage\n        ///                         (see <see cref=\"Brokerages.BrokerageName\"/>)</param>\n        /// <param name=\"version\">The version identifier</param>\n        /// <param name=\"dataProviders\">Dictionary with data providers credentials. Each data provider requires certain credentials\n        ///                         in order to retrieve data from their API. Each key in this dictionary describes a data provider name\n        ///                         and its corresponding value is another dictionary with the required key-value pairs of credential\n        ///                         names and values. For example: \"dataProviders: {InteractiveBrokersBrokerage : { \"id\": 12345, \"environement\" : \"paper\",\n        ///                         \"username\": \"testUsername\", \"password\": \"testPassword\"}}\"</param>\n        /// <param name=\"parameters\">Dictionary to specify the parameters for the live algorithm</param>\n        /// <param name=\"notification\">Dictionary with the lists of events and targets</param>\n        public LiveAlgorithmApiSettingsWrapper(\n            int projectId,\n            string compileId,\n            string nodeId,\n            Dictionary<string, object> settings,\n            string version = \"-1\",\n            Dictionary<string, object> dataProviders = null,\n            Dictionary<string, string> parameters = null,\n            Dictionary<string, List<string>> notification = null)\n        {\n            VersionId = version;\n            ProjectId = projectId;\n            CompileId = compileId;\n            NodeId = nodeId;\n            Brokerage = settings;\n\n            var quantConnectDataProvider = new Dictionary<string, string>\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n            };\n\n            DataProviders = dataProviders ?? new Dictionary<string, object>()\n            {\n                { \"QuantConnectBrokerage\", quantConnectDataProvider },\n            };\n            Signature = CompileId.Split(\"-\").LastOrDefault();\n            Parameters = parameters ?? new Dictionary<string, string>();\n            Notification = notification ?? new Dictionary<string, List<string>>();\n            AutomaticRedeploy = false;\n        }\n\n        /// <summary>\n        /// -1 is master\n        /// </summary>\n        [JsonProperty(PropertyName = \"versionId\")]\n        public string VersionId { get; set; }\n\n        /// <summary>\n        /// Project id for the live instance\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectId\")]\n        public int ProjectId { get; private set; }\n\n        /// <summary>\n        /// Compile Id for the live algorithm\n        /// </summary>\n        [JsonProperty(PropertyName = \"compileId\")]\n        public string CompileId { get; private set; }\n\n        /// <summary>\n        /// Id of the node being used to run live algorithm\n        /// </summary>\n        [JsonProperty(PropertyName = \"nodeId\")]\n        public string NodeId { get; private set; }\n\n        /// <summary>\n        /// Signature of the live algorithm\n        /// </summary>\n        [JsonProperty(PropertyName = \"signature\")]\n        public string Signature { get; private set; }\n\n        /// <summary>\n        /// True to enable Automatic Re-Deploy of the live algorithm,\n        /// false otherwise\n        /// </summary>\n        [JsonProperty(PropertyName = \"automaticRedeploy\")]\n        public bool AutomaticRedeploy { get; private set; }\n\n        /// <summary>\n        /// The API expects the settings as part of a brokerage object\n        /// </summary>\n        [JsonProperty(PropertyName = \"brokerage\")]\n        public Dictionary<string, object> Brokerage { get; private set; }\n\n        /// <summary>\n        /// Dictionary with the data providers and their corresponding credentials\n        /// </summary>\n        [JsonProperty(PropertyName = \"dataProviders\")]\n        public Dictionary<string, object> DataProviders { get; private set; }\n\n        /// <summary>\n        /// Dictionary with the parameters to be used in the live algorithm\n        /// </summary>\n        [JsonProperty(PropertyName = \"parameters\")]\n        public Dictionary<string, string> Parameters { get; private set; }\n\n        /// <summary>\n        /// Dictionary with the lists of events and targets\n        /// </summary>\n        [JsonProperty(PropertyName = \"notification\")]\n        public Dictionary<string, List<string>> Notification { get; private set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/LiveLog.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Logs from a live algorithm\n    /// </summary>\n    public class LiveLog : RestResponse\n    {\n        /// <summary>\n        /// List of logs from the live algorithm\n        /// </summary>\n        public List<string> Logs { get; set; }\n\n        /// <summary>\n        /// Total amount of rows in the logs\n        /// </summary>\n        public int Length { get; set; }\n\n        /// <summary>\n        /// Amount of log rows before the current deployment\n        /// </summary>\n        public int DeploymentOffset { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Nodes.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Node class built for API endpoints nodes/read and nodes/create.\n    /// Converts JSON properties from API response into data members for the class.\n    /// Contains all relevant information on a Node to interact through API endpoints.\n    /// </summary>\n    public class Node\n    {\n        /// <summary>\n        /// The nodes cpu clock speed in GHz.\n        /// </summary>\n        [JsonProperty(PropertyName = \"speed\")]\n        public decimal Speed { get; set; }\n\n        /// <summary>\n        /// The monthly and yearly prices of the node in US dollars,\n        /// see <see cref=\"NodePrices\"/> for type.\n        /// </summary>\n        [JsonProperty(PropertyName = \"price\")]\n        public NodePrices Prices { get; set; }\n\n        /// <summary>\n        /// CPU core count of node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"cpu\")]\n        public int CpuCount { get; set; }\n\n        /// <summary>\n        /// Indicate if the node has GPU (1) or not (0)\n        /// </summary>\n        [JsonProperty(PropertyName = \"hasGpu\")]\n        public int HasGPU { get; set; }\n\n        /// <summary>\n        /// Size of RAM in Gigabytes.\n        /// </summary>\n        [JsonProperty(PropertyName = \"ram\")]\n        public decimal Ram { get; set; }\n\n        /// <summary>\n        /// Name of the node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Node type identifier for configuration.\n        /// </summary>\n        [JsonProperty(PropertyName = \"sku\")]\n        public string SKU { get; set; }\n\n        /// <summary>\n        /// Description of the node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"description\")]\n        public string Description { get; set; }\n\n        /// <summary>\n        /// User currently using the node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"usedBy\")]\n        public string UsedBy { get; set; }\n\n        /// <summary>\n        /// URL of the user using the node\n        /// </summary>\n        [JsonProperty(PropertyName = \"userProfile\")]\n        public string UserProfile { get; set; }\n\n        /// <summary>\n        /// Project the node is being used for.\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectName\")]\n        public string ProjectName { get; set; }\n\n        /// <summary>\n        /// Id of the project the node is being used for.\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectId\")]\n        public int? ProjectId { get; set; }\n\n        /// <summary>\n        /// Indicates if the node is currently busy.\n        /// </summary>\n        [JsonProperty(PropertyName = \"busy\")]\n        public bool Busy { get; set; }\n\n        /// <summary>\n        /// Full ID of node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Maximum number of assets recommended for this node.\n        /// </summary>\n        [JsonProperty(PropertyName = \"assets\")]\n        public int Assets { get; set; }\n\n        /// <summary>\n        /// Node host.\n        /// </summary>\n        [JsonProperty(PropertyName = \"host\")]\n        public string Host { get; set; }\n\n        /// <summary>\n        /// Indicate if this is the active node. The project will use this node if it's not busy.\n        /// </summary>\n        [JsonProperty(PropertyName = \"active\")]\n        public bool Active { get; set; }\n    }\n\n    /// <summary>\n    /// Collection of <see cref=\"Node\"/> objects for each target environment.\n    /// </summary>\n    public class NodeList : RestResponse\n    {\n        /// <summary>\n        /// Collection of backtest nodes\n        /// </summary>\n        [JsonProperty(PropertyName = \"backtest\")]\n        public List<Node> BacktestNodes { get; set; }\n\n        /// <summary>\n        /// Collection of research nodes\n        /// </summary>\n        [JsonProperty(PropertyName = \"research\")]\n        public List<Node> ResearchNodes { get; set; }\n\n        /// <summary>\n        /// Collection of live nodes\n        /// </summary>\n        [JsonProperty(PropertyName = \"live\")]\n        public List<Node> LiveNodes { get; set; }\n    }\n\n    /// <summary>\n    /// Rest api response wrapper for node/create, reads in the nodes information into a\n    /// node object\n    /// </summary>\n    public class CreatedNode : RestResponse\n    {\n        /// <summary>\n        /// The created node from node/create\n        /// </summary>\n        [JsonProperty(\"node\")]\n        public Node Node { get; set; }\n    }\n\n    /// <summary>\n    /// Class for generating a SKU for a node with a given configuration\n    /// Every SKU is made up of 3 variables:\n    /// - Target environment (L for live, B for Backtest, R for Research)\n    /// - CPU core count\n    /// - Dedicated RAM (GB)\n    /// </summary>\n    public class SKU\n    {\n        /// <summary>\n        /// The number of CPU cores in the node\n        /// </summary>\n        public int Cores { get; set; }\n\n        /// <summary>\n        /// Size of RAM in GB of the Node\n        /// </summary>\n        public int Memory { get; set; }\n\n        /// <summary>\n        /// Target environment for the node\n        /// </summary>\n        public NodeType Target { get; set; }\n\n        /// <summary>\n        /// Constructs a SKU object out of the provided node configuration\n        /// </summary>\n        /// <param name=\"cores\">Number of cores</param>\n        /// <param name=\"memory\">Size of RAM in GBs</param>\n        /// <param name=\"target\">Target Environment Live/Backtest/Research</param>\n        public SKU(int cores, int memory, NodeType target)\n        {\n            Cores = cores;\n            Memory = memory;\n            Target = target;\n        }\n\n        /// <summary>\n        /// Generates the SKU string for API calls based on the specifications of the node\n        /// </summary>\n        /// <returns>String representation of the SKU</returns>\n        public override string ToString()\n        {\n            string result = \"\";\n\n            switch (Target)\n            {\n                case NodeType.Backtest:\n                    result += \"B\";\n                    break;\n                case NodeType.Research:\n                    result += \"R\";\n                    break;\n                case NodeType.Live:\n                    result += \"L\";\n                    break;\n            }\n\n            if (Cores == 0)\n            {\n                result += \"-MICRO\";\n            }\n            else\n            {\n                result += Cores + \"-\" + Memory;\n            }\n\n            return result;\n        }\n    }\n\n    /// <summary>\n    /// NodeTypes enum for all possible options of target environments\n    /// Used in conjuction with SKU class as a NodeType is a required parameter for SKU\n    /// </summary>\n    public enum NodeType\n    {\n        /// <summary>\n        /// A node for running backtests (0)\n        /// </summary>\n        Backtest,\n\n        /// <summary>\n        /// A node for running research (1)\n        /// </summary>\n        Research,\n\n        /// <summary>\n        /// A node for live trading (2)\n        /// </summary>\n        Live\n    }\n\n    /// <summary>\n    /// Class for deserializing node prices from node object\n    /// </summary>\n    public class NodePrices\n    {\n        /// <summary>\n        /// The monthly price of the node in US dollars\n        /// </summary>\n        [JsonProperty(PropertyName = \"monthly\")]\n        public int Monthly { get; set; }\n\n        /// <summary>\n        /// The yearly prices of the node in US dollars\n        /// </summary>\n        [JsonProperty(PropertyName = \"yearly\")]\n        public int Yearly { get; set; }\n    }\n\n    /// <summary>\n    /// Supported optimization nodes\n    /// </summary>\n    public static class OptimizationNodes\n    {\n        /// <summary>\n        /// 2 CPUs 8 GB ram\n        /// </summary>\n        public static string O2_8 => \"O2-8\";\n\n        /// <summary>\n        /// 4 CPUs 12 GB ram\n        /// </summary>\n        public static string O4_12 => \"O4-12\";\n\n        /// <summary>\n        /// 8 CPUs 16 GB ram\n        /// </summary>\n        public static string O8_16 => \"O8-16\";\n    }\n}\n"
  },
  {
    "path": "Common/Api/ObjectStoreResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing System;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Response received when fetching Object Store\n    /// </summary>\n    public class GetObjectStoreResponse : RestResponse\n    {\n        /// <summary>\n        /// Job ID which can be used for querying state or packaging\n        /// </summary>\n        [JsonProperty(\"jobId\")]\n        public string JobId { get; set; }\n\n        /// <summary>\n        /// The URL to download the object. This can also be null\n        /// </summary>\n        [JsonProperty(\"url\")]\n        public string Url { get; set; }\n    }\n\n    /// <summary>\n    /// Class contining basic store properties present in the REST response from QC API\n    /// </summary>\n    public class BasicObjectStore\n    {\n        /// <summary>\n        /// Object store key\n        /// </summary>\n        [JsonProperty(PropertyName = \"key\")]\n        public string Key {  get; set; }\n\n        /// <summary>\n        /// Last time it was modified\n        /// </summary>\n        [JsonProperty(PropertyName = \"modified\")]\n        public DateTime? Modified { get; set; }\n\n        /// <summary>\n        /// MIME type\n        /// </summary>\n        [JsonProperty(PropertyName = \"mime\")]\n        public string Mime { get; set; }\n\n        /// <summary>\n        /// File size\n        /// </summary>\n        [JsonProperty(PropertyName = \"size\")]\n        public decimal? Size { get; set; }\n    }\n\n    /// <summary>\n    /// Summary information of the Object Store\n    /// </summary>\n    public class SummaryObjectStore: BasicObjectStore\n    {\n        /// <summary>\n        /// File or folder name\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// True if it is a folder, false otherwise\n        /// </summary>\n        [JsonProperty(PropertyName = \"isFolder\")]\n        public bool IsFolder { get; set; }\n    }\n\n    /// <summary>\n    /// Object Store file properties\n    /// </summary>\n    public class PropertiesObjectStore: BasicObjectStore\n    {\n        /// <summary>\n        /// Date this object was created\n        /// </summary>\n        [JsonProperty(PropertyName = \"created\")]\n        public DateTime Created { get; set; }\n\n        /// <summary>\n        /// MD5 (hashing algorithm) hash authentication code\n        /// </summary>\n        [JsonProperty(PropertyName = \"md5\")]\n        public string Md5 { get; set; }\n\n        /// <summary>\n        /// Preview of the Object Store file content\n        /// </summary>\n        [JsonProperty(PropertyName = \"preview\")]\n        public string Preview { get; set; }\n    }\n\n    /// <summary>\n    /// Response received containing a list of stored objects metadata, as well as the total size of all of them.\n    /// </summary>\n    public class ListObjectStoreResponse : RestResponse\n    {\n        /// <summary>\n        /// Path to the files in the Object Store\n        /// </summary>\n        [JsonProperty(PropertyName = \"path\")]\n        public string Path { get; set; }\n\n        /// <summary>\n        /// List of objects stored\n        /// </summary>\n        [JsonProperty(PropertyName = \"objects\")]\n        public List<SummaryObjectStore> Objects { get; set; }\n\n        /// <summary>\n        /// Size of all objects stored in bytes\n        /// </summary>\n        [JsonProperty(PropertyName = \"objectStorageUsed\")]\n        public long ObjectStorageUsed { get; set; }\n\n        /// <summary>\n        /// Size of all the objects stored in human-readable format\n        /// </summary>\n        [JsonProperty(PropertyName = \"objectStorageUsedHuman\")]\n        public string ObjectStorageUsedHuman { get; set; }\n    }\n\n    /// <summary>\n    /// Response received containing the properties of the requested Object Store\n    /// </summary>\n    public class PropertiesObjectStoreResponse : RestResponse\n    {\n        /// <summary>\n        /// Object Store properties\n        /// </summary>\n        [JsonProperty(PropertyName = \"metadata\")]\n        public PropertiesObjectStore Properties { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Optimization.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Optimization response packet from the QuantConnect.com API.\n    /// </summary>\n    public class Optimization : BaseOptimization\n    {\n        /// <summary>\n        /// Snapshot ID of this optimization\n        /// </summary>\n        public int? SnapshotId { get; set; }\n\n        /// <summary>\n        /// Statistic to be optimized\n        /// </summary>\n        public string OptimizationTarget { get; set; }\n\n        /// <summary>\n        /// List with grid charts representing the grid layout\n        /// </summary>\n        public List<GridChart> GridLayout { get; set; }\n\n        /// <summary>\n        /// Runtime banner/updating statistics for the optimization\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> RuntimeStatistics { get; set; }\n\n        /// <summary>\n        /// Optimization constraints\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IReadOnlyList<Constraint> Constraints { get; set; }\n\n        /// <summary>\n        /// Number of parallel nodes for optimization\n        /// </summary>\n        public int ParallelNodes { get; set; }\n\n        /// <summary>\n        /// Optimization constraints\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, OptimizationBacktest> Backtests { get; set; }\n\n        /// <summary>\n        /// Optimization strategy\n        /// </summary>\n        public string Strategy { get; set; }\n\n        /// <summary>\n        /// Optimization requested date and time\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime Requested { get; set; }\n    }\n\n    /// <summary>\n    /// Wrapper class for Optimizations/Read endpoint JSON response\n    /// </summary>\n    public class OptimizationResponseWrapper : RestResponse\n    {\n        /// <summary>\n        /// Optimization object\n        /// </summary>\n        public Optimization Optimization { get; set; }\n    }\n\n    /// <summary>\n    /// Collection container for a list of summarized optimizations for a project\n    /// </summary>\n    public class OptimizationList : RestResponse\n    {\n        /// <summary>\n        /// Collection of summarized optimization objects\n        /// </summary>\n        public List<OptimizationSummary> Optimizations { get; set; }\n\n        /// <summary>\n        /// The optimization count\n        /// </summary>\n        public int Count => Optimizations?.Count ?? 0;\n    }\n}\n"
  },
  {
    "path": "Common/Api/OptimizationBacktest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// OptimizationBacktest object from the QuantConnect.com API.\n    /// </summary>\n    [JsonConverter(typeof(OptimizationBacktestJsonConverter))]\n    public class OptimizationBacktest\n    {\n        /// <summary>\n        /// Progress of the backtest as a percentage from 0-1 based on the days lapsed from start-finish.\n        /// </summary>\n        public decimal Progress { get; set; }\n\n        /// <summary>\n        /// The backtest name\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// The backtest host name\n        /// </summary>\n        public string HostName { get; set; }\n\n        /// <summary>\n        /// The backtest id\n        /// </summary>\n        public string BacktestId { get; }\n\n        /// <summary>\n        /// Represent a combination as key value of parameters, i.e. order doesn't matter\n        /// </summary>\n        public ParameterSet ParameterSet { get; }\n\n        /// <summary>\n        /// The backtest statistics results\n        /// </summary>\n        public IDictionary<string, string> Statistics { get; set; }\n\n        /// <summary>\n        /// The backtest equity chart series\n        /// </summary>\n        public CandlestickSeries Equity { get; set; }\n\n        /// <summary>\n        /// The exit code of this backtest\n        /// </summary>\n        public int ExitCode { get; set; }\n\n        /// <summary>\n        /// Backtest maximum end date\n        /// </summary>\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// The backtest out of sample day count\n        /// </summary>\n        public int OutOfSampleDays { get; set; }\n\n        /// <summary>\n        /// The backtest start date\n        /// </summary>\n        public DateTime StartDate { get; set; }\n\n        /// <summary>\n        /// The backtest end date\n        /// </summary>\n        public DateTime EndDate { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"parameterSet\">The parameter set</param>\n        /// <param name=\"backtestId\">The backtest id if any</param>\n        /// <param name=\"name\">The backtest name</param>\n        public OptimizationBacktest(ParameterSet parameterSet, string backtestId, string name)\n        {\n            ParameterSet = parameterSet;\n            BacktestId = backtestId;\n            Name = name;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/OptimizationBacktestJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Json converter for <see cref=\"OptimizationBacktest\"/> which creates a light weight easy to consume serialized version\n    /// </summary>\n    public class OptimizationBacktestJsonConverter : JsonConverter\n    {\n        private static Dictionary<string, int> StatisticsIndices = new()\n        {\n            { PerformanceMetrics.Alpha, 0 },\n            { PerformanceMetrics.AnnualStandardDeviation, 1 },\n            { PerformanceMetrics.AnnualVariance, 2 },\n            { PerformanceMetrics.AverageLoss, 3 },\n            { PerformanceMetrics.AverageWin, 4 },\n            { PerformanceMetrics.Beta, 5 },\n            { PerformanceMetrics.CompoundingAnnualReturn, 6 },\n            { PerformanceMetrics.Drawdown, 7 },\n            { PerformanceMetrics.EstimatedStrategyCapacity, 8 },\n            { PerformanceMetrics.Expectancy, 9 },\n            { PerformanceMetrics.InformationRatio, 10 },\n            { PerformanceMetrics.LossRate, 11 },\n            { PerformanceMetrics.NetProfit, 12 },\n            { PerformanceMetrics.ProbabilisticSharpeRatio, 13 },\n            { PerformanceMetrics.ProfitLossRatio, 14 },\n            { PerformanceMetrics.SharpeRatio, 15 },\n            { PerformanceMetrics.TotalFees, 16 },\n            { PerformanceMetrics.TotalOrders, 17 },\n            { PerformanceMetrics.TrackingError, 18 },\n            { PerformanceMetrics.TreynorRatio, 19 },\n            { PerformanceMetrics.WinRate, 20 },\n            { PerformanceMetrics.SortinoRatio, 21 },\n            { PerformanceMetrics.StartEquity, 22 },\n            { PerformanceMetrics.EndEquity, 23 },\n            { PerformanceMetrics.DrawdownRecovery, 24 },\n        };\n\n        private static string[] StatisticNames { get; } = StatisticsIndices\n            .OrderBy(kvp => kvp.Value)\n            .Select(kvp => kvp.Key)\n            .ToArray();\n\n        // Only 21 Lean statistics where supported when the serialized statistics where a json array\n        private static int ArrayStatisticsCount = 21;\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(OptimizationBacktest);\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var optimizationBacktest = value as OptimizationBacktest;\n            if (ReferenceEquals(optimizationBacktest, null)) return;\n\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrEmpty(optimizationBacktest.Name))\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(optimizationBacktest.Name);\n            }\n\n            if (!string.IsNullOrEmpty(optimizationBacktest.BacktestId))\n            {\n                writer.WritePropertyName(\"id\");\n                writer.WriteValue(optimizationBacktest.BacktestId);\n\n                writer.WritePropertyName(\"progress\");\n                writer.WriteValue(optimizationBacktest.Progress);\n\n                writer.WritePropertyName(\"exitCode\");\n                writer.WriteValue(optimizationBacktest.ExitCode);\n            }\n\n            if (optimizationBacktest.StartDate != default)\n            {\n                writer.WritePropertyName(\"startDate\");\n                writer.WriteValue(optimizationBacktest.StartDate.ToStringInvariant(DateFormat.ISOShort));\n            }\n\n            if (optimizationBacktest.EndDate != default)\n            {\n                writer.WritePropertyName(\"endDate\");\n                writer.WriteValue(optimizationBacktest.EndDate.ToStringInvariant(DateFormat.ISOShort));\n            }\n\n            if (optimizationBacktest.OutOfSampleMaxEndDate != null)\n            {\n                writer.WritePropertyName(\"outOfSampleMaxEndDate\");\n                writer.WriteValue(optimizationBacktest.OutOfSampleMaxEndDate.ToStringInvariant(DateFormat.ISOShort));\n\n                writer.WritePropertyName(\"outOfSampleDays\");\n                writer.WriteValue(optimizationBacktest.OutOfSampleDays);\n            }\n\n            if (!optimizationBacktest.Statistics.IsNullOrEmpty())\n            {\n                writer.WritePropertyName(\"statistics\");\n                writer.WriteStartObject();\n\n                var customStatisticsNames = new HashSet<string>();\n\n                foreach (var (name, statisticValue, index) in optimizationBacktest.Statistics\n                    .Select(kvp => (Name: kvp.Key, kvp.Value, Index: StatisticsIndices.TryGetValue(kvp.Key, out var index) ? index : int.MaxValue))\n                    .OrderBy(t => t.Index)\n                    .ThenByDescending(t => t.Name))\n                {\n                    var statistic = statisticValue.Replace(\"%\", string.Empty, StringComparison.InvariantCulture);\n                    if (Currencies.TryParse(statistic, out var result))\n                    {\n                        writer.WritePropertyName(index < StatisticsIndices.Count ? index.ToStringInvariant() : name);\n                        writer.WriteValue(result);\n                    }\n                }\n                writer.WriteEndObject();\n            }\n\n            if (optimizationBacktest.ParameterSet != null)\n            {\n                writer.WritePropertyName(\"parameterSet\");\n                serializer.Serialize(writer, optimizationBacktest.ParameterSet.Value);\n            }\n\n            if (optimizationBacktest.Equity != null)\n            {\n                writer.WritePropertyName(\"equity\");\n\n                var equity = JsonConvert.SerializeObject(optimizationBacktest.Equity.Values);\n                writer.WriteRawValue(equity);\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            var name = jObject[\"name\"].Value<string>();\n            var hostName = jObject[\"hostName\"]?.Value<string>();\n            var backtestId = jObject[\"id\"].Value<string>();\n            var progress = jObject[\"progress\"].Value<decimal>();\n            var exitCode = jObject[\"exitCode\"].Value<int>();\n\n            var outOfSampleDays = jObject[\"outOfSampleDays\"]?.Value<int>() ?? default;\n            var startDate = jObject[\"startDate\"]?.Value<DateTime?>() ?? default;\n            var endDate = jObject[\"endDate\"]?.Value<DateTime?>() ?? default;\n            var outOfSampleMaxEndDate = jObject[\"outOfSampleMaxEndDate\"]?.Value<DateTime>();\n\n            var jStatistics = jObject[\"statistics\"];\n            Dictionary<string, string> statistics = default;\n            if (jStatistics != null)\n            {\n                if (jStatistics.Type == JTokenType.Array)\n                {\n                    var statsCount = Math.Min(ArrayStatisticsCount, (jStatistics as JArray).Count);\n                    statistics = new Dictionary<string, string>(StatisticsIndices\n                        .Where(kvp => kvp.Value < statsCount)\n                        .Select(kvp => KeyValuePair.Create(kvp.Key, jStatistics[kvp.Value].Value<string>()))\n                        .Where(kvp => kvp.Value != null));\n                }\n                else\n                {\n                    statistics = new();\n                    foreach (var statistic in jStatistics.Children<JProperty>())\n                    {\n                        var statisticName = TryConvertToLeanStatisticIndex(statistic.Name, out var index)\n                            ? StatisticNames[index]\n                            : statistic.Name;\n                        statistics[statisticName] = statistic.Value.Value<string>();\n                    }\n                }\n            }\n\n            var parameterSet = serializer.Deserialize<ParameterSet>(jObject[\"parameterSet\"].CreateReader());\n\n            var equity = new CandlestickSeries();\n            if (jObject[\"equity\"] != null)\n            {\n                foreach (var point in JsonConvert.DeserializeObject<List<Candlestick>>(jObject[\"equity\"].ToString()))\n                {\n                    equity.AddPoint(point);\n                }\n            }\n\n            var optimizationBacktest = new OptimizationBacktest(parameterSet, backtestId, name)\n            {\n                HostName = hostName,\n                Progress = progress,\n                ExitCode = exitCode,\n                Statistics = statistics,\n                Equity = equity,\n                EndDate = endDate,\n                StartDate = startDate,\n                OutOfSampleDays = outOfSampleDays,\n                OutOfSampleMaxEndDate = outOfSampleMaxEndDate,\n            };\n\n            return optimizationBacktest;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static bool TryConvertToLeanStatisticIndex(string statistic, out int index)\n        {\n            return int.TryParse(statistic, out index) && index >= 0 && index < StatisticsIndices.Count;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Organization.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Api.Serialization;\n\n// Collection of response objects for QuantConnect Organization/ endpoints\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Response wrapper for Organizations/Read\n    /// </summary>\n    public class OrganizationResponse : RestResponse\n    {\n        /// <summary>\n        /// Organization read from the response\n        /// </summary>\n        public Organization Organization { get; set; }\n    }\n\n    /// <summary>\n    /// Object representation of Organization from QuantConnect Api\n    /// </summary>\n    public class Organization: StringRepresentation\n    {\n        /// <summary>\n        /// Data Agreement information\n        /// </summary>\n        [JsonProperty(PropertyName = \"data\")]\n        public DataAgreement DataAgreement { get; set; }\n\n        /// <summary>\n        /// Organization Product Subscriptions\n        /// </summary>\n        public List<Product> Products { get; set; }\n\n        /// <summary>\n        /// Organization Credit Balance and Transactions\n        /// </summary>\n        public Credit Credit { get; set; }\n    }\n\n    /// <summary>\n    /// Organization Data Agreement\n    /// </summary>\n    public class DataAgreement\n    {\n        /// <summary>\n        /// Epoch time the Data Agreement was Signed\n        /// </summary>\n        [JsonProperty(PropertyName = \"signedTime\")]\n        public long? EpochSignedTime { get; set; }\n\n        /// <summary>\n        /// DateTime the agreement was signed.\n        /// Uses EpochSignedTime converted to a standard datetime.\n        /// </summary>\n        [JsonIgnore]\n        public DateTime? SignedTime => EpochSignedTime.HasValue ? DateTimeOffset.FromUnixTimeSeconds(EpochSignedTime.Value).DateTime : null;\n\n        /// <summary>\n        /// True/False if it is currently signed\n        /// </summary>\n        [JsonProperty(PropertyName = \"current\")]\n        public bool Signed { get; set; }\n    }\n\n    /// <summary>\n    /// Organization Credit Object\n    /// </summary>\n    public class Credit\n    {\n        /// <summary>\n        /// QCC Current Balance\n        /// </summary>\n        public decimal Balance { get; set; }\n    }\n\n    /// <summary>\n    /// QuantConnect Products\n    /// </summary>\n    [JsonConverter(typeof(ProductJsonConverter))]\n    public class Product\n    {\n        /// <summary>\n        /// Product Type\n        /// </summary>\n        public ProductType Type { get; set; }\n\n        /// <summary>\n        /// Collection of item subscriptions\n        /// Nodes/Data/Seats/etc\n        /// </summary>\n        public List<ProductItem> Items { get; set; }\n    }\n\n    /// <summary>\n    /// QuantConnect ProductItem\n    /// </summary>\n    public class ProductItem\n    {\n        /// <summary>\n        /// ID for this product\n        /// </summary>\n        [JsonProperty(PropertyName = \"productId\")]\n        public int Id { get; set; }\n\n        /// <summary>\n        /// Quantity for this product\n        /// </summary>\n        public int Quantity { get; set; }\n    }\n\n    /// <summary>\n    /// Product types offered by QuantConnect\n    /// Used by Product class\n    /// </summary>\n    public enum ProductType\n    {\n        /// <summary>\n        /// Professional Seats Subscriptions\n        /// </summary>\n        ProfessionalSeats,\n\n        /// <summary>\n        /// Backtest Nodes Subscriptions\n        /// </summary>\n        BacktestNode,\n\n        /// <summary>\n        /// Research Nodes Subscriptions\n        /// </summary>\n        ResearchNode,\n\n        /// <summary>\n        /// Live Trading Nodes Subscriptions\n        /// </summary>\n        LiveNode,\n\n        /// <summary>\n        /// Support Subscriptions\n        /// </summary>\n        Support,\n\n        /// <summary>\n        /// Data Subscriptions\n        /// </summary>\n        Data,\n\n        /// <summary>\n        /// Modules Subscriptions\n        /// </summary>\n        Modules\n    }\n}\n"
  },
  {
    "path": "Common/Api/ParameterSetJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Json converter for <see cref=\"ParameterSet\"/> which creates a light weight easy to consume serialized version\n    /// </summary>\n    public class ParameterSetJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(ParameterSet);\n        }\n\n        /// <summary>\n        /// Writes a JSON object from a Parameter set\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)\n        {\n            var parameterSet = value as ParameterSet;\n            if (ReferenceEquals(parameterSet, null)) return;\n\n            writer.WriteStartObject();\n\n            if (parameterSet.Value != null)\n            {\n                writer.WritePropertyName(\"parameterSet\");\n                serializer.Serialize(writer, parameterSet.Value);\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.StartArray)\n            {\n                if (JArray.Load(reader).Count == 0)\n                {\n                    return new ParameterSet(-1, new Dictionary<string, string>());\n                }\n            }\n            else if (reader.TokenType == JsonToken.StartObject)\n            {\n                var jObject = JObject.Load(reader);\n\n                var value = jObject[\"parameterSet\"] ?? jObject;\n\n                var parameterSet = new ParameterSet(-1, value.ToObject<Dictionary<string, string>>());\n\n                return parameterSet;\n            }\n\n            throw new ArgumentException($\"Unexpected Tokentype {reader.TokenType}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Portfolio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Class containing the basic portfolio information of a live algorithm\n    /// </summary>\n    public class Portfolio\n    {\n        /// <summary>\n        /// Dictionary of algorithm holdings information\n        /// </summary>\n        public Dictionary<string, Holding> Holdings { get; set; }\n\n        /// <summary>\n        /// Dictionary of algorithm cash currencies information\n        /// </summary>\n        public Dictionary<string, Cash> Cash { get; set; }\n    }\n\n    /// <summary>\n    /// Response class for reading the portfolio of a live algorithm\n    /// </summary>\n    public class PortfolioResponse : RestResponse\n    {\n        /// <summary>\n        /// Object containing the basic portfolio information of a live algorithm\n        /// </summary>\n        public Portfolio Portfolio { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Project.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Collaborator responses\n    /// </summary>\n    public class Collaborator\n    {\n        /// <summary>\n        /// User ID\n        /// </summary>\n        [JsonProperty(PropertyName = \"uid\")]\n        public int? Uid { get; set; }\n\n        /// <summary>\n        /// Indicate if the user have live control\n        /// </summary>\n        [JsonProperty(PropertyName = \"liveControl\")]\n        public bool LiveControl { get; set; }\n\n        /// <summary>\n        /// The permission this user is given. Can be \"read\"\n        /// or \"write\"\n        /// </summary>\n        [JsonProperty(PropertyName = \"permission\")]\n        public string Permission { get; set; }\n\n        /// <summary>\n        /// The user public ID\n        /// </summary>\n        [JsonProperty(PropertyName = \"publicId\")]\n        public string PublicId { get; set; }\n\n        /// <summary>\n        /// The url of the user profile image\n        /// </summary>\n        [JsonProperty(PropertyName = \"profileImage\")]\n        public string ProfileImage { get; set; }\n\n        /// <summary>\n        /// The registered email of the user\n        /// </summary>\n        [JsonProperty(PropertyName = \"email\")]\n        public string Email { get; set; }\n\n        /// <summary>\n        /// The display name of the user\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// The biography of the user\n        /// </summary>\n        [JsonProperty(PropertyName = \"bio\")]\n        public string Bio { get; set; }\n\n        /// <summary>\n        /// Indicate if the user is the owner of the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"owner\")]\n        public bool Owner { get; set; }\n    }\n\n    /// <summary>\n    /// Library response\n    /// </summary>\n    public class Library\n    {\n\n        /// <summary>\n        /// Project Id of the library project\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectId\")]\n        public int Projectid { get; set; }\n\n        /// <summary>\n        /// Name of the library project\n        /// </summary>\n        [JsonProperty(PropertyName = \"libraryName\")]\n        public string LibraryName { get; set; }\n\n        /// <summary>\n        /// Name of the library project owner\n        /// </summary>\n        [JsonProperty(PropertyName = \"ownerName\")]\n        public string OwnerName { get; set; }\n\n        /// <summary>\n        /// Indicate if the library project can be accessed\n        /// </summary>\n        [JsonProperty(PropertyName = \"access\")]\n        public bool Access { get; set; }\n    }\n\n    /// <summary>\n    /// The chart display properties\n    /// </summary>\n    public class GridChart\n    {\n        /// <summary>\n        /// The chart name\n        /// </summary>\n        [JsonProperty(PropertyName = \"chartName\")]\n        public string ChartName { get; set; }\n\n        /// <summary>\n        /// Width of the chart\n        /// </summary>\n        [JsonProperty(PropertyName = \"width\")]\n        public int Width { get; set; }\n\n        /// <summary>\n        /// Height of the chart\n        /// </summary>\n        [JsonProperty(PropertyName = \"height\")]\n        public int Height { get; set; }\n\n        /// <summary>\n        /// Number of rows of the chart\n        /// </summary>\n        [JsonProperty(PropertyName = \"row\")]\n        public int Row { get; set; }\n\n        /// <summary>\n        /// Number of columns of the chart\n        /// </summary>\n        [JsonProperty(PropertyName = \"column\")]\n        public int Column { get; set; }\n\n        /// <summary>\n        /// Sort of the chart\n        /// </summary>\n        [JsonProperty(PropertyName = \"sort\")]\n        public int Sort { get; set; }\n\n        /// <summary>\n        /// Optionally related definition\n        /// </summary>\n        [JsonProperty(PropertyName = \"definition\")]\n        public List<string> Definition { get; set; }\n    }\n\n    /// <summary>\n    /// The grid arrangement of charts\n    /// </summary>\n    public class Grid\n    {\n        /// <summary>\n        /// List of chart in the xs (Extra small) position\n        /// </summary>\n        [JsonProperty(PropertyName = \"xs\")]\n        public List<GridChart> Xs { get; set; }\n\n        /// <summary>\n        /// List of chart in the sm (Small) position\n        /// </summary>\n        [JsonProperty(PropertyName = \"sm\")]\n        public List<GridChart> Sm { get; set; }\n\n        /// <summary>\n        /// List of chart in the md (Medium) position\n        /// </summary>\n        [JsonProperty(PropertyName = \"md\")]\n        public List<GridChart> Md { get; set; }\n\n        /// <summary>\n        /// List of chart in the lg (Large) position\n        /// </summary>\n        [JsonProperty(PropertyName = \"lg\")]\n        public List<GridChart> Lg { get; set; }\n\n        /// <summary>\n        /// List of chart in the xl (Extra large) position\n        /// </summary>\n        [JsonProperty(PropertyName = \"xl\")]\n        public List<GridChart> Xl { get; set; }\n    }\n\n    /// <summary>\n    /// Encryption key details\n    /// </summary>\n    public class EncryptionKey\n    {\n        /// <summary>\n        /// Encryption key id\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Name of the encryption key\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n    }\n\n    /// <summary>\n    /// Parameter set\n    /// </summary>\n    public class Parameter\n    {\n        /// <summary>\n        /// Name of parameter\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Value of parameter\n        /// </summary>\n        [JsonProperty(PropertyName = \"value\")]\n        public string Value { get; set; }\n    }\n\n    /// <summary>\n    /// Response from reading a project by id.\n    /// </summary>\n    public class Project : RestResponse\n    {\n        /// <summary>\n        /// Project id\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectId\")]\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Name of the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Date the project was created\n        /// </summary>\n        [JsonProperty(PropertyName = \"created\")]\n        public DateTime Created { get; set; }\n\n        /// <summary>\n        /// Modified date for the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"modified\")]\n        public DateTime Modified { get; set; }\n\n        /// <summary>\n        /// Programming language of the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"language\")]\n        public Language Language { get; set; }\n\n        /// <summary>\n        /// The projects owner id\n        /// </summary>\n        [JsonProperty(PropertyName = \"ownerId\")]\n        public int OwnerId { get; set; }\n\n        /// <summary>\n        /// The organization ID\n        /// </summary>\n        [JsonProperty(PropertyName = \"organizationId\")]\n        public string OrganizationId { get; set; }\n\n        /// <summary>\n        /// List of collaborators\n        /// </summary>\n        [JsonProperty(PropertyName = \"collaborators\")]\n        public List<Collaborator> Collaborators { get; set; }\n\n        /// <summary>\n        /// The version of LEAN this project is running on\n        /// </summary>\n        [JsonProperty(PropertyName = \"leanVersionId\")]\n        public int LeanVersionId { get; set; }\n\n        /// <summary>\n        /// Indicate if the project is pinned to the master branch of LEAN\n        /// </summary>\n        [JsonProperty(PropertyName = \"leanPinnedToMaster\")]\n        public bool LeanPinnedToMaster { get; set; }\n\n        /// <summary>\n        /// Indicate if you are the owner of the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"owner\")]\n        public bool Owner { get; set; }\n\n        /// <summary>\n        /// The project description\n        /// </summary>\n        [JsonProperty(PropertyName = \"description\")]\n        public string Description { get; set; }\n\n        /// <summary>\n        /// Channel id\n        /// </summary>\n        [JsonProperty(PropertyName = \"channelId\")]\n        public string ChannelId { get; set; }\n\n        /// <summary>\n        /// Optimization parameters\n        /// </summary>\n        [JsonProperty(PropertyName = \"parameters\")]\n        public List<Parameter> Parameters { get; set; }\n\n        /// <summary>\n        /// The library projects\n        /// </summary>\n        [JsonProperty(PropertyName = \"libraries\")]\n        public List<Library> Libraries { get; set; }\n\n        /// <summary>\n        /// Configuration of the backtest view grid\n        /// </summary>\n        [JsonProperty(PropertyName = \"grid\")]\n        public Grid Grid { get; set; }\n\n        /// <summary>\n        /// Configuration of the live view grid\n        /// </summary>\n        [JsonProperty(PropertyName = \"liveGrid\")]\n        public Grid LiveGrid { get; set; }\n\n        /// <summary>\n        /// The equity value of the last paper trading instance\n        /// </summary>\n        [JsonProperty(PropertyName = \"paperEquity\")]\n        public decimal? PaperEquity { get; set; }\n\n        /// <summary>\n        /// The last live deployment active time\n        /// </summary>\n        [JsonProperty(PropertyName = \"lastLiveDeployment\")]\n        public DateTime? LastLiveDeployment { get; set; }\n\n        /// <summary>\n        /// The last live wizard content used\n        /// </summary>\n        [JsonProperty(PropertyName = \"liveForm\")]\n        public object LiveForm { get; set; }\n\n        /// <summary>\n        /// Indicates if the project is encrypted\n        /// </summary>\n        [JsonProperty(PropertyName = \"encrypted\")]\n        public bool? Encrypted { get; set; }\n\n        /// <summary>\n        /// Indicates if the project is running or not\n        /// </summary>\n        [JsonProperty(PropertyName = \"codeRunning\")]\n        public bool CodeRunning { get; set; }\n\n        /// <summary>\n        /// LEAN environment of the project running on\n        /// </summary>\n        [JsonProperty(PropertyName = \"leanEnvironment\")]\n        public int LeanEnvironment { get; set; }\n\n        /// <summary>\n        /// Text file with at least 32 characters to be used to encrypt the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"encryptionKey\")]\n        public EncryptionKey EncryptionKey { get; set; }\n    }\n\n    /// <summary>\n    /// API response for version\n    /// </summary>\n    public class Version\n    {\n        /// <summary>\n        /// ID of the LEAN version\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public int Id { get; set; }\n\n        /// <summary>\n        /// Date when this version was created\n        /// </summary>\n        [JsonProperty(PropertyName = \"created\")]\n        public DateTime? Created { get; set; }\n\n        /// <summary>\n        /// Description of the LEAN version\n        /// </summary>\n        [JsonProperty(PropertyName = \"description\")]\n        public string Description { get; set; }\n\n        /// <summary>\n        /// Commit Hash in the LEAN repository\n        /// </summary>\n        [JsonProperty(PropertyName = \"leanHash\")]\n        public string LeanHash { get; set; }\n\n        /// <summary>\n        /// Commit Hash in the LEAN Cloud repository\n        /// </summary>\n        [JsonProperty(PropertyName = \"leanCloudHash\")]\n        public string LeanCloudHash { get; set; }\n\n        /// <summary>\n        /// Name of the branch where the commit is\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Reference to the branch where the commit is\n        /// </summary>\n        [JsonProperty(PropertyName = \"ref\")]\n        public string Ref { get; set; }\n\n        /// <summary>\n        /// Indicates if the version is available for the public (1) or not (0)\n        /// </summary>\n        [JsonProperty(PropertyName = \"public\")]\n        public bool Public { get; set; }\n    }\n\n    /// <summary>\n    /// Read versions response\n    /// </summary>\n    public class VersionsResponse : RestResponse\n    {\n        /// <summary>\n        /// List of LEAN versions\n        /// </summary>\n        [JsonProperty(PropertyName = \"versions\")]\n        public List<Version> Versions { get; set; }\n    }\n\n    /// <summary>\n    /// Project list response\n    /// </summary>\n    public class ProjectResponse : VersionsResponse\n    {\n        /// <summary>\n        /// List of projects for the authenticated user\n        /// </summary>\n        [JsonProperty(PropertyName = \"projects\")]\n        public List<Project> Projects { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/ProjectFile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// File for a project\n    /// </summary>\n    public class ProjectFile\n    {\n        /// <summary>\n        /// Name of a project file\n        /// </summary>\n        [JsonProperty(PropertyName = \"name\")]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Contents of the project file\n        /// </summary>\n        [JsonProperty(PropertyName = \"content\")]\n        public string Code { get; set; }\n\n        /// <summary>\n        /// DateTime project file was modified\n        /// </summary>\n        [JsonProperty(PropertyName = \"modified\")]\n        public DateTime DateModified{ get; set; }\n\n        /// <summary>\n        /// Indicates if the project file is a library or not\n        /// </summary>\n        [JsonProperty(PropertyName = \"isLibrary\")]\n        public bool IsLibrary { get; set; }\n\n        /// <summary>\n        /// Indicates if the project file is open or not\n        /// </summary>\n        [JsonProperty(PropertyName = \"open\")]\n        public bool Open { get; set; }\n\n        /// <summary>\n        /// ID of the project\n        /// </summary>\n        [JsonProperty(PropertyName = \"projectId\")]\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// ID of the project file, can be null\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public int? Id { get; set; }\n    }\n\n    /// <summary>\n    /// Response received when creating a file or reading one file or more in a project\n    /// </summary>\n    public class ProjectFilesResponse : RestResponse\n    {\n        /// <summary>\n        /// List of project file information\n        /// </summary>\n        [JsonProperty(PropertyName = \"files\")]\n        public List<ProjectFile> Files { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/ProjectNode.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Response received when reading or updating some nodes of a project\n    /// </summary>\n    public class ProjectNodesResponse : RestResponse\n    {\n        /// <summary>\n        /// List of project nodes.\n        /// </summary>\n        [JsonProperty(PropertyName = \"nodes\")]\n        public NodeList Nodes { get; set; }\n\n        /// <summary>\n        /// Indicate if the node is automatically selected\n        /// </summary>\n        [JsonProperty(PropertyName = \"autoSelectNode\")]\n        public bool AutoSelectNode { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/ReadChartResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Class for wrapping Read Chart response\n    /// </summary>\n    public class ReadChartResponse: RestResponse\n    {\n        /// <summary>\n        /// Chart object from the ReadChart response\n        /// </summary>\n        [JsonProperty(PropertyName = \"chart\")]\n        public Chart Chart { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/RestResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Base API response class for the QuantConnect API.\n    /// </summary>\n    public class RestResponse: StringRepresentation\n    {\n        /// <summary>\n        /// JSON Constructor\n        /// </summary>\n        public RestResponse()\n        {\n            Success = false;\n            Errors = new List<string>();\n        }\n\n        /// <summary>\n        /// Indicate if the API request was successful.\n        /// </summary>\n        public bool Success { get; set; }\n\n        /// <summary>\n        /// List of errors with the API call.\n        /// </summary>\n        public List<string> Errors { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Api/Serialization/ProductJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Api.Serialization\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"JsonConverter\"/> that can deserialize <see cref=\"Product\"/>\n    /// </summary>\n    public class ProductJsonConverter : JsonConverter\n    {\n        private Dictionary<string, ProductType> _productTypeMap = new Dictionary<string, ProductType>()\n        {\n            {\"Professional Seats\", ProductType.ProfessionalSeats},\n            {\"Backtest Node\", ProductType.BacktestNode},\n            {\"Research Node\", ProductType.ResearchNode},\n            {\"Live Trading Node\", ProductType.LiveNode},\n            {\"Support\", ProductType.Support},\n            {\"Data\", ProductType.Data},\n            {\"Modules\", ProductType.Modules}\n        };\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if this <see cref=\"JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite => false;\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(Product);\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException(\"The OrderJsonConverter does not implement a WriteJson method;.\");\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            var result = CreateProductFromJObject(jObject);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Create an order from a simple JObject\n        /// </summary>\n        /// <param name=\"jObject\"></param>\n        /// <returns>Order Object</returns>\n        public Product CreateProductFromJObject(JObject jObject)\n        {\n            if (jObject == null)\n            {\n                return null;\n            }\n\n            var productTypeName = jObject[\"name\"].Value<string>();\n            if (!_productTypeMap.ContainsKey(productTypeName))\n            {\n                return null;\n            }\n\n            return new Product\n            {\n                Type = _productTypeMap[productTypeName],\n                Items = jObject[\"items\"].ToObject<List<ProductItem>>()\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Api/StringRepresentation.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Api\n{\n    /// <summary>\n    /// Class to return the string representation of an API response class\n    /// </summary>\n    public class StringRepresentation\n    {\n        /// <summary>\n        /// Returns the string representation of this object\n        /// </summary>\n        public override string ToString()\n        {\n            return JsonConvert.SerializeObject(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/BaseSeries.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Chart Series Object - Series data and properties for a chart:\n    /// </summary>\n    [JsonConverter(typeof(SeriesJsonConverter))]\n    public abstract class BaseSeries\n    {\n        /// The index of the last fetch update request to only retrieve the \"delta\" of the previous request.\n        private int _updatePosition;\n\n        /// <summary>\n        /// Name of the series.\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Axis for the chart series.\n        /// </summary>\n        public string Unit { get; set; }\n\n        /// <summary>\n        /// Index/position of the series on the chart.\n        /// </summary>\n        public int Index { get; set; }\n\n        /// <summary>\n        /// Axis name for the chart series.\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string IndexName { get; set; }\n\n        /// <summary>\n        /// Defines the visual Z index of the series on the chart.\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public int? ZIndex { get; set; }\n\n        /// <summary>\n        /// Chart type for the series:\n        /// </summary>\n        public SeriesType SeriesType { get; set; }\n\n        /// <summary>\n        /// An optional tooltip template\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Tooltip { get; set; }\n\n        /// <summary>\n        /// The series list of values.\n        /// These values are assumed to be in ascending time order (first points earliest, last points latest)\n        /// </summary>\n        public List<ISeriesPoint> Values { get; set; }\n\n        /// <summary>\n        /// Default constructor for chart series\n        /// </summary>\n        protected BaseSeries()\n        {\n            Unit = \"$\";\n            Values = new List<ISeriesPoint>();\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"type\">Type of the series</param>\n        protected BaseSeries(string name, SeriesType type)\n            : this()\n        {\n            Name = name;\n            SeriesType = type;\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"type\">Type of the series</param>\n        /// <param name=\"index\">Series index position on the chart</param>\n        protected BaseSeries(string name, SeriesType type, int index)\n            : this(name, type)\n        {\n            Index = index;\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"type\">Type of the series</param>\n        /// <param name=\"index\">Series index position on the chart</param>\n        /// <param name=\"unit\">Unit for the series axis</param>\n        protected BaseSeries(string name, SeriesType type, int index, string unit)\n            : this(name, type, index)\n        {\n            Unit = unit;\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"type\">Type of the chart series</param>\n        /// <param name=\"unit\">Unit of the series</param>\n        protected BaseSeries(string name, SeriesType type, string unit)\n            : this(name, type, 0, unit)\n        {\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"point\">The data point to add</param>\n        public virtual void AddPoint(ISeriesPoint point)\n        {\n            if (Values.Count > 0 && Values[Values.Count - 1].Time == point.Time)\n            {\n                // duplicate points at the same time, overwrite the value\n                Values[Values.Count - 1] = point;\n            }\n            else\n            {\n                Values.Add(point);\n            }\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"time\">The time of the data point</param>\n        /// <param name=\"values\">The values of the data point</param>\n        public abstract void AddPoint(DateTime time, List<decimal> values);\n\n        /// <summary>\n        /// Get the updates since the last call to this function.\n        /// </summary>\n        /// <returns>List of the updates from the series</returns>\n        public BaseSeries GetUpdates()\n        {\n            var copy = Clone(empty: true);\n\n            try\n            {\n                //Add the updates since the last\n                for (var i = _updatePosition; i < Values.Count; i++)\n                {\n                    copy.Values.Add(Values[i]);\n                }\n                //Shuffle the update point to now:\n                _updatePosition = Values.Count;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return copy;\n        }\n\n        /// <summary>\n        /// Removes the data from this series and resets the update position to 0\n        /// </summary>\n        public void Purge()\n        {\n            Values.Clear();\n            _updatePosition = 0;\n        }\n\n        /// <summary>\n        /// Will sum up all chart points into a new single value, using the time of latest point\n        /// </summary>\n        /// <returns>The new chart point</returns>\n        public abstract ISeriesPoint ConsolidateChartPoints();\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        /// <returns></returns>\n        public abstract BaseSeries Clone(bool empty = false);\n\n        /// <summary>\n        /// Return a list of cloned values\n        /// </summary>\n        /// <returns></returns>\n        protected List<ISeriesPoint> CloneValues()\n        {\n            var clone = new List<ISeriesPoint>(Values.Count);\n            foreach (var point in Values)\n            {\n                clone.Add(point.Clone());\n            }\n            return clone;\n        }\n\n        /// <summary>\n        /// Returns an enumerable of the values of the series cast to the specified type\n        /// </summary>\n        /// <returns>An enumerable of the values of the series cast to the specified type</returns>\n        public IEnumerable<T> GetValues<T>()\n            where T : ISeriesPoint\n        {\n            return Values.Cast<T>();\n        }\n\n        /// <summary>\n        /// Creates a series according to the specified type.\n        /// </summary>\n        /// <param name=\"seriesType\">The series type</param>\n        /// <param name=\"name\">The name of the series</param>\n        /// <param name=\"index\">Series index position on the chart</param>\n        /// <param name=\"unit\">Unit for the series axis</param>\n        /// <returns>\n        /// A <see cref=\"CandlestickSeries\"/> if <paramref name=\"seriesType\"/> is <see cref=\"SeriesType.Candle\"/>.\n        /// A <see cref=\"Series\"/> otherwise.\n        /// </returns>\n        public static BaseSeries Create(SeriesType seriesType, string name, int index = 0, string unit = \"$\")\n        {\n            if (!Enum.IsDefined(typeof(SeriesType), seriesType))\n            {\n                throw new ArgumentOutOfRangeException(nameof(seriesType), \"Series type out of range\");\n            }\n\n            if (seriesType == SeriesType.Candle)\n            {\n                return new CandlestickSeries(name, index, unit);\n            }\n\n            return new Series(name, seriesType, index, unit);\n        }\n    }\n\n    /// <summary>\n    /// Available types of chart series\n    /// </summary>\n    public enum SeriesType\n    {\n        /// <summary>\n        /// Line Plot for Value Types (0)\n        /// </summary>\n        Line,\n        /// <summary>\n        /// Scatter Plot for Chart Distinct Types (1)\n        /// </summary>\n        Scatter,\n        /// <summary>\n        /// Charts (2)\n        /// </summary>\n        Candle,\n        /// <summary>\n        /// Bar chart (3)\n        /// </summary>\n        Bar,\n        /// <summary>\n        /// Flag indicators (4)\n        /// </summary>\n        Flag,\n        /// <summary>\n        /// 100% area chart showing relative proportions of series values at each time index (5)\n        /// </summary>\n        StackedArea,\n        /// <summary>\n        /// Pie chart (6)\n        /// </summary>\n        Pie,\n        /// <summary>\n        /// Treemap Plot (7)\n        /// </summary>\n        Treemap,\n        /// <summary>\n        /// Heatmap Plot (9) -- NOTE: 8 is reserved\n        /// </summary>\n        Heatmap = 9,\n        /// <summary>\n        /// Scatter 3D Plot (10)\n        /// </summary>\n        Scatter3d\n    }\n}\n"
  },
  {
    "path": "Common/Benchmarks/FuncBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\n\nnamespace QuantConnect.Benchmarks\n{\n    /// <summary>\n    /// Creates a benchmark defined by a function\n    /// </summary>\n    public class FuncBenchmark : IBenchmark\n    {\n        private readonly Func<DateTime, decimal> _benchmark;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncBenchmark\"/> class\n        /// </summary>\n        /// <param name=\"benchmark\">The functional benchmark implementation</param>\n        public FuncBenchmark(Func<DateTime, decimal> benchmark)\n        {\n            if (benchmark == null)\n            {\n                throw new ArgumentNullException(nameof(benchmark));\n            }\n            _benchmark = benchmark;\n        }\n\n        /// <summary>\n        /// Create a function benchmark from a Python function\n        /// </summary>\n        /// <param name=\"pyFunc\"></param>\n        public FuncBenchmark(PyObject pyFunc)\n        {\n            if (!pyFunc.TrySafeAs(out _benchmark))\n            {\n                throw new ArgumentException($\"FuncBenchmark(): {Messages.FuncBenchmark.UnableToConvertPythonFunctionToBenchmarkFunction}\");\n            }\n        }\n\n        /// <summary>\n        /// Evaluates this benchmark at the specified time\n        /// </summary>\n        /// <param name=\"time\">The time to evaluate the benchmark at</param>\n        /// <returns>The value of the benchmark at the specified time</returns>\n        public decimal Evaluate(DateTime time)\n        {\n            return _benchmark(time);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Benchmarks/IBenchmark.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Benchmarks\n{\n    /// <summary>\n    /// Specifies how to compute a benchmark for an algorithm\n    /// </summary>\n    public interface IBenchmark\n    {\n        /// <summary>\n        /// Evaluates this benchmark at the specified time\n        /// </summary>\n        /// <param name=\"time\">The time to evaluate the benchmark at</param>\n        /// <returns>The value of the benchmark at the specified time</returns>\n        decimal Evaluate(DateTime time);\n    }\n}\n"
  },
  {
    "path": "Common/Benchmarks/SecurityBenchmark.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Benchmarks\n{\n    /// <summary>\n    /// Creates a benchmark defined by the closing price of a <see cref=\"Security\"/> instance\n    /// </summary>\n    public class SecurityBenchmark : IBenchmark\n    {\n        /// <summary>\n        /// The benchmark security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityBenchmark\"/> class\n        /// </summary>\n        public SecurityBenchmark(Security security)\n        {\n            Security = security;\n        }\n\n        /// <summary>\n        /// Evaluates this benchmark at the specified time in units of the account's currency.\n        /// </summary>\n        /// <param name=\"time\">The time to evaluate the benchmark at</param>\n        /// <returns>The value of the benchmark at the specified time\n        /// in units of the account's currency.</returns>\n        public decimal Evaluate(DateTime time)\n        {\n            return Security.Price * Security.QuoteCurrency.ConversionRate;\n        }\n\n        /// <summary>\n        /// Helper function that will create a security with the given SecurityManager\n        /// for a specific symbol and then create a SecurityBenchmark for it\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security</param>\n        /// <param name=\"symbol\">The symbol to create a security benchmark with</param>\n        /// <returns>The new SecurityBenchmark</returns>\n        public static SecurityBenchmark CreateInstance(SecurityManager securities, Symbol symbol)\n        {\n            return new SecurityBenchmark(securities.CreateBenchmarkSecurity(symbol));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/BinaryComparison.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq.Expressions;\nusing static QuantConnect.Util.ExpressionBuilder;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Enumeration class defining binary comparisons and providing access to expressions and functions\n    /// capable of evaluating a particular comparison for any type. If a particular type does not implement\n    /// a binary comparison than an exception will be thrown.\n    /// </summary>\n    public class BinaryComparison\n    {\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.Equal\"/>\n        /// </summary>\n        public static readonly BinaryComparison Equal = new BinaryComparison(ExpressionType.Equal);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.NotEqual\"/>\n        /// </summary>\n        public static readonly BinaryComparison NotEqual = new BinaryComparison(ExpressionType.NotEqual);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.LessThan\"/>\n        /// </summary>\n        public static readonly BinaryComparison LessThan = new BinaryComparison(ExpressionType.LessThan);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.GreaterThan\"/>\n        /// </summary>\n        public static readonly BinaryComparison GreaterThan = new BinaryComparison(ExpressionType.GreaterThan);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.LessThanOrEqual\"/>\n        /// </summary>\n        public static readonly BinaryComparison LessThanOrEqual = new BinaryComparison(ExpressionType.LessThanOrEqual);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> equivalent of <see cref=\"ExpressionType.GreaterThanOrEqual\"/>\n        /// </summary>\n        public static readonly BinaryComparison GreaterThanOrEqual = new BinaryComparison(ExpressionType.GreaterThanOrEqual);\n\n        /// <summary>\n        /// Gets the <see cref=\"BinaryComparison\"/> matching the provided <paramref name=\"type\"/>\n        /// </summary>\n        public static BinaryComparison FromExpressionType(ExpressionType type)\n        {\n            switch (type)\n            {\n                case ExpressionType.Equal:              return Equal;\n                case ExpressionType.NotEqual:           return NotEqual;\n                case ExpressionType.LessThan:           return LessThan;\n                case ExpressionType.LessThanOrEqual:    return LessThanOrEqual;\n                case ExpressionType.GreaterThan:        return GreaterThan;\n                case ExpressionType.GreaterThanOrEqual: return GreaterThanOrEqual;\n                default:\n                    throw new InvalidOperationException($\"The specified ExpressionType '{type}' is not a binary comparison.\");\n            }\n        }\n\n        /// <summary>\n        /// Gets the expression type defining the binary comparison.\n        /// </summary>\n        public ExpressionType Type { get; }\n\n        private BinaryComparison(ExpressionType type)\n        {\n            Type = type;\n        }\n\n        /// <summary>\n        /// Evaluates the specified <paramref name=\"left\"/> and <paramref name=\"right\"/> according to this <see cref=\"BinaryComparison\"/>\n        /// </summary>\n        public bool Evaluate<T>(T left, T right)\n            => OfType<T>.GetFunc(Type)(left, right);\n\n        /// <summary>\n        /// Gets a function capable of performing this <see cref=\"BinaryComparison\"/>\n        /// </summary>\n        public Func<T, T, bool> GetEvaluator<T>()\n            => OfType<T>.GetFunc(Type);\n\n        /// <summary>\n        /// Gets an expression representing this <see cref=\"BinaryComparison\"/>\n        /// </summary>\n        public Expression<Func<T, T, bool>> GetExpression<T>()\n            => OfType<T>.GetExpression(Type);\n\n        /// <summary>\n        /// Flips the logic ordering of the comparison's operands. For example, <see cref=\"LessThan\"/>\n        /// is converted into <see cref=\"GreaterThan\"/>\n        /// </summary>\n        public BinaryComparison FlipOperands()\n        {\n            switch (Type)\n            {\n                case ExpressionType.Equal:              return this;\n                case ExpressionType.NotEqual:           return this;\n                case ExpressionType.LessThan:           return GreaterThan;\n                case ExpressionType.LessThanOrEqual:    return GreaterThanOrEqual;\n                case ExpressionType.GreaterThan:        return LessThan;\n                case ExpressionType.GreaterThanOrEqual: return LessThanOrEqual;\n                default:\n                    throw new Exception(\n                        \"The skies are falling and the oceans are rising! \" +\n                        \"If you've made it here then this exception is the least of your worries! \" +\n                        $\"ExpressionType: {Type}\"\n                    );\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return Type.ToString();\n        }\n\n        /// <summary>\n        /// Provides thread-safe lookups of expressions and functions for binary comparisons by type.\n        /// MUCH faster than using a concurrency dictionary, for example, as it's expanded at runtime\n        /// and hard-linked, no look-up is actually performed!\n        /// </summary>\n        private static class OfType<T>\n        {\n            private static readonly Expression<Func<T, T, bool>> EqualExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.Equal);\n            private static readonly Expression<Func<T, T, bool>> NotEqualExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.NotEqual);\n            private static readonly Expression<Func<T, T, bool>> LessThanExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.LessThan);\n            private static readonly Expression<Func<T, T, bool>> LessThanOrEqualExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.LessThanOrEqual);\n            private static readonly Expression<Func<T, T, bool>> GreaterThanExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.GreaterThan);\n            private static readonly Expression<Func<T, T, bool>> GreaterThanOrEqualExpr = MakeBinaryComparisonLambdaOrNull(ExpressionType.GreaterThanOrEqual);\n\n            public static Expression<Func<T, T, bool>> GetExpression(ExpressionType type)\n            {\n                switch (type)\n                {\n                    case ExpressionType.Equal:              return EqualExpr;\n                    case ExpressionType.NotEqual:           return NotEqualExpr;\n                    case ExpressionType.LessThan:           return LessThanExpr;\n                    case ExpressionType.LessThanOrEqual:    return LessThanOrEqualExpr;\n                    case ExpressionType.GreaterThan:        return GreaterThanExpr;\n                    case ExpressionType.GreaterThanOrEqual: return GreaterThanOrEqualExpr;\n                    default:\n                        throw new InvalidOperationException($\"The specified ExpressionType '{type}' is not a binary comparison.\");\n                }\n            }\n\n            private static readonly Func<T, T, bool> EqualFunc = EqualExpr?.Compile();\n            private static readonly Func<T, T, bool> NotEqualFunc = NotEqualExpr?.Compile();\n            private static readonly Func<T, T, bool> LessThanFunc = LessThanExpr?.Compile();\n            private static readonly Func<T, T, bool> LessThanOrEqualFunc = LessThanOrEqualExpr?.Compile();\n            private static readonly Func<T, T, bool> GreaterThanFunc = GreaterThanExpr?.Compile();\n            private static readonly Func<T, T, bool> GreaterThanOrEqualFunc = GreaterThanOrEqualExpr?.Compile();\n\n            public static Func<T, T, bool> GetFunc(ExpressionType type)\n            {\n                switch (type)\n                {\n                    case ExpressionType.Equal:              return EqualFunc;\n                    case ExpressionType.NotEqual:           return NotEqualFunc;\n                    case ExpressionType.LessThan:           return LessThanFunc;\n                    case ExpressionType.LessThanOrEqual:    return LessThanOrEqualFunc;\n                    case ExpressionType.GreaterThan:        return GreaterThanFunc;\n                    case ExpressionType.GreaterThanOrEqual: return GreaterThanOrEqualFunc;\n                    default:\n                        throw new InvalidOperationException($\"The specified ExpressionType '{type}' is not a binary comparison.\");\n                }\n            }\n\n            private static Expression<Func<T, T, bool>> MakeBinaryComparisonLambdaOrNull(ExpressionType type)\n            {\n                try\n                {\n                    return MakeBinaryComparisonLambda<T>(type);\n                }\n                catch\n                {\n                    return null;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/BinaryComparisonExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq.Expressions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides convenience extension methods for applying a <see cref=\"BinaryComparison\"/> to collections.\n    /// </summary>\n    public static class BinaryComparisonExtensions\n    {\n        /// <summary>\n        /// Filters the provided <paramref name=\"values\"/> according to this <see cref=\"BinaryComparison\"/>\n        /// and the specified <paramref name=\"reference\"/> value. The <paramref name=\"reference\"/> value is\n        /// used as the RIGHT side of the binary comparison. Consider the binary comparison is LessThan and\n        /// we call Filter(values, 42). We're looking for keys that are less than 42.\n        /// </summary>\n        public static TCollection Filter<T, TCollection>(\n            this BinaryComparison comparison,\n            TCollection values,\n            T reference\n            )\n            where TCollection : ICollection<T>, new()\n        {\n            var result = new TCollection();\n            var evaluator = comparison.GetEvaluator<T>();\n            foreach (var value in values)\n            {\n                if (evaluator(value, reference))\n                {\n                    result.Add(value);\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Filters the provided <paramref name=\"values\"/> according to this <see cref=\"BinaryComparison\"/>\n        /// and the specified <paramref name=\"reference\"/> value. The <paramref name=\"reference\"/> value is\n        /// used as the RIGHT side of the binary comparison. Consider the binary comparison is LessThan and\n        /// we call Filter(values, 42). We're looking for keys that are less than 42.\n        /// </summary>\n        public static SortedDictionary<TKey, TValue> Filter<TKey, TValue>(\n            this BinaryComparison comparison,\n            SortedDictionary<TKey, TValue> values,\n            TKey reference\n            )\n        {\n            SortedDictionary<TKey, TValue> result;\n            if (comparison.Type == ExpressionType.NotEqual)\n            {\n                result = new SortedDictionary<TKey, TValue>(values);\n                result.Remove(reference);\n                return result;\n            }\n\n            result = new SortedDictionary<TKey, TValue>();\n            if (comparison.Type == ExpressionType.Equal)\n            {\n                TValue value;\n                if (values.TryGetValue(reference, out value))\n                {\n                    result.Add(reference, value);\n                }\n\n                return result;\n            }\n\n            // since we're enumerating a sorted collection, once we receive\n            // a mismatch it means we'll never again receive a match\n            var breakAfterFailure =\n                comparison == BinaryComparison.LessThanOrEqual ||\n                comparison == BinaryComparison.LessThanOrEqual;\n\n            var evaluator = comparison.GetEvaluator<TKey>();\n            foreach (var kvp in values)\n            {\n                if (evaluator(kvp.Key, reference))\n                {\n                    result.Add(kvp.Key, kvp.Value);\n                }\n                else if (breakAfterFailure)\n                {\n                    break;\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Filters the provided <paramref name=\"values\"/> according to this <see cref=\"BinaryComparison\"/>\n        /// and the specified <paramref name=\"reference\"/> value. The <paramref name=\"reference\"/> value is\n        /// used as the RIGHT side of the binary comparison. Consider the binary comparison is LessThan and\n        /// we call Filter(values, 42). We're looking for keys that are less than 42.\n        /// </summary>\n        public static ImmutableSortedDictionary<TKey, TValue> Filter<TKey, TValue>(\n            this BinaryComparison comparison,\n            ImmutableSortedDictionary<TKey, TValue> values,\n            TKey reference\n            )\n        {\n            if (comparison.Type == ExpressionType.NotEqual)\n            {\n                return values.Remove(reference);\n            }\n\n            var result = ImmutableSortedDictionary<TKey, TValue>.Empty;\n            if (comparison.Type == ExpressionType.Equal)\n            {\n                TValue value;\n                if (values.TryGetValue(reference, out value))\n                {\n                    result = result.Add(reference, value);\n                }\n\n                return result;\n            }\n\n            // since we're enumerating a sorted collection, once we receive\n            // a mismatch it means we'll never again receive a match\n            var breakAfterFailure =\n                comparison == BinaryComparison.LessThanOrEqual ||\n                comparison == BinaryComparison.LessThanOrEqual;\n\n            var evaluator = comparison.GetEvaluator<TKey>();\n            foreach (var kvp in values)\n            {\n                if (evaluator(kvp.Key, reference))\n                {\n                    result = result.Add(kvp.Key, kvp.Value);\n                }\n                else if (breakAfterFailure)\n                {\n                    break;\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Filters the provided <paramref name=\"values\"/> according to this <see cref=\"BinaryComparison\"/>\n        /// and the specified <paramref name=\"reference\"/> value. The <paramref name=\"reference\"/> value is\n        /// used as the RIGHT side of the binary comparison. Consider the binary comparison is LessThan and\n        /// we call Filter(values, 42). We're looking for keys that are less than 42.\n        /// </summary>\n        public static Tuple<ImmutableSortedDictionary<TKey, TValue>, ImmutableSortedDictionary<TKey, TValue>> SplitBy<TKey, TValue>(\n            this BinaryComparison comparison,\n            ImmutableSortedDictionary<TKey, TValue> values,\n            TKey reference\n            )\n        {\n            var matches = ImmutableSortedDictionary<TKey, TValue>.Empty;\n            var removed = ImmutableSortedDictionary<TKey, TValue>.Empty;\n\n            if (comparison.Type == ExpressionType.NotEqual)\n            {\n                var match = values.Remove(reference);\n                removed = BinaryComparison.Equal.Filter(values, reference);\n                return Tuple.Create(match, removed);\n            }\n\n            if (comparison.Type == ExpressionType.Equal)\n            {\n                TValue value;\n                if (values.TryGetValue(reference, out value))\n                {\n                    matches = matches.Add(reference, value);\n                    removed = BinaryComparison.NotEqual.Filter(values, reference);\n                    return Tuple.Create(matches, removed);\n                }\n\n                // no matches\n                return Tuple.Create(ImmutableSortedDictionary<TKey, TValue>.Empty, values);\n            }\n\n            var evaluator = comparison.GetEvaluator<TKey>();\n            foreach (var kvp in values)\n            {\n                if (evaluator(kvp.Key, reference))\n                {\n                    matches = matches.Add(kvp.Key, kvp.Value);\n                }\n                else\n                {\n                    removed = removed.Add(kvp.Key, kvp.Value);\n                }\n            }\n\n            return Tuple.Create(matches, removed);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/AlpacaBrokerageModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.TimeInForces;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides an implementation of the <see cref=\"DefaultBrokerageModel\"/> specific to Alpaca brokerage.\n    /// </summary>\n    public class AlpacaBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// The default start time of the <see cref=\"OrderType.MarketOnOpen\"/> order submission window.\n        /// Example: 19:00 (7:00 PM).\n        /// </summary>\n        private static readonly TimeOnly _mooWindowStart = new(19, 0, 0);\n\n        /// <summary>\n        /// A dictionary that maps each supported <see cref=\"SecurityType\"/> to an array of <see cref=\"OrderType\"/> supported by Alpaca brokerage.\n        /// </summary>\n        private readonly Dictionary<SecurityType, HashSet<OrderType>> _supportOrderTypeBySecurityType = new()\n        {\n            { SecurityType.Equity, new HashSet<OrderType> { OrderType.Market, OrderType.Limit, OrderType.StopMarket, OrderType.StopLimit,\n                OrderType.TrailingStop, OrderType.MarketOnOpen, OrderType.MarketOnClose } },\n            // Market and limit order types see https://docs.alpaca.markets/docs/options-trading-overview\n            { SecurityType.Option, new HashSet<OrderType> { OrderType.Market, OrderType.Limit } },\n            { SecurityType.Crypto, new HashSet<OrderType> { OrderType.Market, OrderType.Limit, OrderType.StopLimit }}\n        };\n\n        /// <summary>\n        /// Defines the default set of <see cref=\"SecurityType\"/> values that support <see cref=\"OrderType.MarketOnOpen\"/> orders.\n        /// </summary>\n        private readonly IReadOnlySet<SecurityType> _defaultMarketOnOpenSupportedSecurityTypes;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlpacaBrokerageModel\"/> class\n        /// </summary>\n        /// <remarks>All Alpaca accounts are set up as margin accounts</remarks>\n        public AlpacaBrokerageModel() : base(AccountType.Margin)\n        {\n            _defaultMarketOnOpenSupportedSecurityTypes = _supportOrderTypeBySecurityType.Where(x => x.Value.Contains(OrderType.MarketOnOpen)).Select(x => x.Key).ToHashSet();\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new AlpacaFeeModel();\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!_supportOrderTypeBySecurityType.TryGetValue(security.Type, out var supportOrderTypes))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n                return false;\n            }\n\n            if (!supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, supportOrderTypes));\n                return false;\n            }\n\n            var supportsOutsideTradingHours = (order.Properties as AlpacaOrderProperties)?.OutsideRegularTradingHours ?? false;\n            if (supportsOutsideTradingHours && (order.Type != OrderType.Limit || order.TimeInForce is not DayTimeInForce))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.AlpacaBrokerageModel.TradingOutsideRegularHoursNotSupported(this, order.Type, order.TimeInForce));\n                return false;\n            }\n\n            if (!BrokerageExtensions.ValidateCrossZeroOrder(this, security, order, out message))\n            {\n                return false;\n            }\n\n            if (!BrokerageExtensions.ValidateMarketOnOpenOrder(security, order, GetMarketOnOpenAllowedWindow, _defaultMarketOnOpenSupportedSecurityTypes, out message))\n            {\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested updated to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Returns the allowed Market-on-Open submission window for Alpaca.\n        /// </summary>\n        /// <param name=\"marketHours\">The market hours segment for the security.</param>\n        /// <returns>\n        /// A tuple with <c>MarketOnOpenWindowStart</c> (default 19:00 / 7:00 PM) and \n        /// <c>MarketOnOpenWindowEnd</c>, adjusted slightly before the market open to avoid rejection.\n        /// </returns>\n        private (TimeOnly MarketOnOpenWindowStart, TimeOnly MarketOnOpenWindowEnd) GetMarketOnOpenAllowedWindow(MarketHoursSegment marketHours)\n        {\n            return (_mooWindowStart, TimeOnly.FromTimeSpan(marketHours.Start.Add(-TimeSpan.FromMinutes(2))));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/AlphaStreamsBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides properties specific to Alpha Streams\n    /// </summary>\n    public class AlphaStreamsBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlphaStreamsBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Margin\"/> does not accept <see cref=\"AccountType.Cash\"/>.</param>\n        public AlphaStreamsBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n            if (accountType == AccountType.Cash)\n            {\n                throw new ArgumentException(Messages.AlphaStreamsBrokerageModel.UnsupportedAccountType, nameof(accountType));\n            }\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security) => new AlphaStreamsFeeModel();\n\n        /// <summary>\n        /// Gets a new slippage model that represents this brokerage's fill slippage behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get a slippage model for</param>\n        /// <returns>The new slippage model for this brokerage</returns>\n        public override ISlippageModel GetSlippageModel(Security security) => new AlphaStreamsSlippageModel();\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            switch (security.Type)\n            {\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    return 10m;\n\n                default:\n                    return 1m;\n            }\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        public override ISettlementModel GetSettlementModel(Security security) => new ImmediateSettlementModel();\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/AxosClearingBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides the Axos clearing brokerage model specific properties\n    /// </summary>\n    public class AxosClearingBrokerageModel : DefaultBrokerageModel\n    {\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.MarketOnClose\n        };\n\n        /// <summary>\n        /// The default markets for Trading Technologies\n        /// </summary>\n        public new static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Equity, Market.USA}\n        }.ToReadOnlyDictionary();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public AxosClearingBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => DefaultMarketMap;\n\n        /// <summary>\n        /// Provides Axos fee model\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new AxosFeeModel();\n        }\n\n        /// <summary>\n        /// Gets the shortable provider\n        /// </summary>\n        /// <returns>Shortable provider</returns>\n        public override IShortableProvider GetShortableProvider(Security security)\n        {\n            if(security.Type == SecurityType.Equity)\n            {\n                return new LocalDiskShortableProvider(\"axos\");\n            }\n            return base.GetShortableProvider(security);\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            // Equivalent to no benchmark\n            return new FuncBenchmark(x => 0);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order.\n        /// </summary>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (!DefaultMarketMap.ContainsKey(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            // validate orders quantity\n            if (order.AbsoluteQuantity % 1 != 0)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.AxosBrokerageModel.NonIntegerOrderQuantity(order));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BinanceBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Binance specific properties\n    /// </summary>\n    public class BinanceBrokerageModel : DefaultBrokerageModel\n    {\n        private const decimal _defaultLeverage = 3;\n        private const decimal _defaultFutureLeverage = 25;\n\n        /// <summary>\n        /// The base Binance API endpoint URL.\n        /// </summary>\n        protected virtual string BaseApiEndpoint => \"https://api.binance.com/api/v3\";\n\n        /// <summary>\n        /// Market name\n        /// </summary>\n        protected virtual string MarketName => Market.Binance;\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.Binance);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BinanceBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Cash\"/></param>\n        public BinanceBrokerageModel(AccountType accountType = AccountType.Cash) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Binance global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n            {\n                return 1m;\n            }\n\n            return security.Symbol.SecurityType == SecurityType.CryptoFuture ? _defaultFutureLeverage : _defaultLeverage;\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSDC\", SecurityType.Crypto, MarketName);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Binance fee model\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new BinanceFeeModel();\n        }\n\n        /// <summary>\n        /// Binance does not support update of orders\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>Binance does not support update of orders, so it will always return false</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, 0, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            return false;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // Binance API provides minimum order size in quote currency\n            // and hence we have to check current order size using available price and order quantity\n            var quantityIsValid = true;\n            decimal price;\n            switch (order)\n            {\n                case LimitOrder limitOrder:\n                    quantityIsValid &= IsOrderSizeLargeEnough(limitOrder.LimitPrice);\n                    price = limitOrder.LimitPrice;\n                    break;\n                case MarketOrder:\n                    if (!security.HasData)\n                    {\n                        message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                            Messages.DefaultBrokerageModel.NoDataForSymbol);\n\n                        return false;\n                    }\n\n                    price = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n                    quantityIsValid &= IsOrderSizeLargeEnough(price);\n                    break;\n                case StopLimitOrder stopLimitOrder:\n                    price = stopLimitOrder.LimitPrice;\n                    quantityIsValid &= IsOrderSizeLargeEnough(stopLimitOrder.LimitPrice);\n                    if (!quantityIsValid)\n                    {\n                        break;\n                    }\n\n                    // Binance Trading UI requires this check too...\n                    quantityIsValid &= IsOrderSizeLargeEnough(stopLimitOrder.StopPrice);\n                    price = stopLimitOrder.StopPrice;\n                    break;\n                case StopMarketOrder stopMarketOrder:\n                    if (security.Symbol.SecurityType != SecurityType.CryptoFuture)\n                    {\n                        // despite Binance API allows you to post STOP_LOSS and TAKE_PROFIT order types\n                        // they always fails with the content\n                        // {\"code\":-1013,\"msg\":\"Take profit orders are not supported for this symbol.\"}\n                        // currently no symbols supporting TAKE_PROFIT or STOP_LOSS orders\n\n                        message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                            Messages.BinanceBrokerageModel.UnsupportedOrderTypeWithLinkToSupportedTypes(BaseApiEndpoint, order, security));\n                        return false;\n                    }\n                    quantityIsValid &= IsOrderSizeLargeEnough(stopMarketOrder.StopPrice);\n                    price = stopMarketOrder.StopPrice;\n                    break;\n                default:\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                        Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, new[] { OrderType.StopMarket, OrderType.StopLimit, OrderType.Market, OrderType.Limit }));\n                    return false;\n            }\n\n\n            if (!quantityIsValid)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.InvalidOrderSize(security, order.Quantity, price));\n\n                return false;\n            }\n\n            if (security.Type != SecurityType.Crypto && security.Type != SecurityType.CryptoFuture)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n            return base.CanSubmitOrder(security, order, out message);\n\n            bool IsOrderSizeLargeEnough(decimal price) =>\n                // if we have a minimum order size we enforce it\n                !security.SymbolProperties.MinimumOrderSize.HasValue || order.AbsoluteQuantity * price > security.SymbolProperties.MinimumOrderSize;\n        }\n\n        /// <summary>\n        /// Returns a readonly dictionary of binance default markets\n        /// </summary>\n        protected static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(string marketName)\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Crypto] = marketName;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BinanceCoinFuturesBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Binance Coin Futures specific properties\n    /// </summary>\n    public class BinanceCoinFuturesBrokerageModel : BinanceFuturesBrokerageModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public BinanceCoinFuturesBrokerageModel(AccountType accountType) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.CryptoFuture, MarketName);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Binance Coin Futures fee model\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new BinanceCoinFuturesFeeModel();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BinanceFuturesBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Binance Futures specific properties\n    /// </summary>\n    public class BinanceFuturesBrokerageModel : BinanceBrokerageModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public BinanceFuturesBrokerageModel(AccountType accountType) : base(accountType)\n        {\n            if (accountType == AccountType.Cash)\n            {\n                throw new InvalidOperationException($\"{SecurityType.CryptoFuture} can only be traded using a {AccountType.Margin} account type\");\n            }\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSDT\", SecurityType.CryptoFuture, MarketName);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Binance Futures fee model\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new BinanceFuturesFeeModel();\n        }\n\n        /// <summary>\n        /// Gets a new margin interest rate model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a margin interest rate model for</param>\n        /// <returns>The margin interest rate model for this brokerage</returns>\n        public override IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n        {\n            // only applies for perpetual futures\n            if (security.Symbol.SecurityType == SecurityType.CryptoFuture && security.Symbol.ID.Date == SecurityIdentifier.DefaultDate)\n            {\n                return new BinanceFutureMarginInterestRateModel();\n            }\n            return base.GetMarginInterestRateModel(security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BinanceUSBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Binance.US specific properties\n    /// </summary>\n    public class BinanceUSBrokerageModel : BinanceBrokerageModel\n    {\n        /// <summary>\n        /// The base Binance Futures API endpoint URL.\n        /// </summary>\n        protected override string BaseApiEndpoint => \"https://api.binance.us/api/v3\";\n\n        /// <summary>\n        /// Market name\n        /// </summary>\n        protected override string MarketName => Market.BinanceUS;\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.BinanceUS);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BinanceBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Cash\"/></param>\n        public BinanceUSBrokerageModel(AccountType accountType = AccountType.Cash) : base(accountType)\n        {\n            if (accountType == AccountType.Margin)\n            {\n                throw new ArgumentException(Messages.BinanceUSBrokerageModel.UnsupportedAccountType);\n            }\n        }\n\n        /// <summary>\n        /// Binance global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            // margin trading is not currently supported by Binance.US\n            return 1m;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BitfinexBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Bitfinex specific properties\n    /// </summary>\n    public class BitfinexBrokerageModel : DefaultBrokerageModel\n    {\n        private const decimal _maxLeverage = 3.3m;\n\n        /// <summary>\n        /// Represents a set of order types supported by the current brokerage model.\n        /// </summary>\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Market,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.StopLimit,\n        };\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BitfinexBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Margin\"/></param>\n        public BitfinexBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Bitfinex global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n            {\n                return 1m;\n            }\n\n            if (security.Type == SecurityType.Crypto)\n            {\n                return _maxLeverage;\n            }\n\n            throw new ArgumentException(Messages.DefaultBrokerageModel.InvalidSecurityTypeForLeverage(security), nameof(security));\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Bitfinex);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Bitfinex fee model\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new BitfinexFeeModel();\n        }\n\n        /// <summary>\n        /// Checks whether an order can be updated or not in the Bitfinex brokerage model\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The update request</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the update requested quantity is valid, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            // If the requested quantity is null is going to be ignored by the moment ApplyUpdateOrderRequest() method is call\n            if (request.Quantity == null)\n            {\n                message = null;\n                return true;\n            }\n\n            // Check if the requested quantity is valid\n            var requestedQuantity = (decimal)request.Quantity;\n            return IsValidOrderSize(security, requestedQuantity, out message);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            message = null;\n            if (security.Type != SecurityType.Crypto)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n                return false;\n            }\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets()\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Crypto] = Market.Bitfinex;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BrokerageExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides extension methods for handling brokerage operations.\n    /// </summary>\n    public static class BrokerageExtensions\n    {\n        /// <summary>\n        /// The default set of order types that are not allowed to cross zero holdings.\n        /// This is used by <see cref=\"ValidateCrossZeroOrder\"/> when no custom set is provided.\n        /// </summary>\n        private static readonly IReadOnlySet<OrderType> DefaultNotSupportedCrossZeroOrderTypes = new HashSet<OrderType>\n        {\n            OrderType.MarketOnOpen,\n            OrderType.MarketOnClose\n        };\n\n        /// <summary>\n        /// Determines if executing the specified order will cross the zero holdings threshold.\n        /// </summary>\n        /// <param name=\"holdingQuantity\">The current quantity of holdings.</param>\n        /// <param name=\"orderQuantity\">The quantity of the order to be evaluated.</param>\n        /// <returns>\n        /// <c>true</c> if the order will change the holdings from positive to negative or vice versa; otherwise, <c>false</c>.\n        /// </returns>\n        /// <remarks>\n        /// This method checks if the order will result in a position change from positive to negative holdings or from negative to positive holdings.\n        /// </remarks>\n        public static bool OrderCrossesZero(decimal holdingQuantity, decimal orderQuantity)\n        {\n            //We're reducing position or flipping:\n            if (holdingQuantity > 0 && orderQuantity < 0)\n            {\n                if ((holdingQuantity + orderQuantity) < 0)\n                {\n                    //We don't have enough holdings so will cross through zero:\n                    return true;\n                }\n            }\n            else if (holdingQuantity < 0 && orderQuantity > 0)\n            {\n                if ((holdingQuantity + orderQuantity) > 0)\n                {\n                    //Crossed zero: need to split into 2 orders:\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Determines whether an order that crosses zero holdings is permitted \n        /// for the specified brokerage model and order type.\n        /// </summary>\n        /// <param name=\"brokerageModel\">The brokerage model performing the validation.</param>\n        /// <param name=\"security\">The security associated with the order.</param>\n        /// <param name=\"order\">The order to validate.</param>\n        /// <param name=\"notSupportedTypes\">The set of order types that cannot cross zero holdings.</param>\n        /// <param name=\"message\">\n        /// When the method returns <c>false</c>, contains a <see cref=\"BrokerageMessageEvent\"/> \n        /// explaining why the order is not supported; otherwise <c>null</c>.\n        /// </param>\n        /// <returns>\n        /// <c>true</c> if the order is valid to submit; <c>false</c> if crossing zero is not supported \n        /// for the given order type.\n        /// </returns>\n        public static bool ValidateCrossZeroOrder(\n            IBrokerageModel brokerageModel,\n            Security security,\n            Order order,\n            out BrokerageMessageEvent message,\n            IReadOnlySet<OrderType> notSupportedTypes = null)\n        {\n            message = null;\n            notSupportedTypes ??= DefaultNotSupportedCrossZeroOrderTypes;\n\n            if (OrderCrossesZero(security.Holdings.Quantity, order.Quantity) && notSupportedTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(\n                    BrokerageMessageType.Warning,\n                    \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedCrossZeroByOrderType(brokerageModel, order.Type)\n                );\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Validates whether a <see cref=\"OrderType.MarketOnOpen\"/> order.\n        /// </summary>\n        /// <param name=\"security\">The security associated with the order.</param>\n        /// <param name=\"order\">The order to validate.</param>\n        /// <param name=\"getMarketOnOpenAllowedWindow\">\n        /// A delegate that takes a <see cref=\"MarketHoursSegment\"/> and returns the allowed \n        /// Market-on-Open submission window as a <see cref=\"TimeOnly\"/> tuple (start, end).\n        /// </param>\n        /// <param name=\"supportedSecurityTypes\"> The set of <see cref=\"SecurityType\"/> values allowed for <see cref=\"OrderType.MarketOnOpen\"/> orders.</param>\n        /// <param name=\"message\">\n        /// An output <see cref=\"BrokerageMessageEvent\"/> containing the reason\n        /// the order is invalid if the check fails; otherwise <c>null</c>.\n        /// </param>\n        /// <returns><c>true</c> if the order may be submitted within the given window; otherwise <c>false</c>.</returns>\n        public static bool ValidateMarketOnOpenOrder(\n            Security security,\n            Order order,\n            Func<MarketHoursSegment, (TimeOnly WindowStart, TimeOnly WindowEnd)> getMarketOnOpenAllowedWindow,\n            IReadOnlySet<SecurityType> supportedSecurityTypes,\n            out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            if (order.Type != OrderType.MarketOnOpen)\n            {\n                return true;\n            }\n\n            if (!supportedSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, $\"UnsupportedSecurityType\",\n                    $\"The broker does not support Market-on-Open orders for security type {security.Type}\");\n                return false;\n            }\n\n            var targetTime = TimeOnly.FromDateTime(security.LocalTime);\n\n            var regularHours = security.Exchange.Hours.GetMarketHours(security.LocalTime).Segments.FirstOrDefault(x => x.State == MarketHoursState.Market);\n            var (windowStart, windowEnd) = (TimeOnly.MinValue, TimeOnly.MaxValue);\n            if (regularHours != null)\n            {\n                (windowStart, windowEnd) = getMarketOnOpenAllowedWindow(regularHours);\n            }\n\n            if (!targetTime.IsBetween(windowStart, windowEnd))\n            {\n                message = new BrokerageMessageEvent(\n                    BrokerageMessageType.Warning,\n                    \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedMarketOnOpenOrderTime(windowStart, windowEnd)\n                );\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the position that might result given the specified order direction and the current holdings quantity.\n        /// This is useful for brokerages that require more specific direction information than provided by the OrderDirection enum\n        /// (e.g. Tradier differentiates Buy/Sell and BuyToOpen/BuyToCover/SellShort/SellToClose)\n        /// </summary>\n        /// <param name=\"orderDirection\">The order direction</param>\n        /// <param name=\"holdingsQuantity\">The current holdings quantity</param>\n        /// <returns>The order position</returns>\n        public static OrderPosition GetOrderPosition(OrderDirection orderDirection, decimal holdingsQuantity)\n        {\n            return orderDirection switch\n            {\n                OrderDirection.Buy => holdingsQuantity >= 0 ? OrderPosition.BuyToOpen : OrderPosition.BuyToClose,\n                OrderDirection.Sell => holdingsQuantity <= 0 ? OrderPosition.SellToOpen : OrderPosition.SellToClose,\n                _ => throw new ArgumentOutOfRangeException(nameof(orderDirection), orderDirection, \"Invalid order direction\")\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BrokerageFactoryAttribute.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents the brokerage factory type required to load a data queue handler\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class)]\n    public class BrokerageFactoryAttribute : Attribute\n    {\n        /// <summary>\n        /// The type of the brokerage factory\n        /// </summary>\n        public Type Type { get; set; }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BrokerageFactoryAttribute\"/> class\n        /// </summary>\n        /// <param name=\"type\">The brokerage factory type</param>\n        public BrokerageFactoryAttribute(Type type)\n        {\n            Type = type;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BrokerageMessageEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a message received from a brokerage\n    /// </summary>\n    public class BrokerageMessageEvent\n    {\n        /// <summary>\n        /// Gets the type of brokerage message\n        /// </summary>\n        public BrokerageMessageType Type { get; private set; }\n\n        /// <summary>\n        /// Gets the brokerage specific code for this message, zero if no code was specified\n        /// </summary>\n        public string Code { get; private set; }\n\n        /// <summary>\n        /// Gets the message text received from the brokerage\n        /// </summary>\n        public string Message { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the BrokerageMessageEvent class\n        /// </summary>\n        /// <param name=\"type\">The type of brokerage message</param>\n        /// <param name=\"code\">The brokerage specific code</param>\n        /// <param name=\"message\">The message text received from the brokerage</param>\n        public BrokerageMessageEvent(BrokerageMessageType type, int code, string message)\n        {\n            Type = type;\n            Code = code.ToStringInvariant();\n            Message = message;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BrokerageMessageEvent class\n        /// </summary>\n        /// <param name=\"type\">The type of brokerage message</param>\n        /// <param name=\"code\">The brokerage specific code</param>\n        /// <param name=\"message\">The message text received from the brokerage</param>\n        public BrokerageMessageEvent(BrokerageMessageType type, string code, string message)\n        {\n            Type = type;\n            Code = code;\n            Message = message;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"BrokerageMessageEvent\"/> to represent a disconnect message\n        /// </summary>\n        /// <param name=\"message\">The message from the brokerage</param>\n        /// <returns>A brokerage disconnect message</returns>\n        public static BrokerageMessageEvent Disconnected(string message)\n        {\n            return new BrokerageMessageEvent(BrokerageMessageType.Disconnect, Messages.BrokerageMessageEvent.DisconnectCode, message);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"BrokerageMessageEvent\"/> to represent a reconnect message\n        /// </summary>\n        /// <param name=\"message\">The message from the brokerage</param>\n        /// <returns>A brokerage reconnect message</returns>\n        public static BrokerageMessageEvent Reconnected(string message)\n        {\n            return new BrokerageMessageEvent(BrokerageMessageType.Reconnect, Messages.BrokerageMessageEvent.ReconnectCode, message);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.BrokerageMessageEvent.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BrokerageMessageType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Specifies the type of message received from an IBrokerage implementation\n    /// </summary>\n    public enum BrokerageMessageType\n    {\n        /// <summary>\n        /// Informational message (0)\n        /// </summary>\n        Information,\n\n        /// <summary>\n        /// Warning message (1)\n        /// </summary>\n        Warning,\n\n        /// <summary>\n        /// Fatal error message, the algo will be stopped (2)\n        /// </summary>\n        Error,\n\n        /// <summary>\n        /// Brokerage reconnected with remote server (3)\n        /// </summary>\n        Reconnect,\n\n        /// <summary>\n        /// Brokerage disconnected from remote server (4)\n        /// </summary>\n        Disconnect,\n\n        /// <summary>\n        /// Action required by the user (5)\n        /// </summary>\n        ActionRequired,\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BrokerageName.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Specifices what transaction model and submit/execution rules to use\n    /// </summary>\n    public enum BrokerageName\n    {\n        /// <summary>\n        /// Transaction and submit/execution rules will be the default as initialized\n        /// </summary>\n        Default,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will be the default as initialized\n        /// Alternate naming for default brokerage\n        /// </summary>\n        QuantConnectBrokerage = Default,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use interactive brokers models\n        /// </summary>\n        InteractiveBrokersBrokerage,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use tradier models\n        /// </summary>\n        TradierBrokerage,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use oanda models\n        /// </summary>\n        OandaBrokerage,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use fxcm models\n        /// </summary>\n        FxcmBrokerage,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use bitfinex models\n        /// </summary>\n        Bitfinex,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use binance models\n        /// </summary>\n        Binance,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use gdax models\n        /// </summary>\n        [Obsolete(\"GDAX brokerage name is deprecated. Use Coinbase instead.\")]\n        GDAX = 12,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use alpaca models\n        /// </summary>\n        Alpaca,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use AlphaStream models\n        /// </summary>\n        AlphaStreams,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Zerodha models\n        /// </summary>\n        Zerodha,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Samco models\n        /// </summary>\n        Samco,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use atreyu models\n        /// </summary>\n        Atreyu,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use TradingTechnologies models\n        /// </summary>\n        TradingTechnologies,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Kraken models\n        /// </summary>\n        Kraken,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use ftx models\n        /// </summary>\n        FTX,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use ftx us models\n        /// </summary>\n        FTXUS,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Exante models\n        /// </summary>\n        Exante,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Binance.US models\n        /// </summary>\n        BinanceUS,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Wolverine models\n        /// </summary>\n        Wolverine,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use TDameritrade models\n        /// </summary>\n        TDAmeritrade,\n\n        /// <summary>\n        /// Binance Futures USDⓈ-Margined contracts are settled and collateralized in their quote cryptocurrency, USDT or BUSD\n        /// </summary>\n        BinanceFutures,\n\n        /// <summary>\n        /// Binance Futures COIN-Margined contracts are settled and collateralized in their based cryptocurrency.\n        /// </summary>\n        BinanceCoinFutures,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use RBI models\n        /// </summary>\n        RBI,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Bybit models\n        /// </summary>\n        Bybit,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Eze models\n        /// </summary>\n        Eze,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Axos models\n        /// </summary>\n        Axos,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Coinbase broker's model\n        /// </summary>\n        Coinbase,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use TradeStation models\n        /// </summary>\n        TradeStation,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Terminal link models\n        /// </summary>\n        TerminalLink,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Charles Schwab models\n        /// </summary>\n        CharlesSchwab,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use Tastytrade models\n        /// </summary>\n        Tastytrade,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use interactive brokers Fix models\n        /// </summary>\n        InteractiveBrokersFix,\n\n        /// <summary>\n        /// Transaction and submit/execution rules will use dYdX models\n        /// </summary>\n        DYDX\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/BybitBrokerageModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages;\n\n/// <summary>\n/// Provides Bybit specific properties\n/// </summary>\npublic class BybitBrokerageModel : DefaultBrokerageModel\n{\n    /// <summary>\n    /// Market name\n    /// </summary>\n    protected virtual string MarketName => Market.Bybit;\n\n    /// <summary>\n    /// Gets a map of the default markets to be used for each security type\n    /// </summary>\n    public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.Bybit);\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"BybitBrokerageModel\"/> class\n    /// </summary>\n    /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Cash\"/></param>\n    public BybitBrokerageModel(AccountType accountType = AccountType.Cash) : base(accountType)\n    {\n    }\n\n    /// <summary>\n    /// Bybit global leverage rule\n    /// </summary>\n    /// <param name=\"security\"></param>\n    /// <returns></returns>\n    public override decimal GetLeverage(Security security)\n    {\n        if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n        {\n            return 1m;\n        }\n\n        return 10;\n    }\n\n    /// <summary>\n    /// Provides Bybit fee model\n    /// </summary>\n    /// <param name=\"security\"></param>\n    /// <returns></returns>\n    public override IFeeModel GetFeeModel(Security security)\n    {\n        return security.Type switch\n        {\n            SecurityType.Crypto => new BybitFeeModel(),\n            SecurityType.CryptoFuture => new BybitFuturesFeeModel(),\n            SecurityType.Base => base.GetFeeModel(security),\n            _ => throw new ArgumentOutOfRangeException(nameof(security), security, $\"Not supported security type {security.Type}\")\n        };\n    }\n\n    /// <summary>\n    /// Gets a new margin interest rate model for the security\n    /// </summary>\n    /// <param name=\"security\">The security to get a margin interest rate model for</param>\n    /// <returns>The margin interest rate model for this brokerage</returns>\n    public override IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n    {\n        // only applies for perpetual futures\n        if (security.Type == SecurityType.CryptoFuture &&\n            security.Symbol.ID.Date == SecurityIdentifier.DefaultDate)\n        {\n            return new BybitFutureMarginInterestRateModel();\n        }\n\n        return base.GetMarginInterestRateModel(security);\n    }\n\n    /// <summary>\n    /// Get the benchmark for this model\n    /// </summary>\n    /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n    /// <returns>The benchmark for this brokerage</returns>\n    public override IBenchmark GetBenchmark(SecurityManager securities)\n    {\n        var symbol = Symbol.Create(\"BTCUSDC\", SecurityType.Crypto, MarketName);\n        return SecurityBenchmark.CreateInstance(securities, symbol);\n        //todo default conversion?\n    }\n\n    /// <summary>\n    /// Returns true if the brokerage could accept this order update. This takes into account\n    /// order type, security type, and order size limits. Bybit can only update inverse, linear, and option orders\n    /// </summary>\n    /// <param name=\"security\">The security of the order</param>\n    /// <param name=\"order\">The order to be updated</param>\n    /// <param name=\"request\">The requested update to be made to the order</param>\n    /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n    /// <returns>True if the brokerage could update the order, false otherwise</returns>\n    public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request,\n        out BrokerageMessageEvent message)\n    {\n        //can only update linear, inverse, and options\n        if (security.Type != SecurityType.CryptoFuture)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            return false;\n        }\n\n        if (order.Status is not (OrderStatus.New or OrderStatus.PartiallyFilled or OrderStatus.Submitted or OrderStatus.UpdateSubmitted))\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                $\"Order with status {order.Status} can't be modified\");\n            return false;\n        }\n\n        if (request.Quantity.HasValue && !IsOrderSizeLargeEnough(security, Math.Abs(request.Quantity.Value)))\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, request.Quantity.Value));\n            return false;\n        }\n\n        message = null;\n        return true;\n    }\n\n    /// <summary>\n    /// Returns true if the brokerage could accept this order. This takes into account\n    /// order type, security type, and order size limits.\n    /// </summary>\n    /// <remarks>\n    /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n    /// </remarks>\n    /// <param name=\"security\">The security of the order</param>\n    /// <param name=\"order\">The order to be processed</param>\n    /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n    /// <returns>True if the brokerage could process the order, false otherwise</returns>\n    public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n    {\n        if (security.Type != SecurityType.Crypto && security.Type != SecurityType.CryptoFuture && security.Type != SecurityType.Base)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n            return false;\n        }\n\n        message = null;\n        bool quantityIsValid;\n\n        switch (order)\n        {\n            case StopLimitOrder:\n            case StopMarketOrder:\n            case LimitOrder:\n            case MarketOrder:\n                quantityIsValid = IsOrderSizeLargeEnough(security, Math.Abs(order.Quantity));\n                break;\n            default:\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order,\n                        new[] { OrderType.StopMarket, OrderType.StopLimit, OrderType.Market, OrderType.Limit }));\n                return false;\n        }\n\n        if (!quantityIsValid)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, order.Quantity));\n\n            return false;\n        }\n\n        return base.CanSubmitOrder(security, order, out message);\n    }\n\n    /// <summary>\n    /// Returns true if the order size is large enough for the given security.\n    /// </summary>\n    /// <param name=\"security\">The security of the order</param>\n    /// <param name=\"orderQuantity\">The order quantity</param>\n    /// <returns>True if the order size is large enough, false otherwise</returns>\n    protected virtual bool IsOrderSizeLargeEnough(Security security, decimal orderQuantity)\n    {\n        return !security.SymbolProperties.MinimumOrderSize.HasValue ||\n               orderQuantity >= security.SymbolProperties.MinimumOrderSize;\n    }\n\n    private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(string marketName)\n    {\n        var map = DefaultMarketMap.ToDictionary();\n        map[SecurityType.Crypto] = marketName;\n        map[SecurityType.CryptoFuture] = marketName;\n        return map.ToReadOnlyDictionary();\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/CharlesSchwabBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a brokerage model specific to Charles Schwab.\n    /// </summary>\n    public class CharlesSchwabBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// HashSet containing the security types supported by TradeStation.\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new(\n            new[]\n            {\n                SecurityType.Equity,\n                SecurityType.Option,\n                SecurityType.IndexOption\n            });\n\n        /// <summary>\n        /// HashSet containing the order types supported by the <see cref=\"CanSubmitOrder\"/> operation in TradeStation.\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes =\n        [\n            OrderType.Market,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.ComboMarket,\n            OrderType.ComboLimit,\n            OrderType.MarketOnClose,\n            OrderType.MarketOnOpen,\n            OrderType.StopLimit\n        ];\n\n        /// <summary>\n        /// Constructor for Charles Schwab brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public CharlesSchwabBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Provides TradeStation fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>TradeStation fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new CharlesSchwabFeeModel();\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = default;\n\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportOrderTypes));\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/CoinbaseBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014-2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a brokerage model for interacting with the Coinbase exchange.\n    /// This class extends the default brokerage model.\n    /// </summary>\n    public class CoinbaseBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Marks the end of stop market order support on Coinbase Pro.\n        /// For backtesting purposes, this field '_stopMarketOrderSupportEndDate' specifies the date when the\n        /// market structure update was applied, affecting the handling of historical data or simulations\n        /// involving stop market orders. Details: https://blog.coinbase.com/coinbase-pro-market-structure-update-fbd9d49f43d7\n        /// </summary>\n        private readonly DateTime _stopMarketOrderSupportEndDate = new DateTime(2019, 3, 23, 1, 0, 0);\n\n        /// <summary>\n        /// Notifies users that order updates are not supported by the current brokerage model.\n        /// </summary>\n        private readonly BrokerageMessageEvent _message = new(BrokerageMessageType.Warning, 0, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n\n        /// <summary>\n        /// Represents a set of order types supported by the current brokerage model.\n        /// </summary>\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopLimit,\n            OrderType.StopMarket\n        };\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => GetDefaultMarkets(Market.Coinbase);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoinbaseBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to <see cref=\"AccountType.Cash\"/></param>\n        public CoinbaseBrokerageModel(AccountType accountType = AccountType.Cash)\n            : base(accountType)\n        {\n            if (accountType == AccountType.Margin)\n            {\n                throw new ArgumentException(Messages.CoinbaseBrokerageModel.UnsupportedAccountType, nameof(accountType));\n            }\n        }\n\n        /// <summary>\n        /// Coinbase global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            // margin trading is not currently supported by Coinbase\n            return 1m;\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Coinbase fee model\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new CoinbaseFeeModel();\n        }\n\n        /// <summary>\n        /// Determines whether the brokerage supports updating an existing order for the specified security.\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns><c>true</c> if the brokerage supports updating orders; otherwise, <c>false</c>.</returns>\n        /// <remarks>Coinbase: Only limit order types, with time in force type of good-till-cancelled can be edited.</remarks>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            if (order == null || security == null || request == null)\n            {\n                var parameter = order == null ? nameof(order) : nameof(security);\n                throw new ArgumentNullException(parameter, $\"{parameter} parameter cannot be null. Please provide a valid {parameter} for submission.\");\n            }\n\n            if (order.Type != OrderType.Limit)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", \n                    $\"Order with type {order.Type} can't be modified, only LIMIT.\");\n                return false;\n            }\n\n            if (order.TimeInForce != TimeInForce.GoodTilCanceled)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", \n                    $\"Order's parameter 'TimeInForce' is not instance of Good Til Cancelled class.\");\n                return false;\n            }\n\n            if (order.Status is not (OrderStatus.New or OrderStatus.PartiallyFilled or OrderStatus.Submitted or OrderStatus.UpdateSubmitted))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    $\"Order with status {order.Status} can't be modified\");\n                return false;\n            }\n\n            if (request.Quantity.HasValue && !IsOrderSizeLargeEnough(security, Math.Abs(request.Quantity.Value)))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, request.Quantity.Value));\n                return false;\n            }\n\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Evaluates whether exchange will accept order. Will reject order update\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if(order == null || security == null)\n            {\n                var parameter = order == null ? nameof(order) : nameof(security);\n                throw new ArgumentNullException(parameter, $\"{parameter} parameter cannot be null. Please provide a valid {parameter} for submission.\");\n            }\n            \n            if (order.BrokerId != null && order.BrokerId.Any())\n            {\n                message = _message;\n                return false;\n            }\n\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            if (security.Type != SecurityType.Crypto)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", \n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n                return false;\n            }\n\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n                return false;\n            }\n            \n            if (order.Type == OrderType.StopMarket && order.Time >= _stopMarketOrderSupportEndDate)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.CoinbaseBrokerageModel.StopMarketOrdersNoLongerSupported(_stopMarketOrderSupportEndDate));\n\n                return false;\n            }\n\n            if (!IsOrderSizeLargeEnough(security, Math.Abs(order.Quantity)))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, order.Quantity));\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Gets a new buying power model for the security, returning the default model with the security's configured leverage.\n        /// For cash accounts, leverage = 1 is used.\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        public override IBuyingPowerModel GetBuyingPowerModel(Security security)\n        {\n            // margin trading is not currently supported by Coinbase\n            return new CashBuyingPowerModel();\n        }\n\n        /// <summary>\n        /// Returns true if the order size is large enough for the given security.\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"orderQuantity\">The order quantity</param>\n        /// <returns>True if the order size is large enough, false otherwise</returns>\n        protected virtual bool IsOrderSizeLargeEnough(Security security, decimal orderQuantity)\n        {\n#pragma warning disable CA1062\n            return !security!.SymbolProperties.MinimumOrderSize.HasValue ||\n                   orderQuantity >= security.SymbolProperties.MinimumOrderSize;\n#pragma warning restore CA1062\n        }\n\n        /// <summary>\n        /// Gets the default markets for different security types, with an option to override the market name for Crypto securities.\n        /// </summary>\n        /// <param name=\"marketName\">The default market name for Crypto securities.</param>\n        /// <returns>\n        /// A read-only dictionary where the keys are <see cref=\"SecurityType\"/> and the values are market names.\n        /// </returns>\n        protected static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(string marketName)\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Crypto] = marketName;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/DefaultBrokerageMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides a default implementation o <see cref=\"IBrokerageMessageHandler\"/> that will forward\n    /// messages as follows:\n    /// Information -> IResultHandler.Debug\n    /// Warning     -> IResultHandler.Error &amp;&amp; IApi.SendUserEmail\n    /// Error       -> IResultHandler.Error &amp;&amp; IAlgorithm.RunTimeError\n    /// </summary>\n    public class DefaultBrokerageMessageHandler : IBrokerageMessageHandler\n    {\n        private static readonly TimeSpan DefaultOpenThreshold = TimeSpan.FromMinutes(5);\n        private static readonly TimeSpan DefaultInitialDelay = TimeSpan.FromMinutes(15);\n\n        private volatile bool _connected;\n\n        private readonly IAlgorithm _algorithm;\n        private readonly TimeSpan _openThreshold;\n        private readonly TimeSpan _initialDelay;\n        private CancellationTokenSource _cancellationTokenSource;\n        private bool _outsideLeanOrderWarningEmitted;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageMessageHandler\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The running algorithm</param>\n        /// <param name=\"initialDelay\"></param>\n        /// <param name=\"openThreshold\">Defines how long before market open to re-check for brokerage reconnect message</param>\n        public DefaultBrokerageMessageHandler(IAlgorithm algorithm, TimeSpan? initialDelay = null, TimeSpan? openThreshold = null)\n            : this(algorithm, null, null, initialDelay, openThreshold)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageMessageHandler\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The running algorithm</param>\n        /// <param name=\"job\">The job that produced the algorithm</param>\n        /// <param name=\"api\">The api for the algorithm</param>\n        /// <param name=\"initialDelay\"></param>\n        /// <param name=\"openThreshold\">Defines how long before market open to re-check for brokerage reconnect message</param>\n        public DefaultBrokerageMessageHandler(IAlgorithm algorithm, AlgorithmNodePacket job, IApi api, TimeSpan? initialDelay = null, TimeSpan? openThreshold = null)\n        {\n            _algorithm = algorithm;\n            _connected = true;\n            _openThreshold = openThreshold ?? DefaultOpenThreshold;\n            _initialDelay = initialDelay ?? DefaultInitialDelay;\n        }\n\n        /// <summary>\n        /// Handles the message\n        /// </summary>\n        /// <param name=\"message\">The message to be handled</param>\n        public void HandleMessage(BrokerageMessageEvent message)\n        {\n            // based on message type dispatch to result handler\n            switch (message.Type)\n            {\n                case BrokerageMessageType.Information:\n                    _algorithm.Debug(Messages.DefaultBrokerageMessageHandler.BrokerageInfo(message));\n                    break;\n\n                case BrokerageMessageType.Warning:\n                    _algorithm.Error(Messages.DefaultBrokerageMessageHandler.BrokerageWarning(message));\n                    break;\n\n                case BrokerageMessageType.Error:\n                    // unexpected error, we need to close down shop\n                    _algorithm.SetRuntimeError(new Exception(message.Message),\n                        Messages.DefaultBrokerageMessageHandler.BrokerageErrorContext);\n                    break;\n\n                case BrokerageMessageType.Disconnect:\n                    _connected = false;\n                    Log.Trace(Messages.DefaultBrokerageMessageHandler.Disconnected);\n\n                    // check to see if any non-custom security exchanges are open within the next x minutes\n                    var open = (from kvp in _algorithm.Securities\n                                let security = kvp.Value\n                                where security.Type != SecurityType.Base\n                                let exchange = security.Exchange\n                                let localTime = _algorithm.UtcTime.ConvertFromUtc(exchange.TimeZone)\n                                where exchange.IsOpenDuringBar(\n                                    localTime,\n                                    localTime + _openThreshold,\n                                    _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                                        .GetSubscriptionDataConfigs(security.Symbol)\n                                        .IsExtendedMarketHours())\n                                select security).Any();\n\n                    // if any are open then we need to kill the algorithm\n                    if (open)\n                    {\n                        Log.Trace(Messages.DefaultBrokerageMessageHandler.DisconnectedWhenExchangesAreOpen(_initialDelay));\n\n                        // wait 15 minutes before killing algorithm\n                        StartCheckReconnected(_initialDelay, message);\n                    }\n                    else\n                    {\n                        Log.Trace(Messages.DefaultBrokerageMessageHandler.DisconnectedWhenExchangesAreClosed);\n\n                        // if they aren't open, we'll need to check again a little bit before markets open\n                        DateTime nextMarketOpenUtc;\n                        if (_algorithm.Securities.Count != 0)\n                        {\n                            nextMarketOpenUtc = (from kvp in _algorithm.Securities\n                                                 let security = kvp.Value\n                                                 where security.Type != SecurityType.Base\n                                                 let exchange = security.Exchange\n                                                 let localTime = _algorithm.UtcTime.ConvertFromUtc(exchange.TimeZone)\n                                                 let marketOpen = exchange.Hours.GetNextMarketOpen(localTime,\n                                                     _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                                                         .GetSubscriptionDataConfigs(security.Symbol)\n                                                         .IsExtendedMarketHours())\n                                                 let marketOpenUtc = marketOpen.ConvertToUtc(exchange.TimeZone)\n                                                 select marketOpenUtc).Min();\n                        }\n                        else\n                        {\n                            // if we have no securities just make next market open an hour from now\n                            nextMarketOpenUtc = DateTime.UtcNow.AddHours(1);\n                        }\n\n                        var timeUntilNextMarketOpen = nextMarketOpenUtc - DateTime.UtcNow - _openThreshold;\n                        Log.Trace(Messages.DefaultBrokerageMessageHandler.TimeUntilNextMarketOpen(timeUntilNextMarketOpen));\n\n                        // wake up 5 minutes before market open and check if we've reconnected\n                        StartCheckReconnected(timeUntilNextMarketOpen, message);\n                    }\n                    break;\n\n                case BrokerageMessageType.Reconnect:\n                    _connected = true;\n                    Log.Trace(Messages.DefaultBrokerageMessageHandler.Reconnected);\n\n                    if (_cancellationTokenSource != null && !_cancellationTokenSource.IsCancellationRequested)\n                    {\n                        _cancellationTokenSource.Cancel();\n                    }\n                    break;\n\n                case BrokerageMessageType.ActionRequired:\n                    // not supported atm\n                    _algorithm.SetRuntimeError(new Exception(\"Brokerage requires user action\"), Messages.DefaultBrokerageMessageHandler.BrokerageDisconnectedShutDownContext);\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Handles a new order placed manually in the brokerage side\n        /// </summary>\n        /// <param name=\"eventArgs\">The new order event</param>\n        /// <returns>Whether the order should be added to the transaction handler</returns>\n        public virtual bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n        {\n            if (!_outsideLeanOrderWarningEmitted)\n            {\n                _outsideLeanOrderWarningEmitted = true;\n                _algorithm.Error(Messages.DefaultBrokerageMessageHandler.IgnoreUnrecognizedOrder(eventArgs.Order.BrokerId.FirstOrDefault()));\n            }\n            return false;\n        }\n\n        private void StartCheckReconnected(TimeSpan delay, BrokerageMessageEvent message)\n        {\n            _cancellationTokenSource.DisposeSafely();\n            _cancellationTokenSource = new CancellationTokenSource(delay);\n\n            Task.Run(() =>\n            {\n                while (!_cancellationTokenSource.IsCancellationRequested)\n                {\n                    Thread.Sleep(TimeSpan.FromMinutes(1));\n                }\n\n                CheckReconnected(message);\n\n            }, _cancellationTokenSource.Token);\n        }\n\n        private void CheckReconnected(BrokerageMessageEvent message)\n        {\n            if (!_connected)\n            {\n                Log.Error(Messages.DefaultBrokerageMessageHandler.StillDisconnected);\n                _algorithm.SetRuntimeError(new Exception(message.Message),\n                    Messages.DefaultBrokerageMessageHandler.BrokerageDisconnectedShutDownContext);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/DefaultBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"IBrokerageModel\"/> that allows all orders and uses\n    /// the default transaction models\n    /// </summary>\n    public class DefaultBrokerageModel : IBrokerageModel\n    {\n        /// <summary>\n        /// The default markets for the backtesting brokerage\n        /// </summary>\n        public static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Base, Market.USA},\n            {SecurityType.Equity, Market.USA},\n            {SecurityType.Option, Market.USA},\n            {SecurityType.Future, Market.CME},\n            {SecurityType.FutureOption, Market.CME},\n            {SecurityType.Forex, Market.Oanda},\n            {SecurityType.Cfd, Market.Oanda},\n            {SecurityType.Crypto, Market.Coinbase},\n            {SecurityType.CryptoFuture, Market.Binance},\n            {SecurityType.Index, Market.USA},\n            {SecurityType.IndexOption, Market.USA}\n        }.ToReadOnlyDictionary();\n\n        /// <summary>\n        /// Gets or sets the account type used by this model\n        /// </summary>\n        public virtual AccountType AccountType\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the brokerages model percentage factor used to determine the required unused buying power for the account.\n        /// From 1 to 0. Example: 0 means no unused buying power is required. 0.5 means 50% of the buying power should be left unused.\n        /// </summary>\n        public virtual decimal RequiredFreeBuyingPowerPercent => 0m;\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public virtual IReadOnlyDictionary<SecurityType, string> DefaultMarkets\n        {\n            get { return DefaultMarketMap; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"QuantConnect.AccountType.Margin\"/></param>\n        public DefaultBrokerageModel(AccountType accountType = AccountType.Margin)\n        {\n            AccountType = accountType;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public virtual bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if ((security.Type == SecurityType.Future || security.Type == SecurityType.FutureOption) && order.Type == OrderType.MarketOnOpen)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedMarketOnOpenOrdersForFuturesAndFutureOptions);\n                return false;\n            }\n\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public virtual bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\">The security being traded</param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public virtual bool CanExecuteOrder(Security security, Order order)\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Applies the split to the specified order ticket\n        /// </summary>\n        /// <remarks>\n        /// This default implementation will update the orders to maintain a similar market value\n        /// </remarks>\n        /// <param name=\"tickets\">The open tickets matching the split event</param>\n        /// <param name=\"split\">The split event data</param>\n        public virtual void ApplySplit(List<OrderTicket> tickets, Split split)\n        {\n            // by default we'll just update the orders to have the same notional value\n            var splitFactor = split.SplitFactor;\n            tickets.ForEach(ticket => ticket.Update(new UpdateOrderFields\n            {\n                Quantity = (int?) (ticket.Quantity/splitFactor),\n                LimitPrice = ticket.OrderType.IsLimitOrder() ? ticket.Get(OrderField.LimitPrice)*splitFactor : (decimal?) null,\n                StopPrice = ticket.OrderType.IsStopOrder() ? ticket.Get(OrderField.StopPrice)*splitFactor : (decimal?) null,\n                TriggerPrice = ticket.OrderType == OrderType.LimitIfTouched ? ticket.Get(OrderField.TriggerPrice) * splitFactor : (decimal?) null,\n                TrailingAmount = ticket.OrderType == OrderType.TrailingStop && !ticket.Get<bool>(OrderField.TrailingAsPercentage) ? ticket.Get(OrderField.TrailingAmount) * splitFactor : (decimal?) null\n            }));\n        }\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public virtual decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash)\n            {\n                return 1m;\n            }\n\n            switch (security.Type)\n            {\n                case SecurityType.CryptoFuture:\n                    return 25m;\n\n                case SecurityType.Equity:\n                    return 2m;\n\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    return 50m;\n\n                case SecurityType.Crypto:\n                    return 1m;\n\n                case SecurityType.Base:\n                case SecurityType.Commodity:\n                case SecurityType.Option:\n                case SecurityType.FutureOption:\n                case SecurityType.Future:\n                case SecurityType.Index:\n                case SecurityType.IndexOption:\n                default:\n                    return 1m;\n            }\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public virtual IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Gets a new fill model that represents this brokerage's fill behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get fill model for</param>\n        /// <returns>The new fill model for this brokerage</returns>\n        public virtual IFillModel GetFillModel(Security security)\n        {\n            switch (security.Type)\n            {\n                case SecurityType.Equity:\n                    return new EquityFillModel();\n                case SecurityType.FutureOption:\n                    return new FutureOptionFillModel();\n                case SecurityType.Future:\n                    return new FutureFillModel();\n                case SecurityType.Base:\n                case SecurityType.Option:\n                case SecurityType.Commodity:\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                case SecurityType.Index:\n                case SecurityType.IndexOption:\n                    return new ImmediateFillModel();\n                default:\n                    throw new ArgumentOutOfRangeException(Messages.DefaultBrokerageModel.InvalidSecurityTypeToGetFillModel(this, security));\n            }\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public virtual IFeeModel GetFeeModel(Security security)\n        {\n            switch (security.Type)\n            {\n                case SecurityType.Base:\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                case SecurityType.Index:\n                    return new ConstantFeeModel(0m);\n\n                case SecurityType.Equity:\n                case SecurityType.Option:\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                    return new InteractiveBrokersFeeModel();\n\n                case SecurityType.Commodity:\n                default:\n                    return new ConstantFeeModel(0m);\n            }\n        }\n\n        /// <summary>\n        /// Gets a new slippage model that represents this brokerage's fill slippage behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get a slippage model for</param>\n        /// <returns>The new slippage model for this brokerage</returns>\n        public virtual ISlippageModel GetSlippageModel(Security security)\n        {\n            return NullSlippageModel.Instance;\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        public virtual ISettlementModel GetSettlementModel(Security security)\n        {\n            if (AccountType == AccountType.Cash)\n            {\n                switch (security.Type)\n                {\n                    case SecurityType.Equity:\n                        return new DelayedSettlementModel(Equity.DefaultSettlementDays, Equity.DefaultSettlementTime);\n\n                    case SecurityType.Option:\n                        return new DelayedSettlementModel(Option.DefaultSettlementDays, Option.DefaultSettlementTime);\n                }\n            }\n\n            if(security.Symbol.SecurityType == SecurityType.Future)\n            {\n                return new FutureSettlementModel();\n            }\n\n            return new ImmediateSettlementModel();\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        public ISettlementModel GetSettlementModel(Security security, AccountType accountType)\n        {\n            return GetSettlementModel(security);\n        }\n\n        /// <summary>\n        /// Gets a new buying power model for the security, returning the default model with the security's configured leverage.\n        /// For cash accounts, leverage = 1 is used.\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        public virtual IBuyingPowerModel GetBuyingPowerModel(Security security)\n        {\n            IBuyingPowerModel getCurrencyBuyingPowerModel() =>\n                AccountType == AccountType.Cash\n                    ? new CashBuyingPowerModel()\n                    : new SecurityMarginModel(GetLeverage(security), RequiredFreeBuyingPowerPercent);\n\n            return security?.Type switch\n            {\n                SecurityType.Crypto => getCurrencyBuyingPowerModel(),\n                SecurityType.Forex => getCurrencyBuyingPowerModel(),\n                SecurityType.CryptoFuture => new CryptoFutureMarginModel(GetLeverage(security)),\n                SecurityType.Future => new FutureMarginModel(RequiredFreeBuyingPowerPercent, security),\n                SecurityType.FutureOption => new FuturesOptionsMarginModel(RequiredFreeBuyingPowerPercent, (Option)security),\n                SecurityType.IndexOption => new OptionMarginModel(RequiredFreeBuyingPowerPercent),\n                SecurityType.Option => new OptionMarginModel(RequiredFreeBuyingPowerPercent),\n                _ => new SecurityMarginModel(GetLeverage(security), RequiredFreeBuyingPowerPercent)\n            };\n        }\n\n        /// <summary>\n        /// Gets the shortable provider\n        /// </summary>\n        /// <returns>Shortable provider</returns>\n        public virtual IShortableProvider GetShortableProvider(Security security)\n        {\n            // Shortable provider, responsible for loading the data that indicates how much\n            // quantity we can short for a given asset. The NullShortableProvider default will\n            // allow for infinite quantities of any asset to be shorted.\n            return NullShortableProvider.Instance;\n        }\n\n        /// <summary>\n        /// Gets a new margin interest rate model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a margin interest rate model for</param>\n        /// <returns>The margin interest rate model for this brokerage</returns>\n        public virtual IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n        {\n            return MarginInterestRateModel.Null;\n        }\n\n        /// <summary>\n        /// Gets a new buying power model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        public IBuyingPowerModel GetBuyingPowerModel(Security security, AccountType accountType)\n        {\n            return GetBuyingPowerModel(security);\n        }\n\n        /// <summary>\n        /// Checks if the order quantity is valid, it means, the order size is bigger than the minimum size allowed\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"orderQuantity\">The quantity of the order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may be invalid</param>\n        /// <returns>True if the order quantity is bigger than the minimum allowed, false otherwise</returns>\n        public static bool IsValidOrderSize(Security security, decimal orderQuantity, out BrokerageMessageEvent message)\n        {\n            var minimumOrderSize = security.SymbolProperties.MinimumOrderSize;\n            if (minimumOrderSize != null && Math.Abs(orderQuantity) < minimumOrderSize)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, orderQuantity));\n\n                return false;\n            }\n\n            message = null;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/DelistingNotificationEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Event arguments class for the <see cref=\"IBrokerage.DelistingNotification\"/> event\n    /// </summary>\n    public class DelistingNotificationEventArgs\n    {\n        /// <summary>\n        /// Gets the option symbol which has received a notification\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DelistingNotificationEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        public DelistingNotificationEventArgs(Symbol symbol)\n        {\n            Symbol = symbol;\n        }\n\n        /// <summary>\n        /// Returns a string describing the delisting notification.\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"Symbol: {Symbol}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/DowngradeErrorCodeToWarningBrokerageMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IBrokerageMessageHandler\"/> that converts specified error codes into warnings\n    /// </summary>\n    public class DowngradeErrorCodeToWarningBrokerageMessageHandler : IBrokerageMessageHandler\n    {\n        private readonly HashSet<string> _errorCodesToIgnore;\n        private readonly IBrokerageMessageHandler _brokerageMessageHandler;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DowngradeErrorCodeToWarningBrokerageMessageHandler\"/> class\n        /// </summary>\n        /// <param name=\"brokerageMessageHandler\">The brokerage message handler to be wrapped</param>\n        /// <param name=\"errorCodesToIgnore\">The error codes to convert to warning messages</param>\n        public DowngradeErrorCodeToWarningBrokerageMessageHandler(IBrokerageMessageHandler brokerageMessageHandler, string[] errorCodesToIgnore)\n        {\n            _brokerageMessageHandler = brokerageMessageHandler;\n            _errorCodesToIgnore = errorCodesToIgnore.ToHashSet();\n        }\n\n        /// <summary>\n        /// Handles the message\n        /// </summary>\n        /// <param name=\"message\">The message to be handled</param>\n        public void HandleMessage(BrokerageMessageEvent message)\n        {\n            if (message.Type == BrokerageMessageType.Error && _errorCodesToIgnore.Contains(message.Code))\n            {\n                // rewrite the ignored message as a warning message\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, message.Code, message.Message);\n            }\n\n            _brokerageMessageHandler.HandleMessage(message);\n        }\n\n        /// <summary>\n        /// Handles a new order placed manually in the brokerage side\n        /// </summary>\n        /// <param name=\"eventArgs\">The new order event</param>\n        /// <returns>Whether the order should be added to the transaction handler</returns>\n        public bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n        {\n            return _brokerageMessageHandler.HandleOrder(eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/ExanteBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing static QuantConnect.Util.SecurityExtensions;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Exante Brokerage Model Implementation for Back Testing.\n    /// </summary>\n    public class ExanteBrokerageModel : DefaultBrokerageModel\n    {\n        private const decimal EquityLeverage = 1.2m;\n\n        /// <summary>\n        /// Constructor for Exante brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public ExanteBrokerageModel(AccountType accountType = AccountType.Cash)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            if (order == null)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.ExanteBrokerageModel.NullOrder);\n                return false;\n            }\n\n            if (order.Price == 0m)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.ExanteBrokerageModel.PriceNotSet);\n                return false;\n            }\n\n            if (security.Type != SecurityType.Forex &&\n                security.Type != SecurityType.Equity &&\n                security.Type != SecurityType.Index &&\n                security.Type != SecurityType.Option &&\n                security.Type != SecurityType.Future &&\n                security.Type != SecurityType.Cfd &&\n                security.Type != SecurityType.Crypto &&\n                security.Type != SecurityType.Index)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security) => new ExanteFeeModel();\n\n        /// <summary>\n        /// Exante global leverage rule\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n            {\n                return 1m;\n            }\n\n            return security.Type switch\n            {\n                SecurityType.Forex => 1.05m,\n                SecurityType.Equity => EquityLeverage,\n                _ => 1.0m,\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/EzeBrokerageModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides Eze specific properties\n    /// </summary>\n    public class EzeBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Array's Eze supports security types\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new(\n            new[]\n            {\n                SecurityType.Equity,\n                SecurityType.Option,\n                SecurityType.Future,\n                SecurityType.FutureOption,\n                SecurityType.Index,\n                SecurityType.IndexOption\n            });\n\n        /// <summary>\n        /// Array's Eze supports order types\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes = new(\n            new[]\n            {\n                OrderType.Market,\n                OrderType.Limit,\n                OrderType.StopMarket,\n                OrderType.StopLimit,\n                OrderType.MarketOnOpen,\n                OrderType.MarketOnClose,\n            });\n\n        /// <summary>\n        /// Constructor for Eze brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public EzeBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n            if (accountType == AccountType.Cash)\n            {\n                throw new NotSupportedException($\"Eze brokerage can only be used with a {AccountType.Margin} account type\");\n            }\n        }\n\n        /// <summary>\n        /// Provides Eze fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>Eze Fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new EzeFeeModel();\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">>If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportOrderTypes));\n\n                return false;\n            }\n\n            if (order.AbsoluteQuantity % 1 != 0)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    $\"Order Quantity must be Integer, but provided {order.AbsoluteQuantity}.\");\n\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order update. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage could update the order, false otherwise</returns>\n        /// <remarks>\n        /// The Eze supports update:\n        /// - quantity <see cref=\"Order.Quantity\"/>\n        /// - LimitPrice <see cref=\"LimitOrder.LimitPrice\"/>\n        /// - StopPrice <see cref=\"StopLimitOrder.StopPrice\"/>\n        /// - OrderType <seealso cref=\"OrderType\"/>\n        /// - Time In Force <see cref=\"Order.TimeInForce\"/>\n        /// </remarks>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/FTXBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// FTX Brokerage model\n    /// </summary>\n    public class FTXBrokerageModel : DefaultBrokerageModel\n    {\n        private readonly HashSet<OrderType> _supportedOrderTypes = new HashSet<OrderType>\n        {\n            OrderType.Market,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        };\n\n        private const decimal _defaultLeverage = 3m;\n\n        /// <summary>\n        /// market name\n        /// </summary>\n        protected virtual string MarketName => Market.FTX;\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.FTX);\n\n        /// <summary>\n        /// Creates an instance of <see cref=\"FTXBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public FTXBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash)\n            {\n                return 1m;\n            }\n\n            return _defaultLeverage;\n        }\n\n        /// <summary>\n        /// Provides FTX fee model\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n            => new FTXFeeModel();\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, MarketName);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            message = null;\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            if (order.Type is OrderType.StopMarket or OrderType.StopLimit)\n            {\n                if (!security.HasData)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                        Messages.DefaultBrokerageModel.NoDataForSymbol);\n\n                    return false;\n                }\n\n                var stopPrice = (order as StopMarketOrder)?.StopPrice;\n                if (!stopPrice.HasValue)\n                {\n                    stopPrice = (order as StopLimitOrder)?.StopPrice;\n                }\n\n                switch (order.Direction)\n                {\n                    case OrderDirection.Sell:\n                        if (stopPrice > security.BidPrice)\n                        {\n                            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                                Messages.FTXBrokerageModel.TriggerPriceTooHigh);\n                        }\n                        break;\n\n                    case OrderDirection.Buy:\n                        if (stopPrice < security.AskPrice)\n                        {\n                            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                                Messages.FTXBrokerageModel.TriggerPriceTooLow);\n                        }\n                        break;\n                }\n\n                if (message != null)\n                {\n                    return false;\n                }\n            }\n\n            if (security.Type != SecurityType.Crypto)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Please note that the order's queue priority will be reset, and the order ID of the modified order will be different from that of the original order.\n        /// Also note: this is implemented as cancelling and replacing your order.\n        /// There's a chance that the order meant to be cancelled gets filled and its replacement still gets placed.\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, 0, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            return false;\n        }\n\n        /// <summary>\n        /// Returns a readonly dictionary of FTX default markets\n        /// </summary>\n        protected static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(string market)\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Crypto] = market;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/FTXUSBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// FTX.US Brokerage model\n    /// </summary>\n    public class FTXUSBrokerageModel : FTXBrokerageModel\n    {\n        /// <summary>\n        /// Market name\n        /// </summary>\n        protected override string MarketName => Market.FTXUS;\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.FTXUS);\n\n        /// <summary>\n        /// Creates an instance of <see cref=\"FTXUSBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public FTXUSBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Provides FTX.US fee model\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n            => new FTXUSFeeModel();\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/FxcmBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides FXCM specific properties\n    /// </summary>\n    public class FxcmBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// The default markets for the fxcm brokerage\n        /// </summary>\n        public new static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Base, Market.USA},\n            {SecurityType.Equity, Market.USA},\n            {SecurityType.Option, Market.USA},\n            {SecurityType.Forex, Market.FXCM},\n            {SecurityType.Cfd, Market.FXCM}\n        }.ToReadOnlyDictionary();\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket\n        };\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => DefaultMarketMap;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public FxcmBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (security.Type != SecurityType.Forex && security.Type != SecurityType.Cfd)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            // validate order quantity\n            if (order.Quantity % security.SymbolProperties.LotSize != 0)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.FxcmBrokerageModel.InvalidOrderQuantityForLotSize(security));\n\n                return false;\n            }\n\n            // validate stop/limit orders prices\n            var limit = order as LimitOrder;\n            if (limit != null)\n            {\n                return IsValidOrderPrices(security, OrderType.Limit, limit.Direction, security.Price, limit.LimitPrice, ref message);\n            }\n\n            var stopMarket = order as StopMarketOrder;\n            if (stopMarket != null)\n            {\n                return IsValidOrderPrices(security, OrderType.StopMarket, stopMarket.Direction, stopMarket.StopPrice, security.Price, ref message);\n            }\n\n            // validate time in force\n            if (order.TimeInForce != TimeInForce.GoodTilCanceled)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate order quantity\n            if (request.Quantity != null && request.Quantity % security.SymbolProperties.LotSize != 0)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.FxcmBrokerageModel.InvalidOrderQuantityForLotSize(security));\n\n                return false;\n            }\n\n            // determine direction via the new, updated quantity\n            var newQuantity = request.Quantity ?? order.Quantity;\n            var direction = newQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n\n            // use security.Price if null, allows to pass checks\n            var stopPrice = request.StopPrice ?? security.Price;\n            var limitPrice = request.LimitPrice ?? security.Price;\n\n            return IsValidOrderPrices(security, order.Type, direction, stopPrice, limitPrice, ref message);\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new FxcmFeeModel();\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        public override ISettlementModel GetSettlementModel(Security security)\n        {\n            return security.Type == SecurityType.Cfd\n                ? new AccountCurrencyImmediateSettlementModel() :\n                (ISettlementModel)new ImmediateSettlementModel();\n        }\n\n        /// <summary>\n        /// Validates limit/stopmarket order prices, pass security.Price for limit/stop if n/a\n        /// </summary>\n        private static bool IsValidOrderPrices(Security security, OrderType orderType, OrderDirection orderDirection, decimal stopPrice, decimal limitPrice, ref BrokerageMessageEvent message)\n        {\n            // validate order price\n            var invalidPrice = orderType == OrderType.Limit && orderDirection == OrderDirection.Buy && limitPrice > security.Price ||\n                orderType == OrderType.Limit && orderDirection == OrderDirection.Sell && limitPrice < security.Price ||\n                orderType == OrderType.StopMarket && orderDirection == OrderDirection.Buy && stopPrice < security.Price ||\n                orderType == OrderType.StopMarket && orderDirection == OrderDirection.Sell && stopPrice > security.Price;\n\n            if (invalidPrice)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.FxcmBrokerageModel.InvalidOrderPrice);\n\n                return false;\n            }\n\n            // Validate FXCM maximum distance for limit and stop orders:\n            // there are two different Max Limits, 15000 pips and 50% rule,\n            // whichever comes first (for most pairs, 50% rule comes first)\n            var maxDistance = Math.Min(\n                // MinimumPriceVariation is 1/10th of a pip\n                security.SymbolProperties.MinimumPriceVariation * 10 * 15000,\n                security.Price / 2);\n            var currentPrice = security.Price;\n            var minPrice = currentPrice - maxDistance;\n            var maxPrice = currentPrice + maxDistance;\n\n            var outOfRangePrice = orderType == OrderType.Limit && orderDirection == OrderDirection.Buy && limitPrice < minPrice ||\n                                  orderType == OrderType.Limit && orderDirection == OrderDirection.Sell && limitPrice > maxPrice ||\n                                  orderType == OrderType.StopMarket && orderDirection == OrderDirection.Buy && stopPrice > maxPrice ||\n                                  orderType == OrderType.StopMarket && orderDirection == OrderDirection.Sell && stopPrice < minPrice;\n\n            if (outOfRangePrice)\n            {\n                var orderPrice = orderType == OrderType.Limit ? limitPrice : stopPrice;\n\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.FxcmBrokerageModel.PriceOutOfRange(orderType, orderDirection, orderPrice, currentPrice));\n\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/GDAXBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014-2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides GDAX specific properties\n    /// </summary>\n    [Obsolete(\"GDAXBrokerageModel is deprecated. Use CoinbaseBrokerageModel instead.\")]\n    public class GDAXBrokerageModel : CoinbaseBrokerageModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GDAXBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Cash\"/></param>\n        public GDAXBrokerageModel(AccountType accountType = AccountType.Cash)\n            : base(accountType)\n        { }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/IBrokerageMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides an plugin point to allow algorithms to directly handle the messages\n    /// that come from their brokerage\n    /// </summary>\n    public interface IBrokerageMessageHandler\n    {\n        /// <summary>\n        /// Handles the message\n        /// </summary>\n        /// <param name=\"message\">The message to be handled</param>\n        void HandleMessage(BrokerageMessageEvent message);\n\n        /// <summary>\n        /// Handles a new order placed manually in the brokerage side\n        /// </summary>\n        /// <param name=\"eventArgs\">The new order event</param>\n        /// <returns>Whether the order should be added to the transaction handler</returns>\n        bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs);\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/IBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Models brokerage transactions, fees, and order\n    /// </summary>\n    public interface IBrokerageModel\n    {\n        /// <summary>\n        /// Gets the account type used by this model\n        /// </summary>\n        AccountType AccountType\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the brokerages model percentage factor used to determine the required unused buying power for the account.\n        /// From 1 to 0. Example: 0 means no unused buying power is required. 0.5 means 50% of the buying power should be left unused.\n        /// </summary>\n        decimal RequiredFreeBuyingPowerPercent\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message);\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested updated to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message);\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        bool CanExecuteOrder(Security security, Order order);\n\n        /// <summary>\n        /// Applies the split to the specified order ticket\n        /// </summary>\n        /// <param name=\"tickets\">The open tickets matching the split event</param>\n        /// <param name=\"split\">The split event data</param>\n        void ApplySplit(List<OrderTicket> tickets, Split split);\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        decimal GetLeverage(Security security);\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        IBenchmark GetBenchmark(SecurityManager securities);\n\n        /// <summary>\n        /// Gets a new fill model that represents this brokerage's fill behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get fill model for</param>\n        /// <returns>The new fill model for this brokerage</returns>\n        IFillModel GetFillModel(Security security);\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        IFeeModel GetFeeModel(Security security);\n\n        /// <summary>\n        /// Gets a new slippage model that represents this brokerage's fill slippage behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get a slippage model for</param>\n        /// <returns>The new slippage model for this brokerage</returns>\n        ISlippageModel GetSlippageModel(Security security);\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        ISettlementModel GetSettlementModel(Security security);\n\n        /// <summary>\n        /// Gets a new margin interest rate model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a margin interest rate model for</param>\n        /// <returns>The margin interest rate model for this brokerage</returns>\n        IMarginInterestRateModel GetMarginInterestRateModel(Security security);\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        ISettlementModel GetSettlementModel(Security security, AccountType accountType);\n\n        /// <summary>\n        /// Gets a new buying power model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        IBuyingPowerModel GetBuyingPowerModel(Security security);\n\n        /// <summary>\n        /// Gets a new buying power model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        IBuyingPowerModel GetBuyingPowerModel(Security security, AccountType accountType);\n\n        /// <summary>\n        /// Gets the shortable provider\n        /// </summary>\n        /// <returns>Shortable provider</returns>\n        IShortableProvider GetShortableProvider(Security security);\n    }\n\n    /// <summary>\n    /// Provides factory method for creating an <see cref=\"IBrokerageModel\"/> from the <see cref=\"BrokerageName\"/> enum\n    /// </summary>\n    public static class BrokerageModel\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"IBrokerageModel\"/> for the specified <see cref=\"BrokerageName\"/>\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider</param>\n        /// <param name=\"brokerage\">The name of the brokerage</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The model for the specified brokerage</returns>\n        public static IBrokerageModel Create(IOrderProvider orderProvider, BrokerageName brokerage, AccountType accountType)\n        {\n            switch (brokerage)\n            {\n                case BrokerageName.Default:\n                case BrokerageName.TerminalLink:\n                    return new DefaultBrokerageModel(accountType);\n\n                case BrokerageName.Alpaca:\n                    return new AlpacaBrokerageModel();\n\n                case BrokerageName.InteractiveBrokersBrokerage:\n                    return new InteractiveBrokersBrokerageModel(accountType);\n\n                case BrokerageName.InteractiveBrokersFix:\n                    return new InteractiveBrokersFixModel(accountType);\n\n                case BrokerageName.TradierBrokerage:\n                    return new TradierBrokerageModel(accountType);\n\n                case BrokerageName.OandaBrokerage:\n                    return new OandaBrokerageModel(accountType);\n\n                case BrokerageName.FxcmBrokerage:\n                    return new FxcmBrokerageModel(accountType);\n\n                case BrokerageName.Bitfinex:\n                    return new BitfinexBrokerageModel(accountType);\n\n                case BrokerageName.BinanceFutures:\n                    return new BinanceFuturesBrokerageModel(accountType);\n\n                case BrokerageName.BinanceCoinFutures:\n                    return new BinanceCoinFuturesBrokerageModel(accountType);\n\n                case BrokerageName.Binance:\n                    return new BinanceBrokerageModel(accountType);\n\n                case BrokerageName.BinanceUS:\n                    return new BinanceUSBrokerageModel(accountType);\n\n                case BrokerageName.GDAX:\n                    return new GDAXBrokerageModel(accountType);\n\n                case BrokerageName.Coinbase:\n                    return new CoinbaseBrokerageModel(accountType);\n\n                case BrokerageName.AlphaStreams:\n                    return new AlphaStreamsBrokerageModel(accountType);\n\n                case BrokerageName.Zerodha:\n                    return new ZerodhaBrokerageModel(accountType);\n\n                case BrokerageName.Axos:\n                    return new AxosClearingBrokerageModel(accountType);\n\n                case BrokerageName.TradingTechnologies:\n                    return new TradingTechnologiesBrokerageModel(accountType);\n\n                case BrokerageName.Samco:\n                    return new SamcoBrokerageModel(accountType);\n\n                case BrokerageName.Kraken:\n                    return new KrakenBrokerageModel(accountType);\n\n                case BrokerageName.Exante:\n                    return new ExanteBrokerageModel(accountType);\n\n                case BrokerageName.FTX:\n                    return new FTXBrokerageModel(accountType);\n\n                case BrokerageName.FTXUS:\n                    return new FTXUSBrokerageModel(accountType);\n\n                case BrokerageName.Wolverine:\n                    return new WolverineBrokerageModel(accountType);\n\n                case BrokerageName.TDAmeritrade:\n                    return new TDAmeritradeBrokerageModel(accountType);\n\n                case BrokerageName.RBI:\n                    return new RBIBrokerageModel(accountType);\n\n                case BrokerageName.Bybit:\n                    return new BybitBrokerageModel(accountType);\n\n                case BrokerageName.Eze:\n                    return new EzeBrokerageModel(accountType);\n\n                case BrokerageName.TradeStation:\n                    return new TradeStationBrokerageModel(accountType);\n\n                case BrokerageName.CharlesSchwab:\n                    return new CharlesSchwabBrokerageModel(accountType);\n\n                case BrokerageName.Tastytrade:\n                    return new TastytradeBrokerageModel(accountType);\n\n                case BrokerageName.DYDX:\n                    return new dYdXBrokerageModel(accountType);\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(brokerage), brokerage, null);\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the corresponding <see cref=\"BrokerageName\"/> for the specified <see cref=\"IBrokerageModel\"/>\n        /// </summary>\n        /// <param name=\"brokerageModel\">The brokerage model</param>\n        /// <returns>The <see cref=\"BrokerageName\"/> for the specified brokerage model</returns>\n        public static BrokerageName GetBrokerageName(IBrokerageModel brokerageModel)\n        {\n            var model = brokerageModel;\n            if (brokerageModel is BrokerageModelPythonWrapper)\n            {\n                model = (brokerageModel as BrokerageModelPythonWrapper).GetModel();\n            }\n\n            // Case order matters to ensure we get the correct brokerage name from the inheritance chain\n            switch (model)\n            {\n                case AlpacaBrokerageModel:\n                    return BrokerageName.Alpaca;\n\n                case InteractiveBrokersBrokerageModel _:\n                    return BrokerageName.InteractiveBrokersBrokerage;\n\n                case TradierBrokerageModel _:\n                    return BrokerageName.TradierBrokerage;\n\n                case OandaBrokerageModel _:\n                    return BrokerageName.OandaBrokerage;\n\n                case FxcmBrokerageModel _:\n                    return BrokerageName.FxcmBrokerage;\n\n                case BitfinexBrokerageModel _:\n                    return BrokerageName.Bitfinex;\n\n                case BinanceUSBrokerageModel _:\n                    return BrokerageName.BinanceUS;\n\n                case BinanceBrokerageModel _:\n                    return BrokerageName.Binance;\n\n                case GDAXBrokerageModel _:\n                    return BrokerageName.GDAX;\n\n                case CoinbaseBrokerageModel _:\n                    return BrokerageName.Coinbase;\n\n                case AlphaStreamsBrokerageModel _:\n                    return BrokerageName.AlphaStreams;\n\n                case ZerodhaBrokerageModel _:\n                    return BrokerageName.Zerodha;\n\n                case AxosClearingBrokerageModel _:\n                    return BrokerageName.Axos;\n\n                case TradingTechnologiesBrokerageModel _:\n                    return BrokerageName.TradingTechnologies;\n\n                case SamcoBrokerageModel _:\n                    return BrokerageName.Samco;\n\n                case KrakenBrokerageModel _:\n                    return BrokerageName.Kraken;\n\n                case ExanteBrokerageModel _:\n                    return BrokerageName.Exante;\n\n                case FTXUSBrokerageModel _:\n                    return BrokerageName.FTXUS;\n\n                case FTXBrokerageModel _:\n                    return BrokerageName.FTX;\n\n                case WolverineBrokerageModel _:\n                    return BrokerageName.Wolverine;\n\n                case TDAmeritradeBrokerageModel _:\n                    return BrokerageName.TDAmeritrade;\n\n                case RBIBrokerageModel _:\n                    return BrokerageName.RBI;\n\n                case BybitBrokerageModel _:\n                    return BrokerageName.Bybit;\n\n                case EzeBrokerageModel _:\n                    return BrokerageName.Eze;\n\n                case TradeStationBrokerageModel _:\n                    return BrokerageName.TradeStation;\n\n                case CharlesSchwabBrokerageModel:\n                    return BrokerageName.CharlesSchwab;\n\n                case TastytradeBrokerageModel:\n                    return BrokerageName.Tastytrade;\n\n                case DefaultBrokerageModel _:\n                    return BrokerageName.Default;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(brokerageModel), brokerageModel, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/InteractiveBrokersBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides properties specific to interactive brokers\n    /// </summary>\n    public class InteractiveBrokersBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Defines the default set of <see cref=\"SecurityType\"/> values that support <see cref=\"OrderType.MarketOnOpen\"/> orders.\n        /// </summary>\n        private static readonly IReadOnlySet<SecurityType> _defaultMarketOnOpenSupportedSecurityTypes = new HashSet<SecurityType>\n        {\n            SecurityType.Cfd,\n            SecurityType.Equity,\n            SecurityType.Option,\n            SecurityType.FutureOption,\n            SecurityType.IndexOption\n        };\n\n        /// <summary>\n        /// The default markets for the IB brokerage\n        /// </summary>\n        public new static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Base, Market.USA},\n            {SecurityType.Equity, Market.USA},\n            {SecurityType.Index, Market.USA},\n            {SecurityType.Option, Market.USA},\n            {SecurityType.IndexOption, Market.USA},\n            {SecurityType.Future, Market.CME},\n            {SecurityType.FutureOption, Market.CME},\n            {SecurityType.Forex, Market.Oanda},\n            {SecurityType.Cfd, Market.InteractiveBrokers}\n        }.ToReadOnlyDictionary();\n\n        /// <summary>\n        /// Supported time in force\n        /// </summary>\n        protected virtual Type[] SupportedTimeInForces { get; } =\n        {\n            typeof(GoodTilCanceledTimeInForce),\n            typeof(DayTimeInForce),\n            typeof(GoodTilDateTimeInForce)\n        };\n\n        /// <summary>\n        /// Supported order types\n        /// </summary>\n        protected virtual HashSet<OrderType> SupportedOrderTypes { get; } = new HashSet<OrderType>\n        {\n            OrderType.Market,\n            OrderType.MarketOnOpen,\n            OrderType.MarketOnClose,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.StopLimit,\n            OrderType.TrailingStop,\n            OrderType.LimitIfTouched,\n            OrderType.ComboMarket,\n            OrderType.ComboLimit,\n            OrderType.ComboLegLimit,\n            OrderType.OptionExercise\n        };\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InteractiveBrokersBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public InteractiveBrokersBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => DefaultMarketMap;\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            // Equivalent to no benchmark\n            return new FuncBenchmark(x => 0);\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new InteractiveBrokersFeeModel();\n        }\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash)\n            {\n                return 1m;\n            }\n\n            return security.Type == SecurityType.Cfd ? 10m : base.GetLeverage(security);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate order type\n            if (!SupportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, SupportedOrderTypes));\n\n                return false;\n            }\n            else if (order.Type == OrderType.MarketOnClose && security.Type != SecurityType.Future && security.Type != SecurityType.Equity && security.Type != SecurityType.Cfd)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, $\"Unsupported order type for {security.Type} security type\",\n                    \"InteractiveBrokers does not support Market-on-Close orders for other security types different than Future and Equity.\");\n                return false;\n            }\n            else if (!BrokerageExtensions.ValidateMarketOnOpenOrder(security, order, GetMarketOnOpenAllowedWindow, _defaultMarketOnOpenSupportedSecurityTypes, out message))\n            {\n                return false;\n            }\n\n            if (order.Type == OrderType.ComboLegLimit && order.GroupOrderManager?.Count >= 4)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.InteractiveBrokersBrokerageModel.UnsupportedFourLegComboLegLimitOrders(this));\n                return false;\n            }\n\n            // validate security type\n            if (security.Type != SecurityType.Equity &&\n                security.Type != SecurityType.Forex &&\n                security.Type != SecurityType.Option &&\n                security.Type != SecurityType.Future &&\n                security.Type != SecurityType.FutureOption &&\n                security.Type != SecurityType.Index &&\n                security.Type != SecurityType.IndexOption &&\n                security.Type != SecurityType.Cfd)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            // validate order quantity\n            //https://www.interactivebrokers.com/en/?f=%2Fen%2Ftrading%2FforexOrderSize.php\n            if (security.Type == SecurityType.Forex &&\n                !IsForexWithinOrderSizeLimits(order.Symbol.Value, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            // validate time in force\n            if (!SupportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            // IB doesn't support index options and cash-settled options exercise\n            if (order.Type == OrderType.OptionExercise &&\n                (security.Type == SecurityType.IndexOption ||\n                (security.Type == SecurityType.Option && (security as Option).ExerciseSettlement == SettlementType.Cash)))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.InteractiveBrokersBrokerageModel.UnsupportedExerciseForIndexAndCashSettledOptions(this, order));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            if (order.SecurityType == SecurityType.Forex && request.Quantity != null)\n            {\n                return IsForexWithinOrderSizeLimits(order.Symbol.Value, request.Quantity.Value, out message);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public override bool CanExecuteOrder(Security security, Order order)\n        {\n            return order.SecurityType != SecurityType.Base;\n        }\n\n        /// <summary>\n        /// Returns true if the specified order is within IB's order size limits\n        /// </summary>\n        private bool IsForexWithinOrderSizeLimits(string currencyPair, decimal quantity, out BrokerageMessageEvent message)\n        {\n            /* https://www.interactivebrokers.com/en/trading/forexOrderSize.php\n            Currency    Currency Description\t    Minimum Order Size\tMaximum Order Size\n            USD\t        US Dollar\t                25,000\t            7,000,000\n            AUD\t        Australian Dollar\t        25,000\t            6,000,000\n            CAD\t        Canadian Dollar\t            25,000\t            6,000,000\n            CHF\t        Swiss Franc\t                25,000\t            6,000,000\n            CNH\t        China Renminbi (offshore)\t150,000\t            40,000,000\n            CZK\t        Czech Koruna\t            USD 25,000(1)       USD 7,000,000(1)\n            DKK\t        Danish Krone\t            150,000\t            35,000,000\n            EUR\t        Euro\t                    20,000\t            6,000,000\n            GBP\t        British Pound Sterling\t    20,000\t            5,000,000\n            HKD\t        Hong Kong Dollar\t        200,000\t            50,000,000\n            HUF\t        Hungarian Forint\t        USD 25,000(1)   \tUSD 7,000,000(1)\n            ILS\t        Israeli Shekel\t            USD 25,000(1)   \tUSD 7,000,000(1)\n            KRW\t        Korean Won\t                0\t                200,000,000\n            JPY\t        Japanese Yen\t            2,500,000\t        550,000,000\n            MXN\t        Mexican Peso\t            300,000\t            70,000,000\n            NOK\t        Norwegian Krone\t            150,000\t            35,000,000\n            NZD\t        New Zealand Dollar\t        35,000\t            8,000,000\n            PLN\t        Polish Zloty\t            USD 25,000(1)       USD 7,000,000(1)\n            RUB\t        Russian Ruble\t            750,000\t            30,000,000\n            SEK\t        Swedish Krona\t            175,000\t            40,000,000\n            SGD\t        Singapore Dollar\t        35,000\t            8,000,000\n            ZAR\t        South African Rand\t        350,000\t            100,000,000\n             */\n\n            message = null;\n\n            // switch on the currency being bought\n            Forex.DecomposeCurrencyPair(currencyPair, out var baseCurrency, out _);\n\n            ForexCurrencyLimits.TryGetValue(baseCurrency, out var limits);\n            var min = limits?.Item1 ?? 0m;\n            var max = limits?.Item2 ?? 0m;\n\n            var absoluteQuantity = Math.Abs(quantity);\n            var orderIsWithinForexSizeLimits = ((min == 0 && absoluteQuantity > min) || (min > 0 && absoluteQuantity >= min)) && absoluteQuantity <= max;\n            if (!orderIsWithinForexSizeLimits)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"OrderSizeLimit\",\n                    Messages.InteractiveBrokersBrokerageModel.InvalidForexOrderSize(min, max, baseCurrency));\n            }\n            return orderIsWithinForexSizeLimits;\n        }\n\n        // currency -> (min, max)\n        private static readonly IReadOnlyDictionary<string, Tuple<decimal, decimal>> ForexCurrencyLimits =\n            new Dictionary<string, Tuple<decimal, decimal>>()\n            {\n                {\"USD\", Tuple.Create(25000m, 7000000m)},\n                {\"AUD\", Tuple.Create(25000m, 6000000m)},\n                {\"CAD\", Tuple.Create(25000m, 6000000m)},\n                {\"CHF\", Tuple.Create(25000m, 6000000m)},\n                {\"CNH\", Tuple.Create(150000m, 40000000m)},\n                {\"CZK\", Tuple.Create(0m, 0m)}, // need market price in USD or EUR -- do later when we support\n                {\"DKK\", Tuple.Create(150000m, 35000000m)},\n                {\"EUR\", Tuple.Create(20000m, 6000000m)},\n                {\"GBP\", Tuple.Create(20000m, 5000000m)},\n                {\"HKD\", Tuple.Create(200000m, 50000000m)},\n                {\"HUF\", Tuple.Create(0m, 0m)}, // need market price in USD or EUR -- do later when we support\n                {\"ILS\", Tuple.Create(0m, 0m)}, // need market price in USD or EUR -- do later when we support\n                {\"KRW\", Tuple.Create(0m, 200000000m)},\n                {\"JPY\", Tuple.Create(2500000m, 550000000m)},\n                {\"MXN\", Tuple.Create(300000m, 70000000m)},\n                {\"NOK\", Tuple.Create(150000m, 35000000m)},\n                {\"NZD\", Tuple.Create(35000m, 8000000m)},\n                {\"PLN\", Tuple.Create(0m, 0m)}, // need market price in USD or EUR -- do later when we support\n                {\"RUB\", Tuple.Create(750000m, 30000000m)},\n                {\"SEK\", Tuple.Create(175000m, 40000000m)},\n                {\"SGD\", Tuple.Create(35000m, 8000000m)},\n                {\"ZAR\", Tuple.Create(350000m, 100000000m)}\n            };\n\n        /// <summary>\n        /// Returns the allowed Market-on-Open submission window for a <see cref=\"MarketHoursSegment\"/>.\n        /// </summary>\n        /// <param name=\"marketHours\">The market hours segment for the security.</param>\n        /// <returns>\n        /// A tuple with <c>MarketOnOpenWindowStart</c> and <c>MarketOnOpenWindowEnd</c>, \n        /// adjusted to avoid IB order rejections at exact market boundaries.\n        /// </returns>\n        private (TimeOnly MarketOnOpenWindowStart, TimeOnly MarketOnOpenWindowEnd) GetMarketOnOpenAllowedWindow(MarketHoursSegment marketHours)\n        {\n            return (TimeOnly.FromTimeSpan(marketHours.End), TimeOnly.FromTimeSpan(marketHours.Start.Add(-TimeSpan.FromMinutes(2))));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/InteractiveBrokersFixModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.TimeInForces;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides properties specific to interactive brokers\n    /// </summary>\n    public class InteractiveBrokersFixModel : InteractiveBrokersBrokerageModel\n    {\n        /// <summary>\n        /// Supported time in force\n        /// </summary>\n        protected override Type[] SupportedTimeInForces { get; } =\n        {\n            typeof(GoodTilCanceledTimeInForce),\n            typeof(DayTimeInForce),\n        };\n\n        /// <summary>\n        /// Supported order types\n        /// </summary>\n        protected override HashSet<OrderType> SupportedOrderTypes { get; } = new HashSet<OrderType>\n        {\n            OrderType.Market,\n            OrderType.MarketOnOpen,\n            OrderType.MarketOnClose,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.StopLimit,\n            OrderType.TrailingStop,\n            OrderType.ComboMarket,\n            OrderType.ComboLimit\n        };\n\n        private readonly GroupOrderCacheManager _groupOrderCacheManager = new();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InteractiveBrokersFixModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public InteractiveBrokersFixModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            // only check supported combo order types\n            if (order is ComboOrder && order.GroupOrderManager != null && SupportedOrderTypes.Contains(order.Type))\n            {\n                if (_groupOrderCacheManager.TryGetGroupCachedOrders(order, out var orders))\n                {\n                    // reject combos that mix FutureOption and Future legs\n                    if (orders.Any(o => o.SecurityType == SecurityType.FutureOption) &&\n                        orders.Any(o => o.SecurityType == SecurityType.Future))\n                    {\n                        message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                            Messages.InteractiveBrokersFixModel.UnsupportedFopFutureComboOrders(this, order));\n                        return false;\n                    }\n                }\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/KrakenBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Kraken Brokerage model\n    /// </summary>\n    public class KrakenBrokerageModel : DefaultBrokerageModel\n    {\n        private readonly List<string> _fiatsAvailableMargin = new() {\"USD\", \"EUR\"};\n        private readonly List<string> _onlyFiatsAvailableMargin = new() {\"BTC\", \"USDT\", \"USDC\"};\n        private readonly List<string> _ethAvailableMargin = new() {\"REP\", \"XTZ\", \"ADA\", \"EOS\", \"TRX\", \"LINK\" };\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket,\n            OrderType.StopLimit,\n            OrderType.LimitIfTouched\n        };\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets();\n\n        /// <summary>\n        /// Leverage map of different coins\n        /// </summary>\n        public IReadOnlyDictionary<string, decimal> CoinLeverage { get; } = new Dictionary<string, decimal>\n        {\n            {\"BTC\", 5}, // only with fiats\n            {\"ETH\", 5},\n            {\"USDT\", 2}, // only with fiats\n            {\"XMR\", 2},\n            {\"REP\", 2}, // eth available\n            {\"XRP\", 3},\n            {\"BCH\", 2},\n            {\"XTZ\", 2}, // eth available\n            {\"LTC\", 3},\n            {\"ADA\", 3}, // eth available\n            {\"EOS\", 3}, // eth available\n            {\"DASH\", 3},\n            {\"TRX\", 3}, // eth available\n            {\"LINK\", 3}, // eth available\n            {\"USDC\", 3}, // only with fiats\n        };\n\n        /// <summary>\n        /// Constructor for Kraken brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public KrakenBrokerageModel(AccountType accountType = AccountType.Cash) : base(accountType)\n        {\n\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            message = null;\n            if (security.Type != SecurityType.Crypto)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Kraken does not support update of orders\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <param name=\"order\">Order that should be updated</param>\n        /// <param name=\"request\">Update request</param>\n        /// <param name=\"message\">Outgoing message</param>\n        /// <returns>Always false as Kraken does not support update of orders</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, 0, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            return false;\n        }\n\n        /// <summary>\n        /// Provides Kraken fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>Kraken fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new KrakenFeeModel();\n        }\n\n        /// <summary>\n        /// Kraken global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash)\n            {\n                return 1m;\n            }\n\n            // first check whether this security support margin only with fiats.\n            foreach (var coin in _onlyFiatsAvailableMargin.Where(coin => security.Symbol.ID.Symbol.StartsWith(coin)).Where(coin => _fiatsAvailableMargin.Any(rightFiat => security.Symbol.Value.EndsWith(rightFiat))))\n            {\n                return CoinLeverage[coin];\n            }\n\n            List<string> extendedCoinArray = new() {\"BTC\", \"ETH\"};\n            extendedCoinArray.AddRange(_fiatsAvailableMargin);\n            // Then check whether this security support margin with ETH.\n            foreach (var coin in _ethAvailableMargin.Where(coin => security.Symbol.ID.Symbol.StartsWith(coin)).Where(coin => extendedCoinArray.Any(rightFiat => security.Symbol.Value.EndsWith(rightFiat))))\n            {\n                return CoinLeverage[coin];\n            }\n\n            extendedCoinArray.Remove(\"ETH\");\n            // At the end check all others.\n            foreach (var coin in CoinLeverage.Keys.Where(coin => security.Symbol.ID.Symbol.StartsWith(coin)).Where(coin => extendedCoinArray.Any(rightFiat => security.Symbol.Value.EndsWith(rightFiat))))\n            {\n                return CoinLeverage[coin];\n            }\n\n            return 1m;\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Kraken);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Get default markets and specify Kraken as crypto market\n        /// </summary>\n        /// <returns>default markets</returns>\n        private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets()\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Crypto] = Market.Kraken;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/NewBrokerageOrderNotificationEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Event arguments class for the <see cref=\"IBrokerage.NewBrokerageOrderNotification\"/> event\n    /// </summary>\n    public class NewBrokerageOrderNotificationEventArgs\n    {\n        /// <summary>\n        /// The new brokerage side generated order\n        /// </summary>\n        public Order Order { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public NewBrokerageOrderNotificationEventArgs(Order order)\n        {\n            Order = order;\n        }\n\n        /// <summary>\n        /// Returns a string describing the new brokerage order notification.\n        /// </summary>\n        override public string ToString()\n        {\n            return Order.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/OandaBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Oanda Brokerage Model Implementation for Back Testing.\n    /// </summary>\n    public class OandaBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// The default markets for the fxcm brokerage\n        /// </summary>\n        public new static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Base, Market.USA},\n            {SecurityType.Equity, Market.USA},\n            {SecurityType.Option, Market.USA},\n            {SecurityType.Forex, Market.Oanda},\n            {SecurityType.Cfd, Market.Oanda}\n        }.ToReadOnlyDictionary();\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        };\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => DefaultMarketMap;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public OandaBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n            if (accountType == AccountType.Cash)\n            {\n                throw new InvalidOperationException($\"Oanda brokerage can only be used with a {AccountType.Margin} account type\");\n            }\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (security.Type != SecurityType.Forex && security.Type != SecurityType.Cfd)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            // validate time in force\n            if (order.TimeInForce != TimeInForce.GoodTilCanceled)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new ConstantFeeModel(0m);\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        public override ISettlementModel GetSettlementModel(Security security)\n        {\n            return security.Type == SecurityType.Cfd\n                ? new AccountCurrencyImmediateSettlementModel() :\n                (ISettlementModel)new ImmediateSettlementModel();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/OptionNotificationEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Event arguments class for the <see cref=\"IBrokerage.OptionNotification\"/> event\n    /// </summary>\n    public sealed class OptionNotificationEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the option symbol which has received a notification\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the new option position (positive for long, zero for flat, negative for short)\n        /// </summary>\n        public decimal Position { get; }\n\n        /// <summary>\n        /// The tag that will be used in the order\n        /// </summary>\n        public string Tag { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionNotificationEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"position\">The new option position</param>\n        public OptionNotificationEventArgs(Symbol symbol, decimal position)\n        {\n            Symbol = symbol;\n            Position = position;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionNotificationEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"position\">The new option position</param>\n        /// <param name=\"tag\">The tag to be used for the order</param>\n        public OptionNotificationEventArgs(Symbol symbol, decimal position, string tag)\n            : this(symbol, position)\n        {\n            Tag = tag;\n        }\n\n        /// <summary>\n        /// Returns the string representation of this event\n        /// </summary>\n        public override string ToString()\n        {\n            var str = $\"{Symbol} position: {Position}\";\n            if (!string.IsNullOrEmpty(Tag))\n            {\n                str += $\", tag: {Tag}\";\n            }\n\n            return str;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/RBIBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// RBI Brokerage model\n    /// </summary>\n    public class RBIBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Array's RBI supports security types\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new (new [] { SecurityType.Equity });\n\n        /// <summary>\n        /// Array's RBI supports order types\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes = new(new [] { OrderType.Market, OrderType.Limit, OrderType.StopMarket, OrderType.StopLimit });\n\n        /// <summary>\n        /// Constructor for RBI brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public RBIBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            message = null;\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.RBIBrokerageModel.UnsupportedOrderType(order));\n\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// RBI supports UpdateOrder\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <param name=\"order\">Order that should be updated</param>\n        /// <param name=\"request\">Update request</param>\n        /// <param name=\"message\">Outgoing message</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Provides RBI fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>RBI fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new RBIFeeModel();\n        }\n    }\n}"
  },
  {
    "path": "Common/Brokerages/SamcoBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Brokerage Model implementation for Samco\n    /// </summary>\n    public class SamcoBrokerageModel : DefaultBrokerageModel\n    {\n        private readonly HashSet<Type> _supportedTimeInForces = new()\n        {\n            typeof(GoodTilCanceledTimeInForce),\n            typeof(DayTimeInForce),\n            typeof(GoodTilDateTimeInForce)\n        };\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Market,\n            OrderType.Limit,\n            OrderType.StopMarket\n        };\n\n        private const decimal _maxLeverage = 5m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SamcoBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to <see cref=\"AccountType.Margin\"/></param>\n        public SamcoBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not\n        /// perform executions during extended market hours. This is not intended to be checking\n        /// whether or not the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public override bool CanExecuteOrder(Security security, Order order)\n        {\n            // validate security type\n            if (security.Type != SecurityType.Equity &&\n                security.Type != SecurityType.Option &&\n                security.Type != SecurityType.Future)\n            {\n                return false;\n            }\n\n            // validate time in force\n            if (!_supportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account order\n        /// type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order\n        /// rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">\n        /// If this function returns false, a brokerage message detailing why the order may not be submitted\n        /// </param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (security.Type != SecurityType.Equity &&\n                security.Type != SecurityType.Option &&\n                security.Type != SecurityType.Future)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n\n                return false;\n            }\n\n            // validate time in force\n            if (!_supportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">\n        /// If this function returns false, a brokerage message detailing why the order may not be updated\n        /// </param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets();\n\n        /// <summary>\n        /// Samco global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n            {\n                return 1m;\n            }\n\n            if (security.Type == SecurityType.Equity || security.Type == SecurityType.Future || security.Type == SecurityType.Option || security.Type == SecurityType.Index)\n            {\n                return _maxLeverage;\n            }\n\n            throw new ArgumentException(Messages.DefaultBrokerageModel.InvalidSecurityTypeForLeverage(security), nameof(security));\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            var symbol = Symbol.Create(\"NIFTYBEES\", SecurityType.Equity, Market.India);\n            return SecurityBenchmark.CreateInstance(securities, symbol);\n        }\n\n        /// <summary>\n        /// Provides Samco fee model\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new SamcoFeeModel();\n        }\n\n        private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets()\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Equity] = Market.India;\n            map[SecurityType.Future] = Market.India;\n            map[SecurityType.Option] = Market.India;\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/TDAmeritradeBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// TDAmeritrade\n    /// </summary>\n    public class TDAmeritradeBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Array's TD Ameritrade supports security types\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new (new [] { SecurityType.Equity });\n\n        /// <summary>\n        /// Array's TD Ameritrade supports order types\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes = new(new [] { OrderType.Market, OrderType.Limit, OrderType.StopMarket, OrderType.StopLimit });\n\n        /// <summary>\n        /// Constructor for TDAmeritrade brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public TDAmeritradeBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            message = null;\n\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportOrderTypes));\n\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// TDAmeritrade support Update Order\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <param name=\"order\">Order that should be updated</param>\n        /// <param name=\"request\">Update request</param>\n        /// <param name=\"message\">Outgoing message</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Provides TDAmeritrade fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>TDAmeritrade fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new TDAmeritradeFeeModel();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/TastytradeBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a brokerage model specific to Tastytrade.\n    /// </summary>\n    public class TastytradeBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// HashSet containing the security types supported by Tastytrade.\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new(\n            new[]\n            {\n                SecurityType.Equity,\n                SecurityType.Option,\n                SecurityType.IndexOption,\n                SecurityType.Future,\n                SecurityType.FutureOption\n            });\n\n        /// <summary>\n        /// HashSet containing the order types supported by the <see cref=\"CanSubmitOrder\"/> operation in Tastytrade.\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes = new(\n            new[]\n            {\n                OrderType.Market,\n                OrderType.Limit,\n                OrderType.StopMarket,\n                OrderType.StopLimit,\n                OrderType.ComboLimit\n            });\n\n        /// <summary>\n        /// The set of <see cref=\"OrderType\"/> values that cannot be used for cross-zero execution.\n        /// </summary>\n        private static IReadOnlySet<OrderType> NotSupportedCrossZeroOrderTypes => new HashSet<OrderType>()\n        {\n            OrderType.ComboLimit\n        };\n\n        /// <summary>\n        /// Constructor for Tastytrade brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public TastytradeBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Provides Tastytrade fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>TradeStation fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new TastytradeFeeModel();\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account order type, security type.\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = default;\n\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportOrderTypes));\n                return false;\n            }\n\n            if (!BrokerageExtensions.ValidateCrossZeroOrder(this, security, order, out message, NotSupportedCrossZeroOrderTypes))\n            {\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/TradeStationBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Represents a brokerage model specific to TradeStation.\n    /// </summary>\n    public class TradeStationBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// The default start time of the <see cref=\"OrderType.MarketOnOpen\"/> order submission window.\n        /// Example: 6:00 (6:00 AM).\n        /// </summary>\n        private static readonly TimeOnly _mooWindowStart = new(6, 0, 0);\n\n        /// <summary>\n        /// HashSet containing the security types supported by TradeStation.\n        /// </summary>\n        private readonly HashSet<SecurityType> _supportSecurityTypes = new(\n            new[]\n            {\n                SecurityType.Equity,\n                SecurityType.Option,\n                SecurityType.Future,\n                SecurityType.IndexOption\n            });\n\n        /// <summary>\n        /// Defines the default set of <see cref=\"SecurityType\"/> values that support <see cref=\"OrderType.MarketOnOpen\"/> orders.\n        /// </summary>\n        private static readonly IReadOnlySet<SecurityType> _defaultMarketOnOpenSupportedSecurityTypes = new HashSet<SecurityType>\n        {\n            SecurityType.Equity,\n            SecurityType.Option,\n            SecurityType.IndexOption\n        };\n\n        /// <summary>\n        /// HashSet containing the order types supported by the <see cref=\"CanSubmitOrder\"/> operation in TradeStation.\n        /// </summary>\n        private readonly HashSet<OrderType> _supportOrderTypes = new(\n            new[]\n            {\n                OrderType.Market,\n                OrderType.Limit,\n                OrderType.StopMarket,\n                OrderType.StopLimit,\n                OrderType.ComboMarket,\n                OrderType.ComboLimit,\n                OrderType.MarketOnOpen,\n                OrderType.MarketOnClose,\n                OrderType.TrailingStop\n            });\n\n        /// <summary>\n        /// The set of <see cref=\"OrderType\"/> values that cannot be used for cross-zero execution.\n        /// </summary>\n        private static IReadOnlySet<OrderType> NotSupportedCrossZeroOrderTypes => new HashSet<OrderType>()\n        {\n            OrderType.ComboMarket,\n            OrderType.ComboLimit,\n            OrderType.MarketOnOpen,\n            OrderType.MarketOnClose\n        };\n\n\n        /// <summary>\n        /// Constructor for TradeStation brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public TradeStationBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Provides TradeStation fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>TradeStation fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new TradeStationFeeModel();\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = default;\n\n            var supportsOutsideTradingHours = (order.Properties as TradeStationOrderProperties)?.OutsideRegularTradingHours ?? false;\n            if (supportsOutsideTradingHours && (order.Type != OrderType.Limit || order.SecurityType != SecurityType.Equity))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupportedOutsideRegularMarketHours\",\n                    \"To place an order outside regular trading hours, please use a limit order and ensure the security is an equity.\");\n                return false;\n            }\n\n            if (!_supportSecurityTypes.Contains(security.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            if (!_supportOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportOrderTypes));\n                return false;\n            }\n\n            if (!BrokerageExtensions.ValidateCrossZeroOrder(this, security, order, out message, NotSupportedCrossZeroOrderTypes))\n            {\n                return false;\n            }\n\n            if (!BrokerageExtensions.ValidateMarketOnOpenOrder(security, order, GetMarketOnOpenAllowedWindow, _defaultMarketOnOpenSupportedSecurityTypes, out message))\n            {\n                return false;\n            }\n\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// TradeStation support Update Order\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <param name=\"order\">Order that should be updated</param>\n        /// <param name=\"request\">Update request</param>\n        /// <param name=\"message\">Outgoing message</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            if (BrokerageExtensions.OrderCrossesZero(security.Holdings.Quantity, order.Quantity)\n                && request.Quantity != null && request.Quantity != order.Quantity)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"UpdateRejected\",\n                    Messages.DefaultBrokerageModel.UnsupportedCrossZeroOrderUpdate(this));\n                return false;\n            }\n\n            if (IsComboOrderType(order.Type) && request.Quantity != null && request.Quantity != order.Quantity)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", Messages.DefaultBrokerageModel.UnsupportedUpdateQuantityOrder(this, order.Type));\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Determines if the provided order type is a combo order.\n        /// </summary>\n        /// <param name=\"orderType\">The order type to check.</param>\n        /// <returns>True if the order type is a combo order; otherwise, false.</returns>\n        private static bool IsComboOrderType(OrderType orderType)\n        {\n            return orderType == OrderType.ComboMarket || orderType == OrderType.ComboLimit;\n        }\n\n        /// <summary>\n        /// Returns the TradeStation Market-on-Open submission window (6:00 AM start, slightly before market open end).\n        /// </summary>\n        /// <param name=\"marketHours\">The market hours segment for the security.</param>\n        /// <returns>A tuple with <c>MarketOnOpenWindowStart</c> and <c>MarketOnOpenWindowEnd</c>.</returns>\n        private (TimeOnly MarketOnOpenWindowStart, TimeOnly MarketOnOpenWindowEnd) GetMarketOnOpenAllowedWindow(MarketHoursSegment marketHours)\n        {\n            return (_mooWindowStart, TimeOnly.FromTimeSpan(marketHours.Start.Add(-TimeSpan.FromMinutes(1))));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/TradierBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides tradier specific properties\n    /// </summary>\n    public class TradierBrokerageModel : DefaultBrokerageModel\n    {\n        private static readonly MarketHoursSegment PreMarketSession = new MarketHoursSegment(\n            MarketHoursState.PreMarket,\n            new TimeSpan(4, 0, 0),\n            new TimeSpan(9, 24, 0));\n\n        private static readonly MarketHoursSegment PostMarketSession = new MarketHoursSegment(\n            MarketHoursState.PostMarket,\n            new TimeSpan(16, 0, 0),\n            new TimeSpan(19, 55, 0));\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new HashSet<OrderType>\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        };\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modeled, defaults to\n        /// <see cref=\"QuantConnect.AccountType.Margin\"/></param>\n        public TradierBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            var securityType = order.SecurityType;\n            if (securityType != SecurityType.Equity && securityType != SecurityType.Option && securityType != SecurityType.IndexOption)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.TradierBrokerageModel.UnsupportedSecurityType);\n\n                return false;\n            }\n\n            if (order.TimeInForce is not GoodTilCanceledTimeInForce && order.TimeInForce is not DayTimeInForce)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.TradierBrokerageModel.UnsupportedTimeInForceType);\n\n                return false;\n            }\n\n            if (security.Holdings.Quantity + order.Quantity < 0)\n            {\n                if (order.TimeInForce is GoodTilCanceledTimeInForce)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"ShortOrderIsGtc\", Messages.TradierBrokerageModel.ShortOrderIsGtc);\n\n                    return false;\n                }\n                else if (security.Price < 5)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"SellShortOrderLastPriceBelow5\", Messages.TradierBrokerageModel.SellShortOrderLastPriceBelow5);\n\n                    return false;\n                }\n            }\n\n            if (order.AbsoluteQuantity < 1 || order.AbsoluteQuantity > 10000000)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"IncorrectOrderQuantity\", Messages.TradierBrokerageModel.IncorrectOrderQuantity);\n\n                return false;\n            }\n\n            if (!CanExecuteOrderImpl(security, order, out var canSubmit))\n            {\n                if (!canSubmit)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"ExtendedMarket\",\n                        Messages.TradierBrokerageModel.ExtendedMarketHoursTradingNotSupportedOutsideExtendedSession(PreMarketSession, PostMarketSession));\n                    return false;\n                }\n\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"ExtendedMarket\",\n                    Messages.TradierBrokerageModel.ExtendedMarketHoursTradingNotSupported);\n            }\n\n            if (!BrokerageExtensions.ValidateCrossZeroOrder(this, security, order, out message))\n            {\n                return false;\n            }\n\n            // tradier order limits\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // Tradier doesn't allow updating order quantities\n            if (request.Quantity != null && request.Quantity != order.Quantity)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"UpdateRejected\",\n                    Messages.TradierBrokerageModel.OrderQuantityUpdateNotSupported);\n\n                return false;\n            }\n\n            return true;\n        }\n\n        private static bool CanExecuteOrderImpl(Security security, Order order, out bool canSubmit)\n        {\n            if (!security.Exchange.ExchangeOpen)\n            {\n                var tradeOnExtendedHours = (order.Properties as TradierOrderProperties)?.OutsideRegularTradingHours ?? false;\n                if (!tradeOnExtendedHours ||\n                    order.Type != OrderType.Limit ||\n                    order.Symbol.SecurityType != SecurityType.Equity ||\n                    !IsWithinTradierExtendedSession(security.LocalTime))\n                {\n                    // if OutsideRegularTradingHours is false, allow order submission since it will be processed on market open\n                    canSubmit = !tradeOnExtendedHours;\n                    return false;\n                }\n\n            }\n\n            canSubmit = true;\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public override bool CanExecuteOrder(Security security, Order order)\n        {\n            return CanExecuteOrderImpl(security, order, out _);\n        }\n\n        /// <summary>\n        /// Applies the split to the specified order ticket\n        /// </summary>\n        /// <param name=\"tickets\">The open tickets matching the split event</param>\n        /// <param name=\"split\">The split event data</param>\n        public override void ApplySplit(List<OrderTicket> tickets, Split split)\n        {\n            // tradier cancels reverse splits\n            var splitFactor = split.SplitFactor;\n            if (splitFactor > 1.0m)\n            {\n                tickets.ForEach(ticket => ticket.Cancel(Messages.TradierBrokerageModel.OpenOrdersCancelOnReverseSplitSymbols));\n            }\n            else\n            {\n                base.ApplySplit(tickets, split);\n            }\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            // Trading stocks at Tradier Brokerage is free\n            return new ConstantFeeModel(0m);\n        }\n\n        private static bool IsWithinTradierExtendedSession(DateTime localTime)\n        {\n            return PreMarketSession.Contains(localTime.TimeOfDay) || PostMarketSession.Contains(localTime.TimeOfDay);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/TradingTechnologiesBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Provides properties specific to Trading Technologies\n    /// </summary>\n    public class TradingTechnologiesBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// The default markets for Trading Technologies\n        /// </summary>\n        public new static readonly IReadOnlyDictionary<SecurityType, string> DefaultMarketMap = new Dictionary<SecurityType, string>\n        {\n            {SecurityType.Future, Market.CME}\n        }.ToReadOnlyDictionary();\n\n        private readonly Type[] _supportedTimeInForces =\n        {\n            typeof(GoodTilCanceledTimeInForce),\n            typeof(DayTimeInForce)\n        };\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new()\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        };\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TradingTechnologiesBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public TradingTechnologiesBrokerageModel(AccountType accountType = AccountType.Margin)\n            : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets => DefaultMarketMap;\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public override IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            // Equivalent to no benchmark\n            return new FuncBenchmark(x => 0);\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new ConstantFeeModel(0);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (security.Type != SecurityType.Future)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n            // validate time in force\n            if (!_supportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            // validate stop orders prices\n            var stopMarket = order as StopMarketOrder;\n            if (stopMarket != null)\n            {\n                return IsValidOrderPrices(security, OrderType.StopMarket, stopMarket.Direction, stopMarket.StopPrice, security.Price, ref message);\n            }\n\n            var stopLimit = order as StopLimitOrder;\n            if (stopLimit != null)\n            {\n                return IsValidOrderPrices(security, OrderType.StopLimit, stopLimit.Direction, stopLimit.StopPrice, stopLimit.LimitPrice, ref message);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public override bool CanExecuteOrder(Security security, Order order)\n        {\n            return order.SecurityType == SecurityType.Future;\n        }\n\n        /// <summary>\n        /// Validates stopmarket/stoplimit order prices, pass security.Price for limit/stop if n/a\n        /// </summary>\n        private static bool IsValidOrderPrices(\n            Security security,\n            OrderType orderType,\n            OrderDirection orderDirection,\n            decimal stopPrice,\n            decimal limitPrice,\n            ref BrokerageMessageEvent message\n            )\n        {\n            // validate stop market order prices\n            if (orderType == OrderType.StopMarket &&\n                (orderDirection == OrderDirection.Buy && stopPrice <= security.Price ||\n                    orderDirection == OrderDirection.Sell && stopPrice >= security.Price))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.TradingTechnologiesBrokerageModel.InvalidStopMarketOrderPrice);\n\n                return false;\n            }\n\n            // validate stop limit order prices\n            if (orderType == OrderType.StopLimit)\n            {\n                if (orderDirection == OrderDirection.Buy && stopPrice <= security.Price ||\n                    orderDirection == OrderDirection.Sell && stopPrice >= security.Price)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                        Messages.TradingTechnologiesBrokerageModel.InvalidStopLimitOrderPrice);\n\n                    return false;\n                }\n\n                if (orderDirection == OrderDirection.Buy && limitPrice < stopPrice ||\n                    orderDirection == OrderDirection.Sell && limitPrice > stopPrice)\n                {\n                    message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                        Messages.TradingTechnologiesBrokerageModel.InvalidStopLimitOrderLimitPrice);\n\n                    return false;\n                }\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/WolverineBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Wolverine Brokerage model\n    /// </summary>\n    public class WolverineBrokerageModel : DefaultBrokerageModel\n    {\n        /// <summary>\n        /// Supported order types\n        /// </summary>\n        private HashSet<OrderType> SupportedOrderTypes { get; } =\n        [\n            OrderType.Market,\n            OrderType.MarketOnClose,\n            OrderType.Limit,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        ];\n\n        /// <summary>\n        /// Constructor for Wolverine brokerage model\n        /// </summary>\n        /// <param name=\"accountType\">Cash or Margin</param>\n        public WolverineBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            if (!IsValidOrderSize(security, order.Quantity, out message))\n            {\n                return false;\n            }\n\n            if (security.Type != SecurityType.Equity && security.Type != SecurityType.Option)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n                return false;\n            }\n            if (!SupportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, SupportedOrderTypes));\n                return false;\n            }\n            return base.CanSubmitOrder(security, order, out message);\n        }\n\n        /// <summary>\n        /// Wolverine does not support update of orders\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <param name=\"order\">Order that should be updated</param>\n        /// <param name=\"request\">Update request</param>\n        /// <param name=\"message\">Outgoing message</param>\n        /// <returns>Always false as Wolverine does not support update of orders</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, 0, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            return false;\n        }\n\n        /// <summary>\n        /// Provides Wolverine fee model\n        /// </summary>\n        /// <param name=\"security\">Security</param>\n        /// <returns>Wolverine fee model</returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new WolverineFeeModel();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/ZerodhaBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\n\nnamespace QuantConnect.Brokerages\n{\n    /// <summary>\n    /// Brokerage Model implementation for Zerodha\n    /// </summary>\n    public class ZerodhaBrokerageModel : DefaultBrokerageModel\n    {\n        private readonly Type[] _supportedTimeInForces =\n        {\n            typeof(GoodTilCanceledTimeInForce),\n            typeof(DayTimeInForce),\n            typeof(GoodTilDateTimeInForce)\n        };\n\n        private readonly HashSet<OrderType> _supportedOrderTypes = new HashSet<OrderType>\n        {\n            OrderType.Limit,\n            OrderType.Market,\n            OrderType.StopMarket,\n            OrderType.StopLimit\n        };\n\n        private const decimal _maxLeverage = 5m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ZerodhaBrokerageModel\"/> class\n        /// </summary>\n        /// <param name=\"accountType\">The type of account to be modelled, defaults to\n        /// <see cref=\"AccountType.Margin\"/></param>\n        public ZerodhaBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n        {\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public override bool CanExecuteOrder(Security security, Order order)\n        {\n\n            // validate security type\n            if (security.Type != SecurityType.Equity)\n            {\n                return false;\n            }\n\n\n            // validate time in force\n            if (!_supportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n\n            // validate security type\n            if (security.Type != SecurityType.Equity)\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n                return false;\n            }\n\n\n            // validate order type\n            if (!_supportedOrderTypes.Contains(order.Type))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order, _supportedOrderTypes));\n\n                return false;\n            }\n\n\n            // validate time in force\n            if (!_supportedTimeInForces.Contains(order.TimeInForce.GetType()))\n            {\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedTimeInForce(this, order));\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested update to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n             return true;\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets();\n\n        /// <summary>\n        /// Zerodha global leverage rule\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override decimal GetLeverage(Security security)\n        {\n            if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base)\n            {\n                return 1m;\n            }\n\n            if (security.Type == SecurityType.Equity || security.Type == SecurityType.Future || security.Type == SecurityType.Option || security.Type == SecurityType.Index)\n            {\n                return _maxLeverage;\n            }\n\n            throw new ArgumentException(Messages.DefaultBrokerageModel.InvalidSecurityTypeForLeverage(security), nameof(security));\n        }\n\n        /// <summary>\n        /// Provides Zerodha fee model\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <returns></returns>\n        public override IFeeModel GetFeeModel(Security security)\n        {\n            return new ZerodhaFeeModel();\n        }\n\n        private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets()\n        {\n            var map = DefaultMarketMap.ToDictionary();\n            map[SecurityType.Equity] = Market.India;\n\n            return map.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Brokerages/dYdXBrokerageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Brokerages;\n\npublic class dYdXBrokerageModel : DefaultBrokerageModel\n{\n    /// <summary>\n    /// Gets a map of the default markets to be used for each security type\n    /// </summary>\n    public override IReadOnlyDictionary<SecurityType, string> DefaultMarkets { get; } = GetDefaultMarkets(Market.DYDX);\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"dYdXBrokerageModel\"/> class\n    /// </summary>\n    /// <param name=\"accountType\">The type of account to be modeled, defaults to <see cref=\"AccountType.Margin\"/></param>\n    public dYdXBrokerageModel(AccountType accountType = AccountType.Margin) : base(accountType)\n    {\n        if (accountType != AccountType.Margin)\n        {\n            throw new ArgumentException(\"dYdXBrokerageModel only supports margin accounts\", nameof(accountType));\n        }\n    }\n\n    /// <summary>\n    /// Gets a new buying power model for the security, returning the default model with the security's configured leverage.\n    /// For cash accounts, leverage = 1 is used.\n    /// </summary>\n    /// <param name=\"security\">The security to get a buying power model for</param>\n    /// <returns>The buying power model for this brokerage/security</returns>\n    public override IBuyingPowerModel GetBuyingPowerModel(Security security)\n    {\n        return security?.Type switch\n        {\n            SecurityType.CryptoFuture => new SecurityMarginModel(GetLeverage(security)),\n            _ => base.GetBuyingPowerModel(security)\n        };\n    }\n\n    /// <summary>\n    /// Provides dYdX fee model\n    /// </summary>\n    /// <param name=\"security\"></param>\n    /// <returns></returns>\n    public override IFeeModel GetFeeModel(Security security)\n    {\n        return security.Type switch\n        {\n            SecurityType.CryptoFuture => new dYdXFeeModel(),\n            _ => base.GetFeeModel(security)\n        };\n    }\n\n    /// <summary>\n    /// Gets a new margin interest rate model for the security\n    /// </summary>\n    /// <param name=\"security\">The security to get a margin interest rate model for</param>\n    /// <returns>The margin interest rate model for this brokerage</returns>\n    public override IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n    {\n        // only applies for perpetual futures\n        return security.Type switch\n        {\n            SecurityType.CryptoFuture => new dYdXFutureMarginInterestRateModel(),\n            _ => base.GetMarginInterestRateModel(security)\n        };\n    }\n\n    /// <summary>\n    /// Get the benchmark for this model\n    /// </summary>\n    /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n    /// <returns>The benchmark for this brokerage</returns>\n    public override IBenchmark GetBenchmark(SecurityManager securities)\n    {\n        var symbol = Symbol.Create(\"BTCUSD\", SecurityType.CryptoFuture, Market.DYDX);\n        return SecurityBenchmark.CreateInstance(securities, symbol);\n        //todo default conversion?\n    }\n\n    /// <summary>\n    /// Returns true if the brokerage could accept this order update. This takes into account\n    /// order type, security type, and order size limits. dYdX can only update inverse, linear, and option orders\n    /// </summary>\n    /// <param name=\"security\">The security of the order</param>\n    /// <param name=\"order\">The order to be updated</param>\n    /// <param name=\"request\">The requested update to be made to the order</param>\n    /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n    /// <returns>True if the brokerage could update the order, false otherwise</returns>\n    public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request,\n        out BrokerageMessageEvent message)\n    {\n        message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n            Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n        return false;\n    }\n\n    /// <summary>\n    /// Returns true if the brokerage could accept this order. This takes into account\n    /// order type, security type, and order size limits.\n    /// </summary>\n    /// <remarks>\n    /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n    /// </remarks>\n    /// <param name=\"security\">The security of the order</param>\n    /// <param name=\"order\">The order to be processed</param>\n    /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n    /// <returns>True if the brokerage could process the order, false otherwise</returns>\n    public override bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n    {\n        if (security.Type != SecurityType.CryptoFuture)\n        {\n            message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                Messages.DefaultBrokerageModel.UnsupportedSecurityType(this, security));\n\n            return false;\n        }\n\n        message = null;\n        bool quantityIsValid;\n\n        switch (order)\n        {\n            case StopLimitOrder:\n            case StopMarketOrder:\n            case LimitOrder:\n            case MarketOrder:\n                quantityIsValid = IsValidOrderSize(security, Math.Abs(order.Quantity), out message);\n                break;\n            default:\n                message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\",\n                    Messages.DefaultBrokerageModel.UnsupportedOrderType(this, order,\n                        [OrderType.StopMarket, OrderType.StopLimit, OrderType.Market, OrderType.Limit]));\n                return false;\n        }\n\n        return quantityIsValid;\n    }\n\n    private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(string marketName)\n    {\n        var map = DefaultMarketMap.ToDictionary();\n        map[SecurityType.CryptoFuture] = marketName;\n        return map.ToReadOnlyDictionary();\n    }\n}\n"
  },
  {
    "path": "Common/Candlestick.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Single candlestick for a candlestick chart\n    /// </summary>\n    [JsonConverter(typeof(CandlestickJsonConverter))]\n    public class Candlestick : ISeriesPoint\n    {\n        private bool _openSet;\n        private decimal? _open;\n        private decimal? _high;\n        private decimal? _low;\n        private decimal? _close;\n\n        /// <summary>\n        /// The candlestick time\n        /// </summary>\n        public DateTime Time { get; set; }\n\n        /// <summary>\n        /// The candlestick time in seconds since Unix Epoch\n        /// </summary>\n        public long LongTime\n        {\n            get\n            {\n                return (long)QuantConnect.Time.DateTimeToUnixTimeStamp(Time);\n            }\n        }\n\n        /// <summary>\n        /// The candlestick open price\n        /// </summary>\n        public decimal? Open\n        {\n            get { return _open; }\n            set { _open = value.SmartRounding(); }\n        }\n\n        /// <summary>\n        /// The candlestick high price\n        /// </summary>\n        public decimal? High\n        {\n            get { return _high; }\n            set { _high = value.SmartRounding(); }\n        }\n\n        /// <summary>\n        /// The candlestick low price\n        /// </summary>\n        public decimal? Low\n        {\n            get { return _low; }\n            set { _low = value.SmartRounding(); }\n        }\n\n        /// <summary>\n        /// The candlestick close price\n        /// </summary>\n        public decimal? Close\n        {\n            get { return _close; }\n            set { _close = value.SmartRounding(); }\n        }\n\n        /// <summary>\n        /// Default constructor\n        /// </summary>\n        public Candlestick() { }\n\n        /// <summary>\n        /// Constructor taking the candlestick values\n        /// </summary>\n        /// <param name=\"time\">Candlestick time in seconds since Unix Epoch</param>\n        /// <param name=\"open\">Candlestick open price</param>\n        /// <param name=\"high\">Candlestick high price</param>\n        /// <param name=\"low\">Candlestick low price</param>\n        /// <param name=\"close\">Candlestick close price</param>\n        public Candlestick(long time, decimal? open, decimal? high, decimal? low, decimal? close)\n            : this(QuantConnect.Time.UnixTimeStampToDateTime(time), open, high, low, close)\n        {\n        }\n\n        /// <summary>\n        /// Constructor taking candlestick values and time in DateTime format\n        /// </summary>\n        /// <param name=\"time\">Candlestick time in seconds</param>\n        /// <param name=\"open\">Candlestick open price</param>\n        /// <param name=\"high\">Candlestick high price</param>\n        /// <param name=\"low\">Candlestick low price</param>\n        /// <param name=\"close\">Candlestick close price</param>\n        public Candlestick(DateTime time, decimal? open, decimal? high, decimal? low, decimal? close)\n        {\n            Time = time;\n            Open = open;\n            High = high;\n            Low = low;\n            Close = close;\n        }\n\n        /// <summary>\n        /// Constructor taking candlestick values and time in DateTime format\n        /// </summary>\n        /// <param name=\"bar\">Bar which data will be used to create the candlestick</param>\n        public Candlestick(TradeBar bar)\n            : this(bar.EndTime, bar.Open, bar.High, bar.Low, bar.Close)\n        {\n        }\n\n        /// <summary>\n        /// Constructor taking candlestick values and time in DateTime format\n        /// </summary>\n        /// <param name=\"time\">Candlestick time in seconds</param>\n        /// <param name=\"bar\">Bar which data will be used to create the candlestick</param>\n        public Candlestick(DateTime time, Bar bar)\n            : this(time, bar.Open, bar.High, bar.Low, bar.Close)\n        {\n        }\n\n        /// <summary>\n        /// Copy constructor\n        /// </summary>\n        /// <param name=\"candlestick\">Candlestick to copy from</param>\n        public Candlestick(Candlestick candlestick)\n            : this(candlestick.Time, candlestick.Open, candlestick.High, candlestick.Low, candlestick.Close)\n        {\n        }\n\n        /// <summary>\n        /// Provides a readable string representation of this instance.\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.Candlestick.ToString(this);\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        /// <returns>Clone of this instance</returns>\n        public ISeriesPoint Clone()\n        {\n            return new Candlestick(this);\n        }\n\n        /// <summary>\n        /// Updates the candlestick with a new value. This will aggregate the OHLC bar\n        /// </summary>\n        /// <param name=\"value\">The new value</param>\n        public void Update(decimal? value)\n        {\n            if (value.HasValue)\n            {\n                Update(value.Value);\n            }\n        }\n\n        /// <summary>\n        /// Updates the candlestick with a new value. This will aggregate the OHLC bar\n        /// </summary>\n        /// <param name=\"value\">The new value</param>\n        public void Update(decimal value)\n        {\n            if (!_openSet)\n            {\n                Open = High = Low = Close = value;\n                _openSet = true;\n            }\n            else if (value > High) High = value;\n            else if (value < Low) Low = value;\n            Close = value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/CandlestickSeries.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System;\nusing QuantConnect.Data.Market;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Candlestick Chart Series Object - Series data and properties for a candlestick chart\n    /// </summary>\n    [JsonConverter(typeof(SeriesJsonConverter))]\n    public class CandlestickSeries : BaseSeries\n    {\n        /// <summary>\n        /// Default constructor for chart series\n        /// </summary>\n        public CandlestickSeries() : base()\n        {\n            SeriesType = SeriesType.Candle;\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        public CandlestickSeries(string name)\n            : base(name, SeriesType.Candle)\n        {\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"index\">Index position on the chart of the series</param>\n        public CandlestickSeries(string name, int index)\n            : this(name, index, \"$\")\n        {\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"index\">Index position on the chart of the series</param>\n        /// <param name=\"unit\">Unit for the series axis</param>\n        public CandlestickSeries(string name, int index, string unit)\n            : this(name, unit)\n        {\n            Index = index;\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"unit\">Unit of the series</param>\n        public CandlestickSeries(string name, string unit)\n            : base(name, SeriesType.Candle, unit)\n        {\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"time\">Time of the chart point</param>\n        /// <param name=\"open\">Candlestick open price</param>\n        /// <param name=\"high\">Candlestick high price</param>\n        /// <param name=\"low\">Candlestick low price</param>\n        /// <param name=\"close\">Candlestick close price</param>\n        public void AddPoint(DateTime time, decimal open, decimal high, decimal low, decimal close)\n        {\n            base.AddPoint(new Candlestick(time, open, high, low, close));\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        public void AddPoint(TradeBar bar)\n        {\n            base.AddPoint(new Candlestick(bar));\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"point\">The data point to add</param>\n        public override void AddPoint(ISeriesPoint point)\n        {\n            if (point as Candlestick == null)\n            {\n                throw new ArgumentException(\"CandlestickSeries.AddPoint requires a Candlestick object\");\n            }\n\n            base.AddPoint(point);\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"time\">The time of the data point</param>\n        /// <param name=\"values\">The values of the data point</param>\n        public override void AddPoint(DateTime time, List<decimal> values)\n        {\n            if (values.Count != 4)\n            {\n                throw new ArgumentException(\"CandlestickSeries.AddPoint requires 4 values (open, high, low, close)\");\n            }\n\n            base.AddPoint(new Candlestick(time, values[0], values[1], values[2], values[3]));\n        }\n\n        /// <summary>\n        /// Will sum up all candlesticks into a new single one, using the time of latest point\n        /// </summary>\n        /// <returns>The new candlestick</returns>\n        public override ISeriesPoint ConsolidateChartPoints()\n        {\n            if (Values.Count <= 0) return null;\n\n            decimal? openSum = null;\n            decimal? highSum = null;\n            decimal? lowSum = null;\n            decimal? closeSum = null;\n            foreach (Candlestick point in Values)\n            {\n                if (point.Open.HasValue)\n                {\n                    openSum ??= 0;\n                    openSum += point.Open.Value;\n                }\n                if (point.High.HasValue)\n                {\n                    highSum ??= 0;\n                    highSum += point.High.Value;\n                }\n                if (point.Low.HasValue)\n                {\n                    lowSum ??= 0;\n                    lowSum += point.Low.Value;\n                }\n                if (point.Close.HasValue)\n                {\n                    closeSum ??= 0;\n                    closeSum += point.Close.Value;\n                }\n            }\n\n            var lastCandlestick = Values[Values.Count - 1];\n            return new Candlestick(lastCandlestick.Time, openSum, highSum, lowSum, closeSum);\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        /// <returns></returns>\n        public override BaseSeries Clone(bool empty = false)\n        {\n            var series = new CandlestickSeries(Name, Index, Unit) { ZIndex = ZIndex, IndexName = IndexName, Tooltip = Tooltip };\n\n            if (!empty)\n            {\n                series.Values = CloneValues();\n            }\n\n            return series;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/CapacityEstimate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Estimates dollar volume capacity of algorithm (in account currency) using all Symbols in the portfolio.\n    /// </summary>\n    /// <remarks>\n    /// Any mention of dollar volume is volume in account currency, but \"dollar volume\" is used\n    /// to maintain consistency with financial terminology and our use\n    /// case of having alphas measured capacity be in USD.\n    /// </remarks>\n    public class CapacityEstimate\n    {\n        private readonly IAlgorithm _algorithm;\n        private readonly Dictionary<Symbol, SymbolCapacity> _capacityBySymbol;\n        private List<SymbolCapacity> _monitoredSymbolCapacity;\n        // We use multiple collections to avoid having to perform an O(n) lookup whenever\n        // we're wanting to check whether a particular SymbolData instance is being \"monitored\",\n        // but still want to preserve indexing via an integer index\n        // (monitored meaning it is currently aggregating market dollar volume for its capacity calculation).\n        // For integer indexing, we use the List above, v.s. for lookup we use this HashSet.\n        private HashSet<SymbolCapacity> _monitoredSymbolCapacitySet;\n        private DateTime _nextSnapshotDate;\n        private TimeSpan _snapshotPeriod;\n        private Symbol _smallestAssetSymbol;\n\n        /// <summary>\n        /// Private capacity member, We wrap this value type because it's being\n        /// read and written by multiple threads.\n        /// </summary>\n        private ReferenceWrapper<decimal> _capacity;\n\n        /// <summary>\n        /// The total capacity of the strategy at a point in time\n        /// </summary>\n        public decimal Capacity\n        {\n            // Round our capacity to the nearest 1000\n            get => _capacity.Value.DiscretelyRoundBy(1000.00m);\n            private set => _capacity = new ReferenceWrapper<decimal>(value);\n        }\n\n        /// <summary>\n        /// Provide a reference to the lowest capacity symbol used in scaling down the capacity for debugging.\n        /// </summary>\n        public Symbol LowestCapacityAsset => _smallestAssetSymbol; \n\n        /// <summary>\n        /// Initializes an instance of the class.\n        /// </summary>\n        /// <param name=\"algorithm\">Used to get data at the current time step and access the portfolio state</param>\n        public CapacityEstimate(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n            _capacityBySymbol = new Dictionary<Symbol, SymbolCapacity>();\n            _monitoredSymbolCapacity = new List<SymbolCapacity>();\n            _monitoredSymbolCapacitySet = new HashSet<SymbolCapacity>();\n            // Set the minimum snapshot period to one day, but use algorithm start/end if the algo runtime is less than seven days\n            _snapshotPeriod = TimeSpan.FromDays(Math.Max(Math.Min((_algorithm.EndDate - _algorithm.StartDate).TotalDays - 1, 7), 1)); \n            _nextSnapshotDate = _algorithm.StartDate + _snapshotPeriod;\n            _capacity = new ReferenceWrapper<decimal>(0);\n        }\n\n        /// <summary>\n        /// Processes an order whenever it's encountered so that we can calculate the capacity\n        /// </summary>\n        /// <param name=\"orderEvent\">Order event to use to calculate capacity</param>\n        public void OnOrderEvent(OrderEvent orderEvent)\n        {\n            if (orderEvent.Status != OrderStatus.Filled && orderEvent.Status != OrderStatus.PartiallyFilled)\n            {\n                return;\n            }\n\n            SymbolCapacity symbolCapacity;\n            if (!_capacityBySymbol.TryGetValue(orderEvent.Symbol, out symbolCapacity))\n            {\n                symbolCapacity = new SymbolCapacity(_algorithm, orderEvent.Symbol);\n                _capacityBySymbol[orderEvent.Symbol] = symbolCapacity;\n            }\n\n            symbolCapacity.OnOrderEvent(orderEvent);\n            if (_monitoredSymbolCapacitySet.Contains(symbolCapacity))\n            {\n                return;\n            }\n\n            _monitoredSymbolCapacity.Add(symbolCapacity);\n            _monitoredSymbolCapacitySet.Add(symbolCapacity);\n        }\n\n        #pragma warning disable CS1574\n        /// <summary>\n        /// Updates the market capacity for any Symbols that require a market update.\n        /// Sometimes, after the specified <seealso cref=\"_snapshotPeriod\"/>, we\n        /// take a \"snapshot\" (point-in-time capacity) of the portfolio's capacity.\n        ///\n        /// This result will be written into the Algorithm Statistics via the <see cref=\"BacktestingResultHandler\"/>\n        /// </summary>\n        #pragma warning restore CS1574\n        public void UpdateMarketCapacity(bool forceProcess)\n        {\n            for (var i = _monitoredSymbolCapacity.Count - 1; i >= 0; --i)\n            {\n                var capacity = _monitoredSymbolCapacity[i];\n                if (capacity.UpdateMarketCapacity())\n                {\n                    _monitoredSymbolCapacity.RemoveAt(i);\n                    _monitoredSymbolCapacitySet.Remove(capacity);\n                }\n            }\n\n            var utcDate = _algorithm.UtcTime.Date;\n            if (forceProcess || utcDate >= _nextSnapshotDate && _capacityBySymbol.Count != 0)\n            {\n                var totalPortfolioValue = _algorithm.Portfolio.TotalPortfolioValue;\n                var totalSaleVolume = _capacityBySymbol.Values\n                    .Sum(s => s.SaleVolume);\n\n                if (totalPortfolioValue == 0 || _capacityBySymbol.Count == 0)\n                {\n                    return;\n                }\n\n                var smallestAsset = _capacityBySymbol.Values\n                    .OrderBy(c => c.MarketCapacityDollarVolume)\n                    .First();\n\n                _smallestAssetSymbol = smallestAsset.Security.Symbol;\n\n                // When there is no trading, rely on the portfolio holdings\n                var percentageOfSaleVolume = totalSaleVolume != 0\n                    ? smallestAsset.SaleVolume / totalSaleVolume\n                    : 0;\n\n                var buyingPowerUsed = smallestAsset.Security.MarginModel.GetReservedBuyingPowerForPosition(new ReservedBuyingPowerForPositionParameters(smallestAsset.Security))\n                    .AbsoluteUsedBuyingPower * smallestAsset.Security.Leverage;\n\n                var percentageOfHoldings = buyingPowerUsed / totalPortfolioValue;\n\n                var scalingFactor = Math.Max(percentageOfSaleVolume, percentageOfHoldings);\n                var dailyMarketCapacityDollarVolume = smallestAsset.MarketCapacityDollarVolume / smallestAsset.Trades;\n\n                var newCapacity = scalingFactor == 0\n                    ? _capacity.Value\n                    : dailyMarketCapacityDollarVolume / scalingFactor;\n\n                // Weight our capacity based on previous value if we have one\n                if (_capacity.Value != 0)\n                {\n                    newCapacity = (0.33m * newCapacity) + (_capacity.Value * 0.66m);\n                }\n\n                // Set our new capacity value\n                Capacity = newCapacity;\n\n                foreach (var capacity in _capacityBySymbol.Select(pair => pair.Value).ToList())\n                {\n                    if (!capacity.ShouldRemove())\n                    {\n                        capacity.Reset();\n                        continue;\n                    }\n\n                    // we remove non invested and non tradable (delisted, deselected) securities this will allow the 'smallestAsset'\n                    // to be changing between snapshots, and avoid the collections to grow\n                    _capacityBySymbol.Remove(capacity.Security.Symbol);\n                    _monitoredSymbolCapacity.Remove(capacity);\n                    _monitoredSymbolCapacitySet.Remove(capacity);\n                }\n\n                _nextSnapshotDate = utcDate + _snapshotPeriod;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Chart.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Data;\nusing System.Drawing;\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Single Parent Chart Object for Custom Charting\n    /// </summary>\n    public class Chart\n    {\n        /// <summary>\n        /// Name of the Chart\n        /// </summary>\n        public string Name { get; set; } = string.Empty;\n\n        /// Type of the Chart, Overlayed or Stacked.\n        [Obsolete(\"ChartType is now obsolete. Please use Series indexes instead by setting index in the series constructor.\")]\n        public ChartType ChartType { get; set; } = ChartType.Overlay;\n\n        /// List of Series Objects for this Chart:\n        [JsonConverter(typeof(ChartSeriesJsonConverter))]\n        public Dictionary<string, BaseSeries> Series { get; set; } = new();\n\n        /// <summary>\n        /// Associated symbol if any, making this an asset plot\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// True to hide this series legend from the chart\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public bool LegendDisabled { get; set; }\n\n        /// <summary>\n        /// Default constructor for chart:\n        /// </summary>\n        public Chart() { }\n\n        /// <summary>\n        /// Chart Constructor:\n        /// </summary>\n        /// <param name=\"name\">Name of the Chart</param>\n        /// <param name=\"type\"> Type of the chart</param>\n        [Obsolete(\"ChartType is now obsolete and ignored in charting. Please use Series indexes instead by setting index in the series constructor.\")]\n        public Chart(string name, ChartType type = ChartType.Overlay)\n        {\n            Name = name;\n            Series = new Dictionary<string, BaseSeries>();\n            ChartType = type;\n        }\n\n        /// <summary>\n        /// Constructor for a chart\n        /// </summary>\n        /// <param name=\"name\">String name of the chart</param>\n        public Chart(string name) : this(name, null)\n        {\n        }\n\n        /// <summary>\n        /// Constructor for a chart\n        /// </summary>\n        /// <param name=\"name\">String name of the chart</param>\n        /// <param name=\"symbol\">Associated symbol if any</param>\n        public Chart(string name, Symbol symbol)\n        {\n            Name = name;\n            Symbol = symbol;\n            Series = new Dictionary<string, BaseSeries>();\n        }\n\n        /// <summary>\n        /// Add a reference to this chart series:\n        /// </summary>\n        /// <param name=\"series\">Chart series class object</param>\n        public void AddSeries(BaseSeries series)\n        {\n            //If we dont already have this series, add to the chrt:\n            if (!Series.TryAdd(series.Name, series))\n            {\n                throw new DuplicateNameException($\"Chart.AddSeries(): ${Messages.Chart.ChartSeriesAlreadyExists}\");\n            }\n        }\n\n        /// <summary>\n        /// Gets Series if already present in chart, else will add a new series and return it\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"type\">Type of the series</param>\n        /// <param name=\"index\">Index position on the chart of the series</param>\n        /// <param name=\"unit\">Unit for the series axis</param>\n        /// <param name=\"color\">Color of the series</param>\n        /// <param name=\"symbol\">Symbol for the marker in a scatter plot series</param>\n        /// <param name=\"forceAddNew\">True will always add a new Series instance, stepping on existing if any</param>\n        public Series TryAddAndGetSeries(string name, SeriesType type, int index, string unit,\n                                      Color color, ScatterMarkerSymbol symbol, bool forceAddNew = false)\n        {\n            BaseSeries series;\n            if (forceAddNew || !Series.TryGetValue(name, out series))\n            {\n                series = new Series(name, type, index, unit)\n                {\n                    Color = color,\n                    ScatterMarkerSymbol = symbol\n                };\n                Series[name] = series;\n            }\n\n            return (Series)series;\n        }\n\n        /// <summary>\n        /// Gets Series if already present in chart, else will add a new series and return it\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"templateSeries\">Series to be used as a template. It will be clone without values if the series is added to the chart</param>\n        /// <param name=\"forceAddNew\">True will always add a new Series instance, stepping on existing if any</param>\n        public BaseSeries TryAddAndGetSeries(string name, BaseSeries templateSeries, bool forceAddNew = false)\n        {\n            BaseSeries chartSeries;\n            if (forceAddNew || !Series.TryGetValue(name, out chartSeries))\n            {\n                Series[name] = chartSeries = templateSeries.Clone(empty: true);\n            }\n\n            return chartSeries;\n        }\n\n        /// <summary>\n        /// Fetch a chart with only the updates since the last request,\n        /// Underlying series will save the index position.\n        /// </summary>\n        /// <returns></returns>\n        public Chart GetUpdates()\n        {\n            var copy = CloneEmpty();\n            try\n            {\n                foreach (var series in Series.Values)\n                {\n                    copy.AddSeries(series.GetUpdates());\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return copy;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        /// <returns></returns>\n        public virtual Chart Clone()\n        {\n            var chart = CloneEmpty();\n\n            foreach (var kvp in Series)\n            {\n                chart.Series.Add(kvp.Key, kvp.Value.Clone());\n            }\n\n            return chart;\n        }\n\n        /// <summary>\n        /// Return a new empty instance clone of this object\n        /// </summary>\n        public virtual Chart CloneEmpty()\n        {\n            return new Chart(Name) { LegendDisabled = LegendDisabled, Symbol = Symbol };\n        }\n\n        /// <summary>\n        /// Helper method to consolidate a chart into a single series chart by summing all values\n        /// </summary>\n        public virtual Chart Aggregate(SeriesType seriesType = SeriesType.Line)\n        {\n            var newChart = CloneEmpty();\n            if (Series == null || Series.Count == 0)\n            {\n                return newChart;\n            }\n\n            var referenceSeries = Series.Values.First();\n            var aggregatedSeries = new Series(\"TOTAL\", seriesType, referenceSeries.Unit);\n            newChart.AddSeries(aggregatedSeries);\n            var aggregatedPoints = new Dictionary<long, decimal>(referenceSeries.Values.Count * Series.Count);\n            foreach (var point in Series.Values.SelectMany(x => x.Values.OfType<ChartPoint>()))\n            {\n                if (point.Y.HasValue)\n                {\n                    aggregatedPoints[point.X] = point.Y.Value + aggregatedPoints.GetValueOrDefault(point.X);\n                }\n            }\n\n            foreach (var kvp in aggregatedPoints.OrderBy(x => x.Key))\n            {\n                aggregatedSeries.Values.Add(new ChartPoint(kvp.Key, kvp.Value));\n            }\n            return newChart;\n        }\n    }\n\n    /// <summary>\n    /// Type of chart - should we draw the series as overlayed or stacked\n    /// </summary>\n    public enum ChartType\n    {\n        /// Overlayed stacked (0)\n        Overlay,\n        /// Stacked series on top of each other. (1)\n        Stacked\n    }\n}\n"
  },
  {
    "path": "Common/ChartPoint.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Single Chart Point Value Type for QCAlgorithm.Plot();\n    /// </summary>\n    [JsonConverter(typeof(ChartPointJsonConverter))]\n    public class ChartPoint : ISeriesPoint\n    {\n        private DateTime _time;\n        private long _x;\n        private decimal? _y;\n\n        /// <summary>\n        /// Time of this chart series point\n        /// </summary>\n        [JsonIgnore]\n        public DateTime Time\n        {\n            get\n            {\n                return _time;\n            }\n            set\n            {\n                _time = value;\n                _x = Convert.ToInt64(QuantConnect.Time.DateTimeToUnixTimeStamp(_time));\n            }\n        }\n\n        /// <summary>\n        /// Chart point time\n        /// </summary>\n        /// <remarks>Lower case for javascript encoding simplicity</remarks>\n        public long x\n        {\n            get\n            {\n                return _x;\n            }\n            set\n            {\n                _time = QuantConnect.Time.UnixTimeStampToDateTime(value);\n                _x = value;\n            }\n        }\n\n        /// <summary>\n        /// Chart point value\n        /// </summary>\n        /// <remarks>Lower case for javascript encoding simplicity</remarks>\n        public decimal? y\n        {\n            get\n            {\n                return _y;\n            }\n            set\n            {\n                _y = value.SmartRounding();\n            }\n        }\n\n        /// <summary>\n        /// Shortcut for <see cref=\"x\"/> for C# naming conventions\n        /// </summary>\n        [JsonIgnore]\n        public long X => x;\n\n        /// <summary>\n        /// Shortcut for <see cref=\"y\"/> for C# naming conventions\n        /// </summary>\n        [JsonIgnore]\n        public decimal? Y => y;\n\n        /// <summary>\n        /// Default constructor. Using in SeriesSampler.\n        /// </summary>\n        public ChartPoint() { }\n\n        /// <summary>\n        /// Constructor that takes both x, y value pairs\n        /// </summary>\n        /// <param name=\"xValue\">X value often representing a time in seconds</param>\n        /// <param name=\"yValue\">Y value</param>\n        public ChartPoint(long xValue, decimal? yValue)\n            : this()\n        {\n            x = xValue;\n            y = yValue;\n        }\n\n        /// <summary>\n        /// Constructor that takes both x, y value pairs\n        /// </summary>\n        /// <param name=\"time\">This point time</param>\n        /// <param name=\"value\">Y value</param>\n        public ChartPoint(DateTime time, decimal? value)\n            : this()\n        {\n            Time = time;\n            y = value;\n        }\n\n        ///Cloner Constructor:\n        public ChartPoint(ChartPoint point)\n        {\n            _time = point._time;\n            _x = point._x;\n            _y = point._y;\n        }\n\n        /// <summary>\n        /// Provides a readable string representation of this instance.\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.ChartPoint.ToString(this);\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        /// <returns>Clone of this instance</returns>\n        public virtual ISeriesPoint Clone()\n        {\n            return new ChartPoint(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/ChartSeriesJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Convert a Chart Series to and from JSON\n    /// </summary>\n    public class ChartSeriesJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// This converter wont be used to read JSON. Will throw exception if manually called.\n        /// </summary>\n        public override bool CanRead => false;\n\n        /// <summary>\n        /// Indicates whether the given object type can be converted into Chart Series\n        /// </summary>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(Dictionary<string, BaseSeries>).IsAssignableFrom(objectType);\n        }\n\n        /// <summary>\n        /// Converts a Chart Series object into a JSON file\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var series = value as Dictionary<string, BaseSeries>;\n            if (series == null)\n            {\n                return;\n            }\n\n            writer.WriteStartObject();\n            // we sort the series in ascending count so that they are chart nicely, has value for stacked area series so they're continuous \n            foreach (var kvp in series.OrderBy(x => x.Value.Index)\n                .ThenBy(x => x.Value.Values.Count)\n                .ThenBy(x => x.Value.Values.Select(x => (x as ChartPoint)?.Y ?? 0).Sum()))\n            {\n                writer.WritePropertyName(kvp.Key);\n                writer.WriteRawValue(JsonConvert.SerializeObject(kvp.Value));\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Converts a JSON file into a Chart Series object\n        /// </summary>\n        /// <remarks>Throws NotImplementedException</remarks>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/AddSecurityCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command to add a security to the algorithm\n    /// </summary>\n    public class AddSecurityCommand : BaseCommand\n    {\n        /// <summary>\n        /// The security type of the security\n        /// </summary>\n        public SecurityType SecurityType { get; set; }\n\n        /// <summary>\n        /// The security's ticker symbol\n        /// </summary>\n        public string Symbol { get; set; }\n\n        /// <summary>\n        /// The requested resolution, defaults to Resolution.Minute\n        /// </summary>\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// The security's market, defaults to <see cref=\"QuantConnect.Market.USA\"/> except for Forex, defaults to <see cref=\"QuantConnect.Market.FXCM\"/>\n        /// </summary>\n        public string Market { get; set; }\n\n        /// <summary>\n        /// The fill forward behavior, true to fill forward, false otherwise - defaults to true\n        /// </summary>\n        public bool FillDataForward { get; set; }\n\n        /// <summary>\n        /// The leverage for the security, defaults to 2 for equity, 50 for forex, and 1 for everything else\n        /// </summary>\n        public decimal Leverage { get; set; }\n\n        /// <summary>\n        /// The extended market hours flag, true to allow pre/post market data, false for only in market data\n        /// </summary>\n        public bool ExtendedMarketHours { get; set; }\n\n        /// <summary>\n        /// Default construct that applies default values\n        /// </summary>\n        public AddSecurityCommand()\n        {\n            Resolution = Resolution.Minute;\n            Market = null;\n            FillDataForward = true;\n            Leverage = Security.NullLeverage;\n            ExtendedMarketHours = false;\n        }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            var security = algorithm.AddSecurity(SecurityType, Symbol, Resolution, Market, FillDataForward, Leverage, ExtendedMarketHours);\n            return new Result(this, true, security.Symbol);\n        }\n\n        /// <summary>\n        /// Result packet type for the <see cref=\"AddSecurityCommand\"/> command\n        /// </summary>\n        public class Result : CommandResultPacket\n        {\n            /// <summary>\n            /// The symbol result from the add security command\n            /// </summary>\n            public Symbol Symbol { get; set; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"Result\"/> class\n            /// </summary>\n            public Result(AddSecurityCommand command, bool success, Symbol symbol)\n                : base(command, success)\n            {\n                Symbol = symbol;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/AlgorithmStatusCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command that will change the algorithm's status\n    /// </summary>\n    public class AlgorithmStatusCommand : BaseCommand\n    {\n        /// <summary>\n        /// Gets or sets the algorithm status\n        /// </summary>\n        public AlgorithmStatus Status { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmStatusCommand\"/>\n        /// </summary>\n        public AlgorithmStatusCommand()\n        {\n            Status = AlgorithmStatus.Running;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmStatusCommand\"/> with\n        /// the specified status\n        /// </summary>\n        public AlgorithmStatusCommand(AlgorithmStatus status)\n        {\n            Status = status;\n        }\n\n        /// <summary>\n        /// Sets the algorithm's status to <see cref=\"Status\"/>\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            algorithm.Status = Status;\n            return new CommandResultPacket(this, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/BaseCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Base command implementation\n    /// </summary>\n    public abstract class BaseCommand : ICommand\n    {\n        /// <summary>\n        /// Unique command id\n        /// </summary>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public abstract CommandResultPacket Run(IAlgorithm algorithm);\n\n        /// <summary>\n        /// Creats symbol using symbol properties.\n        /// </summary>\n        /// <param name=\"ticker\">The string ticker symbol</param>\n        /// <param name=\"securityType\">The security type of the ticker. If securityType == Option, then a canonical symbol is created</param>\n        /// <param name=\"market\">The market the ticker resides in</param>\n        /// <param name=\"symbol\">The algorithm to run this command against</param>\n        /// <exception cref=\"ArgumentException\">If symbol is null or symbol can't be created with given args</exception>\n        protected Symbol GetSymbol(string ticker, SecurityType securityType, string market, Symbol symbol = null)\n        {\n            if (symbol != null)\n            {\n                // No need to create symbol if alrady exists\n                return symbol;\n            }\n            if (ticker != null && (securityType != null && securityType != SecurityType.Base) && market != null)\n            {\n                return Symbol.Create(ticker, securityType, market);\n            }\n            else\n            {\n                throw new ArgumentException($\"BaseCommand.GetSymbol(): {Messages.BaseCommand.MissingValuesToGetSymbol}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/BaseCommandHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Base algorithm command handler\n    /// </summary>\n    public abstract class BaseCommandHandler : ICommandHandler\n    {\n        /// <summary>\n        /// Command json settings\n        /// </summary>\n        protected static readonly JsonSerializerSettings Settings = new() { TypeNameHandling = TypeNameHandling.All };\n\n        /// <summary>\n        /// The algorithm instance\n        /// </summary>\n        protected IAlgorithm Algorithm { get; set; }\n\n        /// <summary>\n        /// Initializes this command queue for the specified job\n        /// </summary>\n        /// <param name=\"job\">The job that defines what queue to bind to</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public virtual void Initialize(AlgorithmNodePacket job, IAlgorithm algorithm)\n        {\n            Algorithm = algorithm;\n        }\n\n        /// <summary>\n        /// Get the commands to run\n        /// </summary>\n        protected abstract IEnumerable<ICommand> GetCommands();\n\n        /// <summary>\n        /// Acknowledge a command that has been executed\n        /// </summary>\n        /// <param name=\"command\">The command that was executed</param>\n        /// <param name=\"commandResultPacket\">The result</param>\n        protected virtual void Acknowledge(ICommand command, CommandResultPacket commandResultPacket)\n        {\n            // nop\n        }\n\n        /// <summary>\n        /// Will consumer and execute any command in the queue\n        /// </summary>\n        public IEnumerable<CommandResultPacket> ProcessCommands()\n        {\n            List<CommandResultPacket> resultPackets = null;\n            try\n            {\n                foreach (var command in GetCommands().Where(c => c != null))\n                {\n                    Log.Trace($\"BaseCommandHandler.ProcessCommands(): {Messages.BaseCommandHandler.ExecutingCommand(command)}\");\n                    CommandResultPacket result;\n                    try\n                    {\n                        result = command.Run(Algorithm);\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err);\n                        Algorithm.Error($\"{command.GetType().Name} Error: {err.Message}\");\n                        result = new CommandResultPacket(command, false);\n                    }\n\n                    Acknowledge(command, result);\n\n                    if(resultPackets == null)\n                    {\n                        resultPackets = new List<CommandResultPacket>();\n                    }\n                    resultPackets.Add(result);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return resultPackets ?? Enumerable.Empty<CommandResultPacket>();\n        }\n\n        /// <summary>\n        /// Disposes of this instance\n        /// </summary>\n        public virtual void Dispose()\n        {\n            // nop\n        }\n\n        /// <summary>\n        /// Helper method to create a callback command\n        /// </summary>\n        protected ICommand TryGetCallbackCommand(string payload)\n        {\n            Dictionary<string, JToken> deserialized = new(StringComparer.InvariantCultureIgnoreCase);\n            try\n            {\n                if (!string.IsNullOrEmpty(payload))\n                {\n                    var jobject = JObject.Parse(payload);\n                    foreach (var kv in jobject)\n                    {\n                        deserialized[kv.Key] = kv.Value;\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, $\"Payload: '{payload}'\");\n                return null;\n            }\n\n            if (!deserialized.TryGetValue(\"id\", out var id) || id == null)\n            {\n                id = string.Empty;\n            }\n\n            if (!deserialized.TryGetValue(\"$type\", out var type) || type == null)\n            {\n                type = string.Empty;\n            }\n\n            return new CallbackCommand { Id = id.ToString(), Type = type.ToString(), Payload = payload };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/CallbackCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Algorithm callback command type\n    /// </summary>\n    public class CallbackCommand : BaseCommand\n    {\n        /// <summary>\n        /// The target command type to run, if empty or null will be the generic untyped command handler\n        /// </summary>\n        public string Type { get; set; }\n\n        /// <summary>\n        /// The command payload\n        /// </summary>\n        public string Payload { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            if (string.IsNullOrEmpty(Type))\n            {\n                // target is the untyped algorithm handler\n                var result = algorithm.OnCommand(string.IsNullOrEmpty(Payload) ? null : JsonConvert.DeserializeObject<Command>(Payload));\n                return new CommandResultPacket(this, result);\n            }\n            return algorithm.RunCommand(this);\n        }\n\n        /// <summary>\n        /// The command string representation\n        /// </summary>\n        public override string ToString()\n        {\n            if (!string.IsNullOrEmpty(Type))\n            {\n                return Type;\n            }\n            return \"OnCommand\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/CancelOrderCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command to cancel a specific order by id\n    /// </summary>\n    public class CancelOrderCommand : BaseCommand\n    {\n        /// <summary>\n        /// Gets or sets the order id to be cancelled\n        /// </summary>\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            var ticket = algorithm.Transactions.CancelOrder(OrderId);\n            return ticket.CancelRequest != null && ticket.Status != Orders.OrderStatus.Invalid\n                ? new Result(this, true, ticket.QuantityFilled)\n                : new Result(this, false, ticket.QuantityFilled);\n        }\n\n        /// <summary>\n        /// Result packet type for the <see cref=\"CancelOrderCommand\"/> command\n        /// </summary>\n        public class Result : CommandResultPacket\n        {\n            /// <summary>\n            /// Gets or sets the quantity filled on the cancelled order\n            /// </summary>\n            public decimal QuantityFilled { get; set; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"Result\"/> class\n            /// </summary>\n            public Result(ICommand command, bool success, decimal quantityFilled)\n                : base(command, success)\n            {\n                QuantityFilled = quantityFilled;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/Command.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Dynamic;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing System.Reflection;\nusing Newtonsoft.Json.Linq;\nusing System.Linq.Expressions;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Base generic dynamic command class\n    /// </summary>\n    public class Command : DynamicObject\n    {\n        private static readonly MethodInfo SetPropertyMethodInfo = typeof(Command).GetMethod(\"SetProperty\");\n        private static readonly MethodInfo GetPropertyMethodInfo = typeof(Command).GetMethod(\"GetProperty\");\n\n        private readonly Dictionary<string, object> _storage = new(StringComparer.InvariantCultureIgnoreCase);\n\n        /// <summary>\n        /// Useful to string representation in python\n        /// </summary>\n        protected string PayloadData { get; set; }\n\n        /// <summary>\n        /// Get the metaObject required for Dynamism.\n        /// </summary>\n        public sealed override DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new SerializableDynamicMetaObject(parameter, this, SetPropertyMethodInfo, GetPropertyMethodInfo);\n        }\n\n        /// <summary>\n        /// Sets the property with the specified name to the value. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to set</param>\n        /// <param name=\"value\">The new property value</param>\n        /// <returns>Returns the input value back to the caller</returns>\n        public object SetProperty(string name, object value)\n        {\n            if (value is JArray jArray)\n            {\n                return _storage[name] = jArray.ToObject<List<object>>();\n            }\n            else if (value is JObject jobject)\n            {\n                return _storage[name] = jobject.ToObject<Dictionary<string, object>>();\n            }\n            else\n            {\n                return _storage[name] = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the property's value with the specified name. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to access</param>\n        /// <returns>object value of BaseData</returns>\n        public object GetProperty(string name)\n        {\n            if (!_storage.TryGetValue(name, out var value))\n            {\n                var type = GetType();\n                if (type != typeof(Command))\n                {\n                    var propertyInfo = type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance);\n                    if (propertyInfo != null)\n                    {\n                        return propertyInfo.GetValue(this, null);\n                    }\n                    var fieldInfo = type.GetField(name, BindingFlags.Public | BindingFlags.Instance);\n                    if (fieldInfo != null)\n                    {\n                        return fieldInfo.GetValue(this);\n                    }\n                }\n                return null;\n            }\n            return value;\n        }\n\n        /// <summary>\n        /// Run this command using the target algorithm\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>True if success, false otherwise. Returning null will disable command feedback</returns>\n        public virtual bool? Run(IAlgorithm algorithm)\n        {\n            throw new NotImplementedException($\"Please implement the 'def run(algorithm) -> bool | None:' method\");\n        }\n\n        /// <summary>\n        /// The string representation of this command\n        /// </summary>\n        public override string ToString()\n        {\n            if (!string.IsNullOrEmpty(PayloadData))\n            {\n                return PayloadData;\n            }\n            return JsonConvert.SerializeObject(this);\n        }\n\n        /// <summary>\n        /// Helper class so we can serialize a command\n        /// </summary>\n        private class SerializableDynamicMetaObject : GetSetPropertyDynamicMetaObject\n        {\n            private readonly Command _object;\n            public SerializableDynamicMetaObject(Expression expression, object value, MethodInfo setPropertyMethodInfo, MethodInfo getPropertyMethodInfo)\n                : base(expression, value, setPropertyMethodInfo, getPropertyMethodInfo)\n            {\n                _object = (Command)value;\n            }\n            public override IEnumerable<string> GetDynamicMemberNames()\n            {\n                return _object._storage.Keys.Concat(_object.GetType()\n                    .GetMembers(BindingFlags.Public | BindingFlags.Instance)\n                    .Where(x => x.MemberType == MemberTypes.Field || x.MemberType == MemberTypes.Property).Select(x => x.Name));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/CommandResultsPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Contains data held as the result of executing a command\n    /// </summary>\n    public class CommandResultPacket : Packet\n    {\n        /// <summary>\n        /// Gets or sets the command that produced this packet\n        /// </summary>\n        public string CommandName { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether or not the\n        /// </summary>\n        public bool? Success { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CommandResultPacket\"/> class\n        /// </summary>\n        public CommandResultPacket(ICommand command, bool? success)\n            : base(PacketType.CommandResult)\n        {\n            Success = success;\n            CommandName = command.GetType().Name;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/FileCommandHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command handler that sources it's commands from a file on the local disk\n    /// </summary>\n    public class FileCommandHandler : BaseCommandHandler\n    {\n        private readonly Queue<ICommand> _commands = new();\n        private const string _commandFilePattern = \"command*.json\";\n        private const string _resultFileBaseName = \"result-command\";\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FileCommandHandler\"/> class\n        /// using the 'command-json-file' configuration value for the command json file\n        /// </summary>\n        public FileCommandHandler()\n        {\n        }\n\n        /// <summary>\n        /// Gets all the available command files\n        /// </summary>\n        /// <returns>Sorted enumerator of all the available command files</returns>\n        public static IEnumerable<FileInfo> GetCommandFiles()\n        {\n            var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());\n            var filesFromPattern = currentDirectory.GetFiles(_commandFilePattern);\n            return filesFromPattern.OrderBy(file => file.Name);\n        }\n\n        /// <summary>\n        /// Gets the next command in the queue\n        /// </summary>\n        /// <returns>The next command in the queue, if present, null if no commands present</returns>\n        protected override IEnumerable<ICommand> GetCommands()\n        {\n            foreach(var file in GetCommandFiles())\n            {\n                // update the queue by reading the command file\n                ReadCommandFile(file.FullName);\n\n                while (_commands.Count != 0)\n                {\n                    yield return _commands.Dequeue();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Acknowledge a command that has been executed\n        /// </summary>\n        /// <param name=\"command\">The command that was executed</param>\n        /// <param name=\"commandResultPacket\">The result</param>\n        protected override void Acknowledge(ICommand command, CommandResultPacket commandResultPacket)\n        {\n            if (string.IsNullOrEmpty(command.Id))\n            {\n                Log.Error($\"FileCommandHandler.Acknowledge(): {Messages.FileCommandHandler.NullOrEmptyCommandId}\");\n                return;\n            }\n            var resultFilePath = $\"{_resultFileBaseName}-{command.Id}.json\";\n            File.WriteAllText(resultFilePath, JsonConvert.SerializeObject(commandResultPacket));\n        }\n\n        /// <summary>\n        /// Reads the commnd file on disk and populates the queue with the commands\n        /// </summary>\n        private void ReadCommandFile(string commandFilePath)\n        {\n            Log.Trace($\"FileCommandHandler.ReadCommandFile(): {Messages.FileCommandHandler.ReadingCommandFile(commandFilePath)}\");\n            string contents = null;\n            Exception exception = null;\n            object deserialized = null;\n            try\n            {\n                if (!File.Exists(commandFilePath))\n                {\n                    Log.Error($\"FileCommandHandler.ReadCommandFile(): {Messages.FileCommandHandler.CommandFileDoesNotExist(commandFilePath)}\");\n                    return;\n                }\n                contents = File.ReadAllText(commandFilePath);\n                deserialized = JsonConvert.DeserializeObject(contents, Settings);\n            }\n            catch (Exception err)\n            {\n                exception = err;\n            }\n\n            // remove the file when we're done reading it\n            File.Delete(commandFilePath);\n\n            // try it as an enumerable\n            var enumerable = deserialized as IEnumerable<ICommand>;\n            if (enumerable != null)\n            {\n                foreach (var command in enumerable)\n                {\n                    _commands.Enqueue(command);\n                }\n                return;\n            }\n\n            // try it as a single command\n            var item = deserialized as ICommand;\n            if (item != null)\n            {\n                _commands.Enqueue(item);\n                return;\n            }\n\n            var callbackCommand = TryGetCallbackCommand(contents);\n            if (callbackCommand != null)\n            {\n                _commands.Enqueue(callbackCommand);\n                return;\n            }\n\n            if (exception != null)\n            {\n                // if we are here we failed\n                Log.Error(exception);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/ICommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command that can be run against a single algorithm\n    /// </summary>\n    public interface ICommand\n    {\n        /// <summary>\n        /// Unique command id\n        /// </summary>\n        string Id { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        CommandResultPacket Run(IAlgorithm algorithm);\n    }\n}\n"
  },
  {
    "path": "Common/Commands/ICommandHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command queue for the algorithm. This is an entry point\n    /// for external messages to act upon the running algorithm instance.\n    /// </summary>\n    public interface ICommandHandler : IDisposable\n    {\n        /// <summary>\n        /// Initializes this command queue for the specified job\n        /// </summary>\n        /// <param name=\"job\">The job that defines what queue to bind to</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        void Initialize(AlgorithmNodePacket job, IAlgorithm algorithm);\n\n        /// <summary>\n        /// Process any commands in the queue\n        /// </summary>\n        /// <returns>The command result packet of each command executed if any</returns>\n        IEnumerable<CommandResultPacket> ProcessCommands();\n    }\n}\n"
  },
  {
    "path": "Common/Commands/LiquidateCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing System;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command that will liquidate the entire algorithm\n    /// </summary>\n    public class LiquidateCommand : BaseCommand\n    {\n        /// <summary>\n        /// Gets or sets the string ticker symbol\n        /// </summary>\n        public string Ticker { get; set; }\n\n        /// <summary>\n        /// Gets or sets the security type of the ticker.\n        /// </summary>\n        public SecurityType SecurityType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the market the ticker resides in\n        /// </summary>\n        public string Market { get; set; }\n\n        /// <summary>\n        /// Submits orders to liquidate all current holdings in the algorithm\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to be liquidated</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            if (Ticker != null || SecurityType != SecurityType.Base || Market != null)\n            {\n                var symbol = GetSymbol(Ticker, SecurityType, Market);\n                algorithm.Liquidate(symbol);\n            }\n            else\n            {\n                algorithm.Liquidate();\n            }\n            return new CommandResultPacket(this, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/OrderCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command to submit an order to the algorithm\n    /// </summary>\n    public class OrderCommand : BaseCommand\n    {\n        /// <summary>\n        /// Gets or sets the symbol to be ordered\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// Gets or sets the string ticker symbol\n        /// </summary>\n        public string Ticker { get; set; }\n\n        /// <summary>\n        /// Gets or sets the security type of the ticker.\n        /// </summary>\n        public SecurityType SecurityType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the market the ticker resides in\n        /// </summary>\n        public string Market { get; set; }\n\n        /// <summary>\n        /// Gets or sets the order type to be submted\n        /// </summary>\n        public OrderType OrderType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the number of units to be ordered (directional)\n        /// </summary>\n        public decimal Quantity { get; set; }\n\n        /// <summary>\n        /// Gets or sets the limit price. Only applies to <see cref=\"QuantConnect.Orders.OrderType.Limit\"/> and <see cref=\"QuantConnect.Orders.OrderType.StopLimit\"/>\n        /// </summary>\n        public decimal LimitPrice { get; set; }\n\n        /// <summary>\n        /// Gets or sets the stop price. Only applies to <see cref=\"QuantConnect.Orders.OrderType.StopLimit\"/> and <see cref=\"QuantConnect.Orders.OrderType.StopMarket\"/>\n        /// </summary>\n        public decimal StopPrice { get; set; }\n\n        /// <summary>\n        /// Gets or sets an arbitrary tag to be attached to the order\n        /// </summary>\n        public string Tag { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            Symbol = GetSymbol(Ticker, SecurityType, Market, Symbol);\n            var request = new SubmitOrderRequest(OrderType, Symbol.SecurityType, Symbol, Quantity, StopPrice, LimitPrice, DateTime.UtcNow, Tag, algorithm.DefaultOrderProperties);\n            var ticket = algorithm.SubmitOrderRequest(request);\n            var response = ticket.GetMostRecentOrderResponse();\n            var message = Messages.OrderCommand.CommandInfo(OrderType, Symbol, Quantity, response);\n\n            if (response.IsError)\n            {\n                algorithm.Error(message);\n            }\n            else\n            {\n                algorithm.Debug(message);\n            }\n\n            return new CommandResultPacket(this, success: !response.IsError);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            Symbol = GetSymbol(Ticker, SecurityType, Market, Symbol);\n            // delegate to the order request\n            return new SubmitOrderRequest(OrderType, Symbol.SecurityType, Symbol, Quantity, StopPrice, LimitPrice, DateTime.UtcNow, Tag).ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/QuitCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command that will terminate the algorithm\n    /// </summary>\n    public class QuitCommand : AlgorithmStatusCommand\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuitCommand\"/>\n        /// </summary>\n        public QuitCommand()\n            : base(AlgorithmStatus.Stopped)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Commands/UpdateOrderCommand.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Commands\n{\n    /// <summary>\n    /// Represents a command to update an order by id\n    /// </summary>\n    public class UpdateOrderCommand : BaseCommand\n    {\n        /// <summary>\n        /// Gets or sets the id of the order to update\n        /// </summary>\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// Gets or sets the new quantity, specify null to not update the quantity\n        /// </summary>\n        public decimal? Quantity { get; set; }\n\n        /// <summary>\n        /// Gets or sets the new limit price, specify null to not update the limit price.\n        /// This will only be used if the order has a limit price (Limit/StopLimit orders)\n        /// </summary>\n        public decimal? LimitPrice { get; set; }\n\n        /// <summary>\n        /// Gets or sets the new stop price, specify null to not update the stop price.\n        /// This will onky be used if the order has a stop price (StopLimit/StopMarket orders)\n        /// </summary>\n        public decimal? StopPrice { get; set; }\n\n        /// <summary>\n        /// Gets or sets the new tag for the order, specify null to not update the tag\n        /// </summary>\n        public string Tag { get; set; }\n\n        /// <summary>\n        /// Runs this command against the specified algorithm instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to run this command against</param>\n        public override CommandResultPacket Run(IAlgorithm algorithm)\n        {\n            var ticket = algorithm.Transactions.UpdateOrder(new UpdateOrderRequest(algorithm.UtcTime, OrderId, new UpdateOrderFields\n            {\n                Quantity = Quantity,\n                LimitPrice = LimitPrice,\n                StopPrice = StopPrice,\n                Tag = Tag\n            }));\n\n            var response = ticket.GetMostRecentOrderResponse();\n            return new CommandResultPacket(this, response.IsSuccess);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Country.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// The Country class contains all countries normalized for your convenience.\n    /// It maps the country name to its ISO 3166-1 alpha-3 code, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3\n    /// </summary>\n    public static class Country\n    {\n        /// <summary>\n        /// Afghanistan\n        /// </summary>\n        public const string Afghanistan = \"AFG\";\n\n        /// <summary>\n        /// Aland Islands\n        /// </summary>\n        public const string AlandIslands = \"ALA\";\n\n        /// <summary>\n        /// Albania\n        /// </summary>\n        public const string Albania = \"ALB\";\n\n        /// <summary>\n        /// Algeria\n        /// </summary>\n        public const string Algeria = \"DZA\";\n\n        /// <summary>\n        /// American Samoa\n        /// </summary>\n        public const string AmericanSamoa = \"ASM\";\n\n        /// <summary>\n        /// Andorra\n        /// </summary>\n        public const string Andorra = \"AND\";\n\n        /// <summary>\n        /// Angola\n        /// </summary>\n        public const string Angola = \"AGO\";\n\n        /// <summary>\n        /// Anguilla\n        /// </summary>\n        public const string Anguilla = \"AIA\";\n\n        /// <summary>\n        /// Antarctica\n        /// </summary>\n        public const string Antarctica = \"ATA\";\n\n        /// <summary>\n        /// Antigua and Barbuda\n        /// </summary>\n        public const string AntiguaAndBarbuda = \"ATG\";\n\n        /// <summary>\n        /// Argentina\n        /// </summary>\n        public const string Argentina = \"ARG\";\n\n        /// <summary>\n        /// Armenia\n        /// </summary>\n        public const string Armenia = \"ARM\";\n\n        /// <summary>\n        /// Aruba\n        /// </summary>\n        public const string Aruba = \"ABW\";\n\n        /// <summary>\n        /// Australia\n        /// </summary>\n        public const string Australia = \"AUS\";\n\n        /// <summary>\n        /// Austria\n        /// </summary>\n        public const string Austria = \"AUT\";\n\n        /// <summary>\n        /// Azerbaijan\n        /// </summary>\n        public const string Azerbaijan = \"AZE\";\n\n        /// <summary>\n        /// Bahamas\n        /// </summary>\n        public const string Bahamas = \"BHS\";\n\n        /// <summary>\n        /// Bahrain\n        /// </summary>\n        public const string Bahrain = \"BHR\";\n\n        /// <summary>\n        /// Bangladesh\n        /// </summary>\n        public const string Bangladesh = \"BGD\";\n\n        /// <summary>\n        /// Barbados\n        /// </summary>\n        public const string Barbados = \"BRB\";\n\n        /// <summary>\n        /// Belarus\n        /// </summary>\n        public const string Belarus = \"BLR\";\n\n        /// <summary>\n        /// Belgium\n        /// </summary>\n        public const string Belgium = \"BEL\";\n\n        /// <summary>\n        /// Belize\n        /// </summary>\n        public const string Belize = \"BLZ\";\n\n        /// <summary>\n        /// Benin\n        /// </summary>\n        public const string Benin = \"BEN\";\n\n        /// <summary>\n        /// Bermuda\n        /// </summary>\n        public const string Bermuda = \"BMU\";\n\n        /// <summary>\n        /// Bhutan\n        /// </summary>\n        public const string Bhutan = \"BTN\";\n\n        /// <summary>\n        /// Bolivia\n        /// </summary>\n        public const string Bolivia = \"BOL\";\n\n        /// <summary>\n        /// Bonaire\n        /// </summary>\n        public const string Bonaire = \"BES\";\n\n        /// <summary>\n        /// Bosnia and Herzegovina\n        /// </summary>\n        public const string BosniaAndHerzegovina = \"BIH\";\n\n        /// <summary>\n        /// Botswana\n        /// </summary>\n        public const string Botswana = \"BWA\";\n\n        /// <summary>\n        /// Bouvet Island\n        /// </summary>\n        public const string BouvetIsland = \"BVT\";\n\n        /// <summary>\n        /// Brazil\n        /// </summary>\n        public const string Brazil = \"BRA\";\n\n        /// <summary>\n        /// British Indian Ocean Territory\n        /// </summary>\n        public const string BritishIndianOceanTerritory = \"IOT\";\n\n        /// <summary>\n        /// Brunei Darussalam\n        /// </summary>\n        public const string BruneiDarussalam = \"BRN\";\n\n        /// <summary>\n        /// Bulgaria\n        /// </summary>\n        public const string Bulgaria = \"BGR\";\n\n        /// <summary>\n        /// Burkina Faso\n        /// </summary>\n        public const string BurkinaFaso = \"BFA\";\n\n        /// <summary>\n        /// Burundi\n        /// </summary>\n        public const string Burundi = \"BDI\";\n\n        /// <summary>\n        /// Cabo Verde\n        /// </summary>\n        public const string CaboVerde = \"CPV\";\n\n        /// <summary>\n        /// Cambodia\n        /// </summary>\n        public const string Cambodia = \"KHM\";\n\n        /// <summary>\n        /// Cameroon\n        /// </summary>\n        public const string Cameroon = \"CMR\";\n\n        /// <summary>\n        /// Canada\n        /// </summary>\n        public const string Canada = \"CAN\";\n\n        /// <summary>\n        /// Cayman Islands\n        /// </summary>\n        public const string CaymanIslands = \"CYM\";\n\n        /// <summary>\n        /// Central African Republic\n        /// </summary>\n        public const string CentralAfricanRepublic = \"CAF\";\n\n        /// <summary>\n        /// Chad\n        /// </summary>\n        public const string Chad = \"TCD\";\n\n        /// <summary>\n        /// Chile\n        /// </summary>\n        public const string Chile = \"CHL\";\n\n        /// <summary>\n        /// China\n        /// </summary>\n        public const string China = \"CHN\";\n\n        /// <summary>\n        /// Christmas Island\n        /// </summary>\n        public const string ChristmasIsland = \"CXR\";\n\n        /// <summary>\n        /// Cocos Keeling Islands\n        /// </summary>\n        public const string CocosKeelingIslands = \"CCK\";\n\n        /// <summary>\n        /// Colombia\n        /// </summary>\n        public const string Colombia = \"COL\";\n\n        /// <summary>\n        /// Comoros\n        /// </summary>\n        public const string Comoros = \"COM\";\n\n        /// <summary>\n        /// Democratic Republic of Congo\n        /// </summary>\n        public const string DemocraticRepublicOfCongo = \"COD\";\n\n        /// <summary>\n        /// Congo\n        /// </summary>\n        public const string Congo = \"COG\";\n\n        /// <summary>\n        /// Cook Islands\n        /// </summary>\n        public const string CookIslands = \"COK\";\n\n        /// <summary>\n        /// Costa Rica\n        /// </summary>\n        public const string CostaRica = \"CRI\";\n\n        /// <summary>\n        /// Ivory Coast\n        /// </summary>\n        public const string IvoryCoast = \"CIV\";\n\n        /// <summary>\n        /// Croatia\n        /// </summary>\n        public const string Croatia = \"HRV\";\n\n        /// <summary>\n        /// Cuba\n        /// </summary>\n        public const string Cuba = \"CUB\";\n\n        /// <summary>\n        /// Curaçao\n        /// </summary>\n        public const string Curaçao = \"CUW\";\n\n        /// <summary>\n        /// Cyprus\n        /// </summary>\n        public const string Cyprus = \"CYP\";\n\n        /// <summary>\n        /// Czechia\n        /// </summary>\n        public const string Czechia = \"CZE\";\n\n        /// <summary>\n        /// Denmark\n        /// </summary>\n        public const string Denmark = \"DNK\";\n\n        /// <summary>\n        /// Djibouti\n        /// </summary>\n        public const string Djibouti = \"DJI\";\n\n        /// <summary>\n        /// Dominica\n        /// </summary>\n        public const string Dominica = \"DMA\";\n\n        /// <summary>\n        /// Dominican Republic\n        /// </summary>\n        public const string DominicanRepublic = \"DOM\";\n\n        /// <summary>\n        /// Ecuador\n        /// </summary>\n        public const string Ecuador = \"ECU\";\n\n        /// <summary>\n        /// Egypt\n        /// </summary>\n        public const string Egypt = \"EGY\";\n\n        /// <summary>\n        /// El Salvador\n        /// </summary>\n        public const string ElSalvador = \"SLV\";\n\n        /// <summary>\n        /// Equatorial Guinea\n        /// </summary>\n        public const string EquatorialGuinea = \"GNQ\";\n\n        /// <summary>\n        /// Eritrea\n        /// </summary>\n        public const string Eritrea = \"ERI\";\n\n        /// <summary>\n        /// Estonia\n        /// </summary>\n        public const string Estonia = \"EST\";\n\n        /// <summary>\n        /// Eswatini\n        /// </summary>\n        public const string Eswatini = \"SWZ\";\n\n        /// <summary>\n        /// Ethiopia\n        /// </summary>\n        public const string Ethiopia = \"ETH\";\n\n        /// <summary>\n        /// Falkland Islands\n        /// </summary>\n        public const string FalklandIslands = \"FLK\";\n\n        /// <summary>\n        /// Faroe Islands\n        /// </summary>\n        public const string FaroeIslands = \"FRO\";\n\n        /// <summary>\n        /// Fiji\n        /// </summary>\n        public const string Fiji = \"FJI\";\n\n        /// <summary>\n        /// Finland\n        /// </summary>\n        public const string Finland = \"FIN\";\n\n        /// <summary>\n        /// France\n        /// </summary>\n        public const string France = \"FRA\";\n\n        /// <summary>\n        /// French Guiana\n        /// </summary>\n        public const string FrenchGuiana = \"GUF\";\n\n        /// <summary>\n        /// French Polynesia\n        /// </summary>\n        public const string FrenchPolynesia = \"PYF\";\n\n        /// <summary>\n        /// French Southern Territories\n        /// </summary>\n        public const string FrenchSouthernTerritories = \"ATF\";\n\n        /// <summary>\n        /// Gabon\n        /// </summary>\n        public const string Gabon = \"GAB\";\n\n        /// <summary>\n        /// Gambia\n        /// </summary>\n        public const string Gambia = \"GMB\";\n\n        /// <summary>\n        /// Georgia\n        /// </summary>\n        public const string Georgia = \"GEO\";\n\n        /// <summary>\n        /// Germany\n        /// </summary>\n        public const string Germany = \"DEU\";\n\n        /// <summary>\n        /// Ghana\n        /// </summary>\n        public const string Ghana = \"GHA\";\n\n        /// <summary>\n        /// Gibraltar\n        /// </summary>\n        public const string Gibraltar = \"GIB\";\n\n        /// <summary>\n        /// Greece\n        /// </summary>\n        public const string Greece = \"GRC\";\n\n        /// <summary>\n        /// Greenland\n        /// </summary>\n        public const string Greenland = \"GRL\";\n\n        /// <summary>\n        /// Grenada\n        /// </summary>\n        public const string Grenada = \"GRD\";\n\n        /// <summary>\n        /// Guadeloupe\n        /// </summary>\n        public const string Guadeloupe = \"GLP\";\n\n        /// <summary>\n        /// Guam\n        /// </summary>\n        public const string Guam = \"GUM\";\n\n        /// <summary>\n        /// Guatemala\n        /// </summary>\n        public const string Guatemala = \"GTM\";\n\n        /// <summary>\n        /// Guernsey\n        /// </summary>\n        public const string Guernsey = \"GGY\";\n\n        /// <summary>\n        /// Guinea\n        /// </summary>\n        public const string Guinea = \"GIN\";\n\n        /// <summary>\n        /// Guinea-Bissau\n        /// </summary>\n        public const string GuineaBissau = \"GNB\";\n\n        /// <summary>\n        /// Guyana\n        /// </summary>\n        public const string Guyana = \"GUY\";\n\n        /// <summary>\n        /// Haiti\n        /// </summary>\n        public const string Haiti = \"HTI\";\n\n        /// <summary>\n        /// Heard Island and McDonald Islands\n        /// </summary>\n        public const string HeardIslandAndMcdonaldIslands = \"HMD\";\n\n        /// <summary>\n        /// Holy See\n        /// </summary>\n        public const string HolySee = \"VAT\";\n\n        /// <summary>\n        /// Honduras\n        /// </summary>\n        public const string Honduras = \"HND\";\n\n        /// <summary>\n        /// Hong Kong\n        /// </summary>\n        public const string HongKong = \"HKG\";\n\n        /// <summary>\n        /// Hungary\n        /// </summary>\n        public const string Hungary = \"HUN\";\n\n        /// <summary>\n        /// Iceland\n        /// </summary>\n        public const string Iceland = \"ISL\";\n\n        /// <summary>\n        /// India\n        /// </summary>\n        public const string India = \"IND\";\n\n        /// <summary>\n        /// Indonesia\n        /// </summary>\n        public const string Indonesia = \"IDN\";\n\n        /// <summary>\n        /// Iran\n        /// </summary>\n        public const string Iran = \"IRN\";\n\n        /// <summary>\n        /// Iraq\n        /// </summary>\n        public const string Iraq = \"IRQ\";\n\n        /// <summary>\n        /// Ireland\n        /// </summary>\n        public const string Ireland = \"IRL\";\n\n        /// <summary>\n        /// Isle of Man\n        /// </summary>\n        public const string IsleOfMan = \"IMN\";\n\n        /// <summary>\n        /// Israel\n        /// </summary>\n        public const string Israel = \"ISR\";\n\n        /// <summary>\n        /// Italy\n        /// </summary>\n        public const string Italy = \"ITA\";\n\n        /// <summary>\n        /// Jamaica\n        /// </summary>\n        public const string Jamaica = \"JAM\";\n\n        /// <summary>\n        /// Japan\n        /// </summary>\n        public const string Japan = \"JPN\";\n\n        /// <summary>\n        /// Jersey\n        /// </summary>\n        public const string Jersey = \"JEY\";\n\n        /// <summary>\n        /// Jordan\n        /// </summary>\n        public const string Jordan = \"JOR\";\n\n        /// <summary>\n        /// Kazakhstan\n        /// </summary>\n        public const string Kazakhstan = \"KAZ\";\n\n        /// <summary>\n        /// Kenya\n        /// </summary>\n        public const string Kenya = \"KEN\";\n\n        /// <summary>\n        /// Kiribati\n        /// </summary>\n        public const string Kiribati = \"KIR\";\n\n        /// <summary>\n        /// North Korea\n        /// </summary>\n        public const string NorthKorea = \"PRK\";\n\n        /// <summary>\n        /// Korea\n        /// </summary>\n        public const string Korea = \"KOR\";\n\n        /// <summary>\n        /// Kuwait\n        /// </summary>\n        public const string Kuwait = \"KWT\";\n\n        /// <summary>\n        /// Kyrgyzstan\n        /// </summary>\n        public const string Kyrgyzstan = \"KGZ\";\n\n        /// <summary>\n        /// Laos\n        /// </summary>\n        public const string Laos = \"LAO\";\n\n        /// <summary>\n        /// Latvia\n        /// </summary>\n        public const string Latvia = \"LVA\";\n\n        /// <summary>\n        /// Lebanon\n        /// </summary>\n        public const string Lebanon = \"LBN\";\n\n        /// <summary>\n        /// Lesotho\n        /// </summary>\n        public const string Lesotho = \"LSO\";\n\n        /// <summary>\n        /// Liberia\n        /// </summary>\n        public const string Liberia = \"LBR\";\n\n        /// <summary>\n        /// Libya\n        /// </summary>\n        public const string Libya = \"LBY\";\n\n        /// <summary>\n        /// Liechtenstein\n        /// </summary>\n        public const string Liechtenstein = \"LIE\";\n\n        /// <summary>\n        /// Lithuania\n        /// </summary>\n        public const string Lithuania = \"LTU\";\n\n        /// <summary>\n        /// Luxembourg\n        /// </summary>\n        public const string Luxembourg = \"LUX\";\n\n        /// <summary>\n        /// Macao\n        /// </summary>\n        public const string Macao = \"MAC\";\n\n        /// <summary>\n        /// Madagascar\n        /// </summary>\n        public const string Madagascar = \"MDG\";\n\n        /// <summary>\n        /// Malawi\n        /// </summary>\n        public const string Malawi = \"MWI\";\n\n        /// <summary>\n        /// Malaysia\n        /// </summary>\n        public const string Malaysia = \"MYS\";\n\n        /// <summary>\n        /// Maldives\n        /// </summary>\n        public const string Maldives = \"MDV\";\n\n        /// <summary>\n        /// Mali\n        /// </summary>\n        public const string Mali = \"MLI\";\n\n        /// <summary>\n        /// Malta\n        /// </summary>\n        public const string Malta = \"MLT\";\n\n        /// <summary>\n        /// Marshall Islands\n        /// </summary>\n        public const string MarshallIslands = \"MHL\";\n\n        /// <summary>\n        /// Martinique\n        /// </summary>\n        public const string Martinique = \"MTQ\";\n\n        /// <summary>\n        /// Mauritania\n        /// </summary>\n        public const string Mauritania = \"MRT\";\n\n        /// <summary>\n        /// Mauritius\n        /// </summary>\n        public const string Mauritius = \"MUS\";\n\n        /// <summary>\n        /// Mayotte\n        /// </summary>\n        public const string Mayotte = \"MYT\";\n\n        /// <summary>\n        /// Mexico\n        /// </summary>\n        public const string Mexico = \"MEX\";\n\n        /// <summary>\n        /// Micronesia\n        /// </summary>\n        public const string Micronesia = \"FSM\";\n\n        /// <summary>\n        /// Moldova\n        /// </summary>\n        public const string Moldova = \"MDA\";\n\n        /// <summary>\n        /// Monaco\n        /// </summary>\n        public const string Monaco = \"MCO\";\n\n        /// <summary>\n        /// Mongolia\n        /// </summary>\n        public const string Mongolia = \"MNG\";\n\n        /// <summary>\n        /// Montenegro\n        /// </summary>\n        public const string Montenegro = \"MNE\";\n\n        /// <summary>\n        /// Montserrat\n        /// </summary>\n        public const string Montserrat = \"MSR\";\n\n        /// <summary>\n        /// Morocco\n        /// </summary>\n        public const string Morocco = \"MAR\";\n\n        /// <summary>\n        /// Mozambique\n        /// </summary>\n        public const string Mozambique = \"MOZ\";\n\n        /// <summary>\n        /// Myanmar\n        /// </summary>\n        public const string Myanmar = \"MMR\";\n\n        /// <summary>\n        /// Namibia\n        /// </summary>\n        public const string Namibia = \"NAM\";\n\n        /// <summary>\n        /// Nauru\n        /// </summary>\n        public const string Nauru = \"NRU\";\n\n        /// <summary>\n        /// Nepal\n        /// </summary>\n        public const string Nepal = \"NPL\";\n\n        /// <summary>\n        /// Netherlands\n        /// </summary>\n        public const string Netherlands = \"NLD\";\n\n        /// <summary>\n        /// New Caledonia\n        /// </summary>\n        public const string NewCaledonia = \"NCL\";\n\n        /// <summary>\n        /// New Zealand\n        /// </summary>\n        public const string NewZealand = \"NZL\";\n\n        /// <summary>\n        /// Nicaragua\n        /// </summary>\n        public const string Nicaragua = \"NIC\";\n\n        /// <summary>\n        /// Niger\n        /// </summary>\n        public const string Niger = \"NER\";\n\n        /// <summary>\n        /// Nigeria\n        /// </summary>\n        public const string Nigeria = \"NGA\";\n\n        /// <summary>\n        /// Niue\n        /// </summary>\n        public const string Niue = \"NIU\";\n\n        /// <summary>\n        /// Norfolk Island\n        /// </summary>\n        public const string NorfolkIsland = \"NFK\";\n\n        /// <summary>\n        /// North Macedonia\n        /// </summary>\n        public const string NorthMacedonia = \"MKD\";\n\n        /// <summary>\n        /// Northern Mariana Islands\n        /// </summary>\n        public const string NorthernMarianaIslands = \"MNP\";\n\n        /// <summary>\n        /// Norway\n        /// </summary>\n        public const string Norway = \"NOR\";\n\n        /// <summary>\n        /// Oman\n        /// </summary>\n        public const string Oman = \"OMN\";\n\n        /// <summary>\n        /// Pakistan\n        /// </summary>\n        public const string Pakistan = \"PAK\";\n\n        /// <summary>\n        /// Palau\n        /// </summary>\n        public const string Palau = \"PLW\";\n\n        /// <summary>\n        /// Palestine\n        /// </summary>\n        public const string Palestine = \"PSE\";\n\n        /// <summary>\n        /// Panama\n        /// </summary>\n        public const string Panama = \"PAN\";\n\n        /// <summary>\n        /// Papua New Guinea\n        /// </summary>\n        public const string PapuaNewGuinea = \"PNG\";\n\n        /// <summary>\n        /// Paraguay\n        /// </summary>\n        public const string Paraguay = \"PRY\";\n\n        /// <summary>\n        /// Peru\n        /// </summary>\n        public const string Peru = \"PER\";\n\n        /// <summary>\n        /// Philippines\n        /// </summary>\n        public const string Philippines = \"PHL\";\n\n        /// <summary>\n        /// Pitcairn\n        /// </summary>\n        public const string Pitcairn = \"PCN\";\n\n        /// <summary>\n        /// Poland\n        /// </summary>\n        public const string Poland = \"POL\";\n\n        /// <summary>\n        /// Portugal\n        /// </summary>\n        public const string Portugal = \"PRT\";\n\n        /// <summary>\n        /// Puerto Rico\n        /// </summary>\n        public const string PuertoRico = \"PRI\";\n\n        /// <summary>\n        /// Qatar\n        /// </summary>\n        public const string Qatar = \"QAT\";\n\n        /// <summary>\n        /// Reunion\n        /// </summary>\n        public const string Reunion = \"REU\";\n\n        /// <summary>\n        /// Romania\n        /// </summary>\n        public const string Romania = \"ROU\";\n\n        /// <summary>\n        /// Russia\n        /// </summary>\n        public const string Russia = \"RUS\";\n\n        /// <summary>\n        /// Rwanda\n        /// </summary>\n        public const string Rwanda = \"RWA\";\n\n        /// <summary>\n        /// Saint Barthélemy\n        /// </summary>\n        public const string SaintBarthélemy = \"BLM\";\n\n        /// <summary>\n        /// Saint Helena\n        /// </summary>\n        public const string SaintHelena = \"SHN\";\n\n        /// <summary>\n        /// Saint Kitts and Nevis\n        /// </summary>\n        public const string SaintKittsAndNevis = \"KNA\";\n\n        /// <summary>\n        /// Saint Lucia\n        /// </summary>\n        public const string SaintLucia = \"LCA\";\n\n        /// <summary>\n        /// Saint Martin French part\n        /// </summary>\n        public const string SaintMartinFrenchPart = \"MAF\";\n\n        /// <summary>\n        /// Saint Pierre and Miquelon\n        /// </summary>\n        public const string SaintPierreAndMiquelon = \"SPM\";\n\n        /// <summary>\n        /// Saint Vincent and the Grenadines\n        /// </summary>\n        public const string SaintVincentAndTheGrenadines = \"VCT\";\n\n        /// <summary>\n        /// Samoa\n        /// </summary>\n        public const string Samoa = \"WSM\";\n\n        /// <summary>\n        /// San Marino\n        /// </summary>\n        public const string SanMarino = \"SMR\";\n\n        /// <summary>\n        /// Sao Tome and Principe\n        /// </summary>\n        public const string SaoTomeAndPrincipe = \"STP\";\n\n        /// <summary>\n        /// Saudi Arabia\n        /// </summary>\n        public const string SaudiArabia = \"SAU\";\n\n        /// <summary>\n        /// Senegal\n        /// </summary>\n        public const string Senegal = \"SEN\";\n\n        /// <summary>\n        /// Serbia\n        /// </summary>\n        public const string Serbia = \"SRB\";\n\n        /// <summary>\n        /// Seychelles\n        /// </summary>\n        public const string Seychelles = \"SYC\";\n\n        /// <summary>\n        /// Sierra Leone\n        /// </summary>\n        public const string SierraLeone = \"SLE\";\n\n        /// <summary>\n        /// Singapore\n        /// </summary>\n        public const string Singapore = \"SGP\";\n\n        /// <summary>\n        /// Sint Maarten Dutch part\n        /// </summary>\n        public const string SintMaartenDutchPart = \"SXM\";\n\n        /// <summary>\n        /// Slovakia\n        /// </summary>\n        public const string Slovakia = \"SVK\";\n\n        /// <summary>\n        /// Slovenia\n        /// </summary>\n        public const string Slovenia = \"SVN\";\n\n        /// <summary>\n        /// Solomon Islands\n        /// </summary>\n        public const string SolomonIslands = \"SLB\";\n\n        /// <summary>\n        /// Somalia\n        /// </summary>\n        public const string Somalia = \"SOM\";\n\n        /// <summary>\n        /// South Africa\n        /// </summary>\n        public const string SouthAfrica = \"ZAF\";\n\n        /// <summary>\n        /// South Georgia and the South Sandwich Islands\n        /// </summary>\n        public const string SouthGeorgiaAndTheSouthSandwichIslands = \"SGS\";\n\n        /// <summary>\n        /// South Sudan\n        /// </summary>\n        public const string SouthSudan = \"SSD\";\n\n        /// <summary>\n        /// Spain\n        /// </summary>\n        public const string Spain = \"ESP\";\n\n        /// <summary>\n        /// Sri Lanka\n        /// </summary>\n        public const string SriLanka = \"LKA\";\n\n        /// <summary>\n        /// Sudan\n        /// </summary>\n        public const string Sudan = \"SDN\";\n\n        /// <summary>\n        /// Suriname\n        /// </summary>\n        public const string Suriname = \"SUR\";\n\n        /// <summary>\n        /// Svalbard\n        /// </summary>\n        public const string Svalbard = \"SJM\";\n\n        /// <summary>\n        /// Sweden\n        /// </summary>\n        public const string Sweden = \"SWE\";\n\n        /// <summary>\n        /// Switzerland\n        /// </summary>\n        public const string Switzerland = \"CHE\";\n\n        /// <summary>\n        /// Syria\n        /// </summary>\n        public const string Syria = \"SYR\";\n\n        /// <summary>\n        /// Taiwan\n        /// </summary>\n        public const string Taiwan = \"TWN\";\n\n        /// <summary>\n        /// Tajikistan\n        /// </summary>\n        public const string Tajikistan = \"TJK\";\n\n        /// <summary>\n        /// Tanzania\n        /// </summary>\n        public const string Tanzania = \"TZA\";\n\n        /// <summary>\n        /// Thailand\n        /// </summary>\n        public const string Thailand = \"THA\";\n\n        /// <summary>\n        /// Timor-Leste\n        /// </summary>\n        public const string TimorLeste = \"TLS\";\n\n        /// <summary>\n        /// Togo\n        /// </summary>\n        public const string Togo = \"TGO\";\n\n        /// <summary>\n        /// Tokelau\n        /// </summary>\n        public const string Tokelau = \"TKL\";\n\n        /// <summary>\n        /// Tonga\n        /// </summary>\n        public const string Tonga = \"TON\";\n\n        /// <summary>\n        /// Trinidad and Tobago\n        /// </summary>\n        public const string TrinidadAndTobago = \"TTO\";\n\n        /// <summary>\n        /// Tunisia\n        /// </summary>\n        public const string Tunisia = \"TUN\";\n\n        /// <summary>\n        /// Turkey\n        /// </summary>\n        public const string Turkey = \"TUR\";\n\n        /// <summary>\n        /// Turkmenistan\n        /// </summary>\n        public const string Turkmenistan = \"TKM\";\n\n        /// <summary>\n        /// Turks and Caicos Islands\n        /// </summary>\n        public const string TurksAndCaicosIslands = \"TCA\";\n\n        /// <summary>\n        /// Tuvalu\n        /// </summary>\n        public const string Tuvalu = \"TUV\";\n\n        /// <summary>\n        /// Uganda\n        /// </summary>\n        public const string Uganda = \"UGA\";\n\n        /// <summary>\n        /// Ukraine\n        /// </summary>\n        public const string Ukraine = \"UKR\";\n\n        /// <summary>\n        /// United Arab Emirates\n        /// </summary>\n        public const string UnitedArabEmirates = \"ARE\";\n\n        /// <summary>\n        /// United Kingdom\n        /// </summary>\n        public const string UnitedKingdom = \"GBR\";\n\n        /// <summary>\n        /// United States Minor Outlying Islands\n        /// </summary>\n        public const string UnitedStatesMinorOutlyingIslands = \"UMI\";\n\n        /// <summary>\n        /// United States\n        /// </summary>\n        public const string UnitedStates = \"USA\";\n\n        /// <summary>\n        /// European Union\n        /// </summary>\n        public const string EuropeanUnion = \"EUR\";\n\n        /// <summary>\n        /// Uruguay\n        /// </summary>\n        public const string Uruguay = \"URY\";\n\n        /// <summary>\n        /// Uzbekistan\n        /// </summary>\n        public const string Uzbekistan = \"UZB\";\n\n        /// <summary>\n        /// Vanuatu\n        /// </summary>\n        public const string Vanuatu = \"VUT\";\n\n        /// <summary>\n        /// Venezuela\n        /// </summary>\n        public const string Venezuela = \"VEN\";\n\n        /// <summary>\n        /// Vietnam\n        /// </summary>\n        public const string Vietnam = \"VNM\";\n\n        /// <summary>\n        /// Virgin Islands British\n        /// </summary>\n        public const string VirginIslandsBritish = \"VGB\";\n\n        /// <summary>\n        /// Virgin Islands US\n        /// </summary>\n        public const string VirginIslandsUs = \"VIR\";\n\n        /// <summary>\n        /// Wallis and Futuna\n        /// </summary>\n        public const string WallisAndFutuna = \"WLF\";\n\n        /// <summary>\n        /// Western Sahara\n        /// </summary>\n        public const string WesternSahara = \"ESH\";\n\n        /// <summary>\n        /// Yemen\n        /// </summary>\n        public const string Yemen = \"YEM\";\n\n        /// <summary>\n        /// Zambia\n        /// </summary>\n        public const string Zambia = \"ZMB\";\n\n        /// <summary>\n        /// Zimbabwe\n        /// </summary>\n        public const string Zimbabwe = \"ZWE\";\n    }\n}\n"
  },
  {
    "path": "Common/Currencies.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides commonly used currency pairs and symbols\n    /// </summary>\n    public static class Currencies\n    {\n        /// <summary>\n        /// USD (United States Dollar) currency string\n        /// </summary>\n        public const string USD = \"USD\";\n\n        /// <summary>\n        /// EUR (Euro) currency string\n        /// </summary>\n        public const string EUR = \"EUR\";\n\n        /// <summary>\n        /// GBP (British pound sterling) currency string\n        /// </summary>\n        public const string GBP = \"GBP\";\n\n        /// <summary>\n        /// INR (Indian rupee) currency string\n        /// </summary>\n        public const string INR = \"INR\";\n\n        /// <summary>\n        /// IDR (Indonesian rupiah) currency string\n        /// </summary>\n        public const string IDR = \"IDR\";\n\n        /// <summary>\n        /// CNH (Chinese Yuan Renminbi) currency string\n        /// </summary>\n        public const string CNH = \"CNH\";\n\n        /// <summary>\n        /// CHF (Swiss Franc) currency string\n        /// </summary>\n        public const string CHF = \"CHF\";\n\n        /// <summary>\n        /// HKD (Hong Kong dollar) currency string\n        /// </summary>\n        public const string HKD = \"HKD\";\n\n        /// <summary>\n        /// JPY (Japanese yen) currency string\n        /// </summary>\n        public const string JPY = \"JPY\";\n\n        /// <summary>\n        /// Null currency used when a real one is not required\n        /// </summary>\n        public const string NullCurrency = \"QCC\";\n\n        /// <summary>\n        /// A mapping of currency codes to their display symbols\n        /// </summary>\n        /// <remarks>\n        /// Now used by Forex and CFD, should probably be moved out into its own class\n        /// </remarks>\n        public static readonly IReadOnlyDictionary<string, string> CurrencySymbols = new Dictionary<string, string>\n        {\n            {USD, \"$\"},\n            {GBP, \"₤\"},\n            {JPY, \"¥\"},\n            {EUR, \"€\"},\n            {\"NZD\", \"$\"},\n            {\"AUD\", \"$\"},\n            {\"CAD\", \"$\"},\n            {CHF, \"Fr\"},\n            {HKD, \"$\"},\n            {\"SGD\", \"$\"},\n            {\"XAG\", \"Ag\"},\n            {\"XAU\", \"Au\"},\n            {CNH, \"¥\"},\n            {\"CNY\", \"¥\"},\n            {\"CZK\", \"Kč\"},\n            {\"DKK\", \"kr\"},\n            {\"HUF\", \"Ft\"},\n            {\"INR\", \"₹\"},\n            {\"MXN\", \"$\"},\n            {\"NOK\", \"kr\"},\n            {\"PLN\", \"zł\"},\n            {\"SAR\", \"﷼\"},\n            {\"SEK\", \"kr\"},\n            {\"THB\", \"฿\"},\n            {\"TRY\", \"₺\"},\n            {\"TWD\", \"NT$\"},\n            {\"ZAR\", \"R\"},\n            {\"RUB\", \"₽\"},\n            {\"BRL\", \"R$\"},\n            {\"GNF\", \"Fr\"},\n            {IDR, \"Rp\"},\n\n            {\"BTC\", \"₿\"},\n            {\"BCH\", \"Ƀ\"},\n            {\"BSV\", \"Ɓ\"},\n            {\"LTC\", \"Ł\"},\n            {\"ETH\", \"Ξ\"},\n            {\"EOS\", \"ε\"},\n            {\"XRP\", \"✕\"},\n            {\"XLM\", \"*\"},\n            {\"ETC\", \"ξ\"},\n            {\"ZRX\", \"ZRX\"},\n            {\"USDT\", \"₮\"},\n            {\"ADA\", \"₳\"},\n            {\"SOL\", \"◎\"},\n            {\"DOT\", \"●\"},\n            {\"DOGE\", \"Ð\"},\n            {\"DAI\", \"◈\"},\n            {\"ALGO\", \"Ⱥ\"},\n            {\"ICP\", \"∞\"},\n            {\"XMR\", \"ɱ\"},\n            {\"XTZ\", \"ꜩ\"},\n            {\"IOTA\", \"ɨ\"},\n            {\"MIOTA\", \"ɨ\"},\n            {\"MKR\", \"Μ\"},\n            {\"ZEC\", \"ⓩ\"},\n            {\"DASH\", \"Đ\"},\n            {\"XNO\", \"Ӿ\"},\n            {\"REP\", \"Ɍ\"},\n            {\"STEEM\", \"ȿ\"},\n            {\"THETA\", \"ϑ\"},\n            {\"FIL\", \"⨎\"},\n            {\"BAT\", \"⟁\"},\n            {\"LSK\", \"Ⱡ\"},\n            {\"NAV\", \"Ꞥ\"}\n        };\n\n        /// <summary>\n        /// Stable pairs in GDAX. We defined them because they have different fees in GDAX market\n        /// </summary>\n        [Obsolete(\"StablePairsGDAX is deprecated. Use StablePairsCoinbase instead.\")]\n        public static readonly HashSet<string> StablePairsGDAX = StablePairsCoinbase;\n\n        /// <summary>\n        /// Stable pairs in Coinbase. We defined them because they have different fees in Coinbase market\n        /// </summary>\n        public static readonly HashSet<string> StablePairsCoinbase = new()\n        {\n            \"DAIUSDC\",\n            \"DAIUSD\",\n            \"GYENUSD\",\n            \"PAXUSD\",\n            \"PAXUSDT\",\n            \"MUSDUSD\",\n            \"USDCEUR\",\n            \"USDCGBP\",\n            \"USDTEUR\",\n            \"USDTGBP\",\n            \"USDTUSD\",\n            \"USDTUSDC\",\n            \"USTEUR\",\n            \"USTUSD\",\n            \"USTUSDT\",\n            \"WBTCBTC\"\n        };\n\n        /// <summary>\n        /// Define some StableCoins that don't have direct pairs for base currencies in our SPDB in Coinbase market\n        /// This is because some CryptoExchanges do not define direct pairs with the stablecoins they offer.\n        ///\n        /// We use this to allow setting cash amounts for these stablecoins without needing a conversion\n        /// security.\n        /// </summary>\n        private static readonly HashSet<string> _stableCoinsWithoutPairsCoinbase = new HashSet<string>\n        {\n            \"USDCUSD\"\n        };\n\n        /// <summary>\n        /// Define some StableCoins that don't have direct pairs for base currencies in our SPDB in Binance market\n        /// This is because some CryptoExchanges do not define direct pairs with the stablecoins they offer.\n        ///\n        /// We use this to allow setting cash amounts for these stablecoins without needing a conversion\n        /// security.\n        /// </summary>\n        private static readonly HashSet<string> _stableCoinsWithoutPairsBinance = new HashSet<string>\n        {\n            \"USDCUSD\",\n            \"USDTUSD\",\n            \"USDPUSD\",\n            \"SUSDUSD\",\n            \"BUSDUSD\",\n            \"USTUSD\",\n            \"TUSDUSD\",\n            \"FDUSDUSD\",\n            \"DAIUSD\",\n            \"IDRTIDR\",\n            \"BNFCRUSD\"\n        };\n\n        /// <summary>\n        /// Define some StableCoins that don't have direct pairs for base currencies in our SPDB in Bitfinex market\n        /// This is because some CryptoExchanges do not define direct pairs with the stablecoins they offer.\n        ///\n        /// We use this to allow setting cash amounts for these stablecoins without needing a conversion\n        /// security.\n        /// </summary>\n        private static readonly HashSet<string> _stableCoinsWithoutPairsBitfinex = new HashSet<string>\n        {\n            \"EURSEUR\",\n            \"XCHFCHF\"\n        };\n\n        /// <summary>\n        /// Define some StableCoins that don't have direct pairs for base currencies in our SPDB in Bybit market\n        /// This is because some CryptoExchanges do not define direct pairs with the stablecoins they offer.\n        ///\n        /// We use this to allow setting cash amounts for these stablecoins without needing a conversion\n        /// security.\n        /// </summary>\n        private static readonly HashSet<string> _stableCoinsWithoutPairsBybit = new HashSet<string>\n        {\n            \"USDCUSD\",\n            \"USDTUSD\",\n            \"USDPUSD\",\n            \"SUSDUSD\",\n            \"BUSDUSD\",\n            \"USTUSD\",\n            \"TUSDUSD\",\n            \"DAIUSD\"\n        };\n\n        /// <summary>\n        /// Define some StableCoins that don't have direct pairs for base currencies in our SPDB in dYdX market\n        /// This is because some CryptoExchanges do not define direct pairs with the stablecoins they offer.\n        ///\n        /// We use this to allow setting cash amounts for these stablecoins without needing a conversion\n        /// security.\n        /// </summary>\n        private static readonly HashSet<string> _stableCoinsWithoutPairsdYdX = new HashSet<string>\n        {\n            \"USDCUSD\"\n        };\n\n        /// <summary>\n        /// Dictionary to save StableCoins in different Markets\n        /// </summary>\n        private static readonly Dictionary<string, HashSet<string>> _stableCoinsWithoutPairsMarkets = new Dictionary<string, HashSet<string>>\n        {\n            { Market.Binance , _stableCoinsWithoutPairsBinance},\n            { Market.Bitfinex , _stableCoinsWithoutPairsBitfinex},\n            { Market.Coinbase, _stableCoinsWithoutPairsCoinbase},\n            { Market.Bybit , _stableCoinsWithoutPairsBybit},\n            { Market.DYDX , _stableCoinsWithoutPairsdYdX}\n        };\n\n        private static readonly HashSet<string> _dollarStablePairs = [\"USDT\", \"USDC\", USD];\n\n        /// <summary>\n        /// Checks whether or not certain symbol is a StableCoin without pair in a given market\n        /// </summary>\n        /// <param name=\"accountCurrency\">The account currency</param>\n        /// <param name=\"cashSymbol\">The target cash symbol</param>\n        /// <param name=\"market\">The market in which we want to search for that StableCoin</param>\n        /// <returns>True if the given symbol is a StableCoin without pair in the given market</returns>\n        public static bool IsStableCoinWithoutPair(string accountCurrency, string cashSymbol, string market)\n        {\n            IEnumerable<string> _targets;\n            if (_dollarStablePairs.Contains(accountCurrency))\n            {\n                // let's be polite and handle USDT/USDC/USD, this is internal\n                _targets = _dollarStablePairs.Where(x => x != cashSymbol).SelectMany(x => new[] { x + cashSymbol, cashSymbol + x }).ToArray();\n            }\n            else\n            {\n                _targets = [accountCurrency + cashSymbol, cashSymbol + accountCurrency];\n            }\n\n            foreach (var target in _targets)\n            {\n                if (IsStableCoinWithoutPair(target, market))\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Checks whether or not certain symbol is a StableCoin without pair in a given market\n        /// </summary>\n        /// <param name=\"symbol\">The Symbol from wich we want to know if it's a StableCoin without pair</param>\n        /// <param name=\"market\">The market in which we want to search for that StableCoin</param>\n        /// <returns>True if the given symbol is a StableCoin without pair in the given market</returns>\n        public static bool IsStableCoinWithoutPair(string symbol, string market)\n        {\n            if (_stableCoinsWithoutPairsMarkets.TryGetValue(market, out var stableCoins) && stableCoins.Contains(symbol))\n            {\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the currency symbol for the specified currency code\n        /// </summary>\n        /// <param name=\"currency\">The currency code</param>\n        /// <returns>The currency symbol</returns>\n        public static string GetCurrencySymbol(string currency)\n        {\n            if (string.IsNullOrEmpty(currency))\n            {\n                return string.Empty;\n            }\n\n            return CurrencySymbols.TryGetValue(currency, out var currencySymbol) ? currencySymbol : currency;\n        }\n\n        /// <summary>\n        /// Converts the string representation of number with currency in the format {currency}{value} to its decimal equivalent.\n        /// It throws if the value cannot be converted to a decimal number.\n        /// </summary>\n        /// <param name=\"value\">The value with currency</param>\n        /// <returns>The decimal equivalent to the value</returns>\n        public static decimal Parse(string value)\n        {\n            decimal parsedValue;\n\n            if (!TryParse(value, out parsedValue))\n            {\n                throw new ArgumentException(Messages.Currencies.FailedConversionToDecimal(value));\n            }\n\n            return parsedValue;\n        }\n\n        /// <summary>\n        /// Converts the string representation of number with currency in the format {currency}{value} to its decimal equivalent.\n        /// </summary>\n        /// <param name=\"value\">The value with currency</param>\n        /// <param name=\"parsedValue\">The decimal equivalent to the string value after conversion</param>\n        /// <returns>True if the value was succesfuly converted</returns>\n        public static bool TryParse(string value, out decimal parsedValue)\n        {\n            // Strip out the currency (any character before the first number) ignoring blank spaces since they are not supposed to be in numbers with currency\n            value = Regex.Replace(value, @\"^[^\\d\\s-+]+\", string.Empty);\n            return decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedValue);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/AuxiliaryDataKey.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Unique definition key for a collection of auxiliary data for a Market and SecurityType\n    /// </summary>\n    public class AuxiliaryDataKey\n    {\n        /// <summary>\n        /// USA equities market corporate actions key definition\n        /// </summary>\n        public static AuxiliaryDataKey EquityUsa { get; } = new (QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The market associated with these corporate actions\n        /// </summary>\n        public string Market { get; }\n\n        /// <summary>\n        /// The associated security type\n        /// </summary>\n        public SecurityType SecurityType { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public AuxiliaryDataKey(string market, SecurityType securityType)\n        {\n            Market = market;\n            SecurityType = securityType;\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = Market.GetHashCode();\n                return (hashCode*397) ^ SecurityType.GetHashCode();\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param><filterpriority>2</filterpriority>\n        public override bool Equals(object? obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (obj.GetType() != GetType()) return false;\n\n            var other = (AuxiliaryDataKey)obj;\n\n            return other.Market == Market\n                && other.SecurityType == SecurityType;\n        }\n\n        /// <summary>\n        /// Returns a string containing the market and security type\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Market}:{SecurityType}\";\n        }\n\n        /// <summary>\n        /// Helper method to create a new instance from a Symbol\n        /// </summary>\n        public static AuxiliaryDataKey Create(Symbol symbol) => Create(symbol.HasUnderlying ? symbol.Underlying.ID : symbol.ID);\n\n        /// <summary>\n        /// Helper method to create a new instance from a SecurityIdentifier\n        /// </summary>\n        public static AuxiliaryDataKey Create(SecurityIdentifier securityIdentifier)\n        {\n            securityIdentifier = securityIdentifier.HasUnderlying ? securityIdentifier.Underlying : securityIdentifier;\n            return new AuxiliaryDataKey(securityIdentifier.Market, securityIdentifier.SecurityType);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/CorporateFactorProvider.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Corporate related factor provider. Factors based on splits and dividends\n    /// </summary>\n    public class CorporateFactorProvider : FactorFile<CorporateFactorRow>\n    {\n        /// <summary>\n        ///Creates a new instance\n        /// </summary>\n        public CorporateFactorProvider(string permtick, IEnumerable<CorporateFactorRow> data, DateTime? factorFileMinimumDate = null) : base(permtick, data, factorFileMinimumDate)\n        {\n        }\n\n        /// <summary>\n        /// Gets the price scale factor that includes dividend and split adjustments for the specified search date\n        /// </summary>\n        public override decimal GetPriceFactor(DateTime searchDate, DataNormalizationMode dataNormalizationMode, DataMappingMode? dataMappingMode = null, uint contractOffset = 0)\n        {\n            if (dataNormalizationMode == DataNormalizationMode.Raw)\n            {\n                return 0;\n            }\n\n            var factor = 1m;\n\n            for (var i = 0; i < ReversedFactorFileDates.Count; i++)\n            {\n                var factorDate = ReversedFactorFileDates[i];\n                if (factorDate.Date < searchDate.Date)\n                {\n                    break;\n                }\n\n                var factorFileRow = SortedFactorFileData[factorDate];\n                switch (dataNormalizationMode)\n                {\n                    case DataNormalizationMode.TotalReturn:\n                    case DataNormalizationMode.SplitAdjusted:\n                        factor = factorFileRow.First().SplitFactor;\n                        break;\n                    case DataNormalizationMode.Adjusted:\n                    case DataNormalizationMode.ScaledRaw:\n                        factor = factorFileRow.First().PriceScaleFactor;\n                        break;\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n            }\n\n            return factor;\n        }\n\n        /// <summary>\n        /// Gets price and split factors to be applied at the specified date\n        /// </summary>\n        public CorporateFactorRow GetScalingFactors(DateTime searchDate)\n        {\n            var factors = new CorporateFactorRow(searchDate, 1m, 1m, 0m);\n\n            // Iterate backwards to find the most recent factors\n            foreach (var splitDate in ReversedFactorFileDates)\n            {\n                if (splitDate.Date < searchDate.Date) break;\n                factors = SortedFactorFileData[splitDate][0];\n            }\n\n            return factors;\n        }\n\n        /// <summary>\n        /// Returns true if the specified date is the last trading day before a dividend event\n        /// is to be fired\n        /// </summary>\n        /// <remarks>\n        /// NOTE: The dividend event in the algorithm should be fired at the end or AFTER\n        /// this date. This is the date in the file that a factor is applied, so for example,\n        /// MSFT has a 31 cent dividend on 2015.02.17, but in the factor file the factor is applied\n        /// to 2015.02.13, which is the first trading day BEFORE the actual effective date.\n        /// </remarks>\n        /// <param name=\"date\">The date to check the factor file for a dividend event</param>\n        /// <param name=\"priceFactorRatio\">When this function returns true, this value will be populated\n        /// with the price factor ratio required to scale the closing value (pf_i/pf_i+1)</param>\n        /// <param name=\"referencePrice\">When this function returns true, this value will be populated\n        /// with the reference raw price, which is the close of the provided date</param>\n        public bool HasDividendEventOnNextTradingDay(DateTime date, out decimal priceFactorRatio, out decimal referencePrice)\n        {\n            priceFactorRatio = 0;\n            referencePrice = 0;\n            var index = SortedFactorFileData.IndexOfKey(date);\n            if (index > -1 && index < SortedFactorFileData.Count - 1)\n            {\n                // grab the next key to ensure it's a dividend event\n                var thisRow = SortedFactorFileData.Values[index].First();\n                var nextRow = SortedFactorFileData.Values[index + 1].First();\n\n                // if the price factors have changed then it's a dividend event\n                if (thisRow.PriceFactor != nextRow.PriceFactor)\n                {\n                    priceFactorRatio = thisRow.PriceFactor / nextRow.PriceFactor;\n                    referencePrice = thisRow.ReferencePrice;\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Returns true if the specified date is the last trading day before a split event\n        /// is to be fired\n        /// </summary>\n        /// <remarks>\n        /// NOTE: The split event in the algorithm should be fired at the end or AFTER this\n        /// date. This is the date in the file that a factor is applied, so for example MSFT\n        /// has a split on 1999.03.29, but in the factor file the split factor is applied on\n        /// 1999.03.26, which is the first trading day BEFORE the actual split date.\n        /// </remarks>\n        /// <param name=\"date\">The date to check the factor file for a split event</param>\n        /// <param name=\"splitFactor\">When this function returns true, this value will be populated\n        /// with the split factor ratio required to scale the closing value</param>\n        /// <param name=\"referencePrice\">When this function returns true, this value will be populated\n        /// with the reference raw price, which is the close of the provided date</param>\n        public bool HasSplitEventOnNextTradingDay(DateTime date, out decimal splitFactor, out decimal referencePrice)\n        {\n            splitFactor = 1;\n            referencePrice = 0;\n            var index = SortedFactorFileData.IndexOfKey(date);\n            if (index > -1 && index < SortedFactorFileData.Count - 1)\n            {\n                // grab the next key to ensure it's a split event\n                var thisRow = SortedFactorFileData.Values[index].First();\n                var nextRow = SortedFactorFileData.Values[index + 1].First();\n\n                // if the split factors have changed then it's a split event\n                if (thisRow.SplitFactor != nextRow.SplitFactor)\n                {\n                    splitFactor = thisRow.SplitFactor / nextRow.SplitFactor;\n                    referencePrice = thisRow.ReferencePrice;\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets all of the splits and dividends represented by this factor file\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to ues for the dividend and split objects</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <param name=\"decimalPlaces\">The number of decimal places to round the dividend's distribution to, defaulting to 2</param>\n        /// <returns>All splits and dividends represented by this factor file in chronological order</returns>\n        public List<BaseData> GetSplitsAndDividends(Symbol symbol, SecurityExchangeHours exchangeHours, int decimalPlaces = 2)\n        {\n            var dividendsAndSplits = new List<BaseData>();\n            if (SortedFactorFileData.Count == 0)\n            {\n                Log.Trace($\"{symbol} has no factors!\");\n                return dividendsAndSplits;\n            }\n\n            var futureFactorFileRow = SortedFactorFileData.Last().Value.First();\n            for (var i = SortedFactorFileData.Count - 2; i >= 0; i--)\n            {\n                var row = SortedFactorFileData.Values[i].First();\n                var dividend = row.GetDividend(futureFactorFileRow, symbol, exchangeHours, decimalPlaces);\n                if (dividend.Distribution != 0m)\n                {\n                    dividendsAndSplits.Add(dividend);\n                }\n\n                var split = row.GetSplit(futureFactorFileRow, symbol, exchangeHours);\n                if (split.SplitFactor != 1m)\n                {\n                    dividendsAndSplits.Add(split);\n                }\n\n                futureFactorFileRow = row;\n            }\n\n            return dividendsAndSplits.OrderBy(d => d.Time.Date).ToList();\n        }\n\n        /// <summary>\n        /// Creates a new factor file with the specified data applied.\n        /// Only <see cref=\"Dividend\"/> and <see cref=\"Split\"/> data types\n        /// will be used.\n        /// </summary>\n        /// <param name=\"data\">The data to apply</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <returns>A new factor file that incorporates the specified dividend</returns>\n        public CorporateFactorProvider Apply(List<BaseData> data, SecurityExchangeHours exchangeHours)\n        {\n            if (data.Count == 0)\n            {\n                return this;\n            }\n\n            var factorFileRows = new List<CorporateFactorRow>();\n            var firstEntry = SortedFactorFileData.First().Value.First();\n            var lastEntry = SortedFactorFileData.Last().Value.First();\n            factorFileRows.Add(lastEntry);\n\n            var splitsAndDividends = GetSplitsAndDividends(data[0].Symbol, exchangeHours);\n\n            var combinedData = splitsAndDividends.Concat(data)\n                .DistinctBy(e => $\"{e.GetType().Name}{e.Time.ToStringInvariant(DateFormat.EightCharacter)}\")\n                .OrderByDescending(d => d.Time.Date);\n\n            foreach (var datum in combinedData)\n            {\n                CorporateFactorRow nextEntry = null;\n                var split = datum as Split;\n                var dividend = datum as Dividend;\n                if (dividend != null)\n                {\n                    nextEntry = lastEntry.Apply(dividend, exchangeHours);\n                    lastEntry = nextEntry;\n                }\n                else if (split != null)\n                {\n                    nextEntry = lastEntry.Apply(split, exchangeHours);\n                    lastEntry = nextEntry;\n                }\n\n                if (nextEntry != null)\n                {\n                    // overwrite the latest entry -- this handles splits/dividends on the same date\n                    if (nextEntry.Date == factorFileRows.Last().Date)\n                    {\n                        factorFileRows[factorFileRows.Count - 1] = nextEntry;\n                    }\n                    else\n                    {\n                        factorFileRows.Add(nextEntry);\n                    }\n                }\n            }\n\n            var firstFactorFileRow = new CorporateFactorRow(firstEntry.Date, factorFileRows.Last().PriceFactor, factorFileRows.Last().SplitFactor, firstEntry.ReferencePrice == 0 ? 0 : firstEntry.ReferencePrice);\n            var existing = factorFileRows.FindIndex(row => row.Date == firstFactorFileRow.Date);\n            if (existing == -1)\n            {\n                // only add it if not present\n                factorFileRows.Add(firstFactorFileRow);\n            }\n\n            return new CorporateFactorProvider(Permtick, factorFileRows, FactorFileMinimumDate);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/CorporateFactorRow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Defines a single row in a factor_factor file. This is a csv file ordered as {date, price factor, split factor, reference price}\n    /// </summary>\n    public class CorporateFactorRow : IFactorRow\n    {\n        private decimal _splitFactor;\n        private decimal _priceFactor;\n\n        /// <summary>\n        /// Gets the date associated with this data\n        /// </summary>\n        public DateTime Date { get; private set; }\n\n        /// <summary>\n        /// Gets the price factor associated with this data\n        /// </summary>\n        public decimal PriceFactor\n        {\n            get\n            {\n                return _priceFactor;\n\n            }\n            set\n            {\n                _priceFactor = value;\n                UpdatePriceScaleFactor();\n            }\n        }\n\n        /// <summary>\n        /// Gets the split factor associated with the date\n        /// </summary>\n        public decimal SplitFactor\n        {\n            get\n            {\n                return _splitFactor;\n            }\n            set\n            {\n                _splitFactor = value;\n                UpdatePriceScaleFactor();\n            }\n        }\n\n        /// <summary>\n        /// Gets the combined factor used to create adjusted prices from raw prices\n        /// </summary>\n        public decimal PriceScaleFactor { get; private set; }\n\n        /// <summary>\n        /// Gets the raw closing value from the trading date before the updated factor takes effect\n        /// </summary>\n        public decimal ReferencePrice { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CorporateFactorRow\"/> class\n        /// </summary>\n        public CorporateFactorRow(DateTime date, decimal priceFactor, decimal splitFactor, decimal referencePrice = 0)\n        {\n            Date = date;\n            ReferencePrice = referencePrice;\n            PriceFactor = priceFactor;\n            SplitFactor = splitFactor;\n        }\n\n        /// <summary>\n        /// Parses the lines as factor files rows while properly handling inf entries\n        /// </summary>\n        /// <param name=\"lines\">The lines from the factor file to be parsed</param>\n        /// <param name=\"factorFileMinimumDate\">The minimum date from the factor file</param>\n        /// <returns>An enumerable of factor file rows</returns>\n        public static List<CorporateFactorRow> Parse(IEnumerable<string> lines, out DateTime? factorFileMinimumDate)\n        {\n            factorFileMinimumDate = null;\n\n            var rows = new List<CorporateFactorRow>();\n\n            // parse factor file lines\n            foreach (var line in lines)\n            {\n                // Exponential notation is treated as inf is because of the loss of precision. In\n                // all cases, the significant part has fewer decimals than the needed for a correct\n                // representation, E.g., 1.6e+6 when the correct factor is 1562500.\n                if (line.Contains(\"inf\") || line.Contains(\"e+\"))\n                {\n                    continue;\n                }\n\n                var row = Parse(line);\n\n                // ignore zero factor rows\n                if (row.PriceScaleFactor > 0)\n                {\n                    rows.Add(row);\n                }\n            }\n\n            if (rows.Count > 0)\n            {\n                factorFileMinimumDate = rows.Min(ffr => ffr.Date).AddDays(-1);\n            }\n\n            return rows;\n        }\n\n        /// <summary>\n        /// Applies the dividend to this factor file row.\n        /// This dividend date must be on or before the factor\n        /// file row date\n        /// </summary>\n        /// <param name=\"dividend\">The dividend to apply with reference price and distribution specified</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <returns>A new factor file row that applies the dividend to this row's factors</returns>\n        public CorporateFactorRow Apply(Dividend dividend, SecurityExchangeHours exchangeHours)\n        {\n            if (dividend.ReferencePrice == 0m)\n            {\n                throw new ArgumentException(\"Unable to apply dividend with reference price of zero.\");\n            }\n\n            var previousTradingDay = exchangeHours.GetPreviousTradingDay(dividend.Time);\n\n            // this instance must be chronologically at or in front of the dividend\n            // this is because the factors are defined working from current to past\n            if (Date < previousTradingDay)\n            {\n                throw new ArgumentException(Invariant(\n                    $\"Factor file row date '{Date:yyy-MM-dd}' is before dividend previous trading date '{previousTradingDay.Date:yyyy-MM-dd}'.\"\n                ));\n            }\n\n            // pfi - new price factor pf(i+1) - this price factor D - distribution C - previous close\n            // pfi = pf(i+1) * (C-D)/C\n            var priceFactor = PriceFactor * (dividend.ReferencePrice - dividend.Distribution) / dividend.ReferencePrice;\n\n            return new CorporateFactorRow(\n                previousTradingDay,\n                priceFactor,\n                SplitFactor,\n                dividend.ReferencePrice\n            );\n        }\n\n        /// <summary>\n        /// Applies the split to this factor file row.\n        /// This split date must be on or before the factor\n        /// file row date\n        /// </summary>\n        /// <param name=\"split\">The split to apply with reference price and split factor specified</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <returns>A new factor file row that applies the split to this row's factors</returns>\n        public CorporateFactorRow Apply(Split split, SecurityExchangeHours exchangeHours)\n        {\n            if (split.Type == SplitType.Warning)\n            {\n                throw new ArgumentException(\"Unable to apply split with type warning. Only actual splits may be applied\");\n            }\n\n            if (split.ReferencePrice == 0m)\n            {\n                throw new ArgumentException(\"Unable to apply split with reference price of zero.\");\n            }\n\n            var previousTradingDay = exchangeHours.GetPreviousTradingDay(split.Time);\n\n            // this instance must be chronologically at or in front of the split\n            // this is because the factors are defined working from current to past\n            if (Date < previousTradingDay)\n            {\n                throw new ArgumentException(Invariant(\n                    $\"Factor file row date '{Date:yyy-MM-dd}' is before split date '{split.Time.Date:yyyy-MM-dd}'.\"\n                ));\n            }\n\n            return new CorporateFactorRow(\n                previousTradingDay,\n                PriceFactor,\n                SplitFactor * split.SplitFactor,\n                split.ReferencePrice\n            );\n        }\n\n        /// <summary>\n        /// Creates a new dividend from this factor file row and the one chronologically in front of it\n        /// This dividend may have a distribution of zero if this row doesn't represent a dividend\n        /// </summary>\n        /// <param name=\"nextCorporateFactorRow\">The next factor file row in time</param>\n        /// <param name=\"symbol\">The symbol to use for the dividend</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <param name=\"decimalPlaces\">The number of decimal places to round the dividend's distribution to, defaulting to 2</param>\n        /// <returns>A new dividend instance</returns>\n        public Dividend GetDividend(CorporateFactorRow nextCorporateFactorRow, Symbol symbol, SecurityExchangeHours exchangeHours, int decimalPlaces=2)\n        {\n            if (nextCorporateFactorRow.PriceFactor == 0m)\n            {\n                throw new InvalidOperationException(Invariant(\n                    $\"Unable to resolve dividend for '{symbol.ID}' at {Date:yyyy-MM-dd}. Price factor is zero.\"\n                ));\n            }\n\n            // find previous trading day\n            var previousTradingDay = exchangeHours.GetNextTradingDay(Date);\n\n            return Dividend.Create(\n                symbol,\n                previousTradingDay,\n                ReferencePrice,\n                PriceFactor / nextCorporateFactorRow.PriceFactor,\n                decimalPlaces\n            );\n        }\n\n        /// <summary>\n        /// Creates a new split from this factor file row and the one chronologically in front of it\n        /// This split may have a split factor of one if this row doesn't represent a split\n        /// </summary>\n        /// <param name=\"nextCorporateFactorRow\">The next factor file row in time</param>\n        /// <param name=\"symbol\">The symbol to use for the split</param>\n        /// <param name=\"exchangeHours\">Exchange hours used for resolving the previous trading day</param>\n        /// <returns>A new split instance</returns>\n        public Split GetSplit(CorporateFactorRow nextCorporateFactorRow, Symbol symbol, SecurityExchangeHours exchangeHours)\n        {\n            if (nextCorporateFactorRow.SplitFactor == 0m)\n            {\n                throw new InvalidOperationException(Invariant(\n                    $\"Unable to resolve split for '{symbol.ID}' at {Date:yyyy-MM-dd}. Split factor is zero.\"\n                ));\n            }\n\n            // find previous trading day\n            var previousTradingDay = exchangeHours.GetNextTradingDay(Date);\n\n            return new Split(\n                symbol,\n                previousTradingDay,\n                ReferencePrice,\n                SplitFactor / nextCorporateFactorRow.SplitFactor,\n                SplitType.SplitOccurred\n            );\n        }\n\n        /// <summary>\n        /// Parses the specified line as a factor file row\n        /// </summary>\n        private static CorporateFactorRow Parse(string line)\n        {\n            var csv = line.Split(',');\n            return new CorporateFactorRow(\n                QuantConnect.Parse.DateTimeExact(csv[0], DateFormat.EightCharacter, DateTimeStyles.None),\n                QuantConnect.Parse.Decimal(csv[1]),\n                QuantConnect.Parse.Decimal(csv[2]),\n                csv.Length > 3 ? QuantConnect.Parse.Decimal(csv[3]) : 0m\n            );\n        }\n\n        /// <summary>\n        /// Writes factor file row into it's file format\n        /// </summary>\n        /// <remarks>CSV formatted</remarks>\n        public string GetFileFormat(string source = null)\n        {\n            source = source == null ? \"\" : $\",{source}\";\n            return $\"{Date.ToStringInvariant(DateFormat.EightCharacter)},\" +\n                   Invariant($\"{Math.Round(PriceFactor, 7)},\") +\n                   Invariant($\"{Math.Round(SplitFactor, 8)},\") +\n                   Invariant($\"{Math.Round(ReferencePrice, 4).Normalize()}\") +\n                   $\"{source}\";\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Invariant($\"{Date:yyyy-MM-dd}: {PriceScaleFactor:0.0000} {SplitFactor:0.0000}\");\n        }\n\n        /// <summary>\n        /// For performance we update <see cref=\"PriceScaleFactor\"/> when underlying\n        /// values are updated to avoid decimal multiplication on each get operation.\n        /// </summary>\n        private void UpdatePriceScaleFactor()\n        {\n            PriceScaleFactor = _priceFactor * _splitFactor;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/FactorFile.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Represents an entire factor file for a specified symbol\n    /// </summary>\n    public abstract class FactorFile<T> : IFactorProvider\n        where T : IFactorRow\n    {\n        /// <summary>\n        /// Keeping a reversed version is more performant that reversing it each time we need it\n        /// </summary>\n        protected List<DateTime> ReversedFactorFileDates { get; }\n\n        /// <summary>\n        /// The factor file data rows sorted by date\n        /// </summary>\n        public SortedList<DateTime, List<T>> SortedFactorFileData { get; set; }\n\n        /// <summary>\n        /// The minimum tradeable date for the symbol\n        /// </summary>\n        /// <remarks>\n        /// Some factor files have INF split values, indicating that the stock has so many splits\n        /// that prices can't be calculated with correct numerical precision.\n        /// To allow backtesting these symbols, we need to move the starting date\n        /// forward when reading the data.\n        /// Known symbols: GBSN, JUNI, NEWL\n        /// </remarks>\n        public DateTime? FactorFileMinimumDate { get; set; }\n\n        /// <summary>\n        /// Gets the most recent factor change in the factor file\n        /// </summary>\n        public DateTime MostRecentFactorChange => ReversedFactorFileDates\n            .FirstOrDefault(time => time != Time.EndOfTime);\n\n        /// <summary>\n        /// Gets the symbol this factor file represents\n        /// </summary>\n        public string Permtick { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FactorFile{T}\"/> class.\n        /// </summary>\n        protected FactorFile(string permtick, IEnumerable<T> data, DateTime? factorFileMinimumDate = null)\n        {\n            Permtick = permtick.LazyToUpper();\n\n            SortedFactorFileData = new SortedList<DateTime, List<T>>();\n            foreach (var row in data)\n            {\n                if (!SortedFactorFileData.TryGetValue(row.Date, out var factorFileRows))\n                {\n                    SortedFactorFileData[row.Date] = factorFileRows = new List<T>();\n                }\n\n                factorFileRows.Add(row);\n            }\n\n            ReversedFactorFileDates = new List<DateTime>(SortedFactorFileData.Count);\n            foreach (var time in SortedFactorFileData.Keys.Reverse())\n            {\n                ReversedFactorFileDates.Add(time);\n            }\n\n            FactorFileMinimumDate = factorFileMinimumDate;\n        }\n\n        /// <summary>\n        /// Gets the price scale factor for the specified search date\n        /// </summary>\n        public abstract decimal GetPriceFactor(\n            DateTime searchDate,\n            DataNormalizationMode dataNormalizationMode,\n            DataMappingMode? dataMappingMode = null,\n            uint contractOffset = 0\n            );\n\n        /// <summary>\n        /// Writes this factor file data to an enumerable of csv lines\n        /// </summary>\n        /// <returns>An enumerable of lines representing this factor file</returns>\n        public IEnumerable<string> GetFileFormat()\n        {\n            return SortedFactorFileData.SelectMany(kvp => kvp.Value.Select(row => row.GetFileFormat()));\n        }\n\n        /// <summary>\n        /// Write the factor file to the correct place in the default Data folder\n        /// </summary>\n        /// <param name=\"symbol\">The symbol this factor file represents</param>\n        public void WriteToFile(Symbol symbol)\n        {\n            var filePath = LeanData.GenerateRelativeFactorFilePath(symbol);\n            File.WriteAllLines(filePath, GetFileFormat());\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<IFactorRow> GetEnumerator()\n        {\n            foreach (var kvp in SortedFactorFileData)\n            {\n                foreach (var factorRow in kvp.Value)\n                {\n                    yield return factorRow;\n                }\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/FactorFileZipHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Collections.Generic;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides methods for reading factor file zips\n    /// </summary>\n    public static class FactorFileZipHelper\n    {\n        /// <summary>\n        /// Constructs the factor file path for the specified market and security type\n        /// </summary>\n        /// <param name=\"market\">The market this symbol belongs to</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <returns>The relative file path</returns>\n        public static string GetRelativeFactorFilePath(string market, SecurityType securityType)\n        {\n            return Invariant($\"{securityType.SecurityTypeToLower()}/{market}/factor_files\");\n        }\n\n        /// <summary>\n        /// Gets the factor file zip filename for the specified date\n        /// </summary>\n        public static string GetFactorFileZipFileName(string market, DateTime date, SecurityType securityType)\n        {\n            return Path.Combine(Globals.DataFolder, GetRelativeFactorFilePath(market, securityType), $\"factor_files_{date:yyyyMMdd}.zip\");\n        }\n\n        /// <summary>\n        /// Reads the zip bytes as text and parses as FactorFileRows to create FactorFiles\n        /// </summary>\n        public static IEnumerable<KeyValuePair<Symbol, IFactorProvider>> ReadFactorFileZip(Stream file, MapFileResolver mapFileResolver, string market, SecurityType securityType)\n        {\n            if (file == null || file.Length == 0)\n            {\n                return new Dictionary<Symbol, IFactorProvider>();\n            }\n\n            var keyValuePairs = (\n                    from kvp in Compression.Unzip(file)\n                    let filename = kvp.Key\n                    let lines = kvp.Value\n                    let factorFile = PriceScalingExtensions.SafeRead(Path.GetFileNameWithoutExtension(filename), lines, securityType)\n                    let mapFile = mapFileResolver.GetByPermtick(factorFile.Permtick)\n                    where mapFile != null\n                    select new KeyValuePair<Symbol, IFactorProvider>(GetSymbol(mapFile, market, securityType), factorFile)\n                );\n\n            return keyValuePairs;\n        }\n\n        private static Symbol GetSymbol(MapFile mapFile, string market, SecurityType securityType)\n        {\n            SecurityIdentifier sid;\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    sid = SecurityIdentifier.GenerateEquity(mapFile.FirstDate, mapFile.FirstTicker, market);\n                    break;\n                case SecurityType.Future:\n                    sid = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, mapFile.Permtick, market);\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(securityType), securityType, null);\n            }\n            return new Symbol(sid, mapFile.Permtick);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/IFactorProvider.cs",
    "content": "﻿/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Providers price scaling factors for a permanent tick\n    /// </summary>\n    public interface IFactorProvider : IEnumerable<IFactorRow>\n    {\n        /// <summary>\n        /// Gets the symbol this factor file represents\n        /// </summary>\n        public string Permtick { get; }\n\n        /// <summary>\n        /// The minimum tradeable date for the symbol\n        /// </summary>\n        /// <remarks>\n        /// Some factor files have INF split values, indicating that the stock has so many splits\n        /// that prices can't be calculated with correct numerical precision.\n        /// To allow backtesting these symbols, we need to move the starting date\n        /// forward when reading the data.\n        /// Known symbols: GBSN, JUNI, NEWL\n        /// </remarks>\n        public DateTime? FactorFileMinimumDate { get; set; }\n\n        /// <summary>\n        /// Gets the price factor for the specified search date\n        /// </summary>\n        decimal GetPriceFactor(DateTime searchDate, DataNormalizationMode dataNormalizationMode, DataMappingMode? dataMappingMode = null, uint contractOffset = 0);\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/IFactorRow.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Factor row abstraction. <see cref=\"IFactorProvider\"/>\n    /// </summary>\n    public interface IFactorRow\n    {\n        /// <summary>\n        /// Gets the date associated with this data\n        /// </summary>\n        DateTime Date { get; }\n\n        /// <summary>\n        /// Writes factor file row into it's file format\n        /// </summary>\n        string GetFileFormat(string source = null);\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IFactorFileProvider\"/> that searches the local disk\n    /// </summary>\n    public class LocalDiskFactorFileProvider : IFactorFileProvider\n    {\n        private IMapFileProvider _mapFileProvider;\n        private IDataProvider _dataProvider;\n        private readonly ConcurrentDictionary<Symbol, IFactorProvider> _cache;\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LocalDiskFactorFileProvider\"/>\n        /// </summary>\n        public LocalDiskFactorFileProvider()\n        {\n            _cache = new ConcurrentDictionary<Symbol, IFactorProvider>();\n        }\n\n        /// <summary>\n        /// Initializes our FactorFileProvider by supplying our mapFileProvider\n        /// and dataProvider\n        /// </summary>\n        /// <param name=\"mapFileProvider\">MapFileProvider to use</param>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider)\n        {\n            _mapFileProvider = mapFileProvider;\n            _dataProvider = dataProvider;\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"FactorFile{T}\"/> instance for the specified symbol, or null if not found\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol whose factor file we seek</param>\n        /// <returns>The resolved factor file, or null if not found</returns>\n        public IFactorProvider Get(Symbol symbol)\n        {\n            symbol = symbol.GetFactorFileSymbol();\n            IFactorProvider factorFile;\n            if (_cache.TryGetValue(symbol, out factorFile))\n            {\n                return factorFile;\n            }\n\n            // we first need to resolve the map file to get a permtick, that's how the factor files are stored\n            var mapFileResolver = _mapFileProvider.Get(AuxiliaryDataKey.Create(symbol));\n            if (mapFileResolver == null)\n            {\n                return GetFactorFile(symbol, symbol.Value);\n            }\n\n            var mapFile = mapFileResolver.ResolveMapFile(symbol);\n            if (mapFile.IsNullOrEmpty())\n            {\n                return GetFactorFile(symbol, symbol.Value);\n            }\n\n            return GetFactorFile(symbol, mapFile.Permtick);\n        }\n\n        /// <summary>\n        /// Checks that the factor file exists on disk, and if it does, loads it into memory\n        /// </summary>\n        private IFactorProvider GetFactorFile(Symbol symbol, string permtick)\n        {\n            var basePath = Globals.GetDataFolderPath(FactorFileZipHelper.GetRelativeFactorFilePath(symbol.ID.Market, symbol.SecurityType));\n            var path = Path.Combine(basePath, permtick.ToLowerInvariant() + \".csv\");\n\n            var factorFile = PriceScalingExtensions.SafeRead(permtick, _dataProvider.ReadLines(path), symbol.SecurityType);\n            _cache.AddOrUpdate(symbol, factorFile, (s, c) => factorFile);\n            return factorFile;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/LocalDiskMapFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"IMapFileProvider\"/> that reads from\n    /// the local disk\n    /// </summary>\n    public class LocalDiskMapFileProvider : IMapFileProvider\n    {\n        private static int _wroteTraceStatement;\n        private readonly ConcurrentDictionary<AuxiliaryDataKey, MapFileResolver> _cache;\n        private IDataProvider _dataProvider;\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LocalDiskFactorFileProvider\"/>\n        /// </summary>\n        public LocalDiskMapFileProvider()\n        {\n            _cache = new ConcurrentDictionary<AuxiliaryDataKey, MapFileResolver>();\n        }\n\n        /// <summary>\n        /// Initializes our MapFileProvider by supplying our dataProvider\n        /// </summary>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        public void Initialize(IDataProvider dataProvider)\n        {\n            _dataProvider = dataProvider;\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"MapFileResolver\"/> representing all the map\n        /// files for the specified market\n        /// </summary>\n        /// <param name=\"auxiliaryDataKey\">Key used to fetch a map file resolver. Specifying market and security type</param>\n        /// <returns>A <see cref=\"MapFileRow\"/> containing all map files for the specified market</returns>\n        public MapFileResolver Get(AuxiliaryDataKey auxiliaryDataKey)\n        {\n            return _cache.GetOrAdd(auxiliaryDataKey, GetMapFileResolver);\n        }\n\n        private MapFileResolver GetMapFileResolver(AuxiliaryDataKey key)\n        {\n            var securityType = key.SecurityType;\n            var market = key.Market;\n\n            var mapFileDirectory = Globals.GetDataFolderPath(MapFile.GetRelativeMapFilePath(market, securityType));\n            if (!Directory.Exists(mapFileDirectory))\n            {\n                // only write this message once per application instance\n                if (Interlocked.CompareExchange(ref _wroteTraceStatement, 1, 0) == 0)\n                {\n                    Log.Error($\"LocalDiskMapFileProvider.GetMapFileResolver({market}): \" +\n                        $\"The specified directory does not exist: {mapFileDirectory}\"\n                    );\n                }\n                return MapFileResolver.Empty;\n            }\n            return new MapFileResolver(MapFile.GetMapFiles(mapFileDirectory, market, securityType, _dataProvider));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/LocalZipFactorFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IFactorFileProvider\"/> that searches the local disk for a zip file containing all factor files\n    /// </summary>\n    public class LocalZipFactorFileProvider : IFactorFileProvider\n    {\n        private readonly object _lock;\n        private IDataProvider _dataProvider;\n        private IMapFileProvider _mapFileProvider;\n        private Dictionary<AuxiliaryDataKey, bool> _seededMarket;\n        private readonly Dictionary<Symbol, IFactorProvider> _factorFiles;\n\n        /// <summary>\n        /// The cached refresh period for the factor files\n        /// </summary>\n        /// <remarks>Exposed for testing</remarks>\n        protected virtual TimeSpan CacheRefreshPeriod\n        {\n            get\n            {\n                var dueTime = Time.GetNextLiveAuxiliaryDataDueTime();\n                if (dueTime > TimeSpan.FromMinutes(10))\n                {\n                    // Clear the cache before the auxiliary due time to avoid race conditions with consumers\n                    return dueTime - TimeSpan.FromMinutes(10);\n                }\n                return dueTime;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LocalZipFactorFileProvider\"/> class.\n        /// </summary>\n        public LocalZipFactorFileProvider()\n        {\n            _factorFiles = new Dictionary<Symbol, IFactorProvider>();\n            _seededMarket = new Dictionary<AuxiliaryDataKey, bool>();\n            _lock = new object();\n        }\n\n        /// <summary>\n        /// Initializes our FactorFileProvider by supplying our mapFileProvider\n        /// and dataProvider\n        /// </summary>\n        /// <param name=\"mapFileProvider\">MapFileProvider to use</param>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider)\n        {\n            if (_mapFileProvider != null || _dataProvider != null)\n            {\n                return;\n            }\n            \n            _mapFileProvider = mapFileProvider;\n            _dataProvider = dataProvider;\n            StartExpirationTask();\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"FactorFile{T}\"/> instance for the specified symbol, or null if not found\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol whose factor file we seek</param>\n        /// <returns>The resolved factor file, or null if not found</returns>\n        public IFactorProvider Get(Symbol symbol)\n        {\n            symbol = symbol.GetFactorFileSymbol();\n            var key = AuxiliaryDataKey.Create(symbol);\n            lock (_lock)\n            {\n                if (!_seededMarket.ContainsKey(key))\n                {\n                    HydrateFactorFileFromLatestZip(key);\n                    _seededMarket[key] = true;\n                }\n\n                IFactorProvider factorFile;\n                if (!_factorFiles.TryGetValue(symbol, out factorFile))\n                {\n                    // Could not find factor file for symbol\n                    Log.Error($\"LocalZipFactorFileProvider.Get({symbol}): No factor file found.\");\n                    _factorFiles[symbol] = factorFile = symbol.GetEmptyFactorFile();\n                }\n                return factorFile;\n            }\n        }\n\n        /// <summary>\n        /// Helper method that will clear any cached factor files in a daily basis, this is useful for live trading\n        /// </summary>\n        protected virtual void StartExpirationTask()\n        {\n            lock (_lock)\n            {\n                // we clear the seeded markets so they are reloaded\n                _seededMarket = new Dictionary<AuxiliaryDataKey, bool>();\n            }\n            _ = Task.Delay(CacheRefreshPeriod).ContinueWith(_ => StartExpirationTask());\n        }\n\n        /// Hydrate the <see cref=\"_factorFiles\"/> from the latest zipped factor file on disk\n        private void HydrateFactorFileFromLatestZip(AuxiliaryDataKey key)\n        {\n            var market = key.Market;\n            // start the search with yesterday, today's file will be available tomorrow\n            var todayNewYork = DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork).Date;\n            var date = todayNewYork.AddDays(-1);\n\n            var count = 0;\n\n            do\n            {\n                var factorFilePath = FactorFileZipHelper.GetFactorFileZipFileName(market, date, key.SecurityType);\n\n                // Fetch a stream for our zip from our data provider\n                var stream = _dataProvider.Fetch(factorFilePath);\n\n                // If the file was found we can read the file\n                if (stream != null)\n                {\n                    var mapFileResolver = _mapFileProvider.Get(key);\n                    foreach (var keyValuePair in FactorFileZipHelper.ReadFactorFileZip(stream, mapFileResolver, market, key.SecurityType))\n                    {\n                        // we merge with existing, this will allow to hold multiple markets\n                        _factorFiles[keyValuePair.Key] = keyValuePair.Value;\n                    }\n                    stream.DisposeSafely();\n                    Log.Trace($\"LocalZipFactorFileProvider.Get({market}): Fetched factor files for: {date.ToShortDateString()} NY\");\n\n                    return;\n                }\n\n                // Otherwise we will search back another day\n                Log.Debug($\"LocalZipFactorFileProvider.Get({market}): No factor file found for date {date.ToShortDateString()}\");\n\n                // prevent infinite recursion if something is wrong\n                if (count++ > 7)\n                {\n                    throw new InvalidOperationException($\"LocalZipFactorFileProvider.Get(): Could not find any factor files going all the way back to {date} for {market}\");\n                }\n\n                date = date.AddDays(-1);\n            }\n            while (true);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/LocalZipMapFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IMapFileProvider\"/> that reads from a local zip file\n    /// </summary>\n    public class LocalZipMapFileProvider : IMapFileProvider\n    {\n        private Dictionary<AuxiliaryDataKey, MapFileResolver> _cache;\n        private IDataProvider _dataProvider;\n        private object _lock;\n\n        /// <summary>\n        /// The cached refresh period for the map files\n        /// </summary>\n        /// <remarks>Exposed for testing</remarks>\n        protected virtual TimeSpan CacheRefreshPeriod\n        {\n            get\n            {\n                var dueTime = Time.GetNextLiveAuxiliaryDataDueTime();\n                if (dueTime > TimeSpan.FromMinutes(10))\n                {\n                    // Clear the cache before the auxiliary due time to avoid race conditions with consumers\n                    return dueTime - TimeSpan.FromMinutes(10);\n                }\n                return dueTime;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LocalDiskFactorFileProvider\"/>\n        /// </summary>\n        public LocalZipMapFileProvider()\n        {\n            _lock = new object();\n            _cache = new Dictionary<AuxiliaryDataKey, MapFileResolver>();\n        }\n\n        /// <summary>\n        /// Initializes our MapFileProvider by supplying our dataProvider\n        /// </summary>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        public void Initialize(IDataProvider dataProvider)\n        {\n            if (_dataProvider != null)\n            {\n                return;\n            }\n            \n            _dataProvider = dataProvider;\n            StartExpirationTask();\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"MapFileResolver\"/> representing all the map files for the specified market\n        /// </summary>\n        /// <param name=\"auxiliaryDataKey\">Key used to fetch a map file resolver. Specifying market and security type</param>\n        /// <returns>A <see cref=\"MapFileResolver\"/> containing all map files for the specified market</returns>\n        public MapFileResolver Get(AuxiliaryDataKey auxiliaryDataKey)\n        {\n            MapFileResolver result;\n            // we use a lock so that only 1 thread loads the map file resolver while the rest wait\n            // else we could have multiple threads loading the map file resolver at the same time!\n            lock (_lock)\n            {\n                if (!_cache.TryGetValue(auxiliaryDataKey, out result))\n                {\n                    _cache[auxiliaryDataKey] = result = GetMapFileResolver(auxiliaryDataKey);\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method that will clear any cached factor files in a daily basis, this is useful for live trading\n        /// </summary>\n        protected virtual void StartExpirationTask()\n        {\n            lock (_lock)\n            {\n                // we clear the seeded markets so they are reloaded\n                _cache = new Dictionary<AuxiliaryDataKey, MapFileResolver>();\n            }\n            _ = Task.Delay(CacheRefreshPeriod).ContinueWith(_ => StartExpirationTask());\n        }\n\n        private MapFileResolver GetMapFileResolver(AuxiliaryDataKey auxiliaryDataKey)\n        {\n            var market = auxiliaryDataKey.Market;\n            var timestamp = DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork);\n            var todayNewYork = timestamp.Date;\n            var yesterdayNewYork = todayNewYork.AddDays(-1);\n\n            // start the search with yesterday, today's file will be available tomorrow\n            var count = 0;\n            var date = yesterdayNewYork;\n            do\n            {\n                var zipFileName = MapFileZipHelper.GetMapFileZipFileName(market, date, auxiliaryDataKey.SecurityType);\n\n                // Fetch a stream for our zip from our data provider\n                var stream = _dataProvider.Fetch(zipFileName);\n\n                // If we found a file we can read it \n                if (stream != null)\n                {\n                    Log.Trace(\"LocalZipMapFileProvider.Get({0}): Fetched map files for: {1} NY\", market, date.ToShortDateString());\n                    var result =  new MapFileResolver(MapFileZipHelper.ReadMapFileZip(stream, market, auxiliaryDataKey.SecurityType));\n                    stream.DisposeSafely();\n                    return result;\n                }\n\n                // prevent infinite recursion if something is wrong\n                if (count++ > 30)\n                {\n                    throw new InvalidOperationException($\"LocalZipMapFileProvider couldn't find any map files going all the way back to {date} for {market}\");\n                }\n\n                date = date.AddDays(-1);\n            }\n            while (true);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MapFile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Represents an entire map file for a specified symbol\n    /// </summary>\n    public class MapFile : IEnumerable<MapFileRow>\n    {\n        private readonly List<MapFileRow> _data;\n\n        /// <summary>\n        /// Gets the entity's unique symbol, i.e OIH.1\n        /// </summary>\n        public string Permtick { get; }\n\n        /// <summary>\n        /// Gets the last date in the map file which is indicative of a delisting event\n        /// </summary>\n        public DateTime DelistingDate { get; }\n\n        /// <summary>\n        /// Gets the first date in this map file\n        /// </summary>\n        public DateTime FirstDate { get; }\n\n        /// <summary>\n        /// Gets the first ticker for the security represented by this map file\n        /// </summary>\n        public string FirstTicker { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MapFile\"/> class.\n        /// </summary>\n        public MapFile(string permtick, IEnumerable<MapFileRow> data)\n        {\n            if (string.IsNullOrEmpty(permtick))\n            {\n                throw new ArgumentNullException(nameof(permtick), \"Provided ticker is null or empty\");\n            }\n\n            Permtick = permtick.LazyToUpper();\n            _data = data.Distinct().OrderBy(row => row.Date).ToList();\n\n            // for performance we set first and last date on ctr\n            if (_data.Count == 0)\n            {\n                FirstDate = Time.BeginningOfTime;\n                DelistingDate = Time.EndOfTime;\n            }\n            else\n            {\n                FirstDate = _data[0].Date;\n                DelistingDate = _data[_data.Count - 1].Date;\n            }\n\n            var firstTicker = GetMappedSymbol(FirstDate, Permtick);\n            if (char.IsDigit(firstTicker.Last()))\n            {\n                var dotIndex = firstTicker.LastIndexOf(\".\", StringComparison.Ordinal);\n                if (dotIndex > 0)\n                {\n                    int value;\n                    var number = firstTicker.AsSpan(dotIndex + 1);\n                    if (int.TryParse(number, out value))\n                    {\n                        firstTicker = firstTicker.Substring(0, dotIndex);\n                    }\n                }\n            }\n\n            FirstTicker = firstTicker;\n        }\n\n        /// <summary>\n        /// Memory overload search method for finding the mapped symbol for this date.\n        /// </summary>\n        /// <param name=\"searchDate\">date for symbol we need to find.</param>\n        /// <param name=\"defaultReturnValue\">Default return value if search was got no result.</param>\n        /// <param name=\"dataMappingMode\">The mapping mode to use if any.</param>\n        /// <returns>Symbol on this date.</returns>\n        public string GetMappedSymbol(DateTime searchDate, string defaultReturnValue = \"\", DataMappingMode? dataMappingMode = null)\n        {\n            var mappedSymbol = defaultReturnValue;\n            //Iterate backwards to find the most recent factor:\n            for (var i = 0; i < _data.Count; i++)\n            {\n                var row = _data[i];\n                if (row.Date < searchDate || row.DataMappingMode.HasValue && row.DataMappingMode != dataMappingMode)\n                {\n                    continue;\n                }\n                mappedSymbol = row.MappedSymbol;\n                break;\n            }\n            return mappedSymbol;\n        }\n\n        /// <summary>\n        /// Determines if there's data for the requested date\n        /// </summary>\n        public bool HasData(DateTime date)\n        {\n            // handle the case where we don't have any data\n            if (_data.Count == 0)\n            {\n                return true;\n            }\n\n            if (date < FirstDate || date > DelistingDate)\n            {\n                // don't even bother checking the disk if the map files state we don't have the data\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Reads and writes each <see cref=\"MapFileRow\"/>\n        /// </summary>\n        /// <returns>Enumerable of csv lines</returns>\n        public IEnumerable<string> ToCsvLines()\n        {\n            return _data.Select(mapRow => mapRow.ToCsv());\n        }\n\n        /// <summary>\n        /// Writes the map file to a CSV file\n        /// </summary>\n        /// <param name=\"market\">The market to save the MapFile to</param>\n        /// <param name=\"securityType\">The map file security type</param>\n        public void WriteToCsv(string market, SecurityType securityType)\n        {\n            var filePath = Path.Combine(Globals.DataFolder, GetRelativeMapFilePath(market, securityType), Permtick.ToLowerInvariant() + \".csv\");\n            var fileDir = Path.GetDirectoryName(filePath);\n\n            if (!Directory.Exists(fileDir))\n            {\n                Directory.CreateDirectory(fileDir);\n                Log.Trace($\"Created directory for map file: {fileDir}\");\n            }\n\n            File.WriteAllLines(filePath, ToCsvLines());\n        }\n\n        /// <summary>\n        /// Constructs the map file path for the specified market and symbol\n        /// </summary>\n        /// <param name=\"market\">The market this symbol belongs to</param>\n        /// <param name=\"securityType\">The map file security type</param>\n        /// <returns>The file path to the requested map file</returns>\n        public static string GetRelativeMapFilePath(string market, SecurityType securityType)\n        {\n            return Invariant($\"{securityType.SecurityTypeToLower()}/{market}/map_files\");\n        }\n\n        #region Implementation of IEnumerable\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<MapFileRow> GetEnumerator()\n        {\n            return _data.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Reads all the map files in the specified directory\n        /// </summary>\n        /// <param name=\"mapFileDirectory\">The map file directory path</param>\n        /// <param name=\"market\">The map file market</param>\n        /// <param name=\"securityType\">The map file security type</param>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <returns>An enumerable of all map files</returns>\n        public static IEnumerable<MapFile> GetMapFiles(string mapFileDirectory, string market, SecurityType securityType, IDataProvider dataProvider)\n        {\n            var mapFiles = new List<MapFile>();\n            Parallel.ForEach(Directory.EnumerateFiles(mapFileDirectory), file =>\n            {\n                if (file.EndsWith(\".csv\"))\n                {\n                    var permtick = Path.GetFileNameWithoutExtension(file);\n                    var fileRead = SafeMapFileRowRead(file, market, securityType, dataProvider);\n                    var mapFile = new MapFile(permtick, fileRead);\n                    lock (mapFiles)\n                    {\n                        // just use a list + lock, not concurrent bag, avoid garbage it creates for features we don't need here. See https://github.com/dotnet/runtime/issues/23103\n                        mapFiles.Add(mapFile);\n                    }\n                }\n            });\n            return mapFiles;\n        }\n\n        /// <summary>\n        /// Reads in the map file at the specified path, returning null if any exceptions are encountered\n        /// </summary>\n        private static List<MapFileRow> SafeMapFileRowRead(string file, string market, SecurityType securityType, IDataProvider dataProvider)\n        {\n            try\n            {\n                return MapFileRow.Read(file, market, securityType, dataProvider).ToList();\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, $\"File: {file}\");\n                return new List<MapFileRow>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MapFilePrimaryExchangeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Concurrent;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Implementation of IPrimaryExchangeProvider from map files. \n    /// </summary>\n    public class MapFilePrimaryExchangeProvider : IPrimaryExchangeProvider\n    {\n        private readonly IMapFileProvider _mapFileProvider;\n        private readonly ConcurrentDictionary<SecurityIdentifier, Exchange> _primaryExchangeBySid;\n\n        /// <summary>\n        /// Constructor for Primary Exchange Provider from MapFiles\n        /// </summary>\n        /// <param name=\"mapFileProvider\">MapFile to use</param>\n        public MapFilePrimaryExchangeProvider(IMapFileProvider mapFileProvider)\n        {\n            _mapFileProvider = mapFileProvider;\n            _primaryExchangeBySid = new ConcurrentDictionary<SecurityIdentifier, Exchange>();\n        }\n\n        /// <summary>\n        /// Gets the primary exchange for a given security identifier\n        /// </summary>\n        /// <param name=\"securityIdentifier\">The security identifier to get the primary exchange for</param>\n        /// <returns>Returns the primary exchange or null if not found</returns>\n        public Exchange GetPrimaryExchange(SecurityIdentifier securityIdentifier)\n        {\n            Exchange primaryExchange;\n            if (!_primaryExchangeBySid.TryGetValue(securityIdentifier, out primaryExchange))\n            {\n                var mapFile = _mapFileProvider.Get(AuxiliaryDataKey.Create(securityIdentifier))\n                    .ResolveMapFile(securityIdentifier.Symbol, securityIdentifier.Date);\n                if (mapFile != null && mapFile.Any())\n                {\n                    primaryExchange = mapFile.Last().PrimaryExchange;\n                }\n                _primaryExchangeBySid[securityIdentifier] = primaryExchange;\n            }\n\n            return primaryExchange;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MapFileResolver.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Provides a means of mapping a symbol at a point in time to the map file\n    /// containing that share class's mapping information\n    /// </summary>\n    public class MapFileResolver : IEnumerable<MapFile>\n    {\n        private readonly Dictionary<string, MapFile> _mapFilesByPermtick;\n        private readonly Dictionary<string, SortedList<DateTime, MapFileRowEntry>> _bySymbol;\n\n        /// <summary>\n        /// Gets an empty <see cref=\"MapFileResolver\"/>, that is an instance that contains\n        /// zero mappings\n        /// </summary>\n        public static readonly MapFileResolver Empty = new MapFileResolver(Enumerable.Empty<MapFile>());\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MapFileResolver\"/> by reading\n        /// in all files in the specified directory.\n        /// </summary>\n        /// <param name=\"mapFiles\">The data used to initialize this resolver.</param>\n        public MapFileResolver(IEnumerable<MapFile> mapFiles)\n        {\n            _mapFilesByPermtick = new Dictionary<string, MapFile>(StringComparer.InvariantCultureIgnoreCase);\n            _bySymbol = new Dictionary<string, SortedList<DateTime, MapFileRowEntry>>(StringComparer.InvariantCultureIgnoreCase);\n\n            foreach (var mapFile in mapFiles)\n            {\n                // add to our by path map\n                _mapFilesByPermtick.Add(mapFile.Permtick, mapFile);\n\n                foreach (var row in mapFile)\n                {\n                    SortedList<DateTime, MapFileRowEntry> entries;\n                    var mapFileRowEntry = new MapFileRowEntry(mapFile.Permtick, row);\n\n                    if (!_bySymbol.TryGetValue(row.MappedSymbol, out entries))\n                    {\n                        entries = new SortedList<DateTime, MapFileRowEntry>();\n                        _bySymbol[row.MappedSymbol] = entries;\n                    }\n\n                    if (entries.ContainsKey(mapFileRowEntry.MapFileRow.Date))\n                    {\n                        // check to verify it' the same data\n                        if (!entries[mapFileRowEntry.MapFileRow.Date].Equals(mapFileRowEntry))\n                        {\n                            throw new DuplicateNameException(\"Attempted to assign different history for symbol.\");\n                        }\n                    }\n                    else\n                    {\n                        entries.Add(mapFileRowEntry.MapFileRow.Date, mapFileRowEntry);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the map file matching the specified permtick\n        /// </summary>\n        /// <param name=\"permtick\">The permtick to match on</param>\n        /// <returns>The map file matching the permtick, or null if not found</returns>\n        public MapFile GetByPermtick(string permtick)\n        {\n            MapFile mapFile;\n            _mapFilesByPermtick.TryGetValue(permtick.LazyToUpper(), out mapFile);\n            return mapFile;\n        }\n\n        /// <summary>\n        /// Resolves the map file path containing the mapping information for the symbol defined at <paramref name=\"date\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol as of <paramref name=\"date\"/> to be mapped</param>\n        /// <param name=\"date\">The date associated with the <paramref name=\"symbol\"/></param>\n        /// <returns>The map file responsible for mapping the symbol, if no map file is found, null is returned</returns>\n        public MapFile ResolveMapFile(string symbol, DateTime date)\n        {\n            // lookup the symbol's history\n            SortedList<DateTime, MapFileRowEntry> entries;\n            if (_bySymbol.TryGetValue(symbol, out entries))\n            {\n                if (entries.Count == 0)\n                {\n                    return new MapFile(symbol, Enumerable.Empty<MapFileRow>());\n                }\n\n                // Return value of BinarySearch (from MSDN):\n                // The zero-based index of item in the sorted List<T>, if item is found;\n                // otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item\n                // or, if there is no larger element, the bitwise complement of Count.\n                var indexOf = entries.Keys.BinarySearch(date);\n                if (indexOf >= 0)\n                {\n                    symbol = entries.Values[indexOf].EntitySymbol;\n                }\n                else\n                {\n                    if (indexOf == ~entries.Keys.Count)\n                    {\n                        // the searched date is greater than the last date in the list, return the last entry\n                        indexOf = entries.Keys.Count - 1;\n                    }\n                    else\n                    {\n                        // if negative, it's the bitwise complement of where it should be\n                        indexOf = ~indexOf;\n                    }\n\n                    symbol = entries.Values[indexOf].EntitySymbol;\n                }\n            }\n            // secondary search for exact mapping, find path than ends with symbol.csv\n            MapFile mapFile;\n            if (!_mapFilesByPermtick.TryGetValue(symbol, out mapFile)\n                || mapFile.FirstDate > date && date != SecurityIdentifier.DefaultDate)\n            {\n                return new MapFile(symbol, Enumerable.Empty<MapFileRow>());\n            }\n            return mapFile;\n        }\n\n        /// <summary>\n        /// Combines the map file row with the map file path that produced the row\n        /// </summary>\n        class MapFileRowEntry : IEquatable<MapFileRowEntry>\n        {\n            /// <summary>\n            /// Gets the map file row\n            /// </summary>\n            public MapFileRow MapFileRow { get; private set; }\n\n            /// <summary>\n            /// Gets the full path to the map file that produced this row\n            /// </summary>\n            public string EntitySymbol { get; private set; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"MapFileRowEntry\"/> class\n            /// </summary>\n            /// <param name=\"entitySymbol\">The map file that produced this row</param>\n            /// <param name=\"mapFileRow\">The map file row data</param>\n            public MapFileRowEntry(string entitySymbol, MapFileRow mapFileRow)\n            {\n                MapFileRow = mapFileRow;\n                EntitySymbol = entitySymbol;\n            }\n\n            /// <summary>\n            /// Indicates whether the current object is equal to another object of the same type.\n            /// </summary>\n            /// <returns>\n            /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n            /// </returns>\n            /// <param name=\"other\">An object to compare with this object.</param>\n            public bool Equals(MapFileRowEntry other)\n            {\n                if (other == null) return false;\n                return other.MapFileRow.Date == MapFileRow.Date\n                    && other.MapFileRow.MappedSymbol == MapFileRow.MappedSymbol;\n            }\n\n            /// <summary>\n            /// Returns a string that represents the current object.\n            /// </summary>\n            /// <returns>\n            /// A string that represents the current object.\n            /// </returns>\n            /// <filterpriority>2</filterpriority>\n            public override string ToString()\n            {\n                return MapFileRow.Date + \": \" + MapFileRow.MappedSymbol + \": \" + EntitySymbol;\n            }\n        }\n\n        #region Implementation of IEnumerable\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<MapFile> GetEnumerator()\n        {\n            return _mapFilesByPermtick.Values.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MapFileRow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Represents a single row in a map_file. This is a csv file ordered as {date, mapped symbol}\n    /// </summary>\n    public class MapFileRow : IEquatable<MapFileRow>\n    {\n        /// <summary>\n        /// Gets the date associated with this data\n        /// </summary>\n        public DateTime Date { get; }\n\n        /// <summary>\n        /// Gets the mapped symbol\n        /// </summary>\n        public string MappedSymbol { get; }\n\n        /// <summary>\n        /// Gets the mapped symbol\n        /// </summary>\n        public Exchange PrimaryExchange { get; }\n\n        /// <summary>\n        /// Gets the securities mapping mode associated to this mapping row\n        /// </summary>\n        public DataMappingMode? DataMappingMode { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MapFileRow\"/> class.\n        /// </summary>\n        public MapFileRow(DateTime date, string mappedSymbol, string primaryExchange,\n            string market = QuantConnect.Market.USA, SecurityType securityType = SecurityType.Equity, DataMappingMode? dataMappingMode = null)\n            : this(date, mappedSymbol, primaryExchange.GetPrimaryExchange(securityType, market), dataMappingMode)\n        { }\n        \n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MapFileRow\"/> class.\n        /// </summary>\n        public MapFileRow(DateTime date, string mappedSymbol, Exchange primaryExchange = null, DataMappingMode? dataMappingMode = null)\n        {\n            Date = date;\n            MappedSymbol = mappedSymbol.LazyToUpper();\n            PrimaryExchange = primaryExchange ?? Exchange.UNKNOWN;\n            DataMappingMode = dataMappingMode;\n        }\n\n        /// <summary>\n        /// Reads in the map_file for the specified equity symbol\n        /// </summary>\n        public static IEnumerable<MapFileRow> Read(string file, string market, SecurityType securityType, IDataProvider dataProvider)\n        {\n            return dataProvider.ReadLines(file)\n                .Where(l => !string.IsNullOrWhiteSpace(l))\n                .Select(s => {\n                    try\n                    {\n                        return Parse(s, market, securityType);\n                    }\n                    catch (ArgumentException)\n                    {\n                        // skip unrecognized mapping modes for backwards compatibility\n                        return null;\n                    }\n                })\n                .Where(row => row != null);\n        }\n\n        /// <summary>\n        /// Parses the specified line into a MapFileRow\n        /// </summary>\n        public static MapFileRow Parse(string line, string market, SecurityType securityType)\n        {\n            var csv = line.Split(',');\n            var primaryExchange = Exchange.UNKNOWN;\n            DataMappingMode? mappingMode = null;\n\n            if (csv.Length >= 3)\n            {\n                primaryExchange = csv[2].GetPrimaryExchange(securityType, market);\n            }\n            if (csv.Length >= 4)\n            {\n                mappingMode = csv[3].ParseDataMappingMode();\n            }\n\n            return new MapFileRow(DateTime.ParseExact(csv[0], DateFormat.EightCharacter, null), csv[1], primaryExchange, mappingMode);\n        }\n\n        #region Equality members\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(MapFileRow other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return Date.Equals(other.Date) &&\n                   string.Equals(MappedSymbol, other.MappedSymbol) &&\n                   string.Equals(PrimaryExchange, other.PrimaryExchange) &&\n                   DataMappingMode == other.DataMappingMode;\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param><filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            if (obj.GetType() != this.GetType()) return false;\n            return Equals((MapFileRow)obj);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (Date.GetHashCode() * 397) ^ \n                       (MappedSymbol != null ? MappedSymbol.GetHashCode() : 0) ^\n                       (DataMappingMode != null ? DataMappingMode.GetHashCode() : 0) ^\n                       (PrimaryExchange.GetHashCode());\n            }\n        }\n\n        /// <summary>\n        /// Determines whether or not the two instances are equal\n        /// </summary>\n        public static bool operator ==(MapFileRow left, MapFileRow right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Determines whether or not the two instances are not equal\n        /// </summary>\n        public static bool operator !=(MapFileRow left, MapFileRow right)\n        {\n            return !Equals(left, right);\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Writes this row to csv format\n        /// </summary>\n        public string ToCsv()\n        {\n            var encodedExchange = string.Empty;\n            if (PrimaryExchange == Exchange.UNKNOWN)\n            {\n                if (DataMappingMode != null)\n                {\n                    // be lazy, only add a comma if we have a mapping mode after\n                    encodedExchange = \",\";\n                }\n            }\n            else\n            {\n                encodedExchange = $\",{PrimaryExchange.Code}\";\n            }\n            var mappingMode = DataMappingMode != null ? $\",{(int)DataMappingMode}\" : string.Empty;\n            return $\"{Date.ToStringInvariant(DateFormat.EightCharacter)},{MappedSymbol.ToLowerInvariant()}{encodedExchange}{mappingMode}\";\n        }\n\n        /// <summary>\n        /// Convert this row into string form\n        /// </summary>\n        /// <returns>resulting string</returns>\n        public override string ToString()\n        {\n            var mainExchange = PrimaryExchange == Exchange.UNKNOWN ? string.Empty : $\" - {PrimaryExchange}\";\n            var mappingMode = DataMappingMode != null ? $\" - {DataMappingMode}\" : string.Empty;\n            return Date.ToShortDateString() + \": \" + MappedSymbol + mainExchange + mappingMode;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MapFileZipHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Helper class for handling mapfile zip files\n    /// </summary>\n    public static class MapFileZipHelper\n    {\n        /// <summary>\n        /// Gets the mapfile zip filename for the specified date\n        /// </summary>\n        public static string GetMapFileZipFileName(string market, DateTime date, SecurityType securityType)\n        {\n            return Path.Combine(Globals.DataFolder, MapFile.GetRelativeMapFilePath(market, securityType), $\"map_files_{date:yyyyMMdd}.zip\");\n        }\n\n        /// <summary>\n        /// Reads the zip bytes as text and parses as MapFileRows to create MapFiles\n        /// </summary>\n        public static IEnumerable<MapFile> ReadMapFileZip(Stream file, string market, SecurityType securityType)\n        {\n            if (file == null || file.Length == 0)\n            {\n                return Enumerable.Empty<MapFile>();\n            }\n\n            var result = from kvp in Compression.Unzip(file)\n                   let filename = kvp.Key\n                   where filename.EndsWith(\".csv\", StringComparison.InvariantCultureIgnoreCase)\n                   let lines = kvp.Value.Where(line => !string.IsNullOrEmpty(line))\n                   let mapFile = SafeRead(filename, lines, market, securityType)\n                   select mapFile;\n            return result;\n        }\n\n        /// <summary>\n        /// Parses the contents as a MapFile, if error returns a new empty map file\n        /// </summary>\n        private static MapFile SafeRead(string filename, IEnumerable<string> contents, string market, SecurityType securityType)\n        {\n            var permtick = Path.GetFileNameWithoutExtension(filename);\n            try\n            {\n                return new MapFile(permtick, contents.Select(s => MapFileRow.Parse(s, market, securityType)));\n            }\n            catch\n            {\n                return new MapFile(permtick, Enumerable.Empty<MapFileRow>());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MappingContractFactorProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Mapping related factor provider. Factors based on price differences on mapping dates\n    /// </summary>\n    public class MappingContractFactorProvider : FactorFile<MappingContractFactorRow>\n    {\n        /// <summary>\n        ///Creates a new instance\n        /// </summary>\n        public MappingContractFactorProvider(string permtick, IEnumerable<MappingContractFactorRow> data, DateTime? factorFileMinimumDate = null)\n            : base(permtick, data, factorFileMinimumDate)\n        {\n        }\n\n        /// <summary>\n        /// Gets the price scale factor for the specified search date\n        /// </summary>\n        public override decimal GetPriceFactor(DateTime searchDate, DataNormalizationMode dataNormalizationMode, DataMappingMode? dataMappingMode = null, uint contractOffset = 0)\n        {\n            if (dataNormalizationMode == DataNormalizationMode.Raw)\n            {\n                return 0;\n            }\n\n            var factor = 1m;\n            if (dataNormalizationMode is DataNormalizationMode.BackwardsPanamaCanal or DataNormalizationMode.ForwardPanamaCanal)\n            {\n                // default value depends on the data mode\n                factor = 0;\n            }\n\n            for (var i = 0; i < ReversedFactorFileDates.Count; i++)\n            {\n                var factorDate = ReversedFactorFileDates[i];\n                if (factorDate.Date < searchDate.Date)\n                {\n                    break;\n                }\n\n                var factorFileRow = SortedFactorFileData[factorDate];\n                switch (dataNormalizationMode)\n                {\n                    case DataNormalizationMode.BackwardsRatio:\n                    {\n                        var row = factorFileRow.FirstOrDefault(row => row.DataMappingMode == dataMappingMode);\n                        if (row != null && row.BackwardsRatioScale.Count > contractOffset)\n                        {\n                            factor = row.BackwardsRatioScale[(int)contractOffset];\n                        }\n                        break;\n                    }\n                    case DataNormalizationMode.BackwardsPanamaCanal:\n                    {\n                        var row = factorFileRow.FirstOrDefault(row => row.DataMappingMode == dataMappingMode);\n                        if (row != null && row.BackwardsPanamaCanalScale.Count > contractOffset)\n                        {\n                            factor = row.BackwardsPanamaCanalScale[(int)contractOffset];\n                        }\n                        break;\n                    }\n                    case DataNormalizationMode.ForwardPanamaCanal:\n                    {\n                        var row = factorFileRow.FirstOrDefault(row => row.DataMappingMode == dataMappingMode);\n                        if (row != null && row.ForwardPanamaCanalScale.Count > contractOffset)\n                        {\n                            factor = row.ForwardPanamaCanalScale[(int)contractOffset];\n                        }\n                        break;\n                    }\n                    default:\n                        throw new ArgumentOutOfRangeException(nameof(dataNormalizationMode));\n                }\n            }\n\n            return factor;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MappingContractFactorRow.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Collection of factors for continuous contracts and their back months contracts for a specific mapping mode <see cref=\"DataMappingMode\"/> and date\n    /// </summary>\n    public class MappingContractFactorRow : IFactorRow\n    {\n        /// <summary>\n        /// Gets the date associated with this data\n        /// </summary>\n        public DateTime Date { get; set; }\n\n        /// <summary>\n        /// Backwards ratio price scaling factors for the front month [index 0] and it's 'i' back months [index 0 + i]\n        /// <see cref=\"DataNormalizationMode.BackwardsRatio\"/>\n        /// </summary>\n        public IReadOnlyList<decimal> BackwardsRatioScale { get; set;  } = new List<decimal>();\n\n        /// <summary>\n        /// Backwards Panama Canal price scaling factors for the front month [index 0] and it's 'i' back months [index 0 + i]\n        /// <see cref=\"DataNormalizationMode.BackwardsPanamaCanal\"/>\n        /// </summary>\n        public IReadOnlyList<decimal> BackwardsPanamaCanalScale { get; set;  } = new List<decimal>();\n\n        /// <summary>\n        /// Forward Panama Canal price scaling factors for the front month [index 0] and it's 'i' back months [index 0 + i]\n        /// <see cref=\"DataNormalizationMode.ForwardPanamaCanal\"/>\n        /// </summary>\n        public IReadOnlyList<decimal> ForwardPanamaCanalScale { get; set;  } = new List<decimal>();\n\n        /// <summary>\n        /// Allows the consumer to specify a desired mapping mode\n        /// </summary>\n        public DataMappingMode? DataMappingMode { get; set; }\n\n        /// <summary>\n        /// Empty constructor for json converter\n        /// </summary>\n        public MappingContractFactorRow()\n        {\n        }\n\n        /// <summary>\n        /// Writes factor file row into it's file format\n        /// </summary>\n        /// <remarks>Json formatted</remarks>\n        public string GetFileFormat(string source = null)\n        {\n            return JsonConvert.SerializeObject(this);\n        }\n\n        /// <summary>\n        /// Parses the lines as factor files rows while properly handling inf entries\n        /// </summary>\n        /// <param name=\"lines\">The lines from the factor file to be parsed</param>\n        /// <param name=\"factorFileMinimumDate\">The minimum date from the factor file</param>\n        /// <returns>An enumerable of factor file rows</returns>\n        public static List<MappingContractFactorRow> Parse(IEnumerable<string> lines, out DateTime? factorFileMinimumDate)\n        {\n            factorFileMinimumDate = null;\n\n            var rows = new List<MappingContractFactorRow>();\n\n            // parse factor file lines\n            foreach (var line in lines)\n            {\n                var row = JsonConvert.DeserializeObject<MappingContractFactorRow>(line);\n                if(!row.DataMappingMode.HasValue || Enum.IsDefined(typeof(DataMappingMode), row.DataMappingMode.Value))\n                {\n                    rows.Add(row);\n                }\n            }\n\n            if (rows.Count > 0)\n            {\n                factorFileMinimumDate = rows.Min(ffr => ffr.Date).AddDays(-1);\n            }\n\n            return rows;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/MappingExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Mapping extensions helper methods\n    /// </summary>\n    public static class MappingExtensions\n    {\n        /// <summary>\n        /// Helper method to resolve the mapping file to use.\n        /// </summary>\n        /// <remarks>This method is aware of the data type being added for <see cref=\"SecurityType.Base\"/>\n        /// to the <see cref=\"SecurityIdentifier.Symbol\"/> value</remarks>\n        /// <param name=\"mapFileProvider\">The map file provider</param>\n        /// <param name=\"dataConfig\">The configuration to fetch the map file for</param>\n        /// <returns>The mapping file to use</returns>\n        public static MapFile ResolveMapFile(this IMapFileProvider mapFileProvider, SubscriptionDataConfig dataConfig)\n        {\n            var resolver = MapFileResolver.Empty;\n            if (dataConfig.TickerShouldBeMapped())\n            {\n                resolver = mapFileProvider.Get(AuxiliaryDataKey.Create(dataConfig.Symbol));\n            }\n            return resolver.ResolveMapFile(dataConfig.Symbol, dataConfig.Type.Name);\n        }\n\n        /// <summary>\n        /// Helper method to resolve the mapping file to use.\n        /// </summary>\n        /// <remarks>This method is aware of the data type being added for <see cref=\"SecurityType.Base\"/>\n        /// to the <see cref=\"SecurityIdentifier.Symbol\"/> value</remarks>\n        /// <param name=\"mapFileResolver\">The map file resolver</param>\n        /// <param name=\"symbol\">The symbol that we want to map</param>\n        /// <param name=\"dataType\">The string data type name if any</param>\n        /// <returns>The mapping file to use</returns>\n        public static MapFile ResolveMapFile(this MapFileResolver mapFileResolver,\n            Symbol symbol,\n            string dataType = null)\n        {\n            // Load the symbol and date to complete the mapFile checks in one statement\n            var symbolID = symbol.HasUnderlying ? symbol.Underlying.ID.Symbol : symbol.ID.Symbol;\n            if (dataType == null && symbol.SecurityType == SecurityType.Base)\n            {\n                SecurityIdentifier.TryGetCustomDataType(symbol.ID.Symbol, out dataType);\n            }\n            symbolID = symbol.SecurityType == SecurityType.Base && dataType != null ? symbolID.RemoveFromEnd($\".{dataType}\") : symbolID;\n\n            MapFile result;\n            if (ReferenceEquals(mapFileResolver, MapFileResolver.Empty))\n            {\n                result = mapFileResolver.ResolveMapFile(symbol.Value, Time.BeginningOfTime);\n            }\n            else\n            {\n                var date = symbol.HasUnderlying ? symbol.Underlying.ID.Date : symbol.ID.Date;\n                result = mapFileResolver.ResolveMapFile(symbolID, date);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Some historical provider supports ancient data. In fact, the ticker could be restructured to new one.\n        /// </summary>\n        /// <param name=\"mapFileProvider\">Provides instances of <see cref=\"MapFileResolver\"/> at run time</param>\n        /// <param name=\"symbol\">Represents a unique security identifier</param>\n        /// <param name=\"startDateTime\">The date since we began our search for the historical name of the symbol.</param>\n        /// <param name=\"endDateTime\">The end date and time of the historical data range.</param>\n        /// <returns>\n        /// An enumerable collection of tuples containing symbol ticker, start date and time, and end date and time\n        /// representing the historical definitions of the symbol within the specified time range.\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"mapFileProvider\"/> is null.</exception>\n        /// <example>\n        /// For instances, get \"GOOGL\" since 2013 to 2018:\n        /// It returns: { (\"GOOG\", 2013, 2014), (\"GOOGL\", 2014, 2018) }\n        /// </example>\n        /// <remarks>\n        /// GOOGLE: IPO: August 19, 2004 Name = GOOG then it was restructured: from \"GOOG\" to \"GOOGL\" on April 2, 2014\n        /// </remarks>\n        public static IEnumerable<TickerDateRange> RetrieveSymbolHistoricalDefinitionsInDateRange\n            (this IMapFileProvider mapFileProvider, Symbol symbol, DateTime startDateTime, DateTime endDateTime)\n        {\n            if (mapFileProvider == null)\n            {\n                throw new ArgumentNullException(nameof(mapFileProvider));\n            }\n\n            var mapFileResolver = mapFileProvider.Get(AuxiliaryDataKey.Create(symbol));\n            var symbolMapFile = mapFileResolver.ResolveMapFile(symbol);\n\n            if (!symbolMapFile.Any())\n            {\n                yield break;\n            }\n\n            var newStartDateTime = startDateTime;\n            foreach (var mappedTicker in symbolMapFile.Skip(1)) // Skip: IPO Ticker's DateTime \n            {\n                if (mappedTicker.Date >= newStartDateTime)\n                {\n                    // Shifts endDateTime by one day to include all data up to and including the endDateTime.\n                    var newEndDateTime = mappedTicker.Date.AddDays(1);\n                    if (newEndDateTime > endDateTime)\n                    {\n                        yield return new(mappedTicker.MappedSymbol, newStartDateTime, endDateTime);\n                        // the request EndDateTime was achieved\n                        yield break;\n                    }\n\n                    yield return new(mappedTicker.MappedSymbol, newStartDateTime, newEndDateTime);\n                    // the end of the current request is the start of the next\n                    newStartDateTime = newEndDateTime;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Retrieves all Symbol from map files based on specific Symbol.\n        /// </summary>\n        /// <param name=\"mapFileProvider\">The provider for map files containing ticker data.</param>\n        /// <param name=\"symbol\">The symbol to get <see cref=\"MapFileResolver\"/> and generate new Symbol.</param>\n        /// <returns>An enumerable collection of <see cref=\"SymbolDateRange\"/></returns>\n        /// <exception cref=\"ArgumentException\">Throw if <paramref name=\"mapFileProvider\"/> is null.</exception>\n        public static IEnumerable<SymbolDateRange> RetrieveAllMappedSymbolInDateRange(this IMapFileProvider mapFileProvider, Symbol symbol)\n        {\n            if (mapFileProvider == null || symbol == null)\n            {\n                throw new ArgumentException($\"The map file provider and symbol cannot be null. {(mapFileProvider == null ? nameof(mapFileProvider) : nameof(symbol))}\");\n            }\n\n            var mapFileResolver = mapFileProvider.Get(AuxiliaryDataKey.Create(symbol));\n\n            var tickerUpperCase = symbol.HasUnderlying ? symbol.Underlying.Value.ToUpperInvariant() : symbol.Value.ToUpperInvariant();\n\n            var isOptionSymbol = symbol.SecurityType == SecurityType.Option;\n            foreach (var mapFile in mapFileResolver)\n            {\n                // Check if 'mapFile' contains the desired ticker symbol.\n                if (!mapFile.Any(mapFileRow => mapFileRow.MappedSymbol == tickerUpperCase))\n                {\n                    continue;\n                }\n\n                foreach (var tickerDateRange in mapFile.GetTickerDateRanges(tickerUpperCase))\n                {\n                    var sid = SecurityIdentifier.GenerateEquity(mapFile.FirstDate, mapFile.FirstTicker, symbol?.ID.Market);\n\n                    var newSymbol = new Symbol(sid, tickerUpperCase);\n\n                    if (isOptionSymbol)\n                    {\n                        newSymbol = Symbol.CreateCanonicalOption(newSymbol);\n                    }\n\n                    yield return new(newSymbol, tickerDateRange.StartDate, tickerDateRange.EndDate);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Retrieves the date ranges associated with a specific ticker symbol from the provided map file.\n        /// </summary>\n        /// <param name=\"mapFile\">The map file containing the data ranges for various ticker.</param>\n        /// <param name=\"ticker\">The ticker for which to retrieve the date ranges.</param>\n        /// <returns>An enumerable collection of tuples representing the start and end dates for each date range associated with the specified ticker symbol.</returns>\n        private static IEnumerable<(DateTime StartDate, DateTime EndDate)> GetTickerDateRanges(this MapFile mapFile, string ticker)\n        {\n            var previousRowDate = mapFile.FirstOrDefault().Date;\n            foreach (var currentRow in mapFile.Skip(1))\n            {\n                if (ticker == currentRow.MappedSymbol)\n                {\n                    yield return (previousRowDate, currentRow.Date.AddDays(1));\n                }\n                // MapFile maintains the latest date associated with each ticker name, except first Row\n                previousRowDate = currentRow.Date.AddDays(1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/PriceScalingExtensions.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Set of helper methods for factor files and price scaling operations\n    /// </summary>\n    public static class PriceScalingExtensions\n    {\n        /// <summary>\n        /// Resolves the price scale for a date given a factor file and required settings\n        /// </summary>\n        /// <param name=\"factorFile\">The factor file to use</param>\n        /// <param name=\"dateTime\">The date for the price scale lookup</param>\n        /// <param name=\"normalizationMode\">The price normalization mode requested</param>\n        /// <param name=\"contractOffset\">The contract offset, useful for continuous contracts</param>\n        /// <param name=\"dataMappingMode\">The data mapping mode used, useful for continuous contracts</param>\n        /// <param name=\"endDateTime\">The reference end date for scaling prices.</param>\n        /// <returns>The price scale to use</returns>\n        /// <exception cref=\"ArgumentException\">\n        /// If <paramref name=\"normalizationMode\"/> is <see cref=\"DataNormalizationMode.ScaledRaw\"/> and <paramref name=\"endDateTime\"/> is null\n        /// </exception>\n        /// <remarks>\n        /// For <see cref=\"DataNormalizationMode.ScaledRaw\"/> normalization mode,\n        /// the prices are scaled to the prices on the <paramref name=\"endDateTime\"/>\n        /// </remarks>\n        public static decimal GetPriceScale(\n            this IFactorProvider factorFile,\n            DateTime dateTime,\n            DataNormalizationMode normalizationMode,\n            uint contractOffset = 0,\n            DataMappingMode? dataMappingMode = null,\n            DateTime? endDateTime = null\n            )\n        {\n            if (factorFile == null)\n            {\n                if (normalizationMode is DataNormalizationMode.BackwardsPanamaCanal or DataNormalizationMode.ForwardPanamaCanal)\n                {\n                    return 0;\n                }\n                return 1;\n            }\n\n            var endDateTimeFactor = 1m;\n            if (normalizationMode == DataNormalizationMode.ScaledRaw)\n            {\n                if (endDateTime == null)\n                {\n                    throw new ArgumentException(\n                        $\"{nameof(DataNormalizationMode.ScaledRaw)} normalization mode requires an end date for price scaling.\");\n                }\n\n                // For ScaledRaw, we need to get the price scale at the end date to adjust prices to that date instead of \"today\"\n                endDateTimeFactor = factorFile.GetPriceFactor(endDateTime.Value, normalizationMode, dataMappingMode, contractOffset);\n            }\n\n            return factorFile.GetPriceFactor(dateTime, normalizationMode, dataMappingMode, contractOffset) / endDateTimeFactor;\n        }\n\n        /// <summary>\n        /// Determines the symbol to use to fetch it's factor file\n        /// </summary>\n        /// <remarks>This is useful for futures where the symbol to use is the canonical</remarks>\n        public static Symbol GetFactorFileSymbol(this Symbol symbol)\n        {\n            return symbol.SecurityType == SecurityType.Future ? symbol.Canonical : symbol;\n        }\n\n        /// <summary>\n        /// Helper method to return an empty factor file\n        /// </summary>\n        public static IFactorProvider GetEmptyFactorFile(this Symbol symbol)\n        {\n            if (symbol.SecurityType == SecurityType.Future)\n            {\n                return new MappingContractFactorProvider(symbol.ID.Symbol, Enumerable.Empty<MappingContractFactorRow>());\n            }\n            return new CorporateFactorProvider(symbol.ID.Symbol, Enumerable.Empty<CorporateFactorRow>());\n        }\n\n        /// <summary>\n        /// Parses the contents as a FactorFile, if error returns a new empty factor file\n        /// </summary>\n        public static IFactorProvider SafeRead(string permtick, IEnumerable<string> contents, SecurityType securityType)\n        {\n            try\n            {\n                DateTime? minimumDate;\n\n                contents = contents.Distinct();\n\n                if (securityType == SecurityType.Future)\n                {\n                    return new MappingContractFactorProvider(permtick, MappingContractFactorRow.Parse(contents, out minimumDate), minimumDate);\n                }\n                // FactorFileRow.Parse handles entries with 'inf' and exponential notation and provides the associated minimum tradeable date for these cases\n                // previously these cases were not handled causing an exception and returning an empty factor file\n                return new CorporateFactorProvider(permtick, CorporateFactorRow.Parse(contents, out minimumDate), minimumDate);\n            }\n            catch (Exception e)\n            {\n                if (securityType == SecurityType.Future)\n                {\n                    return new MappingContractFactorProvider(permtick, Enumerable.Empty<MappingContractFactorRow>());\n                }\n                return new CorporateFactorProvider(permtick, Enumerable.Empty<CorporateFactorRow>());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/QuoteConditionFlags.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.ComponentModel;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Flag system for quote conditions\n    /// </summary>\n    [Flags]\n    public enum QuoteConditionFlags : long\n    {\n        /// <summary>\n        /// No Condition\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// This condition is used for the majority of quotes to indicate a normal trading environment.\n        /// </summary>\n        [Description(\"This condition is used for the majority of quotes to indicate a normal trading environment.\")]\n        Regular = 1L << 0,\n\n        /// <summary>\n        /// This condition is used to indicate that the quote is a Slow Quote on both the Bid and Offer\n        /// sides due to a Set Slow List that includes High Price securities.\n        /// </summary>\n        [Description(\"This condition is used to indicate that the quote is a Slow Quote on both the Bid and Offer \" +\n            \"sides due to a Set Slow List that includes High Price securities.\")]\n        Slow = 1L << 1,\n\n        /// <summary>\n        /// While in this mode, auto-execution is not eligible, the quote is then considered manual and non-firm in the Bid and Offer and\n        /// either or both sides can be traded through as per Regulation NMS.\n        /// </summary>\n        [Description(\"While in this mode, auto-execution is not eligible, the quote is then considered manual and non-firm in the Bid and Offer and \" +\n            \"either or both sides can be traded through as per Regulation NMS.\")]\n        Gap = 1L << 2,\n\n        /// <summary>\n        /// This condition can be disseminated to indicate that this quote was the last quote for a security for that Participant.\n        /// </summary>\n        [Description(\"This condition can be disseminated to indicate that this quote was the last quote for a security for that Participant.\")]\n        Closing = 1L << 3,\n\n        /// <summary>\n        /// This regulatory Opening Delay or Trading Halt is used when relevant news influencing the security is being disseminated.\n        /// Trading is suspended until the primary market determines that an adequate publication or disclosure of information has occurred.\n        /// </summary>\n        [Description(\"This regulatory Opening Delay or Trading Halt is used when relevant news influencing the security is being disseminated.\" +\n            \"Trading is suspended until the primary market determines that an adequate publication or disclosure of information has occurred.\")]\n        NewsDissemination = 1L << 4,\n\n        /// <summary>\n        /// This condition is used to indicate a regulatory Opening Delay or Trading Halt due to an expected news announcement,\n        /// which may influence the security. An Opening Delay or Trading Halt may be continued once the news has been disseminated.\n        /// </summary>\n        [Description(\"This condition is used to indicate a regulatory Opening Delay or Trading Halt due to an expected news announcement, \" +\n            \"which may influence the security. An Opening Delay or Trading Halt may be continued once the news has been disseminated.\")]\n        NewsPending = 1L << 5,\n\n        /// <summary>\n        /// The condition is used to denote the probable trading range (bid and offer prices, no sizes) of a security that is not Opening Delayed or\n        /// Trading Halted. The Trading Range Indication is used prior to or after the opening of a security.\n        /// </summary>\n        [Description(\"The condition is used to denote the probable trading range (bid and offer prices, no sizes) of a security that is not Opening Delayed or\" +\n            \"Trading Halted. The Trading Range Indication is used prior to or after the opening of a security.\")]\n        TradingRangeIndication = 1L << 6,\n\n        /// <summary>\n        /// This non-regulatory Opening Delay or Trading Halt is used when there is a significant imbalance of buy or sell orders.\n        /// </summary>\n        [Description(\"This non-regulatory Opening Delay or Trading Halt is used when there is a significant imbalance of buy or sell orders.\")]\n        OrderImbalance = 1L << 7,\n\n        /// <summary>\n        /// This condition is disseminated by each individual FINRA Market Maker to signify either the last quote of the day or\n        /// the premature close of an individual Market Maker for the day.\n        /// </summary>\n        [Description(\"This condition is disseminated by each individual FINRA Market Maker to signify either the last quote of the day or\" +\n            \"the premature close of an individual Market Maker for the day.\")]\n        ClosedMarketMaker = 1L << 8,\n\n        /// <summary>\n        /// This quote condition indicates a regulatory Opening Delay or Trading Halt due to conditions in which\n        /// a security experiences a 10 % or more change in price over a five minute period.\n        /// </summary>\n        [Description(\"This quote condition indicates a regulatory Opening Delay or Trading Halt due to conditions in which \" +\n            \"a security experiences a 10 % or more change in price over a five minute period.\")]\n        VolatilityTradingPause = 1L << 9,\n\n        /// <summary>\n        /// This quote condition suspends a Participant's firm quote obligation for a quote for a security.\n        /// </summary>\n        [Description(\"This quote condition suspends a Participant's firm quote obligation for a quote for a security.\")]\n        NonFirmQuote = 1L << 10,\n\n        /// <summary>\n        /// This condition can be disseminated to indicate that this quote was the opening quote for a security for that Participant.\n        /// </summary>\n        [Description(\"This condition can be disseminated to indicate that this quote was the opening quote for a security for that Participant.\")]\n        OpeningQuote = 1L << 11,\n\n        /// <summary>\n        /// This non-regulatory Opening Delay or Trading Halt is used when events relating to one security will affect the price and performance of\n        /// another related security. This non-regulatory Opening Delay or Trading Halt is also used when non-regulatory halt reasons such as\n        /// Order Imbalance, Order Influx and Equipment Changeover are combined with Due to Related Security on CTS.\n        /// </summary>\n        [Description(\"This non-regulatory Opening Delay or Trading Halt is used when events relating to one security will affect the price and performance of \" +\n            \"another related security. This non-regulatory Opening Delay or Trading Halt is also used when non-regulatory halt reasons such as \" +\n            \"Order Imbalance, Order Influx and Equipment Changeover are combined with Due to Related Security on CTS.\")]\n        DueToRelatedSecurity = 1L << 12,\n\n        /// <summary>\n        /// This quote condition along with zero-filled bid, offer and size fields is used to indicate that trading for a Participant is no longer\n        /// suspended in a security which had been Opening Delayed or Trading Halted.\n        /// </summary>\n        [Description(\"This quote condition along with zero-filled bid, offer and size fields is used to indicate that trading for a Participant is no longer \" +\n            \"suspended in a security which had been Opening Delayed or Trading Halted.\")]\n        Resume = 1L << 13,\n\n        /// <summary>\n        /// This quote condition is used when matters affecting the common stock of a company affect the performance of the non-common\n        /// associated securities, e.g., warrants, rights, preferred, classes, etc.\n        /// </summary>\n        [Description(\"This quote condition is used when matters affecting the common stock of a company affect the performance of the non-common \" +\n            \"associated securities, e.g., warrants, rights, preferred, classes, etc.\")]\n        InViewOfCommon = 1L << 14,\n\n        /// <summary>\n        /// This non-regulatory Opening Delay or Trading Halt is used when the ability to trade a security by a Participant is temporarily\n        /// inhibited due to a systems, equipment or communications facility problem or for other technical reasons.\n        /// </summary>\n        [Description(\"This non-regulatory Opening Delay or Trading Halt is used when the ability to trade a security by a Participant is temporarily \" +\n            \"inhibited due to a systems, equipment or communications facility problem or for other technical reasons.\")]\n        EquipmentChangeover = 1L << 15,\n\n        /// <summary>\n        /// This non-regulatory Opening Delay or Trading Halt is used to indicate an Opening Delay or Trading Halt for a security whose price\n        /// may fall below $1.05, possibly leading to a sub-penny execution.\n        /// </summary>\n        [Description(\"This non-regulatory Opening Delay or Trading Halt is used to indicate an Opening Delay or Trading Halt for a security whose price\" +\n            \" may fall below $1.05, possibly leading to a sub-penny execution.\")]\n        SubPennyTrading = 1L << 16,\n\n        /// <summary>\n        /// This quote condition is used to indicate that an Opening Delay or a Trading Halt is to be in effect for the rest\n        /// of the trading day in a security for a Participant.\n        /// </summary>\n        [Description(\"This quote condition is used to indicate that an Opening Delay or a Trading Halt is to be in effect for the rest \" +\n            \"of the trading day in a security for a Participant.\")]\n        NoOpenNoResume = 1L << 17,\n\n        /// <summary>\n        /// This quote condition is used to indicate that a Limit Up-Limit Down Price Band is applicable for a security.\n        /// </summary>\n        [Description(\"This quote condition is used to indicate that a Limit Up-Limit Down Price Band is applicable for a security.\")]\n        LimitUpLimitDownPriceBand = 1L << 18,\n\n        /// <summary>\n        /// This quote condition is used to indicate that a Limit Up-Limit Down Price Band that is being disseminated \" +\n        /// is a ‘republication’ of the latest Price Band for a security.\n        /// </summary>\n        [Description(\"This quote condition is used to indicate that a Limit Up-Limit Down Price Band that is being disseminated \" +\n            \"is a ‘republication’ of the latest Price Band for a security.\")]\n        RepublishedLimitUpLimitDownPriceBand = 1L << 19,\n\n        /// <summary>\n        /// This indicates that the market participant is in a manual mode on both the Bid and Ask. While in this mode,\n        /// automated execution is not eligible on the Bid and Ask side and can be traded through pursuant to Regulation NMS requirements.\n        /// </summary>\n        [Description(\"This indicates that the market participant is in a manual mode on both the Bid and Ask. While in this mode, \" +\n            \"automated execution is not eligible on the Bid and Ask side and can be traded through pursuant to Regulation NMS requirements.\")]\n        Manual = 1L << 20,\n\n        /// <summary>\n        /// For extremely active periods of short duration. While in this mode, the UTP participant will enter quotations on a “best efforts” basis.\n        /// </summary>\n        [Description(\"For extremely active periods of short duration. While in this mode, the UTP participant will enter quotations on a “best efforts” basis.\")]\n        FastTrading = 1L << 21,\n\n        /// <summary>\n        /// A halt condition used when there is a sudden order influx. To prevent a disorderly market, trading is temporarily suspended by the UTP participant.\n        /// </summary>\n        [Description(\"A halt condition used when there is a sudden order influx. To prevent a disorderly market, trading is temporarily suspended by the UTP participant.\")]\n        OrderInflux = 1L << 22\n    }\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/SymbolDateRange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Represents security identifier within a date range.\n    /// </summary>\n#pragma warning disable CA1815 // Override equals and operator equals on value types\n    public readonly struct SymbolDateRange\n    {\n        /// <summary>\n        /// Represents a unique security identifier.\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Ticker Start Date Time in Local\n        /// </summary>\n        public DateTime StartDateTimeLocal { get; }\n\n        /// <summary>\n        /// Ticker End Date Time in Local\n        /// </summary>\n        public DateTime EndDateTimeLocal { get; }\n\n        /// <summary>\n        /// Create the instance of <see cref=\"SymbolDateRange\"/> struct.\n        /// </summary>\n        /// <param name=\"symbol\">The unique security identifier</param>\n        /// <param name=\"startDateTimeLocal\">Start Date Time Local</param>\n        /// <param name=\"endDateTimeLocal\">End Date Time Local</param>\n        public SymbolDateRange(Symbol symbol, DateTime startDateTimeLocal, DateTime endDateTimeLocal)\n        {\n            Symbol = symbol;\n            StartDateTimeLocal = startDateTimeLocal;\n            EndDateTimeLocal = endDateTimeLocal;\n        }\n    }\n#pragma warning restore CA1815\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/TickerDateRange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Represents stock data for a specific ticker within a date range.\n    /// </summary>\n#pragma warning disable CA1815 // Override equals and operator equals on value types\n    public readonly struct TickerDateRange\n    {\n        /// <summary>\n        /// Ticker simple name of stock\n        /// </summary>\n        public string Ticker { get; }\n\n        /// <summary>\n        /// Ticker Start Date Time in Local\n        /// </summary>\n        public DateTime StartDateTimeLocal { get; }\n\n        /// <summary>\n        /// Ticker End Date Time in Local\n        /// </summary>\n        public DateTime EndDateTimeLocal { get; }\n\n        /// <summary>\n        /// Create the instance of <see cref=\"TickerDateRange\"/> struct.\n        /// </summary>\n        /// <param name=\"ticker\">Name of ticker</param>\n        /// <param name=\"startDateTimeLocal\">Start Date Time Local</param>\n        /// <param name=\"endDateTimeLocal\">End Date Time Local</param>\n        public TickerDateRange(string ticker, DateTime startDateTimeLocal, DateTime endDateTimeLocal)\n        {\n            Ticker = ticker;\n            StartDateTimeLocal = startDateTimeLocal;\n            EndDateTimeLocal = endDateTimeLocal;\n        }\n    }\n#pragma warning restore CA1815\n}\n"
  },
  {
    "path": "Common/Data/Auxiliary/TradeConditionFlags.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.ComponentModel;\n\nnamespace QuantConnect.Data.Auxiliary\n{\n    /// <summary>\n    /// Flag system for trade conditions\n    /// </summary>\n    [Flags]\n    public enum TradeConditionFlags: long\n    {\n        /// <summary>\n        /// No Condition\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// A trade made without stated conditions is deemed regular way for settlement on the third business day following the transaction date.\n        /// </summary>\n        [Description(\"A trade made without stated conditions is deemed regular way for settlement on the third business day following the transaction date.\")]\n        Regular = 1L << 0,\n\n        /// <summary>\n        /// A transaction which requires delivery of securities and payment on the same day the trade takes place.\n        /// </summary>\n        [Description(\"A transaction which requires delivery of securities and payment on the same day the trade takes place.\")]\n        Cash = 1L << 1,\n\n        /// <summary>\n        /// A transaction that requires the delivery of securities on the first business day following the trade date.\n        /// </summary>\n        [Description(\"A transaction that requires the delivery of securities on the first business day following the trade date.\")]\n        NextDay = 1L << 2,\n\n        /// <summary>\n        /// A Seller’s Option transaction gives the seller the right to deliver the security at any time within a specific period,\n        /// ranging from not less than two calendar days, to not more than sixty calendar days.\n        /// </summary>\n        [Description(\"A Seller’s Option transaction gives the seller the right to deliver the security at any time within a specific period, \" +\n                     \"ranging from not less than two calendar days, to not more than sixty calendar days.\")]\n        Seller = 1L << 3,\n\n        /// <summary>\n        /// Market Centers will have the ability to identify regular trades being reported during specific events as out of the ordinary\n        /// by appending a new sale condition code Yellow Flag (Y) on each transaction reported to the UTP SIP.\n        /// The new sale condition will be eligible to update all market center and consolidated statistics.\n        /// </summary>\n        [Description(\"Market Centers will have the ability to identify regular trades being reported during specific events as out of the ordinary \" +\n                     \"by appending a new sale condition code Yellow Flag (Y) on each transaction reported to the UTP SIP.\" +\n                     \"The new sale condition will be eligible to update all market center and consolidated statistics.\")]\n        YellowFlag = 1L << 4,\n\n        /// <summary>\n        /// The transaction that constituted the trade-through was the execution of an order identified as an Intermarket Sweep Order.\n        /// </summary>\n        [Description(\"The transaction that constituted the trade-through was the execution of an order identified as an Intermarket Sweep Order.\")]\n        IntermarketSweep = 1L << 5,\n\n        /// <summary>\n        /// The trade that constituted the trade-through was a single priced opening transaction by the Market Center.\n        /// </summary>\n        [Description(\"The trade that constituted the trade-through was a single priced opening transaction by the Market Center.\")]\n        OpeningPrints = 1L << 6,\n\n        /// <summary>\n        /// The transaction that constituted the trade-through was a single priced closing transaction by the Market Center.\n        /// </summary>\n        [Description(\"The transaction that constituted the trade-through was a single priced closing transaction by the Market Center.\")]\n        ClosingPrints = 1L << 7,\n\n        /// <summary>\n        /// The trade that constituted the trade-through was a single priced reopening transaction by the Market Center.\n        /// </summary>\n        [Description(\"The trade that constituted the trade-through was a single priced reopening transaction by the Market Center.\")]\n        ReOpeningPrints = 1L << 8,\n\n        /// <summary>\n        /// The transaction that constituted the trade-through was the execution of an order at a price that was not based, directly or indirectly,\n        /// on the quoted price of the security at the time of execution and for which the material terms were not reasonably determinable\n        /// at the time the commitment to execute the order was made.\n        /// </summary>\n        [Description(\"The transaction that constituted the trade-through was the execution of an order at a price that was not based, directly or indirectly, \" +\n                     \"on the quoted price of the security at the time of execution and for which the material terms were not reasonably determinable \" +\n                     \"at the time the commitment to execute the order was made.\")]\n        DerivativelyPriced = 1L << 9,\n\n        /// <summary>\n        /// Trading in extended hours enables investors to react quickly to events that typically occur outside regular market hours, such as earnings reports.\n        /// However, liquidity may be constrained during such Form T trading, resulting in wide bid-ask spreads.\n        /// </summary>\n        [Description(\"Trading in extended hours enables investors to react quickly to events that typically occur outside regular market hours, such as earnings reports.\" +\n                     \"However, liquidity may be constrained during such Form T trading, resulting in wide bid-ask spreads.\")]\n        FormT = 1L << 10,\n\n        /// <summary>\n        /// Sold Last is used when a trade prints in sequence but is reported late or printed in conformance to the One or Two Point Rule.\n        /// </summary>\n        [Description(\"Sold Last is used when a trade prints in sequence but is reported late or printed in conformance to the One or Two Point Rule.\")]\n        Sold = 1L << 11,\n\n        /// <summary>\n        /// The transaction that constituted the trade-through was the execution by a trading center of an order for which, at the time\n        /// of receipt of the order, the execution at no worse than a specified price a 'stopped order'\n        /// </summary>\n        [Description(\"The transaction that constituted the trade-through was the execution by a trading center of an order for which, at the time\" +\n                     \"of receipt of the order, the execution at no worse than a specified price a 'stopped order'\")]\n        Stopped = 1L << 12,\n\n        /// <summary>\n        /// Identifies a trade that was executed outside of regular primary market hours and is reported as an extended hours trade.\n        /// </summary>\n        [Description(\"Identifies a trade that was executed outside of regular primary market hours and is reported as an extended hours trade.\")]\n        ExtendedHours = 1L << 13,\n\n        /// <summary>\n        /// Identifies a trade that takes place outside of regular market hours.\n        /// </summary>\n        [Description(\"Identifies a trade that takes place outside of regular market hours.\")]\n        OutOfSequence = 1L << 14,\n\n        /// <summary>\n        /// An execution in two markets when the specialist or Market Maker in the market first receiving the order agrees to execute a portion of it\n        /// at whatever price is realized in another market to which the balance of the order is forwarded for execution.\n        /// </summary>\n        [Description(\"An execution in two markets when the specialist or Market Maker in the market first receiving the order agrees to execute a portion of it \" +\n                     \"at whatever price is realized in another market to which the balance of the order is forwarded for execution.\")]\n        Split = 1L << 15,\n\n        /// <summary>\n        /// A transaction made on the Exchange as a result of an Exchange acquisition.\n        /// </summary>\n        [Description(\"A transaction made on the Exchange as a result of an Exchange acquisition.\")]\n        Acquisition = 1L << 16,\n\n        /// <summary>\n        /// A trade representing an aggregate of two or more regular trades in a security occurring at the same price either simultaneously\n        /// or within the same 60-second period, with no individual trade exceeding 10,000 shares.\n        /// </summary>\n        [Description(\"A trade representing an aggregate of two or more regular trades in a security occurring at the same price either simultaneously \" +\n                     \"or within the same 60-second period, with no individual trade exceeding 10,000 shares.\")]\n        Bunched = 1L << 17,\n\n        /// <summary>\n        /// Stock-Option Trade is used to identify cash equity transactions which are related to options transactions and therefore\n        /// potentially subject to cancellation if market conditions of the options leg(s) prevent the execution of the stock-option\n        /// order at the price agreed upon.\n        /// </summary>\n        [Description(\"Stock-Option Trade is used to identify cash equity transactions which are related to options transactions and therefore\" +\n                     \"potentially subject to cancellation if market conditions of the options leg(s) prevent the execution of the stock-option\" +\n                     \"order at the price agreed upon.\")]\n        StockOption = 1L << 18,\n\n        /// <summary>\n        /// Sale of a large block of stock in such a manner that the price is not adversely affected.\n        /// </summary>\n        [Description(\"Sale of a large block of stock in such a manner that the price is not adversely affected.\")]\n        Distribution = 1L << 19,\n\n        /// <summary>\n        /// A trade where the price reported is based upon an average of the prices for transactions in a security during all or any portion of the trading day.\n        /// </summary>\n        [Description(\"A trade where the price reported is based upon an average of the prices for transactions in a security during all or any portion of the trading day.\")]\n        AveragePrice = 1L << 20,\n\n        /// <summary>\n        /// Indicates that the trade resulted from a Market Center’s crossing session.\n        /// </summary>\n        [Description(\"Indicates that the trade resulted from a Market Center’s crossing session.\")]\n        Cross = 1L << 21,\n\n        /// <summary>\n        /// Indicates a regular market session trade transaction that carries a price that is significantly away from the prevailing consolidated or primary market value at the time of the transaction.\n        /// </summary>\n        [Description(\"Indicates a regular market session trade transaction that carries a price that is significantly away from the prevailing consolidated or primary market value at the time of the transaction.\")]\n        PriceVariation = 1L << 22,\n\n        /// <summary>\n        /// To qualify as a NYSE AMEX Rule 155\n        /// </summary>\n        [Description(\"To qualify as a NYSE AMEX Rule 155\")]\n        Rule155 = 1L << 23,\n\n        /// <summary>\n        /// Indicates the ‘Official’ closing value as determined by a Market Center. This transaction report will contain the market center generated closing price.\n        /// </summary>\n        [Description(\"Indicates the ‘Official’ closing value as determined by a Market Center. This transaction report will contain the market center generated closing price.\")]\n        OfficialClose = 1L << 24,\n\n        /// <summary>\n        /// A sale condition that identifies a trade based on a price at a prior point in time i.e. more than 90 seconds prior to the time of the trade report.\n        /// The execution time of the trade will be the time of the prior reference price.\n        /// </summary>\n        [Description(\"A sale condition that identifies a trade based on a price at a prior point in time i.e. more than 90 seconds prior to the time of the trade report. \" +\n                     \"The execution time of the trade will be the time of the prior reference price.\")]\n        PriorReferencePrice = 1L << 25,\n\n        /// <summary>\n        /// Indicates the ‘Official’ open value as determined by a Market Center. This transaction report will contain the market\n        /// </summary>\n        [Description(\"Indicates the ‘Official’ open value as determined by a Market Center. This transaction report will contain the market\")]\n        OfficialOpen = 1L << 26,\n\n        /// <summary>\n        /// The CAP Election Trade highlights sales as a result of a sweep execution on the NYSE, whereby CAP orders have been elected and executed\n        /// outside the best price bid or offer and the orders appear as repeat trades at subsequent execution prices.\n        /// This indicator provides additional information to market participants that an automatic sweep transaction has occurred with repeat\n        /// trades as one continuous electronic transaction.\n        /// </summary>\n        [Description(\"The CAP Election Trade highlights sales as a result of a sweep execution on the NYSE, whereby CAP orders have been elected and executed \" +\n                     \"outside the best price bid or offer and the orders appear as repeat trades at subsequent execution prices. \" +\n                     \"This indicator provides additional information to market participants that an automatic sweep transaction has occurred with repeat \" +\n                     \"trades as one continuous electronic transaction.\")]\n        CapElection = 1L << 27,\n\n        /// <summary>\n        /// A sale condition code that identifies a NYSE trade that has been automatically executed without the potential benefit of price improvement.\n        /// </summary>\n        [Description(\"A sale condition code that identifies a NYSE trade that has been automatically executed without the potential benefit of price improvement.\")]\n        AutoExecution = 1L << 28,\n\n        /// <summary>\n        /// Denotes whether or not a trade is exempt (Rule 611) and when used jointly with certain Sale Conditions,\n        /// will more fully describe the characteristics of a particular trade.\n        /// </summary>\n        [Description(\"Denotes whether or not a trade is exempt (Rule 611) and when used jointly with certain Sale Conditions, \" +\n                     \"will more fully describe the characteristics of a particular trade.\")]\n        TradeThroughExempt = 1L << 29,\n\n        /// <summary>\n        /// This flag is present in raw data, but AlgoSeek document does not describe it.\n        /// </summary>\n        [Description(\"This flag is present in raw data, but AlgoSeek document does not describe it.\")]\n        UndocumentedFlag = 1L << 30,\n\n        /// <summary>\n        /// Denotes the trade is an odd lot less than a 100 shares.\n        /// </summary>\n        [Description(\"Denotes the trade is an odd lot less than a 100 shares.\")]\n        OddLot = 1L << 31,\n    }\n}\n"
  },
  {
    "path": "Common/Data/BaseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing ProtoBuf;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Abstract base data class of QuantConnect. It is intended to be extended to define\n    /// generic user customizable data types while at the same time implementing the basics of data where possible\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    [ProtoInclude(8, typeof(Tick))]\n    [ProtoInclude(100, typeof(TradeBar))]\n    [ProtoInclude(200, typeof(QuoteBar))]\n    [ProtoInclude(300, typeof(Dividend))]\n    [ProtoInclude(400, typeof(Split))]\n    [PandasIgnoreMembers]\n    public abstract class BaseData : IBaseData\n    {\n        private decimal _value;\n\n        /// <summary>\n        /// A list of all <see cref=\"Resolution\"/>\n        /// </summary>\n        protected static readonly List<Resolution> AllResolutions =\n            Enum.GetValues(typeof(Resolution)).Cast<Resolution>().ToList();\n\n        /// <summary>\n        /// A list of <see cref=\"Resolution.Daily\"/>\n        /// </summary>\n        protected static readonly List<Resolution> DailyResolution = new List<Resolution> { Resolution.Daily };\n\n        /// <summary>\n        /// A list of <see cref=\"Resolution.Minute\"/>\n        /// </summary>\n        protected static readonly List<Resolution> MinuteResolution = new List<Resolution> { Resolution.Minute };\n\n        /// <summary>\n        /// A list of high <see cref=\"Resolution\"/>, including minute, second, and tick.\n        /// </summary>\n        protected static readonly List<Resolution> HighResolution = new List<Resolution> { Resolution.Minute, Resolution.Second, Resolution.Tick };\n\n        /// <summary>\n        /// A list of resolutions support by Options\n        /// </summary>\n        protected static readonly List<Resolution> OptionResolutions = new List<Resolution> { Resolution.Daily, Resolution.Hour, Resolution.Minute };\n\n        /// <summary>\n        /// Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.\n        /// </summary>\n        /// <remarks>Data is classed into two categories - streams of instantaneous prices and groups of OHLC data.</remarks>\n        [ProtoMember(1)]\n        public MarketDataType DataType { get; set; } = MarketDataType.Base;\n\n        /// <summary>\n        /// True if this is a fill forward piece of data\n        /// </summary>\n        public bool IsFillForward { get; private set; }\n\n        /// <summary>\n        /// Current time marker of this data packet.\n        /// </summary>\n        /// <remarks>All data is timeseries based.</remarks>\n        [ProtoMember(2)]\n        public DateTime Time { get; set; }\n\n        /// <summary>\n        /// The end time of this data. Some data covers spans (trade bars) and as such we want\n        /// to know the entire time span covered\n        /// </summary>\n        // NOTE: This is needed event though the class is marked with [PandasIgnoreMembers] because the property is virtual.\n        // If a derived class overrides it, without [PandasIgnore], the property will not be ignored.\n        [PandasIgnore]\n        public virtual DateTime EndTime\n        {\n            get { return Time; }\n            set { Time = value; }\n        }\n\n        /// <summary>\n        /// Symbol representation for underlying Security\n        /// </summary>\n        public Symbol Symbol { get; set; } = Symbol.Empty;\n\n        /// <summary>\n        /// Value representation of this data packet. All data requires a representative value for this moment in time.\n        /// For streams of data this is the price now, for OHLC packets this is the closing price.\n        /// </summary>\n        [ProtoMember(4)]\n        [PandasIgnore]\n        public virtual decimal Value\n        {\n            get\n            {\n                return _value;\n            }\n            set\n            {\n                _value = value;\n            }\n        }\n\n        /// <summary>\n        /// As this is a backtesting platform we'll provide an alias of value as price.\n        /// </summary>\n        [PandasIgnore]\n        public virtual decimal Price => Value;\n\n        /// <summary>\n        /// Constructor for initialising the dase data class\n        /// </summary>\n        public BaseData()\n        {\n            //Empty constructor required for fast-reflection initialization\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public virtual BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            // stub implementation to prevent compile errors in user algorithms\n            var dataFeed = isLiveMode ? DataFeedEndpoint.LiveTrading : DataFeedEndpoint.Backtesting;\n#pragma warning disable 618 // This implementation is left here for backwards compatibility of the BaseData API\n            return Reader(config, line, date, dataFeed);\n#pragma warning restore 618\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [StubsIgnore]\n        public virtual BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            throw new NotImplementedException(\"Each data types has to implement is own Stream reader\");\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public virtual SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            // stub implementation to prevent compile errors in user algorithms\n            var dataFeed = isLiveMode ? DataFeedEndpoint.LiveTrading : DataFeedEndpoint.Backtesting;\n#pragma warning disable 618 // This implementation is left here for backwards compatibility of the BaseData API\n            var source = GetSource(config, date, dataFeed);\n#pragma warning restore 618\n\n            if (isLiveMode)\n            {\n                // live trading by default always gets a rest endpoint\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.Rest);\n            }\n\n            // construct a uri to determine if we have a local or remote file\n            var uri = new Uri(source, UriKind.RelativeOrAbsolute);\n\n            if (uri.IsAbsoluteUri && !uri.IsLoopback)\n            {\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile);\n            }\n\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile);\n        }\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <returns>True indicates mapping should be used</returns>\n        public virtual bool RequiresMapping()\n        {\n            return Symbol.RequiresMapping();\n        }\n\n        /// <summary>\n        /// Indicates that the data set is expected to be sparse\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        /// <returns>True if the data set represented by this type is expected to be sparse</returns>\n        public virtual bool IsSparseData()\n        {\n            // by default, we'll assume all custom data is sparse data\n            return Symbol.SecurityType == SecurityType.Base;\n        }\n\n        /// <summary>\n        /// Indicates whether this contains data that should be stored in the security cache\n        /// </summary>\n        /// <returns>Whether this contains data that should be stored in the security cache</returns>\n        public virtual bool ShouldCacheToSecurity()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public virtual Resolution DefaultResolution()\n        {\n            return Resolution.Minute;\n        }\n\n        /// <summary>\n        /// Gets the supported resolution for this data and security type\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public virtual List<Resolution> SupportedResolutions()\n        {\n            if (Symbol.SecurityType.IsOption())\n            {\n                return OptionResolutions;\n            }\n\n            return AllResolutions;\n        }\n\n        /// <summary>\n        /// Specifies the data time zone for this data type. This is useful for custom data types\n        /// </summary>\n        /// <remarks>Will throw <see cref=\"InvalidOperationException\"/> for security types\n        /// other than <see cref=\"SecurityType.Base\"/></remarks>\n        /// <returns>The <see cref=\"DateTimeZone\"/> of this data type</returns>\n        public virtual DateTimeZone DataTimeZone()\n        {\n            if (Symbol.SecurityType != SecurityType.Base)\n            {\n                throw new InvalidOperationException(\"BaseData.DataTimeZone(): is only valid for base data types\");\n            }\n            return TimeZones.NewYork;\n        }\n\n        /// <summary>\n        /// Updates this base data with a new trade\n        /// </summary>\n        /// <param name=\"lastTrade\">The price of the last trade</param>\n        /// <param name=\"tradeSize\">The quantity traded</param>\n        public void UpdateTrade(decimal lastTrade, decimal tradeSize)\n        {\n            Update(lastTrade, 0, 0, tradeSize, 0, 0);\n        }\n\n        /// <summary>\n        /// Updates this base data with new quote information\n        /// </summary>\n        /// <param name=\"bidPrice\">The current bid price</param>\n        /// <param name=\"bidSize\">The current bid size</param>\n        /// <param name=\"askPrice\">The current ask price</param>\n        /// <param name=\"askSize\">The current ask size</param>\n        public void UpdateQuote(decimal bidPrice, decimal bidSize, decimal askPrice, decimal askSize)\n        {\n            Update(0, bidPrice, askPrice, 0, bidSize, askSize);\n        }\n\n        /// <summary>\n        /// Updates this base data with the new quote bid information\n        /// </summary>\n        /// <param name=\"bidPrice\">The current bid price</param>\n        /// <param name=\"bidSize\">The current bid size</param>\n        public void UpdateBid(decimal bidPrice, decimal bidSize)\n        {\n            Update(0, bidPrice, 0, 0, bidSize, 0);\n        }\n\n        /// <summary>\n        /// Updates this base data with the new quote ask information\n        /// </summary>\n        /// <param name=\"askPrice\">The current ask price</param>\n        /// <param name=\"askSize\">The current ask size</param>\n        public void UpdateAsk(decimal askPrice, decimal askSize)\n        {\n            Update(0, 0, askPrice, 0, 0, askSize);\n        }\n\n        /// <summary>\n        /// Update routine to build a bar/tick from a data update.\n        /// </summary>\n        /// <param name=\"lastTrade\">The last trade price</param>\n        /// <param name=\"bidPrice\">Current bid price</param>\n        /// <param name=\"askPrice\">Current asking price</param>\n        /// <param name=\"volume\">Volume of this trade</param>\n        /// <param name=\"bidSize\">The size of the current bid, if available</param>\n        /// <param name=\"askSize\">The size of the current ask, if available</param>\n        public virtual void Update(decimal lastTrade, decimal bidPrice, decimal askPrice, decimal volume, decimal bidSize, decimal askSize)\n        {\n            Value = lastTrade;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <param name=\"fillForward\">True if this is a fill forward clone</param>\n        /// <returns>A clone of the current object</returns>\n        public virtual BaseData Clone(bool fillForward)\n        {\n            var clone = Clone();\n            clone.IsFillForward = fillForward;\n            return clone;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public virtual BaseData Clone()\n        {\n            return (BaseData) ObjectActivator.Clone((object)this);\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            return $\"{Symbol}: {Value.ToStringInvariant(\"C\")}\";\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <remarks>OBSOLETE:: This implementation is added for backward/forward compatibility purposes. This function is no longer called by the LEAN engine.</remarks>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"dataFeed\">Type of datafeed we're requesting - a live or backtest feed.</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [Obsolete(\"Reader(SubscriptionDataConfig, string, DateTime, DataFeedEndpoint) method has been made obsolete, use Reader(SubscriptionDataConfig, string, DateTime, bool) instead.\")]\n        [StubsIgnore]\n        public virtual BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, DataFeedEndpoint dataFeed)\n        {\n            throw new InvalidOperationException(\n                $\"Please implement Reader(SubscriptionDataConfig, string, DateTime, bool) on your custom data type: {GetType().Name}\"\n            );\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <remarks>OBSOLETE:: This implementation is added for backward/forward compatibility purposes. This function is no longer called by the LEAN engine.</remarks>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"datafeed\">Type of datafeed we're reqesting - backtest or live</param>\n        /// <returns>String URL of source file.</returns>\n        [Obsolete(\"GetSource(SubscriptionDataConfig, DateTime, DataFeedEndpoint) method has been made obsolete, use GetSource(SubscriptionDataConfig, DateTime, bool) instead.\")]\n        [StubsIgnore]\n        public virtual string GetSource(SubscriptionDataConfig config, DateTime date, DataFeedEndpoint datafeed)\n        {\n            throw new InvalidOperationException(\n                $\"Please implement GetSource(SubscriptionDataConfig, DateTime, bool) on your custom data type: {GetType().Name}\"\n            );\n        }\n\n        /// <summary>\n        /// Deserialize the message from the data server\n        /// </summary>\n        /// <param name=\"serialized\">The data server's message</param>\n        /// <returns>An enumerable of base data, if unsuccessful, returns an empty enumerable</returns>\n        public static IEnumerable<BaseData> DeserializeMessage(string serialized)\n        {\n            var deserialized = JsonConvert.DeserializeObject(serialized, JsonSerializerSettings);\n\n            var enumerable = deserialized as IEnumerable<BaseData>;\n            if (enumerable != null)\n            {\n                return enumerable;\n            }\n\n            var data = deserialized as BaseData;\n            if (data != null)\n            {\n                return new[] { data };\n            }\n\n            return Enumerable.Empty<BaseData>();\n        }\n\n        private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings\n        {\n            TypeNameHandling = TypeNameHandling.All\n        };\n    }\n}\n"
  },
  {
    "path": "Common/Data/BaseDataRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Abstract sharing logic for data requests\n    /// </summary>\n    public abstract class BaseDataRequest\n    {\n        private readonly Lazy<DateTime> _localStartTime;\n        private readonly Lazy<DateTime> _localEndTime;\n\n        /// <summary>\n        /// Gets the beginning of the requested time interval in UTC\n        /// </summary>\n        public DateTime StartTimeUtc { get; protected set; }\n\n        /// <summary>\n        /// Gets the end of the requested time interval in UTC\n        /// </summary>\n        public DateTime EndTimeUtc { get; protected set;  }\n\n        /// <summary>\n        /// Gets the <see cref=\"StartTimeUtc\"/> in the security's exchange time zone\n        /// </summary>\n        public DateTime StartTimeLocal => _localStartTime.Value;\n\n        /// <summary>\n        /// Gets the <see cref=\"EndTimeUtc\"/> in the security's exchange time zone\n        /// </summary>\n        public DateTime EndTimeLocal => _localEndTime.Value;\n\n        /// <summary>\n        /// Gets the exchange hours used for processing fill forward requests\n        /// </summary>\n        public SecurityExchangeHours ExchangeHours { get; }\n\n        /// <summary>\n        /// Gets the tradable days specified by this request, in the security's data time zone\n        /// </summary>\n        public abstract IEnumerable<DateTime> TradableDaysInDataTimeZone { get; }\n\n        /// <summary>\n        /// Gets true if this is a custom data request, false for normal QC data\n        /// </summary>\n        public bool IsCustomData { get; }\n\n        /// <summary>\n        /// The data type of this request\n        /// </summary>\n        public Type DataType { get; set; }\n\n        /// <summary>\n        /// Initializes the base data request\n        /// </summary>\n        /// <param name=\"startTimeUtc\">The start time for this request,</param>\n        /// <param name=\"endTimeUtc\">The start time for this request</param>\n        /// <param name=\"exchangeHours\">The exchange hours for this request</param>\n        /// <param name=\"tickType\">The tick type of this request</param>\n        /// <param name=\"isCustomData\">True if this subscription is for custom data</param>\n        /// <param name=\"dataType\">The data type of the output data</param>\n        protected BaseDataRequest(DateTime startTimeUtc,\n            DateTime endTimeUtc,\n            SecurityExchangeHours exchangeHours,\n            TickType tickType,\n            bool isCustomData,\n            Type dataType)\n        {\n            DataType = dataType;\n            IsCustomData = isCustomData;\n            StartTimeUtc = startTimeUtc;\n            EndTimeUtc = endTimeUtc;\n            ExchangeHours = exchangeHours;\n\n            // open interest data comes in once a day before market open,\n            // make the subscription start from midnight and use always open exchange\n            if (tickType == TickType.OpenInterest)\n            {\n                ExchangeHours = SecurityExchangeHours.AlwaysOpen(ExchangeHours.TimeZone);\n            }\n\n            _localStartTime = new Lazy<DateTime>(() => StartTimeUtc.ConvertFromUtc(ExchangeHours.TimeZone));\n            _localEndTime = new Lazy<DateTime>(() => EndTimeUtc.ConvertFromUtc(ExchangeHours.TimeZone));\n            IsCustomData = isCustomData;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Channel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data\n{\n\n    /// <summary>\n    /// Represents a subscription channel\n    /// </summary>\n    public class Channel\n    {\n\n        /// <summary>\n        /// Represents an internal channel name for all brokerage channels in case we don't differentiate them\n        /// </summary>\n        public static string Single = \"common\";\n\n        /// <summary>\n        /// The name of the channel\n        /// </summary>\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// The ticker symbol of the channel\n        /// </summary>\n        public Symbol Symbol { get; private set; }\n\n        /// <summary>\n        /// Creates an instance of subscription channel\n        /// </summary>\n        /// <param name=\"channelName\">Socket channel name</param>\n        /// <param name=\"symbol\">Associated symbol</param>\n        public Channel(string channelName, Symbol symbol)\n        {\n            if (string.IsNullOrEmpty(channelName))\n            {\n                throw new ArgumentNullException(nameof(channelName), \"Channel Name can't be null or empty\");\n            }\n\n            if (symbol == null)\n            {\n                throw new ArgumentNullException(nameof(symbol), \"Symbol can't be null or empty\");\n            }\n\n            Name = channelName;\n            Symbol = symbol;\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        public bool Equals(Channel other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return string.Equals(Name, other?.Name) && Symbol.Equals(other.Symbol);\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is equal to the current object.\n        /// </summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        public override bool Equals(object obj)\n        {\n            return Equals(obj as Channel);\n        }\n\n        /// <summary>\n        /// Serves as the default hash function.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current object.\n        /// </returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                int hash = (int)2166136261;\n                hash = (hash * 16777619) ^ Name.GetHashCode();\n                hash = (hash * 16777619) ^ Symbol.GetHashCode();\n                return hash;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/ConsolidatorWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Helper class to wrap a consolidator and keep track of the next scan time we should trigger\n    /// </summary>\n    internal class ConsolidatorWrapper : IDisposable\n    {\n        // helps us guarantee a deterministic ordering by addition/creation\n        private static long _counter;\n\n        private readonly IDataConsolidator _consolidator;\n        private readonly LocalTimeKeeper _localTimeKeeper;\n        private readonly TimeSpan _minimumIncrement;\n        private readonly ITimeKeeper _timeKeeper;\n        private readonly long _id;\n        private TimeSpan? _barSpan;\n\n        /// <summary>\n        /// True if this consolidator has been removed\n        /// </summary>\n        public bool Disposed { get; private set; }\n\n        /// <summary>\n        /// The next utc scan time\n        /// </summary>\n        public DateTime UtcScanTime { get; private set; }\n\n        /// <summary>\n        /// Get enqueue time\n        /// </summary>\n        public ConsolidatorScanPriority Priority => new(UtcScanTime, _id);\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public ConsolidatorWrapper(IDataConsolidator consolidator, TimeSpan configIncrement, ITimeKeeper timeKeeper, LocalTimeKeeper localTimeKeeper)\n        {\n            _id = Interlocked.Increment(ref _counter);\n\n            _timeKeeper = timeKeeper;\n            _consolidator = consolidator;\n            _localTimeKeeper = localTimeKeeper;\n\n            _minimumIncrement = configIncrement < Time.OneSecond ? Time.OneSecond : configIncrement;\n\n            _consolidator.DataConsolidated += AdvanceScanTime;\n        }\n\n        /// <summary>\n        /// Scans the current consolidator\n        /// </summary>\n        public void Scan()\n        {\n            _consolidator.Scan(_localTimeKeeper.LocalTime);\n\n            // it might not of emitted at all, could happen if we got no data or it's not expected to emit like in a weekend\n            // but we still need to advance the next scan time\n            AdvanceScanTime();\n        }\n\n        public void Dispose()\n        {\n            Disposed = true;\n            _consolidator.DataConsolidated -= AdvanceScanTime;\n        }\n\n        /// <summary>\n        /// Helper method to set the next scan time\n        /// </summary>\n        public void AdvanceScanTime(object _ = null, IBaseData consolidated = null)\n        {\n            if (consolidated == null && UtcScanTime > _timeKeeper.UtcTime)\n            {\n                // already set\n                return;\n            }\n\n            if (_barSpan.HasValue)\n            {\n                var reference = _timeKeeper.UtcTime;\n                if (consolidated != null)\n                {\n                    reference = consolidated.EndTime.ConvertToUtc(_localTimeKeeper.TimeZone);\n                }\n                UtcScanTime = reference + _barSpan.Value;\n            }\n            else\n            {\n                if (consolidated != null)\n                {\n                    _barSpan = consolidated.EndTime - consolidated.Time;\n                    if (_barSpan < _minimumIncrement)\n                    {\n                        _barSpan = _minimumIncrement;\n                    }\n\n                    UtcScanTime = consolidated.EndTime.ConvertToUtc(_localTimeKeeper.TimeZone) + _barSpan.Value;\n                }\n                else if (_consolidator.WorkingData == null)\n                {\n                    // we have no reference\n                    UtcScanTime = _timeKeeper.UtcTime + _minimumIncrement;\n                }\n                else\n                {\n                    var pontetialEndTime = _consolidator.WorkingData.EndTime.ConvertToUtc(_localTimeKeeper.TimeZone);\n                    if (pontetialEndTime > _timeKeeper.UtcTime)\n                    {\n                        UtcScanTime = pontetialEndTime;\n                    }\n                    else\n                    {\n                        UtcScanTime = _timeKeeper.UtcTime + _minimumIncrement;\n                    }\n                }\n            }\n        }\n    }\n\n    internal class ConsolidatorScanPriority\n    {\n        private sealed class UtcScanTimeIdRelationalComparer : IComparer<ConsolidatorScanPriority>\n        {\n            public int Compare(ConsolidatorScanPriority? x, ConsolidatorScanPriority? y)\n            {\n                if (ReferenceEquals(x, y)) return 0;\n                if (y is null) return 1;\n                if (x is null) return -1;\n                var utcScanTimeComparison = x.UtcScanTime.CompareTo(y.UtcScanTime);\n                if (utcScanTimeComparison != 0) return utcScanTimeComparison;\n                return x.Id.CompareTo(y.Id);\n            }\n        }\n\n        public static IComparer<ConsolidatorScanPriority> Comparer { get; } =\n            new UtcScanTimeIdRelationalComparer();\n\n        /// <summary>\n        /// The next utc scan time\n        /// </summary>\n        public DateTime UtcScanTime { get; }\n\n        /// <summary>\n        /// Unique Id of the associated consolidator\n        /// </summary>\n        public long Id { get; }\n\n        public ConsolidatorScanPriority(DateTime utcScanTime, long id)\n        {\n            Id = id;\n            UtcScanTime = utcScanTime;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/BaseDataConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Type capable of consolidating trade bars from any base data instance\n    /// </summary>\n    public class BaseDataConsolidator : TradeBarConsolidatorBase<BaseData>\n    {\n        /// <summary>\n        /// Create a new TickConsolidator for the desired resolution\n        /// </summary>\n        /// <param name=\"resolution\">The resolution desired</param>\n        /// <returns>A consolidator that produces data on the resolution interval</returns>\n        public static BaseDataConsolidator FromResolution(Resolution resolution)\n        {\n            return new BaseDataConsolidator(resolution.ToTimeSpan());\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public BaseDataConsolidator(TimeSpan period)\n            : base(period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public BaseDataConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public BaseDataConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public BaseDataConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Func that defines the start time of a consolidated data</param>\n        public BaseDataConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new trade bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref TradeBar workingBar, BaseData data)\n        {\n            if (workingBar == null)\n            {\n                workingBar = new TradeBar\n                {\n                    Symbol = data.Symbol,\n                    Time = GetRoundedBarTime(data.Time),\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Open = data.Value,\n                    DataType = data.DataType,\n                    Value = data.Value\n                };\n            }\n            else\n            {\n                //Aggregate the working bar\n                workingBar.Close = data.Value;\n                if (data.Value < workingBar.Low) workingBar.Low = data.Value;\n                if (data.Value > workingBar.High) workingBar.High = data.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/BaseTimelessConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Represents a timeless consolidator which depends on the given values. This consolidator\n    /// is meant to consolidate data into bars that do not depend on time, e.g., RangeBar's.\n    /// </summary>\n    public abstract class BaseTimelessConsolidator<T> : IDataConsolidator\n        where T : IBaseData\n    {\n        /// <summary>\n        /// Extracts the value from a data instance to be formed into a <see cref=\"T\"/>.\n        /// </summary>\n        protected Func<IBaseData, decimal> Selector { get; set; }\n\n        /// <summary>\n        /// Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.\n        /// </summary>\n        protected Func<IBaseData, decimal> VolumeSelector { get; set; }\n\n        /// <summary>\n        /// Event handler type for the IDataConsolidator.DataConsolidated event\n        /// </summary>\n        protected DataConsolidatedHandler DataConsolidatedHandler { get; set; }\n\n        /// <summary>\n        /// Bar being created\n        /// </summary>\n        protected virtual T CurrentBar {  get; set; }\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated { get; protected set; }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public abstract IBaseData WorkingData { get; }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType => typeof(IBaseData);\n\n        /// <summary>\n        /// Gets <see cref=\"T\"/> which is the type emitted in the <see cref=\"IDataConsolidator.DataConsolidated\"/> event.\n        /// </summary>\n        public virtual Type OutputType => typeof(T);\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event EventHandler<T> DataConsolidated;\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        event DataConsolidatedHandler IDataConsolidator.DataConsolidated\n        {\n            add { DataConsolidatedHandler += value; }\n            remove { DataConsolidatedHandler -= value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseTimelessConsolidator{T}\" /> class.\n        /// </summary>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a new bar which inherits from <see cref=\"IBaseData\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        protected BaseTimelessConsolidator(Func<IBaseData, decimal> selector = null, Func<IBaseData, decimal> volumeSelector = null)\n        {\n            Selector = selector ?? (x => x.Value);\n            VolumeSelector = volumeSelector ?? (x => x is TradeBar bar ? bar.Volume : (x is Tick tick ? tick.Quantity : 0));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseTimelessConsolidator{T}\" /> class.\n        /// </summary>\n        /// <param name=\"valueSelector\">Extracts the value from a data instance to be formed into a new bar which inherits from <see cref=\"IBaseData\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        protected BaseTimelessConsolidator(PyObject valueSelector, PyObject volumeSelector = null)\n            : this (TryToConvertSelector(valueSelector, nameof(valueSelector)), TryToConvertSelector(volumeSelector, nameof(volumeSelector)))\n        {\n        }\n\n        /// <summary>\n        /// Tries to convert the given python selector to a C# one. If the conversion is not\n        /// possible it returns null\n        /// </summary>\n        /// <param name=\"selector\">The python selector to be converted</param>\n        /// <param name=\"selectorName\">The name of the selector to be used in case an exception is thrown</param>\n        /// <exception cref=\"ArgumentException\">This exception will be thrown if it's not possible to convert the\n        /// given python selector to C#</exception>\n        private static Func<IBaseData, decimal> TryToConvertSelector(PyObject selector, string selectorName)\n        {\n            using (Py.GIL())\n            {\n                Func<IBaseData, decimal> resultSelector;\n                if (selector != null && !selector.IsNone())\n                {\n                    if (!selector.TrySafeAs(out resultSelector))\n                    {\n                        throw new ArgumentException(\n                            $\"Unable to convert parameter {selectorName} to delegate type Func<IBaseData, decimal>\");\n                    }\n                }\n                else\n                {\n                    resultSelector = null;\n                }\n\n                return resultSelector;\n            }\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(IBaseData data)\n        {\n            var currentValue = Selector(data);\n            var volume = VolumeSelector(data);\n\n            // If we're already in a bar then update it\n            if (CurrentBar != null)\n            {\n                UpdateBar(data.Time, currentValue, volume);\n            }\n\n            // The state of the CurrentBar could have changed after UpdateBar(),\n            // then we might need to create a new bar\n            if (CurrentBar == null)\n            {\n                CreateNewBar(data, currentValue, volume);\n            }\n        }\n\n        /// <summary>\n        /// Updates the current RangeBar being created with the given data.\n        /// Additionally, if it's the case, it consolidates the current RangeBar\n        /// </summary>\n        /// <param name=\"time\">Time of the given data</param>\n        /// <param name=\"currentValue\">Value of the given data</param>\n        /// <param name=\"volume\">Volume of the given data</param>\n        protected abstract void UpdateBar(DateTime time, decimal currentValue, decimal volume);\n\n        /// <summary>\n        /// Creates a new bar with the given data\n        /// </summary>\n        /// <param name=\"data\">The new data for the bar</param>\n        /// <param name=\"currentValue\">The new value for the bar</param>\n        /// <param name=\"volume\">The new volume to the bar</param>\n        protected abstract void CreateNewBar(IBaseData data, decimal currentValue, decimal volume);\n\n        /// <summary>\n        /// Event invocator for the DataConsolidated event. This should be invoked\n        /// by derived classes when they have consolidated a new piece of data.\n        /// </summary>\n        /// <param name=\"consolidated\">The newly consolidated data</param>\n        protected void OnDataConsolidated(T consolidated)\n        {\n            DataConsolidated?.Invoke(this, consolidated);\n\n            DataConsolidatedHandler?.Invoke(this, consolidated);\n\n            Consolidated = consolidated;\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public virtual void Dispose()\n        {\n            DataConsolidated = null;\n            DataConsolidatedHandler = null;\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public virtual void Reset()\n        {\n            Consolidated = null;\n            CurrentBar = default(T);\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public void Scan(DateTime currentLocalTime)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/Calendar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Helper class that provides <see cref=\"Func{DateTime,CalendarInfo}\"/> used to define consolidation calendar\n    /// </summary>\n    public static class Calendar\n    {\n        /// <summary>\n        /// Computes the start of week (previous Monday) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Weekly\n        {\n            get\n            {\n                return dt =>\n                {\n                    var start = Expiry.EndOfWeek(dt).AddDays(-7);\n                    return new CalendarInfo(start, TimeSpan.FromDays(7));\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the start of month (1st of the current month) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Monthly\n        {\n            get\n            {\n                return dt =>\n                {\n                    var start = dt.AddDays(1 - dt.Day).Date;\n                    var end = Expiry.EndOfMonth(dt);\n                    return new CalendarInfo(start, end - start);\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the start of quarter (1st of the starting month of current quarter) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Quarterly\n        {\n            get\n            {\n                return dt =>\n                {\n                    var nthQuarter = (dt.Month - 1) / 3;\n                    var firstMonthOfQuarter = nthQuarter * 3 + 1;\n                    var start = new DateTime(dt.Year, firstMonthOfQuarter, 1);\n                    var end = Expiry.EndOfQuarter(dt);\n                    return new CalendarInfo(start, end - start);\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the start of year (1st of the current year) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Yearly\n        {\n            get\n            {\n                return dt =>\n                {\n                    var start = dt.AddDays(1 - dt.DayOfYear).Date;\n                    var end = Expiry.EndOfYear(dt);\n                    return new CalendarInfo(start, end - start);\n                };\n            }\n        }\n    }\n\n    /// <summary>\n    /// Calendar Info for storing information related to the start and period of a consolidator\n    /// </summary>\n    public readonly struct CalendarInfo\n    {\n        /// <summary>\n        /// Calendar Start\n        /// </summary>\n        public DateTime Start { get; init; }\n\n        /// <summary>\n        /// Consolidation Period\n        /// </summary>\n        public TimeSpan Period { get; init; }\n\n        /// <summary>\n        /// Calendar End\n        /// </summary>\n        public readonly DateTime End => Start + Period;\n\n        /// <summary>\n        /// Constructor for CalendarInfo; used for consolidation calendar\n        /// </summary>\n        /// <param name=\"start\">Calendar Start</param>\n        /// <param name=\"period\">Consolidation Period</param>\n        public CalendarInfo(DateTime start, TimeSpan period)\n        {\n            Start = start;\n            Period = period;\n        }\n\n        /// <summary>\n        /// Returns a string containing the Calendar start and the consolidation period\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Start} {Period}\";\n        }\n\n        /// <summary>\n        /// Indicates whether the given object is equal to this object, this is, the Calendar start\n        /// and consolidation period is the same for both\n        /// </summary>\n        public override bool Equals(object obj)\n        {\n            if (obj is not CalendarInfo other)\n            {\n                return false;\n            }\n            return Start == other.Start && Period == other.Period;\n        }\n\n        /// <summary>\n        /// Returns the hash code for this object as an integer\n        /// </summary>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = Start.GetHashCode();\n                return (hashCode * 397) ^ Period.GetHashCode();\n            }\n        }\n\n        /// <summary>\n        /// Indicates whether the given object is equal to this object, this is, the Calendar start\n        /// and consolidation period is the same for both\n        /// </summary>\n        public static bool operator ==(CalendarInfo left, CalendarInfo right)\n        {\n            return left.Equals(right);\n        }\n\n        /// <summary>\n        /// Indicates whether the given object is equal to this object, this is, the Calendar start\n        /// and consolidation period is the same for both\n        /// </summary>\n        public static bool operator !=(CalendarInfo left, CalendarInfo right)\n        {\n            return !(left == right);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/CalendarType.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Calendar Type Class; now obsolete routes functions to <see cref=\"Calendar\"/>\n    /// </summary>\n    [Obsolete(\"CalendarType is obsolete, please use Calendar instead\")]\n    public static class CalendarType\n    {\n        /// <summary>\n        /// Computes the start of week (previous Monday) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Weekly => Calendar.Weekly;\n\n        /// <summary>\n        /// Computes the start of month (1st of the current month) of given date/time\n        /// </summary>\n        public static Func<DateTime, CalendarInfo> Monthly => Calendar.Monthly;\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/ClassicRangeConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"IBaseData\"/> instances into a stream of <see cref=\"RangeBar\"/>.\n    /// The difference between this consolidator and <see cref=\"RangeConsolidator\"/>, is that this last one creates intermediate/\n    /// phantom RangeBar's (RangeBar's with zero volume) if the price rises up or falls down by above/below two times the range \n    /// size. Therefore, <see cref=\"RangeConsolidator\"/> leaves no space between two adyacent RangeBar's since it always start \n    /// a new RangeBar one range above the last RangeBar's High value or one range below the last RangeBar's Low value, where \n    /// one range equals to one minimum price change.\n    /// </summary>\n    public class ClassicRangeConsolidator : RangeConsolidator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRangeConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"range\">The Range interval sets the range in which the price moves, which in turn initiates the formation of a new bar.\n        /// One range equals to one minimum price change, where this last value is defined depending of the RangeBar's symbol</param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RangeBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar, except if the input is a TradeBar.</param>\n        public ClassicRangeConsolidator(\n            int range,\n            Func<IBaseData, decimal> selector = null,\n            Func<IBaseData, decimal> volumeSelector = null)\n            : base(range, selector, volumeSelector)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RangeConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"range\">The Range interval sets the range in which the price moves, which in turn initiates the formation of a new bar.\n        /// One range equals to one minimum price change, where this last value is defined depending of the RangeBar's symbol</param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RangeBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        public ClassicRangeConsolidator(int range,\n            PyObject selector,\n            PyObject volumeSelector = null)\n            : base(range, selector, volumeSelector)\n        {\n        }\n\n        /// <summary>\n        /// Updates the current RangeBar being created with the given data.\n        /// Additionally, if it's the case, it consolidates the current RangeBar\n        /// </summary>\n        /// <param name=\"time\">Time of the given data</param>\n        /// <param name=\"currentValue\">Value of the given data</param>\n        /// <param name=\"volume\">Volume of the given data</param>\n        protected override void UpdateBar(DateTime time, decimal currentValue, decimal volume)\n        {\n            CurrentBar.Update(time, currentValue, volume);\n\n            if (CurrentBar.IsClosed)\n            {\n                OnDataConsolidated(CurrentBar);\n                CurrentBar = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/ClassicRenkoConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"IBaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// </summary>\n    public class ClassicRenkoConsolidator : BaseTimelessConsolidator<RenkoBar>\n    {\n        private decimal _barSize;\n        private bool _evenBars;\n        private decimal? _lastCloseValue;\n\n        /// <summary>\n        /// Bar being created\n        /// </summary>\n        protected override RenkoBar CurrentBar { get; set; }\n\n        /// <summary>\n        /// Gets the kind of the bar\n        /// </summary>\n        public RenkoType Type => RenkoType.Classic;\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public override IBaseData WorkingData => CurrentBar?.Clone();\n\n        /// <summary>\n        /// Gets <see cref=\"RenkoBar\"/> which is the type emitted in the <see cref=\"IDataConsolidator.DataConsolidated\"/> event.\n        /// </summary>\n        public override Type OutputType => typeof(RenkoBar);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// The value selector will by default select <see cref=\"IBaseData.Value\"/>\n        /// The volume selector will by default select zero.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        /// <param name=\"evenBars\">When true bar open/close will be a multiple of the barSize</param>\n        public ClassicRenkoConsolidator(decimal barSize, bool evenBars = true)\n            : base()\n        {\n            EpsilonCheck(barSize);\n            _barSize = barSize;\n            _evenBars = evenBars;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"barSize\">The size of each bar in units of the value produced by <paramref name=\"selector\"/></param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RenkoBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        /// <param name=\"evenBars\">When true bar open/close will be a multiple of the barSize</param>\n        public ClassicRenkoConsolidator(\n            decimal barSize,\n            Func<IBaseData, decimal> selector,\n            Func<IBaseData, decimal> volumeSelector = null,\n            bool evenBars = true)\n            : base(selector, volumeSelector)\n        {\n            EpsilonCheck(barSize);\n            _barSize = barSize;\n            _evenBars = evenBars;\n        }\n\n        /// <summary>\n        ///Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        /// <param name=\"type\">The RenkoType of the bar</param>\n        [Obsolete(\"Please use the new RenkoConsolidator if RenkoType is not Classic\")]\n        public ClassicRenkoConsolidator(decimal barSize, RenkoType type)\n        : this(barSize, true)\n        {\n            if (type != RenkoType.Classic)\n            {\n                throw new ArgumentException(\"Please use the new RenkoConsolidator type if RenkoType is not Classic\");\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"barSize\">The size of each bar in units of the value produced by <paramref name=\"selector\"/></param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RenkoBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        /// <param name=\"evenBars\">When true bar open/close will be a multiple of the barSize</param>\n        public ClassicRenkoConsolidator(decimal barSize,\n            PyObject selector,\n            PyObject volumeSelector = null,\n            bool evenBars = true)\n            : base(selector, volumeSelector)\n        {\n            EpsilonCheck(barSize);\n            _barSize = barSize;\n            _evenBars = evenBars;\n        }\n\n        /// <summary>\n        /// Resets the ClassicRenkoConsolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _lastCloseValue = null;\n        }\n\n        /// <summary>\n        /// Updates the current RangeBar being created with the given data.\n        /// Additionally, if it's the case, it consolidates the current RangeBar\n        /// </summary>\n        /// <param name=\"time\">Time of the given data</param>\n        /// <param name=\"currentValue\">Value of the given data</param>\n        /// <param name=\"volume\">Volume of the given data</param>\n        protected override void UpdateBar(DateTime time, decimal currentValue, decimal volume)\n        {\n            CurrentBar.Update(time, currentValue, volume);\n\n            if (CurrentBar.IsClosed)\n            {\n                _lastCloseValue = CurrentBar.Close;\n                OnDataConsolidated(CurrentBar);\n                CurrentBar = null;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new bar with the given data\n        /// </summary>\n        /// <param name=\"data\">The new data for the bar</param>\n        /// <param name=\"currentValue\">The new value for the bar</param>\n        /// <param name=\"volume\">The new volume to the bar</param>\n        protected override void CreateNewBar(IBaseData data, decimal currentValue, decimal volume)\n        {\n            var open = _lastCloseValue ?? currentValue;\n            if (_evenBars && !_lastCloseValue.HasValue)\n            {\n                open = Math.Ceiling(open / _barSize) * _barSize;\n            }\n\n            CurrentBar = new RenkoBar(data.Symbol, data.Time, _barSize, open, volume);\n        }\n\n        private static void EpsilonCheck(decimal barSize)\n        {\n            if (barSize < Extensions.GetDecimalEpsilon())\n            {\n                throw new ArgumentOutOfRangeException(nameof(barSize),\n                    \"RenkoConsolidator bar size must be positve and greater than 1e-28\");\n            }\n        }\n    }\n\n    /// <summary>\n    /// Provides a type safe wrapper on the RenkoConsolidator class. This just allows us to define our selector functions with the real type they'll be receiving\n    /// </summary>\n    /// <typeparam name=\"TInput\"></typeparam>\n    public class ClassicRenkoConsolidator<TInput> : ClassicRenkoConsolidator\n        where TInput : IBaseData\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"barSize\">The size of each bar in units of the value produced by <paramref name=\"selector\"/></param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RenkoBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        /// <param name=\"evenBars\">When true bar open/close will be a multiple of the barSize</param>\n        public ClassicRenkoConsolidator(\n            decimal barSize,\n            Func<TInput, decimal> selector,\n            Func<TInput, decimal> volumeSelector = null,\n            bool evenBars = true\n            )\n            : base(barSize, x => selector((TInput) x),\n                volumeSelector == null ? (Func<IBaseData, decimal>) null : x => volumeSelector((TInput) x), evenBars)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// The value selector will by default select <see cref=\"IBaseData.Value\"/>\n        /// The volume selector will by default select zero.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        /// <param name=\"evenBars\">When true bar open/close will be a multiple of the barSize</param>\n        public ClassicRenkoConsolidator(decimal barSize, bool evenBars = true)\n            : this(barSize, x => x.Value, x => 0, evenBars)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClassicRenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// The value selector will by default select <see cref=\"IBaseData.Value\"/>\n        /// The volume selector will by default select zero.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        /// <param name=\"type\">The RenkoType of the bar</param>\n        [Obsolete(\"Please use the WickedRenkoConsolidator if RenkoType is not Classic\")]\n        public ClassicRenkoConsolidator(decimal barSize, RenkoType type)\n            : base(barSize, type)\n        {\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data.\n        /// </summary>\n        /// <remarks>\n        /// Type safe shim method.\n        /// </remarks>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(TInput data)\n        {\n            base.Update(data);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/DataConsolidator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Represents a type that consumes BaseData instances and fires an event with consolidated\n    /// and/or aggregated data.\n    /// </summary>\n    /// <typeparam name=\"TInput\">The type consumed by the consolidator</typeparam>\n    public abstract class DataConsolidator<TInput> : IDataConsolidator\n        where TInput : IBaseData\n    {\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(IBaseData data)\n        {\n            if (!(data is TInput))\n            {\n                throw new ArgumentNullException(nameof(data),\n                    $\"Received type of {data.GetType().Name} but expected {typeof(TInput).Name}\"\n                );\n            }\n            Update((TInput)data);\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public abstract void Scan(DateTime currentLocalTime);\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event DataConsolidatedHandler DataConsolidated;\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public abstract IBaseData WorkingData\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType\n        {\n            get { return typeof (TInput); }\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public abstract Type OutputType\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data. This method is\n        /// responsible for raising the DataConsolidated event\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public abstract void Update(TInput data);\n\n        /// <summary>\n        /// Event invocator for the DataConsolidated event. This should be invoked\n        /// by derived classes when they have consolidated a new piece of data.\n        /// </summary>\n        /// <param name=\"consolidated\">The newly consolidated data</param>\n        protected virtual void OnDataConsolidated(IBaseData consolidated)\n        {\n            var handler = DataConsolidated;\n            if (handler != null) handler(this, consolidated);\n\n            // assign the Consolidated property after the event handlers are fired,\n            // this allows the event handlers to look at the new consolidated data\n            // and the previous consolidated data at the same time without extra bookkeeping\n            Consolidated = consolidated;\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public virtual void Reset()\n        {\n            Consolidated = null;\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            DataConsolidated = null;\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/DollarVolumeRenkoConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data;\n\nnamespace Common.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator transforms a stream of <see cref=\"BaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// with a constant dollar volume for each bar.\n    /// </summary>\n    public class DollarVolumeRenkoConsolidator : VolumeRenkoConsolidator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DollarVolumeRenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant dollar volume size of each bar</param>\n        public DollarVolumeRenkoConsolidator(decimal barSize)\n            : base(barSize)\n        {\n        }\n\n        /// <summary>\n        /// Converts raw volume into dollar volume by multiplying it with the trade price.\n        /// </summary>\n        /// <param name=\"volume\">The raw trade volume</param>\n        /// <param name=\"price\">The trade price</param>\n        /// <returns>The dollar volume</returns>\n        protected override decimal AdjustVolume(decimal volume, decimal price)\n        {\n            return volume * price;\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/DynamicDataConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// A data csolidator that can make trade bars from DynamicData derived types. This is useful for\n    /// aggregating Quandl and other highly flexible dynamic custom data types.\n    /// </summary>\n    public class DynamicDataConsolidator : TradeBarConsolidatorBase<DynamicData>\n    {\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the period.\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public DynamicDataConsolidator(TimeSpan period)\n            : base(period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data.\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        public DynamicDataConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first.\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public DynamicDataConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first.\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public DynamicDataConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new trade bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref TradeBar workingBar, DynamicData data)\n        {\n            // grab the properties, if they don't exist just use the .Value property\n            var open = GetNamedPropertyOrValueProperty(data, \"Open\");\n            var high = GetNamedPropertyOrValueProperty(data, \"High\");\n            var low = GetNamedPropertyOrValueProperty(data, \"Low\");\n            var close = GetNamedPropertyOrValueProperty(data, \"Close\");\n\n            // if we have volume, use it, otherwise just use zero\n            var volume = data.HasProperty(\"Volume\")\n                ? data.GetProperty(\"Volume\").ConvertInvariant<long>()\n                : 0L;\n\n            if (workingBar == null)\n            {\n                workingBar = new TradeBar\n                {\n                    Symbol = data.Symbol,\n                    Time = GetRoundedBarTime(data),\n                    Open = open,\n                    High = high,\n                    Low = low,\n                    Close = close,\n                    Volume = volume\n                };\n            }\n            else\n            {\n                //Aggregate the working bar\n                workingBar.Close = close;\n                workingBar.Volume += volume;\n                if (low < workingBar.Low) workingBar.Low = low;\n                if (high > workingBar.High) workingBar.High = high;\n            }\n        }\n\n        private static decimal GetNamedPropertyOrValueProperty(DynamicData data, string propertyName)\n        {\n            if (!data.HasProperty(propertyName))\n            {\n                return data.Value;\n            }\n            return data.GetProperty(propertyName).ConvertInvariant<decimal>();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/FilteredIdentityDataConsolidator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataConsolidator\"/> that preserve the input\n    /// data unmodified. The input data is filtering by the specified predicate function\n    /// </summary>\n    /// <typeparam name=\"T\">The type of data</typeparam>\n    public class FilteredIdentityDataConsolidator<T> : IdentityDataConsolidator<T>\n        where T : IBaseData\n    {\n        private readonly Func<T, bool> _predicate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FilteredIdentityDataConsolidator{T}\"/> class\n        /// </summary>\n        /// <param name=\"predicate\">The predicate function, returning true to accept data and false to reject data</param>\n        public FilteredIdentityDataConsolidator(Func<T, bool> predicate)\n        {\n            this._predicate = predicate;\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public override void Update(T data)\n        {\n            // only permit data that passes our predicate function to be passed through\n            if (_predicate(data))\n            {\n                base.Update(data);\n            }\n        }\n    }\n\n    /// <summary>\n    /// Provides factory methods for creating instances of <see cref=\"FilteredIdentityDataConsolidator{T}\"/>\n    /// </summary>\n    public static class FilteredIdentityDataConsolidator\n    {\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FilteredIdentityDataConsolidator{T}\"/> that filters ticks\n        /// based on the specified <see cref=\"TickType\"/>\n        /// </summary>\n        /// <param name=\"tickType\">The tick type of data to accept</param>\n        /// <returns>A new <see cref=\"FilteredIdentityDataConsolidator{T}\"/> that filters based on the provided tick type</returns>\n        public static FilteredIdentityDataConsolidator<Tick> ForTickType(TickType tickType)\n        {\n            return new FilteredIdentityDataConsolidator<Tick>(tick => tick.TickType == tickType);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/IDataConsolidator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Event handler type for the IDataConsolidator.DataConsolidated event\n    /// </summary>\n    /// <param name=\"sender\">The consolidator that fired the event</param>\n    /// <param name=\"consolidated\">The consolidated piece of data</param>\n    public delegate void DataConsolidatedHandler(object sender, IBaseData consolidated);\n\n    /// <summary>\n    /// Represents a type capable of taking BaseData updates and firing events containing new\n    /// 'consolidated' data. These types can be used to produce larger bars, or even be used to\n    /// transform the data before being sent to another component. The most common usage of these\n    /// types is with indicators.\n    /// </summary>\n    public interface IDataConsolidator : IDisposable\n    {\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        IBaseData Consolidated { get; }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        IBaseData WorkingData { get; }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        Type InputType { get; }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        Type OutputType { get; }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        void Update(IBaseData data);\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        void Scan(DateTime currentLocalTime);\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        void Reset();\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        event DataConsolidatedHandler DataConsolidated;\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/IdentityDataConsolidator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Represents the simplest DataConsolidator implementation, one that is defined\n    /// by a straight pass through of the data. No projection or aggregation is performed.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of data</typeparam>\n    public class IdentityDataConsolidator<T> : DataConsolidator<T>\n        where T : IBaseData\n    {\n        private static readonly bool IsTick = typeof(T) == typeof(Tick);\n\n        private T _last;\n\n        /// <summary>\n        /// Stores the timestamp of the last processed data item.\n        /// </summary>\n        private DateTime _lastTime;\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public override IBaseData WorkingData\n        {\n            get { return _last == null ? null : _last.Clone(); }\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public override Type OutputType\n        {\n            get { return typeof(T); }\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public override void Update(T data)\n        {\n            if (IsTick || _last == null || data.EndTime != _lastTime)\n            {\n                OnDataConsolidated(data);\n                _last = data;\n                _lastTime = data.EndTime;\n            }\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public override void Scan(DateTime currentLocalTime)\n        {\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _last = default(T);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Consolidators/MarketHourAwareConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2024 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Data.Common\n{\n    /// <summary>\n    /// Consolidator for open markets bar only, extended hours bar are not consolidated.\n    /// </summary>\n    public class MarketHourAwareConsolidator : IDataConsolidator\n    {\n        private readonly bool _dailyStrictEndTimeEnabled;\n        private readonly bool _extendedMarketHours;\n        private bool _useStrictEndTime;\n\n        /// <summary>\n        /// The consolidation period requested\n        /// </summary>\n        protected TimeSpan Period { get; }\n\n        /// <summary>\n        /// The consolidator instance\n        /// </summary>\n        protected IDataConsolidator Consolidator { get; }\n\n        /// <summary>\n        /// The associated security exchange hours instance\n        /// </summary>\n        protected SecurityExchangeHours ExchangeHours { get; set; }\n\n        /// <summary>\n        /// The associated data time zone\n        /// </summary>\n        protected DateTimeZone DataTimeZone { get; set; }\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated => Consolidator.Consolidated;\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType => Consolidator.InputType;\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public IBaseData WorkingData => Consolidator.WorkingData;\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public Type OutputType => Consolidator.OutputType;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarketHourAwareConsolidator\"/> class.\n        /// </summary>\n        /// <param name=\"resolution\">The resolution.</param>\n        /// <param name=\"dataType\">The target data type</param>\n        /// <param name=\"tickType\">The target tick type</param>\n        /// <param name=\"extendedMarketHours\">True if extended market hours should be consolidated</param>\n        public MarketHourAwareConsolidator(bool dailyStrictEndTimeEnabled, Resolution resolution, Type dataType, TickType tickType, bool extendedMarketHours)\n        {\n            _dailyStrictEndTimeEnabled = dailyStrictEndTimeEnabled;\n            Period = resolution.ToTimeSpan();\n            _extendedMarketHours = extendedMarketHours;\n\n            if (dataType == typeof(Tick))\n            {\n                if (tickType == TickType.Trade)\n                {\n                    Consolidator = resolution == Resolution.Daily\n                        ? new TickConsolidator(DailyStrictEndTime)\n                        : new TickConsolidator(Period);\n                }\n                else\n                {\n                    Consolidator = resolution == Resolution.Daily\n                        ? new TickQuoteBarConsolidator(DailyStrictEndTime)\n                        : new TickQuoteBarConsolidator(Period);\n                }\n            }\n            else if (dataType == typeof(TradeBar))\n            {\n                Consolidator = resolution == Resolution.Daily\n                    ? new TradeBarConsolidator(DailyStrictEndTime)\n                    : new TradeBarConsolidator(Period);\n            }\n            else if (dataType == typeof(QuoteBar))\n            {\n                Consolidator = resolution == Resolution.Daily\n                    ? new QuoteBarConsolidator(DailyStrictEndTime)\n                    : new QuoteBarConsolidator(Period);\n            }\n            else\n            {\n                throw new ArgumentNullException(nameof(dataType), $\"{dataType.Name} not supported\");\n            }\n            Consolidator.DataConsolidated += ForwardConsolidatedBar;\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event DataConsolidatedHandler DataConsolidated;\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public virtual void Update(IBaseData data)\n        {\n            Initialize(data);\n\n            // US equity hour data from the database starts at 9am but the exchange opens at 9:30am. Thus, we need to handle\n            // this case specifically to avoid skipping the first hourly bar. To avoid this, we assert the period is daily,\n            // the data resolution is hour and the exchange opens at any point in time over the data.Time to data.EndTime interval\n            if (_extendedMarketHours ||\n                ExchangeHours.IsOpen(data.Time, false) ||\n                (Period == Time.OneDay && (data.EndTime - data.Time >= Time.OneHour) && ExchangeHours.IsOpen(data.Time, data.EndTime, false)))\n            {\n                Consolidator.Update(data);\n            }\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"P:QuantConnect.Data.BaseData.Time\" />)</param>\n        public void Scan(DateTime currentLocalTime)\n        {\n            Consolidator.Scan(currentLocalTime);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            Consolidator.DataConsolidated -= ForwardConsolidatedBar;\n            Consolidator.Dispose();\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public void Reset()\n        {\n            _useStrictEndTime = false;\n            ExchangeHours = null;\n            DataTimeZone = null;\n            Consolidator.Reset();\n        }\n\n        /// <summary>\n        /// Perform late initialization based on the datas symbol\n        /// </summary>\n        protected void Initialize(IBaseData data)\n        {\n            if (ExchangeHours == null)\n            {\n                var symbol = data.Symbol;\n                var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n                ExchangeHours = marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n                DataTimeZone = marketHoursDatabase.GetDataTimeZone(symbol.ID.Market, symbol, symbol.SecurityType);\n\n                _useStrictEndTime = UseStrictEndTime(data.Symbol);\n            }\n        }\n\n        /// <summary>\n        /// Determines a bar start time and period\n        /// </summary>\n        protected virtual CalendarInfo DailyStrictEndTime(DateTime dateTime)\n        {\n            if (!_useStrictEndTime)\n            {\n                return new(Period > Time.OneDay ? dateTime : dateTime.RoundDown(Period), Period);\n            }\n            return LeanData.GetDailyCalendar(dateTime, ExchangeHours, _extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Useful for testing\n        /// </summary>\n        protected virtual bool UseStrictEndTime(Symbol symbol)\n        {\n            return LeanData.UseStrictEndTime(_dailyStrictEndTimeEnabled, symbol, Period, ExchangeHours);\n        }\n\n        /// <summary>\n        /// Will forward the underlying consolidated bar to consumers on this object\n        /// </summary>\n        protected virtual void ForwardConsolidatedBar(object sender, IBaseData consolidated)\n        {\n            DataConsolidated?.Invoke(this, consolidated);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/OpenInterestConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Type capable of consolidating open interest\n    /// </summary>\n    public class OpenInterestConsolidator : PeriodCountConsolidatorBase<Tick, OpenInterest>\n    {\n        private bool _hourOrDailyConsolidation;\n        // Keep track of the last input to detect hour or date change\n        private Tick _lastInput;\n\n        /// <summary>\n        /// Create a new OpenInterestConsolidator for the desired resolution\n        /// </summary>\n        /// <param name=\"resolution\">The resolution desired</param>\n        /// <returns>A consolidator that produces data on the resolution interval</returns>\n        public static OpenInterestConsolidator FromResolution(Resolution resolution)\n        {\n            return new OpenInterestConsolidator(resolution.ToTimeSpan());\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'OpenInterest' representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        public OpenInterestConsolidator(TimeSpan period, TimeSpan? startTime = null)\n            : base(period, startTime)\n        {\n            _hourOrDailyConsolidation = period >= Time.OneHour;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'OpenInterest' representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public OpenInterestConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'OpenInterest' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public OpenInterestConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'OpenInterest'\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public OpenInterestConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'OpenInterest'\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        public OpenInterestConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n\n        /// <summary>\n        /// Determines whether or not the specified data should be processed\n        /// </summary>\n        /// <param name=\"data\">The data to check</param>\n        /// <returns>True if the consolidator should process this data, false otherwise</returns>\n        protected override bool ShouldProcess(Tick data)\n        {\n            return data.TickType == TickType.OpenInterest;\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new OI bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref OpenInterest workingBar, Tick data)\n        {\n            if (workingBar == null)\n            {\n                workingBar = new OpenInterest\n                {\n                    Symbol = data.Symbol,\n                    Time = _hourOrDailyConsolidation ? data.EndTime : GetRoundedBarTime(data),\n                    Value = data.Value\n                };\n\n            }\n            else\n            {\n                //Update the working bar\n                workingBar.Value = data.Value;\n\n                // If we are consolidating hourly or daily, we need to update the time of the working bar\n                // for the end time to match the last data point time\n                if (_hourOrDailyConsolidation)\n                {\n                    workingBar.Time = data.EndTime;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data. This method is\n        /// responsible for raising the DataConsolidated event.\n        /// It will check for date or hour change and force consolidation if needed.\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public override void Update(Tick data)\n        {\n            if (_lastInput != null &&\n                _hourOrDailyConsolidation &&\n                // Detect hour or date change\n                ((Period == Time.OneHour && data.EndTime.Hour != _lastInput.EndTime.Hour) ||\n                 (Period == Time.OneDay && data.EndTime.Date != _lastInput.EndTime.Date)))\n            {\n                // Date or hour change, force consolidation, no need to wait for the whole period to pass.\n                // Force consolidation by scanning at a time after the end of the period\n                Scan(_lastInput.EndTime.Add(Period.Value + Time.OneSecond));\n            }\n\n            base.Update(data);\n            _lastInput = data;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/PeriodCountConsolidatorBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Provides a base class for consolidators that emit data based on the passing of a period of time\n    /// or after seeing a max count of data points.\n    /// </summary>\n    /// <typeparam name=\"T\">The input type of the consolidator</typeparam>\n    /// <typeparam name=\"TConsolidated\">The output type of the consolidator</typeparam>\n    public abstract class PeriodCountConsolidatorBase<T, TConsolidated> : DataConsolidator<T>\n        where T : IBaseData\n        where TConsolidated : BaseData\n    {\n        // The SecurityIdentifier that we are consolidating for.\n        private SecurityIdentifier _securityIdentifier;\n        private bool _securityIdentifierIsSet;\n        //The number of data updates between creating new bars.\n        private int? _maxCount;\n        //\n        private IPeriodSpecification _periodSpecification;\n        //The minimum timespan between creating new bars.\n        private TimeSpan? _period;\n        //The number of pieces of data we've accumulated since our last emit\n        private int _currentCount;\n        //The working bar used for aggregating the data\n        protected TConsolidated _workingBar;\n        //The last time we emitted a consolidated bar\n        private DateTime? _lastEmit;\n        private bool _validateTimeSpan;\n\n        private PeriodCountConsolidatorBase(IPeriodSpecification periodSpecification)\n        {\n            _periodSpecification = periodSpecification;\n            _period = _periodSpecification.Period;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new <typeparamref name=\"TConsolidated\"/> instance representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        protected PeriodCountConsolidatorBase(TimeSpan period, TimeSpan? startTime = null)\n            : this(new TimeSpanPeriodSpecification(period, startTime))\n        {\n            _period = _periodSpecification.Period;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new <typeparamref name=\"TConsolidated\"/> instance representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        protected PeriodCountConsolidatorBase(int maxCount)\n            : this(new BarCountPeriodSpecification())\n        {\n            _maxCount = maxCount;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new <typeparamref name=\"TConsolidated\"/> instance representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        protected PeriodCountConsolidatorBase(int maxCount, TimeSpan period)\n            : this(new MixedModePeriodSpecification(period))\n        {\n            _maxCount = maxCount;\n            _period = _periodSpecification.Period;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new <typeparamref name=\"TConsolidated\"/> instance representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        protected PeriodCountConsolidatorBase(Func<DateTime, CalendarInfo> func)\n            : this(new FuncPeriodSpecification(func))\n        {\n            _period = Time.OneSecond;\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new <typeparamref name=\"TConsolidated\"/> instance representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"pyObject\">Python object that defines either a function object that defines the start time of a consolidated data or a timespan</param>\n        protected PeriodCountConsolidatorBase(PyObject pyObject)\n            : this(GetPeriodSpecificationFromPyObject(pyObject))\n        {\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public override Type OutputType => typeof(TConsolidated);\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public override IBaseData WorkingData => _workingBar?.Clone();\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced. We define this as a 'new'\n        /// event so we can expose it as a <typeparamref name=\"TConsolidated\"/> instead of a <see cref=\"BaseData\"/> instance\n        /// </summary>\n        public new event EventHandler<TConsolidated> DataConsolidated;\n\n        /// <summary>\n        /// Updates this consolidator with the specified data. This method is\n        /// responsible for raising the DataConsolidated event\n        /// In time span mode, the bar range is closed on the left and open on the right: [T, T+TimeSpan).\n        /// For example, if time span is 1 minute, we have [10:00, 10:01): so data at 10:01 is not\n        /// included in the bar starting at 10:00.\n        /// </summary>\n        /// <exception cref=\"InvalidOperationException\">Thrown when multiple symbols are being consolidated.</exception>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public override void Update(T data)\n        {\n            if (!_securityIdentifierIsSet)\n            {\n                _securityIdentifierIsSet = true;\n                _securityIdentifier = data.Symbol.ID;\n            }\n            else if (!data.Symbol.ID.Equals(_securityIdentifier))\n            {\n                throw new InvalidOperationException($\"Consolidators can only be used with a single symbol. The previous consolidated SecurityIdentifier ({_securityIdentifier}) is not the same as in the current data ({data.Symbol.ID}).\");\n            }\n\n            if (!ShouldProcess(data))\n            {\n                // first allow the base class a chance to filter out data it doesn't want\n                // before we start incrementing counts and what not\n                return;\n            }\n\n            if (!_validateTimeSpan && _period.HasValue && _periodSpecification is TimeSpanPeriodSpecification)\n            {\n                // only do this check once\n                _validateTimeSpan = true;\n                var dataLength = data.EndTime - data.Time;\n                if (dataLength > _period)\n                {\n                    throw new ArgumentException($\"For Symbol {data.Symbol} can not consolidate bars of period: {_period}, using data of the same or higher period: {data.EndTime - data.Time}\");\n                }\n            }\n\n            //Decide to fire the event\n            var fireDataConsolidated = false;\n\n            // decide to aggregate data before or after firing OnDataConsolidated event\n            // always aggregate before firing in counting mode\n            bool aggregateBeforeFire = _maxCount.HasValue;\n\n            if (_maxCount.HasValue)\n            {\n                // we're in count mode\n                _currentCount++;\n                if (_currentCount >= _maxCount.Value)\n                {\n                    _currentCount = 0;\n                    fireDataConsolidated = true;\n                }\n            }\n\n            if (!_lastEmit.HasValue)\n            {\n                // initialize this value for period computations\n                _lastEmit = IsTimeBased ? DateTime.MinValue : data.Time;\n            }\n\n            if (_period.HasValue)\n            {\n                // we're in time span mode and initialized\n                if (_workingBar != null && data.Time - _workingBar.Time >= _period.Value && GetRoundedBarTime(data) > _lastEmit)\n                {\n                    fireDataConsolidated = true;\n                }\n\n                // special case: always aggregate before event trigger when TimeSpan is zero\n                if (_period.Value == TimeSpan.Zero)\n                {\n                    fireDataConsolidated = true;\n                    aggregateBeforeFire = true;\n                }\n            }\n\n            if (aggregateBeforeFire)\n            {\n                if (data.Time >= _lastEmit)\n                {\n                    AggregateBar(ref _workingBar, data);\n\n                    if (_maxCount.HasValue)\n                    {\n                        // When using count-based consolidation, set EndTime to the last input's EndTime\n                        _workingBar.EndTime = data.EndTime;\n                    }\n                }\n            }\n\n            //Fire the event\n            if (fireDataConsolidated)\n            {\n                var workingTradeBar = _workingBar as TradeBar;\n                if (workingTradeBar != null)\n                {\n                    // we kind of are cheating here...\n                    if (_period.HasValue)\n                    {\n                        workingTradeBar.Period = _period.Value;\n                    }\n                }\n\n                // Set _lastEmit first because OnDataConsolidated will set _workingBar to null\n                _lastEmit = IsTimeBased && _workingBar != null ? _workingBar.EndTime : data.Time;\n                OnDataConsolidated(_workingBar);\n            }\n\n            if (!aggregateBeforeFire)\n            {\n                if (data.Time >= _lastEmit)\n                {\n                    AggregateBar(ref _workingBar, data);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public override void Scan(DateTime currentLocalTime)\n        {\n            if (_workingBar != null && _period.HasValue && _period.Value != TimeSpan.Zero\n                && currentLocalTime - _workingBar.Time >= _period.Value && GetRoundedBarTime(currentLocalTime) > _lastEmit)\n            {\n                _lastEmit = _workingBar.EndTime;\n                OnDataConsolidated(_workingBar);\n            }\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _securityIdentifier = null;\n            _securityIdentifierIsSet = false;\n            _currentCount = 0;\n            _workingBar = null;\n            _lastEmit = null;\n            _validateTimeSpan = false;\n        }\n\n        /// <summary>\n        /// Returns true if this consolidator is time-based, false otherwise\n        /// </summary>\n        protected bool IsTimeBased => !_maxCount.HasValue;\n\n        /// <summary>\n        /// Gets the time period for this consolidator\n        /// </summary>\n        protected TimeSpan? Period => _period;\n\n        /// <summary>\n        /// Determines whether or not the specified data should be processed\n        /// </summary>\n        /// <param name=\"data\">The data to check</param>\n        /// <returns>True if the consolidator should process this data, false otherwise</returns>\n        protected virtual bool ShouldProcess(T data) => true;\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new consolidated bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected abstract void AggregateBar(ref TConsolidated workingBar, T data);\n\n        /// <summary>\n        /// Gets a rounded-down bar time. Called by AggregateBar in derived classes.\n        /// </summary>\n        /// <param name=\"time\">The bar time to be rounded down</param>\n        /// <returns>The rounded bar time</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected DateTime GetRoundedBarTime(DateTime time)\n        {\n            var startTime = _periodSpecification.GetRoundedBarTime(time);\n\n            // In the case of a new bar, define the period defined at opening time\n            if (_workingBar == null)\n            {\n                _period = _periodSpecification.Period;\n            }\n\n            return startTime;\n        }\n\n        /// <summary>\n        /// Gets a rounded-down bar start time. Called by AggregateBar in derived classes.\n        /// </summary>\n        /// <param name=\"inputData\">The input data point</param>\n        /// <returns>The rounded bar start time</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected DateTime GetRoundedBarTime(IBaseData inputData)\n        {\n            var potentialStartTime = GetRoundedBarTime(inputData.Time);\n            if (_period.HasValue && potentialStartTime + _period < inputData.EndTime)\n            {\n                // US equity hour bars from the database starts at 9am but the exchange opens at 9:30am. Thus, the method\n                // GetRoundedBarTime(inputData.Time) returns the market open of the previous day, which is not consistent\n                // with the given end time. For that reason we need to handle this case specifically, by calling\n                // GetRoundedBarTime(inputData.EndTime) as it will return our expected start time: 9:30am\n                if (inputData.EndTime - inputData.Time == Time.OneHour && potentialStartTime.Date < inputData.Time.Date)\n                {\n                    potentialStartTime = GetRoundedBarTime(inputData.EndTime);\n                }\n                else\n                {\n                    // whops! the end time we were giving is beyond our potential end time, so let's use the giving bars star time instead\n                    potentialStartTime = inputData.Time;\n                }\n            }\n\n            return potentialStartTime;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"DataConsolidated\"/> event\n        /// </summary>\n        /// <param name=\"e\">The consolidated data</param>\n        protected virtual void OnDataConsolidated(TConsolidated e)\n        {\n            base.OnDataConsolidated(e);\n            DataConsolidated?.Invoke(this, e);\n\n            ResetWorkingBar();\n        }\n\n        /// <summary>\n        /// Resets the working bar\n        /// </summary>\n        protected virtual void ResetWorkingBar()\n        {\n            _workingBar = null;\n        }\n\n        /// <summary>\n        /// Gets the period specification from the PyObject that can either represent a function object that defines the start time of a consolidated data or a timespan.\n        /// </summary>\n        /// <param name=\"pyObject\">Python object that defines either a function object that defines the start time of a consolidated data or a timespan</param>\n        /// <returns>IPeriodSpecification that represents the PyObject</returns>\n        private static IPeriodSpecification GetPeriodSpecificationFromPyObject(PyObject pyObject)\n        {\n            Func<DateTime, CalendarInfo> expiryFunc;\n            if (pyObject.TrySafeAs(out expiryFunc))\n            {\n                return new FuncPeriodSpecification(expiryFunc);\n            }\n\n            using (Py.GIL())\n            {\n                return new TimeSpanPeriodSpecification(pyObject.As<TimeSpan>());\n            }\n        }\n\n        /// <summary>\n        /// Distinguishes between the different ways a consolidated data start time can be specified\n        /// </summary>\n        private interface IPeriodSpecification\n        {\n            TimeSpan? Period { get; }\n            DateTime GetRoundedBarTime(DateTime time);\n        }\n\n        /// <summary>\n        /// User defined the bars period using a counter\n        /// </summary>\n        private class BarCountPeriodSpecification : IPeriodSpecification\n        {\n            public TimeSpan? Period { get; } = null;\n\n            public DateTime GetRoundedBarTime(DateTime time) => time;\n        }\n\n        /// <summary>\n        /// User defined the bars period using a counter and a period (mixed mode)\n        /// </summary>\n        private class MixedModePeriodSpecification : IPeriodSpecification\n        {\n            public TimeSpan? Period { get; }\n\n            public MixedModePeriodSpecification(TimeSpan period)\n            {\n                Period = period;\n            }\n\n            public DateTime GetRoundedBarTime(DateTime time) => time;\n        }\n\n        /// <summary>\n        /// User defined the bars period using a time span\n        /// </summary>\n        private class TimeSpanPeriodSpecification : IPeriodSpecification\n        {\n            public TimeSpan? StartTime { get; }\n            public TimeSpan? Period { get; }\n\n            public TimeSpanPeriodSpecification(TimeSpan period, TimeSpan? startTime = null)\n            {\n                Period = period;\n                StartTime = startTime;\n            }\n\n            public DateTime GetRoundedBarTime(DateTime time)\n            {\n                if (StartTime.HasValue)\n                {\n                    return LeanData.GetConsolidatorStartTime(Period.Value, StartTime.Value, time);\n                }\n                return Period.Value > Time.OneDay\n                    ? time // #4915 For periods larger than a day, don't use a rounding schedule.\n                    : time.RoundDown(Period.Value);\n            }\n        }\n\n        /// <summary>\n        /// Special case for bars where the open time is defined by a function.\n        /// We assert on construction that the function returns a date time in the past or equal to the given time instant.\n        /// </summary>\n        private class FuncPeriodSpecification : IPeriodSpecification\n        {\n            private static readonly DateTime _verificationDate = new DateTime(2022, 01, 03, 10, 10, 10);\n            public TimeSpan? Period { get; private set; }\n\n            public readonly Func<DateTime, CalendarInfo> _calendarInfoFunc;\n\n            public FuncPeriodSpecification(Func<DateTime, CalendarInfo> expiryFunc)\n            {\n                if (expiryFunc(_verificationDate).Start > _verificationDate)\n                {\n                    throw new ArgumentException($\"{nameof(FuncPeriodSpecification)}: Please use a function that computes the start of the bar associated with the given date time. Should never return a time later than the one passed in.\");\n                }\n                _calendarInfoFunc = expiryFunc;\n            }\n\n            public DateTime GetRoundedBarTime(DateTime time)\n            {\n                var calendarInfo = _calendarInfoFunc(time);\n                Period = calendarInfo.Period;\n                return calendarInfo.Start;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/QuoteBarConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Consolidates QuoteBars into larger QuoteBars\n    /// </summary>\n    public class QuoteBarConsolidator : PeriodCountConsolidatorBase<QuoteBar, QuoteBar>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        public QuoteBarConsolidator(TimeSpan period, TimeSpan? startTime = null)\n            : base(period, startTime)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public QuoteBarConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public QuoteBarConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'QuoteBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public QuoteBarConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'QuoteBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        public QuoteBarConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new consolidated bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref QuoteBar workingBar, QuoteBar data)\n        {\n            var bid = data.Bid;\n            var ask = data.Ask;\n\n            if (workingBar == null)\n            {\n                workingBar = new QuoteBar(GetRoundedBarTime(data), data.Symbol, null, 0, null, 0, IsTimeBased && Period.HasValue ? Period : data.Period);\n\n                // open ask and bid should match previous close ask and bid\n                if (Consolidated != null)\n                {\n                    // note that we will only fill forward previous close ask and bid when a new data point comes in and we generate a new working bar which is not a fill forward bar\n                    var previous = Consolidated as QuoteBar;\n                    workingBar.Update(0, previous.Bid?.Close ?? 0, previous.Ask?.Close ?? 0, 0, previous.LastBidSize, previous.LastAskSize);\n                }\n            }\n\n            // update the bid and ask\n            if (bid != null)\n            {\n                workingBar.LastBidSize = data.LastBidSize;\n                if (workingBar.Bid == null)\n                {\n                    workingBar.Bid = new Bar(bid.Open, bid.High, bid.Low, bid.Close);\n                }\n                else\n                {\n                    workingBar.Bid.Close = bid.Close;\n                    if (workingBar.Bid.High < bid.High) workingBar.Bid.High = bid.High;\n                    if (workingBar.Bid.Low > bid.Low) workingBar.Bid.Low = bid.Low;\n                }\n            }\n            if (ask != null)\n            {\n                workingBar.LastAskSize = data.LastAskSize;\n                if (workingBar.Ask == null)\n                {\n                    workingBar.Ask = new Bar(ask.Open, ask.High, ask.Low, ask.Close);\n                }\n                else\n                {\n                    workingBar.Ask.Close = ask.Close;\n                    if (workingBar.Ask.High < ask.High) workingBar.Ask.High = ask.High;\n                    if (workingBar.Ask.Low > ask.Low) workingBar.Ask.Low = ask.Low;\n                }\n            }\n\n            workingBar.Value = data.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/RangeConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"IBaseData\"/> instances into a stream of <see cref=\"RangeBar\"/>\n    /// </summary>\n    public class RangeConsolidator : BaseTimelessConsolidator<RangeBar>\n    {\n        private bool _firstTick;\n        private decimal _minimumPriceVariation;\n\n        /// <summary>\n        /// Symbol properties database to use to get the minimum price variation of certain symbol\n        /// </summary>\n        private static SymbolPropertiesDatabase _symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Bar being created\n        /// </summary>\n        protected override RangeBar CurrentBar { get; set; }\n\n        /// <summary>\n        /// Range for each RangeBar, this is, the difference between the High and Low for each\n        /// RangeBar\n        /// </summary>\n        public decimal RangeSize { get; private set; }\n\n        /// <summary>\n        /// Number of MinimumPriceVariation units\n        /// </summary>\n        public int Range { get; private set; }\n\n        /// <summary>\n        /// Gets <see cref=\"RangeBar\"/> which is the type emitted in the <see cref=\"IDataConsolidator.DataConsolidated\"/> event.\n        /// </summary>\n        public override Type OutputType => typeof(RangeBar);\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public override IBaseData WorkingData => CurrentBar?.Clone();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RangeConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"range\">The Range interval sets the range in which the price moves, which in turn initiates the formation of a new bar.\n        /// One range equals to one minimum price change, where this last value is defined depending of the RangeBar's symbol</param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RangeBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar, except if the input is a TradeBar.</param>\n        public RangeConsolidator(\n            int range,\n            Func<IBaseData, decimal> selector = null,\n            Func<IBaseData, decimal> volumeSelector = null)\n            : base(selector, volumeSelector)\n        {\n            Range = range;\n            _firstTick = true;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RangeConsolidator\" /> class.\n        /// </summary>\n        /// <param name=\"range\">The Range interval sets the range in which the price moves, which in turn initiates the formation of a new bar.\n        /// One range equals to one minimum price change, where this last value is defined depending of the RangeBar's symbol</param>\n        /// <param name=\"selector\">Extracts the value from a data instance to be formed into a <see cref=\"RangeBar\"/>. The default\n        /// value is (x => x.Value) the <see cref=\"IBaseData.Value\"/> property on <see cref=\"IBaseData\"/></param>\n        /// <param name=\"volumeSelector\">Extracts the volume from a data instance. The default value is null which does\n        /// not aggregate volume per bar.</param>\n        public RangeConsolidator(int range,\n            PyObject selector,\n            PyObject volumeSelector = null)\n            : base(selector, volumeSelector)\n        {\n            Range = range;\n            _firstTick = true;\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _firstTick = true;\n            _minimumPriceVariation = 0m;\n            RangeSize = 0m;\n        }\n\n        /// <summary>\n        /// Updates the current RangeBar being created with the given data.\n        /// Additionally, if it's the case, it consolidates the current RangeBar\n        /// </summary>\n        /// <param name=\"time\">Time of the given data</param>\n        /// <param name=\"currentValue\">Value of the given data</param>\n        /// <param name=\"volume\">Volume of the given data</param>\n        protected override void UpdateBar(DateTime time, decimal currentValue, decimal volume)\n        {\n            bool isRising = default;\n            if (currentValue > CurrentBar.High)\n            {\n                isRising = true;\n            }\n            else if (currentValue < CurrentBar.Low)\n            {\n                isRising = false;\n            }\n\n            CurrentBar.Update(time, currentValue, volume);\n            while (CurrentBar.IsClosed)\n            {\n                OnDataConsolidated(CurrentBar);\n                CurrentBar = new RangeBar(CurrentBar.Symbol, CurrentBar.EndTime, RangeSize, isRising ? CurrentBar.High + _minimumPriceVariation : CurrentBar.Low - _minimumPriceVariation);\n                CurrentBar.Update(time, currentValue, Math.Abs(CurrentBar.Low - currentValue) > RangeSize ? 0 : volume); // Intermediate/phantom RangeBar's have zero volume\n            }\n        }\n\n        /// <summary>\n        /// Creates a new bar with the given data\n        /// </summary>\n        /// <param name=\"data\">The new data for the bar</param>\n        /// <param name=\"currentValue\">The new value for the bar</param>\n        /// <param name=\"volume\">The new volume for the bar</param>\n        protected override void CreateNewBar(IBaseData data, decimal currentValue, decimal volume)\n        {\n            var open = currentValue;\n\n            if (_firstTick)\n            {\n                _minimumPriceVariation = _symbolPropertiesDatabase.GetSymbolProperties(data.Symbol.ID.Market, data.Symbol, data.Symbol.ID.SecurityType, \"USD\").MinimumPriceVariation;\n                RangeSize = _minimumPriceVariation * Range;\n                open = Math.Ceiling(open / RangeSize) * RangeSize;\n                _firstTick = false;\n            }\n\n            CurrentBar = new RangeBar(data.Symbol, data.Time, RangeSize, open, volume: volume);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/RenkoConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"BaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// with Renko type <see cref=\"RenkoType.Wicked\"/>.\n    /// </summary>\n    /// <remarks>This implementation replaced the original implementation that was shown to have inaccuracies in its representation\n    /// of Renko charts. The original implementation has been moved to <see cref=\"ClassicRenkoConsolidator\"/>.</remarks>\n    public class RenkoConsolidator : IDataConsolidator\n    {\n        private bool _firstTick = true;\n        private RenkoBar _lastWicko;\n        private DataConsolidatedHandler _dataConsolidatedHandler;\n        private RenkoBar _currentBar;\n        private IBaseData _consolidated;\n        \n        /// <summary>\n        /// Time of consolidated close.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected DateTime CloseOn { get; set; }\n\n        /// <summary>\n        /// Value of consolidated close.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected decimal CloseRate { get; set; }\n\n        /// <summary>\n        /// Value of consolidated high.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected decimal HighRate { get; set; }\n\n        /// <summary>\n        /// Value of consolidated low.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected decimal LowRate { get; set; }\n\n        /// <summary>\n        /// Time of consolidated open.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected DateTime OpenOn { get; set; }\n\n        /// <summary>\n        /// Value of consolidate open.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected decimal OpenRate { get; set; }\n\n        /// <summary>\n        /// Size of the consolidated bar.\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected decimal BarSize { get; set; }\n\n        /// <summary>\n        /// Gets the kind of the bar\n        /// </summary>\n        public RenkoType Type => RenkoType.Wicked;\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public IBaseData WorkingData => _currentBar?.Clone();\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType => typeof(IBaseData);\n\n        /// <summary>\n        /// Gets <see cref=\"RenkoBar\"/> which is the type emitted in the <see cref=\"IDataConsolidator.DataConsolidated\"/> event.\n        /// </summary>\n        public Type OutputType => typeof(RenkoBar);\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated\n        {\n            get { return _consolidated; }\n            private set { _consolidated = value; }\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event EventHandler<RenkoBar> DataConsolidated;\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        event DataConsolidatedHandler IDataConsolidator.DataConsolidated\n        {\n            add { _dataConsolidatedHandler += value; }\n            remove { _dataConsolidatedHandler -= value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        public RenkoConsolidator(decimal barSize)\n        {\n            if (barSize <= 0)\n            {\n                throw new ArgumentException(\"Renko consolidator BarSize must be strictly greater than zero\");\n            }\n\n            BarSize = barSize;\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(IBaseData data)\n        {\n            var rate = data.Price;\n\n            if (_firstTick)\n            {\n                _firstTick = false;\n\n                // Round our first rate to the same length as BarSize\n                rate = GetClosestMultiple(rate, BarSize);\n\n                OpenOn = data.Time;\n                CloseOn = data.Time;\n                OpenRate = rate;\n                HighRate = rate;\n                LowRate = rate;\n                CloseRate = rate;\n            }\n            else\n            {\n                CloseOn = data.Time;\n\n                if (rate > HighRate)\n                {\n                    HighRate = rate;\n                }\n\n                if (rate < LowRate)\n                {\n                    LowRate = rate;\n                }\n\n                CloseRate = rate;\n\n                if (CloseRate > OpenRate)\n                {\n                    if (_lastWicko == null || _lastWicko.Direction == BarDirection.Rising)\n                    {\n                        Rising(data);\n                        return;\n                    }\n\n                    var limit = _lastWicko.Open + BarSize;\n\n                    if (CloseRate > limit)\n                    {\n                        var wicko = new RenkoBar(data.Symbol, OpenOn, CloseOn, BarSize, _lastWicko.Open, limit,\n                            LowRate, limit);\n\n                        _lastWicko = wicko;\n\n                        OnDataConsolidated(wicko);\n\n                        OpenOn = CloseOn;\n                        OpenRate = limit;\n                        LowRate = limit;\n\n                        Rising(data);\n                    }\n                }\n                else if (CloseRate < OpenRate)\n                {\n                    if (_lastWicko == null || _lastWicko.Direction == BarDirection.Falling)\n                    {\n                        Falling(data);\n                        return;\n                    }\n\n                    var limit = _lastWicko.Open - BarSize;\n\n                    if (CloseRate < limit)\n                    {\n                        var wicko = new RenkoBar(data.Symbol, OpenOn, CloseOn, BarSize, _lastWicko.Open, HighRate,\n                            limit, limit);\n\n                        _lastWicko = wicko;\n\n                        OnDataConsolidated(wicko);\n\n                        OpenOn = CloseOn;\n                        OpenRate = limit;\n                        HighRate = limit;\n\n                        Falling(data);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public void Scan(DateTime currentLocalTime)\n        {\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            DataConsolidated = null;\n            _dataConsolidatedHandler = null;\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public void Reset()\n        {\n            _firstTick = true;\n            _lastWicko = null;\n            _currentBar = null;\n            _consolidated = null;\n            CloseOn = default;\n            CloseRate = default;\n            HighRate = default;\n            LowRate = default;\n            OpenOn = default;\n            OpenRate = default;\n        }\n\n        /// <summary>\n        /// Event invocator for the DataConsolidated event. This should be invoked\n        /// by derived classes when they have consolidated a new piece of data.\n        /// </summary>\n        /// <param name=\"consolidated\">The newly consolidated data</param>\n        protected void OnDataConsolidated(RenkoBar consolidated)\n        {\n            DataConsolidated?.Invoke(this, consolidated);\n            _currentBar = consolidated;\n            _dataConsolidatedHandler?.Invoke(this, consolidated);\n            Consolidated = consolidated;\n        }\n\n        private void Rising(IBaseData data)\n        {\n            decimal limit;\n\n            while (CloseRate > (limit = OpenRate + BarSize))\n            {\n                var wicko = new RenkoBar(data.Symbol, OpenOn, CloseOn, BarSize, OpenRate, limit, LowRate, limit);\n\n                _lastWicko = wicko;\n\n                OnDataConsolidated(wicko);\n\n                OpenOn = CloseOn;\n                OpenRate = limit;\n                LowRate = limit;\n            }\n        }\n\n        private void Falling(IBaseData data)\n        {\n            decimal limit;\n\n            while (CloseRate < (limit = OpenRate - BarSize))\n            {\n                var wicko = new RenkoBar(data.Symbol, OpenOn, CloseOn, BarSize, OpenRate, HighRate, limit, limit);\n\n                _lastWicko = wicko;\n\n                OnDataConsolidated(wicko);\n\n                OpenOn = CloseOn;\n                OpenRate = limit;\n                HighRate = limit;\n            }\n        }\n\n        /// <summary>\n        /// Gets the closest BarSize-Multiple to the price.\n        /// </summary>\n        /// <remarks>Based on: The Art of Computer Programming, Vol I, pag 39. Donald E. Knuth</remarks>\n        /// <param name=\"price\">Price to be rounded to the closest BarSize-Multiple</param>\n        /// <param name=\"barSize\">The size of the Renko bar</param>\n        /// <returns>The closest BarSize-Multiple to the price</returns>\n        public static decimal GetClosestMultiple(decimal price, decimal barSize)\n        {\n            if (barSize <= 0)\n            {\n                throw new ArgumentException(\"BarSize must be strictly greater than zero\");\n            }\n\n            var modulus = price - barSize * Math.Floor(price / barSize);\n            var round = Math.Round(modulus / barSize);\n            return barSize * (Math.Floor(price / barSize) + round);\n        }\n    }\n\n    /// <summary>\n    /// Provides a type safe wrapper on the RenkoConsolidator class. This just allows us to define our selector functions with the real type they'll be receiving\n    /// </summary>\n    /// <typeparam name=\"TInput\"></typeparam>\n    public class RenkoConsolidator<TInput> : RenkoConsolidator\n        where TInput : IBaseData\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        public RenkoConsolidator(decimal barSize)\n            : base(barSize)\n        {\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data.\n        /// </summary>\n        /// <remarks>\n        /// Type safe shim method.\n        /// </remarks>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(TInput data)\n        {\n            base.Update(data);\n        }\n    }\n\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"BaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// with Renko type <see cref=\"RenkoType.Wicked\"/>.\n    /// /// </summary>\n    /// <remarks>For backwards compatibility now that WickedRenkoConsolidators -> RenkoConsolidator</remarks>\n    public class WickedRenkoConsolidator : RenkoConsolidator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        public WickedRenkoConsolidator(decimal barSize)\n            : base(barSize)\n        {\n        }\n    }\n\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"BaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// with Renko type <see cref=\"RenkoType.Wicked\"/>.\n    /// Provides a type safe wrapper on the WickedRenkoConsolidator class. This just allows us to define our selector functions with the real type they'll be receiving\n    /// /// </summary>\n    /// <remarks>For backwards compatibility now that WickedRenkoConsolidators -> RenkoConsolidator</remarks>\n    public class WickedRenkoConsolidator<T> : RenkoConsolidator<T>\n        where T : IBaseData\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant value size of each bar</param>\n        public WickedRenkoConsolidator(decimal barSize)\n            : base(barSize)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/SequentialConsolidator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator wires up the events on its First and Second consolidators\n    /// such that data flows from the First to Second consolidator. It's output comes\n    /// from the Second.\n    /// </summary>\n    public class SequentialConsolidator : IDataConsolidator\n    {\n        /// <summary>\n        /// Gets the first consolidator to receive data\n        /// </summary>\n        public IDataConsolidator First\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the second consolidator that ends up receiving data produced\n        /// by the first\n        /// </summary>\n        public IDataConsolidator Second\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        ///\n        /// For a SequentialConsolidator, this is the output from the 'Second' consolidator.\n        /// </summary>\n        public IBaseData Consolidated\n        {\n            get { return Second.Consolidated; }\n        }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public IBaseData WorkingData\n        {\n            get { return Second.WorkingData; }\n        }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType\n        {\n            get { return First.InputType; }\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public Type OutputType\n        {\n            get { return Second.OutputType; }\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(IBaseData data)\n        {\n            First.Update(data);\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public void Scan(DateTime currentLocalTime)\n        {\n            First.Scan(currentLocalTime);\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event DataConsolidatedHandler DataConsolidated;\n\n        /// <summary>\n        /// Creates a new consolidator that will pump date through the first, and then the output\n        /// of the first into the second. This enables 'wrapping' or 'composing' of consolidators\n        /// </summary>\n        /// <param name=\"first\">The first consolidator to receive data</param>\n        /// <param name=\"second\">The consolidator to receive first's output</param>\n        public SequentialConsolidator(IDataConsolidator first, IDataConsolidator second)\n        {\n            if (!second.InputType.IsAssignableFrom(first.OutputType))\n            {\n                throw new ArgumentException(\"first.OutputType must equal second.OutputType!\");\n            }\n            First = first;\n            Second = second;\n\n            // wire up the second one to get data from the first\n            first.DataConsolidated += (sender, consolidated) => second.Update(consolidated);\n\n            // wire up the second one's events to also fire this consolidator's event so consumers\n            // can attach\n            second.DataConsolidated += (sender, consolidated) => OnDataConsolidated(consolidated);\n        }\n\n        /// <summary>\n        /// Event invocator for the DataConsolidated event. This should be invoked\n        /// by derived classes when they have consolidated a new piece of data.\n        /// </summary>\n        /// <param name=\"consolidated\">The newly consolidated data</param>\n        protected virtual void OnDataConsolidated(IBaseData consolidated)\n        {\n            var handler = DataConsolidated;\n            if (handler != null) handler(this, consolidated);\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            First.Dispose();\n            Second.Dispose();\n            DataConsolidated = null;\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public void Reset()\n        {\n            First.Reset();\n            Second.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/SessionConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Util;\n\nnamespace Common.Data.Consolidators\n{\n    /// <summary>\n    /// Consolidates intraday market data into a single daily <see cref=\"SessionBar\"/> (OHLCV + OpenInterest).\n    /// </summary>\n    public class SessionConsolidator : PeriodCountConsolidatorBase<BaseData, SessionBar>\n    {\n        private readonly SecurityExchangeHours _exchangeHours;\n        private readonly TickType _sourceTickType;\n        private readonly Symbol _symbol;\n        private bool _initialized;\n        internal SessionBar WorkingInstance\n        {\n            get\n            {\n                if (_workingBar == null)\n                {\n                    InitializeWorkingBar();\n                }\n                return _workingBar;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SessionConsolidator\"/> class.\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange hours</param>\n        /// <param name=\"sourceTickType\">Type of the source tick</param>\n        /// <param name=\"symbol\">The symbol</param>\n        public SessionConsolidator(SecurityExchangeHours exchangeHours, TickType sourceTickType, Symbol symbol) : base(Time.OneDay)\n        {\n            _symbol = symbol;\n            _exchangeHours = exchangeHours;\n            _sourceTickType = sourceTickType;\n            InitializeWorkingBar();\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new trade bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref SessionBar workingBar, BaseData data)\n        {\n            // Handle open interest\n            if (data.DataType == MarketDataType.Tick && data is Tick oiTick && oiTick.TickType == TickType.OpenInterest)\n            {\n                // Update the working session bar with the latest open interest\n                workingBar.OpenInterest = oiTick.Value;\n                return;\n            }\n\n            if (!_exchangeHours.IsOpen(data.Time, data.EndTime, false))\n            {\n                return;\n            }\n\n            // Update the working session bar\n            workingBar.Update(data, Consolidated);\n        }\n\n        /// <summary>\n        /// Updates the session with new market data and initializes the consolidator if needed\n        /// </summary>\n        /// <param name=\"data\">The new data to update the session with</param>\n        public override void Update(BaseData data)\n        {\n            if (!_initialized)\n            {\n                _workingBar.Time = data.Time.Date;\n                _initialized = true;\n            }\n            base.Update(data);\n        }\n\n        /// <summary>\n        /// Validates the current local time and triggers Scan() if a new day is detected.\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current local time.</param>\n        public void ValidateAndScan(DateTime currentLocalTime)\n        {\n            if (!_initialized)\n            {\n                return;\n            }\n\n            if (currentLocalTime.Date != WorkingInstance.Time.Date)\n            {\n                Scan(currentLocalTime);\n            }\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        //public event DataConsolidatedHandler DataConsolidated;\n\n        protected override void OnDataConsolidated(SessionBar e)\n        {\n            _workingBar = null;\n            base.OnDataConsolidated(e);\n        }\n\n        /// <summary>\n        /// Resets the working bar\n        /// </summary>\n        protected override void ResetWorkingBar()\n        {\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            InitializeWorkingBar();\n        }\n\n        private void InitializeWorkingBar()\n        {\n            var time = DateTime.MaxValue;\n            if (Consolidated != null)\n            {\n                time = _exchangeHours.GetNextTradingDay(Consolidated.Time).Date;\n            }\n            _workingBar = new SessionBar(_sourceTickType)\n            {\n                Time = time,\n                Symbol = _symbol\n            };\n            _initialized = false;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/TickConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// A data consolidator that can make bigger bars from ticks over a given\n    /// time span or a count of pieces of data.\n    /// </summary>\n    public class TickConsolidator : TradeBarConsolidatorBase<Tick>\n    {\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public TickConsolidator(TimeSpan period)\n            : base(period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public TickConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public TickConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public TickConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        public TickConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified data should be processed\n        /// </summary>\n        /// <param name=\"data\">The data to check</param>\n        /// <returns>True if the consolidator should process this data, false otherwise</returns>\n        protected override bool ShouldProcess(Tick data)\n        {\n            return data.TickType == TickType.Trade;\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref TradeBar workingBar, Tick data)\n        {\n            if (workingBar == null)\n            {\n                workingBar = new TradeBar(GetRoundedBarTime(data),\n                    data.Symbol,\n                    data.Value,\n                    data.Value,\n                    data.Value,\n                    data.Value,\n                    data.Quantity,\n                    Period);\n            }\n            else\n            {\n                //Aggregate the working bar\n                workingBar.Close = data.Value;\n                workingBar.Volume += data.Quantity;\n                if (data.Value < workingBar.Low) workingBar.Low = data.Value;\n                if (data.Value > workingBar.High) workingBar.High = data.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/TickQuoteBarConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// Consolidates ticks into quote bars. This consolidator ignores trade ticks\n    /// </summary>\n    public class TickQuoteBarConsolidator : PeriodCountConsolidatorBase<Tick, QuoteBar>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        public TickQuoteBarConsolidator(TimeSpan period, TimeSpan? startTime = null)\n            : base(period, startTime)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public TickQuoteBarConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public TickQuoteBarConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public TickQuoteBarConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TickQuoteBarConsolidator\"/> class\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        public TickQuoteBarConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified data should be processed\n        /// </summary>\n        /// <param name=\"data\">The data to check</param>\n        /// <returns>True if the consolidator should process this data, false otherwise</returns>\n        protected override bool ShouldProcess(Tick data)\n        {\n            return data.TickType == TickType.Quote;\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new consolidated bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref QuoteBar workingBar, Tick data)\n        {\n            if (workingBar == null)\n            {\n                workingBar = new QuoteBar(GetRoundedBarTime(data), data.Symbol, null, decimal.Zero, null, decimal.Zero, Period);\n\n                // open ask and bid should match previous close ask and bid\n                if (Consolidated != null)\n                {\n                    // note that we will only fill forward previous close ask and bid when a new data point comes in and we generate a new working bar which is not a fill forward bar\n                    var previous = Consolidated as QuoteBar;\n                    workingBar.Update(decimal.Zero, previous.Bid?.Close ?? decimal.Zero, previous.Ask?.Close ?? decimal.Zero, decimal.Zero, previous.LastBidSize, previous.LastAskSize);\n                }\n            }\n\n            // update the bid and ask\n            workingBar.Update(decimal.Zero, data.BidPrice, data.AskPrice, decimal.Zero, data.BidSize, data.AskSize);\n            if (!Period.HasValue) workingBar.EndTime = GetRoundedBarTime(data.EndTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/TradeBarConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// A data consolidator that can make bigger bars from smaller ones over a given\n    /// time span or a count of pieces of data.\n    ///\n    /// Use this consolidator to turn data of a lower resolution into data of a higher resolution,\n    /// for example, if you subscribe to minute data but want to have a 15 minute bar.\n    /// </summary>\n    public class TradeBarConsolidator : TradeBarConsolidatorBase<TradeBar>\n    {\n        /// <summary>\n        /// Create a new TradeBarConsolidator for the desired resolution\n        /// </summary>\n        /// <param name=\"resolution\">The resolution desired</param>\n        /// <returns>A consolidator that produces data on the resolution interval</returns>\n        public static TradeBarConsolidator FromResolution(Resolution resolution)\n        {\n            return new TradeBarConsolidator(resolution.ToTimeSpan());\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        public TradeBarConsolidator(TimeSpan period, TimeSpan? startTime = null)\n            : base(period, startTime)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        public TradeBarConsolidator(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emitting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        public TradeBarConsolidator(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        public TradeBarConsolidator(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        public TradeBarConsolidator(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be\n        /// null following the event firing\n        /// </summary>\n        /// <param name=\"workingBar\">The bar we're building, null if the event was just fired and we're starting a new trade bar</param>\n        /// <param name=\"data\">The new data</param>\n        protected override void AggregateBar(ref TradeBar workingBar, TradeBar data)\n        {\n            if (workingBar == null)\n            {\n                workingBar = new TradeBar\n                {\n                    Time = GetRoundedBarTime(data),\n                    Symbol = data.Symbol,\n                    Open = data.Open,\n                    High = data.High,\n                    Low = data.Low,\n                    Close = data.Close,\n                    Volume = data.Volume,\n                    DataType = MarketDataType.TradeBar,\n                    Period = IsTimeBased && Period.HasValue ? (TimeSpan)Period : data.Period\n                };\n            }\n            else\n            {\n                //Aggregate the working bar\n                workingBar.Close = data.Close;\n                workingBar.Volume += data.Volume;\n                if (data.Low < workingBar.Low) workingBar.Low = data.Low;\n                if (data.High > workingBar.High) workingBar.High = data.High;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/TradeBarConsolidatorBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// A data consolidator that can make bigger bars from any base data\n    ///\n    /// This type acts as the base for other consolidators that produce bars on a given time step or for a count of data.\n    /// </summary>\n    /// <typeparam name=\"T\">The input type into the consolidator's Update method</typeparam>\n    public abstract class TradeBarConsolidatorBase<T> : PeriodCountConsolidatorBase<T, TradeBar>\n        where T : IBaseData\n    {\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the period\n        /// </summary>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        /// <param name=\"startTime\">Optionally the bar start time anchor to use</param>\n        protected TradeBarConsolidatorBase(TimeSpan period, TimeSpan? startTime = null)\n            : base(period, startTime)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        protected TradeBarConsolidatorBase(int maxCount)\n            : base(maxCount)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"maxCount\">The number of pieces to accept before emiting a consolidated bar</param>\n        /// <param name=\"period\">The minimum span of time before emitting a consolidated bar</param>\n        protected TradeBarConsolidatorBase(int maxCount, TimeSpan period)\n            : base(maxCount, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"func\">Func that defines the start time of a consolidated data</param>\n        protected TradeBarConsolidatorBase(Func<DateTime, CalendarInfo> func)\n            : base(func)\n        {\n        }\n\n        /// <summary>\n        /// Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first\n        /// </summary>\n        /// <param name=\"pyfuncobj\">Python function object that defines the start time of a consolidated data</param>\n        protected TradeBarConsolidatorBase(PyObject pyfuncobj)\n            : base(pyfuncobj)\n        {\n        }\n\n        /// <summary>\n        /// Gets a copy of the current 'workingBar'.\n        /// </summary>\n        public TradeBar WorkingBar => (TradeBar) WorkingData;\n    }\n}\n"
  },
  {
    "path": "Common/Data/Consolidators/VolumeRenkoConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Consolidators\n{\n    /// <summary>\n    /// This consolidator can transform a stream of <see cref=\"BaseData\"/> instances into a stream of <see cref=\"RenkoBar\"/>\n    /// with a constant volume for each bar.\n    /// </summary>\n    public class VolumeRenkoConsolidator : DataConsolidator<BaseData>\n    {\n        private VolumeRenkoBar _currentBar;\n        private decimal _barSize;\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public override IBaseData WorkingData => _currentBar;\n\n        /// <summary>\n        /// Gets <see cref=\"VolumeRenkoBar\"/> which is the type emitted in the <see cref=\"IDataConsolidator.DataConsolidated\"/> event.\n        /// </summary>\n        public override Type OutputType => typeof(VolumeRenkoBar);\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public new event EventHandler<VolumeRenkoBar> DataConsolidated;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeRenkoConsolidator\"/> class using the specified <paramref name=\"barSize\"/>.\n        /// </summary>\n        /// <param name=\"barSize\">The constant volume size of each bar</param>\n        public VolumeRenkoConsolidator(decimal barSize)\n        {\n            _barSize = barSize;\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public override void Update(BaseData data)\n        {\n            var close = data.Price;\n            var dataType = data.GetType();\n\n            decimal volume;\n            decimal open;\n            decimal high;\n            decimal low;\n\n            if (dataType == typeof(TradeBar))\n            {\n                var tradeBar = (TradeBar)data;\n                volume = tradeBar.Volume;\n                open = tradeBar.Open;\n                high = tradeBar.High;\n                low = tradeBar.Low;\n            }\n            else if (dataType == typeof(Tick))\n            {\n                var tick = (Tick)data;\n                // Only include actual trade information\n                if (tick.TickType != TickType.Trade)\n                {\n                    return;\n                }\n\n                volume = tick.Quantity;\n                open = close;\n                high = close;\n                low = close;\n            }\n            else\n            {\n                throw new ArgumentException($\"{GetType().Name} must be used with TradeBar or Tick data.\");\n            }\n\n            var adjustedVolume = AdjustVolume(volume, close);\n\n            if (_currentBar == null)\n            {\n                _currentBar = new VolumeRenkoBar(data.Symbol, data.Time, data.EndTime, _barSize, open, high, low, close, 0);\n            }\n            var volumeLeftOver = _currentBar.Update(data.EndTime, high, low, close, adjustedVolume);\n            while (volumeLeftOver >= 0)\n            {\n                OnDataConsolidated(_currentBar);\n                _currentBar = _currentBar.Rollover();\n                volumeLeftOver = _currentBar.Update(data.EndTime, high, low, close, volumeLeftOver);\n            }\n        }\n\n        /// <summary>\n        /// Returns the raw volume without any adjustment.\n        /// </summary>\n        /// <param name=\"volume\">The volume</param>\n        /// <param name=\"price\">The price</param>\n        /// <returns>The unmodified volume</returns>\n        protected virtual decimal AdjustVolume(decimal volume, decimal price)\n        {\n            return volume;\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public override void Scan(DateTime currentLocalTime)\n        {\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _currentBar = null;\n        }\n\n        /// <summary>\n        /// Event invocator for the DataConsolidated event. This should be invoked\n        /// by derived classes when they have consolidated a new piece of data.\n        /// </summary>\n        /// <param name=\"consolidated\">The newly consolidated data</param>\n        protected void OnDataConsolidated(VolumeRenkoBar consolidated)\n        {\n            base.OnDataConsolidated(consolidated);\n            DataConsolidated?.Invoke(this, consolidated);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/ConstantDividendYieldModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Constant dividend yield model\n    /// </summary>\n    public class ConstantDividendYieldModel : IDividendYieldModel\n    {\n        private readonly decimal _dividendYield;\n\n        /// <summary>\n        /// Instantiates a <see cref=\"ConstantDividendYieldModel\"/> with the specified dividend yield\n        /// </summary>\n        public ConstantDividendYieldModel(decimal dividendYield)\n        {\n            _dividendYield = dividendYield;\n        }\n\n        /// <summary>\n        /// Get dividend yield by a given date of a given symbol\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        public decimal GetDividendYield(DateTime date)\n        {\n            return _dividendYield;\n        }\n\n        /// <summary>\n        /// Get dividend yield at given date and security price\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"securityPrice\">The security price at the given date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        public decimal GetDividendYield(DateTime date, decimal securityPrice)\n        {\n            return _dividendYield;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/ConstantRiskFreeRateInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Constant risk free rate interest rate model\n    /// </summary>\n    public class ConstantRiskFreeRateInterestRateModel : IRiskFreeInterestRateModel\n    {\n        private readonly decimal _riskFreeRate;\n\n        /// <summary>\n        /// Instantiates a <see cref=\"ConstantRiskFreeRateInterestRateModel\"/> with the specified risk free rate\n        /// </summary>\n        public ConstantRiskFreeRateInterestRateModel(decimal riskFreeRate)\n        {\n            _riskFreeRate = riskFreeRate;\n        }\n\n        /// <summary>\n        /// Get interest rate by a given date\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Interest rate on the given date</returns>\n        public decimal GetInterestRate(DateTime date)\n        {\n            return _riskFreeRate;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/AlphaStreams/PlaceHolder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Custom.AlphaStreams\n{\n    /// <summary>\n    /// Static class for place holder\n    /// </summary>\n    [Obsolete(\"'QuantConnect.Data.Custom.Alphas' namespace is obsolete\")]\n    public static class PlaceHolder\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/FxcmVolume.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Custom\n{\n    /// <summary>\n    ///     FXCM Real FOREX Volume and Transaction data from its clients base, available for the following pairs:\n    ///     - EURUSD, USDJPY, GBPUSD, USDCHF, EURCHF, AUDUSD, USDCAD,\n    ///       NZDUSD, EURGBP, EURJPY, GBPJPY, EURAUD, EURCAD, AUDJPY\n    ///     FXCM only provides support for FX symbols which produced over 110 million average daily volume (ADV) during 2013.\n    ///     This limit is imposed to ensure we do not highlight low volume/low ticket symbols in addition to other financial\n    ///     reporting concerns.\n    /// </summary>\n    /// <seealso cref=\"QuantConnect.Data.BaseData\" />\n    public class FxcmVolume : BaseData\n    {\n        /// <summary>\n        /// Auxiliary enum used to map the pair symbol into FXCM request code.\n        /// </summary>\n        private enum FxcmSymbolId\n        {\n            EURUSD = 1,\n            USDJPY = 2,\n            GBPUSD = 3,\n            USDCHF = 4,\n            EURCHF = 5,\n            AUDUSD = 6,\n            USDCAD = 7,\n            NZDUSD = 8,\n            EURGBP = 9,\n            EURJPY = 10,\n            GBPJPY = 11,\n            EURAUD = 14,\n            EURCAD = 15,\n            AUDJPY = 17\n        }\n\n        /// <summary>\n        ///     The request base URL.\n        /// </summary>\n        private readonly string _baseUrl = \" http://marketsummary2.fxcorporate.com/ssisa/servlet?RT=SSI\";\n\n        /// <summary>\n        ///     FXCM session id.\n        /// </summary>\n        private readonly string _sid = \"quantconnect\";\n\n        /// <summary>\n        ///     The columns index which should be added to obtain the transactions.\n        /// </summary>\n        private readonly long[] _transactionsIdx = { 27, 29, 31, 33 };\n\n        /// <summary>\n        ///     Integer representing client version.\n        /// </summary>\n        private readonly int _ver = 1;\n\n        /// <summary>\n        ///     The columns index which should be added to obtain the volume.\n        /// </summary>\n        private readonly int[] _volumeIdx = { 26, 28, 30, 32 };\n\n        /// <summary>\n        ///     Sum of opening and closing Transactions for the entire time interval.\n        /// </summary>\n        /// <value>\n        ///     The transactions.\n        /// </value>\n        public int Transactions { get; set; }\n\n        /// <summary>\n        ///     Sum of opening and closing Volume for the entire time interval.\n        ///     The volume measured in the QUOTE CURRENCY.\n        /// </summary>\n        /// <remarks>Please remember to convert this data to a common currency before making comparison between different pairs.</remarks>\n        public long Volume { get; set; }\n\n        /// <summary>\n        ///     Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>\n        ///     String URL of source file.\n        /// </returns>\n        /// <exception cref=\"System.NotImplementedException\">FOREX Volume data is not available in live mode, yet.</exception>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var interval = GetIntervalFromResolution(config.Resolution);\n            var symbolId = GetFxcmIDFromSymbol(config.Symbol.Value.Split('_').First());\n\n            if (isLiveMode)\n            {\n                var source = Invariant($\"{_baseUrl}&ver={_ver}&sid={_sid}&interval={interval}&offerID={symbolId}\");\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.Rest, FileFormat.Csv);\n            }\n            else\n            {\n                var source = GenerateZipFilePath(config, date);\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile);\n            }\n        }\n\n        /// <summary>\n        ///     Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method,\n        ///     and returns a new instance of the object\n        ///     each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>\n        ///     Instance of the T:BaseData object generated by this line of the CSV\n        /// </returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var fxcmVolume = new FxcmVolume { DataType = MarketDataType.Base, Symbol = config.Symbol };\n            if (isLiveMode)\n            {\n                try\n                {\n                    var obs = line.Split('\\n')[2].Split(';');\n                    var stringDate = obs[0].Substring(startIndex: 3);\n                    fxcmVolume.Time = DateTime.ParseExact(stringDate, \"yyyyMMddHHmm\", DateTimeFormatInfo.InvariantInfo);\n                    fxcmVolume.Volume = _volumeIdx.Select(x => Parse.Long(obs[x])).Sum();\n                    fxcmVolume.Transactions = _transactionsIdx.Select(x => Parse.Int(obs[x])).Sum();\n                    fxcmVolume.Value = fxcmVolume.Volume;\n                }\n                catch (Exception exception)\n                {\n                    Logging.Log.Error($\"Invalid data. Line: {line}. Exception: {exception.Message}\");\n                    return null;\n                }\n            }\n            else\n            {\n                var obs = line.Split(',');\n                if (config.Resolution == Resolution.Minute)\n                {\n                    fxcmVolume.Time = date.Date.AddMilliseconds(Parse.Int(obs[0]));\n                }\n                else\n                {\n                    fxcmVolume.Time = DateTime.ParseExact(obs[0], \"yyyyMMdd HH:mm\", CultureInfo.InvariantCulture);\n                }\n                fxcmVolume.Volume = Parse.Long(obs[1]);\n                fxcmVolume.Transactions = obs[2].ConvertInvariant<int>();\n                fxcmVolume.Value = fxcmVolume.Volume;\n            }\n            return fxcmVolume;\n        }\n\n        private static string GenerateZipFilePath(SubscriptionDataConfig config, DateTime date)\n        {\n            var source = Path.Combine(new[] { Globals.DataFolder, \"forex\", \"fxcm\", config.Resolution.ToLower() });\n            string filename;\n\n            var symbol = config.Symbol.Value.Split('_').First().ToLowerInvariant();\n            if (config.Resolution == Resolution.Minute)\n            {\n                filename = Invariant($\"{date:yyyyMMdd}_volume.zip\");\n                source = Path.Combine(source, symbol, filename);\n            }\n            else\n            {\n                filename = $\"{symbol}_volume.zip\";\n                source = Path.Combine(source, filename);\n            }\n            return source;\n        }\n\n        /// <summary>\n        ///     Gets the FXCM identifier from a FOREX pair ticker.\n        /// </summary>\n        /// <param name=\"ticker\">The pair ticker.</param>\n        /// <returns></returns>\n        /// <exception cref=\"System.ArgumentException\">Volume data is not available for the selected ticker. - ticker</exception>\n        private int GetFxcmIDFromSymbol(string ticker)\n        {\n            int symbolId;\n            try\n            {\n                symbolId = (int)Enum.Parse(typeof(FxcmSymbolId), ticker);\n            }\n            catch (ArgumentException)\n            {\n                throw new ArgumentOutOfRangeException(nameof(ticker), ticker,\n                                                      \"Volume data is not available for the selected ticker.\");\n            }\n            return symbolId;\n        }\n\n        /// <summary>\n        ///     Gets the string interval representation from the resolution.\n        /// </summary>\n        /// <param name=\"resolution\">The requested resolution.</param>\n        /// <returns></returns>\n        /// <exception cref=\"System.ArgumentOutOfRangeException\">\n        ///     resolution - tick or second resolution are not supported for Forex\n        ///     Volume.\n        /// </exception>\n        private string GetIntervalFromResolution(Resolution resolution)\n        {\n            string interval;\n            switch (resolution)\n            {\n                case Resolution.Minute:\n                    interval = \"M1\";\n                    break;\n\n                case Resolution.Hour:\n                    interval = \"H1\";\n                    break;\n\n                case Resolution.Daily:\n                    interval = \"D1\";\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution), resolution,\n                                                          \"Tick or second resolution are not supported for Forex Volume. Available resolutions are Minute, Hour and Daily.\");\n            }\n            return interval;\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Custom/IconicTypes/IndexedLinkedData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Custom.IconicTypes\n{\n    /// <summary>\n    /// Data type that is indexed, i.e. a file that points to another file containing the contents\n    /// we're looking for in a Symbol.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class IndexedLinkedData : IndexedBaseData\n    {\n        /// <summary>\n        /// Example data property\n        /// </summary>\n        [ProtoMember(55)]\n        public int Count { get; set; }\n        \n        /// <summary>\n        /// Determines the actual source from an index contained within a ticker folder\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"date\">Date</param>\n        /// <param name=\"index\">File to load data from</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        /// <returns>SubscriptionDataSource pointing to the article</returns>\n        public override SubscriptionDataSource GetSourceForAnIndex(SubscriptionDataConfig config, DateTime date, string index, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\"TestData\",\n                    \"indexlinked\",\n                    \"content\",\n                    $\"{date.ToStringInvariant(DateFormat.EightCharacter)}.zip#{index}\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Csv\n            );\n        }\n\n        /// <summary>\n        /// Gets the source of the index file\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        /// <returns>SubscriptionDataSource indicating where data is located and how it's stored</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    \"TestData\",\n                    \"indexlinked\",\n                    config.Symbol.Value.ToLowerInvariant(),\n                    $\"{date.ToStringInvariant(DateFormat.EightCharacter)}.csv\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Index\n            );\n        }\n\n        /// <summary>\n        /// Creates an instance from a line of JSON containing article information read from the `content` directory\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"line\">Line of data</param>\n        /// <param name=\"date\">Date</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            return new IndexedLinkedData\n            {\n                Count = 10,\n                Symbol = config.Symbol,\n                EndTime = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates whether the data source is sparse.\n        /// If false, it will disable missing file logging.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates whether the data source can undergo\n        /// rename events/is tied to equities.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool RequiresMapping()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Set the data time zone to UTC\n        /// </summary>\n        /// <returns>Time zone as UTC</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Sets the default resolution to Second\n        /// </summary>\n        /// <returns>Resolution.Second</returns>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets a list of all the supported Resolutions\n        /// </summary>\n        /// <returns>All resolutions</returns>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        } \n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/IconicTypes/IndexedLinkedData2.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Custom.IconicTypes \n{\n    /// <summary>\n    /// Data type that is indexed, i.e. a file that points to another file containing the contents\n    /// we're looking for in a Symbol.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class IndexedLinkedData2 : IndexedBaseData\n    {\n        /// <summary>\n        /// Example data property\n        /// </summary>\n        [ProtoMember(55)]\n        public int Count { get; set; }\n        \n        /// <summary>\n        /// Determines the actual source from an index contained within a ticker folder\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"date\">Date</param>\n        /// <param name=\"index\">File to load data from</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        /// <returns>SubscriptionDataSource pointing to the article</returns>\n        public override SubscriptionDataSource GetSourceForAnIndex(SubscriptionDataConfig config, DateTime date, string index, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\"TestData\",\n                    \"indexlinked2\",\n                    \"content\",\n                    $\"{date.ToStringInvariant(DateFormat.EightCharacter)}.zip#{index}\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Csv\n            );\n        }\n\n        /// <summary>\n        /// Gets the source of the index file\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        /// <returns>SubscriptionDataSource indicating where data is located and how it's stored</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                throw new NotImplementedException(\"Live mode not supported\");\n            }\n\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    \"TestData\",\n                    \"indexlinked2\",\n                    config.Symbol.Value.ToLowerInvariant(),\n                    $\"{date.ToStringInvariant(DateFormat.EightCharacter)}.csv\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Index\n            );\n        }\n\n        /// <summary>\n        /// Creates an instance from a line of JSON containing article information read from the `content` directory\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"line\">Line of data</param>\n        /// <param name=\"date\">Date</param>\n        /// <param name=\"isLiveMode\">Is live mode</param>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            return new IndexedLinkedData2\n            {\n                Count = 10,\n                Symbol = config.Symbol,\n                EndTime = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates whether the data source is sparse.\n        /// If false, it will disable missing file logging.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates whether the data source can undergo\n        /// rename events/is tied to equities.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool RequiresMapping()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Set the data time zone to UTC\n        /// </summary>\n        /// <returns>Time zone as UTC</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Sets the default resolution to Second\n        /// </summary>\n        /// <returns>Resolution.Second</returns>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets a list of all the supported Resolutions\n        /// </summary>\n        /// <returns>All resolutions</returns>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        } \n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/IconicTypes/LinkedData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Custom.IconicTypes\n{\n    /// <summary>\n    /// Data source that is linked (tickers that can have renames or be delisted)\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class LinkedData : BaseData\n    {\n        /// <summary>\n        /// Example data\n        /// </summary>\n        [ProtoMember(55)]\n        public int Count { get; set; }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    \"TestData\",\n                    \"linked\",\n                    $\"{config.Symbol.Underlying.Value.ToLowerInvariant()}.csv\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            return new LinkedData\n            {\n                Count = 10,\n                Symbol = config.Symbol,\n                EndTime = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates whether the data source is sparse.\n        /// If false, it will disable missing file logging.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates whether the data source can undergo\n        /// rename events/is tied to equities.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool RequiresMapping()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Set the data time zone to UTC\n        /// </summary>\n        /// <returns>Time zone as UTC</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Sets the default resolution to Second\n        /// </summary>\n        /// <returns>Resolution.Second</returns>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets a list of all the supported Resolutions\n        /// </summary>\n        /// <returns>All resolutions</returns>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/IconicTypes/UnlinkedData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Custom.IconicTypes\n{\n    /// <summary>\n    /// Data source that is unlinked (no mapping) and takes any ticker when calling AddData\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class UnlinkedData : BaseData\n    {\n        /// <summary>\n        /// If true, we accept any ticker from the AddData call\n        /// </summary>\n        public static bool AnyTicker { get; set; }\n        \n        /// <summary>\n        /// Example data\n        /// </summary>\n        [ProtoMember(55)]\n        public string Ticker { get; set; }\n\n        /// <summary>\n        /// Return the path string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String path of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    \"TestData\",\n                    \"unlinked\",\n                    AnyTicker ? \"data.csv\" : $\"{config.Symbol.Value.ToLowerInvariant()}.csv\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Creates UnlinkedData objects using the subscription data config setup as well as the date.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the UnlinkedData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            return new UnlinkedData\n            {\n                Ticker = AnyTicker ? \"ANY\" : $\"{config.Symbol.Value}\",\n                Symbol = config.Symbol,\n                EndTime = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates whether the data source is sparse.\n        /// If false, it will disable missing file logging.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates whether the data source can undergo\n        /// rename events/is tied to equities.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool RequiresMapping()\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// Set the data time zone to UTC\n        /// </summary>\n        /// <returns>Time zone as UTC</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Sets the default resolution to Second\n        /// </summary>\n        /// <returns>Resolution.Second</returns>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets a list of all the supported Resolutions\n        /// </summary>\n        /// <returns>All resolutions</returns>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/IconicTypes/UnlinkedDataTradeBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProtoBuf;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.Custom.IconicTypes\n{\n    /// <summary>\n    /// Data source that is unlinked (no mapping) and takes any ticker when calling AddData\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class UnlinkedDataTradeBar : TradeBar\n    {\n        /// <summary>\n        /// If true, we accept any ticker from the AddData call\n        /// </summary>\n        public static bool AnyTicker { get; set; }\n\n        /// <summary>\n        /// Creates a new instance of an UnlinkedTradeBar\n        /// </summary>\n        public UnlinkedDataTradeBar()\n        {\n            DataType = MarketDataType.Base;\n            Period = TimeSpan.FromDays(1);\n        }\n\n        /// <summary>\n        /// Get Source for Custom Data File\n        /// >> What source file location would you prefer for each type of usage:\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source request if source spread across multiple files</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String source location of the file</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    \"TestData\",\n                    \"unlinkedtradebar\",\n                    AnyTicker ? \"data.csv\" : $\"{config.Symbol.Value.ToLowerInvariant()}.csv\"\n                ),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Fetch the data from the storage and feed it line by line into the engine.\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Enumerable iterator for returning each line of the required data.</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            return new UnlinkedDataTradeBar\n            {\n                Open = 1m,\n                High = 2m,\n                Low = 1m,\n                Close = 1.5m,\n                Volume = 0m,\n                \n                Symbol = config.Symbol,\n                EndTime = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates whether the data source is sparse.\n        /// If false, it will disable missing file logging.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates whether the data source can undergo\n        /// rename events/is tied to equities.\n        /// </summary>\n        /// <returns>true</returns>\n        public override bool RequiresMapping()\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// Set the data time zone to UTC\n        /// </summary>\n        /// <returns>Time zone as UTC</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Sets the default resolution to Second\n        /// </summary>\n        /// <returns>Resolution.Second</returns>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets a list of all the supported Resolutions\n        /// </summary>\n        /// <returns>All resolutions</returns>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/Intrinio/EconomicDataSources.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Custom.Intrinio\n{\n    /// <summary>\n    /// Intrinio Data Source\n    /// </summary>\n    public static class IntrinioEconomicDataSources\n    {\n        /// <summary>\n        /// Bank of America Merrill Lynch\n        /// </summary>\n        public static class BofAMerrillLynch\n        {\n            /// <summary>\n            ///     This data represents the effective yield of the BofA Merrill Lynch US Corporate BBB Index, a subset of the BofA\n            ///     Merrill Lynch US Corporate Master Index tracking the performance of US dollar denominated investment grade rated\n            ///     corporate debt publically issued in the US domestic market.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLC0A4CBBBEY\n            /// </remarks>\n            public const string USCorporateBBBEffectiveYield = \"$BAMLC0A4CBBBEY\";\n\n            /// <summary>\n            ///     This data represents the Option-Adjusted Spread (OAS) of the BofA Merrill Lynch US Corporate BBB Index, a subset of\n            ///     the BofA Merrill Lynch US Corporate Master Index tracking the performance of US dollar denominated investment grade\n            ///     rated corporate debt publically issued in the US domestic market.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLC0A4CBBB\n            /// </remarks>\n            public const string USCorporateBBBOptionAdjustedSpread = \"$BAMLC0A4CBBB\";\n\n            /// <summary>\n            ///     The BofA Merrill Lynch Option-Adjusted Spreads (OASs) are the calculated spreads between a computed OAS index of\n            ///     all bonds in a given rating category and a spot Treasury curve. An OAS index is constructed using each constituent\n            ///     bond’s OAS, weighted by market capitalization.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLC0A0CM\n            /// </remarks>\n            public const string USCorporateMasterOptionAdjustedSpread = \"$BAMLC0A0CM\";\n\n            /// <summary>\n            ///     This data represents the Option-Adjusted Spread (OAS) of the BofA Merrill Lynch US Corporate BB Index, a subset of\n            ///     the BofA Merrill Lynch US High Yield Master II Index tracking the performance of US dollar denominated below\n            ///     investment grade rated corporate debt publically issued in the US domestic market.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLH0A1HYBB\n            /// </remarks>\n            public const string USHighYieldBBOptionAdjustedSpread = \"$BAMLH0A1HYBB\";\n\n            /// <summary>\n            ///     This data represents the Option-Adjusted Spread (OAS) of the BofA Merrill Lynch US Corporate B Index, a subset of\n            ///     the BofA Merrill Lynch US High Yield Master II Index tracking the performance of US dollar denominated below\n            ///     investment grade rated corporate debt publically issued in the US domestic market. This subset includes all\n            ///     securities with a given investment grade rating B.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLH0A2HYB\n            /// </remarks>\n            public const string USHighYieldBOptionAdjustedSpread = \"$BAMLH0A2HYB\";\n\n            /// <summary>\n            ///     This data represents the Option-Adjusted Spread (OAS) of the BofA Merrill Lynch US Corporate C Index, a subset of\n            ///     the BofA Merrill Lynch US High Yield Master II Index tracking the performance of US dollar denominated below\n            ///     investment grade rated corporate debt publically issued in the US domestic market.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLH0A3HYC\n            /// </remarks>\n            public const string USHighYieldCCCorBelowOptionAdjustedSpread = \"$BAMLH0A3HYC\";\n\n            /// <summary>\n            ///     This data represents the effective yield of the BofA Merrill Lynch US High Yield Master II Index, which tracks the\n            ///     performance of US dollar denominated below investment grade rated corporate debt publically issued in the US\n            ///     domestic market.\n            ///     Source: https://fred.stlouisfed.org/series/BAMLH0A0HYM2EY\n            /// </summary>\n            public const string USHighYieldEffectiveYield = \"$BAMLH0A0HYM2EY\";\n\n            /// <summary>\n            ///     This data represents the BofA Merrill Lynch US High Yield Master II Index value, which tracks the performance of US\n            ///     dollar denominated below investment grade rated corporate debt publically issued in the US domestic market.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAMLHYH0A0HYM2TRIV\n            /// </remarks>\n            public const string USHighYieldMasterIITotalReturnIndexValue = \"$BAMLHYH0A0HYM2TRIV\";\n\n            /// <summary>\n            ///     The BofA Merrill Lynch Option-Adjusted Spreads (OASs) are the calculated spreads between a computed OAS index of\n            ///     all bonds in a given rating category and a spot Treasury curve. An OAS index is constructed using each constituent\n            ///     bond’s OAS, weighted by market capitalization.\n            ///     Source: https://fred.stlouisfed.org/series/BAMLH0A0HYM2\n            /// </summary>\n            public const string USHighYieldOptionAdjustedSpread = \"$BAMLH0A0HYM2\";\n        }\n\n        /// <summary>\n        /// Chicago Board Options Exchange\n        /// </summary>\n        public static class CBOE\n        {\n            /// <summary>\n            ///     CBOE China ETF Volatility Index\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VXFXICLS\n            /// </remarks>\n            public const string ChinaETFVolatilityIndex = \"$VXFXICLS\";\n\n            /// <summary>\n            ///     CBOE Crude Oil ETF Volatility Index\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/OVXCLS\n            /// </remarks>\n            public const string CrudeOilETFVolatilityIndex = \"$OVXCLS\";\n\n            /// <summary>\n            ///     CBOE Emerging Markets ETF Volatility Index\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VXEEMCLS\n            /// </remarks>\n            public const string EmergingMarketsETFVolatilityIndex = \"$VXEEMCLS\";\n\n            /// <summary>\n            ///     CBOE Gold ETF Volatility Index\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/GVZCLS\n            /// </remarks>\n            public const string GoldETFVolatilityIndex = \"$GVZCLS\";\n\n            /// <summary>\n            ///     CBOE 10-Year Treasury Note Volatility Futures\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VXTYN\n            /// </remarks>\n            public const string TenYearTreasuryNoteVolatilityFutures = \"$VXTYN\";\n\n            /// <summary>\n            ///     CBOE Volatility Index: VIX\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VIXCLS\n            /// </remarks>\n            public const string VIX = \"$VIXCLS\";\n\n            /// <summary>\n            ///     CBOE S&amp;P 100 Volatility Index: VXO\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VXOCLS\n            /// </remarks>\n            public const string VXO = \"$VXOCLS\";\n\n            /// <summary>\n            ///     CBOE S&amp;P 500 3-Month Volatility Index\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/VXVCLS\n            /// </remarks>\n            public const string VXV = \"$VXVCLS\";\n        }\n\n        /// <summary>\n        /// Commodities\n        /// </summary>\n        public static class Commodities\n        {\n            /// <summary>\n            ///     Crude Oil Prices: Brent - Europe\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DCOILBRENTEU\n            /// </remarks>\n            public const string CrudeOilBrent = \"$DCOILBRENTEU\";\n\n            /// <summary>\n            ///     Crude Oil Prices: West Texas Intermediate (WTI) - Cushing, Oklahoma\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DCOILWTICO\n            /// </remarks>\n            public const string CrudeOilWTI = \"$DCOILWTICO\";\n\n            /// <summary>\n            ///     Conventional Gasoline Prices: U.S. Gulf Coast, Regular\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DGASUSGULF\n            /// </remarks>\n            public const string GasolineUSGulfCoast = \"$DGASUSGULF\";\n\n            /// <summary>\n            ///     Gold Fixing Price 10:30 A.M. (London time) in London Bullion Market, based in U.S. Dollars\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/GOLDAMGBD228NLBM\n            /// </remarks>\n            public const string GoldFixingPrice1030amLondon = \"$GOLDAMGBD228NLBM\";\n\n            /// <summary>\n            ///     Gold Fixing Price 3:00 P.M. (London time) in London Bullion Market, based in U.S. Dollars\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/GOLDPMGBD228NLBM\n            /// </remarks>\n            public const string GoldFixingPrice1500amLondon = \"$GOLDPMGBD228NLBM\";\n\n            /// <summary>\n            ///     Henry Hub Natural Gas Spot Price\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DHHNGSP\n            /// </remarks>\n            public const string NaturalGas = \"$DHHNGSP\";\n\n            /// <summary>\n            ///     Propane Prices: Mont Belvieu, Texas\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DPROPANEMBTX\n            /// </remarks>\n            public const string Propane = \"$DPROPANEMBTX\";\n        }\n\n        /// <summary>\n        /// Exchange Rates\n        /// </summary>\n        public static class ExchangeRates\n        {\n            /// <summary>\n            ///     Brazilian Reals to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Brazil_USA = \"$DEXBZUS\";\n\n            /// <summary>\n            ///     Canadian Dollars to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Canada_USA = \"$DEXCAUS\";\n\n            /// <summary>\n            ///     Chinese Yuan to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string China_USA = \"$DEXCHUS\";\n\n            /// <summary>\n            ///     Hong Kong Dollars to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string HongKong_USA = \"$DEXHKUS\";\n\n            /// <summary>\n            ///     Indian Rupees to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string India_USA = \"$DEXINUS\";\n\n            /// <summary>\n            ///     Japanese Yen to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Japan_USA = \"$DEXJPUS\";\n\n            /// <summary>\n            ///     Malaysian Ringgit to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Malaysia_USA = \"$DEXMAUS\";\n\n            /// <summary>\n            ///     Mexican New Pesos to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Mexico_USA = \"$DEXMXUS\";\n\n            /// <summary>\n            ///     Norwegian Kroner to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Norway_USA = \"$DEXNOUS\";\n\n            /// <summary>\n            ///     Singapore Dollars to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Singapore_USA = \"$DEXSIUS\";\n\n            /// <summary>\n            ///     South African Rand to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string SouthAfrica_USA = \"$DEXSFUS\";\n\n            /// <summary>\n            ///     South Korean Won to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string SouthKorea_USA = \"$DEXKOUS\";\n\n            /// <summary>\n            ///     Sri Lankan Rupees to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string SriLanka_USA = \"$DEXSLUS\";\n\n            /// <summary>\n            ///     Swiss Francs to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Switzerland_USA = \"$DEXSZUS\";\n\n            /// <summary>\n            ///     New Taiwan Dollars to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Taiwan_USA = \"$DEXTAUS\";\n\n            /// <summary>\n            ///     Thai Baht to One U.S. Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string Thailand_USA = \"$DEXTHUS\";\n\n            /// <summary>\n            ///     U.S. Dollars to One Australian Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string USA_Australia = \"$DEXUSAL\";\n\n            /// <summary>\n            ///     U.S. Dollars to One Euro\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string USA_Euro = \"$DEXUSEU\";\n\n            /// <summary>\n            ///     U.S. Dollars to One New Zealand Dollar\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string USA_NewZealand = \"$DEXUSNZ\";\n\n            /// <summary>\n            ///     U.S. Dollars to One British Pound\n            /// </summary>\n            /// <remarks>\n            ///     Source: Board of Governors of the Federal Reserve System https://www.federalreserve.gov/releases/h10/\n            /// </remarks>\n            public const string USA_UK = \"$DEXUSUK\";\n        }\n\n        /// <summary>\n        /// Moody's Investors Service\n        /// </summary>\n        public static class Moodys\n        {\n            /// <summary>\n            ///     Moody's Seasoned Aaa Corporate Bond© and 10-Year Treasury Constant Maturity.\n            ///     These instruments are based on bonds with maturities 20 years and above.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DAAA\n            /// </remarks>\n            public const string SeasonedAaaCorporateBondYield = \"$DAAA\";\n\n            /// <summary>\n            ///     Series is calculated as the spread between Moody's Seasoned Aaa Corporate Bond© and 10-Year Treasury Constant\n            ///     Maturity\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/AAA10Y\n            /// </remarks>\n            public const string SeasonedAaaCorporateBondYieldRelativeTo10YearTreasuryConstantMaturity = \"$AAA10Y\";\n\n            /// <summary>\n            ///     Moody's Seasoned Baa Corporate Bond© and 10-Year Treasury Constant Maturity.\n            ///     These instruments are based on bonds with maturities 20 years and above.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DBAA\n            /// </remarks>\n            public const string SeasonedBaaCorporateBondYield = \"$DBAA\";\n\n            /// <summary>\n            /// Series is calculated as the spread between Moody's Seasoned Baa Corporate Bond© and 10-Year Treasury Constant Maturity\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/BAA10Y\n            /// </remarks>\n            public const string SeasonedBaaCorporateBondYieldRelativeTo10YearTreasuryConstantMaturity = \"$BAA10Y\";\n        }\n\n        /// <summary>\n        /// Trade Weighted US Dollar Index\n        /// </summary>\n        public static class TradeWeightedUsDollarIndex\n        {\n            /// <summary>\n            ///     A weighted average of the foreign exchange value of the U.S. dollar against the currencies of a broad group of\n            ///     major U.S. trading partners. Broad currency index includes the Euro Area, Canada, Japan, Mexico, China, United\n            ///     Kingdom, Taiwan, Korea, Singapore, Hong Kong, Malaysia, Brazil, Switzerland, Thailand, Philippines, Australia,\n            ///     Indonesia, India, Israel, Saudi Arabia, Russia, Sweden, Argentina, Venezuela, Chile and Colombia.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DTWEXB\n            ///     For more information about trade-weighted indexes see\n            ///     http://www.federalreserve.gov/pubs/bulletin/2005/winter05_index.pdf.\n            /// </remarks>\n            public const string Broad = \"$DTWEXB\";\n\n            /// <summary>\n            ///     A weighted average of the foreign exchange value of the U.S. dollar against a subset of the broad index currencies\n            ///     that circulate widely outside the country of issue. Major currencies index includes the Euro Area, Canada, Japan,\n            ///     United Kingdom, Switzerland, Australia, and Sweden.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DTWEXM\n            ///     For more information about trade-weighted indexes see\n            ///     http://www.federalreserve.gov/pubs/bulletin/2005/winter05_index.pdf.\n            /// </remarks>\n            public const string MajorCurrencies = \"$DTWEXM\";\n\n            /// <summary>\n            ///     A weighted average of the foreign exchange value of the U.S. dollar against a subset of the broad index currencies\n            ///     that do not circulate widely outside the country of issue. Countries whose currencies are included in the other\n            ///     important trading partners index are Mexico, China, Taiwan, Korea, Singapore, Hong Kong, Malaysia, Brazil,\n            ///     Thailand, Philippines, Indonesia, India, Israel, Saudi Arabia, Russia, Argentina, Venezuela, Chile and Colombia.\n            /// </summary>\n            /// <remarks>\n            ///     Source: https://fred.stlouisfed.org/series/DTWEXO\n            ///     For more information about trade-weighted indexes see\n            ///     http://www.federalreserve.gov/pubs/bulletin/2005/winter05_index.pdf.\n            /// </remarks>\n            public const string OtherImportantTradingPartners = \"$DTWEXO\";\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Custom/Intrinio/IntrinioConfig.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.Custom.Intrinio\n{\n    /// <summary>\n    ///     Auxiliary class to access all Intrinio API data.\n    /// </summary>\n    public static class IntrinioConfig\n    {\n        /// <summary>\n        /// </summary>\n        public static RateGate RateGate =\n            new RateGate(1, TimeSpan.FromMilliseconds(5000));\n\n        /// <summary>\n        ///     Check if Intrinio API user and password are not empty or null.\n        /// </summary>\n        public static bool IsInitialized => !string.IsNullOrWhiteSpace(User) && !string.IsNullOrWhiteSpace(Password);\n\n        /// <summary>\n        ///     Intrinio API password\n        /// </summary>\n        public static string Password = string.Empty;\n\n        /// <summary>\n        ///     Intrinio API user\n        /// </summary>\n        public static string User = string.Empty;\n\n        /// <summary>\n        /// Sets the time interval between calls.\n        /// For more information, please refer to: https://intrinio.com/documentation/api#limits\n        /// </summary>\n        /// <param name=\"timeSpan\">Time interval between to consecutive calls.</param>\n        /// <remarks>\n        /// Paid subscription has limits of 1 call per second.\n        /// Free subscription has limits of 1 call per minute.\n        /// </remarks>\n        public static void SetTimeIntervalBetweenCalls(TimeSpan timeSpan)\n        {\n            RateGate = new RateGate(1, timeSpan);\n        }\n\n        /// <summary>\n        ///     Set the Intrinio API user and password.\n        /// </summary>\n        public static void SetUserAndPassword(string user, string password)\n        {\n            User = user;\n            Password = password;\n\n            if (!IsInitialized)\n            {\n                throw new InvalidOperationException(\"Please set a valid Intrinio user and password.\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Custom/Intrinio/IntrinioEconomicData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\n\nnamespace QuantConnect.Data.Custom.Intrinio\n{\n    /// <summary>\n    ///     TRanformation available for the Economic data.\n    /// </summary>\n    public enum IntrinioDataTransformation\n    {\n        /// <summary>\n        ///     The rate of change\n        /// </summary>\n        Roc,\n\n        /// <summary>\n        ///     Rate of change from Year Ago\n        /// </summary>\n        AnnualyRoc,\n\n        /// <summary>\n        ///     The compounded annual rate of change\n        /// </summary>\n        CompoundedAnnualRoc,\n\n        /// <summary>\n        ///     The continuously compounded annual rate of change\n        /// </summary>\n        AnnualyCCRoc,\n\n        /// <summary>\n        ///     The continuously compounded rateof change\n        /// </summary>\n        CCRoc,\n\n        /// <summary>\n        ///     The level, no transformation.\n        /// </summary>\n        Level,\n\n        /// <summary>\n        ///     The natural log\n        /// </summary>\n        Ln,\n\n        /// <summary>\n        ///     The percent change\n        /// </summary>\n        Pc,\n\n        /// <summary>\n        ///     The percent change from year ago\n        /// </summary>\n        AnnualyPc\n    }\n\n    /// <summary>\n    ///     Access the massive repository of economic data from the Federal Reserve Economic Data system via the Intrinio API.\n    /// </summary>\n    /// <seealso cref=\"QuantConnect.Data.BaseData\" />\n    public class IntrinioEconomicData : BaseData\n    {\n        private readonly string _baseUrl = @\"https://api.intrinio.com/historical_data.csv?\";\n\n        private readonly IntrinioDataTransformation _dataTransformation;\n\n\n        private bool _backtestingFirstTimeCallOrLiveMode = true;\n\n        /// <summary>\n        ///     Initializes a new instance of the <see cref=\"IntrinioEconomicData\" /> class.\n        /// </summary>\n        public IntrinioEconomicData() : this(IntrinioDataTransformation.Level)\n        {\n        }\n\n        /// <summary>\n        ///     Initializes a new instance of the <see cref=\"IntrinioEconomicData\" /> class.\n        /// </summary>\n        /// <param name=\"dataTransformation\">The item.</param>\n        public IntrinioEconomicData(IntrinioDataTransformation dataTransformation)\n        {\n            _dataTransformation = dataTransformation;\n\n            // If the user and the password is not set then then throw error.\n            if (!IntrinioConfig.IsInitialized)\n            {\n                throw new\n                    InvalidOperationException(\"Please set a valid Intrinio user and password using the 'IntrinioEconomicData.SetUserAndPassword' static method. \" +\n                                              \"For local backtesting, the user and password can be set in the 'parameters' fields from the 'config.json' file.\");\n            }\n        }\n\n\n        /// <summary>\n        ///     Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>\n        ///     String URL of source file.\n        /// </returns>\n        /// <remarks>\n        ///     Given Intrinio's API limits, we cannot make more than one CSV request per second. That's why in backtesting mode\n        ///     we make sure we make just one call to retrieve all the data needed. Also, to avoid the problem of many sources\n        ///     asking the data at the beginning of the algorithm, a pause of a second is added.\n        /// </remarks>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            SubscriptionDataSource subscription;\n\n            // We want to make just one call with all the data in backtesting mode.\n            // Also we want to make one call per second becasue of the API limit.\n            if (_backtestingFirstTimeCallOrLiveMode)\n            {\n                // Force the engine to wait at least 1000 ms between API calls.\n                IntrinioConfig.RateGate.WaitToProceed();\n\n                // In backtesting mode, there is only one call at the beggining with all the data \n                _backtestingFirstTimeCallOrLiveMode = false || isLiveMode;\n                subscription = GetIntrinioSubscription(config, isLiveMode);\n            }\n            else\n            {\n                subscription = new SubscriptionDataSource(\"\", SubscriptionTransportMedium.LocalFile);\n            }\n            return subscription;\n        }\n\n        /// <summary>\n        ///     Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method,\n        ///     and returns a new instance of the object\n        ///     each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>\n        ///     Instance of the T:BaseData object generated by this line of the CSV\n        /// </returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var obs = line.Split(',');\n            var time = DateTime.MinValue;\n            if (!DateTime.TryParseExact(obs[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None,\n                                        out time)) return null;\n            var value = obs[1].ToDecimal();\n            return new IntrinioEconomicData\n            {\n                Symbol = config.Symbol,\n                Time = time,\n                EndTime = time + QuantConnect.Time.OneDay,\n                Value = value\n            };\n        }\n\n        private static string GetStringForDataTransformation(IntrinioDataTransformation dataTransformation)\n        {\n            var item = \"level\";\n            switch (dataTransformation)\n            {\n                case IntrinioDataTransformation.Roc:\n                    item = \"change\";\n                    break;\n                case IntrinioDataTransformation.AnnualyRoc:\n                    item = \"yr_change\";\n                    break;\n                case IntrinioDataTransformation.CompoundedAnnualRoc:\n                    item = \"c_annual_roc\";\n                    break;\n                case IntrinioDataTransformation.AnnualyCCRoc:\n                    item = \"cc_annual_roc\";\n                    break;\n                case IntrinioDataTransformation.CCRoc:\n                    item = \"cc_roc\";\n                    break;\n                case IntrinioDataTransformation.Level:\n                    item = \"level\";\n                    break;\n                case IntrinioDataTransformation.Ln:\n                    item = \"log\";\n                    break;\n                case IntrinioDataTransformation.Pc:\n                    item = \"percent_change\";\n                    break;\n                case IntrinioDataTransformation.AnnualyPc:\n                    item = \"yr_percent_change\";\n                    break;\n            }\n            return item;\n        }\n\n        private SubscriptionDataSource GetIntrinioSubscription(SubscriptionDataConfig config, bool isLiveMode)\n        {\n            // In Live mode, we only want the last observation, in backtesitng we need the data in ascending order.\n            var order = isLiveMode ? \"desc\" : \"asc\";\n            var item = GetStringForDataTransformation(_dataTransformation);\n            var url = $\"{_baseUrl}identifier={config.Symbol.Value}&item={item}&sort_order={order}\";\n            var byteKey = Encoding.ASCII.GetBytes($\"{IntrinioConfig.User}:{IntrinioConfig.Password}\");\n            var authorizationHeaders = new List<KeyValuePair<string, string>>\n            {\n                new KeyValuePair<string, string>(\"Authorization\",\n                                                 $\"Basic ({Convert.ToBase64String(byteKey)})\")\n            };\n\n            return new SubscriptionDataSource(url, SubscriptionTransportMedium.RemoteFile, FileFormat.Csv,\n                                              authorizationHeaders);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Custom/NullData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.DataSource\n{\n    /// <summary>\n    /// Represents a custom data type place holder\n    /// </summary>\n    public class NullData : BaseData\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/Tiingo/Tiingo.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Custom.Tiingo\n{\n    /// <summary>\n    /// Helper class for Tiingo configuration\n    /// </summary>\n    public static class Tiingo\n    {\n        /// <summary>\n        /// Gets the Tiingo API token.\n        /// </summary>\n        public static string AuthCode { get; private set; } = string.Empty;\n\n        /// <summary>\n        /// Returns true if the Tiingo API token has been set.\n        /// </summary>\n        public static bool IsAuthCodeSet { get; private set; }\n\n        /// <summary>\n        /// Sets the Tiingo API token.\n        /// </summary>\n        /// <param name=\"authCode\">The Tiingo API token</param>\n        public static void SetAuthCode(string authCode)\n        {\n            if (string.IsNullOrWhiteSpace(authCode)) return;\n\n            AuthCode = authCode;\n            IsAuthCodeSet = true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/Tiingo/TiingoDailyData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Custom.Tiingo\n{\n    /// <summary>\n    /// Tiingo daily price data\n    /// https://api.tiingo.com/docs/tiingo/daily\n    /// </summary>\n    /// <remarks>Requires setting <see cref=\"Tiingo.AuthCode\"/></remarks>\n    [Obsolete(\"This is kept for backwards compatibility, please use TiingoPrice\")]\n    public class TiingoDailyData : TiingoPrice\n    {\n\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/Tiingo/TiingoPrice.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Custom.Tiingo\n{\n    /// <summary>\n    /// Tiingo daily price data\n    /// https://api.tiingo.com/docs/tiingo/daily\n    /// </summary>\n    /// <remarks>Requires setting <see cref=\"Tiingo.AuthCode\"/></remarks>\n    public class TiingoPrice : TradeBar\n    {\n        private readonly ConcurrentDictionary<string, DateTime> _startDates = new ConcurrentDictionary<string, DateTime>();\n\n        /// <summary>\n        /// The end time of this data. Some data covers spans (trade bars) and as such we want\n        /// to know the entire time span covered\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get { return Time + Period; }\n            set { Time = value - Period; }\n        }\n\n        /// <summary>\n        /// The period of this trade bar, (second, minute, daily, ect...)\n        /// </summary>\n        public override TimeSpan Period => QuantConnect.Time.OneDay;\n\n        /// <summary>\n        /// The date this data pertains to\n        /// </summary>\n        [JsonProperty(\"date\")]\n        public DateTime Date { get; set; }\n\n        /// <summary>\n        /// The actual (not adjusted) open price of the asset on the specific date\n        /// </summary>\n        [JsonProperty(\"open\")]\n        public override decimal Open { get; set; }\n\n        /// <summary>\n        /// The actual (not adjusted) high price of the asset on the specific date\n        /// </summary>\n        [JsonProperty(\"high\")]\n        public override decimal High { get; set; }\n\n        /// <summary>\n        /// The actual (not adjusted) low price of the asset on the specific date\n        /// </summary>\n        [JsonProperty(\"low\")]\n        public override decimal Low { get; set; }\n\n        /// <summary>\n        /// The actual (not adjusted) closing price of the asset on the specific date\n        /// </summary>\n        [JsonProperty(\"close\")]\n        public override decimal Close { get; set; }\n\n        /// <summary>\n        /// The actual (not adjusted) number of shares traded during the day\n        /// </summary>\n        [JsonProperty(\"volume\")]\n        public override decimal Volume { get; set; }\n\n        /// <summary>\n        /// The adjusted opening price of the asset on the specific date. Returns null if not available.\n        /// </summary>\n        [JsonProperty(\"adjOpen\")]\n        public decimal AdjustedOpen { get; set; }\n\n        /// <summary>\n        /// The adjusted high price of the asset on the specific date. Returns null if not available.\n        /// </summary>\n        [JsonProperty(\"adjHigh\")]\n        public decimal AdjustedHigh { get; set; }\n\n        /// <summary>\n        /// The adjusted low price of the asset on the specific date. Returns null if not available.\n        /// </summary>\n        [JsonProperty(\"adjLow\")]\n        public decimal AdjustedLow { get; set; }\n\n        /// <summary>\n        /// The adjusted close price of the asset on the specific date. Returns null if not available.\n        /// </summary>\n        [JsonProperty(\"adjClose\")]\n        public decimal AdjustedClose { get; set; }\n\n        /// <summary>\n        /// The adjusted number of shares traded during the day - adjusted for splits. Returns null if not available\n        /// </summary>\n        [JsonProperty(\"adjVolume\")]\n        public long AdjustedVolume { get; set; }\n\n        /// <summary>\n        /// The dividend paid out on \"date\" (note that \"date\" will be the \"exDate\" for the dividend)\n        /// </summary>\n        [JsonProperty(\"divCash\")]\n        public decimal Dividend { get; set; }\n\n        /// <summary>\n        /// A factor used when a company splits or reverse splits. On days where there is ONLY a split (no dividend payment),\n        /// you can calculate the adjusted close as follows: adjClose = \"Previous Close\"/splitFactor\n        /// </summary>\n        [JsonProperty(\"splitFactor\")]\n        public decimal SplitFactor { get; set; }\n\n        /// <summary>\n        /// Initializes an instance of the <see cref=\"TiingoPrice\"/> class.\n        /// </summary>\n        public TiingoPrice()\n        {\n            Symbol = Symbol.Empty;\n            DataType = MarketDataType.Base;\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            DateTime startDate;\n            if (!_startDates.TryGetValue(config.Symbol.Value, out startDate))\n            {\n                startDate = date;\n                _startDates.TryAdd(config.Symbol.Value, startDate);\n            }\n\n            var tiingoTicker = TiingoSymbolMapper.GetTiingoTicker(config.Symbol);\n            var source = Invariant($\"https://api.tiingo.com/tiingo/daily/{tiingoTicker}/prices?startDate={startDate:yyyy-MM-dd}&token={Tiingo.AuthCode}\");\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile, FileFormat.UnfoldingCollection);\n        }\n\n        /// <summary>\n        ///     Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method,\n        ///     and returns a new instance of the object\n        ///     each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Content of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>\n        ///     Instance of the T:BaseData object generated by this line of the CSV\n        /// </returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var list = JsonConvert.DeserializeObject<List<TiingoPrice>>(line);\n\n            foreach (var item in list)\n            {\n                item.Symbol = config.Symbol;\n                item.Time = item.Date;\n                item.Value = item.Close;\n            }\n\n            return new BaseDataCollection(date, config.Symbol, list);\n        }\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <returns>True indicates mapping should be used</returns>\n        public override bool RequiresMapping()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Specifies the data time zone for this data type. This is useful for custom data types\n        /// </summary>\n        /// <returns>The <see cref=\"DateTimeZone\"/> of this data type</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets the supported resolution for this data and security type\n        /// </summary>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Custom/Tiingo/TiingoSymbolMapper.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Custom.Tiingo\n{\n    /// <summary>\n    /// Helper class to map a Lean format ticker to Tiingo format\n    /// </summary>\n    /// <remarks>To be used when performing direct queries to Tiingo API</remarks>\n    /// <remarks>https://api.tiingo.com/documentation/appendix/symbology</remarks>\n    public static class TiingoSymbolMapper\n    {\n        /// <summary>\n        /// Maps a given <see cref=\"Symbol\"/> instance to it's Tiingo equivalent\n        /// </summary>\n        public static string GetTiingoTicker(Symbol symbol)\n        {\n            return symbol.Value.Replace(\".\", \"-\");\n        }\n\n        /// <summary>\n        /// Maps a given Tiingo ticker to Lean equivalent\n        /// </summary>\n        public static string GetLeanTicker(string ticker)\n        {\n            return ticker.Replace(\"-\", \".\");\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DataAggregatorInitializeParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// The <see cref=\"IDataAggregator\"/> parameters initialize dto\n    /// </summary>\n    public class DataAggregatorInitializeParameters\n    {\n        /// <summary>\n        /// The algorithm settings instance to use\n        /// </summary>\n        public IAlgorithmSettings AlgorithmSettings { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DataHistory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Text;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Historical data abstraction\n    /// </summary>\n    /// <typeparam name=\"T\">The data this collection can enumerate</typeparam>\n    public class DataHistory<T> : IEnumerable<T>\n    {\n        private readonly Lazy<int> _count;\n        private readonly Lazy<PyObject> _dataframe;\n\n        /// <summary>\n        /// The data we hold\n        /// </summary>\n        protected IEnumerable<T> Data { get; }\n\n        /// <summary>\n        /// The current data point count\n        /// </summary>\n        public int Count => _count.Value;\n\n        /// <summary>\n        /// This data pandas data frame\n        /// </summary>\n        public PyObject DataFrame => _dataframe.Value;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public DataHistory(IEnumerable<T> data, Lazy<PyObject> dataframe)\n        {\n            Data = data.Memoize();\n            _dataframe = dataframe;\n            // let's be lazy\n            _count = new(() => Data.Count());\n        }\n\n        /// <summary>\n        /// Default to string implementation\n        /// </summary>\n        public override string ToString()\n        {\n            var builder = new StringBuilder();\n            foreach (var dataPoint in Data)\n            {\n                builder.AppendLine(dataPoint.ToString());\n            }\n            return builder.ToString();\n        }\n\n        /// <summary>\n        /// Returns an enumerator for the data\n        /// </summary>\n        public IEnumerator<T> GetEnumerator()\n        {\n            return Data.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DataMonitor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Monitors data requests and reports on missing data\n    /// </summary>\n    public class DataMonitor : IDataMonitor\n    {\n        private bool _exited;\n\n        private TextWriter _succeededDataRequestsWriter;\n        private TextWriter _failedDataRequestsWriter;\n\n        private long _succeededDataRequestsCount;\n        private long _failedDataRequestsCount;\n\n        private long _succeededUniverseDataRequestsCount;\n        private long _failedUniverseDataRequestsCount;\n\n        private readonly List<double> _requestRates = new();\n        private long _prevRequestsCount;\n        private DateTime _lastRequestRateCalculationTime;\n\n        private Thread _requestRateCalculationThread;\n        private CancellationTokenSource _cancellationTokenSource;\n\n        private readonly string _succeededDataRequestsFileName;\n        private readonly string _failedDataRequestsFileName;\n        private readonly string _resultsDestinationFolder;\n\n        private readonly object _threadLock = new();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataMonitor\"/> class\n        /// </summary>\n        public DataMonitor()\n        {\n            _resultsDestinationFolder = Globals.ResultsDestinationFolder;\n            _succeededDataRequestsFileName = GetFilePath(\"succeeded-data-requests.txt\");\n            _failedDataRequestsFileName = GetFilePath(\"failed-data-requests.txt\");\n        }\n\n        /// <summary>\n        /// Event handler for the <see cref=\"IDataProvider.NewDataRequest\"/> event\n        /// </summary>\n        public void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs e)\n        {\n            if (_exited)\n            {\n                return;\n            }\n\n            Initialize();\n\n            if (e.Path.Contains(\"map_files\", StringComparison.OrdinalIgnoreCase) ||\n                e.Path.Contains(\"factor_files\", StringComparison.OrdinalIgnoreCase))\n            {\n                return;\n            }\n\n            var path = StripDataFolder(e.Path);\n            var isUniverseData = path.Contains(\"coarse\", StringComparison.OrdinalIgnoreCase) ||\n                path.Contains(\"universe\", StringComparison.OrdinalIgnoreCase);\n\n            if (e.Succeeded)\n            {\n                WriteLineToFile(_succeededDataRequestsWriter, path, _succeededDataRequestsFileName);\n                Interlocked.Increment(ref _succeededDataRequestsCount);\n                if (isUniverseData)\n                {\n                    Interlocked.Increment(ref _succeededUniverseDataRequestsCount);\n                }\n            }\n            else\n            {\n                WriteLineToFile(_failedDataRequestsWriter, path, _failedDataRequestsFileName);\n                Interlocked.Increment(ref _failedDataRequestsCount);\n                if (isUniverseData)\n                {\n                    Interlocked.Increment(ref _failedUniverseDataRequestsCount);\n                }\n\n                if (Logging.Log.DebuggingEnabled)\n                {\n                    Logging.Log.Debug($\"DataMonitor.OnNewDataRequest(): Data from {path} could not be fetched, error: {e.ErrorMessage}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Terminates the data monitor generating a final report\n        /// </summary>\n        public void Exit()\n        {\n            if (_exited || _requestRateCalculationThread == null)\n            {\n                return;\n            }\n            _exited = true;\n            Log.Trace(\"DataMonitor.Exit(): start...\");\n\n            _requestRateCalculationThread.StopSafely(TimeSpan.FromSeconds(5), _cancellationTokenSource);\n            _succeededDataRequestsWriter?.Close();\n            _failedDataRequestsWriter?.Close();\n\n            StoreDataMonitorReport(GenerateReport());\n\n            _succeededDataRequestsWriter.DisposeSafely();\n            _failedDataRequestsWriter.DisposeSafely();\n            _cancellationTokenSource.DisposeSafely();\n            Log.Trace(\"DataMonitor.Exit(): end\");\n        }\n\n        /// <summary>\n        /// Disposes this object\n        /// </summary>\n        public void Dispose()\n        {\n            Exit();\n        }\n\n        /// <summary>\n        /// Strips the given data folder path\n        /// </summary>\n        protected virtual string StripDataFolder(string path)\n        {\n            if (path.StartsWith(Globals.DataFolder, StringComparison.OrdinalIgnoreCase))\n            {\n                return path.Substring(Globals.DataFolder.Length);\n            }\n\n            return path;\n        }\n\n        /// <summary>\n        /// Initializes the <see cref=\"DataMonitor\"/> instance\n        /// </summary>\n        private void Initialize()\n        {\n            if (_requestRateCalculationThread != null)\n            {\n                return;\n            }\n            lock (_threadLock)\n            {\n                if (_requestRateCalculationThread != null)\n                {\n                    return;\n                }\n                // we create the files on demand\n                _succeededDataRequestsWriter = OpenStream(_succeededDataRequestsFileName);\n                _failedDataRequestsWriter = OpenStream(_failedDataRequestsFileName);\n\n                _cancellationTokenSource = new CancellationTokenSource();\n\n                _requestRateCalculationThread = new Thread(() =>\n                {\n                    while (!_cancellationTokenSource.Token.WaitHandle.WaitOne(3000))\n                    {\n                        ComputeFileRequestFrequency();\n                    }\n                })\n                { IsBackground = true };\n                _requestRateCalculationThread.Start();\n            }\n        }\n\n        private DataMonitorReport GenerateReport()\n        {\n            var report = new DataMonitorReport(_succeededDataRequestsCount,\n                _failedDataRequestsCount,\n                _succeededUniverseDataRequestsCount,\n                _failedUniverseDataRequestsCount,\n                _requestRates);\n\n            Logging.Log.Trace($\"DataMonitor.GenerateReport():{Environment.NewLine}\" +\n                $\"DATA USAGE:: Total data requests {report.TotalRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Succeeded data requests {report.SucceededDataRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Failed data requests {report.FailedDataRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Failed data requests percentage {report.FailedDataRequestsPercentage}%{Environment.NewLine}\" +\n                $\"DATA USAGE:: Total universe data requests {report.TotalUniverseDataRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Succeeded universe data requests {report.SucceededUniverseDataRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Failed universe data requests {report.FailedUniverseDataRequestsCount}{Environment.NewLine}\" +\n                $\"DATA USAGE:: Failed universe data requests percentage {report.FailedUniverseDataRequestsPercentage}%\");\n\n            return report;\n        }\n\n        private void ComputeFileRequestFrequency()\n        {\n            var requestsCount = _succeededDataRequestsCount + _failedDataRequestsCount;\n\n            if (_lastRequestRateCalculationTime == default)\n            {\n                // First time we calculate the request rate.\n                // We don't have a previous value to compare to so we just store the current value.\n                _lastRequestRateCalculationTime = DateTime.UtcNow;\n                _prevRequestsCount = requestsCount;\n                return;\n            }\n\n            var requestsCountDelta = requestsCount - _prevRequestsCount;\n            var now = DateTime.UtcNow;\n            var timeDelta = now - _lastRequestRateCalculationTime;\n\n            _requestRates.Add(Math.Round(requestsCountDelta / timeDelta.TotalSeconds));\n            _prevRequestsCount = requestsCount;\n            _lastRequestRateCalculationTime = now;\n        }\n\n        /// <summary>\n        /// Stores the data monitor report\n        /// </summary>\n        /// <param name=\"report\">The data monitor report to be stored</param>\n        private void StoreDataMonitorReport(DataMonitorReport report)\n        {\n            if (report == null)\n            {\n                return;\n            }\n\n            var path = GetFilePath(\"data-monitor-report.json\");\n            var data = JsonConvert.SerializeObject(report, Formatting.None);\n            File.WriteAllText(path, data);\n        }\n\n        private string GetFilePath(string filename)\n        {\n            var baseFilename = Path.GetFileNameWithoutExtension(filename);\n            var timestamp = DateTime.UtcNow.ToStringInvariant(\"yyyyMMddHHmmssfff\");\n            var extension = Path.GetExtension(filename);\n            return Path.Combine(_resultsDestinationFolder, $\"{baseFilename}-{timestamp}{extension}\");\n        }\n\n        private static TextWriter OpenStream(string filename)\n        {\n            var writer = new StreamWriter(filename);\n            return TextWriter.Synchronized(writer);\n        }\n\n        private static void WriteLineToFile(TextWriter writer, string line, string filename)\n        {\n            try\n            {\n                writer.WriteLine(line);\n            }\n            catch (IOException exception)\n            {\n                Logging.Log.Error($\"DataMonitor.OnNewDataRequest(): Failed to write to file {filename}: {exception.Message}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DataQueueHandlerSubscriptionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Count number of subscribers for each channel (Symbol, Socket) pair\n    /// </summary>\n    public abstract class DataQueueHandlerSubscriptionManager : IDisposable\n    {\n        /// <summary>\n        /// Counter\n        /// </summary>\n        protected ConcurrentDictionary<Channel, int> SubscribersByChannel { get; init; } = new ConcurrentDictionary<Channel, int>();\n\n        /// <summary>\n        /// Increment number of subscribers for current <see cref=\"TickType\"/>\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the subscription configuration data.</param>        \n        public virtual void Subscribe(SubscriptionDataConfig dataConfig)\n        {\n            try\n            {\n                var channel = GetChannel(dataConfig);\n                int count;\n                if (SubscribersByChannel.TryGetValue(channel, out count))\n                {\n                    SubscribersByChannel.TryUpdate(channel, count + 1, count);\n                    return;\n                }\n\n                if (Subscribe(new[] { dataConfig.Symbol }, dataConfig.TickType))\n                {\n                    SubscribersByChannel.AddOrUpdate(channel, 1);\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Decrement number of subscribers for current <see cref=\"TickType\"/>\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the subscription configuration data.</param> \n        public void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            try\n            {\n                var channel = GetChannel(dataConfig);\n                int count;\n                if (SubscribersByChannel.TryGetValue(channel, out count))\n                {\n                    if (count > 1)\n                    {\n                        SubscribersByChannel.TryUpdate(channel, count - 1, count);\n                        return;\n                    }\n\n                    if (Unsubscribe(new[] { dataConfig.Symbol }, dataConfig.TickType))\n                    {\n                        SubscribersByChannel.TryRemove(channel, out count);\n                    }\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Returns subscribed symbols\n        /// </summary>\n        /// <returns>list of <see cref=\"Symbol\"/> currently subscribed</returns>\n        public IEnumerable<Symbol> GetSubscribedSymbols()\n        {\n            return SubscribersByChannel.Keys\n                .Select(c => c.Symbol)\n                .Distinct();\n        }\n\n        /// <summary>\n        /// Retrieves the list of unique <see cref=\"Symbol\"/> instances that are currently subscribed for a specific <see cref=\"TickType\"/>.\n        /// </summary>\n        /// <param name=\"tickType\">The type of tick data to filter subscriptions by.</param>\n        /// <returns>A collection of unique <see cref=\"Symbol\"/> objects that match the specified <paramref name=\"tickType\"/>.</returns>\n        public IEnumerable<Symbol> GetSubscribedSymbols(TickType tickType)\n        {\n            var channelName = ChannelNameFromTickType(tickType);\n#pragma warning disable CA1309\n            return SubscribersByChannel.Keys.Where(x => x.Name.Equals(channelName, StringComparison.InvariantCultureIgnoreCase))\n#pragma warning restore CA1309\n                .Select(c => c.Symbol)\n                .Distinct();\n        }\n\n        /// <summary>\n        /// Checks if there is existing subscriber for current channel\n        /// </summary>\n        /// <param name=\"symbol\">Symbol</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns>return true if there is one subscriber at least; otherwise false</returns>\n        public bool IsSubscribed(Symbol symbol, TickType tickType)\n        {\n            return SubscribersByChannel.ContainsKey(GetChannel(\n                symbol,\n                tickType));\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public virtual void Dispose()\n        {\n        }\n\n        /// <summary>\n        /// Describes the way <see cref=\"IDataQueueHandler\"/> implements subscription\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to subscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns>Returns true if subsribed; otherwise false</returns>\n        protected abstract bool Subscribe(IEnumerable<Symbol> symbols, TickType tickType);\n\n        /// <summary>\n        /// Describes the way <see cref=\"IDataQueueHandler\"/> implements unsubscription\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to unsubscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns>Returns true if unsubsribed; otherwise false</returns>\n        protected abstract bool Unsubscribe(IEnumerable<Symbol> symbols, TickType tickType);\n\n        /// <summary>\n        /// Brokerage maps <see cref=\"TickType\"/> to real socket/api channel\n        /// </summary>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns></returns>\n        protected abstract string ChannelNameFromTickType(TickType tickType);\n\n        private Channel GetChannel(SubscriptionDataConfig dataConfig) => GetChannel(dataConfig.Symbol, dataConfig.TickType);\n\n        private Channel GetChannel(Symbol symbol, TickType tickType)\n        {\n            return new Channel(\n                ChannelNameFromTickType(tickType),\n                symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DiskDataCacheProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing Ionic.Zip;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Simple data cache provider, writes and reads directly from disk\n    /// Used as default for <see cref=\"LeanDataWriter\"/>\n    /// </summary>\n    public class DiskDataCacheProvider : IDataCacheProvider\n    {\n        private readonly KeyStringSynchronizer _synchronizer;\n\n        /// <summary>\n        /// Property indicating the data is temporary in nature and should not be cached.\n        /// </summary>\n        public bool IsDataEphemeral => false;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public DiskDataCacheProvider() : this(new KeyStringSynchronizer())\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance using the given synchronizer\n        /// </summary>\n        /// <param name=\"locker\">The synchronizer instance to use</param>\n        public DiskDataCacheProvider(KeyStringSynchronizer locker)\n        {\n            _synchronizer = locker;\n        }\n\n        /// <summary>\n        /// Fetch data from the cache\n        /// </summary>\n        /// <param name=\"key\">A string representing the key of the cached data</param>\n        /// <returns>An <see cref=\"Stream\"/> of the cached data</returns>\n        public Stream Fetch(string key)\n        {\n            LeanData.ParseKey(key, out var filePath, out var entryName);\n\n            return _synchronizer.Execute(filePath, () =>\n            {\n                if (!File.Exists(filePath))\n                {\n                    return null;\n                }\n\n                try\n                {\n                    using (var zip = ZipFile.Read(filePath))\n                    {\n                        ZipEntry entry;\n                        if (entryName.IsNullOrEmpty())\n                        {\n                            // Return the first entry\n                            entry = zip[0];\n                        }\n                        else\n                        {\n                            // Attempt to find our specific entry\n                            if (!zip.ContainsEntry(entryName))\n                            {\n                                return null;\n                            }\n\n                            entry = zip[entryName];\n                        }\n\n                        // Extract our entry and return it\n                        var stream = new MemoryStream();\n                        entry.Extract(stream);\n                        stream.Position = 0;\n                        return stream;\n                    }\n                }\n                catch (ZipException exception)\n                {\n                    Log.Error(\"DiskDataCacheProvider.Fetch(): Corrupt file: \" + key + \" Error: \" + exception);\n                    return null;\n                }\n            });\n        }\n\n        /// <summary>\n        /// Store the data in the cache. Not implemented in this instance of the IDataCacheProvider\n        /// </summary>\n        /// <param name=\"key\">The source of the data, used as a key to retrieve data in the cache</param>\n        /// <param name=\"data\">The data as a byte array</param>\n        public void Store(string key, byte[] data)\n        {\n            LeanData.ParseKey(key, out var filePath, out var entryName);\n\n            _synchronizer.Execute(filePath, singleExecution: false, () =>\n            {\n                Compression.ZipCreateAppendData(filePath, entryName, data, true);\n            });\n        }\n\n        /// <summary>\n        /// Returns a list of zip entries in a provided zip file\n        /// </summary>\n        public List<string> GetZipEntries(string zipFile)\n        {\n            return _synchronizer.Execute(zipFile, () =>\n            {\n                using var stream = new FileStream(FileExtension.ToNormalizedPath(zipFile), FileMode.Open, FileAccess.Read);\n                return Compression.GetZipEntryFileNames(stream).ToList();\n            });\n        }\n\n        /// <summary>\n        /// Dispose for this class\n        /// </summary>\n        public void Dispose()\n        {\n            //NOP\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DividendYieldProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Estimated annualized continuous dividend yield at given date\n    /// </summary>\n    public class DividendYieldProvider : IDividendYieldModel\n    {\n        private static MarketHoursDatabase _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n        /// <summary>\n        /// The default symbol to use as a dividend yield provider\n        /// </summary>\n        /// <remarks>This is useful for index and future options which do not have an underlying that yields dividends.\n        /// Defaults to SPY</remarks>\n        public static Symbol DefaultSymbol { get; set; } = Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA);\n\n        /// <summary>\n        /// The dividends by symbol\n        /// </summary>\n        protected static Dictionary<Symbol, List<BaseData>> _corporateEventsCache;\n\n        /// <summary>\n        /// Task to clear the cache\n        /// </summary>\n        protected static Task _cacheClearTask;\n        private static readonly object _lock = new();\n\n        private readonly Symbol _symbol;\n        private readonly SecurityExchangeHours _exchangeHours;\n\n        /// <summary>\n        /// Default no dividend payout\n        /// </summary>\n        public static readonly decimal DefaultDividendYieldRate = 0.0m;\n\n        /// <summary>\n        /// The cached refresh period for the dividend yield rate\n        /// </summary>\n        /// <remarks>Exposed for testing</remarks>\n        protected virtual TimeSpan CacheRefreshPeriod\n        {\n            get\n            {\n                var dueTime = Time.GetNextLiveAuxiliaryDataDueTime();\n                if (dueTime > TimeSpan.FromMinutes(10))\n                {\n                    // Clear the cache before the auxiliary due time to avoid race conditions with consumers\n                    return dueTime - TimeSpan.FromMinutes(10);\n                }\n                return dueTime;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance using the default symbol\n        /// </summary>\n        public DividendYieldProvider() : this(DefaultSymbol)\n        {\n        }\n\n        /// <summary>\n        /// Instantiates a <see cref=\"DividendYieldProvider\"/> with the specified Symbol\n        /// </summary>\n        public DividendYieldProvider(Symbol symbol)\n        {\n            _symbol = symbol;\n            _exchangeHours = _marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n\n            if (_cacheClearTask == null)\n            {\n                lock (_lock)\n                {\n                    // only the first triggers the expiration task check\n                    if (_cacheClearTask == null)\n                    {\n                        StartExpirationTask(CacheRefreshPeriod);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given option symbol\n        /// </summary>\n        public static IDividendYieldModel CreateForOption(Symbol optionSymbol)\n        {\n            if (optionSymbol.SecurityType == SecurityType.Option)\n            {\n                return new DividendYieldProvider(optionSymbol.Underlying);\n            }\n\n            if (optionSymbol.SecurityType == SecurityType.IndexOption)\n            {\n                return optionSymbol.Value switch\n                {\n                    \"SPX\" => new DividendYieldProvider(Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA)),\n                    \"NDX\" => new DividendYieldProvider(Symbol.Create(\"QQQ\", SecurityType.Equity, QuantConnect.Market.USA)),\n                    \"VIX\" => new ConstantDividendYieldModel(0),\n                    _ => new DividendYieldProvider()\n                };\n            }\n\n            return new ConstantDividendYieldModel(0);\n        }\n\n        /// <summary>\n        /// Helper method that will clear any cached dividend rate in a daily basis, this is useful for live trading\n        /// </summary>\n        private static void StartExpirationTask(TimeSpan cacheRefreshPeriod)\n        {\n            lock (_lock)\n            {\n                // we clear the dividend yield rate cache so they are reloaded\n                _corporateEventsCache = new();\n            }\n            _cacheClearTask = Task.Delay(cacheRefreshPeriod).ContinueWith(_ => StartExpirationTask(cacheRefreshPeriod));\n        }\n\n        /// <summary>\n        /// Get dividend yield by a given date of a given symbol.\n        /// It will get the dividend yield at the time of the most recent dividend since no price is provided.\n        /// In order to get more accurate dividend yield, provide the security price at the given date to\n        /// the <see cref=\"GetDividendYield(DateTime, decimal)\"/> or <see cref=\"GetDividendYield(IBaseData)\"/> methods.\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        public decimal GetDividendYield(DateTime date)\n        {\n            return GetDividendYieldImpl(date, null);\n        }\n\n        /// <summary>\n        /// Gets the dividend yield at the date of the specified data, using the data price as the security price\n        /// </summary>\n        /// <param name=\"priceData\">Price data instance</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        /// <remarks>Price data must be raw (<see cref=\"DataNormalizationMode.Raw\"/>)</remarks>\n        public decimal GetDividendYield(IBaseData priceData)\n        {\n            if (priceData.Symbol != _symbol)\n            {\n                throw new ArgumentException($\"Trying to get {priceData.Symbol} dividend yield using the {_symbol} dividend yield provider.\");\n            }\n\n            return GetDividendYield(priceData.EndTime, priceData.Value);\n        }\n\n        /// <summary>\n        /// Get dividend yield at given date and security price\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"securityPrice\">The security price at the given date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        /// <remarks>Price data must be raw (<see cref=\"DataNormalizationMode.Raw\"/>)</remarks>\n        public decimal GetDividendYield(DateTime date, decimal securityPrice)\n        {\n            return GetDividendYieldImpl(date, securityPrice);\n        }\n\n        /// <summary>\n        /// Get dividend yield at given date and security price.\n        /// </summary>\n        /// <remarks>\n        /// <paramref name=\"securityPrice\"/> is nullable for backwards compatibility, so <see cref=\"GetDividendYield(DateTime)\"/> is usable.\n        /// If dividend yield is requested at a given date without a price, the dividend yield at the time of the most recent dividend is returned.\n        /// Price data must be raw (<see cref=\"DataNormalizationMode.Raw\"/>).\n        /// </remarks>\n        private decimal GetDividendYieldImpl(DateTime date, decimal? securityPrice)\n        {\n            List<BaseData> symbolCorporateEvents;\n            lock (_lock)\n            {\n                if (!_corporateEventsCache.TryGetValue(_symbol, out symbolCorporateEvents))\n                {\n                    // load the symbol factor if it is the first encounter\n                    symbolCorporateEvents = _corporateEventsCache[_symbol] = LoadCorporateEvents(_symbol);\n                }\n            }\n\n            if (symbolCorporateEvents == null)\n            {\n                return DefaultDividendYieldRate;\n            }\n\n            // We need both corporate event types, so we get the most recent one, either dividend or split\n            var mostRecentCorporateEventIndex = symbolCorporateEvents.FindLastIndex(x => x.EndTime <= date.Date);\n            if (mostRecentCorporateEventIndex == -1)\n            {\n                return DefaultDividendYieldRate;\n            }\n\n            // Now we get the most recent dividend in order to get the end of the trailing twelve months period for the dividend yield\n            var mostRecentCorporateEvent = symbolCorporateEvents[mostRecentCorporateEventIndex];\n            var mostRecentDividend = mostRecentCorporateEvent as Dividend;\n            if (mostRecentDividend == null)\n            {\n                for (var i = mostRecentCorporateEventIndex - 1; i >= 0; i--)\n                {\n                    if (symbolCorporateEvents[i] is Dividend dividend)\n                    {\n                        mostRecentDividend = dividend;\n                        break;\n                    }\n                }\n            }\n\n            // If there is no dividend in the past year, we return the default dividend yield rate\n            if (mostRecentDividend == null)\n            {\n                return DefaultDividendYieldRate;\n            }\n\n            securityPrice ??= mostRecentDividend.ReferencePrice;\n            if (securityPrice == 0)\n            {\n                throw new ArgumentException(\"Security price cannot be zero.\");\n            }\n\n            // The dividend yield is the sum of the dividends in the past year (ending in the most recent dividend date,\n            // not on the price quote date) divided by the last close price:\n\n            // 15 days window from 1y to avoid overestimation from last year value\n            var trailingYearStartDate = mostRecentDividend.EndTime.AddDays(-350);\n\n            var yearlyDividend = 0m;\n            var currentSplitFactor = 1m;\n            for (var i = mostRecentCorporateEventIndex; i >= 0; i--)\n            {\n                var corporateEvent = symbolCorporateEvents[i];\n                if (corporateEvent.EndTime < trailingYearStartDate)\n                {\n                    break;\n                }\n\n                if (corporateEvent is Dividend dividend)\n                {\n                    yearlyDividend += dividend.Distribution * currentSplitFactor;\n                }\n                else\n                {\n                    // Update the split factor to adjust the dividend value per share\n                    currentSplitFactor *= ((Split)corporateEvent).SplitFactor;\n                }\n            }\n\n            return yearlyDividend / securityPrice.Value;\n        }\n\n        /// <summary>\n        /// Generate the corporate events from the corporate factor file for the specified symbol\n        /// </summary>\n        /// <remarks>Exposed for testing</remarks>\n        protected virtual List<BaseData> LoadCorporateEvents(Symbol symbol)\n        {\n            var factorFileProvider = Composer.Instance.GetPart<IFactorFileProvider>();\n            var corporateFactors = factorFileProvider\n                .Get(symbol)\n                .Select(factorRow => factorRow as CorporateFactorRow)\n                .Where(corporateFactor => corporateFactor != null);\n\n            var symbolCorporateEvents = FromCorporateFactorRows(corporateFactors, symbol).ToList();\n            if (symbolCorporateEvents.Count == 0)\n            {\n                return null;\n            }\n\n            return symbolCorporateEvents;\n        }\n\n        /// <summary>\n        /// Generates the splits and dividends from the corporate factor rows\n        /// </summary>\n        private IEnumerable<BaseData> FromCorporateFactorRows(IEnumerable<CorporateFactorRow> corporateFactors, Symbol symbol)\n        {\n            var dividends = new List<Dividend>();\n\n            // Get all dividends from the corporate actions\n            var rows = corporateFactors.OrderBy(corporateFactor => corporateFactor.Date).ToArray();\n            for (var i = 0; i < rows.Length - 1; i++)\n            {\n                var row = rows[i];\n                var nextRow = rows[i + 1];\n                if (row.PriceFactor != nextRow.PriceFactor)\n                {\n                    yield return row.GetDividend(nextRow, symbol, _exchangeHours, decimalPlaces: 3);\n                }\n                else\n                {\n                    yield return row.GetSplit(nextRow, symbol, _exchangeHours);\n                }\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DownloaderExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\nusing NodaTime;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Contains extension methods for the Downloader functionality.\n    /// </summary>\n    public static class DownloaderExtensions\n    {\n        /// <summary>\n        /// Get <see cref=\"DataDownloaderGetParameters\"/> for all mapped <seealso cref=\"Symbol\"/> with appropriate ticker name in specific date time range.\n        /// </summary>\n        /// <param name=\"dataDownloaderParameter\">Generated class in \"Lean.Engine.DataFeeds.DownloaderDataProvider\"</param>\n        /// <param name=\"mapFileProvider\">Provides instances of <see cref=\"MapFileResolver\"/> at run time</param>\n        /// <param name=\"exchangeTimeZone\">Provides the time zone this exchange</param>\n        /// <returns>\n        /// Return DataDownloaderGetParameters with different\n        /// <see cref=\"DataDownloaderGetParameters.StartUtc\"/> - <seealso cref=\"DataDownloaderGetParameters.EndUtc\"/> range\n        /// and <seealso cref=\"Symbol\"/>\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"dataDownloaderParameter\"/> is null.</exception>\n        public static IEnumerable<DataDownloaderGetParameters> GetDataDownloaderParameterForAllMappedSymbols(\n            this DataDownloaderGetParameters dataDownloaderParameter,\n            IMapFileProvider mapFileProvider,\n            DateTimeZone exchangeTimeZone)\n        {\n            if (dataDownloaderParameter == null)\n            {\n                throw new ArgumentNullException(nameof(dataDownloaderParameter));\n            }\n\n            if (dataDownloaderParameter.Symbol.SecurityType != SecurityType.Future\n                && dataDownloaderParameter.Symbol.RequiresMapping()\n                && dataDownloaderParameter.Resolution >= Resolution.Hour)\n            {\n                var yieldMappedSymbol = default(bool);\n                foreach (var symbolDateRange in mapFileProvider.RetrieveAllMappedSymbolInDateRange(dataDownloaderParameter.Symbol))\n                {\n                    var startDateTimeUtc = symbolDateRange.StartDateTimeLocal.ConvertToUtc(exchangeTimeZone);\n                    var endDateTimeUtc = symbolDateRange.EndDateTimeLocal.ConvertToUtc(exchangeTimeZone);\n\n                    // The first start date returns from mapFile like IPO (DateTime) and can not be greater then request StartTime\n                    // The Downloader doesn't know start DateTime exactly, it always download all data, except for options and index options\n                    if (dataDownloaderParameter.Symbol.SecurityType == SecurityType.Option ||\n                        dataDownloaderParameter.Symbol.SecurityType == SecurityType.IndexOption)\n                    {\n                        // The symbol was delisted before the request start time\n                        if (endDateTimeUtc < dataDownloaderParameter.StartUtc)\n                        {\n                            continue;\n                        }\n\n                        if (startDateTimeUtc < dataDownloaderParameter.StartUtc)\n                        {\n                            startDateTimeUtc = dataDownloaderParameter.StartUtc;\n                        }\n                    }\n\n                    if (endDateTimeUtc > dataDownloaderParameter.EndUtc)\n                    {\n                        endDateTimeUtc = dataDownloaderParameter.EndUtc;\n                    }\n\n                    yield return new DataDownloaderGetParameters(\n                        symbolDateRange.Symbol, dataDownloaderParameter.Resolution, startDateTimeUtc, endDateTimeUtc, dataDownloaderParameter.TickType);\n                    yieldMappedSymbol = true;\n                }\n\n                if (!yieldMappedSymbol)\n                {\n                    yield return dataDownloaderParameter;\n                }\n            }\n            else\n            {\n                yield return dataDownloaderParameter;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/DynamicData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Dynamic Data Class: Accept flexible data, adapting to the columns provided by source.\n    /// </summary>\n    /// <remarks>Intended for use with Quandl class.</remarks>\n    public abstract class DynamicData : BaseData, IDynamicMetaObjectProvider\n    {\n        private static readonly MethodInfo SetPropertyMethodInfo = typeof(DynamicData).GetMethod(\"SetProperty\");\n        private static readonly MethodInfo GetPropertyMethodInfo = typeof(DynamicData).GetMethod(\"GetProperty\");\n\n        private readonly IDictionary<string, object> _snakeNameStorage = new Dictionary<string, object>();\n        private readonly IDictionary<string, object> _storage = new Dictionary<string, object>();\n\n        /// <summary>\n        /// Get the metaObject required for Dynamism.\n        /// </summary>\n        public DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new GetSetPropertyDynamicMetaObject(parameter, this, SetPropertyMethodInfo, GetPropertyMethodInfo);\n        }\n\n        /// <summary>\n        /// Sets the property with the specified name to the value. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to set</param>\n        /// <param name=\"value\">The new property value</param>\n        /// <returns>Returns the input value back to the caller</returns>\n        public object SetProperty(string name, object value)\n        {\n            // let's be polite and support snake name access for the given object value too\n            var snakeName = name.ToSnakeCase();\n            name = name.LazyToLower();\n\n            if (name == \"time\")\n            {\n                if (value is PyObject pyobject)\n                {\n                    Time = pyobject.As<DateTime>();\n                }\n                else\n                {\n                    Time = (DateTime)value;\n                }\n            }\n            else if (name == \"endtime\" || name == \"end_time\")\n            {\n                if (value is PyObject pyobject)\n                {\n                    EndTime = pyobject.As<DateTime>();\n                }\n                else\n                {\n                    EndTime = (DateTime)value;\n                }\n            }\n            else if (name == \"value\")\n            {\n                if (value is PyObject pyobject)\n                {\n                    Value = pyobject.As<decimal>();\n                }\n                else\n                {\n                    Value = (decimal)value;\n                }\n            }\n            else if (name == \"symbol\")\n            {\n                if (value is string)\n                {\n                    Symbol = SymbolCache.GetSymbol((string) value);\n                }\n                else\n                {\n                    if (value is PyObject pyobject)\n                    {\n                        Symbol = pyobject.As<Symbol>();\n                    }\n                    else\n                    {\n                        Symbol = (Symbol)value;\n                    }\n                }\n            }\n\n            _storage[name] = value;\n            if (snakeName != name)\n            {\n                _snakeNameStorage[snakeName] = value;\n            }\n            return value;\n        }\n\n        /// <summary>\n        /// Gets the property's value with the specified name. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to access</param>\n        /// <returns>object value of BaseData</returns>\n        public object GetProperty(string name)\n        {\n            name = name.ToLowerInvariant();\n\n            // redirect these calls to the base types properties\n            if (name == \"time\")\n            {\n                return Time;\n            }\n            if (name == \"endtime\")\n            {\n                return EndTime;\n            }\n            if (name == \"value\")\n            {\n                return Value;\n            }\n            if (name == \"symbol\")\n            {\n                return Symbol;\n            }\n            if (name == \"price\")\n            {\n                return Price;\n            }\n\n            object value;\n            if (!_storage.TryGetValue(name, out value) && !_snakeNameStorage.TryGetValue(name, out value))\n            {\n                // let the user know the property name that we couldn't find\n                throw new KeyNotFoundException(\n                    $\"Property with name \\'{name}\\' does not exist. Properties: Time, Symbol, Value {string.Join(\", \", _storage.Keys)}\"\n                );\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Gets whether or not this dynamic data instance has a property with the specified name.\n        /// This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to check for</param>\n        /// <returns>True if the property exists, false otherwise</returns>\n        public bool HasProperty(string name)\n        {\n            return _storage.ContainsKey(name.ToLowerInvariant());\n        }\n\n        /// <summary>\n        /// Gets the storage dictionary\n        /// Python algorithms need this information since DynamicMetaObject does not work\n        /// </summary>\n        /// <returns>Dictionary that stores the paramenters names and values</returns>\n        public IDictionary<string, object> GetStorageDictionary()\n        {\n            return _storage;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            var clone = ObjectActivator.Clone(this);\n            foreach (var kvp in _storage)\n            {\n                // don't forget to add the dynamic members!\n                clone._storage.Add(kvp);\n            }\n            return clone;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/EventBasedDataQueueHandlerSubscriptionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Overrides <see cref=\"DataQueueHandlerSubscriptionManager\"/> methods using events\n    /// </summary>\n    public class EventBasedDataQueueHandlerSubscriptionManager : DataQueueHandlerSubscriptionManager\n    {\n        /// <summary>\n        /// Creates an instance of <see cref=\"EventBasedDataQueueHandlerSubscriptionManager\"/> with a single channel name\n        /// </summary>\n        public EventBasedDataQueueHandlerSubscriptionManager() : this(t => Channel.Single) {}\n\n        /// <summary>\n        /// Creates an instance of <see cref=\"EventBasedDataQueueHandlerSubscriptionManager\"/>\n        /// </summary>\n        /// <param name=\"getChannelName\">Convert TickType into string</param>\n        public EventBasedDataQueueHandlerSubscriptionManager(Func<TickType, string> getChannelName)\n        {\n            _getChannelName = getChannelName;\n        }\n\n        /// <summary>\n        /// Subscription method implementation\n        /// </summary>\n        public Func<IEnumerable<Symbol>, TickType, bool> SubscribeImpl { get; set; }\n        \n        /// <summary>\n        /// Unsubscription method implementation\n        /// </summary>\n        public Func<IEnumerable<Symbol>, TickType, bool> UnsubscribeImpl { get; set; }\n\n        /// <summary>\n        /// Socket channel name\n        /// </summary>\n        private Func<TickType, string> _getChannelName;\n\n        /// <summary>\n        /// The way Brokerage subscribes to symbol tickers\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to subscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns></returns>\n        protected override bool Subscribe(IEnumerable<Symbol> symbols, TickType tickType)\n        {\n            Log.Trace(\"EventBasedDataQueueHandlerSubscriptionManager.Subscribe(): {0}\", string.Join(\",\", symbols.Select(x => x.Value)));\n            return SubscribeImpl?.Invoke(symbols, tickType) == true;\n        }\n\n        /// <summary>\n        /// The way Brokerage unsubscribes from symbol tickers\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to unsubscribe</param>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns></returns>\n        protected override bool Unsubscribe(IEnumerable<Symbol> symbols, TickType tickType)\n        {\n            Log.Trace(\"EventBasedDataQueueHandlerSubscriptionManager.Unsubscribe(): {0}\", string.Join(\",\", symbols.Select(x => x.Value)));\n            return UnsubscribeImpl?.Invoke(symbols, tickType) == true;\n        }\n\n        /// <summary>\n        /// Channel name\n        /// </summary>\n        /// <param name=\"tickType\">Type of tick data</param>\n        /// <returns>Returns Socket channel name corresponding <paramref name=\"tickType\"/></returns>\n        protected override string ChannelNameFromTickType(TickType tickType)\n        {\n            return _getChannelName?.Invoke(tickType);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/FileFormat.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Specifies the format of data in a subscription\n    /// </summary>\n    public enum FileFormat\n    {\n        /// <summary>\n        /// Comma separated values (0)\n        /// </summary>\n        Csv,\n\n        /// <summary>\n        /// Binary file data (1)\n        /// </summary>\n        Binary,\n\n        /// <summary>\n        /// Only the zip entry names are read in as symbols (2)\n        /// </summary>\n        ZipEntryName,\n\n        /// <summary>\n        /// Reader returns a BaseDataCollection object (3)\n        /// </summary>\n        /// <remarks>Lean will unfold the collection and consume it as individual data points</remarks>\n        UnfoldingCollection,\n\n        /// <summary>\n        /// Data stored using an intermediate index source (4)\n        /// </summary>\n        Index,\n\n        /// <summary>\n        /// Data type inherits from BaseDataCollection.\n        /// Reader method can return a non BaseDataCollection type which will be folded, based on unique time,\n        /// into an instance of the data type (5)\n        /// </summary>\n        FoldingCollection\n    }\n}\n"
  },
  {
    "path": "Common/Data/FuncRiskFreeRateInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Constant risk free rate interest rate model\n    /// </summary>\n    public class FuncRiskFreeRateInterestRateModel : IRiskFreeInterestRateModel\n    {\n        private readonly Func<DateTime, decimal> _getInterestRateFunc;\n\n        /// <summary>\n        /// Create class instance of interest rate provider\n        /// </summary>\n        public FuncRiskFreeRateInterestRateModel(Func<DateTime, decimal> getInterestRateFunc)\n        {\n            _getInterestRateFunc = getInterestRateFunc;\n        }\n\n        /// <summary>\n        /// Create class instance of interest rate provider with given PyObject\n        /// </summary>\n        public FuncRiskFreeRateInterestRateModel(PyObject getInterestRateFunc)\n        {\n            using (Py.GIL())\n            {\n                _getInterestRateFunc = getInterestRateFunc.SafeAs<Func<DateTime, decimal>>();\n            }\n        }\n\n        /// <summary>\n        /// Get interest rate by a given date\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Interest rate on the given date</returns>\n        public decimal GetInterestRate(DateTime date)\n        {\n            return _getInterestRateFunc(date);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/AssetClassificationHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Helper class for the AssetClassification's StockType field <see cref=\"AssetClassification.StockType\"/>\n    /// </summary>\n    public static class StockType\n    {\n        /// <summary>\n        /// Companies whose revenues and earnings have both been growing significantly faster than\n        /// the general economy.\n        /// </summary>\n        public readonly static int AggressiveGrowth = 1;\n\n        /// <summary>\n        /// Companies that are growing respectably faster than the general economy, and often pay a\n        /// steady dividend. They tend to be mature and solidly profitable businesses.\n        /// </summary>\n        public readonly static int ClassicGrowth = 2;\n\n        /// <summary>\n        /// Companies in the cyclicals and durables sectors, except those in the three types below.\n        /// The profits of cyclicals tend to rise and fall with the general economy.\n        /// </summary>\n        public readonly static int Cyclicals = 3;\n\n        /// <summary>\n        /// Companies that have had consistently declining cash flows and earnings over the past\n        /// three years, and/or very high debt.\n        /// </summary>\n        public readonly static int Distressed = 4;\n\n        /// <summary>\n        /// Companies that deal in assets such as oil, metals, and real estate, which tend to do\n        /// well in inflationary environments.\n        /// </summary>\n        public readonly static int HardAsset = 5;\n\n        /// <summary>\n        /// Companies that have dividend yields at least twice the average for large-cap stocks.\n        /// They tend to be mature, slow-growing companies.\n        /// </summary>\n        public readonly static int HighYield = 6;\n\n        /// <summary>\n        /// Companies that have shown slow revenue and earnings growth (typically less than the rate\n        /// of GDP growth) over at least three years.\n        /// </summary>\n        public readonly static int SlowGrowth = 7;\n\n        /// <summary>\n        /// Companies that have shown strong revenue growth but slower or spotty earnings growth.\n        /// Very small or young companies also tend to fall into this class.\n        /// </summary>\n        public readonly static int SpeculativeGrowth = 8;\n    }\n\n    /// <summary>\n    /// Helper class for the AssetClassification's StyleBox field <see cref=\"AssetClassification.StyleBox\"/>.\n    /// For stocks and stock funds, it classifies securities according to market capitalization and growth and value factor\n    /// </summary>\n    /// <remarks>Please refer to https://www.morningstar.com/InvGlossary/morningstar_style_box.aspx </remarks>\n    public static class StyleBox\n    {\n#pragma warning disable 1591\n        public readonly static int LargeValue = 1;\n        public readonly static int LargeCore = 2;\n        public readonly static int LargeGrowth = 3;\n        public readonly static int MidValue = 4;\n        public readonly static int MidCore = 5;\n        public readonly static int MidGrowth = 6;\n        public readonly static int SmallValue = 7;\n        public readonly static int SmallCore = 8;\n        public readonly static int SmallGrowth = 9;\n#pragma warning restore 1591\n    }\n\n    /// <summary>\n    /// Helper class for the AssetClassification's MorningstarEconomySphereCode field <see cref=\"AssetClassification.MorningstarEconomySphereCode\"/>.\n    /// </summary>\n    public static class MorningstarEconomySphereCode\n    {\n        /// <summary>\n        /// The cyclical Super Sector includes industries significantly affected by economic shifts.\n        /// When the economy is prosperous, these industries tend to expand, and when the economy is\n        /// in a downturn they tend to shrink. In general, the stocks in these industries have betas\n        /// of greater than 1.\n        /// </summary>\n        public readonly static int Cyclical = 1;\n\n        /// <summary>\n        /// The defensive Super Sector includes industries that are relatively immune to economic\n        /// cycles. These industries provide services that consumers require in both good and bad\n        /// times, such as healthcare and utilities. In general, the stocks in these industries have\n        /// betas of less than 1.\n        /// </summary>\n        public readonly static int Defensive = 2;\n\n        /// <summary>\n        /// The sensitive Super Sector includes industries that ebb and flow with the overall\n        /// economy, but not severely. Sensitive industries fall between defensive and cyclical, as\n        /// they are not immune to a poor economy, but they also may not be as severely affected as\n        /// industries in the cyclical Super Sector. In general, the stocks in these industries have\n        /// betas that are close to 1.\n        /// </summary>\n        public readonly static int Sensitive = 3;\n    }\n\n    /// <summary>\n    /// Helper class for the AssetClassification's MorningstarSectorCode field <see cref=\"AssetClassification.MorningstarSectorCode\"/>.\n    /// </summary>\n    public static class MorningstarSectorCode\n    {\n        /// <summary>\n        /// Companies that manufacture chemicals, building materials, and paper products. This\n        /// sector also includes companies engaged in commodities exploration and processing.\n        /// </summary>\n        public readonly static int BasicMaterials = 101;\n\n        /// <summary>\n        /// This sector includes retail stores, auto and auto-parts manufacturers, restaurants,\n        /// lodging facilities, specialty retail and travel companies.\n        /// </summary>\n        public readonly static int ConsumerCyclical = 102;\n\n        /// <summary>\n        /// Companies that provide financial services include banks, savings and loans, asset\n        /// management companies, credit services, investment brokerage firms, and insurance companies.\n        /// </summary>\n        public readonly static int FinancialServices = 103;\n\n        /// <summary>\n        /// This sector includes companies that develop, acquire, manage, and operate real estate properties.\n        /// </summary>\n        public readonly static int RealEstate = 104;\n\n        /// <summary>\n        /// Companies that manufacture food, beverages, household and personal products, packaging,\n        /// or tobacco. Also includes companies that provide services such as education and training services.\n        /// </summary>\n        public readonly static int ConsumerDefensive = 205;\n\n        /// <summary>\n        /// This sector includes biotechnology, pharmaceuticals, research services, home healthcare,\n        /// hospitals, long-term-care facilities, and medical equipment and supplies. Also include\n        /// pharmaceutical retailers and companies which provide health information services.\n        /// </summary>\n        public readonly static int Healthcare = 206;\n\n        /// <summary>\n        /// Electric, gas, and water utilities.\n        /// </summary>\n        public readonly static int Utilities = 207;\n\n        /// <summary> Companies that provide communication services using fixed-line networks or\n        /// those that provide wireless access and services. Also includes companies that provide\n        /// advertising &amp; marketing services, entertainment content and services, as well as\n        /// interactive media and content provider over internet or through software. </summary>\n        public readonly static int CommunicationServices = 308;\n\n        /// <summary>\n        /// Companies that produce or refine oil and gas, oilfield-services and equipment companies,\n        /// and pipeline operators. This sector also includes companies that mine thermal coal and uranium.\n        /// </summary>\n        public readonly static int Energy = 309;\n\n        /// <summary>\n        /// Companies that manufacture machinery, hand-held tools, and industrial products. This\n        /// sector also includes aerospace and defense firms as well as companies engaged in\n        /// transportation services.\n        /// </summary>\n        public readonly static int Industrials = 310;\n\n        /// <summary>\n        /// Companies engaged in the design, development, and support of computer operating systems\n        /// and applications. This sector also includes companies that make computer equipment, data\n        /// storage products, networking products, semiconductors, and components.\n        /// </summary>\n        public readonly static int Technology = 311;\n    }\n\n    /// <summary>\n    /// Helper class for the AssetClassification's MorningstarIndustryGroupCode field <see cref=\"AssetClassification.MorningstarIndustryGroupCode\"/>.\n    /// </summary>\n    public static class MorningstarIndustryGroupCode\n    {\n#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member\n        public readonly static int Agriculture = 10110;\n        public readonly static int BuildingMaterials = 10120;\n        public readonly static int Chemicals = 10130;\n        public readonly static int ForestProducts = 10140;\n        public readonly static int MetalsAndMining = 10150;\n        public readonly static int Steel = 10160;\n        public readonly static int VehiclesAndParts = 10200;\n        public readonly static int Furnishings = 10220;\n        public readonly static int FixturesAndAppliances = 10220;\n        public readonly static int HomebuildingAndConstruction = 10230;\n        public readonly static int ManufacturingApparelAndAccessories = 10240;\n        public readonly static int PackagingAndContainers = 10250;\n        public readonly static int PersonalServices = 10260;\n        public readonly static int Restaurants = 10270;\n        public readonly static int RetailCyclical = 10280;\n        public readonly static int TravelAndLeisure = 10290;\n        public readonly static int AssetManagement = 10310;\n        public readonly static int Banks = 10320;\n        public readonly static int CapitalMarkets = 10330;\n        public readonly static int Insurance = 10340;\n        public readonly static int DiversifiedFinancialServices = 10350;\n        public readonly static int CreditServices = 10360;\n        public readonly static int RealEstate = 10410;\n        public readonly static int REITs = 10420;\n        public readonly static int BeveragesAlcoholic = 20510;\n        public readonly static int BeveragesNonAlcoholic = 20520;\n        public readonly static int ConsumerPackagedGoods = 20525;\n        public readonly static int Education = 20540;\n        public readonly static int RetailDefensive = 20550;\n        public readonly static int TobaccoProducts = 20560;\n        public readonly static int Biotechnology = 20610;\n        public readonly static int DrugManufacturers = 20620;\n        public readonly static int HealthcarePlans = 20630;\n        public readonly static int HealthcareProvidersAndServices = 20645;\n        public readonly static int MedicalDevicesAndInstruments = 20650;\n        public readonly static int MedicalDiagnosticsAndResearch = 20660;\n        public readonly static int MedicalDistribution = 20670;\n        public readonly static int UtilitiesIndependentPowerProducers = 20710;\n        public readonly static int UtilitiesRegulated = 20720;\n        public readonly static int TelecommunicationServices = 30810;\n        public readonly static int MediaDiversified = 30820;\n        public readonly static int InteractiveMedia = 30830;\n        public readonly static int OilAndGas = 30910;\n        public readonly static int OtherEnergySources = 30920;\n        public readonly static int AerospaceAndDefense = 31010;\n        public readonly static int BusinessServices = 31020;\n        public readonly static int Conglomerates = 31030;\n        public readonly static int Construction = 31040;\n        public readonly static int FarmAndHeavyConstructionMachinery = 31050;\n        public readonly static int IndustrialDistribution = 31060;\n        public readonly static int IndustrialProducts = 31070;\n        public readonly static int Transportation = 31080;\n        public readonly static int WasteManagement = 31090;\n        public readonly static int Software = 31110;\n        public readonly static int Hardware = 31120;\n        public readonly static int Semiconductors = 31130;\n#pragma warning restore CS1591 \n    }\n\n    /// <summary>\n    /// Helper class for the AssetClassification's MorningstarIndustryCode field <see cref=\"AssetClassification.MorningstarIndustryCode\"/>.\n    /// </summary>\n    public static class MorningstarIndustryCode\n    {\n        /// <summary>\n        /// Companies that manufacture nitrogenous and phosphatic fertilizers, pesticides, seed, and\n        /// other agricultural chemical products.\n        /// </summary>\n        public readonly static int AgriculturalInputs = 10110010;\n\n        /// <summary>\n        /// Companies that manufacture construction materials, including stone, clay, and brick\n        /// products, cement, lime, gypsum, and concrete and other construction products. Excludes\n        /// companies that manufacture finished and semi finished building products.\n        /// </summary>\n        public readonly static int BuildingMaterials = 10120010;\n\n        /// <summary>\n        /// Chemical manufacturing companies engaged in diverse chemical and chemical-related\n        /// operations, and basic chemicals manufacturing.\n        /// </summary>\n        public readonly static int Chemicals = 10130010;\n\n        /// <summary>\n        /// Companies that use base chemicals to produce value-added chemicals that are used in a\n        /// variety of products. Includes companies that produce polishes, adhesives and sealants,\n        /// explosives, printing ink, paint, carbon black, acids, repellants, and cleaning solutions.\n        /// </summary>\n        public readonly static int SpecialtyChemicals = 10130020;\n\n        /// <summary>\n        /// Companies that grow timber, mill lumber, and manufacture wood and wood products for construction.\n        /// </summary>\n        public readonly static int LumberAndWoodProduction = 10140010;\n\n        /// <summary>\n        /// Companies that manufacture and market paper and paper-related products from wood pulp\n        /// and other fibers. Excludes companies that produce paper packaging products and are\n        /// classified in the packaging and containers industry.\n        /// </summary>\n        public readonly static int PaperAndPaperProducts = 10140020;\n\n        /// <summary>\n        /// Companies that produce, refine, market, and distribute aluminum and related\n        /// aluminum-based products.\n        /// </summary>\n        public readonly static int Aluminum = 10150010;\n\n        /// <summary>\n        /// Companies engaged in the exploration, mining, smelting, and refining of copper ores and\n        /// related copper products.\n        /// </summary>\n        public readonly static int Copper = 10150020;\n\n        /// <summary>\n        /// Companies that mine, refine, produce, smelt, and mill industrial ores, including copper,\n        /// lead, zinc, radium, vanadium, nickel, tin, titanium, and other related materials.\n        /// </summary>\n        public readonly static int OtherIndustrialMetalsAndMining = 10150030;\n\n        /// <summary>\n        /// Companies principally engaged in gold exploration, mining, processing, extraction, and smelting.\n        /// </summary>\n        public readonly static int Gold = 10150040;\n\n        /// <summary>\n        /// Companies principally engaged in silver exploration, mining, processing, extraction, and smelting.\n        /// </summary>\n        public readonly static int Silver = 10150050;\n\n        /// <summary>\n        /// Companies that mine, refine, produce, smelt, and mill precious metals, including silver,\n        /// platinum, palladium, diamond, and other related minerals.\n        /// </summary>\n        public readonly static int OtherPreciousMetalsAndMining = 10150060;\n\n        /// <summary>\n        /// Companies that produce coking coal.\n        /// </summary>\n        public readonly static int CokingCoal = 10160010;\n\n        /// <summary>\n        /// Companies that produce steel plates, steel sheets, bar and rod materials, structural\n        /// steel, steel pipes and tubes, and stainless steel.\n        /// </summary>\n        public readonly static int Steel = 10160020;\n\n        /// <summary>\n        /// Companies engaged in the specialty retail of new and used automobiles, trucks, and other\n        /// vehicles through the operation and/or franchising of dealerships.\n        /// </summary>\n        public readonly static int AutoAndTruckDealerships = 10200010;\n\n        /// <summary>\n        /// Leading worldwide designers and manufacturers of passenger cars and trucks.\n        /// </summary>\n        public readonly static int AutoManufacturers = 10200020;\n\n        /// <summary>\n        /// Companies that manufacture motor vehicle parts and accessories, including rubber and\n        /// plastic products, such as tires and inner tubes, but do not manufacture complete car bodies.\n        /// </summary>\n        public readonly static int AutoParts = 10200030;\n\n        /// <summary>\n        /// Companies that manufacture recreational vehicles, including self-contained motor homes,\n        /// campers, all-terrain vehicles, travel/camper trailers, and snowmobiles.\n        /// </summary>\n        public readonly static int RecreationalVehicles = 10200040;\n\n        /// <summary>\n        /// Companies that manufacture and market wooden, metal, and upholstered furniture,\n        /// mattresses, bedsprings, lighting fixtures, wooden flooring, wallpaper, and household\n        /// products, such as utensils, cutlery, tableware, and appliances.\n        /// </summary>\n        public readonly static int Furnishings = 10220010;\n\n        /// <summary>\n        /// Companies that manufacture and market wooden, metal, and upholstered furniture,\n        /// mattresses, bedsprings, lighting fixtures, wooden flooring, wallpaper, and household\n        /// products, such as utensils, cutlery, tableware, and appliances.\n        /// </summary>\n        public readonly static int FixturesAndAppliances = 10220010;\n\n        /// <summary>\n        /// Companies that build and renovate residential buildings, such as single-family houses,\n        /// apartments, and hotels.\n        /// </summary>\n        public readonly static int ResidentialConstruction = 10230010;\n\n        /// <summary>\n        /// Companies that manufacture and mill textile products, including apparel fabrics, bedding\n        /// and accessories, home furnishing fabrics, carpets and rugs, curtains and drapes, and\n        /// other milled textile products.\n        /// </summary>\n        public readonly static int TextileManufacturing = 10240010;\n\n        /// <summary>\n        /// Companies that manufacture, design, market, source, and sell all lines of clothing for\n        /// men, women, and children. Also includes companies that manufacture or distribute\n        /// buttons, buckles, and other apparel parts.\n        /// </summary>\n        public readonly static int ApparelManufacturing = 10240020;\n\n        /// <summary>\n        /// Companies that manufacture, design, market, and sell lines of footwear and luggage,\n        /// handbags and purses, belts, and other leather goods.\n        /// </summary>\n        public readonly static int FootwearAndAccessories = 10240030;\n\n        /// <summary>\n        /// Companies that manufacture and market paper, plastic, metal, and glass packaging\n        /// products, including corrugated boxes, cardboard containers, bottles, cans, and plastic\n        /// foam and containers.\n        /// </summary>\n        public readonly static int PackagingAndContainers = 10250010;\n\n        /// <summary>\n        /// Companies that provide services of a personal nature or that are particularly structured\n        /// for the individual or group being served, including veterinary services, funeral and\n        /// cemetery services, child care services, portrait and photo services, tax preparation and\n        /// legal services, and other miscellaneous personal services.\n        /// </summary>\n        public readonly static int PersonalServices = 10260010;\n\n        /// <summary>\n        /// Companies that own, operate, and franchise full-service restaurants that engage in the\n        /// retail sale of prepared food and drink.\n        /// </summary>\n        public readonly static int Restaurants = 10270010;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of clothing, shoes, and accessories.\n        /// </summary>\n        public readonly static int ApparelRetail = 10280010;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of a diverse mix of merchandise, emphasizing\n        /// fashion apparel and accessories, home furnishings, electronics, and cosmetics.\n        /// </summary>\n        public readonly static int DepartmentStores = 10280020;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of home improvement items, such as lumber, carpets,\n        /// hardware and other building materials, plants and other garden supplies, and various\n        /// other items for the home.\n        /// </summary>\n        public readonly static int HomeImprovementRetail = 10280030;\n\n        /// <summary>\n        /// Companies engaged in the specialty retail of luxury items, including jewelry, watches,\n        /// crystal, clothing, handbags, and accessories.\n        /// </summary>\n        public readonly static int LuxuryGoods = 10280040;\n\n        /// <summary>\n        /// Companies engaged in the online retail sale of a diverse mix of merchandise. Excludes\n        /// companies that target the travel industry and are classified in travel services.\n        /// </summary>\n        public readonly static int InternetRetail = 10280050;\n\n        /// <summary>\n        /// Companies engaged in the specialty retail of various goods and products not covered in a\n        /// specific industry group. This group includes retailers such as bookstores, office-supply\n        /// stores, gas stations, pawn shops, novelty shops, auto-parts stores, electronics stores,\n        /// home furnishing stores, sporting goods stores, toy and hobby stores, music and video\n        /// stores, and many other miscellaneous retailers.\n        /// </summary>\n        public readonly static int SpecialtyRetail = 10280060;\n\n        /// <summary>\n        /// Companies that own, operate, or manage lawful gaming activities and events, such as\n        /// horse and dog racing, online gaming, bingo, and video lottery, as well as companies that\n        /// supply products or services to gaming operators. It excludes companies operating casinos.\n        /// </summary>\n        public readonly static int Gambling = 10290010;\n\n        /// <summary>\n        /// Companies that manufacture, design, market, and sell bicycles, sporting goods,\n        /// photographic equipment, recreational equipment, toys, and other leisure products or services.\n        /// </summary>\n        public readonly static int Leisure = 10290020;\n\n        /// <summary>\n        /// Companies that develop, manage, own, and operate lodging facilities, including motels,\n        /// extended-stay and full-service hotels, and economy hotels and inns.\n        /// </summary>\n        public readonly static int Lodging = 10290030;\n\n        /// <summary>\n        /// Companies that own, operate, and manage resort properties, including beach clubs,\n        /// time-share properties, and luxury resort hotels and that conduct casino gaming operations.\n        /// </summary>\n        public readonly static int ResortsAndCasinos = 10290040;\n\n        /// <summary>\n        /// Companies that offer travel-related products or services, including online travel services.\n        /// </summary>\n        public readonly static int TravelServices = 10290050;\n\n        /// <summary>\n        /// Investment management firms offering diversified services such as asset administration,\n        /// investment advice, portfolio or mutual fund management, money management, and venture capital.\n        /// </summary>\n        public readonly static int AssetManagement = 10310010;\n\n        /// <summary>\n        /// Global, diverse financial institutions serving the corporate and consumer needs of\n        /// retail banking, investment banking, trust management, credit cards and mortgage banking.\n        /// </summary>\n        public readonly static int BanksDiversified = 10320010;\n\n        /// <summary>\n        /// Regional, diverse financial institutions serving the corporate, government, and consumer\n        /// needs of retail banking, investment banking, trust management, credit cards, mortgage\n        /// banking, savings and loan associations, building societies, cooperative banks, and homestead.\n        /// </summary>\n        public readonly static int BanksRegional = 10320020;\n\n        /// <summary>\n        /// Companies that originate, purchase, sell, and service home mortgage and equity loans.\n        /// </summary>\n        public readonly static int MortgageFinance = 10320030;\n\n        /// <summary>\n        /// Large, major investment houses offering investment banking, merchant banking,\n        /// underwriting, brokerage, research, advisory, and trading services to broad-based\n        /// national and international markets.\n        /// </summary>\n        public readonly static int CapitalMarkets = 10330010;\n\n        /// <summary>\n        /// Companies that operate security exchanges, including companies that offer financial data\n        /// such as ratings, investment research, and other research solutions.\n        /// </summary>\n        public readonly static int FinancialDataAndStockExchanges = 10330020;\n\n        /// <summary>\n        /// Companies that underwrite, market, and distribute life insurance and related products to\n        /// individuals and families.\n        /// </summary>\n        public readonly static int InsuranceLife = 10340010;\n\n        /// <summary>\n        /// Companies that underwrite, market, and distribute fire, marine, and casualty insurance\n        /// for property and other tangible assets.\n        /// </summary>\n        public readonly static int InsurancePropertyAndCasualty = 10340020;\n\n        /// <summary>\n        /// Companies that underwrite and sell reinsurance.\n        /// </summary>\n        public readonly static int InsuranceReinsurance = 10340030;\n\n        /// <summary>\n        /// Companies that underwrite, market, and distribute accident and health, sickness,\n        /// mortgage, and other specialty or supplemental insurance to individuals and families.\n        /// </summary>\n        public readonly static int InsuranceSpecialty = 10340040;\n\n        /// <summary>\n        /// Companies acting primarily as agents or intermediaries in creating insurance contracts\n        /// between clients and insurance companies.\n        /// </summary>\n        public readonly static int InsuranceBrokers = 10340050;\n\n        /// <summary>\n        /// Insurance companies with diversified interests in life, health, and property and\n        /// casualty insurance.\n        /// </summary>\n        public readonly static int InsuranceDiversified = 10340060;\n\n        /// <summary>\n        /// A development-stage company with no or minimal revenue. Includes capital pool, blank\n        /// check, shell, and holding companies.\n        /// </summary>\n        public readonly static int ShellCompanies = 10350010;\n\n        /// <summary>\n        /// Companies that provide financial services, including banking, insurance, and capital\n        /// markets, but with no dominant business line or source of revenue.\n        /// </summary>\n        public readonly static int FinancialConglomerates = 10350020;\n\n        /// <summary>\n        /// Companies that extend credit and make loans to individuals and businesses through credit\n        /// cards, installment loans, student loans, and business loans that are associated with\n        /// other consumer and business credit instruments.\n        /// </summary>\n        public readonly static int CreditServices = 10360010;\n\n        /// <summary>\n        /// Companies that develop real estate and same properties held as inventory, or sold to\n        /// others after development, with no specific portfolio composition.\n        /// </summary>\n        public readonly static int RealEstateDevelopment = 10410010;\n\n        /// <summary>\n        /// Companies that operate, manage, and lease real property with no specific portfolio\n        /// composition. Includes real estate services like brokers and agents but excludes\n        /// companies classified in the real estate â€“ development industry.\n        /// </summary>\n        public readonly static int RealEstateServices = 10410020;\n\n        /// <summary>\n        /// Companies engaged in multiple real estate activities, including development, sales,\n        /// management, and related services. Excludes companies classified in real estate\n        /// development and real estate services.\n        /// </summary>\n        public readonly static int RealEstateDiversified = 10410030;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of healthcare properties, including long-term-care\n        /// facilities, acute-care and rehab hospitals, psychiatric facilities, and substance-abuse centers.\n        /// </summary>\n        public readonly static int REITHealthcareFacilities = 10420010;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of lodging properties, including full- and limited-service\n        /// hotels and motels.\n        /// </summary>\n        public readonly static int REITHotelAndMotel = 10420020;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of industrial properties, including bulk warehouses,\n        /// self-storage facilities, distribution facilities, and other light industrial facilities.\n        /// </summary>\n        public readonly static int REITIndustrial = 10420030;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of office properties, including office buildings, complexes,\n        /// and centers.\n        /// </summary>\n        public readonly static int REITOffice = 10420040;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of residential properties, including apartments, multifamily\n        /// and single-family mortgage loans, manufactured housing, mobile-home parks, and other\n        /// residential properties.\n        /// </summary>\n        public readonly static int REITResidential = 10420050;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the development, acquisition,\n        /// management, and disposition of retail properties, including community shopping centers,\n        /// factory outlet shopping centers, enclosed shopping malls, strip centers, restaurants,\n        /// and other retail properties.\n        /// </summary>\n        public readonly static int REITRetail = 10420060;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the acquisition, management,\n        /// and disposition of mortgage-backed securities. Also includes companies that provide\n        /// financing for income-producing real estate by purchasing or originating mortgages and\n        /// mortgage-backed securities; and earns income from the interest on these investments.\n        /// </summary>\n        public readonly static int REITMortgage = 10420070;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the acquisition, management,\n        /// and disposition of properties not classified elsewhere. Includes trusts that operate,\n        /// lease, and invest in telecom towers, advertising spaces, timberland properties, and\n        /// other properties not classified elsewhere.\n        /// </summary>\n        public readonly static int REITSpecialty = 10420080;\n\n        /// <summary>\n        /// Self-administered real estate investment trusts engaged in the acquisition, management,\n        /// and disposition of diversified property holdings, with no specific portfolio composition.\n        /// </summary>\n        public readonly static int REITDiversified = 10420090;\n\n        /// <summary>\n        /// Companies that manufacture, sell, and distribute malt-based beverages, beers, and ales.\n        /// </summary>\n        public readonly static int BeveragesBrewers = 20510010;\n\n        /// <summary>\n        /// Companies that manufacture, sell, and distribute distilled liquors and wine.\n        /// </summary>\n        public readonly static int BeveragesWineriesAndDistilleries = 20510020;\n\n        /// <summary>\n        /// Companies that manufacture, sell, and distribute soft drinks, carbonated and spring\n        /// water, fruit juices, and other nonalcoholic beverages.\n        /// </summary>\n        public readonly static int BeveragesNonAlcoholic = 20520010;\n\n        /// <summary>\n        /// Companies that manufacture and refine raw sugar, syrup or finished cane and beet sugar,\n        /// candy and chewing gum, chocolate, and cocoa products.\n        /// </summary>\n        public readonly static int Confectioners = 20525010;\n\n        /// <summary>\n        /// Companies that produce, raise, and grow agricultural and farm-based food products,\n        /// including fruits, vegetables, other crop products, cattle, and eggs. Also includes\n        /// seafood products.\n        /// </summary>\n        public readonly static int FarmProducts = 20525020;\n\n        /// <summary>\n        /// Companies that manufacture and market soaps and other detergents, polishing and\n        /// sanitation goods and produce glycerin from vegetable and animal fats and oils. Also\n        /// includes companies that manufacture and market personal-care products, including\n        /// perfume, cosmetics, and other toilet preparations, infant and adult sanitary paper\n        /// products, shaving razors and blades.\n        /// </summary>\n        public readonly static int HouseholdAndPersonalProducts = 20525030;\n\n        /// <summary>\n        /// Companies that process and package food products, including frozen foods, grain\n        /// products, canned foods, snack foods, health supplements, vitamins, and pet products.\n        /// </summary>\n        public readonly static int PackagedFoods = 20525040;\n\n        /// <summary>\n        /// Companies that provide educational and training services, including college and\n        /// junior-college courses, higher-education programs, technical and vocational training,\n        /// and other education services.\n        /// </summary>\n        public readonly static int EducationAndTrainingServices = 20540010;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of a variety of merchandise at low and discounted prices.\n        /// </summary>\n        public readonly static int DiscountStores = 20550010;\n\n        /// <summary>\n        /// Companies primarily engaged in the distribution and supply of food products, including\n        /// packaged goods, meat, dairy products, frozen foods, and related groceries to grocery\n        /// stores, restaurants, and other food-service centers.\n        /// </summary>\n        public readonly static int FoodDistribution = 20550020;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of groceries, including dry goods, meat, produce,\n        /// frozen foods, dairy products, seafood, deli/bakery, and nonfood items.\n        /// </summary>\n        public readonly static int GroceryStores = 20550030;\n\n        /// <summary>\n        /// Companies that manufacture and market cigarettes, e-cigarettes, snuff, cigars, chewing\n        /// tobacco, and all other tobacco products.\n        /// </summary>\n        public readonly static int Tobacco = 20560010;\n\n        /// <summary>\n        /// Biotech and biopharmaceutical companies engaged in research, discovery, development, and\n        /// production of innovative drug and drug-related technologies.\n        /// </summary>\n        public readonly static int Biotechnology = 20610010;\n\n        /// <summary>\n        /// Major, global pharmaceutical manufacturers offering a broad and diverse line of drug and\n        /// healthcare products; industry leaders that have made a significant commitment to the\n        /// research and development of a long pipeline of drugs.\n        /// </summary>\n        public readonly static int DrugManufacturersGeneral = 20620010;\n\n        /// <summary>\n        /// Companies engaged in development and discovery of branded forms of drug, drug-related\n        /// products, generic drug products, and animal-related drugs. Also includes companies that\n        /// cultivate, process, and farm cannabis or marijuana.\n        /// </summary>\n        public readonly static int DrugManufacturersSpecialtyAndGeneric = 20620020;\n\n        /// <summary>\n        /// Companies that offer a wide variety of managed health products and services, including\n        /// HMOs, PPOs, and other health insurance plans, and are largely U.S.-domiciled.\n        /// </summary>\n        public readonly static int HealthcarePlans = 20630010;\n\n        /// <summary>\n        /// Companies that provide medical services through the ownership and operation of\n        /// hospitals, and other auxiliary healthcare-related services, including healthcare\n        /// staffing and ambulatory services. Also, companies that operate long-term-care\n        /// facilities, such as assisted-living centers, nursing and retirement homes,\n        /// substance-abuse centers, and centers for rehabilitation services.\n        /// </summary>\n        public readonly static int MedicalCareFacilities = 20645010;\n\n        /// <summary>\n        /// Companies engaged in the retail sale of prescription drugs and patent medicines as well\n        /// as a number of related lines, such as cosmetics, toiletries, and novelty merchandise.\n        /// </summary>\n        public readonly static int PharmaceuticalRetailers = 20645020;\n\n        /// <summary>\n        /// Companies that develop and provide comprehensive physician practice management systems\n        /// and software for hospitals, medical practices, and managed-care organizations.\n        /// </summary>\n        public readonly static int HealthInformationServices = 20645030;\n\n        /// <summary>\n        /// Companies that develop, manufacture, and market medical and surgical equipment and\n        /// machinery, including orthopedic products, respiratory care equipment, x-ray equipment,\n        /// laser systems, implants, pacemakers, and other major medical machines and apparatus.\n        /// </summary>\n        public readonly static int MedicalDevices = 20650010;\n\n        /// <summary>\n        /// Companies that develop, design, manufacture, and market medical and dental instruments\n        /// and supplies, including wheelchairs, catheters, needles, syringes, eyewear and eyecare\n        /// products, and other health-related supplies.\n        /// </summary>\n        public readonly static int MedicalInstrumentsAndSupplies = 20650020;\n\n        /// <summary>\n        /// Companies that provide laboratory testing services through imaging and other diagnostic\n        /// services to the medical industry.\n        /// </summary>\n        public readonly static int DiagnosticsAndResearch = 20660010;\n\n        /// <summary>\n        /// Companies primarily engaged in the distribution and supply of medical instruments and\n        /// supplies, ophthalmic goods, and other health-related items to the medical and healthcare industry.\n        /// </summary>\n        public readonly static int MedicalDistribution = 20670010;\n\n        /// <summary>\n        /// Companies that own and operate merchant power generation facilities and sell electricity\n        /// into retail and wholesale markets.\n        /// </summary>\n        public readonly static int UtilitiesIndependentPowerProducers = 20710010;\n\n        /// <summary>\n        /// Companies that generate, produce, or transmit electric energy from renewable sources,\n        /// including hydropower, wind, geothermal, biomass, solar, tidal, and wave.\n        /// </summary>\n        public readonly static int UtilitiesRenewable = 20710020;\n\n        /// <summary>\n        /// Companies that distribute water for sale, including water-treatment companies.\n        /// </summary>\n        public readonly static int UtilitiesRegulatedWater = 20720010;\n\n        /// <summary>\n        /// Companies that generate, transmit, or distribute electric energy for sale.\n        /// </summary>\n        public readonly static int UtilitiesRegulatedElectric = 20720020;\n\n        /// <summary>\n        /// Companies that transmit, store, or distribute natural gas.\n        /// </summary>\n        public readonly static int UtilitiesRegulatedGas = 20720030;\n\n        /// <summary>\n        /// Companies engaged in the regulated generation, transmission, or distribution of\n        /// electricity and natural gas, merchant power generation facilities, and energy marketing operations.\n        /// </summary>\n        public readonly static int UtilitiesDiversified = 20720040;\n\n        /// <summary>\n        /// Companies that provide local, national, international, and long-distance phone services,\n        /// as well as companies offering wireless services. Also includes companies that provide\n        /// services for faxing, prepaid phone cards, pay phones, and directory assistance, or that\n        /// provide Internet access services.\n        /// </summary>\n        public readonly static int TelecomServices = 30810010;\n\n        /// <summary>\n        /// Companies engaged in full-service advertising operations, including the planning,\n        /// creating, producing, and placing of advertising in media such as TV, radio, and print.\n        /// Also includes companies providing marketing services, including outdoor advertising,\n        /// promotional materials, direct-mail services, digital marketing, event management\n        /// services, and marketing research services.\n        /// </summary>\n        public readonly static int AdvertisingAgencies = 30820010;\n\n        /// <summary>\n        /// Companies that publish periodicals, such as magazines, comic books, trade journals,\n        /// books, pamphlets, e-publications, and newspapers.\n        /// </summary>\n        public readonly static int Publishing = 30820020;\n\n        /// <summary>\n        /// Companies that own or operate radio broadcast stations and provide and produce radio\n        /// programming services, television programming services, and television broadcast\n        /// stations. Also includes companies providing Internet-based video on demand and\n        /// pay-per-view programming services.\n        /// </summary>\n        public readonly static int Broadcasting = 30820030;\n\n        /// <summary>\n        /// Companies primarily operating with diversified holdings in movies, television, and other\n        /// media-based entertainment. Also includes companies that produce and distribute motion\n        /// pictures, television programmers, video, and the operation of movie theaters; and\n        /// provide cable television services.\n        /// </summary>\n        public readonly static int Entertainment = 30820040;\n\n        /// <summary>\n        /// Companies that provide content, Internet navigation services, and reference guide\n        /// information for the World Wide Web through its platforms, including social media, search\n        /// engines, and networking platform companies.\n        /// </summary>\n        public readonly static int InternetContentAndInformation = 30830010;\n\n        /// <summary>\n        /// Companies that primarily develop or publish video games and other multimedia software\n        /// applications for devices that include personal computers, video game systems,\n        /// cellphones, tablets, and other portable media players.\n        /// </summary>\n        public readonly static int ElectronicGamingAndMultimedia = 30830020;\n\n        /// <summary>\n        /// Companies primarily engaged in the drilling for petroleum and natural gas.\n        /// </summary>\n        public readonly static int OilAndGasDrilling = 30910010;\n\n        /// <summary>\n        /// Energy companies which are primarily engaged in oil and gas exploration and production.\n        /// </summary>\n        public readonly static int OilAndGasEAndP = 30910020;\n\n        /// <summary>\n        /// Major energy companies engaged in the diverse aspects of oil and gas operations,\n        /// including crude oil and gas exploration, production, manufacturing, refining, marketing,\n        /// and transportation.\n        /// </summary>\n        public readonly static int OilAndGasIntegrated = 30910030;\n\n        /// <summary>\n        /// Companies that own and operate oilfield pipelines and are involved in the gathering,\n        /// processing, and transportation of natural crude petroleum.\n        /// </summary>\n        public readonly static int OilAndGasMidstream = 30910040;\n\n        /// <summary>\n        /// Companies that refine, gather, market, and sell petroleum and petroleum products.\n        /// </summary>\n        public readonly static int OilAndGasRefiningAndMarketing = 30910050;\n\n        /// <summary>\n        /// Companies that provide oilfield services and equipment for activities such as contract\n        /// drilling and seismic surveys. Also includes equipment and tool rental, pumping and\n        /// processing services, and inspection and contracting services.\n        /// </summary>\n        public readonly static int OilAndGasEquipmentAndServices = 30910060;\n\n        /// <summary>\n        /// Companies that mine thermal coal, which is used for generating energy. Excludes\n        /// companies that mine coking coal to make steel.\n        /// </summary>\n        public readonly static int ThermalCoal = 30920010;\n\n        /// <summary>\n        /// Companies that mine, refine, produce, and mill uranium and uranium-related materials.\n        /// </summary>\n        public readonly static int Uranium = 30920020;\n\n        /// <summary>\n        /// Companies that manufacture aerospace and defense products, including aircraft and\n        /// aircraft parts, tanks, guided missiles, space vehicles, ships and marine equipment, and\n        /// other aerospace and defense components and systems, as well as companies supporting\n        /// these products through repair and maintenance services.\n        /// </summary>\n        public readonly static int AerospaceAndDefense = 31010010;\n\n        /// <summary>\n        /// Companies that provide services to the commercial or business market, including\n        /// information distribution, warehousing, graphic design, accounting, printing, and\n        /// miscellaneous services.\n        /// </summary>\n        public readonly static int SpecialtyBusinessServices = 31020010;\n\n        /// <summary>\n        /// Companies that provide management, research, and consulting services to businesses and\n        /// other agencies. Includes companies engaged in strategic and management consulting\n        /// services, interior design, and information and analytics.\n        /// </summary>\n        public readonly static int ConsultingServices = 31020020;\n\n        /// <summary>\n        /// Companies that rent or lease durable goods to the commercial and consumer market,\n        /// including cars and trucks, medical and industrial equipment, appliances and tools, and\n        /// miscellaneous goods.\n        /// </summary>\n        public readonly static int RentalAndLeasingServices = 31020030;\n\n        /// <summary>\n        /// Companies that provide security and protective services, including protective or\n        /// preventive devices, security guards and inspection services, security alarm and\n        /// monitoring systems, detention and correction facilities, and other security-based services.\n        /// </summary>\n        public readonly static int SecurityAndProtectionServices = 31020040;\n\n        /// <summary>\n        /// Companies that provide staffing and employment services, including temporary staffing\n        /// and permanent placement, outsources workforce and other employment-related services to\n        /// businesses and government. Also includes companies providing online staffing services.\n        /// </summary>\n        public readonly static int StaffingAndEmploymentServices = 31020050;\n\n        /// <summary>\n        /// Companies that are in several separate lines of business with no single line providing\n        /// the dominant source of revenue or income.\n        /// </summary>\n        public readonly static int Conglomerates = 31030010;\n\n        /// <summary>\n        /// Companies engaged in the design, construction, or contracting of industrial and\n        /// nonresidential structures, streets and highways, bridges and tunnels, docks and piers,\n        /// dams and water projects, utility lines, and other large building projects. Also includes\n        /// companies that provide engineering consulting and architectural services to consumer and\n        /// commercial clients.\n        /// </summary>\n        public readonly static int EngineeringAndConstruction = 31040010;\n\n        /// <summary>\n        /// Companies that develop, finance, maintain, or manage infrastructure operations such as\n        /// ports, airports, and roadways.\n        /// </summary>\n        public readonly static int InfrastructureOperations = 31040020;\n\n        /// <summary>\n        /// Companies that manufacture building and construction products and materials, including\n        /// ceramic floor and wall tiles, plumbing, HVAC, framing structures, and doors. Excludes\n        /// companies that are classified in the building materials industry.\n        /// </summary>\n        public readonly static int BuildingProductsAndEquipment = 31040030;\n\n        /// <summary>\n        /// Companies that manufacture agricultural and construction machinery, including tractors,\n        /// planting and harvesting machines, cranes, earthmovers, excavators, and related equipment\n        /// and machinery. Includes truck manufacturers that provide local and long-haul trucking\n        /// and transfer services for freight and cargo.\n        /// </summary>\n        public readonly static int FarmAndHeavyConstructionMachinery = 31050010;\n\n        /// <summary>\n        /// Companies primarily engaged in the distribution and supply of industrial equipment,\n        /// including construction and farming machinery, garden equipment and supplies, and other\n        /// industrial items to a diversified market of redistributors and end users.\n        /// </summary>\n        public readonly static int IndustrialDistribution = 31060010;\n\n        /// <summary>\n        /// Companies that manufacture and market office and business machines, such as copiers, fax\n        /// machines, postage meters, point-of-sale terminals, and ATMs.\n        /// </summary>\n        public readonly static int BusinessEquipmentAndSupplies = 31070010;\n\n        /// <summary>\n        /// Companies engaged in diversified machinery manufacturing operations, including paper and\n        /// food production machines, printing machinery, engines and turbines, air and gas\n        /// processors, blowers and fans, furnaces and ovens, and other general and special industry machines.\n        /// </summary>\n        public readonly static int SpecialtyIndustrialMachinery = 31070020;\n\n        /// <summary>\n        /// Companies that fabricate, stamp, or form iron, steel, or other metals into products such\n        /// as structured components by cutting, bending, and assembling processes of basic metals\n        /// to create a final product.\n        /// </summary>\n        public readonly static int MetalFabrication = 31070030;\n\n        /// <summary>\n        /// Companies that manufacture equipment designed to control pollution, including control\n        /// systems, hazardous waste disposal systems, recovery systems, treatment processes,\n        /// filtration systems, cleaning and separation applications, and recycling machinery.\n        /// </summary>\n        public readonly static int PollutionAndTreatmentControls = 31070040;\n\n        /// <summary>\n        /// Companies that manufacture small, hand-held tools, including power-driven drills,\n        /// welding apparatus, lawn and garden equipment, and other power or manually operated tools\n        /// and accessories, such as hardware, nuts, bolts, rivets, and other fasteners.\n        /// </summary>\n        public readonly static int ToolsAndAccessories = 31070050;\n\n        /// <summary>\n        /// Companies that manufacture electrical equipment (such as smart-grid electrical\n        /// equipment, utility metering, high- and low-voltage electrical equipment, transmission\n        /// control devices, switches, and lighting distribution boxes), batteries, electrical wires\n        /// and cables, and automation control.\n        /// </summary>\n        public readonly static int ElectricalEquipmentAndParts = 31070060;\n\n        /// <summary>\n        /// Air transportation companies that provide related air services, including helicopter\n        /// transportation, air-charter services, in-flight catering services, and air emergency and\n        /// business-related services.\n        /// </summary>\n        public readonly static int AirportsAndAirServices = 31080010;\n\n        /// <summary>\n        /// Major international passenger airline companies that fly a wide range of domestic and\n        /// international routes.\n        /// </summary>\n        public readonly static int Airlines = 31080020;\n\n        /// <summary>\n        /// Companies that provide transportation of freight by line-haul railroad as well as\n        /// related railroad equipment and repair services. Includes companies offering passenger\n        /// services via railway and roadways.\n        /// </summary>\n        public readonly static int Railroads = 31080030;\n\n        /// <summary>\n        /// Companies that transport freight and cargo via water and operate marine ports. Includes\n        /// companies that provide passenger services via water.\n        /// </summary>\n        public readonly static int MarineShipping = 31080040;\n\n        /// <summary>\n        /// Companies that provide local and long-haul trucking and transfer services for freight\n        /// and cargo.\n        /// </summary>\n        public readonly static int Trucking = 31080050;\n\n        /// <summary>\n        /// Companies that transport freight and cargo via diversified methods such as railroads,\n        /// airlines, and waterways.\n        /// </summary>\n        public readonly static int IntegratedFreightAndLogistics = 31080060;\n\n        /// <summary>\n        /// Companies that collect, treat, store, transfer, recycle, and dispose of waste materials,\n        /// as well as companies that provide supporting environmental, engineering, and consulting services.\n        /// </summary>\n        public readonly static int WasteManagement = 31090010;\n\n        /// <summary>\n        /// Companies that provide computer-system design, network and systems operations, repair\n        /// services, technical support, computer technology consulting, development, and\n        /// implementation services.\n        /// </summary>\n        public readonly static int InformationTechnologyServices = 31110010;\n\n        /// <summary>\n        /// Companies that primarily design, develop, market, and support application software\n        /// programs, including those that are cloud-based, for specific consumer and business functions.\n        /// </summary>\n        public readonly static int SoftwareApplication = 31110020;\n\n        /// <summary>\n        /// Companies that develop, design, support, and provide system software and services,\n        /// including operating systems, networking software and devices, web portal services, cloud\n        /// storage, and related services.\n        /// </summary>\n        public readonly static int SoftwareInfrastructure = 31110030;\n\n        /// <summary>\n        /// Companies that design, develop, manufacture, and market equipment for the communication\n        /// industry, including fiber-optic cable; telecom peripherals; voice and data transmission\n        /// and processing equipment; satellite products and equipment; video-conferencing systems\n        /// and equipment; and interactive communication systems. Also includes companies that offer\n        /// networking products that provide connectivity solutions for multi-use computing environments.\n        /// </summary>\n        public readonly static int CommunicationEquipment = 31120010;\n\n        /// <summary>\n        /// Companies that design, manufacture, and market computer systems, high mainframe servers,\n        /// supercomputer, and 3D printers and scanners. Also includes companies that manufacture\n        /// and market data storage products and other storage and backup devices for computers.\n        /// </summary>\n        public readonly static int ComputerHardware = 31120020;\n\n        /// <summary>\n        /// Companies that manufacture and market mobile communication products and household audio\n        /// and video equipment, including radios, stereos, televisions, DVD player and personal use\n        /// Drones. Excludes electric household appliances.\n        /// </summary>\n        public readonly static int ConsumerElectronics = 31120030;\n\n        /// <summary>\n        /// Companies that design, develop, manufacture, and market electronic devices, including\n        /// electron tubes; electronic capacitors; electronic resistors; electronic coil and\n        /// transformers; sensors; LED, TFT, and LCD displays; electronic connectors; printed\n        /// circuit boards; circuit assemblies; and other general-purpose electronics components and products.\n        /// </summary>\n        public readonly static int ElectronicComponents = 31120040;\n\n        /// <summary>\n        /// Companies primarily engaged in the distribution, supply, and support of computers and\n        /// computer systems, peripheral equipment, and software and other technological goods,\n        /// including electronic equipment and appliances, electrical cable, wires, and other\n        /// components to various consumer, commercial, and manufacturing customers.\n        /// </summary>\n        public readonly static int ElectronicsAndComputerDistribution = 31120050;\n\n        /// <summary>\n        /// Companies that design, develop, manufacture, and market sophisticated electronics of a\n        /// technical nature, including lab apparatus, process and flow control devices, precise\n        /// measurement and signal processing tools, search and navigation equipment, and other\n        /// scientific or technical analytical or measuring devices.\n        /// </summary>\n        public readonly static int ScientificAndTechnicalInstruments = 31120060;\n\n        /// <summary>\n        /// Companies that design, develop, manufacture, and market equipment, spare parts, tools,\n        /// cleaning devices, and related materials for the semiconductor industry.\n        /// </summary>\n        public readonly static int SemiconductorEquipmentAndMaterials = 31130010;\n\n        /// <summary>\n        /// Semiconductor companies that design, manufacture, and market integrated circuits,\n        /// microprocessors, logic devices, chipsets, and memory chips for a wide variety of users.\n        /// Includes companies that design, manufacture, and market general-application integrated\n        /// circuits and memory and memory-intensive products.\n        /// </summary>\n        public readonly static int Semiconductors = 31130020;\n\n        /// <summary>\n        /// Companies that design, manufacture, market, or install solar power systems and components.\n        /// </summary>\n        public readonly static int Solar = 31130030;\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/FineFundamental.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the FineFundamental class\n    /// </summary>\n    public partial class FineFundamental\n    {\n        /// <summary>\n        /// The end time of this data.\n        /// </summary>\n        [JsonIgnore]\n        public override DateTime EndTime\n        {\n            get { return Time + QuantConnect.Time.OneDay; }\n            set { Time = value - QuantConnect.Time.OneDay; }\n        }\n\n        /// <summary>\n        /// Price * Total SharesOutstanding.\n        /// The most current market cap for example, would be the most recent closing price x the most recent reported shares outstanding.\n        /// For ADR share classes, market cap is price * (ordinary shares outstanding / adr ratio).\n        /// </summary>\n        [JsonIgnore]\n        public long MarketCap => CompanyProfile.MarketCap;\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            throw new InvalidOperationException();\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            throw new InvalidOperationException();\n        }\n\n        /// <summary>\n        /// Clones this fine data instance\n        /// </summary>\n        /// <returns></returns>\n        public override BaseData Clone()\n        {\n            return new FineFundamental(Time, Symbol, _fundamentalInstanceProvider);\n        }\n\n        /// <summary>\n        /// This is a daily data set\n        /// </summary>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n\n        /// <summary>\n        /// This is a daily data set\n        /// </summary>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Fundamental.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Lean fundamental data class\n    /// </summary>\n    public class Fundamental : FineFundamental\n    {\n        /// <summary>\n        /// Gets the day's dollar volume for this symbol\n        /// </summary>\n        public override double DollarVolume => FundamentalService.Get<double>(Time, Symbol.ID, FundamentalProperty.DollarVolume);\n\n        /// <summary>\n        /// Gets the day's total volume\n        /// </summary>\n        public override long Volume => FundamentalService.Get<long>(Time, Symbol.ID, FundamentalProperty.Volume);\n\n        /// <summary>\n        /// Returns whether the symbol has fundamental data for the given date\n        /// </summary>\n        public override bool HasFundamentalData => FundamentalService.Get<bool>(Time, Symbol.ID, FundamentalProperty.HasFundamentalData);\n\n        /// <summary>\n        /// Gets the price factor for the given date\n        /// </summary>\n        public override decimal PriceFactor => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.PriceFactor);\n\n        /// <summary>\n        /// Gets the split factor for the given date\n        /// </summary>\n        public override decimal SplitFactor => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.SplitFactor);\n\n        /// <summary>\n        /// Gets the raw price\n        /// </summary>\n        public override decimal Value => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.Value);\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public Fundamental()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"symbol\">The associated symbol</param>\n        public Fundamental(DateTime time, Symbol symbol)\n            : base(time, symbol)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"symbol\">The associated symbol</param>\n        public static Fundamental ForDate(DateTime time, Symbol symbol)\n        {\n            // Important: set EndTime to time so that time is previous day midnight, if we just set time, EndTime would be NEXT day midnight.\n            // Note: data for T date is available on T+1 date, fundamental selection also handles this, see BaseDataCollectionSubscriptionEnumeratorFactory\n            return new Fundamental(time, symbol) { EndTime = time };\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var path = Path.Combine(Globals.DataFolder, \"equity\", config.Market, \"fundamental\", \"coarse\", $\"{date:yyyyMMdd}.csv\");\n            return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Will read a new instance from the given line\n        /// </summary>\n        /// <param name=\"config\">The associated requested configuration</param>\n        /// <param name=\"line\">The line to parse</param>\n        /// <param name=\"date\">The current time</param>\n        /// <param name=\"isLiveMode\">True if live mode</param>\n        /// <returns>A new instance or null</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            try\n            {\n                var csv = line.Split(',');\n                var sid = SecurityIdentifier.Parse(csv[0]);\n                // This use case/Reader implementation is only for history, where the user requests specific symbols only\n                // and because we use the same source file as the universe Fundamentals we need to filter out other symbols\n                if (sid == config.Symbol.ID)\n                {\n                    return new Fundamental(date, new Symbol(sid, csv[1]));\n                }\n            }\n            catch\n            {\n                // pass\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Will clone the current instance\n        /// </summary>\n        /// <returns>The cloned instance</returns>\n        public override BaseData Clone()\n        {\n            return new Fundamental(Time, Symbol);\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/FundamentalInstanceProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Per symbol we will have a fundamental class provider so the instances can be reused\n    /// </summary>\n    public class FundamentalInstanceProvider\n    {\n        private static readonly Dictionary<SecurityIdentifier, FundamentalInstanceProvider> _cache = new();\n\n        private readonly FundamentalTimeProvider _timeProvider;\n        private readonly FinancialStatements _financialStatements;\n        private readonly OperationRatios _operationRatios;\n        private readonly SecurityReference _securityReference;\n        private readonly CompanyReference _companyReference;\n        private readonly CompanyProfile _companyProfile;\n        private readonly AssetClassification _assetClassification;\n        private readonly ValuationRatios _valuationRatios;\n        private readonly EarningRatios _earningRatios;\n        private readonly EarningReports _earningReports;\n\n        /// <summary>\n        /// Get's the fundamental instance provider for the requested symbol\n        /// </summary>\n        /// <param name=\"symbol\">The requested symbol</param>\n        /// <returns>The unique instance provider</returns>\n        public static FundamentalInstanceProvider Get(Symbol symbol)\n        {\n            FundamentalInstanceProvider result = null;\n            lock (_cache)\n            {\n                _cache.TryGetValue(symbol.ID, out result);\n            }\n\n            if (result == null)\n            {\n                // we create the fundamental instance provider without holding the cache lock, this is because it uses the pygil\n                // Deadlock case: if the main thread has PyGil and wants to take lock on cache (security.Fundamentals use case) and the data\n                // stack thread takes the lock on the cache (creating new fundamentals) and next wants the pygil deadlock!\n                result = new FundamentalInstanceProvider(symbol);\n                lock (_cache)\n                {\n                    _cache[symbol.ID] = result;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a new fundamental instance provider\n        /// </summary>\n        /// <param name=\"symbol\">The target symbol</param>\n        private FundamentalInstanceProvider(Symbol symbol)\n        {\n            _timeProvider = new();\n            _financialStatements = new(_timeProvider, symbol.ID);\n            _operationRatios = new(_timeProvider, symbol.ID);\n            _securityReference = new(_timeProvider, symbol.ID);\n            _companyReference = new(_timeProvider, symbol.ID);\n            _companyProfile = new(_timeProvider, symbol.ID);\n            _assetClassification = new(_timeProvider, symbol.ID);\n            _valuationRatios = new(_timeProvider, symbol.ID);\n            _earningRatios = new(_timeProvider, symbol.ID);\n            _earningReports = new(_timeProvider, symbol.ID);\n        }\n\n        /// <summary>\n        /// Returns the ValuationRatios instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public ValuationRatios GetValuationRatios(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _valuationRatios;\n        }\n\n        /// <summary>\n        /// Returns the EarningRatios instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public EarningRatios GetEarningRatios(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _earningRatios;\n        }\n\n        /// <summary>\n        /// Returns the EarningReports instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public EarningReports GetEarningReports(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _earningReports;\n        }\n\n        /// <summary>\n        /// Returns the OperationRatios instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public OperationRatios GetOperationRatios(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _operationRatios;\n        }\n\n        /// <summary>\n        /// Returns the FinancialStatements instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public FinancialStatements GetFinancialStatements(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _financialStatements;\n        }\n\n        /// <summary>\n        /// Returns the SecurityReference instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public SecurityReference GetSecurityReference(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _securityReference;\n        }\n\n        /// <summary>\n        /// Returns the CompanyReference instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public CompanyReference GetCompanyReference(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _companyReference;\n        }\n\n        /// <summary>\n        /// Returns the CompanyProfile instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public CompanyProfile GetCompanyProfile(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _companyProfile;\n        }\n\n        /// <summary>\n        /// Returns the AssetClassification instance\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public AssetClassification GetAssetClassification(DateTime time)\n        {\n            _timeProvider.Time = time;\n            return _assetClassification;\n        }\n\n        private class FundamentalTimeProvider : ITimeProvider\n        {\n            public DateTime Time;\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public DateTime GetUtcNow() => Time;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/FundamentalProperty.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The fundamental property to access\n    /// </summary>\n    public enum FundamentalProperty\n    {\n#pragma warning disable CS1591, CA1707\n        Market,\n        DollarVolume,\n        Volume,\n        HasFundamentalData,\n        PriceFactor,\n        SplitFactor,\n        Value,\n        Price,\n        CompanyReference_CompanyId,\n        CompanyReference_ShortName,\n        CompanyReference_StandardName,\n        CompanyReference_LegalName,\n        CompanyReference_CountryId,\n        CompanyReference_CIK,\n        CompanyReference_CompanyStatus,\n        CompanyReference_FiscalYearEnd,\n        CompanyReference_IndustryTemplateCode,\n        CompanyReference_PrimaryShareClassID,\n        CompanyReference_PrimarySymbol,\n        CompanyReference_PrimaryExchangeID,\n        CompanyReference_BusinessCountryID,\n        CompanyReference_LegalNameLanguageCode,\n        CompanyReference_Auditor,\n        CompanyReference_AuditorLanguageCode,\n        CompanyReference_Advisor,\n        CompanyReference_AdvisorLanguageCode,\n        CompanyReference_IsLimitedPartnership,\n        CompanyReference_IsREIT,\n        CompanyReference_PrimaryMIC,\n        CompanyReference_ReportStyle,\n        CompanyReference_YearofEstablishment,\n        CompanyReference_IsLimitedLiabilityCompany,\n        CompanyReference_ExpectedFiscalYearEnd,\n        SecurityReference_SecuritySymbol,\n        SecurityReference_ExchangeId,\n        SecurityReference_CurrencyId,\n        SecurityReference_IPODate,\n        SecurityReference_IsDepositaryReceipt,\n        SecurityReference_DepositaryReceiptRatio,\n        SecurityReference_SecurityType,\n        SecurityReference_ShareClassDescription,\n        SecurityReference_ShareClassStatus,\n        SecurityReference_IsPrimaryShare,\n        SecurityReference_IsDividendReinvest,\n        SecurityReference_IsDirectInvest,\n        SecurityReference_InvestmentId,\n        SecurityReference_IPOOfferPrice,\n        SecurityReference_DelistingDate,\n        SecurityReference_DelistingReason,\n        SecurityReference_MIC,\n        SecurityReference_CommonShareSubType,\n        SecurityReference_IPOOfferPriceRange,\n        SecurityReference_ExchangeSubMarketGlobalId,\n        SecurityReference_ConversionRatio,\n        SecurityReference_ParValue,\n        SecurityReference_TradingStatus,\n        SecurityReference_MarketDataID,\n        FinancialStatements_PeriodEndingDate_OneMonth,\n        FinancialStatements_PeriodEndingDate_TwoMonths,\n        FinancialStatements_PeriodEndingDate_ThreeMonths,\n        FinancialStatements_PeriodEndingDate_SixMonths,\n        FinancialStatements_PeriodEndingDate_NineMonths,\n        FinancialStatements_PeriodEndingDate_TwelveMonths,\n        FinancialStatements_FileDate_OneMonth,\n        FinancialStatements_FileDate_TwoMonths,\n        FinancialStatements_FileDate_ThreeMonths,\n        FinancialStatements_FileDate_SixMonths,\n        FinancialStatements_FileDate_NineMonths,\n        FinancialStatements_FileDate_TwelveMonths,\n        FinancialStatements_AccessionNumber_OneMonth,\n        FinancialStatements_AccessionNumber_TwoMonths,\n        FinancialStatements_AccessionNumber_ThreeMonths,\n        FinancialStatements_AccessionNumber_SixMonths,\n        FinancialStatements_AccessionNumber_NineMonths,\n        FinancialStatements_FormType_OneMonth,\n        FinancialStatements_FormType_TwoMonths,\n        FinancialStatements_FormType_ThreeMonths,\n        FinancialStatements_FormType_SixMonths,\n        FinancialStatements_FormType_NineMonths,\n        FinancialStatements_FormType_TwelveMonths,\n        FinancialStatements_PeriodAuditor_OneMonth,\n        FinancialStatements_PeriodAuditor_TwoMonths,\n        FinancialStatements_PeriodAuditor_ThreeMonths,\n        FinancialStatements_PeriodAuditor_SixMonths,\n        FinancialStatements_PeriodAuditor_NineMonths,\n        FinancialStatements_PeriodAuditor_TwelveMonths,\n        FinancialStatements_AuditorReportStatus_OneMonth,\n        FinancialStatements_AuditorReportStatus_TwoMonths,\n        FinancialStatements_AuditorReportStatus_ThreeMonths,\n        FinancialStatements_AuditorReportStatus_SixMonths,\n        FinancialStatements_AuditorReportStatus_NineMonths,\n        FinancialStatements_AuditorReportStatus_TwelveMonths,\n        FinancialStatements_InventoryValuationMethod_OneMonth,\n        FinancialStatements_InventoryValuationMethod_TwoMonths,\n        FinancialStatements_InventoryValuationMethod_ThreeMonths,\n        FinancialStatements_InventoryValuationMethod_SixMonths,\n        FinancialStatements_InventoryValuationMethod_NineMonths,\n        FinancialStatements_InventoryValuationMethod_TwelveMonths,\n        FinancialStatements_NumberOfShareHolders_OneMonth,\n        FinancialStatements_NumberOfShareHolders_TwoMonths,\n        FinancialStatements_NumberOfShareHolders_ThreeMonths,\n        FinancialStatements_NumberOfShareHolders_SixMonths,\n        FinancialStatements_NumberOfShareHolders_NineMonths,\n        FinancialStatements_NumberOfShareHolders_TwelveMonths,\n        FinancialStatements_PeriodType_OneMonth,\n        FinancialStatements_PeriodType_TwoMonths,\n        FinancialStatements_PeriodType_ThreeMonths,\n        FinancialStatements_PeriodType_SixMonths,\n        FinancialStatements_PeriodType_NineMonths,\n        FinancialStatements_PeriodType_TwelveMonths,\n        FinancialStatements_TotalRiskBasedCapital_OneMonth,\n        FinancialStatements_TotalRiskBasedCapital_ThreeMonths,\n        FinancialStatements_TotalRiskBasedCapital_SixMonths,\n        FinancialStatements_TotalRiskBasedCapital_NineMonths,\n        FinancialStatements_TotalRiskBasedCapital_TwelveMonths,\n        FinancialStatements_IncomeStatement_ISFileDate_OneMonth,\n        FinancialStatements_IncomeStatement_ISFileDate_TwoMonths,\n        FinancialStatements_IncomeStatement_ISFileDate_ThreeMonths,\n        FinancialStatements_IncomeStatement_ISFileDate_SixMonths,\n        FinancialStatements_IncomeStatement_ISFileDate_NineMonths,\n        FinancialStatements_IncomeStatement_ISFileDate_TwelveMonths,\n        FinancialStatements_IncomeStatement_Amortization_OneMonth,\n        FinancialStatements_IncomeStatement_Amortization_TwoMonths,\n        FinancialStatements_IncomeStatement_Amortization_ThreeMonths,\n        FinancialStatements_IncomeStatement_Amortization_SixMonths,\n        FinancialStatements_IncomeStatement_Amortization_NineMonths,\n        FinancialStatements_IncomeStatement_Amortization_TwelveMonths,\n        FinancialStatements_IncomeStatement_SecuritiesAmortization_OneMonth,\n        FinancialStatements_IncomeStatement_SecuritiesAmortization_ThreeMonths,\n        FinancialStatements_IncomeStatement_SecuritiesAmortization_SixMonths,\n        FinancialStatements_IncomeStatement_SecuritiesAmortization_NineMonths,\n        FinancialStatements_IncomeStatement_SecuritiesAmortization_TwelveMonths,\n        FinancialStatements_IncomeStatement_CostOfRevenue_OneMonth,\n        FinancialStatements_IncomeStatement_CostOfRevenue_TwoMonths,\n        FinancialStatements_IncomeStatement_CostOfRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_CostOfRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_CostOfRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_CostOfRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_Depletion_ThreeMonths,\n        FinancialStatements_IncomeStatement_Depletion_SixMonths,\n        FinancialStatements_IncomeStatement_Depletion_NineMonths,\n        FinancialStatements_IncomeStatement_Depletion_TwelveMonths,\n        FinancialStatements_IncomeStatement_Depreciation_OneMonth,\n        FinancialStatements_IncomeStatement_Depreciation_ThreeMonths,\n        FinancialStatements_IncomeStatement_Depreciation_SixMonths,\n        FinancialStatements_IncomeStatement_Depreciation_NineMonths,\n        FinancialStatements_IncomeStatement_Depreciation_TwelveMonths,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_OneMonth,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwoMonths,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_ThreeMonths,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_SixMonths,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_NineMonths,\n        FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwelveMonths,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_OneMonth,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwoMonths,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_ThreeMonths,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_SixMonths,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_NineMonths,\n        FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwelveMonths,\n        FinancialStatements_IncomeStatement_ExciseTaxes_ThreeMonths,\n        FinancialStatements_IncomeStatement_ExciseTaxes_SixMonths,\n        FinancialStatements_IncomeStatement_ExciseTaxes_NineMonths,\n        FinancialStatements_IncomeStatement_ExciseTaxes_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwelveMonths,\n        FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_SixMonths,\n        FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_NineMonths,\n        FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_OneMonth,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_SixMonths,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_NineMonths,\n        FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_GrossProfit_OneMonth,\n        FinancialStatements_IncomeStatement_GrossProfit_TwoMonths,\n        FinancialStatements_IncomeStatement_GrossProfit_ThreeMonths,\n        FinancialStatements_IncomeStatement_GrossProfit_SixMonths,\n        FinancialStatements_IncomeStatement_GrossProfit_NineMonths,\n        FinancialStatements_IncomeStatement_GrossProfit_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpense_OneMonth,\n        FinancialStatements_IncomeStatement_InterestExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpense_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpense_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_OneMonth,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_OneMonth,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_SixMonths,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_NineMonths,\n        FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_LossAdjustmentExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_LossAdjustmentExpense_SixMonths,\n        FinancialStatements_IncomeStatement_LossAdjustmentExpense_NineMonths,\n        FinancialStatements_IncomeStatement_LossAdjustmentExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_MinorityInterests_OneMonth,\n        FinancialStatements_IncomeStatement_MinorityInterests_TwoMonths,\n        FinancialStatements_IncomeStatement_MinorityInterests_ThreeMonths,\n        FinancialStatements_IncomeStatement_MinorityInterests_SixMonths,\n        FinancialStatements_IncomeStatement_MinorityInterests_NineMonths,\n        FinancialStatements_IncomeStatement_MinorityInterests_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncome_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetInterestIncome_OneMonth,\n        FinancialStatements_IncomeStatement_NetInterestIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_NetInterestIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetInterestIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NetInterestIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NetInterestIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetInvestmentIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetInvestmentIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NetInvestmentIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NetInvestmentIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalRevenue_OneMonth,\n        FinancialStatements_IncomeStatement_TotalRevenue_TwoMonths,\n        FinancialStatements_IncomeStatement_TotalRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_TotalRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_TotalRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_NonInterestExpense_OneMonth,\n        FinancialStatements_IncomeStatement_NonInterestExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_NonInterestExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_NonInterestExpense_SixMonths,\n        FinancialStatements_IncomeStatement_NonInterestExpense_NineMonths,\n        FinancialStatements_IncomeStatement_NonInterestExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_NonInterestIncome_OneMonth,\n        FinancialStatements_IncomeStatement_NonInterestIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_NonInterestIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NonInterestIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NonInterestIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NonInterestIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_OperatingExpense_OneMonth,\n        FinancialStatements_IncomeStatement_OperatingExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_OperatingExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_OperatingExpense_SixMonths,\n        FinancialStatements_IncomeStatement_OperatingExpense_NineMonths,\n        FinancialStatements_IncomeStatement_OperatingExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_OperatingIncome_OneMonth,\n        FinancialStatements_IncomeStatement_OperatingIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_OperatingIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_OperatingIncome_SixMonths,\n        FinancialStatements_IncomeStatement_OperatingIncome_NineMonths,\n        FinancialStatements_IncomeStatement_OperatingIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_OperatingRevenue_OneMonth,\n        FinancialStatements_IncomeStatement_OperatingRevenue_TwoMonths,\n        FinancialStatements_IncomeStatement_OperatingRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_OperatingRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_OperatingRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_OperatingRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_OneMonth,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_SixMonths,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_NineMonths,\n        FinancialStatements_IncomeStatement_OtherIncomeExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_SixMonths,\n        FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_NineMonths,\n        FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_SixMonths,\n        FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_NineMonths,\n        FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_TwelveMonths,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_OneMonth,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_TwoMonths,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_ThreeMonths,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_SixMonths,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_NineMonths,\n        FinancialStatements_IncomeStatement_PreferredStockDividends_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalPremiumsEarned_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalPremiumsEarned_SixMonths,\n        FinancialStatements_IncomeStatement_TotalPremiumsEarned_NineMonths,\n        FinancialStatements_IncomeStatement_TotalPremiumsEarned_TwelveMonths,\n        FinancialStatements_IncomeStatement_PretaxIncome_OneMonth,\n        FinancialStatements_IncomeStatement_PretaxIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_PretaxIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_PretaxIncome_SixMonths,\n        FinancialStatements_IncomeStatement_PretaxIncome_NineMonths,\n        FinancialStatements_IncomeStatement_PretaxIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_TaxProvision_OneMonth,\n        FinancialStatements_IncomeStatement_TaxProvision_TwoMonths,\n        FinancialStatements_IncomeStatement_TaxProvision_ThreeMonths,\n        FinancialStatements_IncomeStatement_TaxProvision_SixMonths,\n        FinancialStatements_IncomeStatement_TaxProvision_NineMonths,\n        FinancialStatements_IncomeStatement_TaxProvision_TwelveMonths,\n        FinancialStatements_IncomeStatement_CreditLossesProvision_OneMonth,\n        FinancialStatements_IncomeStatement_CreditLossesProvision_ThreeMonths,\n        FinancialStatements_IncomeStatement_CreditLossesProvision_SixMonths,\n        FinancialStatements_IncomeStatement_CreditLossesProvision_NineMonths,\n        FinancialStatements_IncomeStatement_CreditLossesProvision_TwelveMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_OneMonth,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwoMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_ThreeMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_SixMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_NineMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwelveMonths,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_OneMonth,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_SixMonths,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_NineMonths,\n        FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_OneMonth,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwoMonths,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_ThreeMonths,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_SixMonths,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_NineMonths,\n        FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwelveMonths,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_OneMonth,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwoMonths,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_ThreeMonths,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_SixMonths,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_NineMonths,\n        FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalExpenses_OneMonth,\n        FinancialStatements_IncomeStatement_TotalExpenses_TwoMonths,\n        FinancialStatements_IncomeStatement_TotalExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_TotalExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_TotalExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncome_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncome_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncome_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_EBIT_OneMonth,\n        FinancialStatements_IncomeStatement_EBIT_TwoMonths,\n        FinancialStatements_IncomeStatement_EBIT_ThreeMonths,\n        FinancialStatements_IncomeStatement_EBIT_SixMonths,\n        FinancialStatements_IncomeStatement_EBIT_NineMonths,\n        FinancialStatements_IncomeStatement_EBIT_TwelveMonths,\n        FinancialStatements_IncomeStatement_EBITDA_OneMonth,\n        FinancialStatements_IncomeStatement_EBITDA_TwoMonths,\n        FinancialStatements_IncomeStatement_EBITDA_ThreeMonths,\n        FinancialStatements_IncomeStatement_EBITDA_SixMonths,\n        FinancialStatements_IncomeStatement_EBITDA_NineMonths,\n        FinancialStatements_IncomeStatement_EBITDA_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_TwelveMonths,\n        FinancialStatements_IncomeStatement_CededPremiums_ThreeMonths,\n        FinancialStatements_IncomeStatement_CededPremiums_SixMonths,\n        FinancialStatements_IncomeStatement_CededPremiums_NineMonths,\n        FinancialStatements_IncomeStatement_CededPremiums_TwelveMonths,\n        FinancialStatements_IncomeStatement_CommissionExpenses_OneMonth,\n        FinancialStatements_IncomeStatement_CommissionExpenses_TwoMonths,\n        FinancialStatements_IncomeStatement_CommissionExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_CommissionExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_CommissionExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_CommissionExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_CreditCard_ThreeMonths,\n        FinancialStatements_IncomeStatement_CreditCard_SixMonths,\n        FinancialStatements_IncomeStatement_CreditCard_NineMonths,\n        FinancialStatements_IncomeStatement_CreditCard_TwelveMonths,\n        FinancialStatements_IncomeStatement_DividendIncome_OneMonth,\n        FinancialStatements_IncomeStatement_DividendIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_DividendIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_DividendIncome_SixMonths,\n        FinancialStatements_IncomeStatement_DividendIncome_NineMonths,\n        FinancialStatements_IncomeStatement_DividendIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_OneMonth,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwoMonths,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_ThreeMonths,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_SixMonths,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_NineMonths,\n        FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwelveMonths,\n        FinancialStatements_IncomeStatement_Equipment_ThreeMonths,\n        FinancialStatements_IncomeStatement_Equipment_SixMonths,\n        FinancialStatements_IncomeStatement_Equipment_NineMonths,\n        FinancialStatements_IncomeStatement_Equipment_TwelveMonths,\n        FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_FeesAndCommissions_OneMonth,\n        FinancialStatements_IncomeStatement_FeesAndCommissions_ThreeMonths,\n        FinancialStatements_IncomeStatement_FeesAndCommissions_SixMonths,\n        FinancialStatements_IncomeStatement_FeesAndCommissions_NineMonths,\n        FinancialStatements_IncomeStatement_FeesAndCommissions_TwelveMonths,\n        FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_ThreeMonths,\n        FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_SixMonths,\n        FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_NineMonths,\n        FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_TwelveMonths,\n        FinancialStatements_IncomeStatement_Fuel_OneMonth,\n        FinancialStatements_IncomeStatement_Fuel_TwoMonths,\n        FinancialStatements_IncomeStatement_Fuel_ThreeMonths,\n        FinancialStatements_IncomeStatement_Fuel_SixMonths,\n        FinancialStatements_IncomeStatement_Fuel_NineMonths,\n        FinancialStatements_IncomeStatement_Fuel_TwelveMonths,\n        FinancialStatements_IncomeStatement_FuelAndPurchasePower_ThreeMonths,\n        FinancialStatements_IncomeStatement_FuelAndPurchasePower_SixMonths,\n        FinancialStatements_IncomeStatement_FuelAndPurchasePower_NineMonths,\n        FinancialStatements_IncomeStatement_FuelAndPurchasePower_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_OneMonth,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwoMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_SixMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_NineMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfPPE_OneMonth,\n        FinancialStatements_IncomeStatement_GainOnSaleOfPPE_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfPPE_SixMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfPPE_NineMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfPPE_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_OneMonth,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwoMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_SixMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_NineMonths,\n        FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwelveMonths,\n        FinancialStatements_IncomeStatement_GrossPremiumsWritten_ThreeMonths,\n        FinancialStatements_IncomeStatement_GrossPremiumsWritten_SixMonths,\n        FinancialStatements_IncomeStatement_GrossPremiumsWritten_NineMonths,\n        FinancialStatements_IncomeStatement_GrossPremiumsWritten_TwelveMonths,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_OneMonth,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwoMonths,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_ThreeMonths,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_SixMonths,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_NineMonths,\n        FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwelveMonths,\n        FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_ThreeMonths,\n        FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_SixMonths,\n        FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_NineMonths,\n        FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_TwelveMonths,\n        FinancialStatements_IncomeStatement_InsuranceAndClaims_ThreeMonths,\n        FinancialStatements_IncomeStatement_InsuranceAndClaims_SixMonths,\n        FinancialStatements_IncomeStatement_InsuranceAndClaims_NineMonths,\n        FinancialStatements_IncomeStatement_InsuranceAndClaims_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForDeposit_OneMonth,\n        FinancialStatements_IncomeStatement_InterestExpenseForDeposit_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForDeposit_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForDeposit_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForDeposit_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_OneMonth,\n        FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_SixMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_NineMonths,\n        FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLeases_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLeases_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLeases_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLeases_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLeases_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoans_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoans_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoans_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoans_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoans_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_TwelveMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_OneMonth,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwoMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_ThreeMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_SixMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_NineMonths,\n        FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwelveMonths,\n        FinancialStatements_IncomeStatement_InvestmentBankingProfit_ThreeMonths,\n        FinancialStatements_IncomeStatement_InvestmentBankingProfit_SixMonths,\n        FinancialStatements_IncomeStatement_InvestmentBankingProfit_NineMonths,\n        FinancialStatements_IncomeStatement_InvestmentBankingProfit_TwelveMonths,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_OneMonth,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwoMonths,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_ThreeMonths,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_SixMonths,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_NineMonths,\n        FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_SixMonths,\n        FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_NineMonths,\n        FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetOccupancyExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetOccupancyExpense_SixMonths,\n        FinancialStatements_IncomeStatement_NetOccupancyExpense_NineMonths,\n        FinancialStatements_IncomeStatement_NetOccupancyExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetPremiumsWritten_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetPremiumsWritten_SixMonths,\n        FinancialStatements_IncomeStatement_NetPremiumsWritten_NineMonths,\n        FinancialStatements_IncomeStatement_NetPremiumsWritten_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_SixMonths,\n        FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_NineMonths,\n        FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_TwelveMonths,\n        FinancialStatements_IncomeStatement_OccupancyAndEquipment_ThreeMonths,\n        FinancialStatements_IncomeStatement_OccupancyAndEquipment_SixMonths,\n        FinancialStatements_IncomeStatement_OccupancyAndEquipment_NineMonths,\n        FinancialStatements_IncomeStatement_OccupancyAndEquipment_TwelveMonths,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_OneMonth,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_TwoMonths,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_ThreeMonths,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_SixMonths,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_NineMonths,\n        FinancialStatements_IncomeStatement_OperationAndMaintenance_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherCustomerServices_OneMonth,\n        FinancialStatements_IncomeStatement_OtherCustomerServices_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherCustomerServices_SixMonths,\n        FinancialStatements_IncomeStatement_OtherCustomerServices_NineMonths,\n        FinancialStatements_IncomeStatement_OtherCustomerServices_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherInterestExpense_OneMonth,\n        FinancialStatements_IncomeStatement_OtherInterestExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherInterestExpense_SixMonths,\n        FinancialStatements_IncomeStatement_OtherInterestExpense_NineMonths,\n        FinancialStatements_IncomeStatement_OtherInterestExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherInterestIncome_OneMonth,\n        FinancialStatements_IncomeStatement_OtherInterestIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherInterestIncome_SixMonths,\n        FinancialStatements_IncomeStatement_OtherInterestIncome_NineMonths,\n        FinancialStatements_IncomeStatement_OtherInterestIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_OneMonth,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_SixMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_NineMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherSpecialCharges_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherSpecialCharges_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherSpecialCharges_SixMonths,\n        FinancialStatements_IncomeStatement_OtherSpecialCharges_NineMonths,\n        FinancialStatements_IncomeStatement_OtherSpecialCharges_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherTaxes_OneMonth,\n        FinancialStatements_IncomeStatement_OtherTaxes_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherTaxes_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherTaxes_SixMonths,\n        FinancialStatements_IncomeStatement_OtherTaxes_NineMonths,\n        FinancialStatements_IncomeStatement_OtherTaxes_TwelveMonths,\n        FinancialStatements_IncomeStatement_PolicyholderBenefitsCeded_TwelveMonths,\n        FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_ThreeMonths,\n        FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_SixMonths,\n        FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_NineMonths,\n        FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_TwelveMonths,\n        FinancialStatements_IncomeStatement_PolicyholderDividends_ThreeMonths,\n        FinancialStatements_IncomeStatement_PolicyholderDividends_SixMonths,\n        FinancialStatements_IncomeStatement_PolicyholderDividends_NineMonths,\n        FinancialStatements_IncomeStatement_PolicyholderDividends_TwelveMonths,\n        FinancialStatements_IncomeStatement_PolicyholderInterest_ThreeMonths,\n        FinancialStatements_IncomeStatement_PolicyholderInterest_SixMonths,\n        FinancialStatements_IncomeStatement_PolicyholderInterest_NineMonths,\n        FinancialStatements_IncomeStatement_PolicyholderInterest_TwelveMonths,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_OneMonth,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwoMonths,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_SixMonths,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_NineMonths,\n        FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwoMonths,\n        FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_ThreeMonths,\n        FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_SixMonths,\n        FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_NineMonths,\n        FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwelveMonths,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_OneMonth,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_TwoMonths,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_ThreeMonths,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_SixMonths,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_NineMonths,\n        FinancialStatements_IncomeStatement_RentAndLandingFees_TwelveMonths,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_OneMonth,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwoMonths,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_ThreeMonths,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_SixMonths,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_NineMonths,\n        FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwelveMonths,\n        FinancialStatements_IncomeStatement_SalariesAndWages_OneMonth,\n        FinancialStatements_IncomeStatement_SalariesAndWages_TwoMonths,\n        FinancialStatements_IncomeStatement_SalariesAndWages_ThreeMonths,\n        FinancialStatements_IncomeStatement_SalariesAndWages_SixMonths,\n        FinancialStatements_IncomeStatement_SalariesAndWages_NineMonths,\n        FinancialStatements_IncomeStatement_SalariesAndWages_TwelveMonths,\n        FinancialStatements_IncomeStatement_SecuritiesActivities_ThreeMonths,\n        FinancialStatements_IncomeStatement_SecuritiesActivities_SixMonths,\n        FinancialStatements_IncomeStatement_SecuritiesActivities_NineMonths,\n        FinancialStatements_IncomeStatement_SecuritiesActivities_TwelveMonths,\n        FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_OneMonth,\n        FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_ThreeMonths,\n        FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_SixMonths,\n        FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_NineMonths,\n        FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_TwelveMonths,\n        FinancialStatements_IncomeStatement_TradingGainLoss_OneMonth,\n        FinancialStatements_IncomeStatement_TradingGainLoss_ThreeMonths,\n        FinancialStatements_IncomeStatement_TradingGainLoss_SixMonths,\n        FinancialStatements_IncomeStatement_TradingGainLoss_NineMonths,\n        FinancialStatements_IncomeStatement_TradingGainLoss_TwelveMonths,\n        FinancialStatements_IncomeStatement_TrustFeesbyCommissions_ThreeMonths,\n        FinancialStatements_IncomeStatement_TrustFeesbyCommissions_SixMonths,\n        FinancialStatements_IncomeStatement_TrustFeesbyCommissions_NineMonths,\n        FinancialStatements_IncomeStatement_TrustFeesbyCommissions_TwelveMonths,\n        FinancialStatements_IncomeStatement_UnderwritingExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_UnderwritingExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_UnderwritingExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_UnderwritingExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_WriteOff_ThreeMonths,\n        FinancialStatements_IncomeStatement_WriteOff_SixMonths,\n        FinancialStatements_IncomeStatement_WriteOff_NineMonths,\n        FinancialStatements_IncomeStatement_WriteOff_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestIncome_OneMonth,\n        FinancialStatements_IncomeStatement_OtherNonInterestIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestIncome_SixMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestIncome_NineMonths,\n        FinancialStatements_IncomeStatement_OtherNonInterestIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_OneMonth,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwoMonths,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_ThreeMonths,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_SixMonths,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_NineMonths,\n        FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_OneMonth,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_OneMonth,\n        FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_SixMonths,\n        FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_NineMonths,\n        FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_TwelveMonths,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_OneMonth,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwoMonths,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_OneMonth,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_TwoMonths,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_ThreeMonths,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_SixMonths,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_NineMonths,\n        FinancialStatements_IncomeStatement_ReconciledDepreciation_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncome_OneMonth,\n        FinancialStatements_IncomeStatement_NormalizedIncome_TwoMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainLossonSaleofAssets_OneMonth,\n        FinancialStatements_IncomeStatement_GainLossonSaleofAssets_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainLossonSaleofAssets_SixMonths,\n        FinancialStatements_IncomeStatement_GainLossonSaleofAssets_NineMonths,\n        FinancialStatements_IncomeStatement_GainLossonSaleofAssets_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofLoans_OneMonth,\n        FinancialStatements_IncomeStatement_GainonSaleofLoans_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofLoans_SixMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofLoans_NineMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofLoans_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_SixMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_NineMonths,\n        FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_TwelveMonths,\n        FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_ThreeMonths,\n        FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_SixMonths,\n        FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_NineMonths,\n        FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_TwelveMonths,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_OneMonth,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwoMonths,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_ThreeMonths,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_SixMonths,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_NineMonths,\n        FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_OneMonth,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwoMonths,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_ThreeMonths,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_SixMonths,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_NineMonths,\n        FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_OneMonth,\n        FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_SixMonths,\n        FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_NineMonths,\n        FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_TwelveMonths,\n        FinancialStatements_IncomeStatement_StaffCosts_TwoMonths,\n        FinancialStatements_IncomeStatement_StaffCosts_ThreeMonths,\n        FinancialStatements_IncomeStatement_StaffCosts_SixMonths,\n        FinancialStatements_IncomeStatement_StaffCosts_NineMonths,\n        FinancialStatements_IncomeStatement_StaffCosts_TwelveMonths,\n        FinancialStatements_IncomeStatement_SocialSecurityCosts_TwelveMonths,\n        FinancialStatements_IncomeStatement_PensionCosts_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_SixMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_NineMonths,\n        FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwelveMonths,\n        FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_ThreeMonths,\n        FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_SixMonths,\n        FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_NineMonths,\n        FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalOtherFinanceCost_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalOtherFinanceCost_SixMonths,\n        FinancialStatements_IncomeStatement_TotalOtherFinanceCost_NineMonths,\n        FinancialStatements_IncomeStatement_TotalOtherFinanceCost_TwelveMonths,\n        FinancialStatements_IncomeStatement_GrossDividendPayment_ThreeMonths,\n        FinancialStatements_IncomeStatement_GrossDividendPayment_NineMonths,\n        FinancialStatements_IncomeStatement_GrossDividendPayment_TwelveMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionIncome_SixMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionIncome_NineMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionExpense_ThreeMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionExpense_SixMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionExpense_NineMonths,\n        FinancialStatements_IncomeStatement_FeesandCommissionExpense_TwelveMonths,\n        FinancialStatements_IncomeStatement_NetTradingIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherStaffCosts_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainonInvestmentProperties_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainonInvestmentProperties_SixMonths,\n        FinancialStatements_IncomeStatement_GainonInvestmentProperties_NineMonths,\n        FinancialStatements_IncomeStatement_GainonInvestmentProperties_TwelveMonths,\n        FinancialStatements_IncomeStatement_AverageDilutionEarnings_ThreeMonths,\n        FinancialStatements_IncomeStatement_AverageDilutionEarnings_SixMonths,\n        FinancialStatements_IncomeStatement_AverageDilutionEarnings_NineMonths,\n        FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_SixMonths,\n        FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_NineMonths,\n        FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_SixMonths,\n        FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_NineMonths,\n        FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_TwelveMonths,\n        FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_ThreeMonths,\n        FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_SixMonths,\n        FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_TwelveMonths,\n        FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_ThreeMonths,\n        FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_SixMonths,\n        FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_NineMonths,\n        FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_TwelveMonths,\n        FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_ThreeMonths,\n        FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_SixMonths,\n        FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_NineMonths,\n        FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_TwelveMonths,\n        FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_ThreeMonths,\n        FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_SixMonths,\n        FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_NineMonths,\n        FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_TwelveMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_ThreeMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_SixMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_NineMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_TwelveMonths,\n        FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_ThreeMonths,\n        FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_SixMonths,\n        FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_NineMonths,\n        FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_TwelveMonths,\n        FinancialStatements_IncomeStatement_ChangeinInvestmentContract_ThreeMonths,\n        FinancialStatements_IncomeStatement_ChangeinInvestmentContract_SixMonths,\n        FinancialStatements_IncomeStatement_ChangeinInvestmentContract_NineMonths,\n        FinancialStatements_IncomeStatement_ChangeinInvestmentContract_TwelveMonths,\n        FinancialStatements_IncomeStatement_CreditRiskProvisions_ThreeMonths,\n        FinancialStatements_IncomeStatement_CreditRiskProvisions_SixMonths,\n        FinancialStatements_IncomeStatement_CreditRiskProvisions_NineMonths,\n        FinancialStatements_IncomeStatement_CreditRiskProvisions_TwelveMonths,\n        FinancialStatements_IncomeStatement_WagesandSalaries_SixMonths,\n        FinancialStatements_IncomeStatement_WagesandSalaries_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwoMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncome_SixMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncome_NineMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_SixMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_NineMonths,\n        FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_OneMonth,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_TwoMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_SixMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_NineMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItems_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_OneMonth,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwoMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_SixMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_NineMonths,\n        FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwelveMonths,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_OneMonth,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_TwoMonths,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_ThreeMonths,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_SixMonths,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_NineMonths,\n        FinancialStatements_IncomeStatement_TaxRateForCalcs_TwelveMonths,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_OneMonth,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwoMonths,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_ThreeMonths,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_SixMonths,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_NineMonths,\n        FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_OneMonth,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_TwoMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDA_TwelveMonths,\n        FinancialStatements_IncomeStatement_StockBasedCompensation_ThreeMonths,\n        FinancialStatements_IncomeStatement_StockBasedCompensation_SixMonths,\n        FinancialStatements_IncomeStatement_StockBasedCompensation_NineMonths,\n        FinancialStatements_IncomeStatement_StockBasedCompensation_TwelveMonths,\n        FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_ThreeMonths,\n        FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_SixMonths,\n        FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_NineMonths,\n        FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_TwelveMonths,\n        FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_ThreeMonths,\n        FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_SixMonths,\n        FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_NineMonths,\n        FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_TwelveMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_ThreeMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_SixMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_NineMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_SixMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_NineMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_SixMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_NineMonths,\n        FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_TwelveMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_ThreeMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_SixMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_NineMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_TwelveMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_ThreeMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_SixMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_NineMonths,\n        FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_TwelveMonths,\n        FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_ThreeMonths,\n        FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_SixMonths,\n        FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_NineMonths,\n        FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_TwelveMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_ThreeMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_SixMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_NineMonths,\n        FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherGA_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherGA_SixMonths,\n        FinancialStatements_IncomeStatement_OtherGA_NineMonths,\n        FinancialStatements_IncomeStatement_OtherGA_TwelveMonths,\n        FinancialStatements_IncomeStatement_OtherCostofRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_OtherCostofRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_OtherCostofRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_OtherCostofRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_DDACostofRevenue_ThreeMonths,\n        FinancialStatements_IncomeStatement_DDACostofRevenue_SixMonths,\n        FinancialStatements_IncomeStatement_DDACostofRevenue_NineMonths,\n        FinancialStatements_IncomeStatement_DDACostofRevenue_TwelveMonths,\n        FinancialStatements_IncomeStatement_RentExpenseSupplemental_ThreeMonths,\n        FinancialStatements_IncomeStatement_RentExpenseSupplemental_SixMonths,\n        FinancialStatements_IncomeStatement_RentExpenseSupplemental_NineMonths,\n        FinancialStatements_IncomeStatement_RentExpenseSupplemental_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_TwelveMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_ThreeMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_SixMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_NineMonths,\n        FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_TwelveMonths,\n        FinancialStatements_IncomeStatement_DepreciationSupplemental_ThreeMonths,\n        FinancialStatements_IncomeStatement_DepreciationSupplemental_SixMonths,\n        FinancialStatements_IncomeStatement_DepreciationSupplemental_NineMonths,\n        FinancialStatements_IncomeStatement_DepreciationSupplemental_TwelveMonths,\n        FinancialStatements_IncomeStatement_AmortizationSupplemental_ThreeMonths,\n        FinancialStatements_IncomeStatement_AmortizationSupplemental_SixMonths,\n        FinancialStatements_IncomeStatement_AmortizationSupplemental_NineMonths,\n        FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths,\n        FinancialStatements_IncomeStatement_TotalRevenueAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_TotalRevenueAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_TotalRevenueAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_TotalRevenueAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_OperatingExpenseAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_OperatingExpenseAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_OperatingExpenseAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_OperatingExpenseAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedEBITAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_TwelveMonths,\n        FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_ThreeMonths,\n        FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_SixMonths,\n        FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_NineMonths,\n        FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_TwelveMonths,\n        FinancialStatements_BalanceSheet_BSFileDate_OneMonth,\n        FinancialStatements_BalanceSheet_BSFileDate_ThreeMonths,\n        FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccountsPayable_OneMonth,\n        FinancialStatements_BalanceSheet_AccountsPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_AccountsPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccountsPayable_SixMonths,\n        FinancialStatements_BalanceSheet_AccountsPayable_NineMonths,\n        FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccountsReceivable_OneMonth,\n        FinancialStatements_BalanceSheet_AccountsReceivable_TwoMonths,\n        FinancialStatements_BalanceSheet_AccountsReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccountsReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_AccountsReceivable_NineMonths,\n        FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedInvestmentIncome_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedInvestmentIncome_SixMonths,\n        FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_OneMonth,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwoMonths,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_SixMonths,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_NineMonths,\n        FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_OneMonth,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwoMonths,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_ThreeMonths,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_SixMonths,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_NineMonths,\n        FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwelveMonths,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_OneMonth,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwoMonths,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_SixMonths,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_NineMonths,\n        FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_ThreeMonths,\n        FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_SixMonths,\n        FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_NineMonths,\n        FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths,\n        FinancialStatements_BalanceSheet_AvailableForSaleSecurities_ThreeMonths,\n        FinancialStatements_BalanceSheet_AvailableForSaleSecurities_SixMonths,\n        FinancialStatements_BalanceSheet_AvailableForSaleSecurities_NineMonths,\n        FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CapitalStock_OneMonth,\n        FinancialStatements_BalanceSheet_CapitalStock_TwoMonths,\n        FinancialStatements_BalanceSheet_CapitalStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_CapitalStock_SixMonths,\n        FinancialStatements_BalanceSheet_CapitalStock_NineMonths,\n        FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_Cash_OneMonth,\n        FinancialStatements_BalanceSheet_Cash_TwoMonths,\n        FinancialStatements_BalanceSheet_Cash_ThreeMonths,\n        FinancialStatements_BalanceSheet_Cash_SixMonths,\n        FinancialStatements_BalanceSheet_Cash_NineMonths,\n        FinancialStatements_BalanceSheet_Cash_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashEquivalents_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashEquivalents_SixMonths,\n        FinancialStatements_BalanceSheet_CashEquivalents_NineMonths,\n        FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_OneMonth,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwoMonths,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_SixMonths,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_NineMonths,\n        FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashAndDueFromBanks_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashAndDueFromBanks_SixMonths,\n        FinancialStatements_BalanceSheet_CashAndDueFromBanks_NineMonths,\n        FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwoMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_SixMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_NineMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_OneMonth,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwoMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_SixMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_NineMonths,\n        FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CommonStock_OneMonth,\n        FinancialStatements_BalanceSheet_CommonStock_TwoMonths,\n        FinancialStatements_BalanceSheet_CommonStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_CommonStock_SixMonths,\n        FinancialStatements_BalanceSheet_CommonStock_NineMonths,\n        FinancialStatements_BalanceSheet_CommonStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentAssets_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentAssets_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentAssets_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDebt_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDebt_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDebt_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDebt_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDebt_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDebt_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredAssets_SixMonths,\n        FinancialStatements_BalanceSheet_DeferredAssets_NineMonths,\n        FinancialStatements_BalanceSheet_DeferredAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredCosts_OneMonth,\n        FinancialStatements_BalanceSheet_DeferredCosts_TwoMonths,\n        FinancialStatements_BalanceSheet_DeferredCosts_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredCosts_SixMonths,\n        FinancialStatements_BalanceSheet_DeferredCosts_NineMonths,\n        FinancialStatements_BalanceSheet_DeferredCosts_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_SixMonths,\n        FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_NineMonths,\n        FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxAssets_SixMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxAssets_NineMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_EquityInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_EquityInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_EquityInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_ThreeMonths,\n        FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_SixMonths,\n        FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_TwelveMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths,\n        FinancialStatements_BalanceSheet_FixedMaturityInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_FixedMaturityInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_FixedMaturityInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_FixedMaturityInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_FuturePolicyBenefits_ThreeMonths,\n        FinancialStatements_BalanceSheet_FuturePolicyBenefits_TwelveMonths,\n        FinancialStatements_BalanceSheet_GeneralPartnershipCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_GeneralPartnershipCapital_SixMonths,\n        FinancialStatements_BalanceSheet_GeneralPartnershipCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_Goodwill_OneMonth,\n        FinancialStatements_BalanceSheet_Goodwill_TwoMonths,\n        FinancialStatements_BalanceSheet_Goodwill_ThreeMonths,\n        FinancialStatements_BalanceSheet_Goodwill_SixMonths,\n        FinancialStatements_BalanceSheet_Goodwill_NineMonths,\n        FinancialStatements_BalanceSheet_Goodwill_TwelveMonths,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_OneMonth,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_SixMonths,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_NineMonths,\n        FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_GrossLoan_ThreeMonths,\n        FinancialStatements_BalanceSheet_GrossLoan_SixMonths,\n        FinancialStatements_BalanceSheet_GrossLoan_NineMonths,\n        FinancialStatements_BalanceSheet_GrossLoan_TwelveMonths,\n        FinancialStatements_BalanceSheet_GrossPPE_OneMonth,\n        FinancialStatements_BalanceSheet_GrossPPE_TwoMonths,\n        FinancialStatements_BalanceSheet_GrossPPE_ThreeMonths,\n        FinancialStatements_BalanceSheet_GrossPPE_SixMonths,\n        FinancialStatements_BalanceSheet_GrossPPE_NineMonths,\n        FinancialStatements_BalanceSheet_GrossPPE_TwelveMonths,\n        FinancialStatements_BalanceSheet_HeldToMaturitySecurities_ThreeMonths,\n        FinancialStatements_BalanceSheet_HeldToMaturitySecurities_SixMonths,\n        FinancialStatements_BalanceSheet_HeldToMaturitySecurities_NineMonths,\n        FinancialStatements_BalanceSheet_HeldToMaturitySecurities_TwelveMonths,\n        FinancialStatements_BalanceSheet_IncomeTaxPayable_OneMonth,\n        FinancialStatements_BalanceSheet_IncomeTaxPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_IncomeTaxPayable_SixMonths,\n        FinancialStatements_BalanceSheet_IncomeTaxPayable_NineMonths,\n        FinancialStatements_BalanceSheet_IncomeTaxPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_InterestPayable_OneMonth,\n        FinancialStatements_BalanceSheet_InterestPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_InterestPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_InterestPayable_SixMonths,\n        FinancialStatements_BalanceSheet_InterestPayable_NineMonths,\n        FinancialStatements_BalanceSheet_InterestPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_SixMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_NineMonths,\n        FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_Inventory_OneMonth,\n        FinancialStatements_BalanceSheet_Inventory_TwoMonths,\n        FinancialStatements_BalanceSheet_Inventory_ThreeMonths,\n        FinancialStatements_BalanceSheet_Inventory_SixMonths,\n        FinancialStatements_BalanceSheet_Inventory_NineMonths,\n        FinancialStatements_BalanceSheet_Inventory_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_OneMonth,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwoMonths,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_SixMonths,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_NineMonths,\n        FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwelveMonths,\n        FinancialStatements_BalanceSheet_LimitedPartnershipCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_LimitedPartnershipCapital_SixMonths,\n        FinancialStatements_BalanceSheet_LimitedPartnershipCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_LongTermDebt_OneMonth,\n        FinancialStatements_BalanceSheet_LongTermDebt_TwoMonths,\n        FinancialStatements_BalanceSheet_LongTermDebt_ThreeMonths,\n        FinancialStatements_BalanceSheet_LongTermDebt_SixMonths,\n        FinancialStatements_BalanceSheet_LongTermDebt_NineMonths,\n        FinancialStatements_BalanceSheet_LongTermDebt_TwelveMonths,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_OneMonth,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwoMonths,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_ThreeMonths,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_SixMonths,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_NineMonths,\n        FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwelveMonths,\n        FinancialStatements_BalanceSheet_LongTermInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_LongTermInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_LongTermInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_OneMonth,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwoMonths,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_ThreeMonths,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_SixMonths,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_NineMonths,\n        FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwelveMonths,\n        FinancialStatements_BalanceSheet_MinorityInterest_OneMonth,\n        FinancialStatements_BalanceSheet_MinorityInterest_TwoMonths,\n        FinancialStatements_BalanceSheet_MinorityInterest_ThreeMonths,\n        FinancialStatements_BalanceSheet_MinorityInterest_SixMonths,\n        FinancialStatements_BalanceSheet_MinorityInterest_NineMonths,\n        FinancialStatements_BalanceSheet_MinorityInterest_TwelveMonths,\n        FinancialStatements_BalanceSheet_MoneyMarketInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_MoneyMarketInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_MoneyMarketInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_MoneyMarketInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_NetLoan_ThreeMonths,\n        FinancialStatements_BalanceSheet_NetLoan_SixMonths,\n        FinancialStatements_BalanceSheet_NetLoan_NineMonths,\n        FinancialStatements_BalanceSheet_NetLoan_TwelveMonths,\n        FinancialStatements_BalanceSheet_NetPPE_OneMonth,\n        FinancialStatements_BalanceSheet_NetPPE_TwoMonths,\n        FinancialStatements_BalanceSheet_NetPPE_ThreeMonths,\n        FinancialStatements_BalanceSheet_NetPPE_SixMonths,\n        FinancialStatements_BalanceSheet_NetPPE_NineMonths,\n        FinancialStatements_BalanceSheet_NetPPE_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingDeposits_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingDeposits_SixMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingDeposits_NineMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingDeposits_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentNotesPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_NotesReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_NotesReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_NotesReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_OneMonth,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_SixMonths,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_NineMonths,\n        FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherShortTermInvestments_OneMonth,\n        FinancialStatements_BalanceSheet_OtherShortTermInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherShortTermInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_OtherShortTermInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_OtherShortTermInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_Payables_OneMonth,\n        FinancialStatements_BalanceSheet_Payables_TwoMonths,\n        FinancialStatements_BalanceSheet_Payables_ThreeMonths,\n        FinancialStatements_BalanceSheet_Payables_SixMonths,\n        FinancialStatements_BalanceSheet_Payables_NineMonths,\n        FinancialStatements_BalanceSheet_Payables_TwelveMonths,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_OneMonth,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwoMonths,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_ThreeMonths,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_SixMonths,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_NineMonths,\n        FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwelveMonths,\n        FinancialStatements_BalanceSheet_PolicyReservesBenefits_ThreeMonths,\n        FinancialStatements_BalanceSheet_PolicyReservesBenefits_SixMonths,\n        FinancialStatements_BalanceSheet_PolicyReservesBenefits_NineMonths,\n        FinancialStatements_BalanceSheet_PolicyReservesBenefits_TwelveMonths,\n        FinancialStatements_BalanceSheet_PolicyholderFunds_ThreeMonths,\n        FinancialStatements_BalanceSheet_PolicyholderFunds_TwelveMonths,\n        FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_OneMonth,\n        FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_ThreeMonths,\n        FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_SixMonths,\n        FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_NineMonths,\n        FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_TwelveMonths,\n        FinancialStatements_BalanceSheet_PreferredStock_OneMonth,\n        FinancialStatements_BalanceSheet_PreferredStock_TwoMonths,\n        FinancialStatements_BalanceSheet_PreferredStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_PreferredStock_SixMonths,\n        FinancialStatements_BalanceSheet_PreferredStock_NineMonths,\n        FinancialStatements_BalanceSheet_PreferredStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_PrepaidAssets_OneMonth,\n        FinancialStatements_BalanceSheet_PrepaidAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_PrepaidAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_PrepaidAssets_SixMonths,\n        FinancialStatements_BalanceSheet_PrepaidAssets_NineMonths,\n        FinancialStatements_BalanceSheet_PrepaidAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_Receivables_OneMonth,\n        FinancialStatements_BalanceSheet_Receivables_TwoMonths,\n        FinancialStatements_BalanceSheet_Receivables_ThreeMonths,\n        FinancialStatements_BalanceSheet_Receivables_SixMonths,\n        FinancialStatements_BalanceSheet_Receivables_NineMonths,\n        FinancialStatements_BalanceSheet_Receivables_TwelveMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceRecoverable_ThreeMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceRecoverable_TwelveMonths,\n        FinancialStatements_BalanceSheet_RetainedEarnings_OneMonth,\n        FinancialStatements_BalanceSheet_RetainedEarnings_TwoMonths,\n        FinancialStatements_BalanceSheet_RetainedEarnings_ThreeMonths,\n        FinancialStatements_BalanceSheet_RetainedEarnings_SixMonths,\n        FinancialStatements_BalanceSheet_RetainedEarnings_NineMonths,\n        FinancialStatements_BalanceSheet_RetainedEarnings_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_TwelveMonths,\n        FinancialStatements_BalanceSheet_SeparateAccountAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_SeparateAccountAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_SeparateAccountBusiness_ThreeMonths,\n        FinancialStatements_BalanceSheet_SeparateAccountBusiness_TwelveMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_ThreeMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_TwelveMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_ThreeMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_TwelveMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_ThreeMonths,\n        FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_TwelveMonths,\n        FinancialStatements_BalanceSheet_StockholdersEquity_OneMonth,\n        FinancialStatements_BalanceSheet_StockholdersEquity_TwoMonths,\n        FinancialStatements_BalanceSheet_StockholdersEquity_ThreeMonths,\n        FinancialStatements_BalanceSheet_StockholdersEquity_SixMonths,\n        FinancialStatements_BalanceSheet_StockholdersEquity_NineMonths,\n        FinancialStatements_BalanceSheet_StockholdersEquity_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_OneMonth,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_SixMonths,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_NineMonths,\n        FinancialStatements_BalanceSheet_TotalTaxPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalAssets_OneMonth,\n        FinancialStatements_BalanceSheet_TotalAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalAssets_SixMonths,\n        FinancialStatements_BalanceSheet_TotalAssets_NineMonths,\n        FinancialStatements_BalanceSheet_TotalAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalDeposits_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalDeposits_SixMonths,\n        FinancialStatements_BalanceSheet_TotalDeposits_NineMonths,\n        FinancialStatements_BalanceSheet_TotalDeposits_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_TotalInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_OneMonth,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_SixMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_NineMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalPartnershipCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalPartnershipCapital_SixMonths,\n        FinancialStatements_BalanceSheet_TotalPartnershipCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradingAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradingAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradingLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradingLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradingSecurities_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradingSecurities_SixMonths,\n        FinancialStatements_BalanceSheet_TradingSecurities_TwelveMonths,\n        FinancialStatements_BalanceSheet_TreasuryStock_OneMonth,\n        FinancialStatements_BalanceSheet_TreasuryStock_TwoMonths,\n        FinancialStatements_BalanceSheet_TreasuryStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_TreasuryStock_SixMonths,\n        FinancialStatements_BalanceSheet_TreasuryStock_NineMonths,\n        FinancialStatements_BalanceSheet_TreasuryStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnearnedIncome_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnearnedIncome_SixMonths,\n        FinancialStatements_BalanceSheet_UnearnedIncome_NineMonths,\n        FinancialStatements_BalanceSheet_UnearnedIncome_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnearnedPremiums_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnearnedPremiums_SixMonths,\n        FinancialStatements_BalanceSheet_UnearnedPremiums_NineMonths,\n        FinancialStatements_BalanceSheet_UnearnedPremiums_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_SixMonths,\n        FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_NineMonths,\n        FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestedCapital_OneMonth,\n        FinancialStatements_BalanceSheet_InvestedCapital_TwoMonths,\n        FinancialStatements_BalanceSheet_InvestedCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestedCapital_SixMonths,\n        FinancialStatements_BalanceSheet_InvestedCapital_NineMonths,\n        FinancialStatements_BalanceSheet_InvestedCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_OneMonth,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_NineMonths,\n        FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_OneMonth,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwoMonths,\n        FinancialStatements_BalanceSheet_SecuritiesAndInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecuritiesAndInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_SecuritiesAndInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_OneMonth,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_SixMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_NineMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_OneMonth,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_SixMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_NineMonths,\n        FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_OneMonth,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_SixMonths,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_NineMonths,\n        FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwelveMonths,\n        FinancialStatements_BalanceSheet_GrossAccountsReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_GrossAccountsReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwoMonths,\n        FinancialStatements_BalanceSheet_AccruedInterestReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedInterestReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_AccruedInterestReceivable_NineMonths,\n        FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_ThreeMonths,\n        FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_SixMonths,\n        FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_NineMonths,\n        FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths,\n        FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSale_ThreeMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths,\n        FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_ThreeMonths,\n        FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths,\n        FinancialStatements_BalanceSheet_BankIndebtedness_ThreeMonths,\n        FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths,\n        FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_ThreeMonths,\n        FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_SixMonths,\n        FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_NineMonths,\n        FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecurityBorrowed_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecurityBorrowed_TwelveMonths,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_OneMonth,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwoMonths,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_ThreeMonths,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_SixMonths,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_NineMonths,\n        FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths,\n        FinancialStatements_BalanceSheet_CommercialLoan_ThreeMonths,\n        FinancialStatements_BalanceSheet_CommercialLoan_SixMonths,\n        FinancialStatements_BalanceSheet_CommercialLoan_NineMonths,\n        FinancialStatements_BalanceSheet_CommercialLoan_TwelveMonths,\n        FinancialStatements_BalanceSheet_CommercialPaper_ThreeMonths,\n        FinancialStatements_BalanceSheet_CommercialPaper_TwelveMonths,\n        FinancialStatements_BalanceSheet_CommonStockEquity_OneMonth,\n        FinancialStatements_BalanceSheet_CommonStockEquity_TwoMonths,\n        FinancialStatements_BalanceSheet_CommonStockEquity_ThreeMonths,\n        FinancialStatements_BalanceSheet_CommonStockEquity_SixMonths,\n        FinancialStatements_BalanceSheet_CommonStockEquity_NineMonths,\n        FinancialStatements_BalanceSheet_CommonStockEquity_TwelveMonths,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_OneMonth,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_TwoMonths,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_ThreeMonths,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_SixMonths,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_NineMonths,\n        FinancialStatements_BalanceSheet_ConstructionInProgress_TwelveMonths,\n        FinancialStatements_BalanceSheet_ConsumerLoan_ThreeMonths,\n        FinancialStatements_BalanceSheet_ConsumerLoan_SixMonths,\n        FinancialStatements_BalanceSheet_ConsumerLoan_NineMonths,\n        FinancialStatements_BalanceSheet_ConsumerLoan_TwelveMonths,\n        FinancialStatements_BalanceSheet_MinimumPensionLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_MinimumPensionLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CustomerAcceptances_ThreeMonths,\n        FinancialStatements_BalanceSheet_CustomerAcceptances_TwelveMonths,\n        FinancialStatements_BalanceSheet_DefinedPensionBenefit_ThreeMonths,\n        FinancialStatements_BalanceSheet_DefinedPensionBenefit_SixMonths,\n        FinancialStatements_BalanceSheet_DefinedPensionBenefit_TwelveMonths,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_DerivativeAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_DerivativeAssets_SixMonths,\n        FinancialStatements_BalanceSheet_DerivativeAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_DividendsPayable_OneMonth,\n        FinancialStatements_BalanceSheet_DividendsPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_DividendsPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_DividendsPayable_NineMonths,\n        FinancialStatements_BalanceSheet_DividendsPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_EmployeeBenefits_TwoMonths,\n        FinancialStatements_BalanceSheet_EmployeeBenefits_ThreeMonths,\n        FinancialStatements_BalanceSheet_EmployeeBenefits_SixMonths,\n        FinancialStatements_BalanceSheet_EmployeeBenefits_NineMonths,\n        FinancialStatements_BalanceSheet_EmployeeBenefits_TwelveMonths,\n        FinancialStatements_BalanceSheet_FederalFundsPurchased_ThreeMonths,\n        FinancialStatements_BalanceSheet_FederalFundsPurchased_TwelveMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSold_ThreeMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSold_SixMonths,\n        FinancialStatements_BalanceSheet_FederalFundsSold_TwelveMonths,\n        FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_SixMonths,\n        FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_NineMonths,\n        FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialAssets_NineMonths,\n        FinancialStatements_BalanceSheet_FinancialAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_SixMonths,\n        FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinishedGoods_OneMonth,\n        FinancialStatements_BalanceSheet_FinishedGoods_TwoMonths,\n        FinancialStatements_BalanceSheet_FinishedGoods_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinishedGoods_SixMonths,\n        FinancialStatements_BalanceSheet_FinishedGoods_NineMonths,\n        FinancialStatements_BalanceSheet_FinishedGoods_TwelveMonths,\n        FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_ThreeMonths,\n        FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_SixMonths,\n        FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_TwelveMonths,\n        FinancialStatements_BalanceSheet_ForeclosedAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_ForeclosedAssets_NineMonths,\n        FinancialStatements_BalanceSheet_ForeclosedAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwoMonths,\n        FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_ThreeMonths,\n        FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_SixMonths,\n        FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_NineMonths,\n        FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwelveMonths,\n        FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_ThreeMonths,\n        FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_SixMonths,\n        FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_NineMonths,\n        FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_TwelveMonths,\n        FinancialStatements_BalanceSheet_LandAndImprovements_OneMonth,\n        FinancialStatements_BalanceSheet_LandAndImprovements_TwoMonths,\n        FinancialStatements_BalanceSheet_LandAndImprovements_ThreeMonths,\n        FinancialStatements_BalanceSheet_LandAndImprovements_SixMonths,\n        FinancialStatements_BalanceSheet_LandAndImprovements_NineMonths,\n        FinancialStatements_BalanceSheet_LandAndImprovements_TwelveMonths,\n        FinancialStatements_BalanceSheet_Leases_OneMonth,\n        FinancialStatements_BalanceSheet_Leases_TwoMonths,\n        FinancialStatements_BalanceSheet_Leases_ThreeMonths,\n        FinancialStatements_BalanceSheet_Leases_SixMonths,\n        FinancialStatements_BalanceSheet_Leases_NineMonths,\n        FinancialStatements_BalanceSheet_Leases_TwelveMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_ThreeMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_TwelveMonths,\n        FinancialStatements_BalanceSheet_LineOfCredit_OneMonth,\n        FinancialStatements_BalanceSheet_LineOfCredit_ThreeMonths,\n        FinancialStatements_BalanceSheet_LineOfCredit_NineMonths,\n        FinancialStatements_BalanceSheet_LineOfCredit_TwelveMonths,\n        FinancialStatements_BalanceSheet_LoansHeldForSale_ThreeMonths,\n        FinancialStatements_BalanceSheet_LoansHeldForSale_SixMonths,\n        FinancialStatements_BalanceSheet_LoansHeldForSale_NineMonths,\n        FinancialStatements_BalanceSheet_LoansHeldForSale_TwelveMonths,\n        FinancialStatements_BalanceSheet_LoansReceivable_TwoMonths,\n        FinancialStatements_BalanceSheet_LoansReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_LoansReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_LoansReceivable_NineMonths,\n        FinancialStatements_BalanceSheet_LoansReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_OneMonth,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwoMonths,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_ThreeMonths,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_SixMonths,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_NineMonths,\n        FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwelveMonths,\n        FinancialStatements_BalanceSheet_MaterialsAndSupplies_ThreeMonths,\n        FinancialStatements_BalanceSheet_MaterialsAndSupplies_TwelveMonths,\n        FinancialStatements_BalanceSheet_MineralProperties_ThreeMonths,\n        FinancialStatements_BalanceSheet_MineralProperties_SixMonths,\n        FinancialStatements_BalanceSheet_MineralProperties_NineMonths,\n        FinancialStatements_BalanceSheet_MineralProperties_TwelveMonths,\n        FinancialStatements_BalanceSheet_MortgageLoan_ThreeMonths,\n        FinancialStatements_BalanceSheet_MortgageLoan_SixMonths,\n        FinancialStatements_BalanceSheet_MortgageLoan_NineMonths,\n        FinancialStatements_BalanceSheet_MortgageLoan_TwelveMonths,\n        FinancialStatements_BalanceSheet_MortgageAndConsumerloans_ThreeMonths,\n        FinancialStatements_BalanceSheet_MortgageAndConsumerloans_TwelveMonths,\n        FinancialStatements_BalanceSheet_GrossNotesReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_GrossNotesReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherAssets_SixMonths,\n        FinancialStatements_BalanceSheet_OtherAssets_NineMonths,\n        FinancialStatements_BalanceSheet_OtherAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherCapitalStock_OneMonth,\n        FinancialStatements_BalanceSheet_OtherCapitalStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherCapitalStock_NineMonths,\n        FinancialStatements_BalanceSheet_OtherCapitalStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_OneMonth,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_SixMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_NineMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentBorrowings_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentBorrowings_SixMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentBorrowings_NineMonths,\n        FinancialStatements_BalanceSheet_OtherCurrentBorrowings_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherEquityAdjustments_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherEquityAdjustments_SixMonths,\n        FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherInventories_OneMonth,\n        FinancialStatements_BalanceSheet_OtherInventories_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherInventories_SixMonths,\n        FinancialStatements_BalanceSheet_OtherInventories_NineMonths,\n        FinancialStatements_BalanceSheet_OtherInventories_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherInvestedAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherInvestedAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_OneMonth,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_SixMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_NineMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherProperties_OneMonth,\n        FinancialStatements_BalanceSheet_OtherProperties_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherProperties_SixMonths,\n        FinancialStatements_BalanceSheet_OtherProperties_NineMonths,\n        FinancialStatements_BalanceSheet_OtherProperties_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherRealEstateOwned_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherRealEstateOwned_SixMonths,\n        FinancialStatements_BalanceSheet_OtherRealEstateOwned_NineMonths,\n        FinancialStatements_BalanceSheet_OtherRealEstateOwned_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherReceivables_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherReceivables_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherReceivables_SixMonths,\n        FinancialStatements_BalanceSheet_OtherReceivables_NineMonths,\n        FinancialStatements_BalanceSheet_OtherReceivables_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwoMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_SixMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_NineMonths,\n        FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwelveMonths,\n        FinancialStatements_BalanceSheet_PolicyLoans_ThreeMonths,\n        FinancialStatements_BalanceSheet_PolicyLoans_TwelveMonths,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_OneMonth,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_TwoMonths,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_ThreeMonths,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_SixMonths,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_NineMonths,\n        FinancialStatements_BalanceSheet_PreferredStockEquity_TwelveMonths,\n        FinancialStatements_BalanceSheet_Properties_ThreeMonths,\n        FinancialStatements_BalanceSheet_Properties_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentProvisions_TwoMonths,\n        FinancialStatements_BalanceSheet_CurrentProvisions_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentProvisions_SixMonths,\n        FinancialStatements_BalanceSheet_CurrentProvisions_TwelveMonths,\n        FinancialStatements_BalanceSheet_LongTermProvisions_ThreeMonths,\n        FinancialStatements_BalanceSheet_LongTermProvisions_SixMonths,\n        FinancialStatements_BalanceSheet_LongTermProvisions_NineMonths,\n        FinancialStatements_BalanceSheet_LongTermProvisions_TwelveMonths,\n        FinancialStatements_BalanceSheet_RawMaterials_TwoMonths,\n        FinancialStatements_BalanceSheet_RawMaterials_ThreeMonths,\n        FinancialStatements_BalanceSheet_RawMaterials_SixMonths,\n        FinancialStatements_BalanceSheet_RawMaterials_NineMonths,\n        FinancialStatements_BalanceSheet_RawMaterials_TwelveMonths,\n        FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_ThreeMonths,\n        FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_NineMonths,\n        FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_TwelveMonths,\n        FinancialStatements_BalanceSheet_RegulatoryAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_RegulatoryAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_RegulatoryLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_RegulatoryLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_RestrictedCash_OneMonth,\n        FinancialStatements_BalanceSheet_RestrictedCash_TwoMonths,\n        FinancialStatements_BalanceSheet_RestrictedCash_ThreeMonths,\n        FinancialStatements_BalanceSheet_RestrictedCash_SixMonths,\n        FinancialStatements_BalanceSheet_RestrictedCash_NineMonths,\n        FinancialStatements_BalanceSheet_RestrictedCash_TwelveMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_ThreeMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_SixMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_NineMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_TwelveMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_SixMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_NineMonths,\n        FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_RestrictedCommonStock_ThreeMonths,\n        FinancialStatements_BalanceSheet_RestrictedCommonStock_NineMonths,\n        FinancialStatements_BalanceSheet_RestrictedCommonStock_TwelveMonths,\n        FinancialStatements_BalanceSheet_RestrictedInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_RestrictedInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_TaxesReceivable_TwoMonths,\n        FinancialStatements_BalanceSheet_TaxesReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_TaxesReceivable_SixMonths,\n        FinancialStatements_BalanceSheet_TaxesReceivable_NineMonths,\n        FinancialStatements_BalanceSheet_TaxesReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalCapitalization_OneMonth,\n        FinancialStatements_BalanceSheet_TotalCapitalization_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalCapitalization_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalCapitalization_SixMonths,\n        FinancialStatements_BalanceSheet_TotalCapitalization_NineMonths,\n        FinancialStatements_BalanceSheet_TotalCapitalization_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnbilledReceivables_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnbilledReceivables_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnrealizedGainLoss_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnrealizedGainLoss_SixMonths,\n        FinancialStatements_BalanceSheet_UnrealizedGainLoss_TwelveMonths,\n        FinancialStatements_BalanceSheet_WorkInProcess_OneMonth,\n        FinancialStatements_BalanceSheet_WorkInProcess_TwoMonths,\n        FinancialStatements_BalanceSheet_WorkInProcess_ThreeMonths,\n        FinancialStatements_BalanceSheet_WorkInProcess_SixMonths,\n        FinancialStatements_BalanceSheet_WorkInProcess_NineMonths,\n        FinancialStatements_BalanceSheet_WorkInProcess_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_OneMonth,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_OneMonth,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwoMonths,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_ThreeMonths,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_SixMonths,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_NineMonths,\n        FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherLiabilities_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherLiabilities_SixMonths,\n        FinancialStatements_BalanceSheet_OtherLiabilities_NineMonths,\n        FinancialStatements_BalanceSheet_OtherLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherPayable_OneMonth,\n        FinancialStatements_BalanceSheet_OtherPayable_TwoMonths,\n        FinancialStatements_BalanceSheet_OtherPayable_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherPayable_SixMonths,\n        FinancialStatements_BalanceSheet_OtherPayable_NineMonths,\n        FinancialStatements_BalanceSheet_OtherPayable_TwelveMonths,\n        FinancialStatements_BalanceSheet_TangibleBookValue_OneMonth,\n        FinancialStatements_BalanceSheet_TangibleBookValue_TwoMonths,\n        FinancialStatements_BalanceSheet_TangibleBookValue_ThreeMonths,\n        FinancialStatements_BalanceSheet_TangibleBookValue_SixMonths,\n        FinancialStatements_BalanceSheet_TangibleBookValue_NineMonths,\n        FinancialStatements_BalanceSheet_TangibleBookValue_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalEquity_OneMonth,\n        FinancialStatements_BalanceSheet_TotalEquity_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalEquity_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalEquity_SixMonths,\n        FinancialStatements_BalanceSheet_TotalEquity_NineMonths,\n        FinancialStatements_BalanceSheet_TotalEquity_TwelveMonths,\n        FinancialStatements_BalanceSheet_WorkingCapital_OneMonth,\n        FinancialStatements_BalanceSheet_WorkingCapital_TwoMonths,\n        FinancialStatements_BalanceSheet_WorkingCapital_ThreeMonths,\n        FinancialStatements_BalanceSheet_WorkingCapital_SixMonths,\n        FinancialStatements_BalanceSheet_WorkingCapital_NineMonths,\n        FinancialStatements_BalanceSheet_WorkingCapital_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalDebt_OneMonth,\n        FinancialStatements_BalanceSheet_TotalDebt_TwoMonths,\n        FinancialStatements_BalanceSheet_TotalDebt_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalDebt_SixMonths,\n        FinancialStatements_BalanceSheet_TotalDebt_NineMonths,\n        FinancialStatements_BalanceSheet_TotalDebt_TwelveMonths,\n        FinancialStatements_BalanceSheet_CommonUtilityPlant_ThreeMonths,\n        FinancialStatements_BalanceSheet_CommonUtilityPlant_NineMonths,\n        FinancialStatements_BalanceSheet_CommonUtilityPlant_TwelveMonths,\n        FinancialStatements_BalanceSheet_ElectricUtilityPlant_ThreeMonths,\n        FinancialStatements_BalanceSheet_ElectricUtilityPlant_TwelveMonths,\n        FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_ThreeMonths,\n        FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_TwelveMonths,\n        FinancialStatements_BalanceSheet_NetUtilityPlant_ThreeMonths,\n        FinancialStatements_BalanceSheet_NetUtilityPlant_NineMonths,\n        FinancialStatements_BalanceSheet_NetUtilityPlant_TwelveMonths,\n        FinancialStatements_BalanceSheet_WaterProduction_ThreeMonths,\n        FinancialStatements_BalanceSheet_WaterProduction_TwelveMonths,\n        FinancialStatements_BalanceSheet_OrdinarySharesNumber_ThreeMonths,\n        FinancialStatements_BalanceSheet_OrdinarySharesNumber_TwelveMonths,\n        FinancialStatements_BalanceSheet_PreferredSharesNumber_ThreeMonths,\n        FinancialStatements_BalanceSheet_PreferredSharesNumber_TwelveMonths,\n        FinancialStatements_BalanceSheet_TreasurySharesNumber_ThreeMonths,\n        FinancialStatements_BalanceSheet_TreasurySharesNumber_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradingAndOtherReceivable_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradingAndOtherReceivable_TwelveMonths,\n        FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwoMonths,\n        FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_ThreeMonths,\n        FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwelveMonths,\n        FinancialStatements_BalanceSheet_SecuritiesLoaned_ThreeMonths,\n        FinancialStatements_BalanceSheet_SecuritiesLoaned_TwelveMonths,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_OneMonth,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_SixMonths,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_NineMonths,\n        FinancialStatements_BalanceSheet_NetTangibleAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedParties_ThreeMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedParties_TwelveMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentProperties_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentProperties_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwoMonths,\n        FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivables_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivables_TwelveMonths,\n        FinancialStatements_BalanceSheet_ConvertibleLoansCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_BankLoansCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherLoansCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherLoansCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncome_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths,\n        FinancialStatements_BalanceSheet_BankLoansNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherLoansNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherLoansNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherReserves_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherReserves_TwelveMonths,\n        FinancialStatements_BalanceSheet_LoansandAdvancestoBank_ThreeMonths,\n        FinancialStatements_BalanceSheet_LoansandAdvancestoBank_TwelveMonths,\n        FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_ThreeMonths,\n        FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_TwelveMonths,\n        FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_ThreeMonths,\n        FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_TwelveMonths,\n        FinancialStatements_BalanceSheet_EquitySharesInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_EquitySharesInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_DepositsbyBank_ThreeMonths,\n        FinancialStatements_BalanceSheet_DepositsbyBank_TwelveMonths,\n        FinancialStatements_BalanceSheet_CustomerAccounts_ThreeMonths,\n        FinancialStatements_BalanceSheet_CustomerAccounts_TwelveMonths,\n        FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_ThreeMonths,\n        FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_TwelveMonths,\n        FinancialStatements_BalanceSheet_SubordinatedLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_SubordinatedLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_ProvisionsTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_ProvisionsTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_OperatingLeaseAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OperatingLeaseAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_ClaimsOutstanding_ThreeMonths,\n        FinancialStatements_BalanceSheet_ClaimsOutstanding_TwelveMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtSecurities_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtSecurities_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_TaxesAssetsCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_TaxesAssetsCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherEquityInterest_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherEquityInterest_TwelveMonths,\n        FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherLoanAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherLoanAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_TaxAssetsTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_TaxAssetsTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_ThreeMonths,\n        FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths,\n        FinancialStatements_BalanceSheet_DepositCertificates_ThreeMonths,\n        FinancialStatements_BalanceSheet_DepositCertificates_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherBorrowedFunds_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherBorrowedFunds_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwoMonths,\n        FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredIncomeTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredIncomeTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_ReinsuranceAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_ThreeMonths,\n        FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_TwelveMonths,\n        FinancialStatements_BalanceSheet_InsuranceContractAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_InsuranceContractAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_InsuranceContractLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_InsuranceContractLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_ThreeMonths,\n        FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_TwelveMonths,\n        FinancialStatements_BalanceSheet_InvestmentContractLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_InvestmentContractLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_HedgingAssetsCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_HedgingAssetsCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_ConvertibleLoansTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_ConvertibleLoansTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_BankLoansTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherLoansTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherLoansTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtTotal_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtTotal_TwelveMonths,\n        FinancialStatements_BalanceSheet_ComTreShaNum_ThreeMonths,\n        FinancialStatements_BalanceSheet_ComTreShaNum_TwelveMonths,\n        FinancialStatements_BalanceSheet_PreTreShaNum_ThreeMonths,\n        FinancialStatements_BalanceSheet_PreTreShaNum_TwelveMonths,\n        FinancialStatements_BalanceSheet_NetDebt_OneMonth,\n        FinancialStatements_BalanceSheet_NetDebt_TwoMonths,\n        FinancialStatements_BalanceSheet_NetDebt_ThreeMonths,\n        FinancialStatements_BalanceSheet_NetDebt_SixMonths,\n        FinancialStatements_BalanceSheet_NetDebt_NineMonths,\n        FinancialStatements_BalanceSheet_NetDebt_TwelveMonths,\n        FinancialStatements_BalanceSheet_ShareIssued_ThreeMonths,\n        FinancialStatements_BalanceSheet_ShareIssued_TwelveMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_BiologicalAssets_ThreeMonths,\n        FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths,\n        FinancialStatements_BalanceSheet_CashRestrictedOrPledged_ThreeMonths,\n        FinancialStatements_BalanceSheet_CashRestrictedOrPledged_TwelveMonths,\n        FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherInvestments_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherInvestments_TwelveMonths,\n        FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_ThreeMonths,\n        FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_TwelveMonths,\n        FinancialStatements_BalanceSheet_DueFromRelatedParties_ThreeMonths,\n        FinancialStatements_BalanceSheet_DueFromRelatedParties_TwelveMonths,\n        FinancialStatements_BalanceSheet_UnallocatedSurplus_ThreeMonths,\n        FinancialStatements_BalanceSheet_UnallocatedSurplus_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear1_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear1_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear2_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear2_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear5_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtDueInYear5_TwelveMonths,\n        FinancialStatements_BalanceSheet_DebtDueBeyond_ThreeMonths,\n        FinancialStatements_BalanceSheet_DebtDueBeyond_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_TwelveMonths,\n        FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_ThreeMonths,\n        FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_TwelveMonths,\n        FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_OtherFinancialLiabilities_ThreeMonths,\n        FinancialStatements_BalanceSheet_OtherFinancialLiabilities_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_TwelveMonths,\n        FinancialStatements_BalanceSheet_TotalEquityAsReported_ThreeMonths,\n        FinancialStatements_BalanceSheet_TotalEquityAsReported_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CFFileDate_OneMonth,\n        FinancialStatements_CashFlowStatement_CFFileDate_TwoMonths,\n        FinancialStatements_CashFlowStatement_CFFileDate_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CFFileDate_SixMonths,\n        FinancialStatements_CashFlowStatement_CFFileDate_NineMonths,\n        FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths,\n        FinancialStatements_CashFlowStatement_Amortization_OneMonth,\n        FinancialStatements_CashFlowStatement_Amortization_TwoMonths,\n        FinancialStatements_CashFlowStatement_Amortization_ThreeMonths,\n        FinancialStatements_CashFlowStatement_Amortization_SixMonths,\n        FinancialStatements_CashFlowStatement_Amortization_NineMonths,\n        FinancialStatements_CashFlowStatement_Amortization_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_OneMonth,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_TwoMonths,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_SixMonths,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_NineMonths,\n        FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_OneMonth,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_TwoMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwoMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwoMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwoMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_OneMonth,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_TwoMonths,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_ThreeMonths,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_SixMonths,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_NineMonths,\n        FinancialStatements_CashFlowStatement_FinancingCashFlow_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_OneMonth,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_TwoMonths,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_SixMonths,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_NineMonths,\n        FinancialStatements_CashFlowStatement_InvestingCashFlow_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_OneMonth,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_TwoMonths,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_SixMonths,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_NineMonths,\n        FinancialStatements_CashFlowStatement_OperatingCashFlow_TwelveMonths,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_OneMonth,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_TwoMonths,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_ThreeMonths,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_SixMonths,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_NineMonths,\n        FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths,\n        FinancialStatements_CashFlowStatement_EndCashPosition_OneMonth,\n        FinancialStatements_CashFlowStatement_EndCashPosition_TwoMonths,\n        FinancialStatements_CashFlowStatement_EndCashPosition_ThreeMonths,\n        FinancialStatements_CashFlowStatement_EndCashPosition_SixMonths,\n        FinancialStatements_CashFlowStatement_EndCashPosition_NineMonths,\n        FinancialStatements_CashFlowStatement_EndCashPosition_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangesInCash_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangesInCash_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangesInCash_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangesInCash_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangesInCash_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangesInCash_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInInventory_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLoans_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLoans_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLoans_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReceivables_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_OneMonth,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwoMonths,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_SixMonths,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_NineMonths,\n        FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DeferredTax_OneMonth,\n        FinancialStatements_CashFlowStatement_DeferredTax_TwoMonths,\n        FinancialStatements_CashFlowStatement_DeferredTax_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DeferredTax_SixMonths,\n        FinancialStatements_CashFlowStatement_DeferredTax_NineMonths,\n        FinancialStatements_CashFlowStatement_DeferredTax_TwelveMonths,\n        FinancialStatements_CashFlowStatement_Depletion_ThreeMonths,\n        FinancialStatements_CashFlowStatement_Depletion_SixMonths,\n        FinancialStatements_CashFlowStatement_Depletion_NineMonths,\n        FinancialStatements_CashFlowStatement_Depletion_TwelveMonths,\n        FinancialStatements_CashFlowStatement_Depreciation_OneMonth,\n        FinancialStatements_CashFlowStatement_Depreciation_TwoMonths,\n        FinancialStatements_CashFlowStatement_Depreciation_ThreeMonths,\n        FinancialStatements_CashFlowStatement_Depreciation_SixMonths,\n        FinancialStatements_CashFlowStatement_Depreciation_NineMonths,\n        FinancialStatements_CashFlowStatement_Depreciation_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_OneMonth,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwoMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_SixMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_NineMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_OneMonth,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwoMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_SixMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_NineMonths,\n        FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwelveMonths,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_OneMonth,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwoMonths,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_ThreeMonths,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_SixMonths,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_NineMonths,\n        FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_SixMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_NineMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_OneMonth,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_SixMonths,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_NineMonths,\n        FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_SixMonths,\n        FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_NineMonths,\n        FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_OneMonth,\n        FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_SixMonths,\n        FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_NineMonths,\n        FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_OneMonth,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_SixMonths,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_NineMonths,\n        FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PaymentForLoans_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PaymentForLoans_SixMonths,\n        FinancialStatements_CashFlowStatement_PaymentForLoans_NineMonths,\n        FinancialStatements_CashFlowStatement_PaymentForLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_OneMonth,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_TwoMonths,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_SixMonths,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_NineMonths,\n        FinancialStatements_CashFlowStatement_CommonStockPayments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockPayments_OneMonth,\n        FinancialStatements_CashFlowStatement_PreferredStockPayments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockPayments_SixMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockPayments_NineMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockPayments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_OneMonth,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwoMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_SixMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_NineMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_OneMonth,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwoMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_SixMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_NineMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromLoans_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromLoans_SixMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromLoans_NineMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_OneMonth,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwoMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_SixMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_NineMonths,\n        FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_CommonStockIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_OneMonth,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwoMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_SixMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_NineMonths,\n        FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_SixMonths,\n        FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_NineMonths,\n        FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_SixMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_NineMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_OneMonth,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwoMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_OneMonth,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwoMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_OneMonth,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwoMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_OneMonth,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwoMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_OneMonth,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_SixMonths,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_NineMonths,\n        FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_OneMonth,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_SixMonths,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_NineMonths,\n        FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_OneMonth,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_SixMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_NineMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_OneMonth,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_SixMonths,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_NineMonths,\n        FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_OneMonth,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_TwoMonths,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfBusiness_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfIntangibles_OneMonth,\n        FinancialStatements_CashFlowStatement_SaleOfIntangibles_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfIntangibles_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfIntangibles_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfIntangibles_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_OneMonth,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_TwoMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestment_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_OneMonth,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_TwoMonths,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfPPE_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwelveMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_OneMonth,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwoMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_ThreeMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_SixMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_NineMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_OneMonth,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwoMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_SixMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_NineMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_OneMonth,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwoMonths,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_ThreeMonths,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_SixMonths,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_NineMonths,\n        FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDividendPayable_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDividendPayable_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDividendPayable_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDividendPayable_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_OneMonth,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwoMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_OneMonth,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwoMonths,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_OneMonth,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwoMonths,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_SixMonths,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_NineMonths,\n        FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwoMonths,\n        FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_SixMonths,\n        FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_NineMonths,\n        FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwelveMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_OneMonth,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwoMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_SixMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_NineMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_OneMonth,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwoMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_ThreeMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_SixMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_NineMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwelveMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_OneMonth,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwoMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_ThreeMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_SixMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_NineMonths,\n        FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_OneMonth,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwoMonths,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_SixMonths,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_NineMonths,\n        FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_OneMonth,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_SixMonths,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_NineMonths,\n        FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_OneMonth,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwoMonths,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_SixMonths,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_NineMonths,\n        FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_OneMonth,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_TwoMonths,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherNonCashItems_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_OneMonth,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwoMonths,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_SixMonths,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_NineMonths,\n        FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_OneMonth,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwoMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_SixMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_NineMonths,\n        FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_SixMonths,\n        FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_NineMonths,\n        FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_TwelveMonths,\n        FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_OneMonth,\n        FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_ThreeMonths,\n        FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_SixMonths,\n        FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_NineMonths,\n        FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_TwelveMonths,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_OneMonth,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_TwoMonths,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_ThreeMonths,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_SixMonths,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_NineMonths,\n        FinancialStatements_CashFlowStatement_StockBasedCompensation_TwelveMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_OneMonth,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwoMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_SixMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_NineMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_ThreeMonths,\n        FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_TwelveMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_OneMonth,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwoMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_ThreeMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_SixMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_NineMonths,\n        FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_OneMonth,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwoMonths,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_SixMonths,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_NineMonths,\n        FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_OneMonth,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwoMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_OneMonth,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwoMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_SixMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_NineMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_OneMonth,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwoMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_SixMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_NineMonths,\n        FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwelveMonths,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_OneMonth,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwoMonths,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_ThreeMonths,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_SixMonths,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_NineMonths,\n        FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwelveMonths,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_OneMonth,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwoMonths,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_ThreeMonths,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_SixMonths,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_NineMonths,\n        FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwelveMonths,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_OneMonth,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_TwoMonths,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_ThreeMonths,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_SixMonths,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_NineMonths,\n        FinancialStatements_CashFlowStatement_FreeCashFlow_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_SixMonths,\n        FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_NineMonths,\n        FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_SixMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_NineMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFO_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFO_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFO_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFO_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFO_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFO_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFO_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFO_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_SixMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_NineMonths,\n        FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_SixMonths,\n        FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_TwelveMonths,\n        FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_ThreeMonths,\n        FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_SixMonths,\n        FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_NineMonths,\n        FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ShareOfAssociates_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ShareOfAssociates_SixMonths,\n        FinancialStatements_CashFlowStatement_ShareOfAssociates_NineMonths,\n        FinancialStatements_CashFlowStatement_ShareOfAssociates_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProfitOnDisposals_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProfitOnDisposals_SixMonths,\n        FinancialStatements_CashFlowStatement_ProfitOnDisposals_NineMonths,\n        FinancialStatements_CashFlowStatement_ProfitOnDisposals_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_SixMonths,\n        FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_NineMonths,\n        FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetOutwardLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_IssueExpenses_TwoMonths,\n        FinancialStatements_CashFlowStatement_IssueExpenses_ThreeMonths,\n        FinancialStatements_CashFlowStatement_IssueExpenses_SixMonths,\n        FinancialStatements_CashFlowStatement_IssueExpenses_NineMonths,\n        FinancialStatements_CashFlowStatement_IssueExpenses_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinDepositsbyBanksandCustomers_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_OneMonth,\n        FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_SixMonths,\n        FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_NineMonths,\n        FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_OneMonth,\n        FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_OneMonth,\n        FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashPayments_OneMonth,\n        FinancialStatements_CashFlowStatement_ClassesofCashPayments_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashPayments_SixMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashPayments_NineMonths,\n        FinancialStatements_CashFlowStatement_ClassesofCashPayments_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_SixMonths,\n        FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_NineMonths,\n        FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_SixMonths,\n        FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_NineMonths,\n        FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_OneMonth,\n        FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DividendsPaidDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedDirect_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedDirect_SixMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedDirect_NineMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidDirect_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidDirect_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidDirect_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedDirect_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedDirect_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedDirect_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_ThreeMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_SixMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_NineMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_TwelveMonths,\n        FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwoMonths,\n        FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_ThreeMonths,\n        FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_SixMonths,\n        FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_NineMonths,\n        FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_SixMonths,\n        FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_NineMonths,\n        FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DividendPaidCFO_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DividendReceivedCFO_SixMonths,\n        FinancialStatements_CashFlowStatement_DividendReceivedCFO_TwelveMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_TaxesRefundPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_TwelveMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedCFI_ThreeMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedCFI_SixMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedCFI_NineMonths,\n        FinancialStatements_CashFlowStatement_DividendsReceivedCFI_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFI_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFI_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFI_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestReceivedCFI_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFF_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFF_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFF_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestPaidCFF_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinFinancialAssets_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_SixMonths,\n        FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_NineMonths,\n        FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_SixMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_NineMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_SixMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_NineMonths,\n        FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_TwelveMonths,\n        FinancialStatements_CashFlowStatement_MinorityInterest_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CapExReported_OneMonth,\n        FinancialStatements_CashFlowStatement_CapExReported_TwoMonths,\n        FinancialStatements_CashFlowStatement_CapExReported_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CapExReported_SixMonths,\n        FinancialStatements_CashFlowStatement_CapExReported_NineMonths,\n        FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_OneMonth,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_OneMonth,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_OneMonth,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_OneMonth,\n        FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_SixMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_NineMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforLoans_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforLoans_SixMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforLoans_NineMonths,\n        FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths,\n        FinancialStatements_CashFlowStatement_InterestandCommissionPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_InterestandCommissionPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_InterestandCommissionPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_InterestandCommissionPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_AllTaxesPaid_OneMonth,\n        FinancialStatements_CashFlowStatement_AllTaxesPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_AllTaxesPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_AllTaxesPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PremiumReceived_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PremiumReceived_SixMonths,\n        FinancialStatements_CashFlowStatement_PremiumReceived_NineMonths,\n        FinancialStatements_CashFlowStatement_PremiumReceived_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_SixMonths,\n        FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_NineMonths,\n        FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_SixMonths,\n        FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_NineMonths,\n        FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ClaimsPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ClaimsPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_ClaimsPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_ClaimsPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CommissionPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CommissionPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_CommissionPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_CommissionPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_SixMonths,\n        FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_NineMonths,\n        FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsForMinorities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsForMinorities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsForMinorities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_ThreeMonths,\n        FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_SixMonths,\n        FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_NineMonths,\n        FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths,\n        FinancialStatements_CashFlowStatement_FundFromOperation_ThreeMonths,\n        FinancialStatements_CashFlowStatement_FundFromOperation_SixMonths,\n        FinancialStatements_CashFlowStatement_FundFromOperation_NineMonths,\n        FinancialStatements_CashFlowStatement_FundFromOperation_TwelveMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_ThreeMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_SixMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_NineMonths,\n        FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_TwelveMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_ThreeMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_SixMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_NineMonths,\n        FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_TwelveMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_ThreeMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_SixMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_NineMonths,\n        FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_TwelveMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_ThreeMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_SixMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_NineMonths,\n        FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_TwelveMonths,\n        FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_ThreeMonths,\n        FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_SixMonths,\n        FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_NineMonths,\n        FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_TwelveMonths,\n        EarningReports_PeriodEndingDate_OneMonth,\n        EarningReports_PeriodEndingDate_TwoMonths,\n        EarningReports_PeriodEndingDate_ThreeMonths,\n        EarningReports_PeriodEndingDate_SixMonths,\n        EarningReports_PeriodEndingDate_NineMonths,\n        EarningReports_PeriodEndingDate_TwelveMonths,\n        EarningReports_FileDate_OneMonth,\n        EarningReports_FileDate_TwoMonths,\n        EarningReports_FileDate_ThreeMonths,\n        EarningReports_FileDate_SixMonths,\n        EarningReports_FileDate_NineMonths,\n        EarningReports_FileDate_TwelveMonths,\n        EarningReports_AccessionNumber_OneMonth,\n        EarningReports_AccessionNumber_TwoMonths,\n        EarningReports_AccessionNumber_ThreeMonths,\n        EarningReports_AccessionNumber_SixMonths,\n        EarningReports_AccessionNumber_NineMonths,\n        EarningReports_FormType_OneMonth,\n        EarningReports_FormType_TwoMonths,\n        EarningReports_FormType_ThreeMonths,\n        EarningReports_FormType_SixMonths,\n        EarningReports_FormType_NineMonths,\n        EarningReports_FormType_TwelveMonths,\n        EarningReports_PeriodType_OneMonth,\n        EarningReports_PeriodType_TwoMonths,\n        EarningReports_PeriodType_ThreeMonths,\n        EarningReports_PeriodType_SixMonths,\n        EarningReports_PeriodType_NineMonths,\n        EarningReports_PeriodType_TwelveMonths,\n        EarningReports_BasicContinuousOperations_OneMonth,\n        EarningReports_BasicContinuousOperations_TwoMonths,\n        EarningReports_BasicContinuousOperations_ThreeMonths,\n        EarningReports_BasicContinuousOperations_SixMonths,\n        EarningReports_BasicContinuousOperations_NineMonths,\n        EarningReports_BasicContinuousOperations_TwelveMonths,\n        EarningReports_BasicDiscontinuousOperations_OneMonth,\n        EarningReports_BasicDiscontinuousOperations_TwoMonths,\n        EarningReports_BasicDiscontinuousOperations_ThreeMonths,\n        EarningReports_BasicDiscontinuousOperations_SixMonths,\n        EarningReports_BasicDiscontinuousOperations_NineMonths,\n        EarningReports_BasicDiscontinuousOperations_TwelveMonths,\n        EarningReports_BasicExtraordinary_OneMonth,\n        EarningReports_BasicExtraordinary_TwoMonths,\n        EarningReports_BasicExtraordinary_ThreeMonths,\n        EarningReports_BasicExtraordinary_SixMonths,\n        EarningReports_BasicExtraordinary_NineMonths,\n        EarningReports_BasicExtraordinary_TwelveMonths,\n        EarningReports_BasicAccountingChange_ThreeMonths,\n        EarningReports_BasicAccountingChange_SixMonths,\n        EarningReports_BasicAccountingChange_NineMonths,\n        EarningReports_BasicAccountingChange_TwelveMonths,\n        EarningReports_BasicEPS_OneMonth,\n        EarningReports_BasicEPS_TwoMonths,\n        EarningReports_BasicEPS_ThreeMonths,\n        EarningReports_BasicEPS_SixMonths,\n        EarningReports_BasicEPS_NineMonths,\n        EarningReports_BasicEPS_TwelveMonths,\n        EarningReports_DilutedContinuousOperations_OneMonth,\n        EarningReports_DilutedContinuousOperations_TwoMonths,\n        EarningReports_DilutedContinuousOperations_ThreeMonths,\n        EarningReports_DilutedContinuousOperations_SixMonths,\n        EarningReports_DilutedContinuousOperations_NineMonths,\n        EarningReports_DilutedContinuousOperations_TwelveMonths,\n        EarningReports_DilutedDiscontinuousOperations_OneMonth,\n        EarningReports_DilutedDiscontinuousOperations_TwoMonths,\n        EarningReports_DilutedDiscontinuousOperations_ThreeMonths,\n        EarningReports_DilutedDiscontinuousOperations_SixMonths,\n        EarningReports_DilutedDiscontinuousOperations_NineMonths,\n        EarningReports_DilutedDiscontinuousOperations_TwelveMonths,\n        EarningReports_DilutedExtraordinary_OneMonth,\n        EarningReports_DilutedExtraordinary_TwoMonths,\n        EarningReports_DilutedExtraordinary_ThreeMonths,\n        EarningReports_DilutedExtraordinary_SixMonths,\n        EarningReports_DilutedExtraordinary_NineMonths,\n        EarningReports_DilutedExtraordinary_TwelveMonths,\n        EarningReports_DilutedAccountingChange_ThreeMonths,\n        EarningReports_DilutedAccountingChange_SixMonths,\n        EarningReports_DilutedAccountingChange_NineMonths,\n        EarningReports_DilutedAccountingChange_TwelveMonths,\n        EarningReports_DilutedEPS_OneMonth,\n        EarningReports_DilutedEPS_TwoMonths,\n        EarningReports_DilutedEPS_ThreeMonths,\n        EarningReports_DilutedEPS_SixMonths,\n        EarningReports_DilutedEPS_NineMonths,\n        EarningReports_DilutedEPS_TwelveMonths,\n        EarningReports_BasicAverageShares_OneMonth,\n        EarningReports_BasicAverageShares_TwoMonths,\n        EarningReports_BasicAverageShares_ThreeMonths,\n        EarningReports_BasicAverageShares_SixMonths,\n        EarningReports_BasicAverageShares_NineMonths,\n        EarningReports_BasicAverageShares_TwelveMonths,\n        EarningReports_DilutedAverageShares_OneMonth,\n        EarningReports_DilutedAverageShares_TwoMonths,\n        EarningReports_DilutedAverageShares_ThreeMonths,\n        EarningReports_DilutedAverageShares_SixMonths,\n        EarningReports_DilutedAverageShares_NineMonths,\n        EarningReports_DilutedAverageShares_TwelveMonths,\n        EarningReports_DividendPerShare_OneMonth,\n        EarningReports_DividendPerShare_TwoMonths,\n        EarningReports_DividendPerShare_ThreeMonths,\n        EarningReports_DividendPerShare_SixMonths,\n        EarningReports_DividendPerShare_NineMonths,\n        EarningReports_DividendPerShare_TwelveMonths,\n        EarningReports_BasicEPSOtherGainsLosses_ThreeMonths,\n        EarningReports_BasicEPSOtherGainsLosses_SixMonths,\n        EarningReports_BasicEPSOtherGainsLosses_NineMonths,\n        EarningReports_BasicEPSOtherGainsLosses_TwelveMonths,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_OneMonth,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_TwoMonths,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_ThreeMonths,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_SixMonths,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_NineMonths,\n        EarningReports_ContinuingAndDiscontinuedBasicEPS_TwelveMonths,\n        EarningReports_TaxLossCarryforwardBasicEPS_ThreeMonths,\n        EarningReports_TaxLossCarryforwardBasicEPS_SixMonths,\n        EarningReports_TaxLossCarryforwardBasicEPS_NineMonths,\n        EarningReports_TaxLossCarryforwardBasicEPS_TwelveMonths,\n        EarningReports_DilutedEPSOtherGainsLosses_ThreeMonths,\n        EarningReports_DilutedEPSOtherGainsLosses_SixMonths,\n        EarningReports_DilutedEPSOtherGainsLosses_NineMonths,\n        EarningReports_DilutedEPSOtherGainsLosses_TwelveMonths,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_OneMonth,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwoMonths,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_ThreeMonths,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_SixMonths,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_NineMonths,\n        EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwelveMonths,\n        EarningReports_TaxLossCarryforwardDilutedEPS_ThreeMonths,\n        EarningReports_TaxLossCarryforwardDilutedEPS_SixMonths,\n        EarningReports_TaxLossCarryforwardDilutedEPS_NineMonths,\n        EarningReports_TaxLossCarryforwardDilutedEPS_TwelveMonths,\n        EarningReports_NormalizedBasicEPS_OneMonth,\n        EarningReports_NormalizedBasicEPS_TwoMonths,\n        EarningReports_NormalizedBasicEPS_ThreeMonths,\n        EarningReports_NormalizedBasicEPS_SixMonths,\n        EarningReports_NormalizedBasicEPS_NineMonths,\n        EarningReports_NormalizedBasicEPS_TwelveMonths,\n        EarningReports_NormalizedDilutedEPS_OneMonth,\n        EarningReports_NormalizedDilutedEPS_TwoMonths,\n        EarningReports_NormalizedDilutedEPS_ThreeMonths,\n        EarningReports_NormalizedDilutedEPS_SixMonths,\n        EarningReports_NormalizedDilutedEPS_NineMonths,\n        EarningReports_NormalizedDilutedEPS_TwelveMonths,\n        EarningReports_TotalDividendPerShare_OneMonth,\n        EarningReports_TotalDividendPerShare_TwoMonths,\n        EarningReports_TotalDividendPerShare_ThreeMonths,\n        EarningReports_TotalDividendPerShare_SixMonths,\n        EarningReports_TotalDividendPerShare_NineMonths,\n        EarningReports_TotalDividendPerShare_TwelveMonths,\n        EarningReports_ReportedNormalizedBasicEPS_ThreeMonths,\n        EarningReports_ReportedNormalizedBasicEPS_SixMonths,\n        EarningReports_ReportedNormalizedBasicEPS_NineMonths,\n        EarningReports_ReportedNormalizedBasicEPS_TwelveMonths,\n        EarningReports_ReportedNormalizedDilutedEPS_ThreeMonths,\n        EarningReports_ReportedNormalizedDilutedEPS_SixMonths,\n        EarningReports_ReportedNormalizedDilutedEPS_NineMonths,\n        EarningReports_ReportedNormalizedDilutedEPS_TwelveMonths,\n        EarningReports_DividendCoverageRatio_ThreeMonths,\n        EarningReports_DividendCoverageRatio_SixMonths,\n        EarningReports_DividendCoverageRatio_NineMonths,\n        EarningReports_DividendCoverageRatio_TwelveMonths,\n        OperationRatios_RevenueGrowth_OneYear,\n        OperationRatios_RevenueGrowth_ThreeYears,\n        OperationRatios_RevenueGrowth_ThreeMonths,\n        OperationRatios_RevenueGrowth_FiveYears,\n        OperationRatios_OperationIncomeGrowth_OneYear,\n        OperationRatios_OperationIncomeGrowth_ThreeYears,\n        OperationRatios_OperationIncomeGrowth_ThreeMonths,\n        OperationRatios_OperationIncomeGrowth_FiveYears,\n        OperationRatios_NetIncomeGrowth_OneYear,\n        OperationRatios_NetIncomeGrowth_ThreeYears,\n        OperationRatios_NetIncomeGrowth_ThreeMonths,\n        OperationRatios_NetIncomeGrowth_FiveYears,\n        OperationRatios_NetIncomeContOpsGrowth_OneYear,\n        OperationRatios_NetIncomeContOpsGrowth_ThreeYears,\n        OperationRatios_NetIncomeContOpsGrowth_ThreeMonths,\n        OperationRatios_NetIncomeContOpsGrowth_FiveYears,\n        OperationRatios_CFOGrowth_OneYear,\n        OperationRatios_CFOGrowth_ThreeYears,\n        OperationRatios_CFOGrowth_FiveYears,\n        OperationRatios_FCFGrowth_OneYear,\n        OperationRatios_FCFGrowth_ThreeYears,\n        OperationRatios_FCFGrowth_FiveYears,\n        OperationRatios_OperationRevenueGrowth3MonthAvg_OneYear,\n        OperationRatios_OperationRevenueGrowth3MonthAvg_ThreeYears,\n        OperationRatios_OperationRevenueGrowth3MonthAvg_ThreeMonths,\n        OperationRatios_OperationRevenueGrowth3MonthAvg_FiveYears,\n        OperationRatios_GrossMargin_OneYear,\n        OperationRatios_GrossMargin_OneMonth,\n        OperationRatios_GrossMargin_TwoMonths,\n        OperationRatios_GrossMargin_ThreeMonths,\n        OperationRatios_GrossMargin_SixMonths,\n        OperationRatios_GrossMargin_NineMonths,\n        OperationRatios_OperationMargin_OneYear,\n        OperationRatios_OperationMargin_OneMonth,\n        OperationRatios_OperationMargin_TwoMonths,\n        OperationRatios_OperationMargin_ThreeMonths,\n        OperationRatios_OperationMargin_SixMonths,\n        OperationRatios_OperationMargin_NineMonths,\n        OperationRatios_PretaxMargin_OneYear,\n        OperationRatios_PretaxMargin_OneMonth,\n        OperationRatios_PretaxMargin_TwoMonths,\n        OperationRatios_PretaxMargin_ThreeMonths,\n        OperationRatios_PretaxMargin_SixMonths,\n        OperationRatios_PretaxMargin_NineMonths,\n        OperationRatios_NetMargin_OneYear,\n        OperationRatios_NetMargin_OneMonth,\n        OperationRatios_NetMargin_TwoMonths,\n        OperationRatios_NetMargin_ThreeMonths,\n        OperationRatios_NetMargin_SixMonths,\n        OperationRatios_NetMargin_NineMonths,\n        OperationRatios_TaxRate_OneYear,\n        OperationRatios_TaxRate_OneMonth,\n        OperationRatios_TaxRate_TwoMonths,\n        OperationRatios_TaxRate_ThreeMonths,\n        OperationRatios_TaxRate_SixMonths,\n        OperationRatios_TaxRate_NineMonths,\n        OperationRatios_EBITMargin_OneYear,\n        OperationRatios_EBITMargin_OneMonth,\n        OperationRatios_EBITMargin_TwoMonths,\n        OperationRatios_EBITMargin_ThreeMonths,\n        OperationRatios_EBITMargin_SixMonths,\n        OperationRatios_EBITMargin_NineMonths,\n        OperationRatios_EBITDAMargin_OneYear,\n        OperationRatios_EBITDAMargin_OneMonth,\n        OperationRatios_EBITDAMargin_TwoMonths,\n        OperationRatios_EBITDAMargin_ThreeMonths,\n        OperationRatios_EBITDAMargin_SixMonths,\n        OperationRatios_EBITDAMargin_NineMonths,\n        OperationRatios_SalesPerEmployee_OneYear,\n        OperationRatios_SalesPerEmployee_OneMonth,\n        OperationRatios_SalesPerEmployee_TwoMonths,\n        OperationRatios_SalesPerEmployee_ThreeMonths,\n        OperationRatios_SalesPerEmployee_SixMonths,\n        OperationRatios_SalesPerEmployee_NineMonths,\n        OperationRatios_CurrentRatio_OneYear,\n        OperationRatios_CurrentRatio_OneMonth,\n        OperationRatios_CurrentRatio_TwoMonths,\n        OperationRatios_CurrentRatio_ThreeMonths,\n        OperationRatios_CurrentRatio_SixMonths,\n        OperationRatios_CurrentRatio_NineMonths,\n        OperationRatios_QuickRatio_OneYear,\n        OperationRatios_QuickRatio_OneMonth,\n        OperationRatios_QuickRatio_TwoMonths,\n        OperationRatios_QuickRatio_ThreeMonths,\n        OperationRatios_QuickRatio_SixMonths,\n        OperationRatios_QuickRatio_NineMonths,\n        OperationRatios_LongTermDebtTotalCapitalRatio_OneYear,\n        OperationRatios_LongTermDebtTotalCapitalRatio_OneMonth,\n        OperationRatios_LongTermDebtTotalCapitalRatio_TwoMonths,\n        OperationRatios_LongTermDebtTotalCapitalRatio_ThreeMonths,\n        OperationRatios_LongTermDebtTotalCapitalRatio_SixMonths,\n        OperationRatios_LongTermDebtTotalCapitalRatio_NineMonths,\n        OperationRatios_InterestCoverage_OneYear,\n        OperationRatios_InterestCoverage_OneMonth,\n        OperationRatios_InterestCoverage_TwoMonths,\n        OperationRatios_InterestCoverage_ThreeMonths,\n        OperationRatios_InterestCoverage_SixMonths,\n        OperationRatios_InterestCoverage_NineMonths,\n        OperationRatios_LongTermDebtEquityRatio_OneYear,\n        OperationRatios_LongTermDebtEquityRatio_OneMonth,\n        OperationRatios_LongTermDebtEquityRatio_TwoMonths,\n        OperationRatios_LongTermDebtEquityRatio_ThreeMonths,\n        OperationRatios_LongTermDebtEquityRatio_SixMonths,\n        OperationRatios_LongTermDebtEquityRatio_NineMonths,\n        OperationRatios_FinancialLeverage_OneYear,\n        OperationRatios_FinancialLeverage_OneMonth,\n        OperationRatios_FinancialLeverage_TwoMonths,\n        OperationRatios_FinancialLeverage_ThreeMonths,\n        OperationRatios_FinancialLeverage_SixMonths,\n        OperationRatios_FinancialLeverage_NineMonths,\n        OperationRatios_TotalDebtEquityRatio_OneYear,\n        OperationRatios_TotalDebtEquityRatio_OneMonth,\n        OperationRatios_TotalDebtEquityRatio_TwoMonths,\n        OperationRatios_TotalDebtEquityRatio_ThreeMonths,\n        OperationRatios_TotalDebtEquityRatio_SixMonths,\n        OperationRatios_TotalDebtEquityRatio_NineMonths,\n        OperationRatios_NormalizedNetProfitMargin_OneYear,\n        OperationRatios_NormalizedNetProfitMargin_OneMonth,\n        OperationRatios_NormalizedNetProfitMargin_TwoMonths,\n        OperationRatios_NormalizedNetProfitMargin_ThreeMonths,\n        OperationRatios_NormalizedNetProfitMargin_SixMonths,\n        OperationRatios_NormalizedNetProfitMargin_NineMonths,\n        OperationRatios_DaysInSales_OneYear,\n        OperationRatios_DaysInSales_ThreeMonths,\n        OperationRatios_DaysInSales_SixMonths,\n        OperationRatios_DaysInInventory_OneYear,\n        OperationRatios_DaysInInventory_ThreeMonths,\n        OperationRatios_DaysInInventory_SixMonths,\n        OperationRatios_DaysInPayment_OneYear,\n        OperationRatios_DaysInPayment_ThreeMonths,\n        OperationRatios_DaysInPayment_SixMonths,\n        OperationRatios_CashConversionCycle_OneYear,\n        OperationRatios_CashConversionCycle_ThreeMonths,\n        OperationRatios_CashConversionCycle_SixMonths,\n        OperationRatios_ReceivableTurnover_OneYear,\n        OperationRatios_ReceivableTurnover_ThreeMonths,\n        OperationRatios_ReceivableTurnover_SixMonths,\n        OperationRatios_InventoryTurnover_OneYear,\n        OperationRatios_InventoryTurnover_ThreeMonths,\n        OperationRatios_InventoryTurnover_SixMonths,\n        OperationRatios_PaymentTurnover_OneYear,\n        OperationRatios_PaymentTurnover_ThreeMonths,\n        OperationRatios_PaymentTurnover_SixMonths,\n        OperationRatios_FixAssetsTuronver_OneYear,\n        OperationRatios_FixAssetsTuronver_ThreeMonths,\n        OperationRatios_FixAssetsTuronver_SixMonths,\n        OperationRatios_AssetsTurnover_OneYear,\n        OperationRatios_AssetsTurnover_ThreeMonths,\n        OperationRatios_AssetsTurnover_SixMonths,\n        OperationRatios_ROE_OneYear,\n        OperationRatios_ROE_ThreeMonths,\n        OperationRatios_ROE_SixMonths,\n        OperationRatios_ROA_OneYear,\n        OperationRatios_ROA_ThreeMonths,\n        OperationRatios_ROA_SixMonths,\n        OperationRatios_ROIC_OneYear,\n        OperationRatios_ROIC_ThreeMonths,\n        OperationRatios_ROIC_SixMonths,\n        OperationRatios_FCFSalesRatio_OneYear,\n        OperationRatios_FCFNetIncomeRatio_OneYear,\n        OperationRatios_CapExSalesRatio_OneYear,\n        OperationRatios_DebtToAssets_OneYear,\n        OperationRatios_DebtToAssets_OneMonth,\n        OperationRatios_DebtToAssets_TwoMonths,\n        OperationRatios_DebtToAssets_ThreeMonths,\n        OperationRatios_DebtToAssets_SixMonths,\n        OperationRatios_DebtToAssets_NineMonths,\n        OperationRatios_CommonEquityToAssets_OneYear,\n        OperationRatios_CommonEquityToAssets_OneMonth,\n        OperationRatios_CommonEquityToAssets_TwoMonths,\n        OperationRatios_CommonEquityToAssets_ThreeMonths,\n        OperationRatios_CommonEquityToAssets_SixMonths,\n        OperationRatios_CommonEquityToAssets_NineMonths,\n        OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear,\n        OperationRatios_CapitalExpenditureAnnual5YrGrowth_ThreeYears,\n        OperationRatios_CapitalExpenditureAnnual5YrGrowth_FiveYears,\n        OperationRatios_GrossProfitAnnual5YrGrowth_OneYear,\n        OperationRatios_GrossProfitAnnual5YrGrowth_ThreeYears,\n        OperationRatios_GrossProfitAnnual5YrGrowth_FiveYears,\n        OperationRatios_GrossMargin5YrAvg_FiveYears,\n        OperationRatios_PostTaxMargin5YrAvg_FiveYears,\n        OperationRatios_PreTaxMargin5YrAvg_FiveYears,\n        OperationRatios_ProfitMargin5YrAvg_FiveYears,\n        OperationRatios_ROE5YrAvg_FiveYears,\n        OperationRatios_ROA5YrAvg_FiveYears,\n        OperationRatios_AVG5YrsROIC_FiveYears,\n        OperationRatios_NormalizedROIC_OneYear,\n        OperationRatios_NormalizedROIC_ThreeMonths,\n        OperationRatios_NormalizedROIC_SixMonths,\n        OperationRatios_RegressionGrowthOperatingRevenue5Years_FiveYears,\n        OperationRatios_CashRatio_OneYear,\n        OperationRatios_CashRatio_ThreeMonths,\n        OperationRatios_CashtoTotalAssets_OneYear,\n        OperationRatios_CashtoTotalAssets_ThreeMonths,\n        OperationRatios_CapitalExpendituretoEBITDA_OneYear,\n        OperationRatios_FCFtoCFO_OneYear,\n        OperationRatios_StockholdersEquityGrowth_OneYear,\n        OperationRatios_StockholdersEquityGrowth_ThreeYears,\n        OperationRatios_StockholdersEquityGrowth_FiveYears,\n        OperationRatios_TotalAssetsGrowth_OneYear,\n        OperationRatios_TotalAssetsGrowth_ThreeYears,\n        OperationRatios_TotalAssetsGrowth_FiveYears,\n        OperationRatios_TotalLiabilitiesGrowth_OneYear,\n        OperationRatios_TotalLiabilitiesGrowth_ThreeYears,\n        OperationRatios_TotalLiabilitiesGrowth_FiveYears,\n        OperationRatios_TotalDebtEquityRatioGrowth_OneYear,\n        OperationRatios_TotalDebtEquityRatioGrowth_ThreeYears,\n        OperationRatios_TotalDebtEquityRatioGrowth_FiveYears,\n        OperationRatios_CashRatioGrowth_OneYear,\n        OperationRatios_CashRatioGrowth_ThreeYears,\n        OperationRatios_CashRatioGrowth_FiveYears,\n        OperationRatios_EBITDAGrowth_OneYear,\n        OperationRatios_EBITDAGrowth_ThreeYears,\n        OperationRatios_EBITDAGrowth_FiveYears,\n        OperationRatios_CashFlowFromFinancingGrowth_OneYear,\n        OperationRatios_CashFlowFromFinancingGrowth_ThreeYears,\n        OperationRatios_CashFlowFromFinancingGrowth_FiveYears,\n        OperationRatios_CashFlowFromInvestingGrowth_OneYear,\n        OperationRatios_CashFlowFromInvestingGrowth_ThreeYears,\n        OperationRatios_CashFlowFromInvestingGrowth_FiveYears,\n        OperationRatios_CapExGrowth_OneYear,\n        OperationRatios_CapExGrowth_ThreeYears,\n        OperationRatios_CapExGrowth_FiveYears,\n        OperationRatios_CurrentRatioGrowth_OneYear,\n        OperationRatios_CurrentRatioGrowth_ThreeYears,\n        OperationRatios_CurrentRatioGrowth_FiveYears,\n        OperationRatios_WorkingCapitalTurnoverRatio_OneYear,\n        OperationRatios_WorkingCapitalTurnoverRatio_ThreeMonths,\n        OperationRatios_NetIncomePerEmployee_OneYear,\n        OperationRatios_NetIncomePerEmployee_ThreeMonths,\n        OperationRatios_SolvencyRatio_OneYear,\n        OperationRatios_SolvencyRatio_ThreeMonths,\n        OperationRatios_ExpenseRatio_OneYear,\n        OperationRatios_ExpenseRatio_ThreeMonths,\n        OperationRatios_LossRatio_OneYear,\n        OperationRatios_LossRatio_ThreeMonths,\n        EarningRatios_DilutedEPSGrowth_OneYear,\n        EarningRatios_DilutedEPSGrowth_ThreeYears,\n        EarningRatios_DilutedEPSGrowth_ThreeMonths,\n        EarningRatios_DilutedEPSGrowth_FiveYears,\n        EarningRatios_DilutedContEPSGrowth_OneYear,\n        EarningRatios_DilutedContEPSGrowth_ThreeYears,\n        EarningRatios_DilutedContEPSGrowth_ThreeMonths,\n        EarningRatios_DilutedContEPSGrowth_FiveYears,\n        EarningRatios_DPSGrowth_OneYear,\n        EarningRatios_DPSGrowth_ThreeMonths,\n        EarningRatios_DPSGrowth_ThreeYears,\n        EarningRatios_DPSGrowth_FiveYears,\n        EarningRatios_EquityPerShareGrowth_OneYear,\n        EarningRatios_EquityPerShareGrowth_ThreeMonths,\n        EarningRatios_EquityPerShareGrowth_ThreeYears,\n        EarningRatios_EquityPerShareGrowth_FiveYears,\n        EarningRatios_RegressionGrowthofDividends5Years_FiveYears,\n        EarningRatios_FCFPerShareGrowth_OneYear,\n        EarningRatios_FCFPerShareGrowth_ThreeYears,\n        EarningRatios_FCFPerShareGrowth_FiveYears,\n        EarningRatios_BookValuePerShareGrowth_OneYear,\n        EarningRatios_BookValuePerShareGrowth_ThreeMonths,\n        EarningRatios_BookValuePerShareGrowth_ThreeYears,\n        EarningRatios_BookValuePerShareGrowth_FiveYears,\n        EarningRatios_NormalizedDilutedEPSGrowth_OneYear,\n        EarningRatios_NormalizedDilutedEPSGrowth_ThreeMonths,\n        EarningRatios_NormalizedDilutedEPSGrowth_ThreeYears,\n        EarningRatios_NormalizedDilutedEPSGrowth_FiveYears,\n        EarningRatios_NormalizedBasicEPSGrowth_OneYear,\n        EarningRatios_NormalizedBasicEPSGrowth_ThreeMonths,\n        EarningRatios_NormalizedBasicEPSGrowth_ThreeYears,\n        EarningRatios_NormalizedBasicEPSGrowth_FiveYears,\n        ValuationRatios_PayoutRatio,\n        ValuationRatios_SustainableGrowthRate,\n        ValuationRatios_CashReturn,\n        ValuationRatios_SalesPerShare,\n        ValuationRatios_BookValuePerShare,\n        ValuationRatios_CFOPerShare,\n        ValuationRatios_FCFPerShare,\n        ValuationRatios_EarningYield,\n        ValuationRatios_PERatio,\n        ValuationRatios_SalesYield,\n        ValuationRatios_PSRatio,\n        ValuationRatios_BookValueYield,\n        ValuationRatios_PBRatio,\n        ValuationRatios_CFYield,\n        ValuationRatios_PCFRatio,\n        ValuationRatios_FCFYield,\n        ValuationRatios_FCFRatio,\n        ValuationRatios_TrailingDividendYield,\n        ValuationRatios_ForwardDividendYield,\n        ValuationRatios_ForwardEarningYield,\n        ValuationRatios_ForwardPERatio,\n        ValuationRatios_PEGRatio,\n        ValuationRatios_PEGPayback,\n        ValuationRatios_TangibleBookValuePerShare,\n        ValuationRatios_TangibleBVPerShare3YrAvg,\n        ValuationRatios_TangibleBVPerShare5YrAvg,\n        ValuationRatios_ForwardDividend,\n        ValuationRatios_WorkingCapitalPerShare,\n        ValuationRatios_WorkingCapitalPerShare3YrAvg,\n        ValuationRatios_WorkingCapitalPerShare5YrAvg,\n        ValuationRatios_EVToEBITDA,\n        ValuationRatios_BuyBackYield,\n        ValuationRatios_TotalYield,\n        ValuationRatios_RatioPE5YearAverage,\n        ValuationRatios_PriceChange1M,\n        ValuationRatios_NormalizedPERatio,\n        ValuationRatios_PriceToEBITDA,\n        ValuationRatios_DivYield5Year,\n        ValuationRatios_ForwardROE,\n        ValuationRatios_ForwardROA,\n        ValuationRatios_TwoYearsForwardEarningYield,\n        ValuationRatios_TwoYearsForwardPERatio,\n        ValuationRatios_ForwardCalculationStyle,\n        ValuationRatios_ActualForwardDividend,\n        ValuationRatios_TrailingCalculationStyle,\n        ValuationRatios_ActualTrailingDividend,\n        ValuationRatios_TotalAssetPerShare,\n        ValuationRatios_ExpectedDividendGrowthRate,\n        ValuationRatios_EVToRevenue,\n        ValuationRatios_EVToPreTaxIncome,\n        ValuationRatios_EVToTotalAssets,\n        ValuationRatios_EVToFCF,\n        ValuationRatios_EVToEBIT,\n        ValuationRatios_FFOPerShare,\n        ValuationRatios_PriceToCashRatio,\n        ValuationRatios_EVToForwardEBITDA,\n        ValuationRatios_EVToForwardRevenue,\n        ValuationRatios_EVToForwardEBIT,\n        ValuationRatios_EVToEBITDA1YearGrowth,\n        ValuationRatios_EVToFCF1YearGrowth,\n        ValuationRatios_EVToRevenue1YearGrowth,\n        ValuationRatios_EVToTotalAssets1YearGrowth,\n        ValuationRatios_PFCFRatio1YearGrowth,\n        ValuationRatios_PBRatio1YearGrowth,\n        ValuationRatios_PERatio1YearGrowth,\n        ValuationRatios_PSRatio1YearGrowth,\n        ValuationRatios_EVToEBIT3YrAvg,\n        ValuationRatios_EVToEBITDA3YrAvg,\n        ValuationRatios_EVToFCF3YrAvg,\n        ValuationRatios_EVToRevenue3YrAvg,\n        ValuationRatios_EVToTotalAssets3YrAvg,\n        ValuationRatios_EVToEBIT3YrAvgChange,\n        ValuationRatios_EVToEBITDA3YrAvgChange,\n        ValuationRatios_EVToFCF3YrAvgChange,\n        ValuationRatios_EVToRevenue3YrAvgChange,\n        ValuationRatios_EVToTotalAssets3YrAvgChange,\n        ValuationRatios_PFCFRatio3YrAvg,\n        ValuationRatios_PBRatio3YrAvg,\n        ValuationRatios_PSRatio3YrAvg,\n        ValuationRatios_PCashRatio3YrAvg,\n        ValuationRatios_PERatio3YrAvg,\n        ValuationRatios_PFCFRatio3YrAvgChange,\n        ValuationRatios_PBRatio3YrAvgChange,\n        ValuationRatios_PSRatio3YrAvgChange,\n        ValuationRatios_PERatio3YrAvgChange,\n        ValuationRatios_PERatio1YearHigh,\n        ValuationRatios_PERatio1YearLow,\n        ValuationRatios_PERatio1YearAverage,\n        ValuationRatios_PERatio5YearHigh,\n        ValuationRatios_PERatio5YearLow,\n        ValuationRatios_PERatio5YearAverage,\n        ValuationRatios_PERatio10YearHigh,\n        ValuationRatios_PERatio10YearLow,\n        ValuationRatios_PERatio10YearAverage,\n        ValuationRatios_CAPERatio,\n        ValuationRatios_EVToEBITDA3YearGrowth,\n        ValuationRatios_EVToFCF3YearGrowth,\n        ValuationRatios_EVToRevenue3YearGrowth,\n        ValuationRatios_EVToTotalAssets3YearGrowth,\n        ValuationRatios_PFCFRatio3YearGrowth,\n        ValuationRatios_PBRatio3YearGrowth,\n        ValuationRatios_PERatio3YearGrowth,\n        ValuationRatios_PSRatio3YearGrowth,\n        ValuationRatios_EVToEBITDA5YearGrowth,\n        ValuationRatios_EVToFCF5YearGrowth,\n        ValuationRatios_EVToRevenue5YearGrowth,\n        ValuationRatios_EVToTotalAssets5YearGrowth,\n        ValuationRatios_PFCFRatio5YearGrowth,\n        ValuationRatios_PBRatio5YearGrowth,\n        ValuationRatios_PERatio5YearGrowth,\n        ValuationRatios_PSRatio5YearGrowth,\n        ValuationRatios_EVToEBITDA10YearGrowth,\n        ValuationRatios_EVToFCF10YearGrowth,\n        ValuationRatios_EVToRevenue10YearGrowth,\n        ValuationRatios_EVToTotalAssets10YearGrowth,\n        ValuationRatios_PFCFRatio10YearGrowth,\n        ValuationRatios_PBRatio10YearGrowth,\n        ValuationRatios_PERatio10YearGrowth,\n        ValuationRatios_PSRatio10YearGrowth,\n        ValuationRatios_TwoYrsEVToForwardEBIT,\n        ValuationRatios_TwoYrsEVToForwardEBITDA,\n        ValuationRatios_FirstYearEstimatedEPSGrowth,\n        ValuationRatios_SecondYearEstimatedEPSGrowth,\n        ValuationRatios_NormalizedPEGRatio,\n        CompanyProfile_HeadquarterAddressLine1,\n        CompanyProfile_HeadquarterAddressLine2,\n        CompanyProfile_HeadquarterAddressLine3,\n        CompanyProfile_HeadquarterAddressLine4,\n        CompanyProfile_HeadquarterAddressLine5,\n        CompanyProfile_HeadquarterCity,\n        CompanyProfile_HeadquarterProvince,\n        CompanyProfile_HeadquarterCountry,\n        CompanyProfile_HeadquarterPostalCode,\n        CompanyProfile_HeadquarterPhone,\n        CompanyProfile_HeadquarterFax,\n        CompanyProfile_HeadquarterHomepage,\n        CompanyProfile_TotalEmployeeNumber,\n        CompanyProfile_ContactEmail,\n        CompanyProfile_AverageEmployeeNumber,\n        CompanyProfile_RegisteredAddressLine1,\n        CompanyProfile_RegisteredAddressLine2,\n        CompanyProfile_RegisteredAddressLine3,\n        CompanyProfile_RegisteredAddressLine4,\n        CompanyProfile_RegisteredCity,\n        CompanyProfile_RegisteredProvince,\n        CompanyProfile_RegisteredCountry,\n        CompanyProfile_RegisteredPostalCode,\n        CompanyProfile_RegisteredPhone,\n        CompanyProfile_RegisteredFax,\n        CompanyProfile_IsHeadOfficeSameWithRegisteredOfficeFlag,\n        CompanyProfile_SharesOutstanding,\n        CompanyProfile_MarketCap,\n        CompanyProfile_EnterpriseValue,\n        CompanyProfile_ShareClassLevelSharesOutstanding,\n        CompanyProfile_SharesOutstandingWithBalanceSheetEndingDate,\n        CompanyProfile_ReasonofSharesChange,\n        AssetClassification_StockType,\n        AssetClassification_StyleBox,\n        AssetClassification_GrowthGrade,\n        AssetClassification_FinancialHealthGrade,\n        AssetClassification_ProfitabilityGrade,\n        AssetClassification_MorningstarIndustryCode,\n        AssetClassification_MorningstarIndustryGroupCode,\n        AssetClassification_MorningstarSectorCode,\n        AssetClassification_MorningstarEconomySphereCode,\n        AssetClassification_SIC,\n        AssetClassification_NAICS,\n        AssetClassification_StyleScore,\n        AssetClassification_SizeScore,\n        AssetClassification_GrowthScore,\n        AssetClassification_ValueScore,\n        AssetClassification_NACE,\n        AssetClassification_CANNAICS,\n#pragma warning restore CS1591, CA1707\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/FundamentalTimeDependentProperty.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Simple base class shared by top layer fundamental properties which depend on a time provider\n    /// </summary>\n    public abstract class FundamentalTimeDependentProperty : ReusuableCLRObject\n    {\n        /// <summary>\n        /// The time provider instance to use\n        /// </summary>\n        protected ITimeProvider _timeProvider { get; }\n\n        /// <summary>\n        /// The SID instance to use\n        /// </summary>\n        protected SecurityIdentifier _securityIdentifier { get; }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FundamentalTimeDependentProperty(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n        {\n            _timeProvider = timeProvider;\n            _securityIdentifier = securityIdentifier;\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public abstract FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider);\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/FundamentalUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Lean fundamentals universe data class\n    /// </summary>\n    [Obsolete(\"'Fundamentals' was renamed to 'FundamentalUniverse'\")]\n    public class Fundamentals : FundamentalUniverse { }\n\n    /// <summary>\n    /// Lean fundamentals universe data class\n    /// </summary>\n    public class FundamentalUniverse : BaseDataCollection\n    {\n        private static readonly Fundamental _factory = new();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public FundamentalUniverse()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"symbol\">The associated symbol</param>\n        public FundamentalUniverse(DateTime time, Symbol symbol) : base(time, symbol)\n        {\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var path = _factory.GetSource(config, date, isLiveMode).Source;\n            return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.FoldingCollection);\n        }\n\n        /// <summary>\n        /// Will read a new instance from the given line\n        /// </summary>\n        /// <param name=\"config\">The associated requested configuration</param>\n        /// <param name=\"line\">The line to parse</param>\n        /// <param name=\"date\">The current time</param>\n        /// <param name=\"isLiveMode\">True if live mode</param>\n        /// <returns>A new instance or null</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            try\n            {\n                var csv = line.Split(',');\n                var symbol = new Symbol(SecurityIdentifier.Parse(csv[0]), csv[1]);\n                return new Fundamental(date, symbol);\n            }\n            catch (Exception)\n            {\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Will clone the current instance\n        /// </summary>\n        /// <returns>The cloned instance</returns>\n        public override BaseData Clone()\n        {\n            return new FundamentalUniverse(Time, Symbol) { Data = Data, EndTime = EndTime };\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Creates the universe symbol for the target market\n        /// </summary>\n        /// <returns>The universe symbol to use</returns>\n        public override Symbol UniverseSymbol(string market = null)\n        {\n            market ??= QuantConnect.Market.USA;\n            var ticker = $\"{GetType().Name}-{market}-{Guid.NewGuid()}\";\n            return Symbol.Create(ticker, SecurityType.Equity, market, baseDataType: GetType());\n        }\n\n        /// <summary>\n        /// Creates a new fundamental universe for the USA market\n        /// </summary>\n        /// <param name=\"selector\">The selector function</param>\n        /// <param name=\"universeSettings\">The universe settings to use, will default to algorithms if not provided</param>\n        /// <returns>A configured new universe instance</returns>\n        public static FundamentalUniverseFactory USA(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector, UniverseSettings universeSettings = null)\n        {\n            return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new fundamental universe for the USA market\n        /// </summary>\n        /// <param name=\"selector\">The selector function</param>\n        /// <param name=\"universeSettings\">The universe settings to use, will default to algorithms if not provided</param>\n        /// <returns>A configured new universe instance</returns>\n        public static FundamentalUniverseFactory USA(PyObject selector, UniverseSettings universeSettings = null)\n        {\n            return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);\n        }\n\n        /// <summary>\n        /// Creates a new fundamental universe for the USA market\n        /// </summary>\n        /// <param name=\"selector\">The selector function</param>\n        /// <param name=\"universeSettings\">The universe settings to use, will default to algorithms if not provided</param>\n        /// <returns>A configured new universe instance</returns>\n        public static FundamentalUniverseFactory USA(Func<IEnumerable<Fundamental>, object> selector, UniverseSettings universeSettings = null)\n        {\n            return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AVG5YrsROIC.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's ROIC over the last 5 years. Return on invested capital is calculated by taking net operating profit after taxes and dividends and dividing by the total amount of capital invested and expressing the result as a percentage.\n    /// </summary>\n    public class AVG5YrsROIC : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_AVG5YrsROIC_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AVG5YrsROIC()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AVG5YrsROIC(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccountsPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any money that a company owes its suppliers for goods and services purchased on credit and is expected to pay within the next year or operating cycle.\n    /// </summary>\n    public class AccountsPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccountsPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccountsPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccountsPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccountsReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts owed to a company by customers within a year as a result of exchanging goods or services on credit.\n    /// </summary>\n    public class AccountsReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccountsReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccountsReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedInterestReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This account shows the amount of unpaid interest accrued to the date of purchase and included in the purchase price of securities purchased between interest dates.\n    /// </summary>\n    public class AccruedInterestReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedInterestReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedInterestReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedInterestReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedInvestmentIncomeBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest, dividends, rents, ancillary and other revenues earned but not yet received by the entity on its investments.\n    /// </summary>\n    public class AccruedInvestmentIncomeBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedInvestmentIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedInvestmentIncomeBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedInvestmentIncomeBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedLiabilitiesTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities which have occurred, but have not been paid or logged under accounts payable during an accounting PeriodAsByte. In other words, obligations for goods and services provided to a company for which invoices have not yet been received; on a Non- Differentiated Balance Sheet.\n    /// </summary>\n    public class AccruedLiabilitiesTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedLiabilitiesTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedLiabilitiesTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedandDeferredIncomeBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of accrued liabilities and deferred income (amount received in advance but the services are not provided in respect of amount).\n    /// </summary>\n    public class AccruedandDeferredIncomeBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedandDeferredIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedandDeferredIncomeBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedandDeferredIncomeBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedandDeferredIncomeCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due within 1 year.\n    /// </summary>\n    public class AccruedandDeferredIncomeCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedandDeferredIncomeCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedandDeferredIncomeCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccruedandDeferredIncomeNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due after 1 year.\n    /// </summary>\n    public class AccruedandDeferredIncomeNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccruedandDeferredIncomeNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccruedandDeferredIncomeNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AccumulatedDepreciationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cumulative amount of wear and tear or obsolescence charged against the fixed assets of a company.\n    /// </summary>\n    public class AccumulatedDepreciationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AccumulatedDepreciation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AccumulatedDepreciationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AccumulatedDepreciationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AdditionalPaidInCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Excess of issue price over par or stated value of the entity's capital stock and amounts received from other transactions involving the entity's stock or stockholders. Includes adjustments to additional paid in capital. There are two major categories of additional paid in capital: 1) Paid in capital in excess of par/stated value, which is the difference between the actual issue price of the shares and the shares' par/stated value. 2) Paid in capital from other transactions which includes treasury stock, retirement of stock, stock dividends recorded at market, lapse of stock purchase warrants, conversion of convertible bonds in excess of the par value of the stock, and any other additional capital from the company's own stock transactions.\n    /// </summary>\n    public class AdditionalPaidInCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AdditionalPaidInCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AdditionalPaidInCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AdditionalPaidInCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AdvanceFromFederalHomeLoanBanksBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item is typically available for bank industry. It's the amount of borrowings as of the balance sheet date from the Federal Home Loan Bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.\n    /// </summary>\n    public class AdvanceFromFederalHomeLoanBanksBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AdvanceFromFederalHomeLoanBanksBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AdvanceFromFederalHomeLoanBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AdvancesfromCentralBanksBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Borrowings from the central bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.\n    /// </summary>\n    public class AdvancesfromCentralBanksBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AdvancesfromCentralBanksBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AdvancesfromCentralBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AllTaxesPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid to tax authorities in operating cash flow, using the direct method\n    /// </summary>\n    public class AllTaxesPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_AllTaxesPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AllTaxesPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AllTaxesPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AllowanceForDoubtfulAccountsReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An Allowance for Doubtful Accounts measures receivables recorded but not expected to be collected.\n    /// </summary>\n    public class AllowanceForDoubtfulAccountsReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AllowanceForDoubtfulAccountsReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AllowanceForDoubtfulAccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AllowanceForLoansAndLeaseLossesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A contra account sets aside as an allowance for bad loans (e.g. customer defaults).\n    /// </summary>\n    public class AllowanceForLoansAndLeaseLossesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AllowanceForLoansAndLeaseLossesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AllowanceForLoansAndLeaseLossesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AllowanceForNotesReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item is typically available for bank industry. It represents a provision relating to a written agreement to receive money with the terms of the note (at a specified future date(s) within one year from the reporting date (or the normal operating cycle, whichever is longer), consisting of principal as well as any accrued interest) for the portion that is expected to be uncollectible.\n    /// </summary>\n    public class AllowanceForNotesReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AllowanceForNotesReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AllowanceForNotesReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The systematic and rational apportionment of the acquisition cost of intangible operational assets to future periods in which the benefits contribute to revenue. This field is to include Amortization and any variation where Amortization is the first account listed in the line item, excluding Amortization of Intangibles.\n    /// </summary>\n    public class AmortizationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_Amortization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The non-cash expense recognized on intangible assets over the benefit period of the asset.\n    /// </summary>\n    public class AmortizationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_Amortization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationOfFinancingCostsAndDiscountsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The component of interest expense representing the non-cash expenses charged against earnings in the period to allocate debt discount and premium, and the costs to issue debt and obtain financing over the related debt instruments. This item is usually only available for bank industry.\n    /// </summary>\n    public class AmortizationOfFinancingCostsAndDiscountsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationOfFinancingCostsAndDiscountsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationOfFinancingCostsAndDiscountsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationOfIntangiblesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.\n    /// </summary>\n    public class AmortizationOfIntangiblesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationOfIntangiblesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationOfIntangiblesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationOfIntangiblesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.\n    /// </summary>\n    public class AmortizationOfIntangiblesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_AmortizationOfIntangibles_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationOfIntangiblesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationOfIntangiblesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationOfSecuritiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents amortization of the allocation of a lump sum amount to different time periods, particularly for securities, debt, loans, and other forms of financing. Does not include amortization, amortization of capital expenditure and intangible assets.\n    /// </summary>\n    public class AmortizationOfSecuritiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_AmortizationOfSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationOfSecuritiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationOfSecuritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AmortizationSupplementalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current period expense charged against earnings on intangible asset over its useful life. It is a supplemental value which would be reported outside consolidated statements.\n    /// </summary>\n    public class AmortizationSupplementalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_AmortizationSupplemental_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AmortizationSupplementalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AmortizationSupplementalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetClassification.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the AssetClassification class\n    /// </summary>\n    public class AssetClassification : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The purpose of the Stock Types is to group companies according to the underlying fundamentals of their business. They answer the question: If I buy this stock, what kind of company am I buying? Unlike the style box, the emphasis with the Stock Types is on income statement, balance sheet, and cash-flow data-not price data or valuation multiples. We focus on the company, not the stock. Morningstar calculates this figure in-house on a monthly basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3000\n        /// </remarks>\n        [JsonProperty(\"3000\")]\n        public int StockType => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StockType);\n\n        /// <summary>\n        /// The Morningstar Equity Style Box is a grid that provides a graphical representation of the investment style of stocks and portfolios. It classifies securities according to market capitalization (the vertical axis) and value-growth scores (the horizontal axis) and allows us to provide analysis on a 5-by-5 Style Box as well as providing the traditional style box assignment, which is the basis for the Morningstar Category. Two of the style categories, value and growth, are common to both stocks and portfolios. However, for stocks, the central column of the style box represents the core style (those stocks for which neither value nor growth characteristics dominate); for portfolios, it represents the blend style.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3001\n        /// </remarks>\n        [JsonProperty(\"3001\")]\n        public int StyleBox => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StyleBox);\n\n        /// <summary>\n        /// The growth grade is based on the trend in revenue per share using data from the past five years. For the purpose of calculating revenue per share we use the past five years' revenue figures and corresponding year-end fully diluted shares outstanding; if year- end fully diluted shares outstanding is not available, we calculate this figure by dividing the company's reported net income applicable to common shareholders by the reported fully diluted earnings per share. A company must have a minimum of four consecutive years of positive and non-zero revenue, including the latest fiscal year, to qualify for a grade. In calculating the revenue per share growth rate, we calculate the slope of the regression line of historical revenue per share. We then divide the slope of the regression line by the arithmetic average of historical revenue per share figures. The result of the regression is a normalized historical increase or decrease in the rate of growth for sales per share. We then calculate a z-score by subtracting the universe mean revenue growth from the company's revenue growth, and dividing by the standard deviation of the universe's growth rates. Stocks are sorted based on the z-score of their revenue per share growth rate calculated above, from the most negative z-score to the most positive z-score. Stocks are then ranked based on their z-score from 1 to the total number of qualified stocks. We assign grades based on this ranking. Stocks are assigned A, B, C, D, or F. Morningstar calculates this figure in-house on a monthly basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3002\n        /// </remarks>\n        [JsonProperty(\"3002\")]\n        public string GrowthGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_GrowthGrade);\n\n        /// <summary>\n        /// Instead of using accounting-based ratios to formulate a measure to reflect the financial health of a firm, we use structural or contingent claim models. Structural models take advantage of both market information and accounting financial information. The firm's equity in such models is viewed as a call option on the value of the firm's assets. If the value of the assets is not sufficient to cover the firm's liabilities (the strike price), default is expected to occur, and the call option expires worthless and the firm is turned over to its creditors. To estimate a distance to default, the value of the firm's liabilities is obtained from the firm's latest balance sheet and incorporated into the model. We then rank the calculated distance to default and award 10% of the universe A's, 20% B's, 40% C's, 20% D's, and 10% F's. Morningstar calculates this figure in-house on a daily basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3003\n        /// </remarks>\n        [JsonProperty(\"3003\")]\n        public string FinancialHealthGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_FinancialHealthGrade);\n\n        /// <summary>\n        /// The profitability grade for all qualified companies in Morningstar's stock universe is based on valuation of return on shareholders' equity (ROE) using data from the past five years. Morningstar's universe of stocks is first filtered for adequacy of historical ROE figures. Companies with less than four years of consecutive ROE figures including the ROE figure for the latest fiscal year are tossed from calculations and are assigned \"--\" for the profitability grade. For the remaining qualified universe of stocks the profitability grade is based on the valuation of the following three components, which are assigned different weights; the historical growth rate of ROE, the average level of historical ROE, the level of ROE in the latest fiscal year of the company. Stocks are assigned A, B, C, D, or F. Morningstar calculates this figure in-house on a monthly basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3004\n        /// </remarks>\n        [JsonProperty(\"3004\")]\n        public string ProfitabilityGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_ProfitabilityGrade);\n\n        /// <summary>\n        /// Equities are mapped into one of 148 industries, the one which most accurately reflects the underlying business of that company. This mapping is based on publicly available information about each company and uses annual reports, Form 10-Ks and Morningstar Equity Analyst input as its primary source. Other secondary sources of information may include company web sites, sell-side research (if available) and trade publications. By and large, equities are mapped into the industries that best reflect each company's largest source of revenue and income. If the company has more than three sources of revenue and income and there is no clear dominant revenue and income stream, the company is assigned to the Conglomerates industry. Based on Morningstar analyst research or other third party information, Morningstar may change industry assignments to more accurately reflect the changing businesses of companies.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3005\n        /// </remarks>\n        [JsonProperty(\"3005\")]\n        public int MorningstarIndustryCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarIndustryCode);\n\n        /// <summary>\n        /// Industries are mapped into 69 industry groups based on their common operational characteristics. If a particular industry has unique operating characteristics-or simply lacks commonality with other industries-it would map into its own group. However, any industry group containing just one single industry does not necessarily imply that that industry is dominant or otherwise important. The assignment simply reflects the lack of a sufficient amount of shared traits among industries. See appendix for mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3006\n        /// </remarks>\n        [JsonProperty(\"3006\")]\n        public int MorningstarIndustryGroupCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarIndustryGroupCode);\n\n        /// <summary>\n        /// Industry groups are consolidated into 11 sectors. See appendix for mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3007\n        /// </remarks>\n        [JsonProperty(\"3007\")]\n        public int MorningstarSectorCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarSectorCode);\n\n        /// <summary>\n        /// Sectors are consolidated into three major economic spheres or Super Sectors: Cyclical, Defensive and Sensitive. See appendix for mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3008\n        /// </remarks>\n        [JsonProperty(\"3008\")]\n        public int MorningstarEconomySphereCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarEconomySphereCode);\n\n        /// <summary>\n        /// Standard Industrial Classification System (SIC) is a system for classifying a business according to economic activity. See separate reference document for a list of Sic Codes/Mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3009\n        /// </remarks>\n        [JsonProperty(\"3009\")]\n        public int SIC => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_SIC);\n\n        /// <summary>\n        /// An acronym for North American Industry Classification System, it is a 6 digit numerical classification assigned to individual companies. Developed jointly by the U.S., Canada, and Mexico to provide new comparability in statistics about business activity across North America. It is intended to replace the U.S. Standard Industrial Classification (SIC) system. See separate reference document for a list of NAICS Codes/Mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3010\n        /// </remarks>\n        [JsonProperty(\"3010\")]\n        public int NAICS => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_NAICS);\n\n        /// <summary>\n        /// The scores for a stock's value and growth characteristics determine its horizontal placement. The Value-Growth Score is a reflection of the aggregate expectations of market participants for the future growth and required rate of return for a stock. We infer these expectations from the relation between current market prices and future growth and cost of capital expectations under the assumption of rational market participants and a simple model of stock value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3011\n        /// </remarks>\n        [JsonProperty(\"3011\")]\n        public double StyleScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StyleScore);\n\n        /// <summary>\n        /// Rather than a fixed number of large cap or small cap stocks, Morningstar uses a flexible system that isn't adversely affected by overall movements in the market. The Morningstar stock universe represents approximately 99% of the U.S. market for actively traded stocks. Giant-cap stocks are defined as the group that accounts for the top 40% of the capitalization of the Morningstar domestic stock universe; large-cap stocks represent the next 30%; mid-cap stocks represent the next 20%; small-cap stocks represent the next 7%; and micro-cap stocks represent the remaining 3%. Each stock is given a Size Score that ranges from -100 (very micro) to 400 (very giant). When classifying stocks to a Style Box, giant is included in large and micro is included in small.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3012\n        /// </remarks>\n        [JsonProperty(\"3012\")]\n        public double SizeScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_SizeScore);\n\n        /// <summary>\n        /// A high overall growth score indicates that a stock's per-share earnings, book value, revenues, and cash flow are expected to grow quickly relative to other stocks in the same scoring group. A weak growth orientation does not necessarily mean that a stock has a strong value orientation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3013\n        /// </remarks>\n        [JsonProperty(\"3013\")]\n        public double GrowthScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_GrowthScore);\n\n        /// <summary>\n        /// A high value score indicates that a stock's price is relatively low, given the anticipated per-sharing earnings, book value, revenues, cash flow, and dividends that the stock provides to investors. A high price relative to these measures indicates that a stock's value orientation is weak, but it does not necessarily mean that the stock is growth-oriented.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3014\n        /// </remarks>\n        [JsonProperty(\"3014\")]\n        public double ValueScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_ValueScore);\n\n        /// <summary>\n        /// NACE is a European standard classification of economic activities maintained by Eurostat.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3015\n        /// </remarks>\n        [JsonProperty(\"3015\")]\n        public double NACE => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_NACE);\n\n        /// <summary>\n        /// Similar to NAICS (data point 3010, above), this is specifically for Canadian classifications. An acronym for North American Industry Classification System, it is a 6 digit numerical classification assigned to individual companies. Developed jointly by the U.S., Canada, and Mexico to provide new comparability in statistics about business activity across North America. It is intended to replace the U.S. Standard Industrial Classification (SIC) system. See separate reference document for a list of NAICS Codes/Mappings. The initial SIC and NAICS listed is the Primary based on revenue generation; followed by Secondary SIC and NAICS when applicable. Both SIC and NAICS are manually collected and assigned.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3016\n        /// </remarks>\n        [JsonProperty(\"3016\")]\n        public int CANNAICS => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_CANNAICS);\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetClassification(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new AssetClassification(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetImpairmentChargeCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The charge against earnings resulting from the aggregate write down of all assets from their carrying value to their fair value.\n    /// </summary>\n    public class AssetImpairmentChargeCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_AssetImpairmentCharge_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetImpairmentChargeCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetImpairmentChargeCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsHeldForSaleBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item is typically available for bank industry. It's a part of long-lived assets, which has been decided for sale in the future.\n    /// </summary>\n    public class AssetsHeldForSaleBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AssetsHeldForSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsHeldForSaleBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsHeldForSaleBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsHeldForSaleCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Short term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.\n    /// </summary>\n    public class AssetsHeldForSaleCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsHeldForSaleCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsHeldForSaleCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsHeldForSaleNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Long term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.\n    /// </summary>\n    public class AssetsHeldForSaleNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsHeldForSaleNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsHeldForSaleNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsOfDiscontinuedOperationsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A portion of a company's business that has been disposed of or sold.\n    /// </summary>\n    public class AssetsOfDiscontinuedOperationsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsOfDiscontinuedOperationsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsOfDiscontinuedOperationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total value collateral assets pledged to the bank that can be sold or used as collateral for other loans.\n    /// </summary>\n    public class AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AssetsTurnover.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue / Average Total Assets\n    /// </summary>\n    public class AssetsTurnover : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_AssetsTurnover_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AssetsTurnover()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AssetsTurnover(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AuditorReportStatus.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Auditor opinion code will be one of the following for each annual period: Code Meaning UQ Unqualified Opinion UE Unqualified Opinion with Explanation QM Qualified - Due to change in accounting method QL Qualified - Due to litigation OT Qualified Opinion - Other AO Adverse Opinion DS Disclaim an opinion UA Unaudited\n    /// </summary>\n    public class AuditorReportStatus : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_AuditorReportStatus_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AuditorReportStatus()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AuditorReportStatus(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// For an unclassified balance sheet, this item represents equity securities categorized neither as held-to-maturity nor trading. Equity securities represent ownership interests or the right to acquire ownership interests in corporations and other legal entities which ownership interest is represented by shares of common or preferred stock (which is not mandatory redeemable or redeemable at the option of the holder), convertible securities, stock rights, or stock warrants. This category includes preferred stocks, available- for-sale and common stock, available-for-sale.\n    /// </summary>\n    public class AvailableForSaleSecuritiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_AvailableForSaleSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AvailableForSaleSecuritiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AvailableForSaleSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/AverageDilutionEarningsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Adjustments to reported net income to calculate Diluted EPS, by assuming that all convertible instruments are converted to Common Equity. The adjustments usually include the interest expense of debentures when assumed converted and preferred dividends of convertible preferred stock when assumed converted.\n    /// </summary>\n    public class AverageDilutionEarningsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_AverageDilutionEarnings_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public AverageDilutionEarningsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public AverageDilutionEarningsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the BalanceSheet class\n    /// </summary>\n    public class BalanceSheet : ReusuableCLRObject\n    {\n        /// <summary>\n        /// Filing date of the Balance Sheet\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23542\n        /// </remarks>\n        [JsonProperty(\"23542\")]\n        public BalanceSheetFileDate BSFileDate => _bSFileDate ??= new(_timeProvider, _securityIdentifier);\n        private BalanceSheetFileDate _bSFileDate;\n\n        /// <summary>\n        /// Any money that a company owes its suppliers for goods and services purchased on credit and is expected to pay within the next year or operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23000\n        /// </remarks>\n        [JsonProperty(\"23000\")]\n        public AccountsPayableBalanceSheet AccountsPayable => _accountsPayable ??= new(_timeProvider, _securityIdentifier);\n        private AccountsPayableBalanceSheet _accountsPayable;\n\n        /// <summary>\n        /// Accounts owed to a company by customers within a year as a result of exchanging goods or services on credit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23001\n        /// </remarks>\n        [JsonProperty(\"23001\")]\n        public AccountsReceivableBalanceSheet AccountsReceivable => _accountsReceivable ??= new(_timeProvider, _securityIdentifier);\n        private AccountsReceivableBalanceSheet _accountsReceivable;\n\n        /// <summary>\n        /// An expense recognized before it is paid for. Includes compensation, interest, pensions and all other miscellaneous accruals reported by the company. Expenses incurred during the accounting period, but not required to be paid until a later date.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23004\n        /// </remarks>\n        [JsonProperty(\"23004\")]\n        public CurrentAccruedExpensesBalanceSheet CurrentAccruedExpenses => _currentAccruedExpenses ??= new(_timeProvider, _securityIdentifier);\n        private CurrentAccruedExpensesBalanceSheet _currentAccruedExpenses;\n\n        /// <summary>\n        /// An expense that has occurred but the transaction has not been entered in the accounting records. Accordingly, an adjusting entry is made to debit the appropriate expense account and to credit a liability account such as accrued expenses payable or accounts payable.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23005\n        /// </remarks>\n        [JsonProperty(\"23005\")]\n        public NonCurrentAccruedExpensesBalanceSheet NonCurrentAccruedExpenses => _nonCurrentAccruedExpenses ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentAccruedExpensesBalanceSheet _nonCurrentAccruedExpenses;\n\n        /// <summary>\n        /// Interest, dividends, rents, ancillary and other revenues earned but not yet received by the entity on its investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23007\n        /// </remarks>\n        [JsonProperty(\"23007\")]\n        public AccruedInvestmentIncomeBalanceSheet AccruedInvestmentIncome => _accruedInvestmentIncome ??= new(_timeProvider, _securityIdentifier);\n        private AccruedInvestmentIncomeBalanceSheet _accruedInvestmentIncome;\n\n        /// <summary>\n        /// The cumulative amount of wear and tear or obsolescence charged against the fixed assets of a company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23008\n        /// </remarks>\n        [JsonProperty(\"23008\")]\n        public AccumulatedDepreciationBalanceSheet AccumulatedDepreciation => _accumulatedDepreciation ??= new(_timeProvider, _securityIdentifier);\n        private AccumulatedDepreciationBalanceSheet _accumulatedDepreciation;\n\n        /// <summary>\n        /// The aggregate amount of gains or losses that are not part of retained earnings. It is also called other comprehensive income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23009\n        /// </remarks>\n        [JsonProperty(\"23009\")]\n        public GainsLossesNotAffectingRetainedEarningsBalanceSheet GainsLossesNotAffectingRetainedEarnings => _gainsLossesNotAffectingRetainedEarnings ??= new(_timeProvider, _securityIdentifier);\n        private GainsLossesNotAffectingRetainedEarningsBalanceSheet _gainsLossesNotAffectingRetainedEarnings;\n\n        /// <summary>\n        /// Excess of issue price over par or stated value of the entity's capital stock and amounts received from other transactions involving the entity's stock or stockholders. Includes adjustments to additional paid in capital. There are two major categories of additional paid in capital: 1) Paid in capital in excess of par/stated value, which is the difference between the actual issue price of the shares and the shares' par/stated value. 2) Paid in capital from other transactions which includes treasury stock, retirement of stock, stock dividends recorded at market, lapse of stock purchase warrants, conversion of convertible bonds in excess of the par value of the stock, and any other additional capital from the company's own stock transactions.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23012\n        /// </remarks>\n        [JsonProperty(\"23012\")]\n        public AdditionalPaidInCapitalBalanceSheet AdditionalPaidInCapital => _additionalPaidInCapital ??= new(_timeProvider, _securityIdentifier);\n        private AdditionalPaidInCapitalBalanceSheet _additionalPaidInCapital;\n\n        /// <summary>\n        /// A contra account sets aside as an allowance for bad loans (e.g. customer defaults).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23016\n        /// </remarks>\n        [JsonProperty(\"23016\")]\n        public AllowanceForLoansAndLeaseLossesBalanceSheet AllowanceForLoansAndLeaseLosses => _allowanceForLoansAndLeaseLosses ??= new(_timeProvider, _securityIdentifier);\n        private AllowanceForLoansAndLeaseLossesBalanceSheet _allowanceForLoansAndLeaseLosses;\n\n        /// <summary>\n        /// For an unclassified balance sheet, this item represents equity securities categorized neither as held-to-maturity nor trading. Equity securities represent ownership interests or the right to acquire ownership interests in corporations and other legal entities which ownership interest is represented by shares of common or preferred stock (which is not mandatory redeemable or redeemable at the option of the holder), convertible securities, stock rights, or stock warrants. This category includes preferred stocks, available- for-sale and common stock, available-for-sale.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23020\n        /// </remarks>\n        [JsonProperty(\"23020\")]\n        public AvailableForSaleSecuritiesBalanceSheet AvailableForSaleSecurities => _availableForSaleSecurities ??= new(_timeProvider, _securityIdentifier);\n        private AvailableForSaleSecuritiesBalanceSheet _availableForSaleSecurities;\n\n        /// <summary>\n        /// The total amount of stock authorized for issue by a corporation, including common and preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23027\n        /// </remarks>\n        [JsonProperty(\"23027\")]\n        public CapitalStockBalanceSheet CapitalStock => _capitalStock ??= new(_timeProvider, _securityIdentifier);\n        private CapitalStockBalanceSheet _capitalStock;\n\n        /// <summary>\n        /// Cash includes currency on hand as well as demand deposits with banks or financial institutions. It also includes other kinds of accounts that have the general characteristics of demand deposits in that the customer may deposit additional funds at any time and also effectively may withdraw funds at any time without prior notice or penalty.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23028\n        /// </remarks>\n        [JsonProperty(\"23028\")]\n        public CashBalanceSheet Cash => _cash ??= new(_timeProvider, _securityIdentifier);\n        private CashBalanceSheet _cash;\n\n        /// <summary>\n        /// Cash equivalents, excluding items classified as marketable securities, include short-term, highly liquid investments that are both readily convertible to known amounts of cash, and so near their maturity that they present insignificant risk of changes in value because of changes in interest rates. Generally, only investments with original maturities of three months or less qualify under this definition. Original maturity means original maturity to the entity holding the investment. For example, both a three-month US Treasury bill and a three-year Treasury note purchased three months from maturity qualify as cash equivalents. However, a Treasury note purchased three years ago does not become a cash equivalent when its remaining maturity is three months.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23029\n        /// </remarks>\n        [JsonProperty(\"23029\")]\n        public CashEquivalentsBalanceSheet CashEquivalents => _cashEquivalents ??= new(_timeProvider, _securityIdentifier);\n        private CashEquivalentsBalanceSheet _cashEquivalents;\n\n        /// <summary>\n        /// Includes unrestricted cash on hand, money market instruments and other debt securities which can be converted to cash immediately.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23030\n        /// </remarks>\n        [JsonProperty(\"23030\")]\n        public CashAndCashEquivalentsBalanceSheet CashAndCashEquivalents => _cashAndCashEquivalents ??= new(_timeProvider, _securityIdentifier);\n        private CashAndCashEquivalentsBalanceSheet _cashAndCashEquivalents;\n\n        /// <summary>\n        /// Includes cash on hand (currency and coin), cash items in process of collection, non-interest bearing deposits due from other financial institutions (including corporate credit unions), and balances with the Federal Reserve Banks, Federal Home Loan Banks and central banks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23031\n        /// </remarks>\n        [JsonProperty(\"23031\")]\n        public CashAndDueFromBanksBalanceSheet CashAndDueFromBanks => _cashAndDueFromBanks ??= new(_timeProvider, _securityIdentifier);\n        private CashAndDueFromBanksBalanceSheet _cashAndDueFromBanks;\n\n        /// <summary>\n        /// The aggregate amount of cash, cash equivalents, and federal funds sold.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23032\n        /// </remarks>\n        [JsonProperty(\"23032\")]\n        public CashCashEquivalentsAndFederalFundsSoldBalanceSheet CashCashEquivalentsAndFederalFundsSold => _cashCashEquivalentsAndFederalFundsSold ??= new(_timeProvider, _securityIdentifier);\n        private CashCashEquivalentsAndFederalFundsSoldBalanceSheet _cashCashEquivalentsAndFederalFundsSold;\n\n        /// <summary>\n        /// The aggregate amount of cash, cash equivalents, and marketable securities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23033\n        /// </remarks>\n        [JsonProperty(\"23033\")]\n        public CashCashEquivalentsAndMarketableSecuritiesBalanceSheet CashCashEquivalentsAndMarketableSecurities => _cashCashEquivalentsAndMarketableSecurities ??= new(_timeProvider, _securityIdentifier);\n        private CashCashEquivalentsAndMarketableSecuritiesBalanceSheet _cashCashEquivalentsAndMarketableSecurities;\n\n        /// <summary>\n        /// Common stock (all issues) at par value, as reported within the Stockholder's Equity section of the balance sheet; i.e. it is one component of Common Stockholder's Equity\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23038\n        /// </remarks>\n        [JsonProperty(\"23038\")]\n        public CommonStockBalanceSheet CommonStock => _commonStock ??= new(_timeProvider, _securityIdentifier);\n        private CommonStockBalanceSheet _commonStock;\n\n        /// <summary>\n        /// The total amount of assets considered to be convertible into cash within a relatively short period of time, usually a year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23044\n        /// </remarks>\n        [JsonProperty(\"23044\")]\n        public CurrentAssetsBalanceSheet CurrentAssets => _currentAssets ??= new(_timeProvider, _securityIdentifier);\n        private CurrentAssetsBalanceSheet _currentAssets;\n\n        /// <summary>\n        /// Represents the total amount of long-term debt such as bank loans and commercial paper, which is due within one year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23045\n        /// </remarks>\n        [JsonProperty(\"23045\")]\n        public CurrentDebtBalanceSheet CurrentDebt => _currentDebt ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDebtBalanceSheet _currentDebt;\n\n        /// <summary>\n        /// All borrowings due within one year including current portions of long-term debt and capital leases as well as short-term debt such as bank loans and commercial paper.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23046\n        /// </remarks>\n        [JsonProperty(\"23046\")]\n        public CurrentDebtAndCapitalLeaseObligationBalanceSheet CurrentDebtAndCapitalLeaseObligation => _currentDebtAndCapitalLeaseObligation ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDebtAndCapitalLeaseObligationBalanceSheet _currentDebtAndCapitalLeaseObligation;\n\n        /// <summary>\n        /// The debts or obligations of the firm that are due within one year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23047\n        /// </remarks>\n        [JsonProperty(\"23047\")]\n        public CurrentLiabilitiesBalanceSheet CurrentLiabilities => _currentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private CurrentLiabilitiesBalanceSheet _currentLiabilities;\n\n        /// <summary>\n        /// Represents the total amount of long-term capital leases that must be paid within the next accounting period. Capital lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23048\n        /// </remarks>\n        [JsonProperty(\"23048\")]\n        public CurrentCapitalLeaseObligationBalanceSheet CurrentCapitalLeaseObligation => _currentCapitalLeaseObligation ??= new(_timeProvider, _securityIdentifier);\n        private CurrentCapitalLeaseObligationBalanceSheet _currentCapitalLeaseObligation;\n\n        /// <summary>\n        /// An amount owed to a firm that is not expected to be received by the firm within one year from the date of the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23052\n        /// </remarks>\n        [JsonProperty(\"23052\")]\n        public DeferredAssetsBalanceSheet DeferredAssets => _deferredAssets ??= new(_timeProvider, _securityIdentifier);\n        private DeferredAssetsBalanceSheet _deferredAssets;\n\n        /// <summary>\n        /// An expenditure not recognized as a cost of operation of the period in which incurred, but carried forward to be written off in future periods.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23054\n        /// </remarks>\n        [JsonProperty(\"23054\")]\n        public DeferredCostsBalanceSheet DeferredCosts => _deferredCosts ??= new(_timeProvider, _securityIdentifier);\n        private DeferredCostsBalanceSheet _deferredCosts;\n\n        /// <summary>\n        /// Represents the non-current portion of obligations, which is a liability that usually would have been paid but is now past due.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23057\n        /// </remarks>\n        [JsonProperty(\"23057\")]\n        public NonCurrentDeferredLiabilitiesBalanceSheet NonCurrentDeferredLiabilities => _nonCurrentDeferredLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentDeferredLiabilitiesBalanceSheet _nonCurrentDeferredLiabilities;\n\n        /// <summary>\n        /// Represents the current portion of obligations, which is a liability that usually would have been paid but is now past due.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23058\n        /// </remarks>\n        [JsonProperty(\"23058\")]\n        public CurrentDeferredLiabilitiesBalanceSheet CurrentDeferredLiabilities => _currentDeferredLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDeferredLiabilitiesBalanceSheet _currentDeferredLiabilities;\n\n        /// <summary>\n        /// Net amount of deferred policy acquisition costs capitalized on contracts remaining in force as of the balance sheet date.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23059\n        /// </remarks>\n        [JsonProperty(\"23059\")]\n        public DeferredPolicyAcquisitionCostsBalanceSheet DeferredPolicyAcquisitionCosts => _deferredPolicyAcquisitionCosts ??= new(_timeProvider, _securityIdentifier);\n        private DeferredPolicyAcquisitionCostsBalanceSheet _deferredPolicyAcquisitionCosts;\n\n        /// <summary>\n        /// Represents collections of cash or other assets related to revenue producing activity for which revenue has not yet been recognized. Generally, an entity records deferred revenue when it receives consideration from a customer before achieving certain criteria that must be met for revenue to be recognized in conformity with GAAP. It can be either current or non-current item. Also called unearned revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23061\n        /// </remarks>\n        [JsonProperty(\"23061\")]\n        public CurrentDeferredRevenueBalanceSheet CurrentDeferredRevenue => _currentDeferredRevenue ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDeferredRevenueBalanceSheet _currentDeferredRevenue;\n\n        /// <summary>\n        /// The non-current portion of deferred revenue amount as of the balance sheet date. Deferred revenue is a liability related to revenue producing activity for which revenue has not yet been recognized, and is not expected be recognized in the next twelve months.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23062\n        /// </remarks>\n        [JsonProperty(\"23062\")]\n        public NonCurrentDeferredRevenueBalanceSheet NonCurrentDeferredRevenue => _nonCurrentDeferredRevenue ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentDeferredRevenueBalanceSheet _nonCurrentDeferredRevenue;\n\n        /// <summary>\n        /// An asset on a company's balance sheet that may be used to reduce any subsequent period's income tax expense. Deferred tax assets can arise due to net loss carryovers, which are only recorded as assets if it is deemed more likely than not that the asset will be used in future fiscal periods.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23063\n        /// </remarks>\n        [JsonProperty(\"23063\")]\n        public DeferredTaxAssetsBalanceSheet DeferredTaxAssets => _deferredTaxAssets ??= new(_timeProvider, _securityIdentifier);\n        private DeferredTaxAssetsBalanceSheet _deferredTaxAssets;\n\n        /// <summary>\n        /// Meaning a future tax asset, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value, or timing differences between the recognition of gains and losses in financial statements and their recognition in a tax computation. It is also called future tax.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23064\n        /// </remarks>\n        [JsonProperty(\"23064\")]\n        public CurrentDeferredTaxesAssetsBalanceSheet CurrentDeferredTaxesAssets => _currentDeferredTaxesAssets ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDeferredTaxesAssetsBalanceSheet _currentDeferredTaxesAssets;\n\n        /// <summary>\n        /// Meaning a future tax liability, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value, or timing differences between the recognition of gains and losses in financial statements and their recognition in a tax computation. Deferred tax liabilities generally arise where tax relief is provided in advance of an accounting expense, or income is accrued but not taxed until received.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23065\n        /// </remarks>\n        [JsonProperty(\"23065\")]\n        public CurrentDeferredTaxesLiabilitiesBalanceSheet CurrentDeferredTaxesLiabilities => _currentDeferredTaxesLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDeferredTaxesLiabilitiesBalanceSheet _currentDeferredTaxesLiabilities;\n\n        /// <summary>\n        /// A result of timing differences between taxable incomes reported on the income statement and taxable income from the company's tax return. Depending on the positioning of deferred income taxes, the field may be either current (within current assets) or non- current (below total current assets). Typically a company will have two deferred income taxes fields.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23066\n        /// </remarks>\n        [JsonProperty(\"23066\")]\n        public NonCurrentDeferredTaxesAssetsBalanceSheet NonCurrentDeferredTaxesAssets => _nonCurrentDeferredTaxesAssets ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentDeferredTaxesAssetsBalanceSheet _nonCurrentDeferredTaxesAssets;\n\n        /// <summary>\n        /// The estimated future tax obligations, which usually arise when different accounting methods are used for financial statements and tax statement It is also an add-back to the cash flow statement. Deferred income taxes include accumulated tax deferrals due to accelerated depreciation and investment credit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23067\n        /// </remarks>\n        [JsonProperty(\"23067\")]\n        public NonCurrentDeferredTaxesLiabilitiesBalanceSheet NonCurrentDeferredTaxesLiabilities => _nonCurrentDeferredTaxesLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentDeferredTaxesLiabilitiesBalanceSheet _nonCurrentDeferredTaxesLiabilities;\n\n        /// <summary>\n        /// This asset represents equity securities categorized neither as held-to-maturity nor trading.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23076\n        /// </remarks>\n        [JsonProperty(\"23076\")]\n        public EquityInvestmentsBalanceSheet EquityInvestments => _equityInvestments ??= new(_timeProvider, _securityIdentifier);\n        private EquityInvestmentsBalanceSheet _equityInvestments;\n\n        /// <summary>\n        /// This liability refers to the amount shown on the books that a bank with insufficient reserves borrows, at the federal funds rate, from another bank to meet its reserve requirements; and the amount of securities that an institution sells and agrees to repurchase at a specified date for a specified price, net of any reductions or offsets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23079\n        /// </remarks>\n        [JsonProperty(\"23079\")]\n        public FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase => _federalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase ??= new(_timeProvider, _securityIdentifier);\n        private FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet _federalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase;\n\n        /// <summary>\n        /// This asset refers to very-short-term loans of funds to other banks and securities dealers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23081\n        /// </remarks>\n        [JsonProperty(\"23081\")]\n        public FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell => _federalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell ??= new(_timeProvider, _securityIdentifier);\n        private FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet _federalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell;\n\n        /// <summary>\n        /// This asset refers to types of investments that may be contained within the fixed maturity category which securities are having a stated final repayment date. Examples of items within this category may include bonds, including convertibles and bonds with warrants, and redeemable preferred stocks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23089\n        /// </remarks>\n        [JsonProperty(\"23089\")]\n        public FixedMaturityInvestmentsBalanceSheet FixedMaturityInvestments => _fixedMaturityInvestments ??= new(_timeProvider, _securityIdentifier);\n        private FixedMaturityInvestmentsBalanceSheet _fixedMaturityInvestments;\n\n        /// <summary>\n        /// Accounting policy pertaining to an insurance entity's net liability for future benefits (for example, death, cash surrender value) to be paid to or on behalf of policyholders, describing the bases, methodologies and components of the reserve, and assumptions regarding estimates of expected investment yields, mortality, morbidity, terminations and expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23095\n        /// </remarks>\n        [JsonProperty(\"23095\")]\n        public FuturePolicyBenefitsBalanceSheet FuturePolicyBenefits => _futurePolicyBenefits ??= new(_timeProvider, _securityIdentifier);\n        private FuturePolicyBenefitsBalanceSheet _futurePolicyBenefits;\n\n        /// <summary>\n        /// In a limited partnership or master limited partnership form of business, this represents the balance of capital held by the general partners.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23096\n        /// </remarks>\n        [JsonProperty(\"23096\")]\n        public GeneralPartnershipCapitalBalanceSheet GeneralPartnershipCapital => _generalPartnershipCapital ??= new(_timeProvider, _securityIdentifier);\n        private GeneralPartnershipCapitalBalanceSheet _generalPartnershipCapital;\n\n        /// <summary>\n        /// The excess of the cost of an acquired company over the sum of the fair market value of its identifiable individual assets less the liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23097\n        /// </remarks>\n        [JsonProperty(\"23097\")]\n        public GoodwillBalanceSheet Goodwill => _goodwill ??= new(_timeProvider, _securityIdentifier);\n        private GoodwillBalanceSheet _goodwill;\n\n        /// <summary>\n        /// Rights or economic benefits, such as patents and goodwill, that is not physical in nature. They are those that are neither physical nor financial in nature, nevertheless, have value to the company. Intangibles are listed net of accumulated amortization.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23098\n        /// </remarks>\n        [JsonProperty(\"23098\")]\n        public GoodwillAndOtherIntangibleAssetsBalanceSheet GoodwillAndOtherIntangibleAssets => _goodwillAndOtherIntangibleAssets ??= new(_timeProvider, _securityIdentifier);\n        private GoodwillAndOtherIntangibleAssetsBalanceSheet _goodwillAndOtherIntangibleAssets;\n\n        /// <summary>\n        /// Represents the sum of all loans (commercial, consumer, mortgage, etc.) as well as leases before any provisions for loan losses or unearned discounts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23099\n        /// </remarks>\n        [JsonProperty(\"23099\")]\n        public GrossLoanBalanceSheet GrossLoan => _grossLoan ??= new(_timeProvider, _securityIdentifier);\n        private GrossLoanBalanceSheet _grossLoan;\n\n        /// <summary>\n        /// Carrying amount at the balance sheet date for long-lived physical assets used in the normal conduct of business and not intended for resale. This can include land, physical structures, machinery, vehicles, furniture, computer equipment, construction in progress, and similar items. Amount does not include depreciation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23100\n        /// </remarks>\n        [JsonProperty(\"23100\")]\n        public GrossPPEBalanceSheet GrossPPE => _grossPPE ??= new(_timeProvider, _securityIdentifier);\n        private GrossPPEBalanceSheet _grossPPE;\n\n        /// <summary>\n        /// Debt securities that a firm has the ability and intent to hold until maturity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23102\n        /// </remarks>\n        [JsonProperty(\"23102\")]\n        public HeldToMaturitySecuritiesBalanceSheet HeldToMaturitySecurities => _heldToMaturitySecurities ??= new(_timeProvider, _securityIdentifier);\n        private HeldToMaturitySecuritiesBalanceSheet _heldToMaturitySecurities;\n\n        /// <summary>\n        /// A current liability account which reflects the amount of income taxes currently due to the federal, state, and local governments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23103\n        /// </remarks>\n        [JsonProperty(\"23103\")]\n        public IncomeTaxPayableBalanceSheet IncomeTaxPayable => _incomeTaxPayable ??= new(_timeProvider, _securityIdentifier);\n        private IncomeTaxPayableBalanceSheet _incomeTaxPayable;\n\n        /// <summary>\n        /// The aggregate of all domestic and foreign deposits in the bank that earns interests.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23105\n        /// </remarks>\n        [JsonProperty(\"23105\")]\n        public InterestBearingDepositsLiabilitiesBalanceSheet InterestBearingDepositsLiabilities => _interestBearingDepositsLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private InterestBearingDepositsLiabilitiesBalanceSheet _interestBearingDepositsLiabilities;\n\n        /// <summary>\n        /// Sum of the carrying values as of the balance sheet date of interest payable on all forms of debt, including trade payable that has been incurred.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23106\n        /// </remarks>\n        [JsonProperty(\"23106\")]\n        public InterestPayableBalanceSheet InterestPayable => _interestPayable ??= new(_timeProvider, _securityIdentifier);\n        private InterestPayableBalanceSheet _interestPayable;\n\n        /// <summary>\n        /// Deposit of money with a financial institution, in consideration of which the financial institution pays or credits interest, or amounts in the nature of interest.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23107\n        /// </remarks>\n        [JsonProperty(\"23107\")]\n        public InterestBearingDepositsAssetsBalanceSheet InterestBearingDepositsAssets => _interestBearingDepositsAssets ??= new(_timeProvider, _securityIdentifier);\n        private InterestBearingDepositsAssetsBalanceSheet _interestBearingDepositsAssets;\n\n        /// <summary>\n        /// A company's merchandise, raw materials, and finished and unfinished products which have not yet been sold.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23108\n        /// </remarks>\n        [JsonProperty(\"23108\")]\n        public InventoryBalanceSheet Inventory => _inventory ??= new(_timeProvider, _securityIdentifier);\n        private InventoryBalanceSheet _inventory;\n\n        /// <summary>\n        /// All investments in affiliates, real estate, securities, etc. Non-current investment, not including marketable securities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23111\n        /// </remarks>\n        [JsonProperty(\"23111\")]\n        public InvestmentsAndAdvancesBalanceSheet InvestmentsAndAdvances => _investmentsAndAdvances ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentsAndAdvancesBalanceSheet _investmentsAndAdvances;\n\n        /// <summary>\n        /// In a limited partnership or master limited partnership form of business, this represents the balance of capital held by the limited partners.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23118\n        /// </remarks>\n        [JsonProperty(\"23118\")]\n        public LimitedPartnershipCapitalBalanceSheet LimitedPartnershipCapital => _limitedPartnershipCapital ??= new(_timeProvider, _securityIdentifier);\n        private LimitedPartnershipCapitalBalanceSheet _limitedPartnershipCapital;\n\n        /// <summary>\n        /// Sum of the carrying values as of the balance sheet date of all long-term debt, which is debt initially having maturities due after one year or beyond the operating cycle, if longer, but excluding the portions thereof scheduled to be repaid within one year or the normal operating cycle, if longer. Long-term debt includes notes payable, bonds payable, mortgage loans, convertible debt, subordinated debt and other types of long term debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23123\n        /// </remarks>\n        [JsonProperty(\"23123\")]\n        public LongTermDebtBalanceSheet LongTermDebt => _longTermDebt ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtBalanceSheet _longTermDebt;\n\n        /// <summary>\n        /// All borrowings lasting over one year including long-term debt and long-term portion of capital lease obligations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23124\n        /// </remarks>\n        [JsonProperty(\"23124\")]\n        public LongTermDebtAndCapitalLeaseObligationBalanceSheet LongTermDebtAndCapitalLeaseObligation => _longTermDebtAndCapitalLeaseObligation ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtAndCapitalLeaseObligationBalanceSheet _longTermDebtAndCapitalLeaseObligation;\n\n        /// <summary>\n        /// Often referred to simply as \"investments\". Long-term investments are to be held for many years and are not intended to be disposed in the near future. This group usually consists of four types of investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23126\n        /// </remarks>\n        [JsonProperty(\"23126\")]\n        public LongTermInvestmentsBalanceSheet LongTermInvestments => _longTermInvestments ??= new(_timeProvider, _securityIdentifier);\n        private LongTermInvestmentsBalanceSheet _longTermInvestments;\n\n        /// <summary>\n        /// Represents the total liability for long-term leases lasting over one year. Amount equal to the present value (the principal) at the beginning of the lease term less lease payments during the lease term.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23127\n        /// </remarks>\n        [JsonProperty(\"23127\")]\n        public LongTermCapitalLeaseObligationBalanceSheet LongTermCapitalLeaseObligation => _longTermCapitalLeaseObligation ??= new(_timeProvider, _securityIdentifier);\n        private LongTermCapitalLeaseObligationBalanceSheet _longTermCapitalLeaseObligation;\n\n        /// <summary>\n        /// Carrying amount of the equity interests owned by non-controlling shareholders, partners, or other equity holders in one or more of the entities included in the reporting entity's consolidated financial statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23132\n        /// </remarks>\n        [JsonProperty(\"23132\")]\n        public MinorityInterestBalanceSheet MinorityInterest => _minorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private MinorityInterestBalanceSheet _minorityInterest;\n\n        /// <summary>\n        /// Short-term (typical maturity is less than one year), highly liquid government or corporate debt instrument such as bankers' acceptance, promissory notes, and treasury bills.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23133\n        /// </remarks>\n        [JsonProperty(\"23133\")]\n        public MoneyMarketInvestmentsBalanceSheet MoneyMarketInvestments => _moneyMarketInvestments ??= new(_timeProvider, _securityIdentifier);\n        private MoneyMarketInvestmentsBalanceSheet _moneyMarketInvestments;\n\n        /// <summary>\n        /// Represents the value of all loans after deduction of the appropriate allowances for loan and lease losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23137\n        /// </remarks>\n        [JsonProperty(\"23137\")]\n        public NetLoanBalanceSheet NetLoan => _netLoan ??= new(_timeProvider, _securityIdentifier);\n        private NetLoanBalanceSheet _netLoan;\n\n        /// <summary>\n        /// Tangible assets that are held by an entity for use in the production or supply of goods and services, for rental to others, or for administrative purposes and that are expected to provide economic benefit for more than one year; net of accumulated depreciation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23139\n        /// </remarks>\n        [JsonProperty(\"23139\")]\n        public NetPPEBalanceSheet NetPPE => _netPPE ??= new(_timeProvider, _securityIdentifier);\n        private NetPPEBalanceSheet _netPPE;\n\n        /// <summary>\n        /// The aggregate amount of all domestic and foreign deposits in the banks that do not draw interest.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23142\n        /// </remarks>\n        [JsonProperty(\"23142\")]\n        public NonInterestBearingDepositsBalanceSheet NonInterestBearingDeposits => _nonInterestBearingDeposits ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestBearingDepositsBalanceSheet _nonInterestBearingDeposits;\n\n        /// <summary>\n        /// Written promises to pay a stated sum at one or more specified dates in the future, within the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23143\n        /// </remarks>\n        [JsonProperty(\"23143\")]\n        public CurrentNotesPayableBalanceSheet CurrentNotesPayable => _currentNotesPayable ??= new(_timeProvider, _securityIdentifier);\n        private CurrentNotesPayableBalanceSheet _currentNotesPayable;\n\n        /// <summary>\n        /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s) within one year of the balance sheet date or the normal operating cycle, whichever is longer. Such amount may include accrued interest receivable in accordance with the terms of the note. The note also may contain provisions including a discount or premium, payable on demand, secured, or unsecured, interest bearing or non-interest bearing, among a myriad of other features and characteristics.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23144\n        /// </remarks>\n        [JsonProperty(\"23144\")]\n        public NotesReceivableBalanceSheet NotesReceivable => _notesReceivable ??= new(_timeProvider, _securityIdentifier);\n        private NotesReceivableBalanceSheet _notesReceivable;\n\n        /// <summary>\n        /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s), excluding the portion that is expected to be received within one year of the balance sheet date or the normal operating cycle, whichever is longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23146\n        /// </remarks>\n        [JsonProperty(\"23146\")]\n        public NonCurrentNoteReceivablesBalanceSheet NonCurrentNoteReceivables => _nonCurrentNoteReceivables ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentNoteReceivablesBalanceSheet _nonCurrentNoteReceivables;\n\n        /// <summary>\n        /// Other current liabilities = Total current liabilities - Payables and accrued Expenses - Current debt and capital lease obligation - provisions, current - deferred liabilities, current.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23151\n        /// </remarks>\n        [JsonProperty(\"23151\")]\n        public OtherCurrentLiabilitiesBalanceSheet OtherCurrentLiabilities => _otherCurrentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private OtherCurrentLiabilitiesBalanceSheet _otherCurrentLiabilities;\n\n        /// <summary>\n        /// Sum of the carrying amounts of all intangible assets, excluding goodwill.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23155\n        /// </remarks>\n        [JsonProperty(\"23155\")]\n        public OtherIntangibleAssetsBalanceSheet OtherIntangibleAssets => _otherIntangibleAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherIntangibleAssetsBalanceSheet _otherIntangibleAssets;\n\n        /// <summary>\n        /// The aggregate amount of short term investments, which will be expired within one year that are not specifically classified as Available-for-Sale, Held-to-Maturity, nor Trading investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23163\n        /// </remarks>\n        [JsonProperty(\"23163\")]\n        public OtherShortTermInvestmentsBalanceSheet OtherShortTermInvestments => _otherShortTermInvestments ??= new(_timeProvider, _securityIdentifier);\n        private OtherShortTermInvestmentsBalanceSheet _otherShortTermInvestments;\n\n        /// <summary>\n        /// The sum of all payables owed and expected to be paid within one year or one operating cycle, including accounts payables, taxes payable, dividends payable and all other current payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23165\n        /// </remarks>\n        [JsonProperty(\"23165\")]\n        public PayablesBalanceSheet Payables => _payables ??= new(_timeProvider, _securityIdentifier);\n        private PayablesBalanceSheet _payables;\n\n        /// <summary>\n        /// This balance sheet account includes all current payables and accrued expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23166\n        /// </remarks>\n        [JsonProperty(\"23166\")]\n        public PayablesAndAccruedExpensesBalanceSheet PayablesAndAccruedExpenses => _payablesAndAccruedExpenses ??= new(_timeProvider, _securityIdentifier);\n        private PayablesAndAccruedExpensesBalanceSheet _payablesAndAccruedExpenses;\n\n        /// <summary>\n        /// Accounting policy pertaining to an insurance entity's net liability for future benefits (for example, death, cash surrender value) to be paid to or on behalf of policyholders, describing the bases, methodologies and components of the reserve, and assumptions regarding estimates of expected investment yields, mortality, morbidity, terminations and expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23169\n        /// </remarks>\n        [JsonProperty(\"23169\")]\n        public PolicyReservesBenefitsBalanceSheet PolicyReservesBenefits => _policyReservesBenefits ??= new(_timeProvider, _securityIdentifier);\n        private PolicyReservesBenefitsBalanceSheet _policyReservesBenefits;\n\n        /// <summary>\n        /// The total liability as of the balance sheet date of amounts due to policy holders, excluding future policy benefits and claims, including unpaid policy dividends, retrospective refunds, and undistributed earnings on participating business.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23171\n        /// </remarks>\n        [JsonProperty(\"23171\")]\n        public PolicyholderFundsBalanceSheet PolicyholderFunds => _policyholderFunds ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderFundsBalanceSheet _policyholderFunds;\n\n        /// <summary>\n        /// Preferred securities that that firm treats as a liability. It includes convertible preferred stock or redeemable preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23172\n        /// </remarks>\n        [JsonProperty(\"23172\")]\n        public PreferredSecuritiesOutsideStockEquityBalanceSheet PreferredSecuritiesOutsideStockEquity => _preferredSecuritiesOutsideStockEquity ??= new(_timeProvider, _securityIdentifier);\n        private PreferredSecuritiesOutsideStockEquityBalanceSheet _preferredSecuritiesOutsideStockEquity;\n\n        /// <summary>\n        /// Preferred stock (all issues) at par value, as reported within the Stockholder's Equity section of the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23174\n        /// </remarks>\n        [JsonProperty(\"23174\")]\n        public PreferredStockBalanceSheet PreferredStock => _preferredStock ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockBalanceSheet _preferredStock;\n\n        /// <summary>\n        /// Sum of the carrying amounts that are paid in advance for expenses, which will be charged against earnings in subsequent periods.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23179\n        /// </remarks>\n        [JsonProperty(\"23179\")]\n        public PrepaidAssetsBalanceSheet PrepaidAssets => _prepaidAssets ??= new(_timeProvider, _securityIdentifier);\n        private PrepaidAssetsBalanceSheet _prepaidAssets;\n\n        /// <summary>\n        /// Sum of the carrying amounts that are paid in advance for expenses, which will be charged against earnings in periods after one year or beyond the operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23180\n        /// </remarks>\n        [JsonProperty(\"23180\")]\n        public NonCurrentPrepaidAssetsBalanceSheet NonCurrentPrepaidAssets => _nonCurrentPrepaidAssets ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentPrepaidAssetsBalanceSheet _nonCurrentPrepaidAssets;\n\n        /// <summary>\n        /// The sum of all receivables owed by customers and affiliates within one year, including accounts receivable, notes receivable, premiums receivable, and other current receivables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23189\n        /// </remarks>\n        [JsonProperty(\"23189\")]\n        public ReceivablesBalanceSheet Receivables => _receivables ??= new(_timeProvider, _securityIdentifier);\n        private ReceivablesBalanceSheet _receivables;\n\n        /// <summary>\n        /// The amount of benefits the ceding insurer expects to recover on insurance policies ceded to other insurance entities as of the balance sheet date for all guaranteed benefit types. It includes estimated amounts for claims incurred but not reported, and policy benefits, net of any related valuation allowance.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23196\n        /// </remarks>\n        [JsonProperty(\"23196\")]\n        public ReinsuranceRecoverableBalanceSheet ReinsuranceRecoverable => _reinsuranceRecoverable ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceRecoverableBalanceSheet _reinsuranceRecoverable;\n\n        /// <summary>\n        /// The cumulative net income of the company from the date of its inception (or reorganization) to the date of the financial statement less the cumulative distributions to shareholders either directly (dividends) or indirectly (treasury stock).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23204\n        /// </remarks>\n        [JsonProperty(\"23204\")]\n        public RetainedEarningsBalanceSheet RetainedEarnings => _retainedEarnings ??= new(_timeProvider, _securityIdentifier);\n        private RetainedEarningsBalanceSheet _retainedEarnings;\n\n        /// <summary>\n        /// The carrying value as of the balance sheet date of the liabilities collateral securities loaned to other broker-dealers. Borrowers of securities generally are required to provide collateral to the lenders of securities, commonly cash but sometimes other securities or standby letters of credit, with a value slightly higher than that of the securities borrowed.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23205\n        /// </remarks>\n        [JsonProperty(\"23205\")]\n        public SecuritiesLendingCollateralBalanceSheet SecuritiesLendingCollateral => _securitiesLendingCollateral ??= new(_timeProvider, _securityIdentifier);\n        private SecuritiesLendingCollateralBalanceSheet _securitiesLendingCollateral;\n\n        /// <summary>\n        /// The carrying value of funds outstanding loaned in the form of security resale agreements if the agreement requires the purchaser to resell the identical security purchased or a security that meets the definition of \"substantially the same\" in the case of a dollar roll. Also includes purchases of participations in pools of securities that are subject to a resale agreement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23207\n        /// </remarks>\n        [JsonProperty(\"23207\")]\n        public SecurityAgreeToBeResellBalanceSheet SecurityAgreeToBeResell => _securityAgreeToBeResell ??= new(_timeProvider, _securityIdentifier);\n        private SecurityAgreeToBeResellBalanceSheet _securityAgreeToBeResell;\n\n        /// <summary>\n        /// Represent obligations of the company to deliver the specified security at the contracted price and, thereby, create a liability to purchase the security in the market at prevailing prices.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23208\n        /// </remarks>\n        [JsonProperty(\"23208\")]\n        public SecuritySoldNotYetRepurchasedBalanceSheet SecuritySoldNotYetRepurchased => _securitySoldNotYetRepurchased ??= new(_timeProvider, _securityIdentifier);\n        private SecuritySoldNotYetRepurchasedBalanceSheet _securitySoldNotYetRepurchased;\n\n        /// <summary>\n        /// The fair value of the assets held by the company for the benefit of separate account policyholders.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23209\n        /// </remarks>\n        [JsonProperty(\"23209\")]\n        public SeparateAccountAssetsBalanceSheet SeparateAccountAssets => _separateAccountAssets ??= new(_timeProvider, _securityIdentifier);\n        private SeparateAccountAssetsBalanceSheet _separateAccountAssets;\n\n        /// <summary>\n        /// Refers to revenue that is generated that is not part of typical operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23210\n        /// </remarks>\n        [JsonProperty(\"23210\")]\n        public SeparateAccountBusinessBalanceSheet SeparateAccountBusiness => _separateAccountBusiness ??= new(_timeProvider, _securityIdentifier);\n        private SeparateAccountBusinessBalanceSheet _separateAccountBusiness;\n\n        /// <summary>\n        /// The current assets section of a company's balance sheet that contains the investments that a company holds with the purpose for trading.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23212\n        /// </remarks>\n        [JsonProperty(\"23212\")]\n        public ShortTermInvestmentsAvailableForSaleBalanceSheet ShortTermInvestmentsAvailableForSale => _shortTermInvestmentsAvailableForSale ??= new(_timeProvider, _securityIdentifier);\n        private ShortTermInvestmentsAvailableForSaleBalanceSheet _shortTermInvestmentsAvailableForSale;\n\n        /// <summary>\n        /// The current assets section of a company's balance sheet that contains the investments that a company has made that will expire at a fixed date within one year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23213\n        /// </remarks>\n        [JsonProperty(\"23213\")]\n        public ShortTermInvestmentsHeldToMaturityBalanceSheet ShortTermInvestmentsHeldToMaturity => _shortTermInvestmentsHeldToMaturity ??= new(_timeProvider, _securityIdentifier);\n        private ShortTermInvestmentsHeldToMaturityBalanceSheet _shortTermInvestmentsHeldToMaturity;\n\n        /// <summary>\n        /// The current assets section of a company's balance sheet that contains the investments that a company can trade at any moment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23214\n        /// </remarks>\n        [JsonProperty(\"23214\")]\n        public ShortTermInvestmentsTradingBalanceSheet ShortTermInvestmentsTrading => _shortTermInvestmentsTrading ??= new(_timeProvider, _securityIdentifier);\n        private ShortTermInvestmentsTradingBalanceSheet _shortTermInvestmentsTrading;\n\n        /// <summary>\n        /// The residual interest in the assets of the enterprise that remains after deducting its liabilities. Equity is increased by owners' investments and by comprehensive income, and it is reduced by distributions to the owners.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23215\n        /// </remarks>\n        [JsonProperty(\"23215\")]\n        public StockholdersEquityBalanceSheet StockholdersEquity => _stockholdersEquity ??= new(_timeProvider, _securityIdentifier);\n        private StockholdersEquityBalanceSheet _stockholdersEquity;\n\n        /// <summary>\n        /// A liability that reflects the taxes owed to federal, state, and local tax authorities. It is the carrying value as of the balance sheet date of obligations incurred and payable for statutory income, sales, use, payroll, excise, real, property and other taxes.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23217\n        /// </remarks>\n        [JsonProperty(\"23217\")]\n        public TotalTaxPayableBalanceSheet TotalTaxPayable => _totalTaxPayable ??= new(_timeProvider, _securityIdentifier);\n        private TotalTaxPayableBalanceSheet _totalTaxPayable;\n\n        /// <summary>\n        /// The aggregate amount of probable future economic benefits obtained or controlled by a particular enterprise as a result of past transactions or events.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23220\n        /// </remarks>\n        [JsonProperty(\"23220\")]\n        public TotalAssetsBalanceSheet TotalAssets => _totalAssets ??= new(_timeProvider, _securityIdentifier);\n        private TotalAssetsBalanceSheet _totalAssets;\n\n        /// <summary>\n        /// A liability account which represents the total amount of funds deposited.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23223\n        /// </remarks>\n        [JsonProperty(\"23223\")]\n        public TotalDepositsBalanceSheet TotalDeposits => _totalDeposits ??= new(_timeProvider, _securityIdentifier);\n        private TotalDepositsBalanceSheet _totalDeposits;\n\n        /// <summary>\n        /// Asset that refers to the sum of all available for sale securities and other investments often reported on the balance sheet of insurance firms.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23224\n        /// </remarks>\n        [JsonProperty(\"23224\")]\n        public TotalInvestmentsBalanceSheet TotalInvestments => _totalInvestments ??= new(_timeProvider, _securityIdentifier);\n        private TotalInvestmentsBalanceSheet _totalInvestments;\n\n        /// <summary>\n        /// Sum of the carrying amounts as of the balance sheet date of all assets that are expected to be realized in cash, sold or consumed after one year or beyond the normal operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23226\n        /// </remarks>\n        [JsonProperty(\"23226\")]\n        public TotalNonCurrentAssetsBalanceSheet TotalNonCurrentAssets => _totalNonCurrentAssets ??= new(_timeProvider, _securityIdentifier);\n        private TotalNonCurrentAssetsBalanceSheet _totalNonCurrentAssets;\n\n        /// <summary>\n        /// Ownership interest of different classes of partners in the publicly listed limited partnership or master limited partnership. Partners include general, limited and preferred partners.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23228\n        /// </remarks>\n        [JsonProperty(\"23228\")]\n        public TotalPartnershipCapitalBalanceSheet TotalPartnershipCapital => _totalPartnershipCapital ??= new(_timeProvider, _securityIdentifier);\n        private TotalPartnershipCapitalBalanceSheet _totalPartnershipCapital;\n\n        /// <summary>\n        /// Trading account assets are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time). Unrealized holding gains and losses for trading securities are included in earnings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23229\n        /// </remarks>\n        [JsonProperty(\"23229\")]\n        public TradingAssetsBalanceSheet TradingAssets => _tradingAssets ??= new(_timeProvider, _securityIdentifier);\n        private TradingAssetsBalanceSheet _tradingAssets;\n\n        /// <summary>\n        /// The carrying amount of liabilities as of the balance sheet date that pertain to principal and customer trading transactions, or which may be incurred with the objective of generating a profit from short-term fluctuations in price as part of an entity's market-making, hedging and proprietary trading. Examples include short positions in securities, derivatives and commodities, obligations under repurchase agreements, and securities borrowed arrangements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23230\n        /// </remarks>\n        [JsonProperty(\"23230\")]\n        public TradingLiabilitiesBalanceSheet TradingLiabilities => _tradingLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private TradingLiabilitiesBalanceSheet _tradingLiabilities;\n\n        /// <summary>\n        /// The total of financial instruments that are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time) or for debt and equity securities formerly categorized as available-for-sale or held-to-maturity which the company held as of the date it opted to account for such securities at fair value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23231\n        /// </remarks>\n        [JsonProperty(\"23231\")]\n        public TradingSecuritiesBalanceSheet TradingSecurities => _tradingSecurities ??= new(_timeProvider, _securityIdentifier);\n        private TradingSecuritiesBalanceSheet _tradingSecurities;\n\n        /// <summary>\n        /// The portion of shares that a company keeps in their own treasury. Treasury stock may have come from a repurchase or buyback from shareholders; or it may have never been issued to the public in the first place. These shares don't pay dividends, have no voting rights, and are not included in shares outstanding calculations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23232\n        /// </remarks>\n        [JsonProperty(\"23232\")]\n        public TreasuryStockBalanceSheet TreasuryStock => _treasuryStock ??= new(_timeProvider, _securityIdentifier);\n        private TreasuryStockBalanceSheet _treasuryStock;\n\n        /// <summary>\n        /// Income received but not yet earned, it represents the unearned amount that is netted against the total loan.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23235\n        /// </remarks>\n        [JsonProperty(\"23235\")]\n        public UnearnedIncomeBalanceSheet UnearnedIncome => _unearnedIncome ??= new(_timeProvider, _securityIdentifier);\n        private UnearnedIncomeBalanceSheet _unearnedIncome;\n\n        /// <summary>\n        /// Carrying amount of premiums written on insurance contracts that have not been earned as of the balance sheet date.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23236\n        /// </remarks>\n        [JsonProperty(\"23236\")]\n        public UnearnedPremiumsBalanceSheet UnearnedPremiums => _unearnedPremiums ??= new(_timeProvider, _securityIdentifier);\n        private UnearnedPremiumsBalanceSheet _unearnedPremiums;\n\n        /// <summary>\n        /// Liability amount that reflects claims that are expected based upon statistical projections, but which have not been reported to the insurer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23237\n        /// </remarks>\n        [JsonProperty(\"23237\")]\n        public UnpaidLossAndLossReserveBalanceSheet UnpaidLossAndLossReserve => _unpaidLossAndLossReserve ??= new(_timeProvider, _securityIdentifier);\n        private UnpaidLossAndLossReserveBalanceSheet _unpaidLossAndLossReserve;\n\n        /// <summary>\n        /// Invested capital = common shareholders' equity + long term debt + current debt\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23245\n        /// </remarks>\n        [JsonProperty(\"23245\")]\n        public InvestedCapitalBalanceSheet InvestedCapital => _investedCapital ??= new(_timeProvider, _securityIdentifier);\n        private InvestedCapitalBalanceSheet _investedCapital;\n\n        /// <summary>\n        /// Payments that will be assigned as expenses with one accounting period, but that are paid in advance and temporarily set up as current assets on the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23252\n        /// </remarks>\n        [JsonProperty(\"23252\")]\n        public CurrentDeferredAssetsBalanceSheet CurrentDeferredAssets => _currentDeferredAssets ??= new(_timeProvider, _securityIdentifier);\n        private CurrentDeferredAssetsBalanceSheet _currentDeferredAssets;\n\n        /// <summary>\n        /// Payments that will be assigned as expenses longer than one accounting period, but that are paid in advance and temporarily set up as non-current assets on the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23253\n        /// </remarks>\n        [JsonProperty(\"23253\")]\n        public NonCurrentDeferredAssetsBalanceSheet NonCurrentDeferredAssets => _nonCurrentDeferredAssets ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentDeferredAssetsBalanceSheet _nonCurrentDeferredAssets;\n\n        /// <summary>\n        /// Asset, often applicable to Banks, which refers to the aggregate amount of all securities and investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23258\n        /// </remarks>\n        [JsonProperty(\"23258\")]\n        public SecuritiesAndInvestmentsBalanceSheet SecuritiesAndInvestments => _securitiesAndInvestments ??= new(_timeProvider, _securityIdentifier);\n        private SecuritiesAndInvestmentsBalanceSheet _securitiesAndInvestments;\n\n        /// <summary>\n        /// Probable future sacrifices of economic benefits arising from present obligations of an enterprise to transfer assets or provide services to others in the future as a result of past transactions or events, excluding minority interest.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23259\n        /// </remarks>\n        [JsonProperty(\"23259\")]\n        public TotalLiabilitiesNetMinorityInterestBalanceSheet TotalLiabilitiesNetMinorityInterest => _totalLiabilitiesNetMinorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private TotalLiabilitiesNetMinorityInterestBalanceSheet _totalLiabilitiesNetMinorityInterest;\n\n        /// <summary>\n        /// Total obligations, net minority interest, incurred as part of normal operations that is expected to be repaid beyond the following twelve months or one business cycle; excludes minority interest.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23260\n        /// </remarks>\n        [JsonProperty(\"23260\")]\n        public TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet TotalNonCurrentLiabilitiesNetMinorityInterest => _totalNonCurrentLiabilitiesNetMinorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet _totalNonCurrentLiabilitiesNetMinorityInterest;\n\n        /// <summary>\n        /// Residual interest, including minority interest, that remains in the assets of the enterprise after deducting its liabilities. Equity is increased by owners' investments and by comprehensive income, and it is reduced by distributions to the owners.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23261\n        /// </remarks>\n        [JsonProperty(\"23261\")]\n        public TotalEquityGrossMinorityInterestBalanceSheet TotalEquityGrossMinorityInterest => _totalEquityGrossMinorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private TotalEquityGrossMinorityInterestBalanceSheet _totalEquityGrossMinorityInterest;\n\n        /// <summary>\n        /// Accounts owed to a company by customers within a year as a result of exchanging goods or services on credit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23262\n        /// </remarks>\n        [JsonProperty(\"23262\")]\n        public GrossAccountsReceivableBalanceSheet GrossAccountsReceivable => _grossAccountsReceivable ??= new(_timeProvider, _securityIdentifier);\n        private GrossAccountsReceivableBalanceSheet _grossAccountsReceivable;\n\n        /// <summary>\n        /// Accounts receivable represents sums owed to the business that the business records as revenue. Gross accounts receivable is accounts receivable before the business deducts uncollectable accounts to calculate the true value of accounts receivable.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23263\n        /// </remarks>\n        [JsonProperty(\"23263\")]\n        public NonCurrentAccountsReceivableBalanceSheet NonCurrentAccountsReceivable => _nonCurrentAccountsReceivable ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentAccountsReceivableBalanceSheet _nonCurrentAccountsReceivable;\n\n        /// <summary>\n        /// This account shows the amount of unpaid interest accrued to the date of purchase and included in the purchase price of securities purchased between interest dates.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23264\n        /// </remarks>\n        [JsonProperty(\"23264\")]\n        public AccruedInterestReceivableBalanceSheet AccruedInterestReceivable => _accruedInterestReceivable ??= new(_timeProvider, _securityIdentifier);\n        private AccruedInterestReceivableBalanceSheet _accruedInterestReceivable;\n\n        /// <summary>\n        /// This item is typically available for bank industry. It's the amount of borrowings as of the balance sheet date from the Federal Home Loan Bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23265\n        /// </remarks>\n        [JsonProperty(\"23265\")]\n        public AdvanceFromFederalHomeLoanBanksBalanceSheet AdvanceFromFederalHomeLoanBanks => _advanceFromFederalHomeLoanBanks ??= new(_timeProvider, _securityIdentifier);\n        private AdvanceFromFederalHomeLoanBanksBalanceSheet _advanceFromFederalHomeLoanBanks;\n\n        /// <summary>\n        /// An Allowance for Doubtful Accounts measures receivables recorded but not expected to be collected.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23266\n        /// </remarks>\n        [JsonProperty(\"23266\")]\n        public AllowanceForDoubtfulAccountsReceivableBalanceSheet AllowanceForDoubtfulAccountsReceivable => _allowanceForDoubtfulAccountsReceivable ??= new(_timeProvider, _securityIdentifier);\n        private AllowanceForDoubtfulAccountsReceivableBalanceSheet _allowanceForDoubtfulAccountsReceivable;\n\n        /// <summary>\n        /// This item is typically available for bank industry. It represents a provision relating to a written agreement to receive money with the terms of the note (at a specified future date(s) within one year from the reporting date (or the normal operating cycle, whichever is longer), consisting of principal as well as any accrued interest) for the portion that is expected to be uncollectible.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23267\n        /// </remarks>\n        [JsonProperty(\"23267\")]\n        public AllowanceForNotesReceivableBalanceSheet AllowanceForNotesReceivable => _allowanceForNotesReceivable ??= new(_timeProvider, _securityIdentifier);\n        private AllowanceForNotesReceivableBalanceSheet _allowanceForNotesReceivable;\n\n        /// <summary>\n        /// This item is typically available for bank industry. It's a part of long-lived assets, which has been decided for sale in the future.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23268\n        /// </remarks>\n        [JsonProperty(\"23268\")]\n        public AssetsHeldForSaleBalanceSheet AssetsHeldForSale => _assetsHeldForSale ??= new(_timeProvider, _securityIdentifier);\n        private AssetsHeldForSaleBalanceSheet _assetsHeldForSale;\n\n        /// <summary>\n        /// A portion of a company's business that has been disposed of or sold.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23269\n        /// </remarks>\n        [JsonProperty(\"23269\")]\n        public AssetsOfDiscontinuedOperationsBalanceSheet AssetsOfDiscontinuedOperations => _assetsOfDiscontinuedOperations ??= new(_timeProvider, _securityIdentifier);\n        private AssetsOfDiscontinuedOperationsBalanceSheet _assetsOfDiscontinuedOperations;\n\n        /// <summary>\n        /// All indebtedness for borrowed money or the deferred purchase price of property or services, including without limitation reimbursement and other obligations with respect to surety bonds and letters of credit, all obligations evidenced by notes, bonds debentures or similar instruments, all capital lease obligations and all contingent obligations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23271\n        /// </remarks>\n        [JsonProperty(\"23271\")]\n        public BankIndebtednessBalanceSheet BankIndebtedness => _bankIndebtedness ??= new(_timeProvider, _securityIdentifier);\n        private BankIndebtednessBalanceSheet _bankIndebtedness;\n\n        /// <summary>\n        /// The carrying amount of a life insurance policy on an officer, executive or employee for which the reporting entity (a bank) is entitled to proceeds from the policy upon death of the insured or surrender of the insurance policy.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23273\n        /// </remarks>\n        [JsonProperty(\"23273\")]\n        public BankOwnedLifeInsuranceBalanceSheet BankOwnedLifeInsurance => _bankOwnedLifeInsurance ??= new(_timeProvider, _securityIdentifier);\n        private BankOwnedLifeInsuranceBalanceSheet _bankOwnedLifeInsurance;\n\n        /// <summary>\n        /// The securities borrowed or on loan, which is the temporary loan of securities by a lender to a borrower in exchange for cash. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23274\n        /// </remarks>\n        [JsonProperty(\"23274\")]\n        public SecurityBorrowedBalanceSheet SecurityBorrowed => _securityBorrowed ??= new(_timeProvider, _securityIdentifier);\n        private SecurityBorrowedBalanceSheet _securityBorrowed;\n\n        /// <summary>\n        /// Fixed assets that specifically deal with the facilities a company owns. Include the improvements associated with buildings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23275\n        /// </remarks>\n        [JsonProperty(\"23275\")]\n        public BuildingsAndImprovementsBalanceSheet BuildingsAndImprovements => _buildingsAndImprovements ??= new(_timeProvider, _securityIdentifier);\n        private BuildingsAndImprovementsBalanceSheet _buildingsAndImprovements;\n\n        /// <summary>\n        /// Short-term loan, typically 90 days, used by a company to finance seasonal working capital needs.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23278\n        /// </remarks>\n        [JsonProperty(\"23278\")]\n        public CommercialLoanBalanceSheet CommercialLoan => _commercialLoan ??= new(_timeProvider, _securityIdentifier);\n        private CommercialLoanBalanceSheet _commercialLoan;\n\n        /// <summary>\n        /// Commercial paper is a money-market security issued by large banks and corporations. It represents the current obligation for the company. There are four basic kinds of commercial paper: promissory notes, drafts, checks, and certificates of deposit. The maturities of these money market securities generally do not exceed 270 days.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23279\n        /// </remarks>\n        [JsonProperty(\"23279\")]\n        public CommercialPaperBalanceSheet CommercialPaper => _commercialPaper ??= new(_timeProvider, _securityIdentifier);\n        private CommercialPaperBalanceSheet _commercialPaper;\n\n        /// <summary>\n        /// The portion of the Stockholders' Equity that reflects the amount of common stock, which are units of ownership.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23280\n        /// </remarks>\n        [JsonProperty(\"23280\")]\n        public CommonStockEquityBalanceSheet CommonStockEquity => _commonStockEquity ??= new(_timeProvider, _securityIdentifier);\n        private CommonStockEquityBalanceSheet _commonStockEquity;\n\n        /// <summary>\n        /// It represents carrying amount of long-lived asset under construction that includes construction costs to date on capital projects. Assets constructed, but not completed.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23282\n        /// </remarks>\n        [JsonProperty(\"23282\")]\n        public ConstructionInProgressBalanceSheet ConstructionInProgress => _constructionInProgress ??= new(_timeProvider, _securityIdentifier);\n        private ConstructionInProgressBalanceSheet _constructionInProgress;\n\n        /// <summary>\n        /// A loan that establishes consumer credit that is granted for personal use; usually unsecured and based on the borrower's integrity and ability to pay.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23283\n        /// </remarks>\n        [JsonProperty(\"23283\")]\n        public ConsumerLoanBalanceSheet ConsumerLoan => _consumerLoan ??= new(_timeProvider, _securityIdentifier);\n        private ConsumerLoanBalanceSheet _consumerLoan;\n\n        /// <summary>\n        /// The company's minimum pension obligations to its former employees, paid into a defined pension plan to satisfy all pension entitlements that have been earned by employees to date.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23284\n        /// </remarks>\n        [JsonProperty(\"23284\")]\n        public MinimumPensionLiabilitiesBalanceSheet MinimumPensionLiabilities => _minimumPensionLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private MinimumPensionLiabilitiesBalanceSheet _minimumPensionLiabilities;\n\n        /// <summary>\n        /// Amounts receivable from customers on short-term negotiable time drafts drawn on and accepted by the institution (also known as banker's acceptance transactions) that are outstanding on the reporting date.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23285\n        /// </remarks>\n        [JsonProperty(\"23285\")]\n        public CustomerAcceptancesBalanceSheet CustomerAcceptances => _customerAcceptances ??= new(_timeProvider, _securityIdentifier);\n        private CustomerAcceptancesBalanceSheet _customerAcceptances;\n\n        /// <summary>\n        /// The recognition of an asset where pension fund assets exceed promised benefits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23288\n        /// </remarks>\n        [JsonProperty(\"23288\")]\n        public DefinedPensionBenefitBalanceSheet DefinedPensionBenefit => _definedPensionBenefit ??= new(_timeProvider, _securityIdentifier);\n        private DefinedPensionBenefitBalanceSheet _definedPensionBenefit;\n\n        /// <summary>\n        /// Fair values of all liabilities resulting from contracts that meet the criteria of being accounted for as derivative instruments; and which are expected to be extinguished or otherwise disposed of after one year or beyond the normal operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23289\n        /// </remarks>\n        [JsonProperty(\"23289\")]\n        public DerivativeProductLiabilitiesBalanceSheet DerivativeProductLiabilities => _derivativeProductLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private DerivativeProductLiabilitiesBalanceSheet _derivativeProductLiabilities;\n\n        /// <summary>\n        /// Fair values of assets resulting from contracts that meet the criteria of being accounted for as derivative instruments, net of the effects of master netting arrangements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23290\n        /// </remarks>\n        [JsonProperty(\"23290\")]\n        public DerivativeAssetsBalanceSheet DerivativeAssets => _derivativeAssets ??= new(_timeProvider, _securityIdentifier);\n        private DerivativeAssetsBalanceSheet _derivativeAssets;\n\n        /// <summary>\n        /// Sum of the carrying values of dividends declared but unpaid on equity securities issued and outstanding (also includes dividends collected on behalf of another owner of securities that are being held by entity) by the entity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23291\n        /// </remarks>\n        [JsonProperty(\"23291\")]\n        public DividendsPayableBalanceSheet DividendsPayable => _dividendsPayable ??= new(_timeProvider, _securityIdentifier);\n        private DividendsPayableBalanceSheet _dividendsPayable;\n\n        /// <summary>\n        /// Carrying amount as of the balance sheet date of the portion of the obligations recognized for the various benefits provided to former or inactive employees, their beneficiaries, and covered dependents after employment but before retirement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23293\n        /// </remarks>\n        [JsonProperty(\"23293\")]\n        public EmployeeBenefitsBalanceSheet EmployeeBenefits => _employeeBenefits ??= new(_timeProvider, _securityIdentifier);\n        private EmployeeBenefitsBalanceSheet _employeeBenefits;\n\n        /// <summary>\n        /// The amount borrowed by a bank, at the federal funds rate, from another bank to meet its reserve requirements. This item is typically available for the bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23295\n        /// </remarks>\n        [JsonProperty(\"23295\")]\n        public FederalFundsPurchasedBalanceSheet FederalFundsPurchased => _federalFundsPurchased ??= new(_timeProvider, _securityIdentifier);\n        private FederalFundsPurchasedBalanceSheet _federalFundsPurchased;\n\n        /// <summary>\n        /// Federal funds transactions involve lending (federal funds sold) or borrowing (federal funds purchased) of immediately available reserve balances. This item is typically available for the bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23296\n        /// </remarks>\n        [JsonProperty(\"23296\")]\n        public FederalFundsSoldBalanceSheet FederalFundsSold => _federalFundsSold ??= new(_timeProvider, _securityIdentifier);\n        private FederalFundsSoldBalanceSheet _federalFundsSold;\n\n        /// <summary>\n        /// Federal Home Loan Bank stock represents an equity interest in a FHLB. It does not have a readily determinable fair value because its ownership is restricted and it lacks a market (liquidity). This item is typically available for the bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23297\n        /// </remarks>\n        [JsonProperty(\"23297\")]\n        public FederalHomeLoanBankStockBalanceSheet FederalHomeLoanBankStock => _federalHomeLoanBankStock ??= new(_timeProvider, _securityIdentifier);\n        private FederalHomeLoanBankStockBalanceSheet _federalHomeLoanBankStock;\n\n        /// <summary>\n        /// Fair values as of the balance sheet date of all assets resulting from contracts that meet the criteria of being accounted for as derivative instruments, net of the effects of master netting arrangements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23298\n        /// </remarks>\n        [JsonProperty(\"23298\")]\n        public FinancialAssetsBalanceSheet FinancialAssets => _financialAssets ??= new(_timeProvider, _securityIdentifier);\n        private FinancialAssetsBalanceSheet _financialAssets;\n\n        /// <summary>\n        /// The carrying value as of the balance sheet date of securities that an institution sells and agrees to repurchase (the identical or substantially the same securities) as a seller-borrower at a specified date for a specified price, also known as a repurchase agreement. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23299\n        /// </remarks>\n        [JsonProperty(\"23299\")]\n        public FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet FinancialInstrumentsSoldUnderAgreementsToRepurchase => _financialInstrumentsSoldUnderAgreementsToRepurchase ??= new(_timeProvider, _securityIdentifier);\n        private FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet _financialInstrumentsSoldUnderAgreementsToRepurchase;\n\n        /// <summary>\n        /// The carrying amount as of the balance sheet date of merchandise or goods held by the company that are readily available for sale. This item is typically available for mining and manufacturing industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23300\n        /// </remarks>\n        [JsonProperty(\"23300\")]\n        public FinishedGoodsBalanceSheet FinishedGoods => _finishedGoods ??= new(_timeProvider, _securityIdentifier);\n        private FinishedGoodsBalanceSheet _finishedGoods;\n\n        /// <summary>\n        /// It is one of the important fixed assets for transportation industry, which includes bicycles, cars, motorcycles, trains, ships, boats, and aircraft. This item is typically available for transportation industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23301\n        /// </remarks>\n        [JsonProperty(\"23301\")]\n        public FlightFleetVehicleAndRelatedEquipmentsBalanceSheet FlightFleetVehicleAndRelatedEquipments => _flightFleetVehicleAndRelatedEquipments ??= new(_timeProvider, _securityIdentifier);\n        private FlightFleetVehicleAndRelatedEquipmentsBalanceSheet _flightFleetVehicleAndRelatedEquipments;\n\n        /// <summary>\n        /// The carrying amount as of the balance sheet date of all assets obtained in full or partial satisfaction of a debt arrangement through foreclosure proceedings or defeasance; includes real and personal property; equity interests in corporations, partnerships, and joint ventures; and beneficial interest in trusts. This item is typically typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23302\n        /// </remarks>\n        [JsonProperty(\"23302\")]\n        public ForeclosedAssetsBalanceSheet ForeclosedAssets => _foreclosedAssets ??= new(_timeProvider, _securityIdentifier);\n        private ForeclosedAssetsBalanceSheet _foreclosedAssets;\n\n        /// <summary>\n        /// Changes to accumulated comprehensive income that results from the process of translating subsidiary financial statements and foreign equity investments into functional currency of the reporting company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23304\n        /// </remarks>\n        [JsonProperty(\"23304\")]\n        public ForeignCurrencyTranslationAdjustmentsBalanceSheet ForeignCurrencyTranslationAdjustments => _foreignCurrencyTranslationAdjustments ??= new(_timeProvider, _securityIdentifier);\n        private ForeignCurrencyTranslationAdjustmentsBalanceSheet _foreignCurrencyTranslationAdjustments;\n\n        /// <summary>\n        /// This item represents certain charges made in the current period in inventory resulting from such factors as breakage, spoilage, employee theft and shoplifting. This item is typically available for manufacturing, mining and utility industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23307\n        /// </remarks>\n        [JsonProperty(\"23307\")]\n        public InventoriesAdjustmentsAllowancesBalanceSheet InventoriesAdjustmentsAllowances => _inventoriesAdjustmentsAllowances ??= new(_timeProvider, _securityIdentifier);\n        private InventoriesAdjustmentsAllowancesBalanceSheet _inventoriesAdjustmentsAllowances;\n\n        /// <summary>\n        /// This item represents the carrying amount on the company's balance sheet of its investments in common stock of an equity method. This item is typically available for the insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23310\n        /// </remarks>\n        [JsonProperty(\"23310\")]\n        public InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet InvestmentsInOtherVenturesUnderEquityMethod => _investmentsInOtherVenturesUnderEquityMethod ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet _investmentsInOtherVenturesUnderEquityMethod;\n\n        /// <summary>\n        /// Fixed Assets that specifically deal with land a company owns. Includes the improvements associated with land. This excludes land held for sale.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23312\n        /// </remarks>\n        [JsonProperty(\"23312\")]\n        public LandAndImprovementsBalanceSheet LandAndImprovements => _landAndImprovements ??= new(_timeProvider, _securityIdentifier);\n        private LandAndImprovementsBalanceSheet _landAndImprovements;\n\n        /// <summary>\n        /// Carrying amount at the balance sheet date of a long-lived, depreciable asset that is an addition or improvement to assets held under lease arrangement. This item is usually not available for the insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23313\n        /// </remarks>\n        [JsonProperty(\"23313\")]\n        public LeasesBalanceSheet Leases => _leases ??= new(_timeProvider, _securityIdentifier);\n        private LeasesBalanceSheet _leases;\n\n        /// <summary>\n        /// The obligations arising from the sale, disposal, or planned sale in the near future (generally within one year) of a disposal group, including a component of the entity (discontinued operation). This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23314\n        /// </remarks>\n        [JsonProperty(\"23314\")]\n        public LiabilitiesOfDiscontinuedOperationsBalanceSheet LiabilitiesOfDiscontinuedOperations => _liabilitiesOfDiscontinuedOperations ??= new(_timeProvider, _securityIdentifier);\n        private LiabilitiesOfDiscontinuedOperationsBalanceSheet _liabilitiesOfDiscontinuedOperations;\n\n        /// <summary>\n        /// The carrying value as of the balance sheet date of obligations drawn from a line of credit, which is a bank's commitment to make loans up to a specific amount.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23316\n        /// </remarks>\n        [JsonProperty(\"23316\")]\n        public LineOfCreditBalanceSheet LineOfCredit => _lineOfCredit ??= new(_timeProvider, _securityIdentifier);\n        private LineOfCreditBalanceSheet _lineOfCredit;\n\n        /// <summary>\n        /// It means the aggregate amount of loans receivable that will be sold to other entities. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23317\n        /// </remarks>\n        [JsonProperty(\"23317\")]\n        public LoansHeldForSaleBalanceSheet LoansHeldForSale => _loansHeldForSale ??= new(_timeProvider, _securityIdentifier);\n        private LoansHeldForSaleBalanceSheet _loansHeldForSale;\n\n        /// <summary>\n        /// Reflects the carrying amount of unpaid loans issued to other institutions for cash needs or an asset purchase.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23318\n        /// </remarks>\n        [JsonProperty(\"23318\")]\n        public LoansReceivableBalanceSheet LoansReceivable => _loansReceivable ??= new(_timeProvider, _securityIdentifier);\n        private LoansReceivableBalanceSheet _loansReceivable;\n\n        /// <summary>\n        /// Fixed assets specifically dealing with tools, equipment and office furniture. This item is usually not available for the insurance and utility industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23319\n        /// </remarks>\n        [JsonProperty(\"23319\")]\n        public MachineryFurnitureEquipmentBalanceSheet MachineryFurnitureEquipment => _machineryFurnitureEquipment ??= new(_timeProvider, _securityIdentifier);\n        private MachineryFurnitureEquipmentBalanceSheet _machineryFurnitureEquipment;\n\n        /// <summary>\n        /// Aggregated amount of unprocessed materials to be used in manufacturing or production process and supplies that will be consumed. This item is typically available for the utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23320\n        /// </remarks>\n        [JsonProperty(\"23320\")]\n        public MaterialsAndSuppliesBalanceSheet MaterialsAndSupplies => _materialsAndSupplies ??= new(_timeProvider, _securityIdentifier);\n        private MaterialsAndSuppliesBalanceSheet _materialsAndSupplies;\n\n        /// <summary>\n        /// A fixed asset that represents strictly mineral type properties. This item is typically available for mining industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23321\n        /// </remarks>\n        [JsonProperty(\"23321\")]\n        public MineralPropertiesBalanceSheet MineralProperties => _mineralProperties ??= new(_timeProvider, _securityIdentifier);\n        private MineralPropertiesBalanceSheet _mineralProperties;\n\n        /// <summary>\n        /// This is a lien on real estate to protect a lender. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23322\n        /// </remarks>\n        [JsonProperty(\"23322\")]\n        public MortgageLoanBalanceSheet MortgageLoan => _mortgageLoan ??= new(_timeProvider, _securityIdentifier);\n        private MortgageLoanBalanceSheet _mortgageLoan;\n\n        /// <summary>\n        /// It means the aggregate amount of mortgage and consumer loans. This item is typically available for the insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23323\n        /// </remarks>\n        [JsonProperty(\"23323\")]\n        public MortgageAndConsumerloansBalanceSheet MortgageAndConsumerloans => _mortgageAndConsumerloans ??= new(_timeProvider, _securityIdentifier);\n        private MortgageAndConsumerloansBalanceSheet _mortgageAndConsumerloans;\n\n        /// <summary>\n        /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s) within one year of the balance sheet date or the normal operating cycle. Such amount may include accrued interest receivable in accordance with the terms of the note. The note also may contain provisions including a discount or premium, payable on demand, secured, or unsecured, interest bearing or non-interest bearing, among myriad other features and characteristics. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23328\n        /// </remarks>\n        [JsonProperty(\"23328\")]\n        public GrossNotesReceivableBalanceSheet GrossNotesReceivable => _grossNotesReceivable ??= new(_timeProvider, _securityIdentifier);\n        private GrossNotesReceivableBalanceSheet _grossNotesReceivable;\n\n        /// <summary>\n        /// Other non-current assets that are not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23329\n        /// </remarks>\n        [JsonProperty(\"23329\")]\n        public OtherAssetsBalanceSheet OtherAssets => _otherAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherAssetsBalanceSheet _otherAssets;\n\n        /// <summary>\n        /// Other Capital Stock that is not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23330\n        /// </remarks>\n        [JsonProperty(\"23330\")]\n        public OtherCapitalStockBalanceSheet OtherCapitalStock => _otherCapitalStock ??= new(_timeProvider, _securityIdentifier);\n        private OtherCapitalStockBalanceSheet _otherCapitalStock;\n\n        /// <summary>\n        /// Other current assets that are not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23331\n        /// </remarks>\n        [JsonProperty(\"23331\")]\n        public OtherCurrentAssetsBalanceSheet OtherCurrentAssets => _otherCurrentAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherCurrentAssetsBalanceSheet _otherCurrentAssets;\n\n        /// <summary>\n        /// Short Term Borrowings that are not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23332\n        /// </remarks>\n        [JsonProperty(\"23332\")]\n        public OtherCurrentBorrowingsBalanceSheet OtherCurrentBorrowings => _otherCurrentBorrowings ??= new(_timeProvider, _securityIdentifier);\n        private OtherCurrentBorrowingsBalanceSheet _otherCurrentBorrowings;\n\n        /// <summary>\n        /// Other adjustments to stockholders' equity that is not otherwise classified, including other reserves.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23335\n        /// </remarks>\n        [JsonProperty(\"23335\")]\n        public OtherEquityAdjustmentsBalanceSheet OtherEquityAdjustments => _otherEquityAdjustments ??= new(_timeProvider, _securityIdentifier);\n        private OtherEquityAdjustmentsBalanceSheet _otherEquityAdjustments;\n\n        /// <summary>\n        /// Other non-current inventories not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23337\n        /// </remarks>\n        [JsonProperty(\"23337\")]\n        public OtherInventoriesBalanceSheet OtherInventories => _otherInventories ??= new(_timeProvider, _securityIdentifier);\n        private OtherInventoriesBalanceSheet _otherInventories;\n\n        /// <summary>\n        /// An item represents all the other investments or/and securities that cannot be defined into any category above. This item is typically available for the insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23338\n        /// </remarks>\n        [JsonProperty(\"23338\")]\n        public OtherInvestedAssetsBalanceSheet OtherInvestedAssets => _otherInvestedAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherInvestedAssetsBalanceSheet _otherInvestedAssets;\n\n        /// <summary>\n        /// Other non-current assets that are not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23339\n        /// </remarks>\n        [JsonProperty(\"23339\")]\n        public OtherNonCurrentAssetsBalanceSheet OtherNonCurrentAssets => _otherNonCurrentAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonCurrentAssetsBalanceSheet _otherNonCurrentAssets;\n\n        /// <summary>\n        /// Other fixed assets not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23340\n        /// </remarks>\n        [JsonProperty(\"23340\")]\n        public OtherPropertiesBalanceSheet OtherProperties => _otherProperties ??= new(_timeProvider, _securityIdentifier);\n        private OtherPropertiesBalanceSheet _otherProperties;\n\n        /// <summary>\n        /// The Carrying amount as of the balance sheet date of other real estate, which may include real estate investments, real estate loans that qualify as investments in real estate, and premises that are no longer used in operations may also be included in real estate owned. This does not include real estate assets taken in settlement of troubled loans through surrender or foreclosure. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23341\n        /// </remarks>\n        [JsonProperty(\"23341\")]\n        public OtherRealEstateOwnedBalanceSheet OtherRealEstateOwned => _otherRealEstateOwned ??= new(_timeProvider, _securityIdentifier);\n        private OtherRealEstateOwnedBalanceSheet _otherRealEstateOwned;\n\n        /// <summary>\n        /// Other non-current receivables not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23342\n        /// </remarks>\n        [JsonProperty(\"23342\")]\n        public OtherReceivablesBalanceSheet OtherReceivables => _otherReceivables ??= new(_timeProvider, _securityIdentifier);\n        private OtherReceivablesBalanceSheet _otherReceivables;\n\n        /// <summary>\n        /// A loan issued by an insurance company that uses the cash value of a person's life insurance policy as collateral. This item is usually only available in the insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23344\n        /// </remarks>\n        [JsonProperty(\"23344\")]\n        public NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet NonCurrentPensionAndOtherPostretirementBenefitPlans => _nonCurrentPensionAndOtherPostretirementBenefitPlans ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet _nonCurrentPensionAndOtherPostretirementBenefitPlans;\n\n        /// <summary>\n        /// A loan issued by an insurance company that uses the cash value of a person's life insurance policy as collateral. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23345\n        /// </remarks>\n        [JsonProperty(\"23345\")]\n        public PolicyLoansBalanceSheet PolicyLoans => _policyLoans ??= new(_timeProvider, _securityIdentifier);\n        private PolicyLoansBalanceSheet _policyLoans;\n\n        /// <summary>\n        /// A class of ownership in a company that has a higher claim on the assets and earnings than common stock. Preferred stock generally has a dividend that must be paid out before dividends to common stockholders and the shares usually do not have voting rights.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23347\n        /// </remarks>\n        [JsonProperty(\"23347\")]\n        public PreferredStockEquityBalanceSheet PreferredStockEquity => _preferredStockEquity ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockEquityBalanceSheet _preferredStockEquity;\n\n        /// <summary>\n        /// Tangible assets that are held by an entity for use in the production or supply of goods and services, for rental to others, or for administrative purposes and that are expected to provide economic benefit for more than one year. This item is available for manufacturing, bank and transportation industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23351\n        /// </remarks>\n        [JsonProperty(\"23351\")]\n        public PropertiesBalanceSheet Properties => _properties ??= new(_timeProvider, _securityIdentifier);\n        private PropertiesBalanceSheet _properties;\n\n        /// <summary>\n        /// Provisions are created to protect the interests of one or both parties named in a contract or legal document which is a preparatory action or measure. Current provision is expired within one accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23352\n        /// </remarks>\n        [JsonProperty(\"23352\")]\n        public CurrentProvisionsBalanceSheet CurrentProvisions => _currentProvisions ??= new(_timeProvider, _securityIdentifier);\n        private CurrentProvisionsBalanceSheet _currentProvisions;\n\n        /// <summary>\n        /// Provisions are created to protect the interests of one or both parties named in a contract or legal document which is a preparatory action or measure. Long-term provision is expired beyond one accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23353\n        /// </remarks>\n        [JsonProperty(\"23353\")]\n        public LongTermProvisionsBalanceSheet LongTermProvisions => _longTermProvisions ??= new(_timeProvider, _securityIdentifier);\n        private LongTermProvisionsBalanceSheet _longTermProvisions;\n\n        /// <summary>\n        /// Carrying amount as of the balance sheet data of unprocessed items to be consumed in the manufacturing or production process. This item is available for manufacturing and mining industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23355\n        /// </remarks>\n        [JsonProperty(\"23355\")]\n        public RawMaterialsBalanceSheet RawMaterials => _rawMaterials ??= new(_timeProvider, _securityIdentifier);\n        private RawMaterialsBalanceSheet _rawMaterials;\n\n        /// <summary>\n        /// A provision relating to a written agreement to receive money at a specified future date(s) (within one year from the reporting date or the normal operating cycle, whichever is longer), consisting of principal as well as any accrued interest).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23358\n        /// </remarks>\n        [JsonProperty(\"23358\")]\n        public ReceivablesAdjustmentsAllowancesBalanceSheet ReceivablesAdjustmentsAllowances => _receivablesAdjustmentsAllowances ??= new(_timeProvider, _securityIdentifier);\n        private ReceivablesAdjustmentsAllowancesBalanceSheet _receivablesAdjustmentsAllowances;\n\n        /// <summary>\n        /// Carrying amount as of the balance sheet date of capitalized costs of regulated entities that are expected to be recovered through revenue sources over one year or beyond the normal operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23359\n        /// </remarks>\n        [JsonProperty(\"23359\")]\n        public RegulatoryAssetsBalanceSheet RegulatoryAssets => _regulatoryAssets ??= new(_timeProvider, _securityIdentifier);\n        private RegulatoryAssetsBalanceSheet _regulatoryAssets;\n\n        /// <summary>\n        /// The amount for the individual regulatory noncurrent liability as itemized in a table of regulatory noncurrent liabilities as of the end of the period. Such things as the costs of energy efficiency programs and low-income energy assistances programs and deferred fuel. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23360\n        /// </remarks>\n        [JsonProperty(\"23360\")]\n        public RegulatoryLiabilitiesBalanceSheet RegulatoryLiabilities => _regulatoryLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private RegulatoryLiabilitiesBalanceSheet _regulatoryLiabilities;\n\n        /// <summary>\n        /// The carrying amount as of the balance sheet date of the known and estimated amounts owed to insurers under reinsurance treaties or other arrangements. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23361\n        /// </remarks>\n        [JsonProperty(\"23361\")]\n        public ReinsuranceBalancesPayableBalanceSheet ReinsuranceBalancesPayable => _reinsuranceBalancesPayable ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceBalancesPayableBalanceSheet _reinsuranceBalancesPayable;\n\n        /// <summary>\n        /// The carrying amounts of cash and cash equivalent items, which are restricted as to withdrawal or usage. Restrictions may include legally restricted deposits held as compensating balances against short-term borrowing arrangements, contracts entered into with others, or entity statements of intention with regard to particular deposits; however, time deposits and short-term certificates of deposit are not generally included in legally restricted deposits. Excludes compensating balance arrangements that are not agreements, which legally restrict the use of cash amounts shown on the balance sheet. For a classified balance sheet, represents the current portion only (the non-current portion has a separate concept); for an unclassified balance sheet represents the entire amount. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23365\n        /// </remarks>\n        [JsonProperty(\"23365\")]\n        public RestrictedCashBalanceSheet RestrictedCash => _restrictedCash ??= new(_timeProvider, _securityIdentifier);\n        private RestrictedCashBalanceSheet _restrictedCash;\n\n        /// <summary>\n        /// The carrying amounts of cash and cash equivalent items which are restricted as to withdrawal or usage. This item is available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23366\n        /// </remarks>\n        [JsonProperty(\"23366\")]\n        public RestrictedCashAndCashEquivalentsBalanceSheet RestrictedCashAndCashEquivalents => _restrictedCashAndCashEquivalents ??= new(_timeProvider, _securityIdentifier);\n        private RestrictedCashAndCashEquivalentsBalanceSheet _restrictedCashAndCashEquivalents;\n\n        /// <summary>\n        /// The cash and investments whose use in whole or in part is restricted for the long-term, generally by contractual agreements or regulatory requirements. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23367\n        /// </remarks>\n        [JsonProperty(\"23367\")]\n        public RestrictedCashAndInvestmentsBalanceSheet RestrictedCashAndInvestments => _restrictedCashAndInvestments ??= new(_timeProvider, _securityIdentifier);\n        private RestrictedCashAndInvestmentsBalanceSheet _restrictedCashAndInvestments;\n\n        /// <summary>\n        /// Shares of stock for which sale is contractually or governmentally restricted for a given period of time. Stock that is acquired through an employee stock option plan or other private means may not be transferred. Restricted stock must be traded in compliance with special SEC regulations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23368\n        /// </remarks>\n        [JsonProperty(\"23368\")]\n        public RestrictedCommonStockBalanceSheet RestrictedCommonStock => _restrictedCommonStock ??= new(_timeProvider, _securityIdentifier);\n        private RestrictedCommonStockBalanceSheet _restrictedCommonStock;\n\n        /// <summary>\n        /// Investments whose use is restricted in whole or in part, generally by contractual agreements or regulatory requirements. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23369\n        /// </remarks>\n        [JsonProperty(\"23369\")]\n        public RestrictedInvestmentsBalanceSheet RestrictedInvestments => _restrictedInvestments ??= new(_timeProvider, _securityIdentifier);\n        private RestrictedInvestmentsBalanceSheet _restrictedInvestments;\n\n        /// <summary>\n        /// Carrying amount due within one year of the balance sheet date (or one operating cycle, if longer) from tax authorities as of the balance sheet date representing refunds of overpayments or recoveries based on agreed-upon resolutions of disputes. This item is usually not available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23372\n        /// </remarks>\n        [JsonProperty(\"23372\")]\n        public TaxesReceivableBalanceSheet TaxesReceivable => _taxesReceivable ??= new(_timeProvider, _securityIdentifier);\n        private TaxesReceivableBalanceSheet _taxesReceivable;\n\n        /// <summary>\n        /// Stockholder's Equity plus Long Term Debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23374\n        /// </remarks>\n        [JsonProperty(\"23374\")]\n        public TotalCapitalizationBalanceSheet TotalCapitalization => _totalCapitalization ??= new(_timeProvider, _securityIdentifier);\n        private TotalCapitalizationBalanceSheet _totalCapitalization;\n\n        /// <summary>\n        /// Revenue received by a firm but not yet reported as income. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23375\n        /// </remarks>\n        [JsonProperty(\"23375\")]\n        public TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet TotalDeferredCreditsAndOtherNonCurrentLiabilities => _totalDeferredCreditsAndOtherNonCurrentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet _totalDeferredCreditsAndOtherNonCurrentLiabilities;\n\n        /// <summary>\n        /// Revenues that are not currently billed from the customer under the terms of the contract. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23376\n        /// </remarks>\n        [JsonProperty(\"23376\")]\n        public UnbilledReceivablesBalanceSheet UnbilledReceivables => _unbilledReceivables ??= new(_timeProvider, _securityIdentifier);\n        private UnbilledReceivablesBalanceSheet _unbilledReceivables;\n\n        /// <summary>\n        /// A profit or loss that results from holding onto an asset rather than cashing it in and officially taking the profit or loss.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23377\n        /// </remarks>\n        [JsonProperty(\"23377\")]\n        public UnrealizedGainLossBalanceSheet UnrealizedGainLoss => _unrealizedGainLoss ??= new(_timeProvider, _securityIdentifier);\n        private UnrealizedGainLossBalanceSheet _unrealizedGainLoss;\n\n        /// <summary>\n        /// Work, or goods, in the process of being fabricated or manufactured but not yet completed as finished goods. This item is usually available for manufacturing and mining industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23378\n        /// </remarks>\n        [JsonProperty(\"23378\")]\n        public WorkInProcessBalanceSheet WorkInProcess => _workInProcess ??= new(_timeProvider, _securityIdentifier);\n        private WorkInProcessBalanceSheet _workInProcess;\n\n        /// <summary>\n        /// This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23379\n        /// </remarks>\n        [JsonProperty(\"23379\")]\n        public OtherNonCurrentLiabilitiesBalanceSheet OtherNonCurrentLiabilities => _otherNonCurrentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonCurrentLiabilitiesBalanceSheet _otherNonCurrentLiabilities;\n\n        /// <summary>\n        /// Current Portion of Capital Lease Obligation plus Long Term Portion of Capital Lease Obligation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23380\n        /// </remarks>\n        [JsonProperty(\"23380\")]\n        public CapitalLeaseObligationsBalanceSheet CapitalLeaseObligations => _capitalLeaseObligations ??= new(_timeProvider, _securityIdentifier);\n        private CapitalLeaseObligationsBalanceSheet _capitalLeaseObligations;\n\n        /// <summary>\n        /// This item is available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23381\n        /// </remarks>\n        [JsonProperty(\"23381\")]\n        public OtherLiabilitiesBalanceSheet OtherLiabilities => _otherLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private OtherLiabilitiesBalanceSheet _otherLiabilities;\n\n        /// <summary>\n        /// Payables and Accrued Expenses that are not defined as Trade, Tax or Dividends related.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23382\n        /// </remarks>\n        [JsonProperty(\"23382\")]\n        public OtherPayableBalanceSheet OtherPayable => _otherPayable ??= new(_timeProvider, _securityIdentifier);\n        private OtherPayableBalanceSheet _otherPayable;\n\n        /// <summary>\n        /// The company's total book value less the value of any intangible assets. Methodology: Common Stock Equity minus Goodwill and Other Intangible Assets\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23383\n        /// </remarks>\n        [JsonProperty(\"23383\")]\n        public TangibleBookValueBalanceSheet TangibleBookValue => _tangibleBookValue ??= new(_timeProvider, _securityIdentifier);\n        private TangibleBookValueBalanceSheet _tangibleBookValue;\n\n        /// <summary>\n        /// Total Equity equals Preferred Stock Equity + Common Stock Equity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23384\n        /// </remarks>\n        [JsonProperty(\"23384\")]\n        public TotalEquityBalanceSheet TotalEquity => _totalEquity ??= new(_timeProvider, _securityIdentifier);\n        private TotalEquityBalanceSheet _totalEquity;\n\n        /// <summary>\n        /// Current Assets minus Current Liabilities. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23385\n        /// </remarks>\n        [JsonProperty(\"23385\")]\n        public WorkingCapitalBalanceSheet WorkingCapital => _workingCapital ??= new(_timeProvider, _securityIdentifier);\n        private WorkingCapitalBalanceSheet _workingCapital;\n\n        /// <summary>\n        /// All borrowings incurred by the company including debt and capital lease obligations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23386\n        /// </remarks>\n        [JsonProperty(\"23386\")]\n        public TotalDebtBalanceSheet TotalDebt => _totalDebt ??= new(_timeProvider, _securityIdentifier);\n        private TotalDebtBalanceSheet _totalDebt;\n\n        /// <summary>\n        /// The amount for the other plant related to the utility industry fix assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23388\n        /// </remarks>\n        [JsonProperty(\"23388\")]\n        public CommonUtilityPlantBalanceSheet CommonUtilityPlant => _commonUtilityPlant ??= new(_timeProvider, _securityIdentifier);\n        private CommonUtilityPlantBalanceSheet _commonUtilityPlant;\n\n        /// <summary>\n        /// The amount for the electric plant related to the utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23389\n        /// </remarks>\n        [JsonProperty(\"23389\")]\n        public ElectricUtilityPlantBalanceSheet ElectricUtilityPlant => _electricUtilityPlant ??= new(_timeProvider, _securityIdentifier);\n        private ElectricUtilityPlantBalanceSheet _electricUtilityPlant;\n\n        /// <summary>\n        /// The amount for the natural gas, fuel and other items related to the utility industry, which might include oil and gas wells, the properties to exploit oil and gas or liquefied natural gas sites.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23390\n        /// </remarks>\n        [JsonProperty(\"23390\")]\n        public NaturalGasFuelAndOtherBalanceSheet NaturalGasFuelAndOther => _naturalGasFuelAndOther ??= new(_timeProvider, _securityIdentifier);\n        private NaturalGasFuelAndOtherBalanceSheet _naturalGasFuelAndOther;\n\n        /// <summary>\n        /// Net utility plant might include water production, electric utility plan, natural gas, fuel and other, common utility plant and accumulated depreciation. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23391\n        /// </remarks>\n        [JsonProperty(\"23391\")]\n        public NetUtilityPlantBalanceSheet NetUtilityPlant => _netUtilityPlant ??= new(_timeProvider, _securityIdentifier);\n        private NetUtilityPlantBalanceSheet _netUtilityPlant;\n\n        /// <summary>\n        /// The amount for a facility and plant that provides water which might include wells, reservoirs, pumping stations, and control facilities; and waste water systems which includes the waste treatment and disposal facility and equipment. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23392\n        /// </remarks>\n        [JsonProperty(\"23392\")]\n        public WaterProductionBalanceSheet WaterProduction => _waterProduction ??= new(_timeProvider, _securityIdentifier);\n        private WaterProductionBalanceSheet _waterProduction;\n\n        /// <summary>\n        /// Number of Common or Ordinary Shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23393\n        /// </remarks>\n        [JsonProperty(\"23393\")]\n        public OrdinarySharesNumberBalanceSheet OrdinarySharesNumber => _ordinarySharesNumber ??= new(_timeProvider, _securityIdentifier);\n        private OrdinarySharesNumberBalanceSheet _ordinarySharesNumber;\n\n        /// <summary>\n        /// Number of Preferred Shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23394\n        /// </remarks>\n        [JsonProperty(\"23394\")]\n        public PreferredSharesNumberBalanceSheet PreferredSharesNumber => _preferredSharesNumber ??= new(_timeProvider, _securityIdentifier);\n        private PreferredSharesNumberBalanceSheet _preferredSharesNumber;\n\n        /// <summary>\n        /// Number of Treasury Shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23395\n        /// </remarks>\n        [JsonProperty(\"23395\")]\n        public TreasurySharesNumberBalanceSheet TreasurySharesNumber => _treasurySharesNumber ??= new(_timeProvider, _securityIdentifier);\n        private TreasurySharesNumberBalanceSheet _treasurySharesNumber;\n\n        /// <summary>\n        /// This will serve as the \"parent\" value to AccountsReceivable (DataId 23001) and OtherReceivables (DataId 23342) for all company financials reported in the IFRS GAAP.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23399\n        /// </remarks>\n        [JsonProperty(\"23399\")]\n        public TradingAndOtherReceivableBalanceSheet TradingAndOtherReceivable => _tradingAndOtherReceivable ??= new(_timeProvider, _securityIdentifier);\n        private TradingAndOtherReceivableBalanceSheet _tradingAndOtherReceivable;\n\n        /// <summary>\n        /// <remarks> Morningstar DataId: 23400 </remarks>\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23400\n        /// </remarks>\n        [JsonProperty(\"23400\")]\n        public EquityAttributableToOwnersOfParentBalanceSheet EquityAttributableToOwnersOfParent => _equityAttributableToOwnersOfParent ??= new(_timeProvider, _securityIdentifier);\n        private EquityAttributableToOwnersOfParentBalanceSheet _equityAttributableToOwnersOfParent;\n\n        /// <summary>\n        /// The carrying value as of the balance sheet date of securities loaned to other broker dealers, typically used by such parties to cover short sales, secured by cash or other securities furnished by such parties until the borrowing is closed.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23401\n        /// </remarks>\n        [JsonProperty(\"23401\")]\n        public SecuritiesLoanedBalanceSheet SecuritiesLoaned => _securitiesLoaned ??= new(_timeProvider, _securityIdentifier);\n        private SecuritiesLoanedBalanceSheet _securitiesLoaned;\n\n        /// <summary>\n        /// Net assets in physical form. This is calculated using Stockholders' Equity less Intangible Assets (including Goodwill).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23403\n        /// </remarks>\n        [JsonProperty(\"23403\")]\n        public NetTangibleAssetsBalanceSheet NetTangibleAssets => _netTangibleAssets ??= new(_timeProvider, _securityIdentifier);\n        private NetTangibleAssetsBalanceSheet _netTangibleAssets;\n\n        /// <summary>\n        /// Amounts owed to the company from a non-arm's length entity, due within the company's current operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23404\n        /// </remarks>\n        [JsonProperty(\"23404\")]\n        public DuefromRelatedPartiesCurrentBalanceSheet DuefromRelatedPartiesCurrent => _duefromRelatedPartiesCurrent ??= new(_timeProvider, _securityIdentifier);\n        private DuefromRelatedPartiesCurrentBalanceSheet _duefromRelatedPartiesCurrent;\n\n        /// <summary>\n        /// Amounts owed to the company from a non-arm's length entity, due after the company's current operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23405\n        /// </remarks>\n        [JsonProperty(\"23405\")]\n        public DuefromRelatedPartiesNonCurrentBalanceSheet DuefromRelatedPartiesNonCurrent => _duefromRelatedPartiesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private DuefromRelatedPartiesNonCurrentBalanceSheet _duefromRelatedPartiesNonCurrent;\n\n        /// <summary>\n        /// Amounts owed by the company to a non-arm's length entity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23406\n        /// </remarks>\n        [JsonProperty(\"23406\")]\n        public DuetoRelatedPartiesBalanceSheet DuetoRelatedParties => _duetoRelatedParties ??= new(_timeProvider, _securityIdentifier);\n        private DuetoRelatedPartiesBalanceSheet _duetoRelatedParties;\n\n        /// <summary>\n        /// Amounts owed by the company to a non-arm's length entity that has to be repaid within the company's current operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23407\n        /// </remarks>\n        [JsonProperty(\"23407\")]\n        public DuetoRelatedPartiesCurrentBalanceSheet DuetoRelatedPartiesCurrent => _duetoRelatedPartiesCurrent ??= new(_timeProvider, _securityIdentifier);\n        private DuetoRelatedPartiesCurrentBalanceSheet _duetoRelatedPartiesCurrent;\n\n        /// <summary>\n        /// Amounts owed by the company to a non-arm's length entity that has to be repaid after the company's current operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23408\n        /// </remarks>\n        [JsonProperty(\"23408\")]\n        public DuetoRelatedPartiesNonCurrentBalanceSheet DuetoRelatedPartiesNonCurrent => _duetoRelatedPartiesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private DuetoRelatedPartiesNonCurrentBalanceSheet _duetoRelatedPartiesNonCurrent;\n\n        /// <summary>\n        /// Company's investments in properties net of accumulated depreciation, which generate a return.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23410\n        /// </remarks>\n        [JsonProperty(\"23410\")]\n        public InvestmentPropertiesBalanceSheet InvestmentProperties => _investmentProperties ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentPropertiesBalanceSheet _investmentProperties;\n\n        /// <summary>\n        /// A stake in any company which is more than 51%.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23411\n        /// </remarks>\n        [JsonProperty(\"23411\")]\n        public InvestmentsinSubsidiariesatCostBalanceSheet InvestmentsinSubsidiariesatCost => _investmentsinSubsidiariesatCost ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentsinSubsidiariesatCostBalanceSheet _investmentsinSubsidiariesatCost;\n\n        /// <summary>\n        /// A stake in any company which is more than 20% but less than 50%.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23412\n        /// </remarks>\n        [JsonProperty(\"23412\")]\n        public InvestmentsinAssociatesatCostBalanceSheet InvestmentsinAssociatesatCost => _investmentsinAssociatesatCost ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentsinAssociatesatCostBalanceSheet _investmentsinAssociatesatCost;\n\n        /// <summary>\n        /// A 50% stake in any company in which remaining 50% belongs to other company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23413\n        /// </remarks>\n        [JsonProperty(\"23413\")]\n        public InvestmentsinJointVenturesatCostBalanceSheet InvestmentsinJointVenturesatCost => _investmentsinJointVenturesatCost ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentsinJointVenturesatCostBalanceSheet _investmentsinJointVenturesatCost;\n\n        /// <summary>\n        /// Represents the sum of all financial investments (trading securities, available-for-sale securities, held-to-maturity securities, etc.)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23414\n        /// </remarks>\n        [JsonProperty(\"23414\")]\n        public InvestmentinFinancialAssetsBalanceSheet InvestmentinFinancialAssets => _investmentinFinancialAssets ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentinFinancialAssetsBalanceSheet _investmentinFinancialAssets;\n\n        /// <summary>\n        /// Accounts owed to the bank in relation to capital leases. Capital/ finance lease obligation are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23415\n        /// </remarks>\n        [JsonProperty(\"23415\")]\n        public FinanceLeaseReceivablesBalanceSheet FinanceLeaseReceivables => _financeLeaseReceivables ??= new(_timeProvider, _securityIdentifier);\n        private FinanceLeaseReceivablesBalanceSheet _financeLeaseReceivables;\n\n        /// <summary>\n        /// This represents loans that entitle the lender (or the holder of loan debenture) to convert the loan to common or preferred stock (ordinary or preference shares) within the next 12 months or operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23418\n        /// </remarks>\n        [JsonProperty(\"23418\")]\n        public ConvertibleLoansCurrentBalanceSheet ConvertibleLoansCurrent => _convertibleLoansCurrent ??= new(_timeProvider, _securityIdentifier);\n        private ConvertibleLoansCurrentBalanceSheet _convertibleLoansCurrent;\n\n        /// <summary>\n        /// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time within the next 12 months or operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23419\n        /// </remarks>\n        [JsonProperty(\"23419\")]\n        public BankLoansCurrentBalanceSheet BankLoansCurrent => _bankLoansCurrent ??= new(_timeProvider, _securityIdentifier);\n        private BankLoansCurrentBalanceSheet _bankLoansCurrent;\n\n        /// <summary>\n        /// Other loans between the customer and bank which cannot be identified by other specific items in the Debt section, due within the next 12 months or operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23420\n        /// </remarks>\n        [JsonProperty(\"23420\")]\n        public OtherLoansCurrentBalanceSheet OtherLoansCurrent => _otherLoansCurrent ??= new(_timeProvider, _securityIdentifier);\n        private OtherLoansCurrentBalanceSheet _otherLoansCurrent;\n\n        /// <summary>\n        /// Sum of accrued liabilities and deferred income (amount received in advance but the services are not provided in respect of amount).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23422\n        /// </remarks>\n        [JsonProperty(\"23422\")]\n        public AccruedandDeferredIncomeBalanceSheet AccruedandDeferredIncome => _accruedandDeferredIncome ??= new(_timeProvider, _securityIdentifier);\n        private AccruedandDeferredIncomeBalanceSheet _accruedandDeferredIncome;\n\n        /// <summary>\n        /// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time beyond the current accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23426\n        /// </remarks>\n        [JsonProperty(\"23426\")]\n        public BankLoansNonCurrentBalanceSheet BankLoansNonCurrent => _bankLoansNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private BankLoansNonCurrentBalanceSheet _bankLoansNonCurrent;\n\n        /// <summary>\n        /// Other loans between the customer and bank which cannot be identified by other specific items in the Debt section, due beyond the current operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23427\n        /// </remarks>\n        [JsonProperty(\"23427\")]\n        public OtherLoansNonCurrentBalanceSheet OtherLoansNonCurrent => _otherLoansNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private OtherLoansNonCurrentBalanceSheet _otherLoansNonCurrent;\n\n        /// <summary>\n        /// Other reserves owned by the company that cannot be identified by other specific items in the Reserves section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23430\n        /// </remarks>\n        [JsonProperty(\"23430\")]\n        public OtherReservesBalanceSheet OtherReserves => _otherReserves ??= new(_timeProvider, _securityIdentifier);\n        private OtherReservesBalanceSheet _otherReserves;\n\n        /// <summary>\n        /// The aggregate amount of loans and advances made to a bank or financial institution.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23432\n        /// </remarks>\n        [JsonProperty(\"23432\")]\n        public LoansandAdvancestoBankBalanceSheet LoansandAdvancestoBank => _loansandAdvancestoBank ??= new(_timeProvider, _securityIdentifier);\n        private LoansandAdvancestoBankBalanceSheet _loansandAdvancestoBank;\n\n        /// <summary>\n        /// The aggregate amount of loans and advances made to customers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23433\n        /// </remarks>\n        [JsonProperty(\"23433\")]\n        public LoansandAdvancestoCustomerBalanceSheet LoansandAdvancestoCustomer => _loansandAdvancestoCustomer ??= new(_timeProvider, _securityIdentifier);\n        private LoansandAdvancestoCustomerBalanceSheet _loansandAdvancestoCustomer;\n\n        /// <summary>\n        /// Investments backed by the central government, it usually carries less risk than other investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23434\n        /// </remarks>\n        [JsonProperty(\"23434\")]\n        public TreasuryBillsandOtherEligibleBillsBalanceSheet TreasuryBillsandOtherEligibleBills => _treasuryBillsandOtherEligibleBills ??= new(_timeProvider, _securityIdentifier);\n        private TreasuryBillsandOtherEligibleBillsBalanceSheet _treasuryBillsandOtherEligibleBills;\n\n        /// <summary>\n        /// Investments in shares of a company representing ownership in that company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23435\n        /// </remarks>\n        [JsonProperty(\"23435\")]\n        public EquitySharesInvestmentsBalanceSheet EquitySharesInvestments => _equitySharesInvestments ??= new(_timeProvider, _securityIdentifier);\n        private EquitySharesInvestmentsBalanceSheet _equitySharesInvestments;\n\n        /// <summary>\n        /// Banks investment in the ongoing entity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23436\n        /// </remarks>\n        [JsonProperty(\"23436\")]\n        public DepositsbyBankBalanceSheet DepositsbyBank => _depositsbyBank ??= new(_timeProvider, _securityIdentifier);\n        private DepositsbyBankBalanceSheet _depositsbyBank;\n\n        /// <summary>\n        /// Carrying value of amounts transferred by customers to third parties for security purposes that are expected to be returned or applied towards payment after one year or beyond the operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23437\n        /// </remarks>\n        [JsonProperty(\"23437\")]\n        public CustomerAccountsBalanceSheet CustomerAccounts => _customerAccounts ??= new(_timeProvider, _securityIdentifier);\n        private CustomerAccountsBalanceSheet _customerAccounts;\n\n        /// <summary>\n        /// Carrying amount as of the balance sheet date of drafts and bills of exchange that have been accepted by the reporting bank or by others for its own account, as its liability to holders of the drafts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23438\n        /// </remarks>\n        [JsonProperty(\"23438\")]\n        public ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet ItemsinTheCourseofTransmissiontoOtherBanks => _itemsinTheCourseofTransmissiontoOtherBanks ??= new(_timeProvider, _securityIdentifier);\n        private ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet _itemsinTheCourseofTransmissiontoOtherBanks;\n\n        /// <summary>\n        /// Total carrying amount of total trading, financial liabilities and debt in a non-differentiated balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23439\n        /// </remarks>\n        [JsonProperty(\"23439\")]\n        public TradingandFinancialLiabilitiesBalanceSheet TradingandFinancialLiabilities => _tradingandFinancialLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private TradingandFinancialLiabilitiesBalanceSheet _tradingandFinancialLiabilities;\n\n        /// <summary>\n        /// Any debt financial instrument issued instead of cash loan.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23440\n        /// </remarks>\n        [JsonProperty(\"23440\")]\n        public DebtSecuritiesinIssueBalanceSheet DebtSecuritiesinIssue => _debtSecuritiesinIssue ??= new(_timeProvider, _securityIdentifier);\n        private DebtSecuritiesinIssueBalanceSheet _debtSecuritiesinIssue;\n\n        /// <summary>\n        /// The total carrying value of securities loaned to other broker dealers, typically used by such parties to cover short sales, secured by cash or other securities furnished by such parties until the borrowing is closed; in a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23441\n        /// </remarks>\n        [JsonProperty(\"23441\")]\n        public SubordinatedLiabilitiesBalanceSheet SubordinatedLiabilities => _subordinatedLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private SubordinatedLiabilitiesBalanceSheet _subordinatedLiabilities;\n\n        /// <summary>\n        /// Provisions are created to protect the interests of one or both parties named in a contract or legal document, which is a preparatory action or measure. Current provision is expired within one accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23443\n        /// </remarks>\n        [JsonProperty(\"23443\")]\n        public ProvisionsTotalBalanceSheet ProvisionsTotal => _provisionsTotal ??= new(_timeProvider, _securityIdentifier);\n        private ProvisionsTotalBalanceSheet _provisionsTotal;\n\n        /// <summary>\n        /// A contract that allows for the use of an asset, but does not convey rights of ownership of the asset. An operating lease is not capitalized; it is accounted for as a rental expense in what is known as \"off balance sheet financing.\" For the lessor, the asset being leased is accounted for as an asset and is depreciated as such.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23444\n        /// </remarks>\n        [JsonProperty(\"23444\")]\n        public OperatingLeaseAssetsBalanceSheet OperatingLeaseAssets => _operatingLeaseAssets ??= new(_timeProvider, _securityIdentifier);\n        private OperatingLeaseAssetsBalanceSheet _operatingLeaseAssets;\n\n        /// <summary>\n        /// Amounts owing to policy holders who have filed claims but have not yet been settled or paid.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23445\n        /// </remarks>\n        [JsonProperty(\"23445\")]\n        public ClaimsOutstandingBalanceSheet ClaimsOutstanding => _claimsOutstanding ??= new(_timeProvider, _securityIdentifier);\n        private ClaimsOutstandingBalanceSheet _claimsOutstanding;\n\n        /// <summary>\n        /// Liabilities due within the next 12 months related from an asset classified as Held for Sale.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23452\n        /// </remarks>\n        [JsonProperty(\"23452\")]\n        public LiabilitiesHeldforSaleCurrentBalanceSheet LiabilitiesHeldforSaleCurrent => _liabilitiesHeldforSaleCurrent ??= new(_timeProvider, _securityIdentifier);\n        private LiabilitiesHeldforSaleCurrentBalanceSheet _liabilitiesHeldforSaleCurrent;\n\n        /// <summary>\n        /// Liabilities related to an asset classified as held for sale excluding the portion due the next 12 months or operating cycle.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23453\n        /// </remarks>\n        [JsonProperty(\"23453\")]\n        public LiabilitiesHeldforSaleNonCurrentBalanceSheet LiabilitiesHeldforSaleNonCurrent => _liabilitiesHeldforSaleNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private LiabilitiesHeldforSaleNonCurrentBalanceSheet _liabilitiesHeldforSaleNonCurrent;\n\n        /// <summary>\n        /// Debt securities held as investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23455\n        /// </remarks>\n        [JsonProperty(\"23455\")]\n        public DebtSecuritiesBalanceSheet DebtSecurities => _debtSecurities ??= new(_timeProvider, _securityIdentifier);\n        private DebtSecuritiesBalanceSheet _debtSecurities;\n\n        /// <summary>\n        /// Represents the total amount of long-term capital leases that must be paid within the next accounting period for a Non- Differentiated Balance Sheet. Capital lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23456\n        /// </remarks>\n        [JsonProperty(\"23456\")]\n        public TotalFinancialLeaseObligationsBalanceSheet TotalFinancialLeaseObligations => _totalFinancialLeaseObligations ??= new(_timeProvider, _securityIdentifier);\n        private TotalFinancialLeaseObligationsBalanceSheet _totalFinancialLeaseObligations;\n\n        /// <summary>\n        /// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due within 1 year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23457\n        /// </remarks>\n        [JsonProperty(\"23457\")]\n        public AccruedandDeferredIncomeCurrentBalanceSheet AccruedandDeferredIncomeCurrent => _accruedandDeferredIncomeCurrent ??= new(_timeProvider, _securityIdentifier);\n        private AccruedandDeferredIncomeCurrentBalanceSheet _accruedandDeferredIncomeCurrent;\n\n        /// <summary>\n        /// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due after 1 year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23458\n        /// </remarks>\n        [JsonProperty(\"23458\")]\n        public AccruedandDeferredIncomeNonCurrentBalanceSheet AccruedandDeferredIncomeNonCurrent => _accruedandDeferredIncomeNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private AccruedandDeferredIncomeNonCurrentBalanceSheet _accruedandDeferredIncomeNonCurrent;\n\n        /// <summary>\n        /// Accounts owed to the bank in relation to capital leases to be received within the next accounting period. Capital/ finance lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23459\n        /// </remarks>\n        [JsonProperty(\"23459\")]\n        public FinanceLeaseReceivablesCurrentBalanceSheet FinanceLeaseReceivablesCurrent => _financeLeaseReceivablesCurrent ??= new(_timeProvider, _securityIdentifier);\n        private FinanceLeaseReceivablesCurrentBalanceSheet _financeLeaseReceivablesCurrent;\n\n        /// <summary>\n        /// Accounts owed to the bank in relation to capital leases to be received beyond the next accounting period. Capital/ finance lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23460\n        /// </remarks>\n        [JsonProperty(\"23460\")]\n        public FinanceLeaseReceivablesNonCurrentBalanceSheet FinanceLeaseReceivablesNonCurrent => _financeLeaseReceivablesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private FinanceLeaseReceivablesNonCurrentBalanceSheet _financeLeaseReceivablesNonCurrent;\n\n        /// <summary>\n        /// Financial related liabilities due within one year, including short term and current portions of long-term debt, capital leases and derivative liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23462\n        /// </remarks>\n        [JsonProperty(\"23462\")]\n        public FinancialLiabilitiesCurrentBalanceSheet FinancialLiabilitiesCurrent => _financialLiabilitiesCurrent ??= new(_timeProvider, _securityIdentifier);\n        private FinancialLiabilitiesCurrentBalanceSheet _financialLiabilitiesCurrent;\n\n        /// <summary>\n        /// Financial related liabilities due beyond one year, including long term debt, capital leases and derivative liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23463\n        /// </remarks>\n        [JsonProperty(\"23463\")]\n        public FinancialLiabilitiesNonCurrentBalanceSheet FinancialLiabilitiesNonCurrent => _financialLiabilitiesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private FinancialLiabilitiesNonCurrentBalanceSheet _financialLiabilitiesNonCurrent;\n\n        /// <summary>\n        /// Financial assets that are held at fair value through profit or loss comprise assets held for trading and those financial assets designated as being held at fair value through profit or loss.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23466\n        /// </remarks>\n        [JsonProperty(\"23466\")]\n        public FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal => _financialAssetsDesignatedasFairValueThroughProfitorLossTotal ??= new(_timeProvider, _securityIdentifier);\n        private FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet _financialAssetsDesignatedasFairValueThroughProfitorLossTotal;\n\n        /// <summary>\n        /// Carrying amount due within one year of the balance sheet date (or one operating cycle, if longer) from tax authorities as of the balance sheet date representing refunds of overpayments or recoveries based on agreed-upon resolutions of disputes, and current deferred tax assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23468\n        /// </remarks>\n        [JsonProperty(\"23468\")]\n        public TaxesAssetsCurrentBalanceSheet TaxesAssetsCurrent => _taxesAssetsCurrent ??= new(_timeProvider, _securityIdentifier);\n        private TaxesAssetsCurrentBalanceSheet _taxesAssetsCurrent;\n\n        /// <summary>\n        /// Other equity instruments issued by the company that cannot be identified by other specific items in the Equity section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23469\n        /// </remarks>\n        [JsonProperty(\"23469\")]\n        public OtherEquityInterestBalanceSheet OtherEquityInterest => _otherEquityInterest ??= new(_timeProvider, _securityIdentifier);\n        private OtherEquityInterestBalanceSheet _otherEquityInterest;\n\n        /// <summary>\n        /// Carrying amount of any interest-bearing loan which is due after one year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23470\n        /// </remarks>\n        [JsonProperty(\"23470\")]\n        public InterestBearingBorrowingsNonCurrentBalanceSheet InterestBearingBorrowingsNonCurrent => _interestBearingBorrowingsNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private InterestBearingBorrowingsNonCurrentBalanceSheet _interestBearingBorrowingsNonCurrent;\n\n        /// <summary>\n        /// Non-interest bearing borrowings due after a year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23471\n        /// </remarks>\n        [JsonProperty(\"23471\")]\n        public NonInterestBearingBorrowingsNonCurrentBalanceSheet NonInterestBearingBorrowingsNonCurrent => _nonInterestBearingBorrowingsNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestBearingBorrowingsNonCurrentBalanceSheet _nonInterestBearingBorrowingsNonCurrent;\n\n        /// <summary>\n        /// Sum of all non-current payables and accrued expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23472\n        /// </remarks>\n        [JsonProperty(\"23472\")]\n        public TradeandOtherPayablesNonCurrentBalanceSheet TradeandOtherPayablesNonCurrent => _tradeandOtherPayablesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private TradeandOtherPayablesNonCurrentBalanceSheet _tradeandOtherPayablesNonCurrent;\n\n        /// <summary>\n        /// Non-interest bearing deposits in other financial institutions for short periods of time, usually less than 12 months.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23474\n        /// </remarks>\n        [JsonProperty(\"23474\")]\n        public NonInterestBearingBorrowingsCurrentBalanceSheet NonInterestBearingBorrowingsCurrent => _nonInterestBearingBorrowingsCurrent ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestBearingBorrowingsCurrentBalanceSheet _nonInterestBearingBorrowingsCurrent;\n\n        /// <summary>\n        /// Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23475\n        /// </remarks>\n        [JsonProperty(\"23475\")]\n        public PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet PensionandOtherPostRetirementBenefitPlansCurrent => _pensionandOtherPostRetirementBenefitPlansCurrent ??= new(_timeProvider, _securityIdentifier);\n        private PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet _pensionandOtherPostRetirementBenefitPlansCurrent;\n\n        /// <summary>\n        /// Reflects the carrying amount of any other unpaid loans, an asset of the bank.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23478\n        /// </remarks>\n        [JsonProperty(\"23478\")]\n        public OtherLoanAssetsBalanceSheet OtherLoanAssets => _otherLoanAssets ??= new(_timeProvider, _securityIdentifier);\n        private OtherLoanAssetsBalanceSheet _otherLoanAssets;\n\n        /// <summary>\n        /// Total value collateral assets pledged to the bank that can be sold or used as collateral for other loans.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23480\n        /// </remarks>\n        [JsonProperty(\"23480\")]\n        public AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal => _assetsPledgedasCollateralSubjecttoSaleorRepledgingTotal ??= new(_timeProvider, _securityIdentifier);\n        private AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet _assetsPledgedasCollateralSubjecttoSaleorRepledgingTotal;\n\n        /// <summary>\n        /// Sum of total tax assets in a Non-Differentiated Balance Sheet, includes Tax Receivables and Deferred Tax Assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23481\n        /// </remarks>\n        [JsonProperty(\"23481\")]\n        public TaxAssetsTotalBalanceSheet TaxAssetsTotal => _taxAssetsTotal ??= new(_timeProvider, _securityIdentifier);\n        private TaxAssetsTotalBalanceSheet _taxAssetsTotal;\n\n        /// <summary>\n        /// Borrowings from the central bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23482\n        /// </remarks>\n        [JsonProperty(\"23482\")]\n        public AdvancesfromCentralBanksBalanceSheet AdvancesfromCentralBanks => _advancesfromCentralBanks ??= new(_timeProvider, _securityIdentifier);\n        private AdvancesfromCentralBanksBalanceSheet _advancesfromCentralBanks;\n\n        /// <summary>\n        /// A savings certificate entitling the bearer to receive interest. A CD bears a maturity date, a specified fixed interest rate and can be issued in any denomination.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23484\n        /// </remarks>\n        [JsonProperty(\"23484\")]\n        public DepositCertificatesBalanceSheet DepositCertificates => _depositCertificates ??= new(_timeProvider, _securityIdentifier);\n        private DepositCertificatesBalanceSheet _depositCertificates;\n\n        /// <summary>\n        /// Non-interest bearing deposits in other financial institutions for relatively short periods of time; on a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23487\n        /// </remarks>\n        [JsonProperty(\"23487\")]\n        public NonInterestBearingBorrowingsTotalBalanceSheet NonInterestBearingBorrowingsTotal => _nonInterestBearingBorrowingsTotal ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestBearingBorrowingsTotalBalanceSheet _nonInterestBearingBorrowingsTotal;\n\n        /// <summary>\n        /// Other borrowings by the bank to fund its activities that cannot be identified by other specific items in the Liabilities section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23488\n        /// </remarks>\n        [JsonProperty(\"23488\")]\n        public OtherBorrowedFundsBalanceSheet OtherBorrowedFunds => _otherBorrowedFunds ??= new(_timeProvider, _securityIdentifier);\n        private OtherBorrowedFundsBalanceSheet _otherBorrowedFunds;\n\n        /// <summary>\n        /// Financial liabilities that are held at fair value through profit or loss.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23490\n        /// </remarks>\n        [JsonProperty(\"23490\")]\n        public FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal => _financialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal ??= new(_timeProvider, _securityIdentifier);\n        private FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet _financialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal;\n\n        /// <summary>\n        /// Financial liabilities carried at amortized cost.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23491\n        /// </remarks>\n        [JsonProperty(\"23491\")]\n        public FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet FinancialLiabilitiesMeasuredatAmortizedCostTotal => _financialLiabilitiesMeasuredatAmortizedCostTotal ??= new(_timeProvider, _securityIdentifier);\n        private FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet _financialLiabilitiesMeasuredatAmortizedCostTotal;\n\n        /// <summary>\n        /// Liabilities which have occurred, but have not been paid or logged under accounts payable during an accounting period. In other words, obligations for goods and services provided to a company for which invoices have not yet been received; on a Non- Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23495\n        /// </remarks>\n        [JsonProperty(\"23495\")]\n        public AccruedLiabilitiesTotalBalanceSheet AccruedLiabilitiesTotal => _accruedLiabilitiesTotal ??= new(_timeProvider, _securityIdentifier);\n        private AccruedLiabilitiesTotalBalanceSheet _accruedLiabilitiesTotal;\n\n        /// <summary>\n        /// Collections of cash or other assets related to revenue producing activity for which revenue has not yet been recognized on a Non- Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23496\n        /// </remarks>\n        [JsonProperty(\"23496\")]\n        public DeferredIncomeTotalBalanceSheet DeferredIncomeTotal => _deferredIncomeTotal ??= new(_timeProvider, _securityIdentifier);\n        private DeferredIncomeTotalBalanceSheet _deferredIncomeTotal;\n\n        /// <summary>\n        /// A future tax liability, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value or timing differences between the recognition of gains and losses in financial statements, on a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23497\n        /// </remarks>\n        [JsonProperty(\"23497\")]\n        public DeferredTaxLiabilitiesTotalBalanceSheet DeferredTaxLiabilitiesTotal => _deferredTaxLiabilitiesTotal ??= new(_timeProvider, _securityIdentifier);\n        private DeferredTaxLiabilitiesTotalBalanceSheet _deferredTaxLiabilitiesTotal;\n\n        /// <summary>\n        /// Reinsurance asset is insurance that is purchased by an insurance company from another insurance company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23499\n        /// </remarks>\n        [JsonProperty(\"23499\")]\n        public ReinsuranceAssetsBalanceSheet ReinsuranceAssets => _reinsuranceAssets ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceAssetsBalanceSheet _reinsuranceAssets;\n\n        /// <summary>\n        /// Deposits made under reinsurance.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23502\n        /// </remarks>\n        [JsonProperty(\"23502\")]\n        public DepositsMadeunderAssumedReinsuranceContractBalanceSheet DepositsMadeunderAssumedReinsuranceContract => _depositsMadeunderAssumedReinsuranceContract ??= new(_timeProvider, _securityIdentifier);\n        private DepositsMadeunderAssumedReinsuranceContractBalanceSheet _depositsMadeunderAssumedReinsuranceContract;\n\n        /// <summary>\n        /// A contract under which one party (the insurer) accepts significant insurance risk from another party (the policyholder) by agreeing to compensate the policyholder if a specified uncertain future event (the insured event) adversely affects the policyholder. This includes Insurance Receivables and Premiums Receivables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23503\n        /// </remarks>\n        [JsonProperty(\"23503\")]\n        public InsuranceContractAssetsBalanceSheet InsuranceContractAssets => _insuranceContractAssets ??= new(_timeProvider, _securityIdentifier);\n        private InsuranceContractAssetsBalanceSheet _insuranceContractAssets;\n\n        /// <summary>\n        /// Any type of insurance policy that protects an individual or business from the risk that they may be sued and held legally liable for something such as malpractice, injury or negligence. Liability insurance policies cover both legal costs and any legal payouts for which the insured would be responsible if found legally liable. Intentional damage and contractual liabilities are typically not covered in these types of policies.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23505\n        /// </remarks>\n        [JsonProperty(\"23505\")]\n        public InsuranceContractLiabilitiesBalanceSheet InsuranceContractLiabilities => _insuranceContractLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private InsuranceContractLiabilitiesBalanceSheet _insuranceContractLiabilities;\n\n        /// <summary>\n        /// Deposit received through ceded insurance contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23508\n        /// </remarks>\n        [JsonProperty(\"23508\")]\n        public DepositsReceivedunderCededInsuranceContractBalanceSheet DepositsReceivedunderCededInsuranceContract => _depositsReceivedunderCededInsuranceContract ??= new(_timeProvider, _securityIdentifier);\n        private DepositsReceivedunderCededInsuranceContractBalanceSheet _depositsReceivedunderCededInsuranceContract;\n\n        /// <summary>\n        /// Liabilities due on the insurance investment contract.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23509\n        /// </remarks>\n        [JsonProperty(\"23509\")]\n        public InvestmentContractLiabilitiesBalanceSheet InvestmentContractLiabilities => _investmentContractLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentContractLiabilitiesBalanceSheet _investmentContractLiabilities;\n\n        /// <summary>\n        /// Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits. Used to reflect the current portion of the liabilities (due within one year or within the normal operating cycle if longer).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23515\n        /// </remarks>\n        [JsonProperty(\"23515\")]\n        public PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet PensionAndOtherPostretirementBenefitPlansTotal => _pensionAndOtherPostretirementBenefitPlansTotal ??= new(_timeProvider, _securityIdentifier);\n        private PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet _pensionAndOtherPostretirementBenefitPlansTotal;\n\n        /// <summary>\n        /// Liabilities related to an asset classified as held for sale.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23516\n        /// </remarks>\n        [JsonProperty(\"23516\")]\n        public LiabilitiesHeldforSaleTotalBalanceSheet LiabilitiesHeldforSaleTotal => _liabilitiesHeldforSaleTotal ??= new(_timeProvider, _securityIdentifier);\n        private LiabilitiesHeldforSaleTotalBalanceSheet _liabilitiesHeldforSaleTotal;\n\n        /// <summary>\n        /// A security transaction which expires within a 12 month period that reduces the risk on an existing investment position.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23518\n        /// </remarks>\n        [JsonProperty(\"23518\")]\n        public HedgingAssetsCurrentBalanceSheet HedgingAssetsCurrent => _hedgingAssetsCurrent ??= new(_timeProvider, _securityIdentifier);\n        private HedgingAssetsCurrentBalanceSheet _hedgingAssetsCurrent;\n\n        /// <summary>\n        /// Loans that entitles the lender (or the holder of loan debenture) to convert the loan to common or preferred stock (ordinary or preference shares) at a specified rate conversion rate and a specified time frame; in a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23519\n        /// </remarks>\n        [JsonProperty(\"23519\")]\n        public ConvertibleLoansTotalBalanceSheet ConvertibleLoansTotal => _convertibleLoansTotal ??= new(_timeProvider, _securityIdentifier);\n        private ConvertibleLoansTotalBalanceSheet _convertibleLoansTotal;\n\n        /// <summary>\n        /// Total debt financing obligation issued by a bank or similar financial institution to a company that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time; in a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23520\n        /// </remarks>\n        [JsonProperty(\"23520\")]\n        public BankLoansTotalBalanceSheet BankLoansTotal => _bankLoansTotal ??= new(_timeProvider, _securityIdentifier);\n        private BankLoansTotalBalanceSheet _bankLoansTotal;\n\n        /// <summary>\n        /// Total other loans between the customer and bank which cannot be identified by other specific items in the Debt section; in a Non- Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23521\n        /// </remarks>\n        [JsonProperty(\"23521\")]\n        public OtherLoansTotalBalanceSheet OtherLoansTotal => _otherLoansTotal ??= new(_timeProvider, _securityIdentifier);\n        private OtherLoansTotalBalanceSheet _otherLoansTotal;\n\n        /// <summary>\n        /// Liabilities related to insurance funds that are dissolved after one year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23524\n        /// </remarks>\n        [JsonProperty(\"23524\")]\n        public InsuranceFundsNonCurrentBalanceSheet InsuranceFundsNonCurrent => _insuranceFundsNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private InsuranceFundsNonCurrentBalanceSheet _insuranceFundsNonCurrent;\n\n        /// <summary>\n        /// The total aggregate of all written promises and/or agreements to repay a stated amount of borrowed funds at a specified date in the future; in a Non-Differentiated Balance Sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23528\n        /// </remarks>\n        [JsonProperty(\"23528\")]\n        public DebtTotalBalanceSheet DebtTotal => _debtTotal ??= new(_timeProvider, _securityIdentifier);\n        private DebtTotalBalanceSheet _debtTotal;\n\n        /// <summary>\n        /// The treasury stock number of common shares. This represents the number of common shares owned by the company as a result of share repurchase programs or donations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23529\n        /// </remarks>\n        [JsonProperty(\"23529\")]\n        public ComTreShaNumBalanceSheet ComTreShaNum => _comTreShaNum ??= new(_timeProvider, _securityIdentifier);\n        private ComTreShaNumBalanceSheet _comTreShaNum;\n\n        /// <summary>\n        /// The treasury stock number of preferred shares. This represents the number of preferred shares owned by the company as a result of share repurchase programs or donations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23530\n        /// </remarks>\n        [JsonProperty(\"23530\")]\n        public PreTreShaNumBalanceSheet PreTreShaNum => _preTreShaNum ??= new(_timeProvider, _securityIdentifier);\n        private PreTreShaNumBalanceSheet _preTreShaNum;\n\n        /// <summary>\n        /// This is a metric that shows a company's overall debt situation by netting the value of a company's liabilities and debts with its cash and other similar liquid assets. It is calculated using [Current Debt] + [Long Term Debt] - [Cash and Cash Equivalents].\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23531\n        /// </remarks>\n        [JsonProperty(\"23531\")]\n        public NetDebtBalanceSheet NetDebt => _netDebt ??= new(_timeProvider, _securityIdentifier);\n        private NetDebtBalanceSheet _netDebt;\n\n        /// <summary>\n        /// The number of authorized shares that is sold to and held by the shareholders of a company, regardless of whether they are insiders, institutional investors or the general public. Unlike shares that are held as treasury stock, shares that have been retired are not included in this figure. The amount of issued shares can be all or part of the total amount of authorized shares of a corporation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23532\n        /// </remarks>\n        [JsonProperty(\"23532\")]\n        public ShareIssuedBalanceSheet ShareIssued => _shareIssued ??= new(_timeProvider, _securityIdentifier);\n        private ShareIssuedBalanceSheet _shareIssued;\n\n        /// <summary>\n        /// Short term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23533\n        /// </remarks>\n        [JsonProperty(\"23533\")]\n        public AssetsHeldForSaleCurrentBalanceSheet AssetsHeldForSaleCurrent => _assetsHeldForSaleCurrent ??= new(_timeProvider, _securityIdentifier);\n        private AssetsHeldForSaleCurrentBalanceSheet _assetsHeldForSaleCurrent;\n\n        /// <summary>\n        /// Long term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23534\n        /// </remarks>\n        [JsonProperty(\"23534\")]\n        public AssetsHeldForSaleNonCurrentBalanceSheet AssetsHeldForSaleNonCurrent => _assetsHeldForSaleNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private AssetsHeldForSaleNonCurrentBalanceSheet _assetsHeldForSaleNonCurrent;\n\n        /// <summary>\n        /// Biological assets include plants and animals.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23535\n        /// </remarks>\n        [JsonProperty(\"23535\")]\n        public BiologicalAssetsBalanceSheet BiologicalAssets => _biologicalAssets ??= new(_timeProvider, _securityIdentifier);\n        private BiologicalAssetsBalanceSheet _biologicalAssets;\n\n        /// <summary>\n        /// Cash that the company can use only for specific purposes or cash deposit or placing of owned property by a debtor (the pledger) to a creditor (the pledgee) as a security for a loan or obligation.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23536\n        /// </remarks>\n        [JsonProperty(\"23536\")]\n        public CashRestrictedOrPledgedBalanceSheet CashRestrictedOrPledged => _cashRestrictedOrPledged ??= new(_timeProvider, _securityIdentifier);\n        private CashRestrictedOrPledgedBalanceSheet _cashRestrictedOrPledged;\n\n        /// <summary>\n        /// A long term loan with a warrant attached that gives the debt holder the option to exchange all or a portion of the loan principal for an equity position in the company at a predetermined rate of conversion within a specified period of time.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23537\n        /// </remarks>\n        [JsonProperty(\"23537\")]\n        public ConvertibleLoansNonCurrentBalanceSheet ConvertibleLoansNonCurrent => _convertibleLoansNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private ConvertibleLoansNonCurrentBalanceSheet _convertibleLoansNonCurrent;\n\n        /// <summary>\n        /// Financial instruments that are linked to a specific financial instrument or indicator or commodity, and through which specific financial risks can be traded in financial markets in their own right, such as financial options, futures, forwards, etc.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23538\n        /// </remarks>\n        [JsonProperty(\"23538\")]\n        public FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet FinancialOrDerivativeInvestmentCurrentLiabilities => _financialOrDerivativeInvestmentCurrentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet _financialOrDerivativeInvestmentCurrentLiabilities;\n\n        /// <summary>\n        /// Investments that are neither Investment in Financial Assets nor Long term equity investment, not expected to be cashed within a year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23540\n        /// </remarks>\n        [JsonProperty(\"23540\")]\n        public OtherInvestmentsBalanceSheet OtherInvestments => _otherInvestments ??= new(_timeProvider, _securityIdentifier);\n        private OtherInvestmentsBalanceSheet _otherInvestments;\n\n        /// <summary>\n        /// Amounts due from customers or clients, more than one year from the balance sheet date, for goods or services that have been delivered or sold in the normal course of business, or other receivables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23541\n        /// </remarks>\n        [JsonProperty(\"23541\")]\n        public TradeAndOtherReceivablesNonCurrentBalanceSheet TradeAndOtherReceivablesNonCurrent => _tradeAndOtherReceivablesNonCurrent ??= new(_timeProvider, _securityIdentifier);\n        private TradeAndOtherReceivablesNonCurrentBalanceSheet _tradeAndOtherReceivablesNonCurrent;\n\n        /// <summary>\n        /// For an unclassified balance sheet, carrying amount as of the balance sheet date of obligations due all related parties.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23543\n        /// </remarks>\n        [JsonProperty(\"23543\")]\n        public DueFromRelatedPartiesBalanceSheet DueFromRelatedParties => _dueFromRelatedParties ??= new(_timeProvider, _securityIdentifier);\n        private DueFromRelatedPartiesBalanceSheet _dueFromRelatedParties;\n\n        /// <summary>\n        /// The amount of surplus from insurance contracts which has not been allocated at the balance sheet date. This is represented as a liability to policyholders, as it pertains to cumulative income arising from the with-profits business.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23546\n        /// </remarks>\n        [JsonProperty(\"23546\")]\n        public UnallocatedSurplusBalanceSheet UnallocatedSurplus => _unallocatedSurplus ??= new(_timeProvider, _securityIdentifier);\n        private UnallocatedSurplusBalanceSheet _unallocatedSurplus;\n\n        /// <summary>\n        /// Debt due under 1 year according to the debt maturity schedule reported by the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23547\n        /// </remarks>\n        [JsonProperty(\"23547\")]\n        public DebtDueInYear1BalanceSheet DebtDueInYear1 => _debtDueInYear1 ??= new(_timeProvider, _securityIdentifier);\n        private DebtDueInYear1BalanceSheet _debtDueInYear1;\n\n        /// <summary>\n        /// Debt due under 2 years according to the debt maturity schedule reported by the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23548\n        /// </remarks>\n        [JsonProperty(\"23548\")]\n        public DebtDueInYear2BalanceSheet DebtDueInYear2 => _debtDueInYear2 ??= new(_timeProvider, _securityIdentifier);\n        private DebtDueInYear2BalanceSheet _debtDueInYear2;\n\n        /// <summary>\n        /// Debt due within 5 year if the company provide maturity schedule in range e.g. 1-5 years, 2-5 years. Debt due under 5 years according to the debt maturity schedule reported by the company. If a range is reported by the company, the value will be collected under the maximum number of years (eg. 1-5 years, 3-5 years or 5 years will all be collected under this data point.)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23549\n        /// </remarks>\n        [JsonProperty(\"23549\")]\n        public DebtDueInYear5BalanceSheet DebtDueInYear5 => _debtDueInYear5 ??= new(_timeProvider, _securityIdentifier);\n        private DebtDueInYear5BalanceSheet _debtDueInYear5;\n\n        /// <summary>\n        /// Debt maturing beyond 5 years (eg. 5-10 years) or with no specified maturity, according to the debt maturity schedule reported by the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23550\n        /// </remarks>\n        [JsonProperty(\"23550\")]\n        public DebtDueBeyondBalanceSheet DebtDueBeyond => _debtDueBeyond ??= new(_timeProvider, _securityIdentifier);\n        private DebtDueBeyondBalanceSheet _debtDueBeyond;\n\n        /// <summary>\n        /// Total Debt in Maturity Schedule is the sum of Debt details above.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23551\n        /// </remarks>\n        [JsonProperty(\"23551\")]\n        public TotalDebtInMaturityScheduleBalanceSheet TotalDebtInMaturitySchedule => _totalDebtInMaturitySchedule ??= new(_timeProvider, _securityIdentifier);\n        private TotalDebtInMaturityScheduleBalanceSheet _totalDebtInMaturitySchedule;\n\n        /// <summary>\n        /// Reserves created by revaluation of assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23552\n        /// </remarks>\n        [JsonProperty(\"23552\")]\n        public FixedAssetsRevaluationReserveBalanceSheet FixedAssetsRevaluationReserve => _fixedAssetsRevaluationReserve ??= new(_timeProvider, _securityIdentifier);\n        private FixedAssetsRevaluationReserveBalanceSheet _fixedAssetsRevaluationReserve;\n\n        /// <summary>\n        /// Other short term financial liabilities not categorized and due within one year or a normal operating cycle (whichever is longer).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23553\n        /// </remarks>\n        [JsonProperty(\"23553\")]\n        public CurrentOtherFinancialLiabilitiesBalanceSheet CurrentOtherFinancialLiabilities => _currentOtherFinancialLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private CurrentOtherFinancialLiabilitiesBalanceSheet _currentOtherFinancialLiabilities;\n\n        /// <summary>\n        /// Other long term financial liabilities not categorized and due over one year or a normal operating cycle (whichever is longer).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23554\n        /// </remarks>\n        [JsonProperty(\"23554\")]\n        public NonCurrentOtherFinancialLiabilitiesBalanceSheet NonCurrentOtherFinancialLiabilities => _nonCurrentOtherFinancialLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private NonCurrentOtherFinancialLiabilitiesBalanceSheet _nonCurrentOtherFinancialLiabilities;\n\n        /// <summary>\n        /// Other financial liabilities not categorized.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23555\n        /// </remarks>\n        [JsonProperty(\"23555\")]\n        public OtherFinancialLiabilitiesBalanceSheet OtherFinancialLiabilities => _otherFinancialLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private OtherFinancialLiabilitiesBalanceSheet _otherFinancialLiabilities;\n\n        /// <summary>\n        /// Total liabilities as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23556\n        /// </remarks>\n        [JsonProperty(\"23556\")]\n        public TotalLiabilitiesAsReportedBalanceSheet TotalLiabilitiesAsReported => _totalLiabilitiesAsReported ??= new(_timeProvider, _securityIdentifier);\n        private TotalLiabilitiesAsReportedBalanceSheet _totalLiabilitiesAsReported;\n\n        /// <summary>\n        /// Total Equity as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23557\n        /// </remarks>\n        [JsonProperty(\"23557\")]\n        public TotalEquityAsReportedBalanceSheet TotalEquityAsReported => _totalEquityAsReported ??= new(_timeProvider, _securityIdentifier);\n        private TotalEquityAsReportedBalanceSheet _totalEquityAsReported;\n\n        private readonly ITimeProvider _timeProvider;\n        private readonly SecurityIdentifier _securityIdentifier;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n        {\n            _timeProvider = timeProvider;\n            _securityIdentifier = securityIdentifier;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BalanceSheetFileDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Filing date of the Balance Sheet\n    /// </summary>\n    public class BalanceSheetFileDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BSFileDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BalanceSheetFileDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BalanceSheetFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BankIndebtednessBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All indebtedness for borrowed money or the deferred purchase price of property or services, including without limitation reimbursement and other obligations with respect to surety bonds and letters of credit, all obligations evidenced by notes, bonds debentures or similar instruments, all capital lease obligations and all contingent obligations.\n    /// </summary>\n    public class BankIndebtednessBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BankIndebtedness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BankIndebtednessBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BankIndebtednessBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BankLoansCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time within the next 12 months or operating cycle.\n    /// </summary>\n    public class BankLoansCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BankLoansCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BankLoansCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BankLoansCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BankLoansNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time beyond the current accounting PeriodAsByte.\n    /// </summary>\n    public class BankLoansNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BankLoansNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BankLoansNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BankLoansNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BankLoansTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total debt financing obligation issued by a bank or similar financial institution to a company that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time; in a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class BankLoansTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BankLoansTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BankLoansTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BankLoansTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BankOwnedLifeInsuranceBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amount of a life insurance policy on an officer, executive or employee for which the reporting entity (a bank) is entitled to proceeds from the policy upon death of the insured or surrender of the insurance policy.\n    /// </summary>\n    public class BankOwnedLifeInsuranceBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BankOwnedLifeInsuranceBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BankOwnedLifeInsuranceBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicAccountingChange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from the Cumulative Effect of Accounting Change is the earnings attributable to the accounting change (during the reporting period) divided by the weighted average number of common shares outstanding.\n    /// </summary>\n    public class BasicAccountingChange : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicAccountingChange_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicAccountingChange()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicAccountingChange(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicAverageShares.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The shares outstanding used to calculate Basic EPS, which is the weighted average common share outstanding through the whole accounting PeriodAsByte. Note: If Basic Average Shares are not presented by the firm in the Income Statement, this data point will be null.\n    /// </summary>\n    public class BasicAverageShares : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicAverageShares_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicAverageShares()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicAverageShares(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicContinuousOperations.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from Continuing Operations is the earnings from continuing operations reported by the company divided by the weighted average number of common shares outstanding.\n    /// </summary>\n    public class BasicContinuousOperations : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicContinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicContinuousOperations()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicContinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicDiscontinuousOperations.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from Discontinued Operations is the earnings from discontinued operations reported by the company divided by the weighted average number of common shares outstanding. This only includes gain or loss from discontinued operations.\n    /// </summary>\n    public class BasicDiscontinuousOperations : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicDiscontinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicDiscontinuousOperations()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicDiscontinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS is the bottom line net income divided by the weighted average number of common shares outstanding.\n    /// </summary>\n    public class BasicEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicEPSOtherGainsLosses.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from the Other Gains/Losses is the earnings attributable to the other gains/losses (during the reporting period) divided by the weighted average number of common shares outstanding.\n    /// </summary>\n    public class BasicEPSOtherGainsLosses : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicEPSOtherGainsLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicEPSOtherGainsLosses()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicEPSOtherGainsLosses(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BasicExtraordinary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from the Extraordinary Gains/Losses is the earnings attributable to the gains or losses (during the reporting period) from extraordinary items divided by the weighted average number of common shares outstanding.\n    /// </summary>\n    public class BasicExtraordinary : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_BasicExtraordinary_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BasicExtraordinary()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BasicExtraordinary(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BeginningCashPositionCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash and equivalents balance at the beginning of the accounting period, as indicated on the Cash Flow statement.\n    /// </summary>\n    public class BeginningCashPositionCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_BeginningCashPosition_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BeginningCashPositionCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BeginningCashPositionCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BiologicalAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Biological assets include plants and animals.\n    /// </summary>\n    public class BiologicalAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BiologicalAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BiologicalAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BiologicalAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BookValuePerShareGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's book value per share on a percentage basis. Morningstar calculates the growth percentage based on the common shareholder's equity reported in the Balance Sheet divided by the diluted shares outstanding within the company filings or reports.\n    /// </summary>\n    public class BookValuePerShareGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_BookValuePerShareGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BookValuePerShareGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BookValuePerShareGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/BuildingsAndImprovementsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fixed assets that specifically deal with the facilities a company owns. Include the improvements associated with buildings.\n    /// </summary>\n    public class BuildingsAndImprovementsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_BuildingsAndImprovements_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public BuildingsAndImprovementsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public BuildingsAndImprovementsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CFOGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's cash flow from operations on a percentage basis. Morningstar calculates the growth percentage based on the underlying cash flow from operations data reported in the Cash Flow Statement within the company filings or reports.\n    /// </summary>\n    public class CFOGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CFOGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CFOGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CFOGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapExGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's capital expenditures on a percentage basis. Morningstar calculates the growth percentage based on the capital expenditures reported in the Cash Flow Statement within the company filings or reports.\n    /// </summary>\n    public class CapExGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CapExGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapExGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapExGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapExReportedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Capital expenditure, capitalized software development cost, maintenance capital expenditure, etc. as reported by the company.\n    /// </summary>\n    public class CapExReportedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CapExReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapExReportedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapExReportedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapExSalesRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Capital Expenditure / Revenue\n    /// </summary>\n    public class CapExSalesRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CapExSalesRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapExSalesRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapExSalesRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapitalExpenditureAnnual5YrGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the compound annual growth rate of the company's capital spending over the last 5 years. Capital Spending is the sum of the Capital Expenditure items found in the Statement of Cash Flows.\n    /// </summary>\n    public class CapitalExpenditureAnnual5YrGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CapitalExpenditureAnnual5YrGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapitalExpenditureAnnual5YrGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapitalExpenditureAnnual5YrGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapitalExpenditureCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Funds used by a company to acquire or upgrade physical assets such as property, industrial buildings or equipment. This type of outlay is made by companies to maintain or increase the scope of their operations. Capital expenditures are generally depreciated or depleted over their useful life, as distinguished from repairs, which are subtracted from the income of the current year.\n    /// </summary>\n    public class CapitalExpenditureCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CapitalExpenditure_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapitalExpenditureCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapitalExpenditureCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapitalExpendituretoEBITDA.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Measures the amount a company is investing in its business relative to EBITDA generated in a given PeriodAsByte.\n    /// </summary>\n    public class CapitalExpendituretoEBITDA : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CapitalExpendituretoEBITDA_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapitalExpendituretoEBITDA()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapitalExpendituretoEBITDA(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapitalLeaseObligationsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Current Portion of Capital Lease Obligation plus Long Term Portion of Capital Lease Obligation.\n    /// </summary>\n    public class CapitalLeaseObligationsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CapitalLeaseObligations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapitalLeaseObligationsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapitalLeaseObligationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CapitalStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total amount of stock authorized for issue by a corporation, including common and preferred stock.\n    /// </summary>\n    public class CapitalStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CapitalStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CapitalStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CapitalStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash outlay for cash advances and loans made to other parties.\n    /// </summary>\n    public class CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashAndCashEquivalentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes unrestricted cash on hand, money market instruments and other debt securities which can be converted to cash immediately.\n    /// </summary>\n    public class CashAndCashEquivalentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashAndCashEquivalents_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashAndCashEquivalentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashAndCashEquivalentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashAndDueFromBanksBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes cash on hand (currency and coin), cash items in process of collection, non-interest bearing deposits due from other financial institutions (including corporate credit unions), and balances with the Federal Reserve Banks, Federal Home Loan Banks and central banks.\n    /// </summary>\n    public class CashAndDueFromBanksBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashAndDueFromBanks_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashAndDueFromBanksBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashAndDueFromBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash includes currency on hand as well as demand deposits with banks or financial institutions. It also includes other kinds of accounts that have the general characteristics of demand deposits in that the customer may deposit additional funds at any time and also effectively may withdraw funds at any time without prior notice or penalty.\n    /// </summary>\n    public class CashBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Cash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashCashEquivalentsAndFederalFundsSoldBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of cash, cash equivalents, and federal funds sold.\n    /// </summary>\n    public class CashCashEquivalentsAndFederalFundsSoldBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashCashEquivalentsAndFederalFundsSoldBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashCashEquivalentsAndFederalFundsSoldBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashCashEquivalentsAndMarketableSecuritiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of cash, cash equivalents, and marketable securities.\n    /// </summary>\n    public class CashCashEquivalentsAndMarketableSecuritiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashCashEquivalentsAndMarketableSecuritiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashCashEquivalentsAndMarketableSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashConversionCycle.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Days In Inventory + Days In Sales - Days In Payment\n    /// </summary>\n    public class CashConversionCycle : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashConversionCycle_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashConversionCycle()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashConversionCycle(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashDividendsForMinoritiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash Distribution of earnings to Minority Stockholders.\n    /// </summary>\n    public class CashDividendsForMinoritiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashDividendsForMinorities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashDividendsForMinoritiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashDividendsForMinoritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashDividendsPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments for the cash dividends declared by an entity to shareholders during the PeriodAsByte. This element includes paid and unpaid dividends declared during the period for both common and preferred stock.\n    /// </summary>\n    public class CashDividendsPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashDividendsPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashDividendsPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashDividendsPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashEquivalentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash equivalents, excluding items classified as marketable securities, include short-term, highly liquid investments that are both readily convertible to known amounts of cash, and so near their maturity that they present insignificant risk of changes in value because of changes in interest rates. Generally, only investments with original maturities of three months or less qualify under this definition. Original maturity means original maturity to the entity holding the investment. For example, both a three-month US Treasury bill and a three-year Treasury note purchased three months from maturity qualify as cash equivalents. However, a Treasury note purchased three years ago does not become a cash equivalent when its remaining maturity is three months.\n    /// </summary>\n    public class CashEquivalentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashEquivalents_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashEquivalentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashEquivalentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowFileDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Filing date of the Cash Flow Statement.\n    /// </summary>\n    public class CashFlowFileDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CFFileDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFileDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowFromContinuingFinancingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash generated by or used in financing activities of continuing operations; excludes cash flows from discontinued operations.\n    /// </summary>\n    public class CashFlowFromContinuingFinancingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromContinuingFinancingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromContinuingFinancingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowFromContinuingInvestingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash generated by or used in investing activities of continuing operations; excludes cash flows from discontinued operations.\n    /// </summary>\n    public class CashFlowFromContinuingInvestingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromContinuingInvestingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromContinuingInvestingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowFromContinuingOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash generated by or used in operating activities of continuing operations; excludes cash flows from discontinued operations.\n    /// </summary>\n    public class CashFlowFromContinuingOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromContinuingOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromContinuingOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowFromDiscontinuedOperationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of cash flow from discontinued operation, including operating activities, investing activities, and financing activities.\n    /// </summary>\n    public class CashFlowFromDiscontinuedOperationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromDiscontinuedOperationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromDiscontinuedOperationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the CashFlowStatement class\n    /// </summary>\n    public class CashFlowStatement : ReusuableCLRObject\n    {\n        /// <summary>\n        /// Filing date of the Cash Flow Statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26296\n        /// </remarks>\n        [JsonProperty(\"26296\")]\n        public CashFlowFileDate CFFileDate => _cFFileDate ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFileDate _cFFileDate;\n\n        /// <summary>\n        /// The systematic and rational apportionment of the acquisition cost of intangible operational assets to future periods in which the benefits contribute to revenue. This field is to include Amortization and any variation where Amortization is the first account listed in the line item, excluding Amortization of Intangibles.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26000\n        /// </remarks>\n        [JsonProperty(\"26000\")]\n        public AmortizationCashFlowStatement Amortization => _amortization ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationCashFlowStatement _amortization;\n\n        /// <summary>\n        /// Funds used by a company to acquire or upgrade physical assets such as property, industrial buildings or equipment. This type of outlay is made by companies to maintain or increase the scope of their operations. Capital expenditures are generally depreciated or depleted over their useful life, as distinguished from repairs, which are subtracted from the income of the current year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26005\n        /// </remarks>\n        [JsonProperty(\"26005\")]\n        public CapitalExpenditureCashFlowStatement CapitalExpenditure => _capitalExpenditure ??= new(_timeProvider, _securityIdentifier);\n        private CapitalExpenditureCashFlowStatement _capitalExpenditure;\n\n        /// <summary>\n        /// Payments for the cash dividends declared by an entity to shareholders during the period. This element includes paid and unpaid dividends declared during the period for both common and preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26007\n        /// </remarks>\n        [JsonProperty(\"26007\")]\n        public CashDividendsPaidCashFlowStatement CashDividendsPaid => _cashDividendsPaid ??= new(_timeProvider, _securityIdentifier);\n        private CashDividendsPaidCashFlowStatement _cashDividendsPaid;\n\n        /// <summary>\n        /// Cash generated by or used in financing activities of continuing operations; excludes cash flows from discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26008\n        /// </remarks>\n        [JsonProperty(\"26008\")]\n        public CashFlowFromContinuingFinancingActivitiesCashFlowStatement CashFlowFromContinuingFinancingActivities => _cashFlowFromContinuingFinancingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromContinuingFinancingActivitiesCashFlowStatement _cashFlowFromContinuingFinancingActivities;\n\n        /// <summary>\n        /// Cash generated by or used in investing activities of continuing operations; excludes cash flows from discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26009\n        /// </remarks>\n        [JsonProperty(\"26009\")]\n        public CashFlowFromContinuingInvestingActivitiesCashFlowStatement CashFlowFromContinuingInvestingActivities => _cashFlowFromContinuingInvestingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromContinuingInvestingActivitiesCashFlowStatement _cashFlowFromContinuingInvestingActivities;\n\n        /// <summary>\n        /// Cash generated by or used in operating activities of continuing operations; excludes cash flows from discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26010\n        /// </remarks>\n        [JsonProperty(\"26010\")]\n        public CashFlowFromContinuingOperatingActivitiesCashFlowStatement CashFlowFromContinuingOperatingActivities => _cashFlowFromContinuingOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromContinuingOperatingActivitiesCashFlowStatement _cashFlowFromContinuingOperatingActivities;\n\n        /// <summary>\n        /// The aggregate amount of cash flow from discontinued operation, including operating activities, investing activities, and financing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26011\n        /// </remarks>\n        [JsonProperty(\"26011\")]\n        public CashFlowFromDiscontinuedOperationCashFlowStatement CashFlowFromDiscontinuedOperation => _cashFlowFromDiscontinuedOperation ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromDiscontinuedOperationCashFlowStatement _cashFlowFromDiscontinuedOperation;\n\n        /// <summary>\n        /// The net cash inflow (outflow) from financing activity for the period, which involve changes to the long-term liabilities and stockholders' equity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26012\n        /// </remarks>\n        [JsonProperty(\"26012\")]\n        public FinancingCashFlowCashFlowStatement FinancingCashFlow => _financingCashFlow ??= new(_timeProvider, _securityIdentifier);\n        private FinancingCashFlowCashFlowStatement _financingCashFlow;\n\n        /// <summary>\n        /// An item on the cash flow statement that reports the aggregate change in a company's cash position resulting from any gains (or losses) from investments in the financial markets and operating subsidiaries, and changes resulting from amounts spent on investments in capital assets such as plant and equipment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26013\n        /// </remarks>\n        [JsonProperty(\"26013\")]\n        public InvestingCashFlowCashFlowStatement InvestingCashFlow => _investingCashFlow ??= new(_timeProvider, _securityIdentifier);\n        private InvestingCashFlowCashFlowStatement _investingCashFlow;\n\n        /// <summary>\n        /// The net cash from (used in) all of the entity's operating activities, including those of discontinued operations, of the reporting entity. Operating activities include all transactions and events that are not defined as investing or financing activities. Operating activities generally involve producing and delivering goods and providing services. Cash flows from operating activities are generally the cash effects of transactions and other events that enter into the determination of net income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26014\n        /// </remarks>\n        [JsonProperty(\"26014\")]\n        public OperatingCashFlowCashFlowStatement OperatingCashFlow => _operatingCashFlow ??= new(_timeProvider, _securityIdentifier);\n        private OperatingCashFlowCashFlowStatement _operatingCashFlow;\n\n        /// <summary>\n        /// The cash and equivalents balance at the beginning of the accounting period, as indicated on the Cash Flow statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26015\n        /// </remarks>\n        [JsonProperty(\"26015\")]\n        public BeginningCashPositionCashFlowStatement BeginningCashPosition => _beginningCashPosition ??= new(_timeProvider, _securityIdentifier);\n        private BeginningCashPositionCashFlowStatement _beginningCashPosition;\n\n        /// <summary>\n        /// The cash and cash equivalents balance at the end of the accounting period, as indicated on the Cash Flow statement. It is equal to the Beginning Cash and Equivalents, plus the Net Change in Cash and Equivalents.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26016\n        /// </remarks>\n        [JsonProperty(\"26016\")]\n        public EndCashPositionCashFlowStatement EndCashPosition => _endCashPosition ??= new(_timeProvider, _securityIdentifier);\n        private EndCashPositionCashFlowStatement _endCashPosition;\n\n        /// <summary>\n        /// Cash generated by or used in financing activities of discontinued operations; excludes cash flows from continued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26018\n        /// </remarks>\n        [JsonProperty(\"26018\")]\n        public CashFromDiscontinuedFinancingActivitiesCashFlowStatement CashFromDiscontinuedFinancingActivities => _cashFromDiscontinuedFinancingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFromDiscontinuedFinancingActivitiesCashFlowStatement _cashFromDiscontinuedFinancingActivities;\n\n        /// <summary>\n        /// The net cash inflow (outflow) from discontinued investing activities over the designated time period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26020\n        /// </remarks>\n        [JsonProperty(\"26020\")]\n        public CashFromDiscontinuedInvestingActivitiesCashFlowStatement CashFromDiscontinuedInvestingActivities => _cashFromDiscontinuedInvestingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFromDiscontinuedInvestingActivitiesCashFlowStatement _cashFromDiscontinuedInvestingActivities;\n\n        /// <summary>\n        /// The increase or decrease between periods of the account payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26022\n        /// </remarks>\n        [JsonProperty(\"26022\")]\n        public ChangeInAccountPayableCashFlowStatement ChangeInAccountPayable => _changeInAccountPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInAccountPayableCashFlowStatement _changeInAccountPayable;\n\n        /// <summary>\n        /// The increase or decrease between periods of the tax payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26024\n        /// </remarks>\n        [JsonProperty(\"26024\")]\n        public ChangeInTaxPayableCashFlowStatement ChangeInTaxPayable => _changeInTaxPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInTaxPayableCashFlowStatement _changeInTaxPayable;\n\n        /// <summary>\n        /// The increase or decrease between periods of the accrued expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26025\n        /// </remarks>\n        [JsonProperty(\"26025\")]\n        public ChangeInAccruedExpenseCashFlowStatement ChangeInAccruedExpense => _changeInAccruedExpense ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInAccruedExpenseCashFlowStatement _changeInAccruedExpense;\n\n        /// <summary>\n        /// The net change during the reporting period in investment income that has been earned but not yet received in cash.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26026\n        /// </remarks>\n        [JsonProperty(\"26026\")]\n        public ChangeInAccruedInvestmentIncomeCashFlowStatement ChangeInAccruedInvestmentIncome => _changeInAccruedInvestmentIncome ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInAccruedInvestmentIncomeCashFlowStatement _changeInAccruedInvestmentIncome;\n\n        /// <summary>\n        /// The net change between the beginning and ending balance of cash and cash equivalents.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26027\n        /// </remarks>\n        [JsonProperty(\"26027\")]\n        public ChangesInCashCashFlowStatement ChangesInCash => _changesInCash ??= new(_timeProvider, _securityIdentifier);\n        private ChangesInCashCashFlowStatement _changesInCash;\n\n        /// <summary>\n        /// The change of the unamortized portion as of the balance sheet date of capitalized costs that vary with and are primarily related to the acquisition of new and renewal insurance contracts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26028\n        /// </remarks>\n        [JsonProperty(\"26028\")]\n        public ChangeInDeferredAcquisitionCostsCashFlowStatement ChangeInDeferredAcquisitionCosts => _changeInDeferredAcquisitionCosts ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInDeferredAcquisitionCostsCashFlowStatement _changeInDeferredAcquisitionCosts;\n\n        /// <summary>\n        /// The amount shown on the books that a bank with insufficient reserves borrows, at the federal funds rate, from another bank to meet its reserve requirements and the amount of securities that an institution sells and agrees to repurchase at a specified date for a specified price, net of any reductions or offsets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26030\n        /// </remarks>\n        [JsonProperty(\"26030\")]\n        public ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement ChangeInFederalFundsAndSecuritiesSoldForRepurchase => _changeInFederalFundsAndSecuritiesSoldForRepurchase ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement _changeInFederalFundsAndSecuritiesSoldForRepurchase;\n\n        /// <summary>\n        /// The net change during the reporting period associated with funds withheld.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26031\n        /// </remarks>\n        [JsonProperty(\"26031\")]\n        public ChangeInFundsWithheldCashFlowStatement ChangeInFundsWithheld => _changeInFundsWithheld ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInFundsWithheldCashFlowStatement _changeInFundsWithheld;\n\n        /// <summary>\n        /// The increase or decrease between periods of the income tax payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26032\n        /// </remarks>\n        [JsonProperty(\"26032\")]\n        public ChangeInIncomeTaxPayableCashFlowStatement ChangeInIncomeTaxPayable => _changeInIncomeTaxPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInIncomeTaxPayableCashFlowStatement _changeInIncomeTaxPayable;\n\n        /// <summary>\n        /// The increase or decrease between periods of the interest payable. Interest payable means carrying value as of the balance sheet date of interest payable on all forms of debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26033\n        /// </remarks>\n        [JsonProperty(\"26033\")]\n        public ChangeInInterestPayableCashFlowStatement ChangeInInterestPayable => _changeInInterestPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInInterestPayableCashFlowStatement _changeInInterestPayable;\n\n        /// <summary>\n        /// The increase or decrease between periods of the Inventories. Inventories represent merchandise bought for resale and supplies and raw materials purchased for use in revenue producing operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26034\n        /// </remarks>\n        [JsonProperty(\"26034\")]\n        public ChangeInInventoryCashFlowStatement ChangeInInventory => _changeInInventory ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInInventoryCashFlowStatement _changeInInventory;\n\n        /// <summary>\n        /// The net change that a lender gives money or property to a borrower and the borrower agrees to return the property or repay the borrowed money, along with interest, at a predetermined date in the future.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26035\n        /// </remarks>\n        [JsonProperty(\"26035\")]\n        public ChangeInLoansCashFlowStatement ChangeInLoans => _changeInLoans ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInLoansCashFlowStatement _changeInLoans;\n\n        /// <summary>\n        /// The net change during the reporting period in the reserve account established to account for expected but unspecified losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26036\n        /// </remarks>\n        [JsonProperty(\"26036\")]\n        public ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement ChangeInLossAndLossAdjustmentExpenseReserves => _changeInLossAndLossAdjustmentExpenseReserves ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement _changeInLossAndLossAdjustmentExpenseReserves;\n\n        /// <summary>\n        /// The increase or decrease between periods of the payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26040\n        /// </remarks>\n        [JsonProperty(\"26040\")]\n        public ChangeInPayableCashFlowStatement ChangeInPayable => _changeInPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInPayableCashFlowStatement _changeInPayable;\n\n        /// <summary>\n        /// The increase or decrease between periods of the payables and accrued expenses. Accrued expenses represent expenses incurred at the end of the reporting period but not yet paid; also called accrued liabilities. The accrued liability is shown under current liabilities in the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26041\n        /// </remarks>\n        [JsonProperty(\"26041\")]\n        public ChangeInPayablesAndAccruedExpenseCashFlowStatement ChangeInPayablesAndAccruedExpense => _changeInPayablesAndAccruedExpense ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInPayablesAndAccruedExpenseCashFlowStatement _changeInPayablesAndAccruedExpense;\n\n        /// <summary>\n        /// The increase or decrease between periods of the prepaid assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26043\n        /// </remarks>\n        [JsonProperty(\"26043\")]\n        public ChangeInPrepaidAssetsCashFlowStatement ChangeInPrepaidAssets => _changeInPrepaidAssets ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInPrepaidAssetsCashFlowStatement _changeInPrepaidAssets;\n\n        /// <summary>\n        /// The increase or decrease between periods of the receivables. Receivables are amounts due to be paid to the company from clients and other.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26045\n        /// </remarks>\n        [JsonProperty(\"26045\")]\n        public ChangeInReceivablesCashFlowStatement ChangeInReceivables => _changeInReceivables ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInReceivablesCashFlowStatement _changeInReceivables;\n\n        /// <summary>\n        /// The net change during the reporting period in the amount of benefits the ceding insurer expects to recover on insurance policies ceded to other insurance entities as of the balance sheet date for all guaranteed benefit types.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26047\n        /// </remarks>\n        [JsonProperty(\"26047\")]\n        public ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses => _changeInReinsuranceRecoverableOnPaidAndUnpaidLosses ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement _changeInReinsuranceRecoverableOnPaidAndUnpaidLosses;\n\n        /// <summary>\n        /// The net cash inflow (outflow) for the net change associated with funds that are not available for withdrawal or use (such as funds held in escrow).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26049\n        /// </remarks>\n        [JsonProperty(\"26049\")]\n        public ChangeInRestrictedCashCashFlowStatement ChangeInRestrictedCash => _changeInRestrictedCash ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInRestrictedCashCashFlowStatement _changeInRestrictedCash;\n\n        /// <summary>\n        /// The net change during the reporting period associated with trading account assets. Trading account assets are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time). Unrealized holding gains and losses for trading securities are included in earnings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26050\n        /// </remarks>\n        [JsonProperty(\"26050\")]\n        public ChangeInTradingAccountSecuritiesCashFlowStatement ChangeInTradingAccountSecurities => _changeInTradingAccountSecurities ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInTradingAccountSecuritiesCashFlowStatement _changeInTradingAccountSecurities;\n\n        /// <summary>\n        /// The increase or decrease between periods of the working capital. Working Capital is the amount left to the company to finance operations and expansion after current liabilities have been covered.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26053\n        /// </remarks>\n        [JsonProperty(\"26053\")]\n        public ChangeInWorkingCapitalCashFlowStatement ChangeInWorkingCapital => _changeInWorkingCapital ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInWorkingCapitalCashFlowStatement _changeInWorkingCapital;\n\n        /// <summary>\n        /// The component of income tax expense for the period representing the net change in the entities deferred tax assets and liabilities pertaining to continuing operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26056\n        /// </remarks>\n        [JsonProperty(\"26056\")]\n        public DeferredIncomeTaxCashFlowStatement DeferredIncomeTax => _deferredIncomeTax ??= new(_timeProvider, _securityIdentifier);\n        private DeferredIncomeTaxCashFlowStatement _deferredIncomeTax;\n\n        /// <summary>\n        /// Future tax liability or asset, resulting from temporary differences between book (accounting) value of assets and liabilities, and their tax value. This arises due to differences between financial accounting for shareholders and tax accounting.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26057\n        /// </remarks>\n        [JsonProperty(\"26057\")]\n        public DeferredTaxCashFlowStatement DeferredTax => _deferredTax ??= new(_timeProvider, _securityIdentifier);\n        private DeferredTaxCashFlowStatement _deferredTax;\n\n        /// <summary>\n        /// Unlike depreciation and amortization, which mainly describe the deduction of expenses due to the aging of equipment and property, depletion is the actual physical reduction of natural resources by companies. For example, coalmines, oil fields and other natural resources are depleted on company accounting statements. This reduction in the quantity of resources is meant to assist in accurately identifying the value of the asset on the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26058\n        /// </remarks>\n        [JsonProperty(\"26058\")]\n        public DepletionCashFlowStatement Depletion => _depletion ??= new(_timeProvider, _securityIdentifier);\n        private DepletionCashFlowStatement _depletion;\n\n        /// <summary>\n        /// An expense recorded to allocate a tangible asset's cost over its useful life. Since it is a non-cash expense, it increases free cash flow while decreasing reported earnings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26059\n        /// </remarks>\n        [JsonProperty(\"26059\")]\n        public DepreciationCashFlowStatement Depreciation => _depreciation ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationCashFlowStatement _depreciation;\n\n        /// <summary>\n        /// The current period expense charged against earnings on long-lived, physical assets used in the normal conduct of business and not intended for resale to allocate or recognize the cost of assets over their useful lives; or to record the reduction in book value of an intangible asset over the benefit period of such asset.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26060\n        /// </remarks>\n        [JsonProperty(\"26060\")]\n        public DepreciationAndAmortizationCashFlowStatement DepreciationAndAmortization => _depreciationAndAmortization ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationAndAmortizationCashFlowStatement _depreciationAndAmortization;\n\n        /// <summary>\n        /// It is a non cash charge that represents a reduction in the value of fixed assets due to wear, age or obsolescence. This figure also includes amortization of leased property, intangibles, and goodwill, and depletion. This non-cash item is an add-back to the cash flow statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26061\n        /// </remarks>\n        [JsonProperty(\"26061\")]\n        public DepreciationAmortizationDepletionCashFlowStatement DepreciationAmortizationDepletion => _depreciationAmortizationDepletion ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationAmortizationDepletionCashFlowStatement _depreciationAmortizationDepletion;\n\n        /// <summary>\n        /// The effect of exchange rate changes on cash balances held in foreign currencies.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26063\n        /// </remarks>\n        [JsonProperty(\"26063\")]\n        public EffectOfExchangeRateChangesCashFlowStatement EffectOfExchangeRateChanges => _effectOfExchangeRateChanges ??= new(_timeProvider, _securityIdentifier);\n        private EffectOfExchangeRateChangesCashFlowStatement _effectOfExchangeRateChanges;\n\n        /// <summary>\n        /// The aggregate net change during the reporting period in moneys given as security, collateral, or margin deposits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26069\n        /// </remarks>\n        [JsonProperty(\"26069\")]\n        public IncreaseDecreaseInDepositCashFlowStatement IncreaseDecreaseInDeposit => _increaseDecreaseInDeposit ??= new(_timeProvider, _securityIdentifier);\n        private IncreaseDecreaseInDepositCashFlowStatement _increaseDecreaseInDeposit;\n\n        /// <summary>\n        /// The increase or decrease between periods of common stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26071\n        /// </remarks>\n        [JsonProperty(\"26071\")]\n        public NetCommonStockIssuanceCashFlowStatement NetCommonStockIssuance => _netCommonStockIssuance ??= new(_timeProvider, _securityIdentifier);\n        private NetCommonStockIssuanceCashFlowStatement _netCommonStockIssuance;\n\n        /// <summary>\n        /// The increase or decrease between periods of debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26072\n        /// </remarks>\n        [JsonProperty(\"26072\")]\n        public NetIssuancePaymentsOfDebtCashFlowStatement NetIssuancePaymentsOfDebt => _netIssuancePaymentsOfDebt ??= new(_timeProvider, _securityIdentifier);\n        private NetIssuancePaymentsOfDebtCashFlowStatement _netIssuancePaymentsOfDebt;\n\n        /// <summary>\n        /// The increase or decrease between periods of long term debt. Long term debt includes notes payable, bonds payable, mortgage loans, convertible debt, subordinated debt and other types of long term debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26073\n        /// </remarks>\n        [JsonProperty(\"26073\")]\n        public NetLongTermDebtIssuanceCashFlowStatement NetLongTermDebtIssuance => _netLongTermDebtIssuance ??= new(_timeProvider, _securityIdentifier);\n        private NetLongTermDebtIssuanceCashFlowStatement _netLongTermDebtIssuance;\n\n        /// <summary>\n        /// The increase or decrease between periods of preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26074\n        /// </remarks>\n        [JsonProperty(\"26074\")]\n        public NetPreferredStockIssuanceCashFlowStatement NetPreferredStockIssuance => _netPreferredStockIssuance ??= new(_timeProvider, _securityIdentifier);\n        private NetPreferredStockIssuanceCashFlowStatement _netPreferredStockIssuance;\n\n        /// <summary>\n        /// The increase or decrease between periods of short term debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26075\n        /// </remarks>\n        [JsonProperty(\"26075\")]\n        public NetShortTermDebtIssuanceCashFlowStatement NetShortTermDebtIssuance => _netShortTermDebtIssuance ??= new(_timeProvider, _securityIdentifier);\n        private NetShortTermDebtIssuanceCashFlowStatement _netShortTermDebtIssuance;\n\n        /// <summary>\n        /// The net cash from (used in) all of the entity's discontinued operating activities, excluding those of continued operations, of the reporting entity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26077\n        /// </remarks>\n        [JsonProperty(\"26077\")]\n        public NetCashFromDiscontinuedOperationsCashFlowStatement NetCashFromDiscontinuedOperations => _netCashFromDiscontinuedOperations ??= new(_timeProvider, _securityIdentifier);\n        private NetCashFromDiscontinuedOperationsCashFlowStatement _netCashFromDiscontinuedOperations;\n\n        /// <summary>\n        /// The aggregate amount of realized and unrealized gain or loss resulting from changes in exchange rates between currencies. (Excludes foreign currency transactions designated as hedges of net investment in a foreign entity and inter-company foreign currency transactions that are of a long-term nature, when the entities to the transaction are consolidated, combined, or accounted for by the equity method in the reporting entity's financial statements. For certain entities, primarily banks, which are dealers in foreign exchange, foreign currency transaction gains or losses, may be disclosed as dealer gains or losses.)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26078\n        /// </remarks>\n        [JsonProperty(\"26078\")]\n        public NetForeignCurrencyExchangeGainLossCashFlowStatement NetForeignCurrencyExchangeGainLoss => _netForeignCurrencyExchangeGainLoss ??= new(_timeProvider, _securityIdentifier);\n        private NetForeignCurrencyExchangeGainLossCashFlowStatement _netForeignCurrencyExchangeGainLoss;\n\n        /// <summary>\n        /// Revenue less expenses and taxes from the entity's ongoing operations and before income (loss) from discontinued operations, extraordinary items, impact of changes in accounting principles, minority interest, and various other reconciling adjustments; represents the starting line for Operating Cash Flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26080\n        /// </remarks>\n        [JsonProperty(\"26080\")]\n        public NetIncomeFromContinuingOperationsCashFlowStatement NetIncomeFromContinuingOperations => _netIncomeFromContinuingOperations ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeFromContinuingOperationsCashFlowStatement _netIncomeFromContinuingOperations;\n\n        /// <summary>\n        /// Payment from a bank or insurance company to the lender who lends money or property based on the agreement, along with interest, at a predetermined date in the future.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26087\n        /// </remarks>\n        [JsonProperty(\"26087\")]\n        public PaymentForLoansCashFlowStatement PaymentForLoans => _paymentForLoans ??= new(_timeProvider, _securityIdentifier);\n        private PaymentForLoansCashFlowStatement _paymentForLoans;\n\n        /// <summary>\n        /// The cash outflow to reacquire common stock during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26088\n        /// </remarks>\n        [JsonProperty(\"26088\")]\n        public CommonStockPaymentsCashFlowStatement CommonStockPayments => _commonStockPayments ??= new(_timeProvider, _securityIdentifier);\n        private CommonStockPaymentsCashFlowStatement _commonStockPayments;\n\n        /// <summary>\n        /// The cash outflow to reacquire preferred stock during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26089\n        /// </remarks>\n        [JsonProperty(\"26089\")]\n        public PreferredStockPaymentsCashFlowStatement PreferredStockPayments => _preferredStockPayments ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockPaymentsCashFlowStatement _preferredStockPayments;\n\n        /// <summary>\n        /// The cash outflow for debt initially having maturity due after one year or beyond the normal operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26090\n        /// </remarks>\n        [JsonProperty(\"26090\")]\n        public LongTermDebtPaymentsCashFlowStatement LongTermDebtPayments => _longTermDebtPayments ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtPaymentsCashFlowStatement _longTermDebtPayments;\n\n        /// <summary>\n        /// The cash outflow for a borrowing having initial term of repayment within one year or the normal operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26091\n        /// </remarks>\n        [JsonProperty(\"26091\")]\n        public ShortTermDebtPaymentsCashFlowStatement ShortTermDebtPayments => _shortTermDebtPayments ??= new(_timeProvider, _securityIdentifier);\n        private ShortTermDebtPaymentsCashFlowStatement _shortTermDebtPayments;\n\n        /// <summary>\n        /// The cash inflow from borrowing money or property for a bank or insurance company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26095\n        /// </remarks>\n        [JsonProperty(\"26095\")]\n        public ProceedsFromLoansCashFlowStatement ProceedsFromLoans => _proceedsFromLoans ??= new(_timeProvider, _securityIdentifier);\n        private ProceedsFromLoansCashFlowStatement _proceedsFromLoans;\n\n        /// <summary>\n        /// The cash inflow associated with the amount received from holders exercising their stock options.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26097\n        /// </remarks>\n        [JsonProperty(\"26097\")]\n        public ProceedsFromStockOptionExercisedCashFlowStatement ProceedsFromStockOptionExercised => _proceedsFromStockOptionExercised ??= new(_timeProvider, _securityIdentifier);\n        private ProceedsFromStockOptionExercisedCashFlowStatement _proceedsFromStockOptionExercised;\n\n        /// <summary>\n        /// The cash inflow from offering common stock, which is the additional capital contribution to the entity during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26098\n        /// </remarks>\n        [JsonProperty(\"26098\")]\n        public CommonStockIssuanceCashFlowStatement CommonStockIssuance => _commonStockIssuance ??= new(_timeProvider, _securityIdentifier);\n        private CommonStockIssuanceCashFlowStatement _commonStockIssuance;\n\n        /// <summary>\n        /// The cash inflow from a debt initially having maturity due after one year or beyond the operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26099\n        /// </remarks>\n        [JsonProperty(\"26099\")]\n        public LongTermDebtIssuanceCashFlowStatement LongTermDebtIssuance => _longTermDebtIssuance ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtIssuanceCashFlowStatement _longTermDebtIssuance;\n\n        /// <summary>\n        /// The cash inflow from offering preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26100\n        /// </remarks>\n        [JsonProperty(\"26100\")]\n        public PreferredStockIssuanceCashFlowStatement PreferredStockIssuance => _preferredStockIssuance ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockIssuanceCashFlowStatement _preferredStockIssuance;\n\n        /// <summary>\n        /// The cash inflow from a debt initially having maturity due within one year or the normal operating cycle, if longer.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26101\n        /// </remarks>\n        [JsonProperty(\"26101\")]\n        public ShortTermDebtIssuanceCashFlowStatement ShortTermDebtIssuance => _shortTermDebtIssuance ??= new(_timeProvider, _securityIdentifier);\n        private ShortTermDebtIssuanceCashFlowStatement _shortTermDebtIssuance;\n\n        /// <summary>\n        /// The net value of proceeds or payments of loans.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26103\n        /// </remarks>\n        [JsonProperty(\"26103\")]\n        public NetProceedsPaymentForLoanCashFlowStatement NetProceedsPaymentForLoan => _netProceedsPaymentForLoan ??= new(_timeProvider, _securityIdentifier);\n        private NetProceedsPaymentForLoanCashFlowStatement _netProceedsPaymentForLoan;\n\n        /// <summary>\n        /// The net change on interest-bearing deposits in other financial institutions for relatively short periods of time including, for example, certificates of deposits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26104\n        /// </remarks>\n        [JsonProperty(\"26104\")]\n        public ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement ProceedsPaymentInInterestBearingDepositsInBank => _proceedsPaymentInInterestBearingDepositsInBank ??= new(_timeProvider, _securityIdentifier);\n        private ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement _proceedsPaymentInInterestBearingDepositsInBank;\n\n        /// <summary>\n        /// The amount of capital outlays undertaken to increase, construct or improve intangible assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26108\n        /// </remarks>\n        [JsonProperty(\"26108\")]\n        public PurchaseOfIntangiblesCashFlowStatement PurchaseOfIntangibles => _purchaseOfIntangibles ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfIntangiblesCashFlowStatement _purchaseOfIntangibles;\n\n        /// <summary>\n        /// All purchases of investments, including both long term and short term.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26110\n        /// </remarks>\n        [JsonProperty(\"26110\")]\n        public PurchaseOfInvestmentCashFlowStatement PurchaseOfInvestment => _purchaseOfInvestment ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfInvestmentCashFlowStatement _purchaseOfInvestment;\n\n        /// <summary>\n        /// The amount of capital outlays undertaken to increase, construct or improve capital assets. This category includes property, plant equipment, furniture, fixed assets, buildings, and improvement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26112\n        /// </remarks>\n        [JsonProperty(\"26112\")]\n        public PurchaseOfPPECashFlowStatement PurchaseOfPPE => _purchaseOfPPE ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfPPECashFlowStatement _purchaseOfPPE;\n\n        /// <summary>\n        /// All the purchases of business including business acquisitions, investment in subsidiary; investing in affiliated companies, and join venture.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26115\n        /// </remarks>\n        [JsonProperty(\"26115\")]\n        public PurchaseOfBusinessCashFlowStatement PurchaseOfBusiness => _purchaseOfBusiness ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfBusinessCashFlowStatement _purchaseOfBusiness;\n\n        /// <summary>\n        /// The net change between Purchases/Sales of Business.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26116\n        /// </remarks>\n        [JsonProperty(\"26116\")]\n        public NetBusinessPurchaseAndSaleCashFlowStatement NetBusinessPurchaseAndSale => _netBusinessPurchaseAndSale ??= new(_timeProvider, _securityIdentifier);\n        private NetBusinessPurchaseAndSaleCashFlowStatement _netBusinessPurchaseAndSale;\n\n        /// <summary>\n        /// The net change between Purchases/Sales of Intangibles.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26117\n        /// </remarks>\n        [JsonProperty(\"26117\")]\n        public NetIntangiblesPurchaseAndSaleCashFlowStatement NetIntangiblesPurchaseAndSale => _netIntangiblesPurchaseAndSale ??= new(_timeProvider, _securityIdentifier);\n        private NetIntangiblesPurchaseAndSaleCashFlowStatement _netIntangiblesPurchaseAndSale;\n\n        /// <summary>\n        /// The net change between Purchases/Sales of Investments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26118\n        /// </remarks>\n        [JsonProperty(\"26118\")]\n        public NetInvestmentPurchaseAndSaleCashFlowStatement NetInvestmentPurchaseAndSale => _netInvestmentPurchaseAndSale ??= new(_timeProvider, _securityIdentifier);\n        private NetInvestmentPurchaseAndSaleCashFlowStatement _netInvestmentPurchaseAndSale;\n\n        /// <summary>\n        /// The net change between Purchases/Sales of PPE.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26119\n        /// </remarks>\n        [JsonProperty(\"26119\")]\n        public NetPPEPurchaseAndSaleCashFlowStatement NetPPEPurchaseAndSale => _netPPEPurchaseAndSale ??= new(_timeProvider, _securityIdentifier);\n        private NetPPEPurchaseAndSaleCashFlowStatement _netPPEPurchaseAndSale;\n\n        /// <summary>\n        /// Proceeds received from selling a business including proceeds from a subsidiary, and proceeds from an affiliated company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26123\n        /// </remarks>\n        [JsonProperty(\"26123\")]\n        public SaleOfBusinessCashFlowStatement SaleOfBusiness => _saleOfBusiness ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfBusinessCashFlowStatement _saleOfBusiness;\n\n        /// <summary>\n        /// The amount of capital inflow from the sale of all kinds of intangible assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26124\n        /// </remarks>\n        [JsonProperty(\"26124\")]\n        public SaleOfIntangiblesCashFlowStatement SaleOfIntangibles => _saleOfIntangibles ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfIntangiblesCashFlowStatement _saleOfIntangibles;\n\n        /// <summary>\n        /// Proceeds received from selling all kind of investments, including both long term and short term.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26125\n        /// </remarks>\n        [JsonProperty(\"26125\")]\n        public SaleOfInvestmentCashFlowStatement SaleOfInvestment => _saleOfInvestment ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfInvestmentCashFlowStatement _saleOfInvestment;\n\n        /// <summary>\n        /// Proceeds from selling any fixed assets such as property, plant and equipment, which also includes retirement of equipment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26127\n        /// </remarks>\n        [JsonProperty(\"26127\")]\n        public SaleOfPPECashFlowStatement SaleOfPPE => _saleOfPPE ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfPPECashFlowStatement _saleOfPPE;\n\n        /// <summary>\n        /// The increase or decrease between periods of the accounts receivables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26137\n        /// </remarks>\n        [JsonProperty(\"26137\")]\n        public ChangesInAccountReceivablesCashFlowStatement ChangesInAccountReceivables => _changesInAccountReceivables ??= new(_timeProvider, _securityIdentifier);\n        private ChangesInAccountReceivablesCashFlowStatement _changesInAccountReceivables;\n\n        /// <summary>\n        /// The component of interest expense representing the non-cash expenses charged against earnings in the period to allocate debt discount and premium, and the costs to issue debt and obtain financing over the related debt instruments. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26141\n        /// </remarks>\n        [JsonProperty(\"26141\")]\n        public AmortizationOfFinancingCostsAndDiscountsCashFlowStatement AmortizationOfFinancingCostsAndDiscounts => _amortizationOfFinancingCostsAndDiscounts ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationOfFinancingCostsAndDiscountsCashFlowStatement _amortizationOfFinancingCostsAndDiscounts;\n\n        /// <summary>\n        /// Represents amortization of the allocation of a lump sum amount to different time periods, particularly for securities, debt, loans, and other forms of financing. Does not include amortization, amortization of capital expenditure and intangible assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26142\n        /// </remarks>\n        [JsonProperty(\"26142\")]\n        public AmortizationOfSecuritiesCashFlowStatement AmortizationOfSecurities => _amortizationOfSecurities ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationOfSecuritiesCashFlowStatement _amortizationOfSecurities;\n\n        /// <summary>\n        /// The charge against earnings resulting from the aggregate write down of all assets from their carrying value to their fair value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26143\n        /// </remarks>\n        [JsonProperty(\"26143\")]\n        public AssetImpairmentChargeCashFlowStatement AssetImpairmentCharge => _assetImpairmentCharge ??= new(_timeProvider, _securityIdentifier);\n        private AssetImpairmentChargeCashFlowStatement _assetImpairmentCharge;\n\n        /// <summary>\n        /// The increase or decrease between periods of the dividend payables.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26144\n        /// </remarks>\n        [JsonProperty(\"26144\")]\n        public ChangeInDividendPayableCashFlowStatement ChangeInDividendPayable => _changeInDividendPayable ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInDividendPayableCashFlowStatement _changeInDividendPayable;\n\n        /// <summary>\n        /// The net change during the reporting period in the value of expenditures made during the current reporting period for benefits that will be received over a period of years. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26145\n        /// </remarks>\n        [JsonProperty(\"26145\")]\n        public ChangeInDeferredChargesCashFlowStatement ChangeInDeferredCharges => _changeInDeferredCharges ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInDeferredChargesCashFlowStatement _changeInDeferredCharges;\n\n        /// <summary>\n        /// The increase or decrease between periods of the Other Current Assets. This category typically includes prepayments, deferred charges, and amounts (other than trade accounts) due from parents and subsidiaries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26146\n        /// </remarks>\n        [JsonProperty(\"26146\")]\n        public ChangeInOtherCurrentAssetsCashFlowStatement ChangeInOtherCurrentAssets => _changeInOtherCurrentAssets ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInOtherCurrentAssetsCashFlowStatement _changeInOtherCurrentAssets;\n\n        /// <summary>\n        /// The increase or decrease between periods of the Other Current liabilities. Other Current liabilities is a balance sheet entry used by companies to group together current liabilities that are not assigned to common liabilities such as debt obligations or accounts payable.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26147\n        /// </remarks>\n        [JsonProperty(\"26147\")]\n        public ChangeInOtherCurrentLiabilitiesCashFlowStatement ChangeInOtherCurrentLiabilities => _changeInOtherCurrentLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInOtherCurrentLiabilitiesCashFlowStatement _changeInOtherCurrentLiabilities;\n\n        /// <summary>\n        /// The increase or decrease between periods of the other working capital.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26148\n        /// </remarks>\n        [JsonProperty(\"26148\")]\n        public ChangeInOtherWorkingCapitalCashFlowStatement ChangeInOtherWorkingCapital => _changeInOtherWorkingCapital ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInOtherWorkingCapitalCashFlowStatement _changeInOtherWorkingCapital;\n\n        /// <summary>\n        /// The change during the period in the unearned portion of premiums written, excluding the portion amortized into income. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26152\n        /// </remarks>\n        [JsonProperty(\"26152\")]\n        public ChangeInUnearnedPremiumsCashFlowStatement ChangeInUnearnedPremiums => _changeInUnearnedPremiums ??= new(_timeProvider, _securityIdentifier);\n        private ChangeInUnearnedPremiumsCashFlowStatement _changeInUnearnedPremiums;\n\n        /// <summary>\n        /// The cash outflow from the distribution of an entity's earnings in the form of dividends to common shareholders.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26154\n        /// </remarks>\n        [JsonProperty(\"26154\")]\n        public CommonStockDividendPaidCashFlowStatement CommonStockDividendPaid => _commonStockDividendPaid ??= new(_timeProvider, _securityIdentifier);\n        private CommonStockDividendPaidCashFlowStatement _commonStockDividendPaid;\n\n        /// <summary>\n        /// This item represents the entity's proportionate share for the period of the net income (loss) of its investee (such as unconsolidated subsidiaries and joint ventures) to which the equity method of accounting is applied. The amount typically reflects adjustments.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26155\n        /// </remarks>\n        [JsonProperty(\"26155\")]\n        public EarningsLossesFromEquityInvestmentsCashFlowStatement EarningsLossesFromEquityInvestments => _earningsLossesFromEquityInvestments ??= new(_timeProvider, _securityIdentifier);\n        private EarningsLossesFromEquityInvestmentsCashFlowStatement _earningsLossesFromEquityInvestments;\n\n        /// <summary>\n        /// Reductions in the entity's income taxes that arise when compensation cost (from non-qualified share-based compensation) recognized on the entities tax return exceeds compensation cost from share-based compensation recognized in financial statements. This element reduces net cash provided by operating activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26156\n        /// </remarks>\n        [JsonProperty(\"26156\")]\n        public ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement ExcessTaxBenefitFromStockBasedCompensation => _excessTaxBenefitFromStockBasedCompensation ??= new(_timeProvider, _securityIdentifier);\n        private ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement _excessTaxBenefitFromStockBasedCompensation;\n\n        /// <summary>\n        /// This item represents the net total realized gain (loss) included in earnings for the period as a result of selling or holding marketable securities categorized as trading, available-for-sale, or held-to-maturity, including the unrealized holding gain or loss of held-to- maturity securities transferred to the trading security category and the cumulative unrealized gain or loss which was included in other comprehensive income (a separate component of shareholders' equity) for available-for-sale securities transferred to trading securities during the period. Additionally, this item would include any losses recognized for other than temporary impairments of the subject investments in debt and equity securities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26158\n        /// </remarks>\n        [JsonProperty(\"26158\")]\n        public GainLossOnInvestmentSecuritiesCashFlowStatement GainLossOnInvestmentSecurities => _gainLossOnInvestmentSecurities ??= new(_timeProvider, _securityIdentifier);\n        private GainLossOnInvestmentSecuritiesCashFlowStatement _gainLossOnInvestmentSecurities;\n\n        /// <summary>\n        /// The difference between the sale price or salvage price and the book value of an asset that was sold or retired during the reporting period. This element refers to the gain (loss) and not to the cash proceeds of the business. This element is a non-cash adjustment to net income when calculating net cash generated by operating activities using the indirect method.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26159\n        /// </remarks>\n        [JsonProperty(\"26159\")]\n        public GainLossOnSaleOfBusinessCashFlowStatement GainLossOnSaleOfBusiness => _gainLossOnSaleOfBusiness ??= new(_timeProvider, _securityIdentifier);\n        private GainLossOnSaleOfBusinessCashFlowStatement _gainLossOnSaleOfBusiness;\n\n        /// <summary>\n        /// The difference between the sale price or salvage price and the book value of the property, plant and equipment that was sold or retired during the reporting period. Includes the amount received from selling any fixed assets such as property, plant and equipment. Usually this section also includes any retirement of equipment. Such as Sale of business segments; Sale of credit and receivables; Property disposition; Proceeds from sale or disposition of business or investment; Decrease in excess of purchase price over acquired net assets; Abandoned project (expenditures) credit; Allowances for other funds during construction.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26160\n        /// </remarks>\n        [JsonProperty(\"26160\")]\n        public GainLossOnSaleOfPPECashFlowStatement GainLossOnSaleOfPPE => _gainLossOnSaleOfPPE ??= new(_timeProvider, _securityIdentifier);\n        private GainLossOnSaleOfPPECashFlowStatement _gainLossOnSaleOfPPE;\n\n        /// <summary>\n        /// An expense reported in the income statement and needs to be removed from net income to arrive at cash provided by (used in) operations to the extent that such interest has not been paid. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26161\n        /// </remarks>\n        [JsonProperty(\"26161\")]\n        public InterestCreditedOnPolicyholderDepositsCashFlowStatement InterestCreditedOnPolicyholderDeposits => _interestCreditedOnPolicyholderDeposits ??= new(_timeProvider, _securityIdentifier);\n        private InterestCreditedOnPolicyholderDepositsCashFlowStatement _interestCreditedOnPolicyholderDeposits;\n\n        /// <summary>\n        /// The net cash from (used in) all of the entity's discontinued operating activities, excluding those of continued operations, of the reporting entity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26162\n        /// </remarks>\n        [JsonProperty(\"26162\")]\n        public CashFromDiscontinuedOperatingActivitiesCashFlowStatement CashFromDiscontinuedOperatingActivities => _cashFromDiscontinuedOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashFromDiscontinuedOperatingActivitiesCashFlowStatement _cashFromDiscontinuedOperatingActivities;\n\n        /// <summary>\n        /// The gain or loss from the entity's ongoing operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26163\n        /// </remarks>\n        [JsonProperty(\"26163\")]\n        public OperatingGainsLossesCashFlowStatement OperatingGainsLosses => _operatingGainsLosses ??= new(_timeProvider, _securityIdentifier);\n        private OperatingGainsLossesCashFlowStatement _operatingGainsLosses;\n\n        /// <summary>\n        /// Miscellaneous charges incurred due to Financing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26164\n        /// </remarks>\n        [JsonProperty(\"26164\")]\n        public NetOtherFinancingChargesCashFlowStatement NetOtherFinancingCharges => _netOtherFinancingCharges ??= new(_timeProvider, _securityIdentifier);\n        private NetOtherFinancingChargesCashFlowStatement _netOtherFinancingCharges;\n\n        /// <summary>\n        /// Miscellaneous charges incurred due to Investing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26165\n        /// </remarks>\n        [JsonProperty(\"26165\")]\n        public NetOtherInvestingChangesCashFlowStatement NetOtherInvestingChanges => _netOtherInvestingChanges ??= new(_timeProvider, _securityIdentifier);\n        private NetOtherInvestingChangesCashFlowStatement _netOtherInvestingChanges;\n\n        /// <summary>\n        /// Items which adjusted back from net income but without real cash outflow or inflow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26166\n        /// </remarks>\n        [JsonProperty(\"26166\")]\n        public OtherNonCashItemsCashFlowStatement OtherNonCashItems => _otherNonCashItems ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonCashItemsCashFlowStatement _otherNonCashItems;\n\n        /// <summary>\n        /// The amount of pension and other (such as medical, dental and life insurance) postretirement benefit costs recognized during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26167\n        /// </remarks>\n        [JsonProperty(\"26167\")]\n        public PensionAndEmployeeBenefitExpenseCashFlowStatement PensionAndEmployeeBenefitExpense => _pensionAndEmployeeBenefitExpense ??= new(_timeProvider, _securityIdentifier);\n        private PensionAndEmployeeBenefitExpenseCashFlowStatement _pensionAndEmployeeBenefitExpense;\n\n        /// <summary>\n        /// Pay for the amount of dividends declared or paid in the period to preferred shareholders or the amount for which the obligation to pay them dividends rose in the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26168\n        /// </remarks>\n        [JsonProperty(\"26168\")]\n        public PreferredStockDividendPaidCashFlowStatement PreferredStockDividendPaid => _preferredStockDividendPaid ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockDividendPaidCashFlowStatement _preferredStockDividendPaid;\n\n        /// <summary>\n        /// The aggregate amount change of (1) the lending of excess federal funds to another commercial bank requiring such for its legal reserve requirements and (2) securities purchased under agreements to resell. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26169\n        /// </remarks>\n        [JsonProperty(\"26169\")]\n        public ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell => _proceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell ??= new(_timeProvider, _securityIdentifier);\n        private ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement _proceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell;\n\n        /// <summary>\n        /// The sum of the periodic provision charged to earnings, based on an assessment of uncollectible from the counterparty on account of loan, lease or other credit losses, to reduce these accounts to the amount that approximates their net realizable value. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26170\n        /// </remarks>\n        [JsonProperty(\"26170\")]\n        public ProvisionForLoanLeaseAndOtherLossesCashFlowStatement ProvisionForLoanLeaseAndOtherLosses => _provisionForLoanLeaseAndOtherLosses ??= new(_timeProvider, _securityIdentifier);\n        private ProvisionForLoanLeaseAndOtherLossesCashFlowStatement _provisionForLoanLeaseAndOtherLosses;\n\n        /// <summary>\n        /// The gains and losses included in earnings that represent the difference between the sale price and the carrying value of loans and leases that were sold during the reporting period. This element refers to the gain (loss) and not to the cash proceeds of the sales. This element is a non-cash adjustment to net income when calculating net cash generated by operating activities using the indirect method. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26171\n        /// </remarks>\n        [JsonProperty(\"26171\")]\n        public RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement RealizedGainLossOnSaleOfLoansAndLease => _realizedGainLossOnSaleOfLoansAndLease ??= new(_timeProvider, _securityIdentifier);\n        private RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement _realizedGainLossOnSaleOfLoansAndLease;\n\n        /// <summary>\n        /// Value of stock issued during the period as a result of any share-based compensation plan other than an employee stock ownership plan (ESOP).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26172\n        /// </remarks>\n        [JsonProperty(\"26172\")]\n        public StockBasedCompensationCashFlowStatement StockBasedCompensation => _stockBasedCompensation ??= new(_timeProvider, _securityIdentifier);\n        private StockBasedCompensationCashFlowStatement _stockBasedCompensation;\n\n        /// <summary>\n        /// The increases (decreases) in the market value of unsold securities whose gains (losses) were included in earnings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26173\n        /// </remarks>\n        [JsonProperty(\"26173\")]\n        public UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement UnrealizedGainLossOnInvestmentSecurities => _unrealizedGainLossOnInvestmentSecurities ??= new(_timeProvider, _securityIdentifier);\n        private UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement _unrealizedGainLossOnInvestmentSecurities;\n\n        /// <summary>\n        /// The gross gains and losses on derivatives. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26174\n        /// </remarks>\n        [JsonProperty(\"26174\")]\n        public UnrealizedGainsLossesOnDerivativesCashFlowStatement UnrealizedGainsLossesOnDerivatives => _unrealizedGainsLossesOnDerivatives ??= new(_timeProvider, _securityIdentifier);\n        private UnrealizedGainsLossesOnDerivativesCashFlowStatement _unrealizedGainsLossesOnDerivatives;\n\n        /// <summary>\n        /// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26175\n        /// </remarks>\n        [JsonProperty(\"26175\")]\n        public AmortizationOfIntangiblesCashFlowStatement AmortizationOfIntangibles => _amortizationOfIntangibles ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationOfIntangiblesCashFlowStatement _amortizationOfIntangibles;\n\n        /// <summary>\n        /// The amount of cash paid during the current period to foreign, federal state and local authorities as taxes on income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26179\n        /// </remarks>\n        [JsonProperty(\"26179\")]\n        public IncomeTaxPaidSupplementalDataCashFlowStatement IncomeTaxPaidSupplementalData => _incomeTaxPaidSupplementalData ??= new(_timeProvider, _securityIdentifier);\n        private IncomeTaxPaidSupplementalDataCashFlowStatement _incomeTaxPaidSupplementalData;\n\n        /// <summary>\n        /// The amount of cash paid during the current period for interest owed on money borrowed; including amount of interest capitalized.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26180\n        /// </remarks>\n        [JsonProperty(\"26180\")]\n        public InterestPaidSupplementalDataCashFlowStatement InterestPaidSupplementalData => _interestPaidSupplementalData ??= new(_timeProvider, _securityIdentifier);\n        private InterestPaidSupplementalDataCashFlowStatement _interestPaidSupplementalData;\n\n        /// <summary>\n        /// The cash inflow from offering common stock, which is the additional capital contribution to the entity during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26181\n        /// </remarks>\n        [JsonProperty(\"26181\")]\n        public IssuanceOfCapitalStockCashFlowStatement IssuanceOfCapitalStock => _issuanceOfCapitalStock ??= new(_timeProvider, _securityIdentifier);\n        private IssuanceOfCapitalStockCashFlowStatement _issuanceOfCapitalStock;\n\n        /// <summary>\n        /// The cash inflow due to an increase in long term debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26182\n        /// </remarks>\n        [JsonProperty(\"26182\")]\n        public IssuanceOfDebtCashFlowStatement IssuanceOfDebt => _issuanceOfDebt ??= new(_timeProvider, _securityIdentifier);\n        private IssuanceOfDebtCashFlowStatement _issuanceOfDebt;\n\n        /// <summary>\n        /// Payments to Settle Long Term Debt plus Payments to Settle Short Term Debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26183\n        /// </remarks>\n        [JsonProperty(\"26183\")]\n        public RepaymentOfDebtCashFlowStatement RepaymentOfDebt => _repaymentOfDebt ??= new(_timeProvider, _securityIdentifier);\n        private RepaymentOfDebtCashFlowStatement _repaymentOfDebt;\n\n        /// <summary>\n        /// Payments for Common Stock plus Payments for Preferred Stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26184\n        /// </remarks>\n        [JsonProperty(\"26184\")]\n        public RepurchaseOfCapitalStockCashFlowStatement RepurchaseOfCapitalStock => _repurchaseOfCapitalStock ??= new(_timeProvider, _securityIdentifier);\n        private RepurchaseOfCapitalStockCashFlowStatement _repurchaseOfCapitalStock;\n\n        /// <summary>\n        /// Cash Flow Operations minus Capital Expenditures.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26185\n        /// </remarks>\n        [JsonProperty(\"26185\")]\n        public FreeCashFlowCashFlowStatement FreeCashFlow => _freeCashFlow ??= new(_timeProvider, _securityIdentifier);\n        private FreeCashFlowCashFlowStatement _freeCashFlow;\n\n        /// <summary>\n        /// The net change on interest-bearing deposits in other financial institutions for relatively short periods of time including, for example, certificates of deposits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26188\n        /// </remarks>\n        [JsonProperty(\"26188\")]\n        public DecreaseInInterestBearingDepositsInBankCashFlowStatement DecreaseInInterestBearingDepositsInBank => _decreaseInInterestBearingDepositsInBank ??= new(_timeProvider, _securityIdentifier);\n        private DecreaseInInterestBearingDepositsInBankCashFlowStatement _decreaseInInterestBearingDepositsInBank;\n\n        /// <summary>\n        /// Increase in interest-bearing deposits in bank.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26189\n        /// </remarks>\n        [JsonProperty(\"26189\")]\n        public IncreaseInInterestBearingDepositsInBankCashFlowStatement IncreaseInInterestBearingDepositsInBank => _increaseInInterestBearingDepositsInBank ??= new(_timeProvider, _securityIdentifier);\n        private IncreaseInInterestBearingDepositsInBankCashFlowStatement _increaseInInterestBearingDepositsInBank;\n\n        /// <summary>\n        /// Interest received by the company, in the Operating Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26194\n        /// </remarks>\n        [JsonProperty(\"26194\")]\n        public InterestReceivedCFOCashFlowStatement InterestReceivedCFO => _interestReceivedCFO ??= new(_timeProvider, _securityIdentifier);\n        private InterestReceivedCFOCashFlowStatement _interestReceivedCFO;\n\n        /// <summary>\n        /// Interest paid on loans, debt or borrowings, in the Operating Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26195\n        /// </remarks>\n        [JsonProperty(\"26195\")]\n        public InterestPaidCFOCashFlowStatement InterestPaidCFO => _interestPaidCFO ??= new(_timeProvider, _securityIdentifier);\n        private InterestPaidCFOCashFlowStatement _interestPaidCFO;\n\n        /// <summary>\n        /// Purchase of subsidiaries or interest in subsidiaries (investments 51% and above).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26196\n        /// </remarks>\n        [JsonProperty(\"26196\")]\n        public PurchaseOfSubsidiariesCashFlowStatement PurchaseOfSubsidiaries => _purchaseOfSubsidiaries ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfSubsidiariesCashFlowStatement _purchaseOfSubsidiaries;\n\n        /// <summary>\n        /// Purchase of joint venture/associates (investment below 50%).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26197\n        /// </remarks>\n        [JsonProperty(\"26197\")]\n        public PurchaseOfJointVentureAssociateCashFlowStatement PurchaseOfJointVentureAssociate => _purchaseOfJointVentureAssociate ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfJointVentureAssociateCashFlowStatement _purchaseOfJointVentureAssociate;\n\n        /// <summary>\n        /// Cash inflow from the disposal of any subsidiaries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26198\n        /// </remarks>\n        [JsonProperty(\"26198\")]\n        public SaleOfSubsidiariesCashFlowStatement SaleOfSubsidiaries => _saleOfSubsidiaries ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfSubsidiariesCashFlowStatement _saleOfSubsidiaries;\n\n        /// <summary>\n        /// Cash inflow from the disposal of joint venture/associates (investment below 50%).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26199\n        /// </remarks>\n        [JsonProperty(\"26199\")]\n        public SaleOfJointVentureAssociateCashFlowStatement SaleOfJointVentureAssociate => _saleOfJointVentureAssociate ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfJointVentureAssociateCashFlowStatement _saleOfJointVentureAssociate;\n\n        /// <summary>\n        /// Change in cash flow resulting from increase/decrease in lease financing.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26200\n        /// </remarks>\n        [JsonProperty(\"26200\")]\n        public IncreaseDecreaseInLeaseFinancingCashFlowStatement IncreaseDecreaseInLeaseFinancing => _increaseDecreaseInLeaseFinancing ??= new(_timeProvider, _securityIdentifier);\n        private IncreaseDecreaseInLeaseFinancingCashFlowStatement _increaseDecreaseInLeaseFinancing;\n\n        /// <summary>\n        /// The cash inflow from increase in lease financing.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26201\n        /// </remarks>\n        [JsonProperty(\"26201\")]\n        public IncreaseInLeaseFinancingCashFlowStatement IncreaseInLeaseFinancing => _increaseInLeaseFinancing ??= new(_timeProvider, _securityIdentifier);\n        private IncreaseInLeaseFinancingCashFlowStatement _increaseInLeaseFinancing;\n\n        /// <summary>\n        /// The cash outflow to repay lease financing during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26202\n        /// </remarks>\n        [JsonProperty(\"26202\")]\n        public RepaymentInLeaseFinancingCashFlowStatement RepaymentInLeaseFinancing => _repaymentInLeaseFinancing ??= new(_timeProvider, _securityIdentifier);\n        private RepaymentInLeaseFinancingCashFlowStatement _repaymentInLeaseFinancing;\n\n        /// <summary>\n        /// A non-cash adjustment for share of associates' income in respect of operating activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26203\n        /// </remarks>\n        [JsonProperty(\"26203\")]\n        public ShareOfAssociatesCashFlowStatement ShareOfAssociates => _shareOfAssociates ??= new(_timeProvider, _securityIdentifier);\n        private ShareOfAssociatesCashFlowStatement _shareOfAssociates;\n\n        /// <summary>\n        /// The difference between the sale price or salvage price and the book value of an asset that was sold or retired during the reporting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26204\n        /// </remarks>\n        [JsonProperty(\"26204\")]\n        public ProfitOnDisposalsCashFlowStatement ProfitOnDisposals => _profitOnDisposals ??= new(_timeProvider, _securityIdentifier);\n        private ProfitOnDisposalsCashFlowStatement _profitOnDisposals;\n\n        /// <summary>\n        /// A non-cash adjustment relating to restructuring costs.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26205\n        /// </remarks>\n        [JsonProperty(\"26205\")]\n        public ReorganizationOtherCostsCashFlowStatement ReorganizationOtherCosts => _reorganizationOtherCosts ??= new(_timeProvider, _securityIdentifier);\n        private ReorganizationOtherCostsCashFlowStatement _reorganizationOtherCosts;\n\n        /// <summary>\n        /// Adjustments due to net loans to/from outsiders in the Investing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26207\n        /// </remarks>\n        [JsonProperty(\"26207\")]\n        public NetOutwardLoansCashFlowStatement NetOutwardLoans => _netOutwardLoans ??= new(_timeProvider, _securityIdentifier);\n        private NetOutwardLoansCashFlowStatement _netOutwardLoans;\n\n        /// <summary>\n        /// Cost associated with issuance of debt/equity capital in the Financing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26208\n        /// </remarks>\n        [JsonProperty(\"26208\")]\n        public IssueExpensesCashFlowStatement IssueExpenses => _issueExpenses ??= new(_timeProvider, _securityIdentifier);\n        private IssueExpensesCashFlowStatement _issueExpenses;\n\n        /// <summary>\n        /// The increase or decrease between periods of the deposits by banks and customers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26219\n        /// </remarks>\n        [JsonProperty(\"26219\")]\n        public ChangeinDepositsbyBanksandCustomersCashFlowStatement ChangeinDepositsbyBanksandCustomers => _changeinDepositsbyBanksandCustomers ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinDepositsbyBanksandCustomersCashFlowStatement _changeinDepositsbyBanksandCustomers;\n\n        /// <summary>\n        /// The net cash from (used in) all of the entity's operating activities, including those of discontinued operations, of the reporting entity under the direct method.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26220\n        /// </remarks>\n        [JsonProperty(\"26220\")]\n        public CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement CashFlowsfromusedinOperatingActivitiesDirect => _cashFlowsfromusedinOperatingActivitiesDirect ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement _cashFlowsfromusedinOperatingActivitiesDirect;\n\n        /// <summary>\n        /// Sum of total cash receipts in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26221\n        /// </remarks>\n        [JsonProperty(\"26221\")]\n        public ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement ClassesofCashReceiptsfromOperatingActivities => _classesofCashReceiptsfromOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement _classesofCashReceiptsfromOperatingActivities;\n\n        /// <summary>\n        /// Other cash receipts for the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26222\n        /// </remarks>\n        [JsonProperty(\"26222\")]\n        public OtherCashReceiptsfromOperatingActivitiesCashFlowStatement OtherCashReceiptsfromOperatingActivities => _otherCashReceiptsfromOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private OtherCashReceiptsfromOperatingActivitiesCashFlowStatement _otherCashReceiptsfromOperatingActivities;\n\n        /// <summary>\n        /// Sum of total cash payment in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26223\n        /// </remarks>\n        [JsonProperty(\"26223\")]\n        public ClassesofCashPaymentsCashFlowStatement ClassesofCashPayments => _classesofCashPayments ??= new(_timeProvider, _securityIdentifier);\n        private ClassesofCashPaymentsCashFlowStatement _classesofCashPayments;\n\n        /// <summary>\n        /// Cash paid to suppliers when purchasing goods or services by the company, in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26224\n        /// </remarks>\n        [JsonProperty(\"26224\")]\n        public PaymentstoSuppliersforGoodsandServicesCashFlowStatement PaymentstoSuppliersforGoodsandServices => _paymentstoSuppliersforGoodsandServices ??= new(_timeProvider, _securityIdentifier);\n        private PaymentstoSuppliersforGoodsandServicesCashFlowStatement _paymentstoSuppliersforGoodsandServices;\n\n        /// <summary>\n        /// Cash paid in a form of salaries or other benefits to employees of the company, in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26226\n        /// </remarks>\n        [JsonProperty(\"26226\")]\n        public PaymentsonBehalfofEmployeesCashFlowStatement PaymentsonBehalfofEmployees => _paymentsonBehalfofEmployees ??= new(_timeProvider, _securityIdentifier);\n        private PaymentsonBehalfofEmployeesCashFlowStatement _paymentsonBehalfofEmployees;\n\n        /// <summary>\n        /// Other cash payments for the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26228\n        /// </remarks>\n        [JsonProperty(\"26228\")]\n        public OtherCashPaymentsfromOperatingActivitiesCashFlowStatement OtherCashPaymentsfromOperatingActivities => _otherCashPaymentsfromOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private OtherCashPaymentsfromOperatingActivitiesCashFlowStatement _otherCashPaymentsfromOperatingActivities;\n\n        /// <summary>\n        /// Dividend paid to the investors, for the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26229\n        /// </remarks>\n        [JsonProperty(\"26229\")]\n        public DividendsPaidDirectCashFlowStatement DividendsPaidDirect => _dividendsPaidDirect ??= new(_timeProvider, _securityIdentifier);\n        private DividendsPaidDirectCashFlowStatement _dividendsPaidDirect;\n\n        /// <summary>\n        /// Dividend received on the investment, for the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26230\n        /// </remarks>\n        [JsonProperty(\"26230\")]\n        public DividendsReceivedDirectCashFlowStatement DividendsReceivedDirect => _dividendsReceivedDirect ??= new(_timeProvider, _securityIdentifier);\n        private DividendsReceivedDirectCashFlowStatement _dividendsReceivedDirect;\n\n        /// <summary>\n        /// Interest paid on loans, debt or borrowings, in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26231\n        /// </remarks>\n        [JsonProperty(\"26231\")]\n        public InterestPaidDirectCashFlowStatement InterestPaidDirect => _interestPaidDirect ??= new(_timeProvider, _securityIdentifier);\n        private InterestPaidDirectCashFlowStatement _interestPaidDirect;\n\n        /// <summary>\n        /// Interest received by the company, in the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26232\n        /// </remarks>\n        [JsonProperty(\"26232\")]\n        public InterestReceivedDirectCashFlowStatement InterestReceivedDirect => _interestReceivedDirect ??= new(_timeProvider, _securityIdentifier);\n        private InterestReceivedDirectCashFlowStatement _interestReceivedDirect;\n\n        /// <summary>\n        /// Tax paid/refund related to operating activities, for the direct cash flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26233\n        /// </remarks>\n        [JsonProperty(\"26233\")]\n        public TaxesRefundPaidDirectCashFlowStatement TaxesRefundPaidDirect => _taxesRefundPaidDirect ??= new(_timeProvider, _securityIdentifier);\n        private TaxesRefundPaidDirectCashFlowStatement _taxesRefundPaidDirect;\n\n        /// <summary>\n        /// Sum of all adjustments back from net income but without real cash outflow or inflow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26234\n        /// </remarks>\n        [JsonProperty(\"26234\")]\n        public TotalAdjustmentsforNonCashItemsCashFlowStatement TotalAdjustmentsforNonCashItems => _totalAdjustmentsforNonCashItems ??= new(_timeProvider, _securityIdentifier);\n        private TotalAdjustmentsforNonCashItemsCashFlowStatement _totalAdjustmentsforNonCashItems;\n\n        /// <summary>\n        /// The difference between the future net cash flows expected to be received from the asset and its book value, recognized in the Income Statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26235\n        /// </remarks>\n        [JsonProperty(\"26235\")]\n        public ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement ImpairmentLossReversalRecognizedinProfitorLoss => _impairmentLossReversalRecognizedinProfitorLoss ??= new(_timeProvider, _securityIdentifier);\n        private ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement _impairmentLossReversalRecognizedinProfitorLoss;\n\n        /// <summary>\n        /// Dividend paid to the investors, in the Operating Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26238\n        /// </remarks>\n        [JsonProperty(\"26238\")]\n        public DividendPaidCFOCashFlowStatement DividendPaidCFO => _dividendPaidCFO ??= new(_timeProvider, _securityIdentifier);\n        private DividendPaidCFOCashFlowStatement _dividendPaidCFO;\n\n        /// <summary>\n        /// Dividend received on investment, in the Operating Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26239\n        /// </remarks>\n        [JsonProperty(\"26239\")]\n        public DividendReceivedCFOCashFlowStatement DividendReceivedCFO => _dividendReceivedCFO ??= new(_timeProvider, _securityIdentifier);\n        private DividendReceivedCFOCashFlowStatement _dividendReceivedCFO;\n\n        /// <summary>\n        /// Total tax paid or received on operating activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26240\n        /// </remarks>\n        [JsonProperty(\"26240\")]\n        public TaxesRefundPaidCashFlowStatement TaxesRefundPaid => _taxesRefundPaid ??= new(_timeProvider, _securityIdentifier);\n        private TaxesRefundPaidCashFlowStatement _taxesRefundPaid;\n\n        /// <summary>\n        /// Any other cash inflows or outflows in the Operating Cash Flow section, not accounted for in the other specified items.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26241\n        /// </remarks>\n        [JsonProperty(\"26241\")]\n        public OtherOperatingInflowsOutflowsofCashCashFlowStatement OtherOperatingInflowsOutflowsofCash => _otherOperatingInflowsOutflowsofCash ??= new(_timeProvider, _securityIdentifier);\n        private OtherOperatingInflowsOutflowsofCashCashFlowStatement _otherOperatingInflowsOutflowsofCash;\n\n        /// <summary>\n        /// Cash outlay for cash advances and loans made to other parties.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26243\n        /// </remarks>\n        [JsonProperty(\"26243\")]\n        public CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement CashAdvancesandLoansMadetoOtherParties => _cashAdvancesandLoansMadetoOtherParties ??= new(_timeProvider, _securityIdentifier);\n        private CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement _cashAdvancesandLoansMadetoOtherParties;\n\n        /// <summary>\n        /// Cash received from the repayment of advances and loans made to other parties, in the Investing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26244\n        /// </remarks>\n        [JsonProperty(\"26244\")]\n        public CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties => _cashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement _cashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties;\n\n        /// <summary>\n        /// Dividend received on investment, in the Investing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26246\n        /// </remarks>\n        [JsonProperty(\"26246\")]\n        public DividendsReceivedCFICashFlowStatement DividendsReceivedCFI => _dividendsReceivedCFI ??= new(_timeProvider, _securityIdentifier);\n        private DividendsReceivedCFICashFlowStatement _dividendsReceivedCFI;\n\n        /// <summary>\n        /// Interest received by the company, in the Investing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26247\n        /// </remarks>\n        [JsonProperty(\"26247\")]\n        public InterestReceivedCFICashFlowStatement InterestReceivedCFI => _interestReceivedCFI ??= new(_timeProvider, _securityIdentifier);\n        private InterestReceivedCFICashFlowStatement _interestReceivedCFI;\n\n        /// <summary>\n        /// Interest paid on loans, debt or borrowings, in the Financing Cash Flow section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26253\n        /// </remarks>\n        [JsonProperty(\"26253\")]\n        public InterestPaidCFFCashFlowStatement InterestPaidCFF => _interestPaidCFF ??= new(_timeProvider, _securityIdentifier);\n        private InterestPaidCFFCashFlowStatement _interestPaidCFF;\n\n        /// <summary>\n        /// The increase or decrease between periods in the amount of outstanding money owed by a customer for goods or services provided by the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26255\n        /// </remarks>\n        [JsonProperty(\"26255\")]\n        public ChangeinAccruedIncomeCashFlowStatement ChangeinAccruedIncome => _changeinAccruedIncome ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinAccruedIncomeCashFlowStatement _changeinAccruedIncome;\n\n        /// <summary>\n        /// The increase or decrease between periods of the financial assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26258\n        /// </remarks>\n        [JsonProperty(\"26258\")]\n        public ChangeinFinancialAssetsCashFlowStatement ChangeinFinancialAssets => _changeinFinancialAssets ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinFinancialAssetsCashFlowStatement _changeinFinancialAssets;\n\n        /// <summary>\n        /// The increase or decrease between periods of the advances from central banks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26259\n        /// </remarks>\n        [JsonProperty(\"26259\")]\n        public ChangeinAdvancesfromCentralBanksCashFlowStatement ChangeinAdvancesfromCentralBanks => _changeinAdvancesfromCentralBanks ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinAdvancesfromCentralBanksCashFlowStatement _changeinAdvancesfromCentralBanks;\n\n        /// <summary>\n        /// The increase or decrease between periods of the financial liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26260\n        /// </remarks>\n        [JsonProperty(\"26260\")]\n        public ChangeinFinancialLiabilitiesCashFlowStatement ChangeinFinancialLiabilities => _changeinFinancialLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinFinancialLiabilitiesCashFlowStatement _changeinFinancialLiabilities;\n\n        /// <summary>\n        /// The increase or decrease between periods of the contract assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26261\n        /// </remarks>\n        [JsonProperty(\"26261\")]\n        public ChangeinInsuranceContractAssetsCashFlowStatement ChangeinInsuranceContractAssets => _changeinInsuranceContractAssets ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInsuranceContractAssetsCashFlowStatement _changeinInsuranceContractAssets;\n\n        /// <summary>\n        /// The increase or decrease between periods of the reinsurance receivable.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26262\n        /// </remarks>\n        [JsonProperty(\"26262\")]\n        public ChangeinReinsuranceReceivablesCashFlowStatement ChangeinReinsuranceReceivables => _changeinReinsuranceReceivables ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinReinsuranceReceivablesCashFlowStatement _changeinReinsuranceReceivables;\n\n        /// <summary>\n        /// The increase or decrease between periods of the deferred acquisition costs.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26263\n        /// </remarks>\n        [JsonProperty(\"26263\")]\n        public ChangeinDeferredAcquisitionCostsNetCashFlowStatement ChangeinDeferredAcquisitionCostsNet => _changeinDeferredAcquisitionCostsNet ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinDeferredAcquisitionCostsNetCashFlowStatement _changeinDeferredAcquisitionCostsNet;\n\n        /// <summary>\n        /// The increase or decrease between periods of the insurance funds.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26264\n        /// </remarks>\n        [JsonProperty(\"26264\")]\n        public ChangeinInsuranceFundsCashFlowStatement ChangeinInsuranceFunds => _changeinInsuranceFunds ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInsuranceFundsCashFlowStatement _changeinInsuranceFunds;\n\n        /// <summary>\n        /// The increase or decrease between periods of the investment contract liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26266\n        /// </remarks>\n        [JsonProperty(\"26266\")]\n        public ChangeinInvestmentContractLiabilitiesCashFlowStatement ChangeinInvestmentContractLiabilities => _changeinInvestmentContractLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInvestmentContractLiabilitiesCashFlowStatement _changeinInvestmentContractLiabilities;\n\n        /// <summary>\n        /// The increase or decrease between periods of the insurance contract liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26267\n        /// </remarks>\n        [JsonProperty(\"26267\")]\n        public ChangeinInsuranceContractLiabilitiesCashFlowStatement ChangeinInsuranceContractLiabilities => _changeinInsuranceContractLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInsuranceContractLiabilitiesCashFlowStatement _changeinInsuranceContractLiabilities;\n\n        /// <summary>\n        /// A non-cash adjustment for total provision and write off on assets &amp; liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26269\n        /// </remarks>\n        [JsonProperty(\"26269\")]\n        public ProvisionandWriteOffofAssetsCashFlowStatement ProvisionandWriteOffofAssets => _provisionandWriteOffofAssets ??= new(_timeProvider, _securityIdentifier);\n        private ProvisionandWriteOffofAssetsCashFlowStatement _provisionandWriteOffofAssets;\n\n        /// <summary>\n        /// Payment received from customers in the Direct Cash Flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26270\n        /// </remarks>\n        [JsonProperty(\"26270\")]\n        public ReceiptsfromCustomersCashFlowStatement ReceiptsfromCustomers => _receiptsfromCustomers ??= new(_timeProvider, _securityIdentifier);\n        private ReceiptsfromCustomersCashFlowStatement _receiptsfromCustomers;\n\n        /// <summary>\n        /// Cash received from governments in the form of grants in the Direct Cash Flow.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26271\n        /// </remarks>\n        [JsonProperty(\"26271\")]\n        public ReceiptsfromGovernmentGrantsCashFlowStatement ReceiptsfromGovernmentGrants => _receiptsfromGovernmentGrants ??= new(_timeProvider, _securityIdentifier);\n        private ReceiptsfromGovernmentGrantsCashFlowStatement _receiptsfromGovernmentGrants;\n\n        /// <summary>\n        /// Amount of net income (loss) for the period allocated to non-controlling shareholders, partners, or other equity holders in one or more of the entities included.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26272\n        /// </remarks>\n        [JsonProperty(\"26272\")]\n        public MinorityInterestCashFlowStatement MinorityInterest => _minorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private MinorityInterestCashFlowStatement _minorityInterest;\n\n        /// <summary>\n        /// Capital expenditure, capitalized software development cost, maintenance capital expenditure, etc. as reported by the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26273\n        /// </remarks>\n        [JsonProperty(\"26273\")]\n        public CapExReportedCashFlowStatement CapExReported => _capExReported ??= new(_timeProvider, _securityIdentifier);\n        private CapExReportedCashFlowStatement _capExReported;\n\n        /// <summary>\n        /// Cash received as refunds from tax authorities in operating cash flow, using the direct method\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26274\n        /// </remarks>\n        [JsonProperty(\"26274\")]\n        public CashReceiptsfromTaxRefundsCashFlowStatement CashReceiptsfromTaxRefunds => _cashReceiptsfromTaxRefunds ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromTaxRefundsCashFlowStatement _cashReceiptsfromTaxRefunds;\n\n        /// <summary>\n        /// Cash received from banks and customer deposits in operating cash flow, using the direct method. This item is usually only available for bank industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26276\n        /// </remarks>\n        [JsonProperty(\"26276\")]\n        public CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement CashReceiptsfromDepositsbyBanksandCustomers => _cashReceiptsfromDepositsbyBanksandCustomers ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement _cashReceiptsfromDepositsbyBanksandCustomers;\n\n        /// <summary>\n        /// Cash received from loans in operating cash flow, using the direct method. This item is usually only available for bank industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26277\n        /// </remarks>\n        [JsonProperty(\"26277\")]\n        public CashReceiptsfromLoansCashFlowStatement CashReceiptsfromLoans => _cashReceiptsfromLoans ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromLoansCashFlowStatement _cashReceiptsfromLoans;\n\n        /// <summary>\n        /// Cash received from the trading of securities in operating cash flow, using the direct method. This item is usually only available for bank and insurance industries\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26278\n        /// </remarks>\n        [JsonProperty(\"26278\")]\n        public CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement CashReceiptsfromSecuritiesRelatedActivities => _cashReceiptsfromSecuritiesRelatedActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement _cashReceiptsfromSecuritiesRelatedActivities;\n\n        /// <summary>\n        /// Cash received from agency fees and commissions in operating cash flow, using the direct method. This item is usually available for bank and insurance industries\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26280\n        /// </remarks>\n        [JsonProperty(\"26280\")]\n        public CashReceiptsfromFeesandCommissionsCashFlowStatement CashReceiptsfromFeesandCommissions => _cashReceiptsfromFeesandCommissions ??= new(_timeProvider, _securityIdentifier);\n        private CashReceiptsfromFeesandCommissionsCashFlowStatement _cashReceiptsfromFeesandCommissions;\n\n        /// <summary>\n        /// Cash paid for deposits by banks and customers in operating cash flow, using the direct method. This item is usually only available for bank industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26282\n        /// </remarks>\n        [JsonProperty(\"26282\")]\n        public CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement CashPaymentsforDepositsbyBanksandCustomers => _cashPaymentsforDepositsbyBanksandCustomers ??= new(_timeProvider, _securityIdentifier);\n        private CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement _cashPaymentsforDepositsbyBanksandCustomers;\n\n        /// <summary>\n        /// Cash paid for loans in operating cash flow, using the direct method. This item is usually only available for bank industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26283\n        /// </remarks>\n        [JsonProperty(\"26283\")]\n        public CashPaymentsforLoansCashFlowStatement CashPaymentsforLoans => _cashPaymentsforLoans ??= new(_timeProvider, _securityIdentifier);\n        private CashPaymentsforLoansCashFlowStatement _cashPaymentsforLoans;\n\n        /// <summary>\n        /// Cash paid for interest and commission in operating cash flow, using the direct method\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26284\n        /// </remarks>\n        [JsonProperty(\"26284\")]\n        public InterestandCommissionPaidCashFlowStatement InterestandCommissionPaid => _interestandCommissionPaid ??= new(_timeProvider, _securityIdentifier);\n        private InterestandCommissionPaidCashFlowStatement _interestandCommissionPaid;\n\n        /// <summary>\n        /// Cash paid to tax authorities in operating cash flow, using the direct method\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26285\n        /// </remarks>\n        [JsonProperty(\"26285\")]\n        public AllTaxesPaidCashFlowStatement AllTaxesPaid => _allTaxesPaid ??= new(_timeProvider, _securityIdentifier);\n        private AllTaxesPaidCashFlowStatement _allTaxesPaid;\n\n        /// <summary>\n        /// Cash received from insurance activities in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26286\n        /// </remarks>\n        [JsonProperty(\"26286\")]\n        public CashReceivedfromInsuranceActivitiesCashFlowStatement CashReceivedfromInsuranceActivities => _cashReceivedfromInsuranceActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashReceivedfromInsuranceActivitiesCashFlowStatement _cashReceivedfromInsuranceActivities;\n\n        /// <summary>\n        /// Cash received from premium income in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26287\n        /// </remarks>\n        [JsonProperty(\"26287\")]\n        public PremiumReceivedCashFlowStatement PremiumReceived => _premiumReceived ??= new(_timeProvider, _securityIdentifier);\n        private PremiumReceivedCashFlowStatement _premiumReceived;\n\n        /// <summary>\n        /// Cash received from reinsurance income or other recoveries income in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26288\n        /// </remarks>\n        [JsonProperty(\"26288\")]\n        public ReinsuranceandOtherRecoveriesReceivedCashFlowStatement ReinsuranceandOtherRecoveriesReceived => _reinsuranceandOtherRecoveriesReceived ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceandOtherRecoveriesReceivedCashFlowStatement _reinsuranceandOtherRecoveriesReceived;\n\n        /// <summary>\n        /// Cash received from policyholder deposit investment activities in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26289\n        /// </remarks>\n        [JsonProperty(\"26289\")]\n        public PolicyholderDepositInvestmentReceivedCashFlowStatement PolicyholderDepositInvestmentReceived => _policyholderDepositInvestmentReceived ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderDepositInvestmentReceivedCashFlowStatement _policyholderDepositInvestmentReceived;\n\n        /// <summary>\n        /// Cash paid out for insurance activities during the period in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26290\n        /// </remarks>\n        [JsonProperty(\"26290\")]\n        public CashPaidforInsuranceActivitiesCashFlowStatement CashPaidforInsuranceActivities => _cashPaidforInsuranceActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashPaidforInsuranceActivitiesCashFlowStatement _cashPaidforInsuranceActivities;\n\n        /// <summary>\n        /// Cash paid out for claims by a insurance company during the period in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26291\n        /// </remarks>\n        [JsonProperty(\"26291\")]\n        public ClaimsPaidCashFlowStatement ClaimsPaid => _claimsPaid ??= new(_timeProvider, _securityIdentifier);\n        private ClaimsPaidCashFlowStatement _claimsPaid;\n\n        /// <summary>\n        /// Cash paid for commissions in operating cash flow, using the direct method\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26292\n        /// </remarks>\n        [JsonProperty(\"26292\")]\n        public CommissionPaidCashFlowStatement CommissionPaid => _commissionPaid ??= new(_timeProvider, _securityIdentifier);\n        private CommissionPaidCashFlowStatement _commissionPaid;\n\n        /// <summary>\n        /// Cash paid out to reinsurers in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26293\n        /// </remarks>\n        [JsonProperty(\"26293\")]\n        public CashPaidtoReinsurersCashFlowStatement CashPaidtoReinsurers => _cashPaidtoReinsurers ??= new(_timeProvider, _securityIdentifier);\n        private CashPaidtoReinsurersCashFlowStatement _cashPaidtoReinsurers;\n\n        /// <summary>\n        /// Cash paid out for underwriting expenses, such as the acquisition of new and renewal insurance contracts, in operating cash flow, using the direct method. This item is usually only available for insurance industry\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26294\n        /// </remarks>\n        [JsonProperty(\"26294\")]\n        public OtherUnderwritingExpensesPaidCashFlowStatement OtherUnderwritingExpensesPaid => _otherUnderwritingExpensesPaid ??= new(_timeProvider, _securityIdentifier);\n        private OtherUnderwritingExpensesPaidCashFlowStatement _otherUnderwritingExpensesPaid;\n\n        /// <summary>\n        /// Cash Distribution of earnings to Minority Stockholders.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26295\n        /// </remarks>\n        [JsonProperty(\"26295\")]\n        public CashDividendsForMinoritiesCashFlowStatement CashDividendsForMinorities => _cashDividendsForMinorities ??= new(_timeProvider, _securityIdentifier);\n        private CashDividendsForMinoritiesCashFlowStatement _cashDividendsForMinorities;\n\n        /// <summary>\n        /// The net cash from an entity's operating activities before real cash inflow or outflow for Dividend, Interest, Tax, or other unclassified operating activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26298\n        /// </remarks>\n        [JsonProperty(\"26298\")]\n        public CashGeneratedfromOperatingActivitiesCashFlowStatement CashGeneratedfromOperatingActivities => _cashGeneratedfromOperatingActivities ??= new(_timeProvider, _securityIdentifier);\n        private CashGeneratedfromOperatingActivitiesCashFlowStatement _cashGeneratedfromOperatingActivities;\n\n        /// <summary>\n        /// Funds from operations; populated only for real estate investment trusts (REITs), defined as the sum of net income, gain/loss (realized and unrealized) on investment securities, asset impairment charge, depreciation and amortization and gain/ loss on the sale of business and property plant and equipment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26299\n        /// </remarks>\n        [JsonProperty(\"26299\")]\n        public FundFromOperationCashFlowStatement FundFromOperation => _fundFromOperation ??= new(_timeProvider, _securityIdentifier);\n        private FundFromOperationCashFlowStatement _fundFromOperation;\n\n        /// <summary>\n        /// Net increase or decrease in cash due to purchases or sales of investment properties during the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26300\n        /// </remarks>\n        [JsonProperty(\"26300\")]\n        public NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement NetInvestmentPropertiesPurchaseAndSale => _netInvestmentPropertiesPurchaseAndSale ??= new(_timeProvider, _securityIdentifier);\n        private NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement _netInvestmentPropertiesPurchaseAndSale;\n\n        /// <summary>\n        /// Cash outflow for purchases of investment properties during the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26301\n        /// </remarks>\n        [JsonProperty(\"26301\")]\n        public PurchaseOfInvestmentPropertiesCashFlowStatement PurchaseOfInvestmentProperties => _purchaseOfInvestmentProperties ??= new(_timeProvider, _securityIdentifier);\n        private PurchaseOfInvestmentPropertiesCashFlowStatement _purchaseOfInvestmentProperties;\n\n        /// <summary>\n        /// Cash inflow from sale of investment properties during the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26302\n        /// </remarks>\n        [JsonProperty(\"26302\")]\n        public SaleOfInvestmentPropertiesCashFlowStatement SaleOfInvestmentProperties => _saleOfInvestmentProperties ??= new(_timeProvider, _securityIdentifier);\n        private SaleOfInvestmentPropertiesCashFlowStatement _saleOfInvestmentProperties;\n\n        /// <summary>\n        /// Other cash adjustments included in change in cash not categorized above.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26303\n        /// </remarks>\n        [JsonProperty(\"26303\")]\n        public OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement OtherCashAdjustIncludedIntoChangeinCash => _otherCashAdjustIncludedIntoChangeinCash ??= new(_timeProvider, _securityIdentifier);\n        private OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement _otherCashAdjustIncludedIntoChangeinCash;\n\n        /// <summary>\n        /// Other changes to cash and cash equivalents during the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26304\n        /// </remarks>\n        [JsonProperty(\"26304\")]\n        public OtherCashAdjustExcludeFromChangeinCashCashFlowStatement OtherCashAdjustExcludeFromChangeinCash => _otherCashAdjustExcludeFromChangeinCash ??= new(_timeProvider, _securityIdentifier);\n        private OtherCashAdjustExcludeFromChangeinCashCashFlowStatement _otherCashAdjustExcludeFromChangeinCash;\n\n        /// <summary>\n        /// The change in cash flow from the previous period to the current, as reported by the company, may be the same or not the same as Morningstar's standardized definition. It is a supplemental value which would be reported outside consolidated statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26305\n        /// </remarks>\n        [JsonProperty(\"26305\")]\n        public ChangeinCashSupplementalAsReportedCashFlowStatement ChangeinCashSupplementalAsReported => _changeinCashSupplementalAsReported ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinCashSupplementalAsReportedCashFlowStatement _changeinCashSupplementalAsReported;\n\n        private readonly ITimeProvider _timeProvider;\n        private readonly SecurityIdentifier _securityIdentifier;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n        {\n            _timeProvider = timeProvider;\n            _securityIdentifier = securityIdentifier;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowfromFinancingGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's cash flows from financing on a percentage basis. Morningstar calculates the growth percentage based on the financing cash flows reported in the Cash Flow Statement within the company filings or reports.\n    /// </summary>\n    public class CashFlowFromFinancingGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashFlowfromFinancingGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromFinancingGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromFinancingGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowfromInvestingGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's cash flows from investing on a percentage basis. Morningstar calculates the growth percentage based on the cash flows from investing reported in the Cash Flow Statement within the company filings or reports.\n    /// </summary>\n    public class CashFlowFromInvestingGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashFlowfromInvestingGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowFromInvestingGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowFromInvestingGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash from (used in) all of the entity's operating activities, including those of discontinued operations, of the reporting entity under the direct method.\n    /// </summary>\n    public class CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFromDiscontinuedFinancingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash generated by or used in financing activities of discontinued operations; excludes cash flows from continued operations.\n    /// </summary>\n    public class CashFromDiscontinuedFinancingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFromDiscontinuedFinancingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFromDiscontinuedFinancingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFromDiscontinuedInvestingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash inflow (outflow) from discontinued investing activities over the designated time PeriodAsByte.\n    /// </summary>\n    public class CashFromDiscontinuedInvestingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFromDiscontinuedInvestingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFromDiscontinuedInvestingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashFromDiscontinuedOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash from (used in) all of the entity's discontinued operating activities, excluding those of continued operations, of the reporting entity.\n    /// </summary>\n    public class CashFromDiscontinuedOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashFromDiscontinuedOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashFromDiscontinuedOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashGeneratedfromOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash from an entity's operating activities before real cash inflow or outflow for Dividend, Interest, Tax, or other unclassified operating activities.\n    /// </summary>\n    public class CashGeneratedfromOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashGeneratedfromOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashGeneratedfromOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashPaidforInsuranceActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid out for insurance activities during the period in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class CashPaidforInsuranceActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashPaidforInsuranceActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashPaidforInsuranceActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashPaidtoReinsurersCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid out to reinsurers in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class CashPaidtoReinsurersCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashPaidtoReinsurersCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashPaidtoReinsurersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid for deposits by banks and customers in operating cash flow, using the direct method. This item is usually only available for bank industry\n    /// </summary>\n    public class CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashPaymentsforLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid for loans in operating cash flow, using the direct method. This item is usually only available for bank industry\n    /// </summary>\n    public class CashPaymentsforLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashPaymentsforLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashPaymentsforLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashPaymentsforLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Indicates a company's short-term liquidity, defined as short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities.\n    /// </summary>\n    public class CashRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashRatioGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's cash ratio on a percentage basis. Morningstar calculates the growth percentage based on the short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class CashRatioGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashRatioGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashRatioGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashRatioGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from banks and customer deposits in operating cash flow, using the direct method. This item is usually only available for bank industry\n    /// </summary>\n    public class CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromFeesandCommissionsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from agency fees and commissions in operating cash flow, using the direct method. This item is usually available for bank and insurance industries\n    /// </summary>\n    public class CashReceiptsfromFeesandCommissionsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromFeesandCommissionsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromFeesandCommissionsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from loans in operating cash flow, using the direct method. This item is usually only available for bank industry\n    /// </summary>\n    public class CashReceiptsfromLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from the repayment of advances and loans made to other parties, in the Investing Cash Flow section.\n    /// </summary>\n    public class CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherParties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from the trading of securities in operating cash flow, using the direct method. This item is usually only available for bank and insurance industries\n    /// </summary>\n    public class CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromSecuritiesRelatedActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceiptsfromTaxRefundsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received as refunds from tax authorities in operating cash flow, using the direct method\n    /// </summary>\n    public class CashReceiptsfromTaxRefundsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceiptsfromTaxRefunds_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceiptsfromTaxRefundsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceiptsfromTaxRefundsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashReceivedfromInsuranceActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from insurance activities in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class CashReceivedfromInsuranceActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CashReceivedfromInsuranceActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashReceivedfromInsuranceActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashReceivedfromInsuranceActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashRestrictedOrPledgedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash that the company can use only for specific purposes or cash deposit or placing of owned property by a debtor (the pledger) to a creditor (the pledgee) as a security for a loan or obligation.\n    /// </summary>\n    public class CashRestrictedOrPledgedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashRestrictedOrPledged_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashRestrictedOrPledged_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashRestrictedOrPledged_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashRestrictedOrPledged_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CashRestrictedOrPledged_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashRestrictedOrPledgedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashRestrictedOrPledgedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CashtoTotalAssets.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the percentage of a company's total assets is in cash.\n    /// </summary>\n    public class CashtoTotalAssets : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashtoTotalAssets_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashtoTotalAssets_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashtoTotalAssets_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashtoTotalAssets_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CashtoTotalAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CashtoTotalAssets()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CashtoTotalAssets(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CededPremiumsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of premiums paid and payable to another insurer as a result of reinsurance arrangements in order to exchange for that company accepting all or part of insurance on a risk or exposure. This item is usually only available for insurance industry.\n    /// </summary>\n    public class CededPremiumsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CededPremiums_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CededPremiums_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CededPremiumsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CededPremiumsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInAccountPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the account payables.\n    /// </summary>\n    public class ChangeInAccountPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccountPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInAccountPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInAccountPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInAccountPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInAccruedExpenseCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the accrued expenses.\n    /// </summary>\n    public class ChangeInAccruedExpenseCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInAccruedExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInAccruedExpenseCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInAccruedExpenseCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInAccruedInvestmentIncomeCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period in investment income that has been earned but not yet received in cash.\n    /// </summary>\n    public class ChangeInAccruedInvestmentIncomeCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInAccruedInvestmentIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInAccruedInvestmentIncomeCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInAccruedInvestmentIncomeCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInDeferredAcquisitionCostsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The change of the unamortized portion as of the balance sheet date of capitalized costs that vary with and are primarily related to the acquisition of new and renewal insurance contracts.\n    /// </summary>\n    public class ChangeInDeferredAcquisitionCostsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInDeferredAcquisitionCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInDeferredAcquisitionCostsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInDeferredAcquisitionCostsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInDeferredChargesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period in the value of expenditures made during the current reporting period for benefits that will be received over a period of years. This item is usually only available for bank industry.\n    /// </summary>\n    public class ChangeInDeferredChargesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInDeferredCharges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInDeferredChargesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInDeferredChargesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInDividendPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the dividend payables.\n    /// </summary>\n    public class ChangeInDividendPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInDividendPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInDividendPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInDividendPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInDividendPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount shown on the books that a bank with insufficient reserves borrows, at the federal funds rate, from another bank to meet its reserve requirements and the amount of securities that an institution sells and agrees to repurchase at a specified date for a specified price, net of any reductions or offsets.\n    /// </summary>\n    public class ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInFederalFundsAndSecuritiesSoldForRepurchase_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInFundsWithheldCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period associated with funds withheld.\n    /// </summary>\n    public class ChangeInFundsWithheldCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInFundsWithheld_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInFundsWithheldCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInFundsWithheldCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInIncomeTaxPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the income tax payables.\n    /// </summary>\n    public class ChangeInIncomeTaxPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInIncomeTaxPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInIncomeTaxPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInIncomeTaxPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInInterestPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the interest payable. Interest payable means carrying value as of the balance sheet date of interest payable on all forms of debt.\n    /// </summary>\n    public class ChangeInInterestPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInterestPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInInterestPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInInterestPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInInterestPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInInventoryCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the Inventories. Inventories represent merchandise bought for resale and supplies and raw materials purchased for use in revenue producing operations.\n    /// </summary>\n    public class ChangeInInventoryCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInInventory_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInInventory_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInInventoryCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInInventoryCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change that a lender gives money or property to a borrower and the borrower agrees to return the property or repay the borrowed money, along with interest, at a predetermined date in the future.\n    /// </summary>\n    public class ChangeInLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period in the reserve account established to account for expected but unspecified losses.\n    /// </summary>\n    public class ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInLossAndLossAdjustmentExpenseReserves_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInOtherCurrentAssetsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the Other Current Assets. This category typically includes prepayments, deferred charges, and amounts (other than trade accounts) due from parents and subsidiaries.\n    /// </summary>\n    public class ChangeInOtherCurrentAssetsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInOtherCurrentAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInOtherCurrentAssetsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInOtherCurrentAssetsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInOtherCurrentLiabilitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the Other Current liabilities. Other Current liabilities is a balance sheet entry used by companies to group together current liabilities that are not assigned to common liabilities such as debt obligations or accounts payable.\n    /// </summary>\n    public class ChangeInOtherCurrentLiabilitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInOtherCurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInOtherCurrentLiabilitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInOtherCurrentLiabilitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInOtherWorkingCapitalCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the other working capital.\n    /// </summary>\n    public class ChangeInOtherWorkingCapitalCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInOtherWorkingCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInOtherWorkingCapitalCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInOtherWorkingCapitalCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the payables.\n    /// </summary>\n    public class ChangeInPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInPayablesAndAccruedExpenseCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the payables and accrued expenses. Accrued expenses represent expenses incurred at the end of the reporting period but not yet paid; also called accrued liabilities. The accrued liability is shown under current liabilities in the balance sheet.\n    /// </summary>\n    public class ChangeInPayablesAndAccruedExpenseCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInPayablesAndAccruedExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInPayablesAndAccruedExpenseCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInPayablesAndAccruedExpenseCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInPrepaidAssetsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the prepaid assets.\n    /// </summary>\n    public class ChangeInPrepaidAssetsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInPrepaidAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInPrepaidAssetsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInPrepaidAssetsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInReceivablesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the receivables. Receivables are amounts due to be paid to the company from clients and other.\n    /// </summary>\n    public class ChangeInReceivablesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInReceivablesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInReceivablesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period in the amount of benefits the ceding insurer expects to recover on insurance policies ceded to other insurance entities as of the balance sheet date for all guaranteed benefit types.\n    /// </summary>\n    public class ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInReinsuranceRecoverableOnPaidAndUnpaidLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInRestrictedCashCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash inflow (outflow) for the net change associated with funds that are not available for withdrawal or use (such as funds held in escrow).\n    /// </summary>\n    public class ChangeInRestrictedCashCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInRestrictedCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInRestrictedCashCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInRestrictedCashCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInTaxPayableCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the tax payables.\n    /// </summary>\n    public class ChangeInTaxPayableCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTaxPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInTaxPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInTaxPayableCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInTaxPayableCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInTradingAccountSecuritiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change during the reporting period associated with trading account assets. Trading account assets are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time). Unrealized holding gains and losses for trading securities are included in earnings.\n    /// </summary>\n    public class ChangeInTradingAccountSecuritiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInTradingAccountSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInTradingAccountSecuritiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInTradingAccountSecuritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInUnearnedPremiumsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The change during the period in the unearned portion of premiums written, excluding the portion amortized into income. This item is usually only available for insurance industry.\n    /// </summary>\n    public class ChangeInUnearnedPremiumsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInUnearnedPremiums_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInUnearnedPremiumsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInUnearnedPremiumsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeInWorkingCapitalCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the working capital. Working Capital is the amount left to the company to finance operations and expansion after current liabilities have been covered.\n    /// </summary>\n    public class ChangeInWorkingCapitalCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeInWorkingCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeInWorkingCapitalCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeInWorkingCapitalCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinAccruedIncomeCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods in the amount of outstanding money owed by a customer for goods or services provided by the company.\n    /// </summary>\n    public class ChangeinAccruedIncomeCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinAccruedIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinAccruedIncomeCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinAccruedIncomeCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinAdvancesfromCentralBanksCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the advances from central banks.\n    /// </summary>\n    public class ChangeinAdvancesfromCentralBanksCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinAdvancesfromCentralBanks_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinAdvancesfromCentralBanksCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinAdvancesfromCentralBanksCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinCashSupplementalAsReportedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The change in cash flow from the previous period to the current, as reported by the company, may be the same or not the same as Morningstar's standardized definition. It is a supplemental value which would be reported outside consolidated statements.\n    /// </summary>\n    public class ChangeinCashSupplementalAsReportedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinCashSupplementalAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinCashSupplementalAsReportedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinCashSupplementalAsReportedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinDeferredAcquisitionCostsNetCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the deferred acquisition costs.\n    /// </summary>\n    public class ChangeinDeferredAcquisitionCostsNetCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinDeferredAcquisitionCostsNet_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinDeferredAcquisitionCostsNetCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinDeferredAcquisitionCostsNetCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinDepositsbyBanksandCustomersCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the deposits by banks and customers.\n    /// </summary>\n    public class ChangeinDepositsbyBanksandCustomersCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDepositsbyBanksandCustomers_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDepositsbyBanksandCustomers_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinDepositsbyBanksandCustomers_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinDepositsbyBanksandCustomers_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinDepositsbyBanksandCustomersCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinDepositsbyBanksandCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinFinancialAssetsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the financial assets.\n    /// </summary>\n    public class ChangeinFinancialAssetsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinFinancialAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinFinancialAssetsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinFinancialAssetsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinFinancialLiabilitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the financial liabilities.\n    /// </summary>\n    public class ChangeinFinancialLiabilitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinFinancialLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinFinancialLiabilitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinFinancialLiabilitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInsuranceContractAssetsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the contract assets.\n    /// </summary>\n    public class ChangeinInsuranceContractAssetsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinInsuranceContractAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInsuranceContractAssetsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInsuranceContractAssetsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInsuranceContractLiabilitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the insurance contract liabilities.\n    /// </summary>\n    public class ChangeinInsuranceContractLiabilitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinInsuranceContractLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInsuranceContractLiabilitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInsuranceContractLiabilitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInsuranceFundsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the insurance funds.\n    /// </summary>\n    public class ChangeinInsuranceFundsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinInsuranceFunds_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInsuranceFundsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInsuranceFundsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expense due to changes between periods in insurance liabilities.\n    /// </summary>\n    public class ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ChangeinInsuranceLiabilitiesNetofReinsurance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInvestmentContractIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expense due to changes between periods in Investment Contracts.\n    /// </summary>\n    public class ChangeinInvestmentContractIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinInvestmentContract_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ChangeinInvestmentContract_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInvestmentContractIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInvestmentContractIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinInvestmentContractLiabilitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the investment contract liabilities.\n    /// </summary>\n    public class ChangeinInvestmentContractLiabilitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinInvestmentContractLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinInvestmentContractLiabilitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinInvestmentContractLiabilitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinReinsuranceReceivablesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the reinsurance receivable.\n    /// </summary>\n    public class ChangeinReinsuranceReceivablesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangeinReinsuranceReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinReinsuranceReceivablesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinReinsuranceReceivablesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The change in the amount of the unearned premium reserves maintained by insurers.\n    /// </summary>\n    public class ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiums_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The change in the amount of unearned premium reserve to be covered by reinsurers.\n    /// </summary>\n    public class ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangesInAccountReceivablesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of the accounts receivables.\n    /// </summary>\n    public class ChangesInAccountReceivablesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangesInAccountReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangesInAccountReceivablesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangesInAccountReceivablesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ChangesInCashCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change between the beginning and ending balance of cash and cash equivalents.\n    /// </summary>\n    public class ChangesInCashCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ChangesInCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ChangesInCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ChangesInCashCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ChangesInCashCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClaimsOutstandingBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owing to policy holders who have filed claims but have not yet been settled or paid.\n    /// </summary>\n    public class ClaimsOutstandingBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ClaimsOutstanding_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ClaimsOutstanding_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ClaimsOutstanding_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ClaimsOutstanding_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ClaimsOutstanding_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClaimsOutstandingBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClaimsOutstandingBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClaimsPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid out for claims by a insurance company during the period in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class ClaimsPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClaimsPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ClaimsPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClaimsPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClaimsPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClaimsandChangeinInsuranceLiabilitiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expense due to the insurer's changes in insurance liabilities.\n    /// </summary>\n    public class ClaimsandChangeinInsuranceLiabilitiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ClaimsandChangeinInsuranceLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClaimsandChangeinInsuranceLiabilitiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClaimsandChangeinInsuranceLiabilitiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClaimsandPaidIncurredIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All reported claims arising out of incidents in that year are considered incurred grouped with claims paid out.\n    /// </summary>\n    public class ClaimsandPaidIncurredIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ClaimsandPaidIncurred_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClaimsandPaidIncurredIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClaimsandPaidIncurredIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClassesofCashPaymentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of total cash payment in the direct cash flow.\n    /// </summary>\n    public class ClassesofCashPaymentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashPayments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ClassesofCashPayments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClassesofCashPaymentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClassesofCashPaymentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of total cash receipts in the direct cash flow.\n    /// </summary>\n    public class ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ClassesofCashReceiptsfromOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ComTreShaNumBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The treasury stock number of common shares. This represents the number of common shares owned by the company as a result of share repurchase programs or donations.\n    /// </summary>\n    public class ComTreShaNumBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ComTreShaNum_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ComTreShaNum_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ComTreShaNum_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ComTreShaNum_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ComTreShaNum_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ComTreShaNumBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ComTreShaNumBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommercialLoanBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Short-term loan, typically 90 days, used by a company to finance seasonal working capital needs.\n    /// </summary>\n    public class CommercialLoanBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CommercialLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommercialLoanBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommercialLoanBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommercialPaperBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Commercial paper is a money-market security issued by large banks and corporations. It represents the current obligation for the company. There are four basic kinds of commercial paper: promissory notes, drafts, checks, and certificates of deposit. The maturities of these money market securities generally do not exceed 270 days.\n    /// </summary>\n    public class CommercialPaperBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialPaper_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialPaper_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialPaper_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommercialPaper_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CommercialPaper_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommercialPaperBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommercialPaperBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommissionExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// \n    /// </summary>\n    public class CommissionExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CommissionExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CommissionExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommissionExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommissionExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommissionPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid for commissions in operating cash flow, using the direct method\n    /// </summary>\n    public class CommissionPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommissionPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CommissionPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommissionPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommissionPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonEquityToAssets.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is a financial ratio of common stock equity to total assets that indicates the relative proportion of equity used to finance a company's assets.\n    /// </summary>\n    public class CommonEquityToAssets : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CommonEquityToAssets_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CommonEquityToAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonEquityToAssets()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonEquityToAssets(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Common stock (all issues) at par value, as reported within the Stockholder's Equity section of the balance sheet; i.e. it is one component of Common Stockholder's Equity\n    /// </summary>\n    public class CommonStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CommonStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonStockDividendPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow from the distribution of an entity's earnings in the form of dividends to common shareholders.\n    /// </summary>\n    public class CommonStockDividendPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockDividendPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CommonStockDividendPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonStockDividendPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonStockDividendPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonStockEquityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The portion of the Stockholders' Equity that reflects the amount of common stock, which are units of ownership.\n    /// </summary>\n    public class CommonStockEquityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonStockEquity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CommonStockEquity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonStockEquityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonStockEquityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonStockIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from offering common stock, which is the additional capital contribution to the entity during the PeriodAsByte.\n    /// </summary>\n    public class CommonStockIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CommonStockIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonStockIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonStockIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonStockPaymentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow to reacquire common stock during the PeriodAsByte.\n    /// </summary>\n    public class CommonStockPaymentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CommonStockPayments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_CommonStockPayments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonStockPaymentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonStockPaymentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CommonUtilityPlantBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount for the other plant related to the utility industry fix assets.\n    /// </summary>\n    public class CommonUtilityPlantBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonUtilityPlant_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonUtilityPlant_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonUtilityPlant_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonUtilityPlant_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CommonUtilityPlant_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CommonUtilityPlant_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CommonUtilityPlantBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CommonUtilityPlantBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CompanyProfile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the CompanyProfile class\n    /// </summary>\n    public class CompanyProfile : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The headquarter address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2100\n        /// </remarks>\n        [JsonProperty(\"2100\")]\n        public string HeadquarterAddressLine1 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterAddressLine1);\n\n        /// <summary>\n        /// The headquarter address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2101\n        /// </remarks>\n        [JsonProperty(\"2101\")]\n        public string HeadquarterAddressLine2 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterAddressLine2);\n\n        /// <summary>\n        /// The headquarter address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2102\n        /// </remarks>\n        [JsonProperty(\"2102\")]\n        public string HeadquarterAddressLine3 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterAddressLine3);\n\n        /// <summary>\n        /// The headquarter address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2103\n        /// </remarks>\n        [JsonProperty(\"2103\")]\n        public string HeadquarterAddressLine4 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterAddressLine4);\n\n        /// <summary>\n        /// The headquarter address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2104\n        /// </remarks>\n        [JsonProperty(\"2104\")]\n        public string HeadquarterAddressLine5 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterAddressLine5);\n\n        /// <summary>\n        /// The headquarter city as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2105\n        /// </remarks>\n        [JsonProperty(\"2105\")]\n        public string HeadquarterCity => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterCity);\n\n        /// <summary>\n        /// The headquarter state or province as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2106\n        /// </remarks>\n        [JsonProperty(\"2106\")]\n        public string HeadquarterProvince => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterProvince);\n\n        /// <summary>\n        /// The headquarter country as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2107\n        /// </remarks>\n        [JsonProperty(\"2107\")]\n        public string HeadquarterCountry => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterCountry);\n\n        /// <summary>\n        /// The headquarter postal code as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2108\n        /// </remarks>\n        [JsonProperty(\"2108\")]\n        public string HeadquarterPostalCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterPostalCode);\n\n        /// <summary>\n        /// The headquarter phone number as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2109\n        /// </remarks>\n        [JsonProperty(\"2109\")]\n        public string HeadquarterPhone => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterPhone);\n\n        /// <summary>\n        /// The headquarter fax number as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2110\n        /// </remarks>\n        [JsonProperty(\"2110\")]\n        public string HeadquarterFax => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterFax);\n\n        /// <summary>\n        /// The headquarters' website address as given in the latest report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2111\n        /// </remarks>\n        [JsonProperty(\"2111\")]\n        public string HeadquarterHomepage => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_HeadquarterHomepage);\n\n        /// <summary>\n        /// The number of employees as indicated on the latest Annual Report, 10-K filing, Form 20-F or equivalent report indicating the employee count at the end of latest fiscal year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2113\n        /// </remarks>\n        [JsonProperty(\"2113\")]\n        public int TotalEmployeeNumber => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_TotalEmployeeNumber);\n\n        /// <summary>\n        /// Company's contact email address\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2114\n        /// </remarks>\n        [JsonProperty(\"2114\")]\n        public string ContactEmail => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_ContactEmail);\n\n        /// <summary>\n        /// Average number of employees from Annual Report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2115\n        /// </remarks>\n        [JsonProperty(\"2115\")]\n        public int AverageEmployeeNumber => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_AverageEmployeeNumber);\n\n        /// <summary>\n        /// Details for registered office contact information including address full details, phone and\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2116\n        /// </remarks>\n        [JsonProperty(\"2116\")]\n        public string RegisteredAddressLine1 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredAddressLine1);\n\n        /// <summary>\n        /// Address for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2117\n        /// </remarks>\n        [JsonProperty(\"2117\")]\n        public string RegisteredAddressLine2 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredAddressLine2);\n\n        /// <summary>\n        /// Address for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2118\n        /// </remarks>\n        [JsonProperty(\"2118\")]\n        public string RegisteredAddressLine3 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredAddressLine3);\n\n        /// <summary>\n        /// Address for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2119\n        /// </remarks>\n        [JsonProperty(\"2119\")]\n        public string RegisteredAddressLine4 => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredAddressLine4);\n\n        /// <summary>\n        /// City for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2120\n        /// </remarks>\n        [JsonProperty(\"2120\")]\n        public string RegisteredCity => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredCity);\n\n        /// <summary>\n        /// Province for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2121\n        /// </remarks>\n        [JsonProperty(\"2121\")]\n        public string RegisteredProvince => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredProvince);\n\n        /// <summary>\n        /// Country for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2122\n        /// </remarks>\n        [JsonProperty(\"2122\")]\n        public string RegisteredCountry => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredCountry);\n\n        /// <summary>\n        /// Postal Code for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2123\n        /// </remarks>\n        [JsonProperty(\"2123\")]\n        public string RegisteredPostalCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredPostalCode);\n\n        /// <summary>\n        /// Phone number for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2124\n        /// </remarks>\n        [JsonProperty(\"2124\")]\n        public string RegisteredPhone => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredPhone);\n\n        /// <summary>\n        /// Fax number for registered office\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2125\n        /// </remarks>\n        [JsonProperty(\"2125\")]\n        public string RegisteredFax => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_RegisteredFax);\n\n        /// <summary>\n        /// Flag to denote whether head and registered offices are the same\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2126\n        /// </remarks>\n        [JsonProperty(\"2126\")]\n        public bool IsHeadOfficeSameWithRegisteredOfficeFlag => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_IsHeadOfficeSameWithRegisteredOfficeFlag);\n\n        /// <summary>\n        /// The latest total shares outstanding reported by the company; most common source of this information is from the cover of the 10K, 10Q, or 20F filing. This figure is an aggregated shares outstanding number for a company. It can be used to calculate the most accurate market cap, based on each individual share's trading price and the total aggregated shares outstanding figure.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40000\n        /// </remarks>\n        [JsonProperty(\"40000\")]\n        public long SharesOutstanding => FundamentalService.Get<long>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_SharesOutstanding);\n\n        /// <summary>\n        /// Price * Total SharesOutstanding. The most current market cap for example, would be the most recent closing price x the most recent reported shares outstanding. For ADR share classes, market cap is price * (ordinary shares outstanding / adr ratio).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40001\n        /// </remarks>\n        [JsonProperty(\"40001\")]\n        public long MarketCap => FundamentalService.Get<long>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_MarketCap);\n\n        /// <summary>\n        /// This number tells you what cash return you would get if you bought the entire company, including its debt. Enterprise Value = Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40002\n        /// </remarks>\n        [JsonProperty(\"40002\")]\n        public long EnterpriseValue => FundamentalService.Get<long>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_EnterpriseValue);\n\n        /// <summary>\n        /// The latest shares outstanding reported by the company of a particular share class; most common source of this information is from the cover of the 10K, 10Q, or 20F filing. This figure is an aggregated shares outstanding number for a particular share class of the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40003\n        /// </remarks>\n        [JsonProperty(\"40003\")]\n        public long ShareClassLevelSharesOutstanding => FundamentalService.Get<long>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_ShareClassLevelSharesOutstanding);\n\n        /// <summary>\n        /// Total shares outstanding reported by the company as of the balance sheet period ended date. The most common source of this information is from the 10K, 10Q, or 20F filing. This figure is an aggregated shares outstanding number for a company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40007\n        /// </remarks>\n        [JsonProperty(\"40007\")]\n        public long SharesOutstandingWithBalanceSheetEndingDate => FundamentalService.Get<long>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_SharesOutstandingWithBalanceSheetEndingDate);\n\n        /// <summary>\n        /// The reason for the change in a company's total shares outstanding from the previous record. Examples could be share issuances or share buy-back. This field will only be populated when total shares outstanding is collected from a press release.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 40010\n        /// </remarks>\n        [JsonProperty(\"40010\")]\n        public string ReasonofSharesChange => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyProfile_ReasonofSharesChange);\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CompanyProfile(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new CompanyProfile(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CompanyReference.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the CompanyReference class\n    /// </summary>\n    public class CompanyReference : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// 10-digit unique and unchanging Morningstar identifier assigned to every company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1\n        /// </remarks>\n        [JsonProperty(\"1\")]\n        public string CompanyId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_CompanyId);\n\n        /// <summary>\n        /// 25-character max abbreviated name of the firm. In most cases, the short name will simply be the Legal Name less the \"Corporation\", \"Corp.\", \"Inc.\", \"Incorporated\", etc...\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 2\n        /// </remarks>\n        [JsonProperty(\"2\")]\n        public string ShortName => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_ShortName);\n\n        /// <summary>\n        /// The English translation of the foreign legal name if/when applicable.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 3\n        /// </remarks>\n        [JsonProperty(\"3\")]\n        public string StandardName => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_StandardName);\n\n        /// <summary>\n        /// The full name of the registrant as specified in its charter, and most often found on the front cover of the 10K/10Q/20F filing.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 4\n        /// </remarks>\n        [JsonProperty(\"4\")]\n        public string LegalName => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_LegalName);\n\n        /// <summary>\n        /// 3 Character ISO code of the country where the firm is domiciled. See separate reference document for Country Mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 5\n        /// </remarks>\n        [JsonProperty(\"5\")]\n        public string CountryId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_CountryId);\n\n        /// <summary>\n        /// The Central Index Key; a corporate identifier assigned by the Securities and Exchange Commission (SEC).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 6\n        /// </remarks>\n        [JsonProperty(\"6\")]\n        public string CIK => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_CIK);\n\n        /// <summary>\n        /// At the Company level; each company is assigned to 1 of 3 possible status classifications; (U) Public, (V) Private, or (O) Obsolete: - Public-Firm is operating and currently has at least one common share class that is currently trading on a public exchange. - Private-Firm is operating but does not have any common share classes currently trading on a public exchange. - Obsolete-Firm is no longer operating because it closed its business, or was acquired.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 9\n        /// </remarks>\n        [JsonProperty(\"9\")]\n        public string CompanyStatus => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_CompanyStatus);\n\n        /// <summary>\n        /// The Month of the company's latest fiscal year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10\n        /// </remarks>\n        [JsonProperty(\"10\")]\n        public int FiscalYearEnd => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_FiscalYearEnd);\n\n        /// <summary>\n        /// This indicator will denote which one of the six industry data collection templates applies to the company. Each industry data collection template includes data elements that are commonly reported by companies in that industry. N=Normal (Manufacturing), M=Mining, U=Utility, T=Transportation, B=Bank, I=Insurance\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11\n        /// </remarks>\n        [JsonProperty(\"11\")]\n        public string IndustryTemplateCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_IndustryTemplateCode);\n\n        /// <summary>\n        /// The 10-digit unique and unchanging Morningstar identifier assigned to the Primary Share class of a company. The primary share of a company is defined as the first share that was traded publicly and is still actively trading. If this share is no longer trading, the primary share will be the share with the highest volume.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12\n        /// </remarks>\n        [JsonProperty(\"12\")]\n        public string PrimaryShareClassID => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_PrimaryShareClassID);\n\n        /// <summary>\n        /// The symbol of the Primary Share of the company, composed of an arrangement of characters (often letters) representing a particular security listed on an exchange or otherwise traded publicly. The primary share of a company is defined as the first share that was traded publicly and is still actively trading. If this share is no longer trading, the primary share will be the share with the highest volume. Note: Morningstar's multi-share class symbols will often contain a \"period\" within the symbol; e.g. BRK.B for Berkshire Hathaway Class B.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13\n        /// </remarks>\n        [JsonProperty(\"13\")]\n        public string PrimarySymbol => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_PrimarySymbol);\n\n        /// <summary>\n        /// The Id representing the stock exchange of the Primary Share of the company. See separate reference document for Exchange Mappings. The primary share of a company is defined as the first share that was traded publicly with and is still actively trading. If this share is no longer trading, the primary share will be the share with the highest volume.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14\n        /// </remarks>\n        [JsonProperty(\"14\")]\n        public string PrimaryExchangeID => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_PrimaryExchangeID);\n\n        /// <summary>\n        /// In some cases, different from the country of domicile (CountryId; DataID 5). This element is a three (3) Character ISO code of the business country of the security. It is determined by a few factors, including:\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 15\n        /// </remarks>\n        [JsonProperty(\"15\")]\n        public string BusinessCountryID => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_BusinessCountryID);\n\n        /// <summary>\n        /// The language code for the foreign legal name if/when applicable. Related to DataID 4 (LegalName).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 16\n        /// </remarks>\n        [JsonProperty(\"16\")]\n        public string LegalNameLanguageCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_LegalNameLanguageCode);\n\n        /// <summary>\n        /// The legal (registered) name of the company's current auditor. Distinct from DataID 28000 Period Auditor that identifies the Auditor related to that period's financial statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 17\n        /// </remarks>\n        [JsonProperty(\"17\")]\n        public string Auditor => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_Auditor);\n\n        /// <summary>\n        /// The ISO code denoting the language text for Auditor's name and contact information.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 18\n        /// </remarks>\n        [JsonProperty(\"18\")]\n        public string AuditorLanguageCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_AuditorLanguageCode);\n\n        /// <summary>\n        /// The legal (registered) name of the current legal Advisor of the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 19\n        /// </remarks>\n        [JsonProperty(\"19\")]\n        public string Advisor => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_Advisor);\n\n        /// <summary>\n        /// The ISO code denoting the language text for Advisor's name and contact information.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20\n        /// </remarks>\n        [JsonProperty(\"20\")]\n        public string AdvisorLanguageCode => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_AdvisorLanguageCode);\n\n        /// <summary>\n        /// Indicator to denote if the company is a limited partnership, which is a form of business structure comprised of a general partner and limited partners. 1 denotes it is a LP; otherwise 0.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 21\n        /// </remarks>\n        [JsonProperty(\"21\")]\n        public bool IsLimitedPartnership => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_IsLimitedPartnership);\n\n        /// <summary>\n        /// Indicator to denote if the company is a real estate investment trust (REIT). 1 denotes it is a REIT; otherwise 0.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 22\n        /// </remarks>\n        [JsonProperty(\"22\")]\n        public bool IsREIT => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_IsREIT);\n\n        /// <summary>\n        /// The MIC (market identifier code) of the PrimarySymbol of the company. See Data Appendix A for the relevant MIC to exchange name mapping.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 23\n        /// </remarks>\n        [JsonProperty(\"23\")]\n        public string PrimaryMIC => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_PrimaryMIC);\n\n        /// <summary>\n        /// This refers to the financial template used to collect the company's financial statements. There are two report styles representing two different financial template structures. Report style \"1\" is most commonly used by US and Canadian companies, and Report style \"3\" is most commonly used by the rest of the universe. Contact your client manager for access to the respective templates.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 24\n        /// </remarks>\n        [JsonProperty(\"24\")]\n        public int ReportStyle => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_ReportStyle);\n\n        /// <summary>\n        /// The year a company was founded.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 25\n        /// </remarks>\n        [JsonProperty(\"25\")]\n        public string YearofEstablishment => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_YearofEstablishment);\n\n        /// <summary>\n        /// Indicator to denote if the company is a limited liability company. 1 denotes it is a LLC; otherwise 0.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 26\n        /// </remarks>\n        [JsonProperty(\"26\")]\n        public bool IsLimitedLiabilityCompany => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_IsLimitedLiabilityCompany);\n\n        /// <summary>\n        /// The upcoming expected year end for the company. It is calculated based on current year end (from latest available annual report) + 1 year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 27\n        /// </remarks>\n        [JsonProperty(\"27\")]\n        public DateTime ExpectedFiscalYearEnd => FundamentalService.Get<DateTime>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.CompanyReference_ExpectedFiscalYearEnd);\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CompanyReference(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new CompanyReference(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ConstructionInProgressBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// It represents carrying amount of long-lived asset under construction that includes construction costs to date on capital projects. Assets constructed, but not completed.\n    /// </summary>\n    public class ConstructionInProgressBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConstructionInProgress_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ConstructionInProgress_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ConstructionInProgressBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ConstructionInProgressBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ConsumerLoanBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A loan that establishes consumer credit that is granted for personal use; usually unsecured and based on the borrower's integrity and ability to pay.\n    /// </summary>\n    public class ConsumerLoanBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConsumerLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ConsumerLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ConsumerLoanBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ConsumerLoanBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ContinuingAndDiscontinuedBasicEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Basic EPS from Continuing Operations plus Basic EPS from Discontinued Operations.\n    /// </summary>\n    public class ContinuingAndDiscontinuedBasicEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedBasicEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_ContinuingAndDiscontinuedBasicEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ContinuingAndDiscontinuedBasicEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ContinuingAndDiscontinuedBasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ContinuingAndDiscontinuedDilutedEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS from Continuing Operations plus Diluted EPS from Discontinued Operations.\n    /// </summary>\n    public class ContinuingAndDiscontinuedDilutedEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ContinuingAndDiscontinuedDilutedEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_ContinuingAndDiscontinuedDilutedEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ContinuingAndDiscontinuedDilutedEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ContinuingAndDiscontinuedDilutedEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ConvertibleLoansCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This represents loans that entitle the lender (or the holder of loan debenture) to convert the loan to common or preferred stock (ordinary or preference shares) within the next 12 months or operating cycle.\n    /// </summary>\n    public class ConvertibleLoansCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ConvertibleLoansCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ConvertibleLoansCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ConvertibleLoansCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ConvertibleLoansNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A long term loan with a warrant attached that gives the debt holder the option to exchange all or a portion of the loan principal for an equity position in the company at a predetermined rate of conversion within a specified period of time.\n    /// </summary>\n    public class ConvertibleLoansNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ConvertibleLoansNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ConvertibleLoansNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ConvertibleLoansNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ConvertibleLoansTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Loans that entitles the lender (or the holder of loan debenture) to convert the loan to common or preferred stock (ordinary or preference shares) at a specified rate conversion rate and a specified time frame; in a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class ConvertibleLoansTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ConvertibleLoansTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ConvertibleLoansTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ConvertibleLoansTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ConvertibleLoansTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CostOfRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate cost of goods produced and sold and services rendered during the reporting PeriodAsByte. It excludes all operating expenses such as depreciation, depletion, amortization, and SG&amp;A. For the must have cost industry, if the number is not reported by the company, it will be calculated based on accounting equation. Cost of Revenue = Revenue - Operating Expenses - Operating Profit.\n    /// </summary>\n    public class CostOfRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CostOfRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CostOfRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CostOfRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CostOfRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CreditCardIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income earned from credit card services including late, over limit, and annual fees. This item is usually only available for bank industry.\n    /// </summary>\n    public class CreditCardIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditCard_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CreditCard_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CreditCardIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CreditCardIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CreditLossesProvisionIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A charge to income which represents an expense deemed adequate by management given the composition of a bank's credit portfolios, their probability of default, the economic environment and the allowance for credit losses already established. Specific provisions are established to reduce the book value of specific assets (primarily loans) to establish the amount expected to be recovered on the loans.\n    /// </summary>\n    public class CreditLossesProvisionIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditLossesProvision_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CreditLossesProvision_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CreditLossesProvisionIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CreditLossesProvisionIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CreditRiskProvisionsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Provision for the risk of loss of principal or loss of a financial reward stemming from a borrower's failure to repay a loan or otherwise meet a contractual obligation. Credit risk arises whenever a borrower is expecting to use future cash flows to pay a current debt. Investors are compensated for assuming credit risk by way of interest payments from the borrower or issuer of a debt obligation. This is a contra account under Total Revenue in banks.\n    /// </summary>\n    public class CreditRiskProvisionsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_CreditRiskProvisions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_CreditRiskProvisions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CreditRiskProvisionsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CreditRiskProvisionsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentAccruedExpensesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An expense recognized before it is paid for. Includes compensation, interest, pensions and all other miscellaneous accruals reported by the company. Expenses incurred during the accounting period, but not required to be paid until a later date.\n    /// </summary>\n    public class CurrentAccruedExpensesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAccruedExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentAccruedExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentAccruedExpensesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentAccruedExpensesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total amount of assets considered to be convertible into cash within a relatively short period of time, usually a year.\n    /// </summary>\n    public class CurrentAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentCapitalLeaseObligationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the total amount of long-term capital leases that must be paid within the next accounting PeriodAsByte. Capital lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n    /// </summary>\n    public class CurrentCapitalLeaseObligationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentCapitalLeaseObligation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentCapitalLeaseObligationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentCapitalLeaseObligationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDebtAndCapitalLeaseObligationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All borrowings due within one year including current portions of long-term debt and capital leases as well as short-term debt such as bank loans and commercial paper.\n    /// </summary>\n    public class CurrentDebtAndCapitalLeaseObligationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDebtAndCapitalLeaseObligation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDebtAndCapitalLeaseObligationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDebtAndCapitalLeaseObligationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDebtBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the total amount of long-term debt such as bank loans and commercial paper, which is due within one year.\n    /// </summary>\n    public class CurrentDebtBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDebtBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDebtBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDeferredAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments that will be assigned as expenses with one accounting period, but that are paid in advance and temporarily set up as current assets on the balance sheet.\n    /// </summary>\n    public class CurrentDeferredAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDeferredAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDeferredAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDeferredAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDeferredLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the current portion of obligations, which is a liability that usually would have been paid but is now past due.\n    /// </summary>\n    public class CurrentDeferredLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDeferredLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDeferredLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDeferredLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDeferredRevenueBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents collections of cash or other assets related to revenue producing activity for which revenue has not yet been recognized. Generally, an entity records deferred revenue when it receives consideration from a customer before achieving certain criteria that must be met for revenue to be recognized in conformity with GAAP. It can be either current or non-current item. Also called unearned revenue.\n    /// </summary>\n    public class CurrentDeferredRevenueBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDeferredRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDeferredRevenueBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDeferredRevenueBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDeferredTaxesAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Meaning a future tax asset, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value, or timing differences between the recognition of gains and losses in financial statements and their recognition in a tax computation. It is also called future tax.\n    /// </summary>\n    public class CurrentDeferredTaxesAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDeferredTaxesAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDeferredTaxesAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDeferredTaxesAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentDeferredTaxesLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Meaning a future tax liability, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value, or timing differences between the recognition of gains and losses in financial statements and their recognition in a tax computation. Deferred tax liabilities generally arise where tax relief is provided in advance of an accounting expense, or income is accrued but not taxed until received.\n    /// </summary>\n    public class CurrentDeferredTaxesLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentDeferredTaxesLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentDeferredTaxesLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentDeferredTaxesLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The debts or obligations of the firm that are due within one year.\n    /// </summary>\n    public class CurrentLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentNotesPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Written promises to pay a stated sum at one or more specified dates in the future, within the accounting PeriodAsByte.\n    /// </summary>\n    public class CurrentNotesPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentNotesPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentNotesPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentNotesPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentNotesPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentOtherFinancialLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other short term financial liabilities not categorized and due within one year or a normal operating cycle (whichever is longer).\n    /// </summary>\n    public class CurrentOtherFinancialLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentOtherFinancialLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentOtherFinancialLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentOtherFinancialLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentProvisionsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Provisions are created to protect the interests of one or both parties named in a contract or legal document which is a preparatory action or measure. Current provision is expired within one accounting PeriodAsByte.\n    /// </summary>\n    public class CurrentProvisionsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CurrentProvisions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CurrentProvisions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentProvisionsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentProvisionsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Current Assets to Current Liabilities. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Current Assets / Current Liabilities.\n    /// </summary>\n    public class CurrentRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CurrentRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CurrentRatioGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's current ratio on a percentage basis. Morningstar calculates the growth percentage based on the current assets divided by current liabilities reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class CurrentRatioGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatioGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatioGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatioGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatioGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CurrentRatioGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_CurrentRatioGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CurrentRatioGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CurrentRatioGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CustomerAcceptancesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts receivable from customers on short-term negotiable time drafts drawn on and accepted by the institution (also known as banker's acceptance transactions) that are outstanding on the reporting date.\n    /// </summary>\n    public class CustomerAcceptancesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAcceptances_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAcceptances_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAcceptances_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAcceptances_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CustomerAcceptances_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CustomerAcceptancesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CustomerAcceptancesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/CustomerAccountsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying value of amounts transferred by customers to third parties for security purposes that are expected to be returned or applied towards payment after one year or beyond the operating cycle, if longer.\n    /// </summary>\n    public class CustomerAccountsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAccounts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAccounts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAccounts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CustomerAccounts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_CustomerAccounts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public CustomerAccountsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public CustomerAccountsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DDACostofRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Costs of depreciation and amortization on assets used for the revenue-generating activities during the accounting period\n    /// </summary>\n    public class DDACostofRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DDACostofRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DDACostofRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DDACostofRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DDACostofRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DPSGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's dividends per share (DPS) on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying DPS from its dividend database. Morningstar collects its DPS from company filings and reports, as well as from third party sources.\n    /// </summary>\n    public class DPSGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DPSGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_DPSGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DPSGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DPSGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DaysInInventory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// 365 / Inventory turnover\n    /// </summary>\n    public class DaysInInventory : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInInventory_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInInventory_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInInventory_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInInventory_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInInventory_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_DaysInInventory_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DaysInInventory()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DaysInInventory(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DaysInPayment.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// 365 / Payable turnover\n    /// </summary>\n    public class DaysInPayment : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInPayment_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInPayment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInPayment_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInPayment_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInPayment_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_DaysInPayment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DaysInPayment()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DaysInPayment(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DaysInSales.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// 365 / Receivable Turnover\n    /// </summary>\n    public class DaysInSales : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInSales_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInSales_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInSales_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInSales_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DaysInSales_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_DaysInSales_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DaysInSales()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DaysInSales(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtDueBeyondBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt maturing beyond 5 years (eg. 5-10 years) or with no specified maturity, according to the debt maturity schedule reported by the company.\n    /// </summary>\n    public class DebtDueBeyondBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueBeyond_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueBeyond_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueBeyond_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueBeyond_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtDueBeyond_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtDueBeyondBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtDueBeyondBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtDueInYear1BalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt due under 1 year according to the debt maturity schedule reported by the company.\n    /// </summary>\n    public class DebtDueInYear1BalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear1_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear1_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear1_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear1_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtDueInYear1_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtDueInYear1BalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtDueInYear1BalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtDueInYear2BalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt due under 2 years according to the debt maturity schedule reported by the company.\n    /// </summary>\n    public class DebtDueInYear2BalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear2_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear2_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear2_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear2_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtDueInYear2_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtDueInYear2BalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtDueInYear2BalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtDueInYear5BalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt due within 5 year if the company provide maturity schedule in range e.g. 1-5 years, 2-5 years. Debt due under 5 years according to the debt maturity schedule reported by the company. If a range is reported by the company, the value will be collected under the maximum number of years (eg. 1-5 years, 3-5 years or 5 years will all be collected under this data point.)\n    /// </summary>\n    public class DebtDueInYear5BalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear5_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear5_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear5_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtDueInYear5_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtDueInYear5_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtDueInYear5BalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtDueInYear5BalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtSecuritiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt securities held as investments.\n    /// </summary>\n    public class DebtSecuritiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtSecuritiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtSecuritiesinIssueBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any debt financial instrument issued instead of cash loan.\n    /// </summary>\n    public class DebtSecuritiesinIssueBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtSecuritiesinIssue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtSecuritiesinIssueBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtSecuritiesinIssueBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebtTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total aggregate of all written promises and/or agreements to repay a stated amount of borrowed funds at a specified date in the future; in a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class DebtTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DebtTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DebtTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DebttoAssets.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is a leverage ratio used to determine how much debt (a sum of long term and current portion of debt) a company has on its balance sheet relative to total assets. This ratio examines the percent of the company that is financed by debt.\n    /// </summary>\n    public class DebtToAssets : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_DebtToAssets_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_DebttoAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DebtToAssets()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DebtToAssets(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DecreaseInInterestBearingDepositsInBankCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change on interest-bearing deposits in other financial institutions for relatively short periods of time including, for example, certificates of deposits.\n    /// </summary>\n    public class DecreaseInInterestBearingDepositsInBankCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DecreaseInInterestBearingDepositsInBank_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DecreaseInInterestBearingDepositsInBankCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DecreaseInInterestBearingDepositsInBankCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An amount owed to a firm that is not expected to be received by the firm within one year from the date of the balance sheet.\n    /// </summary>\n    public class DeferredAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredCostsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An expenditure not recognized as a cost of operation of the period in which incurred, but carried forward to be written off in future periods.\n    /// </summary>\n    public class DeferredCostsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredCostsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredCostsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredIncomeTaxCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The component of income tax expense for the period representing the net change in the entities deferred tax assets and liabilities pertaining to continuing operations.\n    /// </summary>\n    public class DeferredIncomeTaxCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredIncomeTax_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DeferredIncomeTax_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredIncomeTaxCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredIncomeTaxCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredIncomeTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Collections of cash or other assets related to revenue producing activity for which revenue has not yet been recognized on a Non- Differentiated Balance Sheet.\n    /// </summary>\n    public class DeferredIncomeTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredIncomeTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredIncomeTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredIncomeTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredIncomeTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredIncomeTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredIncomeTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredIncomeTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredPolicyAcquisitionCostsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net amount of deferred policy acquisition costs capitalized on contracts remaining in force as of the balance sheet date.\n    /// </summary>\n    public class DeferredPolicyAcquisitionCostsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredPolicyAcquisitionCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredPolicyAcquisitionCostsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredPolicyAcquisitionCostsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredTaxAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An asset on a company's balance sheet that may be used to reduce any subsequent period's income tax expense. Deferred tax assets can arise due to net loss carryovers, which are only recorded as assets if it is deemed more likely than not that the asset will be used in future fiscal periods.\n    /// </summary>\n    public class DeferredTaxAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredTaxAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredTaxAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredTaxAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredTaxCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Future tax liability or asset, resulting from temporary differences between book (accounting) value of assets and liabilities, and their tax value. This arises due to differences between financial accounting for shareholders and tax accounting.\n    /// </summary>\n    public class DeferredTaxCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DeferredTax_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DeferredTax_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredTaxCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredTaxCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DeferredTaxLiabilitiesTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A future tax liability, resulting from temporary differences between book (accounting) value of assets and liabilities and their tax value or timing differences between the recognition of gains and losses in financial statements, on a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class DeferredTaxLiabilitiesTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DeferredTaxLiabilitiesTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DeferredTaxLiabilitiesTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DeferredTaxLiabilitiesTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DefinedPensionBenefitBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The recognition of an asset where pension fund assets exceed promised benefits.\n    /// </summary>\n    public class DefinedPensionBenefitBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DefinedPensionBenefit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DefinedPensionBenefit_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DefinedPensionBenefit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DefinedPensionBenefit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DefinedPensionBenefit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DefinedPensionBenefit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DefinedPensionBenefitBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DefinedPensionBenefitBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepletionCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Unlike depreciation and amortization, which mainly describe the deduction of expenses due to the aging of equipment and property, depletion is the actual physical reduction of natural resources by companies. For example, coalmines, oil fields and other natural resources are depleted on company accounting statements. This reduction in the quantity of resources is meant to assist in accurately identifying the value of the asset on the balance sheet.\n    /// </summary>\n    public class DepletionCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depletion_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_Depletion_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepletionCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepletionCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepletionIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The non-cash expense recognized on natural resources (eg. Oil and mineral deposits) over the benefit period of the asset.\n    /// </summary>\n    public class DepletionIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depletion_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_Depletion_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepletionIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepletionIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepositCertificatesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A savings certificate entitling the bearer to receive interest. A CD bears a maturity date, a specified fixed interest rate and can be issued in any denomination.\n    /// </summary>\n    public class DepositCertificatesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositCertificates_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositCertificates_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositCertificates_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositCertificates_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DepositCertificates_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepositCertificatesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepositCertificatesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepositsMadeunderAssumedReinsuranceContractBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Deposits made under reinsurance.\n    /// </summary>\n    public class DepositsMadeunderAssumedReinsuranceContractBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DepositsMadeunderAssumedReinsuranceContract_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepositsMadeunderAssumedReinsuranceContractBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepositsMadeunderAssumedReinsuranceContractBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepositsReceivedunderCededInsuranceContractBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Deposit received through ceded insurance contract.\n    /// </summary>\n    public class DepositsReceivedunderCededInsuranceContractBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DepositsReceivedunderCededInsuranceContract_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepositsReceivedunderCededInsuranceContractBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepositsReceivedunderCededInsuranceContractBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepositsbyBankBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Banks investment in the ongoing entity.\n    /// </summary>\n    public class DepositsbyBankBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsbyBank_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsbyBank_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsbyBank_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DepositsbyBank_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DepositsbyBank_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepositsbyBankBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepositsbyBankBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationAmortizationDepletionCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// It is a non cash charge that represents a reduction in the value of fixed assets due to wear, age or obsolescence. This figure also includes amortization of leased property, intangibles, and goodwill, and depletion. This non-cash item is an add-back to the cash flow statement.\n    /// </summary>\n    public class DepreciationAmortizationDepletionCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DepreciationAmortizationDepletion_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationAmortizationDepletionCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationAmortizationDepletionCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationAmortizationDepletionIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of depreciation, amortization and depletion expense in the Income Statement. Depreciation is the non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives Amortization is the non-cash expense recognized on intangible assets over the benefit period of the asset. Depletion is the non-cash expense recognized on natural resources (eg. Oil and mineral deposits) over the benefit period of the asset.\n    /// </summary>\n    public class DepreciationAmortizationDepletionIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DepreciationAmortizationDepletion_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationAmortizationDepletionIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationAmortizationDepletionIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationAndAmortizationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current period expense charged against earnings on long-lived, physical assets used in the normal conduct of business and not intended for resale to allocate or recognize the cost of assets over their useful lives; or to record the reduction in book value of an intangible asset over the benefit period of such asset.\n    /// </summary>\n    public class DepreciationAndAmortizationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DepreciationAndAmortization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DepreciationAndAmortization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationAndAmortizationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationAndAmortizationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationAndAmortizationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of depreciation and amortization expense in the Income Statement. Depreciation is the non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives Amortization is the non-cash expense recognized on intangible assets over the benefit period of the asset.\n    /// </summary>\n    public class DepreciationAndAmortizationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationAndAmortization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DepreciationAndAmortization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationAndAmortizationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationAndAmortizationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An expense recorded to allocate a tangible asset's cost over its useful life. Since it is a non-cash expense, it increases free cash flow while decreasing reported earnings.\n    /// </summary>\n    public class DepreciationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Depreciation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_Depreciation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current period non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives, in the Income Statement. Examples of tangible asset include buildings, production and equipment.\n    /// </summary>\n    public class DepreciationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Depreciation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_Depreciation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DepreciationSupplementalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current period expense charged against earnings on tangible asset over its useful life. It is a supplemental value which would be reported outside consolidated statements.\n    /// </summary>\n    public class DepreciationSupplementalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DepreciationSupplemental_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DepreciationSupplemental_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DepreciationSupplementalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DepreciationSupplementalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DerivativeAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fair values of assets resulting from contracts that meet the criteria of being accounted for as derivative instruments, net of the effects of master netting arrangements.\n    /// </summary>\n    public class DerivativeAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DerivativeAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DerivativeAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DerivativeAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DerivativeProductLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fair values of all liabilities resulting from contracts that meet the criteria of being accounted for as derivative instruments; and which are expected to be extinguished or otherwise disposed of after one year or beyond the normal operating cycle.\n    /// </summary>\n    public class DerivativeProductLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DerivativeProductLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DerivativeProductLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DerivativeProductLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DerivativeProductLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedAccountingChange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS from Cumulative Effect Accounting Changes is the earnings from accounting changes (in the reporting period) divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n    /// </summary>\n    public class DilutedAccountingChange : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAccountingChange_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedAccountingChange_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedAccountingChange()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedAccountingChange(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedAverageShares.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The shares outstanding used to calculate the diluted EPS, assuming the conversion of all convertible securities and the exercise of warrants or stock options. It is the weighted average diluted share outstanding through the whole accounting PeriodAsByte. Note: If Diluted Average Shares are not presented by the firm in the Income Statement and Basic Average Shares are presented, Diluted Average Shares will equal Basic Average Shares. However, if neither value is presented by the firm, Diluted Average Shares will be null.\n    /// </summary>\n    public class DilutedAverageShares : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedAverageShares_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedAverageShares_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedAverageShares()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedAverageShares(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedContEPSGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's diluted EPS from continuing operations on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying diluted EPS from continuing operations reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class DilutedContEPSGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedContEPSGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_DilutedContEPSGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedContEPSGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedContEPSGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedContinuousOperations.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS from Continuing Operations is the earnings from continuing operations divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n    /// </summary>\n    public class DilutedContinuousOperations : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedContinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedContinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedContinuousOperations()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedContinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedDiscontinuousOperations.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS from Discontinued Operations is the earnings from discontinued operations divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock. This only includes gain or loss from discontinued operations.\n    /// </summary>\n    public class DilutedDiscontinuousOperations : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedDiscontinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedDiscontinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedDiscontinuousOperations()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedDiscontinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS is the bottom line net income divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock. This value will be derived when not reported for the fourth quarter and will be less than or equal to Basic EPS.\n    /// </summary>\n    public class DilutedEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedEPSGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's diluted earnings per share (EPS) on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying diluted EPS reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class DilutedEPSGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_DilutedEPSGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_DilutedEPSGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedEPSGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedEPSGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedEPSOtherGainsLosses.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The earnings from gains and losses (in the reporting period) divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, convertible preferred stock, etc.\n    /// </summary>\n    public class DilutedEPSOtherGainsLosses : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedEPSOtherGainsLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedEPSOtherGainsLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedEPSOtherGainsLosses()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedEPSOtherGainsLosses(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedExtraordinary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Diluted EPS from Extraordinary Gain/Losses is the gain or loss from extraordinary items divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n    /// </summary>\n    public class DilutedExtraordinary : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DilutedExtraordinary_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DilutedExtraordinary_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedExtraordinary()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedExtraordinary(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DilutedNIAvailtoComStockholdersIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net income to calculate Diluted EPS, accounting for adjustments assuming that all the convertible instruments are being converted to Common Equity.\n    /// </summary>\n    public class DilutedNIAvailtoComStockholdersIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DilutedNIAvailtoComStockholders_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DilutedNIAvailtoComStockholdersIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DilutedNIAvailtoComStockholdersIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendCoverageRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reflects a firm's capacity to pay a dividend, and is defined as Earnings Per Share / Dividend Per Share\n    /// </summary>\n    public class DividendCoverageRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendCoverageRatio_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DividendCoverageRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendCoverageRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendCoverageRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividends earned from equity investment securities. This item is usually only available for bank industry.\n    /// </summary>\n    public class DividendIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_DividendIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_DividendIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendPaidCFOCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend paid to the investors, in the Operating Cash Flow section.\n    /// </summary>\n    public class DividendPaidCFOCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendPaidCFO_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendPaidCFO_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendPaidCFO_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DividendPaidCFO_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendPaidCFOCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendPaidCFOCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendPerShare.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of dividend that a stockholder will receive for each share of stock held. It can be calculated by taking the total amount of dividends paid and dividing it by the total shares outstanding. Dividend per share = total dividend payment/total number of outstanding shares\n    /// </summary>\n    public class DividendPerShare : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_DividendPerShare_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_DividendPerShare_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendPerShare()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendPerShare(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendReceivedCFOCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend received on investment, in the Operating Cash Flow section.\n    /// </summary>\n    public class DividendReceivedCFOCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendReceivedCFO_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendReceivedCFO_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendReceivedCFO_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendReceivedCFO_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DividendReceivedCFO_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendReceivedCFOCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendReceivedCFOCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendsPaidDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend paid to the investors, for the direct cash flow.\n    /// </summary>\n    public class DividendsPaidDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsPaidDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsPaidDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsPaidDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DividendsPaidDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendsPaidDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendsPaidDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendsPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying values of dividends declared but unpaid on equity securities issued and outstanding (also includes dividends collected on behalf of another owner of securities that are being held by entity) by the entity.\n    /// </summary>\n    public class DividendsPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DividendsPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DividendsPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendsPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendsPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendsReceivedCFICashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend received on investment, in the Investing Cash Flow section.\n    /// </summary>\n    public class DividendsReceivedCFICashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedCFI_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DividendsReceivedCFI_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendsReceivedCFICashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendsReceivedCFICashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DividendsReceivedDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend received on the investment, for the direct cash flow.\n    /// </summary>\n    public class DividendsReceivedDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_DividendsReceivedDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_DividendsReceivedDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DividendsReceivedDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DividendsReceivedDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DueFromRelatedPartiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// For an unclassified balance sheet, carrying amount as of the balance sheet date of obligations due all related parties.\n    /// </summary>\n    public class DueFromRelatedPartiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DueFromRelatedParties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DueFromRelatedParties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DueFromRelatedParties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DueFromRelatedParties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DueFromRelatedParties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DueFromRelatedPartiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DueFromRelatedPartiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DuefromRelatedPartiesCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owed to the company from a non-arm's length entity, due within the company's current operating cycle.\n    /// </summary>\n    public class DuefromRelatedPartiesCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DuefromRelatedPartiesCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DuefromRelatedPartiesCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DuefromRelatedPartiesCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DuefromRelatedPartiesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owed to the company from a non-arm's length entity, due after the company's current operating cycle.\n    /// </summary>\n    public class DuefromRelatedPartiesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DuefromRelatedPartiesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DuefromRelatedPartiesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DuefromRelatedPartiesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DuetoRelatedPartiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owed by the company to a non-arm's length entity.\n    /// </summary>\n    public class DuetoRelatedPartiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedParties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedParties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedParties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedParties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DuetoRelatedParties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DuetoRelatedPartiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DuetoRelatedPartiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DuetoRelatedPartiesCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owed by the company to a non-arm's length entity that has to be repaid within the company's current operating cycle.\n    /// </summary>\n    public class DuetoRelatedPartiesCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DuetoRelatedPartiesCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DuetoRelatedPartiesCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DuetoRelatedPartiesCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/DuetoRelatedPartiesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts owed by the company to a non-arm's length entity that has to be repaid after the company's current operating cycle.\n    /// </summary>\n    public class DuetoRelatedPartiesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_DuetoRelatedPartiesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public DuetoRelatedPartiesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public DuetoRelatedPartiesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EBITDAGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the earnings minus expenses (excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n    /// </summary>\n    public class EBITDAGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_EBITDAGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EBITDAGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EBITDAGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EBITDAIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Earnings minus expenses (excluding interest, tax, depreciation, and amortization expenses).\n    /// </summary>\n    public class EBITDAIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBITDA_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_EBITDA_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EBITDAIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EBITDAIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EBITDAMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of earnings before interest, taxes and depreciation and amortization to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: EBITDA / Revenue.\n    /// </summary>\n    public class EBITDAMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITDAMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_EBITDAMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EBITDAMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EBITDAMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EBITIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Earnings minus expenses (excluding interest and tax expenses).\n    /// </summary>\n    public class EBITIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EBIT_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_EBIT_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EBITIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EBITIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EBITMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of earnings before interest and taxes to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: EBIT / Revenue.\n    /// </summary>\n    public class EBITMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_EBITMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_EBITMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EBITMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EBITMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningRatios.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the EarningRatios class\n    /// </summary>\n    public class EarningRatios : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The growth in the company's diluted earnings per share (EPS) on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying diluted EPS reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13015\n        /// </remarks>\n        [JsonProperty(\"13015\")]\n        public DilutedEPSGrowth DilutedEPSGrowth => _dilutedEPSGrowth ??= new(_timeProvider, _securityIdentifier);\n        private DilutedEPSGrowth _dilutedEPSGrowth;\n\n        /// <summary>\n        /// The growth in the company's diluted EPS from continuing operations on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying diluted EPS from continuing operations reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13016\n        /// </remarks>\n        [JsonProperty(\"13016\")]\n        public DilutedContEPSGrowth DilutedContEPSGrowth => _dilutedContEPSGrowth ??= new(_timeProvider, _securityIdentifier);\n        private DilutedContEPSGrowth _dilutedContEPSGrowth;\n\n        /// <summary>\n        /// The growth in the company's dividends per share (DPS) on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying DPS from its dividend database. Morningstar collects its DPS from company filings and reports, as well as from third party sources.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13017\n        /// </remarks>\n        [JsonProperty(\"13017\")]\n        public DPSGrowth DPSGrowth => _dPSGrowth ??= new(_timeProvider, _securityIdentifier);\n        private DPSGrowth _dPSGrowth;\n\n        /// <summary>\n        /// The growth in the company's book value per share on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying equity and end of period shares outstanding reported in the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13018\n        /// </remarks>\n        [JsonProperty(\"13018\")]\n        public EquityPerShareGrowth EquityPerShareGrowth => _equityPerShareGrowth ??= new(_timeProvider, _securityIdentifier);\n        private EquityPerShareGrowth _equityPerShareGrowth;\n\n        /// <summary>\n        /// The five-year growth rate of dividends per share, calculated using regression analysis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13019\n        /// </remarks>\n        [JsonProperty(\"13019\")]\n        public RegressionGrowthofDividends5Years RegressionGrowthofDividends5Years => _regressionGrowthofDividends5Years ??= new(_timeProvider, _securityIdentifier);\n        private RegressionGrowthofDividends5Years _regressionGrowthofDividends5Years;\n\n        /// <summary>\n        /// The growth in the company's free cash flow per share on a percentage basis. Morningstar calculates the growth percentage based on the free cash flow divided by average diluted shares outstanding reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13020\n        /// </remarks>\n        [JsonProperty(\"13020\")]\n        public FCFPerShareGrowth FCFPerShareGrowth => _fCFPerShareGrowth ??= new(_timeProvider, _securityIdentifier);\n        private FCFPerShareGrowth _fCFPerShareGrowth;\n\n        /// <summary>\n        /// The growth in the company's book value per share on a percentage basis. Morningstar calculates the growth percentage based on the common shareholder's equity reported in the Balance Sheet divided by the diluted shares outstanding within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13021\n        /// </remarks>\n        [JsonProperty(\"13021\")]\n        public BookValuePerShareGrowth BookValuePerShareGrowth => _bookValuePerShareGrowth ??= new(_timeProvider, _securityIdentifier);\n        private BookValuePerShareGrowth _bookValuePerShareGrowth;\n\n        /// <summary>\n        /// The growth in the company's Normalized Diluted EPS on a percentage basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13022\n        /// </remarks>\n        [JsonProperty(\"13022\")]\n        public NormalizedDilutedEPSGrowth NormalizedDilutedEPSGrowth => _normalizedDilutedEPSGrowth ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedDilutedEPSGrowth _normalizedDilutedEPSGrowth;\n\n        /// <summary>\n        /// The growth in the company's Normalized Basic EPS on a percentage basis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 13023\n        /// </remarks>\n        [JsonProperty(\"13023\")]\n        public NormalizedBasicEPSGrowth NormalizedBasicEPSGrowth => _normalizedBasicEPSGrowth ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedBasicEPSGrowth _normalizedBasicEPSGrowth;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningRatios(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new EarningRatios(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReports.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the EarningReports class\n    /// </summary>\n    public class EarningReports : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The exact date that is given in the financial statements for each quarter's end.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20001\n        /// </remarks>\n        [JsonProperty(\"20001\")]\n        public EarningReportsPeriodEndingDate PeriodEndingDate => _periodEndingDate ??= new(_timeProvider, _securityIdentifier);\n        private EarningReportsPeriodEndingDate _periodEndingDate;\n\n        /// <summary>\n        /// Specific date on which a company released its filing to the public.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20002\n        /// </remarks>\n        [JsonProperty(\"20002\")]\n        public EarningReportsFileDate FileDate => _fileDate ??= new(_timeProvider, _securityIdentifier);\n        private EarningReportsFileDate _fileDate;\n\n        /// <summary>\n        /// The accession number is a unique number that EDGAR assigns to each submission as the submission is received.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20003\n        /// </remarks>\n        [JsonProperty(\"20003\")]\n        public EarningReportsAccessionNumber AccessionNumber => _accessionNumber ??= new(_timeProvider, _securityIdentifier);\n        private EarningReportsAccessionNumber _accessionNumber;\n\n        /// <summary>\n        /// The type of filing of the report: for instance, 10-K (annual report) or 10-Q (quarterly report).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20004\n        /// </remarks>\n        [JsonProperty(\"20004\")]\n        public EarningReportsFormType FormType => _formType ??= new(_timeProvider, _securityIdentifier);\n        private EarningReportsFormType _formType;\n\n        /// <summary>\n        /// The nature of the period covered by an individual set of financial results. The output can be: Quarter, Semi-annual or Annual. Assuming a 12-month fiscal year, quarter typically covers a three-month period, semi-annual a six-month period, and annual a twelve-month period. Annual could cover results collected either from preliminary results or an annual report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28006\n        /// </remarks>\n        [JsonProperty(\"28006\")]\n        public EarningReportsPeriodType PeriodType => _periodType ??= new(_timeProvider, _securityIdentifier);\n        private EarningReportsPeriodType _periodType;\n\n        /// <summary>\n        /// Basic EPS from Continuing Operations is the earnings from continuing operations reported by the company divided by the weighted average number of common shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29000\n        /// </remarks>\n        [JsonProperty(\"29000\")]\n        public BasicContinuousOperations BasicContinuousOperations => _basicContinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private BasicContinuousOperations _basicContinuousOperations;\n\n        /// <summary>\n        /// Basic EPS from Discontinued Operations is the earnings from discontinued operations reported by the company divided by the weighted average number of common shares outstanding. This only includes gain or loss from discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29001\n        /// </remarks>\n        [JsonProperty(\"29001\")]\n        public BasicDiscontinuousOperations BasicDiscontinuousOperations => _basicDiscontinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private BasicDiscontinuousOperations _basicDiscontinuousOperations;\n\n        /// <summary>\n        /// Basic EPS from the Extraordinary Gains/Losses is the earnings attributable to the gains or losses (during the reporting period) from extraordinary items divided by the weighted average number of common shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29002\n        /// </remarks>\n        [JsonProperty(\"29002\")]\n        public BasicExtraordinary BasicExtraordinary => _basicExtraordinary ??= new(_timeProvider, _securityIdentifier);\n        private BasicExtraordinary _basicExtraordinary;\n\n        /// <summary>\n        /// Basic EPS from the Cumulative Effect of Accounting Change is the earnings attributable to the accounting change (during the reporting period) divided by the weighted average number of common shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29003\n        /// </remarks>\n        [JsonProperty(\"29003\")]\n        public BasicAccountingChange BasicAccountingChange => _basicAccountingChange ??= new(_timeProvider, _securityIdentifier);\n        private BasicAccountingChange _basicAccountingChange;\n\n        /// <summary>\n        /// Basic EPS is the bottom line net income divided by the weighted average number of common shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29004\n        /// </remarks>\n        [JsonProperty(\"29004\")]\n        public BasicEPS BasicEPS => _basicEPS ??= new(_timeProvider, _securityIdentifier);\n        private BasicEPS _basicEPS;\n\n        /// <summary>\n        /// Diluted EPS from Continuing Operations is the earnings from continuing operations divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29005\n        /// </remarks>\n        [JsonProperty(\"29005\")]\n        public DilutedContinuousOperations DilutedContinuousOperations => _dilutedContinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private DilutedContinuousOperations _dilutedContinuousOperations;\n\n        /// <summary>\n        /// Diluted EPS from Discontinued Operations is the earnings from discontinued operations divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock. This only includes gain or loss from discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29006\n        /// </remarks>\n        [JsonProperty(\"29006\")]\n        public DilutedDiscontinuousOperations DilutedDiscontinuousOperations => _dilutedDiscontinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private DilutedDiscontinuousOperations _dilutedDiscontinuousOperations;\n\n        /// <summary>\n        /// Diluted EPS from Extraordinary Gain/Losses is the gain or loss from extraordinary items divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29007\n        /// </remarks>\n        [JsonProperty(\"29007\")]\n        public DilutedExtraordinary DilutedExtraordinary => _dilutedExtraordinary ??= new(_timeProvider, _securityIdentifier);\n        private DilutedExtraordinary _dilutedExtraordinary;\n\n        /// <summary>\n        /// Diluted EPS from Cumulative Effect Accounting Changes is the earnings from accounting changes (in the reporting period) divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29008\n        /// </remarks>\n        [JsonProperty(\"29008\")]\n        public DilutedAccountingChange DilutedAccountingChange => _dilutedAccountingChange ??= new(_timeProvider, _securityIdentifier);\n        private DilutedAccountingChange _dilutedAccountingChange;\n\n        /// <summary>\n        /// Diluted EPS is the bottom line net income divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, and convertible preferred stock. This value will be derived when not reported for the fourth quarter and will be less than or equal to Basic EPS.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29009\n        /// </remarks>\n        [JsonProperty(\"29009\")]\n        public DilutedEPS DilutedEPS => _dilutedEPS ??= new(_timeProvider, _securityIdentifier);\n        private DilutedEPS _dilutedEPS;\n\n        /// <summary>\n        /// The shares outstanding used to calculate Basic EPS, which is the weighted average common share outstanding through the whole accounting period. Note: If Basic Average Shares are not presented by the firm in the Income Statement, this data point will be null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29010\n        /// </remarks>\n        [JsonProperty(\"29010\")]\n        public BasicAverageShares BasicAverageShares => _basicAverageShares ??= new(_timeProvider, _securityIdentifier);\n        private BasicAverageShares _basicAverageShares;\n\n        /// <summary>\n        /// The shares outstanding used to calculate the diluted EPS, assuming the conversion of all convertible securities and the exercise of warrants or stock options. It is the weighted average diluted share outstanding through the whole accounting period. Note: If Diluted Average Shares are not presented by the firm in the Income Statement and Basic Average Shares are presented, Diluted Average Shares will equal Basic Average Shares. However, if neither value is presented by the firm, Diluted Average Shares will be null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29011\n        /// </remarks>\n        [JsonProperty(\"29011\")]\n        public DilutedAverageShares DilutedAverageShares => _dilutedAverageShares ??= new(_timeProvider, _securityIdentifier);\n        private DilutedAverageShares _dilutedAverageShares;\n\n        /// <summary>\n        /// The amount of dividend that a stockholder will receive for each share of stock held. It can be calculated by taking the total amount of dividends paid and dividing it by the total shares outstanding. Dividend per share = total dividend payment/total number of outstanding shares\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29012\n        /// </remarks>\n        [JsonProperty(\"29012\")]\n        public DividendPerShare DividendPerShare => _dividendPerShare ??= new(_timeProvider, _securityIdentifier);\n        private DividendPerShare _dividendPerShare;\n\n        /// <summary>\n        /// Basic EPS from the Other Gains/Losses is the earnings attributable to the other gains/losses (during the reporting period) divided by the weighted average number of common shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29013\n        /// </remarks>\n        [JsonProperty(\"29013\")]\n        public BasicEPSOtherGainsLosses BasicEPSOtherGainsLosses => _basicEPSOtherGainsLosses ??= new(_timeProvider, _securityIdentifier);\n        private BasicEPSOtherGainsLosses _basicEPSOtherGainsLosses;\n\n        /// <summary>\n        /// Basic EPS from Continuing Operations plus Basic EPS from Discontinued Operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29014\n        /// </remarks>\n        [JsonProperty(\"29014\")]\n        public ContinuingAndDiscontinuedBasicEPS ContinuingAndDiscontinuedBasicEPS => _continuingAndDiscontinuedBasicEPS ??= new(_timeProvider, _securityIdentifier);\n        private ContinuingAndDiscontinuedBasicEPS _continuingAndDiscontinuedBasicEPS;\n\n        /// <summary>\n        /// The earnings attributable to the tax loss carry forward (during the reporting period).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29015\n        /// </remarks>\n        [JsonProperty(\"29015\")]\n        public TaxLossCarryforwardBasicEPS TaxLossCarryforwardBasicEPS => _taxLossCarryforwardBasicEPS ??= new(_timeProvider, _securityIdentifier);\n        private TaxLossCarryforwardBasicEPS _taxLossCarryforwardBasicEPS;\n\n        /// <summary>\n        /// The earnings from gains and losses (in the reporting period) divided by the common shares outstanding adjusted for the assumed conversion of all potentially dilutive securities. Securities having a dilutive effect may include convertible debentures, warrants, options, convertible preferred stock, etc.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29016\n        /// </remarks>\n        [JsonProperty(\"29016\")]\n        public DilutedEPSOtherGainsLosses DilutedEPSOtherGainsLosses => _dilutedEPSOtherGainsLosses ??= new(_timeProvider, _securityIdentifier);\n        private DilutedEPSOtherGainsLosses _dilutedEPSOtherGainsLosses;\n\n        /// <summary>\n        /// Diluted EPS from Continuing Operations plus Diluted EPS from Discontinued Operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29017\n        /// </remarks>\n        [JsonProperty(\"29017\")]\n        public ContinuingAndDiscontinuedDilutedEPS ContinuingAndDiscontinuedDilutedEPS => _continuingAndDiscontinuedDilutedEPS ??= new(_timeProvider, _securityIdentifier);\n        private ContinuingAndDiscontinuedDilutedEPS _continuingAndDiscontinuedDilutedEPS;\n\n        /// <summary>\n        /// The earnings from any tax loss carry forward (in the reporting period).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29018\n        /// </remarks>\n        [JsonProperty(\"29018\")]\n        public TaxLossCarryforwardDilutedEPS TaxLossCarryforwardDilutedEPS => _taxLossCarryforwardDilutedEPS ??= new(_timeProvider, _securityIdentifier);\n        private TaxLossCarryforwardDilutedEPS _taxLossCarryforwardDilutedEPS;\n\n        /// <summary>\n        /// The basic normalized earnings per share. Normalized EPS removes onetime and unusual items from EPS, to provide investors with a more accurate measure of the company's true earnings. Normalized Earnings / Basic Weighted Average Shares Outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29019\n        /// </remarks>\n        [JsonProperty(\"29019\")]\n        public NormalizedBasicEPS NormalizedBasicEPS => _normalizedBasicEPS ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedBasicEPS _normalizedBasicEPS;\n\n        /// <summary>\n        /// The diluted normalized earnings per share. Normalized EPS removes onetime and unusual items from EPS, to provide investors with a more accurate measure of the company's true earnings. Normalized Earnings / Diluted Weighted Average Shares Outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29020\n        /// </remarks>\n        [JsonProperty(\"29020\")]\n        public NormalizedDilutedEPS NormalizedDilutedEPS => _normalizedDilutedEPS ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedDilutedEPS _normalizedDilutedEPS;\n\n        /// <summary>\n        /// Total Dividend Per Share is cash dividends and special cash dividends paid per share over a certain period of time.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29021\n        /// </remarks>\n        [JsonProperty(\"29021\")]\n        public TotalDividendPerShare TotalDividendPerShare => _totalDividendPerShare ??= new(_timeProvider, _securityIdentifier);\n        private TotalDividendPerShare _totalDividendPerShare;\n\n        /// <summary>\n        /// Normalized Basic EPS as reported by the company in the financial statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29022\n        /// </remarks>\n        [JsonProperty(\"29022\")]\n        public ReportedNormalizedBasicEPS ReportedNormalizedBasicEPS => _reportedNormalizedBasicEPS ??= new(_timeProvider, _securityIdentifier);\n        private ReportedNormalizedBasicEPS _reportedNormalizedBasicEPS;\n\n        /// <summary>\n        /// Normalized Diluted EPS as reported by the company in the financial statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29023\n        /// </remarks>\n        [JsonProperty(\"29023\")]\n        public ReportedNormalizedDilutedEPS ReportedNormalizedDilutedEPS => _reportedNormalizedDilutedEPS ??= new(_timeProvider, _securityIdentifier);\n        private ReportedNormalizedDilutedEPS _reportedNormalizedDilutedEPS;\n\n        /// <summary>\n        /// Reflects a firm's capacity to pay a dividend, and is defined as Earnings Per Share / Dividend Per Share\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 29024\n        /// </remarks>\n        [JsonProperty(\"29024\")]\n        public DividendCoverageRatio DividendCoverageRatio => _dividendCoverageRatio ??= new(_timeProvider, _securityIdentifier);\n        private DividendCoverageRatio _dividendCoverageRatio;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReports(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new EarningReports(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReportsAccessionNumber.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The accession number is a unique number that EDGAR assigns to each submission as the submission is received.\n    /// </summary>\n    public class EarningReportsAccessionNumber : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneMonth\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_OneMonth));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_AccessionNumber_OneMonth);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_AccessionNumber_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningReportsAccessionNumber()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReportsAccessionNumber(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReportsFileDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Specific date on which a company released its filing to the public.\n    /// </summary>\n    public class EarningReportsFileDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FileDate_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_FileDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningReportsFileDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReportsFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReportsFormType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The type of filing of the report: for instance, 10-K (annual report) or 10-Q (quarterly report).\n    /// </summary>\n    public class EarningReportsFormType : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_FormType_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_FormType_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningReportsFormType()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReportsFormType(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReportsPeriodEndingDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The exact date that is given in the financial statements for each quarter's end.\n    /// </summary>\n    public class EarningReportsPeriodEndingDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodEndingDate_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_PeriodEndingDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningReportsPeriodEndingDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReportsPeriodEndingDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningReportsPeriodType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The nature of the period covered by an individual set of financial results. The output can be: Quarter, Semi-annual or Annual. Assuming a 12-month fiscal year, quarter typically covers a three-month period, semi-annual a six-month period, and annual a twelve-month period. Annual could cover results collected either from preliminary results or an annual report\n    /// </summary>\n    public class EarningReportsPeriodType : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_PeriodType_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_PeriodType_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningReportsPeriodType()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningReportsPeriodType(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningsFromEquityInterestIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The earnings from equity interest can be a result of any of the following: Income from earnings distribution of the business, either as dividends paid to corporate shareholders or as drawings in a partnership; Capital gain realized upon sale of the business; Capital gain realized from selling his or her interest to other partners. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class EarningsFromEquityInterestIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsFromEquityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_EarningsFromEquityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningsFromEquityInterestIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningsFromEquityInterestIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningsLossesFromEquityInvestmentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item represents the entity's proportionate share for the period of the net income (loss) of its investee (such as unconsolidated subsidiaries and joint ventures) to which the equity method of accounting is applied. The amount typically reflects adjustments.\n    /// </summary>\n    public class EarningsLossesFromEquityInvestmentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_EarningsLossesFromEquityInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningsLossesFromEquityInvestmentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningsLossesFromEquityInvestmentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EarningsfromEquityInterestNetOfTaxIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income from other equity interest reported after Provision of Tax. This applies to all industries.\n    /// </summary>\n    public class EarningsfromEquityInterestNetOfTaxIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_EarningsfromEquityInterestNetOfTax_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EarningsfromEquityInterestNetOfTaxIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EarningsfromEquityInterestNetOfTaxIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EffectOfExchangeRateChangesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The effect of exchange rate changes on cash balances held in foreign currencies.\n    /// </summary>\n    public class EffectOfExchangeRateChangesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_EffectOfExchangeRateChanges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EffectOfExchangeRateChangesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EffectOfExchangeRateChangesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EffectiveTaxRateAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The average tax rate for the period as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class EffectiveTaxRateAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_EffectiveTaxRateAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EffectiveTaxRateAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EffectiveTaxRateAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ElectricUtilityPlantBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount for the electric plant related to the utility industry.\n    /// </summary>\n    public class ElectricUtilityPlantBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ElectricUtilityPlant_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ElectricUtilityPlant_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ElectricUtilityPlant_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ElectricUtilityPlant_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ElectricUtilityPlant_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ElectricUtilityPlantBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ElectricUtilityPlantBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EmployeeBenefitsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount as of the balance sheet date of the portion of the obligations recognized for the various benefits provided to former or inactive employees, their beneficiaries, and covered dependents after employment but before retirement.\n    /// </summary>\n    public class EmployeeBenefitsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EmployeeBenefits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_EmployeeBenefits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EmployeeBenefitsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EmployeeBenefitsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EndCashPositionCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash and cash equivalents balance at the end of the accounting period, as indicated on the Cash Flow statement. It is equal to the Beginning Cash and Equivalents, plus the Net Change in Cash and Equivalents.\n    /// </summary>\n    public class EndCashPositionCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_EndCashPosition_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_EndCashPosition_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EndCashPositionCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EndCashPositionCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EquipmentIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Equipment expenses include depreciation, repairs, rentals, and service contract costs. This also includes equipment purchases which do not qualify for capitalization in accordance with the entity's accounting policy. This item may also include furniture expenses. This item is usually only available for bank industry.\n    /// </summary>\n    public class EquipmentIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Equipment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_Equipment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EquipmentIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EquipmentIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EquityAttributableToOwnersOfParentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// \n    /// </summary>\n    public class EquityAttributableToOwnersOfParentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_EquityAttributableToOwnersOfParent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EquityAttributableToOwnersOfParentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EquityAttributableToOwnersOfParentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EquityInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This asset represents equity securities categorized neither as held-to-maturity nor trading.\n    /// </summary>\n    public class EquityInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquityInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_EquityInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EquityInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EquityInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EquityPerShareGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's book value per share on a percentage basis. Morningstar calculates the annualized growth percentage based on the underlying equity and end of period shares outstanding reported in the company filings or reports.\n    /// </summary>\n    public class EquityPerShareGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_EquityPerShareGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_EquityPerShareGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EquityPerShareGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EquityPerShareGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/EquitySharesInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Investments in shares of a company representing ownership in that company.\n    /// </summary>\n    public class EquitySharesInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquitySharesInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquitySharesInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquitySharesInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_EquitySharesInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_EquitySharesInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public EquitySharesInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public EquitySharesInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reductions in the entity's income taxes that arise when compensation cost (from non-qualified share-based compensation) recognized on the entities tax return exceeds compensation cost from share-based compensation recognized in financial statements. This element reduces net cash provided by operating activities.\n    /// </summary>\n    public class ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ExcessTaxBenefitFromStockBasedCompensation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ExciseTaxesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Excise taxes are taxes paid when purchases are made on a specific good, such as gasoline. Excise taxes are often included in the price of the product. There are also excise taxes on activities, such as on wagering or on highway usage by trucks.\n    /// </summary>\n    public class ExciseTaxesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExciseTaxes_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ExciseTaxes_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ExciseTaxesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ExciseTaxesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ExpenseRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A measure of operating performance for Insurance companies, as it shows the relationship between the premiums earned and administrative expenses related to claims such as fees and commissions. A number of 1 or lower is preferred, as this means the premiums exceed the expenses. Calculated as: (Deferred Policy Acquisition Amortization Expense+Fees and Commission Expense+Other Underwriting Expenses+Selling, General and Administrative) / Net Premiums Earned\n    /// </summary>\n    public class ExpenseRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ExpenseRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ExpenseRatio_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ExpenseRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ExpenseRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ExpenseRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ExpenseRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ExpenseRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Costs incurred in identifying areas that may warrant examination and in examining specific areas that are considered to have prospects of containing energy or metal reserves, including costs of drilling exploratory wells. Development expense is the capitalized costs incurred to obtain access to proved reserves and to provide facilities for extracting, treating, gathering and storing the energy and metal. Mineral property includes oil and gas wells, mines, and other natural deposits (including geothermal deposits). The payment for leasing those properties is called mineral property lease expense. Exploration expense is included in operation expenses for mining industry.\n    /// </summary>\n    public class ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ExplorationDevelopmentAndMineralPropertyLeaseExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FCFGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the underlying cash flow from operations and capital expenditures data reported in the Cash Flow Statement within the company filings or reports: Free Cash Flow = Cash flow from operations - Capital Expenditures.\n    /// </summary>\n    public class FCFGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FCFGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FCFGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FCFGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FCFNetIncomeRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Free Cash Flow / Net Income\n    /// </summary>\n    public class FCFNetIncomeRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFNetIncomeRatio_OneYear);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFNetIncomeRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFNetIncomeRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FCFNetIncomeRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FCFNetIncomeRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FCFNetIncomeRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FCFPerShareGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's free cash flow per share on a percentage basis. Morningstar calculates the growth percentage based on the free cash flow divided by average diluted shares outstanding reported in the Financial Statements within the company filings or reports.\n    /// </summary>\n    public class FCFPerShareGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_FCFPerShareGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_FCFPerShareGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_FCFPerShareGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_FCFPerShareGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_FCFPerShareGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_FCFPerShareGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FCFPerShareGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FCFPerShareGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FCFSalesRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Free Cash flow / Revenue\n    /// </summary>\n    public class FCFSalesRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFSalesRatio_OneYear);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFSalesRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFSalesRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FCFSalesRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FCFSalesRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FCFSalesRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FCFtoCFO.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Indicates the percentage of a company's operating cash flow is free to be invested in its business after capital expenditures.\n    /// </summary>\n    public class FCFtoCFO : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFtoCFO_OneYear);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFtoCFO_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FCFtoCFO_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FCFtoCFO_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FCFtoCFO()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FCFtoCFO(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This liability refers to the amount shown on the books that a bank with insufficient reserves borrows, at the federal funds rate, from another bank to meet its reserve requirements; and the amount of securities that an institution sells and agrees to repurchase at a specified date for a specified price, net of any reductions or offsets.\n    /// </summary>\n    public class FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchase_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FederalFundsPurchasedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount borrowed by a bank, at the federal funds rate, from another bank to meet its reserve requirements. This item is typically available for the bank industry.\n    /// </summary>\n    public class FederalFundsPurchasedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchased_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchased_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchased_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsPurchased_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FederalFundsPurchased_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FederalFundsPurchasedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FederalFundsPurchasedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This asset refers to very-short-term loans of funds to other banks and securities dealers.\n    /// </summary>\n    public class FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FederalFundsSoldBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Federal funds transactions involve lending (federal funds sold) or borrowing (federal funds purchased) of immediately available reserve balances. This item is typically available for the bank industry.\n    /// </summary>\n    public class FederalFundsSoldBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSold_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSold_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSold_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSold_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalFundsSold_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FederalFundsSold_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FederalFundsSoldBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FederalFundsSoldBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FederalHomeLoanBankStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Federal Home Loan Bank stock represents an equity interest in a FHLB. It does not have a readily determinable fair value because its ownership is restricted and it lacks a market (liquidity). This item is typically available for the bank industry.\n    /// </summary>\n    public class FederalHomeLoanBankStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FederalHomeLoanBankStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FederalHomeLoanBankStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FederalHomeLoanBankStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FeeRevenueAndOtherIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of fees, commissions, and other income.\n    /// </summary>\n    public class FeeRevenueAndOtherIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_FeeRevenueAndOtherIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FeeRevenueAndOtherIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FeeRevenueAndOtherIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FeesAndCommissionsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total fees and commissions earned from providing services such as leasing of space or maintaining: (1) depositor accounts; (2) transfer agent; (3) fiduciary and trust; (4) brokerage and underwriting; (5) mortgage; (6) credit cards; (7) correspondent clearing; and (8) other such services and activities performed for others. This item is usually available for bank and insurance industries.\n    /// </summary>\n    public class FeesAndCommissionsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesAndCommissions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_FeesAndCommissions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FeesAndCommissionsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FeesAndCommissionsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FeesandCommissionExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cost incurred by bank and insurance companies for fees and commission income.\n    /// </summary>\n    public class FeesandCommissionExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_FeesandCommissionExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FeesandCommissionExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FeesandCommissionExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FeesandCommissionIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fees and commission income earned by bank and insurance companies on the rendering services.\n    /// </summary>\n    public class FeesandCommissionIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FeesandCommissionIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_FeesandCommissionIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FeesandCommissionIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FeesandCommissionIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinanceLeaseReceivablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts owed to the bank in relation to capital leases. Capital/ finance lease obligation are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n    /// </summary>\n    public class FinanceLeaseReceivablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinanceLeaseReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinanceLeaseReceivablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinanceLeaseReceivablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinanceLeaseReceivablesCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts owed to the bank in relation to capital leases to be received within the next accounting PeriodAsByte. Capital/ finance lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n    /// </summary>\n    public class FinanceLeaseReceivablesCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinanceLeaseReceivablesCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinanceLeaseReceivablesCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinanceLeaseReceivablesCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinanceLeaseReceivablesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts owed to the bank in relation to capital leases to be received beyond the next accounting PeriodAsByte. Capital/ finance lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n    /// </summary>\n    public class FinanceLeaseReceivablesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinanceLeaseReceivablesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinanceLeaseReceivablesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinanceLeaseReceivablesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fair values as of the balance sheet date of all assets resulting from contracts that meet the criteria of being accounted for as derivative instruments, net of the effects of master netting arrangements.\n    /// </summary>\n    public class FinancialAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial assets that are held at fair value through profit or loss comprise assets held for trading and those financial assets designated as being held at fair value through profit or loss.\n    /// </summary>\n    public class FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialAssetsDesignatedasFairValueThroughProfitorLossTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value as of the balance sheet date of securities that an institution sells and agrees to repurchase (the identical or substantially the same securities) as a seller-borrower at a specified date for a specified price, also known as a repurchase agreement. This item is typically available for bank industry.\n    /// </summary>\n    public class FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialInstrumentsSoldUnderAgreementsToRepurchase_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialLeverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Total Assets to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Total Assets / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n    /// </summary>\n    public class FinancialLeverage : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FinancialLeverage_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FinancialLeverage_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialLeverage()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialLeverage(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialLiabilitiesCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial related liabilities due within one year, including short term and current portions of long-term debt, capital leases and derivative liabilities.\n    /// </summary>\n    public class FinancialLiabilitiesCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialLiabilitiesCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialLiabilitiesCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialLiabilitiesCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial liabilities that are held at fair value through profit or loss.\n    /// </summary>\n    public class FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial liabilities carried at amortized cost.\n    /// </summary>\n    public class FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialLiabilitiesMeasuredatAmortizedCostTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialLiabilitiesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial related liabilities due beyond one year, including long term debt, capital leases and derivative liabilities.\n    /// </summary>\n    public class FinancialLiabilitiesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialLiabilitiesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialLiabilitiesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialLiabilitiesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Financial instruments that are linked to a specific financial instrument or indicator or commodity, and through which specific financial risks can be traded in financial markets in their own right, such as financial options, futures, forwards, etc.\n    /// </summary>\n    public class FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinancialOrDerivativeInvestmentCurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatements.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the FinancialStatements class\n    /// </summary>\n    public class FinancialStatements : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The exact date that is given in the financial statements for each quarter's end.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20001\n        /// </remarks>\n        [JsonProperty(\"20001\")]\n        public FinancialStatementsPeriodEndingDate PeriodEndingDate => _periodEndingDate ??= new(_timeProvider, _securityIdentifier);\n        private FinancialStatementsPeriodEndingDate _periodEndingDate;\n\n        /// <summary>\n        /// Specific date on which a company released its filing to the public.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20002\n        /// </remarks>\n        [JsonProperty(\"20002\")]\n        public FinancialStatementsFileDate FileDate => _fileDate ??= new(_timeProvider, _securityIdentifier);\n        private FinancialStatementsFileDate _fileDate;\n\n        /// <summary>\n        /// The accession number is a unique number that EDGAR assigns to each submission as the submission is received.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20003\n        /// </remarks>\n        [JsonProperty(\"20003\")]\n        public FinancialStatementsAccessionNumber AccessionNumber => _accessionNumber ??= new(_timeProvider, _securityIdentifier);\n        private FinancialStatementsAccessionNumber _accessionNumber;\n\n        /// <summary>\n        /// The type of filing of the report: for instance, 10-K (annual report) or 10-Q (quarterly report).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20004\n        /// </remarks>\n        [JsonProperty(\"20004\")]\n        public FinancialStatementsFormType FormType => _formType ??= new(_timeProvider, _securityIdentifier);\n        private FinancialStatementsFormType _formType;\n\n        /// <summary>\n        /// The name of the auditor that performed the financial statement audit for the given period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28000\n        /// </remarks>\n        [JsonProperty(\"28000\")]\n        public PeriodAuditor PeriodAuditor => _periodAuditor ??= new(_timeProvider, _securityIdentifier);\n        private PeriodAuditor _periodAuditor;\n\n        /// <summary>\n        /// Auditor opinion code will be one of the following for each annual period: Code Meaning UQ Unqualified Opinion UE Unqualified Opinion with Explanation QM Qualified - Due to change in accounting method QL Qualified - Due to litigation OT Qualified Opinion - Other AO Adverse Opinion DS Disclaim an opinion UA Unaudited\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28001\n        /// </remarks>\n        [JsonProperty(\"28001\")]\n        public AuditorReportStatus AuditorReportStatus => _auditorReportStatus ??= new(_timeProvider, _securityIdentifier);\n        private AuditorReportStatus _auditorReportStatus;\n\n        /// <summary>\n        /// Which method of inventory valuation was used - LIFO, FIFO, Average, Standard costs, Net realizable value, Others, LIFO and FIFO, FIFO and Average, FIFO and other, LIFO and Average, LIFO and other, Average and other, 3 or more methods, None\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28002\n        /// </remarks>\n        [JsonProperty(\"28002\")]\n        public InventoryValuationMethod InventoryValuationMethod => _inventoryValuationMethod ??= new(_timeProvider, _securityIdentifier);\n        private InventoryValuationMethod _inventoryValuationMethod;\n\n        /// <summary>\n        /// The number of shareholders on record\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28003\n        /// </remarks>\n        [JsonProperty(\"28003\")]\n        public NumberOfShareHolders NumberOfShareHolders => _numberOfShareHolders ??= new(_timeProvider, _securityIdentifier);\n        private NumberOfShareHolders _numberOfShareHolders;\n\n        /// <summary>\n        /// The nature of the period covered by an individual set of financial results. The output can be: Quarter, Semi-annual or Annual. Assuming a 12-month fiscal year, quarter typically covers a three-month period, semi-annual a six-month period, and annual a twelve-month period. Annual could cover results collected either from preliminary results or an annual report\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28006\n        /// </remarks>\n        [JsonProperty(\"28006\")]\n        public FinancialStatementsPeriodType PeriodType => _periodType ??= new(_timeProvider, _securityIdentifier);\n        private FinancialStatementsPeriodType _periodType;\n\n        /// <summary>\n        /// The sum of Tier 1 and Tier 2 Capital. Tier 1 capital consists of common shareholders equity, perpetual preferred shareholders equity with non-cumulative dividends, retained earnings, and minority interests in the equity accounts of consolidated subsidiaries. Tier 2 capital consists of subordinated debt, intermediate-term preferred stock, cumulative and long-term preferred stock, and a portion of a bank's allowance for loan and lease losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 28004\n        /// </remarks>\n        [JsonProperty(\"28004\")]\n        public TotalRiskBasedCapital TotalRiskBasedCapital => _totalRiskBasedCapital ??= new(_timeProvider, _securityIdentifier);\n        private TotalRiskBasedCapital _totalRiskBasedCapital;\n\n        /// <summary>\n        /// The instance of the IncomeStatement class\n        /// </summary>\n\n        public IncomeStatement IncomeStatement => _incomeStatement ??= new(_timeProvider, _securityIdentifier);\n        private IncomeStatement _incomeStatement;\n\n        /// <summary>\n        /// The instance of the BalanceSheet class\n        /// </summary>\n\n        public BalanceSheet BalanceSheet => _balanceSheet ??= new(_timeProvider, _securityIdentifier);\n        private BalanceSheet _balanceSheet;\n\n        /// <summary>\n        /// The instance of the CashFlowStatement class\n        /// </summary>\n\n        public CashFlowStatement CashFlowStatement => _cashFlowStatement ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowStatement _cashFlowStatement;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatements(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new FinancialStatements(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatementsAccessionNumber.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The accession number is a unique number that EDGAR assigns to each submission as the submission is received.\n    /// </summary>\n    public class FinancialStatementsAccessionNumber : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneMonth\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_OneMonth));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AccessionNumber_OneMonth);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_AccessionNumber_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialStatementsAccessionNumber()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatementsAccessionNumber(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatementsFileDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Specific date on which a company released its filing to the public.\n    /// </summary>\n    public class FinancialStatementsFileDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FileDate_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_FileDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialStatementsFileDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatementsFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatementsFormType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The type of filing of the report: for instance, 10-K (annual report) or 10-Q (quarterly report).\n    /// </summary>\n    public class FinancialStatementsFormType : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_FormType_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_FormType_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialStatementsFormType()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatementsFormType(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatementsPeriodEndingDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The exact date that is given in the financial statements for each quarter's end.\n    /// </summary>\n    public class FinancialStatementsPeriodEndingDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodEndingDate_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_PeriodEndingDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialStatementsPeriodEndingDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatementsPeriodEndingDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancialStatementsPeriodType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The nature of the period covered by an individual set of financial results. The output can be: Quarter, Semi-annual or Annual. Assuming a 12-month fiscal year, quarter typically covers a three-month period, semi-annual a six-month period, and annual a twelve-month period. Annual could cover results collected either from preliminary results or an annual report\n    /// </summary>\n    public class FinancialStatementsPeriodType : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"ThreeMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_ThreeMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodType_ThreeMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_PeriodType_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancialStatementsPeriodType()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancialStatementsPeriodType(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinancingCashFlowCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash inflow (outflow) from financing activity for the period, which involve changes to the long-term liabilities and stockholders' equity.\n    /// </summary>\n    public class FinancingCashFlowCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FinancingCashFlow_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_FinancingCashFlow_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinancingCashFlowCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinancingCashFlowCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FineFundamental.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the FineFundamental class\n    /// </summary>\n    public partial class FineFundamental : CoarseFundamental\n    {\n        private readonly FundamentalInstanceProvider _fundamentalInstanceProvider;\n\n        /// <summary>\n        /// The instance of the CompanyReference class\n        /// </summary>\n        [PandasNonExpandable]\n        public CompanyReference CompanyReference => _fundamentalInstanceProvider.GetCompanyReference(Time);\n\n        /// <summary>\n        /// The instance of the SecurityReference class\n        /// </summary>\n        [PandasNonExpandable]\n        public SecurityReference SecurityReference => _fundamentalInstanceProvider.GetSecurityReference(Time);\n\n        /// <summary>\n        /// The instance of the FinancialStatements class\n        /// </summary>\n        [PandasNonExpandable]\n        public FinancialStatements FinancialStatements => _fundamentalInstanceProvider.GetFinancialStatements(Time);\n\n        /// <summary>\n        /// The instance of the EarningReports class\n        /// </summary>\n        [PandasNonExpandable]\n        public EarningReports EarningReports => _fundamentalInstanceProvider.GetEarningReports(Time);\n\n        /// <summary>\n        /// The instance of the OperationRatios class\n        /// </summary>\n        [PandasNonExpandable]\n        public OperationRatios OperationRatios => _fundamentalInstanceProvider.GetOperationRatios(Time);\n\n        /// <summary>\n        /// The instance of the EarningRatios class\n        /// </summary>\n        [PandasNonExpandable]\n        public EarningRatios EarningRatios => _fundamentalInstanceProvider.GetEarningRatios(Time);\n\n        /// <summary>\n        /// The instance of the ValuationRatios class\n        /// </summary>\n        [PandasNonExpandable]\n        public ValuationRatios ValuationRatios => _fundamentalInstanceProvider.GetValuationRatios(Time);\n\n        /// <summary>\n        /// The instance of the CompanyProfile class\n        /// </summary>\n        [PandasNonExpandable]\n        public CompanyProfile CompanyProfile => _fundamentalInstanceProvider.GetCompanyProfile(Time);\n\n        /// <summary>\n        /// The instance of the AssetClassification class\n        /// </summary>\n        [PandasNonExpandable]\n        public AssetClassification AssetClassification => _fundamentalInstanceProvider.GetAssetClassification(Time);\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FineFundamental()\n        {\n            _fundamentalInstanceProvider = FundamentalInstanceProvider.Get(Symbol.Empty);\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FineFundamental(DateTime time, Symbol symbol)\n        {\n            Time = time;\n            Symbol = symbol;\n            _fundamentalInstanceProvider = FundamentalInstanceProvider.Get(symbol);\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FineFundamental(DateTime time, Symbol symbol, FundamentalInstanceProvider fundamentalInstanceProvider)\n        {\n            Time = time;\n            Symbol = symbol;\n            _fundamentalInstanceProvider = fundamentalInstanceProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FinishedGoodsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amount as of the balance sheet date of merchandise or goods held by the company that are readily available for sale. This item is typically available for mining and manufacturing industries.\n    /// </summary>\n    public class FinishedGoodsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FinishedGoods_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FinishedGoods_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FinishedGoodsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FinishedGoodsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FixAssetsTuronver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue / Average PP&amp;E\n    /// </summary>\n    public class FixAssetsTuronver : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FixAssetsTuronver_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FixAssetsTuronver_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FixAssetsTuronver_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FixAssetsTuronver_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_FixAssetsTuronver_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_FixAssetsTuronver_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FixAssetsTuronver()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FixAssetsTuronver(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FixedAssetsRevaluationReserveBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reserves created by revaluation of assets.\n    /// </summary>\n    public class FixedAssetsRevaluationReserveBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FixedAssetsRevaluationReserve_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FixedAssetsRevaluationReserveBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FixedAssetsRevaluationReserveBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FixedMaturityInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This asset refers to types of investments that may be contained within the fixed maturity category which securities are having a stated final repayment date. Examples of items within this category may include bonds, including convertibles and bonds with warrants, and redeemable preferred stocks.\n    /// </summary>\n    public class FixedMaturityInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FixedMaturityInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FixedMaturityInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FixedMaturityInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FixedMaturityInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FlightFleetVehicleAndRelatedEquipmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// It is one of the important fixed assets for transportation industry, which includes bicycles, cars, motorcycles, trains, ships, boats, and aircraft. This item is typically available for transportation industry.\n    /// </summary>\n    public class FlightFleetVehicleAndRelatedEquipmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FlightFleetVehicleAndRelatedEquipments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FlightFleetVehicleAndRelatedEquipmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FlightFleetVehicleAndRelatedEquipmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ForeclosedAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amount as of the balance sheet date of all assets obtained in full or partial satisfaction of a debt arrangement through foreclosure proceedings or defeasance; includes real and personal property; equity interests in corporations, partnerships, and joint ventures; and beneficial interest in trusts. This item is typically typically available for bank industry.\n    /// </summary>\n    public class ForeclosedAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeclosedAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeclosedAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeclosedAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeclosedAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeclosedAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ForeclosedAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ForeclosedAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ForeclosedAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ForeignCurrencyTranslationAdjustmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Changes to accumulated comprehensive income that results from the process of translating subsidiary financial statements and foreign equity investments into functional currency of the reporting company.\n    /// </summary>\n    public class ForeignCurrencyTranslationAdjustmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ForeignCurrencyTranslationAdjustments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ForeignCurrencyTranslationAdjustmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ForeignCurrencyTranslationAdjustmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ForeignExchangeTradingGainsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Trading revenues that result from foreign exchange exposures such as cash instruments and off-balance sheet derivative instruments. This item is usually only available for bank industry.\n    /// </summary>\n    public class ForeignExchangeTradingGainsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ForeignExchangeTradingGains_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ForeignExchangeTradingGainsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ForeignExchangeTradingGainsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FreeCashFlowCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash Flow Operations minus Capital Expenditures.\n    /// </summary>\n    public class FreeCashFlowCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FreeCashFlow_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_FreeCashFlow_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FreeCashFlowCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FreeCashFlowCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FuelAndPurchasePowerIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cost of fuel, purchase power and gas associated with revenue generation. This item is usually only available for utility industry.\n    /// </summary>\n    public class FuelAndPurchasePowerIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_FuelAndPurchasePower_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_FuelAndPurchasePower_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FuelAndPurchasePowerIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FuelAndPurchasePowerIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FuelIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of fuel cost for current period associated with the revenue generation. This item is usually only available for transportation industry.\n    /// </summary>\n    public class FuelIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Fuel_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_Fuel_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FuelIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FuelIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FundFromOperationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Funds from operations; populated only for real estate investment trusts (REITs), defined as the sum of net income, gain/loss (realized and unrealized) on investment securities, asset impairment charge, depreciation and amortization and gain/ loss on the sale of business and property plant and equipment.\n    /// </summary>\n    public class FundFromOperationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_FundFromOperation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_FundFromOperation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FundFromOperationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FundFromOperationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/FuturePolicyBenefitsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounting policy pertaining to an insurance entity's net liability for future benefits (for example, death, cash surrender value) to be paid to or on behalf of policyholders, describing the bases, methodologies and components of the reserve, and assumptions regarding estimates of expected investment yields, mortality, morbidity, terminations and expenses.\n    /// </summary>\n    public class FuturePolicyBenefitsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FuturePolicyBenefits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FuturePolicyBenefits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FuturePolicyBenefits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_FuturePolicyBenefits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_FuturePolicyBenefits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public FuturePolicyBenefitsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public FuturePolicyBenefitsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossOnInvestmentSecuritiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item represents the net total realized gain (loss) included in earnings for the period as a result of selling or holding marketable securities categorized as trading, available-for-sale, or held-to-maturity, including the unrealized holding gain or loss of held-to- maturity securities transferred to the trading security category and the cumulative unrealized gain or loss which was included in other comprehensive income (a separate component of shareholders' equity) for available-for-sale securities transferred to trading securities during the PeriodAsByte. Additionally, this item would include any losses recognized for other than temporary impairments of the subject investments in debt and equity securities.\n    /// </summary>\n    public class GainLossOnInvestmentSecuritiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_GainLossOnInvestmentSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossOnInvestmentSecuritiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossOnInvestmentSecuritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossOnSaleOfBusinessCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The difference between the sale price or salvage price and the book value of an asset that was sold or retired during the reporting PeriodAsByte. This element refers to the gain (loss) and not to the cash proceeds of the business. This element is a non-cash adjustment to net income when calculating net cash generated by operating activities using the indirect method.\n    /// </summary>\n    public class GainLossOnSaleOfBusinessCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_GainLossOnSaleOfBusiness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossOnSaleOfBusinessCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossOnSaleOfBusinessCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossOnSaleOfPPECashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The difference between the sale price or salvage price and the book value of the property, plant and equipment that was sold or retired during the reporting PeriodAsByte. Includes the amount received from selling any fixed assets such as property, plant and equipment. Usually this section also includes any retirement of equipment. Such as Sale of business segments; Sale of credit and receivables; Property disposition; Proceeds from sale or disposition of business or investment; Decrease in excess of purchase price over acquired net assets; Abandoned project (expenditures) credit; Allowances for other funds during construction.\n    /// </summary>\n    public class GainLossOnSaleOfPPECashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_GainLossOnSaleOfPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossOnSaleOfPPECashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossOnSaleOfPPECashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain/loss on the write-off of financial assets available-for-sale.\n    /// </summary>\n    public class GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainLossonDerecognitionofAvailableForSaleFinancialAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain/Loss through hedging activities.\n    /// </summary>\n    public class GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainLossonFinancialInstrumentsDesignatedasCashFlowHedges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainLossonSaleofAssetsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any gain (loss) recognized on the sale of assets or a sale which generates profit or loss, which is a difference between sales price and net book value at the disposal time.\n    /// </summary>\n    public class GainLossonSaleofAssetsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainLossonSaleofAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainLossonSaleofAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainLossonSaleofAssetsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainLossonSaleofAssetsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainOnSaleOfBusinessIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of excess earned in comparison to fair value when selling a business. This item is usually not available for insurance industry.\n    /// </summary>\n    public class GainOnSaleOfBusinessIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainOnSaleOfBusiness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainOnSaleOfBusinessIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainOnSaleOfBusinessIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainOnSaleOfPPEIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of excess earned in comparison to the net book value for sale of property, plant, equipment. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class GainOnSaleOfPPEIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainOnSaleOfPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainOnSaleOfPPEIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainOnSaleOfPPEIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainOnSaleOfSecurityIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of excess earned in comparison to the original purchase value of the security.\n    /// </summary>\n    public class GainOnSaleOfSecurityIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainOnSaleOfSecurity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainOnSaleOfSecurityIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainOnSaleOfSecurityIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainonInvestmentPropertiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain on disposal and change in fair value of investment properties.\n    /// </summary>\n    public class GainonInvestmentPropertiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonInvestmentProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainonInvestmentProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainonInvestmentPropertiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainonInvestmentPropertiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainonSaleofInvestmentPropertyIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain on the disposal of investment property.\n    /// </summary>\n    public class GainonSaleofInvestmentPropertyIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainonSaleofInvestmentProperty_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainonSaleofInvestmentPropertyIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainonSaleofInvestmentPropertyIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainonSaleofLoansIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain on sale of any loans investment.\n    /// </summary>\n    public class GainonSaleofLoansIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainonSaleofLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainonSaleofLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainonSaleofLoansIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainonSaleofLoansIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainsLossesNotAffectingRetainedEarningsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of gains or losses that are not part of retained earnings. It is also called other comprehensive income.\n    /// </summary>\n    public class GainsLossesNotAffectingRetainedEarningsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GainsLossesNotAffectingRetainedEarnings_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainsLossesNotAffectingRetainedEarningsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainsLossesNotAffectingRetainedEarningsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain or loss on derivatives investment due to the fair value adjustment.\n    /// </summary>\n    public class GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GeneralAndAdministrativeExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate total of general managing and administering expenses for the company.\n    /// </summary>\n    public class GeneralAndAdministrativeExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GeneralAndAdministrativeExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GeneralAndAdministrativeExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GeneralAndAdministrativeExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GeneralPartnershipCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// In a limited partnership or master limited partnership form of business, this represents the balance of capital held by the general partners.\n    /// </summary>\n    public class GeneralPartnershipCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GeneralPartnershipCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GeneralPartnershipCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GeneralPartnershipCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GeneralPartnershipCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GeneralPartnershipCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GeneralPartnershipCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GeneralPartnershipCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GeneralPartnershipCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GoodwillAndOtherIntangibleAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Rights or economic benefits, such as patents and goodwill, that is not physical in nature. They are those that are neither physical nor financial in nature, nevertheless, have value to the company. Intangibles are listed net of accumulated amortization.\n    /// </summary>\n    public class GoodwillAndOtherIntangibleAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GoodwillAndOtherIntangibleAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GoodwillAndOtherIntangibleAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GoodwillAndOtherIntangibleAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GoodwillBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The excess of the cost of an acquired company over the sum of the fair market value of its identifiable individual assets less the liabilities.\n    /// </summary>\n    public class GoodwillBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Goodwill_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Goodwill_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GoodwillBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GoodwillBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossAccountsReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts owed to a company by customers within a year as a result of exchanging goods or services on credit.\n    /// </summary>\n    public class GrossAccountsReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossAccountsReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossAccountsReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossAccountsReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossAccountsReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GrossAccountsReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossAccountsReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossAccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossDividendPaymentIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total amount paid in dividends to investors- this includes dividends paid on equity and non-equity shares.\n    /// </summary>\n    public class GrossDividendPaymentIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossDividendPayment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossDividendPayment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossDividendPayment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossDividendPayment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossDividendPayment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GrossDividendPayment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossDividendPaymentIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossDividendPaymentIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossLoanBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the sum of all loans (commercial, consumer, mortgage, etc.) as well as leases before any provisions for loan losses or unearned discounts.\n    /// </summary>\n    public class GrossLoanBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GrossLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossLoanBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossLoanBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of gross profit to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: (Revenue - Cost of Goods Sold) / Revenue.\n    /// </summary>\n    public class GrossMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_GrossMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossMargin5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's Annual Gross Margin over the last 5 years. Gross Margin is Total Revenue minus Cost of Goods Sold divided by Total Revenue and is expressed as a percentage.\n    /// </summary>\n    public class GrossMargin5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossMargin5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_GrossMargin5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossMargin5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossMargin5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossNotesReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s) within one year of the balance sheet date or the normal operating cycle. Such amount may include accrued interest receivable in accordance with the terms of the note. The note also may contain provisions including a discount or premium, payable on demand, secured, or unsecured, interest bearing or non-interest bearing, among myriad other features and characteristics. This item is typically available for bank industry.\n    /// </summary>\n    public class GrossNotesReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossNotesReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossNotesReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossNotesReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossNotesReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GrossNotesReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossNotesReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossNotesReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossPPEBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount at the balance sheet date for long-lived physical assets used in the normal conduct of business and not intended for resale. This can include land, physical structures, machinery, vehicles, furniture, computer equipment, construction in progress, and similar items. Amount does not include depreciation.\n    /// </summary>\n    public class GrossPPEBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_GrossPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_GrossPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossPPEBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossPPEBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossPremiumsWrittenIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total premiums generated from all policies written by an insurance company within a given period of time. This item is usually only available for insurance industry.\n    /// </summary>\n    public class GrossPremiumsWrittenIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossPremiumsWritten_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GrossPremiumsWritten_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossPremiumsWrittenIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossPremiumsWrittenIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossProfitAnnual5YrGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the compound annual growth rate of the company's Gross Profit over the last 5 years.\n    /// </summary>\n    public class GrossProfitAnnual5YrGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossProfitAnnual5YrGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossProfitAnnual5YrGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossProfitAnnual5YrGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossProfitAnnual5YrGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_GrossProfitAnnual5YrGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_GrossProfitAnnual5YrGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossProfitAnnual5YrGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossProfitAnnual5YrGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/GrossProfitIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total revenue less cost of revenue. The number is as reported by the company on the income statement; however, the number will be calculated if it is not reported. This field is null if the cost of revenue is not given. Gross Profit = Total Revenue - Cost of Revenue.\n    /// </summary>\n    public class GrossProfitIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_GrossProfit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_GrossProfit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GrossProfitIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public GrossProfitIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/HedgingAssetsCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A security transaction which expires within a 12 month period that reduces the risk on an existing investment position.\n    /// </summary>\n    public class HedgingAssetsCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HedgingAssetsCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HedgingAssetsCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HedgingAssetsCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HedgingAssetsCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_HedgingAssetsCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public HedgingAssetsCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public HedgingAssetsCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/HeldToMaturitySecuritiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Debt securities that a firm has the ability and intent to hold until maturity.\n    /// </summary>\n    public class HeldToMaturitySecuritiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_HeldToMaturitySecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_HeldToMaturitySecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public HeldToMaturitySecuritiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public HeldToMaturitySecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The difference between the future net cash flows expected to be received from the asset and its book value, recognized in the Income Statement.\n    /// </summary>\n    public class ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ImpairmentLossReversalRecognizedinProfitorLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Impairment or reversal of impairment on financial instrument such as derivative. This is a contra account under Total Revenue in banks.\n    /// </summary>\n    public class ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ImpairmentLossesReversalsFinancialInstrumentsNet_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ImpairmentOfCapitalAssetsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Impairments are considered to be permanent, which is a downward revaluation of fixed assets. If the sum of all estimated future cash flows is less than the carrying value of the asset, then the asset would be considered impaired and would have to be written down to its fair value. Once an asset is written down, it may only be written back up under very few circumstances. Usually the company uses the sum of undiscounted future cash flows to determine if the impairment should occur, and uses the sum of discounted future cash flows to make the impairment judgment. The impairment decision emphasizes on capital assets' future profit collection ability.\n    /// </summary>\n    public class ImpairmentOfCapitalAssetsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ImpairmentOfCapitalAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ImpairmentOfCapitalAssetsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ImpairmentOfCapitalAssetsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the IncomeStatement class\n    /// </summary>\n    public class IncomeStatement : ReusuableCLRObject\n    {\n        /// <summary>\n        /// Filing date of the Income Statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20423\n        /// </remarks>\n        [JsonProperty(\"20423\")]\n        public IncomeStatementFileDate ISFileDate => _iSFileDate ??= new(_timeProvider, _securityIdentifier);\n        private IncomeStatementFileDate _iSFileDate;\n\n        /// <summary>\n        /// The non-cash expense recognized on intangible assets over the benefit period of the asset.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20007\n        /// </remarks>\n        [JsonProperty(\"20007\")]\n        public AmortizationIncomeStatement Amortization => _amortization ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationIncomeStatement _amortization;\n\n        /// <summary>\n        /// The gradual elimination of a liability, such as a mortgage, in regular payments over a specified period of time. Such payments must be sufficient to cover both principal and interest.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20008\n        /// </remarks>\n        [JsonProperty(\"20008\")]\n        public SecuritiesAmortizationIncomeStatement SecuritiesAmortization => _securitiesAmortization ??= new(_timeProvider, _securityIdentifier);\n        private SecuritiesAmortizationIncomeStatement _securitiesAmortization;\n\n        /// <summary>\n        /// The aggregate cost of goods produced and sold and services rendered during the reporting period. It excludes all operating expenses such as depreciation, depletion, amortization, and SG&amp;A. For the must have cost industry, if the number is not reported by the company, it will be calculated based on accounting equation. Cost of Revenue = Revenue - Operating Expenses - Operating Profit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20013\n        /// </remarks>\n        [JsonProperty(\"20013\")]\n        public CostOfRevenueIncomeStatement CostOfRevenue => _costOfRevenue ??= new(_timeProvider, _securityIdentifier);\n        private CostOfRevenueIncomeStatement _costOfRevenue;\n\n        /// <summary>\n        /// The non-cash expense recognized on natural resources (eg. Oil and mineral deposits) over the benefit period of the asset.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20017\n        /// </remarks>\n        [JsonProperty(\"20017\")]\n        public DepletionIncomeStatement Depletion => _depletion ??= new(_timeProvider, _securityIdentifier);\n        private DepletionIncomeStatement _depletion;\n\n        /// <summary>\n        /// The current period non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives, in the Income Statement. Examples of tangible asset include buildings, production and equipment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20018\n        /// </remarks>\n        [JsonProperty(\"20018\")]\n        public DepreciationIncomeStatement Depreciation => _depreciation ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationIncomeStatement _depreciation;\n\n        /// <summary>\n        /// The sum of depreciation and amortization expense in the Income Statement. Depreciation is the non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives Amortization is the non-cash expense recognized on intangible assets over the benefit period of the asset.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20019\n        /// </remarks>\n        [JsonProperty(\"20019\")]\n        public DepreciationAndAmortizationIncomeStatement DepreciationAndAmortization => _depreciationAndAmortization ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationAndAmortizationIncomeStatement _depreciationAndAmortization;\n\n        /// <summary>\n        /// The sum of depreciation, amortization and depletion expense in the Income Statement. Depreciation is the non-cash expense recognized on tangible assets used in the normal course of business, by allocating the cost of assets over their useful lives Amortization is the non-cash expense recognized on intangible assets over the benefit period of the asset. Depletion is the non-cash expense recognized on natural resources (eg. Oil and mineral deposits) over the benefit period of the asset.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20020\n        /// </remarks>\n        [JsonProperty(\"20020\")]\n        public DepreciationAmortizationDepletionIncomeStatement DepreciationAmortizationDepletion => _depreciationAmortizationDepletion ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationAmortizationDepletionIncomeStatement _depreciationAmortizationDepletion;\n\n        /// <summary>\n        /// To be classified as discontinued operations, if both of the following conditions are met: 1: The operations and cash flow of the component have been or will be removed from the ongoing operations of the entity as a result of the disposal transaction, and 2: The entity will have no significant continuing involvement in the operations of the component after the disposal transaction. The discontinued operation is reported net of tax. Gains/Loss on Disposal of Discontinued Operations: Any gains or loss recognized on disposal of discontinued operations, which is the difference between the carrying value of the division and its fair value less costs to sell. Provision for Gain/Loss on Disposal: The amount of current expense charged in order to prepare for the disposal of discontinued operations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20022\n        /// </remarks>\n        [JsonProperty(\"20022\")]\n        public NetIncomeDiscontinuousOperationsIncomeStatement NetIncomeDiscontinuousOperations => _netIncomeDiscontinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeDiscontinuousOperationsIncomeStatement _netIncomeDiscontinuousOperations;\n\n        /// <summary>\n        /// Excise taxes are taxes paid when purchases are made on a specific good, such as gasoline. Excise taxes are often included in the price of the product. There are also excise taxes on activities, such as on wagering or on highway usage by trucks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20028\n        /// </remarks>\n        [JsonProperty(\"20028\")]\n        public ExciseTaxesIncomeStatement ExciseTaxes => _exciseTaxes ??= new(_timeProvider, _securityIdentifier);\n        private ExciseTaxesIncomeStatement _exciseTaxes;\n\n        /// <summary>\n        /// Gains (losses), whether arising from extinguishment of debt, prior period adjustments, or from other events or transactions, that are both unusual in nature and infrequent in occurrence thereby meeting the criteria for an event or transaction to be classified as an extraordinary item.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20030\n        /// </remarks>\n        [JsonProperty(\"20030\")]\n        public NetIncomeExtraordinaryIncomeStatement NetIncomeExtraordinary => _netIncomeExtraordinary ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeExtraordinaryIncomeStatement _netIncomeExtraordinary;\n\n        /// <summary>\n        /// The aggregate amount of fees, commissions, and other income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20031\n        /// </remarks>\n        [JsonProperty(\"20031\")]\n        public FeeRevenueAndOtherIncomeIncomeStatement FeeRevenueAndOtherIncome => _feeRevenueAndOtherIncome ??= new(_timeProvider, _securityIdentifier);\n        private FeeRevenueAndOtherIncomeIncomeStatement _feeRevenueAndOtherIncome;\n\n        /// <summary>\n        /// The aggregate total of general managing and administering expenses for the company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20045\n        /// </remarks>\n        [JsonProperty(\"20045\")]\n        public GeneralAndAdministrativeExpenseIncomeStatement GeneralAndAdministrativeExpense => _generalAndAdministrativeExpense ??= new(_timeProvider, _securityIdentifier);\n        private GeneralAndAdministrativeExpenseIncomeStatement _generalAndAdministrativeExpense;\n\n        /// <summary>\n        /// Total revenue less cost of revenue. The number is as reported by the company on the income statement; however, the number will be calculated if it is not reported. This field is null if the cost of revenue is not given. Gross Profit = Total Revenue - Cost of Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20046\n        /// </remarks>\n        [JsonProperty(\"20046\")]\n        public GrossProfitIncomeStatement GrossProfit => _grossProfit ??= new(_timeProvider, _securityIdentifier);\n        private GrossProfitIncomeStatement _grossProfit;\n\n        /// <summary>\n        /// Relates to the general cost of borrowing money. It is the price that a lender charges a borrower for the use of the lender's money.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20057\n        /// </remarks>\n        [JsonProperty(\"20057\")]\n        public InterestExpenseIncomeStatement InterestExpense => _interestExpense ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseIncomeStatement _interestExpense;\n\n        /// <summary>\n        /// Interest expense caused by long term financing activities; such as interest expense incurred on trading liabilities, commercial paper, long-term debt, capital leases, deposits, and all other borrowings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20064\n        /// </remarks>\n        [JsonProperty(\"20064\")]\n        public InterestExpenseNonOperatingIncomeStatement InterestExpenseNonOperating => _interestExpenseNonOperating ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseNonOperatingIncomeStatement _interestExpenseNonOperating;\n\n        /// <summary>\n        /// Net interest and dividend income or expense, including any amortization and accretion (as applicable) of discounts and premiums, including consideration of the provisions for loan, lease, credit, and other related losses, if any.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20066\n        /// </remarks>\n        [JsonProperty(\"20066\")]\n        public InterestIncomeAfterProvisionForLoanLossIncomeStatement InterestIncomeAfterProvisionForLoanLoss => _interestIncomeAfterProvisionForLoanLoss ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeAfterProvisionForLoanLossIncomeStatement _interestIncomeAfterProvisionForLoanLoss;\n\n        /// <summary>\n        /// Interest income earned from long term financing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20075\n        /// </remarks>\n        [JsonProperty(\"20075\")]\n        public InterestIncomeNonOperatingIncomeStatement InterestIncomeNonOperating => _interestIncomeNonOperating ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeNonOperatingIncomeStatement _interestIncomeNonOperating;\n\n        /// <summary>\n        /// Net-Non Operating interest income or expenses caused by financing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20077\n        /// </remarks>\n        [JsonProperty(\"20077\")]\n        public NetNonOperatingInterestIncomeExpenseIncomeStatement NetNonOperatingInterestIncomeExpense => _netNonOperatingInterestIncomeExpense ??= new(_timeProvider, _securityIdentifier);\n        private NetNonOperatingInterestIncomeExpenseIncomeStatement _netNonOperatingInterestIncomeExpense;\n\n        /// <summary>\n        /// Losses generally refer to (1) the amount of reduction in the value of an insured's property caused by an insured peril, (2) the amount sought through an insured's claim, or (3) the amount paid on behalf of an insured under an insurance contract. Loss Adjustment Expenses is expenses incurred in the course of investigating and settling claims that includes any legal and adjusters' fees and the costs of paying claims and all related expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20084\n        /// </remarks>\n        [JsonProperty(\"20084\")]\n        public LossAdjustmentExpenseIncomeStatement LossAdjustmentExpense => _lossAdjustmentExpense ??= new(_timeProvider, _securityIdentifier);\n        private LossAdjustmentExpenseIncomeStatement _lossAdjustmentExpense;\n\n        /// <summary>\n        /// Represents par or stated value of the subsidiary stock not owned by the parent company plus the minority interest's equity in the surplus of the subsidiary. This item includes preferred dividend averages on the minority preferred stock (preferred shares not owned by the reporting parent company). Minority interest also refers to stockholders who own less than 50% of a subsidiary's outstanding voting common stock. The minority stockholders hold an interest in the subsidiary's net assets and share earnings with the parent company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20087\n        /// </remarks>\n        [JsonProperty(\"20087\")]\n        public MinorityInterestsIncomeStatement MinorityInterests => _minorityInterests ??= new(_timeProvider, _securityIdentifier);\n        private MinorityInterestsIncomeStatement _minorityInterests;\n\n        /// <summary>\n        /// Includes all the operations (continuing and discontinued) and all the other income or charges (extraordinary, accounting changes, tax loss carry forward, and other gains and losses).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20091\n        /// </remarks>\n        [JsonProperty(\"20091\")]\n        public NetIncomeIncomeStatement NetIncome => _netIncome ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeIncomeStatement _netIncome;\n\n        /// <summary>\n        /// Net income minus the preferred dividends paid as presented in the Income Statement.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20093\n        /// </remarks>\n        [JsonProperty(\"20093\")]\n        public NetIncomeCommonStockholdersIncomeStatement NetIncomeCommonStockholders => _netIncomeCommonStockholders ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeCommonStockholdersIncomeStatement _netIncomeCommonStockholders;\n\n        /// <summary>\n        /// Revenue less expenses and taxes from the entity's ongoing operations and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20094\n        /// </remarks>\n        [JsonProperty(\"20094\")]\n        public NetIncomeContinuousOperationsIncomeStatement NetIncomeContinuousOperations => _netIncomeContinuousOperations ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeContinuousOperationsIncomeStatement _netIncomeContinuousOperations;\n\n        /// <summary>\n        /// Total interest income minus total interest expense. It represents the difference between interest and dividends earned on interest- bearing assets and interest paid to depositors and other creditors.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20095\n        /// </remarks>\n        [JsonProperty(\"20095\")]\n        public NetInterestIncomeIncomeStatement NetInterestIncome => _netInterestIncome ??= new(_timeProvider, _securityIdentifier);\n        private NetInterestIncomeIncomeStatement _netInterestIncome;\n\n        /// <summary>\n        /// Total of interest, dividends, and other earnings derived from the insurance company's invested assets minus the expenses associated with these investments. Excluded from this income are capital gains or losses as the result of the sale of assets, as well as any unrealized capital gains or losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20096\n        /// </remarks>\n        [JsonProperty(\"20096\")]\n        public NetInvestmentIncomeIncomeStatement NetInvestmentIncome => _netInvestmentIncome ??= new(_timeProvider, _securityIdentifier);\n        private NetInvestmentIncomeIncomeStatement _netInvestmentIncome;\n\n        /// <summary>\n        /// All sales, business revenues and income that the company makes from its business operations, net of excise taxes. This applies for all companies and can be used as comparison for all industries. For Normal, Mining, Transportation and Utility templates companies, this is the sum of Operating Revenues, Excise Taxes and Fees. For Bank template companies, this is the sum of Net Interest Income and Non-Interest Income. For Insurance template companies, this is the sum of Premiums, Interest Income, Fees, Investment and Other Income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20100\n        /// </remarks>\n        [JsonProperty(\"20100\")]\n        public TotalRevenueIncomeStatement TotalRevenue => _totalRevenue ??= new(_timeProvider, _securityIdentifier);\n        private TotalRevenueIncomeStatement _totalRevenue;\n\n        /// <summary>\n        /// Any expenses that not related to interest. It includes labor and related expense, occupancy and equipment, commission, professional expense and contract services expenses, selling, general and administrative, research and development depreciation, amortization and depletion, and any other special income/charges.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20105\n        /// </remarks>\n        [JsonProperty(\"20105\")]\n        public NonInterestExpenseIncomeStatement NonInterestExpense => _nonInterestExpense ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestExpenseIncomeStatement _nonInterestExpense;\n\n        /// <summary>\n        /// The total amount of non-interest income which may be derived from: (1) fees and commissions; (2) premiums earned; (3) equity investment; (4) the sale or disposal of assets; and (5) other sources not otherwise specified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20106\n        /// </remarks>\n        [JsonProperty(\"20106\")]\n        public NonInterestIncomeIncomeStatement NonInterestIncome => _nonInterestIncome ??= new(_timeProvider, _securityIdentifier);\n        private NonInterestIncomeIncomeStatement _nonInterestIncome;\n\n        /// <summary>\n        /// Operating expenses are primary recurring costs associated with central operations (other than cost of goods sold) that are incurred in order to generate sales.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20108\n        /// </remarks>\n        [JsonProperty(\"20108\")]\n        public OperatingExpenseIncomeStatement OperatingExpense => _operatingExpense ??= new(_timeProvider, _securityIdentifier);\n        private OperatingExpenseIncomeStatement _operatingExpense;\n\n        /// <summary>\n        /// Income from normal business operations after deducting cost of revenue and operating expenses. It does not include income from any investing activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20109\n        /// </remarks>\n        [JsonProperty(\"20109\")]\n        public OperatingIncomeIncomeStatement OperatingIncome => _operatingIncome ??= new(_timeProvider, _securityIdentifier);\n        private OperatingIncomeIncomeStatement _operatingIncome;\n\n        /// <summary>\n        /// Sales and income that the company makes from its business operations. This applies only to non-bank and insurance companies. For Utility template companies, this is the sum of revenue from electric, gas, transportation and other operating revenue. For Transportation template companies, this is the sum of revenue-passenger, revenue-cargo, and other operating revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20112\n        /// </remarks>\n        [JsonProperty(\"20112\")]\n        public OperatingRevenueIncomeStatement OperatingRevenue => _operatingRevenue ??= new(_timeProvider, _securityIdentifier);\n        private OperatingRevenueIncomeStatement _operatingRevenue;\n\n        /// <summary>\n        /// Income or expense that comes from miscellaneous sources.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20117\n        /// </remarks>\n        [JsonProperty(\"20117\")]\n        public OtherIncomeExpenseIncomeStatement OtherIncomeExpense => _otherIncomeExpense ??= new(_timeProvider, _securityIdentifier);\n        private OtherIncomeExpenseIncomeStatement _otherIncomeExpense;\n\n        /// <summary>\n        /// Costs that vary with and are primarily related to the acquisition of new and renewal insurance contracts. Also referred to as underwriting expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20125\n        /// </remarks>\n        [JsonProperty(\"20125\")]\n        public PolicyAcquisitionExpenseIncomeStatement PolicyAcquisitionExpense => _policyAcquisitionExpense ??= new(_timeProvider, _securityIdentifier);\n        private PolicyAcquisitionExpenseIncomeStatement _policyAcquisitionExpense;\n\n        /// <summary>\n        /// The net provision in current period for future policy benefits, claims, and claims settlement expenses incurred in the claims settlement process before the effects of reinsurance arrangements. The value is net of the effects of contracts assumed and ceded.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20129\n        /// </remarks>\n        [JsonProperty(\"20129\")]\n        public NetPolicyholderBenefitsAndClaimsIncomeStatement NetPolicyholderBenefitsAndClaims => _netPolicyholderBenefitsAndClaims ??= new(_timeProvider, _securityIdentifier);\n        private NetPolicyholderBenefitsAndClaimsIncomeStatement _netPolicyholderBenefitsAndClaims;\n\n        /// <summary>\n        /// The amount of dividends declared or paid in the period to preferred shareholders, or the amount for which the obligation to pay them dividends arose in the period. Preferred dividends are the amount required for the current year only, and not for any amount required in past years.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20134\n        /// </remarks>\n        [JsonProperty(\"20134\")]\n        public PreferredStockDividendsIncomeStatement PreferredStockDividends => _preferredStockDividends ??= new(_timeProvider, _securityIdentifier);\n        private PreferredStockDividendsIncomeStatement _preferredStockDividends;\n\n        /// <summary>\n        /// Premiums earned is the portion of an insurance written premium which is considered \"earned\" by the insurer, based on the part of the policy period that the insurance has been in effect, and during which the insurer has been exposed to loss.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20135\n        /// </remarks>\n        [JsonProperty(\"20135\")]\n        public TotalPremiumsEarnedIncomeStatement TotalPremiumsEarned => _totalPremiumsEarned ??= new(_timeProvider, _securityIdentifier);\n        private TotalPremiumsEarnedIncomeStatement _totalPremiumsEarned;\n\n        /// <summary>\n        /// Reported income before the deduction or benefit of income taxes.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20136\n        /// </remarks>\n        [JsonProperty(\"20136\")]\n        public PretaxIncomeIncomeStatement PretaxIncome => _pretaxIncome ??= new(_timeProvider, _securityIdentifier);\n        private PretaxIncomeIncomeStatement _pretaxIncome;\n\n        /// <summary>\n        /// Include any taxes on income, net of any investment tax credits for the current accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20145\n        /// </remarks>\n        [JsonProperty(\"20145\")]\n        public TaxProvisionIncomeStatement TaxProvision => _taxProvision ??= new(_timeProvider, _securityIdentifier);\n        private TaxProvisionIncomeStatement _taxProvision;\n\n        /// <summary>\n        /// A charge to income which represents an expense deemed adequate by management given the composition of a bank's credit portfolios, their probability of default, the economic environment and the allowance for credit losses already established. Specific provisions are established to reduce the book value of specific assets (primarily loans) to establish the amount expected to be recovered on the loans.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20146\n        /// </remarks>\n        [JsonProperty(\"20146\")]\n        public CreditLossesProvisionIncomeStatement CreditLossesProvision => _creditLossesProvision ??= new(_timeProvider, _securityIdentifier);\n        private CreditLossesProvisionIncomeStatement _creditLossesProvision;\n\n        /// <summary>\n        /// The aggregate amount of research and development expenses during the year.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20151\n        /// </remarks>\n        [JsonProperty(\"20151\")]\n        public ResearchAndDevelopmentIncomeStatement ResearchAndDevelopment => _researchAndDevelopment ??= new(_timeProvider, _securityIdentifier);\n        private ResearchAndDevelopmentIncomeStatement _researchAndDevelopment;\n\n        /// <summary>\n        /// The aggregate total amount of expenses directly related to the marketing or selling of products or services.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20158\n        /// </remarks>\n        [JsonProperty(\"20158\")]\n        public SellingAndMarketingExpenseIncomeStatement SellingAndMarketingExpense => _sellingAndMarketingExpense ??= new(_timeProvider, _securityIdentifier);\n        private SellingAndMarketingExpenseIncomeStatement _sellingAndMarketingExpense;\n\n        /// <summary>\n        /// The aggregate total costs related to selling a firm's product and services, as well as all other general and administrative expenses. Selling expenses are those directly related to the company's efforts to generate sales (e.g., sales salaries, commissions, advertising, delivery expenses). General and administrative expenses are expenses related to general administration of the company's operation (e.g., officers and office salaries, office supplies, telephone, accounting and legal services, and business licenses and fees).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20159\n        /// </remarks>\n        [JsonProperty(\"20159\")]\n        public SellingGeneralAndAdministrationIncomeStatement SellingGeneralAndAdministration => _sellingGeneralAndAdministration ??= new(_timeProvider, _securityIdentifier);\n        private SellingGeneralAndAdministrationIncomeStatement _sellingGeneralAndAdministration;\n\n        /// <summary>\n        /// Earnings or losses attributable to occurrences or actions by the firm that is either infrequent or unusual.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20162\n        /// </remarks>\n        [JsonProperty(\"20162\")]\n        public SpecialIncomeChargesIncomeStatement SpecialIncomeCharges => _specialIncomeCharges ??= new(_timeProvider, _securityIdentifier);\n        private SpecialIncomeChargesIncomeStatement _specialIncomeCharges;\n\n        /// <summary>\n        /// The sum of operating expense and cost of revenue. If the company does not give the reported number, it will be calculated by adding operating expense and cost of revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20164\n        /// </remarks>\n        [JsonProperty(\"20164\")]\n        public TotalExpensesIncomeStatement TotalExpenses => _totalExpenses ??= new(_timeProvider, _securityIdentifier);\n        private TotalExpensesIncomeStatement _totalExpenses;\n\n        /// <summary>\n        /// Income generated from interest-bearing deposits or accounts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20177\n        /// </remarks>\n        [JsonProperty(\"20177\")]\n        public InterestIncomeIncomeStatement InterestIncome => _interestIncome ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeIncomeStatement _interestIncome;\n\n        /// <summary>\n        /// Earnings minus expenses (excluding interest and tax expenses).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20189\n        /// </remarks>\n        [JsonProperty(\"20189\")]\n        public EBITIncomeStatement EBIT => _eBIT ??= new(_timeProvider, _securityIdentifier);\n        private EBITIncomeStatement _eBIT;\n\n        /// <summary>\n        /// Earnings minus expenses (excluding interest, tax, depreciation, and amortization expenses).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20190\n        /// </remarks>\n        [JsonProperty(\"20190\")]\n        public EBITDAIncomeStatement EBITDA => _eBITDA ??= new(_timeProvider, _securityIdentifier);\n        private EBITDAIncomeStatement _eBITDA;\n\n        /// <summary>\n        /// Revenue less expenses and taxes from the entity's ongoing operations net of minority interest and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20191\n        /// </remarks>\n        [JsonProperty(\"20191\")]\n        public NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement NetIncomeContinuousOperationsNetMinorityInterest => _netIncomeContinuousOperationsNetMinorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement _netIncomeContinuousOperationsNetMinorityInterest;\n\n        /// <summary>\n        /// The amount of premiums paid and payable to another insurer as a result of reinsurance arrangements in order to exchange for that company accepting all or part of insurance on a risk or exposure. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20201\n        /// </remarks>\n        [JsonProperty(\"20201\")]\n        public CededPremiumsIncomeStatement CededPremiums => _cededPremiums ??= new(_timeProvider, _securityIdentifier);\n        private CededPremiumsIncomeStatement _cededPremiums;\n\n        /// <summary>\n        /// <remarks> Morningstar DataId: 20202 </remarks>\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20202\n        /// </remarks>\n        [JsonProperty(\"20202\")]\n        public CommissionExpensesIncomeStatement CommissionExpenses => _commissionExpenses ??= new(_timeProvider, _securityIdentifier);\n        private CommissionExpensesIncomeStatement _commissionExpenses;\n\n        /// <summary>\n        /// Income earned from credit card services including late, over limit, and annual fees. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20204\n        /// </remarks>\n        [JsonProperty(\"20204\")]\n        public CreditCardIncomeStatement CreditCard => _creditCard ??= new(_timeProvider, _securityIdentifier);\n        private CreditCardIncomeStatement _creditCard;\n\n        /// <summary>\n        /// Dividends earned from equity investment securities. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20206\n        /// </remarks>\n        [JsonProperty(\"20206\")]\n        public DividendIncomeIncomeStatement DividendIncome => _dividendIncome ??= new(_timeProvider, _securityIdentifier);\n        private DividendIncomeIncomeStatement _dividendIncome;\n\n        /// <summary>\n        /// The earnings from equity interest can be a result of any of the following: Income from earnings distribution of the business, either as dividends paid to corporate shareholders or as drawings in a partnership; Capital gain realized upon sale of the business; Capital gain realized from selling his or her interest to other partners. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20208\n        /// </remarks>\n        [JsonProperty(\"20208\")]\n        public EarningsFromEquityInterestIncomeStatement EarningsFromEquityInterest => _earningsFromEquityInterest ??= new(_timeProvider, _securityIdentifier);\n        private EarningsFromEquityInterestIncomeStatement _earningsFromEquityInterest;\n\n        /// <summary>\n        /// Equipment expenses include depreciation, repairs, rentals, and service contract costs. This also includes equipment purchases which do not qualify for capitalization in accordance with the entity's accounting policy. This item may also include furniture expenses. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20210\n        /// </remarks>\n        [JsonProperty(\"20210\")]\n        public EquipmentIncomeStatement Equipment => _equipment ??= new(_timeProvider, _securityIdentifier);\n        private EquipmentIncomeStatement _equipment;\n\n        /// <summary>\n        /// Costs incurred in identifying areas that may warrant examination and in examining specific areas that are considered to have prospects of containing energy or metal reserves, including costs of drilling exploratory wells. Development expense is the capitalized costs incurred to obtain access to proved reserves and to provide facilities for extracting, treating, gathering and storing the energy and metal. Mineral property includes oil and gas wells, mines, and other natural deposits (including geothermal deposits). The payment for leasing those properties is called mineral property lease expense. Exploration expense is included in operation expenses for mining industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20211\n        /// </remarks>\n        [JsonProperty(\"20211\")]\n        public ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement ExplorationDevelopmentAndMineralPropertyLeaseExpenses => _explorationDevelopmentAndMineralPropertyLeaseExpenses ??= new(_timeProvider, _securityIdentifier);\n        private ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement _explorationDevelopmentAndMineralPropertyLeaseExpenses;\n\n        /// <summary>\n        /// Total fees and commissions earned from providing services such as leasing of space or maintaining: (1) depositor accounts; (2) transfer agent; (3) fiduciary and trust; (4) brokerage and underwriting; (5) mortgage; (6) credit cards; (7) correspondent clearing; and (8) other such services and activities performed for others. This item is usually available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20213\n        /// </remarks>\n        [JsonProperty(\"20213\")]\n        public FeesAndCommissionsIncomeStatement FeesAndCommissions => _feesAndCommissions ??= new(_timeProvider, _securityIdentifier);\n        private FeesAndCommissionsIncomeStatement _feesAndCommissions;\n\n        /// <summary>\n        /// Trading revenues that result from foreign exchange exposures such as cash instruments and off-balance sheet derivative instruments. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20214\n        /// </remarks>\n        [JsonProperty(\"20214\")]\n        public ForeignExchangeTradingGainsIncomeStatement ForeignExchangeTradingGains => _foreignExchangeTradingGains ??= new(_timeProvider, _securityIdentifier);\n        private ForeignExchangeTradingGainsIncomeStatement _foreignExchangeTradingGains;\n\n        /// <summary>\n        /// The aggregate amount of fuel cost for current period associated with the revenue generation. This item is usually only available for transportation industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20215\n        /// </remarks>\n        [JsonProperty(\"20215\")]\n        public FuelIncomeStatement Fuel => _fuel ??= new(_timeProvider, _securityIdentifier);\n        private FuelIncomeStatement _fuel;\n\n        /// <summary>\n        /// Cost of fuel, purchase power and gas associated with revenue generation. This item is usually only available for utility industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20216\n        /// </remarks>\n        [JsonProperty(\"20216\")]\n        public FuelAndPurchasePowerIncomeStatement FuelAndPurchasePower => _fuelAndPurchasePower ??= new(_timeProvider, _securityIdentifier);\n        private FuelAndPurchasePowerIncomeStatement _fuelAndPurchasePower;\n\n        /// <summary>\n        /// The amount of excess earned in comparison to fair value when selling a business. This item is usually not available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20217\n        /// </remarks>\n        [JsonProperty(\"20217\")]\n        public GainOnSaleOfBusinessIncomeStatement GainOnSaleOfBusiness => _gainOnSaleOfBusiness ??= new(_timeProvider, _securityIdentifier);\n        private GainOnSaleOfBusinessIncomeStatement _gainOnSaleOfBusiness;\n\n        /// <summary>\n        /// The amount of excess earned in comparison to the net book value for sale of property, plant, equipment. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20218\n        /// </remarks>\n        [JsonProperty(\"20218\")]\n        public GainOnSaleOfPPEIncomeStatement GainOnSaleOfPPE => _gainOnSaleOfPPE ??= new(_timeProvider, _securityIdentifier);\n        private GainOnSaleOfPPEIncomeStatement _gainOnSaleOfPPE;\n\n        /// <summary>\n        /// The amount of excess earned in comparison to the original purchase value of the security.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20219\n        /// </remarks>\n        [JsonProperty(\"20219\")]\n        public GainOnSaleOfSecurityIncomeStatement GainOnSaleOfSecurity => _gainOnSaleOfSecurity ??= new(_timeProvider, _securityIdentifier);\n        private GainOnSaleOfSecurityIncomeStatement _gainOnSaleOfSecurity;\n\n        /// <summary>\n        /// Total premiums generated from all policies written by an insurance company within a given period of time. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20224\n        /// </remarks>\n        [JsonProperty(\"20224\")]\n        public GrossPremiumsWrittenIncomeStatement GrossPremiumsWritten => _grossPremiumsWritten ??= new(_timeProvider, _securityIdentifier);\n        private GrossPremiumsWrittenIncomeStatement _grossPremiumsWritten;\n\n        /// <summary>\n        /// Impairments are considered to be permanent, which is a downward revaluation of fixed assets. If the sum of all estimated future cash flows is less than the carrying value of the asset, then the asset would be considered impaired and would have to be written down to its fair value. Once an asset is written down, it may only be written back up under very few circumstances. Usually the company uses the sum of undiscounted future cash flows to determine if the impairment should occur, and uses the sum of discounted future cash flows to make the impairment judgment. The impairment decision emphasizes on capital assets' future profit collection ability.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20225\n        /// </remarks>\n        [JsonProperty(\"20225\")]\n        public ImpairmentOfCapitalAssetsIncomeStatement ImpairmentOfCapitalAssets => _impairmentOfCapitalAssets ??= new(_timeProvider, _securityIdentifier);\n        private ImpairmentOfCapitalAssetsIncomeStatement _impairmentOfCapitalAssets;\n\n        /// <summary>\n        /// Premium might contain a portion of the amount that has been paid in advance for insurance that has not yet been provided, which is called unearned premium. If either party cancels the contract, the insurer must have the unearned premium ready to refund. Hence, the amount of premium reserve maintained by insurers is called unearned premium reserves, which is prepared for liquidation. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20230\n        /// </remarks>\n        [JsonProperty(\"20230\")]\n        public IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement IncreaseDecreaseInNetUnearnedPremiumReserves => _increaseDecreaseInNetUnearnedPremiumReserves ??= new(_timeProvider, _securityIdentifier);\n        private IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement _increaseDecreaseInNetUnearnedPremiumReserves;\n\n        /// <summary>\n        /// Insurance and claims are the expenses in the period incurred with respect to protection provided by insurance entities against risks other than risks associated with production (which is allocated to cost of sales). This item is usually not available for insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20231\n        /// </remarks>\n        [JsonProperty(\"20231\")]\n        public InsuranceAndClaimsIncomeStatement InsuranceAndClaims => _insuranceAndClaims ??= new(_timeProvider, _securityIdentifier);\n        private InsuranceAndClaimsIncomeStatement _insuranceAndClaims;\n\n        /// <summary>\n        /// Includes interest expense on the following deposit accounts: Interest-bearing Demand deposit; Checking account; Savings account; Deposit in foreign offices; Money Market Certificates &amp; Deposit Accounts. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20235\n        /// </remarks>\n        [JsonProperty(\"20235\")]\n        public InterestExpenseForDepositIncomeStatement InterestExpenseForDeposit => _interestExpenseForDeposit ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseForDepositIncomeStatement _interestExpenseForDeposit;\n\n        /// <summary>\n        /// Gross expenses on the purchase of Federal funds at a specified price with a simultaneous agreement to sell the same to the same counterparty at a fixed or determinable price at a future date. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20236\n        /// </remarks>\n        [JsonProperty(\"20236\")]\n        public InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell => _interestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement _interestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell;\n\n        /// <summary>\n        /// The aggregate interest expenses incurred on long-term borrowings and any interest expenses on fixed assets (property, plant, equipment) that are leased due longer than one year. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20238\n        /// </remarks>\n        [JsonProperty(\"20238\")]\n        public InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement InterestExpenseForLongTermDebtAndCapitalSecurities => _interestExpenseForLongTermDebtAndCapitalSecurities ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement _interestExpenseForLongTermDebtAndCapitalSecurities;\n\n        /// <summary>\n        /// The aggregate interest expenses incurred on short-term borrowings and any interest expenses on fixed assets (property, plant, equipment) that are leased within one year. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20239\n        /// </remarks>\n        [JsonProperty(\"20239\")]\n        public InterestExpenseForShortTermDebtIncomeStatement InterestExpenseForShortTermDebt => _interestExpenseForShortTermDebt ??= new(_timeProvider, _securityIdentifier);\n        private InterestExpenseForShortTermDebtIncomeStatement _interestExpenseForShortTermDebt;\n\n        /// <summary>\n        /// Interest income generated from all deposit accounts. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20240\n        /// </remarks>\n        [JsonProperty(\"20240\")]\n        public InterestIncomeFromDepositsIncomeStatement InterestIncomeFromDeposits => _interestIncomeFromDeposits ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromDepositsIncomeStatement _interestIncomeFromDeposits;\n\n        /// <summary>\n        /// The carrying value of funds outstanding loaned in the form of security resale agreements if the agreement requires the purchaser to resell the identical security purchased or a security that meets the definition of \"\"substantially the same\"\" in the case of a dollar roll. Also includes purchases of participations in pools of securities that are subject to a resale agreement; This category includes all interest income generated from federal funds sold and securities purchases under agreements to resell; This category includes all interest income generated from federal funds sold and securities purchases under agreements to resell.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20241\n        /// </remarks>\n        [JsonProperty(\"20241\")]\n        public InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell => _interestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement _interestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell;\n\n        /// <summary>\n        /// Includes interest and fee income generated by direct lease financing. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20243\n        /// </remarks>\n        [JsonProperty(\"20243\")]\n        public InterestIncomeFromLeasesIncomeStatement InterestIncomeFromLeases => _interestIncomeFromLeases ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromLeasesIncomeStatement _interestIncomeFromLeases;\n\n        /// <summary>\n        /// Loan is a common field to banks. Interest Income from Loans is interest and fee income generated from all loans, which includes Commercial loans; Credit loans; Other consumer loans; Real Estate - Construction; Real Estate - Mortgage; Foreign loans. Banks earn interest from loans. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20244\n        /// </remarks>\n        [JsonProperty(\"20244\")]\n        public InterestIncomeFromLoansIncomeStatement InterestIncomeFromLoans => _interestIncomeFromLoans ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromLoansIncomeStatement _interestIncomeFromLoans;\n\n        /// <summary>\n        /// Total interest and fee income generated by loans and lease. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20245\n        /// </remarks>\n        [JsonProperty(\"20245\")]\n        public InterestIncomeFromLoansAndLeaseIncomeStatement InterestIncomeFromLoansAndLease => _interestIncomeFromLoansAndLease ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromLoansAndLeaseIncomeStatement _interestIncomeFromLoansAndLease;\n\n        /// <summary>\n        /// Represents total interest and dividend income from U.S. Treasury securities, U.S. government agency and corporation obligations, securities issued by states and political subdivisions, other domestic debt securities, foreign debt securities, and equity securities (including investments in mutual funds). Excludes interest income from securities held in trading accounts. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20246\n        /// </remarks>\n        [JsonProperty(\"20246\")]\n        public InterestIncomeFromSecuritiesIncomeStatement InterestIncomeFromSecurities => _interestIncomeFromSecurities ??= new(_timeProvider, _securityIdentifier);\n        private InterestIncomeFromSecuritiesIncomeStatement _interestIncomeFromSecurities;\n\n        /// <summary>\n        /// Includes (1) underwriting revenue (the spread between the resale price received and the cost of the securities and related expenses) generated through the purchasing, distributing and reselling of new issues of securities (alternatively, could be a secondary offering of a large block of previously issued securities); and (2) fees earned for mergers, acquisitions, divestitures, restructurings, and other types of financial advisory services. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20248\n        /// </remarks>\n        [JsonProperty(\"20248\")]\n        public InvestmentBankingProfitIncomeStatement InvestmentBankingProfit => _investmentBankingProfit ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentBankingProfitIncomeStatement _investmentBankingProfit;\n\n        /// <summary>\n        /// The aggregate amount of maintenance and repair expenses in the current period associated with the revenue generation. Mainly for fixed assets. This item is usually only available for transportation industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20252\n        /// </remarks>\n        [JsonProperty(\"20252\")]\n        public MaintenanceAndRepairsIncomeStatement MaintenanceAndRepairs => _maintenanceAndRepairs ??= new(_timeProvider, _securityIdentifier);\n        private MaintenanceAndRepairsIncomeStatement _maintenanceAndRepairs;\n\n        /// <summary>\n        /// The aggregate foreign currency translation gain or loss (both realized and unrealized) included as part of revenue. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20255\n        /// </remarks>\n        [JsonProperty(\"20255\")]\n        public NetForeignExchangeGainLossIncomeStatement NetForeignExchangeGainLoss => _netForeignExchangeGainLoss ??= new(_timeProvider, _securityIdentifier);\n        private NetForeignExchangeGainLossIncomeStatement _netForeignExchangeGainLoss;\n\n        /// <summary>\n        /// Occupancy expense may include items, such as depreciation of facilities and equipment, lease expenses, property taxes and property and casualty insurance expense. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20256\n        /// </remarks>\n        [JsonProperty(\"20256\")]\n        public NetOccupancyExpenseIncomeStatement NetOccupancyExpense => _netOccupancyExpense ??= new(_timeProvider, _securityIdentifier);\n        private NetOccupancyExpenseIncomeStatement _netOccupancyExpense;\n\n        /// <summary>\n        /// Net premiums written are gross premiums written less ceded premiums. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20257\n        /// </remarks>\n        [JsonProperty(\"20257\")]\n        public NetPremiumsWrittenIncomeStatement NetPremiumsWritten => _netPremiumsWritten ??= new(_timeProvider, _securityIdentifier);\n        private NetPremiumsWrittenIncomeStatement _netPremiumsWritten;\n\n        /// <summary>\n        /// Gain or loss realized during the period of time for all kinds of investment securities. In might include trading, available-for-sale, or held-to-maturity securities. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20258\n        /// </remarks>\n        [JsonProperty(\"20258\")]\n        public NetRealizedGainLossOnInvestmentsIncomeStatement NetRealizedGainLossOnInvestments => _netRealizedGainLossOnInvestments ??= new(_timeProvider, _securityIdentifier);\n        private NetRealizedGainLossOnInvestmentsIncomeStatement _netRealizedGainLossOnInvestments;\n\n        /// <summary>\n        /// Includes total expenses of occupancy and equipment. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20260\n        /// </remarks>\n        [JsonProperty(\"20260\")]\n        public OccupancyAndEquipmentIncomeStatement OccupancyAndEquipment => _occupancyAndEquipment ??= new(_timeProvider, _securityIdentifier);\n        private OccupancyAndEquipmentIncomeStatement _occupancyAndEquipment;\n\n        /// <summary>\n        /// The aggregate amount of operation and maintenance expenses, which is the one important operating expense for the utility industry. It includes any costs related to production and maintenance cost of the property during the revenue generation process. This item is usually only available for mining and utility industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20262\n        /// </remarks>\n        [JsonProperty(\"20262\")]\n        public OperationAndMaintenanceIncomeStatement OperationAndMaintenance => _operationAndMaintenance ??= new(_timeProvider, _securityIdentifier);\n        private OperationAndMaintenanceIncomeStatement _operationAndMaintenance;\n\n        /// <summary>\n        /// Represents fees and commissions earned from provide other services. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20263\n        /// </remarks>\n        [JsonProperty(\"20263\")]\n        public OtherCustomerServicesIncomeStatement OtherCustomerServices => _otherCustomerServices ??= new(_timeProvider, _securityIdentifier);\n        private OtherCustomerServicesIncomeStatement _otherCustomerServices;\n\n        /// <summary>\n        /// All other interest expense that is not otherwise classified\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20265\n        /// </remarks>\n        [JsonProperty(\"20265\")]\n        public OtherInterestExpenseIncomeStatement OtherInterestExpense => _otherInterestExpense ??= new(_timeProvider, _securityIdentifier);\n        private OtherInterestExpenseIncomeStatement _otherInterestExpense;\n\n        /// <summary>\n        /// All other interest income that is not otherwise classified\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20266\n        /// </remarks>\n        [JsonProperty(\"20266\")]\n        public OtherInterestIncomeIncomeStatement OtherInterestIncome => _otherInterestIncome ??= new(_timeProvider, _securityIdentifier);\n        private OtherInterestIncomeIncomeStatement _otherInterestIncome;\n\n        /// <summary>\n        /// All other non interest expense that is not otherwise classified\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20267\n        /// </remarks>\n        [JsonProperty(\"20267\")]\n        public OtherNonInterestExpenseIncomeStatement OtherNonInterestExpense => _otherNonInterestExpense ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonInterestExpenseIncomeStatement _otherNonInterestExpense;\n\n        /// <summary>\n        /// All other special charges that are not otherwise classified\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20269\n        /// </remarks>\n        [JsonProperty(\"20269\")]\n        public OtherSpecialChargesIncomeStatement OtherSpecialCharges => _otherSpecialCharges ??= new(_timeProvider, _securityIdentifier);\n        private OtherSpecialChargesIncomeStatement _otherSpecialCharges;\n\n        /// <summary>\n        /// Any taxes that are not part of income taxes. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20271\n        /// </remarks>\n        [JsonProperty(\"20271\")]\n        public OtherTaxesIncomeStatement OtherTaxes => _otherTaxes ??= new(_timeProvider, _securityIdentifier);\n        private OtherTaxesIncomeStatement _otherTaxes;\n\n        /// <summary>\n        /// The provision in current period for future policy benefits, claims, and claims settlement, which is under reinsurance arrangements. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20273\n        /// </remarks>\n        [JsonProperty(\"20273\")]\n        public PolicyholderBenefitsCededIncomeStatement PolicyholderBenefitsCeded => _policyholderBenefitsCeded ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderBenefitsCededIncomeStatement _policyholderBenefitsCeded;\n\n        /// <summary>\n        /// The gross amount of provision in current period for future policyholder benefits, claims, and claims settlement, incurred in the claims settlement process before the effects of reinsurance arrangements. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20274\n        /// </remarks>\n        [JsonProperty(\"20274\")]\n        public PolicyholderBenefitsGrossIncomeStatement PolicyholderBenefitsGross => _policyholderBenefitsGross ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderBenefitsGrossIncomeStatement _policyholderBenefitsGross;\n\n        /// <summary>\n        /// Payments made or credits extended to the insured by the company, usually at the end of a policy year results in reducing the net insurance cost to the policyholder. Such dividends may be paid in cash to the insured or applied by the insured as reductions of the premiums due for the next policy year. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20275\n        /// </remarks>\n        [JsonProperty(\"20275\")]\n        public PolicyholderDividendsIncomeStatement PolicyholderDividends => _policyholderDividends ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderDividendsIncomeStatement _policyholderDividends;\n\n        /// <summary>\n        /// The periodic income payment provided to the annuitant by the insurance company, which is determined by the assumed interest rate (AIR) and other factors. This item is usually only available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20276\n        /// </remarks>\n        [JsonProperty(\"20276\")]\n        public PolicyholderInterestIncomeStatement PolicyholderInterest => _policyholderInterest ??= new(_timeProvider, _securityIdentifier);\n        private PolicyholderInterestIncomeStatement _policyholderInterest;\n\n        /// <summary>\n        /// Professional and contract service expense includes cost reimbursements for support services related to contracted projects, outsourced management, technical and staff support. This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20280\n        /// </remarks>\n        [JsonProperty(\"20280\")]\n        public ProfessionalExpenseAndContractServicesExpenseIncomeStatement ProfessionalExpenseAndContractServicesExpense => _professionalExpenseAndContractServicesExpense ??= new(_timeProvider, _securityIdentifier);\n        private ProfessionalExpenseAndContractServicesExpenseIncomeStatement _professionalExpenseAndContractServicesExpense;\n\n        /// <summary>\n        /// Amount of the current period expense charged against operations, the offset which is generally to the allowance for doubtful accounts for the purpose of reducing receivables, including notes receivable, to an amount that approximates their net realizable value (the amount expected to be collected). The category includes provision for loan losses, provision for any doubtful account receivable, and bad debt expenses. This item is usually not available for bank and insurance industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20283\n        /// </remarks>\n        [JsonProperty(\"20283\")]\n        public ProvisionForDoubtfulAccountsIncomeStatement ProvisionForDoubtfulAccounts => _provisionForDoubtfulAccounts ??= new(_timeProvider, _securityIdentifier);\n        private ProvisionForDoubtfulAccountsIncomeStatement _provisionForDoubtfulAccounts;\n\n        /// <summary>\n        /// Rent fees are the cost of occupying space during the accounting period. Landing fees are a change paid to an airport company for landing at a particular airport. This item is not available for insurance industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20287\n        /// </remarks>\n        [JsonProperty(\"20287\")]\n        public RentAndLandingFeesIncomeStatement RentAndLandingFees => _rentAndLandingFees ??= new(_timeProvider, _securityIdentifier);\n        private RentAndLandingFeesIncomeStatement _rentAndLandingFees;\n\n        /// <summary>\n        /// Expenses are related to restructuring, merger, or acquisitions. Restructuring expenses are charges associated with the consolidation and relocation of operations, disposition or abandonment of operations or productive assets. Merger and acquisition expenses are the amount of costs of a business combination including legal, accounting, and other costs that were charged to expense during the period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20289\n        /// </remarks>\n        [JsonProperty(\"20289\")]\n        public RestructuringAndMergernAcquisitionIncomeStatement RestructuringAndMergernAcquisition => _restructuringAndMergernAcquisition ??= new(_timeProvider, _securityIdentifier);\n        private RestructuringAndMergernAcquisitionIncomeStatement _restructuringAndMergernAcquisition;\n\n        /// <summary>\n        /// All salary, wages, compensation, management fees, and employee benefit expenses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20292\n        /// </remarks>\n        [JsonProperty(\"20292\")]\n        public SalariesAndWagesIncomeStatement SalariesAndWages => _salariesAndWages ??= new(_timeProvider, _securityIdentifier);\n        private SalariesAndWagesIncomeStatement _salariesAndWages;\n\n        /// <summary>\n        /// Income/Loss from Securities and Activities\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20293\n        /// </remarks>\n        [JsonProperty(\"20293\")]\n        public SecuritiesActivitiesIncomeStatement SecuritiesActivities => _securitiesActivities ??= new(_timeProvider, _securityIdentifier);\n        private SecuritiesActivitiesIncomeStatement _securitiesActivities;\n\n        /// <summary>\n        /// Includes any service charges on following accounts: Demand Deposit; Checking account; Savings account; Deposit in foreign offices; ESCROW accounts; Money Market Certificates &amp; Deposit accounts, CDs (Negotiable Certificates of Deposits); NOW Accounts (Negotiable Order of Withdrawal); IRAs (Individual Retirement Accounts). This item is usually only available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20295\n        /// </remarks>\n        [JsonProperty(\"20295\")]\n        public ServiceChargeOnDepositorAccountsIncomeStatement ServiceChargeOnDepositorAccounts => _serviceChargeOnDepositorAccounts ??= new(_timeProvider, _securityIdentifier);\n        private ServiceChargeOnDepositorAccountsIncomeStatement _serviceChargeOnDepositorAccounts;\n\n        /// <summary>\n        /// A broker-dealer or other financial entity may buy and sell securities exclusively for its own account, sometimes referred to as proprietary trading. The profit or loss is measured by the difference between the acquisition cost and the selling price or current market or fair value. The net gain or loss, includes both realized and unrealized, from trading cash instruments, equities and derivative contracts (including commodity contracts) that has been recognized during the accounting period for the broker dealer or other financial entity's own account. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20298\n        /// </remarks>\n        [JsonProperty(\"20298\")]\n        public TradingGainLossIncomeStatement TradingGainLoss => _tradingGainLoss ??= new(_timeProvider, _securityIdentifier);\n        private TradingGainLossIncomeStatement _tradingGainLoss;\n\n        /// <summary>\n        /// Bank manages funds on behalf of its customers through the operation of various trust accounts. Any fees earned through managing those funds are called trust fees, which are recognized when earned. This item is typically available for bank industry.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20300\n        /// </remarks>\n        [JsonProperty(\"20300\")]\n        public TrustFeesbyCommissionsIncomeStatement TrustFeesbyCommissions => _trustFeesbyCommissions ??= new(_timeProvider, _securityIdentifier);\n        private TrustFeesbyCommissionsIncomeStatement _trustFeesbyCommissions;\n\n        /// <summary>\n        /// Also known as Policy Acquisition Costs; and reported by insurance companies. The cost incurred by an insurer when deciding whether to accept or decline a risk; may include meetings with the insureds or brokers, actuarial review of loss history, or physical inspections of exposures. Also, expenses deducted from insurance company revenues (including incurred losses and acquisition costs) to determine underwriting profit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20301\n        /// </remarks>\n        [JsonProperty(\"20301\")]\n        public UnderwritingExpensesIncomeStatement UnderwritingExpenses => _underwritingExpenses ??= new(_timeProvider, _securityIdentifier);\n        private UnderwritingExpensesIncomeStatement _underwritingExpenses;\n\n        /// <summary>\n        /// A reduction in the value of an asset or earnings by the amount of an expense or loss.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20304\n        /// </remarks>\n        [JsonProperty(\"20304\")]\n        public WriteOffIncomeStatement WriteOff => _writeOff ??= new(_timeProvider, _securityIdentifier);\n        private WriteOffIncomeStatement _writeOff;\n\n        /// <summary>\n        /// Usually available for the banking industry. This is Non-Interest Income that is not otherwise classified.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20306\n        /// </remarks>\n        [JsonProperty(\"20306\")]\n        public OtherNonInterestIncomeIncomeStatement OtherNonInterestIncome => _otherNonInterestIncome ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonInterestIncomeIncomeStatement _otherNonInterestIncome;\n\n        /// <summary>\n        /// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20308\n        /// </remarks>\n        [JsonProperty(\"20308\")]\n        public AmortizationOfIntangiblesIncomeStatement AmortizationOfIntangibles => _amortizationOfIntangibles ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationOfIntangiblesIncomeStatement _amortizationOfIntangibles;\n\n        /// <summary>\n        /// Net Income from Continuing Operations and Discontinued Operations, added together.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20309\n        /// </remarks>\n        [JsonProperty(\"20309\")]\n        public NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement NetIncomeFromContinuingAndDiscontinuedOperation => _netIncomeFromContinuingAndDiscontinuedOperation ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement _netIncomeFromContinuingAndDiscontinuedOperation;\n\n        /// <summary>\n        /// Occurs if a company has had a net loss from operations on a previous year that can be carried forward to reduce net income for tax purposes.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20311\n        /// </remarks>\n        [JsonProperty(\"20311\")]\n        public NetIncomeFromTaxLossCarryforwardIncomeStatement NetIncomeFromTaxLossCarryforward => _netIncomeFromTaxLossCarryforward ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeFromTaxLossCarryforwardIncomeStatement _netIncomeFromTaxLossCarryforward;\n\n        /// <summary>\n        /// The aggregate amount of operating expenses associated with normal operations. Will not include any gain, loss, benefit, or income; and its value reported by the company should be &lt;0.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20312\n        /// </remarks>\n        [JsonProperty(\"20312\")]\n        public OtherOperatingExpensesIncomeStatement OtherOperatingExpenses => _otherOperatingExpenses ??= new(_timeProvider, _securityIdentifier);\n        private OtherOperatingExpensesIncomeStatement _otherOperatingExpenses;\n\n        /// <summary>\n        /// The sum of the money market investments held by a bank's depositors, which are FDIC insured.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20313\n        /// </remarks>\n        [JsonProperty(\"20313\")]\n        public TotalMoneyMarketInvestmentsIncomeStatement TotalMoneyMarketInvestments => _totalMoneyMarketInvestments ??= new(_timeProvider, _securityIdentifier);\n        private TotalMoneyMarketInvestmentsIncomeStatement _totalMoneyMarketInvestments;\n\n        /// <summary>\n        /// The Cost Of Revenue plus Depreciation, Depletion &amp; Amortization from the IncomeStatement; minus Depreciation, Depletion &amp; Amortization from the Cash Flow Statement\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20314\n        /// </remarks>\n        [JsonProperty(\"20314\")]\n        public ReconciledCostOfRevenueIncomeStatement ReconciledCostOfRevenue => _reconciledCostOfRevenue ??= new(_timeProvider, _securityIdentifier);\n        private ReconciledCostOfRevenueIncomeStatement _reconciledCostOfRevenue;\n\n        /// <summary>\n        /// Is Depreciation, Depletion &amp; Amortization from the Cash Flow Statement\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20315\n        /// </remarks>\n        [JsonProperty(\"20315\")]\n        public ReconciledDepreciationIncomeStatement ReconciledDepreciation => _reconciledDepreciation ??= new(_timeProvider, _securityIdentifier);\n        private ReconciledDepreciationIncomeStatement _reconciledDepreciation;\n\n        /// <summary>\n        /// This calculation represents earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is calculated using Net Income from Continuing Operations plus/minus any tax affected unusual Items and Goodwill Impairments/Write Offs.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20316\n        /// </remarks>\n        [JsonProperty(\"20316\")]\n        public NormalizedIncomeIncomeStatement NormalizedIncome => _normalizedIncome ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedIncomeIncomeStatement _normalizedIncome;\n\n        /// <summary>\n        /// Revenue less expenses and taxes from the entity's ongoing operations net of minority interest and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20331\n        /// </remarks>\n        [JsonProperty(\"20331\")]\n        public NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement NetIncomeFromContinuingOperationNetMinorityInterest => _netIncomeFromContinuingOperationNetMinorityInterest ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement _netIncomeFromContinuingOperationNetMinorityInterest;\n\n        /// <summary>\n        /// Any gain (loss) recognized on the sale of assets or a sale which generates profit or loss, which is a difference between sales price and net book value at the disposal time.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20333\n        /// </remarks>\n        [JsonProperty(\"20333\")]\n        public GainLossonSaleofAssetsIncomeStatement GainLossonSaleofAssets => _gainLossonSaleofAssets ??= new(_timeProvider, _securityIdentifier);\n        private GainLossonSaleofAssetsIncomeStatement _gainLossonSaleofAssets;\n\n        /// <summary>\n        /// Gain on sale of any loans investment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20334\n        /// </remarks>\n        [JsonProperty(\"20334\")]\n        public GainonSaleofLoansIncomeStatement GainonSaleofLoans => _gainonSaleofLoans ??= new(_timeProvider, _securityIdentifier);\n        private GainonSaleofLoansIncomeStatement _gainonSaleofLoans;\n\n        /// <summary>\n        /// Gain on the disposal of investment property.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20335\n        /// </remarks>\n        [JsonProperty(\"20335\")]\n        public GainonSaleofInvestmentPropertyIncomeStatement GainonSaleofInvestmentProperty => _gainonSaleofInvestmentProperty ??= new(_timeProvider, _securityIdentifier);\n        private GainonSaleofInvestmentPropertyIncomeStatement _gainonSaleofInvestmentProperty;\n\n        /// <summary>\n        /// Loss on extinguishment of debt is the accounting loss that results from a debt extinguishment. A debt shall be accounted for as having been extinguished in a number of circumstances, including when it has been settled through repayment or replacement by another liability. It generally results in an accounting gain or loss. Amount represents the difference between the fair value of the payments made and the carrying amount of the debt at the time of its extinguishment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20343\n        /// </remarks>\n        [JsonProperty(\"20343\")]\n        public LossonExtinguishmentofDebtIncomeStatement LossonExtinguishmentofDebt => _lossonExtinguishmentofDebt ??= new(_timeProvider, _securityIdentifier);\n        private LossonExtinguishmentofDebtIncomeStatement _lossonExtinguishmentofDebt;\n\n        /// <summary>\n        /// Income from other equity interest reported after Provision of Tax. This applies to all industries.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20345\n        /// </remarks>\n        [JsonProperty(\"20345\")]\n        public EarningsfromEquityInterestNetOfTaxIncomeStatement EarningsfromEquityInterestNetOfTax => _earningsfromEquityInterestNetOfTax ??= new(_timeProvider, _securityIdentifier);\n        private EarningsfromEquityInterestNetOfTaxIncomeStatement _earningsfromEquityInterestNetOfTax;\n\n        /// <summary>\n        /// Net income of the group after the adjustment of all expenses and benefit.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20346\n        /// </remarks>\n        [JsonProperty(\"20346\")]\n        public NetIncomeIncludingNoncontrollingInterestsIncomeStatement NetIncomeIncludingNoncontrollingInterests => _netIncomeIncludingNoncontrollingInterests ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeIncludingNoncontrollingInterestsIncomeStatement _netIncomeIncludingNoncontrollingInterests;\n\n        /// <summary>\n        /// Dividend paid to the preferred shareholders before the common stock shareholders.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20347\n        /// </remarks>\n        [JsonProperty(\"20347\")]\n        public OtherunderPreferredStockDividendIncomeStatement OtherunderPreferredStockDividend => _otherunderPreferredStockDividend ??= new(_timeProvider, _securityIdentifier);\n        private OtherunderPreferredStockDividendIncomeStatement _otherunderPreferredStockDividend;\n\n        /// <summary>\n        /// Total staff cost which is paid to the employees that is not part of Selling, General, and Administration expense.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20359\n        /// </remarks>\n        [JsonProperty(\"20359\")]\n        public StaffCostsIncomeStatement StaffCosts => _staffCosts ??= new(_timeProvider, _securityIdentifier);\n        private StaffCostsIncomeStatement _staffCosts;\n\n        /// <summary>\n        /// Benefits paid to the employees in respect of their work.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20360\n        /// </remarks>\n        [JsonProperty(\"20360\")]\n        public SocialSecurityCostsIncomeStatement SocialSecurityCosts => _socialSecurityCosts ??= new(_timeProvider, _securityIdentifier);\n        private SocialSecurityCostsIncomeStatement _socialSecurityCosts;\n\n        /// <summary>\n        /// The expense that a company incurs each year by providing a pension plan for its employees. Major expenses in the pension cost include employer matching contributions and management fees.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20361\n        /// </remarks>\n        [JsonProperty(\"20361\")]\n        public PensionCostsIncomeStatement PensionCosts => _pensionCosts ??= new(_timeProvider, _securityIdentifier);\n        private PensionCostsIncomeStatement _pensionCosts;\n\n        /// <summary>\n        /// Total Other Operating Income- including interest income, dividend income and other types of operating income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20363\n        /// </remarks>\n        [JsonProperty(\"20363\")]\n        public OtherOperatingIncomeTotalIncomeStatement OtherOperatingIncomeTotal => _otherOperatingIncomeTotal ??= new(_timeProvider, _securityIdentifier);\n        private OtherOperatingIncomeTotalIncomeStatement _otherOperatingIncomeTotal;\n\n        /// <summary>\n        /// Total income from the associates and joint venture via investment, accounted for in the Non-Operating section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20367\n        /// </remarks>\n        [JsonProperty(\"20367\")]\n        public IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement IncomefromAssociatesandOtherParticipatingInterests => _incomefromAssociatesandOtherParticipatingInterests ??= new(_timeProvider, _securityIdentifier);\n        private IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement _incomefromAssociatesandOtherParticipatingInterests;\n\n        /// <summary>\n        /// Any other finance cost which is not clearly defined in the Non-Operating section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20368\n        /// </remarks>\n        [JsonProperty(\"20368\")]\n        public TotalOtherFinanceCostIncomeStatement TotalOtherFinanceCost => _totalOtherFinanceCost ??= new(_timeProvider, _securityIdentifier);\n        private TotalOtherFinanceCostIncomeStatement _totalOtherFinanceCost;\n\n        /// <summary>\n        /// Total amount paid in dividends to investors- this includes dividends paid on equity and non-equity shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20371\n        /// </remarks>\n        [JsonProperty(\"20371\")]\n        public GrossDividendPaymentIncomeStatement GrossDividendPayment => _grossDividendPayment ??= new(_timeProvider, _securityIdentifier);\n        private GrossDividendPaymentIncomeStatement _grossDividendPayment;\n\n        /// <summary>\n        /// Fees and commission income earned by bank and insurance companies on the rendering services.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20377\n        /// </remarks>\n        [JsonProperty(\"20377\")]\n        public FeesandCommissionIncomeIncomeStatement FeesandCommissionIncome => _feesandCommissionIncome ??= new(_timeProvider, _securityIdentifier);\n        private FeesandCommissionIncomeIncomeStatement _feesandCommissionIncome;\n\n        /// <summary>\n        /// Cost incurred by bank and insurance companies for fees and commission income.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20378\n        /// </remarks>\n        [JsonProperty(\"20378\")]\n        public FeesandCommissionExpenseIncomeStatement FeesandCommissionExpense => _feesandCommissionExpense ??= new(_timeProvider, _securityIdentifier);\n        private FeesandCommissionExpenseIncomeStatement _feesandCommissionExpense;\n\n        /// <summary>\n        /// Any trading income on the securities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20379\n        /// </remarks>\n        [JsonProperty(\"20379\")]\n        public NetTradingIncomeIncomeStatement NetTradingIncome => _netTradingIncome ??= new(_timeProvider, _securityIdentifier);\n        private NetTradingIncomeIncomeStatement _netTradingIncome;\n\n        /// <summary>\n        /// Other costs in incurred in lieu of the employees that cannot be identified by other specific items in the Staff Costs section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20381\n        /// </remarks>\n        [JsonProperty(\"20381\")]\n        public OtherStaffCostsIncomeStatement OtherStaffCosts => _otherStaffCosts ??= new(_timeProvider, _securityIdentifier);\n        private OtherStaffCostsIncomeStatement _otherStaffCosts;\n\n        /// <summary>\n        /// Gain on disposal and change in fair value of investment properties.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20383\n        /// </remarks>\n        [JsonProperty(\"20383\")]\n        public GainonInvestmentPropertiesIncomeStatement GainonInvestmentProperties => _gainonInvestmentProperties ??= new(_timeProvider, _securityIdentifier);\n        private GainonInvestmentPropertiesIncomeStatement _gainonInvestmentProperties;\n\n        /// <summary>\n        /// Adjustments to reported net income to calculate Diluted EPS, by assuming that all convertible instruments are converted to Common Equity. The adjustments usually include the interest expense of debentures when assumed converted and preferred dividends of convertible preferred stock when assumed converted.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20385\n        /// </remarks>\n        [JsonProperty(\"20385\")]\n        public AverageDilutionEarningsIncomeStatement AverageDilutionEarnings => _averageDilutionEarnings ??= new(_timeProvider, _securityIdentifier);\n        private AverageDilutionEarningsIncomeStatement _averageDilutionEarnings;\n\n        /// <summary>\n        /// Gain/Loss through hedging activities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20391\n        /// </remarks>\n        [JsonProperty(\"20391\")]\n        public GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement GainLossonFinancialInstrumentsDesignatedasCashFlowHedges => _gainLossonFinancialInstrumentsDesignatedasCashFlowHedges ??= new(_timeProvider, _securityIdentifier);\n        private GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement _gainLossonFinancialInstrumentsDesignatedasCashFlowHedges;\n\n        /// <summary>\n        /// Gain/loss on the write-off of financial assets available-for-sale.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20392\n        /// </remarks>\n        [JsonProperty(\"20392\")]\n        public GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement GainLossonDerecognitionofAvailableForSaleFinancialAssets => _gainLossonDerecognitionofAvailableForSaleFinancialAssets ??= new(_timeProvider, _securityIdentifier);\n        private GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement _gainLossonDerecognitionofAvailableForSaleFinancialAssets;\n\n        /// <summary>\n        /// Negative Goodwill recognized in the Income Statement. Negative Goodwill arises where the net assets at the date of acquisition, fairly valued, falls below the cost of acquisition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20394\n        /// </remarks>\n        [JsonProperty(\"20394\")]\n        public NegativeGoodwillImmediatelyRecognizedIncomeStatement NegativeGoodwillImmediatelyRecognized => _negativeGoodwillImmediatelyRecognized ??= new(_timeProvider, _securityIdentifier);\n        private NegativeGoodwillImmediatelyRecognizedIncomeStatement _negativeGoodwillImmediatelyRecognized;\n\n        /// <summary>\n        /// Gain or loss on derivatives investment due to the fair value adjustment.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20395\n        /// </remarks>\n        [JsonProperty(\"20395\")]\n        public GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal => _gainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal ??= new(_timeProvider, _securityIdentifier);\n        private GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement _gainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotal;\n\n        /// <summary>\n        /// Impairment or reversal of impairment on financial instrument such as derivative. This is a contra account under Total Revenue in banks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20396\n        /// </remarks>\n        [JsonProperty(\"20396\")]\n        public ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement ImpairmentLossesReversalsFinancialInstrumentsNet => _impairmentLossesReversalsFinancialInstrumentsNet ??= new(_timeProvider, _securityIdentifier);\n        private ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement _impairmentLossesReversalsFinancialInstrumentsNet;\n\n        /// <summary>\n        /// All reported claims arising out of incidents in that year are considered incurred grouped with claims paid out.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20400\n        /// </remarks>\n        [JsonProperty(\"20400\")]\n        public ClaimsandPaidIncurredIncomeStatement ClaimsandPaidIncurred => _claimsandPaidIncurred ??= new(_timeProvider, _securityIdentifier);\n        private ClaimsandPaidIncurredIncomeStatement _claimsandPaidIncurred;\n\n        /// <summary>\n        /// Claim on the reinsurance company and take the benefits.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20401\n        /// </remarks>\n        [JsonProperty(\"20401\")]\n        public ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement ReinsuranceRecoveriesClaimsandBenefits => _reinsuranceRecoveriesClaimsandBenefits ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement _reinsuranceRecoveriesClaimsandBenefits;\n\n        /// <summary>\n        /// Income/Expense due to changes between periods in insurance liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20402\n        /// </remarks>\n        [JsonProperty(\"20402\")]\n        public ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement ChangeinInsuranceLiabilitiesNetofReinsurance => _changeinInsuranceLiabilitiesNetofReinsurance ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement _changeinInsuranceLiabilitiesNetofReinsurance;\n\n        /// <summary>\n        /// Income/Expense due to changes between periods in Investment Contracts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20405\n        /// </remarks>\n        [JsonProperty(\"20405\")]\n        public ChangeinInvestmentContractIncomeStatement ChangeinInvestmentContract => _changeinInvestmentContract ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinInvestmentContractIncomeStatement _changeinInvestmentContract;\n\n        /// <summary>\n        /// Provision for the risk of loss of principal or loss of a financial reward stemming from a borrower's failure to repay a loan or otherwise meet a contractual obligation. Credit risk arises whenever a borrower is expecting to use future cash flows to pay a current debt. Investors are compensated for assuming credit risk by way of interest payments from the borrower or issuer of a debt obligation. This is a contra account under Total Revenue in banks.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20409\n        /// </remarks>\n        [JsonProperty(\"20409\")]\n        public CreditRiskProvisionsIncomeStatement CreditRiskProvisions => _creditRiskProvisions ??= new(_timeProvider, _securityIdentifier);\n        private CreditRiskProvisionsIncomeStatement _creditRiskProvisions;\n\n        /// <summary>\n        /// This is the portion under Staff Costs that represents salary paid to the employees in respect of their work.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20411\n        /// </remarks>\n        [JsonProperty(\"20411\")]\n        public WagesandSalariesIncomeStatement WagesandSalaries => _wagesandSalaries ??= new(_timeProvider, _securityIdentifier);\n        private WagesandSalariesIncomeStatement _wagesandSalaries;\n\n        /// <summary>\n        /// Total other income and expense of the company that cannot be identified by other specific items in the Non-Operating section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20412\n        /// </remarks>\n        [JsonProperty(\"20412\")]\n        public OtherNonOperatingIncomeExpensesIncomeStatement OtherNonOperatingIncomeExpenses => _otherNonOperatingIncomeExpenses ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonOperatingIncomeExpensesIncomeStatement _otherNonOperatingIncomeExpenses;\n\n        /// <summary>\n        /// Other income of the company that cannot be identified by other specific items in the Non-Operating section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20414\n        /// </remarks>\n        [JsonProperty(\"20414\")]\n        public OtherNonOperatingIncomeIncomeStatement OtherNonOperatingIncome => _otherNonOperatingIncome ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonOperatingIncomeIncomeStatement _otherNonOperatingIncome;\n\n        /// <summary>\n        /// Other expenses of the company that cannot be identified by other specific items in the Non-Operating section.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20415\n        /// </remarks>\n        [JsonProperty(\"20415\")]\n        public OtherNonOperatingExpensesIncomeStatement OtherNonOperatingExpenses => _otherNonOperatingExpenses ??= new(_timeProvider, _securityIdentifier);\n        private OtherNonOperatingExpensesIncomeStatement _otherNonOperatingExpenses;\n\n        /// <summary>\n        /// Total unusual items including Negative Goodwill.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20416\n        /// </remarks>\n        [JsonProperty(\"20416\")]\n        public TotalUnusualItemsIncomeStatement TotalUnusualItems => _totalUnusualItems ??= new(_timeProvider, _securityIdentifier);\n        private TotalUnusualItemsIncomeStatement _totalUnusualItems;\n\n        /// <summary>\n        /// The sum of all the identifiable operating and non-operating unusual items.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20417\n        /// </remarks>\n        [JsonProperty(\"20417\")]\n        public TotalUnusualItemsExcludingGoodwillIncomeStatement TotalUnusualItemsExcludingGoodwill => _totalUnusualItemsExcludingGoodwill ??= new(_timeProvider, _securityIdentifier);\n        private TotalUnusualItemsExcludingGoodwillIncomeStatement _totalUnusualItemsExcludingGoodwill;\n\n        /// <summary>\n        /// Tax rate used for Morningstar calculations.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20418\n        /// </remarks>\n        [JsonProperty(\"20418\")]\n        public TaxRateForCalcsIncomeStatement TaxRateForCalcs => _taxRateForCalcs ??= new(_timeProvider, _securityIdentifier);\n        private TaxRateForCalcsIncomeStatement _taxRateForCalcs;\n\n        /// <summary>\n        /// Tax effect of the usual items\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20419\n        /// </remarks>\n        [JsonProperty(\"20419\")]\n        public TaxEffectOfUnusualItemsIncomeStatement TaxEffectOfUnusualItems => _taxEffectOfUnusualItems ??= new(_timeProvider, _securityIdentifier);\n        private TaxEffectOfUnusualItemsIncomeStatement _taxEffectOfUnusualItems;\n\n        /// <summary>\n        /// EBITDA less Total Unusual Items\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20420\n        /// </remarks>\n        [JsonProperty(\"20420\")]\n        public NormalizedEBITDAIncomeStatement NormalizedEBITDA => _normalizedEBITDA ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedEBITDAIncomeStatement _normalizedEBITDA;\n\n        /// <summary>\n        /// The cost to the company for granting stock options to reward employees.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20422\n        /// </remarks>\n        [JsonProperty(\"20422\")]\n        public StockBasedCompensationIncomeStatement StockBasedCompensation => _stockBasedCompensation ??= new(_timeProvider, _securityIdentifier);\n        private StockBasedCompensationIncomeStatement _stockBasedCompensation;\n\n        /// <summary>\n        /// Net income to calculate Diluted EPS, accounting for adjustments assuming that all the convertible instruments are being converted to Common Equity.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20424\n        /// </remarks>\n        [JsonProperty(\"20424\")]\n        public DilutedNIAvailtoComStockholdersIncomeStatement DilutedNIAvailtoComStockholders => _dilutedNIAvailtoComStockholders ??= new(_timeProvider, _securityIdentifier);\n        private DilutedNIAvailtoComStockholdersIncomeStatement _dilutedNIAvailtoComStockholders;\n\n        /// <summary>\n        /// Income/Expenses due to the insurer's liabilities incurred in Investment Contracts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20425\n        /// </remarks>\n        [JsonProperty(\"20425\")]\n        public InvestmentContractLiabilitiesIncurredIncomeStatement InvestmentContractLiabilitiesIncurred => _investmentContractLiabilitiesIncurred ??= new(_timeProvider, _securityIdentifier);\n        private InvestmentContractLiabilitiesIncurredIncomeStatement _investmentContractLiabilitiesIncurred;\n\n        /// <summary>\n        /// Income/Expense due to recoveries from reinsurers for Investment Contracts.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20426\n        /// </remarks>\n        [JsonProperty(\"20426\")]\n        public ReinsuranceRecoveriesofInvestmentContractIncomeStatement ReinsuranceRecoveriesofInvestmentContract => _reinsuranceRecoveriesofInvestmentContract ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceRecoveriesofInvestmentContractIncomeStatement _reinsuranceRecoveriesofInvestmentContract;\n\n        /// <summary>\n        /// Total amount paid in dividends to equity securities investors.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20429\n        /// </remarks>\n        [JsonProperty(\"20429\")]\n        public TotalDividendPaymentofEquitySharesIncomeStatement TotalDividendPaymentofEquityShares => _totalDividendPaymentofEquityShares ??= new(_timeProvider, _securityIdentifier);\n        private TotalDividendPaymentofEquitySharesIncomeStatement _totalDividendPaymentofEquityShares;\n\n        /// <summary>\n        /// Total amount paid in dividends to Non-Equity securities investors.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20430\n        /// </remarks>\n        [JsonProperty(\"20430\")]\n        public TotalDividendPaymentofNonEquitySharesIncomeStatement TotalDividendPaymentofNonEquityShares => _totalDividendPaymentofNonEquityShares ??= new(_timeProvider, _securityIdentifier);\n        private TotalDividendPaymentofNonEquitySharesIncomeStatement _totalDividendPaymentofNonEquityShares;\n\n        /// <summary>\n        /// The change in the amount of the unearned premium reserves maintained by insurers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20431\n        /// </remarks>\n        [JsonProperty(\"20431\")]\n        public ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement ChangeinTheGrossProvisionforUnearnedPremiums => _changeinTheGrossProvisionforUnearnedPremiums ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement _changeinTheGrossProvisionforUnearnedPremiums;\n\n        /// <summary>\n        /// The change in the amount of unearned premium reserve to be covered by reinsurers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20432\n        /// </remarks>\n        [JsonProperty(\"20432\")]\n        public ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShare => _changeinTheGrossProvisionforUnearnedPremiumsReinsurersShare ??= new(_timeProvider, _securityIdentifier);\n        private ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement _changeinTheGrossProvisionforUnearnedPremiumsReinsurersShare;\n\n        /// <summary>\n        /// Income/Expense due to the insurer's changes in insurance liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20433\n        /// </remarks>\n        [JsonProperty(\"20433\")]\n        public ClaimsandChangeinInsuranceLiabilitiesIncomeStatement ClaimsandChangeinInsuranceLiabilities => _claimsandChangeinInsuranceLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ClaimsandChangeinInsuranceLiabilitiesIncomeStatement _claimsandChangeinInsuranceLiabilities;\n\n        /// <summary>\n        /// Income/Expense due to recoveries from reinsurers for insurance liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20434\n        /// </remarks>\n        [JsonProperty(\"20434\")]\n        public ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement ReinsuranceRecoveriesofInsuranceLiabilities => _reinsuranceRecoveriesofInsuranceLiabilities ??= new(_timeProvider, _securityIdentifier);\n        private ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement _reinsuranceRecoveriesofInsuranceLiabilities;\n\n        /// <summary>\n        /// Operating profit/loss as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20435\n        /// </remarks>\n        [JsonProperty(\"20435\")]\n        public TotalOperatingIncomeAsReportedIncomeStatement TotalOperatingIncomeAsReported => _totalOperatingIncomeAsReported ??= new(_timeProvider, _securityIdentifier);\n        private TotalOperatingIncomeAsReportedIncomeStatement _totalOperatingIncomeAsReported;\n\n        /// <summary>\n        /// Other General and Administrative Expenses not categorized that the company incurs that are not directly tied to a specific function such as manufacturing, production, or sales.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20436\n        /// </remarks>\n        [JsonProperty(\"20436\")]\n        public OtherGAIncomeStatement OtherGA => _otherGA ??= new(_timeProvider, _securityIdentifier);\n        private OtherGAIncomeStatement _otherGA;\n\n        /// <summary>\n        /// Other costs associated with the revenue-generating activities of the company not categorized above.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20437\n        /// </remarks>\n        [JsonProperty(\"20437\")]\n        public OtherCostofRevenueIncomeStatement OtherCostofRevenue => _otherCostofRevenue ??= new(_timeProvider, _securityIdentifier);\n        private OtherCostofRevenueIncomeStatement _otherCostofRevenue;\n\n        /// <summary>\n        /// Costs paid to use the facilities necessary to generate revenue during the accounting period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20438\n        /// </remarks>\n        [JsonProperty(\"20438\")]\n        public RentandLandingFeesCostofRevenueIncomeStatement RentandLandingFeesCostofRevenue => _rentandLandingFeesCostofRevenue ??= new(_timeProvider, _securityIdentifier);\n        private RentandLandingFeesCostofRevenueIncomeStatement _rentandLandingFeesCostofRevenue;\n\n        /// <summary>\n        /// Costs of depreciation and amortization on assets used for the revenue-generating activities during the accounting period\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20439\n        /// </remarks>\n        [JsonProperty(\"20439\")]\n        public DDACostofRevenueIncomeStatement DDACostofRevenue => _dDACostofRevenue ??= new(_timeProvider, _securityIdentifier);\n        private DDACostofRevenueIncomeStatement _dDACostofRevenue;\n\n        /// <summary>\n        /// The sum of all rent expenses incurred by the company for operating leases during the year, it is a supplemental value which would be reported outside consolidated statements or consolidated statement's footnotes.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20440\n        /// </remarks>\n        [JsonProperty(\"20440\")]\n        public RentExpenseSupplementalIncomeStatement RentExpenseSupplemental => _rentExpenseSupplemental ??= new(_timeProvider, _securityIdentifier);\n        private RentExpenseSupplementalIncomeStatement _rentExpenseSupplemental;\n\n        /// <summary>\n        /// This calculation represents pre-tax earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is calculated using Pre-Tax Income plus/minus any unusual Items and Goodwill Impairments/Write Offs.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20441\n        /// </remarks>\n        [JsonProperty(\"20441\")]\n        public NormalizedPreTaxIncomeIncomeStatement NormalizedPreTaxIncome => _normalizedPreTaxIncome ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedPreTaxIncomeIncomeStatement _normalizedPreTaxIncome;\n\n        /// <summary>\n        /// The aggregate amount of research and development expenses during the year. It is a supplemental value which would be reported outside consolidated statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20442\n        /// </remarks>\n        [JsonProperty(\"20442\")]\n        public ResearchAndDevelopmentExpensesSupplementalIncomeStatement ResearchAndDevelopmentExpensesSupplemental => _researchAndDevelopmentExpensesSupplemental ??= new(_timeProvider, _securityIdentifier);\n        private ResearchAndDevelopmentExpensesSupplementalIncomeStatement _researchAndDevelopmentExpensesSupplemental;\n\n        /// <summary>\n        /// The current period expense charged against earnings on tangible asset over its useful life. It is a supplemental value which would be reported outside consolidated statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20443\n        /// </remarks>\n        [JsonProperty(\"20443\")]\n        public DepreciationSupplementalIncomeStatement DepreciationSupplemental => _depreciationSupplemental ??= new(_timeProvider, _securityIdentifier);\n        private DepreciationSupplementalIncomeStatement _depreciationSupplemental;\n\n        /// <summary>\n        /// The current period expense charged against earnings on intangible asset over its useful life. It is a supplemental value which would be reported outside consolidated statements.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20444\n        /// </remarks>\n        [JsonProperty(\"20444\")]\n        public AmortizationSupplementalIncomeStatement AmortizationSupplemental => _amortizationSupplemental ??= new(_timeProvider, _securityIdentifier);\n        private AmortizationSupplementalIncomeStatement _amortizationSupplemental;\n\n        /// <summary>\n        /// Total revenue as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20445\n        /// </remarks>\n        [JsonProperty(\"20445\")]\n        public TotalRevenueAsReportedIncomeStatement TotalRevenueAsReported => _totalRevenueAsReported ??= new(_timeProvider, _securityIdentifier);\n        private TotalRevenueAsReportedIncomeStatement _totalRevenueAsReported;\n\n        /// <summary>\n        /// Operating expense as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20446\n        /// </remarks>\n        [JsonProperty(\"20446\")]\n        public OperatingExpenseAsReportedIncomeStatement OperatingExpenseAsReported => _operatingExpenseAsReported ??= new(_timeProvider, _securityIdentifier);\n        private OperatingExpenseAsReportedIncomeStatement _operatingExpenseAsReported;\n\n        /// <summary>\n        /// Earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20447\n        /// </remarks>\n        [JsonProperty(\"20447\")]\n        public NormalizedIncomeAsReportedIncomeStatement NormalizedIncomeAsReported => _normalizedIncomeAsReported ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedIncomeAsReportedIncomeStatement _normalizedIncomeAsReported;\n\n        /// <summary>\n        /// EBITDA less Total Unusual Items. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20448\n        /// </remarks>\n        [JsonProperty(\"20448\")]\n        public NormalizedEBITDAAsReportedIncomeStatement NormalizedEBITDAAsReported => _normalizedEBITDAAsReported ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedEBITDAAsReportedIncomeStatement _normalizedEBITDAAsReported;\n\n        /// <summary>\n        /// EBIT less Total Unusual Items. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20449\n        /// </remarks>\n        [JsonProperty(\"20449\")]\n        public NormalizedEBITAsReportedIncomeStatement NormalizedEBITAsReported => _normalizedEBITAsReported ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedEBITAsReportedIncomeStatement _normalizedEBITAsReported;\n\n        /// <summary>\n        /// Operating profit adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20450\n        /// </remarks>\n        [JsonProperty(\"20450\")]\n        public NormalizedOperatingProfitAsReportedIncomeStatement NormalizedOperatingProfitAsReported => _normalizedOperatingProfitAsReported ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedOperatingProfitAsReportedIncomeStatement _normalizedOperatingProfitAsReported;\n\n        /// <summary>\n        /// The average tax rate for the period as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 20451\n        /// </remarks>\n        [JsonProperty(\"20451\")]\n        public EffectiveTaxRateAsReportedIncomeStatement EffectiveTaxRateAsReported => _effectiveTaxRateAsReported ??= new(_timeProvider, _securityIdentifier);\n        private EffectiveTaxRateAsReportedIncomeStatement _effectiveTaxRateAsReported;\n\n        private readonly ITimeProvider _timeProvider;\n        private readonly SecurityIdentifier _securityIdentifier;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n        {\n            _timeProvider = timeProvider;\n            _securityIdentifier = securityIdentifier;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncomeStatementFileDate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Filing date of the Income Statement.\n    /// </summary>\n    public class IncomeStatementFileDate : MultiPeriodField<DateTime>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override DateTime Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ISFileDate_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()\n        {\n            var result = new Dictionary<string, DateTime>();\n            foreach (var kvp in new[] { new Tuple<string, DateTime>(\"1M\", OneMonth), new Tuple<string, DateTime>(\"2M\", TwoMonths), new Tuple<string, DateTime>(\"3M\", ThreeMonths), new Tuple<string, DateTime>(\"6M\", SixMonths), new Tuple<string, DateTime>(\"9M\", NineMonths), new Tuple<string, DateTime>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ISFileDate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncomeStatementFileDate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncomeStatementFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncomeTaxPaidSupplementalDataCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of cash paid during the current period to foreign, federal state and local authorities as taxes on income.\n    /// </summary>\n    public class IncomeTaxPaidSupplementalDataCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IncomeTaxPaidSupplementalData_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncomeTaxPaidSupplementalDataCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncomeTaxPaidSupplementalDataCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncomeTaxPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A current liability account which reflects the amount of income taxes currently due to the federal, state, and local governments.\n    /// </summary>\n    public class IncomeTaxPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_IncomeTaxPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_IncomeTaxPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncomeTaxPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncomeTaxPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total income from the associates and joint venture via investment, accounted for in the Non-Operating section.\n    /// </summary>\n    public class IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_IncomefromAssociatesandOtherParticipatingInterests_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncreaseDecreaseInDepositCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate net change during the reporting period in moneys given as security, collateral, or margin deposits.\n    /// </summary>\n    public class IncreaseDecreaseInDepositCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IncreaseDecreaseInDeposit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncreaseDecreaseInDepositCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncreaseDecreaseInDepositCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncreaseDecreaseInLeaseFinancingCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Change in cash flow resulting from increase/decrease in lease financing.\n    /// </summary>\n    public class IncreaseDecreaseInLeaseFinancingCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IncreaseDecreaseInLeaseFinancing_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncreaseDecreaseInLeaseFinancingCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncreaseDecreaseInLeaseFinancingCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Premium might contain a portion of the amount that has been paid in advance for insurance that has not yet been provided, which is called unearned premium. If either party cancels the contract, the insurer must have the unearned premium ready to refund. Hence, the amount of premium reserve maintained by insurers is called unearned premium reserves, which is prepared for liquidation. This item is usually only available for insurance industry.\n    /// </summary>\n    public class IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_IncreaseDecreaseInNetUnearnedPremiumReserves_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncreaseInInterestBearingDepositsInBankCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Increase in interest-bearing deposits in bank.\n    /// </summary>\n    public class IncreaseInInterestBearingDepositsInBankCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IncreaseInInterestBearingDepositsInBank_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncreaseInInterestBearingDepositsInBankCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncreaseInInterestBearingDepositsInBankCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IncreaseInLeaseFinancingCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from increase in lease financing.\n    /// </summary>\n    public class IncreaseInLeaseFinancingCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IncreaseInLeaseFinancing_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IncreaseInLeaseFinancingCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IncreaseInLeaseFinancingCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InsuranceAndClaimsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Insurance and claims are the expenses in the period incurred with respect to protection provided by insurance entities against risks other than risks associated with production (which is allocated to cost of sales). This item is usually not available for insurance industries.\n    /// </summary>\n    public class InsuranceAndClaimsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InsuranceAndClaims_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InsuranceAndClaims_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InsuranceAndClaimsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InsuranceAndClaimsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InsuranceContractAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A contract under which one party (the insurer) accepts significant insurance risk from another party (the policyholder) by agreeing to compensate the policyholder if a specified uncertain future event (the insured event) adversely affects the policyholder. This includes Insurance Receivables and Premiums Receivables.\n    /// </summary>\n    public class InsuranceContractAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InsuranceContractAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InsuranceContractAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InsuranceContractAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InsuranceContractLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any type of insurance policy that protects an individual or business from the risk that they may be sued and held legally liable for something such as malpractice, injury or negligence. Liability insurance policies cover both legal costs and any legal payouts for which the insured would be responsible if found legally liable. Intentional damage and contractual liabilities are typically not covered in these types of policies.\n    /// </summary>\n    public class InsuranceContractLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceContractLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InsuranceContractLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InsuranceContractLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InsuranceContractLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InsuranceFundsNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities related to insurance funds that are dissolved after one year.\n    /// </summary>\n    public class InsuranceFundsNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InsuranceFundsNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InsuranceFundsNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InsuranceFundsNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestBearingBorrowingsNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount of any interest-bearing loan which is due after one year.\n    /// </summary>\n    public class InterestBearingBorrowingsNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InterestBearingBorrowingsNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestBearingBorrowingsNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestBearingBorrowingsNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestBearingDepositsAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Deposit of money with a financial institution, in consideration of which the financial institution pays or credits interest, or amounts in the nature of interest.\n    /// </summary>\n    public class InterestBearingDepositsAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InterestBearingDepositsAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestBearingDepositsAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestBearingDepositsAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestBearingDepositsLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate of all domestic and foreign deposits in the bank that earns interests.\n    /// </summary>\n    public class InterestBearingDepositsLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InterestBearingDepositsLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestBearingDepositsLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestBearingDepositsLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestCoverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of EBIT to Interest Expense. Morningstar calculates the ratio by using the underlying data reported in the Income Statement within the company filings or reports: EBIT / Interest Expense.\n    /// </summary>\n    public class InterestCoverage : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InterestCoverage_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_InterestCoverage_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestCoverage()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestCoverage(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestCreditedOnPolicyholderDepositsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An expense reported in the income statement and needs to be removed from net income to arrive at cash provided by (used in) operations to the extent that such interest has not been paid. This item is usually only available for insurance industry.\n    /// </summary>\n    public class InterestCreditedOnPolicyholderDepositsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestCreditedOnPolicyholderDeposits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestCreditedOnPolicyholderDepositsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestCreditedOnPolicyholderDepositsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseForDepositIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes interest expense on the following deposit accounts: Interest-bearing Demand deposit; Checking account; Savings account; Deposit in foreign offices; Money Market Certificates &amp; Deposit Accounts. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestExpenseForDepositIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForDeposit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpenseForDeposit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseForDepositIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseForDepositIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gross expenses on the purchase of Federal funds at a specified price with a simultaneous agreement to sell the same to the same counterparty at a fixed or determinable price at a future date. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate interest expenses incurred on long-term borrowings and any interest expenses on fixed assets (property, plant, equipment) that are leased due longer than one year. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpenseForLongTermDebtAndCapitalSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseForShortTermDebtIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate interest expenses incurred on short-term borrowings and any interest expenses on fixed assets (property, plant, equipment) that are leased within one year. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestExpenseForShortTermDebtIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpenseForShortTermDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseForShortTermDebtIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseForShortTermDebtIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Relates to the general cost of borrowing money. It is the price that a lender charges a borrower for the use of the lender's money.\n    /// </summary>\n    public class InterestExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestExpenseNonOperatingIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest expense caused by long term financing activities; such as interest expense incurred on trading liabilities, commercial paper, long-term debt, capital leases, deposits, and all other borrowings.\n    /// </summary>\n    public class InterestExpenseNonOperatingIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestExpenseNonOperating_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestExpenseNonOperating_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestExpenseNonOperatingIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestExpenseNonOperatingIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeAfterProvisionForLoanLossIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net interest and dividend income or expense, including any amortization and accretion (as applicable) of discounts and premiums, including consideration of the provisions for loan, lease, credit, and other related losses, if any.\n    /// </summary>\n    public class InterestIncomeAfterProvisionForLoanLossIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeAfterProvisionForLoanLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeAfterProvisionForLoanLossIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeAfterProvisionForLoanLossIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromDepositsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest income generated from all deposit accounts. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestIncomeFromDepositsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromDeposits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromDepositsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromDepositsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value of funds outstanding loaned in the form of security resale agreements if the agreement requires the purchaser to resell the identical security purchased or a security that meets the definition of \"\"substantially the same\"\" in the case of a dollar roll. Also includes purchases of participations in pools of securities that are subject to a resale agreement; This category includes all interest income generated from federal funds sold and securities purchases under agreements to resell; This category includes all interest income generated from federal funds sold and securities purchases under agreements to resell.\n    /// </summary>\n    public class InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResell_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromLeasesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes interest and fee income generated by direct lease financing. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestIncomeFromLeasesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLeases_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromLeases_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromLeasesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromLeasesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromLoansAndLeaseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total interest and fee income generated by loans and lease. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestIncomeFromLoansAndLeaseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromLoansAndLease_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromLoansAndLeaseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromLoansAndLeaseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromLoansIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Loan is a common field to banks. Interest Income from Loans is interest and fee income generated from all loans, which includes Commercial loans; Credit loans; Other consumer loans; Real Estate - Construction; Real Estate - Mortgage; Foreign loans. Banks earn interest from loans. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestIncomeFromLoansIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromLoansIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromLoansIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeFromSecuritiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents total interest and dividend income from U.S. Treasury securities, U.S. government agency and corporation obligations, securities issued by states and political subdivisions, other domestic debt securities, foreign debt securities, and equity securities (including investments in mutual funds). Excludes interest income from securities held in trading accounts. This item is usually only available for bank industry.\n    /// </summary>\n    public class InterestIncomeFromSecuritiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeFromSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeFromSecuritiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeFromSecuritiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income generated from interest-bearing deposits or accounts.\n    /// </summary>\n    public class InterestIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestIncomeNonOperatingIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest income earned from long term financing activities.\n    /// </summary>\n    public class InterestIncomeNonOperatingIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InterestIncomeNonOperating_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InterestIncomeNonOperating_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestIncomeNonOperatingIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestIncomeNonOperatingIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestPaidCFFCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest paid on loans, debt or borrowings, in the Financing Cash Flow section.\n    /// </summary>\n    public class InterestPaidCFFCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFF_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestPaidCFF_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestPaidCFFCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestPaidCFFCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestPaidCFOCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest paid on loans, debt or borrowings, in the Operating Cash Flow section.\n    /// </summary>\n    public class InterestPaidCFOCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidCFO_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestPaidCFO_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestPaidCFOCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestPaidCFOCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestPaidDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest paid on loans, debt or borrowings, in the direct cash flow.\n    /// </summary>\n    public class InterestPaidDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestPaidDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestPaidDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestPaidDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestPaidSupplementalDataCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of cash paid during the current period for interest owed on money borrowed; including amount of interest capitalized.\n    /// </summary>\n    public class InterestPaidSupplementalDataCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestPaidSupplementalData_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestPaidSupplementalDataCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestPaidSupplementalDataCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying values as of the balance sheet date of interest payable on all forms of debt, including trade payable that has been incurred.\n    /// </summary>\n    public class InterestPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InterestPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InterestPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestReceivedCFICashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest received by the company, in the Investing Cash Flow section.\n    /// </summary>\n    public class InterestReceivedCFICashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFI_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestReceivedCFI_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestReceivedCFICashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestReceivedCFICashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestReceivedCFOCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest received by the company, in the Operating Cash Flow section.\n    /// </summary>\n    public class InterestReceivedCFOCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedCFO_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestReceivedCFO_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestReceivedCFOCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestReceivedCFOCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestReceivedDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Interest received by the company, in the direct cash flow.\n    /// </summary>\n    public class InterestReceivedDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestReceivedDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestReceivedDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestReceivedDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestReceivedDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InterestandCommissionPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid for interest and commission in operating cash flow, using the direct method\n    /// </summary>\n    public class InterestandCommissionPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InterestandCommissionPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InterestandCommissionPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InterestandCommissionPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InterestandCommissionPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InventoriesAdjustmentsAllowancesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item represents certain charges made in the current period in inventory resulting from such factors as breakage, spoilage, employee theft and shoplifting. This item is typically available for manufacturing, mining and utility industries.\n    /// </summary>\n    public class InventoriesAdjustmentsAllowancesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InventoriesAdjustmentsAllowances_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InventoriesAdjustmentsAllowancesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InventoriesAdjustmentsAllowancesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InventoryBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A company's merchandise, raw materials, and finished and unfinished products which have not yet been sold.\n    /// </summary>\n    public class InventoryBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Inventory_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Inventory_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InventoryBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InventoryBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InventoryTurnover.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cost Of Goods Sold / Average Inventory\n    /// </summary>\n    public class InventoryTurnover : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InventoryTurnover_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InventoryTurnover_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InventoryTurnover_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InventoryTurnover_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_InventoryTurnover_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_InventoryTurnover_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InventoryTurnover()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InventoryTurnover(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InventoryValuationMethod.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Which method of inventory valuation was used - LIFO, FIFO, Average, Standard costs, Net realizable value, Others, LIFO and FIFO, FIFO and Average, FIFO and other, LIFO and Average, LIFO and other, Average and other, 3 or more methods, None\n    /// </summary>\n    public class InventoryValuationMethod : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_InventoryValuationMethod_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_InventoryValuationMethod_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InventoryValuationMethod()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InventoryValuationMethod(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestedCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Invested capital = common shareholders' equity + long term debt + current debt\n    /// </summary>\n    public class InvestedCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestedCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestedCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestedCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestedCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestingCashFlowCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An item on the cash flow statement that reports the aggregate change in a company's cash position resulting from any gains (or losses) from investments in the financial markets and operating subsidiaries, and changes resulting from amounts spent on investments in capital assets such as plant and equipment.\n    /// </summary>\n    public class InvestingCashFlowCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_InvestingCashFlow_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_InvestingCashFlow_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestingCashFlowCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestingCashFlowCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentBankingProfitIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes (1) underwriting revenue (the spread between the resale price received and the cost of the securities and related expenses) generated through the purchasing, distributing and reselling of new issues of securities (alternatively, could be a secondary offering of a large block of previously issued securities); and (2) fees earned for mergers, acquisitions, divestitures, restructurings, and other types of financial advisory services. This item is usually only available for bank industry.\n    /// </summary>\n    public class InvestmentBankingProfitIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentBankingProfit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InvestmentBankingProfit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentBankingProfitIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentBankingProfitIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentContractLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities due on the insurance investment contract.\n    /// </summary>\n    public class InvestmentContractLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentContractLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentContractLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentContractLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentContractLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentContractLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentContractLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentContractLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentContractLiabilitiesIncurredIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expenses due to the insurer's liabilities incurred in Investment Contracts.\n    /// </summary>\n    public class InvestmentContractLiabilitiesIncurredIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_InvestmentContractLiabilitiesIncurred_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentContractLiabilitiesIncurredIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentContractLiabilitiesIncurredIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentPropertiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Company's investments in properties net of accumulated depreciation, which generate a return.\n    /// </summary>\n    public class InvestmentPropertiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentPropertiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentPropertiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentinFinancialAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the sum of all financial investments (trading securities, available-for-sale securities, held-to-maturity securities, etc.)\n    /// </summary>\n    public class InvestmentinFinancialAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentinFinancialAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentinFinancialAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentinFinancialAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentsAndAdvancesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All investments in affiliates, real estate, securities, etc. Non-current investment, not including marketable securities.\n    /// </summary>\n    public class InvestmentsAndAdvancesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsAndAdvances_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentsAndAdvances_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentsAndAdvancesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentsAndAdvancesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item represents the carrying amount on the company's balance sheet of its investments in common stock of an equity method. This item is typically available for the insurance industry.\n    /// </summary>\n    public class InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentsInOtherVenturesUnderEquityMethod_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentsinAssociatesatCostBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A stake in any company which is more than 20% but less than 50%.\n    /// </summary>\n    public class InvestmentsinAssociatesatCostBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentsinAssociatesatCost_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentsinAssociatesatCostBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentsinAssociatesatCostBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentsinJointVenturesatCostBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A 50% stake in any company in which remaining 50% belongs to other company.\n    /// </summary>\n    public class InvestmentsinJointVenturesatCostBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentsinJointVenturesatCost_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentsinJointVenturesatCostBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentsinJointVenturesatCostBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/InvestmentsinSubsidiariesatCostBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A stake in any company which is more than 51%.\n    /// </summary>\n    public class InvestmentsinSubsidiariesatCostBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_InvestmentsinSubsidiariesatCost_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public InvestmentsinSubsidiariesatCostBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public InvestmentsinSubsidiariesatCostBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IssuanceOfCapitalStockCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from offering common stock, which is the additional capital contribution to the entity during the PeriodAsByte.\n    /// </summary>\n    public class IssuanceOfCapitalStockCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IssuanceOfCapitalStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IssuanceOfCapitalStockCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IssuanceOfCapitalStockCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IssuanceOfDebtCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow due to an increase in long term debt.\n    /// </summary>\n    public class IssuanceOfDebtCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssuanceOfDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IssuanceOfDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IssuanceOfDebtCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IssuanceOfDebtCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/IssueExpensesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cost associated with issuance of debt/equity capital in the Financing Cash Flow section.\n    /// </summary>\n    public class IssueExpensesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_IssueExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_IssueExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public IssueExpensesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public IssueExpensesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount as of the balance sheet date of drafts and bills of exchange that have been accepted by the reporting bank or by others for its own account, as its liability to holders of the drafts.\n    /// </summary>\n    public class ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ItemsinTheCourseofTransmissiontoOtherBanks_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LandAndImprovementsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fixed Assets that specifically deal with land a company owns. Includes the improvements associated with land. This excludes land held for sale.\n    /// </summary>\n    public class LandAndImprovementsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LandAndImprovements_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LandAndImprovements_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LandAndImprovementsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LandAndImprovementsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LeasesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount at the balance sheet date of a long-lived, depreciable asset that is an addition or improvement to assets held under lease arrangement. This item is usually not available for the insurance industry.\n    /// </summary>\n    public class LeasesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Leases_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Leases_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LeasesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LeasesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities due within the next 12 months related from an asset classified as Held for Sale.\n    /// </summary>\n    public class LiabilitiesHeldforSaleCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LiabilitiesHeldforSaleCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LiabilitiesHeldforSaleCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities related to an asset classified as held for sale excluding the portion due the next 12 months or operating cycle.\n    /// </summary>\n    public class LiabilitiesHeldforSaleNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LiabilitiesHeldforSaleNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LiabilitiesHeldforSaleNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liabilities related to an asset classified as held for sale.\n    /// </summary>\n    public class LiabilitiesHeldforSaleTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LiabilitiesHeldforSaleTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LiabilitiesHeldforSaleTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LiabilitiesHeldforSaleTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LiabilitiesOfDiscontinuedOperationsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The obligations arising from the sale, disposal, or planned sale in the near future (generally within one year) of a disposal group, including a component of the entity (discontinued operation). This item is typically available for bank industry.\n    /// </summary>\n    public class LiabilitiesOfDiscontinuedOperationsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LiabilitiesOfDiscontinuedOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LiabilitiesOfDiscontinuedOperationsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LiabilitiesOfDiscontinuedOperationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LimitedPartnershipCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// In a limited partnership or master limited partnership form of business, this represents the balance of capital held by the limited partners.\n    /// </summary>\n    public class LimitedPartnershipCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LimitedPartnershipCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LimitedPartnershipCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LimitedPartnershipCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LimitedPartnershipCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LimitedPartnershipCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LimitedPartnershipCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LimitedPartnershipCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LimitedPartnershipCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LineOfCreditBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value as of the balance sheet date of obligations drawn from a line of credit, which is a bank's commitment to make loans up to a specific amount.\n    /// </summary>\n    public class LineOfCreditBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LineOfCredit_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LineOfCredit_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LineOfCreditBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LineOfCreditBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LoansHeldForSaleBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// It means the aggregate amount of loans receivable that will be sold to other entities. This item is typically available for bank industry.\n    /// </summary>\n    public class LoansHeldForSaleBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansHeldForSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LoansHeldForSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LoansHeldForSaleBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LoansHeldForSaleBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LoansReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reflects the carrying amount of unpaid loans issued to other institutions for cash needs or an asset purchase.\n    /// </summary>\n    public class LoansReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LoansReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LoansReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LoansReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LoansandAdvancestoBankBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of loans and advances made to a bank or financial institution.\n    /// </summary>\n    public class LoansandAdvancestoBankBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoBank_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoBank_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoBank_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoBank_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LoansandAdvancestoBank_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LoansandAdvancestoBankBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LoansandAdvancestoBankBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LoansandAdvancestoCustomerBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of loans and advances made to customers.\n    /// </summary>\n    public class LoansandAdvancestoCustomerBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LoansandAdvancestoCustomer_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LoansandAdvancestoCustomerBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LoansandAdvancestoCustomerBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermCapitalLeaseObligationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the total liability for long-term leases lasting over one year. Amount equal to the present value (the principal) at the beginning of the lease term less lease payments during the lease term.\n    /// </summary>\n    public class LongTermCapitalLeaseObligationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LongTermCapitalLeaseObligation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermCapitalLeaseObligationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermCapitalLeaseObligationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtAndCapitalLeaseObligationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All borrowings lasting over one year including long-term debt and long-term portion of capital lease obligations.\n    /// </summary>\n    public class LongTermDebtAndCapitalLeaseObligationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LongTermDebtAndCapitalLeaseObligation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtAndCapitalLeaseObligationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtAndCapitalLeaseObligationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying values as of the balance sheet date of all long-term debt, which is debt initially having maturities due after one year or beyond the operating cycle, if longer, but excluding the portions thereof scheduled to be repaid within one year or the normal operating cycle, if longer. Long-term debt includes notes payable, bonds payable, mortgage loans, convertible debt, subordinated debt and other types of long term debt.\n    /// </summary>\n    public class LongTermDebtBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LongTermDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtEquityRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Long Term Debt to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Long-Term Debt And Capital Lease Obligation / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n    /// </summary>\n    public class LongTermDebtEquityRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtEquityRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_LongTermDebtEquityRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtEquityRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtEquityRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from a debt initially having maturity due after one year or beyond the operating cycle, if longer.\n    /// </summary>\n    public class LongTermDebtIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_LongTermDebtIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtPaymentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow for debt initially having maturity due after one year or beyond the normal operating cycle, if longer.\n    /// </summary>\n    public class LongTermDebtPaymentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_LongTermDebtPayments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_LongTermDebtPayments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtPaymentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtPaymentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermDebtTotalCapitalRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Long Term Debt to Total Capital. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Long-Term Debt And Capital Lease Obligation / (Long-Term Debt And Capital Lease Obligation + Total Shareholder's Equity)\n    /// </summary>\n    public class LongTermDebtTotalCapitalRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LongTermDebtTotalCapitalRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_LongTermDebtTotalCapitalRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermDebtTotalCapitalRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermDebtTotalCapitalRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Often referred to simply as \"investments\". Long-term investments are to be held for many years and are not intended to be disposed in the near future. This group usually consists of four types of investments.\n    /// </summary>\n    public class LongTermInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LongTermInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LongTermProvisionsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Provisions are created to protect the interests of one or both parties named in a contract or legal document which is a preparatory action or measure. Long-term provision is expired beyond one accounting PeriodAsByte.\n    /// </summary>\n    public class LongTermProvisionsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_LongTermProvisions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_LongTermProvisions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LongTermProvisionsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LongTermProvisionsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LossAdjustmentExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Losses generally refer to (1) the amount of reduction in the value of an insured's property caused by an insured peril, (2) the amount sought through an insured's claim, or (3) the amount paid on behalf of an insured under an insurance contract. Loss Adjustment Expenses is expenses incurred in the course of investigating and settling claims that includes any legal and adjusters' fees and the costs of paying claims and all related expenses.\n    /// </summary>\n    public class LossAdjustmentExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossAdjustmentExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_LossAdjustmentExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LossAdjustmentExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LossAdjustmentExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LossRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A measure of operating performance for Insurance companies, as it shows the relationship between the premiums earned and the expenses related to claims. A number of 1 or lower is preferred, as this means the premiums exceed the expenses. Calculated as: Benefits, Claims and Loss Adjustment Expense, Net / Net Premiums Earned\n    /// </summary>\n    public class LossRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LossRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LossRatio_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LossRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_LossRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_LossRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LossRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LossRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/LossonExtinguishmentofDebtIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Loss on extinguishment of debt is the accounting loss that results from a debt extinguishment. A debt shall be accounted for as having been extinguished in a number of circumstances, including when it has been settled through repayment or replacement by another liability. It generally results in an accounting gain or loss. Amount represents the difference between the fair value of the payments made and the carrying amount of the debt at the time of its extinguishment.\n    /// </summary>\n    public class LossonExtinguishmentofDebtIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_LossonExtinguishmentofDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public LossonExtinguishmentofDebtIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public LossonExtinguishmentofDebtIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MachineryFurnitureEquipmentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Fixed assets specifically dealing with tools, equipment and office furniture. This item is usually not available for the insurance and utility industries.\n    /// </summary>\n    public class MachineryFurnitureEquipmentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MachineryFurnitureEquipment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MachineryFurnitureEquipmentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MachineryFurnitureEquipmentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MaintenanceAndRepairsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of maintenance and repair expenses in the current period associated with the revenue generation. Mainly for fixed assets. This item is usually only available for transportation industry.\n    /// </summary>\n    public class MaintenanceAndRepairsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MaintenanceAndRepairs_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_MaintenanceAndRepairs_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MaintenanceAndRepairsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MaintenanceAndRepairsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MaterialsAndSuppliesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Aggregated amount of unprocessed materials to be used in manufacturing or production process and supplies that will be consumed. This item is typically available for the utility industry.\n    /// </summary>\n    public class MaterialsAndSuppliesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MaterialsAndSupplies_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MaterialsAndSupplies_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MaterialsAndSupplies_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MaterialsAndSupplies_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MaterialsAndSupplies_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MaterialsAndSuppliesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MaterialsAndSuppliesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MineralPropertiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A fixed asset that represents strictly mineral type properties. This item is typically available for mining industry.\n    /// </summary>\n    public class MineralPropertiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MineralProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MineralProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MineralPropertiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MineralPropertiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MinimumPensionLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The company's minimum pension obligations to its former employees, paid into a defined pension plan to satisfy all pension entitlements that have been earned by employees to date.\n    /// </summary>\n    public class MinimumPensionLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinimumPensionLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinimumPensionLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinimumPensionLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinimumPensionLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MinimumPensionLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MinimumPensionLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MinimumPensionLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MinorityInterestBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount of the equity interests owned by non-controlling shareholders, partners, or other equity holders in one or more of the entities included in the reporting entity's consolidated financial statements.\n    /// </summary>\n    public class MinorityInterestBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MinorityInterestBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MinorityInterestBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MinorityInterestCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amount of net income (loss) for the period allocated to non-controlling shareholders, partners, or other equity holders in one or more of the entities included.\n    /// </summary>\n    public class MinorityInterestCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_MinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_MinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_MinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_MinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MinorityInterestCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MinorityInterestCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MinorityInterestsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents par or stated value of the subsidiary stock not owned by the parent company plus the minority interest's equity in the surplus of the subsidiary. This item includes preferred dividend averages on the minority preferred stock (preferred shares not owned by the reporting parent company). Minority interest also refers to stockholders who own less than 50% of a subsidiary's outstanding voting common stock. The minority stockholders hold an interest in the subsidiary's net assets and share earnings with the parent company.\n    /// </summary>\n    public class MinorityInterestsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_MinorityInterests_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_MinorityInterests_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MinorityInterestsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MinorityInterestsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MoneyMarketInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Short-term (typical maturity is less than one year), highly liquid government or corporate debt instrument such as bankers' acceptance, promissory notes, and treasury bills.\n    /// </summary>\n    public class MoneyMarketInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MoneyMarketInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MoneyMarketInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MoneyMarketInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MoneyMarketInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MortgageAndConsumerloansBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// It means the aggregate amount of mortgage and consumer loans. This item is typically available for the insurance industry.\n    /// </summary>\n    public class MortgageAndConsumerloansBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageAndConsumerloans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageAndConsumerloans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageAndConsumerloans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageAndConsumerloans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MortgageAndConsumerloans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MortgageAndConsumerloansBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MortgageAndConsumerloansBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/MortgageLoanBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is a lien on real estate to protect a lender. This item is typically available for bank industry.\n    /// </summary>\n    public class MortgageLoanBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_MortgageLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_MortgageLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public MortgageLoanBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public MortgageLoanBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NaturalGasFuelAndOtherBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount for the natural gas, fuel and other items related to the utility industry, which might include oil and gas wells, the properties to exploit oil and gas or liquefied natural gas sites.\n    /// </summary>\n    public class NaturalGasFuelAndOtherBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NaturalGasFuelAndOther_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NaturalGasFuelAndOtherBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NaturalGasFuelAndOtherBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NegativeGoodwillImmediatelyRecognizedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Negative Goodwill recognized in the Income Statement. Negative Goodwill arises where the net assets at the date of acquisition, fairly valued, falls below the cost of acquisition.\n    /// </summary>\n    public class NegativeGoodwillImmediatelyRecognizedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NegativeGoodwillImmediatelyRecognized_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NegativeGoodwillImmediatelyRecognizedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NegativeGoodwillImmediatelyRecognizedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetBusinessPurchaseAndSaleCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change between Purchases/Sales of Business.\n    /// </summary>\n    public class NetBusinessPurchaseAndSaleCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetBusinessPurchaseAndSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetBusinessPurchaseAndSaleCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetBusinessPurchaseAndSaleCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetCashFromDiscontinuedOperationsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash from (used in) all of the entity's discontinued operating activities, excluding those of continued operations, of the reporting entity.\n    /// </summary>\n    public class NetCashFromDiscontinuedOperationsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetCashFromDiscontinuedOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetCashFromDiscontinuedOperationsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetCashFromDiscontinuedOperationsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetCommonStockIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of common stock.\n    /// </summary>\n    public class NetCommonStockIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetCommonStockIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetCommonStockIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetCommonStockIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetCommonStockIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetDebtBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is a metric that shows a company's overall debt situation by netting the value of a company's liabilities and debts with its cash and other similar liquid assets. It is calculated using [Current Debt] + [Long Term Debt] - [Cash and Cash Equivalents].\n    /// </summary>\n    public class NetDebtBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NetDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetDebtBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetDebtBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetForeignCurrencyExchangeGainLossCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of realized and unrealized gain or loss resulting from changes in exchange rates between currencies. (Excludes foreign currency transactions designated as hedges of net investment in a foreign entity and inter-company foreign currency transactions that are of a long-term nature, when the entities to the transaction are consolidated, combined, or accounted for by the equity method in the reporting entity's financial statements. For certain entities, primarily banks, which are dealers in foreign exchange, foreign currency transaction gains or losses, may be disclosed as dealer gains or losses.)\n    /// </summary>\n    public class NetForeignCurrencyExchangeGainLossCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetForeignCurrencyExchangeGainLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetForeignCurrencyExchangeGainLossCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetForeignCurrencyExchangeGainLossCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetForeignExchangeGainLossIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate foreign currency translation gain or loss (both realized and unrealized) included as part of revenue. This item is usually only available for insurance industry.\n    /// </summary>\n    public class NetForeignExchangeGainLossIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetForeignExchangeGainLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetForeignExchangeGainLossIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetForeignExchangeGainLossIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeCommonStockholdersIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net income minus the preferred dividends paid as presented in the Income Statement.\n    /// </summary>\n    public class NetIncomeCommonStockholdersIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeCommonStockholders_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeCommonStockholdersIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeCommonStockholdersIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeContOpsGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's net income from continuing operations on a percentage basis. Morningstar calculates the growth percentage based on the underlying net income from continuing operations data reported in the Income Statement within the company filings or reports. This figure represents the rate of net income growth for parts of the business that will continue to generate revenue in the future.\n    /// </summary>\n    public class NetIncomeContOpsGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeContOpsGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NetIncomeContOpsGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeContOpsGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeContOpsGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeContinuousOperationsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue less expenses and taxes from the entity's ongoing operations and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n    /// </summary>\n    public class NetIncomeContinuousOperationsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeContinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeContinuousOperationsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeContinuousOperationsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue less expenses and taxes from the entity's ongoing operations net of minority interest and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n    /// </summary>\n    public class NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeContinuousOperationsNetMinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeDiscontinuousOperationsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// To be classified as discontinued operations, if both of the following conditions are met: 1: The operations and cash flow of the component have been or will be removed from the ongoing operations of the entity as a result of the disposal transaction, and 2: The entity will have no significant continuing involvement in the operations of the component after the disposal transaction. The discontinued operation is reported net of tax. Gains/Loss on Disposal of Discontinued Operations: Any gains or loss recognized on disposal of discontinued operations, which is the difference between the carrying value of the division and its fair value less costs to sell. Provision for Gain/Loss on Disposal: The amount of current expense charged in order to prepare for the disposal of discontinued operations.\n    /// </summary>\n    public class NetIncomeDiscontinuousOperationsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeDiscontinuousOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeDiscontinuousOperationsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeDiscontinuousOperationsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeExtraordinaryIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gains (losses), whether arising from extinguishment of debt, prior period adjustments, or from other events or transactions, that are both unusual in nature and infrequent in occurrence thereby meeting the criteria for an event or transaction to be classified as an extraordinary item.\n    /// </summary>\n    public class NetIncomeExtraordinaryIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeExtraordinary_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeExtraordinary_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeExtraordinaryIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeExtraordinaryIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net Income from Continuing Operations and Discontinued Operations, added together.\n    /// </summary>\n    public class NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeFromContinuingAndDiscontinuedOperation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue less expenses and taxes from the entity's ongoing operations net of minority interest and before income (loss) from: Preferred Dividends; Extraordinary Gains and Losses; Income from Cumulative Effects of Accounting Change; Discontinuing Operation; Income from Tax Loss Carry forward; Other Gains/Losses.\n    /// </summary>\n    public class NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeFromContinuingOperationNetMinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeFromContinuingOperationsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue less expenses and taxes from the entity's ongoing operations and before income (loss) from discontinued operations, extraordinary items, impact of changes in accounting principles, minority interest, and various other reconciling adjustments; represents the starting line for Operating Cash Flow.\n    /// </summary>\n    public class NetIncomeFromContinuingOperationsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetIncomeFromContinuingOperations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeFromContinuingOperationsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeFromContinuingOperationsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeFromTaxLossCarryforwardIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Occurs if a company has had a net loss from operations on a previous year that can be carried forward to reduce net income for tax purposes.\n    /// </summary>\n    public class NetIncomeFromTaxLossCarryforwardIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeFromTaxLossCarryforward_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeFromTaxLossCarryforwardIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeFromTaxLossCarryforwardIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's net income on a percentage basis. Morningstar calculates the growth percentage based on the underlying net income data reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class NetIncomeGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomeGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NetIncomeGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeIncludingNoncontrollingInterestsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net income of the group after the adjustment of all expenses and benefit.\n    /// </summary>\n    public class NetIncomeIncludingNoncontrollingInterestsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncomeIncludingNoncontrollingInterests_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeIncludingNoncontrollingInterestsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeIncludingNoncontrollingInterestsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes all the operations (continuing and discontinued) and all the other income or charges (extraordinary, accounting changes, tax loss carry forward, and other gains and losses).\n    /// </summary>\n    public class NetIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIncomePerEmployee.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Net Income to Employees. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Net Income / Employee Number.\n    /// </summary>\n    public class NetIncomePerEmployee : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomePerEmployee_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomePerEmployee_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomePerEmployee_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetIncomePerEmployee_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NetIncomePerEmployee_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIncomePerEmployee()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIncomePerEmployee(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIntangiblesPurchaseAndSaleCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change between Purchases/Sales of Intangibles.\n    /// </summary>\n    public class NetIntangiblesPurchaseAndSaleCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetIntangiblesPurchaseAndSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIntangiblesPurchaseAndSaleCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIntangiblesPurchaseAndSaleCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetInterestIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total interest income minus total interest expense. It represents the difference between interest and dividends earned on interest- bearing assets and interest paid to depositors and other creditors.\n    /// </summary>\n    public class NetInterestIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInterestIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetInterestIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetInterestIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetInterestIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetInvestmentIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total of interest, dividends, and other earnings derived from the insurance company's invested assets minus the expenses associated with these investments. Excluded from this income are capital gains or losses as the result of the sale of assets, as well as any unrealized capital gains or losses.\n    /// </summary>\n    public class NetInvestmentIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetInvestmentIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetInvestmentIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetInvestmentIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetInvestmentIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net increase or decrease in cash due to purchases or sales of investment properties during the accounting PeriodAsByte.\n    /// </summary>\n    public class NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetInvestmentPropertiesPurchaseAndSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetInvestmentPurchaseAndSaleCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change between Purchases/Sales of Investments.\n    /// </summary>\n    public class NetInvestmentPurchaseAndSaleCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetInvestmentPurchaseAndSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetInvestmentPurchaseAndSaleCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetInvestmentPurchaseAndSaleCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetIssuancePaymentsOfDebtCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of debt.\n    /// </summary>\n    public class NetIssuancePaymentsOfDebtCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetIssuancePaymentsOfDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetIssuancePaymentsOfDebtCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetIssuancePaymentsOfDebtCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetLoanBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the value of all loans after deduction of the appropriate allowances for loan and lease losses.\n    /// </summary>\n    public class NetLoanBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NetLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetLoanBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetLoanBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetLongTermDebtIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of long term debt. Long term debt includes notes payable, bonds payable, mortgage loans, convertible debt, subordinated debt and other types of long term debt.\n    /// </summary>\n    public class NetLongTermDebtIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetLongTermDebtIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetLongTermDebtIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetLongTermDebtIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of net income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Net Income / Revenue.\n    /// </summary>\n    public class NetMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NetMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NetMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetNonOperatingInterestIncomeExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net-Non Operating interest income or expenses caused by financing activities.\n    /// </summary>\n    public class NetNonOperatingInterestIncomeExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetNonOperatingInterestIncomeExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetNonOperatingInterestIncomeExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetNonOperatingInterestIncomeExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetOccupancyExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Occupancy expense may include items, such as depreciation of facilities and equipment, lease expenses, property taxes and property and casualty insurance expense. This item is usually only available for bank industry.\n    /// </summary>\n    public class NetOccupancyExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetOccupancyExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetOccupancyExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetOccupancyExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetOccupancyExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetOtherFinancingChargesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Miscellaneous charges incurred due to Financing activities.\n    /// </summary>\n    public class NetOtherFinancingChargesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetOtherFinancingCharges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetOtherFinancingChargesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetOtherFinancingChargesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetOtherInvestingChangesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Miscellaneous charges incurred due to Investing activities.\n    /// </summary>\n    public class NetOtherInvestingChangesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetOtherInvestingChanges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetOtherInvestingChangesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetOtherInvestingChangesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetOutwardLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Adjustments due to net loans to/from outsiders in the Investing Cash Flow section.\n    /// </summary>\n    public class NetOutwardLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOutwardLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOutwardLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetOutwardLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetOutwardLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetOutwardLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetOutwardLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetPPEBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Tangible assets that are held by an entity for use in the production or supply of goods and services, for rental to others, or for administrative purposes and that are expected to provide economic benefit for more than one year; net of accumulated depreciation.\n    /// </summary>\n    public class NetPPEBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NetPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetPPEBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetPPEBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetPPEPurchaseAndSaleCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change between Purchases/Sales of PPE.\n    /// </summary>\n    public class NetPPEPurchaseAndSaleCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetPPEPurchaseAndSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetPPEPurchaseAndSaleCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetPPEPurchaseAndSaleCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetPolicyholderBenefitsAndClaimsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net provision in current period for future policy benefits, claims, and claims settlement expenses incurred in the claims settlement process before the effects of reinsurance arrangements. The value is net of the effects of contracts assumed and ceded.\n    /// </summary>\n    public class NetPolicyholderBenefitsAndClaimsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetPolicyholderBenefitsAndClaims_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetPolicyholderBenefitsAndClaimsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetPolicyholderBenefitsAndClaimsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetPreferredStockIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of preferred stock.\n    /// </summary>\n    public class NetPreferredStockIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetPreferredStockIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetPreferredStockIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetPreferredStockIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetPremiumsWrittenIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net premiums written are gross premiums written less ceded premiums. This item is usually only available for insurance industry.\n    /// </summary>\n    public class NetPremiumsWrittenIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetPremiumsWritten_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetPremiumsWritten_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetPremiumsWrittenIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetPremiumsWrittenIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetProceedsPaymentForLoanCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net value of proceeds or payments of loans.\n    /// </summary>\n    public class NetProceedsPaymentForLoanCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetProceedsPaymentForLoan_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetProceedsPaymentForLoanCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetProceedsPaymentForLoanCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetRealizedGainLossOnInvestmentsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Gain or loss realized during the period of time for all kinds of investment securities. In might include trading, available-for-sale, or held-to-maturity securities. This item is usually only available for insurance industry.\n    /// </summary>\n    public class NetRealizedGainLossOnInvestmentsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetRealizedGainLossOnInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetRealizedGainLossOnInvestmentsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetRealizedGainLossOnInvestmentsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetShortTermDebtIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increase or decrease between periods of short term debt.\n    /// </summary>\n    public class NetShortTermDebtIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_NetShortTermDebtIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetShortTermDebtIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetShortTermDebtIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetTangibleAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net assets in physical form. This is calculated using Stockholders' Equity less Intangible Assets (including Goodwill).\n    /// </summary>\n    public class NetTangibleAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetTangibleAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NetTangibleAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetTangibleAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetTangibleAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetTradingIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any trading income on the securities.\n    /// </summary>\n    public class NetTradingIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetTradingIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetTradingIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NetTradingIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NetTradingIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetTradingIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetTradingIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NetUtilityPlantBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net utility plant might include water production, electric utility plan, natural gas, fuel and other, common utility plant and accumulated depreciation. This item is usually only available for utility industry.\n    /// </summary>\n    public class NetUtilityPlantBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetUtilityPlant_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetUtilityPlant_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetUtilityPlant_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetUtilityPlant_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NetUtilityPlant_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NetUtilityPlant_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NetUtilityPlantBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NetUtilityPlantBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentAccountsReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounts receivable represents sums owed to the business that the business records as revenue. Gross accounts receivable is accounts receivable before the business deducts uncollectable accounts to calculate the true value of accounts receivable.\n    /// </summary>\n    public class NonCurrentAccountsReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentAccountsReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentAccountsReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentAccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentAccruedExpensesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An expense that has occurred but the transaction has not been entered in the accounting records. Accordingly, an adjusting entry is made to debit the appropriate expense account and to credit a liability account such as accrued expenses payable or accounts payable.\n    /// </summary>\n    public class NonCurrentAccruedExpensesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentAccruedExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentAccruedExpensesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentAccruedExpensesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentDeferredAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments that will be assigned as expenses longer than one accounting period, but that are paid in advance and temporarily set up as non-current assets on the balance sheet.\n    /// </summary>\n    public class NonCurrentDeferredAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentDeferredAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentDeferredAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentDeferredAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentDeferredLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the non-current portion of obligations, which is a liability that usually would have been paid but is now past due.\n    /// </summary>\n    public class NonCurrentDeferredLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentDeferredLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentDeferredLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentDeferredLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentDeferredRevenueBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The non-current portion of deferred revenue amount as of the balance sheet date. Deferred revenue is a liability related to revenue producing activity for which revenue has not yet been recognized, and is not expected be recognized in the next twelve months.\n    /// </summary>\n    public class NonCurrentDeferredRevenueBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentDeferredRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentDeferredRevenueBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentDeferredRevenueBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentDeferredTaxesAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A result of timing differences between taxable incomes reported on the income statement and taxable income from the company's tax return. Depending on the positioning of deferred income taxes, the field may be either current (within current assets) or non- current (below total current assets). Typically a company will have two deferred income taxes fields.\n    /// </summary>\n    public class NonCurrentDeferredTaxesAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentDeferredTaxesAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentDeferredTaxesAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentDeferredTaxesLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The estimated future tax obligations, which usually arise when different accounting methods are used for financial statements and tax statement It is also an add-back to the cash flow statement. Deferred income taxes include accumulated tax deferrals due to accelerated depreciation and investment credit.\n    /// </summary>\n    public class NonCurrentDeferredTaxesLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentDeferredTaxesLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentDeferredTaxesLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentDeferredTaxesLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentNoteReceivablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s), excluding the portion that is expected to be received within one year of the balance sheet date or the normal operating cycle, whichever is longer.\n    /// </summary>\n    public class NonCurrentNoteReceivablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentNoteReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentNoteReceivablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentNoteReceivablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentOtherFinancialLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other long term financial liabilities not categorized and due over one year or a normal operating cycle (whichever is longer).\n    /// </summary>\n    public class NonCurrentOtherFinancialLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentOtherFinancialLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentOtherFinancialLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentOtherFinancialLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A loan issued by an insurance company that uses the cash value of a person's life insurance policy as collateral. This item is usually only available in the insurance industry.\n    /// </summary>\n    public class NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentPensionAndOtherPostretirementBenefitPlans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonCurrentPrepaidAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying amounts that are paid in advance for expenses, which will be charged against earnings in periods after one year or beyond the operating cycle, if longer.\n    /// </summary>\n    public class NonCurrentPrepaidAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonCurrentPrepaidAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonCurrentPrepaidAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonCurrentPrepaidAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Non-interest bearing deposits in other financial institutions for short periods of time, usually less than 12 months.\n    /// </summary>\n    public class NonInterestBearingBorrowingsCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestBearingBorrowingsCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestBearingBorrowingsCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Non-interest bearing borrowings due after a year.\n    /// </summary>\n    public class NonInterestBearingBorrowingsNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestBearingBorrowingsNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestBearingBorrowingsNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Non-interest bearing deposits in other financial institutions for relatively short periods of time; on a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class NonInterestBearingBorrowingsTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonInterestBearingBorrowingsTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestBearingBorrowingsTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestBearingBorrowingsTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestBearingDepositsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of all domestic and foreign deposits in the banks that do not draw interest.\n    /// </summary>\n    public class NonInterestBearingDepositsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NonInterestBearingDeposits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NonInterestBearingDeposits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestBearingDepositsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestBearingDepositsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any expenses that not related to interest. It includes labor and related expense, occupancy and equipment, commission, professional expense and contract services expenses, selling, general and administrative, research and development depreciation, amortization and depletion, and any other special income/charges.\n    /// </summary>\n    public class NonInterestExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NonInterestExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NonInterestIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total amount of non-interest income which may be derived from: (1) fees and commissions; (2) premiums earned; (3) equity investment; (4) the sale or disposal of assets; and (5) other sources not otherwise specified.\n    /// </summary>\n    public class NonInterestIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NonInterestIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NonInterestIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NonInterestIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NonInterestIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedBasicEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The basic normalized earnings per share. Normalized EPS removes onetime and unusual items from EPS, to provide investors with a more accurate measure of the company's true earnings. Normalized Earnings / Basic Weighted Average Shares Outstanding.\n    /// </summary>\n    public class NormalizedBasicEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedBasicEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_NormalizedBasicEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedBasicEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedBasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedBasicEPSGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's Normalized Basic EPS on a percentage basis.\n    /// </summary>\n    public class NormalizedBasicEPSGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedBasicEPSGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_NormalizedBasicEPSGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedBasicEPSGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedBasicEPSGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedDilutedEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The diluted normalized earnings per share. Normalized EPS removes onetime and unusual items from EPS, to provide investors with a more accurate measure of the company's true earnings. Normalized Earnings / Diluted Weighted Average Shares Outstanding.\n    /// </summary>\n    public class NormalizedDilutedEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_NormalizedDilutedEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_NormalizedDilutedEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedDilutedEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedDilutedEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedDilutedEPSGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's Normalized Diluted EPS on a percentage basis.\n    /// </summary>\n    public class NormalizedDilutedEPSGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_NormalizedDilutedEPSGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_NormalizedDilutedEPSGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedDilutedEPSGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedDilutedEPSGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedEBITAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// EBIT less Total Unusual Items. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class NormalizedEBITAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedEBITAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedEBITAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedEBITAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedEBITDAAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// EBITDA less Total Unusual Items. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class NormalizedEBITDAAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedEBITDAAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedEBITDAAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedEBITDAAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedEBITDAIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// EBITDA less Total Unusual Items\n    /// </summary>\n    public class NormalizedEBITDAIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedEBITDA_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedEBITDA_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedEBITDAIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedEBITDAIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedIncomeAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class NormalizedIncomeAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedIncomeAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedIncomeAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedIncomeAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This calculation represents earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is calculated using Net Income from Continuing Operations plus/minus any tax affected unusual Items and Goodwill Impairments/Write Offs.\n    /// </summary>\n    public class NormalizedIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedNetProfitMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Normalized Income / Total Revenue. A measure of profitability of the company calculated by finding Normalized Net Profit as a percentage of Total Revenues.\n    /// </summary>\n    public class NormalizedNetProfitMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedNetProfitMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NormalizedNetProfitMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedNetProfitMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedNetProfitMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedOperatingProfitAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Operating profit adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class NormalizedOperatingProfitAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedOperatingProfitAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedOperatingProfitAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedOperatingProfitAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedPreTaxIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This calculation represents pre-tax earnings adjusted for items that are irregular or unusual in nature, and/or are non-recurring. This can be used to fairly measure a company's profitability. This is calculated using Pre-Tax Income plus/minus any unusual Items and Goodwill Impairments/Write Offs.\n    /// </summary>\n    public class NormalizedPreTaxIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_NormalizedPreTaxIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedPreTaxIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedPreTaxIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NormalizedROIC.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// [Normalized Income + (Interest Expense * (1-Tax Rate))] / Invested Capital\n    /// </summary>\n    public class NormalizedROIC : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedROIC_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedROIC_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedROIC_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedROIC_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_NormalizedROIC_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_NormalizedROIC_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NormalizedROIC()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NormalizedROIC(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NotesReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An amount representing an agreement for an unconditional promise by the maker to pay the entity (holder) a definite sum of money at a future date(s) within one year of the balance sheet date or the normal operating cycle, whichever is longer. Such amount may include accrued interest receivable in accordance with the terms of the note. The note also may contain provisions including a discount or premium, payable on demand, secured, or unsecured, interest bearing or non-interest bearing, among a myriad of other features and characteristics.\n    /// </summary>\n    public class NotesReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NotesReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NotesReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NotesReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NotesReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_NotesReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_NotesReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NotesReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NotesReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/NumberOfShareHolders.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The number of shareholders on record\n    /// </summary>\n    public class NumberOfShareHolders : MultiPeriodField<long>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public long OneMonth => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public long TwoMonths => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public long ThreeMonths => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public long SixMonths => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public long NineMonths => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public long TwelveMonths => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(long), FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override long Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_NumberOfShareHolders_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(long), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, long> GetPeriodValues()\n        {\n            var result = new Dictionary<string, long>();\n            foreach (var kvp in new[] { new Tuple<string, long>(\"1M\", OneMonth), new Tuple<string, long>(\"2M\", TwoMonths), new Tuple<string, long>(\"3M\", ThreeMonths), new Tuple<string, long>(\"6M\", SixMonths), new Tuple<string, long>(\"9M\", NineMonths), new Tuple<string, long>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(long), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override long GetPeriodValue(string period) => FundamentalService.Get<long>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_NumberOfShareHolders_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public NumberOfShareHolders()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public NumberOfShareHolders(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OccupancyAndEquipmentIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes total expenses of occupancy and equipment. This item is usually only available for bank industry.\n    /// </summary>\n    public class OccupancyAndEquipmentIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OccupancyAndEquipment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OccupancyAndEquipment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OccupancyAndEquipmentIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OccupancyAndEquipmentIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingCashFlowCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net cash from (used in) all of the entity's operating activities, including those of discontinued operations, of the reporting entity. Operating activities include all transactions and events that are not defined as investing or financing activities. Operating activities generally involve producing and delivering goods and providing services. Cash flows from operating activities are generally the cash effects of transactions and other events that enter into the determination of net income.\n    /// </summary>\n    public class OperatingCashFlowCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingCashFlow_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OperatingCashFlow_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingCashFlowCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingCashFlowCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingExpenseAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Operating expense as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class OperatingExpenseAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpenseAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OperatingExpenseAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingExpenseAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingExpenseAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Operating expenses are primary recurring costs associated with central operations (other than cost of goods sold) that are incurred in order to generate sales.\n    /// </summary>\n    public class OperatingExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OperatingExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingGainsLossesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The gain or loss from the entity's ongoing operations.\n    /// </summary>\n    public class OperatingGainsLossesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OperatingGainsLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OperatingGainsLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingGainsLossesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingGainsLossesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income from normal business operations after deducting cost of revenue and operating expenses. It does not include income from any investing activities.\n    /// </summary>\n    public class OperatingIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OperatingIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingLeaseAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A contract that allows for the use of an asset, but does not convey rights of ownership of the asset. An operating lease is not capitalized; it is accounted for as a rental expense in what is known as \"off balance sheet financing.\" For the lessor, the asset being leased is accounted for as an asset and is depreciated as such.\n    /// </summary>\n    public class OperatingLeaseAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OperatingLeaseAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OperatingLeaseAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OperatingLeaseAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OperatingLeaseAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OperatingLeaseAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingLeaseAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingLeaseAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperatingRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sales and income that the company makes from its business operations. This applies only to non-bank and insurance companies. For Utility template companies, this is the sum of revenue from electric, gas, transportation and other operating revenue. For Transportation template companies, this is the sum of revenue-passenger, revenue-cargo, and other operating revenue.\n    /// </summary>\n    public class OperatingRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperatingRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OperatingRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperatingRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperatingRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperationAndMaintenanceIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of operation and maintenance expenses, which is the one important operating expense for the utility industry. It includes any costs related to production and maintenance cost of the property during the revenue generation process. This item is usually only available for mining and utility industries.\n    /// </summary>\n    public class OperationAndMaintenanceIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OperationAndMaintenance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OperationAndMaintenance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperationAndMaintenanceIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperationAndMaintenanceIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperationIncomeGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's operating income on a percentage basis. Morningstar calculates the growth percentage based on the underlying operating income data reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class OperationIncomeGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationIncomeGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_OperationIncomeGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperationIncomeGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperationIncomeGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperationMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of operating income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Operating Income / Revenue.\n    /// </summary>\n    public class OperationMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_OperationMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperationMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperationMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperationRatios.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the OperationRatios class\n    /// </summary>\n    public class OperationRatios : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// The growth in the company's revenue on a percentage basis. Morningstar calculates the growth percentage based on the underlying revenue data reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10001\n        /// </remarks>\n        [JsonProperty(\"10001\")]\n        public RevenueGrowth RevenueGrowth => _revenueGrowth ??= new(_timeProvider, _securityIdentifier);\n        private RevenueGrowth _revenueGrowth;\n\n        /// <summary>\n        /// The growth in the company's operating income on a percentage basis. Morningstar calculates the growth percentage based on the underlying operating income data reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10002\n        /// </remarks>\n        [JsonProperty(\"10002\")]\n        public OperationIncomeGrowth OperationIncomeGrowth => _operationIncomeGrowth ??= new(_timeProvider, _securityIdentifier);\n        private OperationIncomeGrowth _operationIncomeGrowth;\n\n        /// <summary>\n        /// The growth in the company's net income on a percentage basis. Morningstar calculates the growth percentage based on the underlying net income data reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10003\n        /// </remarks>\n        [JsonProperty(\"10003\")]\n        public NetIncomeGrowth NetIncomeGrowth => _netIncomeGrowth ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeGrowth _netIncomeGrowth;\n\n        /// <summary>\n        /// The growth in the company's net income from continuing operations on a percentage basis. Morningstar calculates the growth percentage based on the underlying net income from continuing operations data reported in the Income Statement within the company filings or reports. This figure represents the rate of net income growth for parts of the business that will continue to generate revenue in the future.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10004\n        /// </remarks>\n        [JsonProperty(\"10004\")]\n        public NetIncomeContOpsGrowth NetIncomeContOpsGrowth => _netIncomeContOpsGrowth ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomeContOpsGrowth _netIncomeContOpsGrowth;\n\n        /// <summary>\n        /// The growth in the company's cash flow from operations on a percentage basis. Morningstar calculates the growth percentage based on the underlying cash flow from operations data reported in the Cash Flow Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10005\n        /// </remarks>\n        [JsonProperty(\"10005\")]\n        public CFOGrowth CFOGrowth => _cFOGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CFOGrowth _cFOGrowth;\n\n        /// <summary>\n        /// The growth in the company's free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the underlying cash flow from operations and capital expenditures data reported in the Cash Flow Statement within the company filings or reports: Free Cash Flow = Cash flow from operations - Capital Expenditures.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10006\n        /// </remarks>\n        [JsonProperty(\"10006\")]\n        public FCFGrowth FCFGrowth => _fCFGrowth ??= new(_timeProvider, _securityIdentifier);\n        private FCFGrowth _fCFGrowth;\n\n        /// <summary>\n        /// The growth in the company's operating revenue on a percentage basis. Morningstar calculates the growth percentage based on the underlying operating revenue data reported in the Income Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 10007\n        /// </remarks>\n        [JsonProperty(\"10007\")]\n        public OperationRevenueGrowth3MonthAvg OperationRevenueGrowth3MonthAvg => _operationRevenueGrowth3MonthAvg ??= new(_timeProvider, _securityIdentifier);\n        private OperationRevenueGrowth3MonthAvg _operationRevenueGrowth3MonthAvg;\n\n        /// <summary>\n        /// Refers to the ratio of gross profit to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: (Revenue - Cost of Goods Sold) / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11001\n        /// </remarks>\n        [JsonProperty(\"11001\")]\n        public GrossMargin GrossMargin => _grossMargin ??= new(_timeProvider, _securityIdentifier);\n        private GrossMargin _grossMargin;\n\n        /// <summary>\n        /// Refers to the ratio of operating income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Operating Income / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11002\n        /// </remarks>\n        [JsonProperty(\"11002\")]\n        public OperationMargin OperationMargin => _operationMargin ??= new(_timeProvider, _securityIdentifier);\n        private OperationMargin _operationMargin;\n\n        /// <summary>\n        /// Refers to the ratio of pretax income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Pretax Income / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11003\n        /// </remarks>\n        [JsonProperty(\"11003\")]\n        public PretaxMargin PretaxMargin => _pretaxMargin ??= new(_timeProvider, _securityIdentifier);\n        private PretaxMargin _pretaxMargin;\n\n        /// <summary>\n        /// Refers to the ratio of net income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Net Income / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11004\n        /// </remarks>\n        [JsonProperty(\"11004\")]\n        public NetMargin NetMargin => _netMargin ??= new(_timeProvider, _securityIdentifier);\n        private NetMargin _netMargin;\n\n        /// <summary>\n        /// Refers to the ratio of tax provision to pretax income. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Tax Provision / Pretax Income. [Note: Valid only when positive pretax income, and positive tax expense (not tax benefit)]\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11005\n        /// </remarks>\n        [JsonProperty(\"11005\")]\n        public TaxRate TaxRate => _taxRate ??= new(_timeProvider, _securityIdentifier);\n        private TaxRate _taxRate;\n\n        /// <summary>\n        /// Refers to the ratio of earnings before interest and taxes to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: EBIT / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11006\n        /// </remarks>\n        [JsonProperty(\"11006\")]\n        public EBITMargin EBITMargin => _eBITMargin ??= new(_timeProvider, _securityIdentifier);\n        private EBITMargin _eBITMargin;\n\n        /// <summary>\n        /// Refers to the ratio of earnings before interest, taxes and depreciation and amortization to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: EBITDA / Revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11007\n        /// </remarks>\n        [JsonProperty(\"11007\")]\n        public EBITDAMargin EBITDAMargin => _eBITDAMargin ??= new(_timeProvider, _securityIdentifier);\n        private EBITDAMargin _eBITDAMargin;\n\n        /// <summary>\n        /// Refers to the ratio of Revenue to Employees. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Revenue / Employee Number.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11008\n        /// </remarks>\n        [JsonProperty(\"11008\")]\n        public SalesPerEmployee SalesPerEmployee => _salesPerEmployee ??= new(_timeProvider, _securityIdentifier);\n        private SalesPerEmployee _salesPerEmployee;\n\n        /// <summary>\n        /// Refers to the ratio of Current Assets to Current Liabilities. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Current Assets / Current Liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11009\n        /// </remarks>\n        [JsonProperty(\"11009\")]\n        public CurrentRatio CurrentRatio => _currentRatio ??= new(_timeProvider, _securityIdentifier);\n        private CurrentRatio _currentRatio;\n\n        /// <summary>\n        /// Refers to the ratio of liquid assets to Current Liabilities. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports:(Cash, Cash Equivalents, and Short Term Investments + Receivables ) / Current Liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11010\n        /// </remarks>\n        [JsonProperty(\"11010\")]\n        public QuickRatio QuickRatio => _quickRatio ??= new(_timeProvider, _securityIdentifier);\n        private QuickRatio _quickRatio;\n\n        /// <summary>\n        /// Refers to the ratio of Long Term Debt to Total Capital. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Long-Term Debt And Capital Lease Obligation / (Long-Term Debt And Capital Lease Obligation + Total Shareholder's Equity)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11011\n        /// </remarks>\n        [JsonProperty(\"11011\")]\n        public LongTermDebtTotalCapitalRatio LongTermDebtTotalCapitalRatio => _longTermDebtTotalCapitalRatio ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtTotalCapitalRatio _longTermDebtTotalCapitalRatio;\n\n        /// <summary>\n        /// Refers to the ratio of EBIT to Interest Expense. Morningstar calculates the ratio by using the underlying data reported in the Income Statement within the company filings or reports: EBIT / Interest Expense.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11012\n        /// </remarks>\n        [JsonProperty(\"11012\")]\n        public InterestCoverage InterestCoverage => _interestCoverage ??= new(_timeProvider, _securityIdentifier);\n        private InterestCoverage _interestCoverage;\n\n        /// <summary>\n        /// Refers to the ratio of Long Term Debt to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Long-Term Debt And Capital Lease Obligation / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11013\n        /// </remarks>\n        [JsonProperty(\"11013\")]\n        public LongTermDebtEquityRatio LongTermDebtEquityRatio => _longTermDebtEquityRatio ??= new(_timeProvider, _securityIdentifier);\n        private LongTermDebtEquityRatio _longTermDebtEquityRatio;\n\n        /// <summary>\n        /// Refers to the ratio of Total Assets to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: Total Assets / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11014\n        /// </remarks>\n        [JsonProperty(\"11014\")]\n        public FinancialLeverage FinancialLeverage => _financialLeverage ??= new(_timeProvider, _securityIdentifier);\n        private FinancialLeverage _financialLeverage;\n\n        /// <summary>\n        /// Refers to the ratio of Total Debt to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: (Current Debt And Current Capital Lease Obligation + Long-Term Debt And Long-Term Capital Lease Obligation / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11015\n        /// </remarks>\n        [JsonProperty(\"11015\")]\n        public TotalDebtEquityRatio TotalDebtEquityRatio => _totalDebtEquityRatio ??= new(_timeProvider, _securityIdentifier);\n        private TotalDebtEquityRatio _totalDebtEquityRatio;\n\n        /// <summary>\n        /// Normalized Income / Total Revenue. A measure of profitability of the company calculated by finding Normalized Net Profit as a percentage of Total Revenues.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 11016\n        /// </remarks>\n        [JsonProperty(\"11016\")]\n        public NormalizedNetProfitMargin NormalizedNetProfitMargin => _normalizedNetProfitMargin ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedNetProfitMargin _normalizedNetProfitMargin;\n\n        /// <summary>\n        /// 365 / Receivable Turnover\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12001\n        /// </remarks>\n        [JsonProperty(\"12001\")]\n        public DaysInSales DaysInSales => _daysInSales ??= new(_timeProvider, _securityIdentifier);\n        private DaysInSales _daysInSales;\n\n        /// <summary>\n        /// 365 / Inventory turnover\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12002\n        /// </remarks>\n        [JsonProperty(\"12002\")]\n        public DaysInInventory DaysInInventory => _daysInInventory ??= new(_timeProvider, _securityIdentifier);\n        private DaysInInventory _daysInInventory;\n\n        /// <summary>\n        /// 365 / Payable turnover\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12003\n        /// </remarks>\n        [JsonProperty(\"12003\")]\n        public DaysInPayment DaysInPayment => _daysInPayment ??= new(_timeProvider, _securityIdentifier);\n        private DaysInPayment _daysInPayment;\n\n        /// <summary>\n        /// Days In Inventory + Days In Sales - Days In Payment\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12004\n        /// </remarks>\n        [JsonProperty(\"12004\")]\n        public CashConversionCycle CashConversionCycle => _cashConversionCycle ??= new(_timeProvider, _securityIdentifier);\n        private CashConversionCycle _cashConversionCycle;\n\n        /// <summary>\n        /// Revenue / Average Accounts Receivables\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12005\n        /// </remarks>\n        [JsonProperty(\"12005\")]\n        public ReceivableTurnover ReceivableTurnover => _receivableTurnover ??= new(_timeProvider, _securityIdentifier);\n        private ReceivableTurnover _receivableTurnover;\n\n        /// <summary>\n        /// Cost Of Goods Sold / Average Inventory\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12006\n        /// </remarks>\n        [JsonProperty(\"12006\")]\n        public InventoryTurnover InventoryTurnover => _inventoryTurnover ??= new(_timeProvider, _securityIdentifier);\n        private InventoryTurnover _inventoryTurnover;\n\n        /// <summary>\n        /// Cost of Goods Sold / Average Accounts Payables\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12007\n        /// </remarks>\n        [JsonProperty(\"12007\")]\n        public PaymentTurnover PaymentTurnover => _paymentTurnover ??= new(_timeProvider, _securityIdentifier);\n        private PaymentTurnover _paymentTurnover;\n\n        /// <summary>\n        /// Revenue / Average PP&amp;E\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12008\n        /// </remarks>\n        [JsonProperty(\"12008\")]\n        public FixAssetsTuronver FixAssetsTuronver => _fixAssetsTuronver ??= new(_timeProvider, _securityIdentifier);\n        private FixAssetsTuronver _fixAssetsTuronver;\n\n        /// <summary>\n        /// Revenue / Average Total Assets\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12009\n        /// </remarks>\n        [JsonProperty(\"12009\")]\n        public AssetsTurnover AssetsTurnover => _assetsTurnover ??= new(_timeProvider, _securityIdentifier);\n        private AssetsTurnover _assetsTurnover;\n\n        /// <summary>\n        /// Net Income / Average Total Common Equity\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12010\n        /// </remarks>\n        [JsonProperty(\"12010\")]\n        public ROE ROE => _rOE ??= new(_timeProvider, _securityIdentifier);\n        private ROE _rOE;\n\n        /// <summary>\n        /// Net Income / Average Total Assets\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12011\n        /// </remarks>\n        [JsonProperty(\"12011\")]\n        public ROA ROA => _rOA ??= new(_timeProvider, _securityIdentifier);\n        private ROA _rOA;\n\n        /// <summary>\n        /// Net Income / (Total Equity + Long-term Debt and Capital Lease Obligation + Short-term Debt and Capital Lease Obligation)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12012\n        /// </remarks>\n        [JsonProperty(\"12012\")]\n        public ROIC ROIC => _rOIC ??= new(_timeProvider, _securityIdentifier);\n        private ROIC _rOIC;\n\n        /// <summary>\n        /// Free Cash flow / Revenue\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12013\n        /// </remarks>\n        [JsonProperty(\"12013\")]\n        public FCFSalesRatio FCFSalesRatio => _fCFSalesRatio ??= new(_timeProvider, _securityIdentifier);\n        private FCFSalesRatio _fCFSalesRatio;\n\n        /// <summary>\n        /// Free Cash Flow / Net Income\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12014\n        /// </remarks>\n        [JsonProperty(\"12014\")]\n        public FCFNetIncomeRatio FCFNetIncomeRatio => _fCFNetIncomeRatio ??= new(_timeProvider, _securityIdentifier);\n        private FCFNetIncomeRatio _fCFNetIncomeRatio;\n\n        /// <summary>\n        /// Capital Expenditure / Revenue\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12015\n        /// </remarks>\n        [JsonProperty(\"12015\")]\n        public CapExSalesRatio CapExSalesRatio => _capExSalesRatio ??= new(_timeProvider, _securityIdentifier);\n        private CapExSalesRatio _capExSalesRatio;\n\n        /// <summary>\n        /// This is a leverage ratio used to determine how much debt (a sum of long term and current portion of debt) a company has on its balance sheet relative to total assets. This ratio examines the percent of the company that is financed by debt.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12016\n        /// </remarks>\n        [JsonProperty(\"12016\")]\n        public DebtToAssets DebtToAssets => _debtToAssets ??= new(_timeProvider, _securityIdentifier);\n        private DebtToAssets _debtToAssets;\n\n        /// <summary>\n        /// This is a financial ratio of common stock equity to total assets that indicates the relative proportion of equity used to finance a company's assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12017\n        /// </remarks>\n        [JsonProperty(\"12017\")]\n        public CommonEquityToAssets CommonEquityToAssets => _commonEquityToAssets ??= new(_timeProvider, _securityIdentifier);\n        private CommonEquityToAssets _commonEquityToAssets;\n\n        /// <summary>\n        /// This is the compound annual growth rate of the company's capital spending over the last 5 years. Capital Spending is the sum of the Capital Expenditure items found in the Statement of Cash Flows.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12018\n        /// </remarks>\n        [JsonProperty(\"12018\")]\n        public CapitalExpenditureAnnual5YrGrowth CapitalExpenditureAnnual5YrGrowth => _capitalExpenditureAnnual5YrGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CapitalExpenditureAnnual5YrGrowth _capitalExpenditureAnnual5YrGrowth;\n\n        /// <summary>\n        /// This is the compound annual growth rate of the company's Gross Profit over the last 5 years.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12019\n        /// </remarks>\n        [JsonProperty(\"12019\")]\n        public GrossProfitAnnual5YrGrowth GrossProfitAnnual5YrGrowth => _grossProfitAnnual5YrGrowth ??= new(_timeProvider, _securityIdentifier);\n        private GrossProfitAnnual5YrGrowth _grossProfitAnnual5YrGrowth;\n\n        /// <summary>\n        /// This is the simple average of the company's Annual Gross Margin over the last 5 years. Gross Margin is Total Revenue minus Cost of Goods Sold divided by Total Revenue and is expressed as a percentage.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12020\n        /// </remarks>\n        [JsonProperty(\"12020\")]\n        public GrossMargin5YrAvg GrossMargin5YrAvg => _grossMargin5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private GrossMargin5YrAvg _grossMargin5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's Annual Post Tax Margin over the last 5 years. Post tax margin is Post tax divided by total revenue for the same period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12021\n        /// </remarks>\n        [JsonProperty(\"12021\")]\n        public PostTaxMargin5YrAvg PostTaxMargin5YrAvg => _postTaxMargin5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private PostTaxMargin5YrAvg _postTaxMargin5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's Annual Pre Tax Margin over the last 5 years. Pre tax margin is Pre tax divided by total revenue for the same period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12022\n        /// </remarks>\n        [JsonProperty(\"12022\")]\n        public PreTaxMargin5YrAvg PreTaxMargin5YrAvg => _preTaxMargin5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private PreTaxMargin5YrAvg _preTaxMargin5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's Annual Net Profit Margin over the last 5 years. Net profit margin is post tax income divided by total revenue for the same period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12023\n        /// </remarks>\n        [JsonProperty(\"12023\")]\n        public ProfitMargin5YrAvg ProfitMargin5YrAvg => _profitMargin5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private ProfitMargin5YrAvg _profitMargin5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's ROE over the last 5 years. Return on equity reveals how much profit a company has earned in comparison to the total amount of shareholder equity found on the balance sheet.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12024\n        /// </remarks>\n        [JsonProperty(\"12024\")]\n        public ROE5YrAvg ROE5YrAvg => _rOE5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private ROE5YrAvg _rOE5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's ROA over the last 5 years. Return on asset is calculated by dividing a company's annual earnings by its average total assets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12025\n        /// </remarks>\n        [JsonProperty(\"12025\")]\n        public ROA5YrAvg ROA5YrAvg => _rOA5YrAvg ??= new(_timeProvider, _securityIdentifier);\n        private ROA5YrAvg _rOA5YrAvg;\n\n        /// <summary>\n        /// This is the simple average of the company's ROIC over the last 5 years. Return on invested capital is calculated by taking net operating profit after taxes and dividends and dividing by the total amount of capital invested and expressing the result as a percentage.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12026\n        /// </remarks>\n        [JsonProperty(\"12026\")]\n        public AVG5YrsROIC AVG5YrsROIC => _aVG5YrsROIC ??= new(_timeProvider, _securityIdentifier);\n        private AVG5YrsROIC _aVG5YrsROIC;\n\n        /// <summary>\n        /// [Normalized Income + (Interest Expense * (1-Tax Rate))] / Invested Capital\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12027\n        /// </remarks>\n        [JsonProperty(\"12027\")]\n        public NormalizedROIC NormalizedROIC => _normalizedROIC ??= new(_timeProvider, _securityIdentifier);\n        private NormalizedROIC _normalizedROIC;\n\n        /// <summary>\n        /// The five-year growth rate of operating revenue, calculated using regression analysis.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12028\n        /// </remarks>\n        [JsonProperty(\"12028\")]\n        public RegressionGrowthOperatingRevenue5Years RegressionGrowthOperatingRevenue5Years => _regressionGrowthOperatingRevenue5Years ??= new(_timeProvider, _securityIdentifier);\n        private RegressionGrowthOperatingRevenue5Years _regressionGrowthOperatingRevenue5Years;\n\n        /// <summary>\n        /// Indicates a company's short-term liquidity, defined as short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12029\n        /// </remarks>\n        [JsonProperty(\"12029\")]\n        public CashRatio CashRatio => _cashRatio ??= new(_timeProvider, _securityIdentifier);\n        private CashRatio _cashRatio;\n\n        /// <summary>\n        /// Represents the percentage of a company's total assets is in cash.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12030\n        /// </remarks>\n        [JsonProperty(\"12030\")]\n        public CashtoTotalAssets CashtoTotalAssets => _cashtoTotalAssets ??= new(_timeProvider, _securityIdentifier);\n        private CashtoTotalAssets _cashtoTotalAssets;\n\n        /// <summary>\n        /// Measures the amount a company is investing in its business relative to EBITDA generated in a given period.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12031\n        /// </remarks>\n        [JsonProperty(\"12031\")]\n        public CapitalExpendituretoEBITDA CapitalExpendituretoEBITDA => _capitalExpendituretoEBITDA ??= new(_timeProvider, _securityIdentifier);\n        private CapitalExpendituretoEBITDA _capitalExpendituretoEBITDA;\n\n        /// <summary>\n        /// Indicates the percentage of a company's operating cash flow is free to be invested in its business after capital expenditures.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12032\n        /// </remarks>\n        [JsonProperty(\"12032\")]\n        public FCFtoCFO FCFtoCFO => _fCFtoCFO ??= new(_timeProvider, _securityIdentifier);\n        private FCFtoCFO _fCFtoCFO;\n\n        /// <summary>\n        /// The growth in the stockholder's equity on a percentage basis. Morningstar calculates the growth percentage based on the residual interest in the assets of the enterprise that remains after deducting its liabilities reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12033\n        /// </remarks>\n        [JsonProperty(\"12033\")]\n        public StockholdersEquityGrowth StockholdersEquityGrowth => _stockholdersEquityGrowth ??= new(_timeProvider, _securityIdentifier);\n        private StockholdersEquityGrowth _stockholdersEquityGrowth;\n\n        /// <summary>\n        /// The growth in the total assets on a percentage basis. Morningstar calculates the growth percentage based on the total assets reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12034\n        /// </remarks>\n        [JsonProperty(\"12034\")]\n        public TotalAssetsGrowth TotalAssetsGrowth => _totalAssetsGrowth ??= new(_timeProvider, _securityIdentifier);\n        private TotalAssetsGrowth _totalAssetsGrowth;\n\n        /// <summary>\n        /// The growth in the total liabilities on a percentage basis. Morningstar calculates the growth percentage based on the total liabilities reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12035\n        /// </remarks>\n        [JsonProperty(\"12035\")]\n        public TotalLiabilitiesGrowth TotalLiabilitiesGrowth => _totalLiabilitiesGrowth ??= new(_timeProvider, _securityIdentifier);\n        private TotalLiabilitiesGrowth _totalLiabilitiesGrowth;\n\n        /// <summary>\n        /// The growth in the company's total debt to equity ratio on a percentage basis. Morningstar calculates the growth percentage based on the total debt divided by the shareholder's equity reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12036\n        /// </remarks>\n        [JsonProperty(\"12036\")]\n        public TotalDebtEquityRatioGrowth TotalDebtEquityRatioGrowth => _totalDebtEquityRatioGrowth ??= new(_timeProvider, _securityIdentifier);\n        private TotalDebtEquityRatioGrowth _totalDebtEquityRatioGrowth;\n\n        /// <summary>\n        /// The growth in the company's cash ratio on a percentage basis. Morningstar calculates the growth percentage based on the short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12037\n        /// </remarks>\n        [JsonProperty(\"12037\")]\n        public CashRatioGrowth CashRatioGrowth => _cashRatioGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CashRatioGrowth _cashRatioGrowth;\n\n        /// <summary>\n        /// The growth in the company's EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the earnings minus expenses (excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12038\n        /// </remarks>\n        [JsonProperty(\"12038\")]\n        public EBITDAGrowth EBITDAGrowth => _eBITDAGrowth ??= new(_timeProvider, _securityIdentifier);\n        private EBITDAGrowth _eBITDAGrowth;\n\n        /// <summary>\n        /// The growth in the company's cash flows from financing on a percentage basis. Morningstar calculates the growth percentage based on the financing cash flows reported in the Cash Flow Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12039\n        /// </remarks>\n        [JsonProperty(\"12039\")]\n        public CashFlowFromFinancingGrowth CashFlowFromFinancingGrowth => _cashFlowFromFinancingGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromFinancingGrowth _cashFlowFromFinancingGrowth;\n\n        /// <summary>\n        /// The growth in the company's cash flows from investing on a percentage basis. Morningstar calculates the growth percentage based on the cash flows from investing reported in the Cash Flow Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12040\n        /// </remarks>\n        [JsonProperty(\"12040\")]\n        public CashFlowFromInvestingGrowth CashFlowFromInvestingGrowth => _cashFlowFromInvestingGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CashFlowFromInvestingGrowth _cashFlowFromInvestingGrowth;\n\n        /// <summary>\n        /// The growth in the company's capital expenditures on a percentage basis. Morningstar calculates the growth percentage based on the capital expenditures reported in the Cash Flow Statement within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12041\n        /// </remarks>\n        [JsonProperty(\"12041\")]\n        public CapExGrowth CapExGrowth => _capExGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CapExGrowth _capExGrowth;\n\n        /// <summary>\n        /// The growth in the company's current ratio on a percentage basis. Morningstar calculates the growth percentage based on the current assets divided by current liabilities reported in the Balance Sheet within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12042\n        /// </remarks>\n        [JsonProperty(\"12042\")]\n        public CurrentRatioGrowth CurrentRatioGrowth => _currentRatioGrowth ??= new(_timeProvider, _securityIdentifier);\n        private CurrentRatioGrowth _currentRatioGrowth;\n\n        /// <summary>\n        /// Total revenue / working capital (current assets minus current liabilities)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12043\n        /// </remarks>\n        [JsonProperty(\"12043\")]\n        public WorkingCapitalTurnoverRatio WorkingCapitalTurnoverRatio => _workingCapitalTurnoverRatio ??= new(_timeProvider, _securityIdentifier);\n        private WorkingCapitalTurnoverRatio _workingCapitalTurnoverRatio;\n\n        /// <summary>\n        /// Refers to the ratio of Net Income to Employees. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Net Income / Employee Number.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12044\n        /// </remarks>\n        [JsonProperty(\"12044\")]\n        public NetIncomePerEmployee NetIncomePerEmployee => _netIncomePerEmployee ??= new(_timeProvider, _securityIdentifier);\n        private NetIncomePerEmployee _netIncomePerEmployee;\n\n        /// <summary>\n        /// Measure of whether a company's cash flow is sufficient to meet its short-term and long-term debt requirements. The lower this ratio is, the greater the probability that the company will be in financial distress. Net Income + Depreciation, Depletion and Amortization/ average of annual Total Liabilities over the most recent two periods.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12045\n        /// </remarks>\n        [JsonProperty(\"12045\")]\n        public SolvencyRatio SolvencyRatio => _solvencyRatio ??= new(_timeProvider, _securityIdentifier);\n        private SolvencyRatio _solvencyRatio;\n\n        /// <summary>\n        /// A measure of operating performance for Insurance companies, as it shows the relationship between the premiums earned and administrative expenses related to claims such as fees and commissions. A number of 1 or lower is preferred, as this means the premiums exceed the expenses. Calculated as: (Deferred Policy Acquisition Amortization Expense+Fees and Commission Expense+Other Underwriting Expenses+Selling, General and Administrative) / Net Premiums Earned\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12046\n        /// </remarks>\n        [JsonProperty(\"12046\")]\n        public ExpenseRatio ExpenseRatio => _expenseRatio ??= new(_timeProvider, _securityIdentifier);\n        private ExpenseRatio _expenseRatio;\n\n        /// <summary>\n        /// A measure of operating performance for Insurance companies, as it shows the relationship between the premiums earned and the expenses related to claims. A number of 1 or lower is preferred, as this means the premiums exceed the expenses. Calculated as: Benefits, Claims and Loss Adjustment Expense, Net / Net Premiums Earned\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 12047\n        /// </remarks>\n        [JsonProperty(\"12047\")]\n        public LossRatio LossRatio => _lossRatio ??= new(_timeProvider, _securityIdentifier);\n        private LossRatio _lossRatio;\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperationRatios(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new OperationRatios(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OperationRevenueGrowth3MonthAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's operating revenue on a percentage basis. Morningstar calculates the growth percentage based on the underlying operating revenue data reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class OperationRevenueGrowth3MonthAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_OperationRevenueGrowth3MonthAvg_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_OperationRevenueGrowth3MonthAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OperationRevenueGrowth3MonthAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OperationRevenueGrowth3MonthAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OrdinarySharesNumberBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Number of Common or Ordinary Shares.\n    /// </summary>\n    public class OrdinarySharesNumberBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OrdinarySharesNumber_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OrdinarySharesNumber_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OrdinarySharesNumber_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OrdinarySharesNumber_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OrdinarySharesNumber_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OrdinarySharesNumberBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OrdinarySharesNumberBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other non-current assets that are not otherwise classified.\n    /// </summary>\n    public class OtherAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherBorrowedFundsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other borrowings by the bank to fund its activities that cannot be identified by other specific items in the Liabilities section.\n    /// </summary>\n    public class OtherBorrowedFundsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherBorrowedFunds_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherBorrowedFunds_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherBorrowedFunds_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherBorrowedFunds_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherBorrowedFunds_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherBorrowedFundsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherBorrowedFundsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCapitalStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other Capital Stock that is not otherwise classified.\n    /// </summary>\n    public class OtherCapitalStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCapitalStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherCapitalStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCapitalStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCapitalStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCashAdjustExcludeFromChangeinCashCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other changes to cash and cash equivalents during the accounting PeriodAsByte.\n    /// </summary>\n    public class OtherCashAdjustExcludeFromChangeinCashCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherCashAdjustExcludeFromChangeinCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCashAdjustExcludeFromChangeinCashCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCashAdjustExcludeFromChangeinCashCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other cash adjustments included in change in cash not categorized above.\n    /// </summary>\n    public class OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherCashAdjustIncludedIntoChangeinCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCashPaymentsfromOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other cash payments for the direct cash flow.\n    /// </summary>\n    public class OtherCashPaymentsfromOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherCashPaymentsfromOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCashPaymentsfromOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCashPaymentsfromOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCashReceiptsfromOperatingActivitiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other cash receipts for the direct cash flow.\n    /// </summary>\n    public class OtherCashReceiptsfromOperatingActivitiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherCashReceiptsfromOperatingActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCashReceiptsfromOperatingActivitiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCashReceiptsfromOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCostofRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other costs associated with the revenue-generating activities of the company not categorized above.\n    /// </summary>\n    public class OtherCostofRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCostofRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherCostofRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCostofRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCostofRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCurrentAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other current assets that are not otherwise classified.\n    /// </summary>\n    public class OtherCurrentAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherCurrentAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCurrentAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCurrentAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCurrentBorrowingsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Short Term Borrowings that are not otherwise classified.\n    /// </summary>\n    public class OtherCurrentBorrowingsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentBorrowings_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherCurrentBorrowings_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCurrentBorrowingsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCurrentBorrowingsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCurrentLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other current liabilities = Total current liabilities - Payables and accrued Expenses - Current debt and capital lease obligation - provisions, current - deferred liabilities, current.\n    /// </summary>\n    public class OtherCurrentLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherCurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherCurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCurrentLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCurrentLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherCustomerServicesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents fees and commissions earned from provide other services. This item is usually only available for bank industry.\n    /// </summary>\n    public class OtherCustomerServicesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherCustomerServices_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherCustomerServices_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherCustomerServicesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherCustomerServicesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherEquityAdjustmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other adjustments to stockholders' equity that is not otherwise classified, including other reserves.\n    /// </summary>\n    public class OtherEquityAdjustmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityAdjustments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherEquityAdjustments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherEquityAdjustmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherEquityAdjustmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherEquityInterestBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other equity instruments issued by the company that cannot be identified by other specific items in the Equity section.\n    /// </summary>\n    public class OtherEquityInterestBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherEquityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherEquityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherEquityInterestBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherEquityInterestBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherFinancialLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other financial liabilities not categorized.\n    /// </summary>\n    public class OtherFinancialLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherFinancialLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherFinancialLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherFinancialLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherFinancialLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherFinancialLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherFinancialLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherFinancialLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherGAIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other General and Administrative Expenses not categorized that the company incurs that are not directly tied to a specific function such as manufacturing, production, or sales.\n    /// </summary>\n    public class OtherGAIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherGA_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherGA_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherGAIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherGAIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherIncomeExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income or expense that comes from miscellaneous sources.\n    /// </summary>\n    public class OtherIncomeExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherIncomeExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherIncomeExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherIncomeExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherIncomeExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherIntangibleAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying amounts of all intangible assets, excluding goodwill.\n    /// </summary>\n    public class OtherIntangibleAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherIntangibleAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherIntangibleAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherIntangibleAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherIntangibleAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherInterestExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All other interest expense that is not otherwise classified\n    /// </summary>\n    public class OtherInterestExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherInterestExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherInterestExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherInterestExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherInterestIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All other interest income that is not otherwise classified\n    /// </summary>\n    public class OtherInterestIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherInterestIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherInterestIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherInterestIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherInterestIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherInventoriesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other non-current inventories not otherwise classified.\n    /// </summary>\n    public class OtherInventoriesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInventories_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherInventories_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherInventoriesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherInventoriesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherInvestedAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// An item represents all the other investments or/and securities that cannot be defined into any category above. This item is typically available for the insurance industry.\n    /// </summary>\n    public class OtherInvestedAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestedAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestedAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestedAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestedAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherInvestedAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherInvestedAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherInvestedAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Investments that are neither Investment in Financial Assets nor Long term equity investment, not expected to be cashed within a year.\n    /// </summary>\n    public class OtherInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item is available for bank and insurance industries.\n    /// </summary>\n    public class OtherLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherLoanAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reflects the carrying amount of any other unpaid loans, an asset of the bank.\n    /// </summary>\n    public class OtherLoanAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoanAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoanAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoanAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoanAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherLoanAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherLoanAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherLoanAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherLoansCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other loans between the customer and bank which cannot be identified by other specific items in the Debt section, due within the next 12 months or operating cycle.\n    /// </summary>\n    public class OtherLoansCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherLoansCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherLoansCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherLoansCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherLoansNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other loans between the customer and bank which cannot be identified by other specific items in the Debt section, due beyond the current operating cycle.\n    /// </summary>\n    public class OtherLoansNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherLoansNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherLoansNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherLoansNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherLoansTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total other loans between the customer and bank which cannot be identified by other specific items in the Debt section; in a Non- Differentiated Balance Sheet.\n    /// </summary>\n    public class OtherLoansTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherLoansTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherLoansTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherLoansTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherLoansTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonCashItemsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Items which adjusted back from net income but without real cash outflow or inflow.\n    /// </summary>\n    public class OtherNonCashItemsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherNonCashItems_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherNonCashItems_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonCashItemsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonCashItemsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonCurrentAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other non-current assets that are not otherwise classified.\n    /// </summary>\n    public class OtherNonCurrentAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherNonCurrentAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonCurrentAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonCurrentAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonCurrentLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class OtherNonCurrentLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherNonCurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonCurrentLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonCurrentLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonInterestExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All other non interest expense that is not otherwise classified\n    /// </summary>\n    public class OtherNonInterestExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherNonInterestExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonInterestExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonInterestExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonInterestIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Usually available for the banking industry. This is Non-Interest Income that is not otherwise classified.\n    /// </summary>\n    public class OtherNonInterestIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonInterestIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherNonInterestIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonInterestIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonInterestIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonOperatingExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other expenses of the company that cannot be identified by other specific items in the Non-Operating section.\n    /// </summary>\n    public class OtherNonOperatingExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherNonOperatingExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonOperatingExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonOperatingExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonOperatingIncomeExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total other income and expense of the company that cannot be identified by other specific items in the Non-Operating section.\n    /// </summary>\n    public class OtherNonOperatingIncomeExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherNonOperatingIncomeExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonOperatingIncomeExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonOperatingIncomeExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherNonOperatingIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other income of the company that cannot be identified by other specific items in the Non-Operating section.\n    /// </summary>\n    public class OtherNonOperatingIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherNonOperatingIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherNonOperatingIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherNonOperatingIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherNonOperatingIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherOperatingExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of operating expenses associated with normal operations. Will not include any gain, loss, benefit, or income; and its value reported by the company should be &lt;0.\n    /// </summary>\n    public class OtherOperatingExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherOperatingExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherOperatingExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherOperatingExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherOperatingIncomeTotalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total Other Operating Income- including interest income, dividend income and other types of operating income.\n    /// </summary>\n    public class OtherOperatingIncomeTotalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherOperatingIncomeTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherOperatingIncomeTotalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherOperatingIncomeTotalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherOperatingInflowsOutflowsofCashCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any other cash inflows or outflows in the Operating Cash Flow section, not accounted for in the other specified items.\n    /// </summary>\n    public class OtherOperatingInflowsOutflowsofCashCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherOperatingInflowsOutflowsofCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherOperatingInflowsOutflowsofCashCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherOperatingInflowsOutflowsofCashCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payables and Accrued Expenses that are not defined as Trade, Tax or Dividends related.\n    /// </summary>\n    public class OtherPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherPropertiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other fixed assets not otherwise classified.\n    /// </summary>\n    public class OtherPropertiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherPropertiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherPropertiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherRealEstateOwnedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The Carrying amount as of the balance sheet date of other real estate, which may include real estate investments, real estate loans that qualify as investments in real estate, and premises that are no longer used in operations may also be included in real estate owned. This does not include real estate assets taken in settlement of troubled loans through surrender or foreclosure. This item is typically available for bank industry.\n    /// </summary>\n    public class OtherRealEstateOwnedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherRealEstateOwned_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherRealEstateOwned_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherRealEstateOwnedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherRealEstateOwnedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherReceivablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other non-current receivables not otherwise classified.\n    /// </summary>\n    public class OtherReceivablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherReceivablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherReceivablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherReservesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other reserves owned by the company that cannot be identified by other specific items in the Reserves section.\n    /// </summary>\n    public class OtherReservesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReserves_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReserves_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReserves_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherReserves_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherReserves_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherReservesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherReservesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherShortTermInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of short term investments, which will be expired within one year that are not specifically classified as Available-for-Sale, Held-to-Maturity, nor Trading investments.\n    /// </summary>\n    public class OtherShortTermInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_OtherShortTermInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_OtherShortTermInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherShortTermInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherShortTermInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherSpecialChargesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All other special charges that are not otherwise classified\n    /// </summary>\n    public class OtherSpecialChargesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherSpecialCharges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherSpecialCharges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherSpecialChargesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherSpecialChargesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherStaffCostsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Other costs in incurred in lieu of the employees that cannot be identified by other specific items in the Staff Costs section.\n    /// </summary>\n    public class OtherStaffCostsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherStaffCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherStaffCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherStaffCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherStaffCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherStaffCostsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherStaffCostsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherTaxesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any taxes that are not part of income taxes. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class OtherTaxesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherTaxes_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherTaxes_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherTaxesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherTaxesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherUnderwritingExpensesPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid out for underwriting expenses, such as the acquisition of new and renewal insurance contracts, in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class OtherUnderwritingExpensesPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_OtherUnderwritingExpensesPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherUnderwritingExpensesPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherUnderwritingExpensesPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/OtherunderPreferredStockDividendIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Dividend paid to the preferred shareholders before the common stock shareholders.\n    /// </summary>\n    public class OtherunderPreferredStockDividendIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_OtherunderPreferredStockDividend_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public OtherunderPreferredStockDividendIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public OtherunderPreferredStockDividendIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PayablesAndAccruedExpensesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This balance sheet account includes all current payables and accrued expenses.\n    /// </summary>\n    public class PayablesAndAccruedExpensesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PayablesAndAccruedExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PayablesAndAccruedExpensesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PayablesAndAccruedExpensesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PayablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of all payables owed and expected to be paid within one year or one operating cycle, including accounts payables, taxes payable, dividends payable and all other current payables.\n    /// </summary>\n    public class PayablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Payables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Payables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PayablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PayablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PaymentForLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payment from a bank or insurance company to the lender who lends money or property based on the agreement, along with interest, at a predetermined date in the future.\n    /// </summary>\n    public class PaymentForLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentForLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PaymentForLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PaymentForLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PaymentForLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PaymentTurnover.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cost of Goods Sold / Average Accounts Payables\n    /// </summary>\n    public class PaymentTurnover : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PaymentTurnover_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PaymentTurnover_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PaymentTurnover_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PaymentTurnover_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PaymentTurnover_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_PaymentTurnover_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PaymentTurnover()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PaymentTurnover(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PaymentsonBehalfofEmployeesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid in a form of salaries or other benefits to employees of the company, in the direct cash flow.\n    /// </summary>\n    public class PaymentsonBehalfofEmployeesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PaymentsonBehalfofEmployees_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PaymentsonBehalfofEmployeesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PaymentsonBehalfofEmployeesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PaymentstoSuppliersforGoodsandServicesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash paid to suppliers when purchasing goods or services by the company, in the direct cash flow.\n    /// </summary>\n    public class PaymentstoSuppliersforGoodsandServicesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PaymentstoSuppliersforGoodsandServices_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PaymentstoSuppliersforGoodsandServicesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PaymentstoSuppliersforGoodsandServicesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PensionAndEmployeeBenefitExpenseCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of pension and other (such as medical, dental and life insurance) postretirement benefit costs recognized during the PeriodAsByte.\n    /// </summary>\n    public class PensionAndEmployeeBenefitExpenseCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PensionAndEmployeeBenefitExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PensionAndEmployeeBenefitExpenseCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PensionAndEmployeeBenefitExpenseCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits. Used to reflect the current portion of the liabilities (due within one year or within the normal operating cycle if longer).\n    /// </summary>\n    public class PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PensionAndOtherPostretirementBenefitPlansTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PensionCostsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The expense that a company incurs each year by providing a pension plan for its employees. Major expenses in the pension cost include employer matching contributions and management fees.\n    /// </summary>\n    public class PensionCostsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PensionCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PensionCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PensionCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PensionCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PensionCostsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PensionCostsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits.\n    /// </summary>\n    public class PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PensionandOtherPostRetirementBenefitPlansCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PeriodAuditor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The name of the auditor that performed the financial statement audit for the given period.\n    /// </summary>\n    public class PeriodAuditor : MultiPeriodField<string>\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override string Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_PeriodAuditor_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, string> GetPeriodValues()\n        {\n            var result = new Dictionary<string, string>();\n            foreach (var kvp in new[] { new Tuple<string, string>(\"1M\", OneMonth), new Tuple<string, string>(\"2M\", TwoMonths), new Tuple<string, string>(\"3M\", ThreeMonths), new Tuple<string, string>(\"6M\", SixMonths), new Tuple<string, string>(\"9M\", NineMonths), new Tuple<string, string>(\"12M\", TwelveMonths) })\n            {\n                if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_PeriodAuditor_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PeriodAuditor()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PeriodAuditor(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyAcquisitionExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Costs that vary with and are primarily related to the acquisition of new and renewal insurance contracts. Also referred to as underwriting expenses.\n    /// </summary>\n    public class PolicyAcquisitionExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PolicyAcquisitionExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyAcquisitionExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyAcquisitionExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyLoansBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A loan issued by an insurance company that uses the cash value of a person's life insurance policy as collateral. This item is usually only available for insurance industry.\n    /// </summary>\n    public class PolicyLoansBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PolicyLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyLoansBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyLoansBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyReservesBenefitsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Accounting policy pertaining to an insurance entity's net liability for future benefits (for example, death, cash surrender value) to be paid to or on behalf of policyholders, describing the bases, methodologies and components of the reserve, and assumptions regarding estimates of expected investment yields, mortality, morbidity, terminations and expenses.\n    /// </summary>\n    public class PolicyReservesBenefitsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyReservesBenefits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PolicyReservesBenefits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyReservesBenefitsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyReservesBenefitsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderBenefitsCededIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The provision in current period for future policy benefits, claims, and claims settlement, which is under reinsurance arrangements. This item is usually only available for insurance industry.\n    /// </summary>\n    public class PolicyholderBenefitsCededIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsCeded_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsCeded_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsCeded_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PolicyholderBenefitsCeded_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderBenefitsCededIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderBenefitsCededIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderBenefitsGrossIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The gross amount of provision in current period for future policyholder benefits, claims, and claims settlement, incurred in the claims settlement process before the effects of reinsurance arrangements. This item is usually only available for insurance industry.\n    /// </summary>\n    public class PolicyholderBenefitsGrossIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PolicyholderBenefitsGross_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderBenefitsGrossIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderBenefitsGrossIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderDepositInvestmentReceivedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from policyholder deposit investment activities in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class PolicyholderDepositInvestmentReceivedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PolicyholderDepositInvestmentReceived_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderDepositInvestmentReceivedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderDepositInvestmentReceivedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderDividendsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments made or credits extended to the insured by the company, usually at the end of a policy year results in reducing the net insurance cost to the policyholder. Such dividends may be paid in cash to the insured or applied by the insured as reductions of the premiums due for the next policy year. This item is usually only available for insurance industry.\n    /// </summary>\n    public class PolicyholderDividendsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderDividends_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PolicyholderDividends_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderDividendsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderDividendsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderFundsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total liability as of the balance sheet date of amounts due to policy holders, excluding future policy benefits and claims, including unpaid policy dividends, retrospective refunds, and undistributed earnings on participating business.\n    /// </summary>\n    public class PolicyholderFundsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyholderFunds_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyholderFunds_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyholderFunds_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PolicyholderFunds_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PolicyholderFunds_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderFundsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderFundsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PolicyholderInterestIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The periodic income payment provided to the annuitant by the insurance company, which is determined by the assumed interest rate (AIR) and other factors. This item is usually only available for insurance industry.\n    /// </summary>\n    public class PolicyholderInterestIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PolicyholderInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PolicyholderInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PolicyholderInterestIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PolicyholderInterestIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PostTaxMargin5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's Annual Post Tax Margin over the last 5 years. Post tax margin is Post tax divided by total revenue for the same PeriodAsByte.\n    /// </summary>\n    public class PostTaxMargin5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PostTaxMargin5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PostTaxMargin5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PostTaxMargin5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_PostTaxMargin5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PostTaxMargin5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PostTaxMargin5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreTaxMargin5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's Annual Pre Tax Margin over the last 5 years. Pre tax margin is Pre tax divided by total revenue for the same PeriodAsByte.\n    /// </summary>\n    public class PreTaxMargin5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PreTaxMargin5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PreTaxMargin5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PreTaxMargin5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_PreTaxMargin5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreTaxMargin5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreTaxMargin5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreTreShaNumBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The treasury stock number of preferred shares. This represents the number of preferred shares owned by the company as a result of share repurchase programs or donations.\n    /// </summary>\n    public class PreTreShaNumBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreTreShaNum_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreTreShaNum_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreTreShaNum_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreTreShaNum_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PreTreShaNum_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreTreShaNumBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreTreShaNumBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredSecuritiesOutsideStockEquityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Preferred securities that that firm treats as a liability. It includes convertible preferred stock or redeemable preferred stock.\n    /// </summary>\n    public class PreferredSecuritiesOutsideStockEquityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PreferredSecuritiesOutsideStockEquity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredSecuritiesOutsideStockEquityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredSecuritiesOutsideStockEquityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredSharesNumberBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Number of Preferred Shares.\n    /// </summary>\n    public class PreferredSharesNumberBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSharesNumber_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSharesNumber_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSharesNumber_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredSharesNumber_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PreferredSharesNumber_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredSharesNumberBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredSharesNumberBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Preferred stock (all issues) at par value, as reported within the Stockholder's Equity section of the balance sheet.\n    /// </summary>\n    public class PreferredStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PreferredStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockDividendPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Pay for the amount of dividends declared or paid in the period to preferred shareholders or the amount for which the obligation to pay them dividends rose in the PeriodAsByte.\n    /// </summary>\n    public class PreferredStockDividendPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PreferredStockDividendPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockDividendPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockDividendPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockDividendsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of dividends declared or paid in the period to preferred shareholders, or the amount for which the obligation to pay them dividends arose in the PeriodAsByte. Preferred dividends are the amount required for the current year only, and not for any amount required in past years.\n    /// </summary>\n    public class PreferredStockDividendsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PreferredStockDividends_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PreferredStockDividends_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockDividendsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockDividendsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockEquityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A class of ownership in a company that has a higher claim on the assets and earnings than common stock. Preferred stock generally has a dividend that must be paid out before dividends to common stockholders and the shares usually do not have voting rights.\n    /// </summary>\n    public class PreferredStockEquityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PreferredStockEquity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PreferredStockEquity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockEquityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockEquityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from offering preferred stock.\n    /// </summary>\n    public class PreferredStockIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PreferredStockIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PreferredStockPaymentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow to reacquire preferred stock during the PeriodAsByte.\n    /// </summary>\n    public class PreferredStockPaymentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PreferredStockPayments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PreferredStockPayments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PreferredStockPaymentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PreferredStockPaymentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PremiumReceivedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from premium income in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class PremiumReceivedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PremiumReceived_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PremiumReceived_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PremiumReceivedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PremiumReceivedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PrepaidAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying amounts that are paid in advance for expenses, which will be charged against earnings in subsequent periods.\n    /// </summary>\n    public class PrepaidAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_PrepaidAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_PrepaidAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PrepaidAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PrepaidAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PretaxIncomeIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reported income before the deduction or benefit of income taxes.\n    /// </summary>\n    public class PretaxIncomeIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_PretaxIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_PretaxIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PretaxIncomeIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PretaxIncomeIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PretaxMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of pretax income to revenue. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Pretax Income / Revenue.\n    /// </summary>\n    public class PretaxMargin : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_PretaxMargin_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_PretaxMargin_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PretaxMargin()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PretaxMargin(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProceedsFromLoansCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from borrowing money or property for a bank or insurance company.\n    /// </summary>\n    public class ProceedsFromLoansCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromLoans_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProceedsFromLoans_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProceedsFromLoansCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProceedsFromLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProceedsFromStockOptionExercisedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow associated with the amount received from holders exercising their stock options.\n    /// </summary>\n    public class ProceedsFromStockOptionExercisedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProceedsFromStockOptionExercised_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProceedsFromStockOptionExercisedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProceedsFromStockOptionExercisedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount change of (1) the lending of excess federal funds to another commercial bank requiring such for its legal reserve requirements and (2) securities purchased under agreements to resell. This item is usually only available for bank industry.\n    /// </summary>\n    public class ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResell_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The net change on interest-bearing deposits in other financial institutions for relatively short periods of time including, for example, certificates of deposits.\n    /// </summary>\n    public class ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProceedsPaymentInInterestBearingDepositsInBank_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProfessionalExpenseAndContractServicesExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Professional and contract service expense includes cost reimbursements for support services related to contracted projects, outsourced management, technical and staff support. This item is usually only available for bank industry.\n    /// </summary>\n    public class ProfessionalExpenseAndContractServicesExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ProfessionalExpenseAndContractServicesExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProfessionalExpenseAndContractServicesExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProfessionalExpenseAndContractServicesExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProfitMargin5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's Annual Net Profit Margin over the last 5 years. Net profit margin is post tax income divided by total revenue for the same PeriodAsByte.\n    /// </summary>\n    public class ProfitMargin5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ProfitMargin5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ProfitMargin5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ProfitMargin5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ProfitMargin5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProfitMargin5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProfitMargin5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProfitOnDisposalsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The difference between the sale price or salvage price and the book value of an asset that was sold or retired during the reporting PeriodAsByte.\n    /// </summary>\n    public class ProfitOnDisposalsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProfitOnDisposals_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProfitOnDisposals_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProfitOnDisposalsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProfitOnDisposalsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PropertiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Tangible assets that are held by an entity for use in the production or supply of goods and services, for rental to others, or for administrative purposes and that are expected to provide economic benefit for more than one year. This item is available for manufacturing, bank and transportation industries.\n    /// </summary>\n    public class PropertiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Properties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Properties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Properties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Properties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Properties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PropertiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PropertiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProvisionForDoubtfulAccountsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amount of the current period expense charged against operations, the offset which is generally to the allowance for doubtful accounts for the purpose of reducing receivables, including notes receivable, to an amount that approximates their net realizable value (the amount expected to be collected). The category includes provision for loan losses, provision for any doubtful account receivable, and bad debt expenses. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class ProvisionForDoubtfulAccountsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ProvisionForDoubtfulAccounts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProvisionForDoubtfulAccountsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProvisionForDoubtfulAccountsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProvisionForLoanLeaseAndOtherLossesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of the periodic provision charged to earnings, based on an assessment of uncollectible from the counterparty on account of loan, lease or other credit losses, to reduce these accounts to the amount that approximates their net realizable value. This item is usually only available for bank industry.\n    /// </summary>\n    public class ProvisionForLoanLeaseAndOtherLossesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProvisionForLoanLeaseAndOtherLosses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProvisionForLoanLeaseAndOtherLossesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProvisionForLoanLeaseAndOtherLossesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProvisionandWriteOffofAssetsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A non-cash adjustment for total provision and write off on assets &amp; liabilities.\n    /// </summary>\n    public class ProvisionandWriteOffofAssetsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ProvisionandWriteOffofAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProvisionandWriteOffofAssetsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProvisionandWriteOffofAssetsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ProvisionsTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Provisions are created to protect the interests of one or both parties named in a contract or legal document, which is a preparatory action or measure. Current provision is expired within one accounting PeriodAsByte.\n    /// </summary>\n    public class ProvisionsTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ProvisionsTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ProvisionsTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ProvisionsTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ProvisionsTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ProvisionsTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ProvisionsTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ProvisionsTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfBusinessCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All the purchases of business including business acquisitions, investment in subsidiary; investing in affiliated companies, and join venture.\n    /// </summary>\n    public class PurchaseOfBusinessCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfBusiness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfBusiness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfBusinessCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfBusinessCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfIntangiblesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of capital outlays undertaken to increase, construct or improve intangible assets.\n    /// </summary>\n    public class PurchaseOfIntangiblesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfIntangibles_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfIntangiblesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfIntangiblesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfInvestmentCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All purchases of investments, including both long term and short term.\n    /// </summary>\n    public class PurchaseOfInvestmentCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfInvestment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfInvestmentCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfInvestmentCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfInvestmentPropertiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash outflow for purchases of investment properties during the accounting PeriodAsByte.\n    /// </summary>\n    public class PurchaseOfInvestmentPropertiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfInvestmentProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfInvestmentPropertiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfInvestmentPropertiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfJointVentureAssociateCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Purchase of joint venture/associates (investment below 50%).\n    /// </summary>\n    public class PurchaseOfJointVentureAssociateCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfJointVentureAssociate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfJointVentureAssociateCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfJointVentureAssociateCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfPPECashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of capital outlays undertaken to increase, construct or improve capital assets. This category includes property, plant equipment, furniture, fixed assets, buildings, and improvement.\n    /// </summary>\n    public class PurchaseOfPPECashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfPPECashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfPPECashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/PurchaseOfSubsidiariesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Purchase of subsidiaries or interest in subsidiaries (investments 51% and above).\n    /// </summary>\n    public class PurchaseOfSubsidiariesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_PurchaseOfSubsidiaries_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public PurchaseOfSubsidiariesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public PurchaseOfSubsidiariesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/QuickRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of liquid assets to Current Liabilities. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports:(Cash, Cash Equivalents, and Short Term Investments + Receivables ) / Current Liabilities.\n    /// </summary>\n    public class QuickRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_QuickRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_QuickRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public QuickRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public QuickRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ROA.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net Income / Average Total Assets\n    /// </summary>\n    public class ROA : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ROA_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ROA()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ROA(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ROA5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's ROA over the last 5 years. Return on asset is calculated by dividing a company's annual earnings by its average total assets.\n    /// </summary>\n    public class ROA5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROA5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ROA5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ROA5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ROA5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ROE.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net Income / Average Total Common Equity\n    /// </summary>\n    public class ROE : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ROE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ROE()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ROE(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ROE5YrAvg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the simple average of the company's ROE over the last 5 years. Return on equity reveals how much profit a company has earned in comparison to the total amount of shareholder equity found on the balance sheet.\n    /// </summary>\n    public class ROE5YrAvg : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE5YrAvg_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE5YrAvg_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROE5YrAvg_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ROE5YrAvg_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ROE5YrAvg()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ROE5YrAvg(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ROIC.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Net Income / (Total Equity + Long-term Debt and Capital Lease Obligation + Short-term Debt and Capital Lease Obligation)\n    /// </summary>\n    public class ROIC : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROIC_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROIC_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROIC_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROIC_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ROIC_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ROIC_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ROIC()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ROIC(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RawMaterialsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount as of the balance sheet data of unprocessed items to be consumed in the manufacturing or production process. This item is available for manufacturing and mining industries.\n    /// </summary>\n    public class RawMaterialsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RawMaterials_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RawMaterials_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RawMaterialsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RawMaterialsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The gains and losses included in earnings that represent the difference between the sale price and the carrying value of loans and leases that were sold during the reporting PeriodAsByte. This element refers to the gain (loss) and not to the cash proceeds of the sales. This element is a non-cash adjustment to net income when calculating net cash generated by operating activities using the indirect method. This item is usually only available for bank industry.\n    /// </summary>\n    public class RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_RealizedGainLossOnSaleOfLoansAndLease_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReceiptsfromCustomersCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payment received from customers in the Direct Cash Flow.\n    /// </summary>\n    public class ReceiptsfromCustomersCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ReceiptsfromCustomers_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReceiptsfromCustomersCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReceiptsfromCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReceiptsfromGovernmentGrantsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from governments in the form of grants in the Direct Cash Flow.\n    /// </summary>\n    public class ReceiptsfromGovernmentGrantsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ReceiptsfromGovernmentGrants_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReceiptsfromGovernmentGrantsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReceiptsfromGovernmentGrantsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReceivableTurnover.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue / Average Accounts Receivables\n    /// </summary>\n    public class ReceivableTurnover : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ReceivableTurnover_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ReceivableTurnover_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ReceivableTurnover_SixMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ReceivableTurnover_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_ReceivableTurnover_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_ReceivableTurnover_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReceivableTurnover()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReceivableTurnover(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReceivablesAdjustmentsAllowancesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A provision relating to a written agreement to receive money at a specified future date(s) (within one year from the reporting date or the normal operating cycle, whichever is longer), consisting of principal as well as any accrued interest).\n    /// </summary>\n    public class ReceivablesAdjustmentsAllowancesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ReceivablesAdjustmentsAllowances_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReceivablesAdjustmentsAllowancesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReceivablesAdjustmentsAllowancesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReceivablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of all receivables owed by customers and affiliates within one year, including accounts receivable, notes receivable, premiums receivable, and other current receivables.\n    /// </summary>\n    public class ReceivablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Receivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_Receivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReceivablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReceivablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReconciledCostOfRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The Cost Of Revenue plus Depreciation, Depletion &amp; Amortization from the IncomeStatement; minus Depreciation, Depletion &amp; Amortization from the Cash Flow Statement\n    /// </summary>\n    public class ReconciledCostOfRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ReconciledCostOfRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReconciledCostOfRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReconciledCostOfRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReconciledDepreciationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Is Depreciation, Depletion &amp; Amortization from the Cash Flow Statement\n    /// </summary>\n    public class ReconciledDepreciationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReconciledDepreciation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ReconciledDepreciation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReconciledDepreciationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReconciledDepreciationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RegressionGrowthOperatingRevenue5Years.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The five-year growth rate of operating revenue, calculated using regression analysis.\n    /// </summary>\n    public class RegressionGrowthOperatingRevenue5Years : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RegressionGrowthOperatingRevenue5Years_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RegressionGrowthOperatingRevenue5Years_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RegressionGrowthOperatingRevenue5Years_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_RegressionGrowthOperatingRevenue5Years_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RegressionGrowthOperatingRevenue5Years()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RegressionGrowthOperatingRevenue5Years(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RegressionGrowthofDividends5Years.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The five-year growth rate of dividends per share, calculated using regression analysis.\n    /// </summary>\n    public class RegressionGrowthofDividends5Years : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"FiveYears\";\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_RegressionGrowthofDividends5Years_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_RegressionGrowthofDividends5Years_FiveYears));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_RegressionGrowthofDividends5Years_FiveYears);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningRatios_RegressionGrowthofDividends5Years_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RegressionGrowthofDividends5Years()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RegressionGrowthofDividends5Years(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RegulatoryAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount as of the balance sheet date of capitalized costs of regulated entities that are expected to be recovered through revenue sources over one year or beyond the normal operating cycle.\n    /// </summary>\n    public class RegulatoryAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RegulatoryAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RegulatoryAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RegulatoryAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RegulatoryLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount for the individual regulatory noncurrent liability as itemized in a table of regulatory noncurrent liabilities as of the end of the PeriodAsByte. Such things as the costs of energy efficiency programs and low-income energy assistances programs and deferred fuel. This item is usually only available for utility industry.\n    /// </summary>\n    public class RegulatoryLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RegulatoryLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RegulatoryLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RegulatoryLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RegulatoryLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Reinsurance asset is insurance that is purchased by an insurance company from another insurance company.\n    /// </summary>\n    public class ReinsuranceAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ReinsuranceAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceBalancesPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amount as of the balance sheet date of the known and estimated amounts owed to insurers under reinsurance treaties or other arrangements. This item is usually only available for insurance industry.\n    /// </summary>\n    public class ReinsuranceBalancesPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ReinsuranceBalancesPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceBalancesPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceBalancesPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceRecoverableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of benefits the ceding insurer expects to recover on insurance policies ceded to other insurance entities as of the balance sheet date for all guaranteed benefit types. It includes estimated amounts for claims incurred but not reported, and policy benefits, net of any related valuation allowance.\n    /// </summary>\n    public class ReinsuranceRecoverableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceRecoverable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceRecoverable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceRecoverable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ReinsuranceRecoverable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ReinsuranceRecoverable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceRecoverableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceRecoverableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Claim on the reinsurance company and take the benefits.\n    /// </summary>\n    public class ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ReinsuranceRecoveriesClaimsandBenefits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expense due to recoveries from reinsurers for insurance liabilities.\n    /// </summary>\n    public class ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInsuranceLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceRecoveriesofInvestmentContractIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Expense due to recoveries from reinsurers for Investment Contracts.\n    /// </summary>\n    public class ReinsuranceRecoveriesofInvestmentContractIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ReinsuranceRecoveriesofInvestmentContract_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceRecoveriesofInvestmentContractIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceRecoveriesofInvestmentContractIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReinsuranceandOtherRecoveriesReceivedCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash received from reinsurance income or other recoveries income in operating cash flow, using the direct method. This item is usually only available for insurance industry\n    /// </summary>\n    public class ReinsuranceandOtherRecoveriesReceivedCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ReinsuranceandOtherRecoveriesReceived_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReinsuranceandOtherRecoveriesReceivedCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReinsuranceandOtherRecoveriesReceivedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RentAndLandingFeesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Rent fees are the cost of occupying space during the accounting PeriodAsByte. Landing fees are a change paid to an airport company for landing at a particular airport. This item is not available for insurance industry.\n    /// </summary>\n    public class RentAndLandingFeesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentAndLandingFees_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_RentAndLandingFees_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RentAndLandingFeesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RentAndLandingFeesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RentExpenseSupplementalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of all rent expenses incurred by the company for operating leases during the year, it is a supplemental value which would be reported outside consolidated statements or consolidated statement's footnotes.\n    /// </summary>\n    public class RentExpenseSupplementalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentExpenseSupplemental_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_RentExpenseSupplemental_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RentExpenseSupplementalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RentExpenseSupplementalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RentandLandingFeesCostofRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Costs paid to use the facilities necessary to generate revenue during the accounting PeriodAsByte.\n    /// </summary>\n    public class RentandLandingFeesCostofRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_RentandLandingFeesCostofRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RentandLandingFeesCostofRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RentandLandingFeesCostofRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReorganizationOtherCostsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A non-cash adjustment relating to restructuring costs.\n    /// </summary>\n    public class ReorganizationOtherCostsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ReorganizationOtherCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReorganizationOtherCostsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReorganizationOtherCostsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RepaymentInLeaseFinancingCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow to repay lease financing during the PeriodAsByte.\n    /// </summary>\n    public class RepaymentInLeaseFinancingCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_RepaymentInLeaseFinancing_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RepaymentInLeaseFinancingCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RepaymentInLeaseFinancingCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RepaymentOfDebtCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments to Settle Long Term Debt plus Payments to Settle Short Term Debt.\n    /// </summary>\n    public class RepaymentOfDebtCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepaymentOfDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_RepaymentOfDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RepaymentOfDebtCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RepaymentOfDebtCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReportedNormalizedBasicEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Normalized Basic EPS as reported by the company in the financial statements.\n    /// </summary>\n    public class ReportedNormalizedBasicEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedBasicEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_ReportedNormalizedBasicEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReportedNormalizedBasicEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReportedNormalizedBasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ReportedNormalizedDilutedEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Normalized Diluted EPS as reported by the company in the financial statements.\n    /// </summary>\n    public class ReportedNormalizedDilutedEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_ReportedNormalizedDilutedEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_ReportedNormalizedDilutedEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ReportedNormalizedDilutedEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ReportedNormalizedDilutedEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RepurchaseOfCapitalStockCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Payments for Common Stock plus Payments for Preferred Stock.\n    /// </summary>\n    public class RepurchaseOfCapitalStockCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_RepurchaseOfCapitalStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RepurchaseOfCapitalStockCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RepurchaseOfCapitalStockCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ResearchAndDevelopmentExpensesSupplementalIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of research and development expenses during the year. It is a supplemental value which would be reported outside consolidated statements.\n    /// </summary>\n    public class ResearchAndDevelopmentExpensesSupplementalIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ResearchAndDevelopmentExpensesSupplemental_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ResearchAndDevelopmentExpensesSupplementalIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ResearchAndDevelopmentExpensesSupplementalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ResearchAndDevelopmentIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of research and development expenses during the year.\n    /// </summary>\n    public class ResearchAndDevelopmentIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ResearchAndDevelopment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ResearchAndDevelopment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ResearchAndDevelopmentIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ResearchAndDevelopmentIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestrictedCashAndCashEquivalentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amounts of cash and cash equivalent items which are restricted as to withdrawal or usage. This item is available for bank and insurance industries.\n    /// </summary>\n    public class RestrictedCashAndCashEquivalentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RestrictedCashAndCashEquivalents_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestrictedCashAndCashEquivalentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestrictedCashAndCashEquivalentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestrictedCashAndInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash and investments whose use in whole or in part is restricted for the long-term, generally by contractual agreements or regulatory requirements. This item is usually only available for bank industry.\n    /// </summary>\n    public class RestrictedCashAndInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RestrictedCashAndInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestrictedCashAndInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestrictedCashAndInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestrictedCashBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amounts of cash and cash equivalent items, which are restricted as to withdrawal or usage. Restrictions may include legally restricted deposits held as compensating balances against short-term borrowing arrangements, contracts entered into with others, or entity statements of intention with regard to particular deposits; however, time deposits and short-term certificates of deposit are not generally included in legally restricted deposits. Excludes compensating balance arrangements that are not agreements, which legally restrict the use of cash amounts shown on the balance sheet. For a classified balance sheet, represents the current portion only (the non-current portion has a separate concept); for an unclassified balance sheet represents the entire amount. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class RestrictedCashBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCash_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RestrictedCash_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestrictedCashBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestrictedCashBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestrictedCommonStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Shares of stock for which sale is contractually or governmentally restricted for a given period of time. Stock that is acquired through an employee stock option plan or other private means may not be transferred. Restricted stock must be traded in compliance with special SEC regulations.\n    /// </summary>\n    public class RestrictedCommonStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCommonStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCommonStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCommonStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCommonStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedCommonStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RestrictedCommonStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestrictedCommonStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestrictedCommonStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestrictedInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Investments whose use is restricted in whole or in part, generally by contractual agreements or regulatory requirements. This item is usually only available for bank industry.\n    /// </summary>\n    public class RestrictedInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RestrictedInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RestrictedInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestrictedInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestrictedInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RestructuringAndMergernAcquisitionIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Expenses are related to restructuring, merger, or acquisitions. Restructuring expenses are charges associated with the consolidation and relocation of operations, disposition or abandonment of operations or productive assets. Merger and acquisition expenses are the amount of costs of a business combination including legal, accounting, and other costs that were charged to expense during the PeriodAsByte.\n    /// </summary>\n    public class RestructuringAndMergernAcquisitionIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_RestructuringAndMergernAcquisition_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RestructuringAndMergernAcquisitionIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RestructuringAndMergernAcquisitionIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RetainedEarningsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cumulative net income of the company from the date of its inception (or reorganization) to the date of the financial statement less the cumulative distributions to shareholders either directly (dividends) or indirectly (treasury stock).\n    /// </summary>\n    public class RetainedEarningsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_RetainedEarnings_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_RetainedEarnings_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RetainedEarningsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RetainedEarningsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/RevenueGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's revenue on a percentage basis. Morningstar calculates the growth percentage based on the underlying revenue data reported in the Income Statement within the company filings or reports.\n    /// </summary>\n    public class RevenueGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_RevenueGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_RevenueGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public RevenueGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public RevenueGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SalariesAndWagesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All salary, wages, compensation, management fees, and employee benefit expenses.\n    /// </summary>\n    public class SalariesAndWagesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SalariesAndWages_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SalariesAndWages_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SalariesAndWagesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SalariesAndWagesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfBusinessCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Proceeds received from selling a business including proceeds from a subsidiary, and proceeds from an affiliated company.\n    /// </summary>\n    public class SaleOfBusinessCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfBusiness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfBusiness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfBusinessCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfBusinessCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfIntangiblesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of capital inflow from the sale of all kinds of intangible assets.\n    /// </summary>\n    public class SaleOfIntangiblesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfIntangibles_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfIntangibles_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfIntangiblesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfIntangiblesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfInvestmentCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Proceeds received from selling all kind of investments, including both long term and short term.\n    /// </summary>\n    public class SaleOfInvestmentCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestment_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfInvestment_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfInvestmentCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfInvestmentCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfInvestmentPropertiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash inflow from sale of investment properties during the accounting PeriodAsByte.\n    /// </summary>\n    public class SaleOfInvestmentPropertiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfInvestmentProperties_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfInvestmentPropertiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfInvestmentPropertiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfJointVentureAssociateCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash inflow from the disposal of joint venture/associates (investment below 50%).\n    /// </summary>\n    public class SaleOfJointVentureAssociateCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfJointVentureAssociate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfJointVentureAssociateCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfJointVentureAssociateCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfPPECashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Proceeds from selling any fixed assets such as property, plant and equipment, which also includes retirement of equipment.\n    /// </summary>\n    public class SaleOfPPECashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfPPE_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfPPE_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfPPECashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfPPECashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SaleOfSubsidiariesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Cash inflow from the disposal of any subsidiaries.\n    /// </summary>\n    public class SaleOfSubsidiariesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_SaleOfSubsidiaries_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SaleOfSubsidiariesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SaleOfSubsidiariesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SalesPerEmployee.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Revenue to Employees. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Revenue / Employee Number.\n    /// </summary>\n    public class SalesPerEmployee : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SalesPerEmployee_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_SalesPerEmployee_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SalesPerEmployee()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SalesPerEmployee(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritiesActivitiesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income/Loss from Securities and Activities\n    /// </summary>\n    public class SecuritiesActivitiesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesActivities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SecuritiesActivities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritiesActivitiesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritiesActivitiesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritiesAmortizationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The gradual elimination of a liability, such as a mortgage, in regular payments over a specified period of time. Such payments must be sufficient to cover both principal and interest.\n    /// </summary>\n    public class SecuritiesAmortizationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SecuritiesAmortization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SecuritiesAmortization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritiesAmortizationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritiesAmortizationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritiesAndInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Asset, often applicable to Banks, which refers to the aggregate amount of all securities and investments.\n    /// </summary>\n    public class SecuritiesAndInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesAndInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecuritiesAndInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritiesAndInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritiesAndInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritiesLendingCollateralBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value as of the balance sheet date of the liabilities collateral securities loaned to other broker-dealers. Borrowers of securities generally are required to provide collateral to the lenders of securities, commonly cash but sometimes other securities or standby letters of credit, with a value slightly higher than that of the securities borrowed.\n    /// </summary>\n    public class SecuritiesLendingCollateralBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecuritiesLendingCollateral_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritiesLendingCollateralBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritiesLendingCollateralBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritiesLoanedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value as of the balance sheet date of securities loaned to other broker dealers, typically used by such parties to cover short sales, secured by cash or other securities furnished by such parties until the borrowing is closed.\n    /// </summary>\n    public class SecuritiesLoanedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLoaned_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLoaned_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLoaned_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritiesLoaned_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecuritiesLoaned_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritiesLoanedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritiesLoanedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecurityAgreeToBeResellBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying value of funds outstanding loaned in the form of security resale agreements if the agreement requires the purchaser to resell the identical security purchased or a security that meets the definition of \"substantially the same\" in the case of a dollar roll. Also includes purchases of participations in pools of securities that are subject to a resale agreement.\n    /// </summary>\n    public class SecurityAgreeToBeResellBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecurityAgreeToBeResell_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecurityAgreeToBeResellBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecurityAgreeToBeResellBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecurityBorrowedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The securities borrowed or on loan, which is the temporary loan of securities by a lender to a borrower in exchange for cash. This item is usually only available for bank industry.\n    /// </summary>\n    public class SecurityBorrowedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityBorrowed_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityBorrowed_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityBorrowed_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecurityBorrowed_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecurityBorrowed_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecurityBorrowedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecurityBorrowedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecurityReference.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the SecurityReference class\n    /// </summary>\n    public class SecurityReference : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// An arrangement of characters (often letters) representing a particular security listed on an exchange or otherwise traded publicly. Note: Morningstar's multi-share class symbols will often contain a \"period\" within the symbol; e.g. BRK.B for Berkshire Hathaway Class B.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1001\n        /// </remarks>\n        [JsonProperty(\"1001\")]\n        public string SecuritySymbol => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_SecuritySymbol);\n\n        /// <summary>\n        /// The Id representing the stock exchange that the particular share class is trading. See separate reference document for Exchange Mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1002\n        /// </remarks>\n        [JsonProperty(\"1002\")]\n        public string ExchangeId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ExchangeId);\n\n        /// <summary>\n        /// 3 Character ISO code of the currency that the exchange price is denominated in; i.e. the trading currency of the security. See separate reference document for Currency Mappings.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1004\n        /// </remarks>\n        [JsonProperty(\"1004\")]\n        public string CurrencyId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_CurrencyId);\n\n        /// <summary>\n        /// The initial day that the share begins trading on a public exchange.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1009\n        /// </remarks>\n        [JsonProperty(\"1009\")]\n        public DateTime IPODate => FundamentalService.Get<DateTime>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPODate);\n\n        /// <summary>\n        /// Indicator to denote if the share class is a depository receipt. 1 denotes it is an ADR or GDR; otherwise 0.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1010\n        /// </remarks>\n        [JsonProperty(\"1010\")]\n        public bool IsDepositaryReceipt => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDepositaryReceipt);\n\n        /// <summary>\n        /// The number of underlying common shares backing each American Depository Receipt traded.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1011\n        /// </remarks>\n        [JsonProperty(\"1011\")]\n        public double DepositaryReceiptRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DepositaryReceiptRatio);\n\n        /// <summary>\n        /// Each security will be assigned to one of the below security type classifications; - Common Stock (ST00000001) - Preferred Stock (ST00000002) - Units (ST000000A1)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1012\n        /// </remarks>\n        [JsonProperty(\"1012\")]\n        public string SecurityType => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_SecurityType);\n\n        /// <summary>\n        /// Provides information when applicable such as whether the share class is Class A or Class B, an ADR, GDR, or a business development company (BDC). For preferred stocks, this field provides more detail about the preferred share class.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1013\n        /// </remarks>\n        [JsonProperty(\"1013\")]\n        public string ShareClassDescription => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ShareClassDescription);\n\n        /// <summary>\n        /// At the ShareClass level; each share is assigned to 1 of 4 possible status classifications; (A) Active, (D) Deactive, (I) Inactive, or (O) Obsolete: - Active-Share class is currently trading in a public market, and we have fundamental data available. - Deactive-Share class was once Active, but is no longer trading due to share being delisted from the exchange. - Inactive-Share class is currently trading in a public market, but no fundamental data is available. - Obsolete-Share class was once Inactive, but is no longer trading due to share being delisted from the exchange.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1014\n        /// </remarks>\n        [JsonProperty(\"1014\")]\n        public string ShareClassStatus => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ShareClassStatus);\n\n        /// <summary>\n        /// This indicator will denote if the indicated share is the primary share for the company. A \"1\" denotes the primary share, a \"0\" denotes a share that is not the primary share. The primary share is defined as the first share that a company IPO'd with and is still actively trading. If this share is no longer trading, we will denote the primary share as the share with the highest volume.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1015\n        /// </remarks>\n        [JsonProperty(\"1015\")]\n        public bool IsPrimaryShare => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsPrimaryShare);\n\n        /// <summary>\n        /// Shareholder election plan to re-invest cash dividend into additional shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1016\n        /// </remarks>\n        [JsonProperty(\"1016\")]\n        public bool IsDividendReinvest => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDividendReinvest);\n\n        /// <summary>\n        /// A plan to make it possible for individual investors to invest in public companies without going through a stock broker.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1017\n        /// </remarks>\n        [JsonProperty(\"1017\")]\n        public bool IsDirectInvest => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IsDirectInvest);\n\n        /// <summary>\n        /// Identifier assigned to each security Morningstar covers.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1018\n        /// </remarks>\n        [JsonProperty(\"1018\")]\n        public string InvestmentId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_InvestmentId);\n\n        /// <summary>\n        /// IPO offer price indicates the price at which an issuer sells its shares under an initial public offering (IPO). The offer price is set by issuer and its underwriters.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1019\n        /// </remarks>\n        [JsonProperty(\"1019\")]\n        public double IPOOfferPrice => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPOOfferPrice);\n\n        /// <summary>\n        /// The date on which an inactive security was delisted from an exchange.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1020\n        /// </remarks>\n        [JsonProperty(\"1020\")]\n        public DateTime DelistingDate => FundamentalService.Get<DateTime>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DelistingDate);\n\n        /// <summary>\n        /// The reason for an inactive security's delisting from an exchange. The full list of Delisting Reason codes can be found within the Data Definitions- Appendix A DelistingReason Codes tab.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1021\n        /// </remarks>\n        [JsonProperty(\"1021\")]\n        public string DelistingReason => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_DelistingReason);\n\n        /// <summary>\n        /// The MIC (market identifier code) of the related shareclass of the company. See Data Appendix A for the relevant MIC to exchange name mapping.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1022\n        /// </remarks>\n        [JsonProperty(\"1022\")]\n        public string MIC => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_MIC);\n\n        /// <summary>\n        /// Refers to the type of securities that can be found within the equity database. For the vast majority, this value will populate as null for regular common shares. For a minority of shareclasses, this will populate as either \"Participating Preferred\", \"Closed-End Fund\", \"Foreign Share\", or \"Foreign Participated Preferred\" which reflects our limited coverage of these types of securities within our equity database.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1023\n        /// </remarks>\n        [JsonProperty(\"1023\")]\n        public string CommonShareSubType => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_CommonShareSubType);\n\n        /// <summary>\n        /// The estimated offer price range (low-high) for a new IPO. The field should be used until the final IPO price becomes available, as populated in the data field \"IPOPrice\".\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1024\n        /// </remarks>\n        [JsonProperty(\"1024\")]\n        public string IPOOfferPriceRange => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_IPOOfferPriceRange);\n\n        /// <summary>\n        /// Classification to denote different Marketplace or Market tiers within a stock exchange.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1025\n        /// </remarks>\n        [JsonProperty(\"1025\")]\n        public string ExchangeSubMarketGlobalId => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ExchangeSubMarketGlobalId);\n\n        /// <summary>\n        /// The relationship between the chosen share class and the primary share class.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1026\n        /// </remarks>\n        [JsonProperty(\"1026\")]\n        public double ConversionRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ConversionRatio);\n\n        /// <summary>\n        /// Nominal value of a security determined by the issuing company.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1027\n        /// </remarks>\n        [JsonProperty(\"1027\")]\n        public double ParValue => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_ParValue);\n\n        /// <summary>\n        /// <remarks> Morningstar DataId: 1028 </remarks>\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1028\n        /// </remarks>\n        [JsonProperty(\"1028\")]\n        public bool TradingStatus => FundamentalService.Get<bool>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_TradingStatus);\n\n        /// <summary>\n        /// <remarks> Morningstar DataId: 1029 </remarks>\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 1029\n        /// </remarks>\n        [JsonProperty(\"1029\")]\n        public string MarketDataID => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.SecurityReference_MarketDataID);\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecurityReference(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new SecurityReference(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SecuritySoldNotYetRepurchasedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represent obligations of the company to deliver the specified security at the contracted price and, thereby, create a liability to purchase the security in the market at prevailing prices.\n    /// </summary>\n    public class SecuritySoldNotYetRepurchasedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SecuritySoldNotYetRepurchased_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SecuritySoldNotYetRepurchasedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SecuritySoldNotYetRepurchasedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SellingAndMarketingExpenseIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate total amount of expenses directly related to the marketing or selling of products or services.\n    /// </summary>\n    public class SellingAndMarketingExpenseIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingAndMarketingExpense_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SellingAndMarketingExpense_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SellingAndMarketingExpenseIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SellingAndMarketingExpenseIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SellingGeneralAndAdministrationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate total costs related to selling a firm's product and services, as well as all other general and administrative expenses. Selling expenses are those directly related to the company's efforts to generate sales (e.g., sales salaries, commissions, advertising, delivery expenses). General and administrative expenses are expenses related to general administration of the company's operation (e.g., officers and office salaries, office supplies, telephone, accounting and legal services, and business licenses and fees).\n    /// </summary>\n    public class SellingGeneralAndAdministrationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SellingGeneralAndAdministration_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SellingGeneralAndAdministrationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SellingGeneralAndAdministrationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SeparateAccountAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The fair value of the assets held by the company for the benefit of separate account policyholders.\n    /// </summary>\n    public class SeparateAccountAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SeparateAccountAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SeparateAccountAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SeparateAccountAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SeparateAccountBusinessBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to revenue that is generated that is not part of typical operations.\n    /// </summary>\n    public class SeparateAccountBusinessBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountBusiness_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountBusiness_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountBusiness_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SeparateAccountBusiness_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SeparateAccountBusiness_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SeparateAccountBusinessBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SeparateAccountBusinessBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ServiceChargeOnDepositorAccountsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Includes any service charges on following accounts: Demand Deposit; Checking account; Savings account; Deposit in foreign offices; ESCROW accounts; Money Market Certificates &amp; Deposit accounts, CDs (Negotiable Certificates of Deposits); NOW Accounts (Negotiable Order of Withdrawal); IRAs (Individual Retirement Accounts). This item is usually only available for bank industry.\n    /// </summary>\n    public class ServiceChargeOnDepositorAccountsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_ServiceChargeOnDepositorAccounts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ServiceChargeOnDepositorAccountsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ServiceChargeOnDepositorAccountsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShareIssuedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The number of authorized shares that is sold to and held by the shareholders of a company, regardless of whether they are insiders, institutional investors or the general public. Unlike shares that are held as treasury stock, shares that have been retired are not included in this figure. The amount of issued shares can be all or part of the total amount of authorized shares of a corporation.\n    /// </summary>\n    public class ShareIssuedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShareIssued_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShareIssued_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShareIssued_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShareIssued_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ShareIssued_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShareIssuedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShareIssuedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShareOfAssociatesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A non-cash adjustment for share of associates' income in respect of operating activities.\n    /// </summary>\n    public class ShareOfAssociatesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShareOfAssociates_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ShareOfAssociates_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShareOfAssociatesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShareOfAssociatesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShortTermDebtIssuanceCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash inflow from a debt initially having maturity due within one year or the normal operating cycle, if longer.\n    /// </summary>\n    public class ShortTermDebtIssuanceCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ShortTermDebtIssuance_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShortTermDebtIssuanceCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShortTermDebtIssuanceCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShortTermDebtPaymentsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cash outflow for a borrowing having initial term of repayment within one year or the normal operating cycle, if longer.\n    /// </summary>\n    public class ShortTermDebtPaymentsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_ShortTermDebtPayments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_ShortTermDebtPayments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShortTermDebtPaymentsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShortTermDebtPaymentsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShortTermInvestmentsAvailableForSaleBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current assets section of a company's balance sheet that contains the investments that a company holds with the purpose for trading.\n    /// </summary>\n    public class ShortTermInvestmentsAvailableForSaleBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ShortTermInvestmentsAvailableForSale_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShortTermInvestmentsAvailableForSaleBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShortTermInvestmentsAvailableForSaleBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShortTermInvestmentsHeldToMaturityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current assets section of a company's balance sheet that contains the investments that a company has made that will expire at a fixed date within one year.\n    /// </summary>\n    public class ShortTermInvestmentsHeldToMaturityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ShortTermInvestmentsHeldToMaturity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShortTermInvestmentsHeldToMaturityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShortTermInvestmentsHeldToMaturityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ShortTermInvestmentsTradingBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The current assets section of a company's balance sheet that contains the investments that a company can trade at any moment.\n    /// </summary>\n    public class ShortTermInvestmentsTradingBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_ShortTermInvestmentsTrading_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ShortTermInvestmentsTradingBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ShortTermInvestmentsTradingBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SocialSecurityCostsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Benefits paid to the employees in respect of their work.\n    /// </summary>\n    public class SocialSecurityCostsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SocialSecurityCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SocialSecurityCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SocialSecurityCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SocialSecurityCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SocialSecurityCostsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SocialSecurityCostsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SolvencyRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Measure of whether a company's cash flow is sufficient to meet its short-term and long-term debt requirements. The lower this ratio is, the greater the probability that the company will be in financial distress. Net Income + Depreciation, Depletion and Amortization/ average of annual Total Liabilities over the most recent two periods.\n    /// </summary>\n    public class SolvencyRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SolvencyRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SolvencyRatio_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SolvencyRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_SolvencyRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_SolvencyRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SolvencyRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SolvencyRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SpecialIncomeChargesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Earnings or losses attributable to occurrences or actions by the firm that is either infrequent or unusual.\n    /// </summary>\n    public class SpecialIncomeChargesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_SpecialIncomeCharges_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_SpecialIncomeCharges_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SpecialIncomeChargesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SpecialIncomeChargesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/StaffCostsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total staff cost which is paid to the employees that is not part of Selling, General, and Administration expense.\n    /// </summary>\n    public class StaffCostsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StaffCosts_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_StaffCosts_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public StaffCostsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public StaffCostsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/StockBasedCompensationCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Value of stock issued during the period as a result of any share-based compensation plan other than an employee stock ownership plan (ESOP).\n    /// </summary>\n    public class StockBasedCompensationCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_StockBasedCompensation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_StockBasedCompensation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public StockBasedCompensationCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public StockBasedCompensationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/StockBasedCompensationIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The cost to the company for granting stock options to reward employees.\n    /// </summary>\n    public class StockBasedCompensationIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_StockBasedCompensation_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_StockBasedCompensation_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public StockBasedCompensationIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public StockBasedCompensationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/StockholdersEquityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The residual interest in the assets of the enterprise that remains after deducting its liabilities. Equity is increased by owners' investments and by comprehensive income, and it is reduced by distributions to the owners.\n    /// </summary>\n    public class StockholdersEquityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_StockholdersEquity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_StockholdersEquity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public StockholdersEquityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public StockholdersEquityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/StockholdersEquityGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the stockholder's equity on a percentage basis. Morningstar calculates the growth percentage based on the residual interest in the assets of the enterprise that remains after deducting its liabilities reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class StockholdersEquityGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_StockholdersEquityGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_StockholdersEquityGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_StockholdersEquityGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_StockholdersEquityGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_StockholdersEquityGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_StockholdersEquityGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public StockholdersEquityGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public StockholdersEquityGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/SubordinatedLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total carrying value of securities loaned to other broker dealers, typically used by such parties to cover short sales, secured by cash or other securities furnished by such parties until the borrowing is closed; in a Non-Differentiated Balance Sheet.\n    /// </summary>\n    public class SubordinatedLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SubordinatedLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SubordinatedLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SubordinatedLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_SubordinatedLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_SubordinatedLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public SubordinatedLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public SubordinatedLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TangibleBookValueBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The company's total book value less the value of any intangible assets. Methodology: Common Stock Equity minus Goodwill and Other Intangible Assets\n    /// </summary>\n    public class TangibleBookValueBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TangibleBookValue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TangibleBookValue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TangibleBookValueBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TangibleBookValueBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxAssetsTotalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of total tax assets in a Non-Differentiated Balance Sheet, includes Tax Receivables and Deferred Tax Assets.\n    /// </summary>\n    public class TaxAssetsTotalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxAssetsTotal_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxAssetsTotal_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxAssetsTotal_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxAssetsTotal_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TaxAssetsTotal_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxAssetsTotalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxAssetsTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxEffectOfUnusualItemsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Tax effect of the usual items\n    /// </summary>\n    public class TaxEffectOfUnusualItemsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TaxEffectOfUnusualItems_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxEffectOfUnusualItemsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxEffectOfUnusualItemsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxLossCarryforwardBasicEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The earnings attributable to the tax loss carry forward (during the reporting period).\n    /// </summary>\n    public class TaxLossCarryforwardBasicEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardBasicEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_TaxLossCarryforwardBasicEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxLossCarryforwardBasicEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxLossCarryforwardBasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxLossCarryforwardDilutedEPS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The earnings from any tax loss carry forward (in the reporting period).\n    /// </summary>\n    public class TaxLossCarryforwardDilutedEPS : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TaxLossCarryforwardDilutedEPS_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_TaxLossCarryforwardDilutedEPS_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxLossCarryforwardDilutedEPS()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxLossCarryforwardDilutedEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxProvisionIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Include any taxes on income, net of any investment tax credits for the current accounting PeriodAsByte.\n    /// </summary>\n    public class TaxProvisionIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxProvision_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TaxProvision_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxProvisionIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxProvisionIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxRate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of tax provision to pretax income. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: Tax Provision / Pretax Income. [Note: Valid only when positive pretax income, and positive tax expense (not tax benefit)]\n    /// </summary>\n    public class TaxRate : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TaxRate_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_TaxRate_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxRate()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxRate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxRateForCalcsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Tax rate used for Morningstar calculations.\n    /// </summary>\n    public class TaxRateForCalcsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TaxRateForCalcs_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TaxRateForCalcs_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxRateForCalcsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxRateForCalcsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxesAssetsCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount due within one year of the balance sheet date (or one operating cycle, if longer) from tax authorities as of the balance sheet date representing refunds of overpayments or recoveries based on agreed-upon resolutions of disputes, and current deferred tax assets.\n    /// </summary>\n    public class TaxesAssetsCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesAssetsCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesAssetsCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesAssetsCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesAssetsCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TaxesAssetsCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxesAssetsCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxesAssetsCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxesReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount due within one year of the balance sheet date (or one operating cycle, if longer) from tax authorities as of the balance sheet date representing refunds of overpayments or recoveries based on agreed-upon resolutions of disputes. This item is usually not available for bank industry.\n    /// </summary>\n    public class TaxesReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TaxesReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TaxesReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxesReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxesReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxesRefundPaidCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total tax paid or received on operating activities.\n    /// </summary>\n    public class TaxesRefundPaidCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaid_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_TaxesRefundPaid_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxesRefundPaidCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxesRefundPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TaxesRefundPaidDirectCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Tax paid/refund related to operating activities, for the direct cash flow.\n    /// </summary>\n    public class TaxesRefundPaidDirectCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_TaxesRefundPaidDirect_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TaxesRefundPaidDirectCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TaxesRefundPaidDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalAdjustmentsforNonCashItemsCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of all adjustments back from net income but without real cash outflow or inflow.\n    /// </summary>\n    public class TotalAdjustmentsforNonCashItemsCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_TotalAdjustmentsforNonCashItems_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalAdjustmentsforNonCashItemsCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalAdjustmentsforNonCashItemsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The aggregate amount of probable future economic benefits obtained or controlled by a particular enterprise as a result of past transactions or events.\n    /// </summary>\n    public class TotalAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalAssetsGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the total assets on a percentage basis. Morningstar calculates the growth percentage based on the total assets reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class TotalAssetsGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalAssetsGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalAssetsGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalAssetsGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalAssetsGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalAssetsGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_TotalAssetsGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalAssetsGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalAssetsGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalCapitalizationBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Stockholder's Equity plus Long Term Debt.\n    /// </summary>\n    public class TotalCapitalizationBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalCapitalization_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalCapitalization_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalCapitalizationBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalCapitalizationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDebtBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All borrowings incurred by the company including debt and capital lease obligations.\n    /// </summary>\n    public class TotalDebtBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebt_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalDebt_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDebtBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDebtBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDebtEquityRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Refers to the ratio of Total Debt to Common Equity. Morningstar calculates the ratio by using the underlying data reported in the Balance Sheet within the company filings or reports: (Current Debt And Current Capital Lease Obligation + Long-Term Debt And Long-Term Capital Lease Obligation / Common Equity. [Note: Common Equity = Total Shareholder's Equity - Preferred Stock]\n    /// </summary>\n    public class TotalDebtEquityRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_NineMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_TotalDebtEquityRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDebtEquityRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDebtEquityRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDebtEquityRatioGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the company's total debt to equity ratio on a percentage basis. Morningstar calculates the growth percentage based on the total debt divided by the shareholder's equity reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class TotalDebtEquityRatioGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatioGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatioGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatioGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatioGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalDebtEquityRatioGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_TotalDebtEquityRatioGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDebtEquityRatioGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDebtEquityRatioGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDebtInMaturityScheduleBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total Debt in Maturity Schedule is the sum of Debt details above.\n    /// </summary>\n    public class TotalDebtInMaturityScheduleBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalDebtInMaturitySchedule_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDebtInMaturityScheduleBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDebtInMaturityScheduleBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenue received by a firm but not yet reported as income. This item is usually only available for utility industry.\n    /// </summary>\n    public class TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalDeferredCreditsAndOtherNonCurrentLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDepositsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A liability account which represents the total amount of funds deposited.\n    /// </summary>\n    public class TotalDepositsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalDeposits_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalDeposits_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDepositsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDepositsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDividendPaymentofEquitySharesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total amount paid in dividends to equity securities investors.\n    /// </summary>\n    public class TotalDividendPaymentofEquitySharesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalDividendPaymentofEquityShares_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDividendPaymentofEquitySharesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDividendPaymentofEquitySharesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDividendPaymentofNonEquitySharesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total amount paid in dividends to Non-Equity securities investors.\n    /// </summary>\n    public class TotalDividendPaymentofNonEquitySharesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalDividendPaymentofNonEquityShares_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDividendPaymentofNonEquitySharesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDividendPaymentofNonEquitySharesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalDividendPerShare.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total Dividend Per Share is cash dividends and special cash dividends paid per share over a certain period of time.\n    /// </summary>\n    public class TotalDividendPerShare : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_TotalDividendPerShare_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"EarningReports_TotalDividendPerShare_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalDividendPerShare()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalDividendPerShare(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalEquityAsReportedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total Equity as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class TotalEquityAsReportedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalEquityAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalEquityAsReportedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalEquityAsReportedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalEquityBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total Equity equals Preferred Stock Equity + Common Stock Equity.\n    /// </summary>\n    public class TotalEquityBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquity_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalEquity_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalEquityBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalEquityBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalEquityGrossMinorityInterestBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Residual interest, including minority interest, that remains in the assets of the enterprise after deducting its liabilities. Equity is increased by owners' investments and by comprehensive income, and it is reduced by distributions to the owners.\n    /// </summary>\n    public class TotalEquityGrossMinorityInterestBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalEquityGrossMinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalEquityGrossMinorityInterestBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalEquityGrossMinorityInterestBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of operating expense and cost of revenue. If the company does not give the reported number, it will be calculated by adding operating expense and cost of revenue.\n    /// </summary>\n    public class TotalExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalFinancialLeaseObligationsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Represents the total amount of long-term capital leases that must be paid within the next accounting period for a Non- Differentiated Balance Sheet. Capital lease obligations are contractual obligations that arise from obtaining the use of property or equipment via a capital lease contract.\n    /// </summary>\n    public class TotalFinancialLeaseObligationsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalFinancialLeaseObligations_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalFinancialLeaseObligationsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalFinancialLeaseObligationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalInvestmentsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Asset that refers to the sum of all available for sale securities and other investments often reported on the balance sheet of insurance firms.\n    /// </summary>\n    public class TotalInvestmentsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalInvestmentsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalInvestmentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalLiabilitiesAsReportedBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total liabilities as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class TotalLiabilitiesAsReportedBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalLiabilitiesAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalLiabilitiesAsReportedBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalLiabilitiesAsReportedBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalLiabilitiesGrowth.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The growth in the total liabilities on a percentage basis. Morningstar calculates the growth percentage based on the total liabilities reported in the Balance Sheet within the company filings or reports.\n    /// </summary>\n    public class TotalLiabilitiesGrowth : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalLiabilitiesGrowth_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeYears period value for the field\n        /// </summary>\n        [JsonProperty(\"3Y\")]\n        public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalLiabilitiesGrowth_ThreeYears);\n\n        /// <summary>\n        /// Gets/sets the FiveYears period value for the field\n        /// </summary>\n        [JsonProperty(\"5Y\")]\n        public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalLiabilitiesGrowth_FiveYears);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalLiabilitiesGrowth_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_TotalLiabilitiesGrowth_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3Y\",ThreeYears), new Tuple<string, double>(\"5Y\",FiveYears) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_TotalLiabilitiesGrowth_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalLiabilitiesGrowth()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalLiabilitiesGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalLiabilitiesNetMinorityInterestBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Probable future sacrifices of economic benefits arising from present obligations of an enterprise to transfer assets or provide services to others in the future as a result of past transactions or events, excluding minority interest.\n    /// </summary>\n    public class TotalLiabilitiesNetMinorityInterestBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalLiabilitiesNetMinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalLiabilitiesNetMinorityInterestBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalLiabilitiesNetMinorityInterestBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalMoneyMarketInvestmentsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of the money market investments held by a bank's depositors, which are FDIC insured.\n    /// </summary>\n    public class TotalMoneyMarketInvestmentsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalMoneyMarketInvestments_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalMoneyMarketInvestmentsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalMoneyMarketInvestmentsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalNonCurrentAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of the carrying amounts as of the balance sheet date of all assets that are expected to be realized in cash, sold or consumed after one year or beyond the normal operating cycle, if longer.\n    /// </summary>\n    public class TotalNonCurrentAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalNonCurrentAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalNonCurrentAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalNonCurrentAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total obligations, net minority interest, incurred as part of normal operations that is expected to be repaid beyond the following twelve months or one business cycle; excludes minority interest.\n    /// </summary>\n    public class TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalNonCurrentLiabilitiesNetMinorityInterest_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalOperatingIncomeAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Operating profit/loss as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class TotalOperatingIncomeAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalOperatingIncomeAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalOperatingIncomeAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalOperatingIncomeAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalOtherFinanceCostIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Any other finance cost which is not clearly defined in the Non-Operating section.\n    /// </summary>\n    public class TotalOtherFinanceCostIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalOtherFinanceCost_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalOtherFinanceCost_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalOtherFinanceCostIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalOtherFinanceCostIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalPartnershipCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Ownership interest of different classes of partners in the publicly listed limited partnership or master limited partnership. Partners include general, limited and preferred partners.\n    /// </summary>\n    public class TotalPartnershipCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalPartnershipCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalPartnershipCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalPartnershipCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalPartnershipCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalPartnershipCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalPartnershipCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalPartnershipCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalPartnershipCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalPremiumsEarnedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Premiums earned is the portion of an insurance written premium which is considered \"earned\" by the insurer, based on the part of the policy period that the insurance has been in effect, and during which the insurer has been exposed to loss.\n    /// </summary>\n    public class TotalPremiumsEarnedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalPremiumsEarned_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalPremiumsEarned_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalPremiumsEarnedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalPremiumsEarnedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalRevenueAsReportedIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total revenue as reported by the company, may be the same or not the same as Morningstar's standardized definition.\n    /// </summary>\n    public class TotalRevenueAsReportedIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenueAsReported_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalRevenueAsReported_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalRevenueAsReportedIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalRevenueAsReportedIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalRevenueIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// All sales, business revenues and income that the company makes from its business operations, net of excise taxes. This applies for all companies and can be used as comparison for all industries. For Normal, Mining, Transportation and Utility templates companies, this is the sum of Operating Revenues, Excise Taxes and Fees. For Bank template companies, this is the sum of Net Interest Income and Non-Interest Income. For Insurance template companies, this is the sum of Premiums, Interest Income, Fees, Investment and Other Income.\n    /// </summary>\n    public class TotalRevenueIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalRevenue_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalRevenue_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalRevenueIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalRevenueIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalRiskBasedCapital.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of Tier 1 and Tier 2 Capital. Tier 1 capital consists of common shareholders equity, perpetual preferred shareholders equity with non-cumulative dividends, retained earnings, and minority interests in the equity accounts of consolidated subsidiaries. Tier 2 capital consists of subordinated debt, intermediate-term preferred stock, cumulative and long-term preferred stock, and a portion of a bank's allowance for loan and lease losses.\n    /// </summary>\n    public class TotalRiskBasedCapital : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_TotalRiskBasedCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_TotalRiskBasedCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalRiskBasedCapital()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalRiskBasedCapital(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalTaxPayableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A liability that reflects the taxes owed to federal, state, and local tax authorities. It is the carrying value as of the balance sheet date of obligations incurred and payable for statutory income, sales, use, payroll, excise, real, property and other taxes.\n    /// </summary>\n    public class TotalTaxPayableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TotalTaxPayable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TotalTaxPayable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalTaxPayableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalTaxPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalUnusualItemsExcludingGoodwillIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The sum of all the identifiable operating and non-operating unusual items.\n    /// </summary>\n    public class TotalUnusualItemsExcludingGoodwillIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalUnusualItemsExcludingGoodwill_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalUnusualItemsExcludingGoodwillIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalUnusualItemsExcludingGoodwillIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TotalUnusualItemsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total unusual items including Negative Goodwill.\n    /// </summary>\n    public class TotalUnusualItemsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TotalUnusualItems_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TotalUnusualItems_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TotalUnusualItemsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TotalUnusualItemsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradeAndOtherReceivablesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Amounts due from customers or clients, more than one year from the balance sheet date, for goods or services that have been delivered or sold in the normal course of business, or other receivables.\n    /// </summary>\n    public class TradeAndOtherReceivablesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradeAndOtherReceivablesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradeAndOtherReceivablesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradeAndOtherReceivablesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradeandOtherPayablesNonCurrentBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Sum of all non-current payables and accrued expenses.\n    /// </summary>\n    public class TradeandOtherPayablesNonCurrentBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradeandOtherPayablesNonCurrent_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradeandOtherPayablesNonCurrentBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradeandOtherPayablesNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingAndOtherReceivableBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This will serve as the \"parent\" value to AccountsReceivable (DataId 23001) and OtherReceivables (DataId 23342) for all company financials reported in the IFRS GAAP.\n    /// </summary>\n    public class TradingAndOtherReceivableBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAndOtherReceivable_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAndOtherReceivable_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAndOtherReceivable_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAndOtherReceivable_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradingAndOtherReceivable_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingAndOtherReceivableBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingAndOtherReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingAssetsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Trading account assets are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time). Unrealized holding gains and losses for trading securities are included in earnings.\n    /// </summary>\n    public class TradingAssetsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAssets_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAssets_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAssets_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingAssets_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradingAssets_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingAssetsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingGainLossIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A broker-dealer or other financial entity may buy and sell securities exclusively for its own account, sometimes referred to as proprietary trading. The profit or loss is measured by the difference between the acquisition cost and the selling price or current market or fair value. The net gain or loss, includes both realized and unrealized, from trading cash instruments, equities and derivative contracts (including commodity contracts) that has been recognized during the accounting period for the broker dealer or other financial entity's own account. This item is typically available for bank industry.\n    /// </summary>\n    public class TradingGainLossIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TradingGainLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TradingGainLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingGainLossIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingGainLossIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The carrying amount of liabilities as of the balance sheet date that pertain to principal and customer trading transactions, or which may be incurred with the objective of generating a profit from short-term fluctuations in price as part of an entity's market-making, hedging and proprietary trading. Examples include short positions in securities, derivatives and commodities, obligations under repurchase agreements, and securities borrowed arrangements.\n    /// </summary>\n    public class TradingLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradingLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingSecuritiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The total of financial instruments that are bought and held principally for the purpose of selling them in the near term (thus held for only a short period of time) or for debt and equity securities formerly categorized as available-for-sale or held-to-maturity which the company held as of the date it opted to account for such securities at fair value.\n    /// </summary>\n    public class TradingSecuritiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradingSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingSecuritiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TradingandFinancialLiabilitiesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total carrying amount of total trading, financial liabilities and debt in a non-differentiated balance sheet.\n    /// </summary>\n    public class TradingandFinancialLiabilitiesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TradingandFinancialLiabilities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TradingandFinancialLiabilitiesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TradingandFinancialLiabilitiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TreasuryBillsandOtherEligibleBillsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Investments backed by the central government, it usually carries less risk than other investments.\n    /// </summary>\n    public class TreasuryBillsandOtherEligibleBillsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TreasuryBillsandOtherEligibleBills_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TreasuryBillsandOtherEligibleBillsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TreasuryBillsandOtherEligibleBillsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TreasurySharesNumberBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Number of Treasury Shares.\n    /// </summary>\n    public class TreasurySharesNumberBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasurySharesNumber_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasurySharesNumber_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasurySharesNumber_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasurySharesNumber_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TreasurySharesNumber_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TreasurySharesNumberBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TreasurySharesNumberBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TreasuryStockBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The portion of shares that a company keeps in their own treasury. Treasury stock may have come from a repurchase or buyback from shareholders; or it may have never been issued to the public in the first place. These shares don't pay dividends, have no voting rights, and are not included in shares outstanding calculations.\n    /// </summary>\n    public class TreasuryStockBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_TreasuryStock_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_TreasuryStock_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TreasuryStockBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TreasuryStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/TrustFeesbyCommissionsIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Bank manages funds on behalf of its customers through the operation of various trust accounts. Any fees earned through managing those funds are called trust fees, which are recognized when earned. This item is typically available for bank industry.\n    /// </summary>\n    public class TrustFeesbyCommissionsIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_TrustFeesbyCommissions_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_TrustFeesbyCommissions_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public TrustFeesbyCommissionsIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public TrustFeesbyCommissionsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnallocatedSurplusBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount of surplus from insurance contracts which has not been allocated at the balance sheet date. This is represented as a liability to policyholders, as it pertains to cumulative income arising from the with-profits business.\n    /// </summary>\n    public class UnallocatedSurplusBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnallocatedSurplus_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnallocatedSurplus_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnallocatedSurplus_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnallocatedSurplus_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnallocatedSurplus_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnallocatedSurplusBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnallocatedSurplusBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnbilledReceivablesBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Revenues that are not currently billed from the customer under the terms of the contract. This item is usually only available for utility industry.\n    /// </summary>\n    public class UnbilledReceivablesBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnbilledReceivables_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnbilledReceivables_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnbilledReceivables_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnbilledReceivables_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnbilledReceivables_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnbilledReceivablesBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnbilledReceivablesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnderwritingExpensesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Also known as Policy Acquisition Costs; and reported by insurance companies. The cost incurred by an insurer when deciding whether to accept or decline a risk; may include meetings with the insureds or brokers, actuarial review of loss history, or physical inspections of exposures. Also, expenses deducted from insurance company revenues (including incurred losses and acquisition costs) to determine underwriting profit.\n    /// </summary>\n    public class UnderwritingExpensesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_UnderwritingExpenses_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_UnderwritingExpenses_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnderwritingExpensesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnderwritingExpensesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnearnedIncomeBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Income received but not yet earned, it represents the unearned amount that is netted against the total loan.\n    /// </summary>\n    public class UnearnedIncomeBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedIncome_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnearnedIncome_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnearnedIncomeBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnearnedIncomeBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnearnedPremiumsBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Carrying amount of premiums written on insurance contracts that have not been earned as of the balance sheet date.\n    /// </summary>\n    public class UnearnedPremiumsBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnearnedPremiums_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnearnedPremiums_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnearnedPremiumsBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnearnedPremiumsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnpaidLossAndLossReserveBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Liability amount that reflects claims that are expected based upon statistical projections, but which have not been reported to the insurer.\n    /// </summary>\n    public class UnpaidLossAndLossReserveBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnpaidLossAndLossReserve_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnpaidLossAndLossReserveBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnpaidLossAndLossReserveBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnrealizedGainLossBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A profit or loss that results from holding onto an asset rather than cashing it in and officially taking the profit or loss.\n    /// </summary>\n    public class UnrealizedGainLossBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnrealizedGainLoss_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnrealizedGainLoss_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnrealizedGainLoss_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnrealizedGainLoss_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_UnrealizedGainLoss_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_UnrealizedGainLoss_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnrealizedGainLossBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnrealizedGainLossBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The increases (decreases) in the market value of unsold securities whose gains (losses) were included in earnings.\n    /// </summary>\n    public class UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_UnrealizedGainLossOnInvestmentSecurities_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/UnrealizedGainsLossesOnDerivativesCashFlowStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The gross gains and losses on derivatives. This item is usually only available for insurance industry.\n    /// </summary>\n    public class UnrealizedGainsLossesOnDerivativesCashFlowStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_CashFlowStatement_UnrealizedGainsLossesOnDerivatives_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public UnrealizedGainsLossesOnDerivativesCashFlowStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public UnrealizedGainsLossesOnDerivativesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/ValuationRatios.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Definition of the ValuationRatios class\n    /// </summary>\n    public class ValuationRatios : FundamentalTimeDependentProperty\n    {\n        /// <summary>\n        /// Dividend per share / Diluted earnings per share\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14000\n        /// </remarks>\n        [JsonProperty(\"14000\")]\n        public double PayoutRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PayoutRatio);\n\n        /// <summary>\n        /// ROE * (1 - Payout Ratio)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14001\n        /// </remarks>\n        [JsonProperty(\"14001\")]\n        public double SustainableGrowthRate => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_SustainableGrowthRate);\n\n        /// <summary>\n        /// Refers to the ratio of free cash flow to enterprise value. Morningstar calculates the ratio by using the underlying data reported in the company filings or reports: FCF /Enterprise Value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14002\n        /// </remarks>\n        [JsonProperty(\"14002\")]\n        public double CashReturn => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_CashReturn);\n\n        /// <summary>\n        /// Sales / Average Diluted Shares Outstanding\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14003\n        /// </remarks>\n        [JsonProperty(\"14003\")]\n        public double SalesPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_SalesPerShare);\n\n        /// <summary>\n        /// Common Shareholder's Equity / Diluted Shares Outstanding\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14004\n        /// </remarks>\n        [JsonProperty(\"14004\")]\n        public double BookValuePerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_BookValuePerShare);\n\n        /// <summary>\n        /// Cash Flow from Operations / Average Diluted Shares Outstanding\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14005\n        /// </remarks>\n        [JsonProperty(\"14005\")]\n        public double CFOPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_CFOPerShare);\n\n        /// <summary>\n        /// Free Cash Flow / Average Diluted Shares Outstanding\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14006\n        /// </remarks>\n        [JsonProperty(\"14006\")]\n        public double FCFPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_FCFPerShare);\n\n        /// <summary>\n        /// Diluted EPS / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14007\n        /// </remarks>\n        [JsonProperty(\"14007\")]\n        public double EarningYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EarningYield);\n\n        /// <summary>\n        /// Adjusted Close Price/ EPS. If the result is negative, zero, &gt;10,000 or &lt;0.001, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14008\n        /// </remarks>\n        [JsonProperty(\"14008\")]\n        public double PERatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio);\n\n        /// <summary>\n        /// SalesPerShare / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14009\n        /// </remarks>\n        [JsonProperty(\"14009\")]\n        public double SalesYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_SalesYield);\n\n        /// <summary>\n        /// Adjusted close price / Sales Per Share. If the result is negative or zero, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14010\n        /// </remarks>\n        [JsonProperty(\"14010\")]\n        public double PSRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio);\n\n        /// <summary>\n        /// BookValuePerShare / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14011\n        /// </remarks>\n        [JsonProperty(\"14011\")]\n        public double BookValueYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_BookValueYield);\n\n        /// <summary>\n        /// Adjusted close price / Book Value Per Share. If the result is negative or zero, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14012\n        /// </remarks>\n        [JsonProperty(\"14012\")]\n        public double PBRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio);\n\n        /// <summary>\n        /// CFOPerShare / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14013\n        /// </remarks>\n        [JsonProperty(\"14013\")]\n        public double CFYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_CFYield);\n\n        /// <summary>\n        /// Adjusted close price /Cash Flow Per Share. If the result is negative or zero, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14014\n        /// </remarks>\n        [JsonProperty(\"14014\")]\n        public double PCFRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PCFRatio);\n\n        /// <summary>\n        /// FCFPerShare / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14015\n        /// </remarks>\n        [JsonProperty(\"14015\")]\n        public double FCFYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_FCFYield);\n\n        /// <summary>\n        /// Adjusted close price/ Free Cash Flow Per Share. If the result is negative or zero, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14016\n        /// </remarks>\n        [JsonProperty(\"14016\")]\n        public double FCFRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_FCFRatio);\n\n        /// <summary>\n        /// Dividends Per Share over the trailing 12 months / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14017\n        /// </remarks>\n        [JsonProperty(\"14017\")]\n        public double TrailingDividendYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TrailingDividendYield);\n\n        /// <summary>\n        /// (Current Dividend Per Share * Payout Frequency) / Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14018\n        /// </remarks>\n        [JsonProperty(\"14018\")]\n        public double ForwardDividendYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardDividendYield);\n\n        /// <summary>\n        /// Estimated Earnings Per Share / Price Note: a) The \"Next\" Year's EPS Estimate is used; For instance, if today's actual date is March 1, 2009, the \"Current\" EPS Estimate for MSFT is June 2009, and the \"Next\" EPS Estimate for MSFT is June 2010; the latter is used. b) The eps estimated data is sourced from a third party.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14019\n        /// </remarks>\n        [JsonProperty(\"14019\")]\n        public double ForwardEarningYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardEarningYield);\n\n        /// <summary>\n        /// 1 / ForwardEarningYield If result is negative, then null\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14020\n        /// </remarks>\n        [JsonProperty(\"14020\")]\n        public double ForwardPERatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardPERatio);\n\n        /// <summary>\n        /// ForwardPERatio / Long-term Average Earning Growth Rate\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14021\n        /// </remarks>\n        [JsonProperty(\"14021\")]\n        public double PEGRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PEGRatio);\n\n        /// <summary>\n        /// The number of years it would take for a company's cumulative earnings to equal the stock's current trading price, assuming that the company continues to increase its annual earnings at the growth rate used to calculate the PEG ratio. [ Log (PG/E + 1) / Log (1 + G) ] - 1 Where P=Price E=Next Fiscal Year's Estimated EPS G=Long-term Average Earning Growth\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14022\n        /// </remarks>\n        [JsonProperty(\"14022\")]\n        public double PEGPayback => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PEGPayback);\n\n        /// <summary>\n        /// The company's total book value less the value of any intangible assets dividend by number of shares.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14023\n        /// </remarks>\n        [JsonProperty(\"14023\")]\n        public double TangibleBookValuePerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TangibleBookValuePerShare);\n\n        /// <summary>\n        /// The three year average for tangible book value per share.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14024\n        /// </remarks>\n        [JsonProperty(\"14024\")]\n        public double TangibleBVPerShare3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TangibleBVPerShare3YrAvg);\n\n        /// <summary>\n        /// The five year average for tangible book value per share.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14025\n        /// </remarks>\n        [JsonProperty(\"14025\")]\n        public double TangibleBVPerShare5YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TangibleBVPerShare5YrAvg);\n\n        /// <summary>\n        /// Latest Dividend * Frequency\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14026\n        /// </remarks>\n        [JsonProperty(\"14026\")]\n        public double ForwardDividend => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardDividend);\n\n        /// <summary>\n        /// (Current Assets - Current Liabilities)/number of shares\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14027\n        /// </remarks>\n        [JsonProperty(\"14027\")]\n        public double WorkingCapitalPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_WorkingCapitalPerShare);\n\n        /// <summary>\n        /// The three year average for working capital per share.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14028\n        /// </remarks>\n        [JsonProperty(\"14028\")]\n        public double WorkingCapitalPerShare3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_WorkingCapitalPerShare3YrAvg);\n\n        /// <summary>\n        /// The five year average for working capital per share.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14029\n        /// </remarks>\n        [JsonProperty(\"14029\")]\n        public double WorkingCapitalPerShare5YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_WorkingCapitalPerShare5YrAvg);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of EBITDA generated.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14030\n        /// </remarks>\n        [JsonProperty(\"14030\")]\n        public double EVToEBITDA => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA);\n\n        /// <summary>\n        /// The net repurchase of shares outstanding over the market capital of the company. It is a measure of shareholder return.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14031\n        /// </remarks>\n        [JsonProperty(\"14031\")]\n        public double BuyBackYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_BuyBackYield);\n\n        /// <summary>\n        /// The total yield that shareholders can expect, by summing Dividend Yield and Buyback Yield.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14032\n        /// </remarks>\n        [JsonProperty(\"14032\")]\n        public double TotalYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TotalYield);\n\n        /// <summary>\n        /// The five-year average of the company's price-to-earnings ratio.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14033\n        /// </remarks>\n        [JsonProperty(\"14033\")]\n        public double RatioPE5YearAverage => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_RatioPE5YearAverage);\n\n        /// <summary>\n        /// Price change this month, expressed as latest price/last month end price.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14034\n        /// </remarks>\n        [JsonProperty(\"14034\")]\n        public double PriceChange1M => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PriceChange1M);\n\n        /// <summary>\n        /// Adjusted Close Price/ Normalized EPS. Normalized EPS removes onetime and unusual items from net EPS, to provide investors with a more accurate measure of the company's true earnings. If the result is negative, zero, &gt;10,000 or &lt;0.001, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14035\n        /// </remarks>\n        [JsonProperty(\"14035\")]\n        public double NormalizedPERatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_NormalizedPERatio);\n\n        /// <summary>\n        /// Adjusted close price/EBITDA Per Share. If the result is negative or zero, then null.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14036\n        /// </remarks>\n        [JsonProperty(\"14036\")]\n        public double PriceToEBITDA => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PriceToEBITDA);\n\n        /// <summary>\n        /// Average of the last 60 monthly observations of trailing dividend yield in the last 5 years.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14037\n        /// </remarks>\n        [JsonProperty(\"14037\")]\n        public double DivYield5Year => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_DivYield5Year);\n\n        /// <summary>\n        /// Estimated EPS/Book Value Per Share\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14038\n        /// </remarks>\n        [JsonProperty(\"14038\")]\n        public double ForwardROE => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardROE);\n\n        /// <summary>\n        /// Estimated EPS/Total Assets Per Share\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14039\n        /// </remarks>\n        [JsonProperty(\"14039\")]\n        public double ForwardROA => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardROA);\n\n        /// <summary>\n        /// 2 Years Forward Estimated EPS / Adjusted Close Price\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14040\n        /// </remarks>\n        [JsonProperty(\"14040\")]\n        public double TwoYearsForwardEarningYield => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TwoYearsForwardEarningYield);\n\n        /// <summary>\n        /// Adjusted Close Price/2 Years Forward Estimated EPS\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14041\n        /// </remarks>\n        [JsonProperty(\"14041\")]\n        public double TwoYearsForwardPERatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TwoYearsForwardPERatio);\n\n        /// <summary>\n        /// Indicates the method used to calculate Forward Dividend. There are three options: Annual, Look-back and Manual.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14042\n        /// </remarks>\n        [JsonProperty(\"14042\")]\n        public string ForwardCalculationStyle => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ForwardCalculationStyle);\n\n        /// <summary>\n        /// Used to collect the forward dividend for companies where our formula will not produce the correct value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14043\n        /// </remarks>\n        [JsonProperty(\"14043\")]\n        public double ActualForwardDividend => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ActualForwardDividend);\n\n        /// <summary>\n        /// Indicates the method used to calculate Trailing Dividend. There are two options: Look-back and Manual.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14044\n        /// </remarks>\n        [JsonProperty(\"14044\")]\n        public string TrailingCalculationStyle => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TrailingCalculationStyle);\n\n        /// <summary>\n        /// Used to collect the trailing dividend for companies where our formula will not produce the correct value.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14045\n        /// </remarks>\n        [JsonProperty(\"14045\")]\n        public double ActualTrailingDividend => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ActualTrailingDividend);\n\n        /// <summary>\n        /// Total Assets / Diluted Shares Outstanding\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14046\n        /// </remarks>\n        [JsonProperty(\"14046\")]\n        public double TotalAssetPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TotalAssetPerShare);\n\n        /// <summary>\n        /// The growth rate from the TrailingDividend to the Forward Dividend: {(Forward Dividend/Trailing Dividend) - 1}*100.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14047\n        /// </remarks>\n        [JsonProperty(\"14047\")]\n        public double ExpectedDividendGrowthRate => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_ExpectedDividendGrowthRate);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of revenue generated.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14048\n        /// </remarks>\n        [JsonProperty(\"14048\")]\n        public double EVToRevenue => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of Pretax Income generated.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14049\n        /// </remarks>\n        [JsonProperty(\"14049\")]\n        public double EVToPreTaxIncome => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToPreTaxIncome);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of asset value; should be the default EV multiple used in an asset driven business.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14050\n        /// </remarks>\n        [JsonProperty(\"14050\")]\n        public double EVToTotalAssets => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of free cash flow generated.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14051\n        /// </remarks>\n        [JsonProperty(\"14051\")]\n        public double EVToFCF => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of EBIT generated.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14052\n        /// </remarks>\n        [JsonProperty(\"14052\")]\n        public double EVToEBIT => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBIT);\n\n        /// <summary>\n        /// Funds from operations per share; populated only for real estate investment trusts (REITs), defined as the sum of net income, gain/loss (realized and unrealized) on investment securities, asset impairment charge, depreciation and amortization and gain/ loss on the sale of business and property plant and equipment, divided by shares outstanding.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14053\n        /// </remarks>\n        [JsonProperty(\"14053\")]\n        public double FFOPerShare => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_FFOPerShare);\n\n        /// <summary>\n        /// The ratio of a stock's price to its cash flow per share.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14054\n        /// </remarks>\n        [JsonProperty(\"14054\")]\n        public double PriceToCashRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PriceToCashRatio);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of estimated EBITDA.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14055\n        /// </remarks>\n        [JsonProperty(\"14055\")]\n        public double EVToForwardEBITDA => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToForwardEBITDA);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of estimated revenue.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14056\n        /// </remarks>\n        [JsonProperty(\"14056\")]\n        public double EVToForwardRevenue => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToForwardRevenue);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of estimated EBIT.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14057\n        /// </remarks>\n        [JsonProperty(\"14057\")]\n        public double EVToForwardEBIT => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToForwardEBIT);\n\n        /// <summary>\n        /// The one-year growth in the company's EV to EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14058\n        /// </remarks>\n        [JsonProperty(\"14058\")]\n        public double EVToEBITDA1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's EV to free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash flow from operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14059\n        /// </remarks>\n        [JsonProperty(\"14059\")]\n        public double EVToFCF1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's EV to revenue on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14060\n        /// </remarks>\n        [JsonProperty(\"14060\")]\n        public double EVToRevenue1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's EV to total assets on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by total assets reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14061\n        /// </remarks>\n        [JsonProperty(\"14061\")]\n        public double EVToTotalAssets1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's price to free cash flow ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the free cash flow reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14062\n        /// </remarks>\n        [JsonProperty(\"14062\")]\n        public double PFCFRatio1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's price to book ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14063\n        /// </remarks>\n        [JsonProperty(\"14063\")]\n        public double PBRatio1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's PE ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14064\n        /// </remarks>\n        [JsonProperty(\"14064\")]\n        public double PERatio1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio1YearGrowth);\n\n        /// <summary>\n        /// The one-year growth in the company's price to sales ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the sales per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14065\n        /// </remarks>\n        [JsonProperty(\"14065\")]\n        public double PSRatio1YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio1YearGrowth);\n\n        /// <summary>\n        /// The three-year average for a company's EV to EBIT ratio: EV (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBIT (earnings minus expenses excluding interest and tax expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14066\n        /// </remarks>\n        [JsonProperty(\"14066\")]\n        public double EVToEBIT3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBIT3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's EV to EBITDA ratio: EV (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14067\n        /// </remarks>\n        [JsonProperty(\"14067\")]\n        public double EVToEBITDA3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's EV to free cash flow ratio: EV (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash Flow from Operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14068\n        /// </remarks>\n        [JsonProperty(\"14068\")]\n        public double EVToFCF3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's EV to revenue ratio: EV (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14069\n        /// </remarks>\n        [JsonProperty(\"14069\")]\n        public double EVToRevenue3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's EV to total assets ratio: EV (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Assets reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14070\n        /// </remarks>\n        [JsonProperty(\"14070\")]\n        public double EVToTotalAssets3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets3YrAvg);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's EV to EBIT ratio. Morningstar calculates the growth percentage based on the EV to EBIT ratio ((Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBIT (earnings minus expenses excluding interest and tax expenses) reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14071\n        /// </remarks>\n        [JsonProperty(\"14071\")]\n        public double EVToEBIT3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBIT3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's EV to EBITDA ratio. Morningstar calculates the growth percentage based on the EV to EBITDA ratio ((Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax depreciation and amortization expenses) reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14072\n        /// </remarks>\n        [JsonProperty(\"14072\")]\n        public double EVToEBITDA3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's EV to free cash flow ratio. Morningstar calculates the growth percentage based on the EV to free cash flow ratio ((Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash Flow from Operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14073\n        /// </remarks>\n        [JsonProperty(\"14073\")]\n        public double EVToFCF3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's EV to revenue ratio. Morningstar calculates the growth percentage based on the EV to revenue ratio ((Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14074\n        /// </remarks>\n        [JsonProperty(\"14074\")]\n        public double EVToRevenue3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's EV to total assets ratio. Morningstar calculates the growth percentage based on the EV to total assets ratio ((Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by total assets reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14075\n        /// </remarks>\n        [JsonProperty(\"14075\")]\n        public double EVToTotalAssets3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets3YrAvgChange);\n\n        /// <summary>\n        /// The three-year average for a company's price to free cash flow ratio (the adjusted close price divided by the free cash flow per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14076\n        /// </remarks>\n        [JsonProperty(\"14076\")]\n        public double PFCFRatio3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's price to book ratio (the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14077\n        /// </remarks>\n        [JsonProperty(\"14077\")]\n        public double PBRatio3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's price to sales ratio (the adjusted close price divided by the total sales per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14078\n        /// </remarks>\n        [JsonProperty(\"14078\")]\n        public double PSRatio3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's price to cash ratio (the adjusted close price divided by the cash flow per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14079\n        /// </remarks>\n        [JsonProperty(\"14079\")]\n        public double PCashRatio3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PCashRatio3YrAvg);\n\n        /// <summary>\n        /// The three-year average for a company's PE ratio (the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14080\n        /// </remarks>\n        [JsonProperty(\"14080\")]\n        public double PERatio3YrAvg => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio3YrAvg);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's price to free cash flow ratio. Morningstar calculates the growth percentage based on the adjusted close price divided by the free cash flow per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14081\n        /// </remarks>\n        [JsonProperty(\"14081\")]\n        public double PFCFRatio3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's price to book ratio. Morningstar calculates the growth percentage based on the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14082\n        /// </remarks>\n        [JsonProperty(\"14082\")]\n        public double PBRatio3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's price to sales ratio. Morningstar calculates the growth percentage based on the adjusted close price divided by the total sales per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14083\n        /// </remarks>\n        [JsonProperty(\"14083\")]\n        public double PSRatio3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio3YrAvgChange);\n\n        /// <summary>\n        /// The growth in the three-year average for a company's PE ratio. Morningstar calculates the growth percentage based on the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14084\n        /// </remarks>\n        [JsonProperty(\"14084\")]\n        public double PERatio3YrAvgChange => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio3YrAvgChange);\n\n        /// <summary>\n        /// The one-year high for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14085\n        /// </remarks>\n        [JsonProperty(\"14085\")]\n        public double PERatio1YearHigh => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio1YearHigh);\n\n        /// <summary>\n        /// The one-year low for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14086\n        /// </remarks>\n        [JsonProperty(\"14086\")]\n        public double PERatio1YearLow => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio1YearLow);\n\n        /// <summary>\n        /// The one-year average for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14087\n        /// </remarks>\n        [JsonProperty(\"14087\")]\n        public double PERatio1YearAverage => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio1YearAverage);\n\n        /// <summary>\n        /// The five-year high for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14088\n        /// </remarks>\n        [JsonProperty(\"14088\")]\n        public double PERatio5YearHigh => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio5YearHigh);\n\n        /// <summary>\n        /// The five-year low for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14089\n        /// </remarks>\n        [JsonProperty(\"14089\")]\n        public double PERatio5YearLow => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio5YearLow);\n\n        /// <summary>\n        /// The five-year average for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14090\n        /// </remarks>\n        [JsonProperty(\"14090\")]\n        public double PERatio5YearAverage => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio5YearAverage);\n\n        /// <summary>\n        /// The ten-year high for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14091\n        /// </remarks>\n        [JsonProperty(\"14091\")]\n        public double PERatio10YearHigh => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio10YearHigh);\n\n        /// <summary>\n        /// The ten-year low for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14092\n        /// </remarks>\n        [JsonProperty(\"14092\")]\n        public double PERatio10YearLow => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio10YearLow);\n\n        /// <summary>\n        /// The ten-year average for a company's PE ratio (adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports).\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14093\n        /// </remarks>\n        [JsonProperty(\"14093\")]\n        public double PERatio10YearAverage => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio10YearAverage);\n\n        /// <summary>\n        /// The cyclically adjusted PE ratio for a company; adjusted close price divided by earnings per share. If the result is negative, zero, &gt;10,000 or &lt;0.001, then null. Morningstar uses the CPI index for US companies and Indexes from the World Bank for the rest of the global markets.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14094\n        /// </remarks>\n        [JsonProperty(\"14094\")]\n        public double CAPERatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_CAPERatio);\n\n        /// <summary>\n        /// The three-year growth in the company's EV to EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14095\n        /// </remarks>\n        [JsonProperty(\"14095\")]\n        public double EVToEBITDA3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's EV to free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash flow from operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14096\n        /// </remarks>\n        [JsonProperty(\"14096\")]\n        public double EVToFCF3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's EV to revenue on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14097\n        /// </remarks>\n        [JsonProperty(\"14097\")]\n        public double EVToRevenue3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's EV to total assets on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by total assets reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14098\n        /// </remarks>\n        [JsonProperty(\"14098\")]\n        public double EVToTotalAssets3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's price to free cash flow ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the free cash flow reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14099\n        /// </remarks>\n        [JsonProperty(\"14099\")]\n        public double PFCFRatio3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's price to book ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14100\n        /// </remarks>\n        [JsonProperty(\"14100\")]\n        public double PBRatio3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's PE ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14101\n        /// </remarks>\n        [JsonProperty(\"14101\")]\n        public double PERatio3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio3YearGrowth);\n\n        /// <summary>\n        /// The three-year growth in the company's price to sales ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the sales per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14102\n        /// </remarks>\n        [JsonProperty(\"14102\")]\n        public double PSRatio3YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio3YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's EV to EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14103\n        /// </remarks>\n        [JsonProperty(\"14103\")]\n        public double EVToEBITDA5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's EV to free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash flow from operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14104\n        /// </remarks>\n        [JsonProperty(\"14104\")]\n        public double EVToFCF5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's EV to revenue on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14105\n        /// </remarks>\n        [JsonProperty(\"14105\")]\n        public double EVToRevenue5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's EV to total assets on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by total assets reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14106\n        /// </remarks>\n        [JsonProperty(\"14106\")]\n        public double EVToTotalAssets5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's price to free cash flow ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the free cash flow reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14107\n        /// </remarks>\n        [JsonProperty(\"14107\")]\n        public double PFCFRatio5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's price to book ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14108\n        /// </remarks>\n        [JsonProperty(\"14108\")]\n        public double PBRatio5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's PE ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14109\n        /// </remarks>\n        [JsonProperty(\"14109\")]\n        public double PERatio5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio5YearGrowth);\n\n        /// <summary>\n        /// The five-year growth in the company's price to sales ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the sales per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14110\n        /// </remarks>\n        [JsonProperty(\"14110\")]\n        public double PSRatio5YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio5YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's EV to EBITDA on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by EBITDA (earnings minus expenses excluding interest, tax, depreciation, and amortization expenses) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14111\n        /// </remarks>\n        [JsonProperty(\"14111\")]\n        public double EVToEBITDA10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToEBITDA10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's EV to free cash flow on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by free cash flow (Cash flow from operations - Capital Expenditures) reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14112\n        /// </remarks>\n        [JsonProperty(\"14112\")]\n        public double EVToFCF10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToFCF10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's EV to revenue on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by Total Revenue reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14113\n        /// </remarks>\n        [JsonProperty(\"14113\")]\n        public double EVToRevenue10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToRevenue10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's EV to total assets on a percentage basis. Morningstar calculates the growth percentage based on the enterprise value (Market Cap + Preferred stock + Long-Term Debt And Capital Lease + Short Term Debt And Capital Lease + Securities Sold But Not Yet Repurchased - Cash, Cash Equivalent And Market Securities - Securities Purchased with Agreement to Resell - Securities Borrowed) divided by total assets reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14114\n        /// </remarks>\n        [JsonProperty(\"14114\")]\n        public double EVToTotalAssets10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_EVToTotalAssets10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's price to free cash flow ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the free cash flow reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14115\n        /// </remarks>\n        [JsonProperty(\"14115\")]\n        public double PFCFRatio10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PFCFRatio10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's price to book ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the book value per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14116\n        /// </remarks>\n        [JsonProperty(\"14116\")]\n        public double PBRatio10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PBRatio10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's PE ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the earnings per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14117\n        /// </remarks>\n        [JsonProperty(\"14117\")]\n        public double PERatio10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PERatio10YearGrowth);\n\n        /// <summary>\n        /// The ten-year growth in the company's price to sales ratio on a percentage basis. Morningstar calculates the growth percentage based on the adjusted close price divided by the sales per share reported in the Financial Statements within the company filings or reports.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14118\n        /// </remarks>\n        [JsonProperty(\"14118\")]\n        public double PSRatio10YearGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_PSRatio10YearGrowth);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of estimated EBIT in year 2.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14119\n        /// </remarks>\n        [JsonProperty(\"14119\")]\n        public double TwoYrsEVToForwardEBIT => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TwoYrsEVToForwardEBIT);\n\n        /// <summary>\n        /// Indicates what is a company being valued per each dollar of estimated EBITDA in year 2.\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14120\n        /// </remarks>\n        [JsonProperty(\"14120\")]\n        public double TwoYrsEVToForwardEBITDA => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_TwoYrsEVToForwardEBITDA);\n\n        /// <summary>\n        /// EPS Growth Ratio: (Estimated EPS Year 1) / (TTM Normalized diluted EPS\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14121\n        /// </remarks>\n        [JsonProperty(\"14121\")]\n        public double FirstYearEstimatedEPSGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_FirstYearEstimatedEPSGrowth);\n\n        /// <summary>\n        /// EPS Growth Ratio: (Estimated EPS Year 2) / (Estimated EPS Year 1)\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14122\n        /// </remarks>\n        [JsonProperty(\"14122\")]\n        public double SecondYearEstimatedEPSGrowth => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_SecondYearEstimatedEPSGrowth);\n\n        /// <summary>\n        /// Normalized ForwardPERatio / Long-term Average Normalized Earnings Growth Rate\n        /// </summary>\n        /// <remarks>\n        /// Morningstar DataId: 14123\n        /// </remarks>\n        [JsonProperty(\"14123\")]\n        public double NormalizedPEGRatio => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.ValuationRatios_NormalizedPEGRatio);\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public ValuationRatios(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n            : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)\n        {\n            return new ValuationRatios(timeProvider, _securityIdentifier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WagesandSalariesIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// This is the portion under Staff Costs that represents salary paid to the employees in respect of their work.\n    /// </summary>\n    public class WagesandSalariesIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WagesandSalaries_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WagesandSalaries_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WagesandSalaries_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WagesandSalaries_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_WagesandSalaries_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WagesandSalariesIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WagesandSalariesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WaterProductionBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// The amount for a facility and plant that provides water which might include wells, reservoirs, pumping stations, and control facilities; and waste water systems which includes the waste treatment and disposal facility and equipment. This item is usually only available for utility industry.\n    /// </summary>\n    public class WaterProductionBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WaterProduction_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WaterProduction_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WaterProduction_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WaterProduction_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_WaterProduction_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WaterProductionBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WaterProductionBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WorkInProcessBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Work, or goods, in the process of being fabricated or manufactured but not yet completed as finished goods. This item is usually available for manufacturing and mining industries.\n    /// </summary>\n    public class WorkInProcessBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkInProcess_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_WorkInProcess_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WorkInProcessBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WorkInProcessBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WorkingCapitalBalanceSheet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Current Assets minus Current Liabilities. This item is usually not available for bank and insurance industries.\n    /// </summary>\n    public class WorkingCapitalBalanceSheet : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the OneMonth period value for the field\n        /// </summary>\n        [JsonProperty(\"1M\")]\n        public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_OneMonth);\n\n        /// <summary>\n        /// Gets/sets the TwoMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"2M\")]\n        public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_TwoMonths);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_WorkingCapital_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1M\",OneMonth), new Tuple<string, double>(\"2M\",TwoMonths), new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_BalanceSheet_WorkingCapital_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WorkingCapitalBalanceSheet()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WorkingCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WorkingCapitalTurnoverRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Total revenue / working capital (current assets minus current liabilities)\n    /// </summary>\n    public class WorkingCapitalTurnoverRatio : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"OneYear\";\n\n        /// <summary>\n        /// Gets/sets the OneYear period value for the field\n        /// </summary>\n        [JsonProperty(\"1Y\")]\n        public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_WorkingCapitalTurnoverRatio_OneYear);\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_WorkingCapitalTurnoverRatio_ThreeMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_WorkingCapitalTurnoverRatio_OneYear));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_WorkingCapitalTurnoverRatio_OneYear);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\",OneYear), new Tuple<string, double>(\"3M\",ThreeMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"OperationRatios_WorkingCapitalTurnoverRatio_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WorkingCapitalTurnoverRatio()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WorkingCapitalTurnoverRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Generated/WriteOffIncomeStatement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// A reduction in the value of an asset or earnings by the amount of an expense or loss.\n    /// </summary>\n    public class WriteOffIncomeStatement : MultiPeriodField\n    {\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected override string DefaultPeriod => \"TwelveMonths\";\n\n        /// <summary>\n        /// Gets/sets the ThreeMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"3M\")]\n        public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_ThreeMonths);\n\n        /// <summary>\n        /// Gets/sets the SixMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"6M\")]\n        public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_SixMonths);\n\n        /// <summary>\n        /// Gets/sets the NineMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"9M\")]\n        public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_NineMonths);\n\n        /// <summary>\n        /// Gets/sets the TwelveMonths period value for the field\n        /// </summary>\n        [JsonProperty(\"12M\")]\n        public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_TwelveMonths);\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_TwelveMonths));\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public override double Value\n        {\n            get\n            {\n                var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_WriteOff_TwelveMonths);\n                if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                {\n                    return defaultValue;\n                }\n                return base.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        /// <returns>The dictionary of period names and values</returns>\n        public override IReadOnlyDictionary<string, double> GetPeriodValues()\n        {\n            var result = new Dictionary<string, double>();\n            foreach (var kvp in new[] { new Tuple<string, double>(\"3M\",ThreeMonths), new Tuple<string, double>(\"6M\",SixMonths), new Tuple<string, double>(\"9M\",NineMonths), new Tuple<string, double>(\"12M\",TwelveMonths) })\n            {\n                if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                {\n                    result[kvp.Item1] = kvp.Item2;\n                }\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($\"FinancialStatements_IncomeStatement_WriteOff_{ConvertPeriod(period)}\"));\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public WriteOffIncomeStatement()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance for the given time and security\n        /// </summary>\n        public WriteOffIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/MultiPeriodField.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Abstract base class for multi-period fields\n    /// </summary>\n    public abstract class MultiPeriodField<T> : ReusuableCLRObject\n    {\n        /// <summary>\n        /// No Value\n        /// </summary>\n        public static T NoValue { get; } = BaseFundamentalDataProvider.GetDefault<T>();\n\n        /// <summary>\n        /// The time provider instance to use\n        /// </summary>\n        protected ITimeProvider TimeProvider { get; }\n\n        /// <summary>\n        /// The default period\n        /// </summary>\n        protected abstract string DefaultPeriod { get; }\n\n        /// <summary>\n        /// The target security identifier\n        /// </summary>\n        protected SecurityIdentifier SecurityIdentifier { get; set; }\n\n        /// <summary>\n        /// Returns true if the field contains a value for the default period\n        /// </summary>\n        public abstract bool HasValue { get; }\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public virtual T Value => GetPeriodValues().Select(x => x.Value).DefaultIfEmpty(NoValue).FirstOrDefault();\n\n        /// <summary>\n        /// Creates an empty instance\n        /// </summary>\n        protected MultiPeriodField()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeProvider\"></param>\n        /// <param name=\"securityIdentifier\"></param>\n        protected MultiPeriodField(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)\n        {\n            TimeProvider = timeProvider;\n            SecurityIdentifier = securityIdentifier;\n        }\n\n        /// <summary>\n        /// Gets a dictionary of period names and values for the field\n        /// </summary>\n        public abstract IReadOnlyDictionary<string, T> GetPeriodValues();\n\n        /// <summary>\n        /// Returns true if the field contains a value for the requested period\n        /// </summary>\n        /// <returns>True if the field contains a value for the requested period</returns>\n        public virtual bool HasPeriodValue(string period) => !BaseFundamentalDataProvider.IsNone(typeof(T), GetPeriodValue(period));\n\n        /// <summary>\n        /// Gets the value of the field for the requested period\n        /// </summary>\n        /// <param name=\"period\">The requested period</param>\n        /// <returns>The value for the period</returns>\n        public abstract T GetPeriodValue(string period);\n\n        /// <summary>\n        /// Gets the list of available period names for the field\n        /// </summary>\n        public IEnumerable<string> GetPeriodNames()\n        {\n            return GetPeriodValues().Select(x => x.Key);\n        }\n\n        /// <summary>\n        /// Returns true if the field has at least one value for one period\n        /// </summary>\n        public bool HasValues()\n        {\n            return GetPeriodValues().Any();\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        public override string ToString()\n        {\n            return string.Join(\";\", GetPeriodValues().Select(kvp => $\"{kvp.Key}:{kvp.Value}\"));\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        protected string ConvertPeriod(string period)\n        {\n            if (string.IsNullOrEmpty(period))\n            {\n                return DefaultPeriod;\n            }\n\n            switch (period)\n            {\n                case Period.OneMonth:\n                    return \"OneMonth\";\n                case Period.TwoMonths:\n                    return \"TwoMonths\";\n                case Period.ThreeMonths:\n                    return \"ThreeMonths\";\n                case Period.SixMonths:\n                    return \"SixMonths\";\n                case Period.NineMonths:\n                    return \"NineMonths\";\n                case Period.TwelveMonths:\n                    return \"TwelveMonths\";\n                case Period.OneYear:\n                    return \"OneYear\";\n                case Period.TwoYears:\n                    return \"TwoYears\";\n                case Period.ThreeYears:\n                    return \"ThreeYears\";\n                case Period.FiveYears:\n                    return \"FiveYears\";\n                case Period.TenYears:\n                    return \"TenYears\";\n                default:\n                    return period;\n            }\n        }\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public static implicit operator T(MultiPeriodField<T> instance)\n        {\n            return instance.Value;\n        }\n    }\n\n    /// <summary>\n    /// Abstract class for multi-period fields\n    /// </summary>\n    public abstract class MultiPeriodField : MultiPeriodField<double>\n    {\n        /// <summary>\n        /// Creates an empty instance\n        /// </summary>\n        protected MultiPeriodField()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeProvider\"></param>\n        /// <param name=\"securityIdentifier\"></param>\n        protected MultiPeriodField(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public static implicit operator decimal(MultiPeriodField instance)\n        {\n            return (decimal)instance.Value;\n        }\n    }\n\n    /// <summary>\n    /// Abstract class for multi-period fields long\n    /// </summary>\n    public abstract class MultiPeriodFieldLong : MultiPeriodField<long>\n    {\n        /// <summary>\n        /// Creates an empty instance\n        /// </summary>\n        protected MultiPeriodFieldLong()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeProvider\"></param>\n        /// <param name=\"securityIdentifier\"></param>\n        protected MultiPeriodFieldLong(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)\n        {\n        }\n\n        /// <summary>\n        /// Returns the default value for the field\n        /// </summary>\n        public static implicit operator decimal(MultiPeriodFieldLong instance)\n        {\n            return (decimal)instance.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Fundamental/Period.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Fundamental\n{\n    /// <summary>\n    /// Period constants for multi-period fields\n    /// </summary>\n    public static class Period\n    {\n        /// <summary>\n        /// Period constant for one month\n        /// </summary>\n        public const string OneMonth = \"1M\";\n\n        /// <summary>\n        /// Period constant for two months\n        /// </summary>\n        public const string TwoMonths = \"2M\";\n\n        /// <summary>\n        /// Period constant for three months\n        /// </summary>\n        public const string ThreeMonths = \"3M\";\n\n        /// <summary>\n        /// Period constant for six months\n        /// </summary>\n        public const string SixMonths = \"6M\";\n\n        /// <summary>\n        /// Period constant for nine months\n        /// </summary>\n        public const string NineMonths = \"9M\";\n\n        /// <summary>\n        /// Period constant for twelve months\n        /// </summary>\n        public const string TwelveMonths = \"12M\";\n\n        /// <summary>\n        /// Period constant for one year\n        /// </summary>\n        public const string OneYear = \"1Y\";\n\n        /// <summary>\n        /// Period constant for two years\n        /// </summary>\n        public const string TwoYears = \"2Y\";\n\n        /// <summary>\n        /// Period constant for three years\n        /// </summary>\n        public const string ThreeYears = \"3Y\";\n\n        /// <summary>\n        /// Period constant for five years\n        /// </summary>\n        public const string FiveYears = \"5Y\";\n\n        /// <summary>\n        /// Period constant for ten years\n        /// </summary>\n        public const string TenYears = \"10Y\";\n    }\n\n    /// <summary>\n    /// Period constants for multi-period fields as bytes\n    /// </summary>\n    /// <remarks>For performance speed and memory using bytes versus strings.\n    /// This is the period we are going to store in memory</remarks>\n    internal static class PeriodAsByte\n    {\n        /// <summary>\n        /// Converts a byte period to its string equivalent\n        /// </summary>\n        public static string Convert(byte period)\n        {\n            switch (period)\n            {\n                case 0:\n                    // no period case\n                    return \"\";\n                case 1:\n                    return Period.OneMonth;\n                case 2:\n                    return Period.TwoMonths;\n                case 3:\n                    return Period.ThreeMonths;\n                case 6:\n                    return Period.SixMonths;\n                case 9:\n                    return Period.NineMonths;\n                case 12:\n                    return Period.TwelveMonths;\n                case 121:\n                    return Period.OneYear;\n                case 24:\n                    return Period.TwoYears;\n                case 36:\n                    return Period.ThreeYears;\n                case 60:\n                    return Period.FiveYears;\n                case 120:\n                    return Period.TenYears;\n                default:\n                    throw new InvalidOperationException(Invariant($\"{period} is not a valid period value\"));\n            }\n        }\n\n        /// <summary>\n        /// Converts a string period to its byte equivalent\n        /// </summary>\n        public static byte Convert(string period)\n        {\n            switch (period)\n            {\n                case \"\":\n                    // no period case\n                    return NoPeriod;\n                case Period.OneMonth:\n                    return OneMonth;\n                case Period.TwoMonths:\n                    return TwoMonths;\n                case Period.ThreeMonths:\n                    return ThreeMonths;\n                case Period.SixMonths:\n                    return SixMonths;\n                case Period.NineMonths:\n                    return NineMonths;\n                case Period.TwelveMonths:\n                    return TwelveMonths;\n                case Period.OneYear:\n                    return OneYear;\n                case Period.TwoYears:\n                    return TwoYears;\n                case Period.ThreeYears:\n                    return ThreeYears;\n                case Period.FiveYears:\n                    return FiveYears;\n                case Period.TenYears:\n                    return TenYears;\n                default:\n                    throw new InvalidOperationException($\"{period} is not a valid period value\");\n            }\n        }\n\n        /// <summary>\n        /// No Period constant\n        /// </summary>\n        public const byte NoPeriod = 0;\n\n        /// <summary>\n        /// Period constant for one month\n        /// </summary>\n        public const byte OneMonth = 1;\n\n        /// <summary>\n        /// Period constant for two months\n        /// </summary>\n        public const byte TwoMonths = 2;\n\n        /// <summary>\n        /// Period constant for three months\n        /// </summary>\n        public const byte ThreeMonths = 3;\n\n        /// <summary>\n        /// Period constant for six months\n        /// </summary>\n        public const byte SixMonths = 6;\n\n        /// <summary>\n        /// Period constant for nine months\n        /// </summary>\n        public const byte NineMonths = 9;\n\n        /// <summary>\n        /// Period constant for twelve months\n        /// </summary>\n        public const byte TwelveMonths = 12;\n\n        /// <summary>\n        /// Period constant for one year\n        /// </summary>\n        public const byte OneYear = 121;\n\n        /// <summary>\n        /// Period constant for two years\n        /// </summary>\n        public const byte TwoYears = 24;\n\n        /// <summary>\n        /// Period constant for three years\n        /// </summary>\n        public const byte ThreeYears = 36;\n\n        /// <summary>\n        /// Period constant for five years\n        /// </summary>\n        public const byte FiveYears = 60;\n\n        /// <summary>\n        /// Period constant for ten years\n        /// </summary>\n        public const byte TenYears = 120;\n    }\n}\n"
  },
  {
    "path": "Common/Data/GetSetPropertyDynamicMetaObject.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Dynamic;\nusing System.Linq.Expressions;\nusing System.Reflection;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"DynamicMetaObject\"/> that uses get/set methods to update\n    /// values in the dynamic object.\n    /// </summary>\n    public class GetSetPropertyDynamicMetaObject : DynamicMetaObject\n    {\n        private readonly MethodInfo _setPropertyMethodInfo;\n        private readonly MethodInfo _getPropertyMethodInfo;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"T:QuantConnect.Data.GetSetPropertyDynamicMetaObject\" /> class.\n        /// </summary>\n        /// <param name=\"expression\">The expression representing this <see cref=\"T:System.Dynamic.DynamicMetaObject\" /></param>\n        /// <param name=\"value\">The value represented by the <see cref=\"T:System.Dynamic.DynamicMetaObject\" /></param>\n        /// <param name=\"setPropertyMethodInfo\">The set method to use for updating this dynamic object</param>\n        /// <param name=\"getPropertyMethodInfo\">The get method to use for updating this dynamic object</param>\n        public GetSetPropertyDynamicMetaObject(\n            Expression expression,\n            object value,\n            MethodInfo setPropertyMethodInfo,\n            MethodInfo getPropertyMethodInfo\n            )\n            : base(expression, BindingRestrictions.Empty, value)\n        {\n            _setPropertyMethodInfo = setPropertyMethodInfo;\n            _getPropertyMethodInfo = getPropertyMethodInfo;\n        }\n\n        /// <summary>\n        /// Performs the binding of the dynamic set member operation.\n        /// </summary>\n        /// <param name=\"binder\">An instance of the <see cref=\"T:System.Dynamic.SetMemberBinder\" /> that represents the details of the dynamic operation.</param>\n        /// <param name=\"value\">The <see cref=\"T:System.Dynamic.DynamicMetaObject\" /> representing the value for the set member operation.</param>\n        /// <returns>The new <see cref=\"T:System.Dynamic.DynamicMetaObject\" /> representing the result of the binding.</returns>\n        public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)\n        {\n            // we need to build up an expression tree that represents accessing our instance\n            var restrictions = BindingRestrictions.GetTypeRestriction(Expression, LimitType);\n\n            var args = new Expression[]\n            {\n                // this is the name of the property to set\n                Expression.Constant(binder.Name),\n\n                // this is the value\n                Expression.Convert(value.Expression, typeof (object))\n            };\n\n            // set the 'this' reference\n            var self = Expression.Convert(Expression, LimitType);\n\n            var call = Expression.Call(self, _setPropertyMethodInfo, args);\n\n            return new DynamicMetaObject(call, restrictions);\n        }\n\n        /// <summary>Performs the binding of the dynamic get member operation.</summary>\n        /// <param name=\"binder\">An instance of the <see cref=\"T:System.Dynamic.GetMemberBinder\" /> that represents the details of the dynamic operation.</param>\n        /// <returns>The new <see cref=\"T:System.Dynamic.DynamicMetaObject\" /> representing the result of the binding.</returns>\n        public override DynamicMetaObject BindGetMember(GetMemberBinder binder)\n        {\n            // we need to build up an expression tree that represents accessing our instance\n            var restrictions = BindingRestrictions.GetTypeRestriction(Expression, LimitType);\n\n            // arguments for 'call'\n            var args = new Expression[]\n            {\n                // this is the name of the property to set\n                Expression.Constant(binder.Name)\n            };\n\n            // set the 'this' reference\n            var self = Expression.Convert(Expression, LimitType);\n\n            var call = Expression.Call(self, _getPropertyMethodInfo, args);\n\n            return new DynamicMetaObject(call, restrictions);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/HistoryExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Helper extension methods for objects related with Histotical data\n    /// </summary>\n    public static class HistoryExtensions\n    {\n        private static readonly Regex _brokerageHistoryProvider = new(\"QuantConnect.Lean.Engine.HistoricalData.([a-zA-z]+)HistoryProvider\", RegexOptions.Compiled);\n\n        /// <summary>\n        /// Helper method to get the brokerage name\n        /// </summary>\n        public static bool TryGetBrokerageName(string historyProviderName, out string brokerageName)\n        {\n            brokerageName = null;\n            if (historyProviderName != \"QuantConnect.Lean.Engine.HistoricalData.BrokerageHistoryProvider\"\n                && historyProviderName != \"QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider\")\n            {\n                var matches = _brokerageHistoryProvider.Match(historyProviderName);\n                if (matches.Success)\n                {\n                    brokerageName = matches.Groups[1].Value;\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Split <see cref=\"HistoryRequest\"/> on several request with update mapped symbol.\n        /// </summary>\n        /// <param name=\"request\">Represents historical data requests</param>\n        /// <param name=\"mapFileProvider\">Provides instances of <see cref=\"MapFileResolver\"/> at run time</param>\n        /// <returns>\n        /// Return HistoryRequests with different <see cref=\"BaseDataRequest.StartTimeUtc\"/> - <seealso cref=\"BaseDataRequest.EndTimeUtc\"/> range\n        /// and <seealso cref=\"Symbol.Value\"/>\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"mapFileProvider\"/> is null.</exception>\n        /// <example>\n        /// For instances:\n        /// request = { StartTimeUtc = 2013/01/01, EndTimeUtc = 2017/02/02, Symbol = \"GOOGL\" }  split request on:\n        /// 1: request = { StartTimeUtc = 2013/01/01, EndTimeUtc = 2014/04/02, Symbol.Value = \"GOOG\" }\n        /// 2: request = { StartTimeUtc = 2014/04/**03**, EndTimeUtc = 2017/02/02, Symbol.Value = \"GOOGL\" }\n        /// > GOOGLE: IPO: August 19, 2004 Name = GOOG then it was restructured: from \"GOOG\" to \"GOOGL\" on April 2, 2014\n        /// </example>\n        public static IEnumerable<HistoryRequest> SplitHistoryRequestWithUpdatedMappedSymbol(this HistoryRequest request, IMapFileProvider mapFileProvider)\n        {\n            if (request == null)\n            {\n                throw new ArgumentNullException(nameof(request));\n            }\n\n            if (request.Symbol.SecurityType != SecurityType.Future && request.Symbol.RequiresMapping())\n            {\n                var isReturnHistoryRequest = default(bool);\n                foreach (var tickerDateRange in mapFileProvider.RetrieveSymbolHistoricalDefinitionsInDateRange(request.Symbol, request.StartTimeLocal, request.EndTimeLocal))\n                {\n                    isReturnHistoryRequest = true;\n                    var symbol = request.Symbol.UpdateMappedSymbol(tickerDateRange.Ticker);\n                    yield return new HistoryRequest(\n                        request,\n                        symbol,\n                        tickerDateRange.StartDateTimeLocal.ConvertToUtc(request.ExchangeHours.TimeZone),\n                        tickerDateRange.EndDateTimeLocal.ConvertToUtc(request.ExchangeHours.TimeZone)\n                        );\n                }\n\n                if (!isReturnHistoryRequest)\n                {\n                    yield return request;\n                }\n            }\n            else\n            {\n                yield return request;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/HistoryProviderBase.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides a base type for all history providers\n    /// </summary>\n    public abstract class HistoryProviderBase : IHistoryProvider\n    {\n        /// <summary>\n        /// Event fired when an invalid configuration has been detected\n        /// </summary>\n        public event EventHandler<InvalidConfigurationDetectedEventArgs> InvalidConfigurationDetected;\n\n        /// <summary>\n        /// Event fired when the numerical precision in the factor file has been limited\n        /// </summary>\n        public event EventHandler<NumericalPrecisionLimitedEventArgs> NumericalPrecisionLimited;\n\n        /// <summary>\n        /// Event fired when the start date has been limited\n        /// </summary>\n        public event EventHandler<StartDateLimitedEventArgs> StartDateLimited;\n\n        /// <summary>\n        /// Event fired when there was an error downloading a remote file\n        /// </summary>\n        public event EventHandler<DownloadFailedEventArgs> DownloadFailed;\n\n        /// <summary>\n        /// Event fired when there was an error reading the data\n        /// </summary>\n        public event EventHandler<ReaderErrorDetectedEventArgs> ReaderErrorDetected;\n\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        public abstract int DataPointCount { get; }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public abstract void Initialize(HistoryProviderInitializeParameters parameters);\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public abstract IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone);\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"InvalidConfigurationDetected\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"InvalidConfigurationDetected\"/> event</param>\n        protected virtual void OnInvalidConfigurationDetected(InvalidConfigurationDetectedEventArgs e)\n        {\n            InvalidConfigurationDetected?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NumericalPrecisionLimited\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"NumericalPrecisionLimited\"/> event</param>\n        protected virtual void OnNumericalPrecisionLimited(NumericalPrecisionLimitedEventArgs e)\n        {\n            NumericalPrecisionLimited?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"DownloadFailed\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"DownloadFailed\"/> event</param>\n        protected virtual void OnDownloadFailed(DownloadFailedEventArgs e)\n        {\n            DownloadFailed?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ReaderErrorDetected\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"ReaderErrorDetected\"/> event</param>\n        protected virtual void OnReaderErrorDetected(ReaderErrorDetectedEventArgs e)\n        {\n            ReaderErrorDetected?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"StartDateLimited\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"StartDateLimited\"/> event</param>\n        protected virtual void OnStartDateLimited(StartDateLimitedEventArgs e)\n        {\n            StartDateLimited?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/HistoryProviderInitializeParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Represents the set of parameters for the <see cref=\"IHistoryProvider.Initialize\"/> method\n    /// </summary>\n    public class HistoryProviderInitializeParameters\n    {\n        /// <summary>\n        /// The job\n        /// </summary>\n        public AlgorithmNodePacket Job { get; }\n\n        /// <summary>\n        /// The API instance\n        /// </summary>\n        public IApi Api { get; }\n\n        /// <summary>\n        /// The provider used to get data when it is not present on disk\n        /// </summary>\n        public IDataProvider DataProvider { get; }\n\n        /// <summary>\n        /// The provider used to cache history data files\n        /// </summary>\n        public IDataCacheProvider DataCacheProvider { get; }\n\n        /// <summary>\n        /// The provider used to get a map file resolver to handle equity mapping\n        /// </summary>\n        public IMapFileProvider MapFileProvider { get; }\n\n        /// <summary>\n        /// The provider used to get factor files to handle equity price scaling\n        /// </summary>\n        public IFactorFileProvider FactorFileProvider { get; }\n\n        /// <summary>\n        /// A function used to send status updates\n        /// </summary>\n        public Action<int> StatusUpdateAction { get; }\n\n        /// <summary>\n        /// True if parallel history requests are enabled\n        /// </summary>\n        /// <remarks>Parallel history requests are faster but require more ram and cpu usage\n        /// and are not compatible with some <see cref=\"IDataCacheProvider\"/></remarks>\n        public bool ParallelHistoryRequestsEnabled { get; }\n\n        /// <summary>\n        /// The data permission manager\n        /// </summary>\n        public IDataPermissionManager DataPermissionManager { get; }\n\n        /// <summary>\n        /// The object store\n        /// </summary>\n        public IObjectStore ObjectStore { get; }\n\n        /// <summary>\n        /// The algorithm settings instance to use\n        /// </summary>\n        public IAlgorithmSettings AlgorithmSettings { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryProviderInitializeParameters\"/> class from the specified parameters\n        /// </summary>\n        /// <param name=\"job\">The job</param>\n        /// <param name=\"api\">The API instance</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <param name=\"dataCacheProvider\">Provider used to cache history data files</param>\n        /// <param name=\"mapFileProvider\">Provider used to get a map file resolver to handle equity mapping</param>\n        /// <param name=\"factorFileProvider\">Provider used to get factor files to handle equity price scaling</param>\n        /// <param name=\"statusUpdateAction\">Function used to send status updates</param>\n        /// <param name=\"parallelHistoryRequestsEnabled\">True if parallel history requests are enabled</param>\n        /// <param name=\"dataPermissionManager\">The data permission manager to use</param>\n        /// <param name=\"objectStore\">The object store to use</param>\n        /// <param name=\"algorithmSettings\">The algorithm settings instance to use</param>\n        public HistoryProviderInitializeParameters(\n            AlgorithmNodePacket job,\n            IApi api,\n            IDataProvider dataProvider,\n            IDataCacheProvider dataCacheProvider,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            Action<int> statusUpdateAction,\n            bool parallelHistoryRequestsEnabled,\n            IDataPermissionManager dataPermissionManager,\n            IObjectStore objectStore,\n            IAlgorithmSettings algorithmSettings)\n        {\n            Job = job;\n            Api = api;\n            DataProvider = dataProvider;\n            DataCacheProvider = dataCacheProvider;\n            MapFileProvider = mapFileProvider;\n            FactorFileProvider = factorFileProvider;\n            StatusUpdateAction = statusUpdateAction;\n            ParallelHistoryRequestsEnabled = parallelHistoryRequestsEnabled;\n            DataPermissionManager = dataPermissionManager;\n            ObjectStore = objectStore;\n            AlgorithmSettings = algorithmSettings;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/HistoryRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Represents a request for historical data\n    /// </summary>\n    public class HistoryRequest : BaseDataRequest\n    {\n        private Resolution? _fillForwardResolution;\n        private bool _includeExtendedMarketHours;\n\n        /// <summary>\n        /// Gets the symbol to request data for\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// Gets the requested data resolution\n        /// </summary>\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// Gets the requested fill forward resolution, set to null for no fill forward behavior.\n        /// Will always return null when Resolution is set to Tick.\n        /// </summary>\n        public Resolution? FillForwardResolution\n        {\n            get\n            {\n                return Resolution == Resolution.Tick ? null : _fillForwardResolution;\n            }\n            set\n            {\n                _fillForwardResolution = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets whether or not to include extended market hours data, set to false for only normal market hours\n        /// </summary>\n        public bool IncludeExtendedMarketHours\n        {\n            get\n            {\n                return _includeExtendedMarketHours;\n            }\n            set\n            {\n                _includeExtendedMarketHours = value && LeanData.SupportsExtendedMarketHours(DataType);\n            }\n        }\n\n        /// <summary>\n        /// Gets the time zone of the time stamps on the raw input data\n        /// </summary>\n        public DateTimeZone DataTimeZone { get; set; }\n\n        /// <summary>\n        /// TickType of the history request\n        /// </summary>\n        public TickType TickType { get; set; }\n\n        /// <summary>\n        /// Gets the normalization mode used for this subscription\n        /// </summary>\n        public DataNormalizationMode DataNormalizationMode { get; set; }\n\n        /// <summary>\n        /// Gets the data mapping mode used for this subscription\n        /// </summary>\n        public DataMappingMode DataMappingMode { get; set; }\n\n        /// <summary>\n        /// The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract\n        /// </summary>\n        public uint ContractDepthOffset { get; set; }\n\n        /// <summary>\n        /// Gets the tradable days specified by this request, in the security's data time zone\n        /// </summary>\n        public override IEnumerable<DateTime> TradableDaysInDataTimeZone => Time.EachTradeableDayInTimeZone(ExchangeHours,\n            StartTimeLocal,\n            EndTimeLocal,\n            DataTimeZone,\n            IncludeExtendedMarketHours);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryRequest\"/> class from the specified parameters\n        /// </summary>\n        /// <param name=\"startTimeUtc\">The start time for this request,</param>\n        /// <param name=\"endTimeUtc\">The end time for this request</param>\n        /// <param name=\"dataType\">The data type of the output data</param>\n        /// <param name=\"symbol\">The symbol to request data for</param>\n        /// <param name=\"resolution\">The requested data resolution</param>\n        /// <param name=\"exchangeHours\">The exchange hours used in fill forward processing</param>\n        /// <param name=\"dataTimeZone\">The time zone of the data</param>\n        /// <param name=\"fillForwardResolution\">The requested fill forward resolution for this request</param>\n        /// <param name=\"includeExtendedMarketHours\">True to include data from pre/post market hours</param>\n        /// <param name=\"isCustomData\">True for custom user data, false for normal QC data</param>\n        /// <param name=\"dataNormalizationMode\">Specifies normalization mode used for this subscription</param>\n        /// <param name=\"tickType\">The tick type used to created the <see cref=\"SubscriptionDataConfig\"/> for the retrieval of history data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        public HistoryRequest(DateTime startTimeUtc,\n            DateTime endTimeUtc,\n            Type dataType,\n            Symbol symbol,\n            Resolution resolution,\n            SecurityExchangeHours exchangeHours,\n            DateTimeZone dataTimeZone,\n            Resolution? fillForwardResolution,\n            bool includeExtendedMarketHours,\n            bool isCustomData,\n            DataNormalizationMode dataNormalizationMode,\n            TickType tickType,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0)\n            : base(startTimeUtc, endTimeUtc, exchangeHours, tickType, isCustomData, dataType)\n        {\n            Symbol = symbol;\n            DataTimeZone = dataTimeZone;\n            Resolution = resolution;\n            FillForwardResolution = fillForwardResolution;\n            IncludeExtendedMarketHours = includeExtendedMarketHours;\n            DataNormalizationMode = dataNormalizationMode;\n            TickType = tickType;\n            DataMappingMode = dataMappingMode;\n            ContractDepthOffset = contractDepthOffset;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryRequest\"/> class from the specified config and exchange hours\n        /// </summary>\n        /// <param name=\"config\">The subscription data config used to initialize this request</param>\n        /// <param name=\"hours\">The exchange hours used for fill forward processing</param>\n        /// <param name=\"startTimeUtc\">The start time for this request,</param>\n        /// <param name=\"endTimeUtc\">The end time for this request</param>\n        public HistoryRequest(SubscriptionDataConfig config, SecurityExchangeHours hours, DateTime startTimeUtc, DateTime endTimeUtc)\n            : this(startTimeUtc, endTimeUtc, config.Type, config.Symbol, config.Resolution,\n                hours, config.DataTimeZone, config.FillDataForward ? config.Resolution : (Resolution?)null,\n                config.ExtendedMarketHours, config.IsCustomData, config.DataNormalizationMode, config.TickType, config.DataMappingMode, config.ContractDepthOffset)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryRequest\"/> class with new Symbol, StartTimeUtc, EndTimeUtc\n        /// </summary>\n        /// <param name=\"request\">Represents a request for historical data</param>\n        /// <param name=\"newStartTimeUtc\">The start time for this request</param>\n        /// <param name=\"newEndTimeUtc\">The end time for this request</param>\n        public HistoryRequest(HistoryRequest request, Symbol newSymbol, DateTime newStartTimeUtc, DateTime newEndTimeUtc)\n            : this (newStartTimeUtc, newEndTimeUtc, request.DataType, newSymbol, request.Resolution, request.ExchangeHours, request.DataTimeZone, request.FillForwardResolution,\n                  request.IncludeExtendedMarketHours, request.IsCustomData, request.DataNormalizationMode, request.TickType, request.DataMappingMode, request.ContractDepthOffset)\n        { }\n    }\n}\n"
  },
  {
    "path": "Common/Data/HistoryRequestFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Helper class used to create new <see cref=\"HistoryRequest\"/>\n    /// </summary>\n    public class HistoryRequestFactory\n    {\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to use</param>\n        public HistoryRequestFactory(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n        }\n\n        /// <summary>\n        /// Creates a new history request\n        /// </summary>\n        /// <param name=\"subscription\">The config </param>\n        /// <param name=\"startAlgoTz\">History request start time in algorithm time zone</param>\n        /// <param name=\"endAlgoTz\">History request end time in algorithm time zone</param>\n        /// <param name=\"exchangeHours\">Security exchange hours</param>\n        /// <param name=\"resolution\">The resolution to use. If null will use <see cref=\"SubscriptionDataConfig.Resolution\"/></param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security history request</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the securities history</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 will use the front month, 1 will use the back month contract</param>\n        /// <returns>The new <see cref=\"HistoryRequest\"/></returns>\n        public HistoryRequest CreateHistoryRequest(SubscriptionDataConfig subscription,\n            DateTime startAlgoTz,\n            DateTime endAlgoTz,\n            SecurityExchangeHours exchangeHours,\n            Resolution? resolution,\n            bool? fillForward = null,\n            bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null,\n            DataNormalizationMode? dataNormalizationMode = null,\n            int? contractDepthOffset = null)\n        {\n            resolution ??= subscription.Resolution;\n\n            var dataType = subscription.Type;\n\n            // if we change resolution the data type can change, for example subscription being Tick type and resolution daily\n            // data type here won't be Tick anymore, but TradeBar/QuoteBar\n            if (resolution.Value != subscription.Resolution && LeanData.IsCommonLeanDataType(dataType))\n            {\n                dataType = LeanData.GetDataType(resolution.Value, subscription.TickType);\n            }\n\n            var fillForwardResolution = subscription.FillDataForward ? resolution : null;\n            if (fillForward != null)\n            {\n                fillForwardResolution = fillForward.Value ? resolution : null;\n            }\n\n            var request = new HistoryRequest(subscription,\n                exchangeHours,\n                startAlgoTz.ConvertToUtc(_algorithm.TimeZone),\n                endAlgoTz.ConvertToUtc(_algorithm.TimeZone))\n            {\n                DataType = dataType,\n                Resolution = resolution.Value,\n                FillForwardResolution = fillForwardResolution,\n                TickType = subscription.TickType\n            };\n\n            if (extendedMarketHours != null)\n            {\n                request.IncludeExtendedMarketHours = extendedMarketHours.Value;\n            }\n\n            if (dataMappingMode != null)\n            {\n                request.DataMappingMode = dataMappingMode.Value;\n            }\n\n            if (dataNormalizationMode != null)\n            {\n                request.DataNormalizationMode = dataNormalizationMode.Value;\n            }\n\n            if (contractDepthOffset != null)\n            {\n                request.ContractDepthOffset = (uint)Math.Abs(contractDepthOffset.Value);\n            }\n\n            return request;\n        }\n\n        /// <summary>\n        /// Gets the start time required for the specified bar count in terms of the algorithm's time zone\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to select proper <see cref=\"SubscriptionDataConfig\"/> config</param>\n        /// <param name=\"periods\">The number of bars requested</param>\n        /// <param name=\"resolution\">The length of each bar</param>\n        /// <param name=\"exchange\">The exchange hours used for market open hours</param>\n        /// <param name=\"dataTimeZone\">The time zone in which data are stored</param>\n        /// <param name=\"dataType\">The data type to request</param>\n        /// <param name=\"extendedMarketHours\">\n        /// True to include extended market hours data, false otherwise.\n        /// If not passed, the config will be used to determined whether to include extended market hours.\n        /// </param>\n        /// <returns>The start time that would provide the specified number of bars ending at the algorithm's current time</returns>\n        public DateTime GetStartTimeAlgoTz(\n            Symbol symbol,\n            int periods,\n            Resolution resolution,\n            SecurityExchangeHours exchange,\n            DateTimeZone dataTimeZone,\n            Type dataType,\n            bool? extendedMarketHours = null)\n        {\n            return GetStartTimeAlgoTz(_algorithm.UtcTime, symbol, periods, resolution, exchange, dataTimeZone, dataType, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Gets the start time required for the specified bar count in terms of the algorithm's time zone\n        /// </summary>\n        /// <param name=\"referenceUtcTime\">The end time in utc</param>\n        /// <param name=\"symbol\">The symbol to select proper <see cref=\"SubscriptionDataConfig\"/> config</param>\n        /// <param name=\"periods\">The number of bars requested</param>\n        /// <param name=\"resolution\">The length of each bar</param>\n        /// <param name=\"exchange\">The exchange hours used for market open hours</param>\n        /// <param name=\"dataTimeZone\">The time zone in which data are stored</param>\n        /// <param name=\"dataType\">The data type to request</param>\n        /// <param name=\"extendedMarketHours\">\n        /// True to include extended market hours data, false otherwise.\n        /// If not passed, the config will be used to determined whether to include extended market hours.\n        /// </param>\n        /// <returns>The start time that would provide the specified number of bars ending at the algorithm's current time</returns>\n        public DateTime GetStartTimeAlgoTz(\n            DateTime referenceUtcTime,\n            Symbol symbol,\n            int periods,\n            Resolution resolution,\n            SecurityExchangeHours exchange,\n            DateTimeZone dataTimeZone,\n            Type dataType,\n            bool? extendedMarketHours = null)\n        {\n            var isExtendedMarketHours = false;\n            // hour and daily resolution does no have extended market hours data. Same for chain universes\n            if (resolution < Resolution.Hour && LeanData.SupportsExtendedMarketHours(dataType))\n            {\n                if (extendedMarketHours.HasValue)\n                {\n                    isExtendedMarketHours = extendedMarketHours.Value;\n                }\n                else\n                {\n                    var configs = _algorithm.SubscriptionManager\n                        .SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(symbol);\n                    isExtendedMarketHours = configs.IsExtendedMarketHours();\n                }\n            }\n\n            var timeSpan = resolution.ToTimeSpan();\n            // make this a minimum of one second\n            timeSpan = timeSpan < Time.OneSecond ? Time.OneSecond : timeSpan;\n\n            var localStartTime = Time.GetStartTimeForTradeBars(\n                exchange,\n                referenceUtcTime.ConvertFromUtc(exchange.TimeZone),\n                timeSpan,\n                periods,\n                isExtendedMarketHours,\n                dataTimeZone,\n                LeanData.UseDailyStrictEndTimes(_algorithm.Settings, dataType, symbol, timeSpan, exchange));\n            return localStartTime.ConvertTo(exchange.TimeZone, _algorithm.TimeZone);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/IBaseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Base Data Class: Type, Timestamp, Key -- Base Features.\n    /// </summary>\n    [StubsAvoidImplicits]\n    public interface IBaseData : ISymbolProvider\n    {\n        /// <summary>\n        /// Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.\n        /// </summary>\n        MarketDataType DataType\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Time keeper of data -- all data is timeseries based.\n        /// </summary>\n        DateTime Time\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// End time of data\n        /// </summary>\n        DateTime EndTime\n        {\n            get;\n            set;\n        }\n\n\n        /// <summary>\n        /// All timeseries data is a time-value pair:\n        /// </summary>\n        decimal Value\n        {\n            get;\n            set;\n        }\n\n\n        /// <summary>\n        /// Alias of Value.\n        /// </summary>\n        decimal Price\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Reader Method :: using set of arguements we specify read out type. Enumerate\n        /// until the end of the data stream or file. E.g. Read CSV file line by line and convert\n        /// into data types.\n        /// </summary>\n        /// <returns>BaseData type set by Subscription Method.</returns>\n        [Obsolete(\"Reader(SubscriptionDataConfig, string, DateTime, DataFeedEndpoint) method has been made obsolete, use Reader(SubscriptionDataConfig, string, DateTime, bool) instead.\")]\n        [StubsIgnore]\n        BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, DataFeedEndpoint dataFeed);\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode);\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [StubsIgnore]\n        BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode);\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"datafeed\">Type of datafeed we're reqesting - backtest or live</param>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <returns>String URL of source file.</returns>\n        [StubsIgnore]\n        string GetSource(SubscriptionDataConfig config, DateTime date, DataFeedEndpoint datafeed);\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <returns>True indicates mapping should be used</returns>\n        bool RequiresMapping();\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        /// <returns></returns>\n        BaseData Clone();\n\n    } // End Base Data Class\n\n} // End QC Namespace\n"
  },
  {
    "path": "Common/Data/IDataAggregator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Aggregates ticks and bars based on given subscriptions.\n    /// </summary>\n    [InheritedExport(typeof(IDataAggregator))]\n    public interface IDataAggregator : IDisposable\n    {\n        /// <summary>\n        /// Initialize this instance\n        /// </summary>\n        /// <param name=\"parameters\">The parameters dto instance</param>\n        void Initialize(DataAggregatorInitializeParameters parameters);\n\n        /// <summary>\n        /// Add new subscription to current <see cref=\"IDataAggregator\"/> instance\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        /// <returns></returns>\n        IEnumerator<BaseData> Add(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler);\n\n        /// <summary>\n        /// Remove the given subscription\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the subscription configuration data.</param>        \n        /// <returns>Returns true if given <see cref=\"SubscriptionDataConfig\"/> was found and succesfully removed; otherwise false.</returns>\n        bool Remove(SubscriptionDataConfig dataConfig);\n\n        /// <summary>\n        /// Adds new <see cref=\"BaseData\"/> input into aggregator.\n        /// </summary>\n        /// <param name=\"input\">The new data</param>\n        void Update(BaseData input);\n    }\n}\n"
  },
  {
    "path": "Common/Data/IDividendYieldModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Represents a model that provides dividend yield data\n    /// </summary>\n    public interface IDividendYieldModel\n    {\n        /// <summary>\n        /// Get dividend yield by a given date of a given symbol\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        decimal GetDividendYield(DateTime date);\n\n        /// <summary>\n        /// Get dividend yield at given date and security price\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"securityPrice\">The security price at the given date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        public decimal GetDividendYield(DateTime date, decimal securityPrice);\n    }\n}\n"
  },
  {
    "path": "Common/Data/IRiskFreeInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Represents a model that provides risk free interest rate data\n    /// </summary>\n    public interface IRiskFreeInterestRateModel\n    {\n        /// <summary>\n        /// Get interest rate by a given date\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Interest rate on the given date</returns>\n        decimal GetInterestRate(DateTime date);\n    }\n\n    /// <summary>\n    /// Provide extension and static methods for <see cref=\"IRiskFreeInterestRateModel\"/>\n    /// </summary>\n    public static class RiskFreeInterestRateModelExtensions\n    {\n        /// <summary>\n        /// Gets the average risk free annual return rate\n        /// </summary>\n        /// <param name=\"model\">The interest rate model</param>\n        /// <param name=\"startDate\">Start date to calculate the average</param>\n        /// <param name=\"endDate\">End date to calculate the average</param>\n        public static decimal GetRiskFreeRate(this IRiskFreeInterestRateModel model, DateTime startDate, DateTime endDate)\n        {\n            return model.GetAverageRiskFreeRate(Time.EachDay(startDate, endDate));\n        }\n\n        /// <summary>\n        /// Gets the average Risk Free Rate from the interest rate of the given dates\n        /// </summary>\n        /// <param name=\"model\">The interest rate model</param>\n        /// <param name=\"dates\">\n        /// Collection of dates from which the interest rates will be computed and then the average of them\n        /// </param>\n        public static decimal GetAverageRiskFreeRate(this IRiskFreeInterestRateModel model, IEnumerable<DateTime> dates)\n        {\n            var interestRates = dates.Select(x => model.GetInterestRate(x)).DefaultIfEmpty(0);\n            return interestRates.Average();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/ISubscriptionEnumeratorFactory.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Create an <see cref=\"IEnumerator{BaseData}\"/> \n    /// </summary>\n    public interface ISubscriptionEnumeratorFactory\n    {\n        /// <summary>\n        /// Creates an enumerator to read the specified request\n        /// </summary>\n        /// <param name=\"request\">The subscription request to be read</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <returns>An enumerator reading the subscription request</returns>\n        IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, IDataProvider dataProvider);\n    }\n}\n"
  },
  {
    "path": "Common/Data/ISymbolProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Base data with a symbol\n    /// </summary>\n    public interface ISymbolProvider\n    {\n        /// <summary>\n        /// Gets the Symbol\n        /// </summary>\n        Symbol Symbol\n        {\n            get;\n            set;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/IndexedBasedData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Abstract indexed base data class of QuantConnect.\n    /// It is intended to be extended to define customizable data types which are stored\n    /// using an intermediate index source\n    /// </summary>\n    public abstract class IndexedBaseData : BaseData\n    {\n        /// <summary>\n        /// Returns the source for a given index value\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"index\">The index value for which we want to fetch the source</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>The <see cref=\"SubscriptionDataSource\"/> instance to use</returns>\n        public virtual SubscriptionDataSource GetSourceForAnIndex(SubscriptionDataConfig config, DateTime date, string index, bool isLiveMode)\n        {\n            throw new NotImplementedException($\"{nameof(IndexedBaseData)} types should implement 'GetSourceForAnIndex'. \" +\n                                              \"The implementation should determine the source to use for a given index value.\");\n        }\n\n        /// <summary>\n        /// Returns the index source for a date\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>The <see cref=\"SubscriptionDataSource\"/> instance to use</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            throw new NotImplementedException($\"{nameof(IndexedBaseData)} types should implement 'GetSource'. \" +\n                                              \"The implementation should determine the index source to use for a given date.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/IndicatorHistory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides historical values of an indicator\n    /// </summary>\n    public class IndicatorHistory : DataHistory<IndicatorDataPoints>\n    {\n        private readonly Dictionary<string, List<IndicatorDataPoint>> _pointsPerName;\n\n        /// <summary>\n        /// The indicators historical values\n        /// </summary>\n        public List<IndicatorDataPoint> Current => this[\"current\"];\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"indicatorsDataPointsByTime\">Indicators data points by time</param>\n        /// <param name=\"indicatorsDataPointPerProperty\">Indicators data points by property name</param>\n        /// <param name=\"dataframe\">The lazy data frame constructor</param>\n        public IndicatorHistory(List<IndicatorDataPoints> indicatorsDataPointsByTime, List<InternalIndicatorValues> indicatorsDataPointPerProperty, Lazy<PyObject> dataframe)\n            : base(indicatorsDataPointsByTime, dataframe)\n        {\n            // for the index accessor we enforce uniqueness by name\n            _pointsPerName = indicatorsDataPointPerProperty.DistinctBy(x => x.Name.ToLowerInvariant()).ToDictionary(x => x.Name.ToSnakeCase(), x => x.Values);\n        }\n\n        /// <summary>\n        /// Access the historical indicator values per indicator property name\n        /// </summary>\n        public List<IndicatorDataPoint> this[string name]\n        {\n            get\n            {\n                if (_pointsPerName.TryGetValue(name.ToSnakeCase().ToLowerInvariant(), out var result))\n                {\n                    return result;\n                }\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/InterestRateProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Fed US Primary Credit Rate at given date\n    /// </summary>\n    public class InterestRateProvider : IRiskFreeInterestRateModel\n    {\n        private static readonly DateTime _firstInterestRateDate = new DateTime(1998, 1, 1);\n        private static DateTime _lastInterestRateDate;\n        private static Dictionary<DateTime, decimal> _riskFreeRateProvider;\n        private static readonly object _lock = new();\n\n        /// <summary>\n        /// Default Risk Free Rate of 1%\n        /// </summary>\n        public static readonly decimal DefaultRiskFreeRate = 0.01m;\n\n        /// <summary>\n        /// Lazily loads the interest rate provider from disk and returns it\n        /// </summary>\n        private IReadOnlyDictionary<DateTime, decimal> RiskFreeRateProvider\n        {\n            get\n            {\n                // let's not lock if the provider is already loaded\n                if (_riskFreeRateProvider != null)\n                {\n                    return _riskFreeRateProvider;\n                }\n\n                lock (_lock)\n                {\n                    _riskFreeRateProvider ??= GetInterestRateProvider();\n                    return _riskFreeRateProvider;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Get interest rate by a given date\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Interest rate on the given date</returns>\n        public decimal GetInterestRate(DateTime date)\n        {\n            if (!RiskFreeRateProvider.TryGetValue(date.Date, out var interestRate))\n            {\n                return date < _firstInterestRateDate\n                    ? RiskFreeRateProvider[_firstInterestRateDate]\n                    : RiskFreeRateProvider[_lastInterestRateDate];\n            }\n\n            return interestRate;\n        }\n\n        /// <summary>\n        /// Generate the daily historical US primary credit rate\n        /// </summary>\n        protected static Dictionary<DateTime, decimal> GetInterestRateProvider()\n        {\n            var directory = Path.Combine(Globals.DataFolder, \"alternative\", \"interest-rate\", \"usa\",\n                \"interest-rate.csv\");\n            var riskFreeRateProvider = FromCsvFile(directory, out var previousInterestRate);\n\n            _lastInterestRateDate = DateTime.UtcNow.Date;\n\n            // Sparse the discrete data points into continuous credit rate data for every day\n            for (var date = _firstInterestRateDate; date <= _lastInterestRateDate; date = date.AddDays(1))\n            {\n                if (!riskFreeRateProvider.TryGetValue(date, out var currentRate))\n                {\n                    riskFreeRateProvider[date] = previousInterestRate;\n                    continue;\n                }\n\n                previousInterestRate = currentRate;\n            }\n\n            return riskFreeRateProvider;\n        }\n\n        /// <summary>\n        /// Reads Fed primary credit rate file and returns a dictionary of historical rate changes\n        /// </summary>\n        /// <param name=\"file\">The csv file to be read</param>\n        /// <param name=\"firstInterestRate\">The first interest rate on file</param>\n        /// <returns>Dictionary of historical credit rate change events</returns>\n        public static Dictionary<DateTime, decimal> FromCsvFile(string file, out decimal firstInterestRate)\n        {\n            var dataProvider = Composer.Instance.GetPart<IDataProvider>();\n\n            var firstInterestRateSet = false;\n            firstInterestRate = DefaultRiskFreeRate;\n\n            // skip the first header line, also skip #'s as these are comment lines\n            var interestRateProvider = new Dictionary<DateTime, decimal>();\n            foreach (var line in dataProvider.ReadLines(file).Skip(1)\n                         .Where(x => !string.IsNullOrWhiteSpace(x)))\n            {\n                if (TryParse(line, out var date, out var interestRate))\n                {\n                    if (!firstInterestRateSet)\n                    {\n                        firstInterestRate = interestRate;\n                        firstInterestRateSet = true;\n                    }\n\n                    interestRateProvider[date] = interestRate;\n                }\n            }\n\n            if (interestRateProvider.Count == 0)\n            {\n                Log.Error($\"InterestRateProvider.FromCsvFile(): no interest rates were loaded, please make sure the file is present '{file}'\");\n            }\n\n            return interestRateProvider;\n        }\n\n        /// <summary>\n        /// Parse the string into the interest rate date and value\n        /// </summary>\n        /// <param name=\"csvLine\">The csv line to be parsed</param>\n        /// <param name=\"date\">Parsed interest rate date</param>\n        /// <param name=\"interestRate\">Parsed interest rate value</param>\n        public static bool TryParse(string csvLine, out DateTime date, out decimal interestRate)\n        {\n            var line = csvLine.Split(',');\n\n            if (!DateTime.TryParseExact(line[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n            {\n                Log.Error($\"Couldn't parse date/time while reading FED primary credit rate file. Line: {csvLine}\");\n                interestRate = DefaultRiskFreeRate;\n                return false;\n            }\n\n            if (!decimal.TryParse(line[1], NumberStyles.Any, CultureInfo.InvariantCulture, out interestRate))\n            {\n                Log.Error($\"Couldn't parse primary credit rate while reading FED primary credit rate file. Line: {csvLine}\");\n                return false;\n            }\n\n            // Unit conversion from %\n            interestRate /= 100;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/LeanDataWriter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing QuantConnect.Util;\nusing System.Globalization;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Data writer for saving an IEnumerable of BaseData into the LEAN data directory.\n    /// </summary>\n    public class LeanDataWriter\n    {\n        private static KeyStringSynchronizer _keySynchronizer = new();\n\n        /// <summary>\n        /// The map file provider instance to use\n        /// </summary>\n        /// <remarks>Public for testing</remarks>\n        public static Lazy<IMapFileProvider> MapFileProvider { get; set; } = new(\n            Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"), forceTypeNameOnExisting: false)\n        );\n\n        private readonly Symbol _symbol;\n        private readonly bool _mapSymbol;\n        private readonly string _dataDirectory;\n        private readonly TickType _tickType;\n        private readonly Resolution _resolution;\n        private readonly WritePolicy _writePolicy;\n        private readonly SecurityType _securityType;\n        private readonly IDataCacheProvider _dataCacheProvider;\n\n        /// <summary>\n        /// Create a new lean data writer to this base data directory.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol string</param>\n        /// <param name=\"dataDirectory\">Base data directory</param>\n        /// <param name=\"resolution\">Resolution of the desired output data</param>\n        /// <param name=\"tickType\">The tick type</param>\n        /// <param name=\"dataCacheProvider\">The data cache provider to use</param>\n        /// <param name=\"writePolicy\">The file write policy to use</param>\n        /// <param name=\"mapSymbol\">True if the symbol should be mapped while writting the data</param>\n        public LeanDataWriter(Resolution resolution, Symbol symbol, string dataDirectory, TickType tickType = TickType.Trade,\n            IDataCacheProvider dataCacheProvider = null, WritePolicy? writePolicy = null, bool mapSymbol = false) : this(\n            dataDirectory,\n            resolution,\n            symbol.ID.SecurityType,\n            tickType,\n            dataCacheProvider,\n            writePolicy\n        )\n        {\n            _symbol = symbol;\n            _mapSymbol = mapSymbol;\n            // All fx data is quote data.\n            if (_securityType == SecurityType.Forex || _securityType == SecurityType.Cfd)\n            {\n                _tickType = TickType.Quote;\n            }\n\n            if (_securityType != SecurityType.Equity && _securityType != SecurityType.Forex && _securityType != SecurityType.Cfd && _securityType != SecurityType.Crypto\n                && _securityType != SecurityType.Future && _securityType != SecurityType.Option && _securityType != SecurityType.FutureOption\n                && _securityType != SecurityType.Index && _securityType != SecurityType.IndexOption && _securityType != SecurityType.CryptoFuture)\n            {\n                throw new NotImplementedException(\"Sorry this security type is not yet supported by the LEAN data writer: \" + _securityType);\n            }\n        }\n\n        /// <summary>\n        /// Create a new lean data writer to this base data directory.\n        /// </summary>\n        /// <param name=\"dataDirectory\">Base data directory</param>\n        /// <param name=\"resolution\">Resolution of the desired output data</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <param name=\"tickType\">The tick type</param>\n        /// <param name=\"dataCacheProvider\">The data cache provider to use</param>\n        /// <param name=\"writePolicy\">The file write policy to use</param>\n        public LeanDataWriter(string dataDirectory, Resolution resolution, SecurityType securityType, TickType tickType,\n            IDataCacheProvider dataCacheProvider = null, WritePolicy? writePolicy = null)\n        {\n            _dataDirectory = dataDirectory;\n            _resolution = resolution;\n            _securityType = securityType;\n            _tickType = tickType;\n            if (writePolicy == null)\n            {\n                _writePolicy = resolution >= Resolution.Hour ? WritePolicy.Merge : WritePolicy.Overwrite;\n            }\n            else\n            {\n                _writePolicy = writePolicy.Value;\n            }\n            _dataCacheProvider = dataCacheProvider ?? new DiskDataCacheProvider();\n        }\n\n        /// <summary>\n        /// Given the constructor parameters, write out the data in LEAN format.\n        /// </summary>\n        /// <param name=\"source\">IEnumerable source of the data: sorted from oldest to newest.</param>\n        public void Write(IEnumerable<BaseData> source)\n        {\n            var lastTime = DateTime.MinValue;\n            var outputFile = string.Empty;\n            Symbol symbol = null;\n            var currentFileData = new List<TimedLine>();\n            var writeTasks = new Queue<Task>();\n\n            foreach (var data in source)\n            {\n                // Ensure the data is sorted as a safety check\n                if (data.Time < lastTime) throw new Exception(\"The data must be pre-sorted from oldest to newest\");\n\n                // Update our output file\n                // Only do this on date change, because we know we don't have a any data zips smaller than a day, saves time\n                if (data.Time.Date != lastTime.Date)\n                {\n                    var mappedSymbol = GetMappedSymbol(data.Time, data.Symbol);\n                    // Get the latest file name, if it has changed, we have entered a new file, write our current data to file\n                    var latestOutputFile = GetZipOutputFileName(_dataDirectory, data.Time, mappedSymbol);\n                    var latestSymbol = mappedSymbol;\n                    if (outputFile.IsNullOrEmpty() || outputFile != latestOutputFile)\n                    {\n                        if (!currentFileData.IsNullOrEmpty())\n                        {\n                            // Launch a write task for the current file and data set\n                            var file = outputFile;\n                            var fileData = currentFileData;\n                            var fileSymbol = symbol;\n                            writeTasks.Enqueue(Task.Run(() =>\n                            {\n                                WriteFile(file, fileData, fileSymbol);\n                            }));\n                        }\n\n                        // Reset our dictionary and store new output file\n                        currentFileData = new List<TimedLine>();\n                        outputFile = latestOutputFile;\n                        symbol = latestSymbol;\n                    }\n                }\n\n                // Add data to our current dictionary\n                var line = LeanData.GenerateLine(data, _securityType, _resolution);\n                currentFileData.Add(new TimedLine(data.Time, line));\n\n                // Update our time\n                lastTime = data.Time;\n            }\n\n            // Finish off my processing the last file as well\n            if (!currentFileData.IsNullOrEmpty())\n            {\n                // we want to finish ASAP so let's do it ourselves\n                WriteFile(outputFile, currentFileData, symbol);\n            }\n\n            // Wait for all our write tasks to finish\n            while (writeTasks.Count > 0)\n            {\n                var task = writeTasks.Dequeue();\n                task.Wait();\n            }\n        }\n\n        /// <summary>\n        /// Downloads historical data from the brokerage and saves it in LEAN format.\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage from where to fetch the data</param>\n        /// <param name=\"symbols\">The list of symbols</param>\n        /// <param name=\"startTimeUtc\">The starting date/time (UTC)</param>\n        /// <param name=\"endTimeUtc\">The ending date/time (UTC)</param>\n        public void DownloadAndSave(IBrokerage brokerage, List<Symbol> symbols, DateTime startTimeUtc, DateTime endTimeUtc)\n        {\n            if (symbols.Count == 0)\n            {\n                throw new ArgumentException(\"DownloadAndSave(): The symbol list cannot be empty.\");\n            }\n\n            if (_tickType != TickType.Trade && _tickType != TickType.Quote)\n            {\n                throw new ArgumentException(\"DownloadAndSave(): The tick type must be Trade or Quote.\");\n            }\n\n            if (symbols.Any(x => x.SecurityType != _securityType))\n            {\n                throw new ArgumentException($\"DownloadAndSave(): All symbols must have {_securityType} security type.\");\n            }\n\n            if (symbols.DistinctBy(x => x.ID.Symbol).Count() > 1)\n            {\n                throw new ArgumentException(\"DownloadAndSave(): All symbols must have the same root ticker.\");\n            }\n\n            var dataType = LeanData.GetDataType(_resolution, _tickType);\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            var ticker = symbols.First().ID.Symbol;\n            var market = symbols.First().ID.Market;\n\n            var canonicalSymbol = Symbol.Create(ticker, _securityType, market);\n\n            var exchangeHours = marketHoursDatabase.GetExchangeHours(canonicalSymbol.ID.Market, canonicalSymbol, _securityType);\n            var dataTimeZone = marketHoursDatabase.GetDataTimeZone(canonicalSymbol.ID.Market, canonicalSymbol, _securityType);\n\n            foreach (var symbol in symbols)\n            {\n                var historyRequest = new HistoryRequest(\n                    startTimeUtc,\n                    endTimeUtc,\n                    dataType,\n                    symbol,\n                    _resolution,\n                    exchangeHours,\n                    dataTimeZone,\n                    _resolution,\n                    true,\n                    false,\n                    DataNormalizationMode.Raw,\n                    _tickType\n                );\n\n                var history = brokerage.GetHistory(historyRequest)?\n                    .Select(\n                        x =>\n                        {\n                            // Convert to date timezone before we write it\n                            x.Time = x.Time.ConvertTo(exchangeHours.TimeZone, dataTimeZone);\n                            return x;\n                        })?\n                    .ToList();\n\n                if (history == null)\n                {\n                    continue;\n                }\n\n                // Generate a writer for this data and write it\n                var writer = new LeanDataWriter(_resolution, symbol, _dataDirectory, _tickType);\n                writer.Write(history);\n            }\n        }\n\n        /// <summary>\n        /// Loads an existing Lean zip file into a SortedDictionary\n        /// </summary>\n        private bool TryLoadFile(string fileName, string entryName, DateTime date, out SortedDictionary<DateTime, string> rows)\n        {\n            rows = new SortedDictionary<DateTime, string>();\n\n            using (var stream = _dataCacheProvider.Fetch($\"{fileName}#{entryName}\"))\n            {\n                if (stream == null)\n                {\n                    return false;\n                }\n\n                using (var reader = new StreamReader(stream))\n                {\n                    string line;\n                    while ((line = reader.ReadLine()) != null)\n                    {\n                        rows[LeanData.ParseTime(line, date.Date, _resolution)] = line;\n                    }\n                }\n\n                return true;\n            }\n        }\n\n        /// <summary>\n        /// Write this file to disk with the given data.\n        /// </summary>\n        /// <param name=\"filePath\">The full path to the new file</param>\n        /// <param name=\"data\">The data to write as a list of dates and strings</param>\n        /// <param name=\"symbol\">The symbol associated with this data</param>\n        /// <remarks>The reason we have the data as IEnumerable(DateTime, string) is to support\n        /// a generic write that works for all resolutions. In order to merge in hour/daily case I need the\n        /// date of the data to correctly merge the two. In order to support writing ticks I need to allow\n        /// two data points to have the same time. Thus I cannot use a single list of just strings nor\n        /// a sorted dictionary of DateTimes and strings. </remarks>\n        private void WriteFile(string filePath, List<TimedLine> data, Symbol symbol)\n        {\n            filePath = FileExtension.ToNormalizedPath(filePath);\n            if (data == null || data.Count == 0)\n            {\n                return;\n            }\n\n            // because we read & write the same file we need to take a lock per file path so we don't read something that might get outdated\n            // by someone writting to the same path at the same time\n            _keySynchronizer.Execute(filePath, singleExecution: false, () =>\n            {\n                var date = data[0].Time.Date;\n                // Generate this csv entry name\n                var entryName = LeanData.GenerateZipEntryName(symbol, date, _resolution, _tickType);\n\n                // Check disk once for this file ahead of time, reuse where possible\n                var fileExists = File.Exists(filePath);\n\n                // If our file doesn't exist its possible the directory doesn't exist, make sure at least the directory exists\n                if (!fileExists)\n                {\n                    Directory.CreateDirectory(Path.GetDirectoryName(filePath));\n                }\n\n                // Handle merging of files\n                // Only merge on files with hour/daily resolution, that exist, and can be loaded\n                string finalData = null;\n                if (_writePolicy == WritePolicy.Append)\n                {\n                    var streamWriter = new ZipStreamWriter(filePath, entryName);\n                    foreach (var tuple in data)\n                    {\n                        streamWriter.WriteLine(tuple.Line);\n                    }\n                    streamWriter.DisposeSafely();\n                }\n                else if (_writePolicy == WritePolicy.Merge && fileExists && TryLoadFile(filePath, entryName, date, out var rows))\n                {\n                    // Preform merge on loaded rows\n                    foreach (var timedLine in data)\n                    {\n                        rows[timedLine.Time] = timedLine.Line;\n                    }\n\n                    // Final merged data product\n                    finalData = string.Join(\"\\n\", rows.Values);\n                }\n                else\n                {\n                    // Otherwise just extract the data from the given list.\n                    finalData = string.Join(\"\\n\", data.Select(x => x.Line));\n                }\n\n                if (finalData != null)\n                {\n                    var bytes = Encoding.UTF8.GetBytes(finalData);\n                    _dataCacheProvider.Store($\"{filePath}#{entryName}\", bytes);\n                }\n\n                if (Log.DebuggingEnabled)\n                {\n                    var from = date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    var to = data[data.Count - 1].Time.Date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    Log.Debug($\"LeanDataWriter.Write({symbol.ID}): Appended: {filePath} @ {entryName} {from}->{to}\");\n                }\n            });\n        }\n\n        /// <summary>\n        /// Get the output zip file\n        /// </summary>\n        /// <param name=\"baseDirectory\">Base output directory for the zip file</param>\n        /// <param name=\"time\">Date/time for the data we're writing</param>\n        /// <param name=\"symbol\">The associated symbol. For example for options/futures it will be different than the canonical at <see cref=\"_symbol\"/></param>\n        /// <returns>The full path to the output zip file</returns>\n        private string GetZipOutputFileName(string baseDirectory, DateTime time, Symbol symbol)\n        {\n            return LeanData.GenerateZipFilePath(baseDirectory, symbol, time, _resolution, _tickType);\n        }\n\n        /// <summary>\n        /// Helper method to map a symbol if required at the given date\n        /// </summary>\n        private Symbol GetMappedSymbol(DateTime time, Symbol symbol)\n        {\n            if (!_mapSymbol)\n            {\n                return _symbol;\n            }\n            if (symbol.RequiresMapping())\n            {\n                var mapFileResolver = MapFileProvider.Value.Get(AuxiliaryDataKey.Create(symbol.ID));\n                var mapFile = mapFileResolver.ResolveMapFile(symbol);\n                var mappedTicker = mapFile.GetMappedSymbol(time);\n                if(!string.IsNullOrEmpty(mappedTicker))\n                {\n                    // only update if we got something to map to\n                    symbol = symbol.UpdateMappedSymbol(mappedTicker);\n                }\n            }\n\n            return symbol;\n        }\n\n        private class TimedLine\n        {\n            public string Line { get; }\n            public DateTime Time { get; }\n            public TimedLine(DateTime time, string line)\n            {\n                Line = line;\n                Time = time;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Bar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Base Bar Class: Open, High, Low, Close and Period.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class Bar : IBar\n    {\n        private bool _openSet;\n\n        /// <summary>\n        /// Opening price of the bar: Defined as the price at the start of the time period.\n        /// </summary>\n        [ProtoMember(1)]\n        public virtual decimal Open { get; set; }\n\n        /// <summary>\n        /// High price of the bar during the time period.\n        /// </summary>\n        [ProtoMember(2)]\n        public virtual decimal High { get; set; }\n\n        /// <summary>\n        /// Low price of the bar during the time period.\n        /// </summary>\n        [ProtoMember(3)]\n        public virtual decimal Low { get; set; }\n\n        /// <summary>\n        /// Closing price of the bar. Defined as the price at Start Time + TimeSpan.\n        /// </summary>\n        [ProtoMember(4)]\n        public virtual decimal Close { get; set; }\n\n        /// <summary>\n        /// Default initializer to setup an empty bar.\n        /// </summary>\n        public Bar()\n        {\n        }\n\n        /// <summary>\n        /// Initializer to setup a bar with a given information.\n        /// </summary>\n        /// <param name=\"open\">Decimal Opening Price</param>\n        /// <param name=\"high\">Decimal High Price of this bar</param>\n        /// <param name=\"low\">Decimal Low Price of this bar</param>\n        /// <param name=\"close\">Decimal Close price of this bar</param>\n        public Bar(decimal open, decimal high, decimal low, decimal close)\n        {\n            _openSet = open != 0;\n            Open = open;\n            High = high;\n            Low = low;\n            Close = close;\n        }\n\n        /// <summary>\n        /// Updates the bar with a new value. This will aggregate the OHLC bar\n        /// </summary>\n        /// <param name=\"value\">The new value</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Update(decimal value)\n        {\n            Update(ref value);\n        }\n\n        /// <summary>\n        /// Updates the bar with a new value. This will aggregate the OHLC bar\n        /// </summary>\n        /// <param name=\"value\">The new value</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Update(ref decimal value)\n        {\n            // Do not accept zero as a new value\n            if (value == 0) return;\n\n            if (!_openSet)\n            {\n                Open = High = Low = Close = value;\n                _openSet = true;\n            }\n            else if (value > High) High = value;\n            else if (value < Low) Low = value;\n            Close = value;\n        }\n\n        /// <summary>\n        /// Returns a clone of this bar\n        /// </summary>\n        public Bar Clone()\n        {\n            return new Bar(Open, High, Low, Close);\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return $\"O: {Open.SmartRounding()} \" +\n                   $\"H: {High.SmartRounding()} \" +\n                   $\"L: {Low.SmartRounding()} \" +\n                   $\"C: {Close.SmartRounding()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/BarDirection.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Enum for Bar Direction\n    /// </summary>\n    public enum BarDirection\n    {\n        /// <summary>\n        /// Rising bar (0)\n        /// </summary>\n        Rising,\n\n        /// <summary>\n        /// No change (1)\n        /// </summary>\n        NoDelta,\n\n        /// <summary>\n        /// Falling bar (2)\n        /// </summary>\n        Falling\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/BaseChain.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Base representation of an entire chain of contracts for a single underlying security.\n    /// This type is <see cref=\"IEnumerable{T}\"/> where T is <see cref=\"OptionContract\"/>, <see cref=\"FuturesContract\"/>, etc.\n    /// </summary>\n    public class BaseChain<T, TContractsCollection> : BaseData, IEnumerable<T>\n        where T : BaseContract\n        where TContractsCollection : DataDictionary<T>, new()\n    {\n        private Dictionary<Type, Dictionary<Symbol, List<BaseData>>> _auxiliaryData;\n        private readonly Lazy<PyObject> _dataframe;\n        private readonly bool _flatten;\n\n        private Dictionary<Type, Dictionary<Symbol, List<BaseData>>> AuxiliaryData\n        {\n            get\n            {\n                if (_auxiliaryData == null)\n                {\n                    _auxiliaryData = new Dictionary<Type, Dictionary<Symbol, List<BaseData>>>();\n                }\n\n                return _auxiliaryData;\n            }\n        }\n\n        /// <summary>\n        /// Gets the most recent trade information for the underlying. This may\n        /// be a <see cref=\"Tick\"/> or a <see cref=\"TradeBar\"/>\n        /// </summary>\n        [PandasIgnore]\n        public BaseData Underlying\n        {\n            get; internal set;\n        }\n\n        /// <summary>\n        /// Gets all ticks for every option contract in this chain, keyed by option symbol\n        /// </summary>\n        [PandasIgnore]\n        public Ticks Ticks\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Gets all trade bars for every option contract in this chain, keyed by option symbol\n        /// </summary>\n        [PandasIgnore]\n        public TradeBars TradeBars\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Gets all quote bars for every option contract in this chain, keyed by option symbol\n        /// </summary>\n        [PandasIgnore]\n        public QuoteBars QuoteBars\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Gets all contracts in the chain, keyed by option symbol\n        /// </summary>\n        public TContractsCollection Contracts\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the set of symbols that passed the <see cref=\"Option.ContractFilter\"/>\n        /// </summary>\n        [PandasIgnore]\n        public HashSet<Symbol> FilteredContracts\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// The data frame representation of the option chain\n        /// </summary>\n        [PandasIgnore]\n        public PyObject DataFrame => _dataframe.Value;\n\n        /// <summary>\n        /// The number of contracts in this chain\n        /// </summary>\n        public int Count => Contracts.Count;\n\n        /// <summary>\n        /// Checks if the chain contains a contract with the specified symbol\n        /// </summary>\n        /// <param name=\"key\">The symbol of the contract to check for</param>\n        /// <returns>True if the chain contains a contract with the specified symbol; otherwise, false.</returns>\n        public bool ContainsKey(Symbol key)\n        {\n            return Contracts.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"BaseChain{T, TContractsCollection}\"/> class\n        /// </summary>\n        protected BaseChain(MarketDataType dataType, bool flatten)\n        {\n            DataType = dataType;\n            _flatten = flatten;\n            _dataframe = new Lazy<PyObject>(\n                () =>\n                {\n                    if (!PythonEngine.IsInitialized)\n                    {\n                        return null;\n                    }\n                    return new PandasConverter().GetDataFrame(new[] { this }, symbolOnlyIndex: true, flatten: _flatten);\n                },\n                isThreadSafe: false);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseChain{T, TContractsCollection}\"/> class\n        /// </summary>\n        /// <param name=\"canonicalOptionSymbol\">The symbol for this chain.</param>\n        /// <param name=\"time\">The time of this chain</param>\n        /// <param name=\"flatten\">Whether to flatten the data frame</param>\n        protected BaseChain(Symbol canonicalOptionSymbol, DateTime time, MarketDataType dataType, bool flatten = true)\n            : this(dataType, flatten)\n        {\n            Time = time;\n            Symbol = canonicalOptionSymbol;\n            Ticks = new Ticks(time);\n            TradeBars = new TradeBars(time);\n            QuoteBars = new QuoteBars(time);\n            FilteredContracts = new HashSet<Symbol>();\n            Underlying = new QuoteBar();\n            Contracts = new();\n            Contracts.Time = time;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseChain{T, TContractsCollection}\"/> class as a copy of the specified chain\n        /// </summary>\n        protected BaseChain(BaseChain<T, TContractsCollection> other)\n            : this(other.DataType, other._flatten)\n        {\n            Symbol = other.Symbol;\n            Time = other.Time;\n            Value = other.Value;\n            Underlying = other.Underlying;\n            Ticks = other.Ticks;\n            QuoteBars = other.QuoteBars;\n            TradeBars = other.TradeBars;\n            Contracts = other.Contracts;\n            FilteredContracts = other.FilteredContracts;\n        }\n\n        /// <summary>\n        /// Gets the auxiliary data with the specified type and symbol\n        /// </summary>\n        /// <typeparam name=\"TAux\">The type of auxiliary data</typeparam>\n        /// <param name=\"symbol\">The symbol of the auxiliary data</param>\n        /// <returns>The last auxiliary data with the specified type and symbol</returns>\n        public TAux GetAux<TAux>(Symbol symbol)\n        {\n            List<BaseData> list;\n            Dictionary<Symbol, List<BaseData>> dictionary;\n            if (!AuxiliaryData.TryGetValue(typeof(TAux), out dictionary) || !dictionary.TryGetValue(symbol, out list))\n            {\n                return default;\n            }\n            return list.OfType<TAux>().LastOrDefault();\n        }\n\n        /// <summary>\n        /// Gets all auxiliary data of the specified type as a dictionary keyed by symbol\n        /// </summary>\n        /// <typeparam name=\"TAux\">The type of auxiliary data</typeparam>\n        /// <returns>A dictionary containing all auxiliary data of the specified type</returns>\n        public DataDictionary<TAux> GetAux<TAux>()\n        {\n            Dictionary<Symbol, List<BaseData>> d;\n            if (!AuxiliaryData.TryGetValue(typeof(TAux), out d))\n            {\n                return new DataDictionary<TAux>();\n            }\n            var dictionary = new DataDictionary<TAux>();\n            foreach (var kvp in d)\n            {\n                var item = kvp.Value.OfType<TAux>().LastOrDefault();\n                if (item != null)\n                {\n                    dictionary.Add(kvp.Key, item);\n                }\n            }\n            return dictionary;\n        }\n\n        /// <summary>\n        /// Gets all auxiliary data of the specified type as a dictionary keyed by symbol\n        /// </summary>\n        /// <typeparam name=\"TAux\">The type of auxiliary data</typeparam>\n        /// <returns>A dictionary containing all auxiliary data of the specified type</returns>\n        public Dictionary<Symbol, List<BaseData>> GetAuxList<TAux>()\n        {\n            Dictionary<Symbol, List<BaseData>> dictionary;\n            if (!AuxiliaryData.TryGetValue(typeof(TAux), out dictionary))\n            {\n                return new Dictionary<Symbol, List<BaseData>>();\n            }\n            return dictionary;\n        }\n\n        /// <summary>\n        /// Gets a list of auxiliary data with the specified type and symbol\n        /// </summary>\n        /// <typeparam name=\"TAux\">The type of auxiliary data</typeparam>\n        /// <param name=\"symbol\">The symbol of the auxiliary data</param>\n        /// <returns>The list of auxiliary data with the specified type and symbol</returns>\n        public List<TAux> GetAuxList<TAux>(Symbol symbol)\n        {\n            List<BaseData> list;\n            Dictionary<Symbol, List<BaseData>> dictionary;\n            if (!AuxiliaryData.TryGetValue(typeof(TAux), out dictionary) || !dictionary.TryGetValue(symbol, out list))\n            {\n                return new List<TAux>();\n            }\n            return list.OfType<TAux>().ToList();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// An enumerator that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<T> GetEnumerator()\n        {\n            return Contracts.Values.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Adds the specified data to this chain\n        /// </summary>\n        /// <param name=\"data\">The data to be added</param>\n        internal void AddData(BaseData data)\n        {\n            switch (data)\n            {\n                case Tick tick:\n                    Ticks.Add(tick.Symbol, tick);\n                    break;\n\n                case TradeBar tradeBar:\n                    TradeBars[tradeBar.Symbol] = tradeBar;\n                    break;\n\n                case QuoteBar quoteBar:\n                    QuoteBars[quoteBar.Symbol] = quoteBar;\n                    break;\n\n                default:\n                    if (data.DataType == MarketDataType.Base)\n                    {\n                        AddAuxData(data);\n                    }\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified auxiliary data to this option chain\n        /// </summary>\n        /// <param name=\"baseData\">The auxiliary data to be added</param>\n        private void AddAuxData(BaseData baseData)\n        {\n            var type = baseData.GetType();\n            Dictionary<Symbol, List<BaseData>> dictionary;\n            if (!AuxiliaryData.TryGetValue(type, out dictionary))\n            {\n                dictionary = new Dictionary<Symbol, List<BaseData>>();\n                AuxiliaryData[type] = dictionary;\n            }\n\n            List<BaseData> list;\n            if (!dictionary.TryGetValue(baseData.Symbol, out list))\n            {\n                list = new List<BaseData>();\n                dictionary[baseData.Symbol] = list;\n            }\n            list.Add(baseData);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/BaseChains.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"BaseChain{T, TContractsCollection}\"/> keyed by canonical option symbol\n    /// </summary>\n    public class BaseChains<T, TContract, TContractsCollection> : DataDictionary<T>\n        where T : BaseChain<TContract, TContractsCollection>\n        where TContract : BaseContract\n        where TContractsCollection : DataDictionary<TContract>, new()\n    {\n        private static readonly IEnumerable<string> _flattenedDfIndexNames = new[] { \"canonical\", \"symbol\" };\n\n        private readonly Lazy<PyObject> _dataframe;\n        private readonly bool _flatten;\n\n        /// <summary>\n        /// The data frame representation of the option chains\n        /// </summary>\n        public PyObject DataFrame => _dataframe.Value;\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChains{T, TContract, TContractsCollection}\"/> dictionary\n        /// </summary>\n        protected BaseChains()\n            : this(default, true)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChains{T, TContract, TContractsCollection}\"/> dictionary\n        /// </summary>\n        protected BaseChains(bool flatten)\n            : this(default, flatten)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChains{T, TContract, TContractsCollection}\"/> dictionary\n        /// </summary>\n        protected BaseChains(DateTime time, bool flatten)\n            : base(time)\n        {\n            _flatten = flatten;\n            _dataframe = new Lazy<PyObject>(InitializeDataFrame, isThreadSafe: false);\n        }\n\n        private PyObject InitializeDataFrame()\n        {\n            if (!PythonEngine.IsInitialized)\n            {\n                return null;\n            }\n\n            var dataFrames = this.Select(kvp => kvp.Value.DataFrame).ToList();\n\n            if (_flatten)\n            {\n                var canonicalSymbols = this.Select(kvp => kvp.Key);\n                return PandasConverter.ConcatDataFrames(dataFrames, keys: canonicalSymbols, names: _flattenedDfIndexNames, sort: false);\n            }\n\n            return PandasConverter.ConcatDataFrames(dataFrames, sort: false);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/BaseContract.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Python;\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines a base for a single contract, like an option or future contract\n    /// </summary>\n    public abstract class BaseContract : ISymbolProvider\n    {\n        /// <summary>\n        /// Gets the contract's symbol\n        /// </summary>\n        [PandasIgnore]\n        public Symbol Symbol\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// The security identifier of the symbol\n        /// </summary>\n        [PandasIgnore]\n        public SecurityIdentifier ID => Symbol.ID;\n\n        /// <summary>\n        /// Gets the underlying security's symbol\n        /// </summary>\n        public Symbol UnderlyingSymbol => Symbol.Underlying;\n\n        /// <summary>\n        /// Gets the expiration date\n        /// </summary>\n        public DateTime Expiry => Symbol.ID.Date;\n\n        /// <summary>\n        /// Gets the local date time this contract's data was last updated\n        /// </summary>\n        [PandasIgnore]\n        public DateTime Time\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the open interest\n        /// </summary>\n        public virtual decimal OpenInterest { get; set; }\n\n        /// <summary>\n        /// Gets the last price this contract traded at\n        /// </summary>\n        public virtual decimal LastPrice { get; set; }\n\n        /// <summary>\n        /// Gets the last volume this contract traded at\n        /// </summary>\n        public virtual long Volume { get; set; }\n\n        /// <summary>\n        /// Gets the current bid price\n        /// </summary>\n        public virtual decimal BidPrice { get; set; }\n\n        /// <summary>\n        /// Get the current bid size\n        /// </summary>\n        public virtual long BidSize { get; set; }\n\n        /// <summary>\n        /// Gets the ask price\n        /// </summary>\n        public virtual decimal AskPrice { get; set; }\n\n        /// <summary>\n        /// Gets the current ask size\n        /// </summary>\n        public virtual long AskSize { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseContract\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The contract symbol</param>\n        protected BaseContract(Symbol symbol)\n        {\n            Symbol = symbol;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        public override string ToString() => Symbol.Value;\n\n        /// <summary>\n        /// Updates the contract with the new data, which can be a <see cref=\"Tick\"/> or <see cref=\"TradeBar\"/> or <see cref=\"QuoteBar\"/>\n        /// </summary>\n        internal abstract void Update(BaseData data);\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/BaseRenkoBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents a bar sectioned not by time, but by some amount of movement in a set field,\n    /// where:\n    /// - Open : Gets the opening value that started this bar\n    /// - Close : Gets the closing value or the current value if the bar has not yet closed.\n    /// - High : Gets the highest value encountered during this bar\n    /// - Low : Gets the lowest value encountered during this bar\n    /// </summary>\n    public abstract class BaseRenkoBar : TradeBar, IBaseDataBar\n    {\n        /// <summary>\n        /// Gets the kind of the bar\n        /// </summary>\n        public RenkoType Type { get; protected set; }\n\n        /// <summary>\n        /// The preset size of the consolidated bar\n        /// </summary>\n        public decimal BrickSize  { get; protected set; }\n\n        /// <summary>\n        /// Gets the end time of this renko bar or the most recent update time if it <see cref=\"IsClosed\"/>\n        /// </summary>\n        public override DateTime EndTime { get; set; }\n\n        /// <summary>\n        /// Gets the time this bar started\n        /// </summary>\n        public DateTime Start\n        {\n            get { return Time; }\n            protected set { Time = value; }\n        }\n\n        /// <summary>\n        /// Gets whether or not this bar is considered closed.\n        /// </summary>\n        public virtual bool IsClosed { get; protected set; }\n\n        /// <summary>\n        /// Reader Method :: using set of arguements we specify read out type. Enumerate\n        /// until the end of the data stream or file. E.g. Read CSV file line by line and convert\n        /// into data types.\n        /// </summary>\n        /// <returns>BaseData type set by Subscription Method.</returns>\n        /// <param name=\"config\">Config.</param>\n        /// <param name=\"line\">Line.</param>\n        /// <param name=\"date\">Date.</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            throw new NotSupportedException(\"RenkoBar does not support the Reader function. This function should never be called on this type.\");\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            throw new NotSupportedException(\"RenkoBar does not support the GetSource function. This function should never be called on this type.\");\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Market/DataDictionary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Common.Util;\nusing QuantConnect.Python;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Provides a base class for types holding base data instances keyed by symbol\n    /// </summary>\n    [PandasNonExpandable]\n    public class DataDictionary<T> : BaseExtendedDictionary<Symbol, T>\n    {\n        /// <summary>\n        /// Used to cache the sorted items in the dictionary.\n        /// We do this instead of using a SortedDictionary to keep the O(1) access time.\n        /// </summary>\n        private List<KeyValuePair<Symbol, T>> _items;\n        private List<Symbol> _keys;\n        private List<T> _values;\n\n        /// <summary>\n        /// Gets or sets the time associated with this collection of data\n        /// </summary>\n        public DateTime Time { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Data.Market.DataDictionary{T}\"/> class.\n        /// </summary>\n        public DataDictionary() : base()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Data.Market.DataDictionary{T}\"/> class\n        /// using the specified <paramref name=\"data\"/> as a data source\n        /// </summary>\n        /// <param name=\"data\">The data source for this data dictionary</param>\n        /// <param name=\"keySelector\">Delegate used to select a key from the value</param>\n        public DataDictionary(IEnumerable<T> data, Func<T, Symbol> keySelector)\n            : base(data, keySelector)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Data.Market.DataDictionary{T}\"/> class.\n        /// </summary>\n        /// <param name=\"time\">The time this data was emitted.</param>\n        public DataDictionary(DateTime time) : base()\n        {\n            Time = time;\n        }\n\n        /// <summary>\n        /// Gets or sets the element with the specified key.\n        /// </summary>\n        public override T this[Symbol symbol]\n        {\n            get\n            {\n                T data;\n                if (TryGetValue(symbol, out data))\n                {\n                    return data;\n                }\n                CheckForImplicitlyCreatedSymbol(symbol);\n                throw new KeyNotFoundException($\"'{symbol}' wasn't found in the {GetType().GetBetterTypeName()} object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with data.ContainsKey(\\\"{symbol}\\\")\");\n            }\n            set\n            {\n                _items = null;\n                base[symbol] = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the value associated with the specified key.\n        /// </summary>\n        public virtual T GetValue(Symbol key)\n        {\n            T value;\n            TryGetValue(key, out value);\n            return value;\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<Symbol, T>> GetItems()\n        {\n            if (_items == null)\n            {\n                _items = base.GetItems().OrderBy(x => x.Key).ToList();\n            }\n            return _items;\n        }\n\n        /// <summary>\n        /// Gets a collection containing the keys of the dictionary\n        /// </summary>\n        public override ICollection<Symbol> Keys\n        {\n            get\n            {\n                if (_keys == null)\n                {\n                    _keys = (_items == null ? base.Keys.OrderBy(x => x) : _items.Select(x => x.Key)).ToList();\n                }\n                return _keys;\n            }\n        }\n\n        /// <summary>\n        /// Gets a collection containing the values of the dictionary\n        /// </summary>\n        public override ICollection<T> Values\n        {\n            get\n            {\n                if (_values == null)\n                {\n                    var items = _items == null\n                        ? base.GetItems().OrderBy(x => x.Key)\n                        : (IEnumerable<KeyValuePair<Symbol, T>>)_items;\n                    _values = items.Select(x => x.Value).ToList();\n                }\n                return _values;\n            }\n        }\n\n        /// <summary>\n        /// Gets a collection containing the keys in the dictionary\n        /// </summary>\n        protected override IEnumerable<Symbol> GetKeys => Keys;\n\n        /// <summary>\n        /// Gets a collection containing the values in the dictionary\n        /// </summary>\n        protected override IEnumerable<T> GetValues => Values;\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the dictionary\n        /// </summary>\n        /// <returns>An enumerator for the dictionary</returns>\n        public override IEnumerator<KeyValuePair<Symbol, T>> GetEnumerator()\n        {\n            return GetItems().GetEnumerator();\n        }\n\n        /// <summary>\n        /// Removes all items from the dictionary\n        /// </summary>\n        public override void Clear()\n        {\n            ClearCache();\n            base.Clear();\n        }\n\n        /// <summary>\n        /// Removes the value with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key of the element to remove</param>\n        /// <returns>true if the element was successfully found and removed; otherwise, false</returns>\n        public override bool Remove(Symbol key)\n        {\n            ClearCache();\n            return base.Remove(key);\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to remove</param>\n        /// <returns>true if the key-value pair was successfully removed; otherwise, false</returns>\n        public override bool Remove(KeyValuePair<Symbol, T> item)\n        {\n            ClearCache();\n            return base.Remove(item);\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key and value to the dictionary\n        /// </summary>\n        /// <param name=\"key\">The key of the element to add</param>\n        /// <param name=\"value\">The value of the element to add</param>\n        public override void Add(Symbol key, T value)\n        {\n            ClearCache();\n            base.Add(key, value);\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key-value pair to the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to add</param>\n        public override void Add(KeyValuePair<Symbol, T> item)\n        {\n            ClearCache();\n            base.Add(item);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void ClearCache()\n        {\n            _items = null;\n            _keys = null;\n            _values = null;\n        }\n    }\n\n    /// <summary>\n    /// Provides extension methods for the DataDictionary class\n    /// </summary>\n    public static class DataDictionaryExtensions\n    {\n        /// <summary>\n        /// Provides a convenience method for adding a base data instance to our data dictionary\n        /// </summary>\n        public static void Add<T>(this DataDictionary<T> dictionary, T data)\n            where T : BaseData\n        {\n            dictionary.Add(data.Symbol, data);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Delisting.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Delisting event of a security\n    /// </summary>\n    public class Delisting : BaseData\n    {\n        /// <summary>\n        /// Gets the type of delisting, warning or delisted\n        /// A <see cref=\"DelistingType.Warning\"/> is sent\n        /// </summary>\n        [JsonProperty]\n        public DelistingType Type { get; private set; }\n\n        /// <summary>\n        /// Gets the <see cref=\"OrderTicket\"/> that was submitted to liquidate this position\n        /// </summary>\n        public OrderTicket Ticket { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Delisting\"/> class\n        /// </summary>\n        public Delisting()\n        {\n            DataType = MarketDataType.Auxiliary;\n            Type = DelistingType.Delisted;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Delisting\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The delisted symbol</param>\n        /// <param name=\"date\">The date the symbol was delisted</param>\n        /// <param name=\"price\">The final price before delisting</param>\n        /// <param name=\"type\">The type of delisting event</param>\n        public Delisting(Symbol symbol, DateTime date, decimal price, DelistingType type)\n            : this()\n        {\n            Symbol = symbol;\n            Time = date;\n            Value = price;\n            Type = type;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"OrderTicket\"/> used to liquidate this position\n        /// </summary>\n        /// <param name=\"ticket\">The ticket that represents the order to liquidate this position</param>\n        public void SetOrderTicket(OrderTicket ticket)\n        {\n            Ticket = ticket;\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            throw new NotImplementedException(\"This method is not supposed to be called on the Delisting type.\");\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new Delisting(Symbol, Time, Price, Type);\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            var type = Type == DelistingType.Warning ? \"Delisting Warning\" : \"Delisted\";\n            return $\"{type}: {Symbol} {EndTime}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Delistings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collections of <see cref=\"Delisting\"/> keyed by <see cref=\"Symbol\"/>\n    /// </summary>\n    public class Delistings : DataDictionary<Delisting>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Delistings\"/> dictionary\n        /// </summary>\n        public Delistings()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Delistings\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public Delistings(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Dividend.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing ProtoBuf;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Dividend event from a security\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class Dividend : BaseData\n    {\n        /// <summary>\n        /// Gets the dividend payment\n        /// </summary>\n        [ProtoMember(10)]\n        public decimal Distribution\n        {\n            get { return Value; }\n            set { Value = value; }\n        }\n\n        /// <summary>\n        /// Gets the price at which the dividend occurred.\n        /// This is typically the previous day's closing price\n        /// </summary>\n        [ProtoMember(11)]\n        public decimal ReferencePrice\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Dividend class\n        /// </summary>\n        public Dividend()\n        {\n            DataType = MarketDataType.Auxiliary;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Dividend class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"distribution\">The dividend amount</param>\n        /// <param name=\"referencePrice\">The previous day's closing price</param>\n        public Dividend(Symbol symbol, DateTime date, decimal distribution, decimal referencePrice)\n            : this()\n        {\n            Symbol = symbol;\n            Time = date;\n            Distribution = distribution;\n            ReferencePrice = referencePrice;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Dividend class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"referencePrice\">The previous day's closing price</param>\n        /// <param name=\"priceFactorRatio\">The ratio of the price factors, pf_i/pf_i+1</param>\n        /// <param name=\"decimalPlaces\">The number of decimal places to round the dividend's distribution to, defaulting to 2</param>\n        public static Dividend Create(Symbol symbol, DateTime date, decimal referencePrice, decimal priceFactorRatio, int decimalPlaces = 2)\n        {\n            var distribution = ComputeDistribution(referencePrice, priceFactorRatio, decimalPlaces);\n            return new Dividend(symbol, date, distribution, referencePrice);\n        }\n\n        /// <summary>\n        /// Computes the price factor ratio given the previous day's closing price and the p\n        /// </summary>\n        /// <param name=\"close\">Previous day's closing price</param>\n        /// <param name=\"priceFactorRatio\">Price factor ratio pf_i/pf_i+1</param>\n        /// <param name=\"decimalPlaces\">The number of decimal places to round the result to, defaulting to 2</param>\n        /// <returns>The distribution rounded to the specified number of decimal places, defaulting to 2</returns>\n        public static decimal ComputeDistribution(decimal close, decimal priceFactorRatio, int decimalPlaces)\n        {\n            return Math.Round(close - close * priceFactorRatio, decimalPlaces);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            // this is implemented in the SubscriptionDataReader.CheckForDividend\n            throw new NotImplementedException(\"This method is not supposed to be called on the Dividend type.\");\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            // this data is derived from map files and factor files in backtesting\n            return null;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new Dividend\n            {\n                Time = Time,\n                Value = Value,\n                Symbol = Symbol,\n                EndTime = EndTime,\n                DataType = DataType,\n                Distribution = Distribution,\n                ReferencePrice = ReferencePrice\n            };\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            return Invariant($\"Dividend: {Symbol}: {Distribution} | {ReferencePrice}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Dividends.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of dividends keyed by <see cref=\"Symbol\"/>\n    /// </summary>\n    public class Dividends : DataDictionary<Dividend>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Dividends\"/> dictionary\n        /// </summary>\n        public Dividends()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Dividends\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public Dividends(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/FuturesChain.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents an entire chain of futures contracts for a single underlying\n    /// This type is <see cref=\"IEnumerable{FuturesContract}\"/>\n    /// </summary>\n    public class FuturesChain : BaseChain<FuturesContract, FuturesContracts>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesChain\"/> class\n        /// </summary>\n        /// <param name=\"canonicalFutureSymbol\">The symbol for this chain.</param>\n        /// <param name=\"time\">The time of this chain</param>\n        /// <param name=\"flatten\">Whether to flatten the data frame</param>\n        public FuturesChain(Symbol canonicalFutureSymbol, DateTime time, bool flatten = true)\n            : base(canonicalFutureSymbol, time, MarketDataType.FuturesChain, flatten)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesChain\"/> class\n        /// </summary>\n        /// <param name=\"canonicalFutureSymbol\">The symbol for this chain.</param>\n        /// <param name=\"time\">The time of this chain</param>\n        /// <param name=\"contracts\">The list of contracts that form this chain</param>\n        /// <param name=\"flatten\">Whether to flatten the data frame</param>\n        public FuturesChain(Symbol canonicalFutureSymbol, DateTime time, IEnumerable<FutureUniverse> contracts, bool flatten = true)\n            : this(canonicalFutureSymbol, time, flatten)\n        {\n            foreach (var contractData in contracts)\n            {\n                if (contractData.Symbol.ID.Date.Date < time.Date) continue;\n                Contracts[contractData.Symbol] = new FuturesContract(contractData);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesChain\"/> class as a clone of the specified instance\n        /// </summary>\n        private FuturesChain(FuturesChain other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new FuturesChain(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/FuturesChains.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"FuturesChain\"/> keyed by canonical futures symbol\n    /// </summary>\n    public class FuturesChains : BaseChains<FuturesChain, FuturesContract, FuturesContracts>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FuturesChains\"/> dictionary\n        /// </summary>\n        public FuturesChains()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FuturesChains\"/> dictionary\n        /// </summary>\n        public FuturesChains(bool flatten)\n            : base(flatten)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FuturesChains\"/> dictionary\n        /// </summary>\n        public FuturesChains(DateTime time, bool flatten = true)\n            : base(time, flatten)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/FuturesContract.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines a single futures contract at a specific expiration\n    /// </summary>\n    public class FuturesContract : BaseContract\n    {\n        private FutureUniverse _universeData;\n        private TradeBar _tradeBar;\n        private QuoteBar _quoteBar;\n        private Tick _tradeTick;\n        private Tick _quoteTick;\n        private Tick _openInterest;\n\n        /// <summary>\n        /// Gets the open interest\n        /// </summary>\n        public override decimal OpenInterest\n        {\n            get\n            {\n                // Contract universe data is prioritized\n                if (_universeData != null)\n                {\n                    return _universeData.OpenInterest;\n                }\n                return _openInterest?.Value ?? decimal.Zero;\n            }\n        }\n\n        /// <summary>\n        /// Gets the last price this contract traded at\n        /// </summary>\n        public override decimal LastPrice\n        {\n            get\n            {\n                if (_universeData != null)\n                {\n                    return _universeData.Close;\n                }\n\n                if (_tradeBar == null && _tradeTick == null)\n                {\n                    return decimal.Zero;\n                }\n                if (_tradeBar != null)\n                {\n                    return _tradeTick != null && _tradeTick.EndTime > _tradeBar.EndTime ? _tradeTick.Price : _tradeBar.Close;\n                }\n                return _tradeTick.Price;\n            }\n        }\n\n        /// <summary>\n        /// Gets the last volume this contract traded at\n        /// </summary>\n        public override long Volume\n        {\n            get\n            {\n                if (_universeData != null)\n                {\n                    return (long)_universeData.Volume;\n                }\n\n                if (_tradeBar == null && _tradeTick == null)\n                {\n                    return 0L;\n                }\n                if (_tradeBar != null)\n                {\n                    return (long)(_tradeTick != null && _tradeTick.EndTime > _tradeBar.EndTime ? _tradeTick.Quantity : _tradeBar.Volume);\n                }\n                return (long)_tradeTick.Quantity;\n            }\n        }\n\n        /// <summary>\n        /// Get the current bid price\n        /// </summary>\n        public override decimal BidPrice\n        {\n            get\n            {\n                if (_universeData != null)\n                {\n                    return _universeData.Close;\n                }\n                if (_quoteBar == null && _quoteTick == null)\n                {\n                    return decimal.Zero;\n                }\n                if (_quoteBar != null)\n                {\n                    var quoteBarPrice = _quoteBar.Bid?.Close ?? decimal.Zero;\n                    if (_quoteTick != null)\n                    {\n                        return _quoteTick.EndTime > _quoteBar.EndTime ? _quoteTick.BidPrice : quoteBarPrice;\n                    }\n                    return quoteBarPrice;\n                }\n                return _quoteTick.BidPrice;\n            }\n        }\n\n        /// <summary>\n        /// Get the current bid size\n        /// </summary>\n        public override long BidSize\n        {\n            get\n            {\n                if (_quoteBar == null && _quoteTick == null)\n                {\n                    return 0;\n                }\n                if (_quoteBar != null)\n                {\n                    return (long)(_quoteTick != null && _quoteTick.EndTime > _quoteBar.EndTime ? _quoteTick.BidSize : _quoteBar.LastBidSize);\n                }\n                return (long)_quoteTick.BidSize;\n            }\n        }\n\n        /// <summary>\n        /// Gets the current ask price\n        /// </summary>\n        public override decimal AskPrice\n        {\n            get\n            {\n                if (_universeData != null)\n                {\n                    return _universeData.Close;\n                }\n                if (_quoteBar == null && _quoteTick == null)\n                {\n                    return decimal.Zero;\n                }\n                if (_quoteBar != null)\n                {\n                    var quoteBarPrice = _quoteBar.Ask?.Close ?? decimal.Zero;\n                    if (_quoteTick != null)\n                    {\n                        return _quoteTick.EndTime > _quoteBar.EndTime ? _quoteTick.AskPrice : quoteBarPrice;\n                    }\n                    return quoteBarPrice;\n                }\n                return _quoteTick.AskPrice;\n            }\n        }\n\n        /// <summary>\n        /// Get the current ask size\n        /// </summary>\n        public override long AskSize\n        {\n            get\n            {\n                if (_quoteBar == null && _quoteTick == null)\n                {\n                    return 0;\n                }\n                if (_quoteBar != null)\n                {\n                    return (long)(_quoteTick != null && _quoteTick.EndTime > _quoteBar.EndTime ? _quoteTick.AskSize : _quoteBar.LastAskSize);\n                }\n                return (long)_quoteTick.AskSize;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesContract\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The futures contract symbol</param>\n        public FuturesContract(Symbol symbol)\n            : base(symbol)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesContract\"/> class\n        /// </summary>\n        /// <param name=\"contractData\">The contract universe data</param>\n        public FuturesContract(FutureUniverse contractData)\n            : base(contractData.Symbol)\n        {\n            _universeData = contractData;\n        }\n\n        /// <summary>\n        /// Implicit conversion into <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"contract\">The option contract to be converted</param>\n        public static implicit operator Symbol(FuturesContract contract)\n        {\n            return contract.Symbol;\n        }\n\n        /// <summary>\n        /// Updates the future contract with the new data, which can be a <see cref=\"Tick\"/> or <see cref=\"TradeBar\"/> or <see cref=\"QuoteBar\"/>\n        /// </summary>\n        internal override void Update(BaseData data)\n        {\n            switch (data)\n            {\n                case TradeBar tradeBar:\n                    _tradeBar = tradeBar;\n                    break;\n\n                case QuoteBar quoteBar:\n                    _quoteBar = quoteBar;\n                    break;\n\n                case Tick tick when tick.TickType == TickType.Trade:\n                    _tradeTick = tick;\n                    break;\n\n                case Tick tick when tick.TickType == TickType.Quote:\n                    _quoteTick = tick;\n                    break;\n\n                case Tick tick when tick.TickType == TickType.OpenInterest:\n                    _openInterest = tick;\n                    break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/FuturesContracts.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"FuturesContract\"/> keyed by futures symbol\n    /// </summary>\n    public class FuturesContracts : DataDictionary<FuturesContract>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FuturesContracts\"/> dictionary\n        /// </summary>\n        public FuturesContracts()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FuturesContracts\"/> dictionary\n        /// </summary>\n        public FuturesContracts(DateTime time)\n            : base(time)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Greeks.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines the greeks\n    /// </summary>\n    public class Greeks\n    {\n        /// <summary>\n        /// Gets the delta.\n        /// <para>\n        /// Delta measures the rate of change of the option value with respect to changes in\n        /// the underlying asset'sprice. (∂V/∂S)\n        /// </para>\n        /// </summary>\n        public virtual decimal Delta { get; set; }\n\n        /// <summary>\n        /// Gets the gamma.\n        /// <para>\n        /// Gamma measures the rate of change of Delta with respect to changes in\n        /// the underlying asset'sprice. (∂²V/∂S²)\n        /// </para>\n        /// </summary>\n        public virtual decimal Gamma { get; set; }\n\n        /// <summary>\n        /// Gets the vega.\n        /// <para>\n        /// Vega measures the rate of change of the option value with respect to changes in\n        /// the underlying's volatility. (∂V/∂σ)\n        /// </para>\n        /// </summary>\n        public virtual decimal Vega { get; set; }\n\n        /// <summary>\n        /// Gets the theta.\n        /// <para>\n        /// Theta measures the rate of change of the option value with respect to changes in\n        /// time. This is commonly known as the 'time decay.' (∂V/∂τ)\n        /// </para>\n        /// </summary>\n        public virtual decimal Theta { get; set; }\n\n        /// <summary>\n        /// Gets the rho.\n        /// <para>\n        /// Rho measures the rate of change of the option value with respect to changes in\n        /// the risk free interest rate. (∂V/∂r)\n        /// </para>\n        /// </summary>\n        public virtual decimal Rho { get; set; }\n\n        /// <summary>\n        /// Gets the lambda.\n        /// <para>\n        /// Lambda is the percentage change in option value per percentage change in the\n        /// underlying's price, a measure of leverage. Sometimes referred to as gearing.\n        /// (∂V/∂S ✕ S/V)\n        /// </para>\n        /// </summary>\n        [PandasIgnore]\n        public virtual decimal Lambda { get; set; }\n\n        /// <summary>\n        /// Gets the lambda.\n        /// <para>\n        /// Lambda is the percentage change in option value per percentage change in the\n        /// underlying's price, a measure of leverage. Sometimes referred to as gearing.\n        /// (∂V/∂S ✕ S/V)\n        /// </para>\n        /// </summary>\n        /// <remarks>\n        /// Alias for <see cref=\"Lambda\"/> required for compatibility with Python when\n        /// PEP8 API is used (lambda is a reserved keyword in Python).\n        /// </remarks>\n        [PandasIgnore]\n        public virtual decimal Lambda_\n        {\n            get { return Lambda; }\n            set { Lambda = value; }\n        }\n\n        /// <summary>\n        /// Gets the theta per day.\n        /// <para>\n        /// Theta measures the rate of change of the option value with respect to changes in\n        /// time. This is commonly known as the 'time decay.' (∂V/∂τ)\n        /// </para>\n        /// </summary>\n        [PandasIgnore]\n        public virtual decimal ThetaPerDay\n        {\n            get { return Theta / 365m; }\n            set { Theta = value * 365m; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Greeks\"/> class.\n        /// </summary>\n        public Greeks()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Greeks\"/> class with specified values.\n        /// </summary>\n        public Greeks(decimal delta, decimal gamma, decimal vega, decimal theta, decimal rho, decimal lambda)\n        {\n            Delta = delta;\n            Gamma = gamma;\n            Vega = vega;\n            Theta = theta;\n            Rho = rho;\n            Lambda = lambda;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/IBar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Generic bar interface with Open, High, Low and Close.\n    /// </summary>\n    public interface IBar\n    {\n        /// <summary>\n        /// Opening price of the bar: Defined as the price at the start of the time period.\n        /// </summary>\n        decimal Open { get; }\n\n        /// <summary>\n        /// High price of the bar during the time period.\n        /// </summary>\n        decimal High { get; }\n\n        /// <summary>\n        /// Low price of the bar during the time period.\n        /// </summary>\n        decimal Low { get; }\n\n        /// <summary>\n        /// Closing price of the bar. Defined as the price at Start Time + TimeSpan.\n        /// </summary>\n        decimal Close { get; }\n    }\n}"
  },
  {
    "path": "Common/Data/Market/IBaseDataBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents a type that is both a bar and base data\n    /// </summary>\n    public interface IBaseDataBar : IBaseData, IBar\n    {\n    }\n}"
  },
  {
    "path": "Common/Data/Market/MarginInterestRate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing System.IO;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Margin interest rate data source\n    /// </summary>\n    /// <remarks>This is useful to model margin costs</remarks>\n    public class MarginInterestRate : BaseData\n    {\n        /// <summary>\n        /// The interest rate value\n        /// </summary>\n        public decimal InterestRate { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public MarginInterestRate()\n        {\n            DataType = MarketDataType.Auxiliary;\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            var dateTime = stream.GetDateTime(\"yyyyMMdd HH:mm:ss\");\n            var interestRate = stream.GetDecimal();\n            return new MarginInterestRate {\n                Time = dateTime,\n                InterestRate = Value = interestRate,\n                Symbol = config.Symbol\n            };\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var identifier = config.Symbol.ID;\n            var source = Path.Combine(Globals.DataFolder,\n                identifier.SecurityType.SecurityTypeToLower(),\n                identifier.Market.ToLowerInvariant(),\n                \"margin_interest\",\n                $\"{identifier.Symbol.ToLowerInvariant()}.csv\"\n            );\n\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Specifies the data time zone for this data type. This is useful for custom data types\n        /// </summary>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Symbol}: Rate {InterestRate}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/MarginInterestRates.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of dividends keyed by <see cref=\"Symbol\"/>\n    /// </summary>\n    public class MarginInterestRates : DataDictionary<MarginInterestRate>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarginInterestRate\"/> dictionary\n        /// </summary>\n        public MarginInterestRates()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarginInterestRate\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public MarginInterestRates(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/ModeledGreeks.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines the greeks\n    /// </summary>\n    internal class ModeledGreeks : Greeks\n    {\n        private Lazy<decimal> _delta;\n        private Lazy<decimal> _gamma;\n        private Lazy<decimal> _vega;\n        private Lazy<decimal> _theta;\n        private Lazy<decimal> _rho;\n        private Lazy<decimal> _lambda;\n\n        /// <summary>\n        /// Gets the delta\n        /// </summary>\n        public override decimal Delta => _delta.Value;\n\n        /// <summary>\n        /// Gets the gamma\n        /// </summary>\n        public override decimal Gamma => _gamma.Value;\n\n        /// <summary>\n        /// Gets the vega\n        /// </summary>\n        public override decimal Vega => _vega.Value;\n\n        /// <summary>\n        /// Gets the theta\n        /// </summary>\n        public override decimal Theta => _theta.Value;\n\n        /// <summary>\n        /// Gets the rho\n        /// </summary>\n        public override decimal Rho => _rho.Value;\n\n        /// <summary>\n        /// Gets the lambda\n        /// </summary>\n        public override decimal Lambda => _lambda.Value;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModeledGreeks\"/> class\n        /// </summary>\n        public ModeledGreeks(Func<decimal> delta, Func<decimal> gamma, Func<decimal> vega, Func<decimal> theta, Func<decimal> rho, Func<decimal> lambda)\n        {\n            _delta = new Lazy<decimal>(delta, isThreadSafe: false);\n            _gamma = new Lazy<decimal>(gamma, isThreadSafe: false);\n            _vega = new Lazy<decimal>(vega, isThreadSafe: false);\n            _theta = new Lazy<decimal>(theta, isThreadSafe: false);\n            _rho = new Lazy<decimal>(rho, isThreadSafe: false);\n            _lambda = new Lazy<decimal>(lambda, isThreadSafe: false);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/NullGreeks.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines greeks that are all zero\n    /// </summary>\n    internal class NullGreeks : Greeks\n    {\n        /// <summary>\n        /// Singleton instance of <see cref=\"NullGreeks\"/>\n        /// </summary>\n        public static readonly NullGreeks Instance = new NullGreeks();\n\n        /// <summary>\n        /// Gets the delta\n        /// </summary>\n        public override decimal Delta => decimal.Zero;\n\n        /// <summary>\n        /// Gets the gamma\n        /// </summary>\n        public override decimal Gamma => decimal.Zero;\n\n        /// <summary>\n        /// Gets the vega\n        /// </summary>\n        public override decimal Vega => decimal.Zero;\n\n        /// <summary>\n        /// Gets the theta\n        /// </summary>\n        public override decimal Theta => decimal.Zero;\n\n        /// <summary>\n        /// Gets the rho\n        /// </summary>\n        public override decimal Rho => decimal.Zero;\n\n        /// <summary>\n        /// Gets the lambda\n        /// </summary>\n        public override decimal Lambda => decimal.Zero;\n\n        private NullGreeks()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/OpenInterest.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Util;\nusing System;\nusing ProtoBuf;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines a data type that represents open interest for given security\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class OpenInterest : Tick\n    {\n        /// <summary>\n        /// Initializes a new instance of the OpenInterest class\n        /// </summary>\n        public OpenInterest()\n        {\n            DataType = MarketDataType.Tick;\n            TickType = TickType.OpenInterest;\n            Value = 0;\n            Time = new DateTime();\n            Symbol = Symbol.Empty;\n        }\n\n        /// <summary>\n        /// Cloner constructor for fill forward engine implementation. Clone the original OI into this new one:\n        /// </summary>\n        /// <param name=\"original\">Original OI we're cloning</param>\n        public OpenInterest(OpenInterest original)\n        {\n            DataType = MarketDataType.Tick;\n            TickType = TickType.OpenInterest;\n            Value = original.Value;\n            Time = original.Time;\n            Symbol = original.Symbol;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OpenInterest class with data\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"openInterest\">Open Interest value</param>\n        public OpenInterest(DateTime time, Symbol symbol, decimal openInterest)\n        {\n            DataType = MarketDataType.Tick;\n            TickType = TickType.OpenInterest;\n            Time = time;\n            Symbol = symbol;\n            Value = openInterest;\n        }\n\n        /// <summary>\n        /// Constructor for QuantConnect open interest data\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"symbol\">Symbol for underlying asset</param>\n        /// <param name=\"line\">CSV line of data from QC OI csv</param>\n        /// <param name=\"baseDate\">The base date of the OI</param>\n        public OpenInterest(SubscriptionDataConfig config, Symbol symbol, string line, DateTime baseDate)\n        {\n            var csv = line.Split(',');\n            DataType = MarketDataType.Tick;\n            TickType = TickType.OpenInterest;\n            Symbol = symbol;\n\n            Time = (config.Resolution == Resolution.Daily || config.Resolution == Resolution.Hour) ?\n                // hourly and daily have different time format, and can use slow, robust c# parser.\n                DateTime.ParseExact(csv[0], DateFormat.TwelveCharacter,\n                    System.Globalization.CultureInfo.InvariantCulture)\n                    .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone)\n                :\n                // Using custom \"ToDecimal\" conversion for speed on high resolution data.\n                baseDate.Date.AddMilliseconds(csv[0].ToInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n            Value = csv[1].ToDecimal();\n        }\n\n        /// <summary>\n        /// Parse an open interest data line from quantconnect zip source files.\n        /// </summary>\n        /// <param name=\"line\">CSV source line of the compressed source</param>\n        /// <param name=\"date\">Base date for the open interest (date is stored as int milliseconds since midnight)</param>\n        /// <param name=\"config\">Subscription configuration object</param>\n        public OpenInterest(SubscriptionDataConfig config, string line, DateTime date):\n            this(config, config.Symbol, line, date)\n        {\n        }\n\n        /// <summary>\n        /// Tick implementation of reader method: read a line of data from the source and convert it to an open interest object.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration object for algorithm</param>\n        /// <param name=\"line\">Line from the datafeed source</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>New initialized open interest object</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // currently OIs don't come through the reader function\n                return new OpenInterest();\n            }\n\n            return new OpenInterest(config, line, date);\n        }\n\n        /// <summary>\n        /// Get source for OI data feed - not used with QuantConnect data sources implementation.\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source request if source spread across multiple files</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String source location of the file to be opened with a stream</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // this data type is streamed in live mode\n                return new SubscriptionDataSource(string.Empty, SubscriptionTransportMedium.Streaming);\n            }\n\n            var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n            if (config.SecurityType == SecurityType.Future || config.SecurityType.IsOption())\n            {\n                source += \"#\" + LeanData.GenerateZipEntryName(config.Symbol, date, config.Resolution, config.TickType);\n            }\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Clone implementation for open interest class:\n        /// </summary>\n        /// <returns>New tick object clone of the current class values.</returns>\n        public override BaseData Clone()\n        {\n            return new OpenInterest(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/OptionChain.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents an entire chain of option contracts for a single underlying security.\n    /// This type is <see cref=\"IEnumerable{OptionContract}\"/>\n    /// </summary>\n    public class OptionChain : BaseChain<OptionContract, OptionContracts>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionChain\"/> class\n        /// </summary>\n        /// <param name=\"canonicalOptionSymbol\">The symbol for this chain.</param>\n        /// <param name=\"time\">The time of this chain</param>\n        /// <param name=\"flatten\">Whether to flatten the data frame</param>\n        public OptionChain(Symbol canonicalOptionSymbol, DateTime time, bool flatten = true)\n            : base(canonicalOptionSymbol, time, MarketDataType.OptionChain, flatten)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new option chain for a list of contracts as <see cref=\"OptionUniverse\"/> instances\n        /// </summary>\n        /// <param name=\"canonicalOptionSymbol\">The canonical option symbol</param>\n        /// <param name=\"time\">The time of this chain</param>\n        /// <param name=\"contracts\">The list of contracts data</param>\n        /// <param name=\"symbolProperties\">The option symbol properties</param>\n        /// <param name=\"flatten\">Whether to flatten the data frame</param>\n        public OptionChain(Symbol canonicalOptionSymbol, DateTime time, IEnumerable<OptionUniverse> contracts, SymbolProperties symbolProperties,\n            bool flatten = true)\n            : this(canonicalOptionSymbol, time, flatten)\n        {\n            foreach (var contractData in contracts)\n            {\n                Underlying ??= contractData.Underlying;\n                if (contractData.Symbol.ID.Date.Date < time.Date) continue;\n                Contracts[contractData.Symbol] = OptionContract.Create(contractData, symbolProperties);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionChain\"/> class as a clone of the specified instance\n        /// </summary>\n        private OptionChain(OptionChain other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new OptionChain(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/OptionChains.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"OptionChain\"/> keyed by canonical option symbol\n    /// </summary>\n    public class OptionChains : BaseChains<OptionChain, OptionContract, OptionContracts>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionChains\"/> dictionary\n        /// </summary>\n        public OptionChains() : base()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionChains\"/> dictionary\n        /// </summary>\n        public OptionChains(bool flatten)\n            : base(flatten)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionChains\"/> dictionary\n        /// </summary>\n        public OptionChains(DateTime time, bool flatten = true)\n            : base(time, flatten)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"OptionChain\"/> for the symbol, converting to canonical if needed.\n        /// </summary>\n        public override OptionChain this[Symbol symbol]\n        {\n            get => base[GetCanonicalOptionSymbol(symbol)];\n            set => base[GetCanonicalOptionSymbol(symbol)] = value;\n        }\n\n        /// <summary>\n        /// Tries to get the <see cref=\"OptionChain\"/> for the given symbol.\n        /// Converts to the canonical option symbol if needed before attempting retrieval.\n        /// </summary>\n        public override bool TryGetValue(Symbol key, out OptionChain value)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(key);\n            return base.TryGetValue(canonicalSymbol, out value);\n        }\n\n        /// <summary>\n        /// Checks if an <see cref=\"OptionChain\"/> exists for the given symbol.\n        /// Converts to the canonical option symbol first if needed.\n        /// </summary>\n        public override bool ContainsKey(Symbol key)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(key);\n            return base.ContainsKey(canonicalSymbol);\n        }\n\n        /// <summary>\n        /// Adds the specified symbol and chain to the dictionary, converting to canonical if needed.\n        /// </summary>\n        public override void Add(Symbol key, OptionChain value)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(key);\n            base.Add(canonicalSymbol, value);\n        }\n\n        /// <summary>\n        /// Removes the element with the specified key, converting to canonical if needed.\n        /// </summary>\n        public override bool Remove(Symbol key)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(key);\n            return base.Remove(canonicalSymbol);\n        }\n\n        /// <summary>\n        /// Determines if the dictionary contains the specific key-value pair, converting key to canonical if needed.\n        /// </summary>\n        public override bool Contains(KeyValuePair<Symbol, OptionChain> item)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(item.Key);\n            return base.Contains(new KeyValuePair<Symbol, OptionChain>(canonicalSymbol, item.Value));\n        }\n\n        /// <summary>\n        /// Removes the specific key-value pair, converting key to canonical if needed.\n        /// </summary>\n        public override bool Remove(KeyValuePair<Symbol, OptionChain> item)\n        {\n            var canonicalSymbol = GetCanonicalOptionSymbol(item.Key);\n            return base.Remove(new KeyValuePair<Symbol, OptionChain>(canonicalSymbol, item.Value));\n        }\n\n        private static Symbol GetCanonicalOptionSymbol(Symbol symbol)\n        {\n            if (symbol.SecurityType.HasOptions())\n            {\n                return Symbol.CreateCanonicalOption(symbol);\n            }\n\n            if (symbol.SecurityType.IsOption())\n            {\n                return symbol.Canonical;\n            }\n\n            return symbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/OptionContract.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Defines a single option contract at a specific expiration and strike price\n    /// </summary>\n    public class OptionContract : BaseContract\n    {\n        private IOptionData _optionData = OptionPriceModelResultData.Null;\n        private readonly SymbolProperties _symbolProperties;\n\n        /// <summary>\n        /// Gets the strike price\n        /// </summary>\n        public decimal Strike => Symbol.ID.StrikePrice;\n\n        /// <summary>\n        /// Gets the strike price multiplied by the strike multiplier\n        /// </summary>\n        public decimal ScaledStrike => Strike * _symbolProperties.StrikeMultiplier;\n\n        /// <summary>\n        /// Gets the right being purchased (call [right to buy] or put [right to sell])\n        /// </summary>\n        public OptionRight Right => Symbol.ID.OptionRight;\n\n        /// <summary>\n        /// Gets the option style\n        /// </summary>\n        public OptionStyle Style => Symbol.ID.OptionStyle;\n\n        /// <summary>\n        /// Gets the theoretical price of this option contract as computed by the <see cref=\"IOptionPriceModel\"/>\n        /// </summary>\n        public decimal TheoreticalPrice => _optionData.TheoreticalPrice;\n\n        /// <summary>\n        /// Gets the implied volatility of the option contract as computed by the <see cref=\"IOptionPriceModel\"/>\n        /// </summary>\n        public decimal ImpliedVolatility => _optionData.ImpliedVolatility;\n\n        /// <summary>\n        /// Gets the greeks for this contract\n        /// </summary>\n        public Greeks Greeks => _optionData.Greeks;\n\n        /// <summary>\n        /// Gets the open interest\n        /// </summary>\n        public override decimal OpenInterest => _optionData.OpenInterest;\n\n        /// <summary>\n        /// Gets the last price this contract traded at\n        /// </summary>\n        public override decimal LastPrice => _optionData.LastPrice;\n\n        /// <summary>\n        /// Gets the last volume this contract traded at\n        /// </summary>\n        public override long Volume => _optionData.Volume;\n\n        /// <summary>\n        /// Gets the current bid price\n        /// </summary>\n        public override decimal BidPrice => _optionData.BidPrice;\n\n        /// <summary>\n        /// Get the current bid size\n        /// </summary>\n        public override long BidSize => _optionData.BidSize;\n\n        /// <summary>\n        /// Gets the ask price\n        /// </summary>\n        public override decimal AskPrice => _optionData.AskPrice;\n\n        /// <summary>\n        /// Gets the current ask size\n        /// </summary>\n        public override long AskSize => _optionData.AskSize;\n\n        /// <summary>\n        /// Gets the last price the underlying security traded at\n        /// </summary>\n        public decimal UnderlyingLastPrice => _optionData.UnderlyingLastPrice;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionContract\"/> class\n        /// </summary>\n        /// <param name=\"security\">The option contract security</param>\n        public OptionContract(ISecurityPrice security)\n            : base(security.Symbol)\n        {\n            _symbolProperties = security.SymbolProperties;\n        }\n\n        /// <summary>\n        /// Initializes a new option contract from a given <see cref=\"OptionUniverse\"/> instance\n        /// </summary>\n        /// <param name=\"contractData\">The option universe contract data to use as source for this contract</param>\n        /// <param name=\"symbolProperties\">The contract symbol properties</param>\n        public OptionContract(OptionUniverse contractData, SymbolProperties symbolProperties)\n            : base(contractData.Symbol)\n        {\n            _symbolProperties = symbolProperties;\n            _optionData = new OptionUniverseData(contractData);\n        }\n\n        /// <summary>\n        /// Sets the option price model evaluator function to be used for this contract\n        /// </summary>\n        /// <param name=\"optionPriceModelEvaluator\">Function delegate used to evaluate the option price model</param>\n        internal void SetOptionPriceModel(Func<OptionPriceModelResult> optionPriceModelEvaluator)\n        {\n            _optionData = new OptionPriceModelResultData(optionPriceModelEvaluator, _optionData as OptionPriceModelResultData);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"OptionContract\"/>\n        /// </summary>\n        /// <param name=\"baseData\"></param>\n        /// <param name=\"security\">Provides price properties for a <see cref=\"Security\"/></param>\n        /// <param name=\"underlying\">Last underlying security trade data</param>\n        /// <returns>Option contract</returns>\n        public static OptionContract Create(BaseData baseData, ISecurityPrice security, BaseData underlying)\n            => Create(baseData.EndTime, security, underlying);\n\n        /// <summary>\n        /// Creates a <see cref=\"OptionContract\"/>\n        /// </summary>\n        /// <param name=\"endTime\">local date time this contract's data was last updated</param>\n        /// <param name=\"security\">provides price properties for a <see cref=\"Security\"/></param>\n        /// <param name=\"underlying\">last underlying security trade data</param>\n        /// <returns>Option contract</returns>\n        public static OptionContract Create(DateTime endTime, ISecurityPrice security, BaseData underlying)\n        {\n            var contract = new OptionContract(security)\n            {\n                Time = endTime,\n            };\n            contract._optionData.SetUnderlying(underlying);\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Creates a new option contract from a given <see cref=\"OptionUniverse\"/> instance,\n        /// using its data to form a quote bar to source pricing data\n        /// </summary>\n        /// <param name=\"contractData\">The option universe contract data to use as source for this contract</param>\n        /// <param name=\"symbolProperties\">The contract symbol properties</param>\n        public static OptionContract Create(OptionUniverse contractData, SymbolProperties symbolProperties)\n        {\n            var contract = new OptionContract(contractData, symbolProperties)\n            {\n                Time = contractData.EndTime,\n            };\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Implicit conversion into <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"contract\">The option contract to be converted</param>\n        public static implicit operator Symbol(OptionContract contract)\n        {\n            return contract.Symbol;\n        }\n\n        /// <summary>\n        /// Updates the option contract with the new data, which can be a <see cref=\"Tick\"/> or <see cref=\"TradeBar\"/> or <see cref=\"QuoteBar\"/>\n        /// </summary>\n        internal override void Update(BaseData data)\n        {\n            if (data.Symbol.SecurityType.IsOption())\n            {\n                _optionData.Update(data);\n            }\n            else if (data.Symbol.SecurityType == Symbol.GetUnderlyingFromOptionType(Symbol.SecurityType))\n            {\n                _optionData.SetUnderlying(data);\n            }\n        }\n\n        #region Option Contract Data Handlers\n\n        private interface IOptionData\n        {\n            decimal LastPrice { get; }\n            decimal UnderlyingLastPrice { get; }\n            long Volume { get; }\n            decimal BidPrice { get; }\n            long BidSize { get; }\n            decimal AskPrice { get; }\n            long AskSize { get; }\n            decimal OpenInterest { get; }\n            decimal TheoreticalPrice { get; }\n            decimal ImpliedVolatility { get; }\n            Greeks Greeks { get; }\n\n            void Update(BaseData data);\n\n            void SetUnderlying(BaseData data);\n        }\n\n        /// <summary>\n        /// Handles option data for a contract from actual price data (trade, quote, open interest) and theoretical price model results\n        /// </summary>\n        private class OptionPriceModelResultData : IOptionData\n        {\n            public static readonly OptionPriceModelResultData Null = new(() => OptionPriceModelResult.None);\n\n            private readonly Lazy<OptionPriceModelResult> _optionPriceModelResult;\n            private TradeBar _tradeBar;\n            private QuoteBar _quoteBar;\n            private OpenInterest _openInterest;\n            private BaseData _underlying;\n\n            public decimal LastPrice => _tradeBar?.Close ?? decimal.Zero;\n\n            public decimal UnderlyingLastPrice => _underlying?.Price ?? decimal.Zero;\n\n            public long Volume => (long)(_tradeBar?.Volume ?? 0L);\n\n            public decimal BidPrice => _quoteBar?.Bid?.Close ?? decimal.Zero;\n\n            public long BidSize => (long)(_quoteBar?.LastBidSize ?? 0L);\n\n            public decimal AskPrice => _quoteBar?.Ask?.Close ?? decimal.Zero;\n\n            public long AskSize => (long)(_quoteBar?.LastAskSize ?? 0L);\n\n            public decimal OpenInterest => _openInterest?.Value ?? decimal.Zero;\n\n            public decimal TheoreticalPrice => _optionPriceModelResult.Value.TheoreticalPrice;\n            public decimal ImpliedVolatility => _optionPriceModelResult.Value.ImpliedVolatility;\n            public Greeks Greeks => _optionPriceModelResult.Value.Greeks;\n\n            public OptionPriceModelResultData(Func<OptionPriceModelResult> optionPriceModelEvaluator,\n                OptionPriceModelResultData previousOptionData = null)\n            {\n                _optionPriceModelResult = new(optionPriceModelEvaluator, isThreadSafe: false);\n\n                if (previousOptionData != null)\n                {\n                    _tradeBar = previousOptionData._tradeBar;\n                    _quoteBar = previousOptionData._quoteBar;\n                    _openInterest = previousOptionData._openInterest;\n                    _underlying = previousOptionData._underlying;\n                }\n            }\n\n            public void Update(BaseData data)\n            {\n                switch (data)\n                {\n                    case TradeBar tradeBar:\n                        _tradeBar = tradeBar;\n                        break;\n                    case QuoteBar quoteBar:\n                        _quoteBar = quoteBar;\n                        break;\n                    case OpenInterest openInterest:\n                        _openInterest = openInterest;\n                        break;\n                }\n            }\n\n            public void SetUnderlying(BaseData data)\n            {\n                _underlying = data;\n            }\n        }\n\n        /// <summary>\n        /// Handles option data for a contract from a <see cref=\"OptionUniverse\"/> instance\n        /// </summary>\n        private class OptionUniverseData : IOptionData\n        {\n            private readonly OptionUniverse _contractData;\n\n            public decimal LastPrice => _contractData.Close;\n\n            // TODO: Null check required for FOPs: since OptionUniverse does not support FOPs,\n            // these instances will by \"synthetic\" and will not have underlying data.\n            // Can be removed after FOPs are supported by OptionUniverse\n            public decimal UnderlyingLastPrice => _contractData?.Underlying?.Price ?? decimal.Zero;\n\n            public long Volume => (long)_contractData.Volume;\n\n            public decimal BidPrice => _contractData.Close;\n\n            public long BidSize => 0;\n\n            public decimal AskPrice => _contractData.Close;\n\n            public long AskSize => 0;\n\n            public decimal OpenInterest => _contractData.OpenInterest;\n\n            public decimal TheoreticalPrice => decimal.Zero;\n\n            public decimal ImpliedVolatility => _contractData.ImpliedVolatility;\n\n            public Greeks Greeks => _contractData.Greeks;\n\n            public OptionUniverseData(OptionUniverse contractData)\n            {\n                _contractData = contractData;\n            }\n\n            public void Update(BaseData data)\n            {\n            }\n\n            public void SetUnderlying(BaseData data)\n            {\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/OptionContracts.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"OptionContract\"/> keyed by option symbol\n    /// </summary>\n    public class OptionContracts : DataDictionary<OptionContract>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionContracts\"/> dictionary\n        /// </summary>\n        public OptionContracts()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionContracts\"/> dictionary\n        /// </summary>\n        public OptionContracts(DateTime time)\n            : base(time)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/QuoteBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing ProtoBuf;\nusing QuantConnect.Logging;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// QuoteBar class for second and minute resolution data:\n    /// An OHLC implementation of the QuantConnect BaseData class with parameters for candles.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class QuoteBar : BaseData, IBaseDataBar\n    {\n        // scale factor used in QC equity/option/indexOption data files\n        private const decimal _scaleFactor = 1 / 10000m;\n\n        /// <summary>\n        /// Average bid size\n        /// </summary>\n        [ProtoMember(201)]\n        [PandasColumn(\"bidsize\")]\n        public decimal LastBidSize { get; set; }\n\n        /// <summary>\n        /// Average ask size\n        /// </summary>\n        [ProtoMember(202)]\n        [PandasColumn(\"asksize\")]\n        public decimal LastAskSize { get; set; }\n\n        /// <summary>\n        /// Bid OHLC\n        /// </summary>\n        [ProtoMember(203)]\n        public Bar Bid { get; set; }\n\n        /// <summary>\n        /// Ask OHLC\n        /// </summary>\n        [ProtoMember(204)]\n        public Bar Ask { get; set; }\n\n        /// <summary>\n        /// Opening price of the bar: Defined as the price at the start of the time period.\n        /// </summary>\n        public decimal Open\n        {\n            get\n            {\n                if (Bid != null && Ask != null)\n                {\n                    if (Bid.Open != 0m && Ask.Open != 0m)\n                        return (Bid.Open + Ask.Open) / 2m;\n\n                    if (Bid.Open != 0)\n                        return Bid.Open;\n\n                    if (Ask.Open != 0)\n                        return Ask.Open;\n\n                    return 0m;\n                }\n                if (Bid != null)\n                {\n                    return Bid.Open;\n                }\n                if (Ask != null)\n                {\n                    return Ask.Open;\n                }\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// High price of the QuoteBar during the time period.\n        /// </summary>\n        public decimal High\n        {\n            get\n            {\n                if (Bid != null && Ask != null)\n                {\n                    if (Bid.High != 0m && Ask.High != 0m)\n                        return (Bid.High + Ask.High) / 2m;\n\n                    if (Bid.High != 0)\n                        return Bid.High;\n\n                    if (Ask.High != 0)\n                        return Ask.High;\n\n                    return 0m;\n                }\n                if (Bid != null)\n                {\n                    return Bid.High;\n                }\n                if (Ask != null)\n                {\n                    return Ask.High;\n                }\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Low price of the QuoteBar during the time period.\n        /// </summary>\n        public decimal Low\n        {\n            get\n            {\n                if (Bid != null && Ask != null)\n                {\n                    if (Bid.Low != 0m && Ask.Low != 0m)\n                        return (Bid.Low + Ask.Low) / 2m;\n\n                    if (Bid.Low != 0)\n                        return Bid.Low;\n\n                    if (Ask.Low != 0)\n                        return Ask.Low;\n\n                    return 0m;\n                }\n                if (Bid != null)\n                {\n                    return Bid.Low;\n                }\n                if (Ask != null)\n                {\n                    return Ask.Low;\n                }\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Closing price of the QuoteBar. Defined as the price at Start Time + TimeSpan.\n        /// </summary>\n        public decimal Close\n        {\n            get\n            {\n                if (Bid != null && Ask != null)\n                {\n                    if (Bid.Close != 0m && Ask.Close != 0m)\n                        return (Bid.Close + Ask.Close) / 2m;\n\n                    if (Bid.Close != 0)\n                        return Bid.Close;\n\n                    if (Ask.Close != 0)\n                        return Ask.Close;\n\n                    return 0m;\n                }\n                if (Bid != null)\n                {\n                    return Bid.Close;\n                }\n                if (Ask != null)\n                {\n                    return Ask.Close;\n                }\n                return Value;\n            }\n        }\n\n        /// <summary>\n        /// The closing time of this bar, computed via the Time and Period\n        /// </summary>\n        [PandasIgnore]\n        public override DateTime EndTime\n        {\n            get { return Time + Period; }\n            set { Period = value - Time; }\n        }\n\n        /// <summary>\n        /// The period of this quote bar, (second, minute, daily, ect...)\n        /// </summary>\n        [ProtoMember(205)]\n        [PandasIgnore]\n        public TimeSpan Period { get; set; }\n\n        /// <summary>\n        /// Default initializer to setup an empty quotebar.\n        /// </summary>\n        public QuoteBar()\n        {\n            Symbol = Symbol.Empty;\n            Time = new DateTime();\n            Bid = new Bar();\n            Ask = new Bar();\n            Value = 0;\n            Period = QuantConnect.Time.OneMinute;\n            DataType = MarketDataType.QuoteBar;\n        }\n\n        /// <summary>\n        /// Initialize Quote Bar with Bid(OHLC) and Ask(OHLC) Values:\n        /// </summary>\n        /// <param name=\"time\">DateTime Timestamp of the bar</param>\n        /// <param name=\"symbol\">Market MarketType Symbol</param>\n        /// <param name=\"bid\">Bid OLHC bar</param>\n        /// <param name=\"lastBidSize\">Average bid size over period</param>\n        /// <param name=\"ask\">Ask OLHC bar</param>\n        /// <param name=\"lastAskSize\">Average ask size over period</param>\n        /// <param name=\"period\">The period of this bar, specify null for default of 1 minute</param>\n        public QuoteBar(DateTime time, Symbol symbol, IBar bid, decimal lastBidSize, IBar ask, decimal lastAskSize, TimeSpan? period = null)\n        {\n            Symbol = symbol;\n            Time = time;\n            Bid = bid == null ? null : new Bar(bid.Open, bid.High, bid.Low, bid.Close);\n            Ask = ask == null ? null : new Bar(ask.Open, ask.High, ask.Low, ask.Close);\n            if (Bid != null) LastBidSize = lastBidSize;\n            if (Ask != null) LastAskSize = lastAskSize;\n            Value = Close;\n            Period = period ?? QuantConnect.Time.OneMinute;\n            DataType = MarketDataType.QuoteBar;\n        }\n\n        /// <summary>\n        /// Update the quotebar - build the bar from this pricing information:\n        /// </summary>\n        /// <param name=\"lastTrade\">The last trade price</param>\n        /// <param name=\"bidPrice\">Current bid price</param>\n        /// <param name=\"askPrice\">Current asking price</param>\n        /// <param name=\"volume\">Volume of this trade</param>\n        /// <param name=\"bidSize\">The size of the current bid, if available, if not, pass 0</param>\n        /// <param name=\"askSize\">The size of the current ask, if available, if not, pass 0</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public override void Update(decimal lastTrade, decimal bidPrice, decimal askPrice, decimal volume, decimal bidSize, decimal askSize)\n        {\n            // update our bid and ask bars - handle null values, this is to give good values for midpoint OHLC\n            if (Bid == null && bidPrice != 0) Bid = new Bar(bidPrice, bidPrice, bidPrice, bidPrice);\n            else if (Bid != null) Bid.Update(ref bidPrice);\n\n            if (Ask == null && askPrice != 0) Ask = new Bar(askPrice, askPrice, askPrice, askPrice);\n            else if (Ask != null) Ask.Update(ref askPrice);\n\n            if (bidSize > 0)\n            {\n                LastBidSize = bidSize;\n            }\n\n            if (askSize > 0)\n            {\n                LastAskSize = askSize;\n            }\n\n            // be prepared for updates without trades\n            if (lastTrade != 0) Value = lastTrade;\n            else if (askPrice != 0) Value = askPrice;\n            else if (bidPrice != 0) Value = bidPrice;\n        }\n\n        /// <summary>\n        /// QuoteBar Reader: Fetch the data from the QC storage and feed it line by line into the engine.\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"stream\">The file data stream</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Enumerable iterator for returning each line of the required data.</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            try\n            {\n                switch (config.SecurityType)\n                {\n                    case SecurityType.Equity:\n                        return ParseEquity(config, stream, date);\n\n                    case SecurityType.Forex:\n                    case SecurityType.Crypto:\n                    case SecurityType.CryptoFuture:\n                        return ParseForex(config, stream, date);\n\n                    case SecurityType.Cfd:\n                        return ParseCfd(config, stream, date);\n\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                        return ParseOption(config, stream, date);\n\n                    case SecurityType.Future:\n                        return ParseFuture(config, stream, date);\n\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(Invariant($\"QuoteBar.Reader(): Error parsing stream, Symbol: {config.Symbol.Value}, SecurityType: {config.SecurityType}, \") +\n                          Invariant($\"Resolution: {config.Resolution}, Date: {date.ToStringInvariant(\"yyyy-MM-dd\")}, Message: {err}\")\n                );\n            }\n\n            // we need to consume a line anyway, to advance the stream\n            stream.ReadLine();\n\n            // if we couldn't parse it above return a default instance\n            return new QuoteBar { Symbol = config.Symbol, Period = config.Increment };\n        }\n\n        /// <summary>\n        /// QuoteBar Reader: Fetch the data from the QC storage and feed it line by line into the engine.\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Enumerable iterator for returning each line of the required data.</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            try\n            {\n                switch (config.SecurityType)\n                {\n                    case SecurityType.Equity:\n                        return ParseEquity(config, line, date);\n\n                    case SecurityType.Forex:\n                    case SecurityType.Crypto:\n                    case SecurityType.CryptoFuture:\n                        return ParseForex(config, line, date);\n\n                    case SecurityType.Cfd:\n                        return ParseCfd(config, line, date);\n\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                        return ParseOption(config, line, date);\n\n                    case SecurityType.Future:\n                        return ParseFuture(config, line, date);\n\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(Invariant($\"QuoteBar.Reader(): Error parsing line: '{line}', Symbol: {config.Symbol.Value}, SecurityType: {config.SecurityType}, \") +\n                    Invariant($\"Resolution: {config.Resolution}, Date: {date.ToStringInvariant(\"yyyy-MM-dd\")}, Message: {err}\")\n                );\n            }\n\n            // if we couldn't parse it above return a default instance\n            return new QuoteBar { Symbol = config.Symbol, Period = config.Increment };\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a future with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseFuture(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseQuote(config, date, line, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a future with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseFuture(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseQuote(config, date, streamReader, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing an option with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseOption(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseQuote(config, date, line, LeanData.OptionUseScaleFactor(config.Symbol));\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing an option with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseOption(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            // scale factor only applies for equity and index options\n            return ParseQuote(config, date, streamReader, useScaleFactor: LeanData.OptionUseScaleFactor(config.Symbol));\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a cfd without a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseCfd(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseQuote(config, date, line, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a cfd without a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseCfd(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseQuote(config, date, streamReader, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a forex without a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseForex(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseQuote(config, date, line, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing a forex without a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseForex(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseQuote(config, date, streamReader, false);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing an equity with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseEquity(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseQuote(config, date, line, true);\n        }\n\n        /// <summary>\n        /// Parse a quotebar representing an equity with a scaling factor\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType</param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask set to same values</returns>\n        public QuoteBar ParseEquity(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseQuote(config, date, streamReader, true);\n        }\n\n        /// <summary>\n        /// \"Scaffold\" code - If the data being read is formatted as a QuoteBar, use this method to deserialize it\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"useScaleFactor\">Whether the data has a scaling factor applied</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask prices set appropriately</returns>\n        private QuoteBar ParseQuote(SubscriptionDataConfig config, DateTime date, StreamReader streamReader, bool useScaleFactor)\n        {\n            // Non-equity asset classes will not use scaling, including options that have a non-equity underlying asset class.\n            var scaleFactor = useScaleFactor\n                              ? _scaleFactor\n                              : 1;\n\n            var quoteBar = new QuoteBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            if (config.Resolution == Resolution.Daily || config.Resolution == Resolution.Hour)\n            {\n                // hourly and daily have different time format, and can use slow, robust c# parser.\n                quoteBar.Time = streamReader.GetDateTime().ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            else\n            {\n                // Using custom int conversion for speed on high resolution data.\n                quoteBar.Time = date.Date.AddMilliseconds(streamReader.GetInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n\n            var open = streamReader.GetDecimal();\n            var high = streamReader.GetDecimal();\n            var low = streamReader.GetDecimal();\n            var close = streamReader.GetDecimal();\n            var lastSize = streamReader.GetDecimal();\n            // only create the bid if it exists in the file\n            if (open != 0 || high != 0 || low != 0 || close != 0)\n            {\n                // the Bid/Ask bars were already create above, we don't need to recreate them but just set their values\n                quoteBar.Bid.Open = open * scaleFactor;\n                quoteBar.Bid.High = high * scaleFactor;\n                quoteBar.Bid.Low = low * scaleFactor;\n                quoteBar.Bid.Close = close * scaleFactor;\n                quoteBar.LastBidSize = lastSize;\n            }\n            else\n            {\n                quoteBar.Bid = null;\n            }\n\n            open = streamReader.GetDecimal();\n            high = streamReader.GetDecimal();\n            low = streamReader.GetDecimal();\n            close = streamReader.GetDecimal();\n            lastSize = streamReader.GetDecimal();\n            // only create the ask if it exists in the file\n            if (open != 0 || high != 0 || low != 0 || close != 0)\n            {\n                // the Bid/Ask bars were already create above, we don't need to recreate them but just set their values\n                quoteBar.Ask.Open = open * scaleFactor;\n                quoteBar.Ask.High = high * scaleFactor;\n                quoteBar.Ask.Low = low * scaleFactor;\n                quoteBar.Ask.Close = close * scaleFactor;\n                quoteBar.LastAskSize = lastSize;\n            }\n            else\n            {\n                quoteBar.Ask = null;\n            }\n\n            quoteBar.Value = quoteBar.Close;\n            return quoteBar;\n        }\n\n        /// <summary>\n        /// \"Scaffold\" code - If the data being read is formatted as a QuoteBar, use this method to deserialize it\n        /// TODO: Once all Forex data refactored to use QuoteBar formatted data, use only this method\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"useScaleFactor\">Whether the data has a scaling factor applied</param>\n        /// <returns><see cref=\"QuoteBar\"/> with the bid/ask prices set appropriately</returns>\n        private QuoteBar ParseQuote(SubscriptionDataConfig config, DateTime date, string line, bool useScaleFactor)\n        {\n            var scaleFactor = useScaleFactor\n                              ? _scaleFactor\n                              : 1;\n\n            var quoteBar = new QuoteBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            var csv = line.ToCsv(11);\n            if (config.Resolution == Resolution.Daily || config.Resolution == Resolution.Hour)\n            {\n                // hourly and daily have different time format, and can use slow, robust c# parser.\n                quoteBar.Time = DateTime.ParseExact(csv[0], DateFormat.TwelveCharacter, CultureInfo.InvariantCulture).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            else\n            {\n                // Using custom \"ToDecimal\" conversion for speed on high resolution data.\n                quoteBar.Time = date.Date.AddMilliseconds((double)csv[0].ToDecimal()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n\n            // only create the bid if it exists in the file\n            if (csv[1].Length != 0 || csv[2].Length != 0 || csv[3].Length != 0 || csv[4].Length != 0)\n            {\n                // the Bid/Ask bars were already create above, we don't need to recreate them but just set their values\n                quoteBar.Bid.Open = csv[1].ToDecimal() * scaleFactor;\n                quoteBar.Bid.High = csv[2].ToDecimal() * scaleFactor;\n                quoteBar.Bid.Low = csv[3].ToDecimal() * scaleFactor;\n                quoteBar.Bid.Close = csv[4].ToDecimal() * scaleFactor;\n                quoteBar.LastBidSize = csv[5].ToDecimal();\n            }\n            else\n            {\n                quoteBar.Bid = null;\n            }\n\n            // only create the ask if it exists in the file\n            if (csv[6].Length != 0 || csv[7].Length != 0 || csv[8].Length != 0 || csv[9].Length != 0)\n            {\n                // the Bid/Ask bars were already create above, we don't need to recreate them but just set their values\n                quoteBar.Ask.Open = csv[6].ToDecimal() * scaleFactor;\n                quoteBar.Ask.High = csv[7].ToDecimal() * scaleFactor;\n                quoteBar.Ask.Low = csv[8].ToDecimal() * scaleFactor;\n                quoteBar.Ask.Close = csv[9].ToDecimal() * scaleFactor;\n                quoteBar.LastAskSize = csv[10].ToDecimal();\n            }\n            else\n            {\n                quoteBar.Ask = null;\n            }\n\n            quoteBar.Value = quoteBar.Close;\n            return quoteBar;\n        }\n\n        /// <summary>\n        /// Get Source for Custom Data File\n        /// >> What source file location would you prefer for each type of usage:\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source request if source spread across multiple files</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String source location of the file</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // this data type is streamed in live mode\n                return new SubscriptionDataSource(string.Empty, SubscriptionTransportMedium.Streaming);\n            }\n\n            var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n            if (config.SecurityType == SecurityType.Future || config.SecurityType.IsOption())\n            {\n                source += \"#\" + LeanData.GenerateZipEntryName(config.Symbol, date, config.Resolution, config.TickType);\n            }\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this quote bar, used in fill forward\n        /// </summary>\n        /// <returns>A clone of the current quote bar</returns>\n        public override BaseData Clone()\n        {\n            return new QuoteBar\n            {\n                Ask = Ask == null ? null : Ask.Clone(),\n                Bid = Bid == null ? null : Bid.Clone(),\n                LastAskSize = LastAskSize,\n                LastBidSize = LastBidSize,\n                Symbol = Symbol,\n                Time = Time,\n                Period = Period,\n                Value = Value,\n                DataType = DataType\n            };\n        }\n\n        /// <summary>\n        /// Collapses QuoteBars into TradeBars object when\n        ///  algorithm requires FX data, but calls OnData(<see cref=\"TradeBars\"/>)\n        /// TODO: (2017) Remove this method in favor of using OnData(<see cref=\"Slice\"/>)\n        /// </summary>\n        /// <returns><see cref=\"TradeBars\"/></returns>\n        public TradeBar Collapse()\n        {\n            return new TradeBar(Time, Symbol, Open, High, Low, Close, 0, Period);\n        }\n\n        /// <summary>\n        /// Convert this <see cref=\"QuoteBar\"/> to string form.\n        /// </summary>\n        /// <returns>String representation of the <see cref=\"QuoteBar\"/></returns>\n        public override string ToString()\n        {\n            return $\"{Symbol}: \" +\n                   $\"Bid: O: {Bid?.Open.SmartRounding()} \" +\n                   $\"Bid: H: {Bid?.High.SmartRounding()} \" +\n                   $\"Bid: L: {Bid?.Low.SmartRounding()} \" +\n                   $\"Bid: C: {Bid?.Close.SmartRounding()} \" +\n                   $\"Ask: O: {Ask?.Open.SmartRounding()} \" +\n                   $\"Ask: H: {Ask?.High.SmartRounding()} \" +\n                   $\"Ask: L: {Ask?.Low.SmartRounding()} \" +\n                   $\"Ask: C: {Ask?.Close.SmartRounding()} \";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/QuoteBars.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"QuoteBar\"/> keyed by symbol\n    /// </summary>\n    public class QuoteBars : DataDictionary<QuoteBar>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"QuoteBars\"/> dictionary\n        /// </summary>\n        public QuoteBars()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"QuoteBars\"/> dictionary\n        /// </summary>\n        public QuoteBars(DateTime time)\n            : base(time)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/RangeBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents a bar sectioned not by time, but by some amount of movement in a value (for example, Closing price moving in $10 bar sizes)\n    /// </summary>\n    public class RangeBar: TradeBar\n    {\n        /// <summary>\n        /// Gets the range of the bar.\n        /// </summary>\n        public decimal RangeSize { get; private set; }\n\n        /// <summary>\n        /// Gets whether or not this bar is considered closed.\n        /// </summary>\n        public bool IsClosed { get; private set; }\n\n        /// <summary>\n        /// Initialize a new default instance of <see cref=\"RangeBar\"/> class.\n        /// </summary>\n        public RangeBar()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RangeBar\"/> class with the specified values\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of this data</param>\n        /// <param name=\"endTime\">The end time of the bar</param>\n        /// <param name=\"rangeSize\">The size of each range bar</param>\n        /// <param name=\"open\">The opening price for the new bar</param>\n        /// <param name=\"high\">The high price for the new bar</param>\n        /// <param name=\"low\">The low price for the new bar</param>\n        /// <param name=\"close\">The closing price for the new bar</param>\n        /// <param name=\"volume\">The volume value for the new bar</param>\n        public RangeBar(Symbol symbol, DateTime endTime,\n            decimal rangeSize, decimal open, decimal? high = null, decimal? low = null, decimal? close = null, decimal volume = 0)\n        {\n            Symbol = symbol;\n            EndTime = endTime;\n            RangeSize = rangeSize;\n            Open = open;\n            Close = close ?? open;\n            Volume = volume;\n            High = high ?? open;\n            Low = low ?? open;\n        }\n\n        /// <summary>\n        /// Updates this <see cref=\"RangeBar\"/> with the specified values\n        /// </summary>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"currentValue\">The current value</param>\n        /// <param name=\"volumeSinceLastUpdate\">The volume since the last update called on this instance</param>\n        public void Update(DateTime time, decimal currentValue, decimal volumeSinceLastUpdate)\n        {\n            EndTime = time;\n\n            if (currentValue < Low)\n            {\n                if ((High - currentValue) > RangeSize)\n                {\n                    IsClosed = true;\n                    Low = High - RangeSize;\n                    Close = Low;\n                    return;\n                }\n                else\n                {\n                    Low = currentValue;\n                }\n            } \n            else if (currentValue > High)\n            {\n                if ((currentValue - Low) > RangeSize)\n                {\n                    IsClosed = true;\n                    High = Low + RangeSize;\n                    Close = High;\n                    return;\n                }\n                else\n                {\n                    High = currentValue;\n                }\n            }\n\n            Volume += volumeSinceLastUpdate;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new RangeBar\n            {\n                RangeSize = RangeSize,\n                Open = Open,\n                Volume = Volume,\n                Close = Close,\n                EndTime = EndTime,\n                High = High,\n                IsClosed = IsClosed,\n                Low = Low,\n                Time = Time,\n                Value = Value,\n                Symbol = Symbol,\n                DataType = DataType\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/RenkoBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents a bar sectioned not by time, but by some amount of movement in a value (for example, Closing price moving in $10 bar sizes)\n    /// </summary>\n    public class RenkoBar : BaseRenkoBar\n    {\n        /// <summary>\n        /// Gets the end time of this renko bar or the most recent update time if it <see cref=\"BaseRenkoBar.IsClosed\"/>\n        /// </summary>\n        [Obsolete(\"RenkoBar.End is obsolete. Please use RenkoBar.EndTime property instead.\")]\n        public DateTime End\n        {\n            get { return EndTime; }\n            set { EndTime = value; }\n        }\n\n        /// <summary>\n        /// The trend of the bar (i.e. Rising, Falling or NoDelta)\n        /// </summary>\n        public BarDirection Direction\n        {\n            get\n            {\n                if (Open < Close)\n                    return BarDirection.Rising;\n                else if (Open > Close)\n                    return BarDirection.Falling;\n                else\n                    return BarDirection.NoDelta;\n            }\n        }\n\n        /// <summary>\n        /// The \"spread\" of the bar\n        /// </summary>\n        public decimal Spread\n        {\n            get\n            {\n                return Math.Abs(Close - Open);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"RenkoBar\"/> class.\n        /// </summary>\n        public RenkoBar()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoBar\"/> class with the specified values\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of this data</param>\n        /// <param name=\"time\">The start time of the bar</param>\n        /// <param name=\"brickSize\">The size of each renko brick</param>\n        /// <param name=\"open\">The opening price for the new bar</param>\n        /// <param name=\"volume\">Any initial volume associated with the data</param>\n        public RenkoBar(Symbol symbol, DateTime time, decimal brickSize, \n            decimal open, decimal volume)\n        {\n            Type = RenkoType.Classic;\n\n            Symbol = symbol;\n            Start = time;\n            EndTime = time;\n            BrickSize = brickSize;\n            Open = open;\n            Close = open;\n            Volume = volume;\n            High = open;\n            Low = open;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RenkoBar\"/> class with the specified values\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of this data</param>\n        /// <param name=\"start\">The start time of the bar</param>\n        /// <param name=\"endTime\">The end time of the bar</param>\n        /// <param name=\"brickSize\">The size of each wicko brick</param>\n        /// <param name=\"open\">The opening price for the new bar</param>\n        /// <param name=\"high\">The high price for the new bar</param>\n        /// <param name=\"low\">The low price for the new bar</param>\n        /// <param name=\"close\">The closing price for the new bar</param>\n        public RenkoBar(Symbol symbol, DateTime start, DateTime endTime,\n            decimal brickSize, decimal open, decimal high, decimal low, decimal close)\n        {\n            Type = RenkoType.Wicked;\n\n            Symbol = symbol;\n            Start = start;\n            EndTime = endTime;\n            BrickSize = brickSize;\n            Open = open;\n            Close = close;\n            Volume = 0;\n            High = high;\n            Low = low;\n        }\n\n        /// <summary>\n        /// Updates this <see cref=\"RenkoBar\"/> with the specified values and returns whether or not this bar is closed\n        /// </summary>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"currentValue\">The current value</param>\n        /// <param name=\"volumeSinceLastUpdate\">The volume since the last update called on this instance</param>\n        /// <returns>True if this bar <see cref=\"BaseRenkoBar.IsClosed\"/></returns>\n        public bool Update(DateTime time, decimal currentValue, decimal volumeSinceLastUpdate)\n        {\n            if (Type == RenkoType.Wicked)\n                throw new InvalidOperationException(\"A \\\"Wicked\\\" RenkoBar cannot be updated!\");\n\n            // can't update a closed renko bar\n            if (IsClosed) return true;\n            if (Start == DateTime.MinValue) Start = time;\n            EndTime = time;\n\n            // compute the min/max closes this renko bar can have\n            decimal lowClose = Open - BrickSize;\n            decimal highClose = Open + BrickSize;\n\n            Close = Math.Min(highClose, Math.Max(lowClose, currentValue));\n            Volume += volumeSinceLastUpdate;\n\n            // determine if this data caused the bar to close\n            if (currentValue <= lowClose  || currentValue >= highClose)\n            {\n                IsClosed = true;\n            }\n\n            if (Close > High) High = Close;\n            if (Close < Low) Low = Close;\n\n            return IsClosed;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new RenkoBar\n            {\n                Type = Type,\n                BrickSize = BrickSize,\n                Open = Open,\n                Volume = Volume,\n                Close = Close,\n                EndTime = EndTime,\n                High = High,\n                IsClosed = IsClosed,\n                Low = Low,\n                Time = Time,\n                Value = Value,\n                Symbol = Symbol,\n                DataType = DataType\n            };\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Market/RenkoType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// The type of the RenkoBar being created.\n    /// Used by RenkoConsolidator, ClassicRenkoConsolidator and VolumeRenkoConsolidator\n    /// </summary>\n    /// <remarks>Classic implementation was not entirely accurate for Renko consolidator\n    /// so we have replaced it with a new implementation and maintain the classic\n    /// for backwards compatibility and comparison.</remarks>\n    public enum RenkoType\n    {\n        /// <summary>\n        /// Indicates that the RenkoConsolidator works in its\n        /// original implementation; Specifically:\n        /// - It only returns a single bar, at most, irrespective of tick movement\n        /// - It will emit consecutive bars side by side\n        /// - By default even bars are created \n        /// (0)\n        /// </summary>\n        /// <remarks>the Classic mode has only been retained for\n        /// backwards compatibility with existing code.</remarks>\n        Classic,\n\n        /// <summary>\n        /// Indicates that the RenkoConsolidator works properly;\n        /// Specifically:\n        /// - returns zero or more bars per tick, as appropriate.\n        /// - Will not emit consecutive bars side by side\n        /// - Creates \n        /// (1)\n        /// </summary>\n        Wicked\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Session.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing Common.Data.Consolidators;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Provides a rolling window of <see cref=\"SessionBar\"/> with size 2,\n    /// where [0] contains the current session values in progress (OHLCV + OpenInterest),\n    /// and [1] contains the fully consolidated data of the previous trading day.\n    /// </summary>\n    public class Session : RollingWindow<SessionBar>, IBar\n    {\n        private readonly Symbol _symbol;\n        private readonly TickType _tickType;\n        private readonly SecurityExchangeHours _exchangeHours;\n        private SessionConsolidator _consolidator;\n\n        /// <summary>\n        /// Opening price of the session\n        /// </summary>\n        public decimal Open => _consolidator?.WorkingInstance.Open ?? 0;\n\n        /// <summary>\n        /// High price of the session\n        /// </summary>\n        public decimal High => _consolidator?.WorkingInstance.High ?? 0;\n\n        /// <summary>\n        /// Low price of the session\n        /// </summary>\n        public decimal Low => _consolidator?.WorkingInstance.Low ?? 0;\n\n        /// <summary>\n        /// Closing price of the session\n        /// </summary>\n        public decimal Close => _consolidator?.WorkingInstance.Close ?? 0;\n\n        /// <summary>\n        /// Volume traded during the session\n        /// </summary>\n        public decimal Volume => _consolidator?.WorkingInstance.Volume ?? 0;\n\n        /// <summary>\n        /// Open Interest of the session\n        /// </summary>\n        public decimal OpenInterest => _consolidator?.WorkingInstance.OpenInterest ?? 0;\n\n        /// <summary>\n        /// The symbol of the session\n        /// </summary>\n        public Symbol Symbol => _symbol;\n\n        /// <summary>\n        /// The end time of the session\n        /// </summary>\n        public DateTime EndTime => _consolidator?.WorkingInstance.EndTime ?? default;\n\n        /// <summary>\n        /// Gets the size of this window\n        /// </summary>\n        public override int Size\n        {\n            set\n            {\n                base.Size = value;\n                TryInitialize();\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Session\"/> class\n        /// </summary>\n        /// <param name=\"tickType\">The tick type to use</param>\n        /// <param name=\"exchangeHours\">The exchange hours</param>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"size\">The number of items to hold</param>\n        public Session(TickType tickType, SecurityExchangeHours exchangeHours, Symbol symbol, int size = 0)\n            : base(size)\n        {\n            _symbol = symbol;\n            _tickType = tickType;\n            _exchangeHours = exchangeHours;\n            TryInitialize();\n        }\n\n        /// <summary>\n        /// Updates the session with new market data\n        /// </summary>\n        /// <param name=\"data\">The new data to update the session with</param>\n        public void Update(BaseData data)\n        {\n            _consolidator?.Update(data);\n        }\n\n        private void OnConsolidated(object sender, IBaseData consolidated)\n        {\n            // Finished current trading day\n            // Add the new working session bar at [0], this will shift the previous trading day's bar to [1]\n            Add(_consolidator.WorkingInstance);\n        }\n\n        /// <summary>\n        /// Scans the consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        public void Scan(DateTime currentLocalTime)\n        {\n            // Delegates the scan decision to the underlying consolidator.\n            _consolidator?.ValidateAndScan(currentLocalTime);\n        }\n\n        /// <summary>\n        /// Resets the session\n        /// </summary>\n        public override void Reset()\n        {\n            if (_consolidator != null)\n            {\n                base.Reset();\n                _consolidator.Reset();\n                // We need to add the working session bar at [0]\n                Add(_consolidator.WorkingInstance);\n            }\n        }\n\n        /// <summary>\n        /// Returns a string representation of current session bar with OHLCV and OpenInterest values formatted.\n        /// Example: \"O: 101.00 H: 112.00 L: 95.00 C: 110.00 V: 1005.00 OI: 12\"\n        /// </summary>\n        public override string ToString()\n        {\n            if (_consolidator != null)\n            {\n                return _consolidator.WorkingInstance.ToString();\n            }\n            return string.Empty;\n        }\n\n        private void TryInitialize()\n        {\n            if (base.Size > 0 && _consolidator == null)\n            {\n                _consolidator = new SessionConsolidator(_exchangeHours, _tickType, _symbol);\n                _consolidator.DataConsolidated += OnConsolidated;\n                Add(_consolidator.WorkingInstance);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/SessionBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Contains OHLCV data for a single session\n    /// </summary>\n    public class SessionBar : TradeBar\n    {\n        private DateTime _lastVolumeTime = DateTime.MinValue;\n        private QuoteBar _bar;\n        private readonly TickType _sourceTickType;\n\n        /// <summary>\n        /// Open Interest:\n        /// </summary>\n        public decimal OpenInterest { get; set; }\n\n        /// <summary>\n        /// Opening price of the bar: Defined as the price at the start of the time period.\n        /// </summary>\n        public override decimal Open => _bar?.Open ?? 0m;\n\n        /// <summary>\n        /// High price of the TradeBar during the time period.\n        /// </summary>\n        public override decimal High => _bar?.High ?? 0m;\n\n        /// <summary>\n        /// Low price of the TradeBar during the time period.\n        /// </summary>\n        public override decimal Low => _bar?.Low ?? 0m;\n\n        /// <summary>\n        /// Closing price of the TradeBar. Defined as the price at Start Time + TimeSpan.\n        /// </summary>\n        public override decimal Close => _bar?.Close ?? 0m;\n\n        /// <summary>\n        /// The closing time of this bar, computed via the Time and Period\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get\n            {\n                if (Time == DateTime.MaxValue)\n                {\n                    // Prevent overflow from Time + Period when Time is DateTime.MaxValue\n                    return Time;\n                }\n\n                return base.EndTime;\n            }\n        }\n\n        /// <summary>\n        /// The period of this session bar\n        /// </summary>\n        public override TimeSpan Period { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of SessionBar with default values\n        /// </summary>\n        public SessionBar()\n        {\n            Period = QuantConnect.Time.OneDay;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of SessionBar with a specific tick type\n        /// </summary>\n        public SessionBar(TickType sourceTickType)\n        {\n            _sourceTickType = sourceTickType;\n            Period = QuantConnect.Time.OneDay;\n        }\n\n        /// <summary>\n        /// Updates the session bar with new market data and initializes the first bar if needed\n        /// </summary>\n        /// <param name=\"data\">The new data to update the session with</param>\n        /// <param name=\"consolidated\">The current consolidated session bar</param>\n        public void Update(BaseData data, IBaseData consolidated)\n        {\n            InitializeBar(data, consolidated);\n            if (data.Time < _bar.Time)\n            {\n                // This will prevent overlapping\n                return;\n            }\n\n            if (data.DataType == MarketDataType.TradeBar && data is TradeBar tradeBar)\n            {\n                if (_lastVolumeTime <= tradeBar.Time)\n                {\n                    _lastVolumeTime = tradeBar.EndTime;\n                    Volume += tradeBar.Volume;\n                }\n\n                if (_sourceTickType == TickType.Trade)\n                {\n                    if (Initialized == 0)\n                    {\n                        Initialized = 1;\n                        _bar.Bid.Open = tradeBar.Open;\n                    }\n                    _bar.Bid.Close = tradeBar.Close;\n                    if (tradeBar.Low < _bar.Bid.Low) _bar.Bid.Low = tradeBar.Low;\n                    if (tradeBar.High > _bar.Bid.High) _bar.Bid.High = tradeBar.High;\n\n                    _bar.Time = tradeBar.EndTime;\n                }\n            }\n            else if (_sourceTickType == TickType.Quote && data.DataType == MarketDataType.QuoteBar)\n            {\n                var quoteBar = (QuoteBar)data;\n                var bid = quoteBar.Bid;\n                var ask = quoteBar.Ask;\n\n                // update the bid and ask\n                if (bid != null)\n                {\n                    if (_bar.Bid == null)\n                    {\n                        _bar.Bid = bid.Clone();\n                    }\n                    else\n                    {\n                        _bar.Bid.Close = bid.Close;\n                        if (_bar.Bid.High < bid.High) _bar.Bid.High = bid.High;\n                        if (_bar.Bid.Low > bid.Low) _bar.Bid.Low = bid.Low;\n                    }\n                }\n                if (ask != null)\n                {\n                    if (_bar.Ask == null)\n                    {\n                        _bar.Ask = ask.Clone();\n                    }\n                    else\n                    {\n                        _bar.Ask.Close = ask.Close;\n                        if (_bar.Ask.High < ask.High) _bar.Ask.High = ask.High;\n                        if (_bar.Ask.Low > ask.Low) _bar.Ask.Low = ask.Low;\n                    }\n                }\n\n                _bar.Value = data.Value;\n                _bar.Time = data.EndTime;\n            }\n            else if (data.DataType == MarketDataType.Tick)\n            {\n                var tick = (Tick)data;\n                if (_lastVolumeTime <= data.Time)\n                {\n                    _lastVolumeTime = data.EndTime;\n                    Volume += tick.Quantity;\n                }\n\n                // update the bid and ask\n                if (_sourceTickType == tick.TickType)\n                {\n                    if (tick.TickType == TickType.Trade)\n                    {\n                        if (Initialized == 0)\n                        {\n                            Initialized = 1;\n                            _bar.Bid.Open = tick.Value;\n                        }\n                        _bar.Bid.Close = tick.Value;\n                        if (tick.Value < _bar.Bid.Low) _bar.Bid.Low = tick.Value;\n                        if (tick.Value > _bar.Bid.High) _bar.Bid.High = tick.Value;\n                    }\n                    else\n                    {\n                        _bar.Update(decimal.Zero, tick.BidPrice, tick.AskPrice, decimal.Zero, tick.BidSize, tick.AskSize);\n                    }\n                    _bar.Time = data.EndTime;\n                }\n            }\n        }\n\n        private void InitializeBar(BaseData data, IBaseData consolidated)\n        {\n            if (_bar == null)\n            {\n                _bar = new QuoteBar(data.Time.Date, data.Symbol, null, 0, null, 0, Period);\n                if (_sourceTickType == TickType.Trade)\n                {\n                    _bar.Bid = new Bar(0, 0, decimal.MaxValue, 0);\n                }\n                else if (consolidated != null)\n                {\n                    var previousBar = ((SessionBar)consolidated)._bar;\n                    _bar.Update(decimal.Zero, previousBar?.Bid?.Close ?? decimal.Zero, previousBar?.Ask?.Close ?? decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns a string representation of the session bar with OHLCV and OpenInterest values formatted.\n        /// Example: \"O: 101.00 H: 112.00 L: 95.00 C: 110.00 V: 1005.00 OI: 12\"\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"O: {Open.SmartRounding()} \" +\n                   $\"H: {High.SmartRounding()} \" +\n                   $\"L: {Low.SmartRounding()} \" +\n                   $\"C: {Close.SmartRounding()} \" +\n                   $\"V: {Volume.SmartRounding()} \" +\n                   $\"OI: {OpenInterest}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Split.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing ProtoBuf;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Split event from a security\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class Split : BaseData\n    {\n        /// <summary>\n        ///Gets the type of split event, warning or split.\n        /// </summary>\n        [JsonProperty]\n        [ProtoMember(10)]\n        public SplitType Type\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the split factor\n        /// </summary>\n        [JsonProperty]\n        [ProtoMember(11)]\n        public decimal SplitFactor\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the price at which the split occurred\n        /// This is typically the previous day's closing price\n        /// </summary>\n        [ProtoMember(12)]\n        public decimal ReferencePrice\n        {\n            get { return Value; }\n            set { Value = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Split class\n        /// </summary>\n        public Split()\n        {\n            Type = SplitType.SplitOccurred;\n            DataType = MarketDataType.Auxiliary;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Split class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"price\">The price at the time of the split</param>\n        /// <param name=\"splitFactor\">The split factor to be applied to current holdings</param>\n        /// <param name=\"type\">The type of split event, warning or split occurred</param>\n        public Split(Symbol symbol, DateTime date, decimal price, decimal splitFactor, SplitType type)\n             : this()\n        {\n            Type = type;\n            Time = date;\n            Symbol = symbol;\n            ReferencePrice = price;\n            SplitFactor = splitFactor;\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            // this is implemented in the SubscriptionDataReader.CheckForSplit\n            throw new NotImplementedException(\"This method is not supposed to be called on the Split type.\");\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            // this data is derived from map files and factor files in backtesting\n            return null;\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            var type = Type == SplitType.Warning ? \"Split Warning\" : \"Split\";\n            return Invariant($\"{type}: {Symbol}: {SplitFactor} | {ReferencePrice}\");\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new Split(Symbol, Time, Price, SplitFactor, Type);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Splits.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of splits keyed by <see cref=\"Symbol\"/>\n    /// </summary>\n    public class Splits : DataDictionary<Split>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Splits\"/> dictionary\n        /// </summary>\n        public Splits()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Splits\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public Splits(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/SymbolChangedEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Symbol changed event of a security. This is generated when a symbol is remapped for a given\n    /// security, for example, at EOD 2014.04.02 GOOG turned into GOOGL, but are the same\n    /// </summary>\n    public class SymbolChangedEvent : BaseData\n    {\n        /// <summary>\n        /// Gets the symbol before the change\n        /// </summary>\n        public string OldSymbol { get; private set; }\n\n        /// <summary>\n        /// Gets the symbol after the change\n        /// </summary>\n        public string NewSymbol { get; private set; }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"SymbolChangedEvent\"/> class\n        /// </summary>\n        public SymbolChangedEvent()\n        {\n            DataType = MarketDataType.Auxiliary;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SymbolChangedEvent\"/>\n        /// </summary>\n        /// <param name=\"requestedSymbol\">The symbol that was originally requested</param>\n        /// <param name=\"date\">The date/time this symbol remapping took place</param>\n        /// <param name=\"oldSymbol\">The old symbol mapping</param>\n        /// <param name=\"newSymbol\">The new symbol mapping</param>\n        public SymbolChangedEvent(Symbol requestedSymbol, DateTime date, string oldSymbol, string newSymbol)\n            : this()\n        {\n            Time = date;\n            Symbol = requestedSymbol;\n            OldSymbol = oldSymbol;\n            NewSymbol = newSymbol;\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new SymbolChangedEvent(Symbol, Time, OldSymbol, NewSymbol);\n        }\n\n        /// <summary>\n        /// Friendly string representation of this symbol changed event\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Time} {OldSymbol}->{NewSymbol}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/SymbolChangedEvents.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of <see cref=\"SymbolChangedEvent\"/> keyed by the original, requested symbol\n    /// </summary>\n    public class SymbolChangedEvents : DataDictionary<SymbolChangedEvent>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SymbolChangedEvent\"/> dictionary\n        /// </summary>\n        public SymbolChangedEvents()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SymbolChangedEvent\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public SymbolChangedEvents(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Tick.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing ProtoBuf;\nusing System.IO;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Tick class is the base representation for tick data. It is grouped into a Ticks object\n    /// which implements IDictionary and passed into an OnData event handler.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    [ProtoInclude(1000, typeof(OpenInterest))]\n    public class Tick : BaseData\n    {\n        private Exchange _exchange = QuantConnect.Exchange.UNKNOWN;\n        private string _exchangeValue;\n        private uint? _parsedSaleCondition;\n\n        /// <summary>\n        /// Type of the Tick: Trade or Quote.\n        /// </summary>\n        [ProtoMember(10)]\n        [PandasIgnore]\n        public TickType TickType { get; set; } = TickType.Trade;\n\n        /// <summary>\n        /// Quantity exchanged in a trade.\n        /// </summary>\n        [ProtoMember(11)]\n        public decimal Quantity { get; set; }\n\n        /// <summary>\n        /// Exchange code this tick came from <see cref=\"Exchanges\"/>\n        /// </summary>\n        [PandasIgnore]\n        public string ExchangeCode\n        {\n            get\n            {\n                if (_exchange == null)\n                {\n                    _exchange = Symbol != null\n                        ? _exchangeValue.GetPrimaryExchange(Symbol.SecurityType, Symbol.ID.Market) : _exchangeValue.GetPrimaryExchange();\n                }\n                return _exchange.Code;\n            }\n            set\n            {\n                _exchangeValue = value;\n                _exchange = null;\n            }\n        }\n\n        /// <summary>\n        /// Exchange name this tick came from <see cref=\"Exchanges\"/>\n        /// </summary>\n        [ProtoMember(12)]\n        public string Exchange\n        {\n            get\n            {\n                if (_exchange == null)\n                {\n                    _exchange = Symbol != null\n                        ? _exchangeValue.GetPrimaryExchange(Symbol.SecurityType, Symbol.ID.Market) : _exchangeValue.GetPrimaryExchange();\n                }\n                return _exchange;\n            }\n            set\n            {\n                _exchangeValue = value;\n                _exchange = null;\n            }\n        }\n\n        /// <summary>\n        /// Sale condition for the tick.\n        /// </summary>\n        [PandasIgnore]\n        [ProtoMember(13)]\n        public string SaleCondition { get; set; } = string.Empty;\n\n        /// <summary>\n        /// For performance parsed sale condition for the tick.\n        /// </summary>\n        [JsonIgnore]\n        [PandasIgnore]\n        public uint ParsedSaleCondition\n        {\n            get\n            {\n                if (string.IsNullOrEmpty(SaleCondition))\n                {\n                    return 0;\n                }\n\n                if (!_parsedSaleCondition.HasValue)\n                {\n                    _parsedSaleCondition = uint.Parse(SaleCondition, NumberStyles.HexNumber, CultureInfo.InvariantCulture);\n                }\n                return _parsedSaleCondition.Value;\n            }\n            set\n            {\n                _parsedSaleCondition = value;\n            }\n        }\n\n        /// <summary>\n        /// Bool whether this is a suspicious tick\n        /// </summary>\n        [ProtoMember(14)]\n        public bool Suspicious { get; set; }\n\n        /// <summary>\n        /// Bid Price for Tick\n        /// </summary>\n        [ProtoMember(15)]\n        public decimal BidPrice { get; set; }\n\n        /// <summary>\n        /// Asking price for the Tick quote.\n        /// </summary>\n        [ProtoMember(16)]\n        public decimal AskPrice { get; set; }\n\n        /// <summary>\n        /// Alias for \"Value\" - the last sale for this asset.\n        /// </summary>\n        public decimal LastPrice\n        {\n            get\n            {\n                return Value;\n            }\n        }\n\n        /// <summary>\n        /// Size of bid quote.\n        /// </summary>\n        [ProtoMember(17)]\n        public decimal BidSize { get; set; }\n\n        /// <summary>\n        /// Size of ask quote.\n        /// </summary>\n        [ProtoMember(18)]\n        public decimal AskSize { get; set; }\n\n        //In Base Class: Alias of Closing:\n        //public decimal Price;\n\n        //Symbol of Asset.\n        //In Base Class: public Symbol Symbol;\n\n        //In Base Class: DateTime Of this TradeBar\n        //public DateTime Time;\n\n        /// <summary>\n        /// Initialize tick class with a default constructor.\n        /// </summary>\n        public Tick()\n        {\n            Value = 0;\n            Time = new DateTime();\n            DataType = MarketDataType.Tick;\n            Symbol = Symbol.Empty;\n            TickType = TickType.Trade;\n            Quantity = 0;\n            _exchange = QuantConnect.Exchange.UNKNOWN;\n            SaleCondition = string.Empty;\n            Suspicious = false;\n            BidSize = 0;\n            AskSize = 0;\n        }\n\n        /// <summary>\n        /// Cloner constructor for fill forward engine implementation. Clone the original tick into this new tick:\n        /// </summary>\n        /// <param name=\"original\">Original tick we're cloning</param>\n        public Tick(Tick original)\n        {\n            Symbol = original.Symbol;\n            Time = new DateTime(original.Time.Ticks);\n            Value = original.Value;\n            BidPrice = original.BidPrice;\n            AskPrice = original.AskPrice;\n            // directly set privates so we don't parse the exchange\n            _exchange = original._exchange;\n            _exchangeValue = original._exchangeValue;\n            SaleCondition = original.SaleCondition;\n            _parsedSaleCondition = original._parsedSaleCondition;\n            Quantity = original.Quantity;\n            Suspicious = original.Suspicious;\n            DataType = MarketDataType.Tick;\n            TickType = original.TickType;\n            BidSize = original.BidSize;\n            AskSize = original.AskSize;\n        }\n\n        /// <summary>\n        /// Constructor for a FOREX tick where there is no last sale price. The volume in FX is so high its rare to find FX trade data.\n        /// To fake this the tick contains bid-ask prices and the last price is the midpoint.\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying currency pair we're trading</param>\n        /// <param name=\"bid\">FX tick bid value</param>\n        /// <param name=\"ask\">FX tick ask value</param>\n        public Tick(DateTime time, Symbol symbol, decimal bid, decimal ask)\n        {\n            DataType = MarketDataType.Tick;\n            Time = time;\n            Symbol = symbol;\n            Value = (bid + ask) / 2;\n            TickType = TickType.Quote;\n            BidPrice = bid;\n            AskPrice = ask;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Tick\"/> class to <see cref=\"TickType.OpenInterest\"/>.\n        /// </summary>\n        /// <param name=\"time\">The time at which the open interest tick occurred.</param>\n        /// <param name=\"symbol\">The symbol associated with the open interest tick.</param>\n        /// <param name=\"openInterest\">The value of the open interest for the specified symbol.</param>\n        public Tick(DateTime time, Symbol symbol, decimal openInterest)\n        {\n            Time = time;\n            Symbol = symbol;\n            Value = openInterest;\n            DataType = MarketDataType.Tick;\n            TickType = TickType.OpenInterest;\n        }\n\n        /// <summary>\n        /// Initializer for a last-trade equity tick with bid or ask prices.\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"bid\">Bid value</param>\n        /// <param name=\"ask\">Ask value</param>\n        /// <param name=\"last\">Last trade price</param>\n        public Tick(DateTime time, Symbol symbol, decimal last, decimal bid, decimal ask)\n        {\n            DataType = MarketDataType.Tick;\n            Time = time;\n            Symbol = symbol;\n            Value = last;\n            TickType = TickType.Quote;\n            BidPrice = bid;\n            AskPrice = ask;\n        }\n\n        /// <summary>\n        /// Trade tick type constructor\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"saleCondition\">The ticks sale condition</param>\n        /// <param name=\"exchange\">The ticks exchange</param>\n        /// <param name=\"quantity\">The quantity traded</param>\n        /// <param name=\"price\">The price of the trade</param>\n        public Tick(DateTime time, Symbol symbol, string saleCondition, string exchange, decimal quantity, decimal price)\n        {\n            Value = price;\n            Time = time;\n            DataType = MarketDataType.Tick;\n            Symbol = symbol;\n            TickType = TickType.Trade;\n            Quantity = quantity;\n            Exchange = exchange;\n            SaleCondition = saleCondition;\n            Suspicious = false;\n        }\n\n        /// <summary>\n        /// Trade tick type constructor\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"saleCondition\">The ticks sale condition</param>\n        /// <param name=\"exchange\">The ticks exchange</param>\n        /// <param name=\"quantity\">The quantity traded</param>\n        /// <param name=\"price\">The price of the trade</param>\n        public Tick(DateTime time, Symbol symbol, string saleCondition, Exchange exchange, decimal quantity, decimal price)\n            : this(time, symbol, saleCondition, string.Empty, quantity, price)\n        {\n            // we were giving the exchange, set it directly\n            _exchange = exchange;\n        }\n\n        /// <summary>\n        /// Quote tick type constructor\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"saleCondition\">The ticks sale condition</param>\n        /// <param name=\"exchange\">The ticks exchange</param>\n        /// <param name=\"bidSize\">The bid size</param>\n        /// <param name=\"bidPrice\">The bid price</param>\n        /// <param name=\"askSize\">The ask size</param>\n        /// <param name=\"askPrice\">The ask price</param>\n        public Tick(DateTime time, Symbol symbol, string saleCondition, string exchange, decimal bidSize, decimal bidPrice, decimal askSize, decimal askPrice)\n        {\n            Time = time;\n            DataType = MarketDataType.Tick;\n            Symbol = symbol;\n            TickType = TickType.Quote;\n            Exchange = exchange;\n            SaleCondition = saleCondition;\n            Suspicious = false;\n            AskPrice = askPrice;\n            AskSize = askSize;\n            BidPrice = bidPrice;\n            BidSize = bidSize;\n            SetValue();\n        }\n\n        /// <summary>\n        /// Quote tick type constructor\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"bidSize\">The bid size</param>\n        /// <param name=\"bidPrice\">The bid price</param>\n        /// <param name=\"askSize\">The ask size</param>\n        /// <param name=\"askPrice\">The ask price</param>\n        public Tick(DateTime time, Symbol symbol, decimal bidSize, decimal bidPrice, decimal askSize, decimal askPrice)\n            : this(time, symbol, string.Empty, string.Empty, bidSize, bidPrice, askSize, askPrice)\n        {\n        }\n\n        /// <summary>\n        /// Quote tick type constructor\n        /// </summary>\n        /// <param name=\"time\">Full date and time</param>\n        /// <param name=\"symbol\">Underlying equity security symbol</param>\n        /// <param name=\"saleCondition\">The ticks sale condition</param>\n        /// <param name=\"exchange\">The ticks exchange</param>\n        /// <param name=\"bidSize\">The bid size</param>\n        /// <param name=\"bidPrice\">The bid price</param>\n        /// <param name=\"askSize\">The ask size</param>\n        /// <param name=\"askPrice\">The ask price</param>\n        public Tick(DateTime time, Symbol symbol, string saleCondition, Exchange exchange, decimal bidSize, decimal bidPrice, decimal askSize, decimal askPrice)\n            : this(time, symbol, saleCondition, string.Empty, bidSize, bidPrice, askSize, askPrice)\n        {\n            // we were giving the exchange, set it directly\n            _exchange = exchange;\n        }\n\n        /// <summary>\n        /// Constructor for QuantConnect FXCM Data source:\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for underlying asset</param>\n        /// <param name=\"line\">CSV line of data from FXCM</param>\n        public Tick(Symbol symbol, string line)\n        {\n            var csv = line.Split(',');\n            DataType = MarketDataType.Tick;\n            Symbol = symbol;\n            Time = DateTime.ParseExact(csv[0], DateFormat.Forex, CultureInfo.InvariantCulture);\n            Value = (BidPrice + AskPrice) / 2;\n            TickType = TickType.Quote;\n            BidPrice = Convert.ToDecimal(csv[1], CultureInfo.InvariantCulture);\n            AskPrice = Convert.ToDecimal(csv[2], CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Constructor for QuantConnect tick data\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for underlying asset</param>\n        /// <param name=\"line\">CSV line of data from QC tick csv</param>\n        /// <param name=\"baseDate\">The base date of the tick</param>\n        public Tick(Symbol symbol, string line, DateTime baseDate)\n        {\n            var csv = line.Split(',');\n            DataType = MarketDataType.Tick;\n            Symbol = symbol;\n            Time = baseDate.Date.AddTicks(Convert.ToInt64(10000 * csv[0].ToDecimal()));\n            Value = csv[1].ToDecimal() / GetScaleFactor(symbol);\n            TickType = TickType.Trade;\n            Quantity = csv[2].ToDecimal();\n            Exchange = csv[3].Trim();\n            SaleCondition = csv[4];\n            Suspicious = csv[5].ToInt32() == 1;\n        }\n\n        /// <summary>\n        /// Parse a tick data line from quantconnect zip source files.\n        /// </summary>\n        /// <param name=\"reader\">The source stream reader</param>\n        /// <param name=\"date\">Base date for the tick (ticks date is stored as int milliseconds since midnight)</param>\n        /// <param name=\"config\">Subscription configuration object</param>\n        public Tick(SubscriptionDataConfig config, StreamReader reader, DateTime date)\n        {\n            try\n            {\n                DataType = MarketDataType.Tick;\n                Symbol = config.Symbol;\n\n                // Which security type is this data feed:\n                var scaleFactor = GetScaleFactor(config.Symbol);\n\n                switch (config.SecurityType)\n                {\n                    case SecurityType.Equity:\n                        {\n                            TickType = config.TickType;\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * reader.GetDecimal())).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n                            bool pastLineEnd;\n                            if (TickType == TickType.Trade)\n                            {\n                                Value = reader.GetDecimal() / scaleFactor;\n                                Quantity = reader.GetDecimal(out pastLineEnd);\n                                if (!pastLineEnd)\n                                {\n                                    Exchange = reader.GetString();\n                                    SaleCondition = reader.GetString();\n                                    Suspicious = reader.GetInt32() == 1;\n                                }\n                            }\n                            else if (TickType == TickType.Quote)\n                            {\n                                BidPrice = reader.GetDecimal() / scaleFactor;\n                                BidSize = reader.GetDecimal();\n                                AskPrice = reader.GetDecimal() / scaleFactor;\n                                AskSize = reader.GetDecimal(out pastLineEnd);\n\n                                SetValue();\n\n                                if (!pastLineEnd)\n                                {\n                                    Exchange = reader.GetString();\n                                    SaleCondition = reader.GetString();\n                                    Suspicious = reader.GetInt32() == 1;\n                                }\n                            }\n                            else\n                            {\n                                throw new InvalidOperationException($\"Tick(): Unexpected tick type {TickType}\");\n                            }\n                            break;\n                        }\n\n                    case SecurityType.Forex:\n                    case SecurityType.Cfd:\n                        {\n                            TickType = TickType.Quote;\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * reader.GetDecimal()))\n                                .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n                            BidPrice = reader.GetDecimal();\n                            AskPrice = reader.GetDecimal();\n\n                            SetValue();\n                            break;\n                        }\n\n                    case SecurityType.CryptoFuture:\n                    case SecurityType.Crypto:\n                        {\n                            TickType = config.TickType;\n                            Exchange = config.Market;\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * reader.GetDecimal()))\n                                .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n                            if (TickType == TickType.Trade)\n                            {\n                                Value = reader.GetDecimal();\n                                Quantity = reader.GetDecimal(out var endOfLine);\n                                Suspicious = !endOfLine && reader.GetInt32() == 1;\n                            }\n                            else if(TickType == TickType.Quote)\n                            {\n                                BidPrice = reader.GetDecimal();\n                                BidSize = reader.GetDecimal();\n                                AskPrice = reader.GetDecimal();\n                                AskSize = reader.GetDecimal(out var endOfLine);\n                                Suspicious = !endOfLine && reader.GetInt32() == 1;\n\n                                SetValue();\n                            }\n                            break;\n                        }\n                    case SecurityType.Future:\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                        {\n                            TickType = config.TickType;\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * reader.GetDecimal()))\n                                .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n                            if (TickType == TickType.Trade)\n                            {\n                                Value = reader.GetDecimal() / scaleFactor;\n                                Quantity = reader.GetDecimal();\n                                Exchange = reader.GetString();\n                                SaleCondition = reader.GetString();\n                                Suspicious = reader.GetInt32() == 1;\n                            }\n                            else if (TickType == TickType.OpenInterest)\n                            {\n                                Value = reader.GetDecimal();\n                            }\n                            else\n                            {\n                                BidPrice = reader.GetDecimal() / scaleFactor;\n                                BidSize = reader.GetDecimal();\n                                AskPrice = reader.GetDecimal() / scaleFactor;\n                                AskSize = reader.GetDecimal();\n                                Exchange = reader.GetString();\n                                Suspicious = reader.GetInt32() == 1;\n\n                                SetValue();\n                            }\n\n                            break;\n                        }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Parse a tick data line from quantconnect zip source files.\n        /// </summary>\n        /// <param name=\"line\">CSV source line of the compressed source</param>\n        /// <param name=\"date\">Base date for the tick (ticks date is stored as int milliseconds since midnight)</param>\n        /// <param name=\"config\">Subscription configuration object</param>\n        public Tick(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            try\n            {\n                DataType = MarketDataType.Tick;\n                Symbol = config.Symbol;\n\n                // Which security type is this data feed:\n                var scaleFactor = GetScaleFactor(config.Symbol);\n\n                switch (config.SecurityType)\n                {\n                    case SecurityType.Equity:\n                    {\n                        var index = 0;\n                        TickType = config.TickType;\n                        var csv = line.ToCsv(TickType == TickType.Trade ? 6 : 8);\n                        Time = date.Date.AddTicks(Convert.ToInt64(10000 * csv[index++].ToDecimal())).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n                        if (TickType == TickType.Trade)\n                        {\n                            Value = csv[index++].ToDecimal() / scaleFactor;\n                            Quantity = csv[index++].ToDecimal();\n                            if (csv.Count > index)\n                            {\n                                Exchange = csv[index++];\n                                SaleCondition = csv[index++];\n                                Suspicious = (csv[index++] == \"1\");\n                            }\n                        }\n                        else if (TickType == TickType.Quote)\n                        {\n                            BidPrice = csv[index++].ToDecimal() / scaleFactor;\n                            BidSize = csv[index++].ToDecimal();\n                            AskPrice = csv[index++].ToDecimal() / scaleFactor;\n                            AskSize = csv[index++].ToDecimal();\n\n                            SetValue();\n\n                            if (csv.Count > index)\n                            {\n                                Exchange = csv[index++];\n                                SaleCondition = csv[index++];\n                                Suspicious = (csv[index++] == \"1\");\n                            }\n                        }\n                        else\n                        {\n                            throw new InvalidOperationException($\"Tick(): Unexpected tick type {TickType}\");\n                        }\n                        break;\n                    }\n\n                    case SecurityType.Forex:\n                    case SecurityType.Cfd:\n                    {\n                        var csv = line.ToCsv(3);\n                        TickType = TickType.Quote;\n                        var ticks = (long)(csv[0].ToDecimal() * TimeSpan.TicksPerMillisecond);\n                        Time = date.Date.AddTicks(ticks)\n                            .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n                        BidPrice = csv[1].ToDecimal();\n                        AskPrice = csv[2].ToDecimal();\n\n                        SetValue();\n                        break;\n                    }\n\n                    case SecurityType.Crypto:\n                    case SecurityType.CryptoFuture:\n                    {\n                        TickType = config.TickType;\n                        Exchange = config.Market;\n\n                        if (TickType == TickType.Trade)\n                        {\n                            var csv = line.ToCsv(3);\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * csv[0].ToDecimal()))\n                                .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n                            Value = csv[1].ToDecimal();\n                            Quantity = csv[2].ToDecimal();\n                            Suspicious = csv.Count >= 4 && csv[3] == \"1\";\n                        }\n\n                        if (TickType == TickType.Quote)\n                        {\n                            var csv = line.ToCsv(6);\n                            Time = date.Date.AddTicks(Convert.ToInt64(10000 * csv[0].ToDecimal()))\n                                .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n                            BidPrice = csv[1].ToDecimal();\n                            BidSize = csv[2].ToDecimal();\n                            AskPrice = csv[3].ToDecimal();\n                            AskSize = csv[4].ToDecimal();\n                            Suspicious = csv.Count >= 6 && csv[5] == \"1\";\n\n                            SetValue();\n                        }\n                        break;\n                    }\n                    case SecurityType.Future:\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                    {\n                        var csv = line.ToCsv(7);\n                        TickType = config.TickType;\n                        Time = date.Date.AddTicks(Convert.ToInt64(10000 * csv[0].ToDecimal()))\n                            .ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n\n                        if (TickType == TickType.Trade)\n                        {\n                            Value = csv[1].ToDecimal()/scaleFactor;\n                            Quantity = csv[2].ToDecimal();\n                            Exchange = csv[3];\n                            SaleCondition = csv[4];\n                            Suspicious = csv[5] == \"1\";\n                        }\n                        else if (TickType == TickType.OpenInterest)\n                        {\n                            Value = csv[1].ToDecimal();\n                        }\n                        else\n                        {\n                            if (csv[1].Length != 0)\n                            {\n                                BidPrice = csv[1].ToDecimal()/scaleFactor;\n                                BidSize = csv[2].ToDecimal();\n                            }\n                            if (csv[3].Length != 0)\n                            {\n                                AskPrice = csv[3].ToDecimal()/scaleFactor;\n                                AskSize = csv[4].ToDecimal();\n                            }\n                            Exchange = csv[5];\n                            Suspicious = csv[6] == \"1\";\n\n                            SetValue();\n                        }\n\n                        break;\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Tick implementation of reader method: read a line of data from the source and convert it to a tick object.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration object for algorithm</param>\n        /// <param name=\"line\">Line from the datafeed source</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>New Initialized tick</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // currently ticks don't come through the reader function\n                return new Tick();\n            }\n\n            return new Tick(config, line, date);\n        }\n\n        /// <summary>\n        /// Tick implementation of reader method: read a line of data from the source and convert it to a tick object.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration object for algorithm</param>\n        /// <param name=\"stream\">The source stream reader</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>New Initialized tick</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // currently ticks don't come through the reader function\n                return new Tick();\n            }\n\n            return new Tick(config, stream, date);\n        }\n\n\n        /// <summary>\n        /// Get source for tick data feed - not used with QuantConnect data sources implementation.\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source request if source spread across multiple files</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String source location of the file to be opened with a stream</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // this data type is streamed in live mode\n                return new SubscriptionDataSource(string.Empty, SubscriptionTransportMedium.Streaming);\n            }\n\n            var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n            if (config.SecurityType == SecurityType.Future || config.SecurityType.IsOption())\n            {\n                source += \"#\" + LeanData.GenerateZipEntryName(config.Symbol, date, config.Resolution, config.TickType);\n            }\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Update the tick price information - not used.\n        /// </summary>\n        /// <param name=\"lastTrade\">This trade price</param>\n        /// <param name=\"bidPrice\">Current bid price</param>\n        /// <param name=\"askPrice\">Current asking price</param>\n        /// <param name=\"volume\">Volume of this trade</param>\n        /// <param name=\"bidSize\">The size of the current bid, if available</param>\n        /// <param name=\"askSize\">The size of the current ask, if available</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public override void Update(decimal lastTrade, decimal bidPrice, decimal askPrice, decimal volume, decimal bidSize, decimal askSize)\n        {\n            Value = lastTrade;\n            BidPrice = bidPrice;\n            AskPrice = askPrice;\n            BidSize = bidSize;\n            AskSize = askSize;\n            Quantity = Convert.ToDecimal(volume);\n        }\n\n        /// <summary>\n        /// Check if tick contains valid data (either a trade, or a bid or ask)\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsValid()\n        {\n            // Indexes have zero volume in live trading, but is still a valid tick.\n            return (TickType == TickType.Trade && (LastPrice > 0.0m && (Quantity > 0 || Symbol.SecurityType == SecurityType.Index))) ||\n                   (TickType == TickType.Quote && AskPrice > 0.0m && AskSize > 0) ||\n                   (TickType == TickType.Quote && BidPrice > 0.0m && BidSize > 0) ||\n                   (TickType == TickType.OpenInterest && Value > 0);\n        }\n\n        /// <summary>\n        /// Clone implementation for tick class:\n        /// </summary>\n        /// <returns>New tick object clone of the current class values.</returns>\n        public override BaseData Clone()\n        {\n            return new Tick(this);\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            switch (TickType)\n            {\n                case TickType.Trade:\n                    return $\"{Symbol}: Price: {Price} Quantity: {Quantity}\";\n\n                case TickType.Quote:\n                    return $\"{Symbol}: Bid: {BidSize}@{BidPrice} Ask: {AskSize}@{AskPrice}\";\n\n                case TickType.OpenInterest:\n                    return $\"{Symbol}: OpenInterest: {Value}\";\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Sets the tick Value based on ask and bid price\n        /// </summary>\n        public void SetValue()\n        {\n            Value = BidPrice + AskPrice;\n            if (BidPrice * AskPrice != 0)\n            {\n                Value /= 2m;\n            }\n        }\n\n        /// <summary>\n        /// Gets the scaling factor according to the <see cref=\"SecurityType\"/> of the <see cref=\"Symbol\"/> provided.\n        /// Non-equity data will not be scaled, including options with an underlying non-equity asset class.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to get scaling factor for</param>\n        /// <returns>Scaling factor</returns>\n        private static decimal GetScaleFactor(Symbol symbol)\n        {\n            return symbol.SecurityType == SecurityType.Equity || symbol.SecurityType == SecurityType.Option ? 10000m : 1;\n        }\n\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/Ticks.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Ticks collection which implements an IDictionary-string-list of ticks. This way users can iterate over the string indexed ticks of the requested symbol.\n    /// </summary>\n    /// <remarks>Ticks are timestamped to the nearest second in QuantConnect</remarks>\n    public class Ticks : DataDictionary<List<Tick>>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Ticks\"/> dictionary\n        /// </summary>\n        public Ticks()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Ticks\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public Ticks(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/TradeBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing ProtoBuf;\nusing System.IO;\nusing System.Threading;\nusing QuantConnect.Util;\nusing System.Globalization;\nusing QuantConnect.Logging;\nusing static QuantConnect.StringExtensions;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// TradeBar class for second and minute resolution data:\n    /// An OHLC implementation of the QuantConnect BaseData class with parameters for candles.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class TradeBar : BaseData, IBaseDataBar\n    {\n        // scale factor used in QC equity/forex data files\n        private const decimal _scaleFactor = 1 / 10000m;\n\n        protected int Initialized;\n        private decimal _open;\n        private decimal _high;\n        private decimal _low;\n\n        /// <summary>\n        /// Volume:\n        /// </summary>\n        [ProtoMember(101)]\n        public virtual decimal Volume { get; set; }\n\n        /// <summary>\n        /// Opening price of the bar: Defined as the price at the start of the time period.\n        /// </summary>\n        [ProtoMember(102)]\n        public virtual decimal Open\n        {\n            get { return _open; }\n            set\n            {\n                Initialize(value);\n                _open = value;\n            }\n        }\n\n        /// <summary>\n        /// High price of the TradeBar during the time period.\n        /// </summary>\n        [ProtoMember(103)]\n        public virtual decimal High\n        {\n            get { return _high; }\n            set\n            {\n                Initialize(value);\n                _high = value;\n            }\n        }\n\n        /// <summary>\n        /// Low price of the TradeBar during the time period.\n        /// </summary>\n        [ProtoMember(104)]\n        public virtual decimal Low\n        {\n            get { return _low; }\n            set\n            {\n                Initialize(value);\n                _low = value;\n            }\n        }\n\n        /// <summary>\n        /// Closing price of the TradeBar. Defined as the price at Start Time + TimeSpan.\n        /// </summary>\n        [ProtoMember(105)]\n        public virtual decimal Close\n        {\n            get { return Value; }\n            set\n            {\n                Initialize(value);\n                Value = value;\n            }\n        }\n\n        /// <summary>\n        /// The closing time of this bar, computed via the Time and Period\n        /// </summary>\n        [PandasIgnore]\n        public override DateTime EndTime\n        {\n            get { return Time + Period; }\n            set { Period = value - Time; }\n        }\n\n        /// <summary>\n        /// The period of this trade bar, (second, minute, daily, ect...)\n        /// </summary>\n        [ProtoMember(106)]\n        [PandasIgnore]\n        public virtual TimeSpan Period { get; set; }\n\n        //In Base Class: Alias of Closing:\n        //public decimal Price;\n\n        //Symbol of Asset.\n        //In Base Class: public Symbol Symbol;\n\n        //In Base Class: DateTime Of this TradeBar\n        //public DateTime Time;\n\n        /// <summary>\n        /// Default initializer to setup an empty tradebar.\n        /// </summary>\n        public TradeBar()\n        {\n            Symbol = Symbol.Empty;\n            DataType = MarketDataType.TradeBar;\n            Period = QuantConnect.Time.OneMinute;\n        }\n\n        /// <summary>\n        /// Cloner constructor for implementing fill forward.\n        /// Return a new instance with the same values as this original.\n        /// </summary>\n        /// <param name=\"original\">Original tradebar object we seek to clone</param>\n        public TradeBar(TradeBar original)\n        {\n            DataType = MarketDataType.TradeBar;\n            Time = new DateTime(original.Time.Ticks);\n            Symbol = original.Symbol;\n            Value = original.Close;\n            Open = original.Open;\n            High = original.High;\n            Low = original.Low;\n            Close = original.Close;\n            Volume = original.Volume;\n            Period = original.Period;\n            Initialized = 1;\n        }\n\n        /// <summary>\n        /// Initialize Trade Bar with OHLC Values:\n        /// </summary>\n        /// <param name=\"time\">DateTime Timestamp of the bar</param>\n        /// <param name=\"symbol\">Market MarketType Symbol</param>\n        /// <param name=\"open\">Decimal Opening Price</param>\n        /// <param name=\"high\">Decimal High Price of this bar</param>\n        /// <param name=\"low\">Decimal Low Price of this bar</param>\n        /// <param name=\"close\">Decimal Close price of this bar</param>\n        /// <param name=\"volume\">Volume sum over day</param>\n        /// <param name=\"period\">The period of this bar, specify null for default of 1 minute</param>\n        public TradeBar(DateTime time, Symbol symbol, decimal open, decimal high, decimal low, decimal close, decimal volume, TimeSpan? period = null)\n        {\n            Time = time;\n            Symbol = symbol;\n            Value = close;\n            Open = open;\n            High = high;\n            Low = low;\n            Close = close;\n            Volume = volume;\n            Period = period ?? QuantConnect.Time.OneMinute;\n            DataType = MarketDataType.TradeBar;\n            Initialized = 1;\n        }\n\n        /// <summary>\n        /// TradeBar Reader: Fetch the data from the QC storage and feed it line by line into the engine.\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Enumerable iterator for returning each line of the required data.</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            //Handle end of file:\n            if (line == null)\n            {\n                return null;\n            }\n\n            if (isLiveMode)\n            {\n                return new TradeBar();\n            }\n\n            try\n            {\n                switch (config.SecurityType)\n                {\n                    //Equity File Data Format:\n                    case SecurityType.Equity:\n                        return ParseEquity(config, line, date);\n\n                    //FOREX has a different data file format:\n                    case SecurityType.Forex:\n                        return ParseForex(config, line, date);\n\n                    case SecurityType.Crypto:\n                    case SecurityType.CryptoFuture:\n                        return ParseCrypto(config, line, date);\n\n                    case SecurityType.Cfd:\n                        return ParseCfd(config, line, date);\n\n                    case SecurityType.Index:\n                        return ParseIndex(config, line, date);\n\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                        return ParseOption(config, line, date);\n\n                    case SecurityType.Future:\n                        return ParseFuture(config, line, date);\n\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(Invariant($\"TradeBar.Reader(): Error parsing line: '{line}', Symbol: {config.Symbol.Value}, SecurityType: \") +\n                    Invariant($\"{config.SecurityType}, Resolution: {config.Resolution}, Date: {date:yyyy-MM-dd}, Message: {err}\")\n                );\n            }\n\n            // if we couldn't parse it above return a default instance\n            return new TradeBar { Symbol = config.Symbol, Period = config.Increment };\n        }\n\n        /// <summary>\n        /// TradeBar Reader: Fetch the data from the QC storage and feed it directly from the stream into the engine.\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"stream\">The file data stream</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Enumerable iterator for returning each line of the required data.</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            //Handle end of file:\n            if (stream == null || stream.EndOfStream)\n            {\n                return null;\n            }\n            if (isLiveMode)\n            {\n                return new TradeBar();\n            }\n\n            try\n            {\n                switch (config.SecurityType)\n                {\n                    //Equity File Data Format:\n                    case SecurityType.Equity:\n                        return ParseEquity(config, stream, date);\n\n                    //FOREX has a different data file format:\n                    case SecurityType.Forex:\n                        return ParseForex(config, stream, date);\n\n                    case SecurityType.Crypto:\n                    case SecurityType.CryptoFuture:\n                        return ParseCrypto(config, stream, date);\n\n                    case SecurityType.Index:\n                        return ParseIndex(config, stream, date);\n\n                    case SecurityType.Cfd:\n                        return ParseCfd(config, stream, date);\n\n                    case SecurityType.Option:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                        return ParseOption(config, stream, date);\n\n                    case SecurityType.Future:\n                        return ParseFuture(config, stream, date);\n\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(Invariant($\"TradeBar.Reader(): Error parsing stream, Symbol: {config.Symbol.Value}, SecurityType: \") +\n                          Invariant($\"{config.SecurityType}, Resolution: {config.Resolution}, Date: {date:yyyy-MM-dd}, Message: {err}\")\n                );\n            }\n\n            // we need to consume a line anyway, to advance the stream\n            stream.ReadLine();\n\n            // if we couldn't parse it above return a default instance\n            return new TradeBar { Symbol = config.Symbol, Period = config.Increment };\n        }\n\n        /// <summary>\n        /// Parses the trade bar data line assuming QC data formats\n        /// </summary>\n        public static TradeBar Parse(SubscriptionDataConfig config, string line, DateTime baseDate)\n        {\n            switch (config.SecurityType)\n            {\n                case SecurityType.Equity:\n                    return ParseEquity(config, line, baseDate);\n\n                case SecurityType.Forex:\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                    return ParseForex(config, line, baseDate);\n\n                case SecurityType.Cfd:\n                    return ParseCfd(config, line, baseDate);\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Parses equity trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns></returns>\n        public static T ParseEquity<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Symbol = config.Symbol,\n                Period = config.Increment\n            };\n\n            ParseEquity(tradeBar, config, line, date);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses equity trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns></returns>\n        public static TradeBar ParseEquity(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            var tradeBar = new TradeBar\n            {\n                Symbol = config.Symbol,\n                Period = config.Increment\n            };\n            StreamParseScale(config, streamReader, date, useScaleFactor: true, tradeBar, true);\n\n            return tradeBar;\n        }\n\n        private static void ParseEquity(TradeBar tradeBar, SubscriptionDataConfig config, string line, DateTime date)\n        {\n            LineParseScale(config, line, date, useScaleFactor: true, tradeBar, hasVolume: true);\n        }\n\n        /// <summary>\n        /// Parses equity trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">Date of this reader request</param>\n        /// <returns></returns>\n        public static TradeBar ParseEquity(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            var tradeBar = new TradeBar\n            {\n                Symbol = config.Symbol,\n                Period = config.Increment\n            };\n            ParseEquity(tradeBar, config, line, date);\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses forex trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseForex<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Symbol = config.Symbol,\n                Period = config.Increment\n            };\n            LineParseNoScale(config, line, date, tradeBar, hasVolume: false);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses crypto trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        public static T ParseCrypto<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Symbol = config.Symbol,\n                Period = config.Increment\n            };\n            LineParseNoScale(config, line, date, tradeBar);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses crypto trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        public static TradeBar ParseCrypto(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return LineParseNoScale(config, line, date);\n        }\n\n        /// <summary>\n        /// Parses crypto trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        public static TradeBar ParseCrypto(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return StreamParseNoScale(config, streamReader, date);\n        }\n\n        /// <summary>\n        /// Parses forex trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseForex(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return LineParseNoScale(config, line, date, hasVolume: false);\n        }\n\n        /// <summary>\n        /// Parses forex trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseForex(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return StreamParseNoScale(config, streamReader, date, hasVolume: false);\n        }\n\n        /// <summary>\n        /// Parses CFD trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseCfd<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            // CFD has the same data format as Forex\n            return ParseForex<T>(config, line, date);\n        }\n\n        /// <summary>\n        /// Parses CFD trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseCfd(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            // CFD has the same data format as Forex\n            return ParseForex(config, line, date);\n        }\n\n        /// <summary>\n        /// Parses CFD trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseCfd(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            // CFD has the same data format as Forex\n            return ParseForex(config, streamReader, date);\n        }\n\n        /// <summary>\n        /// Parses Option trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseOption<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n            LineParseScale(config, line, date, useScaleFactor: LeanData.OptionUseScaleFactor(config.Symbol), tradeBar, hasVolume: true);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses Option trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseOption<T>(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n            StreamParseScale(config, streamReader, date, useScaleFactor: LeanData.OptionUseScaleFactor(config.Symbol), tradeBar, true);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses Future trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseFuture<T>(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n            StreamParseNoScale(config, streamReader, date, tradeBar);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parses Future trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <typeparam name=\"T\">The requested output type, must derive from TradeBar</typeparam>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static T ParseFuture<T>(SubscriptionDataConfig config, string line, DateTime date)\n            where T : TradeBar, new()\n        {\n            var tradeBar = new T\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n            LineParseNoScale(config, line, date, tradeBar);\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parse an index bar from the LEAN disk format\n        /// </summary>\n        public static TradeBar ParseIndex(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return LineParseNoScale(config, line, date);\n        }\n\n        /// <summary>\n        /// Parse an index bar from the LEAN disk format\n        /// </summary>\n        private static TradeBar LineParseNoScale(SubscriptionDataConfig config, string line, DateTime date, TradeBar bar = null, bool hasVolume = true)\n        {\n            var tradeBar = bar ?? new TradeBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            var csv = line.ToCsv(hasVolume ? 6 : 5);\n            if (config.Resolution == Resolution.Daily || config.Resolution == Resolution.Hour)\n            {\n                // hourly and daily have different time format, and can use slow, robust c# parser.\n                tradeBar.Time = DateTime.ParseExact(csv[0], DateFormat.TwelveCharacter, CultureInfo.InvariantCulture).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            else\n            {\n                // Using custom \"ToDecimal\" conversion for speed on high resolution data.\n                tradeBar.Time = date.Date.AddMilliseconds(csv[0].ToInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            tradeBar.Open = csv[1].ToDecimal();\n            tradeBar.High = csv[2].ToDecimal();\n            tradeBar.Low = csv[3].ToDecimal();\n            tradeBar.Close = csv[4].ToDecimal();\n            if (hasVolume)\n            {\n                tradeBar.Volume = csv[5].ToDecimal();\n            }\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parse an index bar from the LEAN disk format\n        /// </summary>\n        private static TradeBar StreamParseNoScale(SubscriptionDataConfig config, StreamReader streamReader, DateTime date, TradeBar bar = null, bool hasVolume = true)\n        {\n            var tradeBar = bar ?? new TradeBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            if (config.Resolution == Resolution.Daily || config.Resolution == Resolution.Hour)\n            {\n                // hourly and daily have different time format, and can use slow, robust c# parser.\n                tradeBar.Time = streamReader.GetDateTime().ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            else\n            {\n                // Using custom \"ToDecimal\" conversion for speed on high resolution data.\n                tradeBar.Time = date.Date.AddMilliseconds(streamReader.GetInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone);\n            }\n            tradeBar.Open = streamReader.GetDecimal();\n            tradeBar.High = streamReader.GetDecimal();\n            tradeBar.Low = streamReader.GetDecimal();\n            tradeBar.Close = streamReader.GetDecimal();\n            if (hasVolume)\n            {\n                tradeBar.Volume = streamReader.GetDecimal();\n            }\n            return tradeBar;\n        }\n\n        private static TradeBar LineParseScale(SubscriptionDataConfig config, string line, DateTime date, bool useScaleFactor, TradeBar bar = null, bool hasVolume = true)\n        {\n            var tradeBar = bar ?? new TradeBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            LineParseNoScale(config, line, date, tradeBar, hasVolume);\n            if (useScaleFactor)\n            {\n                tradeBar.Open *= _scaleFactor;\n                tradeBar.High *= _scaleFactor;\n                tradeBar.Low *= _scaleFactor;\n                tradeBar.Close *= _scaleFactor;\n            }\n\n            return tradeBar;\n        }\n\n        private static TradeBar StreamParseScale(SubscriptionDataConfig config, StreamReader streamReader, DateTime date, bool useScaleFactor, TradeBar bar = null, bool hasVolume = true)\n        {\n            var tradeBar = bar ?? new TradeBar\n            {\n                Period = config.Increment,\n                Symbol = config.Symbol\n            };\n\n            StreamParseNoScale(config, streamReader, date, tradeBar, hasVolume);\n            if (useScaleFactor)\n            {\n                tradeBar.Open *= _scaleFactor;\n                tradeBar.High *= _scaleFactor;\n                tradeBar.Low *= _scaleFactor;\n                tradeBar.Close *= _scaleFactor;\n            }\n\n            return tradeBar;\n        }\n\n        /// <summary>\n        /// Parse an index bar from the LEAN disk format\n        /// </summary>\n        public static TradeBar ParseIndex(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return StreamParseNoScale(config, streamReader, date);\n        }\n\n        /// <summary>\n        /// Parses Option trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseOption(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseOption<TradeBar>(config, line, date);\n        }\n\n        /// <summary>\n        /// Parses Option trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseOption(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseOption<TradeBar>(config, streamReader, date);\n        }\n\n        /// <summary>\n        /// Parses Future trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"line\">Line from the data file requested</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseFuture(SubscriptionDataConfig config, string line, DateTime date)\n        {\n            return ParseFuture<TradeBar>(config, line, date);\n        }\n\n        /// <summary>\n        /// Parses Future trade bar data into the specified tradebar type, useful for custom types with OHLCV data deriving from TradeBar\n        /// </summary>\n        /// <param name=\"config\">Symbols, Resolution, DataType, </param>\n        /// <param name=\"streamReader\">The data stream of the requested file</param>\n        /// <param name=\"date\">The base data used to compute the time of the bar since the line specifies a milliseconds since midnight</param>\n        /// <returns></returns>\n        public static TradeBar ParseFuture(SubscriptionDataConfig config, StreamReader streamReader, DateTime date)\n        {\n            return ParseFuture<TradeBar>(config, streamReader, date);\n        }\n\n        /// <summary>\n        /// Update the tradebar - build the bar from this pricing information:\n        /// </summary>\n        /// <param name=\"lastTrade\">This trade price</param>\n        /// <param name=\"bidPrice\">Current bid price (not used) </param>\n        /// <param name=\"askPrice\">Current asking price (not used) </param>\n        /// <param name=\"volume\">Volume of this trade</param>\n        /// <param name=\"bidSize\">The size of the current bid, if available</param>\n        /// <param name=\"askSize\">The size of the current ask, if available</param>\n        public override void Update(decimal lastTrade, decimal bidPrice, decimal askPrice, decimal volume, decimal bidSize, decimal askSize)\n        {\n            Initialize(lastTrade);\n            if (lastTrade > High) High = lastTrade;\n            if (lastTrade < Low) Low = lastTrade;\n            //Volume is the total summed volume of trades in this bar:\n            Volume += volume;\n            //Always set the closing price;\n            Close = lastTrade;\n        }\n\n        /// <summary>\n        /// Get Source for Custom Data File\n        /// >> What source file location would you prefer for each type of usage:\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source request if source spread across multiple files</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String source location of the file</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                // this data type is streamed in live mode\n                return new SubscriptionDataSource(string.Empty, SubscriptionTransportMedium.Streaming);\n            }\n\n            var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n            if (config.SecurityType == SecurityType.Future || config.SecurityType.IsOption())\n            {\n                source += \"#\" + LeanData.GenerateZipEntryName(config.Symbol, date, config.Resolution, config.TickType);\n            }\n            return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <param name=\"fillForward\">True if this is a fill forward clone</param>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone(bool fillForward)\n        {\n            var clone = base.Clone(fillForward);\n\n            if (fillForward)\n            {\n                // zero volume out, since it would skew calculations in volume-based indicators\n                ((TradeBar)clone).Volume = 0;\n            }\n\n            return clone;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        public override BaseData Clone()\n        {\n            return (BaseData)MemberwiseClone();\n        }\n\n        /// <summary>\n        /// Formats a string with the symbol and value.\n        /// </summary>\n        /// <returns>string - a string formatted as SPY: 167.753</returns>\n        public override string ToString()\n        {\n            return $\"{Symbol}: \" +\n                   $\"O: {Open.SmartRounding()} \" +\n                   $\"H: {High.SmartRounding()} \" +\n                   $\"L: {Low.SmartRounding()} \" +\n                   $\"C: {Close.SmartRounding()} \" +\n                   $\"V: {Volume.SmartRounding()}\";\n        }\n\n        /// <summary>\n        /// Initializes this bar with a first data point\n        /// </summary>\n        /// <param name=\"value\">The seed value for this bar</param>\n        private void Initialize(decimal value)\n        {\n            if (Interlocked.CompareExchange(ref Initialized, 1, 0) == 0)\n            {\n                _open = value;\n                _low = value;\n                _high = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/TradeBars.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Collection of TradeBars to create a data type for generic data handler:\n    /// </summary>\n    public class TradeBars : DataDictionary<TradeBar>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"TradeBars\"/> dictionary\n        /// </summary>\n        public TradeBars()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"TradeBars\"/> dictionary\n        /// </summary>\n        /// <param name=\"frontier\">The time associated with the data in this dictionary</param>\n        public TradeBars(DateTime frontier)\n            : base(frontier)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Market/VolumeRenkoBar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Data.Market\n{\n    /// <summary>\n    /// Represents a bar sectioned not by time, but by some amount of movement in volume\n    /// </summary>\n    public class VolumeRenkoBar : BaseRenkoBar\n    {\n        /// <summary>\n        /// Gets whether or not this bar is considered closed.\n        /// </summary>\n        public override bool IsClosed => Volume >= BrickSize;\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"RenkoBar\"/> class.\n        /// </summary>\n        public VolumeRenkoBar()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeRenkoBar\"/> class with the specified values\n        /// </summary>\n        /// <param name=\"symbol\">symbol of the data</param>\n        /// <param name=\"start\">The current data start time</param>\n        /// <param name=\"endTime\">The current data end time</param>\n        /// <param name=\"brickSize\">The preset volume capacity of this bar</param>\n        /// <param name=\"open\">The current data open value</param>\n        /// <param name=\"high\">The current data high value</param>\n        /// <param name=\"low\">The current data low value</param>\n        /// <param name=\"close\">The current data close value</param>\n        /// <param name=\"volume\">The current data volume</param>\n        public VolumeRenkoBar(Symbol symbol, DateTime start, DateTime endTime, decimal brickSize, decimal open, decimal high, decimal low, decimal close, decimal volume)\n        {\n            Type = RenkoType.Classic;\n            BrickSize = brickSize;\n\n            Symbol = symbol;\n            Start = start;\n            EndTime = endTime;\n            Open = open;\n            Close = close;\n            Volume = volume;\n            High = high;\n            Low = low;\n        }\n\n        /// <summary>\n        /// Updates this <see cref=\"VolumeRenkoBar\"/> with the specified values and returns whether or not this bar is closed\n        /// </summary>\n        /// <param name=\"time\">The current data end time</param>\n        /// <param name=\"high\">The current data high value</param>\n        /// <param name=\"low\">The current data low value</param>\n        /// <param name=\"close\">The current data close value</param>\n        /// <param name=\"volume\">The current data volume</param>\n        /// <returns>The excess volume that the current bar cannot absorb</returns>\n        public decimal Update(DateTime time, decimal high, decimal low, decimal close, decimal volume)\n        {\n            // can't update a closed renko bar\n            if (IsClosed) return 0m;\n            EndTime = time;\n\n            var excessVolume = Volume + volume - BrickSize;\n            if (excessVolume > 0)\n            {\n                Volume = BrickSize;\n            }\n            else\n            {\n                Volume += volume;\n            }\n\n            Close = close;\n            if (high > High) High = high;\n            if (low < Low) Low = low;\n\n            return excessVolume;\n        }\n\n        /// <summary>\n        /// Create a new <see cref=\"VolumeRenkoBar\"/> with previous information rollover\n        /// </summary>\n        public VolumeRenkoBar Rollover()\n        {\n            return new VolumeRenkoBar\n            {\n                Type = Type,\n                BrickSize = BrickSize,\n                Symbol = Symbol,\n                Open = Close,           // rollover open is the previous close\n                High = Close,\n                Low = Close,\n                Close = Close,\n                Start = EndTime,        // rollover start time is the previous end time\n                EndTime = EndTime,\n                Volume = 0m\n            };\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/Shortable/InteractiveBrokersShortableProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Data.Shortable\n{\n    /// <summary>\n    /// Sources the InteractiveBrokers short availability data from the local disk for the given brokerage\n    /// </summary>\n    public class InteractiveBrokersShortableProvider : LocalDiskShortableProvider\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public InteractiveBrokersShortableProvider()\n            : base(\"interactivebrokers\")\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Shortable/LocalDiskShortableProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Util;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace QuantConnect.Data.Shortable\n{\n    /// <summary>\n    /// Sources short availability data from the local disk for the given brokerage\n    /// </summary>\n    public class LocalDiskShortableProvider : IShortableProvider\n    {\n        /// <summary>\n        /// The data provider instance to use\n        /// </summary>\n        protected static IDataProvider DataProvider = Composer.Instance.GetPart<IDataProvider>();\n\n        private string _ticker;\n        private bool _scheduledCleanup;\n        private Dictionary<DateTime, ShortableData> _shortableDataPerDate;\n\n        /// <summary>\n        /// The short availability provider\n        /// </summary>\n        protected string Brokerage { get; set; }\n\n        /// <summary>\n        /// Creates an instance of the class. Establishes the directory to read from.\n        /// </summary>\n        /// <param name=\"brokerage\">Brokerage to read the short availability data</param>\n        public LocalDiskShortableProvider(string brokerage)\n        {\n            Brokerage = brokerage.ToLowerInvariant();\n        }\n\n        /// <summary>\n        /// Gets interest rate charged on borrowed shares for a given asset.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup fee rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>Fee rate. Zero if the data for the brokerage/date does not exist.</returns>\n        public decimal FeeRate(Symbol symbol, DateTime localTime)\n        {\n            if (symbol != null && GetCacheData(symbol).TryGetValue(localTime.Date, out var result))\n            {\n                return result.FeeRate;\n            }\n            // Any missing entry will be considered to be zero.\n            return 0m;\n        }\n\n        /// <summary>\n        /// Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset.\n        /// E.g.: Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup rebate rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>Rebate fee. Zero if the data for the brokerage/date does not exist.</returns>\n        public decimal RebateRate(Symbol symbol, DateTime localTime)\n        {\n            if (symbol != null && GetCacheData(symbol).TryGetValue(localTime.Date, out var result))\n            {\n                return result.RebateFee;\n            }\n            // Any missing entry will be considered to be zero.\n            return 0m;\n        }\n\n        /// <summary>\n        /// Gets the quantity shortable for the Symbol at the given date.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup shortable quantity</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>Quantity shortable. Null if the data for the brokerage/date does not exist.</returns>\n        public long? ShortableQuantity(Symbol symbol, DateTime localTime)\n        {\n            if (symbol != null && GetCacheData(symbol).TryGetValue(localTime.Date, out var result))\n            {\n                return result.ShortableQuantity;\n            }\n            // Any missing entry will be considered to be Shortable.\n            return null;\n        }\n\n        /// <summary>\n        /// We cache data per ticker\n        /// </summary>\n        /// <param name=\"symbol\">The requested symbol</param>\n        private Dictionary<DateTime, ShortableData> GetCacheData(Symbol symbol)\n        {\n            var result = _shortableDataPerDate;\n            if (_ticker == symbol.Value)\n            {\n                return result;\n            }\n\n            if (!_scheduledCleanup)\n            {\n                // we schedule it once\n                _scheduledCleanup = true;\n                ClearCache();\n            }\n\n            // create a new collection\n            _ticker = symbol.Value;\n            result = _shortableDataPerDate = new();\n\n            // Implicitly trusts that Symbol.Value has been mapped and updated to the latest ticker\n            var shortableSymbolFile = Path.Combine(Globals.DataFolder, symbol.SecurityType.SecurityTypeToLower(), symbol.ID.Market,\n                \"shortable\", Brokerage, \"symbols\", $\"{_ticker.ToLowerInvariant()}.csv\");\n\n            foreach (var line in DataProvider.ReadLines(shortableSymbolFile))\n            {\n                if (string.IsNullOrEmpty(line) || line.StartsWith(\"#\"))\n                {\n                    // ignore empty or comment lines\n                    continue;\n                }\n                // Data example. The rates, if available, are expressed in percentage.\n                // 20201221,2000,5.0700,0.2500\n                var csv = line.Split(',');\n                var date = Parse.DateTimeExact(csv[0], \"yyyyMMdd\");\n                var lenght = csv.Length;\n                var shortableQuantity = csv[1].IfNotNullOrEmpty(s => long.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture));\n                var rebateRate = csv.Length > 2 ? csv[2].IfNotNullOrEmpty(s => decimal.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture)) : 0;\n                var feeRate = csv.Length > 3 ? csv[3].IfNotNullOrEmpty(s => decimal.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture)) : 0;\n                result[date] = new ShortableData(shortableQuantity, rebateRate / 100, feeRate / 100);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// For live deployments we don't want to have stale short quantity so we refresh them every day\n        /// </summary>\n        private void ClearCache()\n        {\n            var now = DateTime.UtcNow;\n            var tomorrowMidnight = now.Date.AddDays(1);\n            var delayToClean = tomorrowMidnight - now;\n\n            Task.Delay(delayToClean).ContinueWith((_) =>\n            {\n                // create new instances so we don't need to worry about locks\n                _ticker = null;\n                _shortableDataPerDate = new();\n\n                ClearCache();\n            });\n        }\n\n        /// <summary>\n        /// Gets the shortable data\n        /// </summary>\n        protected record ShortableData(long? ShortableQuantity, decimal RebateFee, decimal FeeRate);\n    }\n}\n"
  },
  {
    "path": "Common/Data/Shortable/NullShortableProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data.Shortable\n{\n    /// <summary>\n    /// Defines the default shortable provider in the case that no local data exists.\n    /// This will allow for all assets to be infinitely shortable, with no restrictions.\n    /// </summary>\n    public class NullShortableProvider : IShortableProvider\n    {\n        /// <summary>\n        /// The null shortable provider instance\n        /// </summary>\n        public static NullShortableProvider Instance { get; } = new ();\n\n        /// <summary>\n        /// Gets interest rate charged on borrowed shares for a given asset.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup fee rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>zero indicating that it is does have borrowing costs</returns>\n        public decimal FeeRate(Symbol symbol, DateTime localTime)\n        {\n            return 0m;       \n        }\n\n        /// <summary>\n        /// Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset.\n        /// E.g.: Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup rebate rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>zero indicating that it is does have borrowing costs</returns>\n        public decimal RebateRate(Symbol symbol, DateTime localTime)\n        {\n            return 0m;\n        }\n\n        /// <summary>\n        /// Gets the quantity shortable for the Symbol at the given time.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check</param>\n        /// <param name=\"localTime\">Local time of the algorithm</param>\n        /// <returns>null, indicating that it is infinitely shortable</returns>\n        public long? ShortableQuantity(Symbol symbol, DateTime localTime)\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Shortable/ShortableProviderPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Python;\nusing System;\n\nnamespace QuantConnect.Data.Shortable\n{\n    /// <summary>\n    /// Python wrapper for custom shortable providers\n    /// </summary>\n    public class ShortableProviderPythonWrapper : BasePythonWrapper<IShortableProvider>, IShortableProvider\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"shortableProvider\">The python custom shortable provider</param>\n        public ShortableProviderPythonWrapper(PyObject shortableProvider)\n            : base(shortableProvider)\n        {\n        }\n\n        /// <summary>\n        /// Gets the fee rate for the Symbol at the given date.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup fee rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>zero indicating that it is does have borrowing costs</returns>\n        public decimal FeeRate(Symbol symbol, DateTime localTime)\n        {\n            return InvokeMethod<decimal>(nameof(FeeRate), symbol, localTime);\n        }\n\n        /// <summary>\n        /// Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset.\n        /// E.g.: Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup rebate rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>zero indicating that it is does have borrowing costs</returns>\n        public decimal RebateRate(Symbol symbol, DateTime localTime)\n        {\n            return InvokeMethod<decimal>(nameof(RebateRate), symbol, localTime);\n        }\n\n        /// <summary>\n        /// Gets the quantity shortable for a <see cref=\"Symbol\"/>, from python custom shortable provider\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check shortable quantity</param>\n        /// <param name=\"localTime\">Local time of the algorithm</param>\n        /// <returns>The quantity shortable for the given Symbol as a positive number. Null if the Symbol is shortable without restrictions.</returns>\n        public long? ShortableQuantity(Symbol symbol, DateTime localTime)\n        {\n            return InvokeMethod<long?>(nameof(ShortableQuantity), symbol, localTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/Slice.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing Python.Runtime;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides a data structure for all of an algorithm's data at a single time step\n    /// </summary>\n    public class Slice : ExtendedDictionary<Symbol, dynamic>, IEnumerable<KeyValuePair<Symbol, BaseData>>\n    {\n        private Ticks _ticks;\n        private TradeBars _bars;\n        private QuoteBars _quoteBars;\n        private OptionChains _optionChains;\n        private FuturesChains _futuresChains;\n\n        // aux data\n        private Splits _splits;\n        private Dividends _dividends;\n        private Delistings _delistings;\n        private SymbolChangedEvents _symbolChangedEvents;\n        private MarginInterestRates _marginInterestRates;\n\n        // string -> data   for non-tick data\n        // string -> list{data} for tick data\n        private Lazy<DataDictionary<SymbolData>> _data;\n        // UnlinkedData -> DataDictonary<UnlinkedData>\n        private Dictionary<Type, object> _dataByType;\n\n        /// <summary>\n        /// All the data hold in this slice\n        /// </summary>\n        public IEnumerable<BaseData> AllData { get; private set; }\n\n        /// <summary>\n        /// Gets the timestamp for this slice of data\n        /// </summary>\n        public DateTime Time\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the timestamp for this slice of data in UTC\n        /// </summary>\n        public DateTime UtcTime\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets whether or not this slice has data\n        /// </summary>\n        public bool HasData\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"TradeBars\"/> for this slice of data\n        /// </summary>\n        public TradeBars Bars\n        {\n            get { return _bars; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"QuoteBars\"/> for this slice of data\n        /// </summary>\n        public QuoteBars QuoteBars\n        {\n            get { return _quoteBars; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Ticks\"/> for this slice of data\n        /// </summary>\n        public Ticks Ticks\n        {\n            get { return _ticks; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"OptionChains\"/> for this slice of data\n        /// </summary>\n        public OptionChains OptionChains\n        {\n            get { return _optionChains; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"FuturesChains\"/> for this slice of data\n        /// </summary>\n        public FuturesChains FuturesChains\n        {\n            get { return _futuresChains; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"FuturesChains\"/> for this slice of data\n        /// </summary>\n        public FuturesChains FutureChains\n        {\n            get { return _futuresChains; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Splits\"/> for this slice of data\n        /// </summary>\n        public Splits Splits\n        {\n            get { return _splits; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Dividends\"/> for this slice of data\n        /// </summary>\n        public Dividends Dividends\n        {\n            get { return _dividends; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Delistings\"/> for this slice of data\n        /// </summary>\n        public Delistings Delistings\n        {\n            get { return _delistings; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Market.SymbolChangedEvents\"/> for this slice of data\n        /// </summary>\n        public SymbolChangedEvents SymbolChangedEvents\n        {\n            get { return _symbolChangedEvents; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Market.MarginInterestRates\"/> for this slice of data\n        /// </summary>\n        public MarginInterestRates MarginInterestRates\n        {\n            get { return _marginInterestRates; }\n        }\n\n        /// <summary>\n        /// Gets the number of symbols held in this slice\n        /// </summary>\n        public override int Count\n        {\n            get { return _data.Value.Count; }\n        }\n\n        /// <summary>\n        /// Gets all the symbols in this slice\n        /// </summary>\n        public virtual IReadOnlyList<Symbol> Keys\n        {\n            get { return new List<Symbol>(_data.Value.Keys); }\n        }\n\n        /// <summary>\n        /// Gets an <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the Symbol objects of the <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the Symbol objects of the object that implements <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </returns>\n        protected override IEnumerable<Symbol> GetKeys => _data.Value.Keys;\n\n        /// <summary>\n        /// Gets an <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the values in the <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the values in the object that implements <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </returns>\n        protected override IEnumerable<dynamic> GetValues => GetKeyValuePairEnumerable().Select(data => (dynamic)data.Value);\n\n        /// <summary>\n        /// Gets a list of all the data in this slice\n        /// </summary>\n        public virtual IReadOnlyList<BaseData> Values\n        {\n            get { return GetKeyValuePairEnumerable().Select(x => x.Value).ToList(); }\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<Symbol, dynamic>> GetItems() =>\n            GetKeyValuePairEnumerable().Select(kvp => KeyValuePair.Create<Symbol, dynamic>(kvp.Key, kvp.Value));\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Slice\"/> class, lazily\n        /// instantiating the <see cref=\"Slice.Bars\"/> and <see cref=\"Slice.Ticks\"/>\n        /// collections on demand\n        /// </summary>\n        /// <param name=\"time\">The timestamp for this slice of data</param>\n        /// <param name=\"data\">The raw data in this slice</param>\n        /// <param name=\"utcTime\">The timestamp for this slice of data in UTC</param>\n        public Slice(DateTime time, IEnumerable<BaseData> data, DateTime utcTime)\n            : this(time, data.ToList(), utcTime: utcTime)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Slice\"/> class, lazily\n        /// instantiating the <see cref=\"Slice.Bars\"/> and <see cref=\"Slice.Ticks\"/>\n        /// collections on demand\n        /// </summary>\n        /// <param name=\"time\">The timestamp for this slice of data</param>\n        /// <param name=\"data\">The raw data in this slice</param>\n        /// <param name=\"utcTime\">The timestamp for this slice of data in UTC</param>\n        public Slice(DateTime time, List<BaseData> data, DateTime utcTime)\n            : this(time, data, CreateCollection<TradeBars, TradeBar>(time, data),\n                CreateCollection<QuoteBars, QuoteBar>(time, data),\n                CreateTicksCollection(time, data),\n                CreateCollection<OptionChains, OptionChain>(time, data),\n                CreateCollection<FuturesChains, FuturesChain>(time, data),\n                CreateCollection<Splits, Split>(time, data),\n                CreateCollection<Dividends, Dividend>(time, data),\n                CreateCollection<Delistings, Delisting>(time, data),\n                CreateCollection<SymbolChangedEvents, SymbolChangedEvent>(time, data),\n                CreateCollection<MarginInterestRates, MarginInterestRate>(time, data),\n                utcTime: utcTime)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance used by the <see cref=\"PythonSlice\"/>\n        /// </summary>\n        /// <param name=\"slice\">slice object to wrap</param>\n        /// <remarks>This is required so that python slice enumeration works correctly since it relies on the private <see cref=\"_data\"/> collection</remarks>\n        protected Slice(Slice slice)\n        {\n            Time = slice.Time;\n            UtcTime = slice.UtcTime;\n            AllData = slice.AllData;\n            _dataByType = slice._dataByType;\n\n            _data = slice._data;\n\n            HasData = slice.HasData;\n\n            _ticks = slice._ticks;\n            _bars = slice._bars;\n            _quoteBars = slice._quoteBars;\n            _optionChains = slice._optionChains;\n            _futuresChains = slice._futuresChains;\n\n            // auxiliary data\n            _splits = slice._splits;\n            _dividends = slice._dividends;\n            _delistings = slice._delistings;\n            _symbolChangedEvents = slice._symbolChangedEvents;\n            _marginInterestRates = slice._marginInterestRates;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Slice\"/> class\n        /// </summary>\n        /// <param name=\"time\">The timestamp for this slice of data</param>\n        /// <param name=\"data\">The raw data in this slice</param>\n        /// <param name=\"tradeBars\">The trade bars for this slice</param>\n        /// <param name=\"quoteBars\">The quote bars for this slice</param>\n        /// <param name=\"ticks\">This ticks for this slice</param>\n        /// <param name=\"optionChains\">The option chains for this slice</param>\n        /// <param name=\"futuresChains\">The futures chains for this slice</param>\n        /// <param name=\"splits\">The splits for this slice</param>\n        /// <param name=\"dividends\">The dividends for this slice</param>\n        /// <param name=\"delistings\">The delistings for this slice</param>\n        /// <param name=\"symbolChanges\">The symbol changed events for this slice</param>\n        /// <param name=\"marginInterestRates\">The margin interest rates for this slice</param>\n        /// <param name=\"utcTime\">The timestamp for this slice of data in UTC</param>\n        /// <param name=\"hasData\">true if this slice contains data</param>\n        public Slice(DateTime time, List<BaseData> data, TradeBars tradeBars, QuoteBars quoteBars, Ticks ticks, OptionChains optionChains, FuturesChains futuresChains, Splits splits, Dividends dividends, Delistings delistings, SymbolChangedEvents symbolChanges, MarginInterestRates marginInterestRates, DateTime utcTime, bool? hasData = null)\n        {\n            Time = time;\n            UtcTime = utcTime;\n            AllData = data;\n            // market data\n            _data = new Lazy<DataDictionary<SymbolData>>(() => CreateDynamicDataDictionary(AllData));\n\n            HasData = hasData ?? _data.Value.Count > 0;\n\n            _ticks = ticks;\n            _bars = tradeBars;\n            _quoteBars = quoteBars;\n            _optionChains = optionChains;\n            _futuresChains = futuresChains;\n\n            // auxiliary data\n            _splits = splits;\n            _dividends = dividends;\n            _delistings = delistings;\n            _symbolChangedEvents = symbolChanges;\n            _marginInterestRates = marginInterestRates;\n        }\n\n        /// <summary>\n        /// Gets the data corresponding to the specified symbol. If the requested data\n        /// is of <see cref=\"MarketDataType.Tick\"/>, then a <see cref=\"List{Tick}\"/> will\n        /// be returned, otherwise, it will be the subscribed type, for example, <see cref=\"TradeBar\"/>\n        /// or event <see cref=\"UnlinkedData\"/> for custom data.\n        /// </summary>\n        /// <param name=\"symbol\">The data's symbols</param>\n        /// <returns>The data for the specified symbol</returns>\n        public override dynamic this[Symbol symbol]\n        {\n            get\n            {\n                SymbolData value;\n                if (_data.Value.TryGetValue(symbol, out value))\n                {\n                    return value.GetData();\n                }\n                CheckForImplicitlyCreatedSymbol(symbol);\n                throw new KeyNotFoundException($\"'{symbol}' wasn't found in the Slice object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with data.ContainsKey(\\\"{symbol}\\\")\");\n            }\n            set\n            {\n                // this is a no-op, we don't want to allow setting data in the slice\n                // this is a read-only collection\n                throw new NotSupportedException(\"The Slice object is read-only. You cannot set data in the slice.\");\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"DataDictionary{T}\"/> for all data of the specified type\n        /// </summary>\n        /// <typeparam name=\"T\">The type of data we want, for example, <see cref=\"TradeBar\"/> or <see cref=\"UnlinkedData\"/>, etc...</typeparam>\n        /// <returns>The <see cref=\"DataDictionary{T}\"/> containing the data of the specified type</returns>\n        public DataDictionary<T> Get<T>()\n            where T : IBaseData\n        {\n            return GetImpl(typeof(T));\n        }\n\n        /// <summary>\n        /// Gets the data of the specified type.\n        /// </summary>\n        /// <param name=\"type\">The type of data we seek</param>\n        /// <returns>The <see cref=\"DataDictionary{T}\"/> instance for the requested type</returns>\n        public dynamic Get(Type type)\n        {\n            return GetImpl(type);\n        }\n\n        /// <summary>\n        /// Gets the data of the specified symbol and type.\n        /// </summary>\n        /// <param name=\"type\">The type of data we seek</param>\n        /// <param name=\"symbol\">The specific symbol was seek</param>\n        /// <returns>The data point for the requested symbol</returns>\n        public PyObject Get(PyObject type, Symbol symbol)\n        {\n            using var _ = Py.GIL();\n            var datapoint = (object)GetImpl(type.CreateType())[symbol];\n            return datapoint.ToPython();\n        }\n\n        /// <summary>\n        /// Gets the data of the specified data type.\n        /// </summary>\n        /// <param name=\"type\">The type of data we seek</param>\n        /// <returns>The data dictionary for the requested data type</returns>\n        public PyObject Get(PyObject type)\n        {\n            using var _ = Py.GIL();\n            var dataDictionary = (object)GetImpl(type.CreateType());\n            return dataDictionary.ToPython();\n        }\n\n        /// <summary>\n        /// Gets the data of the specified type.\n        /// </summary>\n        /// <remarks>Supports both C# and Python use cases</remarks>\n        private dynamic GetImpl(Type type)\n        {\n            if (type == typeof(Fundamentals))\n            {\n                // backwards compatibility for users doing a get of Fundamentals type\n                type = typeof(FundamentalUniverse);\n            }\n            else if (type == typeof(ETFConstituentData))\n            {\n                // backwards compatibility for users doing a get of ETFConstituentData type\n                type = typeof(ETFConstituentUniverse);\n            }\n\n            if (_dataByType == null)\n            {\n                // for performance we only really create this collection if someone used it\n                _dataByType = new Dictionary<Type, object>(1);\n            }\n\n            object dictionary;\n            if (!_dataByType.TryGetValue(type, out dictionary))\n            {\n                var requestedOpenInterest = type == typeof(OpenInterest);\n                if (type == typeof(Tick) || requestedOpenInterest)\n                {\n                    var dataDictionaryCache = GenericDataDictionary.Get(type, isPythonData: false);\n                    dictionary = Activator.CreateInstance(dataDictionaryCache.GenericType);\n                    ((dynamic)dictionary).Time = Time;\n\n                    foreach (var data in Ticks)\n                    {\n                        var symbol = data.Key;\n                        // preserving existing behavior we will return the last data point, users expect a 'DataDictionary<Tick> : IDictionary<Symbol, Tick>'.\n                        // openInterest is stored with the Ticks collection\n                        var lastDataPoint = data.Value.LastOrDefault(tick => requestedOpenInterest && tick.TickType == TickType.OpenInterest || !requestedOpenInterest && tick.TickType != TickType.OpenInterest);\n                        if (lastDataPoint == null)\n                        {\n                            continue;\n                        }\n                        dataDictionaryCache.MethodInfo.Invoke(dictionary, new object[] { symbol, lastDataPoint });\n                    }\n                }\n                else if (type == typeof(TradeBar))\n                {\n                    dictionary = Bars;\n                }\n                else if (type == typeof(QuoteBar))\n                {\n                    dictionary = QuoteBars;\n                }\n                else if (type == typeof(Delisting))\n                {\n                    dictionary = Delistings;\n                }\n                else if (type == typeof(Split))\n                {\n                    dictionary = Splits;\n                }\n                else if (type == typeof(OptionChain))\n                {\n                    dictionary = OptionChains;\n                }\n                else if (type == typeof(FuturesChain))\n                {\n                    dictionary = FuturesChains;\n                }\n                else if (type == typeof(Dividend))\n                {\n                    dictionary = Dividends;\n                }\n                else if (type == typeof(SymbolChangedEvent))\n                {\n                    dictionary = SymbolChangedEvents;\n                }\n                else if (type == typeof(MarginInterestRate))\n                {\n                    dictionary = MarginInterestRates;\n                }\n                else\n                {\n                    var isPythonData = type.IsAssignableTo(typeof(PythonData));\n\n                    var dataDictionaryCache = GenericDataDictionary.Get(type, isPythonData);\n                    dictionary = Activator.CreateInstance(dataDictionaryCache.GenericType);\n                    ((dynamic)dictionary).Time = Time;\n\n                    foreach (var data in _data.Value.Values)\n                    {\n                        // let's first check custom data, else double check the user isn't requesting auxiliary data we have\n                        if (IsDataPointOfType(data.Custom, type, isPythonData))\n                        {\n                            dataDictionaryCache.MethodInfo.Invoke(dictionary, new object[] { data.Symbol, data.Custom });\n                        }\n                        else\n                        {\n                            foreach (var auxiliaryData in data.AuxilliaryData.Where(x => IsDataPointOfType(x, type, isPythonData)))\n                            {\n                                dataDictionaryCache.MethodInfo.Invoke(dictionary, new object[] { data.Symbol, auxiliaryData });\n                            }\n                        }\n                    }\n                }\n\n                _dataByType[type] = dictionary;\n            }\n            return dictionary;\n        }\n\n        /// <summary>\n        /// Gets the data of the specified symbol and type.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of data we seek</typeparam>\n        /// <param name=\"symbol\">The specific symbol was seek</param>\n        /// <returns>The data for the requested symbol</returns>\n        public T Get<T>(Symbol symbol)\n            where T : BaseData\n        {\n            return Get<T>()[symbol];\n        }\n\n        /// <summary>\n        /// Determines whether this instance contains data for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol we seek data for</param>\n        /// <returns>True if this instance contains data for the symbol, false otherwise</returns>\n        public override bool ContainsKey(Symbol symbol)\n        {\n            return _data.Value.ContainsKey(symbol);\n        }\n\n        /// <summary>\n        /// Gets the data associated with the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol we want data for</param>\n        /// <param name=\"data\">The data for the specifed symbol, or null if no data was found</param>\n        /// <returns>True if data was found, false otherwise</returns>\n        public override bool TryGetValue(Symbol symbol, out dynamic data)\n        {\n            data = null;\n            SymbolData symbolData;\n            if (_data.Value.TryGetValue(symbol, out symbolData))\n            {\n                data = symbolData.GetData();\n                return data != null;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Merge two slice with same Time\n        /// </summary>\n        /// <param name=\"inputSlice\">slice instance</param>\n        /// <remarks> Will change the input collection for re-use</remarks>\n        public void MergeSlice(Slice inputSlice)\n        {\n            if (UtcTime != inputSlice.UtcTime)\n            {\n                throw new InvalidOperationException($\"Slice with time {UtcTime} can't be merged with given slice with different {inputSlice.UtcTime}\");\n            }\n\n            _bars = (TradeBars)UpdateCollection(_bars, inputSlice.Bars);\n            _quoteBars = (QuoteBars)UpdateCollection(_quoteBars, inputSlice.QuoteBars);\n            _ticks = (Ticks)UpdateCollection(_ticks, inputSlice.Ticks);\n            _optionChains = (OptionChains)UpdateCollection(_optionChains, inputSlice.OptionChains);\n            _futuresChains = (FuturesChains)UpdateCollection(_futuresChains, inputSlice.FuturesChains);\n            _splits = (Splits)UpdateCollection(_splits, inputSlice.Splits);\n            _dividends = (Dividends)UpdateCollection(_dividends, inputSlice.Dividends);\n            _delistings = (Delistings)UpdateCollection(_delistings, inputSlice.Delistings);\n            _symbolChangedEvents = (SymbolChangedEvents)UpdateCollection(_symbolChangedEvents, inputSlice.SymbolChangedEvents);\n            _marginInterestRates = (MarginInterestRates)UpdateCollection(_marginInterestRates, inputSlice.MarginInterestRates);\n\n            var ourDataList = (List<BaseData>)AllData;\n            var othersDataList = (List<BaseData>)inputSlice.AllData;\n            if (othersDataList.Count != 0)\n            {\n                if (ourDataList.Count == 0)\n                {\n                    AllData = othersDataList;\n                    _data = inputSlice._data;\n                }\n                else\n                {\n                    // Should keep this._rawDataList last so that selected data points are not overriden\n                    // while creating _data\n                    othersDataList.AddRange(ourDataList);\n                    AllData = othersDataList;\n                    _data = new Lazy<DataDictionary<SymbolData>>(() => CreateDynamicDataDictionary(AllData));\n                }\n            }\n        }\n\n        private static DataDictionary<T> UpdateCollection<T>(DataDictionary<T> baseCollection, DataDictionary<T> inputCollection)\n        {\n            if (baseCollection == null || baseCollection.Count == 0)\n            {\n                return inputCollection;\n            }\n            if (inputCollection?.Count > 0)\n            {\n                foreach (var kvp in inputCollection)\n                {\n                    if (!baseCollection.ContainsKey(kvp.Key))\n                    {\n                        baseCollection.Add(kvp.Key, kvp.Value);\n                    }\n                }\n            }\n            return baseCollection;\n        }\n\n        /// <summary>\n        /// Produces the dynamic data dictionary from the input data\n        /// </summary>\n        private static DataDictionary<SymbolData> CreateDynamicDataDictionary(IEnumerable<BaseData> data)\n        {\n            var allData = new DataDictionary<SymbolData>();\n            foreach (var datum in data)\n            {\n                // we only will cache the default data type to preserve determinism and backwards compatibility\n                if (!SubscriptionManager.IsDefaultDataType(datum))\n                {\n                    continue;\n                }\n                SymbolData symbolData;\n                if (!allData.TryGetValue(datum.Symbol, out symbolData))\n                {\n                    symbolData = new SymbolData(datum.Symbol);\n                    allData[datum.Symbol] = symbolData;\n                }\n\n                switch (datum.DataType)\n                {\n                    case MarketDataType.Base:\n                        symbolData.Type = SubscriptionType.Custom;\n                        symbolData.Custom = datum;\n                        break;\n\n                    case MarketDataType.TradeBar:\n                        symbolData.Type = SubscriptionType.TradeBar;\n                        symbolData.TradeBar = (TradeBar)datum;\n                        break;\n\n                    case MarketDataType.QuoteBar:\n                        symbolData.Type = SubscriptionType.QuoteBar;\n                        symbolData.QuoteBar = (QuoteBar)datum;\n                        break;\n\n                    case MarketDataType.Tick:\n                        symbolData.Type = SubscriptionType.Tick;\n                        symbolData.Ticks.Add((Tick)datum);\n                        break;\n\n                    case MarketDataType.Auxiliary:\n                        symbolData.AuxilliaryData.Add(datum);\n                        break;\n\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n            }\n            return allData;\n        }\n\n        /// <summary>\n        /// Dynamically produces a <see cref=\"Ticks\"/> data dictionary using the provided data\n        /// </summary>\n        private static Ticks CreateTicksCollection(DateTime time, IEnumerable<BaseData> data)\n        {\n            var ticks = new Ticks(time);\n            foreach (var tick in data.OfType<Tick>())\n            {\n                List<Tick> listTicks;\n                if (!ticks.TryGetValue(tick.Symbol, out listTicks))\n                {\n                    ticks[tick.Symbol] = listTicks = new List<Tick>();\n                }\n                listTicks.Add(tick);\n            }\n            return ticks;\n        }\n\n        /// <summary>\n        /// Dynamically produces a data dictionary for the requested type using the provided data\n        /// </summary>\n        /// <typeparam name=\"T\">The data dictionary type</typeparam>\n        /// <typeparam name=\"TItem\">The item type of the data dictionary</typeparam>\n        /// <param name=\"time\">The current slice time</param>\n        /// <param name=\"data\">The data to create the collection</param>\n        /// <returns>The data dictionary of <typeparamref name=\"TItem\"/> containing all the data of that type in this slice</returns>\n        private static T CreateCollection<T, TItem>(DateTime time, IEnumerable<BaseData> data)\n            where T : DataDictionary<TItem>, new()\n            where TItem : BaseData\n        {\n            var collection = new T\n            {\n#pragma warning disable 618 // This assignment is left here until the Time property is removed.\n                Time = time\n#pragma warning restore 618\n            };\n            foreach (var item in data.OfType<TItem>())\n            {\n                collection[item.Symbol] = item;\n            }\n            return collection;\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<KeyValuePair<Symbol, BaseData>> GetEnumerator()\n        {\n            return GetKeyValuePairEnumerable().GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        private IEnumerable<KeyValuePair<Symbol, BaseData>> GetKeyValuePairEnumerable()\n        {\n            // this will not enumerate auxilliary data!\n\n            foreach (var kvp in _data.Value)\n            {\n                var data = kvp.Value.GetData();\n\n                var dataPoints = data as IEnumerable<BaseData>;\n                if (dataPoints != null)\n                {\n                    foreach (var dataPoint in dataPoints)\n                    {\n                        yield return new KeyValuePair<Symbol, BaseData>(kvp.Key, dataPoint);\n                    }\n                }\n                else if (data != null)\n                {\n                    yield return new KeyValuePair<Symbol, BaseData>(kvp.Key, data);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if the given data point is of a specific type\n        /// </summary>\n        private static bool IsDataPointOfType(BaseData o, Type type, bool isPythonData)\n        {\n            if (o == null)\n            {\n                return false;\n            }\n            if (isPythonData && o is PythonData data)\n            {\n                return data.IsOfType(type);\n            }\n            return o.GetType() == type;\n        }\n\n        private enum SubscriptionType { TradeBar, QuoteBar, Tick, Custom };\n        private class SymbolData\n        {\n            public SubscriptionType Type;\n            public readonly Symbol Symbol;\n\n            // data\n            public BaseData Custom;\n            public TradeBar TradeBar;\n            public QuoteBar QuoteBar;\n            public readonly List<Tick> Ticks;\n            public readonly List<BaseData> AuxilliaryData;\n\n            public SymbolData(Symbol symbol)\n            {\n                Symbol = symbol;\n                Ticks = new List<Tick>();\n                AuxilliaryData = new List<BaseData>();\n            }\n\n            public dynamic GetData()\n            {\n                switch (Type)\n                {\n                    case SubscriptionType.TradeBar:\n                        return TradeBar;\n                    case SubscriptionType.QuoteBar:\n                        return QuoteBar;\n                    case SubscriptionType.Tick:\n                        return Ticks;\n                    case SubscriptionType.Custom:\n                        return Custom;\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper class for generic <see cref=\"DataDictionary{T}\"/>\n        /// </summary>\n        /// <remarks>The value of this class is primarily performance since it keeps a cache\n        /// of the generic types instances and there add methods.</remarks>\n        private class GenericDataDictionary\n        {\n            private static Dictionary<Type, GenericDataDictionary> _genericCache = new Dictionary<Type, GenericDataDictionary>();\n\n            /// <summary>\n            /// The <see cref=\"DataDictionary{T}.Add(KeyValuePair{QuantConnect.Symbol,T})\"/> method\n            /// </summary>\n            public MethodInfo MethodInfo { get; }\n\n            /// <summary>\n            /// The <see cref=\"DataDictionary{T}\"/> type\n            /// </summary>\n            public Type GenericType { get; }\n\n            private GenericDataDictionary(Type genericType, MethodInfo methodInfo)\n            {\n                GenericType = genericType;\n                MethodInfo = methodInfo;\n            }\n\n            /// <summary>\n            /// Provides a <see cref=\"GenericDataDictionary\"/> instance for a given <see cref=\"Type\"/>\n            /// </summary>\n            /// <param name=\"type\">The requested data type</param>\n            /// <param name=\"isPythonData\">True if data is of <see cref=\"PythonData\"/> type</param>\n            /// <returns>A new instance or retrieved from the cache</returns>\n            public static GenericDataDictionary Get(Type type, bool isPythonData)\n            {\n                if (!_genericCache.TryGetValue(type, out var dataDictionaryCache))\n                {\n                    var dictionaryType = type;\n                    if (isPythonData)\n                    {\n                        // let's create a python data dictionary because the data itself will be a PythonData type in C#\n                        dictionaryType = typeof(PythonData);\n                    }\n                    var generic = typeof(DataDictionary<>).MakeGenericType(dictionaryType);\n                    var method = generic.GetMethod(\"Add\", new[] { typeof(Symbol), dictionaryType });\n\n                    // Replace the cache instance with a new one instead of locking in order to avoid the overhead\n                    var temp = new Dictionary<Type, GenericDataDictionary>(_genericCache);\n                    temp[type] = dataDictionaryCache = new GenericDataDictionary(generic, method);\n                    _genericCache = temp;\n                }\n\n                return dataDictionaryCache;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SliceExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides extension methods to slices and slice enumerables\n    /// </summary>\n    public static class SliceExtensions\n    {\n        /// <summary>\n        /// Selects into the slice and returns the TradeBars that have data in order\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <returns>An enumerable of TradeBars</returns>\n        public static IEnumerable<TradeBars> TradeBars(this IEnumerable<Slice> slices)\n        {\n            return slices.Where(x => x.Bars.Count > 0).Select(x => x.Bars);\n        }\n\n        /// <summary>\n        /// Selects into the slice and returns the Ticks that have data in order\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <returns>An enumerable of Ticks</returns>\n        public static IEnumerable<Ticks> Ticks(this IEnumerable<Slice> slices)\n        {\n            return slices.Where(x => x.Ticks.Count > 0).Select(x => x.Ticks);\n        }\n\n        /// <summary>\n        /// Gets the data dictionaries or points of the requested type in each slice\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <returns>An enumerable of data dictionary or data point of the requested type</returns>\n        public static IEnumerable<DataDictionary<BaseDataCollection>> GetUniverseData(this IEnumerable<Slice> slices)\n        {\n            return slices.SelectMany(x => x.AllData).Select(x =>\n            {\n                // we wrap the universe data collection into a data dictionary so it fits the api pattern\n                return new DataDictionary<BaseDataCollection>(new[] { (BaseDataCollection)x }, (y) => y.Symbol);\n            });\n        }\n\n        /// <summary>\n        /// Gets the data dictionaries or points of the requested type in each slice\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <param name=\"type\">Data type of the data that will be fetched</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <returns>An enumerable of data dictionary or data point of the requested type</returns>\n        public static IEnumerable<dynamic> Get(this IEnumerable<Slice> slices, Type type, Symbol symbol = null)\n        {\n            var result = slices.Select(x => x.Get(type));\n\n            if (symbol == null)\n            {\n                return result;\n            }\n\n            return result.Where(x => x.ContainsKey(symbol)).Select(x => x[symbol]);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of TradeBar for the given symbol. This method does not verify\n        /// that the specified symbol points to a TradeBar\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <returns>An enumerable of TradeBar for the matching symbol, of no TradeBar found for symbol, empty enumerable is returned</returns>\n        public static IEnumerable<TradeBar> Get(this IEnumerable<Slice> slices, Symbol symbol)\n        {\n            return slices.TradeBars().Where(x => x.ContainsKey(symbol)).Select(x => x[symbol]);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of T for the given symbol. This method does not vify\n        /// that the specified symbol points to a T\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"dataDictionaries\">The data dictionary enumerable to access</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <returns>An enumerable of T for the matching symbol, if no T is found for symbol, empty enumerable is returned</returns>\n        public static IEnumerable<T> Get<T>(this IEnumerable<DataDictionary<T>> dataDictionaries, Symbol symbol)\n            where T : IBaseData\n        {\n            return dataDictionaries.Where(x => x.ContainsKey(symbol)).Select(x => x[symbol]);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of decimals by accessing the specified field on data for the symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"dataDictionaries\">An enumerable of data dictionaries</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <param name=\"field\">The field to access</param>\n        /// <returns>An enumerable of decimals</returns>\n        public static IEnumerable<decimal> Get<T>(this IEnumerable<DataDictionary<T>> dataDictionaries, Symbol symbol, string field)\n        {\n            Func<T, decimal> selector;\n            if (typeof (DynamicData).IsAssignableFrom(typeof (T)))\n            {\n                selector = data =>\n                {\n                    var dyn = (DynamicData) (object) data;\n                    return (decimal) dyn.GetProperty(field);\n                };\n            }\n            else if (typeof (T) == typeof (List<Tick>))\n            {\n                // perform the selection on the last tick\n                // NOTE: This is a known bug, should be updated to perform the selection on each item in the list\n                var dataSelector = (Func<Tick, decimal>) ExpressionBuilder.MakePropertyOrFieldSelector(typeof (Tick), field).Compile();\n                selector = ticks => dataSelector(((List<Tick>) (object) ticks).Last());\n            }\n            else\n            {\n                selector = (Func<T, decimal>) ExpressionBuilder.MakePropertyOrFieldSelector(typeof (T), field).Compile();\n            }\n\n            foreach (var dataDictionary in dataDictionaries)\n            {\n                T item;\n                if (dataDictionary.TryGetValue(symbol, out item))\n                {\n                    yield return selector(item);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the data dictionaries of the requested type in each slice\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <returns>An enumerable of data dictionary of the requested type</returns>\n        public static IEnumerable<DataDictionary<T>> Get<T>(this IEnumerable<Slice> slices)\n            where T : IBaseData\n        {\n            return slices.Select(x => x.Get<T>()).Where(x => x.Count > 0);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of T by accessing the slices for the requested symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <returns>An enumerable of T by accessing each slice for the requested symbol</returns>\n        public static IEnumerable<T> Get<T>(this IEnumerable<Slice> slices, Symbol symbol)\n            where T : IBaseData\n        {\n            return slices.Select(x => x.Get<T>()).Where(x => x.ContainsKey(symbol)).Select(x => x[symbol]);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of decimal by accessing the slice for the symbol and then retrieving the specified\n        /// field on each piece of data\n        /// </summary>\n        /// <param name=\"slices\">The enumerable of slice</param>\n        /// <param name=\"symbol\">The symbol to retrieve</param>\n        /// <param name=\"field\">The field selector used to access the dats</param>\n        /// <returns>An enumerable of decimal</returns>\n        public static IEnumerable<decimal> Get(this IEnumerable<Slice> slices, Symbol symbol, Func<BaseData, decimal> field)\n        {\n            foreach (var slice in slices)\n            {\n                dynamic item;\n                if (slice.TryGetValue(symbol, out item))\n                {\n                    if (item is List<Tick>) yield return field(item.Last());\n                    else yield return field(item);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Tries to get the data for the specified symbol and type\n        /// </summary>\n        /// <typeparam name=\"T\">The type of data we want, for example, <see cref=\"TradeBar\"/> or <see cref=\"UnlinkedData\"/>, etc...</typeparam>\n        /// <param name=\"slice\">The slice</param>\n        /// <param name=\"symbol\">The symbol data is sought for</param>\n        /// <param name=\"data\">The found data</param>\n        /// <returns>True if data was found for the specified type and symbol</returns>\n        public static bool TryGet<T>(this Slice slice, Symbol symbol, out T data)\n            where T : IBaseData\n        {\n            data = default(T);\n            var typeData = slice.Get(typeof(T)) as DataDictionary<T>;\n            if (typeData.ContainsKey(symbol))\n            {\n                data = typeData[symbol];\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Tries to get the data for the specified symbol and type\n        /// </summary>\n        /// <param name=\"slice\">The slice</param>\n        /// <param name=\"type\">The type of data we seek</param>\n        /// <param name=\"symbol\">The symbol data is sought for</param>\n        /// <param name=\"data\">The found data</param>\n        /// <returns>True if data was found for the specified type and symbol</returns>\n        public static bool TryGet(this Slice slice, Type type, Symbol symbol, out dynamic data)\n        {\n            data = null;\n            var typeData = slice.Get(type);\n            if (typeData.ContainsKey(symbol))\n            {\n                data = typeData[symbol];\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Converts the specified enumerable of decimals into a double array\n        /// </summary>\n        /// <param name=\"decimals\">The enumerable of decimal</param>\n        /// <returns>Double array representing the enumerable of decimal</returns>\n        public static double[] ToDoubleArray(this IEnumerable<decimal> decimals)\n        {\n            return decimals.Select(x => (double) x).ToArray();\n        }\n\n        /// <summary>\n        /// Loops through the specified slices and pushes the data into the consolidators. This can be used to\n        /// easily warm up indicators from a history call that returns slice objects.\n        /// </summary>\n        /// <param name=\"slices\">The data to send into the consolidators, likely result of a history request</param>\n        /// <param name=\"consolidatorsBySymbol\">Dictionary of consolidators keyed by symbol</param>\n        public static void PushThroughConsolidators(this IEnumerable<Slice> slices, Dictionary<Symbol, IDataConsolidator> consolidatorsBySymbol)\n        {\n            PushThroughConsolidators(slices, symbol =>\n            {\n                IDataConsolidator consolidator;\n                consolidatorsBySymbol.TryGetValue(symbol, out consolidator);\n                return consolidator;\n            });\n        }\n\n        /// <summary>\n        /// Loops through the specified slices and pushes the data into the consolidators. This can be used to\n        /// easily warm up indicators from a history call that returns slice objects.\n        /// </summary>\n        /// <param name=\"slices\">The data to send into the consolidators, likely result of a history request</param>\n        /// <param name=\"consolidatorsProvider\">Delegate that fetches the consolidators by a symbol</param>\n        public static void PushThroughConsolidators(this IEnumerable<Slice> slices, Func<Symbol, IDataConsolidator> consolidatorsProvider)\n        {\n            slices.PushThrough(data => consolidatorsProvider(data?.Symbol)?.Update(data));\n        }\n\n        /// <summary>\n        /// Loops through the specified slices and pushes the data into the consolidators. This can be used to\n        /// easily warm up indicators from a history call that returns slice objects.\n        /// </summary>\n        /// <param name=\"slices\">The data to send into the consolidators, likely result of a history request</param>\n        /// <param name=\"handler\">Delegate handles each data piece from the slice</param>\n        /// <param name=\"dataType\">Defines the type of the data that should be pushed</param>\n        public static void PushThrough(this IEnumerable<Slice> slices, Action<BaseData> handler, Type dataType = null)\n        {\n            if (dataType != null)\n            {\n                Func<Slice, IEnumerable<BaseData>> dataSelector = default;\n                if (dataType == typeof(QuoteBar))\n                {\n                    dataSelector = slice => slice.QuoteBars.Values;\n                }\n                else if (dataType == typeof(Tick))\n                {\n                    dataSelector = slice => slice.Ticks.Values.Select(x => x.Last());\n                }\n                else if (dataType == typeof(TradeBar))\n                {\n                    dataSelector = slice => slice.Bars.Values;\n                }\n                else\n                {\n                    dataSelector = slice => slice.Get(dataType).Values;\n                }\n\n                foreach (var slice in slices)\n                {\n                    foreach (BaseData baseData in dataSelector(slice))\n                    {\n                        handler(baseData);\n                    }\n                }\n            }\n            else\n            {\n                foreach (var slice in slices)\n                {\n                    foreach (var symbol in slice.Keys)\n                    {\n                        dynamic value;\n                        if (!slice.TryGetValue(symbol, out value))\n                        {\n                            continue;\n                        }\n\n                        var list = value as IList;\n                        var data = (BaseData)(list != null ? list[list.Count - 1] : value);\n\n                        handler(data);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SubscriptionDataConfig.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Consolidators;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Subscription data required including the type of data.\n    /// </summary>\n    public class SubscriptionDataConfig : IEquatable<SubscriptionDataConfig>\n    {\n        private readonly bool _mappedConfig;\n        private readonly SecurityIdentifier _sid;\n\n        /// <summary>\n        /// Event fired when there is a new symbol due to mapping\n        /// </summary>\n        public event EventHandler<NewSymbolEventArgs> NewSymbol;\n\n        /// <summary>\n        /// Type of data\n        /// </summary>\n        public Type Type { get; }\n\n        /// <summary>\n        /// Security type of this data subscription\n        /// </summary>\n        public SecurityType SecurityType => Symbol.SecurityType;\n\n        /// <summary>\n        /// Symbol of the asset we're requesting: this is really a perm tick!!\n        /// </summary>\n        public Symbol Symbol { get; private set; }\n\n        /// <summary>\n        /// Trade, quote or open interest data\n        /// </summary>\n        public TickType TickType { get; }\n\n        /// <summary>\n        /// Resolution of the asset we're requesting, second minute or tick\n        /// </summary>\n        public Resolution Resolution { get; }\n\n        /// <summary>\n        /// Timespan increment between triggers of this data:\n        /// </summary>\n        public TimeSpan Increment { get; }\n\n        /// <summary>\n        /// True if wish to send old data when time gaps in data feed.\n        /// </summary>\n        public bool FillDataForward { get; }\n\n        /// <summary>\n        /// Boolean Send Data from between 4am - 8am (Equities Setting Only)\n        /// </summary>\n        public bool ExtendedMarketHours { get; }\n\n        /// <summary>\n        /// True if this subscription was added for the sole purpose of providing currency conversion rates via <see cref=\"CashBook.EnsureCurrencyDataFeeds\"/>\n        /// </summary>\n        public bool IsInternalFeed { get; }\n\n        /// <summary>\n        /// True if this subscription is for custom user data, false for QC data\n        /// </summary>\n        public bool IsCustomData { get; }\n\n        /// <summary>\n        /// The sum of dividends accrued in this subscription, used for scaling total return prices\n        /// </summary>\n        public decimal SumOfDividends{ get; set; }\n\n        /// <summary>\n        /// Gets the normalization mode used for this subscription\n        /// </summary>\n        public DataNormalizationMode DataNormalizationMode { get; set; }\n\n        /// <summary>\n        /// Gets the securities mapping mode used for this subscription\n        /// </summary>\n        /// <remarks>This is particular useful when generating continuous futures</remarks>\n        public DataMappingMode DataMappingMode { get; }\n\n        /// <summary>\n        /// The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract\n        /// </summary>\n        public uint ContractDepthOffset { get; }\n\n        /// <summary>\n        /// Price Scaling Factor:\n        /// </summary>\n        public decimal PriceScaleFactor { get; set; }\n\n        /// <summary>\n        /// Symbol Mapping: When symbols change over time (e.g. CHASE-> JPM) need to update the symbol requested.\n        /// </summary>\n        public string MappedSymbol\n        {\n            get\n            {\n                if (Symbol.HasUnderlying)\n                {\n                    if (SecurityType == SecurityType.Future)\n                    {\n                        return Symbol.Underlying.ID.ToString();\n                    }\n                    if (SecurityType.IsOption())\n                    {\n                        return Symbol.Underlying.Value;\n                    }\n                }\n                return Symbol.Value;\n            }\n            set\n            {\n                var oldMappedValue = MappedSymbol;\n                if(ContractDepthOffset == 0 && oldMappedValue == value)\n                {\n                    // Do less if we can.\n                    // We can only do this for sure if 'ContractDepthOffset' is 0 else the value we got might be outdated and will change bellow\n                    return;\n                }\n                var oldSymbol = Symbol;\n                Symbol = Symbol.UpdateMappedSymbol(value, ContractDepthOffset);\n\n                if (MappedSymbol != oldMappedValue)\n                {\n                    NewSymbol?.Invoke(this, new NewSymbolEventArgs(Symbol, oldSymbol));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the market / scope of the symbol\n        /// </summary>\n        public string Market => Symbol.ID.Market;\n\n        /// <summary>\n        /// Gets the data time zone for this subscription\n        /// </summary>\n        public DateTimeZone DataTimeZone { get; }\n\n        /// <summary>\n        /// Gets the exchange time zone for this subscription\n        /// </summary>\n        public DateTimeZone ExchangeTimeZone { get; }\n\n        /// <summary>\n        /// Consolidators that are registred with this subscription\n        /// </summary>\n        public ISet<IDataConsolidator> Consolidators { get; }\n\n        /// <summary>\n        /// Gets whether or not this subscription should have filters applied to it (market hours/user filters from security)\n        /// </summary>\n        public bool IsFilteredSubscription { get; }\n\n        /// <summary>\n        /// Constructor for Data Subscriptions\n        /// </summary>\n        /// <param name=\"objectType\">Type of the data objects.</param>\n        /// <param name=\"symbol\">Symbol of the asset we're requesting</param>\n        /// <param name=\"resolution\">Resolution of the asset we're requesting</param>\n        /// <param name=\"dataTimeZone\">The time zone the raw data is time stamped in</param>\n        /// <param name=\"exchangeTimeZone\">Specifies the time zone of the exchange for the security this subscription is for. This\n        /// is this output time zone, that is, the time zone that will be used on BaseData instances</param>\n        /// <param name=\"fillForward\">Fill in gaps with historical data</param>\n        /// <param name=\"extendedHours\">Equities only - send in data from 4am - 8pm</param>\n        /// <param name=\"isInternalFeed\">Set to true if this subscription is added for the sole purpose of providing currency conversion rates,\n        /// setting this flag to true will prevent the data from being sent into the algorithm's OnData methods</param>\n        /// <param name=\"isCustom\">True if this is user supplied custom data, false for normal QC data</param>\n        /// <param name=\"tickType\">Specifies if trade or quote data is subscribed</param>\n        /// <param name=\"isFilteredSubscription\">True if this subscription should have filters applied to it (market hours/user filters from security), false otherwise</param>\n        /// <param name=\"dataNormalizationMode\">Specifies normalization mode used for this subscription</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        public SubscriptionDataConfig(Type objectType,\n            Symbol symbol,\n            Resolution resolution,\n            DateTimeZone dataTimeZone,\n            DateTimeZone exchangeTimeZone,\n            bool fillForward,\n            bool extendedHours,\n            bool isInternalFeed,\n            bool isCustom = false,\n            TickType? tickType = null,\n            bool isFilteredSubscription = true,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0,\n            bool mappedConfig = false)\n        {\n            if (objectType == null) throw new ArgumentNullException(nameof(objectType));\n            if (symbol == null) throw new ArgumentNullException(nameof(symbol));\n            if (dataTimeZone == null) throw new ArgumentNullException(nameof(dataTimeZone));\n            if (exchangeTimeZone == null) throw new ArgumentNullException(nameof(exchangeTimeZone));\n\n            Type = objectType;\n            Resolution = resolution;\n            _sid = symbol.ID;\n            Symbol = symbol;\n            ExtendedMarketHours = extendedHours && LeanData.SupportsExtendedMarketHours(Type);\n            PriceScaleFactor = 1;\n            IsInternalFeed = isInternalFeed;\n            IsCustomData = isCustom;\n            DataTimeZone = dataTimeZone;\n            _mappedConfig = mappedConfig;\n            DataMappingMode = dataMappingMode;\n            ExchangeTimeZone = exchangeTimeZone;\n            ContractDepthOffset = contractDepthOffset;\n            IsFilteredSubscription = isFilteredSubscription;\n            Consolidators = new ConcurrentSet<IDataConsolidator>();\n            DataNormalizationMode = dataNormalizationMode;\n\n            TickType = tickType ?? LeanData.GetCommonTickTypeForCommonDataTypes(objectType, SecurityType);\n\n            Increment = resolution.ToTimeSpan();\n            //Ticks are individual sales and fillforward doesn't apply.\n            FillDataForward = resolution == Resolution.Tick ? false : fillForward;\n        }\n\n        /// <summary>\n        /// Copy constructor with overrides\n        /// </summary>\n        /// <param name=\"config\">The config to copy, then overrides are applied and all option</param>\n        /// <param name=\"objectType\">Type of the data objects.</param>\n        /// <param name=\"symbol\">Symbol of the asset we're requesting</param>\n        /// <param name=\"resolution\">Resolution of the asset we're requesting</param>\n        /// <param name=\"dataTimeZone\">The time zone the raw data is time stamped in</param>\n        /// <param name=\"exchangeTimeZone\">Specifies the time zone of the exchange for the security this subscription is for. This\n        /// is this output time zone, that is, the time zone that will be used on BaseData instances</param>\n        /// <param name=\"fillForward\">Fill in gaps with historical data</param>\n        /// <param name=\"extendedHours\">Equities only - send in data from 4am - 8pm</param>\n        /// <param name=\"isInternalFeed\">Set to true if this subscription is added for the sole purpose of providing currency conversion rates,\n        /// setting this flag to true will prevent the data from being sent into the algorithm's OnData methods</param>\n        /// <param name=\"isCustom\">True if this is user supplied custom data, false for normal QC data</param>\n        /// <param name=\"tickType\">Specifies if trade or quote data is subscribed</param>\n        /// <param name=\"isFilteredSubscription\">True if this subscription should have filters applied to it (market hours/user filters from security), false otherwise</param>\n        /// <param name=\"dataNormalizationMode\">Specifies normalization mode used for this subscription</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"mappedConfig\">True if this is created as a mapped config. This is useful for continuous contract at live trading\n        /// where we subscribe to the mapped symbol but want to preserve uniqueness</param>\n        public SubscriptionDataConfig(SubscriptionDataConfig config,\n            Type objectType = null,\n            Symbol symbol = null,\n            Resolution? resolution = null,\n            DateTimeZone dataTimeZone = null,\n            DateTimeZone exchangeTimeZone = null,\n            bool? fillForward = null,\n            bool? extendedHours = null,\n            bool? isInternalFeed = null,\n            bool? isCustom = null,\n            TickType? tickType = null,\n            bool? isFilteredSubscription = null,\n            DataNormalizationMode? dataNormalizationMode = null,\n            DataMappingMode? dataMappingMode = null,\n            uint? contractDepthOffset = null,\n            bool? mappedConfig = null)\n            : this(\n            objectType ?? config.Type,\n            symbol ?? config.Symbol,\n            resolution ?? config.Resolution,\n            dataTimeZone ?? config.DataTimeZone,\n            exchangeTimeZone ?? config.ExchangeTimeZone,\n            fillForward ?? config.FillDataForward,\n            extendedHours ?? config.ExtendedMarketHours,\n            isInternalFeed ?? config.IsInternalFeed,\n            isCustom ?? config.IsCustomData,\n            tickType ?? config.TickType,\n            isFilteredSubscription ?? config.IsFilteredSubscription,\n            dataNormalizationMode ?? config.DataNormalizationMode,\n            dataMappingMode ?? config.DataMappingMode,\n            contractDepthOffset ?? config.ContractDepthOffset,\n            mappedConfig ?? false\n            )\n        {\n            PriceScaleFactor = config.PriceScaleFactor;\n            SumOfDividends = config.SumOfDividends;\n            Consolidators = config.Consolidators;\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(SubscriptionDataConfig other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return _sid.Equals(other._sid) && Type == other.Type\n                && TickType == other.TickType\n                && Resolution == other.Resolution\n                && FillDataForward == other.FillDataForward\n                && ExtendedMarketHours == other.ExtendedMarketHours\n                && IsInternalFeed == other.IsInternalFeed\n                && IsCustomData == other.IsCustomData\n                && DataTimeZone.Equals(other.DataTimeZone)\n                && DataMappingMode == other.DataMappingMode\n                && ExchangeTimeZone.Equals(other.ExchangeTimeZone)\n                && ContractDepthOffset == other.ContractDepthOffset\n                && IsFilteredSubscription == other.IsFilteredSubscription\n                && _mappedConfig == other._mappedConfig;\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is equal to the current object.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            if (obj.GetType() != GetType()) return false;\n            return Equals((SubscriptionDataConfig) obj);\n        }\n\n        /// <summary>\n        /// Serves as the default hash function.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current object.\n        /// </returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = _sid.GetHashCode();\n                hashCode = (hashCode*397) ^ Type.GetHashCode();\n                hashCode = (hashCode*397) ^ (int) TickType;\n                hashCode = (hashCode*397) ^ (int) Resolution;\n                hashCode = (hashCode*397) ^ FillDataForward.GetHashCode();\n                hashCode = (hashCode*397) ^ ExtendedMarketHours.GetHashCode();\n                hashCode = (hashCode*397) ^ IsInternalFeed.GetHashCode();\n                hashCode = (hashCode*397) ^ IsCustomData.GetHashCode();\n                hashCode = (hashCode*397) ^ DataMappingMode.GetHashCode();\n                hashCode = (hashCode*397) ^ DataTimeZone.Id.GetHashCode();// timezone hash is expensive, use id instead\n                hashCode = (hashCode*397) ^ ExchangeTimeZone.Id.GetHashCode();// timezone hash is expensive, use id instead\n                hashCode = (hashCode*397) ^ ContractDepthOffset.GetHashCode();\n                hashCode = (hashCode*397) ^ IsFilteredSubscription.GetHashCode();\n                hashCode = (hashCode*397) ^ _mappedConfig.GetHashCode();\n                return hashCode;\n            }\n        }\n\n        /// <summary>\n        /// Override equals operator\n        /// </summary>\n        public static bool operator ==(SubscriptionDataConfig left, SubscriptionDataConfig right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Override not equals operator\n        /// </summary>\n        public static bool operator !=(SubscriptionDataConfig left, SubscriptionDataConfig right)\n        {\n            return !Equals(left, right);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return ToString(Symbol.Value);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to use in the string representation of the object</param>\n        /// <returns>/// A string that represents the current object.</returns>\n        public string ToString(string symbol)\n        {\n            return Invariant($\"{symbol},#{ContractDepthOffset},{MappedSymbol},{Resolution},{Type.Name},{TickType},{DataNormalizationMode},{DataMappingMode}{(IsInternalFeed ? \",Internal\" : string.Empty)}\");\n        }\n\n        /// <summary>\n        /// New base class for all event classes.\n        /// </summary>\n        public class NewSymbolEventArgs : EventArgs\n        {\n            /// <summary>\n            /// The old symbol instance\n            /// </summary>\n            public Symbol Old { get; }\n\n            /// <summary>\n            /// The new symbol instance\n            /// </summary>\n            public Symbol New { get; }\n\n            /// <summary>\n            /// Create an instance of NewSymbolEventArgs\n            /// </summary>\n            /// <param name=\"new\"></param>\n            /// <param name=\"old\"></param>\n            public NewSymbolEventArgs(Symbol @new, Symbol old)\n            {\n                New = @new;\n                Old = old;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SubscriptionDataConfigExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Helper methods used to determine different configurations properties\n    /// for a given set of <see cref=\"SubscriptionDataConfig\"/>\n    /// </summary>\n    public static class SubscriptionDataConfigExtensions\n    {\n        /// <summary>\n        /// Extension method used to obtain the highest <see cref=\"Resolution\"/>\n        /// for a given set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigs\"></param>\n        /// <returns>The highest resolution, <see cref=\"Resolution.Daily\"/> if there\n        /// are no subscriptions</returns>\n        public static Resolution GetHighestResolution(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs)\n        {\n            return subscriptionDataConfigs\n                .Select(x => x.Resolution)\n                .DefaultIfEmpty(Resolution.Daily)\n                .Min();\n        }\n\n        /// <summary>\n        /// Extension method used to determine if FillForward is enabled\n        /// for a given set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigs\"></param>\n        /// <returns>True, at least one subscription has it enabled</returns>\n        public static bool IsFillForward(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs)\n        {\n            return subscriptionDataConfigs.Any(x => x.FillDataForward);\n        }\n\n        /// <summary>\n        /// Extension method used to determine if ExtendedMarketHours is enabled\n        /// for a given set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigs\"></param>\n        /// <returns>True, at least one subscription has it enabled</returns>\n        public static bool IsExtendedMarketHours(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs)\n        {\n            return subscriptionDataConfigs.Any(x => x.ExtendedMarketHours);\n        }\n\n        /// <summary>\n        /// Extension method used to determine if it is custom data\n        /// for a given set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigs\"></param>\n        /// <returns>True, at least one subscription is custom data</returns>\n        public static bool IsCustomData(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs)\n        {\n            return subscriptionDataConfigs.Any(x => x.IsCustomData);\n        }\n\n        /// <summary>\n        /// Extension method used to determine what <see cref=\"QuantConnect.DataNormalizationMode\"/>\n        /// to use for a given set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigs\"></param>\n        /// <returns>The first DataNormalizationMode,\n        /// <see cref=\"DataNormalizationMode.Adjusted\"/> if there  are no subscriptions</returns>\n        public static DataNormalizationMode DataNormalizationMode(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs)\n        {\n            return subscriptionDataConfigs.\n                Select(x => x.DataNormalizationMode)\n                .DefaultIfEmpty(QuantConnect.DataNormalizationMode.Adjusted)\n                .First();\n        }\n\n        /// <summary>\n        /// Sets the data normalization mode to be used by\n        /// this set of <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        public static void SetDataNormalizationMode(\n            this IEnumerable<SubscriptionDataConfig> subscriptionDataConfigs,\n            DataNormalizationMode mode)\n        {\n            foreach (var subscription in subscriptionDataConfigs)\n            {\n                subscription.DataNormalizationMode = mode;\n            }\n        }\n\n        /// <summary>\n        /// Will determine if mapping should be used for this subscription configuration\n        /// </summary>\n        /// <param name=\"config\">The subscription data configuration we are processing</param>\n        /// <remarks>One of the objectives of this method is to normalize the 'use mapping'\n        /// check and void code duplication and related issues</remarks>\n        /// <returns>True if ticker should be mapped</returns>\n        public static bool TickerShouldBeMapped(this SubscriptionDataConfig config)\n        {\n            // we create an instance of the data type, if it is a custom type\n            // it can override RequiresMapping else it will use security type\\\n            return config.GetBaseDataInstance().RequiresMapping();\n        }\n\n        /// <summary>\n        /// Will determine if price scaling should be used for this subscription configuration\n        /// </summary>\n        /// <param name=\"config\">The subscription data configuration we are processing</param>\n        /// <remarks>One of the objectives of this method is to normalize the 'use price scale'\n        /// check and void code duplication and related issues</remarks>\n        /// <param name=\"liveMode\">True, is this is a live mode data stream</param>\n        /// <returns>True if ticker prices should be scaled</returns>\n        public static bool PricesShouldBeScaled(this SubscriptionDataConfig config, bool liveMode = false)\n        {\n            if (config.IsCustomData || config.Symbol.Value.Contains(\"UNIVERSE\"))\n            {\n                return false;\n            }\n\n            if(config.SecurityType == SecurityType.Equity && !liveMode)\n            {\n                return true;\n            }\n            if (config.SecurityType == SecurityType.Future && config.Symbol.IsCanonical())\n            {\n                return LeanData.IsCommonLeanDataType(config.Type);\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Will determine if splits and dividends should be used for this subscription configuration\n        /// </summary>\n        /// <param name=\"config\">The subscription data configuration we are processing</param>\n        /// <remarks>Different than <see cref=\"PricesShouldBeScaled\"/> because prices could be scale and no split and dividends\n        /// really exist, like in the continuous futures case</remarks>\n        /// <returns>True if this configuration requires split and divided handling</returns>\n        public static bool EmitSplitsAndDividends(this SubscriptionDataConfig config)\n        {\n            return !config.IsCustomData && !config.Symbol.Value.Contains(\"UNIVERSE\") && config.SecurityType == SecurityType.Equity;\n        }\n\n        /// <summary>\n        /// True if this configuration is associated with an asset which can have delisting events\n        /// </summary>\n        public static bool CanBeDelisted(this SubscriptionDataConfig config)\n        {\n            return config.SecurityType.IsOption() || config.SecurityType == SecurityType.Future || config.SecurityType == SecurityType.Equity;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseData\"/> type defined in <paramref name=\"config\"/> with the symbol properly set\n        /// </summary>\n        public static BaseData GetBaseDataInstance(this SubscriptionDataConfig config)\n        {\n            var instance = config.Type.GetBaseDataInstance();\n            instance.Symbol = config.Symbol;\n            return instance;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SubscriptionDataConfigList.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Provides convenient methods for holding several <see cref=\"SubscriptionDataConfig\"/>\n    /// </summary>\n    public class SubscriptionDataConfigList : List<SubscriptionDataConfig>\n    {\n        /// <summary>\n        /// <see cref=\"Symbol\"/> for which this class holds <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        public Symbol Symbol { get; private set; }\n\n        /// <summary>\n        /// Assume that the InternalDataFeed is the same for both <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        public bool IsInternalFeed\n        {\n            get\n            {\n                var first = this.FirstOrDefault();\n                return first != null && first.IsInternalFeed;\n            }\n        }\n\n        /// <summary>\n        /// Default constructor that specifies the <see cref=\"Symbol\"/> that the <see cref=\"SubscriptionDataConfig\"/> represent\n        /// </summary>\n        /// <param name=\"symbol\"></param>\n        public SubscriptionDataConfigList(Symbol symbol)\n        {\n            Symbol = symbol;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"DataNormalizationMode\"/> for all <see cref=\"SubscriptionDataConfig\"/> contained in the list\n        /// </summary>\n        /// <param name=\"normalizationMode\"></param>\n        public void SetDataNormalizationMode(DataNormalizationMode normalizationMode)\n        {\n            if (Symbol.SecurityType.IsOption() && normalizationMode != DataNormalizationMode.Raw)\n            {\n                throw new ArgumentException($\"DataNormalizationMode.Raw must be used with SecurityType {Symbol.SecurityType}\");\n            }\n\n            foreach (var config in this)\n            {\n                config.DataNormalizationMode = normalizationMode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SubscriptionDataSource.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    /// Represents the source location and transport medium for a subscription\n    /// </summary>\n    public class SubscriptionDataSource : IEquatable<SubscriptionDataSource>\n    {\n        private readonly static IReadOnlyList<KeyValuePair<string, string>> _empty = new List<KeyValuePair<string, string>>();\n\n        /// <summary>\n        /// Specifies whether the data source should be sorted.\n        /// <c>If False</c>, data will be returned in the original order, <c>else</c> it will be ordered by time.\n        /// </summary>\n        public bool Sort { get; set; }\n\n        /// <summary>\n        /// Identifies where to get the subscription's data from\n        /// </summary>\n        public string Source { get; init; }\n\n        /// <summary>\n        /// Identifies the format of the data within the source\n        /// </summary>\n        public FileFormat Format { get; init; }\n\n        /// <summary>\n        /// Identifies the transport medium used to access the data, such as a local or remote file, or a polling rest API\n        /// </summary>\n        public SubscriptionTransportMedium TransportMedium { get; init; }\n\n        /// <summary>\n        /// Gets the header values to be used in the web request.\n        /// </summary>\n        public IReadOnlyList<KeyValuePair<string, string>> Headers { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionDataSource\"/> class.\n        /// </summary>\n        /// <param name=\"source\">The subscription's data source location</param>\n        public SubscriptionDataSource(string source)\n            : this(source, GetDefaultSubscriptionTransportMedium(source), FileFormat.Csv)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionDataSource\"/> class.\n        /// </summary>\n        /// <param name=\"source\">The subscription's data source location</param>\n        /// <param name=\"transportMedium\">The transport medium to be used to retrieve the subscription's data from the source</param>\n        public SubscriptionDataSource(string source, SubscriptionTransportMedium transportMedium)\n            : this(source, transportMedium, FileFormat.Csv)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionDataSource\"/> class.\n        /// </summary>\n        /// <param name=\"source\">The subscription's data source location</param>\n        /// <param name=\"transportMedium\">The transport medium to be used to retrieve the subscription's data from the source</param>\n        /// <param name=\"format\">The format of the data within the source</param>\n        public SubscriptionDataSource(string source, SubscriptionTransportMedium transportMedium, FileFormat format)\n            : this(source, transportMedium, format, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionDataSource\"/> class with <see cref=\"SubscriptionTransportMedium.Rest\"/>\n        /// including the specified header values\n        /// </summary>\n        /// <param name=\"source\">The subscription's data source location</param>\n        /// <param name=\"transportMedium\">The transport medium to be used to retrieve the subscription's data from the source</param>\n        /// <param name=\"format\">The format of the data within the source</param>\n        /// <param name=\"headers\">The headers to be used for this source</param>\n        public SubscriptionDataSource(string source, SubscriptionTransportMedium transportMedium, FileFormat format, IEnumerable<KeyValuePair<string, string>> headers)\n        {\n            Source = source;\n            Format = format;\n            TransportMedium = transportMedium;\n            Headers = headers?.ToList() ?? _empty;\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(SubscriptionDataSource other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return string.Equals(Source, other.Source)\n                && TransportMedium == other.TransportMedium\n                && Headers.SequenceEqual(other.Headers);\n        }\n\n        /// <summary>\n        /// Determines whether the specified instance is equal to the current instance.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param><filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            if (obj.GetType() != GetType()) return false;\n            return Equals((SubscriptionDataSource) obj);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((Source != null ? Source.GetHashCode() : 0)*397) ^ (int) TransportMedium;\n            }\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <param name=\"left\">The <see cref=\"SubscriptionDataSource\"/> instance on the left of the operator</param>\n        /// <param name=\"right\">The <see cref=\"SubscriptionDataSource\"/> instance on the right of the operator</param>\n        /// <returns>True if the two instances are considered equal, false otherwise</returns>\n        public static bool operator ==(SubscriptionDataSource left, SubscriptionDataSource right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is not equal to another object of the same type.\n        /// </summary>\n        /// <param name=\"left\">The <see cref=\"SubscriptionDataSource\"/> instance on the left of the operator</param>\n        /// <param name=\"right\">The <see cref=\"SubscriptionDataSource\"/> instance on the right of the operator</param>\n        /// <returns>True if the two instances are not considered equal, false otherwise</returns>\n        public static bool operator !=(SubscriptionDataSource left, SubscriptionDataSource right)\n        {\n            return !Equals(left, right);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Invariant($\"{TransportMedium}: {Format} {Source}\");\n        }\n\n        /// <summary>\n        /// Gets the default transport medium for the specified source\n        /// </summary>\n        private static SubscriptionTransportMedium GetDefaultSubscriptionTransportMedium(string source)\n        {\n            if (source.StartsWith(\"http://\", StringComparison.OrdinalIgnoreCase) ||\n                source.StartsWith(\"https://\", StringComparison.OrdinalIgnoreCase))\n            {\n                return SubscriptionTransportMedium.RemoteFile;\n            }\n            return SubscriptionTransportMedium.LocalFile;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/SubscriptionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data\n{\n    /// <summary>\n    ///     Enumerable Subscription Management Class\n    /// </summary>\n    public class SubscriptionManager\n    {\n        private readonly PriorityQueue<ConsolidatorWrapper, ConsolidatorScanPriority> _consolidatorsSortedByScanTime;\n        private readonly Dictionary<IDataConsolidator, ConsolidatorWrapper> _consolidators;\n        private List<ConsolidatorWrapper> _consolidatorsToAdd;\n        private readonly object _threadSafeCollectionLock;\n        private readonly ITimeKeeper _timeKeeper;\n        private IAlgorithmSubscriptionManager _subscriptionManager;\n\n        /// <summary>\n        ///     Instance that implements <see cref=\"ISubscriptionDataConfigService\" />\n        /// </summary>\n        public ISubscriptionDataConfigService SubscriptionDataConfigService => _subscriptionManager;\n\n        /// <summary>\n        ///     Returns an IEnumerable of Subscriptions\n        /// </summary>\n        /// <remarks>Will not return internal subscriptions</remarks>\n        public IEnumerable<SubscriptionDataConfig> Subscriptions => _subscriptionManager.SubscriptionManagerSubscriptions.Where(config => !config.IsInternalFeed);\n\n        /// <summary>\n        ///     The different <see cref=\"TickType\" /> each <see cref=\"SecurityType\" /> supports\n        /// </summary>\n        public Dictionary<SecurityType, List<TickType>> AvailableDataTypes => _subscriptionManager?.AvailableDataTypes;\n\n        /// <summary>\n        ///     Get the count of assets:\n        /// </summary>\n        public int Count => _subscriptionManager.SubscriptionManagerCount();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public SubscriptionManager(ITimeKeeper timeKeeper)\n        {\n            _consolidators = new();\n            _timeKeeper = timeKeeper;\n            _consolidatorsSortedByScanTime = new(1000, ConsolidatorScanPriority.Comparer);\n            _threadSafeCollectionLock = new object();\n        }\n\n        /// <summary>\n        ///     Add Market Data Required (Overloaded method for backwards compatibility).\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the asset we're like</param>\n        /// <param name=\"resolution\">Resolution of Asset Required</param>\n        /// <param name=\"timeZone\">The time zone the subscription's data is time stamped in</param>\n        /// <param name=\"exchangeTimeZone\">\n        ///     Specifies the time zone of the exchange for the security this subscription is for. This\n        ///     is this output time zone, that is, the time zone that will be used on BaseData instances\n        /// </param>\n        /// <param name=\"isCustomData\">True if this is custom user supplied data, false for normal QC data</param>\n        /// <param name=\"fillForward\">when there is no data pass the last tradebar forward</param>\n        /// <param name=\"extendedMarketHours\">Request premarket data as well when true </param>\n        /// <returns>\n        ///     The newly created <see cref=\"SubscriptionDataConfig\" /> or existing instance if it already existed\n        /// </returns>\n        public SubscriptionDataConfig Add(\n            Symbol symbol,\n            Resolution resolution,\n            DateTimeZone timeZone,\n            DateTimeZone exchangeTimeZone,\n            bool isCustomData = false,\n            bool fillForward = true,\n            bool extendedMarketHours = false\n            )\n        {\n            //Set the type: market data only comes in two forms -- ticks(trade by trade) or tradebar(time summaries)\n            var dataType = typeof(TradeBar);\n            if (resolution == Resolution.Tick)\n            {\n                dataType = typeof(Tick);\n            }\n\n            var tickType = LeanData.GetCommonTickTypeForCommonDataTypes(dataType, symbol.SecurityType);\n            return Add(dataType, tickType, symbol, resolution, timeZone, exchangeTimeZone, isCustomData, fillForward,\n                extendedMarketHours);\n        }\n\n        /// <summary>\n        ///     Add Market Data Required - generic data typing support as long as Type implements BaseData.\n        /// </summary>\n        /// <param name=\"dataType\">Set the type of the data we're subscribing to.</param>\n        /// <param name=\"tickType\">Tick type for the subscription.</param>\n        /// <param name=\"symbol\">Symbol of the asset we're like</param>\n        /// <param name=\"resolution\">Resolution of Asset Required</param>\n        /// <param name=\"dataTimeZone\">The time zone the subscription's data is time stamped in</param>\n        /// <param name=\"exchangeTimeZone\">\n        ///     Specifies the time zone of the exchange for the security this subscription is for. This\n        ///     is this output time zone, that is, the time zone that will be used on BaseData instances\n        /// </param>\n        /// <param name=\"isCustomData\">True if this is custom user supplied data, false for normal QC data</param>\n        /// <param name=\"fillForward\">when there is no data pass the last tradebar forward</param>\n        /// <param name=\"extendedMarketHours\">Request premarket data as well when true </param>\n        /// <param name=\"isInternalFeed\">\n        ///     Set to true to prevent data from this subscription from being sent into the algorithm's\n        ///     OnData events\n        /// </param>\n        /// <param name=\"isFilteredSubscription\">\n        ///     True if this subscription should have filters applied to it (market hours/user\n        ///     filters from security), false otherwise\n        /// </param>\n        /// <param name=\"dataNormalizationMode\">Define how data is normalized</param>\n        /// <returns>\n        ///     The newly created <see cref=\"SubscriptionDataConfig\" /> or existing instance if it already existed\n        /// </returns>\n        public SubscriptionDataConfig Add(\n            Type dataType,\n            TickType tickType,\n            Symbol symbol,\n            Resolution resolution,\n            DateTimeZone dataTimeZone,\n            DateTimeZone exchangeTimeZone,\n            bool isCustomData,\n            bool fillForward = true,\n            bool extendedMarketHours = false,\n            bool isInternalFeed = false,\n            bool isFilteredSubscription = true,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted\n            )\n        {\n            return SubscriptionDataConfigService.Add(symbol, resolution, fillForward,\n                extendedMarketHours, isFilteredSubscription, isInternalFeed, isCustomData,\n                new List<Tuple<Type, TickType>> { new Tuple<Type, TickType>(dataType, tickType) },\n                dataNormalizationMode).First();\n        }\n\n        /// <summary>\n        /// Add a consolidator for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the asset to consolidate</param>\n        /// <param name=\"consolidator\">The consolidator</param>\n        /// <param name=\"tickType\">Desired tick type for the subscription</param>\n        public void AddConsolidator(Symbol symbol, IDataConsolidator consolidator, TickType? tickType = null)\n        {\n            // Find the right subscription and add the consolidator to it\n            var subscriptions = Subscriptions.Where(x => x.Symbol == symbol).ToList();\n\n            if (subscriptions.Count == 0)\n            {\n                // If we made it here it is because we never found the symbol in the subscription list\n                throw new ArgumentException(\"Please subscribe to this symbol before adding a consolidator for it. Symbol: \" +\n                    symbol.Value);\n            }\n\n            if (consolidator.InputType.IsAbstract && tickType == null)\n            {\n                tickType = AvailableDataTypes[symbol.SecurityType].FirstOrDefault();\n            }\n\n            foreach (var subscription in subscriptions)\n            {\n                // we need to be able to pipe data directly from the data feed into the consolidator\n                if (IsSubscriptionValidForConsolidator(subscription, consolidator, tickType))\n                {\n                    subscription.Consolidators.Add(consolidator);\n\n                    var wrapper = _consolidators[consolidator] =\n                        new ConsolidatorWrapper(consolidator, subscription.Increment, _timeKeeper, _timeKeeper.GetLocalTimeKeeper(subscription.ExchangeTimeZone));\n\n                    lock (_threadSafeCollectionLock)\n                    {\n                        _consolidatorsToAdd ??= new();\n                        _consolidatorsToAdd.Add(wrapper);\n                    }\n                    return;\n                }\n            }\n\n            string tickTypeException = null;\n            if (tickType != null && !subscriptions.Where(x => x.TickType == tickType).Any())\n            {\n                tickTypeException = $\"No subscription with the requested Tick Type {tickType} was found. Available Tick Types: {string.Join(\", \", subscriptions.Select(x => x.TickType))}\";\n            }\n\n            throw new ArgumentException(tickTypeException ?? (\"Type mismatch found between consolidator and symbol. \" +\n                $\"Symbol: {symbol.Value} does not support input type: {consolidator.InputType.Name}. \" +\n                $\"Supported types: {string.Join(\",\", subscriptions.Select(x => x.Type.Name))}.\"));\n        }\n\n        /// <summary>\n        /// Add a custom python consolidator for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the asset to consolidate</param>\n        /// <param name=\"pyConsolidator\">The custom python consolidator</param>\n        public void AddConsolidator(Symbol symbol, PyObject pyConsolidator)\n        {\n            var consolidator = PythonUtil.CreateInstanceOrWrapper<IDataConsolidator>(\n                pyConsolidator,\n                py => new DataConsolidatorPythonWrapper(py)\n            );\n            AddConsolidator(symbol, consolidator);\n        }\n\n        /// <summary>\n        ///     Removes the specified consolidator for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol the consolidator is receiving data from</param>\n        /// <param name=\"consolidator\">The consolidator instance to be removed</param>\n        public void RemoveConsolidator(Symbol symbol, IDataConsolidator consolidator)\n        {\n            // let's try to get associated symbol, not required but nice to have\n            symbol ??= consolidator.Consolidated?.Symbol;\n            symbol ??= consolidator.WorkingData?.Symbol;\n\n            // remove consolidator from each subscription\n            foreach (var subscription in _subscriptionManager.GetSubscriptionDataConfigs(symbol))\n            {\n                subscription.Consolidators.Remove(consolidator);\n\n                if (_consolidators.Remove(consolidator, out var consolidatorsToScan))\n                {\n                    consolidatorsToScan.Dispose();\n                }\n            }\n\n            // dispose of the consolidator to remove any remaining event handlers\n            consolidator.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Removes the specified python consolidator for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol the consolidator is receiving data from</param>\n        /// <param name=\"pyConsolidator\">The python consolidator instance to be removed</param>\n        public void RemoveConsolidator(Symbol symbol, PyObject pyConsolidator)\n        {\n            if (!pyConsolidator.TryConvert(out IDataConsolidator consolidator))\n            {\n                consolidator = new DataConsolidatorPythonWrapper(pyConsolidator);\n            }\n\n            RemoveConsolidator(symbol, consolidator);\n        }\n\n        /// <summary>\n        /// Will trigger past consolidator scans\n        /// </summary>\n        /// <param name=\"newUtcTime\">The new utc time</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        public void ScanPastConsolidators(DateTime newUtcTime, IAlgorithm algorithm)\n        {\n            if (_consolidatorsToAdd != null)\n            {\n                lock (_threadSafeCollectionLock)\n                {\n                    foreach (var consolidator in _consolidatorsToAdd)\n                    {\n                        // At this point we already calculate the warm up start time, so we can reset the UtcScanTime property\n                        // To ensure correct scan times\n                        consolidator.AdvanceScanTime();\n                        _consolidatorsSortedByScanTime.Enqueue(consolidator, consolidator.Priority);\n                    }\n                    _consolidatorsToAdd = null;\n                }\n            }\n\n            while (_consolidatorsSortedByScanTime.TryPeek(out _, out var priority) && priority.UtcScanTime < newUtcTime)\n            {\n                var consolidatorToScan = _consolidatorsSortedByScanTime.Dequeue();\n                if (consolidatorToScan.Disposed)\n                {\n                    // consolidator has been removed\n                    continue;\n                }\n\n                if (priority.UtcScanTime != algorithm.UtcTime)\n                {\n                    // only update the algorithm time once, it's not cheap because of TZ conversions\n                    algorithm.SetDateTime(priority.UtcScanTime);\n                }\n\n                if (consolidatorToScan.UtcScanTime <= priority.UtcScanTime)\n                {\n                    // only scan if we still need to\n                    consolidatorToScan.Scan();\n                }\n\n                _consolidatorsSortedByScanTime.Enqueue(consolidatorToScan, consolidatorToScan.Priority);\n            }\n        }\n\n        /// <summary>\n        ///     Hard code the set of default available data feeds\n        /// </summary>\n        public static Dictionary<SecurityType, List<TickType>> DefaultDataTypes()\n        {\n            return new Dictionary<SecurityType, List<TickType>>\n            {\n                {SecurityType.Base, new List<TickType> {TickType.Trade}},\n                {SecurityType.Index, new List<TickType> {TickType.Trade}},\n                {SecurityType.Forex, new List<TickType> {TickType.Quote}},\n                {SecurityType.Equity, new List<TickType> {TickType.Trade, TickType.Quote}},\n                {SecurityType.Option, new List<TickType> {TickType.Quote, TickType.Trade, TickType.OpenInterest}},\n                {SecurityType.FutureOption, new List<TickType> {TickType.Quote, TickType.Trade, TickType.OpenInterest}},\n                {SecurityType.IndexOption, new List<TickType> {TickType.Quote, TickType.Trade, TickType.OpenInterest}},\n                {SecurityType.Cfd, new List<TickType> {TickType.Quote}},\n                {SecurityType.Future, new List<TickType> {TickType.Quote, TickType.Trade, TickType.OpenInterest}},\n                {SecurityType.Commodity, new List<TickType> {TickType.Trade}},\n                {SecurityType.Crypto, new List<TickType> {TickType.Trade, TickType.Quote}},\n                {SecurityType.CryptoFuture, new List<TickType> {TickType.Trade, TickType.Quote}}\n            };\n        }\n\n        /// <summary>\n        ///     Get the available data types for a security\n        /// </summary>\n        public IReadOnlyList<TickType> GetDataTypesForSecurity(SecurityType securityType)\n        {\n            return AvailableDataTypes[securityType];\n        }\n\n        /// <summary>\n        ///     Get the data feed types for a given <see cref=\"SecurityType\" /> <see cref=\"Resolution\" />\n        /// </summary>\n        /// <param name=\"symbolSecurityType\">The <see cref=\"SecurityType\" /> used to determine the types</param>\n        /// <param name=\"resolution\">The resolution of the data requested</param>\n        /// <param name=\"isCanonical\">Indicates whether the security is Canonical (future and options)</param>\n        /// <returns>Types that should be added to the <see cref=\"SubscriptionDataConfig\" /></returns>\n        public List<Tuple<Type, TickType>> LookupSubscriptionConfigDataTypes(\n            SecurityType symbolSecurityType,\n            Resolution resolution,\n            bool isCanonical\n            )\n        {\n            return _subscriptionManager.LookupSubscriptionConfigDataTypes(symbolSecurityType, resolution, isCanonical);\n        }\n\n        /// <summary>\n        ///     Sets the Subscription Manager\n        /// </summary>\n        public void SetDataManager(IAlgorithmSubscriptionManager subscriptionManager)\n        {\n            _subscriptionManager = subscriptionManager;\n        }\n\n        /// <summary>\n        /// Checks if the subscription is valid for the consolidator\n        /// </summary>\n        /// <param name=\"subscription\">The subscription configuration</param>\n        /// <param name=\"consolidator\">The consolidator</param>\n        /// <param name=\"desiredTickType\">The desired tick type for the subscription. If not given is null.</param>\n        /// <returns>true if the subscription is valid for the consolidator</returns>\n        public static bool IsSubscriptionValidForConsolidator(SubscriptionDataConfig subscription, IDataConsolidator consolidator, TickType? desiredTickType = null)\n        {\n            // Ensure the consolidator can accept data of the subscription's type\n            if (!consolidator.InputType.IsAssignableFrom(subscription.Type))\n            {\n                return false;\n            }\n\n            if (subscription.Type == typeof(Tick))\n            {\n                if (desiredTickType == null)\n                {\n                    if (!LeanData.IsCommonLeanDataType(consolidator.OutputType))\n                    {\n                        return true;\n                    }\n                    var tickType = LeanData.GetCommonTickTypeForCommonDataTypes(consolidator.OutputType, subscription.Symbol.SecurityType);\n                    return subscription.TickType == tickType;\n                }\n                return subscription.TickType == desiredTickType;\n            }\n\n            // For non-Tick data, the subscription is valid if its type is compatible with the consolidator's input type\n            return true;\n        }\n\n        /// <summary>\n        /// Returns true if the provided data is the default data type associated with it's <see cref=\"SecurityType\"/>.\n        /// This is useful to determine if a data point should be used/cached in an environment where consumers will not provider a data type and we want to preserve\n        /// determinism and backwards compatibility when there are multiple data types available per <see cref=\"SecurityType\"/> or new ones added.\n        /// </summary>\n        /// <remarks>Temporary until we have a dictionary for the default data type per security type see GH issue 4196.\n        /// Internal so it's only accessible from this assembly.</remarks>\n        internal static bool IsDefaultDataType(BaseData data)\n        {\n            switch (data.Symbol.SecurityType)\n            {\n                case SecurityType.Equity:\n                    if (data.DataType == MarketDataType.QuoteBar || data.DataType == MarketDataType.Tick && (data as Tick).TickType == TickType.Quote)\n                    {\n                        return false;\n                    }\n                    break;\n            }\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/BaseChainUniverseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Represents a chain universe.\n    /// Intended as a base for options and futures universe data.\n    /// </summary>\n    public abstract class BaseChainUniverseData : BaseDataCollection, IChainUniverseData\n    {\n        /// <summary>\n        /// Csv line to get the values from\n        /// </summary>\n        /// <remarks>We keep the properties as they are in the csv file to reduce memory usage (strings vs decimals)</remarks>\n        protected string CsvLine { get; }\n\n        /// <summary>\n        /// The security identifier of the option symbol\n        /// </summary>\n        [PandasIgnore]\n        public SecurityIdentifier ID => Symbol.ID;\n\n        /// <summary>\n        /// Price of the security\n        /// </summary>\n        [PandasIgnore]\n        public override decimal Value => Close;\n\n        /// <summary>\n        /// Open price of the security\n        /// </summary>\n        public decimal Open\n        {\n            get\n            {\n                // Parse the values every time to avoid keeping them in memory\n                return CsvLine.GetDecimalFromCsv(0);\n            }\n        }\n\n        /// <summary>\n        /// High price of the security\n        /// </summary>\n        public decimal High\n        {\n            get\n            {\n                return CsvLine.GetDecimalFromCsv(1);\n            }\n        }\n\n        /// <summary>\n        /// Low price of the security\n        /// </summary>\n        public decimal Low\n        {\n            get\n            {\n                return CsvLine.GetDecimalFromCsv(2);\n            }\n        }\n\n        /// <summary>\n        /// Close price of the security\n        /// </summary>\n        public decimal Close\n        {\n            get\n            {\n                return CsvLine.GetDecimalFromCsv(3);\n            }\n        }\n\n        /// <summary>\n        /// Volume value of the security\n        /// </summary>\n        public decimal Volume\n        {\n            get\n            {\n                return CsvLine.GetDecimalFromCsv(4);\n            }\n        }\n\n        /// <summary>\n        /// Open interest value\n        /// </summary>\n        public virtual decimal OpenInterest\n        {\n            get\n            {\n                return CsvLine.GetDecimalFromCsv(5);\n            }\n        }\n\n        /// <summary>\n        /// Time that the data became available to use\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get { return Time + QuantConnect.Time.OneDay; }\n            set { Time = value - QuantConnect.Time.OneDay; }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChainUniverseData\"/> class\n        /// </summary>\n        protected BaseChainUniverseData()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChainUniverseData\"/> class\n        /// </summary>\n        protected BaseChainUniverseData(DateTime date, Symbol symbol, string csv)\n            : base(date, date, symbol, null, null)\n        {\n            CsvLine = csv;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BaseChainUniverseData\"/> class as a copy of the given instance\n        /// </summary>\n        protected BaseChainUniverseData(BaseChainUniverseData other)\n            : base(other)\n        {\n            CsvLine = other.CsvLine;\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var path = GetUniverseFullFilePath(config.Symbol, date);\n            return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.FoldingCollection);\n        }\n\n        /// <summary>\n        /// Generates the file path for a universe data file based on the given symbol and date.\n        /// Optionally, creates the directory if it does not exist.\n        /// </summary>\n        /// <param name=\"symbol\">The financial symbol for which the universe file is generated.</param>\n        /// <param name=\"date\">The date associated with the universe file.</param>\n        /// <returns>The full file path to the universe data file.</returns>\n        public static string GetUniverseFullFilePath(Symbol symbol, DateTime date)\n        {\n            return Path.Combine(LeanData.GenerateUniversesDirectory(Globals.DataFolder, symbol), $\"{date:yyyyMMdd}.csv\");\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets the symbol of the option\n        /// </summary>\n        public Symbol ToSymbol()\n        {\n            return Symbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/BaseDataCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// This type exists for transport of data as a single packet\n    /// </summary>\n    public class BaseDataCollection : BaseData, IEnumerable<BaseData>\n    {\n        private DateTime _endTime;\n\n        /// <summary>\n        /// The associated underlying price data if any\n        /// </summary>\n        [PandasNonExpandable]\n        public BaseData Underlying { get; set; }\n\n        /// <summary>\n        /// Gets or sets the contracts selected by the universe\n        /// </summary>\n        [PandasIgnore]\n        public HashSet<Symbol> FilteredContracts { get; set; }\n\n        /// <summary>\n        /// Gets the data list\n        /// </summary>\n        public List<BaseData> Data { get; set; }\n\n        /// <summary>\n        /// Gets or sets the end time of this data\n        /// </summary>\n        [PandasIgnore]\n        public override DateTime EndTime\n        {\n            get\n            {\n                if (_endTime == default)\n                {\n                    // to be user friendly let's return Time if not set, like BaseData does\n                    return Time;\n                }\n                return _endTime;\n            }\n            set\n            {\n                _endTime = value;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"BaseDataCollection\"/> c;ass\n        /// </summary>\n        public BaseDataCollection()\n            : this(DateTime.MinValue, Symbol.Empty)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataCollection\"/> class\n        /// </summary>\n        /// <param name=\"time\">The time of this data</param>\n        /// <param name=\"symbol\">A common identifier for all data in this packet</param>\n        /// <param name=\"data\">The data to add to this collection</param>\n        public BaseDataCollection(DateTime time, Symbol symbol, IEnumerable<BaseData> data = null)\n            : this(time, time, symbol, data)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataCollection\"/> class\n        /// </summary>\n        /// <param name=\"time\">The start time of this data</param>\n        /// <param name=\"endTime\">The end time of this data</param>\n        /// <param name=\"symbol\">A common identifier for all data in this packet</param>\n        /// <param name=\"data\">The data to add to this collection</param>\n        /// <param name=\"underlying\">The associated underlying price data if any</param>\n        /// <param name=\"filteredContracts\">The contracts selected by the universe</param>\n        public BaseDataCollection(DateTime time, DateTime endTime, Symbol symbol, IEnumerable<BaseData> data = null, BaseData underlying = null, HashSet<Symbol> filteredContracts = null)\n            : this(time, endTime, symbol, data != null ? data.ToList() : new List<BaseData>(), underlying, filteredContracts)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataCollection\"/> class\n        /// </summary>\n        /// <param name=\"time\">The start time of this data</param>\n        /// <param name=\"endTime\">The end time of this data</param>\n        /// <param name=\"symbol\">A common identifier for all data in this packet</param>\n        /// <param name=\"data\">The data to add to this collection</param>\n        /// <param name=\"underlying\">The associated underlying price data if any</param>\n        /// <param name=\"filteredContracts\">The contracts selected by the universe</param>\n        public BaseDataCollection(DateTime time, DateTime endTime, Symbol symbol, List<BaseData> data, BaseData underlying, HashSet<Symbol> filteredContracts)\n            : this(time, endTime, symbol, underlying, filteredContracts)\n        {\n            if (data != null && data.Count == 1 && data[0] is BaseDataCollection collection && collection.Data != null && collection.Data.Count > 0)\n            {\n                // we were given a base data collection, let's be nice and fetch it's data if it has any\n                Data = collection.Data;\n            }\n            else\n            {\n                Data = data ?? new List<BaseData>();\n            }\n        }\n\n        /// <summary>\n        /// Helper method to create an instance without setting the data list\n        /// </summary>\n        protected BaseDataCollection(DateTime time, DateTime endTime, Symbol symbol, BaseData underlying, HashSet<Symbol> filteredContracts)\n        {\n            Symbol = symbol;\n            Time = time;\n            _endTime = endTime;\n            Underlying = underlying;\n            FilteredContracts = filteredContracts;\n        }\n\n        /// <summary>\n        /// Copy constructor for <see cref=\"BaseDataCollection\"/>\n        /// </summary>\n        /// <param name=\"other\">The base data collection being copied</param>\n        public BaseDataCollection(BaseDataCollection other)\n            : this(other.Time, other.EndTime, other.Symbol, other.Underlying, other.FilteredContracts)\n        {\n            Data = other.Data;\n        }\n\n        /// <summary>\n        /// Creates the universe symbol for the target market\n        /// </summary>\n        /// <returns>The universe symbol to use</returns>\n        public virtual Symbol UniverseSymbol(string market = null)\n        {\n            market ??= QuantConnect.Market.USA;\n            var ticker = $\"{GetType().Name}-{market}-{Guid.NewGuid()}\";\n            return Symbol.Create(ticker, SecurityType.Base, market, baseDataType: GetType());\n        }\n\n        /// <summary>\n        /// Indicates whether this contains data that should be stored in the security cache\n        /// </summary>\n        /// <returns>Whether this contains data that should be stored in the security cache</returns>\n        public override bool ShouldCacheToSecurity()\n        {\n            if (Data == null || Data.Count == 0)\n            {\n                return true;\n            }\n            // if we hold the same data type we are, else we ask underlying type\n            return Data[0].GetType() == GetType() || Data[0].ShouldCacheToSecurity();\n        }\n\n        /// <summary>\n        /// Adds a new data point to this collection\n        /// </summary>\n        /// <param name=\"newDataPoint\">The new data point to add</param>\n        public virtual void Add(BaseData newDataPoint)\n        {\n            Data.Add(newDataPoint);\n        }\n\n        /// <summary>\n        /// Adds a new data points to this collection\n        /// </summary>\n        /// <param name=\"newDataPoints\">The new data points to add</param>\n        public virtual void AddRange(IEnumerable<BaseData> newDataPoints)\n        {\n            Data.AddRange(newDataPoints);\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object, used in fill forward\n        /// </summary>\n        /// <remarks>\n        /// This base implementation uses reflection to copy all public fields and properties\n        /// </remarks>\n        /// <returns>A clone of the current object</returns>\n        public override BaseData Clone()\n        {\n            return new BaseDataCollection(this);\n        }\n\n        /// <summary>\n        /// Returns an IEnumerator for this enumerable Object.  The enumerator provides\n        /// a simple way to access all the contents of a collection.\n        /// </summary>\n        public IEnumerator<BaseData> GetEnumerator()\n        {\n            return (Data ?? Enumerable.Empty<BaseData>()).GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an IEnumerator for this enumerable Object.  The enumerator provides\n        /// a simple way to access all the contents of a collection.\n        /// </summary>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/BaseFundamentalDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Fundamental;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Base fundamental data provider\n    /// </summary>\n    public class BaseFundamentalDataProvider : IFundamentalDataProvider\n    {\n        /// <summary>\n        /// True if live trading\n        /// </summary>\n        public bool LiveMode { get; set; }\n\n        /// <summary>\n        /// THe data provider instance to use\n        /// </summary>\n        protected IDataProvider DataProvider { get; set; }\n\n        /// <summary>\n        /// Initializes the service\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        public virtual void Initialize(IDataProvider dataProvider, bool liveMode)\n        {\n            LiveMode = liveMode;\n            DataProvider = dataProvider;\n        }\n\n        /// <summary>\n        /// Will fetch the requested fundamental information for the requested time and symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The expected data type</typeparam>\n        /// <param name=\"time\">The time to request this data for</param>\n        /// <param name=\"securityIdentifier\">The security identifier</param>\n        /// <param name=\"name\">The name of the fundamental property</param>\n        /// <returns>The fundamental information</returns>\n        public virtual T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n        {\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Get's the default value for the given T type\n        /// </summary>\n        /// <typeparam name=\"T\">The expected T type</typeparam>\n        /// <returns>The default value</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static T GetDefault<T>()\n        {\n            if (typeof(T) == typeof(double))\n            {\n                return (T)Convert.ChangeType(double.NaN, typeof(T), CultureInfo.InvariantCulture);\n            }\n            else if (typeof(T) == typeof(decimal))\n            {\n                return (T)Convert.ChangeType(decimal.Zero, typeof(T), CultureInfo.InvariantCulture);\n            }\n            return default;\n        }\n\n        /// <summary>\n        /// True if the given value is none\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsNone(object value) => IsNone(value?.GetType(), value);\n\n        /// <summary>\n        /// True if the given value is none\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsNone(Type type, object value)\n        {\n            if (type == null || value == null)\n            {\n                return true;\n            }\n            else if(type == typeof(double))\n            {\n                return ((double)value).IsNaNOrInfinity();\n            }\n            else if (type == typeof(decimal))\n            {\n                return default(decimal) == (decimal)value;\n            }\n            else if (type == typeof(DateTime))\n            {\n                return default(DateTime) == (DateTime)value;\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/CoarseFundamental.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Globalization;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines summary information about a single symbol for a given date\n    /// </summary>\n    public class CoarseFundamental : BaseData\n    {\n        /// <summary>\n        /// Gets the market for this symbol\n        /// </summary>\n        public string Market => Symbol.ID.Market;\n\n        /// <summary>\n        /// Gets the day's dollar volume for this symbol\n        /// </summary>\n        public virtual double DollarVolume { get; }\n\n        /// <summary>\n        /// Gets the day's total volume\n        /// </summary>\n        public virtual long Volume { get; }\n\n        /// <summary>\n        /// Returns whether the symbol has fundamental data for the given date\n        /// </summary>\n        public virtual bool HasFundamentalData { get; }\n\n        /// <summary>\n        /// Gets the price factor for the given date\n        /// </summary>\n        public virtual decimal PriceFactor { get; } = 1;\n\n        /// <summary>\n        /// Gets the split factor for the given date\n        /// </summary>\n        public virtual decimal SplitFactor { get; } = 1;\n\n        /// <summary>\n        /// Gets the combined factor used to create adjusted prices from raw prices\n        /// </summary>\n        public decimal PriceScaleFactor => PriceFactor * SplitFactor;\n\n        /// <summary>\n        /// Gets the split and dividend adjusted price\n        /// </summary>\n        public decimal AdjustedPrice => Price * PriceScaleFactor;\n\n        /// <summary>\n        /// The end time of this data.\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get { return Time + QuantConnect.Time.OneDay; }\n            set { Time = value - QuantConnect.Time.OneDay; }\n        }\n        \n        /// <summary>\n        /// Gets the raw price\n        /// </summary>\n        public override decimal Price => Value; \n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamental\"/> class\n        /// </summary>\n        public CoarseFundamental()\n        {\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            throw new InvalidOperationException($\"Coarse type is obsolete, please use {nameof(Fundamental)}\");\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            throw new InvalidOperationException($\"Coarse type is obsolete, please use {nameof(Fundamental)}\");\n        }\n\n        /// <summary>\n        /// Converts a given fundamental data point into row format\n        /// </summary>\n        public static string ToRow(CoarseFundamental coarse)\n        {\n            // sid,symbol,close,volume,dollar volume,has fundamental data,price factor,split factor\n            var values = new object[]\n            {\n                coarse.Symbol.ID,\n                coarse.Symbol.Value,\n                coarse.Value,\n                coarse.Volume,\n                coarse.DollarVolume,\n                coarse.HasFundamentalData,\n                coarse.PriceFactor,\n                coarse.SplitFactor\n            };\n\n            return string.Join(\",\", values.Select(s => Convert.ToString(s, CultureInfo.InvariantCulture)));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/CoarseFundamentalDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Coarse base fundamental data provider\n    /// </summary>\n    public class CoarseFundamentalDataProvider : BaseFundamentalDataProvider\n    {\n        private DateTime _date;\n        private readonly Dictionary<SecurityIdentifier, CoarseFundamental> _coarseFundamental = new();\n\n        /// <summary>\n        /// Will fetch the requested fundamental information for the requested time and symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The expected data type</typeparam>\n        /// <param name=\"time\">The time to request this data for</param>\n        /// <param name=\"securityIdentifier\">The security identifier</param>\n        /// <param name=\"name\">The name of the fundamental property</param>\n        /// <returns>The fundamental information</returns>\n        public override T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n        {\n            var enumName = Enum.GetName(name);\n            lock (_coarseFundamental)\n            {\n                if (time == _date)\n                {\n                    return GetProperty<T>(securityIdentifier, enumName);\n                }\n                _date = time;\n\n                var path = Path.Combine(Globals.DataFolder, \"equity\", \"usa\", \"fundamental\", \"coarse\", $\"{time:yyyyMMdd}.csv\");\n                var fileStream = DataProvider.Fetch(path);\n                if (fileStream == null)\n                {\n                    return GetDefault<T>();\n                }\n\n                _coarseFundamental.Clear();\n                using (var reader = new StreamReader(fileStream))\n                {\n                    while (!reader.EndOfStream)\n                    {\n                        var line = reader.ReadLine();\n                        var coarse = Read(line, time);\n                        if (coarse != null)\n                        {\n                            _coarseFundamental[coarse.Symbol.ID] = coarse;\n                        }\n                    }\n                }\n\n                return GetProperty<T>(securityIdentifier, enumName);\n            }\n        }\n\n        /// <summary>\n        /// Reads the given line and returns a CoarseFundamentalSource with the information within it\n        /// </summary>\n        public static CoarseFundamentalSource Read(string line, DateTime date)\n        {\n            try\n            {\n                var csv = line.Split(',');\n                var coarse = new CoarseFundamentalSource\n                {\n                    Symbol = new Symbol(SecurityIdentifier.Parse(csv[0]), csv[1]),\n                    Time = date,\n                    Value = csv[2].ToDecimal(),\n                    VolumeSetter = csv[3].ToInt64(),\n                    DollarVolumeSetter = (double)csv[4].ToDecimal()\n                };\n\n                if (csv.Length > 5)\n                {\n                    coarse.HasFundamentalDataSetter = csv[5].ConvertInvariant<bool>();\n                }\n\n                if (csv.Length > 7)\n                {\n                    coarse.PriceFactorSetter = csv[6].ToDecimal();\n                    coarse.SplitFactorSetter = csv[7].ToDecimal();\n                }\n\n                return coarse;\n            }\n            catch (Exception)\n            {\n                return null;\n            }\n\n        }\n\n        private dynamic GetProperty<T>(SecurityIdentifier securityIdentifier, string property)\n        {\n            if (!_coarseFundamental.TryGetValue(securityIdentifier, out var coarse))\n            {\n                return GetDefault<T>();\n            }\n\n            switch (property)\n            {\n                case nameof(CoarseFundamental.Price):\n                    return coarse.Price;\n                case nameof(CoarseFundamental.Value):\n                    return coarse.Value;\n                case nameof(CoarseFundamental.Market):\n                    return coarse.Market;\n                case nameof(CoarseFundamental.Volume):\n                    return coarse.Volume;\n                case nameof(CoarseFundamental.PriceFactor):\n                    return coarse.PriceFactor;\n                case nameof(CoarseFundamental.SplitFactor):\n                    return coarse.SplitFactor;\n                case nameof(CoarseFundamental.DollarVolume):\n                    return coarse.DollarVolume;\n                case nameof(CoarseFundamental.HasFundamentalData):\n                    return false;\n            }\n\n            return GetDefault<T>();\n        }\n\n        /// <summary>\n        /// Coarse fundamental with setters\n        /// </summary>\n        public class CoarseFundamentalSource : CoarseFundamental\n        {\n            /// <summary>\n            /// Property to set the volume of the Coarse Fundamental\n            /// </summary>\n            public long VolumeSetter { get; init; }\n\n            /// <summary>\n            /// Property to set the dollar volume of the Coarse Fundamental\n            /// </summary>\n            public double DollarVolumeSetter { get; init; }\n\n            /// <summary>\n            /// Property to set the price factor of the Coarse Fundamental\n            /// </summary>\n            public decimal PriceFactorSetter { get; set; } = 1;\n\n            /// <summary>\n            /// Property to set the split factor of the Coarse Fundamental\n            /// </summary>\n            public decimal SplitFactorSetter { get; set; } = 1;\n\n            /// <summary>\n            /// Property to indicate if the Coarse Fundamental has fundamental data\n            /// </summary>\n            public bool HasFundamentalDataSetter { get; set; }\n\n            /// <summary>\n            /// Gets the day's dollar volume for this symbol\n            /// </summary>\n            public override double DollarVolume => DollarVolumeSetter;\n\n            /// <summary>\n            /// Gets the day's total volume\n            /// </summary>\n            public override long Volume => VolumeSetter;\n\n            /// <summary>\n            /// Returns whether the symbol has fundamental data for the given date\n            /// </summary>\n            public override bool HasFundamentalData => HasFundamentalDataSetter;\n\n            /// <summary>\n            /// Gets the price factor for the given date\n            /// </summary>\n            public override decimal PriceFactor => PriceFactorSetter;\n\n            /// <summary>\n            /// Gets the split factor for the given date\n            /// </summary>\n            public override decimal SplitFactor => SplitFactorSetter;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/CoarseFundamentalUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a universe that reads coarse us equity data\n    /// </summary>\n    public class CoarseFundamentalUniverse : Universe\n    {\n        private readonly Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> _selector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public CoarseFundamentalUniverse(UniverseSettings universeSettings, Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> selector)\n            : base(CreateConfiguration(FundamentalUniverseFactory.SymbolFactory.UniverseSymbol()))\n        {\n            UniverseSettings = universeSettings;\n            _selector = selector;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public CoarseFundamentalUniverse(UniverseSettings universeSettings, PyObject selector)\n            : this(FundamentalUniverseFactory.SymbolFactory.UniverseSymbol(), universeSettings, selector)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Defines the symbol to use for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public CoarseFundamentalUniverse(Symbol symbol, UniverseSettings universeSettings, Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> selector)\n            : base(CreateConfiguration(symbol))\n        {\n            UniverseSettings = universeSettings;\n            _selector = selector;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Defines the symbol to use for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public CoarseFundamentalUniverse(Symbol symbol, UniverseSettings universeSettings, PyObject selector)\n            : base(CreateConfiguration(symbol))\n        {\n            UniverseSettings = universeSettings;\n            Func<IEnumerable<CoarseFundamental>, object> func;\n            if (selector.TrySafeAs(out func))\n            {\n                _selector = func.ConvertToUniverseSelectionSymbolDelegate();\n            }\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selector(data.Data.OfType<CoarseFundamental>());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"CoarseFundamental\"/> subscription configuration for the US-equity market\n        /// </summary>\n        /// <param name=\"symbol\">The symbol used in the returned configuration</param>\n        /// <returns>A coarse fundamental subscription configuration with the specified symbol</returns>\n        public static SubscriptionDataConfig CreateConfiguration(Symbol symbol)\n        {\n            return FundamentalUniverseFactory.CreateConfiguration(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ConstituentsUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// ConstituentsUniverse allows to perform universe selection based on an\n    /// already preselected set of <see cref=\"Symbol\"/>.\n    /// </summary>\n    /// <remarks>Using this class allows a performance improvement, since there is no\n    /// runtime logic computation required for selecting the <see cref=\"Symbol\"/></remarks>\n    public class ConstituentsUniverse<T> : FuncUniverse<T>\n        where T : BaseData\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The universe symbol</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"constituentsFilter\">User-provided function to filter constituents universe with</param>\n        public ConstituentsUniverse(\n            Symbol symbol, \n            UniverseSettings universeSettings, \n            Func<IEnumerable<T>, IEnumerable<Symbol>> constituentsFilter = null)\n            : this(new SubscriptionDataConfig(typeof(T),\n                    symbol,\n                    Resolution.Daily,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    true,\n                    true),\n                universeSettings,\n                constituentsFilter)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The universe symbol</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"constituentsFilter\">User-provided function to filter constituents universe with</param>\n        public ConstituentsUniverse(\n            Symbol symbol,\n            UniverseSettings universeSettings,\n            PyObject constituentsFilter = null)\n            : this(symbol, universeSettings, constituentsFilter.ConvertPythonUniverseFilterFunction<T>())\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataConfig\">The universe configuration to use</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"constituentsFilter\">User-provided function to filter constituents universe with</param>\n        public ConstituentsUniverse(\n            SubscriptionDataConfig subscriptionDataConfig, \n            UniverseSettings universeSettings,\n            Func<IEnumerable<T>, IEnumerable<Symbol>> constituentsFilter = null)\n            : base(subscriptionDataConfig,\n                universeSettings,\n                constituentsFilter ?? (constituents =>\n                {\n                    var symbols = constituents.Select(baseData => baseData.Symbol).ToList();\n                    // for performance, just compare to Symbol.None if we have 1 Symbol\n                    if (symbols.Count == 1 && symbols[0] == Symbol.None)\n                    {\n                        // no symbol selected\n                        return Enumerable.Empty<Symbol>();\n                    }\n\n                    return symbols;\n                }))\n        {\n            if (!subscriptionDataConfig.IsCustomData)\n            {\n                throw new InvalidOperationException($\"{typeof(T).Name} {nameof(SubscriptionDataConfig)}\" +\n                    $\" only supports custom data property set to 'true'\");\n            }\n        }\n\n        /// <summary>\n        /// Constituent universe for a Python function\n        /// </summary>\n        /// <param name=\"subscriptionDataConfig\">The universe configuration to use</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"constituentsFilter\">User-provided function to filter constituents universe with</param>\n        public ConstituentsUniverse(\n            SubscriptionDataConfig subscriptionDataConfig,\n            UniverseSettings universeSettings,\n            PyObject constituentsFilter = null)\n        : this(subscriptionDataConfig, universeSettings, constituentsFilter.ConvertPythonUniverseFilterFunction<T>())\n        {\n        }\n    }\n\n    /// <summary>\n    /// ConstituentsUniverse allows to perform universe selection based on an\n    /// already preselected set of <see cref=\"Symbol\"/>.\n    /// </summary>\n    /// <remarks>Using this class allows a performance improvement, since there is no\n    /// runtime logic computation required for selecting the <see cref=\"Symbol\"/></remarks>\n    public class ConstituentsUniverse : ConstituentsUniverse<ConstituentsUniverseData>\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The universe symbol</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"filterFunc\">The constituents filter function</param>\n        public ConstituentsUniverse(Symbol symbol, UniverseSettings universeSettings, Func<IEnumerable<ConstituentsUniverseData>, IEnumerable<Symbol>> filterFunc)\n            : base(symbol, universeSettings, filterFunc)\n        {\n        }\n        \n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The universe symbol</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        public ConstituentsUniverse(Symbol symbol, UniverseSettings universeSettings)\n            : base(symbol, universeSettings, (Func<IEnumerable<ConstituentsUniverseData>, IEnumerable<Symbol>>)null)\n        {\n        } \n        \n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstituentsUniverse\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The universe symbol</param>\n        /// <param name=\"universeSettings\">The universe settings to use</param>\n        /// <param name=\"filterFunc\">The constituents filter function</param>\n        public ConstituentsUniverse(Symbol symbol, UniverseSettings universeSettings, PyObject filterFunc)\n            : base(symbol, universeSettings, filterFunc)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ConstituentsUniverseData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Custom base data class used for <see cref=\"ConstituentsUniverse\"/>\n    /// </summary>\n    public class ConstituentsUniverseData : BaseData\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseFundamental\"/> class\n        /// </summary>\n        public ConstituentsUniverseData()\n        {\n            DataType = MarketDataType.Auxiliary;\n        }\n\n        /// <summary>\n        /// The end time of this data.\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get { return Time + QuantConnect.Time.OneDay; }\n            set { Time = value - QuantConnect.Time.OneDay; }\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var universe = config.Symbol.ID.Symbol.Substring(config.MappedSymbol.LastIndexOf('-') + 1);\n\n            if (isLiveMode)\n            {\n                date = date.AddDays(-1);\n            }\n            var path = Path.Combine(Globals.DataFolder,\n                config.SecurityType.SecurityTypeToLower(),\n                config.Market,\n                \"universes\",\n                config.Resolution.ResolutionToLower(),\n                universe,\n                $\"{date:yyyyMMdd}.csv\");\n            return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            try\n            {\n                var csv = line.Split(',');\n                var preselected = new ConstituentsUniverseData\n                {\n                    Symbol = new Symbol(SecurityIdentifier.Parse(csv[1]), csv[0]),\n                    Time = isLiveMode ? date.AddDays(-1) : date\n                };\n\n                return preselected;\n            }\n            catch\n            {\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Indicates that the data set is expected to be sparse\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        /// <returns>True if the data set represented by this type is expected to be sparse</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <returns>True indicates mapping should be used</returns>\n        public override bool RequiresMapping()\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets the supported resolution for this data and security type\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ContinuousContractUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Continuous contract universe selection that based on the requested mapping mode will select each symbol\n    /// </summary>\n    public class ContinuousContractUniverse : Universe, ITimeTriggeredUniverse\n    {\n        private readonly  IMapFileProvider _mapFileProvider;\n        private readonly SubscriptionDataConfig _config;\n        private readonly Security _security;\n        private readonly bool _liveMode;\n        private Symbol _currentSymbol;\n        private string _mappedSymbol;\n\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// TODO: see IContinuousSecurity.Mapped\n        /// </summary>\n        public override bool Asynchronous => false;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public ContinuousContractUniverse(Security security, UniverseSettings universeSettings, bool liveMode, SubscriptionDataConfig universeConfig)\n            : base(universeConfig)\n        {\n            _security = security;\n            _liveMode = liveMode;\n            UniverseSettings = universeSettings;\n            _mapFileProvider = Composer.Instance.GetPart<IMapFileProvider>();\n\n            _config = new SubscriptionDataConfig(Configuration, dataMappingMode: UniverseSettings.DataMappingMode, symbol: _security.Symbol.Canonical);\n        }\n\n        /// <summary>\n        /// Performs universe selection based on the symbol mapping\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">Empty data</param>\n        /// <returns>The symbols to use</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            yield return _security.Symbol.Canonical;\n\n            var mapFile = _mapFileProvider.ResolveMapFile(_config);\n            var mappedSymbol = mapFile.GetMappedSymbol(utcTime.ConvertFromUtc(_security.Exchange.TimeZone), dataMappingMode: _config.DataMappingMode);\n            if (!string.IsNullOrEmpty(mappedSymbol) && mappedSymbol != _mappedSymbol)\n            {\n                if (_currentSymbol != null)\n                {\n                    // let's emit the old and new for the mapping date\n                    yield return _currentSymbol;\n                }\n                _mappedSymbol = mappedSymbol;\n\n                _currentSymbol = _security.Symbol.Canonical\n                    .UpdateMappedSymbol(mappedSymbol, Configuration.ContractDepthOffset)\n                    .Underlying;\n            }\n\n            if (_currentSymbol != null)\n            {\n                // TODO: this won't work with async universe selection\n                ((IContinuousSecurity)_security).Mapped = _currentSymbol;\n                yield return _currentSymbol;\n            }\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security,\n            DateTime currentTimeUtc,\n            DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            var configs = AddConfigurations(subscriptionService, UniverseSettings, security.Symbol);\n            return configs.Select(config => new SubscriptionRequest(isUniverseSubscription: false,\n                universe: this,\n                security: security,\n                configuration: new SubscriptionDataConfig(config, isInternalFeed: config.IsInternalFeed || config.TickType == TickType.OpenInterest),\n                startTimeUtc: currentTimeUtc,\n                endTimeUtc: maximumEndTimeUtc));\n        }\n\n        /// <summary>\n        /// Each tradeable day of the future we trigger a new selection.\n        /// Allows use to select the current contract\n        /// </summary>\n        public IEnumerable<DateTime> GetTriggerTimes(DateTime startTimeUtc, DateTime endTimeUtc, MarketHoursDatabase marketHoursDatabase)\n        {\n            var startTimeLocal = startTimeUtc.ConvertFromUtc(_security.Exchange.TimeZone);\n            var endTimeLocal = endTimeUtc.ConvertFromUtc(_security.Exchange.TimeZone);\n\n            return Time.EachTradeableDay(_security, startTimeLocal, endTimeLocal, Configuration.ExtendedMarketHours)\n                // in live trading selection happens on start see 'DataQueueFuturesChainUniverseDataCollectionEnumerator'\n                .Where(tradeableDay => _liveMode || tradeableDay >= startTimeLocal)\n                // in live trading we delay selection so that we make sure auxiliary data is ready\n                .Select(time => _liveMode ? time.Add(Time.LiveAuxiliaryDataOffset) : time);\n        }\n\n        /// <summary>\n        /// Helper method to add and get the required configurations associated with a continuous universe\n        /// </summary>\n        public static List<SubscriptionDataConfig> AddConfigurations(ISubscriptionDataConfigService subscriptionService, UniverseSettings universeSettings, Symbol symbol)\n        {\n            List<SubscriptionDataConfig> configs = new(universeSettings.SubscriptionDataTypes.Count);\n            foreach (var pair in universeSettings.SubscriptionDataTypes)\n            {\n                configs.AddRange(subscriptionService.Add(symbol,\n                    universeSettings.Resolution,\n                    universeSettings.FillForward,\n                    universeSettings.ExtendedMarketHours,\n                    dataNormalizationMode: universeSettings.DataNormalizationMode,\n                    // we need to provider the data types we want, else since it's canonical it would assume the default ZipEntry type used in universe chain\n                    subscriptionDataTypes: new List<Tuple<Type, TickType>> { pair },\n                    dataMappingMode: universeSettings.DataMappingMode,\n                    contractDepthOffset: (uint)Math.Abs(universeSettings.ContractDepthOffset),\n                    // open interest is internal and the underlying mapped contracts of the continuous canonical\n                    isInternalFeed: !symbol.IsCanonical() || pair.Item2 == TickType.OpenInterest));\n            }\n            return configs;\n        }\n\n        /// <summary>\n        /// Creates a continuous universe symbol\n        /// </summary>\n        /// <param name=\"symbol\">The associated symbol</param>\n        /// <returns>A symbol for a continuous universe of the specified symbol</returns>\n        public static Symbol CreateSymbol(Symbol symbol)\n        {\n            var ticker = $\"qc-universe-continuous-{symbol.ID.Market.ToLowerInvariant()}-{symbol.SecurityType}-{symbol.ID.Symbol}\";\n            return UniverseExtensions.CreateSymbol(symbol.SecurityType, symbol.ID.Market, ticker);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/DerivativeUniverseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Data.UniverseSelection;\n\n/// <summary>\n/// Represents derivative market data including trade and open interest information.\n/// </summary>\npublic class DerivativeUniverseData\n{\n    private readonly Symbol _symbol;\n    private decimal _open;\n    private decimal _high;\n    private decimal _low;\n    private decimal _close;\n    private decimal _volume;\n    private decimal? _openInterest;\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"DerivativeUniverseData\"/> using open interest data.\n    /// </summary>\n    /// <param name=\"openInterest\">The open interest data.</param>\n    public DerivativeUniverseData(OpenInterest openInterest)\n    {\n        _symbol = openInterest.Symbol;\n        _openInterest = openInterest.Value;\n    }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"DerivativeUniverseData\"/> using trade bar data.\n    /// </summary>\n    /// <param name=\"tradeBar\">The trade bar data.</param>\n    public DerivativeUniverseData(TradeBar tradeBar)\n    {\n        _symbol = tradeBar.Symbol;\n        _open = tradeBar.Open;\n        _high = tradeBar.High;\n        _low = tradeBar.Low;\n        _close = tradeBar.Close;\n        _volume = tradeBar.Volume;\n    }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"DerivativeUniverseData\"/> using quote bar data.\n    /// </summary>\n    /// <param name=\"quoteBar\">The quote bar data.</param>\n    public DerivativeUniverseData(QuoteBar quoteBar)\n    {\n        _symbol = quoteBar.Symbol;\n        _open = quoteBar.Open;\n        _high = quoteBar.High;\n        _low = quoteBar.Low;\n        _close = quoteBar.Close;\n    }\n\n    /// <summary>\n    /// Updates the instance with new trade bar data.\n    /// </summary>\n    /// <param name=\"tradeBar\">The new trade bar data.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown when tradeBar is null.</exception>\n    public void UpdateByTradeBar(TradeBar tradeBar)\n    {\n        // If price data has already been initialized (likely from a QuoteBar)\n        if (_open != 0 || _high != 0 || _low != 0 || _close != 0)\n        {\n            _volume = tradeBar.Volume;\n            return;\n        }\n\n        _open = tradeBar.Open;\n        _high = tradeBar.High;\n        _low = tradeBar.Low;\n        _close = tradeBar.Close;\n    }\n\n    /// <summary>\n    /// Updates the instance with new quote bar data.\n    /// </summary>\n    /// <param name=\"quoteBar\">The new quote bar data.</param>\n    public void UpdateByQuoteBar(QuoteBar quoteBar)\n    {\n        _open = quoteBar.Open;\n        _high = quoteBar.High;\n        _low = quoteBar.Low;\n        _close = quoteBar.Close;\n    }\n\n    /// <summary>\n    /// Updates the instance with new open interest data.\n    /// </summary>\n    /// <param name=\"openInterest\">The new open interest data.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown when openInterest is null.</exception>\n    public void UpdateByOpenInterest(OpenInterest openInterest)\n    {\n        _openInterest = openInterest.Value;\n    }\n\n    /// <summary>\n    /// Converts the current data to a CSV format string.\n    /// </summary>\n    /// <returns>A CSV formatted string representing the data.</returns>\n    public string ToCsv()\n    {\n        return OptionUniverse.ToCsv(_symbol, _open, _high, _low, _close, _volume, _openInterest, null, NullGreeks.Instance);\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ETFConstituentUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing NodaTime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// ETF Constituent data\n    /// </summary>\n    [Obsolete(\"'ETFConstituentData' was renamed to 'ETFConstituentUniverse'\")]\n    public class ETFConstituentData : ETFConstituentUniverse { }\n\n    /// <summary>\n    /// ETF constituent data\n    /// </summary>\n    public class ETFConstituentUniverse : BaseDataCollection\n    {\n        /// <summary>\n        /// Time of the previous ETF constituent data update\n        /// </summary>\n        public DateTime? LastUpdate { get; set; }\n        \n        /// <summary>\n        /// The percentage of the ETF allocated to this constituent\n        /// </summary>\n        public decimal? Weight { get; set; }\n        \n        /// <summary>\n        /// Number of shares held in the ETF\n        /// </summary>\n        public decimal? SharesHeld { get; set; }\n        \n        /// <summary>\n        /// Market value of the current asset held in U.S. dollars\n        /// </summary>\n        public decimal? MarketValue { get; set; }\n\n        /// <summary>\n        /// Period of the data\n        /// </summary>\n        public TimeSpan Period { get; set; } = TimeSpan.FromDays(1);\n\n        /// <summary>\n        /// Time that the data became available to use\n        /// </summary>\n        public override DateTime EndTime\n        {\n            get { return Time + Period; }\n            set { Time = value - Period; }\n        }\n\n        /// <summary>\n        /// Return the URL string source of the file. This will be converted to a stream\n        /// </summary>\n        /// <param name=\"config\">Configuration object</param>\n        /// <param name=\"date\">Date of this source file</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>String URL of source file.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\n                Path.Combine(\n                    Globals.DataFolder,\n                    config.SecurityType.SecurityTypeToLower(),\n                    config.Market,\n                    \"universes\",\n                    \"etf\",\n                    config.Symbol.Underlying.Value.ToLowerInvariant(),\n                    $\"{date:yyyyMMdd}.csv\"),\n                SubscriptionTransportMedium.LocalFile,\n                FileFormat.FoldingCollection);\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"line\">Line of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            if (string.IsNullOrEmpty(line))\n            {\n                return null;\n            }\n\n            var split = line.Split(',');\n\n            var symbol = new Symbol(SecurityIdentifier.Parse(split[1]), split[0]);\n            var lastUpdateDate = Parse.TryParseExact(split[2], \"yyyyMMdd\", DateTimeStyles.None, out var lastUpdateDateParsed)\n                ? lastUpdateDateParsed\n                : (DateTime?)null;\n            var weighting = split[3].IsNullOrEmpty()\n                ? (decimal?)null\n                : Parse.Decimal(split[3], NumberStyles.Any);\n            var sharesHeld = split[4].IsNullOrEmpty()\n                ? (decimal?)null\n                : Parse.Decimal(split[4], NumberStyles.Any);\n            var marketValue = split[5].IsNullOrEmpty()\n                ? (decimal?)null\n                : Parse.Decimal(split[5], NumberStyles.Any);\n\n            return new ETFConstituentUniverse\n            {\n                LastUpdate = lastUpdateDate,\n                Weight = weighting,\n                SharesHeld = sharesHeld,\n                MarketValue = marketValue,\n\n                Symbol = symbol,\n                Time = date\n            };\n        }\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <returns>True indicates mapping should be used</returns>\n        public override bool RequiresMapping()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Creates a copy of the instance\n        /// </summary>\n        /// <returns>Clone of the instance</returns>\n        public override BaseData Clone()\n        {\n            return new ETFConstituentUniverse\n            {\n                LastUpdate = LastUpdate,\n                Weight = Weight,\n                SharesHeld = SharesHeld,\n                MarketValue = MarketValue,\n\n                Symbol = Symbol,\n                Time = Time,\n                Data = Data\n            };\n        }\n\n        /// <summary>\n        /// Indicates that the data set is expected to be sparse\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        /// <returns>True if the data set represented by this type is expected to be sparse</returns>\n        public override bool IsSparseData()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>\n        /// This is a method and not a property so that python\n        /// custom data types can override it.\n        /// </remarks>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Gets the supported resolution for this data and security type\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override List<Resolution> SupportedResolutions()\n        {\n            return DailyResolution;\n        }\n\n        /// <summary>\n        /// Specifies the data time zone for this data type. This is useful for custom data types\n        /// </summary>\n        /// <remarks>Will throw <see cref=\"InvalidOperationException\"/> for security types\n        /// other than <see cref=\"SecurityType.Base\"/></remarks>\n        /// <returns>The <see cref=\"DateTimeZone\"/> of this data type</returns>\n        public override DateTimeZone DataTimeZone()\n        {\n            return TimeZones.Utc;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ETFConstituentsUniverseFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Creates a universe based on an ETF's holdings at a given date\n    /// </summary>\n    public class ETFConstituentsUniverseFactory : ConstituentsUniverse<ETFConstituentUniverse>\n    {\n        private const string _etfConstituentsUniverseIdentifier = \"qc-universe-etf-constituents\";\n\n        /// <summary>\n        /// Creates a new universe for the constituents of the ETF provided as <paramref name=\"symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The ETF to load constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"constituentsFilter\">The filter function used to filter out ETF constituents from the universe</param>\n        public ETFConstituentsUniverseFactory(Symbol symbol, UniverseSettings universeSettings, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> constituentsFilter = null)\n            : base(CreateConstituentUniverseETFSymbol(symbol), universeSettings, constituentsFilter ?? (constituents => constituents.Select(c => c.Symbol)))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new universe for the constituents of the ETF provided as <paramref name=\"symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The ETF to load constituents for</param>\n        /// <param name=\"universeSettings\">Universe settings</param>\n        /// <param name=\"constituentsFilter\">The filter function used to filter out ETF constituents from the universe</param>\n        public ETFConstituentsUniverseFactory(Symbol symbol, UniverseSettings universeSettings, PyObject constituentsFilter)\n            : this(symbol, universeSettings, constituentsFilter.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>())\n        {\n        }\n\n        /// <summary>\n        /// Creates a universe Symbol for constituent ETFs\n        /// </summary>\n        /// <param name=\"compositeSymbol\">The Symbol of the ETF</param>\n        /// <returns>Universe Symbol with ETF set as underlying</returns>\n        private static Symbol CreateConstituentUniverseETFSymbol(Symbol compositeSymbol)\n        {\n            var guid = Guid.NewGuid().ToString();\n            var universeTicker = _etfConstituentsUniverseIdentifier + '-' + guid;\n\n            return new Symbol(\n                SecurityIdentifier.GenerateConstituentIdentifier(\n                    universeTicker,\n                    compositeSymbol.SecurityType,\n                    compositeSymbol.ID.Market),\n                universeTicker,\n                compositeSymbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FineFundamentalFilteredUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a universe that can be filtered with a <see cref=\"FineFundamental\"/> selection function\n    /// </summary>\n    public class FineFundamentalFilteredUniverse : SelectSymbolsUniverseDecorator\n    {\n        /// <summary>\n        /// The universe that will be used for fine universe selection\n        /// </summary>\n        public FineFundamentalUniverse FineFundamentalUniverse { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalFilteredUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be filtered</param>\n        /// <param name=\"fineSelector\">The fine selection function</param>\n        public FineFundamentalFilteredUniverse(Universe universe, Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> fineSelector)\n            : base(universe, universe.SelectSymbols)\n        {\n            if (universe is CoarseFundamentalUniverse && universe.UniverseSettings.Asynchronous.HasValue && universe.UniverseSettings.Asynchronous.Value)\n            {\n                throw new ArgumentException(\"Asynchronous universe setting is not supported for coarse & fine selections, please use the new Fundamental single pass selection\");\n            }\n\n            FineFundamentalUniverse = new FineFundamentalUniverse(universe.UniverseSettings, fineSelector);\n            FineFundamentalUniverse.SelectionChanged += (sender, args) => OnSelectionChanged(((SelectionEventArgs) args).CurrentSelection);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalFilteredUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be filtered</param>\n        /// <param name=\"fineSelector\">The fine selection function</param>\n        public FineFundamentalFilteredUniverse(Universe universe, PyObject fineSelector)\n            : base(universe, universe.SelectSymbols)\n        {\n            var func = fineSelector.SafeAs<Func< IEnumerable<FineFundamental>, object>>();\n            FineFundamentalUniverse = new FineFundamentalUniverse(universe.UniverseSettings, func.ConvertToUniverseSelectionSymbolDelegate());\n            FineFundamentalUniverse.SelectionChanged += (sender, args) => OnSelectionChanged(((SelectionEventArgs)args).CurrentSelection);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FineFundamentalUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a universe that reads fine us equity data\n    /// </summary>\n    public class FineFundamentalUniverse : Universe\n    {\n        private readonly Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> _selector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FineFundamentalUniverse(UniverseSettings universeSettings, Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> selector)\n            : base(CreateConfiguration(FundamentalUniverseFactory.SymbolFactory.UniverseSymbol()))\n        {\n            UniverseSettings = universeSettings;\n            _selector = selector;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FineFundamentalUniverse\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Defines the symbol to use for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FineFundamentalUniverse(Symbol symbol, UniverseSettings universeSettings, Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> selector)\n            : base(CreateConfiguration(symbol))\n        {\n            UniverseSettings = universeSettings;\n            _selector = selector;\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selector(data.Data.OfType<FineFundamental>());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"FineFundamental\"/> subscription configuration for the US-equity market\n        /// </summary>\n        /// <param name=\"symbol\">The symbol used in the returned configuration</param>\n        /// <returns>A fine fundamental subscription configuration with the specified symbol</returns>\n        public static SubscriptionDataConfig CreateConfiguration(Symbol symbol)\n        {\n            return FundamentalUniverseFactory.CreateConfiguration(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FuncUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a functional implementation of <see cref=\"Universe\"/>\n    /// </summary>\n    /// <typeparam name=\"T\">The BaseData type to provide to the user defined universe filter</typeparam>\n    public class FuncUniverse<T> : Universe\n        where T : BaseData\n    {\n        private readonly Func<IEnumerable<T>, IEnumerable<Symbol>> _universeSelector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncUniverse{T}\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"universeSelector\">Returns the symbols that should be included in the universe</param>\n        public FuncUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, Func<IEnumerable<T>, IEnumerable<Symbol>> universeSelector)\n            : base(configuration)\n        {\n            _universeSelector = universeSelector;\n            _universeSelector ??= (dataPoints) => dataPoints.Select(x => x.Symbol);\n            UniverseSettings = universeSettings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncUniverse{T}\"/> class for a filter function loaded from Python\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"universeSelector\">Function that returns the symbols that should be included in the universe</param>\n        public FuncUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, PyObject universeSelector)\n            : this(configuration, universeSettings, universeSelector.ConvertPythonUniverseFilterFunction<T>())\n        {\n        }\n\n        /// <summary>\n        /// Performs an initial, coarse filter\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The coarse fundamental data</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _universeSelector(data.Data.Cast<T>());\n        }\n    }\n    \n    /// <summary>\n    /// Provides a functional implementation of <see cref=\"Universe\"/>\n    /// </summary>\n    public class FuncUniverse : FuncUniverse<BaseData>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncUniverse\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"universeSelector\">Returns the symbols that should be included in the universe</param>\n        public FuncUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, Func<IEnumerable<BaseData>, IEnumerable<Symbol>> universeSelector)\n            : base(configuration, universeSettings, universeSelector)\n        {\n        }\n     \n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncUniverse\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"universeSelector\">Returns the symbols that should be included in the universe</param>\n        public FuncUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, PyObject universeSelector)\n            : base(configuration, universeSettings, universeSelector)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FundamentalFilteredUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a universe that can be filtered with a <see cref=\"Fundamental.Fundamental\"/> selection function\n    /// </summary>\n    public class FundamentalFilteredUniverse : SelectSymbolsUniverseDecorator\n    {\n        /// <summary>\n        /// The universe that will be used for fine universe selection\n        /// </summary>\n        public FundamentalUniverseFactory FundamentalUniverse { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalFilteredUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be filtered</param>\n        /// <param name=\"fundamentalSelector\">The fundamental selection function</param>\n        public FundamentalFilteredUniverse(Universe universe, Func<IEnumerable<Fundamental.Fundamental>, IEnumerable<Symbol>> fundamentalSelector)\n            : base(universe, universe.SelectSymbols)\n        {\n            FundamentalUniverse = Fundamental.FundamentalUniverse.USA(fundamentalSelector, universe.UniverseSettings);\n            FundamentalUniverse.SelectionChanged += (sender, args) => OnSelectionChanged(((SelectionEventArgs)args).CurrentSelection);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalFilteredUniverse\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be filtered</param>\n        /// <param name=\"fundamentalSelector\">The fundamental selection function</param>\n        public FundamentalFilteredUniverse(Universe universe, PyObject fundamentalSelector)\n            : base(universe, universe.SelectSymbols)\n        {\n            var func = fundamentalSelector.SafeAs<Func<IEnumerable<Fundamental.Fundamental>, object>>();\n            FundamentalUniverse = Fundamental.FundamentalUniverse.USA(func.ConvertToUniverseSelectionSymbolDelegate(), universe.UniverseSettings);\n            FundamentalUniverse.SelectionChanged += (sender, args) => OnSelectionChanged(((SelectionEventArgs)args).CurrentSelection);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FundamentalService.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Fundamental data provider service\n    /// </summary>\n    public static class FundamentalService\n    {\n        private static IFundamentalDataProvider _fundamentalDataProvider;\n\n        /// <summary>\n        /// Initializes the service\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        public static void Initialize(IDataProvider dataProvider, bool liveMode)\n        {\n            Initialize(dataProvider, Config.Get(\"fundamental-data-provider\", nameof(CoarseFundamentalDataProvider)), liveMode);\n        }\n\n        /// <summary>\n        /// Initializes the service\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <param name=\"fundamentalDataProvider\">The fundamental data provider</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        public static void Initialize(IDataProvider dataProvider, string fundamentalDataProvider, bool liveMode)\n        {\n            Initialize(dataProvider, Composer.Instance.GetExportedValueByTypeName<IFundamentalDataProvider>(fundamentalDataProvider), liveMode);\n        }\n\n        /// <summary>\n        /// Initializes the service\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <param name=\"fundamentalDataProvider\">The fundamental data provider</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        public static void Initialize(IDataProvider dataProvider, IFundamentalDataProvider fundamentalDataProvider, bool liveMode)\n        {\n            _fundamentalDataProvider = fundamentalDataProvider;\n            _fundamentalDataProvider.Initialize(dataProvider, liveMode);\n        }\n\n        /// <summary>\n        /// Will fetch the requested fundamental information for the requested time and symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The expected data type</typeparam>\n        /// <param name=\"time\">The time to request this data for</param>\n        /// <param name=\"symbol\">The symbol instance</param>\n        /// <param name=\"name\">The name of the fundamental property</param>\n        /// <returns>The fundamental information</returns>\n        public static T Get<T>(DateTime time, Symbol symbol, FundamentalProperty name) => Get<T>(time, symbol.ID, name);\n\n        /// <summary>\n        /// Will fetch the requested fundamental information for the requested time and symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The expected data type</typeparam>\n        /// <param name=\"time\">The time to request this data for</param>\n        /// <param name=\"securityIdentifier\">The security identifier</param>\n        /// <param name=\"name\">The name of the fundamental property</param>\n        /// <returns>The fundamental information</returns>\n        public static T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n        {\n            return _fundamentalDataProvider.Get<T>(time.Date, securityIdentifier, name);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FundamentalUniverseFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a universe that reads fundamental us equity data\n    /// </summary>\n    public class FundamentalUniverseFactory : Universe\n    {\n        internal static readonly FundamentalUniverse SymbolFactory = new();\n\n        private readonly Func<IEnumerable<Fundamental.Fundamental>, IEnumerable<Symbol>> _selector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseFactory\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FundamentalUniverseFactory(string market, UniverseSettings universeSettings, Func<IEnumerable<Fundamental.Fundamental>, IEnumerable<Symbol>> selector)\n            : this(SymbolFactory.UniverseSymbol(market), universeSettings, selector)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseFactory\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FundamentalUniverseFactory(string market, UniverseSettings universeSettings, PyObject selector)\n            : this(market, universeSettings, selector.SafeAs<Func<IEnumerable<Fundamental.Fundamental>, object>>())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseFactory\"/> class\n        /// </summary>\n        /// <param name=\"market\">The target market</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FundamentalUniverseFactory(string market, UniverseSettings universeSettings, Func<IEnumerable<Fundamental.Fundamental>, object> selector)\n            : this(market, universeSettings, selector.ConvertToUniverseSelectionSymbolDelegate())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FundamentalUniverseFactory\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Defines the symbol to use for this universe</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"selector\">Returns the symbols that should be included in the universe</param>\n        public FundamentalUniverseFactory(Symbol symbol, UniverseSettings universeSettings, Func<IEnumerable<Fundamental.Fundamental>, IEnumerable<Symbol>> selector)\n            : base(CreateConfiguration(symbol))\n        {\n            UniverseSettings = universeSettings;\n            _selector = selector;\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selector(data.Data.OfType<Fundamental.Fundamental>());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"Fundamental.Fundamental\"/> subscription configuration for the US-equity market\n        /// </summary>\n        /// <param name=\"symbol\">The symbol used in the returned configuration</param>\n        /// <returns>A fundamental subscription configuration with the specified symbol</returns>\n        public static SubscriptionDataConfig CreateConfiguration(Symbol symbol)\n        {\n            return new SubscriptionDataConfig(typeof(Fundamental.FundamentalUniverse),\n                symbol: symbol,\n                resolution: Resolution.Daily,\n                dataTimeZone: TimeZones.NewYork,\n                exchangeTimeZone: TimeZones.NewYork,\n                fillForward: false,\n                extendedHours: false,\n                isInternalFeed: true,\n                isCustom: false,\n                tickType: null,\n                isFilteredSubscription: false\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FutureUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Represents a universe of futures data\n    /// </summary>\n    public class FutureUniverse : BaseChainUniverseData\n    {\n        /// <summary>\n        /// Cache for the symbols to avoid creating them multiple times\n        /// </summary>\n        /// <remarks>Key: securityType, market, ticker, expiry</remarks>\n        private static readonly Dictionary<(SecurityType, string, string, DateTime), Symbol> _symbolsCache = new();\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FutureUniverse\"/> class\n        /// </summary>\n        public FutureUniverse()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FutureUniverse\"/> class\n        /// </summary>\n        public FutureUniverse(DateTime date, Symbol symbol, string csv)\n            : base(date, symbol, csv)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"FutureUniverse\"/> class as a copy of the given instance\n        /// </summary>\n        public FutureUniverse(FutureUniverse other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"stream\">Stream reader of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            if (stream == null || stream.EndOfStream)\n            {\n                return null;\n            }\n\n            if (stream.Peek() == '#')\n            {\n                // Skip header\n                stream.ReadLine();\n                return null;\n            }\n\n            var futureContractMonth = stream.GetDateTime(DateFormat.YearMonth);\n            var cacheKey = (config.SecurityType, config.Market, config.Symbol.ID.Symbol, futureContractMonth);\n            if (!TryGetCachedSymbol(cacheKey, out var symbol))\n            {\n                var expiry = FuturesExpiryUtilityFunctions.GetFutureExpirationFromContractMonth(config.Symbol, futureContractMonth);\n                symbol = Symbol.CreateFuture(config.Symbol.ID.Symbol, config.Symbol.ID.Market, expiry);\n                CacheSymbol(cacheKey, symbol);\n            }\n\n            return new FutureUniverse(date, symbol, stream.ReadLine());\n        }\n\n        /// <summary>\n        /// Creates a copy of the instance\n        /// </summary>\n        /// <returns>Clone of the instance</returns>\n        public override BaseData Clone()\n        {\n            return new FutureUniverse(this);\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override Resolution DefaultResolution()\n        {\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Implicit conversion into <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"data\">The option universe data to be converted</param>\n#pragma warning disable CA2225 // Operator overloads have named alternates\n        public static implicit operator Symbol(FutureUniverse data)\n#pragma warning restore CA2225 // Operator overloads have named alternates\n        {\n            return data.Symbol;\n        }\n\n        /// <summary>\n        /// Gets the CSV string representation of this universe entry\n        /// </summary>\n        public static string ToCsv(Symbol symbol, decimal open, decimal high, decimal low, decimal close, decimal volume, decimal? openInterest)\n        {\n            var contractMonth = FuturesExpiryUtilityFunctions.GetFutureContractMonth(symbol);\n            return $\"{contractMonth.ToString(DateFormat.YearMonth)},{open},{high},{low},{close},{volume},{openInterest}\";\n        }\n\n        /// <summary>\n        /// Gets the CSV header string for this universe entry\n        /// </summary>\n        public static string CsvHeader => \"expiry,open,high,low,close,volume,open_interest\";\n\n        /// <summary>\n        /// Tries to get a symbol from the cache\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected static bool TryGetCachedSymbol((SecurityType, string, string, DateTime) key, out Symbol symbol)\n        {\n            lock (_symbolsCache)\n            {\n                return _symbolsCache.TryGetValue(key, out symbol);\n            }\n        }\n\n        /// <summary>\n        /// Caches a symbol\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected static void CacheSymbol((SecurityType, string, string, DateTime) key, Symbol symbol)\n        {\n            lock (_symbolsCache)\n            {\n                // limit the cache size to help with memory usage\n                if (_symbolsCache.Count >= 100000)\n                {\n                    _symbolsCache.Clear();\n                }\n                _symbolsCache.TryAdd(key, symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/FuturesChainUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a universe for a single futures chain\n    /// </summary>\n    public class FuturesChainUniverse : Universe\n    {\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        public override bool Asynchronous\n        {\n            get\n            {\n                if (UniverseSettings.Asynchronous.HasValue)\n                {\n                    return UniverseSettings.Asynchronous.Value;\n                }\n                return Future.ContractFilter.Asynchronous;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuturesChainUniverse\"/> class\n        /// </summary>\n        /// <param name=\"future\">The canonical future chain security</param>\n        /// <param name=\"universeSettings\">The universe settings to be used for new subscriptions</param>\n        public FuturesChainUniverse(Future future,\n            UniverseSettings universeSettings)\n            : base(future.SubscriptionDataConfig)\n        {\n            Future = future;\n            UniverseSettings = universeSettings;\n        }\n\n        /// <summary>\n        /// The canonical future chain security\n        /// </summary>\n        public Future Future { get; }\n\n        /// <summary>\n        /// Gets the settings used for subscriptons added for this universe\n        /// </summary>\n        public override UniverseSettings UniverseSettings\n        {\n            set\n            {\n                if (value != null)\n                {\n                    // make sure data mode is raw\n                    base.UniverseSettings = new UniverseSettings(value) { DataNormalizationMode = DataNormalizationMode.Raw };\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            var localEndTime = utcTime.ConvertFromUtc(Future.Exchange.TimeZone);\n            var availableContracts = data.Data.Cast<FutureUniverse>().ToList();\n            var results = Future.ContractFilter.Filter(new FutureFilterUniverse(availableContracts, localEndTime));\n\n            return results.Select(x => x.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/GetSubscriptionRequestsUniverseDecorator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a universe decoration that replaces the implementation of <see cref=\"GetSubscriptionRequests\"/>\n    /// </summary>\n    public class GetSubscriptionRequestsUniverseDecorator : UniverseDecorator\n    {\n        private readonly GetSubscriptionRequestsDelegate _getRequests;\n\n        /// <summary>\n        /// Delegate type for the <see cref=\"GetSubscriptionRequests\"/> method\n        /// </summary>\n        /// <param name=\"security\">The security to get subscription requests for</param>\n        /// <param name=\"currentTimeUtc\">The current utc frontier time</param>\n        /// <param name=\"maximumEndTimeUtc\"></param>\n        /// <returns>The subscription requests for the security to be given to the data feed</returns>\n        public delegate IEnumerable<SubscriptionRequest> GetSubscriptionRequestsDelegate(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetSubscriptionRequestsUniverseDecorator\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be decorated</param>\n        /// <param name=\"getRequests\"></param>\n        public GetSubscriptionRequestsUniverseDecorator(Universe universe, GetSubscriptionRequestsDelegate getRequests)\n            : base(universe)\n        {\n            _getRequests = getRequests;\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc)\n        {\n            return _getRequests(security, currentTimeUtc, maximumEndTimeUtc);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/UniverseSelection/IFundamentalDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// \n    /// </summary>\n    public interface IFundamentalDataProvider\n    {\n        /// <summary>\n        /// Initializes the service\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider instance to use</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        void Initialize(IDataProvider dataProvider, bool liveMode);\n\n        /// <summary>\n        /// Will fetch the requested fundamental information for the requested time and symbol\n        /// </summary>\n        /// <typeparam name=\"T\">The expected data type</typeparam>\n        /// <param name=\"time\">The time to request this data for</param>\n        /// <param name=\"securityIdentifier\">The security identifier</param>\n        /// <param name=\"name\">The name of the fundamental property</param>\n        /// <returns>The fundamental information</returns>\n        T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name);\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ITimeTriggeredUniverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// A universe implementing this interface will NOT use it's SubscriptionDataConfig to generate data\n    /// that is used to 'pulse' the universe selection function -- instead, the times output by\n    /// GetTriggerTimes are used to 'pulse' the universe selection function WITHOUT data.\n    /// </summary>\n    public interface ITimeTriggeredUniverse\n    {\n        /// <summary>\n        /// Returns an enumerator that defines when this user defined universe will be invoked\n        /// </summary>\n        /// <returns>An enumerator of DateTime that defines when this universe will be invoked</returns>\n        IEnumerable<DateTime> GetTriggerTimes(DateTime startTimeUtc, DateTime endTimeUtc, MarketHoursDatabase marketHoursDatabase);\n    }\n}"
  },
  {
    "path": "Common/Data/UniverseSelection/OptionChainUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a universe for a single option chain\n    /// </summary>\n    public class OptionChainUniverse : Universe\n    {\n        private readonly OptionFilterUniverse _optionFilterUniverse;\n        // as an array to make it easy to prepend to selected symbols\n        private readonly Symbol[] _underlyingSymbol;\n\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        public override bool Asynchronous\n        {\n            get\n            {\n                if (UniverseSettings.Asynchronous.HasValue)\n                {\n                    return UniverseSettings.Asynchronous.Value;\n                }\n                return Option.ContractFilter.Asynchronous;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionChainUniverse\"/> class\n        /// </summary>\n        /// <param name=\"option\">The canonical option chain security</param>\n        /// <param name=\"universeSettings\">The universe settings to be used for new subscriptions</param>\n        public OptionChainUniverse(Option option,\n            UniverseSettings universeSettings)\n            : base(option.SubscriptionDataConfig)\n        {\n            Option = option;\n            UniverseSettings = universeSettings;\n            _underlyingSymbol = new[] { Option.Symbol.Underlying };\n            _optionFilterUniverse = new OptionFilterUniverse(Option);\n        }\n\n        /// <summary>\n        /// The canonical option chain security\n        /// </summary>\n        public Option Option { get; }\n\n        /// <summary>\n        /// Gets the settings used for subscriptons added for this universe\n        /// </summary>\n        public override UniverseSettings UniverseSettings\n        {\n            set\n            {\n                if (value != null)\n                {\n                    // make sure data mode is raw\n                    base.UniverseSettings = new UniverseSettings(value) { DataNormalizationMode = DataNormalizationMode.Raw };\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            var localEndTime = utcTime.ConvertFromUtc(Option.Exchange.TimeZone);\n            // we will only update unique strikes when there is an exchange date change\n            _optionFilterUniverse.Refresh(data.Data.Cast<OptionUniverse>().ToList(), data.Underlying, localEndTime);\n\n            var results = Option.ContractFilter.Filter(_optionFilterUniverse);\n\n            // always prepend the underlying symbol\n            return _underlyingSymbol.Concat(results.Select(x => x.Symbol));\n        }\n\n        /// <summary>\n        /// Adds the specified security to this universe\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc date time</param>\n        /// <param name=\"security\">The security to be added</param>\n        /// <param name=\"isInternal\">True if internal member</param>\n        /// <returns>True if the security was successfully added,\n        /// false if the security was already in the universe</returns>\n        internal override bool AddMember(DateTime utcTime, Security security, bool isInternal)\n        {\n            // never add members to disposed universes\n            if (DisposeRequested)\n            {\n                return false;\n            }\n\n            if (Securities.ContainsKey(security.Symbol))\n            {\n                return false;\n            }\n\n            // method take into account the case, when the option has experienced an adjustment\n            // we update member reference in this case\n            if (Securities.Any(x => x.Value.Security == security))\n            {\n                Member member;\n                Securities.TryRemove(security.Symbol, out member);\n            }\n\n            return Securities.TryAdd(security.Symbol, new Member(utcTime, security, isInternal));\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc,\n                                                                                 ISubscriptionDataConfigService subscriptionService)\n        {\n            if (Option.Symbol.Underlying == security.Symbol)\n            {\n                Option.Underlying = security;\n                security.SetDataNormalizationMode(DataNormalizationMode.Raw);\n            }\n            else\n            {\n                // set the underlying security and pricing model from the canonical security\n                var option = (Option)security;\n                option.PriceModel = Option.PriceModel;\n            }\n\n            return base.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc, subscriptionService);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/OptionUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Represents a universe of options data\n    /// </summary>\n    public class OptionUniverse : BaseChainUniverseData\n    {\n        /// <summary>\n        /// Cache for the symbols to avoid creating them multiple times\n        /// </summary>\n        /// <remarks>Key: securityType, market, ticker, expiry, strike, right</remarks>\n        private static readonly Dictionary<(SecurityType, string, string, DateTime, decimal, OptionRight), Symbol> _symbolsCache = new();\n\n        private const int StartingGreeksCsvIndex = 7;\n\n        /// <summary>\n        /// Open interest value of the option\n        /// </summary>\n        public override decimal OpenInterest\n        {\n            get\n            {\n                ThrowIfNotAnOption(nameof(OpenInterest));\n                return base.OpenInterest;\n            }\n        }\n\n        /// <summary>\n        /// Implied volatility value of the option\n        /// </summary>\n        public decimal ImpliedVolatility\n        {\n            get\n            {\n                ThrowIfNotAnOption(nameof(ImpliedVolatility));\n                return CsvLine.GetDecimalFromCsv(6);\n            }\n        }\n\n        /// <summary>\n        /// Greeks values of the option\n        /// </summary>\n        public Greeks Greeks\n        {\n            get\n            {\n                ThrowIfNotAnOption(nameof(Greeks));\n                return new PreCalculatedGreeks(CsvLine);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionUniverse\"/> class\n        /// </summary>\n        public OptionUniverse()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionUniverse\"/> class\n        /// </summary>\n        public OptionUniverse(DateTime date, Symbol symbol, string csv)\n            : base(date, symbol, csv)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"OptionUniverse\"/> class as a copy of the given instance\n        /// </summary>\n        public OptionUniverse(OptionUniverse other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object\n        /// each time it is called.\n        /// </summary>\n        /// <param name=\"config\">Subscription data config setup object</param>\n        /// <param name=\"stream\">Stream reader of the source document</param>\n        /// <param name=\"date\">Date of the requested data</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>Instance of the T:BaseData object generated by this line of the CSV</returns>\n        [StubsIgnore]\n        public override BaseData Reader(SubscriptionDataConfig config, StreamReader stream, DateTime date, bool isLiveMode)\n        {\n            if (stream == null || stream.EndOfStream)\n            {\n                return null;\n            }\n\n            var firstChar = (char)stream.Peek();\n            if (firstChar == '#')\n            {\n                // Skip header\n                stream.ReadLine();\n                return null;\n            }\n\n            Symbol symbol;\n            if (!char.IsDigit(firstChar))\n            {\n                // This is the underlying line\n                symbol = config.Symbol.Underlying;\n                // Skip the first 3 cells, expiry, strike and right, which will be empty for the underlying\n                stream.GetChar();\n                stream.GetChar();\n                stream.GetChar();\n            }\n            else\n            {\n                var expiry = stream.GetDateTime(\"yyyyMMdd\");\n                var strike = stream.GetDecimal();\n                var right = char.ToUpperInvariant(stream.GetChar()) == 'C' ? OptionRight.Call : OptionRight.Put;\n                var targetOption = config.Symbol.SecurityType != SecurityType.IndexOption ? null : config.Symbol.ID.Symbol;\n\n                var cacheKey = (config.SecurityType, config.Market, targetOption ?? config.Symbol.Underlying.Value, expiry, strike, right);\n                if (!TryGetCachedSymbol(cacheKey, out symbol))\n                {\n                    symbol = Symbol.CreateOption(config.Symbol.Underlying, targetOption, config.Symbol.ID.Market,\n                        config.Symbol.SecurityType.DefaultOptionStyle(), right, strike, expiry);\n                    CacheSymbol(cacheKey, symbol);\n                }\n            }\n\n            return new OptionUniverse(date, symbol, stream.ReadLine());\n        }\n\n        /// <summary>\n        /// Adds a new data point to this collection.\n        /// If the data point is for the underlying, it will be stored in the <see cref=\"BaseDataCollection.Underlying\"/> property.\n        /// </summary>\n        /// <param name=\"newDataPoint\">The new data point to add</param>\n        public override void Add(BaseData newDataPoint)\n        {\n            if (newDataPoint is BaseChainUniverseData optionUniverseDataPoint)\n            {\n                if (optionUniverseDataPoint.Symbol.HasUnderlying)\n                {\n                    optionUniverseDataPoint.Underlying = Underlying;\n                    base.Add(optionUniverseDataPoint);\n                }\n                else\n                {\n                    Underlying = optionUniverseDataPoint;\n                    foreach (BaseChainUniverseData data in Data)\n                    {\n                        data.Underlying = optionUniverseDataPoint;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a copy of the instance\n        /// </summary>\n        /// <returns>Clone of the instance</returns>\n        public override BaseData Clone()\n        {\n            return new OptionUniverse(this);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static string GetOptionSymbolCsv(Symbol symbol)\n        {\n            if (!symbol.SecurityType.IsOption())\n            {\n                return \",,\";\n            }\n\n            return $\"{symbol.ID.Date:yyyyMMdd},{symbol.ID.StrikePrice},{(symbol.ID.OptionRight == OptionRight.Call ? 'C' : 'P')}\";\n        }\n\n        /// <summary>\n        /// Gets the CSV string representation of this universe entry\n        /// </summary>\n        public static string ToCsv(Symbol symbol, decimal open, decimal high, decimal low, decimal close, decimal volume, decimal? openInterest,\n            decimal? impliedVolatility, Greeks greeks)\n        {\n            if (symbol.SecurityType == SecurityType.Future || symbol.SecurityType == SecurityType.FutureOption)\n            {\n                return $\"{GetOptionSymbolCsv(symbol)},{open},{high},{low},{close},{volume},{openInterest}\";\n            }\n\n            return $\"{GetOptionSymbolCsv(symbol)},{open},{high},{low},{close},{volume},\"\n                + $\"{openInterest},{impliedVolatility},{greeks?.Delta},{greeks?.Gamma},{greeks?.Vega},{greeks?.ThetaPerDay},{greeks?.Rho}\";\n        }\n\n        /// <summary>\n        /// Implicit conversion into <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"data\">The option universe data to be converted</param>\n#pragma warning disable CA2225 // Operator overloads have named alternates\n        public static implicit operator Symbol(OptionUniverse data)\n#pragma warning restore CA2225 // Operator overloads have named alternates\n        {\n            return data.Symbol;\n        }\n\n        /// <summary>\n        /// Gets the CSV header string for this universe entry\n        /// </summary>\n        public static string CsvHeader(SecurityType securityType)\n        {\n            // FOPs don't have greeks\n            if (securityType == SecurityType.FutureOption || securityType == SecurityType.Future)\n            {\n                return \"expiry,strike,right,open,high,low,close,volume,open_interest\";\n            }\n\n            return \"expiry,strike,right,open,high,low,close,volume,open_interest,implied_volatility,delta,gamma,vega,theta,rho\";\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void ThrowIfNotAnOption(string propertyName)\n        {\n            if (!Symbol.SecurityType.IsOption())\n            {\n                throw new InvalidOperationException($\"{propertyName} is only available for options.\");\n            }\n        }\n\n        /// <summary>\n        /// Pre-calculated greeks lazily parsed from csv line.\n        /// It parses the greeks values from the csv line only when they are requested to avoid holding decimals in memory.\n        /// </summary>\n        private class PreCalculatedGreeks : Greeks\n        {\n            private readonly string _csvLine;\n\n            public override decimal Delta => _csvLine.GetDecimalFromCsv(StartingGreeksCsvIndex);\n\n            public override decimal Gamma => _csvLine.GetDecimalFromCsv(StartingGreeksCsvIndex + 1);\n\n            public override decimal Vega => _csvLine.GetDecimalFromCsv(StartingGreeksCsvIndex + 2);\n\n            public override decimal Theta => _csvLine.GetDecimalFromCsv(StartingGreeksCsvIndex + 3) * 365m;\n\n            public override decimal Rho => _csvLine.GetDecimalFromCsv(StartingGreeksCsvIndex + 4);\n\n            [PandasIgnore]\n            public override decimal Lambda => decimal.Zero;\n\n            /// <summary>\n            /// Initializes a new default instance of the <see cref=\"PreCalculatedGreeks\"/> class\n            /// </summary>\n            public PreCalculatedGreeks(string csvLine)\n            {\n                _csvLine = csvLine;\n            }\n\n            /// <summary>\n            /// Gets a string representation of the greeks values\n            /// </summary>\n            public override string ToString()\n            {\n                return $\"D: {Delta}, G: {Gamma}, V: {Vega}, T: {Theta}, R: {Rho}\";\n            }\n        }\n\n        /// <summary>\n        /// Tries to get a symbol from the cache\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected static bool TryGetCachedSymbol((SecurityType, string, string, DateTime, decimal, OptionRight) key, out Symbol symbol)\n        {\n            lock (_symbolsCache)\n            {\n                return _symbolsCache.TryGetValue(key, out symbol);\n            }\n        }\n\n        /// <summary>\n        /// Caches a symbol\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected static void CacheSymbol((SecurityType, string, string, DateTime, decimal, OptionRight) key, Symbol symbol)\n        {\n            lock (_symbolsCache)\n            {\n                // limit the cache size to help with memory usage\n                if (_symbolsCache.Count >= 500000)\n                {\n                    _symbolsCache.Clear();\n                }\n                _symbolsCache.TryAdd(key, symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/Schedule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Scheduling;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Entity in charge of managing a schedule\n    /// </summary>\n    public class Schedule\n    {\n        private IDateRule _dateRule;\n\n        /// <summary>\n        /// True if this schedule is set\n        /// </summary>\n        public bool Initialized => _dateRule != null;\n\n        /// <summary>\n        /// Set a <see cref=\"IDateRule\"/> for this schedule\n        /// </summary>\n        public void On(IDateRule dateRule)\n        {\n            _dateRule = dateRule;\n        }\n\n        /// <summary>\n        /// Gets the current schedule for a given start time\n        /// </summary>\n        public IEnumerable<DateTime> Get(DateTime startTime, DateTime endTime)\n        {\n            return _dateRule?.GetDates(startTime, endTime) ?? Enumerable.Empty<DateTime>();\n        }\n\n        /// <summary>\n        /// Creates a new instance holding the same schedule if any\n        /// </summary>\n        public Schedule Clone()\n        {\n            return new Schedule { _dateRule = _dateRule };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/ScheduledUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines a user that is fired based on a specified <see cref=\"IDateRule\"/> and <see cref=\"ITimeRule\"/>\n    /// </summary>\n    public class ScheduledUniverse : Universe, ITimeTriggeredUniverse\n    {\n        private readonly IDateRule _dateRule;\n        private readonly ITimeRule _timeRule;\n        private readonly Func<DateTime, IEnumerable<Symbol>> _selector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverse\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone the date/time rules are in</param>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverse(DateTimeZone timeZone, IDateRule dateRule, ITimeRule timeRule, Func<DateTime, IEnumerable<Symbol>> selector, UniverseSettings settings = null)\n            : base(CreateConfiguration(timeZone, dateRule, timeRule))\n        {\n            _dateRule = dateRule;\n            _timeRule = timeRule;\n            _selector = selector;\n            UniverseSettings = settings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverse\"/> class\n        /// </summary>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverse(IDateRule dateRule, ITimeRule timeRule, Func<DateTime, IEnumerable<Symbol>> selector, UniverseSettings settings = null)\n            : this(TimeZones.Utc, dateRule, timeRule, selector, settings)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverse\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone the date/time rules are in</param>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverse(DateTimeZone timeZone, IDateRule dateRule, ITimeRule timeRule, PyObject selector, UniverseSettings settings = null)\n            : base(CreateConfiguration(timeZone, dateRule, timeRule))\n        {\n            selector.TrySafeAs<Func<DateTime, object>>(out var func);\n            _dateRule = dateRule;\n            _timeRule = timeRule;\n            _selector = func.ConvertSelectionSymbolDelegate();\n            UniverseSettings = settings;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledUniverse\"/> class\n        /// </summary>\n        /// <param name=\"dateRule\">Date rule defines what days the universe selection function will be invoked</param>\n        /// <param name=\"timeRule\">Time rule defines what times on each day selected by date rule the universe selection function will be invoked</param>\n        /// <param name=\"selector\">Selector function accepting the date time firing time and returning the universe selected symbols</param>\n        /// <param name=\"settings\">Universe settings for subscriptions added via this universe, null will default to algorithm's universe settings</param>\n        public ScheduledUniverse(IDateRule dateRule, ITimeRule timeRule, PyObject selector, UniverseSettings settings = null)\n            : this(TimeZones.Utc, dateRule, timeRule, selector, settings)\n        {\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selector(DateTime.SpecifyKind(utcTime, DateTimeKind.Unspecified));\n        }\n\n        /// <summary>\n        /// Get an enumerator of UTC DateTimes that defines when this universe will be invoked\n        /// </summary>\n        /// <param name=\"startTimeUtc\">The start time of the range in UTC</param>\n        /// <param name=\"endTimeUtc\">The end time of the range in UTC</param>\n        /// <returns>An enumerator of UTC DateTimes that defines when this universe will be invoked</returns>\n        public IEnumerable<DateTime> GetTriggerTimes(DateTime startTimeUtc, DateTime endTimeUtc, MarketHoursDatabase marketHoursDatabase)\n        {\n            var startTimeLocal = startTimeUtc.ConvertFromUtc(Configuration.ExchangeTimeZone);\n            var endTimeLocal = endTimeUtc.ConvertFromUtc(Configuration.ExchangeTimeZone);\n\n            // define date/time rule enumerable\n            var dates = _dateRule.GetDates(startTimeLocal, endTimeLocal);\n            var times = _timeRule.CreateUtcEventTimes(dates).GetEnumerator();\n\n            // Make sure and filter out any times before our start time\n            // GH #5440\n            do\n            {\n                if (!times.MoveNext())\n                {\n                    times.Dispose();\n                    yield break;\n                }\n            }\n            while (times.Current < startTimeUtc);\n\n            // Start yielding times\n            do\n            {\n                yield return times.Current;\n            }\n            while (times.MoveNext());\n            times.Dispose();\n        }\n\n        private static SubscriptionDataConfig CreateConfiguration(DateTimeZone timeZone, IDateRule dateRule, ITimeRule timeRule)\n        {\n            // remove forbidden characters\n            var ticker = $\"{dateRule.Name}_{timeRule.Name}\";\n            foreach (var c in SecurityIdentifier.InvalidSymbolCharacters)\n            {\n                ticker = ticker.Replace(c.ToStringInvariant(), \"_\");\n            }\n\n            var symbol = Symbol.Create(ticker, SecurityType.Base, QuantConnect.Market.USA);\n            var config = new SubscriptionDataConfig(typeof(Tick),\n                symbol: symbol,\n                resolution: Resolution.Daily,\n                dataTimeZone: timeZone,\n                exchangeTimeZone: timeZone,\n                fillForward: false,\n                extendedHours: false,\n                isInternalFeed: true,\n                isCustom: false,\n                tickType: null,\n                isFilteredSubscription: false\n            );\n\n            // force always open hours so we don't inadvertently mess with the scheduled firing times\n            MarketHoursDatabase.FromDataFolder()\n                .SetEntryAlwaysOpen(config.Market, config.Symbol.Value, config.SecurityType, config.ExchangeTimeZone);\n\n            return config;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/SecurityChanges.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines the additions and subtractions to the algorithm's security subscriptions\n    /// </summary>\n    public class SecurityChanges\n    {\n        /// <summary>\n        /// Gets an instance that represents no changes have been made\n        /// </summary>\n        public static readonly SecurityChanges None = new (Enumerable.Empty<Security>(), Enumerable.Empty<Security>(),\n            Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n\n        private readonly IReadOnlySet<Security> _addedSecurities;\n        private readonly IReadOnlySet<Security> _removedSecurities;\n        private readonly IReadOnlySet<Security> _internalAddedSecurities;\n        private readonly IReadOnlySet<Security> _internalRemovedSecurities;\n\n        /// <summary>\n        /// Gets the total count of added and removed securities\n        /// </summary>\n        public int Count => _addedSecurities.Count + _removedSecurities.Count\n            + _internalAddedSecurities.Count + _internalRemovedSecurities.Count;\n\n        /// <summary>\n        /// True will filter out custom securities from the\n        /// <see cref=\"AddedSecurities\"/> and <see cref=\"RemovedSecurities\"/> properties\n        /// </summary>\n        /// <remarks>This allows us to filter but also to disable\n        /// the filtering if desired</remarks>\n        public bool FilterCustomSecurities { get; set; }\n\n        /// <summary>\n        /// True will filter out internal securities from the\n        /// <see cref=\"AddedSecurities\"/> and <see cref=\"RemovedSecurities\"/> properties\n        /// </summary>\n        /// <remarks>This allows us to filter but also to disable\n        /// the filtering if desired</remarks>\n        public bool FilterInternalSecurities { get; set; }\n\n        /// <summary>\n        /// Gets the symbols that were added by universe selection\n        /// </summary>\n        /// <remarks>Will use <see cref=\"FilterCustomSecurities\"/> value\n        /// to determine if custom securities should be filtered</remarks>\n        /// <remarks>Will use <see cref=\"FilterInternalSecurities\"/> value\n        /// to determine if internal securities should be filtered</remarks>\n        public IReadOnlyList<Security> AddedSecurities => GetFilteredList(_addedSecurities,\n            !FilterInternalSecurities ? _internalAddedSecurities : null);\n\n        /// <summary>\n        /// Gets the symbols that were removed by universe selection. This list may\n        /// include symbols that were removed, but are still receiving data due to\n        /// existing holdings or open orders\n        /// </summary>\n        /// <remarks>Will use <see cref=\"FilterCustomSecurities\"/> value\n        /// to determine if custom securities should be filtered</remarks>\n        /// <remarks>Will use <see cref=\"FilterInternalSecurities\"/> value\n        /// to determine if internal securities should be filtered</remarks>\n        public IReadOnlyList<Security> RemovedSecurities => GetFilteredList(_removedSecurities,\n            !FilterInternalSecurities ? _internalRemovedSecurities : null);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityChanges\"/> class\n        /// </summary>\n        /// <param name=\"additions\">Added symbols list</param>\n        /// <param name=\"removals\">Removed symbols list</param>\n        /// <param name=\"internalAdditions\">Internal added symbols list</param>\n        /// <param name=\"internalRemovals\">Internal removed symbols list</param>\n        private SecurityChanges(IEnumerable<Security> additions, IEnumerable<Security> removals,\n            IEnumerable<Security> internalAdditions, IEnumerable<Security> internalRemovals)\n        {\n            _addedSecurities = additions.ToHashSet();\n            _removedSecurities = removals.ToHashSet();\n            _internalAddedSecurities = internalAdditions.ToHashSet();\n            _internalRemovedSecurities = internalRemovals.ToHashSet();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityChanges\"/> class\n        /// as a shallow clone of a given instance, sharing the same collections\n        /// </summary>\n        /// <param name=\"changes\">The instance to clone</param>\n        public SecurityChanges(SecurityChanges changes)\n        {\n            _addedSecurities = changes._addedSecurities;\n            _removedSecurities = changes._removedSecurities;\n            _internalAddedSecurities = changes._internalAddedSecurities;\n            _internalRemovedSecurities = changes._internalRemovedSecurities;\n        }\n\n        /// <summary>\n        /// Combines the results of two <see cref=\"SecurityChanges\"/>\n        /// </summary>\n        /// <param name=\"left\">The left side of the operand</param>\n        /// <param name=\"right\">The right side of the operand</param>\n        /// <returns>Adds the additions together and removes any removals found in the additions, that is, additions take precedence</returns>\n        public static SecurityChanges operator +(SecurityChanges left, SecurityChanges right)\n        {\n            // common case is adding something to nothing, shortcut these to prevent linqness\n            if (left == None || left.Count == 0) return right;\n            if (right == None || right.Count == 0) return left;\n\n            var additions = Merge(left._addedSecurities, right._addedSecurities);\n            var internalAdditions = Merge(left._internalAddedSecurities, right._internalAddedSecurities);\n\n            var removals = Merge(left._removedSecurities, right._removedSecurities,\n                security => !additions.Contains(security) && !internalAdditions.Contains(security));\n            var internalRemovals = Merge(left._internalRemovedSecurities, right._internalRemovedSecurities,\n                security => !additions.Contains(security) && !internalAdditions.Contains(security));\n\n            return new SecurityChanges(additions, removals, internalAdditions, internalRemovals);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityChanges\"/> class all none internal\n        /// </summary>\n        /// <param name=\"additions\">Added symbols list</param>\n        /// <param name=\"removals\">Removed symbols list</param>\n        /// <param name=\"internalAdditions\">Internal added symbols list</param>\n        /// <param name=\"internalRemovals\">Internal removed symbols list</param>\n        /// <remarks>Useful for testing</remarks>\n        public static SecurityChanges Create(IReadOnlyCollection<Security> additions, IReadOnlyCollection<Security> removals,\n            IReadOnlyCollection<Security> internalAdditions, IReadOnlyCollection<Security> internalRemovals)\n        {\n            // return None if there's no changes, otherwise return what we've modified\n            return additions?.Count + removals?.Count + internalAdditions?.Count + internalRemovals?.Count > 0\n                ? new SecurityChanges(additions, removals, internalAdditions, internalRemovals)\n                : None;\n        }\n\n        #region Overrides of Object\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            if (Count == 0)\n            {\n                return \"SecurityChanges: None\";\n            }\n\n            var added = string.Empty;\n            if (AddedSecurities.Count != 0)\n            {\n                added = $\" Added: {string.Join(\",\", AddedSecurities.Select(x => x.Symbol.ID))}\";\n            }\n            var removed = string.Empty;\n            if (RemovedSecurities.Count != 0)\n            {\n                removed = $\" Removed: {string.Join(\",\", RemovedSecurities.Select(x => x.Symbol.ID))}\";\n            }\n\n            return $\"SecurityChanges: {added}{removed}\";\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Helper method to filter added and removed securities based on current settings\n        /// </summary>\n        private IReadOnlyList<Security> GetFilteredList(IReadOnlySet<Security> source, IReadOnlySet<Security> secondSource = null)\n        {\n            IEnumerable<Security> enumerable = source;\n            if (secondSource != null && secondSource.Count > 0)\n            {\n                enumerable = enumerable.Union(secondSource);\n            }\n            return enumerable.Where(kvp => !FilterCustomSecurities || kvp.Type != SecurityType.Base)\n                .Select(kvp => kvp)\n                .OrderBy(security => security.Symbol.Value)\n                .ToList();\n        }\n\n        /// <summary>\n        /// Helper method that will merge two security sets, taken into account an optional filter\n        /// </summary>\n        /// <returns>Will return merged set</returns>\n        private static HashSet<Security> Merge(IReadOnlyCollection<Security> left, IReadOnlyCollection<Security> right, Func<Security, bool> filter = null)\n        {\n            // if right is emtpy we just use left\n            IEnumerable<Security> result = left;\n            if (right.Count != 0)\n            {\n                if (left.Count == 0)\n                {\n                    // left is emtpy so let's just use right\n                    result = right;\n                }\n                else\n                {\n                    // merge, both are not empty\n                    result = result.Concat(right);\n                }\n            }\n\n            if (filter != null)\n            {\n                result = result.Where(filter.Invoke);\n            }\n\n            return new HashSet<Security>(result);\n        }\n    }\n\n    /// <summary>\n    /// Helper method to create security changes\n    /// </summary>\n    public class SecurityChangesConstructor\n    {\n        private readonly List<Security> _internalAdditions =  new();\n        private readonly List<Security> _internalRemovals =  new();\n        private readonly List<Security> _additions = new();\n        private readonly List<Security> _removals = new();\n\n        /// <summary>\n        /// Inserts a security addition change\n        /// </summary>\n        public void Add(Security security, bool isInternal)\n        {\n            if (isInternal)\n            {\n                _internalAdditions.Add(security);\n            }\n            else\n            {\n                _additions.Add(security);\n            }\n        }\n\n        /// <summary>\n        /// Inserts a security removal change\n        /// </summary>\n        public void Remove(Security security, bool isInternal)\n        {\n            if (isInternal)\n            {\n                _internalRemovals.Add(security);\n            }\n            else\n            {\n                _removals.Add(security);\n            }\n        }\n\n        /// <summary>\n        /// Get the current security changes clearing state\n        /// </summary>\n        public SecurityChanges Flush()\n        {\n            var result = SecurityChanges.Create(_additions, _removals, _internalAdditions, _internalRemovals);\n\n            _internalAdditions.Clear();\n            _removals.Clear();\n            _internalRemovals.Clear();\n            _additions.Clear();\n\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/SelectSymbolsUniverseDecorator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a univese decoration that replaces the implementation of <see cref=\"SelectSymbols\"/>\n    /// </summary>\n    public class SelectSymbolsUniverseDecorator : UniverseDecorator\n    {\n        private readonly SelectSymbolsDelegate _selectSymbols;\n\n        /// <summary>\n        /// Delegate type for the <see cref=\"SelectSymbols\"/> method\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc frontier time</param>\n        /// <param name=\"data\">The universe selection data</param>\n        /// <returns>The symbols selected by the universe</returns>\n        public delegate IEnumerable<Symbol> SelectSymbolsDelegate(DateTime utcTime, BaseDataCollection data);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SelectSymbolsUniverseDecorator\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The universe to be decorated</param>\n        /// <param name=\"selectSymbols\">The new implementation of <see cref=\"SelectSymbols\"/></param>\n        public SelectSymbolsUniverseDecorator(Universe universe, SelectSymbolsDelegate selectSymbols)\n            : base(universe)\n        {\n            _selectSymbols = selectSymbols;\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selectSymbols(utcTime, data);\n        }\n    }\n}"
  },
  {
    "path": "Common/Data/UniverseSelection/SubscriptionRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines the parameters required to add a subscription to a data feed.\n    /// </summary>\n    public class SubscriptionRequest : BaseDataRequest\n    {\n        /// <summary>\n        /// Gets true if the subscription is a universe\n        /// </summary>\n        public bool IsUniverseSubscription { get; }\n\n        /// <summary>\n        /// Gets the universe this subscription resides in\n        /// </summary>\n        public Universe Universe { get; }\n\n        /// <summary>\n        /// Gets the security. This is the destination of data for non-internal subscriptions.\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the subscription configuration. This defines how/where to read the data.\n        /// </summary>\n        public SubscriptionDataConfig Configuration { get; }\n\n        /// <summary>\n        /// Gets the tradable days specified by this request, in the security's data time zone\n        /// </summary>\n        public override IEnumerable<DateTime> TradableDaysInDataTimeZone => Time.EachTradeableDayInTimeZone(ExchangeHours,\n            StartTimeLocal,\n            EndTimeLocal,\n            Configuration.DataTimeZone,\n            Configuration.ExtendedMarketHours);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionRequest\"/> class\n        /// </summary>\n        public SubscriptionRequest(bool isUniverseSubscription,\n            Universe universe,\n            Security security,\n            SubscriptionDataConfig configuration,\n            DateTime startTimeUtc,\n            DateTime endTimeUtc)\n            : base(startTimeUtc, endTimeUtc, security.Exchange.Hours, configuration.TickType, configuration.IsCustomData, configuration.Type)\n        {\n            IsUniverseSubscription = isUniverseSubscription;\n            Universe = universe;\n            Security = security;\n            Configuration = configuration;\n\n            // open interest data comes in once a day before market open,\n            // make the subscription start from midnight and use always open exchange\n            if (Configuration.TickType == TickType.OpenInterest)\n            {\n                StartTimeUtc = StartTimeUtc.ConvertFromUtc(ExchangeHours.TimeZone).Date.ConvertToUtc(ExchangeHours.TimeZone);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionRequest\"/> class\n        /// </summary>\n        public SubscriptionRequest(SubscriptionRequest template,\n            bool? isUniverseSubscription = null,\n            Universe universe = null,\n            Security security = null,\n            SubscriptionDataConfig configuration = null,\n            DateTime? startTimeUtc = null,\n            DateTime? endTimeUtc = null\n            )\n            : this(isUniverseSubscription ?? template.IsUniverseSubscription,\n                  universe ?? template.Universe,\n                  security ?? template.Security,\n                  configuration ?? template.Configuration,\n                  startTimeUtc ?? template.StartTimeUtc,\n                  endTimeUtc ?? template.EndTimeUtc\n                  )\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/Universe.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides a base class for all universes to derive from.\n    /// </summary>\n    public abstract class Universe : IDisposable\n    {\n        /// <summary>\n        /// Used to round the members time in universe <see cref=\"CanRemoveMember\"/>, this is\n        /// done because we can not guarantee exact selection time in live mode, see GH issue 3287\n        /// </summary>\n        private TimeSpan? _minimumTimeInUniverseRoundingInterval;\n\n        /// <summary>\n        /// Gets a value indicating that no change to the universe should be made\n        /// </summary>\n        public static readonly UnchangedUniverse Unchanged = UnchangedUniverse.Instance;\n\n        private HashSet<Symbol> _previousSelections;\n\n        /// <summary>\n        /// Gets the internal security collection used to define membership in this universe\n        /// </summary>\n        public virtual ConcurrentDictionary<Symbol, Member> Securities\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// The currently selected symbol set\n        /// </summary>\n        /// <remarks>This set might be different than <see cref=\"Securities\"/> which might hold members that are no longer selected\n        /// but have not been removed yet, this can be because they have some open position, orders, haven't completed the minimum time in universe</remarks>\n        public HashSet<Symbol> Selected\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        public virtual bool Asynchronous\n        {\n            get\n            {\n                if (UniverseSettings.Asynchronous.HasValue)\n                {\n                    return UniverseSettings.Asynchronous.Value;\n                }\n                return false;\n            }\n            set\n            {\n                UniverseSettings.Asynchronous = value;\n            }\n        }\n\n        /// <summary>\n        /// Event fired when the universe selection has changed\n        /// </summary>\n        public event EventHandler SelectionChanged;\n\n        /// <summary>\n        /// Gets the security type of this universe\n        /// </summary>\n        public SecurityType SecurityType => Configuration.SecurityType;\n\n        /// <summary>\n        /// Gets the market of this universe\n        /// </summary>\n        public string Market => Configuration.Market;\n\n        /// <summary>\n        /// Gets the symbol of this universe\n        /// </summary>\n        public Symbol Symbol => Configuration.Symbol;\n\n        /// <summary>\n        /// Gets the data type of this universe\n        /// </summary>\n        public Type DataType => Configuration.Type;\n\n        /// <summary>\n        /// Flag indicating if disposal of this universe has been requested\n        /// </summary>\n        public virtual bool DisposeRequested\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Gets the settings used for subscriptions added for this universe\n        /// </summary>\n        public virtual UniverseSettings UniverseSettings\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the configuration used to get universe data\n        /// </summary>\n        public virtual SubscriptionDataConfig Configuration\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the current listing of members in this universe. Modifications\n        /// to this dictionary do not change universe membership.\n        /// </summary>\n        public Dictionary<Symbol, Security> Members\n        {\n            get { return Securities.Select(x => x.Value.Security).ToDictionary(x => x.Symbol); }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Universe\"/> class\n        /// </summary>\n        /// <param name=\"config\">The configuration used to source data for this universe</param>\n        protected Universe(SubscriptionDataConfig config)\n        {\n            _previousSelections = new HashSet<Symbol>();\n            Securities = new ConcurrentDictionary<Symbol, Member>();\n\n            Configuration = config;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified security can be removed from\n        /// this universe. This is useful to prevent securities from being taken\n        /// out of a universe before the algorithm has had enough time to make\n        /// decisions on the security\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"security\">The security to check if its ok to remove</param>\n        /// <returns>True if we can remove the security, false otherwise</returns>\n        public virtual bool CanRemoveMember(DateTime utcTime, Security security)\n        {\n            // can always remove securities after dispose requested\n            if (DisposeRequested)\n            {\n                return true;\n            }\n\n            // can always remove delisted securities from the universe\n            if (security.IsDelisted)\n            {\n                return true;\n            }\n\n            Member member;\n            if (Securities.TryGetValue(security.Symbol, out member))\n            {\n                if (_minimumTimeInUniverseRoundingInterval == null)\n                {\n                    // lets set _minimumTimeInUniverseRoundingInterval once\n                    _minimumTimeInUniverseRoundingInterval = UniverseSettings.MinimumTimeInUniverse;\n                    AdjustMinimumTimeInUniverseRoundingInterval();\n                }\n\n                var timeInUniverse = utcTime - member.Added;\n                if (timeInUniverse.Round(_minimumTimeInUniverseRoundingInterval.Value)\n                    >= UniverseSettings.MinimumTimeInUniverse)\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public IEnumerable<Symbol> PerformSelection(DateTime utcTime, BaseDataCollection data)\n        {\n            // select empty set of symbols after dispose requested\n            if (DisposeRequested)\n            {\n                OnSelectionChanged();\n                return Enumerable.Empty<Symbol>();\n            }\n\n            var selections = data.FilteredContracts;\n            if (selections == null)\n            {\n                // only trigger selection if it hasn't already been run\n                var result = SelectSymbols(utcTime, data);\n                if (ReferenceEquals(result, Unchanged))\n                {\n                    data.FilteredContracts = _previousSelections;\n                    return Unchanged;\n                }\n\n                selections = result.ToHashSet();\n                data.FilteredContracts = selections;\n            }\n\n            var hasDiffs = _previousSelections.AreDifferent(selections);\n            _previousSelections = selections;\n            if (!hasDiffs)\n            {\n                return Unchanged;\n            }\n\n            OnSelectionChanged(selections);\n            return selections;\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public abstract IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data);\n\n        /// <summary>\n        /// Creates and configures a security for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be created</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database</param>\n        /// <param name=\"symbolPropertiesDatabase\">The symbol properties database</param>\n        /// <returns>The newly initialized security object</returns>\n        /// <obsolete>The CreateSecurity won't be called</obsolete>\n        [Obsolete(\"CreateSecurity is obsolete and will not be called. The system will create the required Securities based on selected symbols\")]\n        public virtual Security CreateSecurity(Symbol symbol, IAlgorithm algorithm, MarketHoursDatabase marketHoursDatabase, SymbolPropertiesDatabase symbolPropertiesDatabase)\n        {\n            throw new InvalidOperationException(\"CreateSecurity is obsolete and should not be called.\" +\n                \"The system will create the required Securities based on selected symbols\");\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <returns>All subscriptions required by this security</returns>\n        [Obsolete(\"This overload is obsolete and will not be called. It was not capable of creating new SubscriptionDataConfig due to lack of information\")]\n        public virtual IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc)\n        {\n            throw new InvalidOperationException(\"This overload is obsolete and should not be called.\" +\n                \"It was not capable of creating new SubscriptionDataConfig due to lack of information\");\n        }\n\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public virtual IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security,\n            DateTime currentTimeUtc,\n            DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            var result = subscriptionService.Add(security.Symbol,\n                UniverseSettings.Resolution,\n                UniverseSettings.FillForward,\n                UniverseSettings.ExtendedMarketHours,\n                dataNormalizationMode: UniverseSettings.DataNormalizationMode,\n                subscriptionDataTypes: UniverseSettings.SubscriptionDataTypes,\n                dataMappingMode: UniverseSettings.DataMappingMode,\n                contractDepthOffset: (uint)Math.Abs(UniverseSettings.ContractDepthOffset));\n            return result.Select(config => new SubscriptionRequest(isUniverseSubscription: false,\n                universe: this,\n                security: security,\n                configuration: config,\n                startTimeUtc: currentTimeUtc,\n                endTimeUtc: maximumEndTimeUtc));\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified symbol is currently a member of this universe\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose membership is to be checked</param>\n        /// <returns>True if the specified symbol is part of this universe, false otherwise</returns>\n        public bool ContainsMember(Symbol symbol)\n        {\n            return Securities.ContainsKey(symbol);\n        }\n\n        /// <summary>\n        /// Adds the specified security to this universe\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc date time</param>\n        /// <param name=\"security\">The security to be added</param>\n        /// <param name=\"isInternal\">True if internal member</param>\n        /// <returns>True if the security was successfully added,\n        /// false if the security was already in the universe</returns>\n        internal virtual bool AddMember(DateTime utcTime, Security security, bool isInternal)\n        {\n            // never add members to disposed universes\n            if (DisposeRequested)\n            {\n                return false;\n            }\n\n            if (security.IsDelisted)\n            {\n                return false;\n            }\n\n            return Securities.TryAdd(security.Symbol, new Member(utcTime, security, isInternal));\n        }\n\n        /// <summary>\n        /// Tries to remove the specified security from the universe. This\n        /// will first check to verify that we can remove the security by\n        /// calling the <see cref=\"CanRemoveMember\"/> function.\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"security\">The security to be removed</param>\n        /// <returns>True if the security was successfully removed, false if\n        /// we're not allowed to remove or if the security didn't exist</returns>\n        internal virtual bool RemoveMember(DateTime utcTime, Security security)\n        {\n            if (CanRemoveMember(utcTime, security))\n            {\n                Member member;\n                return Securities.TryRemove(security.Symbol, out member);\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Marks this universe as disposed and ready to remove all child subscriptions\n        /// </summary>\n        public virtual void Dispose()\n        {\n            DisposeRequested = true;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"SelectionChanged\"/> event\n        /// </summary>\n        /// <param name=\"selection\">The current universe selection</param>\n        protected void OnSelectionChanged(HashSet<Symbol> selection = null)\n        {\n            SelectionChanged?.Invoke(this, new SelectionEventArgs(selection ?? new HashSet<Symbol>()));\n        }\n\n        /// <summary>\n        /// Provides a value to indicate that no changes should be made to the universe.\n        /// This value is intended to be returned by reference via <see cref=\"Universe.SelectSymbols\"/>\n        /// </summary>\n        public sealed class UnchangedUniverse : IEnumerable<string>, IEnumerable<Symbol>\n        {\n            /// <summary>\n            /// Read-only instance of the <see cref=\"UnchangedUniverse\"/> value\n            /// </summary>\n            public static readonly UnchangedUniverse Instance = new UnchangedUniverse();\n            private UnchangedUniverse() { }\n            IEnumerator<Symbol> IEnumerable<Symbol>.GetEnumerator() { yield break; }\n            IEnumerator<string> IEnumerable<string>.GetEnumerator() { yield break; }\n            IEnumerator IEnumerable.GetEnumerator() { yield break; }\n        }\n\n        /// <summary>\n        /// Will adjust the <see cref=\"_minimumTimeInUniverseRoundingInterval\"/>\n        /// so rounding is performed as expected\n        /// </summary>\n        private void AdjustMinimumTimeInUniverseRoundingInterval()\n        {\n            if (_minimumTimeInUniverseRoundingInterval >= Time.OneDay)\n            {\n                _minimumTimeInUniverseRoundingInterval = Time.OneDay;\n            }\n            else if (_minimumTimeInUniverseRoundingInterval >= Time.OneHour)\n            {\n                _minimumTimeInUniverseRoundingInterval = Time.OneHour;\n            }\n            else if (_minimumTimeInUniverseRoundingInterval >= Time.OneMinute)\n            {\n                _minimumTimeInUniverseRoundingInterval = Time.OneMinute;\n            }\n            else if (_minimumTimeInUniverseRoundingInterval >= Time.OneSecond)\n            {\n                _minimumTimeInUniverseRoundingInterval = Time.OneSecond;\n            }\n        }\n\n        /// <summary>\n        /// Member of the Universe\n        /// </summary>\n        public sealed class Member\n        {\n            /// <summary>\n            /// DateTime when added\n            /// </summary>\n            public DateTime Added { get; init; }\n\n            /// <summary>\n            /// The security that was added\n            /// </summary>\n            public Security Security { get; init; }\n\n            /// <summary>\n            /// True if the security was added as internal by this universe\n            /// </summary>\n            public bool IsInternal { get; init; }\n\n            /// <summary>\n            /// Initialize a new member for the universe\n            /// </summary>\n            /// <param name=\"added\">DateTime added</param>\n            /// <param name=\"security\">Security to add</param>\n            /// <param name=\"isInternal\">True if internal member</param>\n            public Member(DateTime added, Security security, bool isInternal)\n            {\n                Added = added;\n                Security = security;\n                IsInternal = isInternal;\n            }\n        }\n\n        /// <summary>\n        /// Event fired when the universe selection changes\n        /// </summary>\n        public class SelectionEventArgs : EventArgs\n        {\n            /// <summary>\n            /// The current universe selection\n            /// </summary>\n            public HashSet<Symbol> CurrentSelection { get; }\n\n            /// <summary>\n            /// Creates a new instance\n            /// </summary>\n            public SelectionEventArgs(HashSet<Symbol> currentSelection)\n            {\n                CurrentSelection = currentSelection;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/UniverseDecorator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"UniverseSelection.Universe\"/> that redirects all calls to a\n    /// wrapped (or decorated) universe. This provides scaffolding for other decorators who\n    /// only need to override one or two methods.\n    /// </summary>\n    /// <remarks> Requires special handling due to `this != this.Universe` \n    /// <see cref=\"GetSubscriptionRequests(Security, DateTime, DateTime, ISubscriptionDataConfigService)\"/></remarks>\n    public abstract class UniverseDecorator : Universe\n    {\n        /// <summary>\n        /// The decorated universe instance\n        /// </summary>\n        protected Universe Universe { get; init; }\n\n        /// <summary>\n        /// Gets the settings used for subscriptions added for this universe\n        /// </summary>\n        public override UniverseSettings UniverseSettings\n        {\n            get\n            {\n                return Universe.UniverseSettings;\n            }\n            set\n            {\n                Universe.UniverseSettings = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the internal security collection used to define membership in this universe\n        /// </summary>\n        public override ConcurrentDictionary<Symbol, Member> Securities\n        {\n            get { return Universe.Securities; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseDecorator\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The decorated universe. All overridable methods delegate to this instance.</param>\n        protected UniverseDecorator(Universe universe)\n            : base(universe.Configuration)\n        {\n            Universe = universe;\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <returns>All subscriptions required by this security</returns>\n        [Obsolete(\"This overload is obsolete and will not be called. It was not capable of creating new SubscriptionDataConfig due to lack of information\")]\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc)\n        {\n            return Universe.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc);\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security,\n            DateTime currentTimeUtc,\n            DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            var result = Universe.GetSubscriptionRequests(\n                security,\n                currentTimeUtc,\n                maximumEndTimeUtc,\n                subscriptionService).ToList();\n\n            for (var i = 0; i < result.Count; i++)\n            {\n                // This is required because the system tracks which universe\n                // is requesting to add or remove each SubscriptionRequest.\n                // UniverseDecorator is a special case because\n                // `this != UniverseDecorator.Universe`\n                result[i] =\n                    new SubscriptionRequest(result[i], universe: this);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified security can be removed from\n        /// this universe. This is useful to prevent securities from being taken\n        /// out of a universe before the algorithm has had enough time to make\n        /// decisions on the security\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"security\">The security to check if its ok to remove</param>\n        /// <returns>True if we can remove the security, false otherwise</returns>\n        public override bool CanRemoveMember(DateTime utcTime, Security security)\n        {\n            return Universe.CanRemoveMember(utcTime, security);\n        }\n\n        /// <summary>\n        /// Creates and configures a security for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be created</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database</param>\n        /// <param name=\"symbolPropertiesDatabase\">The symbol properties database</param>\n        /// <returns>The newly initialized security object</returns>\n        [Obsolete(\"CreateSecurity is obsolete and will not be called. The system will create the required Securities based on selected symbols\")]\n        public override Security CreateSecurity(Symbol symbol, IAlgorithm algorithm, MarketHoursDatabase marketHoursDatabase, SymbolPropertiesDatabase symbolPropertiesDatabase)\n        {\n            return Universe.CreateSecurity(symbol, algorithm, marketHoursDatabase, symbolPropertiesDatabase);\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return Universe.SelectSymbols(utcTime, data);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/UniverseExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides extension methods for the <see cref=\"Universe\"/> class\n    /// </summary>\n    public static class UniverseExtensions\n    {\n        /// <summary>\n        /// Creates a new universe that logically is the result of wiring the two universes together such that\n        /// the first will produce subscriptions for the second and the second will only select on data that has\n        /// passed the first.\n        /// \n        /// NOTE: The <paramref name=\"first\"/> and <paramref name=\"second\"/> universe instances provided\n        /// to this method should not be manually added to the algorithm.\n        /// </summary>\n        /// <param name=\"first\">The first universe in this 'chain'</param>\n        /// <param name=\"second\">The second universe in this 'chain'</param>\n        /// <param name=\"configurationPerSymbol\">True if each symbol as its own configuration, false otherwise</param>\n        /// <returns>A new universe that can be added to the algorithm that represents invoking the first universe\n        /// and then the second universe using the outputs of the first. </returns>\n        public static Universe ChainedTo(this Universe first, Universe second, bool configurationPerSymbol)\n        {\n            var prefilteredSecond = second.PrefilterUsing(first);\n            return new GetSubscriptionRequestsUniverseDecorator(first, (security, currentTimeUtc, maximumEndTimeUtc) =>\n            {\n                return first.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc).Select(request => new SubscriptionRequest(\n                    template: request,\n                    isUniverseSubscription: true,\n                    universe: prefilteredSecond,\n                    security: security,\n                    configuration: configurationPerSymbol ? new SubscriptionDataConfig(prefilteredSecond.Configuration, symbol: security.Symbol) : prefilteredSecond.Configuration,\n                    startTimeUtc: currentTimeUtc - prefilteredSecond.Configuration.Resolution.ToTimeSpan(),\n                    endTimeUtc: currentTimeUtc.AddSeconds(-1)\n                    ));\n            });\n        }\n\n        /// <summary>\n        /// Creates a new universe that restricts the universe selection data to symbols that passed the\n        /// first universe's selection critera\n        /// \n        /// NOTE: The <paramref name=\"second\"/> universe instance provided to this method should not be manually\n        /// added to the algorithm. The <paramref name=\"first\"/> should still be manually (assuming no other changes).\n        /// </summary>\n        /// <param name=\"second\">The universe to be filtere</param>\n        /// <param name=\"first\">The universe providing the set of symbols used for filtered</param>\n        /// <returns>A new universe that can be added to the algorithm that represents invoking the second\n        /// using the selections from the first as a filter.</returns>\n        public static Universe PrefilterUsing(this Universe second, Universe first)\n        {\n            return new SelectSymbolsUniverseDecorator(second, (utcTime, data) =>\n            {\n                var clone = (BaseDataCollection)data.Clone();\n                clone.Data = clone.Data.Where(d => first.ContainsMember(d.Symbol)).ToList();\n                return second.SelectSymbols(utcTime, clone);\n            });\n        }\n\n        /// <summary>\n        /// Creates a universe symbol\n        /// </summary>\n        /// <param name=\"securityType\">The security</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"ticker\">The Universe ticker</param>\n        /// <returns>A symbol for user defined universe of the specified security type and market</returns>\n        public static Symbol CreateSymbol(SecurityType securityType, string market, string ticker)\n        {\n            // TODO looks like we can just replace this for Symbol.Create?\n\n            SecurityIdentifier sid;\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                    sid = SecurityIdentifier.GenerateBase(null, ticker, market);\n                    break;\n\n                case SecurityType.Equity:\n                    sid = SecurityIdentifier.GenerateEquity(SecurityIdentifier.DefaultDate, ticker, market);\n                    break;\n\n                case SecurityType.Option:\n                    var underlying = SecurityIdentifier.GenerateEquity(SecurityIdentifier.DefaultDate, ticker, market);\n                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlying, market, 0, 0, 0);\n                    break;\n\n                case SecurityType.FutureOption:\n                    var underlyingFuture = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, ticker, market);\n                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlyingFuture, market, 0, 0, 0);\n                    break;\n\n                case SecurityType.IndexOption:\n                    var underlyingIndex = SecurityIdentifier.GenerateIndex(ticker, market);\n                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlyingIndex, market, 0, 0, OptionStyle.European);\n                    break;\n\n                case SecurityType.Forex:\n                    sid = SecurityIdentifier.GenerateForex(ticker, market);\n                    break;\n\n                case SecurityType.Cfd:\n                    sid = SecurityIdentifier.GenerateCfd(ticker, market);\n                    break;\n\n                case SecurityType.Index:\n                    sid = SecurityIdentifier.GenerateIndex(ticker, market);\n                    break;\n\n                case SecurityType.Future:\n                    sid = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, ticker, market);\n                    break;\n\n                case SecurityType.Crypto:\n                    sid = SecurityIdentifier.GenerateCrypto(ticker, market);\n                    break;\n\n                case SecurityType.CryptoFuture:\n                    sid = SecurityIdentifier.GenerateCryptoFuture(SecurityIdentifier.DefaultDate, ticker, market);\n                    break;\n\n                case SecurityType.Commodity:\n                default:\n                    throw new NotImplementedException($\"The specified security type is not implemented yet: {securityType}\");\n            }\n\n            return new Symbol(sid, ticker);\n        }\n\n        /// <summary>\n        /// Processes the universe download based on parameters.\n        /// </summary>\n        /// <param name=\"dataDownloader\">The data downloader instance.</param>\n        /// <param name=\"universeDownloadParameters\">The parameters for universe downloading.</param>\n        public static void RunUniverseDownloader(IDataDownloader dataDownloader, DataUniverseDownloaderGetParameters universeDownloadParameters)\n        {\n            var universeDataBySymbol = new Dictionary<Symbol, DerivativeUniverseData>();\n            foreach (var (processingDate, universeDownloaderParameters) in universeDownloadParameters.CreateDataDownloaderGetParameters())\n            {\n                universeDataBySymbol.Clear();\n\n                foreach (var downloaderParameters in universeDownloaderParameters)\n                {\n                    Log.Debug($\"{nameof(UniverseExtensions)}.{nameof(RunUniverseDownloader)}:Generating universe for {downloaderParameters.Symbol} on {processingDate:yyyy/MM/dd}\");\n\n                    var historyData = dataDownloader.Get(downloaderParameters);\n\n                    if (historyData == null)\n                    {\n                        Log.Debug($\"{nameof(UniverseExtensions)}.{nameof(RunUniverseDownloader)}: No data available for the following parameters: {universeDownloadParameters}\");\n                        continue;\n                    }\n\n                    foreach (var baseData in historyData)\n                    {\n                        switch (baseData)\n                        {\n                            case TradeBar tradeBar:\n                                if (!universeDataBySymbol.TryAdd(tradeBar.Symbol, new(tradeBar)))\n                                {\n                                    universeDataBySymbol[tradeBar.Symbol].UpdateByTradeBar(tradeBar);\n                                }\n                                break;\n                            case OpenInterest openInterest:\n                                if (!universeDataBySymbol.TryAdd(openInterest.Symbol, new(openInterest)))\n                                {\n                                    universeDataBySymbol[openInterest.Symbol].UpdateByOpenInterest(openInterest);\n                                }\n                                break;\n                            case QuoteBar quoteBar:\n                                if (!universeDataBySymbol.TryAdd(quoteBar.Symbol, new(quoteBar)))\n                                {\n                                    universeDataBySymbol[quoteBar.Symbol].UpdateByQuoteBar(quoteBar);\n                                }\n                                break;\n                            default:\n                                throw new InvalidOperationException($\"{nameof(UniverseExtensions)}.{nameof(RunUniverseDownloader)}: Unexpected data type encountered.\");\n                        }\n                    }\n                }\n\n                if (universeDataBySymbol.Count == 0)\n                {\n                    continue;\n                }\n\n                using var writer = new StreamWriter(universeDownloadParameters.GetUniverseFileName(processingDate));\n\n                writer.WriteLine($\"#{OptionUniverse.CsvHeader}\");\n\n                // Write option data, sorted by contract type (Call/Put), strike price, expiration date, and then by full ID\n                foreach (var universeData in universeDataBySymbol\n                    .OrderBy(x => x.Key.Underlying != null)\n                    .ThenBy(d => d.Key.SecurityType.IsOption() ? d.Key.ID.OptionRight : 0)\n                    .ThenBy(d => d.Key.SecurityType.IsOption() ? d.Key.ID.StrikePrice : 0)\n                    .ThenBy(d => d.Key.ID.Date)\n                    .ThenBy(d => d.Key.ID))\n                {\n                    writer.WriteLine(universeData.Value.ToCsv());\n                }\n\n                Log.Trace($\"{nameof(UniverseExtensions)}.{nameof(RunUniverseDownloader)}:Generated for {universeDownloadParameters.Symbol} on {processingDate:yyyy/MM/dd} with {universeDataBySymbol.Count} entries\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/UniversePythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"Universe\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class UniversePythonWrapper : Universe\n    {\n        private readonly BasePythonWrapper<Universe> _model;\n\n        /// <summary>\n        /// Gets the settings used for subscriptions added for this universe\n        /// </summary>\n        public override UniverseSettings UniverseSettings\n        {\n            get\n            {\n                return _model.GetProperty<UniverseSettings>(nameof(UniverseSettings));\n            }\n            set\n            {\n                _model.SetProperty(nameof(UniverseSettings), value);\n            }\n        }\n\n        /// <summary>\n        /// Flag indicating if disposal of this universe has been requested\n        /// </summary>\n        public override bool DisposeRequested\n        {\n            get\n            {\n                return _model.GetProperty<bool>(nameof(DisposeRequested));\n            }\n            protected set\n            {\n                _model.SetProperty(nameof(DisposeRequested), value);\n            }\n        }\n\n        /// <summary>\n        /// Gets the configuration used to get universe data\n        /// </summary>\n        public override SubscriptionDataConfig Configuration\n        {\n            get\n            {\n                return _model.GetProperty<SubscriptionDataConfig>(nameof(Configuration));\n            }\n        }\n\n        /// <summary>\n        /// Gets the internal security collection used to define membership in this universe\n        /// </summary>\n        public override ConcurrentDictionary<Symbol, Member> Securities\n        {\n            get\n            {\n                return _model.GetProperty<ConcurrentDictionary<Symbol, Member>>(nameof(Securities));\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniversePythonWrapper\"/> class\n        /// </summary>\n        public UniversePythonWrapper(PyObject universe) : base(null)\n        {\n            _model = new BasePythonWrapper<Universe>(universe, false);\n        }\n\n        /// <summary>\n        /// Performs universe selection using the data specified\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _model.InvokeMethodAndEnumerate<Symbol>(nameof(SelectSymbols), utcTime, data);\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            var requests = _model.InvokeMethodAndEnumerate<SubscriptionRequest>(nameof(GetSubscriptionRequests), security, currentTimeUtc,\n                maximumEndTimeUtc, subscriptionService);\n            foreach (var subscriptionRequest in requests)\n            {\n                yield return new SubscriptionRequest(subscriptionRequest, universe: this);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/UniverseSettings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Scheduling;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Defines settings required when adding a subscription\n    /// </summary>\n    public class UniverseSettings\n    {\n        /// <summary>\n        /// The resolution to be used\n        /// </summary>\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// The leverage to be used\n        /// </summary>\n        public decimal Leverage { get; set; }\n\n        /// <summary>\n        /// True to fill data forward, false otherwise\n        /// </summary>\n        public bool FillForward { get; set; }\n\n        /// <summary>\n        /// If configured, will be used to determine universe selection schedule and filter or skip selection data\n        /// that does not fit the schedule\n        /// </summary>\n        public Schedule Schedule { get; set; }\n\n        /// <summary>\n        /// True to allow extended market hours data, false otherwise\n        /// </summary>\n        public bool ExtendedMarketHours { get; set; }\n\n        /// <summary>\n        /// Defines the minimum amount of time a security must be in\n        /// the universe before being removed.\n        /// </summary>\n        /// <remarks>When selection takes place, the actual members time in the universe\n        /// will be rounded based on this TimeSpan, so that relative small differences do not\n        /// cause an unexpected behavior <see cref=\"Universe.CanRemoveMember\"/></remarks>\n        public TimeSpan MinimumTimeInUniverse {  get; set; }\n\n        /// <summary>\n        /// Defines how universe data is normalized before being send into the algorithm\n        /// </summary>\n        public DataNormalizationMode DataNormalizationMode { get; set; }\n\n        /// <summary>\n        /// Defines how universe data is mapped together\n        /// </summary>\n        /// <remarks>This is particular useful when generating continuous futures</remarks>\n        public DataMappingMode DataMappingMode { get; set; }\n\n        /// <summary>\n        /// The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contra\n        /// </summary>\n        public int ContractDepthOffset { get; set; }\n\n        /// <summary>\n        /// Allows a universe to specify which data types to add for a selected symbol\n        /// </summary>\n        public List<Tuple<Type, TickType>> SubscriptionDataTypes { get; set; }\n\n        /// <summary>\n        /// True if universe selection can run asynchronous\n        /// </summary>\n        public bool? Asynchronous { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseSettings\"/> class\n        /// </summary>\n        /// <param name=\"resolution\">The resolution</param>\n        /// <param name=\"leverage\">The leverage to be used</param>\n        /// <param name=\"fillForward\">True to fill data forward, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to allow extended market hours data, false otherwise</param>\n        /// <param name=\"minimumTimeInUniverse\">Defines the minimum amount of time a security must remain in the universe before being removed</param>\n        /// <param name=\"dataNormalizationMode\">Defines how universe data is normalized before being send into the algorithm</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <param name=\"asynchronous\">True if universe selection can run asynchronous</param>\n        /// <param name=\"selectionDateRule\">If provided, will be used to determine universe selection schedule</param>\n        public UniverseSettings(Resolution resolution, decimal leverage, bool fillForward, bool extendedMarketHours, TimeSpan minimumTimeInUniverse, DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest, int contractDepthOffset = 0, bool? asynchronous = null, IDateRule selectionDateRule = null)\n        {\n            Resolution = resolution;\n            Leverage = leverage;\n            FillForward = fillForward;\n            DataMappingMode = dataMappingMode;\n            ContractDepthOffset = contractDepthOffset;\n            ExtendedMarketHours = extendedMarketHours;\n            MinimumTimeInUniverse = minimumTimeInUniverse;\n            DataNormalizationMode = dataNormalizationMode;\n            Asynchronous = asynchronous;\n            Schedule = new Schedule();\n            if (selectionDateRule != null)\n            {\n                Schedule.On(selectionDateRule);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseSettings\"/> class\n        /// </summary>\n        public UniverseSettings(UniverseSettings universeSettings)\n        {\n            Resolution = universeSettings.Resolution;\n            Leverage = universeSettings.Leverage;\n            FillForward = universeSettings.FillForward;\n            DataMappingMode = universeSettings.DataMappingMode;\n            ContractDepthOffset = universeSettings.ContractDepthOffset;\n            ExtendedMarketHours = universeSettings.ExtendedMarketHours;\n            MinimumTimeInUniverse = universeSettings.MinimumTimeInUniverse;\n            DataNormalizationMode = universeSettings.DataNormalizationMode;\n            SubscriptionDataTypes = universeSettings.SubscriptionDataTypes;\n            Asynchronous = universeSettings.Asynchronous;\n            Schedule = universeSettings.Schedule.Clone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Data/UniverseSelection/UserDefinedUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace QuantConnect.Data.UniverseSelection\n{\n    /// <summary>\n    /// Represents the universe defined by the user's algorithm. This is\n    /// the default universe where manually added securities live by\n    /// market/security type. They can also be manually generated and\n    /// can be configured to fire on certain interval and will always\n    /// return the internal list of symbols.\n    /// </summary>\n    public class UserDefinedUniverse : Universe, INotifyCollectionChanged, ITimeTriggeredUniverse\n    {\n        private readonly TimeSpan _interval;\n        private readonly HashSet<SubscriptionDataConfig> _subscriptionDataConfigs = new HashSet<SubscriptionDataConfig>();\n        private readonly HashSet<Symbol> _symbols = new HashSet<Symbol>();\n        // `UniverseSelection.RemoveSecurityFromUniverse()` will query us at `GetSubscriptionRequests()` to get the `SubscriptionDataConfig` and remove it from the DF\n        // and we need to return the config even after the call to `Remove()`\n        private readonly HashSet<SubscriptionDataConfig> _pendingRemovedConfigs = new HashSet<SubscriptionDataConfig>();\n        private readonly Func<DateTime, IEnumerable<Symbol>> _selector;\n        private readonly object _lock = new ();\n\n        /// <summary>\n        /// Event fired when a symbol is added or removed from this universe\n        /// </summary>\n        public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n        /// <summary>\n        /// Gets the interval of this user defined universe\n        /// </summary>\n        public TimeSpan Interval\n        {\n            get { return _interval; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UserDefinedUniverse\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"interval\">The interval at which selection should be performed</param>\n        /// <param name=\"symbols\">The initial set of symbols in this universe</param>\n        public UserDefinedUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, TimeSpan interval, IEnumerable<Symbol> symbols)\n            : base(configuration)\n        {\n            _interval = interval;\n            _symbols = symbols.ToHashSet();\n            UniverseSettings = universeSettings;\n            // the selector Func will be the union of the provided symbols and the added symbols or subscriptions data configurations\n            _selector = time => {\n                lock(_lock)\n                {\n                    return _subscriptionDataConfigs.Select(x => x.Symbol).Union(_symbols).ToHashSet();\n                }\n            };\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UserDefinedUniverse\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The configuration used to resolve the data for universe selection</param>\n        /// <param name=\"universeSettings\">The settings used for new subscriptions generated by this universe</param>\n        /// <param name=\"interval\">The interval at which selection should be performed</param>\n        /// <param name=\"selector\">Universe selection function invoked for each time returned via GetTriggerTimes.\n        /// The function parameter is a DateTime in the time zone of configuration.ExchangeTimeZone</param>\n        public UserDefinedUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, TimeSpan interval, Func<DateTime, IEnumerable<string>> selector)\n            : base(configuration)\n        {\n            _interval = interval;\n            UniverseSettings = universeSettings;\n            _selector = time =>\n            {\n                var selectSymbolsResult = selector(time.ConvertFromUtc(Configuration.ExchangeTimeZone));\n                // if we received an unchaged then short circuit the symbol creation and return it directly\n                if (ReferenceEquals(selectSymbolsResult, Unchanged)) return Unchanged;\n                return selectSymbolsResult.Select(sym => Symbol.Create(sym, Configuration.SecurityType, Configuration.Market));\n            };\n        }\n\n        /// <summary>\n        /// Creates a user defined universe symbol\n        /// </summary>\n        /// <param name=\"securityType\">The security</param>\n        /// <param name=\"market\">The market</param>\n        /// <returns>A symbol for user defined universe of the specified security type and market</returns>\n        public static Symbol CreateSymbol(SecurityType securityType, string market)\n        {\n            var ticker = $\"qc-universe-userdefined-{market.ToLowerInvariant()}-{securityType}\";\n            return UniverseExtensions.CreateSymbol(securityType, market, ticker);\n        }\n\n        /// <summary>\n        /// Adds the specified <see cref=\"Symbol\"/> to this universe\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be added to this universe</param>\n        /// <returns>True if the symbol was added, false if it was already present</returns>\n        public bool Add(Symbol symbol)\n        {\n            var added = false;\n            lock (_lock)\n            {\n                // let's not call the event having the lock if we don't need too\n                added = _symbols.Add(symbol);\n            }\n\n            if (added)\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, symbol));\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Adds the specified <see cref=\"SubscriptionDataConfig\"/> to this universe\n        /// </summary>\n        /// <param name=\"subscriptionDataConfig\">The subscription data configuration to be added to this universe</param>\n        /// <returns>True if the subscriptionDataConfig was added, false if it was already present</returns>\n        public bool Add(SubscriptionDataConfig subscriptionDataConfig)\n        {\n            var added = false;\n            lock (_lock)\n            {\n                // let's not call the event having the lock if we don't need too\n                added = _subscriptionDataConfigs.Add(subscriptionDataConfig);\n            }\n\n            if (added)\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, subscriptionDataConfig.Symbol));\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Removes the specified <see cref=\"Symbol\"/> from this universe\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to be removed</param>\n        /// <returns>True if the symbol was removed, false if the symbol was not present</returns>\n        public bool Remove(Symbol symbol)\n        {\n            if (RemoveAndKeepTrack(symbol))\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, symbol));\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Returns the symbols defined by the user for this universe\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"data\">The symbols to remain in the universe</param>\n        /// <returns>The data that passes the filter</returns>\n        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n        {\n            return _selector(utcTime);\n        }\n\n        /// <summary>\n        /// Returns an enumerator that defines when this user defined universe will be invoked\n        /// </summary>\n        /// <returns>An enumerator of DateTime that defines when this universe will be invoked</returns>\n        public virtual IEnumerable<DateTime> GetTriggerTimes(DateTime startTimeUtc, DateTime endTimeUtc, MarketHoursDatabase marketHoursDatabase)\n        {\n            var exchangeHours = marketHoursDatabase.GetExchangeHours(Configuration);\n            var localStartTime = startTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);\n            var localEndTime = endTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);\n\n            var first = true;\n            foreach (var dateTime in LinqExtensions.Range(localStartTime, localEndTime, dt => dt + Interval))\n            {\n                if (first)\n                {\n                    yield return dateTime;\n                    first = false;\n                }\n                else if (exchangeHours.IsOpen(dateTime, dateTime + Interval, Configuration.ExtendedMarketHours))\n                {\n                    yield return dateTime;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"CollectionChanged\"/> event\n        /// </summary>\n        /// <param name=\"e\">The notify collection changed event arguments</param>\n        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n        {\n            CollectionChanged?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Gets the subscription requests to be added for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to get subscriptions for</param>\n        /// <param name=\"currentTimeUtc\">The current time in utc. This is the frontier time of the algorithm</param>\n        /// <param name=\"maximumEndTimeUtc\">The max end time</param>\n        /// <param name=\"subscriptionService\">Instance which implements <see cref=\"ISubscriptionDataConfigService\"/> interface</param>\n        /// <returns>All subscriptions required by this security</returns>\n        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security,\n            DateTime currentTimeUtc,\n            DateTime maximumEndTimeUtc,\n            ISubscriptionDataConfigService subscriptionService)\n        {\n            List<SubscriptionDataConfig> result;\n            lock (_lock)\n            {\n                result = _subscriptionDataConfigs.Where(x => x.Symbol == security.Symbol).ToList();\n                if (!result.Any())\n                {\n                    result = _pendingRemovedConfigs.Where(x => x.Symbol == security.Symbol).ToList();\n                    if (result.Any())\n                    {\n                        _pendingRemovedConfigs.RemoveWhere(x => x.Symbol == security.Symbol);\n                    }\n                    else\n                    {\n                        result = base.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc, subscriptionService).Select(x => x.Configuration).ToList();\n                        // we create subscription data configs ourselves, add the configs\n                        _subscriptionDataConfigs.UnionWith(result);\n                    }\n                }\n            }\n            return result.Select(config => new SubscriptionRequest(isUniverseSubscription: false,\n                                                                   universe: this,\n                                                                   security: security,\n                                                                   configuration: config,\n                                                                   startTimeUtc: currentTimeUtc,\n                                                                   endTimeUtc: maximumEndTimeUtc));\n        }\n\n        /// <summary>\n        /// Tries to remove the specified security from the universe.\n        /// </summary>\n        /// <param name=\"utcTime\">The current utc time</param>\n        /// <param name=\"security\">The security to be removed</param>\n        /// <returns>True if the security was successfully removed, false if\n        /// we're not allowed to remove or if the security didn't exist</returns>\n        internal override bool RemoveMember(DateTime utcTime, Security security)\n        {\n            if (base.RemoveMember(utcTime, security))\n            {\n                RemoveAndKeepTrack(security.Symbol);\n                return true;\n            }\n            return false;\n        }\n\n        private bool RemoveAndKeepTrack(Symbol symbol)\n        {\n            lock (_lock)\n            {\n                var toBeRemoved = _subscriptionDataConfigs.Where(x => x.Symbol == symbol).ToList();\n                var removedSymbol = _symbols.Remove(symbol);\n\n                if (removedSymbol || toBeRemoved.Any())\n                {\n                    _subscriptionDataConfigs.RemoveWhere(x => x.Symbol == symbol);\n                    _pendingRemovedConfigs.UnionWith(toBeRemoved);\n                    return true;\n                }\n\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/DataDownloaderGetParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Model class for passing in parameters for historical data\n    /// </summary>\n    public class DataDownloaderGetParameters\n    {\n        /// <summary>\n        /// Symbol for the data we're looking for.\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// Resolution of the data request\n        /// </summary>\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// Start time of the data in UTC\n        /// </summary>\n        public DateTime StartUtc { get; set; }\n\n        /// <summary>\n        /// End time of the data in UTC\n        /// </summary>\n        public DateTime EndUtc { get; set; }\n\n        /// <summary>\n        /// The type of tick to get\n        /// </summary>\n        public TickType TickType { get; set; }\n\n        /// <summary>\n        /// Initialize model class for passing in parameters for historical data\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for the data we're looking for.</param>\n        /// <param name=\"resolution\">Resolution of the data request</param>\n        /// <param name=\"startUtc\">Start time of the data in UTC</param>\n        /// <param name=\"endUtc\">End time of the data in UTC</param>\n        /// <param name=\"tickType\">[Optional] The type of tick to get. Defaults to <see cref=\"QuantConnect.TickType.Trade\"/></param>\n        public DataDownloaderGetParameters(Symbol symbol, Resolution resolution, DateTime startUtc, DateTime endUtc, TickType? tickType = null)\n        {\n            Symbol = symbol;\n            Resolution = resolution;\n            StartUtc = startUtc;\n            EndUtc = endUtc;\n            TickType = tickType ?? TickType.Trade;\n        }\n\n        /// <summary>\n        /// Returns a string representation of the <see cref=\"DataDownloaderGetParameters\"/> object.\n        /// </summary>\n        /// <returns>A string representing the object's properties.</returns>\n        public override string ToString() => $\"Symbol: {Symbol}, Resolution: {Resolution}, StartUtc: {StartUtc}, EndUtc: {EndUtc}, TickType: {TickType}\";\n    }\n}\n"
  },
  {
    "path": "Common/DataMonitorReport.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Report generated by the <see cref=\"IDataMonitor\"/> class that contains information about data requests\n    /// </summary>\n    public class DataMonitorReport\n    {\n        /// <summary>\n        /// Gets the number of data files that were requested and successfully fetched\n        /// </summary>\n        [JsonProperty(PropertyName = \"succeeded-data-requests-count\")]\n        public long SucceededDataRequestsCount { get; set; }\n\n        /// <summary>\n        /// Gets the number of data files that were requested but could not be fetched\n        /// </summary>\n        [JsonProperty(PropertyName = \"failed-data-requests-count\")]\n        public long FailedDataRequestsCount { get; set; }\n\n        /// <summary>\n        /// Gets the number of universe data files that were requested and successfully fetched\n        /// </summary>\n        [JsonProperty(PropertyName = \"succeeded-universe-data-requests-count\")]\n        public long SucceededUniverseDataRequestsCount { get; set; }\n\n        /// <summary>\n        /// Gets the number of universe data files that were requested but could not be fetched\n        /// </summary>\n        [JsonProperty(PropertyName = \"failed-universe-data-requests-count\")]\n        public long FailedUniverseDataRequestsCount { get; set; }\n\n        /// <summary>\n        /// Gets the number of data files that were requested\n        /// </summary>\n        [JsonProperty(PropertyName = \"total-data-requests-count\")]\n        public long TotalRequestsCount\n        {\n            get { return SucceededDataRequestsCount + FailedDataRequestsCount; }\n        }\n\n        /// <summary>\n        /// Fets the percentage of data requests that could not be satisfied\n        /// </summary>\n        [JsonProperty(PropertyName = \"failed-data-requests-percentage\")]\n        public double FailedDataRequestsPercentage\n        {\n            get { return GetPercentage(TotalRequestsCount, FailedDataRequestsCount); }\n        }\n\n        /// <summary>\n        /// Gets the number of universe data files that were requested\n        /// </summary>\n        [JsonProperty(PropertyName = \"total-universe-data-requests-count\")]\n        public long TotalUniverseDataRequestsCount\n        {\n            get { return SucceededUniverseDataRequestsCount + FailedUniverseDataRequestsCount; }\n        }\n\n        /// <summary>\n        /// Fets the percentage of universe data requests that could not be satisfied\n        /// </summary>\n        [JsonProperty(PropertyName = \"failed-universe-data-requests-percentage\")]\n        public double FailedUniverseDataRequestsPercentage\n        {\n            get { return GetPercentage(TotalUniverseDataRequestsCount, FailedUniverseDataRequestsCount); }\n        }\n\n        /// <summary>\n        /// Rates at which data requests were made per second\n        /// </summary>\n        [JsonProperty(PropertyName = \"data-request-rates\")]\n        public IReadOnlyList<double> DataRequestRates { get; set; }\n\n        /// <summary>\n        /// Initializes an empty instance of the <see cref=\"DataMonitorReport\"/> class\n        /// </summary>\n        public DataMonitorReport()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataMonitorReport\"/> class\n        /// </summary>\n        /// <param name=\"succeededDataRequestsCount\">Number of data paths that were requested and successfuly served</param>\n        /// <param name=\"failedDataRequestsCount\">Number of data paths that were requested but could not be served</param>\n        /// <param name=\"succeededUniverseDataRequestsCount\">Number of universe data paths that were requested and successfuly served</param>\n        /// <param name=\"failedUniverseDataRequestsCount\">Number of universe data paths that were requested but could not be served</param>\n        /// <param name=\"dataRequestRates\">Rates at which data requests were made per second</param>\n        public DataMonitorReport(long succeededDataRequestsCount, \n            long failedDataRequestsCount, \n            long succeededUniverseDataRequestsCount, \n            long failedUniverseDataRequestsCount, \n            IReadOnlyList<double> dataRequestRates)\n        {\n            SucceededDataRequestsCount = succeededDataRequestsCount;\n            FailedDataRequestsCount = failedDataRequestsCount;\n            SucceededUniverseDataRequestsCount = succeededUniverseDataRequestsCount;\n            FailedUniverseDataRequestsCount = failedUniverseDataRequestsCount;\n            DataRequestRates = dataRequestRates;\n        }\n        \n        private static double GetPercentage(long total, long value)\n        {\n            if (total == 0)\n            {\n                return 0;\n            }\n\n            return Math.Round(value / (double)total * 100);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/DataProviderEvents.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Defines a base class for <see cref=\"IDataProviderEvents\"/>\n    /// </summary>\n    public abstract class DataProviderEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the symbol being processed that generated the event\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataProviderEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        protected DataProviderEventArgs(Symbol symbol)\n        {\n            Symbol = symbol;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProviderEvents.InvalidConfigurationDetected\"/> event\n    /// </summary>\n    public sealed class InvalidConfigurationDetectedEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// Gets the error message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InvalidConfigurationDetectedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        /// <param name=\"message\">The error message</param>\n        public InvalidConfigurationDetectedEventArgs(Symbol symbol, string message)\n            : base(symbol)\n        {\n            Message = message;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProviderEvents.NumericalPrecisionLimited\"/> event\n    /// </summary>\n    public sealed class NumericalPrecisionLimitedEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// Gets the error message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NumericalPrecisionLimitedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        /// <param name=\"message\">The error message</param>\n        public NumericalPrecisionLimitedEventArgs(Symbol symbol, string message)\n            : base(symbol)\n        {\n            Message = message;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProviderEvents.DownloadFailed\"/> event\n    /// </summary>\n    public sealed class DownloadFailedEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// Gets the error message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Gets the error stack trace\n        /// </summary>\n        public string StackTrace { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DownloadFailedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        /// <param name=\"message\">The error message</param>\n        /// <param name=\"stackTrace\">The error stack trace</param>\n        public DownloadFailedEventArgs(Symbol symbol, string message, string stackTrace = \"\")\n            : base(symbol)\n        {\n            Message = message;\n            StackTrace = stackTrace;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProviderEvents.ReaderErrorDetected\"/> event\n    /// </summary>\n    public sealed class ReaderErrorDetectedEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// Gets the error message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Gets the error stack trace\n        /// </summary>\n        public string StackTrace { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReaderErrorDetectedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        /// <param name=\"message\">The error message</param>\n        /// <param name=\"stackTrace\">The error stack trace</param>\n        public ReaderErrorDetectedEventArgs(Symbol symbol, string message, string stackTrace = \"\")\n            : base(symbol)\n        {\n            Message = message;\n            StackTrace = stackTrace;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProviderEvents.StartDateLimited\"/> event\n    /// </summary>\n    public sealed class StartDateLimitedEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// Gets the error message\n        /// </summary>\n        public string Message { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StartDateLimitedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">Symbol being processed that generated the event</param>\n        /// <param name=\"message\">The error message</param>\n        public StartDateLimitedEventArgs(Symbol symbol, string message)\n            : base(symbol)\n        {\n            Message = message;\n        }\n    }\n\n    /// <summary>\n    /// Event arguments for the NewTradableDate event\n    /// </summary>\n    public sealed class NewTradableDateEventArgs : DataProviderEventArgs\n    {\n        /// <summary>\n        /// The new tradable date\n        /// </summary>\n        public DateTime Date { get; }\n\n        /// <summary>\n        /// The last <see cref=\"BaseData\"/> of the <see cref=\"Security\"/>\n        /// for which we are enumerating\n        /// </summary>\n        public BaseData LastBaseData { get; }\n\n        /// <summary>\n        /// The last raw security price we have\n        /// </summary>\n        public decimal? LastRawPrice { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NewTradableDateEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"date\">The new tradable date</param>\n        /// <param name=\"lastBaseData\">The last <see cref=\"BaseData\"/> of the\n        /// <see cref=\"Security\"/> for which we are enumerating</param>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/> of the new tradable date</param>\n        /// <param name=\"lastRawPrice\">The last raw security price we have</param>\n        public NewTradableDateEventArgs(DateTime date, BaseData lastBaseData, Symbol symbol, decimal? lastRawPrice)\n            : base(symbol)\n        {\n            Date = date;\n            LastBaseData = lastBaseData;\n            LastRawPrice = lastRawPrice;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/DataUniverseDownloaderGetParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect;\n\n/// <summary>\n/// Represents the parameters required for downloading universe data.\n/// </summary>\npublic sealed class DataUniverseDownloaderGetParameters : DataDownloaderGetParameters\n{\n    /// <summary>\n    /// The initialized instance of the security exchange hours.\n    /// </summary>\n    private readonly SecurityExchangeHours _securityExchangeHours;\n\n    /// <summary>\n    /// The tick types supported for universe data.\n    /// </summary>\n    private readonly TickType[] UniverseTickTypes = { TickType.Quote, TickType.Trade, TickType.OpenInterest };\n\n    /// <summary>\n    /// Gets the underlying symbol associated with the universe.\n    /// </summary>\n    public Symbol UnderlyingSymbol { get => Symbol.HasUnderlying ? Symbol.Underlying : Symbol.Empty; }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DataUniverseDownloaderGetParameters\"/> class.\n    /// </summary>\n    /// <param name=\"canonicalSymbol\">The canonical symbol for the data request.</param>\n    /// <param name=\"startDate\">The start date for the data request.</param>\n    /// <param name=\"endDate\">The end date for the data request.</param>\n    /// <param name=\"securityExchangeHours\">The security exchange hours for this symbol</param>\n    /// <exception cref=\"ArgumentException\">Thrown when the provided symbol is not canonical.</exception>\n    public DataUniverseDownloaderGetParameters(Symbol canonicalSymbol, DateTime startDate, DateTime endDate, SecurityExchangeHours securityExchangeHours = default)\n        : base(\n            canonicalSymbol.IsCanonical() ? canonicalSymbol : throw new ArgumentException(\"DataUniverseDownloaderGetParameters: Symbol must be canonical.\", nameof(canonicalSymbol)),\n            Resolution.Daily,\n            startDate,\n            endDate)\n    {\n        _securityExchangeHours = securityExchangeHours ?? MarketHoursDatabase.FromDataFolder().GetExchangeHours(canonicalSymbol.ID.Market, canonicalSymbol, canonicalSymbol.SecurityType);\n\n        EndUtc = EndUtc.ConvertToUtc(_securityExchangeHours.TimeZone);\n        StartUtc = StartUtc.ConvertToUtc(_securityExchangeHours.TimeZone);\n    }\n\n    /// <summary>\n    /// Gets the file name where the universe data will be saved.\n    /// </summary>\n    /// <param name=\"processingDate\">The date for which the file name is generated.</param>\n    /// <returns>The universe file name.</returns>\n    public string GetUniverseFileName(DateTime processingDate)\n    {\n        return BaseChainUniverseData.GetUniverseFullFilePath(Symbol, processingDate);\n    }\n\n    /// <summary>\n    /// Creates data download parameters for each day in the range.\n    /// </summary>\n    public IEnumerable<(DateTime, IEnumerable<DataDownloaderGetParameters>)> CreateDataDownloaderGetParameters()\n    {\n        foreach (var processingDate in Time.EachTradeableDay(_securityExchangeHours, StartUtc, EndUtc))\n        {\n            var processingDateUtc = processingDate.ConvertToUtc(_securityExchangeHours.TimeZone);\n\n            var requests = new List<DataDownloaderGetParameters>(3);\n\n            if (UnderlyingSymbol != Symbol.Empty)\n            {\n                requests.Add(new(UnderlyingSymbol, Resolution, processingDateUtc, processingDateUtc.AddDays(1), TickType.Trade));\n            }\n\n            requests.AddRange(UniverseTickTypes.Select(tickType => new DataDownloaderGetParameters(Symbol, Resolution, processingDateUtc, processingDateUtc.AddDays(1), tickType)));\n\n            yield return (processingDate, requests);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/DefaultConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Helper json converter to use the default json converter, breaking inheritance json converter\n    /// </summary>\n    public class DefaultConverter : JsonConverter\n    {\n        /// <summary>\n        /// Indicates if this object can be read\n        /// </summary>\n        public override bool CanRead => false;\n\n        /// <summary>\n        /// Indicates if this object can be written\n        /// </summary>\n        public override bool CanWrite => false;\n\n        /// <summary>\n        /// Writes a JSON file from the given object and the other arguments\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Creates an object from a given JSON reader and other arguments\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Indicates if the given type can be assigned to this object\n        /// </summary>\n        public override bool CanConvert(Type objectType)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/DocumentationAttribute.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Reflection;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Custom attribute used for documentation\n    /// </summary>\n    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]\n    [DocumentationAttribute(\"Reference\")]\n    public sealed class DocumentationAttribute : Attribute\n    {\n        private static readonly DocumentationAttribute Attribute =\n            typeof(DocumentationAttribute).GetCustomAttributes<DocumentationAttribute>().Single();\n        private static readonly string BasePath =\n            Attribute.FileName.Substring(0, Attribute.FileName.LastIndexOf(\"Common\", StringComparison.Ordinal));\n\n        /// <summary>\n        /// The documentation tag\n        /// </summary>\n        [JsonProperty(PropertyName = \"tag\")]\n        public string Tag { get; }\n\n        /// <summary>\n        ///  The associated weight of this attribute and tag\n        /// </summary>\n        [JsonProperty(PropertyName = \"weight\")]\n        public int Weight { get; }\n\n        /// <summary>\n        ///  The associated line of this attribute\n        /// </summary>\n        [JsonProperty(PropertyName = \"line\")]\n        public int Line { get; }\n\n        /// <summary>\n        ///  The associated file name of this attribute\n        /// </summary>\n        [JsonProperty(PropertyName = \"fileName\")]\n        public string FileName { get; }\n\n        /// <summary>\n        /// The attributes type id, we override it to ignore it when serializing\n        /// </summary>\n        [JsonIgnore]\n        public override object TypeId => base.TypeId;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public DocumentationAttribute(string tag, int weight = 0,\n            [System.Runtime.CompilerServices.CallerLineNumber] int line = 0,\n            [System.Runtime.CompilerServices.CallerFilePath] string fileName = \"\")\n        {\n            Tag = tag;\n            Line = line;\n            Weight = weight;\n            // will be null for the attribute of DocumentationAttribute itself\n            if (BasePath != null)\n            {\n                FileName = fileName.Replace(BasePath, string.Empty, StringComparison.InvariantCultureIgnoreCase);\n            }\n            else\n            {\n                FileName = fileName;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/ClrBubbledExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"ClrBubbledException\"/> instances\n    /// </summary>\n    public class ClrBubbledExceptionInterpreter : SystemExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public override int Order => int.MaxValue - 1;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception. f\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public override bool CanInterpret(Exception exception) => exception?.GetType() == typeof(ClrBubbledException);\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public override Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (ClrBubbledException)exception;\n            var sanitized = base.Interpret(exception, innerInterpreter);\n            var inner = sanitized.InnerException ?? sanitized;\n\n            return new Exception(pe.Message + PythonUtil.PythonExceptionStackParser(pe.PythonTraceback), inner);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/DllNotFoundPythonExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"DllNotFoundPythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class DllNotFoundPythonExceptionInterpreter : IExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public bool CanInterpret(Exception exception)\n        {\n            return\n                exception?.GetType() == typeof(DllNotFoundException) &&\n                exception.Message.Contains(\"python\");\n        }\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var dnfe = (DllNotFoundException)exception;\n\n            var startIndex = dnfe.Message.IndexOfInvariant(\"python\");\n            var length = Math.Min(dnfe.Message.Length - startIndex, 10);\n            var dllName = dnfe.Message.Substring(startIndex, length);\n\n            length = dllName.IndexOfInvariant('\\'');\n            if (length > 0)\n            {\n                dllName = dllName.Substring(0, length);\n            }\n\n            var platform = Environment.OSVersion.Platform.ToString();\n            var message = Messages.DllNotFoundPythonExceptionInterpreter.DynamicLinkLibraryNotFound(dllName, platform);\n            return new DllNotFoundException(message, dnfe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/IExceptionInterpreter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Defines an exception interpreter. Interpretations are invoked on <see cref=\"IAlgorithm.RunTimeError\"/>\n    /// </summary>\n    public interface IExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that a class that implements this interface should be called\n        /// </summary>\n        int Order { get; }\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        bool CanInterpret(Exception exception);\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.\n        /// This provides a link back allowing the inner exceptions to be interpreted using the interpreters\n        /// configured in the <see cref=\"IExceptionInterpreter\"/>. Individual implementations *may* ignore\n        /// this value if required.</param>\n        /// <returns>The interpreted exception</returns>\n        Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter);\n    }\n}"
  },
  {
    "path": "Common/Exceptions/InvalidTokenPythonExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"InvalidTokenPythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class InvalidTokenPythonExceptionInterpreter : PythonExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public override int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public override bool CanInterpret(Exception exception)\n        {\n            return base.CanInterpret(exception) &&\n                (exception.Message.Contains(Messages.InvalidTokenPythonExceptionInterpreter.InvalidTokenExpectedSubstring, StringComparison.InvariantCultureIgnoreCase)\n                || exception.Message.Contains(Messages.InvalidTokenPythonExceptionInterpreter.NotPermittedExpectedSubstring, StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public override Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (PythonException)exception;\n            return new Exception(Messages.InvalidTokenPythonExceptionInterpreter.InterpretException(pe), pe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/KeyErrorPythonExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"KeyErrorPythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class KeyErrorPythonExceptionInterpreter : PythonExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public override int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public override bool CanInterpret(Exception exception)\n        {\n            var pythonException = exception as PythonException;\n            if (pythonException == null)\n            {\n                return false;\n            }\n\n            using (Py.GIL())\n            {\n                return base.CanInterpret(exception) &&\n                    pythonException.Type.Name.Contains(\"KeyError\", StringComparison.InvariantCultureIgnoreCase);\n            }\n        }\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public override Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (PythonException)exception;\n\n            var key = string.Empty;\n            if (pe.Message.Contains('[', StringComparison.InvariantCulture))\n            {\n                key = pe.Message.GetStringBetweenChars('[', ']');\n            }\n            else if (pe.Message.Contains('\\'', StringComparison.InvariantCulture))\n            {\n                key = pe.Message.GetStringBetweenChars('\\'', '\\'');\n            }\n            var message = Messages.KeyErrorPythonExceptionInterpreter.KeyNotFoundInCollection(key);\n\n            message += PythonUtil.PythonExceptionStackParser(pe.StackTrace);\n\n            return new KeyNotFoundException(message, pe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/NoMethodMatchPythonExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"NoMethodMatchPythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class NoMethodMatchPythonExceptionInterpreter : PythonExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public override int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public override bool CanInterpret(Exception exception)\n        {\n            return base.CanInterpret(exception) &&\n                exception.Message.Contains(Messages.NoMethodMatchPythonExceptionInterpreter.NoMethodMatchExpectedSubstring);\n        }\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public override Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (PythonException)exception;\n\n            var startIndex = pe.Message.LastIndexOfInvariant(\" \");\n            var methodName = pe.Message.Substring(startIndex).Trim();\n            var message = Messages.NoMethodMatchPythonExceptionInterpreter.AttemptedToAccessMethodThatDoesNotExist(methodName);\n\n            message += PythonUtil.PythonExceptionStackParser(pe.StackTrace);\n\n            return new MissingMethodException(message, pe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/PythonExceptionInterpreter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"PythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class PythonExceptionInterpreter : IExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public virtual int Order => int.MaxValue - 1;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception. f\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public virtual bool CanInterpret(Exception exception) => exception?.GetType() == typeof(PythonException);\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public virtual Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (PythonException)exception;\n\n            return new Exception(PythonUtil.PythonExceptionParser(pe), pe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/ScheduledEventExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"ScheduledEventException\"/> instances\n    /// </summary>\n    public class ScheduledEventExceptionInterpreter : IExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public bool CanInterpret(Exception exception) => exception?.GetType() == typeof(ScheduledEventException);\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.\n        /// This provides a link back allowing the inner exceptions to be interpreted using the interpreters\n        /// configured in the <see cref=\"IExceptionInterpreter\"/>. Individual implementations *may* ignore\n        /// this value if required.</param>\n        /// <returns>The interpreted exception</returns>\n        public Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var see = (ScheduledEventException) exception;\n\n            var inner = innerInterpreter.Interpret(see.InnerException, innerInterpreter);\n\n            // prepend the scheduled event name\n            var message = exception.Message;\n            if (!message.Contains(see.ScheduledEventName))\n            {\n                message = Messages.ScheduledEventExceptionInterpreter.ScheduledEventName(see.ScheduledEventName);\n            }\n\n            return new ScheduledEventException(see.ScheduledEventName, message, inner);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/StackExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Reflection;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets exceptions using the configured interpretations\n    /// </summary>\n    public class StackExceptionInterpreter : IExceptionInterpreter\n    {\n        private readonly List<IExceptionInterpreter> _interpreters;\n\n        /// <summary>\n        /// Stack interpreter instance\n        /// </summary>\n        public static readonly Lazy<StackExceptionInterpreter> Instance = new Lazy<StackExceptionInterpreter>(\n            () => StackExceptionInterpreter.CreateFromAssemblies());\n\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public int Order => 0;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StackExceptionInterpreter\"/> class\n        /// </summary>\n        /// <param name=\"interpreters\">The interpreters to use</param>\n        public StackExceptionInterpreter(IEnumerable<IExceptionInterpreter> interpreters)\n        {\n            _interpreters = interpreters.OrderBy(x => x.Order).ToList();\n        }\n\n        /// <summary>\n        /// Gets the interpreters loaded into this instance\n        /// </summary>\n        public IEnumerable<IExceptionInterpreter> Interpreters => _interpreters;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public bool CanInterpret(Exception exception)\n        {\n            return _interpreters.Any(interpreter => interpreter.CanInterpret(exception));\n        }\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.\n        /// This provides a link back allowing the inner exceptions to be interpreted using the intepretators\n        /// configured in the <see cref=\"StackExceptionInterpreter\"/>. Individual implementations *may* ignore\n        /// this value if required.</param>\n        /// <returns>The interpreted exception</returns>\n        public Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter = null)\n        {\n            if (exception == null)\n            {\n                return null;\n            }\n\n            foreach (var interpreter in _interpreters)\n            {\n                try\n                {\n                    if (interpreter.CanInterpret(exception))\n                    {\n                        // use this instance to interpret inner exceptions as well, unless one was specified\n                        return interpreter.Interpret(exception, innerInterpreter ?? this);\n                    }\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n                }\n            }\n\n            return exception;\n        }\n\n        /// <summary>\n        /// Combines the exception messages from this exception and all inner exceptions.\n        /// </summary>\n        /// <param name=\"exception\">The exception to create a collated message from</param>\n        /// <returns>The collate exception message</returns>\n        public string GetExceptionMessageHeader(Exception exception)\n        {\n            return string.Join(\" \", InnersAndSelf(exception).Select(e => e.Message));\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"StackExceptionInterpreter\"/> by loading implementations with default constructors from the specified assemblies\n        /// </summary>\n        /// <returns>A new <see cref=\"StackExceptionInterpreter\"/> containing interpreters from the specified assemblies</returns>\n        public static StackExceptionInterpreter CreateFromAssemblies()\n        {\n            var interpreters =\n                // type implements IExceptionInterpreter\n                from type in Composer.Instance.GetExportedTypes<IExceptionInterpreter>()\n                // ignore non-public and non-instantiable abstract types\n                // type has default parameterless ctor\n                where type.IsPublic && !type.IsAbstract && type.GetConstructor([]) != null\n                // provide guarantee of deterministic ordering\n                orderby type.FullName\n                select (IExceptionInterpreter) Activator.CreateInstance(type);\n\n            var stackExceptionInterpreter = new StackExceptionInterpreter(interpreters);\n\n            foreach (var interpreter in stackExceptionInterpreter.Interpreters)\n            {\n                Log.Debug(Messages.StackExceptionInterpreter.LoadedExceptionInterpreter(interpreter));\n            }\n\n            return stackExceptionInterpreter;\n        }\n\n        private IEnumerable<Exception> InnersAndSelf(Exception exception)\n        {\n            yield return exception;\n            while (exception.InnerException != null)\n            {\n                exception = exception.InnerException;\n                yield return exception;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/SystemExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Base handler that will try get an exception file and line\n    /// </summary>\n    public class SystemExceptionInterpreter : IExceptionInterpreter\n    {\n        private static Regex FileAndLineRegex = new (\"(\\\\w+.cs:line \\\\d+)\", RegexOptions.Compiled);\n\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public virtual int Order => int.MaxValue;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception. f\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public virtual bool CanInterpret(Exception exception) => true;\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public virtual Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var sanitized = new SanitizedException(exception.Message, exception.StackTrace);\n\n            if (!TryGetLineAndFile(exception.StackTrace, out var fileAndLine))\n            {\n                return sanitized;\n            }\n            return new Exception(exception.Message + fileAndLine, innerException: sanitized);\n        }\n\n        /// <summary>\n        /// Helper method to get the file and line from a C# stacktrace\n        /// </summary>\n        public static bool TryGetLineAndFile(string stackTrace, out string fileAndLine)\n        {\n            fileAndLine = null;\n            if (stackTrace != null)\n            {\n                var match = FileAndLineRegex.Match(stackTrace);\n                if (match.Success)\n                {\n                    foreach (Match lineCapture in match.Captures)\n                    {\n                        fileAndLine = $\" in {lineCapture.Groups[1].Value}\" ;\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n\n        private class SanitizedException : Exception\n        {\n            private readonly string _message;\n            private readonly string _stackTrace;\n\n            public override string Message => _message;\n            public override string StackTrace => _stackTrace;\n\n            public SanitizedException(string message, string stackTrace)\n            {\n                _message = message;\n                _stackTrace = Logging.Log.ClearLeanPaths(stackTrace);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exceptions/UnsupportedOperandPythonExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Exceptions\n{\n    /// <summary>\n    /// Interprets <see cref=\"UnsupportedOperandPythonExceptionInterpreter\"/> instances\n    /// </summary>\n    public class UnsupportedOperandPythonExceptionInterpreter : PythonExceptionInterpreter\n    {\n        /// <summary>\n        /// Determines the order that an instance of this class should be called\n        /// </summary>\n        public override int Order => 0;\n\n        /// <summary>\n        /// Determines if this interpreter should be applied to the specified exception.\n        /// </summary>\n        /// <param name=\"exception\">The exception to check</param>\n        /// <returns>True if the exception can be interpreted, false otherwise</returns>\n        public override bool CanInterpret(Exception exception)\n        {\n            return base.CanInterpret(exception) &&\n                exception.Message.Contains(Messages.UnsupportedOperandPythonExceptionInterpreter.UnsupportedOperandTypeExpectedSubstring);\n        }\n\n        /// <summary>\n        /// Interprets the specified exception into a new exception\n        /// </summary>\n        /// <param name=\"exception\">The exception to be interpreted</param>\n        /// <param name=\"innerInterpreter\">An interpreter that should be applied to the inner exception.</param>\n        /// <returns>The interpreted exception</returns>\n        public override Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            var pe = (PythonException)exception;\n\n            var types = pe.Message.Split(':')[1].Trim();\n            var message = Messages.UnsupportedOperandPythonExceptionInterpreter.InvalidObjectTypesForOperation(types);\n            message += PythonUtil.PythonExceptionStackParser(pe.StackTrace);\n\n            return new Exception(message, pe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Exchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Lean exchange definition\n    /// </summary>\n    public class Exchange\n    {\n        /// <summary>\n        /// Unknown exchange value\n        /// </summary>\n        public static Exchange UNKNOWN { get; } = new(string.Empty, string.Empty, \"UNKNOWN\", string.Empty);\n\n        /// <summary>\n        /// The Members Exchange (MEMX) is an independently owned, technology-driven stock exchange\n        /// </summary>\n        public static Exchange MEMX { get; }\n            = new(\"MEMX\", \"MM\", \"The Long-Term Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Long-Term Stock Exchange\n        /// </summary>\n        public static Exchange LTSE { get; }\n            = new(\"LTSE\", \"L\", \"The Long-Term Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// National Association of Securities Dealers Automated Quotation.\n        /// </summary>\n        public static Exchange NASDAQ { get; }\n            = new(\"NASDAQ\", \"Q\", \"National Association of Securities Dealers Automated Quotation\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The NASDAQ options market\n        /// </summary>\n        public static Exchange NASDAQ_Options { get; }\n            = new(\"XNDQ\", \"XNDQ\", \"NASDAQ options market\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// Bats Global Markets, Better Alternative Trading System\n        /// </summary>\n        public static Exchange BATS { get; }\n            = new(\"BATS\", \"Z\", \"Bats Global Markets, Better Alternative Trading System\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// New York Stock Archipelago Exchange\n        /// </summary>\n        public static Exchange ARCA { get; }\n            = new(\"ARCA\", \"P\", \"New York Stock Archipelago Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// New York Stock Archipelago Exchange\n        /// </summary>\n        public static Exchange ARCA_Options { get; }\n            = new(\"ARCX\", \"ARCX\", \"NYSE Arca Options\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// New York Stock Exchange\n        /// </summary>\n        public static Exchange NYSE { get; }\n            = new(\"NYSE\", \"N\", \"New York Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Smart Exchange\n        /// </summary>\n        /// <remarks>Brokerage will route to smart exchange</remarks>\n        public static Exchange SMART { get; }\n            = new(\"SMART\", \"SMART\", \"SMART Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Over The Counter Exchange\n        /// </summary>\n        public static Exchange OTCX { get; }\n            = new(\"OTCX\", \"OTCX\", \"Over the Counter Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Investors Exchange\n        /// </summary>\n        public static Exchange IEX { get; }\n            = new(\"IEX\", \"IEX\", \"Investors Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// National Stock Exchange\n        /// </summary>\n        /// <remarks>Is now known as the NYSE National</remarks>\n        public static Exchange NSX { get; }\n            = new(\"NSE\", \"C\", \"National Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Financial Industry Regulatory Authority\n        /// </summary>\n        public static Exchange FINRA { get; }\n            = new(\"FINRA\", \"D\", \"The Financial Industry Regulatory Authority\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Nasdaq International Securities Exchange\n        /// </summary>\n        public static Exchange ISE { get; }\n            = new(\"ISE\", \"I\", \"Nasdaq International Securities Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Chicago Stock Exchange\n        /// </summary>\n        public static Exchange CSE { get; }\n            = new(\"CSE\", \"M\", \"Chicago Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Chicago Board Options Exchange\n        /// </summary>\n        public static Exchange CBOE { get; }\n            = new(\"CBOE\", \"W\", \"The Chicago Board Options Exchange\", QuantConnect.Market.USA, SecurityType.Equity, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// CBOE Options Exchange\n        /// </summary>\n        public static Exchange C2 { get; }\n            = new(\"C2\", \"W\", \"CBOE Options Exchange\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// The American Options Exchange\n        /// </summary>\n        public static Exchange NASDAQ_BX { get; }\n            = new(\"NASDAQ_BX\", \"B\", \"National Association of Securities Dealers Automated Quotation BX\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Securities Industry Automation Corporation\n        /// </summary>\n        public static Exchange SIAC { get; }\n            = new(\"SIAC\", \"SIAC\", \"The Securities Industry Automation Corporation\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// CBOE EDGA U.S. equities Exchange\n        /// </summary>\n        public static Exchange EDGA { get; }\n            = new(\"EDGA\", \"J\", \"CBOE EDGA U.S. equities Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// CBOE EDGX U.S. equities Exchange\n        /// </summary>\n        public static Exchange EDGX { get; }\n            = new(\"EDGX\", \"K\", \"CBOE EDGX U.S. equities Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// CBOE EDGO U.S. option Exchange\n        /// </summary>\n        public static Exchange EDGO { get; }\n            = new(\"EDGO\", \"EDGO\", \"CBOE EDGX OPTIONS EXCHANGE.\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// National Association of Securities Dealers Automated Quotation PSX\n        /// </summary>\n        public static Exchange NASDAQ_PSX { get; }\n            = new(\"NASDAQ_PSX\", \"X\", \"National Association of Securities Dealers Automated Quotation PSX\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// National Association of Securities Dealers Automated Quotation PSX\n        /// </summary>\n        public static Exchange BATS_Y { get; }\n            = new(\"BATS_Y\", \"Y\", \"Bats Global Markets, Better Alternative Trading System\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Boston Stock Exchange\n        /// </summary>\n        /// <remarks>Now NASDAQ OMX BX</remarks>\n        public static Exchange BOSTON { get; }\n            = new(\"BOSTON\", \"BB\", \"The Boston Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// The Boston Option Exchange\n        /// </summary>\n        public static Exchange BOX { get; }\n            = new(\"BOX\", \"B\", \"The Boston Option Exchange\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// The American Stock Exchange\n        /// </summary>\n        /// <remarks>Now NYSE MKT</remarks>\n        public static Exchange AMEX { get; }\n            = new(\"AMEX\", \"A\", \"The American Stock Exchange\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Bombay Stock Exchange\n        /// </summary>\n        public static Exchange BSE { get; }\n            = new(\"BSE\", \"BSE\", \"Bombay Stock Exchange\", QuantConnect.Market.India, SecurityType.Equity);\n\n        /// <summary>\n        /// National Stock Exchange of India\n        /// </summary>\n        public static Exchange NSE { get; }\n            = new(\"NSE\", \"NSE\", \"National Stock Exchange of India\", QuantConnect.Market.India, SecurityType.Equity);\n\n        /// <summary>\n        /// The American Options Exchange\n        /// </summary>\n        /// <remarks>Now NYSE Amex Options</remarks>\n        public static Exchange AMEX_Options { get; }\n            = new(\"AMEX\", \"A\", \"The American Options Exchange\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// The Options Price Reporting Authority\n        /// </summary>\n        public static Exchange OPRA { get; }\n            = new(\"OPRA\", \"O\", \"The Options Price Reporting Authority\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// Miami International Securities Options Exchange\n        /// </summary>\n        public static Exchange MIAX { get; }\n            = new(\"MIAX\", \"M\", \"Miami International Securities Options Exchange\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// MIAX Pearl Option and Equity exchange. Offers a Price-Time allocation and Maker-Taker fee structure\n        /// </summary>\n        public static Exchange MIAX_PEARL { get; }\n            = new(\"MIAX_PEARL\", \"MP\", \"MIAX PEARL\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.Equity);\n\n        /// <summary>\n        /// Serves as a counterpart to MIAX Options and MIAX Pearl by providing Pro-Rata allocation like MIAX Options and a Maker-Taker fee structure like MIAX Pearl\n        /// </summary>\n        public static Exchange MIAX_EMERALD { get; }\n            = new(\"MIAX_EMERALD\", \"ME\", \"MIAX EMERALD\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// MIAX Sapphire: Electronic and floor trading for derivatives.\n        /// </summary>\n        public static Exchange MIAX_SAPPHIRE { get; }\n            = new(\"MIAX_SAPPHIRE\", \"SPHR\", \"Miax Sapphire, LLC\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// International Securities Options Exchange GEMINI\n        /// </summary>\n        public static Exchange ISE_GEMINI { get; }\n            = new(\"ISE_GEMINI\", \"H\", \"International Securities Options Exchange GEMINI\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// International Securities Options Exchange MERCURY\n        /// </summary>\n        public static Exchange ISE_MERCURY { get; }\n            = new(\"ISE_MERCURY\", \"J\", \"International Securities Options Exchange MERCURY\", QuantConnect.Market.USA, SecurityType.Option);\n\n        /// <summary>\n        /// The Chicago Mercantile Exchange (CME), is an organized exchange for the trading of futures and options.\n        /// </summary>\n        public static Exchange CME { get; }\n            = new(\"CME\", \"CME\", \"Futures and Options Chicago Mercantile Exchange\", QuantConnect.Market.CME, SecurityType.Future, SecurityType.FutureOption);\n\n        /// <summary>\n        /// The European Derivatives Exchange (EUREX)\n        /// </summary>\n        public static Exchange EUREX { get; }\n            = new(\"EUREX\", \"EUREX\", \"European Derivatives Exchange\", QuantConnect.Market.EUREX, SecurityType.Future, SecurityType.Index);\n\n        /// <summary>\n\n        /// <summary>\n        /// The Chicago Board of Trade (CBOT) is a commodity exchange\n        /// </summary>\n        public static Exchange CBOT { get; }\n            = new(\"CBOT\", \"CBOT\", \" Chicago Board of Trade Commodity Exchange\", QuantConnect.Market.CBOT, SecurityType.Future, SecurityType.FutureOption);\n\n        /// <summary>\n        /// Cboe Futures Exchange\n        /// </summary>\n        public static Exchange CFE { get; }\n            = new(\"CFE\", \"CFE\", \"CFE Futures Exchange\", QuantConnect.Market.CFE, SecurityType.Future);\n\n        /// <summary>\n        /// COMEX Commodity Exchange\n        /// </summary>\n        public static Exchange COMEX { get; }\n            = new(\"COMEX\", \"COMEX\", \"COMEX Futures Exchange\", QuantConnect.Market.COMEX, SecurityType.Future);\n\n        /// <summary>\n        /// The Intercontinental Exchange\n        /// </summary>\n        public static Exchange ICE { get; }\n            = new(\"ICE\", \"ICE\", \"The Intercontinental Exchange\", QuantConnect.Market.ICE, SecurityType.Future);\n\n        /// <summary>\n        /// New York Mercantile Exchange\n        /// </summary>\n        public static Exchange NYMEX { get; }\n            = new(\"NYMEX\", \"NYMEX\", \"New York Mercantile Exchange\", QuantConnect.Market.NYMEX, SecurityType.Future, SecurityType.FutureOption);\n\n        /// <summary>\n        /// London International Financial Futures and Options Exchange\n        /// </summary>\n        public static Exchange NYSELIFFE { get; }\n            = new(\"NYSELIFFE\", \"NYSELIFFE\", \"London International Financial Futures and Options Exchange\", QuantConnect.Market.NYSELIFFE, SecurityType.Future, SecurityType.FutureOption);\n\n        /// <summary>\n        /// Credit Suisse First Boston (also known as CSFB and CS First Boston) is the investment banking affiliate of Credit Suisse headquartered in New York.\n        /// </summary>\n        public static Exchange CSFB { get; }\n            = new(\"CSFB\", \"CSFB\", \"Credit Suisse First Boston\", QuantConnect.Market.USA, SecurityType.Equity);\n\n        /// <summary>\n        /// Philadelphia Stock Exchange (PHLX), now known as Nasdaq PHLX, is the first stock exchange established in the United States and the oldest stock exchange in the nation.\n        /// </summary>\n        public static Exchange PHLX { get; }\n            = new(\"PHLX\", \"X\", \"NASDAQ OMX PHLX\", QuantConnect.Market.USA, SecurityType.Option, SecurityType.IndexOption);\n\n        /// <summary>\n        /// Exchange description\n        /// </summary>\n        [JsonIgnore]\n        public string Description { get; }\n\n        /// <summary>\n        /// The exchange short code\n        /// </summary>\n        public string Code { get; init; }\n\n        /// <summary>\n        /// The exchange name\n        /// </summary>\n        public string Name { get; init; }\n\n        /// <summary>\n        /// The associated lean market <see cref=\"Market\"/>\n        /// </summary>\n        public string Market { get; init; }\n\n        /// <summary>\n        /// Security types traded in this exchange\n        /// </summary>\n        [JsonProperty(ReferenceLoopHandling = ReferenceLoopHandling.Ignore)]\n        public IReadOnlyList<SecurityType> SecurityTypes { get; init; } = new List<SecurityType>();\n\n        /// <summary>\n        /// Creates a new empty exchange instance\n        /// </summary>\n        /// <remarks>For json round trip serialization</remarks>\n        private Exchange()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new exchange instance\n        /// </summary>\n        public Exchange(string name, string code, string description, string market, params SecurityType[] securityTypes)\n        {\n            Name = name;\n            Market = market;\n            Description = description;\n            SecurityTypes = securityTypes?.ToList() ?? new List<SecurityType>();\n            Code = string.IsNullOrEmpty(code) ? name : code;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        public override string ToString()\n        {\n            return Name;\n        }\n\n        /// <summary>\n        /// Returns the string representation of this exchange\n        /// </summary>\n        public static implicit operator string(Exchange exchange)\n        {\n            return ReferenceEquals(exchange, null) ? string.Empty : exchange.ToString();\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object\n        /// </summary>\n        public override bool Equals(object? obj)\n        {\n            if (ReferenceEquals(this, obj))\n            {\n                return true;\n            }\n            var exchange = obj as Exchange;\n            if (ReferenceEquals(exchange, null) || ReferenceEquals(exchange, UNKNOWN))\n            {\n                // other is null or UNKNOWN (equivalents)\n                // so we need to know how We compare with UNKNOWN\n                return ReferenceEquals(this, UNKNOWN);\n            }\n\n            return Code == exchange.Code\n                && Market == exchange.Market\n                && SecurityTypes.All(exchange.SecurityTypes.Contains)\n                && SecurityTypes.Count == exchange.SecurityTypes.Count;\n        }\n\n        /// <summary>\n        /// Equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are equal, otherwise false</returns>\n        public static bool operator ==(Exchange left, Exchange right)\n        {\n            if (ReferenceEquals(left, right))\n            {\n                return true;\n            }\n            if (ReferenceEquals(left, null) || left.Equals(UNKNOWN))\n            {\n                return ReferenceEquals(right, null) || right.Equals(UNKNOWN);\n            }\n            return left.Equals(right);\n        }\n\n        /// <summary>\n        /// Not equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are not equal, otherwise false</returns>\n        public static bool operator !=(Exchange left, Exchange right)\n        {\n            return !(left == right);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = Code.GetHashCode();\n                hashCode = (hashCode * 397) ^ Market.GetHashCode();\n                for (var i = 0; i < SecurityTypes.Count; i++)\n                {\n                    hashCode = (hashCode * 397) ^ SecurityTypes[i].GetHashCode();\n                }\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Expiry.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides static functions that can be used to compute a future <see cref=\"DateTime\"/> (expiry) given a <see cref=\"DateTime\"/>.\n    /// </summary>\n    public static class Expiry\n    {\n        /// <summary>\n        /// Computes a date/time one month after a given date/time (nth day to nth day)\n        /// </summary>\n        public static Func<DateTime, DateTime> OneMonth => dt => dt.AddMonths(1);\n\n        /// <summary>\n        /// Computes a date/time one quarter after a given date/time (nth day to nth day)\n        /// </summary>\n        public static Func<DateTime, DateTime> OneQuarter => dt => dt.AddMonths(3);\n\n        /// <summary>\n        /// Computes a date/time one year after a given date/time (nth day to nth day)\n        /// </summary>\n        public static Func<DateTime, DateTime> OneYear => dt => dt.AddYears(1);\n\n        /// <summary>\n        /// Computes the end of day (mid-night of the next day) of given date/time\n        /// </summary>\n        public static Func<DateTime, DateTime> EndOfDay => dt => dt.AddDays(1).Date;\n\n        /// <summary>\n        /// Computes the end of week (next Monday) of given date/time\n        /// </summary>\n        public static Func<DateTime, DateTime> EndOfWeek\n        {\n            get\n            {\n                return dt =>\n                {\n                    var value = 8 - (int)dt.DayOfWeek;\n                    if (value == 8) value = 1;   // Sunday\n                    return dt.AddDays(value).Date;\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the end of month (1st of the next month) of given date/time\n        /// </summary>\n        public static Func<DateTime, DateTime> EndOfMonth\n        {\n            get\n            {\n                return dt =>\n                {\n                    var value = OneMonth(dt);\n                    return new DateTime(value.Year, value.Month, 1);\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the end of quarter (1st of the starting month of next quarter) of given date/time\n        /// </summary>\n        public static Func<DateTime, DateTime> EndOfQuarter\n        {\n            get\n            {\n                return dt =>\n                {\n                    var nthQuarter = (dt.Month - 1) / 3;\n                    var firstMonthOfQuarter = nthQuarter * 3 + 1;\n                    return OneQuarter(new DateTime(dt.Year, firstMonthOfQuarter, 1));\n                };\n            }\n        }\n\n        /// <summary>\n        /// Computes the end of year (1st of the next year) of given date/time\n        /// </summary>\n        public static Func<DateTime, DateTime> EndOfYear => dt => new DateTime(dt.Year + 1, 1, 1);\n    }\n}"
  },
  {
    "path": "Common/ExtendedDictionary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing System.Collections;\nusing QuantConnect.Python;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides a base class for types holding key value pairs with helper methods for easy usage in Python\n    /// </summary>\n    [PandasNonExpandable]\n#pragma warning disable CA1708 // Identifiers should differ by more than case\n    public abstract class ExtendedDictionary<TKey, TValue> : IExtendedDictionary<TKey, TValue>\n#pragma warning restore CA1708 // Identifiers should differ by more than case\n    {\n        /// <summary>\n        /// Gets the number of elements contained in the dictionary\n        /// </summary>\n        public abstract int Count { get; }\n\n        /// <summary>\n        /// Removes all items from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only. </exception>\n        public virtual void Clear()\n        {\n            if (IsReadOnly)\n            {\n                throw new InvalidOperationException(Messages.ExtendedDictionary.ClearInvalidOperation(this));\n            }\n            throw new NotImplementedException(Messages.ExtendedDictionary.ClearMethodNotImplemented);\n        }\n\n        /// <summary>\n        /// Gets the value associated with the specified key.\n        /// </summary>\n        /// <returns>\n        /// true if the object that implements <see cref=\"T:System.Collections.Generic.IDictionary`2\"/> contains an element with the specified key; otherwise, false.\n        /// </returns>\n        /// <param name=\"key\">The key whose value to get.</param>\n        /// <param name=\"value\">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name=\"value\"/> parameter. This parameter is passed uninitialized.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"key\"/> is null.</exception>\n        public abstract bool TryGetValue(TKey key, out TValue value);\n\n        /// <summary>\n        /// Checks if the dictionary contains the specified key.\n        /// </summary>\n        /// <param name=\"key\">The key to locate in the dictionary</param>\n        /// <returns>true if the dictionary contains an element with the specified key; otherwise, false.</returns>\n        public virtual bool ContainsKey(TKey key)\n        {\n            return TryGetValue(key, out _);\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public abstract IEnumerable<KeyValuePair<TKey, TValue>> GetItems();\n\n        /// <summary>\n        /// Gets an <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the key objects of the <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the key objects of the object that implements <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </returns>\n        protected abstract IEnumerable<TKey> GetKeys { get; }\n\n        /// <summary>\n        /// Gets an <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the values in the <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.Generic.ICollection`1\"/> containing the values in the object that implements <see cref=\"T:System.Collections.Generic.IDictionary`2\"/>.\n        /// </returns>\n        protected abstract IEnumerable<TValue> GetValues { get; }\n\n        /// <summary>\n        /// Gets a value indicating whether the <see cref=\"IDictionary\"/> object is read-only.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        public virtual bool IsReadOnly => true;\n\n        /// <summary>\n        /// Removes the value with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key object of the element to remove.</param>\n        /// <returns>true if the element is successfully found and removed; otherwise, false.</returns>\n        public virtual bool Remove(TKey key)\n        {\n            if (IsReadOnly)\n            {\n                throw new InvalidOperationException(Messages.ExtendedDictionary.RemoveInvalidOperation(this));\n            }\n            throw new NotImplementedException(Messages.ExtendedDictionary.RemoveMethodNotImplemented);\n        }\n\n        /// <summary>\n        /// Indexer method for the base dictioanry to access the objects by their symbol.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <param name=\"key\">Key object indexer</param>\n        /// <returns>Object of <typeparamref name=\"TValue\"/></returns>\n        public abstract TValue this[TKey key] { get; set; }\n\n        /// <summary>\n        /// Removes all keys and values from the <see cref=\"IExtendedDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        public void clear()\n        {\n            Clear();\n        }\n\n        /// <summary>\n        /// Creates a shallow copy of the <see cref=\"IExtendedDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <returns>Returns a shallow copy of the dictionary. It doesn't modify the original dictionary.</returns>\n        public PyDict copy()\n        {\n            return fromkeys(GetKeys.ToArray());\n        }\n\n        /// <summary>\n        /// Creates a new dictionary from the given sequence of elements.\n        /// </summary>\n        /// <param name=\"sequence\">Sequence of elements which is to be used as keys for the new dictionary</param>\n        /// <returns>Returns a new dictionary with the given sequence of elements as the keys of the dictionary.</returns>\n        public PyDict fromkeys(TKey[] sequence)\n        {\n            return fromkeys(sequence, default);\n        }\n\n        /// <summary>\n        /// Creates a new dictionary from the given sequence of elements with a value provided by the user.\n        /// </summary>\n        /// <param name=\"sequence\">Sequence of elements which is to be used as keys for the new dictionary</param>\n        /// <param name=\"value\">Value which is set to each each element of the dictionary</param>\n        /// <returns>Returns a new dictionary with the given sequence of elements as the keys of the dictionary.\n        /// Each element of the newly created dictionary is set to the provided value.</returns>\n        public PyDict fromkeys(TKey[] sequence, TValue value)\n        {\n            using (Py.GIL())\n            {\n                var dict = new PyDict();\n                foreach (var key in sequence)\n                {\n                    var pyValue = get(key, value);\n                    dict.SetItem(key.ToPython(), pyValue.ToPython());\n                }\n                return dict;\n            }\n        }\n\n        /// <summary>\n        /// Returns the value for the specified key if key is in dictionary.\n        /// </summary>\n        /// <param name=\"key\">key to be searched in the dictionary</param>\n        /// <returns>The value for the specified key if key is in dictionary.\n        /// None if the key is not found and value is not specified.</returns>\n        public TValue get(TKey key)\n        {\n            TValue data;\n            TryGetValue(key, out data);\n            return data;\n        }\n\n        /// <summary>\n        /// Returns the value for the specified key if key is in dictionary.\n        /// </summary>\n        /// <param name=\"key\">key to be searched in the dictionary</param>\n        /// <param name=\"value\">Value to be returned if the key is not found. The default value is null.</param>\n        /// <returns>The value for the specified key if key is in dictionary.\n        /// value if the key is not found and value is specified.</returns>\n        public TValue get(TKey key, TValue value)\n        {\n            TValue data;\n            if (TryGetValue(key, out data))\n            {\n                return data;\n            }\n            return value;\n        }\n\n        /// <summary>\n        /// Returns a view object that displays a list of dictionary's (key, value) tuple pairs.\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of a given dictionary's (key, value) tuple pair.</returns>\n        public PyList items()\n        {\n            using (Py.GIL())\n            {\n                var pyList = new PyList();\n                foreach (var (key, value) in GetItems())\n                {\n                    using var pyKey = key.ToPython();\n                    using var pyValue = value.ToPython();\n                    using var pyKvp = new PyTuple([pyKey, pyValue]);\n                    pyList.Append(pyKvp);\n                }\n                return pyList;\n            }\n        }\n\n        /// <summary>\n        /// Returns and removes an arbitrary element (key, value) pair from the dictionary.\n        /// </summary>\n        /// <returns>Returns an arbitrary element (key, value) pair from the dictionary\n        /// removes an arbitrary element(the same element which is returned) from the dictionary.\n        /// Note: Arbitrary elements and random elements are not same.The popitem() doesn't return a random element.</returns>\n        public PyTuple popitem()\n        {\n            throw new NotSupportedException(Messages.ExtendedDictionary.PopitemMethodNotSupported(this));\n        }\n\n        /// <summary>\n        /// Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key with null/None value is inserted to the dictionary if key is not in the dictionary.</param>\n        /// <returns>The value of the key if it is in the dictionary\n        /// None if key is not in the dictionary</returns>\n        public TValue setdefault(TKey key)\n        {\n            return setdefault(key, default);\n        }\n\n        /// <summary>\n        /// Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key with a value default_value is inserted to the dictionary if key is not in the dictionary.</param>\n        /// <param name=\"default_value\">Default value</param>\n        /// <returns>The value of the key if it is in the dictionary\n        /// default_value if key is not in the dictionary and default_value is specified</returns>\n        public TValue setdefault(TKey key, TValue default_value)\n        {\n            TValue data;\n            if (TryGetValue(key, out data))\n            {\n                return data;\n            }\n\n            if (IsReadOnly)\n            {\n                throw new KeyNotFoundException(Messages.ExtendedDictionary.KeyNotFoundDueToNoData(this, key));\n            }\n\n            this[key] = default_value;\n            return default_value;\n        }\n\n        /// <summary>\n        /// Removes and returns an element from a dictionary having the given key.\n        /// </summary>\n        /// <param name=\"key\">Key which is to be searched for removal</param>\n        /// <returns>If key is found - removed/popped element from the dictionary\n        /// If key is not found - KeyError exception is raised</returns>\n        public TValue pop(TKey key)\n        {\n            return pop(key, default);\n        }\n\n        /// <summary>\n        /// Removes and returns an element from a dictionary having the given key.\n        /// </summary>\n        /// <param name=\"key\">Key which is to be searched for removal</param>\n        /// <param name=\"default_value\">Value which is to be returned when the key is not in the dictionary</param>\n        /// <returns>If key is found - removed/popped element from the dictionary\n        /// If key is not found - value specified as the second argument(default)</returns>\n        public TValue pop(TKey key, TValue default_value)\n        {\n            TValue data;\n            if (TryGetValue(key, out data))\n            {\n                Remove(key);\n                return data;\n            }\n            return default_value;\n        }\n\n        /// <summary>\n        /// Updates the dictionary with the elements from the another dictionary object or from an iterable of key/value pairs.\n        /// The update() method adds element(s) to the dictionary if the key is not in the dictionary.If the key is in the dictionary, it updates the key with the new value.\n        /// </summary>\n        /// <param name=\"other\">Takes either a dictionary or an iterable object of key/value pairs (generally tuples).</param>\n        public void update(PyObject other)\n        {\n            if (IsReadOnly)\n            {\n                throw new InvalidOperationException(Messages.ExtendedDictionary.UpdateInvalidOperation(this));\n            }\n\n            var dictionary = other.ConvertToDictionary<TKey, TValue>();\n            foreach (var kvp in dictionary)\n            {\n                this[kvp.Key] = kvp.Value;\n            }\n        }\n\n        /// <summary>\n        /// Returns a view object that displays a list of all the key objects in the dictionary\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of all the key objects.\n        /// When the dictionary is changed, the view object also reflect these changes.</returns>\n        public PyList keys()\n        {\n            return GetKeys.ToPyList();\n        }\n\n        /// <summary>\n        /// Returns a view object that displays a list of all the values in the dictionary.\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of all values in a given dictionary.</returns>\n        public PyList values()\n        {\n            return GetValues.ToPyList();\n        }\n\n        /// <summary>\n        /// Checks if the symbol is implicitly created from a string, in which case it is not in the symbol cache,\n        /// and throws a KeyNotFoundException.\n        /// </summary>\n        protected void CheckForImplicitlyCreatedSymbol(Symbol symbol)\n        {\n            if (symbol.ID == new SecurityIdentifier(symbol.ID.Symbol, 0))\n            {\n                throw new KeyNotFoundException(Messages.ExtendedDictionary.TickerNotFoundInSymbolCache(symbol.ID.Symbol));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Extensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Http;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Runtime.CompilerServices;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing ProtoBuf;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Python;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing Timer = System.Timers.Timer;\nusing Microsoft.IO;\nusing NodaTime.TimeZones;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Exceptions;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Statistics;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Orders.Fees;\nusing Newtonsoft.Json.Serialization;\nusing QuantConnect.Api;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Extensions function collections - group all static extensions functions here.\n    /// </summary>\n    public static class Extensions\n    {\n        private static readonly Dictionary<string, bool> _emptyDirectories = new();\n        private static readonly HashSet<string> InvalidSecurityTypes = new HashSet<string>();\n        private static readonly Regex DateCheck = new Regex(@\"\\d{8}\", RegexOptions.Compiled);\n        private static RecyclableMemoryStreamManager MemoryManager = new RecyclableMemoryStreamManager();\n        private static readonly int DataUpdatePeriod = Config.GetInt(\"downloader-data-update-period\", 7);\n\n        private static readonly Dictionary<IntPtr, PythonActivator> PythonActivators\n            = new Dictionary<IntPtr, PythonActivator>();\n\n        /// <summary>\n        /// Maintains old behavior of NodaTime's (&lt; 2.0) daylight savings mapping.\n        /// We keep the old behavior to ensure the FillForwardEnumerator does not get stuck on an infinite loop.\n        /// The test `ConvertToSkipsDiscontinuitiesBecauseOfDaylightSavingsStart_AddingOneHour` and other related tests\n        /// assert the expected behavior, which is to ignore discontinuities in daylight savings resolving.\n        ///\n        /// More info can be found in the summary of the <see cref=\"Resolvers.LenientResolver\"/> delegate.\n        /// </summary>\n        private static readonly ZoneLocalMappingResolver _mappingResolver = Resolvers.CreateMappingResolver(Resolvers.ReturnLater, Resolvers.ReturnStartOfIntervalAfter);\n\n        /// <summary>\n        /// Json converter deserializer for streams\n        /// </summary>\n        private static readonly JsonSerializer JsonSerializer = new()\n        {\n            Converters = { new LiveAlgorithmResultsJsonConverter(), new OrderJsonConverter() },\n            ContractResolver = new DefaultContractResolver\n            {\n                NamingStrategy = new CamelCaseNamingStrategy\n                {\n                    ProcessDictionaryKeys = false,\n                    OverrideSpecifiedNames = true\n                }\n            }\n        };\n\n        /// <summary>\n        /// The offset span from the market close to liquidate or exercise a security on the delisting date\n        /// </summary>\n        /// <remarks>Will no be used in live trading</remarks>\n        /// <remarks>By default span is negative 15 minutes. We want to liquidate before market closes if not, in some cases\n        /// like future options the market close would match the delisted event time and would cancel all orders and mark the security\n        /// as non tradable and delisted.</remarks>\n        public static TimeSpan DelistingMarketCloseOffsetSpan { get; set; } = TimeSpan.FromMinutes(-15);\n\n        /// <summary>\n        /// Helper method to get a property in a jobject if available\n        /// </summary>\n        /// <typeparam name=\"T\">The property type</typeparam>\n        /// <param name=\"jObject\">The jobject source</param>\n        /// <param name=\"name\">The property name</param>\n        /// <returns>The property value if present or it's default value</returns>\n        public static T TryGetPropertyValue<T>(this JObject jObject, string name)\n        {\n            T result = default;\n            if (jObject == null)\n            {\n                return result;\n            }\n\n            var jValue = jObject[name];\n            if (jValue != null && jValue.Type != JTokenType.Null)\n            {\n                result = jValue.Value<T>();\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method to find all defined enums in the given value\n        /// </summary>\n        public static IEnumerable<T> GetFlags<T>(long value) where T : Enum\n        {\n            foreach (T flag in Enum.GetValues(typeof(T)))\n            {\n                if ((value & Convert.ToInt64(flag, CultureInfo.InvariantCulture)) != 0)\n                {\n                    yield return flag;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determine if the file is out of date according to our download period.\n        /// Date based files are never out of date (Files with YYYYMMDD)\n        /// </summary>\n        /// <param name=\"filepath\">Path to the file</param>\n        /// <returns>True if the file is out of date</returns>\n        public static bool IsOutOfDate(this string filepath)\n        {\n            var fileName = Path.GetFileName(filepath);\n            // helper to determine if file is date based using regex, matches a 8 digit value because we expect YYYYMMDD\n            return !DateCheck.IsMatch(fileName) && DateTime.Now - TimeSpan.FromDays(DataUpdatePeriod) > File.GetLastWriteTime(filepath);\n        }\n\n        /// <summary>\n        /// Helper method to check if a directory exists and is not empty\n        /// </summary>\n        /// <param name=\"directoryPath\">The path to check</param>\n        /// <returns>True if the directory does not exist or is empty</returns>\n        /// <remarks>Will cache results</remarks>\n        public static bool IsDirectoryEmpty(this string directoryPath)\n        {\n            lock (_emptyDirectories)\n            {\n                if (!_emptyDirectories.TryGetValue(directoryPath, out var result))\n                {\n                    // is empty unless it exists and it has at least 1 file or directory in it\n                    result = true;\n                    if (Directory.Exists(directoryPath))\n                    {\n                        try\n                        {\n                            result = !Directory.EnumerateFileSystemEntries(directoryPath).Any();\n                        }\n                        catch (Exception exception)\n                        {\n                            Log.Error(exception);\n                        }\n                    }\n\n                    _emptyDirectories[directoryPath] = result;\n                    if (result)\n                    {\n                        Log.Trace($\"Extensions.IsDirectoryEmpty(): directory '{directoryPath}' not found or empty\");\n                    }\n                }\n\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to get a market hours entry\n        /// </summary>\n        /// <param name=\"marketHoursDatabase\">The market hours data base instance</param>\n        /// <param name=\"symbol\">The symbol to get the entry for</param>\n        /// <param name=\"dataTypes\">For custom data types can optionally provide data type so that a new entry is added</param>\n        public static MarketHoursDatabase.Entry GetEntry(this MarketHoursDatabase marketHoursDatabase, Symbol symbol, IEnumerable<Type> dataTypes)\n        {\n            if (symbol.SecurityType == SecurityType.Base)\n            {\n                if (!marketHoursDatabase.TryGetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType, out var entry))\n                {\n                    var type = dataTypes.Single();\n                    var baseInstance = type.GetBaseDataInstance();\n                    baseInstance.Symbol = symbol;\n                    SecurityIdentifier.TryGetCustomDataType(symbol.ID.Symbol, out var customType);\n                    // for custom types we will add an entry for that type\n                    entry = marketHoursDatabase.SetEntryAlwaysOpen(symbol.ID.Market, customType != null ? $\"TYPE.{customType}\" : null, SecurityType.Base, baseInstance.DataTimeZone());\n                }\n                return entry;\n            }\n\n            var result = marketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n\n            // For the OptionUniverse and FutureUniverse types, the exchange and data time zones are set to the same value (exchange tz).\n            // This is not actual options/futures data, just chains/universe selection, so we don't want any offsets\n            // between the exchange and data time zones.\n            // If the MHDB were data type dependent as well, this would be taken care in there.\n            if (result != null && dataTypes.Any(dataType => dataType.IsAssignableTo(typeof(BaseChainUniverseData))))\n            {\n                result = new MarketHoursDatabase.Entry(result.ExchangeHours.TimeZone, result.ExchangeHours);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method to deserialize a json array into a list also handling single json values\n        /// </summary>\n        /// <param name=\"jsonArray\">The value to deserialize</param>\n        public static List<string> DeserializeList(this string jsonArray)\n        {\n            return DeserializeList<string>(jsonArray);\n        }\n\n        /// <summary>\n        /// Helper method to deserialize a json array into a list also handling single json values\n        /// </summary>\n        /// <param name=\"jsonArray\">The value to deserialize</param>\n        public static List<T> DeserializeList<T>(this string jsonArray)\n        {\n            try\n            {\n                if (string.IsNullOrEmpty(jsonArray))\n                {\n                    return new();\n                }\n                return JsonConvert.DeserializeObject<List<T>>(jsonArray);\n            }\n            catch (Exception ex)\n            {\n                if (ex is not JsonReaderException && ex is not JsonSerializationException)\n                {\n                    throw;\n                }\n\n                if (typeof(T) == typeof(string))\n                {\n                    return new List<T> { (T)Convert.ChangeType(jsonArray, typeof(T), CultureInfo.InvariantCulture) };\n                }\n                return new List<T> { JsonConvert.DeserializeObject<T>(jsonArray) };\n            }\n        }\n\n        /// <summary>\n        /// Helper method to download a provided url as a string\n        /// </summary>\n        /// <param name=\"client\">The http client to use</param>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"data\">The downloaded data</param>\n        /// <param name=\"statusCode\">The request status code</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        public static bool TryDownloadData(this HttpClient client, string url, out string data, out HttpStatusCode? statusCode, Dictionary<string, string> headers = null)\n        {\n            return client.TryDownloadData(url, out data, out statusCode, headers, null);\n        }\n\n        /// <summary>\n        /// Helper method to download a provided url as a string\n        /// </summary>\n        /// <param name=\"client\">The http client to use</param>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        public static string DownloadData(this HttpClient client, string url, Dictionary<string, string> headers = null)\n        {\n            return client.DownloadData<string>(url, headers, null);\n        }\n\n        /// <summary>\n        /// Helper method to download a provided url as a string\n        /// </summary>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        public static string DownloadData(this string url, Dictionary<string, string> headers = null)\n        {\n            return url.DownloadData<string>(headers, null);\n        }\n\n        /// <summary>\n        /// Download the content of a url to a string and deserialize it to the specified type\n        /// </summary>\n        /// <typeparam name=\"T\">The type to deserialize to</typeparam>\n        /// <param name=\"client\">The http client to use</param>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        /// <param name=\"settings\">Optional JSON serializer settings</param>\n        /// <returns>The deserialized data</returns>\n        public static T DownloadData<T>(this HttpClient client, string url, Dictionary<string, string> headers = null, JsonSerializerSettings settings = null)\n        {\n            client.TryDownloadData<T>(url, out var result, out _, headers, settings);\n            return result;\n        }\n\n        /// <summary>\n        /// Download the content of a url to a string and deserialize it to the specified type\n        /// </summary>\n        /// <typeparam name=\"T\">The type to deserialize to</typeparam>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        /// <param name=\"settings\">Optional JSON serializer settings</param>\n        /// <returns>The deserialized data</returns>\n        public static T DownloadData<T>(this string url, Dictionary<string, string> headers = null, JsonSerializerSettings settings = null)\n        {\n            using var client = new HttpClient();\n            return client.DownloadData<T>(url, headers, settings);\n        }\n\n        /// <summary>\n        /// Tries to download and deserialize directly from stream to T\n        /// </summary>\n        /// <typeparam name=\"T\">The type to deserialize to</typeparam>\n        /// <param name=\"client\">The http client to use</param>\n        /// <param name=\"url\">The url to download data from</param>\n        /// <param name=\"result\">The deserialized data if successful</param>\n        /// <param name=\"statusCode\">The request status code</param>\n        /// <param name=\"headers\">Add custom headers for the request</param>\n        /// <param name=\"settings\">Optional JSON serializer settings</param>\n        /// <returns>True if successful, otherwise false</returns>\n        public static bool TryDownloadData<T>(this HttpClient client, string url, out T result, out HttpStatusCode? statusCode, Dictionary<string, string> headers = null, JsonSerializerSettings settings = null)\n        {\n            result = default;\n            statusCode = null;\n            using var request = new HttpRequestMessage(HttpMethod.Get, url);\n            if (headers != null)\n            {\n                foreach (var kvp in headers)\n                {\n                    request.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value);\n                }\n            }\n\n            try\n            {\n                using var response = client.SendAsync(request).SynchronouslyAwaitTaskResult();\n                statusCode = response.StatusCode;\n\n                if (!response.IsSuccessStatusCode)\n                {\n                    Log.Error($\"DownloadData(): {Messages.Extensions.DownloadDataFailed(url)}. Status code: {response.StatusCode}\");\n                    return false;\n                }\n\n                using var stream = response.Content.ReadAsStreamAsync().SynchronouslyAwaitTaskResult();\n                using var reader = new StreamReader(stream);\n\n                if (typeof(T) == typeof(string))\n                {\n                    // Special case: return the response as a raw string without deserialization\n                    result = (T)(object)reader.ReadToEnd();\n                }\n                else\n                {\n                    using var jsonReader = new JsonTextReader(reader);\n                    var serializer = JsonSerializer.Create(settings);\n                    result = serializer.Deserialize<T>(jsonReader);\n                }\n                return true;\n            }\n            catch (HttpRequestException ex)\n            {\n                Log.Error(ex, $\"DownloadData(): {Messages.Extensions.DownloadDataFailed(url)}\");\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to download a provided url as a byte array\n        /// </summary>\n        /// <param name=\"url\">The url to download data from</param>\n        public static byte[] DownloadByteArray(this string url)\n        {\n            using (var wc = new HttpClient())\n            {\n                try\n                {\n                    return wc.GetByteArrayAsync(url).Result;\n                }\n                catch (Exception ex)\n                {\n                    Log.Error(ex, $\"DownloadByteArray(): {Messages.Extensions.DownloadDataFailed(url)}\");\n                    return null;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Safe multiplies a decimal by 100\n        /// </summary>\n        /// <param name=\"value\">The decimal to multiply</param>\n        /// <returns>The result, maxed out at decimal.MaxValue</returns>\n        public static decimal SafeMultiply100(this decimal value)\n        {\n            const decimal max = decimal.MaxValue / 100m;\n            if (value >= max) return decimal.MaxValue;\n            return value * 100m;\n        }\n\n        /// <summary>\n        /// Will return a memory stream using the <see cref=\"RecyclableMemoryStreamManager\"/> instance.\n        /// </summary>\n        /// <param name=\"guid\">Unique guid</param>\n        /// <returns>A memory stream</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static MemoryStream GetMemoryStream(Guid guid)\n        {\n            return MemoryManager.GetStream(guid);\n        }\n\n        /// <summary>\n        /// Serialize a list of ticks using protobuf\n        /// </summary>\n        /// <param name=\"ticks\">The list of ticks to serialize</param>\n        /// <param name=\"guid\">Unique guid</param>\n        /// <returns>The resulting byte array</returns>\n        public static byte[] ProtobufSerialize(this List<Tick> ticks, Guid guid)\n        {\n            byte[] result;\n            using (var stream = GetMemoryStream(guid))\n            {\n                Serializer.Serialize(stream, ticks);\n                result = stream.ToArray();\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Serialize a base data instance using protobuf\n        /// </summary>\n        /// <param name=\"baseData\">The data point to serialize</param>\n        /// <param name=\"guid\">Unique guid</param>\n        /// <returns>The resulting byte array</returns>\n        public static byte[] ProtobufSerialize(this IBaseData baseData, Guid guid)\n        {\n            byte[] result;\n            using (var stream = GetMemoryStream(guid))\n            {\n                baseData.ProtobufSerialize(stream);\n                result = stream.ToArray();\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Serialize a base data instance using protobuf\n        /// </summary>\n        /// <param name=\"baseData\">The data point to serialize</param>\n        /// <param name=\"stream\">The destination stream</param>\n        public static void ProtobufSerialize(this IBaseData baseData, Stream stream)\n        {\n            switch (baseData.DataType)\n            {\n                case MarketDataType.Tick:\n                    Serializer.SerializeWithLengthPrefix(stream, baseData as Tick, PrefixStyle.Base128, 1);\n                    break;\n                case MarketDataType.QuoteBar:\n                    Serializer.SerializeWithLengthPrefix(stream, baseData as QuoteBar, PrefixStyle.Base128, 1);\n                    break;\n                case MarketDataType.TradeBar:\n                    Serializer.SerializeWithLengthPrefix(stream, baseData as TradeBar, PrefixStyle.Base128, 1);\n                    break;\n                default:\n                    Serializer.SerializeWithLengthPrefix(stream, baseData as BaseData, PrefixStyle.Base128, 1);\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Extension method to get security price is 0 messages for users\n        /// </summary>\n        /// <remarks>The value of this method is normalization</remarks>\n        public static string GetZeroPriceMessage(this Symbol symbol)\n        {\n            return Messages.Extensions.ZeroPriceForSecurity(symbol);\n        }\n\n        /// <summary>\n        /// Converts the provided string into camel case notation\n        /// </summary>\n        public static string ToCamelCase(this string value)\n        {\n            if (string.IsNullOrEmpty(value))\n            {\n                return value;\n            }\n\n            if (value.Length == 1)\n            {\n                return value.ToLowerInvariant();\n            }\n            return char.ToLowerInvariant(value[0]) + value.Substring(1);\n        }\n\n        /// <summary>\n        /// Helper method to batch a collection of <see cref=\"AlphaResultPacket\"/> into 1 single instance.\n        /// Will return null if the provided list is empty. Will keep the last Order instance per order id,\n        /// which is the latest. Implementations trusts the provided 'resultPackets' list to batch is in order\n        /// </summary>\n        public static AlphaResultPacket Batch(this List<AlphaResultPacket> resultPackets)\n        {\n            AlphaResultPacket resultPacket = null;\n\n            // batch result packets into a single packet\n            if (resultPackets.Count > 0)\n            {\n                // we will batch results into the first packet\n                resultPacket = resultPackets[0];\n                for (var i = 1; i < resultPackets.Count; i++)\n                {\n                    var newerPacket = resultPackets[i];\n\n                    // only batch current packet if there actually is data\n                    if (newerPacket.Insights != null)\n                    {\n                        if (resultPacket.Insights == null)\n                        {\n                            // initialize the collection if it isn't there\n                            resultPacket.Insights = new List<Insight>();\n                        }\n                        resultPacket.Insights.AddRange(newerPacket.Insights);\n                    }\n\n                    // only batch current packet if there actually is data\n                    if (newerPacket.OrderEvents != null)\n                    {\n                        if (resultPacket.OrderEvents == null)\n                        {\n                            // initialize the collection if it isn't there\n                            resultPacket.OrderEvents = new List<OrderEvent>();\n                        }\n                        resultPacket.OrderEvents.AddRange(newerPacket.OrderEvents);\n                    }\n\n                    // only batch current packet if there actually is data\n                    if (newerPacket.Orders != null)\n                    {\n                        if (resultPacket.Orders == null)\n                        {\n                            // initialize the collection if it isn't there\n                            resultPacket.Orders = new List<Order>();\n                        }\n                        resultPacket.Orders.AddRange(newerPacket.Orders);\n\n                        // GroupBy guarantees to respect original order, so we want to get the last order instance per order id\n                        // this way we only keep the most updated version\n                        resultPacket.Orders = resultPacket.Orders.GroupBy(order => order.Id)\n                            .Select(ordersGroup => ordersGroup.Last()).ToList();\n                    }\n                }\n            }\n            return resultPacket;\n        }\n\n        /// <summary>\n        /// Helper method to safely stop a running thread\n        /// </summary>\n        /// <param name=\"thread\">The thread to stop</param>\n        /// <param name=\"timeout\">The timeout to wait till the thread ends after which abort will be called</param>\n        /// <param name=\"token\">Cancellation token source to use if any</param>\n        public static void StopSafely(this Thread thread, TimeSpan timeout, CancellationTokenSource token = null)\n        {\n            if (thread != null)\n            {\n                try\n                {\n                    if (token != null && !token.IsCancellationRequested)\n                    {\n                        token.Cancel(false);\n                    }\n                    Log.Trace($\"StopSafely(): {Messages.Extensions.WaitingForThreadToStopSafely(thread.Name)}\");\n                    // just in case we add a time out\n                    if (!thread.Join(timeout))\n                    {\n                        Log.Error($\"StopSafely(): {Messages.Extensions.TimeoutWaitingForThreadToStopSafely(thread.Name)}\");\n                    }\n                }\n                catch (Exception exception)\n                {\n                    // just in case catch any exceptions\n                    Log.Error(exception);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Generates a hash code from a given collection of orders\n        /// </summary>\n        /// <param name=\"orders\">The order collection</param>\n        /// <returns>The hash value</returns>\n        public static string GetHash(this IDictionary<int, Order> orders)\n        {\n            var joinedOrders = string.Join(\n                \",\",\n                orders\n                    .OrderBy(pair => pair.Key)\n                    .Select(pair =>\n                        {\n                            // this is required to avoid any small differences between python and C#\n                            var order = pair.Value;\n                            order.Price = order.Price.SmartRounding();\n                            var limit = order as LimitOrder;\n                            if (limit != null)\n                            {\n                                limit.LimitPrice = limit.LimitPrice.SmartRounding();\n                            }\n                            var stopLimit = order as StopLimitOrder;\n                            if (stopLimit != null)\n                            {\n                                stopLimit.LimitPrice = stopLimit.LimitPrice.SmartRounding();\n                                stopLimit.StopPrice = stopLimit.StopPrice.SmartRounding();\n                            }\n                            var trailingStop = order as TrailingStopOrder;\n                            if (trailingStop != null)\n                            {\n                                trailingStop.TrailingAmount = trailingStop.TrailingAmount.SmartRounding();\n                            }\n                            var stopMarket = order as StopMarketOrder;\n                            if (stopMarket != null)\n                            {\n                                stopMarket.StopPrice = stopMarket.StopPrice.SmartRounding();\n                            }\n                            var limitIfTouched = order as LimitIfTouchedOrder;\n                            if (limitIfTouched != null)\n                            {\n                                limitIfTouched.LimitPrice = limitIfTouched.LimitPrice.SmartRounding();\n                                limitIfTouched.TriggerPrice = limitIfTouched.TriggerPrice.SmartRounding();\n                            }\n                            return JsonConvert.SerializeObject(pair.Value, Formatting.None);\n                        }\n                    )\n            );\n\n            return joinedOrders.ToMD5();\n        }\n\n        /// <summary>\n        /// Converts a date rule into a function that receives current time\n        /// and returns the next date.\n        /// </summary>\n        /// <param name=\"dateRule\">The date rule to convert</param>\n        /// <returns>A function that will enumerate the provided date rules</returns>\n        public static Func<DateTime, DateTime?> ToFunc(this IDateRule dateRule)\n        {\n            IEnumerator<DateTime> dates = null;\n            return timeUtc =>\n            {\n                if (dates == null)\n                {\n                    dates = dateRule.GetDates(timeUtc, Time.EndOfTime).GetEnumerator();\n                    if (!dates.MoveNext())\n                    {\n                        return Time.EndOfTime;\n                    }\n                }\n\n                try\n                {\n                    // only advance enumerator if provided time is past or at our current\n                    if (timeUtc >= dates.Current)\n                    {\n                        if (!dates.MoveNext())\n                        {\n                            return Time.EndOfTime;\n                        }\n                    }\n                    return dates.Current;\n                }\n                catch (InvalidOperationException)\n                {\n                    // enumeration ended\n                    return Time.EndOfTime;\n                }\n            };\n        }\n\n        /// <summary>\n        /// Returns true if the specified <see cref=\"BaseSeries\"/> instance holds no <see cref=\"ISeriesPoint\"/>\n        /// </summary>\n        public static bool IsEmpty(this BaseSeries series)\n        {\n            return series.Values.Count == 0;\n        }\n\n        /// <summary>\n        /// Returns if the specified <see cref=\"Chart\"/> instance holds no <see cref=\"Series\"/>\n        /// or they are all empty <see cref=\"Extensions.IsEmpty(BaseSeries)\"/>\n        /// </summary>\n        public static bool IsEmpty(this Chart chart)\n        {\n            return chart.Series.Values.All(IsEmpty);\n        }\n\n        /// <summary>\n        /// Gets a python method by name\n        /// </summary>\n        /// <param name=\"instance\">The object instance to search the method in</param>\n        /// <param name=\"name\">The name of the method</param>\n        /// <returns>The python method or null if not defined or CSharp implemented</returns>\n        public static dynamic GetPythonMethod(this PyObject instance, string name)\n        {\n            using (Py.GIL())\n            {\n                PyObject method;\n\n                // Let's try first with snake-case style in case the user is using it\n                var snakeCasedNamed = name.ToSnakeCase();\n                if (snakeCasedNamed != name)\n                {\n                    method = instance.GetPythonMethodWithChecks(snakeCasedNamed);\n                    if (method != null)\n                    {\n                        return method;\n                    }\n                }\n\n                method = instance.GetAttr(name);\n                using var pythonType = method.GetPythonType();\n                var isPythonDefined = pythonType.Repr().Equals(\"<class \\'method\\'>\", StringComparison.Ordinal);\n\n                if (isPythonDefined)\n                {\n                    return method;\n                }\n                method.Dispose();\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Gets a python property by name\n        /// </summary>\n        /// <param name=\"instance\">The object instance to search the property in</param>\n        /// <param name=\"name\">The name of the property</param>\n        /// <returns>The python property or null if not defined or CSharp implemented</returns>\n        public static dynamic GetPythonBoolProperty(this PyObject instance, string name)\n        {\n            using (Py.GIL())\n            {\n                var objectType = instance.GetPythonType();\n                if (!objectType.HasAttr(name))\n                {\n                    return null;\n                }\n\n                var property = instance.GetAttr(name);\n                var pythonType = property.GetPythonType();\n                var isPythonDefined = pythonType.Repr().Equals(\"<class \\'bool\\'>\", StringComparison.Ordinal);\n\n                if (isPythonDefined)\n                {\n                    return property;\n                }\n\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Gets a python property by name\n        /// </summary>\n        /// <param name=\"instance\">The object instance to search the property in</param>\n        /// <param name=\"name\">The name of the method</param>\n        /// <returns>The python property or null if not defined or CSharp implemented</returns>\n        public static dynamic GetPythonBoolPropertyWithChecks(this PyObject instance, string name)\n        {\n            using (Py.GIL())\n            {\n                if (!instance.HasAttr(name))\n                {\n                    return null;\n                }\n\n                return instance.GetPythonBoolProperty(name);\n            }\n        }\n\n        /// <summary>\n        /// Gets a python method by name\n        /// </summary>\n        /// <param name=\"instance\">The object instance to search the method in</param>\n        /// <param name=\"name\">The name of the method</param>\n        /// <returns>The python method or null if not defined or CSharp implemented</returns>\n        public static dynamic GetPythonMethodWithChecks(this PyObject instance, string name)\n        {\n            using (Py.GIL())\n            {\n                if (!instance.HasAttr(name))\n                {\n                    return null;\n                }\n\n                return instance.GetPythonMethod(name);\n            }\n        }\n\n        /// <summary>\n        /// Gets a method from a <see cref=\"PyObject\"/> instance by name.\n        /// First, it tries to get the snake-case version of the method name, in case the user is using that style.\n        /// Else, it tries to get the method with the original name, regardless of whether the class has a Python overload or not.\n        /// </summary>\n        /// <param name=\"instance\">The object instance to search the method in</param>\n        /// <param name=\"name\">The name of the method</param>\n        /// <returns>The method matching the name</returns>\n        public static dynamic GetMethod(this PyObject instance, string name)\n        {\n            using var _ = Py.GIL();\n            return instance.GetPythonMethodWithChecks(name.ToSnakeCase()) ?? instance.GetAttr(name);\n        }\n\n        /// <summary>\n        /// Get a python methods arg count\n        /// </summary>\n        /// <param name=\"method\">The Python method</param>\n        /// <returns>Count of arguments</returns>\n        public static int GetPythonArgCount(this PyObject method)\n        {\n            using (Py.GIL())\n            {\n                int argCount;\n                var pyArgCount = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from inspect import signature\\n\" +\n                    \"def GetArgCount(method):\\n\" +\n                    \"   return len(signature(method).parameters)\\n\"\n                ).GetAttr(\"GetArgCount\").Invoke(method);\n                pyArgCount.TryConvert(out argCount);\n\n                return argCount;\n            }\n        }\n\n        /// <summary>\n        /// Returns an ordered enumerable where position reducing orders are executed first\n        /// and the remaining orders are executed in decreasing order value.\n        /// Will NOT return targets during algorithm warmup.\n        /// Will NOT return targets for securities that have no data yet.\n        /// Will NOT return targets for which current holdings + open orders quantity, sum up to the target quantity\n        /// </summary>\n        /// <param name=\"targets\">The portfolio targets to order by margin</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"targetIsDelta\">True if the target quantity is the delta between the\n        /// desired and existing quantity</param>\n        public static IEnumerable<IPortfolioTarget> OrderTargetsByMarginImpact(\n            this IEnumerable<IPortfolioTarget> targets,\n            IAlgorithm algorithm,\n            bool targetIsDelta = false)\n        {\n            if (algorithm.IsWarmingUp)\n            {\n                return Enumerable.Empty<IPortfolioTarget>();\n            }\n\n            return targets.Select(x =>\n                {\n                    var security = algorithm.Securities[x.Symbol];\n                    return new\n                    {\n                        PortfolioTarget = x,\n                        TargetQuantity = OrderSizing.AdjustByLotSize(security, x.Quantity),\n                        ExistingQuantity = algorithm.Transactions.GetProjectedHoldings(security).ProjectedQuantity,\n                        Security = security\n                    };\n                })\n                .Where(x => x.Security.HasData\n                            && x.Security.IsTradable\n                            && (targetIsDelta ? Math.Abs(x.TargetQuantity) : Math.Abs(x.TargetQuantity - x.ExistingQuantity))\n                            >= x.Security.SymbolProperties.LotSize\n                )\n                .Select(x => new\n                {\n                    x.PortfolioTarget,\n                    OrderValue = Math.Abs((targetIsDelta ? x.TargetQuantity : (x.TargetQuantity - x.ExistingQuantity)) * x.Security.Price),\n                    IsReducingPosition = x.ExistingQuantity != 0\n                                         && Math.Abs((targetIsDelta ? (x.TargetQuantity + x.ExistingQuantity) : x.TargetQuantity)) < Math.Abs(x.ExistingQuantity)\n                })\n                .OrderByDescending(x => x.IsReducingPosition)\n                .ThenByDescending(x => x.OrderValue)\n                .Select(x => x.PortfolioTarget);\n        }\n\n        /// <summary>\n        /// Given a type will create a new instance using the parameterless constructor\n        /// and assert the type implements <see cref=\"BaseData\"/>\n        /// </summary>\n        /// <remarks>One of the objectives of this method is to normalize the creation of the\n        /// BaseData instances while reducing code duplication</remarks>\n        public static BaseData GetBaseDataInstance(this Type type)\n        {\n            var objectActivator = ObjectActivator.GetActivator(type);\n            if (objectActivator == null)\n            {\n                throw new ArgumentException(Messages.Extensions.DataTypeMissingParameterlessConstructor(type));\n            }\n\n            var instance = objectActivator.Invoke(new object[] { type });\n            if (instance == null)\n            {\n                // shouldn't happen but just in case...\n                throw new ArgumentException(Messages.Extensions.FailedToCreateInstanceOfType(type));\n            }\n\n            // we expect 'instance' to inherit BaseData in most cases so we use 'as' versus 'IsAssignableFrom'\n            // since it is slightly cheaper\n            var result = instance as BaseData;\n            if (result == null)\n            {\n                throw new ArgumentException(Messages.Extensions.TypeIsNotBaseData(type));\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method that will cast the provided <see cref=\"PyObject\"/>\n        /// to a T type and dispose of it.\n        /// </summary>\n        /// <typeparam name=\"T\">The target type</typeparam>\n        /// <param name=\"instance\">The <see cref=\"PyObject\"/> instance to cast and dispose</param>\n        /// <returns>The instance of type T. Will return default value if\n        /// provided instance is null</returns>\n        public static T GetAndDispose<T>(this PyObject instance)\n        {\n            if (instance == null)\n            {\n                return default(T);\n            }\n            var returnInstance = instance.As<T>();\n            // will reduce ref count\n            instance.Dispose();\n            return returnInstance;\n        }\n\n        /// <summary>\n        /// Extension to move one element from list from A to position B.\n        /// </summary>\n        /// <typeparam name=\"T\">Type of list</typeparam>\n        /// <param name=\"list\">List we're operating on.</param>\n        /// <param name=\"oldIndex\">Index of variable we want to move.</param>\n        /// <param name=\"newIndex\">New location for the variable</param>\n        public static void Move<T>(this List<T> list, int oldIndex, int newIndex)\n        {\n            var oItem = list[oldIndex];\n            list.RemoveAt(oldIndex);\n            if (newIndex > oldIndex) newIndex--;\n            list.Insert(newIndex, oItem);\n        }\n\n        /// <summary>\n        /// Extension method to convert a string into a byte array\n        /// </summary>\n        /// <param name=\"str\">String to convert to bytes.</param>\n        /// <returns>Byte array</returns>\n        public static byte[] GetBytes(this string str)\n        {\n            var bytes = new byte[str.Length * sizeof(char)];\n            Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);\n            return bytes;\n        }\n\n        /// <summary>\n        /// Reads the entire content of a stream and returns it as a byte array.\n        /// </summary>\n        /// <param name=\"stream\">Stream to read bytes from</param>\n        /// <returns>The bytes read from the stream</returns>\n        public static byte[] GetBytes(this Stream stream)\n        {\n            using var memoryStream = new MemoryStream();\n            stream.CopyTo(memoryStream);\n            return memoryStream.ToArray();\n        }\n\n        /// <summary>\n        /// Deserialize a json stream into an object of type T\n        /// </summary>\n        /// <param name=\"stream\">The stream to deserialize</param>\n        /// <param name=\"serializer\">The json serializer to use</param>\n        /// <param name=\"leaveOpen\">Whether to leave the source stream open</param>\n        /// <returns>The deserialized object</returns>\n        public static T DeserializeJson<T>(this Stream stream, JsonSerializer serializer = null, bool leaveOpen = true)\n        {\n            using var streamReader = new StreamReader(stream, leaveOpen: leaveOpen);\n            using var jsonReader = new JsonTextReader(streamReader);\n            return (serializer ?? JsonSerializer).Deserialize<T>(jsonReader);\n        }\n\n        /// <summary>\n        /// Deserialize a json stream into an object of type T\n        /// </summary>\n        /// <param name=\"content\">The string to deserialize</param>\n        /// <param name=\"serializer\">The json serializer to use</param>\n        /// <returns>The deserialized object</returns>\n        public static T DeserializeJson<T>(this string content, JsonSerializer serializer = null)\n        {\n            using var stringReader = new StringReader(content);\n            using var jsonReader = new JsonTextReader(stringReader);\n            return (serializer ?? JsonSerializer).Deserialize<T>(jsonReader);\n        }\n\n        /// <summary>\n        /// Serialize an object of type T into a json stream\n        /// </summary>\n        /// <param name=\"value\">The object to serialize</param>\n        /// <param name=\"target\">The stream to serialize the object to</param>\n        /// <param name=\"serializer\">The json serializer to use</param>\n        public static void SerializeJsonToStream<T>(this T value, Stream target, JsonSerializer serializer = null)\n        {\n            using var writer = new StreamWriter(target, leaveOpen: true);\n            using var jsonWriter = new JsonTextWriter(writer);\n            (serializer ?? JsonSerializer).Serialize(jsonWriter, value);\n            jsonWriter.Flush();\n            target.Position = 0;\n        }\n\n        /// <summary>\n        /// Serialize an object of type T into a json stream\n        /// </summary>\n        /// <param name=\"value\">The object to serialize</param>\n        /// <param name=\"serializer\">The json serializer to use</param>\n        /// <returns>The serialized string</returns>\n        public static string SerializeJsonToString<T>(this T value, JsonSerializer serializer = null)\n        {\n            using var stringWriter = new StringWriter();\n            using var jsonWriter = new JsonTextWriter(stringWriter);\n            (serializer ?? JsonSerializer).Serialize(jsonWriter, value);\n            return stringWriter.ToString();\n        }\n\n        /// <summary>\n        /// Extentsion method to clear all items from a thread safe queue\n        /// </summary>\n        /// <remarks>Small risk of race condition if a producer is adding to the list.</remarks>\n        /// <typeparam name=\"T\">Queue type</typeparam>\n        /// <param name=\"queue\">queue object</param>\n        public static void Clear<T>(this ConcurrentQueue<T> queue)\n        {\n            T item;\n            while (queue.TryDequeue(out item))\n            {\n                // NOP\n            }\n        }\n\n        /// <summary>\n        /// Extension method to convert a byte array into a string.\n        /// </summary>\n        /// <param name=\"bytes\">Byte array to convert.</param>\n        /// <param name=\"encoding\">The encoding to use for the conversion. Defaults to Encoding.ASCII</param>\n        /// <returns>String from bytes.</returns>\n        public static string GetString(this byte[] bytes, Encoding encoding = null)\n        {\n            if (encoding == null) encoding = Encoding.ASCII;\n\n            return encoding.GetString(bytes);\n        }\n\n        /// <summary>\n        /// Extension method to convert a string to a MD5 hash.\n        /// </summary>\n        /// <param name=\"str\">String we want to MD5 encode.</param>\n        /// <returns>MD5 hash of a string</returns>\n        public static string ToMD5(this string str)\n        {\n            var builder = new StringBuilder(32);\n            var data = MD5.HashData(Encoding.UTF8.GetBytes(str));\n            for (var i = 0; i < 16; i++)\n            {\n                builder.Append(data[i].ToStringInvariant(\"x2\"));\n            }\n            return builder.ToString();\n        }\n\n        /// <summary>\n        /// Encrypt the token:time data to make our API hash.\n        /// </summary>\n        /// <param name=\"data\">Data to be hashed by SHA256</param>\n        /// <returns>Hashed string.</returns>\n        public static string ToSHA256(this string data)\n        {\n            var hash = new StringBuilder(64);\n            var crypto = SHA256.HashData(Encoding.UTF8.GetBytes(data));\n            for (var i = 0; i < 32; i++)\n            {\n                hash.Append(crypto[i].ToStringInvariant(\"x2\"));\n            }\n            return hash.ToString();\n        }\n\n        /// <summary>\n        /// Converts a long to an uppercase alpha numeric string\n        /// </summary>\n        public static string EncodeBase36(this ulong data)\n        {\n            var stack = new Stack<char>(15);\n            while (data != 0)\n            {\n                var value = data % 36;\n                var c = value < 10\n                    ? (char)(value + '0')\n                    : (char)(value - 10 + 'A');\n\n                stack.Push(c);\n                data /= 36;\n            }\n            return new string(stack.ToArray());\n        }\n\n        /// <summary>\n        /// Converts an upper case alpha numeric string into a long\n        /// </summary>\n        public static ulong DecodeBase36(this string symbol)\n        {\n            var result = 0ul;\n            var baseValue = 1ul;\n            for (var i = symbol.Length - 1; i > -1; i--)\n            {\n                var c = symbol[i];\n\n                // assumes alpha numeric upper case only strings\n                var value = (uint)(c <= 57\n                    ? c - '0'\n                    : c - 'A' + 10);\n\n                result += baseValue * value;\n                baseValue *= 36;\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Convert a string to Base64 Encoding\n        /// </summary>\n        /// <param name=\"text\">Text to encode</param>\n        /// <returns>Encoded result</returns>\n        public static string EncodeBase64(this string text)\n        {\n            if (string.IsNullOrEmpty(text))\n            {\n                return text;\n            }\n\n            byte[] textBytes = Encoding.UTF8.GetBytes(text);\n            return Convert.ToBase64String(textBytes);\n        }\n\n        /// <summary>\n        /// Decode a Base64 Encoded string\n        /// </summary>\n        /// <param name=\"base64EncodedText\">Text to decode</param>\n        /// <returns>Decoded result</returns>\n        public static string DecodeBase64(this string base64EncodedText)\n        {\n            if (string.IsNullOrEmpty(base64EncodedText))\n            {\n                return base64EncodedText;\n            }\n\n            byte[] base64EncodedBytes = Convert.FromBase64String(base64EncodedText);\n            return Encoding.UTF8.GetString(base64EncodedBytes);\n        }\n\n        /// <summary>\n        /// Lazy string to upper implementation.\n        /// Will first verify the string is not already upper and avoid\n        /// the call to <see cref=\"string.ToUpperInvariant()\"/> if possible.\n        /// </summary>\n        /// <param name=\"data\">The string to upper</param>\n        /// <returns>The upper string</returns>\n        public static string LazyToUpper(this string data)\n        {\n            // for performance only call to upper if required\n            var alreadyUpper = true;\n            for (int i = 0; i < data.Length && alreadyUpper; i++)\n            {\n                alreadyUpper = char.IsUpper(data[i]);\n            }\n            return alreadyUpper ? data : data.ToUpperInvariant();\n        }\n\n        /// <summary>\n        /// Lazy string to lower implementation.\n        /// Will first verify the string is not already lower and avoid\n        /// the call to <see cref=\"string.ToLowerInvariant()\"/> if possible.\n        /// </summary>\n        /// <param name=\"data\">The string to lower</param>\n        /// <returns>The lower string</returns>\n        public static string LazyToLower(this string data)\n        {\n            // for performance only call to lower if required\n            var alreadyLower = true;\n            for (int i = 0; i < data.Length && alreadyLower; i++)\n            {\n                alreadyLower = char.IsLower(data[i]);\n            }\n            return alreadyLower ? data : data.ToLowerInvariant();\n        }\n\n        /// <summary>\n        /// Extension method to automatically set the update value to same as \"add\" value for TryAddUpdate.\n        /// This makes the API similar for traditional and concurrent dictionaries.\n        /// </summary>\n        /// <typeparam name=\"K\">Key type for dictionary</typeparam>\n        /// <typeparam name=\"V\">Value type for dictonary</typeparam>\n        /// <param name=\"dictionary\">Dictionary object we're operating on</param>\n        /// <param name=\"key\">Key we want to add or update.</param>\n        /// <param name=\"value\">Value we want to set.</param>\n        public static void AddOrUpdate<K, V>(this ConcurrentDictionary<K, V> dictionary, K key, V value)\n        {\n            dictionary.AddOrUpdate(key, value, (oldkey, oldvalue) => value);\n        }\n\n        /// <summary>\n        /// Extension method to automatically add/update lazy values in concurrent dictionary.\n        /// </summary>\n        /// <typeparam name=\"TKey\">Key type for dictionary</typeparam>\n        /// <typeparam name=\"TValue\">Value type for dictonary</typeparam>\n        /// <param name=\"dictionary\">Dictionary object we're operating on</param>\n        /// <param name=\"key\">Key we want to add or update.</param>\n        /// <param name=\"addValueFactory\">The function used to generate a value for an absent key</param>\n        /// <param name=\"updateValueFactory\">The function used to generate a new value for an existing key based on the key's existing value</param>\n        public static TValue AddOrUpdate<TKey, TValue>(this ConcurrentDictionary<TKey, Lazy<TValue>> dictionary, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)\n        {\n            var result = dictionary.AddOrUpdate(key, new Lazy<TValue>(() => addValueFactory(key)), (key2, old) => new Lazy<TValue>(() => updateValueFactory(key2, old.Value)));\n            return result.Value;\n        }\n\n        /// <summary>\n        /// Adds the specified element to the collection with the specified key. If an entry does not exist for the\n        /// specified key then one will be created.\n        /// </summary>\n        /// <typeparam name=\"TKey\">The key type</typeparam>\n        /// <typeparam name=\"TElement\">The collection element type</typeparam>\n        /// <typeparam name=\"TCollection\">The collection type</typeparam>\n        /// <param name=\"dictionary\">The source dictionary to be added to</param>\n        /// <param name=\"key\">The key</param>\n        /// <param name=\"element\">The element to be added</param>\n        public static void Add<TKey, TElement, TCollection>(this IDictionary<TKey, TCollection> dictionary, TKey key, TElement element)\n            where TCollection : ICollection<TElement>, new()\n        {\n            TCollection list;\n            if (!dictionary.TryGetValue(key, out list))\n            {\n                list = new TCollection();\n                dictionary.Add(key, list);\n            }\n            list.Add(element);\n        }\n\n        /// <summary>\n        /// Adds the specified element to the collection with the specified key. If an entry does not exist for the\n        /// specified key then one will be created.\n        /// </summary>\n        /// <typeparam name=\"TKey\">The key type</typeparam>\n        /// <typeparam name=\"TElement\">The collection element type</typeparam>\n        /// <param name=\"dictionary\">The source dictionary to be added to</param>\n        /// <param name=\"key\">The key</param>\n        /// <param name=\"element\">The element to be added</param>\n        public static ImmutableDictionary<TKey, ImmutableHashSet<TElement>> Add<TKey, TElement>(\n            this ImmutableDictionary<TKey, ImmutableHashSet<TElement>> dictionary,\n            TKey key,\n            TElement element\n            )\n        {\n            ImmutableHashSet<TElement> set;\n            if (!dictionary.TryGetValue(key, out set))\n            {\n                set = ImmutableHashSet<TElement>.Empty.Add(element);\n                return dictionary.Add(key, set);\n            }\n\n            return dictionary.SetItem(key, set.Add(element));\n        }\n\n        /// <summary>\n        /// Adds the specified element to the collection with the specified key. If an entry does not exist for the\n        /// specified key then one will be created.\n        /// </summary>\n        /// <typeparam name=\"TKey\">The key type</typeparam>\n        /// <typeparam name=\"TElement\">The collection element type</typeparam>\n        /// <param name=\"dictionary\">The source dictionary to be added to</param>\n        /// <param name=\"key\">The key</param>\n        /// <param name=\"element\">The element to be added</param>\n        public static ImmutableSortedDictionary<TKey, ImmutableHashSet<TElement>> Add<TKey, TElement>(\n            this ImmutableSortedDictionary<TKey, ImmutableHashSet<TElement>> dictionary,\n            TKey key,\n            TElement element\n            )\n        {\n            ImmutableHashSet<TElement> set;\n            if (!dictionary.TryGetValue(key, out set))\n            {\n                set = ImmutableHashSet<TElement>.Empty.Add(element);\n                return dictionary.Add(key, set);\n            }\n\n            return dictionary.SetItem(key, set.Add(element));\n        }\n\n        /// <summary>\n        /// Adds the specified Tick to the Ticks collection. If an entry does not exist for the specified key then one will be created.\n        /// </summary>\n        /// <param name=\"dictionary\">The ticks dictionary</param>\n        /// <param name=\"key\">The symbol</param>\n        /// <param name=\"tick\">The tick to add</param>\n        /// <remarks>For performance we implement this method based on <see cref=\"Add{TKey,TElement,TCollection}\"/></remarks>\n        public static void Add(this Ticks dictionary, Symbol key, Tick tick)\n        {\n            List<Tick> list;\n            if (!dictionary.TryGetValue(key, out list))\n            {\n                dictionary[key] = list = new List<Tick>(1);\n            }\n            list.Add(tick);\n        }\n\n        /// <summary>\n        /// Extension method to round a double value to a fixed number of significant figures instead of a fixed decimal places.\n        /// </summary>\n        /// <param name=\"d\">Double we're rounding</param>\n        /// <param name=\"digits\">Number of significant figures</param>\n        /// <returns>New double rounded to digits-significant figures</returns>\n        public static decimal RoundToSignificantDigits(this decimal d, int digits)\n        {\n            if (d == 0) return 0;\n            var scale = (decimal)Math.Pow(10, Math.Floor(Math.Log10((double)Math.Abs(d))) + 1);\n            return scale * Math.Round(d / scale, digits);\n        }\n\n        /// <summary>\n        /// Converts a decimal into a rounded number ending with K (thousands), M (millions), B (billions), etc.\n        /// </summary>\n        /// <param name=\"number\">Number to convert</param>\n        /// <returns>Formatted number with figures written in shorthand form</returns>\n        public static string ToFinancialFigures(this decimal number)\n        {\n            if (number < 1000)\n            {\n                return number.ToStringInvariant();\n            }\n\n            // Subtract by multiples of 5 to round down to nearest round number\n            if (number < 10000)\n            {\n                return (number - 5m).ToString(\"#,.##\", CultureInfo.InvariantCulture) + \"K\";\n            }\n\n            if (number < 100000)\n            {\n                return (number - 50m).ToString(\"#,.#\", CultureInfo.InvariantCulture) + \"K\";\n            }\n\n            if (number < 1000000)\n            {\n                return (number - 500m).ToString(\"#,.\", CultureInfo.InvariantCulture) + \"K\";\n            }\n\n            if (number < 10000000)\n            {\n                return (number - 5000m).ToString(\"#,,.##\", CultureInfo.InvariantCulture) + \"M\";\n            }\n\n            if (number < 100000000)\n            {\n                return (number - 50000m).ToString(\"#,,.#\", CultureInfo.InvariantCulture) + \"M\";\n            }\n\n            if (number < 1000000000)\n            {\n                return (number - 500000m).ToString(\"#,,.\", CultureInfo.InvariantCulture) + \"M\";\n            }\n\n            return (number - 5000000m).ToString(\"#,,,.##\", CultureInfo.InvariantCulture) + \"B\";\n        }\n\n        /// <summary>\n        /// Discretizes the <paramref name=\"value\"/> to a maximum precision specified by <paramref name=\"quanta\"/>. Quanta\n        /// can be an arbitrary positive number and represents the step size. Consider a quanta equal to 0.15 and rounding\n        /// a value of 1.0. Valid values would be 0.9 (6 quanta) and 1.05 (7 quanta) which would be rounded up to 1.05.\n        /// </summary>\n        /// <param name=\"value\">The value to be rounded by discretization</param>\n        /// <param name=\"quanta\">The maximum precision allowed by the value</param>\n        /// <param name=\"mode\">Specifies how to handle the rounding of half value, defaulting to away from zero.</param>\n        /// <returns></returns>\n        public static decimal DiscretelyRoundBy(this decimal value, decimal quanta, MidpointRounding mode = MidpointRounding.AwayFromZero)\n        {\n            if (quanta == 0m)\n            {\n                return value;\n            }\n\n            // away from zero is the 'common sense' rounding.\n            // +0.5 rounded by 1 yields +1\n            // -0.5 rounded by 1 yields -1\n            var multiplicand = Math.Round(value / quanta, mode);\n            return quanta * multiplicand;\n        }\n\n        /// <summary>\n        /// Will truncate the provided decimal, without rounding, to 3 decimal places\n        /// </summary>\n        /// <param name=\"value\">The value to truncate</param>\n        /// <returns>New instance with just 3 decimal places</returns>\n        public static decimal TruncateTo3DecimalPlaces(this decimal value)\n        {\n            // we will multiply by 1k bellow, if its bigger it will stack overflow\n            if (value >= decimal.MaxValue / 1000\n                || value <= decimal.MinValue / 1000\n                || value == 0)\n            {\n                return value;\n            }\n\n            return Math.Truncate(1000 * value) / 1000;\n        }\n\n        /// <summary>\n        /// Provides global smart rounding, numbers larger than 1000 will round to 4 decimal places,\n        /// while numbers smaller will round to 7 significant digits\n        /// </summary>\n        public static decimal? SmartRounding(this decimal? input)\n        {\n            if (!input.HasValue)\n            {\n                return null;\n            }\n            return input.Value.SmartRounding();\n        }\n\n        /// <summary>\n        /// Provides global smart rounding, numbers larger than 1000 will round to 4 decimal places,\n        /// while numbers smaller will round to 7 significant digits\n        /// </summary>\n        public static decimal SmartRounding(this decimal input)\n        {\n            input = Normalize(input);\n\n            // any larger numbers we still want some decimal places\n            if (input > 1000)\n            {\n                return Math.Round(input, 4);\n            }\n\n            // this is good for forex and other small numbers\n            return input.RoundToSignificantDigits(7).Normalize();\n        }\n\n        /// <summary>\n        /// Provides global smart rounding to a shorter version\n        /// </summary>\n        public static decimal SmartRoundingShort(this decimal input)\n        {\n            input = Normalize(input);\n            if (input <= 1)\n            {\n                // 0.99 > input\n                return input;\n            }\n            else if (input <= 10)\n            {\n                // 1.01 to 9.99\n                return Math.Round(input, 2);\n            }\n            else if (input <= 100)\n            {\n                // 99.9 to 10.1\n                return Math.Round(input, 1);\n            }\n            // 100 to inf\n            return Math.Truncate(input);\n        }\n\n        /// <summary>\n        /// Casts the specified input value to a decimal while acknowledging the overflow conditions\n        /// </summary>\n        /// <param name=\"input\">The value to be cast</param>\n        /// <returns>The input value as a decimal, if the value is too large or to small to be represented\n        /// as a decimal, then the closest decimal value will be returned</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal SafeDecimalCast(this double input)\n        {\n            if (input.IsNaNOrInfinity())\n            {\n                throw new ArgumentException(\n                    Messages.Extensions.CannotCastNonFiniteFloatingPointValueToDecimal(input),\n                    nameof(input),\n                    new NotFiniteNumberException(input)\n                );\n            }\n\n            if (input <= (double)decimal.MinValue) return decimal.MinValue;\n            if (input >= (double)decimal.MaxValue) return decimal.MaxValue;\n            return (decimal)input;\n        }\n\n        /// <summary>\n        /// Will remove any trailing zeros for the provided decimal input\n        /// </summary>\n        /// <param name=\"input\">The <see cref=\"decimal\"/> to remove trailing zeros from</param>\n        /// <returns>Provided input with no trailing zeros</returns>\n        /// <remarks>Will not have the expected behavior when called from Python,\n        /// since the returned <see cref=\"decimal\"/> will be converted to python float,\n        /// <see cref=\"NormalizeToStr\"/></remarks>\n        public static decimal Normalize(this decimal input)\n        {\n            // http://stackoverflow.com/a/7983330/1582922\n            return input / 1.000000000000000000000000000000000m;\n        }\n\n        /// <summary>\n        /// Will remove any trailing zeros for the provided decimal and convert to string.\n        /// Uses <see cref=\"Normalize(decimal)\"/>.\n        /// </summary>\n        /// <param name=\"input\">The <see cref=\"decimal\"/> to convert to <see cref=\"string\"/></param>\n        /// <returns>Input converted to <see cref=\"string\"/> with no trailing zeros</returns>\n        public static string NormalizeToStr(this decimal input)\n        {\n            return Normalize(input).ToString(CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Helper method to determine the amount of decimal places associated with the given decimal\n        /// </summary>\n        /// <param name=\"input\">The value to get the decimal count from</param>\n        /// <returns>The quantity of decimal places</returns>\n        public static int GetDecimalPlaces(this decimal input)\n        {\n            return BitConverter.GetBytes(decimal.GetBits(input)[3])[2];\n        }\n\n        /// <summary>\n        /// Extension method for faster string to decimal conversion.\n        /// </summary>\n        /// <param name=\"str\">String to be converted to positive decimal value</param>\n        /// <remarks>\n        /// Leading and trailing whitespace chars are ignored\n        /// </remarks>\n        /// <returns>Decimal value of the string</returns>\n        public static decimal ToDecimal(this string str)\n        {\n            long value = 0;\n            var decimalPlaces = 0;\n            var hasDecimals = false;\n            var index = 0;\n            var length = str.Length;\n\n            while (index < length && char.IsWhiteSpace(str[index]))\n            {\n                index++;\n            }\n\n            var isNegative = index < length && str[index] == '-';\n            if (isNegative)\n            {\n                index++;\n            }\n\n            while (index < length)\n            {\n                var ch = str[index++];\n                if (ch == '.')\n                {\n                    hasDecimals = true;\n                    decimalPlaces = 0;\n                }\n                else if (char.IsWhiteSpace(ch))\n                {\n                    break;\n                }\n                else\n                {\n                    value = value * 10 + (ch - '0');\n                    decimalPlaces++;\n                }\n            }\n\n            var lo = (int)value;\n            var mid = (int)(value >> 32);\n            return new decimal(lo, mid, 0, isNegative, (byte)(hasDecimals ? decimalPlaces : 0));\n        }\n\n        /// <summary>\n        /// Extension method for faster string to normalized decimal conversion, i.e. 20.0% should be parsed into 0.2\n        /// </summary>\n        /// <param name=\"str\">String to be converted to positive decimal value</param>\n        /// <remarks>\n        /// Leading and trailing whitespace chars are ignored\n        /// </remarks>\n        /// <returns>Decimal value of the string</returns>\n        public static decimal ToNormalizedDecimal(this string str)\n        {\n            var trimmed = str.Trim();\n            var value = str.TrimEnd('%').ToDecimal();\n            if (trimmed.EndsWith(\"%\"))\n            {\n                value /= 100;\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Extension method for string to decimal conversion where string can represent a number with exponent xe-y\n        /// </summary>\n        /// <param name=\"str\">String to be converted to decimal value</param>\n        /// <returns>Decimal value of the string</returns>\n        public static decimal ToDecimalAllowExponent(this string str)\n        {\n            return decimal.Parse(str, NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Extension method for faster string to Int32 conversion.\n        /// </summary>\n        /// <param name=\"str\">String to be converted to positive Int32 value</param>\n        /// <remarks>Method makes some assuptions - always numbers, no \"signs\" +,- etc.</remarks>\n        /// <returns>Int32 value of the string</returns>\n        public static int ToInt32(this string str)\n        {\n            int value = 0;\n            for (var i = 0; i < str.Length; i++)\n            {\n                if (str[i] == '.')\n                    break;\n\n                value = value * 10 + (str[i] - '0');\n            }\n            return value;\n        }\n\n        /// <summary>\n        /// Extension method for faster string to Int64 conversion.\n        /// </summary>\n        /// <param name=\"str\">String to be converted to positive Int64 value</param>\n        /// <remarks>Method makes some assuptions - always numbers, no \"signs\" +,- etc.</remarks>\n        /// <returns>Int32 value of the string</returns>\n        public static long ToInt64(this string str)\n        {\n            long value = 0;\n            for (var i = 0; i < str.Length; i++)\n            {\n                if (str[i] == '.')\n                    break;\n\n                value = value * 10 + (str[i] - '0');\n            }\n            return value;\n        }\n\n        /// <summary>\n        /// Helper method to determine if a data type implements the Stream reader method\n        /// </summary>\n        public static bool ImplementsStreamReader(this Type baseDataType)\n        {\n            // we know these type implement the streamReader interface lets avoid dynamic reflection call to figure it out\n            if (baseDataType == typeof(TradeBar) || baseDataType == typeof(QuoteBar) || baseDataType == typeof(Tick))\n            {\n                return true;\n            }\n\n            var method = baseDataType.GetMethod(\"Reader\",\n                new[] { typeof(SubscriptionDataConfig), typeof(StreamReader), typeof(DateTime), typeof(bool) });\n            if (method != null && method.DeclaringType == baseDataType)\n            {\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Breaks the specified string into csv components, all commas are considered separators\n        /// </summary>\n        /// <param name=\"str\">The string to be broken into csv</param>\n        /// <param name=\"size\">The expected size of the output list</param>\n        /// <returns>A list of the csv pieces</returns>\n        public static List<string> ToCsv(this string str, int size = 4)\n        {\n            int last = 0;\n            var csv = new List<string>(size);\n            for (int i = 0; i < str.Length; i++)\n            {\n                if (str[i] == ',')\n                {\n                    if (last != 0) last = last + 1;\n                    csv.Add(str.Substring(last, i - last));\n                    last = i;\n                }\n            }\n            if (last != 0) last = last + 1;\n            csv.Add(str.Substring(last));\n            return csv;\n        }\n\n        /// <summary>\n        /// Breaks the specified string into csv components, works correctly with commas in data fields\n        /// </summary>\n        /// <param name=\"str\">The string to be broken into csv</param>\n        /// <param name=\"size\">The expected size of the output list</param>\n        /// <param name=\"delimiter\">The delimiter used to separate entries in the line</param>\n        /// <returns>A list of the csv pieces</returns>\n        public static List<string> ToCsvData(this string str, int size = 4, char delimiter = ',')\n        {\n            var csv = new List<string>(size);\n\n            var last = -1;\n            var count = 0;\n            var textDataField = false;\n\n            for (var i = 0; i < str.Length; i++)\n            {\n                var current = str[i];\n                if (current == '\"')\n                {\n                    textDataField = !textDataField;\n                }\n                else if (!textDataField && current == delimiter)\n                {\n                    csv.Add(str.Substring(last + 1, (i - last)).Trim(' ', ','));\n                    last = i;\n                    count++;\n                }\n            }\n\n            if (last != 0)\n            {\n                csv.Add(str.Substring(last + 1).Trim());\n            }\n\n            return csv;\n        }\n\n        /// <summary>\n        /// Gets the value at the specified index from a CSV line.\n        /// </summary>\n        /// <param name=\"csvLine\">The CSV line</param>\n        /// <param name=\"index\">The index of the value to be extracted from the CSV line</param>\n        /// <param name=\"result\">The value at the given index</param>\n        /// <returns>Whether there was a value at the given index and could be extracted</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool TryGetFromCsv(this string csvLine, int index, out ReadOnlySpan<char> result)\n        {\n            result = ReadOnlySpan<char>.Empty;\n            if (string.IsNullOrEmpty(csvLine) || index < 0)\n            {\n                return false;\n            }\n\n            var span = csvLine.AsSpan();\n            for (int i = 0; i < index; i++)\n            {\n                var commaIndex = span.IndexOf(',');\n                if (commaIndex == -1)\n                {\n                    return false;\n                }\n                span = span.Slice(commaIndex + 1);\n            }\n\n            var nextCommaIndex = span.IndexOf(',');\n            if (nextCommaIndex == -1)\n            {\n                nextCommaIndex = span.Length;\n            }\n\n            result = span.Slice(0, nextCommaIndex);\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the value at the specified index from a CSV line, converted into a decimal.\n        /// </summary>\n        /// <param name=\"csvLine\">The CSV line</param>\n        /// <param name=\"index\">The index of the value to be extracted from the CSV line</param>\n        /// <param name=\"value\">The decimal value at the given index</param>\n        /// <returns>Whether there was a value at the given index and could be extracted and converted into a decimal</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool TryGetDecimalFromCsv(this string csvLine, int index, out decimal value)\n        {\n            value = decimal.Zero;\n            if (!csvLine.TryGetFromCsv(index, out var csvValue))\n            {\n                return false;\n            }\n\n            return decimal.TryParse(csvValue, NumberStyles.Any, CultureInfo.InvariantCulture, out value);\n        }\n\n        /// <summary>\n        /// Gets the value at the specified index from a CSV line, converted into a decimal.\n        /// </summary>\n        /// <param name=\"csvLine\">The CSV line</param>\n        /// <param name=\"index\">The index of the value to be extracted from the CSV line</param>\n        /// <returns>The decimal value at the given index. If the index is invalid or conversion fails, it will return zero</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal GetDecimalFromCsv(this string csvLine, int index)\n        {\n            csvLine.TryGetDecimalFromCsv(index, out var value);\n            return value;\n        }\n\n        /// <summary>\n        /// Check if a number is NaN or infinity\n        /// </summary>\n        /// <param name=\"value\">The double value to check</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsNaNOrInfinity(this double value)\n        {\n            return double.IsNaN(value) || double.IsInfinity(value);\n        }\n\n        /// <summary>\n        /// Check if a number is NaN or equal to zero\n        /// </summary>\n        /// <param name=\"value\">The double value to check</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsNaNOrZero(this double value)\n        {\n            return double.IsNaN(value) || Math.Abs(value) < double.Epsilon;\n        }\n\n        /// <summary>\n        /// Gets the smallest positive number that can be added to a decimal instance and return\n        /// a new value that does not == the old value\n        /// </summary>\n        public static decimal GetDecimalEpsilon()\n        {\n            return new decimal(1, 0, 0, false, 27); //1e-27m;\n        }\n\n        /// <summary>\n        /// Extension method to extract the extension part of this file name if it matches a safe list, or return a \".custom\" extension for ones which do not match.\n        /// </summary>\n        /// <param name=\"str\">String we're looking for the extension for.</param>\n        /// <returns>Last 4 character string of string.</returns>\n        public static string GetExtension(this string str)\n        {\n            var ext = str.Substring(Math.Max(0, str.Length - 4));\n            var allowedExt = new List<string> { \".zip\", \".csv\", \".json\", \".tsv\" };\n            if (!allowedExt.Contains(ext))\n            {\n                ext = \".custom\";\n            }\n            return ext;\n        }\n\n        /// <summary>\n        /// Extension method to convert strings to stream to be read.\n        /// </summary>\n        /// <param name=\"str\">String to convert to stream</param>\n        /// <returns>Stream instance</returns>\n        public static Stream ToStream(this string str)\n        {\n            var stream = new MemoryStream();\n            var writer = new StreamWriter(stream);\n            writer.Write(str);\n            writer.Flush();\n            stream.Position = 0;\n            return stream;\n        }\n\n        /// <summary>\n        /// Extension method to round a timeSpan to nearest timespan period.\n        /// </summary>\n        /// <param name=\"time\">TimeSpan To Round</param>\n        /// <param name=\"roundingInterval\">Rounding Unit</param>\n        /// <param name=\"roundingType\">Rounding method</param>\n        /// <returns>Rounded timespan</returns>\n        public static TimeSpan Round(this TimeSpan time, TimeSpan roundingInterval, MidpointRounding roundingType)\n        {\n            if (roundingInterval == TimeSpan.Zero)\n            {\n                // divide by zero exception\n                return time;\n            }\n\n            return new TimeSpan(\n                Convert.ToInt64(Math.Round(\n                    time.Ticks / (decimal)roundingInterval.Ticks,\n                    roundingType\n                )) * roundingInterval.Ticks\n            );\n        }\n\n\n        /// <summary>\n        /// Extension method to round timespan to nearest timespan period.\n        /// </summary>\n        /// <param name=\"time\">Base timespan we're looking to round.</param>\n        /// <param name=\"roundingInterval\">Timespan period we're rounding.</param>\n        /// <returns>Rounded timespan period</returns>\n        public static TimeSpan Round(this TimeSpan time, TimeSpan roundingInterval)\n        {\n            return Round(time, roundingInterval, MidpointRounding.ToEven);\n        }\n\n        /// <summary>\n        /// Extension method to round a datetime down by a timespan interval.\n        /// </summary>\n        /// <param name=\"dateTime\">Base DateTime object we're rounding down.</param>\n        /// <param name=\"interval\">Timespan interval to round to</param>\n        /// <returns>Rounded datetime</returns>\n        /// <remarks>Using this with timespans greater than 1 day may have unintended\n        /// consequences. Be aware that rounding occurs against ALL time, so when using\n        /// timespan such as 30 days we will see 30 day increments but it will be based\n        /// on 30 day increments from the beginning of time.</remarks>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime RoundDown(this DateTime dateTime, TimeSpan interval)\n        {\n            if (interval == TimeSpan.Zero)\n            {\n                // divide by zero exception\n                return dateTime;\n            }\n\n            var amount = dateTime.Ticks % interval.Ticks;\n            if (amount > 0)\n            {\n                return dateTime.AddTicks(-amount);\n            }\n            return dateTime;\n        }\n\n        /// <summary>\n        /// Rounds the specified date time in the specified time zone. Careful with calling this method in a loop while modifying dateTime, check unit tests.\n        /// </summary>\n        /// <param name=\"dateTime\">Date time to be rounded</param>\n        /// <param name=\"roundingInterval\">Timespan rounding period</param>\n        /// <param name=\"sourceTimeZone\">Time zone of the date time</param>\n        /// <param name=\"roundingTimeZone\">Time zone in which the rounding is performed</param>\n        /// <returns>The rounded date time in the source time zone</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime RoundDownInTimeZone(this DateTime dateTime, TimeSpan roundingInterval, DateTimeZone sourceTimeZone, DateTimeZone roundingTimeZone)\n        {\n            var dateTimeInRoundingTimeZone = dateTime.ConvertTo(sourceTimeZone, roundingTimeZone);\n            var roundedDateTimeInRoundingTimeZone = dateTimeInRoundingTimeZone.RoundDown(roundingInterval);\n            return roundedDateTimeInRoundingTimeZone.ConvertTo(roundingTimeZone, sourceTimeZone);\n        }\n\n        /// <summary>\n        /// Extension method to round a datetime down by a timespan interval until it's\n        /// within the specified exchange's open hours. This works by first rounding down\n        /// the specified time using the interval, then producing a bar between that\n        /// rounded time and the interval plus the rounded time and incrementally walking\n        /// backwards until the exchange is open\n        /// </summary>\n        /// <param name=\"dateTime\">Time to be rounded down</param>\n        /// <param name=\"interval\">Timespan interval to round to.</param>\n        /// <param name=\"exchangeHours\">The exchange hours to determine open times</param>\n        /// <param name=\"extendedMarketHours\">True for extended market hours, otherwise false</param>\n        /// <returns>Rounded datetime</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime ExchangeRoundDown(this DateTime dateTime, TimeSpan interval, SecurityExchangeHours exchangeHours, bool extendedMarketHours)\n        {\n            // can't round against a zero interval\n            if (interval == TimeSpan.Zero) return dateTime;\n\n            var rounded = dateTime.RoundDown(interval);\n            while (!exchangeHours.IsOpen(rounded, rounded + interval, extendedMarketHours))\n            {\n                rounded -= interval;\n            }\n            return rounded;\n        }\n\n        /// <summary>\n        /// Extension method to round a datetime down by a timespan interval until it's\n        /// within the specified exchange's open hours. The rounding is performed in the\n        /// specified time zone\n        /// </summary>\n        /// <param name=\"dateTime\">Time to be rounded down</param>\n        /// <param name=\"interval\">Timespan interval to round to.</param>\n        /// <param name=\"exchangeHours\">The exchange hours to determine open times</param>\n        /// <param name=\"roundingTimeZone\">The time zone to perform the rounding in</param>\n        /// <param name=\"extendedMarketHours\">True for extended market hours, otherwise false</param>\n        /// <returns>Rounded datetime</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime ExchangeRoundDownInTimeZone(this DateTime dateTime, TimeSpan interval, SecurityExchangeHours exchangeHours, DateTimeZone roundingTimeZone, bool extendedMarketHours)\n        {\n            // can't round against a zero interval\n            if (interval == TimeSpan.Zero) return dateTime;\n\n            var dateTimeInRoundingTimeZone = dateTime.ConvertTo(exchangeHours.TimeZone, roundingTimeZone);\n            var roundedDateTimeInRoundingTimeZone = dateTimeInRoundingTimeZone.RoundDown(interval);\n            var rounded = roundedDateTimeInRoundingTimeZone.ConvertTo(roundingTimeZone, exchangeHours.TimeZone);\n\n            while (!exchangeHours.IsOpen(rounded, rounded + interval, extendedMarketHours))\n            {\n                // Will subtract interval to 'dateTime' in the roundingTimeZone (using the same value type instance) to avoid issues with daylight saving time changes.\n                // GH issue 2368: subtracting interval to 'dateTime' in exchangeHours.TimeZone and converting back to roundingTimeZone\n                // caused the substraction to be neutralized by daylight saving time change, which caused an infinite loop situation in this loop.\n                // The issue also happens if substracting in roundingTimeZone and converting back to exchangeHours.TimeZone.\n\n                dateTimeInRoundingTimeZone -= interval;\n                roundedDateTimeInRoundingTimeZone = dateTimeInRoundingTimeZone.RoundDown(interval);\n                rounded = roundedDateTimeInRoundingTimeZone.ConvertTo(roundingTimeZone, exchangeHours.TimeZone);\n            }\n            return rounded;\n        }\n\n        /// <summary>\n        /// Helper method to determine if a specific market is open\n        /// </summary>\n        /// <param name=\"security\">The target security</param>\n        /// <param name=\"extendedMarketHours\">True if should consider extended market hours</param>\n        /// <returns>True if the market is open</returns>\n        public static bool IsMarketOpen(this Security security, bool extendedMarketHours)\n        {\n            return security.Exchange.Hours.IsOpen(security.LocalTime, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Helper method to determine if a specific market is open\n        /// </summary>\n        /// <param name=\"symbol\">The target symbol</param>\n        /// <param name=\"utcTime\">The current UTC time</param>\n        /// <param name=\"extendedMarketHours\">True if should consider extended market hours</param>\n        /// <returns>True if the market is open</returns>\n        public static bool IsMarketOpen(this Symbol symbol, DateTime utcTime, bool extendedMarketHours)\n        {\n            var exchangeHours = MarketHoursDatabase.FromDataFolder()\n                .GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            var time = utcTime.ConvertFromUtc(exchangeHours.TimeZone);\n\n            return exchangeHours.IsOpen(time, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Extension method to round a datetime to the nearest unit timespan.\n        /// </summary>\n        /// <param name=\"datetime\">Datetime object we're rounding.</param>\n        /// <param name=\"roundingInterval\">Timespan rounding period.</param>\n        /// <returns>Rounded datetime</returns>\n        public static DateTime Round(this DateTime datetime, TimeSpan roundingInterval)\n        {\n            return new DateTime((datetime - DateTime.MinValue).Round(roundingInterval).Ticks);\n        }\n\n        /// <summary>\n        /// Extension method to explicitly round up to the nearest timespan interval.\n        /// </summary>\n        /// <param name=\"time\">Base datetime object to round up.</param>\n        /// <param name=\"interval\">Timespan interval to round to</param>\n        /// <returns>Rounded datetime</returns>\n        /// <remarks>Using this with timespans greater than 1 day may have unintended\n        /// consequences. Be aware that rounding occurs against ALL time, so when using\n        /// timespan such as 30 days we will see 30 day increments but it will be based\n        /// on 30 day increments from the beginning of time.</remarks>\n        public static DateTime RoundUp(this DateTime time, TimeSpan interval)\n        {\n            if (interval == TimeSpan.Zero)\n            {\n                // divide by zero exception\n                return time;\n            }\n\n            return new DateTime(((time.Ticks + interval.Ticks - 1) / interval.Ticks) * interval.Ticks);\n        }\n\n        /// <summary>\n        /// Converts the specified time from the <paramref name=\"from\"/> time zone to the <paramref name=\"to\"/> time zone\n        /// </summary>\n        /// <param name=\"time\">The time to be converted in terms of the <paramref name=\"from\"/> time zone</param>\n        /// <param name=\"from\">The time zone the specified <paramref name=\"time\"/> is in</param>\n        /// <param name=\"to\">The time zone to be converted to</param>\n        /// <param name=\"strict\">True for strict conversion, this will throw during ambiguitities, false for lenient conversion</param>\n        /// <returns>The time in terms of the to time zone</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime ConvertTo(this DateTime time, DateTimeZone from, DateTimeZone to, bool strict = false)\n        {\n            if (strict)\n            {\n                return from.AtStrictly(LocalDateTime.FromDateTime(time)).WithZone(to).ToDateTimeUnspecified();\n            }\n\n            // `InZone` sets the LocalDateTime's timezone, `WithZone` is the tz the time will be converted into.\n            return LocalDateTime.FromDateTime(time)\n                .InZone(from, _mappingResolver)\n                .WithZone(to)\n                .ToDateTimeUnspecified();\n        }\n\n        /// <summary>\n        /// Converts the specified time from UTC to the <paramref name=\"to\"/> time zone\n        /// </summary>\n        /// <param name=\"time\">The time to be converted expressed in UTC</param>\n        /// <param name=\"to\">The destinatio time zone</param>\n        /// <param name=\"strict\">True for strict conversion, this will throw during ambiguitities, false for lenient conversion</param>\n        /// <returns>The time in terms of the <paramref name=\"to\"/> time zone</returns>\n        public static DateTime ConvertFromUtc(this DateTime time, DateTimeZone to, bool strict = false)\n        {\n            return time.ConvertTo(TimeZones.Utc, to, strict);\n        }\n\n        /// <summary>\n        /// Converts the specified time from the <paramref name=\"from\"/> time zone to <see cref=\"TimeZones.Utc\"/>\n        /// </summary>\n        /// <param name=\"time\">The time to be converted in terms of the <paramref name=\"from\"/> time zone</param>\n        /// <param name=\"from\">The time zone the specified <paramref name=\"time\"/> is in</param>\n        /// <param name=\"strict\">True for strict conversion, this will throw during ambiguitities, false for lenient conversion</param>\n        /// <returns>The time in terms of the to time zone</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime ConvertToUtc(this DateTime time, DateTimeZone from, bool strict = false)\n        {\n            if (strict)\n            {\n                return from.AtStrictly(LocalDateTime.FromDateTime(time)).ToDateTimeUtc();\n            }\n\n            // Set the local timezone with `InZone` and convert to UTC\n            return LocalDateTime.FromDateTime(time)\n                .InZone(from, _mappingResolver)\n                .ToDateTimeUtc();\n        }\n\n        /// <summary>\n        /// Business day here is defined as any day of the week that is not saturday or sunday\n        /// </summary>\n        /// <param name=\"date\">The date to be examined</param>\n        /// <returns>A bool indicating wether the datetime is a weekday or not</returns>\n        public static bool IsCommonBusinessDay(this DateTime date)\n        {\n            return (date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek != DayOfWeek.Sunday);\n        }\n\n        /// <summary>\n        /// Add the reset method to the System.Timer class.\n        /// </summary>\n        /// <param name=\"timer\">System.timer object</param>\n        public static void Reset(this Timer timer)\n        {\n            timer.Stop();\n            timer.Start();\n        }\n\n        /// <summary>\n        /// Function used to match a type against a string type name. This function compares on the AssemblyQualfiedName,\n        /// the FullName, and then just the Name of the type.\n        /// </summary>\n        /// <param name=\"type\">The type to test for a match</param>\n        /// <param name=\"typeName\">The name of the type to match</param>\n        /// <returns>True if the specified type matches the type name, false otherwise</returns>\n        public static bool MatchesTypeName(this Type type, string typeName)\n        {\n            if (type.AssemblyQualifiedName == typeName)\n            {\n                return true;\n            }\n            if (type.FullName == typeName)\n            {\n                return true;\n            }\n            if (type.Name == typeName)\n            {\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Checks the specified type to see if it is a subclass of the <paramref name=\"possibleSuperType\"/>. This method will\n        /// crawl up the inheritance heirarchy to check for equality using generic type definitions (if exists)\n        /// </summary>\n        /// <param name=\"type\">The type to be checked as a subclass of <paramref name=\"possibleSuperType\"/></param>\n        /// <param name=\"possibleSuperType\">The possible superclass of <paramref name=\"type\"/></param>\n        /// <returns>True if <paramref name=\"type\"/> is a subclass of the generic type definition <paramref name=\"possibleSuperType\"/></returns>\n        public static bool IsSubclassOfGeneric(this Type type, Type possibleSuperType)\n        {\n            while (type != null && type != typeof(object))\n            {\n                Type cur;\n                if (type.IsGenericType && possibleSuperType.IsGenericTypeDefinition)\n                {\n                    cur = type.GetGenericTypeDefinition();\n                }\n                else\n                {\n                    cur = type;\n                }\n                if (possibleSuperType == cur)\n                {\n                    return true;\n                }\n                type = type.BaseType;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets a type's name with the generic parameters filled in the way they would look when\n        /// defined in code, such as converting Dictionary&lt;`1,`2&gt; to Dictionary&lt;string,int&gt;\n        /// </summary>\n        /// <param name=\"type\">The type who's name we seek</param>\n        /// <returns>A better type name</returns>\n        public static string GetBetterTypeName(this Type type)\n        {\n            string name = type.Name;\n            if (type.IsGenericType)\n            {\n                var genericArguments = type.GetGenericArguments();\n                var toBeReplaced = \"`\" + (genericArguments.Length);\n                name = name.Replace(toBeReplaced, $\"<{string.Join(\", \", genericArguments.Select(x => x.GetBetterTypeName()))}>\");\n            }\n            return name;\n        }\n\n        /// <summary>\n        /// Converts the Resolution instance into a TimeSpan instance\n        /// </summary>\n        /// <param name=\"resolution\">The resolution to be converted</param>\n        /// <returns>A TimeSpan instance that represents the resolution specified</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static TimeSpan ToTimeSpan(this Resolution resolution)\n        {\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                    // ticks can be instantaneous\n                    return TimeSpan.Zero;\n                case Resolution.Second:\n                    return Time.OneSecond;\n                case Resolution.Minute:\n                    return Time.OneMinute;\n                case Resolution.Hour:\n                    return Time.OneHour;\n                case Resolution.Daily:\n                    return Time.OneDay;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified time span into a resolution enum value. If an exact match\n        /// is not found and `requireExactMatch` is false, then the higher resoluion will be\n        /// returned. For example, timeSpan=5min will return Minute resolution.\n        /// </summary>\n        /// <param name=\"timeSpan\">The time span to convert to resolution</param>\n        /// <param name=\"requireExactMatch\">True to throw an exception if an exact match is not found</param>\n        /// <returns>The resolution</returns>\n        public static Resolution ToHigherResolutionEquivalent(this TimeSpan timeSpan, bool requireExactMatch)\n        {\n            if (requireExactMatch)\n            {\n                if (TimeSpan.Zero == timeSpan) return Resolution.Tick;\n                if (Time.OneSecond == timeSpan) return Resolution.Second;\n                if (Time.OneMinute == timeSpan) return Resolution.Minute;\n                if (Time.OneHour == timeSpan) return Resolution.Hour;\n                if (Time.OneDay == timeSpan) return Resolution.Daily;\n                throw new InvalidOperationException(Messages.Extensions.UnableToConvertTimeSpanToResolution(timeSpan));\n            }\n\n            // for non-perfect matches\n            if (Time.OneSecond > timeSpan) return Resolution.Tick;\n            if (Time.OneMinute > timeSpan) return Resolution.Second;\n            if (Time.OneHour > timeSpan) return Resolution.Minute;\n            if (Time.OneDay > timeSpan) return Resolution.Hour;\n\n            return Resolution.Daily;\n        }\n\n        /// <summary>\n        /// Attempts to convert the string into a <see cref=\"SecurityType\"/> enum value\n        /// </summary>\n        /// <param name=\"value\">string value to convert to SecurityType</param>\n        /// <param name=\"securityType\">SecurityType output</param>\n        /// <param name=\"ignoreCase\">Ignore casing</param>\n        /// <returns>true if parsed into a SecurityType successfully, false otherwise</returns>\n        /// <remarks>\n        /// Logs once if we've encountered an invalid SecurityType\n        /// </remarks>\n        public static bool TryParseSecurityType(this string value, out SecurityType securityType, bool ignoreCase = true)\n        {\n            if (Enum.TryParse(value, ignoreCase, out securityType))\n            {\n                return true;\n            }\n\n            if (InvalidSecurityTypes.Add(value))\n            {\n                Log.Error($\"Extensions.TryParseSecurityType(): {Messages.Extensions.UnableToParseUnknownSecurityType(value)}\");\n            }\n\n            return false;\n\n        }\n\n        /// <summary>\n        /// Converts the specified string value into the specified type\n        /// </summary>\n        /// <typeparam name=\"T\">The output type</typeparam>\n        /// <param name=\"value\">The string value to be converted</param>\n        /// <returns>The converted value</returns>\n        public static T ConvertTo<T>(this string value)\n        {\n            return (T)value.ConvertTo(typeof(T));\n        }\n\n        /// <summary>\n        /// Converts the specified string value into the specified type\n        /// </summary>\n        /// <param name=\"value\">The string value to be converted</param>\n        /// <param name=\"type\">The output type</param>\n        /// <returns>The converted value</returns>\n        public static object ConvertTo(this string value, Type type)\n        {\n            if (type.IsEnum)\n            {\n                return Enum.Parse(type, value, true);\n            }\n\n            if (typeof(IConvertible).IsAssignableFrom(type))\n            {\n                return Convert.ChangeType(value, type, CultureInfo.InvariantCulture);\n            }\n\n            // try and find a static parse method\n            var parse = type.GetMethod(\"Parse\", new[] { typeof(string) });\n            if (parse != null)\n            {\n                var result = parse.Invoke(null, new object[] { value });\n                return result;\n            }\n\n            return JsonConvert.DeserializeObject(value, type);\n        }\n\n        /// <summary>\n        /// Blocks the current thread until the current <see cref=\"T:System.Threading.WaitHandle\"/> receives a signal, while observing a <see cref=\"T:System.Threading.CancellationToken\"/>.\n        /// </summary>\n        /// <param name=\"waitHandle\">The wait handle to wait on</param>\n        /// <param name=\"cancellationToken\">The <see cref=\"T:System.Threading.CancellationToken\"/> to observe.</param>\n        /// <exception cref=\"T:System.InvalidOperationException\">The maximum number of waiters has been exceeded.</exception>\n        /// <exception cref=\"T:System.OperationCanceledExcepton\"><paramref name=\"cancellationToken\"/> was canceled.</exception>\n        /// <exception cref=\"T:System.ObjectDisposedException\">The object has already been disposed or the <see cref=\"T:System.Threading.CancellationTokenSource\"/> that created <paramref name=\"cancellationToken\"/> has been disposed.</exception>\n        public static bool WaitOne(this WaitHandle waitHandle, CancellationToken cancellationToken)\n        {\n            return waitHandle.WaitOne(Timeout.Infinite, cancellationToken);\n        }\n\n        /// <summary>\n        /// Blocks the current thread until the current <see cref=\"T:System.Threading.WaitHandle\"/> is set, using a <see cref=\"T:System.TimeSpan\"/> to measure the time interval, while observing a <see cref=\"T:System.Threading.CancellationToken\"/>.\n        /// </summary>\n        ///\n        /// <returns>\n        /// true if the <see cref=\"T:System.Threading.WaitHandle\"/> was set; otherwise, false.\n        /// </returns>\n        /// <param name=\"waitHandle\">The wait handle to wait on</param>\n        /// <param name=\"timeout\">A <see cref=\"T:System.TimeSpan\"/> that represents the number of milliseconds to wait, or a <see cref=\"T:System.TimeSpan\"/> that represents -1 milliseconds to wait indefinitely.</param>\n        /// <param name=\"cancellationToken\">The <see cref=\"T:System.Threading.CancellationToken\"/> to observe.</param>\n        /// <exception cref=\"T:System.Threading.OperationCanceledException\"><paramref name=\"cancellationToken\"/> was canceled.</exception>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"timeout\"/> is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than <see cref=\"F:System.Int32.MaxValue\"/>.</exception>\n        /// <exception cref=\"T:System.InvalidOperationException\">The maximum number of waiters has been exceeded. </exception><exception cref=\"T:System.ObjectDisposedException\">The object has already been disposed or the <see cref=\"T:System.Threading.CancellationTokenSource\"/> that created <paramref name=\"cancellationToken\"/> has been disposed.</exception>\n        public static bool WaitOne(this WaitHandle waitHandle, TimeSpan timeout, CancellationToken cancellationToken)\n        {\n            return waitHandle.WaitOne((int)timeout.TotalMilliseconds, cancellationToken);\n        }\n\n        /// <summary>\n        /// Blocks the current thread until the current <see cref=\"T:System.Threading.WaitHandle\"/> is set, using a 32-bit signed integer to measure the time interval, while observing a <see cref=\"T:System.Threading.CancellationToken\"/>.\n        /// </summary>\n        ///\n        /// <returns>\n        /// true if the <see cref=\"T:System.Threading.WaitHandle\"/> was set; otherwise, false.\n        /// </returns>\n        /// <param name=\"waitHandle\">The wait handle to wait on</param>\n        /// <param name=\"millisecondsTimeout\">The number of milliseconds to wait, or <see cref=\"F:System.Threading.Timeout.Infinite\"/>(-1) to wait indefinitely.</param>\n        /// <param name=\"cancellationToken\">The <see cref=\"T:System.Threading.CancellationToken\"/> to observe.</param>\n        /// <exception cref=\"T:System.Threading.OperationCanceledException\"><paramref name=\"cancellationToken\"/> was canceled.</exception>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"millisecondsTimeout\"/> is a negative number other than -1, which represents an infinite time-out.</exception>\n        /// <exception cref=\"T:System.InvalidOperationException\">The maximum number of waiters has been exceeded.</exception>\n        /// <exception cref=\"T:System.ObjectDisposedException\">The object has already been disposed or the <see cref=\"T:System.Threading.CancellationTokenSource\"/> that created <paramref name=\"cancellationToken\"/> has been disposed.</exception>\n        public static bool WaitOne(this WaitHandle waitHandle, int millisecondsTimeout, CancellationToken cancellationToken)\n        {\n            return WaitHandle.WaitAny(new[] { waitHandle, cancellationToken.WaitHandle }, millisecondsTimeout) == 0;\n        }\n\n        /// <summary>\n        /// Gets the MD5 hash from a stream\n        /// </summary>\n        /// <param name=\"stream\">The stream to compute a hash for</param>\n        /// <returns>The MD5 hash</returns>\n        public static byte[] GetMD5Hash(this Stream stream)\n        {\n            using (var md5 = MD5.Create())\n            {\n                return md5.ComputeHash(stream);\n            }\n        }\n\n        /// <summary>\n        /// Convert a string into the same string with a URL! :)\n        /// </summary>\n        /// <param name=\"source\">The source string to be converted</param>\n        /// <returns>The same source string but with anchor tags around substrings matching a link regex</returns>\n        public static string WithEmbeddedHtmlAnchors(this string source)\n        {\n            var regx = new Regex(\"http(s)?://([\\\\w+?\\\\.\\\\w+])+([a-zA-Z0-9\\\\~\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&amp;\\\\*\\\\(\\\\)_\\\\-\\\\=\\\\+\\\\\\\\\\\\/\\\\?\\\\.\\\\:\\\\;\\\\'\\\\,]*([a-zA-Z0-9\\\\?\\\\#\\\\=\\\\/]){1})?\", RegexOptions.IgnoreCase);\n            var matches = regx.Matches(source);\n            foreach (Match match in matches)\n            {\n                source = source.Replace(match.Value, $\"<a href=\\'{match.Value}\\' target=\\'blank\\'>{match.Value}</a>\");\n            }\n            return source;\n        }\n\n        /// <summary>\n        /// Get the first occurence of a string between two characters from another string\n        /// </summary>\n        /// <param name=\"value\">The original string</param>\n        /// <param name=\"left\">Left bound of the substring</param>\n        /// <param name=\"right\">Right bound of the substring</param>\n        /// <returns>Substring from original string bounded by the two characters</returns>\n        public static string GetStringBetweenChars(this string value, char left, char right)\n        {\n            var startIndex = 1 + value.IndexOf(left);\n            var length = value.IndexOf(right, startIndex) - startIndex;\n            if (length > 0)\n            {\n                value = value.Substring(startIndex, length);\n                startIndex = 1 + value.IndexOf(left);\n                return value.Substring(startIndex).Trim();\n            }\n            return string.Empty;\n        }\n\n        /// <summary>\n        /// Return the first in the series of names, or find the one that matches the configured algorithmTypeName\n        /// </summary>\n        /// <param name=\"names\">The list of class names</param>\n        /// <param name=\"algorithmTypeName\">The configured algorithm type name from the config</param>\n        /// <returns>The name of the class being run</returns>\n        public static string SingleOrAlgorithmTypeName(this List<string> names, string algorithmTypeName)\n        {\n            // If there's only one name use that guy\n            if (names.Count == 1) { return names.Single(); }\n\n            // If we have multiple names we need to search the names based on the given algorithmTypeName\n            // If the given name already contains dots (fully named) use it as it is\n            // otherwise add a dot to the beginning to avoid matching any subsets of other names\n            var searchName = algorithmTypeName.Contains('.', StringComparison.InvariantCulture) ? algorithmTypeName : \".\" + algorithmTypeName;\n            return names.SingleOrDefault(x => x.EndsWith(searchName));\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"enum\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <param name=\"enum\">The enumeration value</param>\n        /// <returns>A lower-case string representation of the specified enumeration value</returns>\n        public static string ToLower(this Enum @enum)\n        {\n            return @enum.ToString().ToLowerInvariant();\n        }\n\n        /// <summary>\n        /// Asserts the specified <paramref name=\"securityType\"/> value is valid\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"Enum.IsDefined\"/> which uses reflection</remarks>\n        /// <param name=\"securityType\">The SecurityType value</param>\n        /// <returns>True if valid security type value</returns>\n        public static bool IsValid(this SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                case SecurityType.Option:\n                case SecurityType.FutureOption:\n                case SecurityType.Commodity:\n                case SecurityType.Forex:\n                case SecurityType.Future:\n                case SecurityType.Cfd:\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                case SecurityType.Index:\n                case SecurityType.IndexOption:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Determines if the provided SecurityType is a type of Option.\n        /// Valid option types are: Equity Options, Futures Options, and Index Options.\n        /// </summary>\n        /// <param name=\"securityType\">The SecurityType to check if it's an option asset</param>\n        /// <returns>\n        /// true if the asset has the makings of an option (exercisable, expires, and is a derivative of some underlying),\n        /// false otherwise.\n        /// </returns>\n        public static bool IsOption(this SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Option:\n                case SecurityType.FutureOption:\n                case SecurityType.IndexOption:\n                    return true;\n\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Determines if the provided SecurityType has a matching option SecurityType, used to represent\n        /// the current SecurityType as a derivative.\n        /// </summary>\n        /// <param name=\"securityType\">The SecurityType to check if it has options available</param>\n        /// <returns>true if there are options for the SecurityType, false otherwise</returns>\n        public static bool HasOptions(this SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                case SecurityType.Future:\n                case SecurityType.Index:\n                    return true;\n\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Gets the default <see cref=\"OptionStyle\"/> for the provided <see cref=\"SecurityType\"/>\n        /// </summary>\n        /// <param name=\"securityType\">SecurityType to get default OptionStyle for</param>\n        /// <returns>Default OptionStyle for the SecurityType</returns>\n        /// <exception cref=\"ArgumentException\">The SecurityType has no options available for it or it is not an option</exception>\n        public static OptionStyle DefaultOptionStyle(this SecurityType securityType)\n        {\n            if (!securityType.HasOptions() && !securityType.IsOption())\n            {\n                throw new ArgumentException(Messages.Extensions.NoDefaultOptionStyleForSecurityType(securityType));\n            }\n\n            switch (securityType)\n            {\n                case SecurityType.Index:\n                case SecurityType.IndexOption:\n                    return OptionStyle.European;\n\n                default:\n                    return OptionStyle.American;\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified string to its corresponding OptionStyle\n        /// </summary>\n        /// <remarks>This method provides faster performance than enum parse</remarks>\n        /// <param name=\"optionStyle\">The OptionStyle string value</param>\n        /// <returns>The OptionStyle value</returns>\n        public static OptionStyle ParseOptionStyle(this string optionStyle)\n        {\n            switch (optionStyle.LazyToLower())\n            {\n                case \"american\":\n                    return OptionStyle.American;\n                case \"european\":\n                    return OptionStyle.European;\n                default:\n                    throw new ArgumentException(Messages.Extensions.UnknownOptionStyle(optionStyle));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified string to its corresponding OptionRight\n        /// </summary>\n        /// <remarks>This method provides faster performance than enum parse</remarks>\n        /// <param name=\"optionRight\">The optionRight string value</param>\n        /// <returns>The OptionRight value</returns>\n        public static OptionRight ParseOptionRight(this string optionRight)\n        {\n            switch (optionRight.LazyToLower())\n            {\n                case \"call\":\n                    return OptionRight.Call;\n                case \"put\":\n                    return OptionRight.Put;\n                default:\n                    throw new ArgumentException(Messages.Extensions.UnknownOptionRight(optionRight));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"optionRight\"/> value to its corresponding string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than enum <see cref=\"Object.ToString\"/></remarks>\n        /// <param name=\"optionRight\">The optionRight value</param>\n        /// <returns>A string representation of the specified OptionRight value</returns>\n        public static string ToStringPerformance(this OptionRight optionRight)\n        {\n            switch (optionRight)\n            {\n                case OptionRight.Call:\n                    return \"Call\";\n                case OptionRight.Put:\n                    return \"Put\";\n                default:\n                    // just in case\n                    return optionRight.ToString();\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"optionRight\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"ToLower\"/></remarks>\n        /// <param name=\"optionRight\">The optionRight value</param>\n        /// <returns>A lower case string representation of the specified OptionRight value</returns>\n        public static string OptionRightToLower(this OptionRight optionRight)\n        {\n            switch (optionRight)\n            {\n                case OptionRight.Call:\n                    return \"call\";\n                case OptionRight.Put:\n                    return \"put\";\n                default:\n                    throw new ArgumentException(Messages.Extensions.UnknownOptionRight(optionRight));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"optionStyle\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"ToLower\"/></remarks>\n        /// <param name=\"optionStyle\">The optionStyle value</param>\n        /// <returns>A lower case string representation of the specified optionStyle value</returns>\n        public static string OptionStyleToLower(this OptionStyle optionStyle)\n        {\n            switch (optionStyle)\n            {\n                case OptionStyle.American:\n                    return \"american\";\n                case OptionStyle.European:\n                    return \"european\";\n                default:\n                    throw new ArgumentException(Messages.Extensions.UnknownOptionStyle(optionStyle));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified string to its corresponding DataMappingMode\n        /// </summary>\n        /// <remarks>This method provides faster performance than enum parse</remarks>\n        /// <param name=\"dataMappingMode\">The dataMappingMode string value</param>\n        /// <returns>The DataMappingMode value</returns>\n        public static DataMappingMode? ParseDataMappingMode(this string dataMappingMode)\n        {\n            if (string.IsNullOrEmpty(dataMappingMode))\n            {\n                return null;\n            }\n            switch (dataMappingMode.LazyToLower())\n            {\n                case \"0\":\n                case \"lasttradingday\":\n                    return DataMappingMode.LastTradingDay;\n                case \"1\":\n                case \"firstdaymonth\":\n                    return DataMappingMode.FirstDayMonth;\n                case \"2\":\n                case \"openinterest\":\n                    return DataMappingMode.OpenInterest;\n                case \"3\":\n                case \"openinterestannual\":\n                    return DataMappingMode.OpenInterestAnnual;\n                default:\n                    throw new ArgumentException(Messages.Extensions.UnknownDataMappingMode(dataMappingMode));\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"securityType\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"ToLower\"/></remarks>\n        /// <param name=\"securityType\">The SecurityType value</param>\n        /// <returns>A lower-case string representation of the specified SecurityType value</returns>\n        public static string SecurityTypeToLower(this SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                    return \"base\";\n                case SecurityType.Equity:\n                    return \"equity\";\n                case SecurityType.Option:\n                    return \"option\";\n                case SecurityType.FutureOption:\n                    return \"futureoption\";\n                case SecurityType.IndexOption:\n                    return \"indexoption\";\n                case SecurityType.Commodity:\n                    return \"commodity\";\n                case SecurityType.Forex:\n                    return \"forex\";\n                case SecurityType.Future:\n                    return \"future\";\n                case SecurityType.Index:\n                    return \"index\";\n                case SecurityType.Cfd:\n                    return \"cfd\";\n                case SecurityType.Crypto:\n                    return \"crypto\";\n                case SecurityType.CryptoFuture:\n                    return \"cryptofuture\";\n                default:\n                    // just in case\n                    return securityType.ToLower();\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"tickType\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"ToLower\"/></remarks>\n        /// <param name=\"tickType\">The tickType value</param>\n        /// <returns>A lower-case string representation of the specified tickType value</returns>\n        public static string TickTypeToLower(this TickType tickType)\n        {\n            switch (tickType)\n            {\n                case TickType.Trade:\n                    return \"trade\";\n                case TickType.Quote:\n                    return \"quote\";\n                case TickType.OpenInterest:\n                    return \"openinterest\";\n                default:\n                    // just in case\n                    return tickType.ToLower();\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"resolution\"/> value to its corresponding lower-case string representation\n        /// </summary>\n        /// <remarks>This method provides faster performance than <see cref=\"ToLower\"/></remarks>\n        /// <param name=\"resolution\">The resolution value</param>\n        /// <returns>A lower-case string representation of the specified resolution value</returns>\n        public static string ResolutionToLower(this Resolution resolution)\n        {\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                    return \"tick\";\n                case Resolution.Second:\n                    return \"second\";\n                case Resolution.Minute:\n                    return \"minute\";\n                case Resolution.Hour:\n                    return \"hour\";\n                case Resolution.Daily:\n                    return \"daily\";\n                default:\n                    // just in case\n                    return resolution.ToLower();\n            }\n        }\n\n        /// <summary>\n        /// Turn order into an order ticket\n        /// </summary>\n        /// <param name=\"order\">The <see cref=\"Order\"/> being converted</param>\n        /// <param name=\"transactionManager\">The transaction manager, <see cref=\"SecurityTransactionManager\"/></param>\n        /// <returns></returns>\n        public static OrderTicket ToOrderTicket(this Order order, SecurityTransactionManager transactionManager)\n        {\n            var limitPrice = 0m;\n            var stopPrice = 0m;\n            var triggerPrice = 0m;\n            var trailingAmount = 0m;\n            var trailingAsPercentage = false;\n\n            switch (order.Type)\n            {\n                case OrderType.Limit:\n                    var limitOrder = order as LimitOrder;\n                    limitPrice = limitOrder.LimitPrice;\n                    break;\n                case OrderType.StopMarket:\n                    var stopMarketOrder = order as StopMarketOrder;\n                    stopPrice = stopMarketOrder.StopPrice;\n                    break;\n                case OrderType.StopLimit:\n                    var stopLimitOrder = order as StopLimitOrder;\n                    stopPrice = stopLimitOrder.StopPrice;\n                    limitPrice = stopLimitOrder.LimitPrice;\n                    break;\n                case OrderType.TrailingStop:\n                    var trailingStopOrder = order as TrailingStopOrder;\n                    stopPrice = trailingStopOrder.StopPrice;\n                    trailingAmount = trailingStopOrder.TrailingAmount;\n                    trailingAsPercentage = trailingStopOrder.TrailingAsPercentage;\n                    break;\n                case OrderType.LimitIfTouched:\n                    var limitIfTouched = order as LimitIfTouchedOrder;\n                    triggerPrice = limitIfTouched.TriggerPrice;\n                    limitPrice = limitIfTouched.LimitPrice;\n                    break;\n                case OrderType.OptionExercise:\n                case OrderType.Market:\n                case OrderType.MarketOnOpen:\n                case OrderType.MarketOnClose:\n                case OrderType.ComboMarket:\n                    limitPrice = order.Price;\n                    stopPrice = order.Price;\n                    break;\n                case OrderType.ComboLimit:\n                    limitPrice = order.GroupOrderManager.LimitPrice;\n                    break;\n                case OrderType.ComboLegLimit:\n                    var legLimitOrder = order as ComboLegLimitOrder;\n                    limitPrice = legLimitOrder.LimitPrice;\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            var submitOrderRequest = new SubmitOrderRequest(order.Type,\n                order.SecurityType,\n                order.Symbol,\n                order.Quantity,\n                stopPrice,\n                limitPrice,\n                triggerPrice,\n                trailingAmount,\n                trailingAsPercentage,\n                order.Time,\n                order.Tag,\n                order.Properties,\n                order.GroupOrderManager);\n\n            submitOrderRequest.SetOrderId(order.Id);\n            var orderTicket = new OrderTicket(transactionManager, submitOrderRequest);\n            orderTicket.SetOrder(order);\n            return orderTicket;\n        }\n\n        /// <summary>\n        /// Process all items in collection through given handler\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"collection\">Collection to process</param>\n        /// <param name=\"handler\">Handler to process those items with</param>\n        public static void ProcessUntilEmpty<T>(this IProducerConsumerCollection<T> collection, Action<T> handler)\n        {\n            T item;\n            while (collection.TryTake(out item))\n            {\n                handler(item);\n            }\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"string\"/> that represents the current <see cref=\"PyObject\"/>\n        /// </summary>\n        /// <param name=\"pyObject\">The <see cref=\"PyObject\"/> being converted</param>\n        /// <returns>string that represents the current PyObject</returns>\n        public static string ToSafeString(this PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                var value = \"\";\n                // PyObject objects that have the to_string method, like some pandas objects,\n                // can use this method to convert them into string objects\n                if (pyObject.HasAttr(\"to_string\"))\n                {\n                    var pyValue = pyObject.InvokeMethod(\"to_string\");\n                    value = Environment.NewLine + pyValue;\n                    pyValue.Dispose();\n                }\n                else\n                {\n                    value = pyObject.ToString();\n                    if (string.IsNullOrWhiteSpace(value))\n                    {\n                        var pythonType = pyObject.GetPythonType();\n                        if (pythonType.GetType() == typeof(PyObject))\n                        {\n                            value = pythonType.ToString();\n                        }\n                        else\n                        {\n                            var type = pythonType.As<Type>();\n                            value = pyObject.AsManagedObject(type).ToString();\n                        }\n                        pythonType.Dispose();\n                    }\n                }\n                return value;\n            }\n        }\n\n        /// <summary>\n        /// Tries to convert a <see cref=\"PyObject\"/> into a managed object\n        /// </summary>\n        /// <remarks>This method is not working correctly for a wrapped <see cref=\"TimeSpan\"/> instance,\n        /// probably because it is a struct, using <see cref=\"PyObject.As{T}\"/> is a valid work around.\n        /// Not used here because it caused errors\n        /// </remarks>\n        /// <typeparam name=\"T\">Target type of the resulting managed object</typeparam>\n        /// <param name=\"pyObject\">PyObject to be converted</param>\n        /// <param name=\"result\">Managed object </param>\n        /// <param name=\"allowPythonDerivative\">True will convert python subclasses of T</param>\n        /// <returns>True if successful conversion</returns>\n        public static bool TryConvert<T>(this PyObject pyObject, out T result, bool allowPythonDerivative = false)\n        {\n            result = default(T);\n            var type = typeof(T);\n\n            if (pyObject == null)\n            {\n                return true;\n            }\n\n            using (Py.GIL())\n            {\n                try\n                {\n                    // We must first check if allowPythonDerivative is true to then only return true\n                    // when the PyObject is assignable from Type or IEnumerable and is a C# type\n                    // wrapped in PyObject\n                    if (allowPythonDerivative)\n                    {\n                        result = (T)pyObject.AsManagedObject(type);\n                        return true;\n                    }\n\n                    // Special case: Type\n                    if (typeof(Type).IsAssignableFrom(type))\n                    {\n                        result = (T)pyObject.AsManagedObject(type);\n                        // pyObject is a C# object wrapped in PyObject, in this case return true\n                        if (!pyObject.HasAttr(\"__name__\"))\n                        {\n                            return true;\n                        }\n                        // Otherwise, pyObject is a python object that subclass a C# class, only return true if 'allowPythonDerivative'\n                        var castedResult = (Type)pyObject.AsManagedObject(type);\n                        var pythonName = pyObject.GetAttr(\"__name__\").GetAndDispose<string>();\n                        return pythonName == castedResult.Name;\n                    }\n\n                    // Special case: IEnumerable\n                    if (typeof(IEnumerable).IsAssignableFrom(type))\n                    {\n                        result = (T)pyObject.AsManagedObject(type);\n                        return true;\n                    }\n\n                    using var pythonType = pyObject.GetPythonType();\n                    var csharpType = pythonType.As<Type>();\n\n                    if (!type.IsAssignableFrom(csharpType))\n                    {\n                        return false;\n                    }\n\n                    result = (T)pyObject.AsManagedObject(type);\n\n                    // The PyObject is a Python object of a Python class that is a subclass of a C# class.\n                    // In this case, we return false just because we want the actual Python object\n                    // so it gets wrapped in a python wrapper, not the C# object.\n                    if (result is IPythonDerivedType)\n                    {\n                        return false;\n                    }\n\n                    // If the python type object is just a representation of the C# type, the conversion is direct,\n                    // the python object is an instance of the C# class.\n                    // We can compare by reference because pythonnet caches the PyTypes and because the behavior of\n                    // PyObject.Equals is not exactly what we want:\n                    // e.g. type(class PyClass(CSharpClass)) == type(CSharpClass) is true in Python\n                    if (PythonReferenceComparer.Instance.Equals(PyType.Get(csharpType), pythonType))\n                    {\n                        return true;\n                    }\n\n                    // If the PyObject type and the managed object names are the same,\n                    // pyObject is a C# object wrapped in PyObject, in this case return true\n                    // Otherwise, pyObject is a python object that subclass a C# class, only return true if 'allowPythonDerivative'\n                    var name = (((dynamic)pythonType).__name__ as PyObject).GetAndDispose<string>();\n                    return name == result.GetType().Name;\n                }\n                catch\n                {\n                    // Do not throw or log the exception.\n                    // Return false as an exception means that the conversion could not be made.\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Safely convert PyObject to ManagedObject using Py.GIL Lock\n        /// If no type is given it will convert the PyObject's Python Type to a ManagedObject Type\n        /// in a attempt to resolve the target type to convert to.\n        /// </summary>\n        /// <param name=\"pyObject\">PyObject to convert to managed</param>\n        /// <param name=\"typeToConvertTo\">The target type to convert to</param>\n        /// <returns>The resulting ManagedObject</returns>\n        public static dynamic SafeAsManagedObject(this PyObject pyObject, Type typeToConvertTo = null)\n        {\n            using (Py.GIL())\n            {\n                if (typeToConvertTo == null)\n                {\n                    typeToConvertTo = pyObject.GetPythonType().AsManagedObject(typeof(Type)) as Type;\n                }\n\n                return pyObject.AsManagedObject(typeToConvertTo);\n            }\n        }\n\n        /// <summary>\n        /// Converts a Python function to a managed function returning a Symbol\n        /// </summary>\n        /// <param name=\"universeFilterFunc\">Universe filter function from Python</param>\n        /// <returns>Function that provides <typeparamref name=\"T\"/> and returns an enumerable of Symbols</returns>\n        public static Func<IEnumerable<T>, IEnumerable<Symbol>> ConvertPythonUniverseFilterFunction<T>(this PyObject universeFilterFunc) where T : BaseData\n        {\n            Func<IEnumerable<T>, object> convertedFunc;\n            Func<IEnumerable<T>, IEnumerable<Symbol>> filterFunc = null;\n\n            if (universeFilterFunc != null && universeFilterFunc.TrySafeAs(out convertedFunc))\n            {\n                filterFunc = convertedFunc.ConvertToUniverseSelectionSymbolDelegate();\n            }\n\n            return filterFunc;\n        }\n\n        /// <summary>\n        /// Wraps the provided universe selection selector checking if it returned <see cref=\"Universe.Unchanged\"/>\n        /// and returns it instead, else enumerates result as <see cref=\"IEnumerable{Symbol}\"/>\n        /// </summary>\n        /// <remarks>This method is a work around for the fact that currently we can not create a delegate which returns\n        /// an <see cref=\"IEnumerable{Symbol}\"/> from a python method returning an array, plus the fact that\n        /// <see cref=\"Universe.Unchanged\"/> can not be cast to an array</remarks>\n        public static Func<IEnumerable<T>, IEnumerable<Symbol>> ConvertToUniverseSelectionSymbolDelegate<T>(this Func<IEnumerable<T>, object> selector) where T : BaseData\n        {\n            if (selector == null)\n            {\n                return (dataPoints) => dataPoints.Select(x => x.Symbol);\n            }\n            return selector.ConvertSelectionSymbolDelegate();\n        }\n\n        /// <summary>\n        /// Wraps the provided universe selection selector checking if it returned <see cref=\"Universe.Unchanged\"/>\n        /// and returns it instead, else enumerates result as <see cref=\"IEnumerable{Symbol}\"/>\n        /// </summary>\n        /// <remarks>This method is a work around for the fact that currently we can not create a delegate which returns\n        /// an <see cref=\"IEnumerable{Symbol}\"/> from a python method returning an array, plus the fact that\n        /// <see cref=\"Universe.Unchanged\"/> can not be cast to an array</remarks>\n        public static Func<T, IEnumerable<Symbol>> ConvertSelectionSymbolDelegate<T>(this Func<T, object> selector)\n        {\n            return data =>\n            {\n                var result = selector(data);\n                return ReferenceEquals(result, Universe.Unchanged)\n                    ? Universe.Unchanged\n                    : ((object[])result).Select(x =>\n                    {\n                        if (x is Symbol castedSymbol)\n                        {\n                            return castedSymbol;\n                        }\n                        return SymbolCache.TryGetSymbol((string)x, out var symbol) ? symbol : null;\n                    });\n            };\n        }\n\n        /// <summary>\n        /// Wraps the provided universe selection selector checking if it returned <see cref=\"Universe.Unchanged\"/>\n        /// and returns it instead, else enumerates result as <see cref=\"IEnumerable{String}\"/>\n        /// </summary>\n        /// <remarks>This method is a work around for the fact that currently we can not create a delegate which returns\n        /// an <see cref=\"IEnumerable{String}\"/> from a python method returning an array, plus the fact that\n        /// <see cref=\"Universe.Unchanged\"/> can not be cast to an array</remarks>\n        public static Func<T, IEnumerable<string>> ConvertToUniverseSelectionStringDelegate<T>(this Func<T, object> selector)\n        {\n            return data =>\n            {\n                var result = selector(data);\n                return ReferenceEquals(result, Universe.Unchanged)\n                    ? Universe.Unchanged : ((object[])result).Select(x => (string)x);\n            };\n        }\n\n        /// <summary>\n        /// Convert a <see cref=\"PyObject\"/> into a managed dictionary\n        /// </summary>\n        /// <typeparam name=\"TKey\">Target type of the resulting dictionary key</typeparam>\n        /// <typeparam name=\"TValue\">Target type of the resulting dictionary value</typeparam>\n        /// <param name=\"pyObject\">PyObject to be converted</param>\n        /// <returns>Dictionary of TValue keyed by TKey</returns>\n        public static Dictionary<TKey, TValue> ConvertToDictionary<TKey, TValue>(this PyObject pyObject)\n        {\n            var result = new List<KeyValuePair<TKey, TValue>>();\n            using (Py.GIL())\n            {\n                var inputType = pyObject.GetPythonType().ToString();\n                var targetType = nameof(PyDict);\n\n                try\n                {\n                    using (var pyDict = new PyDict(pyObject))\n                    {\n                        targetType = $\"{typeof(TKey).Name}: {typeof(TValue).Name}\";\n\n                        foreach (PyObject item in pyDict.Items())\n                        {\n                            inputType = $\"{item[0].GetPythonType()}: {item[1].GetPythonType()}\";\n\n                            var key = item[0].As<TKey>();\n                            var value = item[1].As<TValue>();\n\n                            result.Add(new KeyValuePair<TKey, TValue>(key, value));\n                        }\n                    }\n                }\n                catch (Exception e)\n                {\n                    throw new ArgumentException(Messages.Extensions.ConvertToDictionaryFailed(inputType, targetType, e.Message), e);\n                }\n            }\n\n            return result.ToDictionary();\n        }\n\n        /// <summary>\n        /// Gets Enumerable of <see cref=\"Symbol\"/> from a PyObject\n        /// </summary>\n        /// <param name=\"pyObject\">PyObject containing Symbol or Array of Symbol</param>\n        /// <returns>Enumerable of Symbol</returns>\n        public static IEnumerable<Symbol> ConvertToSymbolEnumerable(this PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                Exception exception = null;\n                if (!PyList.IsListType(pyObject))\n                {\n                    // it's not a pylist try to conver directly\n                    Symbol result = null;\n                    try\n                    {\n                        // we shouldn't dispose of an object we haven't created\n                        result = ConvertToSymbol(pyObject, dispose: false);\n                    }\n                    catch (Exception ex)\n                    {\n                        exception = ex;\n                    }\n\n                    if (result != null)\n                    {\n                        // happy case\n                        yield return result;\n                    }\n                }\n                else\n                {\n                    using var iterator = pyObject.GetIterator();\n                    foreach (PyObject item in iterator)\n                    {\n                        Symbol result;\n                        try\n                        {\n                            result = ConvertToSymbol(item, dispose: true);\n                        }\n                        catch (Exception ex)\n                        {\n                            exception = ex;\n                            break;\n                        }\n                        yield return result;\n                    }\n                }\n\n                // let's give it once last try, relying on pythonnet internal conversions, else throw\n                if (exception != null)\n                {\n                    if (pyObject.TryConvert(out IEnumerable<Symbol> symbols))\n                    {\n                        foreach (var symbol in symbols)\n                        {\n                            yield return symbol;\n                        }\n                    }\n                    else\n                    {\n                        throw exception;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Converts an IEnumerable to a PyList\n        /// </summary>\n        /// <param name=\"enumerable\">IEnumerable object to convert</param>\n        /// <returns>PyList</returns>\n        public static PyList ToPyList(this IEnumerable enumerable)\n        {\n            using (Py.GIL())\n            {\n                return enumerable.ToPyListUnSafe();\n            }\n        }\n\n        /// <summary>\n        /// Converts an IEnumerable to a PyList\n        /// </summary>\n        /// <param name=\"enumerable\">IEnumerable object to convert</param>\n        /// <remarks>Requires the caller to own the GIL</remarks>\n        /// <returns>PyList</returns>\n        public static PyList ToPyListUnSafe(this IEnumerable enumerable)\n        {\n            var pyList = new PyList();\n            foreach (var item in enumerable)\n            {\n                using (var pyObject = item.ToPython())\n                {\n                    pyList.Append(pyObject);\n                }\n            }\n\n            return pyList;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Type\"/> from a <see cref=\"PyObject\"/> that represents a C# type.\n        /// It throws an <see cref=\"ArgumentException\"/> if the <see cref=\"PyObject\"/> is not a C# type.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static Type GetType(PyObject pyObject)\n        {\n            if (pyObject.TryConvert(out Type type))\n            {\n                return type;\n            }\n\n            using (Py.GIL())\n            {\n                throw new ArgumentException($\"GetType(): {Messages.Extensions.ObjectFromPythonIsNotACSharpType(pyObject.Repr())}\");\n            }\n        }\n\n        /// <summary>\n        /// Converts the numeric value of one or more enumerated constants to an equivalent enumerated string.\n        /// </summary>\n        /// <param name=\"value\">Numeric value</param>\n        /// <param name=\"pyObject\">Python object that encapsulated a Enum Type</param>\n        /// <returns>String that represents the enumerated object</returns>\n        [Obsolete(\"Deprecated as of 2025-07. Please use `str()`.\")]\n        public static string GetEnumString(this int value, PyObject pyObject)\n        {\n            var type = GetType(pyObject);\n            return value.ToStringInvariant().ConvertTo(type).ToString();\n        }\n\n        /// <summary>\n        /// Converts the numeric value of one or more enumerated constants to an equivalent enumerated string.\n        /// </summary>\n        /// <param name=\"value\">Numeric value</param>\n        /// <param name=\"pyObject\">Python object that encapsulated a Enum Type</param>\n        /// <returns>String that represents the enumerated object</returns>\n        [Obsolete(\"Deprecated as of 2025-07. Please use `str()`.\")]\n        public static string GetEnumString(this Enum value, PyObject pyObject)\n        {\n            var type = GetType(pyObject);\n            return value.ToString();\n        }\n\n        /// <summary>\n        /// Try to create a type with a given name, if PyObject is not a CLR type. Otherwise, convert it.\n        /// </summary>\n        /// <param name=\"pyObject\">Python object representing a type.</param>\n        /// <param name=\"type\">Type object</param>\n        /// <returns>True if was able to create the type</returns>\n        public static bool TryCreateType(this PyObject pyObject, out Type type)\n        {\n            if (pyObject.TryConvert(out type))\n            {\n                // handles pure C# types\n                return true;\n            }\n\n            if (!PythonActivators.TryGetValue(pyObject.Handle, out var pythonType))\n            {\n                // Some examples:\n                // pytype: \"<class 'DropboxBaseDataUniverseSelectionAlgorithm.StockDataSource'>\"\n                // method: \"<bound method CoarseFineFundamentalComboAlgorithm.CoarseSelectionFunction of <CoarseFineFunda...\"\n                // array: \"[<QuantConnect.Symbol object at 0x000001EEF21ED480>]\"\n                if (pyObject.ToString().StartsWith(\"<class '\", StringComparison.InvariantCulture))\n                {\n                    type = CreateType(pyObject);\n                    return true;\n                }\n                return false;\n            }\n            type = pythonType.Type;\n            return true;\n        }\n\n\n        /// <summary>\n        /// Creates a type with a given name, if PyObject is not a CLR type. Otherwise, convert it.\n        /// </summary>\n        /// <param name=\"pyObject\">Python object representing a type.</param>\n        /// <returns>Type object</returns>\n        public static Type CreateType(this PyObject pyObject)\n        {\n            Type type;\n            if (pyObject.TryConvert(out type))\n            {\n                return type;\n            }\n\n            PythonActivator pythonType;\n            if (!PythonActivators.TryGetValue(pyObject.Handle, out pythonType))\n            {\n                var assemblyName = pyObject.GetAssemblyName();\n                var typeBuilder = AssemblyBuilder\n                    .DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run)\n                    .DefineDynamicModule(\"MainModule\")\n                    // creating the type as public is required to allow 'dynamic' to be able to bind at runtime\n                    .DefineType(assemblyName.Name, TypeAttributes.Class | TypeAttributes.Public, type);\n\n                pythonType = new PythonActivator(typeBuilder.CreateType(), pyObject);\n\n                ObjectActivator.AddActivator(pythonType.Type, pythonType.Factory);\n\n                // Save to prevent future additions\n                PythonActivators.Add(pyObject.Handle, pythonType);\n            }\n            return pythonType.Type;\n        }\n\n        /// <summary>\n        /// Helper method to get the assembly name from a python type\n        /// </summary>\n        /// <param name=\"pyObject\">Python object pointing to the python type. <see cref=\"PyObject.GetPythonType\"/></param>\n        /// <returns>The python type assembly name</returns>\n        public static AssemblyName GetAssemblyName(this PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                return new AssemblyName(pyObject.Repr().Split('\\'')[1]);\n            }\n        }\n\n        /// <summary>\n        /// Performs on-line batching of the specified enumerator, emitting chunks of the requested batch size\n        /// </summary>\n        /// <typeparam name=\"T\">The enumerable item type</typeparam>\n        /// <param name=\"enumerable\">The enumerable to be batched</param>\n        /// <param name=\"batchSize\">The number of items per batch</param>\n        /// <returns>An enumerable of lists</returns>\n        public static IEnumerable<List<T>> BatchBy<T>(this IEnumerable<T> enumerable, int batchSize)\n        {\n            using (var enumerator = enumerable.GetEnumerator())\n            {\n                List<T> list = null;\n                while (enumerator.MoveNext())\n                {\n                    if (list == null)\n                    {\n                        list = new List<T> { enumerator.Current };\n                    }\n                    else if (list.Count < batchSize)\n                    {\n                        list.Add(enumerator.Current);\n                    }\n                    else\n                    {\n                        yield return list;\n                        list = new List<T> { enumerator.Current };\n                    }\n                }\n\n                if (list?.Count > 0)\n                {\n                    yield return list;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Safely blocks until the specified task has completed executing\n        /// </summary>\n        /// <typeparam name=\"TResult\">The task's result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <returns>The result of the task</returns>\n        public static TResult SynchronouslyAwaitTaskResult<TResult>(this Task<TResult> task)\n        {\n            return task.ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Safely blocks until the specified task has completed executing\n        /// </summary>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <returns>The result of the task</returns>\n        public static void SynchronouslyAwaitTask(this Task task)\n        {\n            task.ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Safely blocks until the specified task has completed executing\n        /// </summary>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <returns>The result of the task</returns>\n        public static T SynchronouslyAwaitTask<T>(this Task<T> task)\n        {\n            return SynchronouslyAwaitTaskResult(task);\n        }\n\n        /// <summary>\n        /// Safely blocks until the specified task has completed executing\n        /// </summary>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <returns>The result of the task</returns>\n        public static void SynchronouslyAwaitTask(this ValueTask task)\n        {\n            if (task.IsCompleted)\n            {\n                return;\n            }\n            task.ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Safely blocks until the specified task has completed executing\n        /// </summary>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <returns>The result of the task</returns>\n        public static T SynchronouslyAwaitTask<T>(this ValueTask<T> task)\n        {\n            if (task.IsCompleted)\n            {\n                return task.Result;\n            }\n            return task.ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Convert dictionary to query string\n        /// </summary>\n        /// <param name=\"pairs\"></param>\n        /// <returns></returns>\n        public static string ToQueryString(this IDictionary<string, object> pairs)\n        {\n            return string.Join(\"&\", pairs.Select(pair => $\"{pair.Key}={pair.Value}\"));\n        }\n\n        /// <summary>\n        /// Returns a new string in which specified ending in the current instance is removed.\n        /// </summary>\n        /// <param name=\"s\">original string value</param>\n        /// <param name=\"ending\">the string to be removed</param>\n        /// <returns></returns>\n        public static string RemoveFromEnd(this string s, string ending)\n        {\n            if (s.EndsWith(ending, StringComparison.InvariantCulture))\n            {\n                return s.Substring(0, s.Length - ending.Length);\n            }\n            else\n            {\n                return s;\n            }\n        }\n\n        /// <summary>\n        /// Returns a new string in which specified start in the current instance is removed.\n        /// </summary>\n        /// <param name=\"s\">original string value</param>\n        /// <param name=\"start\">the string to be removed</param>\n        /// <returns>Substring with start removed</returns>\n        public static string RemoveFromStart(this string s, string start)\n        {\n            if (!string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(start) && s.StartsWith(start, StringComparison.InvariantCulture))\n            {\n                return s.Substring(start.Length);\n            }\n            else\n            {\n                return s;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine symbol for a live subscription\n        /// </summary>\n        /// <remarks>Useful for continuous futures where we subscribe to the underlying</remarks>\n        public static bool TryGetLiveSubscriptionSymbol(this Symbol symbol, out Symbol mapped)\n        {\n            mapped = null;\n            if (symbol.SecurityType == SecurityType.Future && symbol.IsCanonical() && symbol.HasUnderlying)\n            {\n                mapped = symbol.Underlying;\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the delisting date for the provided Symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to lookup the last trading date</param>\n        /// <param name=\"mapFile\">Map file to use for delisting date. Defaults to SID.DefaultDate if no value is passed and is equity.</param>\n        /// <returns></returns>\n        public static DateTime GetDelistingDate(this Symbol symbol, MapFile mapFile = null)\n        {\n            if (symbol.IsCanonical())\n            {\n                return Time.EndOfTime;\n            }\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Option:\n                    return OptionSymbol.GetLastDayOfTrading(symbol);\n                case SecurityType.FutureOption:\n                    return FutureOptionSymbol.GetLastDayOfTrading(symbol);\n                case SecurityType.Future:\n                case SecurityType.IndexOption:\n                    return symbol.ID.Date;\n                default:\n                    return mapFile?.DelistingDate ?? Time.EndOfTime;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine if a given symbol is of custom data\n        /// </summary>\n        public static bool IsCustomDataType<T>(this Symbol symbol)\n        {\n            return symbol.SecurityType == SecurityType.Base\n                && SecurityIdentifier.TryGetCustomDataType(symbol.ID.Symbol, out var type)\n                && type.Equals(typeof(T).Name, StringComparison.InvariantCultureIgnoreCase);\n        }\n\n        /// <summary>\n        /// Helper method that will return a back month, with future expiration, future contract based on the given offset\n        /// </summary>\n        /// <param name=\"symbol\">The none canonical future symbol</param>\n        /// <param name=\"offset\">The quantity of contracts to move into the future expiration chain</param>\n        /// <returns>A new future expiration symbol instance</returns>\n        public static Symbol AdjustSymbolByOffset(this Symbol symbol, uint offset)\n        {\n            if (symbol.SecurityType != SecurityType.Future || symbol.IsCanonical())\n            {\n                throw new InvalidOperationException(Messages.Extensions.ErrorAdjustingSymbolByOffset);\n            }\n\n            var expiration = symbol.ID.Date;\n            for (var i = 0; i < offset; i++)\n            {\n                var expiryFunction = FuturesExpiryFunctions.FuturesExpiryFunction(symbol);\n                DateTime newExpiration;\n                // for the current expiration we add a month to get the next one\n                var monthOffset = 0;\n                do\n                {\n                    monthOffset++;\n                    newExpiration = expiryFunction(expiration.AddMonths(monthOffset)).Date;\n                } while (newExpiration <= expiration);\n\n                expiration = newExpiration;\n                symbol = Symbol.CreateFuture(symbol.ID.Symbol, symbol.ID.Market, newExpiration);\n            }\n\n            return symbol;\n        }\n\n        /// <summary>\n        /// Helper method to get the mirror option symbol for a given option symbol\n        /// </summary>\n        /// <param name=\"contractSymbol\">The original option contract symbol</param>\n        /// <returns>The mirror option contract symbol</returns>\n        public static Symbol GetMirrorOptionSymbol(this Symbol contractSymbol)\n        {\n            if (!contractSymbol.SecurityType.IsOption() || contractSymbol.IsCanonical())\n            {\n                throw new ArgumentException(Messages.Extensions.NotAValidOptionSymbolForMirror);\n            }\n\n            return Symbol.CreateOption(contractSymbol.Underlying,\n                contractSymbol.ID.Symbol,\n                contractSymbol.ID.Market,\n                contractSymbol.ID.OptionStyle,\n                contractSymbol.ID.OptionRight.Invert(),\n                contractSymbol.ID.StrikePrice,\n                contractSymbol.ID.Date);\n        }\n\n        /// <summary>\n        /// Helper method to unsubscribe a given configuration, handling any required mapping\n        /// </summary>\n        public static void UnsubscribeWithMapping(this IDataQueueHandler dataQueueHandler, SubscriptionDataConfig dataConfig)\n        {\n            if (dataConfig.Symbol.TryGetLiveSubscriptionSymbol(out var mappedSymbol))\n            {\n                dataConfig = new SubscriptionDataConfig(dataConfig, symbol: mappedSymbol, mappedConfig: true);\n            }\n            dataQueueHandler.Unsubscribe(dataConfig);\n        }\n\n        /// <summary>\n        /// Helper method to subscribe a given configuration, handling any required mapping\n        /// </summary>\n        public static IEnumerator<BaseData> SubscribeWithMapping(this IDataQueueHandler dataQueueHandler,\n            SubscriptionDataConfig dataConfig,\n            EventHandler newDataAvailableHandler,\n            Func<SubscriptionDataConfig, bool> isExpired,\n            out SubscriptionDataConfig subscribedConfig)\n        {\n            subscribedConfig = dataConfig;\n            if (dataConfig.Symbol.TryGetLiveSubscriptionSymbol(out var mappedSymbol))\n            {\n                subscribedConfig = new SubscriptionDataConfig(dataConfig, symbol: mappedSymbol, mappedConfig: true);\n            }\n\n            // during warmup we might get requested to add some asset which has already expired in which case the live enumerator will be empty\n            IEnumerator<BaseData> result = null;\n            if (!isExpired(subscribedConfig))\n            {\n                result = dataQueueHandler.Subscribe(subscribedConfig, newDataAvailableHandler);\n            }\n            else\n            {\n                Log.Trace($\"SubscribeWithMapping(): skip live subscription for expired asset {subscribedConfig}\");\n            }\n            return result ?? Enumerable.Empty<BaseData>().GetEnumerator();\n        }\n\n        /// <summary>\n        /// Helper method to stream read lines from a file\n        /// </summary>\n        /// <param name=\"dataProvider\">The data provider to use</param>\n        /// <param name=\"file\">The file path to read from</param>\n        /// <returns>Enumeration of lines in file</returns>\n        public static IEnumerable<string> ReadLines(this IDataProvider dataProvider, string file)\n        {\n            if (dataProvider == null)\n            {\n                throw new ArgumentException(Messages.Extensions.NullDataProvider);\n            }\n            var stream = dataProvider.Fetch(file);\n            if (stream == null)\n            {\n                yield break;\n            }\n\n            using (var streamReader = new StreamReader(stream))\n            {\n                string line;\n                do\n                {\n                    line = streamReader.ReadLine();\n                    if (line != null)\n                    {\n                        yield return line;\n                    }\n                }\n                while (line != null);\n            }\n        }\n\n        /// <summary>\n        /// Scale data based on factor function\n        /// </summary>\n        /// <param name=\"data\">Data to Adjust</param>\n        /// <param name=\"factorFunc\">Function to factor prices by</param>\n        /// <param name=\"volumeFactor\">Factor to multiply volume/askSize/bidSize/quantity by</param>\n        /// <param name=\"factor\">Price scale</param>\n        /// <param name=\"sumOfDividends\">The current dividend sum</param>\n        /// <remarks>Volume values are rounded to the nearest integer, lot size purposefully not considered\n        /// as scaling only applies to equities</remarks>\n        public static BaseData Scale(this BaseData data, Func<decimal, decimal, decimal, decimal> factorFunc, decimal volumeFactor, decimal factor, decimal sumOfDividends)\n        {\n            switch (data.DataType)\n            {\n                case MarketDataType.TradeBar:\n                    var tradeBar = data as TradeBar;\n                    if (tradeBar != null)\n                    {\n                        tradeBar.Open = factorFunc(tradeBar.Open, factor, sumOfDividends);\n                        tradeBar.High = factorFunc(tradeBar.High, factor, sumOfDividends);\n                        tradeBar.Low = factorFunc(tradeBar.Low, factor, sumOfDividends);\n                        tradeBar.Close = factorFunc(tradeBar.Close, factor, sumOfDividends);\n                        tradeBar.Volume = Math.Round(tradeBar.Volume * volumeFactor);\n                    }\n                    break;\n                case MarketDataType.Tick:\n                    var securityType = data.Symbol.SecurityType;\n                    if (securityType != SecurityType.Equity &&\n                        securityType != SecurityType.Future &&\n                        !securityType.IsOption())\n                    {\n                        break;\n                    }\n\n                    var tick = data as Tick;\n                    if (tick == null || tick.TickType == TickType.OpenInterest)\n                    {\n                        break;\n                    }\n\n                    if (tick.TickType == TickType.Trade)\n                    {\n                        tick.Value = factorFunc(tick.Value, factor, sumOfDividends);\n                        tick.Quantity = Math.Round(tick.Quantity * volumeFactor);\n                        break;\n                    }\n\n                    tick.BidPrice = tick.BidPrice != 0 ? factorFunc(tick.BidPrice, factor, sumOfDividends) : 0;\n                    tick.BidSize = Math.Round(tick.BidSize * volumeFactor);\n                    tick.AskPrice = tick.AskPrice != 0 ? factorFunc(tick.AskPrice, factor, sumOfDividends) : 0;\n                    tick.AskSize = Math.Round(tick.AskSize * volumeFactor);\n\n                    if (tick.BidPrice == 0)\n                    {\n                        tick.Value = tick.AskPrice;\n                        break;\n                    }\n                    if (tick.AskPrice == 0)\n                    {\n                        tick.Value = tick.BidPrice;\n                        break;\n                    }\n\n                    tick.Value = (tick.BidPrice + tick.AskPrice) / 2m;\n                    break;\n                case MarketDataType.QuoteBar:\n                    var quoteBar = data as QuoteBar;\n                    if (quoteBar != null)\n                    {\n                        if (quoteBar.Ask != null)\n                        {\n                            quoteBar.Ask.Open = factorFunc(quoteBar.Ask.Open, factor, sumOfDividends);\n                            quoteBar.Ask.High = factorFunc(quoteBar.Ask.High, factor, sumOfDividends);\n                            quoteBar.Ask.Low = factorFunc(quoteBar.Ask.Low, factor, sumOfDividends);\n                            quoteBar.Ask.Close = factorFunc(quoteBar.Ask.Close, factor, sumOfDividends);\n                        }\n                        if (quoteBar.Bid != null)\n                        {\n                            quoteBar.Bid.Open = factorFunc(quoteBar.Bid.Open, factor, sumOfDividends);\n                            quoteBar.Bid.High = factorFunc(quoteBar.Bid.High, factor, sumOfDividends);\n                            quoteBar.Bid.Low = factorFunc(quoteBar.Bid.Low, factor, sumOfDividends);\n                            quoteBar.Bid.Close = factorFunc(quoteBar.Bid.Close, factor, sumOfDividends);\n                        }\n                        quoteBar.Value = quoteBar.Close;\n                        quoteBar.LastAskSize = Math.Round(quoteBar.LastAskSize * volumeFactor);\n                        quoteBar.LastBidSize = Math.Round(quoteBar.LastBidSize * volumeFactor);\n                    }\n                    break;\n                case MarketDataType.Auxiliary:\n                case MarketDataType.Base:\n                case MarketDataType.OptionChain:\n                case MarketDataType.FuturesChain:\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n            return data;\n        }\n\n        /// <summary>\n        /// Normalize prices based on configuration\n        /// </summary>\n        /// <param name=\"data\">Data to be normalized</param>\n        /// <param name=\"factor\">Price scale</param>\n        /// <param name=\"normalizationMode\">The price scaling normalization mode</param>\n        /// <param name=\"sumOfDividends\">The current dividend sum</param>\n        /// <returns>The provided data point adjusted</returns>\n        public static BaseData Normalize(this BaseData data, decimal factor, DataNormalizationMode normalizationMode, decimal sumOfDividends)\n        {\n            switch (normalizationMode)\n            {\n                case DataNormalizationMode.Adjusted:\n                case DataNormalizationMode.SplitAdjusted:\n                case DataNormalizationMode.ScaledRaw:\n                    return data?.Scale(TimesFactor, 1 / factor, factor, decimal.Zero);\n                case DataNormalizationMode.TotalReturn:\n                    return data.Scale(TimesFactor, 1 / factor, factor, sumOfDividends);\n\n                case DataNormalizationMode.BackwardsRatio:\n                    return data.Scale(TimesFactor, 1, factor, decimal.Zero);\n                case DataNormalizationMode.BackwardsPanamaCanal:\n                    return data.Scale(AdditionFactor, 1, factor, decimal.Zero);\n                case DataNormalizationMode.ForwardPanamaCanal:\n                    return data.Scale(AdditionFactor, 1, factor, decimal.Zero);\n\n                case DataNormalizationMode.Raw:\n                default:\n                    return data;\n            }\n        }\n\n        /// <summary>\n        /// Applies a times factor. We define this so we don't need to create it constantly\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static decimal TimesFactor(decimal target, decimal factor, decimal sumOfDividends)\n        {\n            return target * factor + sumOfDividends;\n        }\n\n        /// <summary>\n        /// Applies an addition factor. We define this so we don't need to create it constantly\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static decimal AdditionFactor(decimal target, decimal factor, decimal _)\n        {\n            return target + factor;\n        }\n\n        /// <summary>\n        /// Helper method to determine if price scales need an update based on the given data point\n        /// </summary>\n        public static DateTime GetUpdatePriceScaleFrontier(this BaseData data)\n        {\n            if (data != null)\n            {\n                var priceScaleFrontier = data.Time;\n                if (data.Time.Date != data.EndTime.Date && data.EndTime.TimeOfDay > TimeSpan.Zero)\n                {\n                    // if the data point goes from one day to another after midnight we use EndTime, this is due to differences between 'data' and 'exchage' time zone,\n                    // for example: NYMEX future CL 'data' TZ is UTC while 'exchange' TZ is NY, so daily bars go from 8PM 'X day' to 8PM 'X+1 day'. Note that the data\n                    // in the daily bar itself is filtered by exchange open, so it has data from 09:30 'X+1 day' to 17:00 'X+1 day' as expected.\n                    // A potential solution to avoid the need of this check is to adjust the daily data time zone to match the exchange time zone, following this example above\n                    // the daily bar would go from midnight X+1 day to midnight X+2\n                    // TODO: see related issue https://github.com/QuantConnect/Lean/issues/6964 which would avoid the need for this\n                    priceScaleFrontier = data.EndTime;\n                }\n                return priceScaleFrontier;\n            }\n            return DateTime.MinValue;\n        }\n\n        /// <summary>\n        /// Thread safe concurrent dictionary order by implementation by using <see cref=\"SafeEnumeration{TSource,TKey}\"/>\n        /// </summary>\n        /// <remarks>See https://stackoverflow.com/questions/47630824/is-c-sharp-linq-orderby-threadsafe-when-used-with-concurrentdictionarytkey-tva</remarks>\n        public static IOrderedEnumerable<KeyValuePair<TSource, TKey>> OrderBySafe<TSource, TKey>(\n            this ConcurrentDictionary<TSource, TKey> source, Func<KeyValuePair<TSource, TKey>, TSource> keySelector\n            )\n        {\n            return source.SafeEnumeration().OrderBy(keySelector);\n        }\n\n        /// <summary>\n        /// Thread safe concurrent dictionary order by implementation by using <see cref=\"SafeEnumeration{TSource,TKey}\"/>\n        /// </summary>\n        /// <remarks>See https://stackoverflow.com/questions/47630824/is-c-sharp-linq-orderby-threadsafe-when-used-with-concurrentdictionarytkey-tva</remarks>\n        public static IOrderedEnumerable<KeyValuePair<TSource, TKey>> OrderBySafe<TSource, TKey>(\n            this ConcurrentDictionary<TSource, TKey> source, Func<KeyValuePair<TSource, TKey>, TKey> keySelector\n            )\n        {\n            return source.SafeEnumeration().OrderBy(keySelector);\n        }\n\n        /// <summary>\n        /// Force concurrent dictionary enumeration using a thread safe implementation\n        /// </summary>\n        /// <remarks>See https://stackoverflow.com/questions/47630824/is-c-sharp-linq-orderby-threadsafe-when-used-with-concurrentdictionarytkey-tva</remarks>\n        public static IEnumerable<KeyValuePair<TSource, TKey>> SafeEnumeration<TSource, TKey>(\n            this ConcurrentDictionary<TSource, TKey> source)\n        {\n            foreach (var kvp in source)\n            {\n                yield return kvp;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine the right data mapping mode to use by default\n        /// </summary>\n        public static DataMappingMode GetUniverseMappingModeOrDefault(this UniverseSettings universeSettings, SecurityType securityType, string market)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Future:\n                    if ((universeSettings.DataMappingMode == DataMappingMode.OpenInterest\n                        || universeSettings.DataMappingMode == DataMappingMode.OpenInterestAnnual)\n                        && (market == Market.HKFE || market == Market.EUREX || market == Market.ICE))\n                    {\n                        // circle around default OI for currently no OI available data\n                        return DataMappingMode.LastTradingDay;\n                    }\n                    return universeSettings.DataMappingMode;\n                default:\n                    return universeSettings.DataMappingMode;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine the right data normalization mode to use by default\n        /// </summary>\n        public static DataNormalizationMode GetUniverseNormalizationModeOrDefault(this UniverseSettings universeSettings, SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Future:\n                    if (universeSettings.DataNormalizationMode is DataNormalizationMode.BackwardsRatio\n                        or DataNormalizationMode.BackwardsPanamaCanal or DataNormalizationMode.ForwardPanamaCanal\n                        or DataNormalizationMode.Raw)\n                    {\n                        return universeSettings.DataNormalizationMode;\n                    }\n                    return DataNormalizationMode.BackwardsRatio;\n                default:\n                    return universeSettings.DataNormalizationMode;\n            }\n        }\n\n        /// <summary>\n        /// Returns a hex string of the byte array.\n        /// </summary>\n        /// <param name=\"source\">the byte array to be represented as string</param>\n        /// <returns>A new string containing the items in the enumerable</returns>\n        public static string ToHexString(this byte[] source)\n        {\n            if (source == null || source.Length == 0)\n            {\n                throw new ArgumentException(Messages.Extensions.NullOrEmptySourceToConvertToHexString);\n            }\n\n            var hex = new StringBuilder(source.Length * 2);\n            foreach (var b in source)\n            {\n                hex.AppendFormat(CultureInfo.InvariantCulture, \"{0:x2}\", b);\n            }\n\n            return hex.ToString();\n        }\n\n        /// <summary>\n        /// Gets the option exercise order direction resulting from the specified <paramref name=\"right\"/> and\n        /// whether or not we wrote the option (<paramref name=\"isShort\"/> is <code>true</code>) or bought to\n        /// option (<paramref name=\"isShort\"/> is <code>false</code>)\n        /// </summary>\n        /// <param name=\"right\">The option right</param>\n        /// <param name=\"isShort\">True if we wrote the option, false if we purchased the option</param>\n        /// <returns>The order direction resulting from an exercised option</returns>\n        public static OrderDirection GetExerciseDirection(this OptionRight right, bool isShort)\n        {\n            switch (right)\n            {\n                case OptionRight.Call:\n                    return isShort ? OrderDirection.Sell : OrderDirection.Buy;\n                default:\n                    return isShort ? OrderDirection.Buy : OrderDirection.Sell;\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"OrderDirection\"/> for the specified <paramref name=\"quantity\"/>\n        /// </summary>\n        public static OrderDirection GetOrderDirection(decimal quantity)\n        {\n            var sign = Math.Sign(quantity);\n            switch (sign)\n            {\n                case 1: return OrderDirection.Buy;\n                case 0: return OrderDirection.Hold;\n                case -1: return OrderDirection.Sell;\n                default:\n                    throw new ApplicationException(\n                        $\"The skies are falling and the oceans are rising! Math.Sign({quantity}) returned {sign} :/\"\n                    );\n            }\n        }\n\n        /// <summary>\n        /// Helper method to process an algorithms security changes, will add and remove securities according to them\n        /// </summary>\n        public static void ProcessSecurityChanges(this IAlgorithm algorithm, SecurityChanges securityChanges)\n        {\n            foreach (var security in securityChanges.AddedSecurities)\n            {\n                // uses TryAdd, so don't need to worry about duplicates here\n                algorithm.Securities.Add(security);\n            }\n\n            var activeSecurities = algorithm.UniverseManager.ActiveSecurities;\n            foreach (var security in securityChanges.RemovedSecurities)\n            {\n                if (!activeSecurities.ContainsKey(security.Symbol))\n                {\n                    security.Reset();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper method to set the <see cref=\"Security.IsTradable\"/> property to <code>true</code>\n        /// for the given security when possible\n        /// </summary>\n        public static void MakeTradable(this Security security)\n        {\n            if (security.Type != SecurityType.Index || (security as Securities.Index.Index).ManualSetIsTradable)\n            {\n                security.IsTradable = true;\n            }\n        }\n\n        /// <summary>\n        /// Helper method to set an algorithm runtime exception in a normalized fashion\n        /// </summary>\n        public static void SetRuntimeError(this IAlgorithm algorithm, Exception exception, string context)\n        {\n            Log.Error(exception, $\"Extensions.SetRuntimeError(): {Messages.Extensions.RuntimeError(algorithm, context)}\");\n            exception = StackExceptionInterpreter.Instance.Value.Interpret(exception);\n            algorithm.RunTimeError = exception;\n            algorithm.SetStatus(AlgorithmStatus.RuntimeError);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"OptionChainUniverse\"/> for a given symbol\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <param name=\"symbol\">Symbol of the option</param>\n        /// <param name=\"filter\">The option filter to use</param>\n        /// <param name=\"universeSettings\">The universe settings, will use algorithm settings if null</param>\n        /// <returns><see cref=\"OptionChainUniverse\"/> for the given symbol</returns>\n        public static OptionChainUniverse CreateOptionChain(this IAlgorithm algorithm, Symbol symbol, PyObject filter, UniverseSettings universeSettings = null)\n        {\n            var result = CreateOptionChain(algorithm, symbol, out var option, universeSettings);\n            option.SetFilter(filter);\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"OptionChainUniverse\"/> for a given symbol\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <param name=\"symbol\">Symbol of the option</param>\n        /// <param name=\"filter\">The option filter to use</param>\n        /// <param name=\"universeSettings\">The universe settings, will use algorithm settings if null</param>\n        /// <returns><see cref=\"OptionChainUniverse\"/> for the given symbol</returns>\n        public static OptionChainUniverse CreateOptionChain(this IAlgorithm algorithm, Symbol symbol, Func<OptionFilterUniverse, OptionFilterUniverse> filter, UniverseSettings universeSettings = null)\n        {\n            var result = CreateOptionChain(algorithm, symbol, out var option, universeSettings);\n            option.SetFilter(filter);\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"OptionChainUniverse\"/> for a given symbol\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <param name=\"symbol\">Symbol of the option</param>\n        /// <param name=\"universeSettings\">The universe settings, will use algorithm settings if null</param>\n        /// <returns><see cref=\"OptionChainUniverse\"/> for the given symbol</returns>\n        private static OptionChainUniverse CreateOptionChain(this IAlgorithm algorithm, Symbol symbol, out Option option, UniverseSettings universeSettings = null)\n        {\n            if (!symbol.SecurityType.IsOption())\n            {\n                throw new ArgumentException(Messages.Extensions.CreateOptionChainRequiresOptionSymbol);\n            }\n\n            // resolve defaults if not specified\n            var settings = universeSettings ?? algorithm.UniverseSettings;\n\n            option = (Option)algorithm.AddSecurity(symbol.Canonical, settings.Resolution, settings.FillForward, settings.Leverage, settings.ExtendedMarketHours);\n\n            return (OptionChainUniverse)algorithm.UniverseManager.Values.Single(universe => universe.Configuration.Symbol == symbol.Canonical);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"FuturesChainUniverse\"/> for a given symbol\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <param name=\"symbol\">Symbol of the future</param>\n        /// <param name=\"filter\">The future filter to use</param>\n        /// <param name=\"universeSettings\">The universe settings, will use algorithm settings if null</param>\n        public static IEnumerable<Universe> CreateFutureChain(this IAlgorithm algorithm, Symbol symbol, PyObject filter, UniverseSettings universeSettings = null)\n        {\n            var result = CreateFutureChain(algorithm, symbol, out var future, universeSettings);\n            future.SetFilter(filter);\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"FuturesChainUniverse\"/> for a given symbol\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance to create universes for</param>\n        /// <param name=\"symbol\">Symbol of the future</param>\n        /// <param name=\"filter\">The future filter to use</param>\n        /// <param name=\"universeSettings\">The universe settings, will use algorithm settings if null</param>\n        public static IEnumerable<Universe> CreateFutureChain(this IAlgorithm algorithm, Symbol symbol, Func<FutureFilterUniverse, FutureFilterUniverse> filter, UniverseSettings universeSettings = null)\n        {\n            var result = CreateFutureChain(algorithm, symbol, out var future, universeSettings);\n            future.SetFilter(filter);\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"FuturesChainUniverse\"/> for a given symbol\n        /// </summary>\n        private static IEnumerable<Universe> CreateFutureChain(this IAlgorithm algorithm, Symbol symbol, out Future future, UniverseSettings universeSettings = null)\n        {\n            if (symbol.SecurityType != SecurityType.Future)\n            {\n                throw new ArgumentException(Messages.Extensions.CreateFutureChainRequiresFutureSymbol);\n            }\n\n            // resolve defaults if not specified\n            var settings = universeSettings ?? algorithm.UniverseSettings;\n\n            var dataNormalizationMode = settings.GetUniverseNormalizationModeOrDefault(symbol.SecurityType);\n\n            future = (Future)algorithm.AddSecurity(symbol.Canonical, settings.Resolution, settings.FillForward, settings.Leverage, settings.ExtendedMarketHours,\n                settings.DataMappingMode, dataNormalizationMode, settings.ContractDepthOffset);\n\n            // let's yield back both the future chain and the continuous future universe\n            return algorithm.UniverseManager.Values.Where(universe => universe.Configuration.Symbol == symbol.Canonical || ContinuousContractUniverse.CreateSymbol(symbol.Canonical) == universe.Configuration.Symbol);\n        }\n\n        private static bool _notifiedUniverseSettingsUsed;\n        private static readonly HashSet<SecurityType> _supportedSecurityTypes = new()\n        {\n            SecurityType.Equity,\n            SecurityType.Forex,\n            SecurityType.Cfd,\n            SecurityType.Option,\n            SecurityType.Future,\n            SecurityType.FutureOption,\n            SecurityType.IndexOption,\n            SecurityType.Crypto,\n            SecurityType.CryptoFuture\n        };\n\n        /// <summary>\n        /// Gets the security for the specified symbol from the algorithm's securities collection.\n        /// In case the security is not found, it will be created using the <see cref=\"IAlgorithm.UniverseSettings\"/>\n        /// and a best effort configuration setup.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"symbol\">The symbol which security is being looked up</param>\n        /// <param name=\"security\">The found or added security instance</param>\n        /// <param name=\"onError\">Callback to invoke in case of unsupported security type</param>\n        /// <returns>True if the security was found or added</returns>\n        public static bool GetOrAddUnrequestedSecurity(this IAlgorithm algorithm, Symbol symbol, out Security security,\n            Action<IReadOnlyCollection<SecurityType>> onError = null)\n        {\n            if (!algorithm.Securities.TryGetValue(symbol, out security))\n            {\n                if (!_supportedSecurityTypes.Contains(symbol.SecurityType))\n                {\n                    Log.Error(\"GetOrAddUnrequestedSecurity(): Unsupported security type: \" + symbol.SecurityType + \"-\" + symbol.Value);\n                    onError?.Invoke(_supportedSecurityTypes);\n                    return false;\n                }\n\n                var resolution = algorithm.UniverseSettings.Resolution;\n                var fillForward = algorithm.UniverseSettings.FillForward;\n                var leverage = algorithm.UniverseSettings.Leverage;\n                var extendedHours = algorithm.UniverseSettings.ExtendedMarketHours;\n\n                if (!_notifiedUniverseSettingsUsed)\n                {\n                    // let's just send the message once\n                    _notifiedUniverseSettingsUsed = true;\n\n                    var leverageMsg = $\" Leverage = {leverage};\";\n                    if (leverage == Security.NullLeverage)\n                    {\n                        leverageMsg = $\" Leverage = default;\";\n                    }\n                    algorithm.Debug($\"Will use UniverseSettings for automatically added securities for open orders and holdings. UniverseSettings:\" +\n                        $\" Resolution = {resolution};{leverageMsg} FillForward = {fillForward}; ExtendedHours = {extendedHours}\");\n                }\n\n                Log.Trace(\"GetOrAddUnrequestedSecurity(): Adding unrequested security: \" + symbol.Value);\n\n                if (symbol.SecurityType.IsOption())\n                {\n                    // add current option contract to the system\n                    security = algorithm.AddOptionContract(symbol, resolution, fillForward, leverage, extendedHours);\n                }\n                else if (symbol.SecurityType == SecurityType.Future)\n                {\n                    // add current future contract to the system\n                    security = algorithm.AddFutureContract(symbol, resolution, fillForward, leverage, extendedHours);\n                }\n                else\n                {\n                    // for items not directly requested set leverage to 1 and at the min resolution\n                    security = algorithm.AddSecurity(symbol.SecurityType, symbol.Value, resolution, symbol.ID.Market, fillForward, leverage, extendedHours);\n                }\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Inverts the specified <paramref name=\"right\"/>\n        /// </summary>\n        public static OptionRight Invert(this OptionRight right)\n        {\n            switch (right)\n            {\n                case OptionRight.Call: return OptionRight.Put;\n                case OptionRight.Put: return OptionRight.Call;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(right), right, null);\n            }\n        }\n\n        /// <summary>\n        /// Compares two values using given operator\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"op\">Comparison operator</param>\n        /// <param name=\"arg1\">The first value</param>\n        /// <param name=\"arg2\">The second value</param>\n        /// <returns>Returns true if its left-hand operand meets the operator value to its right-hand operand, false otherwise</returns>\n        public static bool Compare<T>(this ComparisonOperatorTypes op, T arg1, T arg2) where T : IComparable\n        {\n            return ComparisonOperator.Compare(op, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"Data.HistoryRequest\" /> instance to a <see cref=\"SubscriptionDataConfig\"/> instance\n        /// </summary>\n        /// <param name=\"request\">History request</param>\n        /// <param name=\"isInternalFeed\">\n        /// Set to true if this subscription is added for the sole purpose of providing currency conversion rates,\n        /// setting this flag to true will prevent the data from being sent into the algorithm's OnData methods\n        /// </param>\n        /// <param name=\"isFilteredSubscription\">True if this subscription should have filters applied to it (market hours/user filters from security), false otherwise</param>\n        /// <returns>Subscription data configuration</returns>\n        public static SubscriptionDataConfig ToSubscriptionDataConfig(this Data.HistoryRequest request, bool isInternalFeed = false, bool isFilteredSubscription = true)\n        {\n            return new SubscriptionDataConfig(request.DataType,\n                request.Symbol,\n                request.Resolution,\n                request.DataTimeZone,\n                request.ExchangeHours.TimeZone,\n                request.FillForwardResolution.HasValue,\n                request.IncludeExtendedMarketHours,\n                isInternalFeed,\n                request.IsCustomData,\n                request.TickType,\n                isFilteredSubscription,\n                request.DataNormalizationMode,\n                request.DataMappingMode,\n                request.ContractDepthOffset\n            );\n        }\n\n        /// <summary>\n        /// Centralized logic used at the top of the subscription enumerator stacks to determine if we should emit base data points\n        /// based on the configuration for this subscription and the type of data we are handling.\n        ///\n        /// Currently we only want to emit split/dividends/delisting events for non internal <see cref=\"TradeBar\"/> configurations\n        /// this last part is because equities also have <see cref=\"QuoteBar\"/> subscriptions which will also subscribe to the\n        /// same aux events and we don't want duplicate emits of these events in the TimeSliceFactory\n        /// </summary>\n        /// <remarks>The \"TimeSliceFactory\" does not allow for multiple dividends/splits per symbol in the same time slice\n        /// but we don't want to rely only on that to filter out duplicated aux data so we use this at the top of\n        /// our data enumerator stacks to define what subscription should emit this data.</remarks>\n        /// <remarks>We use this function to filter aux data at the top of the subscription enumerator stack instead of\n        /// stopping the subscription stack from subscribing to aux data at the bottom because of a\n        /// dependency with the FF enumerators requiring that they receive aux data to properly handle delistings.\n        /// Otherwise we would have issues with delisted symbols continuing to fill forward after expiry/delisting.\n        /// Reference PR #5485 and related issues for more.</remarks>\n        public static bool ShouldEmitData(this SubscriptionDataConfig config, BaseData data, bool isUniverse = false)\n        {\n            // For now we are only filtering Auxiliary data; so if its another type just return true or if it's a margin interest rate which we want to emit always\n            if (data.DataType != MarketDataType.Auxiliary)\n            {\n                return true;\n            }\n\n            // This filter does not apply to auxiliary data outside of delisting/splits/dividends so lets those emit\n            var type = data.GetType();\n            var expectedType = type.IsAssignableTo(config.Type);\n\n            // Check our config type first to be lazy about using data.GetType() unless required\n            var configTypeFilter = (config.Type == typeof(TradeBar) || config.Type.IsAssignableTo(typeof(BaseChainUniverseData)) ||\n                config.Type == typeof(Tick) && config.TickType == TickType.Trade || config.IsCustomData);\n\n            if (!configTypeFilter)\n            {\n                return expectedType;\n            }\n\n            // We don't want to pump in any data to `Universe.SelectSymbols(...)` if the\n            // type is not configured to be consumed by the universe. This change fixes\n            // a case where a `SymbolChangedEvent` was being passed to an ETF constituent universe\n            // for filtering/selection, and would result in either a runtime error\n            // if casting into the expected type explicitly, or call the filter function with\n            // no data being provided, resulting in all universe Symbols being de-selected.\n            if (isUniverse && !expectedType)\n            {\n                return (data as Delisting)?.Type == DelistingType.Delisted;\n            }\n\n            // We let delistings through. We need to emit delistings for all subscriptions, even internals like\n            // continuous futures mapped contracts. For instance, an algorithm might hold a position for a mapped\n            // contract and then the continuous future is mapped to a different contract. If the previously mapped\n            // contract is delisted, we need to let the delisting through so that positions are closed out and the\n            // security is removed from the algorithm and marked as delisted and non-tradable.\n            if (!(type == typeof(Split) || type == typeof(Dividend)))\n            {\n                return true;\n            }\n\n            // If we made it here then only filter it if its an InternalFeed\n            return !config.IsInternalFeed;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"OrderDirection\"/> that corresponds to the specified <paramref name=\"side\"/>\n        /// </summary>\n        /// <param name=\"side\">The position side to be converted</param>\n        /// <returns>The order direction that maps from the provided position side</returns>\n        public static OrderDirection ToOrderDirection(this PositionSide side)\n        {\n            switch (side)\n            {\n                case PositionSide.Short: return OrderDirection.Sell;\n                case PositionSide.None: return OrderDirection.Hold;\n                case PositionSide.Long: return OrderDirection.Buy;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(side), side, null);\n            }\n        }\n\n        /// <summary>\n        /// Determines if an order with the specified <paramref name=\"direction\"/> would close a position with the\n        /// specified <paramref name=\"side\"/>\n        /// </summary>\n        /// <param name=\"direction\">The direction of the order, buy/sell</param>\n        /// <param name=\"side\">The side of the position, long/short</param>\n        /// <returns>True if the order direction would close the position, otherwise false</returns>\n        public static bool Closes(this OrderDirection direction, PositionSide side)\n        {\n            switch (side)\n            {\n                case PositionSide.Short:\n                    switch (direction)\n                    {\n                        case OrderDirection.Buy: return true;\n                        case OrderDirection.Sell: return false;\n                        case OrderDirection.Hold: return false;\n                        default:\n                            throw new ArgumentOutOfRangeException(nameof(direction), direction, null);\n                    }\n\n                case PositionSide.Long:\n                    switch (direction)\n                    {\n                        case OrderDirection.Buy: return false;\n                        case OrderDirection.Sell: return true;\n                        case OrderDirection.Hold: return false;\n                        default:\n                            throw new ArgumentOutOfRangeException(nameof(direction), direction, null);\n                    }\n\n                case PositionSide.None:\n                    return false;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(side), side, null);\n            }\n        }\n\n        /// <summary>\n        /// Determines if the two lists are equal, including all items at the same indices.\n        /// </summary>\n        /// <typeparam name=\"T\">The element type</typeparam>\n        /// <param name=\"left\">The left list</param>\n        /// <param name=\"right\">The right list</param>\n        /// <returns>True if the two lists have the same counts and items at each index evaluate as equal</returns>\n        public static bool ListEquals<T>(this IReadOnlyList<T> left, IReadOnlyList<T> right)\n        {\n            var count = left.Count;\n            if (count != right.Count)\n            {\n                return false;\n            }\n\n            for (int i = 0; i < count; i++)\n            {\n                if (!left[i].Equals(right[i]))\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Computes a deterministic hash code based on the items in the list. This hash code is dependent on the\n        /// ordering of items.\n        /// </summary>\n        /// <typeparam name=\"T\">The element type</typeparam>\n        /// <param name=\"list\">The list</param>\n        /// <returns>A hash code dependent on the ordering of elements in the list</returns>\n        public static int GetListHashCode<T>(this IReadOnlyList<T> list)\n        {\n            unchecked\n            {\n                var hashCode = 17;\n                for (int i = 0; i < list.Count; i++)\n                {\n                    hashCode += (hashCode * 397) ^ list[i].GetHashCode();\n                }\n\n                return hashCode;\n            }\n        }\n\n        /// <summary>\n        /// Determine if this SecurityType requires mapping\n        /// </summary>\n        /// <param name=\"symbol\">Type to check</param>\n        /// <returns>True if it needs to be mapped</returns>\n        public static bool RequiresMapping(this Symbol symbol)\n        {\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.Base:\n                    return symbol.HasUnderlying && symbol.Underlying.RequiresMapping();\n                case SecurityType.Future:\n                    return symbol.IsCanonical();\n                case SecurityType.Equity:\n                case SecurityType.Option:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Checks whether the fill event for closing a trade is a winning trade\n        /// </summary>\n        /// <param name=\"fill\">The fill event</param>\n        /// <param name=\"security\">The security being traded</param>\n        /// <param name=\"profitLoss\">The profit-loss for the closed trade</param>\n        /// <returns>\n        /// Whether the trade is a win.\n        /// For options assignments this depends on whether the option is ITM or OTM and the position side.\n        /// See <see cref=\"Trade.IsWin\"/> for more information.\n        /// </returns>\n        public static bool IsWin(this OrderEvent fill, Security security, decimal profitLoss)\n        {\n            // For non-options or non-exercise orders, the trade is a win if the profit-loss is positive\n            if (!fill.Symbol.SecurityType.IsOption() || fill.Ticket.OrderType != OrderType.OptionExercise)\n            {\n                return profitLoss > 0;\n            }\n\n            var option = (Option)security;\n\n            // If the fill is a sell, the original transaction was a buy\n            if (fill.Direction == OrderDirection.Sell)\n            {\n                // If the option is ITM, the trade is a win only if the profit is greater than the ITM amount\n                return fill.IsInTheMoney && Math.Abs(profitLoss) < option.InTheMoneyAmount(fill.FillQuantity);\n            }\n\n            // It is a win if the buyer paid more than what they saved (the ITM amount)\n            return !fill.IsInTheMoney || Math.Abs(profitLoss) > option.InTheMoneyAmount(fill.FillQuantity);\n        }\n\n        /// <summary>\n        /// Gets the option's ITM amount for the given quantity.\n        /// </summary>\n        /// <param name=\"option\">The option security</param>\n        /// <param name=\"quantity\">The quantity</param>\n        /// <returns>The ITM amount for the absolute quantity</returns>\n        /// <remarks>The returned value can be negative, which would mean the option is actually OTM.</remarks>\n        public static ConvertibleCashAmount InTheMoneyAmount(this Option option, decimal quantity)\n        {\n            return option.Holdings.GetQuantityValue(Math.Abs(quantity), option.GetPayOff(option.Underlying.Price));\n        }\n\n        /// <summary>\n        /// Gets the greatest common divisor of a list of numbers\n        /// </summary>\n        /// <param name=\"values\">List of numbers which greatest common divisor is requested</param>\n        /// <returns>The greatest common divisor for the given list of numbers</returns>\n        public static decimal GreatestCommonDivisor(this IEnumerable<decimal> values)\n        {\n            return GreatestCommonDivisor(values.Select(Convert.ToInt32));\n        }\n\n        /// <summary>\n        /// Gets the greatest common divisor of a list of numbers\n        /// </summary>\n        /// <param name=\"values\">List of numbers which greatest common divisor is requested</param>\n        /// <returns>The greatest common divisor for the given list of numbers</returns>\n        public static int GreatestCommonDivisor(this IEnumerable<int> values)\n        {\n            int? result = null;\n            foreach (var value in values)\n            {\n                if (result.HasValue)\n                {\n                    result = GreatestCommonDivisor(result.Value, value);\n                }\n                else\n                {\n                    result = value;\n                }\n            }\n\n            if (!result.HasValue)\n            {\n                throw new ArgumentException(Messages.Extensions.GreatestCommonDivisorEmptyList);\n            }\n\n            return result.Value;\n        }\n\n        /// <summary>\n        /// Gets the greatest common divisor of two numbers\n        /// </summary>\n        private static int GreatestCommonDivisor(int a, int b)\n        {\n            int remainder;\n            while (b != 0)\n            {\n                remainder = a % b;\n                a = b;\n                b = remainder;\n            }\n            return Math.Abs(a);\n        }\n\n        /// <summary>\n        /// Safe method to perform divisions avoiding DivideByZeroException and Overflow/Underflow exceptions\n        /// </summary>\n        /// <param name=\"failValue\">Value to be returned if the denominator is zero</param>\n        /// <returns>The numerator divided by the denominator if the denominator is not\n        /// zero. Otherwise, the default failValue or the provided one</returns>\n        public static decimal SafeDivision(this decimal numerator, decimal denominator, decimal failValue = 0)\n        {\n            try\n            {\n                return (denominator == 0) ? failValue : (numerator / denominator);\n            }\n            catch\n            {\n                return failValue;\n            }\n        }\n\n        /// <summary>\n        /// Retrieve a common custom data types from the given symbols if any\n        /// </summary>\n        /// <param name=\"symbols\">The target symbols to search</param>\n        /// <returns>The custom data type or null</returns>\n        public static Type GetCustomDataTypeFromSymbols(Symbol[] symbols)\n        {\n            if (symbols.Length != 0)\n            {\n                if (!SecurityIdentifier.TryGetCustomDataTypeInstance(symbols[0].ID.Symbol, out var dataType)\n                    || symbols.Any(x => !SecurityIdentifier.TryGetCustomDataTypeInstance(x.ID.Symbol, out var customDataType) || customDataType != dataType))\n                {\n                    return null;\n                }\n                return dataType;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Determines if certain data type is custom\n        /// </summary>\n        /// <param name=\"symbol\">Symbol associated with the data type</param>\n        /// <param name=\"type\">Data type to determine if it's custom</param>\n        public static bool IsCustomDataType(Symbol symbol, Type type)\n        {\n            return type.Namespace != typeof(Bar).Namespace || Extensions.GetCustomDataTypeFromSymbols(new Symbol[] { symbol }) != null;\n        }\n\n        /// <summary>\n        /// Returns the amount of fee's charged by executing a market order with the given arguments\n        /// </summary>\n        /// <param name=\"security\">Security for which we would like to make a market order</param>\n        /// <param name=\"quantity\">Quantity of the security we are seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        public static CashAmount GetMarketOrderFees(Security security, decimal quantity, DateTime time)\n        {\n            var marketOrder = new MarketOrder(security.Symbol, quantity, time);\n            return security.FeeModel.GetOrderFee(new OrderFeeParameters(security, marketOrder)).Value;\n        }\n\n        private static Symbol ConvertToSymbol(PyObject item, bool dispose)\n        {\n            if (PyString.IsStringType(item))\n            {\n                return SymbolCache.GetSymbol(dispose ? item.GetAndDispose<string>() : item.As<string>());\n            }\n            else\n            {\n                Symbol symbol;\n                try\n                {\n                    symbol = dispose ? item.GetAndDispose<Symbol>() : item.As<Symbol>();\n                }\n                catch (Exception e)\n                {\n                    throw new ArgumentException(Messages.Extensions.ConvertToSymbolEnumerableFailed(item), e);\n                }\n                return symbol;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Field.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides static properties to be used as selectors with the indicator system\n    /// </summary>\n    public static partial class Field\n    {\n        private readonly static Func<IBaseData, decimal> _high = DataTypePropertyOrValue<IBaseDataBar>(x => x.High);\n        private readonly static Func<IBaseData, decimal> _low = DataTypePropertyOrValue<IBaseDataBar>(x => x.Low);\n        private readonly static Func<IBaseData, decimal> _open = DataTypePropertyOrValue<IBaseDataBar>(x => x.Open);\n        private readonly static Func<IBaseData, decimal> _bidClose = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Bid.Close);\n        private readonly static Func<IBaseData, decimal> _bidOpen = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Bid.Open);\n        private readonly static Func<IBaseData, decimal> _bidLow = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Bid.Low);\n        private readonly static Func<IBaseData, decimal> _bidHigh = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Bid.High);\n        private readonly static Func<IBaseData, decimal> _askClose = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Ask.Close);\n        private readonly static Func<IBaseData, decimal> _askOpen = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Ask.Open);\n        private readonly static Func<IBaseData, decimal> _askLow = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Ask.Low);\n        private readonly static Func<IBaseData, decimal> _askHigh = DataTypePropertyOrValue<QuoteBar>(x => ((QuoteBar)x).Ask.High);\n        private readonly static Func<IBaseData, decimal> _bidPrice = DataTypePropertyOrValue<Tick>(x => ((Tick)x).BidPrice, defaultQuoteSelector: x => ((QuoteBar)x).Bid.Close);\n        private readonly static Func<IBaseData, decimal> _askPrice = DataTypePropertyOrValue<Tick>(x => ((Tick)x).AskPrice, defaultQuoteSelector: x => ((QuoteBar)x).Ask.Close);\n        private readonly static Func<IBaseData, decimal> _volume = DataTypePropertyOrValue<TradeBar>(x => ((TradeBar)x).Volume, x => ((Tick)x).Quantity);\n        private readonly static Func<IBaseData, decimal> _average = DataTypePropertyOrValue<IBaseDataBar>(x => (x.Open + x.High + x.Low + x.Close) / 4m);\n        private readonly static Func<IBaseData, decimal> _median = DataTypePropertyOrValue<IBaseDataBar>(x => (x.High + x.Low) / 2m);\n        private readonly static Func<IBaseData, decimal> _typical = DataTypePropertyOrValue<IBaseDataBar>(x => (x.High + x.Low + x.Close) / 3m);\n        private readonly static Func<IBaseData, decimal> _weighted = DataTypePropertyOrValue<IBaseDataBar>(x => (x.High + x.Low + 2 * x.Close) / 4m);\n        private readonly static Func<IBaseData, decimal> _sevenBar = DataTypePropertyOrValue<IBaseDataBar>(x => (2 * x.Open + x.High + x.Low + 3 * x.Close) / 7m);\n\n        /// <summary>\n        /// Gets a selector that selectes the Bid close price\n        /// </summary>\n        public static Func<IBaseData, decimal> BidClose\n        {\n            get { return _bidClose; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Bid open price\n        /// </summary>\n        public static Func<IBaseData, decimal> BidOpen\n        {\n            get { return _bidOpen; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Bid low price\n        /// </summary>\n        public static Func<IBaseData, decimal> BidLow\n        {\n            get { return _bidLow; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Bid high price\n        /// </summary>\n        public static Func<IBaseData, decimal> BidHigh\n        {\n            get { return _bidHigh; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Ask close price\n        /// </summary>\n        public static Func<IBaseData, decimal> AskClose\n        {\n            get { return _askClose; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Ask open price\n        /// </summary>\n        public static Func<IBaseData, decimal> AskOpen\n        {\n            get { return _askOpen; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Ask low price\n        /// </summary>\n        public static Func<IBaseData, decimal> AskLow\n        {\n            get { return _askLow; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Ask high price\n        /// </summary>\n        public static Func<IBaseData, decimal> AskHigh\n        {\n            get { return _askHigh; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Ask price\n        /// </summary>\n        public static Func<IBaseData, decimal> AskPrice\n        {\n            get { return _askPrice; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectes the Bid price\n        /// </summary>\n        public static Func<IBaseData, decimal> BidPrice\n        {\n            get { return _bidPrice; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selects the Open value\n        /// </summary>\n        public static Func<IBaseData, decimal> Open\n        {\n            get { return _open; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selects the High value\n        /// </summary>\n        public static Func<IBaseData, decimal> High\n        {\n            get { return _high; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selects the Low value\n        /// </summary>\n        public static Func<IBaseData, decimal> Low\n        {\n            get { return _low; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selects the Close value\n        /// </summary>\n        public static Func<IBaseData, decimal> Close\n        {\n            get { return x => x.Value; }\n        }\n\n        /// <summary>\n        /// Defines an average price that is equal to (O + H + L + C) / 4\n        /// </summary>\n        public static Func<IBaseData, decimal> Average\n        {\n            get { return _average; }\n        }\n\n        /// <summary>\n        /// Defines an average price that is equal to (H + L) / 2\n        /// </summary>\n        public static Func<IBaseData, decimal> Median\n        {\n            get { return _median; }\n        }\n\n        /// <summary>\n        /// Defines an average price that is equal to (H + L + C) / 3\n        /// </summary>\n        public static Func<IBaseData, decimal> Typical\n        {\n            get { return _typical; }\n        }\n\n        /// <summary>\n        /// Defines an average price that is equal to (H + L + 2*C) / 4\n        /// </summary>\n        public static Func<IBaseData, decimal> Weighted\n        {\n            get { return _weighted; }\n        }\n\n        /// <summary>\n        /// Defines an average price that is equal to (2*O + H + L + 3*C)/7\n        /// </summary>\n        public static Func<IBaseData, decimal> SevenBar\n        {\n            get { return _sevenBar; }\n        }\n\n        /// <summary>\n        /// Gets a selector that selectors the Volume value\n        /// </summary>\n        public static Func<IBaseData, decimal> Volume\n        {\n            get { return _volume; }\n        }\n\n        private static Func<IBaseData, decimal> DataTypePropertyOrValue<T>(Func<T, decimal> selector,\n            Func<IBaseData, decimal> defaultTickSelector = null,\n            Func<IBaseData, decimal> defaultQuoteSelector = null)\n            where T: class, IBaseData\n        {\n            return x =>\n            {\n                var dataType = x as T;\n                if (dataType != null)\n                {\n                    return selector(dataType);\n                }\n\n                var tick = x as Tick;\n                if (tick != null && defaultTickSelector != null)\n                {\n                    return defaultTickSelector(x as Tick);\n                }\n\n                var quoteBar = x as QuoteBar;\n                if (quoteBar != null && defaultQuoteSelector != null)\n                {\n                    return defaultQuoteSelector(x as QuoteBar);\n                }\n\n                var defaultSelector = new Func<IBaseData, decimal>(data => data.Value);\n                return defaultSelector(x);\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/FileExtension.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Configuration;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Helper methods for file management\n    /// </summary>\n    public static class FileExtension\n    {\n        /// <summary>\n        /// Reserved words prefix from Configuration\n        /// </summary>\n        public static readonly string ReservedWordsPrefix = Config.Get(\"reserved-words-prefix\", \"@\");\n        private static readonly Regex ToValidWindowsPathRegex = new Regex(\"((?<=(\\\\\\\\|/|^))(CON|PRN|AUX|NUL|(COM[0-9])|(LPT[0-9]))(?=(\\\\.|\\\\\\\\|/|$)))\", RegexOptions.IgnoreCase | RegexOptions.Compiled);\n        private static readonly string _fixPathRegex = ReservedWordsPrefix + \"$&\"; // The string \"$&\" gets the matched word\n        private static readonly bool _isWindows = OS.IsWindows;\n\n        /// <summary>\n        /// Takes a given path and (if applicable) returns a modified path accepted by\n        /// Windows OS\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string ToNormalizedPath(string path)\n        {\n            return _isWindows ? ToValidWindowsPathRegex.Replace(path, _fixPathRegex) : path;\n        }\n\n        /// <summary>\n        /// Takes a modified path (see <see cref=\"ToNormalizedPath(string)\"/>) and (if applicable)\n        /// returns the original path proposed by LEAN\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string FromNormalizedPath(string path)\n        {\n            return _isWindows ? path.Replace(ReservedWordsPrefix, string.Empty) : path;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Global.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System.ComponentModel;\nusing QuantConnect.Securities;\nusing Newtonsoft.Json.Converters;\nusing System.Runtime.Serialization;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Shortcut date format strings\n    /// </summary>\n    public static class DateFormat\n    {\n        /// Year-Month-Date 6 Character Date Representation\n        public const string SixCharacter = \"yyMMdd\";\n        /// YYYY-MM-DD Eight Character Date Representation\n        public const string EightCharacter = \"yyyyMMdd\";\n        /// Daily and hourly time format\n        public const string TwelveCharacter = \"yyyyMMdd HH:mm\";\n        /// JSON Format Date Representation\n        public static string JsonFormat { get; } = \"yyyy-MM-ddTHH:mm:ss\";\n        /// MySQL Format Date Representation\n        public const string DB = \"yyyy-MM-dd HH:mm:ss\";\n        /// QuantConnect UX Date Representation\n        public const string UI = \"yyyy-MM-dd HH:mm:ss\";\n        /// ISO Date Representation\n        public const string ISOShort = \"yyyy-MM-ddTHH:mm:ssZ\";\n        /// en-US Short Date and Time Pattern\n        public const string USShort = \"M/d/yy h:mm tt\";\n        /// en-US Short Date Pattern\n        public const string USShortDateOnly = \"M/d/yy\";\n        /// en-US format\n        public const string US = \"M/d/yyyy h:mm:ss tt\";\n        /// en-US Date format\n        public const string USDateOnly = \"M/d/yyyy\";\n        /// Date format of QC forex data\n        public const string Forex = \"yyyyMMdd HH:mm:ss.ffff\";\n        /// Date format of FIX Protocol UTC Timestamp without milliseconds\n        public const string FIX = \"yyyyMMdd-HH:mm:ss\";\n        /// Date format of FIX Protocol UTC Timestamp with milliseconds\n        public const string FIXWithMillisecond = \"yyyyMMdd-HH:mm:ss.fff\";\n        /// YYYYMM Year and Month Character Date Representation (used for futures)\n        public const string YearMonth = \"yyyyMM\";\n    }\n\n    /// <summary>\n    /// Singular holding of assets from backend live nodes:\n    /// </summary>\n    [JsonConverter(typeof(HoldingJsonConverter))]\n    public class Holding\n    {\n        private decimal? _conversionRate;\n        private decimal _marketValue;\n        private decimal _unrealizedPnl;\n        private decimal _unrealizedPnLPercent;\n\n        /// Symbol of the Holding:\n        [JsonIgnore]\n        public Symbol Symbol { get; set; } = Symbol.Empty;\n\n        /// Type of the security\n        [JsonIgnore]\n        public SecurityType Type => Symbol.SecurityType;\n\n        /// The currency symbol of the holding, such as $\n        [DefaultValue(\"$\")]\n        [JsonProperty(PropertyName = \"c\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string CurrencySymbol { get; set; }\n\n        /// Average Price of our Holding in the currency the symbol is traded in\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"a\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal AveragePrice { get; set; }\n\n        /// Quantity of Symbol We Hold.\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"q\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal Quantity { get; set; }\n\n        /// Current Market Price of the Asset in the currency the symbol is traded in\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"p\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal MarketPrice { get; set; }\n\n        /// Current market conversion rate into the account currency\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"r\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal? ConversionRate\n        {\n            get\n            {\n                return _conversionRate;\n            }\n            set\n            {\n                if (value != 1)\n                {\n                    _conversionRate = value;\n                }\n            }\n        }\n\n        /// Current market value of the holding\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"v\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal MarketValue\n        {\n            get\n            {\n                return _marketValue;\n            }\n            set\n            {\n                _marketValue = value.SmartRoundingShort();\n            }\n        }\n\n        /// Current unrealized P/L of the holding\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"u\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal UnrealizedPnL\n        {\n            get\n            {\n                return _unrealizedPnl;\n            }\n            set\n            {\n                _unrealizedPnl = value.SmartRoundingShort();\n            }\n        }\n\n        /// Current unrealized P/L % of the holding\n        [JsonConverter(typeof(DecimalJsonConverter))]\n        [JsonProperty(PropertyName = \"up\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal UnrealizedPnLPercent\n        {\n            get\n            {\n                return _unrealizedPnLPercent;\n            }\n            set\n            {\n                _unrealizedPnLPercent = value.SmartRoundingShort();\n            }\n        }\n\n        /// Create a new default holding:\n        public Holding()\n        {\n            CurrencySymbol = \"$\";\n        }\n\n        /// <summary>\n        /// Create a simple JSON holdings from a Security holding class.\n        /// </summary>\n        /// <param name=\"security\">The security instance</param>\n        public Holding(Security security)\n            : this()\n        {\n            var holding = security.Holdings;\n\n            Symbol = holding.Symbol;\n            Quantity = holding.Quantity;\n            MarketValue = holding.HoldingsValue;\n            CurrencySymbol = Currencies.GetCurrencySymbol(security.QuoteCurrency.Symbol);\n            ConversionRate = security.QuoteCurrency.ConversionRate;\n\n            var rounding = security.SymbolProperties.MinimumPriceVariation.GetDecimalPlaces();\n\n            AveragePrice = Math.Round(holding.AveragePrice, rounding);\n            MarketPrice = Math.Round(holding.Price, rounding);\n            UnrealizedPnL = Math.Round(holding.UnrealizedProfit, 2);\n            UnrealizedPnLPercent = Math.Round(holding.UnrealizedProfitPercent * 100, 2);\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        /// <returns>A new Holding object with the same values as this one</returns>\n        public Holding Clone()\n        {\n            return new Holding\n            {\n                AveragePrice = AveragePrice,\n                Symbol = Symbol,\n                Quantity = Quantity,\n                MarketPrice = MarketPrice,\n                MarketValue = MarketValue,\n                UnrealizedPnL = UnrealizedPnL,\n                UnrealizedPnLPercent = UnrealizedPnLPercent,\n                ConversionRate = ConversionRate,\n                CurrencySymbol = CurrencySymbol\n            };\n        }\n\n        /// <summary>\n        /// Writes out the properties of this instance to string\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.Holding.ToString(this);\n        }\n\n        private class DecimalJsonConverter : JsonConverter\n        {\n            public override bool CanRead => false;\n            public override bool CanConvert(Type objectType) => typeof(decimal) == objectType;\n            public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n            {\n                writer.WriteRawValue(((decimal)value).NormalizeToStr());\n            }\n            public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n            {\n                throw new NotImplementedException();\n            }\n        }\n        private class HoldingJsonConverter : JsonConverter\n        {\n            public override bool CanWrite => false;\n            public override bool CanConvert(Type objectType) => typeof(Holding) == objectType;\n            public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n            {\n                var jObject = JObject.Load(reader);\n                var result = new Holding\n                {\n                    Symbol = jObject[\"symbol\"]?.ToObject<Symbol>() ?? jObject[\"Symbol\"]?.ToObject<Symbol>() ?? Symbol.Empty,\n                    CurrencySymbol = jObject[\"c\"]?.Value<string>() ?? jObject[\"currencySymbol\"]?.Value<string>() ?? jObject[\"CurrencySymbol\"]?.Value<string>() ?? string.Empty,\n                    AveragePrice = jObject[\"a\"]?.Value<decimal>() ?? jObject[\"averagePrice\"]?.Value<decimal>() ?? jObject[\"AveragePrice\"]?.Value<decimal>() ?? 0,\n                    Quantity = jObject[\"q\"]?.Value<decimal>() ?? jObject[\"quantity\"]?.Value<decimal>() ?? jObject[\"Quantity\"]?.Value<decimal>() ?? 0,\n                    MarketPrice = jObject[\"p\"]?.Value<decimal>() ?? jObject[\"marketPrice\"]?.Value<decimal>() ?? jObject[\"MarketPrice\"]?.Value<decimal>() ?? 0,\n                    ConversionRate = jObject[\"r\"]?.Value<decimal>() ?? jObject[\"conversionRate\"]?.Value<decimal>() ?? jObject[\"ConversionRate\"]?.Value<decimal>() ?? null,\n                    MarketValue = jObject[\"v\"]?.Value<decimal>() ?? jObject[\"marketValue\"]?.Value<decimal>() ?? jObject[\"MarketValue\"]?.Value<decimal>() ?? 0,\n                    UnrealizedPnL = jObject[\"u\"]?.Value<decimal>() ?? jObject[\"unrealizedPnl\"]?.Value<decimal>() ?? jObject[\"UnrealizedPnl\"]?.Value<decimal>() ?? 0,\n                    UnrealizedPnLPercent = jObject[\"up\"]?.Value<decimal>() ?? jObject[\"unrealizedPnLPercent\"]?.Value<decimal>() ?? jObject[\"UnrealizedPnLPercent\"]?.Value<decimal>() ?? 0,\n                };\n                if (!result.ConversionRate.HasValue)\n                {\n                    result.ConversionRate = 1;\n                }\n                if (string.IsNullOrEmpty(result.CurrencySymbol))\n                {\n                    result.CurrencySymbol = \"$\";\n                }\n                return result;\n            }\n            public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n\n    /// <summary>\n    /// Represents the types of environments supported by brokerages for trading\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum BrokerageEnvironment\n    {\n        /// <summary>\n        /// Live trading (0)\n        /// </summary>\n        [EnumMember(Value = \"live\")]\n        Live,\n\n        /// <summary>\n        /// Paper trading (1)\n        /// </summary>\n        [EnumMember(Value = \"paper\")]\n        Paper\n    }\n\n    /// <summary>\n    /// Multilanguage support enum: which language is this project for the interop bridge converter.\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum Language\n    {\n        /// <summary>\n        /// C# Language Project (0)\n        /// </summary>\n        [EnumMember(Value = \"C#\")]\n        CSharp,\n\n        /// <summary>\n        /// FSharp Project (1)\n        /// </summary>\n        [EnumMember(Value = \"F#\")]\n        FSharp,\n\n        /// <summary>\n        /// Visual Basic Project (2)\n        /// </summary>\n        [EnumMember(Value = \"VB\")]\n        VisualBasic,\n\n        /// <summary>\n        /// Java Language Project (3)\n        /// </summary>\n        [EnumMember(Value = \"Ja\")]\n        Java,\n\n        /// <summary>\n        /// Python Language Project (4)\n        /// </summary>\n        [EnumMember(Value = \"Py\")]\n        Python\n    }\n\n    /// <summary>\n    /// Live server types available through the web IDE. / QC deployment.\n    /// </summary>\n    public enum ServerType\n    {\n        /// <summary>\n        /// Additional server (0)\n        /// </summary>\n        Server512,\n\n        /// <summary>\n        /// Upgraded server (1)\n        /// </summary>\n        Server1024,\n\n        /// <summary>\n        /// Server with 2048 MB Ram (2)\n        /// </summary>\n        Server2048\n    }\n\n    /// <summary>\n    /// Type of tradable security / underlying asset\n    /// </summary>\n    public enum SecurityType\n    {\n        /// <summary>\n        /// Base class for all security types (0)\n        /// </summary>\n        Base,\n\n        /// <summary>\n        /// US Equity Security (1)\n        /// </summary>\n        Equity,\n\n        /// <summary>\n        /// Option Security Type (2)\n        /// </summary>\n        Option,\n\n        /// <summary>\n        /// Commodity Security Type (3)\n        /// </summary>\n        Commodity,\n\n        /// <summary>\n        /// FOREX Security (4)\n        /// </summary>\n        Forex,\n\n        /// <summary>\n        /// Future Security Type (5)\n        /// </summary>\n        Future,\n\n        /// <summary>\n        /// Contract For a Difference Security Type (6)\n        /// </summary>\n        Cfd,\n\n        /// <summary>\n        /// Cryptocurrency Security Type (7)\n        /// </summary>\n        Crypto,\n\n        /// <summary>\n        /// Futures Options Security Type (8)\n        /// </summary>\n        /// <remarks>\n        /// Futures options function similar to equity options, but with a few key differences.\n        /// Firstly, the contract unit of trade is 1x, rather than 100x. This means that each\n        /// option represents the right to buy or sell 1 future contract at expiry/exercise.\n        /// The contract multiplier for Futures Options plays a big part in determining the premium\n        /// of the option, which can also differ from the underlying future's multiplier.\n        /// </remarks>\n        FutureOption,\n\n        /// <summary>\n        /// Index Security Type (9)\n        /// </summary>\n        Index,\n\n        /// <summary>\n        /// Index Option Security Type (10)\n        /// </summary>\n        /// <remarks>\n        /// For index options traded on American markets, they tend to be European-style options and are Cash-settled.\n        /// </remarks>\n        IndexOption,\n\n        /// <summary>\n        /// Crypto Future Type (11)\n        /// </summary>\n        CryptoFuture,\n    }\n\n    /// <summary>\n    /// Account type: margin or cash\n    /// </summary>\n    public enum AccountType\n    {\n        /// <summary>\n        /// Margin account type (0)\n        /// </summary>\n        Margin,\n\n        /// <summary>\n        /// Cash account type (1)\n        /// </summary>\n        Cash\n    }\n\n    /// <summary>\n    /// Market data style: is the market data a summary (OHLC style) bar, or is it a time-price value.\n    /// </summary>\n    public enum MarketDataType\n    {\n        /// <summary>\n        /// Base market data type (0)\n        /// </summary>\n        Base,\n\n        /// <summary>\n        /// TradeBar market data type (OHLC summary bar) (1)\n        /// </summary>\n        TradeBar,\n\n        /// <summary>\n        /// Tick market data type (price-time pair) (2)\n        /// </summary>\n        Tick,\n\n        /// <summary>\n        /// Data associated with an instrument (3)\n        /// </summary>\n        Auxiliary,\n\n        /// <summary>\n        /// QuoteBar market data type (4) [Bid(OHLC), Ask(OHLC) and Mid(OHLC) summary bar]\n        /// </summary>\n        QuoteBar,\n\n        /// <summary>\n        /// Option chain data (5)\n        /// </summary>\n        OptionChain,\n\n        /// <summary>\n        /// Futures chain data (6)\n        /// </summary>\n        FuturesChain\n    }\n\n    /// <summary>\n    /// Datafeed enum options for selecting the source of the datafeed.\n    /// </summary>\n    public enum DataFeedEndpoint\n    {\n        /// <summary>\n        /// Backtesting Datafeed Endpoint (0)\n        /// </summary>\n        Backtesting,\n\n        /// <summary>\n        /// Loading files off the local system (1)\n        /// </summary>\n        FileSystem,\n\n        /// <summary>\n        /// Getting datafeed from a QC-Live-Cloud (2)\n        /// </summary>\n        LiveTrading,\n\n        /// <summary>\n        /// Database (3)\n        /// </summary>\n        Database\n    }\n\n    /// <summary>\n    /// Cloud storage permission options.\n    /// </summary>\n    public enum StoragePermissions\n    {\n        /// <summary>\n        /// Public Storage Permissions (0)\n        /// </summary>\n        Public,\n\n        /// <summary>\n        /// Authenticated Read Storage Permissions (1)\n        /// </summary>\n        Authenticated\n    }\n\n    /// <summary>\n    /// Types of tick data\n    /// </summary>\n    /// <remarks>QuantConnect currently only has trade, quote, open interest tick data.</remarks>\n    public enum TickType\n    {\n        /// <summary>\n        /// Trade type tick object (0)\n        /// </summary>\n        Trade,\n\n        /// <summary>\n        /// Quote type tick object (1)\n        /// </summary>\n        Quote,\n\n        /// <summary>\n        /// Open Interest type tick object (for options, futures) (2)\n        /// </summary>\n        OpenInterest\n    }\n\n    /// <summary>\n    /// Specifies the type of <see cref=\"QuantConnect.Data.Market.Delisting\"/> data\n    /// </summary>\n    public enum DelistingType\n    {\n        /// <summary>\n        /// Specifies a warning of an imminent delisting (0)\n        /// </summary>\n        Warning = 0,\n\n        /// <summary>\n        /// Specifies the symbol has been delisted (1)\n        /// </summary>\n        Delisted = 1\n    }\n\n    /// <summary>\n    /// Specifies the type of <see cref=\"QuantConnect.Data.Market.Split\"/> data\n    /// </summary>\n    public enum SplitType\n    {\n        /// <summary>\n        /// Specifies a warning of an imminent split event (0)\n        /// </summary>\n        Warning = 0,\n\n        /// <summary>\n        /// Specifies the symbol has been split (1)\n        /// </summary>\n        SplitOccurred = 1\n    }\n\n    /// <summary>\n    /// Resolution of data requested.\n    /// </summary>\n    /// <remarks>Always sort the enum from the smallest to largest resolution</remarks>\n    public enum Resolution\n    {\n        /// <summary>\n        /// Tick Resolution (0)\n        /// </summary>\n        Tick,\n\n        /// <summary>\n        /// Second Resolution (1)\n        /// </summary>\n        Second,\n\n        /// <summary>\n        /// Minute Resolution (2)\n        /// </summary>\n        Minute,\n\n        /// <summary>\n        /// Hour Resolution (3)\n        /// </summary>\n        Hour,\n\n        /// <summary>\n        /// Daily Resolution (4)\n        /// </summary>\n        Daily\n    }\n\n    /// <summary>\n    /// Specifies what side a position is on, long/short\n    /// </summary>\n    public enum PositionSide\n    {\n        /// <summary>\n        /// A short position, quantity less than zero (-1)\n        /// </summary>\n        Short = -1,\n\n        /// <summary>\n        /// No position, quantity equals zero (0)\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// A long position, quantity greater than zero (1)\n        /// </summary>\n        Long = 1\n    }\n\n    /// <summary>\n    /// Specifies the different types of options\n    /// </summary>\n    public enum OptionRight\n    {\n        /// <summary>\n        /// A call option, the right to buy at the strike price (0)\n        /// </summary>\n        Call,\n\n        /// <summary>\n        /// A put option, the right to sell at the strike price (1)\n        /// </summary>\n        Put\n    }\n\n    /// <summary>\n    /// Specifies the style of an option\n    /// </summary>\n    public enum OptionStyle\n    {\n        /// <summary>\n        /// American style options are able to be exercised at any time on or before the expiration date (0)\n        /// </summary>\n        American,\n\n        /// <summary>\n        /// European style options are able to be exercised on the expiration date only (1)\n        /// </summary>\n        European\n    }\n\n    /// <summary>\n    /// Specifies the type of settlement in derivative deals\n    /// </summary>\n    public enum SettlementType\n    {\n        /// <summary>\n        /// Physical delivery of the underlying security (0)\n        /// </summary>\n        PhysicalDelivery,\n\n        /// <summary>\n        /// Cash is paid/received on settlement (1)\n        /// </summary>\n        Cash\n    }\n\n    /// <summary>\n    /// Wrapper for algorithm status enum to include the charting subscription.\n    /// </summary>\n    public class AlgorithmControl\n    {\n        /// <summary>\n        /// Default initializer for algorithm control class.\n        /// </summary>\n        public AlgorithmControl()\n        {\n            // default to true, API can override\n            Initialized = false;\n            HasSubscribers = true;\n            Status = AlgorithmStatus.Running;\n            ChartSubscription = Messages.AlgorithmControl.ChartSubscription;\n        }\n\n        /// <summary>\n        /// Register this control packet as not defaults.\n        /// </summary>\n        public bool Initialized { get; set; }\n\n        /// <summary>\n        /// Current run status of the algorithm id.\n        /// </summary>\n        public AlgorithmStatus Status { get; set; }\n\n        /// <summary>\n        /// Currently requested chart.\n        /// </summary>\n        public string ChartSubscription { get; set; }\n\n        /// <summary>\n        /// True if there's subscribers on the channel\n        /// </summary>\n        public bool HasSubscribers { get; set; }\n    }\n\n    /// <summary>\n    /// States of a live deployment.\n    /// </summary>\n    public enum AlgorithmStatus\n    {\n        /// <summary>\n        /// Error compiling algorithm at start (0)\n        /// </summary>\n        DeployError,\n\n        /// <summary>\n        /// Waiting for a server (1)\n        /// </summary>\n        InQueue,\n\n        /// <summary>\n        /// Running algorithm (2)\n        /// </summary>\n        Running,\n\n        /// <summary>\n        /// Stopped algorithm or exited with runtime errors (3)\n        /// </summary>\n        Stopped,\n\n        /// <summary>\n        /// Liquidated algorithm (4)\n        /// </summary>\n        Liquidated,\n\n        /// <summary>\n        /// Algorithm has been deleted (5)\n        /// </summary>\n        Deleted,\n\n        /// <summary>\n        /// Algorithm completed running (6)\n        /// </summary>\n        Completed,\n\n        /// <summary>\n        /// Runtime Error Stoped Algorithm (7)\n        /// </summary>\n        RuntimeError,\n\n        /// <summary>\n        /// Error in the algorithm id (not used) (8)\n        /// </summary>\n        Invalid,\n\n        /// <summary>\n        /// The algorithm is logging into the brokerage (9)\n        /// </summary>\n        LoggingIn,\n\n        /// <summary>\n        /// The algorithm is initializing (10)\n        /// </summary>\n        Initializing,\n\n        /// <summary>\n        /// History status update (11)\n        /// </summary>\n        History\n    }\n\n    /// <summary>\n    /// Specifies where a subscription's data comes from\n    /// </summary>\n    public enum SubscriptionTransportMedium\n    {\n        /// <summary>\n        /// The subscription's data comes from disk (0)\n        /// </summary>\n        LocalFile,\n\n        /// <summary>\n        /// The subscription's data is downloaded from a remote source (1)\n        /// </summary>\n        RemoteFile,\n\n        /// <summary>\n        /// The subscription's data comes from a rest call that is polled and returns a single line/data point of information (2)\n        /// </summary>\n        Rest,\n\n        /// <summary>\n        /// The subscription's data is streamed (3)\n        /// </summary>\n        Streaming,\n\n        /// <summary>\n        /// The subscription's data comes from the object store (4)\n        /// </summary>\n        ObjectStore\n    }\n\n    /// <summary>\n    /// Used by the <see cref=\"Data.LeanDataWriter\"/> to determine which merge write policy should be applied\n    /// </summary>\n    public enum WritePolicy\n    {\n        /// <summary>\n        /// Will overwrite any existing file or zip entry with the new content (0)\n        /// </summary>\n        Overwrite = 0,\n\n        /// <summary>\n        /// Will inject and merge new content with the existings file content (1)\n        /// </summary>\n        Merge,\n\n        /// <summary>\n        /// Will append new data to the end of the file or zip entry (2)\n        /// </summary>\n        Append\n    }\n\n    /// <summary>\n    /// enum Period - Enum of all the analysis periods, AS integers. Reference \"Period\" Array to access the values\n    /// </summary>\n    public enum Period\n    {\n        /// <summary>\n        /// Period Short Codes - 10\n        /// </summary>\n        TenSeconds = 10,\n\n        /// <summary>\n        /// Period Short Codes - 30 Second\n        /// </summary>\n        ThirtySeconds = 30,\n\n        /// <summary>\n        /// Period Short Codes - 60 Second\n        /// </summary>\n        OneMinute = 60,\n\n        /// <summary>\n        /// Period Short Codes - 120 Second\n        /// </summary>\n        TwoMinutes = 120,\n\n        /// <summary>\n        /// Period Short Codes - 180 Second\n        /// </summary>\n        ThreeMinutes = 180,\n\n        /// <summary>\n        /// Period Short Codes - 300 Second\n        /// </summary>\n        FiveMinutes = 300,\n\n        /// <summary>\n        /// Period Short Codes - 600 Second\n        /// </summary>\n        TenMinutes = 600,\n\n        /// <summary>\n        /// Period Short Codes - 900 Second\n        /// </summary>\n        FifteenMinutes = 900,\n\n        /// <summary>\n        /// Period Short Codes - 1200 Second\n        /// </summary>\n        TwentyMinutes = 1200,\n\n        /// <summary>\n        /// Period Short Codes - 1800 Second\n        /// </summary>\n        ThirtyMinutes = 1800,\n\n        /// <summary>\n        /// Period Short Codes - 3600 Second\n        /// </summary>\n        OneHour = 3600,\n\n        /// <summary>\n        /// Period Short Codes - 7200 Second\n        /// </summary>\n        TwoHours = 7200,\n\n        /// <summary>\n        /// Period Short Codes - 14400 Second\n        /// </summary>\n        FourHours = 14400,\n\n        /// <summary>\n        /// Period Short Codes - 21600 Second\n        /// </summary>\n        SixHours = 21600\n    }\n\n    /// <summary>\n    /// Specifies how data is normalized before being sent into an algorithm\n    /// </summary>\n    public enum DataNormalizationMode\n    {\n        /// <summary>\n        /// No modifications to the asset price at all. For Equities, dividends are paid in cash and splits are applied directly to your portfolio quantity. (0)\n        /// </summary>\n        Raw,\n        /// <summary>\n        /// Splits and dividends are backward-adjusted into the price of the asset. The price today is identical to the current market price. (1)\n        /// </summary>\n        Adjusted,\n        /// <summary>\n        /// Equity splits are applied to the price adjustment but dividends are paid in cash to your portfolio. This normalization mode allows you to manage dividend payments (e.g. reinvestment) while still giving a smooth time series of prices for indicators. (2)\n        /// </summary>\n        SplitAdjusted,\n        /// <summary>\n        /// Equity splits are applied to the price adjustment and the value of all future dividend payments is added to the initial asset price. (3)\n        /// </summary>\n        TotalReturn,\n        /// <summary>\n        /// Eliminates price jumps between two consecutive contracts, adding a factor based on the difference of their prices. The first contract has the true price. Factor 0. (4)\n        /// </summary>\n        /// <remarks>First contract is the true one, factor 0</remarks>\n        ForwardPanamaCanal,\n        /// <summary>\n        /// Eliminates price jumps between two consecutive contracts, adding a factor based on the difference of their prices. The last contract has the true price. Factor 0. (5)\n        /// </summary>\n        /// <remarks>Last contract is the true one, factor 0</remarks>\n        BackwardsPanamaCanal,\n        /// <summary>\n        /// Eliminates price jumps between two consecutive contracts, multiplying the prices by their ratio. The last contract has the true price. Factor 1. (6)\n        /// </summary>\n        /// <remarks>Last contract is the true one, factor 1</remarks>\n        BackwardsRatio,\n        /// <summary>\n        /// Splits and dividends are adjusted into the prices in a given date. Only for history requests. (7)\n        /// </summary>\n        ScaledRaw,\n    }\n\n    /// <summary>\n    /// Continuous contracts mapping modes\n    /// </summary>\n    public enum DataMappingMode\n    {\n        /// <summary>\n        /// The contract maps on the previous day of expiration of the front month (0)\n        /// </summary>\n        LastTradingDay,\n        /// <summary>\n        /// The contract maps on the first date of the delivery month of the front month. If the contract expires prior to this date,\n        /// then it rolls on the contract's last trading date instead (1)\n        /// </summary>\n        /// <remarks>For example, the Crude Oil WTI (CL) 'DEC 2021 CLZ1' contract expires on November, 19 2021, so the mapping date will be its expiration date.</remarks>\n        /// <remarks>Another example is the Corn 'DEC 2021 ZCZ1' contract, which expires on December, 14 2021, so the mapping date will be December 1, 2021.</remarks>\n        FirstDayMonth,\n        /// <summary>\n        /// The contract maps when the following back month contract has a higher open interest that the current front month (2)\n        /// </summary>\n        OpenInterest,\n        /// <summary>\n        /// The contract maps when any of the back month contracts of the next year have a higher volume that the current front month (3)\n        /// </summary>\n        OpenInterestAnnual,\n    }\n\n    /// <summary>\n    /// The different types of <see cref=\"CashBook.Updated\"/> events\n    /// </summary>\n    public enum CashBookUpdateType\n    {\n        /// <summary>\n        /// A new <see cref=\"Cash.Symbol\"/> was added (0)\n        /// </summary>\n        Added,\n        /// <summary>\n        /// One or more <see cref=\"Cash\"/> instances were removed (1)\n        /// </summary>\n        Removed,\n        /// <summary>\n        /// An existing <see cref=\"Cash.Symbol\"/> was updated (2)\n        /// </summary>\n        Updated\n    }\n\n    /// <summary>\n    /// Defines Lean exchanges codes and names\n    /// </summary>\n    public static class Exchanges\n    {\n        /// <summary>\n        /// Gets the exchange as single character representation.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string GetPrimaryExchangeCodeGetPrimaryExchange(this string exchange,\n            SecurityType securityType = SecurityType.Equity,\n            string market = Market.USA)\n        {\n            return exchange.GetPrimaryExchange(securityType, market).Code;\n        }\n\n        /// <summary>\n        /// Gets the exchange as PrimaryExchange object.\n        /// </summary>\n        /// <remarks>Useful for performance</remarks>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Exchange GetPrimaryExchange(this string exchange,\n            SecurityType securityType = SecurityType.Equity,\n            string market = Market.USA)\n        {\n            var primaryExchange = Exchange.UNKNOWN;\n            if (string.IsNullOrEmpty(exchange))\n            {\n                return primaryExchange;\n            }\n\n            if (securityType == SecurityType.Equity)\n            {\n                switch (exchange.LazyToUpper())\n                {\n                    case \"T\":\n                    case \"Q\":\n                    case \"NASDAQ\":\n                    case \"NASDAQ_OMX\":\n                        return Exchange.NASDAQ;\n                    case \"Z\":\n                    case \"BATS\":\n                    case \"BATS Z\":\n                    case \"BATS_Z\":\n                        return Exchange.BATS;\n                    case \"P\":\n                    case \"ARCA\":\n                        return Exchange.ARCA;\n                    case \"N\":\n                    case \"NYSE\":\n                        return Exchange.NYSE;\n                    case \"C\":\n                    case \"NSX\":\n                    case \"NSE\":\n                        if (market == Market.USA)\n                        {\n                            return Exchange.NSX;\n                        }\n                        else if (market == Market.India)\n                        {\n                            return Exchange.NSE;\n                        }\n                        return Exchange.UNKNOWN;\n                    case \"D\":\n                    case \"FINRA\":\n                        return Exchange.FINRA;\n                    case \"I\":\n                    case \"ISE\":\n                        return Exchange.ISE;\n                    case \"M\":\n                    case \"CSE\":\n                        return Exchange.CSE;\n                    case \"W\":\n                    case \"CBOE\":\n                        return Exchange.CBOE;\n                    case \"A\":\n                    case \"AMEX\":\n                        return Exchange.AMEX;\n                    case \"SIAC\":\n                        return Exchange.SIAC;\n                    case \"J\":\n                    case \"EDGA\":\n                        return Exchange.EDGA;\n                    case \"K\":\n                    case \"EDGX\":\n                        return Exchange.EDGX;\n                    case \"B\":\n                    case \"NASDAQ BX\":\n                    case \"NASDAQ_BX\":\n                        return Exchange.NASDAQ_BX;\n                    case \"X\":\n                    case \"NASDAQ PSX\":\n                    case \"NASDAQ_PSX\":\n                        return Exchange.NASDAQ_PSX;\n                    case \"Y\":\n                    case \"BATS Y\":\n                    case \"BATS_Y\":\n                    case \"BYX\":\n                        return Exchange.BATS_Y;\n                    case \"BB\":\n                    case \"BOSTON\":\n                        return Exchange.BOSTON;\n                    case \"BSE\":\n                        return Exchange.BSE;\n                    case \"IEX\":\n                        return Exchange.IEX;\n                    case \"SMART\":\n                        return Exchange.SMART;\n                    case \"OTCX\":\n                        return Exchange.OTCX;\n                    case \"MP\":\n                    case \"MIAX PEARL\":\n                    case \"MIAX_PEARL\":\n                        return Exchange.MIAX_PEARL;\n                    case \"L\":\n                    case \"LTSE\":\n                        return Exchange.LTSE;\n                    case \"MM\":\n                    case \"MEMX\":\n                        return Exchange.MEMX;\n                    case \"CSFB\":\n                        return Exchange.CSFB;\n                }\n            }\n            else if (securityType == SecurityType.Option)\n            {\n                switch (exchange.LazyToUpper())\n                {\n                    case \"A\":\n                    case \"AMEX\":\n                        return Exchange.AMEX_Options;\n                    case \"M\":\n                    case \"MIAX\":\n                        return Exchange.MIAX;\n                    case \"ME\":\n                    case \"MIAX EMERALD\":\n                    case \"MIAX_EMERALD\":\n                        return Exchange.MIAX_EMERALD;\n                    case \"MP\":\n                    case \"MIAX PEARL\":\n                    case \"MIAX_PEARL\":\n                        return Exchange.MIAX_PEARL;\n                    case \"I\":\n                    case \"ISE\":\n                        return Exchange.ISE;\n                    case \"H\":\n                    case \"ISE GEMINI\":\n                    case \"ISE_GEMINI\":\n                        return Exchange.ISE_GEMINI;\n                    case \"J\":\n                    case \"ISE MERCURY\":\n                    case \"ISE_MERCURY\":\n                        return Exchange.ISE_MERCURY;\n                    case \"O\":\n                    case \"OPRA\":\n                        return Exchange.OPRA;\n                    case \"W\":\n                    case \"C2\":\n                        return Exchange.C2;\n                    case \"XNDQ\":\n                        return Exchange.NASDAQ_Options;\n                    case \"ARCX\":\n                        return Exchange.ARCA_Options;\n                    case \"EDGO\":\n                        return Exchange.EDGO;\n                    case \"BOX\":\n                    case \"B\":\n                        return Exchange.BOX;\n                    case \"PHLX\":\n                        return Exchange.PHLX;\n                    case \"SPHR\":\n                    case \"MIAX SAPPHIRE\":\n                    case \"MIAX_SAPPHIRE\":\n                        return Exchange.MIAX_SAPPHIRE;\n                    default:\n                        return Exchange.UNKNOWN;\n                }\n            }\n            else if (securityType == SecurityType.Future || securityType == SecurityType.FutureOption)\n            {\n                switch (exchange.LazyToUpper())\n                {\n                    case \"CME\":\n                        return Exchange.CME;\n                    case \"CBOT\":\n                        return Exchange.CBOT;\n                    case \"NYMEX\":\n                        return Exchange.NYMEX;\n                    case \"ICE\":\n                        return Exchange.ICE;\n                    case \"CFE\":\n                        return Exchange.CFE;\n                    case \"COMEX\":\n                        return Exchange.COMEX;\n                    case \"NYSELIFFE\":\n                        return Exchange.NYSELIFFE;\n                    case \"EUREX\":\n                        return Exchange.EUREX;\n                    default:\n                        return Exchange.UNKNOWN;\n                }\n            }\n            return Exchange.UNKNOWN;\n        }\n    }\n\n    /// <summary>\n    /// Defines the different channel status values\n    /// </summary>\n    public static class ChannelStatus\n    {\n        /// <summary>\n        /// The channel is empty\n        /// </summary>\n        public const string Vacated = \"channel_vacated\";\n\n        /// <summary>\n        /// The channel has subscribers\n        /// </summary>\n        public const string Occupied = \"channel_occupied\";\n    }\n\n    /// <summary>\n    /// Represents the types deployment targets for algorithms\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum DeploymentTarget\n    {\n        /// <summary>\n        /// Cloud Platform (0)\n        /// </summary>\n        CloudPlatform,\n\n        /// <summary>\n        /// Local Platform (1)\n        /// </summary>\n        LocalPlatform,\n\n        /// <summary>\n        /// Private Cloud Platform (2)\n        /// </summary>\n        PrivateCloudPlatform\n    }\n\n    /// <summary>\n    /// Represents the deployment modes of an algorithm\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum AlgorithmMode\n    {\n        /// <summary>\n        /// Live (0)\n        /// </summary>\n        Live,\n\n        /// <summary>\n        /// Optimization (1)\n        /// </summary>\n        Optimization,\n\n        /// <summary>\n        /// Backtesting (2)\n        /// </summary>\n        Backtesting,\n\n        /// <summary>\n        /// Research (3)\n        /// </summary>\n        Research\n    }\n}\n"
  },
  {
    "path": "Common/Globals.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing System.Reflection;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides application level constant values\n    /// </summary>\n    public static class Globals\n    {\n        static Globals()\n        {\n            Reset();\n        }\n\n        /// <summary>\n        /// The base api url address to use\n        /// </summary>\n        public static string Api { get; set; }\n\n        /// <summary>\n        /// The user Id\n        /// </summary>\n        public static int UserId { get; set; }\n\n        /// <summary>\n        /// The project id\n        /// </summary>\n        public static int ProjectId { get; set; }\n\n        /// <summary>\n        /// The user token\n        /// </summary>\n        public static string UserToken { get; set; }\n\n        /// <summary>\n        /// The organization id\n        /// </summary>\n        public static string OrganizationID { get; set; }\n\n        /// <summary>\n        /// The results destination folder\n        /// </summary>\n        public static string ResultsDestinationFolder { get; set; }\n\n        /// <summary>\n        /// The root directory of the data folder for this application\n        /// </summary>\n        public static string DataFolder { get; private set; }\n\n        /// <summary>\n        /// True if running in live mode\n        /// </summary>\n        public static bool LiveMode { get; private set; }\n\n        /// <summary>\n        /// Resets global values with the Config data.\n        /// </summary>\n        public static void Reset ()\n        {\n            CacheDataFolder = DataFolder = Config.Get(\"data-folder\", @\"../../../Data/\");\n\n            Version = Assembly.GetExecutingAssembly().GetName().Version.ToString();\n            var versionid = Config.Get(\"version-id\");\n            if (!string.IsNullOrWhiteSpace(versionid))\n            {\n                Version += \".\" + versionid;\n            }\n\n            var cacheLocation = Config.Get(\"cache-location\");\n            if (!string.IsNullOrEmpty(cacheLocation) && !cacheLocation.IsDirectoryEmpty())\n            {\n                CacheDataFolder = cacheLocation;\n            }\n\n            LiveMode = Config.GetBool(\"live-mode\");\n\n            UserId = Config.GetInt(\"job-user-id\");\n            ProjectId = Config.GetInt(\"project-id\");\n            UserToken = Config.Get(\"api-access-token\");\n            OrganizationID = Config.Get(\"job-organization-id\");\n            Api = Config.Get(\"api-url\", \"https://www.quantconnect.com/api/v2/\");\n            ResultsDestinationFolder = Config.Get(\"results-destination-folder\", Directory.GetCurrentDirectory());\n        }\n\n        /// <summary>\n        /// The directory used for storing downloaded remote files\n        /// </summary>\n        public const string Cache = \"./cache/data\";\n\n        /// <summary>\n        /// The version of lean\n        /// </summary>\n        public static string Version { get; private set; }\n\n        /// <summary>\n        /// Data path to cache folder location\n        /// </summary>\n        public static string CacheDataFolder { get; private set; }\n\n        /// <summary>\n        /// Helper method that will build a data folder path checking if it exists on the cache folder else will return data folder\n        /// </summary>\n        public static string GetDataFolderPath(string relativePath)\n        {\n            var result = Path.Combine(CacheDataFolder, relativePath);\n            if (result.IsDirectoryEmpty())\n            {\n                result = Path.Combine(DataFolder, relativePath);\n            }\n\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/IDataDownloader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Data Downloader Interface for pulling data from a remote source.\n    /// </summary>\n    public interface IDataDownloader\n    {\n        /// <summary>\n        /// Get historical data enumerable for a single symbol, type and resolution given this start and end time (in UTC).\n        /// </summary>\n        /// <param name=\"dataDownloaderGetParameters\">model class for passing in parameters for historical data</param>\n        /// <returns>Enumerable of base data for this symbol</returns>\n        IEnumerable<BaseData> Get(DataDownloaderGetParameters dataDownloaderGetParameters);\n    }\n}\n"
  },
  {
    "path": "Common/IIsolatorLimitResultProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides an abstraction for managing isolator limit results.\n    /// This is originally intended to be used by the training feature to permit a single\n    /// algorithm time loop to extend past the default of ten minutes\n    /// </summary>\n    public interface IIsolatorLimitResultProvider\n    {\n        /// <summary>\n        /// Determines whether or not a custom isolator limit has be reached.\n        /// </summary>\n        IsolatorLimitResult IsWithinLimit();\n\n        /// <summary>\n        /// Requests additional time from the isolator result provider. This is intended\n        /// to prevent <see cref=\"IsWithinLimit\"/> from returning an error result.\n        /// This method will throw a <see cref=\"TimeoutException\"/> if there is insufficient\n        /// resources available to fulfill the specified number of minutes.\n        /// </summary>\n        /// <param name=\"minutes\">The number of additional minutes to request</param>\n        void RequestAdditionalTime(int minutes);\n\n        /// <summary>\n        /// Attempts to request additional time from the isolator result provider. This is intended\n        /// to prevent <see cref=\"IsWithinLimit\"/> from returning an error result.\n        /// This method will only return false if there is insufficient resources available to fulfill\n        /// the specified number of minutes.\n        /// </summary>\n        /// <param name=\"minutes\">The number of additional minutes to request</param>\n        bool TryRequestAdditionalTime(int minutes);\n    }\n}"
  },
  {
    "path": "Common/ISeriesPoint.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Single chart series point/bar data.\n    /// </summary>\n    public interface ISeriesPoint\n    {\n        /// <summary>\n        /// Time of this chart series point\n        /// </summary>\n        DateTime Time { get; set; }\n\n        /// <summary>\n        /// Clone implementation for ISeriesPoint\n        /// </summary>\n        /// <returns>Clone of the series</returns>\n        ISeriesPoint Clone();\n    }\n}\n"
  },
  {
    "path": "Common/ITimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides access to the current time in UTC. This doesn't necessarily\n    /// need to be wall-clock time, but rather the current time in some system\n    /// </summary>\n    public interface ITimeProvider\n    {\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        DateTime GetUtcNow();\n    }\n}"
  },
  {
    "path": "Common/Indicators/IIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// KEEPING THIS INTERFACE FOR BACKWARDS COMPATIBILITY.\n    /// Represents an indicator that can receive data updates and emit events when the value of\n    /// the indicator has changed.\n    /// </summary>\n    public interface IIndicator<T> : IComparable<IIndicator<T>>, IIndicator\n        where T : IBaseData\n    {\n    }\n\n    /// <summary>\n    /// Represents an indicator that can receive data updates and emit events when the value of\n    /// the indicator has changed.\n    /// </summary>\n    public interface IIndicator : IComparable\n    {\n        /// <summary>\n        /// Event handler that fires after this indicator is updated\n        /// </summary>\n        event IndicatorUpdatedHandler Updated;\n\n        /// <summary>\n        /// Gets a name for this indicator\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        bool IsReady { get; }\n\n        /// <summary>\n        /// Gets the current state of this indicator. If the state has not been updated\n        /// then the time on the value will equal DateTime.MinValue.\n        /// </summary>\n        IndicatorDataPoint Current { get; }\n\n        /// <summary>\n        /// Gets the number of samples processed by this indicator\n        /// </summary>\n        long Samples { get; }\n\n        /// <summary>\n        /// Updates the state of this indicator with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"input\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        bool Update(IBaseData input);\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        void Reset();\n    }\n}\n"
  },
  {
    "path": "Common/Indicators/IIndicatorWarmUpPeriodProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator with a warm up period provider.\n    /// </summary>\n    public interface IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        int WarmUpPeriod { get; }\n    }\n}"
  },
  {
    "path": "Common/Indicators/IReadOnlyWindow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    ///     Interface type used to pass windows around without worry of external modification\n    /// </summary>\n    /// <typeparam name=\"T\">The type of data in the window</typeparam>\n    public interface IReadOnlyWindow<out T> : IEnumerable<T>\n    {\n        /// <summary>\n        ///     Gets the size of this window\n        /// </summary>\n        int Size { get; }\n\n        /// <summary>\n        ///     Gets the current number of elements in this window\n        /// </summary>\n        int Count { get; }\n\n        /// <summary>\n        ///     Gets the number of samples that have been added to this window over its lifetime\n        /// </summary>\n        int Samples { get; }\n\n        /// <summary>\n        ///     Indexes into this window, where index 0 is the most recently\n        ///     entered value\n        /// </summary>\n        /// <param name=\"i\">the index, i</param>\n        /// <returns>the ith most recent entry</returns>\n        T this[int i] { get; }\n\n        /// <summary>\n        ///     Gets a value indicating whether or not this window is ready, i.e,\n        ///     it has been filled to its capacity, this is when the Size==Count\n        /// </summary>\n        bool IsReady { get; }\n\n        /// <summary>\n        ///     Gets the most recently removed item from the window. This is the\n        ///     piece of data that just 'fell off' as a result of the most recent\n        ///     add. If no items have been removed, this will throw an exception.\n        /// </summary>\n        T MostRecentlyRemoved { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Indicators/IndicatorDataPoint.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents a piece of data at a specific time\n    /// </summary>\n    public class IndicatorDataPoint : BaseData, IEquatable<IndicatorDataPoint>, IComparable<IndicatorDataPoint>, IComparable\n    {\n        /// <summary>\n        /// Initializes a new default instance of IndicatorDataPoint with a time of\n        /// DateTime.MinValue and a Value of 0m.\n        /// </summary>\n        public IndicatorDataPoint()\n        {\n            Value = 0m;\n            Time = DateTime.MinValue;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the DataPoint type using the specified time/data\n        /// </summary>\n        /// <param name=\"time\">The time this data was produced</param>\n        /// <param name=\"value\">The data</param>\n        public IndicatorDataPoint(DateTime time, decimal value)\n        {\n            Time = time;\n            Value = value;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the DataPoint type using the specified time/data\n        /// </summary>\n        /// <param name=\"symbol\">The symbol associated with this data</param>\n        /// <param name=\"time\">The time this data was produced</param>\n        /// <param name=\"value\">The data</param>\n        public IndicatorDataPoint(Symbol symbol, DateTime time, decimal value)\n        {\n            Symbol = symbol;\n            Time = time;\n            Value = value;\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(IndicatorDataPoint other)\n        {\n            if (other == null)\n            {\n                return false;\n            }\n            return other.Time == Time && other.Value == Value;\n        }\n\n        /// <summary>\n        /// Compares the current object with another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the <paramref name=\"other\"/> parameter.Zero This object is equal to <paramref name=\"other\"/>. Greater than zero This object is greater than <paramref name=\"other\"/>.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public int CompareTo(IndicatorDataPoint other)\n        {\n            if (ReferenceEquals(other, null))\n            {\n                // everything is greater than null via MSDN\n                return 1;\n            }\n            return Value.CompareTo(other.Value);\n        }\n\n        /// <summary>\n        /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.\n        /// </summary>\n        /// <returns>\n        /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name=\"obj\"/> in the sort order. Zero This instance occurs in the same position in the sort order as <paramref name=\"obj\"/>. Greater than zero This instance follows <paramref name=\"obj\"/> in the sort order.\n        /// </returns>\n        /// <param name=\"obj\">An object to compare with this instance. </param><exception cref=\"T:System.ArgumentException\"><paramref name=\"obj\"/> is not the same type as this instance. </exception><filterpriority>2</filterpriority>\n        public int CompareTo(object obj)\n        {\n            var other = obj as IndicatorDataPoint;\n            if (other == null)\n            {\n                throw new ArgumentException(Messages.IndicatorDataPoint.InvalidObjectTypeToCompareTo(GetType()));\n            }\n            return CompareTo(other);\n        }\n\n        /// <summary>\n        /// Returns a string representation of this DataPoint instance using ISO8601 formatting for the date\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.String\" /> containing a fully qualified type name.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.IndicatorDataPoint.ToString(this);\n        }\n\n        /// <summary>\n        /// Indicates whether this instance and a specified object are equal.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"obj\" /> and this instance are the same type and represent the same value; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">Another object to compare to. </param>\n        /// <filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            return obj is IndicatorDataPoint && Equals((IndicatorDataPoint) obj);\n        }\n\n        /// <summary>\n        /// Returns the hash code for this instance.\n        /// </summary>\n        /// <returns>\n        /// A 32-bit signed integer that is the hash code for this instance.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (Value.GetHashCode()*397) ^ Time.GetHashCode();\n            }\n        }\n\n        /// <summary>\n        /// Returns the data held within the instance\n        /// </summary>\n        /// <param name=\"instance\">The DataPoint instance</param>\n        /// <returns>The data held within the instance</returns>\n        public static implicit operator decimal(IndicatorDataPoint instance)\n        {\n            return instance.Value;\n        }\n\n        /// <summary>\n        /// This function is purposefully not implemented.\n        /// </summary>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            throw new NotImplementedException(Messages.IndicatorDataPoint.UnsupportedMethod(nameof(Reader)));\n        }\n\n        /// <summary>\n        /// This function is purposefully not implemented.\n        /// </summary>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            throw new NotImplementedException(Messages.IndicatorDataPoint.UnsupportedMethod(nameof(GetSource)));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Indicators/IndicatorUpdatedHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Event handler type for the IndicatorBase.Updated event\n    /// </summary>\n    /// <param name=\"sender\">The indicator that fired the event</param>\n    /// <param name=\"updated\">The new piece of data produced by the indicator</param>\n    public delegate void IndicatorUpdatedHandler(object sender, IndicatorDataPoint updated);\n}"
  },
  {
    "path": "Common/Indicators/InternalIndicatorValues.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Data;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Collection of indicator data points for a given time\n    /// </summary>\n    public class IndicatorDataPoints : DynamicData\n    {\n        /// <summary>\n        /// The indicator value at a given point\n        /// </summary>\n        public IndicatorDataPoint Current => (IndicatorDataPoint)GetProperty(\"Current\");\n\n        /// <summary>\n        /// The indicator value at a given point\n        /// </summary>\n        public override decimal Value => Current.Value;\n\n        /// <summary>\n        /// Access the historical indicator values per indicator property name\n        /// </summary>\n        public IndicatorDataPoint this[string name]\n        {\n            get\n            {\n                return GetProperty(name) as IndicatorDataPoint;\n            }\n        }\n\n        /// <summary>\n        /// String representation\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{EndTime} {string.Join(\", \", GetStorageDictionary().OrderBy(x => x.Key).Select(x => $\"{x.Key}: {HandleObjectStorage(x.Value)}\"))}\";\n        }\n\n        /// <summary>\n        /// Returns the current data value held within the instance\n        /// </summary>\n        /// <param name=\"instance\">The DataPoint instance</param>\n        /// <returns>The current data value held within the instance</returns>\n        public static implicit operator decimal(IndicatorDataPoints instance)\n        {\n            return instance.Value;\n        }\n\n        private static string HandleObjectStorage(object storedObject)\n        {\n            if (storedObject is IndicatorDataPoint point)\n            {\n                return point.Value.SmartRounding().ToStringInvariant();\n            }\n            return storedObject?.ToString() ?? string.Empty;\n        }\n    }\n\n    /// <summary>\n    /// Internal carrier of an indicator values by property name\n    /// </summary>\n    public class InternalIndicatorValues : IEnumerable<IndicatorDataPoint>\n    {\n        /// <summary>\n        /// The name of the values associated to this dto\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// The indicator values\n        /// </summary>\n        public List<IndicatorDataPoint> Values { get; }\n\n        /// <summary>\n        /// The target indicator\n        /// </summary>\n        protected IIndicator Indicator { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public InternalIndicatorValues(IIndicator indicator, string name)\n        {\n            Name = name;\n            Values = new();\n            Indicator = indicator;\n        }\n\n        /// <summary>\n        /// Update with a new indicator point\n        /// </summary>\n        public virtual IndicatorDataPoint UpdateValue()\n        {\n            Values.Add(Indicator.Current);\n            return Indicator.Current;\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public static InternalIndicatorValues Create(IIndicator indicator, string name)\n        {\n            return new InternalIndicatorValues(indicator, name);\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public static InternalIndicatorValues Create(IIndicator indicator, PropertyInfo propertyInfo)\n        {\n            return new IndicatorPropertyValues(indicator, propertyInfo);\n        }\n\n        /// <summary>\n        /// String representation\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Name} {Values.Count} indicator values\";\n        }\n\n        /// <summary>\n        /// Returns an enumerator for the indicator values\n        /// </summary>\n        public IEnumerator<IndicatorDataPoint> GetEnumerator()\n        {\n            return ((IEnumerable<IndicatorDataPoint>)Values).GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return ((IEnumerable)Values).GetEnumerator();\n        }\n\n        private class IndicatorPropertyValues : InternalIndicatorValues\n        {\n            private readonly PropertyInfo _currentInfo;\n            private readonly PropertyInfo _propertyInfo;\n            public IndicatorPropertyValues(IIndicator indicator, PropertyInfo propertyInfo) : base(indicator, propertyInfo.Name)\n            {\n                _propertyInfo = propertyInfo;\n                _currentInfo = _propertyInfo.PropertyType.GetProperty(\"Current\");\n            }\n            public override IndicatorDataPoint UpdateValue()\n            {\n                var value = _propertyInfo.GetValue(Indicator);\n                if (value == null)\n                {\n                    return null;\n                }\n\n                if (_currentInfo != null)\n                {\n                    value = _currentInfo.GetValue(value);\n                }\n                var point = value as IndicatorDataPoint;\n\n                if (Values.Count == 0 || point.EndTime != Values[^1].EndTime)\n                {\n                    // If the list is empty or the new point has a different EndTime, add it to the list\n                    Values.Add(point);\n                }\n                else\n                {\n                    // If the new point has the same EndTime as the last point, update the last point\n                    Values[^1] = point;\n                }\n\n                return point;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Indicators/OptionPricingModelType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Defines different types of option pricing model\n    /// </summary>\n    public enum OptionPricingModelType\n    {\n        /// <summary>\n        /// Vanilla Black Scholes Model\n        /// </summary>\n        /// <remarks>Preferred on calculating greeks for European options, and IV for all options</remarks>\n        BlackScholes,\n        /// <summary>\n        /// The Cox-Ross-Rubinstein binomial tree model (CRR model)\n        /// </summary>\n        /// <remarks>Preferred on calculating greeks for American options</remarks>\n        BinomialCoxRossRubinstein,\n        /// <summary>\n        /// The forward binomial tree model, or Cox-Ross-Rubinstein with drift model\n        /// </summary>\n        /// <remarks>Preferred on replicating IB IV for American options</remarks>\n        ForwardTree\n    }\n}\n"
  },
  {
    "path": "Common/Indicators/RollingWindow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing Python.Runtime;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This is generic rolling window.\n    /// </summary>\n    public class RollingWindow : RollingWindow<object>\n    {\n        /// <summary>\n        /// Initializes a new RollingWindow with the specified size.\n        /// </summary>\n        /// <param name=\"size\">The number of elements to store in the window</param>\n        public RollingWindow(int size) : base(size)\n        {\n        }\n    }\n\n    /// <summary>\n    ///     This is a window that allows for list access semantics,\n    ///     where this[0] refers to the most recent item in the\n    ///     window and this[Count-1] refers to the last item in the window\n    /// </summary>\n    /// <typeparam name=\"T\">The type of data in the window</typeparam>\n    public class RollingWindow<T> : IReadOnlyWindow<T>\n    {\n        // the backing list object used to hold the data\n        private readonly List<T> _list;\n        // read-write lock used for controlling access to the underlying list data structure\n        private readonly ReaderWriterLockSlim _listLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);\n        // the most recently removed item from the window (fell off the back)\n        private T _mostRecentlyRemoved;\n        // the total number of samples taken by this indicator\n        private int _samples;\n        // used to locate the last item in the window as an indexer into the _list\n        private int _tail;\n        // the size or capacity of the window\n        private int _size;\n\n        /// <summary>\n        ///     Initializes a new instance of the RollwingWindow class with the specified window size.\n        /// </summary>\n        /// <param name=\"size\">The number of items to hold in the window</param>\n        public RollingWindow(int size)\n        {\n            if (size < 0)\n            {\n                throw new ArgumentException(Messages.RollingWindow.InvalidSize(0), nameof(size));\n            }\n            _list = new List<T>(size);\n            _size = size;\n        }\n\n        /// <summary>\n        ///     Gets the size of this window\n        /// </summary>\n        public virtual int Size\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n                    return _size;\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n            }\n            set\n            {\n                Resize(value);\n            }\n        }\n\n        /// <summary>\n        ///     Gets the current number of elements in this window\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n                    return _list.Count;\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n            }\n        }\n\n        /// <summary>\n        ///     Gets the number of samples that have been added to this window over its lifetime\n        /// </summary>\n        public int Samples\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n                    return _samples;\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n            }\n        }\n\n        /// <summary>\n        ///     Gets the most recently removed item from the window. This is the\n        ///     piece of data that just 'fell off' as a result of the most recent\n        ///     add. If no items have been removed, this will throw an exception.\n        /// </summary>\n        public T MostRecentlyRemoved\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n\n                    if (_samples <= _size)\n                    {\n                        throw new InvalidOperationException(Messages.RollingWindow.NoItemsRemovedYet);\n                    }\n                    return _mostRecentlyRemoved;\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n\n            }\n        }\n\n        /// <summary>\n        ///     Indexes into this window, where index 0 is the most recently\n        ///     entered value\n        /// </summary>\n        /// <param name=\"i\">the index, i</param>\n        /// <returns>the ith most recent entry</returns>\n        public T this[int i]\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n\n                    if (i < 0)\n                    {\n                        if (_size + i < 0)\n                        {\n                            throw new ArgumentOutOfRangeException(nameof(i), i, Messages.RollingWindow.IndexOutOfSizeRange);\n                        }\n                        i = _list.Count + i;\n\n                        if (i < 0)\n                        {\n                            return default;\n                        }\n                    }\n\n                    if (i > _list.Count - 1)\n                    {\n                        if (i > _size - 1)\n                        {\n                            _listLock.ExitReadLock();\n                            Resize(i + 1);\n                            _listLock.EnterReadLock();\n                        }\n\n                        return default;\n                    }\n\n                    return _list[GetListIndex(i, _list.Count, _tail)];\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n            }\n            set\n            {\n                try\n                {\n                    _listLock.EnterWriteLock();\n\n                    if (i < 0)\n                    {\n                        if (_size + i < 0)\n                        {\n                            throw new ArgumentOutOfRangeException(nameof(i), i, Messages.RollingWindow.IndexOutOfSizeRange);\n                        }\n                        i = _size + i;\n                    }\n\n                    if (i > _list.Count - 1)\n                    {\n                        if (i > _size - 1)\n                        {\n                            Resize(i + 1);\n                        }\n\n                        var count = _list.Count;\n                        for (var j = 0; j < i - count + 1; j++)\n                        {\n                            Add(default);\n                        }\n                    }\n\n                    _list[GetListIndex(i, _list.Count, _tail)] = value;\n                }\n                finally\n                {\n                    _listLock.ExitWriteLock();\n                }\n            }\n        }\n\n        /// <summary>\n        ///     Gets a value indicating whether or not this window is ready, i.e,\n        ///     it has been filled to its capacity\n        /// </summary>\n        public bool IsReady\n        {\n            get\n            {\n                try\n                {\n                    _listLock.EnterReadLock();\n                    return _samples >= _size;\n                }\n                finally\n                {\n                    _listLock.ExitReadLock();\n                }\n            }\n        }\n\n        /// <summary>\n        ///     Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        ///     A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<T> GetEnumerator()\n        {\n            try\n            {\n                _listLock.EnterReadLock();\n\n                // we make a copy on purpose so the enumerator isn't tied\n                // to a mutable object, well it is still mutable but out of scope\n                var count = _list.Count;\n                var temp = new T[count];\n                for (int i = 0; i < count; i++)\n                {\n                    temp[i] = _list[GetListIndex(i, count, _tail)];\n                }\n\n                return ((IEnumerable<T>)temp).GetEnumerator();\n            }\n            finally\n            {\n                _listLock.ExitReadLock();\n            }\n\n        }\n\n        /// <summary>\n        ///     Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        ///     An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        ///     Adds an item to this window and shifts all other elements\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        public void Add(T item)\n        {\n            try\n            {\n                _listLock.EnterWriteLock();\n\n                _samples++;\n                if (_size == _list.Count)\n                {\n                    // keep track of what's the last element\n                    // so we can reindex on this[ int ]\n                    _mostRecentlyRemoved = _list[_tail];\n                    _list[_tail] = item;\n                    _tail = (_tail + 1) % _size;\n                }\n                else\n                {\n                    _list.Add(item);\n                }\n            }\n            finally\n            {\n                _listLock.ExitWriteLock();\n            }\n        }\n\n        /// <summary>\n        ///     Clears this window of all data\n        /// </summary>\n        public virtual void Reset()\n        {\n            try\n            {\n                _listLock.EnterWriteLock();\n\n                _samples = 0;\n                _list.Clear();\n                _tail = 0;\n            }\n            finally\n            {\n                _listLock.ExitWriteLock();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static int GetListIndex(int index, int listCount, int tail)\n        {\n            return (listCount + tail - index - 1) % listCount;\n        }\n\n        private void Resize(int size)\n        {\n            try\n            {\n                _listLock.EnterWriteLock();\n\n                _list.EnsureCapacity(size);\n                if (size < _list.Count)\n                {\n                    _list.RemoveRange(0, _list.Count - size);\n                }\n                _size = size;\n            }\n            finally\n            {\n                _listLock.ExitWriteLock();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/DataProviderDataFetchedEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"IDataProvider.NewDataRequest\"/> event\n    /// </summary>\n    public class DataProviderNewDataRequestEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Path to the fetched data\n        /// </summary>\n        public string Path { get; }\n\n        /// <summary>\n        /// Whether the data was fetched successfully\n        /// </summary>\n        public bool Succeeded { get; }\n\n        /// <summary>\n        /// Any error message that occurred during the fetch\n        /// </summary>\n        public string ErrorMessage  { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataProviderNewDataRequestEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"path\">The path to the fetched data</param>\n        /// <param name=\"succeeded\">Whether the data was fetched successfully</param>\n        /// <param name=\"errorMessage\">Any error message that occured during the fetch</param>\n        public DataProviderNewDataRequestEventArgs(string path, bool succeeded, string  errorMessage)\n        {\n            Path = path;\n            Succeeded = succeeded;\n            ErrorMessage = errorMessage;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IAccountCurrencyProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// A reduced interface for an account currency provider\n    /// </summary>\n    public interface IAccountCurrencyProvider\n    {\n        /// <summary>\n        /// Gets the account currency\n        /// </summary>\n        string AccountCurrency { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Storage;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Notifications;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\nusing QuantConnect.Commands;\nusing Common.Util;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines an event fired from within an algorithm instance.\n    /// </summary>\n    /// <typeparam name=\"T\">The event type</typeparam>\n    /// <param name=\"algorithm\">The algorithm that fired the event</param>\n    /// <param name=\"eventData\">The event data</param>\n    public delegate void AlgorithmEvent<in T>(IAlgorithm algorithm, T eventData);\n\n    /// <summary>\n    /// Interface for QuantConnect algorithm implementations. All algorithms must implement these\n    /// basic members to allow interaction with the Lean Backtesting Engine.\n    /// </summary>\n    public interface IAlgorithm : ISecurityInitializerProvider, IAccountCurrencyProvider\n    {\n        /// <summary>\n        /// Event fired when an algorithm generates a insight\n        /// </summary>\n        event AlgorithmEvent<GeneratedInsightsCollection> InsightsGenerated;\n\n        /// <summary>\n        /// Gets the time keeper instance\n        /// </summary>\n        ITimeKeeper TimeKeeper\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Data subscription manager controls the information and subscriptions the algorithms recieves.\n        /// Subscription configurations can be added through the Subscription Manager.\n        /// </summary>\n        SubscriptionManager SubscriptionManager\n        {\n            get;\n        }\n\n        /// <summary>\n        /// The project id associated with this algorithm if any\n        /// </summary>\n        int ProjectId\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Security object collection class stores an array of objects representing representing each security/asset\n        /// we have a subscription for.\n        /// </summary>\n        /// <remarks>It is an IDictionary implementation and can be indexed by symbol</remarks>\n        SecurityManager Securities\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the collection of universes for the algorithm\n        /// </summary>\n        UniverseManager UniverseManager\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Security portfolio management class provides wrapper and helper methods for the Security.Holdings class such as\n        /// IsLong, IsShort, TotalProfit\n        /// </summary>\n        /// <remarks>Portfolio is a wrapper and helper class encapsulating the Securities[].Holdings objects</remarks>\n        SecurityPortfolioManager Portfolio\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Security transaction manager class controls the store and processing of orders.\n        /// </summary>\n        /// <remarks>The orders and their associated events are accessible here. When a new OrderEvent is recieved the algorithm portfolio is updated.</remarks>\n        SecurityTransactionManager Transactions\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the brokerage model used to emulate a real brokerage\n        /// </summary>\n        IBrokerageModel BrokerageModel\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the brokerage name.\n        /// </summary>\n        BrokerageName BrokerageName\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the risk free interest rate model used to get the interest rates\n        /// </summary>\n        IRiskFreeInterestRateModel RiskFreeInterestRateModel\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the brokerage message handler used to decide what to do\n        /// with each message sent from the brokerage\n        /// </summary>\n        IBrokerageMessageHandler BrokerageMessageHandler\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Notification manager for storing and processing live event messages\n        /// </summary>\n        NotificationManager Notify\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets schedule manager for adding/removing scheduled events\n        /// </summary>\n        ScheduleManager Schedule\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets or sets the history provider for the algorithm\n        /// </summary>\n        IHistoryProvider HistoryProvider\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets or sets the current status of the algorithm\n        /// </summary>\n        AlgorithmStatus Status\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets whether or not this algorithm is still warming up\n        /// </summary>\n        bool IsWarmingUp\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Public name for the algorithm.\n        /// </summary>\n        string Name\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// A list of tags associated with the algorithm or the backtest, useful for categorization\n        /// </summary>\n        HashSet<string> Tags\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Event fired algorithm's name is changed\n        /// </summary>\n        event AlgorithmEvent<string> NameUpdated;\n\n        /// <summary>\n        /// Event fired when the tag collection is updated\n        /// </summary>\n        event AlgorithmEvent<HashSet<string>> TagsUpdated;\n\n        /// <summary>\n        /// Current date/time in the algorithm's local time zone\n        /// </summary>\n        DateTime Time\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the time zone of the algorithm\n        /// </summary>\n        DateTimeZone TimeZone\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Current date/time in UTC.\n        /// </summary>\n        DateTime UtcTime\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Algorithm start date for backtesting, set by the SetStartDate methods.\n        /// </summary>\n        DateTime StartDate\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Get Requested Backtest End Date\n        /// </summary>\n        DateTime EndDate\n        {\n            get;\n        }\n\n        /// <summary>\n        /// AlgorithmId for the backtest\n        /// </summary>\n        string AlgorithmId\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Algorithm is running on a live server.\n        /// </summary>\n        bool LiveMode\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        AlgorithmMode AlgorithmMode\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Deployment target, either local or cloud.\n        /// </summary>\n        DeploymentTarget DeploymentTarget\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the subscription settings to be used when adding securities via universe selection\n        /// </summary>\n        UniverseSettings UniverseSettings\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Debug messages from the strategy:\n        /// </summary>\n        ConcurrentQueue<string> DebugMessages\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Error messages from the strategy:\n        /// </summary>\n        ConcurrentQueue<string> ErrorMessages\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Log messages from the strategy:\n        /// </summary>\n        ConcurrentQueue<string> LogMessages\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the run time error from the algorithm, or null if none was encountered.\n        /// </summary>\n        Exception RunTimeError\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Customizable dynamic statistics displayed during live trading:\n        /// </summary>\n        ConcurrentDictionary<string, string> RuntimeStatistics\n        {\n            get;\n        }\n\n        /// <summary>\n        /// The current algorithm statistics for the running algorithm.\n        /// </summary>\n        StatisticsResults Statistics\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the function used to define the benchmark. This function will return\n        /// the value of the benchmark at a requested date/time\n        /// </summary>\n        IBenchmark Benchmark\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the Trade Builder to generate trades from executions\n        /// </summary>\n        ITradeBuilder TradeBuilder\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the user settings for the algorithm\n        /// </summary>\n        IAlgorithmSettings Settings\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        IOptionChainProvider OptionChainProvider\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        IFutureChainProvider FutureChainProvider\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the insight manager\n        /// </summary>\n        InsightManager Insights\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the object store, used for persistence\n        /// </summary>\n        ObjectStore ObjectStore { get; }\n\n        /// <summary>\n        /// Returns the current Slice object\n        /// </summary>\n        Slice CurrentSlice { get; }\n\n        /// <summary>\n        /// Initialise the Algorithm and Prepare Required Data:\n        /// </summary>\n        void Initialize();\n\n        /// <summary>\n        /// Called by setup handlers after Initialize and allows the algorithm a chance to organize\n        /// the data gather in the Initialize method\n        /// </summary>\n        void PostInitialize();\n\n        /// <summary>\n        /// Called when the algorithm has completed initialization and warm up.\n        /// </summary>\n        void OnWarmupFinished();\n\n        /// <summary>\n        /// Gets a read-only dictionary with all current parameters\n        /// </summary>\n        ReadOnlyExtendedDictionary<string, string> GetParameters();\n\n        /// <summary>\n        /// Gets the parameter with the specified name. If a parameter with the specified name does not exist,\n        /// the given default value is returned if any, else null\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        string GetParameter(string name, string defaultValue = null);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as an integer. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        int GetParameter(string name, int defaultValue);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a double. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        double GetParameter(string name, double defaultValue);\n\n        /// <summary>\n        /// Gets the parameter with the specified name parsed as a decimal. If a parameter with the specified name does not exist,\n        /// or the conversion is not possible, the given default value is returned\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter to get</param>\n        /// <param name=\"defaultValue\">The default value to return</param>\n        /// <returns>The value of the specified parameter, or defaultValue if not found or null if there's no default value</returns>\n        decimal GetParameter(string name, decimal defaultValue);\n\n        /// <summary>\n        /// Sets the parameters from the dictionary\n        /// </summary>\n        /// <param name=\"parameters\">Dictionary containing the parameter names to values</param>\n        void SetParameters(Dictionary<string, string> parameters);\n\n        /// <summary>\n        /// Determines if the Symbol is shortable at the brokerage\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check if shortable</param>\n        /// <param name=\"shortQuantity\">Order's quantity to check if it is currently shortable, taking into account current holdings and open orders</param>\n        /// <param name=\"updateOrderId\">Optionally the id of the order being updated. When updating an order\n        /// we want to ignore it's submitted short quantity and use the new provided quantity to determine if we\n        /// can perform the update</param>\n        /// <returns>True if the symbol can be shorted by the requested quantity</returns>\n        bool Shortable(Symbol symbol, decimal shortQuantity, int? updateOrderId = null);\n\n        /// <summary>\n        /// Gets the quantity shortable for the given asset\n        /// </summary>\n        /// <returns>\n        /// Quantity shortable for the given asset. Zero if not\n        /// shortable, or a number greater than zero if shortable.\n        /// </returns>\n        long ShortableQuantity(Symbol symbol);\n\n        /// <summary>\n        /// Sets the brokerage model used to resolve transaction models, settlement models,\n        /// and brokerage specified ordering behaviors.\n        /// </summary>\n        /// <param name=\"brokerageModel\">The brokerage model used to emulate the real\n        /// brokerage</param>\n        void SetBrokerageModel(IBrokerageModel brokerageModel);\n\n        /// <summary>\n        /// v3.0 Handler for all data types\n        /// </summary>\n        /// <param name=\"slice\">The current slice of data</param>\n        void OnData(Slice slice);\n\n        /// <summary>\n        /// Used to send data updates to algorithm framework models\n        /// </summary>\n        /// <param name=\"slice\">The current data slice</param>\n        void OnFrameworkData(Slice slice);\n\n        /// <summary>\n        /// Event handler to be called when there's been a split event\n        /// </summary>\n        /// <param name=\"splits\">The current time slice splits</param>\n        void OnSplits(Splits splits);\n\n        /// <summary>\n        /// Event handler to be called when there's been a dividend event\n        /// </summary>\n        /// <param name=\"dividends\">The current time slice dividends</param>\n        void OnDividends(Dividends dividends);\n\n        /// <summary>\n        /// Event handler to be called when there's been a delistings event\n        /// </summary>\n        /// <param name=\"delistings\">The current time slice delistings</param>\n        void OnDelistings(Delistings delistings);\n\n        /// <summary>\n        /// Event handler to be called when there's been a symbol changed event\n        /// </summary>\n        /// <param name=\"symbolsChanged\">The current time slice symbol changed events</param>\n        void OnSymbolChangedEvents(SymbolChangedEvents symbolsChanged);\n\n        /// <summary>\n        /// Event fired each time that we add/remove securities from the data feed\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        void OnSecuritiesChanged(SecurityChanges changes);\n\n        /// <summary>\n        /// Used to send security changes to algorithm framework models\n        /// </summary>\n        /// <param name=\"changes\">Security additions/removals for this time step</param>\n        void OnFrameworkSecuritiesChanged(SecurityChanges changes);\n\n        /// <summary>\n        /// Invoked at the end of every time step. This allows the algorithm\n        /// to process events before advancing to the next time step.\n        /// </summary>\n        void OnEndOfTimeStep();\n\n        /// <summary>\n        /// Send debug message\n        /// </summary>\n        /// <param name=\"message\"></param>\n        void Debug(string message);\n\n        /// <summary>\n        /// Save entry to the Log\n        /// </summary>\n        /// <param name=\"message\">String message</param>\n        void Log(string message);\n\n        /// <summary>\n        /// Send an error message for the algorithm\n        /// </summary>\n        /// <param name=\"message\">String message</param>\n        void Error(string message);\n\n        /// <summary>\n        /// Margin call event handler. This method is called right before the margin call orders are placed in the market.\n        /// </summary>\n        /// <param name=\"requests\">The orders to be executed to bring this algorithm within margin limits</param>\n        void OnMarginCall(List<SubmitOrderRequest> requests);\n\n        /// <summary>\n        /// Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue\n        /// </summary>\n        void OnMarginCallWarning();\n\n        /// <summary>\n        /// Call this method at the end of each day of data.\n        /// </summary>\n        /// <remarks>Deprecated because different assets have different market close times,\n        /// and because Python does not support two methods with the same name</remarks>\n        [Obsolete(\"This method is deprecated. Please use this overload: OnEndOfDay(Symbol symbol)\")]\n        [StubsIgnore]\n        void OnEndOfDay();\n\n        /// <summary>\n        /// Call this method at the end of each day of data.\n        /// </summary>\n        [StubsAvoidImplicits]\n        void OnEndOfDay(Symbol symbol);\n\n        /// <summary>\n        /// Call this event at the end of the algorithm running.\n        /// </summary>\n        void OnEndOfAlgorithm();\n\n        /// <summary>\n        /// EXPERTS ONLY:: [-!-Async Code-!-]\n        /// New order event handler: on order status changes (filled, partially filled, cancelled etc).\n        /// </summary>\n        /// <param name=\"newEvent\">Event information</param>\n        void OnOrderEvent(OrderEvent newEvent);\n\n        /// <summary>\n        /// Generic untyped command call handler\n        /// </summary>\n        /// <param name=\"data\">The associated data</param>\n        /// <returns>True if success, false otherwise. Returning null will disable command feedback</returns>\n        bool? OnCommand(dynamic data);\n\n        /// <summary>\n        /// Will submit an order request to the algorithm\n        /// </summary>\n        /// <param name=\"request\">The request to submit</param>\n        /// <remarks>Will run order prechecks, which include making sure the algorithm is not warming up, security is added and has data among others</remarks>\n        /// <returns>The order ticket</returns>\n        OrderTicket SubmitOrderRequest(SubmitOrderRequest request);\n\n        /// <summary>\n        /// Option assignment event handler. On an option assignment event for short legs the resulting information is passed to this method.\n        /// </summary>\n        /// <param name=\"assignmentEvent\">Option exercise event details containing details of the assignment</param>\n        /// <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>\n        void OnAssignmentOrderEvent(OrderEvent assignmentEvent);\n\n        /// <summary>\n        /// Brokerage message event handler. This method is called for all types of brokerage messages.\n        /// </summary>\n        void OnBrokerageMessage(BrokerageMessageEvent messageEvent);\n\n        /// <summary>\n        /// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.\n        /// </summary>\n        void OnBrokerageDisconnect();\n\n        /// <summary>\n        /// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.\n        /// </summary>\n        void OnBrokerageReconnect();\n\n        /// <summary>\n        /// Set the DateTime Frontier: This is the master time and is\n        /// </summary>\n        /// <param name=\"time\"></param>\n        void SetDateTime(DateTime time);\n\n        /// <summary>\n        /// Set the start date for the backtest\n        /// </summary>\n        /// <param name=\"start\">Datetime Start date for backtest</param>\n        /// <remarks>Must be less than end date and within data available</remarks>\n        void SetStartDate(DateTime start);\n\n        /// <summary>\n        /// Set the end date for a backtest.\n        /// </summary>\n        /// <param name=\"end\">Datetime value for end date</param>\n        /// <remarks>Must be greater than the start date</remarks>\n        void SetEndDate(DateTime end);\n\n        /// <summary>\n        /// Set the algorithm Id for this backtest or live run. This can be used to identify the order and equity records.\n        /// </summary>\n        /// <param name=\"algorithmId\">unique 32 character identifier for backtest or live server</param>\n        void SetAlgorithmId(string algorithmId);\n\n        /// <summary>\n        /// Set the algorithm as initialized and locked. No more cash or security changes.\n        /// </summary>\n        void SetLocked();\n\n        /// <summary>\n        /// Gets whether or not this algorithm has been locked and fully initialized\n        /// </summary>\n        bool GetLocked();\n\n        /// <summary>\n        /// Add a Chart object to algorithm collection\n        /// </summary>\n        /// <param name=\"chart\">Chart object to add to collection.</param>\n        void AddChart(Chart chart);\n\n        /// <summary>\n        /// Get the chart updates since the last request:\n        /// </summary>\n        /// <param name=\"clearChartData\"></param>\n        /// <returns>List of Chart Updates</returns>\n        IEnumerable<Chart> GetChartUpdates(bool clearChartData = false);\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"securityType\">SecurityType Enum: Equity, Commodity, FOREX or Future</param>\n        /// <param name=\"symbol\">Symbol Representation of the MarketType, e.g. AAPL</param>\n        /// <param name=\"resolution\">Resolution of the MarketType required: MarketData, Second or Minute</param>\n        /// <param name=\"market\">The market the requested security belongs to, such as 'usa' or 'fxcm'</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">ExtendedMarketHours send in data from 4am - 8pm, not used for FOREX</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        Security AddSecurity(SecurityType securityType, string symbol, Resolution? resolution, string market, bool? fillForward, decimal leverage, bool? extendedMarketHours,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null);\n\n        /// <summary>\n        /// Set a required SecurityType-symbol and resolution for algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The security Symbol</param>\n        /// <param name=\"resolution\">Resolution of the MarketType required: MarketData, Second or Minute</param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice.</param>\n        /// <param name=\"leverage\">leverage for this security</param>\n        /// <param name=\"extendedMarketHours\">Use extended market hours data</param>\n        /// <param name=\"dataMappingMode\">The contract mapping mode to use for the security</param>\n        /// <param name=\"dataNormalizationMode\">The price scaling mode to use for the security</param>\n        /// <param name=\"contractDepthOffset\">The continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</param>\n        /// <returns>The new Security that was added to the algorithm</returns>\n        Security AddSecurity(Symbol symbol, Resolution? resolution = null, bool? fillForward = null, decimal leverage = Security.NullLeverage, bool? extendedMarketHours = null,\n            DataMappingMode? dataMappingMode = null, DataNormalizationMode? dataNormalizationMode = null, int contractDepthOffset = 0);\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Future\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The futures contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Show the after market data as well</param>\n        /// <returns>The new <see cref=\"Future\"/> security</returns>\n        Future AddFutureContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true, decimal leverage = 0m, bool extendedMarketHours = false);\n\n        /// <summary>\n        /// Creates and adds a new single <see cref=\"Option\"/> contract to the algorithm\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> of market data, Tick, Second, Minute, Hour, or Daily. Default is <see cref=\"Resolution.Minute\"/></param>\n        /// <param name=\"fillForward\">If true, returns the last available data even if none in that timeslice. Default is <value>true</value></param>\n        /// <param name=\"leverage\">The requested leverage for this equity. Default is set by <see cref=\"SecurityInitializer\"/></param>\n        /// <param name=\"extendedMarketHours\">Show the after market data as well</param>\n        /// <returns>The new <see cref=\"Option\"/> security</returns>\n        Option AddOptionContract(Symbol symbol, Resolution? resolution = null, bool fillForward = true, decimal leverage = 0m, bool extendedMarketHours = false);\n\n        /// <summary>\n        /// Removes the security with the specified symbol. This will cancel all\n        /// open orders and then liquidate any existing holdings\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security to be removed</param>\n        /// <param name=\"tag\">Optional tag to indicate the cause of removal</param>\n        bool RemoveSecurity(Symbol symbol, string tag = null);\n\n        /// <summary>\n        /// Sets the account currency cash symbol this algorithm is to manage, as well as\n        /// the starting cash in this currency if given\n        /// </summary>\n        /// <remarks>Has to be called during <see cref=\"Initialize\"/> before\n        /// calling <see cref=\"SetCash(decimal)\"/> or adding any <see cref=\"Security\"/></remarks>\n        /// <param name=\"accountCurrency\">The account currency cash symbol to set</param>\n        /// <param name=\"startingCash\">The account currency starting cash to set</param>\n        void SetAccountCurrency(string accountCurrency, decimal? startingCash = null);\n\n        /// <summary>\n        /// Set the starting capital for the strategy\n        /// </summary>\n        /// <param name=\"startingCash\">decimal starting capital, default $100,000</param>\n        void SetCash(decimal startingCash);\n\n        /// <summary>\n        /// Set the cash for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The cash symbol to set</param>\n        /// <param name=\"startingCash\">Decimal cash value of portfolio</param>\n        /// <param name=\"conversionRate\">The current conversion rate for the</param>\n        void SetCash(string symbol, decimal startingCash, decimal conversionRate = 0);\n\n        /// <summary>\n        /// Liquidate your portfolio holdings\n        /// </summary>\n        /// <param name=\"symbol\">Specific asset to liquidate, defaults to all.</param>\n        /// <param name=\"asynchronous\">Flag to indicate if the symbols should be liquidated asynchronously</param>\n        /// <param name=\"tag\">Custom tag to know who is calling this</param>\n        /// <param name=\"orderProperties\">Order properties to use</param>\n        List<OrderTicket> Liquidate(Symbol symbol = null, bool asynchronous = false, string tag = \"Liquidated\", IOrderProperties orderProperties = null);\n\n        /// <summary>\n        /// Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode.\n        /// </summary>\n        /// <param name=\"live\">Bool live mode flag</param>\n        void SetLiveMode(bool live);\n\n        /// <summary>\n        /// Sets the algorithm running mode\n        /// </summary>\n        /// <param name=\"algorithmMode\">Algorithm mode</param>\n        void SetAlgorithmMode(AlgorithmMode algorithmMode);\n\n        /// <summary>\n        /// Sets the algorithm deployment target\n        /// </summary>\n        /// <param name=\"deploymentTarget\">Deployment target</param>\n        void SetDeploymentTarget(DeploymentTarget deploymentTarget);\n\n        /// <summary>\n        /// Sets <see cref=\"IsWarmingUp\"/> to false to indicate this algorithm has finished its warm up\n        /// </summary>\n        void SetFinishedWarmingUp();\n\n        /// <summary>\n        /// Set the maximum number of orders the algorithm is allowed to process.\n        /// </summary>\n        /// <param name=\"max\">Maximum order count int</param>\n        void SetMaximumOrders(int max);\n\n        /// <summary>\n        /// Sets the implementation used to handle messages from the brokerage.\n        /// The default implementation will forward messages to debug or error\n        /// and when a <see cref=\"BrokerageMessageType.Error\"/> occurs, the algorithm\n        /// is stopped.\n        /// </summary>\n        /// <param name=\"handler\">The message handler to use</param>\n        void SetBrokerageMessageHandler(IBrokerageMessageHandler handler);\n\n        /// <summary>\n        /// Set the historical data provider\n        /// </summary>\n        /// <param name=\"historyProvider\">Historical data provider</param>\n        void SetHistoryProvider(IHistoryProvider historyProvider);\n\n        /// <summary>\n        /// Get the last known price using the history provider.\n        /// Useful for seeding securities with the correct price\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which to retrieve historical data</param>\n        /// <returns>A single <see cref=\"BaseData\"/> object with the last known price</returns>\n        BaseData GetLastKnownPrice(Symbol symbol);\n\n        /// <summary>\n        /// Yields data to warmup a security for all it's subscribed data types\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which to retrieve historical data</param>\n        /// <returns>Securities historical data</returns>\n        IEnumerable<BaseData> GetLastKnownPrices(Symbol symbol);\n\n        /// <summary>\n        /// Yields data to warm up multiple securities for all their subscribed data types\n        /// </summary>\n        /// <param name=\"symbols\">The symbols we want to get seed data for</param>\n        /// <returns>Securities historical data</returns>\n        DataDictionary<IEnumerable<BaseData>> GetLastKnownPrices(IEnumerable<Symbol> symbols);\n\n        /// <summary>\n        /// Set the runtime error\n        /// </summary>\n        /// <param name=\"exception\">Represents error that occur during execution</param>\n        void SetRunTimeError(Exception exception);\n\n        /// <summary>\n        /// Set the state of a live deployment\n        /// </summary>\n        /// <param name=\"status\">Live deployment status</param>\n        void SetStatus(AlgorithmStatus status);\n\n        /// <summary>\n        /// Set the available <see cref=\"TickType\"/> supported by each <see cref=\"SecurityType\"/> in <see cref=\"SecurityManager\"/>\n        /// </summary>\n        /// <param name=\"availableDataTypes\">>The different <see cref=\"TickType\"/> each <see cref=\"Security\"/> supports</param>\n        void SetAvailableDataTypes(Dictionary<SecurityType, List<TickType>> availableDataTypes);\n\n        /// <summary>\n        /// Sets the option chain provider, used to get the list of option contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"optionChainProvider\">The option chain provider</param>\n        void SetOptionChainProvider(IOptionChainProvider optionChainProvider);\n\n        /// <summary>\n        /// Sets the future chain provider, used to get the list of future contracts for an underlying symbol\n        /// </summary>\n        /// <param name=\"futureChainProvider\">The future chain provider</param>\n        void SetFutureChainProvider(IFutureChainProvider futureChainProvider);\n\n        /// <summary>\n        /// Sets the current slice\n        /// </summary>\n        /// <param name=\"slice\">The Slice object</param>\n        void SetCurrentSlice(Slice slice);\n\n        /// <summary>\n        /// Provide the API for the algorithm.\n        /// </summary>\n        /// <param name=\"api\">Initiated API</param>\n        void SetApi(IApi api);\n\n        /// <summary>\n        /// Sets the object store\n        /// </summary>\n        /// <param name=\"objectStore\">The object store</param>\n        void SetObjectStore(IObjectStore objectStore);\n\n        /// <summary>\n        /// Converts the string 'ticker' symbol into a full <see cref=\"Symbol\"/> object\n        /// This requires that the string 'ticker' has been added to the algorithm\n        /// </summary>\n        /// <param name=\"ticker\">The ticker symbol. This should be the ticker symbol\n        /// as it was added to the algorithm</param>\n        /// <returns>The symbol object mapped to the specified ticker</returns>\n        Symbol Symbol(string ticker);\n\n        /// <summary>\n        /// For the given symbol will resolve the ticker it used at the current algorithm date\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get the ticker for</param>\n        /// <returns>The mapped ticker for a symbol</returns>\n        string Ticker(Symbol symbol);\n\n        /// <summary>\n        /// Sets the statistics service instance to be used by the algorithm\n        /// </summary>\n        /// <param name=\"statisticsService\">The statistics service instance</param>\n        void SetStatisticsService(IStatisticsService statisticsService);\n\n        /// <summary>\n        /// Sets name to the currently running backtest\n        /// </summary>\n        /// <param name=\"name\">The name for the backtest</param>\n        void SetName(string name);\n\n        /// <summary>\n        /// Adds a tag to the algorithm\n        /// </summary>\n        /// <param name=\"tag\">The tag to add</param>\n        void AddTag(string tag);\n\n        /// <summary>\n        /// Sets the tags for the algorithm\n        /// </summary>\n        /// <param name=\"tags\">The tags</param>\n        void SetTags(HashSet<string> tags);\n\n        /// <summary>\n        /// Run a callback command instance\n        /// </summary>\n        /// <param name=\"command\">The callback command instance</param>\n        /// <returns>The command result</returns>\n        CommandResultPacket RunCommand(CallbackCommand command);\n\n        /// <summary>\n        /// Gets the default order properties\n        /// </summary>\n        IOrderProperties DefaultOrderProperties { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IAlgorithmSettings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    ///  User settings for the algorithm which can be changed in the <see cref=\"IAlgorithm.Initialize\"/> method\n    /// </summary>\n    public interface IAlgorithmSettings\n    {\n        /// <summary>\n        /// Gets whether or not WarmUpIndicator is allowed to warm up indicators\n        /// </summary>\n        bool AutomaticIndicatorWarmUp { get; set; }\n\n        /// <summary>\n        /// True if should rebalance portfolio on security changes. True by default\n        /// </summary>\n        bool? RebalancePortfolioOnSecurityChanges { get; set; }\n\n        /// <summary>\n        /// True if should rebalance portfolio on new insights or expiration of insights. True by default\n        /// </summary>\n        bool? RebalancePortfolioOnInsightChanges { get; set; }\n\n        /// <summary>\n        /// The absolute maximum valid total portfolio value target percentage\n        /// </summary>\n        /// <remarks>This setting is currently being used to filter out undesired target percent values,\n        /// caused by the IPortfolioConstructionModel implementation being used.\n        /// For example rounding errors, math operations</remarks>\n        decimal MaxAbsolutePortfolioTargetPercentage { get; set; }\n\n        /// <summary>\n        /// The absolute minimum valid total portfolio value target percentage\n        /// </summary>\n        /// <remarks>This setting is currently being used to filter out undesired target percent values,\n        /// caused by the IPortfolioConstructionModel implementation being used.\n        /// For example rounding errors, math operations</remarks>\n        decimal MinAbsolutePortfolioTargetPercentage { get; set; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, or orders with unrealistic sizes\n        /// </summary>\n        /// <remarks>Default minimum order size is $0 value</remarks>\n        decimal MinimumOrderMarginPortfolioPercentage { get; set; }\n\n        /// <summary>\n        /// Gets/sets the SetHoldings buffers value.\n        /// The buffer is used for orders not to be rejected due to volatility when using SetHoldings and CalculateOrderQuantity\n        /// </summary>\n        decimal? FreePortfolioValue { get; set; }\n\n        /// <summary>\n        /// Gets/sets the SetHoldings buffers value percentage.\n        /// This percentage will be used to set the <see cref=\"FreePortfolioValue\"/>\n        /// based on the <see cref=\"SecurityPortfolioManager.TotalPortfolioValue\"/>\n        /// </summary>\n        decimal FreePortfolioValuePercentage { get; set; }\n\n        /// <summary>\n        /// Gets/sets if Liquidate() is enabled\n        /// </summary>\n        bool LiquidateEnabled { get; set; }\n\n        /// <summary>\n        /// True if daily strict end times are enabled\n        /// </summary>\n        bool DailyPreciseEndTime { get; set; }\n\n        /// <summary>\n        /// True if extended market hours should be used for daily consolidation, when extended market hours is enabled\n        /// </summary>\n        bool DailyConsolidationUseExtendedMarketHours { get; set; }\n\n        /// <summary>\n        /// Gets/sets the maximum number of concurrent market data subscriptions available\n        /// </summary>\n        /// <remarks>\n        /// All securities added with <see cref=\"IAlgorithm.AddSecurity\"/> are counted as one,\n        /// with the exception of options and futures where every single contract in a chain counts as one.\n        /// </remarks>\n        [Obsolete(\"This property is deprecated. Please observe data subscription limits set by your brokerage to avoid runtime errors.\")]\n        int DataSubscriptionLimit { get; set; }\n\n        /// <summary>\n        /// Gets the minimum time span elapsed to consider a market fill price as stale (defaults to one hour)\n        /// </summary>\n        TimeSpan StalePriceTimeSpan { get; set; }\n\n        /// <summary>\n        /// The warmup resolution to use if any\n        /// </summary>\n        /// <remarks>This allows improving the warmup speed by setting it to a lower resolution than the one added in the algorithm</remarks>\n        Resolution? WarmupResolution { get; set; }\n\n        /// <summary>\n        /// Gets or sets the number of trading days per year for this Algorithm's portfolio statistics.\n        /// </summary>\n        /// <remarks>\n        /// This property affects the calculation of various portfolio statistics, including:\n        /// - <see cref=\"Statistics.PortfolioStatistics.AnnualVariance\"/>\n        /// - <seealso cref=\"Statistics.PortfolioStatistics.AnnualStandardDeviation\"/>\n        /// - <seealso cref=\"Statistics.PortfolioStatistics.SharpeRatio\"/>\n        /// - <seealso cref=\"Statistics.PortfolioStatistics.SortinoRatio\"/>\n        /// - <seealso cref=\"Statistics.PortfolioStatistics.TrackingError\"/>\n        /// - <seealso cref=\"Statistics.PortfolioStatistics.InformationRatio\"/>.\n        ///\n        /// The default values are:\n        /// - Cryptocurrency Exchanges: 365 days\n        /// - Traditional Stock Exchanges: 252 days\n        ///\n        /// Users can also set a custom value for this property.\n        /// </remarks>\n        int? TradingDaysPerYear { get; set; }\n\n        /// <summary>\n        /// Gets the time span used to refresh the market hours and symbol properties databases\n        /// </summary>\n        TimeSpan DatabasesRefreshPeriod { get; set; }\n\n        /// <summary>\n        /// Determines whether to terminate the algorithm when an asset is not supported by Lean or the brokerage\n        /// </summary>\n        bool IgnoreUnknownAssetHoldings { get; set; }\n\n        /// <summary>\n        /// Performance tracking sample period to use if any, useful to debug performance issues\n        /// </summary>\n        TimeSpan PerformanceSamplePeriod { get; set; }\n\n        /// <summary>\n        /// Determines whether to seed initial prices for all selected and manually added securities.\n        /// </summary>\n        bool SeedInitialPrices { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IAlgorithmSubscriptionManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    ///     AlgorithmSubscriptionManager interface will manage the subscriptions for the SubscriptionManager\n    /// </summary>\n    public interface IAlgorithmSubscriptionManager : ISubscriptionDataConfigService\n    {\n        /// <summary>\n        ///     Gets all the current data config subscriptions that are being processed for the SubscriptionManager\n        /// </summary>\n        IEnumerable<SubscriptionDataConfig> SubscriptionManagerSubscriptions { get; }\n\n        /// <summary>\n        ///     Returns the amount of data config subscriptions processed for the SubscriptionManager\n        /// </summary>\n        int SubscriptionManagerCount();\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IApi.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Api;\nusing QuantConnect.Notifications;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// API for QuantConnect.com\n    /// </summary>\n    [InheritedExport(typeof(IApi))]\n    public interface IApi : IDisposable\n    {\n        /// <summary>\n        /// Initialize the control system\n        /// </summary>\n        void Initialize(int userId, string token, string dataFolder);\n\n        /// <summary>\n        /// Create a project with the specified name and language via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"name\">Project name</param>\n        /// <param name=\"language\">Programming language to use</param>\n        /// <param name=\"organizationId\">Organization to create this project under</param>\n        /// <returns><see cref=\"ProjectResponse\"/> that includes information about the newly created project</returns>\n        ProjectResponse CreateProject(string name, Language language, string organizationId = null);\n\n        /// <summary>\n        /// Read in a project from the QuantConnect.com API.\n        /// </summary>\n        /// <param name=\"projectId\">Project id you own</param>\n        /// <returns><see cref=\"ProjectResponse\"/> about a specific project</returns>\n        ProjectResponse ReadProject(int projectId);\n\n        /// <summary>\n        /// Add a file to a project\n        /// </summary>\n        /// <param name=\"projectId\">The project to which the file should be added</param>\n        /// <param name=\"name\">The name of the new file</param>\n        /// <param name=\"content\">The content of the new file</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes information about the newly created file</returns>\n        RestResponse AddProjectFile(int projectId, string name, string content);\n\n        /// <summary>\n        /// Update the name of a file\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"oldFileName\">The current name of the file</param>\n        /// <param name=\"newFileName\">The new name for the file</param>\n        /// <returns><see cref=\"RestResponse\"/> indicating success</returns>\n        RestResponse UpdateProjectFileName(int projectId, string oldFileName, string newFileName);\n\n        /// <summary>\n        /// Update the contents of a file\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"fileName\">The name of the file that should be updated</param>\n        /// <param name=\"newFileContents\">The new contents of the file</param>\n        /// <returns><see cref=\"RestResponse\"/> indicating success</returns>\n        RestResponse UpdateProjectFileContent(int projectId, string fileName, string newFileContents);\n\n        /// <summary>\n        /// Read a file in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"fileName\">The name of the file</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes the file information</returns>\n        ProjectFilesResponse ReadProjectFile(int projectId, string fileName);\n\n        /// <summary>\n        /// Read all files in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes the information about all files in the project</returns>\n        ProjectFilesResponse ReadProjectFiles(int projectId);\n\n        /// <summary>\n        /// Read all nodes in a project.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the nodes refer</param>\n        /// <returns><see cref=\"ProjectNodesResponse\"/> that includes the information about all nodes in the project</returns>\n        ProjectNodesResponse ReadProjectNodes(int projectId);\n\n        /// <summary>\n        /// Update the active state of some nodes to true.\n        /// If you don't provide any nodes, all the nodes become inactive and AutoSelectNode is true.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the nodes refer</param>\n        /// <param name=\"nodes\">List of node ids to update</param>\n        /// <returns><see cref=\"ProjectNodesResponse\"/> that includes the information about all nodes in the project</returns>\n        ProjectNodesResponse UpdateProjectNodes(int projectId, string[] nodes);\n\n        /// <summary>\n        /// Delete a file in a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id to which the file belongs</param>\n        /// <param name=\"name\">The name of the file that should be deleted</param>\n        /// <returns><see cref=\"ProjectFilesResponse\"/> that includes the information about all files in the project</returns>\n        RestResponse DeleteProjectFile(int projectId, string name);\n\n        /// <summary>\n        /// Delete a specific project owned by the user from QuantConnect.com\n        /// </summary>\n        /// <param name=\"projectId\">Project id we own and wish to delete</param>\n        /// <returns>RestResponse indicating success</returns>\n        RestResponse DeleteProject(int projectId);\n\n        /// <summary>\n        /// Read back a list of all projects on the account for a user.\n        /// </summary>\n        /// <returns>Container for list of projects</returns>\n        ProjectResponse ListProjects();\n\n        /// <summary>\n        /// Create a new compile job request for this project id.\n        /// </summary>\n        /// <param name=\"projectId\">Project id we wish to compile.</param>\n        /// <returns>Compile object result</returns>\n        Compile CreateCompile(int projectId);\n\n        /// <summary>\n        /// Read a compile packet job result.\n        /// </summary>\n        /// <param name=\"projectId\">Project id we sent for compile</param>\n        /// <param name=\"compileId\">Compile id return from the creation request</param>\n        /// <returns>Compile object result</returns>\n        Compile ReadCompile(int projectId, string compileId);\n\n        /// <summary>\n        /// Create a new backtest from a specified projectId and compileId\n        /// </summary>\n        /// <param name=\"projectId\"></param>\n        /// <param name=\"compileId\"></param>\n        /// <param name=\"backtestName\"></param>\n        /// <returns></returns>\n        Backtest CreateBacktest(int projectId, string compileId, string backtestName);\n\n        /// <summary>\n        /// Read out the full result of a specific backtest\n        /// </summary>\n        /// <param name=\"projectId\">Project id for the backtest we'd like to read</param>\n        /// <param name=\"backtestId\">Backtest id for the backtest we'd like to read</param>\n        /// <param name=\"getCharts\">True will return backtest charts</param>\n        /// <returns>Backtest result object</returns>\n        Backtest ReadBacktest(int projectId, string backtestId, bool getCharts = true);\n\n        /// <summary>\n        /// Update the backtest name\n        /// </summary>\n        /// <param name=\"projectId\">Project id to update</param>\n        /// <param name=\"backtestId\">Backtest id to update</param>\n        /// <param name=\"name\">New backtest name to set</param>\n        /// <param name=\"note\">Note attached to the backtest</param>\n        /// <returns>Rest response on success</returns>\n        RestResponse UpdateBacktest(int projectId, string backtestId, string name = \"\", string note = \"\");\n\n        /// <summary>\n        /// Delete a backtest from the specified project and backtestId.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the backtest we want to delete</param>\n        /// <param name=\"backtestId\">Backtest id we want to delete</param>\n        /// <returns>RestResponse on success</returns>\n        RestResponse DeleteBacktest(int projectId, string backtestId);\n\n        /// <summary>\n        /// Get a list of backtest summaries for a specific project id\n        /// </summary>\n        /// <param name=\"projectId\">Project id to search</param>\n        /// <param name=\"includeStatistics\">True for include statistics in the response, false otherwise</param>\n        /// <returns>BacktestList container for list of backtests</returns>\n        BacktestSummaryList ListBacktests(int projectId, bool includeStatistics = false);\n\n        /// <summary>\n        /// Read out the insights of a backtest\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the backtest</param>\n        /// <param name=\"backtestId\">Backtest id from which we want to get the insights</param>\n        /// <param name=\"start\">Starting index of the insights to be fetched</param>\n        /// <param name=\"end\">Last index of the insights to be fetched. Note that end - start must be less than 100</param>\n        /// <returns><see cref=\"InsightResponse\"/></returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        public InsightResponse ReadBacktestInsights(int projectId, string backtestId, int start = 0, int end = 0);\n\n#pragma warning disable CS1574\n        /// <summary>\n        /// Estimate optimization with the specified parameters via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the project the optimization belongs to</param>\n        /// <param name=\"name\">Name of the optimization</param>\n        /// <param name=\"target\">Target of the optimization, see examples in <see cref=\"PortfolioStatistics\"/></param>\n        /// <param name=\"targetTo\">Target extremum of the optimization, for example \"max\" or \"min\"</param>\n        /// <param name=\"targetValue\">Optimization target value</param>\n        /// <param name=\"strategy\">Optimization strategy, <see cref=\"GridSearchOptimizationStrategy\"/></param>\n        /// <param name=\"compileId\">Optimization compile ID</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"constraints\">Optimization constraints</param>\n        /// <returns>Estimate object from the API.</returns>\n#pragma warning restore CS1574\n        public Estimate EstimateOptimization(\n            int projectId,\n            string name,\n            string target,\n            string targetTo,\n            decimal? targetValue,\n            string strategy,\n            string compileId,\n            HashSet<OptimizationParameter> parameters,\n            IReadOnlyList<Constraint> constraints);\n\n#pragma warning disable CS1574\n        /// <summary>\n        /// Create an optimization with the specified parameters via QuantConnect.com API\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the project the optimization belongs to</param>\n        /// <param name=\"name\">Name of the optimization</param>\n        /// <param name=\"target\">Target of the optimization, see examples in <see cref=\"PortfolioStatistics\"/></param>\n        /// <param name=\"targetTo\">Target extremum of the optimization, for example \"max\" or \"min\"</param>\n        /// <param name=\"targetValue\">Optimization target value</param>\n        /// <param name=\"strategy\">Optimization strategy, <see cref=\"GridSearchOptimizationStrategy\"/></param>\n        /// <param name=\"compileId\">Optimization compile ID</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"constraints\">Optimization constraints</param>\n        /// <param name=\"estimatedCost\">Estimated cost for optimization</param>\n        /// <param name=\"nodeType\">Optimization node type</param>\n        /// <param name=\"parallelNodes\">Number of parallel nodes for optimization</param>\n        /// <returns>BaseOptimization object from the API.</returns>\n#pragma warning restore CS1574\n        public OptimizationSummary CreateOptimization(\n            int projectId,\n            string name,\n            string target,\n            string targetTo,\n            decimal? targetValue,\n            string strategy,\n            string compileId,\n            HashSet<OptimizationParameter> parameters,\n            IReadOnlyList<Constraint> constraints,\n            decimal estimatedCost,\n            string nodeType,\n            int parallelNodes);\n\n        /// <summary>\n        /// List all the optimizations for a project\n        /// </summary>\n        /// <param name=\"projectId\">Project id we'd like to get a list of optimizations for</param>\n        /// <returns>A list of BaseOptimization objects, <see cref=\"BaseOptimization\"/></returns>\n        public List<OptimizationSummary> ListOptimizations(int projectId);\n\n        /// <summary>\n        /// Read an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to read</param>\n        /// <returns><see cref=\"Optimization\"/></returns>\n        public Optimization ReadOptimization(string optimizationId);\n\n        /// <summary>\n        /// Abort an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to abort</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse AbortOptimization(string optimizationId);\n\n        /// <summary>\n        /// Update an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id we want to update</param>\n        /// <param name=\"name\">Name we'd like to assign to the optimization</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse UpdateOptimization(string optimizationId, string name = null);\n\n        /// <summary>\n        /// Delete an optimization\n        /// </summary>\n        /// <param name=\"optimizationId\">Optimization id for the optimization we want to delete</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse DeleteOptimization(string optimizationId);\n\n        /// <summary>\n        /// Gets the logs of a specific live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Project Id of the live running algorithm</param>\n        /// <param name=\"algorithmId\">Algorithm Id of the live running algorithm</param>\n        /// <param name=\"startLine\">Start line of logs to read</param>\n        /// <param name=\"endLine\">End line of logs to read</param>\n        /// <returns>List of strings that represent the logs of the algorithm</returns>\n        LiveLog ReadLiveLogs(int projectId, string algorithmId, int startLine, int endLine);\n\n        /// <summary>\n        /// Returns a chart object from a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the request</param>\n        /// <param name=\"name\">The requested chart name</param>\n        /// <param name=\"start\">The Utc start seconds timestamp of the request</param>\n        /// <param name=\"end\">The Utc end seconds timestamp of the request</param>\n        /// <param name=\"count\">The number of data points to request</param>\n        /// <returns></returns>\n        public ReadChartResponse ReadLiveChart(int projectId, string name, int start, int end, uint count);\n\n        /// <summary>\n        /// Read out the portfolio state of a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the live algorithm</param>\n        /// <returns><see cref=\"PortfolioResponse\"/></returns>\n        public PortfolioResponse ReadLivePortfolio(int projectId);\n\n        /// <summary>\n        /// Read out the insights of a live algorithm\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project from which to read the live algorithm</param>\n        /// <param name=\"start\">Starting index of the insights to be fetched</param>\n        /// <param name=\"end\">Last index of the insights to be fetched. Note that end - start must be less than 100</param>\n        /// <returns><see cref=\"InsightResponse\"/></returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        public InsightResponse ReadLiveInsights(int projectId, int start = 0, int end = 0);\n\n        /// <summary>\n        /// Gets the link to the downloadable data.\n        /// </summary>\n        /// <param name=\"filePath\">File path representing the data requested</param>\n        /// <param name=\"organizationId\">Organization to purchase this data with</param>\n        /// <returns>Link to the downloadable data.</returns>\n        DataLink ReadDataLink(string filePath, string organizationId);\n\n        /// <summary>\n        /// Get valid data entries for a given filepath from data/list\n        /// </summary>\n        /// <returns></returns>\n        DataList ReadDataDirectory(string filePath);\n\n        /// <summary>\n        /// Gets data prices from data/prices\n        /// </summary>\n        public DataPricesList ReadDataPrices(string organizationId);\n\n        /// <summary>\n        /// Read out the report of a backtest in the project id specified.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to read</param>\n        /// <param name=\"backtestId\">Specific backtest id to read</param>\n        /// <returns><see cref=\"BacktestReport\"/></returns>\n        public BacktestReport ReadBacktestReport(int projectId, string backtestId);\n\n        /// <summary>\n        /// Returns a requested chart object from a backtest\n        /// </summary>\n        /// <param name=\"projectId\">Project ID of the request</param>\n        /// <param name=\"name\">The requested chart name</param>\n        /// <param name=\"start\">The Utc start seconds timestamp of the request</param>\n        /// <param name=\"end\">The Utc end seconds timestamp of the request</param>\n        /// <param name=\"count\">The number of data points to request</param>\n        /// <param name=\"backtestId\">Associated Backtest ID for this chart request</param>\n        /// <returns></returns>\n        public ReadChartResponse ReadBacktestChart(int projectId, string name, int start, int end, uint count, string backtestId);\n\n        /// <summary>\n        /// Method to download and save the data purchased through QuantConnect\n        /// </summary>\n        /// <param name=\"filePath\">File path representing the data requested</param>\n        /// <returns>A bool indicating whether the data was successfully downloaded or not.</returns>\n        bool DownloadData(string filePath, string organizationId);\n\n        /// <summary>\n        /// Will read the organization account status\n        /// </summary>\n        /// <param name=\"organizationId\">The target organization id, if null will return default organization</param>\n        public Account ReadAccount(string organizationId = null);\n\n        /// <summary>\n        /// Fetch organization data from web API\n        /// </summary>\n        /// <param name=\"organizationId\"></param>\n        /// <returns></returns>\n        public Organization ReadOrganization(string organizationId = null);\n\n        /// <summary>\n        /// Create a new live algorithm for a logged in user.\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project on QuantConnect</param>\n        /// <param name=\"compileId\">Id of the compilation on QuantConnect</param>\n        /// <param name=\"nodeId\">Id of the node that will run the algorithm</param>\n        /// <param name=\"brokerageSettings\">Dictionary with Brokerage specific settings</param>\n        /// <param name=\"versionId\">The version identifier</param>\n        /// <param name=\"dataProviders\">Dictionary with data providers and their corresponding credentials</param>\n        /// <returns>Information regarding the new algorithm <see cref=\"CreateLiveAlgorithmResponse\"/></returns>\n        CreateLiveAlgorithmResponse CreateLiveAlgorithm(int projectId, string compileId, string nodeId, Dictionary<string, object> brokerageSettings, string versionId = \"-1\", Dictionary<string, object> dataProviders = null);\n\n        /// <summary>\n        /// Get a list of live running algorithms for a logged in user.\n        /// </summary>\n        /// <param name=\"status\">Filter the statuses of the algorithms returned from the api</param>\n        /// <returns>List of live algorithm instances</returns>\n        LiveList ListLiveAlgorithms(AlgorithmStatus? status = null);\n\n        /// <summary>\n        /// Read out a live algorithm in the project id specified.\n        /// </summary>\n        /// <param name=\"projectId\">Project id to read</param>\n        /// <param name=\"deployId\">Specific instance id to read</param>\n        /// <returns>Live object with the results</returns>\n        LiveAlgorithmResults ReadLiveAlgorithm(int projectId, string deployId);\n\n        /// <summary>\n        /// Liquidate a live algorithm from the specified project.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the live instance we want to stop</param>\n        /// <returns></returns>\n        RestResponse LiquidateLiveAlgorithm(int projectId);\n\n        /// <summary>\n        /// Stop a live algorithm from the specified project.\n        /// </summary>\n        /// <param name=\"projectId\">Project for the live algo we want to delete</param>\n        /// <returns></returns>\n        RestResponse StopLiveAlgorithm(int projectId);\n\n        /// <summary>\n        /// Sends a notification\n        /// </summary>\n        /// <param name=\"notification\">The notification to send</param>\n        /// <param name=\"projectId\">The project id</param>\n        /// <returns><see cref=\"RestResponse\"/> containing success response and errors</returns>\n        RestResponse SendNotification(Notification notification, int projectId);\n\n        /// <summary>\n        /// Get the algorithm current status, active or cancelled from the user\n        /// </summary>\n        /// <param name=\"algorithmId\"></param>\n        /// <returns></returns>\n        AlgorithmControl GetAlgorithmStatus(string algorithmId);\n\n        /// <summary>\n        /// Set the algorithm status from the worker to update the UX e.g. if there was an error.\n        /// </summary>\n        /// <param name=\"algorithmId\">Algorithm id we're setting.</param>\n        /// <param name=\"status\">Status enum of the current worker</param>\n        /// <param name=\"message\">Message for the algorithm status event</param>\n        void SetAlgorithmStatus(string algorithmId, AlgorithmStatus status, string message = \"\");\n\n        /// <summary>\n        /// Send the statistics to storage for performance tracking.\n        /// </summary>\n        /// <param name=\"algorithmId\">Identifier for algorithm</param>\n        /// <param name=\"unrealized\">Unrealized gainloss</param>\n        /// <param name=\"fees\">Total fees</param>\n        /// <param name=\"netProfit\">Net profi</param>\n        /// <param name=\"holdings\">Algorithm holdings</param>\n        /// <param name=\"equity\">Total equity</param>\n        /// <param name=\"netReturn\">Algorithm return</param>\n        /// <param name=\"volume\">Volume traded</param>\n        /// <param name=\"trades\">Total trades since inception</param>\n        /// <param name=\"sharpe\">Sharpe ratio since inception</param>\n        void SendStatistics(string algorithmId, decimal unrealized, decimal fees, decimal netProfit, decimal holdings, decimal equity, decimal netReturn, decimal volume, int trades, double sharpe);\n\n        /// <summary>\n        /// Local implementation for downloading data to algorithms\n        /// </summary>\n        /// <param name=\"address\">URL to download</param>\n        /// <param name=\"headers\">KVP headers</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns></returns>\n        string Download(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password);\n\n        /// <summary>\n        /// Local implementation for downloading data to algorithms\n        /// </summary>\n        /// <param name=\"address\">URL to download</param>\n        /// <param name=\"headers\">KVP headers</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns></returns>\n        byte[] DownloadBytes(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password);\n\n        /// <summary>\n        /// Download the object store associated with the given organization ID and key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to get the Object Store from</param>\n        /// <param name=\"keys\">Keys for the Object Store files</param>\n        /// <param name=\"destinationFolder\">Folder in which the object will be stored</param>\n        /// <returns>True if the object was retrieved correctly, false otherwise</returns>\n        public bool GetObjectStore(string organizationId, List<string> keys, string destinationFolder = null);\n\n        /// <summary>\n        /// Get Object Store properties given the organization ID and the Object Store key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to get the Object Store from</param>\n        /// <param name=\"key\">Key for the Object Store file</param>\n        /// <returns><see cref=\"PropertiesObjectStoreResponse\"/></returns>\n        /// <remarks>It does not work when the object store is a directory</remarks>\n        public PropertiesObjectStoreResponse GetObjectStoreProperties(string organizationId, string key);\n\n        /// <summary>\n        /// Upload files to the Object Store\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to upload the file to</param>\n        /// <param name=\"key\">Key to the Object Store file</param>\n        /// <param name=\"objectData\">File to be uploaded</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse SetObjectStore(string organizationId, string key, byte[] objectData);\n\n        /// <summary>\n        /// Request to delete Object Store metadata of a specific organization and key\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID we would like to delete the Object Store file from</param>\n        /// <param name=\"key\">Key to the Object Store file</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse DeleteObjectStore(string organizationId, string key);\n\n        /// <summary>\n        /// Gets a list of LEAN versions with their corresponding basic descriptions\n        /// </summary>\n        public VersionsResponse ReadLeanVersions();\n\n        /// <summary>\n        /// Broadcast a live command\n        /// </summary>\n        /// <param name=\"organizationId\">Organization ID of the projects we would like to broadcast the command to</param>\n        /// <param name=\"excludeProjectId\">Project for the live instance we want to exclude from the broadcast list</param>\n        /// <param name=\"command\">The command to run</param>\n        /// <returns><see cref=\"RestResponse\"/></returns>\n        public RestResponse BroadcastLiveCommand(string organizationId, int? excludeProjectId, object command);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IBrokerage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Brokerage interface that defines the operations all brokerages must implement. The IBrokerage implementation\n    /// must have a matching IBrokerageFactory implementation.\n    /// </summary>\n    public interface IBrokerage : IBrokerageCashSynchronizer, IDisposable\n    {\n        /// <summary>\n        /// Event that fires each time the brokerage order id changes\n        /// </summary>\n        event EventHandler<BrokerageOrderIdChangedEvent> OrderIdChanged;\n\n        /// <summary>\n        /// Event that fires each time the status for a list of orders change\n        /// </summary>\n        event EventHandler<List<OrderEvent>> OrdersStatusChanged;\n\n        /// <summary>\n        /// Event that fires each time an order is updated in the brokerage side\n        /// </summary>\n        /// <remarks>\n        /// These are not status changes but mainly price changes, like the stop price of a trailing stop order\n        /// </remarks>\n        event EventHandler<OrderUpdateEvent> OrderUpdated;\n\n        /// <summary>\n        /// Event that fires each time a short option position is assigned\n        /// </summary>\n        event EventHandler<OrderEvent> OptionPositionAssigned;\n\n        /// <summary>\n        /// Event that fires each time an option position has changed\n        /// </summary>\n        event EventHandler<OptionNotificationEventArgs> OptionNotification;\n\n        /// <summary>\n        /// Event that fires each time there's a brokerage side generated order\n        /// </summary>\n        event EventHandler<NewBrokerageOrderNotificationEventArgs> NewBrokerageOrderNotification;\n\n        /// <summary>\n        /// Event that fires each time a delisting occurs\n        /// </summary>\n        /// <remarks>TODO: Wire brokerages to call this event to process delistings</remarks>\n        event EventHandler<DelistingNotificationEventArgs> DelistingNotification;\n\n        /// <summary>\n        /// Event that fires each time a user's brokerage account is changed\n        /// </summary>\n        event EventHandler<AccountEvent> AccountChanged;\n\n        /// <summary>\n        /// Event that fires when a message is received from the brokerage\n        /// </summary>\n        event EventHandler<BrokerageMessageEvent> Message;\n\n        /// <summary>\n        /// Gets the name of the brokerage\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Returns true if we're currently connected to the broker\n        /// </summary>\n        bool IsConnected { get; }\n\n        /// <summary>\n        /// Gets all open orders on the account\n        /// </summary>\n        /// <returns>The open orders returned from IB</returns>\n        List<Order> GetOpenOrders();\n\n        /// <summary>\n        /// Gets all holdings for the account\n        /// </summary>\n        /// <returns>The current holdings from the account</returns>\n        List<Holding> GetAccountHoldings();\n\n        /// <summary>\n        /// Gets the current cash balance for each currency held in the brokerage account\n        /// </summary>\n        /// <returns>The current cash balance for each currency available for trading</returns>\n        List<CashAmount> GetCashBalance();\n\n        /// <summary>\n        /// Places a new order and assigns a new broker ID to the order\n        /// </summary>\n        /// <param name=\"order\">The order to be placed</param>\n        /// <returns>True if the request for a new order has been placed, false otherwise</returns>\n        bool PlaceOrder(Order order);\n\n        /// <summary>\n        /// Updates the order with the same id\n        /// </summary>\n        /// <param name=\"order\">The new order information</param>\n        /// <returns>True if the request was made for the order to be updated, false otherwise</returns>\n        bool UpdateOrder(Order order);\n\n        /// <summary>\n        /// Cancels the order with the specified ID\n        /// </summary>\n        /// <param name=\"order\">The order to cancel</param>\n        /// <returns>True if the request was made for the order to be canceled, false otherwise</returns>\n        bool CancelOrder(Order order);\n\n        /// <summary>\n        /// Connects the client to the broker's remote servers\n        /// </summary>\n        void Connect();\n\n        /// <summary>\n        /// Disconnects the client from the broker's remote servers\n        /// </summary>\n        void Disconnect();\n\n        /// <summary>\n        /// Specifies whether the brokerage will instantly update account balances\n        /// </summary>\n        bool AccountInstantlyUpdated { get; }\n\n        /// <summary>\n        /// Returns the brokerage account's base currency\n        /// </summary>\n        string AccountBaseCurrency { get; }\n\n        /// <summary>\n        /// Gets the history for the requested security\n        /// </summary>\n        /// <param name=\"request\">The historical data request</param>\n        /// <returns>An enumerable of bars covering the span specified in the request</returns>\n        IEnumerable<BaseData> GetHistory(HistoryRequest request);\n\n        /// <summary>\n        /// Enables or disables concurrent processing of messages to and from the brokerage.\n        /// </summary>\n        bool ConcurrencyEnabled { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IBrokerageCashSynchronizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines live brokerage cash synchronization operations.\n    /// </summary>\n    public interface IBrokerageCashSynchronizer\n    {\n        /// <summary>\n        /// Gets the datetime of the last sync (UTC)\n        /// </summary>\n        DateTime LastSyncDateTimeUtc { get; }\n\n        /// <summary>\n        /// Returns whether the brokerage should perform the cash synchronization\n        /// </summary>\n        /// <param name=\"currentTimeUtc\">The current time (UTC)</param>\n        /// <returns>True if the cash sync should be performed</returns>\n        bool ShouldPerformCashSync(DateTime currentTimeUtc);\n\n        /// <summary>\n        /// Synchronizes the cashbook with the brokerage account\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"currentTimeUtc\">The current time (UTC)</param>\n        /// <param name=\"getTimeSinceLastFill\">A function which returns the time elapsed since the last fill</param>\n        /// <returns>True if the cash sync was performed successfully</returns>\n        bool PerformCashSync(IAlgorithm algorithm, DateTime currentTimeUtc, Func<TimeSpan> getTimeSinceLastFill);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IBrokerageFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines factory types for brokerages. Every IBrokerage is expected to also implement an IBrokerageFactory.\n    /// </summary>\n    [InheritedExport(typeof(IBrokerageFactory))]\n    public interface IBrokerageFactory : IDisposable\n    {\n        /// <summary>\n        /// Gets the type of brokerage produced by this factory\n        /// </summary>\n        Type BrokerageType { get; }\n\n        /// <summary>\n        /// Gets the brokerage data required to run the brokerage from configuration/disk\n        /// </summary>\n        /// <remarks>\n        /// The implementation of this property will create the brokerage data dictionary required for\n        /// running live jobs. See <see cref=\"IJobQueueHandler.NextJob\"/>\n        /// </remarks>\n        Dictionary<string, string> BrokerageData { get; }\n\n        /// <summary>\n        /// Gets a brokerage model that can be used to model this brokerage's unique behaviors\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider</param>\n        IBrokerageModel GetBrokerageModel(IOrderProvider orderProvider);\n\n        /// <summary>\n        /// Creates a new IBrokerage instance\n        /// </summary>\n        /// <param name=\"job\">The job packet to create the brokerage for</param>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>A new brokerage instance</returns>\n        IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm);\n\n        /// <summary>\n        /// Gets a brokerage message handler\n        /// </summary>\n        IBrokerageMessageHandler CreateBrokerageMessageHandler(IAlgorithm algorithm, AlgorithmNodePacket job, IApi api);\n    }\n}"
  },
  {
    "path": "Common/Interfaces/IBusyCollection.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Interface used to handle items being processed and communicate busy state\n    /// </summary>\n    /// <typeparam name=\"T\">The item type being processed</typeparam>\n    public interface IBusyCollection<T> : IDisposable\n    {\n        /// <summary>\n        /// Gets a wait handle that can be used to wait until this instance is done\n        /// processing all of it's item\n        /// </summary>\n        WaitHandle WaitHandle { get; }\n\n        /// <summary>\n        /// Gets the number of items held within this collection\n        /// </summary>\n        int Count { get; }\n\n        /// <summary>\n        /// Returns true if processing, false otherwise\n        /// </summary>\n        bool IsBusy { get; }\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        void Add(T item);\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        void Add(T item, CancellationToken cancellationToken);\n\n        /// <summary>\n        /// Marks the collection as not accepting any more additions\n        /// </summary>\n        void CompleteAdding();\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        IEnumerable<T> GetConsumingEnumerable();\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        IEnumerable<T> GetConsumingEnumerable(CancellationToken cancellationToken);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataCacheProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines a cache for data\n    /// </summary>\n    public interface IDataCacheProvider : IDisposable\n    {\n        /// <summary>\n        /// Property indicating the data is temporary in nature and should not be cached\n        /// </summary>\n        bool IsDataEphemeral { get; }\n\n        /// <summary>\n        /// Fetch data from the cache\n        /// </summary>\n        /// <param name=\"key\">A string representing the key of the cached data</param>\n        /// <returns>An <see cref=\"Stream\"/> of the cached data</returns>\n        Stream Fetch(string key);\n\n        /// <summary>\n        /// Store the data in the cache\n        /// </summary>\n        /// <param name=\"key\">The source of the data, used as a key to retrieve data in the cache</param>\n        /// <param name=\"data\">The data to cache as a byte array</param>\n        void Store(string key, byte[] data);\n\n        /// <summary>\n        /// Returns a list of zip entries in a provided zip file\n        /// </summary>\n        List<string> GetZipEntries(string zipFile);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataChannelProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Specifies data channel settings\n    /// </summary>\n    public interface IDataChannelProvider\n    {\n        /// <summary>\n        /// Initializes the class with an algorithm node packet\n        /// </summary>\n        /// <param name=\"packet\">Algorithm node packet</param>\n        void Initialize(AlgorithmNodePacket packet);\n\n        /// <summary>\n        /// True if this subscription configuration should be streamed\n        /// </summary>\n        bool ShouldStreamSubscription(SubscriptionDataConfig config);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataMonitor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.ComponentModel.Composition;\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Monitors data requests and reports on missing data\n    /// </summary>\n    [InheritedExport(typeof(IDataMonitor))]\n    public interface IDataMonitor : IDisposable\n    {\n        /// <summary>\n        /// Terminates the data monitor generating a final report\n        /// </summary>\n        void Exit();\n        \n        /// <summary>\n        /// Event handler for the <see cref=\"IDataProvider.NewDataRequest\"/> event\n        /// </summary>\n        void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs e);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataPermissionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Entity in charge of handling data permissions\n    /// </summary>\n    public interface IDataPermissionManager\n    {\n        /// <summary>\n        /// The data channel provider instance\n        /// </summary>\n        IDataChannelProvider DataChannelProvider { get; }\n\n        /// <summary>\n        /// Initialize the data permission manager\n        /// </summary>\n        /// <param name=\"job\">The job packet</param>\n        void Initialize(AlgorithmNodePacket job);\n\n        /// <summary>\n        /// Will assert the requested configuration is valid for the current job\n        /// </summary>\n        /// <param name=\"subscriptionRequest\">The data subscription configuration to assert</param>\n        /// <param name=\"startTimeLocal\">The start time of this request</param>\n        /// <param name=\"endTimeLocal\">The end time of this request</param>\n        void AssertConfiguration(SubscriptionDataConfig subscriptionRequest, DateTime startTimeLocal, DateTime endTimeLocal);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.ComponentModel.Composition;\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Fetches a remote file for a security.\n    /// Must save the file to Globals.DataFolder.\n    /// </summary>\n    [InheritedExport(typeof(IDataProvider))]\n    public interface IDataProvider\n    {\n        /// <summary>\n        /// Event raised each time data fetch is finished (successfully or not)\n        /// </summary>\n        event EventHandler<DataProviderNewDataRequestEventArgs> NewDataRequest;\n\n        /// <summary>\n        /// Retrieves data to be used in an algorithm\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        Stream Fetch(string key);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataProviderEvents.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Events related to data providers\n    /// </summary>\n    public interface IDataProviderEvents\n    {\n        /// <summary>\n        /// Event fired when an invalid configuration has been detected\n        /// </summary>\n        event EventHandler<InvalidConfigurationDetectedEventArgs> InvalidConfigurationDetected;\n\n        /// <summary>\n        /// Event fired when the numerical precision in the factor file has been limited\n        /// </summary>\n        event EventHandler<NumericalPrecisionLimitedEventArgs> NumericalPrecisionLimited;\n\n        /// <summary>\n        /// Event fired when there was an error downloading a remote file\n        /// </summary>\n        event EventHandler<DownloadFailedEventArgs> DownloadFailed;\n\n        /// <summary>\n        /// Event fired when there was an error reading the data\n        /// </summary>\n        event EventHandler<ReaderErrorDetectedEventArgs> ReaderErrorDetected;\n\n        /// <summary>\n        /// Event fired when the start date has been limited\n        /// </summary>\n        event EventHandler<StartDateLimitedEventArgs> StartDateLimited;\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataQueueHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Task requestor interface with cloud system\n    /// </summary>\n    [InheritedExport(typeof(IDataQueueHandler))]\n    public interface IDataQueueHandler : IDisposable\n    {\n        /// <summary>\n        /// Subscribe to the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler);\n\n        /// <summary>\n        /// Removes the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">Subscription config to be removed</param>\n        void Unsubscribe(SubscriptionDataConfig dataConfig);\n\n        /// <summary>\n        /// Sets the job we're subscribing for\n        /// </summary>\n        /// <param name=\"job\">Job we're subscribing for</param>\n        void SetJob(LiveNodePacket job);\n\n        /// <summary>\n        /// Returns whether the data provider is connected\n        /// </summary>\n        /// <returns>True if the data provider is connected</returns>\n        bool IsConnected { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDataQueueUniverseProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// This interface allows interested parties to lookup or enumerate the available symbols. Data source exposes it if this feature is available.\n    /// Availability of a symbol doesn't imply that it is possible to trade it. This is a data source specific interface, not broker specific.\n    /// </summary>\n    public interface IDataQueueUniverseProvider\n    {\n        /// <summary>\n        /// Method returns a collection of Symbols that are available at the data source.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup</param>\n        /// <param name=\"includeExpired\">Include expired contracts</param>\n        /// <param name=\"securityCurrency\">Expected security currency(if any)</param>\n        /// <returns>Enumerable of Symbols, that are associated with the provided Symbol</returns>\n        IEnumerable<Symbol> LookupSymbols(Symbol symbol, bool includeExpired, string securityCurrency = null);\n\n        /// <summary>\n        /// Returns whether selection can take place or not.\n        /// </summary>\n        /// <remarks>This is useful to avoid a selection taking place during invalid times, for example IB reset times or when not connected,\n        /// because if allowed selection would fail since IB isn't running and would kill the algorithm</remarks>\n        /// <returns>True if selection can take place</returns>\n        bool CanPerformSelection();\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IDownloadProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Wrapper on the API for downloading data for an algorithm.\n    /// </summary>\n    public interface IDownloadProvider\n    {\n        /// <summary>\n        /// Method for downloading data for an algorithm\n        /// </summary>\n        /// <param name=\"address\">Source URL to download from</param>\n        /// <param name=\"headers\">Headers to pass to the site</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns>String contents of file</returns>\n        string Download(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password);\n\n        /// <summary>\n        /// Method for downloading data for an algorithm that can be read from a stream\n        /// </summary>\n        /// <param name=\"address\">Source URL to download from</param>\n        /// <param name=\"headers\">Headers to pass to the site</param>\n        /// <param name=\"userName\">Username for basic authentication</param>\n        /// <param name=\"password\">Password for basic authentication</param>\n        /// <returns>String contents of file</returns>\n        byte[] DownloadBytes(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IExtendedDictionary.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Represents a generic collection of key/value pairs that implements python dictionary methods.\n    /// </summary>\n    public interface IExtendedDictionary<TKey, TValue>\n    {\n        /// <summary>\n        /// Removes all keys and values from the <see cref=\"IExtendedDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        void clear();\n\n        /// <summary>\n        /// Creates a shallow copy of the <see cref=\"IExtendedDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <returns>Returns a shallow copy of the dictionary. It doesn't modify the original dictionary.</returns>\n        PyDict copy();\n\n        /// <summary>\n        /// Creates a new dictionary from the given sequence of elements.\n        /// </summary>\n        /// <param name=\"sequence\">Sequence of elements which is to be used as keys for the new dictionary</param>\n        /// <returns>Returns a new dictionary with the given sequence of elements as the keys of the dictionary.</returns>\n        PyDict fromkeys(TKey[] sequence);\n\n        /// <summary>\n        /// Creates a new dictionary from the given sequence of elements with a value provided by the user.\n        /// </summary>\n        /// <param name=\"sequence\">Sequence of elements which is to be used as keys for the new dictionary</param>\n        /// <param name=\"value\">Value which is set to each each element of the dictionary</param>\n        /// <returns>Returns a new dictionary with the given sequence of elements as the keys of the dictionary.\n        /// Each element of the newly created dictionary is set to the provided value.</returns>\n        PyDict fromkeys(TKey[] sequence, TValue value);\n\n        /// <summary>\n        /// Returns the value for the specified key if key is in dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key to be searched in the dictionary</param>\n        /// <returns>The value for the specified key if key is in dictionary.\n        /// None if the key is not found and value is not specified.</returns>\n        TValue get(TKey key);\n\n        /// <summary>\n        /// Returns the value for the specified key if key is in dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key to be searched in the dictionary</param>\n        /// <param name=\"value\">Value to be returned if the key is not found. The default value is null.</param>\n        /// <returns>The value for the specified key if key is in dictionary.\n        /// value if the key is not found and value is specified.</returns>\n        TValue get(TKey key, TValue value);\n\n        /// <summary>\n        /// Returns a view object that displays a list of dictionary's (key, value) tuple pairs.\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of a given dictionary's (key, value) tuple pair.</returns>\n        PyList items();\n\n        /// <summary>\n        /// Returns a view object that displays a list of all the keys in the dictionary\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of all the keys.\n        /// When the dictionary is changed, the view object also reflect these changes.</returns>\n        PyList keys();\n\n        /// <summary>\n        /// Returns and removes an arbitrary element (key, value) pair from the dictionary.\n        /// </summary>\n        /// <returns>Returns an arbitrary element (key, value) pair from the dictionary\n        /// removes an arbitrary element(the same element which is returned) from the dictionary.\n        /// Note: Arbitrary elements and random elements are not same.The popitem() doesn't return a random element.</returns>\n        PyTuple popitem();\n\n        /// <summary>\n        /// Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key with null/None value is inserted to the dictionary if key is not in the dictionary.</param>\n        /// <returns>The value of the key if it is in the dictionary\n        /// None if key is not in the dictionary</returns>\n        TValue setdefault(TKey key);\n\n        /// <summary>\n        /// Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key with a value default_value is inserted to the dictionary if key is not in the dictionary.</param>\n        /// <param name=\"default_value\">Default value</param>\n        /// <returns>The value of the key if it is in the dictionary\n        /// default_value if key is not in the dictionary and default_value is specified</returns>\n        TValue setdefault(TKey key, TValue default_value);\n\n        /// <summary>\n        /// Removes and returns an element from a dictionary having the given key.\n        /// </summary>\n        /// <param name=\"key\">Key which is to be searched for removal</param>\n        /// <returns>If key is found - removed/popped element from the dictionary\n        /// If key is not found - KeyError exception is raised</returns>\n        TValue pop(TKey key);\n\n        /// <summary>\n        /// Removes and returns an element from a dictionary having the given key.\n        /// </summary>\n        /// <param name=\"key\">Key which is to be searched for removal</param>\n        /// <param name=\"default_value\">Value which is to be returned when the key is not in the dictionary</param>\n        /// <returns>If key is found - removed/popped element from the dictionary\n        /// If key is not found - value specified as the second argument(default)</returns>\n        TValue pop(TKey key, TValue default_value);\n\n        /// <summary>\n        /// Updates the dictionary with the elements from the another dictionary object or from an iterable of key/value pairs.\n        /// The update() method adds element(s) to the dictionary if the key is not in the dictionary.If the key is in the dictionary, it updates the key with the new value.\n        /// </summary>\n        /// <param name=\"other\">Takes either a dictionary or an iterable object of key/value pairs (generally tuples).</param>\n        void update(PyObject other);\n\n        /// <summary>\n        /// Returns a view object that displays a list of all the values in the dictionary.\n        /// </summary>\n        /// <returns>Returns a view object that displays a list of all values in a given dictionary.</returns>\n        PyList values();\n    }\n}"
  },
  {
    "path": "Common/Interfaces/IFactorFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides instances of <see cref=\"FactorFile{T}\"/> at run time\n    /// </summary>\n    [InheritedExport(typeof(IFactorFileProvider))]\n    public interface IFactorFileProvider\n    {\n        /// <summary>\n        /// Initializes our FactorFileProvider by supplying our mapFileProvider\n        /// and dataProvider\n        /// </summary>\n        /// <param name=\"mapFileProvider\">MapFileProvider to use</param>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider);\n\n        /// <summary>\n        /// Gets a <see cref=\"FactorFile{T}\"/> instance for the specified symbol, or null if not found\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol whose factor file we seek</param>\n        /// <returns>The resolved factor file, or null if not found</returns>\n        IFactorProvider Get(Symbol symbol);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IFutureChainProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides the full future chain for a given underlying.\n    /// </summary>\n    public interface IFutureChainProvider\n    {\n        /// <summary>\n        /// Gets the list of future contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the future chain (only used in backtesting)</param>\n        /// <returns>The list of future contracts</returns>\n        IEnumerable<Symbol> GetFutureContractList(Symbol symbol, DateTime date);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IHistoryProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing NodaTime;\nusing QuantConnect.Data;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides historical data to an algorithm at runtime\n    /// </summary>\n    [InheritedExport(typeof(IHistoryProvider))]\n    public interface IHistoryProvider : IDataProviderEvents\n    {\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        int DataPointCount { get; }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        void Initialize(HistoryProviderInitializeParameters parameters);\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IJobQueueHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.ComponentModel.Composition;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Task requestor interface with cloud system\n    /// </summary>\n    [InheritedExport(typeof(IJobQueueHandler))]\n    public interface IJobQueueHandler\n    {\n        /// <summary>\n        /// Initialize the internal state\n        /// </summary>\n        void Initialize(IApi api, IMessagingHandler messagingHandler);\n\n        /// <summary>\n        /// Request the next task to run through the engine:\n        /// </summary>\n        /// <returns>Algorithm job to process</returns>\n        AlgorithmNodePacket NextJob(out string algorithmPath);\n\n        /// <summary>\n        /// Signal task complete\n        /// </summary>\n        /// <param name=\"job\">Work to do.</param>\n        void AcknowledgeJob(AlgorithmNodePacket job);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IMapFileProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides instances of <see cref=\"MapFileResolver\"/> at run time\n    /// </summary>\n    [InheritedExport(typeof(IMapFileProvider))]\n    public interface IMapFileProvider\n    {\n        /// <summary>\n        /// Initializes our MapFileProvider by supplying our dataProvider\n        /// </summary>\n        /// <param name=\"dataProvider\">DataProvider to use</param>\n        void Initialize(IDataProvider dataProvider);\n\n        /// <summary>\n        /// Gets a <see cref=\"MapFileResolver\"/> representing all the map\n        /// files for the specified market\n        /// </summary>\n        /// <param name=\"auxiliaryDataKey\">Key used to fetch a map file resolver. Specifying market and security type</param>\n        /// <returns>A <see cref=\"MapFileResolver\"/> containing all map files for the specified market</returns>\n        MapFileResolver Get(AuxiliaryDataKey auxiliaryDataKey);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IMessagingHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Notifications;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Messaging System Plugin Interface. \n    /// Provides a common messaging pattern between desktop and cloud implementations of QuantConnect.\n    /// </summary>\n    [InheritedExport(typeof(IMessagingHandler))]\n    public interface IMessagingHandler : IDisposable\n    {\n        /// <summary>\n        /// Gets or sets whether this messaging handler has any current subscribers.\n        /// When set to false, messages won't be sent.\n        /// </summary>\n        bool HasSubscribers { get; set; }\n\n        /// <summary>\n        /// Initialize the Messaging System Plugin. \n        /// </summary>\n        /// <param name=\"initializeParameters\">The parameters required for initialization</param>\n        void Initialize(MessagingHandlerInitializeParameters initializeParameters);\n\n        /// <summary>\n        /// Set the user communication channel\n        /// </summary>\n        /// <param name=\"job\">The job packet</param>\n        void SetAuthentication(AlgorithmNodePacket job);\n\n        /// <summary>\n        /// Send any message with a base type of Packet.\n        /// </summary>\n        /// <param name=\"packet\">Packet of data to send via the messaging system plugin</param>\n        void Send(Packet packet);\n\n        /// <summary>\n        /// Send any notification with a base type of Notification.\n        /// </summary>\n        /// <param name=\"notification\">The notification to be sent.</param>\n        void SendNotification(Notification notification);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IObjectStore.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Packets;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides object storage for data persistence.\n    /// </summary>\n    [InheritedExport(typeof(IObjectStore))]\n    public interface IObjectStore : IDisposable, IEnumerable<KeyValuePair<string, byte[]>>\n    {\n        /// <summary>\n        /// Gets the maximum storage limit in bytes\n        /// </summary>\n        long MaxSize { get; }\n\n        /// <summary>\n        /// Gets the maximum number of files allowed\n        /// </summary>\n        int MaxFiles { get; }\n\n        /// <summary>\n        /// Event raised each time there's an error\n        /// </summary>\n        event EventHandler<ObjectStoreErrorRaisedEventArgs> ErrorRaised;\n\n        /// <summary>\n        /// Initializes the object store\n        /// </summary>\n        /// <param name=\"userId\">The user id</param>\n        /// <param name=\"projectId\">The project id</param>\n        /// <param name=\"userToken\">The user token</param>\n        /// <param name=\"controls\">The job controls instance</param>\n        /// <param name=\"algorithmMode\">The algorithm mode</param>\n        void Initialize(int userId, int projectId, string userToken, Controls controls, AlgorithmMode algorithmMode);\n\n        /// <summary>\n        /// Determines whether the store contains data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the key was found</returns>\n        bool ContainsKey(string path);\n\n        /// <summary>\n        /// Returns the object data for the specified key\n        /// </summary>\n        /// <param name=\"path\">The object key</param>\n        /// <returns>A byte array containing the data</returns>\n        byte[] ReadBytes(string path);\n\n        /// <summary>\n        /// Saves the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"contents\">The object data</param>\n        /// <returns>True if the save operation was successful</returns>\n        bool SaveBytes(string path, byte[] contents);\n\n        /// <summary>\n        /// Deletes the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the delete operation was successful</returns>\n        bool Delete(string path);\n\n        /// <summary>\n        /// Returns the file path for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>The path for the file</returns>\n        string GetFilePath(string path);\n\n        /// <summary>\n        /// Returns the file paths present in the object store. This is specially useful not to load the object store into memory\n        /// </summary>\n        ICollection<string> Keys { get; }\n\n        /// <summary>\n        /// Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information\n        /// </summary>\n        void Clear();\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IOptionChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Provides the full option chain for a given underlying.\n    /// </summary>\n    public interface IOptionChainProvider\n    {\n        /// <summary>\n        /// Gets the list of option contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The option or the underlying symbol to get the option chain for.\n        /// Providing the option allows targetting an option ticker different than the default e.g. SPXW</param>\n        /// <param name=\"date\">The date for which to request the option chain (only used in backtesting)</param>\n        /// <returns>The list of option contracts</returns>\n        IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IOptionPrice.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Reduced interface for accessing <see cref=\"Option\"/>\n    /// specific price properties and methods\n    /// </summary>\n    public interface IOptionPrice : ISecurityPrice\n    {\n        /// <summary>\n        /// Gets a reduced interface of the underlying security object.\n        /// </summary>\n        ISecurityPrice Underlying { get; }\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        OptionPriceModelResult EvaluatePriceModel(Slice slice, OptionContract contract);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order\n    /// </summary>\n    public interface IOrderProperties\n    {\n        /// <summary>\n        /// Defines the length of time over which an order will continue working before it is cancelled\n        /// </summary>\n        [JsonProperty(PropertyName = \"timeInForce\")]\n        TimeInForce TimeInForce { get; set; }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        IOrderProperties Clone();\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IPrimaryExchangeProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Primary Exchange Provider interface\n    /// </summary>\n    public interface IPrimaryExchangeProvider\n    {\n        /// <summary>\n        /// Gets the primary exchange for a given security identifier\n        /// </summary>\n        /// <param name=\"securityIdentifier\">The security identifier to get the primary exchange for</param>\n        /// <returns>Returns the primary exchange or null if not found</returns>\n        Exchange GetPrimaryExchange(SecurityIdentifier securityIdentifier);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IRegressionAlgorithmDefinition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines a C# algorithm as a regression algorithm to be run as part of the test suite.\n    /// This interface also allows the algorithm to declare that it has versions in other languages\n    /// that should yield identical results.\n    /// </summary>\n    public interface IRegressionAlgorithmDefinition\n    {\n        /// <summary>\n        /// Final status of the algorithm\n        /// </summary>\n        AlgorithmStatus AlgorithmStatus { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.\n        /// </summary>\n        bool CanRunLocally { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate which languages this algorithm is written in.\n        /// </summary>\n        List<Language> Languages { get; }\n\n        /// <summary>\n        /// Data Points count of all timeslices of algorithm\n        /// </summary>\n        long DataPoints { get; }\n\n        /// <summary>\n        /// Data Points count of the algorithm history\n        /// </summary>\n        int AlgorithmHistoryDataPoints { get; }\n\n        /// <summary>\n        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm\n        /// </summary>\n        Dictionary<string, string> ExpectedStatistics { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IRegressionResearchDefinition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines interface for research notebooks to be run as part of the research test suite.\n    /// </summary>\n    public interface IRegressionResearchDefinition\n    {\n        #pragma warning disable CS1574\n        /// <summary>\n        /// This is used by the research regression test system to validate the output\n        /// </summary>\n        /// <remarks>Requires to be implemented last in the file <see cref=\"ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile\"/>\n        /// get should start from next line</remarks>\n        #pragma warning restore CS1574\n        string ExpectedOutput { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISecurityInitializerProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Reduced interface which provides an instance which implements <see cref=\"ISecurityInitializer\"/>\n    /// </summary>\n    public interface ISecurityInitializerProvider\n    {\n        /// <summary>\n        /// Gets an instance that is to be used to initialize newly created securities.\n        /// </summary>\n        ISecurityInitializer SecurityInitializer\n        {\n            get;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISecurityPrice.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Reduced interface which allows setting and accessing\n    /// price properties for a <see cref=\"Security\"/>\n    /// </summary>\n    public interface ISecurityPrice\n    {\n        /// <summary>\n        /// Get the current value of the security.\n        /// </summary>\n        decimal Price { get; }\n\n        /// <summary>\n        /// If this uses trade bar data, return the most recent close.\n        /// </summary>\n        decimal Close { get; }\n\n        /// <summary>\n        /// Access to the volume of the equity today\n        /// </summary>\n        decimal Volume { get; }\n\n        /// <summary>\n        /// Gets the most recent bid price if available\n        /// </summary>\n        decimal BidPrice { get; }\n\n        /// <summary>\n        /// Gets the most recent bid size if available\n        /// </summary>\n        decimal BidSize { get; }\n\n        /// <summary>\n        /// Gets the most recent ask price if available\n        /// </summary>\n        decimal AskPrice { get; }\n\n        /// <summary>\n        /// Gets the most recent ask size if available\n        /// </summary>\n        decimal AskSize { get; }\n\n        /// <summary>\n        /// Access to the open interest of the security today\n        /// </summary>\n        long OpenInterest { get; }\n\n        /// <summary>\n        /// <see cref=\"Symbol\"/> for the asset.\n        /// </summary>\n        Symbol Symbol { get; }\n\n        /// <summary>\n        /// <see cref=\"SymbolProperties\"/> of the symbol\n        /// </summary>\n        SymbolProperties SymbolProperties { get; }\n\n        /// <summary>\n        /// Update any security properties based on the latest market data and time\n        /// </summary>\n        /// <param name=\"data\">New data packet from LEAN</param>\n        void SetMarketPrice(BaseData data);\n\n        /// <summary>\n        /// Updates all of the security properties, such as price/OHLCV/bid/ask based\n        /// on the data provided. Data is also stored into the security's data cache\n        /// </summary>\n        /// <param name=\"data\">The security update data</param>\n        /// <param name=\"dataType\">The data type</param>\n        /// <param name=\"containsFillForwardData\">Flag indicating whether\n        /// <param name=\"isInternalConfig\">True if this update data corresponds to an internal subscription\n        /// such as currency or security benchmark</param>\n        /// <paramref name=\"data\"/> contains any fill forward bar or not</param>\n        void Update(IReadOnlyList<BaseData> data, Type dataType, bool? containsFillForwardData, bool isInternalConfig);\n\n        /// <summary>\n        /// Get the last price update set to the security.\n        /// </summary>\n        /// <returns>BaseData object for this security</returns>\n        BaseData GetLastData();\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISecurityService.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// This interface exposes methods for creating a new <see cref=\"Security\" />\n    /// </summary>\n    public interface ISecurityService\n    {\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        Security CreateSecurity(Symbol symbol,\n            List<SubscriptionDataConfig> subscriptionDataConfigList,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null,\n            bool seedSecurity = true);\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        Security CreateSecurity(Symbol symbol,\n            SubscriptionDataConfig subscriptionDataConfig,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null,\n            bool seedSecurity = true);\n\n        /// <summary>\n        /// Creates a new benchmark security\n        /// </summary>\n        Security CreateBenchmarkSecurity(Symbol symbol);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IShortableProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines a short list/easy-to-borrow provider\n    /// </summary>\n    [StubsAvoidImplicits]\n    public interface IShortableProvider\n    {\n        /// <summary>\n        /// Gets interest rate charged on borrowed shares for a given asset.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup fee rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>Fee rate. Zero if the data for the brokerage/date does not exist.</returns>\n        decimal FeeRate(Symbol symbol, DateTime localTime);\n\n        /// <summary>\n        /// Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset.\n        /// Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup rebate rate</param>\n        /// <param name=\"localTime\">Time of the algorithm</param>\n        /// <returns>Rebate fee. Zero if the data for the brokerage/date does not exist.</returns>\n        decimal RebateRate(Symbol symbol, DateTime localTime);\n\n        /// <summary>\n        /// Gets the quantity shortable for a <see cref=\"Symbol\"/>.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to check shortable quantity</param>\n        /// <param name=\"localTime\">Local time of the algorithm</param>\n        /// <returns>The quantity shortable for the given Symbol as a positive number. Null if the Symbol is shortable without restrictions.</returns>\n        long? ShortableQuantity(Symbol symbol, DateTime localTime);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISignalExportTarget.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Interface to send positions holdings to different 3rd party API's\n    /// </summary>\n    public interface ISignalExportTarget: IDisposable\n    {\n        /// <summary>\n        /// Sends user's positions to certain 3rd party API\n        /// </summary>\n        /// <param name=\"parameters\">Holdings the user have defined to be sent to certain 3rd party API and the algorithm being ran</param>\n        bool Send(SignalExportTargetParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/IStreamReader.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Defines a transport mechanism for data from its source into various reader methods\n    /// </summary>\n    public interface IStreamReader : IDisposable\n    {\n        /// <summary>\n        /// Gets the transport medium of this stream reader\n        /// </summary>\n        SubscriptionTransportMedium TransportMedium { get; }\n\n        /// <summary>\n        /// Gets whether or not there's more data to be read in the stream\n        /// </summary>\n        bool EndOfStream { get; }\n\n        /// <summary>\n        /// Gets the next line/batch of content from the stream\n        /// </summary>\n        string ReadLine();\n\n        /// <summary>\n        /// Direct access to the StreamReader instance\n        /// </summary>\n        StreamReader StreamReader { get; }\n\n        /// <summary>\n        /// Gets whether or not this stream reader should be rate limited\n        /// </summary>\n        bool ShouldBeRateLimited { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISubscriptionDataConfigProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Reduced interface which provides access to registered <see cref=\"SubscriptionDataConfig\"/>\n    /// </summary>\n    public interface ISubscriptionDataConfigProvider\n    {\n        /// <summary>\n        /// Gets a list of all registered <see cref=\"SubscriptionDataConfig\"/> for a given <see cref=\"Symbol\"/> if any\n        /// else will return the whole list of subscriptions\n        /// </summary>\n        /// <remarks>Will not return internal subscriptions by default</remarks>\n        List<SubscriptionDataConfig> GetSubscriptionDataConfigs(Symbol symbol = null, bool includeInternalConfigs = false);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ISubscriptionDataConfigService.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// This interface exposes methods for creating a list of <see cref=\"SubscriptionDataConfig\" /> for a given\n    /// configuration\n    /// </summary>\n    public interface ISubscriptionDataConfigService : ISubscriptionDataConfigProvider\n    {\n        /// <summary>\n        /// Creates and adds a list of <see cref=\"SubscriptionDataConfig\" /> for a given symbol and configuration.\n        /// Can optionally pass in desired subscription data type to use.\n        /// If the config already existed will return existing instance instead\n        /// </summary>\n        SubscriptionDataConfig Add(\n            Type dataType,\n            Symbol symbol,\n            Resolution? resolution = null,\n            bool fillForward = true,\n            bool extendedMarketHours = false,\n            bool isFilteredSubscription = true,\n            bool isInternalFeed = false,\n            bool isCustomData = false,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0\n            );\n\n        /// <summary>\n        /// Creates and adds a list of <see cref=\"SubscriptionDataConfig\" /> for a given symbol and configuration.\n        /// Can optionally pass in desired subscription data types to use.\n        /// If the config already existed will return existing instance instead\n        /// </summary>\n        List<SubscriptionDataConfig> Add(\n            Symbol symbol,\n            Resolution? resolution = null,\n            bool fillForward = true,\n            bool extendedMarketHours = false,\n            bool isFilteredSubscription = true,\n            bool isInternalFeed = false,\n            bool isCustomData = false,\n            List<Tuple<Type, TickType>> subscriptionDataTypes = null,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0\n            );\n\n        /// <summary>\n        /// Get the data feed types for a given <see cref=\"SecurityType\" /> <see cref=\"Resolution\" />\n        /// </summary>\n        /// <param name=\"symbolSecurityType\">The <see cref=\"SecurityType\" /> used to determine the types</param>\n        /// <param name=\"resolution\">The resolution of the data requested</param>\n        /// <param name=\"isCanonical\">Indicates whether the security is Canonical (future and options)</param>\n        /// <returns>Types that should be added to the <see cref=\"SubscriptionDataConfig\" /></returns>\n        List<Tuple<Type, TickType>> LookupSubscriptionConfigDataTypes(\n            SecurityType symbolSecurityType,\n            Resolution resolution,\n            bool isCanonical\n            );\n\n        /// <summary>\n        /// Gets the available data types\n        /// </summary>\n        Dictionary<SecurityType, List<TickType>> AvailableDataTypes { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ITimeInForceHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Handles the time in force for an order\n    /// </summary>\n    public interface ITimeInForceHandler\n    {\n        /// <summary>\n        /// Checks if an order is expired\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <returns>Returns true if the order has expired, false otherwise</returns>\n        bool IsOrderExpired(Security security, Order order);\n\n        /// <summary>\n        /// Checks if an order fill is valid\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <param name=\"fill\">The order fill to be checked</param>\n        /// <returns>Returns true if the order fill can be emitted, false otherwise</returns>\n        bool IsFillValid(Security security, Order order, OrderEvent fill);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ITimeKeeper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Interface implemented by <see cref=\"TimeKeeper\"/>\n    /// </summary>\n    public interface ITimeKeeper\n    {\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        DateTime UtcTime { get; }\n\n        /// <summary>\n        /// Adds the specified time zone to this time keeper\n        /// </summary>\n        /// <param name=\"timeZone\"></param>\n        void AddTimeZone(DateTimeZone timeZone);\n\n        /// <summary>\n        /// Gets the <see cref=\"LocalTimeKeeper\"/> instance for the specified time zone\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone whose <see cref=\"LocalTimeKeeper\"/> we seek</param>\n        /// <returns>The <see cref=\"LocalTimeKeeper\"/> instance for the specified time zone</returns>\n        LocalTimeKeeper GetLocalTimeKeeper(DateTimeZone timeZone);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ITradeBuilder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Generates trades from executions and market price updates\n    /// </summary>\n    public interface ITradeBuilder\n    {\n        /// <summary>\n        /// Sets the security manager instance\n        /// </summary>\n        /// <param name=\"securities\">The security manager</param>\n        void SetSecurityManager(SecurityManager securities);\n\n        /// <summary>\n        /// Sets the live mode flag\n        /// </summary>\n        /// <param name=\"live\">The live mode flag</param>\n        void SetLiveMode(bool live);\n\n        /// <summary>\n        /// The list of closed trades\n        /// </summary>\n        List<Trade> ClosedTrades { get; }\n\n        /// <summary>\n        /// Returns true if there is an open position for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>true if there is an open position for the symbol</returns>\n        bool HasOpenPosition(Symbol symbol);\n\n        /// <summary>\n        /// Sets the current market price for the symbol\n        /// </summary>\n        /// <param name=\"symbol\"></param>\n        /// <param name=\"price\"></param>\n        void SetMarketPrice(Symbol symbol, decimal price);\n\n        /// <summary>\n        /// Applies a split to the trade builder\n        /// </summary>\n        /// <param name=\"split\">The split to be applied</param>\n        /// <param name=\"liveMode\">True if live mode, false for backtest</param>\n        /// <param name=\"dataNormalizationMode\">The <see cref=\"DataNormalizationMode\"/> for this security</param>\n        void ApplySplit(Split split, bool liveMode, DataNormalizationMode dataNormalizationMode);\n\n        /// <summary>\n        /// Processes a new fill, eventually creating new trades\n        /// </summary>\n        /// <param name=\"fill\">The new fill order event</param>\n        /// <param name=\"securityConversionRate\">The current security market conversion rate into the account currency</param>\n        /// <param name=\"feeInAccountCurrency\">The current order fee in the account currency</param>\n        /// <param name=\"multiplier\">The contract multiplier</param>\n        void ProcessFill(OrderEvent fill,\n            decimal securityConversionRate,\n            decimal feeInAccountCurrency,\n            decimal multiplier = 1.0m);\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/MessagingHandlerInitializeParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Parameters required to initialize a <see cref=\"IMessagingHandler\"/> instance\n    /// </summary>\n    public class MessagingHandlerInitializeParameters\n    {\n        /// <summary>\n        /// The api instance to use\n        /// </summary>\n        public IApi Api { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"api\">The api instance to use</param>\n        public MessagingHandlerInitializeParameters(IApi api)\n        {\n            Api = api;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Interfaces/ObjectStoreErrorRaisedEventArgs.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Interfaces\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"IObjectStore.ErrorRaised\"/> event\n    /// </summary>\n    public class ObjectStoreErrorRaisedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the <see cref=\"Exception\"/> that was raised\n        /// </summary>\n        public Exception Error { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ObjectStoreErrorRaisedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"error\">The error that was raised</param>\n        public ObjectStoreErrorRaisedEventArgs(Exception error)\n        {\n            Error = error;\n        }\n    }\n}"
  },
  {
    "path": "Common/Isolator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Isolator class - create a new instance of the algorithm and ensure it doesn't\n    /// exceed memory or time execution limits.\n    /// </summary>\n    public class Isolator\n    {\n        /// <summary>\n        /// Algo cancellation controls - cancel source.\n        /// </summary>\n        public CancellationTokenSource CancellationTokenSource\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Isolator\"/> class\n        /// </summary>\n        public Isolator()\n        {\n            CancellationTokenSource = new CancellationTokenSource();\n        }\n\n        /// <summary>\n        /// Execute a code block with a maximum limit on time and memory.\n        /// </summary>\n        /// <param name=\"timeSpan\">Timeout in timespan</param>\n        /// <param name=\"withinCustomLimits\">Function used to determine if the codeBlock is within custom limits, such as with algorithm manager\n        /// timing individual time loops, return a non-null and non-empty string with a message indicating the error/reason for stoppage</param>\n        /// <param name=\"codeBlock\">Action codeblock to execute</param>\n        /// <param name=\"memoryCap\">Maximum memory allocation, default 1024Mb</param>\n        /// <param name=\"sleepIntervalMillis\">Sleep interval between each check in ms</param>\n        /// <param name=\"workerThread\">The worker thread instance that will execute the provided action, if null\n        /// will use a <see cref=\"Task\"/></param>\n        /// <returns>True if algorithm exited successfully, false if cancelled because it exceeded limits.</returns>\n        public bool ExecuteWithTimeLimit(TimeSpan timeSpan, Func<IsolatorLimitResult> withinCustomLimits, Action codeBlock, long memoryCap = 1024, int sleepIntervalMillis = 1000, WorkerThread workerThread = null)\n        {\n            workerThread?.Add(codeBlock);\n\n            var task = workerThread == null\n                //Launch task\n                ? Task.Factory.StartNew(codeBlock, CancellationTokenSource.Token)\n                // wrapper task so we can reuse MonitorTask\n                : Task.Factory.StartNew(() => workerThread.FinishedWorkItem.WaitOne(), CancellationTokenSource.Token);\n            try\n            {\n                return MonitorTask(task, timeSpan, withinCustomLimits, memoryCap, sleepIntervalMillis);\n            }\n            catch (Exception)\n            {\n                if (!task.IsCompleted)\n                {\n                    // lets free the wrapper task even if the worker thread didn't finish\n                    workerThread?.FinishedWorkItem.Set();\n                }\n                throw;\n            }\n        }\n\n        private bool MonitorTask(Task task,\n            TimeSpan timeSpan,\n            Func<IsolatorLimitResult> withinCustomLimits,\n            long memoryCap = 1024,\n            int sleepIntervalMillis = 1000)\n        {\n            // default to always within custom limits\n            withinCustomLimits = withinCustomLimits ?? (() => new IsolatorLimitResult(TimeSpan.Zero, string.Empty));\n\n            var message = string.Empty;\n            var emaPeriod = 60d;\n            var memoryUsed = 0L;\n            var utcNow = DateTime.UtcNow;\n            var end = utcNow + timeSpan;\n            var memoryLogger = utcNow + Time.OneMinute;\n            var isolatorLimitResult = new IsolatorLimitResult(TimeSpan.Zero, string.Empty);\n\n            //Convert to bytes\n            memoryCap *= 1024 * 1024;\n            var spikeLimit = memoryCap*2;\n\n            if (memoryCap <= 0)\n            {\n                memoryCap = long.MaxValue;\n                spikeLimit = long.MaxValue;\n            }\n\n            while (!task.IsCompleted && !CancellationTokenSource.IsCancellationRequested && utcNow < end)\n            {\n                // if over 80% allocation force GC then sample\n                var sample = Convert.ToDouble(GC.GetTotalMemory(forceFullCollection: false));\n\n                // find the EMA of the memory used to prevent spikes killing stategy\n                memoryUsed = Convert.ToInt64((emaPeriod-1)/emaPeriod * memoryUsed + (1/emaPeriod)*sample);\n\n                // if the rolling EMA > cap; or the spike is more than 2x the allocation.\n                if (memoryUsed > memoryCap || sample > spikeLimit)\n                {\n                    message = Messages.Isolator.MemoryUsageMaxedOut(PrettyFormatRam(memoryCap), PrettyFormatRam((long)sample));\n                    break;\n                }\n\n                if (utcNow > memoryLogger)\n                {\n                    if (memoryUsed > memoryCap * 0.8)\n                    {\n                        Log.Error(Messages.Isolator.MemoryUsageOver80Percent(sample));\n                    }\n\n                    Log.Trace(\"Isolator.ExecuteWithTimeLimit(): \" +\n                        Messages.Isolator.MemoryUsageInfo(\n                            PrettyFormatRam(memoryUsed),\n                            PrettyFormatRam((long)sample),\n                            PrettyFormatRam(OS.ApplicationMemoryUsed * 1024 * 1024),\n                            isolatorLimitResult.CurrentTimeStepElapsed,\n                            (int)Math.Ceiling(OS.CpuUsage)));\n\n                    memoryLogger = utcNow.AddMinutes(1);\n                }\n\n                // check to see if we're within other custom limits defined by the caller\n                isolatorLimitResult = withinCustomLimits();\n                if (!isolatorLimitResult.IsWithinCustomLimits)\n                {\n                    message = isolatorLimitResult.ErrorMessage;\n                    break;\n                }\n\n                if (task.Wait(utcNow.GetSecondUnevenWait(sleepIntervalMillis)))\n                {\n                    break;\n                }\n\n                utcNow = DateTime.UtcNow;\n            }\n\n            if (task.IsCompleted == false)\n            {\n                if (CancellationTokenSource.IsCancellationRequested)\n                {\n                    Log.Trace($\"Isolator.ExecuteWithTimeLimit(): Operation was canceled\");\n                    throw new OperationCanceledException(\"Operation was canceled\");\n                }\n                else if (string.IsNullOrEmpty(message))\n                {\n                    message = Messages.Isolator.MemoryUsageMonitorTaskTimedOut(timeSpan);\n                    Log.Trace($\"Isolator.ExecuteWithTimeLimit(): {message}\");\n                }\n            }\n\n            if (!string.IsNullOrEmpty(message))\n            {\n                if (!CancellationTokenSource.IsCancellationRequested)\n                {\n                    CancellationTokenSource.Cancel();\n                }\n                Log.Error($\"Security.ExecuteWithTimeLimit(): {message}\");\n                throw new TimeoutException(message);\n            }\n            return task.IsCompleted;\n        }\n\n        /// <summary>\n        /// Execute a code block with a maximum limit on time and memory.\n        /// </summary>\n        /// <param name=\"timeSpan\">Timeout in timespan</param>\n        /// <param name=\"codeBlock\">Action codeblock to execute</param>\n        /// <param name=\"memoryCap\">Maximum memory allocation, default 1024Mb</param>\n        /// <param name=\"sleepIntervalMillis\">Sleep interval between each check in ms</param>\n        /// <param name=\"workerThread\">The worker thread instance that will execute the provided action, if null\n        /// will use a <see cref=\"Task\"/></param>\n        /// <returns>True if algorithm exited successfully, false if cancelled because it exceeded limits.</returns>\n        public bool ExecuteWithTimeLimit(TimeSpan timeSpan, Action codeBlock, long memoryCap, int sleepIntervalMillis = 1000, WorkerThread workerThread = null)\n        {\n            return ExecuteWithTimeLimit(timeSpan, null, codeBlock, memoryCap, sleepIntervalMillis, workerThread);\n        }\n\n        /// <summary>\n        /// Convert the bytes to a MB in double format for string display\n        /// </summary>\n        /// <param name=\"ramInBytes\"></param>\n        /// <returns></returns>\n        private static string PrettyFormatRam(long ramInBytes)\n        {\n            return Math.Round(Convert.ToDouble(ramInBytes/(1024*1024))).ToStringInvariant();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/IsolatorLimitResult.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Represents the result of the <see cref=\"Isolator\"/> limiter callback\n    /// </summary>\n    public class IsolatorLimitResult\n    {\n        /// <summary>\n        /// Gets the amount of time spent on the current time step\n        /// </summary>\n        public TimeSpan CurrentTimeStepElapsed { get; }\n\n        /// <summary>\n        /// Gets the error message or an empty string if no error on the current time step\n        /// </summary>\n        public string ErrorMessage { get; }\n\n        /// <summary>\n        /// Returns true if there are no errors in the current time step\n        /// </summary>\n        public bool IsWithinCustomLimits => string.IsNullOrEmpty(ErrorMessage);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IsolatorLimitResult\"/> class\n        /// </summary>\n        /// <param name=\"currentTimeStepElapsed\">The amount of time spent on the current time step</param>\n        /// <param name=\"errorMessage\">The error message or an empty string if no error on the current time step</param>\n        public IsolatorLimitResult(TimeSpan currentTimeStepElapsed, string errorMessage)\n        {\n            ErrorMessage = errorMessage;\n            CurrentTimeStepElapsed = currentTimeStepElapsed;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/IsolatorLimitResultProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides access to the <see cref=\"NullIsolatorLimitResultProvider\"/> and extension methods supporting <see cref=\"ScheduledEvent\"/>\n    /// </summary>\n    public static class IsolatorLimitResultProvider\n    {\n        /// <summary>\n        /// Provides access to a null implementation of <see cref=\"IIsolatorLimitResultProvider\"/>\n        /// </summary>\n        public static readonly IIsolatorLimitResultProvider Null = new NullIsolatorLimitResultProvider();\n\n        /// <summary>\n        /// Convenience method for invoking a scheduled event's Scan method inside the <see cref=\"IsolatorLimitResultProvider\"/>\n        /// </summary>\n        public static void Consume(\n            this IIsolatorLimitResultProvider isolatorLimitProvider,\n            ScheduledEvent scheduledEvent,\n            DateTime scanTimeUtc,\n            TimeMonitor timeMonitor\n            )\n        {\n            // perform initial filtering to prevent starting a task when not necessary\n            if (scheduledEvent.NextEventUtcTime > scanTimeUtc)\n            {\n                return;\n            }\n\n            var timeProvider = RealTimeProvider.Instance;\n            isolatorLimitProvider.Consume(timeProvider, () => scheduledEvent.Scan(scanTimeUtc), timeMonitor);\n        }\n\n        /// <summary>\n        /// Executes the provided code block and while the code block is running, continually consume from\n        /// the limit result provided one token each minute. This function allows the code to run for the\n        /// first full minute without requesting additional time from the provider. Following that, every\n        /// minute an additional one minute will be requested from the provider.\n        /// </summary>\n        /// <remarks>\n        /// This method exists to support scheduled events, and as such, intercepts any errors raised via the\n        /// provided code and wraps them in a <see cref=\"ScheduledEventException\"/>. If in the future this is\n        /// usable elsewhere, consider refactoring to handle the errors in a different fashion.\n        /// </remarks>\n        public static void Consume(\n            this IIsolatorLimitResultProvider isolatorLimitProvider,\n            ITimeProvider timeProvider,\n            Action code,\n            TimeMonitor timeMonitor\n            )\n        {\n            var consumer = new TimeConsumer\n            {\n                IsolatorLimitProvider = isolatorLimitProvider,\n                TimeProvider = timeProvider\n            };\n            timeMonitor.Add(consumer);\n            code();\n            consumer.Finished = true;\n        }\n\n\n        private sealed class NullIsolatorLimitResultProvider : IIsolatorLimitResultProvider\n        {\n            private static readonly IsolatorLimitResult OK = new IsolatorLimitResult(TimeSpan.Zero, string.Empty);\n\n            public void RequestAdditionalTime(int minutes) { }\n            public IsolatorLimitResult IsWithinLimit() { return OK; }\n            public bool TryRequestAdditionalTime(int minutes) { return true; }\n        }\n    }\n}"
  },
  {
    "path": "Common/LocalTimeKeeper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Represents the current local time. This object is created via the <see cref=\"TimeKeeper\"/> to\n    /// manage conversions to local time.\n    /// </summary>\n    public class LocalTimeKeeper\n    {\n        /// <summary>\n        /// Event fired each time <see cref=\"UpdateTime\"/> is called\n        /// </summary>\n        public event EventHandler<TimeUpdatedEventArgs> TimeUpdated;\n\n        /// <summary>\n        /// Gets the time zone of this <see cref=\"LocalTimeKeeper\"/>\n        /// </summary>\n        public DateTimeZone TimeZone { get; }\n\n        /// <summary>\n        /// Gets the current time in terms of the <see cref=\"TimeZone\"/>\n        /// </summary>\n        public DateTime LocalTime { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalTimeKeeper\"/> class\n        /// </summary>\n        /// <param name=\"utcDateTime\">The current time in UTC</param>\n        /// <param name=\"timeZone\">The time zone</param>\n        internal LocalTimeKeeper(DateTime utcDateTime, DateTimeZone timeZone)\n        {\n            TimeZone = timeZone;\n            LocalTime = utcDateTime.ConvertTo(DateTimeZone.Utc, TimeZone);\n        }\n\n        /// <summary>\n        /// Updates the current time of this time keeper\n        /// </summary>\n        /// <param name=\"utcDateTime\">The current time in UTC</param>\n        internal void UpdateTime(DateTime utcDateTime)\n        {\n            LocalTime = utcDateTime.ConvertTo(DateTimeZone.Utc, TimeZone);\n            TimeUpdated?.Invoke(this, new TimeUpdatedEventArgs(LocalTime, TimeZone));\n        }\n    }\n}"
  },
  {
    "path": "Common/Market.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Markets Collection: Soon to be expanded to a collection of items specifying the market hour, timezones and country codes.\n    /// </summary>\n    public static class Market\n    {\n        // the upper bound (non-inclusive) for market identifiers\n        private const int MaxMarketIdentifier = 1000;\n\n        private static Dictionary<string, int> Markets = new Dictionary<string, int>();\n        private static Dictionary<int, string> ReverseMarkets = new Dictionary<int, string>();\n        private static readonly IEnumerable<Tuple<string, int>> HardcodedMarkets = new List<Tuple<string, int>>\n        {\n            Tuple.Create(\"empty\", 0),\n            Tuple.Create(USA, 1),\n            Tuple.Create(FXCM, 2),\n            Tuple.Create(Oanda, 3),\n            Tuple.Create(Dukascopy, 4),\n            Tuple.Create(Bitfinex, 5),\n\n            Tuple.Create(Globex, 6),\n            Tuple.Create(NYMEX, 7),\n            Tuple.Create(CBOT, 8),\n            Tuple.Create(ICE, 9),\n            Tuple.Create(CBOE, 10),\n            Tuple.Create(India, 11),\n\n            Tuple.Create(GDAX, 12),\n            Tuple.Create(Kraken, 13),\n            Tuple.Create(Bittrex, 14),\n            Tuple.Create(Bithumb, 15),\n            Tuple.Create(Binance, 16),\n            Tuple.Create(Poloniex, 17),\n            Tuple.Create(Coinone, 18),\n            Tuple.Create(HitBTC, 19),\n            Tuple.Create(OkCoin, 20),\n            Tuple.Create(Bitstamp, 21),\n\n            Tuple.Create(COMEX, 22),\n            Tuple.Create(CME, 23),\n            Tuple.Create(SGX, 24),\n            Tuple.Create(HKFE, 25),\n            Tuple.Create(NYSELIFFE, 26),\n\n            Tuple.Create(CFE, 33),\n            Tuple.Create(FTX, 34),\n            Tuple.Create(FTXUS, 35),\n            Tuple.Create(BinanceUS, 36),\n            Tuple.Create(Bybit, 37),\n            Tuple.Create(Coinbase, 38),\n            Tuple.Create(InteractiveBrokers, 39),\n            Tuple.Create(EUREX, 40),\n            Tuple.Create(OSE, 41),\n            Tuple.Create(DYDX, 42)\n        };\n\n        static Market()\n        {\n            // initialize our maps\n            foreach (var market in HardcodedMarkets)\n            {\n                Markets[market.Item1] = market.Item2;\n                ReverseMarkets[market.Item2] = market.Item1;\n            }\n        }\n\n        /// <summary>\n        /// USA Market\n        /// </summary>\n        public const string USA = \"usa\";\n\n        /// <summary>\n        /// Oanda Market\n        /// </summary>\n        public const string Oanda = \"oanda\";\n\n        /// <summary>\n        /// FXCM Market Hours\n        /// </summary>\n        public const string FXCM = \"fxcm\";\n\n        /// <summary>\n        /// Dukascopy Market\n        /// </summary>\n        public const string Dukascopy = \"dukascopy\";\n\n        /// <summary>\n        /// Bitfinex market\n        /// </summary>\n        public const string Bitfinex = \"bitfinex\";\n\n        // Futures exchanges\n\n        /// <summary>\n        /// CME Globex\n        /// </summary>\n        public const string Globex = \"cmeglobex\";\n\n        /// <summary>\n        /// NYMEX\n        /// </summary>\n        public const string NYMEX = \"nymex\";\n\n        /// <summary>\n        /// CBOT\n        /// </summary>\n        public const string CBOT = \"cbot\";\n\n        /// <summary>\n        /// ICE\n        /// </summary>\n        public const string ICE = \"ice\";\n\n        /// <summary>\n        /// CBOE\n        /// </summary>\n        public const string CBOE = \"cboe\";\n\n        /// <summary>\n        /// CFE\n        /// </summary>\n        public const string CFE = \"cfe\";\n\n        /// <summary>\n        /// NSE - National Stock Exchange\n        /// </summary>\n        public const string India = \"india\";\n\n        /// <summary>\n        /// Comex\n        /// </summary>\n        public const string COMEX = \"comex\";\n\n        /// <summary>\n        /// CME\n        /// </summary>\n        public const string CME = \"cme\";\n\n        /// <summary>\n        /// EUREX\n        /// </summary>\n        public const string EUREX = \"eurex\";\n\n        /// <summary>\n        /// Singapore Exchange\n        /// </summary>\n        public const string SGX = \"sgx\";\n\n        /// <summary>\n        /// Hong Kong Exchange\n        /// </summary>\n        public const string HKFE = \"hkfe\";\n\n        /// <summary>\n        /// Osaka Stock Exchange\n        /// </summary>\n        public const string OSE = \"ose\";\n\n        /// <summary>\n        /// London International Financial Futures and Options Exchange\n        /// </summary>\n        public const string NYSELIFFE = \"nyseliffe\";\n\n        /// <summary>\n        /// GDAX\n        /// </summary>\n        [Obsolete(\"The GDAX constant is deprecated. Please use Coinbase instead.\")]\n        public const string GDAX = Coinbase;\n\n        /// <summary>\n        /// Kraken\n        /// </summary>\n        public const string Kraken = \"kraken\";\n\n        /// <summary>\n        /// Bitstamp\n        /// </summary>\n        public const string Bitstamp = \"bitstamp\";\n\n        /// <summary>\n        /// OkCoin\n        /// </summary>\n        public const string OkCoin = \"okcoin\";\n\n        /// <summary>\n        /// Bithumb\n        /// </summary>\n        public const string Bithumb = \"bithumb\";\n\n        /// <summary>\n        /// Binance\n        /// </summary>\n        public const string Binance = \"binance\";\n\n        /// <summary>\n        /// Poloniex\n        /// </summary>\n        public const string Poloniex = \"poloniex\";\n\n        /// <summary>\n        /// Coinone\n        /// </summary>\n        public const string Coinone = \"coinone\";\n\n        /// <summary>\n        /// HitBTC\n        /// </summary>\n        public const string HitBTC = \"hitbtc\";\n\n        /// <summary>\n        /// Bittrex\n        /// </summary>\n        public const string Bittrex = \"bittrex\";\n\n        /// <summary>\n        /// FTX\n        /// </summary>\n        public const string FTX = \"ftx\";\n\n        /// <summary>\n        /// FTX.US\n        /// </summary>\n        public const string FTXUS = \"ftxus\";\n\n        /// <summary>\n        /// Binance.US\n        /// </summary>\n        public const string BinanceUS = \"binanceus\";\n\n        /// <summary>\n        /// Bybit\n        /// </summary>\n        public const string Bybit = \"bybit\";\n\n        /// <summary>\n        /// Coinbase\n        /// </summary>\n        public const string Coinbase = \"coinbase\";\n\n        /// <summary>\n        /// InteractiveBrokers market\n        /// </summary>\n        public const string InteractiveBrokers = \"interactivebrokers\";\n\n        /// <summary>\n        /// dYdX market\n        /// </summary>\n        public const string DYDX = \"dydx\";\n\n        /// <summary>\n        /// Adds the specified market to the map of available markets with the specified identifier.\n        /// </summary>\n        /// <param name=\"market\">The market string to add</param>\n        /// <param name=\"identifier\">The identifier for the market, this value must be positive and less than 1000</param>\n        public static void Add(string market, int identifier)\n        {\n            if (identifier >= MaxMarketIdentifier)\n            {\n                throw new ArgumentOutOfRangeException(nameof(identifier), Messages.Market.InvalidMarketIdentifier(MaxMarketIdentifier));\n            }\n\n            market = market.ToLowerInvariant();\n\n            int marketIdentifier;\n            if (Markets.TryGetValue(market, out marketIdentifier) && identifier != marketIdentifier)\n            {\n                throw new ArgumentException(Messages.Market.TriedToAddExistingMarketWithDifferentIdentifier(market));\n            }\n\n            string existingMarket;\n            if (ReverseMarkets.TryGetValue(identifier, out existingMarket))\n            {\n                throw new ArgumentException(Messages.Market.TriedToAddExistingMarketIdentifier(market, existingMarket));\n            }\n\n            // update our maps.\n            // We make a copy and update the copy, later swap the references so it's thread safe with no lock\n            var newMarketDictionary = Markets.ToDictionary(entry => entry.Key,\n                entry => entry.Value);\n            newMarketDictionary[market] = identifier;\n\n            var newReverseMarketDictionary = ReverseMarkets.ToDictionary(entry => entry.Key,\n                entry => entry.Value);\n            newReverseMarketDictionary[identifier] = market;\n\n            Markets = newMarketDictionary;\n            ReverseMarkets = newReverseMarketDictionary;\n        }\n\n        /// <summary>\n        /// Gets the market code for the specified market. Returns <c>null</c> if the market is not found\n        /// </summary>\n        /// <param name=\"market\">The market to check for (case sensitive)</param>\n        /// <returns>The internal code used for the market. Corresponds to the value used when calling <see cref=\"Add\"/></returns>\n        public static int? Encode(string market)\n        {\n            return !Markets.TryGetValue(market, out var code) ? null : code;\n        }\n\n        /// <summary>\n        /// Gets the market string for the specified market code.\n        /// </summary>\n        /// <param name=\"code\">The market code to be decoded</param>\n        /// <returns>The string representation of the market, or null if not found</returns>\n        public static string Decode(int code)\n        {\n            return !ReverseMarkets.TryGetValue(code, out var market) ? null : market;\n        }\n\n        /// <summary>\n        /// Returns a list of the supported markets\n        /// </summary>\n        public static List<string> SupportedMarkets()\n        {\n            return Markets.Keys.ToList();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Algorithm.Framework.Alphas.Analysis.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Algorithm.Framework.Alphas.Analysis\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Algorithm.Framework.Alphas.Analysis.InsightManager\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InsightManager\n        {\n            /// <summary>\n            /// String message saying extraAnalysisPeriodRatio must be greater than or equal to zero\n            /// </summary>\n            public static string InvalidExtraAnalysisPeriodRatio = \"extraAnalysisPeriodRatio must be greater than or equal to zero.\";\n\n            /// <summary>\n            /// Returns a string message warning the user of an insight with zero initial price\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ZeroInitialPriceValue(DateTime frontierTimeUtc, Algorithm.Framework.Alphas.Insight insight)\n            {\n                return Invariant($\"InsightManager.Step(): Warning {frontierTimeUtc} UTC: insight {insight} initial price value is 0\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"ReadOnlySecurityValuesCollection\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ReadOnlySecurityValuesCollection\n        {\n            /// <summary>\n            /// Returns a string message saying no SecurityValues were found for the given symbol\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SecurityValuesForSymbolNotFound(QuantConnect.Symbol symbol)\n            {\n                return Invariant($\"SecurityValues for symbol {symbol} was not found\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Algorithm.Framework.Alphas.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Algorithm.Framework.Alphas\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Algorithm.Framework.Alphas.Insight\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Insight\n        {\n            /// <summary>\n            /// Returns a string message saying: Insight barCount must be grater than zero\n            /// </summary>\n            public static string InvalidBarCount = \"Insight barCount must be greater than zero.\";\n\n            /// <summary>\n            /// Returns a string message saying: Insight period must be greater than or equal to 1 second\n            /// </summary>\n            public static string InvalidPeriod = \"Insight period must be greater than or equal to 1 second.\";\n\n            /// <summary>\n            /// Returns a string message saying: Insight closeTimeUtc must be greater than generatedTimeUtc\n            /// </summary>\n            public static string InvalidCloseTimeUtc = \"Insight closeTimeUtc must be greater than generatedTimeUtc.\";\n\n            /// <summary>\n            /// Returns a string message saying: Insight closeTimeLocal must not be in the past\n            /// </summary>\n            public static string InvalidCloseTimeLocal = \"Insight closeTimeLocal must not be in the past.\";\n\n            /// <summary>\n            /// Returns a string message saying the Insight's GeneratedTimeUtc property must be set before calling SetPeriodAndCloseTime\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string GeneratedTimeUtcNotSet(Algorithm.Framework.Alphas.Insight insight)\n            {\n                return Invariant($@\"The insight's '{nameof(insight.GeneratedTimeUtc)}' property must be set before calling {\n                    nameof(insight.SetPeriodAndCloseTime)}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to set group id on the given insight because it has already\n            /// been assigned to a group\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InsightAlreadyAssignedToAGroup(Algorithm.Framework.Alphas.Insight insight)\n            {\n                return Invariant($\"Unable to set group id on insight {insight} because it has already been assigned to a group.\");\n            }\n\n            /// <summary>\n            /// Parses the given insight into a string containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Algorithm.Framework.Alphas.Insight insight)\n            {\n                var str = Invariant($\"{insight.Id:N}: {insight.Symbol} {insight.Type} {insight.Direction} within {insight.Period}\");\n\n                if (insight.Magnitude.HasValue)\n                {\n                    str += Invariant($\" by {insight.Magnitude.Value}%\");\n                }\n                if (insight.Confidence.HasValue)\n                {\n                    str += Invariant($\" with {Math.Round(100 * insight.Confidence.Value, 1)}% confidence\");\n                }\n                if (insight.Weight.HasValue)\n                {\n                    str += Invariant($\" and {Math.Round(100 * insight.Weight.Value, 1)}% weight\");\n                }\n\n                if (!string.IsNullOrEmpty(insight.Tag))\n                {\n                    str += Invariant($\": {insight.Tag}\");\n                }\n\n                return str;\n            }\n\n            /// <summary>\n            /// Parses a short insight into a string containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ShortToString(Algorithm.Framework.Alphas.Insight insight)\n            {\n                var str = Invariant($\"{insight.Symbol.Value} {insight.Type} {insight.Direction} {insight.Period}\");\n\n                if (insight.Magnitude.HasValue)\n                {\n                    str += Invariant($\" M:{insight.Magnitude.Value}%\");\n                }\n                if (insight.Confidence.HasValue)\n                {\n                    str += Invariant($\" C:{Math.Round(100 * insight.Confidence.Value, 1)}%\");\n                }\n                if (insight.Weight.HasValue)\n                {\n                    str += Invariant($\" W:{Math.Round(100 * insight.Weight.Value, 1)}%\");\n                }\n                if (!string.IsNullOrEmpty(insight.Tag))\n                {\n                    str += Invariant($\". {insight.Tag}\");\n                }\n\n                return str;\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Algorithm.Framework.Alphas.InsightScore\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InsightScore\n        {\n            /// <summary>\n            /// Parses an InsightScore object into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Algorithm.Framework.Alphas.InsightScore insightScore)\n            {\n                return Invariant($@\"Direction: {Math.Round(100 * insightScore.Direction, 2)} Magnitude: {\n                    Math.Round(100 * insightScore.Magnitude, 2)}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Algorithm.Framework.Portfolio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Positions;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Algorithm.Framework.Portfolio\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Algorithm.Framework.Portfolio.PortfolioTarget\"/> class and its consumers or related classes\n        /// </summary>\n        public static class PortfolioTarget\n        {\n            /// <summary>\n            /// Returns a string message saying the portfolio target percent is invalid\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidTargetPercent(IAlgorithm algorithm, decimal percent)\n            {\n                return Invariant($@\"The portfolio target percent: {\n                    percent}, does not comply with the current 'Algorithm.Settings' 'MaxAbsolutePortfolioTargetPercentage': {\n                    algorithm.Settings.MaxAbsolutePortfolioTargetPercentage} or 'MinAbsolutePortfolioTargetPercentage': {\n                    algorithm.Settings.MinAbsolutePortfolioTargetPercentage}. Skipping\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given symbol was not found in the portfolio\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SymbolNotFound(QuantConnect.Symbol symbol)\n            {\n                return Invariant($\"{symbol} not found in portfolio. Request this data when initializing the algorithm.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to compute the order quantity of the given symbol. It also\n            /// explains the reason why it was impossible\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToComputeOrderQuantityDueToNullResult(QuantConnect.Symbol symbol, GetMaximumLotsResult result)\n            {\n                return Invariant($\"Unable to compute order quantity of {symbol}. Reason: {result.Reason} Returning null.\");\n            }\n\n            /// <summary>\n            /// Parses the given portfolio target into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Algorithm.Framework.Portfolio.PortfolioTarget portfolioTarget)\n            {\n                var str = Invariant($\"{portfolioTarget.Symbol}: {portfolioTarget.Quantity.Normalize()}\");\n                if (!string.IsNullOrEmpty(portfolioTarget.Tag))\n                {\n                    str += $\" ({portfolioTarget.Tag})\";\n                }\n\n                return str;\n            }\n\n            /// <summary>\n            /// Returns a string message saying the insight direction is invalid for the given symbol\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidInsightDirection(QuantConnect.Symbol symbol, InsightDirection insightDirection)\n            {\n                return Invariant($\"Invalid insight direction {insightDirection} for symbol: {symbol}.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Benchmarks.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Benchmarks\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Benchmarks.FuncBenchmark\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FuncBenchmark\n        {\n            /// <summary>\n            /// String message saying it was impossible to convert the Python function to a benchmark function\n            /// </summary>\n            public static string UnableToConvertPythonFunctionToBenchmarkFunction =\n                \"Unable to convert Python function to benchmark function, please ensure the function supports Datetime input and decimal output\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Brokerages.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders;\n\nusing static QuantConnect.StringExtensions;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.TimeInForces;\nusing System.Globalization;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Brokerages\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.DefaultBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DefaultBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: MarketOnOpen orders are not supported for futures and future options\n            /// </summary>\n            public static string UnsupportedMarketOnOpenOrdersForFuturesAndFutureOptions =\n                \"MarketOnOpen orders are not supported for futures and future options.\";\n\n            /// <summary>\n            /// String message saying: There is no data for this symbol yet\n            /// </summary>\n            public static string NoDataForSymbol =\n                \"There is no data for this symbol yet, please check the security.HasData flag to ensure there is at least one data point.\";\n\n            /// <summary>\n            /// String message saying: Brokerage does not support update. You must cancel and re-create instead\n            /// </summary>\n            public static string OrderUpdateNotSupported = \"Brokerage does not support update. You must cancel and re-create instead.\";\n\n            /// <summary>\n            /// Retunrns a string message saying the type of the given security is not supported by the given brokerage\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedSecurityType(IBrokerageModel brokerageModel, Securities.Security security)\n            {\n                return Invariant($\"The {brokerageModel.GetType().Name} does not support {security.Type} security type.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given brokerage does not support updating the quantity of Cross Zero orders\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedCrossZeroOrderUpdate(IBrokerageModel brokerageModel)\n            {\n                return Invariant($\"Unfortunately, the {brokerageModel.GetType().Name} brokerage model does not support updating the quantity of Cross Zero Orders.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given security is invalid for the given brokerage GetFillModel() method\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidSecurityTypeToGetFillModel(IBrokerageModel brokerageModel, Securities.Security security)\n            {\n                return Invariant($\"{brokerageModel.GetType().Name}.GetFillModel: Invalid security type {security.Type}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the quantity given was invalid for the given security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOrderQuantity(Securities.Security security, decimal quantity)\n            {\n                return Invariant($@\"The minimum order size (in quote currency) for {security.Symbol.Value} is {\n                    security.SymbolProperties.MinimumOrderSize}. Order quantity was {quantity}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given order size (quantity * price) was invalid for the given security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOrderSize(Securities.Security security, decimal quantity, decimal price)\n            {\n                return Invariant($@\"The minimum order size (in quote currency) for {security.Symbol.Value} is {security.SymbolProperties.MinimumOrderSize}. Order size was {quantity * price}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given order is unsupported by the given brokerage model. It also\n            /// mentions the supported order types\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedOrderType(IBrokerageModel brokerageModel, Orders.Order order, IEnumerable<OrderType> supportedOrderTypes)\n            {\n                return Invariant($\"The {brokerageModel.GetType().Name} does not support {order.Type} order type. Only supports [{string.Join(',', supportedOrderTypes)}]\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the Time In Force of the given order is unsupported by the given brokerage\n            /// model\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedTimeInForce(IBrokerageModel brokerageModel, Orders.Order order)\n            {\n                return Invariant($@\"The {brokerageModel.GetType().Name} does not support {\n                    order.TimeInForce.GetType().Name} time in force.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given security is invalid\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidSecurityTypeForLeverage(Securities.Security security)\n            {\n                return Invariant($\"Invalid security type: {security.Type}\");\n            }\n\n            /// <summary>\n            /// Returns a message indicating that the specified order type is not supported for orders that cross the zero holdings threshold.\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedCrossZeroByOrderType(IBrokerageModel brokerageModel, OrderType orderType)\n            {\n                return Invariant($\"Order type '{orderType}' is not supported for orders that cross the zero holdings threshold in the {brokerageModel.GetType().Name}. This means you cannot change a position from positive to negative or vice versa using this order type. Please close the existing position first.\");\n            }\n\n            /// <summary>\n            /// Returns a message indicating that the specified order type cannot be updated quantity using the given brokerage model.\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedUpdateQuantityOrder(IBrokerageModel brokerageModel, OrderType orderType)\n            {\n                return Invariant($\"Order type '{orderType}' is not supported to update quantity in the {brokerageModel.GetType().Name}.\");\n            }\n\n            /// <summary>\n            /// Builds a descriptive error message when a <see cref=\"OrderType.MarketOnOpen\"/> \n            /// order is submitted outside the valid submission window.\n            /// </summary>\n            /// <param name=\"windowStart\">The start of the valid submission window (typically evening of the prior day).</param>\n            /// <param name=\"windowEnd\">The end of the valid submission window (typically morning of the next day).</param>\n            /// <returns>\n            /// A formatted string describing why the order is not valid at the current time,\n            /// including the allowed submission window and suggested fixes.\n            /// </returns>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedMarketOnOpenOrderTime(\n                in TimeOnly windowStart,\n                in TimeOnly windowEnd)\n            {\n                return Invariant($\"MarketOnOpen submission time is invalid. Valid local times are {windowStart: hh\\\\:mm}–{windowEnd: hh\\\\:mm}. Consider setting DailyPreciseEndTime = false or using {nameof(Schedule)}.{nameof(Schedule.On)}.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.AlpacaBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AlpacaBrokerageModel\n        {\n            /// <summary>\n            /// Returns a message indicating that the specified order type is not supported for trading outside\n            /// regular hours by the given brokerage model.\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TradingOutsideRegularHoursNotSupported(IBrokerageModel brokerageModel, OrderType orderType, TimeInForce timeInForce)\n            {\n                return Invariant($\"The {brokerageModel.GetType().Name} does not support {orderType} orders with {timeInForce} TIF outside regular hours. \") +\n                    Invariant($\"Only {OrderType.Limit} orders with {TimeInForce.Day} TIF are supported outside regular trading hours.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.AlphaStreamsBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AlphaStreamsBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: The Alpha Streams brokerage does not currently support Cash trading\n            /// </summary>\n            public static string UnsupportedAccountType = \"The Alpha Streams brokerage does not currently support Cash trading.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.AxosClearingBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AxosBrokerageModel\n        {\n            /// <summary>\n            /// Returns a string message saying the order quantity must be Integer. It also contains\n            /// the quantity of the given order\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NonIntegerOrderQuantity(Orders.Order order)\n            {\n                return Invariant($\"Order Quantity must be Integer, but provided {order.Quantity}.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.BinanceBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BinanceBrokerageModel\n        {\n            /// <summary>\n            /// Returns a string message saying the type of the given order is unsupported for the symbol of the given\n            /// security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedOrderTypeForSecurityType(Orders.Order order, Securities.Security security)\n            {\n                return Invariant($\"{order.Type} orders are not supported for this symbol ${security.Symbol}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given order is unsupported for the symbol of the given\n            /// security. The message also contains a link to the supported order types in Binance\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedOrderTypeWithLinkToSupportedTypes(string baseApiEndpoint, Orders.Order order, Securities.Security security)\n            {\n                return Invariant($@\"{order.Type} orders are not supported for this symbol. Please check '{baseApiEndpoint}/exchangeInfo?symbol={security.SymbolProperties.MarketTicker}' to see supported order types.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.BinanceUSBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BinanceUSBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: The Binance.US brokerage does not currently support Margin trading\n            /// </summary>\n            public static string UnsupportedAccountType = \"The Binance.US brokerage does not currently support Margin trading.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.BrokerageMessageEvent\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BrokerageMessageEvent\n        {\n            /// <summary>\n            /// String message saying: Disconnect\n            /// </summary>\n            public static string DisconnectCode = \"Disconnect\";\n\n            /// <summary>\n            /// String message saying: Reconnect\n            /// </summary>\n            public static string ReconnectCode = \"Reconnect\";\n\n            /// <summary>\n            /// Parses a given BrokerageMessageEvent object into a string containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Brokerages.BrokerageMessageEvent messageEvent)\n            {\n                return Invariant($\"{messageEvent.Type} - Code: {messageEvent.Code} - {messageEvent.Message}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.DefaultBrokerageMessageHandler\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DefaultBrokerageMessageHandler\n        {\n            /// <summary>\n            /// String message saying: Brokerage Error\n            /// </summary>\n            public static string BrokerageErrorContext = \"Brokerage Error\";\n\n            /// <summary>\n            /// String message saying: DefaultBrokerageMessageHandler.Handle(): Disconnected\n            /// </summary>\n            public static string Disconnected = \"DefaultBrokerageMessageHandler.Handle(): Disconnected.\";\n\n            /// <summary>\n            /// String message saying: DefaultBrookerageMessageHandler.Handle(): Reconnected\n            /// </summary>\n            public static string Reconnected = \"DefaultBrokerageMessageHandler.Handle(): Reconnected.\";\n\n            /// <summary>\n            /// String message saying: DefaultBrokerageMessageHandler.Handle(): Disconnect when exchanges are closed,\n            /// checking back before exchange open\n            /// </summary>\n            public static string DisconnectedWhenExchangesAreClosed =\n                \"DefaultBrokerageMessageHandler.Handle(): Disconnect when exchanges are closed, checking back before exchange open.\";\n\n            /// <summary>\n            /// String message saying: DefaultBrokerageMessageHandler.Handle(): Still disconnected, goodbye\n            /// </summary>\n            public static string StillDisconnected = \"DefaultBrokerageMessageHandler.Handle(): Still disconnected, goodbye.\";\n\n            /// <summary>\n            /// String message saying: Brokerage Disconnect\n            /// </summary>\n            public static string BrokerageDisconnectedShutDownContext = \"Brokerage Disconnect\";\n\n            /// <summary>\n            /// Returns a string message with basic information about the given message event\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string BrokerageInfo(Brokerages.BrokerageMessageEvent messageEvent)\n            {\n                return $\"Brokerage Info: {messageEvent.Message}\";\n            }\n\n            /// <summary>\n            /// Returns a string message warning from the given message event\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string BrokerageWarning(Brokerages.BrokerageMessageEvent messageEvent)\n            {\n                return $\"Brokerage Warning: {messageEvent.Message}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the brokerage is disconnected when exchanges are open and that it's\n            /// trying to reconnect for the given reconnection timeout minutes\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DisconnectedWhenExchangesAreOpen(TimeSpan reconnectionTimeout)\n            {\n                return Invariant($@\"DefaultBrokerageMessageHandler.Handle(): Disconnect when exchanges are open, trying to reconnect for {\n                    reconnectionTimeout.TotalMinutes} minutes.\");\n            }\n\n            /// <summary>\n            /// Returns a string message with the time until the next market open\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TimeUntilNextMarketOpen(TimeSpan timeUntilNextMarketOpen)\n            {\n                return Invariant($\"DefaultBrokerageMessageHandler.Handle(): TimeUntilNextMarketOpen: {timeUntilNextMarketOpen}\");\n            }\n\n            /// <summary>\n            /// Returns a string message notify about unrecognized orders that are not being observed by Lean\n            /// </summary>\n            /// <param name=\"brokerageOrderId\">The brokerage order id.</param>\n            /// <returns>The string represent unrecognized message</returns>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string IgnoreUnrecognizedOrder(string brokerageOrderId)\n            {\n                return $\"Ignoring unrecognized order (BrokerId: {brokerageOrderId}). Please use 'SetBrokerageMessageHandler(...)' to set a custom brokerage message handler to optionally accept unknown orders.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.ExanteBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ExanteBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: Order is null\n            /// </summary>\n            public static string NullOrder = \"Order is null.\";\n\n            /// <summary>\n            /// String message saying: Price is not set\n            /// </summary>\n            public static string PriceNotSet = \"Price is not set.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.FTXBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FTXBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: Trigger price too high, must be below current market price\n            /// </summary>\n            public static string TriggerPriceTooHigh = \"Trigger price too high: must be below current market price.\";\n\n            /// <summary>\n            /// String message saying: Trigger price too low, must be above current market price\n            /// </summary>\n            public static string TriggerPriceTooLow = \"Trigger price too low: must be above current market price.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.FxcmBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FxcmBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: Limit Buy orders and Stop Sell orders must be below market, Limit Sell orders and Stop Buy orders\n            /// must be above market\n            /// </summary>\n            public static string InvalidOrderPrice =\n                \"Limit Buy orders and Stop Sell orders must be below market, Limit Sell orders and Stop Buy orders must be above market.\";\n\n            /// <summary>\n            /// Returns a string message saying the order quantity must be a multiple of LotSize. It also contains the security's Lot\n            /// Size\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOrderQuantityForLotSize(Securities.Security security)\n            {\n                return Invariant($\"The order quantity must be a multiple of LotSize: [{security.SymbolProperties.LotSize}].\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the order price is too far from the current market price\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string PriceOutOfRange(OrderType orderType, OrderDirection orderDirection, decimal orderPrice, decimal currentPrice)\n            {\n                return Invariant($@\"The {orderType} {orderDirection} order price ({\n                    orderPrice}) is too far from the current market price ({currentPrice}).\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.CoinbaseBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class CoinbaseBrokerageModel\n        {\n            /// <summary>\n            /// String message saying: The Coinbase brokerage does not currently support Margin trading\n            /// </summary>\n            public static string UnsupportedAccountType = \"The Coinbase brokerage does not currently support Margin trading.\";\n\n            /// <summary>\n            /// Returns a string message saying the Stop Market orders are no longer supported since the given end date\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string StopMarketOrdersNoLongerSupported(DateTime stopMarketOrderSupportEndDate)\n            {\n                return Invariant($\"Stop Market orders are no longer supported since {stopMarketOrderSupportEndDate}.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.InteractiveBrokersFixModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InteractiveBrokersFixModel\n        {\n            /// <summary>\n            /// Returns a string message saying the given brokerage model does not support combo orders\n            /// that mix future options and futures legs\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedFopFutureComboOrders(Brokerages.InteractiveBrokersFixModel brokerageModel, Orders.Order order)\n            {\n                return Invariant($@\"The {brokerageModel.GetType().Name} does not support {order.Type} combining future options and futures legs.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.InteractiveBrokersBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InteractiveBrokersBrokerageModel\n        {\n            /// <summary>\n            /// Returns a string message saying the given brokerage model does not support order exercises\n            /// for index and cash-settled options\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedExerciseForIndexAndCashSettledOptions(Brokerages.InteractiveBrokersBrokerageModel brokerageModel,\n                Orders.Order order)\n            {\n                return Invariant($@\"The {brokerageModel.GetType().Name} does not support {\n                    order.Type} exercises for index and cash-settled options.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given brokerage model does not support four-leg combo leg limit orders\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedFourLegComboLegLimitOrders(Brokerages.InteractiveBrokersBrokerageModel brokerageModel)\n            {\n                return Invariant($\"The {brokerageModel.GetType().Name} does not support four-leg ComboLegLimit orders. Use ComboLimit orders for four-leg combinations or more.\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing the minimum and maximum limits for the allowable order size as well as the currency\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidForexOrderSize(decimal min, decimal max, string currency)\n            {\n                return Invariant($\"The minimum and maximum limits for the allowable order size are ({min}, {max}){currency}.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.TradierBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class TradierBrokerageModel\n        {\n            /// <summary>\n            /// Unsupported Security Type string message\n            /// </summary>\n            public static string UnsupportedSecurityType = \"This model only supports equities and options.\";\n\n            /// <summary>\n            /// Unsupported Time In Force Type string message\n            /// </summary>\n            public static string UnsupportedTimeInForceType = $\"This model only supports orders with the following time in force types: {typeof(DayTimeInForce)} and {typeof(GoodTilCanceledTimeInForce)}\";\n\n            /// <summary>\n            /// Extended Market Hours Trading Not Supported string message\n            /// </summary>\n            public static string ExtendedMarketHoursTradingNotSupported =\n                \"Tradier does not support extended market hours trading. Your order will be processed at market open.\";\n\n            /// <summary>\n            /// Order Quantity Update Not Supported string message\n            /// </summary>\n            public static string OrderQuantityUpdateNotSupported = \"Tradier does not support updating order quantities.\";\n\n            /// <summary>\n            /// Open Orders Cancel On Reverse Split Symbols string message\n            /// </summary>\n            public static string OpenOrdersCancelOnReverseSplitSymbols = \"Tradier Brokerage cancels open orders on reverse split symbols\";\n\n            /// <summary>\n            /// Short Order Is GTC string message\n            /// </summary>\n            public static string ShortOrderIsGtc = \"You cannot place short stock orders with GTC, only day orders are allowed\";\n\n            /// <summary>\n            /// Sell Short Order Last Price Below 5 string message\n            /// </summary>\n            public static string SellShortOrderLastPriceBelow5 = \"Sell Short order cannot be placed for stock priced below $5\";\n\n            /// <summary>\n            /// Incorrect Order Quantity string message\n            /// </summary>\n            public static string IncorrectOrderQuantity = \"Quantity should be between 1 and 10,000,000\";\n\n            /// <summary>\n            /// Extended Market Hours Trading Not Supported Outside Extended Session string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ExtendedMarketHoursTradingNotSupportedOutsideExtendedSession(Securities.MarketHoursSegment preMarketSegment,\n                Securities.MarketHoursSegment postMarketSegment)\n            {\n                return \"Tradier does not support explicitly placing out-of-regular-hours orders if not currently \" +\n                    $\"during the pre or post market session. {preMarketSegment}. {postMarketSegment}. \" +\n                    \"Only equity limit orders are allowed during extended market hours.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.TradingTechnologiesBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class TradingTechnologiesBrokerageModel\n        {\n            /// <summary>\n            /// Invalid Stop Market Order Price string message\n            /// </summary>\n            public static string InvalidStopMarketOrderPrice =\n                \"StopMarket Sell orders must be below market, StopMarket Buy orders must be above market.\";\n\n            /// <summary>\n            /// Invalid Stop Limit Order Price string message\n            /// </summary>\n            public static string InvalidStopLimitOrderPrice =\n                \"StopLimit Sell orders must be below market, StopLimit Buy orders must be above market.\";\n\n            /// <summary>\n            /// Invalid Stop Limit Order Limit Price string message\n            /// </summary>\n            public static string InvalidStopLimitOrderLimitPrice =\n                \"StopLimit Buy limit price must be greater than or equal to stop price, StopLimit Sell limit price must be smaller than or equal to stop price.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.WolverineBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class WolverineBrokerageModel\n        {\n            /// <summary>\n            /// Returns a message for an unsupported order type in Wolverine Brokerage Model\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedOrderType(Orders.Order order)\n            {\n                return Invariant($\"{order.Type} order is not supported by Wolverine. Currently, only Market Order is supported.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Brokerages.RBIBrokerageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class RBIBrokerageModel\n        {\n            /// <summary>\n            /// Returns a message for an unsupported order type in RBI Brokerage Model\n            /// </summary>\n            /// <param name=\"order\"></param>\n            /// <returns></returns>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedOrderType(Orders.Order order)\n            {\n                return Invariant($\"{order.Type} order is not supported by RBI. Currently, only Market Order, Limit Order, StopMarket Order and StopLimit Order are supported.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Commands.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Commands;\nusing QuantConnect.Orders;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Commands\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Commands.BaseCommand\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BaseCommand\n        {\n            /// <summary>\n            /// Returns a string message saying: Please provide values for: Ticker, Market and SecurityType\n            /// </summary>\n            public static string MissingValuesToGetSymbol = \"Please provide values for: Ticker, Market & SecurityType\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Commands.BaseCommandHandler\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BaseCommandHandler\n        {\n            /// <summary>\n            /// Returns a string with the given command\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ExecutingCommand(ICommand command)\n            {\n                return $\"Executing {command}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Commands.FileCommandHandler\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FileCommandHandler\n        {\n            /// <summary>\n            /// Returns a string message saying: Command Id is null or empty, will skip writing result file\n            /// </summary>\n            public static string NullOrEmptyCommandId = \"Command Id is null or empty, will skip writing result file\";\n\n            /// <summary>\n            /// Returns a string message saying the given commandFilePath is being read\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ReadingCommandFile(string commandFilePath)\n            {\n                return $\"Reading command file {commandFilePath}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given commandFilePath does not exists\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string CommandFileDoesNotExist(string commandFilePath)\n            {\n                return $\"File {commandFilePath} does not exists\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Commands.OrderCommand\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OrderCommand\n        {\n            /// <summary>\n            /// Returns a string message with basic information about a command, such us:\n            /// order type, symbol, quantity and response\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string CommandInfo(OrderType orderType, QuantConnect.Symbol symbol, decimal quantity, Orders.OrderResponse response)\n            {\n                return Invariant($\"{orderType} for {quantity} units of {symbol}: {response}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Exceptions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Exceptions\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.DllNotFoundPythonExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DllNotFoundPythonExceptionInterpreter\n        {\n            /// <summary>\n            /// Returns a string message saying the given dynamic-link library could not be found\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DynamicLinkLibraryNotFound(string dllName, string platform)\n            {\n                return $\"The dynamic-link library for {dllName} could not be found. \" +\n                    \"Please visit https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/readme.md for instructions \" +\n                    $\"on how to enable python support in {platform}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.InvalidTokenPythonExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InvalidTokenPythonExceptionInterpreter\n        {\n            /// <summary>\n            /// String message saying: invalid token\n            /// </summary>\n            public static string InvalidTokenExpectedSubstring = \"invalid token\";\n\n            /// <summary>\n            /// String message saying: are not permitted\n            /// </summary>\n            public static string NotPermittedExpectedSubstring = \"are not permitted;\";\n\n            /// <summary>\n            /// Returns a string message saying: Tring to include an invalid token/character in any statement throws s SyntaxError\n            /// exception. It also contains an advice to prevent that exception\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InterpretException(PythonException exception)\n            {\n                var message = \"Trying to include an invalid token/character in any statement throws a SyntaxError exception. \" +\n                    \"To prevent the exception, ensure no invalid token are mistakenly included (e.g: leading zero).\";\n                var errorLine = exception.Message.GetStringBetweenChars('(', ')');\n\n                return $\"{message}{Environment.NewLine}  in {errorLine}{Environment.NewLine}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.KeyErrorPythonExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class KeyErrorPythonExceptionInterpreter\n        {\n            /// <summary>\n            /// Returns a string message saying the given key does not exists in the collection and the exception that is thrown\n            /// in this case. It also advises the user on how to prevent this exception\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string KeyNotFoundInCollection(string key)\n            {\n                return \"Trying to retrieve an element from a collection using a key that does not exist \" +\n                    $@\"in that collection throws a KeyError exception. To prevent the exception, ensure that the {\n                        key} key exist in the collection and/or that collection is not empty.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.NoMethodMatchPythonExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class NoMethodMatchPythonExceptionInterpreter\n        {\n            /// <summary>\n            /// String message saying: No method match\n            /// </summary>\n            public static string NoMethodMatchExpectedSubstring = \"No method match\";\n\n            /// <summary>\n            /// Returns a string message saying the given method does not exists. It also contains the exception\n            /// thrown is this case and an advice on how to prevent it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string AttemptedToAccessMethodThatDoesNotExist(string methodName)\n            {\n                return \"Trying to dynamically access a method that does not exist throws a TypeError exception. \" +\n                    $@\"To prevent the exception, ensure each parameter type matches those required by the {\n                        methodName} method. Please checkout the API documentation.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.ScheduledEventExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ScheduledEventExceptionInterpreter\n        {\n            /// <summary>\n            /// Returns a string message with the given event name\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ScheduledEventName(string eventName)\n            {\n                return $\"In Scheduled Event '{eventName}',\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.StackExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class StackExceptionInterpreter\n        {\n            /// <summary>\n            /// Returns a message for a Loaded Exception Interpreter\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string LoadedExceptionInterpreter(IExceptionInterpreter interpreter)\n            {\n                return $\"Loaded ExceptionInterpreter: {interpreter.GetType().Name}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Exceptions.UnsupportedOperandPythonExceptionInterpreter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class UnsupportedOperandPythonExceptionInterpreter\n        {\n            /// <summary>\n            /// Unsupported Operand Type Expected substring\n            /// </summary>\n            public static string UnsupportedOperandTypeExpectedSubstring = \"unsupported operand type\";\n\n            /// <summary>\n            /// Returns a message for invalid object types for operation\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidObjectTypesForOperation(string types)\n            {\n                return $@\"Trying to perform a summation, subtraction, multiplication or division between {\n                    types} objects throws a TypeError exception. To prevent the exception, ensure that both values share the same type.\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Indicators.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Indicators\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Indicators.IndicatorDataPoint\"/> class and its consumers or related classes\n        /// </summary>\n        public static class IndicatorDataPoint\n        {\n            /// <summary>\n            /// Returns a string message saying the given type is invalid for certain object\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidObjectTypeToCompareTo(Type type)\n            {\n                return $\"Object must be of type {type.GetBetterTypeName()}\";\n            }\n\n            /// <summary>\n            /// Parses a IndicatorDataPoint instance into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Indicators.IndicatorDataPoint instance)\n            {\n                return Invariant($\"{instance.Time.ToStringInvariant(\"s\")} - {instance.Value}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given method cannot be called on this type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedMethod(string methodName)\n            {\n                return $\"IndicatorDataPoint does not support the {methodName} function. This function should never be called on this type.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Indicators.RollingWindow{T}\"/> class and its consumers or related classes\n        /// </summary>\n        public static class RollingWindow\n        {\n            /// <summary>\n            /// String message saying the rolling windows must have size of at least 1\n            /// </summary>\n            public static string InvalidSize(int minimumSize) => $\"RollingWindow must have size of at least {minimumSize}.\";\n\n            /// <summary>\n            /// String message saying no items have been removed yet from the rolling window\n            /// </summary>\n            public static string NoItemsRemovedYet = \"No items have been removed yet!\";\n\n            /// <summary>\n            /// String message saying the index must be a non-negative integer\n            /// </summary>\n            public static string IndexOutOfSizeRange = \"Index must be a non-negative integer\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Notifications.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Notifications\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Notifications.NotificationEmail\"/> class and its consumers or related classes\n        /// </summary>\n        public static class NotificationEmail\n        {\n            /// <summary>\n            /// Returns a string message saying the given email is invalid\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidEmailAddress(string email)\n            {\n                return $\"Invalid email address: {email}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Notifications.NotificationFtp\"/> class and its consumers or related classes\n        /// </summary>\n        public static class NotificationFtp\n        {\n            /// <summary>\n            /// String message saying the SSH key is missing\n            /// </summary>\n            public static string MissingSSHKey = \"FTP SSH key missing for SFTP notification.\";\n\n            /// <summary>\n            /// String message saying the password is missing\n            /// </summary>\n            public static string MissingPassword = \"FTP password is missing for unsecure FTP notification.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Notifications.NotificationJsonConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class NotificationJsonConverter\n        {\n            /// <summary>\n            /// String message saying the write method has not been implemented and should not be called\n            /// </summary>\n            public static string WriteNotImplemented = \"Not implemented, should not be called\";\n\n            /// <summary>\n            /// String message saying the given object is unexpected\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedJsonObject(JObject jObject)\n            {\n                return $\"Unexpected json object: '{jObject.ToString(Formatting.None)}'\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Optimizer.Objectives.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Optimizer.Objectives\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Optimizer.Objectives\"/> namespace classes\n        /// </summary>\n        public static class OptimizerObjectivesCommon\n        {\n            /// <summary>\n            /// String message saying the backtest result can not be null or empty\n            /// </summary>\n            public static string NullOrEmptyBacktestResult = \"Backtest result can not be null or empty.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Objectives.Constraint\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Constraint\n        {\n            /// <summary>\n            /// String message saying the constraint target value is not specified\n            /// </summary>\n            public static string ConstraintTargetValueNotSpecified = \"Constraint target value is not specified\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Objectives.ExtremumJsonConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ExtremumJsonConverter\n        {\n            /// <summary>\n            /// String message saying it could not recognize target direction\n            /// </summary>\n            public static string UnrecognizedTargetDirection = \"Could not recognize target direction\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Objectives.Objective\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Objective\n        {\n            /// <summary>\n            /// Null or empty Objective string message\n            /// </summary>\n            public static string NullOrEmptyObjective = \"Objective can not be null or empty\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Objectives.Target\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Target\n        {\n            /// <summary>\n            /// Parses a Target object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Optimizer.Objectives.Target instance)\n            {\n                if (instance.TargetValue.HasValue)\n                {\n                    return $\"Target: {instance.Target} TargetValue: {instance.TargetValue.Value} at: {instance.Current}\";\n                }\n                return $\"Target: {instance.Target} at: {instance.Current}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Optimizer.Parameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Optimizer.Parameters\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Parameters.OptimizationParameterJsonConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OptimizationParameterJsonConverter\n        {\n            /// <summary>\n            /// String message saying optimization parameter name is not specified\n            /// </summary>\n            public static string OptimizationParameterNotSpecified = \"Optimization parameter name is not specified.\";\n\n            /// <summary>\n            /// String message saying optimization parameter is not currently supported\n            /// </summary>\n            public static string OptimizationParameterNotSupported = \"Optimization parameter is not currently supported.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Optimizer.Parameters.OptimizationStepParameter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OptimizationStepParameter\n        {\n            /// <summary>\n            /// String message saying the step should be great or equal than minStep\n            /// </summary>\n            public static string StepLessThanMinStep = $\"step should be great or equal than minStep\";\n\n            /// <summary>\n            /// Returns a string message saying the step range is invalid\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidStepRange(decimal min, decimal max)\n            {\n                return $\"Minimum value ({min}) should be less or equal than maximum ({max})\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the step should be positive value\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NonPositiveStepValue(string stepVarName, decimal value)\n            {\n                return $\"{stepVarName} should be positive value; but was {value}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Orders.Fees.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Securities;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Orders.Fees\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fees.FeeModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FeeModel\n        {\n            /// <summary>\n            /// Returns a string message saying the type of the given security is unsupported\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedSecurityType(Securities.Security security)\n            {\n                return Invariant($\"Unsupported security type: {security.Type}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fees.AlphaStreamsFeeModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AlphaStreamsFeeModel\n        {\n            /// <summary>\n            /// Returns a string message saying the given market is unexpected\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedEquityMarket(string market)\n            {\n                return Invariant($\"AlphaStreamsFeeModel(): unexpected equity Market {market}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fees.ExanteFeeModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ExanteFeeModel\n        {\n            /// <summary>\n            /// Returns a string message saying the market associated with the given order symbol is unsupported\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedExchange(Orders.Order order)\n            {\n                return Invariant($\"Unsupported exchange: ${order.Symbol.ID.Market}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fees.InteractiveBrokersFeeModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InteractiveBrokersFeeModel\n        {\n            /// <summary>\n            /// Returns a string message saying the given option market was unexpected\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedOptionMarket(string market)\n            {\n                return Invariant($\"InteractiveBrokersFeeModel(): unexpected option Market {market}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given future market was unexpected\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedFutureMarket(string market)\n            {\n                return Invariant($\"InteractiveBrokersFeeModel(): unexpected future Market {market}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given equity market was unexpected\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedEquityMarket(string market)\n            {\n                return Invariant($\"InteractiveBrokersFeeModel(): unexpected equity Market {market}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given security was unsupported\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnitedStatesFutureFeesUnsupportedSecurityType(Securities.Security security)\n            {\n                return Invariant($\"InteractiveBrokersFeeModel.UnitedStatesFutureFees(): Unsupported security type: {security.Type}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the type of the given security was unsupported\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string EUREXFutureFeesUnsupportedSecurityType(Securities.Security security)\n            {\n                return Invariant($\"InteractiveBrokersFeeModel.EUREXFutureFees(): Unsupported security type: {security.Type}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the quote currency of the given security was \n            /// unexpected for Hong Kong futures exchange\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string HongKongFutureFeesUnexpectedQuoteCurrency(Securities.Security security)\n            {\n                return Invariant($\"Unexpected quote currency {security.QuoteCurrency.Symbol} for Hong Kong futures exchange\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fees.TDAmeritradeFeeModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class TDAmeritradeFeeModel\n        {\n            /// <summary>\n            /// Returns a string message for unsupported security types in TDAmeritradeFeeModel\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedSecurityType(SecurityType securityType)\n            {\n                return $\"TDAmeritradeFeeModel doesn't return correct fee model for SecurityType = {nameof(securityType)}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Orders.Fills.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Orders.Fills\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fills.FillModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FillModel\n        {\n            /// <summary>\n            /// Returns a string message warning saying the order was filled at stale price\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledAtStalePrice(Securities.Security security, Prices prices)\n            {\n                return Invariant($\"Warning: fill at stale price ({prices.EndTime.ToStringInvariant()} {security.Exchange.TimeZone})\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the market never closes for the given symbol, and that an order of the given\n            /// type cannot be submitted\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MarketNeverCloses(Securities.Security security, OrderType orderType)\n            {\n                return Invariant($\"Market never closes for this symbol {security.Symbol}, can no submit a {nameof(orderType)} order.\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing the given subscribedTypes\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            private static string SubscribedTypesToString(HashSet<Type> subscribedTypes)\n            {\n                return subscribedTypes == null\n                    ? string.Empty\n                    : Invariant($\" SubscribedTypes: [{string.Join(\",\", subscribedTypes.Select(type => type.Name))}]\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to get ask price to perform the fill for the given security symbol because\n            /// no market data was found\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoMarketDataToGetAskPriceForFilling(Securities.Security security, HashSet<Type> subscribedTypes = null)\n            {\n                return Invariant($\"Cannot get ask price to perform fill for {security.Symbol} because no market data was found.\") +\n                    SubscribedTypesToString(subscribedTypes);\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to get bid price to perform the fill for the given security symbol because\n            /// no market data was found\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoMarketDataToGetBidPriceForFilling(Securities.Security security, HashSet<Type> subscribedTypes = null)\n            {\n                return Invariant($\"Cannot get bid price to perform fill for {security.Symbol} because no market data was found.\") +\n                    SubscribedTypesToString(subscribedTypes);\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to perform a fill for the given security symbol because\n            /// no data subscription was found\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoDataSubscriptionFoundForFilling(Securities.Security security)\n            {\n                return Invariant($\"Cannot perform fill for {security.Symbol} because no data subscription were found.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Fills.EquityFillModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class EquityFillModel\n        {\n            /// <summary>\n            /// String message saying: No trade with the OfficialOpen or OpeningPrints flag within the 1-minute timeout\n            /// </summary>\n            public static string MarketOnOpenFillNoOfficialOpenOrOpeningPrintsWithinOneMinute =\n                \"No trade with the OfficialOpen or OpeningPrints flag within the 1-minute timeout.\";\n\n            /// <summary>\n            /// String message saying: No trade with the OfficialClose or ClosingPrints flag within the 1-minute timeout\n            /// </summary>\n            public static string MarketOnCloseFillNoOfficialCloseOrClosingPrintsWithinOneMinute =\n                \"No trade with the OfficialClose or ClosingPrints flag within the 1-minute timeout.\";\n\n            /// <summary>\n            /// String message saying: No trade with the OfficialClose or ClosingPrints flag for data that does not include\n            /// extended market hours\n            /// </summary>\n            public static string MarketOnCloseFillNoOfficialCloseOrClosingPrintsWithoutExtendedMarketHours =\n                \"No trade with the OfficialClose or ClosingPrints flag for data that does not include extended market hours.\";\n\n            /// <summary>\n            /// Returns a string message saying the last data (of the given tick type) has been used to fill\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithLastTickTypeData(Tick tick)\n            {\n                return Invariant($\"Fill with last {tick.TickType} data.\");\n            }\n\n            /// <summary>\n            /// Returns a string message warnning the user that no trade information was available, so the order was filled\n            /// using quote data\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithQuoteData(Securities.Security security)\n            {\n                return Invariant($@\"Warning: No trade information available at {security.LocalTime.ToStringInvariant()} {\n                    security.Exchange.TimeZone}, order filled using Quote data\");\n            }\n\n            /// <summary>\n            /// Returns a string message warning the user that the fill is at stale price and that the order will\n            /// be filled using quote tick data\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithQuoteTickData(Securities.Security security, Tick quoteTick)\n            {\n                return Invariant($@\"Warning: fill at stale price ({quoteTick.EndTime.ToStringInvariant()} {\n                    security.Exchange.TimeZone}), using Quote Tick data.\");\n            }\n\n            /// <summary>\n            /// Returns a string message warning the user that no quote information was available, so the order\n            /// was filled using trade tick data\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithTradeTickData(Securities.Security security, Tick tradeTick)\n            {\n                return Invariant($@\"Warning: No quote information available at {tradeTick.EndTime.ToStringInvariant()} {\n                    security.Exchange.TimeZone}, order filled using Trade Tick data\");\n            }\n\n            /// <summary>\n            /// Returns a string message warning the user that the fill was at stale price, so quote bar data\n            /// was used to fill the order\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithQuoteBarData(Securities.Security security, QuoteBar quoteBar)\n            {\n                return Invariant($@\"Warning: fill at stale price ({quoteBar.EndTime.ToStringInvariant()} {\n                    security.Exchange.TimeZone}), using QuoteBar data.\");\n            }\n\n            /// <summary>\n            /// Returns a string message warning the user that no quote information was available, so that trade bar\n            /// data was used to fill the order\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithTradeBarData(Securities.Security security, TradeBar tradeBar)\n            {\n                return Invariant($@\"Warning: No quote information available at {tradeBar.EndTime.ToStringInvariant()} {\n                    security.Exchange.TimeZone}, order filled using TradeBar data\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the order was filled using the open price due to a favorable gap\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithOpenDueToFavorableGap(Securities.Security security, TradeBar tradeBar)\n            {\n                return Invariant($@\"Due to a favorable gap at {tradeBar.EndTime.ToStringInvariant()} {security.Exchange.TimeZone}, order filled using the open price ({tradeBar.Open})\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the order was filled using the open price due to an unfavorable gap\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FilledWithOpenDueToUnfavorableGap(Securities.Security security, TradeBar tradeBar)\n            {\n                return Invariant($@\"Due to an unfavorable gap at {tradeBar.EndTime.ToStringInvariant()} {security.Exchange.TimeZone}, order filled using the open price ({tradeBar.Open})\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Orders.OptionExercise.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Orders.OptionExercise\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.OptionExercise.DefaultExerciseModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DefaultExerciseModel\n        {\n            /// <summary>\n            /// String message saying: Option Assignment\n            /// </summary>\n            public static string OptionAssignment = \"Option Assignment\";\n\n            /// <summary>\n            /// String message saying: Option exercise\n            /// </summary>\n            public static string OptionExercise = \"Option Exercise\";\n\n            /// <summary>\n            /// Returns a string message containing basic information such as if it's\n            /// an assignment or an exercise, if it's ITM or OTM  and the underlying option price\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ContractHoldingsAdjustmentFillTag(bool inTheMoney, bool isAssignment, Option option)\n            {\n                var action = isAssignment ? \"Assigned\" : \"Automatic Exercise\";\n                var tag = inTheMoney ? action : \"OTM\";\n\n                return $\"{tag}. Underlying: {option.Underlying.Price.ToStringInvariant()}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Orders.Slippage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Data;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Orders.Slippage\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Slippage.VolumeShareSlippageModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class VolumeShareSlippageModel\n        {\n            /// <summary>\n            /// Returns a message for an invalid market data type in Volume Share Slippage Model\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidMarketDataType(BaseData data)\n            {\n                return $\"VolumeShareSlippageModel.GetSlippageApproximation(): Cannot use this model with market data type {data.GetType()}\";\n            }\n\n            /// <summary>\n            /// Returns a message for a volume not reported for market data type in Volume Share Slippage Model\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string VolumeNotReportedForMarketDataType(SecurityType securityType)\n            {\n                return Invariant($\"VolumeShareSlippageModel.GetSlippageApproximation(): {securityType} security type often \") +\n                    \"does not report volume. If you intend to model slippage beyond the spread, please consider another model.\";\n            }\n\n            /// <summary>\n            /// Returns a message for a negative or zero bar volume in Volume Share Slippage Model\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NegativeOrZeroBarVolume(decimal barVolume, decimal slippagePercent)\n            {\n                return Invariant($@\"VolumeShareSlippageModel.GetSlippageApproximation: Bar volume cannot be zero or negative. Volume: {\n                    barVolume}. Using maximum slippage percentage of {slippagePercent}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Orders.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Orders\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.CancelOrderRequest\"/> class and its consumers or related classes\n        /// </summary>\n        public static class CancelOrderRequest\n        {\n            /// <summary>\n            /// Parses the given CancelOrderRequest into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.CancelOrderRequest request)\n            {\n                return Invariant($@\"{request.Time.ToStringInvariant()} UTC: Cancel Order: ({request.OrderId}) - {\n                    request.Tag} Status: {request.Status}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.GroupOrderExtensions\"/> class and its consumers or related classes\n        /// </summary>\n        public static class GroupOrderExtensions\n        {\n            /// <summary>\n            /// Returns a string message saying there is insufficient buying power to complete the given orders\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InsufficientBuyingPowerForOrders(Dictionary<Orders.Order, Securities.Security> securities,\n                HasSufficientBuyingPowerForOrderResult hasSufficientBuyingPowerResult)\n            {\n                var ids = string.Join(\",\", securities.Keys.Select(o => o.Id));\n                var values = string.Join(\",\", securities.Select(o => o.Key.GetValue(o.Value).SmartRounding()));\n                return $@\"Order Error: ids: [{ids}], Insufficient buying power to complete orders (Value:[{values}]), Reason: {\n                    hasSufficientBuyingPowerResult.Reason}.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.LimitIfTouchedOrder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class LimitIfTouchedOrder\n        {\n            /// <summary>\n            /// Returns an empty string tag\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string Tag(Orders.LimitIfTouchedOrder order)\n            {\n                // No additional information to display\n                return string.Empty;\n            }\n\n            /// <summary>\n            /// Parses the given LimitIfTouched order to a string message containing basic information\n            /// about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.LimitIfTouchedOrder order)\n            {\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency);\n                return Invariant($@\"{Order.ToString(order)} at trigger {currencySymbol}{order.TriggerPrice.SmartRounding()\n                    } limit {currencySymbol}{order.LimitPrice.SmartRounding()}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.LimitOrder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class LimitOrder\n        {\n            /// <summary>\n            /// Returns an empty string tag\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string Tag(Orders.LimitOrder order)\n            {\n                // No additional information to display\n                return string.Empty;\n            }\n\n            /// <summary>\n            /// Parses a Limit order to a string message with basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.LimitOrder order)\n            {\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency);\n                return Invariant($\"{Order.ToString(order)} at limit {currencySymbol}{order.LimitPrice.SmartRounding()}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.Order\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Order\n        {\n            /// <summary>\n            /// Parses the given order into a string message with basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.Order order)\n            {\n                var tag = string.IsNullOrEmpty(order.Tag) ? string.Empty : $\": {order.Tag}\";\n                return Invariant($@\"OrderId: {order.Id} (BrokerId: {string.Join(\",\", order.BrokerId)}) {order.Status} {\n                    order.Type} order for {order.Quantity} unit{(order.Quantity == 1 ? \"\" : \"s\")} of {order.Symbol}{tag}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.OrderEvent\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OrderEvent\n        {\n            /// <summary>\n            /// Parses the given order event into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.OrderEvent orderEvent)\n            {\n                var message = Invariant($@\"Time: {orderEvent.UtcTime} OrderID: {orderEvent.OrderId} EventID: {\n                    orderEvent.Id} Symbol: {orderEvent.Symbol.Value} Status: {orderEvent.Status} Quantity: {orderEvent.Quantity}\");\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(orderEvent.FillPriceCurrency);\n\n                if (orderEvent.FillQuantity != 0)\n                {\n                    message += Invariant($@\" FillQuantity: {orderEvent.FillQuantity\n                        } FillPrice: {currencySymbol}{orderEvent.FillPrice.SmartRounding()}\");\n                }\n\n                if (orderEvent.LimitPrice.HasValue)\n                {\n                    message += Invariant($\" LimitPrice: {currencySymbol}{orderEvent.LimitPrice.Value.SmartRounding()}\");\n                }\n\n                if (orderEvent.StopPrice.HasValue)\n                {\n                    message += Invariant($\" StopPrice: {currencySymbol}{orderEvent.StopPrice.Value.SmartRounding()}\");\n                }\n\n                if (orderEvent.TrailingAmount.HasValue)\n                {\n                    var trailingAmountString = TrailingStopOrder.TrailingAmount(orderEvent.TrailingAmount.Value,\n                        orderEvent.TrailingAsPercentage ?? false, currencySymbol);\n                    message += $\" TrailingAmount: {trailingAmountString}\";\n                }\n\n                if (orderEvent.TriggerPrice.HasValue)\n                {\n                    message += Invariant($\" TriggerPrice: {currencySymbol}{orderEvent.TriggerPrice.Value.SmartRounding()}\");\n                }\n\n                // attach the order fee so it ends up in logs properly.\n                if (orderEvent.OrderFee.Value.Amount != 0m)\n                {\n                    message += Invariant($\" OrderFee: {orderEvent.OrderFee}\");\n                }\n\n                // add message from brokerage\n                if (!string.IsNullOrEmpty(orderEvent.Message))\n                {\n                    message += Invariant($\" Message: {orderEvent.Message}\");\n                }\n\n                if (orderEvent.Symbol.SecurityType.IsOption())\n                {\n                    message += Invariant($\" IsAssignment: {orderEvent.IsAssignment}\");\n                }\n\n                return message;\n            }\n\n            /// <summary>\n            /// Parses the given order event into a string message which summarizes the basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ShortToString(Orders.OrderEvent orderEvent)\n            {\n                var message = Invariant($\"{orderEvent.UtcTime} OID:{orderEvent.OrderId} {orderEvent.Symbol.Value} {orderEvent.Status} Q:{orderEvent.Quantity}\");\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(orderEvent.FillPriceCurrency);\n\n                if (orderEvent.FillQuantity != 0)\n                {\n                    message += Invariant($\" FQ:{orderEvent.FillQuantity} FP:{currencySymbol}{orderEvent.FillPrice.SmartRounding()}\");\n                }\n\n                if (orderEvent.LimitPrice.HasValue)\n                {\n                    message += Invariant($\" LP:{currencySymbol}{orderEvent.LimitPrice.Value.SmartRounding()}\");\n                }\n\n                if (orderEvent.StopPrice.HasValue)\n                {\n                    message += Invariant($\" SP:{currencySymbol}{orderEvent.StopPrice.Value.SmartRounding()}\");\n                }\n\n                if (orderEvent.TrailingAmount.HasValue)\n                {\n                    var trailingAmountString = TrailingStopOrder.TrailingAmount(orderEvent.TrailingAmount.Value,\n                        orderEvent.TrailingAsPercentage ?? false, currencySymbol);\n                    message += $\" TA: {trailingAmountString}\";\n                }\n\n                if (orderEvent.TriggerPrice.HasValue)\n                {\n                    message += Invariant($\" TP:{currencySymbol}{orderEvent.TriggerPrice.Value.SmartRounding()}\");\n                }\n\n                // attach the order fee so it ends up in logs properly.\n                if (orderEvent.OrderFee.Value.Amount != 0m)\n                {\n                    message += Invariant($\" OF:{currencySymbol}{orderEvent.OrderFee}\");\n                }\n\n                // add message from brokerage\n                if (!string.IsNullOrEmpty(orderEvent.Message))\n                {\n                    message += Invariant($\" M:{orderEvent.Message}\");\n                }\n\n                if (orderEvent.Symbol.SecurityType.IsOption())\n                {\n                    message += Invariant($\" IA:{orderEvent.IsAssignment}\");\n                }\n\n                return message;\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.OrderRequest\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OrderRequest\n        {\n            /// <summary>\n            /// Parses the given order request into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.OrderRequest request)\n            {\n                return Invariant($\"{request.Time} UTC: Order: ({request.OrderId}) - {request.Tag} Status: {request.Status}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.OrderResponse\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OrderResponse\n        {\n            /// <summary>\n            /// String message saying: An unexpected error occurred\n            /// </summary>\n            public static string DefaultErrorMessage = \"An unexpected error occurred.\";\n\n            /// <summary>\n            /// String message saying: The request has not yet been processed\n            /// </summary>\n            public static string UnprocessedOrderResponseErrorMessage = \"The request has not yet been processed.\";\n\n            /// <summary>\n            /// Parses the given order response into a string message containing basic information about it \n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.OrderResponse response)\n            {\n                if (response == Orders.OrderResponse.Unprocessed)\n                {\n                    return \"Unprocessed\";\n                }\n\n                if (response.IsError)\n                {\n                    return Invariant($\"Error: {response.ErrorCode} - {response.ErrorMessage}\");\n                }\n\n                return \"Success\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to udpate the order with the id\n            /// from the given request because it already had the status of the given order\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidStatus(Orders.OrderRequest request, Orders.Order order)\n            {\n                return Invariant($\"Unable to update order with id {request.OrderId} because it already has {order.Status} status.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to update or cancel the order with the\n            /// id from the given request because the submit confirmation had not been received yet\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidNewStatus(Orders.OrderRequest request, Orders.Order order)\n            {\n                return Invariant($@\"Unable to update or cancel order with id {\n                    request.OrderId} and status {order.Status} because the submit confirmation has not been received yet.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to locate the order with the id from the\n            /// given request\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToFindOrder(Orders.OrderRequest request)\n            {\n                return Invariant($\"Unable to locate order with id {request.OrderId}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to process the given order request\n            /// that has zero quantity\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ZeroQuantity(Orders.OrderRequest request)\n            {\n                return Invariant($\"Unable to {request.OrderRequestType.ToLower()} order with id {request.OrderId} that has zero quantity.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the user has not requested data for the symbol of the given\n            /// request. It also advises the user on how to add this data\n            /// </summary>\n            /// <param name=\"request\"></param>\n            /// <returns></returns>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MissingSecurity(Orders.SubmitOrderRequest request)\n            {\n                return Invariant($\"You haven't requested {request.Symbol} data. Add this with AddSecurity() in the Initialize() Method.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given order request operation is not allowed\n            /// in Initialize or during warm up. It also advises the user on where it is allowed\n            /// to make it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string WarmingUp(Orders.OrderRequest request)\n            {\n                return Invariant($@\"This operation is not allowed in Initialize or during warm up: OrderRequest.{\n                    request.OrderRequestType}. Please move this code to the OnWarmupFinished() method.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.OrderTicket\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OrderTicket\n        {\n            /// <summary>\n            /// Returns a string message saying it was impossible to get the given field on the order type from the given\n            /// ticket\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string GetFieldError(Orders.OrderTicket ticket, OrderField field)\n            {\n                return Invariant($\"Unable to get field {field} on order of type {ticket.SubmitRequest.OrderType}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the order associated with the given ticket has already received a\n            /// cancellation request\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string CancelRequestAlreadySubmitted(Orders.OrderTicket ticket)\n            {\n                return Invariant($\"Order {ticket.OrderId} has already received a cancellation request.\");\n            }\n\n            /// <summary>\n            /// Parses the given order ticket into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.OrderTicket ticket, Orders.Order order, int requestCount, int responseCount)\n            {\n                var counts = Invariant($\"Request Count: {requestCount} Response Count: {responseCount}\");\n                if (order != null)\n                {\n                    return Invariant($\"{ticket.OrderId}: {order} {counts}\");\n                }\n\n                return Invariant($\"{ticket.OrderId}: {counts}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.StopLimitOrder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class StopLimitOrder\n        {\n            /// <summary>\n            /// Returns an empty string as a tag\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string Tag(Orders.StopLimitOrder order)\n            {\n                // No additional information to display\n                return string.Empty;\n            }\n\n            /// <summary>\n            /// Parses the given StopLimitOrder object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.StopLimitOrder order)\n            {\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency);\n                return Invariant($@\"{Order.ToString(order)} at stop {currencySymbol}{order.StopPrice.SmartRounding()\n                    } limit {currencySymbol}{order.LimitPrice.SmartRounding()}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.StopMarketOrder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class StopMarketOrder\n        {\n            /// <summary>\n            /// Returns an empty string as a tag\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string Tag(Orders.StopMarketOrder order)\n            {\n                // No additional information to display\n                return string.Empty;\n            }\n\n            /// <summary>\n            /// Parses a given StopMarketOrder object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.StopMarketOrder order)\n            {\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency);\n                return Invariant($\"{Order.ToString(order)} at stop {currencySymbol}{order.StopPrice.SmartRounding()}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.TrailingStopOrder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class TrailingStopOrder\n        {\n            /// <summary>\n            /// Returns a tag message for the given TrailingStopOrder\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string Tag(Orders.TrailingStopOrder order)\n            {\n                return Invariant($\"Trailing Amount: {TrailingAmount(order)}\");\n            }\n\n            /// <summary>\n            /// Parses a TrailingStopOrder into a string\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.TrailingStopOrder order)\n            {\n                var currencySymbol = QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency);\n                return Invariant($@\"{Order.ToString(order)} at stop {currencySymbol}{order.StopPrice.SmartRounding()}. Trailing amount: {\n                    TrailingAmountImpl(order, currencySymbol)}\");\n            }\n\n            /// <summary>\n            /// Returns a TrailingAmount string representation for the given TrailingStopOrder\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TrailingAmount(Orders.TrailingStopOrder order)\n            {\n                return TrailingAmountImpl(order, QuantConnect.Currencies.GetCurrencySymbol(order.PriceCurrency));\n            }\n\n            /// <summary>\n            /// Returns a message for the given TrailingAmount and PriceCurrency values taking into account if the trailing is as percentage\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TrailingAmount(decimal trailingAmount, bool trailingAsPercentage, string priceCurrency)\n            {\n                return trailingAsPercentage ? Invariant($\"{trailingAmount * 100}%\") : Invariant($\"{priceCurrency}{trailingAmount}\");\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            private static string TrailingAmountImpl(Orders.TrailingStopOrder order, string currencySymbol)\n            {\n                return TrailingAmount(order.TrailingAmount, order.TrailingAsPercentage, currencySymbol);\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.SubmitOrderRequest\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SubmitOrderRequest\n        {\n            /// <summary>\n            /// Parses a given SubmitOrderRequest object to a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.SubmitOrderRequest request)\n            {\n                // create a proxy order object to steal its ToString method\n                var proxy = Orders.Order.CreateOrder(request);\n                return Invariant($\"{request.Time} UTC: Submit Order: ({request.OrderId}) - {proxy} {request.Tag} Status: {request.Status} Async: {request.Asynchronous}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Orders.UpdateOrderRequest\"/> class and its consumers or related classes\n        /// </summary>\n        public static class UpdateOrderRequest\n        {\n            /// <summary>\n            /// Parses an UpdateOrderRequest to a string\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Orders.UpdateOrderRequest request)\n            {\n                var updates = new List<string>(4);\n                if (request.Quantity.HasValue)\n                {\n                    updates.Add(Invariant($\"Quantity: {request.Quantity.Value}\"));\n                }\n                if (request.LimitPrice.HasValue)\n                {\n                    updates.Add(Invariant($\"LimitPrice: {request.LimitPrice.Value.SmartRounding()}\"));\n                }\n                if (request.StopPrice.HasValue)\n                {\n                    updates.Add(Invariant($\"StopPrice: {request.StopPrice.Value.SmartRounding()}\"));\n                }\n                if (request.TrailingAmount.HasValue)\n                {\n                    updates.Add(Invariant($\"TrailingAmount: {request.TrailingAmount.Value.SmartRounding()}\"));\n                }\n                if (request.TriggerPrice.HasValue)\n                {\n                    updates.Add(Invariant($\"TriggerPrice: {request.TriggerPrice.Value.SmartRounding()}\"));\n                }\n\n                return Invariant($@\"{request.Time} UTC: Update Order: ({request.OrderId}) - {string.Join(\", \", updates)} {\n                    request.Tag} Status: {request.Status}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Python.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Collections.Generic;\n\nusing Python.Runtime;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Python\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python\"/> namespace classes\n        /// </summary>\n        public static class PythonCommon\n        {\n            /// <summary>\n            /// Returns a string message saying the given attribute must be implemented on the given Python type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string AttributeNotImplemented(string attribute, PyType pythonType)\n            {\n                return $\"{attribute} must be implemented. Please implement this missing method on {pythonType}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.MarginCallModelPythonWrapper\"/> namespace classes\n        /// </summary>\n        public static class MarginCallModelPythonWrapper\n        {\n            /// <summary>\n            /// String message saying: Must return a tuple, where the first item is a list and the second a boolean\n            /// </summary>\n            public static string GetMarginCallOrdersMustReturnTuple = \"Must return a tuple, where the first item is a list and the second a boolean\";\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.PandasConverter\"/> namespace classes\n        /// </summary>\n        public static class PandasConverter\n        {\n            /// <summary>\n            /// String message saying: Pandas module was not imported\n            /// </summary>\n            public static string PandasModuleNotImported = \"pandas module was not imported.\";\n\n            /// <summary>\n            /// Returns a string message saying ConvertToDictionary() method cannot be used to convert the given source\n            /// type into the given target type. It also contains the reason why this method cannot be used\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ConvertToDictionaryFailed(string sourceType, string targetType, string reason)\n            {\n                return $\"ConvertToDictionary cannot be used to convert a {sourceType} into {targetType}. Reason: {reason}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.PandasData\"/> namespace classes\n        /// </summary>\n        public static class PandasData\n        {\n            /// <summary>\n            /// Returns a string message saying the given key was duplicated in the given\n            /// type class\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DuplicateKey(string duplicateKey, string type)\n            {\n                return $\"More than one '{duplicateKey}' member was found in '{type}' class.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given key does not exist in series dictionary\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string KeyNotFoundInSeries(string key)\n            {\n                return $\"{key} key does not exist in series dictionary.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.PythonInitializer\"/> namespace classes\n        /// </summary>\n        public static class PythonInitializer\n        {\n            /// <summary>\n            /// String message saying: start\n            /// </summary>\n            public static string Start = \"start\";\n\n            /// <summary>\n            /// String message saying: ended\n            /// </summary>\n            public static string Ended = \"ended\";\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to find algorithm location path\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToLocateAlgorithm(string algorithmLocation)\n            {\n                return $\"Unable to find algorithm location path: {algorithmLocation}.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given path to virtual environment does not exist\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string VirutalEnvironmentNotFound(string virtualEnvPath)\n            {\n                return $\"Path {virtualEnvPath} to virtual environment does not exist.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to find system package configuration\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToFindSystemPackagesConfiguration(string virtualEnvPath, FileInfo configFile)\n            {\n                return $@\"virtual env '{virtualEnvPath}'. Failed to find system packages configuration. ConfigFile.Exits: {\n                    configFile.Exists}. Will default to true.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the Python Initializer will use the system packages found\n            /// in the virtual environment path\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SystemPackagesConfigurationFound(string virtualEnvPath, bool includeSystemPackages)\n            {\n                return $\"virtual env '{virtualEnvPath}'. Will use system packages: {includeSystemPackages}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to find the given python path\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string PythonPathNotFound(string pythonPath)\n            {\n                return $\"Unable to find python path: {pythonPath}. Skipping.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.PythonWrapper\"/> namespace classes\n        /// </summary>\n        public static class PythonWrapper\n        {\n            /// <summary>\n            /// String message saying: expected and interface type parameter\n            /// </summary>\n            public static string ExpectedInterfaceTypeParameter = \"expected an interface type parameter.\";\n\n            /// <summary>\n            /// Returns a string message saying the given interface must be fully implemented. It also advises the user\n            /// on the missing methods in its interface\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InterfaceNotFullyImplemented(string interfaceName, string pythonTypeName, IEnumerable<string> missingMembers)\n            {\n                return $@\"{interfaceName} must be fully implemented. Please implement these missing methods on {\n                    pythonTypeName}: {string.Join(\", \", missingMembers)}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing common messages for the <see cref=\"Python.BasePythonWrapper{TInterface}\"/> class\n        /// </summary>\n        public static class BasePythonWrapper\n        {\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidDictionaryValueType(string pythonMethodName, Type expectedType, PyType actualPyType)\n            {\n                return InvalidDictionaryItemType(pythonMethodName, expectedType, actualPyType, isKey: false);\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidDictionaryKeyType(string pythonMethodName, Type expectedType, PyType actualPyType)\n            {\n                return InvalidDictionaryItemType(pythonMethodName, expectedType, actualPyType, isKey: true);\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidReturnTypeForMethodWithOutParameters(string pythonMethodName, PyType pyValueType)\n            {\n                return $\"Invalid return type from method '{pythonMethodName.ToSnakeCase()}'. Expected a tuple type but was \" +\n                    $\"'{GetPythonTypeName(pyValueType)}'. The tuple must contain the return value as the first item, \" +\n                    $\"with the remaining ones being the out parameters.\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidReturnTypeTupleSizeForMethodWithOutParameters(string pythonMethodName, long expectedSize, long actualSize)\n            {\n                return $\"Invalid return type from method '{pythonMethodName.ToSnakeCase()}'. Expected a tuple with at least \" +\n                    $\"'{expectedSize}' items but only '{actualSize}' were returned. \" +\n                    $\"The tuple must contain the return value as the first item, with the remaining ones being the out parameters.\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOutParameterType(string pythonMethodName, int index, Type expectedType, PyType actualPyType)\n            {\n                return $\"Invalid out parameter type in method '{pythonMethodName.ToSnakeCase()}'. Out parameter in position {index} \" +\n                    $\"expected type is '{expectedType.Name}' but was '{GetPythonTypeName(actualPyType)}'.\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidReturnType(string pythonName, Type expectedType, PyType actualPyType, bool isMethod = true)\n            {\n                var message = isMethod\n                    ? $\"Invalid return type from method '{pythonName.ToSnakeCase()}'. \"\n                    : $\"Invalid type for property '{pythonName.ToSnakeCase()}'. \";\n                message += $\"Expected a type convertible to '{expectedType.Name}' but was '{GetPythonTypeName(actualPyType)}'\";\n                return message;\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidIterable(string pythonMethodName, Type expectedType, PyType actualPyType)\n            {\n                return $\"Invalid return type from method '{pythonMethodName.ToSnakeCase()}'. \" +\n                    $\"Expected an iterable type of '{expectedType.Name}' items but was '{GetPythonTypeName(actualPyType)}'\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidMethodIterableItemType(string pythonMethodName, Type expectedType, PyType actualPyType)\n            {\n                return $\"Invalid return type from method '{pythonMethodName.ToSnakeCase()}'. Expected all the items in the iterator to be of type \" +\n                    $\"'{expectedType.Name}' but found one of type ' {GetPythonTypeName(actualPyType)}'\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            private static string InvalidDictionaryItemType(string pythonMethodName, Type expectedType, PyType actualPyType, bool isKey = true)\n            {\n                return $\"Invalid value type from method or property '{pythonMethodName.ToSnakeCase()}'. \" +\n                    $\"Expected all the {(isKey ? \"keys\" : \"values\")} in the dictionary to be of type '{expectedType.Name}' \" +\n                    $\"but found one of type '{GetPythonTypeName(actualPyType)}'\";\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            private static string GetPythonTypeName(PyType pyType)\n            {\n                return pyType.Name.Split('.').Last();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.QuantConnect.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nusing Python.Runtime;\n\nusing QuantConnect.Interfaces;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"QuantConnect\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"AlphaRuntimeStatistics\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AlphaRuntimeStatistics\n        {\n            /// <summary>\n            /// Returns a string message saying: Return Over Maximum Drawdown\n            /// </summary>\n            public static string ReturnOverMaximumDrawdownKey = \"Return Over Maximum Drawdown\";\n\n            /// <summary>\n            /// Returns a string message saying: Portfolio Turnover\n            /// </summary>\n            public static string PortfolioTurnoverKey = \"Portfolio Turnover\";\n\n            /// <summary>\n            /// Returns a string message saying: Total Insights Generated\n            /// </summary>\n            public static string TotalInsightsGeneratedKey = \"Total Insights Generated\";\n\n            /// <summary>\n            /// Returns a string message saying: Total Insights Closed\n            /// </summary>\n            public static string TotalInsightsClosedKey = \"Total Insights Closed\";\n\n            /// <summary>\n            /// Returns a string message saying: Total Insights Analysis Completed\n            /// </summary>\n            public static string TotalInsightsAnalysisCompletedKey = \"Total Insights Analysis Completed\";\n\n            /// <summary>\n            /// Returns a string message saying: Long Insight Count\n            /// </summary>\n            public static string LongInsightCountKey = \"Long Insight Count\";\n\n            /// <summary>\n            /// Returns a string message saying: Short Insight Count\n            /// </summary>\n            public static string ShortInsightCountKey = \"Short Insight Count\";\n\n            /// <summary>\n            /// Returns a string message saying: Long/Short Ratio\n            /// </summary>\n            public static string LongShortRatioKey = \"Long/Short Ratio\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Chart\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Chart\n        {\n            /// <summary>\n            /// Returns a string message saying Chart series name already exists\n            /// </summary>\n            public static string ChartSeriesAlreadyExists = \"Chart series name already exists\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.ChartPoint\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ChartPoint\n        {\n            /// <summary>\n            /// Parses a given ChartPoint object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(QuantConnect.ChartPoint instance)\n            {\n                return Invariant($\"{instance.Time:o} - {instance.y}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Candlestick\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Candlestick\n        {\n            /// <summary>\n            /// Parses a given Candlestick object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(QuantConnect.Candlestick instance)\n            {\n                return Invariant($@\"{instance.Time:o} - (O:{instance.Open} H: {instance.High} L: {\n                    instance.Low} C: {instance.Close})\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Currencies\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Currencies\n        {\n            /// <summary>\n            /// Returns a string message saying the given value cannot be converted to a decimal number\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedConversionToDecimal(string value)\n            {\n                return $\"The value {value} cannot be converted to a decimal number\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.ExtendedDictionary{T}\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ExtendedDictionary\n        {\n            /// <summary>\n            /// Returns a string message saying the types deriving from ExtendedDictionary must implement the void Clear() method\n            /// </summary>\n            public static string ClearMethodNotImplemented = \"Types deriving from 'ExtendedDictionary' must implement the 'void Clear() method.\";\n\n            /// <summary>\n            /// Returns a string message saying the types deriving from ExtendedDictionary must implement the void Remove(Symbol) method\n            /// </summary>\n            public static string RemoveMethodNotImplemented =\n                \"Types deriving from 'ExtendedDictionary' must implement the 'void Remove(Symbol) method.\";\n\n            /// <summary>\n            /// Returns a string message saying the types deriving from ExtendedDictionary must implement the T this[Symbol] method\n            /// </summary>\n            public static string IndexerBySymbolNotImplemented =\n                \"Types deriving from 'ExtendedDictionary' must implement the 'T this[Symbol] method.\";\n\n            /// <summary>\n            /// Returns a string message saying Clear/clear method call is an invalid operation. It also says that the given instance\n            /// is a read-only collection\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ClearInvalidOperation<TKey, TValue>(ExtendedDictionary<TKey, TValue> instance)\n            {\n                return $\"Clear/clear method call is an invalid operation. {instance.GetType().Name} is a read-only collection.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying that Remove/pop call method is an invalid operation. It also says that the given instance\n            /// is a read-only collection\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string RemoveInvalidOperation<TKey, TValue>(ExtendedDictionary<TKey, TValue> instance)\n            {\n                return $\"Remove/pop method call is an invalid operation. {instance.GetType().Name} is a read-only collection.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the given ticker was not found in the SymbolCache. It also gives a recommendation\n            /// for solving this problem\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TickerNotFoundInSymbolCache(string ticker)\n            {\n                return $\"The ticker {ticker} was not found in the SymbolCache. Use the Symbol object as key instead. \" +\n                    \"Accessing the securities collection/slice object by string ticker is only available for securities added with \" +\n                    \"the AddSecurity-family methods. For more details, please check out the documentation.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the popitem method is not supported for the given instance\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string PopitemMethodNotSupported<TKey, TValue>(ExtendedDictionary<TKey, TValue> instance)\n            {\n                return $\"popitem method is not supported for {instance.GetType().Name}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the given symbol wasn't found in the give instance object. It also shows\n            /// a recommendation for solving this problem\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string KeyNotFoundDueToNoData<TKey, TValue>(ExtendedDictionary<TKey, TValue> instance, TKey key)\n            {\n                return $\"'{key}' wasn't found in the {instance.GetType().Name} object, likely because there was no-data at this moment in \" +\n                    \"time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with \" +\n                    $\"data.ContainsKey(\\\"{key}\\\"). The collection is read-only, cannot set default.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the update method call is an invalid operation. It also mentions that the given\n            /// instance is a read-only collection\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UpdateInvalidOperation<TKey, TValue>(ExtendedDictionary<TKey, TValue> instance)\n            {\n                return $\"update method call is an invalid operation. {instance.GetType().Name} is a read-only collection.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Extensions\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Extensions\n        {\n            /// <summary>\n            /// Returns a string message saying adjusting a symbol by an offset is currently only supported for non canonical futures\n            /// </summary>\n            public static string ErrorAdjustingSymbolByOffset =\n                \"Adjusting a symbol by an offset is currently only supported for non canonical futures\";\n\n            /// <summary>\n            /// Returns a string message saying the provided DataProvider instance is null\n            /// </summary>\n            public static string NullDataProvider =\n                $\"The provided '{nameof(IDataProvider)}' instance is null. Are you missing some initialization step?\";\n\n            /// <summary>\n            /// Returns a string message saying the source cannot be null or empty\n            /// </summary>\n            public static string NullOrEmptySourceToConvertToHexString = \"Source cannot be null or empty.\";\n\n            /// <summary>\n            /// Returns a string message saying the CreateOptionChain method requires an option symbol\n            /// </summary>\n            public static string CreateOptionChainRequiresOptionSymbol = \"CreateOptionChain requires an option symbol.\";\n\n            /// <summary>\n            /// Returns a string message saying the CreateFutureChain method requires a future symbol\n            /// </summary>\n            public static string CreateFutureChainRequiresFutureSymbol = \"CreateFutureChain requires a future symbol.\";\n\n            /// <summary>\n            /// Returns a string message saying the list of values cannot be empty\n            /// </summary>\n            public static string GreatestCommonDivisorEmptyList = \"The list of values cannot be empty\";\n\n            /// <summary>\n            /// Returns a string message saying that the symbol for which a mirror contract is being created is not a valid option symbol\n            /// </summary>\n            public static string NotAValidOptionSymbolForMirror = \"Cannot create mirror contract for non-option symbol or canonical option symbol\";\n\n            /// <summary>\n            /// Returns a string message saying the process of downloading data from the given url failed\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DownloadDataFailed(string url)\n            {\n                return $\"failed for: '{url}'\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the security does not have an accurate price as it has not yet received\n            /// a bar of data, as well as some recommendations\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ZeroPriceForSecurity(QuantConnect.Symbol symbol)\n            {\n                return $\"{symbol}: The security does not have an accurate price as it has not yet received a bar of data. \" +\n                    \"Before placing a trade (or using SetHoldings) warm up your algorithm with SetWarmup, or use slice.Contains(symbol) \" +\n                    \"to confirm the Slice object has price before using the data. Data does not necessarily all arrive at the same \" +\n                    \"time so your algorithm should confirm the data is ready before using it. In live trading this can mean you do \" +\n                    \"not have an active subscription to the asset class you're trying to trade. If using custom data make sure you've \" +\n                    \"set the 'Value' property.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying: Waiting for the given thread to stop\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string WaitingForThreadToStopSafely(string threadName)\n            {\n                return $\"Waiting for '{threadName}' thread to stop...\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying: Timeout waiting for the given thread to stop\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TimeoutWaitingForThreadToStopSafely(string threadName)\n            {\n                return $\"Timeout waiting for '{threadName}' thread to stop\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given data type is missing a parameterless constructor\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DataTypeMissingParameterlessConstructor(Type type)\n            {\n                return $\"Data type '{type.Name}' missing parameterless constructor. E.g. public {type.Name}() {{ }}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the process of creating an instance of the given type failed\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToCreateInstanceOfType(Type type)\n            {\n                return $\"Failed to create instance of type '{type.Name}'\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given data type does not inherit the required BaseData\n            /// methods and/or attributes\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TypeIsNotBaseData(Type type)\n            {\n                return $\"Data type '{type.Name}' does not inherit required {nameof(Data.BaseData)}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it is impossible to cast the given non-finite floating-point value\n            /// as a decimal\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string CannotCastNonFiniteFloatingPointValueToDecimal(double input)\n            {\n                return Invariant($@\"It is not possible to cast a non-finite floating-point value ({\n                    input}) as decimal. Please review math operations and verify the result is valid.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was not able to exactly convert the given time span to resolution\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToConvertTimeSpanToResolution(TimeSpan timeSpan)\n            {\n                return Invariant($\"Unable to exactly convert time span ('{timeSpan}') to resolution.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was attempted to parse the given unknown security type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToParseUnknownSecurityType(string value)\n            {\n                return $\"Attempted to parse unknown SecurityType: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given security type has no default OptionStyle, because it has no options\n            /// available for it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoDefaultOptionStyleForSecurityType(SecurityType securityType)\n            {\n                return Invariant($\"The SecurityType {securityType} has no default OptionStyle, because it has no options available for it\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given OptionStyle was unexpected/unknown\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnknownOptionStyle(string value)\n            {\n                return $\"Unexpected OptionStyle: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given OptionStyle was unexpected/unknown\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnknownOptionStyle(OptionStyle value)\n            {\n                return $\"Unexpected OptionStyle: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given OptionRight was unexpected/unknown\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnknownOptionRight(string value)\n            {\n                return $\"Unexpected OptionRight: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given OptionRight was unexpected/unknown\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnknownOptionRight(OptionRight value)\n            {\n                return $\"Unexpected OptionRight: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given DataMappingMode was unexpected/unknown\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnknownDataMappingMode(string value)\n            {\n                return $\"Unexpected DataMappingMode: {value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the method ConvertToDictionary cannot be used to convert a given source\n            /// type into another given target type. It also specifies the reason.\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ConvertToDictionaryFailed(string sourceType, string targetType, string reason)\n            {\n                return $\"ConvertToDictionary cannot be used to convert a {sourceType} into {targetType}. Reason: {reason}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given argument type should Symbol or a list of Symbol. It also\n            /// shows the given item as well as its Python type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ConvertToSymbolEnumerableFailed(PyObject item)\n            {\n                return $\"Argument type should be Symbol or a list of Symbol. Object: {item}. Type: {item.GetPythonType()}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given object is not a C# type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ObjectFromPythonIsNotACSharpType(string objectRepr)\n            {\n                return $\"{objectRepr} is not a C# Type.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying there was a RuntimeError at a given time in UTC. It also\n            /// shows the given context\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string RuntimeError(IAlgorithm algorithm, string context)\n            {\n                return Invariant($\"RuntimeError at {algorithm.UtcTime} UTC. Context: {context}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Holding\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Holding\n        {\n            /// <summary>\n            /// Parses a Holding object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(QuantConnect.Holding instance)\n            {\n                var currencySymbol = instance.CurrencySymbol;\n                if (string.IsNullOrEmpty(currencySymbol))\n                {\n                    currencySymbol = \"$\";\n                }\n                var value = Invariant($@\"{instance.Symbol?.Value}: {instance.Quantity} @ {\n                    currencySymbol}{instance.AveragePrice} - Market: {currencySymbol}{instance.MarketPrice}\");\n\n                if (instance.ConversionRate.HasValue && instance.ConversionRate != 1m)\n                {\n                    value += Invariant($\" - Conversion: {instance.ConversionRate}\");\n                }\n\n                return value;\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.AlgorithmControl\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AlgorithmControl\n        {\n            /// <summary>\n            /// Returns a string message saying: Strategy Equity\n            /// </summary>\n            public static string ChartSubscription = \"Strategy Equity\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Isolator\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Isolator\n        {\n            /// <summary>\n            /// Returns a string message saying: Execution Security Error: Memory Usage Maxed out, with the max memory capacity\n            /// and a last sample of the usage\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MemoryUsageMaxedOut(string memoryCap, string lastSample)\n            {\n                return $\"Execution Security Error: Memory Usage Maxed Out - {memoryCap}MB max, with last sample of {lastSample}MB.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying: Execution Security Error: Memory usage over 80% capacity, and the last sample taken\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MemoryUsageOver80Percent(double lastSample)\n            {\n                return Invariant($\"Execution Security Error: Memory usage over 80% capacity. Sampled at {lastSample}\");\n            }\n\n            /// <summary>\n            /// Returns a string message with useful information about the memory usage, such us the memory used, the last sample\n            /// the current memory used by the given app and the CPU usage\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MemoryUsageInfo(string memoryUsed, string lastSample, string memoryUsedByApp, TimeSpan currentTimeStepElapsed,\n                int cpuUsage)\n            {\n                return Invariant($@\"Used: {memoryUsed}, Sample: {lastSample}, App: {memoryUsedByApp}, CurrentTimeStepElapsed: {\n                    currentTimeStepElapsed:mm':'ss'.'fff}. CPU: {cpuUsage}%\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying: Execution Security Error: Operation timed out, with the maximum amount of minutes\n            /// allowed\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MemoryUsageMonitorTaskTimedOut(TimeSpan timeout)\n            {\n                return $@\"Execution Security Error: Operation timed out - {\n                    timeout.TotalMinutes.ToStringInvariant()} minutes max. Check for recursive loops.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Market\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Market\n        {\n            /// <summary>\n            /// Returns a string message saying the market identifier is limited to positive values less than the given maximum market identifier\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidMarketIdentifier(int maxMarketIdentifier)\n            {\n                return $\"The market identifier is limited to positive values less than {maxMarketIdentifier.ToStringInvariant()}.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was attempted to add an already added market with a different identifier\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TriedToAddExistingMarketWithDifferentIdentifier(string market)\n            {\n                return $\"Attempted to add an already added market with a different identifier. Market: {market}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was attempted to add a market identifier that is already in use\n            /// </summary>\n            /// <returns></returns>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TriedToAddExistingMarketIdentifier(string market, string existingMarket)\n            {\n                return $\"Attempted to add a market identifier that is already in use. New Market: {market} Existing Market: {existingMarket}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.OS\"/> class and its consumers or related classes\n        /// </summary>\n        public static class OS\n        {\n            /// <summary>\n            /// CPU Usage string\n            /// </summary>\n            public static string CPUUsageKey = \"CPU Usage\";\n\n            /// <summary>\n            /// Used RAM (MB) string\n            /// </summary>\n            public static string UsedRAMKey = \"Used RAM (MB)\";\n\n            /// <summary>\n            /// Total RAM (MB) string\n            /// </summary>\n            public static string TotalRAMKey = \"Total RAM (MB)\";\n\n            /// <summary>\n            /// Hostname string\n            /// </summary>\n            public static string HostnameKey = \"Hostname\";\n\n            /// <summary>\n            /// LEAN Version string\n            /// </summary>\n            public static string LEANVersionKey = \"LEAN Version\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Parse\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Parse\n        {\n            /// <summary>\n            /// Returns a string message saying the provided input was not parseable as the given target type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ValueIsNotParseable(string input, Type targetType)\n            {\n                return $\"The provided value ({input}) was not parseable as {targetType.Name}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.SecurityIdentifier\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityIdentifier\n        {\n            /// <summary>\n            /// Returns a string message saying no underlying was specified for certain identifier\n            /// </summary>\n            public static string NoUnderlyingForIdentifier =\n                \"No underlying specified for this identifier. Check that HasUnderlying is true before accessing the Underlying property.\";\n\n            /// <summary>\n            /// Returns a string message saying Date is only defined for SecurityType.Equity, SecurityType.Option, SecurityType.Future, SecurityType.FutureOption, SecurityType.IndexOption, and SecurityType.Base\n            /// </summary>\n            public static string DateNotSupportedBySecurityType =\n                \"Date is only defined for SecurityType.Equity, SecurityType.Option, SecurityType.Future, SecurityType.FutureOption, SecurityType.IndexOption, and SecurityType.Base\";\n\n            /// <summary>\n            /// Returns a string message saying StrikePrice is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\n            /// </summary>\n            public static string StrikePriceNotSupportedBySecurityType =\n                \"StrikePrice is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\";\n\n            /// <summary>\n            /// Returns a string message saying OptionRight is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\n            /// </summary>\n            public static string OptionRightNotSupportedBySecurityType =\n                \"OptionRight is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\";\n\n            /// <summary>\n            /// Returns a string message saying OptionStyle is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\n            /// </summary>\n            public static string OptionStyleNotSupportedBySecurityType =\n                \"OptionStyle is only defined for SecurityType.Option, SecurityType.FutureOption, and SecurityType.IndexOption\";\n\n            /// <summary>\n            /// Returns a string message saying SecurityIdentifier requires a non-null string 'symbol'\n            /// </summary>\n            public static string NullSymbol = \"SecurityIdentifier requires a non-null string 'symbol'\";\n\n            /// <summary>\n            /// Returns a string message saying Symbol must not contain the characters '|' or ' '\n            /// </summary>\n            public static string SymbolWithInvalidCharacters = \"Symbol must not contain the characters '|' or ' '.\";\n\n            /// <summary>\n            /// Returns a string message saying the provided properties do not match with a valid SecurityType\n            /// </summary>\n            public static string PropertiesDoNotMatchAnySecurityType = $\"The provided properties do not match with a valid {nameof(SecurityType)}\";\n\n            /// <summary>\n            /// Returns a string message saying the string must be splittable on space into two parts\n            /// </summary>\n            public static string StringIsNotSplittable = \"The string must be splittable on space into two parts.\";\n\n            /// <summary>\n            /// Returns a string message saying object must be of type SecurityIdentifier\n            /// </summary>\n            public static string UnexpectedTypeToCompareTo = $\"Object must be of type {nameof(SecurityIdentifier)}\";\n\n            /// <summary>\n            /// Returns a string message saying the given parameter must be between 0 and 99\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidSecurityType(string parameterName)\n            {\n                return $\"{parameterName} must be between 0 and 99\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given parameter must be either 0 or 1\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOptionRight(string parameterName)\n            {\n                return $\"{parameterName} must be either 0 or 1\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the specified strike price's precision is too high\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidStrikePrice(decimal strikePrice)\n            {\n                return Invariant($\"The specified strike price's precision is too high: {strikePrice}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying there was an error parsing SecurityIdentifier. It also says the given error and exception\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ErrorParsingSecurityIdentifier(string value, Exception exception)\n            {\n                return Invariant($\"Error parsing SecurityIdentifier: '{value}', Exception: {exception}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given market could not be found in the markets lookup\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MarketNotFound(string market)\n            {\n                return $@\"The specified market wasn't found in the markets lookup. Requested: {\n                    market}. You can add markets by calling QuantConnect.Market.Add(string,int)\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.StringExtensions\"/> class and its consumers or related classes\n        /// </summary>\n        public static class StringExtensions\n        {\n            /// <summary>\n            /// Returns a string message saying StringExtensinos.ConvertInvariant does not support converting to the given TypeCode\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ConvertInvariantCannotConvertTo(TypeCode targetTypeCode)\n            {\n                return $\"StringExtensions.ConvertInvariant does not support converting to TypeCode.{targetTypeCode}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Symbol\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Symbol\n        {\n            /// <summary>\n            /// Returns a string message saying there is insufficient information for creating certain future option symbol\n            /// </summary>\n            public static string InsufficientInformationToCreateFutureOptionSymbol =\n                \"Cannot create future option Symbol using this method (insufficient information). Use `CreateOption(Symbol, ...)` instead.\";\n\n            /// <summary>\n            /// Returns a string message saying Canonical is only defined for SecurityType.Option, SecurityType.Future, SecurityType.FutureOption\n            /// </summary>\n            public static string CanonicalNotDefined =\n                \"Canonical is only defined for SecurityType.Option, SecurityType.Future, SecurityType.FutureOption\";\n\n            /// <summary>\n            /// Returns a string message saying certain object must be of type Symbol or string\n            /// </summary>\n            public static string UnexpectedObjectTypeToCompareTo = \"Object must be of type Symbol or string.\";\n\n            /// <summary>\n            /// Returns a string message saying the given security type has not been implemented yet\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SecurityTypeNotImplementedYet(SecurityType securityType)\n            {\n                return Invariant($\"The security type has not been implemented yet: {securityType}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given security can not be mapped\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SecurityTypeCannotBeMapped(SecurityType securityType)\n            {\n                return Invariant($\"SecurityType {securityType} can not be mapped.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying no option type exists for the given underlying SecurityType\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoOptionTypeForUnderlying(SecurityType securityType)\n            {\n                return Invariant($\"No option type exists for underlying SecurityType: {securityType}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying no underlying type exists for the given option SecurityType\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoUnderlyingForOption(SecurityType securityType)\n            {\n                return Invariant($\"No underlying type exists for option SecurityType: {securityType}\");\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SidNotForOption(QuantConnect.SecurityIdentifier sid)\n            {\n                return Invariant($\"The provided SecurityIdentifier is not for an option: {sid}\");\n            }\n\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnderlyingSidDoesNotMatch(QuantConnect.SecurityIdentifier sid, QuantConnect.Symbol underlying)\n            {\n                return Invariant($\"The provided SecurityIdentifier does not match the underlying symbol: {sid} != {underlying.ID}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.SymbolCache\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SymbolCache\n        {\n            /// <summary>\n            /// Returns a string message saying the given ticker could not be localized\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToLocateTicker(string ticker)\n            {\n                return $\"We were unable to locate the ticker '{ticker}'.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying mutiple potentially matching tickers were localized\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MultipleMatchingTickersLocated(IEnumerable<string> tickers)\n            {\n                return \"We located multiple potentially matching tickers. \" +\n                    \"For custom data, be sure to append a dot followed by the custom data type name. \" +\n                    $\"For example: 'BTC.Bitcoin'. Potential Matches: {string.Join(\", \", tickers)}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.SymbolRepresentation\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SymbolRepresentation\n        {\n            /// <summary>\n            /// Returns a string message saying SymbolRepresentation failed to get market for the given ticker and underlying\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToGetMarketForTickerAndUnderlying(string ticker, string underlying)\n            {\n                return $\"Failed to get market for future '{ticker}' and underlying '{underlying}'\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying no market was found for the given ticker\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoMarketFound(string ticker)\n            {\n                return $\"No market found for '{ticker}'\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying an unexpected security type was received by the given method name\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedSecurityTypeForMethod(string methodName, SecurityType securityType)\n            {\n                return Invariant($\"{methodName} expects symbol to be an option, received {securityType}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given ticker is not in the expected OSI format\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidOSITickerFormat(string ticker)\n            {\n                return $\"Invalid ticker format {ticker}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given security type is not implemented\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SecurityTypeNotImplemented(SecurityType securityType)\n            {\n                return Invariant($\"Security type {securityType} not implemented\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.SymbolValueJsonConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SymbolValueJsonConverter\n        {\n            /// <summary>\n            /// String message saying converter is write only\n            /// </summary>\n            public static string ConverterIsWriteOnly = \"The SymbolValueJsonConverter is write-only.\";\n\n            /// <summary>\n            /// String message saying converter is intended to be directly decorated in member\n            /// </summary>\n            public static string ConverterIsIntendedToBeDirectlyDecoratedInMember =\n                \"The SymbolValueJsonConverter is intended to be decorated on the appropriate member directly.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.Time\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Time\n        {\n            /// <summary>\n            /// Invalid Bar Size string message\n            /// </summary>\n            public static string InvalidBarSize = \"barSize must be greater than TimeSpan.Zero\";\n\n            /// <summary>\n            /// Returns a string message containing the number of securities\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SecurityCount(int count)\n            {\n                return $\"Security Count: {count}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"QuantConnect.TradingCalendar\"/> class and its consumers or related classes\n        /// </summary>\n        public static class TradingCalendar\n        {\n            /// <summary>\n            /// Returns a string message for invalid total days\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidTotalDays(int totalDays)\n            {\n                return Invariant($@\"Total days is negative ({\n                    totalDays\n                    }), indicating reverse start and end times. Check your usage of TradingCalendar to ensure proper arrangement of variables\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Securities.Positions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities.Positions;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Securities.Positions\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.Positions.PositionGroup\"/> class and its consumers or related classes\n        /// </summary>\n        public static class PositionGroup\n        {\n            /// <summary>\n            /// Returns a string message saying the given quantity is invalid. It also contains the quantities from the\n            /// given positions as well as the unit quantities\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidQuantity(decimal quantity, IEnumerable<IPosition> positions)\n            {\n                return Invariant($@\"The given quantity {quantity\n                    } must be equal to the ratio between the quantity and unit quantity for each position. Quantities were {\n                    string.Join(\", \", positions.Select(position => position.Quantity))}. Unit quantities were {\n                    string.Join(\", \", positions.Select(position => position.UnitQuantity))}.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Messages/Messages.Securities.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Text;\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides user-facing message construction methods and static messages for the <see cref=\"Securities\"/> namespace\n    /// </summary>\n    public static partial class Messages\n    {\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.AccountEvent\"/> class and its consumers or related classes\n        /// </summary>\n        public static class AccountEvent\n        {\n            /// <summary>\n            /// Returns a string message containing basic information about the given accountEvent\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.AccountEvent accountEvent)\n            {\n                return Invariant($\"Account {accountEvent.CurrencySymbol} Balance: {accountEvent.CashBalance:0.00}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.BuyingPowerModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class BuyingPowerModel\n        {\n            /// <summary>\n            /// String message saying: Initial margin requirement must be between 0 and 1\n            /// </summary>\n            public static string InvalidInitialMarginRequirement = \"Initial margin requirement must be between 0 and 1\";\n\n            /// <summary>\n            /// String messsage saying: Maintenance margin requirement must be between 0 and 1 \n            /// </summary>\n            public static string InvalidMaintenanceMarginRequirement = \"Maintenance margin requirement must be between 0 and 1\";\n\n            /// <summary>\n            /// String message saying: Free Buying Power Percent requirement must be between 0 and 1\n            /// </summary>\n            public static string InvalidFreeBuyingPowerPercentRequirement = \"Free Buying Power Percent requirement must be between 0 and 1\";\n\n            /// <summary>\n            /// String message saying: Leverage must be greater than or equal to 1\n            /// </summary>\n            public static string InvalidLeverage = \"Leverage must be greater than or equal to 1.\";\n\n            /// <summary>\n            /// Returns a string message saying the order associated with the id of the given order is null\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InsufficientBuyingPowerDueToNullOrderTicket(Orders.Order order)\n            {\n                return Invariant($\"Null order ticket for id: {order.Id}\");\n            }\n\n            /// <summary>\n            /// Returns a string mesage containing information about the order ID, the initial margin and\n            /// the free margin\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InsufficientBuyingPowerDueToUnsufficientMargin(Orders.Order order,\n                decimal initialMarginRequiredForRemainderOfOrder, decimal freeMargin)\n            {\n                return Invariant($@\"Id: {order.Id}, Initial Margin: {\n                    initialMarginRequiredForRemainderOfOrder.Normalize()}, Free Margin: {freeMargin.Normalize()}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given target order margin is less than the given minimum value\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TargetOrderMarginNotAboveMinimum(decimal absDifferenceOfMargin, decimal minimumValue)\n            {\n                return Invariant($\"The target order margin {absDifferenceOfMargin} is less than the minimum {minimumValue}.\");\n            }\n            \n            /// <summary>\n            /// Returns a string message warning the user that the Portfolio rebalance result ignored as it resulted in\n            /// a single share trade recommendation which can generate high fees.\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TargetOrderMarginNotAboveMinimum()\n            {\n                return \"Warning: Portfolio rebalance result ignored as it resulted in a single share trade recommendation which can generate high fees.\" +\n                    \" To disable minimum order size checks please set Settings.MinimumOrderMarginPortfolioPercentage = 0.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying that the order quantity is less that the lot size of the given security\n            /// and that it has been rounded to zero\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderQuantityLessThanLotSize(Securities.Security security, decimal targetOrderMargin)\n            {\n                return Invariant($@\"The order quantity is less than the lot size of {\n                    security.SymbolProperties.LotSize} and has been rounded to zero. Target order margin {targetOrderMargin}. \");\n            }\n\n            /// <summary>\n            /// Returns a string message saying GetMaximumOrderQuantityForTargetBuyingPower failed to converge on the target margin.\n            /// It also contains useful information to reproduce the issue\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToConvergeOnTheTargetMargin(GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters,\n                decimal signedTargetFinalMarginValue, decimal orderFees)\n            {\n                return Invariant($@\"GetMaximumOrderQuantityForTargetBuyingPower failed to converge on the target margin: {\n                    signedTargetFinalMarginValue}; the following information can be used to reproduce the issue. Total Portfolio Cash: {\n                    parameters.Portfolio.Cash}; Security : {parameters.Security.Symbol.ID}; Price : {parameters.Security.Close}; Leverage: {\n                    parameters.Security.Leverage}; Order Fee: {orderFees}; Lot Size: {\n                    parameters.Security.SymbolProperties.LotSize}; Current Holdings: {parameters.Security.Holdings.Quantity} @ {\n                    parameters.Security.Holdings.AveragePrice}; Target Percentage: %{parameters.TargetBuyingPower * 100};\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing basic information related with the underlying security such as the price,\n            /// the holdings and the average price of them\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToConvergeOnTheTargetMarginUnderlyingSecurityInfo(Securities.Security underlying)\n            {\n                return Invariant($@\"Underlying Security: {underlying.Symbol.ID}; Underlying Price: {\n                    underlying.Close}; Underlying Holdings: {underlying.Holdings.Quantity} @ {underlying.Holdings.AveragePrice};\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the margin is being adjusted in the wrong direction. It also provides useful information to\n            /// reproduce the issue\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MarginBeingAdjustedInTheWrongDirection(decimal targetMargin, decimal marginForOneUnit, Securities.Security security)\n            {\n                return Invariant(\n                    $@\"Margin is being adjusted in the wrong direction. Reproduce this issue with the following variables, Target Margin: {\n                        targetMargin}; MarginForOneUnit: {marginForOneUnit}; Security Holdings: {security.Holdings.Quantity} @ {\n                        security.Holdings.AveragePrice}; LotSize: {security.SymbolProperties.LotSize}; Price: {security.Close}; Leverage: {\n                        security.Leverage}\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing basic information related with the underlying security such as the price,\n            /// the holdings and the average price of them\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string MarginBeingAdjustedInTheWrongDirectionUnderlyingSecurityInfo(Securities.Security underlying)\n            {\n                return Invariant($@\"Underlying Security: {underlying.Symbol.ID}; Underlying Price: {\n                    underlying.Close}; Underlying Holdings: {underlying.Holdings.Quantity} @ {underlying.Holdings.AveragePrice};\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.Positions.PositionGroupBuyingPowerModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class PositionGroupBuyingPowerModel\n        {\n            /// <summary>\n            /// String message saying: No buying power used, delta cannot be applied\n            /// </summary>\n            public static string DeltaCannotBeApplied = \"No buying power used, delta cannot be applied\";\n\n            /// <summary>\n            /// Returns a string message saying the zero initial margin requirement was computed\n            /// for the given position group\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ComputedZeroInitialMargin(IPositionGroup positionGroup)\n            {\n                return Invariant($\"Computed zero initial margin requirement for {positionGroup.GetUserFriendlyName()}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the position group order quantity has been rounded to zero\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string PositionGroupQuantityRoundedToZero(decimal targetOrderMargin)\n            {\n                return Invariant($\"The position group order quantity has been rounded to zero. Target order margin {targetOrderMargin}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the process to converge on the given target margin failed\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToConvergeOnTargetMargin(decimal targetMargin, decimal positionGroupQuantity, decimal orderFees,\n                GetMaximumLotsForTargetBuyingPowerParameters parameters)\n            {\n                return Invariant($@\"Failed to converge on the target margin: {targetMargin}; the following information can be used to reproduce the issue. Total Portfolio Cash: {parameters.Portfolio.Cash}; Position group: {parameters.PositionGroup.GetUserFriendlyName()}; Position group order quantity: {positionGroupQuantity} Order Fee: {orderFees}; Current Holdings: {parameters.PositionGroup.Quantity}; Target Percentage: %{parameters.TargetBuyingPower * 100};\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.Cash\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Cash\n        {\n            /// <summary>\n            /// String message saying: Cash symbols cannot be null or empty\n            /// </summary>\n            public static string NullOrEmptyCashSymbol = \"Cash symbols cannot be null or empty.\";\n\n            /// <summary>\n            /// Returns a string message saying no tradeable pair was found for the given currency symbol. It also mentions\n            /// that the given account currency will be set to zero\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoTradablePairFoundForCurrencyConversion(string cashCurrencySymbol, string accountCurrency,\n                IEnumerable<KeyValuePair<SecurityType, string>> marketMap)\n            {\n                return Invariant($@\"No tradeable pair was found for currency {cashCurrencySymbol}, conversion rate to account currency ({\n                    accountCurrency}) will be set to zero. Markets: [{string.Join(\",\", marketMap.Select(x => $\"{x.Key}:{x.Value}\"))}]\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the security symbol is being added for cash currency feed (this comes from the\n            /// given cash currency symbol)\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string AddingSecuritySymbolForCashCurrencyFeed(QuantConnect.Symbol symbol, string cashCurrencySymbol)\n            {\n                return Invariant($\"Adding {symbol.Value} {symbol.ID.Market} for cash {cashCurrencySymbol} currency feed\");\n            }\n\n            /// <summary>\n            /// Parses the given Cash object into a string containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.Cash cash, string accountCurrency)\n            {\n                // round the conversion rate for output\n                var rate = cash.ConversionRate;\n                rate = rate < 1000 ? rate.RoundToSignificantDigits(5) : Math.Round(rate, 2);\n                return Invariant($@\"{cash.Symbol}: {cash.CurrencySymbol}{cash.Amount,15:0.00} @ {rate,10:0.00####} = {\n                    QuantConnect.Currencies.GetCurrencySymbol(accountCurrency)}{Math.Round(cash.ValueInAccountCurrency, 2)}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.CashBook\"/> class and its consumers or related classes\n        /// </summary>\n        public static class CashBook\n        {\n            /// <summary>\n            /// String message saying: Unexpected request for NullCurrency Cash instance\n            /// </summary>\n            public static string UnexpectedRequestForNullCurrency = \"Unexpected request for NullCurrency Cash instance\";\n\n            /// <summary>\n            /// Returns a string message saying the conversion rate for the given currency is not available\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ConversionRateNotFound(string currency)\n            {\n                return Invariant($\"The conversion rate for {currency} is not available.\");\n            }\n\n            /// <summary>\n            /// Parses the given CashBook into a string mesage with basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.CashBook cashBook)\n            {\n                var sb = new StringBuilder();\n                sb.AppendLine(Invariant($\"Symbol {\"Quantity\",13}    {\"Conversion\",10} = Value in {cashBook.AccountCurrency}\"));\n                foreach (var value in cashBook.Values)\n                {\n                    sb.AppendLine(value.ToString(cashBook.AccountCurrency));\n                }\n                sb.AppendLine(\"-------------------------------------------------\");\n                sb.AppendLine(Invariant($@\"CashBook Total Value:                {\n                    QuantConnect.Currencies.GetCurrencySymbol(cashBook.AccountCurrency)}{\n                    Math.Round(cashBook.TotalValueInAccountCurrency, 2).ToStringInvariant()}\"));\n\n                return sb.ToString();\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given cash symbol was not found\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string CashSymbolNotFound(string symbol)\n            {\n                return $\"This cash symbol ({symbol}) was not found in your cash book.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to remove the cash book record\n            /// for the given symbol\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToRemoveRecord(string symbol)\n            {\n                return $\"Failed to remove the cash book record for symbol {symbol}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.CashBuyingPowerModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class CashBuyingPowerModel\n        {\n            /// <summary>\n            /// String message saying: CashBuyingPowerModel does not allow setting leverage. Cash accounts have no leverage\n            /// </summary>\n            public static string UnsupportedLeverage = \"CashBuyingPowerModel does not allow setting leverage. Cash accounts have no leverage.\";\n\n            /// <summary>\n            /// String message saying: The CashBuyingPowerModel does not require GetMaximumOrderQuantityForDeltaBuyingPower\n            /// </summary>\n            public static string GetMaximumOrderQuantityForDeltaBuyingPowerNotImplemented =\n                $@\"The {nameof(CashBuyingPowerModel)} does not require '{\n                    nameof(Securities.CashBuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower)}'.\";\n\n            /// <summary>\n            /// String message saying: The cash model does not allow shorting\n            /// </summary>\n            public static string ShortingNotSupported = \"The cash model does not allow shorting.\";\n\n            /// <summary>\n            /// String message saying: The security type must be Crypto or Forex\n            /// </summary>\n            public static string InvalidSecurity = $\"The security type must be {nameof(SecurityType.Crypto)}or {nameof(SecurityType.Forex)}.\";\n\n            /// <summary>\n            /// Returns a string message saying: The security is not supported by this cash model. It also mentioned that\n            /// currently just crypt and forex securities are supported\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnsupportedSecurity(Securities.Security security)\n            {\n                return $@\"The '{security.Symbol.Value}' security is not supported by this cash model. Currently only {\n                    nameof(SecurityType.Crypto)} and {nameof(SecurityType.Forex)} are supported.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying Cash Modeling trading does not permit short holdings as well as portfolio\n            /// holdings and an advise to ensure the user is selling only what it has\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SellOrderShortHoldingsNotSupported(decimal totalQuantity, decimal openOrdersReservedQuantity, decimal orderQuantity,\n                IBaseCurrencySymbol baseCurrency)\n            {\n                return Invariant($@\"Your portfolio holds {totalQuantity.Normalize()} {\n                    baseCurrency.BaseCurrency.Symbol}, {openOrdersReservedQuantity.Normalize()} {\n                    baseCurrency.BaseCurrency.Symbol} of which are reserved for open orders, but your Sell order is for {\n                    orderQuantity.Normalize()} {baseCurrency.BaseCurrency.Symbol\n                    }. Cash Modeling trading does not permit short holdings so ensure you only sell what you have, including any additional open orders.\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing the portfolio holdings, the buy order and the maximum buying power\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string BuyOrderQuantityGreaterThanMaxForBuyingPower(decimal totalQuantity, decimal maximumQuantity,\n                decimal openOrdersReservedQuantity, decimal orderQuantity, IBaseCurrencySymbol baseCurrency, Securities.Security security,\n                Orders.Order order)\n            {\n                return Invariant($@\"Your portfolio holds {totalQuantity.Normalize()} {\n                    security.QuoteCurrency.Symbol}, {openOrdersReservedQuantity.Normalize()} {\n                    security.QuoteCurrency.Symbol} of which are reserved for open orders, but your Buy order is for {\n                    order.AbsoluteQuantity.Normalize()} {baseCurrency.BaseCurrency.Symbol}. Your order requires a total value of {\n                    orderQuantity.Normalize()} {security.QuoteCurrency.Symbol}, but only a total value of {\n                    Math.Abs(maximumQuantity).Normalize()} {security.QuoteCurrency.Symbol} is available.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the internal cash feed required for converting the quote currency, from the given security,\n            /// to the target account currency, from the given portfolio, does not have any data\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoDataInInternalCashFeedYet(Securities.Security security, Securities.SecurityPortfolioManager portfolio)\n            {\n                return Invariant($@\"The internal cash feed required for converting {security.QuoteCurrency.Symbol} to {\n                    portfolio.CashBook.AccountCurrency} does not have any data yet (or market may be closed).\");\n            }\n\n            /// <summary>\n            /// Returns a string mesasge saying the contract multiplier for the given security is zero\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ZeroContractMultiplier(Securities.Security security)\n            {\n                return $@\"The contract multiplier for the {\n                    security.Symbol.Value} security is zero. The symbol properties database may be out of date.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the order quantity is less than the lot size for the given security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderQuantityLessThanLotSize(Securities.Security security)\n            {\n                return Invariant($@\"The order quantity is less than the lot size of {\n                    security.SymbolProperties.LotSize} and has been rounded to zero.\");\n            }\n\n            /// <summary>\n            /// Returns a string message containing information about the target order value, the order fees and\n            /// the order quantity\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderQuantityLessThanLotSizeOrderDetails(decimal targetOrderValue, decimal orderQuantity, decimal orderFees)\n            {\n                return Invariant($\"Target order value {targetOrderValue}. Order fees {orderFees}. Order quantity {orderQuantity}.\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying GetMaximumOrderQuantityForTargetBuyingPower failed to converge to\n            /// the given target order value\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string FailedToConvergeOnTargetOrderValue(decimal targetOrderValue, decimal currentOrderValue, decimal orderQuantity,\n                decimal orderFees, Securities.Security security)\n            {\n                return Invariant($@\"GetMaximumOrderQuantityForTargetBuyingPower failed to converge to target order value {\n                    targetOrderValue}. Current order value is {currentOrderValue}. Order quantity {orderQuantity}. Lot size is {\n                    security.SymbolProperties.LotSize}. Order fees {orderFees}. Security symbol {security.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.DefaultMarginCallModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DefaultMarginCallModel\n        {\n            /// <summary>\n            /// String message saying: Margin Call\n            /// </summary>\n            public static string MarginCallOrderTag = \"Margin Call\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.DynamicSecurityData\"/> class and its consumers or related classes\n        /// </summary>\n        public static class DynamicSecurityData\n        {\n            /// <summary>\n            /// String message saying: DynamicSecurityData is a view of the SecurityCache. It is readonly, properties can not bet set\n            /// </summary>\n            public static string PropertiesCannotBeSet =\n                \"DynamicSecurityData is a view of the SecurityCache. It is readonly, properties can not be set\";\n\n            /// <summary>\n            /// Returns a string message saying no property exists with the given name\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string PropertyNotFound(string name)\n            {\n                return $\"Property with name '{name}' does not exist.\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying a list of the given type was expected but the one found was of the given data type\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnexpectedTypesForGetAll(Type type, object data)\n            {\n                return $\"Expected a list with type '{type.GetBetterTypeName()}' but found type '{data.GetType().GetBetterTypeName()}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.EquityPriceVariationModel\"/> class and its consumers or related classes\n        /// </summary>\n        public static class EquityPriceVariationModel\n        {\n            /// <summary>\n            /// Returns a string message saying the type of the given security was invalid\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string InvalidSecurityType(Securities.Security security)\n            {\n                return Invariant($\"Invalid SecurityType: {security.Type}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.ErrorCurrencyConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class ErrorCurrencyConverter\n        {\n            /// <summary>\n            /// String message saying: Unexpected usage of ErrorCurrencyConverter.AccountCurrency\n            /// </summary>\n            public static string AccountCurrencyUnexpectedUsage = \"Unexpected usage of ErrorCurrencyConverter.AccountCurrency\";\n\n            /// <summary>\n            /// String message saying: This method purposefully throws as a proof that a test does not depend on a currency converter\n            /// </summary>\n            public static string ConvertToAccountCurrencyPurposefullyThrow =\n                $@\"This method purposefully throws as a proof that a test does not depend on {\n                    nameof(ICurrencyConverter)}. If this exception is encountered, it means the test DOES depend on {\n                     nameof(ICurrencyConverter)} and should be properly updated to use a real implementation of {nameof(ICurrencyConverter)}.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.FuncSecuritySeeder\"/> class and its consumers or related classes\n        /// </summary>\n        public static class FuncSecuritySeeder\n        {\n            /// <summary>\n            /// Returns a string message with basic information about the given BaseData object\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SeededSecurityInfo(BaseData seedData)\n            {\n                return $\"Seeded security: {seedData.Symbol.Value}: {seedData.GetType()} {seedData.Value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to seed the given security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToSeedSecurity(Securities.Security security)\n            {\n                return $\"Unable to seed security: {security.Symbol.Value}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to seed price for the given security\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToSecurityPrice(Securities.Security security)\n            {\n                return $\"Could not seed price for security {security.Symbol}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.IdentityCurrencyConverter\"/> class and its consumers or related classes\n        /// </summary>\n        public static class IdentityCurrencyConverter\n        {\n            /// <summary>\n            /// String message saying: The IdentityCurrencyConverter can only handle CashAmounts in units of the account currency\n            /// </summary>\n            public static string UnableToHandleCashInNonAccountCurrency =\n                $\"The {nameof(Securities.IdentityCurrencyConverter)} can only handle CashAmounts in units of the account currency\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.InitialMarginParameters\"/> class and its consumers or related classes\n        /// </summary>\n        public static class InitialMarginParameters\n        {\n            /// <summary>\n            /// String message saying: ForUnderlying is only invokable for IDerivativeSecurity (Option|Future)\n            /// </summary>\n            public static string ForUnderlyingOnlyInvokableForIDerivativeSecurity =\n                \"ForUnderlying is only invokable for IDerivativeSecurity (Option|Future)\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.LocalMarketHours\"/> class and its consumers or related classes\n        /// </summary>\n        public static class LocalMarketHours\n        {\n            /// <summary>\n            /// Parses the given LocalMarketHours object into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.LocalMarketHours instance)\n            {\n                if (instance.IsClosedAllDay)\n                {\n                    return \"Closed All Day\";\n                }\n\n                if (instance.IsOpenAllDay)\n                {\n                    return \"Open All Day\";\n                }\n\n                return Invariant($\"{instance.DayOfWeek}: {string.Join(\" | \", instance.Segments)}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.MaintenanceMarginParameters\"/> class and its consumers or related classes\n        /// </summary>\n        public static class MaintenanceMarginParameters\n        {\n            /// <summary>\n            /// String message saying: ForUnderlying is only invokable for IDerivativeSecurity\n            /// </summary>\n            public static string ForUnderlyingOnlyInvokableForIDerivativeSecurity =\n                \"ForUnderlying is only invokable for IDerivativeSecurity (Option|Future)\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.MarketHoursDatabase\"/> class and its consumers or related classes\n        /// </summary>\n        public static class MarketHoursDatabase\n        {\n            /// <summary>\n            /// String message saying: Future.Usa market type is no longer supported as we mapped each ticker to its actual exchange\n            /// </summary>\n            public static string FutureUsaMarketTypeNoLongerSupported =\n                \"Future.Usa market type is no longer supported as we mapped each ticker to its actual exchange. \" +\n                \"Please find your specific market in the symbol-properties database.\";\n\n            /// <summary>\n            /// Returns a string message saying it was impossible to locate exchange hours for the given key. It also\n            /// mentiones the available keys\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ExchangeHoursNotFound(Securities.SecurityDatabaseKey key,\n                IEnumerable<Securities.SecurityDatabaseKey> availableKeys = null)\n            {\n                var keys = \"\";\n                if (availableKeys != null)\n                {\n                    keys = \" Available keys: \" + string.Join(\", \", availableKeys);\n                }\n\n                return $\"Unable to locate exchange hours for {key}.{keys}\";\n            }\n\n            /// <summary>\n            /// Returns a string message that suggests the given market based on the provided ticker\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SuggestedMarketBasedOnTicker(string market)\n            {\n                return $\"Suggested market based on the provided ticker 'Market.{market.ToUpperInvariant()}'.\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.MarketHoursSegment\"/> class and its consumers or related classes\n        /// </summary>\n        public static class MarketHoursSegment\n        {\n            /// <summary>\n            /// String message saying: Extended market open time must be less than or equal to market open time\n            /// </summary>\n            public static string InvalidExtendedMarketOpenTime = \"Extended market open time must be less than or equal to market open time.\";\n\n            /// <summary>\n            /// String message saying: Market close time must be after market open time\n            /// </summary>\n            public static string InvalidMarketCloseTime = \"Market close time must be after market open time.\";\n\n            /// <summary>\n            /// String message saying: Extended market close time must be greater than or equal to market close time\n            /// </summary>\n            public static string InvalidExtendedMarketCloseTime = \"Extended market close time must be greater than or equal to market close time.\";\n\n            /// <summary>\n            /// Parses a MarketHourSegment object into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.MarketHoursSegment instance)\n            {\n                return $\"{instance.State}: {instance.Start.ToStringInvariant(null)}-{instance.End.ToStringInvariant(null)}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.RegisteredSecurityDataTypesProvider\"/> class and its consumers or related classes\n        /// </summary>\n        public static class RegisteredSecurityDataTypesProvider\n        {\n            /// <summary>\n            /// Returns a string message saying two different types were detected trying to register the same type name. It also\n            /// mentions the two different types\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TwoDifferentTypesDetectedForTheSameTypeName(Type type, Type existingType)\n            {\n                return $\"Two different types were detected trying to register the same type name: {existingType} - {type}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.Security\"/> class and its consumers or related classes\n        /// </summary>\n        public static class Security\n        {\n            /// <summary>\n            /// String message saying: Security requires a valid SymbolProperties instance\n            /// </summary>\n            public static string ValidSymbolPropertiesInstanceRequired = \"Security requires a valid SymbolProperties instance.\";\n\n            /// <summary>\n            /// String message saying: symbolProperties.QuoteCurrency must match the quoteCurrency.Symbol\n            /// </summary>\n            public static string UnmatchingQuoteCurrencies = \"symbolProperties.QuoteCurrency must match the quoteCurrency.Symbol\";\n\n            /// <summary>\n            /// String message saying: Security.SetLocalTimeKeeper(LocalTimeKeeper) must be called in order to use the LocalTime property\n            /// </summary>\n            public static string SetLocalTimeKeeperMustBeCalledBeforeUsingLocalTime =\n                \"Security.SetLocalTimeKeeper(LocalTimeKeeper) must be called in order to use the LocalTime property.\";\n\n            /// <summary>\n            /// String message saying: Symbols must match\n            /// </summary>\n            public static string UnmatchingSymbols = \"Symbols must match.\";\n\n            /// <summary>\n            /// String message saying: ExchangeTimeZones must match\n            /// </summary>\n            public static string UnmatchingExchangeTimeZones = \"ExchangeTimeZones must match.\";\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityDatabaseKey\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityDatabaseKey\n        {\n            /// <summary>\n            /// Returns a string message saying the specified and given key was not in the expected format\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string KeyNotInExpectedFormat(string key)\n            {\n                return $\"The specified key was not in the expected format: {key}\";\n            }\n\n            /// <summary>\n            /// Parses a SecurityDatabaseKey into a string message with basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.SecurityDatabaseKey instance)\n            {\n                return Invariant($\"{instance.SecurityType}-{instance.Market}-{instance.Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityDefinitionSymbolResolver\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityDefinitionSymbolResolver\n        {\n            /// <summary>\n            /// Returns a string message saying no security definitions data have been loaded from the given file\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string NoSecurityDefinitionsLoaded(string securitiesDefinitionKey)\n            {\n                return $\"No security definitions data loaded from file: {securitiesDefinitionKey}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityExchangeHours\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityExchangeHours\n        {\n            /// <summary>\n            /// Returns an error message when the next market open could not be located within two weeks.\n            /// Includes additional guidance if the market is always open (e.g., crypto assets).\n            /// </summary>\n            public static string UnableToLocateNextMarketOpenInTwoWeeks(bool isMarketAlwaysOpen)\n            {\n                var message = \"Unable to locate next market open within two weeks.\";\n                if (!isMarketAlwaysOpen)\n                {\n                    return message;\n                }\n                message += \" Market is always open for this asset, this can happen e.g. if using TimeRules AfterMarketOpen for a crypto asset. \" +\n                    \"An alternative would be TimeRules.At(), TimeRules.Every(), TimeRules.Midnight or TimeRules.Noon instead\";\n                return message;\n            }\n\n            /// <summary>\n            /// Returns an error message when the next market close could not be located within two weeks.\n            /// Includes additional guidance if the market is always open (e.g., crypto assets).\n            /// </summary>\n            public static string UnableToLocateNextMarketCloseInTwoWeeks(bool isMarketAlwaysOpen)\n            {\n                var message = \"Unable to locate next market close within two weeks.\";\n                if (!isMarketAlwaysOpen)\n                {\n                    return message;\n                }\n                message += \" Market is always open for this asset, this can happen e.g. if using TimeRules BeforeMarketClose for a crypto asset. \" +\n                    \"An alternative would be TimeRules.At(), TimeRules.Every(), TimeRules.Midnight or TimeRules.Noon instead\";\n                return message;\n            }\n\n            /// <summary>\n            /// Returns a string message saying it did not find last market open for the given local date time. It also mentions\n            /// if the market is always open or not\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string LastMarketOpenNotFound(DateTime localDateTime, bool isMarketAlwaysOpen)\n            {\n                return $\"Did not find last market open for {localDateTime}. IsMarketAlwaysOpen: {isMarketAlwaysOpen}\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityHolding\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityHolding\n        {\n            /// <summary>\n            /// Parses the given SecurityHolding object into a string message containing basic information about it\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.SecurityHolding instance)\n            {\n                return Invariant($\"{instance.Symbol.Value}: {instance.Quantity} @ {instance.AveragePrice}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityManager\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityManager\n        {\n            /// <summary>\n            /// Returns a string message saying the given symbol was not found in the user security list\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SymbolNotFoundInSecurities(QuantConnect.Symbol symbol)\n            {\n                return Invariant($@\"This asset symbol ({\n                    symbol}) was not found in your security list. Please add this security or check it exists before using it with 'Securities.ContainsKey(\"\"{\n                    QuantConnect.SymbolCache.GetTicker(symbol)}\"\")'\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the given symbol could not be overwritten\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToOverwriteSecurity(QuantConnect.Symbol symbol)\n            {\n                return Invariant($\"Unable to overwrite existing Security: {symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityPortfolioManager\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityPortfolioManager\n        {\n            /// <summary>\n            /// Returns a string message saying Portfolio object is an adaptor for Security Manager and that to add a new asset\n            /// the required data should added during initialization\n            /// </summary>\n            public static string DictionaryAddNotImplemented =\n                \"Portfolio object is an adaptor for Security Manager. To add a new asset add the required data during initialization.\";\n\n            /// <summary>\n            /// Returns a string message saying the Portfolio object object is an adaptor for Security Manager and cannot be cleared\n            /// </summary>\n            public static string DictionaryClearNotImplemented = \"Portfolio object is an adaptor for Security Manager and cannot be cleared.\";\n\n            /// <summary>\n            /// Returns a string message saying the Portfolio object is an adaptor for Security Manager and objects cannot be removed\n            /// </summary>\n            public static string DictionaryRemoveNotImplemented = \"Portfolio object is an adaptor for Security Manager and objects cannot be removed.\";\n\n            /// <summary>\n            /// Returns a string message saying the AccountCurrency cannot be changed after adding a Security and that the method\n            /// SetAccountCurrency() should be moved before AddSecurity()\n            /// </summary>\n            public static string CannotChangeAccountCurrencyAfterAddingSecurity =\n                \"Cannot change AccountCurrency after adding a Security. Please move SetAccountCurrency() before AddSecurity().\";\n\n            /// <summary>\n            /// Returns a string message saying the AccountCurrency cannot be changed after setting cash and that the method\n            /// SetAccountCurrency() should be moved before SetCash()\n            /// </summary>\n            public static string CannotChangeAccountCurrencyAfterSettingCash =\n                \"Cannot change AccountCurrency after setting cash. Please move SetAccountCurrency() before SetCash().\";\n\n            /// <summary>\n            /// Returns a string message saying the AccountCurrency has already been set and that the new value for this property\n            /// will be ignored\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string AccountCurrencyAlreadySet(Securities.CashBook cashBook, string newAccountCurrency)\n            {\n                return $\"account currency has already been set to {cashBook.AccountCurrency}. Will ignore new value {newAccountCurrency}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the AccountCurrency is being set to the given account currency\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SettingAccountCurrency(string accountCurrency)\n            {\n                return $\"setting account currency to {accountCurrency}\";\n            }\n\n            /// <summary>\n            /// Returns a string message saying the total margin information, this is, the total margin used as well as the\n            /// margin remaining\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string TotalMarginInformation(decimal totalMarginUsed, decimal marginRemaining)\n            {\n                return Invariant($\"Total margin information: TotalMarginUsed: {totalMarginUsed:F2}, MarginRemaining: {marginRemaining:F2}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the order request margin information, this is, the margin used and the margin remaining\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderRequestMarginInformation(decimal marginUsed, decimal marginRemaining)\n            {\n                return Invariant($\"Order request margin information: MarginUsed: {marginUsed:F2}, MarginRemaining: {marginRemaining:F2}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityService\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityService\n        {\n            /// <summary>\n            /// Returns a string message saying the given Symbol could not be found in the Symbol Properties Database\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string SymbolNotFoundInSymbolPropertiesDatabase(QuantConnect.Symbol symbol)\n            {\n                return $\"{symbol.SecurityType} '{symbol.Value}' symbol could not be found in the database for {symbol.ID.Market} market\";\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SecurityTransactionManager\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SecurityTransactionManager\n        {\n            /// <summary>\n            /// Returns a string message saying CancelOpenOrders operation is not allowed in Initialize or during warm up\n            /// </summary>\n            public static string CancelOpenOrdersNotAllowedOnInitializeOrWarmUp =\n                \"This operation is not allowed in Initialize or during warm up: CancelOpenOrders. Please move this code to the OnWarmupFinished() method.\";\n\n            /// <summary>\n            /// Returns a string message saying the order was canceled by the CancelOpenOrders() at the given time\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderCanceledByCancelOpenOrders(DateTime time)\n            {\n                return Invariant($\"Canceled by CancelOpenOrders() at {time:o}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the ticket for the given order ID could not be localized\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string UnableToLocateOrderTicket(int orderId)\n            {\n                return Invariant($\"Unable to locate ticket for order: {orderId}\");\n            }\n\n            /// <summary>\n            /// Returns a string message saying the order did not fill within the given amount of seconds\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string OrderNotFilledWithinExpectedTime(TimeSpan fillTimeout)\n            {\n                return Invariant($\"Order did not fill within {fillTimeout.TotalSeconds} seconds.\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SymbolProperties\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SymbolProperties\n        {\n            /// <summary>\n            /// String message saying the SymbolProperties LotSize can not be less than or equal to 0\n            /// </summary>\n            public static string InvalidLotSize = \"SymbolProperties LotSize can not be less than or equal to 0\";\n\n            /// <summary>\n            /// String message saying the SymbolProperties PriceMagnifier can not be less than or equal to 0\n            /// </summary>\n            public static string InvalidPriceMagnifier = \"SymbolProprties PriceMagnifier can not be less than or equal to 0\";\n\n            /// <summary>\n            /// String message saying the SymbolProperties StrikeMultiplier can not be less than or equal to 0\n            /// </summary>\n            public static string InvalidStrikeMultiplier = \"SymbolProperties StrikeMultiplier can not be less than or equal to 0\";\n\n            /// <summary>\n            /// Parses a given SymbolProperties object into a string message\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string ToString(Securities.SymbolProperties instance)\n            {\n                var marketTicker = \",\";\n                var minimumOrderSize = marketTicker;\n                var priceMagnifier = marketTicker;\n                if (!string.IsNullOrEmpty(instance.MarketTicker))\n                {\n                    marketTicker = $\",{instance.MarketTicker}\";\n                }\n                if (instance.MinimumOrderSize != null)\n                {\n                    minimumOrderSize = Invariant($\",{instance.MinimumOrderSize}\");\n                }\n                if (instance.PriceMagnifier != 1)\n                {\n                    priceMagnifier = Invariant($\",{instance.PriceMagnifier}\");\n                }\n\n                return Invariant($@\"{instance.Description},{instance.QuoteCurrency},{instance.ContractMultiplier},{\n                    instance.MinimumPriceVariation},{instance.LotSize}{marketTicker}{minimumOrderSize}{priceMagnifier}\");\n            }\n        }\n\n        /// <summary>\n        /// Provides user-facing messages for the <see cref=\"Securities.SymbolPropertiesDatabase\"/> class and its consumers or related classes\n        /// </summary>\n        public static class SymbolPropertiesDatabase\n        {\n            //public static string InvalidLotSize = \"SymbolProperties LotSize can not be less than or equal to 0\";\n\n            /// <summary>\n            /// Returns a string saying a duplicated key was found while processing the given file\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DuplicateKeyInFile(string file, Securities.SecurityDatabaseKey key)\n            {\n                return $\"Encountered duplicate key while processing file: {file}. Key: {key}\";\n            }\n\n            /// <summary>\n            /// Returns a string saying the given symbol properties file could not be localized\n            /// </summary>\n            [MethodImpl(MethodImplOptions.AggressiveInlining)]\n            public static string DatabaseFileNotFound(string file)\n            {\n                return $\"Unable to locate symbol properties file: {file}\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Notifications/Notification.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Notifications\n{\n    /// <summary>\n    /// Local/desktop implementation of messaging system for Lean Engine.\n    /// </summary>\n    [JsonConverter(typeof(NotificationJsonConverter))]\n    public abstract class Notification\n    {\n        /// <summary>\n        /// Method for sending implementations of notification object types.\n        /// </summary>\n        /// <remarks>SMS, Email and Web are all handled by the QC Messaging Handler. To implement your own notification type implement it here.</remarks>\n        public virtual void Send()\n        {\n            //\n        }\n    }\n\n    /// <summary>\n    /// Web Notification Class\n    /// </summary>\n    public class NotificationWeb : Notification\n    {\n        /// <summary>\n        /// Optional email headers\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Dictionary<string, string> Headers { get; set; }\n\n        /// <summary>\n        /// Send a notification message to this web address\n        /// </summary>\n        public string Address { get; set; }\n\n        /// <summary>\n        /// Object data to send.\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public object Data { get; set; }\n\n        /// <summary>\n        /// Constructor for sending a notification SMS to a specified phone number\n        /// </summary>\n        /// <param name=\"address\">Address to send to</param>\n        /// <param name=\"data\">Data to send</param>\n        /// <param name=\"headers\">Optional headers to use</param>\n        public NotificationWeb(string address, object data = null, Dictionary<string, string> headers = null)\n        {\n            Address = address;\n            Data = data;\n            Headers = headers;\n        }\n    }\n\n    /// <summary>\n    /// Sms Notification Class\n    /// </summary>\n    public class NotificationSms : Notification\n    {\n        /// <summary>\n        /// Send a notification message to this phone number\n        /// </summary>\n        public string PhoneNumber { get; set; }\n\n        /// <summary>\n        /// Message to send. Limited to 160 characters\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Constructor for sending a notification SMS to a specified phone number\n        /// </summary>\n        /// <param name=\"number\"></param>\n        /// <param name=\"message\"></param>\n        public NotificationSms(string number, string message)\n        {\n            PhoneNumber = number;\n            Message = message;\n        }\n    }\n\n    /// <summary>\n    /// Email notification data.\n    /// </summary>\n    public class NotificationEmail : Notification\n    {\n        /// <summary>\n        /// Optional email headers\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Dictionary<string, string> Headers { get; set; }\n\n        /// <summary>\n        /// Send to address:\n        /// </summary>\n        public string Address { get; set; }\n\n        /// <summary>\n        /// Email subject\n        /// </summary>\n        public string Subject { get; set; }\n\n        /// <summary>\n        /// Message to send.\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Email Data\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Data { get; set; }\n\n        /// <summary>\n        /// Default constructor for sending an email notification\n        /// </summary>\n        /// <param name=\"address\">Address to send to, if null will default to users email. Will throw <see cref=\"ArgumentException\"/> if invalid\n        /// <see cref=\"Validate.EmailAddress\"/></param>\n        /// <param name=\"subject\">Subject of the email. Will set to <see cref=\"string.Empty\"/> if null</param>\n        /// <param name=\"message\">Message body of the email. Will set to <see cref=\"string.Empty\"/> if null</param>\n        /// <param name=\"data\">Data to attach to the email. Will set to <see cref=\"string.Empty\"/> if null</param>\n        /// <param name=\"headers\">Optional email headers to use</param>\n        public NotificationEmail(string address, string subject = \"\", string message = \"\", string data = \"\", Dictionary<string, string> headers = null)\n        {\n            if (!Validate.EmailAddress(address))\n            {\n                throw new ArgumentException(Messages.NotificationEmail.InvalidEmailAddress(address));\n            }\n\n            Address = address;\n            Data = data ?? string.Empty;\n            Message = message ?? string.Empty;\n            Subject = subject ?? string.Empty;\n            Headers = headers;\n        }\n    }\n\n    /// <summary>\n    /// Telegram notification data\n    /// </summary>\n    public class NotificationTelegram : Notification\n    {\n        /// <summary>\n        /// Send a notification message to this user on Telegram\n        /// Can be either a personal ID or Group ID.\n        /// </summary>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Message to send. Limited to 4096 characters\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Token to use\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Token { get; set; }\n\n        /// <summary>\n        /// Constructor for sending a telegram notification to a specific User ID\n        /// or group ID. Note: The bot must have an open chat with the user or be\n        /// added to the group for messages to deliver.\n        /// </summary>\n        /// <param name=\"id\">User Id or Group Id to send the message too</param>\n        /// <param name=\"message\">Message to send</param>\n        /// <param name=\"token\">Bot token to use, if null defaults to \"telegram-token\"\n        /// in config on send</param>\n        public NotificationTelegram(string id, string message, string token = null)\n        {\n            Id = id;\n            Message = message;\n            Token = token;\n        }\n    }\n\n    /// <summary>\n    /// FTP notification data\n    /// </summary>\n    public class NotificationFtp : Notification\n    {\n        private static readonly Regex HostnameProtocolRegex = new(@\"^[s]?ftp\\:\\/\\/\", RegexOptions.IgnoreCase | RegexOptions.Compiled);\n\n        private const int DefaultPort = 21;\n\n        /// <summary>\n        /// Whether to use SFTP or FTP.\n        /// </summary>\n        [JsonProperty(\"secure\")]\n        public bool Secure { get; }\n\n        /// <summary>\n        /// The FTP server hostname.\n        /// </summary>\n        [JsonProperty(\"host\")]\n        public string Hostname { get; }\n\n        /// <summary>\n        /// The FTP server port.\n        /// </summary>\n        [JsonProperty(\"port\")]\n        public int Port { get; }\n\n        /// <summary>\n        /// The FTP server username.\n        /// </summary>\n        [JsonProperty(\"username\")]\n        public string Username { get; }\n\n        /// <summary>\n        /// The FTP server password.\n        /// </summary>\n        [JsonProperty(\"password\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Password { get; }\n\n        /// <summary>\n        /// The path to file on the FTP server.\n        /// </summary>\n        [JsonProperty(\"fileDestinationPath\")]\n        public string FilePath { get; }\n\n        /// <summary>\n        /// The contents of the file to send.\n        /// </summary>\n        [JsonProperty(\"fileContent\")]\n        public string FileContent { get; private set; }\n\n        /// <summary>\n        /// The private key to use for authentication (optional).\n        /// </summary>\n        [JsonProperty(\"privateKey\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string PrivateKey { get; }\n\n        /// <summary>\n        /// The passphrase for the private key (optional).\n        /// </summary>\n        [JsonProperty(\"passphrase\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string PrivateKeyPassphrase { get; }\n\n        private NotificationFtp(string hostname, string username, string filePath, byte[] fileContent, bool secure, int? port)\n        {\n            Hostname = NormalizeHostname(hostname);\n            Port = port ?? DefaultPort;\n            Username = username;\n            FilePath = filePath;\n            FileContent = Convert.ToBase64String(fileContent);\n            Secure = secure;\n        }\n\n        /// <summary>\n        /// Constructor for a notification to sent as a file to an FTP server using password authentication.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"secure\">Whether to use SFTP or FTP. Defaults to true</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public NotificationFtp(string hostname, string username, string password, string filePath, byte[] fileContent,\n            bool secure = true, int? port = null)\n            : this(hostname, username, filePath, fileContent, secure, port)\n        {\n            if (string.IsNullOrEmpty(password))\n            {\n                throw new ArgumentException(Messages.NotificationFtp.MissingPassword);\n            }\n\n            Password = password;\n        }\n\n        /// <summary>\n        /// Constructor for a notification to sent as a file to an FTP server over SFTP using SSH keys.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"privateKey\">The private SSH key to use for authentication</param>\n        /// <param name=\"privateKeyPassphrase\">The optional passphrase to decrypt the private key.\n        /// This can be empty or null if the private key is not encrypted</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public NotificationFtp(string hostname, string username, string privateKey, string privateKeyPassphrase,\n            string filePath, byte[] fileContent, int? port = null)\n            : this(hostname, username, filePath, fileContent, true, port)\n        {\n            if (string.IsNullOrEmpty(privateKey))\n            {\n                throw new ArgumentException(Messages.NotificationFtp.MissingSSHKey);\n            }\n\n            PrivateKey = privateKey;\n            PrivateKeyPassphrase = privateKeyPassphrase;\n        }\n\n        /// <summary>\n        /// Constructor for a notification to sent as a file to an FTP server using password authentication.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"secure\">Whether to use SFTP or FTP. Defaults to true</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public NotificationFtp(string hostname, string username, string password, string filePath, string fileContent,\n            bool secure = true, int? port = null)\n            : this(hostname, username, password, filePath, Encoding.ASCII.GetBytes(fileContent), secure, port)\n        {\n        }\n\n        /// <summary>\n        /// Constructor for a notification to sent as a file to an FTP server over SFTP using SSH keys.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"privateKey\">The private SSH key to use for authentication</param>\n        /// <param name=\"privateKeyPassphrase\">The optional passphrase to decrypt the private key.\n        /// This can be empty or null if the private key is not encrypted</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public NotificationFtp(string hostname, string username, string privateKey, string privateKeyPassphrase,\n            string filePath, string fileContent, int? port = null)\n            : this(hostname, username, privateKey, privateKeyPassphrase, filePath, Encoding.ASCII.GetBytes(fileContent), port)\n        {\n        }\n\n        private static string NormalizeHostname(string hostname)\n        {\n            // Remove trailing slashes\n            hostname = hostname.Trim().TrimEnd('/');\n            // Remove protocol if present\n            return HostnameProtocolRegex.Replace(hostname, \"\");\n        }\n\n        /// <summary>\n        /// Factory method for Json deserialization: the file contents are already encoded\n        /// </summary>\n        internal static NotificationFtp FromEncodedData(string hostname, string username, string password, string filePath, string encodedFileContent,\n            bool secure, int? port)\n        {\n            var notification = new NotificationFtp(hostname, username, password, filePath, Array.Empty<byte>(), secure, port);\n            notification.FileContent = encodedFileContent;\n            return notification;\n        }\n\n        /// <summary>\n        /// Factory method for Json deserialization: the file contents are already encoded\n        /// </summary>\n        internal static NotificationFtp FromEncodedData(string hostname, string username, string privateKey, string privateKeyPassphrase,\n            string filePath, string encodedFileContent, int? port)\n        {\n            var notification = new NotificationFtp(hostname, username, privateKey, privateKeyPassphrase, filePath, Array.Empty<byte>(), port);\n            notification.FileContent = encodedFileContent;\n            return notification;\n        }\n    }\n\n    /// <summary>\n    /// Extension methods for <see cref=\"Notification\"/>\n    /// </summary>\n    public static class NotificationExtensions\n    {\n        /// <summary>\n        /// Check if the notification can be sent (implements the <see cref=\"Notification.Send\"/> method)\n        /// </summary>\n        /// <param name=\"notification\">The notification</param>\n        /// <returns>Whether the notification can be sent</returns>\n        public static bool CanSend(this Notification notification)\n        {\n            if (notification == null)\n            {\n                return false;\n            }\n\n            var type = notification.GetType();\n            return type != typeof(NotificationEmail) &&\n                type != typeof(NotificationWeb) &&\n                type != typeof(NotificationSms) &&\n                type != typeof(NotificationTelegram) &&\n                type != typeof(NotificationFtp);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Notifications/NotificationJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Notifications\n{\n    /// <summary>\n    /// Defines a <see cref=\"JsonConverter\"/> to be used when deserializing to the <see cref=\"Notification\"/> class.\n    /// </summary>\n    public class NotificationJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Use default implementation to write the json\n        /// </summary>\n        public override bool CanWrite => false;\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException(Messages.NotificationJsonConverter.WriteNotImplemented);\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            JToken token;\n            if (jObject.TryGetValue(\"PhoneNumber\", StringComparison.InvariantCultureIgnoreCase, out token))\n            {\n                var message = jObject.GetValue(\"Message\", StringComparison.InvariantCultureIgnoreCase);\n\n                return new NotificationSms(token.ToString(), message?.ToString());\n            }\n            else if (jObject.TryGetValue(\"Subject\", StringComparison.InvariantCultureIgnoreCase, out token))\n            {\n                var data = jObject.GetValue(\"Data\", StringComparison.InvariantCultureIgnoreCase);\n                var message = jObject.GetValue(\"Message\", StringComparison.InvariantCultureIgnoreCase);\n                var address = jObject.GetValue(\"Address\", StringComparison.InvariantCultureIgnoreCase);\n                var headers= jObject.GetValue(\"Headers\", StringComparison.InvariantCultureIgnoreCase);\n\n                return new NotificationEmail(address?.ToString(), token.ToString(), message?.ToString(), data?.ToString(), headers?.ToObject<Dictionary<string, string>>());\n            }\n            else if (jObject.TryGetValue(\"Address\", StringComparison.InvariantCultureIgnoreCase, out token))\n            {\n                var headers = jObject.GetValue(\"Headers\", StringComparison.InvariantCultureIgnoreCase);\n                var data = jObject.GetValue(\"Data\", StringComparison.InvariantCultureIgnoreCase);\n\n                return new NotificationWeb(token.ToString(), data?.ToString(), headers?.ToObject<Dictionary<string, string>>());\n            }\n            else if (jObject.TryGetValue(\"Id\", StringComparison.InvariantCultureIgnoreCase, out token))\n            {\n                var message = jObject.GetValue(\"Message\", StringComparison.InvariantCultureIgnoreCase);\n                var botToken = jObject.GetValue(\"Token\", StringComparison.InvariantCultureIgnoreCase);\n                return new NotificationTelegram(token.ToString(), message?.ToString(), botToken?.ToString());\n            }\n            else if (jObject.TryGetValue(\"host\", StringComparison.InvariantCultureIgnoreCase, out token))\n            {\n                // This is an FTP notification\n                var hostname = token.ToString();\n                var port = jObject.GetValue(\"port\", StringComparison.InvariantCultureIgnoreCase)?.ToObject<int?>();\n                var username = jObject.GetValue(\"username\", StringComparison.InvariantCultureIgnoreCase)?.ToString();\n                var filePath = jObject.GetValue(\"fileDestinationPath\", StringComparison.InvariantCultureIgnoreCase)?.ToString();\n                var fileContent = jObject.GetValue(\"fileContent\", StringComparison.InvariantCultureIgnoreCase)?.ToString();\n\n                if (jObject.TryGetValue(\"password\", StringComparison.InvariantCultureIgnoreCase, out var password))\n                {\n                    var secure = jObject.GetValue(\"secure\", StringComparison.InvariantCultureIgnoreCase)?.ToObject<bool>() ?? true;\n                    return NotificationFtp.FromEncodedData(hostname, username, password.ToString(), filePath, fileContent, secure, port);\n                }\n\n                var privateKey = jObject.GetValue(\"privateKey\", StringComparison.InvariantCultureIgnoreCase)?.ToString();\n                var passphrase = jObject.GetValue(\"passphrase\", StringComparison.InvariantCultureIgnoreCase)?.ToString();\n                return NotificationFtp.FromEncodedData(hostname, username, privateKey, passphrase, filePath, fileContent, port);\n            }\n\n            throw new NotImplementedException(Messages.NotificationJsonConverter.UnexpectedJsonObject(jObject));\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(Notification);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Notifications/NotificationManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Notifications\n{\n    /// <summary>\n    /// Local/desktop implementation of messaging system for Lean Engine.\n    /// </summary>\n    public class NotificationManager\n    {\n        private readonly bool _liveMode;\n\n        /// <summary>\n        /// Public access to the messages\n        /// </summary>\n        public ConcurrentQueue<Notification> Messages { get; set; }\n\n        /// <summary>\n        /// Initialize the messaging system\n        /// </summary>\n        public NotificationManager(bool liveMode)\n        {\n            _liveMode = liveMode;\n            Messages = new ConcurrentQueue<Notification>();\n        }\n\n        /// <summary>\n        /// Send an email to the address specified for live trading notifications.\n        /// </summary>\n        /// <param name=\"subject\">Subject of the email</param>\n        /// <param name=\"message\">Message body, up to 10kb</param>\n        /// <param name=\"data\">Data attachment (optional)</param>\n        /// <param name=\"address\">Email address to send to, if null will default to users email</param>\n        /// <param name=\"headers\">Optional email headers to use</param>\n        public bool Email(string address, string subject, string message, string data, PyObject headers)\n        {\n            return Email(address, subject, message, data, headers.ConvertToDictionary<string, string>());\n        }\n\n        /// <summary>\n        /// Send an email to the address specified for live trading notifications.\n        /// </summary>\n        /// <param name=\"subject\">Subject of the email</param>\n        /// <param name=\"message\">Message body, up to 10kb</param>\n        /// <param name=\"data\">Data attachment (optional)</param>\n        /// <param name=\"address\">Email address to send to, if null will default to users email</param>\n        /// <param name=\"headers\">Optional email headers to use</param>\n        public bool Email(string address, string subject, string message, string data = \"\", Dictionary<string, string> headers = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var email = new NotificationEmail(address, subject, message, data, headers);\n            Messages.Enqueue(email);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Send an SMS to the phone number specified\n        /// </summary>\n        /// <param name=\"phoneNumber\">Phone number to send to</param>\n        /// <param name=\"message\">Message to send</param>\n        public bool Sms(string phoneNumber, string message)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var sms = new NotificationSms(phoneNumber, message);\n            Messages.Enqueue(sms);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Place REST POST call to the specified address with the specified DATA.\n        /// Python overload for Headers parameter.\n        /// </summary>\n        /// <param name=\"address\">Endpoint address</param>\n        /// <param name=\"data\">Data to send in body JSON encoded</param>\n        /// <param name=\"headers\">Optional headers to use</param>\n        public bool Web(string address, object data, PyObject headers)\n        {\n            return Web(address, data, headers.ConvertToDictionary<string, string>());\n        }\n\n        /// <summary>\n        /// Place REST POST call to the specified address with the specified DATA.\n        /// </summary>\n        /// <param name=\"address\">Endpoint address</param>\n        /// <param name=\"data\">Data to send in body JSON encoded (optional)</param>\n        /// <param name=\"headers\">Optional headers to use</param>\n        public bool Web(string address, object data = null, Dictionary<string, string> headers = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var web = new NotificationWeb(address, data, headers);\n            Messages.Enqueue(web);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Send a telegram message to the chat ID specified, supply token for custom bot.\n        /// Note: Requires bot to have chat with user or be in the group specified by ID.\n        /// </summary>\n        /// <param name=\"id\">Chat or group ID to send message to</param>\n        /// <param name=\"message\">Message to send</param>\n        /// <param name=\"token\">Bot token to use for this message</param>\n        public bool Telegram(string id, string message, string token = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var telegram = new NotificationTelegram(id, message, token);\n            Messages.Enqueue(telegram);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over unsecure FTP.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Ftp(string hostname, string username, string password, string filePath, byte[] fileContent, int? port = null)\n        {\n            return Ftp(hostname, username, password, filePath, fileContent, secure: false, port);\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over unsecure FTP.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The string contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Ftp(string hostname, string username, string password, string filePath, string fileContent, int? port = null)\n        {\n            return Ftp(hostname, username, password, filePath, fileContent, secure: false, port);\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over SFTP.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Sftp(string hostname, string username, string password, string filePath, byte[] fileContent, int? port = null)\n        {\n            return Ftp(hostname, username, password, filePath, fileContent, secure: true, port);\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over SFTP.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"password\">The FTP server password</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The string contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Sftp(string hostname, string username, string password, string filePath, string fileContent, int? port = null)\n        {\n            return Ftp(hostname, username, password, filePath, fileContent, secure: true, port);\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over SFTP using SSH keys.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"privateKey\">The private SSH key to use for authentication</param>\n        /// <param name=\"privateKeyPassphrase\">The optional passphrase to decrypt the private key.\n        /// This can be empty or null if the private key is not encrypted</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Sftp(string hostname, string username, string privateKey, string privateKeyPassphrase, string filePath, byte[] fileContent,\n            int? port = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var ftp = new NotificationFtp(hostname, username, privateKey, privateKeyPassphrase, filePath, fileContent, port);\n            Messages.Enqueue(ftp);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Send a file to the FTP specified server using password authentication over SFTP using SSH keys.\n        /// </summary>\n        /// <param name=\"hostname\">FTP server hostname</param>\n        /// <param name=\"username\">The FTP server username</param>\n        /// <param name=\"privateKey\">The private SSH key to use for authentication</param>\n        /// <param name=\"privateKeyPassphrase\">The optional passphrase to decrypt the private key.\n        /// This can be empty or null if the private key is not encrypted</param>\n        /// <param name=\"filePath\">The path to file on the FTP server</param>\n        /// <param name=\"fileContent\">The string contents of the file</param>\n        /// <param name=\"port\">The FTP server port. Defaults to 21</param>\n        public bool Sftp(string hostname, string username, string privateKey, string privateKeyPassphrase, string filePath, string fileContent,\n            int? port = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var ftp = new NotificationFtp(hostname, username, privateKey, privateKeyPassphrase, filePath, fileContent, port);\n            Messages.Enqueue(ftp);\n\n            return true;\n        }\n\n        private bool Ftp(string hostname, string username, string password, string filePath, byte[] fileContent, bool secure = true, int? port = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var ftp = new NotificationFtp(hostname, username, password, filePath, fileContent, secure: secure, port);\n            Messages.Enqueue(ftp);\n\n            return true;\n        }\n\n        private bool Ftp(string hostname, string username, string password, string filePath, string fileContent, bool secure = true, int? port = null)\n        {\n            if (!_liveMode)\n            {\n                return false;\n            }\n\n            var ftp = new NotificationFtp(hostname, username, password, filePath, fileContent, secure: secure, port);\n            Messages.Enqueue(ftp);\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/OS.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Threading;\nusing System.Reflection;\nusing QuantConnect.Util;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Operating systems class for managing anything that is operation system specific.\n    /// </summary>\n    /// <remarks>Good design should remove the need for this function. Over time it should disappear.</remarks>\n    public static class OS\n    {\n        /// <summary>\n        /// CPU performance counter measures percentage of CPU used in a background thread.\n        /// </summary>\n        private static CpuPerformance CpuPerformanceCounter;\n\n        /// <summary>\n        /// Global Flag :: Operating System\n        /// </summary>\n        public static bool IsLinux\n        {\n            get\n            {\n                var p = (int)Environment.OSVersion.Platform;\n                return (p == 4) || (p == 6) || (p == 128);\n            }\n        }\n\n        /// <summary>\n        /// Global Flag :: Operating System\n        /// </summary>\n        public static bool IsWindows => !IsLinux;\n\n        /// <summary>\n        /// Character Separating directories in this OS:\n        /// </summary>\n        public static string PathSeparation => Path.DirectorySeparatorChar.ToStringInvariant();\n\n        /// <summary>\n        /// Get the drive space remaining on windows and linux in MB\n        /// </summary>\n        public static long DriveSpaceRemaining\n        {\n            get\n            {\n                var d = GetDrive();\n                return d.AvailableFreeSpace / (1024 * 1024);\n            }\n        }\n\n        /// <summary>\n        /// Get the drive space remaining on windows and linux in MB\n        /// </summary>\n        public static long DriveSpaceUsed\n        {\n            get\n            {\n                var d = GetDrive();\n                return (d.TotalSize - d.AvailableFreeSpace) / (1024 * 1024);\n            }\n        }\n\n        /// <summary>\n        /// Total space on the drive\n        /// </summary>\n        public static long DriveTotalSpace\n        {\n            get\n            {\n                var d = GetDrive();\n                return d.TotalSize / (1024 * 1024);\n            }\n        }\n\n        /// <summary>\n        /// Get the drive.\n        /// </summary>\n        /// <returns></returns>\n        private static DriveInfo GetDrive()\n        {\n            var assembly = Assembly.GetExecutingAssembly();\n            var drive = Path.GetPathRoot(assembly.Location);\n            return new DriveInfo(drive);\n        }\n\n        /// <summary>\n        /// Gets the amount of private memory allocated for the current process (includes both managed and unmanaged memory).\n        /// </summary>\n        public static long ApplicationMemoryUsed\n        {\n            get\n            {\n                var proc = Process.GetCurrentProcess();\n                return proc.PrivateMemorySize64 / (1024 * 1024);\n            }\n        }\n\n        /// <summary>\n        /// Get the RAM used on the machine:\n        /// </summary>\n        public static long TotalPhysicalMemoryUsed => GC.GetTotalMemory(false) / (1024 * 1024);\n\n        /// <summary>\n        /// Total CPU usage as a percentage\n        /// </summary>\n        public static decimal CpuUsage\n        {\n            get\n            {\n                if(CpuPerformanceCounter != null)\n                {\n                    return (decimal)CpuPerformanceCounter.CpuPercentage;\n                }\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Gets the statistics of the machine, including CPU% and RAM\n        /// </summary>\n        public static Dictionary<string, string> GetServerStatistics()\n        {\n            return new Dictionary<string, string>\n            {\n                { Messages.OS.CPUUsageKey, Invariant($\"{CpuUsage:0.0}%\")},\n                { Messages.OS.UsedRAMKey, TotalPhysicalMemoryUsed.ToStringInvariant() },\n                { Messages.OS.TotalRAMKey, \"\" },\n                { Messages.OS.HostnameKey, Environment.MachineName },\n                { Messages.OS.LEANVersionKey, $\"v{Globals.Version}\"}\n            };\n        }\n\n        /// <summary>\n        /// Initializes the OS internal resources\n        /// </summary>\n        public static void Initialize()\n        {\n            CpuPerformanceCounter = new CpuPerformance();\n        }\n\n        /// <summary>\n        /// Disposes of the OS internal resources\n        /// </summary>\n        public static void Dispose()\n        {\n            CpuPerformanceCounter.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Calculates the CPU usage in a background thread\n        /// </summary>\n        private class CpuPerformance : IDisposable\n        {\n            private readonly CancellationTokenSource _cancellationToken;\n            private readonly Thread _cpuThread;\n\n            /// <summary>\n            /// CPU usage as a percentage (0-100)\n            /// </summary>\n            /// <remarks>Float to avoid any atomicity issues</remarks>\n            public float CpuPercentage { get; private set; }\n\n            /// <summary>\n            /// Initializes an instance of the class and starts a new thread.\n            /// </summary>\n            public CpuPerformance()\n            {\n                _cancellationToken = new CancellationTokenSource();\n                _cpuThread = new Thread(CalculateCpu) { IsBackground = true, Name = \"CpuPerformance\" };\n                _cpuThread.Start();\n            }\n\n            /// <summary>\n            /// Event loop that calculates the CPU percentage the process is using\n            /// </summary>\n            private void CalculateCpu()\n            {\n                var process = Process.GetCurrentProcess();\n                while (!_cancellationToken.IsCancellationRequested)\n                {\n                    var startTime = DateTime.UtcNow;\n                    var startCpuUsage = process.TotalProcessorTime;\n\n                    if (_cancellationToken.Token.WaitHandle.WaitOne(startTime.GetSecondUnevenWait(5000)))\n                    {\n                        return;\n                    }\n\n                    var endTime = DateTime.UtcNow;\n                    var endCpuUsage = process.TotalProcessorTime;\n\n                    var cpuUsedMs = (endCpuUsage - startCpuUsage).TotalMilliseconds;\n                    var totalMsPassed = (endTime - startTime).TotalMilliseconds;\n                    var cpuUsageTotal = cpuUsedMs / totalMsPassed;\n\n                    CpuPercentage = (float)cpuUsageTotal * 100;\n                }\n            }\n\n            /// <summary>\n            /// Stops the execution of the task\n            /// </summary>\n            public void Dispose()\n            {\n                _cpuThread.StopSafely(TimeSpan.FromSeconds(5), _cancellationToken);\n                _cancellationToken.DisposeSafely();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Constraint.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Util;\nusing System;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// A backtest optimization constraint.\n    /// Allows specifying statistical constraints for the optimization, eg. a backtest can't have a DrawDown less than 10%\n    /// </summary>\n    public class Constraint : Objective\n    {\n        /// <summary>\n        /// The target comparison operation, eg. 'Greater'\n        /// </summary>\n        [JsonConverter(typeof(StringEnumConverter))]\n        public ComparisonOperatorTypes Operator { get; set; }\n\n        /// <summary>\n        /// Empty Constraint constructor\n        /// </summary>\n        public Constraint()\n        {\n\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public Constraint(string target, ComparisonOperatorTypes @operator, decimal? targetValue) : base(target, targetValue)\n        {\n            Operator = @operator;\n\n            if (!TargetValue.HasValue)\n            {\n                throw new ArgumentNullException(nameof(targetValue), Messages.Constraint.ConstraintTargetValueNotSpecified);\n            }\n        }\n\n        /// <summary>\n        /// Asserts the constraint is met\n        /// </summary>\n        public bool IsMet(string jsonBacktestResult)\n        {\n            if (string.IsNullOrEmpty(jsonBacktestResult))\n            {\n                throw new ArgumentNullException(nameof(jsonBacktestResult), $\"Constraint.IsMet(): {Messages.OptimizerObjectivesCommon.NullOrEmptyBacktestResult}\");\n            }\n\n            var token = Objectives.Target.GetTokenInJsonBacktest(jsonBacktestResult, Target);\n            if (token == null)\n            {\n                return false;\n            }\n\n            return Operator.Compare(\n                token.Value<string>().ToNormalizedDecimal(),\n                TargetValue.Value);\n        }\n\n        /// <summary>\n        /// Pretty representation of a constraint\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Target} '{Operator}' {TargetValue.Value}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Extremum.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// Define the way to compare current real-values and the new one (candidates).\n    /// It's encapsulated in different abstraction to allow configure the direction of optimization, i.e. max or min.\n    /// </summary>\n    [JsonConverter(typeof(ExtremumJsonConverter))]\n    public class Extremum\n    {\n        private Func<decimal, decimal, bool> _comparer;\n\n        /// <summary>\n        /// Create an instance of <see cref=\"Extremum\"/> to compare values.\n        /// </summary>\n        /// <param name=\"comparer\">The way old and new values should be compared</param>\n        public Extremum(Func<decimal, decimal, bool> comparer)\n        {\n            _comparer = comparer;\n        }\n\n        /// <summary>\n        /// Compares two values; identifies whether condition is met or not.\n        /// </summary>\n        /// <param name=\"current\">Left operand</param>\n        /// <param name=\"candidate\">Right operand</param>\n        /// <returns>Returns the result of comparer with this arguments</returns>\n        public bool Better(decimal current, decimal candidate) => _comparer(current, candidate);\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/ExtremumJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// Class for converting string values to Maximization or Minimization strategy objects\n    /// </summary>\n    public class ExtremumJsonConverter : TypeChangeJsonConverter<Extremum, string>\n    {\n        /// <summary>\n        /// Don't populate any property\n        /// </summary>\n        protected override bool PopulateProperties => false;\n\n        /// <summary>\n        /// Converts a Extremum object into a string\n        /// </summary>\n        protected override string Convert(Extremum value)\n        {\n            return value.GetType() == typeof(Maximization)\n                ? \"max\"\n                : \"min\";\n        }\n\n        /// <summary>\n        /// Converts a string into its corresponding Extremum object\n        /// </summary>\n        /// <param name=\"value\"></param>\n        protected override Extremum Convert(string value)\n        {\n            switch (value.ToLowerInvariant())\n            {\n                case \"max\": return new Maximization();\n                case \"min\": return new Minimization();\n                default:\n                    throw new InvalidOperationException($\"ExtremumJsonConverter.Convert: {Messages.ExtremumJsonConverter.UnrecognizedTargetDirection}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Maximization.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// Defines standard maximization strategy, i.e. right operand is greater than left\n    /// </summary>\n    public class Maximization : Extremum\n    {\n        /// <summary>\n        /// Creates an instance of <see cref=\"Maximization\"/>\n        /// </summary>\n        public Maximization() : base((v1, v2) => v1 < v2)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Minimization.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// Defines standard minimization strategy, i.e. right operand is less than left\n    /// </summary>\n    public class Minimization : Extremum\n    {\n        /// <summary>\n        /// Creates an instance of <see cref=\"Minimization\"/>\n        /// </summary>\n        public Minimization() : base((v1, v2) => v1 > v2)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Objective.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// Base class for optimization <see cref=\"Objectives.Target\"/> and <see cref=\"Constraint\"/>\n    /// </summary>\n    public abstract class Objective\n    {\n        private readonly Regex _targetTemplate = new Regex(\"['(.+)']\");\n        private string _target;\n\n        /// <summary>\n        /// Target; property of json file we want to track\n        /// </summary>\n        public string Target\n        {\n            get => _target;\n            set\n            {\n                _target = value != null ? string.Join(\".\", value.Split('.').Select(s => _targetTemplate.Match(s).Success ? s : $\"['{s}']\")) : value;\n            }\n        }\n\n        /// <summary>\n        /// Target value\n        /// </summary>\n        /// <remarks>For <see cref=\"Objectives.Target\"/> if defined and backtest complies with the targets then finish optimization</remarks>\n        /// <remarks>For <see cref=\"Constraint\"/> non optional, the value of the target constraint</remarks>\n        public decimal? TargetValue { get; set; }\n\n        /// <summary>\n        /// Creates a new instance of Objective class\n        /// </summary>\n        protected Objective()\n        {\n\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        protected Objective(string target, decimal? targetValue)\n        {\n            if (string.IsNullOrEmpty(target))\n            {\n                throw new ArgumentNullException(nameof(target), Messages.Objective.NullOrEmptyObjective);\n            }\n\n            var objective = target;\n            if (!objective.Contains('.', StringComparison.InvariantCulture))\n            {\n                // default path\n                objective = $\"Statistics.{objective}\";\n            }\n            // escape empty space in json path\n            Target = objective;\n            TargetValue = targetValue;\n        }\n\n        #region Backwards Compatibility\n        /// <summary>\n        /// Target value\n        /// </summary>\n        /// <remarks>For <see cref=\"Objectives.Target\"/> if defined and backtest complies with the targets then finish optimization</remarks>\n        /// <remarks>For <see cref=\"Constraint\"/> non optional, the value of the target constraint</remarks>\n        [JsonProperty(\"target-value\")]\n        public decimal? OldTargetValue\n        {\n            set\n            {\n                TargetValue = value;\n            }\n            get\n            {\n                return TargetValue;\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Objectives/Target.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System;\n\nnamespace QuantConnect.Optimizer.Objectives\n{\n    /// <summary>\n    /// The optimization statistical target\n    /// </summary>\n    public class Target: Objective\n    {\n        /// <summary>\n        /// Defines the direction of optimization, i.e. maximization or minimization\n        /// </summary>\n        public Extremum Extremum { get; set; }\n\n        /// <summary>\n        /// Current value\n        /// </summary>\n        [JsonIgnore]\n        public decimal? Current { get; private set; }\n\n        /// <summary>\n        /// Fires when target complies specified value\n        /// </summary>\n        public event EventHandler Reached;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public Target(string target, Extremum extremum, decimal? targetValue): base(target, targetValue)\n        {\n            Extremum = extremum;\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public Target()\n        {\n\n        }\n\n        /// <summary>\n        /// Pretty representation of this optimization target\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.Target.ToString(this);\n        }\n\n        /// <summary>\n        /// Check backtest result\n        /// </summary>\n        /// <param name=\"jsonBacktestResult\">Backtest result json</param>\n        /// <returns>true if found a better solution; otherwise false</returns>\n        public bool MoveAhead(string jsonBacktestResult)\n        {\n            if (string.IsNullOrEmpty(jsonBacktestResult))\n            {\n                throw new ArgumentNullException(nameof(jsonBacktestResult), $\"Target.MoveAhead(): {Messages.OptimizerObjectivesCommon.NullOrEmptyBacktestResult}\");\n            }\n\n            var token = GetTokenInJsonBacktest(jsonBacktestResult, Target);\n            if (token == null)\n            {\n                return false;\n            }\n            var computedValue = token.Value<string>().ToNormalizedDecimal();\n            if (!Current.HasValue || Extremum.Better(Current.Value, computedValue))\n            {\n                Current = computedValue;\n\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Try comply target value\n        /// </summary>\n        public void CheckCompliance()\n        {\n            if (IsComplied())\n            {\n                Reached?.Invoke(this, EventArgs.Empty);\n            }\n        }\n\n        public static JToken GetTokenInJsonBacktest(string jsonBacktestResult, string target)\n        {\n            var jObject = JObject.Parse(jsonBacktestResult);\n            var path = target.Replace(\"[\", string.Empty, StringComparison.InvariantCultureIgnoreCase)\n                .Replace(\"]\", string.Empty, StringComparison.InvariantCultureIgnoreCase)\n                .Replace(\"\\'\", string.Empty, StringComparison.InvariantCultureIgnoreCase).Split(\".\");\n            JToken token = null;\n            foreach (var key in path)\n            {\n                if (jObject.TryGetValue(key, StringComparison.OrdinalIgnoreCase, out token))\n                {\n                    if (token is not JValue)\n                    {\n                        jObject = token.ToObject<JObject>();\n                    }\n                }\n                else\n                {\n                    return null;\n                }\n            }\n\n            return token;\n        }\n\n        private bool IsComplied() => TargetValue.HasValue && Current.HasValue && (TargetValue.Value == Current.Value || Extremum.Better(TargetValue.Value, Current.Value));\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/OptimizationStatus.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Optimizer\n{\n    /// <summary>\n    /// The different optimization status\n    /// </summary>\n    public enum OptimizationStatus\n    {\n        /// <summary>\n        /// Just created and not running optimization (0)\n        /// </summary>\n        New,\n\n        /// <summary>\n        /// We failed or we were aborted (1)\n        /// </summary>\n        Aborted,\n\n        /// <summary>\n        /// We are running (2)\n        /// </summary>\n        Running,\n\n        /// <summary>\n        /// Optimization job has completed (3)\n        /// </summary>\n        Completed\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Parameters/OptimizationParameter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Defines the optimization parameter meta information\n    /// </summary>\n    [JsonConverter(typeof(OptimizationParameterJsonConverter))]\n    public abstract class OptimizationParameter\n    {\n        /// <summary>\n        /// Name of optimization parameter\n        /// </summary>\n        [JsonProperty(\"name\")]\n        public string Name { get; }\n\n        /// <summary>\n        /// Create an instance of <see cref=\"OptimizationParameter\"/> based on configuration\n        /// </summary>\n        /// <param name=\"name\">parameter name</param>\n        protected OptimizationParameter(string name)\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        public bool Equals(OptimizationParameter other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return string.Equals(Name, other?.Name);\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is equal to the current object.\n        /// </summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        public override bool Equals(object obj)\n        {\n            return Equals(obj as OptimizationParameter);\n        }\n\n        /// <summary>\n        /// Serves as the default hash function.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current object.\n        /// </returns>\n        public override int GetHashCode() => this.Name.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Parameters/OptimizationParameterJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System;\nusing System.Reflection;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Override <see cref=\"OptimizationParameter\"/> deserialization method.\n    /// Can handle <see cref=\"OptimizationStepParameter\"/> instances\n    /// </summary>\n    public class OptimizationParameterJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes a JSON object from a OptimizationParameter object\n        /// </summary>        \n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            JObject jo = new JObject();\n            Type type = value.GetType();\n\n            foreach (PropertyInfo prop in type.GetProperties())\n            {\n                if (prop.CanRead)\n                {\n                    var attribute = prop.GetCustomAttribute<JsonPropertyAttribute>();\n                    object propVal = prop.GetValue(value, null);\n                    if (propVal != null)\n                    {\n                        jo.Add(attribute.PropertyName ?? prop.Name, JToken.FromObject(propVal, serializer));\n                    }\n                }\n            }\n            jo.WriteTo(writer);\n        }\n\n        /// <summary>\n        /// Creates a Optimization Parameter object from a JSON object\n        /// </summary>\n        public override object ReadJson(\n            JsonReader reader,\n            Type objectType,\n            object existingValue,\n            JsonSerializer serializer\n            )\n        {\n            JObject token = JObject.Load(reader);\n            var parameterName = (token.GetValue(\"name\", StringComparison.OrdinalIgnoreCase) ?? token.GetValue(\"key\", StringComparison.OrdinalIgnoreCase))?.Value<string>();\n            if (string.IsNullOrEmpty(parameterName))\n            {\n                throw new ArgumentException(Messages.OptimizationParameterJsonConverter.OptimizationParameterNotSpecified);\n            }\n\n            JToken value;\n            JToken minToken;\n            JToken maxToken;\n            OptimizationParameter optimizationParameter = null;\n            if (token.TryGetValue(\"min\", StringComparison.OrdinalIgnoreCase, out minToken) &&\n                token.TryGetValue(\"max\", StringComparison.OrdinalIgnoreCase, out maxToken))\n            {\n                var stepToken = token.GetValue(\"step\", StringComparison.OrdinalIgnoreCase)?.Value<decimal>();\n                var minStepToken = token.GetValue(\"minStep\", StringComparison.OrdinalIgnoreCase)?.Value<decimal>() ?? token.GetValue(\"min-step\", StringComparison.OrdinalIgnoreCase)?.Value<decimal>();\n                if (stepToken.HasValue)\n                {\n                    if (minStepToken.HasValue)\n                    {\n                        optimizationParameter = new OptimizationStepParameter(parameterName,\n                            minToken.Value<decimal>(),\n                            maxToken.Value<decimal>(),\n                            stepToken.Value,\n                            minStepToken.Value);\n                    }\n                    else\n                    {\n                        optimizationParameter = new OptimizationStepParameter(parameterName,\n                            minToken.Value<decimal>(),\n                            maxToken.Value<decimal>(),\n                            stepToken.Value);\n                    }\n                }\n                else\n                {\n                    optimizationParameter = new OptimizationStepParameter(parameterName,\n                        minToken.Value<decimal>(),\n                        maxToken.Value<decimal>());\n                }\n            }\n            else if(token.TryGetValue(\"value\", StringComparison.OrdinalIgnoreCase, out value))\n            {\n                optimizationParameter = new StaticOptimizationParameter(parameterName, value.Value<string>());\n            }\n\n            if (optimizationParameter == null)\n            {\n                throw new ArgumentException(Messages.OptimizationParameterJsonConverter.OptimizationParameterNotSupported);\n            }\n\n            return optimizationParameter;\n        }\n\n        /// <summary>\n        /// Determines if an OptimizationParameter is assignable from the given object type\n        /// </summary>\n        public override bool CanConvert(Type objectType) => typeof(OptimizationParameter).IsAssignableFrom(objectType);\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Parameters/OptimizationStepParameter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing System;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Defines the step based optimization parameter\n    /// </summary>\n    public class OptimizationStepParameter : OptimizationParameter\n    {\n        /// <summary>\n        /// Minimum value of optimization parameter, applicable for boundary conditions\n        /// </summary>\n        [JsonProperty(\"min\")]\n        public decimal MinValue { get; }\n\n        /// <summary>\n        /// Maximum value of optimization parameter, applicable for boundary conditions\n        /// </summary>\n        [JsonProperty(\"max\")]\n        public decimal MaxValue { get; }\n\n        /// <summary>\n        /// Movement, should be positive\n        /// </summary>\n        [JsonProperty(\"step\")]\n        public decimal? Step { get; set; }\n\n        #pragma warning disable CS1574\n        /// <summary>\n        /// Minimal possible movement for current parameter, should be positive\n        /// </summary>\n        /// <remarks>Used by <see cref=\"Strategies.EulerSearchOptimizationStrategy\"/> to determine when this parameter can no longer be optimized</remarks>\n        [JsonProperty(\"minStep\")]\n        #pragma warning restore CS1574\n        public decimal? MinStep { get; set; }\n\n        /// <summary>\n        /// Create an instance of <see cref=\"OptimizationParameter\"/> based on configuration\n        /// </summary>\n        /// <param name=\"name\">parameter name</param>\n        /// <param name=\"min\">minimal value</param>\n        /// <param name=\"max\">maximal value</param>\n        public OptimizationStepParameter(string name, decimal min, decimal max)\n            : base(name)\n        {\n            if (min > max)\n            {\n                throw new ArgumentException(Messages.OptimizationStepParameter.InvalidStepRange(min, max));\n            }\n\n            MinValue = min;\n            MaxValue = max;\n        }\n\n        /// <summary>\n        /// Create an instance of <see cref=\"OptimizationParameter\"/> based on configuration\n        /// </summary>\n        /// <param name=\"name\">parameter name</param>\n        /// <param name=\"min\">minimal value</param>\n        /// <param name=\"max\">maximal value</param>\n        /// <param name=\"step\">movement</param>\n        public OptimizationStepParameter(string name, decimal min, decimal max, decimal step)\n            : this(name, min, max, step, step)\n        {\n\n        }\n\n        /// <summary>\n        /// Create an instance of <see cref=\"OptimizationParameter\"/> based on configuration\n        /// </summary>\n        /// <param name=\"name\">parameter name</param>\n        /// <param name=\"min\">minimal value</param>\n        /// <param name=\"max\">maximal value</param>\n        /// <param name=\"step\">movement</param>\n        /// <param name=\"minStep\">minimal possible movement</param>\n        public OptimizationStepParameter(string name, decimal min, decimal max, decimal step, decimal minStep) : this(name, min, max)\n        {\n            // with zero step algorithm can go to infinite loop, use default step value\n            if (step <= 0)\n            {\n                throw new ArgumentException(Messages.OptimizationStepParameter.NonPositiveStepValue(nameof(step), step));\n            }\n\n            // EulerSearch algorithm can go to infinite range division if Min step is not provided, use Step as default\n            if (minStep <= 0)\n            {\n                throw new ArgumentException(Messages.OptimizationStepParameter.NonPositiveStepValue(nameof(minStep), minStep));\n            }\n\n            if (step < minStep)\n            {\n                throw new ArgumentException(Messages.OptimizationStepParameter.StepLessThanMinStep);\n            }\n\n            Step = step;\n            MinStep = minStep;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Parameters/ParameterSet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Api;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Represents a single combination of optimization parameters\n    /// </summary>\n    [JsonConverter(typeof(ParameterSetJsonConverter))]\n    public class ParameterSet\n    {\n        /// <summary>\n        /// The unique identifier within scope (current optimization job)\n        /// </summary>\n        /// <remarks>Internal id, useful for the optimization strategy to id each generated parameter sets,\n        /// even before there is any backtest id</remarks>\n        [JsonProperty(PropertyName = \"id\")]\n        public int Id { get; }\n\n        /// <summary>\n        /// Represent a combination as key value of parameters, i.e. order doesn't matter\n        /// </summary>\n        [JsonProperty(PropertyName = \"value\", NullValueHandling = NullValueHandling.Ignore)]\n        public IReadOnlyDictionary<string, string> Value { get; }\n\n        /// <summary>\n        /// Creates an instance of <see cref=\"ParameterSet\"/> based on new combination of optimization parameters\n        /// </summary>\n        /// <param name=\"id\">Unique identifier</param>\n        /// <param name=\"value\">Combination of optimization parameters</param>\n        public ParameterSet(int id, IReadOnlyDictionary<string, string> value)\n        {\n            Id = id;\n            Value = value;\n        }\n\n        /// <summary>\n        /// String representation of this parameter set\n        /// </summary>\n        public override string ToString()\n        {\n            return string.Join(',', Value.OrderBy(kvp => kvp.Key).Select(arg => $\"{arg.Key}:{arg.Value}\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Optimizer/Parameters/StaticOptimizationParameter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Defines the step based optimization parameter\n    /// </summary>\n    public class StaticOptimizationParameter : OptimizationParameter\n    {\n        /// <summary>\n        /// Minimum value of optimization parameter, applicable for boundary conditions\n        /// </summary>\n        [JsonProperty(\"value\")]\n        public string Value { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter</param>\n        /// <param name=\"value\">The fixed value of this parameter</param>\n        public StaticOptimizationParameter(string name, string value) : base(name)\n        {\n            Value = value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/AlpacaOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides an implementation of the <see cref=\"OrderProperties\"/> specific to Alpaca order.\n    /// </summary>\n    public class AlpacaOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// Flag to allow orders to also trigger or fill outside of regular trading hours.\n        /// </summary>\n        public bool OutsideRegularTradingHours { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/BinanceOrderProperties.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Binance brokerage\n    /// </summary>\n    public class BinanceOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (no fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders.\n        /// </summary>\n        public bool PostOnly { get; set; }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (BinanceOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/BitfinexOrderProperties.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Bitfinex brokerage\n    /// </summary>\n    public class BitfinexOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (no fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders.\n        /// </summary>\n        public bool PostOnly { get; set; }\n\n        /// <summary>\n        /// The hidden order option ensures an order does not appear in the order book; thus does not influence other market participants.\n        /// If you place a hidden order, you will always pay the taker fee. If you place a limit order that hits a hidden order, you will always pay the maker fee.\n        /// </summary>\n        public bool Hidden { get; set; }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (BitfinexOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/BrokerageOrderIdChangedEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Event used when the brokerage order id has changed\n    /// </summary>\n    public class BrokerageOrderIdChangedEvent\n    {\n        /// <summary>\n        /// The lean order ID.\n        /// </summary>\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// Brokerage Id for this order\n        /// </summary>\n        public List<string> BrokerId { get; set; }\n\n        /// <summary>\n        /// Returns a string that represents the current <see cref=\"BrokerageOrderIdChangedEvent\"/>.\n        /// </summary>\n        /// <returns>\n        /// A string containing the order ID and associated brokerage IDs.\n        /// </returns>\n        public override string ToString()\n        {\n            var brokerIds = BrokerId != null ? string.Join(\", \", BrokerId) : \"null\";\n            return $\"OrderId: {OrderId}, BrokerId: [{brokerIds}]\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/BybitOrderProperties.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nnamespace QuantConnect.Orders;\n\n/// <summary>\n/// Class containing Bybit OrderProperties\n/// </summary>\npublic class BybitOrderProperties : OrderProperties\n{\n    \n    /// <summary>\n    /// This flag will ensure the order executes only as a maker (no fee) order.\n    /// If part of the order results in taking liquidity rather than providing,\n    /// it will be rejected and no part of the order will execute.\n    /// Note: this flag is only applied to Limit orders.\n    /// </summary>\n    public bool PostOnly { get; set; }\n    \n    /// <summary>\n    /// This flag will ensure your position can only reduce in size if the order is triggered.\n    /// <seealso href=\"https://www.bybit.com/en-US/help-center/s/article/What-is-a-Reduce-Only-Order\"/>\n    /// </summary>\n    public bool? ReduceOnly { get; set; }\n}\n"
  },
  {
    "path": "Common/Orders/CancelOrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Defines a request to cancel an order\n    /// </summary>\n    public class CancelOrderRequest : OrderRequest\n    {\n        /// <summary>\n        /// Gets <see cref=\"Orders.OrderRequestType.Cancel\"/>\n        /// </summary>\n        public override OrderRequestType OrderRequestType\n        {\n            get { return OrderRequestType.Cancel; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CancelOrderRequest\"/> class\n        /// </summary>\n        /// <param name=\"time\">The time this cancelation was requested</param>\n        /// <param name=\"orderId\">The order id to be canceled</param>\n        /// <param name=\"tag\">A new tag for the order</param>\n        public CancelOrderRequest(DateTime time, int orderId, string tag)\n            : base(time, orderId, tag)\n        {\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.CancelOrderRequest.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/CharlesSchwabOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Charles Schwab brokerage\n    /// </summary>\n    public class CharlesSchwabOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// If set to true, allows orders to also trigger or fill outside of regular trading hours.\n        /// </summary>\n        /// <remarks>\n        /// Schwab offers extended hours trading for stocks and ETFs  during the business week.\n        /// Stock trading does not occur on weekends, holidays, or on days the market is closed.\n        /// </remarks>\n        public bool ExtendedRegularTradingHours { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/CoinbaseOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Coinbase brokerage\n    /// </summary>\n    public class CoinbaseOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (no fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders.\n        /// </summary>\n        public bool PostOnly { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether self-trade prevention is enabled for this order.\n        /// Self-trade prevention helps prevent an order from crossing against the same user, \n        /// reducing the risk of unintentional trades within the same account.\n        /// </summary>\n        public bool SelfTradePreventionId { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/ComboLegLimitOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Combo leg limit order type\n    /// </summary>\n    /// <remarks>Limit price per leg in the combo order</remarks>\n    public class ComboLegLimitOrder : ComboOrder\n    {\n        /// <summary>\n        /// Combo Limit Leg Order Type\n        /// </summary>\n        public override OrderType Type => OrderType.ComboLegLimit;\n\n        /// <summary>\n        /// Limit price for this order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"limitPrice\")]\n        public decimal LimitPrice { get; internal set; }\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public ComboLegLimitOrder() : base()\n        {\n        }\n\n        /// <summary>\n        /// New limit order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"groupOrderManager\">Manager for the orders in the group</param>\n        /// <param name=\"limitPrice\">Price the order should be filled at if a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public ComboLegLimitOrder(Symbol symbol, decimal quantity, decimal limitPrice, DateTime time, GroupOrderManager groupOrderManager,\n            string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, groupOrderManager, tag, properties)\n        {\n            GroupOrderManager = groupOrderManager;\n            LimitPrice = limitPrice;\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return LimitOrder.CalculateOrderValue(Quantity, LimitPrice, security.Price);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.LimitPrice.HasValue)\n            {\n                LimitPrice = request.LimitPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new ComboLegLimitOrder { LimitPrice = LimitPrice };\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/ComboLimitOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Combo limit order type\n    /// </summary>\n    /// <remarks>Single limit price for the whole combo order</remarks>\n    public class ComboLimitOrder : ComboOrder\n    {\n        /// <summary>\n        /// Combo Limit Order Type\n        /// </summary>\n        public override OrderType Type => OrderType.ComboLimit;\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public ComboLimitOrder() : base()\n        {\n        }\n\n        /// <summary>\n        /// New limit order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"groupOrderManager\">Manager for the orders in the group</param>\n        /// <param name=\"limitPrice\">Price the order should be filled at if a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public ComboLimitOrder(Symbol symbol, decimal quantity, decimal limitPrice, DateTime time, GroupOrderManager groupOrderManager,\n            string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, groupOrderManager, tag, properties)\n        {\n            GroupOrderManager.LimitPrice = limitPrice;\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return LimitOrder.CalculateOrderValue(Quantity, GroupOrderManager.LimitPrice, security.Price);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.LimitPrice.HasValue)\n            {\n                GroupOrderManager.LimitPrice = request.LimitPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new ComboLimitOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/ComboMarketOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Combo market order type\n    /// </summary>\n    public class ComboMarketOrder : ComboOrder\n    {\n        /// <summary>\n        /// Combo Market Order Type\n        /// </summary>\n        public override OrderType Type => OrderType.ComboMarket;\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public ComboMarketOrder() : base()\n        {\n        }\n\n        /// <summary>\n        /// New market order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"groupOrderManager\">Manager for the orders in the group</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public ComboMarketOrder(Symbol symbol, decimal quantity, DateTime time, GroupOrderManager groupOrderManager, string tag = \"\",\n            IOrderProperties properties = null)\n            : base(symbol, quantity, time, groupOrderManager, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return Quantity * security.Price;\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new ComboMarketOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/ComboOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Combo order type\n    /// </summary>\n    public abstract class ComboOrder : Order\n    {\n        private decimal _ratio;\n\n        /// <summary>\n        /// Number of shares to execute.\n        /// For combo orders, we store the ratio of each leg instead of the quantity,\n        /// and the actual quantity is calculated when requested using the group order manager quantity.\n        /// This allows for a single quantity update to be applied to all the legs of the combo.\n        /// </summary>\n        public override decimal Quantity\n        {\n            get\n            {\n                return _ratio.GetOrderLegGroupQuantity(GroupOrderManager).Normalize();\n            }\n            internal set\n            {\n                _ratio = value.GetOrderLegRatio(GroupOrderManager);\n            }\n        }\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public ComboOrder() : base()\n        {\n        }\n\n        /// <summary>\n        /// New market order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"groupOrderManager\">Manager for the orders in the group</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public ComboOrder(Symbol symbol, decimal quantity, DateTime time, GroupOrderManager groupOrderManager, string tag = \"\",\n            IOrderProperties properties = null)\n            : base(symbol, 0m, time, tag, properties)\n        {\n            GroupOrderManager = groupOrderManager;\n            Quantity = quantity;\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            if (request.OrderId != Id)\n            {\n                throw new ArgumentException(\"Attempted to apply updates to the incorrect order!\");\n            }\n            if (request.Tag != null)\n            {\n                Tag = request.Tag;\n            }\n            if (request.Quantity.HasValue)\n            {\n                // For combo orders, the updated quantity is the quantity of the group\n                GroupOrderManager.Quantity = request.Quantity.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/EzeOrderProperties.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to EZE brokerage\n    /// </summary>\n    public class EzeOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// Gets or sets the route name as shown in Eze EMS.\n        /// </summary>\n        public string Route { get; set; }\n\n        /// <summary>\n        /// Gets or sets a semi-colon separated list of trade or neutral accounts \n        /// the user has permission for, e.g., \"TAL;TEST;USER1;TRADE\" or \"TAL;TEST;USER2;NEUTRAL\".\n        /// </summary>\n        public string Account { get; set; }\n\n        /// <summary>\n        /// Gets or sets the user message or notes.\n        /// </summary>\n        public string Notes { get; set; }\n\n        /// <summary>\n        /// Gets or sets the account type for the order.\n        /// </summary>\n        /// <remarks>Should be set to <b>\"119\"</b> for margin orders in Eze EMS.</remarks>\n        public string AccountType { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance with optional route, account, and notes.\n        /// </summary>\n        /// <param name=\"route\">The trading route name (optional).</param>\n        /// <param name=\"account\">The trading account with specific permissions (optional).</param>\n        /// <param name=\"notes\">Optional notes about the order.</param>\n        /// <param name=\"accountType\">The account type for the order (e.g., \"119\" for margin orders) (optional).</param>\n        public EzeOrderProperties(string route = default, string account = default, string notes = default, string accountType = default)\n            : base()\n        {\n            Route = route;\n            Account = account;\n            Notes = notes;\n            AccountType = accountType;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/FTXOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to FTX brokerage\n    /// </summary>\n    public class FTXOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (maker fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders.\n        /// </summary>\n        public bool PostOnly { get; set; }\n\n        /// <summary>\n        /// If you send a reduce only order, it will only trade if it would decrease your position size.\n        /// </summary>\n        public bool ReduceOnly { get; set; }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (FTXOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/AlpacaFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents the fee model specific to Alpaca trading platform.\n    /// </summary>\n    /// <remarks>This class inherits from <see cref=\"FeeModel\"/> and provides the fee structure for Alpaca trades.\n    /// It implements the <see cref=\"IFeeModel\"/> interface and should be used for calculating fees on the Alpaca platform.</remarks>\n    public class AlpacaFeeModel : FeeModel\n    {\n        /// <summary>\n        /// The fee percentage for a maker transaction in cryptocurrency.\n        /// </summary>\n        /// <see href=\"https://docs.alpaca.markets/docs/crypto-fees\"/>\n        public const decimal MakerCryptoFee = 0.0015m;\n\n        /// <summary>\n        /// The fee percentage for a taker transaction in cryptocurrency.\n        /// </summary>\n        public const decimal TakerCryptoFee = 0.0025m;\n\n        /// <summary>\n        /// Gets the order fee associated with the specified order.\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var security = parameters.Security;\n            if (security.Symbol.ID.SecurityType == SecurityType.Crypto)\n            {\n                var order = parameters.Order;\n                var fee = GetFee(order, MakerCryptoFee, TakerCryptoFee);\n                CashAmount cashAmount;\n                Crypto.DecomposeCurrencyPair(security.Symbol, security.SymbolProperties, out var baseCurrency, out var quoteCurrency);\n                if (order.Direction == OrderDirection.Buy)\n                {\n                    // base currency, deducted from what we bought\n                    cashAmount = new CashAmount(order.AbsoluteQuantity * fee, baseCurrency);\n                }\n                else\n                {\n                    // quote currency\n                    var positionValue = order.AbsoluteQuantity * security.Price;\n                    cashAmount = new CashAmount(positionValue * fee, quoteCurrency);\n                }\n                return new OrderFee(cashAmount);\n            }\n            return new OrderFee(new CashAmount(0, Currencies.USD));\n        }\n\n        /// <summary>\n        /// Calculates the fee for a given order based on whether it is a maker or taker order.\n        /// </summary>\n        /// <param name=\"order\">The order for which the fee is being calculated.</param>\n        /// <param name=\"makerFee\">The fee percentage for maker orders.</param>\n        /// <param name=\"takerFee\">The fee percentage for taker orders.</param>\n        /// <returns>The calculated fee for the given order.</returns>\n        private static decimal GetFee(Order order, decimal makerFee, decimal takerFee)\n        {\n            if (order.Type == OrderType.Limit && !order.IsMarketable)\n            {\n                return makerFee;\n            }\n            return takerFee;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/AlphaStreamsFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models order fees that alpha stream clients pay/receive\n    /// </summary>\n    public class AlphaStreamsFeeModel : FeeModel\n    {\n        private readonly Dictionary<string, EquityFee> _equityFee =\n            new Dictionary<string, EquityFee> {\n                { Market.USA, new EquityFee(\"USD\", feePerShare: 0.005m, minimumFee: 1, maximumFeeRate: 0.005m) }\n            };\n\n        private readonly IDictionary<SecurityType, decimal> _feeRates = new Dictionary<SecurityType, decimal>\n        {\n            // Commission\n            {SecurityType.Forex, 0.000002m},\n            // Commission plus clearing fee\n            {SecurityType.Future, 0.4m + 0.1m},\n            {SecurityType.FutureOption, 0.4m + 0.1m},\n            {SecurityType.Option, 0.4m + 0.1m},\n            {SecurityType.IndexOption, 0.4m + 0.1m},\n            {SecurityType.Cfd, 0m}\n        };\n        private const decimal _makerFee = 0.001m;\n        private const decimal _takerFee = 0.002m;\n\n        /// <summary>\n        /// Gets the order fee associated with the specified order. This returns the cost\n        /// of the transaction in the account currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n\n            // Option exercise is free of charge\n            if (order.Type == OrderType.OptionExercise)\n            {\n                return OrderFee.Zero;\n            }\n\n            var market = security.Symbol.ID.Market;\n            decimal feeRate;\n\n            switch (security.Type)\n            {\n                case SecurityType.Option:\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                case SecurityType.Cfd:\n                    _feeRates.TryGetValue(security.Type, out feeRate);\n                    return new OrderFee(new CashAmount(feeRate * order.AbsoluteQuantity, Currencies.USD));\n\n                case SecurityType.Forex:\n                    _feeRates.TryGetValue(security.Type, out feeRate);\n                    return new OrderFee(new CashAmount(feeRate * Math.Abs(order.GetValue(security)), Currencies.USD));\n\n                case SecurityType.Crypto:\n                    decimal fee = _takerFee;\n                    var props = order.Properties as BitfinexOrderProperties;\n\n                    if (order.Type == OrderType.Limit &&\n                        props?.Hidden != true &&\n                        (props?.PostOnly == true || !order.IsMarketable))\n                    {\n                        // limit order posted to the order book\n                        fee = _makerFee;\n                    }\n\n                    // get order value in quote currency\n                    var unitPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n                    if (order.Type == OrderType.Limit)\n                    {\n                        // limit order posted to the order book\n                        unitPrice = ((LimitOrder)order).LimitPrice;\n                    }\n\n                    unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n                    // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n                    return new OrderFee(new CashAmount(\n                        unitPrice * order.AbsoluteQuantity * fee,\n                        security.QuoteCurrency.Symbol));\n\n                // Use the IB fee model\n                case SecurityType.Equity:\n                    EquityFee equityFee;\n                    if (!_equityFee.TryGetValue(market, out equityFee))\n                    {\n                        throw new KeyNotFoundException(Messages.AlphaStreamsFeeModel.UnexpectedEquityMarket(market));\n                    }\n                    var tradeValue = Math.Abs(order.GetValue(security));\n\n                    //Per share fees\n                    var tradeFee = equityFee.FeePerShare * order.AbsoluteQuantity;\n\n                    //Maximum Per Order: equityFee.MaximumFeeRate\n                    //Minimum per order. $equityFee.MinimumFee\n                    var maximumPerOrder = equityFee.MaximumFeeRate * tradeValue;\n                    if (tradeFee < equityFee.MinimumFee)\n                    {\n                        tradeFee = equityFee.MinimumFee;\n                    }\n                    else if (tradeFee > maximumPerOrder)\n                    {\n                        tradeFee = maximumPerOrder;\n                    }\n\n                    return new OrderFee(new CashAmount(Math.Abs(tradeFee), equityFee.Currency));\n\n                default:\n                    // unsupported security type\n                    throw new ArgumentException(Messages.FeeModel.UnsupportedSecurityType(security));\n            }\n        }\n\n        /// <summary>\n        /// Helper class to handle Equity fees\n        /// </summary>\n        private class EquityFee\n        {\n            public string Currency { get; }\n            public decimal FeePerShare { get; }\n            public decimal MinimumFee { get; }\n            public decimal MaximumFeeRate { get; }\n\n            public EquityFee(string currency,\n                decimal feePerShare,\n                decimal minimumFee,\n                decimal maximumFeeRate)\n            {\n                Currency = currency;\n                FeePerShare = feePerShare;\n                MinimumFee = minimumFee;\n                MaximumFeeRate = maximumFeeRate;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/AxosFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Axos order fees\n    /// </summary>\n    public class AxosFeeModel: IFeeModel\n    {\n        private readonly decimal _feesPerShare;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"feesPerShare\">The fees per share to apply</param>\n        /// <remarks>Default value is $0.0015 per share</remarks>\n        public AxosFeeModel(decimal? feesPerShare = null)\n        {\n            _feesPerShare = feesPerShare ?? 0.0035m;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            return new OrderFee(new CashAmount(_feesPerShare * parameters.Order.AbsoluteQuantity, Currencies.USD));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BinanceCoinFuturesFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Binance Coin Futures order fees\n    /// </summary>\n    public class BinanceCoinFuturesFeeModel : BinanceFeeModel\n    {\n        /// <summary>\n        /// Tier 1 maker fees\n        /// https://www.binance.com/en/fee/deliveryFee\n        /// </summary>\n        public new const decimal MakerTier1Fee = 0.0001m;\n\n        /// <summary>\n        /// Tier 1 taker fees\n        /// https://www.binance.com/en/fee/deliveryFee\n        /// </summary>\n        public new const decimal TakerTier1Fee = 0.0005m;\n\n        /// <summary>\n        /// Creates Binance Coin Futures fee model setting fees values\n        /// </summary>\n        /// <param name=\"mFee\">Maker fee value</param>\n        /// <param name=\"tFee\">Taker fee value</param>\n        public BinanceCoinFuturesFeeModel(decimal mFee = MakerTier1Fee, decimal tFee = TakerTier1Fee)\n            : base(mFee, tFee)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BinanceFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Binance order fees\n    /// </summary>\n    public class BinanceFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Tier 1 maker fees\n        /// https://www.binance.com/en/fee/schedule\n        /// </summary>\n        public const decimal MakerTier1Fee = 0.001m;\n\n        /// <summary>\n        /// Tier 1 taker fees\n        /// https://www.binance.com/en/fee/schedule\n        /// </summary>\n        public const decimal TakerTier1Fee = 0.001m;\n\n        private readonly decimal _makerFee;\n        private readonly decimal _takerFee;\n\n        /// <summary>\n        /// Creates Binance fee model setting fees values\n        /// </summary>\n        /// <param name=\"mFee\">Maker fee value</param>\n        /// <param name=\"tFee\">Taker fee value</param>\n        public BinanceFeeModel(decimal mFee = MakerTier1Fee, decimal tFee = TakerTier1Fee)\n        {\n            _makerFee = mFee;\n            _takerFee = tFee;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var security = parameters.Security;\n            var order = parameters.Order;\n\n            var fee = GetFee(order);\n\n            if(security.Symbol.ID.SecurityType == SecurityType.CryptoFuture)\n            {\n                var positionValue = security.Holdings.GetQuantityValue(order.AbsoluteQuantity, security.Price);\n                return new OrderFee(new CashAmount(positionValue.Amount * fee, positionValue.Cash.Symbol));\n            }\n\n            if (order.Direction == OrderDirection.Buy)\n            {\n                // fees taken in the received currency\n                CurrencyPairUtil.DecomposeCurrencyPair(order.Symbol, out var baseCurrency, out _);\n                return new OrderFee(new CashAmount(order.AbsoluteQuantity * fee, baseCurrency));\n            }\n\n            // get order value in quote currency\n            var unitPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n            if (order.Type == OrderType.Limit)\n            {\n                // limit order posted to the order book\n                unitPrice = ((LimitOrder)order).LimitPrice;\n            }\n\n            unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n            return new OrderFee(new CashAmount(\n                unitPrice * order.AbsoluteQuantity * fee,\n                security.QuoteCurrency.Symbol));\n        }\n\n        /// <summary>\n        /// Gets the fee factor for the given order\n        /// </summary>\n        /// <param name=\"order\">The order to get the fee factor for</param>\n        /// <returns>The fee factor for the given order</returns>\n        protected virtual decimal GetFee(Order order)\n        {\n            return GetFee(order, _makerFee, _takerFee);\n        }\n\n        /// <summary>\n        /// Gets the fee factor for the given order taking into account the maker and the taker fee\n        /// </summary>\n        protected static decimal GetFee(Order order, decimal makerFee, decimal takerFee)\n        {\n            // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n            var fee = takerFee;\n            var props = order.Properties as BinanceOrderProperties;\n\n            if (order.Type == OrderType.Limit && ((props != null && props.PostOnly) || !order.IsMarketable))\n            {\n                // limit order posted to the order book\n                fee = makerFee;\n            }\n\n            return fee;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BinanceFuturesFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Binance Futures order fees\n    /// </summary>\n    public class BinanceFuturesFeeModel : BinanceFeeModel\n    {\n        /// <summary>\n        /// Tier 1 USDT maker fees\n        /// https://www.binance.com/en/fee/futureFee\n        /// </summary>\n        public const decimal MakerTier1USDTFee = 0.0002m;\n\n        /// <summary>\n        /// Tier 1 USDT taker fees\n        /// https://www.binance.com/en/fee/futureFee\n        /// </summary>\n        public const decimal TakerTier1USDTFee = 0.0004m;\n\n        /// <summary>\n        /// Tier 1 BUSD maker fees\n        /// https://www.binance.com/en/fee/futureFee\n        /// </summary>\n        public const decimal MakerTier1BUSDFee = 0.00012m;\n\n        /// <summary>\n        /// Tier 1 BUSD taker fees\n        /// https://www.binance.com/en/fee/futureFee\n        /// </summary>\n        public const decimal TakerTier1BUSDFee = 0.00036m;\n\n        private decimal _makerUsdtFee;\n        private decimal _takerUsdtFee;\n        private decimal _makerBusdFee;\n        private decimal _takerBusdFee;\n\n        /// <summary>\n        /// Creates Binance Futures fee model setting fees values\n        /// </summary>\n        /// <param name=\"mUsdtFee\">Maker fee value for USDT pair contracts</param>\n        /// <param name=\"tUsdtFee\">Taker fee value for USDT pair contracts</param>\n        /// <param name=\"mBusdFee\">Maker fee value for BUSD pair contracts</param>\n        /// <param name=\"tBusdFee\">Taker fee value for BUSD pair contracts</param>\n        public BinanceFuturesFeeModel(decimal mUsdtFee = MakerTier1USDTFee, decimal tUsdtFee = TakerTier1USDTFee,\n            decimal mBusdFee = MakerTier1BUSDFee, decimal tBusdFee = TakerTier1BUSDFee)\n            : base(-1, -1)\n        {\n            _makerUsdtFee = mUsdtFee;\n            _takerUsdtFee = tUsdtFee;\n            _makerBusdFee = mBusdFee;\n            _takerBusdFee = tBusdFee;\n        }\n\n        /// <summary>\n        /// Gets the fee for the given order\n        /// </summary>\n        protected override decimal GetFee(Order order)\n        {\n            CurrencyPairUtil.DecomposeCurrencyPair(order.Symbol, out var _, out var quoteCurrency);\n            var makerFee = _makerUsdtFee;\n            var takerFee = _takerUsdtFee;\n            if (quoteCurrency == \"BUSD\")\n            {\n                makerFee = _makerBusdFee;\n                takerFee = _takerBusdFee;\n            }\n\n            return GetFee(order, makerFee, takerFee);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BitfinexFeeModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Bitfinex order fees\n    /// </summary>\n    public class BitfinexFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Tier 1 maker fees\n        /// Maker fees are paid when you add liquidity to our order book by placing a limit order under the ticker price for buy and above the ticker price for sell.\n        /// https://www.bitfinex.com/fees\n        /// </summary>\n        public const decimal MakerFee = 0.001m;\n        /// <summary>\n        /// Tier 1 taker fees\n        /// Taker fees are paid when you remove liquidity from our order book by placing any order that is executed against an order of the order book.\n        /// Note: If you place a hidden order, you will always pay the taker fee. If you place a limit order that hits a hidden order, you will always pay the maker fee.\n        /// https://www.bitfinex.com/fees\n        /// </summary>\n        public const decimal TakerFee = 0.002m;\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n            // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n            var fee = TakerFee;\n            var props = order.Properties as BitfinexOrderProperties;\n\n            if (order.Type == OrderType.Limit &&\n                props?.Hidden != true &&\n                (props?.PostOnly == true || !order.IsMarketable))\n            {\n                // limit order posted to the order book\n                fee = MakerFee;\n            }\n\n            if (order.Direction == OrderDirection.Buy)\n            {\n                // fees taken in the received currency\n                CurrencyPairUtil.DecomposeCurrencyPair(order.Symbol, out var baseCurrency, out _);\n                return new OrderFee(new CashAmount(order.AbsoluteQuantity * fee, baseCurrency));\n            }\n\n            // get order value in quote currency\n            var unitPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n            if (order.Type == OrderType.Limit)\n            {\n                // limit order posted to the order book\n                unitPrice = ((LimitOrder)order).LimitPrice;\n            }\n\n            unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n            return new OrderFee(new CashAmount(\n                unitPrice * order.AbsoluteQuantity * fee,\n                security.QuoteCurrency.Symbol));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BybitFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Fees;\n\n/// <summary>\n/// Bybit fee model implementation\n/// </summary>\npublic class BybitFeeModel : FeeModel\n{\n    /// <summary>\n    /// Tier 1 maker fees\n    /// https://learn.bybit.com/bybit-guide/bybit-trading-fees/\n    /// </summary>\n    public const decimal MakerNonVIPFee = 0.001m;\n\n    /// <summary>\n    /// Tier 1 taker fees\n    /// https://learn.bybit.com/bybit-guide/bybit-trading-fees/\n    /// </summary>\n    public const decimal TakerNonVIPFee = 0.001m;\n\n    private readonly decimal _makerFee;\n    private readonly decimal _takerFee;\n\n    /// <summary>\n    /// Creates Binance fee model setting fees values\n    /// </summary>\n    /// <param name=\"mFee\">Maker fee value</param>\n    /// <param name=\"tFee\">Taker fee value</param>\n    public BybitFeeModel(decimal mFee = MakerNonVIPFee, decimal tFee = TakerNonVIPFee)\n    {\n        _makerFee = mFee;\n        _takerFee = tFee;\n    }\n\n    /// <summary>\n    /// Gets the order fee associated with the specified order.\n    /// </summary>\n    /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n    /// containing the security and order</param>\n    /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n    public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n    {\n        var security = parameters.Security;\n        var order = parameters.Order;\n\n        var fee = GetFee(order);\n\n        if(security.Symbol.ID.SecurityType == SecurityType.CryptoFuture)\n        {\n            var positionValue = security.Holdings.GetQuantityValue(order.AbsoluteQuantity, security.Price);\n            return new OrderFee(new CashAmount(positionValue.Amount * fee, positionValue.Cash.Symbol));\n        }\n\n        if (order.Direction == OrderDirection.Buy)\n        {\n            // fees taken in the received currency\n            CurrencyPairUtil.DecomposeCurrencyPair(order.Symbol, out var baseCurrency, out _);\n            return new OrderFee(new CashAmount(order.AbsoluteQuantity * fee, baseCurrency));\n        }\n\n        // get order value in quote currency\n        var unitPrice = security.BidPrice;\n        if (order.Type == OrderType.Limit)\n        {\n            // limit order posted to the order book\n            unitPrice = ((LimitOrder)order).LimitPrice;\n        }\n\n        unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n        return new OrderFee(new CashAmount(\n            unitPrice * order.AbsoluteQuantity * fee,\n            security.QuoteCurrency.Symbol));\n    }\n\n    /// <summary>\n    /// Gets the fee factor for the given order\n    /// </summary>\n    /// <param name=\"order\">The order to get the fee factor for</param>\n    /// <returns>The fee factor for the given order</returns>\n    protected virtual decimal GetFee(Order order)\n    {\n        return GetFee(order, _makerFee, _takerFee);\n    }\n\n    private static decimal GetFee(Order order, decimal makerFee, decimal takerFee)\n    {\n        // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n        var fee = takerFee;\n        var props = order.Properties as BybitOrderProperties;\n\n        if (order.Type == OrderType.Limit && ((props != null && props.PostOnly) || !order.IsMarketable))\n        {\n            // limit order posted to the order book\n            fee = makerFee;\n        }\n\n        return fee;\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/BybitFuturesFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees;\n\n/// <summary>\n/// Bybit futures fee model implementation\n/// </summary>\npublic class BybitFuturesFeeModel : BybitFeeModel\n{\n    /// <summary>\n    /// Tier 1 maker fees\n    /// https://learn.bybit.com/bybit-guide/bybit-trading-fees/\n    /// </summary>\n    public new const decimal MakerNonVIPFee = 0.0002m;\n\n    /// <summary>\n    /// Tier 1 taker fees\n    /// https://learn.bybit.com/bybit-guide/bybit-trading-fees/\n    /// </summary>\n    public new const decimal TakerNonVIPFee = 0.00055m;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"BybitFuturesFeeModel\"/> class\n    /// </summary>\n    /// <param name=\"makerFee\">The accounts maker fee</param>\n    /// <param name=\"takerFee\">The accounts taker fee</param>\n    public BybitFuturesFeeModel(decimal makerFee = MakerNonVIPFee, decimal takerFee = TakerNonVIPFee)\n        : base(makerFee, takerFee)\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/CharlesSchwabFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents a fee model specific to Charles Schwab.\n    /// </summary>\n    /// <see href=\"https://www.schwab.com/pricing\"/>\n    public class CharlesSchwabFeeModel : FeeModel\n    {\n        /// <summary>\n        /// The exchange processing fee for standard option securities.\n        /// </summary>\n        private const decimal _optionIndexFee = 1m;\n\n        /// <summary>\n        /// Represents the fee associated with equity options transactions (per contract).\n        /// </summary>\n        private const decimal _optionFee = 0.65m;\n\n        /// <summary>\n        /// Calculates the order fee based on the security type and order parameters.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters for the order fee calculation, which include security and order details.</param>\n        /// <returns>\n        /// An <see cref=\"OrderFee\"/> instance representing the calculated order fee.\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">\n        /// Thrown when <paramref name=\"parameters\"/> is <c>null</c>.\n        /// </exception>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            if (parameters.Security.Type.IsOption())\n            {\n                var feeRate = parameters.Security.Type switch\n                {\n                    SecurityType.IndexOption => _optionIndexFee,\n                    SecurityType.Option => _optionFee,\n                    _ => 0m\n                };\n                return new OrderFee(new CashAmount(parameters.Order.AbsoluteQuantity * feeRate, Currencies.USD));\n            }\n            return OrderFee.Zero;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/CoinbaseFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014-2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents a fee model specific to Coinbase.\n    /// This class extends the base fee model.\n    /// </summary>\n    public class CoinbaseFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Level Advanced 1 maker fee\n        /// Tab \"Fee tiers\" on <see href=\"https://www.coinbase.com/advanced-fees\"/>\n        /// </summary>\n        public const decimal MakerAdvanced1 = 0.006m;\n\n        /// <summary>\n        /// Level Advanced 1 taker fee\n        /// Tab \"Fee tiers\" on <see href=\"https://www.coinbase.com/advanced-fees\"/>\n        /// </summary>\n        public const decimal TakerAdvanced1 = 0.008m;\n\n        /// <summary>\n        /// Stable Pairs maker fee\n        /// Tab \"Stable pairs\" on <see href=\"https://www.coinbase.com/advanced-fees\"/>\n        /// </summary>\n        public const decimal MakerStablePairs = 0m;\n\n        /// <summary>\n        /// Stable Pairs taker fee\n        /// Tab \"Stable pairs\" on <see href=\"https://www.coinbase.com/advanced-fees\"/>\n        /// </summary>\n        public const decimal TakerStableParis = 0.00001m;\n\n        private readonly decimal _makerFee;\n\n        private readonly decimal _takerFee;\n\n        /// <summary>\n        /// Create Coinbase Fee model setting fee values\n        /// </summary>\n        /// <param name=\"makerFee\">Maker fee value</param>\n        /// <param name=\"takerFee\">Taker fee value</param>\n        /// <remarks>By default: use Level Advanced 1 fees</remarks>\n        public CoinbaseFeeModel(decimal makerFee = MakerAdvanced1, decimal takerFee = TakerAdvanced1)\n        {\n            _makerFee = makerFee;\n            _takerFee = takerFee;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            if (parameters == null)\n            {\n                throw new ArgumentNullException(nameof(parameters), \"The 'parameters' argument cannot be null.\");\n            }\n\n            var order = parameters.Order;\n            var security = parameters.Security;\n            var props = order.Properties as CoinbaseOrderProperties;\n\n            // marketable limit orders are considered takers\n            var isMaker = order.Type == OrderType.Limit && ((props != null && props.PostOnly) || !order.IsMarketable);\n\n            // Check if the current symbol is a StableCoin\n            var isStableCoin = Currencies.StablePairsCoinbase.Contains(security.Symbol.Value);\n\n            var feePercentage = GetFeePercentage(order.Time, isMaker, isStableCoin, _makerFee, _takerFee);\n\n            // get order value in quote currency, then apply maker/taker fee factor\n            var unitPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n            unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n            // currently we do not model 30-day volume, so we use the first tier\n\n            var fee = unitPrice * order.AbsoluteQuantity * feePercentage;\n\n            return new OrderFee(new CashAmount(fee, security.QuoteCurrency.Symbol));\n        }\n\n        /// <summary>\n        /// Returns the maker/taker fee percentage effective at the requested date.\n        /// </summary>\n        /// <param name=\"utcTime\">The date/time requested (UTC)</param>\n        /// <param name=\"isMaker\">true if the maker percentage fee is requested, false otherwise</param>\n        /// <param name=\"isStableCoin\">true if the order security symbol is a StableCoin, false otherwise</param>\n        /// <param name=\"makerFee\">maker fee amount</param>\n        /// <param name=\"takerFee\">taker fee amount</param>\n        /// <returns>The fee percentage</returns>\n        protected static decimal GetFeePercentage(DateTime utcTime, bool isMaker, bool isStableCoin, decimal makerFee, decimal takerFee)\n        {\n            if (isStableCoin && utcTime < new DateTime(2022, 6, 1))\n            {                \n                return isMaker ? 0m : 0.001m;\n            }\n            else if(isStableCoin)\n            {\n                return isMaker ? MakerStablePairs : TakerStableParis;\n            }\n            else if (utcTime < new DateTime(2019, 3, 23, 1, 30, 0))\n            {\n                return isMaker ? 0m : 0.003m;\n            }\n            else if (utcTime < new DateTime(2019, 10, 8, 0, 30, 0))\n            {\n                return isMaker ? 0.0015m : 0.0025m;\n            }\n\n            // https://www.coinbase.com/advanced-fees\n            // Level      | Trading amount  | Spot fees (Maker | Taker)\n            // Advanced 1 |     >= $0       |       0.60% | 0.80%\n            return isMaker ? makerFee : takerFee;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/ConstantFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an order fee model that always returns the same order fee.\n    /// </summary>\n    public class ConstantFeeModel : FeeModel\n    {\n        private readonly decimal _fee;\n        private readonly string _currency;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantFeeModel\"/> class with the specified <paramref name=\"fee\"/>\n        /// </summary>\n        /// <param name=\"fee\">The constant order fee used by the model</param>\n        /// <param name=\"currency\">The currency of the order fee</param>\n        public ConstantFeeModel(decimal fee, string currency = \"USD\")\n        {\n            _fee = Math.Abs(fee);\n            _currency = currency;\n        }\n\n        /// <summary>\n        /// Returns the constant fee for the model in units of the account currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            return new OrderFee(new CashAmount(_fee, _currency));\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Fees/ExanteFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Exante order fees.\n    /// According to:\n    /// <list type=\"bullet\">\n    ///   <item>https://support.exante.eu/hc/en-us/articles/115005873143-Fees-overview-exchange-imposed-fees?source=search</item>\n    ///   <item>https://exante.eu/markets/</item>\n    /// </list>\n    /// </summary>\n    public class ExanteFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Market USA rate\n        /// </summary>\n        public const decimal MarketUsaRate = 0.02m;\n\n        /// <summary>\n        /// Default rate\n        /// </summary>\n        public const decimal DefaultRate = 0.02m;\n\n        private readonly decimal _forexCommissionRate;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"forexCommissionRate\">Commission rate for FX operations</param>\n        public ExanteFeeModel(decimal forexCommissionRate = 0.25m)\n        {\n            _forexCommissionRate = forexCommissionRate;\n        }\n\n        /// <summary>\n        /// Gets the order fee associated with the specified order.\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n\n            decimal feeResult;\n            string feeCurrency;\n            switch (security.Type)\n            {\n                case SecurityType.Forex:\n                    var totalOrderValue = order.GetValue(security);\n                    feeResult = Math.Abs(_forexCommissionRate * totalOrderValue);\n                    feeCurrency = Currencies.USD;\n                    break;\n\n                case SecurityType.Equity:\n                    var equityFee = ComputeEquityFee(order);\n                    feeResult = equityFee.Amount;\n                    feeCurrency = equityFee.Currency;\n                    break;\n\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    var optionsFee = ComputeOptionFee(order);\n                    feeResult = optionsFee.Amount;\n                    feeCurrency = optionsFee.Currency;\n                    break;\n\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                    feeResult = 1.5m;\n                    feeCurrency = Currencies.USD;\n                    break;\n\n                default:\n                    throw new ArgumentException(Messages.FeeModel.UnsupportedSecurityType(security));\n            }\n\n            return new OrderFee(new CashAmount(feeResult, feeCurrency));\n        }\n\n        /// <summary>\n        /// Computes fee for equity order\n        /// </summary>\n        /// <param name=\"order\">LEAN order</param>\n        private static CashAmount ComputeEquityFee(Order order)\n        {\n            switch (order.Symbol.ID.Market)\n            {\n                case Market.USA:\n                    return new CashAmount(order.AbsoluteQuantity * MarketUsaRate, Currencies.USD);\n\n                default:\n                    return new CashAmount(order.AbsoluteQuantity * order.Price * DefaultRate, Currencies.USD);\n            }\n        }\n\n        /// <summary>\n        /// Computes fee for option order\n        /// </summary>\n        /// <param name=\"order\">LEAN order</param>\n        private static CashAmount ComputeOptionFee(Order order)\n        {\n            return order.Symbol.ID.Market switch\n            {\n                Market.USA => new CashAmount(order.AbsoluteQuantity * 1.5m, Currencies.USD),\n                _ =>\n                    // ToDo: clarify the value for different exchanges\n                    throw new ArgumentException(Messages.ExanteFeeModel.UnsupportedExchange(order))\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/EzeFeeModel.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Eze fee model implementation\n    /// </summary>\n    public class EzeFeeModel : FeeModel\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/FTXFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models FTX order fees\n    /// https://help.ftx.com/hc/en-us/articles/360024479432-Fees\n    /// </summary>\n    public class FTXFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Tier 1 maker fees\n        /// </summary>\n        public virtual decimal MakerFee => 0.0002m;\n        \n        /// <summary>\n        /// Tier 1 taker fees\n        /// </summary>\n        public virtual decimal TakerFee => 0.0007m;\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n            var props = order.Properties as FTXOrderProperties;\n\n            //taker by default\n            var fee = TakerFee;\n            var unitPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n            unitPrice *= security.SymbolProperties.ContractMultiplier;\n            var currency = security.QuoteCurrency.Symbol;\n\n            //maker if limit\n            if (order.Type == OrderType.Limit && (props?.PostOnly == true || !order.IsMarketable))\n            {\n                fee =  MakerFee;\n                if (order.Direction == OrderDirection.Buy)\n                {\n                    unitPrice = 1;\n                    currency = ((IBaseCurrencySymbol)security).BaseCurrency.Symbol;\n                }\n            }\n\n            // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n            return new OrderFee(new CashAmount(\n                unitPrice * order.AbsoluteQuantity * fee,\n                currency));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/FTXUSFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models FTX order fees\n    /// https://help.ftx.us/hc/en-us/articles/360043579273-Fees\n    /// </summary>\n    public class FTXUSFeeModel : FTXFeeModel\n    {\n        /// <summary>\n        /// Tier 1 maker fees\n        /// </summary>\n        public override decimal MakerFee => 0.001m;\n        \n        /// <summary>\n        /// Tier 1 taker fees\n        /// </summary>\n        public override decimal TakerFee => 0.004m;\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/FeeModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Base class for any order fee model\n    /// </summary>\n    /// <remarks>Please use <see cref=\"FeeModel\"/> as the base class for\n    /// any implementations of <see cref=\"IFeeModel\"/></remarks>\n    public class FeeModel : IFeeModel\n    {\n        /// <summary>\n        /// Gets the order fee associated with the specified order.\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n        public virtual OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            return new OrderFee(new CashAmount(\n                0,\n                \"USD\"));\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Fees/FxcmFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models FXCM order fees\n    /// </summary>\n    public class FxcmFeeModel : FeeModel\n    {\n        private readonly string _currency;\n\n        private readonly HashSet<Symbol> _groupCommissionSchedule1 = new HashSet<Symbol>\n        {\n            Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"GBPUSD\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"USDJPY\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"USDCHF\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"AUDUSD\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"EURJPY\", SecurityType.Forex, Market.FXCM),\n            Symbol.Create(\"GBPJPY\", SecurityType.Forex, Market.FXCM),\n        };\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"currency\">The currency of the order fee, for FXCM this is the account currency</param>\n        public FxcmFeeModel(string currency = \"USD\")\n        {\n            _currency = currency;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in units of the account currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            // From http://www.fxcm.com/forex/forex-pricing/ (on Oct 6th, 2015)\n            // Forex: $0.04 per side per 1k lot for EURUSD, GBPUSD, USDJPY, USDCHF, AUDUSD, EURJPY, GBPJPY\n            //        $0.06 per side per 1k lot for other instruments\n\n            // From https://www.fxcm.com/uk/markets/cfds/frequently-asked-questions/\n            // CFD: no commissions\n\n            decimal fee = 0;\n            if (parameters.Security.Type == SecurityType.Forex)\n            {\n                var commissionRate = _groupCommissionSchedule1.Contains(parameters.Security.Symbol)\n                    ? 0.04m : 0.06m;\n\n                fee = Math.Abs(commissionRate * parameters.Order.AbsoluteQuantity / 1000);\n            }\n            return new OrderFee(new CashAmount(fee,\n                _currency));\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Fees/GDAXFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models GDAX order fees\n    /// </summary>\n    [Obsolete(\"GDAXFeeModel is deprecated. Use CoinbaseFeeModel instead.\")]\n    public class GDAXFeeModel : CoinbaseFeeModel\n    { }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/IFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents a model the simulates order fees\n    /// </summary>\n    /// <remarks>Please use <see cref=\"FeeModel\"/> as the base class for\n    /// any implementations of <see cref=\"IFeeModel\"/></remarks>\n    public interface IFeeModel\n    {\n        /// <summary>\n        /// Gets the order fee associated with the specified order.\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n        OrderFee GetOrderFee(OrderFeeParameters parameters);\n    }\n\n    /// <summary>\n    /// Provide extension method for <see cref=\"IFeeModel\"/> to enable\n    /// backwards compatibility of invocations.\n    /// </summary>\n    public static class FeeModelExtensions\n    {\n        /// <summary>\n        /// Gets the order fee associated with the specified order. This returns the cost\n        /// of the transaction in the account currency\n        /// </summary>\n        /// <param name=\"model\">The fee model</param>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to compute fees for</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public static decimal GetOrderFee(this IFeeModel model, Security security, Order order)\n        {\n            var parameters = new OrderFeeParameters(security, order);\n            var fee = model.GetOrderFee(parameters);\n\n            return fee.Value.Amount;\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Fees/IndiaFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides the default implementation of <see cref=\"IFeeModel\"/> Refer to https://www.samco.in/technology/brokerage_calculator\n    /// </summary>\n    public class IndiaFeeModel : IFeeModel\n    {\n        /// <summary>\n        /// Brokerage calculation Factor\n        /// </summary>\n        protected virtual decimal BrokerageMultiplier { get; set; }\n\n        /// <summary>\n        /// Maximum brokerage per order\n        /// </summary>\n        protected virtual decimal MaxBrokerage { get; set; }\n\n        /// <summary>\n        /// Securities Transaction Tax calculation Factor\n        /// </summary>\n        protected virtual decimal SecuritiesTransactionTaxTotalMultiplier { get; set; }\n\n        /// <summary>\n        /// Exchange Transaction Charge calculation Factor\n        /// </summary>\n        protected virtual decimal ExchangeTransactionChargeMultiplier { get; set; }\n\n        /// <summary>\n        /// State Tax calculation Factor\n        /// </summary>\n        protected virtual decimal StateTaxMultiplier { get; set; }\n\n        /// <summary>\n        /// Sebi Charges calculation Factor\n        /// </summary>\n        protected virtual decimal SebiChargesMultiplier { get; set; }\n\n        /// <summary>\n        /// Stamp Charges calculation Factor\n        /// </summary>\n        protected virtual decimal StampChargesMultiplier { get; set; }\n\n        /// <summary>\n        /// Checks if Stamp Charges is calculated from order valur or turnover\n        /// </summary>\n        protected virtual bool IsStampChargesFromOrderValue { get; set; }\n\n        /// <summary>\n        /// Gets the order fee associated with the specified order.\n        /// </summary>\n        /// <param name=\"parameters\">\n        /// A <see cref=\"OrderFeeParameters\"/> object containing the security and order\n        /// </param>\n        public OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            if (parameters.Security == null)\n            {\n                return OrderFee.Zero;\n            }\n            var orderValue = parameters.Order.GetValue(parameters.Security);\n\n            var fee = GetFee(orderValue);\n            return new OrderFee(new CashAmount(fee, Currencies.INR));\n        }\n\n        private decimal GetFee(decimal orderValue)\n        {\n            bool isSell = orderValue < 0;\n            orderValue = Math.Abs(orderValue);\n            var multiplied = orderValue * BrokerageMultiplier;\n            var brokerage = (multiplied > MaxBrokerage) ? MaxBrokerage : Math.Round(multiplied, 2);\n\n            var turnover = Math.Round(orderValue, 2);\n\n            decimal securitiesTransactionTaxTotal = 0;\n            if (isSell)\n            {\n                securitiesTransactionTaxTotal = Math.Round(orderValue * SecuritiesTransactionTaxTotalMultiplier, 2);\n            }\n\n            var exchangeTransactionCharge = Math.Round(turnover * ExchangeTransactionChargeMultiplier, 2);\n            var clearingCharge = 0;\n\n            var stateTax = Math.Round(StateTaxMultiplier * (brokerage + exchangeTransactionCharge), 2);\n\n            var sebiCharges = Math.Round((turnover * SebiChargesMultiplier), 2);\n            decimal stampCharges = 0;\n            if (!isSell)\n            {\n                if (IsStampChargesFromOrderValue)\n                {\n                    stampCharges = Math.Round((orderValue * StampChargesMultiplier), 2);\n                }\n                else\n                {\n                    stampCharges = Math.Round((turnover * StampChargesMultiplier), 2);\n                }\n            }\n\n            var totalTax = Math.Round(brokerage + securitiesTransactionTaxTotal + exchangeTransactionCharge + stampCharges + clearingCharge + stateTax + sebiCharges, 2);\n\n            return totalTax;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/InteractiveBrokersFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fills;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides the default implementation of <see cref=\"IFeeModel\"/>\n    /// </summary>\n    public class InteractiveBrokersFeeModel : FeeModel\n    {\n        private readonly decimal _forexCommissionRate;\n        private readonly decimal _forexMinimumOrderFee;\n\n        // option commission function takes number of contracts and the size of the option premium and returns total commission\n        private readonly Dictionary<string, Func<decimal, decimal, CashAmount>> _optionFee =\n            new Dictionary<string, Func<decimal, decimal, CashAmount>>();\n\n        #pragma warning disable CS1570\n        /// <summary>\n        /// Reference at https://www.interactivebrokers.com/en/index.php?f=commission&p=futures1\n        /// </summary>\n        #pragma warning restore CS1570\n        private readonly Dictionary<string, Func<Security, CashAmount>> _futureFee =\n            //                                                               IB fee + exchange fee\n            new()\n            {\n                { Market.USA, UnitedStatesFutureFees },\n                { Market.HKFE, HongKongFutureFees },\n                { Market.EUREX, EUREXFutureFees }\n            };\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ImmediateFillModel\"/>\n        /// </summary>\n        /// <param name=\"monthlyForexTradeAmountInUSDollars\">Monthly FX dollar volume traded</param>\n        /// <param name=\"monthlyOptionsTradeAmountInContracts\">Monthly options contracts traded</param>\n        public InteractiveBrokersFeeModel(decimal monthlyForexTradeAmountInUSDollars = 0, decimal monthlyOptionsTradeAmountInContracts = 0)\n        {\n            ProcessForexRateSchedule(monthlyForexTradeAmountInUSDollars, out _forexCommissionRate, out _forexMinimumOrderFee);\n            Func<decimal, decimal, CashAmount> optionsCommissionFunc;\n            ProcessOptionsRateSchedule(monthlyOptionsTradeAmountInContracts, out optionsCommissionFunc);\n            // only USA for now\n            _optionFee.Add(Market.USA, optionsCommissionFunc);\n        }\n\n        /// <summary>\n        /// Gets the order fee associated with the specified order. This returns the cost\n        /// of the transaction in the account currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n\n            // Option exercise for equity options is free of charge\n            if (order.Type == OrderType.OptionExercise)\n            {\n                var optionOrder = (OptionExerciseOrder)order;\n\n                // For Futures Options, contracts are charged the standard commission at expiration of the contract.\n                // Read more here: https://www1.interactivebrokers.com/en/index.php?f=14718#trading-related-fees\n                if (optionOrder.Symbol.ID.SecurityType == SecurityType.Option)\n                {\n                    return OrderFee.Zero;\n                }\n            }\n\n            var quantity = order.AbsoluteQuantity;\n            decimal feeResult;\n            string feeCurrency;\n            var market = security.Symbol.ID.Market;\n            switch (security.Type)\n            {\n                case SecurityType.Forex:\n                    // get the total order value in the account currency\n                    var totalOrderValue = order.GetValue(security);\n                    var fee = Math.Abs(_forexCommissionRate*totalOrderValue);\n                    feeResult = Math.Max(_forexMinimumOrderFee, fee);\n                    // IB Forex fees are all in USD\n                    feeCurrency = Currencies.USD;\n                    break;\n\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    Func<decimal, decimal, CashAmount> optionsCommissionFunc;\n                    if (!_optionFee.TryGetValue(market, out optionsCommissionFunc))\n                    {\n                        throw new KeyNotFoundException(Messages.InteractiveBrokersFeeModel.UnexpectedOptionMarket(market));\n                    }\n                    // applying commission function to the order\n                    var optionFee = optionsCommissionFunc(quantity, GetPotentialOrderPrice(order, security));\n                    feeResult = optionFee.Amount;\n                    feeCurrency = optionFee.Currency;\n                    break;\n\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                    // The futures options fee model is exactly the same as futures' fees on IB.\n                    if (market == Market.Globex || market == Market.NYMEX\n                        || market == Market.CBOT || market == Market.ICE\n                        || market == Market.CFE || market == Market.COMEX\n                        || market == Market.CME || market == Market.NYSELIFFE)\n                    {\n                        // just in case...\n                        market = Market.USA;\n                    }\n\n                    if (!_futureFee.TryGetValue(market, out var feeRatePerContractFunc))\n                    {\n                        throw new KeyNotFoundException(Messages.InteractiveBrokersFeeModel.UnexpectedFutureMarket(market));\n                    }\n\n                    var feeRatePerContract = feeRatePerContractFunc(security);\n                    feeResult = quantity * feeRatePerContract.Amount;\n                    feeCurrency = feeRatePerContract.Currency;\n                    break;\n\n                case SecurityType.Equity:\n                    EquityFee equityFee;\n                    switch (market)\n                    {\n                        case Market.USA:\n                            equityFee = new EquityFee(Currencies.USD, feePerShare: 0.005m, minimumFee: 1, maximumFeeRate: 0.005m);\n                            break;\n                        case Market.India:\n                            equityFee = new EquityFee(Currencies.INR, feePerShare: 0.01m, minimumFee: 6, maximumFeeRate: 20);\n                            break;\n                        default:\n                            throw new KeyNotFoundException(Messages.InteractiveBrokersFeeModel.UnexpectedEquityMarket(market));\n                    }\n                    var tradeValue = Math.Abs(order.GetValue(security));\n\n                    //Per share fees\n                    var tradeFee = equityFee.FeePerShare * quantity;\n\n                    //Maximum Per Order: equityFee.MaximumFeeRate\n                    //Minimum per order. $equityFee.MinimumFee\n                    var maximumPerOrder = equityFee.MaximumFeeRate * tradeValue;\n                    if (tradeFee < equityFee.MinimumFee)\n                    {\n                        tradeFee = equityFee.MinimumFee;\n                    }\n                    else if (tradeFee > maximumPerOrder)\n                    {\n                        tradeFee = maximumPerOrder;\n                    }\n\n                    feeCurrency = equityFee.Currency;\n                    //Always return a positive fee.\n                    feeResult = Math.Abs(tradeFee);\n                    break;\n\n                case SecurityType.Cfd:\n                    var value = Math.Abs(order.GetValue(security));\n                    feeResult = 0.00002m * value; // 0.002%\n                    feeCurrency = security.QuoteCurrency.Symbol;\n\n                    var minimumFee = security.QuoteCurrency.Symbol switch\n                    {\n                        \"JPY\" => 40.0m,\n                        \"HKD\" => 10.0m,\n                        _ => 1.0m\n                    };\n                    feeResult = Math.Max(feeResult, minimumFee);\n                    break;\n\n                default:\n                    // unsupported security type\n                    throw new ArgumentException(Messages.FeeModel.UnsupportedSecurityType(security));\n            }\n\n            return new OrderFee(new CashAmount(\n                feeResult,\n                feeCurrency));\n        }\n\n        /// <summary>\n        /// Approximates the order's price based on the order type\n        /// </summary>\n        protected static decimal GetPotentialOrderPrice(Order order, Security security)\n        {\n            decimal price = 0;\n            switch (order.Type)\n            {\n                case OrderType.TrailingStop:\n                    price = (order as TrailingStopOrder).StopPrice;\n                    break;\n                case OrderType.StopMarket:\n                    price = (order as StopMarketOrder).StopPrice;\n                    break;\n                case OrderType.ComboMarket:\n                case OrderType.MarketOnOpen:\n                case OrderType.MarketOnClose:\n                case OrderType.Market:\n                    decimal securityPrice;\n                    if (order.Direction == OrderDirection.Buy)\n                    {\n                        price = security.BidPrice;\n                    }\n                    else\n                    {\n                        price = security.AskPrice;\n                    }\n                    break;\n                case OrderType.ComboLimit:\n                    price = (order as ComboLimitOrder).GroupOrderManager.LimitPrice;\n                    break;\n                case OrderType.ComboLegLimit:\n                    price = (order as ComboLegLimitOrder).LimitPrice;\n                    break;\n                case OrderType.StopLimit:\n                    price = (order as StopLimitOrder).LimitPrice;\n                    break;\n                case OrderType.LimitIfTouched:\n                    price = (order as LimitIfTouchedOrder).LimitPrice;\n                    break;\n                case OrderType.Limit:\n                    price = (order as LimitOrder).LimitPrice;\n                    break;\n            }\n\n            return price;\n        }\n\n        /// <summary>\n        /// Determines which tier an account falls into based on the monthly trading volume\n        /// </summary>\n        private static void ProcessForexRateSchedule(decimal monthlyForexTradeAmountInUSDollars, out decimal commissionRate, out decimal minimumOrderFee)\n        {\n            const decimal bp = 0.0001m;\n            if (monthlyForexTradeAmountInUSDollars <= 1000000000)      // 1 billion\n            {\n                commissionRate = 0.20m * bp;\n                minimumOrderFee = 2.00m;\n            }\n            else if (monthlyForexTradeAmountInUSDollars <= 2000000000) // 2 billion\n            {\n                commissionRate = 0.15m * bp;\n                minimumOrderFee = 1.50m;\n            }\n            else if (monthlyForexTradeAmountInUSDollars <= 5000000000) // 5 billion\n            {\n                commissionRate = 0.10m * bp;\n                minimumOrderFee = 1.25m;\n            }\n            else\n            {\n                commissionRate = 0.08m * bp;\n                minimumOrderFee = 1.00m;\n            }\n        }\n\n        /// <summary>\n        /// Determines which tier an account falls into based on the monthly trading volume\n        /// </summary>\n        private static void ProcessOptionsRateSchedule(decimal monthlyOptionsTradeAmountInContracts, out Func<decimal, decimal, CashAmount> optionsCommissionFunc)\n        {\n            if (monthlyOptionsTradeAmountInContracts <= 10000)\n            {\n                optionsCommissionFunc = (orderSize, premium) =>\n                {\n                    var commissionRate = premium >= 0.1m ?\n                                            0.65m :\n                                            (0.05m <= premium && premium < 0.1m ? 0.5m : 0.25m);\n                    return new CashAmount(Math.Max(orderSize * commissionRate, 1.0m), Currencies.USD);\n                };\n            }\n            else if (monthlyOptionsTradeAmountInContracts <= 50000)\n            {\n                optionsCommissionFunc = (orderSize, premium) =>\n                {\n                    var commissionRate = premium >= 0.05m ? 0.5m : 0.25m;\n                    return new CashAmount(Math.Max(orderSize * commissionRate, 1.0m), Currencies.USD);\n                };\n            }\n            else if (monthlyOptionsTradeAmountInContracts <= 100000)\n            {\n                optionsCommissionFunc = (orderSize, premium) =>\n                {\n                    var commissionRate = 0.25m;\n                    return new CashAmount(Math.Max(orderSize * commissionRate, 1.0m), Currencies.USD);\n                };\n            }\n            else\n            {\n                optionsCommissionFunc = (orderSize, premium) =>\n                {\n                    var commissionRate = 0.15m;\n                    return new CashAmount(Math.Max(orderSize * commissionRate, 1.0m), Currencies.USD);\n                };\n            }\n        }\n\n        private static CashAmount UnitedStatesFutureFees(Security security)\n        {\n            IDictionary<string, decimal> fees, exchangeFees;\n            decimal ibFeePerContract, exchangeFeePerContract;\n            string symbol;\n\n            switch (security.Symbol.SecurityType)\n            {\n                case SecurityType.Future:\n                    fees = _usaFuturesFees;\n                    exchangeFees = _usaFuturesExchangeFees;\n                    symbol = security.Symbol.ID.Symbol;\n                    break;\n                case SecurityType.FutureOption:\n                    fees = _usaFutureOptionsFees;\n                    exchangeFees = _usaFutureOptionsExchangeFees;\n                    symbol = security.Symbol.Underlying.ID.Symbol;\n                    break;\n                default:\n                    throw new ArgumentException(Messages.InteractiveBrokersFeeModel.UnitedStatesFutureFeesUnsupportedSecurityType(security));\n            }\n\n            if (!fees.TryGetValue(symbol, out ibFeePerContract))\n            {\n                ibFeePerContract = 0.85m;\n            }\n\n            if (!exchangeFees.TryGetValue(symbol, out exchangeFeePerContract))\n            {\n                exchangeFeePerContract = 1.60m;\n            }\n\n            // Add exchange fees + IBKR regulatory fee (0.02)\n            return new CashAmount(ibFeePerContract + exchangeFeePerContract + 0.02m, Currencies.USD);\n        }\n\n        /// <summary>\n        /// See https://www.hkex.com.hk/Services/Rules-and-Forms-and-Fees/Fees/Listed-Derivatives/Trading/Transaction?sc_lang=en\n        /// </summary>\n        private static CashAmount HongKongFutureFees(Security security)\n        {\n            if (security.Symbol.ID.Symbol.Equals(\"HSI\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                // IB fee + exchange fee\n                return new CashAmount(30 + 10, Currencies.HKD);\n            }\n\n            decimal ibFeePerContract;\n            switch (security.QuoteCurrency.Symbol)\n            {\n                case Currencies.CNH:\n                    ibFeePerContract = 13;\n                    break;\n                case Currencies.HKD:\n                    ibFeePerContract = 20;\n                    break;\n                case Currencies.USD:\n                    ibFeePerContract = 2.40m;\n                    break;\n                default:\n                    throw new ArgumentException(Messages.InteractiveBrokersFeeModel.HongKongFutureFeesUnexpectedQuoteCurrency(security));\n            }\n\n            // let's add a 50% extra charge for exchange fees\n            return new CashAmount(ibFeePerContract * 1.5m, security.QuoteCurrency.Symbol);\n        }\n\n        private static CashAmount EUREXFutureFees(Security security)\n        {\n            IDictionary<string, decimal> fees, exchangeFees;\n            decimal ibFeePerContract, exchangeFeePerContract;\n            string symbol;\n\n            switch (security.Symbol.SecurityType)\n            {\n                case SecurityType.Future:\n                    fees = _eurexFuturesFees;\n                    exchangeFees = _eurexFuturesExchangeFees;\n                    symbol = security.Symbol.ID.Symbol;\n                    break;\n                default:\n                    throw new ArgumentException(Messages.InteractiveBrokersFeeModel.EUREXFutureFeesUnsupportedSecurityType(security));\n            }\n\n            if (!fees.TryGetValue(symbol, out ibFeePerContract))\n            {\n                ibFeePerContract = 1.00m;\n            }\n\n            if (!exchangeFees.TryGetValue(symbol, out exchangeFeePerContract))\n            {\n                exchangeFeePerContract = 0.00m;\n            }\n\n            // Add exchange fees + IBKR regulatory fee (0.02)\n            return new CashAmount(ibFeePerContract + exchangeFeePerContract + 0.02m, Currencies.EUR);\n        }\n\n        /// <summary>\n        /// Reference at https://www.interactivebrokers.com/en/pricing/commissions-futures.php?re=amer\n        /// </summary>\n        private static readonly Dictionary<string, decimal> _usaFuturesFees = new()\n        {\n            // Micro E-mini Futures\n            { \"MYM\", 0.25m }, { \"M2K\", 0.25m }, { \"MES\", 0.25m }, { \"MNQ\", 0.25m }, { \"2YY\", 0.25m }, { \"5YY\", 0.25m }, { \"10Y\", 0.25m },\n            { \"30Y\", 0.25m }, { \"MCL\", 0.25m }, { \"MGC\", 0.25m }, { \"SIL\", 0.25m },\n            // Cryptocurrency Futures\n            { \"BTC\", 5m }, { \"MBT\", 2.25m }, { \"ETH\", 3m }, { \"MET\", 0.20m }, { \"MIB\", 2.25m }, { \"MRB\", 0.20m },\n            // E-mini FX (currencies) Futures\n            { \"E7\", 0.50m }, { \"J7\", 0.50m },\n            // Micro E-mini FX (currencies) Futures\n            { \"M6E\", 0.15m }, { \"M6A\", 0.15m }, { \"M6B\", 0.15m }, { \"MCD\", 0.15m }, { \"MJY\", 0.15m }, { \"MSF\", 0.15m }, { \"M6J\", 0.15m },\n            { \"MIR\", 0.15m }, { \"M6C\", 0.15m }, { \"M6S\", 0.15m }, { \"MNH\", 0.15m },\n        };\n\n        /// <summary>\n        /// Reference at https://www.interactivebrokers.com/en/pricing/commissions-futures-europe.php?re=europe\n        /// </summary>\n        private static readonly Dictionary<string, decimal> _eurexFuturesFees = new()\n        {\n            // Futures\n            { \"FESX\", 1.00m },\n        };\n\n        private static readonly Dictionary<string, decimal> _usaFutureOptionsFees = new()\n        {\n            // Micro E-mini Future Options\n            { \"MYM\", 0.25m }, { \"M2K\", 0.25m }, { \"MES\", 0.25m }, { \"MNQ\", 0.25m }, { \"2YY\", 0.25m }, { \"5YY\", 0.25m }, { \"10Y\", 0.25m },\n            { \"30Y\", 0.25m }, { \"MCL\", 0.25m }, { \"MGC\", 0.25m }, { \"SIL\", 0.25m },\n            // Cryptocurrency Future Options\n            { \"BTC\", 5m }, { \"MBT\", 1.25m }, { \"ETH\", 3m }, { \"MET\", 0.10m }, { \"MIB\", 1.25m }, { \"MRB\", 0.10m }\n        };\n\n        private static readonly Dictionary<string, decimal> _usaFuturesExchangeFees = new()\n        {\n            // E-mini Futures\n            { \"ES\", 1.28m }, { \"NQ\", 1.28m }, { \"YM\", 1.28m }, { \"RTY\", 1.28m }, { \"EMD\", 1.28m },\n            // Micro E-mini Futures\n            { \"MYM\", 0.30m }, { \"M2K\", 0.30m }, { \"MES\", 0.30m }, { \"MNQ\", 0.30m }, { \"2YY\", 0.30m }, { \"5YY\", 0.30m }, { \"10Y\", 0.30m },\n            { \"30Y\", 0.30m }, { \"MCL\", 0.30m }, { \"MGC\", 0.30m }, { \"SIL\", 0.30m },\n            // Cryptocurrency Futures\n            { \"BTC\", 6m }, { \"MBT\", 2.5m }, { \"ETH\", 4m }, { \"MET\", 0.20m }, { \"MIB\", 2.5m }, { \"MRB\", 0.20m },\n            // E-mini FX (currencies) Futures\n            { \"E7\", 0.85m }, { \"J7\", 0.85m },\n            // Micro E-mini FX (currencies) Futures\n            { \"M6E\", 0.24m }, { \"M6A\", 0.24m }, { \"M6B\", 0.24m }, { \"MCD\", 0.24m }, { \"MJY\", 0.24m }, { \"MSF\", 0.24m }, { \"M6J\", 0.24m },\n            { \"MIR\", 0.24m }, { \"M6C\", 0.24m }, { \"M6S\", 0.24m }, { \"MNH\", 0.24m },\n        };\n\n        private static readonly Dictionary<string, decimal> _eurexFuturesExchangeFees = new()\n        {\n            // Futures\n            { \"FESX\", 0.00m },\n        };\n\n        private static readonly Dictionary<string, decimal> _usaFutureOptionsExchangeFees = new()\n        {\n            // E-mini Future Options\n            { \"ES\", 0.55m }, { \"NQ\", 0.55m }, { \"YM\", 0.55m }, { \"RTY\", 0.55m }, { \"EMD\", 0.55m },\n            // Micro E-mini Future Options\n            { \"MYM\", 0.20m }, { \"M2K\", 0.20m }, { \"MES\", 0.20m }, { \"MNQ\", 0.20m }, { \"2YY\", 0.20m }, { \"5YY\", 0.20m }, { \"10Y\", 0.20m },\n            { \"30Y\", 0.20m }, { \"MCL\", 0.20m }, { \"MGC\", 0.20m }, { \"SIL\", 0.20m },\n            // Cryptocurrency Future Options\n            { \"BTC\", 5m }, { \"MBT\", 2.5m }, { \"ETH\", 4m }, { \"MET\", 0.20m }, { \"MIB\", 2.5m }, { \"MRB\", 0.20m },\n        };\n\n        /// <summary>\n        /// Helper class to handle IB Equity fees\n        /// </summary>\n        private class EquityFee\n        {\n            public string Currency { get; }\n            public decimal FeePerShare { get; }\n            public decimal MinimumFee { get; }\n            public decimal MaximumFeeRate { get; }\n\n            public EquityFee(string currency,\n                decimal feePerShare,\n                decimal minimumFee,\n                decimal maximumFeeRate)\n            {\n                Currency = currency;\n                FeePerShare = feePerShare;\n                MinimumFee = minimumFee;\n                MaximumFeeRate = maximumFeeRate;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/KrakenFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Kraken order fees\n    /// </summary>\n    public class KrakenFeeModel : FeeModel\n    {\n        /// <summary>\n        /// We don't use 30 day model, so using only tier1 fees.\n        /// https://www.kraken.com/features/fee-schedule#kraken-pro\n        /// </summary>\n        public const decimal MakerTier1CryptoFee = 0.0016m;\n        \n        /// <summary>\n        /// We don't use 30 day model, so using only tier1 fees.\n        /// https://www.kraken.com/features/fee-schedule#kraken-pro\n        /// </summary>\n        public const decimal TakerTier1CryptoFee = 0.0026m;\n        \n        /// <summary>\n        /// We don't use 30 day model, so using only tier1 fees.\n        /// https://www.kraken.com/features/fee-schedule#stablecoin-fx-pairs\n        /// </summary>\n        public const decimal Tier1FxFee = 0.002m;\n\n        /// <summary>\n        /// Fiats and stablecoins list that have own fee.\n        /// </summary>\n        public List<string> FxStablecoinList { get; init; } = new() {\"CAD\", \"EUR\", \"GBP\", \"JPY\", \"USD\", \"USDT\", \"DAI\", \"USDC\"};\n \n        /// <summary>\n        /// Get the fee for this order.\n        /// If sell - fees in base currency\n        /// If buy - fees in quote currency\n        /// It can be defined manually in <see cref=\"KrakenOrderProperties\"/>\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The fee of the order</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var security = parameters.Security;\n\n            var isBuy = order.Direction == OrderDirection.Buy;\n            var unitPrice = isBuy ? security.AskPrice : security.BidPrice;\n\n            if (order.Type == OrderType.Limit)\n            {\n                // limit order posted to the order book\n                unitPrice = ((LimitOrder)order).LimitPrice;\n            }\n            \n            unitPrice *= security.SymbolProperties.ContractMultiplier;\n\n            var fee = TakerTier1CryptoFee;\n\n            var props = order.Properties as KrakenOrderProperties;\n            \n            if (order.Type == OrderType.Limit &&\n                (props?.PostOnly == true || !order.IsMarketable))\n            {\n                // limit order posted to the order book\n                fee = MakerTier1CryptoFee;\n            }\n\n            if (isBuy && props?.FeeInBase == true)\n            {\n                isBuy = false;\n            }\n            \n            if (!isBuy && props?.FeeInQuote == true)\n            {\n                isBuy = true;\n            }\n\n            if (FxStablecoinList.Any(i => security.Symbol.Value.StartsWith(i)))\n            {\n                fee = Tier1FxFee;\n            }\n            string actualBaseCurrency;\n            string actualQuoteCurrency;\n\n            CurrencyPairUtil.DecomposeCurrencyPair(security.Symbol, out actualBaseCurrency, out actualQuoteCurrency);\n            \n            return new OrderFee(new CashAmount(\n                isBuy ? unitPrice * order.AbsoluteQuantity * fee : 1 * order.AbsoluteQuantity * fee,\n                isBuy ? actualQuoteCurrency : actualBaseCurrency));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/ModifiedFillQuantityOrderFee.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// An order fee where the fee quantity has already been subtracted from the filled quantity so instead we subtracted\n    /// from the quote currency when applied to the portfolio\n    /// </summary>\n    /// <remarks>\n    /// This type of order fee is returned by some crypto brokerages (e.g. Bitfinex and Binance)\n    /// with buy orders with cash accounts.\n    /// </remarks>\n    public class ModifiedFillQuantityOrderFee : OrderFee\n    {\n        private readonly string _quoteCurrency;\n        private readonly decimal _contractMultiplier;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModifiedFillQuantityOrderFee\"/> class\n        /// </summary>\n        /// <param name=\"orderFee\">The order fee</param>\n        /// <param name=\"quoteCurrency\">The associated security quote currency</param>\n        /// <param name=\"contractMultiplier\">The associated security contract multiplier</param>\n        public ModifiedFillQuantityOrderFee(CashAmount orderFee, string quoteCurrency, decimal contractMultiplier)\n            : base(orderFee)\n        {\n            _quoteCurrency = quoteCurrency;\n            _contractMultiplier = contractMultiplier;\n        }\n\n        /// <summary>\n        /// Applies the order fee to the given portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">The portfolio instance</param>\n        /// <param name=\"fill\">The order fill event</param>\n        public override void ApplyToPortfolio(SecurityPortfolioManager portfolio, OrderEvent fill)\n        {\n            portfolio.CashBook[_quoteCurrency].AddAmount(-Value.Amount * fill.FillPrice * _contractMultiplier);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/OrderFee.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing ProtoBuf;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Defines the result for <see cref=\"IFeeModel.GetOrderFee\"/>\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class OrderFee\n    {\n        /// <summary>\n        /// Gets the order fee\n        /// </summary>\n        [ProtoMember(1)]\n        public CashAmount Value { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderFee\"/> class\n        /// </summary>\n        /// <param name=\"orderFee\">The order fee</param>\n        public OrderFee(CashAmount orderFee)\n        {\n            Value = new CashAmount(\n                orderFee.Amount.Normalize(),\n                orderFee.Currency);\n        }\n\n        /// <summary>\n        /// Applies the order fee to the given portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">The portfolio instance</param>\n        /// <param name=\"fill\">The order fill event</param>\n        public virtual void ApplyToPortfolio(SecurityPortfolioManager portfolio, OrderEvent fill)\n        {\n            portfolio.CashBook[Value.Currency].AddAmount(-Value.Amount);\n        }\n\n        /// <summary>\n        /// This is for backward compatibility with old 'decimal' order fee\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Value.Amount} {Value.Currency}\";\n        }\n\n        /// <summary>\n        /// This is for backward compatibility with old 'decimal' order fee\n        /// </summary>\n        public static implicit operator decimal(OrderFee m)\n        {\n            return m.Value.Amount;\n        }\n\n        /// <summary>\n        /// Gets an instance of <see cref=\"OrderFee\"/> that represents zero.\n        /// </summary>\n        public static readonly OrderFee Zero =\n            new OrderFee(new CashAmount(0, Currencies.NullCurrency));\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/OrderFeeParameters.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing QuantConnect.Securities;\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IFeeModel.GetOrderFee\"/>\n    /// </summary>\n    public class OrderFeeParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the order\n        /// </summary>\n        public Order Order { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderFeeParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"order\">The order</param>\n        public OrderFeeParameters(Security security, Order order)\n        {\n            Security = security;\n            Order = order;\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Fees/RBIFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models RBI order fees\n    /// </summary>\n    public class RBIFeeModel : FeeModel\n    {\n        private readonly decimal _feesPerShare;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"feesPerShare\">The fees per share to apply</param>\n        /// <remarks>Default value is $0.005 per share</remarks>\n        public RBIFeeModel(decimal? feesPerShare = null)\n        {\n            _feesPerShare = feesPerShare ?? 0.005m;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            return new OrderFee(new CashAmount(_feesPerShare * parameters.Order.AbsoluteQuantity, Currencies.USD));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/SamcoFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides the default implementation of <see cref=\"IFeeModel\"/> Refer to https://www.samco.in/technology/brokerage_calculator\n    /// </summary>\n    public class SamcoFeeModel : IndiaFeeModel\n    {\n        /// <summary>\n        /// Brokerage calculation Factor\n        /// </summary>\n        protected override decimal BrokerageMultiplier => 0.0002M;\n\n        /// <summary>\n        /// Maximum brokerage per order\n        /// </summary>\n        protected override decimal MaxBrokerage => 20;\n\n        /// <summary>\n        /// Securities Transaction Tax calculation Factor\n        /// </summary>\n        protected override decimal SecuritiesTransactionTaxTotalMultiplier => 0.00025M;\n\n        /// <summary>\n        /// Exchange Transaction Charge calculation Factor\n        /// </summary>\n        protected override decimal ExchangeTransactionChargeMultiplier => 0.0000345M;\n\n        /// <summary>\n        /// State Tax calculation Factor\n        /// </summary>\n        protected override decimal StateTaxMultiplier => 0.18M;\n\n        /// <summary>\n        /// Sebi Charges calculation Factor\n        /// </summary>\n        protected override decimal SebiChargesMultiplier => 0.000001M;\n\n        /// <summary>\n        /// Stamp Charges calculation Factor\n        /// </summary>\n        protected override decimal StampChargesMultiplier => 0.00003M;\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/TDAmeritradeFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models TDAmeritrade order fees\n    /// </summary>\n    public class TDAmeritradeFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var order = parameters.Order;\n            var symbolSecurityType = order.Symbol.SecurityType;\n\n            switch(symbolSecurityType)\n            {\n                case SecurityType.Equity:\n                    return new OrderFee(new CashAmount(0m, Currencies.USD));\n                case SecurityType.Option:\n                    return new OrderFee(new CashAmount(0.65m * order.AbsoluteQuantity, Currencies.USD));\n            };\n\n            throw new System.ArgumentException(Messages.TDAmeritradeFeeModel.UnsupportedSecurityType(symbolSecurityType));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/TastytradeFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents a fee model specific to Tastytrade.\n    /// </summary>\n    /// <see href=\"https://tastytrade.com/pricing/\"/>\n    public class TastytradeFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Represents the fee associated with equity options transactions (per contract).\n        /// </summary>\n        private const decimal _optionFeeOpen = 1m;\n\n        /// <summary>\n        /// The fee associated with futures transactions (per contract).\n        /// </summary>\n        private const decimal _futureFee = 1.25m;\n\n        /// <summary>\n        /// The fee associated with futures options transactions (per contract).\n        /// </summary>\n        private const decimal _futureOptionFeeOpen = 2.5m;\n\n        /// <summary>\n        /// Gets the order fee for a given security and order.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters including the security and order details.</param>\n        /// <returns>\n        /// A <see cref=\"OrderFee\"/> instance representing the total fee for the order,\n        /// or <see cref=\"OrderFee.Zero\"/> if no fee is applicable.\n        /// </returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            var feeRate = default(decimal);\n            switch (parameters.Security.Type)\n            {\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    feeRate = IsOpenPosition(parameters.Order.Direction, parameters.Security.Holdings.Quantity) ? _optionFeeOpen : 0m;\n                    break;\n                case SecurityType.Future:\n                    feeRate = _futureFee;\n                    break;\n                case SecurityType.FutureOption:\n                    feeRate = IsOpenPosition(parameters.Order.Direction, parameters.Security.Holdings.Quantity) ? _futureOptionFeeOpen : 0m;\n                    break;\n                default:\n                    break;\n            }\n\n            return new OrderFee(new CashAmount(parameters.Order.AbsoluteQuantity * feeRate, Currencies.USD));\n        }\n\n        /// <summary>\n        /// Determines whether the specified order represents the opening of a new position.\n        /// </summary>\n        /// <param name=\"orderDirection\">The direction of the order (buy/sell).</param>\n        /// <param name=\"holdingsQuantity\">The current holdings quantity for the security.</param>\n        /// <returns>\n        /// <c>true</c> if the order is intended to open a new position; otherwise, <c>false</c>.\n        /// </returns>\n        /// <exception cref=\"NotSupportedException\">\n        /// Thrown when the resolved <see cref=\"OrderPosition\"/> is not recognized.\n        /// </exception>\n        private static bool IsOpenPosition(OrderDirection orderDirection, decimal holdingsQuantity)\n        {\n            var orderPosition = BrokerageExtensions.GetOrderPosition(orderDirection, holdingsQuantity);\n\n            return orderPosition switch\n            {\n                OrderPosition.BuyToClose or OrderPosition.SellToClose => false,\n                OrderPosition.BuyToOpen or OrderPosition.SellToOpen => true,\n                _ => throw new NotSupportedException($\"{nameof(TastytradeFeeModel)}.{nameof(IsOpenPosition)}: Unsupported order position: {orderPosition}\")\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/TradeStationFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Represents a fee model specific to TradeStation.\n    /// </summary>\n    /// <see href=\"https://www.tradestation.com/pricing\"/>\n    /// <remarks>\n    /// It is $0 for domestic and $5 for international clients for normal equities trades up to 10,000 shares, then $0.005 per share after.\n    /// Options are $0.60 per contract, per side, and an extra $1 for index options\n    /// </remarks>\n    public class TradeStationFeeModel : FeeModel\n    {\n        /// <summary>\n        /// Represents the fee associated with equity options transactions (per contract).\n        /// </summary>\n        private const decimal _equityOptionFee = 0.6m;\n\n        /// <summary>\n        /// Represents the fee associated with index options transactions (per contract).\n        /// </summary>\n        private const decimal _indexOptionFee = 1m;\n\n        /// <summary>\n        /// Represents the fee associated with futures transactions (per contract, per side).\n        /// </summary>\n        private const decimal _futuresFee = 1.5m;\n\n        /// <summary>\n        /// Gets the commission per trade based on the residency status of the entity or person.\n        /// </summary>\n        private decimal CommissionPerTrade => USResident ? 0m : 5.0m;\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the entity or person is a resident of the United States.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if the entity or person is a US resident; otherwise, <c>false</c>.\n        /// </value>\n        public bool USResident { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TradeStationFeeModel\"/> class.\n        /// </summary>\n        /// <param name=\"usResident\">\n        /// A boolean value indicating whether the entity or person is a US resident.\n        /// Default is <c>true</c>.\n        /// </param>\n        public TradeStationFeeModel(bool usResident = true)\n        {\n            USResident = usResident;\n        }\n\n        /// <summary>\n        /// Calculates the order fee based on the security type and order parameters.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters for the order fee calculation, which include security and order details.</param>\n        /// <returns>\n        /// An <see cref=\"OrderFee\"/> instance representing the calculated order fee.\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">\n        /// Thrown when <paramref name=\"parameters\"/> is <c>null</c>.\n        /// </exception>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            if (parameters == null)\n            {\n                throw new ArgumentNullException(nameof(parameters), \"Order fee parameters cannot be null.\");\n            }\n\n            switch (parameters.Security.Type)\n            {\n                case SecurityType.Option:\n                    return new OrderFee(new CashAmount(CommissionPerTrade + parameters.Order.AbsoluteQuantity * _equityOptionFee, Currencies.USD));\n                case SecurityType.IndexOption:\n                    return new OrderFee(new CashAmount(CommissionPerTrade + parameters.Order.AbsoluteQuantity * _indexOptionFee, Currencies.USD));\n                case SecurityType.Future:\n                    return new OrderFee(new CashAmount(parameters.Order.AbsoluteQuantity * _futuresFee, Currencies.USD));\n                default:\n                    return new OrderFee(new CashAmount(CommissionPerTrade, Currencies.USD));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/WolverineFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"FeeModel\"/> that models Wolverine order fees\n    /// </summary>\n    public class WolverineFeeModel : FeeModel\n    {\n        private readonly decimal _feesPerShare;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"feesPerShare\">The fees per share to apply</param>\n        /// <remarks>Default value is $0.005 per share</remarks>\n        public WolverineFeeModel(decimal? feesPerShare = null)\n        {\n            _feesPerShare = feesPerShare ?? 0.005m;\n        }\n\n        /// <summary>\n        /// Get the fee for this order in quote currency\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in quote currency</returns>\n        public OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            return new OrderFee(new CashAmount(_feesPerShare * parameters.Order.AbsoluteQuantity, Currencies.USD));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/ZerodhaFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fees\n{\n    /// <summary>\n    /// Provides the default implementation of <see cref=\"IFeeModel\"/> Refer to https://www.samco.in/technology/brokerage_calculator\n    /// </summary>\n    public class ZerodhaFeeModel : IndiaFeeModel\n    {\n        /// <summary>\n        /// Brokerage calculation Factor\n        /// </summary>\n        protected override decimal BrokerageMultiplier => 0.0003M;\n\n        /// <summary>\n        /// Maximum brokerage per order\n        /// </summary>\n        protected override decimal MaxBrokerage => 20;\n\n        /// <summary>\n        /// Securities Transaction Tax calculation Factor\n        /// </summary>\n        protected override decimal SecuritiesTransactionTaxTotalMultiplier => 0.00025M;\n\n        /// <summary>\n        /// Exchange Transaction Charge calculation Factor\n        /// </summary>\n        protected override decimal ExchangeTransactionChargeMultiplier => 0.0000345M;\n\n        /// <summary>\n        /// State Tax calculation Factor\n        /// </summary>\n        protected override decimal StateTaxMultiplier => 0.18M;\n\n        /// <summary>\n        /// Sebi Charges calculation Factor\n        /// </summary>\n        protected override decimal SebiChargesMultiplier => 0.000001M;\n\n        /// <summary>\n        /// Stamp Charges calculation Factor\n        /// </summary>\n        protected override decimal StampChargesMultiplier => 0.00003M;\n\n        /// <summary>\n        /// Checks if Stamp Charges is calculated from order valur or turnover\n        /// </summary>\n        protected override bool IsStampChargesFromOrderValue => true;\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fees/dYdXFeeModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fees;\n\n/// <summary>\n/// dYdX fee model implementation\n/// </summary>\npublic class dYdXFeeModel : FeeModel\n{\n    /// <summary>\n    /// Tier 1 maker fees\n    /// https://dydx.trade/portfolio/fees\n    /// </summary>\n    private const decimal MakerTier1Fee = 0.0001m;\n\n    /// <summary>\n    /// Tier 1 taker fees\n    /// https://dydx.trade/portfolio/fees\n    /// </summary>\n    private const decimal TakerTier1Fee = 0.0005m;\n\n    private readonly decimal _makerFee;\n    private readonly decimal _takerFee;\n\n    /// <summary>\n    /// Creates Binance fee model setting fees values\n    /// </summary>\n    /// <param name=\"mFee\">Maker fee value</param>\n    /// <param name=\"tFee\">Taker fee value</param>\n    public dYdXFeeModel(decimal mFee = MakerTier1Fee, decimal tFee = TakerTier1Fee)\n    {\n        _makerFee = mFee;\n        _takerFee = tFee;\n    }\n\n    /// <summary>\n    /// Gets the order fee associated with the specified order.\n    /// </summary>\n    /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n    /// containing the security and order</param>\n    /// <returns>The cost of the order in a <see cref=\"CashAmount\"/> instance</returns>\n    public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n    {\n        var security = parameters.Security;\n        var order = parameters.Order;\n\n        var fee = GetFee(order);\n        var positionValue = security.Holdings.GetQuantityValue(order.AbsoluteQuantity, security.Price);\n\n        return new OrderFee(new CashAmount(positionValue.Amount * fee, positionValue.Cash.Symbol));\n    }\n\n    /// <summary>\n    /// Gets the fee factor for the given order\n    /// </summary>\n    /// <param name=\"order\">The order to get the fee factor for</param>\n    /// <returns>The fee factor for the given order</returns>\n    protected virtual decimal GetFee(Order order)\n    {\n        return GetFee(order, _makerFee, _takerFee);\n    }\n\n    private static decimal GetFee(Order order, decimal makerFee, decimal takerFee)\n    {\n        // apply fee factor, currently we do not model 30-day volume, so we use the first tier\n        var fee = takerFee;\n        var props = order.Properties as dYdXOrderProperties;\n\n        if (order.Type == OrderType.Limit && (props is { PostOnly: true } || !order.IsMarketable))\n        {\n            // limit order posted to the order book\n            fee = makerFee;\n        }\n\n        return fee;\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/EquityFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Represents the fill model used to simulate order fills for equities\n    /// </summary>\n    public class EquityFillModel : FillModel\n    {\n        /// <summary>\n        /// Default limit if touched fill model implementation in base class security.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <remarks>\n        ///     There is no good way to model limit orders with OHLC because we never know whether the market has\n        ///     gapped past our fill price. We have to make the assumption of a fluid, high volume market.\n        ///\n        ///     With Limit if Touched orders, whether or not a trigger is surpassed is determined by the high (low)\n        ///     of the previous tradebar when making a sell (buy) request. Following the behaviour of\n        ///     <see cref=\"StopLimitFill\"/>, current quote information is used when determining fill parameters\n        ///     (e.g., price, quantity) as the tradebar containing the incoming data is not yet consolidated.\n        ///     This conservative approach, however, can lead to trades not occuring as would be expected when\n        ///     compared to future consolidated data.\n        /// </remarks>\n        public override OrderEvent LimitIfTouchedFill(Security asset, LimitIfTouchedOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Fill only if open or extended\n            if (!IsExchangeOpen(asset,\n                Parameters.ConfigProvider\n                    .GetSubscriptionDataConfigs(asset.Symbol)\n                    .IsExtendedMarketHours()))\n            {\n                return fill;\n            }\n\n            // Get the trade bar that closes after the order time\n            var tradeBar = GetBestEffortTradeBar(asset, order.Time);\n\n            // Do not fill on stale data\n            if (tradeBar == null) return fill;\n\n            //Check if the limit if touched order was filled:\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    //-> 1.2 Buy: If Price below Trigger, Buy:\n                    if (tradeBar.Low <= order.TriggerPrice || order.TriggerTouched)\n                    {\n                        order.TriggerTouched = true;\n                        var askCurrent = GetBestEffortAskPrice(asset, order.Time, out var fillMessage);\n\n                        if (askCurrent <= order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Min(askCurrent, order.LimitPrice);\n                            fill.FillQuantity = order.Quantity;\n                            fill.Message = fillMessage;\n                        }\n                    }\n\n                    break;\n\n                case OrderDirection.Sell:\n                    //-> 1.2 Sell: If Price above Trigger, Sell:\n                    if (tradeBar.High >= order.TriggerPrice || order.TriggerTouched)\n                    {\n                        order.TriggerTouched = true;\n                        var bidCurrent = GetBestEffortBidPrice(asset, order.Time, out var fillMessage);\n\n                        if (bidCurrent >= order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Max(bidCurrent, order.LimitPrice);\n                            fill.FillQuantity = order.Quantity;\n                            fill.Message = fillMessage;\n                        }\n                    }\n\n                    break;\n            }\n            return fill;\n        }\n\n        /// <summary>\n        /// Default market fill model for the base security class. Fills at the last traded price.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketFill(Security asset, MarketOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            // Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            var fillMessage = string.Empty;\n\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    //Order [fill]price for a buy market order model is the current security ask price\n                    fill.FillPrice = GetBestEffortAskPrice(asset, order.Time, out fillMessage) + slip;\n                    break;\n                case OrderDirection.Sell:\n                    //Order [fill]price for a buy market order model is the current security bid price\n                    fill.FillPrice = GetBestEffortBidPrice(asset, order.Time, out fillMessage) - slip;\n                    break;\n            }\n\n            // assume the order completely filled\n            fill.FillQuantity = order.Quantity;\n            fill.Message = fillMessage;\n            fill.Status = OrderStatus.Filled;\n            return fill;\n        }\n\n        /// <summary>\n        /// Stop fill model implementation for Equity.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <remarks>\n        /// A Stop order is an instruction to submit a buy or sell market order\n        /// if and when the user-specified stop trigger price is attained or penetrated.\n        ///\n        /// A Sell Stop order is always placed below the current market price.\n        /// We assume a fluid/continuous, high volume market. Therefore, it is filled at the stop trigger price\n        /// if the current low price of trades is less than or equal to this price.\n        ///\n        /// A Buy Stop order is always placed above the current market price.\n        /// We assume a fluid, high volume market. Therefore, it is filled at the stop trigger price\n        /// if the current high price of trades is greater or equal than this price.\n        ///\n        /// The continuous market assumption is not valid if the market opens with an unfavorable gap.\n        /// In this case, a new bar opens below/above the stop trigger price, and the order is filled with the opening price.\n        /// <seealso cref=\"MarketFill(Security, MarketOrder)\"/></remarks>\n        public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n        {\n            // Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            // If cancelled, don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            // Get the trade bar that closes after the order time\n            var tradeBar = GetBestEffortTradeBar(asset, order.Time);\n\n            // Do not fill on stale data\n            if (tradeBar == null) return fill;\n\n            switch (order.Direction)\n            {\n                case OrderDirection.Sell:\n                    if (tradeBar.Low <= order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        fill.FillQuantity = order.Quantity;\n\n                        var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n                        // Unfavorable gap case: if the bar opens below the stop price, fill at open price\n                        if (tradeBar.Open <= order.StopPrice)\n                        {\n                            fill.FillPrice = tradeBar.Open - slip;\n                            fill.Message = Messages.EquityFillModel.FilledWithOpenDueToUnfavorableGap(asset, tradeBar);\n                            return fill;\n                        }\n\n                        fill.FillPrice = order.StopPrice - slip;\n                    }\n                    break;\n\n                case OrderDirection.Buy:\n                    if (tradeBar.High >= order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        fill.FillQuantity = order.Quantity;\n\n                        var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n                        // Unfavorable gap case: if the bar opens above the stop price, fill at open price\n                        if (tradeBar.Open >= order.StopPrice)\n                        {\n                            fill.FillPrice = tradeBar.Open + slip;\n                            fill.Message = Messages.EquityFillModel.FilledWithOpenDueToUnfavorableGap(asset, tradeBar);\n                            return fill;\n                        }\n\n                        fill.FillPrice = order.StopPrice + slip;\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default stop limit fill model implementation in base class security. (Stop Limit Order Type)\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <seealso cref=\"StopMarketFill(Security, StopMarketOrder)\"/>\n        /// <remarks>\n        ///     There is no good way to model limit orders with OHLC because we never know whether the market has\n        ///     gapped past our fill price. We have to make the assumption of a fluid, high volume market.\n        ///\n        ///     Stop limit orders we also can't be sure of the order of the H - L values for the limit fill. The assumption\n        ///     was made the limit fill will be done with closing price of the bar after the stop has been triggered..\n        /// </remarks>\n        public override OrderEvent StopLimitFill(Security asset, StopLimitOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open before filling -- allow pre/post market fills to occur\n            if (!IsExchangeOpen(\n                asset,\n                Parameters.ConfigProvider\n                    .GetSubscriptionDataConfigs(asset.Symbol)\n                    .IsExtendedMarketHours()))\n            {\n                return fill;\n            }\n\n            //Get the range of prices in the last bar:\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            //Check if the Stop Order was filled: opposite to a limit order\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:\n                    if (prices.High > order.StopPrice || order.StopTriggered)\n                    {\n                        if (!order.StopTriggered)\n                        {\n                            order.StopTriggered = true;\n                            Parameters.OnOrderUpdated(order);\n                        }\n\n                        // Fill the limit order, using closing price of bar:\n                        // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.\n                        if (prices.Current < order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Min(prices.High, order.LimitPrice);\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n\n                case OrderDirection.Sell:\n                    //-> 1.1 Sell Stop: If Price below setpoint, Sell:\n                    if (prices.Low < order.StopPrice || order.StopTriggered)\n                    {\n                        if (!order.StopTriggered)\n                        {\n                            order.StopTriggered = true;\n                            Parameters.OnOrderUpdated(order);\n                        }\n\n                        // Fill the limit order, using minimum price of the bar\n                        // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.\n                        if (prices.Current > order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Max(prices.Low, order.LimitPrice);\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Limit fill model implementation for Equity.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <remarks>\n        /// A Limit order is an order to buy or sell at a specified price or better.\n        /// The Limit order ensures that if the order fills, it will not fill at a price less favorable than your limit price,\n        /// but it does not guarantee a fill.\n        ///\n        /// A Buy Limit order is always placed above the current market price.\n        /// We assume a fluid/continuous, high volume market. Therefore, it is filled at the limit price\n        /// if the current low price of trades is less than this price.\n        ///\n        /// A Sell Limit order is always placed below the current market price.\n        /// We assume a fluid, high volume market. Therefore, it is filled at the limit price\n        /// if the current high price of trades is greater than this price.\n        ///\n        /// This model does not trigger the limit order when the limit is attained (equals to).\n        /// Since the order may not be filled in reality if it is not the top of the order book\n        /// (first come, first served), we assume our order is the last in the book with its limit price,\n        /// thus it will be filled when the limit price is penetrated.\n        ///\n        /// The continuous market assumption is not valid if the market opens with a favorable gap.\n        /// If the buy/sell limit order is placed below/above the current market price,\n        /// the order is filled with the opening price.\n        /// <seealso cref=\"StopMarketFill(Security, StopMarketOrder)\"/>\n        /// <seealso cref=\"MarketFill(Security, MarketOrder)\"/></remarks>\n        public override OrderEvent LimitFill(Security asset, LimitOrder order)\n        {\n            //Initialise;\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open before filling -- allow pre/post market fills to occur\n            if (!IsExchangeOpen(asset,\n                Parameters.ConfigProvider\n                    .GetSubscriptionDataConfigs(asset.Symbol)\n                    .IsExtendedMarketHours()))\n            {\n                return fill;\n            }\n\n            // Get the trade bar that closes after the order time\n            var tradeBar = GetBestEffortTradeBar(asset, order.Time);\n\n            // Do not fill on stale data\n            if (tradeBar == null) return fill;\n\n            //-> Valid Live/Model Order:\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    if (tradeBar.Low < order.LimitPrice)\n                    {\n                        // assume the order completely filled\n                        // TODO: Add separate DepthLimited fill partial order quantities based on tick quantity / bar.Volume available.\n                        fill.FillQuantity = order.Quantity;\n                        fill.Status = OrderStatus.Filled;\n\n                        fill.FillPrice = order.LimitPrice;\n\n                        // Favorable gap case: if the bar opens below the limit price, fill at open price\n                        if (tradeBar.Open < order.LimitPrice)\n                        {\n                            fill.FillPrice = tradeBar.Open;\n                            fill.Message = Messages.EquityFillModel.FilledWithOpenDueToFavorableGap(asset, tradeBar);\n                            return fill;\n                        }\n                    }\n                    break;\n                case OrderDirection.Sell:\n                    if (tradeBar.High > order.LimitPrice)\n                    {\n                        // Assume the order completely filled\n                        // TODO: Add separate DepthLimited fill partial order quantities based on tick quantity / bar.Volume available.\n                        fill.FillQuantity = order.Quantity;\n                        fill.Status = OrderStatus.Filled;\n\n                        fill.FillPrice = order.LimitPrice;\n\n                        // Favorable gap case: if the bar opens above the limit price, fill at open price\n                        if (tradeBar.Open > order.LimitPrice)\n                        {\n                            fill.FillPrice = tradeBar.Open;\n                            fill.Message = Messages.EquityFillModel.FilledWithOpenDueToFavorableGap(asset, tradeBar);\n                            return fill;\n                        }\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Market on Open Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketOnOpenFill(Security asset, MarketOnOpenOrder order)\n        {\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // MOO should never fill on the same bar or on stale data\n            // Imagine the case where we have a thinly traded equity, ASUR, and another liquid\n            // equity, say SPY, SPY gets data every minute but ASUR, if not on fill forward, maybe\n            // have large gaps, in which case the currentBar.EndTime will be in the past\n            // ASUR  | | |      [order]        | | | | | | |\n            //  SPY  | | | | | | | | | | | | | | | | | | | |\n            var localOrderTime = order.Time.ConvertFromUtc(asset.Exchange.TimeZone);\n            var endTime = DateTime.MinValue;\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            if (subscribedTypes.Contains(typeof(Tick)))\n            {\n                var primaryExchangeCode = ((Equity)asset).PrimaryExchange.Code;\n                var openTradeTickFlags = (uint)(TradeConditionFlags.OfficialOpen | TradeConditionFlags.OpeningPrints);\n\n                var trades = asset.Cache.GetAll<Tick>()\n                    .Where(x => x.TickType == TickType.Trade && asset.Exchange.DateTimeIsOpen(x.Time))\n                    .OrderBy(x => x.EndTime).ToList();\n\n                // Get the first valid (non-zero) tick of trade type from an open market\n                var tick = trades\n                    .FirstOrDefault(x =>\n                        !string.IsNullOrWhiteSpace(x.SaleCondition) &&\n                        x.ExchangeCode == primaryExchangeCode &&\n                        (x.ParsedSaleCondition & openTradeTickFlags) != 0 &&\n                        asset.Exchange.DateTimeIsOpen(x.Time));\n\n                // If there is no OfficialOpen or OpeningPrints in the current list of trades,\n                // we will wait for the next up to 1 minute before accepting the last trade without flags\n                // We will give priority to trade then use quote to get the timestamp\n                // If there are only quotes, we will need to test for the tick type before we assign the fill price\n                if (tick == null)\n                {\n                    var previousOpen = asset.Exchange.Hours\n                        .GetMarketHours(asset.LocalTime)\n                        .GetMarketOpen(TimeSpan.Zero, false);\n\n                    fill.Message = Messages.EquityFillModel.MarketOnOpenFillNoOfficialOpenOrOpeningPrintsWithinOneMinute;\n\n                    tick = trades.LastOrDefault() ?? asset.Cache.GetAll<Tick>().LastOrDefault();\n                    if ((tick?.EndTime.TimeOfDay - previousOpen)?.TotalMinutes < 1)\n                    {\n                        return fill;\n                    }\n\n                    fill.Message += \" \" + Messages.EquityFillModel.FilledWithLastTickTypeData(tick);\n                }\n\n                endTime = tick?.EndTime ?? endTime;\n\n                if (tick?.TickType == TickType.Trade)\n                {\n                    fill.FillPrice = tick.Price;\n                }\n            }\n            else if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null)\n                {\n                    // If the order was placed during the bar aggregation, we cannot use its open price\n                    if (tradeBar.Time < localOrderTime) return fill;\n\n                    // We need to verify whether the trade data is from the open market.\n                    if (tradeBar.Period < Resolution.Hour.ToTimeSpan() && !asset.Exchange.DateTimeIsOpen(tradeBar.Time))\n                    {\n                        return fill;\n                    }\n\n                    endTime = tradeBar.EndTime;\n                    fill.FillPrice = tradeBar.Open;\n                }\n            }\n            else\n            {\n                fill.Message = Messages.EquityFillModel.FilledWithQuoteData(asset);\n            }\n\n            if (localOrderTime >= endTime) return fill;\n\n            // if the MOO was submitted during market the previous day, wait for a day to turn over\n            // The date of the order and the trade data end time cannot be the same.\n            // Note that the security local time can be ahead of the data end time.\n            if (asset.Exchange.DateTimeIsOpen(localOrderTime) && localOrderTime.Date == endTime.Date)\n            {\n                return fill;\n            }\n\n            // wait until market open\n            // make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            // assume the order completely filled\n            fill.FillQuantity = order.Quantity;\n            fill.Status = OrderStatus.Filled;\n\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            var bestEffortMessage = \"\";\n\n            // If there is no trade information, get the bid or ask, then apply the slippage\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    if (fill.FillPrice == 0)\n                    {\n                        fill.FillPrice = GetBestEffortAskPrice(asset, order.Time, out bestEffortMessage);\n                        fill.Message += bestEffortMessage;\n                    }\n\n                    fill.FillPrice += slip;\n                    break;\n                case OrderDirection.Sell:\n                    if (fill.FillPrice == 0)\n                    {\n                        fill.FillPrice = GetBestEffortBidPrice(asset, order.Time, out bestEffortMessage);\n                        fill.Message += bestEffortMessage;\n                    }\n\n                    fill.FillPrice -= slip;\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Market on Close Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketOnCloseFill(Security asset, MarketOnCloseOrder order)\n        {\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            var localOrderTime = order.Time.ConvertFromUtc(asset.Exchange.TimeZone);\n            var nextMarketClose = asset.Exchange.Hours.GetNextMarketClose(localOrderTime, false);\n\n            // wait until market closes after the order time\n            if (asset.LocalTime < nextMarketClose)\n            {\n                return fill;\n            }\n\n            // LocalTime has reached or passed market close, proceed to fill\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            if (subscribedTypes.Contains(typeof(Tick)))\n            {\n                var primaryExchangeCode = ((Equity)asset).PrimaryExchange.Code;\n                var closeTradeTickFlags = (uint)(TradeConditionFlags.OfficialClose | TradeConditionFlags.ClosingPrints);\n\n                var trades = asset.Cache.GetAll<Tick>()\n                    .Where(x => x.TickType == TickType.Trade)\n                    .OrderBy(x => x.EndTime).ToList();\n\n                // Get the last valid (non-zero) tick of trade type from an close market\n                var tick = trades\n                    .LastOrDefault(x =>\n                        !string.IsNullOrWhiteSpace(x.SaleCondition) &&\n                        x.ExchangeCode == primaryExchangeCode\n                        && (x.ParsedSaleCondition & closeTradeTickFlags) != 0);\n\n                // If there is no OfficialClose or ClosingPrints in the current list of trades,\n                // we will wait for the next up to 1 minute before accepting the last tick without flags\n                // We will give priority to trade then use quote to get the timestamp\n                // If there are only quotes, we will need to test for the tick type before we assign the fill price\n                if (tick == null)\n                {\n                    tick = trades.LastOrDefault() ?? asset.Cache.GetAll<Tick>().LastOrDefault();\n                    if (Parameters.ConfigProvider.GetSubscriptionDataConfigs(asset.Symbol).IsExtendedMarketHours())\n                    {\n                        fill.Message = Messages.EquityFillModel.MarketOnCloseFillNoOfficialCloseOrClosingPrintsWithinOneMinute;\n\n                        if ((tick?.EndTime - nextMarketClose)?.TotalMinutes < 1)\n                        {\n                            return fill;\n                        }\n                    }\n                    else\n                    {\n                        fill.Message = Messages.EquityFillModel.MarketOnCloseFillNoOfficialCloseOrClosingPrintsWithoutExtendedMarketHours;\n                    }\n\n                    fill.Message += \" \" + Messages.EquityFillModel.FilledWithLastTickTypeData(tick);\n                }\n\n                if (tick?.TickType == TickType.Trade)\n                {\n                    fill.FillPrice = tick.Price;\n                }\n            }\n            else if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                fill.FillPrice = asset.Cache.GetData<TradeBar>()?.Close ?? 0;\n            }\n            else\n            {\n                fill.Message = Messages.EquityFillModel.FilledWithQuoteData(asset);\n            }\n\n            // Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            var bestEffortMessage = \"\";\n\n            // If there is no trade information, get the bid or ask, then apply the slippage\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    if (fill.FillPrice == 0)\n                    {\n                        fill.FillPrice = GetBestEffortAskPrice(asset, order.Time, out bestEffortMessage);\n                        fill.Message += bestEffortMessage;\n                    }\n\n                    fill.FillPrice += slip;\n                    break;\n                case OrderDirection.Sell:\n                    if (fill.FillPrice == 0)\n                    {\n                        fill.FillPrice = GetBestEffortBidPrice(asset, order.Time, out bestEffortMessage);\n                        fill.Message += bestEffortMessage;\n                    }\n\n                    fill.FillPrice -= slip;\n                    break;\n            }\n\n            // assume the order completely filled\n            fill.FillQuantity = order.Quantity;\n            fill.Status = OrderStatus.Filled;\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Get data types the Security is subscribed to\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        protected override HashSet<Type> GetSubscribedTypes(Security asset)\n        {\n            var subscribedTypes = Parameters\n                .ConfigProvider\n                .GetSubscriptionDataConfigs(asset.Symbol)\n                .ToHashSet(x => x.Type);\n\n            if (subscribedTypes.Count == 0)\n            {\n                throw new InvalidOperationException($\"Cannot perform fill for {asset.Symbol} because no data subscription were found.\");\n            }\n\n            return subscribedTypes;\n        }\n\n        /// <summary>\n        /// Get current ask price for subscribed data\n        /// This method will try to get the most recent ask price data, so it will try to get tick quote first, then quote bar.\n        /// If no quote, tick or bar, is available (e.g. hourly data), use trade data with preference to tick data.\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        /// <param name=\"orderTime\">Time the order was submitted</param>\n        /// <param name=\"message\">Information about the best effort, whether prices are stale or need to use trade information</param>\n        private decimal GetBestEffortAskPrice(Security asset, DateTime orderTime, out string message)\n        {\n            message = string.Empty;\n            BaseData baseData = null;\n            var bestEffortAskPrice = 0m;\n\n            // Define the cut off time to get the best effort bid or ask and whether the price is stale\n            var localOrderTime = orderTime.ConvertFromUtc(asset.Exchange.TimeZone);\n            var cutOffTime = localOrderTime.Add(-Parameters.StalePriceTimeSpan);\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            List<Tick> ticks = null;\n            var isTickSubscribed = subscribedTypes.Contains(typeof(Tick));\n\n            if (isTickSubscribed)\n            {\n                ticks = asset.Cache.GetAll<Tick>().ToList();\n\n                var quote = ticks.LastOrDefault(x => x.TickType == TickType.Quote && x.AskPrice > 0);\n                if (quote != null)\n                {\n                    if (quote.EndTime >= cutOffTime)\n                    {\n                        return quote.AskPrice;\n                    }\n\n                    baseData = quote;\n                    bestEffortAskPrice = quote.AskPrice;\n                    message = Messages.EquityFillModel.FilledWithQuoteTickData(asset, quote);\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(QuoteBar)))\n            {\n                var quoteBar = asset.Cache.GetData<QuoteBar>();\n                if (quoteBar != null && (baseData == null || quoteBar.EndTime > baseData.EndTime))\n                {\n                    if (quoteBar.EndTime >= cutOffTime)\n                    {\n                        return quoteBar.Ask?.Close ?? quoteBar.Close;\n                    }\n\n                    baseData = quoteBar;\n                    bestEffortAskPrice = quoteBar.Ask?.Close ?? quoteBar.Close;\n                    message = Messages.EquityFillModel.FilledWithQuoteBarData(asset, quoteBar);\n                }\n            }\n\n            if (isTickSubscribed)\n            {\n                var trade = ticks.LastOrDefault(x => x.TickType == TickType.Trade);\n                if (trade != null && (baseData == null || trade.EndTime > baseData.EndTime))\n                {\n                    message = Messages.EquityFillModel.FilledWithTradeTickData(asset, trade);\n\n                    if (trade.EndTime >= cutOffTime)\n                    {\n                        return trade.Price;\n                    }\n\n                    baseData = trade;\n                    bestEffortAskPrice = trade.Price;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null && (baseData == null || tradeBar.EndTime > baseData.EndTime))\n                {\n                    message = Messages.EquityFillModel.FilledWithTradeBarData(asset, tradeBar);\n\n                    if (tradeBar.EndTime >= cutOffTime)\n                    {\n                        return tradeBar.Close;\n                    }\n\n                    baseData = tradeBar;\n                    bestEffortAskPrice = tradeBar.Close;\n                }\n            }\n\n            if (baseData != null)\n            {\n                return bestEffortAskPrice;\n            }\n\n            throw new InvalidOperationException(Messages.FillModel.NoMarketDataToGetAskPriceForFilling(asset, subscribedTypes));\n        }\n\n        /// <summary>\n        /// Get current bid price for subscribed data\n        /// This method will try to get the most recent bid price data, so it will try to get tick quote first, then quote bar.\n        /// If no quote, tick or bar, is available (e.g. hourly data), use trade data with preference to tick data.\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        /// <param name=\"orderTime\">Time the order was submitted</param>\n        /// <param name=\"message\">Information about the best effort, whether prices are stale or need to use trade information</param>\n        private decimal GetBestEffortBidPrice(Security asset, DateTime orderTime, out string message)\n        {\n            message = string.Empty;\n            BaseData baseData = null;\n            var bestEffortBidPrice = 0m;\n\n            // Define the cut off time to get the best effort bid or ask and whether the price is stale\n            var localOrderTime = orderTime.ConvertFromUtc(asset.Exchange.TimeZone);\n            var cutOffTime = localOrderTime.Add(-Parameters.StalePriceTimeSpan);\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            List<Tick> ticks = null;\n            var isTickSubscribed = subscribedTypes.Contains(typeof(Tick));\n\n            if (isTickSubscribed)\n            {\n                ticks = asset.Cache.GetAll<Tick>().ToList();\n\n                var quote = ticks.LastOrDefault(x => x.TickType == TickType.Quote && x.BidPrice > 0);\n                if (quote != null)\n                {\n                    if (quote.EndTime >= cutOffTime)\n                    {\n                        return quote.BidPrice;\n                    }\n\n                    baseData = quote;\n                    bestEffortBidPrice = quote.BidPrice;\n                    message = Messages.EquityFillModel.FilledWithQuoteTickData(asset, quote);\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(QuoteBar)))\n            {\n                var quoteBar = asset.Cache.GetData<QuoteBar>();\n                if (quoteBar != null && (baseData == null || quoteBar.EndTime > baseData.EndTime))\n                {\n                    if (quoteBar.EndTime >= cutOffTime)\n                    {\n                        return quoteBar.Bid?.Close ?? quoteBar.Close;\n                    }\n\n                    baseData = quoteBar;\n                    bestEffortBidPrice = quoteBar.Bid?.Close ?? quoteBar.Close;\n                    message = Messages.EquityFillModel.FilledWithQuoteBarData(asset, quoteBar);\n                }\n            }\n\n            if (isTickSubscribed)\n            {\n                var trade = ticks.LastOrDefault(x => x.TickType == TickType.Trade);\n                if (trade != null && (baseData == null || trade.EndTime > baseData.EndTime))\n                {\n                    message = Messages.EquityFillModel.FilledWithTradeTickData(asset, trade);\n\n                    if (trade.EndTime >= cutOffTime)\n                    {\n                        return trade.Price;\n                    }\n\n                    baseData = trade;\n                    bestEffortBidPrice = trade.Price;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null && (baseData == null || tradeBar.EndTime > baseData.EndTime))\n                {\n                    message = Messages.EquityFillModel.FilledWithTradeBarData(asset, tradeBar);\n\n                    if (tradeBar.EndTime >= cutOffTime)\n                    {\n                        return tradeBar.Close;\n                    }\n\n                    baseData = tradeBar;\n                    bestEffortBidPrice = tradeBar.Close;\n                }\n            }\n\n            if (baseData != null)\n            {\n                return bestEffortBidPrice;\n            }\n\n            throw new InvalidOperationException(Messages.FillModel.NoMarketDataToGetBidPriceForFilling(asset, subscribedTypes));\n        }\n\n        /// <summary>\n        /// Get current trade bar for subscribed data\n        /// This method will try to get the most recent trade bar after the order time,\n        /// so it will try to get tick trades first to create a trade bar, then trade bar.\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        /// <param name=\"orderTime\">Time the order was submitted</param>\n        /// <returns>\n        /// A TradeBar object with the most recent trade information after the order close.\n        /// If there is no trade information or it is older than the order, returns null.\n        /// </returns>\n        private TradeBar GetBestEffortTradeBar(Security asset, DateTime orderTime)\n        {\n            TradeBar bestEffortTradeBar = null;\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            if (subscribedTypes.Contains(typeof(Tick)))\n            {\n                var tradeOpen = 0m;\n                var tradeHigh = decimal.MinValue;\n                var tradeLow = decimal.MaxValue;\n                var tradeClose = 0m;\n                var tradeVolume = 0m;\n                var startTimeUtc = DateTime.MinValue;\n                var endTimeUtc = DateTime.MinValue;\n\n                var trades = asset.Cache.GetAll<Tick>().Where(x => x.TickType == TickType.Trade).ToList();\n                if (trades.Any())\n                {\n                    foreach (var trade in trades)\n                    {\n                        if (tradeOpen == 0)\n                        {\n                            tradeOpen = trade.Price;\n                            startTimeUtc = trade.Time;\n                        }\n\n                        tradeHigh = Math.Max(tradeHigh, trade.Price);\n                        tradeLow = Math.Min(tradeLow, trade.Price);\n                        tradeClose = trade.Price;\n                        tradeVolume += trade.Quantity;\n                        endTimeUtc = trade.EndTime;\n                    }\n\n                    bestEffortTradeBar = new TradeBar(startTimeUtc, asset.Symbol,\n                        tradeOpen, tradeHigh, tradeLow, tradeClose, tradeVolume, endTimeUtc - startTimeUtc);\n                }\n            }\n            else if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                bestEffortTradeBar = asset.Cache.GetData<TradeBar>();\n            }\n\n            // Do not accept trade information older than the order\n            if (bestEffortTradeBar == null ||\n                bestEffortTradeBar.EndTime.ConvertToUtc(asset.Exchange.TimeZone) <= orderTime)\n            {\n                return null;\n            }\n\n            return bestEffortTradeBar;\n        }\n\n        /// <summary>\n        /// This is required due to a limitation in PythonNet to resolved\n        /// overriden methods. <see cref=\"GetPrices\"/>\n        /// </summary>\n        protected override Prices GetPricesCheckingPythonWrapper(Security asset, OrderDirection direction)\n        {\n            if (PythonWrapper != null)\n            {\n                var prices = PythonWrapper.GetPricesInternal(asset, direction);\n                return new Prices(prices.EndTime, prices.Current, prices.Open, prices.High, prices.Low, prices.Close);\n            }\n            return GetPrices(asset, direction);\n        }\n\n        /// <summary>\n        /// Get the minimum and maximum price for this security in the last bar:\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're checking</param>\n        /// <param name=\"direction\">The order direction, decides whether to pick bid or ask</param>\n        protected override Prices GetPrices(Security asset, OrderDirection direction)\n        {\n            var low = asset.Low;\n            var high = asset.High;\n            var open = asset.Open;\n            var close = asset.Close;\n            var current = asset.Price;\n            var endTime = asset.Cache.GetData()?.EndTime ?? DateTime.MinValue;\n\n            if (direction == OrderDirection.Hold)\n            {\n                return new Prices(endTime, current, open, high, low, close);\n            }\n\n            // Only fill with data types we are subscribed to\n            var subscriptionTypes = Parameters.ConfigProvider\n                .GetSubscriptionDataConfigs(asset.Symbol)\n                .Select(x => x.Type).ToList();\n            // Tick\n            var tick = asset.Cache.GetData<Tick>();\n            if (subscriptionTypes.Contains(typeof(Tick)) && tick != null)\n            {\n                var price = direction == OrderDirection.Sell ? tick.BidPrice : tick.AskPrice;\n                if (price != 0m)\n                {\n                    return new Prices(tick.EndTime, price, 0, 0, 0, 0);\n                }\n\n                // If the ask/bid spreads are not available for ticks, try the price\n                price = tick.Price;\n                if (price != 0m)\n                {\n                    return new Prices(tick.EndTime, price, 0, 0, 0, 0);\n                }\n            }\n\n            // Quote\n            var quoteBar = asset.Cache.GetData<QuoteBar>();\n            if (subscriptionTypes.Contains(typeof(QuoteBar)) && quoteBar != null)\n            {\n                var bar = direction == OrderDirection.Sell ? quoteBar.Bid : quoteBar.Ask;\n                if (bar != null)\n                {\n                    return new Prices(quoteBar.EndTime, bar);\n                }\n            }\n\n            // Trade\n            var tradeBar = asset.Cache.GetData<TradeBar>();\n            if (subscriptionTypes.Contains(typeof(TradeBar)) && tradeBar != null)\n            {\n                return new Prices(tradeBar);\n            }\n\n            return new Prices(endTime, current, open, high, low, close);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/Fill.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Defines a possible result for <see cref=\"IFillModel.Fill\"/> for a single order\n    /// </summary>\n    public class Fill : IEnumerable<OrderEvent>\n    {\n        private readonly List<OrderEvent> _orderEvents;\n\n        /// <summary>\n        /// Creates a new <see cref=\"Fill\"/> instance\n        /// </summary>\n        /// <param name=\"orderEvents\">The fill order events</param>\n        public Fill(List<OrderEvent> orderEvents)\n        {\n            _orderEvents = orderEvents;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Fill\"/> instance\n        /// </summary>\n        /// <param name=\"orderEvent\">The fill order event</param>\n        public Fill(OrderEvent orderEvent)\n        {\n            _orderEvents = new() { orderEvent };\n        }\n\n        /// <summary>\n        /// Returns the order events enumerator\n        /// </summary>\n        public IEnumerator<OrderEvent> GetEnumerator()\n        {\n            return _orderEvents.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/FillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Provides a base class for all fill models\n    /// </summary>\n    public class FillModel : IFillModel\n    {\n        /// <summary>\n        /// The parameters instance to be used by the different XxxxFill() implementations\n        /// </summary>\n        protected FillModelParameters Parameters { get; set; }\n\n        /// <summary>\n        /// This is required due to a limitation in PythonNet to resolved overriden methods.\n        /// When Python calls a C# method that calls a method that's overriden in python it won't\n        /// run the python implementation unless the call is performed through python too.\n        /// </summary>\n        protected FillModelPythonWrapper PythonWrapper { get; set; }\n\n        /// <summary>\n        /// Used to set the <see cref=\"FillModelPythonWrapper\"/> instance if any\n        /// </summary>\n        public void SetPythonWrapper(FillModelPythonWrapper pythonWrapper)\n        {\n            PythonWrapper = pythonWrapper;\n        }\n\n        /// <summary>\n        /// Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"FillModelParameters\"/> object containing the security and order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public virtual Fill Fill(FillModelParameters parameters)\n        {\n            // Important: setting the parameters is required because it is\n            // consumed by the different XxxxFill() implementations\n            Parameters = parameters;\n\n            var orderEvents = new List<OrderEvent>(1);\n            switch (parameters.Order.Type)\n            {\n                case OrderType.Market:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.MarketFill(parameters.Security, parameters.Order as MarketOrder)\n                        : MarketFill(parameters.Security, parameters.Order as MarketOrder));\n                    break;\n                case OrderType.Limit:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.LimitFill(parameters.Security, parameters.Order as LimitOrder)\n                        : LimitFill(parameters.Security, parameters.Order as LimitOrder));\n                    break;\n                case OrderType.LimitIfTouched:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.LimitIfTouchedFill(parameters.Security, parameters.Order as LimitIfTouchedOrder)\n                        : LimitIfTouchedFill(parameters.Security, parameters.Order as LimitIfTouchedOrder));\n                    break;\n                case OrderType.StopMarket:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.StopMarketFill(parameters.Security, parameters.Order as StopMarketOrder)\n                        : StopMarketFill(parameters.Security, parameters.Order as StopMarketOrder));\n                    break;\n                case OrderType.TrailingStop:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.TrailingStopFill(parameters.Security, parameters.Order as TrailingStopOrder)\n                        : TrailingStopFill(parameters.Security, parameters.Order as TrailingStopOrder));\n                    break;\n                case OrderType.StopLimit:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.StopLimitFill(parameters.Security, parameters.Order as StopLimitOrder)\n                        : StopLimitFill(parameters.Security, parameters.Order as StopLimitOrder));\n                    break;\n                case OrderType.MarketOnOpen:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.MarketOnOpenFill(parameters.Security, parameters.Order as MarketOnOpenOrder)\n                        : MarketOnOpenFill(parameters.Security, parameters.Order as MarketOnOpenOrder));\n                    break;\n                case OrderType.MarketOnClose:\n                    orderEvents.Add(PythonWrapper != null\n                        ? PythonWrapper.MarketOnCloseFill(parameters.Security, parameters.Order as MarketOnCloseOrder)\n                        : MarketOnCloseFill(parameters.Security, parameters.Order as MarketOnCloseOrder));\n                    break;\n                case OrderType.ComboMarket:\n                    orderEvents = PythonWrapper != null\n                        ? PythonWrapper.ComboMarketFill(parameters.Order, parameters)\n                        : ComboMarketFill(parameters.Order, parameters);\n                    break;\n                case OrderType.ComboLimit:\n                    orderEvents = PythonWrapper != null\n                        ? PythonWrapper.ComboLimitFill(parameters.Order, parameters)\n                        : ComboLimitFill(parameters.Order, parameters);\n                    break;\n                case OrderType.ComboLegLimit:\n                    orderEvents = PythonWrapper != null\n                        ? PythonWrapper.ComboLegLimitFill(parameters.Order, parameters)\n                        : ComboLegLimitFill(parameters.Order, parameters);\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n            return new Fill(orderEvents);\n        }\n\n\n        /// <summary>\n        /// Default combo market fill model for the base security class. Fills at the last traded price for each leg.\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public virtual List<OrderEvent> ComboMarketFill(Order order, FillModelParameters parameters)\n        {\n            var fills = new List<OrderEvent>(parameters.SecuritiesForOrders.Count);\n            foreach (var kvp in parameters.SecuritiesForOrders.OrderBy(x => x.Key.Id))\n            {\n                var targetOrder = kvp.Key;\n                var security = kvp.Value;\n                var fill = InternalMarketFill(security, targetOrder, targetOrder.Quantity);\n                if (fill.Status != OrderStatus.Filled)\n                {\n                    return new List<OrderEvent>();\n                }\n\n                fills.Add(fill);\n            }\n\n            return fills;\n        }\n\n        /// <summary>\n        /// Default combo limit fill model for the base security class. Fills at the sum of prices for the assets of every leg.\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public virtual List<OrderEvent> ComboLimitFill(Order order, FillModelParameters parameters)\n        {\n            // aggregate the prices from all the securities\n            var fillParameters = new List<ComboLimitOrderLegParameters>(parameters.SecuritiesForOrders.Count);\n            foreach (var kvp in parameters.SecuritiesForOrders.OrderBy(x => x.Key.Id))\n            {\n                var targetOrder = kvp.Key;\n                var security = kvp.Value;\n                var prices = GetPricesCheckingPythonWrapper(security, targetOrder.Direction);\n\n                if (prices.EndTime.ConvertToUtc(security.Exchange.TimeZone) < targetOrder.Time)\n                {\n                    // do not fill on stale data\n                    return new List<OrderEvent>();\n                }\n\n                fillParameters.Add(new ComboLimitOrderLegParameters\n                {\n                    Security = security,\n                    Order = targetOrder,\n                    Prices = prices\n                });\n            }\n\n            var currentPrice = fillParameters.Aggregate(0m, (accumulatedPrice, p) => accumulatedPrice + p.Price);\n            var limitPrice = order.GroupOrderManager.LimitPrice;\n\n            var fills = new List<OrderEvent>(fillParameters.Count);\n\n            switch (order.GroupOrderManager.Direction)\n            {\n                case OrderDirection.Buy:\n                    //Buy limit seeks lowest price\n                    if (currentPrice < limitPrice)\n                    {\n                        for (var i = 0; i < fillParameters.Count; i++)\n                        {\n                            var targetParameters = fillParameters[i];\n                            var utcTime = targetParameters.Security.LocalTime.ConvertToUtc(targetParameters.Security.Exchange.TimeZone);\n                            var fill = new OrderEvent(targetParameters.Order, utcTime, OrderFee.Zero);\n\n                            //Set order fill:\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = targetParameters.Prices.Low;\n                            // assume the order completely filled\n                            fill.FillQuantity = targetParameters.Order.Quantity;\n\n                            fills.Add(fill);\n                        }\n                    }\n                    break;\n\n                case OrderDirection.Sell:\n                    //Sell limit seeks highest price possible\n                    if (currentPrice > limitPrice)\n                    {\n                        for (var i = 0; i < fillParameters.Count; i++)\n                        {\n                            var targetParameters = fillParameters[i];\n                            var utcTime = targetParameters.Security.LocalTime.ConvertToUtc(targetParameters.Security.Exchange.TimeZone);\n                            var fill = new OrderEvent(targetParameters.Order, utcTime, OrderFee.Zero);\n\n                            //Set order fill:\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = targetParameters.Prices.High;\n                            // assume the order completely filled\n                            fill.FillQuantity = targetParameters.Order.Quantity;\n\n                            fills.Add(fill);\n                        }\n                    }\n                    break;\n            }\n\n            return fills;\n        }\n\n        /// <summary>\n        /// Default combo limit fill model for the base security class. Fills at the limit price for each leg\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public virtual List<OrderEvent> ComboLegLimitFill(Order order, FillModelParameters parameters)\n        {\n            var fills = new List<OrderEvent>(order.GroupOrderManager.OrderIds.Count);\n\n            foreach (var kvp in parameters.SecuritiesForOrders.OrderBy(x => x.Key.Id))\n            {\n                var targetOrder = kvp.Key;\n                var security = kvp.Value;\n\n                var fill = InternalLimitFill(security, targetOrder, (targetOrder as ComboLegLimitOrder).LimitPrice,\n                    targetOrder.Quantity);\n\n                if (fill.Status != OrderStatus.Filled)\n                {\n                    return new List<OrderEvent>();\n                }\n\n                fills.Add(fill);\n            }\n\n            return fills;\n        }\n\n        /// <summary>\n        /// Default market fill model for the base security class. Fills at the last traded price.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public virtual OrderEvent MarketFill(Security asset, MarketOrder order)\n        {\n            return InternalMarketFill(asset, order, order.Quantity);\n        }\n\n\n        /// <summary>\n        /// Default market fill model for the base security class. Fills at the last traded price.\n        /// </summary>\n        private OrderEvent InternalMarketFill(Security asset, Order order, decimal quantity)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            var orderDirection = order.Direction;\n            var prices = GetPricesCheckingPythonWrapper(asset, orderDirection);\n            var pricesEndTimeUtc = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // if the order is filled on stale (fill-forward) data, set a warning message on the order event\n            if (pricesEndTimeUtc.Add(Parameters.StalePriceTimeSpan) < order.Time)\n            {\n                fill.Message = Messages.FillModel.FilledAtStalePrice(asset, prices);\n            }\n\n            //Order [fill]price for a market order model is the current security price\n            fill.FillPrice = prices.Current;\n            fill.Status = OrderStatus.Filled;\n\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Apply slippage\n            switch (orderDirection)\n            {\n                case OrderDirection.Buy:\n                    fill.FillPrice += slip;\n                    break;\n                case OrderDirection.Sell:\n                    fill.FillPrice -= slip;\n                    break;\n            }\n\n            // assume the order completely filled\n            fill.FillQuantity = quantity;\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default stop fill model implementation in base class security. (Stop Market Order Type)\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <seealso cref=\"MarketFill(Security, MarketOrder)\"/>\n        public virtual OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            //Get the range of prices in the last bar:\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Check if the Stop Order was filled: opposite to a limit order\n            switch (order.Direction)\n            {\n                case OrderDirection.Sell:\n                    //-> 1.1 Sell Stop: If Price below setpoint, Sell:\n                    if (prices.Low < order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at lowest of the stop & asset price.\n                        fill.FillPrice = Math.Min(order.StopPrice, prices.Current - slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n\n                case OrderDirection.Buy:\n                    //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:\n                    if (prices.High > order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at highest of the stop & asset price.\n                        fill.FillPrice = Math.Max(order.StopPrice, prices.Current + slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default trailing stop fill model implementation in base class security. (Trailing Stop Order Type)\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public virtual OrderEvent TrailingStopFill(Security asset, TrailingStopOrder order)\n        {\n            // Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            // If its canceled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            // Get the range of prices in the last bar:\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // Do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            // Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            switch (order.Direction)\n            {\n                case OrderDirection.Sell:\n                    // Fill sell if market price drops below stop price\n                    if (prices.Low <= order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at lowest of the stop & asset price.\n                        fill.FillPrice = Math.Min(order.StopPrice, prices.Current - slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n\n                case OrderDirection.Buy:\n                    // Fill buy if market price rises above stop price\n                    if (prices.High >= order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at highest of the stop & asset price.\n                        fill.FillPrice = Math.Max(order.StopPrice, prices.Current + slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n            }\n\n            // Update the stop price:\n            // NOTE: Doing this after attempting to fill the order in the following cases:\n            //  - Sell: if low < stop price, order is filled. If we were to update the stop price before and it is moved towards the high price\n            //          placing the stop price above the low price, it will not trigger a fill.\n            //  - Buy: if high > stop price, order is filled. If we were to update the stop price before and it is moved towards the low price\n            //         placing the stop price below the high price, it will not trigger a fill.\n            if (fill.Status != OrderStatus.Filled &&\n                TrailingStopOrder.TryUpdateStopPrice(order.Direction == OrderDirection.Sell ? prices.High : prices.Low, order.StopPrice,\n                    order.TrailingAmount, order.TrailingAsPercentage, order.Direction, out var updatedStopPrice))\n            {\n                order.StopPrice = updatedStopPrice;\n                Parameters.OnOrderUpdated(order);\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default stop limit fill model implementation in base class security. (Stop Limit Order Type)\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <seealso cref=\"StopMarketFill(Security, StopMarketOrder)\"/>\n        /// <remarks>\n        ///     There is no good way to model limit orders with OHLC because we never know whether the market has\n        ///     gapped past our fill price. We have to make the assumption of a fluid, high volume market.\n        ///\n        ///     Stop limit orders we also can't be sure of the order of the H - L values for the limit fill. The assumption\n        ///     was made the limit fill will be done with closing price of the bar after the stop has been triggered..\n        /// </remarks>\n        public virtual OrderEvent StopLimitFill(Security asset, StopLimitOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open before filling -- allow pre/post market fills to occur\n            if (!IsExchangeOpen(asset))\n            {\n                return fill;\n            }\n\n            //Get the range of prices in the last bar:\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            //Check if the Stop Order was filled: opposite to a limit order\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:\n                    if (prices.High > order.StopPrice || order.StopTriggered)\n                    {\n                        if (!order.StopTriggered)\n                        {\n                            order.StopTriggered = true;\n                            Parameters.OnOrderUpdated(order);\n                        }\n\n                        // Fill the limit order, using closing price of bar:\n                        // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.\n                        if (prices.Current < order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Min(prices.High, order.LimitPrice);\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n\n                case OrderDirection.Sell:\n                    //-> 1.1 Sell Stop: If Price below setpoint, Sell:\n                    if (prices.Low < order.StopPrice || order.StopTriggered)\n                    {\n                        if (!order.StopTriggered)\n                        {\n                            order.StopTriggered = true;\n                            Parameters.OnOrderUpdated(order);\n                        }\n\n                        // Fill the limit order, using minimum price of the bar\n                        // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.\n                        if (prices.Current > order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = Math.Max(prices.Low, order.LimitPrice);\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default limit if touched fill model implementation in base class security. (Limit If Touched Order Type)\n        /// </summary>\n        /// <param name=\"asset\"></param>\n        /// <param name=\"order\"></param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <remarks>\n        ///     There is no good way to model limit orders with OHLC because we never know whether the market has\n        ///     gapped past our fill price. We have to make the assumption of a fluid, high volume market.\n        ///\n        ///     With Limit if Touched orders, whether or not a trigger is surpassed is determined by the high (low)\n        ///     of the previous tradebar when making a sell (buy) request. Following the behaviour of\n        ///     <see cref=\"StopLimitFill\"/>, current quote information is used when determining fill parameters\n        ///     (e.g., price, quantity) as the tradebar containing the incoming data is not yet consolidated.\n        ///     This conservative approach, however, can lead to trades not occuring as would be expected when\n        ///     compared to future consolidated data.\n        /// </remarks>\n        public virtual OrderEvent LimitIfTouchedFill(Security asset, LimitIfTouchedOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Fill only if open or extended\n            if (!IsExchangeOpen(asset))\n            {\n                return fill;\n            }\n\n            // Get the range of prices in the last bar:\n            var tradeHigh = 0m;\n            var tradeLow = 0m;\n            var pricesEndTime = DateTime.MinValue;\n\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            if (subscribedTypes.Contains(typeof(Tick)))\n            {\n                var trade = GetPricesCheckingPythonWrapper(asset, order.Direction);\n\n                if (trade != null)\n                {\n                    tradeHigh = trade.Current;\n                    tradeLow = trade.Current;\n                    pricesEndTime = trade.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n                }\n            }\n\n            else if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null)\n                {\n                    tradeHigh = tradeBar.High;\n                    tradeLow = tradeBar.Low;\n                    pricesEndTime = tradeBar.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n                }\n            }\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            switch (order.Direction)\n            {\n                case OrderDirection.Sell:\n                    if (tradeHigh >= order.TriggerPrice || order.TriggerTouched)\n                    {\n                        order.TriggerTouched = true;\n\n                        //-> 1.1 Limit surpassed: Sell.\n                        if (GetAskPrice(asset, out pricesEndTime) >= order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = order.LimitPrice;\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n\n                case OrderDirection.Buy:\n                    if (tradeLow <= order.TriggerPrice || order.TriggerTouched)\n                    {\n                        order.TriggerTouched = true;\n\n                        //-> 1.2 Limit surpassed: Buy.\n                        if (GetBidPrice(asset, out pricesEndTime) <= order.LimitPrice)\n                        {\n                            fill.Status = OrderStatus.Filled;\n                            fill.FillPrice = order.LimitPrice;\n                            // assume the order completely filled\n                            fill.FillQuantity = order.Quantity;\n                        }\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Default limit order fill model in the base security class.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <seealso cref=\"StopMarketFill(Security, StopMarketOrder)\"/>\n        /// <seealso cref=\"MarketFill(Security, MarketOrder)\"/>\n        public virtual OrderEvent LimitFill(Security asset, LimitOrder order)\n        {\n            return InternalLimitFill(asset, order, order.LimitPrice, order.Quantity);\n        }\n\n        /// <summary>\n        /// Default limit order fill model in the base security class.\n        /// </summary>\n        private OrderEvent InternalLimitFill(Security asset, Order order, decimal limitPrice, decimal quantity)\n        {\n            //Initialise;\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open before filling -- allow pre/post market fills to occur\n            if (!IsExchangeOpen(asset))\n            {\n                return fill;\n            }\n            //Get the range of prices in the last bar:\n            var orderDirection = order.Direction;\n            var prices = GetPricesCheckingPythonWrapper(asset, orderDirection);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            //-> Valid Live/Model Order:\n            switch (orderDirection)\n            {\n                case OrderDirection.Buy:\n                    //Buy limit seeks lowest price\n                    if (prices.Low < limitPrice)\n                    {\n                        //Set order fill:\n                        fill.Status = OrderStatus.Filled;\n                        // fill at the worse price this bar or the limit price, this allows far out of the money limits\n                        // to be executed properly\n                        fill.FillPrice = Math.Min(prices.High, limitPrice);\n                        // assume the order completely filled\n                        fill.FillQuantity = quantity;\n                    }\n                    break;\n                case OrderDirection.Sell:\n                    //Sell limit seeks highest price possible\n                    if (prices.High > limitPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // fill at the worse price this bar or the limit price, this allows far out of the money limits\n                        // to be executed properly\n                        fill.FillPrice = Math.Max(prices.Low, limitPrice);\n                        // assume the order completely filled\n                        fill.FillQuantity = quantity;\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Market on Open Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public virtual OrderEvent MarketOnOpenFill(Security asset, MarketOnOpenOrder order)\n        {\n            if (asset.Exchange.Hours.IsMarketAlwaysOpen)\n            {\n                throw new InvalidOperationException(Messages.FillModel.MarketNeverCloses(asset, OrderType.MarketOnOpen));\n            }\n\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // MOO should never fill on the same bar or on stale data\n            // Imagine the case where we have a thinly traded equity, ASUR, and another liquid\n            // equity, say SPY, SPY gets data every minute but ASUR, if not on fill forward, maybe\n            // have large gaps, in which case the currentBar.EndTime will be in the past\n            // ASUR  | | |      [order]        | | | | | | |\n            //  SPY  | | | | | | | | | | | | | | | | | | | |\n            var currentBar = asset.GetLastData();\n            var localOrderTime = order.Time.ConvertFromUtc(asset.Exchange.TimeZone);\n            if (currentBar == null || localOrderTime >= currentBar.EndTime) return fill;\n\n            // if the MOO was submitted during market the previous day, wait for a day to turn over\n            if (asset.Exchange.DateTimeIsOpen(localOrderTime) && localOrderTime.Date == asset.LocalTime.Date)\n            {\n                return fill;\n            }\n\n            // wait until market open\n            // make sure the exchange is open/normal market hours before filling\n            if (!IsExchangeOpen(asset, false)) return fill;\n\n            fill.FillPrice = GetPricesCheckingPythonWrapper(asset, order.Direction).Open;\n            fill.Status = OrderStatus.Filled;\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Apply slippage\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    fill.FillPrice += slip;\n                    // assume the order completely filled\n                    fill.FillQuantity = order.Quantity;\n                    break;\n                case OrderDirection.Sell:\n                    fill.FillPrice -= slip;\n                    // assume the order completely filled\n                    fill.FillQuantity = order.Quantity;\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Market on Close Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public virtual OrderEvent MarketOnCloseFill(Security asset, MarketOnCloseOrder order)\n        {\n            if (asset.Exchange.Hours.IsMarketAlwaysOpen)\n            {\n                throw new InvalidOperationException(Messages.FillModel.MarketNeverCloses(asset, OrderType.MarketOnClose));\n            }\n\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            var localOrderTime = order.Time.ConvertFromUtc(asset.Exchange.TimeZone);\n            var nextMarketClose = asset.Exchange.Hours.GetNextMarketClose(localOrderTime, false);\n\n            // wait until market closes after the order time\n            if (asset.LocalTime < nextMarketClose)\n            {\n                return fill;\n            }\n\n            // LocalTime has reached or passed market close, proceed to fill\n\n            fill.FillPrice = GetPricesCheckingPythonWrapper(asset, order.Direction).Close;\n            fill.Status = OrderStatus.Filled;\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Apply slippage\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    fill.FillPrice += slip;\n                    // assume the order completely filled\n                    fill.FillQuantity = order.Quantity;\n                    break;\n                case OrderDirection.Sell:\n                    fill.FillPrice -= slip;\n                    // assume the order completely filled\n                    fill.FillQuantity = order.Quantity;\n                    break;\n            }\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Get current ask price for subscribed data\n        /// This method will try to get the most recent ask price data, so it will try to get tick quote first, then quote bar.\n        /// If no quote, tick or bar, is available (e.g. hourly data), use trade data with preference to tick data.\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        /// <param name=\"endTime\">Timestamp of the most recent data type</param>\n        private decimal GetAskPrice(Security asset, out DateTime endTime)\n        {\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            List<Tick> ticks = null;\n            var isTickSubscribed = subscribedTypes.Contains(typeof(Tick));\n\n            if (isTickSubscribed)\n            {\n                ticks = asset.Cache.GetAll<Tick>().ToList();\n\n                var quote = ticks.LastOrDefault(x => x.TickType == TickType.Quote && x.AskPrice > 0);\n                if (quote != null)\n                {\n                    endTime = quote.EndTime;\n                    return quote.AskPrice;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(QuoteBar)))\n            {\n                var quoteBar = asset.Cache.GetData<QuoteBar>();\n                if (quoteBar != null)\n                {\n                    endTime = quoteBar.EndTime;\n                    return quoteBar.Ask?.Close ?? quoteBar.Close;\n                }\n            }\n\n            if (isTickSubscribed)\n            {\n                var trade = ticks.LastOrDefault(x => x.TickType == TickType.Trade && x.Price > 0);\n                if (trade != null)\n                {\n                    endTime = trade.EndTime;\n                    return trade.Price;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null)\n                {\n                    endTime = tradeBar.EndTime;\n                    return tradeBar.Close;\n                }\n            }\n\n            throw new InvalidOperationException(Messages.FillModel.NoMarketDataToGetAskPriceForFilling(asset));\n        }\n\n        /// <summary>\n        /// Get current bid price for subscribed data\n        /// This method will try to get the most recent bid price data, so it will try to get tick quote first, then quote bar.\n        /// If no quote, tick or bar, is available (e.g. hourly data), use trade data with preference to tick data.\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        /// <param name=\"endTime\">Timestamp of the most recent data type</param>\n        private decimal GetBidPrice(Security asset, out DateTime endTime)\n        {\n            var subscribedTypes = GetSubscribedTypes(asset);\n\n            List<Tick> ticks = null;\n            var isTickSubscribed = subscribedTypes.Contains(typeof(Tick));\n\n            if (isTickSubscribed)\n            {\n                ticks = asset.Cache.GetAll<Tick>().ToList();\n\n                var quote = ticks.LastOrDefault(x => x.TickType == TickType.Quote && x.BidPrice > 0);\n                if (quote != null)\n                {\n                    endTime = quote.EndTime;\n                    return quote.BidPrice;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(QuoteBar)))\n            {\n                var quoteBar = asset.Cache.GetData<QuoteBar>();\n                if (quoteBar != null)\n                {\n                    endTime = quoteBar.EndTime;\n                    return quoteBar.Bid?.Close ?? quoteBar.Close;\n                }\n            }\n\n            if (isTickSubscribed)\n            {\n                var trade = ticks.LastOrDefault(x => x.TickType == TickType.Trade && x.Price > 0);\n                if (trade != null)\n                {\n                    endTime = trade.EndTime;\n                    return trade.Price;\n                }\n            }\n\n            if (subscribedTypes.Contains(typeof(TradeBar)))\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n                if (tradeBar != null)\n                {\n                    endTime = tradeBar.EndTime;\n                    return tradeBar.Close;\n                }\n            }\n\n            throw new InvalidOperationException(Messages.FillModel.NoMarketDataToGetBidPriceForFilling(asset));\n        }\n\n        /// <summary>\n        /// Get data types the Security is subscribed to\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        protected virtual HashSet<Type> GetSubscribedTypes(Security asset)\n        {\n            var subscribedTypes = Parameters\n                .ConfigProvider\n                // even though data from internal configurations are not sent to the algorithm.OnData they still drive security cache and data\n                // this is specially relevant for the continuous contract underlying mapped contracts which are internal configurations\n                .GetSubscriptionDataConfigs(asset.Symbol, includeInternalConfigs: true)\n                .ToHashSet(x => x.Type);\n\n            if (subscribedTypes.Count == 0)\n            {\n                throw new InvalidOperationException(Messages.FillModel.NoDataSubscriptionFoundForFilling(asset));\n            }\n\n            return subscribedTypes;\n        }\n\n        /// <summary>\n        /// Helper method to determine if the exchange is open before filling. Will allow pre/post market fills to occur based on configuration\n        /// </summary>\n        /// <param name=\"asset\">Security which has subscribed data types</param>\n        private bool IsExchangeOpen(Security asset)\n        {\n            // even though data from internal configurations are not sent to the algorithm.OnData they still drive security cache and data\n            // this is specially relevant for the continuous contract underlying mapped contracts which are internal configurations\n            var configs = Parameters.ConfigProvider.GetSubscriptionDataConfigs(asset.Symbol, includeInternalConfigs: true);\n            if (configs.Count == 0)\n            {\n                throw new InvalidOperationException(Messages.FillModel.NoDataSubscriptionFoundForFilling(asset));\n            }\n\n            var hasNonInternals = false;\n            var exchangeOpenNonInternals = false;\n            var exchangeOpenInternals = false;\n            for (int i = 0; i < configs.Count; i++)\n            {\n                var config = configs[i];\n\n                if (config.IsInternalFeed)\n                {\n                    exchangeOpenInternals |= config.ExtendedMarketHours;\n                }\n                else\n                {\n                    hasNonInternals = true;\n                    exchangeOpenNonInternals |= config.ExtendedMarketHours;\n                }\n            }\n\n            if (hasNonInternals)\n            {\n                // give priority to non internals if any\n                return IsExchangeOpen(asset, exchangeOpenNonInternals);\n            }\n            return IsExchangeOpen(asset, exchangeOpenInternals);\n        }\n\n        /// <summary>\n        /// This is required due to a limitation in PythonNet to resolved\n        /// overriden methods. <see cref=\"GetPrices\"/>\n        /// </summary>\n        protected virtual Prices GetPricesCheckingPythonWrapper(Security asset, OrderDirection direction)\n        {\n            if (PythonWrapper != null)\n            {\n                return PythonWrapper.GetPrices(asset, direction);\n            }\n            return GetPrices(asset, direction);\n        }\n\n        /// <summary>\n        /// Get the minimum and maximum price for this security in the last bar:\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're checking</param>\n        /// <param name=\"direction\">The order direction, decides whether to pick bid or ask</param>\n        protected virtual Prices GetPrices(Security asset, OrderDirection direction)\n        {\n            var low = asset.Low;\n            var high = asset.High;\n            var open = asset.Open;\n            var close = asset.Close;\n            var current = asset.Price;\n            var endTime = asset.Cache.GetData()?.EndTime ?? DateTime.MinValue;\n\n            if (direction == OrderDirection.Hold)\n            {\n                return new Prices(endTime, current, open, high, low, close);\n            }\n\n            // Only fill with data types we are subscribed to\n            var subscriptionTypes = GetSubscribedTypes(asset);\n            // Tick\n            var tick = asset.Cache.GetData<Tick>();\n            if (tick != null && subscriptionTypes.Contains(typeof(Tick)))\n            {\n                var price = direction == OrderDirection.Sell ? tick.BidPrice : tick.AskPrice;\n                if (price != 0m)\n                {\n                    return new Prices(tick.EndTime, price, 0, 0, 0, 0);\n                }\n\n                // If the ask/bid spreads are not available for ticks, try the price\n                price = tick.Price;\n                if (price != 0m)\n                {\n                    return new Prices(tick.EndTime, price, 0, 0, 0, 0);\n                }\n            }\n\n            // Quote\n            var quoteBar = asset.Cache.GetData<QuoteBar>();\n            if (quoteBar != null && subscriptionTypes.Contains(typeof(QuoteBar)))\n            {\n                var bar = direction == OrderDirection.Sell ? quoteBar.Bid : quoteBar.Ask;\n                if (bar != null)\n                {\n                    return new Prices(quoteBar.EndTime, bar);\n                }\n            }\n\n            // Trade\n            var tradeBar = asset.Cache.GetData<TradeBar>();\n            if (tradeBar != null && subscriptionTypes.Contains(typeof(TradeBar)))\n            {\n                return new Prices(tradeBar);\n            }\n\n            return new Prices(endTime, current, open, high, low, close);\n        }\n\n        /// <summary>\n        /// Determines if the exchange is open using the current time of the asset\n        /// </summary>\n        protected virtual bool IsExchangeOpen(Security asset, bool isExtendedMarketHours)\n        {\n            if (!asset.Exchange.Hours.IsOpen(asset.LocalTime, isExtendedMarketHours))\n            {\n                // if we're not open at the current time exactly, check the bar size, this handle large sized bars (hours/days)\n                var currentBar = asset.GetLastData();\n                if (currentBar == null)\n                {\n                    return false;\n                }\n\n                var barSpan = currentBar.EndTime - currentBar.Time;\n                var isOnCurrentBar = barSpan > Time.OneHour\n                    // for fill purposes we consider the market open for daily bars if we are in the same day\n                    ? asset.LocalTime.Date == currentBar.EndTime.Date\n                    // for other resolution bars, market is considered open if we are within the bar time\n                    : asset.LocalTime <= currentBar.EndTime;\n\n                return isOnCurrentBar && asset.Exchange.IsOpenDuringBar(currentBar.Time, currentBar.EndTime, isExtendedMarketHours);\n            }\n\n            return true;\n        }\n\n        private class ComboLimitOrderLegParameters\n        {\n            public Security Security { get; set; }\n            public Order Order { get; set; }\n            public Prices Prices { get; set; }\n\n            /// <summary>\n            /// Gets the current price that would be paid/received for this leg based on the security price and the leg quantity\n            /// </summary>\n            public decimal Price\n            {\n                get\n                {\n                    // we use the same, either low or high, for every leg depending on the combo direction\n                    var price = Order.GroupOrderManager.Direction == OrderDirection.Buy ? Prices.Low : Prices.High;\n\n                    // the limit price should be calculated using the ratios instead of the group quantities, like IB does\n                    var quantity = Order.Quantity.GetOrderLegRatio(Order.GroupOrderManager);\n                    if (Security.Symbol.SecurityType == SecurityType.Equity)\n                    {\n                        quantity /= 100;\n                    }\n\n                    return price * quantity;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/FillModelParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Defines the parameters for the <see cref=\"IFillModel\"/> method\n    /// </summary>\n    public class FillModelParameters\n    {\n        /// <summary>\n        /// Gets the <see cref=\"Security\"/>\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the <see cref=\"Order\"/>\n        /// </summary>\n        public Order Order { get; }\n\n        /// <summary>\n        /// Gets the <see cref=\"SubscriptionDataConfig\"/> provider\n        /// </summary>\n        public ISubscriptionDataConfigProvider ConfigProvider { get; }\n\n        /// <summary>\n        /// Gets the minimum time span elapsed to consider a market fill price as stale (defaults to one hour)\n        /// </summary>\n        public TimeSpan StalePriceTimeSpan { get; }\n\n        /// <summary>\n        /// Gets the collection of securities by order\n        /// </summary>\n        /// <remarks>We need this so that combo limit orders can access the prices for each security to calculate the price for the fill</remarks>\n        public Dictionary<Order, Security> SecuritiesForOrders { get; }\n\n        /// <summary>\n        /// Callback to notify when an order is updated by the fill model\n        /// </summary>\n        public Action<Order> OnOrderUpdated { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"security\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <param name=\"configProvider\">The <see cref=\"ISubscriptionDataConfigProvider\"/> to use</param>\n        /// <param name=\"stalePriceTimeSpan\">The minimum time span elapsed to consider a fill price as stale</param>\n        /// <param name=\"securitiesForOrders\">Collection of securities for each order</param>\n        public FillModelParameters(\n            Security security,\n            Order order,\n            ISubscriptionDataConfigProvider configProvider,\n            TimeSpan stalePriceTimeSpan,\n            Dictionary<Order, Security> securitiesForOrders,\n            Action<Order> onOrderUpdated = null)\n        {\n            Security = security;\n            Order = order;\n            ConfigProvider = configProvider;\n            StalePriceTimeSpan = stalePriceTimeSpan;\n            SecuritiesForOrders = securitiesForOrders;\n            OnOrderUpdated = onOrderUpdated ?? (o => { });\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/FutureFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Represents the fill model used to simulate order fills for futures\n    /// </summary>\n    public class FutureFillModel : ImmediateFillModel\n    {\n        /// <summary>\n        /// Default market fill model for the base security class. Fills at the last traded price.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketFill(Security asset, MarketOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // make sure the exchange is open on regular/extended market hours before filling\n            if (!IsExchangeOpen(asset, true)) return fill;\n\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTimeUtc = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // if the order is filled on stale (fill-forward) data, set a warning message on the order event\n            if (pricesEndTimeUtc.Add(Parameters.StalePriceTimeSpan) < order.Time)\n            {\n                fill.Message = Messages.FillModel.FilledAtStalePrice(asset, prices);\n            }\n\n            //Order [fill]price for a market order model is the current security price\n            fill.FillPrice = prices.Current;\n            fill.Status = OrderStatus.Filled;\n\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Apply slippage\n            switch (order.Direction)\n            {\n                case OrderDirection.Buy:\n                    fill.FillPrice += slip;\n                    break;\n                case OrderDirection.Sell:\n                    fill.FillPrice -= slip;\n                    break;\n            }\n\n            // assume the order completely filled\n            fill.FillQuantity = order.Quantity;\n\n            return fill;\n        }\n\n        /// <summary>\n        /// Stop fill model implementation for Future.\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're filling</param>\n        /// <param name=\"order\">Order packet to model</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        /// <remarks>\n        /// A Stop order is an instruction to submit a buy or sell market order\n        /// if and when the user-specified stop trigger price is attained or penetrated.\n        ///\n        /// A Sell Stop order is always placed below the current market price.\n        /// We assume a fluid/continuous, high volume market. Therefore, it is filled at the stop trigger price\n        /// if the current low price of trades is less than or equal to this price.\n        ///\n        /// A Buy Stop order is always placed above the current market price.\n        /// We assume a fluid, high volume market. Therefore, it is filled at the stop trigger price\n        /// if the current high price of trades is greater or equal than this price.\n        ///\n        /// The continuous market assumption is not valid if the market opens with an unfavorable gap.\n        /// In this case, a new bar opens below/above the stop trigger price, and the order is filled with the opening price.\n        /// <seealso cref=\"MarketFill(Security, MarketOrder)\"/></remarks>\n        public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n        {\n            //Default order event to return.\n            var utcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n            var fill = new OrderEvent(order, utcTime, OrderFee.Zero);\n\n            //If its cancelled don't need anymore checks:\n            if (order.Status == OrderStatus.Canceled) return fill;\n\n            // Fill only if open or extended\n            // even though data from internal configurations are not sent to the algorithm.OnData they still drive security cache and data\n            // this is specially relevant for the continuous contract underlying mapped contracts which are internal configurations\n            if (!IsExchangeOpen(asset, Parameters.ConfigProvider.GetSubscriptionDataConfigs(asset.Symbol, includeInternalConfigs: true).IsExtendedMarketHours()))\n            {\n                return fill;\n            }\n\n            //Get the range of prices in the last bar:\n            var prices = GetPricesCheckingPythonWrapper(asset, order.Direction);\n            var pricesEndTime = prices.EndTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n            // do not fill on stale data\n            if (pricesEndTime <= order.Time) return fill;\n\n            //Calculate the model slippage: e.g. 0.01c\n            var slip = asset.SlippageModel.GetSlippageApproximation(asset, order);\n\n            //Check if the Stop Order was filled: opposite to a limit order\n            switch (order.Direction)\n            {\n                case OrderDirection.Sell:\n                    //-> 1.1 Sell Stop: If Price below setpoint, Sell:\n                    if (prices.Low < order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at lowest of the stop & asset price.\n                        fill.FillPrice = Math.Min(order.StopPrice, prices.Current - slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n\n                case OrderDirection.Buy:\n                    //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:\n                    if (prices.High > order.StopPrice)\n                    {\n                        fill.Status = OrderStatus.Filled;\n                        // Assuming worse case scenario fill - fill at highest of the stop & asset price.\n                        fill.FillPrice = Math.Max(order.StopPrice, prices.Current + slip);\n                        // assume the order completely filled\n                        fill.FillQuantity = order.Quantity;\n                    }\n                    break;\n            }\n\n            return fill;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/FutureOptionFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Represents the default fill model used to simulate order fills for future options\n    /// </summary>\n    public class FutureOptionFillModel : FutureFillModel\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/IFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Represents a model that simulates order fill events\n    /// </summary>\n    /// <remarks>Please use<see cref=\"FillModel\"/> as the base class for\n    /// any implementations of<see cref=\"IFillModel\"/></remarks>\n    public interface IFillModel\n    {\n        /// <summary>\n        /// Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"FillModelParameters\"/> object containing the security and order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        Fill Fill(FillModelParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/ImmediateFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Represents the default fill model used to simulate order fills\n    /// </summary>\n    public class ImmediateFillModel : FillModel\n    {\n    }\n}"
  },
  {
    "path": "Common/Orders/Fills/LatestPriceFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// This fill model is provided for cases where the trade/quote distinction should be\n    /// ignored and the fill price should be determined from the latest pricing information.\n    /// </summary>\n    public class LatestPriceFillModel : ImmediateFillModel\n    {\n        /// <summary>\n        /// Get the minimum and maximum price for this security in the last bar\n        /// Ignore the Trade/Quote distinction - fill with the latest pricing information\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're checking</param>\n        /// <param name=\"direction\">The order direction, decides whether to pick bid or ask</param>\n        protected override Prices GetPrices(Security asset, OrderDirection direction)\n        {\n            var low = asset.Low;\n            var high = asset.High;\n            var open = asset.Open;\n            var close = asset.Close;\n            var current = asset.Price;\n            var endTime = asset.Cache.GetData()?.EndTime ?? DateTime.MinValue;\n\n            if (direction == OrderDirection.Hold)\n            {\n                return new Prices(endTime, current, open, high, low, close);\n            }\n\n            // Only fill with data types we are subscribed to\n            var subscriptionTypes = Parameters.ConfigProvider\n                .GetSubscriptionDataConfigs(asset.Symbol)\n                .Select(x => x.Type).ToList();\n\n            // Tick\n            var tick = asset.Cache.GetData<Tick>();\n            if (subscriptionTypes.Contains(typeof(Tick)) && tick != null)\n            {\n                var price = direction == OrderDirection.Sell ? tick.BidPrice : tick.AskPrice;\n                if (price != 0m)\n                {\n                    return new Prices(endTime, price, 0, 0, 0, 0);\n                }\n\n                // If the ask/bid spreads are not available for ticks, try the price\n                price = tick.Price;\n                if (price != 0m)\n                {\n                    return new Prices(endTime, price, 0, 0, 0, 0);\n                }\n            }\n\n            // Get both the last trade and last quote\n            // Assume that the security has both a trade and quote subscription\n            // This should be true for crypto securities\n            var quoteBar = asset.Cache.GetData<QuoteBar>();\n            if (quoteBar != null)\n            {\n                var tradeBar = asset.Cache.GetData<TradeBar>();\n\n                if (tradeBar != null && tradeBar.EndTime > quoteBar.EndTime)\n                {\n                    // The latest pricing data came from a trade\n                    return new Prices(tradeBar);\n                }\n                else\n                {\n                    // The latest pricing data came from a quote\n                    var bar = direction == OrderDirection.Sell ? quoteBar.Bid : quoteBar.Ask;\n                    if (bar != null)\n                    {\n                        return new Prices(quoteBar.EndTime, bar);\n                    }\n                }\n            }\n\n            return new Prices(endTime, current, open, high, low, close);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Fills/Prices.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Orders.Fills\n{\n    /// <summary>\n    /// Prices class used by <see cref=\"IFillModel\"/>s\n    /// </summary>\n    public class Prices\n    {\n        /// <summary>\n        /// End time for these prices\n        /// </summary>\n        public DateTime EndTime { get; init; }\n\n        /// <summary>\n        /// Current price\n        /// </summary>\n        public decimal Current { get; init; }\n\n        /// <summary>\n        /// Open price\n        /// </summary>\n        public decimal Open { get; init; }\n\n        /// <summary>\n        /// High price\n        /// </summary>\n        public decimal High { get; init; }\n\n        /// <summary>\n        /// Low price\n        /// </summary>\n        public decimal Low { get; init; }\n\n        /// <summary>\n        /// Closing price\n        /// </summary>\n        public decimal Close { get; init; }\n\n        /// <summary>\n        /// Create an instance of Prices class with a data bar\n        /// </summary>\n        /// <param name=\"bar\">Data bar to use for prices</param>\n        public Prices(IBaseDataBar bar)\n            : this(bar.EndTime, bar.Close, bar.Open, bar.High, bar.Low, bar.Close)\n        {\n        }\n\n        /// <summary>\n        /// Create an instance of Prices class with a data bar and end time\n        /// </summary>\n        /// <param name=\"endTime\">The end time for these prices</param>\n        /// <param name=\"bar\">Data bar to use for prices</param>\n        public Prices(DateTime endTime, IBar bar)\n            : this(endTime, bar.Close, bar.Open, bar.High, bar.Low, bar.Close)\n        {\n        }\n\n        /// <summary>\n        /// Create a instance of the Prices class with specific values for all prices\n        /// </summary>\n        /// <param name=\"endTime\">The end time for these prices</param>\n        /// <param name=\"current\">Current price</param>\n        /// <param name=\"open\">Open price</param>\n        /// <param name=\"high\">High price</param>\n        /// <param name=\"low\">Low price</param>\n        /// <param name=\"close\">Close price</param>\n        public Prices(DateTime endTime, decimal current, decimal open, decimal high, decimal low, decimal close)\n        {\n            EndTime = endTime;\n            Current = current;\n            Open = open == 0 ? current : open;\n            High = high == 0 ? current : high;\n            Low = low == 0 ? current : low;\n            Close = close == 0 ? current : close;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/FixOrderProperites.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// FIX (Financial Information Exchange) order properties\n    /// </summary>\n    public class FixOrderProperites: OrderProperties\n    {\n        /// <summary>\n        /// Instruction for order handling on Broker floor\n        /// </summary>\n        public char? HandleInstruction { get; set; }\n\n        /// <summary>\n        /// Free format text string\n        /// </summary>\n        public string Notes { get; set; }\n\n        /// <summary>\n        /// Automated execution order, private, no broker intervention\n        /// </summary>\n        public const char AutomatedExecutionOrderPrivate = '1';\n\n        /// <summary>\n        /// Automated execution order, public, broker, intervention OK\n        /// </summary>\n        public const char AutomatedExecutionOrderPublic = '2';\n\n        /// <summary>\n        /// Staged order, broker intervention required\n        /// </summary>\n        public const char ManualOrder = '3';\n    }\n}\n"
  },
  {
    "path": "Common/Orders/GDAXOrderProperties.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to GDAX brokerage\n    /// </summary>\n    [Obsolete(\"GDAXOrderProperties is deprecated. Use CoinbaseOrderProperties instead.\")]\n    public class GDAXOrderProperties : CoinbaseOrderProperties\n    { }\n}\n"
  },
  {
    "path": "Common/Orders/GroupOrderCacheManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides a thread-safe service for caching and managing original orders when they are part of a group.\n    /// </summary>\n    public class GroupOrderCacheManager\n    {\n        /// <summary>\n        /// A thread-safe dictionary that caches original orders when they are part of a group.\n        /// </summary>\n        /// <remarks>\n        /// The dictionary uses the order ID as the key and stores the original <see cref=\"Order\"/> objects as values.\n        /// This allows for the modification of the original orders, such as setting the brokerage ID, \n        /// without retrieving a cloned instance from the order provider.\n        /// </remarks>\n        private readonly ConcurrentDictionary<int, Order> _pendingGroupOrders = new();\n\n        /// <summary>\n        /// Attempts to retrieve all the orders in the combo group from the cache.\n        /// </summary>\n        /// <param name=\"order\">Target order, which can be any of the legs of the combo</param>\n        /// <param name=\"orders\">List of orders in the combo</param>\n        /// <returns>\n        /// <c>true</c> if all the orders in the combo group were successfully retrieved from the cache; \n        /// otherwise, <c>false</c>. If the retrieval fails, the target order is cached for future retrieval.\n        /// </returns>\n        public bool TryGetGroupCachedOrders(Order order, out List<Order> orders)\n        {\n            if (!order.TryGetGroupOrders(TryGetOrder, out orders))\n            {\n                // some order of the group is missing but cache the new one\n                CacheOrder(order);\n                return false;\n            }\n            RemoveCachedOrders(orders);\n            return true;\n        }\n\n        /// <summary>\n        /// Attempts to retrieve an original order from the cache using the specified order ID.\n        /// </summary>\n        /// <param name=\"orderId\">The unique identifier of the order to retrieve.</param>\n        /// <returns>\n        /// The original <see cref=\"Order\"/> if found; otherwise, <c>null</c>.\n        /// </returns>\n        private Order TryGetOrder(int orderId)\n        {\n            _pendingGroupOrders.TryGetValue(orderId, out var order);\n            return order;\n        }\n\n        /// <summary>\n        /// Caches an original order in the internal dictionary for future retrieval.\n        /// </summary>\n        /// <param name=\"order\">The <see cref=\"Order\"/> object to cache.</param>\n        private void CacheOrder(Order order)\n        {\n            _pendingGroupOrders[order.Id] = order;\n        }\n\n        /// <summary>\n        /// Removes a list of orders from the internal cache.\n        /// </summary>\n        /// <param name=\"orders\">The list of <see cref=\"Order\"/> objects to remove from the cache.</param>\n        private void RemoveCachedOrders(List<Order> orders)\n        {\n            for (var i = 0; i < orders.Count; i++)\n            {\n                _pendingGroupOrders.TryRemove(orders[i].Id, out _);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/GroupOrderExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Group (combo) orders extension methods for easiest combo order manipulation\n    /// </summary>\n    public static class GroupOrderExtensions\n    {\n        /// <summary>\n        /// Gets the grouped orders (legs) of a group order\n        /// </summary>\n        /// <param name=\"order\">Target order, which can be any of the legs of the combo</param>\n        /// <param name=\"orderProvider\">Order provider to use to access the existing orders</param>\n        /// <param name=\"orders\">List of orders in the combo</param>\n        /// <returns>False if any of the orders in the combo is not yet found in the order provider. True otherwise</returns>\n        /// <remarks>If the target order is not a combo order, the resulting list will contain that single order alone</remarks>\n        public static bool TryGetGroupOrders(this Order order, Func<int, Order> orderProvider, out List<Order> orders)\n        {\n            orders = new List<Order> { order };\n            if (order.GroupOrderManager != null)\n            {\n                lock (order.GroupOrderManager.OrderIds)\n                {\n                    foreach (var otherOrdersId in order.GroupOrderManager.OrderIds.Where(id => id != order.Id))\n                    {\n                        var otherOrder = orderProvider(otherOrdersId);\n                        if (otherOrder != null)\n                        {\n                            orders.Add(otherOrder);\n                        }\n                        else\n                        {\n                            // this will happen while all the orders haven't arrived yet, we will retry\n                            return false;\n                        }\n                    }\n                }\n\n                if (order.GroupOrderManager.Count != orders.Count)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"GroupOrderExtensions.TryGetGroupOrders(): missing orders of group {order.GroupOrderManager.Id}.\" +\n                            $\" We have {orders.Count}/{order.GroupOrderManager.Count} orders will skip\");\n                    }\n                    return false;\n                }\n            }\n\n            orders.Sort((x, y) => x.Id.CompareTo(y.Id));\n\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the securities corresponding to each order in the group\n        /// </summary>\n        /// <param name=\"orders\">List of orders to map</param>\n        /// <param name=\"securityProvider\">The security provider to use</param>\n        /// <param name=\"securities\">The resulting map of order to security</param>\n        /// <returns>True if the mapping is successful, false otherwise.</returns>\n        public static bool TryGetGroupOrdersSecurities(this List<Order> orders, ISecurityProvider securityProvider, out Dictionary<Order, Security> securities)\n        {\n            securities = new(orders.Count);\n            for (var i = 0; i < orders.Count; i++)\n            {\n                var order = orders[i];\n                var security = securityProvider.GetSecurity(order.Symbol);\n\n                if (security == null)\n                {\n                    return false;\n                }\n                securities[order] = security;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Returns an error string message saying there is insufficient buying power for the given orders associated with their respective\n        /// securities\n        /// </summary>\n        public static string GetErrorMessage(this Dictionary<Order, Security> securities, HasSufficientBuyingPowerForOrderResult hasSufficientBuyingPowerResult)\n        {\n            return Messages.GroupOrderExtensions.InsufficientBuyingPowerForOrders(securities, hasSufficientBuyingPowerResult);\n        }\n\n        /// <summary>\n        /// Gets the combo order leg group quantity, that is, the total number of shares to be bought/sold from this leg,\n        /// from its ratio and the group order quantity\n        /// </summary>\n        /// <param name=\"legRatio\">The leg ratio</param>\n        /// <param name=\"groupOrderManager\">The group order manager</param>\n        /// <returns>The total number of shares to be bought/sold from this leg</returns>\n        public static decimal GetOrderLegGroupQuantity(this decimal legRatio, GroupOrderManager groupOrderManager)\n        {\n            return groupOrderManager != null ? legRatio * groupOrderManager.Quantity : legRatio;\n        }\n\n        /// <summary>\n        /// Gets the combo order leg ratio from its group quantity and the group order quantity\n        /// </summary>\n        /// <param name=\"legGroupQuantity\">\n        /// The total number of shares to be bought/sold from this leg, that is, the result of the let ratio times the group quantity\n        /// </param>\n        /// <param name=\"groupOrderManager\">The group order manager</param>\n        /// <returns>The ratio of this combo order leg</returns>\n        public static decimal GetOrderLegRatio(this decimal legGroupQuantity, GroupOrderManager groupOrderManager)\n        {\n            return groupOrderManager != null ? legGroupQuantity / groupOrderManager.Quantity : legGroupQuantity;\n        }\n\n        /// <summary>\n        /// Calculates the greatest common divisor (GCD) of the provided leg quantities\n        /// and returns it as a signed quantity based on the <see cref=\"OrderDirection\"/>.\n        /// </summary>\n        /// <param name=\"legQuantity\">A collection of leg quantities.</param>\n        /// <param name=\"orderDirection\">\n        /// Determines the sign of the returned quantity:\n        /// <see cref=\"OrderDirection.Buy\"/> returns a positive quantity,\n        /// <see cref=\"OrderDirection.Sell\"/> returns a negative quantity.\n        /// </param>\n        /// <returns>\n        /// The greatest common divisor of the leg quantities, signed according to <paramref name=\"orderDirection\"/>.\n        /// </returns>\n        /// <exception cref=\"ArgumentException\">\n        /// Thrown when <paramref name=\"orderDirection\"/> has an unsupported value.\n        /// </exception>\n        public static decimal GetGroupQuantityByEachLegQuantity(IEnumerable<decimal> legQuantity, OrderDirection orderDirection)\n        {\n            var groupQuantity = Extensions.GreatestCommonDivisor(legQuantity.Select(Math.Abs));\n            return orderDirection switch\n            {\n                OrderDirection.Buy => groupQuantity,\n                OrderDirection.Sell => decimal.Negate(groupQuantity),\n                _ => throw new ArgumentException($\"Unsupported {nameof(OrderDirection)} value: '{orderDirection}'.\", nameof(orderDirection))\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/GroupOrderManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Manager of a group of orders\n    /// </summary>\n    public class GroupOrderManager\n    {\n        /// <summary>\n        /// The unique order group Id\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public int Id { get; internal set; }\n\n        /// <summary>\n        /// The group order quantity\n        /// </summary>\n        [JsonProperty(PropertyName = \"quantity\")]\n        public decimal Quantity { get; internal set; }\n\n        /// <summary>\n        /// The total order count associated with this order group\n        /// </summary>\n        [JsonProperty(PropertyName = \"count\")]\n        public int Count { get; }\n\n        /// <summary>\n        /// The limit price associated with this order group if any\n        /// </summary>\n        [JsonProperty(PropertyName = \"limitPrice\")]\n        public decimal LimitPrice { get; set; }\n\n        /// <summary>\n        /// The order Ids in this group\n        /// </summary>\n        /// <remarks>In live trading we process orders in a dedicated thread so we need to be thread safe</remarks>\n        [JsonProperty(PropertyName = \"orderIds\")]\n        public HashSet<int> OrderIds { get; }\n\n        /// <summary>\n        /// Order Direction Property based off Quantity.\n        /// </summary>\n        [JsonProperty(PropertyName = \"direction\")]\n        public OrderDirection Direction\n        {\n            get\n            {\n                if (Quantity > 0)\n                {\n                    return OrderDirection.Buy;\n                }\n                if (Quantity < 0)\n                {\n                    return OrderDirection.Sell;\n                }\n                return OrderDirection.Hold;\n            }\n        }\n\n        /// <summary>\n        /// Get the absolute quantity for this combo order\n        /// </summary>\n        [JsonIgnore]\n        public decimal AbsoluteQuantity => Math.Abs(Quantity);\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public GroupOrderManager()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"GroupOrderManager\"/>\n        /// </summary>\n        /// <param name=\"id\">This order group unique Id</param>\n        /// <param name=\"legCount\">The order leg count</param>\n        /// <param name=\"quantity\">The group order quantity</param>\n        /// <param name=\"limitPrice\">The limit price associated with this order group if any</param>\n        public GroupOrderManager(int id, int legCount, decimal quantity, decimal limitPrice = 0) : this(legCount, quantity, limitPrice)\n        {\n            Id = id;\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"GroupOrderManager\"/>\n        /// </summary>\n        /// <param name=\"legCount\">The order leg count</param>\n        /// <param name=\"quantity\">The group order quantity</param>\n        /// <param name=\"limitPrice\">The limit price associated with this order group if any</param>\n        public GroupOrderManager(int legCount, decimal quantity, decimal limitPrice = 0)\n        {\n            Count = legCount;\n            Quantity = quantity;\n            LimitPrice = limitPrice;\n            OrderIds = new(capacity: legCount);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/IndiaOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Indian Brokerages\n    /// </summary>\n    public class IndiaOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// India product type\n        /// </summary>\n        public string ProductType { get; }\n\n        /// <summary>\n        /// Define the India Order type that we are targeting (MIS/CNC/NRML).\n        /// </summary>\n        public enum IndiaProductType\n        {\n            /// <summary>\n            /// Margin Intraday Square Off (0)\n            /// </summary>\n            MIS,\n\n            /// <summary>\n            /// Cash and Carry (1)\n            /// </summary>\n            CNC,\n\n            /// <summary>\n            /// Normal (2)\n            /// </summary>\n            NRML\n        }\n\n        /// <summary>\n        /// Initialize a new OrderProperties for <see cref=\"IndiaOrderProperties\"/>\n        /// </summary>\n        /// <param name=\"exchange\">Exchange value, nse/bse etc</param>\n        public IndiaOrderProperties(Exchange exchange) : base(exchange)\n        {\n        }\n\n        /// <summary>\n        /// Initialize a new OrderProperties for <see cref=\"IndiaOrderProperties\"/>\n        /// </summary>\n        /// <param name=\"exchange\">Exchange value, nse/bse etc</param>\n        /// <param name=\"productType\">ProductType value, MIS/CNC/NRML etc</param>\n        public IndiaOrderProperties(Exchange exchange, IndiaProductType productType) : base(exchange)\n        {\n            ProductType = productType.ToString();\n        }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (IndiaOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/InteractiveBrokersFixOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Fix Interactive Brokers\n    /// </summary>\n    public class InteractiveBrokersFixOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// The linked account for which to submit the order (only used by Financial Advisors)\n        /// </summary>\n        public string Account { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/InteractiveBrokersOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Interactive Brokers\n    /// </summary>\n    public class InteractiveBrokersOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// The linked account for which to submit the order (only used by Financial Advisors)\n        /// </summary>\n        /// <remarks>Mutually exclusive with FaProfile and FaGroup</remarks>\n        public string Account { get; set; }\n\n        /// <summary>\n        /// The account group for the order (only used by Financial Advisors)\n        /// </summary>\n        /// <remarks>Mutually exclusive with FaProfile and Account</remarks>\n        public string FaGroup { get; set; }\n\n        /// <summary>\n        /// The allocation method for the account group order (only used by Financial Advisors)\n        /// Supported allocation methods are: Equal, NetLiq, AvailableEquity, PctChange\n        /// </summary>\n        public string FaMethod { get; set; }\n\n        /// <summary>\n        /// The percentage for the percent change method (only used by Financial Advisors)\n        /// </summary>\n        public int FaPercentage { get; set; }\n\n        /// <summary>\n        /// The allocation profile to be used for the order (only used by Financial Advisors)\n        /// </summary>\n        /// <remarks>Mutually exclusive with FaGroup and Account</remarks>\n        public string FaProfile { get; set; }\n\n        /// <summary>\n        /// If set to true, allows orders to also trigger or fill outside of regular trading hours.\n        /// </summary>\n        public bool OutsideRegularTradingHours { get; set; }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (InteractiveBrokersOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/KrakenOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Kraken order properties\n    /// </summary>\n    public class KrakenOrderProperties : OrderProperties\n    {\n        private bool _feeInQuote;\n        private bool _feeInBase;\n\n        /// <summary>\n        /// Post-only order (available when ordertype = limit)\n        /// </summary>\n        public bool PostOnly { get; set; }\n        \n        /// <summary>\n        /// If true or by default when selling, fees will be charged in base currency. If false will be ignored. Mutually exclusive with FeeInQuote.\n        /// </summary>\n        /// <remarks>See (https://support.kraken.com/hc/en-us/articles/202966956#howclosingtransactionswork) for more information about the currency selection.</remarks>\n        public bool FeeInBase\n        {\n            get\n            {\n                return _feeInBase;\n            }\n            set\n            {\n                if (value)\n                {\n                    _feeInBase = value;\n                    _feeInQuote = !_feeInBase;\n                }\n            }\n        }\n\n        /// <summary>\n        /// If true or by default when buying, fees will be charged in quote currency. If false will be ignored. Mutually exclusive with FeeInBase.\n        /// </summary>\n        /// <remarks>See (https://support.kraken.com/hc/en-us/articles/202966956#howclosingtransactionswork) for more information about the currency selection.</remarks>\n        public bool FeeInQuote\n        {\n            get\n            {\n                return _feeInQuote;\n            }\n            set\n            {\n                if (value)\n                {\n                    _feeInQuote = value;\n                    _feeInBase = !_feeInQuote;\n                }\n            }\n        }\n        \n        /// <summary>\n        /// https://support.kraken.com/hc/en-us/articles/201648183-Market-Price-Protection\n        /// </summary>\n        public bool NoMarketPriceProtection { get; set; }\n\n        /// <summary>\n        /// Conditional close orders are triggered by execution of the primary order in the same quantity and opposite direction. Ordertypes can be the same with primary order.\n        /// </summary>\n        public Order ConditionalOrder { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Leg.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Basic order leg\n    /// </summary>\n    public class Leg\n    {\n        /// <summary>\n        /// The legs symbol\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// Quantity multiplier used to specify proper scale (and direction) of the leg within the strategy\n        /// </summary>\n        public int Quantity { get; set; }\n\n        /// <summary>\n        /// Order limit price of the leg in case limit order is sent to the market on strategy execution\n        /// </summary>\n        public decimal? OrderPrice { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"quantity\">The quantity</param>\n        /// <param name=\"limitPrice\">Associated limit price if any</param>\n        public static Leg Create(Symbol symbol, int quantity, decimal? limitPrice = null)\n        {\n            return new Leg { Symbol = symbol, Quantity = quantity, OrderPrice= limitPrice};\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/LimitIfTouchedOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// In effect, a LimitIfTouchedOrder behaves opposite to the <see cref=\"StopLimitOrder\"/>;\n    /// after a trigger price is touched, a limit order is set for some user-defined value above (below)\n    /// the trigger when selling (buying).\n    /// https://www.interactivebrokers.ca/en/index.php?f=45318\n    /// </summary>\n    public class LimitIfTouchedOrder : Order\n    {\n        /// <summary>\n        /// Order Type\n        /// </summary>\n        public override OrderType Type => OrderType.LimitIfTouched;\n\n        /// <summary>\n        /// The price which, when touched, will trigger the setting of a limit order at <see cref=\"LimitPrice\"/>.\n        /// </summary>\n        [JsonProperty(PropertyName = \"triggerPrice\")]\n        public decimal TriggerPrice { get; internal set; }\n\n        /// <summary>\n        /// The price at which to set the limit order following <see cref=\"TriggerPrice\"/> being touched.\n        /// </summary>\n        [JsonProperty(PropertyName = \"limitPrice\")]\n        public decimal LimitPrice { get; internal set; }\n\n        /// <summary>\n        /// Whether or not the <see cref=\"TriggerPrice\"/> has been touched.\n        /// </summary>\n        [JsonProperty(PropertyName = \"triggerTouched\")]\n        public bool TriggerTouched { get; internal set; }\n\n        /// <summary>\n        /// New <see cref=\"LimitIfTouchedOrder\"/> constructor.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"limitPrice\">Maximum price to fill the order</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"triggerPrice\">Price which must be touched in order to then set a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public LimitIfTouchedOrder(\n            Symbol symbol,\n            decimal quantity,\n            decimal? triggerPrice,\n            decimal limitPrice,\n            DateTime time,\n            string tag = \"\",\n            IOrderProperties properties = null\n            )\n            : base(symbol, quantity, time, tag, properties)\n        {\n            TriggerPrice = (decimal) triggerPrice;\n            LimitPrice = limitPrice;\n        }\n\n        /// <summary>\n        /// Default constructor for JSON Deserialization:\n        /// </summary>\n        public LimitIfTouchedOrder()\n        {\n        }\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public override string GetDefaultTag()\n        {\n            return Messages.LimitIfTouchedOrder.Tag(this);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.TriggerPrice.HasValue)\n            {\n                TriggerPrice = request.TriggerPrice.Value;\n            }\n\n            if (request.LimitPrice.HasValue)\n            {\n                LimitPrice = request.LimitPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new LimitIfTouchedOrder\n                {TriggerPrice = TriggerPrice, LimitPrice = LimitPrice, TriggerTouched = TriggerTouched};\n            CopyTo(order);\n            return order;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.LimitIfTouchedOrder.ToString(this);\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency for a single unit.\n        /// A single unit here is a single share of stock, or a single barrel of oil, or the\n        /// cost of a single share in an option contract.\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            // selling, so higher price will be used\n            if (Quantity < 0)\n            {\n                return Quantity * Math.Max(LimitPrice, security.Price);\n            }\n\n            // buying, so lower price will be used\n            if (Quantity > 0)\n            {\n                return Quantity * Math.Min(LimitPrice, security.Price);\n            }\n\n            return 0m;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/LimitOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Limit order type definition\n    /// </summary>\n    public class LimitOrder : Order\n    {\n        /// <summary>\n        /// Limit price for this order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"limitPrice\")]\n        public decimal LimitPrice { get; internal set; }\n\n        /// <summary>\n        /// Limit Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.Limit; }\n        }\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public LimitOrder()\n        {\n        }\n\n        /// <summary>\n        /// New limit order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"limitPrice\">Price the order should be filled at if a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public LimitOrder(Symbol symbol, decimal quantity, decimal limitPrice, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n            LimitPrice = limitPrice;\n        }\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public override string GetDefaultTag()\n        {\n            return Messages.LimitOrder.Tag(this);\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return CalculateOrderValue(Quantity, LimitPrice, security.Price);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.LimitPrice.HasValue)\n            {\n                LimitPrice = request.LimitPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.LimitOrder.ToString(this);\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new LimitOrder { LimitPrice = LimitPrice };\n            CopyTo(order);\n            return order;\n        }\n\n        internal static decimal CalculateOrderValue(decimal quantity, decimal limitPrice, decimal price)\n        {\n            // selling, so higher price will be used\n            if (quantity < 0)\n            {\n                return quantity * Math.Max(limitPrice, price);\n            }\n\n            // buying, so lower price will be used\n            if (quantity > 0)\n            {\n                return quantity * Math.Min(limitPrice, price);\n            }\n\n            return 0m;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/MarketOnCloseOrder.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Market on close order type - submits a market order on exchange close\n    /// </summary>\n    public class MarketOnCloseOrder : Order\n    {\n        /// <summary>\n        /// Gets the default interval before market close that an MOC order may be submitted.\n        /// For example, US equity exchanges typically require MOC orders to be placed no later\n        /// than 15 minutes before market close, which yields a nominal time of 3:45PM.\n        /// This buffer value takes into account the 15 minutes and adds an additional 30 seconds\n        /// to account for other potential delays, such as LEAN order processing and placement of\n        /// the order to the exchange.\n        /// </summary>\n        public static readonly TimeSpan DefaultSubmissionTimeBuffer = TimeSpan.FromMinutes(15.5);\n\n        /// <summary>\n        /// The interval before market close that an MOC order may be submitted.\n        /// </summary>\n        /// <remarks>Configurable so advanced users may modify this for special cases;\n        /// Related issue: Github #5481</remarks>\n        public static TimeSpan SubmissionTimeBuffer = DefaultSubmissionTimeBuffer;\n\n        /// <summary>\n        /// MarketOnClose Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.MarketOnClose; }\n        }\n\n        /// <summary>\n        /// Intiializes a new instance of the <see cref=\"MarketOnCloseOrder\"/> class.\n        /// </summary>\n        public MarketOnCloseOrder()\n        {\n        }\n\n        /// <summary>\n        /// Intiializes a new instance of the <see cref=\"MarketOnCloseOrder\"/> class.\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol being ordered</param>\n        /// <param name=\"quantity\">The number of units to order</param>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"tag\">A user defined tag for the order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public MarketOnCloseOrder(Symbol symbol, decimal quantity, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return Quantity*security.Price;\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new MarketOnCloseOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/MarketOnOpenOrder.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Market on Open order type, submits a market order when the exchange opens\n    /// </summary>\n    public class MarketOnOpenOrder : Order\n    {\n        /// <summary>\n        /// MarketOnOpen Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.MarketOnOpen; }\n        }\n\n        /// <summary>\n        /// Intiializes a new instance of the <see cref=\"MarketOnOpenOrder\"/> class.\n        /// </summary>\n        public MarketOnOpenOrder()\n        {\n        }\n\n        /// <summary>\n        /// Intiializes a new instance of the <see cref=\"MarketOnOpenOrder\"/> class.\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol being ordered</param>\n        /// <param name=\"quantity\">The number of units to order</param>\n        /// <param name=\"time\">The current time</param>\n        /// <param name=\"tag\">A user defined tag for the order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public MarketOnOpenOrder(Symbol symbol, decimal quantity, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return Quantity*security.Price;\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new MarketOnOpenOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/MarketOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Market order type definition\n    /// </summary>\n    public class MarketOrder : Order\n    {\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public MarketOrder()\n        {\n        }\n\n        /// <summary>\n        /// Market Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.Market; }\n        }\n\n        /// <summary>\n        /// New market order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"price\">Price of the order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public MarketOrder(Symbol symbol, decimal quantity, DateTime time, decimal price, string tag = \"\", IOrderProperties properties = null)\n            : this(symbol, quantity, time, tag, properties)\n        {\n            Price = price;\n        }\n\n        /// <summary>\n        /// New market order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public MarketOrder(Symbol symbol, decimal quantity, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            return Quantity*security.Price;\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new MarketOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OptionExercise/DefaultExerciseModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities.Option;\nusing static QuantConnect.Extensions;\n\nnamespace QuantConnect.Orders.OptionExercise\n{\n    /// <summary>\n    /// Represents the default option exercise model (physical, cash settlement)\n    /// </summary>\n    public class DefaultExerciseModel : IOptionExerciseModel\n    {\n        /// <summary>\n        /// Default option exercise model for the basic equity/index option security class.\n        /// </summary>\n        /// <param name=\"option\">Option we're trading this order</param>\n        /// <param name=\"order\">Order to update</param>\n        public virtual IEnumerable<OrderEvent> OptionExercise(Option option, OptionExerciseOrder order)\n        {\n            var underlying = option.Underlying;\n            var utcTime = option.LocalTime.ConvertToUtc(option.Exchange.TimeZone);\n\n            var inTheMoney = option.IsAutoExercised(underlying.Close);\n            var isAssignment = inTheMoney && option.Holdings.IsShort;\n\n            yield return new OrderEvent(\n                order.Id,\n                option.Symbol,\n                utcTime,\n                OrderStatus.Filled,\n                GetOrderDirection(order.Quantity),\n                0.0m,\n                order.Quantity,\n                OrderFee.Zero,\n                Messages.DefaultExerciseModel.ContractHoldingsAdjustmentFillTag(inTheMoney, isAssignment, option)\n            )\n            {\n                IsAssignment = isAssignment,\n                IsInTheMoney = inTheMoney\n            };\n\n            // TODO : Support Manual Exercise of OTM contracts [ inTheMoney = false ]\n            if (inTheMoney && option.ExerciseSettlement == SettlementType.PhysicalDelivery)\n            {\n                var exerciseQuantity = option.GetExerciseQuantity(order.Quantity);\n\n                yield return new OrderEvent(\n                    order.Id,\n                    underlying.Symbol,\n                    utcTime,\n                    OrderStatus.Filled,\n                    GetOrderDirection(exerciseQuantity),\n                    option.StrikePrice,\n                    exerciseQuantity,\n                    OrderFee.Zero,\n                    isAssignment ? Messages.DefaultExerciseModel.OptionAssignment : Messages.DefaultExerciseModel.OptionExercise\n                ) { IsInTheMoney = true };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OptionExercise/IOptionExerciseModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders.OptionExercise\n{\n    /// <summary>\n    /// Represents a model that simulates option exercise and lapse events\n    /// </summary>\n    public interface IOptionExerciseModel\n    {\n\n        /// <summary>\n        /// Model the option exercise \n        /// </summary>\n        /// <param name=\"option\">Option we're trading this order</param>\n        /// <param name=\"order\">Order to update</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        IEnumerable<OrderEvent> OptionExercise(Option option, OptionExerciseOrder order);\n\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OptionExercise/OptionExerciseModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Securities.Option;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders.OptionExercise\n{\n    /// <summary>\n    /// Python wrapper for custom option exercise models\n    /// </summary>\n    public class OptionExerciseModelPythonWrapper: BasePythonWrapper<IOptionExerciseModel>, IOptionExerciseModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"model\">The python model to wrapp</param>\n        public OptionExerciseModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Performs option exercise for the option security class.\n        /// </summary>\n        /// <param name=\"option\">Option we're trading this order</param>\n        /// <param name=\"order\">Order to update</param>\n        public IEnumerable<OrderEvent> OptionExercise(Option option, OptionExerciseOrder order)\n        {\n            return InvokeMethodAndEnumerate<OrderEvent>(nameof(OptionExercise), option, order);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OptionExerciseOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Option exercise order type definition\n    /// </summary>\n    public class OptionExerciseOrder : Order\n    {\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        public OptionExerciseOrder()\n        {\n        }\n\n        /// <summary>\n        /// New option exercise order constructor. We model option exercising as an underlying asset long/short order with strike equal to limit price.\n        /// This means that by exercising a call we get into long asset position, by exercising a put we get into short asset position.\n        /// </summary>\n        /// <param name=\"symbol\">Option symbol we're seeking to exercise</param>\n        /// <param name=\"quantity\">Quantity of the option we're seeking to exercise. Must be a positive value.</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public OptionExerciseOrder(Symbol symbol, decimal quantity, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Option Exercise Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.OptionExercise; }\n        }\n\n        /// <summary>\n        /// Gets the order value in option contracts quoted in options's currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            var option = (Option)security;\n\n            return option.GetExerciseQuantity(Quantity) * Price  / option.SymbolProperties.ContractMultiplier;\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new OptionExerciseOrder();\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Order.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Threading;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Order struct for placing new trade\n    /// </summary>\n    public abstract class Order\n    {\n        private volatile int _incrementalId;\n        private decimal _quantity;\n        private decimal _price;\n        private int _id;\n\n        /// <summary>\n        /// Order ID.\n        /// </summary>\n        [JsonProperty(PropertyName = \"id\")]\n        public int Id\n        {\n            get => _id;\n            internal set\n            {\n                _id = value;\n                if (_id != 0 && GroupOrderManager != null)\n                {\n                    lock (GroupOrderManager.OrderIds)\n                    {\n                        GroupOrderManager.OrderIds.Add(_id);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Order id to process before processing this order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"contingentId\")]\n        public int ContingentId { get; internal set; }\n\n        /// <summary>\n        /// Brokerage Id for this order for when the brokerage splits orders into multiple pieces\n        /// </summary>\n        [JsonProperty(PropertyName = \"brokerId\")]\n        public List<string> BrokerId { get; internal set; }\n\n        /// <summary>\n        /// Symbol of the Asset\n        /// </summary>\n        [JsonProperty(PropertyName = \"symbol\")]\n        public Symbol Symbol { get; internal set; }\n\n        /// <summary>\n        /// Price of the Order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"price\")]\n        public decimal Price\n        {\n            get { return _price; }\n            internal set { _price = value.Normalize(); }\n        }\n\n        /// <summary>\n        /// Currency for the order price\n        /// </summary>\n        [JsonProperty(PropertyName = \"priceCurrency\")]\n        public string PriceCurrency { get; internal set; }\n\n        /// <summary>\n        /// Gets the utc time the order was created.\n        /// </summary>\n        [JsonProperty(PropertyName = \"time\")]\n        public DateTime Time { get; internal set; }\n\n        /// <summary>\n        /// Gets the utc time this order was created. Alias for <see cref=\"Time\"/>\n        /// </summary>\n        [JsonProperty(PropertyName = \"createdTime\")]\n        public DateTime CreatedTime => Time;\n\n        /// <summary>\n        /// Gets the utc time the last fill was received, or null if no fills have been received\n        /// </summary>\n        [JsonProperty(PropertyName = \"lastFillTime\", NullValueHandling = NullValueHandling.Ignore)]\n        public DateTime? LastFillTime { get; internal set; }\n\n        /// <summary>\n        /// Gets the utc time this order was last updated, or null if the order has not been updated.\n        /// </summary>\n        [JsonProperty(PropertyName = \"lastUpdateTime\", NullValueHandling = NullValueHandling.Ignore)]\n        public DateTime? LastUpdateTime { get; internal set; }\n\n        /// <summary>\n        /// Gets the utc time this order was canceled, or null if the order was not canceled.\n        /// </summary>\n        [JsonProperty(PropertyName = \"canceledTime\", NullValueHandling = NullValueHandling.Ignore)]\n        public DateTime? CanceledTime { get; internal set; }\n\n        /// <summary>\n        /// Number of shares to execute.\n        /// </summary>\n        [JsonProperty(PropertyName = \"quantity\")]\n        public virtual decimal Quantity\n        {\n            get { return _quantity; }\n            internal set { _quantity = value.Normalize(); }\n        }\n\n        /// <summary>\n        /// Order Type\n        /// </summary>\n        [JsonProperty(PropertyName = \"type\")]\n        public abstract OrderType Type { get; }\n\n        /// <summary>\n        /// Status of the Order\n        /// </summary>\n        [JsonProperty(PropertyName = \"status\")]\n        public OrderStatus Status { get; set; }\n\n        /// <summary>\n        /// Order Time In Force\n        /// </summary>\n        [JsonIgnore]\n        public TimeInForce TimeInForce => Properties.TimeInForce;\n\n        /// <summary>\n        /// Tag the order with some custom data\n        /// </summary>\n        [JsonProperty(PropertyName = \"tag\" ,DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Tag { get; internal set; }\n\n        /// <summary>\n        /// Additional properties of the order\n        /// </summary>\n        [JsonProperty(PropertyName = \"properties\")]\n        public IOrderProperties Properties { get; private set; }\n\n        /// <summary>\n        /// The symbol's security type\n        /// </summary>\n        [JsonProperty(PropertyName = \"securityType\")]\n        public SecurityType SecurityType => Symbol.ID.SecurityType;\n\n        /// <summary>\n        /// Order Direction Property based off Quantity.\n        /// </summary>\n        [JsonProperty(PropertyName = \"direction\")]\n        public OrderDirection Direction\n        {\n            get\n            {\n                if (Quantity > 0)\n                {\n                    return OrderDirection.Buy;\n                }\n                if (Quantity < 0)\n                {\n                    return OrderDirection.Sell;\n                }\n                return OrderDirection.Hold;\n            }\n        }\n\n        /// <summary>\n        /// Get the absolute quantity for this order\n        /// </summary>\n        [JsonIgnore]\n        public decimal AbsoluteQuantity => Math.Abs(Quantity);\n\n        /// <summary>\n        /// Deprecated\n        /// </summary>\n        [JsonProperty(PropertyName = \"value\"), Obsolete(\"Please use Order.GetValue(security) or security.Holdings.HoldingsValue\")]\n        public decimal Value => Quantity * Price;\n\n        /// <summary>\n        /// Gets the price data at the time the order was submitted\n        /// </summary>\n        [JsonProperty(PropertyName = \"orderSubmissionData\")]\n        public OrderSubmissionData OrderSubmissionData { get; internal set; }\n\n        /// <summary>\n        /// Returns true if the order is a marketable order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"isMarketable\")]\n        public bool IsMarketable\n        {\n            get\n            {\n                if (Type == OrderType.Limit)\n                {\n                    // check if marketable limit order using bid/ask prices\n                    var limitOrder = (LimitOrder)this;\n                    return OrderSubmissionData != null &&\n                           (Direction == OrderDirection.Buy && limitOrder.LimitPrice >= OrderSubmissionData.AskPrice ||\n                            Direction == OrderDirection.Sell && limitOrder.LimitPrice <= OrderSubmissionData.BidPrice);\n                }\n\n                return Type == OrderType.Market || Type == OrderType.ComboMarket;\n            }\n        }\n\n        /// <summary>\n        /// Manager for the orders in the group if this is a combo order\n        /// </summary>\n        [JsonProperty(PropertyName = \"groupOrderManager\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public GroupOrderManager GroupOrderManager { get; set; }\n\n        /// <summary>\n        /// The adjustment mode used on the order fill price\n        /// </summary>\n        [JsonProperty(PropertyName = \"priceAdjustmentMode\")]\n        public DataNormalizationMode PriceAdjustmentMode { get; set; }\n\n        /// <summary>\n        /// Added a default constructor for JSON Deserialization:\n        /// </summary>\n        protected Order()\n        {\n            Time = new DateTime();\n            PriceCurrency = string.Empty;\n            Symbol = Symbol.Empty;\n            Status = OrderStatus.None;\n            Tag = string.Empty;\n            BrokerId = new List<string>();\n            Properties = new OrderProperties();\n            GroupOrderManager = null;\n        }\n\n        /// <summary>\n        /// New order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"groupOrderManager\">Manager for the orders in the group if this is a combo order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        protected Order(Symbol symbol, decimal quantity, DateTime time, GroupOrderManager groupOrderManager, string tag = \"\",\n            IOrderProperties properties = null)\n        {\n            Time = time;\n            PriceCurrency = string.Empty;\n            Quantity = quantity;\n            Symbol = symbol;\n            Status = OrderStatus.None;\n            Tag = tag;\n            BrokerId = new List<string>();\n            Properties = properties ?? new OrderProperties();\n            GroupOrderManager = groupOrderManager;\n        }\n\n        /// <summary>\n        /// New order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        protected Order(Symbol symbol, decimal quantity, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : this(symbol, quantity, time, null, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Creates an enumerable containing each position resulting from executing this order.\n        /// </summary>\n        /// <remarks>\n        /// This is provided in anticipation of a new combo order type that will need to override this method,\n        /// returning a position for each 'leg' of the order.\n        /// </remarks>\n        /// <returns>An enumerable of positions matching the results of executing this order</returns>\n        public virtual IEnumerable<IPosition> CreatePositions(SecurityManager securities)\n        {\n            var security = securities[Symbol];\n            yield return new Position(security, Quantity);\n        }\n\n        /// <summary>\n        /// Gets the value of this order at the given market price in units of the account currency\n        /// NOTE: Some order types derive value from other parameters, such as limit prices\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        /// <returns>The value of this order given the current market price</returns>\n        /// <remarks>TODO: we should remove this. Only used in tests</remarks>\n        public decimal GetValue(Security security)\n        {\n            var value = GetValueImpl(security);\n            return value*security.QuoteCurrency.ConversionRate*security.SymbolProperties.ContractMultiplier;\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency for a single unit.\n        /// A single unit here is a single share of stock, or a single barrel of oil, or the\n        /// cost of a single share in an option contract.\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected abstract decimal GetValueImpl(Security security);\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public virtual string GetDefaultTag()\n        {\n            return string.Empty;\n        }\n\n        /// <summary>\n        /// Gets a new unique incremental id for this order\n        /// </summary>\n        /// <returns>Returns a new id for this order</returns>\n        internal int GetNewId()\n        {\n            return Interlocked.Increment(ref _incrementalId);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public virtual void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            if (request.OrderId != Id)\n            {\n                throw new ArgumentException(\"Attempted to apply updates to the incorrect order!\");\n            }\n            if (request.Quantity.HasValue)\n            {\n                Quantity = request.Quantity.Value;\n            }\n            if (request.Tag != null)\n            {\n                Tag = request.Tag;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.Order.ToString(this);\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public abstract Order Clone();\n\n        /// <summary>\n        /// Copies base Order properties to the specified order\n        /// </summary>\n        /// <param name=\"order\">The target of the copy</param>\n        protected void CopyTo(Order order)\n        {\n            order.Id = Id;\n            // The group order manager has to be set before the quantity,\n            // since combo orders might need it to calculate the quantity in the Quantity setter.\n            order.GroupOrderManager = GroupOrderManager;\n            order.Time = Time;\n            order.LastFillTime = LastFillTime;\n            order.LastUpdateTime = LastUpdateTime;\n            order.CanceledTime = CanceledTime;\n            order.BrokerId = BrokerId.ToList();\n            order.ContingentId = ContingentId;\n            order.Price = Price;\n            order.PriceCurrency = PriceCurrency;\n            order.Quantity = Quantity;\n            order.Status = Status;\n            order.Symbol = Symbol;\n            order.Tag = Tag;\n            order.Properties = Properties.Clone();\n            order.OrderSubmissionData = OrderSubmissionData?.Clone();\n            order.PriceAdjustmentMode = PriceAdjustmentMode;\n        }\n\n        /// <summary>\n        /// Creates an <see cref=\"Order\"/> to match the specified <paramref name=\"request\"/>\n        /// </summary>\n        /// <param name=\"request\">The <see cref=\"SubmitOrderRequest\"/> to create an order for</param>\n        /// <returns>The <see cref=\"Order\"/> that matches the request</returns>\n        public static Order CreateOrder(SubmitOrderRequest request)\n        {\n            return CreateOrder(request.OrderId, request.OrderType, request.Symbol, request.Quantity, request.Time,\n                 request.Tag, request.OrderProperties, request.LimitPrice, request.StopPrice, request.TriggerPrice, request.TrailingAmount,\n                 request.TrailingAsPercentage, request.GroupOrderManager);\n        }\n\n        private static Order CreateOrder(int orderId, OrderType type, Symbol symbol, decimal quantity, DateTime time,\n            string tag, IOrderProperties properties, decimal limitPrice, decimal stopPrice, decimal triggerPrice, decimal trailingAmount,\n            bool trailingAsPercentage, GroupOrderManager groupOrderManager)\n        {\n            Order order;\n            switch (type)\n            {\n                case OrderType.Market:\n                    order = new MarketOrder(symbol, quantity, time, tag, properties);\n                    break;\n\n                case OrderType.Limit:\n                    order = new LimitOrder(symbol, quantity, limitPrice, time, tag, properties);\n                    break;\n\n                case OrderType.StopMarket:\n                    order = new StopMarketOrder(symbol, quantity, stopPrice, time, tag, properties);\n                    break;\n\n                case OrderType.StopLimit:\n                    order = new StopLimitOrder(symbol, quantity, stopPrice, limitPrice, time, tag, properties);\n                    break;\n\n                case OrderType.TrailingStop:\n                    order = new TrailingStopOrder(symbol, quantity, stopPrice, trailingAmount, trailingAsPercentage, time, tag, properties);\n                    break;\n\n                case OrderType.LimitIfTouched:\n                    order = new LimitIfTouchedOrder(symbol, quantity, triggerPrice, limitPrice, time, tag, properties);\n                    break;\n\n                case OrderType.MarketOnOpen:\n                    order = new MarketOnOpenOrder(symbol, quantity, time, tag, properties);\n                    break;\n\n                case OrderType.MarketOnClose:\n                    order = new MarketOnCloseOrder(symbol, quantity, time, tag, properties);\n                    break;\n\n                case OrderType.OptionExercise:\n                    order = new OptionExerciseOrder(symbol, quantity, time, tag, properties);\n                    break;\n\n                case OrderType.ComboLimit:\n                    order = new ComboLimitOrder(symbol, quantity, limitPrice, time, groupOrderManager, tag, properties);\n                    break;\n\n                case OrderType.ComboLegLimit:\n                    order = new ComboLegLimitOrder(symbol, quantity, limitPrice, time, groupOrderManager, tag, properties);\n                    break;\n\n                case OrderType.ComboMarket:\n                    order = new ComboMarketOrder(symbol, quantity, time, groupOrderManager, tag, properties);\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n            order.Status = OrderStatus.New;\n            order.Id = orderId;\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderError.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.ComponentModel;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Specifies the possible error states during presubmission checks\n    /// </summary>\n    public enum OrderError\n    {\n        /// <summary>\n        /// Order has already been filled and cannot be modified (-8)\n        /// </summary>\n        [Description(\"Order has already been filled and cannot be modified\")]\n        CanNotUpdateFilledOrder = -8,\n\n        /// <summary>\n        /// General error in order (-7)\n        /// </summary>\n        [Description(\"General error in order\")]\n        GeneralError = -7,\n\n        /// <summary>\n        /// Order timestamp error. Order appears to be executing in the future (-6)\n        /// </summary>\n        [Description(\"Order timestamp error. Order appears to be executing in the future\")]\n        TimestampError = -6,\n\n        /// <summary>\n        /// Exceeded maximum allowed orders for one analysis period (-5)\n        /// </summary>\n        [Description(\"Exceeded maximum allowed orders for one analysis period\")]\n        MaxOrdersExceeded = -5,\n\n        /// <summary>\n        /// Insufficient capital to execute order (-4)\n        /// </summary>\n        [Description(\"Insufficient capital to execute order\")]\n        InsufficientCapital = -4,\n\n        /// <summary>\n        /// Attempting market order outside of market hours (-3)\n        /// </summary>\n        [Description(\"Attempting market order outside of market hours\")]\n        MarketClosed = -3,\n\n        /// <summary>\n        /// There is no data yet for this security - please wait for data (market order price not available yet) (-2)\n        /// </summary>\n        [Description(\"There is no data yet for this security - please wait for data (market order price not available yet)\")]\n        NoData = -2,\n\n        /// <summary>\n        /// Order quantity must not be zero (-1)\n        /// </summary>\n        [Description(\"Order quantity must not be zero\")]\n        ZeroQuantity = -1,\n\n        /// <summary>\n        /// The order is OK (0)\n        /// </summary>\n        [Description(\"The order is OK\")]\n        None = 0\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.ComponentModel;\nusing Newtonsoft.Json;\nusing ProtoBuf;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Serialization;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Order Event - Messaging class signifying a change in an order state and record the change in the user's algorithm portfolio\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class OrderEvent\n    {\n        private decimal _fillPrice;\n        private decimal _fillQuantity;\n        private decimal _quantity;\n        private decimal? _limitPrice;\n        private decimal? _triggerPrice;\n        private decimal? _stopPrice;\n        private decimal? _trailingAmount;\n        private bool? _trailingAsPercentage;\n\n        /// <summary>\n        /// Id of the order this event comes from.\n        /// </summary>\n        [ProtoMember(1)]\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// The unique order event id for each order\n        /// </summary>\n        [ProtoMember(2)]\n        public int Id { get; set; }\n\n        /// <summary>\n        /// Easy access to the order symbol associated with this event.\n        /// </summary>\n        [ProtoMember(3)]\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// The date and time of this event (UTC).\n        /// </summary>\n        [ProtoMember(4)]\n        public DateTime UtcTime { get; set; }\n\n        /// <summary>\n        /// Status message of the order.\n        /// </summary>\n        [ProtoMember(5)]\n        public OrderStatus Status { get; set; }\n\n        /// <summary>\n        /// The fee associated with the order\n        /// </summary>\n        [ProtoMember(6)]\n        public OrderFee OrderFee { get; set; }\n\n        /// <summary>\n        /// Fill price information about the order\n        /// </summary>\n        [ProtoMember(7)]\n        public decimal FillPrice\n        {\n            get { return _fillPrice; }\n            set { _fillPrice = value.Normalize(); }\n        }\n\n        /// <summary>\n        /// Currency for the fill price\n        /// </summary>\n        [ProtoMember(8)]\n        public string FillPriceCurrency { get; set; }\n\n        /// <summary>\n        /// Number of shares of the order that was filled in this event.\n        /// </summary>\n        [ProtoMember(9)]\n        public decimal FillQuantity\n        {\n            get { return _fillQuantity; }\n            set { _fillQuantity = value.Normalize(); }\n        }\n\n        /// <summary>\n        /// Public Property Absolute Getter of Quantity -Filled\n        /// </summary>\n        [JsonIgnore]\n        public decimal AbsoluteFillQuantity => Math.Abs(FillQuantity);\n\n        /// <summary>\n        /// Order direction.\n        /// </summary>\n        [ProtoMember(10)]\n        public OrderDirection Direction { get; set; }\n\n        /// <summary>\n        /// Any message from the exchange.\n        /// </summary>\n        [DefaultValue(\"\"), JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(11)]\n        public string Message { get; set; }\n\n        /// <summary>\n        /// True if the order event is an assignment\n        /// </summary>\n        [ProtoMember(12)]\n        public bool IsAssignment { get; set; }\n\n        /// <summary>\n        /// The current stop price\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(13)]\n        public decimal? StopPrice\n        {\n            get { return _stopPrice; }\n            set\n            {\n                if (value.HasValue)\n                {\n                    _stopPrice = value.Value.Normalize();\n                }\n            }\n        }\n\n        /// <summary>\n        /// The current trigger price\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(14)]\n        public decimal? TriggerPrice\n        {\n            get { return _triggerPrice; }\n            set\n            {\n                if (value.HasValue)\n                {\n                    _triggerPrice = value.Value.Normalize();\n                }\n            }\n        }\n\n        /// <summary>\n        /// The current limit price\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(15)]\n        public decimal? LimitPrice\n        {\n            get { return _limitPrice; }\n            set\n            {\n                if (value.HasValue)\n                {\n                    _limitPrice = value.Value.Normalize();\n                }\n            }\n        }\n\n        /// <summary>\n        /// The current order quantity\n        /// </summary>\n        [ProtoMember(16)]\n        public decimal Quantity\n        {\n            get { return _quantity; }\n            set { _quantity = value.Normalize(); }\n        }\n\n        /// <summary>\n        /// True if the order event's option is In-The-Money (ITM)\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(17)]\n        public bool IsInTheMoney { get; set; }\n\n        /// <summary>\n        /// The trailing stop amount\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(18)]\n        public decimal? TrailingAmount\n        {\n            get { return _trailingAmount; }\n            set\n            {\n                if (value.HasValue)\n                {\n                    _trailingAmount = value.Value.Normalize();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Whether the <see cref=\"TrailingAmount\"/> is a percentage or an absolute currency value\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        [ProtoMember(19)]\n        public bool? TrailingAsPercentage\n        {\n            get { return _trailingAsPercentage; }\n            set\n            {\n                if (value.HasValue)\n                {\n                    _trailingAsPercentage = value.Value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// The order ticket associated to the order\n        /// </summary>\n        [JsonIgnore]\n        public OrderTicket Ticket { get; set; }\n\n        /// <summary>\n        /// Order Event empty constructor required for json converter\n        /// </summary>\n        public OrderEvent()\n        {\n        }\n\n        /// <summary>\n        /// Order Event Constructor.\n        /// </summary>\n        /// <param name=\"orderId\">Id of the parent order</param>\n        /// <param name=\"symbol\">Asset Symbol</param>\n        /// <param name=\"utcTime\">Date/time of this event</param>\n        /// <param name=\"status\">Status of the order</param>\n        /// <param name=\"direction\">The direction of the order this event belongs to</param>\n        /// <param name=\"fillPrice\">Fill price information if applicable.</param>\n        /// <param name=\"fillQuantity\">Fill quantity</param>\n        /// <param name=\"orderFee\">The order fee</param>\n        /// <param name=\"message\">Message from the exchange</param>\n        public OrderEvent(int orderId,\n            Symbol symbol,\n            DateTime utcTime,\n            OrderStatus status,\n            OrderDirection direction,\n            decimal fillPrice,\n            decimal fillQuantity,\n            OrderFee orderFee,\n            string message = \"\"\n            )\n        {\n            OrderId = orderId;\n            Symbol = symbol;\n            UtcTime = utcTime;\n            Status = status;\n            Direction = direction;\n            FillPrice = fillPrice;\n            FillPriceCurrency = string.Empty;\n            FillQuantity = fillQuantity;\n            OrderFee = orderFee;\n            Message = message;\n            IsAssignment = false;\n        }\n\n        /// <summary>\n        /// Helper Constructor using Order to Initialize.\n        /// </summary>\n        /// <param name=\"order\">Order for this order status</param>\n        /// <param name=\"utcTime\">Date/time of this event</param>\n        /// <param name=\"orderFee\">The order fee</param>\n        /// <param name=\"message\">Message from exchange or QC.</param>\n        public OrderEvent(Order order, DateTime utcTime, OrderFee orderFee, string message = \"\")\n        {\n            OrderId = order.Id;\n            Symbol = order.Symbol;\n            Status = order.Status;\n            Quantity = order.Quantity;\n            Direction = order.Direction;\n\n            //Initialize to zero, manually set fill quantity\n            FillQuantity = 0;\n            FillPrice = 0;\n            FillPriceCurrency = order.PriceCurrency;\n\n            UtcTime = utcTime;\n            OrderFee = orderFee;\n            Message = message;\n            IsAssignment = false;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.OrderEvent.ToString(this);\n        }\n\n        /// <summary>\n        /// Returns a short string that represents the current object.\n        /// </summary>\n        public string ShortToString()\n        {\n            return Messages.OrderEvent.ShortToString(this);\n        }\n\n        /// <summary>\n        /// Returns a clone of the current object.\n        /// </summary>\n        /// <returns>The new clone object</returns>\n        public OrderEvent Clone()\n        {\n            return (OrderEvent) MemberwiseClone();\n        }\n\n        /// <summary>\n        /// Creates a new instance based on the provided serialized order event\n        /// </summary>\n        public static OrderEvent FromSerialized(SerializedOrderEvent serializedOrderEvent)\n        {\n            var sid = SecurityIdentifier.Parse(serializedOrderEvent.Symbol);\n            var symbol = new Symbol(sid, sid.Symbol);\n\n            var orderFee = OrderFee.Zero;\n            if (serializedOrderEvent.OrderFeeAmount.HasValue)\n            {\n                orderFee = new OrderFee(new CashAmount(serializedOrderEvent.OrderFeeAmount.Value,\n                    serializedOrderEvent.OrderFeeCurrency));\n            }\n\n            var orderEvent = new OrderEvent(serializedOrderEvent.OrderId,\n                symbol,\n                DateTime.SpecifyKind(Time.UnixTimeStampToDateTime(serializedOrderEvent.Time), DateTimeKind.Utc),\n                serializedOrderEvent.Status,\n                serializedOrderEvent.Direction,\n                serializedOrderEvent.FillPrice,\n                serializedOrderEvent.FillQuantity,\n                orderFee,\n                serializedOrderEvent.Message)\n            {\n                IsAssignment = serializedOrderEvent.IsAssignment,\n                IsInTheMoney = serializedOrderEvent.IsInTheMoney,\n                LimitPrice = serializedOrderEvent.LimitPrice,\n                StopPrice = serializedOrderEvent.StopPrice,\n                FillPriceCurrency = serializedOrderEvent.FillPriceCurrency,\n                Id = serializedOrderEvent.OrderEventId,\n                Quantity = serializedOrderEvent.Quantity\n            };\n\n            return orderEvent;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides extension methods for the <see cref=\"Order\"/> class and for the <see cref=\"OrderStatus\"/> enumeration\n    /// </summary>\n    public static class OrderExtensions\n    {\n        /// <summary>\n        /// Determines if the specified status is in a closed state.\n        /// </summary>\n        /// <param name=\"status\">The status to check</param>\n        /// <returns>True if the status is <see cref=\"OrderStatus.Filled\"/>, <see cref=\"OrderStatus.Canceled\"/>, or <see cref=\"OrderStatus.Invalid\"/></returns>\n        public static bool IsClosed(this OrderStatus status)\n        {\n            return status == OrderStatus.Filled\n                || status == OrderStatus.Canceled\n                || status == OrderStatus.Invalid;\n        }\n\n        /// <summary>\n        /// Determines if the specified status is in an open state.\n        /// </summary>\n        /// <param name=\"status\">The status to check</param>\n        /// <returns>True if the status is not <see cref=\"OrderStatus.Filled\"/>, <see cref=\"OrderStatus.Canceled\"/>, or <see cref=\"OrderStatus.Invalid\"/></returns>\n        public static bool IsOpen(this OrderStatus status)\n        {\n            return !status.IsClosed();\n        }\n\n        /// <summary>\n        /// Determines if the specified status is a fill, that is, <see cref=\"OrderStatus.Filled\"/>\n        /// order <see cref=\"OrderStatus.PartiallyFilled\"/>\n        /// </summary>\n        /// <param name=\"status\">The status to check</param>\n        /// <returns>True if the status is <see cref=\"OrderStatus.Filled\"/> or <see cref=\"OrderStatus.PartiallyFilled\"/>, false otherwise</returns>\n        public static bool IsFill(this OrderStatus status)\n        {\n            return status == OrderStatus.Filled || status == OrderStatus.PartiallyFilled;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified order is a limit order\n        /// </summary>\n        /// <param name=\"orderType\">The order to check</param>\n        /// <returns>True if the order is a limit order, false otherwise</returns>\n        public static bool IsLimitOrder(this OrderType orderType)\n        {\n            return orderType == OrderType.Limit\n                || orderType == OrderType.StopLimit\n                || orderType == OrderType.LimitIfTouched;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified order is a stop order\n        /// </summary>\n        /// <param name=\"orderType\">The order to check</param>\n        /// <returns>True if the order is a stop order, false otherwise</returns>\n        public static bool IsStopOrder(this OrderType orderType)\n        {\n            return orderType == OrderType.StopMarket || orderType == OrderType.StopLimit || orderType == OrderType.TrailingStop;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderField.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Specifies an order field that does not apply to all order types\n    /// </summary>\n    public enum OrderField\n    {\n        /// <summary>\n        /// The limit price for a <see cref=\"LimitOrder\"/>, <see cref=\"StopLimitOrder\"/> or <see cref=\"LimitIfTouchedOrder\"/> (0)\n        /// </summary>\n        LimitPrice,\n\n        /// <summary>\n        /// The stop price for stop orders (<see cref=\"StopMarketOrder\"/>, <see cref=\"StopLimitOrder\"/>) (1)\n        /// </summary>\n        StopPrice,\n\n        /// <summary>\n        /// The trigger price for a <see cref=\"LimitIfTouchedOrder\"/> (2)\n        /// </summary>\n        TriggerPrice,\n\n        /// <summary>\n        /// The trailing amount for a <see cref=\"TrailingStopOrder\"/> (3)\n        /// </summary>\n        TrailingAmount,\n\n        /// <summary>\n        /// Whether the trailing amount for a <see cref=\"TrailingStopOrder\"/> is a percentage or an absolute currency value (4)\n        /// </summary>\n        TrailingAsPercentage\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"JsonConverter\"/> that can deserialize Orders\n    /// </summary>\n    public class OrderJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(Order).IsAssignableFrom(objectType);\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException(\"The OrderJsonConverter does not implement a WriteJson method;.\");\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            var order = CreateOrderFromJObject(jObject);\n\n            return order;\n        }\n\n        /// <summary>\n        /// Create an order from a simple JObject\n        /// </summary>\n        /// <param name=\"jObject\"></param>\n        /// <returns>Order Object</returns>\n        public static Order CreateOrderFromJObject(JObject jObject)\n        {\n            // create order instance based on order type field\n            var orderType = (OrderType)(jObject[\"Type\"]?.Value<int>() ?? jObject[\"type\"].Value<int>());\n            var order = CreateOrder(orderType, jObject);\n\n            // populate common order properties\n            order.Id = jObject[\"Id\"]?.Value<int>() ?? jObject[\"id\"].Value<int>();\n\n            var jsonStatus = jObject[\"Status\"] ?? jObject[\"status\"];\n            var jsonTime = jObject[\"Time\"] ?? jObject[\"time\"];\n            if (jsonStatus.Type == JTokenType.Integer)\n            {\n                order.Status = (OrderStatus)jsonStatus.Value<int>();\n            }\n            else if (jsonStatus.Type == JTokenType.Null)\n            {\n                order.Status = OrderStatus.Canceled;\n            }\n            else\n            {\n                // The `Status` tag can sometimes appear as a string of the enum value in the LiveResultPacket.\n                order.Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), jsonStatus.Value<string>(), true);\n            }\n            if (jsonTime != null && jsonTime.Type != JTokenType.Null)\n            {\n                order.Time = jsonTime.Value<DateTime>();\n            }\n            else\n            {\n                // `Time` can potentially be null in some LiveResultPacket instances, but\n                // `CreatedTime` will always be there if `Time` is absent.\n                order.Time = (jObject[\"CreatedTime\"]?.Value<DateTime>() ?? jObject[\"createdTime\"].Value<DateTime>());\n            }\n\n            var orderSubmissionData = jObject[\"OrderSubmissionData\"] ?? jObject[\"orderSubmissionData\"];\n            if (orderSubmissionData != null && orderSubmissionData.Type != JTokenType.Null)\n            {\n                var bidPrice = orderSubmissionData[\"BidPrice\"]?.Value<decimal>() ?? orderSubmissionData[\"bidPrice\"].Value<decimal>();\n                var askPrice = orderSubmissionData[\"AskPrice\"]?.Value<decimal>() ?? orderSubmissionData[\"askPrice\"].Value<decimal>();\n                var lastPrice = orderSubmissionData[\"LastPrice\"]?.Value<decimal>() ?? orderSubmissionData[\"lastPrice\"].Value<decimal>();\n                order.OrderSubmissionData = new OrderSubmissionData(bidPrice, askPrice, lastPrice);\n            }\n\n            var priceAdjustmentMode = jObject[\"PriceAdjustmentMode\"] ?? jObject[\"priceAdjustmentMode\"];\n            if (priceAdjustmentMode != null && priceAdjustmentMode.Type != JTokenType.Null)\n            {\n                var value = priceAdjustmentMode.Value<int>();\n                order.PriceAdjustmentMode = (DataNormalizationMode)value;\n            }\n\n            var lastFillTime = jObject[\"LastFillTime\"] ?? jObject[\"lastFillTime\"];\n            var lastUpdateTime = jObject[\"LastUpdateTime\"] ?? jObject[\"lastUpdateTime\"];\n            var canceledTime = jObject[\"CanceledTime\"] ?? jObject[\"canceledTime\"];\n\n            if (canceledTime != null && canceledTime.Type != JTokenType.Null)\n            {\n                order.CanceledTime = canceledTime.Value<DateTime>();\n            }\n            if (lastFillTime != null && lastFillTime.Type != JTokenType.Null)\n            {\n                order.LastFillTime = lastFillTime.Value<DateTime>();\n            }\n            if (lastUpdateTime != null && lastUpdateTime.Type != JTokenType.Null)\n            {\n                order.LastUpdateTime = lastUpdateTime.Value<DateTime>();\n            }\n            var tag = jObject[\"Tag\"] ?? jObject[\"tag\"];\n            if (tag != null && tag.Type != JTokenType.Null)\n            {\n                order.Tag = tag.Value<string>();\n            }\n            else\n            {\n                order.Tag = string.Empty;\n            }\n\n            order.Quantity = jObject[\"Quantity\"]?.Value<decimal>() ?? jObject[\"quantity\"].Value<decimal>();\n            var orderPrice = jObject[\"Price\"] ?? jObject[\"price\"];\n            if (orderPrice != null && orderPrice.Type != JTokenType.Null)\n            {\n                order.Price = orderPrice.Value<decimal>();\n            }\n            else\n            {\n                order.Price = default(decimal);\n            }\n\n            var priceCurrency = jObject[\"PriceCurrency\"] ?? jObject[\"priceCurrency\"];\n            if (priceCurrency != null && priceCurrency.Type != JTokenType.Null)\n            {\n                order.PriceCurrency = priceCurrency.Value<string>();\n            }\n            order.BrokerId = jObject[\"BrokerId\"]?.Select(x => x.Value<string>()).ToList() ?? jObject[\"brokerId\"].Select(x => x.Value<string>()).ToList();\n            var jsonContingentId = jObject[\"ContingentId\"] ?? jObject[\"contingentId\"];\n            if (jsonContingentId != null && jsonContingentId.Type != JTokenType.Null)\n            {\n                order.ContingentId = jsonContingentId.Value<int>();\n            }\n\n            var timeInForce = jObject[\"Properties\"]?[\"TimeInForce\"] ?? jObject[\"TimeInForce\"] ?? jObject[\"Duration\"];\n            if (timeInForce == null)\n            {\n                timeInForce = jObject[\"properties\"]?[\"timeInForce\"] ?? jObject[\"timeInForce\"] ?? jObject[\"duration\"];\n            }\n            order.Properties.TimeInForce = (timeInForce != null)\n                ? CreateTimeInForce(timeInForce, jObject)\n                : TimeInForce.GoodTilCanceled;\n\n            if (jObject.SelectTokens(\"Symbol.ID\").Any())\n            {\n                var sid = SecurityIdentifier.Parse(jObject.SelectTokens(\"Symbol.ID\").Single().Value<string>());\n                var ticker = jObject.SelectTokens(\"Symbol.Value\").Single().Value<string>();\n                order.Symbol = new Symbol(sid, ticker);\n            }\n            else if (jObject.SelectTokens(\"symbol.id\").Any())\n            {\n                var sid = SecurityIdentifier.Parse(jObject.SelectTokens(\"symbol.id\").Single().Value<string>());\n                var ticker = jObject.SelectTokens(\"symbol.value\").Single().Value<string>();\n                order.Symbol = new Symbol(sid, ticker);\n            }\n            else\n            {\n                string market = null;\n\n                //does data have market?\n                var suppliedMarket = jObject.SelectTokens(\"Symbol.ID.Market\") ?? jObject.SelectTokens(\"symbol.ID.Market\");\n                if (suppliedMarket.Any())\n                {\n                    market = suppliedMarket.Single().Value<string>();\n                }\n\n                // we only get the security type if we need it, because it might not be there in other cases\n                var securityType = (SecurityType)(jObject[\"SecurityType\"]?.Value<int>() ?? jObject[\"securityType\"].Value<int>());\n\n                var symbolValueUpperCase = jObject.SelectTokens(\"Symbol.Value\");\n                var symbolValueCamelCase = jObject.SelectTokens(\"symbol.value\");\n                string ticker = default;\n                if (symbolValueUpperCase.Any())\n                {\n                    // provide for backwards compatibility\n                    ticker = symbolValueUpperCase.Single().Value<string>();\n                }\n                else if (symbolValueCamelCase.Any())\n                {\n                    // provide compatibility for orders in camel case\n                    ticker = symbolValueCamelCase.Single().Value<string>();\n                }\n                else\n                {\n                    ticker = jObject[\"Symbol\"]?.Value<string>() ?? jObject[\"symbol\"]?.Value<string>();\n                }\n\n                if (market == null && !SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(ticker, securityType, out market))\n                {\n                    market = DefaultBrokerageModel.DefaultMarketMap[securityType];\n                }\n                order.Symbol = Symbol.Create(ticker, securityType, market);\n            }\n\n            return order;\n        }\n\n        /// <summary>\n        /// Creates an order of the correct type\n        /// </summary>\n        private static Order CreateOrder(OrderType orderType, JObject jObject)\n        {\n            Order order;\n            switch (orderType)\n            {\n                case OrderType.Market:\n                    order = new MarketOrder();\n                    break;\n\n                case OrderType.Limit:\n                    order = new LimitOrder { LimitPrice = jObject[\"LimitPrice\"]?.Value<decimal>() ?? jObject[\"limitPrice\"]?.Value<decimal>() ?? default(decimal) };\n                    break;\n\n                case OrderType.StopMarket:\n                    order = new StopMarketOrder\n                    {\n                        StopPrice = jObject[\"stopPrice\"]?.Value<decimal>() ?? jObject[\"StopPrice\"]?.Value<decimal>() ?? default(decimal)\n                    };\n                    break;\n\n                case OrderType.StopLimit:\n                    order = new StopLimitOrder\n                    {\n                        LimitPrice = jObject[\"LimitPrice\"]?.Value<decimal>() ?? jObject[\"limitPrice\"]?.Value<decimal>() ?? default(decimal),\n                        StopPrice = jObject[\"stopPrice\"]?.Value<decimal>() ?? jObject[\"StopPrice\"]?.Value<decimal>() ?? default(decimal)\n                    };\n                    break;\n\n                case OrderType.TrailingStop:\n                    order = new TrailingStopOrder\n                    {\n                        StopPrice = jObject[\"StopPrice\"]?.Value<decimal>() ?? jObject[\"stopPrice\"]?.Value<decimal>() ?? default(decimal),\n                        TrailingAmount = jObject[\"TrailingAmount\"]?.Value<decimal>() ?? jObject[\"trailingAmount\"]?.Value<decimal>() ??  default(decimal),\n                        TrailingAsPercentage = jObject[\"TrailingAsPercentage\"]?.Value<bool>() ?? jObject[\"trailingAsPercentage\"]?.Value<bool>() ?? default(bool)\n                    };\n                    break;\n\n                case OrderType.LimitIfTouched:\n                    order = new LimitIfTouchedOrder\n                    {\n                        LimitPrice = jObject[\"LimitPrice\"]?.Value<decimal>() ?? jObject[\"limitPrice\"]?.Value<decimal>() ?? default(decimal),\n                        TriggerPrice = jObject[\"TriggerPrice\"]?.Value<decimal>() ?? jObject[\"triggerPrice\"]?.Value<decimal>() ?? default(decimal)\n                    };\n                    break;\n\n                case OrderType.MarketOnOpen:\n                    order = new MarketOnOpenOrder();\n                    break;\n\n                case OrderType.MarketOnClose:\n                    order = new MarketOnCloseOrder();\n                    break;\n\n                case OrderType.OptionExercise:\n                    order = new OptionExerciseOrder();\n                    break;\n\n                case OrderType.ComboMarket:\n                    order = new ComboMarketOrder() { GroupOrderManager = DeserializeGroupOrderManager(jObject) };\n                    break;\n\n                case OrderType.ComboLimit:\n                    order = new ComboLimitOrder() { GroupOrderManager = DeserializeGroupOrderManager(jObject) };\n                    break;\n\n                case OrderType.ComboLegLimit:\n                    order = new ComboLegLimitOrder\n                    {\n                        GroupOrderManager = DeserializeGroupOrderManager(jObject),\n                        LimitPrice = jObject[\"LimitPrice\"]?.Value<decimal>() ?? jObject[\"limitPrice\"]?.Value<decimal>() ?? default(decimal)\n                    };\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n            return order;\n        }\n\n        /// <summary>\n        /// Creates a Time In Force of the correct type\n        /// </summary>\n        private static TimeInForce CreateTimeInForce(JToken timeInForce, JObject jObject)\n        {\n            // for backward-compatibility support deserialization of old JSON format\n            if (timeInForce is JValue)\n            {\n                var value = timeInForce.Value<int>();\n\n                switch (value)\n                {\n                    case 0:\n                        return TimeInForce.GoodTilCanceled;\n\n                    case 1:\n                        return TimeInForce.Day;\n\n                    case 2:\n                        var expiry = jObject[\"DurationValue\"].Value<DateTime>();\n                        return TimeInForce.GoodTilDate(expiry);\n\n                    default:\n                        throw new Exception($\"Unknown time in force value: {value}\");\n                }\n            }\n\n            // convert with TimeInForceJsonConverter\n            return timeInForce.ToObject<TimeInForce>();\n        }\n\n        /// <summary>\n        /// Deserializes the GroupOrderManager from the JSON object\n        /// </summary>\n        private static GroupOrderManager DeserializeGroupOrderManager(JObject jObject)\n        {\n            var groupOrderManagerJObject = jObject[\"GroupOrderManager\"] ?? jObject[\"groupOrderManager\"];\n\n            // this should never happen\n            if (groupOrderManagerJObject == null)\n            {\n                throw new ArgumentException(\"OrderJsonConverter.DeserializeGroupOrderManager(): JObject does not have a GroupOrderManager\");\n            }\n\n            var result = new GroupOrderManager(\n                groupOrderManagerJObject[\"Id\"]?.Value<int>() ?? groupOrderManagerJObject[\"id\"].Value<int>(),\n                groupOrderManagerJObject[\"Count\"]?.Value<int>() ?? groupOrderManagerJObject[\"count\"].Value<int>(),\n                groupOrderManagerJObject[\"Quantity\"]?.Value<decimal>() ?? groupOrderManagerJObject[\"quantity\"].Value<decimal>(),\n                groupOrderManagerJObject[\"LimitPrice\"]?.Value<decimal>() ?? groupOrderManagerJObject[\"limitPrice\"].Value<decimal>()\n            );\n\n            foreach (var orderId in (groupOrderManagerJObject[\"OrderIds\"]?.Values<int>() ?? groupOrderManagerJObject[\"orderIds\"].Values<int>()))\n            {\n                result.OrderIds.Add(orderId);\n            }\n\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order\n    /// </summary>\n    public class OrderProperties : IOrderProperties\n    {\n        /// <summary>\n        /// Defines the length of time over which an order will continue working before it is cancelled\n        /// </summary>\n        public TimeInForce TimeInForce { get; set; }\n\n        /// <summary>\n        /// Defines the exchange name for a particular market\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Exchange Exchange { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderProperties\"/> class\n        /// </summary>\n        public OrderProperties()\n        {\n            TimeInForce = TimeInForce.GoodTilCanceled;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderProperties\"/> class, with exchange param\n        ///<param name=\"exchange\">Exchange name for market</param>\n        /// </summary>\n        public OrderProperties(Exchange exchange) : this()\n        {\n            Exchange = exchange;\n        }\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public virtual IOrderProperties Clone()\n        {\n            return (OrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Represents a request to submit, update, or cancel an order\n    /// </summary>\n    public abstract class OrderRequest\n    {\n        /// <summary>\n        /// Gets the type of this order request\n        /// </summary>\n        public abstract OrderRequestType OrderRequestType\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the status of this request\n        /// </summary>\n        public OrderRequestStatus Status\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the UTC time the request was created\n        /// </summary>\n        public DateTime Time\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the order id the request acts on\n        /// </summary>\n        public int OrderId\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Gets a tag for this request\n        /// </summary>\n        public string Tag\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the response for this request. If this request was never processed then this\n        /// will equal <see cref=\"OrderResponse.Unprocessed\"/>. This value is never equal to null.\n        /// </summary>\n        public OrderResponse Response\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderRequest\"/> class\n        /// </summary>\n        /// <param name=\"time\">The time this request was created</param>\n        /// <param name=\"orderId\">The order id this request acts on, specify zero for <see cref=\"SubmitOrderRequest\"/></param>\n        /// <param name=\"tag\">A custom tag for the request</param>\n        protected OrderRequest(DateTime time, int orderId, string tag)\n        {\n            Time = time;\n            OrderId = orderId;\n            Tag = tag;\n            Response = OrderResponse.Unprocessed;\n            Status = OrderRequestStatus.Unprocessed;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"Response\"/> for this request\n        /// </summary>\n        /// <param name=\"response\">The response to this request</param>\n        /// <param name=\"status\">The current status of this request</param>\n        public void SetResponse(OrderResponse response, OrderRequestStatus status = OrderRequestStatus.Error)\n        {\n            if (response == null)\n            {\n                throw new ArgumentNullException(nameof(response), \"Response can not be null\");\n            }\n\n            // if the response is an error, ignore the input status\n            Status = response.IsError ? OrderRequestStatus.Error : status;\n            Response = response;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.OrderRequest.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderRequestStatus.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Specifies the status of a request\n    /// </summary>\n    public enum OrderRequestStatus\n    {\n        /// <summary>\n        /// This is an unprocessed request (0)\n        /// </summary>\n        Unprocessed,\n\n        /// <summary>\n        /// This request is partially processed (1)\n        /// </summary>\n        Processing,\n\n        /// <summary>\n        /// This request has been completely processed (2)\n        /// </summary>\n        Processed,\n\n        /// <summary>\n        /// This request encountered an error (3)\n        /// </summary>\n        Error\n    }\n}"
  },
  {
    "path": "Common/Orders/OrderRequestType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Specifies the type of <see cref=\"OrderRequest\"/>\n    /// </summary>\n    public enum OrderRequestType\n    {\n        /// <summary>\n        /// The request is a <see cref=\"SubmitOrderRequest\"/> (0)\n        /// </summary>\n        Submit,\n\n        /// <summary>\n        /// The request is a <see cref=\"UpdateOrderRequest\"/> (1)\n        /// </summary>\n        Update,\n\n        /// <summary>\n        /// The request is a <see cref=\"CancelOrderRequest\"/> (2)\n        /// </summary>\n        Cancel\n    }\n}"
  },
  {
    "path": "Common/Orders/OrderResponse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Represents a response to an <see cref=\"OrderRequest\"/>. See <see cref=\"OrderRequest.Response\"/> property for\n    /// a specific request's response value\n    /// </summary>\n    public class OrderResponse\n    {\n        /// <summary>\n        /// Gets the order id\n        /// </summary>\n        public int OrderId\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the error message if the <see cref=\"ErrorCode\"/> does not equal <see cref=\"OrderResponseErrorCode.None\"/>, otherwise\n        /// gets <see cref=\"string.Empty\"/>\n        /// </summary>\n        public string ErrorMessage\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the error code for this response.\n        /// </summary>\n        public OrderResponseErrorCode ErrorCode\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets true if this response represents a successful request, false otherwise\n        /// If this is an unprocessed response, IsSuccess will return false.\n        /// </summary>\n        public bool IsSuccess\n        {\n            get { return IsProcessed && !IsError; }\n        }\n\n        /// <summary>\n        /// Gets true if this response represents an error, false otherwise\n        /// </summary>\n        public bool IsError\n        {\n            get { return IsProcessed && ErrorCode != OrderResponseErrorCode.None; }\n        }\n\n        /// <summary>\n        /// Gets true if this response has been processed, false otherwise\n        /// </summary>\n        public bool IsProcessed\n        {\n            get { return this != Unprocessed; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderResponse\"/> class\n        /// </summary>\n        /// <param name=\"orderId\">The order id</param>\n        /// <param name=\"errorCode\">The error code of the response, specify <see cref=\"OrderResponseErrorCode.None\"/> for no error</param>\n        /// <param name=\"errorMessage\">The error message, applies only if the <paramref name=\"errorCode\"/> does not equal <see cref=\"OrderResponseErrorCode.None\"/></param>\n        private OrderResponse(int orderId, OrderResponseErrorCode errorCode, string errorMessage)\n        {\n            OrderId = orderId;\n            ErrorCode = errorCode;\n            if (errorCode != OrderResponseErrorCode.None)\n            {\n                ErrorMessage = errorMessage ?? Messages.OrderResponse.DefaultErrorMessage;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.OrderResponse.ToString(this);\n        }\n\n        #region Statics - implicit(int), Unprocessed constant, response factory methods\n\n        /// <summary>\n        /// Gets an <see cref=\"OrderResponse\"/> for a request that has not yet been processed\n        /// </summary>\n        public static readonly OrderResponse Unprocessed = new OrderResponse(int.MinValue, OrderResponseErrorCode.None,\n            Messages.OrderResponse.UnprocessedOrderResponseErrorMessage);\n\n        /// <summary>\n        /// Helper method to create a successful response from a request\n        /// </summary>\n        public static OrderResponse Success(OrderRequest request)\n        {\n            return new OrderResponse(request.OrderId, OrderResponseErrorCode.None, null);\n        }\n\n        /// <summary>\n        /// Helper method to create an error response from a request\n        /// </summary>\n        public static OrderResponse Error(OrderRequest request, OrderResponseErrorCode errorCode, string errorMessage)\n        {\n            return new OrderResponse(request.OrderId, errorCode, errorMessage);\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to an invalid order status\n        /// </summary>\n        public static OrderResponse InvalidStatus(OrderRequest request, Order order)\n        {\n            return Error(request, OrderResponseErrorCode.InvalidOrderStatus, Messages.OrderResponse.InvalidStatus(request, order));\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to the \"New\" order status\n        /// </summary>\n        public static OrderResponse InvalidNewStatus(OrderRequest request, Order order)\n        {\n            return Error(request, OrderResponseErrorCode.InvalidNewOrderStatus, Messages.OrderResponse.InvalidNewStatus(request, order));\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to a bad order id\n        /// </summary>\n        public static OrderResponse UnableToFindOrder(OrderRequest request)\n        {\n            return Error(request, OrderResponseErrorCode.UnableToFindOrder, Messages.OrderResponse.UnableToFindOrder(request));\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to a zero order quantity\n        /// </summary>\n        public static OrderResponse ZeroQuantity(OrderRequest request)\n        {\n            return Error(request, OrderResponseErrorCode.OrderQuantityZero, Messages.OrderResponse.ZeroQuantity(request));\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to a missing security\n        /// </summary>\n        public static OrderResponse MissingSecurity(SubmitOrderRequest request)\n        {\n            return Error(request, OrderResponseErrorCode.MissingSecurity, Messages.OrderResponse.MissingSecurity(request));\n        }\n\n        /// <summary>\n        /// Helper method to create an error response due to algorithm still in warmup mode\n        /// </summary>\n        public static OrderResponse WarmingUp(OrderRequest request)\n        {\n            return Error(request, OrderResponseErrorCode.AlgorithmWarmingUp, Messages.OrderResponse.WarmingUp(request));\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderResponseErrorCode.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Error detail code\n    /// </summary>\n    public enum OrderResponseErrorCode\n    {\n        /// <summary>\n        /// No error (0)\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// Unknown error (-1)\n        /// </summary>\n        ProcessingError = -1,\n\n        /// <summary>\n        /// Cannot submit because order already exists (-2)\n        /// </summary>\n        OrderAlreadyExists = -2,\n\n        /// <summary>\n        /// Not enough money to to submit order (-3)\n        /// </summary>\n        InsufficientBuyingPower = -3,\n\n        /// <summary>\n        /// Internal logic invalidated submit order (-4)\n        /// </summary>\n        BrokerageModelRefusedToSubmitOrder = -4,\n\n        /// <summary>\n        /// Brokerage submit error (-5)\n        /// </summary>\n        BrokerageFailedToSubmitOrder = -5,\n\n        /// <summary>\n        /// Brokerage update error (-6)\n        /// </summary>\n        BrokerageFailedToUpdateOrder = -6,\n\n        /// <summary>\n        /// Internal logic invalidated update order (-7)\n        /// </summary>\n        BrokerageHandlerRefusedToUpdateOrder = -7,\n\n        /// <summary>\n        /// Brokerage cancel error (-8)\n        /// </summary>\n        BrokerageFailedToCancelOrder = -8,\n\n        /// <summary>\n        /// Only pending orders can be canceled (-9)\n        /// </summary>\n        InvalidOrderStatus = -9,\n\n        /// <summary>\n        /// Missing order (-10)\n        /// </summary>\n        UnableToFindOrder = -10,\n\n        /// <summary>\n        /// Cannot submit or update orders with zero quantity (-11)\n        /// </summary>\n        OrderQuantityZero = -11,\n\n        /// <summary>\n        /// This type of request is unsupported (-12)\n        /// </summary>\n        UnsupportedRequestType = -12,\n\n        /// <summary>\n        /// Unknown error during pre order request validation (-13)\n        /// </summary>\n        PreOrderChecksError = -13,\n\n        /// <summary>\n        /// Security is missing. Probably did not subscribe (-14)\n        /// </summary>\n        MissingSecurity = -14,\n\n        /// <summary>\n        /// Some order types require open exchange (-15)\n        /// </summary>\n        ExchangeNotOpen = -15,\n\n        /// <summary>\n        /// Zero security price is probably due to bad data (-16)\n        /// </summary>\n        SecurityPriceZero = -16,\n\n        /// <summary>\n        /// Need both currencies in cashbook to trade a pair (-17)\n        /// </summary>\n        ForexBaseAndQuoteCurrenciesRequired = -17,\n\n        /// <summary>\n        /// Need conversion rate to account currency (-18)\n        /// </summary>\n        ForexConversionRateZero = -18,\n\n        /// <summary>\n        /// Should not attempt trading without at least one data point (-19)\n        /// </summary>\n        SecurityHasNoData = -19,\n\n        /// <summary>\n        /// Transaction manager's cache is full (-20)\n        /// </summary>\n        ExceededMaximumOrders = -20,\n\n        /// <summary>\n        /// Below buffer time for MOC order to be placed before exchange closes. 15.5 minutes by default (-21)\n        /// </summary>\n        MarketOnCloseOrderTooLate = -21,\n\n        /// <summary>\n        /// Request is invalid or null (-22)\n        /// </summary>\n        InvalidRequest = -22,\n\n        /// <summary>\n        /// Request was canceled by user (-23)\n        /// </summary>\n        RequestCanceled = -23,\n\n        /// <summary>\n        /// All orders are invalidated while algorithm is warming up (-24)\n        /// </summary>\n        AlgorithmWarmingUp = -24,\n\n        /// <summary>\n        /// Internal logic invalidated update order (-25)\n        /// </summary>\n        BrokerageModelRefusedToUpdateOrder = -25,\n\n        /// <summary>\n        /// Need quote currency in cashbook to trade (-26)\n        /// </summary>\n        QuoteCurrencyRequired = -26,\n\n        /// <summary>\n        /// Need conversion rate to account currency (-27)\n        /// </summary>\n        ConversionRateZero = -27,\n\n        /// <summary>\n        /// The order's symbol references a non-tradable security (-28)\n        /// </summary>\n        NonTradableSecurity = -28,\n\n        /// <summary>\n        /// The order's symbol references a non-exercisable security (-29)\n        /// </summary>\n        NonExercisableSecurity = -29,\n\n        /// <summary>\n        /// Cannot submit or update orders with quantity that is less than lot size (-30)\n        /// </summary>\n        OrderQuantityLessThanLotSize = -30,\n\n        /// <summary>\n        /// The order's quantity exceeds the max shortable quantity set by the brokerage (-31)\n        /// </summary>\n        ExceedsShortableQuantity = -31,\n\n        /// <summary>\n        /// Cannot update/cancel orders with OrderStatus.New (-32)\n        /// </summary>\n        InvalidNewOrderStatus = -32,\n\n        /// <summary>\n        /// Exercise time before expiry for European options (-33)\n        /// </summary>\n        EuropeanOptionNotExpiredOnExercise = -33,\n\n        /// <summary>\n        /// Option order is invalid due to underlying stock split (-34)\n        /// </summary>\n        OptionOrderOnStockSplit = -34,\n\n        /// <summary>\n        /// The Market On Open order was submitted during regular market hours, \n        /// which is not allowed. This order type must be submitted before the market opens.\n        /// </summary>\n        MarketOnOpenNotAllowedDuringRegularHours = -35\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderSizing.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides methods for computing a maximum order size.\n    /// </summary>\n    public static class OrderSizing\n    {\n        /// <summary>\n        /// Adjust the provided order size to respect maximum order size based on a percentage of current volume.\n        /// </summary>\n        /// <param name=\"security\">The security object</param>\n        /// <param name=\"maximumPercentCurrentVolume\">The maximum percentage of the current bar's volume</param>\n        /// <param name=\"desiredOrderSize\">The desired order size to adjust</param>\n        /// <returns>The signed adjusted order size</returns>\n        public static decimal GetOrderSizeForPercentVolume(Security security, decimal maximumPercentCurrentVolume, decimal desiredOrderSize)\n        {\n            var maxOrderSize = maximumPercentCurrentVolume * security.Volume;\n            var orderSize = Math.Min(maxOrderSize, Math.Abs(desiredOrderSize));\n\n            return Math.Sign(desiredOrderSize) * AdjustByLotSize(security, orderSize);\n        }\n\n        /// <summary>\n        /// Adjust the provided order size to respect the maximum total order value\n        /// </summary>\n        /// <param name=\"security\">The security object</param>\n        /// <param name=\"maximumOrderValueInAccountCurrency\">The maximum order value in units of the account currency</param>\n        /// <param name=\"desiredOrderSize\">The desired order size to adjust</param>\n        /// <returns>The signed adjusted order size</returns>\n        public static decimal GetOrderSizeForMaximumValue(Security security, decimal maximumOrderValueInAccountCurrency, decimal desiredOrderSize)\n        {\n            var priceInAccountCurrency = security.Price\n                                         * security.QuoteCurrency.ConversionRate\n                                         * security.SymbolProperties.ContractMultiplier;\n\n            if (priceInAccountCurrency == 0m)\n            {\n                return 0m;\n            }\n\n            var maxOrderSize =  maximumOrderValueInAccountCurrency / priceInAccountCurrency;\n            var orderSize = Math.Min(maxOrderSize, Math.Abs(desiredOrderSize));\n\n            return Math.Sign(desiredOrderSize) * AdjustByLotSize(security, orderSize);\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity to be ordered to reach the specified target quantity.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"target\">The portfolio target</param>\n        /// <returns>The signed remaining quantity to be ordered</returns>\n        public static decimal GetUnorderedQuantity(IAlgorithm algorithm, IPortfolioTarget target)\n        {\n            var security = algorithm.Securities[target.Symbol];\n\n            return GetUnorderedQuantity(algorithm, target, security);\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity to be ordered to reach the specified target quantity.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"target\">The portfolio target</param>\n        /// <param name=\"security\">The target security</param>\n        /// <param name=\"accountForFees\">True for taking into account the fee's in the order quantity.\n        /// False, otherwise.</param>\n        /// <returns>The signed remaining quantity to be ordered</returns>\n        public static decimal GetUnorderedQuantity(IAlgorithm algorithm, IPortfolioTarget target, Security security, bool accountForFees = false)\n        {\n            var quantity = target.Quantity - algorithm.Transactions.GetProjectedHoldings(security).ProjectedQuantity;\n\n            // Adjust the order quantity taking into account the fee's\n            if (accountForFees && security.Symbol.SecurityType == SecurityType.Crypto && quantity > 0)\n            {\n                var orderFee = Extensions.GetMarketOrderFees(security, quantity, algorithm.UtcTime);\n                var baseCurrency = ((Crypto)security).BaseCurrency.Symbol;\n                if (baseCurrency == orderFee.Currency)\n                {\n                    quantity += orderFee.Amount;\n                }\n            }\n\n            return AdjustByLotSize(security, quantity);\n        }\n\n        /// <summary>\n        /// Adjusts the provided order quantity to respect the securities lot size.\n        /// If the quantity is missing 1M part of the lot size it will be rounded up\n        /// since we suppose it's due to floating point error, this is required to avoid diff\n        /// between Py and C#\n        /// </summary>\n        /// <param name=\"security\">The security instance</param>\n        /// <param name=\"quantity\">The desired quantity to adjust, can be signed</param>\n        /// <returns>The signed adjusted quantity</returns>\n        public static decimal AdjustByLotSize(Security security, decimal quantity)\n        {\n            var absQuantity = Math.Abs(quantity);\n            // if the amount we are missing for +1 lot size is 1M part of a lot size\n            // we suppose its due to floating point error and round up\n            // Note: this is required to avoid a diff between Py and C# equivalent\n            var remainder = absQuantity % security.SymbolProperties.LotSize;\n            var missingForLotSize = security.SymbolProperties.LotSize - remainder;\n            if (missingForLotSize < (security.SymbolProperties.LotSize / 1000000))\n            {\n                remainder -= security.SymbolProperties.LotSize;\n            }\n            absQuantity -= remainder;\n\n            return absQuantity * Math.Sign(quantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderSubmissionData.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// The purpose of this class is to store time and price information\n    /// available at the time an order was submitted.\n    /// </summary>\n    public class OrderSubmissionData\n    {\n        /// <summary>\n        /// The bid price at order submission time\n        /// </summary>\n        [JsonProperty(PropertyName = \"bidPrice\")]\n        public decimal BidPrice { get; }\n\n        /// <summary>\n        /// The ask price at order submission time\n        /// </summary>\n        [JsonProperty(PropertyName = \"askPrice\")]\n        public decimal AskPrice { get; }\n\n        /// <summary>\n        /// The current price at order submission time\n        /// </summary>\n        [JsonProperty(PropertyName = \"lastPrice\")]\n        public decimal LastPrice { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderSubmissionData\"/> class\n        /// </summary>\n        /// <remarks>This method is currently only used for testing.</remarks>\n        public OrderSubmissionData(decimal bidPrice, decimal askPrice, decimal lastPrice)\n        {\n            BidPrice = bidPrice;\n            AskPrice = askPrice;\n            LastPrice = lastPrice;\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        public OrderSubmissionData Clone()\n        {\n            return (OrderSubmissionData)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderTicket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Securities;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides a single reference to an order for the algorithm to maintain. As the order gets\n    /// updated this ticket will also get updated\n    /// </summary>\n    public sealed class OrderTicket\n    {\n        private readonly object _lock = new object();\n\n        private Order _order;\n        private OrderStatus? _orderStatusOverride;\n        private CancelOrderRequest _cancelRequest;\n\n        private FillState _fillState;\n        private List<OrderEvent> _orderEventsImpl;\n        private List<UpdateOrderRequest> _updateRequestsImpl;\n        private readonly SubmitOrderRequest _submitRequest;\n        private readonly ManualResetEvent _orderStatusClosedEvent;\n        private readonly ManualResetEvent _orderSetEvent;\n\n        // we pull this in to provide some behavior/simplicity to the ticket API\n        private readonly SecurityTransactionManager _transactionManager;\n\n        private List<OrderEvent> _orderEvents { get => _orderEventsImpl ??= new List<OrderEvent>(); }\n        private List<UpdateOrderRequest> _updateRequests { get => _updateRequestsImpl ??= new List<UpdateOrderRequest>(); }\n\n        /// <summary>\n        /// Gets the order id of this ticket\n        /// </summary>\n        public int OrderId\n        {\n            get { return _submitRequest.OrderId; }\n        }\n\n        /// <summary>\n        /// Gets the current status of this order ticket\n        /// </summary>\n        public OrderStatus Status\n        {\n            get\n            {\n                if (_orderStatusOverride.HasValue) return _orderStatusOverride.Value;\n                return _order == null ? OrderStatus.New : _order.Status;\n            }\n        }\n\n        /// <summary>\n        /// Gets the symbol being ordered\n        /// </summary>\n        public Symbol Symbol\n        {\n            get { return _submitRequest.Symbol; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Symbol\"/>'s <see cref=\"SecurityType\"/>\n        /// </summary>\n        public SecurityType SecurityType\n        {\n            get { return _submitRequest.SecurityType; }\n        }\n\n        /// <summary>\n        /// Gets the number of units ordered\n        /// </summary>\n        public decimal Quantity\n        {\n            get { return _order == null ? _submitRequest.Quantity : _order.Quantity; }\n        }\n\n        /// <summary>\n        /// Gets the average fill price for this ticket. If no fills have been processed\n        /// then this will return a value of zero.\n        /// </summary>\n        public decimal AverageFillPrice\n        {\n            get\n            {\n                return _fillState.AverageFillPrice;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total qantity filled for this ticket. If no fills have been processed\n        /// then this will return a value of zero.\n        /// </summary>\n        public decimal QuantityFilled\n        {\n            get\n            {\n                return _fillState.QuantityFilled;\n            }\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity for this order ticket.\n        /// This is the difference between the total quantity ordered and the total quantity filled.\n        /// </summary>\n        public decimal QuantityRemaining\n        {\n            get\n            {\n                var currentState = _fillState;\n                return Quantity - currentState.QuantityFilled;\n            }\n        }\n\n        /// <summary>\n        /// Gets the time this order was last updated\n        /// </summary>\n        public DateTime Time\n        {\n            get { return GetMostRecentOrderRequest().Time; }\n        }\n\n        /// <summary>\n        /// Gets the type of order\n        /// </summary>\n        public OrderType OrderType\n        {\n            get { return _submitRequest.OrderType; }\n        }\n\n        /// <summary>\n        /// Gets the order's current tag\n        /// </summary>\n        public string Tag\n        {\n            get { return _order == null ? _submitRequest.Tag : _order.Tag; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"SubmitOrderRequest\"/> that initiated this order\n        /// </summary>\n        public SubmitOrderRequest SubmitRequest\n        {\n            get { return _submitRequest; }\n        }\n\n        /// <summary>\n        /// Gets a list of <see cref=\"UpdateOrderRequest\"/> containing an item for each\n        /// <see cref=\"UpdateOrderRequest\"/> that was sent for this order id\n        /// </summary>\n        public IReadOnlyList<UpdateOrderRequest> UpdateRequests\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    // Avoid creating the update requests list if not necessary\n                    if (_updateRequestsImpl == null)\n                    {\n                        return Array.Empty<UpdateOrderRequest>();\n                    }\n                    return _updateRequestsImpl.ToList();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"CancelOrderRequest\"/> if this order was canceled. If this order\n        /// was not canceled, this will return null\n        /// </summary>\n        public CancelOrderRequest CancelRequest\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    return _cancelRequest;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets a list of all order events for this ticket\n        /// </summary>\n        public IReadOnlyList<OrderEvent> OrderEvents\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    return _orderEvents.ToList();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets a wait handle that can be used to wait until this order has filled\n        /// </summary>\n        public WaitHandle OrderClosed\n        {\n            get { return _orderStatusClosedEvent; }\n        }\n\n        /// <summary>\n        /// Returns true if the order has been set for this ticket\n        /// </summary>\n        public bool HasOrder => _order != null;\n\n        /// <summary>\n        /// Gets a wait handle that can be used to wait until the order has been set\n        /// </summary>\n        public WaitHandle OrderSet => _orderSetEvent;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OrderTicket\"/> class\n        /// </summary>\n        /// <param name=\"transactionManager\">The transaction manager used for submitting updates and cancels for this ticket</param>\n        /// <param name=\"submitRequest\">The order request that initiated this order ticket</param>\n        public OrderTicket(SecurityTransactionManager transactionManager, SubmitOrderRequest submitRequest)\n        {\n            _submitRequest = submitRequest;\n            _transactionManager = transactionManager;\n\n            _orderStatusClosedEvent = new ManualResetEvent(false);\n            _orderSetEvent = new ManualResetEvent(false);\n            _fillState = new FillState(0m, 0m);\n        }\n\n        /// <summary>\n        /// Gets the specified field from the ticket\n        /// </summary>\n        /// <param name=\"field\">The order field to get</param>\n        /// <returns>The value of the field</returns>\n        /// <exception cref=\"ArgumentException\">Field out of range</exception>\n        /// <exception cref=\"ArgumentOutOfRangeException\">Field out of range for order type</exception>\n        public decimal Get(OrderField field)\n        {\n            return Get<decimal>(field);\n        }\n\n        /// <summary>\n        /// Gets the specified field from the ticket and tries to convert it to the specified type\n        /// </summary>\n        /// <param name=\"field\">The order field to get</param>\n        /// <returns>The value of the field</returns>\n        /// <exception cref=\"ArgumentException\">Field out of range</exception>\n        /// <exception cref=\"ArgumentOutOfRangeException\">Field out of range for order type</exception>\n        public T Get<T>(OrderField field)\n        {\n            object fieldValue = null;\n\n            switch (field)\n            {\n                case OrderField.LimitPrice:\n                    if (_submitRequest.OrderType == OrderType.ComboLimit)\n                    {\n                        fieldValue = AccessOrder<ComboLimitOrder, decimal>(this, field, o => o.GroupOrderManager.LimitPrice, r => r.LimitPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.ComboLegLimit)\n                    {\n                        fieldValue = AccessOrder<ComboLegLimitOrder, decimal>(this, field, o => o.LimitPrice, r => r.LimitPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.Limit)\n                    {\n                        fieldValue = AccessOrder<LimitOrder, decimal>(this, field, o => o.LimitPrice, r => r.LimitPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.StopLimit)\n                    {\n                        fieldValue = AccessOrder<StopLimitOrder, decimal>(this, field, o => o.LimitPrice, r => r.LimitPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.LimitIfTouched)\n                    {\n                        fieldValue = AccessOrder<LimitIfTouchedOrder, decimal>(this, field, o => o.LimitPrice, r => r.LimitPrice);\n                    }\n                    break;\n\n                case OrderField.StopPrice:\n                    if (_submitRequest.OrderType == OrderType.StopLimit)\n                    {\n                        fieldValue = AccessOrder<StopLimitOrder, decimal>(this, field, o => o.StopPrice, r => r.StopPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.StopMarket)\n                    {\n                        fieldValue = AccessOrder<StopMarketOrder, decimal>(this, field, o => o.StopPrice, r => r.StopPrice);\n                    }\n                    else if (_submitRequest.OrderType == OrderType.TrailingStop)\n                    {\n                        fieldValue = AccessOrder<TrailingStopOrder, decimal>(this, field, o => o.StopPrice, r => r.StopPrice);\n                    }\n                    break;\n\n                case OrderField.TriggerPrice:\n                    fieldValue = AccessOrder<LimitIfTouchedOrder, decimal>(this, field, o => o.TriggerPrice, r => r.TriggerPrice);\n                    break;\n\n                case OrderField.TrailingAmount:\n                    fieldValue = AccessOrder<TrailingStopOrder, decimal>(this, field, o => o.TrailingAmount, r => r.TrailingAmount);\n                    break;\n\n                case OrderField.TrailingAsPercentage:\n                    fieldValue = AccessOrder<TrailingStopOrder, bool>(this, field, o => o.TrailingAsPercentage, r => r.TrailingAsPercentage);\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(field), field, null);\n            }\n\n            if (fieldValue == null)\n            {\n                throw new ArgumentException(Messages.OrderTicket.GetFieldError(this, field));\n            }\n\n            return (T)fieldValue;\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticket with data specified in <paramref name=\"fields\"/>\n        /// </summary>\n        /// <param name=\"fields\">Defines what properties of the order should be updated</param>\n        /// <returns>The <see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse Update(UpdateOrderFields fields)\n        {\n            var ticket = _transactionManager.UpdateOrder(new UpdateOrderRequest(_transactionManager.UtcTime, SubmitRequest.OrderId, fields));\n            return ticket.UpdateRequests.Last().Response;\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticket with tag specified in <paramref name=\"tag\"/>\n        /// </summary>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateTag(string tag)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticket with quantity specified in <paramref name=\"quantity\"/> and with tag specified in <paramref name=\"quantity\"/>\n        /// </summary>\n        /// <param name=\"quantity\">The new quantity for this order ticket</param>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateQuantity(decimal quantity, string tag = null)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                Quantity = quantity,\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticker with limit price specified in <paramref name=\"limitPrice\"/> and with tag specified in <paramref name=\"tag\"/>\n        /// </summary>\n        /// <param name=\"limitPrice\">The new limit price for this order ticket</param>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateLimitPrice(decimal limitPrice, string tag = null)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                LimitPrice = limitPrice,\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticker with stop price specified in <paramref name=\"stopPrice\"/> and with tag specified in <paramref name=\"tag\"/>\n        /// </summary>\n        /// <param name=\"stopPrice\">The new stop price  for this order ticket</param>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateStopPrice(decimal stopPrice, string tag = null)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                StopPrice = stopPrice,\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticker with trigger price specified in <paramref name=\"triggerPrice\"/> and with tag specified in <paramref name=\"tag\"/>\n        /// </summary>\n        /// <param name=\"triggerPrice\">The new price which, when touched, will trigger the setting of a limit order.</param>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateTriggerPrice(decimal triggerPrice, string tag = null)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                TriggerPrice = triggerPrice,\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits an <see cref=\"UpdateOrderRequest\"/> with the <see cref=\"SecurityTransactionManager\"/> to update\n        /// the ticker with stop trailing amount specified in <paramref name=\"trailingAmount\"/> and with tag specified in <paramref name=\"tag\"/>\n        /// </summary>\n        /// <param name=\"trailingAmount\">The new trailing amount for this order ticket</param>\n        /// <param name=\"tag\">The new tag for this order ticket</param>\n        /// <returns><see cref=\"OrderResponse\"/> from updating the order</returns>\n        public OrderResponse UpdateStopTrailingAmount(decimal trailingAmount, string tag = null)\n        {\n            var fields = new UpdateOrderFields()\n            {\n                TrailingAmount = trailingAmount,\n                Tag = tag\n            };\n            return Update(fields);\n        }\n\n        /// <summary>\n        /// Submits a new request to cancel this order\n        /// </summary>\n        public OrderResponse Cancel(string tag = null)\n        {\n            var request = new CancelOrderRequest(_transactionManager.UtcTime, OrderId, tag);\n            lock (_lock)\n            {\n                // don't submit duplicate cancel requests, if the cancel request wasn't flagged as error\n                // this could happen when trying to cancel an order which status is still new and hasn't even been submitted to the brokerage\n                if (_cancelRequest != null && _cancelRequest.Status != OrderRequestStatus.Error)\n                {\n                    return OrderResponse.Error(request, OrderResponseErrorCode.RequestCanceled,\n                        Messages.OrderTicket.CancelRequestAlreadySubmitted(this));\n                }\n            }\n\n            var ticket = _transactionManager.ProcessRequest(request);\n            return ticket.CancelRequest.Response;\n        }\n\n        /// <summary>\n        /// Gets the most recent <see cref=\"OrderResponse\"/> for this ticket\n        /// </summary>\n        /// <returns>The most recent <see cref=\"OrderResponse\"/> for this ticket</returns>\n        public OrderResponse GetMostRecentOrderResponse()\n        {\n            return GetMostRecentOrderRequest().Response;\n        }\n\n        /// <summary>\n        /// Gets the most recent <see cref=\"OrderRequest\"/> for this ticket\n        /// </summary>\n        /// <returns>The most recent <see cref=\"OrderRequest\"/> for this ticket</returns>\n        public OrderRequest GetMostRecentOrderRequest()\n        {\n            lock (_lock)\n            {\n                if (_cancelRequest != null)\n                {\n                    return _cancelRequest;\n                }\n\n                // Avoid creating the update requests list if not necessary\n                if (_updateRequestsImpl != null)\n                {\n                    var lastUpdate = _updateRequestsImpl.LastOrDefault();\n                    if (lastUpdate != null)\n                    {\n                        return lastUpdate;\n                    }\n                }\n            }\n            return SubmitRequest;\n        }\n\n        /// <summary>\n        /// Adds an order event to this ticket\n        /// </summary>\n        /// <param name=\"orderEvent\">The order event to be added</param>\n        internal void AddOrderEvent(OrderEvent orderEvent)\n        {\n            lock (_lock)\n            {\n                _orderEvents.Add(orderEvent);\n\n                // Update the ticket and order\n                if (orderEvent.FillQuantity != 0)\n                {\n                    var filledQuantity = _fillState.QuantityFilled;\n                    var averageFillPrice = _fillState.AverageFillPrice;\n\n                    if (_order.Type != OrderType.OptionExercise)\n                    {\n                        // keep running totals of quantity filled and the average fill price so we\n                        // don't need to compute these on demand\n                        filledQuantity += orderEvent.FillQuantity;\n                        var quantityWeightedFillPrice = _orderEvents.Where(x => x.Status.IsFill())\n                            .Aggregate(0m, (d, x) => d + x.AbsoluteFillQuantity * x.FillPrice);\n                        averageFillPrice = quantityWeightedFillPrice / Math.Abs(filledQuantity);\n\n                        _order.Price = averageFillPrice;\n                    }\n                    // For ITM option exercise orders we set the order price to the strike price.\n                    // For OTM the fill price should be zero, which is the default for OptionExerciseOrders\n                    else if (orderEvent.IsInTheMoney)\n                    {\n                        _order.Price = Symbol.ID.StrikePrice;\n\n                        // We update the ticket only if the fill price is not zero (this fixes issue #2846 where average price\n                        // is skewed by the removal of the option).\n                        if (orderEvent.FillPrice != 0)\n                        {\n                            filledQuantity += orderEvent.FillQuantity;\n                            averageFillPrice = _order.Price;\n                        }\n                    }\n\n                    _fillState = new FillState(averageFillPrice, filledQuantity);\n                }\n            }\n\n            // fire the wait handle indicating this order is closed\n            if (orderEvent.Status.IsClosed())\n            {\n                _orderStatusClosedEvent.Set();\n            }\n        }\n\n        /// <summary>\n        /// Updates the internal order object with the current state\n        /// </summary>\n        /// <param name=\"order\">The order</param>\n        internal void SetOrder(Order order)\n        {\n            if (_order != null && _order.Id != order.Id)\n            {\n                throw new ArgumentException(\"Order id mismatch\");\n            }\n\n            _order = order;\n\n            _orderSetEvent.Set();\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"UpdateOrderRequest\"/> to this ticket.\n        /// </summary>\n        /// <param name=\"request\">The recently processed <see cref=\"UpdateOrderRequest\"/></param>\n        internal void AddUpdateRequest(UpdateOrderRequest request)\n        {\n            if (request.OrderId != OrderId)\n            {\n                throw new ArgumentException(\"Received UpdateOrderRequest for incorrect order id.\");\n            }\n\n            lock (_lock)\n            {\n                _updateRequests.Add(request);\n            }\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"CancelOrderRequest\"/> for this ticket. This can only be performed once.\n        /// </summary>\n        /// <remarks>\n        /// This method is thread safe.\n        /// </remarks>\n        /// <param name=\"request\">The <see cref=\"CancelOrderRequest\"/> that canceled this ticket.</param>\n        /// <returns>False if the the CancelRequest has already been set, true if this call set it</returns>\n        internal bool TrySetCancelRequest(CancelOrderRequest request)\n        {\n            if (request.OrderId != OrderId)\n            {\n                throw new ArgumentException(\"Received CancelOrderRequest for incorrect order id.\");\n            }\n\n            lock (_lock)\n            {\n                // don't submit duplicate cancel requests, if the cancel request wasn't flagged as error\n                // this could happen when trying to cancel an order which status is still new and hasn't even been submitted to the brokerage\n                if (_cancelRequest != null && _cancelRequest.Status != OrderRequestStatus.Error)\n                {\n                    return false;\n                }\n                _cancelRequest = request;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OrderTicket\"/> that represents trying to cancel an order for which no ticket exists\n        /// </summary>\n        public static OrderTicket InvalidCancelOrderId(SecurityTransactionManager transactionManager, CancelOrderRequest request)\n        {\n            var submit = new SubmitOrderRequest(OrderType.Market, SecurityType.Base, Symbol.Empty, 0, 0, 0, DateTime.MaxValue, request.Tag);\n            submit.SetResponse(OrderResponse.UnableToFindOrder(request));\n            submit.SetOrderId(request.OrderId);\n            var ticket = new OrderTicket(transactionManager, submit);\n            request.SetResponse(OrderResponse.UnableToFindOrder(request));\n            ticket.TrySetCancelRequest(request);\n            ticket._orderStatusOverride = OrderStatus.Invalid;\n            return ticket;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OrderTicket\"/> that represents trying to update an order for which no ticket exists\n        /// </summary>\n        public static OrderTicket InvalidUpdateOrderId(SecurityTransactionManager transactionManager, UpdateOrderRequest request)\n        {\n            var submit = new SubmitOrderRequest(OrderType.Market, SecurityType.Base, Symbol.Empty, 0, 0, 0, DateTime.MaxValue, request.Tag);\n            submit.SetResponse(OrderResponse.UnableToFindOrder(request));\n            submit.SetOrderId(request.OrderId);\n            var ticket = new OrderTicket(transactionManager, submit);\n            request.SetResponse(OrderResponse.UnableToFindOrder(request));\n            ticket.AddUpdateRequest(request);\n            ticket._orderStatusOverride = OrderStatus.Invalid;\n            return ticket;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OrderTicket\"/> that represents trying to submit a new order that had errors embodied in the <paramref name=\"response\"/>\n        /// </summary>\n        public static OrderTicket InvalidSubmitRequest(SecurityTransactionManager transactionManager, SubmitOrderRequest request, OrderResponse response)\n        {\n            request.SetResponse(response);\n            return new OrderTicket(transactionManager, request) { _orderStatusOverride = OrderStatus.Invalid };\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            var requestCount = 1;\n            var responseCount = _submitRequest.Response == OrderResponse.Unprocessed ? 0 : 1;\n            lock (_lock)\n            {\n                // Avoid creating the update requests list if not necessary\n                if (_updateRequestsImpl != null)\n                {\n                    requestCount += _updateRequestsImpl.Count;\n                    responseCount += _updateRequestsImpl.Count(x => x.Response != OrderResponse.Unprocessed);\n                }\n\n                requestCount += _cancelRequest == null ? 0 : 1;\n                responseCount += _cancelRequest == null || _cancelRequest.Response == OrderResponse.Unprocessed ? 0 : 1;\n            }\n\n            return Messages.OrderTicket.ToString(this, _order, requestCount, responseCount);\n        }\n\n        /// <summary>\n        /// This is provided for API backward compatibility and will resolve to the order ID, except during\n        /// an error, where it will return the integer value of the <see cref=\"OrderResponseErrorCode\"/> from\n        /// the most recent response\n        /// </summary>\n        public static implicit operator int(OrderTicket ticket)\n        {\n            var response = ticket.GetMostRecentOrderResponse();\n            if (response != null && response.IsError)\n            {\n                return (int) response.ErrorCode;\n            }\n            return ticket.OrderId;\n        }\n\n        private static P AccessOrder<T, P>(OrderTicket ticket, OrderField field, Func<T, P> orderSelector, Func<SubmitOrderRequest, P> requestSelector)\n            where T : Order\n        {\n            var order = ticket._order;\n            if (order == null)\n            {\n                return requestSelector(ticket._submitRequest);\n            }\n            var typedOrder = order as T;\n            if (typedOrder != null)\n            {\n                return orderSelector(typedOrder);\n            }\n            throw new ArgumentException(Invariant($\"Unable to access property {field} on order of type {order.Type}\"));\n        }\n\n        /// <summary>\n        /// Reference wrapper for decimal average fill price and quantity filled.\n        /// In order to update the average fill price and quantity filled, we create a new instance of this class\n        /// so we avoid potential race conditions when accessing these properties\n        /// (e.g. the decimals might be being updated and in a invalid state when being read)\n        /// </summary>\n        private class FillState\n        {\n            public decimal AverageFillPrice { get; }\n            public decimal QuantityFilled { get; }\n\n            public FillState(decimal averageFillPrice, decimal quantityFilled)\n            {\n                AverageFillPrice = averageFillPrice;\n                QuantityFilled = quantityFilled;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderTypes.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Type of the order: market, limit or stop\n    /// </summary>\n    public enum OrderType\n    {\n        /// <summary>\n        /// Market Order Type (0)\n        /// </summary>\n        Market,\n\n        /// <summary>\n        /// Limit Order Type (1)\n        /// </summary>\n        Limit,\n\n        /// <summary>\n        /// Stop Market Order Type - Fill at market price when break target price (2)\n        /// </summary>\n        StopMarket,\n\n        /// <summary>\n        /// Stop limit order type - trigger fill once pass the stop price; but limit fill to limit price (3)\n        /// </summary>\n        StopLimit,\n\n        /// <summary>\n        /// Market on open type - executed on exchange open (4)\n        /// </summary>\n        MarketOnOpen,\n\n        /// <summary>\n        /// Market on close type - executed on exchange close (5)\n        /// </summary>\n        MarketOnClose,\n\n        /// <summary>\n        /// Option Exercise Order Type (6)\n        /// </summary>\n        OptionExercise,\n\n        /// <summary>\n        ///  Limit if Touched Order Type - a limit order to be placed after first reaching a trigger value (7)\n        /// </summary>\n        LimitIfTouched,\n\n        /// <summary>\n        ///  Combo Market Order Type - (8)\n        /// </summary>\n        ComboMarket,\n\n        /// <summary>\n        ///  Combo Limit Order Type - (9)\n        /// </summary>\n        ComboLimit,\n\n        /// <summary>\n        ///  Combo Leg Limit Order Type - (10)\n        /// </summary>\n        ComboLegLimit,\n\n        /// <summary>\n        /// Trailing Stop Order Type - (11)\n        /// </summary>\n        TrailingStop\n    }\n\n    /// <summary>\n    /// Direction of the order\n    /// </summary>\n    public enum OrderDirection\n    {\n        /// <summary>\n        /// Buy Order (0)\n        /// </summary>\n        Buy,\n\n        /// <summary>\n        /// Sell Order (1)\n        /// </summary>\n        Sell,\n\n        /// <summary>\n        /// Default Value - No Order Direction (2)\n        /// </summary>\n        /// <remarks>\n        /// Unfortunately this does not have a value of zero because\n        /// there are backtests saved that reference the values in this order\n        /// </remarks>\n        Hold\n    }\n\n    /// <summary>\n    /// Position of the order\n    /// </summary>\n    public enum OrderPosition\n    {\n        /// <summary>\n        /// Indicates the buy order will result in a long position, starting either from zero or an existing long position (0)\n        /// </summary>\n        BuyToOpen,\n\n        /// <summary>\n        /// Indicates the buy order is starting from an existing short position, resulting in a closed or long position (1)\n        /// </summary>\n        BuyToClose,\n\n        /// <summary>\n        /// Indicates the sell order will result in a short position, starting either from zero or an existing short position (2)\n        /// </summary>\n        SellToOpen,\n\n        /// <summary>\n        /// Indicates the sell order is starting from an existing long position, resulting in a closed or short position (3)\n        /// </summary>\n        SellToClose,\n    }\n\n    /// <summary>\n    /// Fill status of the order class.\n    /// </summary>\n    public enum OrderStatus\n    {\n        /// <summary>\n        /// New order pre-submission to the order processor (0)\n        /// </summary>\n        New = 0,\n\n        /// <summary>\n        /// Order submitted to the market (1)\n        /// </summary>\n        Submitted = 1,\n\n        /// <summary>\n        /// Partially filled, In Market Order (2)\n        /// </summary>\n        PartiallyFilled = 2,\n\n        /// <summary>\n        /// Completed, Filled, In Market Order (3)\n        /// </summary>\n        Filled = 3,\n\n        /// <summary>\n        /// Order cancelled before it was filled (5)\n        /// </summary>\n        Canceled = 5,\n\n        /// <summary>\n        /// No Order State Yet (6)\n        /// </summary>\n        None = 6,\n\n        /// <summary>\n        /// Order invalidated before it hit the market (e.g. insufficient capital) (7)\n        /// </summary>\n        Invalid = 7,\n\n        /// <summary>\n        /// Order waiting for confirmation of cancellation (8)\n        /// </summary>\n        CancelPending = 8,\n\n        /// <summary>\n        /// Order update submitted to the market (9)\n        /// </summary>\n        UpdateSubmitted = 9\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrderUpdateEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Event that fires each time an order is updated in the brokerage side.\n    /// These are not status changes but mainly price changes, like the stop price of a trailing stop order.\n    /// </summary>\n    public class OrderUpdateEvent\n    {\n        /// <summary>\n        /// The order ID.\n        /// </summary>\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// The updated stop price for a <see cref=\"TrailingStopOrder\"/>\n        /// </summary>\n        public decimal TrailingStopPrice { get; set; }\n\n        /// <summary>\n        /// Flag indicating whether stop has been triggered for a <see cref=\"StopLimitOrder\"/>\n        /// </summary>\n        public bool StopTriggered { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/OrdersResponseWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Api;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Serialization;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Collection container for a list of orders for a project\n    /// </summary>\n    public class OrdersResponseWrapper : RestResponse\n    {\n        /// <summary>\n        /// Returns the total order collection length, not only the amount we are sending here\n        /// </summary>\n        [JsonProperty(PropertyName = \"length\")]\n        public int Length { get; set; }\n\n        /// <summary>\n        /// Collection of summarized Orders objects\n        /// </summary>\n        [JsonProperty(PropertyName = \"orders\")]\n        public List<ApiOrderResponse> Orders { get; set; } = new();\n    }\n\n    /// <summary>\n    /// Api order and order events reponse\n    /// </summary>\n    [JsonConverter(typeof(ReadOrdersResponseJsonConverter))]\n    public class ApiOrderResponse: StringRepresentation\n    {\n        /// <summary>\n        /// The symbol associated with this order\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// The order\n        /// </summary>\n        public Order Order { get; set; }\n\n        /// <summary>\n        /// The order events\n        /// </summary>\n        public List<SerializedOrderEvent> Events { get; set; }\n\n        /// <summary>\n        /// ApiOrderResponse empty constructor\n        /// </summary>\n        public ApiOrderResponse()\n        {\n        }\n\n        /// <summary>\n        /// Creates an instance of an ApiOrderResponse class using the given arguments\n        /// </summary>\n        public ApiOrderResponse(Order order, List<SerializedOrderEvent> events, Symbol symbol)\n        {\n            Order = order;\n            Events = events;\n            Symbol = symbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/RBIOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// RBI order properties\n    /// </summary>\n    public class RBIOrderProperties : OrderProperties\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/ReadOrdersResponseJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2024 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Serialization;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Api orders read response json converter\n    /// </summary>\n    public class ReadOrdersResponseJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Determines if can convert the given open type\n        /// </summary>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(ApiOrderResponse);\n        }\n\n        /// <summary>\n        /// Serialize the given api order response\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var orderResponse = (ApiOrderResponse)value;\n            var jObject = JObject.FromObject(orderResponse.Order);\n            jObject[\"symbol\"] = JToken.FromObject(orderResponse.Symbol);\n            jObject[\"events\"] = JToken.FromObject(orderResponse.Events);\n            jObject.WriteTo(writer);\n        }\n\n        /// <summary>\n        /// Deserialize the given api order response\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            serializer.Converters.Add(new OrderJsonConverter());\n            var order = jObject.ToObject<Order>(serializer);\n\n            var events = jObject[\"Events\"] ?? jObject[\"events\"];\n            List<SerializedOrderEvent> deserializedEvents = null;\n            if (events != null)\n            {\n                deserializedEvents = events.ToObject<List<SerializedOrderEvent>>();\n            }\n\n            var symbol = jObject[\"Symbol\"] ?? jObject[\"symbol\"];\n            Symbol deserializedSymbol = null;\n            if (symbol != null)\n            {\n                deserializedSymbol = symbol.ToObject<Symbol>();\n            }\n\n            return new ApiOrderResponse(order, deserializedEvents ?? new(), deserializedSymbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Serialization/OrderEventJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Orders.Serialization\n{\n    /// <summary>\n    /// Defines how OrderEvents should be serialized to json\n    /// </summary>\n    public class OrderEventJsonConverter : TypeChangeJsonConverter<OrderEvent, SerializedOrderEvent>\n    {\n        private readonly string _algorithmId;\n\n        /// <summary>\n        /// True will populate TResult object returned by <see cref=\"Convert(SerializedOrderEvent)\"/> with json properties\n        /// </summary>\n        protected override bool PopulateProperties => false;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"algorithmId\">The associated algorithm id, required when serializing</param>\n        public OrderEventJsonConverter(string algorithmId = null)\n        {\n            _algorithmId = algorithmId;\n        }\n\n        /// <summary>\n        /// Convert the input value to a value to be serialzied\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialziation</param>\n        /// <returns>A new instance of TResult that is to be serialzied</returns>\n        protected override SerializedOrderEvent Convert(OrderEvent value)\n        {\n            return new SerializedOrderEvent(value, _algorithmId);\n        }\n\n        /// <summary>\n        /// Converts the input value to be deserialized\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to <see cref=\"OrderEvent\"/></param>\n        /// <returns>The converted value</returns>\n        protected override OrderEvent Convert(SerializedOrderEvent value)\n        {\n            return OrderEvent.FromSerialized(value);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Serialization/SerializedOrderEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.ComponentModel;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Orders.Serialization\n{\n    /// <summary>\n    /// Data transfer object used for serializing an <see cref=\"OrderEvent\"/> that was just generated by an algorithm\n    /// </summary>\n    public class SerializedOrderEvent\n    {\n        /// <summary>\n        /// The unique order event id\n        /// </summary>\n        [JsonProperty(\"id\")]\n        public virtual string Id => $\"{AlgorithmId}-{OrderId}-{OrderEventId}\";\n\n        /// <summary>\n        /// Algorithm Id, BacktestId or DeployId\n        /// </summary>\n        [JsonProperty(\"algorithmId\")]\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Id of the order this event comes from.\n        /// </summary>\n        [JsonProperty(\"orderId\")]\n        public int OrderId { get; set; }\n\n        /// <summary>\n        /// The unique order event id for each order\n        /// </summary>\n        [JsonProperty(\"orderEventId\")]\n        public int OrderEventId { get; set; }\n\n        /// <summary>\n        /// Easy access to the order symbol associated with this event.\n        /// </summary>\n        [JsonProperty(\"symbol\")]\n        public string Symbol { get; set; }\n\n        /// <summary>\n        /// The mapped symbol value\n        /// </summary>\n        [JsonProperty(PropertyName = \"symbolValue\")]\n        public string SymbolValue { get; set; }\n\n        /// <summary>\n        /// The symbols permanent ticker. For equities, by convention this is the first ticker symbol for which the security traded\n        /// </summary>\n        [JsonProperty(PropertyName = \"symbolPermtick\")]\n        public string SymbolPermtick { get; set; }\n\n        /// <summary>\n        /// The time of this event in unix timestamp\n        /// </summary>\n        [JsonProperty(\"time\")]\n        public double Time { get; set; }\n\n        /// <summary>\n        /// Status message of the order.\n        /// </summary>\n        [JsonProperty(\"status\"), JsonConverter(typeof(StringEnumConverter), true)]\n        public OrderStatus Status { get; set; }\n\n        /// <summary>\n        /// The fee amount associated with the order\n        /// </summary>\n        [JsonProperty(\"orderFeeAmount\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal? OrderFeeAmount { get; set; }\n\n        /// <summary>\n        /// The fee currency associated with the order\n        /// </summary>\n        [JsonProperty(\"orderFeeCurrency\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string OrderFeeCurrency { get; set; }\n\n        /// <summary>\n        /// Fill price information about the order\n        /// </summary>\n        [JsonProperty(\"fillPrice\")]\n        public decimal FillPrice { get; set; }\n\n        /// <summary>\n        /// Currency for the fill price\n        /// </summary>\n        [JsonProperty(\"fillPriceCurrency\")]\n        public string FillPriceCurrency { get; set; }\n\n        /// <summary>\n        /// Number of shares of the order that was filled in this event.\n        /// </summary>\n        [JsonProperty(\"fillQuantity\")]\n        public decimal FillQuantity { get; set; }\n\n        /// <summary>\n        /// Order direction.\n        /// </summary>\n        [JsonProperty(\"direction\"), JsonConverter(typeof(StringEnumConverter), true)]\n        public OrderDirection Direction { get; set; }\n\n        /// <summary>\n        /// Any message from the exchange.\n        /// </summary>\n        [DefaultValue(\"\"), JsonProperty(\"message\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Message { get; set; }\n\n        /// <summary>\n        /// True if the order event is an assignment\n        /// </summary>\n        [JsonProperty(\"isAssignment\")]\n        public bool IsAssignment { get; set; }\n\n        /// <summary>\n        /// The current order quantity\n        /// </summary>\n        [JsonProperty(\"quantity\")]\n        public decimal Quantity { get; set; }\n\n        /// <summary>\n        /// The current stop price\n        /// </summary>\n        [JsonProperty(\"stopPrice\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal? StopPrice { get; set; }\n\n        /// <summary>\n        /// The current limit price\n        /// </summary>\n        [JsonProperty(\"limitPrice\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public decimal? LimitPrice { get; set; }\n\n        /// <summary>\n        /// True if the order event's option is In-The-Money (ITM)\n        /// </summary>\n        [JsonProperty(\"isInTheMoney\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public bool IsInTheMoney { get; set; }\n\n        /// <summary>\n        /// Empty constructor required for JSON converter.\n        /// </summary>\n        public SerializedOrderEvent()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instances based on the provided order event and algorithm Id\n        /// </summary>\n        public SerializedOrderEvent(OrderEvent orderEvent, string algorithmId)\n        {\n            AlgorithmId = algorithmId;\n            OrderId = orderEvent.OrderId;\n            OrderEventId = orderEvent.Id;\n            Symbol = orderEvent.Symbol.ID.ToString();\n            SymbolValue = orderEvent.Symbol.Value;\n            SymbolPermtick = orderEvent.Symbol.ID.Symbol;\n            Time = QuantConnect.Time.DateTimeToUnixTimeStamp(orderEvent.UtcTime);\n            Status = orderEvent.Status;\n            if (orderEvent.OrderFee.Value.Currency != Currencies.NullCurrency)\n            {\n                OrderFeeAmount = orderEvent.OrderFee.Value.Amount;\n                OrderFeeCurrency = orderEvent.OrderFee.Value.Currency;\n            }\n            FillPrice = orderEvent.FillPrice;\n            FillPriceCurrency = orderEvent.FillPriceCurrency;\n            FillQuantity = orderEvent.FillQuantity;\n            Direction = orderEvent.Direction;\n            Message = orderEvent.Message;\n            IsAssignment = orderEvent.IsAssignment;\n            IsInTheMoney = orderEvent.IsInTheMoney;\n            Quantity = orderEvent.Quantity;\n            StopPrice = orderEvent.StopPrice;\n            LimitPrice = orderEvent.LimitPrice;\n        }\n\n        #region BackwardsCompatibility\n\n        [JsonProperty(\"algorithm-id\")]\n        string OldAlgorithmId\n        {\n            set\n            {\n                AlgorithmId = value;\n            }\n        }\n        [JsonProperty(\"order-id\")]\n        int OldOrderId\n        {\n            set\n            {\n                OrderId = value;\n            }\n        }\n        [JsonProperty(\"order-event-id\")]\n        int OldOrderEventId\n        {\n            set\n            {\n                OrderEventId = value;\n            }\n        }\n        [JsonProperty(PropertyName = \"symbol-value\")]\n        string OldSymbolValue\n        {\n            set\n            {\n                SymbolValue = value;\n            }\n        }\n        [JsonProperty(PropertyName = \"symbol-permtick\")]\n        string OldSymbolPermtick\n        {\n            set\n            {\n                SymbolPermtick = value;\n            }\n        }\n        [JsonProperty(\"order-fee-amount\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        decimal? OldOrderFeeAmount\n        {\n            set\n            {\n                OrderFeeAmount = value;\n            }\n        }\n        [JsonProperty(\"order-fee-currency\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        string OldOrderFeeCurrency\n        {\n            set\n            {\n                OrderFeeCurrency = value;\n            }\n        }\n        [JsonProperty(\"fill-price\")]\n        decimal OldFillPrice\n        {\n            set\n            {\n                FillPrice = value;\n            }\n        }\n        [JsonProperty(\"fill-price-currency\")]\n        string OldFillPriceCurrency\n        {\n            set\n            {\n                FillPriceCurrency = value;\n            }\n        }\n        [JsonProperty(\"fill-quantity\")]\n        decimal OldFillQuantity\n        {\n            set\n            {\n                FillQuantity = value;\n            }\n        }\n        [JsonProperty(\"is-assignment\")]\n        bool OldIsAssignment\n        {\n            set\n            {\n                IsAssignment = value;\n            }\n        }\n        [JsonProperty(\"stop-price\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        decimal? OldStopPrice\n        {\n            set\n            {\n                StopPrice = value;\n            }\n        }\n        [JsonProperty(\"limit-price\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        decimal? OldLimitPrice\n        {\n            set\n            {\n                LimitPrice = value;\n            }\n        }\n        [JsonProperty(\"is-in-the-money\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        bool OldIsInTheMoney\n        {\n            set\n            {\n                IsInTheMoney = value;\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Slippage/AlphaStreamsSlippageModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Represents a slippage model that uses a constant percentage of slip\n    /// </summary>\n    public class AlphaStreamsSlippageModel : ISlippageModel\n    {\n        private const decimal _slippagePercent = 0.0001m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlphaStreamsSlippageModel\"/> class\n        /// </summary>\n        public AlphaStreamsSlippageModel() { }\n\n        /// <summary>\n        /// Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            if (asset.Type != SecurityType.Equity)\n            {\n                return 0;\n            }\n\n            return _slippagePercent * asset.GetLastData()?.Value ?? 0;\n        }\n    }\n}"
  },
  {
    "path": "Common/Orders/Slippage/ConstantSlippageModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Represents a slippage model that uses a constant percentage of slip\n    /// </summary>\n    public class ConstantSlippageModel : ISlippageModel\n    {\n        private readonly decimal _slippagePercent;\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantSlippageModel\"/> class\n        /// </summary>\n        /// <param name=\"slippagePercent\">The slippage percent for each order. Percent is ranged 0 to 1.</param>\n        public ConstantSlippageModel(decimal slippagePercent)\n        {\n            _slippagePercent = slippagePercent;\n        }\n\n        /// <summary>\n        /// Slippage Model. Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            var lastData = asset.GetLastData();\n            if (lastData == null) return 0;\n\n            return lastData.Value*_slippagePercent;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Slippage/ISlippageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Represents a model that simulates market order slippage\n    /// </summary>\n    public interface ISlippageModel\n    {\n        /// <summary>\n        /// Slippage Model. Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        decimal GetSlippageApproximation(Security asset, Order order);\n    }\n}"
  },
  {
    "path": "Common/Orders/Slippage/MarketImpactSlippageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing MathNet.Numerics.Statistics;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Slippage model that mimic the effect brought by market impact,\n    /// i.e. consume the volume listed in the order book\n    /// </summary>\n    /// <remark>Almgren, R., Thum, C., Hauptmann, E., and Li, H. (2005). \n    /// Direct estimation of equity market impact. Risk, 18(7), 58-62.\n    /// Available from: https://www.ram-ai.com/sites/default/files/2022-06/costestim.pdf</remark>\n    /// <remark>The default parameters are calibrated around 2 decades ago,\n    /// the trading time effect is not accounted (volume near market open/close is larger),\n    /// the market regime is not taken into account,\n    /// and the market environment does not have many market makers at that time,\n    /// so it is recommend to recalibrate with reference to the original paper.</remark>\n    public class MarketImpactSlippageModel : ISlippageModel\n    {\n        private readonly IAlgorithm _algorithm;\n        private readonly bool _nonNegative;\n        private readonly double _latency;\n        private readonly double _impactTime;\n        private readonly double _alpha;\n        private readonly double _beta;\n        private readonly double _gamma;\n        private readonly double _eta;\n        private readonly double _delta;\n        private readonly Random _random;\n        private SymbolData _symbolData;\n\n        /// <summary>\n        /// Instantiate a new instance of MarketImpactSlippageModel\n        /// </summary>\n        /// <param name=\"algorithm\">IAlgorithm instance</param>\n        /// <param name=\"nonNegative\">Indicator whether only non-negative slippage allowed</param>\n        /// <param name=\"latency\">Time between order submitted and filled, in seconds(s)</param>\n        /// <param name=\"impactTime\">Time between order filled and new equilibrium established, in second(s)</param>\n        /// <param name=\"alpha\">Exponent of the permanent impact function</param>\n        /// <param name=\"beta\">Exponent of the temporary impact function</param>\n        /// <param name=\"gamma\">Coefficient of the permanent impact function</param>\n        /// <param name=\"eta\">Coefficient of the temporary impact function</param>\n        /// <param name=\"delta\">Liquidity scaling factor for permanent impact</param>\n        /// <param name=\"randomSeed\">Random seed for generating gaussian noise</param>\n        public MarketImpactSlippageModel(IAlgorithm algorithm, bool nonNegative = true, double latency = 0.075d,\n                                         double impactTime = 1800d, double alpha = 0.891d, double beta = 0.600d, \n                                         double gamma = 0.314d, double eta = 0.142d, double delta = 0.267d, \n                                         int randomSeed = 50)\n        {\n            if (latency <= 0)\n            {\n                throw new Exception(\"Latency cannot be less than or equal to 0.\");\n            }\n            if (impactTime <= 0)\n            {\n                throw new Exception(\"impactTime cannot be less than or equal to 0.\");\n            }\n\n            _algorithm = algorithm;\n            _nonNegative = nonNegative;\n            _latency = latency;\n            _impactTime = impactTime;\n            _alpha = alpha;\n            _beta = beta;\n            _gamma = gamma;\n            _eta = eta;\n            _delta = delta;\n            _random = new(randomSeed);\n        }\n\n        /// <summary>\n        /// Slippage Model. Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            if (asset.Type == SecurityType.Forex || asset.Type == SecurityType.Cfd)\n            {\n                throw new Exception($\"Asset of {asset.Type} is not supported as MarketImpactSlippageModel requires volume data\");\n            }\n\n            if (_symbolData == null)\n            {\n                _symbolData = new SymbolData(_algorithm, asset, _latency, _impactTime);\n            }\n\n            if (_symbolData.AverageVolume == 0d)\n            {\n                return 0m;\n            }\n            \n            // normalized volume of execution\n            var nu = (double)order.AbsoluteQuantity / _symbolData.ExecutionTime / _symbolData.AverageVolume;\n            // liquidity adjustment for temporary market impact, if any\n            var liquidityAdjustment = asset.Fundamentals.HasFundamentalData && asset.Fundamentals.CompanyProfile.SharesOutstanding != default ?\n                                      Math.Pow(asset.Fundamentals.CompanyProfile.SharesOutstanding / _symbolData.AverageVolume, _delta) :\n                                      1d;\n            // noise adjustment factor\n            var noise = _symbolData.Sigma * Math.Sqrt(_symbolData.ImpactTime);\n\n            // permanent market impact\n            var permanentImpact = _symbolData.Sigma * _symbolData.ExecutionTime * G(nu) * liquidityAdjustment + SampleGaussian() * noise;\n            // temporary market impact\n            var temporaryImpact = _symbolData.Sigma * H(nu) + SampleGaussian() * noise;\n            // realized market impact\n            var realizedImpact = temporaryImpact + permanentImpact * 0.5d;\n\n            // estimate the slippage by temporary impact\n            return SlippageFromImpactEstimation(realizedImpact) * asset.Price;\n        }\n\n        /// <summary>\n        /// The permanent market impact function\n        /// </summary>\n        /// <param name=\"absoluteOrderQuantity\">The absolute, normalized order quantity</param>\n        /// <return>Unadjusted permanent market impact factor</return>\n        private double G(double absoluteOrderQuantity)\n        {\n            return _gamma * Math.Pow(absoluteOrderQuantity, _alpha);\n        }\n\n        /// <summary>\n        /// The temporary market impact function\n        /// </summary>\n        /// <param name=\"absoluteOrderQuantity\">The absolute, normalized order quantity</param>\n        /// <return>Unadjusted temporary market impact factor</return>\n        private double H(double absoluteOrderQuantity)\n        {\n            return _eta * Math.Pow(absoluteOrderQuantity, _beta);\n        }\n\n        /// <summary>\n        /// Estimate the slippage size from impact\n        /// </summary>\n        /// <param name=\"impact\">The market impact of the order</param>\n        /// <return>Slippage estimation</return>\n        private decimal SlippageFromImpactEstimation(double impact)\n        {\n            // The percentage of impact that an order is averagely being affected is random from 0.0 to 1.0\n            var ultimateSlippage = (impact * _random.NextDouble()).SafeDecimalCast();\n            // Impact at max can be the asset's price\n            ultimateSlippage = Math.Min(ultimateSlippage, 1m);\n\n            if (_nonNegative)\n            {\n                return Math.Max(0m, ultimateSlippage);\n            }\n\n            return ultimateSlippage;\n        }\n\n        private double SampleGaussian(double location = 0d, double scale = 1d)\n        {\n            var randomVariable1 = 1 - _random.NextDouble();\n            var randomVariable2 = 1 - _random.NextDouble();\n\n            var deviation = Math.Sqrt(-2.0 * Math.Log(randomVariable1)) * Math.Cos(2.0 * Math.PI * randomVariable2);\n            return deviation * scale + location;\n        }\n    }\n\n    internal class SymbolData\n    {\n        private readonly IAlgorithm _algorithm;\n        private readonly Symbol _symbol;\n        private readonly TradeBarConsolidator _consolidator;\n        private readonly RollingWindow<decimal> _volumes = new(10);\n        private readonly RollingWindow<decimal> _prices = new(252);\n\n        public double Sigma { get; internal set; }\n\n        public double AverageVolume { get; internal set; }\n\n        public double ExecutionTime { get; internal set; }\n\n        public double ImpactTime { get; internal set; }\n\n        public SymbolData(IAlgorithm algorithm, Security asset, double latency, double impactTime)\n        {\n            _algorithm = algorithm;\n            _symbol = asset.Symbol;\n\n            _consolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));\n            _consolidator.DataConsolidated += OnDataConsolidated;\n            algorithm.SubscriptionManager.AddConsolidator(_symbol, _consolidator);\n\n            var configs = algorithm\n                .SubscriptionManager\n                .SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(_symbol, includeInternalConfigs: true);\n            var configToUse = configs.Where(x => x.TickType == TickType.Trade).First();\n\n            var historyRequestFactory = new HistoryRequestFactory(algorithm);\n            var historyRequest = historyRequestFactory.CreateHistoryRequest(configToUse,\n                                                                            algorithm.Time - TimeSpan.FromDays(370),\n                                                                            algorithm.Time,\n                                                                            algorithm.Securities[_symbol].Exchange.Hours,\n                                                                            Resolution.Daily);\n            foreach (var bar in algorithm.HistoryProvider.GetHistory(new List<HistoryRequest> { historyRequest }, algorithm.TimeZone))\n            {\n                _consolidator.Update(bar.Bars[_symbol]);\n            }\n\n            // execution time is defined as time difference between order submission and filling here, \n            // default with 75ms latency (https://www.interactivebrokers.com/download/salesPDFs/10-PDF0513.pdf)\n            // it should be in unit of \"trading days\", so we need to divide by normal trade day's length\n            var normalTradeDayLength = asset.Exchange.Hours.RegularMarketDuration.TotalDays;\n            ExecutionTime = TimeSpan.FromSeconds(latency).TotalDays / normalTradeDayLength;\n            // expected valid time for impact\n            var adjustedImpactTime = TimeSpan.FromSeconds(impactTime).TotalDays / normalTradeDayLength;\n            ImpactTime = ExecutionTime + adjustedImpactTime;\n        }\n\n        public void OnDataConsolidated(object _, TradeBar bar)\n        {\n            _prices.Add(bar.Close);\n            _volumes.Add(bar.Volume);\n\n            if (_prices.Samples < 2)\n            {\n                return;\n            }\n\n            var rocp = new double[_prices.Samples - 1];\n            for (var i = 0; i < _prices.Samples - 1; i++)\n            {\n                if (_prices[i + 1] == 0) continue;\n\n                var roc = (_prices[i] - _prices[i + 1]) / _prices[i + 1];\n                rocp[i] = (double)roc;\n            }\n\n            var variance = rocp.Variance();\n            Sigma = Math.Sqrt(variance);\n            AverageVolume = (double)_volumes.Average();\n        }\n\n        public void Dispose()\n        {\n            _prices.Reset();\n            _volumes.Reset();\n\n            _consolidator.DataConsolidated -= OnDataConsolidated;\n            _algorithm.SubscriptionManager.RemoveConsolidator(_symbol, _consolidator);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Slippage/NullSlippageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Null slippage model, which provider no slippage\n    /// </summary>\n    public sealed class NullSlippageModel : ISlippageModel\n    {\n        /// <summary>\n        /// The null slippage model instance\n        /// </summary>\n        public static NullSlippageModel Instance { get; } = new();\n\n        /// <summary>\n        /// Will return no slippage\n        /// </summary>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            return 0;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Slippage/VolumeShareSlippageModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Orders.Slippage\n{\n    /// <summary>\n    /// Represents a slippage model that is calculated by multiplying the price impact constant\n    /// by the square of the ratio of the order to the total volume.\n    /// </summary>\n    public class VolumeShareSlippageModel : ISlippageModel\n    {\n        private readonly decimal _priceImpact;\n        private readonly decimal _volumeLimit;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeShareSlippageModel\"/> class\n        /// </summary>\n        /// <param name=\"volumeLimit\"></param>\n        /// <param name=\"priceImpact\">Defines how large of an impact the order will have on the price calculation</param>\n        public VolumeShareSlippageModel(decimal volumeLimit = 0.025m, decimal priceImpact = 0.1m)\n        {\n            _priceImpact = priceImpact;\n            _volumeLimit = volumeLimit;\n        }\n\n        /// <summary>\n        /// Slippage Model. Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            var lastData = asset.GetLastData();\n            if (lastData == null) return 0;\n\n            var barVolume = 0m;\n            var slippagePercent = _volumeLimit * _volumeLimit * _priceImpact;\n\n            switch (lastData.DataType)\n            {\n                case MarketDataType.TradeBar:\n                    barVolume = ((TradeBar)lastData).Volume;\n                    break;\n                case MarketDataType.QuoteBar:\n                    barVolume = order.Direction == OrderDirection.Buy\n                        ? ((QuoteBar)lastData).LastBidSize\n                        : ((QuoteBar)lastData).LastAskSize;\n                    break;\n                default:\n                    throw new InvalidOperationException(Messages.VolumeShareSlippageModel.InvalidMarketDataType(lastData));\n            }\n\n            // If volume is zero or negative, we use the maximum slippage percentage since the impact of any quantity is infinite\n            // In FX/CFD case, we issue a warning and return zero slippage\n            if (barVolume <= 0)\n            {\n                var securityType = asset.Symbol.ID.SecurityType;\n                if (securityType == SecurityType.Cfd || securityType == SecurityType.Forex || securityType == SecurityType.Crypto)\n                {\n                    Log.Error(Messages.VolumeShareSlippageModel.VolumeNotReportedForMarketDataType(securityType));\n                    return 0;\n                }\n\n                Log.Error(Messages.VolumeShareSlippageModel.NegativeOrZeroBarVolume(barVolume, slippagePercent));\n            }\n            else\n            {\n                // Ratio of the order to the total volume\n                var volumeShare = Math.Min(order.AbsoluteQuantity / barVolume, _volumeLimit);\n\n                slippagePercent = volumeShare * volumeShare * _priceImpact;\n            }\n\n            return slippagePercent * lastData.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/Slippage/VolumeShareSlippageModel.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass VolumeShareSlippageModel:\n    '''Represents a slippage model that is calculated by multiplying the price impact constant by the square of the ratio of the order to the total volume.'''\n    \n    def __init__(self, volume_limit: float = 0.025, price_impact: float = 0.1) -> None:\n        '''Initializes a new instance of the \"VolumeShareSlippageModel\" class\n        Args:\n            volume_limit:\n            price_impact: Defines how large of an impact the order will have on the price calculation'''\n        self.volume_limit = volume_limit\n        self.price_impact = price_impact\n\n    def get_slippage_approximation(self, asset: Security, order: Order) -> float:\n        '''Slippage Model. Return a decimal cash slippage approximation on the order.\n        Args:\n            asset: The Security instance of the security of the order.\n            order: The Order instance being filled.'''\n        last_data = asset.get_last_data()\n        if not last_data:\n           return 0\n\n        bar_volume = 0\n        slippage_percent = self.volume_limit * self.volume_limit * self.price_impact\n\n        if last_data.data_type == MarketDataType.TRADE_BAR:\n            bar_volume = last_data.volume\n        elif last_data.data_type == MarketDataType.QUOTE_BAR:\n            bar_volume = last_data.last_bid_size if order.direction == OrderDirection.BUY else last_data.last_ask_size\n        else:\n           raise InvalidOperationException(Messages.VolumeShareSlippageModel.invalid_market_data_type(last_data))\n\n        # If volume is zero or negative, we use the maximum slippage percentage since the impact of any quantity is infinite\n        # In FX/CFD case, we issue a warning and return zero slippage\n        if bar_volume <= 0:\n            security_type = asset.symbol.id.security_type\n            if security_type == SecurityType.CFD or security_type == SecurityType.FOREX or security_type == SecurityType.CRYPTO:\n                Log.error(Messages.VolumeShareSlippageModel.volume_not_reported_for_market_data_type(security_type))\n                return 0\n\n            Log.error(Messages.VolumeShareSlippageModel.negative_or_zero_bar_volume(bar_volume, slippage_percent))\n        else:\n            # Ratio of the order to the total volume\n            volume_share = min(order.absolute_quantity / bar_volume, self.volume_limit)\n\n            slippage_percent = volume_share * volume_share * self.price_impact\n\n        return slippage_percent * last_data.Value;\n"
  },
  {
    "path": "Common/Orders/StopLimitOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Stop Market Order Type Definition\n    /// </summary>\n    public class StopLimitOrder : Order\n    {\n        /// <summary>\n        /// Stop price for this stop market order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"stopPrice\")]\n        public decimal StopPrice { get; internal set; }\n\n        /// <summary>\n        /// Signal showing the \"StopLimitOrder\" has been converted into a Limit Order\n        /// </summary>\n        [JsonProperty(PropertyName = \"stopTriggered\")]\n        public bool StopTriggered { get; internal set; }\n\n        /// <summary>\n        /// Limit price for the stop limit order\n        /// </summary>\n        [JsonProperty(PropertyName = \"limitPrice\")]\n        public decimal LimitPrice { get; internal set; }\n\n        /// <summary>\n        /// StopLimit Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.StopLimit; }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON Deserialization:\n        /// </summary>\n        public StopLimitOrder()\n        {\n        }\n\n        /// <summary>\n        /// New Stop Market Order constructor -\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"limitPrice\">Maximum price to fill the order</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"stopPrice\">Price the order should be filled at if a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public StopLimitOrder(Symbol symbol, decimal quantity, decimal stopPrice, decimal limitPrice, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n            StopPrice = stopPrice;\n            LimitPrice = limitPrice;\n        }\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public override string GetDefaultTag()\n        {\n            return Messages.StopLimitOrder.Tag(this);\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            // selling, so higher price will be used\n            if (Quantity < 0)\n            {\n                return Quantity * Math.Max(LimitPrice, security.Price);\n            }\n\n            // buying, so lower price will be used\n            if (Quantity > 0)\n            {\n                return Quantity * Math.Min(LimitPrice, security.Price);\n            }\n\n            return 0m;\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.StopPrice.HasValue)\n            {\n                StopPrice = request.StopPrice.Value;\n            }\n            if (request.LimitPrice.HasValue)\n            {\n                LimitPrice = request.LimitPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.StopLimitOrder.ToString(this);\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new StopLimitOrder { StopPrice = StopPrice, LimitPrice = LimitPrice, StopTriggered = StopTriggered };\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/StopMarketOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Stop Market Order Type Definition\n    /// </summary>\n    public class StopMarketOrder : Order\n    {\n        /// <summary>\n        /// Stop price for this stop market order.\n        /// </summary>\n        [JsonProperty(PropertyName = \"stopPrice\")]\n        public decimal StopPrice { get; internal set; }\n\n        /// <summary>\n        /// StopMarket Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.StopMarket; }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON Deserialization:\n        /// </summary>\n        public StopMarketOrder()\n        {\n        }\n\n        /// <summary>\n        /// New Stop Market Order constructor -\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset we're seeking to trade</param>\n        /// <param name=\"quantity\">Quantity of the asset we're seeking to trade</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"stopPrice\">Price the order should be filled at if a limit order</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The order properties for this order</param>\n        public StopMarketOrder(Symbol symbol, decimal quantity, decimal stopPrice, DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, time, tag, properties)\n        {\n            StopPrice = stopPrice;\n        }\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public override string GetDefaultTag()\n        {\n            return Messages.StopMarketOrder.Tag(this);\n        }\n\n        /// <summary>\n        /// Gets the order value in units of the security's quote currency\n        /// </summary>\n        /// <param name=\"security\">The security matching this order's symbol</param>\n        protected override decimal GetValueImpl(Security security)\n        {\n            // selling, so higher price will be used\n            if (Quantity < 0)\n            {\n                return Quantity * Math.Max(StopPrice, security.Price);\n            }\n\n            // buying, so lower price will be used\n            if (Quantity > 0)\n            {\n                return Quantity * Math.Min(StopPrice, security.Price);\n            }\n\n            return 0m;\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.StopPrice.HasValue)\n            {\n                StopPrice = request.StopPrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.StopMarketOrder.ToString(this);\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new StopMarketOrder { StopPrice = StopPrice };\n            CopyTo(order);\n            return order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/SubmitOrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Defines a request to submit a new order\n    /// </summary>\n    public class SubmitOrderRequest : OrderRequest\n    {\n        /// <summary>\n        /// Gets <see cref=\"Orders.OrderRequestType.Submit\"/>\n        /// </summary>\n        public override OrderRequestType OrderRequestType\n        {\n            get { return OrderRequestType.Submit; }\n        }\n\n        /// <summary>\n        /// Gets the security type of the symbol\n        /// </summary>\n        public SecurityType SecurityType\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the symbol to be traded\n        /// </summary>\n        public Symbol Symbol\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the order type od the order\n        /// </summary>\n        public OrderType OrderType\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the quantity of the order\n        /// </summary>\n        public decimal Quantity\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the limit price of the order, zero if not a limit order\n        /// </summary>\n        public decimal LimitPrice\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the stop price of the order, zero if not a stop order\n        /// </summary>\n        public decimal StopPrice\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Price which must first be reached before a limit order can be submitted.\n        /// </summary>\n        public decimal TriggerPrice\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Trailing amount for a trailing stop order\n        /// </summary>\n        public decimal TrailingAmount\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"TrailingAmount\"/> is a percentage or an absolute currency value\n        /// </summary>\n        public bool TrailingAsPercentage\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the order properties for this request\n        /// </summary>\n        public IOrderProperties OrderProperties\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the manager for the combo order. If null, the order is not a combo order.\n        /// </summary>\n        public GroupOrderManager GroupOrderManager\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Whether this request should be asynchronous,\n        /// which means the ticket will be returned to the algorithm without waiting for submission\n        /// </summary>\n        public bool Asynchronous\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubmitOrderRequest\"/> class.\n        /// The <see cref=\"OrderRequest.OrderId\"/> will default to <see cref=\"OrderResponseErrorCode.UnableToFindOrder\"/>\n        /// </summary>\n        /// <param name=\"orderType\">The order type to be submitted</param>\n        /// <param name=\"securityType\">The symbol's <see cref=\"SecurityType\"/></param>\n        /// <param name=\"symbol\">The symbol to be traded</param>\n        /// <param name=\"quantity\">The number of units to be ordered</param>\n        /// <param name=\"stopPrice\">The stop price for stop orders, non-stop orders this value is ignored</param>\n        /// <param name=\"limitPrice\">The limit price for limit orders, non-limit orders this value is ignored</param>\n        /// <param name=\"triggerPrice\">The trigger price for limit if touched orders, for non-limit if touched orders this value is ignored</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"time\">The time this request was created</param>\n        /// <param name=\"tag\">A custom tag for this request</param>\n        /// <param name=\"properties\">The order properties for this request</param>\n        /// <param name=\"groupOrderManager\">The manager for this combo order</param>\n        /// <param name=\"asynchronous\">True if this request should be asynchronous,\n        /// which means the ticket will be returned to the algorithm without waiting for submission</param>\n        public SubmitOrderRequest(\n            OrderType orderType,\n            SecurityType securityType,\n            Symbol symbol,\n            decimal quantity,\n            decimal stopPrice,\n            decimal limitPrice,\n            decimal triggerPrice,\n            decimal trailingAmount,\n            bool trailingAsPercentage,\n            DateTime time,\n            string tag,\n            IOrderProperties properties = null,\n            GroupOrderManager groupOrderManager = null,\n            bool asynchronous = false\n            )\n            : base(time, (int)OrderResponseErrorCode.UnableToFindOrder, tag)\n        {\n            SecurityType = securityType;\n            Symbol = symbol;\n            GroupOrderManager = groupOrderManager;\n            OrderType = orderType;\n            Quantity = quantity;\n            LimitPrice = limitPrice;\n            StopPrice = stopPrice;\n            TriggerPrice = triggerPrice;\n            TrailingAmount = trailingAmount;\n            TrailingAsPercentage = trailingAsPercentage;\n            OrderProperties = properties;\n            Asynchronous = asynchronous;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubmitOrderRequest\"/> class.\n        /// The <see cref=\"OrderRequest.OrderId\"/> will default to <see cref=\"OrderResponseErrorCode.UnableToFindOrder\"/>\n        /// </summary>\n        /// <param name=\"orderType\">The order type to be submitted</param>\n        /// <param name=\"securityType\">The symbol's <see cref=\"SecurityType\"/></param>\n        /// <param name=\"symbol\">The symbol to be traded</param>\n        /// <param name=\"quantity\">The number of units to be ordered</param>\n        /// <param name=\"stopPrice\">The stop price for stop orders, non-stop orders this value is ignored</param>\n        /// <param name=\"limitPrice\">The limit price for limit orders, non-limit orders this value is ignored</param>\n        /// <param name=\"triggerPrice\">The trigger price for limit if touched orders, for non-limit if touched orders this value is ignored</param>\n        /// <param name=\"time\">The time this request was created</param>\n        /// <param name=\"tag\">A custom tag for this request</param>\n        /// <param name=\"properties\">The order properties for this request</param>\n        /// <param name=\"groupOrderManager\">The manager for this combo order</param>\n        /// <param name=\"asynchronous\">True if this request should be asynchronous,\n        /// which means the ticket will be returned to the algorithm without waiting for submission</param>\n        public SubmitOrderRequest(\n            OrderType orderType,\n            SecurityType securityType,\n            Symbol symbol,\n            decimal quantity,\n            decimal stopPrice,\n            decimal limitPrice,\n            decimal triggerPrice,\n            DateTime time,\n            string tag,\n            IOrderProperties properties = null,\n            GroupOrderManager groupOrderManager = null,\n            bool asynchronous = false\n            )\n            : this(orderType, securityType, symbol, quantity, stopPrice, limitPrice, triggerPrice, 0, false, time, tag, properties,\n                  groupOrderManager, asynchronous)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubmitOrderRequest\"/> class.\n        /// The <see cref=\"OrderRequest.OrderId\"/> will default to <see cref=\"OrderResponseErrorCode.UnableToFindOrder\"/>\n        /// </summary>\n        /// <param name=\"orderType\">The order type to be submitted</param>\n        /// <param name=\"securityType\">The symbol's <see cref=\"SecurityType\"/></param>\n        /// <param name=\"symbol\">The symbol to be traded</param>\n        /// <param name=\"quantity\">The number of units to be ordered</param>\n        /// <param name=\"stopPrice\">The stop price for stop orders, non-stop orders this value is ignored</param>\n        /// <param name=\"limitPrice\">The limit price for limit orders, non-limit orders this value is ignored</param>\n        /// <param name=\"time\">The time this request was created</param>\n        /// <param name=\"tag\">A custom tag for this request</param>\n        /// <param name=\"properties\">The order properties for this request</param>\n        /// <param name=\"groupOrderManager\">The manager for this combo order</param>\n        /// <param name=\"asynchronous\">True if this request should be asynchronous,\n        /// which means the ticket will be returned to the algorithm without waiting for submission</param>\n        public SubmitOrderRequest(\n            OrderType orderType,\n            SecurityType securityType,\n            Symbol symbol,\n            decimal quantity,\n            decimal stopPrice,\n            decimal limitPrice,\n            DateTime time,\n            string tag,\n            IOrderProperties properties = null,\n            GroupOrderManager groupOrderManager = null,\n            bool asynchronous = false\n            )\n            : this(orderType, securityType, symbol, quantity, stopPrice, limitPrice, 0, time, tag, properties, groupOrderManager, asynchronous)\n        {\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"OrderRequest.OrderId\"/>\n        /// </summary>\n        /// <param name=\"orderId\">The order id of the generated order</param>\n        internal void SetOrderId(int orderId)\n        {\n            OrderId = orderId;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.SubmitOrderRequest.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TDAmeritradeOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// TDAmeritrade order properties\n    /// </summary>\n    public class TDAmeritradeOrderProperties : OrderProperties\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TastytradeOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Tastytrade brokerage\n    /// </summary>\n    public class TastytradeOrderProperties : OrderProperties\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TerminalLinkOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// The terminal link order properties\n    /// </summary>\n    public class TerminalLinkOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// The EMSX Instructions is the free form instructions that may be sent to the broker\n        /// </summary>\n        public string Notes { get; set; }\n\n        /// <summary>\n        /// The EMSX Handling Instruction is the instructions for handling the order or route.The values can be\n        /// preconfigured or a value customized by the broker.\n        /// </summary>\n        public string HandlingInstruction { get; set; }\n\n        /// <summary>\n        /// The execution instruction field\n        /// </summary>\n        public string ExecutionInstruction { get; set; }\n\n        /// <summary>\n        /// Custom user order notes 1\n        /// </summary>\n        public string CustomNotes1 { get; set; }\n\n        /// <summary>\n        /// Custom user order notes 2\n        /// </summary>\n        public string CustomNotes2 { get; set; }\n\n        /// <summary>\n        /// Custom user order notes 3\n        /// </summary>\n        public string CustomNotes3 { get; set; }\n\n        /// <summary>\n        /// Custom user order notes 4\n        /// </summary>\n        public string CustomNotes4 { get; set; }\n\n        /// <summary>\n        /// Custom user order notes 5\n        /// </summary>\n        public string CustomNotes5 { get; set; }\n\n        /// <summary>\n        /// The EMSX account\n        /// </summary>\n        public string Account { get; set; }\n\n        /// <summary>\n        /// The EMSX broker code\n        /// </summary>\n        public string Broker { get; set; }\n\n        /// <summary>\n        /// The EMSX order strategy details.\n        /// Strategy parameters must be appended in the correct order as expected by EMSX.\n        /// </summary>\n        public StrategyParameters Strategy { get; set; }\n\n        /// <summary>\n        /// Whether to automatically include the position side in the order direction (buy-to-open, sell-to-close, etc.) instead of the default (buy, sell)\n        /// </summary>\n        public bool AutomaticPositionSides { get; set; }\n\n        /// <summary>\n        /// Can optionally specify the position side in the order direction (buy-to-open, sell-to-close, etc.) instead of the default (buy, sell)\n        /// </summary>\n        /// <remarks>Has precedence over <see cref=\"AutomaticPositionSides\"/></remarks>\n        public OrderPosition? PositionSide { get; set; }\n\n        /// <summary>\n        /// Models an EMSX order strategy parameter\n        /// </summary>\n        public class StrategyParameters\n        {\n            /// <summary>\n            /// The strategy name\n            /// </summary>\n            public string Name { get; set; }\n\n            /// <summary>\n            /// The strategy fields\n            /// </summary>\n            public List<StrategyField> Fields { get; set; }\n\n            /// <summary>\n            /// Creates a new TerminalLink order strategy instance\n            /// </summary>\n            /// <param name=\"name\">The strategy name</param>\n            /// <param name=\"fields\">The strategy fields</param>\n            public StrategyParameters(string name, List<StrategyField> fields)\n            {\n                Name = name;\n                Fields = fields;\n            }\n        }\n\n        /// <summary>\n        /// Models an EMSX order strategy field\n        /// </summary>\n        public class StrategyField\n        {\n            /// <summary>\n            /// The strategy field value\n            /// </summary>\n            public string Value { get; set; }\n\n            /// <summary>\n            /// Whether the strategy field carries a value\n            /// </summary>\n            public bool HasValue { get; set; }\n\n            /// <summary>\n            /// Creates a new TerminalLink order strategy field carrying a value.\n            /// </summary>\n            /// <param name=\"value\">The strategy field value</param>\n            public StrategyField(string value)\n            {\n                Value = value;\n                HasValue = true;\n            }\n\n            /// <summary>\n            /// Creates a new TerminalLink order strategy field without a value.\n            /// </summary>\n            public StrategyField()\n            {\n                HasValue = false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TimeInForce.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Time In Force - defines the length of time over which an order will continue working before it is canceled\n    /// </summary>\n    [JsonConverter(typeof(TimeInForceJsonConverter))]\n    public abstract class TimeInForce : ITimeInForceHandler\n    {\n        /// <summary>\n        /// Gets a <see cref=\"GoodTilCanceledTimeInForce\"/> instance\n        /// </summary>\n        public static readonly TimeInForce GoodTilCanceled = new GoodTilCanceledTimeInForce();\n\n        /// <summary>\n        /// Gets a <see cref=\"DayTimeInForce\"/> instance\n        /// </summary>\n        public static readonly TimeInForce Day = new DayTimeInForce();\n\n        /// <summary>\n        /// Gets a <see cref=\"GoodTilDateTimeInForce\"/> instance\n        /// </summary>\n        public static Func<DateTime, TimeInForce> GoodTilDate => (DateTime expiry) => new GoodTilDateTimeInForce(expiry);\n\n        /// <summary>\n        /// Checks if an order is expired\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <returns>Returns true if the order has expired, false otherwise</returns>\n        public abstract bool IsOrderExpired(Security security, Order order);\n\n        /// <summary>\n        /// Checks if an order fill is valid\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <param name=\"fill\">The order fill to be checked</param>\n        /// <returns>Returns true if the order fill can be emitted, false otherwise</returns>\n        public abstract bool IsFillValid(Security security, Order order, OrderEvent fill);\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TimeInForceJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Reflection;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Orders.TimeInForces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"JsonConverter\"/> that can deserialize TimeInForce objects\n    /// </summary>\n    public class TimeInForceJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if this <see cref=\"T:Newtonsoft.Json.JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite => true;\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(TimeInForce).IsAssignableFrom(objectType);\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var timeInForce = value as TimeInForce;\n            if (ReferenceEquals(timeInForce, null)) return;\n\n            var jo = new JObject();\n\n            var type = value.GetType();\n            // don't add if its the default value used by the reader\n            if (type != typeof(GoodTilCanceledTimeInForce))\n            {\n                jo.Add(\"$type\", type.FullName);\n            }\n\n            foreach (var property in type.GetProperties())\n            {\n                if (property.CanRead)\n                {\n                    var propertyValue = property.GetValue(value, null);\n                    if (propertyValue != null)\n                    {\n                        jo.Add(property.Name, JToken.FromObject(propertyValue, serializer));\n                    }\n                }\n            }\n\n            jo.WriteTo(writer);\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JToken.Load(reader);\n\n            Type type;\n            var array = jObject as JArray;\n            if (array != null)\n            {\n                if (array.Count != 0)\n                {\n                    throw new InvalidOperationException($\"Unexpected time in force value: {jObject}\");\n                }\n                // default value if not present. for php [] & {} are the same representation of empty object\n                type = typeof(GoodTilCanceledTimeInForce);\n            }\n            else if (jObject[\"$type\"] != null)\n            {\n                var jToken = jObject[\"$type\"];\n                var typeName = jToken.ToString();\n                type = Type.GetType(typeName, throwOnError: false, ignoreCase: true);\n                if (type == null)\n                {\n                    throw new InvalidOperationException($\"Unable to find the type: {typeName}\");\n                }\n            }\n            else\n            {\n                // default value if not present\n                type = typeof(GoodTilCanceledTimeInForce);\n            }\n\n            var constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[0], null);\n            if (constructor == null)\n            {\n                throw new NotImplementedException($\"Unable to find a constructor for type: {type.FullName}\");\n            }\n\n            var timeInForce = constructor.Invoke(null);\n\n            foreach (var property in timeInForce.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))\n            {\n                var value = jObject[property.Name];\n                if (value != null)\n                {\n                    property.SetValue(timeInForce, value.ToObject(property.PropertyType));\n                }\n            }\n\n            return timeInForce;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TimeInForces/DayTimeInForce.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.TimeInForces\n{\n    /// <summary>\n    /// Day Time In Force - order expires at market close\n    /// </summary>\n    public class DayTimeInForce : TimeInForce\n    {\n        /// <summary>\n        /// Checks if an order is expired\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <returns>Returns true if the order has expired, false otherwise</returns>\n        public override bool IsOrderExpired(Security security, Order order)\n        {\n            var exchangeHours = security.Exchange.Hours;\n\n            var orderTime = order.Time.ConvertFromUtc(exchangeHours.TimeZone);\n            var time = security.LocalTime;\n\n            bool expired;\n            switch (order.SecurityType)\n            {\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    // With real brokerages (IB, Oanda, FXCM have been verified) FX orders expire at 5 PM NewYork time.\n                    // For now we use this fixed cut-off time, in future we might get this value from brokerage models,\n                    // to support custom brokerage implementations.\n\n                    var cutOffTimeZone = TimeZones.NewYork;\n                    var cutOffTimeSpan = TimeSpan.FromHours(17);\n\n                    orderTime = order.Time.ConvertFromUtc(cutOffTimeZone);\n                    var expiryTime = orderTime.Date.Add(cutOffTimeSpan);\n                    if (orderTime.TimeOfDay > cutOffTimeSpan)\n                    {\n                        // order submitted after 5 PM, expiry on next date\n                        expiryTime = expiryTime.AddDays(1);\n                    }\n\n                    expired = time.ConvertTo(exchangeHours.TimeZone, cutOffTimeZone) >= expiryTime;\n                    break;\n\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                    // expires at midnight UTC\n                    expired = time.Date > orderTime.Date;\n                    break;\n\n                case SecurityType.Equity:\n                case SecurityType.Option:\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                case SecurityType.IndexOption:\n                default:\n                    // expires at market close\n                    expired = time >= exchangeHours.GetLastDailyMarketClose(orderTime, false);\n                    break;\n            }\n\n            return expired;\n        }\n\n        /// <summary>\n        /// Checks if an order fill is valid\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <param name=\"fill\">The order fill to be checked</param>\n        /// <returns>Returns true if the order fill can be emitted, false otherwise</returns>\n        public override bool IsFillValid(Security security, Order order, OrderEvent fill)\n        {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TimeInForces/GoodTilCanceledTimeInForce.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.TimeInForces\n{\n    /// <summary>\n    /// Good Til Canceled Time In Force - order does never expires\n    /// </summary>\n    public class GoodTilCanceledTimeInForce : TimeInForce\n    {\n        /// <summary>\n        /// Checks if an order is expired\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <returns>Returns true if the order has expired, false otherwise</returns>\n        public override bool IsOrderExpired(Security security, Order order)\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// Checks if an order fill is valid\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <param name=\"fill\">The order fill to be checked</param>\n        /// <returns>Returns true if the order fill can be emitted, false otherwise</returns>\n        public override bool IsFillValid(Security security, Order order, OrderEvent fill)\n        {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TimeInForces/GoodTilDateTimeInForce.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Orders.TimeInForces\n{\n    /// <summary>\n    /// Good Til Date Time In Force - order expires and will be cancelled on a fixed date/time\n    /// </summary>\n    public class GoodTilDateTimeInForce : TimeInForce\n    {\n        /// <summary>\n        /// The date/time on which the order will expire and will be cancelled\n        /// </summary>\n        /// <remarks>The private set is required for JSON deserialization</remarks>\n        public DateTime Expiry { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GoodTilDateTimeInForce\"/> class\n        /// </summary>\n        /// <remarks>This constructor is required for JSON deserialization</remarks>\n        private GoodTilDateTimeInForce()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GoodTilDateTimeInForce\"/> class\n        /// </summary>\n        public GoodTilDateTimeInForce(DateTime expiry)\n        {\n            Expiry = expiry;\n        }\n\n        /// <summary>\n        /// Checks if an order is expired\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <returns>Returns true if the order has expired, false otherwise</returns>\n        public override bool IsOrderExpired(Security security, Order order)\n        {\n            var exchangeHours = security.Exchange.Hours;\n\n            var time = security.LocalTime;\n\n            bool expired;\n            switch (order.SecurityType)\n            {\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    // With real brokerages (IB, Oanda, FXCM have been verified) FX orders expire at 5 PM NewYork time.\n                    // For now we use this fixed cut-off time, in future we might get this value from brokerage models,\n                    // to support custom brokerage implementations.\n                    expired = time.ConvertToUtc(exchangeHours.TimeZone) >= GetForexOrderExpiryDateTime(order);\n                    break;\n\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                    // expires at midnight after expiry date\n                    expired = time.Date > Expiry.Date;\n                    break;\n\n                case SecurityType.Equity:\n                case SecurityType.Option:\n                case SecurityType.Future:\n                case SecurityType.FutureOption:\n                case SecurityType.IndexOption:\n                default:\n                    // expires at market close of expiry date\n                    expired = time >= exchangeHours.GetLastDailyMarketClose(Expiry.Date, false);\n                    break;\n            }\n\n            return expired;\n        }\n\n        /// <summary>\n        /// Checks if an order fill is valid\n        /// </summary>\n        /// <param name=\"security\">The security matching the order</param>\n        /// <param name=\"order\">The order to be checked</param>\n        /// <param name=\"fill\">The order fill to be checked</param>\n        /// <returns>Returns true if the order fill can be emitted, false otherwise</returns>\n        public override bool IsFillValid(Security security, Order order, OrderEvent fill)\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Returns the expiry date and time (UTC) for a Forex order\n        /// </summary>\n        public DateTime GetForexOrderExpiryDateTime(Order order)\n        {\n            var cutOffTimeZone = TimeZones.NewYork;\n            var cutOffTimeSpan = TimeSpan.FromHours(17);\n\n            var expiryTime = Expiry.Date.Add(cutOffTimeSpan);\n            if (order.Time.Date == Expiry.Date)\n            {\n                // expiry date same as order date\n                var orderTime = order.Time.ConvertFromUtc(cutOffTimeZone);\n                if (orderTime.TimeOfDay > cutOffTimeSpan)\n                {\n                    // order submitted after 5 PM, expiry on next date\n                    expiryTime = expiryTime.AddDays(1);\n                }\n            }\n\n            return expiryTime.ConvertToUtc(cutOffTimeZone);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TradeStationOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Represents the properties of an order in TradeStation.\n    /// </summary>\n    public class TradeStationOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// Enables the \"All or None\" feature for your order, ensuring it will only be filled completely or not at all.\n        /// Set to true to activate this feature, or false to allow partial fills.\n        /// </summary>\n        /// <remarks>\n        /// Applicable to Equities and Options.\n        /// </remarks>\n        public bool AllOrNone { get; set; }\n\n        /// <summary>\n        /// If set to true, allows orders to also trigger or fill outside of regular trading hours.\n        /// </summary>\n        public bool OutsideRegularTradingHours { get; set; }\n\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (no fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders and equities.\n        /// </summary>\n        public bool PostOnly { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TradierOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Provides an implementation of the <see cref=\"OrderProperties\"/> specific to Tradier order.\n    /// </summary>\n    public class TradierOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// If set to true, allows orders to also trigger and fill outside of regular trading hours.\n        /// If on extended hours, the order will be valid only during the current extended session.\n        /// </summary>\n        public bool OutsideRegularTradingHours { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TradingTechnologiesOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n    \nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Trading Technologies order properties\n    /// </summary>\n    public class TradingTechnologiesOrderProperties : FixOrderProperites\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Orders/TrailingStopOrder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Trailing Stop Order Type Definition\n    /// </summary>\n    public class TrailingStopOrder : StopMarketOrder\n    {\n        /// <summary>\n        /// Trailing amount for this trailing stop order\n        /// </summary>\n        [JsonProperty(PropertyName = \"trailingAmount\")]\n        public decimal TrailingAmount { get; internal set; }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"TrailingAmount\"/> is a percentage or an absolute currency value\n        /// </summary>\n        [JsonProperty(PropertyName = \"trailingAsPercentage\")]\n        public bool TrailingAsPercentage { get; internal set; }\n\n        /// <summary>\n        /// StopLimit Order Type\n        /// </summary>\n        public override OrderType Type\n        {\n            get { return OrderType.TrailingStop; }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON Deserialization:\n        /// </summary>\n        public TrailingStopOrder()\n        {\n        }\n\n        /// <summary>\n        /// New Trailing Stop Market Order constructor\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset being traded</param>\n        /// <param name=\"quantity\">Quantity of the asset to be traded</param>\n        /// <param name=\"stopPrice\">Initial stop price at which the order should be triggered</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The properties for this order</param>\n        public TrailingStopOrder(Symbol symbol, decimal quantity, decimal stopPrice, decimal trailingAmount, bool trailingAsPercentage,\n            DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : base(symbol, quantity, stopPrice, time, tag, properties)\n        {\n            TrailingAmount = trailingAmount;\n            TrailingAsPercentage = trailingAsPercentage;\n        }\n\n        /// <summary>\n        /// New Trailing Stop Market Order constructor.\n        /// It creates a new Trailing Stop Market Order with an initial stop price calculated by subtracting (for a sell) or adding (for a buy) the\n        /// trailing amount to the current market price.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol asset being traded</param>\n        /// <param name=\"quantity\">Quantity of the asset to be traded</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"time\">Time the order was placed</param>\n        /// <param name=\"tag\">User defined data tag for this order</param>\n        /// <param name=\"properties\">The properties for this order</param>\n        public TrailingStopOrder(Symbol symbol, decimal quantity, decimal trailingAmount, bool trailingAsPercentage,\n            DateTime time, string tag = \"\", IOrderProperties properties = null)\n            : this(symbol, quantity, 0, trailingAmount, trailingAsPercentage, time, tag, properties)\n        {\n        }\n\n        /// <summary>\n        /// Gets the default tag for this order\n        /// </summary>\n        /// <returns>The default tag</returns>\n        public override string GetDefaultTag()\n        {\n            return Messages.TrailingStopOrder.Tag(this);\n        }\n\n        /// <summary>\n        /// Modifies the state of this order to match the update request\n        /// </summary>\n        /// <param name=\"request\">The request to update this order object</param>\n        public override void ApplyUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            base.ApplyUpdateOrderRequest(request);\n            if (request.TrailingAmount.HasValue)\n            {\n                TrailingAmount = request.TrailingAmount.Value;\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.TrailingStopOrder.ToString(this);\n        }\n\n        /// <summary>\n        /// Creates a deep-copy clone of this order\n        /// </summary>\n        /// <returns>A copy of this order</returns>\n        public override Order Clone()\n        {\n            var order = new TrailingStopOrder\n            {\n                StopPrice = StopPrice,\n                TrailingAmount = TrailingAmount,\n                TrailingAsPercentage = TrailingAsPercentage\n            };\n            CopyTo(order);\n            return order;\n        }\n\n        /// <summary>\n        /// Tries to update the stop price for a trailing stop order given the current market price\n        /// </summary>\n        /// <param name=\"currentMarketPrice\">The current market price</param>\n        /// <param name=\"currentStopPrice\">The current trailing stop order stop price</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"direction\">The order direction</param>\n        /// <param name=\"updatedStopPrice\">The updated stop price</param>\n        /// <returns>\n        /// Whether the stop price was updated.\n        /// This only happens when the distance between the current stop price and the current market price is greater than the trailing amount,\n        /// which will happen when the market price raises/falls for sell/buy orders respectively.\n        /// </returns>\n        public static bool TryUpdateStopPrice(decimal currentMarketPrice, decimal currentStopPrice, decimal trailingAmount,\n            bool trailingAsPercentage, OrderDirection direction, out decimal updatedStopPrice)\n        {\n            updatedStopPrice = 0m;\n            var distanceToMarketPrice = direction == OrderDirection.Sell\n                ? currentMarketPrice - currentStopPrice\n                : currentStopPrice - currentMarketPrice;\n            var stopReference = trailingAsPercentage ? currentMarketPrice * trailingAmount : trailingAmount;\n\n            if (distanceToMarketPrice <= stopReference)\n            {\n                return false;\n            }\n\n            updatedStopPrice = CalculateStopPrice(currentMarketPrice, trailingAmount, trailingAsPercentage, direction);\n            return true;\n        }\n\n        /// <summary>\n        /// Calculates the stop price for a trailing stop order given the current market price\n        /// </summary>\n        /// <param name=\"currentMarketPrice\">The current market price</param>\n        /// <param name=\"trailingAmount\">The trailing amount to be used to update the stop price</param>\n        /// <param name=\"trailingAsPercentage\">Whether the <paramref name=\"trailingAmount\"/> is a percentage or an absolute currency value</param>\n        /// <param name=\"direction\">The order direction</param>\n        /// <returns>The stop price for the order given the current market price</returns>\n        public static decimal CalculateStopPrice(decimal currentMarketPrice, decimal trailingAmount, bool trailingAsPercentage,\n            OrderDirection direction)\n        {\n            if (trailingAsPercentage)\n            {\n                return direction == OrderDirection.Buy\n                    ? currentMarketPrice * (1 + trailingAmount)\n                    : currentMarketPrice * (1 - trailingAmount);\n            }\n\n            return direction == OrderDirection.Buy\n                ? currentMarketPrice + trailingAmount\n                : currentMarketPrice - trailingAmount;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/UpdateOrderFields.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Specifies the data in an order to be updated\n    /// </summary>\n    public class UpdateOrderFields\n    {\n        /// <summary>\n        /// Specify to update the quantity of the order\n        /// </summary>\n        public decimal? Quantity { get; set; }\n\n        /// <summary>\n        /// Specify to update the limit price of the order\n        /// </summary>\n        public decimal? LimitPrice { get; set; }\n\n        /// <summary>\n        /// Specify to update the stop price of the order\n        /// </summary>\n        public decimal? StopPrice { get; set; }\n\n        /// <summary>\n        /// Specify to update the trigger price of the order\n        /// </summary>\n        public decimal? TriggerPrice { get; set; }\n\n        /// <summary>\n        /// The trailing stop order trailing amount\n        /// </summary>\n        public decimal? TrailingAmount { get; set; }\n\n        /// <summary>\n        /// Specify to update the order's tag\n        /// </summary>\n        public string Tag { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/UpdateOrderRequest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Defines a request to update an order's values\n    /// </summary>\n    public class UpdateOrderRequest : OrderRequest\n    {\n        /// <summary>\n        /// Gets <see cref=\"Orders.OrderRequestType.Update\"/>\n        /// </summary>\n        public override OrderRequestType OrderRequestType\n        {\n            get { return OrderRequestType.Update; }\n        }\n\n        /// <summary>\n        /// Gets the new quantity of the order, null to not change the quantity\n        /// </summary>\n        public decimal? Quantity { get; private set; }\n\n        /// <summary>\n        /// Gets the new limit price of the order, null to not change the limit price\n        /// </summary>\n        public decimal? LimitPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the new stop price of the order, null to not change the stop price\n        /// </summary>\n        public decimal? StopPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the new trigger price of the order, null to not change the trigger price\n        /// </summary>\n        public decimal? TriggerPrice { get; private set; }\n\n        /// <summary>\n        /// The trailing stop order trailing amount\n        /// </summary>\n        public decimal? TrailingAmount { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateOrderRequest\"/> class\n        /// </summary>\n        /// <param name=\"time\">The time the request was submitted</param>\n        /// <param name=\"orderId\">The order id to be updated</param>\n        /// <param name=\"fields\">The fields defining what should be updated</param>\n        public UpdateOrderRequest(DateTime time, int orderId, UpdateOrderFields fields)\n            : base(time, orderId, fields.Tag)\n        {\n            Quantity = fields.Quantity;\n            LimitPrice = fields.LimitPrice;\n            StopPrice = fields.StopPrice;\n            TriggerPrice = fields.TriggerPrice;\n            TrailingAmount = fields.TrailingAmount;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.UpdateOrderRequest.ToString(this);\n        }\n\n        /// <summary>\n        /// Checks whether the update request is allowed for a closed order.\n        /// Only tag updates are allowed on closed orders.\n        /// </summary>\n        /// <returns>True if the update request is allowed for a closed order</returns>\n        public bool IsAllowedForClosedOrder()\n        {\n            return !Quantity.HasValue && !LimitPrice.HasValue && !StopPrice.HasValue && !TriggerPrice.HasValue & !TrailingAmount.HasValue;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/WolverineOrderProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Wolverine order properties\n    /// </summary>\n    public class WolverineOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// The exchange post fix to apply if any\n        /// </summary>\n        public string ExchangePostFix { get; set; }\n\n        /// <summary>\n        /// Identifies the broker source for borrowed stock\n        /// </summary>\n        public string LocateBroker { get; set; }\n\n        /// <summary>\n        /// Can optionally specify the position side in the order direction (buy-to-open, sell-to-close, etc.) instead of the default handling\n        /// </summary>\n        public OrderPosition? PositionSide { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Orders/dYdXOrderProperties.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Orders\n{\n    /// <summary>\n    /// Contains additional properties and settings for an order submitted to Binance brokerage\n    /// </summary>\n    public class dYdXOrderProperties : OrderProperties\n    {\n        /// <summary>\n        /// This flag will ensure the order executes only as a maker (no fee) order.\n        /// If part of the order results in taking liquidity rather than providing,\n        /// it will be rejected and no part of the order will execute.\n        /// Note: this flag is only applied to Limit orders.\n        /// </summary>\n        public bool PostOnly\n        {\n            get;\n            set\n            {\n                if (value && IOC)\n                {\n                    throw new System.InvalidOperationException(\"Cannot set PostOnly when IOC is already set. Only one execution type can be active at a time.\");\n                }\n                field = value;\n            }\n        }\n\n        /// <summary>\n        /// Enforces that an order only be placed\n        /// on the book as a maker order. Note this means that validators will cancel\n        /// any newly placed post only orders that would cross with other maker\n        /// orders.\n        /// </summary>\n        public bool IOC\n        {\n            get;\n            set\n            {\n                if (value && PostOnly)\n                {\n                    throw new System.InvalidOperationException(\"Cannot set IOC when PostOnly is already set. Only one execution type can be active at a time.\");\n                }\n                field = value;\n            }\n        }\n\n        /// <summary>\n        /// The maximum amount of gas to use for the order.\n        /// </summary>\n        public ulong GasLimit { get; set; } = 1_000_000;\n\n        /// <summary>\n        /// If you send a reduce-only order, it will only trade if it decreases your position size.\n        /// </summary>\n        public bool ReduceOnly { get; set; }\n\n        /// <summary>\n        /// The block height at which the order expires.\n        /// </summary>\n        public uint GoodTilBlockOffset { get; set; } = 20;\n\n        /// <summary>\n        /// Returns a new instance clone of this object\n        /// </summary>\n        public override IOrderProperties Clone()\n        {\n            return (dYdXOrderProperties)MemberwiseClone();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlgorithmNameUpdatePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Packet to communicate updates to the algorithm's name\n    /// </summary>\n    public class AlgorithmNameUpdatePacket : Packet\n    {\n        /// <summary>\n        /// Algorithm id for this order event\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// The new name\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public AlgorithmNameUpdatePacket()\n            : base(PacketType.AlgorithmNameUpdate)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the algorithm tags up[date packet\n        /// </summary>\n        public AlgorithmNameUpdatePacket(string algorithmId, string name)\n            : base(PacketType.AlgorithmNameUpdate)\n        {\n            AlgorithmId = algorithmId;\n            Name = name;\n        }\n\n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlgorithmNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Algorithm Node Packet is a work task for the Lean Engine\n    /// </summary>\n    public class AlgorithmNodePacket : PythonEnvironmentPacket\n    {\n        /// <summary>\n        /// Default constructor for the algorithm node:\n        /// </summary>\n        /// <param name=\"type\"></param>\n        public AlgorithmNodePacket(PacketType type)\n            : base(type)\n        { }\n\n        /// <summary>\n        /// The host name to use if any\n        /// </summary>\n        public string HostName { get; set; }\n\n        /// <summary>\n        /// User Id placing request\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// User API Token\n        public string UserToken { get; set; } = string.Empty;\n\n        /// User Organization Id\n        public string OrganizationId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Project Id of the request\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Project name of the request\n        /// </summary>\n        public string ProjectName { get; set; }\n\n        /// <summary>\n        /// Algorithm Id - BacktestId or DeployId - Common Id property between packets.\n        /// </summary>\n        public string AlgorithmId\n        {\n            get\n            {\n                if (Type == PacketType.LiveNode || Type == PacketType.AlphaNode)\n                {\n                    return ((LiveNodePacket)this).DeployId;\n                }\n                else if (Type == PacketType.ResearchNode)\n                {\n                    return ((ResearchNodePacket)this).ResearchId;\n                }\n                return ((BacktestNodePacket)this).BacktestId;\n            }\n        }\n\n        /// <summary>\n        /// User session Id for authentication\n        /// </summary>\n        public string SessionId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Language flag: Currently represents IL code or Dynamic Scripted Types.\n        /// </summary>\n        public Language Language { get; set; } = Language.CSharp;\n\n        /// <summary>\n        /// Server type for the deployment (512, 1024, 2048)\n        /// </summary>\n        public ServerType ServerType { get; set; } = ServerType.Server512;\n\n        /// <summary>\n        /// Unique compile id of this backtest\n        /// </summary>\n        public string CompileId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Version number identifier for the lean engine.\n        /// </summary>\n        public string Version { get; set; }\n\n        /// <summary>\n        /// An algorithm packet which has already been run and is being redelivered on this node.\n        /// In this event we don't want to relaunch the task as it may result in unexpected behaviour for user.\n        /// </summary>\n        public bool Redelivered { get; set; }\n\n        /// <summary>\n        /// Algorithm binary with zip of contents\n        /// </summary>\n        public byte[] Algorithm { get; set; } = Array.Empty<byte>();\n\n        /// <summary>\n        /// Request source - Web IDE or API - for controling result handler behaviour\n        /// </summary>\n        public string RequestSource { get; set; } = \"WebIDE\";\n\n        /// <summary>\n        /// The maximum amount of RAM (in MB) this algorithm is allowed to utilize\n        /// </summary>\n        public int RamAllocation {\n            get { return Controls?.RamAllocation ?? 0; }\n        }\n\n        /// <summary>\n        /// Specifies values to control algorithm limits\n        /// </summary>\n        public Controls Controls { get; set; }\n\n        /// <summary>\n        /// The parameter values used to set algorithm parameters\n        /// </summary>\n        public Dictionary<string, string> Parameters { get; set; } = new Dictionary<string, string>();\n\n        /// <summary>\n        /// String name of the HistoryProvider we're running with\n        /// </summary>\n        public string HistoryProvider { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        [JsonIgnore]\n        public virtual AlgorithmMode AlgorithmMode { get; } = AlgorithmMode.Backtesting;\n\n        /// <summary>\n        /// Deployment target, either local or cloud.\n        /// </summary>\n        [JsonIgnore]\n        public DeploymentTarget DeploymentTarget { get; set; }\n\n        /// <summary>\n        /// Gets a unique name for the algorithm defined by this packet\n        /// </summary>\n        public string GetAlgorithmName()\n        {\n            return Invariant($\"{UserId}-{ProjectId}-{AlgorithmId}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlgorithmStatusPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Algorithm status update information packet\n    /// </summary>\n    public class AlgorithmStatusPacket : Packet\n    {\n        /// <summary>\n        /// Current algorithm status\n        /// </summary>\n        [JsonConverter(typeof(StringEnumConverter))]\n        public AlgorithmStatus Status { get; set; }\n\n        /// <summary>\n        /// Chart we're subscribed to for live trading.\n        /// </summary>\n        public string ChartSubscription { get; set; }\n\n        /// <summary>\n        /// Optional message or reason for state change.\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Algorithm Id associated with this status packet\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// OptimizationId for this result packet if any\n        /// </summary>\n        public string OptimizationId { get; set; }\n\n        /// <summary>\n        /// Project Id associated with this status packet\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// The current state of the channel\n        /// </summary>\n        public string ChannelStatus { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public AlgorithmStatusPacket()\n            : base(PacketType.AlgorithmStatus)\n        {\n        }\n\n        /// <summary>\n        /// Initialize algorithm state packet:\n        /// </summary>\n        public AlgorithmStatusPacket(string algorithmId, int projectId, AlgorithmStatus status, string message = \"\")\n            : base (PacketType.AlgorithmStatus)\n        {\n            Status = status;\n            ProjectId = projectId;\n            AlgorithmId = algorithmId;\n            Message = message;\n        }   \n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlgorithmTagsUpdatePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Packet to communicate updates to the algorithm tags\n    /// </summary>\n    public class AlgorithmTagsUpdatePacket : Packet\n    {\n        /// <summary>\n        /// Algorithm id for this order event\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// The new tags\n        /// </summary>\n        public HashSet<string> Tags { get; set; } = new();\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public AlgorithmTagsUpdatePacket()\n            : base(PacketType.AlgorithmTagsUpdate)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the algorithm tags up[date packet\n        /// </summary>\n        public AlgorithmTagsUpdatePacket(string algorithmId, HashSet<string> tags)\n            : base(PacketType.AlgorithmTagsUpdate)\n        {\n            AlgorithmId = algorithmId;\n            Tags = tags;\n        }\n\n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlphaNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Alpha job packet\n    /// </summary>\n    public class AlphaNodePacket : LiveNodePacket\n    {\n        /// <summary>\n        /// Gets or sets the alpha id\n        /// </summary>\n        public string AlphaId { get; set; }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"AlgorithmNodePacket\"/> class\n        /// </summary>\n        public AlphaNodePacket()\n        {\n            Type = PacketType.AlphaNode;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/AlphaResultPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Provides a packet type for transmitting alpha insights data\n    /// </summary>\n    public class AlphaResultPacket : Packet\n    {\n        /// <summary>\n        /// The user's id that deployed the alpha stream\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// <summary>\n        /// The deployed alpha id. This is the id generated upon submssion to the alpha marketplace.\n        /// If this is a user backtest or live algo then this will not be specified\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string AlphaId { get; set; }\n\n        /// <summary>\n        /// The algorithm's unique identifier\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// The generated insights\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public List<Insight> Insights { get; set; }\n\n        /// <summary>\n        /// The generated OrderEvents\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public List<OrderEvent> OrderEvents { get; set; }\n\n        /// <summary>\n        /// The new or updated Orders\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public List<Order> Orders { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlphaResultPacket\"/> class\n        /// </summary>\n        public AlphaResultPacket()\n            : base(PacketType.AlphaResult)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlphaResultPacket\"/> class\n        /// </summary>\n        /// <param name=\"algorithmId\">The algorithm's unique identifier</param>\n        /// <param name=\"userId\">The user's id</param>\n        /// <param name=\"insights\">Alphas generated by the algorithm</param>\n        /// <param name=\"orderEvents\">OrderEvents generated by the algorithm</param>\n        /// <param name=\"orders\">Orders generated or updated by the algorithm</param>\n        public AlphaResultPacket(string algorithmId, int userId, List<Insight> insights = null, List<OrderEvent> orderEvents = null, List<Order> orders = null)\n            : base(PacketType.AlphaResult)\n        {\n            UserId = userId;\n            AlgorithmId = algorithmId;\n            Insights = insights;\n            OrderEvents = orderEvents;\n            Orders = orders;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/BacktestNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Algorithm backtest task information packet.\n    /// </summary>\n    public class BacktestNodePacket : AlgorithmNodePacket\n    {\n        // default random id, static so its one per process\n        private static readonly string DefaultId\n            = Guid.NewGuid().ToString(\"N\", CultureInfo.InvariantCulture);\n\n        /// <summary>\n        /// Name of the backtest as randomly defined in the IDE.\n        /// </summary>\n        public string Name { get; set; } = string.Empty;\n\n        /// <summary>\n        /// BacktestId / Algorithm Id for this task\n        /// </summary>\n        public string BacktestId { get; set; } = DefaultId;\n\n        /// <summary>\n        /// Optimization Id for this task\n        /// </summary>\n        public string OptimizationId { get; set; }\n\n        /// <summary>\n        /// Backtest start-date as defined in the Initialize() method.\n        /// </summary>\n        public DateTime? PeriodStart { get; set; }\n\n        /// <summary>\n        /// Backtest end date as defined in the Initialize() method.\n        /// </summary>\n        public DateTime? PeriodFinish { get; set; }\n\n        /// <summary>\n        /// Backtest maximum end date\n        /// </summary>\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// The backtest out of sample day count\n        /// </summary>\n        public int OutOfSampleDays { get; set; }\n\n        /// <summary>\n        /// Estimated number of trading days in this backtest task based on the start-end dates.\n        /// </summary>\n        public int TradeableDates { get; set; }\n\n        /// <summary>\n        /// True, if this is a debugging backtest\n        /// </summary>\n        public bool Debugging { get; set; }\n\n        /// <summary>\n        /// Optional initial cash amount if set\n        /// </summary>\n        public CashAmount? CashAmount { get; set; }\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        [JsonIgnore]\n        public override AlgorithmMode AlgorithmMode\n        {\n            get\n            {\n                return OptimizationId.IsNullOrEmpty() ? AlgorithmMode.Backtesting : AlgorithmMode.Optimization;\n            }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public BacktestNodePacket()\n            : base(PacketType.BacktestNode)\n        {\n            Controls = new Controls\n            {\n                MinuteLimit = 500,\n                SecondLimit = 100,\n                TickLimit = 30\n            };\n        }\n\n        /// <summary>\n        /// Initialize the backtest task packet.\n        /// </summary>\n        public BacktestNodePacket(int userId, int projectId, string sessionId, byte[] algorithmData, decimal startingCapital, string name)\n            : this (userId, projectId, sessionId, algorithmData, name, new CashAmount(startingCapital, Currencies.USD))\n        {\n        }\n\n        /// <summary>\n        /// Initialize the backtest task packet.\n        /// </summary>\n        public BacktestNodePacket(int userId, int projectId, string sessionId, byte[] algorithmData, string name, CashAmount? startingCapital = null)\n            : base(PacketType.BacktestNode)\n        {\n            UserId = userId;\n            Algorithm = algorithmData;\n            SessionId = sessionId;\n            ProjectId = projectId;\n            Name = name;\n            CashAmount = startingCapital;\n            Language = Language.CSharp;\n            Controls = new Controls\n            {\n                MinuteLimit = 500,\n                SecondLimit = 100,\n                TickLimit = 30\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/BacktestResultPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Backtest result packet: send backtest information to GUI for user consumption.\n    /// </summary>\n    public class BacktestResultPacket : Packet\n    {\n        /// <summary>\n        /// User Id placing this task\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// <summary>\n        /// Project Id of the this task.\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// User Session Id\n        /// </summary>\n        public string SessionId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// BacktestId for this result packet\n        /// </summary>\n        public string BacktestId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// OptimizationId for this result packet if any\n        /// </summary>\n        public string OptimizationId { get; set; }\n\n        /// <summary>\n        /// Compile Id for the algorithm which generated this result packet.\n        /// </summary>\n        public string CompileId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Start of the backtest period as defined in Initialize() method.\n        /// </summary>\n        public DateTime PeriodStart { get; set; }\n\n        /// <summary>\n        /// End of the backtest period as defined in the Initialize() method.\n        /// </summary>\n        public DateTime PeriodFinish { get; set; }\n\n        /// <summary>\n        /// DateTime (EST) the user requested this backtest.\n        /// </summary>\n        public DateTime DateRequested { get; set; }\n\n        /// <summary>\n        /// DateTime (EST) when the backtest was completed.\n        /// </summary>\n        public DateTime DateFinished { get; set; }\n\n        /// <summary>\n        /// Progress of the backtest as a percentage from 0-1 based on the days lapsed from start-finish.\n        /// </summary>\n        public decimal Progress { get; set; }\n\n        /// <summary>\n        /// Name of this backtest.\n        /// </summary>\n        public string Name { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Result data object for this backtest\n        /// </summary>\n        public BacktestResult Results { get; set; } = new ();\n\n        /// <summary>\n        /// Processing time of the algorithm (from moment the algorithm arrived on the algorithm node)\n        /// </summary>\n        public double ProcessingTime { get; set; }\n\n        /// <summary>\n        /// Estimated number of tradeable days in the backtest based on the start and end date or the backtest\n        /// </summary>\n        public int TradeableDates { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON Serialization\n        /// </summary>\n        public BacktestResultPacket()\n            : base(PacketType.BacktestResult)\n        {\n            PeriodStart = PeriodFinish = DateRequested = DateFinished = DateTime.UtcNow;\n        }\n\n        /// <summary>\n        /// Compose the packet from a JSON string:\n        /// </summary>\n        public BacktestResultPacket(string json)\n            : base (PacketType.BacktestResult)\n        {\n            try\n            {\n                var packet = JsonConvert.DeserializeObject<BacktestResultPacket>(json, new JsonSerializerSettings\n                {\n                    TypeNameHandling = TypeNameHandling.Auto\n                });\n                CompileId           = packet.CompileId;\n                Channel             = packet.Channel;\n                PeriodFinish        = packet.PeriodFinish;\n                PeriodStart         = packet.PeriodStart;\n                Progress            = packet.Progress;\n                SessionId           = packet.SessionId;\n                BacktestId          = packet.BacktestId;\n                Type                = packet.Type;\n                UserId              = packet.UserId;\n                DateFinished        = packet.DateFinished;\n                DateRequested       = packet.DateRequested;\n                Name                = packet.Name;\n                ProjectId           = packet.ProjectId;\n                Results             = packet.Results;\n                ProcessingTime      = packet.ProcessingTime;\n                TradeableDates      = packet.TradeableDates;\n                OptimizationId      = packet.OptimizationId;\n            }\n            catch (Exception err)\n            {\n                Log.Trace($\"BacktestResultPacket(): Error converting json: {err}\");\n            }\n        }\n\n\n        /// <summary>\n        /// Compose result data packet - with tradable dates from the backtest job task and the partial result packet.\n        /// </summary>\n        /// <param name=\"job\">Job that started this request</param>\n        /// <param name=\"results\">Results class for the Backtest job</param>\n        /// <param name=\"endDate\">The algorithms backtest end date</param>\n        /// <param name=\"startDate\">The algorithms backtest start date</param>\n        /// <param name=\"progress\">Progress of the packet. For the packet we assume progess of 100%.</param>\n        public BacktestResultPacket(BacktestNodePacket job, BacktestResult results, DateTime endDate, DateTime startDate, decimal progress = 1m)\n            : this()\n        {\n            try\n            {\n                Progress = Math.Round(progress, 3);\n                SessionId = job.SessionId;\n                PeriodFinish = endDate;\n                PeriodStart = startDate;\n                CompileId = job.CompileId;\n                Channel = job.Channel;\n                BacktestId = job.BacktestId;\n                OptimizationId = job.OptimizationId;\n                Results = results;\n                Name = job.Name;\n                UserId = job.UserId;\n                ProjectId = job.ProjectId;\n                SessionId = job.SessionId;\n                TradeableDates = job.TradeableDates;\n            }\n            catch (Exception err) {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Creates an empty result packet, useful when the algorithm fails to initialize\n        /// </summary>\n        /// <param name=\"job\">The associated job packet</param>\n        /// <returns>An empty result packet</returns>\n        public static BacktestResultPacket CreateEmpty(BacktestNodePacket job)\n        {\n            return new BacktestResultPacket(job, new BacktestResult(new BacktestResultParameters(\n                new Dictionary<string, Chart>(), new Dictionary<int, Order>(), new Dictionary<DateTime, decimal>(),\n                new Dictionary<string, string>(), new SortedDictionary<string, string>(), new Dictionary<string, AlgorithmPerformance>(),\n                new List<OrderEvent>(), new AlgorithmPerformance(), new AlgorithmConfiguration(), new Dictionary<string, string>()\n            )), DateTime.UtcNow, DateTime.UtcNow);\n        }\n    } // End Queue Packet:\n\n\n    /// <summary>\n    /// Backtest results object class - result specific items from the packet.\n    /// </summary>\n    public class BacktestResult : Result\n    {\n        /// <summary>\n        /// Rolling window detailed statistics.\n        /// </summary>\n        public Dictionary<string, AlgorithmPerformance> RollingWindow { get; set; } = new Dictionary<string, AlgorithmPerformance>();\n\n        /// <summary>\n        /// Default Constructor\n        /// </summary>\n        public BacktestResult()\n        {\n        }\n\n        /// <summary>\n        /// Constructor for the result class using dictionary objects.\n        /// </summary>\n        public BacktestResult(BacktestResultParameters parameters) : base(parameters)\n        {\n            RollingWindow = parameters.RollingWindow;\n        }\n    }\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/BacktestResultParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"BacktestResult\"/>\n    /// </summary>\n    public class BacktestResultParameters : BaseResultParameters\n    {\n        /// <summary>\n        /// Rolling window detailed statistics.\n        /// </summary>\n        public Dictionary<string, AlgorithmPerformance> RollingWindow { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public BacktestResultParameters(IDictionary<string, Chart> charts,\n            IDictionary<int, Order> orders,\n            IDictionary<DateTime, decimal> profitLoss,\n            IDictionary<string, string> statistics,\n            IDictionary<string, string> runtimeStatistics,\n            Dictionary<string, AlgorithmPerformance> rollingWindow,\n            List<OrderEvent> orderEvents,\n            AlgorithmPerformance totalPerformance = null,\n            AlgorithmConfiguration algorithmConfiguration = null,\n            IDictionary<string, string> state = null)\n            : base(charts, orders, profitLoss, statistics, runtimeStatistics, orderEvents, totalPerformance, algorithmConfiguration, state)\n        {\n            RollingWindow = rollingWindow;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/BaseResultParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Statistics;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Base parameters used by <see cref=\"LiveResultParameters\"/> and <see cref=\"BacktestResultParameters\"/>\n    /// </summary>\n    public class BaseResultParameters\n    {\n        /// <summary>\n        /// Trade profit and loss information since the last algorithm result packet\n        /// </summary>\n        public IDictionary<DateTime, decimal> ProfitLoss { get; set; }\n\n        /// <summary>\n        /// Charts updates for the live algorithm since the last result packet\n        /// </summary>\n        public IDictionary<string, Chart> Charts { get; set; }\n\n        /// <summary>\n        /// Order updates since the last result packet\n        /// </summary>\n        public IDictionary<int, Order> Orders { get; set; }\n\n        /// <summary>\n        /// Order events updates since the last result packet\n        /// </summary>\n        public List<OrderEvent> OrderEvents { get; set; }\n\n        /// <summary>\n        /// Statistics information sent during the algorithm operations.\n        /// </summary>\n        public IDictionary<string, string> Statistics { get; set; }\n\n        /// <summary>\n        /// Runtime banner/updating statistics in the title banner of the live algorithm GUI.\n        /// </summary>\n        public IDictionary<string, string> RuntimeStatistics { get; set; }\n\n        /// <summary>\n        /// State information of the algorithm.\n        /// </summary>\n        public IDictionary<string, string> State { get; set; }\n\n        /// <summary>\n        /// The algorithm's configuration required for report generation\n        /// </summary>\n        public AlgorithmConfiguration AlgorithmConfiguration { get; set; }\n\n        /// <summary>\n        /// Rolling window detailed statistics.\n        /// </summary>\n        public AlgorithmPerformance TotalPerformance { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public BaseResultParameters(IDictionary<string, Chart> charts,\n            IDictionary<int, Order> orders,\n            IDictionary<DateTime, decimal> profitLoss,\n            IDictionary<string, string> statistics,\n            IDictionary<string, string> runtimeStatistics,\n            List<OrderEvent> orderEvents,\n            AlgorithmPerformance totalPerformance = null,\n            AlgorithmConfiguration algorithmConfiguration = null,\n            IDictionary<string, string> state = null)\n        {\n            Charts = charts;\n            Orders = orders;\n            ProfitLoss = profitLoss;\n            Statistics = statistics;\n            RuntimeStatistics = runtimeStatistics;\n            OrderEvents = orderEvents;\n            AlgorithmConfiguration = algorithmConfiguration;\n            State = state;\n            TotalPerformance = totalPerformance;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/Controls.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Specifies values used to control algorithm limits\n    /// </summary>\n    public class Controls\n    {\n        /// <summary>\n        /// The maximum runtime in minutes\n        /// </summary>\n        public int MaximumRuntimeMinutes { get; set; }\n\n        /// <summary>\n        /// The maximum number of minute symbols\n        /// </summary>\n        public int MinuteLimit { get; set; }\n\n        /// <summary>\n        /// The maximum number of second symbols\n        /// </summary>\n        public int SecondLimit { get; set; }\n\n        /// <summary>\n        /// The maximum number of tick symbol\n        /// </summary>\n        public int TickLimit { get; set; }\n\n        /// <summary>\n        /// Ram allocation for this algorithm in MB\n        /// </summary>\n        public int RamAllocation { get; set; }\n\n        /// <summary>\n        /// CPU allocation for this algorithm\n        /// </summary>\n        public decimal CpuAllocation {  get; set; }\n\n        /// <summary>\n        /// The user live log limit\n        /// </summary>\n        public int LiveLogLimit { get; set; }\n\n        /// <summary>\n        /// The user backtesting log limit\n        /// </summary>\n        public int BacktestLogLimit { get; set; }\n\n        /// <summary>\n        /// The daily log limit of a user\n        /// </summary>\n        public int DailyLogLimit { get; set; }\n\n        /// <summary>\n        /// The remaining log allowance for a user\n        /// </summary>\n        public int RemainingLogAllowance { get; set; }\n\n        /// <summary>\n        /// Maximimum number of insights we'll store and score in a single backtest\n        /// </summary>\n        public int BacktestingMaxInsights { get; set; }\n\n        /// <summary>\n        /// Maximimum number of orders we'll allow in a backtest.\n        /// </summary>\n        public int BacktestingMaxOrders { get; set; }\n\n        /// <summary>\n        /// Limits the amount of data points per chart series. Applies only for backtesting\n        /// </summary>\n        public int MaximumDataPointsPerChartSeries { get; set; }\n\n        /// <summary>\n        /// Limits the amount of chart series. Applies only for backtesting\n        /// </summary>\n        public int MaximumChartSeries { get; set; }\n\n        /// <summary>\n        /// The amount seconds used for timeout limits\n        /// </summary>\n        public int SecondTimeOut { get; set; }\n\n        /// <summary>\n        /// Sets parameters used for determining the behavior of the leaky bucket algorithm that\n        /// controls how much time is available for an algorithm to use the training feature.\n        /// </summary>\n        public LeakyBucketControlParameters TrainingLimits { get; set; }\n\n        /// <summary>\n        /// Limits the total size of storage used by <see cref=\"IObjectStore\"/>\n        /// </summary>\n        public long StorageLimit { get; set; }\n\n        /// <summary>\n        /// Limits the number of files to be held under the <see cref=\"IObjectStore\"/>\n        /// </summary>\n        public int StorageFileCount { get; set; }\n\n        /// <summary>\n        /// Holds the permissions for the object store\n        /// </summary>\n        public StoragePermissions StorageAccess { get; set; }\n\n        /// <summary>\n        /// The interval over which the <see cref=\"IObjectStore\"/> will persistence the contents of\n        /// the object store\n        /// </summary>\n        public int PersistenceIntervalSeconds { get; set; }\n\n        /// <summary>\n        /// The cost associated with running this job\n        /// </summary>\n        public decimal CreditCost { get; set; }\n\n        /// <summary>\n        /// Initializes a new default instance of the <see cref=\"Controls\"/> class\n        /// </summary>\n        public Controls()\n        {\n            MinuteLimit = 500;\n            SecondLimit = 100;\n            TickLimit = 30;\n            RamAllocation = 1024;\n            BacktestLogLimit = 10000;\n            BacktestingMaxOrders = int.MaxValue;\n            DailyLogLimit = 3000000;\n            RemainingLogAllowance = 10000;\n            MaximumRuntimeMinutes = 60 * 24 * 100; // 100 days default\n            BacktestingMaxInsights = 10000;\n            MaximumChartSeries = 10;\n            MaximumDataPointsPerChartSeries = 4000;\n            SecondTimeOut = 300;\n            StorageLimit = 10737418240;\n            StorageFileCount = 10000;\n            PersistenceIntervalSeconds = 5;\n            StorageAccess = new StoragePermissions();\n\n            // initialize to default leaky bucket values in case they're not specified\n            TrainingLimits = new LeakyBucketControlParameters();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/DebugPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Send a simple debug message from the users algorithm to the console.\n    /// </summary>\n    public class DebugPacket : Packet\n    {\n        /// <summary>\n        /// String debug message to send to the users console\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Associated algorithm Id.\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Compile id of the algorithm sending this message\n        /// </summary>\n        public string CompileId { get; set; }\n\n        /// <summary>\n        /// Project Id for this message\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// True to emit message as a popup notification (toast),\n        /// false to emit message in console as text\n        /// </summary>\n        public bool Toast { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public DebugPacket()\n            : base (PacketType.Debug)\n        { }\n\n        /// <summary>\n        /// Constructor for inherited types\n        /// </summary>\n        /// <param name=\"packetType\">The type of packet to create</param>\n        protected DebugPacket(PacketType packetType)\n            : base(packetType)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the notify debug packet:\n        /// </summary>\n        public DebugPacket(int projectId, string algorithmId, string compileId, string message, bool toast = false)\n            : base(PacketType.Debug)\n        {\n            ProjectId = projectId;\n            Message = message;\n            CompileId = compileId;\n            AlgorithmId = algorithmId;\n            Toast = toast;\n        }\n    \n    } // End Work Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/HandledErrorPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Algorithm runtime error packet from the lean engine. \n    /// This is a managed error which stops the algorithm execution.\n    /// </summary>\n    public class HandledErrorPacket : Packet\n    {\n        /// <summary>\n        /// Runtime error message from the exception\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Algorithm id which generated this runtime error\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Error stack trace information string passed through from the Lean exception\n        /// </summary>\n        public string StackTrace { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public HandledErrorPacket()\n            : base (PacketType.HandledError)\n        { }\n\n        /// <summary>\n        /// Create a new handled error packet\n        /// </summary>\n        public HandledErrorPacket(string algorithmId, string message, string stacktrace = \"\")\n            : base(PacketType.HandledError)\n        {\n            Message = message;\n            AlgorithmId = algorithmId;\n            StackTrace = stacktrace;\n        }\n    \n    } // End Work Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/HistoryPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Packet for history jobs\n    /// </summary>\n    public class HistoryPacket : Packet\n    {\n        /// <summary>\n        /// The queue where the data should be sent\n        /// </summary>\n        public string QueueName { get; set; }\n\n        /// <summary>\n        /// The individual requests to be processed\n        /// </summary>\n        public List<HistoryRequest> Requests { get; set; } = new List<HistoryRequest>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryPacket\"/> class\n        /// </summary>\n        public HistoryPacket()\n            : base(PacketType.History)\n        {\n        }\n    }\n\n    /// <summary>\n    /// Specifies request parameters for a single historical request.\n    /// A HistoryPacket is made of multiple requests for data. These\n    /// are used to request data during live mode from a data server\n    /// </summary>\n    public class HistoryRequest\n    {\n        /// <summary>\n        /// The start time to request data in UTC\n        /// </summary>\n        public DateTime StartTimeUtc { get; set; }\n\n        /// <summary>\n        /// The end time to request data in UTC\n        /// </summary>\n        public DateTime EndTimeUtc { get; set; }\n\n        /// <summary>\n        /// The symbol to request data for\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// The requested resolution\n        /// </summary>\n        public Resolution Resolution { get; set; }\n\n        /// <summary>\n        /// The type of data to retrieve\n        /// </summary>\n        public TickType TickType { get; set; }\n    }\n\n    /// <summary>\n    /// Specifies various types of history results\n    /// </summary>\n    public enum HistoryResultType\n    {\n        /// <summary>\n        /// The requested file data\n        /// </summary>\n        File,\n\n        /// <summary>\n        /// The request's status\n        /// </summary>\n        Status,\n\n        /// <summary>\n        /// The request is completed\n        /// </summary>\n        Completed,\n\n        /// <summary>\n        /// The request had an error\n        /// </summary>\n        Error\n    }\n\n    /// <summary>\n    /// Provides a container for results from history requests. This contains\n    /// the file path relative to the /Data folder where the data can be written\n    /// </summary>\n    public abstract class HistoryResult\n    {\n        /// <summary>\n        /// Gets the type of history result\n        /// </summary>\n        public HistoryResultType Type { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryResult\"/> class\n        /// </summary>\n        /// <param name=\"type\">The type of history result</param>\n        protected HistoryResult(HistoryResultType type)\n        {\n            Type = type;\n        }\n    }\n\n    /// <summary>\n    /// Defines requested file data for a history request\n    /// </summary>\n    public class FileHistoryResult : HistoryResult\n    {\n        /// <summary>\n        /// The relative file path where the data should be written\n        /// </summary>\n        public string Filepath { get; set; }\n\n        /// <summary>\n        /// The file's contents, this is a zipped csv file\n        /// </summary>\n        public byte[] File { get; set; }\n\n        /// <summary>\n        /// Default constructor for serializers\n        /// </summary>\n        public FileHistoryResult()\n            : base(HistoryResultType.File)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HistoryResult\"/> class\n        /// </summary>\n        /// <param name=\"filepath\">The relative file path where the file should be written, rooted in /Data, so for example ./forex/fxcm/daily/eurusd.zip</param>\n        /// <param name=\"file\">The zipped csv file content in bytes</param>\n        public FileHistoryResult(string filepath, byte[] file)\n            : this()\n        {\n            Filepath = filepath;\n            File = file;\n        }\n    }\n\n    /// <summary>\n    /// Specifies the completed message from a history result\n    /// </summary>\n    public class CompletedHistoryResult : HistoryResult\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"CompletedHistoryResult\"/> class\n        /// </summary>\n        public CompletedHistoryResult()\n            : base(HistoryResultType.Completed)\n        {\n        }\n    }\n\n    /// <summary>\n    /// Specfies an error message in a history result\n    /// </summary>\n    public class ErrorHistoryResult : HistoryResult\n    {\n        /// <summary>\n        /// Gets the error that was encountered\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Default constructor for serializers\n        /// </summary>\n        public ErrorHistoryResult()\n            : base(HistoryResultType.Error)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ErrorHistoryResult\"/> class\n        /// </summary>\n        /// <param name=\"message\">The error message</param>\n        public ErrorHistoryResult(string message)\n            : this()\n        {\n            Message = message;\n        }\n    }\n\n    /// <summary>\n    /// Specifies the progress of a request\n    /// </summary>\n    public class StatusHistoryResult : HistoryResult\n    {\n        /// <summary>\n        /// Gets the progress of the request\n        /// </summary>\n        public int Progress { get; set; }\n\n        /// <summary>\n        /// Default constructor for serializers\n        /// </summary>\n        public StatusHistoryResult()\n            : base(HistoryResultType.Status)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StatusHistoryResult\"/> class\n        /// </summary>\n        /// <param name=\"progress\">The progress, from 0 to 100</param>\n        public StatusHistoryResult(int progress)\n            : this()\n        {\n            Progress = progress;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/LeakyBucketControlParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Provides parameters that control the behavior of a leaky bucket rate limiting algorithm. The\n    /// parameter names below are phrased in the positive, such that the bucket is filled up over time\n    /// vs leaking out over time.\n    /// </summary>\n    public class LeakyBucketControlParameters\n    {\n        // defaults represent 2 hour max capacity refilling at one seventh the capacity (~17.2 => 18) each day.\n        // rounded up to 18 to prevent a very small decrease in refilling, IOW, if it's defaulting to 17, then\n        // after 7 days have passed, we'll end up being at 119 and not completely refilled, but at 18, on the 6th\n        // day we'll reach 108 and on the seventh day it will top off at 120 since it's not permitted to exceed the max\n        /// <summary>\n        /// Default capacity for leaky bucket\n        /// </summary>\n        public static int DefaultCapacity { get; set; } = Config.GetInt(\"scheduled-event-leaky-bucket-capacity\", 2 * 60);\n\n        /// <summary>\n        /// Default time interval\n        /// </summary>\n        public static int DefaultTimeInterval { get; set; } = Config.GetInt(\"scheduled-event-leaky-bucket-time-interval-minutes\", 1440);\n\n        /// <summary>\n        /// Default refill amount\n        /// </summary>\n        public static int DefaultRefillAmount { get; set; } = Config.GetInt(\"scheduled-event-leaky-bucket-refill-amount\", (int)Math.Ceiling(DefaultCapacity/7.0));\n\n        /// <summary>\n        /// Sets the total capacity of the bucket in a leaky bucket algorithm. This is the maximum\n        /// number of 'units' the bucket can hold and also defines the maximum burst rate, assuming\n        /// instantaneous usage of 'units'. In reality, the usage of 'units' takes times, and so it\n        /// is possible for the bucket to incrementally refill while consuming from the bucket.\n        /// </summary>\n        public int Capacity { get; set; }\n\n        /// <summary>\n        /// Sets the refill amount of the bucket. This defines the quantity of 'units' that become available\n        /// to a consuming entity after the time interval has elapsed. For example, if the refill amount is\n        /// equal to one, then each time interval one new 'unit' will be made available for a consumer that is\n        /// throttled by the leaky bucket.\n        /// </summary>\n        public int RefillAmount { get; set; }\n\n        /// <summary>\n        /// Sets the time interval for the refill amount of the bucket, in minutes. After this amount of wall-clock\n        /// time has passed, the bucket will refill the refill amount, thereby making more 'units' available\n        /// for a consumer. For example, if the refill amount equals 10 and the time interval is 30 minutes, then\n        /// every 30 minutes, 10 more 'units' become available for a consumer. The available 'units' will\n        /// continue to increase until the bucket capacity is reached.\n        /// </summary>\n        public int TimeIntervalMinutes { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeakyBucketControlParameters\"/> using default values\n        /// </summary>\n        public LeakyBucketControlParameters()\n        {\n            Capacity = DefaultCapacity;\n            RefillAmount = DefaultRefillAmount;\n            TimeIntervalMinutes = DefaultTimeInterval;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeakyBucketControlParameters\"/> with the specified value\n        /// </summary>\n        /// <param name=\"capacity\">The total capacity of the bucket in minutes</param>\n        /// <param name=\"refillAmount\">The number of additional minutes to add to the bucket\n        /// after <paramref name=\"timeIntervalMinutes\"/> has elapsed</param>\n        /// <param name=\"timeIntervalMinutes\">The interval, in minutes, that must pass before the <paramref name=\"refillAmount\"/>\n        /// is added back to the bucket for reuse</param>\n        public LeakyBucketControlParameters(int capacity, int refillAmount, int timeIntervalMinutes)\n        {\n            Capacity = capacity;\n            RefillAmount = refillAmount;\n            TimeIntervalMinutes = timeIntervalMinutes;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/LiveNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing QuantConnect.Notifications;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Live job task packet: container for any live specific job variables\n    /// </summary>\n    public class LiveNodePacket : AlgorithmNodePacket\n    {\n        /// <summary>\n        /// Deploy Id for this live algorithm.\n        /// </summary>\n        public string DeployId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// String name of the brokerage we're trading with\n        /// </summary>\n        public string Brokerage { get; set; } = string.Empty;\n\n        /// <summary>\n        /// String-String Dictionary of Brokerage Data for this Live Job\n        /// </summary>\n        public Dictionary<string, string> BrokerageData { get; set; } = new Dictionary<string, string>();\n\n        /// <summary>\n        /// String name of the DataQueueHandler or LiveDataProvider we're running with\n        /// </summary>\n        public string DataQueueHandler { get; set; } = string.Empty;\n\n        /// <summary>\n        /// String name of the DataChannelProvider we're running with\n        /// </summary>\n        public string DataChannelProvider { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Gets flag indicating whether or not the message should be acknowledged and removed from the queue\n        /// </summary>\n        public bool DisableAcknowledgement { get; set; }\n\n        /// <summary>\n        /// A list of event types to generate notifications for, which will use <see cref=\"NotificationTargets\"/>\n        /// </summary>\n        public HashSet<string> NotificationEvents { get; set; }\n\n        /// <summary>\n        /// A list of notification targets to use\n        /// </summary>\n        public List<Notification> NotificationTargets { get; set; }\n\n        /// <summary>\n        /// List of real time data types available in the live trading environment\n        /// </summary>\n        public HashSet<string> LiveDataTypes { get; set; }\n\n        /// <summary>\n        /// Algorithm running mode.\n        /// </summary>\n        [JsonIgnore]\n        public override AlgorithmMode AlgorithmMode\n        {\n            get\n            {\n                return AlgorithmMode.Live;\n            }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON of the Live Task Packet\n        /// </summary>\n        public LiveNodePacket()\n            : base(PacketType.LiveNode)\n        {\n            Controls = new Controls\n            {\n                MinuteLimit = 100,\n                SecondLimit = 50,\n                TickLimit = 25,\n                RamAllocation = 512\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/LiveResultPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Live result packet from a lean engine algorithm.\n    /// </summary>\n    public class LiveResultPacket : Packet\n    {\n        /// <summary>\n        /// User Id sending result packet\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// <summary>\n        /// Project Id of the result packet\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Live Algorithm Id (DeployId) for this result packet\n        /// </summary>\n        public string DeployId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Result data object for this result packet\n        /// </summary>\n        public LiveResult Results { get; set; } = new LiveResult();\n\n        /// <summary>\n        /// Default constructor for JSON Serialization\n        /// </summary>\n        public LiveResultPacket()\n            : base(PacketType.LiveResult)\n        { }\n\n        /// <summary>\n        /// Compose the packet from a JSON string:\n        /// </summary>\n        public LiveResultPacket(string json)\n            : base(PacketType.LiveResult)\n        {\n            try\n            {\n                var packet = JsonConvert.DeserializeObject<LiveResultPacket>(json);\n                Channel            = packet.Channel;\n                DeployId           = packet.DeployId;\n                Type               = packet.Type;\n                UserId             = packet.UserId;\n                ProjectId          = packet.ProjectId;\n                Results            = packet.Results;\n            }\n            catch (Exception err)\n            {\n                Log.Trace($\"LiveResultPacket(): Error converting json: {err}\");\n            }\n        }\n\n        /// <summary>\n        /// Compose Live Result Data Packet - With tradable dates\n        /// </summary>\n        /// <param name=\"job\">Job that started this request</param>\n        /// <param name=\"results\">Results class for the Backtest job</param>\n        public LiveResultPacket(LiveNodePacket job, LiveResult results)\n            :base (PacketType.LiveResult)\n        {\n            try\n            {\n                DeployId = job.DeployId;\n                Results = results;\n                UserId = job.UserId;\n                ProjectId = job.ProjectId;\n                Channel = job.Channel;\n            }\n            catch (Exception err) {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Creates an empty result packet, useful when the algorithm fails to initialize\n        /// </summary>\n        /// <param name=\"job\">The associated job packet</param>\n        /// <returns>An empty result packet</returns>\n        public static LiveResultPacket CreateEmpty(LiveNodePacket job)\n        {\n            return new LiveResultPacket(job, new LiveResult(new LiveResultParameters(\n                new Dictionary<string, Chart>(), new Dictionary<int, Order>(), new Dictionary<DateTime, decimal>(),\n                new Dictionary<string, Holding>(), new CashBook(), new Dictionary<string, string>(),\n                new SortedDictionary<string, string>(), new List<OrderEvent>(), null, new Dictionary<string, string>(),\n                new AlgorithmConfiguration(), new Dictionary<string, string>())));\n        }\n    } // End Queue Packet:\n\n\n    /// <summary>\n    /// Live results object class for packaging live result data.\n    /// </summary>\n    public class LiveResult : Result\n    {\n        private CashBook _cashBook;\n\n        /// <summary>\n        /// Holdings dictionary of algorithm holdings information\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, Holding> Holdings { get; set; }\n\n        /// <summary>\n        /// Cashbook for the algorithm's live results.\n        /// </summary>\n        [JsonIgnore]\n        public CashBook CashBook\n        {\n            get\n            {\n                return _cashBook;\n            }\n            set\n            {\n                _cashBook = value;\n\n                Cash = _cashBook?.ToDictionary(pair => pair.Key, pair => pair.Value);\n                AccountCurrency = CashBook?.AccountCurrency;\n                AccountCurrencySymbol = AccountCurrency != null ? Currencies.GetCurrencySymbol(AccountCurrency) : null;\n            }\n        }\n\n        /// <summary>\n        /// Cash for the algorithm's live results.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public Dictionary<string, Cash> Cash { get; set; }\n\n        /// <summary>\n        /// The algorithm's account currency\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public string AccountCurrency { get; set; }\n\n        /// <summary>\n        /// The algorithm's account currency\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public string AccountCurrencySymbol { get; set; }\n\n        /// <summary>\n        /// Default Constructor\n        /// </summary>\n        public LiveResult()\n        { }\n\n        /// <summary>\n        /// Constructor for the result class for dictionary objects\n        /// </summary>\n        public LiveResult(LiveResultParameters parameters) : base(parameters)\n        {\n            Holdings = parameters.Holdings;\n            CashBook = parameters.CashBook;\n        }\n    }\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/LiveResultParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"LiveResult\"/>\n    /// </summary>\n    public class LiveResultParameters : BaseResultParameters\n    {\n        /// <summary>\n        /// Holdings dictionary of algorithm holdings information\n        /// </summary>\n        public IDictionary<string, Holding> Holdings { get; set; }\n\n        /// <summary>\n        /// Cashbook for the algorithm's live results.\n        /// </summary>\n        public CashBook CashBook { get; set; }\n\n        /// <summary>\n        /// Server status information, including CPU/RAM usage, ect...\n        /// </summary>\n        public IDictionary<string, string> ServerStatistics { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public LiveResultParameters(IDictionary<string, Chart> charts,\n            IDictionary<int, Order> orders,\n            IDictionary<DateTime, decimal> profitLoss,\n            IDictionary<string, Holding> holdings,\n            CashBook cashBook,\n            IDictionary<string, string> statistics,\n            IDictionary<string, string> runtimeStatistics,\n            List<OrderEvent> orderEvents,\n            AlgorithmPerformance totalPerformance = null,\n            IDictionary<string, string> serverStatistics = null,\n            AlgorithmConfiguration algorithmConfiguration = null,\n            IDictionary<string, string> state = null)\n            : base(charts, orders, profitLoss, statistics, runtimeStatistics, orderEvents, totalPerformance, algorithmConfiguration, state)\n        {\n            Holdings = holdings;\n            CashBook = cashBook;\n            ServerStatistics = serverStatistics ?? OS.GetServerStatistics();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/LogPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Simple log message instruction from the lean engine.\n    /// </summary>\n    public class LogPacket : Packet\n    {\n        /// <summary>\n        /// Log message to the users console:\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Algorithm Id requesting this logging\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public LogPacket()\n            : base (PacketType.Log)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the notify Log packet:\n        /// </summary>\n        public LogPacket(string algorithmId, string message)\n            : base(PacketType.Log)\n        {\n            Message = message;\n            AlgorithmId = algorithmId;\n        }\n    \n    } // End Work Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/MarketTodayPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n\n    /// <summary>\n    /// Market today information class\n    /// </summary>\n    public class MarketToday\n    {\n        /// <summary>\n        /// Date this packet was generated.\n        /// </summary>\n        [JsonProperty(PropertyName = \"date\")]\n        public DateTime Date { get; set; }\n\n        /// <summary>\n        /// Given the dates and times above, what is the current market status - open or closed.\n        /// </summary>\n        [JsonProperty(PropertyName = \"status\")]\n        public string Status { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Premarket hours for today\n        /// </summary>\n        [JsonProperty(PropertyName = \"premarket\")]\n        public MarketHours PreMarket { get; set; }\n\n        /// <summary>\n        /// Normal trading market hours for today\n        /// </summary>\n        [JsonProperty(PropertyName = \"open\")]\n        public MarketHours Open { get; set; }\n\n        /// <summary>\n        /// Post market hours for today\n        /// </summary>\n        [JsonProperty(PropertyName = \"postmarket\")]\n        public MarketHours PostMarket { get; set; }\n\n        /// <summary>\n        /// Default constructor (required for JSON serialization)\n        /// </summary>\n        public MarketToday()\n        { }\n    }\n\n    /// <summary>\n    /// Market open hours model for pre, normal and post market hour definitions.\n    /// </summary>\n    public class MarketHours\n    {\n        /// <summary>\n        /// Start time for this market hour category\n        /// </summary>\n        [JsonProperty(PropertyName = \"start\")]\n        public DateTime Start { get; set; }\n\n        /// <summary>\n        /// End time for this market hour category\n        /// </summary>\n        [JsonProperty(PropertyName = \"end\")]\n        public DateTime End { get; set; }\n\n        /// <summary>\n        /// Market hours initializer given an hours since midnight measure for the market hours today\n        /// </summary>\n        /// <param name=\"referenceDate\">Reference date used for as base date from the specified hour offsets</param>\n        /// <param name=\"defaultStart\">Time in hours since midnight to start this open period.</param>\n        /// <param name=\"defaultEnd\">Time in hours since midnight to end this open period.</param>\n        public MarketHours(DateTime referenceDate, double defaultStart, double defaultEnd)\n        {\n            Start = referenceDate.Date.AddHours(defaultStart);\n            End = referenceDate.Date.AddHours(defaultEnd);\n            if (defaultEnd == 24)\n            {\n                // when we mark it as the end of the day other code that relies on .TimeOfDay has issues\n                End = End.AddTicks(-1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/OrderEventPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Order event packet for passing updates on the state of an order to the portfolio. \n    /// </summary>\n    /// <remarks>As an order is updated in pieces/partial fills the order fill price is passed back to the Algorithm Portfolio method</remarks>\n    public class OrderEventPacket : Packet\n    {\n        /// <summary>\n        /// Order event object\n        /// </summary>\n        public OrderEvent Event { get; set; }\n\n        /// <summary>\n        /// Algorithm id for this order event\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public OrderEventPacket()\n            : base (PacketType.OrderEvent)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the order event packet\n        /// </summary>\n        public OrderEventPacket(string algorithmId, OrderEvent eventOrder)\n            : base(PacketType.OrderEvent)\n        {\n            AlgorithmId = algorithmId;\n            Event = eventOrder;\n        }\n    \n    } // End Order Event Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/Packet.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Base class for packet messaging system\n    /// </summary>\n    public class Packet\n    {\n        /// <summary>\n        /// Packet type defined by a string enum\n        /// </summary>\n        public PacketType Type { get; set; } = PacketType.None;\n\n        /// <summary>\n        /// User unique specific channel endpoint to send the packets\n        /// </summary>\n        public virtual string Channel { get; set; } = \"\";\n\n        /// <summary>\n        /// Initialize the base class and setup the packet type.\n        /// </summary>\n        /// <param name=\"type\">PacketType for the class.</param>\n        public Packet(PacketType type)\n        {\n            Channel = \"\";\n            Type = type;\n        }\n    }\n\n    /// <summary>\n    /// Classifications of internal packet system\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum PacketType\n    {\n        /// <summary>\n        /// Default, unset:\n        /// </summary>\n        None,\n\n        /// <summary>\n        /// Base type for backtest and live work\n        /// </summary>\n        AlgorithmNode,\n\n        /// <summary>\n        /// Autocomplete Work Packet\n        /// </summary>\n        AutocompleteWork,\n\n        /// <summary>\n        /// Result of the Autocomplete Job:\n        /// </summary>\n        AutocompleteResult,\n\n        /// <summary>\n        /// Controller->Backtest Node Packet:\n        /// </summary>\n        BacktestNode,\n\n        /// <summary>\n        /// Packet out of backtest node:\n        /// </summary>\n        BacktestResult,\n\n        /// <summary>\n        /// API-> Controller Work Packet:\n        /// </summary>\n        BacktestWork,\n\n        /// <summary>\n        /// Controller -> Live Node Packet:\n        /// </summary>\n        LiveNode,\n\n        /// <summary>\n        /// Live Node -> User Packet:\n        /// </summary>\n        LiveResult,\n\n        /// <summary>\n        /// API -> Controller Packet:\n        /// </summary>\n        LiveWork,\n\n        /// <summary>\n        /// Node -> User Algo Security Types\n        /// </summary>\n        SecurityTypes,\n\n        /// <summary>\n        /// Controller -> User Error in Backtest Settings:\n        /// </summary>\n        BacktestError,\n\n        /// <summary>\n        /// Nodes -> User Algorithm Status Packet:\n        /// </summary>\n        AlgorithmStatus,\n\n        /// <summary>\n        /// API -> Compiler Work Packet:\n        /// </summary>\n        BuildWork,\n\n        /// <summary>\n        /// Compiler -> User Build Success\n        /// </summary>\n        BuildSuccess,\n\n        /// <summary>\n        /// Compiler -> User, Compile Error\n        /// </summary>\n        BuildError,\n\n        /// <summary>\n        /// Node -> User Algorithm Runtime Error\n        /// </summary>\n        RuntimeError,\n\n        /// <summary>\n        /// Error is an internal handled error packet inside users algorithm\n        /// </summary>\n        HandledError,\n\n        /// <summary>\n        /// Nodes -> User Log Message\n        /// </summary>\n        Log,\n\n        /// <summary>\n        /// Nodes -> User Debug Message\n        /// </summary>\n        Debug,\n\n        /// <summary>\n        /// Nodes -> User, Order Update Event\n        /// </summary>\n        OrderEvent,\n\n        /// <summary>\n        /// Boolean true/false success\n        /// </summary>\n        Success,\n\n        /// <summary>\n        /// History live job packets\n        /// </summary>\n        History,\n\n        /// <summary>\n        /// Result from a command\n        /// </summary>\n        CommandResult,\n\n        /// <summary>\n        /// Hook from git hub\n        /// </summary>\n        GitHubHook,\n\n        /// <summary>\n        /// Documentation result from docs server\n        /// </summary>\n        DocumentationResult,\n\n        /// <summary>\n        /// Documentation request to the docs server\n        /// </summary>\n        Documentation,\n\n        /// <summary>\n        /// Debug packet generated by Lean\n        /// </summary>\n        SystemDebug,\n\n        /// <summary>\n        /// Packet containing insights generated by the algorithm\n        /// </summary>\n        AlphaResult,\n\n        /// <summary>\n        /// Alpha API -> Controller packet\n        /// </summary>\n        AlphaWork,\n\n        /// <summary>\n        /// Alpha Controller -> Alpha Node packet\n        /// </summary>\n        AlphaNode,\n\n        /// <summary>\n        /// Packet containing list of algorithms to run as a regression test\n        /// </summary>\n        RegressionAlgorithm,\n\n        /// <summary>\n        /// Packet containing a heartbeat\n        /// </summary>\n        AlphaHeartbeat,\n\n        /// <summary>\n        /// Used when debugging to send status updates\n        /// </summary>\n        DebuggingStatus,\n\n        /// <summary>\n        /// Optimization Node Packet:\n        /// </summary>\n        OptimizationNode,\n\n        /// <summary>\n        /// Optimization Estimate Packet:\n        /// </summary>\n        OptimizationEstimate,\n\n        /// <summary>\n        /// Optimization work status update\n        /// </summary>\n        OptimizationStatus,\n\n        /// <summary>\n        /// Optimization work result\n        /// </summary>\n        OptimizationResult,\n\n        /// <summary>\n        /// Aggregated packets\n        /// </summary>\n        Aggregated,\n\n        /// <summary>\n        /// Query the language model\n        /// </summary>\n        LanguageModelQuery,\n\n        /// <summary>\n        /// Send feedback to a language model response\n        /// </summary>\n        LanguageModelFeedback,\n\n        /// <summary>\n        /// The language models response\n        /// </summary>\n        LanguageModelResponse,\n\n        /// <summary>\n        /// Language model code analysis\n        /// </summary>\n        LanguageModelCodeAnalysis,\n\n        /// <summary>\n        /// Language model chat work\n        /// </summary>\n        LanguageModelChatWork,\n\n        /// <summary>\n        /// Language model chat response\n        /// </summary>\n        LanguageModelChatResponse,\n\n        /// <summary>\n        /// Algorithm name update\n        /// </summary>\n        AlgorithmNameUpdate,\n\n        /// <summary>\n        /// Algorithm tags update\n        /// </summary>\n        AlgorithmTagsUpdate,\n\n        /// <summary>\n        /// Research job packet\n        /// </summary>\n        ResearchNode,\n\n        /// <summary>\n        /// Organization update\n        /// </summary>\n        OrganizationUpdate,\n\n        /// <summary>\n        /// Compiler -> User Build Warnings\n        /// </summary>\n        BuildWarning,\n\n        /// <summary>\n        /// Language model function call related packet\n        /// </summary>\n        LanguageModelFunctionCall,\n\n        /// <summary>\n        /// Language model agent message\n        /// </summary>\n        LanguageModelAgentMessage,\n\n        /// <summary>\n        /// Agent job packet\n        /// </summary>\n        AgentNode\n    }\n}\n"
  },
  {
    "path": "Common/Packets/PythonEnvironmentPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Python Environment Packet is an abstract packet that contains a PythonVirtualEnvironment\n    /// definition. Intended to be used by inheriting classes that may use a PythonVirtualEnvironment\n    /// </summary>\n    public abstract class PythonEnvironmentPacket : Packet\n    {\n        /// <summary>\n        /// Default constructor for a PythonEnvironmentPacket\n        /// </summary>\n        /// <param name=\"type\"></param>\n        protected PythonEnvironmentPacket(PacketType type) : base(type)\n        {\n        }\n\n        /// <summary>\n        /// Virtual environment ID used to find PythonEvironments\n        /// Ideally MD5, but environment names work as well.\n        /// </summary>\n        public string PythonVirtualEnvironment { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/ResearchNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Represents a research node packet\n    /// </summary>\n    public class ResearchNodePacket : AlgorithmNodePacket\n    {\n        /// <summary>\n        /// The research id\n        /// </summary>\n        public string ResearchId { get; set; }\n\n        /// <summary>\n        /// Associated research token\n        /// </summary>\n        public string ResearchToken { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public ResearchNodePacket() : base(PacketType.ResearchNode)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/RuntimeErrorPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Algorithm runtime error packet from the lean engine. \n    /// This is a managed error which stops the algorithm execution.\n    /// </summary>\n    public class RuntimeErrorPacket : Packet\n    {\n        /// <summary>\n        /// Runtime error message from the exception\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Algorithm id which generated this runtime error\n        /// </summary>\n        public string AlgorithmId { get; set; }\n\n        /// <summary>\n        /// Error stack trace information string passed through from the Lean exception\n        /// </summary>\n        public string StackTrace { get; set; }\n\n        /// <summary>\n        /// User Id associated with the backtest that threw the error\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public RuntimeErrorPacket()\n            : base (PacketType.RuntimeError)\n        { }\n\n        /// <summary>\n        /// Create a new runtime error packet\n        /// </summary>\n        public RuntimeErrorPacket(int userId, string algorithmId, string message, string stacktrace = \"\")\n            : base(PacketType.RuntimeError)\n        {\n            UserId = userId;\n            Message = message;\n            AlgorithmId = algorithmId;\n            StackTrace = stacktrace;\n        }\n    \n    } // End Work Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/SecurityTypesPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Security types packet contains information on the markets the user data has requested.\n    /// </summary>\n    public class SecurityTypesPacket : Packet\n    {\n        /// <summary>\n        /// List of Security Type the user has requested (Equity, Forex, Futures etc).\n        /// </summary>\n        public List<SecurityType> Types { get; set; } = new List<SecurityType>();\n\n        /// <summary>\n        /// CSV formatted, lower case list of SecurityTypes for the web API.\n        /// </summary>\n        public string TypesCSV\n        {\n            get\n            {\n                var result = \"\";\n                foreach (var type in Types)\n                {\n                    result += type + \",\";\n                }\n                result = result.TrimEnd(',');\n                return result.ToLowerInvariant();\n            }\n        }\n\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public SecurityTypesPacket()\n            : base (PacketType.SecurityTypes)\n        { }\n\n    } // End Work Packet:\n\n} // End of Namespace:\n"
  },
  {
    "path": "Common/Packets/StoragePermissions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Holds the permissions for the object store\n    /// </summary>\n    public class StoragePermissions\n    {\n        /// <summary>\n        /// Whether the user has read permissions on the object store\n        /// </summary>\n        public bool Read { get; set; }\n\n        /// <summary>\n        /// Whether the user has write permissions on the object store\n        /// </summary>\n        public bool Write { get; set; }\n\n        /// <summary>\n        /// Whether the user has delete permissions on the object store\n        /// </summary>\n        public bool Delete { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StoragePermissions\"/> struct with default permissions.\n        /// </summary>\n        public StoragePermissions()\n        {\n            // default permissions for controls storage\n            Read = true;\n            Write = true;\n            Delete = true;\n        }\n\n        /// <summary>\n        /// Returns a string representation of the storage permissions.\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"Read={Read} Write={Write} Delete={Delete}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Packets/SystemDebugPacket.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Packets\n{\n    /// <summary>\n    /// Debug packets generated by Lean\n    /// </summary>\n    public class SystemDebugPacket : DebugPacket\n    {\n        /// <summary>\n        /// Default constructor for JSON\n        /// </summary>\n        public SystemDebugPacket()\n            : base (PacketType.SystemDebug)\n        { }\n\n        /// <summary>\n        /// Create a new instance of the system debug packet\n        /// </summary>\n        public SystemDebugPacket(int projectId, string algorithmId, string compileId, string message, bool toast = false)\n            : base(PacketType.SystemDebug)\n        {\n            ProjectId = projectId;\n            Message = message;\n            CompileId = compileId;\n            AlgorithmId = algorithmId;\n            Toast = toast;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/PandasMapper.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n'''\nLean Pandas Remapper\nWraps key indexing functions of Pandas to remap keys to SIDs when accessing dataframes.\nAllowing support for indexing of Lean created Indexes with tickers like \"SPY\", Symbol objs, and SIDs\n\n'''\n\nimport pandas as pd\nfrom pandas.core.indexes.frozen import FrozenList as pdFrozenList\n\nfrom clr import AddReference\nAddReference(\"QuantConnect.Common\")\nfrom QuantConnect import *\n\nclass PandasColumn(str):\n    '''\n    PandasColumn is a wrapper class for a pandas column that allows for the column to be used as a key\n    and properly compared to strings, regardless of whether it's a C# or Python string\n    (since the hash of a C# string and the same Python string are different).\n    '''\n\n    def __new__(cls, key):\n        return super().__new__(cls, key)\n\n    def __eq__(self, other):\n        # We need this since Lean created data frames might contain Symbol objects in the indexes\n        return super().__eq__(other) and type(other) is not Symbol\n\n    def __hash__(self):\n        return super().__hash__()\n\ndef mapper(key):\n    '''Maps a Symbol object or a Symbol Ticker (string) to the string representation of\n    Symbol SecurityIdentifier.If cannot map, returns the object\n    '''\n    keyType = type(key)\n    if keyType is tuple:\n        return tuple(mapper(x) for x in key)\n    if keyType is str:\n        kvp = SymbolCache.try_get_symbol(key, None)\n        if kvp[0]:\n            return kvp[1]\n        return key\n    if keyType is list:\n        return [mapper(x) for x in key]\n    if keyType is dict:\n        return {k: mapper(v) for k, v in key.items()}\n    return key\n\ndef wrap_keyerror_function(f):\n    '''Wraps function f with wrapped_function, used for functions that throw KeyError when not found.\n    wrapped_function converts the args / kwargs to use alternative index keys and then calls the function.\n    If this fails we fall back to the original key and try it as well, if they both fail we throw our error.\n    '''\n    def wrapped_function(*args, **kwargs):\n        # Map args & kwargs and execute function\n        try:\n            newargs = args\n            newkwargs = kwargs\n\n            if len(args) > 1:\n                newargs = mapper(args)\n            if len(kwargs) > 0:\n                newkwargs = mapper(kwargs)\n\n            return f(*newargs, **newkwargs)\n        except KeyError as e:\n            pass\n\n        # Execute original\n        # Allows for df, Series, etc indexing for keys like 'SPY' if they exist\n        try:\n            return f(*args, **kwargs)\n        except KeyError as e:\n            mKey = [str(arg) for arg in newargs if isinstance(arg, str) or isinstance(arg, Symbol)]\n            oKey = [str(arg) for arg in args if isinstance(arg, str) or isinstance(arg, Symbol)]\n            raise KeyError(f\"No key found for either mapped or original key. Mapped Key: {mKey}; Original Key: {oKey}\")\n\n    wrapped_function.__name__ = f.__name__\n    return wrapped_function\n\ndef wrap_bool_function(f):\n    '''Wraps function f with wrapped_function, used for functions that reply true/false if key is found.\n    wrapped_function attempts with the original args, if its false, it converts the args / kwargs to use\n    alternative index keys and then attempts with the mapped args.\n    '''\n    def wrapped_function(*args, **kwargs):\n\n        # Try the original args; if true just return true\n        originalResult = f(*args, **kwargs)\n        if originalResult:\n            return originalResult\n\n        # Try our mapped args; return this result regardless\n        newargs = args\n        newkwargs = kwargs\n\n        if len(args) > 1:\n            newargs = mapper(args)\n        if len(kwargs) > 0:\n            newkwargs = mapper(kwargs)\n\n        return f(*newargs, **newkwargs)\n\n    wrapped_function.__name__ = f.__name__\n    return wrapped_function\n\n\n# Wrap all core indexing functions that are shared, yet still throw key errors if index not found\npd.core.indexing._LocationIndexer.__getitem__ = wrap_keyerror_function(pd.core.indexing._LocationIndexer.__getitem__)\npd.core.indexing._ScalarAccessIndexer.__getitem__ = wrap_keyerror_function(pd.core.indexing._ScalarAccessIndexer.__getitem__)\npd.core.indexes.base.Index.get_loc = wrap_keyerror_function(pd.core.indexes.base.Index.get_loc)\n\n# Wrap our DF _getitem__ as well, even though most pathways go through the above functions\n# There are cases like indexing with an array that need to be mapped earlier to stop KeyError from arising\npd.core.frame.DataFrame.__getitem__ = wrap_keyerror_function(pd.core.frame.DataFrame.__getitem__)\n\n# For older version of pandas we may need to wrap extra functions\nif (int(pd.__version__.split('.')[0]) < 1):\n    pd.core.indexes.base.Index.get_value = wrap_keyerror_function(pd.core.indexes.base.Index.get_value)\n\n# Special cases where we need to wrap a function that won't throw a keyerror when not found but instead returns true or false\n# Wrap __contains__ to support Python syntax like 'SPY' in DataFrame\npd.core.indexes.base.Index.__contains__ = wrap_bool_function(pd.core.indexes.base.Index.__contains__)\n\n# For compatibility with PandasData.cs usage of this module (Previously wrapped classes)\nFrozenList = pdFrozenList\nIndex = pd.Index\nMultiIndex = pd.MultiIndex\nSeries = pd.Series\nDataFrame = pd.DataFrame\n"
  },
  {
    "path": "Common/Parameters/ParameterAttribute.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Parameters\n{\n    /// <summary>\n    /// Specifies a field or property is a parameter that can be set\n    /// from an <see cref=\"AlgorithmNodePacket.Parameters\"/> dictionary\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]\n    public class ParameterAttribute : Attribute\n    {\n        /// <summary>\n        /// Specifies the binding flags used by this implementation to resolve parameter attributes\n        /// </summary>\n        public const BindingFlags BindingFlags = System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance;\n\n        /// <summary>\n        /// Gets the name of this parameter\n        /// </summary>\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ParameterAttribute\"/> class\n        /// </summary>\n        /// <param name=\"name\">The name of the parameter. If null is specified\n        /// then the field or property name will be used</param>\n        public ParameterAttribute(string name = null)\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        /// Uses reflections to inspect the instance for any parameter attributes.\n        /// If a value is found in the parameters dictionary, it is set.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters dictionary</param>\n        /// <param name=\"instance\">The instance to set parameters on</param>\n        public static void ApplyAttributes(Dictionary<string, string> parameters, object instance)\n        {\n            if (instance == null) throw new ArgumentNullException(nameof(instance));\n\n            var type = instance.GetType();\n\n            // get all fields/properties on the instance\n            var members = type.GetFields(BindingFlags).Concat<MemberInfo>(type.GetProperties(BindingFlags));\n            foreach (var memberInfo in members)\n            {\n                var fieldInfo = memberInfo as FieldInfo;\n                var propertyInfo = memberInfo as PropertyInfo;\n\n                // this line make static analysis a little happier, but should never actually throw\n                if (fieldInfo == null && propertyInfo == null)\n                {\n                    throw new InvalidOperationException(\"Resolved member that is neither FieldInfo or PropertyInfo\");\n                }\n\n                // check the member for our custom attribute\n                var attribute = memberInfo.GetCustomAttribute<ParameterAttribute>();\n                if (attribute == null) continue;\n\n                // if no name is specified in the attribute then use the member name\n                var parameterName = attribute.Name ?? memberInfo.Name;\n\n                // get the parameter string value to apply to the member\n                string parameterValue;\n                if (!parameters.TryGetValue(parameterName, out parameterValue)) continue;\n\n                if (string.IsNullOrEmpty(parameterValue))\n                {\n                    Log.Error($\"ParameterAttribute.ApplyAttributes(): parameter '{parameterName}' provided value is null/empty, skipping\");\n                    continue;\n                }\n\n                // if it's a read-only property with a parameter value we can't really do anything, bail\n                if (propertyInfo != null && !propertyInfo.CanWrite)\n                {\n                    var message = $\"The specified property is read only: {propertyInfo.DeclaringType}.{propertyInfo.Name}\";\n                    throw new InvalidOperationException(message);\n                }\n\n                // resolve the member type\n                var memberType = fieldInfo != null ? fieldInfo.FieldType : propertyInfo.PropertyType;\n\n                // convert the parameter string value to the member type\n                var value = parameterValue.ConvertTo(memberType);\n\n                // set the value to the field/property\n                if (fieldInfo != null)\n                {\n                    fieldInfo.SetValue(instance, value);\n                }\n                else\n                {\n                    propertyInfo.SetValue(instance, value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Resolves all parameter attributes from the specified compiled assembly path\n        /// </summary>\n        /// <param name=\"assembly\">The assembly to inspect</param>\n        /// <returns>Parameters dictionary keyed by parameter name with a value of the member type</returns>\n        public static Dictionary<string, string> GetParametersFromAssembly(Assembly assembly)\n        {\n            var parameters = new Dictionary<string, string>();\n            foreach (var type in assembly.GetTypes())\n            {\n                foreach (var kvp in GetParametersFromType(type))\n                {\n                    parameters[kvp.Key] = kvp.Value;\n                }\n            }\n            return parameters;\n        }\n\n        /// <summary>\n        /// Resolves all parameter attributes from the specified type\n        /// </summary>\n        /// <param name=\"type\">The type to inspect</param>\n        /// <returns>Parameters dictionary keyed by parameter name with a value of the member type</returns>\n        public static IEnumerable<KeyValuePair<string, string>> GetParametersFromType(Type type)\n        {\n            foreach (var field in type.GetFields(BindingFlags))\n            {\n                var attribute = field.GetCustomAttribute<ParameterAttribute>();\n                if (attribute != null)\n                {\n                    var parameterName = attribute.Name ?? field.Name;\n                    yield return new KeyValuePair<string, string>(parameterName, field.FieldType.GetBetterTypeName());\n                }\n            }\n\n            foreach (var property in type.GetProperties(BindingFlags))\n            {\n                // ignore non-writeable properties\n                if (!property.CanWrite) continue;\n                var attribute = property.GetCustomAttribute<ParameterAttribute>();\n                if (attribute != null)\n                {\n                    var parameterName = attribute.Name ?? property.Name;\n                    yield return new KeyValuePair<string, string>(parameterName, property.PropertyType.GetBetterTypeName());\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Parse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides methods for parsing strings using <see cref=\"CultureInfo.InvariantCulture\"/>\n    /// </summary>\n    public static class Parse\n    {\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"System.TimeSpan\"/> using <see cref=\"System.TimeSpan.Parse(string,IFormatProvider)\"/>\n        /// with <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static TimeSpan TimeSpan(string value)\n        {\n            return System.TimeSpan.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"System.TimeSpan\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, out TimeSpan value)\n        {\n            return System.TimeSpan.TryParse(input, CultureInfo.InvariantCulture, out value);\n\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"System.TimeSpan\"/>, format\n        /// string, <see cref=\"TimeSpanStyles\"/>, and using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        /// <param name=\"input\"></param>\n        /// <param name=\"format\"></param>\n        /// <param name=\"timeSpanStyle\"></param>\n        /// <param name=\"value\"></param>\n        /// <returns></returns>\n        public static bool TryParseExact(string input, string format, TimeSpanStyles timeSpanStyle, out TimeSpan value)\n        {\n            return System.TimeSpan.TryParseExact(input, format, CultureInfo.InvariantCulture, timeSpanStyle, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"System.DateTime\"/> using <see cref=\"System.DateTime.Parse(string,IFormatProvider)\"/>\n        /// with <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static DateTime DateTime(string value)\n        {\n            return System.DateTime.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"System.DateTime\"/> using <see cref=\"System.DateTime.ParseExact(string,string,IFormatProvider)\"/>\n        /// with the specified <paramref name=\"format\"/> and <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static DateTime DateTimeExact(string value, string format)\n        {\n            return System.DateTime.ParseExact(value, format, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"System.DateTime\"/> using <see cref=\"System.DateTime.ParseExact(string,string,IFormatProvider)\"/>\n        /// with the specified <paramref name=\"format\"/>, <paramref name=\"dateTimeStyles\"/> and <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static DateTime DateTimeExact(string value, string format, DateTimeStyles dateTimeStyles)\n        {\n            return System.DateTime.ParseExact(value, format, CultureInfo.InvariantCulture, dateTimeStyles);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"System.DateTime\"/> using the specified <paramref name=\"dateTimeStyle\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, DateTimeStyles dateTimeStyle, out System.DateTime value)\n        {\n            return System.DateTime.TryParse(input, CultureInfo.InvariantCulture, dateTimeStyle, out value);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"System.DateTime\"/> using the\n        /// specified <paramref name=\"dateTimeStyle\"/>, the format <paramref name=\"format\"/>, and\n        /// <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParseExact(string input, string format, DateTimeStyles dateTimeStyle, out System.DateTime value)\n        {\n            return System.DateTime.TryParseExact(input, format, CultureInfo.InvariantCulture, dateTimeStyle, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"double\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static double Double(string value)\n        {\n            return double.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"double\"/> using the specified <paramref name=\"numberStyle\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, NumberStyles numberStyle, out double value)\n        {\n            return double.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"decimal\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static decimal Decimal(string value)\n        {\n            return decimal.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"decimal\"/> using the specified <paramref name=\"numberStyles\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static decimal Decimal(string value, NumberStyles numberStyles)\n        {\n            return decimal.Parse(value, numberStyles, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"decimal\"/> using the specified <paramref name=\"numberStyle\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, NumberStyles numberStyle, out decimal value)\n        {\n            return decimal.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"int\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static int Int(string value)\n        {\n            return int.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"int\"/> using the specified <paramref name=\"numberStyle\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, NumberStyles numberStyle, out int value)\n        {\n            return int.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"long\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// </summary>\n        public static long Long(string value)\n        {\n            return long.Parse(value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a <see cref=\"long\"/> using <see cref=\"CultureInfo.InvariantCulture\"/>\n        /// and the specified <paramref name=\"numberStyles\"/>\n        /// </summary>\n        public static long Long(string value, NumberStyles numberStyles)\n        {\n            return long.Parse(value, numberStyles, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Tries to parse the provided value with TryParse as a <see cref=\"long\"/> using the specified <paramref name=\"numberStyle\"/>\n        /// and <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public static bool TryParse(string input, NumberStyles numberStyle, out long value)\n        {\n            return long.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);\n        }\n\n        /// <summary>\n        /// Parses the provided value as a an enumeration type <typeparamref name=\"T\"/>\n        /// </summary>\n        public static T Enum<T>(string input, bool ignoreCase = true)\n            where T : struct, IConvertible\n        {\n            T value;\n            if (!TryParse(input, out value, ignoreCase))\n            {\n                throw new ArgumentException(Messages.Parse.ValueIsNotParseable(input, typeof(T)));\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Parses the provided value as a an enumeration type <typeparamref name=\"T\"/>\n        /// </summary>\n        public static bool TryParse<T>(string input, out T value, bool ignoreCase = true)\n            where T : struct, IConvertible\n        {\n            return System.Enum.TryParse<T>(input, ignoreCase, out value);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Common\")]\n[assembly: AssemblyProduct(\"QuantConnect.Common\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"94687ba0-0b5f-43f7-a911-83b5a89651cf\")]\n\n[assembly: InternalsVisibleTo(\"QuantConnect.Algorithm.Framework\")]\n[assembly: InternalsVisibleTo(\"QuantConnect.Brokerages\")]\n[assembly: InternalsVisibleTo(\"QuantConnect.Lean.Engine\")]\n[assembly: InternalsVisibleTo(\"QuantConnect.Tests\")]"
  },
  {
    "path": "Common/Properties/SharedAssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n// common assembly attributes\n[assembly: AssemblyCopyright(\"QuantConnect™ 2018. All Rights Reserved\")]\n[assembly: AssemblyCompany(\"QuantConnect Corporation\")]\n[assembly: AssemblyVersion(\"2.5\")]\n\n// Configuration used to build the assembly is by defaulting 'Debug'.\n// To create a package using a Release configuration, -properties Configuration=Release on the command line must be use.\n// source: https://docs.microsoft.com/en-us/nuget/reference/nuspec#replacement-tokens"
  },
  {
    "path": "Common/Python/BasePythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Base class for Python wrapper classes\n    /// </summary>\n    public class BasePythonWrapper<TInterface> : IEquatable<BasePythonWrapper<TInterface>>, IDisposable\n    {\n        private PyObject _instance;\n        private object _underlyingClrObject;\n        private Dictionary<string, PyObject> _pythonMethods;\n        private Dictionary<string, string> _pythonPropertyNames;\n\n        private bool _validateInterface;\n\n        /// <summary>\n        /// Gets the underlying python instance\n        /// </summary>\n        protected PyObject Instance => _instance;\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BasePythonWrapper{TInterface}\" /> class\n        /// </summary>\n        /// <param name=\"validateInterface\">Whether to perform validations for interface implementation</param>\n        public BasePythonWrapper(bool validateInterface = true)\n        {\n            _validateInterface = validateInterface;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"BasePythonWrapper{TInterface}\"/> class with the specified instance\n        /// </summary>\n        /// <param name=\"instance\">The underlying python instance</param>\n        /// <param name=\"validateInterface\">Whether to perform validations for interface implementation</param>\n        public BasePythonWrapper(PyObject instance, bool validateInterface = true)\n            : this(validateInterface)\n        {\n            SetPythonInstance(instance);\n        }\n\n        /// <summary>\n        /// Sets the python instance\n        /// </summary>\n        /// <param name=\"instance\">The underlying python instance</param>\n        public void SetPythonInstance(PyObject instance)\n        {\n            InitializeContainers();\n\n            _instance = _validateInterface ? instance.ValidateImplementationOf<TInterface>() : instance;\n            _instance.TryConvert(out _underlyingClrObject);\n        }\n\n        /// <summary>\n        /// Sets the python instance and sets the validate interface flag\n        /// </summary>\n        /// <param name=\"instance\">The underlying python instance</param>\n        /// <param name=\"validateInterface\">Whether to perform validations for interface implementation</param>\n        protected void SetPythonInstance(PyObject instance, bool validateInterface)\n        {\n            _validateInterface = validateInterface;\n            SetPythonInstance(instance);\n        }\n\n        private void InitializeContainers()\n        {\n            if (_pythonMethods != null && _pythonPropertyNames != null)\n            {\n                _pythonMethods.Clear();\n                _pythonPropertyNames.Clear();\n                return;\n            }\n\n            _pythonMethods = new();\n            _pythonPropertyNames = new();\n        }\n\n        /// <summary>\n        /// Gets the Python instance property with the specified name\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property</param>\n        public T GetProperty<T>(string propertyName)\n        {\n            using var _ = Py.GIL();\n            return PythonRuntimeChecker.ConvertAndDispose<T>(GetProperty(propertyName), propertyName, isMethod: false);\n        }\n\n        /// <summary>\n        /// Gets the Python instance property with the specified name\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property</param>\n        public PyObject GetProperty(string propertyName)\n        {\n            using var _ = Py.GIL();\n            return _instance.GetAttr(GetPropertyName(propertyName));\n        }\n\n        /// <summary>\n        /// Sets the Python instance property with the specified name\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property</param>\n        /// <param name=\"value\">The property value</param>\n        public void SetProperty(string propertyName, object value)\n        {\n            using var _ = Py.GIL();\n            _instance.SetAttr(GetPropertyName(propertyName), value.ToPython());\n        }\n\n        /// <summary>\n        /// Gets the Python instance event with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of the event</param>\n        public dynamic GetEvent(string name)\n        {\n            using var _ = Py.GIL();\n            return _instance.GetAttr(GetPropertyName(name, true));\n        }\n\n        /// <summary>\n        /// Determines whether the Python instance has the specified attribute\n        /// </summary>\n        /// <param name=\"name\">The attribute name</param>\n        /// <returns>Whether the Python instance has the specified attribute</returns>\n        public bool HasAttr(string name)\n        {\n            using var _ = Py.GIL();\n            return _instance.HasAttr(name) || _instance.HasAttr(name.ToSnakeCase());\n        }\n\n        /// <summary>\n        /// Gets the Python instances method with the specified name and caches it\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"pythonOnly\">Whether to only return python methods</param>\n        /// <returns>The matched method</returns>\n        public PyObject GetMethod(string methodName, bool pythonOnly = false)\n        {\n            if (!_pythonMethods.TryGetValue(methodName, out var method))\n            {\n                method = pythonOnly ? _instance.GetPythonMethod(methodName) : _instance.GetMethod(methodName);\n                _pythonMethods = AddToDictionary(_pythonMethods, methodName, method);\n            }\n\n            return method;\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The returned valued converted to the given type</returns>\n        public T InvokeMethod<T>(string methodName, params object[] args)\n        {\n            var method = GetMethod(methodName);\n            return PythonRuntimeChecker.InvokeMethod<T>(method, methodName, args);\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        public PyObject InvokeMethod(string methodName, params object[] args)\n        {\n            using var _ = Py.GIL();\n            var method = GetMethod(methodName);\n            return method.Invoke(args);\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments without returning a value\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        public void InvokeVoidMethod(string methodName, params object[] args)\n        {\n            InvokeMethod(methodName, args).Dispose();\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments and iterates over the returned values\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The returned valued converted to the given type</returns>\n        public IEnumerable<T> InvokeMethodAndEnumerate<T>(string methodName, params object[] args)\n        {\n            var method = GetMethod(methodName);\n            return PythonRuntimeChecker.InvokeMethodAndEnumerate<T>(method, methodName, args);\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments and iterates over the returned values\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The returned valued converted to the given type</returns>\n        public Dictionary<TKey, TValue> InvokeMethodAndGetDictionary<TKey, TValue>(string methodName, params object[] args)\n        {\n            var method = GetMethod(methodName);\n            return PythonRuntimeChecker.InvokeMethodAndGetDictionary<TKey, TValue>(method, methodName, args);\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments and out parameters\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"outParametersTypes\">The types of the out parameters</param>\n        /// <param name=\"outParameters\">The out parameters values</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The returned valued converted to the given type</returns>\n        public T InvokeMethodWithOutParameters<T>(string methodName, Type[] outParametersTypes, out object[] outParameters, params object[] args)\n        {\n            var method = GetMethod(methodName);\n            return PythonRuntimeChecker.InvokeMethodAndGetOutParameters<T>(method, methodName, outParametersTypes, out outParameters, args);\n        }\n\n        /// <summary>\n        /// Invokes the specified method with the specified arguments and wraps the result\n        /// by calling the given function if the result is not a C# object\n        /// </summary>\n        /// <param name=\"methodName\">The name of the method</param>\n        /// <param name=\"wrapResult\">Method that wraps a Python object in the corresponding Python Wrapper</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The returned value wrapped using the given method if the result is not a C# object</returns>\n        public T InvokeMethodAndWrapResult<T>(string methodName, Func<PyObject, T> wrapResult, params object[] args)\n        {\n            var method = GetMethod(methodName);\n            return PythonRuntimeChecker.InvokeMethodAndWrapResult(method, methodName, wrapResult, args);\n        }\n\n        private string GetPropertyName(string propertyName, bool isEvent = false)\n        {\n            if (!_pythonPropertyNames.TryGetValue(propertyName, out var pythonPropertyName))\n            {\n                var snakeCasedPropertyName = propertyName.ToSnakeCase();\n\n                // If the object is actually a C# object (e.g. a child class of a C# class),\n                // we check which property was defined in the Python class (if any), either the snake-cased or the original name.\n                if (!isEvent && _underlyingClrObject != null)\n                {\n                    var underlyingClrObjectType = _underlyingClrObject.GetType();\n                    var property = underlyingClrObjectType.GetProperty(propertyName);\n                    if (property != null)\n                    {\n                        var clrPropertyValue = property.GetValue(_underlyingClrObject);\n                        var pyObjectSnakeCasePropertyValue = _instance.GetAttr(snakeCasedPropertyName);\n\n                        if (!pyObjectSnakeCasePropertyValue.TryConvert(out object pyObjectSnakeCasePropertyClrValue, true) ||\n                            !ReferenceEquals(clrPropertyValue, pyObjectSnakeCasePropertyClrValue))\n                        {\n                            pythonPropertyName = snakeCasedPropertyName;\n                        }\n                        else\n                        {\n                            pythonPropertyName = propertyName;\n                        }\n                    }\n                }\n\n                if (pythonPropertyName == null)\n                {\n                    pythonPropertyName = snakeCasedPropertyName;\n                    if (!_instance.HasAttr(pythonPropertyName))\n                    {\n                        pythonPropertyName = propertyName;\n                    }\n                }\n\n                _pythonPropertyNames = AddToDictionary(_pythonPropertyNames, propertyName, pythonPropertyName);\n            }\n\n            return pythonPropertyName;\n        }\n\n        /// <summary>\n        /// Adds a key-value pair to the dictionary by copying the original one first and returning a new dictionary\n        /// containing the new key-value pair along with the original ones.\n        /// We do this in order to avoid the overhead of using locks or concurrent dictionaries and still be thread-safe.\n        /// </summary>\n        private static Dictionary<string, T> AddToDictionary<T>(Dictionary<string, T> dictionary, string key, T value)\n        {\n            return new Dictionary<string, T>(dictionary)\n            {\n                [key] = value\n            };\n        }\n\n        /// <summary>\n        /// Determines whether the specified instance wraps the same Python object reference as this instance,\n        /// which would indicate that they are equal.\n        /// </summary>\n        /// <param name=\"other\">The other object to compare this with</param>\n        /// <returns>True if both instances are equal, that is if both wrap the same Python object reference</returns>\n        public virtual bool Equals(BasePythonWrapper<TInterface> other)\n        {\n            return other is not null && (ReferenceEquals(this, other) || Equals(other._instance));\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is an instance of <see cref=\"BasePythonWrapper{TInterface}\"/>\n        /// and wraps the same Python object reference as this instance, which would indicate that they are equal.\n        /// </summary>\n        /// <param name=\"obj\">The other object to compare this with</param>\n        /// <returns>True if both instances are equal, that is if both wrap the same Python object reference</returns>\n        public override bool Equals(object obj)\n        {\n            return Equals(obj as PyObject) || Equals(obj as BasePythonWrapper<TInterface>);\n        }\n\n        /// <summary>\n        /// Gets the hash code for the current instance\n        /// </summary>\n        /// <returns>The hash code of the current instance</returns>\n        public override int GetHashCode()\n        {\n            using var _ = Py.GIL();\n            return PythonReferenceComparer.Instance.GetHashCode(_instance);\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"PyObject\"/> is equal to the current instance's underlying Python object.\n        /// </summary>\n        private bool Equals(PyObject other)\n        {\n            if (other is null) return false;\n            if (ReferenceEquals(_instance, other)) return true;\n\n            using var _ = Py.GIL();\n            // We only care about the Python object reference, not the underlying C# object reference for comparison\n            return PythonReferenceComparer.Instance.Equals(_instance, other);\n        }\n\n\n        /// <summary>\n        /// Dispose of this instance\n        /// </summary>\n        public virtual void Dispose()\n        {\n            using var _ = Py.GIL();\n            if (_pythonMethods != null)\n            {\n                foreach (var methods in _pythonMethods.Values)\n                {\n                    methods.Dispose();\n                }\n                _pythonMethods.Clear();\n            }\n            _instance?.Dispose();\n        }\n\n        /// <summary>\n        /// Attempts to invoke the method if it has been overridden in Python.\n        /// </summary>\n        /// <typeparam name=\"T\">The expected return type of the Python method.</typeparam>\n        /// <param name=\"methodName\">The name of the method to call on the Python instance.</param>\n        /// <param name=\"result\">When this method returns, contains the method result if the call succeeded.</param>\n        /// <param name=\"args\">The arguments to pass to the Python method.</param>\n        /// <returns>true if the Python method was successfully invoked, otherwise, false.</returns>\n        protected bool TryInvokePythonOverride<T>(string methodName, out T result, params object[] args)\n        {\n\n            if (_instance != null)\n            {\n                var method = GetMethod(methodName, true);\n                if (method != null)\n                {\n                    result = PythonRuntimeChecker.InvokeMethod<T>(method, methodName, args);\n                    return true;\n                }\n            }\n\n            result = default;\n            return false;\n        }\n\n        /// <summary>\n        /// Set of helper methods to invoke Python methods with runtime checks for return values and out parameter's conversions.\n        /// </summary>\n        public class PythonRuntimeChecker\n        {\n            /// <summary>\n            /// Invokes method <paramref name=\"method\"/> and converts the returned value to type <typeparamref name=\"TResult\"/>\n            /// </summary>\n            public static TResult InvokeMethod<TResult>(PyObject method, string pythonMethodName, params object[] args)\n            {\n                using var _ = Py.GIL();\n                using var result = method.Invoke(args);\n\n                return Convert<TResult>(result, pythonMethodName);\n            }\n\n            /// <summary>\n            /// Invokes method <paramref name=\"method\"/>, expecting an enumerable or generator as return value,\n            /// converting each item to type <typeparamref name=\"TItem\"/> on demand.\n            /// </summary>\n            public static IEnumerable<TItem> InvokeMethodAndEnumerate<TItem>(PyObject method, string pythonMethodName, params object[] args)\n            {\n                using var _ = Py.GIL();\n                var result = method.Invoke(args);\n\n                foreach (var item in EnumerateAndDisposeItems<TItem>(result, pythonMethodName))\n                {\n                    yield return item;\n                }\n\n                result.Dispose();\n            }\n\n            /// <summary>\n            /// Invokes method <paramref name=\"method\"/>, expecting a dictionary as return value,\n            /// which then will be converted to a managed dictionary, with type checking on each item conversion.\n            /// </summary>\n            public static Dictionary<TKey, TValue> InvokeMethodAndGetDictionary<TKey, TValue>(PyObject method, string pythonMethodName, params object[] args)\n            {\n                using var _ = Py.GIL();\n                using var result = method.Invoke(args);\n\n                Dictionary<TKey, TValue> dict;\n                if (result.TryConvert(out dict))\n                {\n                    // this is required if the python implementation is actually returning a C# dict, not common,\n                    // but could happen if its actually calling a base C# implementation\n                    return dict;\n                }\n\n                dict = new();\n                Func<PyObject, string> keyErrorMessageFunc =\n                    (pyItem) => Messages.BasePythonWrapper.InvalidDictionaryKeyType(pythonMethodName, typeof(TKey), pyItem.GetPythonType());\n                foreach (var (managedKey, pyKey) in Enumerate<TKey>(result, pythonMethodName, keyErrorMessageFunc))\n                {\n                    var pyValue = result.GetItem(pyKey);\n                    try\n                    {\n                        dict[managedKey] = pyValue.GetAndDispose<TValue>();\n                    }\n                    catch (InvalidCastException ex)\n                    {\n                        throw new InvalidCastException(\n                            Messages.BasePythonWrapper.InvalidDictionaryValueType(pythonMethodName, typeof(TValue), pyValue.GetPythonType()),\n                            ex);\n                    }\n                }\n\n                return dict;\n            }\n\n            /// <summary>\n            /// Invokes method <paramref name=\"method\"/> and tries to convert the returned value to type <typeparamref name=\"TResult\"/>.\n            /// If conversion is not possible, the returned PyObject is passed to the provided <paramref name=\"wrapResult\"/> method,\n            /// which should try to do the proper conversion, wrapping or handling of the PyObject.\n            /// </summary>\n            public static TResult InvokeMethodAndWrapResult<TResult>(PyObject method, string pythonMethodName, Func<PyObject, TResult> wrapResult,\n                params object[] args)\n            {\n                using var _ = Py.GIL();\n                var result = method.Invoke(args);\n\n                if (!result.TryConvert<TResult>(out var managedResult))\n                {\n                    return wrapResult(result);\n                }\n\n                result.Dispose();\n                return managedResult;\n            }\n\n            /// <summary>\n            /// Invokes method <paramref name=\"method\"/> and converts the returned value to type <typeparamref name=\"TResult\"/>.\n            /// It also makes sure the Python method returns values for the out parameters, converting them into the expected types\n            /// in <paramref name=\"outParametersTypes\"/> and placing them in the <paramref name=\"outParameters\"/> array.\n            /// </summary>\n            public static TResult InvokeMethodAndGetOutParameters<TResult>(PyObject method, string pythonMethodName, Type[] outParametersTypes,\n                out object[] outParameters, params object[] args)\n            {\n                using var _ = Py.GIL();\n                using var result = method.Invoke(args);\n\n                // Since pythonnet does not support out parameters, the methods return\n                // a tuple where the out parameter come after the other returned values\n                if (!PyTuple.IsTupleType(result))\n                {\n                    throw new ArgumentException(\n                        Messages.BasePythonWrapper.InvalidReturnTypeForMethodWithOutParameters(pythonMethodName, result.GetPythonType()));\n                }\n\n                if (result.Length() < outParametersTypes.Length + 1)\n                {\n                    throw new ArgumentException(Messages.BasePythonWrapper.InvalidReturnTypeTupleSizeForMethodWithOutParameters(\n                        pythonMethodName, outParametersTypes.Length + 1, result.Length()));\n                }\n\n                var managedResult = Convert<TResult>(result[0], pythonMethodName);\n\n                outParameters = new object[outParametersTypes.Length];\n                var i = 0;\n                try\n                {\n                    for (; i < outParametersTypes.Length; i++)\n                    {\n                        outParameters[i] = result[i + 1].AsManagedObject(outParametersTypes[i]);\n                    }\n                }\n                catch (InvalidCastException exception)\n                {\n                    throw new InvalidCastException(\n                        Messages.BasePythonWrapper.InvalidOutParameterType(pythonMethodName, i, outParametersTypes[i], result[i + 1].GetPythonType()),\n                        exception);\n                }\n\n                return managedResult;\n            }\n\n            /// <summary>\n            /// Converts the given PyObject into the provided <typeparamref name=\"T\"/> type,\n            /// generating an exception with a user-friendly message if conversion is not possible.\n            /// </summary>\n            public static T Convert<T>(PyObject pyObject, string pythonName, bool isMethod = true)\n            {\n                var type = typeof(T);\n                try\n                {\n                    if (type == typeof(void))\n                    {\n                        return default;\n                    }\n\n                    if (type == typeof(PyObject))\n                    {\n                        return (T)(object)pyObject;\n                    }\n\n                    return (T)pyObject.AsManagedObject(type);\n                }\n                catch (InvalidCastException e)\n                {\n                    throw new InvalidCastException(Messages.BasePythonWrapper.InvalidReturnType(pythonName, type, pyObject.GetPythonType(), isMethod), e);\n                }\n            }\n\n            /// <summary>\n            /// Converts the given PyObject into the provided <typeparamref name=\"T\"/> type,\n            /// generating an exception with a user-friendly message if conversion is not possible.\n            /// It will dispose of the source PyObject.\n            /// </summary>\n            public static T ConvertAndDispose<T>(PyObject pyObject, string pythonName, bool isMethod = true)\n            {\n                try\n                {\n                    return Convert<T>(pyObject, pythonName, isMethod);\n                }\n                finally\n                {\n                    pyObject.Dispose();\n                }\n            }\n\n            /// <summary>\n            /// Verifies that the <paramref name=\"result\"/> value is iterable and converts each item into the <typeparamref name=\"TItem\"/> type,\n            /// returning also the corresponding source PyObject for each one of them.\n            /// </summary>\n            private static IEnumerable<(TItem, PyObject)> Enumerate<TItem>(PyObject result, string pythonMethodName,\n                Func<PyObject, string> getInvalidCastExceptionMessage = null)\n            {\n                if (!result.IsIterable())\n                {\n                    throw new InvalidCastException(Messages.BasePythonWrapper.InvalidIterable(pythonMethodName, typeof(TItem), result.GetPythonType()));\n                }\n\n                using var iterator = result.GetIterator();\n                foreach (PyObject item in iterator)\n                {\n                    TItem managedItem;\n\n                    try\n                    {\n                        managedItem = item.As<TItem>();\n                    }\n                    catch (InvalidCastException ex)\n                    {\n                        var message = getInvalidCastExceptionMessage?.Invoke(item) ??\n                            Messages.BasePythonWrapper.InvalidMethodIterableItemType(pythonMethodName, typeof(TItem), item.GetPythonType());\n                        throw new InvalidCastException(message, ex);\n                    }\n\n                    yield return (managedItem, item);\n                }\n            }\n\n            /// <summary>\n            /// Verifies that the <paramref name=\"result\"/> value is iterable and converts each item into the <typeparamref name=\"TItem\"/> type.\n            /// </summary>\n            private static IEnumerable<TItem> EnumerateAndDisposeItems<TItem>(PyObject result, string pythonMethodName)\n            {\n                foreach (var (managedItem, pyItem) in Enumerate<TItem>(result, pythonMethodName))\n                {\n                    pyItem.Dispose();\n                    yield return managedItem;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/BenchmarkPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Benchmarks;\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IBenchmark\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class BenchmarkPythonWrapper : BasePythonWrapper<IBenchmark>, IBenchmark\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"BenchmarkPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Python benchmark model</param>\n        public BenchmarkPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Evaluates this benchmark at the specified time using the method defined in the Python class\n        /// </summary>\n        /// <param name=\"time\">The time to evaluate the benchmark at</param>\n        /// <returns>The value of the benchmark at the specified time</returns>\n        public decimal Evaluate(DateTime time)\n        {\n            return InvokeMethod<decimal>(nameof(Evaluate), time);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/BrokerageMessageHandlerPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides a wrapper for <see cref=\"IBrokerageMessageHandler\"/> implementations written in python\n    /// </summary>\n    public class BrokerageMessageHandlerPythonWrapper : BasePythonWrapper<IBrokerageMessageHandler>, IBrokerageMessageHandler\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageMessageHandlerPythonWrapper\"/> class\n        /// </summary>\n        /// <param name=\"model\">The python implementation of <see cref=\"IBrokerageMessageHandler\"/></param>\n        public BrokerageMessageHandlerPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Handles the message\n        /// </summary>\n        /// <param name=\"message\">The message to be handled</param>\n        public void HandleMessage(BrokerageMessageEvent message)\n        {\n            InvokeMethod(nameof(HandleMessage), message);\n        }\n\n        /// <summary>\n        /// Handles a new order placed manually in the brokerage side\n        /// </summary>\n        /// <param name=\"eventArgs\">The new order event</param>\n        /// <returns>Whether the order should be added to the transaction handler</returns>\n        public bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n        {\n            return InvokeMethod<bool>(nameof(HandleOrder), eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/BrokerageModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IBrokerageModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class BrokerageModelPythonWrapper : BasePythonWrapper<IBrokerageModel>, IBrokerageModel\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"BrokerageModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Models brokerage transactions, fees, and order</param>\n        public BrokerageModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the account type used by this model\n        /// </summary>\n        public AccountType AccountType\n        {\n            get\n            {\n                return GetProperty<AccountType>(nameof(AccountType));\n            }\n        }\n\n        /// <summary>\n        /// Gets the brokerages model percentage factor used to determine the required unused buying power for the account.\n        /// From 1 to 0. Example: 0 means no unused buying power is required. 0.5 means 50% of the buying power should be left unused.\n        /// </summary>\n        public decimal RequiredFreeBuyingPowerPercent\n        {\n            get\n            {\n                return GetProperty<decimal>(nameof(RequiredFreeBuyingPowerPercent));\n            }\n        }\n\n        /// <summary>\n        /// Gets a map of the default markets to be used for each security type\n        /// </summary>\n        public IReadOnlyDictionary<SecurityType, string> DefaultMarkets\n        {\n            get\n            {\n                using (Py.GIL())\n                {\n                    var markets = GetProperty(nameof(DefaultMarkets)) as dynamic;\n                    if ((markets as PyObject).TryConvert(out IReadOnlyDictionary<SecurityType, string> csharpDic))\n                    {\n                        return csharpDic;\n                    }\n\n                    var dic = new Dictionary<SecurityType, string>();\n                    foreach (var item in markets)\n                    {\n                        using var pyItem = item as PyObject;\n                        var market = pyItem.As<SecurityType>();\n                        dic[market] = markets[item];\n                    }\n\n                    (markets as PyObject).Dispose();\n                    return dic;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Applies the split to the specified order ticket\n        /// </summary>\n        /// <param name=\"tickets\">The open tickets matching the split event</param>\n        /// <param name=\"split\">The split event data</param>\n        public void ApplySplit(List<OrderTicket> tickets, Split split)\n        {\n            InvokeMethod(nameof(ApplySplit), tickets, split);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would be able to execute this order at this time assuming\n        /// market prices are sufficient for the fill to take place. This is used to emulate the\n        /// brokerage fills in backtesting and paper trading. For example some brokerages may not perform\n        /// executions during extended market hours. This is not intended to be checking whether or not\n        /// the exchange is open, that is handled in the Security.Exchange property.\n        /// </summary>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to test for execution</param>\n        /// <returns>True if the brokerage would be able to perform the execution, false otherwise</returns>\n        public bool CanExecuteOrder(Security security, Order order)\n        {\n            return InvokeMethod<bool>(nameof(CanExecuteOrder), security, order);\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage could accept this order. This takes into account\n        /// order type, security type, and order size limits.\n        /// </summary>\n        /// <remarks>\n        /// For example, a brokerage may have no connectivity at certain times, or an order rate/size limit\n        /// </remarks>\n        /// <param name=\"security\">The security being ordered</param>\n        /// <param name=\"order\">The order to be processed</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be submitted</param>\n        /// <returns>True if the brokerage could process the order, false otherwise</returns>\n        public bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n        {\n            message = null;\n            var result = InvokeMethodWithOutParameters<bool>(nameof(CanSubmitOrder), new[] { typeof(BrokerageMessageEvent) },\n                out var outParameters, security, order, message);\n            message = outParameters[0] as BrokerageMessageEvent;\n\n            return result;\n        }\n\n        /// <summary>\n        /// Returns true if the brokerage would allow updating the order as specified by the request\n        /// </summary>\n        /// <param name=\"security\">The security of the order</param>\n        /// <param name=\"order\">The order to be updated</param>\n        /// <param name=\"request\">The requested updated to be made to the order</param>\n        /// <param name=\"message\">If this function returns false, a brokerage message detailing why the order may not be updated</param>\n        /// <returns>True if the brokerage would allow updating the order, false otherwise</returns>\n        public bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n        {\n            message = null;\n            var result = InvokeMethodWithOutParameters<bool>(nameof(CanUpdateOrder), new[] { typeof(BrokerageMessageEvent) }, out var outParameters,\n                security, order, request, message);\n            message = outParameters[0] as BrokerageMessageEvent;\n\n            return result;\n        }\n\n        /// <summary>\n        /// Get the benchmark for this model\n        /// </summary>\n        /// <param name=\"securities\">SecurityService to create the security with if needed</param>\n        /// <returns>The benchmark for this brokerage</returns>\n        public IBenchmark GetBenchmark(SecurityManager securities)\n        {\n            return InvokeMethodAndWrapResult<IBenchmark>(nameof(GetBenchmark), (pyInstance) => new BenchmarkPythonWrapper(pyInstance), securities);\n        }\n\n        /// <summary>\n        /// Gets a new fee model that represents this brokerage's fee structure\n        /// </summary>\n        /// <param name=\"security\">The security to get a fee model for</param>\n        /// <returns>The new fee model for this brokerage</returns>\n        public IFeeModel GetFeeModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<IFeeModel>(nameof(GetFeeModel), (pyInstance) => new FeeModelPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Gets a new fill model that represents this brokerage's fill behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get fill model for</param>\n        /// <returns>The new fill model for this brokerage</returns>\n        public IFillModel GetFillModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<IFillModel>(nameof(GetFillModel), (pyInstance) => new FillModelPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Gets the brokerage's leverage for the specified security\n        /// </summary>\n        /// <param name=\"security\">The security's whose leverage we seek</param>\n        /// <returns>The leverage for the specified security</returns>\n        public decimal GetLeverage(Security security)\n        {\n            return InvokeMethod<decimal>(nameof(GetLeverage), security);\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        public ISettlementModel GetSettlementModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<ISettlementModel>(nameof(GetSettlementModel),\n                (pyInstance) => new SettlementModelPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Gets a new settlement model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a settlement model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The settlement model for this brokerage</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        public ISettlementModel GetSettlementModel(Security security, AccountType accountType)\n        {\n            return InvokeMethod<ISettlementModel>(nameof(GetSettlementModel), security, accountType);\n        }\n\n        /// <summary>\n        /// Gets a new slippage model that represents this brokerage's fill slippage behavior\n        /// </summary>\n        /// <param name=\"security\">The security to get a slippage model for</param>\n        /// <returns>The new slippage model for this brokerage</returns>\n        public ISlippageModel GetSlippageModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<ISlippageModel>(nameof(GetSlippageModel),\n                (pyInstance) => new SlippageModelPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Determine if this symbol is shortable\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm running</param>\n        /// <param name=\"symbol\">The symbol to short</param>\n        /// <param name=\"quantity\">The amount to short</param>\n        /// <returns></returns>\n        public bool Shortable(IAlgorithm algorithm, Symbol symbol, decimal quantity)\n        {\n            return InvokeMethod<bool>(nameof(Shortable), algorithm, symbol, quantity);\n        }\n\n        /// <summary>\n        /// Gets a new buying power model for the security, returning the default model with the security's configured leverage.\n        /// For cash accounts, leverage = 1 is used.\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        public IBuyingPowerModel GetBuyingPowerModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<IBuyingPowerModel>(nameof(GetBuyingPowerModel),\n                (pyInstance) => new BuyingPowerModelPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Gets a new buying power model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a buying power model for</param>\n        /// <param name=\"accountType\">The account type</param>\n        /// <returns>The buying power model for this brokerage/security</returns>\n        [Obsolete(\"Flagged deprecated and will remove December 1st 2018\")]\n        public IBuyingPowerModel GetBuyingPowerModel(Security security, AccountType accountType)\n        {\n            return InvokeMethod<IBuyingPowerModel>(nameof(GetBuyingPowerModel), security, accountType);\n        }\n\n        /// <summary>\n        /// Gets the shortable provider\n        /// </summary>\n        /// <returns>Shortable provider</returns>\n        public IShortableProvider GetShortableProvider(Security security)\n        {\n            return InvokeMethodAndWrapResult<IShortableProvider>(nameof(GetShortableProvider),\n                (pyInstance) => new ShortableProviderPythonWrapper(pyInstance), security);\n        }\n\n        /// <summary>\n        /// Convenience method to get the underlying <see cref=\"IBrokerageModel\"/> object from the wrapper.\n        /// </summary>\n        /// <returns>Underlying <see cref=\"IBrokerageModel\"/> object</returns>\n        public IBrokerageModel GetModel()\n        {\n            using (Py.GIL())\n            {\n                return Instance.As<IBrokerageModel>();\n            }\n        }\n\n        /// <summary>\n        /// Gets a new margin interest rate model for the security\n        /// </summary>\n        /// <param name=\"security\">The security to get a margin interest rate model for</param>\n        /// <returns>The margin interest rate model for this brokerage</returns>\n        public IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n        {\n            return InvokeMethodAndWrapResult<IMarginInterestRateModel>(nameof(GetMarginInterestRateModel),\n                (pyInstance) => new MarginInterestRateModelPythonWrapper(pyInstance), security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/BuyingPowerModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a security's model of buying power\n    /// </summary>\n    public class BuyingPowerModelPythonWrapper : BasePythonWrapper<IBuyingPowerModel>, IBuyingPowerModel\n    {\n        /// <summary>\n        /// Constructor for initializing the <see cref=\"BuyingPowerModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a security's model of buying power</param>\n        public BuyingPowerModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's potrfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        public BuyingPower GetBuyingPower(BuyingPowerParameters parameters)\n        {\n            return InvokeMethod<BuyingPower>(nameof(GetBuyingPower), parameters);\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public decimal GetLeverage(Security security)\n        {\n            return InvokeMethod<decimal>(nameof(GetLeverage), security);\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given buying power percentage.\n        /// Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the target signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)\n        {\n            return InvokeMethod<GetMaximumOrderQuantityResult>(nameof(GetMaximumOrderQuantityForTargetBuyingPower), parameters);\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a delta in the buying power used by a security.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower(\n            GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters)\n        {\n            return InvokeMethod<GetMaximumOrderQuantityResult>(nameof(GetMaximumOrderQuantityForDeltaBuyingPower), parameters);\n        }\n\n        /// <summary>\n        /// Gets the amount of buying power reserved to maintain the specified position\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the security</param>\n        /// <returns>The reserved buying power in account currency</returns>\n        public ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters)\n        {\n            return InvokeMethod<ReservedBuyingPowerForPosition>(nameof(GetReservedBuyingPowerForPosition), parameters);\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        public HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters)\n        {\n            return InvokeMethod<HasSufficientBuyingPowerForOrderResult>(nameof(HasSufficientBuyingPowerForOrder), parameters);\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\">The security to set leverage for</param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public void SetLeverage(Security security, decimal leverage)\n        {\n            InvokeMethod(nameof(SetLeverage), security, leverage);\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return InvokeMethod<MaintenanceMargin>(nameof(GetMaintenanceMargin), parameters);\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        public InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            return InvokeMethod<InitialMargin>(nameof(GetInitialMarginRequirement), parameters);\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public InitialMargin GetInitialMarginRequiredForOrder(InitialMarginRequiredForOrderParameters parameters)\n        {\n            return InvokeMethod<InitialMargin>(nameof(GetInitialMarginRequiredForOrder), parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/CommandPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Commands;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Python wrapper for a python defined command type\n    /// </summary>\n    public class CommandPythonWrapper : BasePythonWrapper<Command>\n    {\n        private static PyObject _linkSerializationMethod;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"CommandPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"type\">Python command type</param>\n        /// <param name=\"data\">Command data</param>\n        public CommandPythonWrapper(PyObject type, string data = null)\n            : base()\n        {\n            using var _ = Py.GIL();\n\n            var instance = type.Invoke();\n\n            SetPythonInstance(instance);\n            if (!string.IsNullOrEmpty(data))\n            {\n                if (HasAttr(\"PayloadData\"))\n                {\n                    SetProperty(\"PayloadData\", data);\n                }\n\n                foreach (var kvp in JsonConvert.DeserializeObject<Dictionary<string, object>>(data))\n                {\n                    if (kvp.Value is JArray jArray)\n                    {\n                        SetProperty(kvp.Key, jArray.ToObject<List<object>>());\n                    }\n                    else if (kvp.Value is JObject jobject)\n                    {\n                        SetProperty(kvp.Key, jobject.ToObject<Dictionary<string, object>>());\n                    }\n                    else\n                    {\n                        SetProperty(kvp.Key, kvp.Value);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Run this command using the target algorithm\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>True if success, false otherwise. Returning null will disable command feedback</returns>\n        public bool? Run(IAlgorithm algorithm)\n        {\n            using var _ = Py.GIL();\n            var result = InvokeMethod(nameof(Run), algorithm);\n            return result.GetAndDispose<bool?>();\n        }\n\n        /// <summary>\n        /// Helper method to serialize a command instance\n        /// </summary>\n        public static string Serialize(PyObject command)\n        {\n            if (command == null)\n            {\n                return string.Empty;\n            }\n\n            using var _ = Py.GIL();\n            if (_linkSerializationMethod == null)\n            {\n                var module = PyModule.FromString(\"python_serialization\", @\"from json import dumps\nfrom inspect import getmembers\n\ndef serialize(target):\n    if isinstance(target, dict):\n        # dictionary\n        return dumps(target)\n    if not hasattr(target, '__dict__') or not target.__dict__:\n        # python command inheriting base Command\n        members = getmembers(target)\n        result = {}\n        for name, value in members:\n            if value and not name.startswith('__'):\n                potential_entry = str(value)\n                if not potential_entry.startswith('<bound '):\n                    result[name] = value\n        return dumps(result)\n    # pure python command object\n    return dumps(target.__dict__)\n\");\n                _linkSerializationMethod = module.GetAttr(\"serialize\");\n            }\n            using var strResult = _linkSerializationMethod.Invoke(command);\n\n            return strResult.As<string>();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/DataConsolidatorPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an Data Consolidator that wraps a <see cref=\"PyObject\"/> object that represents a custom Python consolidator\n    /// </summary>\n    public class DataConsolidatorPythonWrapper : BasePythonWrapper<IDataConsolidator>, IDataConsolidator\n    {\n        internal PyObject Model => Instance;\n\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated\n        {\n            get { return GetProperty<IBaseData>(nameof(Consolidated)); }\n        }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public IBaseData WorkingData\n        {\n            get { return GetProperty<IBaseData>(nameof(WorkingData)); }\n        }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType\n        {\n            get { return GetProperty<Type>(nameof(InputType)); }\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public Type OutputType\n        {\n            get { return GetProperty<Type>(nameof(OutputType)); }\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event DataConsolidatedHandler DataConsolidated\n        {\n            add\n            {\n                var eventHandler = GetEvent(nameof(DataConsolidated));\n                eventHandler += value;\n            }\n            remove\n            {\n                var eventHandler = GetEvent(nameof(DataConsolidated));\n                eventHandler -= value;\n            }\n        }\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"DataConsolidatorPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"consolidator\">Represents a custom python consolidator</param>\n        public DataConsolidatorPythonWrapper(PyObject consolidator)\n            : base(consolidator, true)\n        {\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public void Scan(DateTime currentLocalTime)\n        {\n            InvokeMethod(nameof(Scan), currentLocalTime);\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public void Update(IBaseData data)\n        {\n            InvokeMethod(nameof(Update), data);\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public void Reset()\n        {\n            InvokeMethod(nameof(Reset));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/DividendYieldModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a dividend yield model\n    /// </summary>\n    public class DividendYieldModelPythonWrapper : BasePythonWrapper<IDividendYieldModel>, IDividendYieldModel\n    {\n        /// <summary>\n        /// Constructor for initializing the <see cref=\"DividendYieldModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a security's model of dividend yield</param>\n        public DividendYieldModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Get dividend yield by a given date of a given symbol\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        public decimal GetDividendYield(DateTime date)\n        {\n            return InvokeMethod<decimal>(nameof(GetDividendYield), date);\n        }\n\n        /// <summary>\n        /// Get dividend yield at given date and security price\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <param name=\"securityPrice\">The security price at the given date</param>\n        /// <returns>Dividend yield on the given date of the given symbol</returns>\n        /// <remarks>Price data must be raw (<see cref=\"DataNormalizationMode.Raw\"/>)</remarks>\n        public decimal GetDividendYield(DateTime date, decimal securityPrice)\n        {\n            return InvokeMethod<decimal>(nameof(GetDividendYield), date, securityPrice);\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"PyObject\"/> object into a <see cref=\"IDividendYieldModel\"/> object, wrapping it if necessary\n        /// </summary>\n        /// <param name=\"model\">The Python model</param>\n        /// <returns>The converted <see cref=\"IDividendYieldModel\"/> instance</returns>\n        public static IDividendYieldModel FromPyObject(PyObject model)\n        {\n            var dividendYieldModel = PythonUtil.CreateInstanceOrWrapper<IDividendYieldModel>(\n                model,\n                py => new DividendYieldModelPythonWrapper(py)\n            );\n            return dividendYieldModel;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/FeeModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an order fee model that wraps a <see cref=\"PyObject\"/> object that represents a model that simulates order fees\n    /// </summary>\n    public class FeeModelPythonWrapper : FeeModel\n    {\n        private readonly BasePythonWrapper<FeeModel> _model;\n        private bool _extendedVersion = true;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"FeeModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a model that simulates order fees</param>\n        public FeeModelPythonWrapper(PyObject model)\n        {\n            _model = new BasePythonWrapper<FeeModel>(model, false);\n        }\n\n        /// <summary>\n        /// Get the fee for this order\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OrderFeeParameters\"/> object\n        /// containing the security and order</param>\n        /// <returns>The cost of the order in units of the account currency</returns>\n        public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n        {\n            using (Py.GIL())\n            {\n                if (_extendedVersion)\n                {\n                    try\n                    {\n                        return _model.InvokeMethod<OrderFee>(nameof(GetOrderFee), parameters);\n                    }\n                    catch (PythonException)\n                    {\n                        _extendedVersion = false;\n                    }\n                }\n                var fee =  _model.InvokeMethod<decimal>(nameof(GetOrderFee), parameters.Security, parameters.Order);\n                return new OrderFee(new CashAmount(fee, \"USD\"));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/FillModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a model that simulates order fill events\n    /// </summary>\n    public class FillModelPythonWrapper : FillModel\n    {\n        private readonly BasePythonWrapper<FillModel> _model;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"FillModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a model that simulates order fill events</param>\n        public FillModelPythonWrapper(PyObject model)\n        {\n            _model = new BasePythonWrapper<FillModel>(model, false);\n            using (Py.GIL())\n            {\n                (model as dynamic).SetPythonWrapper(this);\n            }\n        }\n\n        /// <summary>\n        /// Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the security and order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override Fill Fill(FillModelParameters parameters)\n        {\n            Parameters = parameters;\n            return _model.InvokeMethod<Fill>(nameof(Fill), parameters);\n        }\n\n        /// <summary>\n        /// Limit Fill Model. Return an order event with the fill details.\n        /// </summary>\n        /// <param name=\"asset\">Stock Object to use to help model limit fill</param>\n        /// <param name=\"order\">Order to fill. Alter the values directly if filled.</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent LimitFill(Security asset, LimitOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(LimitFill), asset, order);\n        }\n\n        /// <summary>\n        /// Limit if Touched Fill Model. Return an order event with the fill details.\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading this order</param>\n        /// <param name=\"order\"><see cref=\"LimitIfTouchedOrder\"/> Order to Check, return filled if true</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent LimitIfTouchedFill(Security asset, LimitIfTouchedOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(LimitIfTouchedFill), asset, order);\n        }\n\n        /// <summary>\n        /// Model the slippage on a market order: fixed percentage of order price\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading this order</param>\n        /// <param name=\"order\">Order to update</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketFill(Security asset, MarketOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(MarketFill), asset, order);\n        }\n\n        /// <summary>\n        /// Market on Close Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketOnCloseFill(Security asset, MarketOnCloseOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(MarketOnCloseFill), asset, order);\n        }\n\n        /// <summary>\n        /// Market on Open Fill Model. Return an order event with the fill details\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading with this order</param>\n        /// <param name=\"order\">Order to be filled</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent MarketOnOpenFill(Security asset, MarketOnOpenOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(MarketOnOpenFill), asset, order);\n        }\n\n        /// <summary>\n        /// Stop Limit Fill Model. Return an order event with the fill details.\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading this order</param>\n        /// <param name=\"order\">Stop Limit Order to Check, return filled if true</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent StopLimitFill(Security asset, StopLimitOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(StopLimitFill), asset, order);\n        }\n\n        /// <summary>\n        /// Stop Market Fill Model. Return an order event with the fill details.\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading this order</param>\n        /// <param name=\"order\">Trailing Stop Order to check, return filled if true</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(StopMarketFill), asset, order);\n        }\n\n        /// <summary>\n        /// Trailing Stop Fill Model. Return an order event with the fill details.\n        /// </summary>\n        /// <param name=\"asset\">Asset we're trading this order</param>\n        /// <param name=\"order\">Stop Order to Check, return filled if true</param>\n        /// <returns>Order fill information detailing the average price and quantity filled.</returns>\n        public override OrderEvent TrailingStopFill(Security asset, TrailingStopOrder order)\n        {\n            return _model.InvokeMethod<OrderEvent>(nameof(TrailingStopFill), asset, order);\n        }\n\n        /// <summary>\n        /// Default combo market fill model for the base security class. Fills at the last traded price for each leg.\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public override List<OrderEvent> ComboMarketFill(Order order, FillModelParameters parameters)\n        {\n            return _model.InvokeMethod<List<OrderEvent>>(nameof(ComboMarketFill), order, parameters);\n        }\n\n        /// <summary>\n        /// Default combo limit fill model for the base security class. Fills at the sum of prices for the assets of every leg.\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public override List<OrderEvent> ComboLimitFill(Order order, FillModelParameters parameters)\n        {\n            return _model.InvokeMethod<List<OrderEvent>>(nameof(ComboLimitFill), order, parameters);\n        }\n\n        /// <summary>\n        /// Default combo limit fill model for the base security class. Fills at the limit price for each leg\n        /// </summary>\n        /// <param name=\"order\">Order to fill</param>\n        /// <param name=\"parameters\">Fill parameters for the order</param>\n        /// <returns>Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty</returns>\n        public override List<OrderEvent> ComboLegLimitFill(Order order, FillModelParameters parameters)\n        {\n            return _model.InvokeMethod<List<OrderEvent>>(nameof(ComboLegLimitFill), order, parameters);\n        }\n\n        /// <summary>\n        /// Get the minimum and maximum price for this security in the last bar:\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're checking</param>\n        /// <param name=\"direction\">The order direction, decides whether to pick bid or ask</param>\n        protected override Prices GetPrices(Security asset, OrderDirection direction)\n        {\n            return _model.InvokeMethod<Prices>(nameof(GetPrices), asset, direction);\n        }\n\n        /// <summary>\n        /// Get the minimum and maximum price for this security in the last bar:\n        /// </summary>\n        /// <param name=\"asset\">Security asset we're checking</param>\n        /// <param name=\"direction\">The order direction, decides whether to pick bid or ask</param>\n        /// <remarks>This method was implemented temporarily to help the refactoring of fill models (GH #4567)</remarks>\n        internal Prices GetPricesInternal(Security asset, OrderDirection direction)\n        {\n            return GetPrices(asset, direction);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/MarginCallModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides a margin call model that wraps a <see cref=\"PyObject\"/> object that represents the model responsible for picking which orders should be executed during a margin call\n    /// </summary>\n    public class MarginCallModelPythonWrapper : BasePythonWrapper<IMarginCallModel>, IMarginCallModel\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"MarginCallModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents the model responsible for picking which orders should be executed during a margin call</param>\n        public MarginCallModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Executes synchronous orders to bring the account within margin requirements.\n        /// </summary>\n        /// <param name=\"generatedMarginCallOrders\">These are the margin call orders that were generated\n        /// by individual security margin models.</param>\n        /// <returns>The list of orders that were actually executed</returns>\n        public List<OrderTicket> ExecuteMarginCall(IEnumerable<SubmitOrderRequest> generatedMarginCallOrders)\n        {\n            return InvokeMethod<List<OrderTicket>>(nameof(ExecuteMarginCall), generatedMarginCallOrders);\n        }\n\n        /// <summary>\n        /// Scan the portfolio and the updated data for a potential margin call situation which may get the holdings below zero!\n        /// If there is a margin call, liquidate the portfolio immediately before the portfolio gets sub zero.\n        /// </summary>\n        /// <param name=\"issueMarginCallWarning\">Set to true if a warning should be issued to the algorithm</param>\n        /// <returns>True for a margin call on the holdings.</returns>\n        public List<SubmitOrderRequest> GetMarginCallOrders(out bool issueMarginCallWarning)\n        {\n            issueMarginCallWarning = false;\n            var requests = InvokeMethodWithOutParameters<List<SubmitOrderRequest>>(nameof(GetMarginCallOrders), new[] { typeof(bool) },\n                out var outParameters, issueMarginCallWarning);\n            issueMarginCallWarning = (bool)outParameters[0] || requests.Count > 0;\n\n            return requests;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/MarginInterestRateModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a security's margin interest rate model\n    /// </summary>\n    public class MarginInterestRateModelPythonWrapper : BasePythonWrapper<IMarginInterestRateModel>, IMarginInterestRateModel\n    {\n        /// <summary>\n        /// Constructor for initializing the <see cref=\"MarginInterestRateModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a security's model of buying power</param>\n        public MarginInterestRateModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Apply margin interest rates to the portfolio\n        /// </summary>\n        /// <param name=\"marginInterestRateParameters\">The parameters to use</param>\n        public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n        {\n            InvokeMethod(nameof(ApplyMarginInterestRate), marginInterestRateParameters);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/OptionAssignmentModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Python wrapper for custom option assignment models\n    /// </summary>\n    public class OptionAssignmentModelPythonWrapper : BasePythonWrapper<IOptionAssignmentModel>, IOptionAssignmentModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"model\">The python model to wrapp</param>\n        public OptionAssignmentModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Get's the option assignments to generate if any\n        /// </summary>\n        /// <param name=\"parameters\">The option assignment parameters data transfer class</param>\n        /// <returns>The option assignment result</returns>\n        public OptionAssignmentResult GetAssignment(OptionAssignmentParameters parameters)\n        {\n            return InvokeMethod<OptionAssignmentResult>(nameof(GetAssignment), parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/OptionPriceModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing System;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionPriceModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class OptionPriceModelPythonWrapper : BasePythonWrapper<IOptionPriceModel>, IOptionPriceModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"model\">The python model to wrap</param>\n        public OptionPriceModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OptionPriceModelParameters\"/> object\n        /// containing the security, slice and contract</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters)\n        {\n            return InvokeMethod<OptionPriceModelResult>(nameof(Evaluate), parameters);\n        }\n    }\n}"
  },
  {
    "path": "Common/Python/PandasColumnAttribute.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Attribute to rename a property or field when converting an instance to a pandas DataFrame row.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]\n    public sealed class PandasColumnAttribute : Attribute\n    {\n        /// <summary>\n        /// The name of the column in the pandas DataFrame.\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PandasColumnAttribute\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name of the column in the pandas DataFrame</param>\n        public PandasColumnAttribute(string name)\n        {\n            Name = name;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasConverter.DataFrameGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Python\n{\n    public partial class PandasConverter\n    {\n        /// <summary>\n        /// Helper class to generate data frames from slices\n        /// </summary>\n        private class DataFrameGenerator\n        {\n            private static readonly string[] MultiBaseDataCollectionDataFrameNames = new[] { \"collection_symbol\", \"time\" };\n            private static readonly string[] MultiCanonicalSymbolsDataFrameNames = new[] { \"canonical\", \"time\" };\n            private static readonly string[] SingleBaseDataCollectionDataFrameNames = new[] { \"time\" };\n\n            private readonly Type _dataType;\n            private readonly bool _requestedTick;\n            private readonly bool _requestedQuoteBar;\n            private readonly bool _requestedTradeBar;\n            private readonly bool _timeAsColumn;\n\n            /// <summary>\n            /// PandasData instances for each symbol. Does not hold BaseDataCollection instances.\n            /// </summary>\n            private Dictionary<Symbol, PandasData> _pandasData;\n            private List<(Symbol Symbol, DateTime Time, IEnumerable<ISymbolProvider> Data)> _collections;\n\n            private int _maxLevels;\n            private bool _shouldUseSymbolOnlyIndex;\n            private readonly bool _flatten;\n\n            protected DataFrameGenerator(Type dataType = null, bool timeAsColumn = false, bool flatten = false)\n            {\n                _dataType = dataType;\n                // if no data type is requested we check all\n                _requestedTick = dataType == null || dataType == typeof(Tick) || dataType == typeof(OpenInterest);\n                _requestedTradeBar = dataType == null || dataType == typeof(TradeBar);\n                _requestedQuoteBar = dataType == null || dataType == typeof(QuoteBar);\n                _timeAsColumn = timeAsColumn;\n                _flatten = flatten;\n            }\n\n            public DataFrameGenerator(IEnumerable<Slice> slices, bool flatten = false, Type dataType = null)\n                : this(dataType, flatten: flatten)\n            {\n                AddData(slices);\n            }\n\n            /// <summary>\n            /// Extracts the data from the slices and prepares it for DataFrame generation.\n            /// If the slices contain BaseDataCollection instances, they are added to the collections list for proper handling.\n            /// For the rest of the data, PandasData instances are created for each symbol and the data is added to them for later processing.\n            /// </summary>\n            protected void AddData(IEnumerable<Slice> slices)\n            {\n                HashSet<SecurityIdentifier> addedData = null;\n\n                foreach (var slice in slices)\n                {\n                    foreach (var data in slice.AllData)\n                    {\n                        if (_flatten && IsCollection(data.GetType()))\n                        {\n                            AddCollection(data.Symbol, data.EndTime, (data as IEnumerable).Cast<ISymbolProvider>());\n                            continue;\n                        }\n\n                        var pandasData = GetPandasData(data);\n                        if (pandasData.IsCustomData || (_requestedTick && data is Tick))\n                        {\n                            pandasData.Add(data);\n                        }\n                        else\n                        {\n                            if (!_requestedTradeBar && !_requestedQuoteBar && _dataType != null && data.GetType().IsAssignableTo(_dataType))\n                            {\n                                // support for auxiliary data history requests\n                                pandasData.Add(data);\n                                continue;\n                            }\n\n                            // we add both quote and trade bars for each symbol at the same time, because they share the row in the data frame else it will generate 2 rows per series\n                            if (_requestedTradeBar && _requestedQuoteBar)\n                            {\n                                addedData ??= new();\n                                if (!addedData.Add(data.Symbol.ID))\n                                {\n                                    continue;\n                                }\n                            }\n\n                            // the slice already has the data organized by symbol so let's take advantage of it using Bars/QuoteBars collections\n                            QuoteBar quoteBar;\n                            var tradeBar = _requestedTradeBar ? data as TradeBar : null;\n                            if (tradeBar != null)\n                            {\n                                slice.QuoteBars.TryGetValue(tradeBar.Symbol, out quoteBar);\n                            }\n                            else\n                            {\n                                quoteBar = _requestedQuoteBar ? data as QuoteBar : null;\n                                if (quoteBar != null)\n                                {\n                                    slice.Bars.TryGetValue(quoteBar.Symbol, out tradeBar);\n                                }\n                            }\n                            pandasData.Add(tradeBar, quoteBar);\n                        }\n                    }\n\n                    addedData?.Clear();\n                }\n            }\n\n            /// <summary>\n            /// Adds a collection of data and prepares it for DataFrame generation.\n            /// If the collection holds BaseDataCollection instances, they are added to the collections list for proper handling.\n            /// For the rest of the data, PandasData instances are created for each symbol and the data is added to them for later processing.\n            /// </summary>\n            protected void AddData<T>(IEnumerable<T> data)\n                where T : ISymbolProvider\n            {\n                var type = typeof(T);\n                var isCollection = IsCollection(type);\n\n                if (_flatten && isCollection)\n                {\n                    foreach (var collection in data)\n                    {\n                        var baseData = collection as BaseData;\n                        var collectionData = collection as IEnumerable;\n                        AddCollection(baseData.Symbol, baseData.EndTime, collectionData.Cast<ISymbolProvider>());\n                    }\n                }\n                else\n                {\n                    Symbol prevSymbol = null;\n                    PandasData prevPandasData = null;\n                    foreach (var item in data)\n                    {\n                        var pandasData = prevSymbol != null && item.Symbol == prevSymbol ? prevPandasData : GetPandasData(item);\n                        pandasData.Add(item);\n                        prevSymbol = item.Symbol;\n                        prevPandasData = pandasData;\n                    }\n\n                    // Multiple symbols detected, use symbol only indexing for performance reasons\n                    if (_pandasData != null && _pandasData.Count > 1)\n                    {\n                        _shouldUseSymbolOnlyIndex = true;\n                    }\n                }\n            }\n\n            /// <summary>\n            /// Generates the data frame\n            /// </summary>\n            /// <param name=\"levels\">The number of level the index should have. If not provided, it will be inferred from the data</param>\n            /// <param name=\"sort\">Whether to sort the data frames on concatenation</param>\n            /// <param name=\"filterMissingValueColumns\">Whether to filter missing values. See <see cref=\"PandasData.ToPandasDataFrame(int, bool)\"/></param>\n            /// <param name=\"symbolOnlyIndex\">Whether to assume the data has multiple symbols and also one data point per symbol.\n            /// This is used for performance purposes</param>\n            /// <param name=\"forceMultiValueSymbol\">Useful when the data contains points for multiple symbols.\n            /// If false and <paramref name=\"symbolOnlyIndex\"/> is true, it will assume there is a single point for each symbol,\n            /// and will apply performance improvements for the data frame generation.</param>\n            public PyObject GenerateDataFrame(int? levels = null, bool sort = true, bool filterMissingValueColumns = true,\n                bool symbolOnlyIndex = false, bool forceMultiValueSymbol = false)\n            {\n                using var _ = Py.GIL();\n\n                var pandasDataDataFrames = GetPandasDataDataFrames(levels, filterMissingValueColumns, symbolOnlyIndex, forceMultiValueSymbol).ToList();\n                var collectionsDataFrames = GetCollectionsDataFrames(symbolOnlyIndex, forceMultiValueSymbol).ToList();\n\n                try\n                {\n                    if (collectionsDataFrames.Count == 0)\n                    {\n                        return ConcatDataFrames(pandasDataDataFrames, sort, dropna: true);\n                    }\n\n                    var dataFrames = collectionsDataFrames.Select(x => x.Item3).Concat(pandasDataDataFrames);\n\n                    if (symbolOnlyIndex)\n                    {\n                        return ConcatDataFrames(dataFrames, sort, dropna: true);\n                    }\n                    else if (_collections.DistinctBy(x => x.Symbol).Count() > 1)\n                    {\n                        var keys = collectionsDataFrames\n                            .Select(x => new object[] { x.Item1, x.Item2 })\n                            .Concat(pandasDataDataFrames.Select(x => new object[] { x, DateTime.MinValue }));\n                        var names = _collections.Any(x => x.Symbol.IsCanonical())\n                            ? MultiCanonicalSymbolsDataFrameNames\n                            : MultiBaseDataCollectionDataFrameNames;\n\n                        return ConcatDataFrames(dataFrames, keys, names, sort, dropna: true);\n                    }\n                    else\n                    {\n                        var keys = collectionsDataFrames\n                            .Select(x => new object[] { x.Item2 })\n                            .Concat(pandasDataDataFrames.Select(x => new object[] { DateTime.MinValue }));\n\n                        return ConcatDataFrames(dataFrames, keys, SingleBaseDataCollectionDataFrameNames, sort, dropna: true);\n                    }\n                }\n                finally\n                {\n                    foreach (var df in pandasDataDataFrames.Concat(collectionsDataFrames.Select(x => x.Item3)))\n                    {\n                        df.Dispose();\n                    }\n                }\n            }\n\n            /// <summary>\n            /// Creates the data frames for the data stored in the <see cref=\"_pandasData\"/> dictionary\n            /// </summary>\n            private IEnumerable<PyObject> GetPandasDataDataFrames(int? levels, bool filterMissingValueColumns, bool symbolOnlyIndex, bool forceMultiValueSymbol)\n            {\n                if (_pandasData is null || _pandasData.Count == 0)\n                {\n                    yield break;\n                }\n\n                if (!forceMultiValueSymbol && (symbolOnlyIndex || _shouldUseSymbolOnlyIndex))\n                {\n                    yield return PandasData.ToPandasDataFrame(_pandasData.Values, skipTimesColumn: true);\n                    yield break;\n                }\n\n                foreach (var data in _pandasData.Values)\n                {\n                    yield return data.ToPandasDataFrame(levels ?? _maxLevels, filterMissingValueColumns);\n                }\n            }\n\n            /// <summary>\n            /// Generates the data frames for the base data collections\n            /// </summary>\n            private IEnumerable<(Symbol, DateTime, PyObject)> GetCollectionsDataFrames(bool symbolOnlyIndex, bool forceMultiValueSymbol)\n            {\n                if (_collections is null || _collections.Count == 0)\n                {\n                    yield break;\n                }\n\n                foreach (var (symbol, time, data) in _collections.GroupBy(x => x.Symbol).SelectMany(x => x))\n                {\n                    var generator = new DataFrameGenerator(_dataType, timeAsColumn: !symbolOnlyIndex, flatten: _flatten);\n                    generator.AddData(data);\n                    var dataFrame = generator.GenerateDataFrame(symbolOnlyIndex: symbolOnlyIndex, forceMultiValueSymbol: forceMultiValueSymbol);\n\n                    yield return (symbol, time, dataFrame);\n                }\n            }\n\n            private PandasData GetPandasData(ISymbolProvider data)\n            {\n                _pandasData ??= new();\n                if (!_pandasData.TryGetValue(data.Symbol, out var pandasData))\n                {\n                    pandasData = new PandasData(data, _timeAsColumn);\n                    _pandasData[data.Symbol] = pandasData;\n                    _maxLevels = Math.Max(_maxLevels, pandasData.Levels);\n                }\n\n                return pandasData;\n            }\n\n            private void AddCollection(Symbol symbol, DateTime time, IEnumerable<ISymbolProvider> data)\n            {\n                _collections ??= new();\n                _collections.Add((symbol, time, data));\n            }\n\n            /// <summary>\n            /// Determines whether the type is considered a collection for flattening.\n            /// Any object that is a <see cref=\"BaseData\"/> and implements <see cref=\"IEnumerable{ISymbolProvider}\"/>\n            /// is considered a base data collection.\n            /// This allows detecting collections of cases like <see cref=\"OptionUniverse\"/> (which is a direct subclass of\n            /// <see cref=\"BaseDataCollection\"/>) and <see cref=\"OptionChain\"/>, which is a collection of <see cref=\"OptionContract\"/>\n            /// </summary>\n            private static bool IsCollection(Type type)\n            {\n                return type.IsAssignableTo(typeof(BaseData)) &&\n                    type.GetInterfaces().Any(x => x.IsGenericType &&\n                        x.GetGenericTypeDefinition().IsAssignableTo(typeof(IEnumerable<>)) &&\n                        x.GenericTypeArguments[0].IsAssignableTo(typeof(ISymbolProvider)));\n            }\n        }\n\n        private class DataFrameGenerator<T> : DataFrameGenerator\n            where T : ISymbolProvider\n        {\n            public DataFrameGenerator(IEnumerable<T> data, bool flatten)\n                : base(flatten: flatten)\n            {\n                AddData(data);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Collection of methods that converts lists of objects in pandas.DataFrame\n    /// </summary>\n    public partial class PandasConverter\n    {\n        private static dynamic _pandas;\n        private static PyObject _concat;\n\n        /// <summary>\n        /// Initializes the <see cref=\"PandasConverter\"/> class\n        /// </summary>\n        static PandasConverter()\n        {\n            using (Py.GIL())\n            {\n                var pandas = Py.Import(\"pandas\");\n                _pandas = pandas;\n                // keep it so we don't need to ask for it each time\n                _concat = pandas.GetAttr(\"concat\");\n            }\n        }\n\n        /// <summary>\n        /// Converts an enumerable of <see cref=\"Slice\"/> in a pandas.DataFrame\n        /// </summary>\n        /// <param name=\"data\">Enumerable of <see cref=\"Slice\"/></param>\n        /// <param name=\"flatten\">Whether to flatten collections into rows and columns</param>\n        /// <param name=\"dataType\">Optional type of bars to add to the data frame\n        /// If true, the base data items time will be ignored and only the base data collection time will be used in the index</param>\n        /// <returns><see cref=\"PyObject\"/> containing a pandas.DataFrame</returns>\n        public PyObject GetDataFrame(IEnumerable<Slice> data, bool flatten = false, Type dataType = null)\n        {\n            var generator = new DataFrameGenerator(data, flatten, dataType);\n            return generator.GenerateDataFrame();\n        }\n\n        /// <summary>\n        /// Converts an enumerable of <see cref=\"IBaseData\"/> in a pandas.DataFrame\n        /// </summary>\n        /// <param name=\"data\">Enumerable of <see cref=\"Slice\"/></param>\n        /// <param name=\"symbolOnlyIndex\">Whether to make the index only the symbol, without time or any other index levels</param>\n        /// <param name=\"forceMultiValueSymbol\">Useful when the data contains points for multiple symbols.\n        /// If false and <paramref name=\"symbolOnlyIndex\"/> is true, it will assume there is a single point for each symbol,\n        /// and will apply performance improvements for the data frame generation.</param>\n        /// <param name=\"flatten\">Whether to flatten collections into rows and columns</param>\n        /// <returns><see cref=\"PyObject\"/> containing a pandas.DataFrame</returns>\n        /// <remarks>Helper method for testing</remarks>\n        public PyObject GetDataFrame<T>(IEnumerable<T> data, bool symbolOnlyIndex = false, bool forceMultiValueSymbol = false, bool flatten = false)\n            where T : ISymbolProvider\n        {\n            var generator = new DataFrameGenerator<T>(data, flatten);\n            return generator.GenerateDataFrame(\n                // Use 2 instead of maxLevels for backwards compatibility\n                levels: symbolOnlyIndex ? 1 : 2,\n                sort: false,\n                symbolOnlyIndex: symbolOnlyIndex,\n                forceMultiValueSymbol: forceMultiValueSymbol);\n        }\n\n        /// <summary>\n        /// Converts a dictionary with a list of <see cref=\"IndicatorDataPoint\"/> in a pandas.DataFrame\n        /// </summary>\n        /// <param name=\"data\">Dictionary with a list of <see cref=\"IndicatorDataPoint\"/></param>\n        /// <param name=\"extraData\">Optional dynamic properties to include in the DataFrame.</param>\n        /// <returns><see cref=\"PyObject\"/> containing a pandas.DataFrame</returns>\n        public PyObject GetIndicatorDataFrame(IEnumerable<KeyValuePair<string, List<IndicatorDataPoint>>> data, IEnumerable<KeyValuePair<string, List<(DateTime, object)>>> extraData = null)\n        {\n            using (Py.GIL())\n            {\n                using var pyDict = new PyDict();\n\n                foreach (var kvp in data)\n                {\n                    AddSeriesToPyDict(kvp.Key, kvp.Value, pyDict);\n                }\n\n                if (extraData != null)\n                {\n                    foreach (var kvp in extraData)\n                    {\n                        AddDynamicSeriesToPyDict(kvp.Key, kvp.Value, pyDict);\n                    }\n                }\n\n                return MakeIndicatorDataFrame(pyDict);\n            }\n        }\n\n        /// <summary>\n        /// Converts a dictionary with a list of <see cref=\"IndicatorDataPoint\"/> in a pandas.DataFrame\n        /// </summary>\n        /// <param name=\"data\"><see cref=\"PyObject\"/> that should be a dictionary (convertible to PyDict) of string to list of <see cref=\"IndicatorDataPoint\"/></param>\n        /// <returns><see cref=\"PyObject\"/> containing a pandas.DataFrame</returns>\n        public PyObject GetIndicatorDataFrame(PyObject data)\n        {\n            using (Py.GIL())\n            {\n                using var inputPythonType = data.GetPythonType();\n                var inputTypeStr = inputPythonType.ToString();\n                var targetTypeStr = nameof(PyDict);\n                PyObject currentKvp = null;\n\n                try\n                {\n                    using var pyDictData = new PyDict(data);\n                    using var seriesPyDict = new PyDict();\n\n                    targetTypeStr = $\"{nameof(String)}: {nameof(List<IndicatorDataPoint>)}\";\n\n                    foreach (var kvp in pyDictData.Items())\n                    {\n                        currentKvp = kvp;\n                        AddSeriesToPyDict(kvp[0].As<string>(), kvp[1].As<List<IndicatorDataPoint>>(), seriesPyDict);\n                    }\n\n                    return MakeIndicatorDataFrame(seriesPyDict);\n                }\n                catch (Exception e)\n                {\n                    if (currentKvp != null)\n                    {\n                        inputTypeStr = $\"{currentKvp[0].GetPythonType()}: {currentKvp[1].GetPythonType()}\";\n                    }\n\n                    throw new ArgumentException(Messages.PandasConverter.ConvertToDictionaryFailed(inputTypeStr, targetTypeStr, e.Message), e);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns a string that represent the current object\n        /// </summary>\n        /// <returns></returns>\n        public override string ToString()\n        {\n            if (_pandas == null)\n            {\n                return Messages.PandasConverter.PandasModuleNotImported;\n            }\n\n            using (Py.GIL())\n            {\n                return _pandas.Repr();\n            }\n        }\n\n        /// <summary>\n        /// Concatenates multiple data frames\n        /// </summary>\n        /// <param name=\"dataFrames\">The data frames to concatenate</param>\n        /// <param name=\"keys\">\n        /// Optional new keys for a new multi-index level that would be added\n        /// to index each individual data frame in the resulting one\n        /// </param>\n        /// <param name=\"names\">The optional names of the new index level (and the existing ones if they need to be changed)</param>\n        /// <param name=\"sort\">Whether to sort the resulting data frame</param>\n        /// <param name=\"dropna\">Whether to drop columns containing NA values only (Nan, None, etc)</param>\n        /// <returns>A new data frame result from concatenating the input</returns>\n        public static PyObject ConcatDataFrames<T>(IEnumerable<PyObject> dataFrames, IEnumerable<T> keys, IEnumerable<string> names,\n            bool sort = true, bool dropna = true)\n        {\n            using (Py.GIL())\n            {\n                using var pyDataFrames = dataFrames.ToPyListUnSafe();\n\n                if (pyDataFrames.Length() == 0)\n                {\n                    return _pandas.DataFrame();\n                }\n\n                using var kwargs = Py.kw(\"sort\", sort);\n                PyList pyKeys = null;\n                PyList pyNames = null;\n\n                try\n                {\n                    if (keys != null && names != null)\n                    {\n                        pyNames = names.ToPyListUnSafe();\n                        pyKeys = ConvertConcatKeys(keys);\n                        using var pyFalse = false.ToPython();\n\n                        kwargs.SetItem(\"keys\", pyKeys);\n                        kwargs.SetItem(\"names\", pyNames);\n                        kwargs.SetItem(\"copy\", pyFalse);\n                    }\n\n                    var result = _concat.Invoke(new[] { pyDataFrames }, kwargs);\n\n                    // Drop columns with only NaN or None values\n                    if (dropna)\n                    {\n                        using var dropnaKwargs = Py.kw(\"axis\", 1, \"inplace\", true, \"how\", \"all\");\n                        result.GetAttr(\"dropna\").Invoke(Array.Empty<PyObject>(), dropnaKwargs);\n                    }\n\n                    return result;\n                }\n                finally\n                {\n                    pyKeys?.Dispose();\n                    pyNames?.Dispose();\n                }\n            }\n        }\n\n        public static PyObject ConcatDataFrames(IEnumerable<PyObject> dataFrames, bool sort = true, bool dropna = true)\n        {\n            return ConcatDataFrames<string>(dataFrames, null, null, sort, dropna);\n        }\n\n        /// <summary>\n        /// Creates the list of keys required for the pd.concat method, making sure that if the items are enumerables,\n        /// they are converted to Python tuples so that they are used as levels for a multi index\n        /// </summary>\n        private static PyList ConvertConcatKeys(IEnumerable<IEnumerable<object>> keys)\n        {\n            var keyTuples = keys.Select(x => new PyTuple(x.Select(y => y.ToPython()).ToArray()));\n            try\n            {\n                return keyTuples.ToPyListUnSafe();\n            }\n            finally\n            {\n                foreach (var tuple in keyTuples)\n                {\n                    foreach (var x in tuple)\n                    {\n                        x.DisposeSafely();\n                    }\n                    tuple.DisposeSafely();\n                }\n            }\n        }\n\n        private static PyList ConvertConcatKeys<T>(IEnumerable<T> keys)\n        {\n            if ((typeof(T).IsAssignableTo(typeof(IEnumerable)) && !typeof(T).IsAssignableTo(typeof(string))))\n            {\n                return ConvertConcatKeys(keys.Cast<IEnumerable<object>>());\n            }\n\n            return keys.ToPyListUnSafe();\n        }\n\n        /// <summary>\n        /// Creates a series from a list of <see cref=\"IndicatorDataPoint\"/> and adds it to the\n        /// <see cref=\"PyDict\"/> as the value of the given <paramref name=\"key\"/>\n        /// </summary>\n        /// <param name=\"key\">Key to insert in the <see cref=\"PyDict\"/></param>\n        /// <param name=\"points\">List of <see cref=\"IndicatorDataPoint\"/> that will make up the resulting series</param>\n        /// <param name=\"pyDict\"><see cref=\"PyDict\"/> where the resulting key-value pair will be inserted into</param>\n        private void AddSeriesToPyDict(string key, List<IndicatorDataPoint> points, PyDict pyDict)\n        {\n            var index = new List<DateTime>();\n            var values = new List<double>();\n\n            foreach (var point in points)\n            {\n                if (point.EndTime != default)\n                {\n                    index.Add(point.EndTime);\n                    values.Add((double)point.Value);\n                }\n            }\n            pyDict.SetItem(key.ToLowerInvariant(), _pandas.Series(values, index));\n        }\n\n        /// <summary>\n        /// Builds a time‑indexed pandas <see cref=\"Series\"/> from a collection of \n        /// heterogeneous data (numbers, enums, strings, etc.) and inserts it into the\n        /// specified <see cref=\"PyDict\"/> under the given <paramref name=\"key\"/>.\n        /// </summary>\n        /// <param name=\"key\">Key to insert in the <see cref=\"PyDict\"/></param>\n        /// <param name=\"entries\">A list of tuples whose first item is the timestamp and whose second item is the value associated with that timestamp.</param>\n        /// <param name=\"pyDict\"><see cref=\"PyDict\"/> where the resulting key-value pair will be inserted into</param>\n        private void AddDynamicSeriesToPyDict(string key, List<(DateTime Timestamp, object Value)> entries, PyDict pyDict)\n        {\n            var index = new List<DateTime>();\n            var values = new List<object>();\n\n            foreach (var (timestamp, value) in entries)\n            {\n                if (timestamp != default)\n                {\n                    index.Add(timestamp);\n                    values.Add(value is Enum e ? e.ToString() : value);\n                }\n            }\n            pyDict.SetItem(key.ToLowerInvariant(), _pandas.Series(values, index));\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"PyDict\"/> of string to pandas.Series in a pandas.DataFrame\n        /// </summary>\n        /// <param name=\"pyDict\"><see cref=\"PyDict\"/> of string to pandas.Series</param>\n        /// <returns><see cref=\"PyObject\"/> containing a pandas.DataFrame</returns>\n        private PyObject MakeIndicatorDataFrame(PyDict pyDict)\n        {\n            return _pandas.DataFrame(pyDict, columns: pyDict.Keys().Select(x => x.As<string>().ToLowerInvariant()).OrderBy(x => x));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasData.DataTypeMember.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.Text;\n\nnamespace QuantConnect.Python\n{\n    public partial class PandasData\n    {\n        private static DataTypeMember CreateDataTypeMember(MemberInfo member, DataTypeMember[] children = null)\n        {\n            return member switch\n            {\n                PropertyInfo property => new PropertyMember(property, children),\n                FieldInfo field => new FieldMember(field, children),\n                _ => throw new ArgumentException($\"Member type {member.MemberType} is not supported\")\n            };\n        }\n\n        /// <summary>\n        /// Represents a member of a data type, either a property or a field and it's children members in case it's a complex type.\n        /// It contains logic to get the member name and the children names, taking into account the parent prefixes.\n        /// </summary>\n        private abstract class DataTypeMember\n        {\n            private static readonly StringBuilder _stringBuilder = new StringBuilder();\n\n            private DataTypeMember _parent;\n            private string _name;\n\n            public MemberInfo Member { get; }\n\n            public DataTypeMember[] Children { get; }\n\n            public abstract bool IsProperty { get; }\n\n            public abstract bool IsField { get; }\n\n            /// <summary>\n            /// The prefix to be used for the children members when a class being expanded has multiple properties/fields of the same type\n            /// </summary>\n            public string Prefix { get; private set; }\n\n            public bool ShouldBeUnwrapped => Children != null && Children.Length > 0;\n\n            /// <summary>\n            /// Whether this member is Tick.LastPrice or OpenInterest.LastPrice.\n            /// Saved to avoid MemberInfo comparisons in the future\n            /// </summary>\n            public bool IsTickLastPrice { get; }\n\n            public bool IsTickProperty { get; }\n\n            public DataTypeMember(MemberInfo member, DataTypeMember[] children = null)\n            {\n                Member = member;\n                Children = children;\n\n                IsTickLastPrice = member == _tickLastPriceMember || member == _openInterestLastPriceMember;\n                IsTickProperty = IsProperty && member.DeclaringType == typeof(Tick);\n\n                if (Children != null)\n                {\n                    foreach (var child in Children)\n                    {\n                        child._parent = this;\n                    }\n                }\n            }\n\n            public void SetPrefix()\n            {\n                Prefix = Member.Name.ToLowerInvariant();\n            }\n\n            /// <summary>\n            /// Gets the member name, adding the parent prefixes if necessary.\n            /// </summary>\n            /// <param name=\"customName\">If passed, it will be used instead of the <see cref=\"Member\"/>'s name</param>\n            public string GetMemberName(string customName = null)\n            {\n                if (ShouldBeUnwrapped)\n                {\n                    return string.Empty;\n                }\n\n                if (!string.IsNullOrEmpty(customName))\n                {\n                    return BuildMemberName(customName);\n                }\n\n                if (string.IsNullOrEmpty(_name))\n                {\n                    _name = BuildMemberName(GetBaseName());\n                }\n\n                return _name;\n            }\n\n            public IEnumerable<string> GetMemberNames()\n            {\n                return GetMemberNames(null);\n            }\n\n            public abstract object GetValue(object instance);\n\n            public abstract Type GetMemberType();\n\n            public override string ToString()\n            {\n                return $\"{GetMemberType().Name} {Member.Name}\";\n            }\n\n            private string BuildMemberName(string baseName)\n            {\n                _stringBuilder.Clear();\n                while (_parent != null && _parent.ShouldBeUnwrapped)\n                {\n                    _stringBuilder.Insert(0, _parent.Prefix);\n                    _parent = _parent._parent;\n                }\n\n                _stringBuilder.Append(baseName.ToLowerInvariant());\n                return _stringBuilder.ToString();\n            }\n\n            private IEnumerable<string> GetMemberNames(string parentPrefix)\n            {\n                // If there are no children, return the name of the member. Else ignore the member and return the children names\n                if (ShouldBeUnwrapped)\n                {\n                    var prefix = parentPrefix ?? string.Empty;\n                    if (!string.IsNullOrEmpty(Prefix))\n                    {\n                        prefix += Prefix;\n                    }\n\n                    foreach (var child in Children)\n                    {\n                        foreach (var childName in child.GetMemberNames(prefix))\n                        {\n                            yield return childName;\n                        }\n                    }\n                    yield break;\n                }\n\n                var memberName = GetBaseName();\n                _name = string.IsNullOrEmpty(parentPrefix) ? memberName : $\"{parentPrefix}{memberName}\";\n                yield return _name;\n            }\n\n            private string GetBaseName()\n            {\n                var baseName = Member.GetCustomAttribute<PandasColumnAttribute>()?.Name;\n                if (string.IsNullOrEmpty(baseName))\n                {\n                    baseName = Member.Name;\n                }\n\n                return baseName.ToLowerInvariant();\n            }\n        }\n\n        private class PropertyMember : DataTypeMember\n        {\n            private PropertyInfo _property;\n\n            public override bool IsProperty => true;\n\n            public override bool IsField => false;\n\n            public PropertyMember(PropertyInfo property, DataTypeMember[] children = null)\n                : base(property, children)\n            {\n                _property = property;\n            }\n\n            public override object GetValue(object instance)\n            {\n                return _property.GetValue(instance);\n            }\n\n            public override Type GetMemberType()\n            {\n                return _property.PropertyType;\n            }\n        }\n\n        private class FieldMember : DataTypeMember\n        {\n            private FieldInfo _field;\n\n            public override bool IsProperty => false;\n\n            public override bool IsField => true;\n\n            public FieldMember(FieldInfo field, DataTypeMember[] children = null)\n                : base(field, children)\n            {\n                _field = field;\n            }\n\n            public override object GetValue(object instance)\n            {\n                return _field.GetValue(instance);\n            }\n\n            public override Type GetMemberType()\n            {\n                return _field.FieldType;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Organizes a list of data to create pandas.DataFrames\n    /// </summary>\n    public partial class PandasData\n    {\n        // we keep these so we don't need to ask for them each time\n        private static PyString _empty;\n        private static PyObject _pandas;\n        private static PyObject _pandasColumn;\n        private static PyObject _seriesFactory;\n        private static PyObject _dataFrameFactory;\n        private static PyObject _multiIndexFactory;\n        private static PyObject _multiIndex;\n        private static PyObject _indexFactory;\n\n        private static PyList _defaultNames;\n        private static PyList _level1Names;\n        private static PyList _level2Names;\n        private static PyList _level3Names;\n\n        private readonly static Dictionary<Type, List<DataTypeMember>> _membersCache = new();\n\n        private readonly static MemberInfo _tickLastPriceMember = typeof(Tick).GetProperty(nameof(Tick.LastPrice));\n        private readonly static MemberInfo _openInterestLastPriceMember = typeof(OpenInterest).GetProperty(nameof(Tick.LastPrice));\n\n        private static readonly string[] _nonLeanDataTypeForcedMemberNames = new[] { nameof(BaseData.Value) };\n\n        private readonly static string[] _quoteTickOnlyPropertes = new[] {\n            nameof(Tick.AskPrice),\n            nameof(Tick.AskSize),\n            nameof(Tick.BidPrice),\n            nameof(Tick.BidSize)\n        };\n\n        private static readonly Type PandasNonExpandableAttribute = typeof(PandasNonExpandableAttribute);\n        private static readonly Type PandasIgnoreAttribute = typeof(PandasIgnoreAttribute);\n        private static readonly Type PandasIgnoreMembersAttribute = typeof(PandasIgnoreMembersAttribute);\n\n        private static readonly IReadOnlyCollection<DateTime> EmptySeriesTimesKey = new List<DateTime>();\n        private static readonly List<DataTypeMember> EmptyDataTypeMembers = new List<DataTypeMember>();\n\n        private readonly Symbol _symbol;\n        private readonly bool _isFundamentalType;\n        private readonly bool _isBaseData;\n        private readonly bool _timeAsColumn;\n        private readonly Dictionary<string, Serie> _series;\n\n        private readonly Dictionary<Type, List<DataTypeMember>> _members = new();\n\n        /// <summary>\n        /// Gets true if this is a custom data request, false for normal QC data\n        /// </summary>\n        public bool IsCustomData { get; }\n\n        /// <summary>\n        /// Implied levels of a multi index pandas.Series (depends on the security type)\n        /// </summary>\n        public int Levels { get; } = 2;\n\n        /// <summary>\n        /// Initializes the static members of the <see cref=\"PandasData\"/> class\n        /// </summary>\n        static PandasData()\n        {\n            using (Py.GIL())\n            {\n                // Use our PandasMapper class that modifies pandas indexing to support tickers, symbols and SIDs\n                _pandas = Py.Import(\"PandasMapper\");\n                _pandasColumn = _pandas.GetAttr(\"PandasColumn\");\n                _seriesFactory = _pandas.GetAttr(\"Series\");\n                _dataFrameFactory = _pandas.GetAttr(\"DataFrame\");\n                _multiIndex = _pandas.GetAttr(\"MultiIndex\");\n                _multiIndexFactory = _multiIndex.GetAttr(\"from_tuples\");\n                _indexFactory = _pandas.GetAttr(\"Index\");\n                _empty = new PyString(string.Empty);\n\n                var time = new PyString(\"time\");\n                var symbol = new PyString(\"symbol\");\n                var expiry = new PyString(\"expiry\");\n                _defaultNames = new PyList(new PyObject[] { expiry, new PyString(\"strike\"), new PyString(\"type\"), symbol, time });\n                _level1Names = new PyList(new PyObject[] { symbol });\n                _level2Names = new PyList(new PyObject[] { symbol, time });\n                _level3Names = new PyList(new PyObject[] { expiry, symbol, time });\n            }\n        }\n\n        /// <summary>\n        /// Initializes an instance of <see cref=\"PandasData\"/>\n        /// </summary>\n        public PandasData(object data, bool timeAsColumn = false)\n        {\n            _series = new();\n            var baseData = data as IBaseData;\n\n            // in the case we get a list/collection of data we take the first data point to determine the type\n            // but it's also possible to get a data which supports enumerating we don't care about those cases\n            if (baseData == null && data is IEnumerable enumerable)\n            {\n                foreach (var item in enumerable)\n                {\n                    data = item;\n                    baseData = data as IBaseData;\n                    break;\n                }\n            }\n\n            var type = data.GetType();\n            _isFundamentalType = type == typeof(Fundamental);\n            _isBaseData = baseData != null;\n            _timeAsColumn = timeAsColumn && _isBaseData;\n            _symbol = _isBaseData ? baseData.Symbol : ((ISymbolProvider)data).Symbol;\n            IsCustomData = Extensions.IsCustomDataType(_symbol, type);\n\n            if (baseData == null)\n            {\n                Levels = 1;\n            }\n            else if (_symbol.SecurityType == SecurityType.Future)\n            {\n                Levels = 3;\n            }\n            else if (_symbol.SecurityType.IsOption())\n            {\n                Levels = 5;\n            }\n        }\n\n        /// <summary>\n        /// Adds security data object to the end of the lists\n        /// </summary>\n        /// <param name=\"data\"><see cref=\"IBaseData\"/> object that contains security data</param>\n        public void Add(object data)\n        {\n            Add(data, false);\n        }\n\n        private void Add(object data, bool overrideValues)\n        {\n            if (data == null)\n            {\n                return;\n            }\n\n            var typeMembers = GetInstanceDataTypeMembers(data);\n\n            var endTime = default(DateTime);\n            if (_isBaseData)\n            {\n                endTime = ((IBaseData)data).EndTime;\n                if (_timeAsColumn)\n                {\n                    AddToSeries(\"time\", endTime, endTime, overrideValues);\n                }\n            }\n\n            AddMembersData(data, typeMembers, endTime, overrideValues);\n\n            if (data is DynamicData dynamicData)\n            {\n                var storage = dynamicData.GetStorageDictionary();\n                var value = dynamicData.Value;\n                AddToSeries(\"value\", endTime, value, overrideValues);\n\n                foreach (var kvp in storage.Where(x => x.Key != \"value\"\n                    // if this is a PythonData instance we add in '__typename' which we don't want into the data frame\n                    && !x.Key.StartsWith(\"__\", StringComparison.InvariantCulture)))\n                {\n                    AddToSeries(kvp.Key, endTime, kvp.Value, overrideValues);\n                }\n            }\n        }\n\n        private void AddMemberToSeries(object instance, DateTime endTime, DataTypeMember member, bool overrideValues)\n        {\n            var baseName = (string)null;\n            var tick = member.IsTickProperty ? instance as Tick : null;\n            if (tick != null && member.IsTickLastPrice && tick.TickType == TickType.OpenInterest)\n            {\n                baseName = \"OpenInterest\";\n            }\n\n            // TODO field/property.GetValue is expensive\n            var key = member.GetMemberName(baseName);\n            var value = member.GetValue(instance);\n\n            var memberType = member.GetMemberType();\n            // For DataDictionary instances, we only want to add the values\n            if (MemberIsDataDictionary(memberType))\n            {\n                value = memberType.GetProperty(\"Values\").GetValue(value);\n            }\n            else if (member.IsProperty)\n            {\n                if (_isFundamentalType && value is FundamentalTimeDependentProperty timeDependentProperty)\n                {\n                    value = timeDependentProperty.Clone(new FixedTimeProvider(endTime));\n                }\n                else if (member.IsTickProperty && tick != null)\n                {\n                    if (tick.TickType != TickType.Quote && _quoteTickOnlyPropertes.Contains(member.Member.Name))\n                    {\n                        value = null;\n                    }\n                    else if (member.IsTickLastPrice)\n                    {\n                        var nullValueKey = tick.TickType != TickType.OpenInterest\n                            ? member.GetMemberName(\"OpenInterest\")\n                            : member.GetMemberName();\n                        AddToSeries(nullValueKey, endTime, null, overrideValues);\n                    }\n                }\n            }\n\n            AddToSeries(key, endTime, value, overrideValues);\n        }\n\n        /// <summary>\n        /// Adds Lean data objects to the end of the lists\n        /// </summary>\n        /// <param name=\"tradeBar\"><see cref=\"TradeBar\"/> object that contains trade bar information of the security</param>\n        /// <param name=\"quoteBar\"><see cref=\"QuoteBar\"/> object that contains quote bar information of the security</param>\n        public void Add(TradeBar tradeBar, QuoteBar quoteBar)\n        {\n            // Quote bar first, so if there is a trade bar, OHLC will be overwritten\n            Add(quoteBar);\n            Add(tradeBar, overrideValues: true);\n        }\n\n        /// <summary>\n        /// Get the pandas.DataFrame of the current <see cref=\"PandasData\"/> state\n        /// </summary>\n        /// <param name=\"levels\">Number of levels of the multi index</param>\n        /// <param name=\"filterMissingValueColumns\">If false, make sure columns with \"missing\" values only are still added to the dataframe</param>\n        /// <returns>pandas.DataFrame object</returns>\n        public PyObject ToPandasDataFrame(int levels = 2, bool filterMissingValueColumns = true)\n        {\n            using var _ = Py.GIL();\n\n            PyObject[] indexTemplate;\n            // Create the index labels\n            var names = _defaultNames;\n\n            if (levels == 1)\n            {\n                names = _level1Names;\n                indexTemplate = GetIndexTemplate(_symbol);\n            }\n            else if (levels == 2)\n            {\n                // symbol, time\n                names = _level2Names;\n                indexTemplate = GetIndexTemplate(_symbol, null);\n            }\n            else if (levels == 3)\n            {\n                // expiry, symbol, time\n                names = _level3Names;\n                indexTemplate = GetIndexTemplate(_symbol.ID.Date, _symbol, null);\n            }\n            else\n            {\n                if (_symbol.SecurityType == SecurityType.Future)\n                {\n                    indexTemplate = GetIndexTemplate(_symbol.ID.Date, null, null, _symbol, null);\n                }\n                else if (_symbol.SecurityType.IsOption())\n                {\n                    indexTemplate = GetIndexTemplate(_symbol.ID.Date, _symbol.ID.StrikePrice, _symbol.ID.OptionRight, _symbol, null);\n                }\n                else\n                {\n                    indexTemplate = GetIndexTemplate(null, null, null, _symbol, null);\n                }\n            }\n\n            names = new PyList(names.SkipLast(names.Count() > 1 && _timeAsColumn ? 1 : 0).ToArray());\n\n            // creating the pandas MultiIndex is expensive so we keep a cash\n            var indexCache = new Dictionary<IReadOnlyCollection<DateTime>, PyObject>(new ListComparer<DateTime>());\n            // Returns a dictionary keyed by column name where values are pandas.Series objects\n            using var pyDict = new PyDict();\n            foreach (var (seriesName, serie) in _series)\n            {\n                if (filterMissingValueColumns && serie.ShouldFilter) continue;\n\n                var key = serie.Times ?? EmptySeriesTimesKey;\n                if (!indexCache.TryGetValue(key, out var index))\n                {\n                    PyList indexSource;\n                    if (_timeAsColumn)\n                    {\n                        indexSource = serie.Values.Select(_ => CreateIndexSourceValue(DateTime.MinValue, indexTemplate)).ToPyListUnSafe();\n                    }\n                    else\n                    {\n                        indexSource = serie.Times.Select(time => CreateIndexSourceValue(time, indexTemplate)).ToPyListUnSafe();\n                    }\n\n                    if (indexTemplate.Length == 1)\n                    {\n                        using var nameDic = Py.kw(\"name\", names[0]);\n                        index = _indexFactory.Invoke(new[] { indexSource }, nameDic);\n                    }\n                    else\n                    {\n                        using var namesDic = Py.kw(\"names\", names);\n                        index = _multiIndexFactory.Invoke(new[] { indexSource }, namesDic);\n                    }\n\n                    indexCache[key] = index;\n\n                    foreach (var pyObject in indexSource)\n                    {\n                        pyObject.Dispose();\n                    }\n                    indexSource.Dispose();\n                }\n\n                // Adds pandas.Series value keyed by the column name\n                using var pyvalues = new PyList();\n                for (var i = 0; i < serie.Values.Count; i++)\n                {\n                    using var pyObject = serie.Values[i].ToPython();\n                    pyvalues.Append(pyObject);\n                }\n                using var series = _seriesFactory.Invoke(pyvalues, index);\n                using var pyStrKey = seriesName.ToPython();\n                using var pyKey = _pandasColumn.Invoke(pyStrKey);\n                pyDict.SetItem(pyKey, series);\n            }\n            _series.Clear();\n            foreach (var kvp in indexCache)\n            {\n                kvp.Value.Dispose();\n            }\n\n            for (var i = 0; i < indexTemplate.Length; i++)\n            {\n                DisposeIfNotEmpty(indexTemplate[i]);\n            }\n            names.Dispose();\n\n            // Create the DataFrame\n            var result = _dataFrameFactory.Invoke(pyDict);\n\n            foreach (var item in pyDict)\n            {\n                item.Dispose();\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method to create a single pandas data frame indexed by symbol\n        /// </summary>\n        /// <remarks>Will add a single point per pandas data series (symbol)</remarks>\n        public static PyObject ToPandasDataFrame(IEnumerable<PandasData> pandasDatas, bool skipTimesColumn = false)\n        {\n            using var _ = Py.GIL();\n\n            using var list = pandasDatas.Select(x => x._symbol).ToPyListUnSafe();\n\n            using var namesDic = Py.kw(\"name\", _level1Names[0]);\n            using var index = _indexFactory.Invoke(new[] { list }, namesDic);\n\n            var valuesPerSeries = new Dictionary<string, PyList>();\n            var seriesToSkip = new Dictionary<string, bool>();\n            foreach (var pandasData in pandasDatas)\n            {\n                foreach (var kvp in pandasData._series)\n                {\n                    if (skipTimesColumn && kvp.Key == \"time\")\n                    {\n                        continue;\n                    }\n\n                    if (seriesToSkip.ContainsKey(kvp.Key))\n                    {\n                        seriesToSkip[kvp.Key] &= kvp.Value.ShouldFilter;\n                    }\n                    else\n                    {\n                        seriesToSkip[kvp.Key] = kvp.Value.ShouldFilter;\n                    }\n\n                    if (!valuesPerSeries.TryGetValue(kvp.Key, out PyList value))\n                    {\n                        // Adds pandas.Series value keyed by the column name\n                        value = valuesPerSeries[kvp.Key] = new PyList();\n                    }\n\n                    if (kvp.Value.Values.Count > 0)\n                    {\n                        // taking only 1 value per symbol\n                        using var valueOfSymbol = kvp.Value.Values[0].ToPython();\n                        value.Append(valueOfSymbol);\n                    }\n                    else\n                    {\n                        value.Append(PyObject.None);\n                    }\n                }\n            }\n\n            using var pyDict = new PyDict();\n            foreach (var kvp in valuesPerSeries)\n            {\n                if (seriesToSkip.TryGetValue(kvp.Key, out var skip) && skip)\n                {\n                    continue;\n                }\n\n                using var series = _seriesFactory.Invoke(kvp.Value, index);\n                using var pyStrKey = kvp.Key.ToPython();\n                using var pyKey = _pandasColumn.Invoke(pyStrKey);\n                pyDict.SetItem(pyKey, series);\n\n                kvp.Value.Dispose();\n            }\n            var result = _dataFrameFactory.Invoke(pyDict);\n\n            // Drop columns with only NaN or None values\n            using var dropnaKwargs = Py.kw(\"axis\", 1, \"inplace\", true, \"how\", \"all\");\n            result.GetAttr(\"dropna\").Invoke(Array.Empty<PyObject>(), dropnaKwargs);\n\n            return result;\n        }\n\n        private List<DataTypeMember> GetInstanceDataTypeMembers(object data)\n        {\n            var type = data.GetType();\n            if (!_members.TryGetValue(type, out var members))\n            {\n                HashSet<string> columnNames;\n\n                if (data is DynamicData dynamicData)\n                {\n                    columnNames = (data as DynamicData)?.GetStorageDictionary()\n                        // if this is a PythonData instance we add in '__typename' which we don't want into the data frame\n                        .Where(x => !x.Key.StartsWith(\"__\", StringComparison.InvariantCulture)).ToHashSet(x => x.Key);\n                    columnNames.Add(\"value\");\n                    members = EmptyDataTypeMembers;\n                }\n                else\n                {\n                    members = GetTypeMembers(type);\n                    columnNames = members.SelectMany(x => x.GetMemberNames()).ToHashSet();\n                    // We add openinterest key so the series is created: open interest tick LastPrice is renamed to OpenInterest\n                    if (data is Tick)\n                    {\n                        columnNames.Add(\"openinterest\");\n                    }\n                }\n\n                _members[type] = members;\n\n                if (_timeAsColumn)\n                {\n                    columnNames.Add(\"time\");\n                }\n\n                foreach (var columnName in columnNames)\n                {\n                    _series.TryAdd(columnName, new Serie(withTimeIndex: !_timeAsColumn));\n                }\n            }\n\n            return members;\n        }\n\n        /// <summary>\n        /// Gets or create/adds the <see cref=\"DataTypeMember\"/> instances corresponding to the members of the given type,\n        /// and returns the names of the members.\n        /// </summary>\n        private List<DataTypeMember> GetTypeMembers(Type type)\n        {\n            List<DataTypeMember> typeMembers;\n            lock (_membersCache)\n            {\n                if (!_membersCache.TryGetValue(type, out typeMembers))\n                {\n                    var forcedInclusionMembers = LeanData.IsCommonLeanDataType(type)\n                        ? Array.Empty<string>()\n                        : _nonLeanDataTypeForcedMemberNames;\n                    typeMembers = GetDataTypeMembers(type, forcedInclusionMembers).ToList();\n                    _membersCache[type] = typeMembers;\n                }\n            }\n\n            _members[type] = typeMembers;\n            return typeMembers;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"DataTypeMember\"/> instances corresponding to the members of the given type.\n        /// It will try to unwrap properties which types are classes unless they are marked either to be ignored or to be added as a whole\n        /// </summary>\n        private static IEnumerable<DataTypeMember> GetDataTypeMembers(Type type, string[] forcedInclusionMembers)\n        {\n            var members = type\n                .GetMembers(BindingFlags.Instance | BindingFlags.Public)\n                .Where(x => x.MemberType == MemberTypes.Field || x.MemberType == MemberTypes.Property)\n                .Where(x => forcedInclusionMembers.Contains(x.Name)\n                    || (!x.IsDefined(PandasIgnoreAttribute) && !x.DeclaringType.IsDefined(PandasIgnoreMembersAttribute)));\n\n            return members\n                .Select(member =>\n                {\n                    var dataTypeMember = CreateDataTypeMember(member);\n                    var memberType = dataTypeMember.GetMemberType();\n\n                    // Should we unpack its properties into columns?\n                    if (memberType.IsClass\n                        && (memberType.Namespace == null\n                            // We only expand members of types in the QuantConnect namespace,\n                            // else we might be expanding types like System.String, NodaTime.DateTimeZone or any other external types\n                            || (memberType.Namespace.StartsWith(\"QuantConnect.\", StringComparison.InvariantCulture)\n                                && !memberType.IsDefined(PandasNonExpandableAttribute)\n                                && !member.IsDefined(PandasNonExpandableAttribute))))\n                    {\n                        dataTypeMember = CreateDataTypeMember(member, GetDataTypeMembers(memberType, forcedInclusionMembers).ToArray());\n                    }\n\n                    return (memberType, dataTypeMember);\n                })\n                // Check if there are multiple properties/fields of the same type,\n                // in which case we add the property/field name as prefix for the inner members to avoid name conflicts\n                .GroupBy(x => x.memberType, x => x.dataTypeMember)\n                .SelectMany(grouping =>\n                {\n                    var typeProperties = grouping.ToList();\n                    if (typeProperties.Count > 1)\n                    {\n                        var propertiesToExpand = typeProperties.Where(x => x.ShouldBeUnwrapped).ToList();\n                        if (propertiesToExpand.Count > 1)\n                        {\n                            foreach (var property in propertiesToExpand)\n                            {\n                                property.SetPrefix();\n                            }\n                        }\n                    }\n\n                    return typeProperties;\n                });\n        }\n\n        /// <summary>\n        /// Adds the member value to the corresponding series, making sure unwrapped values a properly added\n        /// by checking the children members and adding their values to their own series\n        /// </summary>\n        private void AddMembersData(object instance, IEnumerable<DataTypeMember> members, DateTime endTime, bool overrideValues)\n        {\n            foreach (var member in members)\n            {\n                if (!member.ShouldBeUnwrapped)\n                {\n                    AddMemberToSeries(instance, endTime, member, overrideValues);\n                }\n                else\n                {\n                    var memberValue = member.GetValue(instance);\n                    if (memberValue != null)\n                    {\n                        AddMembersData(memberValue, member.Children, endTime, overrideValues);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Only dipose of the PyObject if it was set to something different than empty\n        /// </summary>\n        private static void DisposeIfNotEmpty(PyObject pyObject)\n        {\n            if (!ReferenceEquals(pyObject, _empty))\n            {\n                pyObject.Dispose();\n            }\n        }\n\n        private static bool MemberIsDataDictionary(Type memberType)\n        {\n            while (memberType != null && !memberType.IsValueType)\n            {\n                if (memberType.IsGenericType && memberType.GetGenericTypeDefinition() == typeof(DataDictionary<>))\n                {\n                    return true;\n                }\n                memberType = memberType.BaseType;\n            }\n\n            return false;\n        }\n\n        private PyObject[] GetIndexTemplate(params object[] args)\n        {\n            return args.SkipLast(args.Length > 1 && _timeAsColumn ? 1 : 0).Select(x => x?.ToPython() ?? _empty).ToArray();\n        }\n\n        /// <summary>\n        /// Create a new tuple index\n        /// </summary>\n        private PyObject CreateIndexSourceValue(DateTime index, PyObject[] list)\n        {\n            if (!_timeAsColumn && list.Length > 1)\n            {\n                DisposeIfNotEmpty(list[^1]);\n                list[^1] = index.ToPython();\n            }\n\n            if (list.Length > 1)\n            {\n                return new PyTuple(list.ToArray());\n            }\n\n            return list[0].ToPython();\n        }\n\n        /// <summary>\n        /// Adds data to dictionary\n        /// </summary>\n        /// <param name=\"key\">The key of the value to get</param>\n        /// <param name=\"time\"><see cref=\"DateTime\"/> object to add to the value associated with the specific key</param>\n        /// <param name=\"input\"><see cref=\"Object\"/> to add to the value associated with the specific key. Can be null.</param>\n        private void AddToSeries(string key, DateTime time, object input, bool overrideValues)\n        {\n            if (!_series.TryGetValue(key, out var serie))\n            {\n                throw new ArgumentException($\"PandasData.AddToSeries(): {Messages.PandasData.KeyNotFoundInSeries(key)}\");\n            }\n\n            serie.Add(time, input, overrideValues);\n        }\n\n        private class Serie\n        {\n            private static readonly IFormatProvider InvariantCulture = CultureInfo.InvariantCulture;\n\n            public bool ShouldFilter { get; private set; }\n            public List<DateTime> Times { get; }\n            public List<object> Values { get; }\n\n            public Serie(bool withTimeIndex = true)\n            {\n                ShouldFilter = true;\n                Values = new();\n                if (withTimeIndex)\n                {\n                    Times = new();\n                }\n            }\n\n            public void Add(DateTime time, object input, bool overrideValues)\n            {\n                var value = input is decimal ? Convert.ToDouble(input, InvariantCulture) : input;\n                if (ShouldFilter)\n                {\n                    // we need at least 1 valid entry for the series not to get filtered\n                    if (value is double doubleValue)\n                    {\n                        if (!doubleValue.IsNaNOrZero())\n                        {\n                            ShouldFilter = false;\n                        }\n                    }\n                    else if (value is string stringValue)\n                    {\n                        if (!string.IsNullOrWhiteSpace(stringValue))\n                        {\n                            ShouldFilter = false;\n                        }\n                    }\n                    else if (value is bool boolValue)\n                    {\n                        if (boolValue)\n                        {\n                            ShouldFilter = false;\n                        }\n                    }\n                    else if (value != null)\n                    {\n                        if (value is ICollection enumerable)\n                        {\n                            if (enumerable.Count != 0)\n                            {\n                                ShouldFilter = false;\n                            }\n                        }\n                        else\n                        {\n                            ShouldFilter = false;\n                        }\n                    }\n                }\n\n                if (overrideValues && Times != null && Times.Count > 0 && Times[^1] == time)\n                {\n                    // If the time is the same as the last one, we overwrite the value\n                    Values[^1] = value;\n                }\n                else\n                {\n                    Values.Add(value);\n                    Times?.Add(time);\n                }\n            }\n        }\n\n        private class FixedTimeProvider : ITimeProvider\n        {\n            private readonly DateTime _time;\n            public DateTime GetUtcNow() => _time;\n            public FixedTimeProvider(DateTime time)\n            {\n                _time = time;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasIgnoreAttribute.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Attribute to mark a property or field as ignored when converting an instance to a pandas DataFrame row.\n    /// No column will be created for this property or field.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]\n    public sealed class PandasIgnoreAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasIgnoreMembersAttribute.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Attribute to indicate the pandas converter to ignore all members of the class when converting an instance to a pandas DataFrame row.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class, Inherited = false)]\n    public sealed class PandasIgnoreMembersAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Python/PandasNonExpandableAttribute.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Attribute to mark a class, field or property as non-expandable by the pandas converter.\n    /// The instance will be added to the dataframe as it is, without unwrapping its fields and properties into columns.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field)]\n    public sealed class PandasNonExpandableAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Python/Python.Runtime.dll.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <!-- For Linux and Mac users: uncomment and fill either of the following: -->\n    <!-- <dllmap os=\"linux\" dll=\"python3.6m\" target = \"/home/{your_user_name}/miniconda3/envs/{qc_environment}/lib/libpython3.6m.so\"/> -->\n    <!-- <dllmap os=\"osx\" dll=\"python3.6m\" target = \"/Users/{your_user_name}/anaconda3/lib/libpython3.6m.dylib\"/> -->\n</configuration>\n"
  },
  {
    "path": "Common/Python/PythonActivator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides methods for creating new instances of python custom data objects\n    /// </summary>\n    public class PythonActivator\n    {\n        /// <summary>\n        /// <see cref=\"System.Type\"/> of the object we wish to create\n        /// </summary>\n        public Type Type { get; }\n\n        /// <summary>\n        /// Method to return an instance of object\n        /// </summary>\n        public Func<object[], object> Factory { get;  }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PythonActivator\"/>\n        /// </summary>\n        /// <param name=\"type\"><see cref=\"System.Type\"/> of the object we wish to create</param>\n        /// <param name=\"value\"><see cref=\"PyObject\"/> that contains the python type</param>\n        public PythonActivator(Type type, PyObject value)\n        {\n            Type = type;\n\n            Factory = x =>\n            {\n                using (Py.GIL())\n                {\n                    var instance = value.Invoke();\n                    return new PythonData(instance);\n                }\n            };\n        }\n    }\n}"
  },
  {
    "path": "Common/Python/PythonConsolidator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing System;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides a base class for python consolidators, necessary to use event handler.\n    /// </summary>\n    public class PythonConsolidator : IDataConsolidator\n    {\n        /// <summary>\n        /// Gets the most recently consolidated piece of data. This will be null if this consolidator\n        /// has not produced any data yet.\n        /// </summary>\n        public IBaseData Consolidated\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets a clone of the data being currently consolidated\n        /// </summary>\n        public IBaseData WorkingData\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the type consumed by this consolidator\n        /// </summary>\n        public Type InputType\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the type produced by this consolidator\n        /// </summary>\n        public Type OutputType\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Event handler that fires when a new piece of data is produced\n        /// </summary>\n        public event DataConsolidatedHandler DataConsolidated;\n\n        /// <summary>\n        /// Function to invoke the event handler\n        /// </summary>\n        /// <param name=\"consolidator\">Reference to the consolidator itself</param>\n        /// <param name=\"data\">The finished data from the consolidator</param>\n        public void OnDataConsolidated(PyObject consolidator, IBaseData data)\n        {\n            DataConsolidated?.Invoke(consolidator, data);\n        }\n\n        /// <summary>\n        /// Resets the consolidator\n        /// </summary>\n        public virtual void Reset()\n        {\n            Consolidated = null;\n            WorkingData = null;\n        }\n\n        /// <summary>\n        /// Scans this consolidator to see if it should emit a bar due to time passing\n        /// </summary>\n        /// <param name=\"currentLocalTime\">The current time in the local time zone (same as <see cref=\"BaseData.Time\"/>)</param>\n        public virtual void Scan(DateTime currentLocalTime)\n        {\n        }\n\n        /// <summary>\n        /// Updates this consolidator with the specified data\n        /// </summary>\n        /// <param name=\"data\">The new data for the consolidator</param>\n        public virtual void Update(IBaseData data)\n        {\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PythonData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Dynamic data class for Python algorithms.\n    /// Stores properties of python instances in DynamicData dictionary\n    /// </summary>\n    public class PythonData : DynamicData\n    {\n        private readonly string _pythonTypeName;\n        private readonly dynamic _pythonReader;\n        private readonly dynamic _pythonGetSource;\n        private readonly dynamic _pythonData;\n        private readonly dynamic _defaultResolution;\n        private readonly dynamic _supportedResolutions;\n        private readonly dynamic _isSparseData;\n        private readonly dynamic _requiresMapping;\n        private DateTime _endTime;\n\n        /// <summary>\n        /// The end time of this data. Some data covers spans (trade bars)\n        /// and as such we want to know the entire time span covered\n        /// </summary>\n        /// <remarks>\n        /// This property is overriden to allow different values for Time and EndTime\n        /// if they are set in the Reader. In the base implementation EndTime equals Time\n        /// </remarks>\n        public override DateTime EndTime\n        {\n            get\n            {\n                return _endTime == default ? Time : _endTime;\n            }\n            set\n            {\n                _endTime = value;\n                if(Time == default)\n                {\n                    // if Time hasn't been set let's set it, like BaseData does. If the user overrides it that's okay\n                    Time = value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Constructor for initializing the PythonData class\n        /// </summary>\n        public PythonData()\n        {\n            //Empty constructor required for fast-reflection initialization\n        }\n\n        /// <summary>\n        /// Constructor for initializing the PythonData class with wrapped PyObject\n        /// </summary>\n        /// <param name=\"pythonData\"></param>\n        public PythonData(PyObject pythonData)\n        {\n            _pythonData = pythonData;\n            using (Py.GIL())\n            {\n                // these methods rely on the Symbol so we can call them yet but we can get them\n                _requiresMapping = pythonData.GetMethod(\"RequiresMapping\");\n                _isSparseData = pythonData.GetMethod(\"IsSparseData\");\n                _defaultResolution = pythonData.GetMethod(\"DefaultResolution\");\n                _supportedResolutions = pythonData.GetMethod(\"SupportedResolutions\");\n                _pythonReader = pythonData.GetMethod(\"Reader\");\n                _pythonGetSource = pythonData.GetMethod(\"GetSource\");\n                _pythonTypeName = pythonData.GetPythonType().GetAssemblyName().Name;\n            }\n        }\n\n        /// <summary>\n        /// Source Locator for algorithm written in Python.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration object</param>\n        /// <param name=\"date\">Date of the data file we're looking for</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns>STRING API Url.</returns>\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            using (Py.GIL())\n            {\n                var source = _pythonGetSource(config, date, isLiveMode);\n                return (source as PyObject).GetAndDispose<SubscriptionDataSource>();\n            }\n        }\n\n        /// <summary>\n        /// Generic Reader Implementation for Python Custom Data.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration</param>\n        /// <param name=\"line\">CSV line of data from the source</param>\n        /// <param name=\"date\">Date of the requested line</param>\n        /// <param name=\"isLiveMode\">true if we're in live mode, false for backtesting mode</param>\n        /// <returns></returns>\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            using (Py.GIL())\n            {\n                var data = _pythonReader(config, line, date, isLiveMode);\n                var result = (data as PyObject).GetAndDispose<BaseData>();\n\n                (result as PythonData)?.SetProperty(\"__typename\", _pythonTypeName);\n\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Indicates if there is support for mapping\n        /// </summary>\n        /// <returns>True indicates mapping should be used</returns>\n        public override bool RequiresMapping()\n        {\n            if (_requiresMapping == null)\n            {\n                return base.RequiresMapping();\n            }\n            using (Py.GIL())\n            {\n                return _requiresMapping();\n            }\n        }\n\n        /// <summary>\n        /// Indicates that the data set is expected to be sparse\n        /// </summary>\n        /// <remarks>Relies on the <see cref=\"Symbol\"/> property value</remarks>\n        /// <returns>True if the data set represented by this type is expected to be sparse</returns>\n        public override bool IsSparseData()\n        {\n            if (_isSparseData == null)\n            {\n                return base.IsSparseData();\n            }\n            using (Py.GIL())\n            {\n                return _isSparseData();\n            }\n        }\n\n        /// <summary>\n        /// Gets the default resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override Resolution DefaultResolution()\n        {\n            if (_defaultResolution == null)\n            {\n                return base.DefaultResolution();\n            }\n            using (Py.GIL())\n            {\n                return _defaultResolution();\n            }\n        }\n\n        /// <summary>\n        /// Gets the supported resolution for this data and security type\n        /// </summary>\n        /// <remarks>This is a method and not a property so that python\n        /// custom data types can override it</remarks>\n        public override List<Resolution> SupportedResolutions()\n        {\n            if (_supportedResolutions == null)\n            {\n                return base.SupportedResolutions();\n            }\n            using (Py.GIL())\n            {\n                return _supportedResolutions();\n            }\n        }\n\n        /// <summary>\n        /// Indexes into this PythonData, where index is key to the dynamic property\n        /// </summary>\n        /// <param name=\"index\">the index</param>\n        /// <returns>Dynamic property of a given index</returns>\n        public object this[string index]\n        {\n            get\n            {\n                return GetProperty(index);\n            }\n\n            set\n            {\n                SetProperty(index, value is double ? value.ConvertInvariant<decimal>() : value);\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine if the current instance is of the provided type\n        /// </summary>\n        /// <param name=\"type\">Target type to check against</param>\n        /// <returns>True if this instance is of the provided type</returns>\n        public bool IsOfType(Type type)\n        {\n            if (HasProperty(\"__typename\"))\n            {\n                return (string)GetProperty(\"__typename\") == type.FullName;\n            }\n            return GetType() == type;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PythonInitializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Helper class for Python initialization\n    /// </summary>\n    public static class PythonInitializer\n    {\n        private static bool IncludeSystemPackages;\n        private static string PathToVirtualEnv;\n\n        // Used to allow multiple Python unit and regression tests to be run in the same test run\n        private static bool _isInitialized;\n\n        // Used to hold pending path additions before Initialize is called\n        private static List<string> _pendingPathAdditions = new List<string>();\n\n        private static string _algorithmLocation;\n\n        /// <summary>\n        /// Initialize python.\n        ///\n        /// In some cases, we might not need to call BeginAllowThreads, like when we're running\n        /// in a python or non-threaded environment.\n        /// In those cases, we can set the beginAllowThreads parameter to false.\n        /// </summary>\n        public static void Initialize(bool beginAllowThreads = true)\n        {\n            if (!_isInitialized)\n            {\n                Log.Trace($\"PythonInitializer.Initialize(): {Messages.PythonInitializer.Start}...\");\n                PythonEngine.Initialize();\n\n                if (beginAllowThreads)\n                {\n                    // required for multi-threading usage\n                    PythonEngine.BeginAllowThreads();\n                }\n\n                _isInitialized = true;\n\n                ConfigurePythonPaths();\n\n                TryInitPythonVirtualEnvironment();\n                Log.Trace($\"PythonInitializer.Initialize(): {Messages.PythonInitializer.Ended}\");\n            }\n        }\n\n        /// <summary>\n        /// Shutdown python\n        /// </summary>\n        public static void Shutdown()\n        {\n            if (_isInitialized)\n            {\n                Log.Trace($\"PythonInitializer.Shutdown(): {Messages.PythonInitializer.Start}\");\n                _isInitialized = false;\n\n                try\n                {\n                    var pyLock = Py.GIL();\n                    PythonEngine.Shutdown();\n                }\n                catch (Exception ex)\n                {\n                    Log.Error(ex);\n                }\n\n                Log.Trace($\"PythonInitializer.Shutdown(): {Messages.PythonInitializer.Ended}\");\n            }\n        }\n\n        /// <summary>\n        /// Adds directories to the python path at runtime\n        /// </summary>\n        public static bool AddPythonPaths(IEnumerable<string> paths)\n        {\n            // Filter out any paths that are already on our Python path\n            if (paths.IsNullOrEmpty())\n            {\n                return false;\n            }\n\n            // Add these paths to our pending additions\n            _pendingPathAdditions.AddRange(paths.Where(x => !_pendingPathAdditions.Contains(x)));\n\n            if (_isInitialized)\n            {\n                using (Py.GIL())\n                {\n                    using dynamic sys = Py.Import(\"sys\");\n                    using var locals = new PyDict();\n                    locals.SetItem(\"sys\", sys);\n\n                    // Filter out any already paths that already exist on our current PythonPath\n                    using var pythonCurrentPath = PythonEngine.Eval(\"sys.path\", locals: locals);\n                    var currentPath = pythonCurrentPath.As<List<string>>();\n                    _pendingPathAdditions = _pendingPathAdditions.Where(x => !currentPath.Contains(x.Replace('\\\\', '/'))).ToList();\n\n                    // Algorithm location most always be before any other path added through this method\n                    var insertionIndex = 0;\n                    if (!_algorithmLocation.IsNullOrEmpty())\n                    {\n                        insertionIndex = currentPath.IndexOf(_algorithmLocation.Replace('\\\\', '/')) + 1;\n\n                        if (insertionIndex == 0)\n                        {\n                            // The algorithm location is not in the current path so it must be in the pending additions list.\n                            // Let's move it to the back so it ends up added at the beginning of the path list\n                            _pendingPathAdditions.Remove(_algorithmLocation);\n                            _pendingPathAdditions.Add(_algorithmLocation);\n                        }\n                    }\n\n                    // Insert any pending path additions\n                    if (!_pendingPathAdditions.IsNullOrEmpty())\n                    {\n                        var code = string.Join(\";\", _pendingPathAdditions\n                            .Select(s => $\"sys.path.insert({insertionIndex}, '{s}')\")).Replace('\\\\', '/');\n                        PythonEngine.Exec(code, locals: locals);\n\n                        _pendingPathAdditions.Clear();\n                    }\n                }\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Adds the algorithm location to the python path.\n        /// This will make sure that <see cref=\"AddPythonPaths\" /> keeps the algorithm location path\n        /// at the beginning of the pythonpath.\n        /// </summary>\n        public static void AddAlgorithmLocationPath(string algorithmLocation)\n        {\n            if (!_algorithmLocation.IsNullOrEmpty())\n            {\n                return;\n            }\n\n            if (!Directory.Exists(algorithmLocation))\n            {\n                Log.Error($@\"PythonInitializer.AddAlgorithmLocationPath(): {\n                    Messages.PythonInitializer.UnableToLocateAlgorithm(algorithmLocation)}\");\n                return;\n            }\n\n            _algorithmLocation = algorithmLocation;\n            AddPythonPaths(new[] { _algorithmLocation });\n        }\n\n        /// <summary>\n        /// Resets the algorithm location path so another can be set\n        /// </summary>\n        public static void ResetAlgorithmLocationPath()\n        {\n            _algorithmLocation = null;\n        }\n\n        /// <summary>\n        /// \"Activate\" a virtual Python environment by prepending its library storage to Pythons\n        /// path. This allows the libraries in this venv to be selected prior to our base install.\n        /// Requires PYTHONNET_PYDLL to be set to base install.\n        /// </summary>\n        /// <remarks>If a module is already loaded, Python will use its cached version first\n        /// these modules must be reloaded by reload() from importlib library</remarks>\n        public static bool ActivatePythonVirtualEnvironment(string pathToVirtualEnv)\n        {\n            if (string.IsNullOrEmpty(pathToVirtualEnv))\n            {\n                return false;\n            }\n\n            if(!Directory.Exists(pathToVirtualEnv))\n            {\n                Log.Error($@\"PythonIntializer.ActivatePythonVirtualEnvironment(): {\n                    Messages.PythonInitializer.VirutalEnvironmentNotFound(pathToVirtualEnv)}\");\n                return false;\n            }\n\n            PathToVirtualEnv = pathToVirtualEnv;\n\n            bool? includeSystemPackages = null;\n            var configFile = new FileInfo(Path.Combine(PathToVirtualEnv, \"pyvenv.cfg\"));\n            if(configFile.Exists)\n            {\n                foreach (var line in File.ReadAllLines(configFile.FullName))\n                {\n                    if (line.Contains(\"include-system-site-packages\", StringComparison.InvariantCultureIgnoreCase))\n                    {\n                        // format: include-system-site-packages = false (or true)\n                        var equalsIndex = line.IndexOf('=', StringComparison.InvariantCultureIgnoreCase);\n                        if(equalsIndex != -1 && line.Length > (equalsIndex + 1) && bool.TryParse(line.Substring(equalsIndex + 1).Trim(), out var result))\n                        {\n                            includeSystemPackages = result;\n                            break;\n                        }\n                    }\n                }\n            }\n\n            if(!includeSystemPackages.HasValue)\n            {\n                includeSystemPackages = true;\n                Log.Error($@\"PythonIntializer.ActivatePythonVirtualEnvironment(): {\n                    Messages.PythonInitializer.FailedToFindSystemPackagesConfiguration(pathToVirtualEnv, configFile)}\");\n            }\n            else\n            {\n                Log.Trace($@\"PythonIntializer.ActivatePythonVirtualEnvironment(): {\n                    Messages.PythonInitializer.SystemPackagesConfigurationFound(pathToVirtualEnv, includeSystemPackages.Value)}\");\n            }\n\n            if (!includeSystemPackages.Value)\n            {\n                PythonEngine.SetNoSiteFlag();\n            }\n\n            IncludeSystemPackages = includeSystemPackages.Value;\n\n            TryInitPythonVirtualEnvironment();\n            return true;\n        }\n\n        private static void TryInitPythonVirtualEnvironment()\n        {\n            if (!_isInitialized || string.IsNullOrEmpty(PathToVirtualEnv))\n            {\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                using dynamic sys = Py.Import(\"sys\");\n                using var locals = new PyDict();\n                locals.SetItem(\"sys\", sys);\n\n                if (!IncludeSystemPackages)\n                {\n                    var currentPath = (List<string>)sys.path.As<List<string>>();\n                    var toRemove = new List<string>(currentPath.Where(s => s.Contains(\"site-packages\", StringComparison.InvariantCultureIgnoreCase)));\n                    if (toRemove.Count > 0)\n                    {\n                        var code = string.Join(\";\", toRemove.Select(s => $\"sys.path.remove('{s}')\"));\n                        PythonEngine.Exec(code, locals: locals);\n                    }\n                }\n\n                // fix the prefixes to point to our venv\n                sys.prefix = PathToVirtualEnv;\n                sys.exec_prefix = PathToVirtualEnv;\n\n                using dynamic site = Py.Import(\"site\");\n                // This has to be overwritten because site module may already have been loaded by the interpreter (but not run yet)\n                site.PREFIXES = new List<PyObject> { sys.prefix, sys.exec_prefix };\n                // Run site path modification with tweaked prefixes\n                site.main();\n\n                if (IncludeSystemPackages)\n                {\n                    // let's make sure our site packages is at the start so that we support overriding system libraries with a version in the env\n                    PythonEngine.Exec(@$\"if sys.path[-1].startswith('{PathToVirtualEnv}'):\n    sys.path.insert(0, sys.path.pop())\", locals: locals);\n                }\n\n                if (Log.DebuggingEnabled)\n                {\n                    using dynamic os = Py.Import(\"os\");\n                    var path = new List<string>();\n                    foreach (var p in sys.path)\n                    {\n                        path.Add((string)p);\n                    }\n\n                    Log.Debug($\"PythonIntializer.InitPythonVirtualEnvironment(): PYTHONHOME: {os.getenv(\"PYTHONHOME\")}.\" +\n                        $\" PYTHONPATH: {os.getenv(\"PYTHONPATH\")}.\" +\n                        $\" sys.executable: {sys.executable}.\" +\n                        $\" sys.prefix: {sys.prefix}.\" +\n                        $\" sys.base_prefix: {sys.base_prefix}.\" +\n                        $\" sys.exec_prefix: {sys.exec_prefix}.\" +\n                        $\" sys.base_exec_prefix: {sys.base_exec_prefix}.\" +\n                        $\" sys.path: [{string.Join(\",\", path)}]\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the python additional paths from the config and adds them to Python using the PythonInitializer\n        /// </summary>\n        private static void ConfigurePythonPaths()\n        {\n            var pythonAdditionalPaths = new List<string> { Environment.CurrentDirectory };\n            pythonAdditionalPaths.AddRange(Config.GetValue(\"python-additional-paths\", Enumerable.Empty<string>()));\n            AddPythonPaths(pythonAdditionalPaths.Where(path =>\n            {\n                var pathExists = Directory.Exists(path);\n                if (!pathExists)\n                {\n                    Log.Error($\"PythonInitializer.ConfigurePythonPaths(): {Messages.PythonInitializer.PythonPathNotFound(path)}\");\n                }\n\n                return pathExists;\n            }));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/PythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing Python.Runtime;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides extension methods for managing python wrapper classes\n    /// </summary>\n    public static class PythonWrapper\n    {\n        /// <summary>\n        /// Validates that the specified <see cref=\"PyObject\"/> completely implements the provided interface type\n        /// </summary>\n        /// <typeparam name=\"TInterface\">The interface type</typeparam>\n        /// <param name=\"model\">The model implementing the interface type</param>\n        public static PyObject ValidateImplementationOf<TInterface>(this PyObject model)\n        {\n            var notInterface = !typeof(TInterface).IsInterface;\n            var missingMembers = new List<string>();\n            var members = typeof(TInterface).GetMembers(BindingFlags.Public | BindingFlags.Instance);\n            using (Py.GIL())\n            {\n                foreach (var member in members)\n                {\n                    var method = member as MethodInfo;\n                    if ((method == null || !method.IsSpecialName) &&\n                        !model.HasAttr(member.Name) && !model.HasAttr(member.Name.ToSnakeCase()))\n                    {\n                        if (notInterface)\n                        {\n                            if (method != null && !method.IsAbstract && (method.IsFinal || !method.IsVirtual || method.DeclaringType != typeof(TInterface)))\n                            {\n                                continue;\n                            }\n                            else if (member is ConstructorInfo)\n                            {\n                                continue;\n                            }\n                            else if (member.Name is \"ToString\")\n                            {\n                                continue;\n                            }\n                        }\n                        missingMembers.Add(member.Name);\n                    }\n                }\n\n                if (missingMembers.Any())\n                {\n                    throw new NotImplementedException(\n                        Messages.PythonWrapper.InterfaceNotFullyImplemented(typeof(TInterface).Name, model.GetPythonType().Name, missingMembers));\n                }\n            }\n\n            return model;\n        }\n\n        /// <summary>\n        /// Invokes the specified method on the provided <see cref=\"PyObject\"/> instance with the specified arguments\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"PyObject\"/> instance</param>\n        /// <param name=\"methodName\">The name of the method to invoke</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The return value of the called method converted into the <typeparamref name=\"T\"/> type</returns>\n        public static T InvokeMethod<T>(this PyObject model, string methodName, params object[] args)\n        {\n            using var _ = Py.GIL();\n            return InvokeMethodImpl(model, methodName, args).GetAndDispose<T>();\n        }\n\n        /// <summary>\n        /// Invokes the specified method on the provided <see cref=\"PyObject\"/> instance with the specified arguments\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"PyObject\"/> instance</param>\n        /// <param name=\"methodName\">The name of the method to invoke</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        public static void InvokeMethod(this PyObject model, string methodName, params object[] args)\n        {\n            InvokeMethodImpl(model, methodName, args);\n        }\n\n        /// <summary>\n        /// Invokes the given <see cref=\"PyObject\"/> method with the specified arguments\n        /// </summary>\n        /// <param name=\"method\">The method to invoke</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        /// <returns>The return value of the called method converted into the <typeparamref name=\"T\"/> type</returns>\n        public static T Invoke<T>(this PyObject method, params object[] args)\n        {\n            using var _ = Py.GIL();\n            return InvokeMethodImpl(method, args).GetAndDispose<T>();\n        }\n\n        /// <summary>\n        /// Invokes the given <see cref=\"PyObject\"/> method with the specified arguments\n        /// </summary>\n        /// <param name=\"method\">The method to invoke</param>\n        /// <param name=\"args\">The arguments to call the method with</param>\n        public static PyObject Invoke(this PyObject method, params object[] args)\n        {\n            return InvokeMethodImpl(method, args);\n        }\n\n        private static PyObject InvokeMethodImpl(PyObject model, string methodName, params object[] args)\n        {\n            using var _ = Py.GIL();\n            PyObject method = model.GetMethod(methodName);\n            return InvokeMethodImpl(method, args);\n        }\n\n        private static PyObject InvokeMethodImpl(PyObject method, params object[] args)\n        {\n            using var _ = Py.GIL();\n            return method.Invoke(args.Select(arg => arg.ToPython()).ToArray());\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/RiskFreeInterestRateModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a risk-free interest rate model\n    /// </summary>\n    public class RiskFreeInterestRateModelPythonWrapper : BasePythonWrapper<IRiskFreeInterestRateModel>, IRiskFreeInterestRateModel\n    {\n        /// <summary>\n        /// Constructor for initializing the <see cref=\"RiskFreeInterestRateModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a security's model of buying power</param>\n        public RiskFreeInterestRateModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Get interest rate by a given date\n        /// </summary>\n        /// <param name=\"date\">The date</param>\n        /// <returns>Interest rate on the given date</returns>\n        public decimal GetInterestRate(DateTime date)\n        {\n            return InvokeMethod<decimal>(nameof(GetInterestRate), date);\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"PyObject\"/> object into a <see cref=\"IRiskFreeInterestRateModel\"/> object, wrapping it if necessary\n        /// </summary>\n        /// <param name=\"model\">The Python model</param>\n        /// <returns>The converted <see cref=\"IRiskFreeInterestRateModel\"/> instance</returns>\n        public static IRiskFreeInterestRateModel FromPyObject(PyObject model)\n        {\n            var riskFreeInterestRateModel = PythonUtil.CreateInstanceOrWrapper<IRiskFreeInterestRateModel>(\n                model,\n                py => new RiskFreeInterestRateModelPythonWrapper(py)\n            );\n            return riskFreeInterestRateModel;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/SecurityInitializerPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a type capable of initializing a new security\n    /// </summary>\n    public class SecurityInitializerPythonWrapper : BasePythonWrapper<ISecurityInitializer>, ISecurityInitializer\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"SecurityInitializerPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a type capable of initializing a new security</param>\n        public SecurityInitializerPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to be initialized</param>\n        public void Initialize(Security security)\n        {\n            InvokeMethod(nameof(Initialize), security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/SettlementModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISettlementModel\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class SettlementModelPythonWrapper : BasePythonWrapper<ISettlementModel>, ISettlementModel\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"SettlementModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Settlement Python Model</param>\n        public SettlementModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Applies cash settlement rules using the method defined in the Python class\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        public void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            InvokeMethod(nameof(ApplyFunds), applyFundsParameters);\n        }\n\n        /// <summary>\n        /// Scan for pending settlements using the method defined in the Python class\n        /// </summary>\n        /// <param name=\"settlementParameters\">The settlement parameters</param>\n        public void Scan(ScanSettlementModelParameters settlementParameters)\n        {\n            InvokeMethod(nameof(Scan), settlementParameters);\n        }\n\n        /// <summary>\n        /// Gets the unsettled cash amount for the security\n        /// </summary>\n        public CashAmount GetUnsettledCash()\n        {\n            var result = InvokeMethod<CashAmount?>(nameof(GetUnsettledCash));\n            if (result == null)\n            {\n                return default;\n            }\n\n            return result.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/SignalExportTargetPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISignalExportTarget\"/> that wraps a <see cref=\"PyObject\"/> object\n    /// </summary>\n    public class SignalExportTargetPythonWrapper : BasePythonWrapper<ISignalExportTarget>, ISignalExportTarget\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"SignalExportTargetPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"instance\">The underlying python instance</param>\n        public SignalExportTargetPythonWrapper(PyObject instance) : base(instance) { }\n\n        /// <summary>\n        /// Interface to send positions holdings to different 3rd party API's\n        /// </summary>\n        public bool Send(SignalExportTargetParameters parameters)\n        {\n            return InvokeMethod<bool>(nameof(Send), parameters);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. \n        /// </summary>\n        public void Dispose()\n        {\n            InvokeMethod(nameof(Dispose));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/SlippageModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Wraps a <see cref=\"PyObject\"/> object that represents a model that simulates market order slippage\n    /// </summary>\n    public class SlippageModelPythonWrapper : BasePythonWrapper<ISlippageModel>, ISlippageModel\n    {\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"SlippageModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\">Represents a model that simulates market order slippage</param>\n        public SlippageModelPythonWrapper(PyObject model)\n            : base(model)\n        {\n        }\n\n        /// <summary>\n        /// Slippage Model. Return a decimal cash slippage approximation on the order.\n        /// </summary>\n        /// <param name=\"asset\">The security matching the order</param>\n        /// <param name=\"order\">The order to compute slippage for</param>\n        /// <returns>The slippage of the order in units of the account currency</returns>\n        public decimal GetSlippageApproximation(Security asset, Order order)\n        {\n            return InvokeMethod<decimal>(nameof(GetSlippageApproximation), asset, order);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Python/VolatilityModelPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Python\n{\n    /// <summary>\n    /// Provides a volatility model that wraps a <see cref=\"PyObject\"/> object that represents a model that computes the volatility of a security\n    /// </summary>\n    public class VolatilityModelPythonWrapper : BaseVolatilityModel\n    {\n        private readonly BasePythonWrapper<IVolatilityModel> _model;\n\n        /// <summary>\n        /// Constructor for initialising the <see cref=\"VolatilityModelPythonWrapper\"/> class with wrapped <see cref=\"PyObject\"/> object\n        /// </summary>\n        /// <param name=\"model\"> Represents a model that computes the volatility of a security</param>\n        public VolatilityModelPythonWrapper(PyObject model)\n        {\n            _model = new BasePythonWrapper<IVolatilityModel>(model);\n        }\n\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        public override decimal Volatility\n        {\n            get\n            {\n                return _model.GetProperty<decimal>(nameof(Volatility));\n            }\n        }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\">The new data used to update the model</param>\n        public override void Update(Security security, BaseData data)\n        {\n            _model.InvokeMethod(nameof(Update), security, data).Dispose();\n        }\n\n        /// <summary>\n        /// Returns history requirements for the volatility model expressed in the form of history request\n        /// </summary>\n        /// <param name=\"security\">The security of the request</param>\n        /// <param name=\"utcTime\">The date/time of the request</param>\n        /// <returns>History request object list, or empty if no requirements</returns>\n        public override IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        {\n            return _model.InvokeMethodAndEnumerate<HistoryRequest>(nameof(GetHistoryRequirements), security, utcTime);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ISubscriptionDataConfigProvider\"/> instance to use.\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigProvider\">Provides access to registered <see cref=\"SubscriptionDataConfig\"/></param>\n        public override void SetSubscriptionDataConfigProvider(\n            ISubscriptionDataConfigProvider subscriptionDataConfigProvider)\n        {\n            if (_model.HasAttr(nameof(SetSubscriptionDataConfigProvider)))\n            {\n                _model.InvokeMethod(nameof(SetSubscriptionDataConfigProvider), subscriptionDataConfigProvider).Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/QuantConnect.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <TargetFramework>net10.0</TargetFramework>\n    <AssemblyName>QuantConnect.Common</AssemblyName>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <RestorePackages>true</RestorePackages>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Common.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Common Project - A collection of common definitions and utils</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' AND '$(SelectedOptimization)' == ''\">\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <Target Name=\"PrintRID\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"CloneExtensions\" Version=\"1.3.0\" />\n    <PackageReference Include=\"fasterflect\" Version=\"3.0.0\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"Microsoft.IO.RecyclableMemoryStream\" Version=\"3.0.1\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n    <PackageReference Include=\"protobuf-net\" Version=\"3.1.33\" />\n    <PackageReference Include=\"QLNet\" Version=\"1.13.1\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Compression\\QuantConnect.Compression.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <Content Include=\"AlgorithmImports.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n      <PackageCopyToOutput>true</PackageCopyToOutput>\n    </Content>\n    <Content Include=\"PandasMapper.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n      <PackageCopyToOutput>true</PackageCopyToOutput>\n    </Content>\n      <Content Include=\"Orders\\Slippage\\VolumeShareSlippageModel.py\">\n        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n      </Content>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Common/RealTimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ITimeProvider\"/> that\n    /// uses <see cref=\"DateTime.UtcNow\"/> to provide the current time\n    /// </summary>\n    public sealed class RealTimeProvider : ITimeProvider\n    {\n        /// <summary>\n        /// Provides a static instance of the <see cref=\"RealTimeProvider\"/>\n        /// </summary>\n        /// <remarks>\n        /// Since this implementation is stateless, it doesn't make sense to have multiple instances.\n        /// </remarks>\n        public static readonly ITimeProvider Instance = new RealTimeProvider();\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        public DateTime GetUtcNow()\n        {\n            return DateTime.UtcNow;\n        }\n    }\n}"
  },
  {
    "path": "Common/RealTimeSynchronizedTimer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace QuantConnect \n{\n    /// <summary>\n    /// Real time timer class for precise callbacks on a millisecond resolution in a self managed thread.\n    /// </summary>\n    /// <remarks>Due to the way Window's system clock works the clock is only accurate to the nearest 16ms. In linux it is accurate to the millisecond.</remarks>\n    public class RealTimeSynchronizedTimer\n    {        \n        private bool _stopped;\n        private Thread _thread;\n        private TimeSpan _period;\n        private Action<DateTime> _callback = null;\n        private Stopwatch _timer = new Stopwatch();\n        private DateTime _triggerTime;\n        private bool _paused;\n\n        /// <summary>\n        /// Constructor for Real Time Event Driver:\n        /// </summary>\n        public RealTimeSynchronizedTimer()\n        {\n            _period = TimeSpan.FromSeconds(0);\n            _thread = new Thread(Scanner) { IsBackground = true };\n        }\n\n        /// <summary>\n        /// Trigger an event callback after precisely milliseconds-lapsed. \n        /// This is expensive, it creates a new thread and closely monitors the loop.\n        /// </summary>\n        /// <param name=\"period\">delay period between event callbacks</param>\n        /// <param name=\"callback\">Callback event passed the UTC time the event is intended to be triggered</param>\n        public RealTimeSynchronizedTimer(TimeSpan period, Action<DateTime> callback)\n        {\n            _period = period;\n            _callback = callback;\n            _timer = new Stopwatch();\n            _thread = new Thread(Scanner) { IsBackground = true };\n            _stopped = false;\n            _triggerTime = DateTime.UtcNow.RoundUp(period);\n        }\n\n        /// <summary>\n        /// Start the synchronized real time timer - fire events at start of each second or minute \n        /// </summary>\n        public void Start()\n        { \n            _timer.Start();\n            _thread.Start();\n            _triggerTime = DateTime.UtcNow.RoundDown(_period).Add(_period);\n        }\n        \n        /// <summary>\n        /// Scan the stopwatch for the desired millisecond delay:\n        /// </summary>\n        public void Scanner()\n        {\n            while (!_stopped)\n            {\n                if (_callback != null && DateTime.UtcNow >= _triggerTime)\n                {\n                    _timer.Restart();\n                    var triggeredAt = _triggerTime;\n                    _triggerTime = DateTime.UtcNow.RoundDown(_period).Add(_period);\n                    _callback(triggeredAt);\n                }\n\n                while (_paused && !_stopped) Thread.Sleep(10);\n                Thread.Sleep(1);\n            }\n        }\n\n        /// <summary>\n        /// Hang the real time event:\n        /// </summary>\n        public void Pause()\n        {\n            _paused = true;\n        }\n\n        /// <summary>\n        /// Resume clock\n        /// </summary>\n        public void Resume()\n        {\n            _paused = false;\n        }\n\n        /// <summary>\n        /// Stop the real time timer:\n        /// </summary>\n        public void Stop()\n        {\n            _stopped = true;\n        }\n\n    } // End Time Class\n\n} // End QC Namespace\n"
  },
  {
    "path": "Common/RegressionTestException.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Custom exception class for regression tests\n    /// </summary>\n    public class RegressionTestException: Exception\n    {\n        /// <summary>\n        /// Creates a new instance of a <see cref=\"RegressionTestException\"/>\n        /// </summary>\n        public RegressionTestException() { }\n\n        /// <summary>\n        /// Creates a new isntance of a <see cref=\"RegressionTestException\"/>\n        /// </summary>\n        /// <param name=\"message\">Message to be thrown by the exception</param>\n        public RegressionTestException(string message): base(message) { }\n\n        /// <summary>\n        /// Creates a new instance of a <see cref=\"RegressionTestException\"/>\n        /// </summary>\n        /// <param name=\"message\">Message to be thrown by the exception</param>\n        /// <param name=\"inner\">Inner exception thrown</param>\n        public RegressionTestException(string message, Exception inner) :base(message, inner) { }\n    }\n}\n"
  },
  {
    "path": "Common/Result.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Statistics;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Base class for backtesting and live results that packages result data.\n    /// <see cref=\"LiveResult\"/>\n    /// <see cref=\"BacktestResult\"/>\n    /// </summary>\n    public class Result\n    {\n        /// <summary>\n        /// Charts updates for the live algorithm since the last result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, Chart> Charts { get; set; }\n\n        /// <summary>\n        /// Order updates since the last result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<int, Order> Orders { get; set; }\n\n        /// <summary>\n        /// OrderEvent updates since the last result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public List<OrderEvent> OrderEvents { get; set; }\n\n        /// <summary>\n        /// Trade profit and loss information since the last algorithm result packet\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<DateTime, decimal> ProfitLoss { get; set; }\n\n        /// <summary>\n        /// Statistics information sent during the algorithm operations.\n        /// </summary>\n        /// <remarks>Intended for update mode -- send updates to the existing statistics in the result GUI. If statistic key does not exist in GUI, create it</remarks>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> Statistics { get; set; }\n\n        /// <summary>\n        /// Runtime banner/updating statistics in the title banner of the live algorithm GUI.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> RuntimeStatistics { get; set; }\n\n        /// <summary>\n        /// State of the result packet.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> State { get; set; }\n\n        /// <summary>\n        /// Server status information, including CPU/RAM usage, ect...\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public IDictionary<string, string> ServerStatistics { get; set; }\n\n        /// <summary>\n        /// The algorithm's configuration required for report generation\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public AlgorithmConfiguration AlgorithmConfiguration { get; set; }\n\n        /// <summary>\n        /// Rolling window detailed statistics.\n        /// </summary>\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\n        public AlgorithmPerformance TotalPerformance { get; set; }\n\n        /// <summary>\n        /// Creates new empty instance\n        /// </summary>\n        public Result()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new result from the given parameters\n        /// </summary>\n        public Result(BaseResultParameters parameters)\n        {\n            Charts = parameters.Charts;\n            Orders = parameters.Orders;\n            ProfitLoss = parameters.ProfitLoss;\n            Statistics = parameters.Statistics;\n            RuntimeStatistics = parameters.RuntimeStatistics;\n            OrderEvents = parameters.OrderEvents;\n            AlgorithmConfiguration = parameters.AlgorithmConfiguration;\n            State = parameters.State;\n            TotalPerformance = parameters.TotalPerformance;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/ScatterChartPoint.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// A chart point for a scatter series plot\n    /// </summary>\n    [JsonConverter(typeof(ScatterChartPointJsonConverter))]\n    public class ScatterChartPoint : ChartPoint\n    {\n        /// <summary>\n        /// A summary of this point for the tooltip\n        /// </summary>\n        [JsonProperty(PropertyName = \"tooltip\", DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public string Tooltip { get; set; }\n\n        /// <summary>\n        /// Creates a new empty instance\n        /// </summary>\n        public ScatterChartPoint()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance at the specified time and value\n        /// </summary>\n        public ScatterChartPoint(long time, decimal? value, string tooltip = null) : base(time, value)\n        {\n            Tooltip = tooltip;\n        }\n\n        /// <summary>\n        /// Creates a new instance at the specified time and value\n        /// </summary>\n        public ScatterChartPoint(DateTime time, decimal? value, string tooltip = null) : base(time, value)\n        {\n            Tooltip = tooltip;\n        }\n\n        /// <summary>\n        /// Clones this instance\n        /// </summary>\n        /// <returns>Clone of this instance</returns>\n        public override ISeriesPoint Clone()\n        {\n            return new ScatterChartPoint { x = X, y = Y, Tooltip = Tooltip };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/ScatterChartPointJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// <see cref=\"ScatterChartPoint\"/> json converter\n    /// </summary>\n    public class ScatterChartPointJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Default writer\n        /// </summary>\n        public override bool CanWrite => false;\n\n        /// <summary>\n        /// Determine if this Converter can convert this type\n        /// </summary>\n        /// <param name=\"objectType\">Type that we would like to convert</param>\n        /// <returns>True if <see cref=\"Series\"/></returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(ScatterChartPoint);\n        }\n\n        /// <summary>\n        /// Reads series from Json\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.StartObject)\n            {\n                var jObject = JObject.Load(reader);\n                var tooltip = jObject.TryGetPropertyValue<string>(\"tooltip\");\n\n                return new ScatterChartPoint(jObject[\"x\"].Value<long>(), jObject[\"y\"].Value<decimal?>(), tooltip);\n            }\n\n            var jArray = JArray.Load(reader);\n            return new ScatterChartPoint(jArray[0].Value<long>(), jArray[1].Value<decimal?>());\n        }\n\n        /// <summary>\n        /// Writes a Json from series\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/BaseScheduleRules.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Base rule scheduler\n    /// </summary>\n    public class BaseScheduleRules\n    {\n        private bool _sentImplicitWarning;\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// The algorithm's default time zone\n        /// </summary>\n        protected DateTimeZone TimeZone { get; set; }\n\n        /// <summary>\n        /// The security manager\n        /// </summary>\n        protected SecurityManager Securities { get; set; }\n\n        /// <summary>\n        /// The market hours database instance to use\n        /// </summary>\n        protected MarketHoursDatabase MarketHoursDatabase { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeRules\"/> helper class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"securities\">The security manager</param>\n        /// <param name=\"timeZone\">The algorithm's default time zone</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database instance to use</param>\n        public BaseScheduleRules(IAlgorithm algorithm, SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase)\n        {\n            TimeZone = timeZone;\n            _algorithm = algorithm;\n            Securities = securities;\n            MarketHoursDatabase = marketHoursDatabase;\n        }\n\n        /// <summary>\n        /// Helper method to fetch the security exchange hours\n        /// </summary>\n        protected SecurityExchangeHours GetSecurityExchangeHours(Symbol symbol)\n        {\n            if (!Securities.TryGetValue(symbol, out var security))\n            {\n                return MarketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType).ExchangeHours;\n            }\n            return security.Exchange.Hours;\n        }\n\n        protected Symbol GetSymbol(string ticker)\n        {\n            if (SymbolCache.TryGetSymbol(ticker, out var symbolCache))\n            {\n                return symbolCache;\n            }\n\n            if (!_sentImplicitWarning)\n            {\n                _sentImplicitWarning = true;\n                _algorithm?.Debug($\"Warning: no existing symbol found for ticker {ticker}, it will be created with {SecurityType.Equity} type.\");\n            }\n            symbolCache = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            SymbolCache.Set(ticker, symbolCache);\n            return symbolCache;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/CompositeTimeRule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Combines multiple time rules into a single rule that emits for each rule\n    /// </summary>\n    public class CompositeTimeRule : ITimeRule\n    {\n        /// <summary>\n        /// Gets the individual rules for this composite rule\n        /// </summary>\n        public IReadOnlyList<ITimeRule> Rules { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeTimeRule\"/> class\n        /// </summary>\n        /// <param name=\"timeRules\">The time rules to compose</param>\n        public CompositeTimeRule(params ITimeRule[] timeRules)\n            : this((IEnumerable<ITimeRule>) timeRules)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeTimeRule\"/> class\n        /// </summary>\n        /// <param name=\"timeRules\">The time rules to compose</param>\n        public CompositeTimeRule(IEnumerable<ITimeRule> timeRules)\n        {\n            Rules = timeRules.ToList();\n        }\n\n        /// <summary>\n        /// Gets a name for this rule\n        /// </summary>\n        public string Name\n        {\n            get { return string.Join(\",\", Rules.Select(x => x.Name)); }\n        }\n\n        /// <summary>\n        /// Creates the event times for the specified dates in UTC\n        /// </summary>\n        /// <param name=\"dates\">The dates to apply times to</param>\n        /// <returns>An enumerable of date times that is the result\n        /// of applying this rule to the specified dates</returns>\n        public IEnumerable<DateTime> CreateUtcEventTimes(IEnumerable<DateTime> dates)\n        {\n            foreach (var date in dates)\n            {\n                // make unqiue times and order the events before yielding\n                var enumerable = new[] {date};\n                var times = Rules.SelectMany(time => time.CreateUtcEventTimes(enumerable)).ToHashSet().OrderBy(x => x);\n                foreach (var time in times)\n                {\n                    yield return time;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/DateRules.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing System.Globalization;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Helper class used to provide better syntax when defining date rules\n    /// </summary>\n    public class DateRules : BaseScheduleRules\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DateRules\"/> helper class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"securities\">The security manager</param>\n        /// <param name=\"timeZone\">The algorithm's default time zone</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database instance to use</param>\n        public DateRules(IAlgorithm algorithm, SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase)\n            : base(algorithm, securities, timeZone, marketHoursDatabase)\n        {\n        }\n\n        /// <summary>\n        /// Sets the default time zone\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone to use for helper methods that can't resolve a time zone</param>\n        public void SetDefaultTimeZone(DateTimeZone timeZone)\n        {\n            TimeZone = timeZone;\n        }\n\n        /// <summary>\n        /// Specifies an event should fire only on the specified day\n        /// </summary>\n        /// <param name=\"year\">The year</param>\n        /// <param name=\"month\">The month</param>\n        /// <param name=\"day\">The day</param>\n        /// <returns></returns>\n        public IDateRule On(int year, int month, int day)\n        {\n            // make sure they're date objects\n            var dates = new[] {new DateTime(year, month, day)};\n            return new FuncDateRule(string.Join(\",\", dates.Select(x => x.ToShortDateString())), (start, end) => dates.Where(x => x >= start && x <= end));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire only on the specified days\n        /// </summary>\n        /// <param name=\"dates\">The dates the event should fire</param>\n        public IDateRule On(params DateTime[] dates)\n        {\n            // make sure they're date objects\n            dates = dates.Select(x => x.Date).ToArray();\n            return new FuncDateRule(string.Join(\",\", dates.Select(x => x.ToShortDateString())), (start, end) => dates.Where(x => x >= start && x <= end));\n        }\n\n        /// <summary>\n        /// Specifies an event should only fire today in the algorithm's time zone\n        /// using _securities.UtcTime instead of 'start' since ScheduleManager backs it up a day\n        /// </summary>\n        public IDateRule Today => new FuncDateRule(\"TodayOnly\",\n            (start, e) => {\n                return new[] { Securities.UtcTime.ConvertFromUtc(TimeZone).Date };\n            }\n        );\n\n        /// <summary>\n        /// Specifies an event should only fire tomorrow in the algorithm's time zone\n        /// using _securities.UtcTime instead of 'start' since ScheduleManager backs it up a day\n        /// </summary>\n        public IDateRule Tomorrow => new FuncDateRule(\"TomorrowOnly\",\n            (start, e) => new[] {Securities.UtcTime.ConvertFromUtc(TimeZone).Date.AddDays(1)}\n        );\n\n        /// <summary>\n        /// Specifies an event should fire on each of the specified days of week\n        /// </summary>\n        /// <param name=\"day\">The day the event should fire</param>\n        /// <returns>A date rule that fires on every specified day of week</returns>\n        public IDateRule Every(DayOfWeek day) => Every(new[] { day });\n\n        /// <summary>\n        /// Specifies an event should fire on each of the specified days of week\n        /// </summary>\n        /// <param name=\"days\">The days the event should fire</param>\n        /// <returns>A date rule that fires on every specified day of week</returns>\n        public IDateRule Every(params DayOfWeek[] days)\n        {\n            var hash = days.ToHashSet();\n            return new FuncDateRule(string.Join(\",\", days), (start, end) => Time.EachDay(start, end).Where(date => hash.Contains(date.DayOfWeek)));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire every day\n        /// </summary>\n        /// <returns>A date rule that fires every day</returns>\n        public IDateRule EveryDay()\n        {\n            return new FuncDateRule(\"EveryDay\", Time.EachDay);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire every day the symbol is trading\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine tradable dates</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires every day the specified symbol trades</returns>\n        public IDateRule EveryDay(string symbol, bool extendedMarketHours = false) => EveryDay(GetSymbol(symbol), extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire every day the symbol is trading\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine tradable dates</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires every day the specified symbol trades</returns>\n        public IDateRule EveryDay(Symbol symbol, bool extendedMarketHours = false)\n        {\n            var securitySchedule = GetSecurityExchangeHours(symbol);\n            return new FuncDateRule($\"{symbol.Value}: EveryDay\", (start, end) => Time.EachTradeableDay(securitySchedule, start, end, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the first of each year + offset\n        /// </summary>\n        /// <param name=\"daysOffset\"> The amount of days to offset the schedule by; must be between 0 and 365.</param>\n        /// <returns>A date rule that fires on the first of each year + offset</returns>\n        public IDateRule YearStart(int daysOffset = 0)\n        {\n            return YearStart((Symbol)null, daysOffset, false);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified symbol of each year\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first tradable date of the year</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the schedule by; must be between 0 and 365</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the first tradable date + offset for the\n        /// specified security each year</returns>\n        public IDateRule YearStart(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => YearStart(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified symbol of each year\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first tradable date of the year</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the schedule by; must be between 0 and 365</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the first tradable date + offset for the\n        /// specified security each year</returns>\n        public IDateRule YearStart(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 365 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.YearStart() : Offset must be between 0 and 365\");\n            }\n\n            SecurityExchangeHours securityExchangeHours = null;\n            if (symbol != null)\n            {\n                securityExchangeHours = GetSecurityExchangeHours(symbol);\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"YearStart\", daysOffset), (start, end) => YearIterator(securityExchangeHours, start, end, daysOffset, true, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the last of each year\n        /// </summary>\n        /// <param name=\"daysOffset\"> The amount of days to offset the schedule by; must be between 0 and 365</param>\n        /// <returns>A date rule that fires on the last of each year - offset</returns>\n        public IDateRule YearEnd(int daysOffset = 0)\n        {\n            return YearEnd((Symbol)null, daysOffset, false);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the last tradable date - offset for the specified symbol of each year\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last tradable date of the year</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the schedule by; must be between 0 and 365.</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the last tradable date - offset for the specified security each year</returns>\n        public IDateRule YearEnd(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => YearEnd(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the last tradable date - offset for the specified symbol of each year\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last tradable date of the year</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the schedule by; must be between 0 and 365.</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the last tradable date - offset for the specified security each year</returns>\n        public IDateRule YearEnd(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 365 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.YearEnd() : Offset must be between 0 and 365\");\n            }\n\n            SecurityExchangeHours securityExchangeHours = null;\n            if (symbol != null)\n            {\n                securityExchangeHours = GetSecurityExchangeHours(symbol);\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"YearEnd\", -daysOffset), (start, end) => YearIterator(securityExchangeHours, start, end, daysOffset, false, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the first of each month + offset\n        /// </summary>\n        /// <param name=\"daysOffset\"> The amount of days to offset the schedule by; must be between 0 and 30.</param>\n        /// <returns>A date rule that fires on the first of each month + offset</returns>\n        public IDateRule MonthStart(int daysOffset = 0)\n        {\n            return new FuncDateRule(GetName(null, \"MonthStart\", daysOffset), (start, end) => MonthIterator(null, start, end, daysOffset, true, false));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified symbol of each month\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first tradable date of the month</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the schedule by; must be between 0 and 30</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the first tradable date + offset for the\n        /// specified security each month</returns>\n        public IDateRule MonthStart(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => MonthStart(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified symbol of each month\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first tradable date of the month</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the schedule by; must be between 0 and 30</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the first tradable date + offset for the\n        /// specified security each month</returns>\n        public IDateRule MonthStart(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 30 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.MonthStart() : Offset must be between 0 and 30\");\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"MonthStart\", daysOffset), (start, end) => MonthIterator(GetSecurityExchangeHours(symbol), start, end, daysOffset, true, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the last of each month\n        /// </summary>\n        /// <param name=\"daysOffset\"> The amount of days to offset the schedule by; must be between 0 and 30</param>\n        /// <returns>A date rule that fires on the last of each month - offset</returns>\n        public IDateRule MonthEnd(int daysOffset = 0)\n        {\n            return new FuncDateRule(GetName(null, \"MonthEnd\", -daysOffset), (start, end) => MonthIterator(null, start, end, daysOffset, false, false));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the last tradable date - offset for the specified symbol of each month\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last tradable date of the month</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the schedule by; must be between 0 and 30.</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the last tradable date - offset for the specified security each month</returns>\n        public IDateRule MonthEnd(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => MonthEnd(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the last tradable date - offset for the specified symbol of each month\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last tradable date of the month</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the schedule by; must be between 0 and 30.</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>A date rule that fires on the last tradable date - offset for the specified security each month</returns>\n        public IDateRule MonthEnd(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 30 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.MonthEnd() : Offset must be between 0 and 30\");\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"MonthEnd\", -daysOffset), (start, end) => MonthIterator(GetSecurityExchangeHours(symbol), start, end, daysOffset, false, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on Monday + offset each week\n        /// </summary>\n        /// <param name=\"daysOffset\">The amount of days to offset monday by; must be between 0 and 6</param>\n        /// <returns>A date rule that fires on Monday + offset each week</returns>\n        public IDateRule WeekStart(int daysOffset = 0)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 6 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.WeekStart() : Offset must be between 0 and 6\");\n            }\n\n            return new FuncDateRule(GetName(null, \"WeekStart\", daysOffset), (start, end) => WeekIterator(null, start, end, daysOffset, true, false));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified\n        /// symbol each week\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first\n        /// tradeable date of the week</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the first tradable day by</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false otherwise</param>\n        /// <returns>A date rule that fires on the first + offset tradable date for the specified\n        /// security each week</returns>\n        public IDateRule WeekStart(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => WeekStart(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the first tradable date + offset for the specified\n        /// symbol each week\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the first\n        /// tradeable date of the week</param>\n        /// <param name=\"daysOffset\">The amount of tradable days to offset the first tradable day by</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false otherwise</param>\n        /// <returns>A date rule that fires on the first + offset tradable date for the specified\n        /// security each week</returns>\n        public IDateRule WeekStart(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            var securitySchedule = GetSecurityExchangeHours(symbol);\n            var tradingDays = securitySchedule.MarketHours.Values\n                .Where(x => x.IsClosedAllDay == false).OrderBy(x => x.DayOfWeek).ToList();\n\n            // Limit offsets to securities weekly schedule\n            if (daysOffset > tradingDays.Count - 1)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset),\n                    $\"DateRules.WeekStart() : {tradingDays.First().DayOfWeek}+{daysOffset} is out of range for {symbol}'s schedule,\" +\n                    $\" please use an offset between 0 - {tradingDays.Count - 1}; Schedule : {string.Join(\", \", tradingDays.Select(x => x.DayOfWeek))}\");\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"WeekStart\", daysOffset), (start, end) => WeekIterator(securitySchedule, start, end, daysOffset, true, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on Friday - offset\n        /// </summary>\n        /// <param name=\"daysOffset\"> The amount of days to offset Friday by; must be between 0 and 6 </param>\n        /// <returns>A date rule that fires on Friday each week</returns>\n        public IDateRule WeekEnd(int daysOffset = 0)\n        {\n            // Check that our offset is allowed\n            if (daysOffset < 0 || 6 < daysOffset)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset), \"DateRules.WeekEnd() : Offset must be between 0 and 6\");\n            }\n\n            return new FuncDateRule(GetName(null, \"WeekEnd\", -daysOffset), (start, end) => WeekIterator(null, start, end, daysOffset, false, false));\n        }\n\n        /// <summary>\n        /// Specifies an event should fire on the last - offset tradable date for the specified\n        /// symbol of each week\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last\n        /// tradable date of the week</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the last tradable day by each week</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false otherwise</param>\n        /// <returns>A date rule that fires on the last - offset tradable date for the specified security each week</returns>\n        public IDateRule WeekEnd(string symbol, int daysOffset = 0, bool extendedMarketHours = true) => WeekEnd(GetSymbol(symbol), daysOffset, extendedMarketHours);\n\n        /// <summary>\n        /// Specifies an event should fire on the last - offset tradable date for the specified\n        /// symbol of each week\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose exchange is used to determine the last\n        /// tradable date of the week</param>\n        /// <param name=\"daysOffset\"> The amount of tradable days to offset the last tradable day by each week</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false otherwise</param>\n        /// <returns>A date rule that fires on the last - offset tradable date for the specified security each week</returns>\n        public IDateRule WeekEnd(Symbol symbol, int daysOffset = 0, bool extendedMarketHours = true)\n        {\n            var securitySchedule = GetSecurityExchangeHours(symbol);\n            var tradingDays = securitySchedule.MarketHours.Values\n                .Where(x => x.IsClosedAllDay == false).OrderBy(x => x.DayOfWeek).ToList();\n\n            // Limit offsets to securities weekly schedule\n            if (daysOffset > tradingDays.Count - 1)\n            {\n                throw new ArgumentOutOfRangeException(nameof(daysOffset),\n                    $\"DateRules.WeekEnd() : {tradingDays.Last().DayOfWeek}-{daysOffset} is out of range for {symbol}'s schedule,\" +\n                    $\" please use an offset between 0 - {tradingDays.Count - 1}; Schedule : {string.Join(\", \", tradingDays.Select(x => x.DayOfWeek))}\");\n            }\n\n            // Create the new DateRule and return it\n            return new FuncDateRule(GetName(symbol, \"WeekEnd\", -daysOffset), (start, end) => WeekIterator(securitySchedule, start, end, daysOffset, false, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Determine the string representation for a given rule \n        /// </summary>\n        /// <param name=\"symbol\">Symbol for the rule</param>\n        /// <param name=\"ruleType\">Rule type in string form</param>\n        /// <param name=\"offset\">The amount of offset on this rule</param>\n        /// <returns></returns>\n        private static string GetName(Symbol symbol, string ruleType, int offset)\n        {\n            // Convert our offset to +#, -#, or empty string if 0\n            var offsetString = offset.ToString(\"+#;-#;''\", CultureInfo.InvariantCulture);\n            var name = symbol == null ? $\"{ruleType}{offsetString}\" : $\"{symbol.Value}: {ruleType}{offsetString}\";\n\n            return name;\n        }\n\n\n        /// <summary>\n        /// Get the closest trading day to a given DateTime for a given <see cref=\"SecurityExchangeHours\"/>.\n        /// </summary>\n        /// <param name=\"securityExchangeHours\"><see cref=\"SecurityExchangeHours\"/> object with schedule for this Security</param>\n        /// <param name=\"baseDay\">The day to base our search from</param>\n        /// <param name=\"offset\">Amount to offset the schedule by tradable days</param>\n        /// <param name=\"searchForward\">Search into the future for the closest day if true; into the past if false</param>\n        /// <param name=\"boundary\">The boundary DateTime on the resulting day</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false otherwise</param>\n        private static DateTime GetScheduledDay(SecurityExchangeHours securityExchangeHours, DateTime baseDay, int offset, bool searchForward, bool extendedMarketHours, DateTime? boundary = null)\n        {\n            // By default the scheduled date is the given day\n            var scheduledDate = baseDay;\n\n            // If its not open on this day find the next trading day by searching in the given direction\n            if (!securityExchangeHours.IsDateOpen(scheduledDate, extendedMarketHours))\n            {\n                scheduledDate = searchForward\n                    ? securityExchangeHours.GetNextTradingDay(scheduledDate)\n                    : securityExchangeHours.GetPreviousTradingDay(scheduledDate);\n            }\n\n            // Offset the scheduled day accordingly\n            for (var i = 0; i < offset; i++)\n            {\n                scheduledDate = searchForward\n                    ? securityExchangeHours.GetNextTradingDay(scheduledDate)\n                    : securityExchangeHours.GetPreviousTradingDay(scheduledDate);\n            }\n\n            // If there is a boundary ensure we enforce it\n            if (boundary.HasValue)\n            {\n                // If we are searching forward and the resulting date is after this boundary we\n                // revert to the last tradable day equal to or less than boundary\n                if (searchForward && scheduledDate > boundary)\n                {\n                    scheduledDate = GetScheduledDay(securityExchangeHours, (DateTime)boundary, 0, false, extendedMarketHours);\n                }\n\n                // If we are searching backward and the resulting date is after this boundary we\n                // revert to the last tradable day equal to or greater than boundary\n                if (!searchForward && scheduledDate < boundary)\n                {\n                    scheduledDate = GetScheduledDay(securityExchangeHours, (DateTime)boundary, 0, true, extendedMarketHours);\n                }\n            }\n\n            return scheduledDate;\n        }\n\n        private static IEnumerable<DateTime> BaseIterator(\n            SecurityExchangeHours securitySchedule,\n            DateTime start,\n            DateTime end,\n            int offset,\n            bool searchForward,\n            DateTime periodBegin,\n            DateTime periodEnd,\n            Func<DateTime, DateTime> baseDateFunc,\n            Func<DateTime, DateTime> boundaryDateFunc,\n            bool extendedMarketHours)\n        {\n            // No schedule means no security, set to open everyday\n            if (securitySchedule == null)\n            {\n                securitySchedule = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            }\n\n            foreach (var date in Time.EachDay(periodBegin, periodEnd))\n            {\n                var baseDate = baseDateFunc(date);\n                var boundaryDate = boundaryDateFunc(date);\n\n                // Determine the scheduled day for this period\n                if (date == baseDate)\n                {\n                    var scheduledDay = GetScheduledDay(securitySchedule, baseDate, offset, searchForward, extendedMarketHours, boundaryDate);\n\n                    // Ensure the date is within our schedules range\n                    if (scheduledDay >= start && scheduledDay <= end)\n                    {\n                        yield return scheduledDay;\n                    }\n                }\n            }\n        }\n\n        private static IEnumerable<DateTime> MonthIterator(SecurityExchangeHours securitySchedule, DateTime start, DateTime end, int offset, bool searchForward, bool extendedMarketHours)\n        {\n            // Iterate all days between the beginning of \"start\" month, through end of \"end\" month.\n            // Necessary to ensure we schedule events in the month we start and end.\n            var beginningOfStartMonth = new DateTime(start.Year, start.Month, 1);\n            var endOfEndMonth = new DateTime(end.Year, end.Month, DateTime.DaysInMonth(end.Year, end.Month));\n\n            // Searching forward the first of the month is baseDay, with boundary being the last\n            // Searching backward the last of the month is baseDay, with boundary being the first\n            Func<DateTime, DateTime> baseDateFunc = date => searchForward ? new DateTime(date.Year, date.Month, 1) : new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));\n            Func<DateTime, DateTime> boundaryDateFunc = date => searchForward ? new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)) : new DateTime(date.Year, date.Month, 1);\n\n            return BaseIterator(securitySchedule, start, end, offset, searchForward, beginningOfStartMonth, endOfEndMonth, baseDateFunc, boundaryDateFunc, extendedMarketHours);\n        }\n\n        private static IEnumerable<DateTime> YearIterator(SecurityExchangeHours securitySchedule, DateTime start, DateTime end, int offset, bool searchForward, bool extendedMarketHours)\n        {\n            // Iterate all days between the beginning of \"start\" year, through end of \"end\" year\n            // Necessary to ensure we schedule events in the year we start and end.\n            var beginningOfStartOfYear = new DateTime(start.Year, start.Month, 1);\n            var endOfEndYear = new DateTime(end.Year, end.Month, DateTime.DaysInMonth(end.Year, end.Month));\n\n            // Searching forward the first of the year is baseDay, with boundary being the last\n            // Searching backward the last of the year is baseDay, with boundary being the first\n            Func<DateTime, DateTime> baseDateFunc = date => searchForward ? new DateTime(date.Year, 1, 1) : new DateTime(date.Year, 12, 31);\n            Func<DateTime, DateTime> boundaryDateFunc = date => searchForward ? new DateTime(date.Year, 12, 31) : new DateTime(date.Year, 1, 1);\n\n            return BaseIterator(securitySchedule, start, end, offset, searchForward, beginningOfStartOfYear, endOfEndYear, baseDateFunc, boundaryDateFunc, extendedMarketHours);\n        }\n\n        private static IEnumerable<DateTime> WeekIterator(SecurityExchangeHours securitySchedule, DateTime start, DateTime end, int offset, bool searchForward, bool extendedMarketHours)\n        {\n            // Determine the weekly base day and boundary to schedule off of\n            DayOfWeek weeklyBaseDay;\n            DayOfWeek weeklyBoundaryDay;\n            if (securitySchedule == null)\n            {\n                // No schedule means no security, set to open everyday\n                securitySchedule = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n                // Searching forward Monday is baseDay, with boundary being the following Sunday\n                // Searching backward Friday is baseDay, with boundary being the previous Saturday\n                weeklyBaseDay = searchForward ? DayOfWeek.Monday : DayOfWeek.Friday;\n                weeklyBoundaryDay = searchForward ? DayOfWeek.Saturday + 1 : DayOfWeek.Sunday - 1;\n            }\n            else\n            {\n                // Fetch the securities schedule \n                var weeklySchedule = securitySchedule.MarketHours.Values\n                    .Where(x => x.IsClosedAllDay == false).OrderBy(x => x.DayOfWeek).ToList();\n\n                // Determine our weekly base day and boundary for this security\n                weeklyBaseDay = searchForward ? weeklySchedule.First().DayOfWeek : weeklySchedule.Last().DayOfWeek;\n                weeklyBoundaryDay = searchForward ? weeklySchedule.Last().DayOfWeek : weeklySchedule.First().DayOfWeek;\n            }\n\n            // Iterate all days between the beginning of \"start\" week, through end of \"end\" week.\n            // Necessary to ensure we schedule events in the week we start and end. \n            // Also if we have a sunday for start/end we need to adjust for it being the front of the week when we want it as the end of the week.\n            var startAdjustment = start.DayOfWeek == DayOfWeek.Sunday ? -7 : 0;\n            var beginningOfStartWeek = start.AddDays(-(int)start.DayOfWeek + 1 + startAdjustment); // Date - DayOfWeek + 1\n\n            var endAdjustment = end.DayOfWeek == DayOfWeek.Sunday ? -7 : 0;\n            var endOfEndWeek = end.AddDays(-(int)end.DayOfWeek + 7 + endAdjustment); // Date - DayOfWeek + 7 \n\n            // Determine the schedule for each week in this range\n            foreach (var date in Time.EachDay(beginningOfStartWeek, endOfEndWeek).Where(x => x.DayOfWeek == weeklyBaseDay))\n            {\n                var boundary = date.AddDays(weeklyBoundaryDay - weeklyBaseDay);\n                var scheduledDay = GetScheduledDay(securitySchedule, date, offset, searchForward, extendedMarketHours, boundary);\n\n                // Ensure the date is within our schedules range\n                if (scheduledDay >= start && scheduledDay <= end)\n                {\n                    yield return scheduledDay;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/FluentScheduledEventBuilder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Provides a builder class to allow for fluent syntax when constructing new events\n    /// </summary>\n    /// <remarks>\n    /// This builder follows the following steps for event creation:\n    ///\n    /// 1. Specify an event name (optional)\n    /// 2. Specify an IDateRule\n    /// 3. Specify an ITimeRule\n    ///     a. repeat 3. to define extra time rules (optional)\n    /// 4. Specify additional where clause (optional)\n    /// 5. Register event via call to Run\n    /// </remarks>\n    public class FluentScheduledEventBuilder : IFluentSchedulingDateSpecifier, IFluentSchedulingRunnable\n    {\n        private IDateRule _dateRule;\n        private ITimeRule _timeRule;\n        private Func<DateTime, bool> _predicate;\n\n        private readonly string _name;\n        private readonly ScheduleManager _schedule;\n        private readonly SecurityManager _securities;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FluentScheduledEventBuilder\"/> class\n        /// </summary>\n        /// <param name=\"schedule\">The schedule to send created events to</param>\n        /// <param name=\"securities\">The algorithm's security manager</param>\n        /// <param name=\"name\">A specific name for this event</param>\n        public FluentScheduledEventBuilder(ScheduleManager schedule, SecurityManager securities, string name = null)\n        {\n            _name = name;\n            _schedule = schedule;\n            _securities = securities;\n        }\n\n        private FluentScheduledEventBuilder SetTimeRule(ITimeRule rule)\n        {\n            // if it's not set, just set it\n            if (_timeRule == null)\n            {\n                _timeRule = rule;\n                return this;\n            }\n\n            // if it's already a composite, open it up and make a new composite\n            // prevent nesting composites\n            var compositeTimeRule = _timeRule as CompositeTimeRule;\n            if (compositeTimeRule != null)\n            {\n                var rules = compositeTimeRule.Rules;\n                _timeRule = new CompositeTimeRule(rules.Concat(new[] { rule }));\n                return this;\n            }\n\n            // create a composite from the existing rule and the new rules\n            _timeRule = new CompositeTimeRule(_timeRule, rule);\n            return this;\n        }\n\n        #region DateRules and TimeRules delegation\n\n        /// <summary>\n        /// Creates events on each of the specified day of week\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.Every(params DayOfWeek[] days)\n        {\n            _dateRule = _schedule.DateRules.Every(days);\n            return this;\n        }\n\n        /// <summary>\n        /// Creates events on every day of the year\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.EveryDay()\n        {\n            _dateRule = _schedule.DateRules.EveryDay();\n            return this;\n        }\n\n        /// <summary>\n        /// Creates events on every trading day of the year for the symbol\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.EveryDay(Symbol symbol)\n        {\n            _dateRule = _schedule.DateRules.EveryDay(symbol);\n            return this;\n        }\n\n        /// <summary>\n        /// Creates events on the first day of the month\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.MonthStart()\n        {\n            _dateRule = _schedule.DateRules.MonthStart();\n            return this;\n        }\n\n        /// <summary>\n        /// Creates events on the first trading day of the month\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.MonthStart(Symbol symbol)\n        {\n            _dateRule = _schedule.DateRules.MonthStart(symbol);\n            return this;\n        }\n\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.Where(Func<DateTime, bool> predicate)\n        {\n            _predicate = _predicate == null\n                ? predicate\n                : (time => _predicate(time) && predicate(time));\n            return this;\n        }\n\n        /// <summary>\n        /// Creates events that fire at the specific time of day in the algorithm's time zone\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.At(TimeSpan timeOfDay)\n        {\n            return SetTimeRule(_schedule.TimeRules.At(timeOfDay));\n        }\n\n        /// <summary>\n        /// Creates events that fire a specified number of minutes after market open\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.AfterMarketOpen(Symbol symbol, double minutesAfterOpen, bool extendedMarketOpen)\n        {\n            return SetTimeRule(_schedule.TimeRules.AfterMarketOpen(symbol, minutesAfterOpen, extendedMarketOpen));\n        }\n\n        /// <summary>\n        /// Creates events that fire a specified numer of minutes before market close\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.BeforeMarketClose(Symbol symbol, double minuteBeforeClose, bool extendedMarketClose)\n        {\n            return SetTimeRule(_schedule.TimeRules.BeforeMarketClose(symbol, minuteBeforeClose, extendedMarketClose));\n        }\n\n        /// <summary>\n        /// Creates events that fire on a period define by the specified interval\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.Every(TimeSpan interval)\n        {\n            return SetTimeRule(_schedule.TimeRules.Every(interval));\n        }\n\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        IFluentSchedulingTimeSpecifier IFluentSchedulingTimeSpecifier.Where(Func<DateTime, bool> predicate)\n        {\n            _predicate = _predicate == null\n                ? predicate\n                : (time => _predicate(time) && predicate(time));\n            return this;\n        }\n\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent IFluentSchedulingRunnable.Run(Action callback)\n        {\n            return ((IFluentSchedulingRunnable)this).Run((name, time) => callback());\n        }\n\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent IFluentSchedulingRunnable.Run(Action<DateTime> callback)\n        {\n            return ((IFluentSchedulingRunnable)this).Run((name, time) => callback(time));\n        }\n\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent IFluentSchedulingRunnable.Run(Action<string, DateTime> callback)\n        {\n            var name = _name ?? _dateRule.Name + \": \" + _timeRule.Name;\n            // back the date up to ensure we get all events, the event scheduler will skip past events that whose time has passed\n            var dates = ScheduleManager.GetDatesDeferred(_dateRule, _securities);\n            var eventTimes = _timeRule.CreateUtcEventTimes(dates);\n            if (_predicate != null)\n            {\n                eventTimes = eventTimes.Where(_predicate);\n            }\n            var scheduledEvent = new ScheduledEvent(name, eventTimes, callback);\n            _schedule.Add(scheduledEvent);\n            return scheduledEvent;\n        }\n\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingRunnable.Where(Func<DateTime, bool> predicate)\n        {\n            _predicate = _predicate == null\n                ? predicate\n                : (time => _predicate(time) && predicate(time));\n            return this;\n        }\n\n        /// <summary>\n        /// Filters the event times to only include times where the symbol's market is considered open\n        /// </summary>\n        IFluentSchedulingRunnable IFluentSchedulingRunnable.DuringMarketHours(Symbol symbol, bool extendedMarket)\n        {\n            var security = GetSecurity(symbol);\n            Func<DateTime, bool> predicate = time =>\n            {\n                var localTime = time.ConvertFromUtc(security.Exchange.TimeZone);\n                return security.Exchange.IsOpenDuringBar(localTime, localTime, extendedMarket);\n            };\n            _predicate = _predicate == null\n                ? predicate\n                : (time => _predicate(time) && predicate(time));\n            return this;\n        }\n\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.On(int year, int month, int day)\n        {\n            _dateRule = _schedule.DateRules.On(year, month, day);\n            return this;\n        }\n\n        IFluentSchedulingTimeSpecifier IFluentSchedulingDateSpecifier.On(params DateTime[] dates)\n        {\n            _dateRule = _schedule.DateRules.On(dates);\n            return this;\n        }\n\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.At(int hour, int minute, int second)\n        {\n            return SetTimeRule(_schedule.TimeRules.At(hour, minute, second));\n        }\n\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.At(int hour, int minute, DateTimeZone timeZone)\n        {\n            return SetTimeRule(_schedule.TimeRules.At(hour, minute, 0, timeZone));\n        }\n\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.At(int hour, int minute, int second, DateTimeZone timeZone)\n        {\n            return SetTimeRule(_schedule.TimeRules.At(hour, minute, second, timeZone));\n        }\n\n        IFluentSchedulingRunnable IFluentSchedulingTimeSpecifier.At(TimeSpan timeOfDay, DateTimeZone timeZone)\n        {\n            return SetTimeRule(_schedule.TimeRules.At(timeOfDay, timeZone));\n        }\n\n        private Security GetSecurity(Symbol symbol)\n        {\n            Security security;\n            if (!_securities.TryGetValue(symbol, out security))\n            {\n                throw new KeyNotFoundException($\"{symbol} not found in portfolio. Request this data when initializing the algorithm.\");\n            }\n\n            return security;\n        }\n\n        #endregion\n    }\n\n    /// <summary>\n    /// Specifies the date rule component of a scheduled event\n    /// </summary>\n    public interface IFluentSchedulingDateSpecifier\n    {\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        IFluentSchedulingTimeSpecifier Where(Func<DateTime, bool> predicate);\n        /// <summary>\n        /// Creates events only on the specified date\n        /// </summary>\n        IFluentSchedulingTimeSpecifier On(int year, int month, int day);\n        /// <summary>\n        /// Creates events only on the specified dates\n        /// </summary>\n        IFluentSchedulingTimeSpecifier On(params DateTime[] dates);\n        /// <summary>\n        /// Creates events on each of the specified day of week\n        /// </summary>\n        IFluentSchedulingTimeSpecifier Every(params DayOfWeek[] days);\n        /// <summary>\n        /// Creates events on every day of the year\n        /// </summary>\n        IFluentSchedulingTimeSpecifier EveryDay();\n        /// <summary>\n        /// Creates events on every trading day of the year for the symbol\n        /// </summary>\n        IFluentSchedulingTimeSpecifier EveryDay(Symbol symbol);\n        /// <summary>\n        /// Creates events on the first day of the month\n        /// </summary>\n        IFluentSchedulingTimeSpecifier MonthStart();\n        /// <summary>\n        /// Creates events on the first trading day of the month\n        /// </summary>\n        IFluentSchedulingTimeSpecifier MonthStart(Symbol symbol);\n    }\n\n    /// <summary>\n    /// Specifies the time rule component of a scheduled event\n    /// </summary>\n    public interface IFluentSchedulingTimeSpecifier\n    {\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        IFluentSchedulingTimeSpecifier Where(Func<DateTime, bool> predicate);\n        /// <summary>\n        /// Creates events that fire at the specified time of day in the specified time zone\n        /// </summary>\n        IFluentSchedulingRunnable At(int hour, int minute, int second = 0);\n        /// <summary>\n        /// Creates events that fire at the specified time of day in the specified time zone\n        /// </summary>\n        IFluentSchedulingRunnable At(int hour, int minute, DateTimeZone timeZone);\n        /// <summary>\n        /// Creates events that fire at the specified time of day in the specified time zone\n        /// </summary>\n        IFluentSchedulingRunnable At(int hour, int minute, int second, DateTimeZone timeZone);\n        /// <summary>\n        /// Creates events that fire at the specified time of day in the specified time zone\n        /// </summary>\n        IFluentSchedulingRunnable At(TimeSpan timeOfDay, DateTimeZone timeZone);\n        /// <summary>\n        /// Creates events that fire at the specific time of day in the algorithm's time zone\n        /// </summary>\n        IFluentSchedulingRunnable At(TimeSpan timeOfDay);\n        /// <summary>\n        /// Creates events that fire on a period define by the specified interval\n        /// </summary>\n        IFluentSchedulingRunnable Every(TimeSpan interval);\n        /// <summary>\n        /// Creates events that fire a specified number of minutes after market open\n        /// </summary>\n        IFluentSchedulingRunnable AfterMarketOpen(Symbol symbol, double minutesAfterOpen = 0, bool extendedMarketOpen = false);\n        /// <summary>\n        /// Creates events that fire a specified numer of minutes before market close\n        /// </summary>\n        IFluentSchedulingRunnable BeforeMarketClose(Symbol symbol, double minuteBeforeClose = 0, bool extendedMarketClose = false);\n    }\n\n    /// <summary>\n    /// Specifies the callback component of a scheduled event, as well as final filters\n    /// </summary>\n    public interface IFluentSchedulingRunnable : IFluentSchedulingTimeSpecifier\n    {\n        /// <summary>\n        /// Filters the event times using the predicate\n        /// </summary>\n        new IFluentSchedulingRunnable Where(Func<DateTime, bool> predicate);\n        /// <summary>\n        /// Filters the event times to only include times where the symbol's market is considered open\n        /// </summary>\n        IFluentSchedulingRunnable DuringMarketHours(Symbol symbol, bool extendedMarket = false);\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent Run(Action callback);\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent Run(Action<DateTime> callback);\n        /// <summary>\n        /// Register the defined event with the callback\n        /// </summary>\n        ScheduledEvent Run(Action<string, DateTime> callback);\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/FuncDateRule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Uses a function to define an enumerable of dates over a requested start/end period\n    /// </summary>\n    public class FuncDateRule : IDateRule\n    {\n        private readonly Func<DateTime, DateTime, IEnumerable<DateTime>> _getDatesFunction;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncDateRule\"/> class\n        /// </summary>\n        /// <param name=\"name\">The name of this rule</param>\n        /// <param name=\"getDatesFunction\">The time applicator function</param>\n        public FuncDateRule(string name, Func<DateTime, DateTime, IEnumerable<DateTime>> getDatesFunction)\n        {\n            Name = name;\n            _getDatesFunction = getDatesFunction;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncDateRule\"/> class using a Python function\n        /// </summary>\n        /// <param name=\"name\">The name of this rule</param>\n        /// <param name=\"getDatesFunction\">The time applicator function in Python</param>\n        public FuncDateRule(string name, PyObject getDatesFunction)\n        {\n            Name = name;\n            if (!getDatesFunction.TrySafeAs(out _getDatesFunction))\n            {\n                throw new ArgumentException(\"Python DateRule provided is not a function\");\n            }\n        }\n\n        /// <summary>\n        /// Gets a name for this rule\n        /// </summary>\n        public string Name\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the dates produced by this date rule between the specified times\n        /// </summary>\n        /// <param name=\"start\">The start of the interval to produce dates for</param>\n        /// <param name=\"end\">The end of the interval to produce dates for</param>\n        /// <returns>All dates in the interval matching this date rule</returns>\n        public IEnumerable<DateTime> GetDates(DateTime start, DateTime end)\n        {\n            return _getDatesFunction(start, end);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/FuncTimeRule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Uses a function to define a time rule as a projection of date times to date times\n    /// </summary>\n    public class FuncTimeRule : ITimeRule\n    {\n        private readonly Func<IEnumerable<DateTime>, IEnumerable<DateTime>> _createUtcEventTimesFunction;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncTimeRule\"/> class\n        /// </summary>\n        /// <param name=\"name\">The name of the time rule</param>\n        /// <param name=\"createUtcEventTimesFunction\">Function used to transform dates into event date times</param>\n        public FuncTimeRule(string name, Func<IEnumerable<DateTime>, IEnumerable<DateTime>> createUtcEventTimesFunction)\n        {\n            Name = name;\n            _createUtcEventTimesFunction = createUtcEventTimesFunction;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncTimeRule\"/> class using a Python function\n        /// </summary>\n        /// <param name=\"name\">The name of the time rule</param>\n        /// <param name=\"createUtcEventTimesFunction\">Function used to transform dates into event date times in Python</param>\n        public FuncTimeRule(string name, PyObject createUtcEventTimesFunction)\n        {\n            Name = name;\n            if (!createUtcEventTimesFunction.TrySafeAs(out _createUtcEventTimesFunction))\n            {\n                throw new ArgumentException(\"Python TimeRule provided is not a function\");\n            }\n        }\n\n        /// <summary>\n        /// Gets a name for this rule\n        /// </summary>\n        public string Name\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Creates the event times for the specified dates in UTC\n        /// </summary>\n        /// <param name=\"dates\">The dates to apply times to</param>\n        /// <returns>An enumerable of date times that is the result\n        /// of applying this rule to the specified dates</returns>\n        public IEnumerable<DateTime> CreateUtcEventTimes(IEnumerable<DateTime> dates)\n        {\n            return _createUtcEventTimesFunction(dates);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/IDateRule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Specifies dates that events should be fired, used in conjunction with the <see cref=\"ITimeRule\"/>\n    /// </summary>\n    public interface IDateRule\n    {\n        /// <summary>\n        /// Gets a name for this rule\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Gets the dates produced by this date rule between the specified times\n        /// </summary>\n        /// <param name=\"start\">The start of the interval to produce dates for</param>\n        /// <param name=\"end\">The end of the interval to produce dates for</param>\n        /// <returns>All dates in the interval matching this date rule</returns>\n        IEnumerable<DateTime> GetDates(DateTime start, DateTime end);\n    }\n}"
  },
  {
    "path": "Common/Scheduling/IEventSchedule.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Provides the ability to add/remove scheduled events from the real time handler\n    /// </summary>\n    public interface IEventSchedule\n    {\n        /// <summary>\n        /// Adds the specified event to the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be scheduled, including the date/times the event fires and the callback</param>\n        void Add(ScheduledEvent scheduledEvent);\n\n        /// <summary>\n        /// Removes the specified event from the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be removed</param>\n        void Remove(ScheduledEvent scheduledEvent);\n    }\n}"
  },
  {
    "path": "Common/Scheduling/ITimeRule.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Specifies times times on dates for events, used in conjunction with <see cref=\"IDateRule\"/>\n    /// </summary>\n    public interface ITimeRule\n    {\n        /// <summary>\n        /// Gets a name for this rule\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Creates the event times for the specified dates in UTC\n        /// </summary>\n        /// <param name=\"dates\">The dates to apply times to</param>\n        /// <returns>An enumerable of date times that is the result\n        /// of applying this rule to the specified dates</returns>\n        IEnumerable<DateTime> CreateUtcEventTimes(IEnumerable<DateTime> dates);\n    }\n}"
  },
  {
    "path": "Common/Scheduling/ScheduleManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing Python.Runtime;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Provides access to the real time handler's event scheduling feature\n    /// </summary>\n    public class ScheduleManager : IEventSchedule\n    {\n        private IEventSchedule _eventSchedule;\n\n        private readonly SecurityManager _securities;\n        private readonly object _eventScheduleLock = new object();\n        private readonly List<ScheduledEvent> _preInitializedEvents;\n\n        /// <summary>\n        /// Gets the date rules helper object to make specifying dates for events easier\n        /// </summary>\n        public DateRules DateRules { get; }\n\n        /// <summary>\n        /// Gets the time rules helper object to make specifying times for events easier\n        /// </summary>\n        public TimeRules TimeRules { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduleManager\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"securities\">Securities manager containing the algorithm's securities</param>\n        /// <param name=\"timeZone\">The algorithm's time zone</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database instance to use</param>\n        public ScheduleManager(IAlgorithm algorithm, SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase)\n        {\n            _securities = securities;\n            DateRules = new DateRules(algorithm, securities, timeZone, marketHoursDatabase);\n            TimeRules = new TimeRules(algorithm, securities, timeZone, marketHoursDatabase);\n\n            // used for storing any events before the event schedule is set\n            _preInitializedEvents = new List<ScheduledEvent>();\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"IEventSchedule\"/> implementation\n        /// </summary>\n        /// <param name=\"eventSchedule\">The event schedule implementation to be used. This is the IRealTimeHandler</param>\n        public void SetEventSchedule(IEventSchedule eventSchedule)\n        {\n            if (eventSchedule == null)\n            {\n                throw new ArgumentNullException(nameof(eventSchedule));\n            }\n\n            lock (_eventScheduleLock)\n            {\n                _eventSchedule = eventSchedule;\n\n                // load up any events that were added before we were ready to send them to the scheduler\n                foreach (var scheduledEvent in _preInitializedEvents)\n                {\n                    _eventSchedule.Add(scheduledEvent);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified event to the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be scheduled, including the date/times the event fires and the callback</param>\n        public void Add(ScheduledEvent scheduledEvent)\n        {\n            lock (_eventScheduleLock)\n            {\n                if (_eventSchedule != null)\n                {\n                    _eventSchedule.Add(scheduledEvent);\n                }\n                else\n                {\n                    _preInitializedEvents.Add(scheduledEvent);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes the specified event from the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be removed</param>\n        public void Remove(ScheduledEvent scheduledEvent)\n        {\n            lock (_eventScheduleLock)\n            {\n                if (_eventSchedule != null)\n                {\n                    _eventSchedule.Remove(scheduledEvent);\n                }\n                else\n                {\n                    _preInitializedEvents.RemoveAll(se => Equals(se, scheduledEvent));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(IDateRule dateRule, ITimeRule timeRule, Action callback)\n        {\n            return On(dateRule, timeRule, (name, time) => callback());\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(IDateRule dateRule, ITimeRule timeRule, PyObject callback)\n        {\n            return On(dateRule, timeRule, (name, time) => { using (Py.GIL()) callback.Invoke(); });\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(IDateRule dateRule, ITimeRule timeRule, Action<string, DateTime> callback)\n        {\n            var name = $\"{dateRule.Name}: {timeRule.Name}\";\n            return On(name, dateRule, timeRule, callback);\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"name\">The event's unique name</param>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(string name, IDateRule dateRule, ITimeRule timeRule, Action callback)\n        {\n            return On(name, dateRule, timeRule, (n, d) => callback());\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"name\">The event's unique name</param>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(string name, IDateRule dateRule, ITimeRule timeRule, PyObject callback)\n        {\n            return On(name, dateRule, timeRule, (n, d) => { using (Py.GIL()) callback.Invoke(); });\n        }\n\n        /// <summary>\n        /// Schedules the callback to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"name\">The event's unique name</param>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"callback\">The callback to be invoked</param>\n        public ScheduledEvent On(string name, IDateRule dateRule, ITimeRule timeRule, Action<string, DateTime> callback)\n        {\n            // back the date up to ensure we get all events, the event scheduler will skip past events that whose time has passed\n            var dates = GetDatesDeferred(dateRule, _securities);\n            var eventTimes = timeRule.CreateUtcEventTimes(dates);\n            var scheduledEvent = new ScheduledEvent(name, eventTimes, callback);\n            Add(scheduledEvent);\n\n            Log.Trace($\"Event Name \\\"{scheduledEvent.Name}\\\", scheduled to run.\");\n            return scheduledEvent;\n        }\n\n        #region Fluent Scheduling\n\n        /// <summary>\n        /// Entry point for the fluent scheduled event builder\n        /// </summary>\n        public IFluentSchedulingDateSpecifier Event()\n        {\n            return new FluentScheduledEventBuilder(this, _securities);\n        }\n\n        /// <summary>\n        /// Entry point for the fluent scheduled event builder\n        /// </summary>\n        public IFluentSchedulingDateSpecifier Event(string name)\n        {\n            return new FluentScheduledEventBuilder(this, _securities, name);\n        }\n\n        #endregion\n\n        #region Training Events\n\n        /// <summary>\n        /// Schedules the provided training code to execute immediately\n        /// </summary>\n        public ScheduledEvent TrainingNow(Action trainingCode)\n        {\n            return On($\"Training: Now: {_securities.UtcTime:O}\", DateRules.Today, TimeRules.Now, trainingCode);\n        }\n\n        /// <summary>\n        /// Schedules the provided training code to execute immediately\n        /// </summary>\n        public ScheduledEvent TrainingNow(PyObject trainingCode)\n        {\n            return On($\"Training: Now: {_securities.UtcTime:O}\", DateRules.Today, TimeRules.Now, trainingCode);\n        }\n\n        /// <summary>\n        /// Schedules the training code to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        public ScheduledEvent Training(IDateRule dateRule, ITimeRule timeRule, Action trainingCode)\n        {\n            var name = $\"{dateRule.Name}: {timeRule.Name}\";\n            return On(name, dateRule, timeRule, (n, time) => trainingCode());\n        }\n\n\n        /// <summary>\n        /// Schedules the training code to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        public ScheduledEvent Training(IDateRule dateRule, ITimeRule timeRule, PyObject trainingCode)\n        {\n            var name = $\"{dateRule.Name}: {timeRule.Name}\";\n            return On(name, dateRule, timeRule, (n, time) => { using (Py.GIL()) trainingCode.Invoke(); });\n        }\n\n        /// <summary>\n        /// Schedules the training code to run using the specified date and time rules\n        /// </summary>\n        /// <param name=\"dateRule\">Specifies what dates the event should run</param>\n        /// <param name=\"timeRule\">Specifies the times on those dates the event should run</param>\n        /// <param name=\"trainingCode\">The training code to be invoked</param>\n        public ScheduledEvent Training(IDateRule dateRule, ITimeRule timeRule, Action<DateTime> trainingCode)\n        {\n            var name = $\"{dateRule.Name}: {timeRule.Name}\";\n            return On(name, dateRule, timeRule, (n, time) => trainingCode(time));\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Helper methods to defer the evaluation of the current time until the dates are enumerated for the first time.\n        /// This allows for correct support for warmup period\n        /// </summary>\n        internal static IEnumerable<DateTime> GetDatesDeferred(IDateRule dateRule, SecurityManager securities)\n        {\n            foreach (var item in dateRule.GetDates(DateTime.SpecifyKind(securities.UtcTime.Date.AddDays(-1), DateTimeKind.Unspecified), Time.EndOfTime))\n            {\n                yield return item;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/ScheduledEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Real time self scheduling event\n    /// </summary>\n    public class ScheduledEvent : IDisposable\n    {\n        /// <summary>\n        /// Gets the default time before market close end of trading day events will fire\n        /// </summary>\n        public static readonly TimeSpan SecurityEndOfDayDelta = TimeSpan.FromMinutes(10);\n\n        /// <summary>\n        /// Gets the default time before midnight end of day events will fire\n        /// </summary>\n        public static readonly TimeSpan AlgorithmEndOfDayDelta = TimeSpan.FromMinutes(2);\n\n        private bool _needsMoveNext;\n        private bool _endOfScheduledEvents;\n        private readonly Action<string, DateTime> _callback;\n        private readonly IEnumerator<DateTime> _orderedEventUtcTimes;\n\n        /// <summary>\n        /// Event that fires each time this scheduled event happens\n        /// </summary>\n        public event Action<string, DateTime> EventFired;\n\n        /// <summary>\n        /// Gets or sets whether this event is enabled\n        /// </summary>\n        public bool Enabled\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets or sets whether this event will log each time it fires\n        /// </summary>\n        internal bool IsLoggingEnabled\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets the next time this scheduled event will fire in UTC\n        /// </summary>\n        public DateTime NextEventUtcTime\n        {\n            get\n            {\n                if (_endOfScheduledEvents)\n                {\n                    return DateTime.MaxValue;\n                }\n\n                if (_needsMoveNext)\n                {\n                    _needsMoveNext = false;\n                    _endOfScheduledEvents = !_orderedEventUtcTimes.MoveNext();\n                    return NextEventUtcTime;\n                }\n                return _orderedEventUtcTimes.Current;\n            }\n        }\n\n        /// <summary>\n        /// Gets an identifier for this event\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledEvent\"/> class\n        /// </summary>\n        /// <param name=\"name\">An identifier for this event</param>\n        /// <param name=\"eventUtcTime\">The date time the event should fire</param>\n        /// <param name=\"callback\">Delegate to be called when the event time passes</param>\n        public ScheduledEvent(string name, DateTime eventUtcTime, Action<string, DateTime> callback = null)\n            : this(name, new[] { eventUtcTime }.AsEnumerable().GetEnumerator(), callback)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledEvent\"/> class\n        /// </summary>\n        /// <param name=\"name\">An identifier for this event</param>\n        /// <param name=\"orderedEventUtcTimes\">An enumerable that emits event times</param>\n        /// <param name=\"callback\">Delegate to be called each time an event passes</param>\n        public ScheduledEvent(string name, IEnumerable<DateTime> orderedEventUtcTimes, Action<string, DateTime> callback = null)\n            : this(name, orderedEventUtcTimes.GetEnumerator(), callback)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScheduledEvent\"/> class\n        /// </summary>\n        /// <param name=\"name\">An identifier for this event</param>\n        /// <param name=\"orderedEventUtcTimes\">An enumerator that emits event times</param>\n        /// <param name=\"callback\">Delegate to be called each time an event passes</param>\n        public ScheduledEvent(string name, IEnumerator<DateTime> orderedEventUtcTimes, Action<string, DateTime> callback = null)\n        {\n            Name = name;\n            Enabled = true;\n            _callback = callback;\n            // we don't move next until we are requested, this allows the algorithm to support the warmup period correctly\n            _needsMoveNext = true;\n            _orderedEventUtcTimes = orderedEventUtcTimes;\n\n        }\n\n        /// <summary>Serves as the default hash function. </summary>\n        /// <returns>A hash code for the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return Name.GetHashCode();\n        }\n\n        /// <summary>Determines whether the specified object is equal to the current object.</summary>\n        /// <returns>true if the specified object  is equal to the current object; otherwise, false.</returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            return !ReferenceEquals(null, obj) && ReferenceEquals(this, obj);\n        }\n\n        /// <summary>\n        /// Scans this event and fires the callback if an event happened\n        /// </summary>\n        /// <param name=\"utcTime\">The current time in UTC</param>\n        internal void Scan(DateTime utcTime)\n        {\n            if (_endOfScheduledEvents)\n            {\n                return;\n            }\n\n            do\n            {\n                if (_needsMoveNext)\n                {\n                    // if we've passed an event or are just priming the pump, we need to move next\n                    if (!_orderedEventUtcTimes.MoveNext())\n                    {\n                        if (IsLoggingEnabled)\n                        {\n                            Log.Trace($\"ScheduledEvent.{Name}: Completed scheduled events.\");\n                        }\n                        _endOfScheduledEvents = true;\n                        return;\n                    }\n                    if (IsLoggingEnabled)\n                    {\n                        Log.Trace($\"ScheduledEvent.{Name}: Next event: {_orderedEventUtcTimes.Current.ToStringInvariant(DateFormat.UI)} UTC\");\n                    }\n                }\n\n                // if time has passed our event\n                if (utcTime >= _orderedEventUtcTimes.Current)\n                {\n                    if (IsLoggingEnabled)\n                    {\n                        Log.Trace($\"ScheduledEvent.{Name}: Firing at {utcTime.ToStringInvariant(DateFormat.UI)} UTC \" +\n                            $\"Scheduled at {_orderedEventUtcTimes.Current.ToStringInvariant(DateFormat.UI)} UTC\"\n                        );\n                    }\n                    // fire the event\n                    OnEventFired(_orderedEventUtcTimes.Current);\n                    _needsMoveNext = true;\n                }\n                else\n                {\n                    // we haven't passed the event time yet, so keep waiting on this Current\n                    _needsMoveNext = false;\n                }\n            }\n            // keep checking events until we pass the current time, this will fire\n            // all 'skipped' events back to back in order, perhaps this should be handled\n            // in the real time handler\n            while (_needsMoveNext);\n        }\n\n        /// <summary>\n        /// Fast forwards this schedule to the specified time without invoking the events\n        /// </summary>\n        /// <param name=\"utcTime\">Frontier time</param>\n        internal void SkipEventsUntil(DateTime utcTime)\n        {\n            do\n            {\n                // zoom through the enumerator until we get to the desired time\n                if (utcTime <= NextEventUtcTime)\n                {\n                    if (IsLoggingEnabled)\n                    {\n                        Log.Trace($\"ScheduledEvent.{Name}: Skipped events before {utcTime.ToStringInvariant(DateFormat.UI)}. \" +\n                            $\"Next event: {_orderedEventUtcTimes.Current.ToStringInvariant(DateFormat.UI)}\"\n                        );\n                    }\n                    return;\n                }\n            }\n            while (_orderedEventUtcTimes.MoveNext());\n\n            if (IsLoggingEnabled)\n            {\n                Log.Trace($\"ScheduledEvent.{Name}: Exhausted event stream during skip until {utcTime.ToStringInvariant(DateFormat.UI)}\");\n            }\n            _endOfScheduledEvents = true;\n        }\n\n        /// <summary>\n        /// Will return the ScheduledEvents name\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{Name}\";\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        void IDisposable.Dispose()\n        {\n            _orderedEventUtcTimes.Dispose();\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"EventFired\"/> event\n        /// </summary>\n        /// <param name=\"triggerTime\">The event's time in UTC</param>\n        protected void OnEventFired(DateTime triggerTime)\n        {\n            // don't fire the event if we're turned off\n            if (!Enabled) return;\n\n            _callback?.Invoke(Name, _orderedEventUtcTimes.Current);\n            EventFired?.Invoke(Name, triggerTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/ScheduledEventException.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Throw this if there is an exception in the callback function of the scheduled event\n    /// </summary>\n    public class ScheduledEventException : Exception\n    {\n        /// <summary>\n        /// Gets the name of the scheduled event\n        /// </summary>\n        public string ScheduledEventName { get; }\n\n        /// <summary>\n        /// ScheduledEventException constructor\n        /// </summary>\n        /// <param name=\"name\">The name of the scheduled event</param>\n        /// <param name=\"message\">The exception as a string</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception</param>\n        public ScheduledEventException(string name, string message, Exception innerException) : base(message, innerException)\n        {\n            ScheduledEventName = name;\n        }\n    }\n}"
  },
  {
    "path": "Common/Scheduling/TimeConsumer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Represents a timer consumer instance\n    /// </summary>\n    public class TimeConsumer\n    {\n        /// <summary>\n        /// True if the consumer already finished it's work and no longer consumes time\n        /// </summary>\n        public bool Finished { get; set; }\n\n        /// <summary>\n        /// The time provider associated with this consumer\n        /// </summary>\n        public ITimeProvider TimeProvider { get; set; }\n\n        /// <summary>\n        /// The isolator limit provider to be used with this consumer\n        /// </summary>\n        public IIsolatorLimitResultProvider IsolatorLimitProvider { get; set; }\n\n        /// <summary>\n        /// The next time, base on the <see cref=\"TimeProvider\"/>, that time should be requested\n        /// to be <see cref=\"IsolatorLimitProvider\"/>\n        /// </summary>\n        public DateTime? NextTimeRequest { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/TimeMonitor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Helper class that will monitor timer consumers and request more time if required.\n    /// Used by <see cref=\"IsolatorLimitResultProvider\"/>\n    /// </summary>\n    public class TimeMonitor : IDisposable\n    {\n        private readonly int _monitorIntervalMs;\n        private readonly Timer _timer;\n        /// <summary>\n        /// List to store the coming TimeConsumer objects\n        /// </summary>\n        /// <remarks>This field is protected because it's used in a test class \n        /// in `IsolatorLimitResultProviderTests.cs</remarks>\n        protected List<TimeConsumer> TimeConsumers { get; init; }\n\n        /// <summary>\n        /// Returns the number of time consumers currently being monitored\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                lock (TimeConsumers)\n                {\n                    return TimeConsumers.Count;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public TimeMonitor(int monitorIntervalMs = 100)\n        {\n            _monitorIntervalMs = monitorIntervalMs;\n            TimeConsumers = new List<TimeConsumer>();\n            _timer = new Timer(state =>\n            {\n                lock (TimeConsumers)\n                {\n                    try\n                    {\n                        RemoveAll();\n\n                        foreach (var consumer in TimeConsumers)\n                        {\n                            ProcessConsumer(consumer);\n                        }\n                    }\n                    finally\n                    {\n                        if (TimeConsumers.Count > 0)\n                        {\n                            // there's some remaning and we are at the timer callback so let's re schedule\n                            TrySchedule();\n                        }\n                    }\n                }\n            }, null, Timeout.Infinite, Timeout.Infinite);\n        }\n\n        /// <summary>\n        /// Process the TimeConsumer object in TimeConsumers list\n        /// </summary>\n        /// <param name=\"consumer\">The TimeConsumer object to be processed</param>\n        /// <remarks>This method is protected because it's overrode by a test class\n        /// in `IsolatorLimitResultProviderTests.cs`</remarks>\n        protected virtual void ProcessConsumer(TimeConsumer consumer)\n        {\n            if (consumer.NextTimeRequest == null)\n            {\n                // first time, for performance we register this here and not the time consumer\n                consumer.NextTimeRequest = consumer.TimeProvider.GetUtcNow().AddMinutes(1);\n            }\n            else if (consumer.TimeProvider.GetUtcNow() >= consumer.NextTimeRequest)\n            {\n                // each minute request additional time from the isolator\n                consumer.NextTimeRequest = consumer.NextTimeRequest.Value.AddMinutes(1);\n                try\n                {\n                    // this will notify the isolator that we've exceed the limits\n                    consumer.IsolatorLimitProvider.RequestAdditionalTime(minutes: 1);\n                }\n                catch\n                {\n                    // pass\n                }\n            }\n        }\n\n        /// <summary>\n        /// Remove all TimeConsumer objects where the `Finished` field is marked as true\n        /// </summary>\n        /// <remarks>This method is protected because it's overrode by a test class in \n        /// `IsolatorLimitResultProviderTests.cs`</remarks>\n        protected virtual void RemoveAll()\n        {\n            TimeConsumers.RemoveAll(time => time.Finished);\n        }\n\n        /// <summary>\n        /// Adds a new time consumer element to be monitored\n        /// </summary>\n        /// <param name=\"consumer\">Time consumer instance</param>\n        public void Add(TimeConsumer consumer)\n        {\n            lock (TimeConsumers)\n            {\n                if (TimeConsumers.Count == 0)\n                {\n                    // there was none left, schedule is not running, let's schedule it\n                    TrySchedule();\n                }\n                TimeConsumers.Add(consumer);\n            }\n        }\n\n        /// <summary>\n        /// Disposes of the inner timer\n        /// </summary>\n        public void Dispose()\n        {\n            _timer.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Lazy scheduling\n        /// </summary>\n        private void TrySchedule()\n        {\n            try\n            {\n                _timer.Change(Time.GetSecondUnevenWait(_monitorIntervalMs), Timeout.Infinite);\n            }\n            catch (ObjectDisposedException)\n            {\n                // ignored disposed\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Scheduling/TimeRules.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Scheduling\n{\n    /// <summary>\n    /// Helper class used to provide better syntax when defining time rules\n    /// </summary>\n    public class TimeRules : BaseScheduleRules\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeRules\"/> helper class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"securities\">The security manager</param>\n        /// <param name=\"timeZone\">The algorithm's default time zone</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database instance to use</param>\n        public TimeRules(IAlgorithm algorithm, SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase)\n            : base(algorithm, securities, timeZone, marketHoursDatabase)\n        {\n        }\n\n        /// <summary>\n        /// Sets the default time zone\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone to use for helper methods that can't resolve a time zone</param>\n        public void SetDefaultTimeZone(DateTimeZone timeZone)\n        {\n            TimeZone = timeZone;\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the current time\n        /// </summary>\n        public ITimeRule Now => new FuncTimeRule(\"Now\", dates => {\n            return dates.Select(date =>\n            {\n                // we ignore the given date and just use the current time, why? if the algorithm used 'DateRules.Today'\n                // we get the algorithms first 'Date', which during warmup might not be a complete date, depending on the warmup period\n                // and since Today returns dates we might get a time in the past which get's ignored. See 'WarmupTrainRegressionAlgorithm'\n                // which reproduces GH issue #6410\n                return Securities.UtcTime;\n            });\n        });\n\n        /// <summary>\n        /// Convenience property for running a scheduled event at midnight in the algorithm time zone\n        /// </summary>\n        public ITimeRule Midnight => new FuncTimeRule(\"Midnight\", dates => dates.Select(date => date.ConvertToUtc(TimeZone)));\n\n        /// <summary>\n        /// Convenience property for running a scheduled event at noon in the algorithm time zone\n        /// </summary>\n        public ITimeRule Noon => new FuncTimeRule(\"Noon\", dates => dates.Select(date => date.ConvertToUtc(TimeZone).AddHours(12)));\n\n        /// <summary>\n        /// Specifies an event should fire at the specified time of day in the algorithm's time zone\n        /// </summary>\n        /// <param name=\"timeOfDay\">The time of day in the algorithm's time zone the event should fire</param>\n        /// <returns>A time rule that fires at the specified time in the algorithm's time zone</returns>\n        public ITimeRule At(TimeSpan timeOfDay)\n        {\n            return At(timeOfDay, TimeZone);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the specified time of day in the algorithm's time zone\n        /// </summary>\n        /// <param name=\"hour\">The hour</param>\n        /// <param name=\"minute\">The minute</param>\n        /// <param name=\"second\">The second</param>\n        /// <returns>A time rule that fires at the specified time in the algorithm's time zone</returns>\n        public ITimeRule At(int hour, int minute, int second = 0)\n        {\n            return At(new TimeSpan(hour, minute, second), TimeZone);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the specified time of day in the specified time zone\n        /// </summary>\n        /// <param name=\"hour\">The hour</param>\n        /// <param name=\"minute\">The minute</param>\n        /// <param name=\"timeZone\">The time zone the event time is represented in</param>\n        /// <returns>A time rule that fires at the specified time in the algorithm's time zone</returns>\n        public ITimeRule At(int hour, int minute, DateTimeZone timeZone)\n        {\n            return At(new TimeSpan(hour, minute, 0), timeZone);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the specified time of day in the specified time zone\n        /// </summary>\n        /// <param name=\"hour\">The hour</param>\n        /// <param name=\"minute\">The minute</param>\n        /// <param name=\"second\">The second</param>\n        /// <param name=\"timeZone\">The time zone the event time is represented in</param>\n        /// <returns>A time rule that fires at the specified time in the algorithm's time zone</returns>\n        public ITimeRule At(int hour, int minute, int second, DateTimeZone timeZone)\n        {\n            return At(new TimeSpan(hour, minute, second), timeZone);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the specified time of day in the specified time zone\n        /// </summary>\n        /// <param name=\"timeOfDay\">The time of day in the algorithm's time zone the event should fire</param>\n        /// <param name=\"timeZone\">The time zone the date time is expressed in</param>\n        /// <returns>A time rule that fires at the specified time in the algorithm's time zone</returns>\n        public ITimeRule At(TimeSpan timeOfDay, DateTimeZone timeZone)\n        {\n            var name = string.Join(\",\", timeOfDay.TotalHours.ToStringInvariant(\"0.##\"));\n            Func<IEnumerable<DateTime>, IEnumerable<DateTime>> applicator = dates =>\n                from date in dates\n                let localEventTime = date + timeOfDay\n                let utcEventTime = localEventTime.ConvertToUtc(timeZone)\n                select utcEventTime;\n\n            return new FuncTimeRule(name, applicator);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire periodically on the requested interval\n        /// </summary>\n        /// <param name=\"interval\">The frequency with which the event should fire, can not be zero or less</param>\n        /// <returns>A time rule that fires after each interval passes</returns>\n        public ITimeRule Every(TimeSpan interval)\n        {\n            if (interval <= TimeSpan.Zero)\n            {\n                throw new ArgumentException(\"TimeRules.Every(): time span interval can not be zero or less\");\n            }\n            var name = Invariant($\"Every {interval.TotalMinutes:0.##} min\");\n            Func<IEnumerable<DateTime>, IEnumerable<DateTime>> applicator = dates => EveryIntervalIterator(dates, interval, TimeZone);\n            return new FuncTimeRule(name, applicator);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at market open +- <paramref name=\"minutesBeforeOpen\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market open we want an event for</param>\n        /// <param name=\"minutesBeforeOpen\">The minutes before market open that the event should fire</param>\n        /// <param name=\"extendedMarketOpen\">True to use extended market open, false to use regular market open</param>\n        /// <returns>A time rule that fires the specified number of minutes before the symbol's market open</returns>\n        public ITimeRule BeforeMarketOpen(string symbol, double minutesBeforeOpen = 0, bool extendedMarketOpen = false) => BeforeMarketOpen(GetSymbol(symbol), minutesBeforeOpen, extendedMarketOpen);\n\n        /// <summary>\n        /// Specifies an event should fire at market open +- <paramref name=\"minutesBeforeOpen\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market open we want an event for</param>\n        /// <param name=\"minutesBeforeOpen\">The minutes before market open that the event should fire</param>\n        /// <param name=\"extendedMarketOpen\">True to use extended market open, false to use regular market open</param>\n        /// <returns>A time rule that fires the specified number of minutes before the symbol's market open</returns>\n        public ITimeRule BeforeMarketOpen(Symbol symbol, double minutesBeforeOpen = 0, bool extendedMarketOpen = false)\n        {\n            return AfterMarketOpen(symbol, minutesBeforeOpen * (-1), extendedMarketOpen);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at market open +- <paramref name=\"minutesAfterOpen\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market open we want an event for</param>\n        /// <param name=\"minutesAfterOpen\">The minutes after market open that the event should fire</param>\n        /// <param name=\"extendedMarketOpen\">True to use extended market open, false to use regular market open</param>\n        /// <returns>A time rule that fires the specified number of minutes after the symbol's market open</returns>\n        public ITimeRule AfterMarketOpen(string symbol, double minutesAfterOpen = 0, bool extendedMarketOpen = false) => AfterMarketOpen(GetSymbol(symbol), minutesAfterOpen, extendedMarketOpen);\n\n        /// <summary>\n        /// Specifies an event should fire at market open +- <paramref name=\"minutesAfterOpen\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market open we want an event for</param>\n        /// <param name=\"minutesAfterOpen\">The minutes after market open that the event should fire</param>\n        /// <param name=\"extendedMarketOpen\">True to use extended market open, false to use regular market open</param>\n        /// <returns>A time rule that fires the specified number of minutes after the symbol's market open</returns>\n        public ITimeRule AfterMarketOpen(Symbol symbol, double minutesAfterOpen = 0, bool extendedMarketOpen = false)\n        {\n            var type = extendedMarketOpen ? \"ExtendedMarketOpen\" : \"MarketOpen\";\n            var afterOrBefore = minutesAfterOpen > 0 ? \"after\" : \"before\";\n            var name = Invariant($\"{symbol}: {Math.Abs(minutesAfterOpen):0.##} min {afterOrBefore} {type}\");\n            var exchangeHours = GetSecurityExchangeHours(symbol);\n\n            var timeAfterOpen = TimeSpan.FromMinutes(minutesAfterOpen);\n            Func<IEnumerable<DateTime>, IEnumerable<DateTime>> applicator = dates =>\n                from date in dates\n                let marketOpen = exchangeHours.GetFirstDailyMarketOpen((date + Time.OneDay).AddTicks(-1), extendedMarketOpen)\n                // make sure the market open is of this date\n                where exchangeHours.IsDateOpen(date, extendedMarketOpen) && marketOpen.Date == date.Date\n                let localEventTime = marketOpen + timeAfterOpen\n                let utcEventTime = localEventTime.ConvertToUtc(exchangeHours.TimeZone)\n                select utcEventTime;\n\n            return new FuncTimeRule(name, applicator);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the market close +- <paramref name=\"minutesAfterClose\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market close we want an event for</param>\n        /// <param name=\"minutesAfterClose\">The time after market close that the event should fire</param>\n        /// <param name=\"extendedMarketClose\">True to use extended market close, false to use regular market close</param>\n        /// <returns>A time rule that fires the specified number of minutes after the symbol's market close</returns>\n        public ITimeRule AfterMarketClose(string symbol, double minutesAfterClose = 0, bool extendedMarketClose = false) => AfterMarketClose(GetSymbol(symbol), minutesAfterClose, extendedMarketClose);\n\n        /// <summary>\n        /// Specifies an event should fire at the market close +- <paramref name=\"minutesAfterClose\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market close we want an event for</param>\n        /// <param name=\"minutesAfterClose\">The time after market close that the event should fire</param>\n        /// <param name=\"extendedMarketClose\">True to use extended market close, false to use regular market close</param>\n        /// <returns>A time rule that fires the specified number of minutes after the symbol's market close</returns>\n        public ITimeRule AfterMarketClose(Symbol symbol, double minutesAfterClose = 0, bool extendedMarketClose = false)\n        {\n            return BeforeMarketClose(symbol, minutesAfterClose * (-1), extendedMarketClose);\n        }\n\n        /// <summary>\n        /// Specifies an event should fire at the market close +- <paramref name=\"minutesBeforeClose\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market close we want an event for</param>\n        /// <param name=\"minutesBeforeClose\">The time before market close that the event should fire</param>\n        /// <param name=\"extendedMarketClose\">True to use extended market close, false to use regular market close</param>\n        /// <returns>A time rule that fires the specified number of minutes before the symbol's market close</returns>\n        public ITimeRule BeforeMarketClose(string symbol, double minutesBeforeClose = 0, bool extendedMarketClose = false) => BeforeMarketClose(GetSymbol(symbol), minutesBeforeClose, extendedMarketClose);\n\n        /// <summary>\n        /// Specifies an event should fire at the market close +- <paramref name=\"minutesBeforeClose\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose market close we want an event for</param>\n        /// <param name=\"minutesBeforeClose\">The time before market close that the event should fire</param>\n        /// <param name=\"extendedMarketClose\">True to use extended market close, false to use regular market close</param>\n        /// <returns>A time rule that fires the specified number of minutes before the symbol's market close</returns>\n        public ITimeRule BeforeMarketClose(Symbol symbol, double minutesBeforeClose = 0, bool extendedMarketClose = false)\n        {\n            var type = extendedMarketClose ? \"ExtendedMarketClose\" : \"MarketClose\";\n            var afterOrBefore = minutesBeforeClose > 0 ? \"before\" : \"after\";\n            var name = Invariant($\"{symbol}: {Math.Abs(minutesBeforeClose):0.##} min {afterOrBefore} {type}\");\n            var exchangeHours = GetSecurityExchangeHours(symbol);\n\n            var timeBeforeClose = TimeSpan.FromMinutes(minutesBeforeClose);\n            Func<IEnumerable<DateTime>, IEnumerable<DateTime>> applicator = dates =>\n                from date in dates\n                let marketClose = exchangeHours.GetLastDailyMarketClose(date, extendedMarketClose)\n                // make sure the market open is of this date\n                where exchangeHours.IsDateOpen(date, extendedMarketClose)\n                let localEventTime = marketClose - timeBeforeClose\n                let utcEventTime = localEventTime.ConvertToUtc(exchangeHours.TimeZone)\n                select utcEventTime;\n\n            return new FuncTimeRule(name, applicator);\n        }\n\n        /// <summary>\n        /// For each provided date will yield all the time intervals based on the supplied time span\n        /// </summary>\n        /// <param name=\"dates\">The dates for which we want to create the different intervals</param>\n        /// <param name=\"interval\">The interval value to use, can not be zero or less</param>\n        /// <param name=\"timeZone\">The time zone the date time is expressed in</param>\n        private static IEnumerable<DateTime> EveryIntervalIterator(IEnumerable<DateTime> dates, TimeSpan interval, DateTimeZone timeZone)\n        {\n            if (interval <= TimeSpan.Zero)\n            {\n                throw new ArgumentException(\"TimeRules.EveryIntervalIterator(): time span interval can not be zero or less\");\n            }\n            foreach (var date in dates)\n            {\n                for (var time = TimeSpan.Zero; time < Time.OneDay; time += interval)\n                {\n                    yield return (date + time).ConvertToUtc(timeZone);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/AccountCurrencyImmediateSettlementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for applying cash settlement rules\n    /// </summary>\n    /// <remarks>This model converts the amount to the account currency and applies cash settlement immediately</remarks>\n    public class AccountCurrencyImmediateSettlementModel : ImmediateSettlementModel\n    {\n        /// <summary>\n        /// Applies cash settlement rules\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        public override void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            var currency = applyFundsParameters.CashAmount.Currency;\n            var amount = applyFundsParameters.CashAmount.Amount;\n            var portfolio = applyFundsParameters.Portfolio;\n            var amountInAccountCurrency = portfolio.CashBook.ConvertToAccountCurrency(amount, currency);\n\n            portfolio.CashBook[portfolio.CashBook.AccountCurrency].AddAmount(amountInAccountCurrency);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/AccountEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Messaging class signifying a change in a user's account\n    /// </summary>\n    public class AccountEvent\n    {\n        /// <summary>\n        /// Gets the total cash balance of the account in units of <see cref=\"CurrencySymbol\"/>\n        /// </summary>\n        public decimal CashBalance { get; private set; }\n\n        /// <summary>\n        /// Gets the currency symbol\n        /// </summary>\n        public string CurrencySymbol { get; private set; }\n\n        /// <summary>\n        /// Creates an AccountEvent\n        /// </summary>\n        /// <param name=\"currencySymbol\">The currency's symbol</param>\n        /// <param name=\"cashBalance\">The total cash balance of the account</param>\n        public AccountEvent(string currencySymbol, decimal cashBalance)\n        {\n            CashBalance = cashBalance;\n            CurrencySymbol = currencySymbol;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.AccountEvent.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/AdjustedPriceVariationModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPriceVariationModel\"/>\n    /// for use when data is <see cref=\"DataNormalizationMode.Adjusted\"/>.\n    /// </summary>\n    public class AdjustedPriceVariationModel : IPriceVariationModel\n    {\n        /// <summary>\n        /// Get the minimum price variation from a security\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the method parameters</param>\n        /// <returns>Zero</returns>\n        public virtual decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters)\n        {\n            return 0;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/ApplyFundsSettlementModelParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Helper parameters class for <see cref=\"ISettlementModel.ApplyFunds(ApplyFundsSettlementModelParameters)\"/>\n    /// </summary>\n    public class ApplyFundsSettlementModelParameters\n    {\n        /// <summary>\n        /// The algorithm portfolio instance\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; set; }\n\n        /// <summary>\n        /// The associated security type\n        /// </summary>\n        public Security Security { get; set; }\n\n        /// <summary>\n        /// The current Utc time\n        /// </summary>\n        public DateTime UtcTime { get; set; }\n\n        /// <summary>\n        /// The funds to apply\n        /// </summary>\n        public CashAmount CashAmount { get; set; }\n\n        /// <summary>\n        /// The associated fill event\n        /// </summary>\n        public OrderEvent Fill { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The fill's security</param>\n        /// <param name=\"applicationTimeUtc\">The fill time (in UTC)</param>\n        /// <param name=\"cashAmount\">The amount to settle</param>\n        /// <param name=\"fill\">The associated fill</param>\n        public ApplyFundsSettlementModelParameters(SecurityPortfolioManager portfolio, Security security, DateTime applicationTimeUtc, CashAmount cashAmount, OrderEvent fill)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            UtcTime = applicationTimeUtc;\n            CashAmount = cashAmount;\n            Fill = fill;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/BaseSecurityDatabase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Base class for security databases, including market hours and symbol properties.\n    /// </summary>\n    public abstract class BaseSecurityDatabase<T, TEntry>\n        where T : BaseSecurityDatabase<T, TEntry>\n    {\n        /// <summary>\n        /// The database instance loaded from the data folder\n        /// </summary>\n        protected static T DataFolderDatabase { get; set; }\n\n        /// <summary>\n        /// Lock object for the data folder database\n        /// </summary>\n        protected static readonly object DataFolderDatabaseLock = new object();\n\n        /// <summary>\n        /// The database entries\n        /// </summary>\n        protected Dictionary<SecurityDatabaseKey, TEntry> Entries { get; set; }\n\n        /// <summary>\n        /// Custom entries set by the user.\n        /// </summary>\n        protected HashSet<SecurityDatabaseKey> CustomEntries { get; }\n\n        // _loadFromFromDataFolder and _updateEntry are used to load the database from\n        // the data folder and update an entry respectively.\n        // These are not abstract or virtual methods because they might be static methods.\n        private readonly Func<T> _loadFromFromDataFolder;\n        private readonly Action<TEntry, TEntry> _updateEntry;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseSecurityDatabase{T, TEntry}\"/> class\n        /// </summary>\n        /// <param name=\"entries\">The full listing of exchange hours by key</param>\n        /// <param name=\"fromDataFolder\">Method to load the database form the data folder</param>\n        /// <param name=\"updateEntry\">Method to update a database entry</param>\n        protected BaseSecurityDatabase(Dictionary<SecurityDatabaseKey, TEntry> entries,\n            Func<T> fromDataFolder, Action<TEntry, TEntry> updateEntry)\n        {\n            Entries = entries;\n            CustomEntries = new();\n            _loadFromFromDataFolder = fromDataFolder;\n            _updateEntry = updateEntry;\n        }\n\n        /// <summary>\n        /// Resets the database, forcing a reload when reused.\n        /// Called in tests where multiple algorithms are run sequentially,\n        /// and we need to guarantee that every test starts with the same environment.\n        /// </summary>\n#pragma warning disable CA1000 // Do not declare static members on generic types\n        public static void Reset()\n#pragma warning restore CA1000 // Do not declare static members on generic types\n        {\n            lock (DataFolderDatabaseLock)\n            {\n                DataFolderDatabase = null;\n            }\n        }\n\n        /// <summary>\n        /// Reload entries dictionary from file and merge them with previous custom ones\n        /// </summary>\n        internal void UpdateDataFolderDatabase()\n        {\n            lock (DataFolderDatabaseLock)\n            {\n                Reset();\n                var newDatabase = _loadFromFromDataFolder();\n                Merge(newDatabase, resetCustomEntries: false);\n                // Make sure we keep this as the data folder database\n                DataFolderDatabase = (T)this;\n            }\n        }\n\n        /// <summary>\n        /// Updates the entries dictionary with the new entries from the specified database\n        /// </summary>\n        internal virtual void Merge(T newDatabase, bool resetCustomEntries)\n        {\n            var newEntries = new List<KeyValuePair<SecurityDatabaseKey, TEntry>>();\n\n            foreach (var newEntry in newDatabase.Entries)\n            {\n                if (Entries.TryGetValue(newEntry.Key, out var entry))\n                {\n                    if (resetCustomEntries || !CustomEntries.Contains(newEntry.Key))\n                    {\n                        _updateEntry(entry, newEntry.Value);\n                    }\n                }\n                else\n                {\n                    newEntries.Add(KeyValuePair.Create(newEntry.Key, newEntry.Value));\n                }\n            }\n\n            Entries = Entries\n                .Where(kvp => (!resetCustomEntries && CustomEntries.Contains(kvp.Key)) || newDatabase.Entries.ContainsKey(kvp.Key))\n                .Concat(newEntries)\n                .ToDictionary();\n\n            if (resetCustomEntries)\n            {\n                CustomEntries.Clear();\n            }\n        }\n\n        /// <summary>\n        /// Determines if the database contains the specified key\n        /// </summary>\n        /// <param name=\"key\">The key to search for</param>\n        /// <returns>True if an entry is found, otherwise false</returns>\n        protected bool ContainsKey(SecurityDatabaseKey key)\n        {\n            return Entries.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Check whether an entry exists for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        public bool ContainsKey(string market, string symbol, SecurityType securityType)\n        {\n            return ContainsKey(new SecurityDatabaseKey(market, symbol, securityType));\n        }\n\n        /// <summary>\n        /// Check whether an entry exists for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded (Symbol class)</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        public bool ContainsKey(string market, Symbol symbol, SecurityType securityType)\n        {\n            return ContainsKey(\n                market,\n                GetDatabaseSymbolKey(symbol),\n                securityType);\n        }\n\n        /// <summary>\n        /// Gets the correct string symbol to use as a database key\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>The symbol string used in the database ke</returns>\n#pragma warning disable CA1000 // Do not declare static members on generic types\n        public static string GetDatabaseSymbolKey(Symbol symbol)\n#pragma warning restore CA1000 // Do not declare static members on generic types\n        {\n            string stringSymbol;\n            if (symbol == null)\n            {\n                stringSymbol = string.Empty;\n            }\n            else\n            {\n                switch (symbol.ID.SecurityType)\n                {\n                    case SecurityType.Option:\n                        stringSymbol = symbol.HasUnderlying ? symbol.Underlying.Value : string.Empty;\n                        break;\n                    case SecurityType.IndexOption:\n                    case SecurityType.FutureOption:\n                        stringSymbol = symbol.HasUnderlying ? symbol.ID.Symbol : string.Empty;\n                        break;\n                    case SecurityType.Base:\n                    case SecurityType.Future:\n                        stringSymbol = symbol.ID.Symbol;\n                        break;\n                    default:\n                        stringSymbol = symbol.Value;\n                        break;\n                }\n            }\n\n            return stringSymbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/BrokerageModelSecurityInitializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISecurityInitializer\"/> that initializes a security\n    /// by settings the <see cref=\"Security.FillModel\"/>, <see cref=\"Security.FeeModel\"/>,\n    /// <see cref=\"Security.SlippageModel\"/>, and the <see cref=\"Security.SettlementModel\"/> properties\n    /// </summary>\n    public class BrokerageModelSecurityInitializer : ISecurityInitializer\n    {\n        private readonly IBrokerageModel _brokerageModel;\n        private readonly ISecuritySeeder _securitySeeder;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageModelSecurityInitializer\"/> class\n        /// for the specified algorithm\n        /// </summary>\n        public BrokerageModelSecurityInitializer()\n        {\n\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageModelSecurityInitializer\"/> class\n        /// for the specified algorithm\n        /// </summary>\n        /// <param name=\"brokerageModel\">The brokerage model used to initialize the security models</param>\n        /// <param name=\"securitySeeder\">An <see cref=\"ISecuritySeeder\"/> used to seed the initial price of the security</param>\n        public BrokerageModelSecurityInitializer(IBrokerageModel brokerageModel, ISecuritySeeder securitySeeder)\n        {\n            _brokerageModel = brokerageModel;\n            _securitySeeder = securitySeeder;\n        }\n\n        /// <summary>\n        /// Initializes the specified security by setting up the models\n        /// </summary>\n        /// <param name=\"security\">The security to be initialized</param>\n        public virtual void Initialize(Security security)\n        {\n            // Sets the security models\n            security.FillModel = _brokerageModel.GetFillModel(security);\n            security.FeeModel = _brokerageModel.GetFeeModel(security);\n            security.SlippageModel = _brokerageModel.GetSlippageModel(security);\n            security.SettlementModel = _brokerageModel.GetSettlementModel(security);\n            security.BuyingPowerModel = _brokerageModel.GetBuyingPowerModel(security);\n            security.MarginInterestRateModel = _brokerageModel.GetMarginInterestRateModel(security);\n            // Sets the leverage after the buying power model. Otherwise we would set the leverage of the default model.\n            security.SetLeverage(_brokerageModel.GetLeverage(security));\n            security.SetShortableProvider(_brokerageModel.GetShortableProvider(security));\n\n            _securitySeeder.SeedSecurity(security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/BuyingPower.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the result for <see cref=\"IBuyingPowerModel.GetBuyingPower\"/>\n    /// </summary>\n    public class BuyingPower\n    {\n        /// <summary>\n        /// Gets the buying power\n        /// </summary>\n        public decimal Value { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BuyingPower\"/> class\n        /// </summary>\n        /// <param name=\"buyingPower\">The buying power</param>\n        public BuyingPower(decimal buyingPower)\n        {\n            Value = buyingPower;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/BuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing System.Diagnostics.CodeAnalysis;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a base class for all buying power models\n    /// </summary>\n    public class BuyingPowerModel : IBuyingPowerModel\n    {\n        /// <summary>\n        /// Gets an implementation of <see cref=\"IBuyingPowerModel\"/> that\n        /// does not check for sufficient buying power\n        /// </summary>\n        public static readonly IBuyingPowerModel Null = new NullBuyingPowerModel();\n\n        private decimal _initialMarginRequirement;\n        private decimal _maintenanceMarginRequirement;\n\n        /// <summary>\n        /// The percentage used to determine the required unused buying power for the account.\n        /// </summary>\n        protected decimal RequiredFreeBuyingPowerPercent { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BuyingPowerModel\"/> with no leverage (1x)\n        /// </summary>\n        public BuyingPowerModel()\n            : this(1m)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BuyingPowerModel\"/>\n        /// </summary>\n        /// <param name=\"initialMarginRequirement\">The percentage of an order's absolute cost\n        /// that must be held in free cash in order to place the order</param>\n        /// <param name=\"maintenanceMarginRequirement\">The percentage of the holding's absolute\n        /// cost that must be held in free cash in order to avoid a margin call</param>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required\n        /// unused buying power for the account.</param>\n        public BuyingPowerModel(\n            decimal initialMarginRequirement,\n            decimal maintenanceMarginRequirement,\n            decimal requiredFreeBuyingPowerPercent\n            )\n        {\n            if (initialMarginRequirement < 0 || initialMarginRequirement > 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidInitialMarginRequirement);\n            }\n\n            if (maintenanceMarginRequirement < 0 || maintenanceMarginRequirement > 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidMaintenanceMarginRequirement);\n            }\n\n            if (requiredFreeBuyingPowerPercent < 0 || requiredFreeBuyingPowerPercent > 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidFreeBuyingPowerPercentRequirement);\n            }\n\n            _initialMarginRequirement = initialMarginRequirement;\n            _maintenanceMarginRequirement = maintenanceMarginRequirement;\n            RequiredFreeBuyingPowerPercent = requiredFreeBuyingPowerPercent;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BuyingPowerModel\"/>\n        /// </summary>\n        /// <param name=\"leverage\">The leverage</param>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required\n        /// unused buying power for the account.</param>\n        public BuyingPowerModel(decimal leverage, decimal requiredFreeBuyingPowerPercent = 0)\n        {\n            if (leverage < 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidLeverage);\n            }\n\n            if (requiredFreeBuyingPowerPercent < 0 || requiredFreeBuyingPowerPercent > 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidFreeBuyingPowerPercentRequirement);\n            }\n\n            _initialMarginRequirement = 1 / leverage;\n            _maintenanceMarginRequirement = 1 / leverage;\n            RequiredFreeBuyingPowerPercent = requiredFreeBuyingPowerPercent;\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public virtual decimal GetLeverage(Security security)\n        {\n            return 1 / _initialMarginRequirement;\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\"></param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public virtual void SetLeverage(Security security, decimal leverage)\n        {\n            if (leverage < 1)\n            {\n                throw new ArgumentException(Messages.BuyingPowerModel.InvalidLeverage);\n            }\n\n            var margin = 1 / leverage;\n            _initialMarginRequirement = margin;\n            _maintenanceMarginRequirement = margin;\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public virtual InitialMargin GetInitialMarginRequiredForOrder(\n            InitialMarginRequiredForOrderParameters parameters\n            )\n        {\n            //Get the order value from the non-abstract order classes (MarketOrder, LimitOrder, StopMarketOrder)\n            //Market order is approximated from the current security price and set in the MarketOrder Method in QCAlgorithm.\n\n            var fees = parameters.Security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(parameters.Security,\n                    parameters.Order)).Value;\n            var feesInAccountCurrency = parameters.CurrencyConverter.\n                ConvertToAccountCurrency(fees).Amount;\n\n            var orderMargin = this.GetInitialMarginRequirement(parameters.Security, parameters.Order.Quantity);\n\n            return orderMargin + Math.Sign(orderMargin) * feesInAccountCurrency;\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and holdings quantity/cost/value</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public virtual MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return parameters.AbsoluteHoldingsValue * _maintenanceMarginRequirement;\n        }\n\n        /// <summary>\n        /// Gets the margin cash available for a trade\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security to be traded</param>\n        /// <param name=\"direction\">The direction of the trade</param>\n        /// <returns>The margin available for the trade</returns>\n        protected virtual decimal GetMarginRemaining(\n            SecurityPortfolioManager portfolio,\n            Security security,\n            OrderDirection direction\n            )\n        {\n            var totalPortfolioValue = portfolio.TotalPortfolioValue;\n            var result = portfolio.GetMarginRemaining(totalPortfolioValue);\n\n            if (direction != OrderDirection.Hold)\n            {\n                var holdings = security.Holdings;\n                //If the order is in the same direction as holdings, our remaining cash is our cash\n                //In the opposite direction, our remaining cash is 2 x current value of assets + our cash\n                if (holdings.IsLong)\n                {\n                    switch (direction)\n                    {\n                        case OrderDirection.Sell:\n                            result +=\n                                // portion of margin to close the existing position\n                                this.GetMaintenanceMargin(security) +\n                                // portion of margin to open the new position\n                                this.GetInitialMarginRequirement(security, security.Holdings.AbsoluteQuantity);\n                            break;\n                    }\n                }\n                else if (holdings.IsShort)\n                {\n                    switch (direction)\n                    {\n                        case OrderDirection.Buy:\n                            result +=\n                                // portion of margin to close the existing position\n                                this.GetMaintenanceMargin(security) +\n                                // portion of margin to open the new position\n                                this.GetInitialMarginRequirement(security, security.Holdings.AbsoluteQuantity);\n                            break;\n                    }\n                }\n            }\n\n            result -= totalPortfolioValue * RequiredFreeBuyingPowerPercent;\n            return result < 0 ? 0 : result;\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity of shares</param>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        public virtual InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var security = parameters.Security;\n            var quantity = parameters.Quantity;\n            return security.QuoteCurrency.ConversionRate\n                * security.SymbolProperties.ContractMultiplier\n                * security.Price\n                * quantity\n                * _initialMarginRequirement;\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        public virtual HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters)\n        {\n            // short circuit the div 0 case\n            if (parameters.Order.Quantity == 0)\n            {\n                return parameters.Sufficient();\n            }\n\n            var ticket = parameters.Portfolio.Transactions.GetOrderTicket(parameters.Order.Id);\n            if (ticket == null)\n            {\n                return parameters.Insufficient(Messages.BuyingPowerModel.InsufficientBuyingPowerDueToNullOrderTicket(parameters.Order));\n            }\n\n            if (parameters.Order.Type == OrderType.OptionExercise)\n            {\n                // for option assignment and exercise orders we look into the requirements to process the underlying security transaction\n                var option = (Option.Option) parameters.Security;\n                var underlying = option.Underlying;\n\n                if (option.IsAutoExercised(underlying.Close) && underlying.IsTradable)\n                {\n                    var quantity = option.GetExerciseQuantity(parameters.Order.Quantity);\n\n                    var newOrder = new LimitOrder\n                    {\n                        Id = parameters.Order.Id,\n                        Time = parameters.Order.Time,\n                        LimitPrice = option.StrikePrice,\n                        Symbol = underlying.Symbol,\n                        Quantity = quantity\n                    };\n\n                    // we continue with this call for underlying\n                    var parametersForUnderlying = parameters.ForUnderlying(newOrder);\n\n                    var freeMargin = underlying.BuyingPowerModel.GetBuyingPower(parametersForUnderlying.Portfolio, parametersForUnderlying.Security, parametersForUnderlying.Order.Direction);\n                    // we add the margin used by the option itself\n                    freeMargin += GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(option, -parameters.Order.Quantity));\n\n                    var initialMarginRequired = underlying.BuyingPowerModel.GetInitialMarginRequiredForOrder(\n                        new InitialMarginRequiredForOrderParameters(parameters.Portfolio.CashBook, underlying, newOrder));\n\n                    return HasSufficientBuyingPowerForOrder(parametersForUnderlying, ticket, freeMargin, initialMarginRequired);\n                }\n\n                return parameters.Sufficient();\n            }\n\n            return HasSufficientBuyingPowerForOrder(parameters, ticket);\n        }\n\n        private HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters, OrderTicket ticket,\n            decimal? freeMarginToUse = null, decimal? initialMarginRequired = null)\n        {\n            // When order only reduces or closes a security position, capital is always sufficient\n            if (parameters.Security.Holdings.Quantity * parameters.Order.Quantity < 0 && Math.Abs(parameters.Security.Holdings.Quantity) >= Math.Abs(parameters.Order.Quantity))\n            {\n                return parameters.Sufficient();\n            }\n\n            var freeMargin = freeMarginToUse ?? GetMarginRemaining(parameters.Portfolio, parameters.Security, parameters.Order.Direction);\n            var initialMarginRequiredForOrder = initialMarginRequired ?? GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(\n                    parameters.Portfolio.CashBook, parameters.Security, parameters.Order\n            ));\n\n            // pro-rate the initial margin required for order based on how much has already been filled\n            var percentUnfilled = (Math.Abs(parameters.Order.Quantity) - Math.Abs(ticket.QuantityFilled)) / Math.Abs(parameters.Order.Quantity);\n            var initialMarginRequiredForRemainderOfOrder = percentUnfilled * initialMarginRequiredForOrder;\n\n            if (Math.Abs(initialMarginRequiredForRemainderOfOrder) > freeMargin)\n            {\n                return parameters.Insufficient(Messages.BuyingPowerModel.InsufficientBuyingPowerDueToUnsufficientMargin(parameters.Order,\n                    initialMarginRequiredForRemainderOfOrder, freeMargin));\n            }\n\n            return parameters.Sufficient();\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a delta in the buying power used by a security.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        public virtual GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower(\n            GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters)\n        {\n            var usedBuyingPower = parameters.Security.BuyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(parameters.Security)).AbsoluteUsedBuyingPower;\n\n            var signedUsedBuyingPower = usedBuyingPower * (parameters.Security.Holdings.IsLong ? 1 : -1);\n\n            var targetBuyingPower = signedUsedBuyingPower + parameters.DeltaBuyingPower;\n\n            var target = 0m;\n            if (parameters.Portfolio.TotalPortfolioValue != 0)\n            {\n                target = targetBuyingPower / parameters.Portfolio.TotalPortfolioValue;\n            }\n\n            return GetMaximumOrderQuantityForTargetBuyingPower(\n                new GetMaximumOrderQuantityForTargetBuyingPowerParameters(parameters.Portfolio,\n                    parameters.Security,\n                    target,\n                    parameters.MinimumOrderMarginPortfolioPercentage,\n                    parameters.SilenceNonErrorReasons));\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given buying power percentage.\n        /// Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the target signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>This implementation ensures that our resulting holdings is less than the target, but it does not necessarily\n        /// maximize the holdings to meet the target. To do that we need a minimizing algorithm that reduces the difference between\n        /// the target final margin value and the target holdings margin.</remarks>\n        public virtual GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)\n        {\n            // this is expensive so lets fetch it once\n            var totalPortfolioValue = parameters.Portfolio.TotalPortfolioValue;\n\n            // adjust target buying power to comply with required Free Buying Power Percent\n            var signedTargetFinalMarginValue =\n                parameters.TargetBuyingPower * (totalPortfolioValue - totalPortfolioValue * RequiredFreeBuyingPowerPercent);\n\n            // if targeting zero, simply return the negative of the quantity\n            if (signedTargetFinalMarginValue == 0)\n            {\n                return new GetMaximumOrderQuantityResult(-parameters.Security.Holdings.Quantity, string.Empty, false);\n            }\n\n            // we use initial margin requirement here to avoid the duplicate PortfolioTarget.Percent situation:\n            // PortfolioTarget.Percent(1) -> fills -> PortfolioTarget.Percent(1) _could_ detect free buying power if we use Maintenance requirement here\n            var signedCurrentUsedMargin = this.GetInitialMarginRequirement(parameters.Security, parameters.Security.Holdings.Quantity);\n\n            // determine the unit price in terms of the account currency\n            var utcTime = parameters.Security.LocalTime.ConvertToUtc(parameters.Security.Exchange.TimeZone);\n\n            // determine the margin required for 1 unit\n            var absUnitMargin = this.GetInitialMarginRequirement(parameters.Security, 1);\n            if (absUnitMargin == 0)\n            {\n                return new GetMaximumOrderQuantityResult(0, parameters.Security.Symbol.GetZeroPriceMessage());\n            }\n\n            // Check that the change of margin is above our models minimum percentage change\n            var absDifferenceOfMargin = Math.Abs(signedTargetFinalMarginValue - signedCurrentUsedMargin);\n            if (!BuyingPowerModelExtensions.AboveMinimumOrderMarginPortfolioPercentage(parameters.Portfolio,\n                parameters.MinimumOrderMarginPortfolioPercentage, absDifferenceOfMargin))\n            {\n                string reason = null;\n                if (!parameters.SilenceNonErrorReasons)\n                {\n                    var minimumValue = totalPortfolioValue * parameters.MinimumOrderMarginPortfolioPercentage;\n                    reason = Messages.BuyingPowerModel.TargetOrderMarginNotAboveMinimum(absDifferenceOfMargin, minimumValue);\n                }\n\n                if (!PortfolioTarget.MinimumOrderMarginPercentageWarningSent.HasValue)\n                {\n                    // will trigger the warning if it has not already been sent\n                    PortfolioTarget.MinimumOrderMarginPercentageWarningSent = false;\n                }\n                return new GetMaximumOrderQuantityResult(0, reason, false);\n            }\n\n            // Use the following loop to converge on a value that places us under our target allocation when adjusted for fees\n            var lastOrderQuantity = 0m;     // For safety check\n            decimal orderFees = 0m;\n            decimal signedTargetHoldingsMargin;\n            decimal orderQuantity;\n\n            do\n            {\n                // Calculate our order quantity\n                orderQuantity = GetAmountToOrder(parameters.Security, signedTargetFinalMarginValue, absUnitMargin, out signedTargetHoldingsMargin);\n                if (orderQuantity == 0)\n                {\n                    string reason = null;\n                    if (!parameters.SilenceNonErrorReasons)\n                    {\n                        reason = Messages.BuyingPowerModel.OrderQuantityLessThanLotSize(parameters.Security,\n                            signedTargetFinalMarginValue - signedCurrentUsedMargin);\n                    }\n\n                    return new GetMaximumOrderQuantityResult(0, reason, false);\n                }\n\n                // generate the order\n                var order = new MarketOrder(parameters.Security.Symbol, orderQuantity, utcTime);\n                var fees = parameters.Security.FeeModel.GetOrderFee(\n                    new OrderFeeParameters(parameters.Security,\n                        order)).Value;\n                orderFees = parameters.Portfolio.CashBook.ConvertToAccountCurrency(fees).Amount;\n\n                // Update our target portfolio margin allocated when considering fees, then calculate the new FinalOrderMargin\n                signedTargetFinalMarginValue = (totalPortfolioValue - orderFees - totalPortfolioValue * RequiredFreeBuyingPowerPercent) * parameters.TargetBuyingPower;\n\n                // Start safe check after first loop, stops endless recursion\n                if (lastOrderQuantity == orderQuantity)\n                {\n                    var message = Messages.BuyingPowerModel.FailedToConvergeOnTheTargetMargin(parameters, signedTargetFinalMarginValue, orderFees);\n\n                    // Need to add underlying value to message to reproduce with options\n                    if (parameters.Security is Option.Option option && option.Underlying != null)\n                    {\n                        var underlying = option.Underlying;\n                        message += \" \" + Messages.BuyingPowerModel.FailedToConvergeOnTheTargetMarginUnderlyingSecurityInfo(underlying);\n                    }\n\n                    throw new ArgumentException(message);\n                }\n                lastOrderQuantity = orderQuantity;\n\n            }\n            // Ensure that our target holdings margin will be less than or equal to our target allocated margin\n            while (Math.Abs(signedTargetHoldingsMargin) > Math.Abs(signedTargetFinalMarginValue));\n\n            // add directionality back in\n            return new GetMaximumOrderQuantityResult(orderQuantity);\n        }\n\n        /// <summary>\n        /// Helper function that determines the amount to order to get to a given target safely.\n        /// Meaning it will either be at or just below target always.\n        /// </summary>\n        /// <param name=\"security\">Security we are to determine order size for</param>\n        /// <param name=\"targetMargin\">Target margin allocated</param>\n        /// <param name=\"marginForOneUnit\">Margin requirement for one unit; used in our initial order guess</param>\n        /// <param name=\"finalMargin\">Output the final margin allocated to this security</param>\n        /// <returns>The size of the order to get safely to our target</returns>\n        public decimal GetAmountToOrder([NotNull]Security security, decimal targetMargin, decimal marginForOneUnit, out decimal finalMargin)\n        {\n            var lotSize = security.SymbolProperties.LotSize;\n\n            // Start with order size that puts us back to 0, in theory this means current margin is 0\n            // so we can calculate holdings to get to the new target margin directly. This is very helpful for\n            // odd cases where margin requirements aren't linear.\n            var orderSize = -security.Holdings.Quantity;\n\n            // Use the margin for one unit to make our initial guess.\n            orderSize += targetMargin / marginForOneUnit;\n\n            // Determine the rounding mode for this order size\n            var roundingMode = targetMargin < 0\n                // Ending in short position; orders need to be rounded towards positive so we end up under our target\n                ? MidpointRounding.ToPositiveInfinity\n                // Ending in long position; orders need to be rounded towards negative so we end up under our target\n                : MidpointRounding.ToNegativeInfinity;\n\n            // Round this order size appropriately\n            orderSize = orderSize.DiscretelyRoundBy(lotSize, roundingMode);\n\n            // Use our model to calculate this final margin as a final check\n            finalMargin = this.GetInitialMarginRequirement(security,\n                    orderSize + security.Holdings.Quantity);\n\n            // Until our absolute final margin is equal to or below target we need to adjust; ensures we don't overshoot target\n            // This isn't usually the case, but for non-linear margin per unit cases this may be necessary.\n            // For example https://www.quantconnect.com/forum/discussion/12470, (covered in OptionMarginBuyingPowerModelTests)\n            var marginDifference = finalMargin - targetMargin;\n            while ((targetMargin < 0 && marginDifference < 0) || (targetMargin > 0 && marginDifference > 0))\n            {\n                // TODO: Can this be smarter about its adjustment, instead of just stepping by lotsize?\n                // We adjust according to the target margin being a short or long\n                orderSize += targetMargin < 0 ? lotSize : -lotSize;\n\n                // Recalculate final margin with this adjusted orderSize\n                finalMargin = this.GetInitialMarginRequirement(security,\n                    orderSize + security.Holdings.Quantity);\n\n                // Safety check, does not occur in any of our testing, but to be sure we don't enter a endless loop\n                // have this guy check that the difference between the two is not growing.\n                var newDifference = finalMargin - targetMargin;\n                if (Math.Abs(newDifference) > Math.Abs(marginDifference) && Math.Sign(newDifference) == Math.Sign(marginDifference))\n                {\n                    // We have a problem and are correcting in the wrong direction\n                    var errorMessage = \"BuyingPowerModel().GetAmountToOrder(): \" +\n                        Messages.BuyingPowerModel.MarginBeingAdjustedInTheWrongDirection(targetMargin, marginForOneUnit, security);\n\n                    // Need to add underlying value to message to reproduce with options\n                    if (security is Option.Option option && option.Underlying != null)\n                    {\n                        errorMessage += \" \" + Messages.BuyingPowerModel.MarginBeingAdjustedInTheWrongDirectionUnderlyingSecurityInfo(option.Underlying);\n                    }\n\n                    throw new ArgumentException(errorMessage);\n                }\n\n                marginDifference = newDifference;\n            }\n\n            return orderSize;\n        }\n\n        /// <summary>\n        /// Gets the amount of buying power reserved to maintain the specified position\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the security</param>\n        /// <returns>The reserved buying power in account currency</returns>\n        public virtual ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters)\n        {\n            var maintenanceMargin = this.GetMaintenanceMargin(parameters.Security);\n            return parameters.ResultInAccountCurrency(maintenanceMargin);\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        public virtual BuyingPower GetBuyingPower(BuyingPowerParameters parameters)\n        {\n            var marginRemaining = GetMarginRemaining(parameters.Portfolio, parameters.Security, parameters.Direction);\n            return parameters.ResultInAccountCurrency(marginRemaining);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/BuyingPowerModelExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides extension methods as backwards compatibility shims\n    /// </summary>\n    public static class BuyingPowerModelExtensions\n    {\n        /// <summary>\n        /// Gets the amount of buying power reserved to maintain the specified position\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"IBuyingPowerModel\"/></param>\n        /// <param name=\"security\">The security</param>\n        /// <returns>The reserved buying power in account currency</returns>\n        public static decimal GetReservedBuyingPowerForPosition(this IBuyingPowerModel model, Security security)\n        {\n            var context = new ReservedBuyingPowerForPositionParameters(security);\n            var reservedBuyingPower = model.GetReservedBuyingPowerForPosition(context);\n            return reservedBuyingPower.AbsoluteUsedBuyingPower;\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"IBuyingPowerModel\"/></param>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security to be traded</param>\n        /// <param name=\"order\">The order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        public static HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            this IBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            Security security,\n            Order order\n            )\n        {\n            var parameters = new HasSufficientBuyingPowerForOrderParameters(portfolio, security, order);\n\n            return model.HasSufficientBuyingPowerForOrder(parameters);\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given value in account currency\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"IBuyingPowerModel\"/></param>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security to be traded</param>\n        /// <param name=\"target\">The target percent holdings</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public static GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(\n            this IBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            Security security,\n            decimal target,\n            decimal minimumOrderMarginPortfolioPercentage\n            )\n        {\n            var parameters = new GetMaximumOrderQuantityForTargetBuyingPowerParameters(portfolio, security, target, minimumOrderMarginPortfolioPercentage);\n\n            return model.GetMaximumOrderQuantityForTargetBuyingPower(parameters);\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a trade\n        /// </summary>\n        /// <param name=\"model\">The <see cref=\"IBuyingPowerModel\"/></param>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security to be traded</param>\n        /// <param name=\"direction\">The direction of the trade</param>\n        /// <returns>The buying power available for the trade</returns>\n        public static decimal GetBuyingPower(\n            this IBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            Security security,\n            OrderDirection direction\n        )\n        {\n            var context = new BuyingPowerParameters(portfolio, security, direction);\n            var buyingPower = model.GetBuyingPower(context);\n\n            // existing implementations assume certain non-account currency units, so return raw value\n            return buyingPower.Value;\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"model\">The buying power model</param>\n        /// <param name=\"security\">The security</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public static decimal GetMaintenanceMargin(this IBuyingPowerModel model, Security security)\n        {\n            return model.GetMaintenanceMargin(MaintenanceMarginParameters.ForCurrentHoldings(security));\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"model\">The buying power model</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"quantity\">The quantity of shares</param>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        public static decimal GetInitialMarginRequirement(this IBuyingPowerModel model, Security security, decimal quantity)\n        {\n            return model.GetInitialMarginRequirement(new InitialMarginParameters(security, quantity));\n        }\n\n        /// <summary>\n        /// Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage\n        /// </summary>\n        /// <param name=\"model\">The buying power model</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"quantity\">The quantity of shares</param>\n        /// <param name=\"portfolioManager\">The algorithm's portfolio</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes</param>\n        /// <remarks>If we are trading with negative margin remaining this method will return true always</remarks>\n        /// <returns>True if this order quantity is above the minimum requested</returns>\n        public static bool AboveMinimumOrderMarginPortfolioPercentage(this IBuyingPowerModel model, Security security,\n            decimal quantity, SecurityPortfolioManager portfolioManager, decimal minimumOrderMarginPortfolioPercentage)\n        {\n            if (minimumOrderMarginPortfolioPercentage == 0)\n            {\n                return true;\n            }\n            var absFinalOrderMargin = Math.Abs(model.GetInitialMarginRequirement(new InitialMarginParameters(\n                security, quantity)).Value);\n\n            return AboveMinimumOrderMarginPortfolioPercentage(portfolioManager, minimumOrderMarginPortfolioPercentage, absFinalOrderMargin);\n        }\n\n        /// <summary>\n        /// Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage\n        /// </summary>\n        /// <param name=\"portfolioManager\">The algorithm's portfolio</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes</param>\n        /// <param name=\"absFinalOrderMargin\">The calculated order margin value</param>\n        /// <remarks>If we are trading with negative margin remaining this method will return true always</remarks>\n        /// <returns>True if this order quantity is above the minimum requested</returns>\n        public static bool AboveMinimumOrderMarginPortfolioPercentage(SecurityPortfolioManager portfolioManager,\n            decimal minimumOrderMarginPortfolioPercentage,\n            decimal absFinalOrderMargin)\n        {\n            var minimumValue = portfolioManager.TotalPortfolioValue * minimumOrderMarginPortfolioPercentage;\n\n            if (minimumValue > absFinalOrderMargin\n                // if margin remaining is negative allow the order to pass so we can reduce the position\n                && portfolioManager.GetMarginRemaining(portfolioManager.TotalPortfolioValue) > 0)\n            {\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/BuyingPowerParameters.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.GetBuyingPower\"/>\n    /// </summary>\n    public class BuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the algorithm's portfolio\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the direction in which buying power is to be computed\n        /// </summary>\n        public OrderDirection Direction { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"direction\">The direction to compute buying power in</param>\n        public BuyingPowerParameters(SecurityPortfolioManager portfolio, Security security, OrderDirection direction)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            Direction = direction;\n        }\n\n        /// <summary>\n        /// Creates the result using the specified buying power\n        /// </summary>\n        /// <param name=\"buyingPower\">The buying power</param>\n        /// <param name=\"currency\">The units the buying power is denominated in</param>\n        /// <returns>The buying power</returns>\n        public BuyingPower Result(decimal buyingPower, string currency)\n        {\n            // TODO: Properly account for 'currency' - not accounted for currently as only performing mechanical refactoring\n            return new BuyingPower(buyingPower);\n        }\n\n        /// <summary>\n        /// Creates the result using the specified buying power in units of the account currency\n        /// </summary>\n        /// <param name=\"buyingPower\">The buying power</param>\n        /// <returns>The buying power</returns>\n        public BuyingPower ResultInAccountCurrency(decimal buyingPower)\n        {\n            return new BuyingPower(buyingPower);\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Cash.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing ProtoBuf;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities.CurrencyConversion;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a holding of a currency in cash.\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public class Cash\n    {\n        private ICurrencyConversion _currencyConversion;\n\n        private readonly object _locker = new object();\n\n        /// <summary>\n        /// Event fired when this instance is updated\n        /// <see cref=\"AddAmount\"/>, <see cref=\"SetAmount\"/>, <see cref=\"Update\"/>\n        /// </summary>\n        public event EventHandler Updated;\n\n        /// <summary>\n        /// Event fired when this instance's <see cref=\"CurrencyConversion\"/> is set/updated\n        /// </summary>\n        public event EventHandler CurrencyConversionUpdated;\n\n        /// <summary>\n        /// Gets the symbols of the securities required to provide conversion rates.\n        /// If this cash represents the account currency, then an empty enumerable is returned.\n        /// </summary>\n        public IEnumerable<Symbol> SecuritySymbols => CurrencyConversion.ConversionRateSecurities.Any()\n            ? CurrencyConversion.ConversionRateSecurities.Select(x => x.Symbol)\n            // we do this only because Newtonsoft.Json complains about empty enumerables\n            : new List<Symbol>(0);\n\n        /// <summary>\n        /// Gets the object that calculates the conversion rate to account currency\n        /// </summary>\n        [JsonIgnore]\n        public ICurrencyConversion CurrencyConversion\n        {\n            get\n            {\n                return _currencyConversion;\n            }\n            internal set\n            {\n\n                var lastConversionRate = 0m;\n                if (_currencyConversion != null)\n                {\n                    lastConversionRate = _currencyConversion.ConversionRate;\n                    _currencyConversion.ConversionRateUpdated -= OnConversionRateUpdated;\n                }\n\n                _currencyConversion = value;\n                if (_currencyConversion != null)\n                {\n                    if (lastConversionRate != 0m)\n                    {\n                        // If a user adds cash with an initial conversion rate and then this is overriden to a SecurityCurrencyConversion,\n                        // we want to keep the previous rate until the new one is updated.\n                        _currencyConversion.ConversionRate = lastConversionRate;\n                    }\n                    _currencyConversion.ConversionRateUpdated += OnConversionRateUpdated;\n                }\n                CurrencyConversionUpdated?.Invoke(this, EventArgs.Empty);\n            }\n        }\n\n        private void OnConversionRateUpdated(object sender, decimal e)\n        {\n            OnUpdate();\n        }\n\n        /// <summary>\n        /// Gets the symbol used to represent this cash\n        /// </summary>\n        [ProtoMember(1)]\n        public string Symbol { get; }\n\n        /// <summary>\n        /// Gets or sets the amount of cash held\n        /// </summary>\n        [ProtoMember(2)]\n        public decimal Amount { get; private set; }\n\n        /// <summary>\n        /// Gets the conversion rate into account currency\n        /// </summary>\n        [ProtoMember(3)]\n        public decimal ConversionRate\n        {\n            get\n            {\n                return _currencyConversion.ConversionRate;\n            }\n            internal set\n            {\n                if (_currencyConversion == null)\n                {\n                    CurrencyConversion = new ConstantCurrencyConversion(Symbol, null, value);\n                }\n\n                _currencyConversion.ConversionRate = value;\n            }\n        }\n\n        /// <summary>\n        /// The symbol of the currency, such as $\n        /// </summary>\n        [ProtoMember(4)]\n        public string CurrencySymbol { get; }\n\n        /// <summary>\n        /// Gets the value of this cash in the account currency\n        /// </summary>\n        public decimal ValueInAccountCurrency => Amount * ConversionRate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Cash\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol used to represent this cash</param>\n        /// <param name=\"amount\">The amount of this currency held</param>\n        /// <param name=\"conversionRate\">The initial conversion rate of this currency into the <see cref=\"CashBook.AccountCurrency\"/></param>\n        public Cash(string symbol, decimal amount, decimal conversionRate)\n        {\n            if (string.IsNullOrEmpty(symbol))\n            {\n                throw new ArgumentException(Messages.Cash.NullOrEmptyCashSymbol);\n            }\n            Amount = amount;\n            Symbol = symbol.LazyToUpper();\n            CurrencySymbol = Currencies.GetCurrencySymbol(Symbol);\n            CurrencyConversion = new ConstantCurrencyConversion(Symbol, null, conversionRate);\n        }\n\n        /// <summary>\n        /// Marks this cash object's conversion rate as being potentially outdated\n        /// </summary>\n        public void Update()\n        {\n            _currencyConversion.Update();\n        }\n\n        /// <summary>\n        /// Adds the specified amount of currency to this Cash instance and returns the new total.\n        /// This operation is thread-safe\n        /// </summary>\n        /// <param name=\"amount\">The amount of currency to be added</param>\n        /// <returns>The amount of currency directly after the addition</returns>\n        public decimal AddAmount(decimal amount)\n        {\n            lock (_locker)\n            {\n                Amount += amount;\n            }\n            OnUpdate();\n            return Amount;\n        }\n\n        /// <summary>\n        /// Sets the Quantity to the specified amount\n        /// </summary>\n        /// <param name=\"amount\">The amount to set the quantity to</param>\n        public void SetAmount(decimal amount)\n        {\n            var updated = false;\n            // lock can be null when proto deserializing this instance\n            lock (_locker ?? new object())\n            {\n                if (Amount != amount)\n                {\n                    Amount = amount;\n                    // only update if there was actually one\n                    updated = true;\n                }\n            }\n\n            if (updated)\n            {\n                OnUpdate();\n            }\n        }\n\n        /// <summary>\n        /// Ensures that we have a data feed to convert this currency into the base currency.\n        /// This will add a <see cref=\"SubscriptionDataConfig\"/> and create a <see cref=\"Security\"/> at the lowest resolution if one is not found.\n        /// </summary>\n        /// <param name=\"securities\">The security manager</param>\n        /// <param name=\"subscriptions\">The subscription manager used for searching and adding subscriptions</param>\n        /// <param name=\"marketMap\">The market map that decides which market the new security should be in</param>\n        /// <param name=\"changes\">Will be used to consume <see cref=\"SecurityChanges.AddedSecurities\"/></param>\n        /// <param name=\"securityService\">Will be used to create required new <see cref=\"Security\"/></param>\n        /// <param name=\"accountCurrency\">The account currency</param>\n        /// <param name=\"defaultResolution\">The default resolution to use for the internal subscriptions</param>\n        /// <returns>Returns the added <see cref=\"SubscriptionDataConfig\"/>, otherwise null</returns>\n        public List<SubscriptionDataConfig> EnsureCurrencyDataFeed(SecurityManager securities,\n            SubscriptionManager subscriptions,\n            IReadOnlyDictionary<SecurityType, string> marketMap,\n            SecurityChanges changes,\n            ISecurityService securityService,\n            string accountCurrency,\n            Resolution defaultResolution = Resolution.Minute\n            )\n        {\n            // this gets called every time we add securities using universe selection,\n            // so must of the time we've already resolved the value and don't need to again\n            if (CurrencyConversion.DestinationCurrency != null)\n            {\n                return null;\n            }\n\n            if (Symbol == accountCurrency)\n            {\n                CurrencyConversion = ConstantCurrencyConversion.Identity(accountCurrency);\n                return null;\n            }\n\n            // existing securities\n            var securitiesToSearch = securities.Select(kvp => kvp.Value)\n                .Concat(changes.AddedSecurities)\n                .Where(s => ProvidesConversionRate(s.Type));\n\n            // Create a SecurityType to Market mapping with the markets from SecurityManager members\n            var markets = securities.Select(x => x.Key)\n                .GroupBy(x => x.SecurityType)\n                .ToDictionary(x => x.Key, y => y.Select(symbol => symbol.ID.Market).ToHashSet());\n            if (markets.ContainsKey(SecurityType.Cfd) && !markets.ContainsKey(SecurityType.Forex))\n            {\n                markets.Add(SecurityType.Forex, markets[SecurityType.Cfd]);\n            }\n            if (markets.ContainsKey(SecurityType.Forex) && !markets.ContainsKey(SecurityType.Cfd))\n            {\n                markets.Add(SecurityType.Cfd, markets[SecurityType.Forex]);\n            }\n\n            var forexEntries = GetAvailableSymbolPropertiesDatabaseEntries(SecurityType.Forex, marketMap, markets);\n            var cfdEntries = GetAvailableSymbolPropertiesDatabaseEntries(SecurityType.Cfd, marketMap, markets);\n            var cryptoEntries = GetAvailableSymbolPropertiesDatabaseEntries(SecurityType.Crypto, marketMap, markets);\n\n            if (marketMap.TryGetValue(SecurityType.CryptoFuture, out var cryptoFutureMarket) && cryptoFutureMarket == Market.DYDX)\n            {\n                // Put additional logic for dYdX crypto futures as they don't have Crypto (Spot) market\n                // Also need to add them first to give the priority\n                // TODO: remove once dydx SPOT market will be imlemented\n                cryptoEntries = GetAvailableSymbolPropertiesDatabaseEntries(SecurityType.CryptoFuture, marketMap, markets).Concat(cryptoEntries);\n            }\n\n            var potentialEntries = forexEntries\n                .Concat(cfdEntries)\n                .Concat(cryptoEntries)\n                .ToList();\n\n            // Special case for crypto markets without direct pairs (They wont be found by the above)\n            // This allows us to add cash for \"StableCoins\" that are 1-1 with our account currency without needing a conversion security.\n            // Check out the StableCoinsWithoutPairs static var for those that are missing their 1-1 conversion pairs\n            if (marketMap.TryGetValue(SecurityType.Crypto, out var market) && Currencies.IsStableCoinWithoutPair(accountCurrency, Symbol, market))\n            {\n                CurrencyConversion = ConstantCurrencyConversion.Identity(accountCurrency, Symbol);\n                return null;\n            }\n\n            if (!potentialEntries.Any(x =>\n                    Symbol == x.Key.Symbol.Substring(0, x.Key.Symbol.Length - x.Value.QuoteCurrency.Length) ||\n                    Symbol == x.Value.QuoteCurrency))\n            {\n                // currency not found in any tradeable pair\n                Log.Error(Messages.Cash.NoTradablePairFoundForCurrencyConversion(Symbol, accountCurrency, marketMap.Where(kvp => ProvidesConversionRate(kvp.Key))));\n                CurrencyConversion = ConstantCurrencyConversion.Null(accountCurrency, Symbol);\n                return null;\n            }\n\n            var requiredSecurities = new List<SubscriptionDataConfig>();\n\n            var potentials = potentialEntries\n                .Select(x => QuantConnect.Symbol.Create(x.Key.Symbol, x.Key.SecurityType, x.Key.Market));\n\n            var minimumResolution = subscriptions.Subscriptions.Select(x => x.Resolution).DefaultIfEmpty(defaultResolution).Min();\n\n            var makeNewSecurity = new Func<Symbol, Security>(symbol =>\n            {\n                var securityType = symbol.ID.SecurityType;\n\n                // use the first subscription defined in the subscription manager\n                var type = subscriptions.LookupSubscriptionConfigDataTypes(securityType, minimumResolution, false).First();\n                var objectType = type.Item1;\n                var tickType = type.Item2;\n\n                // set this as an internal feed so that the data doesn't get sent into the algorithm's OnData events\n                var config = subscriptions.SubscriptionDataConfigService.Add(symbol,\n                    minimumResolution,\n                    fillForward: true,\n                    extendedMarketHours: false,\n                    isInternalFeed: true,\n                    subscriptionDataTypes: new List<Tuple<Type, TickType>>\n                        {new Tuple<Type, TickType>(objectType, tickType)}).First();\n\n                var newSecurity = securityService.CreateSecurity(symbol,\n                    config,\n                    addToSymbolCache: false,\n                    // All securities added for currency conversion will be seeded in batch after all are created\n                    seedSecurity: false);\n\n                Log.Trace(\"Cash.EnsureCurrencyDataFeed(): \" + Messages.Cash.AddingSecuritySymbolForCashCurrencyFeed(symbol, Symbol));\n\n                securities.Add(symbol, newSecurity);\n                requiredSecurities.Add(config);\n\n                return newSecurity;\n            });\n\n            CurrencyConversion = SecurityCurrencyConversion.LinearSearch(Symbol,\n                accountCurrency,\n                securitiesToSearch.ToList(),\n                potentials,\n                makeNewSecurity);\n\n            return requiredSecurities;\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"string\"/> that represents the current <see cref=\"Cash\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"string\"/> that represents the current <see cref=\"Cash\"/>.</returns>\n        public override string ToString()\n        {\n            return ToString(Currencies.USD);\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"string\"/> that represents the current <see cref=\"Cash\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"string\"/> that represents the current <see cref=\"Cash\"/>.</returns>\n        public string ToString(string accountCurrency)\n        {\n            return Messages.Cash.ToString(this, accountCurrency);\n        }\n\n        private static IEnumerable<KeyValuePair<SecurityDatabaseKey, SymbolProperties>> GetAvailableSymbolPropertiesDatabaseEntries(\n            SecurityType securityType,\n            IReadOnlyDictionary<SecurityType, string> marketMap,\n            IReadOnlyDictionary<SecurityType, HashSet<string>> markets\n            )\n        {\n            var marketJoin = new HashSet<string>();\n            {\n                string market;\n                if (marketMap.TryGetValue(securityType, out market))\n                {\n                    marketJoin.Add(market);\n                }\n                HashSet<string> existingMarkets;\n                if (markets.TryGetValue(securityType, out existingMarkets))\n                {\n                    foreach (var existingMarket in existingMarkets)\n                    {\n                        marketJoin.Add(existingMarket);\n                    }\n                }\n            }\n\n            return marketJoin.SelectMany(market => SymbolPropertiesDatabase.FromDataFolder()\n                .GetSymbolPropertiesList(market, securityType));\n        }\n\n        private static bool ProvidesConversionRate(SecurityType securityType)\n        {\n            return securityType == SecurityType.Forex || securityType == SecurityType.Crypto || securityType == SecurityType.Cfd;\n        }\n\n        private void OnUpdate()\n        {\n            Updated?.Invoke(this, EventArgs.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CashAmount.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing ProtoBuf;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a cash amount which can be converted to account currency using a currency converter\n    /// </summary>\n    [ProtoContract(SkipConstructor = true)]\n    public struct CashAmount\n    {\n        /// <summary>\n        /// The amount of cash\n        /// </summary>\n        [ProtoMember(1)]\n        public decimal Amount { get; }\n\n        /// <summary>\n        /// The currency in which the cash amount is denominated\n        /// </summary>\n        [ProtoMember(2)]\n        public string Currency { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CashAmount\"/> class\n        /// </summary>\n        /// <param name=\"amount\">The amount</param>\n        /// <param name=\"currency\">The currency</param>\n        public CashAmount(decimal amount, string currency)\n        {\n            Amount = amount;\n            Currency = currency;\n        }\n\n        /// <summary>\n        /// Will determine if two <see cref=\"CashAmount\"/> instances are equal\n        /// Useful to compare against the default instance\n        /// </summary>\n        /// <returns>True if <see cref=\"Currency\"/> and <see cref=\"Amount\"/> are equal</returns>\n        public static bool operator ==(CashAmount lhs, CashAmount rhs)\n        {\n            return Equals(lhs, rhs);\n        }\n\n        /// <summary>\n        /// Will determine if two <see cref=\"CashAmount\"/> instances are different\n        /// Useful to compare against the default instance\n        /// </summary>\n        /// <returns>True if <see cref=\"Currency\"/> or <see cref=\"Amount\"/> are different</returns>\n        public static bool operator !=(CashAmount lhs, CashAmount rhs)\n        {\n            return !Equals(lhs, rhs);\n        }\n\n        /// <summary>\n        /// Used to compare two <see cref=\"CashAmount\"/> instances.\n        /// Useful to compare against the default instance\n        /// </summary>\n        /// <param name=\"obj\">The other object to compare with</param>\n        /// <returns>True if <see cref=\"Currency\"/> and <see cref=\"Amount\"/> are equal</returns>\n        public override bool Equals(object obj)\n        {\n            if (obj is CashAmount)\n            {\n                var cashAmountObj = (CashAmount) obj;\n                return Amount == cashAmountObj.Amount\n                    && Currency == cashAmountObj.Currency;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Get Hash Code for this Object\n        /// </summary>\n        /// <returns>Integer Hash Code</returns>\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CashBook.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a means of keeping track of the different cash holdings of an algorithm\n    /// </summary>\n    public class CashBook : ExtendedDictionary<string, Cash>, IDictionary<string, Cash>, ICurrencyConverter\n    {\n        private string _accountCurrency;\n\n        /// <summary>\n        /// Event fired when a <see cref=\"Cash\"/> instance is added or removed, and when\n        /// the <see cref=\"Cash.Updated\"/> is triggered for the currently hold instances\n        /// </summary>\n        public event EventHandler<CashBookUpdatedEventArgs> Updated;\n\n        /// <summary>\n        /// Gets the base currency used\n        /// </summary>\n        public string AccountCurrency\n        {\n            get { return _accountCurrency; }\n            set\n            {\n                var amount = 0m;\n                Cash accountCurrency;\n                // remove previous account currency if any\n                if (!_accountCurrency.IsNullOrEmpty()\n                    && TryGetValue(_accountCurrency, out accountCurrency))\n                {\n                    amount = accountCurrency.Amount;\n                    Remove(_accountCurrency);\n                }\n\n                // add new account currency using same amount as previous\n                _accountCurrency = value.LazyToUpper();\n                Add(_accountCurrency, new Cash(_accountCurrency, amount, 1.0m));\n            }\n        }\n\n        /// <summary>\n        /// No need for concurrent collection, they are expensive. Currencies barely change and only on the start\n        /// by the main thread, so if they do we will just create a new collection, reference change is atomic\n        /// </summary>\n        private Dictionary<string, Cash> _currencies;\n\n        /// <summary>\n        /// Gets the total value of the cash book in units of the base currency\n        /// </summary>\n        public decimal TotalValueInAccountCurrency\n        {\n            get\n            {\n                return this.Aggregate(0m, (d, pair) => d + pair.Value.ValueInAccountCurrency);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CashBook\"/> class.\n        /// </summary>\n        public CashBook()\n        {\n            _currencies = new();\n            AccountCurrency = Currencies.USD;\n        }\n\n        /// <summary>\n        /// Adds a new cash of the specified symbol and quantity\n        /// </summary>\n        /// <param name=\"symbol\">The symbol used to reference the new cash</param>\n        /// <param name=\"quantity\">The amount of new cash to start</param>\n        /// <param name=\"conversionRate\">The conversion rate used to determine the initial\n        /// portfolio value/starting capital impact caused by this currency position.</param>\n        /// <returns>The added cash instance</returns>\n        public Cash Add(string symbol, decimal quantity, decimal conversionRate)\n        {\n            var cash = new Cash(symbol, quantity, conversionRate);\n            // let's return the cash instance we are using\n            return AddIternal(symbol, cash);\n        }\n\n        /// <summary>\n        /// Checks the current subscriptions and adds necessary currency pair feeds to provide real time conversion data\n        /// </summary>\n        /// <param name=\"securities\">The SecurityManager for the algorithm</param>\n        /// <param name=\"subscriptions\">The SubscriptionManager for the algorithm</param>\n        /// <param name=\"marketMap\">The market map that decides which market the new security should be in</param>\n        /// <param name=\"changes\">Will be used to consume <see cref=\"SecurityChanges.AddedSecurities\"/></param>\n        /// <param name=\"securityService\">Will be used to create required new <see cref=\"Security\"/></param>\n        /// <param name=\"defaultResolution\">The default resolution to use for the internal subscriptions</param>\n        /// <returns>Returns a list of added currency <see cref=\"SubscriptionDataConfig\"/></returns>\n        public List<SubscriptionDataConfig> EnsureCurrencyDataFeeds(SecurityManager securities,\n            SubscriptionManager subscriptions,\n            IReadOnlyDictionary<SecurityType, string> marketMap,\n            SecurityChanges changes,\n            ISecurityService securityService,\n            Resolution defaultResolution = Resolution.Minute)\n        {\n            var addedSubscriptionDataConfigs = new List<SubscriptionDataConfig>();\n            foreach (var kvp in _currencies)\n            {\n                var cash = kvp.Value;\n\n                var subscriptionDataConfigs = cash.EnsureCurrencyDataFeed(\n                    securities,\n                    subscriptions,\n                    marketMap,\n                    changes,\n                    securityService,\n                    AccountCurrency,\n                    defaultResolution);\n                if (subscriptionDataConfigs != null)\n                {\n                    foreach (var subscriptionDataConfig in subscriptionDataConfigs)\n                    {\n                        addedSubscriptionDataConfigs.Add(subscriptionDataConfig);\n                    }\n                }\n            }\n            return addedSubscriptionDataConfigs;\n        }\n\n        /// <summary>\n        /// Converts a quantity of source currency units into the specified destination currency\n        /// </summary>\n        /// <param name=\"sourceQuantity\">The quantity of source currency to be converted</param>\n        /// <param name=\"sourceCurrency\">The source currency symbol</param>\n        /// <param name=\"destinationCurrency\">The destination currency symbol</param>\n        /// <returns>The converted value</returns>\n        public decimal Convert(decimal sourceQuantity, string sourceCurrency, string destinationCurrency)\n        {\n            if (sourceQuantity == 0)\n            {\n                return 0;\n            }\n\n            var source = this[sourceCurrency];\n            var destination = this[destinationCurrency];\n\n            if (source.ConversionRate == 0)\n            {\n                throw new ArgumentException(Messages.CashBook.ConversionRateNotFound(sourceCurrency));\n            }\n\n            if (destination.ConversionRate == 0)\n            {\n                throw new ArgumentException(Messages.CashBook.ConversionRateNotFound(destinationCurrency));\n            }\n\n            var conversionRate = source.ConversionRate / destination.ConversionRate;\n            return sourceQuantity * conversionRate;\n        }\n\n        /// <summary>\n        /// Converts a quantity of source currency units into the account currency\n        /// </summary>\n        /// <param name=\"sourceQuantity\">The quantity of source currency to be converted</param>\n        /// <param name=\"sourceCurrency\">The source currency symbol</param>\n        /// <returns>The converted value</returns>\n        public decimal ConvertToAccountCurrency(decimal sourceQuantity, string sourceCurrency)\n        {\n            if (sourceCurrency == AccountCurrency)\n            {\n                return sourceQuantity;\n            }\n            return Convert(sourceQuantity, sourceCurrency, AccountCurrency);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.CashBook.ToString(this);\n        }\n\n        #region IDictionary Implementation\n\n        /// <summary>\n        /// Gets the count of Cash items in this CashBook.\n        /// </summary>\n        /// <value>The count.</value>\n        public override int Count\n        {\n            get\n            {\n                return _currencies.Count;\n            }\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this instance is read only.\n        /// </summary>\n        /// <value><c>true</c> if this instance is read only; otherwise, <c>false</c>.</value>\n        public override bool IsReadOnly\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// Add the specified item to this CashBook.\n        /// </summary>\n        /// <param name=\"item\">KeyValuePair of symbol -> Cash item</param>\n        public void Add(KeyValuePair<string, Cash> item)\n        {\n            Add(item.Key, item.Value);\n        }\n\n        /// <summary>\n        /// Add the specified key and value.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the Cash value.</param>\n        /// <param name=\"value\">Value.</param>\n        public void Add(string symbol, Cash value)\n        {\n            AddIternal(symbol, value);\n        }\n\n        /// <summary>\n        /// Clear this instance of all Cash entries.\n        /// </summary>\n        public override void Clear()\n        {\n            _currencies = new();\n            OnUpdate(CashBookUpdateType.Removed, null);\n        }\n\n        /// <summary>\n        /// Remove the Cash item corresponding to the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbolto be removed</param>\n        public override bool Remove(string symbol)\n        {\n            return Remove(symbol, calledInternally: false);\n        }\n\n        /// <summary>\n        /// Remove the specified item.\n        /// </summary>\n        /// <param name=\"item\">Item.</param>\n        public bool Remove(KeyValuePair<string, Cash> item)\n        {\n            return Remove(item.Key);\n        }\n\n        /// <summary>\n        /// Determines whether the current instance contains an entry with the specified symbol.\n        /// </summary>\n        /// <returns><c>true</c>, if key was contained, <c>false</c> otherwise.</returns>\n        /// <param name=\"symbol\">Key.</param>\n        public override bool ContainsKey(string symbol)\n        {\n            return _currencies.ContainsKey(symbol);\n        }\n\n        /// <summary>\n        /// Try to get the value.\n        /// </summary>\n        /// <remarks>To be added.</remarks>\n        /// <returns><c>true</c>, if get value was tryed, <c>false</c> otherwise.</returns>\n        /// <param name=\"symbol\">The symbol.</param>\n        /// <param name=\"value\">Value.</param>\n        public override bool TryGetValue(string symbol, out Cash value)\n        {\n            return _currencies.TryGetValue(symbol, out value);\n        }\n\n        /// <summary>\n        /// Determines whether the current collection contains the specified value.\n        /// </summary>\n        /// <param name=\"item\">Item.</param>\n        public bool Contains(KeyValuePair<string, Cash> item)\n        {\n            return _currencies.Contains(item);\n        }\n\n        /// <summary>\n        /// Copies to the specified array.\n        /// </summary>\n        /// <param name=\"array\">Array.</param>\n        /// <param name=\"arrayIndex\">Array index.</param>\n        public void CopyTo(KeyValuePair<string, Cash>[] array, int arrayIndex)\n        {\n            ((IDictionary<string, Cash>) _currencies).CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"QuantConnect.Securities.Cash\"/> with the specified symbol.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol.</param>\n        public override Cash this[string symbol]\n        {\n            get\n            {\n                if (symbol == Currencies.NullCurrency)\n                {\n                    throw new InvalidOperationException(Messages.CashBook.UnexpectedRequestForNullCurrency);\n                }\n                Cash cash;\n                if (!_currencies.TryGetValue(symbol, out cash))\n                {\n                    throw new KeyNotFoundException(Messages.CashBook.CashSymbolNotFound(symbol));\n                }\n                return cash;\n            }\n            set\n            {\n                Add(symbol, value);\n            }\n        }\n\n        /// <summary>\n        /// Gets the keys.\n        /// </summary>\n        /// <value>The keys.</value>\n        public ICollection<string> Keys => _currencies.Keys;\n\n        /// <summary>\n        /// Gets the values.\n        /// </summary>\n        /// <value>The values.</value>\n        public ICollection<Cash> Values => _currencies.Values;\n\n        /// <summary>\n        /// Gets the keys.\n        /// </summary>\n        /// <value>The keys.</value>\n        protected override IEnumerable<string> GetKeys => Keys;\n\n        /// <summary>\n        /// Gets the values.\n        /// </summary>\n        /// <value>The values.</value>\n        protected override IEnumerable<Cash> GetValues => Values;\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<string, Cash>> GetItems() => _currencies;\n\n        /// <summary>\n        /// Gets the enumerator.\n        /// </summary>\n        /// <returns>The enumerator.</returns>\n        public IEnumerator<KeyValuePair<string, Cash>> GetEnumerator()\n        {\n            return _currencies.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return _currencies.GetEnumerator();\n        }\n\n        #endregion\n\n        #region ICurrencyConverter Implementation\n\n        /// <summary>\n        /// Converts a cash amount to the account currency\n        /// </summary>\n        /// <param name=\"cashAmount\">The <see cref=\"CashAmount\"/> instance to convert</param>\n        /// <returns>A new <see cref=\"CashAmount\"/> instance denominated in the account currency</returns>\n        public CashAmount ConvertToAccountCurrency(CashAmount cashAmount)\n        {\n            if (cashAmount.Currency == AccountCurrency)\n            {\n                return cashAmount;\n            }\n\n            var amount = Convert(cashAmount.Amount, cashAmount.Currency, AccountCurrency);\n            return new CashAmount(amount, AccountCurrency);\n        }\n\n        #endregion\n\n        private Cash AddIternal(string symbol, Cash value)\n        {\n            if (symbol == Currencies.NullCurrency)\n            {\n                return null;\n            }\n\n            if (!_currencies.TryGetValue(symbol, out var cash))\n            {\n                // we link our Updated event with underlying cash instances\n                // so interested listeners just subscribe to our event\n                value.Updated += OnCashUpdate;\n                var newCurrencies = new Dictionary<string, Cash>(_currencies)\n                {\n                    [symbol] = value\n                };\n                _currencies = newCurrencies;\n\n                OnUpdate(CashBookUpdateType.Added, value);\n\n                return value;\n            }\n            else\n            {\n                // override the values, it will trigger an update event already\n                // we keep the instance because it might be used by securities already\n                cash.ConversionRate = value.ConversionRate;\n                cash.SetAmount(value.Amount);\n\n                return cash;\n            }\n        }\n\n        private bool Remove(string symbol, bool calledInternally)\n        {\n            Cash cash = null;\n            var newCurrencies = new Dictionary<string, Cash>(_currencies);\n            var removed = newCurrencies.Remove(symbol, out cash);\n            _currencies = newCurrencies;\n            if (!removed)\n            {\n                if (!calledInternally)\n                {\n                    Log.Error(\"CashBook.Remove(): \" + Messages.CashBook.FailedToRemoveRecord(symbol));\n                }\n            }\n            else\n            {\n                cash.Updated -= OnCashUpdate;\n                if (!calledInternally)\n                {\n                    OnUpdate(CashBookUpdateType.Removed, cash);\n                }\n            }\n            return removed;\n        }\n\n        private void OnCashUpdate(object sender, EventArgs eventArgs)\n        {\n            OnUpdate(CashBookUpdateType.Updated, sender as Cash);\n        }\n\n        private void OnUpdate(CashBookUpdateType updateType, Cash cash)\n        {\n            Updated?.Invoke(this, new CashBookUpdatedEventArgs(updateType, cash));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CashBookUpdatedEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Event fired when the cash book is updated\n    /// </summary>\n    public class CashBookUpdatedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// The update type\n        /// </summary>\n        public CashBookUpdateType UpdateType { get; }\n\n        /// <summary>\n        /// The updated cash instance.\n        /// </summary>\n        /// <remarks>This will be null for <see cref=\"CashBookUpdateType.Removed\"/> events that clear the whole cash book</remarks>\n        public Cash Cash { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public CashBookUpdatedEventArgs(CashBookUpdateType type, Cash cash)\n        {\n            UpdateType = type;\n            Cash = cash;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CashBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a buying power model for cash accounts\n    /// </summary>\n    public class CashBuyingPowerModel : BuyingPowerModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CashBuyingPowerModel\"/> class\n        /// </summary>\n        public CashBuyingPowerModel()\n            : base(1m, 0m, 0m)\n        {\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            // Always returns 1. Cash accounts have no leverage.\n            return 1m;\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\">The security to set leverage for</param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public override void SetLeverage(Security security, decimal leverage)\n        {\n            if (leverage != 1)\n            {\n                throw new InvalidOperationException(Messages.CashBuyingPowerModel.UnsupportedLeverage);\n            }\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity of shares</param>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var security = parameters.Security;\n            var quantity = parameters.Quantity;\n            return security.QuoteCurrency.ConversionRate\n                * security.SymbolProperties.ContractMultiplier\n                * security.Price\n                * quantity;\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters)\n        {\n            var baseCurrency = parameters.Security as IBaseCurrencySymbol;\n            if (baseCurrency == null)\n            {\n                return parameters.Insufficient(Messages.CashBuyingPowerModel.UnsupportedSecurity(parameters.Security));\n            }\n\n            decimal totalQuantity;\n            decimal orderQuantity;\n            if (parameters.Order.Direction == OrderDirection.Buy)\n            {\n                // quantity available for buying in quote currency\n                totalQuantity = parameters.Security.QuoteCurrency.Amount;\n                orderQuantity = parameters.Order.AbsoluteQuantity * GetOrderPrice(parameters.Security, parameters.Order);\n            }\n            else\n            {\n                // quantity available for selling in base currency\n                totalQuantity = baseCurrency.BaseCurrency.Amount;\n                orderQuantity = parameters.Order.AbsoluteQuantity;\n            }\n\n            // calculate reserved quantity for open orders (in quote or base currency depending on direction)\n            var openOrdersReservedQuantity = GetOpenOrdersReservedQuantity(parameters.Portfolio, parameters.Security, parameters.Order);\n\n            if (parameters.Order.Direction == OrderDirection.Sell)\n            {\n                // can sell available and non-reserved quantities\n                if (orderQuantity <= totalQuantity - openOrdersReservedQuantity)\n                {\n                    return parameters.Sufficient();\n                }\n\n                return parameters.Insufficient(Messages.CashBuyingPowerModel.SellOrderShortHoldingsNotSupported(totalQuantity,\n                    openOrdersReservedQuantity, orderQuantity, baseCurrency));\n            }\n\n            var maximumQuantity = 0m;\n            if (parameters.Order.Type == OrderType.Market)\n            {\n                // include existing holdings (in quote currency)\n                var holdingsValue =\n                    parameters.Portfolio.CashBook.Convert(baseCurrency.BaseCurrency.Amount, baseCurrency.BaseCurrency.Symbol, parameters.Security.QuoteCurrency.Symbol);\n\n                // find a target value in account currency for buy market orders\n                var targetValue =\n                    parameters.Portfolio.CashBook.ConvertToAccountCurrency(totalQuantity - openOrdersReservedQuantity + holdingsValue,\n                        parameters.Security.QuoteCurrency.Symbol);\n\n                // convert the target into a percent in relation to TPV\n                var targetPercent = parameters.Portfolio.TotalPortfolioValue == 0 ? 0 : targetValue / parameters.Portfolio.TotalPortfolioValue;\n\n                // maximum quantity that can be bought (in quote currency)\n                maximumQuantity =\n                    GetMaximumOrderQuantityForTargetBuyingPower(\n                        new GetMaximumOrderQuantityForTargetBuyingPowerParameters(parameters.Portfolio, parameters.Security, targetPercent, 0)).Quantity * GetOrderPrice(parameters.Security, parameters.Order);\n\n                if (orderQuantity <= Math.Abs(maximumQuantity))\n                {\n                    return parameters.Sufficient();\n                }\n\n                return parameters.Insufficient(Messages.CashBuyingPowerModel.BuyOrderQuantityGreaterThanMaxForBuyingPower(totalQuantity,\n                    maximumQuantity, openOrdersReservedQuantity, orderQuantity, baseCurrency, parameters.Security, parameters.Order));\n            }\n\n            // for limit orders, add fees to the order cost\n            var orderFee = 0m;\n            if (parameters.Order.Type == OrderType.Limit)\n            {\n                var fee = parameters.Security.FeeModel.GetOrderFee(\n                    new OrderFeeParameters(parameters.Security,\n                        parameters.Order)).Value;\n                orderFee = parameters.Portfolio.CashBook.Convert(\n                        fee.Amount,\n                        fee.Currency,\n                        parameters.Security.QuoteCurrency.Symbol);\n            }\n\n            maximumQuantity = totalQuantity - openOrdersReservedQuantity - orderFee;\n            if (orderQuantity <= maximumQuantity)\n            {\n                return parameters.Sufficient();\n            }\n\n            return parameters.Insufficient(Messages.CashBuyingPowerModel.BuyOrderQuantityGreaterThanMaxForBuyingPower(totalQuantity,\n                    maximumQuantity, openOrdersReservedQuantity, orderQuantity, baseCurrency, parameters.Security, parameters.Order));\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a delta in the buying power used by a security.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        public override GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower(\n            GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters)\n        {\n            throw new NotImplementedException(Messages.CashBuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPowerNotImplemented);\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given buying power percentage.\n        /// Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the target signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public override GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)\n        {\n            var targetPortfolioValue = parameters.TargetBuyingPower * parameters.Portfolio.TotalPortfolioValue;\n            // no shorting allowed\n            if (targetPortfolioValue < 0)\n            {\n                return new GetMaximumOrderQuantityResult(0, Messages.CashBuyingPowerModel.ShortingNotSupported);\n            }\n\n            var baseCurrency = parameters.Security as IBaseCurrencySymbol;\n            if (baseCurrency == null)\n            {\n                return new GetMaximumOrderQuantityResult(0, Messages.CashBuyingPowerModel.InvalidSecurity);\n            }\n\n            // if target value is zero, return amount of base currency available to sell\n            if (targetPortfolioValue == 0)\n            {\n                return new GetMaximumOrderQuantityResult(-baseCurrency.BaseCurrency.Amount);\n            }\n\n            // convert base currency cash to account currency\n            var baseCurrencyPosition = parameters.Portfolio.CashBook.ConvertToAccountCurrency(\n                baseCurrency.BaseCurrency.Amount,\n                baseCurrency.BaseCurrency.Symbol);\n\n            // remove directionality, we'll work in the land of absolutes\n            var targetOrderValue = Math.Abs(targetPortfolioValue - baseCurrencyPosition);\n            var direction = targetPortfolioValue > baseCurrencyPosition ? OrderDirection.Buy : OrderDirection.Sell;\n\n            // determine the unit price in terms of the account currency\n            var unitPrice = direction == OrderDirection.Buy ? parameters.Security.AskPrice : parameters.Security.BidPrice;\n            unitPrice *= parameters.Security.QuoteCurrency.ConversionRate * parameters.Security.SymbolProperties.ContractMultiplier;\n\n            if (unitPrice == 0)\n            {\n                if (parameters.Security.QuoteCurrency.ConversionRate == 0)\n                {\n                    return new GetMaximumOrderQuantityResult(0,\n                        Messages.CashBuyingPowerModel.NoDataInInternalCashFeedYet(parameters.Security, parameters.Portfolio));\n                }\n\n                if (parameters.Security.SymbolProperties.ContractMultiplier == 0)\n                {\n                    return new GetMaximumOrderQuantityResult(0, Messages.CashBuyingPowerModel.ZeroContractMultiplier(parameters.Security));\n                }\n\n                // security.Price == 0\n                return new GetMaximumOrderQuantityResult(0, parameters.Security.Symbol.GetZeroPriceMessage());\n            }\n\n            // continue iterating while we do not have enough cash for the order\n            decimal orderFees = 0;\n            decimal currentOrderValue = 0;\n            // compute the initial order quantity\n            var orderQuantity = targetOrderValue / unitPrice;\n\n            // rounding off Order Quantity to the nearest multiple of Lot Size\n            orderQuantity -= orderQuantity % parameters.Security.SymbolProperties.LotSize;\n            if (orderQuantity == 0)\n            {\n                string reason = null;\n                if (!parameters.SilenceNonErrorReasons)\n                {\n                    reason = Messages.CashBuyingPowerModel.OrderQuantityLessThanLotSize(parameters.Security);\n                }\n                return new GetMaximumOrderQuantityResult(0, reason, false);\n            }\n\n            // Just in case...\n            var lastOrderQuantity = 0m;\n            var utcTime = parameters.Security.LocalTime.ConvertToUtc(parameters.Security.Exchange.TimeZone);\n            do\n            {\n                // Each loop will reduce the order quantity based on the difference between\n                // (cashRequired + orderFees) and targetOrderValue\n                if (currentOrderValue > targetOrderValue)\n                {\n                    var currentOrderValuePerUnit = currentOrderValue / orderQuantity;\n                    var amountOfOrdersToRemove = (currentOrderValue - targetOrderValue) / currentOrderValuePerUnit;\n                    if (amountOfOrdersToRemove < parameters.Security.SymbolProperties.LotSize)\n                    {\n                        // we will always substract at leat 1 LotSize\n                        amountOfOrdersToRemove = parameters.Security.SymbolProperties.LotSize;\n                    }\n                    orderQuantity -= amountOfOrdersToRemove;\n                }\n\n                // rounding off Order Quantity to the nearest multiple of Lot Size\n                orderQuantity -= orderQuantity % parameters.Security.SymbolProperties.LotSize;\n                if (orderQuantity <= 0)\n                {\n                    return new GetMaximumOrderQuantityResult(0,\n                        Messages.CashBuyingPowerModel.OrderQuantityLessThanLotSize(parameters.Security) +\n                        Messages.CashBuyingPowerModel.OrderQuantityLessThanLotSizeOrderDetails(targetOrderValue, orderQuantity, orderFees)\n                    );\n                }\n\n                if (lastOrderQuantity == orderQuantity)\n                {\n                    throw new ArgumentException(Messages.CashBuyingPowerModel.FailedToConvergeOnTargetOrderValue(targetOrderValue, currentOrderValue,\n                        orderQuantity, orderFees, parameters.Security));\n                }\n                lastOrderQuantity = orderQuantity;\n\n                // generate the order\n                var order = new MarketOrder(parameters.Security.Symbol, orderQuantity, utcTime);\n                var orderValue = orderQuantity * unitPrice;\n\n                var fees = parameters.Security.FeeModel.GetOrderFee(\n                    new OrderFeeParameters(parameters.Security,\n                        order)).Value;\n                orderFees = parameters.Portfolio.CashBook.ConvertToAccountCurrency(fees).Amount;\n\n                currentOrderValue = orderValue + orderFees;\n            } while (currentOrderValue > targetOrderValue);\n\n            // add directionality back in\n            return new GetMaximumOrderQuantityResult((direction == OrderDirection.Sell ? -1 : 1) * orderQuantity);\n        }\n\n        /// <summary>\n        /// Gets the amount of buying power reserved to maintain the specified position\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the security</param>\n        /// <returns>The reserved buying power in account currency</returns>\n        public override ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters)\n        {\n            // Always returns 0. Since we're purchasing currencies outright, the position doesn't consume buying power\n            return parameters.ResultInAccountCurrency(0m);\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        public override BuyingPower GetBuyingPower(BuyingPowerParameters parameters)\n        {\n            var security = parameters.Security;\n            var portfolio = parameters.Portfolio;\n            var direction = parameters.Direction;\n\n            var baseCurrency = security as IBaseCurrencySymbol;\n            if (baseCurrency == null)\n            {\n                return parameters.ResultInAccountCurrency(0m);\n            }\n\n            var baseCurrencyPosition = baseCurrency.BaseCurrency.Amount;\n            var quoteCurrencyPosition = portfolio.CashBook[security.QuoteCurrency.Symbol].Amount;\n\n            // determine the unit price in terms of the quote currency\n            var utcTime = parameters.Security.LocalTime.ConvertToUtc(parameters.Security.Exchange.TimeZone);\n            var unitPrice = new MarketOrder(security.Symbol, 1, utcTime).GetValue(security) / security.QuoteCurrency.ConversionRate;\n            if (unitPrice == 0)\n            {\n                return parameters.ResultInAccountCurrency(0m);\n            }\n\n            // NOTE: This is returning in units of the BASE currency\n            if (direction == OrderDirection.Buy)\n            {\n                // invert units for math, 6500USD per BTC, currency pairs aren't real fractions\n                // (USD)/(BTC/USD) => 10kUSD/ (6500 USD/BTC) => 10kUSD * (1BTC/6500USD) => ~ 1.5BTC\n                return parameters.Result(quoteCurrencyPosition / unitPrice, baseCurrency.BaseCurrency.Symbol);\n            }\n\n            if (direction == OrderDirection.Sell)\n            {\n                return parameters.Result(baseCurrencyPosition, baseCurrency.BaseCurrency.Symbol);\n            }\n\n            return parameters.ResultInAccountCurrency(0m);\n        }\n\n        private static decimal GetOrderPrice(Security security, Order order)\n        {\n            var orderPrice = 0m;\n            switch (order.Type)\n            {\n                case OrderType.Market:\n                    orderPrice = security.Price;\n                    break;\n\n                case OrderType.Limit:\n                    orderPrice = ((LimitOrder)order).LimitPrice;\n                    break;\n\n                case OrderType.StopMarket:\n                    orderPrice = ((StopMarketOrder)order).StopPrice;\n                    break;\n\n                case OrderType.StopLimit:\n                    orderPrice = ((StopLimitOrder)order).LimitPrice;\n                    break;\n\n                case OrderType.LimitIfTouched:\n                    orderPrice = ((LimitIfTouchedOrder)order).LimitPrice;\n                    break;\n\n                case OrderType.TrailingStop:\n                    orderPrice = ((TrailingStopOrder)order).StopPrice;\n                    break;\n            }\n\n            return orderPrice;\n        }\n\n        private static decimal GetOpenOrdersReservedQuantity(SecurityPortfolioManager portfolio, Security security, Order order)\n        {\n            var baseCurrency = security as IBaseCurrencySymbol;\n            if (baseCurrency == null) return 0;\n\n            // find the target currency for the requested direction and the securities potentially involved\n            var targetCurrency = order.Direction == OrderDirection.Buy\n                ? security.QuoteCurrency.Symbol\n                : baseCurrency.BaseCurrency.Symbol;\n\n            var symbolDirectionPairs = new Dictionary<Symbol, OrderDirection>();\n            foreach (var portfolioSecurity in portfolio.Securities.Values)\n            {\n                var basePortfolioSecurity = portfolioSecurity as IBaseCurrencySymbol;\n                if (basePortfolioSecurity == null) continue;\n\n                if (basePortfolioSecurity.BaseCurrency.Symbol == targetCurrency)\n                {\n                    symbolDirectionPairs.Add(portfolioSecurity.Symbol, OrderDirection.Sell);\n                }\n                else if (portfolioSecurity.QuoteCurrency.Symbol == targetCurrency)\n                {\n                    symbolDirectionPairs.Add(portfolioSecurity.Symbol, OrderDirection.Buy);\n                }\n            }\n\n            // fetch open orders with matching symbol/side\n            var openOrders = portfolio.Transactions.GetOpenOrders(x =>\n                {\n                    OrderDirection dir;\n                    return symbolDirectionPairs.TryGetValue(x.Symbol, out dir) &&\n                           // same direction of our order\n                           dir == x.Direction &&\n                           // don't count our current order\n                           x.Id != order.Id &&\n                           // only count working orders\n                           (x.Type == OrderType.Limit || x.Type == OrderType.StopMarket);\n                }\n            );\n\n            // calculate reserved quantity for selected orders\n            var openOrdersReservedQuantity = 0m;\n            foreach (var openOrder in openOrders)\n            {\n                var orderSecurity = portfolio.Securities[openOrder.Symbol];\n                var orderBaseCurrency = orderSecurity as IBaseCurrencySymbol;\n\n                if (orderBaseCurrency != null)\n                {\n                    // convert order value to target currency\n                    var quantityInTargetCurrency = openOrder.AbsoluteQuantity;\n                    if (orderSecurity.QuoteCurrency.Symbol == targetCurrency)\n                    {\n                        quantityInTargetCurrency *= GetOrderPrice(security, openOrder);\n                    }\n\n                    openOrdersReservedQuantity += quantityInTargetCurrency;\n                }\n            }\n\n            return openOrdersReservedQuantity;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Cfd/Cfd.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Securities.Cfd\n{\n    /// <summary>\n    /// CFD Security Object Implementation for CFD Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Cfd : Security\n    {\n        /// <summary>\n        /// Constructor for the CFD security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        public Cfd(SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SubscriptionDataConfig config,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes)\n            : base(config,\n                quoteCurrency,\n                symbolProperties,\n                new CfdExchange(exchangeHours),\n                new CfdCache(),\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new ConstantFeeModel(0),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new CfdDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            Holdings = new CfdHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Constructor for the CFD security\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache for storing Security data</param>\n        public Cfd(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new CfdExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new ConstantFeeModel(0),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new CfdDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            Holdings = new CfdHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Gets the contract multiplier for this CFD security\n        /// </summary>\n        public decimal ContractMultiplier\n        {\n            get { return SymbolProperties.ContractMultiplier; }\n        }\n\n        /// <summary>\n        /// Gets the minimum price variation for this CFD security\n        /// </summary>\n        public decimal MinimumPriceVariation\n        {\n            get { return SymbolProperties.MinimumPriceVariation; }\n        }\n\n        /// <summary>\n        /// Decomposes the specified currency pair into a base and quote currency provided as out parameters\n        /// </summary>\n        /// <param name=\"symbol\">The input symbol to be decomposed</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"baseCurrency\">The output base currency</param>\n        /// <param name=\"quoteCurrency\">The output quote currency</param>\n        public static void DecomposeCurrencyPair(Symbol symbol, SymbolProperties symbolProperties, out string baseCurrency, out string quoteCurrency)\n        {\n            quoteCurrency = symbolProperties.QuoteCurrency;\n            if (symbol.Value.EndsWith(quoteCurrency))\n            {\n                baseCurrency = symbol.Value.RemoveFromEnd(quoteCurrency);\n            }\n            else\n            {\n                throw new InvalidOperationException($\"Symbol doesn't end with {quoteCurrency}\");\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Cfd security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Cfd/CfdCache.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Cfd\n{\n    /// <summary>\n    /// CFD specific caching support\n    /// </summary>\n    /// <remarks>Class is virtually empty and scheduled to be made obsolete. Potentially could be used for user data storage.</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class CfdCache : SecurityCache\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Cfd/CfdDataFilter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Cfd\n{\n    /// <summary>\n    /// CFD packet by packet data filtering mechanism for dynamically detecting bad ticks.\n    /// </summary>\n    /// <seealso cref=\"SecurityDataFilter\"/>\n    public class CfdDataFilter : SecurityDataFilter\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Cfd/CfdExchange.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Cfd\n{\n    /// <summary>\n    /// CFD exchange class - information and helper tools for CFD exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class CfdExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days per year for this security, used for performance statistics.\n        /// </summary>\n        public override int TradingDaysPerYear\n        {\n            // 365 - Saturdays = 313;\n            get { return 313; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CfdExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public CfdExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Cfd/CfdHolding.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Cfd\n{\n    /// <summary>\n    /// CFD holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class CfdHolding : SecurityHolding\n    {\n        /// <summary>\n        /// CFD Holding Class constructor\n        /// </summary>\n        /// <param name=\"security\">The CFD security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public CfdHolding(Cfd security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CompositeSecurityInitializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISecurityInitializer\"/> that executes\n    /// each initializer in order\n    /// </summary>\n    public class CompositeSecurityInitializer : ISecurityInitializer\n    {\n        private readonly List<ISecurityInitializer> _initializers;\n\n        /// <summary>\n        /// Gets the list of internal security initializers\n        /// </summary>\n        public List<ISecurityInitializer> Initializers => _initializers.ToList();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeSecurityInitializer\"/> class\n        /// </summary>\n        /// <param name=\"initializers\">The initializers to execute in order</param>\n        public CompositeSecurityInitializer(params PyObject[] initializers)\n        {\n            _initializers = initializers.Select(x => (ISecurityInitializer)new SecurityInitializerPythonWrapper(x)).ToList();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeSecurityInitializer\"/> class\n        /// </summary>\n        /// <param name=\"initializers\">The initializers to execute in order</param>\n        public CompositeSecurityInitializer(params ISecurityInitializer[] initializers)\n        {\n            _initializers = initializers.ToList();\n        }\n\n        /// <summary>\n        /// Execute each of the internally held initializers in sequence\n        /// </summary>\n        /// <param name=\"security\">The security to be initialized</param>\n        public void Initialize(Security security)\n        {\n            foreach (var initializer in _initializers)\n            {\n                initializer.Initialize(security);\n            }\n        }\n\n        /// <summary>\n        /// Adds a new security initializer to this composite initializer\n        /// </summary>\n        /// <param name=\"initializer\">The initializer to add</param>\n        public void AddSecurityInitializer(ISecurityInitializer initializer)\n        {\n            _initializers.Add(initializer);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ConstantBuyingPowerModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IBuyingPowerModel\"/> that uses an absurdly low margin\n    /// requirement to ensure all orders have sufficient margin provided the portfolio is not underwater.\n    /// </summary>\n    public class ConstantBuyingPowerModel : BuyingPowerModel\n    {\n        private readonly decimal _marginRequiredPerUnitInAccountCurrency;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantBuyingPowerModel\"/> class\n        /// </summary>\n        /// <param name=\"marginRequiredPerUnitInAccountCurrency\">The constant amount of margin required per single unit\n        /// of an asset. Each unit is defined as a quantity of 1 and NOT based on the lot size.</param>\n        public ConstantBuyingPowerModel(decimal marginRequiredPerUnitInAccountCurrency)\n        {\n            _marginRequiredPerUnitInAccountCurrency = marginRequiredPerUnitInAccountCurrency;\n        }\n\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\"></param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public override void SetLeverage(Security security, decimal leverage)\n        {\n            // ignored -- reasoning is user has an algorithm that has margin issues and so they quickly swap\n            // this impl in, but their code calls set leverage, they would need to comment that out and such\n            // said another way -- user made the decision to ignore margin/leverage by selecting this model\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity of shares</param>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            return parameters.Quantity * _marginRequiredPerUnitInAccountCurrency;\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return parameters.AbsoluteQuantity * _marginRequiredPerUnitInAccountCurrency;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ContractSecurityFilterUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Base class for contract symbols filtering universes.\n    /// Used by OptionFilterUniverse and FutureFilterUniverse\n    /// </summary>\n    public abstract class ContractSecurityFilterUniverse<T, TData> : IDerivativeSecurityFilterUniverse<TData>\n        where T : ContractSecurityFilterUniverse<T, TData>\n        where TData : IChainUniverseData\n    {\n        private bool _alreadyAppliedTypeFilters;\n\n        private IEnumerable<TData> _data;\n\n        /// <summary>\n        /// Defines listed contract types with Flags attribute\n        /// </summary>\n        [Flags]\n        protected enum ContractExpirationType : int\n        {\n            /// <summary>\n            /// Standard contracts\n            /// </summary>\n            Standard = 1,\n\n            /// <summary>\n            /// Non standard weekly contracts\n            /// </summary>\n            Weekly = 2\n        }\n\n        /// <summary>\n        /// The default expiration type filter value\n        /// </summary>\n        protected static readonly ContractExpirationType DefaultExpirationType = ContractExpirationType.Standard | ContractExpirationType.Weekly;\n\n        /// <summary>\n        /// Expiration Types allowed through the filter\n        /// Standards only by default\n        /// </summary>\n        protected ContractExpirationType Type { get; set; } = DefaultExpirationType;\n\n        /// <summary>\n        /// The local exchange current time\n        /// </summary>\n        public DateTime LocalTime { get; private set; }\n\n        /// <summary>\n        /// All data in this filter\n        /// Marked internal for use by extensions\n        /// </summary>\n        /// <remarks>\n        /// Setting it will also set AllSymbols\n        /// </remarks>\n        internal IEnumerable<TData> Data\n        {\n            get\n            {\n                return _data;\n            }\n            set\n            {\n                _data = value;\n            }\n        }\n\n        /// <summary>\n        /// All Symbols in this filter\n        /// Marked internal for use by extensions\n        /// </summary>\n        /// <remarks>\n        /// Setting it will remove any data that doesn't have a symbol in AllSymbols\n        /// </remarks>\n        internal IEnumerable<Symbol> AllSymbols\n        {\n            get\n            {\n                return _data.Select(x => x.Symbol);\n            }\n            set\n            {\n                // We create a \"fake\" data instance for each symbol that is not in the data,\n                // so we are polite to the user and keep backwards compatibility\n                _data = value.Select(symbol => _data.FirstOrDefault(x => x.Symbol == symbol) ?? CreateDataInstance(symbol)).ToList();\n            }\n        }\n\n        /// <summary>\n        /// Constructs ContractSecurityFilterUniverse\n        /// </summary>\n        protected ContractSecurityFilterUniverse()\n        {\n            Type = DefaultExpirationType;\n        }\n\n        /// <summary>\n        /// Constructs ContractSecurityFilterUniverse\n        /// </summary>\n        protected ContractSecurityFilterUniverse(IEnumerable<TData> allData, DateTime localTime)\n        {\n            Data = allData;\n            LocalTime = localTime;\n            Type = DefaultExpirationType;\n        }\n\n        /// <summary>\n        /// Function to determine if the given symbol is a standard contract\n        /// </summary>\n        /// <returns>True if standard type</returns>\n        protected abstract bool IsStandard(Symbol symbol);\n\n        /// <summary>\n        /// Creates a new instance of the data type for the given symbol\n        /// </summary>\n        /// <returns>A data instance for the given symbol</returns>\n        protected abstract TData CreateDataInstance(Symbol symbol);\n\n        /// <summary>\n        /// Returns universe, filtered by contract type\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        internal T ApplyTypesFilter()\n        {\n            if (_alreadyAppliedTypeFilters)\n            {\n                return (T)this;\n            }\n\n            // memoization map for ApplyTypesFilter()\n            var memoizedMap = new Dictionary<DateTime, bool>();\n\n            Func<TData, bool> memoizedIsStandardType = data =>\n            {\n                var dt = data.ID.Date;\n\n                bool result;\n                if (memoizedMap.TryGetValue(dt, out result))\n                    return result;\n                var res = IsStandard(data.Symbol);\n                memoizedMap[dt] = res;\n\n                return res;\n            };\n\n            Data = Data.Where(x =>\n            {\n                switch (Type)\n                {\n                    case ContractExpirationType.Weekly:\n                        return !memoizedIsStandardType(x);\n                    case ContractExpirationType.Standard:\n                        return memoizedIsStandardType(x);\n                    case ContractExpirationType.Standard | ContractExpirationType.Weekly:\n                        return true;\n                    default:\n                        return false;\n                }\n            }).ToList();\n\n            _alreadyAppliedTypeFilters = true;\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Refreshes this filter universe\n        /// </summary>\n        /// <param name=\"allData\">All data for contracts in the Universe</param>\n        /// <param name=\"localTime\">The local exchange current time</param>\n        public virtual void Refresh(IEnumerable<TData> allData, DateTime localTime)\n        {\n            Data = allData;\n            LocalTime = localTime;\n            Type = DefaultExpirationType;\n            _alreadyAppliedTypeFilters = false;\n        }\n\n        /// <summary>\n        /// Sets universe of standard contracts (if any) as selection\n        /// Contracts by default are standards; only needed to switch back if changed\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public T StandardsOnly()\n        {\n            if (_alreadyAppliedTypeFilters)\n            {\n                throw new InvalidOperationException(\"Type filters have already been applied, \" +\n                    \"please call StandardsOnly() before applying other filters such as FrontMonth() or BackMonths()\");\n            }\n\n            Type = ContractExpirationType.Standard;\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Includes universe of non-standard weeklys contracts (if any) into selection\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        [Obsolete(\"IncludeWeeklys is obsolete because weekly contracts are now included by default.\")]\n        public T IncludeWeeklys()\n        {\n            if (_alreadyAppliedTypeFilters)\n            {\n                throw new InvalidOperationException(\"Type filters have already been applied, \" +\n                    \"please call IncludeWeeklys() before applying other filters such as FrontMonth() or BackMonths()\");\n            }\n\n            Type |= ContractExpirationType.Weekly;\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Sets universe of weeklys contracts (if any) as selection\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public T WeeklysOnly()\n        {\n            Type = ContractExpirationType.Weekly;\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Returns front month contract\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public virtual T FrontMonth()\n        {\n            ApplyTypesFilter();\n            var ordered = Data.OrderBy(x => x.ID.Date).ToList();\n            if (ordered.Count == 0) return (T)this;\n            var frontMonth = ordered.TakeWhile(x => ordered[0].ID.Date == x.ID.Date);\n\n            Data = frontMonth.ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Returns a list of back month contracts\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public virtual T BackMonths()\n        {\n            ApplyTypesFilter();\n            var ordered = Data.OrderBy(x => x.ID.Date).ToList();\n            if (ordered.Count == 0) return (T)this;\n            var backMonths = ordered.SkipWhile(x => ordered[0].ID.Date == x.ID.Date);\n\n            Data = backMonths.ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Returns first of back month contracts\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public T BackMonth()\n        {\n            return BackMonths().FrontMonth();\n        }\n\n        /// <summary>\n        /// Adjust the reference date used for expiration filtering. By default it just returns the same date.\n        /// </summary>\n        /// <param name=\"referenceDate\">The reference date to be adjusted</param>\n        /// <returns>The adjusted date</returns>\n        protected virtual DateTime AdjustExpirationReferenceDate(DateTime referenceDate)\n        {\n            return referenceDate;\n        }\n\n        /// <summary>\n        /// Applies filter selecting options contracts based on a range of expiration dates relative to the current day\n        /// </summary>\n        /// <param name=\"minExpiry\">The minimum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiry\">The maximum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in more than 10 days</param>\n        /// <returns>Universe with filter applied</returns>\n        public virtual T Expiration(TimeSpan minExpiry, TimeSpan maxExpiry)\n        {\n            if (LocalTime == default)\n            {\n                return (T)this;\n            }\n\n            if (maxExpiry > Time.MaxTimeSpan) maxExpiry = Time.MaxTimeSpan;\n\n            var referenceDate = AdjustExpirationReferenceDate(LocalTime.Date);\n\n            var minExpiryToDate = referenceDate + minExpiry;\n            var maxExpiryToDate = referenceDate + maxExpiry;\n\n            Data = Data\n                .Where(symbol => symbol.ID.Date.Date >= minExpiryToDate && symbol.ID.Date.Date <= maxExpiryToDate)\n                .ToList();\n\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Applies filter selecting contracts based on a range of expiration dates relative to the current day\n        /// </summary>\n        /// <param name=\"minExpiryDays\">The minimum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiryDays\">The maximum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in more than 10 days</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Expiration(int minExpiryDays, int maxExpiryDays)\n        {\n            return Expiration(TimeSpan.FromDays(minExpiryDays), TimeSpan.FromDays(maxExpiryDays));\n        }\n\n        /// <summary>\n        /// Explicitly sets the selected contract symbols for this universe.\n        /// This overrides and and all other methods of selecting symbols assuming it is called last.\n        /// </summary>\n        /// <param name=\"contracts\">The option contract symbol objects to select</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Contracts(PyObject contracts)\n        {\n            // Let's first check if the object is a selector:\n            if (contracts.TrySafeAs(out Func<IEnumerable<TData>, IEnumerable<Symbol>> contractSelector))\n            {\n                return Contracts(contractSelector);\n            }\n\n            // Else, it should be a list of symbols:\n            return Contracts(contracts.ConvertToSymbolEnumerable());\n        }\n\n        /// <summary>\n        /// Explicitly sets the selected contract symbols for this universe.\n        /// This overrides and and all other methods of selecting symbols assuming it is called last.\n        /// </summary>\n        /// <param name=\"contracts\">The option contract symbol objects to select</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Contracts(IEnumerable<Symbol> contracts)\n        {\n            AllSymbols = contracts.ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Explicitly sets the selected contract symbols for this universe.\n        /// This overrides and and all other methods of selecting symbols assuming it is called last.\n        /// </summary>\n        /// <param name=\"contracts\">The option contract symbol objects to select</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Contracts(IEnumerable<TData> contracts)\n        {\n            Data = contracts.ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Sets a function used to filter the set of available contract filters. The input to the 'contractSelector'\n        /// function will be the already filtered list if any other filters have already been applied.\n        /// </summary>\n        /// <param name=\"contractSelector\">The option contract symbol objects to select</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Contracts(Func<IEnumerable<TData>, IEnumerable<Symbol>> contractSelector)\n        {\n            // force materialization using ToList\n            AllSymbols = contractSelector(Data).ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Sets a function used to filter the set of available contract filters. The input to the 'contractSelector'\n        /// function will be the already filtered list if any other filters have already been applied.\n        /// </summary>\n        /// <param name=\"contractSelector\">The option contract symbol objects to select</param>\n        /// <returns>Universe with filter applied</returns>\n        public T Contracts(Func<IEnumerable<TData>, IEnumerable<TData>> contractSelector)\n        {\n            // force materialization using ToList\n            Data = contractSelector(Data).ToList();\n            return (T)this;\n        }\n\n        /// <summary>\n        /// Instructs the engine to only filter contracts on the first time step of each market day.\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        /// <remarks>Deprecated since filters are always non-dynamic now</remarks>\n        [Obsolete(\"Deprecated as of 2023-12-13. Filters are always non-dynamic as of now, which means they will only bee applied daily.\")]\n        public T OnlyApplyFilterAtMarketOpen()\n        {\n            return (T)this;\n        }\n\n        /// <summary>\n        /// IEnumerable interface method implementation\n        /// </summary>\n        /// <returns>IEnumerator of Symbols in Universe</returns>\n        public IEnumerator<TData> GetEnumerator()\n        {\n            return Data.GetEnumerator();\n        }\n\n        /// <summary>\n        /// IEnumerable interface method implementation\n        /// </summary>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return Data.GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ConvertibleCashAmount.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// A cash amount that can easily be converted into account currency\n    /// </summary>\n    public class ConvertibleCashAmount\n    {\n        /// <summary>\n        /// The amount\n        /// </summary>\n        public decimal Amount { get; }\n\n        /// <summary>\n        /// The cash associated with the amount\n        /// </summary>\n        public Cash Cash { get; }\n\n        /// <summary>\n        /// The amount in account currency\n        /// </summary>\n        public decimal InAccountCurrency => Amount * Cash.ConversionRate;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public ConvertibleCashAmount (decimal amount, Cash cash)\n        {\n            Amount = amount;\n            Cash = cash;\n        }\n\n        /// <summary>\n        /// The amount in account currency\n        /// </summary>\n        public static implicit operator decimal(ConvertibleCashAmount convertibleCashAmount)\n        {\n            return convertibleCashAmount.InAccountCurrency;\n        }\n\n        /// <summary>\n        /// The amount in account currency\n        /// </summary>\n        public static implicit operator CashAmount(ConvertibleCashAmount convertibleCashAmount)\n        {\n            return new CashAmount(convertibleCashAmount.Amount, convertibleCashAmount.Cash.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Crypto/Crypto.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Forex;\nusing System;\n\nnamespace QuantConnect.Securities.Crypto\n{\n    /// <summary>\n    /// Crypto Security Object Implementation for Crypto Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Crypto : Security, IBaseCurrencySymbol\n    {\n        /// <summary>\n        /// Gets the currency acquired by going long this currency pair\n        /// </summary>\n        /// <remarks>\n        /// For example, the EUR/USD has a base currency of the euro, and as a result\n        /// of going long the EUR/USD a trader is acquiring euros in exchange for US dollars\n        /// </remarks>\n        public Cash BaseCurrency { get; protected set; }\n\n        /// <summary>\n        /// Constructor for the Crypto security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"baseCurrency\">The cash object that represent the base currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        public Crypto(SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            Cash baseCurrency,\n            SubscriptionDataConfig config,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes)\n            : base(config,\n                quoteCurrency,\n                symbolProperties,\n                new CryptoExchange(exchangeHours),\n                new ForexCache(),\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new GDAXFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new CashBuyingPowerModel(),\n                new ForexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BaseCurrency = baseCurrency;\n            Holdings = new CryptoHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Constructor for the Crypto security\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"baseCurrency\">The cash object that represent the base currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache to store <see cref=\"Security\"/> data</param>\n        public Crypto(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            Cash baseCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new CryptoExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new GDAXFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new CashBuyingPowerModel(),\n                new ForexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BaseCurrency = baseCurrency;\n            Holdings = new CryptoHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Get the current value of the security.\n        /// </summary>\n        public override decimal Price => Cache.GetData<TradeBar>()?.Close ?? Cache.Price;\n\n        /// <summary>\n        /// Decomposes the specified currency pair into a base and quote currency provided as out parameters\n        /// </summary>\n        /// <param name=\"symbol\">The input symbol to be decomposed</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"baseCurrency\">The output base currency</param>\n        /// <param name=\"quoteCurrency\">The output quote currency</param>\n        public static void DecomposeCurrencyPair(Symbol symbol, SymbolProperties symbolProperties, out string baseCurrency, out string quoteCurrency)\n        {\n            quoteCurrency = symbolProperties.QuoteCurrency;\n            if (symbol.Value.EndsWith(quoteCurrency))\n            {\n                baseCurrency = symbol.Value.RemoveFromEnd(quoteCurrency);\n            }\n            else\n            {\n                throw new InvalidOperationException($\"symbol doesn't end with {quoteCurrency}\");\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Crypto security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Crypto/CryptoExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Crypto\n{\n    /// <summary>\n    /// Crypto exchange class - information and helper tools for Crypto exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class CryptoExchange : SecurityExchange\n    {\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CryptoExchange\"/> class using market hours\n        /// derived from the market-hours-database for the Crypto market\n        /// </summary>\n        public CryptoExchange(string market)\n            : base(MarketHoursDatabase.FromDataFolder().GetExchangeHours(market, null, SecurityType.Crypto))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CryptoExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public CryptoExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Crypto/CryptoHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Crypto\n{\n    /// <summary>\n    /// Crypto holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class CryptoHolding : SecurityHolding\n    {\n        /// <summary>\n        /// Crypto Holding Class\n        /// </summary>\n        /// <param name=\"security\">The Crypto security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public CryptoHolding(Crypto security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/CryptoFuture/BinanceFutureMarginInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// The responsability of this model is to apply future funding rate cash flows to the portfolio based on open positions\n    /// </summary>\n    public class BinanceFutureMarginInterestRateModel : IMarginInterestRateModel\n    {\n        private DateTime _nextFundingRateApplication = DateTime.MaxValue;\n\n        /// <summary>\n        /// Apply margin interest rates to the portfolio\n        /// </summary>\n        /// <param name=\"marginInterestRateParameters\">The parameters to use</param>\n        public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n        {\n            var security = marginInterestRateParameters.Security;\n            var time = marginInterestRateParameters.Time;\n            var cryptoFuture = (CryptoFuture)security;\n            if (!cryptoFuture.Invested)\n            {\n                // nothing to do\n                _nextFundingRateApplication = DateTime.MaxValue;\n                return;\n            }\n            else if (_nextFundingRateApplication == DateTime.MaxValue)\n            {\n                // we opened a new position\n                _nextFundingRateApplication = GetNextFundingRateApplication(time);\n            }\n\n            var marginInterest = cryptoFuture.Cache.GetData<MarginInterestRate>();\n            if(marginInterest == null)\n            {\n                return;\n            }\n\n            while(time >= _nextFundingRateApplication)\n            {\n                // When the funding rate is positive, the price of the perpetual contract is higher than the mark price,\n                // thus, traders who are long pay for short positions. Conversely, a negative funding rate indicates that perpetual\n                // prices are below the mark price, which means that short positions pay for longs.\n                // Funding Amount = Nominal Value of Positions * Funding Rate\n\n                var holdings = cryptoFuture.Holdings;\n\n                var positionValue = cryptoFuture.Holdings.GetQuantityValue(holdings.Quantity);\n\n                var funding = marginInterest.InterestRate * positionValue.Amount;\n\n                funding *= -1;\n                // '* -1' because:\n                // - we pay when 'funding' positive:\n                //      long position & positive rate\n                //      short position & negative rate\n                // - we ear when 'funding' negative:\n                //      long position & negative rate\n                //      short position & positive rate\n                positionValue.Cash.AddAmount(funding);\n\n                _nextFundingRateApplication = GetNextFundingRateApplication(_nextFundingRateApplication);\n            }\n        }\n\n        private static DateTime GetNextFundingRateApplication(DateTime currentTime)\n        {\n            if(currentTime.Hour >= 16)\n            {\n                // tomorrow 00:00\n                return currentTime.Date.AddDays(1);\n            }\n            else if (currentTime.Hour >= 8)\n            {\n                return currentTime.Date.AddHours(16);\n            }\n            else\n            {\n                return currentTime.Date.AddHours(8);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/BybitFutureMarginInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// The responsibility of this model is to apply future funding rate cash flows to the portfolio based on open positions\n    /// </summary>\n    public class BybitFutureMarginInterestRateModel : BinanceFutureMarginInterestRateModel\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/CryptoFuture.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// Crypto Future Security Object Implementation for Crypto Future Assets\n    /// </summary>\n    public class CryptoFuture : Security, IBaseCurrencySymbol\n    {\n        /// <summary>\n        /// Gets the currency acquired by going long this currency pair\n        /// </summary>\n        /// <remarks>\n        /// For example, the EUR/USD has a base currency of the euro, and as a result\n        /// of going long the EUR/USD a trader is acquiring euros in exchange for US dollars\n        /// </remarks>\n        public Cash BaseCurrency { get; protected set; }\n\n        /// <summary>\n        /// Constructor for the Crypto Future security\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"baseCurrency\">The cash object that represent the base currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"cache\">The security cache</param>\n        public CryptoFuture(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            Cash baseCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache cache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new CryptoFutureExchange(exchangeHours),\n                cache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                IsCryptoCoinFuture(quoteCurrency.Symbol) ? new BinanceCoinFuturesFeeModel() : new BinanceFuturesFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new CryptoFutureMarginModel(),\n                new SecurityDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                // only applies for perpetual futures\n                symbol.ID.Date == SecurityIdentifier.DefaultDate ? new BinanceFutureMarginInterestRateModel() : Securities.MarginInterestRateModel.Null\n                )\n        {\n            BaseCurrency = baseCurrency;\n            Holdings = new CryptoFutureHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Checks whether the security is a crypto coin future\n        /// </summary>\n        /// <returns>True if the security is a crypto coin future</returns>\n        public bool IsCryptoCoinFuture()\n        {\n            return IsCryptoCoinFuture(QuoteCurrency.Symbol);\n        }\n\n        /// <summary>\n        /// Checks whether the security is a crypto coin future\n        /// </summary>\n        /// <param name=\"quoteCurrency\">The security quote currency</param>\n        /// <returns>True if the security is a crypto coin future</returns>\n        private static bool IsCryptoCoinFuture(string quoteCurrency)\n        {\n            return quoteCurrency != \"USDT\" && quoteCurrency != \"BUSD\" && quoteCurrency != \"USDC\";\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(CryptoFuture security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/CryptoFutureExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// Crypto future exchange class - information and helper tools for Crypto future exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class CryptoFutureExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CryptoFutureExchange\"/> class using market hours\n        /// derived from the market-hours-database for the Crypto future market\n        /// </summary>\n        public CryptoFutureExchange(string market)\n            : base(MarketHoursDatabase.FromDataFolder().GetExchangeHours(market, null, SecurityType.CryptoFuture))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CryptoFutureExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public CryptoFutureExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/CryptoFutureHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// Crypto Future holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class CryptoFutureHolding : SecurityHolding\n    {\n        /// <summary>\n        /// Crypto Future Holding Class constructor\n        /// </summary>\n        /// <param name=\"security\">The crypto future security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public CryptoFutureHolding(Security security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n\n        /// <summary>\n        /// Gets the total value of the specified <paramref name=\"quantity\"/> of shares of this security\n        /// in the account currency\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of shares</param>\n        /// <param name=\"price\">The current price</param>\n        /// <returns>The value of the quantity of shares in the account currency</returns>\n        public override ConvertibleCashAmount GetQuantityValue(decimal quantity, decimal price)\n        {\n            if (Symbol.ID.Market == Market.DYDX)\n            {\n                // common math quantity * quote price\n                return base.GetQuantityValue(quantity, price);\n            }\n            var cryptoFuture = (CryptoFuture)Security;\n\n            Cash cash;\n            decimal notionalPositionValue;\n            // We could check quote currency or the contract multiplier being 1\n            if (!cryptoFuture.IsCryptoCoinFuture())\n            {\n                // https://www.binance.com/en/support/faq/how-to-calculate-cost-required-to-open-a-position-in-perpetual-futures-contracts-87fa7ee33b574f7084d42bd2ce2e463b\n                // example BTCUSDT: (9,253.30 * 1 BTC) = 9,253.3 USDT\n                notionalPositionValue = price * quantity * cryptoFuture.SymbolProperties.ContractMultiplier;\n\n                // USDT is the QUOTE currency we will need to convert it into account currency\n                cash = cryptoFuture.QuoteCurrency;\n            }\n            else\n            {\n                // https://www.binance.com/en/support/faq/leverage-and-margin-in-coin-margined-futures-contracts-be2c7d9d95b04a7e8044ed02dd7dfe5c\n                // example BTCUSD: [ (10*100 USD) / 9,800 USD ] = 0.10204 BTC\n                notionalPositionValue = quantity * cryptoFuture.SymbolProperties.ContractMultiplier / price;\n\n                // BTC is the BASE currency we will need to convert it into account currency\n                cash = cryptoFuture.BaseCurrency;\n            }\n\n            return new ConvertibleCashAmount(notionalPositionValue, cash);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/CryptoFutureMarginModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// The crypto future margin model which supports both Coin and USDT futures\n    /// </summary>\n    public class CryptoFutureMarginModel : SecurityMarginModel\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"leverage\">The leverage to use, used on initial margin requirements, default 25x</param>\n        /// <param name=\"maintenanceMarginRate\">The maintenance margin rate, default 5%</param>\n        /// <param name=\"maintenanceAmount\">The maintenance amount which will reduce maintenance margin requirements, default 0</param>\n        [Obsolete(\"This constructor is deprecated, please use the overload without maintenanceMarginRate and maintenanceAmount parameters.\")]\n        public CryptoFutureMarginModel(decimal leverage, decimal maintenanceMarginRate = 0.05m, decimal maintenanceAmount = 0)\n             : base(leverage, 0)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"leverage\">The leverage to use, used on initial margin requirements, default 25x</param>\n        public CryptoFutureMarginModel(decimal leverage = 25)\n             : base(leverage, 0)\n        {\n        }\n\n        /// <summary>\n        /// Gets the margin currently alloted to the specified holding.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the option</returns>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return new MaintenanceMargin(GetInitialMarginRequirement(new InitialMarginParameters(parameters.Security, parameters.Quantity)));\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity of shares</param>\n        /// <returns>The initial margin required for the option (i.e. the equity required to enter a position for this option)</returns>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var security = parameters.Security;\n            var quantity = parameters.Quantity;\n            if (security?.GetLastData() == null || quantity == 0m)\n            {\n                return InitialMargin.Zero;\n            }\n\n            var positionValue = security.Holdings.GetQuantityValue(quantity, security.Price);\n            var marginRequirementInCollateral = Math.Abs(positionValue.Amount) / GetLeverage(security);\n\n            return new InitialMargin(marginRequirementInCollateral * positionValue.Cash.ConversionRate);\n        }\n\n        /// <summary>\n        /// Gets the margin cash available for a trade\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security to be traded</param>\n        /// <param name=\"direction\">The direction of the trade</param>\n        /// <returns>The margin available for the trade</returns>\n        /// <remarks>What we do specially here is that instead of using the total portfolio value as potential margin remaining we only consider the collateral currency</remarks>\n        protected override decimal GetMarginRemaining(SecurityPortfolioManager portfolio, Security security, OrderDirection direction)\n        {\n            var collateralCurrency = GetCollateralCash(security);\n            var totalCollateralCurrency = collateralCurrency.Amount;\n            var result = totalCollateralCurrency;\n\n            foreach (var kvp in portfolio.Where(holdings => holdings.Value.Invested && holdings.Value.Type == SecurityType.CryptoFuture && holdings.Value.Symbol != security.Symbol))\n            {\n                var otherCryptoFuture = portfolio.Securities[kvp.Key];\n                // check if we share the collateral\n                if (collateralCurrency == GetCollateralCash(otherCryptoFuture))\n                {\n                    // we reduce the available collateral based on total usage of all other positions too\n                    result -= otherCryptoFuture.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForCurrentHoldings(otherCryptoFuture));\n                }\n            }\n\n            if (direction != OrderDirection.Hold)\n            {\n                var holdings = security.Holdings;\n                //If the order is in the same direction as holdings, our remaining cash is our cash\n                //In the opposite direction, our remaining cash is 2 x current value of assets + our cash\n                if (holdings.IsLong)\n                {\n                    switch (direction)\n                    {\n                        case OrderDirection.Sell:\n                            result +=\n                                // portion of margin to close the existing position\n                                this.GetMaintenanceMargin(security) +\n                                // portion of margin to open the new position\n                                this.GetInitialMarginRequirement(security, security.Holdings.AbsoluteQuantity);\n                            break;\n                    }\n                }\n                else if (holdings.IsShort)\n                {\n                    switch (direction)\n                    {\n                        case OrderDirection.Buy:\n                            result +=\n                                // portion of margin to close the existing position\n                                this.GetMaintenanceMargin(security) +\n                                // portion of margin to open the new position\n                                this.GetInitialMarginRequirement(security, security.Holdings.AbsoluteQuantity);\n                            break;\n                    }\n                }\n            }\n\n            result -= totalCollateralCurrency * RequiredFreeBuyingPowerPercent;\n            // convert into account currency\n            result *= collateralCurrency.ConversionRate;\n            return result < 0 ? 0 : result;\n        }\n\n        /// <summary>\n        /// Helper method to determine what's the collateral currency for the given crypto future\n        /// </summary>\n        private static Cash GetCollateralCash(Security security)\n        {\n            var cryptoFuture = (CryptoFuture)security;\n\n            var collateralCurrency = cryptoFuture.BaseCurrency;\n            if (!cryptoFuture.IsCryptoCoinFuture())\n            {\n                collateralCurrency = cryptoFuture.QuoteCurrency;\n            }\n\n            return collateralCurrency;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CryptoFuture/dYdXFutureMarginInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities.CryptoFuture\n{\n    /// <summary>\n    /// The responsibility of this model is to apply future funding rate cash flows to the portfolio based on open positions\n    /// </summary>\n    public class dYdXFutureMarginInterestRateModel : BinanceFutureMarginInterestRateModel\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CurrencyConversion/ConstantCurrencyConversion.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.CurrencyConversion\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ICurrencyConversion\"/> with a fixed conversion rate\n    /// </summary>\n    public class ConstantCurrencyConversion : ICurrencyConversion\n    {\n        private decimal _conversionRate;\n\n        /// <summary>\n        /// Event fired when the conversion rate is updated\n        /// </summary>\n        public event EventHandler<decimal> ConversionRateUpdated;\n\n        /// <summary>\n        /// The currency this conversion converts from\n        /// </summary>\n        public string SourceCurrency { get; }\n\n        /// <summary>\n        /// The currency this conversion converts to\n        /// </summary>\n        public string DestinationCurrency { get; }\n\n        /// <summary>\n        /// The current conversion rate\n        /// </summary>\n        public decimal ConversionRate\n        {\n            get\n            {\n                return _conversionRate;\n            }\n            set\n            {\n                if (_conversionRate != value)\n                {\n                    // only update if there was actually one\n                    _conversionRate = value;\n                    ConversionRateUpdated?.Invoke(this, value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// The securities which the conversion rate is based on\n        /// </summary>\n        public IEnumerable<Security> ConversionRateSecurities => Enumerable.Empty<Security>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantCurrencyConversion\"/> class.\n        /// </summary>\n        /// <param name=\"sourceCurrency\">The currency this conversion converts from</param>\n        /// <param name=\"destinationCurrency\">The currency this conversion converts to</param>\n        /// <param name=\"conversionRate\">The conversion rate between the currencies</param>\n        public ConstantCurrencyConversion(string sourceCurrency, string destinationCurrency, decimal conversionRate = 1m)\n        {\n            SourceCurrency = sourceCurrency;\n            DestinationCurrency = destinationCurrency;\n            ConversionRate = conversionRate;\n        }\n\n        /// <summary>\n        /// Marks the conversion rate as potentially outdated, needing an update based on the latest data\n        /// </summary>\n        /// <remarks>This conversion is not based on securities, so we don't really need an update</remarks>\n        public void Update()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new identity conversion, where the conversion rate is set to 1 and the source and destination currencies might the same\n        /// </summary>\n        /// <param name=\"sourceCurrency\">The currency this conversion converts from</param>\n        /// <param name=\"destinationCurrency\">The currency this conversion converts to. If null, the destination and source currencies are the same</param>\n        /// <returns>The identity currency conversion</returns>\n        public static ConstantCurrencyConversion Identity(string sourceCurrency, string destinationCurrency = null)\n        {\n            return new ConstantCurrencyConversion(sourceCurrency, destinationCurrency ?? sourceCurrency);\n        }\n\n        /// <summary>\n        /// Returns an instance of <see cref=\"ConstantCurrencyConversion\"/> that represents a null conversion\n        /// </summary>\n        public static ConstantCurrencyConversion Null(string sourceCurrency, string destinationCurrency)\n        {\n            return new ConstantCurrencyConversion(sourceCurrency, destinationCurrency, 0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CurrencyConversion/ICurrencyConversion.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.CurrencyConversion\n{\n    /// <summary>\n    /// Represents a type capable of calculating the conversion rate between two currencies\n    /// </summary>\n    public interface ICurrencyConversion\n    {\n        /// <summary>\n        /// Event fired when the conversion rate is updated\n        /// </summary>\n        event EventHandler<decimal> ConversionRateUpdated;\n\n        /// <summary>\n        /// The currency this conversion converts from\n        /// </summary>\n        string SourceCurrency { get; }\n\n        /// <summary>\n        /// The currency this conversion converts to\n        /// </summary>\n        string DestinationCurrency { get; }\n\n        /// <summary>\n        /// The current conversion rate between <see cref=\"SourceCurrency\"/> and <see cref=\"DestinationCurrency\"/>\n        /// </summary>\n        decimal ConversionRate { get; set; }\n\n        /// <summary>\n        /// The securities which the conversion rate is based on\n        /// </summary>\n        IEnumerable<Security> ConversionRateSecurities { get; }\n\n        /// <summary>\n        /// Updates the internal conversion rate based on the latest data, and returns the new conversion rate\n        /// </summary>\n        /// <returns>The new conversion rate</returns>\n        void Update();\n    }\n}\n"
  },
  {
    "path": "Common/Securities/CurrencyConversion/SecurityCurrencyConversion.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.CurrencyConversion\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ICurrencyConversion\"/> to find and use multi-leg currency conversions\n    /// </summary>\n    public class SecurityCurrencyConversion : ICurrencyConversion\n    {\n        /// <summary>\n        /// Class that holds the information of a single step in a multi-leg currency conversion\n        /// </summary>\n        private class Step\n        {\n            /// <summary>\n            /// The security used in this conversion step\n            /// </summary>\n            public Security RateSecurity { get; }\n\n            /// <summary>\n            /// Whether the price of the security must be inverted in the conversion\n            /// </summary>\n            public bool Inverted { get; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"Step\"/> class\n            /// </summary>\n            /// <param name=\"rateSecurity\">The security to use in this currency conversion step</param>\n            /// <param name=\"inverted\">Whether the price of the security should be inverted in the conversion</param>\n            public Step(Security rateSecurity, bool inverted)\n            {\n                RateSecurity = rateSecurity;\n                Inverted = inverted;\n            }\n        }\n\n        private readonly List<Step> _steps;\n\n        private decimal _conversionRate;\n        private bool _conversionRateNeedsUpdate;\n\n        /// <summary>\n        /// Event fired when the conversion rate is updated\n        /// </summary>\n        public event EventHandler<decimal> ConversionRateUpdated;\n\n        /// <summary>\n        /// The currency this conversion converts from\n        /// </summary>\n        public string SourceCurrency { get; }\n\n        /// <summary>\n        /// The currency this conversion converts to\n        /// </summary>\n        public string DestinationCurrency { get; }\n\n        /// <summary>\n        /// The current conversion rate\n        /// </summary>\n        public decimal ConversionRate\n        {\n            get\n            {\n                if (_conversionRateNeedsUpdate)\n                {\n                    var newConversionRate = 1m;\n                    var stepWithoutDataFound = false;\n\n                    _steps.ForEach(step =>\n                    {\n                        if (stepWithoutDataFound)\n                        {\n                            return;\n                        }\n\n                        var lastData = step.RateSecurity.GetLastData();\n                        if (lastData == null || lastData.Price == 0m)\n                        {\n                            newConversionRate = 0m;\n                            stepWithoutDataFound = true;\n                            return;\n                        }\n\n                        if (step.Inverted)\n                        {\n                            newConversionRate /= lastData.Price;\n                        }\n                        else\n                        {\n                            newConversionRate *= lastData.Price;\n                        }\n                    });\n\n                    _conversionRateNeedsUpdate = false;\n                    _conversionRate = newConversionRate;\n                    ConversionRateUpdated?.Invoke(this, _conversionRate);\n                }\n\n                return _conversionRate;\n            }\n            set\n            {\n                if (_conversionRate != value)\n                {\n                    // only update if there was actually one\n                    _conversionRate = value;\n                    _conversionRateNeedsUpdate = false;\n                    ConversionRateUpdated?.Invoke(this, _conversionRate);\n\n                }\n            }\n        }\n\n        /// <summary>\n        /// The securities which the conversion rate is based on\n        /// </summary>\n        public IEnumerable<Security> ConversionRateSecurities => _steps.Select(step => step.RateSecurity);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityCurrencyConversion\"/> class.\n        /// This constructor is intentionally private as only <see cref=\"LinearSearch\"/> is supposed to create it.\n        /// </summary>\n        /// <param name=\"sourceCurrency\">The currency this conversion converts from</param>\n        /// <param name=\"destinationCurrency\">The currency this conversion converts to</param>\n        /// <param name=\"steps\">The steps between sourceCurrency and destinationCurrency</param>\n        private SecurityCurrencyConversion(string sourceCurrency, string destinationCurrency, List<Step> steps)\n        {\n            SourceCurrency = sourceCurrency;\n            DestinationCurrency = destinationCurrency;\n\n            _steps = steps;\n        }\n\n        /// <summary>\n        /// Signals an updates to the internal conversion rate based on the latest data.\n        /// It will set the conversion rate as potentially outdated so it gets re-calculated.\n        /// </summary>\n        public void Update()\n        {\n            _conversionRateNeedsUpdate = true;\n        }\n\n        /// <summary>\n        /// Finds a conversion between two currencies by looking through all available 1 and 2-leg options\n        /// </summary>\n        /// <param name=\"sourceCurrency\">The currency to convert from</param>\n        /// <param name=\"destinationCurrency\">The currency to convert to</param>\n        /// <param name=\"existingSecurities\">The securities which are already added to the algorithm</param>\n        /// <param name=\"potentialSymbols\">The symbols to consider, may overlap with existingSecurities</param>\n        /// <param name=\"makeNewSecurity\">The function to call when a symbol becomes part of the conversion, must return the security that will provide price data about the symbol</param>\n        /// <returns>A new <see cref=\"SecurityCurrencyConversion\"/> instance representing the conversion from sourceCurrency to destinationCurrency</returns>\n        /// <exception cref=\"ArgumentException\">Thrown when no conversion from sourceCurrency to destinationCurrency can be found</exception>\n        public static SecurityCurrencyConversion LinearSearch(\n            string sourceCurrency,\n            string destinationCurrency,\n            IList<Security> existingSecurities,\n            IEnumerable<Symbol> potentialSymbols,\n            Func<Symbol, Security> makeNewSecurity)\n        {\n            var allSymbols = existingSecurities.Select(sec => sec.Symbol).Concat(potentialSymbols)\n                .Where(CurrencyPairUtil.IsDecomposable)\n                .ToList();\n\n            var securitiesBySymbol = existingSecurities.Aggregate(new Dictionary<Symbol, Security>(),\n                (mapping, security) =>\n                {\n                    if (!mapping.ContainsKey(security.Symbol))\n                    {\n                        mapping[security.Symbol] = security;\n                    }\n\n                    return mapping;\n                });\n\n            // Search for 1 leg conversions\n            foreach (var potentialConversionRateSymbol in allSymbols)\n            {\n                var leg1Match = potentialConversionRateSymbol.ComparePair(sourceCurrency, destinationCurrency);\n                if (leg1Match == CurrencyPairUtil.Match.NoMatch)\n                {\n                    continue;\n                }\n                var inverted = leg1Match == CurrencyPairUtil.Match.InverseMatch;\n\n                return new SecurityCurrencyConversion(sourceCurrency, destinationCurrency, new List<Step>(1)\n                {\n                    CreateStep(potentialConversionRateSymbol, inverted, securitiesBySymbol, makeNewSecurity)\n                });\n            }\n\n            // Search for 2 leg conversions\n            foreach (var potentialConversionRateSymbol1 in allSymbols)\n            {\n                var middleCurrency = potentialConversionRateSymbol1.CurrencyPairDual(sourceCurrency);\n                if (middleCurrency == null)\n                {\n                    continue;\n                }\n\n                foreach (var potentialConversionRateSymbol2 in allSymbols)\n                {\n                    var leg2Match = potentialConversionRateSymbol2.ComparePair(middleCurrency, destinationCurrency);\n                    if (leg2Match == CurrencyPairUtil.Match.NoMatch)\n                    {\n                        continue;\n                    }\n                    var secondStepInverted = leg2Match == CurrencyPairUtil.Match.InverseMatch;\n\n                    var steps = new List<Step>(2);\n\n                    // Step 1\n                    string baseCurrency;\n                    string quoteCurrency;\n\n                    CurrencyPairUtil.DecomposeCurrencyPair(\n                        potentialConversionRateSymbol1,\n                        out baseCurrency,\n                        out quoteCurrency);\n\n                    steps.Add(CreateStep(potentialConversionRateSymbol1,\n                        sourceCurrency == quoteCurrency,\n                        securitiesBySymbol,\n                        makeNewSecurity));\n\n                    // Step 2\n                    steps.Add(CreateStep(potentialConversionRateSymbol2,\n                        secondStepInverted,\n                        securitiesBySymbol,\n                        makeNewSecurity));\n\n                    return new SecurityCurrencyConversion(sourceCurrency, destinationCurrency, steps);\n                }\n            }\n\n            throw new ArgumentException(\n                $\"No conversion path found between source currency {sourceCurrency} and destination currency {destinationCurrency}\");\n        }\n\n        /// <summary>\n        /// Creates a new step\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the step</param>\n        /// <param name=\"inverted\">Whether the step is inverted or not</param>\n        /// <param name=\"existingSecurities\">The existing securities, which are preferred over creating new ones</param>\n        /// <param name=\"makeNewSecurity\">The function to call when a new security must be created</param>\n        private static Step CreateStep(\n            Symbol symbol,\n            bool inverted,\n            IDictionary<Symbol, Security> existingSecurities,\n            Func<Symbol, Security> makeNewSecurity)\n        {\n            Security security;\n            if (existingSecurities.TryGetValue(symbol, out security))\n            {\n                return new Step(security, inverted);\n            }\n\n            return new Step(makeNewSecurity(symbol), inverted);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/DefaultMarginCallModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for picking which orders should be executed during a margin call\n    /// </summary>\n    /// <remarks>\n    /// This is a default implementation that orders the generated margin call orders by the unrealized\n    /// profit (losers first) and executes each order synchronously until we're within the margin requirements\n    /// </remarks>\n    public class DefaultMarginCallModel : IMarginCallModel\n    {\n        /// <summary>\n        /// The percent margin buffer to use when checking whether the total margin used is\n        /// above the total portfolio value to generate margin call orders\n        /// </summary>\n        private readonly decimal _marginBuffer;\n\n        /// <summary>\n        /// Gets the portfolio that margin calls will be transacted against\n        /// </summary>\n        protected SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the default order properties to be used in margin call orders\n        /// </summary>\n        protected IOrderProperties DefaultOrderProperties { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultMarginCallModel\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The portfolio object to receive margin calls</param>\n        /// <param name=\"defaultOrderProperties\">The default order properties to be used in margin call orders</param>\n        /// <param name=\"marginBuffer\">\n        /// The percent margin buffer to use when checking whether the total margin used is\n        /// above the total portfolio value to generate margin call orders\n        /// </param>\n        public DefaultMarginCallModel(SecurityPortfolioManager portfolio, IOrderProperties defaultOrderProperties, decimal marginBuffer = 0.10m)\n        {\n            Portfolio = portfolio;\n            DefaultOrderProperties = defaultOrderProperties;\n            _marginBuffer = marginBuffer;\n        }\n\n        /// <summary>\n        /// Scan the portfolio and the updated data for a potential margin call situation which may get the holdings below zero!\n        /// If there is a margin call, liquidate the portfolio immediately before the portfolio gets sub zero.\n        /// </summary>\n        /// <param name=\"issueMarginCallWarning\">Set to true if a warning should be issued to the algorithm</param>\n        /// <returns>True for a margin call on the holdings.</returns>\n        public List<SubmitOrderRequest> GetMarginCallOrders(out bool issueMarginCallWarning)\n        {\n            issueMarginCallWarning = false;\n\n            var totalMarginUsed = Portfolio.TotalMarginUsed;\n\n            // don't issue a margin call if we're not using margin\n            if (totalMarginUsed <= 0)\n            {\n                return new List<SubmitOrderRequest>();\n            }\n\n            var totalPortfolioValue = Portfolio.TotalPortfolioValue;\n            var marginRemaining = Portfolio.GetMarginRemaining(totalPortfolioValue);\n\n            // issue a margin warning when we're down to 5% margin remaining\n            if (marginRemaining <= totalPortfolioValue * 0.05m)\n            {\n                issueMarginCallWarning = true;\n            }\n\n            // generate a listing of margin call orders\n            var marginCallOrders = new List<SubmitOrderRequest>();\n\n            // if we still have margin remaining then there's no need for a margin call\n            if (marginRemaining <= 0)\n            {\n                if (totalMarginUsed > totalPortfolioValue * (1 + _marginBuffer))\n                {\n                    foreach (var positionGroup in Portfolio.Positions.Groups)\n                    {\n                        var positionMarginCallOrders = GenerateMarginCallOrders(\n                            new MarginCallOrdersParameters(positionGroup, totalPortfolioValue, totalMarginUsed)).ToList();\n                        if (positionMarginCallOrders.Count > 0 && positionMarginCallOrders.All(x => x.Quantity != 0))\n                        {\n                            marginCallOrders.AddRange(positionMarginCallOrders);\n                        }\n                    }\n                }\n\n                issueMarginCallWarning = marginCallOrders.Count > 0;\n            }\n\n            return marginCallOrders;\n        }\n\n        /// <summary>\n        /// Generates a new order for the specified security taking into account the total margin\n        /// used by the account. Returns null when no margin call is to be issued.\n        /// </summary>\n        /// <param name=\"parameters\">The set of parameters required to generate the margin call orders</param>\n        /// <returns>An order object representing a liquidation order to be executed to bring the account within margin requirements</returns>\n        protected virtual IEnumerable<SubmitOrderRequest> GenerateMarginCallOrders(MarginCallOrdersParameters parameters)\n        {\n            var positionGroup = parameters.PositionGroup;\n            if (positionGroup.Positions.Any(position => Portfolio.Securities[position.Symbol].QuoteCurrency.ConversionRate == 0))\n            {\n                // check for div 0 - there's no conv rate, so we can't place an order\n                return Enumerable.Empty<SubmitOrderRequest>();\n            }\n\n            // compute the amount of quote currency we need to liquidate in order to get within margin requirements\n            var deltaAccountCurrency = parameters.TotalUsedMargin - parameters.TotalPortfolioValue;\n\n            var currentlyUsedBuyingPower = positionGroup.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(Portfolio, positionGroup);\n\n            // if currentlyUsedBuyingPower > deltaAccountCurrency, means we can keep using the diff in buying power\n            var buyingPowerToKeep = Math.Max(0, currentlyUsedBuyingPower - deltaAccountCurrency);\n\n            // we want a reduction so we send the inverse side of our position\n            var deltaBuyingPower = (currentlyUsedBuyingPower - buyingPowerToKeep) * -Math.Sign(positionGroup.Quantity);\n\n            var result = positionGroup.BuyingPowerModel.GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(\n                Portfolio, positionGroup, deltaBuyingPower,\n                // margin is negative, we need to reduce positions, no minimum\n                minimumOrderMarginPortfolioPercentage: 0\n            ));\n\n            var absQuantity = Math.Abs(result.NumberOfLots);\n            var orderType = positionGroup.Count > 1 ? OrderType.ComboMarket : OrderType.Market;\n\n            GroupOrderManager groupOrderManager = null;\n            if (orderType == OrderType.ComboMarket)\n            {\n                groupOrderManager = new GroupOrderManager(Portfolio.Transactions.GetIncrementGroupOrderManagerId(), positionGroup.Count,\n                    absQuantity);\n            }\n\n            return positionGroup.Positions.Select(position =>\n            {\n                var security = Portfolio.Securities[position.Symbol];\n                // Always reducing, so we take the absolute quantity times the opposite sign of the position\n                var legQuantity = absQuantity * position.UnitQuantity * -Math.Sign(position.Quantity);\n\n                return new SubmitOrderRequest(\n                    orderType,\n                    security.Type,\n                    security.Symbol,\n                    legQuantity.GetOrderLegGroupQuantity(groupOrderManager),\n                    0,\n                    0,\n                    security.LocalTime.ConvertToUtc(security.Exchange.TimeZone),\n                    Messages.DefaultMarginCallModel.MarginCallOrderTag,\n                    DefaultOrderProperties?.Clone(),\n                    groupOrderManager);\n            });\n        }\n\n        /// <summary>\n        /// Executes synchronous orders to bring the account within margin requirements.\n        /// </summary>\n        /// <param name=\"generatedMarginCallOrders\">These are the margin call orders that were generated\n        /// by individual security margin models.</param>\n        /// <returns>The list of orders that were actually executed</returns>\n        public virtual List<OrderTicket> ExecuteMarginCall(IEnumerable<SubmitOrderRequest> generatedMarginCallOrders)\n        {\n            // if our margin used is back under the portfolio value then we can stop liquidating\n            if (Portfolio.MarginRemaining >= 0)\n            {\n                return new List<OrderTicket>();\n            }\n\n            // order by losers first\n            var executedOrders = new List<OrderTicket>();\n            var ordersWithSecurities = generatedMarginCallOrders.ToDictionary(x => x, x => Portfolio[x.Symbol]);\n            var groupManagerTemporalIds = -ordersWithSecurities.Count;\n            var orderedByLosers = ordersWithSecurities\n                // group orders by their group manager id so they are executed together\n                .GroupBy(x => x.Key.GroupOrderManager?.Id ?? groupManagerTemporalIds++)\n                .OrderBy(x => x.Sum(kvp => kvp.Value.UnrealizedProfit))\n                .Select(x => x.Select(kvp => kvp.Key));\n            foreach (var requests in orderedByLosers)\n            {\n                var tickets = new List<OrderTicket>();\n                foreach (var request in requests)\n                {\n                    tickets.Add(Portfolio.Transactions.AddOrder(request));\n                }\n\n                foreach (var ticket in tickets)\n                {\n                    if (ticket.Status.IsOpen())\n                    {\n                        Portfolio.Transactions.WaitForOrder(ticket.OrderId);\n                    }\n                    executedOrders.Add(ticket);\n                }\n\n                // if our margin used is back under the portfolio value then we can stop liquidating\n                if (Portfolio.MarginRemaining >= 0)\n                {\n                    break;\n                }\n            }\n            return executedOrders;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/DelayedSettlementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for applying cash settlement rules\n    /// </summary>\n    /// <remarks>This model applies cash settlement after T+N days</remarks>\n    public class DelayedSettlementModel : ISettlementModel\n    {\n        private readonly int _numberOfDays;\n        private readonly TimeSpan _timeOfDay;\n        private CashBook _cashBook;\n\n        /// <summary>\n        /// The list of pending funds waiting for settlement time\n        /// </summary>\n        private readonly Queue<UnsettledCashAmount> _unsettledCashAmounts;\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"DelayedSettlementModel\"/> class\n        /// </summary>\n        /// <param name=\"numberOfDays\">The number of days required for settlement</param>\n        /// <param name=\"timeOfDay\">The time of day used for settlement</param>\n        public DelayedSettlementModel(int numberOfDays, TimeSpan timeOfDay)\n        {\n            _timeOfDay = timeOfDay;\n            _numberOfDays = numberOfDays;\n            _unsettledCashAmounts = new();\n        }\n\n        /// <summary>\n        /// Applies cash settlement rules\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        public void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            var currency = applyFundsParameters.CashAmount.Currency;\n            var amount = applyFundsParameters.CashAmount.Amount;\n            var security = applyFundsParameters.Security;\n            var portfolio = applyFundsParameters.Portfolio;\n            if (amount > 0)\n            {\n                // positive amount: sell order filled\n\n                portfolio.UnsettledCashBook[currency].AddAmount(amount);\n\n                // find the correct settlement date (usually T+3 or T+1)\n                var settlementDate = applyFundsParameters.UtcTime.ConvertFromUtc(security.Exchange.TimeZone).Date;\n                for (var i = 0; i < _numberOfDays; i++)\n                {\n                    settlementDate = settlementDate.AddDays(1);\n\n                    // only count days when market is open\n                    if (!security.Exchange.Hours.IsDateOpen(settlementDate))\n                        i--;\n                }\n\n                // use correct settlement time\n                var settlementTimeUtc = settlementDate.Add(_timeOfDay).ConvertToUtc(security.Exchange.Hours.TimeZone);\n\n                lock (_unsettledCashAmounts)\n                {\n                    _unsettledCashAmounts.Enqueue(new UnsettledCashAmount(settlementTimeUtc, currency, amount));\n                }\n            }\n            else\n            {\n                // negative amount: buy order filled\n\n                portfolio.CashBook[currency].AddAmount(amount);\n            }\n\n            // We just keep it to use currency conversion in GetUnsettledCash method\n            if (_cashBook == null)\n            {\n                _cashBook = portfolio.UnsettledCashBook;\n            }\n        }\n\n        /// <summary>\n        /// Scan for pending settlements\n        /// </summary>\n        /// <param name=\"settlementParameters\">The settlement parameters</param>\n        public void Scan(ScanSettlementModelParameters settlementParameters)\n        {\n            lock (_unsettledCashAmounts)\n            {\n                while (_unsettledCashAmounts.TryPeek(out var item)\n                    // check if settlement time has passed\n                    && settlementParameters.UtcTime >= item.SettlementTimeUtc)\n                {\n                    // remove item from unsettled funds list\n                    _unsettledCashAmounts.Dequeue();\n\n                    // update unsettled cashbook\n                    settlementParameters.Portfolio.UnsettledCashBook[item.Currency].AddAmount(-item.Amount);\n\n                    // update settled cashbook\n                    settlementParameters.Portfolio.CashBook[item.Currency].AddAmount(item.Amount);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the unsettled cash amount for the security\n        /// </summary>\n        public CashAmount GetUnsettledCash()\n        {\n            var accountCurrency = _cashBook != null ? _cashBook.AccountCurrency : Currencies.USD;\n\n            lock (_unsettledCashAmounts)\n            {\n                if (_unsettledCashAmounts.Count == 0)\n                {\n                    return default;\n                }\n\n                return new CashAmount(_unsettledCashAmounts.Sum(x => _cashBook.ConvertToAccountCurrency(x.Amount, x.Currency)), accountCurrency);\n            }\n\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/DynamicSecurityData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides access to a security's data via it's type. This implementation supports dynamic access\n    /// by type name.\n    /// </summary>\n    public class DynamicSecurityData : IDynamicMetaObjectProvider\n    {\n        private static readonly MethodInfo SetPropertyMethodInfo = typeof(DynamicSecurityData).GetMethod(\"SetProperty\");\n        private static readonly MethodInfo GetPropertyMethodInfo = typeof(DynamicSecurityData).GetMethod(\"GetProperty\");\n\n        private readonly IRegisteredSecurityDataTypesProvider _registeredTypes;\n        private readonly ConcurrentDictionary<Type, Type> _genericTypes = new ConcurrentDictionary<Type, Type>();\n        private readonly SecurityCache _cache;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DynamicSecurityData\"/> class\n        /// </summary>\n        /// <param name=\"registeredTypes\">Provides all the registered data types for the algorithm</param>\n        /// <param name=\"cache\">The security cache</param>\n        public DynamicSecurityData(IRegisteredSecurityDataTypesProvider registeredTypes, SecurityCache cache)\n        {\n            _registeredTypes = registeredTypes;\n            _cache = cache;\n        }\n\n        /// <summary>Returns the <see cref=\"T:System.Dynamic.DynamicMetaObject\" /> responsible for binding operations performed on this object.</summary>\n        /// <returns>The <see cref=\"T:System.Dynamic.DynamicMetaObject\" /> to bind this object.</returns>\n        /// <param name=\"parameter\">The expression tree representation of the runtime value.</param>\n        public DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new GetSetPropertyDynamicMetaObject(parameter, this, SetPropertyMethodInfo, GetPropertyMethodInfo);\n        }\n\n        /// <summary>\n        /// Gets whether or not this dynamic data instance has data stored for the specified type\n        /// </summary>\n        public bool HasData<T>()\n        {\n            return _cache.HasData(typeof(T));\n        }\n\n        /// <summary>\n        /// Gets whether or not this dynamic data instance has a property with the specified name.\n        /// This is a case-insensitive search.\n        /// </summary>\n        /// <param name=\"name\">The property name to check for</param>\n        /// <returns>True if the property exists, false otherwise</returns>\n        public bool HasProperty(string name)\n        {\n            Type type;\n            if (_registeredTypes.TryGetType(name, out type))\n            {\n                return _cache.HasData(type);\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the last item in the data list for the specified type\n        /// </summary>\n        public T Get<T>()\n        {\n            var list = GetAll<T>();\n            return list.LastOrDefault();\n        }\n\n        /// <summary>\n        /// Gets the data list for the specified type\n        /// </summary>\n        public IReadOnlyList<T> GetAll<T>()\n        {\n            return GetAllImpl(typeof(T));\n        }\n\n        /// <summary>\n        /// Get the matching cached object in a python friendly accessor\n        /// </summary>\n        /// <param name=\"type\">Type to search for</param>\n        /// <returns>Matching object</returns>\n        public PyObject Get(Type type)\n        {\n            var list = GetAll(type);\n\n            if (list.Count == 0)\n            {\n                return null;\n            }\n\n            using (Py.GIL())\n            {\n                return list[list.Count - 1].ToPython();\n            }\n        }\n\n        /// <summary>\n        /// Get all the matching types with a python friendly overload.\n        /// </summary>\n        /// <param name=\"type\">Search type</param>\n        /// <returns>List of matching objects cached</returns>\n        public IList GetAll(Type type)\n        {\n            return GetAllImpl(type);\n        }\n\n        /// <summary>\n        /// Sets the property with the specified name to the value. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to set</param>\n        /// <param name=\"value\">The new property value</param>\n        /// <returns>Returns the input value back to the caller</returns>\n        [Obsolete(\"DynamicSecurityData is a view of the SecurityCache. It is readonly, properties can not be set\")]\n        public object SetProperty(string name, object value)\n        {\n            throw new InvalidOperationException(Messages.DynamicSecurityData.PropertiesCannotBeSet);\n        }\n\n        /// <summary>\n        /// Gets the property's value with the specified name. This is a case-insensitve search.\n        /// </summary>\n        /// <param name=\"name\">The property name to access</param>\n        /// <returns>object value of BaseData</returns>\n        public object GetProperty(string name)\n        {\n            // check to see if the requested name matches one of the algorithm registered data types and if\n            // so, we'll return a new empty list. this precludes us from always needing to check HasData<T>\n            Type type;\n            if (_registeredTypes.TryGetType(name, out type))\n            {\n                IReadOnlyList<BaseData> data;\n                if (_cache.TryGetValue(type, out data))\n                {\n                    return data;\n                }\n\n                var listType = GetGenericListType(type);\n                return Activator.CreateInstance(listType);\n            }\n\n            throw new KeyNotFoundException(Messages.DynamicSecurityData.PropertyNotFound(name));\n        }\n\n        /// <summary>\n        /// Get all implementation that covers both Python and C#\n        /// </summary>\n        private dynamic GetAllImpl(Type type)\n        {\n            var data = GetProperty(type.Name);\n\n            var dataType = data.GetType();\n            if (dataType.GetElementType() == type // covers arrays\n                // covers lists\n                || dataType.GenericTypeArguments.Length == 1\n                && dataType.GenericTypeArguments[0] == type)\n            {\n                return data;\n            }\n\n            var baseDataList = data as IReadOnlyList<BaseData>;\n            if (baseDataList != null)\n            {\n                var listType = GetGenericListType(type);\n                var list = (IList)Activator.CreateInstance(listType);\n                foreach (var baseData in baseDataList)\n                {\n                    list.Add(baseData);\n                }\n                return list;\n            }\n\n            throw new InvalidOperationException(Messages.DynamicSecurityData.UnexpectedTypesForGetAll(type, data));\n        }\n\n        private Type GetGenericListType(Type type)\n        {\n            Type containerType;\n            if (!_genericTypes.TryGetValue(type, out containerType))\n            {\n                // for performance we keep the generic type\n                _genericTypes[type] = containerType = typeof(List<>).MakeGenericType(type);\n            }\n\n            return containerType;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/EmptyContractFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Derivate security universe selection filter which will always return empty\n    /// </summary>\n    public class EmptyContractFilter<T> : IDerivativeSecurityFilter<T>\n        where T : IChainUniverseData\n    {\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        public bool Asynchronous { get; set; } = true;\n\n        /// <summary>\n        /// Filters the input set of symbols represented by the universe\n        /// </summary>\n        /// <param name=\"universe\">derivative symbols universe used in filtering</param>\n        /// <returns>The filtered set of symbols</returns>\n        public IDerivativeSecurityFilterUniverse<T> Filter(IDerivativeSecurityFilterUniverse<T> universe)\n        {\n            return new NoneIDerivativeSecurityFilterUniverse();\n        }\n\n        private class NoneIDerivativeSecurityFilterUniverse : IDerivativeSecurityFilterUniverse<T>\n        {\n            public DateTime LocalTime => default;\n\n            public IEnumerator<T> GetEnumerator()\n            {\n                return Enumerable.Empty<T>().GetEnumerator();\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return Enumerable.Empty<T>().GetEnumerator();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Equity/Equity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Securities.Equity\n{\n    /// <summary>\n    /// Equity Security Type : Extension of the underlying Security class for equity specific behaviours.\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Equity : Security\n    {\n        /// <summary>\n        /// The default number of days required to settle an equity sale\n        /// </summary>\n        public static int DefaultSettlementDays { get; set; } = 1;\n\n        /// <summary>\n        /// The default time of day for settlement\n        /// </summary>\n        public static readonly TimeSpan DefaultSettlementTime = new TimeSpan(6, 0, 0);\n\n        /// <summary>\n        /// Checks if the equity is a shortable asset. Note that this does not\n        /// take into account any open orders or existing holdings. To check if the asset\n        /// is currently shortable, use QCAlgorithm's ShortableQuantity property instead.\n        /// </summary>\n        /// <returns>True if the security is a shortable equity</returns>\n        public bool Shortable\n        {\n            get\n            {\n                var shortableQuantity = ShortableProvider.ShortableQuantity(Symbol, LocalTime);\n                // null means we don't have the data\n                return shortableQuantity == null || shortableQuantity > 0m;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total quantity shortable for this security. This does not take into account\n        /// any open orders or existing holdings. To check the asset's currently shortable quantity,\n        /// use QCAlgorithm's ShortableQuantity property instead.\n        /// </summary>\n        /// <returns>Zero if not shortable, null if infinitely shortable, or a number greater than zero if shortable</returns>\n        public long? TotalShortableQuantity => ShortableProvider.ShortableQuantity(Symbol, LocalTime);\n\n        /// <summary>\n        /// Equity primary exchange.\n        /// </summary>\n        public Exchange PrimaryExchange { get; }\n\n        /// <summary>\n        /// Construct the Equity Object\n        /// </summary>\n        public Equity(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache,\n            Exchange primaryExchange = null)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new EquityExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new EquityFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(2m),\n                new EquityDataFilter(),\n                new AdjustedPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            Holdings = new EquityHolding(this, currencyConverter);\n            PrimaryExchange = primaryExchange ?? QuantConnect.Exchange.UNKNOWN;\n        }\n\n        /// <summary>\n        /// Construct the Equity Object\n        /// </summary>\n        public Equity(SecurityExchangeHours exchangeHours,\n            SubscriptionDataConfig config,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            Exchange primaryExchange = null)\n            : base(\n                config,\n                quoteCurrency,\n                symbolProperties,\n                new EquityExchange(exchangeHours),\n                new EquityCache(),\n                new SecurityPortfolioModel(),\n                new EquityFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(2m),\n                new EquityDataFilter(),\n                new AdjustedPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            Holdings = new EquityHolding(this, currencyConverter);\n            PrimaryExchange = primaryExchange ?? QuantConnect.Exchange.UNKNOWN;;\n        }\n\n        /// <summary>\n        /// Sets the data normalization mode to be used by this security\n        /// </summary>\n        public override void SetDataNormalizationMode(DataNormalizationMode mode)\n        {\n            base.SetDataNormalizationMode(mode);\n\n            if (mode == DataNormalizationMode.Adjusted)\n            {\n                PriceVariationModel = new AdjustedPriceVariationModel();\n            }\n            else\n            {\n                PriceVariationModel = new EquityPriceVariationModel();\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Equity security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Equity/EquityCache.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Equity\n{\n    /// <summary>\n    /// Equity cache override.\n    /// </summary>\n    /// <remarks>Scheduled for obsolesence</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class EquityCache : SecurityCache\n    {\n        /// <summary>\n        /// Start a new Cache for the set Index Code\n        /// </summary>\n        public EquityCache()\n            : base()\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Equity/EquityDataFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities.Equity \n{\n    /// <summary>\n    /// Equity security type data filter \n    /// </summary>\n    /// <seealso cref=\"SecurityDataFilter\"/>\n    public class EquityDataFilter : SecurityDataFilter\n    {\n        /// <summary>\n        /// Initialize Data Filter Class:\n        /// </summary>\n        public EquityDataFilter() : base()\n        {\n\n        }\n\n        /// <summary>\n        /// Equity filter the data: true - accept, false - fail.\n        /// </summary>\n        /// <param name=\"data\">Data class</param>\n        /// <param name=\"vehicle\">Security asset</param>\n        public override bool Filter(Security vehicle, BaseData data)\n        {\n            // No data filter for bad ticks. All raw data will be piped into algorithm\n            return true;\n        }\n\n    } //End Filter\n\n} //End Namespace"
  },
  {
    "path": "Common/Securities/Equity/EquityExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Equity\n{\n    /// <summary>\n    /// Equity exchange information\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class EquityExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days in an equity calendar year - 252\n        /// </summary>\n        public override int TradingDaysPerYear\n        {\n            get { return 252; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EquityExchange\"/> class using market hours\n        /// derived from the market-hours-database for the USA Equity market\n        /// </summary>\n        public EquityExchange()\n            : base(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, null, SecurityType.Equity))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EquityExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public EquityExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Equity/EquityHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Equity\n{\n    /// <summary>\n    /// Holdings class for equities securities: no specific properties here but it is a placeholder for future equities specific behaviours.\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class EquityHolding : SecurityHolding\n    {\n        /// <summary>\n        /// Constructor for equities holdings.\n        /// </summary>\n        /// <param name=\"security\">The security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public EquityHolding(Security security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Equity/ShortMarginInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities.Equity\n{\n    /// <summary>\n    /// Short margin interest rate model\n    ///\n    /// When shorting charges the fee rate provided by the <see cref=\"QuantConnect.Interfaces.IShortableProvider\"/>.\n    /// When long adds the rebate fee provided by the <see cref=\"QuantConnect.Interfaces.IShortableProvider\"/>.\n    /// </summary>\n    public class ShortMarginInterestRateModel : IMarginInterestRateModel\n    {\n        private bool _isShort;\n        private DateTime _previousTime;\n\n        /// <summary>\n        /// Accumulated shorting fee, negative means paid, positive earned.\n        ///\n        /// Negative due to borrowing the asset to short, the fee rate.\n        /// Positive due to lending the asset for shorting, the rebate rate.\n        /// </summary>\n        public decimal Amount { get; set; }\n\n        /// <summary>\n        /// Apply margin interest rates to the portfolio\n        /// </summary>\n        /// <param name=\"marginInterestRateParameters\">The parameters to use</param>\n        public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n        {\n            var security = marginInterestRateParameters.Security;\n            if (!security.Holdings.HoldStock)\n            {\n                // clear state\n                _previousTime = default;\n                return;\n            }\n\n            if (_previousTime == default || _isShort != security.Holdings.IsShort)\n            {\n                // start the clock on initial state or when changing sides\n                _isShort = security.Holdings.IsShort;\n                _previousTime = marginInterestRateParameters.Time;\n                return;\n            }\n            else if (marginInterestRateParameters.Time.Date == _previousTime.Date)\n            {\n                // charge once a day\n                return;\n            }\n\n            decimal? feeRate;\n            if (_isShort)\n            {\n                feeRate = security.ShortableProvider?.FeeRate(security.Symbol, security.LocalTime.Date);\n            }\n            else\n            {\n                feeRate = security.ShortableProvider?.RebateRate(security.Symbol, security.LocalTime.Date);\n            }\n\n            if (feeRate == null || feeRate.Value == 0)\n            {\n                // nothing todo\n                _previousTime = default;\n                return;\n            }\n\n            var dailyFeeRate = ((feeRate.Value * security.Holdings.HoldingsValue) / 360);\n            var fee = dailyFeeRate * (marginInterestRateParameters.Time.Date - _previousTime.Date).Days;\n\n            Amount += fee;\n            security.QuoteCurrency.AddAmount(fee);\n            // until next date\n            _previousTime = marginInterestRateParameters.Time;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/EquityPriceVariationModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPriceVariationModel\"/>\n    /// for use in defining the minimum price variation for a given equity\n    /// under Regulation NMS – Rule 612 (a.k.a – the “sub-penny rule”)\n    /// </summary>\n    public class EquityPriceVariationModel : SecurityPriceVariationModel\n    {\n        /// <summary>\n        /// Get the minimum price variation from a security\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the method parameters</param>\n        /// <returns>Decimal minimum price variation of a given security</returns>\n        public override decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters)\n        {\n            if (parameters.Security.Type != SecurityType.Equity)\n            {\n                throw new ArgumentException(\"EquityPriceVariationModel.GetMinimumPriceVariation(): \" +\n                    Messages.EquityPriceVariationModel.InvalidSecurityType(parameters.Security));\n            }\n\n            // If the quotation is priced less than $1.00 per share, the minimum pricing increment is $0.0001.\n            // Source: https://www.law.cornell.edu/cfr/text/17/242.612\n            if (parameters.ReferencePrice < 1m)\n            {\n                return 0.0001m;\n            }\n\n            return base.GetMinimumPriceVariation(parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ErrorCurrencyConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ICurrencyConverter\"/> for use in\n    /// tests that don't depend on this behavior.\n    /// </summary>\n    public class ErrorCurrencyConverter : ICurrencyConverter\n    {\n        /// <summary>\n        /// Gets account currency\n        /// </summary>\n        public string AccountCurrency\n        {\n            get\n            {\n                throw new InvalidOperationException(Messages.ErrorCurrencyConverter.AccountCurrencyUnexpectedUsage);\n            }\n        }\n\n        /// <summary>\n        /// Provides access to the single instance of <see cref=\"ErrorCurrencyConverter\"/>.\n        /// This is done this way to ensure usage is explicit.\n        /// </summary>\n        public static ICurrencyConverter Instance = new ErrorCurrencyConverter();\n\n        private ErrorCurrencyConverter()\n        {\n        }\n\n        /// <summary>\n        /// Converts a cash amount to the account currency\n        /// </summary>\n        /// <param name=\"cashAmount\">The <see cref=\"CashAmount\"/> instance to convert</param>\n        /// <returns>A new <see cref=\"CashAmount\"/> instance denominated in the account currency</returns>\n        public CashAmount ConvertToAccountCurrency(CashAmount cashAmount)\n        {\n            throw new InvalidOperationException(Messages.ErrorCurrencyConverter.ConvertToAccountCurrencyPurposefullyThrow);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Forex/Forex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.Forex\n{\n    /// <summary>\n    /// FOREX Security Object Implementation for FOREX Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Forex : Security, IBaseCurrencySymbol\n    {\n        /// <summary>\n        /// Gets the currency acquired by going long this currency pair\n        /// </summary>\n        /// <remarks>\n        /// For example, the EUR/USD has a base currency of the euro, and as a result\n        /// of going long the EUR/USD a trader is acquiring euros in exchange for US dollars\n        /// </remarks>\n        public Cash BaseCurrency { get; protected set; }\n\n        /// <summary>\n        /// Constructor for the forex security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"baseCurrency\">The cash object that represent the base currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        public Forex(SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            Cash baseCurrency,\n            SubscriptionDataConfig config,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes)\n            : base(config,\n                quoteCurrency,\n                symbolProperties,\n                new ForexExchange(exchangeHours),\n                new ForexCache(),\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new ForexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BaseCurrency = baseCurrency;\n            Holdings = new ForexHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Constructor for the forex security\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"baseCurrency\">The cash object that represent the base currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache for storing Security data</param>\n        public Forex(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            Cash baseCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new ForexExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new ForexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BaseCurrency = baseCurrency;\n            Holdings = new ForexHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Decomposes the specified currency pair into a base and quote currency provided as out parameters\n        /// </summary>\n        /// <param name=\"currencyPair\">The input currency pair to be decomposed, for example, \"EURUSD\"</param>\n        /// <param name=\"baseCurrency\">The output base currency</param>\n        /// <param name=\"quoteCurrency\">The output quote currency</param>\n        public static void DecomposeCurrencyPair(string currencyPair, out string baseCurrency, out string quoteCurrency)\n        {\n            if (!CurrencyPairUtil.IsForexDecomposable(currencyPair))\n            {\n                throw new ArgumentException($\"Currency pairs must be exactly 6 characters: {currencyPair}\");\n            }\n\n            baseCurrency = currencyPair.Substring(0, 3);\n            quoteCurrency = currencyPair.Substring(3);\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Forex security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Forex/ForexCache.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Forex\n{\n    /// <summary>\n    /// Forex specific caching support\n    /// </summary>\n    /// <remarks>Class is vitually empty and scheduled to be made obsolete. Potentially could be used for user data storage.</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class ForexCache : SecurityCache\n    {\n        /// <summary>\n        /// Initialize forex cache\n        /// </summary>\n        public ForexCache()\n            : base()\n        {\n            //Nothing to do:\n        }\n    } //End ForexCache Class\n} //End Namespace"
  },
  {
    "path": "Common/Securities/Forex/ForexDataFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities.Forex \n{\n    /// <summary>\n    /// Forex packet by packet data filtering mechanism for dynamically detecting bad ticks.\n    /// </summary>\n    /// <seealso cref=\"SecurityDataFilter\"/>\n    public class ForexDataFilter : SecurityDataFilter\n    {\n        /// <summary>\n        /// Initialize forex data filter class:\n        /// </summary>\n        public ForexDataFilter()\n            : base() \n        {\n            \n        }\n\n        /// <summary>\n        /// Forex data filter: a true value means accept the packet, a false means fail.\n        /// </summary>\n        /// <param name=\"data\">Data object we're scanning to filter</param>\n        /// <param name=\"vehicle\">Security asset</param>\n        public override bool Filter(Security vehicle, BaseData data)\n        {\n            //FX data is from FXCM and fairly clean already. Accept all packets.\n            return true;\n        }\n\n    } //End Filter\n\n} //End Namespace"
  },
  {
    "path": "Common/Securities/Forex/ForexExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Forex\n{\n    /// <summary>\n    /// Forex exchange class - information and helper tools for forex exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class ForexExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days per year for this security, used for performance statistics.\n        /// </summary>\n        public override int TradingDaysPerYear\n        {\n            // 365 - Saturdays = 313;\n            get { return 313; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ForexExchange\"/> class using market hours\n        /// derived from the market-hours-database for the FXCM Forex market\n        /// </summary>\n        public ForexExchange()\n            : base(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.FXCM, null, SecurityType.Forex))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ForexExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public ForexExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Forex/ForexHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing static System.Math;\n\nnamespace QuantConnect.Securities.Forex\n{\n    /// <summary>\n    /// FOREX holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class ForexHolding : SecurityHolding\n    {\n        /// <summary>\n        /// Forex Holding Class\n        /// </summary>\n        /// <param name=\"security\">The forex security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public ForexHolding(Forex security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n\n        /// <summary>\n        /// Profit in pips if we closed the holdings right now including the approximate fees\n        /// </summary>\n        public decimal TotalCloseProfitPips()\n        {\n            var pipDecimal = Security.SymbolProperties.MinimumPriceVariation * 10;\n            var exchangeRate = Security.QuoteCurrency.ConversionRate;\n\n            var pipCashCurrencyValue = (pipDecimal * AbsoluteQuantity * exchangeRate);\n            return Round((TotalCloseProfit() / pipCashCurrencyValue), 1);\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/FuncSecurityDerivativeFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a functional implementation of <see cref=\"IDerivativeSecurityFilter{T}\"/>\n    /// </summary>\n    public class FuncSecurityDerivativeFilter<T> : IDerivativeSecurityFilter<T>\n        where T : IChainUniverseData\n    {\n        private readonly Func<IDerivativeSecurityFilterUniverse<T>, IDerivativeSecurityFilterUniverse<T>> _filter;\n\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        public bool Asynchronous { get; set; } = true;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncSecurityDerivativeFilter{T}\"/> class\n        /// </summary>\n        /// <param name=\"filter\">The functional implementation of the <see cref=\"Filter\"/> method</param>\n        public FuncSecurityDerivativeFilter(Func<IDerivativeSecurityFilterUniverse<T>, IDerivativeSecurityFilterUniverse<T>> filter)\n        {\n            _filter = filter;\n        }\n\n        /// <summary>\n        /// Filters the input set of symbols represented by the universe\n        /// </summary>\n        /// <param name=\"universe\">Derivative symbols universe used in filtering</param>\n        /// <returns>The filtered set of symbols</returns>\n        public IDerivativeSecurityFilterUniverse<T> Filter(IDerivativeSecurityFilterUniverse<T> universe)\n        {\n            return _filter(universe);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FuncSecurityInitializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a functional implementation of <see cref=\"ISecurityInitializer\"/>\n    /// </summary>\n    public class FuncSecurityInitializer : ISecurityInitializer\n    {\n        private readonly Action<Security> _initializer;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncSecurityInitializer\"/> class\n        /// </summary>\n        /// <param name=\"initializer\">The functional implementation of <see cref=\"ISecurityInitializer.Initialize\"/></param>\n        public FuncSecurityInitializer(PyObject initializer)\n        {\n            _initializer = PythonUtil.ToAction<Security>(initializer);\n            if (_initializer == null)\n            {\n                throw new InvalidOperationException(\"FuncSecurityInitializer constructor requires an action taking a single security instance as an argument\");\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncSecurityInitializer\"/> class\n        /// </summary>\n        /// <param name=\"initializer\">The functional implementation of <see cref=\"ISecurityInitializer.Initialize\"/></param>\n        public FuncSecurityInitializer(Action<Security> initializer)\n        {\n            _initializer = initializer;\n        }\n\n        /// <summary>\n        /// Initializes the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to be initialized</param>\n        public void Initialize(Security security)\n        {\n            _initializer(security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FuncSecuritySeeder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Seed a security price from a history function\n    /// </summary>\n    public class FuncSecuritySeeder : ISecuritySeeder\n    {\n        private readonly Func<Security, IEnumerable<BaseData>> _seedFunction;\n\n\n        /// <summary>\n        /// Constructor that takes as a parameter the security used to seed the price\n        /// </summary>\n        /// <param name=\"seedFunction\">The seed function to use</param>\n        public FuncSecuritySeeder(PyObject seedFunction)\n        {\n            var result = seedFunction.SafeAs<Func<Security, object>>();\n            _seedFunction = security =>\n            {\n                var dataObject = result(security);\n                var dataPoint = dataObject as BaseData;\n                if (dataPoint != null)\n                {\n                    return new[] { dataPoint };\n                }\n\n                return (IEnumerable<BaseData>)dataObject;\n            };\n        }\n\n        /// <summary>\n        /// Constructor that takes as a parameter the security used to seed the price\n        /// </summary>\n        /// <param name=\"seedFunction\">The seed function to use</param>\n        public FuncSecuritySeeder(Func<Security, BaseData> seedFunction)\n         : this(security => { return new []{ seedFunction(security) }; })\n        {\n        }\n\n        /// <summary>\n        /// Constructor that takes as a parameter the security used to seed the price\n        /// </summary>\n        /// <param name=\"seedFunction\">The seed function to use</param>\n        public FuncSecuritySeeder(Func<Security, IEnumerable<BaseData>> seedFunction)\n        {\n            _seedFunction = seedFunction;\n        }\n\n        /// <summary>\n        /// Seed the security\n        /// </summary>\n        /// <param name=\"security\"><see cref=\"Security\"/> being seeded</param>\n        /// <returns>true if the security was seeded, false otherwise</returns>\n        public bool SeedSecurity(Security security)\n        {\n            try\n            {\n                // Do not seed canonical symbols\n                if (!security.Symbol.IsCanonical())\n                {\n                    var gotData = false;\n                    foreach (var seedData in _seedFunction(security))\n                    {\n                        gotData = true;\n                        security.SetMarketPrice(seedData);\n                        Log.Debug(\"FuncSecuritySeeder.SeedSecurity(): \" + Messages.FuncSecuritySeeder.SeededSecurityInfo(seedData));\n                    }\n\n                    if (!gotData)\n                    {\n                        Log.Trace(\"FuncSecuritySeeder.SeedSecurity(): \" + Messages.FuncSecuritySeeder.UnableToSeedSecurity(security));\n                        return false;\n                    }\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Trace(\"FuncSecuritySeeder.SeedSecurity(): \" + Messages.FuncSecuritySeeder.UnableToSecurityPrice(security) + $\": {exception}\");\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/EmptyFutureChainProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IFutureChainProvider\"/> that always returns an empty list of contracts\n    /// </summary>\n    public class EmptyFutureChainProvider : IFutureChainProvider\n    {\n        /// <summary>\n        /// Gets the list of future contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the future chain (only used in backtesting)</param>\n        /// <returns>The list of future contracts</returns>\n        public IEnumerable<Symbol> GetFutureContractList(Symbol symbol, DateTime date)\n        {\n            return Enumerable.Empty<Symbol>();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/Future.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing Python.Runtime;\nusing QuantConnect.Util;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Futures Security Object Implementation for Futures Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Future : Security, IContinuousSecurity\n    {\n        private bool _isTradable;\n\n        /// <summary>\n        /// Gets or sets whether or not this security should be considered tradable\n        /// </summary>\n        /// <remarks>Canonical futures are not tradable</remarks>\n        public override bool IsTradable\n        {\n            get\n            {\n                // once a future is removed it is no longer tradable\n                return _isTradable && !Symbol.IsCanonical();\n            }\n            set\n            {\n                _isTradable = value;\n            }\n        }\n\n        /// <summary>\n        /// The default number of days required to settle a futures sale\n        /// </summary>\n        public const int DefaultSettlementDays = 1;\n\n        /// <summary>\n        /// The default time of day for settlement\n        /// </summary>\n        public static readonly TimeSpan DefaultSettlementTime = new TimeSpan(6, 0, 0);\n\n        /// <summary>\n        /// Constructor for the Future security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        public Future(SecurityExchangeHours exchangeHours,\n            SubscriptionDataConfig config,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes\n            )\n            : base(config,\n                quoteCurrency,\n                symbolProperties,\n                new FutureExchange(exchangeHours),\n                new FutureCache(),\n                new SecurityPortfolioModel(),\n                new FutureFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new FutureSettlementModel(),\n                Securities.VolatilityModel.Null,\n                null,\n                new SecurityDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BuyingPowerModel = new FutureMarginModel(0, this);\n            // for now all futures are cash settled as we don't allow underlying (Live Cattle?) to be posted on the account\n            SettlementType = SettlementType.Cash;\n            Holdings = new FutureHolding(this, currencyConverter);\n            ContractFilter = new EmptyContractFilter<FutureUniverse>();\n        }\n\n        /// <summary>\n        /// Constructor for the Future security\n        /// </summary>\n        /// <param name=\"symbol\">The subscription security symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        ///     instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache to store security information</param>\n        public Future(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new FutureExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new FutureFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new FutureSettlementModel(),\n                Securities.VolatilityModel.Null,\n                null,\n                new SecurityDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            BuyingPowerModel = new FutureMarginModel(0, this);\n            // for now all futures are cash settled as we don't allow underlying (Live Cattle?) to be posted on the account\n            SettlementType = SettlementType.Cash;\n            Holdings = new FutureHolding(this, currencyConverter);\n            ContractFilter = new EmptyContractFilter<FutureUniverse>();\n        }\n\n        /// <summary>\n        /// Returns true if this is the future chain security, false if it is a specific future contract\n        /// </summary>\n        public bool IsFutureChain => Symbol.IsCanonical();\n\n        /// <summary>\n        /// Returns true if this is a specific future contract security, false if it is the future chain security\n        /// </summary>\n        public bool IsFutureContract => !Symbol.IsCanonical();\n\n        /// <summary>\n        /// Gets the expiration date\n        /// </summary>\n        public DateTime Expiry\n        {\n            get { return Symbol.ID.Date; }\n        }\n\n        /// <summary>\n        /// Specifies if futures contract has physical or cash settlement on settlement\n        /// </summary>\n        public SettlementType SettlementType\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets or sets the currently mapped symbol for the security\n        /// </summary>\n        public Symbol Mapped\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets or sets the contract filter\n        /// </summary>\n        public IDerivativeSecurityFilter<FutureUniverse> ContractFilter\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"LocalTimeKeeper\"/> to be used for this <see cref=\"Security\"/>.\n        /// This is the source of this instance's time.\n        /// </summary>\n        /// <param name=\"localTimeKeeper\">The source of this <see cref=\"Security\"/>'s time.</param>\n        public override void SetLocalTimeKeeper(LocalTimeKeeper localTimeKeeper)\n        {\n            base.SetLocalTimeKeeper(localTimeKeeper);\n\n            var model = SettlementModel as FutureSettlementModel;\n            if (model != null)\n            {\n                model.SetLocalDateTimeFrontier(LocalTime);\n            }\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified expiration range values\n        /// </summary>\n        /// <param name=\"minExpiry\">The minimum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiry\">The maximum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in more than 10 days</param>\n        public void SetFilter(TimeSpan minExpiry, TimeSpan maxExpiry)\n        {\n            SetFilterImp(universe => universe.Expiration(minExpiry, maxExpiry));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified expiration range values\n        /// </summary>\n        /// <param name=\"minExpiryDays\">The minimum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiryDays\">The maximum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in more than 10 days</param>\n        public void SetFilter(int minExpiryDays, int maxExpiryDays)\n        {\n            SetFilterImp(universe => universe.Expiration(minExpiryDays, maxExpiryDays));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new universe selection function\n        /// </summary>\n        /// <param name=\"universeFunc\">new universe selection function</param>\n        public void SetFilter(Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc)\n        {\n            SetFilterImp(universeFunc);\n            ContractFilter.Asynchronous = false;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new universe selection function\n        /// </summary>\n        /// <param name=\"universeFunc\">new universe selection function</param>\n        public void SetFilter(PyObject universeFunc)\n        {\n            var pyUniverseFunc = PythonUtil.ToFunc<FutureFilterUniverse, FutureFilterUniverse>(universeFunc);\n            SetFilter(pyUniverseFunc);\n        }\n\n        private void SetFilterImp(Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc)\n        {\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func = universe =>\n            {\n                var futureUniverse = universe as FutureFilterUniverse;\n                var result = universeFunc(futureUniverse);\n                return result.ApplyTypesFilter();\n            };\n            ContractFilter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Future security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureCache.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Future specific caching support\n    /// </summary>\n    /// <remarks>Class is virtually empty and scheduled to be made obsolete. Potentially could be used for user data storage.</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class FutureCache : SecurityCache\n    {\n        /// <summary>\n        /// The current settlement price\n        /// </summary>\n        public decimal SettlementPrice { get; set; }\n\n        /// <summary>\n        /// Will consume the given data point updating the cache state and it's properties\n        /// </summary>\n        /// <param name=\"data\">The data point to process</param>\n        /// <param name=\"cacheByType\">True if this data point should be cached by type</param>\n        protected override void ProcessDataPoint(BaseData data, bool cacheByType)\n        {\n            base.ProcessDataPoint(data, cacheByType);\n\n            SettlementPrice = Price;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Future exchange class - information and helper tools for future exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class FutureExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days per year for this security, 252.\n        /// </summary>\n        /// <remarks>Used for performance statistics to calculate sharpe ratio accurately</remarks>\n        public override int TradingDaysPerYear\n        {\n            get { return 252; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FutureExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public FutureExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Future/FutureExpirationCycles.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Static class contains definitions of popular futures expiration cycles\n    /// </summary>\n    public static class FutureExpirationCycles\n    {\n        /// <summary>\n        /// January Cycle: Expirations in January, April, July, October (the first month of each quarter)\n        /// </summary>\n        public static readonly int[] January = { 1, 4, 7, 10 };\n\n        /// <summary>\n        /// February Cycle: Expirations in February, May, August, November (second month)\n        /// </summary>\n        public static readonly int[] February = { 2, 5, 8, 11 };\n\n        /// <summary>\n        /// March Cycle: Expirations in March, June, September, December (third month)\n        /// </summary>\n        public static readonly int[] March = { 3, 6, 9, 12 };\n\n        /// <summary>\n        /// December Cycle: Expirations in December\n        /// </summary>\n        public static readonly int[] December = { 12 };\n\n        /// <summary>\n        /// All Year Cycle: Expirations in every month of the year\n        /// </summary>\n        public static readonly int[] AllYear = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };\n\n        /// <summary>\n        /// GJMQVZ Cycle\n        /// </summary>\n        public static readonly int[] GJMQVZ = { 2, 4, 6, 8, 10, 12 };\n\n        /// <summary>\n        /// GJKMNQVZ Cycle\n        /// </summary>\n        public static readonly int[] GJKMNQVZ = { 2, 4, 5, 6, 7, 8, 10, 12 };\n\n        /// <summary>\n        /// HMUZ Cycle\n        /// </summary>\n        public static readonly int[] HMUZ = March;\n\n        /// <summary>\n        /// HKNUZ Cycle\n        /// </summary>\n        public static readonly int[] HKNUZ = { 3, 5, 7, 9, 12 };\n\n        /// <summary>\n        /// HKNV Cycle\n        /// </summary>\n        public static readonly int[] HKNV = { 3, 5, 7, 10 };\n\n        /// <summary>\n        /// HKNVZ Cycle\n        /// </summary>\n        public static readonly int[] HKNVZ = { 3, 5, 7, 10, 12 };\n\n        /// <summary>\n        /// FHKNUX Cycle\n        /// </summary>\n        public static readonly int[] FHKNUX = { 1, 3, 5, 7, 9, 11 };\n\n        /// <summary>\n        /// FHJKQUVX Cycle\n        /// </summary>\n        public static readonly int[] FHJKQUVX = { 1, 3, 4, 5, 8, 9, 10, 11 };\n\n        /// <summary>\n        /// HKNUVZ Cycle\n        /// </summary>\n        public static readonly int[] HKNUVZ = { 3, 5, 7, 9, 10, 12 };\n\n        /// <summary>\n        /// FHKNQUVZ Cycle\n        /// </summary>\n        public static readonly int[] FHKNUVZ = { 1, 3, 5, 7, 9, 10, 12 };\n\n        /// <summary>\n        /// FHKMQUVZ Cycle\n        /// </summary>\n        public static readonly int[] FHKNQUVZ = { 1, 3, 5, 7, 8, 9, 10, 12 };\n\n        /// <summary>\n        /// FHKNQUX Cycle\n        /// </summary>\n        public static readonly int[] FHKNQUX = { 1, 3, 5, 7, 8, 9, 11 };\n\n        /// <summary>\n        /// FGHJKMNQUVXZ Cycle\n        /// </summary>\n        public static readonly int[] FGHJKMNQUVXZ = AllYear;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureFilterUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents futures symbols universe used in filtering.\n    /// </summary>\n    public class FutureFilterUniverse : ContractSecurityFilterUniverse<FutureFilterUniverse, FutureUniverse>\n    {\n        /// <summary>\n        /// Constructs FutureFilterUniverse\n        /// </summary>\n        public FutureFilterUniverse(IEnumerable<FutureUniverse> allData, DateTime localTime)\n            : base(allData, localTime)\n        {\n        }\n\n        /// <summary>\n        /// Determine if the given Future contract symbol is standard\n        /// </summary>\n        /// <returns>True if contract is standard</returns>\n        protected override bool IsStandard(Symbol symbol)\n        {\n            return FutureSymbol.IsStandard(symbol);\n        }\n\n        /// <summary>\n        /// Creates a new instance of the data type for the given symbol\n        /// </summary>\n        /// <returns>A data instance for the given symbol, which is just the symbol itself</returns>\n        protected override FutureUniverse CreateDataInstance(Symbol symbol)\n        {\n            return new FutureUniverse()\n            {\n                Symbol = symbol,\n                Time = LocalTime\n            };\n        }\n\n        /// <summary>\n        /// Applies filter selecting futures contracts based on expiration cycles. See <see cref=\"FutureExpirationCycles\"/> for details\n        /// </summary>\n        /// <param name=\"months\">Months to select contracts from</param>\n        /// <returns>Universe with filter applied</returns>\n        public FutureFilterUniverse ExpirationCycle(int[] months)\n        {\n            var monthHashSet = months.ToHashSet();\n            return this.Where(x => monthHashSet.Contains(x.ID.Date.Month));\n        }\n    }\n\n    /// <summary>\n    /// Extensions for Linq support\n    /// </summary>\n    public static class FutureFilterUniverseEx\n    {\n        /// <summary>\n        /// Filters universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"predicate\">Bool function to determine which Symbol are filtered</param>\n        /// <returns><see cref=\"FutureFilterUniverse\"/> with filter applied</returns>\n        public static FutureFilterUniverse Where(this FutureFilterUniverse universe, Func<FutureUniverse, bool> predicate)\n        {\n            universe.Data = universe.Data.Where(predicate).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Maps universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbol function to determine which Symbols are filtered</param>\n        /// <returns><see cref=\"FutureFilterUniverse\"/> with filter applied</returns>\n        public static FutureFilterUniverse Select(this FutureFilterUniverse universe, Func<FutureUniverse, Symbol> mapFunc)\n        {\n            universe.AllSymbols = universe.Data.Select(mapFunc).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Binds universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbols function to determine which Symbols are filtered</param>\n        /// <returns><see cref=\"FutureFilterUniverse\"/> with filter applied</returns>\n        public static FutureFilterUniverse SelectMany(this FutureFilterUniverse universe, Func<FutureUniverse, IEnumerable<Symbol>> mapFunc)\n        {\n            universe.AllSymbols = universe.Data.SelectMany(mapFunc).ToList();\n            return universe;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Future holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class FutureHolding : SecurityHolding\n    {\n        /// <summary>\n        /// The cash settled profit for the current open position\n        /// </summary>\n        public virtual decimal SettledProfit { get; set; }\n\n        /// <summary>\n        /// Unsettled profit for the current open position <see cref=\"SettledProfit\"/>\n        /// </summary>\n        public virtual decimal UnsettledProfit\n        {\n            get\n            {\n                return TotalCloseProfit() - SettledProfit;\n            }\n        }\n\n        /// <summary>\n        /// Future Holding Class constructor\n        /// </summary>\n        /// <param name=\"security\">The future security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public FutureHolding(Security security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureMarginModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Represents a simple margin model for margin futures. Margin file contains Initial and Maintenance margins\n    /// </summary>\n    public class FutureMarginModel : SecurityMarginModel\n    {\n        private static IDataProvider _dataProvider;\n        private static readonly object _locker = new();\n        private static Dictionary<string, MarginRequirementsEntry[]> _marginRequirementsCache = new();\n\n        // historical database of margin requirements\n        private int _marginCurrentIndex;\n\n        private readonly Security _security;\n\n        /// <summary>\n        /// True will enable usage of intraday margins.\n        /// </summary>\n        /// <remarks>Disabled by default. Note that intraday margins are less than overnight margins\n        /// and could lead to margin calls</remarks>\n        public bool EnableIntradayMargins { get; set; }\n\n        /// <summary>\n        /// Initial Overnight margin requirement for the contract effective from the date of change\n        /// </summary>\n        public virtual decimal InitialOvernightMarginRequirement => GetCurrentMarginRequirements(_security)?.InitialOvernight ?? 0m;\n\n        /// <summary>\n        /// Maintenance Overnight margin requirement for the contract effective from the date of change\n        /// </summary>\n        public virtual decimal MaintenanceOvernightMarginRequirement => GetCurrentMarginRequirements(_security)?.MaintenanceOvernight ?? 0m;\n\n        /// <summary>\n        /// Initial Intraday margin for the contract effective from the date of change\n        /// </summary>\n        public virtual decimal InitialIntradayMarginRequirement => GetCurrentMarginRequirements(_security)?.InitialIntraday ?? 0m;\n\n        /// <summary>\n        /// Maintenance Intraday margin requirement for the contract effective from the date of change\n        /// </summary>\n        public virtual decimal MaintenanceIntradayMarginRequirement => GetCurrentMarginRequirements(_security)?.MaintenanceIntraday ?? 0m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FutureMarginModel\"/>\n        /// </summary>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required unused buying power for the account.</param>\n        /// <param name=\"security\">The security that this model belongs to</param>\n        public FutureMarginModel(decimal requiredFreeBuyingPowerPercent = 0, Security security = null)\n        {\n            RequiredFreeBuyingPowerPercent = requiredFreeBuyingPowerPercent;\n            _security = security;\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            return 1;\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, futures\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\"></param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public override void SetLeverage(Security security, decimal leverage)\n        {\n            // Futures are leveraged products and different leverage cannot be set by user.\n            throw new InvalidOperationException(\"Futures are leveraged products and different leverage cannot be set by user\");\n        }\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given buying power percentage.\n        /// Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the target signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public override GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(\n            GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)\n        {\n            if (Math.Abs(parameters.TargetBuyingPower) > 1)\n            {\n                throw new InvalidOperationException(\n                    \"Futures do not allow specifying a leveraged target, since they are traded using margin which already is leveraged. \" +\n                    $\"Possible target buying power goes from -1 to 1, target provided is: {parameters.TargetBuyingPower}\");\n            }\n            return base.GetMaximumOrderQuantityForTargetBuyingPower(parameters);\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public override InitialMargin GetInitialMarginRequiredForOrder(\n            InitialMarginRequiredForOrderParameters parameters\n            )\n        {\n            //Get the order value from the non-abstract order classes (MarketOrder, LimitOrder, StopMarketOrder)\n            //Market order is approximated from the current security price and set in the MarketOrder Method in QCAlgorithm.\n\n            var fees = parameters.Security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(parameters.Security,\n                    parameters.Order)).Value;\n            var feesInAccountCurrency = parameters.CurrencyConverter.\n                ConvertToAccountCurrency(fees).Amount;\n\n            var orderMargin = this.GetInitialMarginRequirement(parameters.Security, parameters.Order.Quantity);\n\n            return new InitialMargin(orderMargin + Math.Sign(orderMargin) * feesInAccountCurrency);\n        }\n\n        /// <summary>\n        /// Gets the margin currently allotted to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the </returns>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            if (parameters.Quantity == 0m)\n            {\n                return 0m;\n            }\n\n            var security = parameters.Security;\n            var marginReq = GetCurrentMarginRequirements(security);\n            if (marginReq == null)\n            {\n                return 0m;\n            }\n\n            if (EnableIntradayMargins\n                && security.Exchange.ExchangeOpen\n                && !security.Exchange.ClosingSoon)\n            {\n                return marginReq.MaintenanceIntraday * parameters.AbsoluteQuantity * security.QuoteCurrency.ConversionRate;\n            }\n\n            // margin is per contract\n            return marginReq.MaintenanceOvernight * parameters.AbsoluteQuantity * security.QuoteCurrency.ConversionRate;\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var security = parameters.Security;\n            var quantity = parameters.Quantity;\n            if (quantity == 0m)\n            {\n                return InitialMargin.Zero;\n            }\n\n            var marginReq = GetCurrentMarginRequirements(security);\n            if (marginReq == null)\n            {\n                return InitialMargin.Zero;\n            }\n\n            if (EnableIntradayMargins\n                && security.Exchange.ExchangeOpen\n                && !security.Exchange.ClosingSoon)\n            {\n                return new InitialMargin(marginReq.InitialIntraday * quantity * security.QuoteCurrency.ConversionRate);\n            }\n\n            // margin is per contract\n            return new InitialMargin(marginReq.InitialOvernight * quantity * security.QuoteCurrency.ConversionRate);\n        }\n\n        private MarginRequirementsEntry GetCurrentMarginRequirements(Security security)\n        {\n            var lastData = security?.GetLastData();\n            if (lastData == null)\n            {\n                return null;\n            }\n\n            var marginRequirementsHistory = LoadMarginRequirementsHistory(security.Symbol);\n            var date = lastData.Time.Date;\n\n            while (_marginCurrentIndex + 1 < marginRequirementsHistory.Length &&\n                marginRequirementsHistory[_marginCurrentIndex + 1].Date <= date)\n            {\n                _marginCurrentIndex++;\n            }\n\n            return marginRequirementsHistory[_marginCurrentIndex];\n        }\n\n        /// <summary>\n        /// Gets the sorted list of historical margin changes produced by reading in the margin requirements\n        /// data found in /Data/symbol-margin/\n        /// </summary>\n        /// <returns>Sorted list of historical margin changes</returns>\n        private static MarginRequirementsEntry[] LoadMarginRequirementsHistory(Symbol symbol)\n        {\n            if (!_marginRequirementsCache.TryGetValue(symbol.ID.Symbol, out var marginRequirementsEntries))\n            {\n                lock (_locker)\n                {\n                    if (!_marginRequirementsCache.TryGetValue(symbol.ID.Symbol, out marginRequirementsEntries))\n                    {\n                        Dictionary<string, MarginRequirementsEntry[]> marginRequirementsCache = new(_marginRequirementsCache)\n                        {\n                            [symbol.ID.Symbol] = marginRequirementsEntries = FromCsvFile(symbol)\n                        };\n                        // we change the reference so we can read without a lock\n                        _marginRequirementsCache = marginRequirementsCache;\n                    }\n                }\n            }\n            return marginRequirementsEntries;\n        }\n\n        /// <summary>\n        /// Reads margin requirements file and returns a sorted list of historical margin changes\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to fetch margin requirements for</param>\n        /// <returns>Sorted list of historical margin changes</returns>\n        private static MarginRequirementsEntry[] FromCsvFile(Symbol symbol)\n        {\n            var file = Path.Combine(Globals.DataFolder,\n                                    symbol.SecurityType.ToLower(),\n                                    symbol.ID.Market.ToLowerInvariant(),\n                                    \"margins\", symbol.ID.Symbol + \".csv\");\n\n            if(_dataProvider == null)\n            {\n                ClearMarginCache();\n                _dataProvider = Composer.Instance.GetPart<IDataProvider>();\n            }\n\n            // skip the first header line, also skip #'s as these are comment lines\n            var marginRequirementsEntries = _dataProvider.ReadLines(file)\n                .Where(x => !x.StartsWith(\"#\") && !string.IsNullOrWhiteSpace(x))\n                .Skip(1)\n                .Select(MarginRequirementsEntry.Create)\n                .OrderBy(x => x.Date)\n                .ToArray();\n\n            if (marginRequirementsEntries.Length == 0)\n            {\n                Log.Error($\"FutureMarginModel.FromCsvFile(): Unable to locate future margin requirements file. Defaulting to zero margin for this symbol. File: {file}\");\n\n                marginRequirementsEntries = new[] {\n                    new MarginRequirementsEntry\n                    {\n                        Date = DateTime.MinValue\n                    }\n                };\n            }\n            return marginRequirementsEntries;\n        }\n\n        /// <summary>\n        /// For live deployments we don't want to have stale margin requirements to we refresh them every day\n        /// </summary>\n        private static void ClearMarginCache()\n        {\n            Task.Delay(Time.OneDay).ContinueWith((_) =>\n            {\n                lock (_locker)\n                {\n                    _marginRequirementsCache = new();\n                }\n                ClearMarginCache();\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureSettlementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Settlement model which can handle daily profit and loss settlement\n    /// </summary>\n    public class FutureSettlementModel : ImmediateSettlementModel\n    {\n        private DateTime _lastSettlementDate;\n        private decimal _settledFutureQuantity;\n        private decimal _settlementPrice;\n\n        /// <summary>\n        /// Applies unsettledContractsTodaysProfit settlement rules\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        public override void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            if(_settledFutureQuantity != 0)\n            {\n                var fill = applyFundsParameters.Fill;\n                var security = applyFundsParameters.Security;\n                var futureHolding = (FutureHolding)security.Holdings;\n\n                var absoluteQuantityClosed = Math.Min(fill.AbsoluteFillQuantity, security.Holdings.AbsoluteQuantity);\n\n                var absoluteQuantityClosedSettled = Math.Min(absoluteQuantityClosed, Math.Abs(_settledFutureQuantity));\n                var quantityClosedSettled = Math.Sign(-fill.FillQuantity) * absoluteQuantityClosedSettled;\n\n                // reduce our settled future quantity proportionally too\n                var factor = quantityClosedSettled / _settledFutureQuantity;\n                _settledFutureQuantity -= quantityClosedSettled;\n\n                // the passed in cash amount will hold the complete profit/loss of the trade, so we need to substract the settled profit we were given or taken from\n                var removedSettledProfit = factor * futureHolding.SettledProfit;\n                futureHolding.SettledProfit -= removedSettledProfit;\n\n                applyFundsParameters.CashAmount = new CashAmount(applyFundsParameters.CashAmount.Amount - removedSettledProfit, applyFundsParameters.CashAmount.Currency);\n            }\n\n            base.ApplyFunds(applyFundsParameters);\n        }\n\n        /// <summary>\n        /// Scan for pending settlements\n        /// </summary>\n        /// <param name=\"settlementParameters\">The settlement parameters</param>\n        public override void Scan(ScanSettlementModelParameters settlementParameters)\n        {\n            var security = settlementParameters.Security;\n\n            // In the futures markets, losers pay winners every day. So once a day after the settlement time has passed we will update the cash book to reflect this\n            if (_lastSettlementDate.Date < security.LocalTime.Date)\n            {\n                if ((_lastSettlementDate != default) && security.Invested)\n                {\n                    var futureHolding = (FutureHolding)security.Holdings;\n                    var futureCache = (FutureCache)security.Cache;\n                    _settlementPrice = futureCache.SettlementPrice;\n                    _settledFutureQuantity = security.Holdings.Quantity;\n\n                    // We settled the daily P&L, losers pay winners\n                    var dailyProfitLoss = futureHolding.TotalCloseProfit(includeFees: false, exitPrice: _settlementPrice) - futureHolding.SettledProfit;\n                    if (dailyProfitLoss != 0)\n                    {\n                        futureHolding.SettledProfit += dailyProfitLoss;\n\n                        settlementParameters.Portfolio.CashBook[security.QuoteCurrency.Symbol].AddAmount(dailyProfitLoss);\n                        Log.Trace($\"FutureSettlementModel.Scan({security.Symbol}): {security.LocalTime} Daily P&L: {dailyProfitLoss} \" +\n                            $\"Quantity: {_settledFutureQuantity} Settlement: {_settlementPrice} UnrealizedProfit: {futureHolding.UnrealizedProfit}\");\n                    }\n                }\n                _lastSettlementDate = security.LocalTime.Date;\n            }\n        }\n\n        /// <summary>\n        /// Set the current datetime in terms of the exchange's local time zone\n        /// </summary>\n        /// <param name=\"newLocalTime\">Current local time</param>\n        public void SetLocalDateTimeFrontier(DateTime newLocalTime)\n        {\n            _lastSettlementDate = newLocalTime.Date;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FutureSymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Static class contains common utility methods specific to symbols representing the future contracts\n    /// </summary>\n    public static class FutureSymbol\n    {\n        /// <summary>\n        /// Determine if a given Futures contract is a standard contract.\n        /// </summary>\n        /// <param name=\"symbol\">Future symbol</param>\n        /// <returns>True if symbol expiration matches standard expiration</returns>\n        public static bool IsStandard(Symbol symbol)\n        {\n            var contractExpirationDate = symbol.ID.Date.Date;\n\n            try\n            {\n                // Use our FutureExpiryFunctions to determine standard contracts dates.\n                var expiryFunction = FuturesExpiryFunctions.FuturesExpiryFunction(symbol);\n                var contractMonth = FuturesExpiryUtilityFunctions.GetFutureContractMonth(symbol);\n\n                var standardExpirationDate = expiryFunction(contractMonth);\n\n                // Return true if the dates match\n                return contractExpirationDate == standardExpirationDate.Date;\n            }\n            catch\n            {\n                Log.Error($\"FutureSymbol.IsStandard(): Could not find standard date for {symbol}, will be classified as standard\");\n                return true;\n            }\n        }\n\n        /// <summary>\n        /// Returns true if the future contract is a weekly contract\n        /// </summary>\n        /// <param name=\"symbol\">Future symbol</param>\n        /// <returns>True if symbol is non-standard contract</returns>\n        public static bool IsWeekly(Symbol symbol)\n        {\n            return !IsStandard(symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/Futures.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Futures static class contains shortcut definitions of major futures contracts available for trading\n    /// </summary>\n    public static class Futures\n    {\n        /// <summary>\n        /// The maximum supported contract offset depth\n        /// </summary>\n        /// <remarks>Note this value is related to the continuous contract desired offset from the current front month.\n        /// For example, 0 (default) will use the front month, 1 will use the back month contract</remarks>\n        public static readonly int MaximumContractDepthOffset = 2;\n\n        /// <summary>\n        /// Grains and Oilseeds group\n        /// </summary>\n        public static class Grains\n        {\n            /// <summary>\n            /// Black Sea Corn Financially Settled (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BlackSeaCornFinanciallySettledPlatts = \"BCF\";\n\n            /// <summary>\n            /// Black Sea Wheat Financially Settled (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BlackSeaWheatFinanciallySettledPlatts = \"BWF\";\n\n            /// <summary>\n            /// Chicago SRW Wheat Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SRWWheat = \"ZW\";\n\n            /// <summary>\n            /// Default wheat contract is SRWWheat\n            /// </summary>\n            /// <returns>The SRW Wheat symbol</returns>\n            public const string Wheat = SRWWheat;\n\n            /// <summary>\n            /// KC HRW Wheat Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string HRWWheat = \"KE\";\n\n            /// <summary>\n            /// Corn Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Corn = \"ZC\";\n\n            /// <summary>\n            /// Soybeans Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Soybeans = \"ZS\";\n\n            /// <summary>\n            /// Soybean Meal Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SoybeanMeal = \"ZM\";\n\n            /// <summary>\n            /// Soybean Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SoybeanOil = \"ZL\";\n\n            /// <summary>\n            /// Oats Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Oats = \"ZO\";\n        }\n\n        /// <summary>\n        /// Currencies group\n        /// </summary>\n        public static class Currencies\n        {\n            /// <summary>\n            /// U.S. Dollar Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string USD = \"DX\";\n\n            /// <summary>\n            /// British Pound Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GBP = \"6B\";\n\n            /// <summary>\n            /// Canadian Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string CAD = \"6C\";\n\n            /// <summary>\n            /// Japanese Yen Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string JPY = \"6J\";\n\n            /// <summary>\n            /// Swiss Franc Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string CHF = \"6S\";\n\n            /// <summary>\n            /// Euro FX Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EUR = \"6E\";\n\n            /// <summary>\n            /// Australian Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string AUD = \"6A\";\n\n            /// <summary>\n            /// New Zealand Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NZD = \"6N\";\n\n            /// <summary>\n            /// Russian Ruble Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string RUB = \"6R\";\n\n            /// <summary>\n            /// Brazillian Real Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BRL = \"6L\";\n\n            /// <summary>\n            /// Mexican Peso Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MXN = \"6M\";\n\n            /// <summary>\n            /// South African Rand Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ZAR = \"6Z\";\n\n            /// <summary>\n            /// Australian Dollar/Canadian Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string AUDCAD = \"ACD\";\n\n            /// <summary>\n            /// Australian Dollar/Japanese Yen Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string AUDJPY = \"AJY\";\n\n            /// <summary>\n            /// Australian Dollar/New Zealand Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string AUDNZD = \"ANE\";\n\n            /// <summary>\n            /// Bitcoin Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BTC = \"BTC\";\n\n            /// <summary>\n            /// Ether Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ETH = \"ETH\";\n\n            /// <summary>\n            /// Canadian Dollar/Japanese Yen Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string CADJPY = \"CJY\";\n\n            /// <summary>\n            /// Standard-Size USD/Offshore RMB (CNH) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string StandardSizeUSDOffshoreRMBCNH = \"CNH\";\n\n            /// <summary>\n            /// E-mini Euro FX Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuroFXEmini = \"E7\";\n\n            /// <summary>\n            /// Euro/Australian Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EURAUD = \"EAD\";\n\n            /// <summary>\n            /// Euro/Canadian Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EURCAD = \"ECD\";\n\n            /// <summary>\n            /// Euro/Swedish Krona Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EURSEK = \"ESK\";\n\n            /// <summary>\n            /// E-mini Japanese Yen Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string JapaneseYenEmini = \"J7\";\n\n            /// <summary>\n            /// Micro EUR/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEUR = \"M6E\";\n\n            /// <summary>\n            /// Micro AUD/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroAUD = \"M6A\";\n\n            /// <summary>\n            /// Micro GBP/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroGBP = \"M6B\";\n\n            /// <summary>\n            /// Micro CAD/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCADUSD = \"MCD\";\n\n            /// <summary>\n            /// Micro JPY/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroJPY = \"MJY\";\n\n            /// <summary>\n            /// Micro CHF/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCHF = \"MSF\";\n\n            /// <summary>\n            /// Micro USD/JPY Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroUSDJPY = \"M6J\";\n\n            /// <summary>\n            /// Micro INR/USD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroINRUSD = \"MIR\";\n\n            /// <summary>\n            /// Micro USD/CAD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCAD = \"M6C\";\n\n            /// <summary>\n            /// Micro USD/CHF Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroUSDCHF = \"M6S\";\n\n            /// <summary>\n            /// Micro USD/CNH Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroUSDCNH = \"MNH\";\n\n            /// <summary>\n            /// Micro Ether Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEther = \"MET\";\n\n            /// <summary>\n            /// Micro Bitcoin Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroBTC = \"MBT\";\n\n            /// <summary>\n            /// BTIC on Micro Ether Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BTICMicroEther = \"MRB\";\n\n            /// <summary>\n            /// BTIC on Micro Bitcoin Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BTICMicroBTC = \"MIB\";\n        }\n\n        /// <summary>\n        /// Energy group\n        /// </summary>\n        [Obsolete(\"Futures.Energies is obsolete, please use Futures.Energy instead.\")]\n        public static class Energies\n        {\n            /// <summary>\n            /// Propane Non LDH Mont Belvieu (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PropaneNonLDHMontBelvieu = \"1S\";\n\n            /// <summary>\n            /// Argus Propane Far East Index BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndexBALMO = \"22\";\n\n            /// <summary>\n            /// Mini European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MiniEuropeanThreePointPercentFiveFuelOilBargesPlatts = \"A0D\";\n\n            /// <summary>\n            /// Mini Singapore Fuel Oil 180 cst (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MiniSingaporeFuelOil180CstPlatts = \"A0F\";\n\n            /// <summary>\n            /// Gulf Coast ULSD (Platts) Up-Down BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastULSDPlattsUpDownBALMO = \"A1L\";\n\n            /// <summary>\n            /// Gulf Coast Jet (Platts) Up-Down BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastJetPlattsUpDownBALMO = \"A1M\";\n\n            /// <summary>\n            /// Propane Non-LDH Mont Belvieu (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PropaneNonLDHMontBelvieuOPIS = \"A1R\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgusBALMO = \"A32\";\n\n            /// <summary>\n            /// Premium Unleaded Gasoline 10 ppm FOB MED (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PremiumUnleadedGasoline10ppmFOBMEDPlatts = \"A3G\";\n\n            /// <summary>\n            /// Argus Propane Far East Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndex = \"A7E\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) Crack Spread BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgusCrackSpreadBALMO = \"A7I\";\n\n            /// <summary>\n            /// Mont Belvieu Natural Gasoline (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNaturalGasolineOPIS = \"A7Q\";\n\n            /// <summary>\n            /// Mont Belvieu Normal Butane (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNormalButaneOPISBALMO = \"A8J\";\n\n            /// <summary>\n            /// Conway Propane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ConwayPropaneOPIS = \"A8K\";\n\n            /// <summary>\n            /// Mont Belvieu LDH Propane (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuLDHPropaneOPISBALMO = \"A8O\";\n\n            /// <summary>\n            /// Argus Propane Far East Index vs. European Propane CIF ARA (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndexVsEuropeanPropaneCIFARAArgus = \"A91\";\n\n            /// <summary>\n            /// Argus Propane (Saudi Aramco) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneSaudiAramco = \"A9N\";\n\n            /// <summary>\n            /// Group Three ULSD (Platts) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GroupThreeULSDPlattsVsNYHarborULSD = \"AA6\";\n\n            /// <summary>\n            /// Group Three Sub-octane Gasoliine (Platts) vs. RBOB Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GroupThreeSuboctaneGasolinePlattsVsRBOB = \"AA8\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 180 cst (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil180cstPlattsBALMO = \"ABS\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 380 cst (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil380cstPlattsBALMO = \"ABT\";\n\n            /// <summary>\n            /// Mont Belvieu Ethane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuEthaneOPIS = \"AC0\";\n\n            /// <summary>\n            /// Mont Belvieu Normal Butane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNormalButaneOPIS = \"AD0\";\n\n            /// <summary>\n            /// Brent Crude Oil vs. Dubai Crude Oil (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentCrudeOilVsDubaiCrudeOilPlatts = \"ADB\";\n\n            /// <summary>\n            /// Argus LLS vs. WTI (Argus) Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusLLSvsWTIArgusTradeMonth = \"AE5\";\n\n            /// <summary>\n            /// Singapore Gasoil (Platts) vs. Low Sulphur Gasoil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeGasoilPlattsVsLowSulphurGasoilFutures = \"AGA\";\n\n            /// <summary>\n            /// Los Angeles CARBOB Gasoline (OPIS) vs. RBOB Gasoline Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesCARBOBGasolineOPISvsRBOBGasoline = \"AJL\";\n\n            /// <summary>\n            /// Los Angeles Jet (OPIS) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesJetOPISvsNYHarborULSD = \"AJS\";\n\n            /// <summary>\n            /// Los Angeles CARB Diesel (OPIS) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesCARBDieselOPISvsNYHarborULSD = \"AKL\";\n\n            /// <summary>\n            /// European Naphtha (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanNaphthaPlattsBALMO = \"AKZ\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgus = \"APS\";\n\n            /// <summary>\n            /// Mont Belvieu Natural Gasoline (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNaturalGasolineOPISBALMO = \"AR0\";\n\n            /// <summary>\n            /// RBOB Gasoline Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string RBOBGasolineCrackSpread = \"ARE\";\n\n            /// <summary>\n            /// Gulf Coast HSFO (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastHSFOPlattsBALMO = \"AVZ\";\n\n            /// <summary>\n            /// Mars (Argus) vs. WTI Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MarsArgusVsWTITradeMonth = \"AYV\";\n\n            /// <summary>\n            /// Mars (Argus) vs. WTI Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MarsArgusVsWTIFinancial = \"AYX\";\n\n            /// <summary>\n            /// Ethanol T2 FOB Rdam Including Duty (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EthanolT2FOBRdamIncludingDutyPlatts = \"AZ1\";\n\n            /// <summary>\n            /// Mont Belvieu LDH Propane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuLDHPropaneOPIS = \"B0\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgus = \"B7H\";\n\n            /// <summary>\n            /// WTI-Brent Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIBrentFinancial = \"BK\";\n\n            /// <summary>\n            /// 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread (1000mt) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mt = \"BOO\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgusBALMO = \"BR7\";\n\n            /// <summary>\n            /// Brent Last Day Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentLastDayFinancial = \"BZ\";\n\n            /// <summary>\n            /// Crude Oil WTI Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string CrudeOilWTI = \"CL\";\n\n            /// <summary>\n            /// Gulf Coast CBOB Gasoline A2 (Platts) vs. RBOB Gasoline Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastCBOBGasolineA2PlattsVsRBOBGasoline = \"CRB\";\n\n            /// <summary>\n            /// WTI Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIFinancial = \"CSX\";\n\n            /// <summary>\n            /// Chicago Ethaanol (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ChicagoEthanolPlatts = \"CU\";\n\n            /// <summary>\n            /// Singapore Mogas 92 Unleaded (Platts) Brent Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeMogas92UnleadedPlattsBrentCrackSpread = \"D1N\";\n\n            /// <summary>\n            /// Dubai Crude Oil (Platts) Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string DubaiCrudeOilPlattsFinancial = \"DCB\";\n\n            /// <summary>\n            /// Japan C&amp;F Naphtha (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string JapanCnFNaphthaPlattsBALMO = \"E6\";\n\n            /// <summary>\n            /// Ethanol Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Ethanol = \"EH\";\n\n            /// <summary>\n            /// European Naphtha (Platts) Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanNaphthaPlattsCrackSpread = \"EN\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) vs. Naphtha Cargoes CIF NWE (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlatts = \"EPN\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 380 cst (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"EVC\";\n\n            /// <summary>\n            /// East-West Gasoline Spread (Platts-Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EastWestGasolineSpreadPlattsArgus = \"EWG\";\n\n            /// <summary>\n            /// East-West Naphtha: Japan C&amp;F vs. Cargoes CIF NWE Spread (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlatts = \"EWN\";\n\n            /// <summary>\n            /// RBOB Gasoline vs. Euro-bob Oxy NWE Barges (Argus) (350,000 gallons) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallons = \"EXR\";\n\n            /// <summary>\n            /// 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread = \"FO\";\n\n            /// <summary>\n            /// Freight Route TC14 (Baltic) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FreightRouteTC14Baltic = \"FRC\";\n\n            /// <summary>\n            /// 1% Fuel Oil Cargoes FOB NWE (Platts) vs. 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"FSS\";\n\n            /// <summary>\n            /// Gulf Coast HSFO (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            public const string GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"GCU\";\n\n            /// <summary>\n            /// WTI Houston Crude Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIHoustonCrudeOil = \"HCL\";\n\n            /// <summary>\n            /// Natural Gas (Henry Hub) Last-day Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGasHenryHubLastDayFinancial = \"HH\";\n\n            /// <summary>\n            /// Heating Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string HeatingOil = \"HO\";\n\n            /// <summary>\n            /// Natural Gas (Henry Hub) Penultimate Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGasHenryHubPenultimateFinancial = \"HP\";\n\n            /// <summary>\n            /// WTI Houston (Argus) vs. WTI Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIHoustonArgusVsWTITradeMonth = \"HTT\";\n\n            /// <summary>\n            /// Gasoline RBOB Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Gasoline = \"RB\";\n\n            /// <summary>\n            /// Natural Gas Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGas = \"NG\";\n\n            /// <summary>\n            /// Brent Crude Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentCrude = \"B\";\n\n            /// <summary>\n            /// Low Sulfur Gasoil\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LowSulfurGasoil = \"G\";\n\n            /// <summary>\n            /// Micro WTI Crude Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCrudeOilWTI = \"MCL\";\n\n            /// <summary>\n            /// Micro Singapore FOB Marine Fuel 0.5% (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts = \"S5O\";\n\n            /// <summary>\n            /// Micro Gasoil 0.1% Barges FOB ARA (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroGasoilZeroPointOnePercentBargesFOBARAPlatts = \"M1B\";\n\n            /// <summary>\n            /// Micro European FOB Rdam Marine Fuel 0.5% Barges (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts = \"R5O\";\n\n            /// <summary>\n            /// Micro European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts = \"MEF\";\n\n            /// <summary>\n            /// Micro Singapore Fuel Oil 380CST (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSingaporeFuelOil380CSTPlatts = \"MAF\";\n\n            /// <summary>\n            /// Micro Coal (API 5) fob Newcastle (Argus/McCloskey) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCoalAPIFivefobNewcastleArgusMcCloskey = \"M5F\";\n\n            /// <summary>\n            /// Micro European 3.5% Fuel Oil Cargoes FOB Med (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts = \"M35\";\n        }\n\n        /// <summary>\n        /// Energy group\n        /// </summary>\n        public static class Energy\n        {\n            /// <summary>\n            /// Propane Non LDH Mont Belvieu (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PropaneNonLDHMontBelvieu = \"1S\";\n\n            /// <summary>\n            /// Argus Propane Far East Index BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndexBALMO = \"22\";\n\n            /// <summary>\n            /// Mini European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MiniEuropeanThreePointPercentFiveFuelOilBargesPlatts = \"A0D\";\n\n            /// <summary>\n            /// Mini Singapore Fuel Oil 180 cst (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MiniSingaporeFuelOil180CstPlatts = \"A0F\";\n\n            /// <summary>\n            /// Gulf Coast ULSD (Platts) Up-Down BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastULSDPlattsUpDownBALMO = \"A1L\";\n\n            /// <summary>\n            /// Gulf Coast Jet (Platts) Up-Down BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastJetPlattsUpDownBALMO = \"A1M\";\n\n            /// <summary>\n            /// Propane Non-LDH Mont Belvieu (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PropaneNonLDHMontBelvieuOPIS = \"A1R\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgusBALMO = \"A32\";\n\n            /// <summary>\n            /// Premium Unleaded Gasoline 10 ppm FOB MED (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string PremiumUnleadedGasoline10ppmFOBMEDPlatts = \"A3G\";\n\n            /// <summary>\n            /// Argus Propane Far East Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndex = \"A7E\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) Crack Spread BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgusCrackSpreadBALMO = \"A7I\";\n\n            /// <summary>\n            /// Mont Belvieu Natural Gasoline (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNaturalGasolineOPIS = \"A7Q\";\n\n            /// <summary>\n            /// Mont Belvieu Normal Butane (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNormalButaneOPISBALMO = \"A8J\";\n\n            /// <summary>\n            /// Conway Propane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ConwayPropaneOPIS = \"A8K\";\n\n            /// <summary>\n            /// Mont Belvieu LDH Propane (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuLDHPropaneOPISBALMO = \"A8O\";\n\n            /// <summary>\n            /// Argus Propane Far East Index vs. European Propane CIF ARA (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneFarEastIndexVsEuropeanPropaneCIFARAArgus = \"A91\";\n\n            /// <summary>\n            /// Argus Propane (Saudi Aramco) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusPropaneSaudiAramco = \"A9N\";\n\n            /// <summary>\n            /// Group Three ULSD (Platts) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GroupThreeULSDPlattsVsNYHarborULSD = \"AA6\";\n\n            /// <summary>\n            /// Group Three Sub-octane Gasoliine (Platts) vs. RBOB Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GroupThreeSuboctaneGasolinePlattsVsRBOB = \"AA8\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 180 cst (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil180cstPlattsBALMO = \"ABS\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 380 cst (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil380cstPlattsBALMO = \"ABT\";\n\n            /// <summary>\n            /// Mont Belvieu Ethane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuEthaneOPIS = \"AC0\";\n\n            /// <summary>\n            /// Mont Belvieu Normal Butane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNormalButaneOPIS = \"AD0\";\n\n            /// <summary>\n            /// Brent Crude Oil vs. Dubai Crude Oil (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentCrudeOilVsDubaiCrudeOilPlatts = \"ADB\";\n\n            /// <summary>\n            /// Argus LLS vs. WTI (Argus) Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ArgusLLSvsWTIArgusTradeMonth = \"AE5\";\n\n            /// <summary>\n            /// Singapore Gasoil (Platts) vs. Low Sulphur Gasoil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeGasoilPlattsVsLowSulphurGasoilFutures = \"AGA\";\n\n            /// <summary>\n            /// Los Angeles CARBOB Gasoline (OPIS) vs. RBOB Gasoline Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesCARBOBGasolineOPISvsRBOBGasoline = \"AJL\";\n\n            /// <summary>\n            /// Los Angeles Jet (OPIS) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesJetOPISvsNYHarborULSD = \"AJS\";\n\n            /// <summary>\n            /// Los Angeles CARB Diesel (OPIS) vs. NY Harbor ULSD Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LosAngelesCARBDieselOPISvsNYHarborULSD = \"AKL\";\n\n            /// <summary>\n            /// European Naphtha (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanNaphthaPlattsBALMO = \"AKZ\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgus = \"APS\";\n\n            /// <summary>\n            /// Mont Belvieu Natural Gasoline (OPIS) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuNaturalGasolineOPISBALMO = \"AR0\";\n\n            /// <summary>\n            /// RBOB Gasoline Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string RBOBGasolineCrackSpread = \"ARE\";\n\n            /// <summary>\n            /// Gulf Coast HSFO (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastHSFOPlattsBALMO = \"AVZ\";\n\n            /// <summary>\n            /// Mars (Argus) vs. WTI Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MarsArgusVsWTITradeMonth = \"AYV\";\n\n            /// <summary>\n            /// Mars (Argus) vs. WTI Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MarsArgusVsWTIFinancial = \"AYX\";\n\n            /// <summary>\n            /// Ethanol T2 FOB Rdam Including Duty (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EthanolT2FOBRdamIncludingDutyPlatts = \"AZ1\";\n\n            /// <summary>\n            /// Mont Belvieu LDH Propane (OPIS) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MontBelvieuLDHPropaneOPIS = \"B0\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgus = \"B7H\";\n\n            /// <summary>\n            /// WTI-Brent Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIBrentFinancial = \"BK\";\n\n            /// <summary>\n            /// 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread (1000mt) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mt = \"BOO\";\n\n            /// <summary>\n            /// Gasoline Euro-bob Oxy NWE Barges (Argus) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GasolineEurobobOxyNWEBargesArgusBALMO = \"BR7\";\n\n            /// <summary>\n            /// Brent Last Day Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentLastDayFinancial = \"BZ\";\n\n            /// <summary>\n            /// Crude Oil WTI Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string CrudeOilWTI = \"CL\";\n\n            /// <summary>\n            /// Gulf Coast CBOB Gasoline A2 (Platts) vs. RBOB Gasoline Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string GulfCoastCBOBGasolineA2PlattsVsRBOBGasoline = \"CRB\";\n\n            /// <summary>\n            /// WTI Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIFinancial = \"CSX\";\n\n            /// <summary>\n            /// Chicago Ethaanol (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ChicagoEthanolPlatts = \"CU\";\n\n            /// <summary>\n            /// Singapore Mogas 92 Unleaded (Platts) Brent Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeMogas92UnleadedPlattsBrentCrackSpread = \"D1N\";\n\n            /// <summary>\n            /// Dubai Crude Oil (Platts) Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string DubaiCrudeOilPlattsFinancial = \"DCB\";\n\n            /// <summary>\n            /// Japan C&amp;F Naphtha (Platts) BALMO Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string JapanCnFNaphthaPlattsBALMO = \"E6\";\n\n            /// <summary>\n            /// Ethanol Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Ethanol = \"EH\";\n\n            /// <summary>\n            /// European Naphtha (Platts) Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanNaphthaPlattsCrackSpread = \"EN\";\n\n            /// <summary>\n            /// European Propane CIF ARA (Argus) vs. Naphtha Cargoes CIF NWE (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlatts = \"EPN\";\n\n            /// <summary>\n            /// Singapore Fuel Oil 380 cst (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"EVC\";\n\n            /// <summary>\n            /// East-West Gasoline Spread (Platts-Argus) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EastWestGasolineSpreadPlattsArgus = \"EWG\";\n\n            /// <summary>\n            /// East-West Naphtha: Japan C&amp;F vs. Cargoes CIF NWE Spread (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlatts = \"EWN\";\n\n            /// <summary>\n            /// RBOB Gasoline vs. Euro-bob Oxy NWE Barges (Argus) (350,000 gallons) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallons = \"EXR\";\n\n            /// <summary>\n            /// 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread = \"FO\";\n\n            /// <summary>\n            /// Freight Route TC14 (Baltic) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FreightRouteTC14Baltic = \"FRC\";\n\n            /// <summary>\n            /// 1% Fuel Oil Cargoes FOB NWE (Platts) vs. 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"FSS\";\n\n            /// <summary>\n            /// Gulf Coast HSFO (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            public const string GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts = \"GCU\";\n\n            /// <summary>\n            /// WTI Houston Crude Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIHoustonCrudeOil = \"HCL\";\n\n            /// <summary>\n            /// Natural Gas (Henry Hub) Last-day Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGasHenryHubLastDayFinancial = \"HH\";\n\n            /// <summary>\n            /// Heating Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string HeatingOil = \"HO\";\n\n            /// <summary>\n            /// Natural Gas (Henry Hub) Penultimate Financial Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGasHenryHubPenultimateFinancial = \"HP\";\n\n            /// <summary>\n            /// WTI Houston (Argus) vs. WTI Trade Month Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string WTIHoustonArgusVsWTITradeMonth = \"HTT\";\n\n            /// <summary>\n            /// Gasoline RBOB Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Gasoline = \"RB\";\n\n            /// <summary>\n            /// Natural Gas Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NaturalGas = \"NG\";\n\n            /// <summary>\n            /// Brent Crude Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BrentCrude = \"B\";\n\n            /// <summary>\n            /// Low Sulfur Gasoil\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LowSulfurGasoil = \"G\";\n\n            /// <summary>\n            /// Micro WTI Crude Oil Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCrudeOilWTI = \"MCL\";\n\n            /// <summary>\n            /// Micro Singapore FOB Marine Fuel 0.5% (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts = \"S5O\";\n\n            /// <summary>\n            /// Micro Gasoil 0.1% Barges FOB ARA (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroGasoilZeroPointOnePercentBargesFOBARAPlatts = \"M1B\";\n\n            /// <summary>\n            /// Micro European FOB Rdam Marine Fuel 0.5% Barges (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts = \"R5O\";\n\n            /// <summary>\n            /// Micro European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts = \"MEF\";\n\n            /// <summary>\n            /// Micro Singapore Fuel Oil 380CST (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSingaporeFuelOil380CSTPlatts = \"MAF\";\n\n            /// <summary>\n            /// Micro Coal (API 5) fob Newcastle (Argus/McCloskey) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroCoalAPIFivefobNewcastleArgusMcCloskey = \"M5F\";\n\n            /// <summary>\n            /// Micro European 3.5% Fuel Oil Cargoes FOB Med (Platts) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts = \"M35\";\n        }\n\n        /// <summary>\n        /// Financials group\n        /// </summary>\n        public static class Financials\n        {\n            /// <summary>\n            /// 30Y U.S. Treasury Bond Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Y30TreasuryBond = \"ZB\";\n\n            /// <summary>\n            /// 10Y U.S. Treasury Note Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Y10TreasuryNote = \"ZN\";\n\n            /// <summary>\n            /// 5Y U.S. Treasury Note Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Y5TreasuryNote = \"ZF\";\n\n            /// <summary>\n            /// 2Y U.S. Treasury Note Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Y2TreasuryNote = \"ZT\";\n\n            /// <summary>\n            /// EuroDollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuroDollar = \"GE\";\n\n            /// <summary>\n            /// 5-Year USD MAC Swap Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FiveYearUSDMACSwap = \"F1U\";\n\n            /// <summary>\n            /// Ultra U.S. Treasury Bond Futures\n            /// </summary>\n            public const string UltraUSTreasuryBond = \"UB\";\n\n            /// <summary>\n            /// Ultra 10-Year U.S. Treasury Note Futures\n            /// </summary>\n            public const string UltraTenYearUSTreasuryNote = \"TN\";\n\n            /// <summary>\n            /// Micro 10-Year Yield Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroY10TreasuryNote = \"10Y\";\n\n            /// <summary>\n            /// Micro 30-Year Yield Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroY30TreasuryBond = \"30Y\";\n\n            /// <summary>\n            /// Micro 2-Year Yield Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroY2TreasuryBond = \"2YY\";\n\n            /// <summary>\n            /// Micro 5-Year Yield Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroY5TreasuryBond = \"5YY\";\n        }\n\n        /// <summary>\n        /// Indices group\n        /// </summary>\n        public static class Indices\n        {\n            /// <summary>\n            /// E-mini S&amp;P 500 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SP500EMini = \"ES\";\n\n            /// <summary>\n            /// E-mini NASDAQ 100 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NASDAQ100EMini = \"NQ\";\n\n            /// <summary>\n            /// E-mini Dow Indu 30 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Dow30EMini = \"YM\";\n\n            /// <summary>\n            /// CBOE Volatility Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string VIX = \"VX\";\n\n            /// <summary>\n            /// E-mini Russell 2000 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Russell2000EMini = \"RTY\";\n\n            /// <summary>\n            /// Nikkei-225 Dollar Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Nikkei225Dollar = \"NKD\";\n\n            /// <summary>\n            /// Nikkei-225 Yen denominated Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Nikkei225YenCME = \"NIY\";\n\n\n            /// <summary>\n            /// E-mini Nikkei 225 Yen denominated Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Nikkei225YenEMini = \"ENY\";\n\n            /// <summary>\n            /// E-MINI FTSE China 50 Index Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FTSEChina50EMini = \"FT5\";\n\n            /// <summary>\n            /// E-mini FTSE 100 Index (GBP) Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FTSE100EMini = \"FT1\";\n\n            #pragma warning disable CS1570\n            /// <summary>\n            /// E-MINI S&P EUROPE 350 ESG Index Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SPEurop350ESGEMini = \"E3G\";\n            #pragma warning restore CS1570\n\n            /// <summary>\n            /// E-MINI USD Denominated FTSE 100 Index Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FTSE100USDEMini = \"FTU\";\n\n            /// <summary>\n            /// USD Denominated Topix Index Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string TOPIXUSD = \"TPD\";\n\n            /// <summary>\n            /// YEN Denominated Topix Index Futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string TOPIXYEN = \"TPY\";\n\n            /// <summary>\n            /// Dow Jones Real Estate futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string DowJonesRealEstate = \"RX\";\n\n            /// <summary>\n            /// E-mini SP500 ESG futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SP500EMiniESG = \"ESG\";\n\n            /// <summary>\n            /// E-mini Russell 1000 futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Russell1000EMini = \"RS1\";\n\n            #pragma warning disable CS1570\n            /// <summary>\n            /// S&P 500 Annual dividend index futures on CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SP500AnnualDividendIndex = \"SDA\";\n            #pragma warning restore CS1570\n\n            /// <summary>\n            /// Bloomberg Commodity Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BloombergCommodityIndex = \"AW\";\n\n            /// <summary>\n            /// E-mini Nasdaq-100 Biotechnology Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string NASDAQ100BiotechnologyEMini = \"BIO\";\n\n            /// <summary>\n            /// E-mini FTSE Emerging Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FTSEEmergingEmini = \"EI\";\n\n            /// <summary>\n            /// E-mini S&amp;P MidCap 400 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SP400MidCapEmini = \"EMD\";\n\n            /// <summary>\n            /// S&amp;P-GSCI Commodity Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string SPGSCICommodity = \"GD\";\n\n            /// <summary>\n            /// USD-Denominated Ibovespa Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string USDDenominatedIbovespa = \"IBV\";\n\n            /// <summary>\n            /// USD-Denominated MSCI Taiwan Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MSCITaiwanIndex = \"TW\";\n\n            /// <summary>\n            /// Nikkei-225 Yen denominated Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Nikkei225Yen = \"NK\";\n\n            /// <summary>\n            /// NSE Nifty50 Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Nifty50 = \"NIFTY\";\n\n            /// <summary>\n            /// NSE BankNifty Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BankNifty = \"BANKNIFTY\";\n\n            /// <summary>\n            /// S&amp;P BSE Sensex Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string BseSensex = \"SENSEX\";\n\n            /// <summary>\n            /// Hang Seng Index\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string HangSeng = \"HSI\";\n\n            /// <summary>\n            /// Micro E-mini S&amp;P 500 Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSP500EMini = \"MES\";\n\n            /// <summary>\n            /// Micro E-mini Nasdaq-100 Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroNASDAQ100EMini = \"MNQ\";\n\n            /// <summary>\n            /// Micro E-mini Russell 2000 Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroRussell2000EMini = \"M2K\";\n\n            /// <summary>\n            /// Micro E-mini Dow Jones Industrial Average Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroDow30EMini = \"MYM\";\n\n            /// <summary>\n            /// MSCI Europe Net Total Return (USD) Futures\n            /// </summary>\n            public const string MSCIEuropeNTR = \"M1EU\";\n\n            /// <summary>\n            /// MSCI Japan Net Total Return Futures\n            /// </summary>\n            public const string MSCIJapanNTR = \"M1JP\";\n\n            /// <summary>\n            /// MSCI Emerging Markets Asia Net Total Return Futures\n            /// </summary>\n            public const string MSCIEmergingMarketsAsiaNTR = \"M1MSA\";\n\n            /// <summary>\n            /// MSCI EAFE Index Futures\n            /// </summary>\n            public const string MSCIEafeIndex = \"MXEA\";\n\n            /// <summary>\n            /// MSCI Emerging Markets Index Futures\n            /// </summary>\n            public const string MSCIEmergingMarketsIndex = \"MXEF\";\n\n            /// <summary>\n            /// MSCI USA Index Futures\n            /// </summary>\n            public const string MSCIUsaIndex = \"MXUS\";\n\n            /// <summary>\n            /// Euro Stoxx 50 Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string EuroStoxx50 = \"FESX\";\n\n            /// <summary>\n            /// DAX Futures\n            /// </summary>\n            public const string DAX = \"FDAX\";\n\n            /// <summary>\n            /// DAX50 Futures\n            /// </summary>\n            public const string DAX50 = \"FSDX\";\n\n            /// <summary>\n            /// Div DAX futureFutures\n            /// </summary>\n            public const string DivDAX = \"FDIV\";\n\n            /// <summary>\n            /// Micro DAX Futures\n            /// </summary>\n            public const string DAXMicro = \"FDXS\";\n\n            /// <summary>\n            /// Mini DAX Futures\n            /// </summary>\n            public const string DAXMini = \"FDXM\";\n\n            /// <summary>\n            /// Mini MDAX Futures\n            /// </summary>\n            public const string MDAXMini = \"FSMX\";\n\n            /// <summary>\n            /// TecDAX Futures\n            /// </summary>\n            public const string TecDAX = \"FTDX\";\n        }\n\n        /// <summary>\n        /// Forestry group\n        /// </summary>\n        public static class Forestry\n        {\n            /// <summary>\n            /// Random Length Lumber Futures\n            /// </summary>\n            public const string RandomLengthLumber = \"LBS\";\n\n            /// <summary>\n            /// Lumber Futures\n            /// </summary>\n            public const string Lumber = \"LBR\";\n        }\n\n        /// <summary>\n        /// Meats group\n        /// </summary>\n        public static class Meats\n        {\n            /// <summary>\n            /// Live Cattle Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LiveCattle = \"LE\";\n\n            /// <summary>\n            /// Feeder Cattle Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string FeederCattle = \"GF\";\n\n            /// <summary>\n            /// Lean Hogs Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string LeanHogs = \"HE\";\n        }\n\n        /// <summary>\n        /// Metals group\n        /// </summary>\n        public static class Metals\n        {\n            /// <summary>\n            /// Gold Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Gold = \"GC\";\n\n            /// <summary>\n            /// Silver Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Silver = \"SI\";\n\n            /// <summary>\n            /// Platinum Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Platinum = \"PL\";\n\n            /// <summary>\n            /// Palladium Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Palladium = \"PA\";\n\n            /// <summary>\n            /// Aluminum MW U.S. Transaction Premium Platts (25MT) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string AluminumMWUSTransactionPremiumPlatts25MT = \"AUP\";\n\n            /// <summary>\n            /// Aluminium European Premium Duty-Paid (Metal Bulletin) Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            /// <remarks>This symbol spells element Al using European spelling</remarks>\n            public const string AluminiumEuropeanPremiumDutyPaidMetalBulletin = \"EDP\";\n\n            /// <summary>\n            /// Copper Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Copper = \"HG\";\n\n            /// <summary>\n            /// U.S. Midwest Domestic Hot-Rolled Coil Steel (CRU) Index Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string USMidwestDomesticHotRolledCoilSteelCRUIndex = \"HRC\";\n\n            /// <summary>\n            /// Micro Gold Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroGold = \"MGC\";\n\n            /// <summary>\n            /// Micro Silver Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroSilver = \"SIL\";\n\n            /// <summary>\n            /// Micro Gold TAS Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroGoldTAS = \"MGT\";\n\n            /// <summary>\n            /// Micro Palladium Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string MicroPalladium = \"PAM\";\n\n            /// <summary>\n            /// Mini Sized NY Gold Futures\n            /// </summary>\n            public const string MiniNYGold = \"YG\";\n\n            /// <summary>\n            /// Mini Sized NY Silver Futures\n            /// </summary>\n            public const string MiniNYSilver = \"YI\";\n\n            /// <summary>\n            /// Gold 100 Oz Futures\n            /// </summary>\n            public const string Gold100Oz = \"ZG\";\n\n            /// <summary>\n            /// Silver 5000 Oz Futures\n            /// </summary>\n            public const string Silver5000Oz = \"ZI\";\n        }\n\n        /// <summary>\n        /// Softs group\n        /// </summary>\n        public static class Softs\n        {\n            /// <summary>\n            /// Cotton #2 Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Cotton2 = \"CT\";\n\n            /// <summary>\n            /// Orange Juice Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string OrangeJuice = \"OJ\";\n\n            /// <summary>\n            /// Coffee C Arabica Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Coffee = \"KC\";\n\n            /// <summary>\n            /// Sugar #11 Futures ICE\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Sugar11 = \"SB\";\n\n            /// <summary>\n            /// Sugar #11 Futures CME\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Sugar11CME = \"YO\";\n\n            /// <summary>\n            /// Cocoa Futures\n            /// </summary>\n            /// <returns>The symbol</returns>\n            public const string Cocoa = \"CC\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FuturesExpiryFunctions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Calculate the date of a futures expiry given an expiry month and year\n    /// </summary>\n    public class FuturesExpiryFunctions\n    {\n        /// <summary>\n        /// Method to retrieve the Function for a specific future symbol\n        /// </summary>\n        public static Func<DateTime, DateTime> FuturesExpiryFunction(Symbol symbol)\n        {\n            Func<DateTime, DateTime> result;\n            if (FuturesExpiryDictionary.TryGetValue(symbol.Canonical, out result))\n            {\n                return result;\n            }\n\n            // If the function cannot be found, throw an exception as it hasn't yet been implemented\n            throw new ArgumentException($\"Expiry function not implemented for {symbol} in FuturesExpiryFunctions.FuturesExpiryDictionary\");\n        }\n\n        /// <summary>\n        /// Dictionary of the Functions that calculates the expiry for a given year and month.\n        /// It does not matter what the day and time of day are passed into the Functions.\n        /// The Functions is responsible for calculating the day and time of day given a year and month\n        /// </summary>\n        public static readonly Dictionary<Symbol, Func<DateTime, DateTime>> FuturesExpiryDictionary = new Dictionary<Symbol, Func<DateTime, DateTime>>()\n        {\n            // Metals\n            // Gold (GC): http://www.cmegroup.com/trading/metals/precious/gold_contract_specifications.html\n            {Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the delivery month.\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.Gold;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time,3, holidays);\n                })\n            },\n            // Silver (SI): http://www.cmegroup.com/trading/metals/precious/silver_contract_specifications.html\n            {Symbol.Create(Futures.Metals.Silver, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the delivery month.\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.Silver;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time,3, holidays);\n                })\n            },\n            // Platinum (PL): http://www.cmegroup.com/trading/metals/precious/platinum_contract_specifications.html\n            {Symbol.Create(Futures.Metals.Platinum, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the delivery month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Metals.Platinum;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time,3, holidays);\n                })\n            },\n            // Palladium (PA): http://www.cmegroup.com/trading/metals/precious/palladium_contract_specifications.html\n            {Symbol.Create(Futures.Metals.Palladium, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the delivery month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Metals.Palladium;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time,3, holidays);\n                })\n            },\n            // Aluminum MW U.S. Transaction Premium Platts (25MT) (AUP): https://www.cmegroup.com/trading/metals/base/aluminum-mw-us-transaction-premium-platts-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Metals.AluminumMWUSTransactionPremiumPlatts25MT, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.AluminumMWUSTransactionPremiumPlatts25MT;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Aluminium European Premium Duty-Paid (Metal Bulletin) (EDP): https://www.cmegroup.com/trading/metals/base/aluminium-european-premium-duty-paid-metal-bulletin_contract_specifications.html\n            {Symbol.Create(Futures.Metals.AluminiumEuropeanPremiumDutyPaidMetalBulletin, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.AluminiumEuropeanPremiumDutyPaidMetalBulletin;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Copper (HG): https://www.cmegroup.com/trading/metals/base/copper_contract_specifications.html\n            {Symbol.Create(Futures.Metals.Copper, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.Copper;\n                    // Monthly contracts\n                    // Trading terminates at 12:00 Noon CT on the third last business day of the contract month.\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays).Add(new TimeSpan(17, 0, 0));\n                })\n            },\n            // U.S. Midwest Domestic Hot-Rolled Coil Steel (CRU) Index (HRC): https://www.cmegroup.com/trading/metals/ferrous/hrc-steel_contract_specifications.html\n            {Symbol.Create(Futures.Metals.USMidwestDomesticHotRolledCoilSteelCRUIndex, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Metals.USMidwestDomesticHotRolledCoilSteelCRUIndex;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the business day prior to the last Wednesday of the named contract month.\n                    var lastWednesday = (from dateRange in Enumerable.Range(1, DateTime.DaysInMonth(time.Year, time.Month))\n                                         where new DateTime(time.Year, time.Month, dateRange).DayOfWeek == DayOfWeek.Wednesday\n                                         select new DateTime(time.Year, time.Month, dateRange)).Last();\n\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(lastWednesday, -1, holidays);\n                })\n            },\n            // Indices\n            // SP500EMini (ES): http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contract_specifications.html\n            {Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar/3, Jun/6 , Sep/9 , Dec/12) listed for 9 consecutive quarters and 3 additional December contract months.\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // EuroStoxx50 (FESX): https://www.xetra.com/resource/blob/63488/437afcd347fb020377873dd1ceac10ba/EURO-STOXX-50-Factsheet-data.pdf\n            {Symbol.Create(Futures.Indices.EuroStoxx50, SecurityType.Future, Market.EUREX), (time =>\n                {\n                    // Quarterly contracts (Mar/3, Jun/6 , Sep/9 , Dec/12) listed for 9 consecutive quarters and 3 additional December contract months.\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(Market.EUREX, Futures.Indices.EuroStoxx50);\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // DAX (FDAX): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.DAX, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.DAX)\n            },\n            // DAX50 (DAX50): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.DAX50, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.DAX50)\n            },\n            // DivDAX (FDIV): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.DivDAX, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.DivDAX)\n            },\n            // Micro DAX (FDXS): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.DAXMicro, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.DAXMicro)\n            },\n            // Mini DAX (FDXM): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.DAXMini, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.DAXMini)\n            },\n            // Mini MDAX (FSMX): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.MDAXMini, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.MDAXMini)\n            },\n            // TexDAX (FTDX): https://www.eurex.com/ex-en/markets/idx/dax/DAX-Futures-139902\n            {Symbol.Create(Futures.Indices.TecDAX, SecurityType.Future, Market.EUREX),\n                GetDAXFuturesExpiry(Market.EUREX, Futures.Indices.TecDAX)\n            },\n            // NASDAQ100EMini (NQ): http://www.cmegroup.com/trading/equity-index/us-index/e-mini-nasdaq-100_contract_specifications.html\n            {Symbol.Create(Futures.Indices.NASDAQ100EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.NASDAQ100EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Dow30EMini (YM): http://www.cmegroup.com/trading/equity-index/us-index/e-mini-dow_contract_specifications.html\n            {Symbol.Create(Futures.Indices.Dow30EMini, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.Dow30EMini, SecurityType.Future, Market.CBOT));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Russell2000EMini (RTY): https://www.cmegroup.com/trading/equity-index/us-index/e-mini-russell-2000_contract_specifications.html\n            {Symbol.Create(Futures.Indices.Russell2000EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.Russell2000EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan (13,30,0));\n                })\n            },\n            // Nikkei225Dollar (NKD): https://www.cmegroup.com/trading/equity-index/international-index/nikkei-225-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Indices.Nikkei225Dollar, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.Nikkei225Dollar;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 12 quarters, and 3 additional Dec contract months\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 5:00 p.m. Eastern Time (ET) on Business Day prior to 2nd Friday of the contract month.\n                    var secondFriday = FuturesExpiryUtilityFunctions.SecondFriday(time);\n                    var priorBusinessDay = secondFriday.AddDays(-1);\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(priorBusinessDay, holidays))\n                    {\n                        priorBusinessDay = priorBusinessDay.AddDays(-1);\n                    }\n                    return priorBusinessDay.Add(TimeSpan.FromHours(21));\n                })\n            },\n            // Nikkei225YenCME (NIY): https://www.cmegroup.com/markets/equities/international-indices/nikkei-225-yen.contractSpecs.html\n            {Symbol.Create(Futures.Indices.Nikkei225YenCME, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.Nikkei225YenCME;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 12 quarters, serial contract listed for 3 months, and 3 additional Dec contract months\n                    // Trading terminates at 5:00 p.m. Eastern Time (ET) on Business Day prior to 2nd Friday of the contract month.\n                    var secondFriday = FuturesExpiryUtilityFunctions.SecondFriday(time);\n                    var priorBusinessDay = secondFriday.AddDays(-1);\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(priorBusinessDay, holidays))\n                    {\n                        priorBusinessDay = priorBusinessDay.AddDays(-1);\n                    }\n                    return priorBusinessDay.Add(TimeSpan.FromHours(21));\n                })\n            },\n            // Nikkei225YenEMini (ENY): https://www.cmegroup.com/markets/equities/international-indices/emini-nikkei-225-yen.contractSpecs.html\n            {Symbol.Create(Futures.Indices.Nikkei225YenEMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.Nikkei225YenEMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Four months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 5:00 p.m. Eastern Time (ET) on Business Day prior to 2nd Friday of the contract month.\n                    var secondFriday = FuturesExpiryUtilityFunctions.SecondFriday(time);\n                    var priorBusinessDay = secondFriday.AddDays(-1);\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(priorBusinessDay, holidays))\n                    {\n                        priorBusinessDay = priorBusinessDay.AddDays(-1);\n                    }\n                    return priorBusinessDay.Add(TimeSpan.FromHours(21));\n                })\n            },\n            // FTSEChina50EMini (FT5): https://www.cmegroup.com/markets/equities/international-indices/e-mini-ftse-china-50-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.FTSEChina50EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.FTSEChina50EMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Contracts listed for the  2 nearest serial and 4 quarterly months.\n                    //Trading terminates on the second to last business day of the contract month at the end of trading on the Hong Kong Exchange Securities Market\n                    var secondLastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time,2, holidays);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(secondLastBusinessDay, holidays))\n                    {\n                        secondLastBusinessDay = secondLastBusinessDay.AddDays(-1);\n                    }\n                    return secondLastBusinessDay.Add(TimeSpan.FromHours(6));\n                })\n            },\n            // FTSE100EMini (FT1): https://www.cmegroup.com/markets/equities/international-indices/e-mini-ftse-100-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.FTSE100EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.FTSE100EMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Contracts listed for five months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Trading terminates on the third Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday;\n                })\n            },\n            // SPEurop350ESGEMini (E3G): https://www.cmegroup.com/markets/equities/international-indices/e-mini-sp-europe-350-esg-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.SPEurop350ESGEMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.SPEurop350ESGEMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Contracts listed for 5 months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Trading terminates on the 3rd Friday of contract delivery month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday;\n                })\n            },\n            // FTSE100USDEMini (FTU): https://www.cmegroup.com/markets/equities/international-indices/e-mini-sp-europe-350-esg-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.FTSE100USDEMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.FTSE100USDEMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Contracts listed for five months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Trading terminates on the third Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday;\n                })\n            },\n            // TOPIXUSD (TPD): https://www.cmegroup.com/markets/equities/international-indices/usd-denominated-topix-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.TOPIXUSD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.TOPIXUSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Quarterly Contracts listed for (Mar, Jun, Sep, Dec) for 5 months\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Trading terminates at 5:00 p.m. ET on the Thursday prior to the second Friday of the contract month.\n                    var secondFriday = FuturesExpiryUtilityFunctions.NthFriday(time,2);\n                    var thursdaypriorsecondFriday = secondFriday.AddDays(-1);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thursdaypriorsecondFriday, holidays))\n                    {\n                        thursdaypriorsecondFriday = thursdaypriorsecondFriday.AddDays(-1);\n                    }\n                    return thursdaypriorsecondFriday.Add(TimeSpan.FromHours(21));\n                })\n            },\n            // TOPIXYEN (TPY): https://www.cmegroup.com/markets/equities/international-indices/usd-denominated-topix-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.TOPIXYEN, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.TOPIXYEN;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Quarterly Contracts listed for (Mar, Jun, Sep, Dec) for 5 months\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Trading terminates at 5:00 p.m. ET on the Thursday prior to the second Friday of the contract month.\n                    var secondFriday = FuturesExpiryUtilityFunctions.NthFriday(time,2);\n                    var thursdaypriorsecondFriday = secondFriday.AddDays(-1);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thursdaypriorsecondFriday, holidays))\n                    {\n                        thursdaypriorsecondFriday = thursdaypriorsecondFriday.AddDays(-1);\n                    }\n                    return thursdaypriorsecondFriday.Add(TimeSpan.FromHours(21));\n                })\n            },\n            // DowJonesRealEstate (RX): https://www.cmegroup.com/markets/equities/dow-jones/dow-jones-rei.contractSpecs.html\n            {Symbol.Create(Futures.Indices.DowJonesRealEstate, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.DowJonesRealEstate;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n                    //Trading can occur up to 9:30 a.m. ET on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // SP500EMiniESG (ESG): https://www.cmegroup.com/markets/equities/sp/e-mini-sandp-500-esg-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.SP500EMiniESG, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.SP500EMiniESG;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n                    //Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // Russell1000EMini (RS1): https://www.cmegroup.com/markets/equities/russell/e-mini-russell-1000-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.Russell1000EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.Russell1000EMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Quarterly contracts (Mar, Jun, Sep, Dec) lisrted for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n                    //Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // SP500AnnualDividendIndex (SDA): https://www.cmegroup.com/markets/equities/sp/sp-500-annual-dividend-index.contractSpecs.html\n            {Symbol.Create(Futures.Indices.SP500AnnualDividendIndex, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.SP500AnnualDividendIndex;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    //Annual contracts (December) listed for 11 consecutive years\n                    while (!FutureExpirationCycles.December.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n                    //Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.NthFriday(time,3);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(thirdFriday, holidays))\n                    {\n                        thirdFriday = thirdFriday.AddDays(-1);\n                    }\n                    return thirdFriday.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // CBOE Volatility Index Futures (VIX): https://www.cboe.com/tradable_products/vix/vix_futures/specifications/\n            {Symbol.Create(Futures.Indices.VIX, SecurityType.Future, Market.CFE), (time =>\n                {\n                    // Trading can occur up to 9:00 a.m. Eastern Time (ET) on the \"Wednesday that is 30 days prior to\n                    // the third Friday of the calendar month immediately following the month in which the contract expires\".\n                    var market = Market.CFE;\n                    var symbol = Futures.Indices.VIX;\n                    var nextThirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time.AddMonths(1));\n                    var expiryDate = nextThirdFriday.AddDays(-30);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // If the next third Friday or the Wednesday are holidays, then it is moved to the previous day.\n                    if (holidays.Contains(expiryDate) || holidays.Contains(nextThirdFriday))\n                    {\n                        expiryDate = expiryDate.AddDays(-1);\n                    }\n                    // Trading hours for expiring VX futures contracts end at 8:00 a.m. Chicago time on the final settlement date.\n                    return expiryDate.Add(new TimeSpan(13, 0, 0));\n                })\n            },\n            // Bloomberg Commodity Index (AW): https://www.cmegroup.com/trading/agricultural/commodity-index/bloomberg-commodity-index_contract_specifications.html\n            {Symbol.Create(Futures.Indices.BloombergCommodityIndex, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Indices.BloombergCommodityIndex;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 consecutive quarters and 4 additional Dec contract months\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 3rd Wednesday of the contract month/ 1:30pm\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    thirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(thirdWednesday, -1, holidays);\n                    return thirdWednesday.Add(new TimeSpan(18, 30, 0));\n                })\n            },\n            // E-mini Nasdaq-100 Biotechnology Index (BIO): https://www.cmegroup.com/trading/equity-index/us-index/e-mini-nasdaq-biotechnology_contract_specifications.html\n            {Symbol.Create(Futures.Indices.NASDAQ100BiotechnologyEMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.NASDAQ100BiotechnologyEMini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. ET on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    thirdFriday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(thirdFriday, -1, holidays);\n\n                    return thirdFriday.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // E-mini FTSE Emerging Index (EI): https://www.cmegroup.com/trading/equity-index/international-index/e-mini-ftse-emerging-index_contract_specifications.html\n            {Symbol.Create(Futures.Indices.FTSEEmergingEmini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Five months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 4:00 p.m. ET on the 3rd Friday of contract month\n                    return FuturesExpiryUtilityFunctions.NthFriday(time, 3).Add(new TimeSpan(20, 0, 0));\n                })\n            },\n            // E-mini S&amp;P MidCap 400 Futures (EMD): https://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp-midcap-400_contract_specifications.html\n            {Symbol.Create(Futures.Indices.SP400MidCapEmini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up until 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    return FuturesExpiryUtilityFunctions.NthFriday(time, 3).Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // S&amp;P-GSCI Commodity Index (GD): https://www.cmegroup.com/trading/agricultural/commodity-index/gsci_contract_specifications.html\n            {Symbol.Create(Futures.Indices.SPGSCICommodity, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.SPGSCICommodity;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the11th business day of the contract month, 1:40pm.\n\n                    return FuturesExpiryUtilityFunctions.NthBusinessDay(time, 11, holidays).Add(new TimeSpan(18, 40, 0));\n                })\n            },\n            // USD-Denominated Ibovespa Index (IBV): https://www.cmegroup.com/trading/equity-index/international-index/usd-denominated-ibovespa_contract_specifications.html\n            {Symbol.Create(Futures.Indices.USDDenominatedIbovespa, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Indices.USDDenominatedIbovespa;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Four bi-monthly contracts (Feb/2, Apr/4, Jun/6, Aug/8, Oct/10, Dec/12 cycle)\n                    while (!FutureExpirationCycles.GJMQVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 5:00 p.m. Sao Paulo Time on the Wednesday closest to the 15th calendar day of the contract month. If it is a non-trading day at BM&amp;F Bovespa, trading shall terminate on the next trading day.\n                    var wednesdays = (from dateRange in Enumerable.Range(1, DateTime.DaysInMonth(time.Year, time.Month))\n                                                               where new DateTime(time.Year, time.Month, dateRange).DayOfWeek == DayOfWeek.Wednesday\n                                                               select new DateTime(time.Year, time.Month, dateRange));\n\n                    var distanceFromFifteenthDay = wednesdays.Select(x => Math.Abs(15 - x.Day)).ToList();\n                    var wednesdayIndex = distanceFromFifteenthDay.IndexOf(distanceFromFifteenthDay.Min());\n                    var closestWednesday = wednesdays.ElementAt(wednesdayIndex);\n                    if (holidays.Contains(closestWednesday) || !FuturesExpiryUtilityFunctions.NotHoliday(closestWednesday, holidays))\n                    {\n                        closestWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(closestWednesday, 1, holidays);\n                    }\n\n                    return closestWednesday.Add(new TimeSpan(20, 0, 0));\n                })\n            },\n\n            // JPY-Denominated Nikkie 225 Index Futures: https://www2.sgx.com/derivatives/products/nikkei225futuresoptions?cc=NK#Contract%20Specifications\n            {Symbol.Create(Futures.Indices.Nikkei225Yen, SecurityType.Future, Market.SGX), (time =>\n                {\n                    // 6 nearest serial months & 32 nearest quarterly months\n                    // The day before the second Friday of the contract month. Trading Hours on Last Day is normal Trading Hours (session T)\n                    // T Session\n                    // 7.15 am - 2.30 pm\n                    var market = Market.SGX;\n                    var symbol = Futures.Indices.Nikkei225Yen;\n                    var secondFriday = FuturesExpiryUtilityFunctions.SecondFriday(time);\n                    var priorBusinessDay = secondFriday.AddDays(-1);\n\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    while (holidays.Contains(priorBusinessDay) || !priorBusinessDay.IsCommonBusinessDay())\n                    {\n                        priorBusinessDay = priorBusinessDay.AddDays(-1);\n                    }\n                    return priorBusinessDay.Add(new TimeSpan(14, 30, 0));\n                })\n            },\n\n            // MSCI Taiwan Index Futures: https://www2.sgx.com/derivatives/products/timsci?cc=TW\n            {Symbol.Create(Futures.Indices.MSCITaiwanIndex, SecurityType.Future, Market.SGX), (time =>\n                {\n                    // 2 nearest serial months and 12 quarterly months on March, June, September and December cycle.\n                    // Second last business day of the contract month. Same as T Session trading hours\n                    var market = Market.SGX;\n                    var symbol = Futures.Indices.MSCITaiwanIndex;\n                    var lastDay = new DateTime(time.Year, time.Month, DateTime.DaysInMonth(time.Year, time.Month));\n                    var priorBusinessDay = lastDay.AddDays(-1);\n\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    while (holidays.Contains(priorBusinessDay) || !priorBusinessDay.IsCommonBusinessDay())\n                    {\n                        priorBusinessDay = priorBusinessDay.AddDays(-1);\n                    }\n                    return priorBusinessDay.Add(new TimeSpan(13, 45, 0));\n                })\n            },\n\n            // Nifty 50 Index Futures: https://www1.nseindia.com/products/content/derivatives/equities/contract_specifitns.htm\n            {Symbol.Create(Futures.Indices.Nifty50, SecurityType.Future, Market.India), (time =>\n                {\n                    // 3 consecutive months trading cycle – Near-Month, Mid-Month and Far-Month.\n                    // Last Thursday of the expiring contract month. If this falls on an NSE non-business day, the last trading day shall be the preceding business day.\n                    // The expiring contract shall close on its last trading day at 3.30 pm.\n                    var market = Market.India;\n                    var symbol = Futures.Indices.Nifty50;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    var expiryday = FuturesExpiryUtilityFunctions.LastThursday(time);\n\n                    while (holidays.Contains(expiryday) || !expiryday.IsCommonBusinessDay())\n                    {\n                        expiryday = expiryday.AddDays(-1);\n                    }\n                    return expiryday.Add(new TimeSpan(15, 30, 0));\n                })\n            },\n\n            // BankNifty Index Futures: https://www1.nseindia.com/products/content/derivatives/equities/bank_nifty_new.htm\n            {Symbol.Create(Futures.Indices.BankNifty, SecurityType.Future, Market.India), (time =>\n                {\n                    // have a maximum of 3-month trading cycle - the near month , the next month and the far month.\n                    // Last Thursday of the expiring contract month. If this falls on an NSE non-business day, the last trading day shall be the preceding business day.\n                    // The expiring contract shall close on its last trading day at 3.30 pm.\n                    var market = Market.India;\n                    var symbol = Futures.Indices.BankNifty;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    var expiryday = FuturesExpiryUtilityFunctions.LastThursday(time);\n\n                    while (holidays.Contains(expiryday) || !expiryday.IsCommonBusinessDay())\n                    {\n                        expiryday = expiryday.AddDays(-1);\n                    }\n                    return expiryday.Add(new TimeSpan(15, 30, 0));\n                })\n            },\n\n\n            // BSE S&P Sensex Index Futures: https://www.bseindia.com/static/markets/Derivatives/DeriReports/market_information.html#!#ach6\n            {Symbol.Create(Futures.Indices.BseSensex, SecurityType.Future, Market.India), (time =>\n                {\n                    // Last Thursday of the expiring contract month. If this falls on an BSE non-business day, the last trading day shall be the preceding business day.\n                    // The expiring contract shall close on its last trading day at 3.30 pm.\n                    var market = Market.India;\n                    var symbol = Futures.Indices.BseSensex;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    var expiryday = FuturesExpiryUtilityFunctions.LastThursday(time);\n\n                    while (holidays.Contains(expiryday) || !expiryday.IsCommonBusinessDay())\n                    {\n                        expiryday = expiryday.AddDays(-1);\n                    }\n                    return expiryday.Add(new TimeSpan(15, 30, 0));\n                })\n            },\n\n            // HSI Index Futures:https://www.hkex.com.hk/Products/Listed-Derivatives/Equity-Index/Hang-Seng-Index-(HSI)/Hang-Seng-Index-Futures?sc_lang=en#&product=HSI\n            {Symbol.Create(Futures.Indices.HangSeng, SecurityType.Future, Market.HKFE), (time =>\n                {\n                   // Short-dated Futures:\n                   // Spot, next three calendar month & next three calendar quarter months; and\n                   // Long-dated Futures:\n                   // The three months of June and December plus the next three months of December\n\n                    // The Business Day immediately preceding the last Business Day of the Contract Month\n                    var lastDay = new DateTime(time.Year, time.Month, DateTime.DaysInMonth(time.Year, time.Month));\n\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(Market.HKFE, Futures.Indices.HangSeng);\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    var priorBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(lastBusinessDay, -1, holidays);\n\n                    return priorBusinessDay.Add(new TimeSpan(16, 0, 0));\n                })\n            },\n\n            // MSCI Europe Net Total Return (USD) Futures: https://www.theice.com/products/71512951/MSCI-Europe-NTR-Index-Future-USD & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIEuropeNTR, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIEuropeNTR;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // MSCI Japan Net Total Return Futures: https://www.theice.com/products/75392111/MSCI-Japan-NTR-Index-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIJapanNTR, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIJapanNTR;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // MSCI Emerging Markets Asia Net Total Return Futures: https://www.theice.com/products/32375861/MSCI-Emerging-Markets-Asia-NTR-Index-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIEmergingMarketsAsiaNTR, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIEmergingMarketsAsiaNTR;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // MSCI EAFE Index Futures: https://www.theice.com/products/31196848/MSCI-EAFE-Index-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIEafeIndex, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIEafeIndex;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // MSCI Emerging Markets Index Futures: https://www.theice.com/products/31196851/MSCI-Emerging-Markets-Index-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIEmergingMarketsIndex, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIEmergingMarketsIndex;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // MSCI USA Index Futures: https://www.theice.com/products/32375866/MSCI-USA-Index-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Indices.MSCIUsaIndex, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Indices.MSCIUsaIndex;\n                    // Trading terminates on the third Friday of the contract month @16:15.\n                    var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                    return lastTradingDay.Add(new TimeSpan(16, 15, 0));\n                })\n            },\n            // Forestry Group\n            // Random Length Lumber (LBS): https://www.cmegroup.com/trading/agricultural/lumber-and-pulp/random-length-lumber_contract_specifications.html\n            {Symbol.Create(Futures.Forestry.RandomLengthLumber, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Forestry.RandomLengthLumber;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts (Jan, Mar, May, Jul, Sep, Nov) listed for 7 months\n                    while (!FutureExpirationCycles.FHKNUX.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 16th calendar day of the contract month at 12:05pm CT\n                    var sixteenth = new DateTime(time.Year,time.Month,16);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(sixteenth, -1, holidays).Add(new TimeSpan(17, 5, 0));\n                })\n            },\n            // Lumber and Softs\n            // Lumber Futures (LBR): https://www.cmegroup.com/markets/agriculture/lumber-and-softs/lumber.contractSpecs.html\n            {Symbol.Create(Futures.Forestry.Lumber, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Forestry.Lumber;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts (Jan, Mar, May, Jul, Sep, Nov) listed for 7 months\n                    while (!FutureExpirationCycles.FHKNUX.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 16th calendar day of the contract month at 12:05pm CT\n                    var sixteenth = new DateTime(time.Year,time.Month, 16);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(sixteenth, -1, holidays).Add(new TimeSpan(17, 5, 0));\n                })\n            },\n            // Grains And OilSeeds Group\n            // Chicago SRW Wheat (ZW): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/wheat_contract_specifications.html\n            {Symbol.Create(Futures.Grains.SRWWheat, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.SRWWheat;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 15 monthly contracts of Mar, May, Jul, Sep, Dec listed annually following the termination of trading in the July contract of the current year.\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // HRW Wheat (KE): https://www.cmegroup.com/trading/agricultural/grain-and-oilseed/kc-wheat_contract_specifications.html\n            {Symbol.Create(Futures.Grains.HRWWheat, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.HRWWheat;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts (Mar, May, Jul, Sep, Dec) listed for  15 months\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // Corn (ZC): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/corn_contract_specifications.html\n            {Symbol.Create(Futures.Grains.Corn, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.Corn;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 9 monthly contracts of Mar/3, May/5, Sep/9 and 8 monthly contracts of Jul/7 and Dec/12 listed annually after the termination of trading in the December contract of the current year.\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // Soybeans (ZS): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean_contract_specifications.html\n            {Symbol.Create(Futures.Grains.Soybeans, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.Soybeans;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 15 monthly contracts of Jan/1, Mar/3, May/5, Aug/8, Sep/9 and 8 monthly contracts of Jul/7 and Nov/11 listed annually after the termination of trading in the November contract of the current year.\n                    while (!FutureExpirationCycles.FHKNQUX.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // SoybeanMeal (ZM): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean-meal_contract_specifications.html\n            {Symbol.Create(Futures.Grains.SoybeanMeal, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.SoybeanMeal;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // \t15 monthly contracts of Jan/1, Mar/3, May/5, Aug/8, Sep/9 and 12 monthly contracts of Jul/7, Oct/10, Dec/12 listed annually after the termination of trading in the December contract of the current year.\n                    while (!FutureExpirationCycles.FHKNQUVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // SoybeanOil (ZL): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean-oil_contract_specifications.html\n            {Symbol.Create(Futures.Grains.SoybeanOil, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.SoybeanOil;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // \t15 monthly contracts of Jan/1, Mar/3, May/5, Aug/8, Sep/9 and 12 monthly contracts of Jul/7, Oct/10, Dec/12 listed annually after the termination of trading in the December contract of the current year.\n                    while (!FutureExpirationCycles.FHKNQUVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // Oats (ZO): http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/oats_contract_specifications.html\n            {Symbol.Create(Futures.Grains.Oats, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.Oats;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts (Mar, May, Jul, Sep, Dec) listed for 10 months and 1 additional Jul and 1 additional Sep contract listed in September\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // The business day prior to the 15th calendar day of the contract month.\n                    var fifteenth = new DateTime(time.Year,time.Month,15);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth,-1, holidays);\n                })\n            },\n            // Black Sea Corn Financially Settled (Platts) (BCF): https://www.cmegroup.com/trading/agricultural/grain-and-oilseed/black-sea-corn-financially-settled-platts_contract_specifications.html\n            {Symbol.Create(Futures.Grains.BlackSeaCornFinanciallySettledPlatts, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.BlackSeaCornFinanciallySettledPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 15 consecutive months.\n                    // Trading terminates on the last business day of the contract month which is also a Platts publication date for the price assessment.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Black Sea Wheat Financially Settled (Platts) (BWF): https://www.cmegroup.com/trading/agricultural/grain-and-oilseed/black-sea-wheat-financially-settled-platts_contract_specifications.html\n            {Symbol.Create(Futures.Grains.BlackSeaWheatFinanciallySettledPlatts, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Grains.BlackSeaWheatFinanciallySettledPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 15 consecutive months\n                    // Trading terminates on the last business day of the contract month which is also a Platts publication date for the price assessment.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Currencies group\n            // U.S. Dollar Index(R) Futures (DX): https://www.theice.com/products/194/US-Dollar-Index-Futures\n            {Symbol.Create(Futures.Currencies.USD, SecurityType.Future, Market.ICE), (time =>\n                {\n                    // Four months in the March/June/September/December quarterly expiration cycle\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last Trading Day:\n                    // Trading ceases at 10:16 Eastern time two days prior to settlement\n                    //\n                    // Final Settlement:\n                    // The US Dollar Index is physically settled on the third Wednesday of the expiration month\n                    // against six component currencies (euro, Japanese yen, British pound, Canadian dollar, Swedish\n                    // krona and Swiss franc) in their respective percentage weights in the Index.\n                    // Settlement rates may be quoted to three decimal places.\n\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var twoDaysPrior = thirdWednesday.AddDays(-2);\n\n                    return twoDaysPrior.Add(new TimeSpan(10, 16, 0));\n                })\n            },\n            //  GBP (6B): http://www.cmegroup.com/trading/fx/g10/british-pound_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.GBP, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.GBP;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters and serial contracts listed for 3 months\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // CAD (6C): http://www.cmegroup.com/trading/fx/g10/canadian-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.CAD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.CAD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters and serial contracts listed for 3 months\n\n                    // 9:16 a.m. Central Time (CT) on the business day immediately preceding the third Wednesday of the contract month (usually Tuesday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var businessDayPrecedingThridWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -1, holidays);\n                    return businessDayPrecedingThridWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // JPY (6J): http://www.cmegroup.com/trading/fx/g10/japanese-yen_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.JPY, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.JPY;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters and serial contracts listed for 3 months\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // CHF (6S): http://www.cmegroup.com/trading/fx/g10/swiss-franc_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.CHF, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.CHF;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // EUR (6E): http://www.cmegroup.com/trading/fx/g10/euro-fx_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.EUR, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.EUR;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters and serial contracts listed for 3 months\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // AUD (6A): http://www.cmegroup.com/trading/fx/g10/australian-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.AUD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.AUD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 20 consecutive quarters and serial contracts listed for 3 months\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // NZD (6N): http://www.cmegroup.com/trading/fx/g10/new-zealand-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.NZD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.NZD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 6 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                        thirdWednesday,\n                        -2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // RUB (6R): https://www.cmegroup.com/trading/fx/emerging-market/russian-ruble_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.RUB, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.RUB;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contacts listed for 12 consecutive months and quarterly contracts (Mar, Jun, Sep, Dec) listed for16 additional quarters\n                    // 11:00 a.m. Mosccow time on the fifteenth day of the month, or, if not a business day, on the next business day for the Moscow interbank foreign exchange market.\n                    var fifteenth = new DateTime(time.Year, time.Month, 15);\n\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(fifteenth, holidays))\n                    {\n                        fifteenth = FuturesExpiryUtilityFunctions.AddBusinessDays(fifteenth, 1, holidays);\n                    }\n                    return fifteenth.Add(new TimeSpan(08,0,0));\n                })\n            },\n            // BRL (6L): https://www.cmegroup.com/trading/fx/emerging-market/brazilian-real_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.BRL, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.BRL;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 60 consecutive months\n                    // On the last business day of the month, at 9:15 a.m. CT, immediately preceding the contract month, on which the Central Bank of Brazil is scheduled to publish its final end-of-month (EOM), \"Commercial exchange rate for Brazilian reais per U.S. dollar for cash delivery\" (PTAX rate).\n                    var lastPrecedingBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(time, -1, holidays);\n                    lastPrecedingBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastPrecedingBusinessDay, -1, holidays);\n\n                    return lastPrecedingBusinessDay.Add(new TimeSpan(14,15,0));\n                })\n            },\n            // MXN (6M): https://www.cmegroup.com/trading/fx/emerging-market/mexican-peso_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.MXN, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MXN;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 13 consecutive  months and 2 additional quarterly contracts (Mar, Jun, Sep, Dec)\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday,-2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // ZAR (6Z): https://www.cmegroup.com/trading/fx/emerging-market/south-african-rand_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.ZAR, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.ZAR;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 13 consecutive months and quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 consecutive quarters\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday)\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // AUD/CAD (ACD): https://www.cmegroup.com/trading/fx/g10/australian-dollar-canadian-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.AUDCAD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.AUDCAD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Six months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday)\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday =  FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14,16,0));\n                })\n            },\n            // Australian Dollar/Japanese Yen (AJY): https://www.cmegroup.com/trading/fx/g10/australian-dollar-japanese-yen_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.AUDJPY, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.AUDJPY;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Six months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Australian Dollar/New Zealand Dollar (ANE): https://www.cmegroup.com/trading/fx/g10/australian-dollar-new-zealand-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.AUDNZD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.AUDNZD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Six months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Bitcoin (BTC): https://www.cmegroup.com/trading/equity-index/us-index/bitcoin_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.BTC, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.BTC;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 6 consecutive months and 2 additional Dec contract months. If the 6 consecutive months includes Dec, list only 1 additional Dec contract month.\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month. If that day is not a business day in both the U.K. and the US, trading terminates on the preceding day that is a business day for both the U.K. and the U.S..\n                    var lastFriday =FuturesExpiryUtilityFunctions.LastFriday(time);\n                    lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastFriday, -1, holidays);\n\n                    return lastFriday.Add(new TimeSpan(15, 0, 0));\n                })\n            },\n            // Ether (ETH): https://www.cmegroup.com/markets/cryptocurrencies/ether/ether.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.ETH, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.ETH;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 6 consecutive months, quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 additional quarters and a second Dec contract if only one is listed.\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month that is either a London or U.S. business day. If the last Friday of the contract month day is not a business day in both London and the U.S., trading terminates on the prior London or U.S. business day.\n                    var lastFriday = FuturesExpiryUtilityFunctions.LastFriday(time);\n                    lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastFriday, -1, holidays);\n\n                    return lastFriday.Add(new TimeSpan(15, 0, 0));\n                })\n            },\n            // Canadian Dollar/Japanese Yen (CJY): https://www.cmegroup.com/trading/fx/g10/canadian-dollar-japanese-yen_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.CADJPY, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.CADJPY;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Six months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Standard-Size USD/Offshore RMB (CNH): https://www.cmegroup.com/trading/fx/emerging-market/usd-cnh_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.StandardSizeUSDOffshoreRMBCNH, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.StandardSizeUSDOffshoreRMBCNH;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 13 consecutive months and quarterly contracts (Mar, Jun, Sep, Dec) listed for the next 8  quarters.\n                    // Trading terminates on the second Hong Kong business day prior to the third Wednesday of the contract month at 11:00 a.m. Hong Kong local time.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = thirdWednesday.AddDays(-2);\n                    while (holidays.Contains(secondBusinessDayPrecedingThirdWednesday) || !secondBusinessDayPrecedingThirdWednesday.IsCommonBusinessDay())\n                    {\n                        secondBusinessDayPrecedingThirdWednesday = secondBusinessDayPrecedingThirdWednesday.AddDays(-1);\n                    }\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(3,0,0));\n                })\n            },\n            // E-mini Euro FX (E7): https://www.cmegroup.com/trading/fx/g10/e-mini-euro-fx_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.EuroFXEmini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.EuroFXEmini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Euro/Australian Dollar (EAD): https://www.cmegroup.com/trading/fx/g10/euro-fx-australian-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.EURAUD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.EURAUD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 6 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Euro/Canadian Dollar (ECD): https://www.cmegroup.com/trading/fx/g10/euro-fx-canadian-dollar_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.EURCAD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.EURCAD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 6 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 9:16 a.m. CT on the second business day prior to the third Wednesday of the contract month.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Euro/Swedish Krona (ESK): https://www.cmegroup.com/trading/fx/g10/euro-fx-swedish-krona_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.EURSEK, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.EURSEK;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Six months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // E-mini Japanese Yen (J7): https://www.cmegroup.com/trading/fx/g10/e-mini-japanese-yen_contract_specifications.html\n            {Symbol.Create(Futures.Currencies.JapaneseYenEmini, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.JapaneseYenEmini;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Two months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                   // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Financials group\n            // Y30TreasuryBond (ZB): http://www.cmegroup.com/trading/interest-rates/us-treasury/30-year-us-treasury-bond_contract_specifications.html\n            {Symbol.Create(Futures.Financials.Y30TreasuryBond, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.Y30TreasuryBond;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //  Seventh business day preceding the last business day of the delivery month. Trading in expiring contracts closes at 12:01 p.m. on the last trading day.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    var seventhBusinessDayPrecedingLastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(lastBusinessDay,-7, holidays);\n                    return seventhBusinessDayPrecedingLastBusinessDay.Add(new TimeSpan(12,01,0));\n                })\n            },\n            // Y10TreasuryNote (ZN): http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note_contract_specifications.html\n            {Symbol.Create(Futures.Financials.Y10TreasuryNote, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.Y10TreasuryNote;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //  Seventh business day preceding the last business day of the delivery month. Trading in expiring contracts closes at 12:01 p.m. on the last trading day.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    var seventhBusinessDayPrecedingLastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(lastBusinessDay,-7, holidays);\n                    return seventhBusinessDayPrecedingLastBusinessDay.Add(new TimeSpan(12,01,0));\n                })\n            },\n            // Y5TreasuryNote (ZF): http://www.cmegroup.com/trading/interest-rates/us-treasury/5-year-us-treasury-note_contract_specifications.html\n            {Symbol.Create(Futures.Financials.Y5TreasuryNote, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.Y5TreasuryNote;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last business day of the calendar month. Trading in expiring contracts closes at 12:01 p.m. on the last trading day.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    return lastBusinessDay.Add(new TimeSpan(12,01,0));\n                })\n            },\n            // Y2TreasuryNote (ZT): http://www.cmegroup.com/trading/interest-rates/us-treasury/2-year-us-treasury-note_contract_specifications.html\n            {Symbol.Create(Futures.Financials.Y2TreasuryNote, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.Y2TreasuryNote;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last business day of the calendar month. Trading in expiring contracts closes at 12:01 p.m. on the last trading day.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    return lastBusinessDay.Add(new TimeSpan(12,01,0));\n                })\n            },\n            // Eurodollar (GE): https://www.cmegroup.com/trading/interest-rates/stir/eurodollar_contract_specifications.html\n            {Symbol.Create(Futures.Financials.EuroDollar, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Financials.EuroDollar;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 40 consecutive quarters and the nearest 4 serial contract months.\n                    // List a new quarterly contract for trading on the last trading day of the nearby expiry.\n\n                    // Termination of trading:\n                    // Second London bank business day before 3rd Wednesday of the contract month. Trading\n                    // in expiring contracts terminates at 11:00 a.m. London time on the last trading day.\n\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(FuturesExpiryUtilityFunctions.ThirdWednesday(time), -2, holidays)\n                        .Add(TimeSpan.FromHours(11));\n                })\n            },\n            // 5-Year USD MAC Swap (F1U): https://www.cmegroup.com/trading/interest-rates/swap-futures/5-year-usd-mac-swap_contract_specifications.html\n            {Symbol.Create(Futures.Financials.FiveYearUSDMACSwap, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.FiveYearUSDMACSwap;\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Second London business day before 3rd Wednesday of futures Delivery Month. Trading in expiring contracts closes at 2:00 p.m. on the last trading day.\n                    var secondBusinessDayBeforeThirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time).AddDays(-2);\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Because we're using a London calendar, we need to put entries in MHDB and not use `USHolidays.Dates`\n                    while (holidays.Contains(secondBusinessDayBeforeThirdWednesday) || !secondBusinessDayBeforeThirdWednesday.IsCommonBusinessDay())\n                    {\n                        secondBusinessDayBeforeThirdWednesday = secondBusinessDayBeforeThirdWednesday.AddDays(-1);\n                    }\n\n                    return secondBusinessDayBeforeThirdWednesday.Add(new TimeSpan(19, 0, 0));\n                })\n            },\n            // Ultra U.S. Treasury Bond (UB): https://www.cmegroup.com/trading/interest-rates/us-treasury/ultra-t-bond_contract_specifications.html\n            {Symbol.Create(Futures.Financials.UltraUSTreasuryBond, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.UltraUSTreasuryBond;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Seventh business day preceding the last business day of the delivery month. Trading in expiring contracts closes at 12:01 p.m. on the last trading day.\n                    var sevenBusinessDaysBeforeLastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 8, holidays);\n\n                    return sevenBusinessDaysBeforeLastBusinessDay.Add(new TimeSpan(12, 1, 0));\n                })\n            },\n            // Ultra 10-Year U.S. Treasury Note (TN): https://www.cmegroup.com/trading/interest-rates/us-treasury/ultra-10-year-us-treasury-note_contract_specifications.html\n            {Symbol.Create(Futures.Financials.UltraTenYearUSTreasuryNote, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.UltraTenYearUSTreasuryNote;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 3 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                     // Trading terminates on the 7th business day before the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 8, holidays);\n                })\n            },\n            // Energy group\n            // Propane Non LDH Mont Belvieu (1S): https://www.cmegroup.com/trading/energy/petrochemicals/propane-non-ldh-mt-belvieu-opis-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.PropaneNonLDHMontBelvieu, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.PropaneNonLDHMontBelvieu;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month (no time specified)\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Argus Propane Far East Index BALMO (22): https://www.cmegroup.com/trading/energy/petrochemicals/argus-propane-far-east-index-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ArgusPropaneFarEastIndexBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ArgusPropaneFarEastIndexBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for three cconsecutive months\n                    // Trading shall cease on the last business day of the contract month. Business days are based on the Singapore Public Holiday calendar.\n                    // TODO: Might need singapore calendar\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mini European 3.5% Fuel Oil Barges FOB Rdam (Platts) (A0D): https://www.cmegroup.com/trading/energy/refined-products/mini-european-35pct-fuel-oil-platts-barges-fob-rdam-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MiniEuropeanThreePointPercentFiveFuelOilBargesPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MiniEuropeanThreePointPercentFiveFuelOilBargesPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Mini Singapore Fuel Oil 180 cst (Platts) (A0F): https://www.cmegroup.com/trading/energy/refined-products/mini-singapore-fuel-oil-180-cst-platts-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MiniSingaporeFuelOil180CstPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MiniSingaporeFuelOil180CstPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and the next 5 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    // Special case exists where the last trade occurs on US holiday, but not an exchange holiday (markets closed)\n                    // In order to fix that case, we will start from the last day of the month and go backwards checking if it's a weekday and a holiday\n                    var lastDay = new DateTime(time.Year, time.Month, DateTime.DaysInMonth(time.Year, time.Month));\n\n                    while (holidays.Contains(lastDay) || !lastDay.IsCommonBusinessDay())\n                    {\n                        lastDay = lastDay.AddDays(-1);\n                    }\n\n                    return lastDay;\n                })\n            },\n            // Gulf Coast ULSD (Platts) Up-Down BALMO Futures (A1L): https://www.cmegroup.com/trading/energy/refined-products/ulsd-up-down-balmo-calendar-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GulfCoastULSDPlattsUpDownBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GulfCoastULSDPlattsUpDownBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Gulf Coast Jet (Platts) Up-Down BALMO Futures (A1M): https://www.cmegroup.com/trading/energy/refined-products/jet-fuel-up-down-balmo-calendar-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GulfCoastJetPlattsUpDownBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GulfCoastJetPlattsUpDownBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Propane Non-LDH Mont Belvieu (OPIS) Futures (A1R): https://www.cmegroup.com/trading/energy/petrochemicals/propane-non-ldh-mt-belvieu-opis-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.PropaneNonLDHMontBelvieuOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.PropaneNonLDHMontBelvieuOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 48 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // European Propane CIF ARA (Argus) BALMO Futures (A32): https://www.cmegroup.com/trading/energy/petrochemicals/european-propane-cif-ara-argus-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EuropeanPropaneCIFARAArgusBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EuropeanPropaneCIFARAArgusBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Premium Unleaded Gasoline 10 ppm FOB MED (Platts) Futures (A3G): https://www.cmegroup.com/trading/energy/refined-products/premium-unleaded-10-ppm-platts-fob-med-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.PremiumUnleadedGasoline10ppmFOBMEDPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.PremiumUnleadedGasoline10ppmFOBMEDPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // 48 consecutive months\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Argus Propane Far East Index Futures (A7E): https://www.cmegroup.com/trading/energy/petrochemicals/argus-propane-far-east-index-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ArgusPropaneFarEastIndex, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ArgusPropaneFarEastIndex;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 48 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Gasoline Euro-bob Oxy NWE Barges (Argus) Crack Spread BALMO Futures (A7I): https://www.cmegroup.com/trading/energy/refined-products/gasoline-euro-bob-oxy-new-barges-crack-spread-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GasolineEurobobOxyNWEBargesArgusCrackSpreadBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GasolineEurobobOxyNWEBargesArgusCrackSpreadBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading ceases on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mont Belvieu Natural Gasoline (OPIS) Futures (A7Q): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-natural-gasoline-5-decimal-opis-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuNaturalGasolineOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuNaturalGasolineOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 56 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mont Belvieu Normal Butane (OPIS) BALMO Futures (A8J): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-normal-butane-opis-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuNormalButaneOPISBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuNormalButaneOPISBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading terminates on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Conway Propane (OPIS) Futures (A8K): https://www.cmegroup.com/trading/energy/petrochemicals/conway-propane-opis-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ConwayPropaneOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ConwayPropaneOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mont Belvieu LDH Propane (OPIS) BALMO Futures (A8O): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-ldh-propane-opis-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuLDHPropaneOPISBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuLDHPropaneOPISBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Argus Propane Far East Index vs. European Propane CIF ARA (Argus) Futures (A91): https://www.cmegroup.com/trading/energy/petrochemicals/argus-propane-far-east-index-vs-european-propane-cif-ara-argus-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ArgusPropaneFarEastIndexVsEuropeanPropaneCIFARAArgus, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ArgusPropaneFarEastIndexVsEuropeanPropaneCIFARAArgus;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Argus Propane (Saudi Aramco) Futures (A9N): https://www.cmegroup.com/trading/energy/petrochemicals/argus-propane-saudi-aramco-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ArgusPropaneSaudiAramco, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ArgusPropaneSaudiAramco;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for 48 consecutive months\n                    // Trading shall terminate on the last business day of the month prior to the contract month.\n                    // Business days are based on the Singapore Public Holiday Calendar.\n                    // Special case in 2021 where last traded date falls on US Holiday, but not exchange holiday\n                    var previousMonth = time.AddMonths(-1);\n                    var lastDay = new DateTime(previousMonth.Year, previousMonth.Month, DateTime.DaysInMonth(previousMonth.Year, previousMonth.Month));\n\n                    while (!lastDay.IsCommonBusinessDay() || holidays.Contains(lastDay))\n                    {\n                        lastDay = lastDay.AddDays(-1);\n                    }\n\n                    return lastDay;\n                })\n            },\n            // Group Three ULSD (Platts) vs. NY Harbor ULSD Futures (AA6): https://www.cmegroup.com/trading/energy/refined-products/group-three-ultra-low-sulfur-diesel-ulsd-platts-vs-heating-oil-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GroupThreeULSDPlattsVsNYHarborULSD, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GroupThreeULSDPlattsVsNYHarborULSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Group Three Sub-octane Gasoline (Platts) vs. RBOB Futures (AA8): https://www.cmegroup.com/trading/energy/refined-products/group-three-unleaded-gasoline-platts-vs-rbob-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GroupThreeSuboctaneGasolinePlattsVsRBOB, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GroupThreeSuboctaneGasolinePlattsVsRBOB;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Singapore Fuel Oil 180 cst (Platts) BALMO Futures (ABS): https://www.cmegroup.com/trading/energy/refined-products/singapore-180cst-fuel-oil-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.SingaporeFuelOil180cstPlattsBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.SingaporeFuelOil180cstPlattsBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Singapore Fuel Oil 380 cst (Platts) BALMO Futures (ABT): https://www.cmegroup.com/trading/energy/refined-products/singapore-380cst-fuel-oil-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.SingaporeFuelOil380cstPlattsBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.SingaporeFuelOil380cstPlattsBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mont Belvieu Ethane (OPIS) Futures (AC0): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-ethane-opis-5-decimals-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuEthaneOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuEthaneOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mont Belvieu Normal Butane (OPIS) Futures (AD0): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-normal-butane-5-decimals-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuNormalButaneOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuNormalButaneOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Brent Crude Oil vs. Dubai Crude Oil (Platts) Futures (ADB): https://www.cmegroup.com/trading/energy/crude-oil/brent-dubai-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.BrentCrudeOilVsDubaiCrudeOilPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.BrentCrudeOilVsDubaiCrudeOilPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading shall cease on the last London and Singapore business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Argus LLS vs. WTI (Argus) Trade Month Futures (AE5): https://www.cmegroup.com/trading/energy/crude-oil/argus-lls-vs-wti-argus-trade-month-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ArgusLLSvsWTIArgusTradeMonth, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ArgusLLSvsWTIArgusTradeMonth;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Trading shall cease at the close of trading on the last business day that falls on or before the 25th calendar day of the month prior to the contract month. If the 25th calendar day is a weekend or holiday, trading shall cease on the first business day prior to the 25th calendar day.\n                    var previousMonth = time.AddMonths(-1);\n                    var twentyFifthDay = new DateTime(previousMonth.Year, previousMonth.Month, 25);\n                    while (!twentyFifthDay.IsCommonBusinessDay() || holidays.Contains(twentyFifthDay))\n                    {\n                        twentyFifthDay = FuturesExpiryUtilityFunctions.AddBusinessDays(twentyFifthDay, -1, holidays);\n                    }\n\n                    return twentyFifthDay;\n                })\n            },\n            // Singapore Gasoil (Platts) vs. Low Sulphur Gasoil (AGA): https://www.cmegroup.com/trading/energy/refined-products/gasoil-arb-singapore-gasoil-platts-vs-ice-rdam-gasoil-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.SingaporeGasoilPlattsVsLowSulphurGasoilFutures, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.SingaporeGasoilPlattsVsLowSulphurGasoilFutures;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // Monthly contracts listed for the current year and the next 2 calendar years.\n                    // Trading ceases on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Los Angeles CARBOB Gasoline (OPIS) vs. RBOB Gasoline (AJL): https://www.cmegroup.com/trading/energy/refined-products/los-angeles-carbob-gasoline-opis-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.LosAngelesCARBOBGasolineOPISvsRBOBGasoline, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.LosAngelesCARBOBGasolineOPISvsRBOBGasoline;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Los Angeles Jet (OPIS) vs. NY Harbor ULSD (AJS): https://www.cmegroup.com/trading/energy/refined-products/los-angeles-carbob-gasoline-opis-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.LosAngelesJetOPISvsNYHarborULSD, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.LosAngelesJetOPISvsNYHarborULSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Los Angeles CARB Diesel (OPIS) vs. NY Harbor ULSD (AKL): https://www.cmegroup.com/trading/energy/refined-products/los-angeles-carbob-diesel-opis-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.LosAngelesCARBDieselOPISvsNYHarborULSD, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.LosAngelesCARBDieselOPISvsNYHarborULSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 3 consecutive years\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // European Naphtha (Platts) BALMO (AKZ): https://www.cmegroup.com/trading/energy/refined-products/european-naphtha-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EuropeanNaphthaPlattsBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EuropeanNaphthaPlattsBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // European Propane CIF ARA (Argus) (APS): https://www.cmegroup.com/trading/energy/petrochemicals/european-propane-cif-ara-argus-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EuropeanPropaneCIFARAArgus, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EuropeanPropaneCIFARAArgus;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 3 calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Mont Belvieu Natural Gasoline (OPIS) BALMO (AR0): https://www.cmegroup.com/trading/energy/petrochemicals/mt-belvieu-natural-gasoline-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuNaturalGasolineOPISBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuNaturalGasolineOPISBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // RBOB Gasoline Crack Spread (ARE): https://www.cmegroup.com/trading/energy/refined-products/rbob-crack-spread-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.RBOBGasolineCrackSpread, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.RBOBGasolineCrackSpread;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // The current year plus the next three calendar years\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Gulf Coast HSFO (Platts) BALMO (AVZ): https://www.cmegroup.com/trading/energy/refined-products/gulf-coast-3pct-fuel-oil-balmo-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GulfCoastHSFOPlattsBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GulfCoastHSFOPlattsBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for the current month and the following month listed 10 business days prior to the start of the contract month\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Mars (Argus) vs. WTI Trade Month (AYV): https://www.cmegroup.com/trading/energy/crude-oil/mars-crude-oil-argus-vs-wti-trade-month-spread-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MarsArgusVsWTITradeMonth, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MarsArgusVsWTITradeMonth;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 5 calendar years.\n                    // Trading shall cease at the close of trading on the last business day that falls on or before the 25th calendar day of the\n                    // month prior to the contract month. If the 25th calendar day is a weekend or holiday, trading shall cease on the\n                    // first business day prior to the 25th calendar day.\n                    var twentyFifthDayPriorMonth = new DateTime(time.Year, time.Month, 25).AddMonths(-1);\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(twentyFifthDayPriorMonth, holidays) || holidays.Contains(twentyFifthDayPriorMonth))\n                    {\n                        twentyFifthDayPriorMonth = FuturesExpiryUtilityFunctions.AddBusinessDays(twentyFifthDayPriorMonth, -1, holidays);\n                    }\n\n                    return twentyFifthDayPriorMonth;\n                })\n            },\n            // Mars (Argus) vs. WTI Financial (AYX): https://www.cmegroup.com/trading/energy/crude-oil/mars-crude-oil-argus-vs-wti-calendar-spread-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MarsArgusVsWTIFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MarsArgusVsWTIFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // The current year and the next five (5) consecutive calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Ethanol T2 FOB Rdam Including Duty (Platts) (AZ1): https://www.cmegroup.com/trading/energy/ethanol/ethanol-platts-t2-fob-rotterdam-including-duty-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EthanolT2FOBRdamIncludingDutyPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EthanolT2FOBRdamIncludingDutyPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading terminates on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Mont Belvieu LDH Propane (OPIS) (B0): https://www.cmegroup.com/trading/energy/petrochemicals/mont-belvieu-propane-5-decimals-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.MontBelvieuLDHPropaneOPIS, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MontBelvieuLDHPropaneOPIS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Gasoline Euro-bob Oxy NWE Barges (Argus) (B7H): https://www.cmegroup.com/trading/energy/refined-products/gasoline-euro-bob-oxy-new-barges-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GasolineEurobobOxyNWEBargesArgus, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GasolineEurobobOxyNWEBargesArgus;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // WTI-Brent Financial (BK): https://www.cmegroup.com/trading/energy/crude-oil/wti-brent-ice-calendar-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.WTIBrentFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.WTIBrentFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 8 calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread (1000mt) (BOO): https://www.cmegroup.com/trading/energy/refined-products/35pct-fuel-oil-platts-barges-fob-rdam-crack-spread-1000mt-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mt, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mt;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Gasoline Euro-bob Oxy NWE Barges (Argus) BALMO (BR7): https://www.cmegroup.com/trading/energy/refined-products/gasoline-euro-bob-oxy-new-barges-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GasolineEurobobOxyNWEBargesArgusBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GasolineEurobobOxyNWEBargesArgusBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Brent Last Day Financial (BZ): https://www.cmegroup.com/trading/energy/crude-oil/brent-crude-oil-last-day_contract_specifications.html\n            {Symbol.Create(Futures.Energy.BrentLastDayFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.BrentLastDayFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 7 calendar years and 3 additional contract months.\n                    // Trading terminates the last London business day of the month, 2 months prior to the contract month except for the February contract month which terminates the 2nd last London business day of the month, 2 months prior to the contract month.\n                    var twoMonthsPriorToContractMonth = time.AddMonths(-2);\n\n                    DateTime lastBusinessDay;\n\n                    if (twoMonthsPriorToContractMonth.Month == 2)\n                    {\n                        lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(twoMonthsPriorToContractMonth, 1, holidays);\n                    }\n                    else\n                    {\n                        lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(twoMonthsPriorToContractMonth, 1, holidays);\n                    }\n\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // CrudeOilWTI (CL): http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_contract_specifications.html\n            {Symbol.Create(Futures.Energy.CrudeOilWTI, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.CrudeOilWTI;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 10 calendar years and 2 additional contract months.\n                    // Trading in the current delivery month shall cease on the third business day prior to the twenty-fifth calendar day of the month preceding the delivery month. If the twenty-fifth calendar day of the month is a non-business day, trading shall cease on the third business day prior to the last business day preceding the twenty-fifth calendar day. In the event that the official Exchange holiday schedule changes subsequent to the listing of a Crude Oil futures, the originally listed expiration date shall remain in effect.In the event that the originally listed expiration day is declared a holiday, expiration will move to the business day immediately prior.\n                    var twentyFifth = new DateTime(time.Year,time.Month,25);\n                    twentyFifth = twentyFifth.AddMonths(-1);\n\n                    var businessDays = -3;\n                    if(!FuturesExpiryUtilityFunctions.NotHoliday(twentyFifth, holidays))\n                    {\n                        // if the 25th is a holiday we substract 1 extra bussiness day\n                        businessDays -= 1;\n                    }\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(twentyFifth, businessDays, holidays);\n                })\n            },\n            // Gulf Coast CBOB Gasoline A2 (Platts) vs. RBOB Gasoline (CRB): https://www.cmegroup.com/trading/energy/refined-products/gulf-coast-cbob-gasoline-a2-platts-vs-rbob-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GulfCoastCBOBGasolineA2PlattsVsRBOBGasoline, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GulfCoastCBOBGasolineA2PlattsVsRBOBGasoline;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // WTI Financial (CSX): https://www.cmegroup.com/trading/energy/crude-oil/west-texas-intermediate-wti-crude-oil-calendar-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.WTIFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.WTIFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 8 calendar years.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Chicago Ethanol (Platts) (CU): https://www.cmegroup.com/trading/energy/ethanol/chicago-ethanol-platts-swap_contract_specifications.html a\n            {Symbol.Create(Futures.Energy.ChicagoEthanolPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ChicagoEthanolPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading terminates on the last business day of the contract month\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Singapore Mogas 92 Unleaded (Platts) Brent Crack Spread (D1N): https://www.cmegroup.com/trading/energy/refined-products/singapore-mogas-92-unleaded-platts-brent-crack-spread-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.SingaporeMogas92UnleadedPlattsBrentCrackSpread, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.SingaporeMogas92UnleadedPlattsBrentCrackSpread;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next calendar year.\n                    // Trading shall cease on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Dubai Crude Oil (Platts) Financial (DCB): https://www.cmegroup.com/trading/energy/crude-oil/dubai-crude-oil-calendar-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.DubaiCrudeOilPlattsFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.DubaiCrudeOilPlattsFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next five calendar years.\n                    // Trading shall cease on the last London and Singapore business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Japan C&amp;F Naphtha (Platts) BALMO (E6): https://www.cmegroup.com/trading/energy/refined-products/japan-naphtha-balmo-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.JapanCnFNaphthaPlattsBALMO, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.JapanCnFNaphthaPlattsBALMO;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly BALMO contracts listed for 3 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // Ethanol (EH): https://www.cmegroup.com/trading/energy/ethanol/cbot-ethanol_contract_specifications.html\n            {Symbol.Create(Futures.Energy.Ethanol, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Energy.Ethanol;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading terminates on 3rd business day of the contract month in \"ctm\"\n\n                    return FuturesExpiryUtilityFunctions.NthBusinessDay(time, 3, holidays);\n                })\n            },\n            // European Naphtha (Platts) Crack Spread (EN): https://www.cmegroup.com/trading/energy/refined-products/european-naphtha-crack-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EuropeanNaphthaPlattsCrackSpread, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts listed for the current year and the next 3 calendar years\n                    // Trading ceases on the last business day of the contract month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EuropeanNaphthaPlattsCrackSpread;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // European Propane CIF ARA (Argus) vs. Naphtha Cargoes CIF NWE (Platts) (EPN): https://www.cmegroup.com/trading/energy/refined-products/european-propane-cif-ara-argus-vs-naphtha-cif-nwe-platts-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts listed for the current year and the next 3 calendar years.\n                    // Trading shall cease on the last business day of the contract month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // Singapore Fuel Oil 380 cst (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) (EVC): https://www.cmegroup.com/trading/energy/refined-products/singapore-fuel-oil-380-cst-platts-vs-european-35-fuel-oil-barges-fob-rdam-platts_contract_specifications.html\n            {Symbol.Create(Futures.Energy.SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 5 calendar years.\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // East-West Gasoline Spread (Platts-Argus) (EWG): https://www.cmegroup.com/trading/energy/refined-products/east-west-gasoline-spread-platts-argus-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EastWestGasolineSpreadPlattsArgus, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EastWestGasolineSpreadPlattsArgus;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 12 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // East-West Naphtha: Japan C&amp;F vs. Cargoes CIF NWE Spread (Platts) (EWN): https://www.cmegroup.com/trading/energy/refined-products/east-west-naphtha-japan-cf-vs-cargoes-cif-nwe-spread-platts-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading terminates on the last business day of the contract month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // RBOB Gasoline vs. Euro-bob Oxy NWE Barges (Argus) (350,000 gallons) (EXR): https://www.cmegroup.com/trading/energy/refined-products/rbob-gasoline-vs-euro-bob-oxy-argus-nwe-barges-1000mt-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallons, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallons;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                })\n            },\n            // 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread Futures (FO): https://www.cmegroup.com/trading/energy/refined-products/northwest-europe-nwe-35pct-fuel-oil-rottderdam-crack-spread-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 4 calendar years.\n                    // Trading ceases on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // Freight Route TC14 (Baltic) (FRC): https://www.cmegroup.com/trading/energy/freight/freight-route-tc14-baltic-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.FreightRouteTC14Baltic, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.FreightRouteTC14Baltic;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 5 consecutive years.\n                    // Trading terminates on the last business day of the contract month\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // 1% Fuel Oil Cargoes FOB NWE (Platts) vs. 3.5% Fuel Oil Barges FOB Rdam (Platts) (FSS):  https://www.cmegroup.com/trading/energy/refined-products/fuel-oil-diff-1pct-nwe-cargoes-vs-35pct-barges-swap_contract_specifications.html\n            {Symbol.Create(Futures.Energy.OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    // Monthly contracts listed for 52 consecutive months\n                    // Trading ceases on the last business day of the contract month.\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // Gulf Coast HSFO (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) (GCU): https://www.cmegroup.com/trading/energy/refined-products/gulf-coast-no6-fuel-oil-3pct-vs-european-3point5pct-fuel-oil-barges-fob-rdam-platts-swap-futures_contract_specifications.html\n            {Symbol.Create(Futures.Energy.GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n                    // Trading shall cease on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n\n                    while (holidays.Contains(lastBusinessDay) || !lastBusinessDay.IsCommonBusinessDay())\n                    {\n                        lastBusinessDay = lastBusinessDay.AddDays(-1);\n                    }\n\n                    return lastBusinessDay;\n                })\n            },\n            // WTI Houston Crude Oil (HCL): https://www.cmegroup.com/trading/energy/crude-oil/wti-houston-crude-oil_contract_specifications.html\n            {Symbol.Create(Futures.Energy.WTIHoustonCrudeOil, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.WTIHoustonCrudeOil;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed through and including Dec-21\n                    // Trading terminates 3 business days prior to the twenty-fifth calendar day of the month prior to the contract month.  If the twenty-fifth calendar day is not a business day, trading terminates 3 business days prior to the business day preceding the twenty-fifth calendar day of the month prior to the contract month.\n                    var twentyFifthDayInPriorMonth = new DateTime(time.Year, time.Month, 25).AddMonths(-1);\n                    var i = 0;\n\n                    while (i < 3 || !twentyFifthDayInPriorMonth.IsCommonBusinessDay() || holidays.Contains(twentyFifthDayInPriorMonth))\n                    {\n                        if (twentyFifthDayInPriorMonth.IsCommonBusinessDay() &&\n                            !holidays.Contains(twentyFifthDayInPriorMonth))\n                        {\n                            i++;\n                        }\n                        twentyFifthDayInPriorMonth = twentyFifthDayInPriorMonth.AddDays(-1);\n                    }\n\n                    return twentyFifthDayInPriorMonth;\n                })\n            },\n            // Natural Gas (Henry Hub) Last-day Financial (HH): https://www.cmegroup.com/trading/energy/natural-gas/natural-gas-last-day_contract_specifications.html\n            {Symbol.Create(Futures.Energy.NaturalGasHenryHubLastDayFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.NaturalGasHenryHubLastDayFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 12 calendar years.\n                    // Trading terminates on the third last business day of the month prior to the contract month.\n                    var previousMonth = time.AddMonths(-1);\n                    previousMonth = new DateTime(previousMonth.Year, previousMonth.Month, DateTime.DaysInMonth(previousMonth.Year, previousMonth.Month));\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(previousMonth, 3, holidays);\n                })\n            },\n            // HeatingOil (HO): http://www.cmegroup.com/trading/energy/refined-products/heating-oil_contract_specifications.html\n            {Symbol.Create(Futures.Energy.HeatingOil, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.HeatingOil;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 3 calendar years and 1 additional month.\n                    // Trading in a current month shall cease on the last business day of the month preceding the delivery month.\n                    var precedingMonth = time.AddMonths(-1);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(precedingMonth, 1, holidays);\n                })\n            },\n            // Natural Gas (Henry Hub) Penultimate Financial (HP): https://www.cmegroup.com/trading/energy/natural-gas/natural-gas-penultimate_contract_specifications.html\n            {Symbol.Create(Futures.Energy.NaturalGasHenryHubPenultimateFinancial, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.NaturalGasHenryHubPenultimateFinancial;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 5 calendar years.\n                    // Trading terminates on the 4th last business day of the month prior to the contract month.\n                    var previousMonth = time.AddMonths(-1);\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(previousMonth, 4, holidays);\n                })\n            },\n            // WTI Houston (Argus) vs. WTI Trade Month (HTT): https://www.cmegroup.com/trading/energy/crude-oil/wti-houston-argus-vs-wti-trade-month_contract_specifications.html\n            {Symbol.Create(Futures.Energy.WTIHoustonArgusVsWTITradeMonth, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.WTIHoustonArgusVsWTITradeMonth;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 3 calendar years.\n                    // Trading terminates on the last business day that falls on or before the 25th calendar day of the month prior to the contract month. If the 25th calendar day is a weekend or holiday, trading shall cease on the first business day prior to the 25th calendar day.\n                    var twentyFifthPreviousMonth = new DateTime(time.Year, time.Month, 25).AddMonths(-1);\n                    while (holidays.Contains(twentyFifthPreviousMonth) || !FuturesExpiryUtilityFunctions.NotHoliday(twentyFifthPreviousMonth, holidays))\n                    {\n                        twentyFifthPreviousMonth = FuturesExpiryUtilityFunctions.AddBusinessDays(twentyFifthPreviousMonth, -1, holidays);\n                    }\n\n                    return twentyFifthPreviousMonth;\n                })\n            },\n            // Gasoline (RB): http://www.cmegroup.com/trading/energy/refined-products/rbob-gasoline_contract_specifications.html\n            {Symbol.Create(Futures.Energy.Gasoline, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.Gasoline;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 3 calendar years and 1 additional month.\n                    // Trading in a current delivery month shall cease on the last business day of the month preceding the delivery month.\n                    var precedingMonth = time.AddMonths(-1);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(precedingMonth, 1, holidays);\n                })\n            },\n            // Natural Gas (NG) : http://www.cmegroup.com/trading/energy/natural-gas/natural-gas_contract_specifications.html\n            {Symbol.Create(Futures.Energy.NaturalGas, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.NaturalGas;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next 12 calendar years.\n                    //Trading of any delivery month shall cease three (3) business days prior to the first day of the delivery month. In the event that the official Exchange holiday schedule changes subsequent to the listing of a Natural Gas futures, the originally listed expiration date shall remain in effect.In the event that the originally listed expiration day is declared a holiday, expiration will move to the business day immediately prior.\n                    var firstDay = new DateTime(time.Year,time.Month,1);\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(firstDay, -3, holidays);\n                })\n            },\n            // Brent Crude (B) : https://www.theice.com/products/219/Brent-Crude-Futures\n            {Symbol.Create(Futures.Energy.BrentCrude, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Energy.BrentCrude;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Up to 96 consecutive months\n                    //Trading shall cease at the end of the designated settlement period on the last Business Day of the second month\n                    //preceding the relevant contract month (e.g. the March contract month will expire on the last Business Day of January).\n                    //If the day on which trading is due to cease would be either: (i) the Business Day preceding Christmas Day, or\n                    //(ii) the Business Day preceding New Year’s Day, then trading shall cease on the next preceding Business Day\n                    var secondPrecedingMonth = time.AddMonths(-2);\n                    var nthLastBusinessDay = secondPrecedingMonth.Month == 12 ? 2 : 1;\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(secondPrecedingMonth, nthLastBusinessDay, holidays);\n                })\n            },\n            // Low Sulphur Gasoil Futures (G): https://www.theice.com/products/34361119/Low-Sulphur-Gasoil-Futures\n            {Symbol.Create(Futures.Energy.LowSulfurGasoil, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Energy.LowSulfurGasoil;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Up to 96 consecutive months\n                    //Trading shall cease at 12:00 hours London Time, 2 business days prior to the 14th calendar day of the delivery month.\n                    var fourteenthDay = new DateTime(time.Year,time.Month,14);\n                    var twelfthDay = FuturesExpiryUtilityFunctions.AddBusinessDays(fourteenthDay, -2, holidays);\n                    return twelfthDay.Add(new TimeSpan(12,0,0));\n                })\n            },\n            // Meats group\n            // LiveCattle (LE): http://www.cmegroup.com/trading/agricultural/livestock/live-cattle_contract_specifications.html\n            {Symbol.Create(Futures.Meats.LiveCattle, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Meats.LiveCattle;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts of (Feb, Apr, Jun, Aug, Oct, Dec) listed for 9 months\n                    while (!FutureExpirationCycles.GJMQVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    //Last business day of the contract month, 12:00 p.m.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    return lastBusinessDay.Add(new TimeSpan(12,0,0));\n                })\n            },\n            // LeanHogs (HE): http://www.cmegroup.com/trading/agricultural/livestock/lean-hogs_contract_specifications.html\n            {Symbol.Create(Futures.Meats.LeanHogs, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Meats.LeanHogs;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    /*\n                     2 monthly contracts of:\n                    Feb listed in August\n                    Apr listed in October\n                    May listed in December\n                    Jun listed in December\n                    Jul listed in February\n                    Aug listed in April\n                    Oct listed in May\n                    Dec listed in June\n                     */\n                    while (!FutureExpirationCycles.GJKMNQVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 10th business day of the contract month, 12:00 p.m.\n                    var lastday = new DateTime(time.Year,time.Month,1);\n                    lastday = lastday.AddDays(-1);\n                    var tenthday = FuturesExpiryUtilityFunctions.AddBusinessDays(lastday, 10, holidays);\n                    return tenthday.Add(new TimeSpan(12,0,0));\n                })\n            },\n            // FeederCattle (GF): http://www.cmegroup.com/trading/agricultural/livestock/feeder-cattle_contract_specifications.html\n            {Symbol.Create(Futures.Meats.FeederCattle, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Meats.FeederCattle;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts of (Jan, Mar, Apr, May, Aug, Sep, Oct, Nov) listed for 8 months\n                    while (!FutureExpirationCycles.FHJKQUVX.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    /* Trading shall terminate on the last Thursday of the contract month, except:\n                     * 1. The November contract shall terminate on the Thursday\n                     * prior to Thanksgiving Day, unless a holiday falls on\n                     * that Thursday or on any of the four weekdays prior to\n                     * that Thursday, in which case trading shall terminate on\n                     * the first prior Thursday that is not a holiday and is\n                     * not so preceded by a holiday. Weekdays shall be defined\n                     * as Monday, Tuesday, Wednesday, Thursday and Friday.\n                     * 2. Any contract month in which a holiday falls on the last\n                     * Thursday of the month or on any of the four weekdays\n                     * prior to that Thursday shall terminate on the first\n                     * prior Thursday that is not a holiday and is not so\n                     * preceded by a holiday.*/\n                    var daysInMonth = DateTime.DaysInMonth(time.Year, time.Month);\n                    // Checking condition 1\n                    if(time.Month == 11)\n                    {\n                        var priorThursday = (from day in Enumerable.Range(1, daysInMonth)\n                                  where new DateTime(time.Year, time.Month, day).DayOfWeek == DayOfWeek.Thursday\n                                  select new DateTime(time.Year, time.Month, day)).Reverse().ElementAt(1);\n                        while (!FuturesExpiryUtilityFunctions.NotHoliday(priorThursday, holidays) || !FuturesExpiryUtilityFunctions.NotPrecededByHoliday(priorThursday, holidays))\n                        {\n                            priorThursday = priorThursday.AddDays(-7);\n                        }\n                        return priorThursday;\n                    }\n                    // Checking Condition 2\n                    var lastThursday = (from day in Enumerable.Range(1, daysInMonth)\n                                  where new DateTime(time.Year, time.Month, day).DayOfWeek == DayOfWeek.Thursday\n                                  select new DateTime(time.Year, time.Month, day)).Reverse().ElementAt(0);\n                    while (!FuturesExpiryUtilityFunctions.NotHoliday(lastThursday, holidays) || !FuturesExpiryUtilityFunctions.NotPrecededByHoliday(lastThursday, holidays))\n                    {\n                        lastThursday = lastThursday.AddDays(-7);\n                    }\n                    return lastThursday;\n                })\n            },\n            // Softs group\n            // Cotton #2 (CT): https://www.theice.com/products/254/Cotton-No-2-Futures\n            {Symbol.Create(Futures.Softs.Cotton2, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Softs.Cotton2;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // March, May, July, October, December\n                    while (!FutureExpirationCycles.HKNVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last Trading Day:\n                    // Seventeen business days from end of spot month.\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 17, holidays);\n                })\n            },\n            // Orange Juice (OJ): https://www.theice.com/products/30/FCOJ-A-Futures\n            {Symbol.Create(Futures.Softs.OrangeJuice, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Softs.OrangeJuice;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    // January, March, May, July, September, November.\n                    while (!FutureExpirationCycles.FHKNUX.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 15, holidays);\n                })\n            },\n            // Coffee (KC): https://www.theice.com/products/15/Coffee-C-Futures\n            {Symbol.Create(Futures.Softs.Coffee, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Softs.Coffee;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // March, May, July, September, December.\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last Trading Day:\n                    // One business day prior to last notice day\n                    //\n                    // Last Notice Day:\n                    // Seven business days prior to the last business day off the delivery month\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 9, holidays);\n                })\n            },\n            // Sugar #11 ICE (SB): https://www.theice.com/products/23/Sugar-No-11-Futures\n            {Symbol.Create(Futures.Softs.Sugar11, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Softs.Sugar11;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // March, May, July and October\n                    while (!FutureExpirationCycles.HKNV.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last Trading Day:\n                    // Last business day of the month preceding the delivery month\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time.AddMonths(-1), 1, holidays);\n                })\n            },\n            // Sugar #11 CME (YO): https://www.cmegroup.com/trading/agricultural/softs/sugar-no11_contract_specifications.html\n            {Symbol.Create(Futures.Softs.Sugar11CME, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Softs.Sugar11CME;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading is conducted in the March, May, July, and October cycle for the next 24 months.\n                    while (!FutureExpirationCycles.HKNV.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates on the day immediately preceding the first notice day of the corresponding trading month of Sugar No. 11 futures at ICE Futures U.S.\n                    var precedingMonth = time.AddMonths(-1);\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(precedingMonth, 1, holidays);\n                })\n            },\n            // Cocoa (CC): https://www.theice.com/products/7/Cocoa-Futures\n            {Symbol.Create(Futures.Softs.Cocoa, SecurityType.Future, Market.ICE), (time =>\n                {\n                    var market = Market.ICE;\n                    var symbol = Futures.Softs.Cocoa;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // March, May, July, September, December\n                    while (!FutureExpirationCycles.HKNUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Last Trading Day:\n                    // One business day prior to last notice day\n                    //\n                    // Last Notice Day:\n                    // Ten business days prior to last business day of delivery month\n\n                    return FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 12, holidays);\n                })\n            },\n            // Micro Gold Futures (MGC): https://www.cmegroup.com/markets/metals/precious/e-micro-gold.contractSpecs.html\n            {Symbol.Create(Futures.Metals.MicroGold, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.MicroGold;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Four bi-monthly contracts (Feb/2, Apr/4, Jun/6, Aug/8, Oct/10, Dec/12 cycle)\n                    while (!FutureExpirationCycles.GJMQVZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Silver Futures (SIL): https://www.cmegroup.com/markets/metals/precious/1000-oz-silver.contractSpecs.html\n            {Symbol.Create(Futures.Metals.MicroSilver, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.MicroSilver;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Gold TAS Futures (MGT): https://www.cmegroup.com/markets/metals/precious/e-micro-gold.contractSpecs.html\n            {Symbol.Create(Futures.Metals.MicroGoldTAS, SecurityType.Future, Market.COMEX), (time =>\n                {\n                    var market = Market.COMEX;\n                    var symbol = Futures.Metals.MicroGoldTAS;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Palladium Futures (PAM): https://www.cmegroup.com/markets/metals/precious/e-micro-palladium.contractSpecs.html\n            {Symbol.Create(Futures.Metals.MicroPalladium, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Metals.MicroPalladium;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the third last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Mini Sized NY Gold Futures: https://www.theice.com/products/31500921/Mini-Gold-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Metals.MiniNYGold, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Metals.MiniNYGold;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading terminates on the third last business day of the contract month @13:30\n\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n\n                    return lastBusinessDay.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // Mini Sized NY Silver Futures: https://www.theice.com/products/31500921/Mini-Silver-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Metals.MiniNYSilver, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Metals.MiniNYSilver;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading terminates on the third last business day of the contract month @13:25\n\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n\n                    return lastBusinessDay.Add(new TimeSpan(13, 25, 0));\n                })\n            },\n            // Gold 100 Oz Futures: https://www.theice.com/products/31499002/100-oz-Gold-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Metals.Gold100Oz, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Metals.Gold100Oz;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading terminates on the third last business day of the contract month @13:30\n\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n\n                    return lastBusinessDay.Add(new TimeSpan(13, 30, 0));\n                })\n            },\n            // Silver 5000 Oz Futures: https://www.theice.com/products/31500922/5000-oz-Silver-Future & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf\n            {Symbol.Create(Futures.Metals.Silver5000Oz, SecurityType.Future, Market.NYSELIFFE), (time =>\n                {\n                    var market = Market.NYSELIFFE;\n                    var symbol = Futures.Metals.Silver5000Oz;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Trading terminates on the third last business day of the contract month @13:25\n\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 3, holidays);\n\n                    return lastBusinessDay.Add(new TimeSpan(13, 25, 0));\n                })\n            },\n            // Micro 10-Year Yield Futures (10Y): https://www.cmegroup.com/markets/interest-rates/us-treasury/micro-10-year-yield.contractSpecs.html\n            {Symbol.Create(Futures.Financials.MicroY10TreasuryNote, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.MicroY10TreasuryNote;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro 30-Year Yield Futures (30Y): https://www.cmegroup.com/markets/interest-rates/us-treasury/micro-30-year-yield_contract_specifications.html\n            {Symbol.Create(Futures.Financials.MicroY30TreasuryBond, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.MicroY30TreasuryBond;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro 2-Year Yield Futures (2YY): https://www.cmegroup.com/markets/interest-rates/us-treasury/micro-2-year-yield.contractSpecs.html\n            {Symbol.Create(Futures.Financials.MicroY2TreasuryBond, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.MicroY2TreasuryBond;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro 5-Year Yield Futures (5YY): https://www.cmegroup.com/markets/interest-rates/us-treasury/micro-5-year-yield.contractSpecs.html\n            {Symbol.Create(Futures.Financials.MicroY5TreasuryBond, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    var market = Market.CBOT;\n                    var symbol = Futures.Financials.MicroY5TreasuryBond;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro EUR/USD Futures (M6E): https://www.cmegroup.com/markets/fx/g10/e-micro-euro.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroEUR, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroEUR;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 9:16 a.m. CT 2 business day prior to the 3rd Wednesday of the contract quqrter.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro AUD/USD Futures (M6A): https://www.cmegroup.com/markets/fx/g10/e-micro-australian-dollar.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroAUD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroAUD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // On the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday;\n                })\n            },\n            // Micro GBP/USD Futures (M6B): https://www.cmegroup.com/markets/fx/g10/e-micro-british-pound.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroGBP, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroGBP;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro CAD/USD Futures (MCD): https://www.cmegroup.com/markets/fx/g10/e-micro-canadian-dollar-us-dollar.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroCADUSD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroCADUSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates 1 business day prior to the 3rd Wednesday of the contract quarter.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var firstBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -1, holidays);\n                    firstBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(firstBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return firstBusinessDayPrecedingThirdWednesday;\n                })\n            },\n            // Micro JPY/USD Futures (MJY): https://www.cmegroup.com/markets/fx/g10/e-micro-japanese-yen-us-dollar.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroJPY, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroJPY;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro CHF/USD Futures (MSF): https://www.cmegroup.com/markets/fx/g10/e-micro-swiss-franc-us-dollar.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroCHF, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroCHF;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro USD/JPY Futures (M6J): https://www.cmegroup.com/markets/fx/g10/micro-usd-jpy.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroUSDJPY, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroUSDJPY;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 2 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // 9:16 a.m. Central Time (CT) on the second business day immediately preceding the third Wednesday of the contract month (usually Monday).\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro INR/USD Futures (MIR): https://www.cmegroup.com/markets/fx/g10/e-micro-indian-rupee.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroINRUSD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroINRUSD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 12 consecutive months.\n\n                    // Trading terminates at 12:00 noon Mumbai time two Indian business days immediately preceding the last Indian\n                    // business day of the contract month.\n\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    var secondBusinessDayPrecedingLastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(lastBusinessDay,-2, holidays);\n                    return secondBusinessDayPrecedingLastBusinessDay.Add(new TimeSpan(6,30,0));\n                })\n            },\n            // Micro USD/CAD Futures (M6C): https://www.cmegroup.com/markets/fx/g10/micro-usd-cad.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroCAD, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroCAD;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Two months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                   // Trading terminates at 9:16 a.m. CT, 1 business day prior to the third Wednesday of the contract month.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var firstBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -1, holidays);\n                    firstBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(firstBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return firstBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro USD/CHF Futures (M6S): https://www.cmegroup.com/markets/fx/g10/micro-usd-chf.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroUSDCHF, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroUSDCHF;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Two months in the March quarterly cycle (Mar, Jun, Sep, Dec)\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                   // Trading terminates at 9:16 a.m. CT, 2 business days prior to the third Wednesday of the contract month.\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday, -2, holidays);\n                    secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(secondBusinessDayPrecedingThirdWednesday, -1, holidays);\n\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(14, 16, 0));\n                })\n            },\n            // Micro USD/CNH Futures (MNH): https://www.cmegroup.com/markets/fx/g10/e-micro-cnh.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroUSDCNH, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroUSDCNH;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 12 consecutive months.\n\n                    // Trading terminates at 11:00 a.m. Hong Kong time on the second Hong Kong business day prior\n                    // to the third Wednesday of the contract month.\n\n                    var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(time);\n                    var secondBusinessDayPrecedingThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(thirdWednesday,-2, holidays);\n                    return secondBusinessDayPrecedingThirdWednesday.Add(new TimeSpan(3,0,0));\n                })\n            },\n            // Micro E-mini S&P 500 Index Futures (MES): https://www.cmegroup.com/markets/equities/sp/micro-e-mini-sandp-500.contractSpecs.html\n            {Symbol.Create(Futures.Indices.MicroSP500EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.MicroSP500EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Micro E-mini Nasdaq-100 Index Futures (MNQ): https://www.cmegroup.com/markets/equities/nasdaq/micro-e-mini-nasdaq-100.contractSpecs.html\n            {Symbol.Create(Futures.Indices.MicroNASDAQ100EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.MicroNASDAQ100EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Micro E-mini Russell 2000 Index Futures (M2K): https://www.cmegroup.com/markets/equities/russell/micro-e-mini-russell-2000.contractSpecs.html\n            {Symbol.Create(Futures.Indices.MicroRussell2000EMini, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 5 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading terminates at 9:30 a.m. ET on the 3rd Friday of the contract month.\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.MicroRussell2000EMini, SecurityType.Future, Market.CME));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Micro E-mini Dow Jones Industrial Average Index Futures (MYM): https://www.cmegroup.com/markets/equities/dow-jones/micro-e-mini-dow.contractSpecs.html\n            {Symbol.Create(Futures.Indices.MicroDow30EMini, SecurityType.Future, Market.CBOT), (time =>\n                {\n                    // Quarterly contracts (Mar, Jun, Sep, Dec) listed for 4 consecutive quarters\n                    while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                    {\n                        time = time.AddMonths(1);\n                    }\n\n                    // Trading can occur up to 9:30 a.m. Eastern Time (ET) on the 3rd Friday of the contract month\n                    var thirdFriday = FuturesExpiryUtilityFunctions.ThirdFriday(time, Symbol.Create(Futures.Indices.MicroDow30EMini, SecurityType.Future, Market.CBOT));\n                    return thirdFriday.Add(new TimeSpan(13,30,0));\n                })\n            },\n            // Micro WTI Crude Oil Futures (MCL): https://www.cmegroup.com/markets/energy/crude-oil/micro-wti-crude-oil.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroCrudeOilWTI, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroCrudeOilWTI;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 12 consecutive months and additional Jun and Dec contract months\n\n                    // Trading terminates 4 business days prior to the 25th calendar day of the month prior to the\n                    // contract month (1 business day prior to CL LTD)\n                    // If the 25th calendar day is not a business day, trading terminates 5 business days before the 25th calendar day of the month prior to the contract month.\n\n                    var previousMonth = time.AddMonths(-1);\n                    var twentyFifthDay = new DateTime(previousMonth.Year, previousMonth.Month, 25);\n\n                    var businessDays = -4;\n                    if(!FuturesExpiryUtilityFunctions.NotHoliday(twentyFifthDay, holidays))\n                    {\n                        // if the 25th is a holiday we substract 1 extra bussiness day\n                        businessDays -= 1;\n                    }\n                    return FuturesExpiryUtilityFunctions.AddBusinessDays(twentyFifthDay, businessDays, holidays);\n                })\n            },\n            // Micro Singapore FOB Marine Fuel 0.5% (Platts) Futures (S50): https://www.cmegroup.com/markets/energy/refined-products/micro-singapore-fob-marine-fuel-05-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and next 3 calendar years\n                    // Add monthly contracts for a new calendar year following the termination of trading in the\n                    // December contract of the current year.\n\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Gasoil 0.1% Barges FOB ARA (Platts) Futures (M1B): https://www.cmegroup.com/markets/energy/refined-products/micro-gasoil-01-barges-fob-rdam-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroGasoilZeroPointOnePercentBargesFOBARAPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroGasoilZeroPointOnePercentBargesFOBARAPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n\n                    // Trading terminates on the last London business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro European FOB Rdam Marine Fuel 0.5% Barges (Platts) Futures (R50): https://www.cmegroup.com/markets/energy/refined-products/micro-european-fob-rdam-marine-fuel-05-barges-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and next 3 calendar years.\n                    // Add monthly contracts for a new calendar year following the termination of trading\n                    // in the December contract of the current year.\n\n                    // Trading terminates on the last London business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (MEF): https://www.cmegroup.com/markets/energy/refined-products/micro-european-35-fuel-oil-barges-fob-rdam-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and 5 calendar years.Monthly contracts for a new calendar\n                    // year will be added following the termination of trading in  the December contract of the current year.\n\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Singapore Fuel Oil 380CST (Platts) Futures (MAF): https://www.cmegroup.com/markets/energy/refined-products/micro-singapore-fuel-oil-380cst-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroSingaporeFuelOil380CSTPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and 5 calendar years.Monthly contracts for a new calendar\n                    // year will be added following the termination of trading in  the December contract of the current year.\n\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Coal (API 5) fob Newcastle (Argus/McCloskey) Futures (M5F): https://www.cmegroup.com/markets/energy/coal/micro-coal-api-5-fob-newcastle-argus-mccloskey.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroCoalAPIFivefobNewcastleArgusMcCloskey, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroCoalAPIFivefobNewcastleArgusMcCloskey;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for the current year and the next calendar year. Monthly contracts\n                    // for a new calendar year will be added following the termination of trading in the December\n                    // contract of the current year.\n\n                    // Trading terminates on the last Friday of the contract month. If such Friday is a UK holiday,\n                    // trading terminates on the UK business day immediately prior to the last Friday of the contract\n                    // month unless such day is not an Exchange business day, in which case trading terminates on the\n                    // Exchange business day immediately prior.\n\n                    var lastFriday = FuturesExpiryUtilityFunctions.LastFriday(time);\n\n                    while (holidays.Contains(lastFriday))\n                    {\n                        lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDays(lastFriday, -1, holidays);\n                        while (holidays.Contains(lastFriday))\n                        {\n                            lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDays(lastFriday, -1, holidays);\n                        }\n                    }\n\n                    return lastFriday;\n                })\n            },\n            // Micro European 3.5% Fuel Oil Cargoes FOB Med (Platts) Futures (M35): https://www.cmegroup.com/markets/energy/refined-products/micro-european-35-fuel-oil-cargoes-fob-med-platts.contractSpecs.html\n            {Symbol.Create(Futures.Energy.MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts, SecurityType.Future, Market.NYMEX), (time =>\n                {\n                    var market = Market.NYMEX;\n                    var symbol = Futures.Energy.MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 36 consecutive months\n\n                    // Trading terminates on the last business day of the contract month.\n                    var lastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(time, 1, holidays);\n                    lastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastBusinessDay, -1, holidays);\n\n                    return lastBusinessDay;\n                })\n            },\n            // Micro Ether Futures (MET): https://www.cmegroup.com/markets/cryptocurrencies/ether/micro-ether.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroEther, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroEther;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 6 consecutive months and 2 additional Dec contract months.\n\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month that\n                    // is either a London or U.S. business day. If the last Friday of the contract month day is\n                    // not a business day in both London and the U.S., trading terminates on the prior London or\n                    // U.S. business day.\n\n                    // BTIC: Trading terminates at 4:00 p.m. London time on the last Thursday of the contract month\n                    // that is either a London or U.S. business day. If the last Thursday of the contract month day\n                    // is not a business day in both London and the U.S., trading terminates on the prior London or U.S.\n                    // business day.\n\n                    var lastFriday = FuturesExpiryUtilityFunctions.LastFriday(time);\n                    lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastFriday, -1, holidays);\n\n                    return lastFriday.Add(new TimeSpan(15, 0, 0));\n                })\n            },\n            // Micro Bitcoin Futures (MBT): https://www.cmegroup.com/markets/cryptocurrencies/bitcoin/micro-bitcoin.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.MicroBTC, SecurityType.Future, Market.CME), (time =>\n                {\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.MicroBTC;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                    // Monthly contracts listed for 6 consecutive months and 2 additional Dec contract months.\n                    // If the 6 consecutive months includes Dec, list only 1 additional Dec contract month.\n\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month.\n                    // If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    // BTIC: Trading terminates at 4:00 p.m. London time on the last Thursday of the contract\n                    // month.If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    var lastFriday = FuturesExpiryUtilityFunctions.LastFriday(time);\n                    lastFriday = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastFriday, -1, holidays);\n\n                    return lastFriday.Add(new TimeSpan(15, 0, 0));\n                })\n            },\n            // BTIC on Micro Ether Futures (MRB): https://www.cmegroup.com/markets/cryptocurrencies/ether/micro-ether.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.BTICMicroEther, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Monthly contracts listed for 6 consecutive months and 2 additional Dec contract months.\n\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month.\n                    // If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    // BTIC: Trading terminates at 4:00 p.m. London time on the last Thursday of the contract\n                    // month.If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    var lastThursday = FuturesExpiryUtilityFunctions.LastThursday(time);\n\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.BTICMicroEther;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    while (holidays.Contains(lastThursday))\n                    {\n                        lastThursday = FuturesExpiryUtilityFunctions.AddBusinessDays(lastThursday, -1, holidays);\n                    }\n\n                    return lastThursday.Add(new TimeSpan(15, 0, 0));\n                })\n            },\n            // BTIC on Micro Bitcoin Futures (MIB): https://www.cmegroup.com/markets/cryptocurrencies/bitcoin/micro-bitcoin.contractSpecs.html\n            {Symbol.Create(Futures.Currencies.BTICMicroBTC, SecurityType.Future, Market.CME), (time =>\n                {\n                    // Monthly contracts listed for 6 consecutive months and 2 additional Dec contract months.\n                    // If the 6 consecutive months includes Dec, list only 1 additional Dec contract month.\n\n                    // Trading terminates at 4:00 p.m. London time on the last Friday of the contract month.\n                    // If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    // BTIC: Trading terminates at 4:00 p.m. London time on the last Thursday of the contract\n                    // month.If this is not both a London and U.S. business day, trading terminates on the prior\n                    // London and the U.S. business day.\n\n                    var lastThursday = FuturesExpiryUtilityFunctions.LastThursday(time);\n\n                    var market = Market.CME;\n                    var symbol = Futures.Currencies.BTICMicroBTC;\n                    var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n\n                    while (holidays.Contains(lastThursday))\n                    {\n                        lastThursday = FuturesExpiryUtilityFunctions.AddBusinessDays(lastThursday, -1, holidays);\n                    }\n\n                    return lastThursday.Add(new TimeSpan(15, 0, 0));\n                })\n            }\n        };\n\n        private static Func<DateTime, DateTime> GetDAXFuturesExpiry(string market, string symbol)\n        {\n            return time =>\n            {\n                // Quarterly contracts (Mar/3, Jun/6 , Sep/9 , Dec/12) listed for 9 consecutive quarters and 3 additional December contract months.\n                while (!FutureExpirationCycles.HMUZ.Contains(time.Month))\n                {\n                    time = time.AddMonths(1);\n                }\n\n                // Trading can occur up to 1:00pm CET on the 3rd Friday of the contract month\n                var lastTradingDay = FuturesExpiryUtilityFunctions.ThirdFriday(time);\n                var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(market, symbol);\n                lastTradingDay = FuturesExpiryUtilityFunctions.AddBusinessDaysIfHoliday(lastTradingDay, -1, holidays);\n\n                return lastTradingDay.Add(new TimeSpan(13, 0, 0));\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FuturesExpiryUtilityFunctions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Class to implement common functions used in FuturesExpiryFunctions\n    /// </summary>\n    public static class FuturesExpiryUtilityFunctions\n    {\n        private static readonly MarketHoursDatabase MarketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Get holiday list from the MHDB given the market and the symbol of the security\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>s\n        internal static HashSet<DateTime> GetExpirationHolidays(string market, string symbol)\n        {\n            var exchangeHours = MarketHoursDatabase.FromDataFolder()\n                        .GetEntry(market, symbol, SecurityType.Future)\n                        .ExchangeHours;\n            return exchangeHours.Holidays.Concat(exchangeHours.BankHolidays).ToHashSet();\n        }\n\n        /// <summary>\n        /// Method to retrieve n^th succeeding/preceding business day for a given day\n        /// </summary>\n        /// <param name=\"time\">The current Time</param>\n        /// <param name=\"n\">Number of business days succeeding current time. Use negative value for preceding business days</param>\n        /// <param name=\"holidays\">Set of holidays to exclude. These should be sourced from the <see cref=\"MarketHoursDatabase\"/></param>\n        /// <returns>The date-time after adding n business days</returns>\n        public static DateTime AddBusinessDays(DateTime time, int n, HashSet<DateTime> holidays)\n        {\n            if (n < 0)\n            {\n                var businessDays = -n;\n                var totalDays = 1;\n                do\n                {\n                    var previousDay = time.AddDays(-totalDays);\n                    if (!holidays.Contains(previousDay.Date) && previousDay.IsCommonBusinessDay())\n                    {\n                        businessDays--;\n                    }\n\n                    if (businessDays > 0) totalDays++;\n                } while (businessDays > 0);\n\n                return time.AddDays(-totalDays);\n            }\n            else\n            {\n                var businessDays = n;\n                var totalDays = 1;\n                do\n                {\n                    var previousDay = time.AddDays(totalDays);\n                    if (!holidays.Contains(previousDay.Date) && previousDay.IsCommonBusinessDay())\n                    {\n                        businessDays--;\n                    }\n\n                    if (businessDays > 0) totalDays++;\n                } while (businessDays > 0);\n\n                return time.AddDays(totalDays);\n            }\n        }\n\n        /// <summary>\n        /// Method to retrieve n^th succeeding/preceding business day for a given day if there was a holiday on that day\n        /// </summary>\n        /// <param name=\"time\">The current Time</param>\n        /// <param name=\"n\">Number of business days succeeding current time. Use negative value for preceding business days</param>\n        /// <param name=\"holidayList\">Enumerable of holidays to exclude. These should be sourced from the <see cref=\"MarketHoursDatabase\"/></param>\n        /// <returns>The date-time after adding n business days</returns>\n        public static DateTime AddBusinessDaysIfHoliday(DateTime time, int n, HashSet<DateTime> holidayList)\n        {\n            if (holidayList.Contains(time))\n            {\n                return AddBusinessDays(time, n, holidayList);\n            }\n            else\n            {\n                return time;\n            }\n        }\n\n        /// <summary>\n        /// Method to retrieve the n^th last business day of the delivery month.\n        /// </summary>\n        /// <param name=\"time\">DateTime for delivery month</param>\n        /// <param name=\"n\">Number of days</param>\n        /// <param name=\"holidayList\">Holidays to use while calculating n^th business day. Useful for MHDB entries</param>\n        /// <returns>Nth Last Business day of the month</returns>\n        public static DateTime NthLastBusinessDay(DateTime time, int n, IEnumerable<DateTime> holidayList)\n        {\n            var daysInMonth = DateTime.DaysInMonth(time.Year, time.Month);\n            var lastDayOfMonth = new DateTime(time.Year, time.Month, daysInMonth);\n            var holidays = holidayList.Select(x => x.Date);\n\n            if (n > daysInMonth)\n            {\n                throw new ArgumentOutOfRangeException(nameof(n), Invariant(\n                    $\"Number of days ({n}) is larger than the size of month({daysInMonth})\"\n                ));\n            }\n            // Count the number of days in the month after the third to last business day\n            var businessDays = n;\n            var totalDays = 0;\n            do\n            {\n                var previousDay = lastDayOfMonth.AddDays(-totalDays);\n                if (NotHoliday(previousDay, holidays) && !holidays.Contains(previousDay))\n                {\n                    businessDays--;\n                }\n                if (businessDays > 0) totalDays++;\n            } while (businessDays > 0);\n\n            return lastDayOfMonth.AddDays(-totalDays);\n        }\n\n        /// <summary>\n        /// Calculates the n^th business day of the month (includes checking for holidays)\n        /// </summary>\n        /// <param name=\"time\">Month to calculate business day for</param>\n        /// <param name=\"nthBusinessDay\">n^th business day to get</param>\n        /// <param name=\"holidayList\"> Holidays to not count as business days</param>\n        /// <returns>Nth business day of the month</returns>\n        public static DateTime NthBusinessDay(DateTime time, int nthBusinessDay, IEnumerable<DateTime> holidayList)\n        {\n            var daysInMonth = DateTime.DaysInMonth(time.Year, time.Month);\n            var holidays = holidayList.Select(x => x.Date);\n            if (nthBusinessDay > daysInMonth)\n            {\n                throw new ArgumentOutOfRangeException(Invariant(\n                    $\"Argument nthBusinessDay (${nthBusinessDay}) is larger than the amount of days in the current month (${daysInMonth})\"\n                ));\n            }\n            if (nthBusinessDay < 1)\n            {\n                throw new ArgumentOutOfRangeException(Invariant(\n                    $\"Argument nthBusinessDay (${nthBusinessDay}) is less than one. Provide a number greater than one and less than the days in month\"\n                ));\n            }\n\n            var calculatedTime = new DateTime(time.Year, time.Month, 1);\n\n            var daysCounted = calculatedTime.IsCommonBusinessDay() ? 1 : 0;\n            var i = 0;\n\n            // Check for holiday up here in case we want the first business day and it is a holiday so that we don't skip over it.\n            // We also want to make sure that we don't stop on a weekend.\n            while (daysCounted < nthBusinessDay || holidays.Contains(calculatedTime) || !calculatedTime.IsCommonBusinessDay())\n            {\n                // The asset continues trading on days contained within `USHoliday.Dates`, but\n                // the last trade date is affected by those holidays. We check for\n                // both MHDB entries and holidays to get accurate business days\n                if (holidays.Contains(calculatedTime))\n                {\n                    // Catches edge case where first day is on a friday\n                    if (i == 0 && calculatedTime.DayOfWeek == DayOfWeek.Friday)\n                    {\n                        daysCounted = 0;\n                    }\n\n                    calculatedTime = calculatedTime.AddDays(1);\n\n                    if (i != 0 && calculatedTime.IsCommonBusinessDay())\n                    {\n                        daysCounted++;\n                    }\n                    i++;\n                    continue;\n                }\n\n                calculatedTime = calculatedTime.AddDays(1);\n\n                if (!holidays.Contains(calculatedTime) && NotHoliday(calculatedTime, holidays))\n                {\n                    daysCounted++;\n                }\n                i++;\n            }\n\n            return calculatedTime;\n        }\n\n        /// <summary>\n        /// Method to retrieve the 2nd Friday of the given month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <returns>2nd Friday of given month</returns>\n        public static DateTime SecondFriday(DateTime time) => NthFriday(time, 2);\n\n        /// <summary>\n        /// Method to retrieve the 3rd Friday of the given month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <returns>3rd Friday of given month</returns>\n        public static DateTime ThirdFriday(DateTime time) => NthFriday(time, 3);\n\n        /// <summary>\n        /// Method to retrieve the Nth Friday of the given month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <param name=\"n\">The order of the Friday in the period</param>\n        /// <returns>Nth Friday of given month</returns>\n        public static DateTime NthFriday(DateTime time, int n) => NthWeekday(time, n, DayOfWeek.Friday);\n\n        /// <summary>\n        /// Method to retrieve third Wednesday of the given month (usually Monday).\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <returns>Third Wednesday of the given month</returns>\n        public static DateTime ThirdWednesday(DateTime time) => NthWeekday(time, 3, DayOfWeek.Wednesday);\n\n        /// <summary>\n        /// Method to retrieve the Nth Weekday of the given month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <param name=\"n\">The order of the Weekday in the period</param>\n        /// <param name=\"dayOfWeek\">The day of the week</param>\n        /// <returns>Nth Weekday of given month</returns>\n        public static DateTime NthWeekday(DateTime time, int n, DayOfWeek dayOfWeek)\n        {\n            if (n < 1 || n > 5)\n            {\n                throw new ArgumentOutOfRangeException(nameof(n), \"'n' lower than 1 or greater than 5\");\n            }\n\n            var daysInMonth = DateTime.DaysInMonth(time.Year, time.Month);\n            return (from day in Enumerable.Range(1, daysInMonth)\n                    where new DateTime(time.Year, time.Month, day).DayOfWeek == dayOfWeek\n                    select new DateTime(time.Year, time.Month, day)).ElementAt(n - 1);\n        }\n\n\n        /// <summary>\n        /// Method to retrieve the last weekday of any month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <param name=\"dayOfWeek\">the last weekday to be found</param>\n        /// <returns>Last day of the we</returns>\n        public static DateTime LastWeekday(DateTime time, DayOfWeek dayOfWeek)\n        {\n\n            var daysInMonth = DateTime.DaysInMonth(time.Year, time.Month);\n            return (from day in Enumerable.Range(1, daysInMonth).Reverse()\n                    where new DateTime(time.Year, time.Month, day).DayOfWeek == dayOfWeek\n                    select new DateTime(time.Year, time.Month, day)).First();\n        }\n\n        /// <summary>\n        /// Method to retrieve the last Thursday of any month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <returns>Last Thursday of the given month</returns>\n        public static DateTime LastThursday(DateTime time) => LastWeekday(time, DayOfWeek.Thursday);\n\n        /// <summary>\n        /// Method to retrieve the last Friday of any month\n        /// </summary>\n        /// <param name=\"time\">Date from the given month</param>\n        /// <returns>Last Friday of the given month</returns>\n        public static DateTime LastFriday(DateTime time) => LastWeekday(time, DayOfWeek.Friday);\n\n        /// <summary>\n        /// Method to check whether a given time is holiday or not\n        /// </summary>\n        /// <param name=\"time\">The DateTime for consideration</param>\n        /// <param name=\"holidayList\">Enumerable of holidays to exclude. These should be sourced from the <see cref=\"MarketHoursDatabase\"/></param>\n        /// <returns>True if the time is not a holidays, otherwise returns false</returns>\n        public static bool NotHoliday(DateTime time, IEnumerable<DateTime> holidayList)\n        {\n            return time.IsCommonBusinessDay() && !holidayList.Contains(time.Date);\n        }\n\n        /// <summary>\n        /// This function takes Thursday as input and returns true if four weekdays preceding it are not Holidays\n        /// </summary>\n        /// <param name=\"thursday\">DateTime of a given Thursday</param>\n        /// <param name=\"holidayList\">Enumerable of holidays to exclude. These should be sourced from the <see cref=\"MarketHoursDatabase\"/></param>\n        /// <returns>False if DayOfWeek is not Thursday or is not preceded by four weekdays,Otherwise returns True</returns>\n        public static bool NotPrecededByHoliday(DateTime thursday, IEnumerable<DateTime> holidayList)\n        {\n            if (thursday.DayOfWeek != DayOfWeek.Thursday)\n            {\n                throw new ArgumentException(\"Input to NotPrecededByHolidays must be a Thursday\");\n            }\n            var result = true;\n            // for Monday, Tuesday and Wednesday\n            for (var i = 1; i <= 3; i++)\n            {\n                if (!NotHoliday(thursday.AddDays(-i), holidayList))\n                {\n                    result = false;\n                }\n            }\n            // for Friday\n            if (!NotHoliday(thursday.AddDays(-6), holidayList))\n            {\n                result = false;\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the number of months between the contract month and the expiry date.\n        /// </summary>\n        /// <param name=\"underlying\">The future symbol ticker</param>\n        /// <param name=\"futureExpiryDate\">Expiry date to use to look up contract month delta. Only used for dairy, since we need to lookup its contract month in a pre-defined table.</param>\n        /// <returns>The number of months between the contract month and the contract expiry</returns>\n        public static int GetDeltaBetweenContractMonthAndContractExpiry(string underlying, DateTime? futureExpiryDate = null)\n        {\n            return ExpiriesPriorMonth.TryGetValue(underlying, out int value) ? value : 0;\n        }\n\n        /// <summary>\n        /// Helper method to retrieve the futures contract month\n        /// </summary>\n        public static DateTime GetFutureContractMonth(Symbol symbol)\n        {\n            if (symbol.SecurityType == SecurityType.FutureOption)\n            {\n                symbol = symbol.Underlying;\n            }\n\n            var contractExpirationDate = symbol.ID.Date.Date;\n            var monthsToAdd = GetDeltaBetweenContractMonthAndContractExpiry(symbol.ID.Symbol, contractExpirationDate);\n            var contractMonth = contractExpirationDate.AddDays(-(contractExpirationDate.Day - 1))\n                .AddMonths(monthsToAdd);\n            return contractMonth;\n        }\n\n        /// <summary>\n        /// Helper method to resolve a future expiration from it's contract month\n        /// </summary>\n        public static DateTime GetFutureExpirationFromContractMonth(string symbol, string market, DateTime contractMonth)\n        {\n            return GetFutureExpirationFromContractMonth(Symbol.CreateFuture(symbol, market, SecurityIdentifier.DefaultDate), contractMonth);\n        }\n\n        /// <summary>\n        /// Helper method to resolve a future expiration from it's contract month\n        /// </summary>\n        public static DateTime GetFutureExpirationFromContractMonth(Symbol future, DateTime contractMonth)\n        {\n            var futureExpiryFunc = FuturesExpiryFunctions.FuturesExpiryFunction(future.Canonical);\n            var futureExpiry = futureExpiryFunc(contractMonth);\n            return futureExpiry;\n        }\n\n        /// <summary>\n        /// This function returns the third Friday of the month, adjusted for holidays and weekends.\n        /// </summary>\n        public static DateTime ThirdFriday(DateTime time, Symbol contract)\n        {\n            if (contract.ID.SecurityType.IsOption())\n            {\n                return ThirdFriday(time, contract.Underlying);\n            }\n            var thirdFriday = ThirdFriday(time);\n            var holidays = GetExpirationHolidays(contract.ID.Market, contract.ID.Symbol);\n            return AddBusinessDaysIfHoliday(thirdFriday, -1, holidays);\n        }\n\n        /// <summary>\n        /// Checks if the future contract is expired.\n        /// </summary>\n        public static bool IsFutureContractExpired(Symbol symbol, DateTime currentUtcTime, MarketHoursDatabase marketHoursDatabase = null)\n        {\n            var exchangeHours = (marketHoursDatabase ?? MarketHoursDatabase).GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var currentTimeInExchangeTz = currentUtcTime.ConvertFromUtc(exchangeHours.TimeZone);\n            if (currentTimeInExchangeTz >= symbol.ID.Date)\n            {\n                return true;\n            }\n\n            return false;\n        }\n\n        private static readonly Dictionary<string, int> ExpiriesPriorMonth = new Dictionary<string, int>\n        {\n            { Futures.Energy.ArgusLLSvsWTIArgusTradeMonth, 1 },\n            { Futures.Energy.ArgusPropaneSaudiAramco, 1 },\n            { Futures.Energy.BrentCrude, 2 },\n            { Futures.Energy.BrentLastDayFinancial, 2 },\n            { Futures.Energy.CrudeOilWTI, 1 },\n            { Futures.Energy.MicroCrudeOilWTI, 1 },\n            { Futures.Energy.Gasoline, 1 },\n            { Futures.Energy.HeatingOil, 1 },\n            { Futures.Energy.MarsArgusVsWTITradeMonth, 1 },\n            { Futures.Energy.NaturalGas, 1 },\n            { Futures.Energy.NaturalGasHenryHubLastDayFinancial, 1 },\n            { Futures.Energy.NaturalGasHenryHubPenultimateFinancial, 1 },\n            { Futures.Energy.WTIHoustonArgusVsWTITradeMonth, 1 },\n            { Futures.Energy.WTIHoustonCrudeOil, 1 },\n            { Futures.Softs.Sugar11, 1 },\n            { Futures.Softs.Sugar11CME, 1 }\n        };\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/FuturesListings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Helpers for getting the futures contracts that are trading on a given date.\n    /// This is a substitute for the BacktestingFutureChainProvider, but\n    /// does not outright replace it because of missing entries. This will resolve\n    /// the listed contracts without having any data in place. We follow the listing rules\n    /// set forth by the exchange to get the <see cref=\"Symbol\"/>s that are listed at a given date.\n    /// </summary>\n    public static class FuturesListings\n    {\n        private static readonly Symbol _zb = Symbol.Create(\"ZB\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zc = Symbol.Create(\"ZC\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zs = Symbol.Create(\"ZS\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zm = Symbol.Create(\"ZM\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zt = Symbol.Create(\"ZT\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zl = Symbol.Create(\"ZL\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _zw = Symbol.Create(\"ZW\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _tn = Symbol.Create(\"TN\", SecurityType.Future, Market.CBOT);\n        private static readonly Symbol _aud = Symbol.Create(\"6A\", SecurityType.Future, Market.CME);\n        private static readonly Symbol _gbp = Symbol.Create(\"6B\", SecurityType.Future, Market.CME);\n        private static readonly Symbol _mxn = Symbol.Create(\"6M\", SecurityType.Future, Market.CME);\n        private static readonly Symbol _jpy = Symbol.Create(\"6J\", SecurityType.Future, Market.CME);\n        private static readonly Symbol _eur = Symbol.Create(\"6E\", SecurityType.Future, Market.CME);\n        private static readonly Symbol _cad = Symbol.Create(\"6C\", SecurityType.Future, Market.CME);\n\n        private static Dictionary<string, Func<DateTime, List<Symbol>>> _futuresListingRules = new Dictionary<string, Func<DateTime, List<Symbol>>>\n        {\n            { \"ZB\", t => QuarterlyContracts(_zb, t, 3) },\n            { \"ZC\", t => MonthlyContractListings(\n                _zc,\n                t,\n                12,\n                new FuturesListingCycles(new[] { 3, 5, 9 }, 9),\n                new FuturesListingCycles(new[] { 7, 12 }, 8)) },\n            { \"ZN\", t => QuarterlyContracts(_zt, t, 3) },\n            { \"TN\", t => QuarterlyContracts(_tn, t, 3) },\n            { \"ZS\", t => MonthlyContractListings(\n                _zs,\n                t,\n                11,\n                new FuturesListingCycles(new[] { 1, 3, 5, 8, 9 }, 15),\n                new FuturesListingCycles(new[] { 7, 11 }, 8)) },\n            { \"ZM\", t => MonthlyContractListings(\n                _zm,\n                t,\n                12,\n                new FuturesListingCycles(new[] { 1, 3, 5, 8, 9 }, 15),\n                new FuturesListingCycles(new[] { 7, 10, 12 }, 12)) },\n            { \"ZL\", t => MonthlyContractListings(\n                _zl,\n                t,\n                12,\n                new FuturesListingCycles(new[] { 1, 3, 5, 8, 9 }, 15),\n                new FuturesListingCycles(new[] { 7, 10, 12 }, 12)) },\n            { \"ZT\", t => QuarterlyContracts(_zt, t, 3) },\n            { \"ZW\", t => MonthlyContractListings(\n                _zw,\n                t,\n                7,\n                new FuturesListingCycles(new[] { 3, 5, 7, 9, 12 }, 15)) },\n            { \"6A\", t => QuarterlyContracts(_aud, t, 8) },\n            { \"6B\", t => QuarterlyContracts(_gbp, t, 8) },\n            { \"6M\", t => QuarterlyContracts(_mxn, t, 8) },\n            { \"6J\", t => QuarterlyContracts(_jpy, t, 8) },\n            { \"6E\", t => QuarterlyContracts(_eur, t, 8) },\n            { \"6C\", t => QuarterlyContracts(_cad, t, 8) },\n        };\n\n        /// <summary>\n        /// Gets the listed futures contracts on a given date\n        /// </summary>\n        /// <param name=\"futureTicker\">Ticker of the future contract</param>\n        /// <param name=\"time\">Contracts to look up that are listed at that time</param>\n        /// <returns>The currently trading contracts on the exchange</returns>\n        public static List<Symbol> ListedContracts(string futureTicker, DateTime time)\n        {\n            if (!_futuresListingRules.ContainsKey(futureTicker))\n            {\n                // No entries found. This differs from entries being returned as an empty array, where\n                // that would mean that no listings were found.\n                return null;\n            }\n\n            return _futuresListingRules[futureTicker](time);\n        }\n\n        /// <summary>\n        /// Gets contracts following a quarterly listing procedure, with a limit of\n        /// how many contracts are listed at once.\n        /// </summary>\n        /// <param name=\"canonicalFuture\">Canonical Futures Symbol</param>\n        /// <param name=\"time\">Contracts to look up that are listed at that time</param>\n        /// <param name=\"limit\">Number of Symbols we get back/are listed at a given time</param>\n        /// <returns>Symbols that are listed at the given time</returns>\n        private static List<Symbol> QuarterlyContracts(Symbol canonicalFuture, DateTime time, int limit)\n        {\n            var contractMonth = new DateTime(time.Year, time.Month, 1);\n            var futureExpiry = DateTime.MinValue;\n            var expiryFunc = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFuture);\n\n            // Skip any contracts that have already expired.\n            while (futureExpiry < time)\n            {\n                futureExpiry = expiryFunc(contractMonth);\n                contractMonth = contractMonth.AddMonths(1);\n            }\n\n            // Negate the last incrementation from the while loop to get the actual contract month of the future.\n            var firstFutureContractMonth = contractMonth.AddMonths(-1);\n\n            var quarterlyContracts = new List<Symbol>();\n            // Gets the next closest month from the current month in multiples of 3\n            var quarterlyContractMonth = (int)Math.Ceiling((double)firstFutureContractMonth.Month / 3) * 3;\n\n            for (var i = 0; i < limit; i++)\n            {\n                // We're past the expiration frontier due to the while loop above, which means\n                // that any contracts from here on out will be greater than the current time.\n                var currentContractMonth = firstFutureContractMonth.AddMonths(-firstFutureContractMonth.Month + quarterlyContractMonth);\n                var currentFutureExpiry = expiryFunc(currentContractMonth);\n\n                quarterlyContracts.Add(Symbol.CreateFuture(canonicalFuture.ID.Symbol, canonicalFuture.ID.Market, currentFutureExpiry));\n                quarterlyContractMonth += 3;\n            }\n\n            return quarterlyContracts;\n        }\n\n        /// <summary>\n        /// Gets Futures contracts that follow a limited cyclical pattern\n        /// </summary>\n        /// <param name=\"canonicalFuture\">Canonical Futures Symbol</param>\n        /// <param name=\"time\">Contracts to look up that are listed at that time</param>\n        /// <param name=\"contractMonthForNewListings\">Contract month that results in new listings after this contract's expiry</param>\n        /// <param name=\"futureListingCycles\">\n        /// Cycles that define the number of contracts and the months the contracts are listed on, including\n        /// the limit of how many contracts will be listed.\n        /// </param>\n        /// <returns>Symbols that are listed at the given time</returns>\n        private static List<Symbol> MonthlyContractListings(\n            Symbol canonicalFuture,\n            DateTime time,\n            int contractMonthForNewListings,\n            params FuturesListingCycles[] futureListingCycles)\n        {\n            var listings = new List<Symbol>();\n            var expiryFunc = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFuture);\n            var yearDelta = 0;\n\n            var contractMonthForNewListingCycle = new DateTime(time.Year, contractMonthForNewListings, 1);\n            var contractMonthForNewListingCycleExpiry = expiryFunc(contractMonthForNewListingCycle);\n\n            if (time <= contractMonthForNewListingCycleExpiry)\n            {\n                // Go back a year if we haven't yet crossed this year's contract renewal expiration date.\n                contractMonthForNewListingCycleExpiry = expiryFunc(contractMonthForNewListingCycle.AddYears(-1));\n                yearDelta = -1;\n            }\n\n            foreach (var listingCycle in futureListingCycles)\n            {\n                var year = yearDelta;\n                var count = 0;\n                var initialListings = true;\n\n                while (count != listingCycle.Limit)\n                {\n                    var monthStartIndex = 0;\n                    if (initialListings)\n                    {\n                        // For the initial listing, we want to start counting at some month that might not be the first\n                        // index of the collection. The index is discovered here and used as the starting point for listed contracts.\n                        monthStartIndex = listingCycle.Cycle.Length - listingCycle.Cycle.Count(c => c > contractMonthForNewListingCycleExpiry.Month);\n                        initialListings = false;\n                    }\n\n                    for (var m = monthStartIndex; m < listingCycle.Cycle.Length; m++)\n                    {\n                        // Add the future's expiration to the listings\n                        var currentContractMonth = new DateTime(time.Year + year, listingCycle.Cycle[m], 1);\n                        var currentFutureExpiry = expiryFunc(currentContractMonth);\n                        if (currentFutureExpiry >= time)\n                        {\n                            listings.Add(Symbol.CreateFuture(canonicalFuture.ID.Symbol, canonicalFuture.ID.Market, currentFutureExpiry));\n                        }\n\n                        if (++count == listingCycle.Limit)\n                        {\n                            break;\n                        }\n                    }\n\n                    year++;\n                }\n            }\n\n            return listings;\n        }\n\n        /// <summary>\n        /// Listing Cycles, i.e. the months and number of contracts that are renewed whenever\n        /// the specified renewal expiration contract expires.\n        /// </summary>\n        /// <remarks>\n        /// Example:\n        ///\n        ///   (from: https://www.cmegroup.com/trading/agricultural/grain-and-oilseed/wheat_contract_specifications.html)\n        ///   \"15 monthly contracts of Mar, May, Jul, Sep, Dec listed annually following the termination of trading in the July contract of the current year.\"\n        ///\n        /// This would equate to a cycle of [3, 5, 7, 9, 12], a limit of 15, and the contract month == 7.\n        /// </remarks>\n        private class FuturesListingCycles\n        {\n            /// <summary>\n            /// Monthly cycles that the futures listings rule follows\n            /// </summary>\n            public int[] Cycle { get; }\n\n            /// <summary>\n            /// Max number of contracts returned by this rule\n            /// </summary>\n            public int Limit { get; }\n\n\n            /// <summary>\n            /// Creates a listing cycle rule\n            /// </summary>\n            /// <param name=\"cycle\">New contract listing cycles</param>\n            /// <param name=\"limit\">Max number of contracts to return in this rule</param>\n            public FuturesListingCycles(int[] cycle, int limit)\n            {\n                Cycle = cycle;\n                Limit = limit;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Future/MarginRequirementsEntry.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// POCO class for modeling margin requirements at given date\n    /// </summary>\n    public class MarginRequirementsEntry\n    {\n        /// <summary>\n        /// Date of margin requirements change\n        /// </summary>\n        public DateTime Date { get; init; }\n\n        /// <summary>\n        /// Initial overnight margin for the contract effective from the date of change\n        /// </summary>\n        public decimal InitialOvernight { get; init; }\n\n        /// <summary>\n        /// Maintenance overnight margin for the contract effective from the date of change\n        /// </summary>\n        public decimal MaintenanceOvernight { get; init; }\n\n        /// <summary>\n        /// Initial intraday margin for the contract effective from the date of change\n        /// </summary>\n        public decimal InitialIntraday { get; init; }\n\n        /// <summary>\n        /// Maintenance intraday margin for the contract effective from the date of change\n        /// </summary>\n        public decimal MaintenanceIntraday { get; init; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"MarginRequirementsEntry\"/> from the specified csv line\n        /// </summary>\n        /// <param name=\"csvLine\">The csv line to be parsed</param>\n        /// <returns>A new <see cref=\"MarginRequirementsEntry\"/> for the specified csv line</returns>\n        public static MarginRequirementsEntry Create(string csvLine)\n        {\n            var line = csvLine.Split(',');\n\n            DateTime date;\n            if (!DateTime.TryParseExact(line[0], DateFormat.EightCharacter, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n            {\n                Log.Trace($\"Couldn't parse date/time while reading future margin requirement file. Line: {csvLine}\");\n            }\n\n            decimal initialOvernight;\n            if (!decimal.TryParse(line[1], out initialOvernight))\n            {\n                Log.Trace($\"Couldn't parse Initial Overnight margin requirements while reading future margin requirement file. Line: {csvLine}\");\n            }\n\n            decimal maintenanceOvernight;\n            if (!decimal.TryParse(line[2], out maintenanceOvernight))\n            {\n                Log.Trace($\"Couldn't parse Maintenance Overnight margin requirements while reading future margin requirement file. Line: {csvLine}\");\n            }\n\n            // default value, if present in file we try to parse\n            decimal initialIntraday = initialOvernight * 0.4m;\n            if (line.Length >= 4\n                && !decimal.TryParse(line[3], out initialIntraday))\n            {\n                Log.Trace($\"Couldn't parse Initial Intraday margin requirements while reading future margin requirement file. Line: {csvLine}\");\n            }\n\n            // default value, if present in file we try to parse\n            decimal maintenanceIntraday = maintenanceOvernight * 0.4m;\n            if (line.Length >= 5\n                && !decimal.TryParse(line[4], out maintenanceIntraday))\n            {\n                Log.Trace($\"Couldn't parse Maintenance Intraday margin requirements while reading future margin requirement file. Line: {csvLine}\");\n            }\n\n            return new MarginRequirementsEntry\n            {\n                Date = date,\n                InitialOvernight = initialOvernight,\n                MaintenanceOvernight = maintenanceOvernight,\n                InitialIntraday = initialIntraday,\n                MaintenanceIntraday = maintenanceIntraday\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/Api/CMEOptionChainQuotes.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.FutureOption.Api\n{\n    /// <summary>\n    /// CME Option Chain Quotes API call root response\n    /// </summary>\n    public class CMEOptionChainQuotes\n    {\n        /// <summary>\n        /// The future options contracts with/without settlements\n        /// </summary>\n        [JsonProperty(\"optionContractQuotes\")]\n        public List<CMEOptionChainQuoteEntry> Quotes { get; private set; }\n    }\n\n    /// <summary>\n    /// Option chain entry quotes, containing strike price\n    /// </summary>\n    public class CMEOptionChainQuoteEntry\n    {\n        /// <summary>\n        /// Strike price of the future option quote entry\n        /// </summary>\n        [JsonProperty(\"strikePrice\"), JsonConverter(typeof(StringDecimalJsonConverter), true)]\n        public decimal StrikePrice { get; private set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/Api/CMEOptionsCategoryList.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.FutureOption.Api\n{\n    /// <summary>\n    /// CME options trades, dates, and expiration list API call root response\n    /// </summary>\n    /// <remarks>Returned as a List of this class</remarks>\n    public class CMEOptionsTradeDatesAndExpiration\n    {\n        /// <summary>\n        /// Describes the type of future option this entry is\n        /// </summary>\n        [JsonProperty(\"label\")]\n        public string Label { get; private set; }\n\n        /// <summary>\n        /// Name of the product\n        /// </summary>\n        [JsonProperty(\"name\")]\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// Option type. \"AME\" for American, \"EUR\" for European.\n        /// Note that there are other types such as weekly, but we\n        /// only support American options for now.\n        /// </summary>\n        [JsonProperty(\"optionType\")]\n        public string OptionType { get; private set; }\n\n        /// <summary>\n        /// Product ID of the option\n        /// </summary>\n        [JsonProperty(\"productId\")]\n        public int ProductId { get; private set; }\n\n        /// <summary>\n        /// Is Daily option\n        /// </summary>\n        [JsonProperty(\"daily\")]\n        public bool Daily { get; private set; }\n\n        /// <summary>\n        /// ???\n        /// </summary>\n        [JsonProperty(\"sto\")]\n        public bool Sto { get; private set; }\n\n        /// <summary>\n        /// Is weekly option\n        /// </summary>\n        [JsonProperty(\"weekly\")]\n        public bool Weekly { get; private set; }\n\n        /// <summary>\n        /// Expirations of the future option\n        /// </summary>\n        [JsonProperty(\"expirations\")]\n        public List<CMEOptionsExpiration> Expirations { get; private set; }\n    }\n\n    /// <summary>\n    /// Future options Expiration entries. These are useful because we can derive the\n    /// future chain from this data, since FOP and FUT share a 1-1 expiry code.\n    /// </summary>\n    public class CMEOptionsExpiration\n    {\n        /// <summary>\n        /// Date of expiry\n        /// </summary>\n        [JsonProperty(\"label\")]\n        public string Label { get; private set; }\n\n        /// <summary>\n        /// Product ID of the expiring asset (usually future option)\n        /// </summary>\n        [JsonProperty(\"productId\")]\n        public int ProductId { get; private set; }\n\n        /// <summary>\n        /// Contract ID of the asset\n        /// </summary>\n        /// <remarks>Used to search settlements for the option chain</remarks>\n        [JsonProperty(\"contractId\")]\n        public string ContractId { get; private set; }\n\n        /// <summary>\n        /// Contract month code formatted as [FUTURE_MONTH_LETTER(1)][YEAR(1)]\n        /// </summary>\n        [JsonProperty(\"expiration\")]\n        public CMEOptionExpirationEntry Expiration { get; private set; }\n    }\n\n    /// <summary>\n    /// Chicago Mercantile Exchange Option Expiration Entry\n    /// </summary>\n    public class CMEOptionExpirationEntry\n    {\n        /// <summary>\n        /// Month of expiry\n        /// </summary>\n        [JsonProperty(\"month\")]\n        public int Month { get; private set; }\n\n        /// <summary>\n        /// Year of expiry\n        /// </summary>\n        [JsonProperty(\"year\")]\n        public int Year { get; private set; }\n\n        /// <summary>\n        /// Expiration code (two letter)\n        /// </summary>\n        [JsonProperty(\"code\")]\n        public string Code { get; private set; }\n\n        /// <summary>\n        /// Expiration code (three letter)\n        /// </summary>\n        [JsonProperty(\"twoDigitsCode\")]\n        public string TwoDigitsCode { get; private set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/Api/CMEProductSlateV2.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Securities.FutureOption.Api\n{\n    /// <summary>\n    /// Product slate API call root response\n    /// </summary>\n    public class CMEProductSlateV2ListResponse\n    {\n        /// <summary>\n        /// Products matching the search criteria\n        /// </summary>\n        [JsonProperty(\"products\")]\n        public List<CMEProductSlateV2ListEntry> Products { get; private set; }\n    }\n\n    /// <summary>\n    /// Product entry describing the asset matching the search criteria\n    /// </summary>\n    public class CMEProductSlateV2ListEntry\n    {\n        /// <summary>\n        /// CME ID for the asset\n        /// </summary>\n        [JsonProperty(\"id\")]\n        public int Id { get; private set; }\n\n        /// <summary>\n        /// Name of the product (e.g. E-mini NASDAQ futures)\n        /// </summary>\n        [JsonProperty(\"name\")]\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// Clearing code\n        /// </summary>\n        [JsonProperty(\"clearing\")]\n        public string Clearing { get; private set; }\n\n        /// <summary>\n        /// GLOBEX ticker\n        /// </summary>\n        [JsonProperty(\"globex\")]\n        public string Globex { get; private set; }\n\n        /// <summary>\n        /// Is traded in the GLOBEX venue\n        /// </summary>\n        [JsonProperty(\"globexTraded\")]\n        public bool GlobexTraded { get; private set; }\n\n        /// <summary>\n        /// Venues this asset trades on\n        /// </summary>\n        [JsonProperty(\"venues\")]\n        public string Venues { get; private set; }\n\n        /// <summary>\n        /// Asset type this product is cleared as (i.e. \"Futures\", \"Options\")\n        /// </summary>\n        [JsonProperty(\"cleared\")]\n        public string Cleared { get; private set; }\n\n        /// <summary>\n        /// Exchange the asset trades on (i.e. CME, NYMEX, COMEX, CBOT)\n        /// </summary>\n        [JsonProperty(\"exch\")]\n        public string Exchange { get; private set; }\n\n        /// <summary>\n        /// Asset class group ID - describes group of asset class (e.g. equities, agriculture, etc.)\n        /// </summary>\n        [JsonProperty(\"groupId\")]\n        public int GroupId { get; private set; }\n\n        /// <summary>\n        /// More specific ID describing product\n        /// </summary>\n        [JsonProperty(\"subGroupId\")]\n        public int subGroupId { get; private set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/Api/CMEStrikePriceScalingFactors.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.FutureOption\n{\n    /// <summary>\n    /// Provides a means to get the scaling factor for CME's quotes API\n    /// </summary>\n    public class CMEStrikePriceScalingFactors\n    {\n        /// <summary>\n        /// CME's option chain quotes strike price scaling factor\n        /// </summary>\n        private static readonly IReadOnlyDictionary<string, decimal> _scalingFactors = new Dictionary<string, decimal>\n        {\n            { \"SI\", 0.1m },\n            { \"NG\", 5m }\n        };\n\n        /// <summary>\n        /// Gets the option chain strike price scaling factor for the quote response from CME\n        /// </summary>\n        /// <param name=\"underlyingFuture\">Underlying future Symbol to normalize</param>\n        /// <returns>Scaling factor for the strike price</returns>\n        public static decimal GetScaleFactor(Symbol underlyingFuture)\n        {\n            return _scalingFactors.ContainsKey(underlyingFuture.ID.Symbol)\n                ? _scalingFactors[underlyingFuture.ID.Symbol]\n                : 1m;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FutureOption.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities.FutureOption\n{\n    /// <summary>\n    /// Futures Options security\n    /// </summary>\n    public class FutureOption : Option.Option\n    {\n        /// <summary>\n        /// Constructor for the future option security\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the future option</param>\n        /// <param name=\"exchangeHours\">Exchange hours of the future option</param>\n        /// <param name=\"quoteCurrency\">Quoted currency of the future option</param>\n        /// <param name=\"symbolProperties\">Symbol properties of the future option</param>\n        /// <param name=\"currencyConverter\">Currency converter</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered to the algorithm</param>\n        /// <param name=\"securityCache\">Cache of security objects</param>\n        /// <param name=\"underlying\">Future underlying security</param>\n        public FutureOption(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            OptionSymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache,\n            Security underlying)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new OptionExchange(exchangeHours),\n                securityCache,\n                new OptionPortfolioModel(),\n                new FutureOptionFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                null,\n                new OptionDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                underlying,\n                null\n        )\n        {\n            BuyingPowerModel = new FuturesOptionsMarginModel(0, this);\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(FutureOption security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FutureOptionSymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities.FutureOption\n{\n    /// <summary>\n    /// Static helper methods to resolve Futures Options Symbol-related tasks.\n    /// </summary>\n    public static class FutureOptionSymbol\n    {\n        /// <summary>\n        /// Detects if the future option contract is standard, i.e. not weekly, not short-term, not mid-sized, etc.\n        /// </summary>\n        /// <param name=\"_\">Symbol</param>\n        /// <returns>true</returns>\n        /// <remarks>\n        /// We have no way of identifying the type of FOP contract based on the properties contained within the Symbol.\n        /// </remarks>\n        public static bool IsStandard(Symbol _) => true;\n\n        /// <summary>\n        /// Gets the last day of trading, aliased to be the Futures options' expiry\n        /// </summary>\n        /// <param name=\"symbol\">Futures Options Symbol</param>\n        /// <returns>Last day of trading date</returns>\n        public static DateTime GetLastDayOfTrading(Symbol symbol) => symbol.ID.Date.Date;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Securities.FutureOption\n{\n    /// <summary>\n    /// Futures options expiry lookup utility class\n    /// </summary>\n    public static class FuturesOptionsExpiryFunctions\n    {\n        private static readonly Symbol _lo = Symbol.CreateCanonicalOption(Symbol.Create(\"CL\", SecurityType.Future, Market.NYMEX));\n        private static readonly Symbol _on = Symbol.CreateCanonicalOption(Symbol.Create(\"NG\", SecurityType.Future, Market.NYMEX));\n        private static readonly Symbol _ozm = Symbol.CreateCanonicalOption(Symbol.Create(\"ZM\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozb = Symbol.CreateCanonicalOption(Symbol.Create(\"ZB\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozc = Symbol.CreateCanonicalOption(Symbol.Create(\"ZC\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozn = Symbol.CreateCanonicalOption(Symbol.Create(\"ZN\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _otn = Symbol.CreateCanonicalOption(Symbol.Create(\"TN\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _oub = Symbol.CreateCanonicalOption(Symbol.Create(\"UB\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozo = Symbol.CreateCanonicalOption(Symbol.Create(\"ZO\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _oke = Symbol.CreateCanonicalOption(Symbol.Create(\"KE\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozf = Symbol.CreateCanonicalOption(Symbol.Create(\"ZF\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozs = Symbol.CreateCanonicalOption(Symbol.Create(\"ZS\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozt = Symbol.CreateCanonicalOption(Symbol.Create(\"ZT\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozl = Symbol.CreateCanonicalOption(Symbol.Create(\"ZL\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _ozw = Symbol.CreateCanonicalOption(Symbol.Create(\"ZW\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _oym = Symbol.CreateCanonicalOption(Symbol.Create(\"YM\", SecurityType.Future, Market.CBOT));\n        private static readonly Symbol _hxe = Symbol.CreateCanonicalOption(Symbol.Create(\"HG\", SecurityType.Future, Market.COMEX));\n        private static readonly Symbol _og = Symbol.CreateCanonicalOption(Symbol.Create(\"GC\", SecurityType.Future, Market.COMEX));\n        private static readonly Symbol _so = Symbol.CreateCanonicalOption(Symbol.Create(\"SI\", SecurityType.Future, Market.COMEX));\n        private static readonly Symbol _aud = Symbol.CreateCanonicalOption(Symbol.Create(\"6A\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _gbu = Symbol.CreateCanonicalOption(Symbol.Create(\"6B\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _cau = Symbol.CreateCanonicalOption(Symbol.Create(\"6C\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _euu = Symbol.CreateCanonicalOption(Symbol.Create(\"6E\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _jpu = Symbol.CreateCanonicalOption(Symbol.Create(\"6J\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _chu = Symbol.CreateCanonicalOption(Symbol.Create(\"6S\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _nzd = Symbol.CreateCanonicalOption(Symbol.Create(\"6N\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _mxn = Symbol.CreateCanonicalOption(Symbol.Create(\"6M\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _le = Symbol.CreateCanonicalOption(Symbol.Create(\"LE\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _he = Symbol.CreateCanonicalOption(Symbol.Create(\"HE\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _lbr = Symbol.CreateCanonicalOption(Symbol.Create(\"LBR\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _lbs = Symbol.CreateCanonicalOption(Symbol.Create(\"LBS\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _es = Symbol.CreateCanonicalOption(Symbol.Create(\"ES\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _emd = Symbol.CreateCanonicalOption(Symbol.Create(\"EMD\", SecurityType.Future, Market.CME));\n        private static readonly Symbol _nq = Symbol.CreateCanonicalOption(Symbol.Create(\"NQ\", SecurityType.Future, Market.CME));\n\n        /// <summary>\n        /// Futures options expiry functions lookup table, keyed by canonical future option Symbol\n        /// </summary>\n        private static readonly IReadOnlyDictionary<Symbol, Func<DateTime, DateTime>> _futuresOptionExpiryFunctions = new Dictionary<Symbol, Func<DateTime,DateTime>>\n        {\n            // Trading terminates 7 business days before the 26th calendar of the month prior to the contract month. https://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_contractSpecs_options.html#optionProductId=190\n            {_lo, expiryMonth => {\n                var twentySixthDayOfPreviousMonthFromContractMonth = expiryMonth.AddMonths(-1).AddDays(-(expiryMonth.Day - 1)).AddDays(25);\n                var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(_lo.ID.Market, _lo.Underlying.ID.Symbol);\n\n                return FuturesExpiryUtilityFunctions.AddBusinessDays(twentySixthDayOfPreviousMonthFromContractMonth, -7, holidays);\n            }},\n            // Trading terminates on the 4th last business day of the month prior to the contract month (1 business day prior to the expiration of the underlying futures corresponding contract month).\n            // https://www.cmegroup.com/trading/energy/natural-gas/natural-gas_contractSpecs_options.html\n            // Although not stated, this follows the same rules as seen in the COMEX markets, but without Fridays. Case: Dec 2020 expiry, Last Trade Date: 24 Nov 2020\n            { _on, expiryMonth => FourthLastBusinessDayInPrecedingMonthFromContractMonth(_on.Underlying, expiryMonth, 0, 0, noFridays: false) },\n            { _ozb, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozb.Underlying, expiryMonth) },\n            { _ozc, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozc.Underlying, expiryMonth) },\n            { _ozn, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozn.Underlying, expiryMonth) },\n            { _otn, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_otn.Underlying, expiryMonth) },\n            { _oub, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_oub.Underlying, expiryMonth) },\n            { _ozo, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozo.Underlying, expiryMonth) },\n            { _oke, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_oke.Underlying, expiryMonth) },\n            { _ozf, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozf.Underlying, expiryMonth) },\n            { _ozs, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozs.Underlying, expiryMonth) },\n            { _ozt, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozt.Underlying, expiryMonth) },\n            { _ozw, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozw.Underlying, expiryMonth) },\n            { _ozl, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozl.Underlying, expiryMonth) },\n            { _ozm, expiryMonth => FridayBeforeTwoBusinessDaysBeforeEndOfMonth(_ozm.Underlying, expiryMonth) },\n            { _hxe, expiryMonth => FourthLastBusinessDayInPrecedingMonthFromContractMonth(_hxe.Underlying, expiryMonth, 12, 0) },\n            { _og, expiryMonth => FourthLastBusinessDayInPrecedingMonthFromContractMonth(_og.Underlying, expiryMonth, 12, 30) },\n            { _so, expiryMonth => FourthLastBusinessDayInPrecedingMonthFromContractMonth(_so.Underlying, expiryMonth, 12, 25) },\n            { _aud, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_aud.Underlying, expiryMonth) },\n            { _gbu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_gbu.Underlying, expiryMonth) },\n            { _cau, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_cau.Underlying, expiryMonth) },\n            { _euu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_euu.Underlying, expiryMonth) },\n            { _jpu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_jpu.Underlying, expiryMonth) },\n            { _chu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_chu.Underlying, expiryMonth) },\n            { _nzd, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_nzd.Underlying, expiryMonth) },\n            { _mxn, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_mxn.Underlying, expiryMonth) },\n            { _le, expiryMonth => FirstFridayOfContractMonth(_le.Underlying, expiryMonth) },\n            { _he, expiryMonth => TenthBusinessDayOfContractMonth(_he.Underlying, expiryMonth) },\n            { _lbr, expiryMonth => LastBusinessDayInPrecedingMonthFromContractMonth(_lbr.Underlying, expiryMonth) },\n            { _lbs, expiryMonth => LastBusinessDayInPrecedingMonthFromContractMonth(_lbs.Underlying, expiryMonth) },\n            // even though these FOPs are currently quarterly (as underlying), they had until some serial months. Expiration is the same rule for all\n            { _es, expiryMonth => FuturesExpiryUtilityFunctions.ThirdFriday(expiryMonth, _es) },\n            { _emd, expiryMonth => FuturesExpiryUtilityFunctions.ThirdFriday(expiryMonth, _emd) },\n            { _oym, expiryMonth => FuturesExpiryUtilityFunctions.ThirdFriday(expiryMonth, _oym) },\n            { _nq, expiryMonth => FuturesExpiryUtilityFunctions.ThirdFriday(expiryMonth, _nq) },\n        };\n\n        /// <summary>\n        /// Gets the Futures Options' expiry for the given contract month.\n        /// </summary>\n        /// <param name=\"canonicalFutureOptionSymbol\">Canonical Futures Options Symbol. Will be made canonical if not provided a canonical</param>\n        /// <param name=\"futureContractMonth\">Contract month of the underlying Future</param>\n        /// <returns>Expiry date/time</returns>\n        public static DateTime FuturesOptionExpiry(Symbol canonicalFutureOptionSymbol, DateTime futureContractMonth)\n        {\n            if (!canonicalFutureOptionSymbol.IsCanonical() || !canonicalFutureOptionSymbol.Underlying.IsCanonical())\n            {\n                canonicalFutureOptionSymbol = Symbol.CreateCanonicalOption(\n                    Symbol.Create(canonicalFutureOptionSymbol.Underlying.ID.Symbol,\n                        SecurityType.Future,\n                        canonicalFutureOptionSymbol.Underlying.ID.Market));\n            }\n\n            if (!_futuresOptionExpiryFunctions.TryGetValue(canonicalFutureOptionSymbol, out var expiryFunction))\n            {\n                // No definition exists for this FOP. Let's default to futures expiry.\n                return FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFutureOptionSymbol.Underlying)(futureContractMonth);\n            }\n\n            return expiryFunction(futureContractMonth);\n        }\n\n        /// <summary>\n        /// Gets the Future Option's expiry from the Future Symbol provided\n        /// </summary>\n        /// <param name=\"futureSymbol\">Future (non-canonical) Symbol</param>\n        /// <param name=\"canonicalFutureOption\">The canonical Future Option Symbol</param>\n        /// <returns>Future Option Expiry for the Future with the same contract month</returns>\n        public static DateTime GetFutureOptionExpiryFromFutureExpiry(Symbol futureSymbol, Symbol canonicalFutureOption = null)\n        {\n            var futureContractMonth = FuturesExpiryUtilityFunctions.GetFutureContractMonth(futureSymbol);\n\n            if (canonicalFutureOption == null)\n            {\n                canonicalFutureOption = Symbol.CreateCanonicalOption(\n                    Symbol.Create(futureSymbol.ID.Symbol, SecurityType.Future, futureSymbol.ID.Market));\n            }\n\n            return FuturesOptionExpiry(canonicalFutureOption, futureContractMonth);\n        }\n\n        /// <summary>\n        /// Expiry function for CBOT Futures Options entries.\n        /// Returns the Friday before the 2nd last business day of the month preceding the future contract expiry month.\n        /// </summary>\n        /// <param name=\"underlyingFuture\">Underlying future symbol</param>\n        /// <param name=\"expiryMonth\">Expiry month date</param>\n        /// <returns>Expiry DateTime of the Future Option</returns>\n        private static DateTime FridayBeforeTwoBusinessDaysBeforeEndOfMonth(Symbol underlyingFuture, DateTime expiryMonth)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlyingFuture.ID.Market, underlyingFuture.ID.Symbol);\n\n            var expiryMonthPreceding = expiryMonth.AddMonths(-1).AddDays(-(expiryMonth.Day - 1));\n            var fridayBeforeSecondLastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(\n                expiryMonthPreceding,\n                2,\n                holidays).AddDays(-1);\n\n            while (fridayBeforeSecondLastBusinessDay.DayOfWeek != DayOfWeek.Friday)\n            {\n                fridayBeforeSecondLastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(fridayBeforeSecondLastBusinessDay, -1, holidays);\n            }\n\n            return fridayBeforeSecondLastBusinessDay;\n        }\n\n        /// <summary>\n        /// For Trading that terminates on the 4th last business day of the month prior to the contract month.\n        /// If the 4th last business day occurs on a Friday or the day before a holiday, trading terminates on the\n        /// prior business day. This applies to some NYMEX (with fridays), all COMEX.\n        /// </summary>\n        /// <param name=\"underlyingFuture\">Underlying Future Symbol</param>\n        /// <param name=\"expiryMonth\">Contract expiry month</param>\n        /// <param name=\"hour\">Hour the contract expires at</param>\n        /// <param name=\"minutes\">Minute the contract expires at</param>\n        /// <param name=\"noFridays\">Exclude Friday expiration dates from consideration</param>\n        /// <returns>Expiry DateTime of the Future Option</returns>\n        private static DateTime FourthLastBusinessDayInPrecedingMonthFromContractMonth(Symbol underlyingFuture, DateTime expiryMonth, int hour, int minutes, bool noFridays = true)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlyingFuture.ID.Market, underlyingFuture.ID.Symbol);\n\n            var expiryMonthPreceding = expiryMonth.AddMonths(-1);\n            var fourthLastBusinessDay = FuturesExpiryUtilityFunctions.NthLastBusinessDay(expiryMonthPreceding, 4, holidays);\n\n            if (noFridays)\n            {\n                while (fourthLastBusinessDay.DayOfWeek == DayOfWeek.Friday || holidays.Contains(fourthLastBusinessDay.AddDays(1)))\n                {\n                    fourthLastBusinessDay = FuturesExpiryUtilityFunctions.AddBusinessDays(fourthLastBusinessDay, -1, holidays);\n                }\n            }\n\n            return fourthLastBusinessDay.AddHours(hour).AddMinutes(minutes);\n        }\n\n        /// <summary>\n        /// Expiry function for AUD Future Options expiry.\n        /// Returns the second Friday before the 3rd Wednesday of contract expiry month, 9am.\n        /// </summary>\n        /// <param name=\"underlyingFuture\">Underlying future symbol</param>\n        /// <param name=\"expiryMonth\">Expiry month date</param>\n        /// <returns>Expiry DateTime of the Future Option</returns>\n        private static DateTime SecondFridayBeforeThirdWednesdayOfContractMonth(Symbol underlyingFuture, DateTime expiryMonth)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlyingFuture.ID.Market, underlyingFuture.ID.Symbol);\n            var thirdWednesday = FuturesExpiryUtilityFunctions.ThirdWednesday(expiryMonth);\n            var secondFridayBeforeThirdWednesday = thirdWednesday.AddDays(-12);\n\n            if (holidays.Contains(secondFridayBeforeThirdWednesday))\n            {\n                secondFridayBeforeThirdWednesday = FuturesExpiryUtilityFunctions.AddBusinessDays(secondFridayBeforeThirdWednesday, -1, holidays);\n            }\n\n            return secondFridayBeforeThirdWednesday.AddHours(9);\n        }\n\n        /// <summary>\n        /// First friday of the contract month\n        /// </summary>\n        public static DateTime FirstFridayOfContractMonth(Symbol underlyingFuture, DateTime expiryMonth)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlyingFuture.ID.Market, underlyingFuture.ID.Symbol);\n            var firstFriday = FuturesExpiryUtilityFunctions.NthFriday(expiryMonth, 1);\n            if (holidays.Contains(firstFriday))\n            {\n                firstFriday = FuturesExpiryUtilityFunctions.AddBusinessDays(firstFriday, -1, holidays);\n            }\n            return firstFriday.AddHours(13);\n        }\n\n        /// <summary>\n        /// Tenth business day of the month\n        /// </summary>\n        public static DateTime TenthBusinessDayOfContractMonth(Symbol underlyingFuture, DateTime expiryMonth)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlyingFuture.ID.Market, underlyingFuture.ID.Symbol);\n            return FuturesExpiryUtilityFunctions.NthBusinessDay(expiryMonth, 10, holidays);\n        }\n\n        /// <summary>\n        /// Last business day of the month preceding the contract month\n        /// </summary>\n        private static DateTime LastBusinessDayInPrecedingMonthFromContractMonth(Symbol underlying, DateTime expiryMonth)\n        {\n            var holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(underlying.ID.Market, underlying.ID.Symbol);\n            return FuturesExpiryUtilityFunctions.NthLastBusinessDay(expiryMonth.AddMonths(-1), 1, holidays);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FuturesOptionsMarginModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines a margin model for future options (an option with a future as its underlying).\n    /// We re-use the <see cref=\"FutureMarginModel\"/> implementation and multiply its results\n    /// by 1.5x to simulate the increased margins seen for future options.\n    /// </summary>\n    public class FuturesOptionsMarginModel : FutureMarginModel\n    {\n        private readonly Option _futureOption;\n\n        /// <summary>\n        /// Initial Overnight margin requirement for the contract effective from the date of change\n        /// </summary>\n        public override decimal InitialOvernightMarginRequirement => GetMarginRequirement(_futureOption, base.InitialOvernightMarginRequirement);\n\n        /// <summary>\n        /// Maintenance Overnight margin requirement for the contract effective from the date of change\n        /// </summary>\n        public override decimal MaintenanceOvernightMarginRequirement => GetMarginRequirement(_futureOption, base.MaintenanceOvernightMarginRequirement);\n\n        /// <summary>\n        /// Initial Intraday margin for the contract effective from the date of change\n        /// </summary>\n        public override decimal InitialIntradayMarginRequirement => GetMarginRequirement(_futureOption, base.InitialIntradayMarginRequirement);\n\n        /// <summary>\n        /// Maintenance Intraday margin requirement for the contract effective from the date of change\n        /// </summary>\n        public override decimal MaintenanceIntradayMarginRequirement => GetMarginRequirement(_futureOption, base.MaintenanceIntradayMarginRequirement);\n\n        /// <summary>\n        /// Creates an instance of FutureOptionMarginModel\n        /// </summary>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required unused buying power for the account.</param>\n        /// <param name=\"futureOption\">Option Security containing a Future security as the underlying</param>\n        public FuturesOptionsMarginModel(decimal requiredFreeBuyingPowerPercent = 0, Option futureOption = null) : base(requiredFreeBuyingPowerPercent, futureOption?.Underlying)\n        {\n            _futureOption = futureOption;\n        }\n\n        /// <summary>\n        /// Gets the margin currently alloted to the specified holding.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the option</returns>\n        /// <remarks>\n        /// We fix the option to 1.5x the maintenance because of its close coupling with the underlying.\n        /// The option's contract multiplier is 1x, but might be more sensitive to volatility shocks in the long\n        /// run when it comes to calculating the different market scenarios attempting to simulate VaR, resulting\n        /// in a margin greater than the underlying's margin.\n        /// </remarks>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            var underlyingRequirement = base.GetMaintenanceMargin(parameters.ForUnderlying(parameters.Quantity));\n            var positionSide = parameters.Quantity > 0 ? PositionSide.Long : PositionSide.Short;\n            return GetMarginRequirement(_futureOption, underlyingRequirement, positionSide);\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity of shares</param>\n        /// <returns>The initial margin required for the option (i.e. the equity required to enter a position for this option)</returns>\n        /// <remarks>\n        /// We fix the option to 1.5x the initial because of its close coupling with the underlying.\n        /// The option's contract multiplier is 1x, but might be more sensitive to volatility shocks in the long\n        /// run when it comes to calculating the different market scenarios attempting to simulate VaR, resulting\n        /// in a margin greater than the underlying's margin.\n        /// </remarks>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var underlyingRequirement = base.GetInitialMarginRequirement(parameters.ForUnderlying()).Value;\n            var positionSide = parameters.Quantity > 0 ? PositionSide.Long : PositionSide.Short;\n\n            return new InitialMargin(GetMarginRequirement(_futureOption, underlyingRequirement, positionSide));\n        }\n\n        /// <summary>\n        /// Get's the margin requirement for a future option based on the underlying future margin requirement and the position side to trade.\n        /// FOPs margin requirement is an 'S' curve based on the underlying requirement around it's current price, see https://en.wikipedia.org/wiki/Logistic_function\n        /// </summary>\n        /// <param name=\"option\">The future option contract to trade</param>\n        /// <param name=\"underlyingRequirement\">The underlying future associated margin requirement</param>\n        /// <param name=\"positionSide\">The position side to trade, long by default. This is because short positions require higher margin requirements</param>\n        public static int GetMarginRequirement(Option option, decimal underlyingRequirement, PositionSide positionSide = PositionSide.Long)\n        {\n            var maximumValue = underlyingRequirement;\n            var curveGrowthRate = -7.8m;\n            var underlyingPrice = option.Underlying.Price;\n\n            // If the underlying price is 0, we can't calculate a margin requirement, so return the underlying requirement.\n            // This could be removed after GH issue #6523 is resolved.\n            if (option.Underlying == null || option.Underlying.Price == 0m)\n            {\n                return 0;\n            }\n\n            if (positionSide == PositionSide.Short)\n            {\n                if (option.Right == OptionRight.Call)\n                {\n                    // going short the curve growth rate is slower\n                    curveGrowthRate = -4m;\n                    // curve shifted to the right -> causes a margin requirement increase\n                    underlyingPrice *= 1.5m;\n                }\n                else\n                {\n                    // higher max requirements\n                    maximumValue *= 1.25m;\n                    // puts are inverter from calls\n                    curveGrowthRate = 2.4m;\n                    // curve shifted to the left -> causes a margin requirement increase\n                    underlyingPrice *= 0.30m;\n                }\n            }\n            else\n            {\n                if (option.Right == OptionRight.Put)\n                {\n                    // fastest change rate\n                    curveGrowthRate = 9m;\n                }\n                else\n                {\n                    maximumValue *= 1.20m;\n                }\n            }\n\n            // we normalize the curve growth rate by dividing by the underlyings price\n            // this way, contracts with different order of magnitude price and strike (like CL & ES) share this logic\n            var denominator = Math.Pow(Math.E, (double) (-curveGrowthRate * (option.ScaledStrikePrice - underlyingPrice) / underlyingPrice));\n\n            if (double.IsInfinity(denominator))\n            {\n                return 0;\n            }\n            if (denominator.IsNaNOrZero())\n            {\n                return (int) maximumValue;\n            }\n\n            return (int) (maximumValue / (1 + denominator).SafeDecimalCast());\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FuturesOptionsSymbolMappings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Future\n{\n    /// <summary>\n    /// Provides conversions from a GLOBEX Futures ticker to a GLOBEX Futures Options ticker\n    /// </summary>\n    public static class FuturesOptionsSymbolMappings\n    {\n        /// <summary>\n        /// Defines Futures GLOBEX Ticker -> Futures Options GLOBEX Ticker\n        /// </summary>\n        private static Dictionary<string, string> _futureToFutureOptionsGLOBEX = new Dictionary<string, string>\n        {\n            { \"EH\", \"OEH\" },\n            { \"KE\", \"OKE\" },\n            { \"TN\", \"OTN\" },\n            { \"UB\", \"OUB\" },\n            { \"YM\", \"OYM\" },\n            { \"ZB\", \"OZB\" },\n            { \"ZC\", \"OZC\" },\n            { \"ZF\", \"OZF\" },\n            { \"ZL\", \"OZL\" },\n            { \"ZM\", \"OZM\" },\n            { \"ZN\", \"OZN\" },\n            { \"ZO\", \"OZO\" },\n            { \"ZS\", \"OZS\" },\n            { \"ZT\", \"OZT\" },\n            { \"ZW\", \"OZW\" },\n            { \"RTY\", \"RTO\" },\n            { \"GC\", \"OG\" },\n            { \"HG\", \"HXE\" },\n            { \"SI\", \"SO\" },\n            { \"CL\", \"LO\" },\n            { \"HCL\", \"HCO\" },\n            { \"HO\", \"OH\" },\n            { \"NG\", \"ON\" },\n            { \"PA\", \"PAO\" },\n            { \"PL\", \"PO\" },\n            { \"RB\", \"OB\" },\n            { \"YG\", \"OYG\" },\n            { \"ZG\", \"OZG\" },\n            { \"ZI\", \"OZI\" },\n            { \"6A\", \"ADU\" },\n            { \"6B\", \"GBU\" },\n            { \"6C\", \"CAU\" },\n            { \"6E\", \"EUU\" },\n            { \"6J\", \"JPU\" },\n            { \"6S\", \"CHU\" }\n        };\n\n        private static Dictionary<string, string> _futureOptionsToFutureGLOBEX = _futureToFutureOptionsGLOBEX\n            .ToDictionary(kvp => kvp.Value, kvp => kvp.Key);\n\n        /// <summary>\n        /// Returns the futures options ticker for the given futures ticker.\n        /// </summary>\n        /// <param name=\"futureTicker\">Future GLOBEX ticker to get Future Option GLOBEX ticker for</param>\n        /// <returns>Future option ticker. Defaults to future ticker provided if no entry is found</returns>\n        public static string Map(string futureTicker)\n        {\n            futureTicker = futureTicker.ToUpperInvariant();\n\n            string result;\n            if (!_futureToFutureOptionsGLOBEX.TryGetValue(futureTicker, out result))\n            {\n                return futureTicker;\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Maps a futures options ticker to its underlying future's ticker\n        /// </summary>\n        /// <param name=\"futureOptionTicker\">Future option ticker to map to the underlying</param>\n        /// <returns>Future ticker</returns>\n        public static string MapFromOption(string futureOptionTicker)\n        {\n            futureOptionTicker = futureOptionTicker.ToUpperInvariant();\n\n            string result;\n            if (!_futureOptionsToFutureGLOBEX.TryGetValue(futureOptionTicker, out result))\n            {\n                return futureOptionTicker;\n            }\n\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/FutureOption/FuturesOptionsUnderlyingMapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Securities.FutureOption\n{\n    /// <summary>\n    /// Creates the underlying Symbol that corresponds to a futures options contract\n    /// </summary>\n    /// <remarks>\n    /// Because there can exist futures options (FOP) contracts that have an underlying Future\n    /// that does not have the same contract month as FOPs contract month, we need a way to resolve\n    /// the underlying Symbol of the FOP to the specific future contract it belongs to.\n    ///\n    /// Luckily, these FOPs all follow a pattern as to how the underlying is determined. The\n    /// method <see cref=\"GetUnderlyingFutureFromFutureOption\"/> will automatically resolve the FOP contract's\n    /// underlying Future, and will ensure that the rules of the underlying are being followed.\n    ///\n    /// An example of a contract that this happens to is Gold Futures (FUT=GC, FOP=OG). OG FOPs\n    /// underlying Symbols are not determined by the contract month of the FOP itself, but rather\n    /// by the closest contract to it in an even month.\n    ///\n    /// Examples:\n    ///   OGH21 would have an underlying of GCJ21\n    ///   OGJ21 would have an underlying of GCJ21\n    ///   OGK21 would have an underlying of GCM21\n    ///   OGM21 would have an underlying of GCM21...\n    /// </remarks>\n    public static class FuturesOptionsUnderlyingMapper\n    {\n        private static readonly Dictionary<string, Func<DateTime, DateTime?, DateTime?>> _underlyingFuturesOptionsRules = new Dictionary<string, Func<DateTime, DateTime?, DateTime?>>\n        {\n            // CBOT\n            { \"ZB\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZB\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZC\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZC\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZN\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZN\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZS\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZS\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZM\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZM\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZT\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZT\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZW\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZW\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"ZL\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"ZL\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n            { \"TN\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"TN\", SecurityType.Future, Market.CBOT), d, ld.Value) },\n\n            // COMEX\n            { \"HG\", (d, _) => ContractMonthYearStartThreeMonthsThenEvenOddMonthsSkipRule(d, true) },\n            { \"SI\", (d, _) => ContractMonthYearStartThreeMonthsThenEvenOddMonthsSkipRule(d, true) },\n            { \"GC\", (d, _) => ContractMonthEvenOddMonth(d, false) },\n\n            // CME\n            { \"6A\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6A\", SecurityType.Future, Market.CME), d, ld.Value) },\n            { \"6B\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6B\", SecurityType.Future, Market.CME), d, ld.Value) },\n            { \"6M\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6M\", SecurityType.Future, Market.CME), d, ld.Value) },\n            { \"6J\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6J\", SecurityType.Future, Market.CME), d, ld.Value) },\n            { \"6E\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6E\", SecurityType.Future, Market.CME), d, ld.Value) },\n            { \"6C\", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create(\"6C\", SecurityType.Future, Market.CME), d, ld.Value) },\n        };\n\n        /// <summary>\n        /// The difference in months for the Futures expiry month minus the Futures Options expiry month. This assumes\n        /// that the underlying Future follows a 1-1 mapping between the FOP and future, i.e. this will result in incorrect\n        /// results, but is needed as an intermediate step to resolve the actual expiry.\n        /// </summary>\n        private static readonly IReadOnlyDictionary<string, int> _futuresOptionsExpiryDelta = new Dictionary<string, int>\n        {\n            { \"ZB\", 1 },\n            { \"ZC\", 1 },\n            { \"ZM\", 1 },\n            { \"ZN\", 1 },\n            { \"TN\", 1 },\n            { \"ZS\", 1 },\n            { \"ZT\", 1 },\n            { \"ZW\", 1 },\n            { \"ZL\", 1 },\n            { \"HG\", 1 },\n            { \"GC\", 1 },\n            { \"SI\", 1 },\n            { \"UB\", 1 },\n            { \"ZO\", 1 },\n            { \"KE\", 1 },\n            { \"ZF\", 1 },\n            { \"LBR\", 1 },\n            { \"LBS\", 1 }\n        };\n\n        /// <summary>\n        /// Gets the FOP's underlying Future. The underlying Future's contract month might not match\n        /// the contract month of the Future Option when providing CBOT or COMEX based FOPs contracts to this method.\n        /// </summary>\n        /// <param name=\"futureOptionTicker\">Future option ticker</param>\n        /// <param name=\"market\">Market of the Future Option</param>\n        /// <param name=\"futureOptionExpiration\">Expiration date of the future option</param>\n        /// <param name=\"date\">Date to search the future chain provider with. Optional, but required for CBOT based contracts</param>\n        /// <returns>Symbol if there is an underlying for the FOP, null if there's no underlying found for the Future Option</returns>\n        public static Symbol GetUnderlyingFutureFromFutureOption(string futureOptionTicker, string market, DateTime futureOptionExpiration, DateTime? date = null)\n        {\n            var futureTicker = FuturesOptionsSymbolMappings.MapFromOption(futureOptionTicker);\n            var canonicalFuture = Symbol.Create(futureTicker, SecurityType.Future, market);\n            // Get the contract month of the FOP to use when searching for the underlying.\n            // If the FOP and Future share the same contract month, this is reused as the future's\n            // contract month so that we can resolve the Future's expiry.\n            var contractMonth = GetFutureContractMonthNoRulesApplied(canonicalFuture, futureOptionExpiration);\n\n            if (_underlyingFuturesOptionsRules.ContainsKey(futureTicker))\n            {\n                // The provided ticker follows some sort of rule. Let's figure out the underlying's contract month.\n                var newFutureContractMonth = _underlyingFuturesOptionsRules[futureTicker](contractMonth, date);\n                if (newFutureContractMonth == null)\n                {\n                    // This will only happen when we search the Futures chain for a given contract and no\n                    // closest match could be made, i.e. there are no futures in the chain that come after the FOP's\n                    // contract month.\n                    return null;\n                }\n\n                contractMonth = newFutureContractMonth.Value;\n            }\n\n            var futureExpiry = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFuture)(contractMonth);\n            return Symbol.CreateFuture(futureTicker, market, futureExpiry);\n        }\n\n        /// <summary>\n        /// Searches the futures chain for the next matching futures contract, and resolves the underlying\n        /// as the closest future we can find during or after the contract month.\n        /// </summary>\n        /// <param name=\"canonicalFutureSymbol\">Canonical future Symbol</param>\n        /// <param name=\"futureOptionContractMonth\">Future option contract month. Note that this is not the expiry of the Future Option.</param>\n        /// <param name=\"lookupDate\">The date that we'll be using to look at the Future chain</param>\n        /// <returns>The underlying future's contract month, or null if no closest contract was found</returns>\n        private static DateTime? ContractMonthSerialLookupRule(Symbol canonicalFutureSymbol, DateTime futureOptionContractMonth, DateTime lookupDate)\n        {\n            var futureChain = FuturesListings.ListedContracts(canonicalFutureSymbol.ID.Symbol, lookupDate);\n            if (futureChain == null)\n            {\n                // No matching contract listing rules entry was found\n                return null;\n            }\n\n            foreach (var future in futureChain.OrderBy(s => s.ID.Date))\n            {\n                // Normalize by date first, normalize to a contract month date, then we want to get the contract\n                // month of the Future contract so we normalize by getting the delta between the expiration\n                // and the contract month.\n                var futureContractMonth = FuturesExpiryUtilityFunctions.GetFutureContractMonth(future);\n\n                // We want a contract that is either the same as the contract month or greater\n                if (futureContractMonth < futureOptionContractMonth)\n                {\n                    continue;\n                }\n\n                return futureContractMonth;\n            }\n\n            // No matching/closest contract was found in the futures chain.\n            return null;\n        }\n\n        /// <summary>\n        /// Searches for the closest future's contract month depending on whether the Future Option's contract month is\n        /// on an even or odd month.\n        /// </summary>\n        /// <param name=\"futureOptionContractMonth\">Future option contract month. Note that this is not the expiry of the Future Option.</param>\n        /// <param name=\"oddMonths\">True if the Future Option's underlying future contract month is on odd months, false if on even months</param>\n        /// <returns>The underlying Future's contract month</returns>\n        private static DateTime ContractMonthEvenOddMonth(DateTime futureOptionContractMonth, bool oddMonths)\n        {\n            var monthEven = futureOptionContractMonth.Month % 2 == 0;\n            if (oddMonths && monthEven)\n            {\n                return futureOptionContractMonth.AddMonths(1);\n            }\n            if (!oddMonths && !monthEven)\n            {\n                return futureOptionContractMonth.AddMonths(1);\n            }\n\n            return futureOptionContractMonth;\n        }\n\n        /// <summary>\n        /// Sets the contract month to the third month for the first 3 months, then begins using the <see cref=\"ContractMonthEvenOddMonth\"/> rule.\n        /// </summary>\n        /// <param name=\"futureOptionContractMonth\">Future option contract month. Note that this is not the expiry of the Future Option.</param>\n        /// <param name=\"oddMonths\">True if the Future Option's underlying future contract month is on odd months, false if on even months. Only used for months greater than 3 months</param>\n        /// <returns></returns>\n        private static DateTime ContractMonthYearStartThreeMonthsThenEvenOddMonthsSkipRule(DateTime futureOptionContractMonth, bool oddMonths)\n        {\n            if (futureOptionContractMonth.Month <= 3)\n            {\n                return new DateTime(futureOptionContractMonth.Year, 3, 1);\n            }\n\n            return ContractMonthEvenOddMonth(futureOptionContractMonth, oddMonths);\n        }\n\n        /// <summary>\n        /// Gets the theoretical (i.e. intermediate/naive) future contract month if we assumed a 1-1 mapping\n        /// between FOPs contract months and Futures contract months, i.e. they share the same contract month.\n        /// </summary>\n        /// <param name=\"canonicalFutureSymbol\">Canonical future Symbol</param>\n        /// <param name=\"futureOptionExpirationDate\">Future Option Expiration Date</param>\n        /// <returns>Contract month assuming that the Future Option and Future share the same contract month</returns>\n        public static DateTime GetFutureContractMonthNoRulesApplied(Symbol canonicalFutureSymbol, DateTime futureOptionExpirationDate)\n        {\n            var baseOptionExpiryMonthDate = new DateTime(futureOptionExpirationDate.Year, futureOptionExpirationDate.Month, 1);\n            if (!_futuresOptionsExpiryDelta.ContainsKey(canonicalFutureSymbol.ID.Symbol))\n            {\n                // For contracts like CL, they have no expiry delta between the Futures and FOPs, so we hit this path.\n                // However, it does have a delta between its expiry and contract month, which we adjust here before\n                // claiming that `baseOptionExpiryMonthDate` is the future's contract month.\n                var futuresExpiry = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFutureSymbol)(baseOptionExpiryMonthDate);\n                var futuresDelta = FuturesExpiryUtilityFunctions.GetDeltaBetweenContractMonthAndContractExpiry(canonicalFutureSymbol.ID.Symbol, futuresExpiry);\n\n                return baseOptionExpiryMonthDate.AddMonths(futuresDelta);\n            }\n\n            return baseOptionExpiryMonthDate.AddMonths(_futuresOptionsExpiryDelta[canonicalFutureSymbol.ID.Symbol]);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/GetMaximumOrderQuantityForDeltaBuyingPowerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumOrderQuantityForDeltaBuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// The delta buying power.\n        /// </summary>\n        /// <remarks>Sign defines the position side to apply the delta, positive long, negative short side.</remarks>\n        public decimal DeltaBuyingPower { get; }\n\n        /// <summary>\n        /// True enables the <see cref=\"IBuyingPowerModel\"/> to skip setting <see cref=\"GetMaximumOrderQuantityResult.Reason\"/>\n        /// for non error situations, for performance\n        /// </summary>\n        public bool SilenceNonErrorReasons { get; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes\n        /// </summary>\n        /// <remarks>Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings</remarks>\n        public decimal MinimumOrderMarginPortfolioPercentage { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityForDeltaBuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"deltaBuyingPower\">The delta buying power to apply.\n        /// Sign defines the position side to apply the delta</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes</param>\n        /// <param name=\"silenceNonErrorReasons\">True will not return <see cref=\"GetMaximumOrderQuantityResult.Reason\"/>\n        /// set for non error situation, this is for performance</param>\n        public GetMaximumOrderQuantityForDeltaBuyingPowerParameters(SecurityPortfolioManager portfolio, Security security, decimal deltaBuyingPower,\n            decimal minimumOrderMarginPortfolioPercentage, bool silenceNonErrorReasons = false)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            DeltaBuyingPower = deltaBuyingPower;\n            SilenceNonErrorReasons = silenceNonErrorReasons;\n            MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/GetMaximumOrderQuantityForTargetBuyingPowerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumOrderQuantityForTargetBuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the target signed percentage buying power\n        /// </summary>\n        public decimal TargetBuyingPower { get; }\n\n        /// <summary>\n        /// True enables the <see cref=\"IBuyingPowerModel\"/> to skip setting <see cref=\"GetMaximumOrderQuantityResult.Reason\"/>\n        /// for non error situations, for performance\n        /// </summary>\n        public bool SilenceNonErrorReasons { get; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes\n        /// </summary>\n        /// <remarks>Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings</remarks>\n        public decimal MinimumOrderMarginPortfolioPercentage { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityForTargetBuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"targetBuyingPower\">The target percentage buying power</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes</param>\n        /// <param name=\"silenceNonErrorReasons\">True will not return <see cref=\"GetMaximumOrderQuantityResult.Reason\"/>\n        /// set for non error situation, this is for performance</param>\n        public GetMaximumOrderQuantityForTargetBuyingPowerParameters(SecurityPortfolioManager portfolio, Security security,\n            decimal targetBuyingPower, decimal minimumOrderMarginPortfolioPercentage, bool silenceNonErrorReasons = false)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            TargetBuyingPower = targetBuyingPower;\n            SilenceNonErrorReasons = silenceNonErrorReasons;\n            MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/GetMaximumOrderQuantityResult.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Contains the information returned by <see cref=\"IBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower\"/>\n    /// and  <see cref=\"IBuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumOrderQuantityResult\n    {\n        /// <summary>\n        /// Returns the maximum quantity for the order\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// Returns the reason for which the maximum order quantity is zero\n        /// </summary>\n        public string Reason { get; }\n\n        /// <summary>\n        /// Returns true if the zero order quantity is an error condition and will be shown to the user.\n        /// </summary>\n        public bool IsError { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityResult\"/> class\n        /// </summary>\n        /// <param name=\"quantity\">Returns the maximum quantity for the order</param>\n        /// <param name=\"reason\">The reason for which the maximum order quantity is zero</param>\n        public GetMaximumOrderQuantityResult(decimal quantity, string reason = null)\n        {\n            Quantity = quantity;\n            Reason = reason ?? string.Empty;\n            IsError = !string.IsNullOrEmpty(Reason);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityResult\"/> class\n        /// </summary>\n        /// <param name=\"quantity\">Returns the maximum quantity for the order</param>\n        /// <param name=\"reason\">The reason for which the maximum order quantity is zero</param>\n        /// <param name=\"isError\">True if the zero order quantity is an error condition</param>\n        public GetMaximumOrderQuantityResult(decimal quantity, string reason, bool isError = true)\n        {\n            Quantity = quantity;\n            Reason = reason ?? string.Empty;\n            IsError = isError;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/GetMinimumPriceVariationParameters.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IPriceVariationModel.GetMinimumPriceVariation\"/>\n    /// </summary>\n    public class GetMinimumPriceVariationParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the reference price to be used for the calculation\n        /// </summary>\n        public decimal ReferencePrice { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMinimumPriceVariationParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"referencePrice\">The reference price to be used for the calculation</param>\n        public GetMinimumPriceVariationParameters(Security security, decimal referencePrice)\n        {\n            Security = security;\n            ReferencePrice = referencePrice;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/HasSufficientBuyingPowerForOrderParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.HasSufficientBuyingPowerForOrder\"/>\n    /// </summary>\n    public class HasSufficientBuyingPowerForOrderParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the order\n        /// </summary>\n        public Order Order { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HasSufficientBuyingPowerForOrderParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"order\">The order</param>\n        public HasSufficientBuyingPowerForOrderParameters(SecurityPortfolioManager portfolio, Security security, Order order)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            Order = order;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"HasSufficientBuyingPowerForOrderParameters\"/> targeting the security's underlying.\n        /// If the security does not implement <see cref=\"IDerivativeSecurity\"/> then an <see cref=\"InvalidCastException\"/>\n        /// will be thrown. If the order's symbol does not match the underlying then an <see cref=\"ArgumentException\"/> will\n        /// be thrown.\n        /// </summary>\n        /// <param name=\"order\">The new order targeting the underlying</param>\n        /// <returns>New parameters instance suitable for invoking the sufficient capital method for the underlying security</returns>\n        public HasSufficientBuyingPowerForOrderParameters ForUnderlying(Order order)\n        {\n            var derivative = (IDerivativeSecurity) Security;\n            return new HasSufficientBuyingPowerForOrderParameters(Portfolio, derivative.Underlying, order);\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there is sufficient buying power for the contemplated order\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Sufficient()\n        {\n            return new HasSufficientBuyingPowerForOrderResult(true);\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there is insufficient buying power for the contemplated order\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Insufficient(string reason)\n        {\n            return new HasSufficientBuyingPowerForOrderResult(false, reason);\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there is insufficient buying power for the contemplated order\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Insufficient(FormattableString reason)\n        {\n            return new HasSufficientBuyingPowerForOrderResult(false, Invariant(reason));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/HasSufficientBuyingPowerForOrderResult.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Contains the information returned by <see cref=\"IBuyingPowerModel.HasSufficientBuyingPowerForOrder\"/>\n    /// </summary>\n    public class HasSufficientBuyingPowerForOrderResult\n    {\n        /// <summary>\n        /// Gets true if there is sufficient buying power to execute an order\n        /// </summary>\n        public bool IsSufficient { get; }\n\n        /// <summary>\n        /// Gets the reason for insufficient buying power to execute an order\n        /// </summary>\n        public string Reason { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HasSufficientBuyingPowerForOrderResult\"/> class\n        /// </summary>\n        /// <param name=\"isSufficient\">True if the order can be executed</param>\n        /// <param name=\"reason\">The reason for insufficient buying power</param>\n        public HasSufficientBuyingPowerForOrderResult(bool isSufficient, string reason = null)\n        {\n            IsSufficient = isSufficient;\n            Reason = reason ?? string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IBaseCurrencySymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Interface for various currency symbols\n    /// </summary>\n    public interface IBaseCurrencySymbol\n    {\n        /// <summary>\n        /// Gets the currency acquired by going long this currency pair\n        /// </summary>\n        /// <remarks>\n        /// For example, the EUR/USD has a base currency of the euro, and as a result\n        /// of going long the EUR/USD a trader is acquiring euros in exchange for US dollars\n        /// </remarks>\n        public Cash BaseCurrency { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a security's model of buying power\n    /// </summary>\n    public interface IBuyingPowerModel\n    {\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        decimal GetLeverage(Security security);\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// This is added to maintain backwards compatibility with the old margin/leverage system\n        /// </remarks>\n        /// <param name=\"security\">The security to set leverage for</param>\n        /// <param name=\"leverage\">The new leverage</param>\n        void SetLeverage(Security security, decimal leverage);\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and holdings quantity/cost/value</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters);\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters);\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        InitialMargin GetInitialMarginRequiredForOrder(InitialMarginRequiredForOrderParameters parameters);\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters);\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a position with a given buying power percentage.\n        /// Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the target signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters);\n\n        /// <summary>\n        /// Get the maximum market order quantity to obtain a delta in the buying power used by a security.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower(GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters);\n\n        /// <summary>\n        /// Gets the amount of buying power reserved to maintain the specified position\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the security</param>\n        /// <returns>The reserved buying power in account currency</returns>\n        ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters);\n\n        /// <summary>\n        /// Gets the buying power available for a trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        BuyingPower GetBuyingPower(BuyingPowerParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IChainUniverseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Base interface intended for chain universe data to have some of their symbol properties accessible directly.\n    /// </summary>\n    public interface IChainUniverseData : IBaseData\n    {\n        /// <summary>\n        /// Gets the security identifier.\n        /// </summary>\n        SecurityIdentifier ID { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IContinuousSecurity.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// A continuous security that get's mapped during his life\n    /// </summary>\n    public interface IContinuousSecurity\n    {\n        /// <summary>\n        /// Gets or sets the currently mapped symbol for the security\n        /// </summary>\n        Symbol Mapped { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ICurrencyConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides the ability to convert cash amounts to the account currency\n    /// </summary>\n    public interface ICurrencyConverter\n    {\n        /// <summary>\n        /// Gets account currency\n        /// </summary>\n        string AccountCurrency { get; }\n\n        /// <summary>\n        /// Converts a cash amount to the account currency\n        /// </summary>\n        /// <param name=\"cashAmount\">The <see cref=\"CashAmount\"/> instance to convert</param>\n        /// <returns>A new <see cref=\"CashAmount\"/> instance denominated in the account currency</returns>\n        CashAmount ConvertToAccountCurrency(CashAmount cashAmount);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IDerivativeSecurity.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines a security as a derivative of another security\n    /// </summary>\n    public interface IDerivativeSecurity\n    {\n        /// <summary>\n        /// Gets or sets the underlying security for the derivative\n        /// </summary>\n        Security Underlying { get; set; }\n    }\n}"
  },
  {
    "path": "Common/Securities/IDerivativeSecurityFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Filters a set of derivative symbols using the underlying price data.\n    /// </summary>\n    public interface IDerivativeSecurityFilter<T>\n         where T : IChainUniverseData\n    {\n        /// <summary>\n        /// Filters the input set of symbols represented by the universe\n        /// </summary>\n        /// <param name=\"universe\">derivative symbols universe used in filtering</param>\n        /// <returns>The filtered set of symbols</returns>\n        IDerivativeSecurityFilterUniverse<T> Filter(IDerivativeSecurityFilterUniverse<T> universe);\n\n        /// <summary>\n        /// True if this universe filter can run async in the data stack\n        /// </summary>\n        bool Asynchronous { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IDerivativeSecurityFilterUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents derivative symbols universe used in filtering.\n    /// </summary>\n    public interface IDerivativeSecurityFilterUniverse<T> : IEnumerable<T>\n        where T : IChainUniverseData\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IMarginCallModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for picking which orders should be executed during a margin call\n    /// </summary>\n    public interface IMarginCallModel\n    {\n        /// <summary>\n        /// Scan the portfolio and the updated data for a potential margin call situation which may get the holdings below zero!\n        /// If there is a margin call, liquidate the portfolio immediately before the portfolio gets sub zero.\n        /// </summary>\n        /// <param name=\"issueMarginCallWarning\">Set to true if a warning should be issued to the algorithm</param>\n        /// <returns>True for a margin call on the holdings.</returns>\n        List<SubmitOrderRequest> GetMarginCallOrders(out bool issueMarginCallWarning);\n\n        /// <summary>\n        /// Executes synchronous orders to bring the account within margin requirements.\n        /// </summary>\n        /// <param name=\"generatedMarginCallOrders\">These are the margin call orders that were generated\n        /// by individual security margin models.</param>\n        /// <returns>The list of orders that were actually executed</returns>\n        List<OrderTicket> ExecuteMarginCall(IEnumerable<SubmitOrderRequest> generatedMarginCallOrders);\n    }\n\n    /// <summary>\n    /// Provides access to a null implementation for <see cref=\"IMarginCallModel\"/>\n    /// </summary>\n    public static class MarginCallModel\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"IMarginCallModel\"/> that will always\n        /// return an empty list of executed orders.\n        /// </summary>\n        public static readonly IMarginCallModel Null = new NullMarginCallModel();\n\n        private sealed class NullMarginCallModel : IMarginCallModel\n        {\n            public List<SubmitOrderRequest> GetMarginCallOrders(out bool issueMarginCallWarning)\n            {\n                issueMarginCallWarning = false;\n                return new List<SubmitOrderRequest>();\n            }\n\n            public List<OrderTicket> ExecuteMarginCall(IEnumerable<SubmitOrderRequest> generatedMarginCallOrders)\n            {\n                return new List<OrderTicket>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IMarginInterestRateModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// The responsability of this model is to apply margin interest rate cash flows to the portfolio\n    /// </summary>\n    public interface IMarginInterestRateModel\n    {\n        /// <summary>\n        /// Apply margin interest rates to the portfolio\n        /// </summary>\n        /// <param name=\"marginInterestRateParameters\">The parameters to use</param>\n        void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters);\n    }\n\n    /// <summary>\n    /// Provides access to a null implementation for <see cref=\"IMarginInterestRateModel\"/>\n    /// </summary>\n    public static class MarginInterestRateModel\n    {\n        /// <summary>\n        /// The null margin interest rate model\n        /// </summary>\n        public static readonly IMarginInterestRateModel Null = new NullMarginInterestRateModel();\n\n        private sealed class NullMarginInterestRateModel : IMarginInterestRateModel\n        {\n            public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IOrderEventProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a type with a new <see cref=\"OrderEvent\"/> event <see cref=\"EventHandler\"/>.\n    /// </summary>\n    public interface IOrderEventProvider\n    {\n        /// <summary>\n        /// Event fired when there is a new <see cref=\"OrderEvent\"/>\n        /// </summary>\n        /// <remarks>Will be called before the <see cref=\"SecurityPortfolioManager\"/></remarks>\n        event EventHandler<OrderEvent> NewOrderEvent;\n    }\n}"
  },
  {
    "path": "Common/Securities/IOrderProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a type capable of processing orders\n    /// </summary>\n    public interface IOrderProcessor : IOrderProvider\n    {\n        /// <summary>\n        /// Adds the specified order to be processed\n        /// </summary>\n        /// <param name=\"request\">The <see cref=\"OrderRequest\"/> to be processed</param>\n        /// <returns>The <see cref=\"OrderTicket\"/> for the corresponding <see cref=\"OrderRequest.OrderId\"/></returns>\n        OrderTicket Process(OrderRequest request);\n    }\n}"
  },
  {
    "path": "Common/Securities/IOrderProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a type capable of fetching Order instances by its QC order id or by a brokerage id\n    /// </summary>\n    public interface IOrderProvider\n    {\n        /// <summary>\n        /// Gets the current number of orders that have been processed\n        /// </summary>\n        int OrdersCount { get; }\n\n        /// <summary>\n        /// Get the order by its id\n        /// </summary>\n        /// <param name=\"orderId\">Order id to fetch</param>\n        /// <returns>A clone of the order with the specified id, or null if no match is found</returns>\n        Order GetOrderById(int orderId);\n\n        /// <summary>\n        /// Gets the Lean orders by its brokerage id\n        /// </summary>\n        /// <param name=\"brokerageId\">The brokerage id to fetch</param>\n        /// <returns>The orders matching the brokerage id, or null if no match is found</returns>\n        List<Order> GetOrdersByBrokerageId(string brokerageId);\n\n        /// <summary>\n        /// Gets and enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets. If null is specified then all tickets are returned</param>\n        /// <returns>An enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null);\n\n        /// <summary>\n        /// Gets and enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets. If null is specified then all tickets are returned</param>\n        /// <returns>An enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null);\n\n        /// <summary>\n        /// Gets the order ticket for the specified order id. Returns null if not found\n        /// </summary>\n        /// <param name=\"orderId\">The order's id</param>\n        /// <returns>The order ticket with the specified id, or null if not found</returns>\n        OrderTicket GetOrderTicket(int orderId);\n\n        /// <summary>\n        /// Gets all orders matching the specified filter. Specifying null will return an enumerable\n        /// of all orders.\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All orders this order provider currently holds by the specified filter</returns>\n        IEnumerable<Order> GetOrders(Func<Order, bool> filter = null);\n\n        /// <summary>\n        /// Gets open orders matching the specified filter. Specifying null will return an enumerable\n        /// of all open orders.\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All filtered open orders this order provider currently holds</returns>\n        List<Order> GetOpenOrders(Func<Order, bool> filter = null);\n\n        /// <summary>\n        /// Calculates the projected holdings for the specified security based on the current open orders.\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <returns>\n        /// The projected holdings for the specified security, which is the sum of the current holdings\n        /// plus the sum of the open orders quantity.\n        /// </returns>\n        ProjectedHoldings GetProjectedHoldings(Security security);\n    }\n\n    /// <summary>\n    /// Provides extension methods for the <see cref=\"IOrderProvider\"/> interface\n    /// </summary>\n    public static class OrderProviderExtensions\n    {\n        /// <summary>\n        /// Gets the order by its brokerage id\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider to search</param>\n        /// <param name=\"brokerageId\">The brokerage id to fetch</param>\n        /// <returns>The first order matching the brokerage id, or null if no match is found</returns>\n        public static List<Order> GetOrdersByBrokerageId(this IOrderProvider orderProvider, long brokerageId)\n        {\n            return orderProvider.GetOrdersByBrokerageId(brokerageId.ToStringInvariant());\n        }\n\n        /// <summary>\n        /// Gets the order by its brokerage id\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider to search</param>\n        /// <param name=\"brokerageId\">The brokerage id to fetch</param>\n        /// <returns>The first order matching the brokerage id, or null if no match is found</returns>\n        public static List<Order> GetOrdersByBrokerageId(this IOrderProvider orderProvider, int brokerageId)\n        {\n            return orderProvider.GetOrdersByBrokerageId(brokerageId.ToStringInvariant());\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IPriceVariationModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Gets the minimum price variation of a given security\n    /// </summary>\n    public interface IPriceVariationModel\n    {\n        /// <summary>\n        /// Get the minimum price variation from a security\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the method parameters</param>\n        /// <returns>Decimal minimum price variation of a given security</returns>\n        decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IRegisteredSecurityDataTypesProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides the set of base data types registered in the algorithm\n    /// </summary>\n    public interface IRegisteredSecurityDataTypesProvider\n    {\n        /// <summary>\n        /// Registers the specified type w/ the provider\n        /// </summary>\n        /// <returns>True if the type was previously not registered</returns>\n        bool RegisterType(Type type);\n\n        /// <summary>\n        /// Removes the registration for the specified type\n        /// </summary>\n        /// <returns>True if the type was previously registered</returns>\n        bool UnregisterType(Type type);\n\n        /// <summary>\n        /// Determines if the specified type is registered or not and returns it\n        /// </summary>\n        /// <returns>True if the type was previously registered</returns>\n        bool TryGetType(string name, out Type type);\n    }\n}"
  },
  {
    "path": "Common/Securities/ISecurityInitializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a type capable of initializing a new security\n    /// </summary>\n    public interface ISecurityInitializer\n    {\n        /// <summary>\n        /// Initializes the specified security\n        /// </summary>\n        /// <param name=\"security\">The security to be initialized</param>\n        void Initialize(Security security);\n    }\n\n    /// <summary>\n    /// Provides static access to the <see cref=\"Null\"/> security initializer\n    /// </summary>\n    public static class SecurityInitializer\n    {\n        /// <summary>\n        /// Gets an implementation of <see cref=\"ISecurityInitializer\"/> that is a no-op\n        /// </summary>\n        public static readonly ISecurityInitializer Null = new NullSecurityInitializer();\n\n        private sealed class NullSecurityInitializer : ISecurityInitializer\n        {\n            public void Initialize(Security security) { }\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/ISecurityPortfolioModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Performs order fill application to portfolio\n    /// </summary>\n    public interface ISecurityPortfolioModel\n    {\n        /// <summary>\n        /// Performs application of an OrderEvent to the portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The fill's security</param>\n        /// <param name=\"fill\">The order event fill object to be applied</param>\n        void ProcessFill(SecurityPortfolioManager portfolio, Security security, OrderEvent fill);\n    }\n}"
  },
  {
    "path": "Common/Securities/ISecurityProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a type capable of fetching the holdings for the specified symbol\n    /// </summary>\n    public interface ISecurityProvider\n    {\n        /// <summary>\n        /// Retrieves a summary of the holdings for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get holdings for</param>\n        /// <returns>The holdings for the symbol or null if the symbol is invalid and/or not in the portfolio</returns>\n        Security GetSecurity(Symbol symbol);\n    }\n\n    /// <summary>\n    /// Provides extension methods for the <see cref=\"ISecurityProvider\"/> interface.\n    /// </summary>\n    public static class SecurityProviderExtensions\n    {\n        /// <summary>\n        /// Extension method to return the quantity of holdings, if no holdings are present, then zero is returned.\n        /// </summary>\n        /// <param name=\"provider\">The <see cref=\"ISecurityProvider\"/></param>\n        /// <param name=\"symbol\">The symbol we want holdings quantity for</param>\n        /// <returns>The quantity of holdings for the specified symbol</returns>\n        public static decimal GetHoldingsQuantity(this ISecurityProvider provider, Symbol symbol)\n        {\n            var security = provider.GetSecurity(symbol);\n            return security == null ? 0 : security.Holdings.Quantity;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/ISecuritySeeder.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Used to seed the security with the correct price\n    /// </summary>\n    public interface ISecuritySeeder\n    {\n        /// <summary>\n        /// Seed the security\n        /// </summary>\n        /// <param name=\"security\"><see cref=\"Security\"/> being seeded</param>\n        /// <returns>true if the security was seeded, false otherwise</returns>\n        bool SeedSecurity(Security security);\n    }\n\n    /// <summary>\n    /// Provides access to a null implementation for <see cref=\"ISecuritySeeder\"/>\n    /// </summary>\n    public static class SecuritySeeder\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"ISecuritySeeder\"/> that is a no-op\n        /// </summary>\n        public static readonly ISecuritySeeder Null = new NullSecuritySeeder();\n\n        private sealed class NullSecuritySeeder : ISecuritySeeder\n        {\n            public bool SeedSecurity(Security security)\n            {\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ISettlementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for applying cash settlement rules\n    /// </summary>\n    public interface ISettlementModel\n    {\n        /// <summary>\n        /// Applies cash settlement rules\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters);\n\n        /// <summary>\n        /// Scan for pending settlements\n        /// </summary>\n        /// <param name=\"settlementParameters\">The settlement parameters</param>\n        void Scan(ScanSettlementModelParameters settlementParameters);\n\n        /// <summary>\n        /// Gets the unsettled cash amount for the security\n        /// </summary>\n        CashAmount GetUnsettledCash();\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IdentityCurrencyConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ICurrencyConverter\"/> that does NOT perform conversions.\n    /// This implementation will throw if the specified cashAmount is not in units of account currency.\n    /// </summary>\n    public class IdentityCurrencyConverter : ICurrencyConverter\n    {\n        /// <summary>\n        /// Gets account currency\n        /// </summary>\n        public string AccountCurrency { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ICurrencyConverter\"/> class\n        /// </summary>\n        /// <param name=\"accountCurrency\">The algorithm's account currency</param>\n        public IdentityCurrencyConverter(string accountCurrency)\n        {\n            AccountCurrency = accountCurrency;\n        }\n\n        /// <summary>\n        /// Converts a cash amount to the account currency.\n        /// This implementation can only handle cash amounts in units of the account currency.\n        /// </summary>\n        /// <param name=\"cashAmount\">The <see cref=\"CashAmount\"/> instance to convert</param>\n        /// <returns>A new <see cref=\"CashAmount\"/> instance denominated in the account currency</returns>\n        public CashAmount ConvertToAccountCurrency(CashAmount cashAmount)\n        {\n            if (!string.Equals(cashAmount.Currency, AccountCurrency, StringComparison.InvariantCultureIgnoreCase))\n            {\n                throw new ArgumentException(Messages.IdentityCurrencyConverter.UnableToHandleCashInNonAccountCurrency);\n            }\n\n            return cashAmount;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ImmediateSettlementModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the model responsible for applying cash settlement rules\n    /// </summary>\n    /// <remarks>This model applies cash settlement immediately</remarks>\n    public class ImmediateSettlementModel : ISettlementModel\n    {\n        /// <summary>\n        /// Applies cash settlement rules\n        /// </summary>\n        /// <param name=\"applyFundsParameters\">The funds application parameters</param>\n        public virtual void ApplyFunds(ApplyFundsSettlementModelParameters applyFundsParameters)\n        {\n            var currency = applyFundsParameters.CashAmount.Currency;\n            var amount = applyFundsParameters.CashAmount.Amount;\n            applyFundsParameters.Portfolio.CashBook[currency].AddAmount(amount);\n        }\n\n        /// <summary>\n        /// Scan for pending settlements\n        /// </summary>\n        /// <param name=\"settlementParameters\">The settlement parameters</param>\n        public virtual void Scan(ScanSettlementModelParameters settlementParameters)\n        {\n        }\n\n        /// <summary>\n        /// Gets the unsettled cash amount for the security\n        /// </summary>\n        public virtual CashAmount GetUnsettledCash()\n        {\n            return default;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/Index.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// INDEX Security Object Implementation for INDEX Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Index : Security\n    {\n        private bool _isTradable;\n\n        /// <summary>\n        /// Gets or sets whether or not this security should be considered tradable\n        /// </summary>\n        public override bool IsTradable {\n            get => _isTradable;\n            set\n            {\n                if (value) ManualSetIsTradable = true;\n                _isTradable = value;\n            }\n        }\n\n        /// <summary>\n        /// Field to check if the user has manually set IsTradable field to true\n        /// </summary>\n        internal bool ManualSetIsTradable { get; set; }\n\n        /// <summary>\n        /// Constructor for the INDEX security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        public Index(SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SubscriptionDataConfig config,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes)\n            : base(config,\n                quoteCurrency,\n                symbolProperties,\n                new IndexExchange(exchangeHours),\n                new IndexCache(),\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new ConstantFeeModel(0),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new IndexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            IsTradable = false;   //Index are non tradable by default\n            Holdings = new IndexHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Constructor for the INDEX security\n        /// </summary>\n        /// <param name=\"symbol\">The security's symbol</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache to store security information</param>\n        public Index(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new IndexExchange(exchangeHours),\n                securityCache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new ConstantFeeModel(0),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(50m),\n                new IndexDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n            IsTradable = false;   //Index are non tradable by default\n            Holdings = new IndexHolding(this, currencyConverter);\n        }\n\n        /// <summary>\n        /// Resets the security to its initial state by marking it as uninitialized and non-tradable\n        /// and clearing the subscriptions.\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            ManualSetIsTradable = false;\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Index security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/IndexCache.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// INDEX specific caching support\n    /// </summary>\n    /// <remarks>Class is virtually empty and scheduled to be made obsolete. Potentially could be used for user data storage.</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class IndexCache : SecurityCache\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/IndexDataFilter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// Index packet by packet data filtering mechanism for dynamically detecting bad ticks.\n    /// </summary>\n    /// <seealso cref=\"SecurityDataFilter\"/>\n    public class IndexDataFilter : SecurityDataFilter\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/IndexExchange.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// INDEX exchange class - information and helper tools for Index exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class IndexExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days per year for this security, used for performance statistics.\n        /// </summary>\n        public override int TradingDaysPerYear\n        {\n            // 365 - Saturdays = 313;\n            get { return 313; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IndexExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public IndexExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/IndexHolding.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// Index holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class IndexHolding : SecurityHolding\n    {\n        /// <summary>\n        /// INDEX Holding Class constructor\n        /// </summary>\n        /// <param name=\"security\">The INDEX security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public IndexHolding(Index security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Index/IndexSymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Index\n{\n    /// <summary>\n    /// Helper methods for Index Symbols\n    /// </summary>\n    public static class IndexSymbol\n    {\n        private static readonly Dictionary<string, string> _indexExchange = new(StringComparer.InvariantCultureIgnoreCase)\n        {\n            { \"SPX\", Market.CBOE },\n            { \"NDX\", \"NASDAQ\" },\n            { \"VIX\", Market.CBOE },\n            { \"SPXW\", Market.CBOE },\n            { \"NQX\", \"NASDAQ\" },\n            { \"VIXW\", Market.CBOE },\n            { \"RUT\", \"RUSSELL\" },\n            { \"BKX\", \"PHLX\" },\n            { \"BXD\", Market.CBOE },\n            { \"BXM\", Market.CBOE },\n            { \"BXN\", Market.CBOE },\n            { \"BXR\", Market.CBOE },\n            { \"CLL\", Market.CBOE },\n            { \"COR1M\", Market.CBOE },\n            { \"COR1Y\", Market.CBOE },\n            { \"COR30D\", Market.CBOE },\n            { \"COR3M\", Market.CBOE },\n            { \"COR6M\", Market.CBOE },\n            { \"COR9M\", Market.CBOE },\n            { \"DJX\", Market.CBOE },\n            { \"DUX\", Market.CBOE },\n            { \"DVS\", Market.CBOE },\n            { \"DXL\", Market.CBOE },\n            { \"EVZ\", Market.CBOE },\n            { \"FVX\", Market.CBOE },\n            { \"GVZ\", Market.CBOE },\n            { \"HGX\", \"PHLX\" },\n            { \"MID\", \"PSE\" },\n            { \"MIDG\", Market.CBOE },\n            { \"MIDV\", Market.CBOE },\n            { \"MRUT\", \"RUSSELL\" },\n            { \"NYA\", \"PSE\" },\n            { \"NYFANG\", \"NYSE\" },\n            { \"NYXBT\", \"NYSE\" },\n            { \"OEX\", Market.CBOE },\n            { \"OSX\", \"PHLX\" },\n            { \"OVX\", Market.CBOE },\n            { \"XDA\", \"PHLX\" },\n            { \"XDB\", \"PHLX\" },\n            { \"XEO\", Market.CBOE },\n            { \"XMI\", \"PSE\" },\n            { \"XNDX\", \"NASDAQ\" },\n            { \"XSP\", Market.CBOE },\n            { \"BRR\", Market.CME },\n            { \"BRTI\", Market.CME },\n            { \"CEX\", Market.CBOE },\n            { \"COMP\", \"NASDAQ\" },\n            { \"DJCIAGC\", Market.CME },\n            { \"DJCICC\", Market.CME },\n            { \"DJCIGC\", Market.CME },\n            { \"DJCIGR\", Market.CME },\n            { \"DJCIIK\", Market.CME },\n            { \"DJCIKC\", Market.CME },\n            { \"DJCISB\", Market.CME },\n            { \"DJCISI\", Market.CME },\n            { \"DJR\", Market.CBOE },\n            { \"DRG\", \"PSE\" },\n            { \"PUT\", Market.CBOE },\n            { \"RUA\", \"RUSSELL\" },\n            { \"RUI\", \"RUSSELL\" },\n            { \"RVX\", Market.CBOE },\n            { \"SET\", Market.CBOE },\n            { \"SGX\", Market.CBOE },\n            { \"SKEW\", Market.CBOE },\n            { \"SPSIBI\", \"PSE\" },\n            { \"SVX\", Market.CBOE },\n            { \"TNX\", Market.CBOE },\n            { \"TYX\", Market.CBOE },\n            { \"UKX\", \"ISE\" },\n            { \"UTY\", \"PHLX\" },\n            { \"VIF\", Market.CBOE },\n            { \"VIN\", Market.CBOE },\n            { \"VIX1D\", Market.CBOE },\n            { \"VIX1Y\", Market.CBOE },\n            { \"VIX3M\", Market.CBOE },\n            { \"VIX6M\", Market.CBOE },\n            { \"VIX9D\", Market.CBOE },\n            { \"VOLI\", \"NASDAQ\" },\n            { \"VPD\", Market.CBOE },\n            { \"VPN\", Market.CBOE },\n            { \"VVIX\", Market.CBOE },\n            { \"VWA\", Market.CBOE },\n            { \"VWB\", Market.CBOE },\n            { \"VXD\", Market.CBOE },\n            { \"VXN\", Market.CBOE },\n            { \"VXO\", Market.CBOE },\n            { \"VXSLV\", Market.CBOE },\n            { \"VXTH\", Market.CBOE },\n            { \"VXTLT\", Market.CBOE },\n            { \"XAU\", \"PHLX\" },\n            { \"DJI\", Market.CME },\n            { \"DWCPF\", Market.CME },\n            { \"UTIL\", Market.CME },\n            { \"DAX\", Market.EUREX },\n            { \"DXY\", \"NYBOT\" },\n            { \"RLS\", Market.CBOE },\n            { \"SMLG\", \"PSE\" },\n            { \"SPGSCI\", Market.CME },\n            { \"VAF\", Market.CBOE },\n            { \"VRO\", Market.CBOE },\n            { \"AEX\", \"FTA\" },\n            { \"DJINET\", Market.CBOE },\n            { \"DTX\", Market.CBOE },\n            { \"SP600\", Market.CBOE },\n            { \"SPSV\", \"PSE\" },\n            { \"FTW5000\", \"AMEX\" },\n            { \"DWCF\", \"PSE\" },\n        };\n\n        private static readonly Dictionary<string, string> _indexMarket = new(StringComparer.InvariantCultureIgnoreCase)\n        {\n            { \"HSI\", Market.HKFE },\n            { \"N225\", Market.OSE },\n            { \"SX5E\", Market.EUREX },\n            { \"DAX\", Market.EUREX }\n        };\n\n        /// <summary>\n        /// Gets the actual exchange the index lives on\n        /// </summary>\n        /// <remarks>Useful for live trading</remarks>\n        /// <returns>The exchange of the index</returns>\n        public static string GetIndexExchange(Symbol symbol)\n        {\n            return _indexExchange.TryGetValue(symbol.Value, out var market)\n                ? market\n                : symbol.ID.Market;\n        }\n\n        /// <summary>\n        /// Gets the lean market for this index ticker\n        /// </summary>\n        /// <returns>The market of the index</returns>\n        public static bool TryGetIndexMarket(string ticker, out string market)\n        {\n            return _indexMarket.TryGetValue(ticker, out market);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IndexOption/IndexOption.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities.IndexOption\n{\n    /// <summary>\n    /// Index Options security\n    /// </summary>\n    public class IndexOption : Option.Option\n    {\n        /// <summary>\n        /// Constructor for the index option security\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of the index option</param>\n        /// <param name=\"exchangeHours\">Exchange hours of the index option</param>\n        /// <param name=\"quoteCurrency\">Quoted currency of the index option</param>\n        /// <param name=\"symbolProperties\">Symbol properties of the index option</param>\n        /// <param name=\"currencyConverter\">Currency converter</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered to the algorithm</param>\n        /// <param name=\"securityCache\">Cache of security objects</param>\n        /// <param name=\"underlying\">Future underlying security</param>\n        /// <param name=\"settlementType\">Settlement type for the index option. Most index options are cash-settled.</param>\n        /// <param name=\"priceModelProvider\">The option price model provider</param>\n        public IndexOption(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            IndexOptionSymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache,\n            Security underlying,\n            SettlementType settlementType = SettlementType.Cash,\n            IOptionPriceModelProvider priceModelProvider = null)\n            : base(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new OptionExchange(exchangeHours),\n                securityCache,\n                new OptionPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new OptionMarginModel(),\n                new OptionDataFilter(),\n                new IndexOptionPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                underlying,\n                priceModelProvider\n            )\n        {\n            ExerciseSettlement = settlementType;\n        }\n\n        /// <summary>\n        /// Consumes market price data and updates the minimum price variation\n        /// </summary>\n        /// <param name=\"data\">Market price data</param>\n        /// <remarks>\n        /// Index options have variable sized minimum price variations.\n        /// For prices greater than or equal to $3.00 USD, the minimum price variation is $0.10 USD.\n        /// For prices less than $3.00 USD, the minimum price variation is $0.05 USD.\n        /// </remarks>\n        protected override void UpdateConsumersMarketPrice(BaseData data)\n        {\n            base.UpdateConsumersMarketPrice(data);\n            ((IndexOptionSymbolProperties)SymbolProperties).UpdateMarketPrice(data);\n        }\n\n        /// <summary>\n        /// Updates the symbol properties of this security\n        /// </summary>\n        internal override void UpdateSymbolProperties(SymbolProperties symbolProperties)\n        {\n            if (symbolProperties != null)\n            {\n                SymbolProperties = new IndexOptionSymbolProperties(symbolProperties);\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(IndexOption security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IndexOption/IndexOptionPriceVariationModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities.IndexOption\n{\n    /// <summary>\n    /// The index option price variation model\n    /// </summary>\n    public class IndexOptionPriceVariationModel : IPriceVariationModel\n    {\n        /// <summary>\n        /// Get the minimum price variation from a security\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the method parameters</param>\n        /// <returns>Decimal minimum price variation of a given security</returns>\n        public decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters)\n        {\n            return IndexOptionSymbolProperties.MinimumPriceVariationForPrice(parameters.Security.Symbol, parameters.ReferencePrice);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IndexOption/IndexOptionSymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Securities.IndexOption\n{\n    /// <summary>\n    /// Index Option Symbol\n    /// </summary>\n    public static class IndexOptionSymbol\n    {\n        private static readonly Dictionary<string, string> _nonStandardOptionToIndex = new()\n        {\n            { \"RUTW\", \"RUT\" },\n            { \"SPXW\", \"SPX\" },\n            { \"VIXW\", \"VIX\" },\n            { \"NDXP\", \"NDX\" },\n            { \"NQX\", \"NDX\" },\n        };\n\n        /// <summary>\n        /// These are known assets that are weeklies or end-of-month settled contracts.\n        /// </summary>\n        private static readonly HashSet<string> _nonStandardIndexOptionTickers = new()\n        {\n            // Weeklies\n            \"RUTW\", // PM-Settled. While RUT AM-Settled on 3rd Fridays\n            \"SPXW\",\n            \"VIXW\",\n            // PM-Settled\n            \"NDXP\",\n            // reduced value index options, 20%\n            \"NQX\"\n        };\n\n        /// <summary>\n        /// Supported index option tickers\n        /// </summary>\n        public static readonly HashSet<string> SupportedIndexOptionTickers = new string[] { \"SPX\", \"NDX\", \"VIX\", \"RUT\" }\n            .Union(_nonStandardIndexOptionTickers)\n            .ToHashSet();\n\n        /// <summary>\n        /// Determines if the Index Option Symbol is for a monthly contract\n        /// </summary>\n        /// <param name=\"symbol\">Index Option Symbol</param>\n        /// <returns>True if monthly contract, false otherwise</returns>\n        public static bool IsStandard(Symbol symbol)\n        {\n            if (symbol.ID.Market != Market.USA)\n            {\n                return true;\n            }\n\n            switch (symbol.ID.Symbol)\n            {\n                case \"NQX\":\n                case \"SPXW\":\n                case \"RUTW\":\n                // they have weeklies and monthly contracts\n                // NQX https://www.nasdaq.com/docs/NQXFactSheet.pdf\n                // SPXW https://www.cboe.com/tradable_products/sp_500/spx_weekly_options/specifications/\n                // RUTW expires every day\n                return FuturesExpiryUtilityFunctions.ThirdFriday(symbol.ID.Date) == symbol.ID.Date;\n                default:\n                    // NDX/SPX/NQX/VIX/VIXW/NDXP/RUT are all normal contracts\n                    return true;\n            }\n        }\n\n        /// <summary>\n        /// Checks if the ticker provided is a supported Index Option\n        /// </summary>\n        /// <param name=\"ticker\">Ticker of the index option</param>\n        /// <returns>true if the ticker matches an index option's ticker</returns>\n        /// <remarks>\n        /// This is only used in IB brokerage, since they don't distinguish index options\n        /// from regular equity options. When we do the conversion from a contract to a SecurityType,\n        /// the only information we're provided that can reverse it to the <see cref=\"SecurityType.IndexOption\"/>\n        /// enum value is the ticker.\n        /// </remarks>\n        public static bool IsIndexOption(string ticker)\n        {\n            return SupportedIndexOptionTickers.Contains(ticker.LazyToUpper());\n        }\n\n        /// <summary>\n        /// Maps an index option ticker to its underlying index ticker\n        /// </summary>\n        /// <param name=\"indexOption\">Index option ticker to map to the underlying</param>\n        /// <returns>Index ticker</returns>\n        public static string MapToUnderlying(string indexOption)\n        {\n            if(_nonStandardOptionToIndex.TryGetValue(indexOption.LazyToUpper(), out var index))\n            {\n                return index;\n            }\n\n            return indexOption;\n        }\n\n        /// <summary>\n        /// Returns the last trading date for the given index option ticker and expiration date\n        /// </summary>\n        /// <remarks>This is useful for IB brokerage</remarks>\n        public static DateTime GetLastTradingDate(string ticker, DateTime expirationDate)\n        {\n            return expirationDate.AddDays(-GetExpirationOffset(ticker));\n        }\n\n        /// <summary>\n        /// Returns the expiry date for the given index option ticker and last trading date\n        /// </summary>\n        /// <remarks>This is useful for IB brokerage</remarks>\n        public static DateTime GetExpiryDate(string ticker, DateTime lastTradingDate)\n        {\n            return lastTradingDate.AddDays(GetExpirationOffset(ticker));\n        }\n\n        /// <summary>\n        /// Some index options last tradable date is the previous day to the expiration\n        /// https://www.cboe.com/tradable_products/vix/vix_options/specifications/\n        /// https://www.cboe.com/tradable_products/ftse_russell/russell_2000_index_options/rut_specifications\n        /// </summary>\n        private static int GetExpirationOffset(string ticker)\n        {\n            switch (ticker)\n            {\n                case \"SPX\":\n                case \"NDX\":\n                case \"VIX\":\n                case \"VIXW\":\n                case \"RUT\":\n                    return 1;\n                default:\n                    // SPXW, NQX, NDXP, RUTW\n                    return 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/IndexOption/IndexOptionSymbolProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities.IndexOption\n{\n    /// <summary>\n    /// Index Option Symbol Properties\n    /// </summary>\n    public class IndexOptionSymbolProperties : OptionSymbolProperties\n    {\n        private BaseData _lastData;\n\n        /// <summary>\n        /// Minimum price variation, subject to variability due to contract price\n        /// </summary>\n        public override decimal MinimumPriceVariation => MinimumPriceVariationForPrice(_lastData?.Symbol, _lastData?.Price);\n\n        /// <summary>\n        /// Creates an instance of index symbol properties\n        /// </summary>\n        /// <param name=\"description\">Description of the Symbol</param>\n        /// <param name=\"quoteCurrency\">Currency the price is quoted in</param>\n        /// <param name=\"contractMultiplier\">Contract multiplier of the index option</param>\n        /// <param name=\"pipSize\">Minimum price variation</param>\n        /// <param name=\"lotSize\">Minimum order lot size</param>\n        public IndexOptionSymbolProperties(\n            string description,\n            string quoteCurrency,\n            decimal contractMultiplier,\n            decimal pipSize,\n            decimal lotSize\n            )\n            : base(description, quoteCurrency, contractMultiplier, pipSize, lotSize)\n        {\n        }\n\n        /// <summary>\n        /// Creates instance of index symbol properties\n        /// </summary>\n        /// <param name=\"properties\"></param>\n        public IndexOptionSymbolProperties(SymbolProperties properties)\n            : base(properties)\n        {\n        }\n\n        /// <summary>\n        /// Updates the last data received, required for calculating some\n        /// index options contracts that have a variable step size for their premium's quotes\n        /// </summary>\n        /// <param name=\"marketData\">Data to update with</param>\n        internal void UpdateMarketPrice(BaseData marketData)\n        {\n            _lastData = marketData;\n        }\n\n        /// <summary>\n        /// Minimum price variation, subject to variability due to contract price\n        /// </summary>\n        /// <remarks>https://www.cboe.com/tradable_products/vix/vix_options/specifications/\n        /// https://www.cboe.com/tradable_products/sp_500/spx_options/specifications/\n        /// https://www.nasdaq.com/docs/2022/08/24/1926-Q22_NDX%20Fact%20Sheet_NAM_v3.pdf</remarks>\n        public static decimal MinimumPriceVariationForPrice(Symbol symbol, decimal? referencePrice)\n        {\n            if(symbol == null || !referencePrice.HasValue)\n            {\n                return 0.05m;\n            }\n\n            var aboveThree = 0.1m;\n            var belowThree = 0.05m;\n            if(symbol.ID.Symbol == \"VIXW\")\n            {\n                aboveThree = belowThree = 0.01m;\n            }\n            else if (symbol.ID.Symbol == \"VIX\")\n            {\n                belowThree = 0.01m;\n                aboveThree = 0.05m;\n            }\n\n            return referencePrice.HasValue && referencePrice >= 3m ? aboveThree : belowThree;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/InitialMargin.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Result type for <see cref=\"IBuyingPowerModel.GetInitialMarginRequirement\"/>\n    /// and <see cref=\"IBuyingPowerModel.GetInitialMarginRequiredForOrder\"/>\n    /// </summary>\n    public class InitialMargin\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"InitialMargin\"/> with zero values\n        /// </summary>\n        public static InitialMargin Zero { get; } = new InitialMargin(0m);\n\n        /// <summary>\n        /// The initial margin value in account currency\n        /// </summary>\n        public decimal Value { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InitialMargin\"/> class\n        /// </summary>\n        /// <param name=\"value\">The initial margin</param>\n        public InitialMargin(decimal value)\n        {\n            Value = value;\n        }\n\n        /// <summary>\n        /// Implicit operator <see cref=\"InitialMargin\"/> -> <see cref=\"decimal\"/>\n        /// </summary>\n        public static implicit operator decimal(InitialMargin margin)\n        {\n            return margin.Value;\n        }\n\n        /// <summary>\n        /// Implicit operator <see cref=\"decimal\"/> -> <see cref=\"InitialMargin\"/>\n        /// </summary>\n        public static implicit operator InitialMargin(decimal margin)\n        {\n            return new InitialMargin(margin);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/InitialMarginParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Parameters for <see cref=\"IBuyingPowerModel.GetInitialMarginRequirement\"/>\n    /// </summary>\n    public class InitialMarginParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the quantity\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InitialMarginParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"quantity\">The quantity</param>\n        public InitialMarginParameters(Security security, decimal quantity)\n        {\n            Security = security;\n            Quantity = quantity;\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"InitialMarginParameters\"/> for the security's underlying\n        /// </summary>\n        public InitialMarginParameters ForUnderlying()\n        {\n            var derivative = Security as IDerivativeSecurity;\n            if (derivative == null)\n            {\n                throw new InvalidOperationException(Messages.InitialMarginParameters.ForUnderlyingOnlyInvokableForIDerivativeSecurity);\n            }\n\n            return new InitialMarginParameters(derivative.Underlying, Quantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/InitialMarginRequiredForOrderParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"BuyingPowerModel.GetInitialMarginRequiredForOrder\"/>\n    /// </summary>\n    public class InitialMarginRequiredForOrderParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the order\n        /// </summary>\n        public Order Order { get; }\n\n        /// <summary>\n        /// Gets the currency converter\n        /// </summary>\n        public ICurrencyConverter CurrencyConverter { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InitialMarginRequiredForOrderParameters\"/> class\n        /// </summary>\n        /// <param name=\"currencyConverter\">The currency converter</param>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"order\">The order</param>\n        public InitialMarginRequiredForOrderParameters(\n            ICurrencyConverter currencyConverter,\n            Security security,\n            Order order\n            )\n        {\n            Order = order;\n            Security = security;\n            CurrencyConverter = currencyConverter;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Interfaces/IContinuousContractModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Interfaces\n{\n    /// <summary>\n    /// Enum defines types of possible price adjustments in continuous contract modeling.\n    /// </summary>\n    public enum AdjustmentType\n    {\n        /// <summary>\n        /// ForwardAdjusted - new quotes are adjusted as new data comes\n        /// </summary>\n        ForwardAdjusted,\n\n        /// <summary>\n        /// BackAdjusted - old quotes are retrospectively adjusted as new data comes\n        /// </summary>\n        BackAdjusted\n    };\n\n    /// <summary>\n    /// Continuous contract model interface. Interfaces is implemented by different classes\n    /// realizing various methods for modeling continuous security series. Primarily, modeling of continuous futures.\n    /// Continuous contracts are used in backtesting of otherwise expiring derivative contracts.\n    /// Continuous contracts are not traded, and are not products traded on exchanges.\n    /// </summary>\n    public interface IContinuousContractModel\n    {\n        /// <summary>\n        /// Adjustment type, implemented by the model\n        /// </summary>\n        AdjustmentType AdjustmentType { get; set; }\n\n        /// <summary>\n        /// List of current and historical data series for one root symbol.\n        /// e.g. 6BH16, 6BM16, 6BU16, 6BZ16\n        /// </summary>\n        IEnumerator<BaseData> InputSeries { get; set; }\n\n        /// <summary>\n        /// Method returns continuous prices from the list of current and historical data series for one root symbol.\n        /// It returns enumerator of stitched continuous quotes, produced by the model.\n        /// e.g. 6BH15, 6BM15, 6BU15, 6BZ15 will result in one 6B continuous historical series for 2015\n        /// </summary>\n        /// <returns>Continuous prices</returns>\n        IEnumerator<BaseData> GetContinuousData(DateTime dateTime);\n\n        /// <summary>\n        /// Returns the list of roll dates for the contract.\n        /// </summary>\n        /// <returns>The list of roll dates</returns>\n        IEnumerator<DateTime> GetRollDates();\n\n        /// <summary>\n        /// Returns current symbol name that corresponds to the current continuous model,\n        /// or null if none.\n        /// </summary>\n        /// <returns>Current symbol name</returns>\n        Symbol GetCurrentSymbol(DateTime dateTime);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Interfaces/ISecurityDataFilter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Securities.Interfaces\n{\n    /// <summary>\n    /// Security data filter interface. Defines pattern for the user defined data filter techniques.\n    /// </summary>\n    /// <remarks>\n    ///     Intended for use primarily with US equities tick data. The tick data is provided in raw \n    ///     and complete format which is more information that more retail feeds provide. In order to match\n    ///     retail feeds the ticks much be filtered to show only public-on market trading.\n    /// \n    ///     For tradebars this filter has already been done.\n    /// </remarks>\n    public interface ISecurityDataFilter \n    {\n        /// <summary>\n        /// Filter out a tick from this security, with this new data:\n        /// </summary>\n        /// <param name=\"data\">New data packet we're checking</param>\n        /// <param name=\"vehicle\">Security of this filter.</param>\n        bool Filter(Security vehicle, BaseData data);\n\n    } // End Data Filter Interface\n\n} // End QC Namespace\n"
  },
  {
    "path": "Common/Securities/LocalMarketHours.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the market hours under normal conditions for an exchange and a specific day of the week in terms of local time\n    /// </summary>\n    public class LocalMarketHours\n    {\n        private static readonly LocalMarketHours _closedMonday = new(DayOfWeek.Monday);\n        private static readonly LocalMarketHours _closedTuesday = new(DayOfWeek.Tuesday);\n        private static readonly LocalMarketHours _closedWednesday = new(DayOfWeek.Wednesday);\n        private static readonly LocalMarketHours _closedThursday = new(DayOfWeek.Thursday);\n        private static readonly LocalMarketHours _closedFriday = new(DayOfWeek.Friday);\n        private static readonly LocalMarketHours _closedSaturday = new(DayOfWeek.Saturday);\n        private static readonly LocalMarketHours _closedSunday = new(DayOfWeek.Sunday);\n\n        private static readonly LocalMarketHours _openMonday = new(DayOfWeek.Monday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openTuesday = new(DayOfWeek.Tuesday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openWednesday = new(DayOfWeek.Wednesday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openThursday = new(DayOfWeek.Thursday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openFriday = new(DayOfWeek.Friday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openSaturday = new(DayOfWeek.Saturday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n        private static readonly LocalMarketHours _openSunday = new(DayOfWeek.Sunday, new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay));\n\n        /// <summary>\n        /// Gets whether or not this exchange is closed all day\n        /// </summary>\n        public bool IsClosedAllDay { get; }\n\n        /// <summary>\n        /// Gets whether or not this exchange is closed all day\n        /// </summary>\n        public bool IsOpenAllDay { get; }\n\n        /// <summary>\n        /// Gets the day of week these hours apply to\n        /// </summary>\n        public DayOfWeek DayOfWeek { get; }\n\n        /// <summary>\n        /// Gets the tradable time during the market day.\n        /// For a normal US equity trading day this is 6.5 hours.\n        /// This does NOT account for extended market hours and only\n        /// considers <see cref=\"MarketHoursState.Market\"/>\n        /// </summary>\n        public TimeSpan MarketDuration { get; }\n\n        /// <summary>\n        /// Gets the individual market hours segments that define the hours of operation for this day\n        /// </summary>\n        public ReadOnlyCollection<MarketHoursSegment> Segments { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalMarketHours\"/> class\n        /// </summary>\n        /// <param name=\"day\">The day of the week these hours are applicable</param>\n        /// <param name=\"segments\">The open/close segments defining the market hours for one day</param>\n        public LocalMarketHours(DayOfWeek day, params MarketHoursSegment[] segments)\n            : this(day, (IEnumerable<MarketHoursSegment>) segments)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalMarketHours\"/> class\n        /// </summary>\n        /// <param name=\"day\">The day of the week these hours are applicable</param>\n        /// <param name=\"segments\">The open/close segments defining the market hours for one day</param>\n        public LocalMarketHours(DayOfWeek day, IEnumerable<MarketHoursSegment> segments)\n        {\n            DayOfWeek = day;\n            // filter out the closed states, we'll assume closed if no segment exists\n            Segments = new ReadOnlyCollection<MarketHoursSegment>((segments ?? Enumerable.Empty<MarketHoursSegment>()).Where(x => x.State != MarketHoursState.Closed).ToList());\n            IsClosedAllDay = Segments.Count == 0;\n            IsOpenAllDay = Segments.Count == 1\n                && Segments[0].Start == TimeSpan.Zero\n                && Segments[0].End == Time.OneDay\n                && Segments[0].State == MarketHoursState.Market;\n\n            for (var i = 0; i < Segments.Count; i++)\n            {\n                var segment = Segments[i];\n                if (segment.State == MarketHoursState.Market)\n                {\n                    MarketDuration += segment.End - segment.Start;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalMarketHours\"/> class from the specified open/close times\n        /// </summary>\n        /// <param name=\"day\">The day of week these hours apply to</param>\n        /// <param name=\"extendedMarketOpen\">The extended market open time</param>\n        /// <param name=\"marketOpen\">The regular market open time, must be greater than or equal to the extended market open time</param>\n        /// <param name=\"marketClose\">The regular market close time, must be greater than the regular market open time</param>\n        /// <param name=\"extendedMarketClose\">The extended market close time, must be greater than or equal to the regular market close time</param>\n        public LocalMarketHours(DayOfWeek day, TimeSpan extendedMarketOpen, TimeSpan marketOpen, TimeSpan marketClose, TimeSpan extendedMarketClose)\n            : this(day, MarketHoursSegment.GetMarketHoursSegments(extendedMarketOpen, marketOpen, marketClose, extendedMarketClose))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalMarketHours\"/> class from the specified open/close times\n        /// using the market open as the extended market open and the market close as the extended market close, effectively\n        /// removing any 'extended' session from these exchange hours\n        /// </summary>\n        /// <param name=\"day\">The day of week these hours apply to</param>\n        /// <param name=\"marketOpen\">The regular market open time</param>\n        /// <param name=\"marketClose\">The regular market close time, must be greater than the regular market open time</param>\n        public LocalMarketHours(DayOfWeek day, TimeSpan marketOpen, TimeSpan marketClose)\n            : this(day, marketOpen, marketOpen, marketClose, marketClose)\n        {\n        }\n\n        /// <summary>\n        /// Gets the market opening time of day\n        /// </summary>\n        /// <param name=\"time\">The reference time, the open returned will be the first open after the specified time if there are multiple market open segments</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false for regular market hours</param>\n        /// <param name=\"previousDayLastSegment\">The previous days last segment. This is used when the potential next market open is the first segment of the day\n        /// so we need to check that segment is not part of previous day last segment. If null, it means there were no segments on the last day</param>\n        /// <returns>The market's opening time of day</returns>\n        public TimeSpan? GetMarketOpen(TimeSpan time, bool extendedMarketHours, TimeSpan? previousDayLastSegment = null)\n        {\n            var previousSegment = previousDayLastSegment;\n            bool prevSegmentIsFromPrevDay = true;\n            for (var i = 0; i < Segments.Count; i++)\n            {\n                var segment = Segments[i];\n                if (segment.State == MarketHoursState.Closed || segment.End <= time)\n                {\n                    // update prev segment end time only if the current segment could have been taken into account\n                    // (regular hours or, when enabled, extended hours segment)\n                    if (segment.State == MarketHoursState.Market || extendedMarketHours)\n                    {\n                        previousSegment = segment.End;\n                        prevSegmentIsFromPrevDay = false;\n                    }\n\n                    continue;\n                }\n\n                // let's try this segment if it's regular market hours or if it is extended market hours and extended market is allowed\n                if (segment.State == MarketHoursState.Market || extendedMarketHours)\n                {\n                    if (!IsContinuousMarketOpen(previousSegment, segment.Start, prevSegmentIsFromPrevDay))\n                    {\n                        return segment.Start;\n                    }\n\n                    previousSegment = segment.End;\n                    prevSegmentIsFromPrevDay = false;\n                }\n            }\n\n            // we couldn't locate an open segment after the specified time\n            return null;\n        }\n\n        /// <summary>\n        /// Gets the market closing time of day\n        /// </summary>\n        /// <param name=\"time\">The reference time, the close returned will be the first close after the specified time if there are multiple market open segments</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false for regular market hours</param>\n        /// <param name=\"nextDaySegmentStart\">Next day first segment start. This is used when the potential next market close is\n        /// the last segment of the day so we need to check that segment is not continued on next day first segment.\n        /// If null, it means there are no segments on the next day</param>\n        /// <returns>The market's closing time of day</returns>\n        public TimeSpan? GetMarketClose(TimeSpan time, bool extendedMarketHours, TimeSpan? nextDaySegmentStart = null)\n        {\n            return GetMarketClose(time, extendedMarketHours, lastClose: false, nextDaySegmentStart);\n        }\n\n        /// <summary>\n        /// Gets the market closing time of day\n        /// </summary>\n        /// <param name=\"time\">The reference time, the close returned will be the first close after the specified time if there are multiple market open segments</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours, false for regular market hours</param>\n        /// <param name=\"lastClose\">True if the last available close of the date should be returned, else the first will be used</param>\n        /// <param name=\"nextDaySegmentStart\">Next day first segment start. This is used when the potential next market close is\n        /// the last segment of the day so we need to check that segment is not continued on next day first segment.\n        /// If null, it means there are no segments on the next day</param>\n        /// <returns>The market's closing time of day</returns>\n        public TimeSpan? GetMarketClose(TimeSpan time, bool extendedMarketHours, bool lastClose, TimeSpan? nextDaySegmentStart = null)\n        {\n            TimeSpan? potentialResult = null;\n            TimeSpan? nextSegment;\n            bool nextSegmentIsFromNextDay = false;\n            for (var i = 0; i < Segments.Count; i++)\n            {\n                var segment = Segments[i];\n                if (segment.State == MarketHoursState.Closed || segment.End <= time)\n                {\n                    continue;\n                }\n\n                if (i != Segments.Count - 1)\n                {\n                    var potentialNextSegment = Segments[i+1];\n\n                    // Check whether we can consider PostMarket or not\n                    if (potentialNextSegment.State != MarketHoursState.Market && !extendedMarketHours)\n                    {\n                        nextSegment = null;\n                    }\n                    else\n                    {\n                        nextSegment = Segments[i+1].Start;\n                    }\n                }\n                else\n                {\n                    nextSegment = nextDaySegmentStart;\n                    nextSegmentIsFromNextDay = true;\n                }\n\n                if ((segment.State == MarketHoursState.Market || extendedMarketHours))\n                {\n                    if (lastClose)\n                    {\n                        // we continue, there might be another close next\n                        potentialResult = segment.End;\n                    }\n                    else if (!IsContinuousMarketOpen(segment.End, nextSegment, nextSegmentIsFromNextDay))\n                    {\n                        return segment.End;\n                    }\n                }\n            }\n            return potentialResult;\n        }\n\n        /// <summary>\n        /// Determines if the exchange is open at the specified time\n        /// </summary>\n        /// <param name=\"time\">The time of day to check</param>\n        /// <param name=\"extendedMarketHours\">True to check exended market hours, false to check regular market hours</param>\n        /// <returns>True if the exchange is considered open, false otherwise</returns>\n        public bool IsOpen(TimeSpan time, bool extendedMarketHours)\n        {\n            for (var i = 0; i < Segments.Count; i++)\n            {\n                var segment = Segments[i];\n                if (segment.State == MarketHoursState.Closed)\n                {\n                    continue;\n                }\n\n                if (segment.Contains(time))\n                {\n                    return extendedMarketHours || segment.State == MarketHoursState.Market;\n                }\n            }\n\n            // if we didn't find a segment then we're closed\n            return false;\n        }\n\n        /// <summary>\n        /// Determines if the exchange is open during the specified interval\n        /// </summary>\n        /// <param name=\"start\">The start time of the interval</param>\n        /// <param name=\"end\">The end time of the interval</param>\n        /// <param name=\"extendedMarketHours\">True to check exended market hours, false to check regular market hours</param>\n        /// <returns>True if the exchange is considered open, false otherwise</returns>\n        public bool IsOpen(TimeSpan start, TimeSpan end, bool extendedMarketHours)\n        {\n            if (start == end)\n            {\n                return IsOpen(start, extendedMarketHours);\n            }\n\n            for (var i = 0; i < Segments.Count; i++)\n            {\n                var segment = Segments[i];\n                if (segment.State == MarketHoursState.Closed)\n                {\n                    continue;\n                }\n\n                if (extendedMarketHours || segment.State == MarketHoursState.Market)\n                {\n                    if (segment.Overlaps(start, end))\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            // if we didn't find a segment then we're closed\n            return false;\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"LocalMarketHours\"/> instance that is always closed\n        /// </summary>\n        /// <param name=\"dayOfWeek\">The day of week</param>\n        /// <returns>A <see cref=\"LocalMarketHours\"/> instance that is always closed</returns>\n        public static LocalMarketHours ClosedAllDay(DayOfWeek dayOfWeek)\n        {\n            switch (dayOfWeek)\n            {\n                case DayOfWeek.Sunday:\n                    return _closedSunday;\n                case DayOfWeek.Monday:\n                    return _closedMonday;\n                case DayOfWeek.Tuesday:\n                    return _closedTuesday;\n                case DayOfWeek.Wednesday:\n                    return _closedWednesday;\n                case DayOfWeek.Thursday:\n                    return _closedThursday;\n                case DayOfWeek.Friday:\n                    return _closedFriday;\n                case DayOfWeek.Saturday:\n                    return _closedSaturday;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(dayOfWeek));\n            }\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"LocalMarketHours\"/> instance that is always open\n        /// </summary>\n        /// <param name=\"dayOfWeek\">The day of week</param>\n        /// <returns>A <see cref=\"LocalMarketHours\"/> instance that is always open</returns>\n        public static LocalMarketHours OpenAllDay(DayOfWeek dayOfWeek)\n        {\n            switch (dayOfWeek)\n            {\n                case DayOfWeek.Sunday:\n                    return _openSunday;\n                case DayOfWeek.Monday:\n                    return _openMonday;\n                case DayOfWeek.Tuesday:\n                    return _openTuesday;\n                case DayOfWeek.Wednesday:\n                    return _openWednesday;\n                case DayOfWeek.Thursday:\n                    return _openThursday;\n                case DayOfWeek.Friday:\n                    return _openFriday;\n                case DayOfWeek.Saturday:\n                    return _openSaturday;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(dayOfWeek));\n            }\n        }\n\n        /// <summary>\n        /// Check the given segment is not part of the current previous segment\n        /// </summary>\n        /// <param name=\"previousSegmentEnd\">Previous segment end time before the current segment</param>\n        /// <param name=\"nextSegmentStart\">The next segment start time</param>\n        /// <param name=\"prevSegmentIsFromPrevDay\">Indicated whether the previous segment is from the previous day or not\n        /// (then it is from the same day as the next segment). Defaults to true</param>\n        /// <returns>True if indeed the given segment is part of the last segment. False otherwise</returns>\n        public static bool IsContinuousMarketOpen(TimeSpan? previousSegmentEnd, TimeSpan? nextSegmentStart, bool prevSegmentIsFromPrevDay = true)\n        {\n            if (previousSegmentEnd != null && nextSegmentStart != null)\n            {\n                if (prevSegmentIsFromPrevDay)\n                {\n                    // midnight passing to the next day\n                    return previousSegmentEnd.Value == Time.OneDay && nextSegmentStart.Value == TimeSpan.Zero;\n                }\n\n                // passing from one segment to another in the same day\n                return previousSegmentEnd.Value == nextSegmentStart.Value;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Messages.LocalMarketHours.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MaintenanceMargin.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Result type for <see cref=\"IBuyingPowerModel.GetMaintenanceMargin\"/>\n    /// </summary>\n    public class MaintenanceMargin\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"MaintenanceMargin\"/> with zero values.\n        /// </summary>\n        public static MaintenanceMargin Zero { get; } = new MaintenanceMargin(0m);\n\n        /// <summary>\n        /// The maintenance margin value in account currency\n        /// </summary>\n        public decimal Value { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaintenanceMargin\"/> class\n        /// </summary>\n        /// <param name=\"value\">The maintenance margin</param>\n        public MaintenanceMargin(decimal value)\n        {\n            Value = value;\n        }\n\n        /// <summary>\n        /// Implicit operator <see cref=\"MaintenanceMargin\"/> -> <see cref=\"decimal\"/>\n        /// </summary>\n        public static implicit operator decimal(MaintenanceMargin margin)\n        {\n            return margin.Value;\n        }\n\n        /// <summary>\n        /// Implicit operator <see cref=\"decimal\"/> -> <see cref=\"MaintenanceMargin\"/>\n        /// </summary>\n        public static implicit operator MaintenanceMargin(decimal margin)\n        {\n            return new MaintenanceMargin(margin);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MaintenanceMarginParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Parameters for <see cref=\"IBuyingPowerModel.GetMaintenanceMargin\"/>\n    /// </summary>\n    public class MaintenanceMarginParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Gets the quantity of the security\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// Gets the absolute quantity of the security\n        /// </summary>\n        public decimal AbsoluteQuantity => Math.Abs(Quantity);\n\n        /// <summary>\n        /// Gets the holdings cost of the security\n        /// </summary>\n        public decimal HoldingsCost { get; }\n\n        /// <summary>\n        /// Gets the absolute holdings cost of the security\n        /// </summary>\n        public decimal AbsoluteHoldingsCost => Math.Abs(HoldingsCost);\n\n        /// <summary>\n        /// Gets the holdings value of the security\n        /// </summary>\n        public decimal HoldingsValue { get; }\n\n        /// <summary>\n        /// Gets the absolute holdings value of the security\n        /// </summary>\n        public decimal AbsoluteHoldingsValue => Math.Abs(HoldingsValue);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MaintenanceMarginParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"quantity\">The quantity</param>\n        /// <param name=\"holdingsCost\">The holdings cost</param>\n        /// <param name=\"holdingsValue\">The holdings value</param>\n        public MaintenanceMarginParameters(\n            Security security,\n            decimal quantity,\n            decimal holdingsCost,\n            decimal holdingsValue\n            )\n        {\n            Security = security;\n            Quantity = quantity;\n            HoldingsCost = holdingsCost;\n            HoldingsValue = holdingsValue;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"MaintenanceMarginParameters\"/> class to compute the maintenance margin\n        /// required to support the algorithm's current holdings\n        /// </summary>\n        public static MaintenanceMarginParameters ForCurrentHoldings(Security security)\n        {\n            return new MaintenanceMarginParameters(security,\n                security.Holdings.Quantity,\n                security.Holdings.HoldingsCost,\n                security.Holdings.HoldingsValue\n            );\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"MaintenanceMarginParameters\"/> class to compute the maintenance margin\n        /// required to support the specified quantity of holdings at current market prices\n        /// </summary>\n        public static MaintenanceMarginParameters ForQuantityAtCurrentPrice(Security security, decimal quantity)\n        {\n            var value = security.Holdings.GetQuantityValue(quantity).InAccountCurrency;\n            return new MaintenanceMarginParameters(security, quantity, value, value);\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"MaintenanceMarginParameters\"/> for the security's underlying\n        /// </summary>\n        public MaintenanceMarginParameters ForUnderlying(decimal quantity)\n        {\n            var derivative = Security as IDerivativeSecurity;\n            if (derivative == null)\n            {\n                throw new InvalidOperationException(Messages.MaintenanceMarginParameters.ForUnderlyingOnlyInvokableForIDerivativeSecurity);\n            }\n\n            return ForQuantityAtCurrentPrice(derivative.Underlying, quantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MarginCallOrdersParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"DefaultMarginCallModel.GenerateMarginCallOrders\"/>\n    /// </summary>\n    public class MarginCallOrdersParameters\n    {\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Gets the algorithm's total portfolio value\n        /// </summary>\n        public decimal TotalPortfolioValue { get; }\n\n        /// <summary>\n        /// Gets the total used margin\n        /// </summary>\n        public decimal TotalUsedMargin { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarginCallOrdersParameters\"/> class\n        /// </summary>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"totalPortfolioValue\">The algorithm's total portfolio value</param>\n        /// <param name=\"totalUsedMargin\">The total used margin</param>\n        public MarginCallOrdersParameters(IPositionGroup positionGroup, decimal totalPortfolioValue, decimal totalUsedMargin)\n        {\n            PositionGroup = positionGroup;\n            TotalPortfolioValue = totalPortfolioValue;\n            TotalUsedMargin = totalUsedMargin;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MarginInterestRateParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IMarginInterestRateModel.ApplyMarginInterestRate\"/>\n    /// </summary>\n    public class MarginInterestRateParameters\n    {\n        /// <summary>\n        /// The target security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// The current UTC time\n        /// </summary>\n        public DateTime Time { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public MarginInterestRateParameters(Security security, DateTime time)\n        {\n            Security = security;\n            Time = time;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MarketHoursDatabase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides access to exchange hours and raw data times zones in various markets\n    /// </summary>\n    [JsonConverter(typeof(MarketHoursDatabaseJsonConverter))]\n    public class MarketHoursDatabase : BaseSecurityDatabase<MarketHoursDatabase, MarketHoursDatabase.Entry>\n    {\n        private readonly bool _forceExchangeAlwaysOpen = Config.GetBool(\"force-exchange-always-open\");\n\n        private static MarketHoursDatabase _alwaysOpenMarketHoursDatabase;\n\n        /// <summary>\n        /// Gets all the exchange hours held by this provider\n        /// </summary>\n        public List<KeyValuePair<SecurityDatabaseKey, Entry>> ExchangeHoursListing => Entries.ToList();\n\n        /// <summary>\n        /// Gets a <see cref=\"MarketHoursDatabase\"/> that always returns <see cref=\"SecurityExchangeHours.AlwaysOpen\"/>\n        /// </summary>\n        public static MarketHoursDatabase AlwaysOpen\n        {\n            get\n            {\n                if (_alwaysOpenMarketHoursDatabase == null)\n                {\n                    _alwaysOpenMarketHoursDatabase = new AlwaysOpenMarketHoursDatabaseImpl();\n                }\n\n                return _alwaysOpenMarketHoursDatabase;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarketHoursDatabase\"/> class\n        /// </summary>\n        private MarketHoursDatabase()\n            : this(new())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarketHoursDatabase\"/> class\n        /// </summary>\n        /// <param name=\"exchangeHours\">The full listing of exchange hours by key</param>\n        public MarketHoursDatabase(Dictionary<SecurityDatabaseKey, Entry> exchangeHours)\n            : base(exchangeHours, FromDataFolder, (entry, other) => entry.Update(other))\n        {\n        }\n\n        /// <summary>\n        /// Convenience method for retrieving exchange hours from market hours database using a subscription config\n        /// </summary>\n        /// <param name=\"configuration\">The subscription data config to get exchange hours for</param>\n        /// <returns>The configure exchange hours for the specified configuration</returns>\n        public SecurityExchangeHours GetExchangeHours(SubscriptionDataConfig configuration)\n        {\n            return GetExchangeHours(configuration.Market, configuration.Symbol, configuration.SecurityType);\n        }\n\n        /// <summary>\n        /// Convenience method for retrieving exchange hours from market hours database using a subscription config\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <returns>The exchange hours for the specified security</returns>\n        public SecurityExchangeHours GetExchangeHours(string market, Symbol symbol, SecurityType securityType)\n        {\n            return GetEntry(market, symbol, securityType).ExchangeHours;\n        }\n\n        /// <summary>\n        /// Performs a lookup using the specified information and returns the data's time zone if found,\n        /// if an entry is not found, an exception is thrown\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <returns>The raw data time zone for the specified security</returns>\n        public DateTimeZone GetDataTimeZone(string market, Symbol symbol, SecurityType securityType)\n        {\n            return GetEntry(market, GetDatabaseSymbolKey(symbol), securityType).DataTimeZone;\n        }\n\n        /// <summary>\n        /// Gets the instance of the <see cref=\"MarketHoursDatabase\"/> class produced by reading in the market hours\n        /// data found in /Data/market-hours/\n        /// </summary>\n        /// <returns>A <see cref=\"MarketHoursDatabase\"/> class that represents the data in the market-hours folder</returns>\n        public static MarketHoursDatabase FromDataFolder()\n        {\n            if (DataFolderDatabase == null)\n            {\n                lock (DataFolderDatabaseLock)\n                {\n                    if (DataFolderDatabase == null)\n                    {\n                        var path = Path.Combine(Globals.GetDataFolderPath(\"market-hours\"), \"market-hours-database.json\");\n                        DataFolderDatabase = FromFile(path);\n                    }\n                }\n            }\n\n            return DataFolderDatabase;\n        }\n\n        /// <summary>\n        /// Reads the specified file as a market hours database instance\n        /// </summary>\n        /// <param name=\"path\">The market hours database file path</param>\n        /// <returns>A new instance of the <see cref=\"MarketHoursDatabase\"/> class</returns>\n        public static MarketHoursDatabase FromFile(string path)\n        {\n            return JsonConvert.DeserializeObject<MarketHoursDatabase>(File.ReadAllText(path));\n        }\n\n        /// <summary>\n        /// Sets the entry for the specified market/symbol/security-type.\n        /// This is intended to be used by custom data and other data sources that don't have explicit\n        /// entries in market-hours-database.csv. At run time, the algorithm can update the market hours\n        /// database via calls to AddData.\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"exchangeHours\">The exchange hours for the specified symbol</param>\n        /// <param name=\"dataTimeZone\">The time zone of the symbol's raw data. Optional, defaults to the exchange time zone</param>\n        /// <returns>The entry matching the specified market/symbol/security-type</returns>\n        public virtual Entry SetEntry(string market, string symbol, SecurityType securityType, SecurityExchangeHours exchangeHours, DateTimeZone dataTimeZone = null)\n        {\n            dataTimeZone = dataTimeZone ?? exchangeHours.TimeZone;\n            var key = new SecurityDatabaseKey(market, symbol, securityType);\n            var entry = new Entry(dataTimeZone, exchangeHours);\n            lock (DataFolderDatabaseLock)\n            {\n                Entries[key] = entry;\n                CustomEntries.Add(key);\n            }\n            return entry;\n        }\n\n        /// <summary>\n        /// Convenience method for the common custom data case.\n        /// Sets the entry for the specified symbol using SecurityExchangeHours.AlwaysOpen(timeZone)\n        /// This sets the data time zone equal to the exchange time zone as well.\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"timeZone\">The time zone of the symbol's exchange and raw data</param>\n        /// <returns>The entry matching the specified market/symbol/security-type</returns>\n        public virtual Entry SetEntryAlwaysOpen(string market, string symbol, SecurityType securityType, DateTimeZone timeZone)\n        {\n            return SetEntry(market, symbol, securityType, SecurityExchangeHours.AlwaysOpen(timeZone));\n        }\n\n        /// <summary>\n        /// Gets the entry for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <returns>The entry matching the specified market/symbol/security-type</returns>\n        public virtual Entry GetEntry(string market, string symbol, SecurityType securityType)\n        {\n            Entry entry;\n            // Fall back on the Futures MHDB entry if the FOP lookup failed.\n            // Some FOPs have the same symbol properties as their futures counterparts.\n            // So, to save ourselves some space, we can fall back on the existing entries\n            // so that we don't duplicate the information.\n            if (!TryGetEntry(market, symbol, securityType, out entry))\n            {\n                var key = new SecurityDatabaseKey(market, symbol, securityType);\n                Log.Error($\"MarketHoursDatabase.GetExchangeHours(): {Messages.MarketHoursDatabase.ExchangeHoursNotFound(key, Entries.Keys)}\");\n\n                if (securityType == SecurityType.Future && market == Market.USA)\n                {\n                    var exception = Messages.MarketHoursDatabase.FutureUsaMarketTypeNoLongerSupported;\n                    if (SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(symbol, SecurityType.Future, out market))\n                    {\n                        // let's suggest a market\n                        exception += \" \" + Messages.MarketHoursDatabase.SuggestedMarketBasedOnTicker(market);\n                    }\n\n                    throw new ArgumentException(exception);\n                }\n                // there was nothing that really matched exactly\n                throw new ArgumentException(Messages.MarketHoursDatabase.ExchangeHoursNotFound(key));\n            }\n\n            return entry;\n        }\n\n        /// <summary>\n        /// Tries to get the entry for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"entry\">The entry found if any</param>\n        /// <returns>True if the entry was present, else false</returns>\n        public bool TryGetEntry(string market, Symbol symbol, SecurityType securityType, out Entry entry)\n        {\n            return TryGetEntry(market, GetDatabaseSymbolKey(symbol), securityType, out entry);\n        }\n\n        /// <summary>\n        /// Tries to get the entry for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"entry\">The entry found if any</param>\n        /// <returns>True if the entry was present, else false</returns>\n        public virtual bool TryGetEntry(string market, string symbol, SecurityType securityType, out Entry entry)\n        {\n            if (_forceExchangeAlwaysOpen)\n            {\n                return AlwaysOpen.TryGetEntry(market, symbol, securityType, out entry);\n            }\n\n            return TryGetEntryImpl(market, symbol, securityType, out entry);\n        }\n\n        private bool TryGetEntryImpl(string market, string symbol, SecurityType securityType, out Entry entry)\n        {\n            var symbolKey = new SecurityDatabaseKey(market, symbol, securityType);\n            return Entries.TryGetValue(symbolKey, out entry)\n                // now check with null symbol key\n                || Entries.TryGetValue(symbolKey.CreateCommonKey(), out entry)\n                // if FOP check for future\n                || securityType == SecurityType.FutureOption && TryGetEntry(market,\n                    FuturesOptionsSymbolMappings.MapFromOption(symbol), SecurityType.Future, out entry)\n                // if custom data type check for type specific entry\n                || (securityType == SecurityType.Base && SecurityIdentifier.TryGetCustomDataType(symbol, out var customType)\n                    && Entries.TryGetValue(new SecurityDatabaseKey(market, $\"TYPE.{customType}\", securityType), out entry));\n        }\n\n        /// <summary>\n        /// Gets the entry for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded (Symbol class)</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <returns>The entry matching the specified market/symbol/security-type</returns>\n        public virtual Entry GetEntry(string market, Symbol symbol, SecurityType securityType)\n        {\n            return GetEntry(market, GetDatabaseSymbolKey(symbol), securityType);\n        }\n\n        /// <summary>\n        /// Represents a single entry in the <see cref=\"MarketHoursDatabase\"/>\n        /// </summary>\n        public class Entry\n        {\n            /// <summary>\n            /// Gets the raw data time zone for this entry\n            /// </summary>\n            public DateTimeZone DataTimeZone { get; private set; }\n            /// <summary>\n            /// Gets the exchange hours for this entry\n            /// </summary>\n            public SecurityExchangeHours ExchangeHours { get; init; }\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"Entry\"/> class\n            /// </summary>\n            /// <param name=\"dataTimeZone\">The raw data time zone</param>\n            /// <param name=\"exchangeHours\">The security exchange hours for this entry</param>\n            public Entry(DateTimeZone dataTimeZone, SecurityExchangeHours exchangeHours)\n            {\n                DataTimeZone = dataTimeZone;\n                ExchangeHours = exchangeHours;\n            }\n\n            internal void Update(Entry other)\n            {\n                DataTimeZone = other.DataTimeZone;\n                ExchangeHours.Update(other.ExchangeHours);\n            }\n        }\n\n        class AlwaysOpenMarketHoursDatabaseImpl : MarketHoursDatabase\n        {\n            public override bool TryGetEntry(string market, string symbol, SecurityType securityType, out Entry entry)\n            {\n                DateTimeZone dataTimeZone;\n                DateTimeZone exchangeTimeZone;\n                if (TryGetEntryImpl(market, symbol, securityType, out entry))\n                {\n                    dataTimeZone = entry.DataTimeZone;\n                    exchangeTimeZone = entry.ExchangeHours.TimeZone;\n                }\n                else\n                {\n                    dataTimeZone = exchangeTimeZone = TimeZones.Utc;\n                }\n\n                entry = new Entry(dataTimeZone, SecurityExchangeHours.AlwaysOpen(exchangeTimeZone));\n                return true;\n            }\n\n            public AlwaysOpenMarketHoursDatabaseImpl()\n                : base(FromDataFolder().ExchangeHoursListing.ToDictionary())\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MarketHoursSegment.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the state of an exchange during a specified time range\n    /// </summary>\n    [JsonObject(MemberSerialization.OptIn)]\n    public class MarketHoursSegment\n    {\n        /// <summary>\n        /// Gets the start time for this segment\n        /// </summary>\n        [JsonProperty(\"start\")]\n        public TimeSpan Start { get; private set; }\n\n        /// <summary>\n        /// Gets the end time for this segment\n        /// </summary>\n        [JsonProperty(\"end\")]\n        public TimeSpan End { get; private set; }\n\n        /// <summary>\n        /// Gets the market hours state for this segment\n        /// </summary>\n        [JsonProperty(\"state\")]\n        public MarketHoursState State { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MarketHoursSegment\"/> class\n        /// </summary>\n        /// <param name=\"state\">The state of the market during the specified times</param>\n        /// <param name=\"start\">The start time of the segment</param>\n        /// <param name=\"end\">The end time of the segment</param>\n        public MarketHoursSegment(MarketHoursState state, TimeSpan start, TimeSpan end)\n        {\n            Start = start;\n            End = end;\n            State = state;\n        }\n\n        /// <summary>\n        /// Gets a new market hours segment representing being open all day\n        /// </summary>\n        public static MarketHoursSegment OpenAllDay()\n        {\n            return new MarketHoursSegment(MarketHoursState.Market, TimeSpan.Zero, Time.OneDay);\n        }\n\n        /// <summary>\n        /// Gets a new market hours segment representing being open all day\n        /// </summary>\n        public static MarketHoursSegment ClosedAllDay()\n        {\n            return new MarketHoursSegment(MarketHoursState.Closed, TimeSpan.Zero, Time.OneDay);\n        }\n\n        /// <summary>\n        /// Creates the market hours segments for the specified market open/close times\n        /// </summary>\n        /// <param name=\"extendedMarketOpen\">The extended market open time. If no pre market, set to market open</param>\n        /// <param name=\"marketOpen\">The regular market open time</param>\n        /// <param name=\"marketClose\">The regular market close time</param>\n        /// <param name=\"extendedMarketClose\">The extended market close time. If no post market, set to market close</param>\n        /// <returns>An array of <see cref=\"MarketHoursSegment\"/> representing the specified market open/close times</returns>\n        public static MarketHoursSegment[] GetMarketHoursSegments(\n            TimeSpan extendedMarketOpen,\n            TimeSpan marketOpen,\n            TimeSpan marketClose,\n            TimeSpan extendedMarketClose\n            )\n        {\n            // perform some sanity checks\n            if (marketOpen < extendedMarketOpen)\n            {\n                throw new ArgumentException(Messages.MarketHoursSegment.InvalidExtendedMarketOpenTime);\n            }\n            if (marketClose < marketOpen)\n            {\n                throw new ArgumentException(Messages.MarketHoursSegment.InvalidMarketCloseTime);\n            }\n            if (extendedMarketClose < marketClose)\n            {\n                throw new ArgumentException(Messages.MarketHoursSegment.InvalidExtendedMarketCloseTime);\n            }\n\n            var segments = new List<MarketHoursSegment>();\n\n            if (extendedMarketOpen != marketOpen)\n            {\n                segments.Add(new MarketHoursSegment(MarketHoursState.PreMarket, extendedMarketOpen, marketOpen));\n            }\n\n            if (marketOpen != TimeSpan.Zero || marketClose != TimeSpan.Zero)\n            {\n                segments.Add(new MarketHoursSegment(MarketHoursState.Market, marketOpen, marketClose));\n            }\n\n            if (marketClose != extendedMarketClose)\n            {\n                segments.Add(new MarketHoursSegment(MarketHoursState.PostMarket, marketClose, extendedMarketClose));\n            }\n\n            return segments.ToArray();\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified time is contained within this segment\n        /// </summary>\n        /// <param name=\"time\">The time to check</param>\n        /// <returns>True if this segment contains the specified time, false otherwise</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool Contains(TimeSpan time)\n        {\n            return time >= Start && time < End;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified time range overlaps with this segment\n        /// </summary>\n        /// <param name=\"start\">The start of the range</param>\n        /// <param name=\"end\">The end of the range</param>\n        /// <returns>True if the specified range overlaps this time segment, false otherwise</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool Overlaps(TimeSpan start, TimeSpan end)\n        {\n            return Start < end && End > start;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        public override string ToString()\n        {\n            return Messages.MarketHoursSegment.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/MarketHoursState.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Specifies the open/close state for a <see cref=\"MarketHoursSegment\"/>\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum MarketHoursState\n    {\n        /// <summary>\n        /// The market is not open (0)\n        /// </summary>\n        [EnumMember(Value = \"closed\")]\n        Closed,\n\n        /// <summary>\n        /// The market is open, but before normal trading hours (1)\n        /// </summary>\n        [EnumMember(Value = \"premarket\")]\n        PreMarket,\n\n        /// <summary>\n        /// The market is open and within normal trading hours (2)\n        /// </summary>\n        [EnumMember(Value = \"market\")]\n        Market,\n\n        /// <summary>\n        /// The market is open, but after normal trading hours (3)\n        /// </summary>\n        [EnumMember(Value = \"postmarket\")]\n        PostMarket\n    }\n}"
  },
  {
    "path": "Common/Securities/NullBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a buying power model considers that there is sufficient buying power for all orders\n    /// </summary>\n    public class NullBuyingPowerModel : BuyingPowerModel\n    {\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return new MaintenanceMargin(decimal.Zero);\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>Returns buying power information for an order</returns>\n        public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(HasSufficientBuyingPowerForOrderParameters parameters)\n        {\n            return parameters.Sufficient();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/ConstantQLDividendYieldEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Class implements default flat dividend yield curve estimator, implementing <see cref=\"IQLDividendYieldEstimator\"/>.  \n    /// </summary>\n    public class ConstantQLDividendYieldEstimator : IQLDividendYieldEstimator\n    {\n        private readonly double _dividendYield;\n        /// <summary>\n        /// Constructor initializes class with constant dividend yield. \n        /// </summary>\n        /// <param name=\"dividendYield\"></param>\n        public ConstantQLDividendYieldEstimator(double dividendYield = 0.00)\n        {\n            _dividendYield = dividendYield;\n        }\n\n        /// <summary>\n        /// Returns current flat estimate of the dividend yield\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>The estimate</returns>\n        public double Estimate(Security security, Slice slice, OptionContract contract)\n        {\n            return _dividendYield;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/ConstantQLRiskFreeRateEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Class implements default flat risk free curve, implementing <see cref=\"IQLRiskFreeRateEstimator\"/>.\n    /// </summary>\n    public class ConstantQLRiskFreeRateEstimator : IQLRiskFreeRateEstimator\n    {\n        private readonly decimal _riskFreeRate;\n        /// <summary>\n        /// Constructor initializes class with risk free rate constant\n        /// </summary>\n        /// <param name=\"riskFreeRate\"></param>\n        public ConstantQLRiskFreeRateEstimator(decimal riskFreeRate = 0.01m)\n        {\n            _riskFreeRate = riskFreeRate;\n        }\n\n        /// <summary>\n        /// Returns current flat estimate of the risk free rate\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>The estimate</returns>\n        public decimal Estimate(Security security, Slice slice, OptionContract contract) => _riskFreeRate;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/ConstantQLUnderlyingVolatilityEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Class implements default underlying constant volatility estimator (<see cref=\"IQLUnderlyingVolatilityEstimator\"/>.), that projects the underlying own volatility \n    /// model into corresponding option pricing model.\n    /// </summary>\n    public class ConstantQLUnderlyingVolatilityEstimator : IQLUnderlyingVolatilityEstimator\n    {\n        /// <summary>\n        /// Indicates whether volatility model has been warmed ot not\n        /// </summary>\n        public bool IsReady { get; private set; }\n\n        /// <summary>\n        /// Returns current estimate of the underlying volatility\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>The estimate</returns>\n        public double Estimate(Security security, Slice slice, OptionContract contract)\n        {\n            var option = security as Option;\n\n            if (option != null &&\n                option.Underlying != null &&\n                option.Underlying.VolatilityModel != null &&\n                option.Underlying.VolatilityModel.Volatility > 0m)\n            {\n                IsReady = true;\n                return (double)option.Underlying.VolatilityModel.Volatility;\n            }\n\n            return 0.0;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/CurrentPriceOptionPriceModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"IOptionPriceModel\"/> that does not compute any\n    /// greeks and uses the current price for the theoretical price.\n    /// <remarks>This is a stub implementation until the real models are implemented</remarks>\n    /// </summary>\n    public class CurrentPriceOptionPriceModel : OptionPriceModel\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPriceModelResult\"/> containing the current <see cref=\"Security.Price\"/>\n        /// and a default, empty instance of first Order <see cref=\"Greeks\"/>\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public override OptionPriceModelResult Evaluate(Security security, Slice slice, OptionContract contract)\n        {\n            return new OptionPriceModelResult(security.Price, NullGreeks.Instance);\n        }\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OptionPriceModelParameters\"/> object\n        /// containing the security, slice and contract</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public override OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters)\n        {\n            return Evaluate(parameters.Security, parameters.Slice, parameters.Contract);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/DefaultOptionAssignmentModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// The option assignment model emulates exercising of short option positions in the portfolio.\n    /// Simulator implements basic no-arb argument: when time value of the option contract is close to zero\n    /// it assigns short legs getting profit close to expiration dates in deep ITM positions. User algorithm then receives\n    /// assignment event from LEAN. Simulator randomly scans for arbitrage opportunities every two hours or so.\n    /// </summary>\n    public class DefaultOptionAssignmentModel : IOptionAssignmentModel\n    {\n        // when we start simulating assignments prior to expiration\n        private readonly TimeSpan _priorExpiration;\n\n        // we focus only on deep ITM calls and puts\n        private readonly decimal _requiredInTheMoneyPercent;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"requiredInTheMoneyPercent\">The percent in the money the option has to be to trigger the option assignment</param>\n        /// <param name=\"priorExpiration\">For <see cref=\"OptionStyle.American\"/>, the time span prior to expiration were we will try to evaluate option assignment</param>\n        public DefaultOptionAssignmentModel(decimal requiredInTheMoneyPercent = 0.05m, TimeSpan? priorExpiration = null)\n        {\n            _priorExpiration = priorExpiration ?? new TimeSpan(4, 0, 0, 0);\n            _requiredInTheMoneyPercent = requiredInTheMoneyPercent;\n        }\n\n        /// <summary>\n        /// Get's the option assignments to generate if any\n        /// </summary>\n        /// <param name=\"parameters\">The option assignment parameters data transfer class</param>\n        /// <returns>The option assignment result</returns>\n        public virtual OptionAssignmentResult GetAssignment(OptionAssignmentParameters parameters)\n        {\n            var option = parameters.Option;\n            var underlying = parameters.Option.Underlying;\n\n            // we take only options that expire soon\n            if ((option.Symbol.ID.OptionStyle == OptionStyle.American && option.Symbol.ID.Date - option.LocalTime <= _priorExpiration ||\n                option.Symbol.ID.OptionStyle == OptionStyle.European && option.Symbol.ID.Date.Date == option.LocalTime.Date)\n                // we take only deep ITM strikes\n                && IsDeepInTheMoney(option))\n            {\n                // we estimate P/L\n                var potentialPnL = EstimateArbitragePnL(option, (OptionHolding)option.Holdings, underlying);\n                if (potentialPnL > 0)\n                {\n                    return new OptionAssignmentResult(option.Holdings.AbsoluteQuantity, \"Simulated option assignment before expiration\");\n                }\n            }\n\n            return OptionAssignmentResult.Null;\n        }\n\n        private bool IsDeepInTheMoney(Option option)\n        {\n            var symbol = option.Symbol;\n            var underlyingPrice = option.Underlying.Close;\n\n            // For some options, the price is based on a fraction of the underlying, such as for NQX.\n            // Therefore, for those options we need to scale the price when comparing it with the\n            // underlying. For that reason we use option.ScaledStrikePrice instead of\n            // option.StrikePrice\n            var result =\n                symbol.ID.OptionRight == OptionRight.Call\n                    ? (underlyingPrice - option.ScaledStrikePrice) / underlyingPrice > _requiredInTheMoneyPercent\n                    : (option.ScaledStrikePrice - underlyingPrice) / underlyingPrice > _requiredInTheMoneyPercent;\n\n            return result;\n        }\n\n        private static decimal EstimateArbitragePnL(Option option, OptionHolding holding, Security underlying)\n        {\n            // no-arb argument:\n            // if our long deep ITM position has a large B/A spread and almost no time value, it may be interesting for us\n            // to exercise the option and close the resulting position in underlying instrument, if we want to exit now.\n\n            // User's short option position is our long one.\n            // In order to sell ITM position we take option bid price as an input\n            var optionPrice = option.BidPrice;\n\n            // we are interested in underlying bid price if we exercise calls and want to sell the underlying immediately.\n            // we are interested in underlying ask price if we exercise puts\n            var underlyingPrice = option.Symbol.ID.OptionRight == OptionRight.Call\n                ? underlying.BidPrice\n                : underlying.AskPrice;\n\n            // quantity is normally negative algo's holdings, but since we're modeling the contract holder (counter-party)\n            // it's negative THEIR holdings. holding.Quantity is negative, so if counter-party exercises, they would reduce holdings\n            var underlyingQuantity = option.GetExerciseQuantity(holding.Quantity);\n\n            // Scenario 1 (base): we just close option position\n            var marketOrder1 = new MarketOrder(option.Symbol, -holding.Quantity, option.LocalTime.ConvertToUtc(option.Exchange.TimeZone));\n            var orderFee1 = option.FeeModel.GetOrderFee(\n                new OrderFeeParameters(option, marketOrder1)).Value.Amount * option.QuoteCurrency.ConversionRate;\n\n            var basePnL = (optionPrice - holding.AveragePrice) * -holding.Quantity\n                * option.QuoteCurrency.ConversionRate\n                * option.SymbolProperties.ContractMultiplier\n                - orderFee1;\n\n            // Scenario 2 (alternative): we exercise option and then close underlying position\n            var optionExerciseOrder2 = new OptionExerciseOrder(option.Symbol, (int)holding.AbsoluteQuantity, option.LocalTime.ConvertToUtc(option.Exchange.TimeZone));\n            var optionOrderFee2 = option.FeeModel.GetOrderFee(\n                new OrderFeeParameters(option, optionExerciseOrder2)).Value.Amount * option.QuoteCurrency.ConversionRate;\n\n            var underlyingOrderFee2Amount = 0m;\n\n            // Cash settlements do not open a position for the underlying.\n            // For Physical Delivery, we calculate the order fee since we have to close the position\n            if (option.ExerciseSettlement == SettlementType.PhysicalDelivery)\n            {\n                var underlyingMarketOrder2 = new MarketOrder(underlying.Symbol, -underlyingQuantity,\n                    underlying.LocalTime.ConvertToUtc(underlying.Exchange.TimeZone));\n                var underlyingOrderFee2 = underlying.FeeModel.GetOrderFee(\n                    new OrderFeeParameters(underlying, underlyingMarketOrder2)).Value.Amount * underlying.QuoteCurrency.ConversionRate;\n                underlyingOrderFee2Amount = underlyingOrderFee2;\n            }\n\n            // calculating P/L of the two transactions (exercise option and then close underlying position)\n            var altPnL = (underlyingPrice - option.ScaledStrikePrice) * underlyingQuantity * underlying.QuoteCurrency.ConversionRate * option.ContractUnitOfTrade\n                        - underlyingOrderFee2Amount\n                        - holding.AveragePrice * holding.AbsoluteQuantity * option.SymbolProperties.ContractMultiplier * option.QuoteCurrency.ConversionRate\n                        - optionOrderFee2;\n\n            return altPnL - basePnL;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/EmptyOptionChainProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IOptionChainProvider\"/> that always returns an empty list of contracts\n    /// </summary>\n    public class EmptyOptionChainProvider : IOptionChainProvider\n    {\n        /// <summary>\n        /// Gets the list of option contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the option chain (only used in backtesting)</param>\n        /// <returns>The list of option contracts</returns>\n        public IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date)\n        {\n            return Enumerable.Empty<Symbol>();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/FedRateQLRiskFreeRateEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Class implements Fed's US primary credit rate as risk free rate, implementing <see cref=\"IQLRiskFreeRateEstimator\"/>.\n    /// </summary>\n    /// <remarks>\n    /// Board of Governors of the Federal Reserve System (US), Primary Credit Rate - Historical Dates of Changes and Rates for Federal Reserve District 8: St. Louis [PCREDIT8]\n    /// retrieved from FRED, Federal Reserve Bank of St. Louis; https://fred.stlouisfed.org/series/PCREDIT8\n    /// </remarks>\n    public class FedRateQLRiskFreeRateEstimator : IQLRiskFreeRateEstimator\n    {\n        private readonly InterestRateProvider _interestRateProvider = new ();\n\n        /// <summary>\n        /// Returns current flat estimate of the risk free rate\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>The estimate</returns>\n        public decimal Estimate(Security security, Slice slice, OptionContract contract)\n        {\n            return slice == null\n                ? InterestRateProvider.DefaultRiskFreeRate\n                : _interestRateProvider.GetInterestRate(slice.Time.Date);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IOptionAssignmentModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// The option assignment model emulates exercising of short option positions in the portfolio.\n    /// </summary>\n    public interface IOptionAssignmentModel\n    {\n        /// <summary>\n        /// Get's the option assignments to generate if any\n        /// </summary>\n        /// <param name=\"parameters\">The option assignment parameters data transfer class</param>\n        /// <returns>The option assignment result</returns>\n        public OptionAssignmentResult GetAssignment(OptionAssignmentParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IOptionPriceModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines a model used to calculate the theoretical price of an option contract.\n    /// </summary>\n    public interface IOptionPriceModel\n    {\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OptionPriceModelParameters\"/> object\n        /// containing the security, slice and contract</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IOptionPriceModelProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides option price models for option securities\n    /// </summary>\n    public interface IOptionPriceModelProvider\n    {\n        /// <summary>\n        /// Gets the option price model for the specified option symbol.\n        /// If no pricing model is specified, the default option price model for the symbol security type will be returned.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"pricingModelType\">The option pricing model type to use</param>\n        /// <returns>The option price model for the given symbol</returns>\n        IOptionPriceModel GetOptionPriceModel(Symbol symbol, OptionPricingModelType? pricingModelType = null);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IQLDividendYieldEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines QuantLib dividend yield estimator for option pricing model. User may define his own estimators, \n    /// including those forward and backward looking ones.\n    /// </summary>\n    public interface IQLDividendYieldEstimator\n    {\n        /// <summary>\n        /// Returns current estimate of the stock dividend yield\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>Dividend yield</returns>\n        double Estimate(Security security, Slice slice, OptionContract contract);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IQLRiskFreeRateEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines QuantLib risk free rate estimator for option pricing model. \n    /// </summary>\n    public interface IQLRiskFreeRateEstimator\n    {\n        /// <summary>\n        /// Returns current estimate of the risk free rate\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>Risk free rate</returns>\n        decimal Estimate(Security security, Slice slice, OptionContract contract);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/IQLUnderlyingVolatilityEstimator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines QuantLib underlying volatility estimator for option pricing model. User may define his own estimators, \n    /// including those forward and backward looking ones.\n    /// </summary>\n    public interface IQLUnderlyingVolatilityEstimator\n    {\n        /// <summary>\n        /// Returns current estimate of the underlying volatility\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>Volatility</returns>\n        double Estimate(Security security, Slice slice, OptionContract contract);\n\n        /// <summary>\n        /// Indicates whether volatility model is warmed up or no\n        /// </summary>\n        bool IsReady { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/NullOptionAssignmentModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// The null option assignment model, that will disable automatic order assignment\n    /// </summary>\n    public class NullOptionAssignmentModel : IOptionAssignmentModel\n    {\n        /// <summary>\n        /// Get's the option assignments to generate if any\n        /// </summary>\n        /// <param name=\"parameters\">The option assignment parameters data transfer object</param>\n        /// <returns>The option assignment result</returns>\n        public OptionAssignmentResult GetAssignment(OptionAssignmentParameters parameters)\n        {\n            return OptionAssignmentResult.Null;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/Option.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.OptionExercise;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Python;\nusing QuantConnect.Securities.Interfaces;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option Security Object Implementation for Option Assets\n    /// </summary>\n    /// <seealso cref=\"Security\"/>\n    public class Option : Security, IDerivativeSecurity, IOptionPrice\n    {\n        /// <summary>\n        /// The default number of days required to settle an equity sale\n        /// </summary>\n        public static int DefaultSettlementDays { get; set; } = 1;\n\n        /// <summary>\n        /// The default time of day for settlement\n        /// </summary>\n        public static readonly TimeSpan DefaultSettlementTime = new(6, 0, 0);\n\n        /// <summary>\n        /// Constructor for the option security\n        /// </summary>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"config\">The subscription configuration for this security</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"priceModelProvider\">The option price model provider</param>\n        /// <remarks>Used in testing</remarks>\n        public Option(SecurityExchangeHours exchangeHours,\n            SubscriptionDataConfig config,\n            Cash quoteCurrency,\n            OptionSymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            IOptionPriceModelProvider priceModelProvider = null)\n            : this(config.Symbol,\n                quoteCurrency,\n                symbolProperties,\n                new OptionExchange(exchangeHours),\n                new OptionCache(),\n                new OptionPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new OptionMarginModel(),\n                new OptionDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypes,\n                null,\n                priceModelProvider)\n        {\n            AddData(config);\n            SetDataNormalizationMode(DataNormalizationMode.Raw);\n        }\n\n        /// <summary>\n        /// Constructor for the option security\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security</param>\n        /// <param name=\"exchangeHours\">Defines the hours this exchange is open</param>\n        /// <param name=\"quoteCurrency\">The cash object that represent the quote currency</param>\n        /// <param name=\"symbolProperties\">The symbol properties for this security</param>\n        /// <param name=\"currencyConverter\">Currency converter used to convert <see cref=\"CashAmount\"/>\n        /// instances into units of the account currency</param>\n        /// <param name=\"registeredTypes\">Provides all data types registered in the algorithm</param>\n        /// <param name=\"securityCache\">Cache to store security information</param>\n        /// <param name=\"underlying\">Future underlying security</param>\n        /// <param name=\"priceModelProvider\">The option price model provider</param>\n        public Option(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            OptionSymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCache securityCache,\n            Security underlying,            \n            IOptionPriceModelProvider priceModelProvider = null)\n           : this (symbol,\n               quoteCurrency,\n               symbolProperties,\n               new OptionExchange(exchangeHours),\n               securityCache,\n               new OptionPortfolioModel(),\n               new ImmediateFillModel(),\n               new InteractiveBrokersFeeModel(),\n               NullSlippageModel.Instance,\n               new ImmediateSettlementModel(),\n               Securities.VolatilityModel.Null,\n               new OptionMarginModel(),\n               new OptionDataFilter(),\n               new SecurityPriceVariationModel(),\n               currencyConverter,\n               registeredTypes,\n               underlying,\n               priceModelProvider)\n        {\n        }\n\n        /// <summary>\n        /// Creates instance of the Option class.\n        /// </summary>\n        /// <remarks>\n        /// Allows for the forwarding of the security configuration to the\n        /// base Security constructor\n        /// </remarks>\n        protected Option(Symbol symbol,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            SecurityExchange exchange,\n            SecurityCache cache,\n            ISecurityPortfolioModel portfolioModel,\n            IFillModel fillModel,\n            IFeeModel feeModel,\n            ISlippageModel slippageModel,\n            ISettlementModel settlementModel,\n            IVolatilityModel volatilityModel,\n            IBuyingPowerModel buyingPowerModel,\n            ISecurityDataFilter dataFilter,\n            IPriceVariationModel priceVariationModel,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            Security underlying,\n            IOptionPriceModelProvider priceModelProvider\n        ) : base(\n            symbol,\n            quoteCurrency,\n            symbolProperties,\n            exchange,\n            cache,\n            portfolioModel,\n            fillModel,\n            feeModel,\n            slippageModel,\n            settlementModel,\n            volatilityModel,\n            buyingPowerModel,\n            dataFilter,\n            priceVariationModel,\n            currencyConverter,\n            registeredTypesProvider,\n            Securities.MarginInterestRateModel.Null\n        )\n        {\n            ExerciseSettlement = SettlementType.PhysicalDelivery;\n            SetDataNormalizationMode(DataNormalizationMode.Raw);\n            OptionExerciseModel = new DefaultExerciseModel();\n            PriceModel = (priceModelProvider ?? QLOptionPriceModelProvider.Instance).GetOptionPriceModel(symbol);\n            Holdings = new OptionHolding(this, currencyConverter);\n            _symbolProperties = (OptionSymbolProperties)symbolProperties;\n            SetFilter(-1, 1, TimeSpan.Zero, TimeSpan.FromDays(35));\n            Underlying = underlying;\n            OptionAssignmentModel = new DefaultOptionAssignmentModel();\n            ScaledStrikePrice = StrikePrice * SymbolProperties.StrikeMultiplier;\n        }\n\n        // save off a strongly typed version of symbol properties\n        private readonly OptionSymbolProperties _symbolProperties;\n\n        /// <summary>\n        /// Returns true if this is the option chain security, false if it is a specific option contract\n        /// </summary>\n        public bool IsOptionChain => Symbol.IsCanonical();\n\n        /// <summary>\n        /// Returns true if this is a specific option contract security, false if it is the option chain security\n        /// </summary>\n        public bool IsOptionContract => !Symbol.IsCanonical();\n\n        /// <summary>\n        /// Gets the strike price\n        /// </summary>\n        public decimal StrikePrice => Symbol.ID.StrikePrice;\n\n        /// <summary>\n        /// Gets the strike price multiplied by the strike multiplier\n        /// </summary>\n        public decimal ScaledStrikePrice\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the expiration date\n        /// </summary>\n        public DateTime Expiry => Symbol.ID.Date;\n\n        /// <summary>\n        /// Gets the right being purchased (call [right to buy] or put [right to sell])\n        /// </summary>\n        public OptionRight Right => Symbol.ID.OptionRight;\n\n        /// <summary>\n        /// Gets the option style\n        /// </summary>\n        public OptionStyle Style => Symbol.ID.OptionStyle;\n\n        /// <summary>\n        /// Gets the most recent bid price if available\n        /// </summary>\n        public override decimal BidPrice => Cache.BidPrice;\n\n        /// <summary>\n        /// Gets the most recent ask price if available\n        /// </summary>\n        public override decimal AskPrice => Cache.AskPrice;\n\n        /// <summary>\n        /// When the holder of an equity option exercises one contract, or when the writer of an equity option is assigned\n        /// an exercise notice on one contract, this unit of trade, usually 100 shares of the underlying security, changes hands.\n        /// </summary>\n        public int ContractUnitOfTrade\n        {\n            get\n            {\n                return _symbolProperties.ContractUnitOfTrade;\n            }\n            set\n            {\n                _symbolProperties.SetContractUnitOfTrade(value);\n            }\n        }\n\n        /// <summary>\n        /// The contract multiplier for the option security\n        /// </summary>\n        public int ContractMultiplier\n        {\n            get\n            {\n                return (int)_symbolProperties.ContractMultiplier;\n            }\n            set\n            {\n                _symbolProperties.SetContractMultiplier(value);\n            }\n        }\n\n        /// <summary>\n        /// Aggregate exercise amount or aggregate contract value. It is the total amount of cash one will pay (or receive) for the shares of the\n        /// underlying stock if he/she decides to exercise (or is assigned an exercise notice). This amount is not the premium paid or received for an equity option.\n        /// </summary>\n        public decimal GetAggregateExerciseAmount()\n        {\n            return StrikePrice * ContractMultiplier;\n        }\n\n        /// <summary>\n        /// Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of all\n        /// contracts held by this account, taking into account the contract's <see cref=\"Right\"/> as well as the contract's current\n        /// <see cref=\"ContractUnitOfTrade\"/>, which may have recently changed due to a split/reverse split in the underlying security.\n        /// </summary>\n        /// <remarks>\n        /// Long option positions result in exercise while short option positions result in assignment. This function uses the term\n        /// exercise loosely to refer to both situations.\n        /// </remarks>\n        public decimal GetExerciseQuantity()\n        {\n            // negate Holdings.Quantity to match an equivalent order\n            return GetExerciseQuantity(-Holdings.Quantity);\n        }\n\n        /// <summary>\n        /// Returns the directional quantity of underlying shares that are going to change hands on exercise/assignment of the\n        /// specified <paramref name=\"exerciseOrderQuantity\"/>, taking into account the contract's <see cref=\"Right\"/> as well\n        /// as the contract's current <see cref=\"ContractUnitOfTrade\"/>, which may have recently changed due to a split/reverse\n        /// split in the underlying security.\n        /// </summary>\n        /// <remarks>\n        /// Long option positions result in exercise while short option positions result in assignment. This function uses the term\n        /// exercise loosely to refer to both situations.\n        /// </remarks>\n        /// <paramref name=\"exerciseOrderQuantity\">The quantity of contracts being exercised as provided by the <see cref=\"OptionExerciseOrder\"/>.\n        /// A negative value indicates exercise (we are long and the order quantity is negative to bring us (closer) to zero.\n        /// A positive value indicates assignment (we are short and the order quantity is positive to bring us (closer) to zero.</paramref>\n        public decimal GetExerciseQuantity(decimal exerciseOrderQuantity)\n        {\n            // when exerciseOrderQuantity > 0 [ we are short ]\n            //      && right == call => we sell to contract holder  => negative\n            //      && right == put  => we buy from contract holder => positive\n\n            // when exerciseOrderQuantity < 0 [ we are long ]\n            //      && right == call => we buy from contract holder => positive\n            //      && right == put  => we sell to contract holder  => negative\n\n            var sign = Right == OptionRight.Call ? -1 : 1;\n            return sign * exerciseOrderQuantity * ContractUnitOfTrade;\n        }\n\n        /// <summary>\n        /// Checks if option is eligible for automatic exercise on expiration\n        /// </summary>\n        public bool IsAutoExercised(decimal underlyingPrice)\n        {\n            return GetIntrinsicValue(underlyingPrice) >= 0.01m;\n        }\n\n        /// <summary>\n        /// Intrinsic value function of the option\n        /// </summary>\n        public decimal GetIntrinsicValue(decimal underlyingPrice)\n        {\n            return OptionPayoff.GetIntrinsicValue(underlyingPrice, ScaledStrikePrice, Right);\n        }\n\n        /// <summary>\n        /// Option payoff function at expiration time\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <returns></returns>\n        public decimal GetPayOff(decimal underlyingPrice)\n        {\n            return OptionPayoff.GetPayOff(underlyingPrice, ScaledStrikePrice, Right);\n        }\n\n        /// <summary>\n        /// Option out of the money function\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <returns></returns>\n        public decimal OutOfTheMoneyAmount(decimal underlyingPrice)\n        {\n            return Math.Max(0, Right == OptionRight.Call ? ScaledStrikePrice - underlyingPrice : underlyingPrice - ScaledStrikePrice);\n        }\n\n        /// <summary>\n        /// Specifies if option contract has physical or cash settlement on exercise\n        /// </summary>\n        public SettlementType ExerciseSettlement\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets or sets the underlying security object.\n        /// </summary>\n        public Security Underlying\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Gets a reduced interface of the underlying security object.\n        /// </summary>\n        ISecurityPrice IOptionPrice.Underlying => Underlying;\n\n        /// <summary>\n        /// For this option security object, evaluates the specified option\n        /// contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public OptionPriceModelResult EvaluatePriceModel(Slice slice, OptionContract contract)\n        {\n            return PriceModel.Evaluate(new OptionPriceModelParameters(this, slice, contract));\n        }\n\n        /// <summary>\n        /// Gets or sets the price model for this option security\n        /// </summary>\n        public IOptionPriceModel PriceModel\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Fill model used to produce fill events for this security\n        /// </summary>\n        public IOptionExerciseModel OptionExerciseModel\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// The automatic option assignment model\n        /// </summary>\n        public IOptionAssignmentModel OptionAssignmentModel\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers\n        /// </summary>\n        [Obsolete(\"This property has been deprecated. Please use QLOptionPriceModel.EnableGreekApproximation instead.\")]\n        public bool EnableGreekApproximation\n        {\n            get\n            {\n                var model = PriceModel as QLOptionPriceModel;\n                if (model != null)\n                {\n                    return model.EnableGreekApproximation;\n                }\n                return false;\n            }\n\n            set\n            {\n                var model = PriceModel as QLOptionPriceModel;\n                if (model != null)\n                {\n                    model.EnableGreekApproximation = value;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the contract filter\n        /// </summary>\n        public IDerivativeSecurityFilter<OptionUniverse> ContractFilter\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Sets the automatic option assignment model\n        /// </summary>\n        /// <param name=\"pyObject\">The option assignment model to use</param>\n        public void SetOptionAssignmentModel(PyObject pyObject)\n        {\n            OptionAssignmentModel = PythonUtil.CreateInstanceOrWrapper<IOptionAssignmentModel>(\n                pyObject,\n                py => new OptionAssignmentModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the automatic option assignment model\n        /// </summary>\n        /// <param name=\"optionAssignmentModel\">The option assignment model to use</param>\n        public void SetOptionAssignmentModel(IOptionAssignmentModel optionAssignmentModel)\n        {\n            OptionAssignmentModel = optionAssignmentModel;\n        }\n\n        /// <summary>\n        /// Sets the option exercise model\n        /// </summary>\n        /// <param name=\"pyObject\">The option exercise model to use</param>\n        public void SetOptionExerciseModel(PyObject pyObject)\n        {\n            OptionExerciseModel = PythonUtil.CreateInstanceOrWrapper<IOptionExerciseModel>(\n                pyObject,\n                py => new OptionExerciseModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the option exercise model\n        /// </summary>\n        /// <param name=\"optionExerciseModel\">The option exercise model to use</param>\n        public void SetOptionExerciseModel(IOptionExerciseModel optionExerciseModel)\n        {\n            OptionExerciseModel = optionExerciseModel;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified min and max strike values. Contracts with expirations further than 35\n        /// days out will also be filtered.\n        /// </summary>\n        /// <param name=\"minStrike\">The min strike rank relative to market price, for example, -1 would put\n        /// a lower bound of one strike under market price, where a +1 would put a lower bound of one strike\n        /// over market price</param>\n        /// <param name=\"maxStrike\">The max strike rank relative to market place, for example, -1 would put\n        /// an upper bound of on strike under market price, where a +1 would be an upper bound of one strike\n        /// over market price</param>\n        public void SetFilter(int minStrike, int maxStrike)\n        {\n            SetFilterImp(universe => universe.Strikes(minStrike, maxStrike));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified min and max strike and expiration range values\n        /// </summary>\n        /// <param name=\"minExpiry\">The minimum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiry\">The maximum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in more than 10 days</param>\n        public void SetFilter(TimeSpan minExpiry, TimeSpan maxExpiry)\n        {\n            SetFilterImp(universe => universe.Expiration(minExpiry, maxExpiry));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified min and max strike and expiration range values\n        /// </summary>\n        /// <param name=\"minStrike\">The min strike rank relative to market price, for example, -1 would put\n        /// a lower bound of one strike under market price, where a +1 would put a lower bound of one strike\n        /// over market price</param>\n        /// <param name=\"maxStrike\">The max strike rank relative to market place, for example, -1 would put\n        /// an upper bound of on strike under market price, where a +1 would be an upper bound of one strike\n        /// over market price</param>\n        /// <param name=\"minExpiry\">The minimum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiry\">The maximum time until expiry to include, for example, TimeSpan.FromDays(10)\n        /// would exclude contracts expiring in more than 10 days</param>\n        public void SetFilter(int minStrike, int maxStrike, TimeSpan minExpiry, TimeSpan maxExpiry)\n        {\n            SetFilterImp(universe => universe\n                .Strikes(minStrike, maxStrike)\n                .Expiration(minExpiry, maxExpiry));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new instance of the filter\n        /// using the specified min and max strike and expiration range values\n        /// </summary>\n        /// <param name=\"minStrike\">The min strike rank relative to market price, for example, -1 would put\n        /// a lower bound of one strike under market price, where a +1 would put a lower bound of one strike\n        /// over market price</param>\n        /// <param name=\"maxStrike\">The max strike rank relative to market place, for example, -1 would put\n        /// an upper bound of on strike under market price, where a +1 would be an upper bound of one strike\n        /// over market price</param>\n        /// <param name=\"minExpiryDays\">The minimum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in less than 10 days</param>\n        /// <param name=\"maxExpiryDays\">The maximum time, expressed in days, until expiry to include, for example, 10\n        /// would exclude contracts expiring in more than 10 days</param>\n        public void SetFilter(int minStrike, int maxStrike, int minExpiryDays, int maxExpiryDays)\n        {\n            SetFilterImp(universe => universe\n                .Strikes(minStrike, maxStrike)\n                .Expiration(minExpiryDays, maxExpiryDays));\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new universe selection function\n        /// </summary>\n        /// <param name=\"universeFunc\">new universe selection function</param>\n        public void SetFilter(Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc)\n        {\n            ContractFilter = new FuncSecurityDerivativeFilter<OptionUniverse>(universe =>\n            {\n                var optionUniverse = universe as OptionFilterUniverse;\n                var result = universeFunc(optionUniverse);\n                return result.ApplyTypesFilter();\n            });\n            ContractFilter.Asynchronous = false;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"ContractFilter\"/> to a new universe selection function\n        /// </summary>\n        /// <param name=\"universeFunc\">new universe selection function</param>\n        public void SetFilter(PyObject universeFunc)\n        {\n            ContractFilter = new FuncSecurityDerivativeFilter<OptionUniverse>(universe =>\n            {\n                var optionUniverse = universe as OptionFilterUniverse;\n                using (Py.GIL())\n                {\n                    PyObject result = (universeFunc as dynamic)(optionUniverse);\n\n                    //Try to convert it to the possible outcomes and process it\n                    //Must try filter first, if it is a filter and you try and convert it to\n                    //list, TryConvert() with catch an exception. Later Python algo will break on\n                    //this exception because we are using Py.GIL() and it will see the error set\n                    OptionFilterUniverse filter;\n                    List<Symbol> list;\n\n                    if ((result).TryConvert(out filter))\n                    {\n                        optionUniverse = filter;\n                    }\n                    else if ((result).TryConvert(out list))\n                    {\n                        optionUniverse = optionUniverse.WhereContains(list);\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"QCAlgorithm.SetFilter: result type {result.GetPythonType()} from \" +\n                            $\"filter function is not a valid argument, please return either a OptionFilterUniverse or a list of symbols\");\n                    }\n                }\n                return optionUniverse.ApplyTypesFilter();\n            });\n            ContractFilter.Asynchronous = false;\n        }\n\n        /// <summary>\n        /// Sets the data normalization mode to be used by this security\n        /// </summary>\n        public override void SetDataNormalizationMode(DataNormalizationMode mode)\n        {\n            if (mode != DataNormalizationMode.Raw)\n            {\n                throw new ArgumentException(\"DataNormalizationMode.Raw must be used with options\");\n            }\n\n            base.SetDataNormalizationMode(mode);\n        }\n\n        private void SetFilterImp(Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc)\n        {\n            ContractFilter = new FuncSecurityDerivativeFilter<OptionUniverse>(universe =>\n            {\n                var optionUniverse = universe as OptionFilterUniverse;\n                var result = universeFunc(optionUniverse);\n                return result.ApplyTypesFilter();\n            });\n        }\n\n        /// <summary>\n        /// Sets the option price model\n        /// </summary>\n        /// <param name=\"pyObject\">The option price model to use</param>\n        public void SetPriceModel(PyObject pyObject)\n        {\n            PriceModel = PythonUtil.CreateInstanceOrWrapper<IOptionPriceModel>(\n                pyObject,\n                py => new OptionPriceModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the option price model\n        /// </summary>\n        /// <param name=\"priceModel\">The option price model to use</param>\n        public void SetPriceModel(IOptionPriceModel priceModel)\n        {\n            PriceModel = priceModel;\n        }\n\n        /// <summary>\n        /// Updates the symbol properties of this security\n        /// </summary>\n        internal override void UpdateSymbolProperties(SymbolProperties symbolProperties)\n        {\n            if (symbolProperties != null)\n            {\n                SymbolProperties = new OptionSymbolProperties(symbolProperties);\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Option security) => security.Symbol;\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionAssignmentParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// The option assignment parameters data transfer class\n    /// </summary>\n    public class OptionAssignmentParameters\n    {\n        /// <summary>\n        /// The option to evaluate option assignments for\n        /// </summary>\n        public Option Option { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"option\">The target option</param>\n        public OptionAssignmentParameters(Option option)\n        {\n            Option = option;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionAssignmentResult.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Data transfer object class\n    /// </summary>\n    public class OptionAssignmentResult\n    {\n        /// <summary>\n        /// No option assignment should take place\n        /// </summary>\n        public static OptionAssignmentResult Null { get; } = new OptionAssignmentResult(decimal.Zero, string.Empty);\n\n        /// <summary>\n        /// The amount of option holdings to trigger the assignment for\n        /// </summary>\n        public decimal Quantity { get; set; }\n\n        /// <summary>\n        /// The tag that will be used in the order for the option assignment\n        /// </summary>\n        public string Tag { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"quantity\">The quantity to assign</param>\n        /// <param name=\"tag\">The order tag to use</param>\n        public OptionAssignmentResult(decimal quantity, string tag)\n        {\n            Quantity = quantity;\n            Tag = tag;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionCache.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option specific caching support\n    /// </summary>\n    /// <remarks>Class is virtually empty and scheduled to be made obsolete. Potentially could be used for user data storage.</remarks>\n    /// <seealso cref=\"SecurityCache\"/>\n    public class OptionCache : SecurityCache\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionDataFilter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option packet by packet data filtering mechanism for dynamically detecting bad ticks.\n    /// </summary>\n    /// <seealso cref=\"SecurityDataFilter\"/>\n    public class OptionDataFilter : SecurityDataFilter\n    {\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/OptionExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option exchange class - information and helper tools for option exchange properties\n    /// </summary>\n    /// <seealso cref=\"SecurityExchange\"/>\n    public class OptionExchange : SecurityExchange\n    {\n        /// <summary>\n        /// Number of trading days per year for this security, 252.\n        /// </summary>\n        /// <remarks>Used for performance statistics to calculate sharpe ratio accurately</remarks>\n        public override int TradingDaysPerYear\n        {\n            get { return 252; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public OptionExchange(SecurityExchangeHours exchangeHours)\n            : base(exchangeHours)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/OptionFilterUniverse.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities.FutureOption;\nusing QuantConnect.Securities.IndexOption;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents options symbols universe used in filtering.\n    /// </summary>\n    public class OptionFilterUniverse : ContractSecurityFilterUniverse<OptionFilterUniverse, OptionUniverse>\n    {\n        private Option.Option _option;\n\n        // Fields used in relative strikes filter\n        private List<decimal> _uniqueStrikes;\n        private bool _refreshUniqueStrikes;\n        private DateTime _lastExchangeDate;\n        private readonly decimal _underlyingScaleFactor = 1;\n\n        /// <summary>\n        /// The underlying price data\n        /// </summary>\n        protected BaseData UnderlyingInternal { get; set; }\n\n        /// <summary>\n        /// The underlying price data\n        /// </summary>\n        public BaseData Underlying\n        {\n            get\n            {\n                return UnderlyingInternal;\n            }\n        }\n\n        /// <summary>\n        /// Constructs OptionFilterUniverse\n        /// By default, the filter includes both standard and weekly contracts.\n        /// </summary>\n        /// <param name=\"option\">The canonical option chain security</param>\n        public OptionFilterUniverse(Option.Option option)\n        {\n            _option = option;\n            _underlyingScaleFactor = option.SymbolProperties.StrikeMultiplier;\n        }\n\n        /// <summary>\n        /// Constructs OptionFilterUniverse\n        /// </summary>\n        /// <remarks>Used for testing only</remarks>\n        public OptionFilterUniverse(Option.Option option, IEnumerable<OptionUniverse> allData, BaseData underlying, decimal underlyingScaleFactor = 1)\n            : base(allData, underlying.EndTime)\n        {\n            _option = option;\n            UnderlyingInternal = underlying;\n            _refreshUniqueStrikes = true;\n            _underlyingScaleFactor = underlyingScaleFactor;\n        }\n\n        /// <summary>\n        /// Refreshes this option filter universe and allows specifying if the exchange date changed from last call\n        /// </summary>\n        /// <param name=\"allContractsData\">All data for the option contracts</param>\n        /// <param name=\"underlying\">The current underlying last data point</param>\n        /// <param name=\"localTime\">The current local time</param>\n        public void Refresh(IEnumerable<OptionUniverse> allContractsData, BaseData underlying, DateTime localTime)\n        {\n            base.Refresh(allContractsData, localTime);\n\n            UnderlyingInternal = underlying;\n            _refreshUniqueStrikes = _lastExchangeDate != localTime.Date;\n            _lastExchangeDate = localTime.Date;\n        }\n\n        /// <summary>\n        /// Determine if the given Option contract symbol is standard\n        /// </summary>\n        /// <returns>True if standard</returns>\n        protected override bool IsStandard(Symbol symbol)\n        {\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.FutureOption:\n                    return FutureOptionSymbol.IsStandard(symbol);\n                case SecurityType.IndexOption:\n                    return IndexOptionSymbol.IsStandard(symbol);\n                default:\n                    return OptionSymbol.IsStandard(symbol);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the data type for the given symbol\n        /// </summary>\n        /// <returns>A data instance for the given symbol</returns>\n        protected override OptionUniverse CreateDataInstance(Symbol symbol)\n        {\n            return new OptionUniverse()\n            {\n                Symbol = symbol,\n                Time = LocalTime\n            };\n        }\n\n        /// <summary>\n        /// Adjusts the date to the next trading day if the current date is not a trading day, so that expiration filter is properly applied.\n        /// e.g. Selection for Mondays happen on Friday midnight (Saturday start), so if the minimum time to expiration is, say 0,\n        /// contracts expiring on Monday would be filtered out if the date is not properly adjusted to the next trading day (Monday).\n        /// </summary>\n        /// <param name=\"referenceDate\">The date to be adjusted</param>\n        /// <returns>The adjusted date</returns>\n        protected override DateTime AdjustExpirationReferenceDate(DateTime referenceDate)\n        {\n            // Check whether the reference time is a tradable date:\n            if (!_option.Exchange.Hours.IsDateOpen(referenceDate))\n            {\n                referenceDate = _option.Exchange.Hours.GetNextTradingDay(referenceDate);\n            }\n\n            return referenceDate;\n        }\n\n        /// <summary>\n        /// Applies filter selecting options contracts based on a range of strikes in relative terms\n        /// </summary>\n        /// <param name=\"minStrike\">The minimum strike relative to the underlying price, for example, -1 would filter out contracts further than 1 strike below market price</param>\n        /// <param name=\"maxStrike\">The maximum strike relative to the underlying price, for example, +1 would filter out contracts further than 1 strike above market price</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Strikes(int minStrike, int maxStrike)\n        {\n            if (UnderlyingInternal == null)\n            {\n                return this;\n            }\n\n            if (_refreshUniqueStrikes || _uniqueStrikes == null)\n            {\n                // Each day we need to recompute the unique strikes list.\n                _uniqueStrikes = AllSymbols.Select(x => x.ID.StrikePrice)\n                    .Distinct()\n                    .OrderBy(strikePrice => strikePrice)\n                    .ToList();\n                _refreshUniqueStrikes = false;\n            }\n\n            // find the current price in the list of strikes\n            // When computing the strike prices we need to take into account\n            // that some option's strike prices are based on a fraction of\n            // the underlying. Thus we need to scale the underlying internal\n            // price so that we can find it among the strike prices\n            // using BinarySearch() method(as it is used below)\n            var exactPriceFound = true;\n            var index = _uniqueStrikes.BinarySearch(UnderlyingInternal.Price / _underlyingScaleFactor);\n\n            // Return value of BinarySearch (from MSDN):\n            // The zero-based index of item in the sorted List<T>, if item is found;\n            // otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item\n            // or, if there is no larger element, the bitwise complement of Count.\n            if (index < 0)\n            {\n                // exact price not found\n                exactPriceFound = false;\n\n                if (index == ~_uniqueStrikes.Count)\n                {\n                    // there is no greater price, return empty\n                    return Empty();\n                }\n\n                index = ~index;\n            }\n\n            // compute the bounds, no need to worry about rounding and such\n            var indexMinPrice = index + minStrike;\n            var indexMaxPrice = index + maxStrike;\n            if (!exactPriceFound)\n            {\n                if (minStrike < 0 && maxStrike > 0)\n                {\n                    indexMaxPrice--;\n                }\n                else if (minStrike > 0)\n                {\n                    indexMinPrice--;\n                    indexMaxPrice--;\n                }\n            }\n\n            if (indexMinPrice < 0)\n            {\n                indexMinPrice = 0;\n            }\n            else if (indexMinPrice >= _uniqueStrikes.Count)\n            {\n                // price out of range: return empty\n                return Empty();\n            }\n\n            if (indexMaxPrice < 0)\n            {\n                // price out of range: return empty\n                return Empty();\n            }\n            if (indexMaxPrice >= _uniqueStrikes.Count)\n            {\n                indexMaxPrice = _uniqueStrikes.Count - 1;\n            }\n\n            var minPrice = _uniqueStrikes[indexMinPrice];\n            var maxPrice = _uniqueStrikes[indexMaxPrice];\n\n            Data = Data\n                .Where(data =>\n                    {\n                        var price = data.ID.StrikePrice;\n                        return price >= minPrice && price <= maxPrice;\n                    }\n                ).ToList();\n\n            return this;\n        }\n\n        /// <summary>\n        /// Sets universe of call options (if any) as a selection\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse CallsOnly()\n        {\n            return Contracts(contracts => contracts.Where(x => x.Symbol.ID.OptionRight == OptionRight.Call));\n        }\n\n        /// <summary>\n        /// Sets universe of put options (if any) as a selection\n        /// </summary>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse PutsOnly()\n        {\n            return Contracts(contracts => contracts.Where(x => x.Symbol.ID.OptionRight == OptionRight.Put));\n        }\n\n        /// <summary>\n        /// Sets universe of a single call contract with the closest match to criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <remarks>Applicable to Naked Call, Covered Call, and Protective Call Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse NakedCall(int minDaysTillExpiry = 30, decimal strikeFromAtm = 0)\n        {\n            return SingleContract(OptionRight.Call, minDaysTillExpiry, strikeFromAtm);\n        }\n\n        /// <summary>\n        /// Sets universe of a single put contract with the closest match to criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <remarks>Applicable to Naked Put, Covered Put, and Protective Put Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse NakedPut(int minDaysTillExpiry = 30, decimal strikeFromAtm = 0)\n        {\n            return SingleContract(OptionRight.Put, minDaysTillExpiry, strikeFromAtm);\n        }\n\n        private OptionFilterUniverse SingleContract(OptionRight right, int minDaysTillExpiry = 30, decimal strikeFromAtm = 0)\n        {\n            // Select the expiry as the nearest to set days later\n            var contractsForExpiry = GetContractsForExpiry(AllSymbols, minDaysTillExpiry);\n            var contracts = contractsForExpiry.Where(x => x.ID.OptionRight == right).ToList();\n            if (contracts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select strike price\n            var strike = GetStrike(contracts, strikeFromAtm);\n            var selected = contracts.Single(x => x.ID.StrikePrice == strike);\n\n            return SymbolList(new List<Symbol> { selected });\n        }\n\n        /// <summary>\n        /// Sets universe of 2 call contracts with the same expiry and different strike prices, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"higherStrikeFromAtm\">The desire strike price distance from the current underlying price of the higher strike price</param>\n        /// <param name=\"lowerStrikeFromAtm\">The desire strike price distance from the current underlying price of the lower strike price</param>\n        /// <remarks>Applicable to Bear Call Spread and Bull Call Spread Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse CallSpread(int minDaysTillExpiry = 30, decimal higherStrikeFromAtm = 5, decimal? lowerStrikeFromAtm = null)\n        {\n            return Spread(OptionRight.Call, minDaysTillExpiry, higherStrikeFromAtm, lowerStrikeFromAtm);\n        }\n\n        /// <summary>\n        /// Sets universe of 2 put contracts with the same expiry and different strike prices, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"higherStrikeFromAtm\">The desire strike price distance from the current underlying price of the higher strike price</param>\n        /// <param name=\"lowerStrikeFromAtm\">The desire strike price distance from the current underlying price of the lower strike price</param>\n        /// <remarks>Applicable to Bear Put Spread and Bull Put Spread Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse PutSpread(int minDaysTillExpiry = 30, decimal higherStrikeFromAtm = 5, decimal? lowerStrikeFromAtm = null)\n        {\n            return Spread(OptionRight.Put, minDaysTillExpiry, higherStrikeFromAtm, lowerStrikeFromAtm);\n        }\n\n        private OptionFilterUniverse Spread(OptionRight right, int minDaysTillExpiry, decimal higherStrikeFromAtm, decimal? lowerStrikeFromAtm = null)\n        {\n            if (!lowerStrikeFromAtm.HasValue)\n            {\n                lowerStrikeFromAtm = -higherStrikeFromAtm;\n            }\n\n            if (higherStrikeFromAtm <= lowerStrikeFromAtm)\n            {\n                throw new ArgumentException(\"Spread(): strike price arguments must be in descending order, \"\n                    + $\"{nameof(higherStrikeFromAtm)}, {nameof(lowerStrikeFromAtm)}\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contractsForExpiry = GetContractsForExpiry(AllSymbols, minDaysTillExpiry);\n            var contracts = contractsForExpiry.Where(x => x.ID.OptionRight == right).ToList();\n            if (contracts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var lowerStrike = GetStrike(contracts, (decimal)lowerStrikeFromAtm);\n            var lowerStrikeContract = contracts.Single(x => x.ID.StrikePrice == lowerStrike);\n            var higherStrikeContracts = contracts.Where(x => x.ID.StrikePrice > lowerStrike).ToList();\n            if (higherStrikeContracts.Count == 0)\n            {\n                return Empty();\n            }\n\n            var higherStrike = GetStrike(higherStrikeContracts, higherStrikeFromAtm);\n            var higherStrikeContract = higherStrikeContracts.Single(x => x.ID.StrikePrice == higherStrike);\n\n            return SymbolList(new List<Symbol> { lowerStrikeContract, higherStrikeContract });\n        }\n\n        /// <summary>\n        /// Sets universe of 2 call contracts with the same strike price and different expiration dates, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <param name=\"minNearDaysTillExpiry\">The mininum days till expiry of the closer contract from the current time, closest expiry will be selected</param>\n        /// <param name=\"minFarDaysTillExpiry\">The mininum days till expiry of the further conrtact from the current time, closest expiry will be selected</param>\n        /// <remarks>Applicable to Long and Short Call Calendar Spread Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse CallCalendarSpread(decimal strikeFromAtm = 0, int minNearDaysTillExpiry = 30, int minFarDaysTillExpiry = 60)\n        {\n            return CalendarSpread(OptionRight.Call, strikeFromAtm, minNearDaysTillExpiry, minFarDaysTillExpiry);\n        }\n\n        /// <summary>\n        /// Sets universe of 2 put contracts with the same strike price and different expiration dates, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <param name=\"minNearDaysTillExpiry\">The mininum days till expiry of the closer contract from the current time, closest expiry will be selected</param>\n        /// <param name=\"minFarDaysTillExpiry\">The mininum days till expiry of the further conrtact from the current time, closest expiry will be selected</param>\n        /// <remarks>Applicable to Long and Short Put Calendar Spread Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse PutCalendarSpread(decimal strikeFromAtm = 0, int minNearDaysTillExpiry = 30, int minFarDaysTillExpiry = 60)\n        {\n            return CalendarSpread(OptionRight.Put, strikeFromAtm, minNearDaysTillExpiry, minFarDaysTillExpiry);\n        }\n\n        private OptionFilterUniverse CalendarSpread(OptionRight right, decimal strikeFromAtm, int minNearDaysTillExpiry, int minFarDaysTillExpiry)\n        {\n            if (minFarDaysTillExpiry <= minNearDaysTillExpiry)\n            {\n                throw new ArgumentException(\"CalendarSpread(): expiry arguments must be in ascending order, \"\n                    + $\"{nameof(minNearDaysTillExpiry)}, {nameof(minFarDaysTillExpiry)}\");\n            }\n\n            if (minNearDaysTillExpiry < 0)\n            {\n                throw new ArgumentException(\"CalendarSpread(): near expiry argument must be positive.\");\n            }\n\n            // Select the set strike\n            var strike = GetStrike(AllSymbols, strikeFromAtm);\n            var contracts = AllSymbols.Where(x => x.ID.StrikePrice == strike && x.ID.OptionRight == right).ToList();\n\n            // Select the expiries\n            var nearExpiryContract = GetContractsForExpiry(contracts, minNearDaysTillExpiry).SingleOrDefault();\n            if (nearExpiryContract == null)\n            {\n                return Empty();\n            }\n\n            var furtherContracts = contracts.Where(x => x.ID.Date > nearExpiryContract.ID.Date).ToList();\n            var farExpiryContract = GetContractsForExpiry(furtherContracts, minFarDaysTillExpiry).SingleOrDefault();\n            if (farExpiryContract == null)\n            {\n                return Empty();\n            }\n\n            return SymbolList(new List<Symbol> { nearExpiryContract, farExpiryContract });\n        }\n\n        /// <summary>\n        /// Sets universe of an OTM call contract and an OTM put contract with the same expiry, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"callStrikeFromAtm\">The desire strike price distance from the current underlying price of the OTM call. It must be positive.</param>\n        /// <param name=\"putStrikeFromAtm\">The desire strike price distance from the current underlying price of the OTM put. It must be negative.</param>\n        /// <remarks>Applicable to Long and Short Strangle Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Strangle(int minDaysTillExpiry = 30, decimal callStrikeFromAtm = 5, decimal putStrikeFromAtm = -5)\n        {\n            if (callStrikeFromAtm <= 0)\n            {\n                throw new ArgumentException($\"Strangle(): {nameof(callStrikeFromAtm)} must be positive\");\n            }\n\n            if (putStrikeFromAtm >= 0)\n            {\n                throw new ArgumentException($\"Strangle(): {nameof(putStrikeFromAtm)} must be negative\");\n            }\n\n            return CallPutSpread(minDaysTillExpiry, callStrikeFromAtm, putStrikeFromAtm, true);\n        }\n\n        /// <summary>\n        /// Sets universe of an ATM call contract and an ATM put contract with the same expiry, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <remarks>Applicable to Long and Short Straddle Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Straddle(int minDaysTillExpiry = 30)\n        {\n            return CallPutSpread(minDaysTillExpiry, 0, 0);\n        }\n\n        /// <summary>\n        /// Sets universe of a call contract and a put contract with the same expiry but lower strike price, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"callStrikeFromAtm\">The desire strike price distance from the current underlying price of the call.</param>\n        /// <param name=\"putStrikeFromAtm\">The desire strike price distance from the current underlying price of the put.</param>\n        /// <remarks>Applicable to Protective Collar Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse ProtectiveCollar(int minDaysTillExpiry = 30, decimal callStrikeFromAtm = 5, decimal putStrikeFromAtm = -5)\n        {\n            if (callStrikeFromAtm <= putStrikeFromAtm)\n            {\n                throw new ArgumentException(\"ProtectiveCollar(): strike price arguments must be in descending order, \"\n                    + $\"{nameof(callStrikeFromAtm)}, {nameof(putStrikeFromAtm)}\");\n            }\n\n            var filtered = CallPutSpread(minDaysTillExpiry, callStrikeFromAtm, putStrikeFromAtm);\n\n            var callStrike = filtered.Single(x => x.ID.OptionRight == OptionRight.Call).ID.StrikePrice;\n            var putStrike = filtered.Single(x => x.ID.OptionRight == OptionRight.Put).ID.StrikePrice;\n            if (callStrike <= putStrike)\n            {\n                return Empty();\n            }\n\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of a call contract and a put contract with the same expiry and strike price, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <remarks>Applicable to Conversion and Reverse Conversion Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Conversion(int minDaysTillExpiry = 30, decimal strikeFromAtm = 5)\n        {\n            return CallPutSpread(minDaysTillExpiry, strikeFromAtm, strikeFromAtm);\n        }\n\n        private OptionFilterUniverse CallPutSpread(int minDaysTillExpiry, decimal callStrikeFromAtm, decimal putStrikeFromAtm, bool otm = false)\n        {\n            // Select the expiry as the nearest to set days later\n            var contracts = GetContractsForExpiry(AllSymbols, minDaysTillExpiry).ToList();\n\n            var calls = contracts.Where(x => x.ID.OptionRight == OptionRight.Call).ToList();\n            var puts = contracts.Where(x => x.ID.OptionRight == OptionRight.Put).ToList();\n\n            if (otm)\n            {\n                calls = calls.Where(x => x.ID.StrikePrice > Underlying.Price).ToList();\n                puts = puts.Where(x => x.ID.StrikePrice < Underlying.Price).ToList();\n            }\n\n            if (calls.Count == 0 || puts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var callStrike = GetStrike(calls, callStrikeFromAtm);\n            var call = calls.Single(x => x.ID.StrikePrice == callStrike);\n            var putStrike = GetStrike(puts, putStrikeFromAtm);\n            var put = puts.Single(x => x.ID.StrikePrice == putStrike);\n\n            // Select the contracts\n            return SymbolList(new List<Symbol> { call, put });\n        }\n\n        /// <summary>\n        /// Sets universe of an ITM call, an ATM call, and an OTM call with the same expiry and equal strike price distance, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeSpread\">The desire strike price distance of the ITM call and the OTM call from the current underlying price</param>\n        /// <remarks>Applicable to Long and Short Call Butterfly Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse CallButterfly(int minDaysTillExpiry = 30, decimal strikeSpread = 5)\n        {\n            return Butterfly(OptionRight.Call, minDaysTillExpiry, strikeSpread);\n        }\n\n        /// <summary>\n        /// Sets universe of an ITM put, an ATM put, and an OTM put with the same expiry and equal strike price distance, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeSpread\">The desire strike price distance of the ITM put and the OTM put from the current underlying price</param>\n        /// <remarks>Applicable to Long and Short Put Butterfly Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse PutButterfly(int minDaysTillExpiry = 30, decimal strikeSpread = 5)\n        {\n            return Butterfly(OptionRight.Put, minDaysTillExpiry, strikeSpread);\n        }\n\n        private OptionFilterUniverse Butterfly(OptionRight right, int minDaysTillExpiry, decimal strikeSpread)\n        {\n            if (strikeSpread <= 0)\n            {\n                throw new ArgumentException(\"ProtectiveCollar(): strikeSpread arguments must be positive\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contractsForExpiry = GetContractsForExpiry(AllSymbols, minDaysTillExpiry);\n            var contracts = contractsForExpiry.Where(x => x.ID.OptionRight == right).ToList();\n            if (contracts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var atmStrike = GetStrike(contracts, 0m);\n            var lowerStrike = GetStrike(contracts.Where(x => x.ID.StrikePrice < Underlying.Price && x.ID.StrikePrice < atmStrike), -strikeSpread);\n            var upperStrike = -1m;\n            if (lowerStrike != decimal.MaxValue)\n            {\n                upperStrike = atmStrike * 2 - lowerStrike;\n            }\n\n            // Select the contracts\n            var filtered = this.Where(x =>\n                x.ID.Date == contracts[0].ID.Date && x.ID.OptionRight == right &&\n                (x.ID.StrikePrice == atmStrike || x.ID.StrikePrice == lowerStrike || x.ID.StrikePrice == upperStrike));\n            if (filtered.Count() != 3)\n            {\n                return Empty();\n            }\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of an OTM call, an ATM call, an ATM put, and an OTM put with the same expiry and equal strike price distance, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeSpread\">The desire strike price distance of the OTM call and the OTM put from the current underlying price</param>\n        /// <remarks>Applicable to Long and Short Iron Butterfly Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse IronButterfly(int minDaysTillExpiry = 30, decimal strikeSpread = 5)\n        {\n            if (strikeSpread <= 0)\n            {\n                throw new ArgumentException(\"IronButterfly(): strikeSpread arguments must be positive\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contracts = GetContractsForExpiry(AllSymbols, minDaysTillExpiry).ToList();\n            var calls = contracts.Where(x => x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice > Underlying.Price).ToList();\n            var puts = contracts.Where(x => x.ID.OptionRight == OptionRight.Put && x.ID.StrikePrice < Underlying.Price).ToList();\n\n            if (calls.Count == 0 || puts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var atmStrike = GetStrike(contracts, 0);\n            var otmCallStrike = GetStrike(calls.Where(x => x.ID.StrikePrice > atmStrike), strikeSpread);\n            var otmPutStrike = -1m;\n            if (otmCallStrike != decimal.MaxValue)\n            {\n                otmPutStrike = atmStrike * 2 - otmCallStrike;\n            }\n\n            var filtered = this.Where(x =>\n                x.ID.Date == contracts[0].ID.Date && (\n                x.ID.StrikePrice == atmStrike ||\n                (x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice == otmCallStrike) ||\n                (x.ID.OptionRight == OptionRight.Put && x.ID.StrikePrice == otmPutStrike)\n            ));\n            if (filtered.Count() != 4)\n            {\n                return Empty();\n            }\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of a far-OTM call, a near-OTM call, a near-OTM put, and a far-OTM put with the same expiry\n        /// and equal strike price distance between both calls and both puts, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"nearStrikeSpread\">The desire strike price distance of the near-to-expiry call and the near-to-expiry put from the current underlying price</param>\n        /// <param name=\"farStrikeSpread\">The desire strike price distance of the further-to-expiry call and the further-to-expiry put from the current underlying price</param>\n        /// <remarks>Applicable to Long and Short Iron Condor Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse IronCondor(int minDaysTillExpiry = 30, decimal nearStrikeSpread = 5, decimal farStrikeSpread = 10)\n        {\n            if (nearStrikeSpread <= 0 || farStrikeSpread <= 0)\n            {\n                throw new ArgumentException(\"IronCondor(): strike arguments must be positive, \"\n                    + $\"{nameof(nearStrikeSpread)}, {nameof(farStrikeSpread)}\");\n            }\n\n            if (nearStrikeSpread >= farStrikeSpread)\n            {\n                throw new ArgumentException(\"IronCondor(): strike arguments must be in ascending orders, \"\n                    + $\"{nameof(nearStrikeSpread)}, {nameof(farStrikeSpread)}\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contracts = GetContractsForExpiry(AllSymbols, minDaysTillExpiry).ToList();\n            var calls = contracts.Where(x => x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice > Underlying.Price).ToList();\n            var puts = contracts.Where(x => x.ID.OptionRight == OptionRight.Put && x.ID.StrikePrice < Underlying.Price).ToList();\n\n            if (calls.Count == 0 || puts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var nearCallStrike = GetStrike(calls, nearStrikeSpread);\n            var nearPutStrike = GetStrike(puts, -nearStrikeSpread);\n            var farCallStrike = GetStrike(calls.Where(x => x.ID.StrikePrice > nearCallStrike), farStrikeSpread);\n            var farPutStrike = -1m;\n            if (farCallStrike != decimal.MaxValue)\n            {\n                farPutStrike = nearPutStrike - farCallStrike + nearCallStrike;\n            }\n\n            // Select the contracts\n            var filtered = this.Where(x =>\n                x.ID.Date == contracts[0].ID.Date && (\n                (x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice == nearCallStrike) ||\n                (x.ID.OptionRight == OptionRight.Put && x.ID.StrikePrice == nearPutStrike) ||\n                (x.ID.OptionRight == OptionRight.Call && x.ID.StrikePrice == farCallStrike) ||\n                (x.ID.OptionRight == OptionRight.Put && x.ID.StrikePrice == farPutStrike)\n            ));\n            if (filtered.Count() != 4)\n            {\n                return Empty();\n            }\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of an OTM call, an ITM call, an OTM put, and an ITM put with the same expiry with closest match to the criteria given.\n        /// The OTM call has the same strike as the ITM put, while the same holds for the ITM call and the OTM put\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"strikeSpread\">The desire strike price distance of the OTM call and the OTM put from the current underlying price</param>\n        /// <remarks>Applicable to Long and Short Box Spread Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse BoxSpread(int minDaysTillExpiry = 30, decimal strikeSpread = 5)\n        {\n            if (strikeSpread <= 0)\n            {\n                throw new ArgumentException($\"BoxSpread(): strike arguments must be positive, {nameof(strikeSpread)}\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contracts = GetContractsForExpiry(AllSymbols, minDaysTillExpiry).ToList();\n            if (contracts.Count == 0)\n            {\n                return Empty();\n            }\n\n            // Select the strike prices with the set spread range\n            var higherStrike = GetStrike(contracts.Where(x => x.ID.StrikePrice > Underlying.Price), strikeSpread);\n            var lowerStrike = GetStrike(contracts.Where(x => x.ID.StrikePrice < higherStrike && x.ID.StrikePrice < Underlying.Price), -strikeSpread);\n\n            // Select the contracts\n            var filtered = this.Where(x =>\n                (x.ID.StrikePrice == higherStrike || x.ID.StrikePrice == lowerStrike) &&\n                x.ID.Date == contracts[0].ID.Date);\n            if (filtered.Count() != 4)\n            {\n                return Empty();\n            }\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of 2 call and 2 put contracts with the same strike price and 2 expiration dates, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"strikeFromAtm\">The desire strike price distance from the current underlying price</param>\n        /// <param name=\"minNearDaysTillExpiry\">The mininum days till expiry of the closer contract from the current time, closest expiry will be selected</param>\n        /// <param name=\"minFarDaysTillExpiry\">The mininum days till expiry of the further conrtact from the current time, closest expiry will be selected</param>\n        /// <remarks>Applicable to Long and Short Jelly Roll Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse JellyRoll(decimal strikeFromAtm = 0, int minNearDaysTillExpiry = 30, int minFarDaysTillExpiry = 60)\n        {\n            if (minFarDaysTillExpiry <= minNearDaysTillExpiry)\n            {\n                throw new ArgumentException(\"JellyRoll(): expiry arguments must be in ascending order, \"\n                    + $\"{nameof(minNearDaysTillExpiry)}, {nameof(minFarDaysTillExpiry)}\");\n            }\n\n            if (minNearDaysTillExpiry < 0)\n            {\n                throw new ArgumentException(\"JellyRoll(): near expiry argument must be positive.\");\n            }\n\n            // Select the set strike\n            var strike = AllSymbols.OrderBy(x => Math.Abs(Underlying.Price - x.ID.StrikePrice + strikeFromAtm))\n                .First().ID.StrikePrice;\n            var contracts = AllSymbols.Where(x => x.ID.StrikePrice == strike && x.ID.OptionRight == OptionRight.Call).ToList();\n\n            // Select the expiries\n            var nearExpiryContract = GetContractsForExpiry(contracts, minNearDaysTillExpiry).SingleOrDefault();\n            if (nearExpiryContract == null)\n            {\n                return Empty();\n            }\n            var nearExpiry = nearExpiryContract.ID.Date;\n\n            var furtherContracts = contracts.Where(x => x.ID.Date > nearExpiryContract.ID.Date).ToList();\n            var farExpiryContract = GetContractsForExpiry(furtherContracts, minFarDaysTillExpiry).SingleOrDefault();\n            if (farExpiryContract == null)\n            {\n                return Empty();\n            }\n            var farExpiry = farExpiryContract.ID.Date;\n\n            var filtered = this.Where(x => x.ID.StrikePrice == strike && (x.ID.Date == nearExpiry || x.ID.Date == farExpiry));\n            if (filtered.Count() != 4)\n            {\n                return Empty();\n            }\n            return filtered;\n        }\n\n        /// <summary>\n        /// Sets universe of 3 call contracts with the same expiry and different strike prices, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"higherStrikeFromAtm\">The desire strike price distance from the current underlying price of the higher strike price</param>\n        /// <param name=\"middleStrikeFromAtm\">The desire strike price distance from the current underlying price of the middle strike price</param>\n        /// <param name=\"lowerStrikeFromAtm\">The desire strike price distance from the current underlying price of the lower strike price</param>\n        /// <remarks>Applicable to Bear Call Ladder and Bull Call Ladder Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse CallLadder(int minDaysTillExpiry, decimal higherStrikeFromAtm, decimal middleStrikeFromAtm, decimal lowerStrikeFromAtm)\n        {\n            return Ladder(OptionRight.Call, minDaysTillExpiry, higherStrikeFromAtm, middleStrikeFromAtm, lowerStrikeFromAtm);\n        }\n\n        /// <summary>\n        /// Sets universe of 3 put contracts with the same expiry and different strike prices, with closest match to the criteria given\n        /// </summary>\n        /// <param name=\"minDaysTillExpiry\">The minimum days till expiry from the current time, closest expiry will be selected</param>\n        /// <param name=\"higherStrikeFromAtm\">The desire strike price distance from the current underlying price of the higher strike price</param>\n        /// <param name=\"middleStrikeFromAtm\">The desire strike price distance from the current underlying price of the middle strike price</param>\n        /// <param name=\"lowerStrikeFromAtm\">The desire strike price distance from the current underlying price of the lower strike price</param>\n        /// <remarks>Applicable to Bear Put Ladder and Bull Put Ladder Option Strategy</remarks>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse PutLadder(int minDaysTillExpiry, decimal higherStrikeFromAtm, decimal middleStrikeFromAtm, decimal lowerStrikeFromAtm)\n        {\n            return Ladder(OptionRight.Put, minDaysTillExpiry, higherStrikeFromAtm, middleStrikeFromAtm, lowerStrikeFromAtm);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Delta between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum Delta value</param>\n        /// <param name=\"max\">The maximum Delta value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Delta(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(Delta));\n            return this.Where(contractData => contractData.Greeks.Delta >= min && contractData.Greeks.Delta <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Delta between the given range.\n        /// Alias for <see cref=\"Delta(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum Delta value</param>\n        /// <param name=\"max\">The maximum Delta value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse D(decimal min, decimal max)\n        {\n            return Delta(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Gamma between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum Gamma value</param>\n        /// <param name=\"max\">The maximum Gamma value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Gamma(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(Gamma));\n            return this.Where(contractData => contractData.Greeks.Gamma >= min && contractData.Greeks.Gamma <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Gamma between the given range.\n        /// Alias for <see cref=\"Gamma(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum Gamma value</param>\n        /// <param name=\"max\">The maximum Gamma value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse G(decimal min, decimal max)\n        {\n            return Gamma(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Theta between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum Theta value</param>\n        /// <param name=\"max\">The maximum Theta value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Theta(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(Theta));\n            return this.Where(contractData => contractData.Greeks.Theta >= min && contractData.Greeks.Theta <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Theta between the given range.\n        /// Alias for <see cref=\"Theta(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum Theta value</param>\n        /// <param name=\"max\">The maximum Theta value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse T(decimal min, decimal max)\n        {\n            return Theta(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Vega between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum Vega value</param>\n        /// <param name=\"max\">The maximum Vega value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Vega(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(Vega));\n            return this.Where(contractData => contractData.Greeks.Vega >= min && contractData.Greeks.Vega <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Vega between the given range.\n        /// Alias for <see cref=\"Vega(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum Vega value</param>\n        /// <param name=\"max\">The maximum Vega value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse V(decimal min, decimal max)\n        {\n            return Vega(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Rho between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum Rho value</param>\n        /// <param name=\"max\">The maximum Rho value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse Rho(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(Rho));\n            return this.Where(contractData => contractData.Greeks.Rho >= min && contractData.Greeks.Rho <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with Rho between the given range.\n        /// Alias for <see cref=\"Rho(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum Rho value</param>\n        /// <param name=\"max\">The maximum Rho value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse R(decimal min, decimal max)\n        {\n            return Rho(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with implied volatility between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum implied volatility value</param>\n        /// <param name=\"max\">The maximum implied volatility value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse ImpliedVolatility(decimal min, decimal max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(ImpliedVolatility));\n            return this.Where(contractData => contractData.ImpliedVolatility >= min && contractData.ImpliedVolatility <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with implied volatility between the given range.\n        /// Alias for <see cref=\"ImpliedVolatility(decimal, decimal)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum implied volatility value</param>\n        /// <param name=\"max\">The maximum implied volatility value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse IV(decimal min, decimal max)\n        {\n            return ImpliedVolatility(min, max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with open interest between the given range\n        /// </summary>\n        /// <param name=\"min\">The minimum open interest value</param>\n        /// <param name=\"max\">The maximum open interest value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse OpenInterest(long min, long max)\n        {\n            ValidateSecurityTypeForSupportedFilters(nameof(OpenInterest));\n            return this.Where(contractData => contractData.OpenInterest >= min && contractData.OpenInterest <= max);\n        }\n\n        /// <summary>\n        /// Applies the filter to the universe selecting the contracts with open interest between the given range.\n        /// Alias for <see cref=\"OpenInterest(long, long)\"/>\n        /// </summary>\n        /// <param name=\"min\">The minimum open interest value</param>\n        /// <param name=\"max\">The maximum open interest value</param>\n        /// <returns>Universe with filter applied</returns>\n        public OptionFilterUniverse OI(long min, long max)\n        {\n            return OpenInterest(min, max);\n        }\n\n        /// <summary>\n        /// Implicitly convert the universe to a list of symbols\n        /// </summary>\n        /// <param name=\"universe\"></param>\n#pragma warning disable CA1002 // Do not expose generic lists\n#pragma warning disable CA2225 // Operator overloads have named alternates\n        public static implicit operator List<Symbol>(OptionFilterUniverse universe)\n        {\n            return universe.AllSymbols.ToList();\n        }\n#pragma warning restore CA2225 // Operator overloads have named alternates\n#pragma warning restore CA1002 // Do not expose generic lists\n\n        private OptionFilterUniverse Ladder(OptionRight right, int minDaysTillExpiry, decimal higherStrikeFromAtm, decimal middleStrikeFromAtm, decimal lowerStrikeFromAtm)\n        {\n            if (higherStrikeFromAtm <= lowerStrikeFromAtm || higherStrikeFromAtm <= middleStrikeFromAtm || middleStrikeFromAtm <= lowerStrikeFromAtm)\n            {\n                throw new ArgumentException(\"Ladder(): strike price arguments must be in descending order, \"\n                    + $\"{nameof(higherStrikeFromAtm)}, {nameof(middleStrikeFromAtm)}, {nameof(lowerStrikeFromAtm)}\");\n            }\n\n            // Select the expiry as the nearest to set days later\n            var contracts = GetContractsForExpiry(AllSymbols.Where(x => x.ID.OptionRight == right).ToList(), minDaysTillExpiry);\n\n            // Select the strike prices with the set ladder range\n            var lowerStrikeContract = contracts.OrderBy(x => Math.Abs(Underlying.Price - x.ID.StrikePrice + lowerStrikeFromAtm)).First();\n            var middleStrikeContract = contracts.Where(x => x.ID.StrikePrice > lowerStrikeContract.ID.StrikePrice)\n                .OrderBy(x => Math.Abs(Underlying.Price - x.ID.StrikePrice + middleStrikeFromAtm)).FirstOrDefault();\n            if (middleStrikeContract == default)\n            {\n                return Empty();\n            }\n            var higherStrikeContract = contracts.Where(x => x.ID.StrikePrice > middleStrikeContract.ID.StrikePrice)\n                .OrderBy(x => Math.Abs(Underlying.Price - x.ID.StrikePrice + higherStrikeFromAtm)).FirstOrDefault();\n            if (higherStrikeContract == default)\n            {\n                return Empty();\n            }\n\n            return this.WhereContains(new List<Symbol> { lowerStrikeContract, middleStrikeContract, higherStrikeContract });\n        }\n\n        /// <summary>\n        /// Will provide all contracts that respect a specific expiration filter\n        /// </summary>\n        /// <param name=\"symbols\">Symbols source to use</param>\n        /// <param name=\"minDaysTillExpiry\">The desired minimum days till expiry</param>\n        /// <returns>All symbols that respect a single expiration date</returns>\n        private IEnumerable<Symbol> GetContractsForExpiry(IEnumerable<Symbol> symbols, int minDaysTillExpiry)\n        {\n            var leastExpiryAccepted = _lastExchangeDate.AddDays(minDaysTillExpiry);\n            return symbols.Where(x => x.ID.Date >= leastExpiryAccepted)\n                .GroupBy(x => x.ID.Date)\n                .OrderBy(x => x.Key)\n                .FirstOrDefault()\n                // let's order the symbols too, to guarantee determinism\n                ?.OrderBy(x => x.ID) ?? Enumerable.Empty<Symbol>();\n        }\n\n        /// <summary>\n        /// Helper method that will select no contract\n        /// </summary>\n        private OptionFilterUniverse Empty()\n        {\n            Data = Enumerable.Empty<OptionUniverse>();\n            return this;\n        }\n\n        /// <summary>\n        /// Helper method that will select the given contract list\n        /// </summary>\n        private OptionFilterUniverse SymbolList(List<Symbol> contracts)\n        {\n            AllSymbols = contracts;\n            return this;\n        }\n\n        private decimal GetStrike(IEnumerable<Symbol> symbols, decimal strikeFromAtm)\n        {\n            return symbols.OrderBy(x => Math.Abs(Underlying.Price + strikeFromAtm - x.ID.StrikePrice))\n                .Select(x => x.ID.StrikePrice)\n                .DefaultIfEmpty(decimal.MaxValue)\n                .First();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void ValidateSecurityTypeForSupportedFilters(string filterName)\n        {\n            if (_option.Symbol.SecurityType == SecurityType.FutureOption)\n            {\n                throw new InvalidOperationException($\"{filterName} filter is not supported for future options.\");\n            }\n        }\n    }\n\n    /// <summary>\n    /// Extensions for Linq support\n    /// </summary>\n    public static class OptionFilterUniverseEx\n    {\n        /// <summary>\n        /// Filters universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"predicate\">Bool function to determine which Symbol are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse Where(this OptionFilterUniverse universe, Func<OptionUniverse, bool> predicate)\n        {\n            universe.Data = universe.Data.Where(predicate).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Filters universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"predicate\">Bool function to determine which Symbol are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse Where(this OptionFilterUniverse universe, PyObject predicate)\n        {\n            universe.Data = universe.Data.Where(predicate.SafeAs<Func<OptionUniverse, bool>>()).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Maps universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbol function to determine which Symbols are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse Select(this OptionFilterUniverse universe, Func<OptionUniverse, Symbol> mapFunc)\n        {\n            universe.AllSymbols = universe.Data.Select(mapFunc).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Maps universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbol function to determine which Symbols are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse Select(this OptionFilterUniverse universe, PyObject mapFunc)\n        {\n            return universe.Select(mapFunc.SafeAs<Func<OptionUniverse, Symbol>>());\n        }\n\n        /// <summary>\n        /// Binds universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbol function to determine which Symbols are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse SelectMany(this OptionFilterUniverse universe, Func<OptionUniverse, IEnumerable<Symbol>> mapFunc)\n        {\n            universe.AllSymbols = universe.Data.SelectMany(mapFunc).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Binds universe\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"mapFunc\">Symbol function to determine which Symbols are filtered</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse SelectMany(this OptionFilterUniverse universe, PyObject mapFunc)\n        {\n            return universe.SelectMany(mapFunc.SafeAs<Func<OptionUniverse, IEnumerable<Symbol>>>());\n        }\n\n        /// <summary>\n        /// Updates universe to only contain the symbols in the list\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"filterList\">List of Symbols to keep in the Universe</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse WhereContains(this OptionFilterUniverse universe, List<Symbol> filterList)\n        {\n            universe.Data = universe.Data.Where(x => filterList.Contains(x)).ToList();\n            return universe;\n        }\n\n        /// <summary>\n        /// Updates universe to only contain the symbols in the list\n        /// </summary>\n        /// <param name=\"universe\">Universe to apply the filter too</param>\n        /// <param name=\"filterList\">List of Symbols to keep in the Universe</param>\n        /// <returns>Universe with filter applied</returns>\n        public static OptionFilterUniverse WhereContains(this OptionFilterUniverse universe, PyObject filterList)\n        {\n            return universe.WhereContains(filterList.ConvertToSymbolEnumerable().ToList());\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionHolding.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option holdings implementation of the base securities class\n    /// </summary>\n    /// <seealso cref=\"SecurityHolding\"/>\n    public class OptionHolding : SecurityHolding\n    {\n        /// <summary>\n        /// Option Holding Class constructor\n        /// </summary>\n        /// <param name=\"security\">The option security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public OptionHolding(Option security, ICurrencyConverter currencyConverter)\n            : base(security, currencyConverter)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/OptionMarginModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Represents a simple option margin model.\n    /// </summary>\n    /// <remarks>\n    /// Options are not traded on margin. Margin requirements exist though for those portfolios with short positions.\n    /// Current implementation covers only single long/naked short option positions.\n    /// </remarks>\n    public class OptionMarginModel : SecurityMarginModel\n    {\n        // initial margin\n        private const decimal OptionMarginRequirement = 1;\n        private const decimal NakedPositionMarginRequirement = 0.1m;\n        private const decimal EquityOptionNakedPositionMarginRequirementOtm = 0.2m;\n        private const decimal IndexOptionNakedPositionMarginRequirementOtm = 0.15m;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionMarginModel\"/>\n        /// </summary>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required unused buying power for the account.</param>\n        public OptionMarginModel(decimal requiredFreeBuyingPowerPercent = 0)\n        {\n            RequiredFreeBuyingPowerPercent = requiredFreeBuyingPowerPercent;\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            // Options are not traded on margin\n            return 1;\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, options.\n        /// </summary>\n        /// <param name=\"security\"></param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public override void SetLeverage(Security security, decimal leverage)\n        {\n            // Options are leveraged products and different leverage cannot be set by user.\n            throw new InvalidOperationException(\"Options are leveraged products and different leverage cannot be set by user\");\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public override InitialMargin GetInitialMarginRequiredForOrder(\n            InitialMarginRequiredForOrderParameters parameters\n            )\n        {\n            //Get the order value from the non-abstract order classes (MarketOrder, LimitOrder, StopMarketOrder)\n            //Market order is approximated from the current security price and set in the MarketOrder Method in QCAlgorithm.\n\n            var fees = parameters.Security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(parameters.Security, parameters.Order)\n            );\n\n            var feesInAccountCurrency = parameters.CurrencyConverter.ConvertToAccountCurrency(fees.Value);\n\n            var value = parameters.Order.GetValue(parameters.Security);\n            var orderMargin = value * GetMarginRequirement(parameters.Security, parameters.Order.Quantity, value);\n\n            return orderMargin + Math.Sign(orderMargin) * feesInAccountCurrency.Amount;\n        }\n\n        /// <summary>\n        /// Gets the margin currently alloted to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the provided holdings quantity/cost/value</returns>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            // Long options have zero maintenance margin requirement\n            return parameters.Quantity >= 0 ? 0 : parameters.AbsoluteHoldingsCost * GetMaintenanceMarginRequirement(parameters);\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <returns>The initial margin required for the provided security and quantity</returns>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            var security = parameters.Security;\n            var quantity = parameters.Quantity;\n            var value = security.QuoteCurrency.ConversionRate\n                        * security.SymbolProperties.ContractMultiplier\n                        * security.Price\n                        * quantity;\n\n            // Initial margin requirement for long options is only the premium that is paid upfront\n            return new OptionInitialMargin(parameters.Quantity >= 0 ? 0 : value * GetMarginRequirement(security, quantity, value), value);\n        }\n\n        /// <summary>\n        /// The percentage of the holding's absolute cost that must be held in free cash in order to avoid a margin call\n        /// </summary>\n        private decimal GetMaintenanceMarginRequirement(MaintenanceMarginParameters parameters)\n        {\n            return GetMarginRequirement(parameters.Security, parameters.Quantity, parameters.HoldingsCost);\n        }\n\n        /// <summary>\n        /// Private method takes option security and its holding and returns required margin. Method considers all short positions naked.\n        /// </summary>\n        /// <param name=\"security\">Option security</param>\n        /// <param name=\"quantity\">Holding quantity</param>\n        /// <param name=\"value\">Holding value</param>\n        /// <returns></returns>\n        private decimal GetMarginRequirement(Security security, decimal quantity, decimal value)\n        {\n            var option = (Option)security;\n\n            if (value == 0m ||\n                option.Close == 0m ||\n                option.StrikePrice == 0m ||\n                option.Underlying == null ||\n                option.Underlying.Close == 0m)\n            {\n                return 0m;\n            }\n\n            if (value > 0m)\n            {\n                return OptionMarginRequirement;\n            }\n\n            var absValue = -value;\n            var optionProperties = (OptionSymbolProperties)option.SymbolProperties;\n            var underlying = option.Underlying;\n\n            // inferring ratios of the option and its underlying to get underlying security value\n            var multiplierRatio = underlying.SymbolProperties.ContractMultiplier / optionProperties.ContractMultiplier;\n            var quantityRatio = optionProperties.ContractUnitOfTrade;\n\n            // Some options are based on a fraction of their underlying security value, such as NQX for example. Thus,\n            // for them we need to scale the underlying value so that the later comparisons made with the option's strike\n            // value are correct\n            var priceRatio = (underlying.Close / option.SymbolProperties.StrikeMultiplier) / (absValue / quantityRatio);\n            var underlyingValueRatio = multiplierRatio * quantityRatio * priceRatio;\n\n            // calculating underlying security value less out-of-the-money amount\n            var amountOTM = option.OutOfTheMoneyAmount(underlying.Close);\n            var priceRatioOTM = amountOTM / (absValue / quantityRatio);\n            var underlyingValueRatioOTM = multiplierRatio * quantityRatio * priceRatioOTM;\n\n            var strikePriceRatio = option.StrikePrice / (absValue / quantityRatio);\n            strikePriceRatio = multiplierRatio * quantityRatio * strikePriceRatio;\n\n            var nakedMarginRequirement = option.Right == OptionRight.Call\n                ? NakedPositionMarginRequirement * underlyingValueRatio\n                : NakedPositionMarginRequirement * strikePriceRatio;\n            var nakedMarginRequirementOtm = security.Type == SecurityType.Option\n                ? EquityOptionNakedPositionMarginRequirementOtm\n                : IndexOptionNakedPositionMarginRequirementOtm;\n\n            return OptionMarginRequirement +\n                   Math.Abs(quantity) * Math.Max(nakedMarginRequirement,\n                       nakedMarginRequirementOtm * underlyingValueRatio - underlyingValueRatioOTM);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionPortfolioModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISecurityPortfolioModel\"/> for options that supports\n    /// default fills as well as option exercising.\n    /// </summary>\n    public class OptionPortfolioModel : SecurityPortfolioModel\n    {\n        /// <summary>\n        /// Performs application of an OrderEvent to the portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">Option security</param>\n        /// <param name=\"fill\">The order event fill object to be applied</param>\n        public override void ProcessFill(SecurityPortfolioManager portfolio, Security security, OrderEvent fill)\n        {\n            if (fill.Ticket.OrderType == OrderType.OptionExercise)\n            {\n                base.ProcessFill(portfolio, portfolio.Securities[fill.Symbol], fill);\n                // Update the order event message with the P&L\n                UpdateExerciseOrderEventMessage(security, fill);\n            }\n            else\n            {\n                // we delegate the call to the base class (default behavior)\n                base.ProcessFill(portfolio, security, fill);\n            }\n        }\n\n        private static void UpdateExerciseOrderEventMessage(Security security, OrderEvent fill)\n        {\n            var lastTradeProfit = security.Holdings.LastTradeProfit;\n            var message = \"\";\n            if (lastTradeProfit >= 0)\n            {\n                message += $\". Profit: +{lastTradeProfit.ToStringInvariant()}\";\n            }\n            else\n            {\n                message += $\". Loss: {lastTradeProfit.ToStringInvariant()}\";\n            }\n            fill.Message = fill.Message + message;\n        }\n\n        /// <summary>\n        /// Helper method to determine the close trade profit\n        /// </summary>\n        /// <remarks>For SettlementType.Cash we apply funds and add in the result to the profit</remarks>\n        protected override ConvertibleCashAmount ProcessCloseTradeProfit(SecurityPortfolioManager portfolio, Security security, OrderEvent fill)\n        {\n            var baseResult = base.ProcessCloseTradeProfit(portfolio, security, fill);\n\n            var ticket = fill.Ticket;\n            if (ticket.OrderType == OrderType.OptionExercise && security.Symbol.SecurityType.IsOption())\n            {\n                var option = (Option)security;\n                if (option.ExerciseSettlement == SettlementType.Cash)\n                {\n                    var underlying = option.Underlying;\n                    var optionQuantity = fill.Ticket.Quantity;\n                    var cashQuantity = -option.GetIntrinsicValue(underlying.Close) * option.ContractUnitOfTrade * optionQuantity;\n                    if (cashQuantity != decimal.Zero)\n                    {\n                        security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, fill.UtcTime, new CashAmount(cashQuantity, option.QuoteCurrency.Symbol), fill));\n                        return new ConvertibleCashAmount(cashQuantity + baseResult.Amount, option.QuoteCurrency);\n                    }\n                }\n            }\n            return baseResult;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionPriceModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Base class for option price models, computing theoretical price, IV, and Greeks.\n    /// </summary>\n    public abstract class OptionPriceModel : IOptionPriceModel\n    {\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OptionPriceModelParameters\"/> object\n        /// containing the security, slice and contract</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public abstract OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters);\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        [Obsolete(\"This method is deprecated. Use Evaluate(OptionPriceModelParameters parameters) instead.\")]\n        public virtual OptionPriceModelResult Evaluate(Security security, Slice slice, OptionContract contract)\n        {\n            return Evaluate(new OptionPriceModelParameters(security, slice, contract));\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/OptionPriceModelParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IOptionPriceModel.Evaluate\"/>\n    /// </summary>\n    public class OptionPriceModelParameters\n    {\n        /// <summary>\n        /// Gets the option security object\n        /// </summary>\n        public Security Security { get; set; }\n\n        /// <summary>\n        /// Gets the current data slice\n        /// </summary>\n        public Slice Slice { get; set; }\n\n        /// <summary>\n        /// Gets the option contract to evaluate\n        /// </summary>\n        public OptionContract Contract { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        public OptionPriceModelParameters(Security security = null, Slice slice = null, OptionContract contract = null)\n        {\n            Security = security;\n            Slice = slice;\n            Contract = contract;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/OptionPriceModelResult.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Result type for <see cref=\"IOptionPriceModel.Evaluate\"/>\n    /// </summary>\n    public class OptionPriceModelResult\n    {\n        /// <summary>\n        /// Represents the zero option price and greeks.\n        /// </summary>\n        public static OptionPriceModelResult None { get; } = new(0, NullGreeks.Instance);\n\n        private Lazy<decimal> _theoreticalPrice;\n        private Lazy<Greeks> _greeks;\n        private Lazy<decimal> _impliedVolatility;\n\n        /// <summary>\n        /// Gets the theoretical price as computed by the <see cref=\"IOptionPriceModel\"/>\n        /// </summary>\n        public decimal TheoreticalPrice\n        {\n            get\n            {\n                return _theoreticalPrice.Value;\n            }\n            set\n            {\n                _theoreticalPrice = new Lazy<decimal>(() => value, isThreadSafe: false);\n            }\n        }\n\n        /// <summary>\n        /// Gets the implied volatility of the option contract\n        /// </summary>\n        public decimal ImpliedVolatility\n        {\n            get\n            {\n                return _impliedVolatility.Value;\n            }\n            set\n            {\n                _impliedVolatility = new Lazy<decimal>(() => value, isThreadSafe: false);\n            }\n        }\n\n        /// <summary>\n        /// Gets the various sensitivities as computed by the <see cref=\"IOptionPriceModel\"/>\n        /// </summary>\n        public Greeks Greeks\n        {\n            get\n            {\n                return _greeks.Value;\n            }\n            set\n            {\n                _greeks = new Lazy<Greeks>(() => value, isThreadSafe: false);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class\n        /// </summary>\n        public OptionPriceModelResult()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class\n        /// </summary>\n        /// <param name=\"theoreticalPrice\">The theoretical price computed by the price model</param>\n        /// <param name=\"greeks\">The sensitivities (greeks) computed by the price model</param>\n        public OptionPriceModelResult(decimal theoreticalPrice, Greeks greeks)\n             : this(() => theoreticalPrice, () => decimal.Zero, () => greeks)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class\n        /// </summary>\n        /// <param name=\"theoreticalPrice\">The theoretical price computed by the price model</param>\n        /// <param name=\"impliedVolatility\">The calculated implied volatility</param>\n        /// <param name=\"greeks\">The sensitivities (greeks) computed by the price model</param>\n        public OptionPriceModelResult(decimal theoreticalPrice, decimal impliedVolatility, Greeks greeks)\n            : this(theoreticalPrice, () => impliedVolatility, () => greeks)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class with lazy calculations of implied volatility and greeks\n        /// </summary>\n        /// <param name=\"theoreticalPrice\">The theoretical price computed by the price model</param>\n        /// <param name=\"impliedVolatility\">The calculated implied volatility</param>\n        /// <param name=\"greeks\">The sensitivities (greeks) computed by the price model</param>\n        public OptionPriceModelResult(decimal theoreticalPrice, Func<decimal> impliedVolatility, Func<Greeks> greeks)\n            : this(() => theoreticalPrice, impliedVolatility, greeks)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class with lazy calculations of implied volatility and greeks\n        /// </summary>\n        /// <param name=\"theoreticalPrice\">The theoretical price computed by the price model</param>\n        /// <param name=\"impliedVolatility\">The calculated implied volatility</param>\n        /// <param name=\"greeks\">The sensitivities (greeks) computed by the price model</param>\n        public OptionPriceModelResult(Func<decimal> theoreticalPrice, Func<decimal> impliedVolatility, Func<Greeks> greeks)\n        {\n            _theoreticalPrice = new Lazy<decimal>(theoreticalPrice, isThreadSafe: false);\n            _impliedVolatility = new Lazy<decimal>(impliedVolatility, isThreadSafe: false);\n            _greeks = new Lazy<Greeks>(greeks, isThreadSafe: false);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPriceModelResult\"/> class with lazy calculations of implied volatility and greeks\n        /// </summary>\n        /// <param name=\"theoreticalPrice\">The theoretical price computed by the price model</param>\n        /// <param name=\"impliedVolatility\">The calculated implied volatility</param>\n        /// <param name=\"greeks\">The sensitivities (greeks) computed by the price model</param>\n        public OptionPriceModelResult(decimal theoreticalPrice, PyObject impliedVolatility, PyObject greeks)\n            : this(theoreticalPrice, impliedVolatility.SafeAs<Func<decimal>>(), greeks.SafeAs<Func<Greeks>>())\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionPriceModels.QuantLib.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QLNet;\nusing System;\nusing System.Linq;\nusing Fasterflect;\n\nnamespace QuantConnect.Securities.Option\n{\n    using PricingEngineFuncEx = Func<Symbol, GeneralizedBlackScholesProcess, IPricingEngine>;\n\n    public static partial class OptionPriceModels\n    {\n        /// <summary>\n        /// Static class contains definitions of major option pricing models that can be used in LEAN,\n        /// based on QuantLib implementations.\n        /// </summary>\n        /// <remarks>\n        /// To introduce particular model into algorithm add the following line to the algorithm's Initialize() method:\n        ///\n        ///     option.PriceModel = OptionPriceModels.QuantLib.BjerksundStensland(); // Option pricing model of choice\n        ///\n        /// </remarks>\n        public static class QuantLib\n        {\n            private const int _timeStepsFD = 100;\n\n            /// <summary>\n            /// Creates pricing engine by engine type name.\n            /// </summary>\n            /// <param name=\"priceEngineName\">QL price engine name</param>\n            /// <param name=\"riskFree\">The risk free rate</param>\n            /// <param name=\"allowedOptionStyles\">List of option styles supported by the pricing model. It defaults to both American and European option styles</param>\n            /// <returns>New option price model instance of specific engine</returns>\n            public static IOptionPriceModel Create(string priceEngineName, decimal riskFree, OptionStyle[] allowedOptionStyles = null)\n            {\n                var type = AppDomain.CurrentDomain.GetAssemblies()\n                    .Where(a => !a.IsDynamic)\n                    .SelectMany(a => a.GetTypes())\n                    .Where(s => s.Implements(typeof(IPricingEngine)))\n                    .FirstOrDefault(t => t.FullName?.EndsWith(priceEngineName, StringComparison.InvariantCulture) == true);\n\n                return new QLOptionPriceModel(process => (IPricingEngine)Activator.CreateInstance(type, process),\n                    riskFreeRateEstimator: new ConstantQLRiskFreeRateEstimator(riskFree),\n                    allowedOptionStyles: allowedOptionStyles);\n            }\n\n            /// <summary>\n            /// Pricing engine for European vanilla options using analytical formula.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_analytic_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BlackScholes()\n            {\n                return QLOptionPriceModelProvider.Instance.GetOptionPriceModel(Symbol.Empty, Indicators.OptionPricingModelType.BlackScholes);\n            }\n\n            /// <summary>\n            /// Barone-Adesi and Whaley pricing engine for American options (1987)\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_barone_adesi_whaley_approximation_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BaroneAdesiWhaley()\n            {\n                return new QLOptionPriceModel(process => new BaroneAdesiWhaleyApproximationEngine(process),\n                                              allowedOptionStyles: new[] { OptionStyle.American });\n            }\n\n            /// <summary>\n            /// Bjerksund and Stensland pricing engine for American options (1993)\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_bjerksund_stensland_approximation_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BjerksundStensland()\n            {\n                return new QLOptionPriceModel(process => new BjerksundStenslandApproximationEngine(process),\n                                              allowedOptionStyles: new[] { OptionStyle.American });\n            }\n\n            /// <summary>\n            /// Pricing engine for European vanilla options using integral approach.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_integral_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel Integral()\n            {\n                return new QLOptionPriceModel(process => new IntegralEngine(process),\n                                              allowedOptionStyles: new[] { OptionStyle.European });\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American options using finite-differences.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel CrankNicolsonFD()\n            {\n                PricingEngineFuncEx pricingEngineFunc = (symbol, process) =>\n                    symbol.ID.OptionStyle == OptionStyle.American\n                        ? new FDAmericanEngine(process, _timeStepsFD, _timeStepsFD - 1)\n                        : new FDEuropeanEngine(process, _timeStepsFD, _timeStepsFD - 1);\n\n                return new QLOptionPriceModel(pricingEngineFunc);\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Jarrow-Rudd model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialJarrowRudd()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<JarrowRudd>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Cox-Ross-Rubinstein(CRR) model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialCoxRossRubinstein()\n            {\n                return QLOptionPriceModelProvider.Instance.GetOptionPriceModel(Symbol.Empty, Indicators.OptionPricingModelType.BinomialCoxRossRubinstein);\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Additive Equiprobabilities model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel AdditiveEquiprobabilities()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<AdditiveEQPBinomialTree>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Trigeorgis model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialTrigeorgis()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<Trigeorgis>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Tian model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialTian()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<Tian>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Leisen-Reimer model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialLeisenReimer()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<LeisenReimer>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n\n            /// <summary>\n            /// Pricing engine for European and American vanilla options using binomial trees. Joshi model.\n            /// QuantLib reference: http://quantlib.org/reference/class_quant_lib_1_1_f_d_european_engine.html\n            /// </summary>\n            /// <returns>New option price model instance</returns>\n            public static IOptionPriceModel BinomialJoshi()\n            {\n                return new QLOptionPriceModel(process => new BinomialVanillaEngine<Joshi4>(process, QLOptionPriceModelProvider.TimeStepsBinomial));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionPriceModels.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Static class contains definitions of major option pricing models that can be used in LEAN\n    /// </summary>\n    /// <remarks>\n    /// To introduce particular model into algorithm add the following line to the algorithm's Initialize() method:\n    ///\n    ///     option.PriceModel = OptionPriceModels.BlackScholes(); // Option pricing model of choice\n    ///\n    /// </remarks>\n    public static partial class OptionPriceModels\n    {\n        /// <summary>\n        /// Default option price model provider used by LEAN when creating price models.\n        /// </summary>\n        internal static IOptionPriceModelProvider DefaultPriceModelProvider { get; set; }\n\n        /// <summary>\n        /// Null pricing engine that returns the current price as the option theoretical price.\n        /// It will also set the option Greeks and implied volatility to zero, effectively disabling the pricing.\n        /// </summary>\n        public static IOptionPriceModel Null()\n        {\n            return new CurrentPriceOptionPriceModel();\n        }\n\n        /// <summary>\n        /// Pricing engine for Black-Scholes model.\n        /// </summary>\n        /// <returns>New option price model instance</returns>\n        public static IOptionPriceModel BlackScholes()\n        {\n            return DefaultPriceModelProvider.GetOptionPriceModel(Symbol.Empty, Indicators.OptionPricingModelType.BlackScholes);\n        }\n\n        /// <summary>\n        /// Pricing engine for Cox-Ross-Rubinstein (CRR) model.\n        /// </summary>\n        /// <returns>New option price model instance</returns>\n        public static IOptionPriceModel BinomialCoxRossRubinstein()\n        {\n            return DefaultPriceModelProvider.GetOptionPriceModel(Symbol.Empty, Indicators.OptionPricingModelType.BinomialCoxRossRubinstein);\n        }\n\n        /// <summary>\n        /// Pricing engine for forward binomial tree model.\n        /// </summary>\n        /// <returns>New option price model instance</returns>\n        public static IOptionPriceModel ForwardTree()\n        {\n            return DefaultPriceModelProvider.GetOptionPriceModel(Symbol.Empty, Indicators.OptionPricingModelType.ForwardTree);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionStrategies.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides methods for creating popular <see cref=\"OptionStrategy\"/> instances.\n    /// These strategies can be directly bought and sold via:\n    ///     QCAlgorithm.Buy(OptionStrategy strategy, int quantity)\n    ///     QCAlgorithm.Sell(OptionStrategy strategy, int quantity)\n    ///\n    /// See also <see cref=\"OptionStrategyDefinitions\"/>\n    /// </summary>\n    public static class OptionStrategies\n    {\n        /// <summary>\n        /// Symbol properties database to use to get contract multipliers\n        /// </summary>\n        private static SymbolPropertiesDatabase _symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Creates a Covered Call strategy that consists of selling one call contract and buying 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the call option contract</param>\n        /// <param name=\"expiration\">The expiration date for the call option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy CoveredCall(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"CoveredCall\");\n            CheckExpirationDate(expiration, \"CoveredCall\", nameof(expiration));\n\n            var underlyingQuantity = (int)_symbolPropertiesDatabase.GetSymbolProperties(canonicalOption.ID.Market, canonicalOption,\n                canonicalOption.SecurityType, \"\").ContractMultiplier;\n\n            return new OptionStrategy(OptionStrategyDefinitions.CoveredCall.Name, \n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = strike, Quantity = -1, Expiration = expiration\n                    }\n                },\n                new List<OptionStrategy.UnderlyingLegData>\n                {\n                    new OptionStrategy.UnderlyingLegData\n                    {\n                        Quantity = underlyingQuantity, Symbol = canonicalOption.Underlying\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a Protective Call strategy that consists of buying one call contract and selling 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the call option contract</param>\n        /// <param name=\"expiration\">The expiration date for the call option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ProtectiveCall(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            // Since a protective call is an inverted covered call, we can just use the CoveredCall method and invert the legs\n            return InvertStrategy(CoveredCall(canonicalOption, strike, expiration), OptionStrategyDefinitions.ProtectiveCall.Name);\n        }\n\n        /// <summary>\n        /// Creates a Covered Put strategy that consists of selling 1 put contract and 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the put option contract</param>\n        /// <param name=\"expiration\">The expiration date for the put option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy CoveredPut(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"CoveredPut\");\n            CheckExpirationDate(expiration, \"CoveredPut\", nameof(expiration));\n\n            var underlyingQuantity = -(int)_symbolPropertiesDatabase.GetSymbolProperties(canonicalOption.ID.Market, canonicalOption,\n                canonicalOption.SecurityType, \"\").ContractMultiplier;\n\n            return new OptionStrategy(OptionStrategyDefinitions.CoveredPut.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = strike, Quantity = -1, Expiration = expiration\n                    }\n                },\n                new List<OptionStrategy.UnderlyingLegData>\n                {\n                    new OptionStrategy.UnderlyingLegData\n                    {\n                        Quantity = underlyingQuantity, Symbol = canonicalOption.Underlying\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a Protective Put strategy that consists of buying 1 put contract and 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the put option contract</param>\n        /// <param name=\"expiration\">The expiration date for the put option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ProtectivePut(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            // Since a protective put is an inverted covered put, we can just use the CoveredPut method and invert the legs\n            return InvertStrategy(CoveredPut(canonicalOption, strike, expiration), OptionStrategyDefinitions.ProtectivePut.Name);\n        }\n\n        /// <summary>\n        /// Creates a Protective Collar strategy that consists of buying 1 put contract and 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"callStrike\">The strike price for the call option contract</param>\n        /// <param name=\"putStrike\">The strike price for the put option contract</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ProtectiveCollar(Symbol canonicalOption, decimal callStrike, decimal putStrike, DateTime expiration)\n        {\n            if (callStrike < putStrike)\n            {\n                throw new ArgumentException(\"ProtectiveCollar: callStrike must be greater than putStrike\", $\"{nameof(callStrike)}, {nameof(putStrike)}\");\n            }\n\n            // Since a protective collar is a combination of protective put and covered call\n            var coveredCall = CoveredCall(canonicalOption, callStrike, expiration);\n            var protectivePut = ProtectivePut(canonicalOption, putStrike, expiration);\n\n            return new OptionStrategy(OptionStrategyDefinitions.ProtectiveCollar.Name,\n                canonicalOption,\n                coveredCall.OptionLegs.Concat(protectivePut.OptionLegs).ToList(),\n                coveredCall.UnderlyingLegs     // only 1 lot of long stock position\n                );\n        }\n\n        /// <summary>\n        /// Creates a Conversion strategy that consists of buying 1 put contract, 1 lot of the underlying and selling 1 call contract.\n        /// Put and call must have the same expiration date, underlying (multiplier), and strike price.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the call and put option contract</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy Conversion(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            var strategy = ProtectiveCollar(canonicalOption, strike, strike, expiration);\n            strategy.Name = OptionStrategyDefinitions.Conversion.Name;\n            return strategy;\n        }\n\n        /// <summary>\n        /// Creates a Reverse Conversion strategy that consists of buying 1 put contract and 1 lot of the underlying.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the put option contract</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ReverseConversion(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            // Since a reverse conversion is an inverted conversion, we can just use the Conversion method and invert the legs\n            return InvertStrategy(Conversion(canonicalOption, strike, expiration), OptionStrategyDefinitions.ReverseConversion.Name);\n        }\n\n        /// <summary>\n        /// Creates a Naked Call strategy that consists of selling 1 call contract.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the call option contract</param>\n        /// <param name=\"expiration\">The expiration date for the call option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy NakedCall(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"NakedCall\");\n            CheckExpirationDate(expiration, \"NakedCall\", nameof(expiration));\n\n            return new OptionStrategy(OptionStrategyDefinitions.NakedCall.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = strike, Quantity = -1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a Naked Put strategy that consists of selling 1 put contract.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the put option contract</param>\n        /// <param name=\"expiration\">The expiration date for the put option contract</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy NakedPut(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"NakedPut\");\n            CheckExpirationDate(expiration, \"NakedPut\", nameof(expiration));\n\n            return new OptionStrategy(OptionStrategyDefinitions.NakedPut.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = strike, Quantity = -1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bear Call Spread strategy, that consists of two calls with the same expiration but different strikes.\n        /// The strike price of the short call is below the strike of the long call. This is a credit spread.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"leg1Strike\">The strike price of the short call</param>\n        /// <param name=\"leg2Strike\">The strike price of the long call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BearCallSpread(\n            Symbol canonicalOption,\n            decimal leg1Strike,\n            decimal leg2Strike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BearCallSpread\");\n            CheckExpirationDate(expiration, \"BearCallSpread\", nameof(expiration));\n\n            if (leg1Strike >= leg2Strike)\n            {\n                throw new ArgumentException(\"BearCallSpread: leg1Strike must be less than leg2Strike\", $\"{nameof(leg1Strike)}, {nameof(leg2Strike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BearCallSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = leg1Strike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = leg2Strike, Quantity = 1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bear Put Spread strategy, that consists of two puts with the same expiration but different strikes.\n        /// The strike price of the short put is below the strike of the long put. This is a debit spread.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"leg1Strike\">The strike price of the long put</param>\n        /// <param name=\"leg2Strike\">The strike price of the short put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BearPutSpread(\n            Symbol canonicalOption,\n            decimal leg1Strike,\n            decimal leg2Strike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BearPutSpread\");\n            CheckExpirationDate(expiration, \"BearPutSpread\", nameof(expiration));\n\n            if (leg1Strike <= leg2Strike)\n            {\n                throw new ArgumentException(\"BearPutSpread: leg1Strike must be greater than leg2Strike\", $\"{nameof(leg1Strike)}, {nameof(leg2Strike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BearPutSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = leg1Strike, Quantity = 1,\n                        Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = leg2Strike, Quantity = -1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bull Call Spread strategy, that consists of two calls with the same expiration but different strikes.\n        /// The strike price of the short call is higher than the strike of the long call. This is a debit spread.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"leg1Strike\">The strike price of the long call</param>\n        /// <param name=\"leg2Strike\">The strike price of the short call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BullCallSpread(\n            Symbol canonicalOption,\n            decimal leg1Strike,\n            decimal leg2Strike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BullCallSpread\");\n            CheckExpirationDate(expiration, \"BullCallSpread\", nameof(expiration));\n\n            if (leg1Strike >= leg2Strike)\n            {\n                throw new ArgumentException(\"BullCallSpread: leg1Strike must be less than leg2Strike\", $\"{nameof(leg1Strike)}, {nameof(leg2Strike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BullCallSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = leg1Strike, Quantity = 1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = leg2Strike, Quantity = -1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bull Put Spread strategy, that consists of two puts with the same expiration but different strikes.\n        /// The strike price of the short put is above the strike of the long put. This is a credit spread.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"leg1Strike\">The strike price of the short put</param>\n        /// <param name=\"leg2Strike\">The strike price of the long put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BullPutSpread(\n            Symbol canonicalOption,\n            decimal leg1Strike,\n            decimal leg2Strike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BullPutSpread\");\n            CheckExpirationDate(expiration, \"BullPutSpread\", nameof(expiration));\n\n            if (leg1Strike <= leg2Strike)\n            {\n                throw new ArgumentException(\"BullPutSpread: leg1Strike must be greater than leg2Strike\", $\"{nameof(leg1Strike)}, {nameof(leg2Strike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BullPutSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = leg1Strike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = leg2Strike, Quantity = 1,\n                        Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Straddle strategy, that is a combination of buying a call and buying a put, both with the same strike price and expiration.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the both legs</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy Straddle(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"Straddle\");\n            CheckExpirationDate(expiration, \"Straddle\", nameof(expiration));\n\n            return new OptionStrategy(OptionStrategyDefinitions.Straddle.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = strike, Quantity = 1,\n                        Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = strike, Quantity = 1,\n                        Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a Short Straddle strategy that consists of selling a call and a put, both with the same strike price and expiration.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price for the option contracts</param>\n        /// <param name=\"expiration\">The expiration date for the option contracts</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortStraddle(Symbol canonicalOption, decimal strike, DateTime expiration)\n        {\n            // Since a short straddle is an inverted straddle, we can just use the Straddle method and invert the legs\n            return InvertStrategy(Straddle(canonicalOption, strike, expiration), OptionStrategyDefinitions.ShortStraddle.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Strangle strategy, that buying a call option and a put option with the same expiration date\n        /// The strike price of the call is above the strike of the put.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"callLegStrike\">The strike price of the long call</param>\n        /// <param name=\"putLegStrike\">The strike price of the long put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy Strangle(\n            Symbol canonicalOption,\n            decimal callLegStrike,\n            decimal putLegStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"Strangle\");\n            CheckExpirationDate(expiration, \"Strangle\", nameof(expiration));\n\n            if (callLegStrike <= putLegStrike)\n            {\n                throw new ArgumentException($\"Strangle: {nameof(callLegStrike)} must be greater than {nameof(putLegStrike)}\",\n                    $\"{nameof(callLegStrike)}, {nameof(putLegStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.Strangle.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = callLegStrike, Quantity = 1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = putLegStrike, Quantity = 1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a Short Strangle strategy that consists of selling a call and a put, with the same expiration date and\n        /// the call strike being above the put strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"callLegStrike\">The strike price of the short call</param>\n        /// <param name=\"putLegStrike\">The strike price of the short put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortStrangle(Symbol canonicalOption, decimal callLegStrike, decimal putLegStrike, DateTime expiration)\n        {\n            // Since a short strangle is an inverted strangle, we can just use the Strangle method and invert the legs\n            return InvertStrategy(Strangle(canonicalOption, callLegStrike, putLegStrike, expiration), OptionStrategyDefinitions.ShortStrangle.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Call Butterfly strategy, that consists of two short calls at a middle strike, and one long call each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the long call</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two short calls</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the long call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy CallButterfly(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal middleStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"CallButterfly\");\n            CheckExpirationDate(expiration, \"CallButterfly\", nameof(expiration));\n\n            if (higherStrike <= middleStrike ||\n                lowerStrike >= middleStrike ||\n                higherStrike - middleStrike != middleStrike - lowerStrike)\n            {\n                throw new ArgumentException(\"ButterflyCall: upper and lower strikes must both be equidistant from the middle strike\",\n                    $\"{nameof(higherStrike)}, {nameof(middleStrike)}, {nameof(lowerStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.ButterflyCall.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = higherStrike, Quantity = 1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = middleStrike, Quantity = -2, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = lowerStrike, Quantity = 1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a new Butterfly Call strategy that consists of two short calls at a middle strike,\n        /// and one long call each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the long call</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two short calls</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the long call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        /// <remarks>Alias for <see cref=\"CallButterfly\" /></remarks>\n        public static OptionStrategy ButterflyCall(Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike,\n            DateTime expiration)\n        {\n            return CallButterfly(canonicalOption, higherStrike, middleStrike, lowerStrike, expiration);\n        }\n\n        /// <summary>\n        /// Creates a new Butterfly Call strategy that consists of two long calls at a middle strike,\n        /// and one short call each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the short call</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two long calls</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the short call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortButterflyCall(Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike,\n            DateTime expiration)\n        {\n            // Since a short butterfly call is an inverted butterfly call, we can just use the ButterflyCall method and invert the legs\n            return InvertStrategy(ButterflyCall(canonicalOption, higherStrike, middleStrike, lowerStrike, expiration),\n                OptionStrategyDefinitions.ShortButterflyCall.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Put Butterfly strategy, that consists of two short puts at a middle strike, and one long put each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the long put</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two short puts</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the long put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy PutButterfly(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal middleStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"PutButterfly\");\n            CheckExpirationDate(expiration, \"PutButterfly\", nameof(expiration));\n\n            if (higherStrike <= middleStrike ||\n                lowerStrike >= middleStrike ||\n                higherStrike - middleStrike != middleStrike - lowerStrike)\n            {\n                throw new ArgumentException(\"ButterflyPut: upper and lower strikes must both be equidistant from the middle strike\",\n                    $\"{nameof(higherStrike)}, {nameof(middleStrike)}, {nameof(lowerStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.ButterflyPut.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = higherStrike, Quantity = 1,\n                        Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = middleStrike, Quantity = -2,\n                        Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = lowerStrike, Quantity = 1,\n                        Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a new Butterfly Put strategy that consists of two short puts at a middle strike,\n        /// and one long put each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the long put</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two short puts</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the long put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        /// <remarks>Alias for <see cref=\"PutButterfly\" /></remarks>\n        public static OptionStrategy ButterflyPut(Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike,\n            DateTime expiration)\n        {\n            return PutButterfly(canonicalOption, higherStrike, middleStrike, lowerStrike, expiration);\n        }\n\n        /// <summary>\n        /// Creates a new Butterfly Put strategy that consists of two long puts at a middle strike,\n        /// and one short put each at a lower and upper strike.\n        /// The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The upper strike price of the short put</param>\n        /// <param name=\"middleStrike\">The middle strike price of the two long puts</param>\n        /// <param name=\"lowerStrike\">The lower strike price of the short put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortButterflyPut(Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike,\n            DateTime expiration)\n        {\n            // Since a short butterfly put is an inverted butterfly put, we can just use the ButterflyPut method and invert the legs\n            return InvertStrategy(ButterflyPut(canonicalOption, higherStrike, middleStrike, lowerStrike, expiration),\n                OptionStrategyDefinitions.ShortButterflyPut.Name);\n        }\n\n        /// <summary>\n        /// Creates new Call Calendar Spread strategy which consists of a short and a long call\n        /// with the same strikes but with the long call having a further expiration date.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the both legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the short option</param>\n        /// <param name=\"farExpiration\">Far expiration date for the long option</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy CallCalendarSpread(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"CallCalendarSpread\");\n            CheckExpirationDate(nearExpiration, \"CallCalendarSpread\", nameof(nearExpiration));\n            CheckExpirationDate(farExpiration, \"CallCalendarSpread\", nameof(farExpiration));\n\n            if (nearExpiration >= farExpiration)\n            {\n                throw new ArgumentException(\"CallCalendarSpread: near expiration must be less than far expiration\",\n                    $\"{nameof(nearExpiration)}, {nameof(farExpiration)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.CallCalendarSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = strike, Quantity = -1, Expiration = nearExpiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = strike, Quantity = 1, Expiration = farExpiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates new Short Call Calendar Spread strategy which consists of a short and a long call\n        /// with the same strikes but with the short call having a further expiration date.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the both legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the long option</param>\n        /// <param name=\"farExpiration\">Far expiration date for the short option</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortCallCalendarSpread(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            // Since a short call calendar spread is an inverted call calendar, we can just use the CallCalendarSpread method and invert the legs\n            return InvertStrategy(CallCalendarSpread(canonicalOption, strike, nearExpiration, farExpiration),\n                OptionStrategyDefinitions.ShortCallCalendarSpread.Name);\n        }\n\n        /// <summary>\n        /// Creates new Put Calendar Spread strategy which consists of a short and a long put\n        /// with the same strikes but with the long put having a further expiration date.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the both legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the short option</param>\n        /// <param name=\"farExpiration\">Far expiration date for the long option</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy PutCalendarSpread(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"PutCalendarSpread\");\n            CheckExpirationDate(nearExpiration, \"PutCalendarSpread\", nameof(nearExpiration));\n            CheckExpirationDate(farExpiration, \"PutCalendarSpread\", nameof(farExpiration));\n\n            if (nearExpiration >= farExpiration)\n            {\n                throw new ArgumentException(\"PutCalendarSpread: near expiration must be less than far expiration\",\n                    $\"{nameof(nearExpiration)}, {nameof(farExpiration)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.PutCalendarSpread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = strike, Quantity = -1, Expiration = nearExpiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = strike, Quantity = 1, Expiration = farExpiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates new Short Put Calendar Spread strategy which consists of a short and a long put\n        /// with the same strikes but with the short put having a further expiration date.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the both legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the long option</param>\n        /// <param name=\"farExpiration\">Far expiration date for the short option</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortPutCalendarSpread(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            // Since a short put calendar spread is an inverted put calendar, we can just use the PutCalendarSpread method and invert the legs\n            return InvertStrategy(PutCalendarSpread(canonicalOption, strike, nearExpiration, farExpiration),\n                OptionStrategyDefinitions.ShortPutCalendarSpread.Name);\n        }\n\n        /// <summary>\n        /// Creates a new Iron Butterfly strategy which consists of a short ATM call, a short ATM put, a long OTM call, and a long OTM put.\n        /// all with the same expiration date and with increasing strikes prices in the mentioned order.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"otmCallStrike\">OTM call option strike price</param>\n        /// <param name=\"atmStrike\">2 ATM options strike price</param>\n        /// <param name=\"otmPutStrike\">OTM put option strike price</param>\n        /// <param name=\"expiration\">Expiration date for all the options</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy IronButterfly(Symbol canonicalOption, decimal otmPutStrike, decimal atmStrike, decimal otmCallStrike,\n            DateTime expiration)\n        {\n            if (atmStrike - otmPutStrike != otmCallStrike - atmStrike)\n            {\n                throw new ArgumentException(\"IronButterfly: intervals between exercise prices must be equal\");\n            }\n            \n            var strategy = IronCondor(canonicalOption, otmPutStrike, atmStrike, atmStrike, otmCallStrike, expiration);\n            strategy.Name = OptionStrategyDefinitions.IronButterfly.Name;\n            return strategy;\n        }\n\n        /// <summary>\n        /// Creates a new Short Iron Butterfly strategy which consists of a long ATM call, a long ATM put, a short OTM call, and a short OTM put,\n        /// all with the same expiration date and with increasing strikes prices in the mentioned order.\n        /// <remarks>It is the inverse of an <see cref=\"IronButterfly\" />.</remarks>\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"otmCallStrike\">OTM call option strike price</param>\n        /// <param name=\"atmStrike\">2 ATM options strike price</param>\n        /// <param name=\"otmPutStrike\">OTM put option strike price</param>\n        /// <param name=\"expiration\">Expiration date for all the options</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortIronButterfly(Symbol canonicalOption, decimal otmPutStrike, decimal atmStrike, decimal otmCallStrike,\n            DateTime expiration)\n        {\n            return InvertStrategy(IronButterfly(canonicalOption, otmPutStrike, atmStrike, otmCallStrike, expiration),\n                OptionStrategyDefinitions.ShortIronButterfly.Name);\n        }\n\n        /// <summary>\n        /// Creates a new Iron Condor strategy which consists of a long put, a short put, a short call and a long option,\n        /// all with the same expiration date and with increasing strikes prices in the mentioned order.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"longPutStrike\">Long put option strike price</param>\n        /// <param name=\"shortPutStrike\">Short put option strike price</param>\n        /// <param name=\"shortCallStrike\">Short call option strike price</param>\n        /// <param name=\"longCallStrike\">Long call option strike price</param>\n        /// <param name=\"expiration\">Expiration date for all the options</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy IronCondor(Symbol canonicalOption, decimal longPutStrike, decimal shortPutStrike, decimal shortCallStrike,\n            decimal longCallStrike, DateTime expiration)\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"IronCondor\");\n            CheckExpirationDate(expiration, \"IronCondor\", nameof(expiration));\n\n            if (longPutStrike >= shortPutStrike || shortPutStrike > shortCallStrike || shortCallStrike >= longCallStrike)\n            {\n                throw new ArgumentException(\"IronCondor: strike prices must be in ascending order\",\n                    $\"{nameof(longPutStrike)}, {nameof(shortPutStrike)}, {nameof(shortCallStrike)}, {nameof(longCallStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.IronCondor.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = longPutStrike, Quantity = 1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = shortPutStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = shortCallStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = longCallStrike, Quantity = 1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Creates a new Short Iron Condor strategy which consists of a short put, a long put, a long call and a short call,\n        /// all with the same expiration date and with increasing strikes prices in the mentioned order.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"shortPutStrike\">Short put option strike price</param>\n        /// <param name=\"longPutStrike\">Long put option strike price</param>\n        /// <param name=\"longCallStrike\">Long call option strike price</param>\n        /// <param name=\"shortCallStrike\">Short call option strike price</param>\n        /// <param name=\"expiration\">Expiration date for all the options</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortIronCondor(Symbol canonicalOption, decimal shortPutStrike, decimal longPutStrike, decimal longCallStrike,\n            decimal shortCallStrike, DateTime expiration)\n        {\n            return InvertStrategy(IronCondor(canonicalOption, shortPutStrike, longPutStrike, longCallStrike, shortCallStrike, expiration),\n                OptionStrategyDefinitions.ShortIronCondor.Name);\n        }\n\n        /// <summary>\n        /// Creates a Box Spread strategy which consists of a long call and a short put (buy side) of the same strikes,\n        /// coupled with a short call and a long put (sell side) of higher but same strikes. All options have the same expiry.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the sell side legs</param>\n        /// <param name=\"lowerStrike\">The strike price of the buy side legs</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BoxSpread(Symbol canonicalOption, decimal higherStrike, decimal lowerStrike, DateTime expiration)\n        {\n            if (higherStrike <= lowerStrike)\n            {\n                throw new ArgumentException($\"BoxSpread: strike prices must be in descending order, {nameof(higherStrike)}, {nameof(lowerStrike)}\");\n            }\n\n            // It is a combination of a BearPutSpread and a BullCallSpread with the same expiry and strikes\n            var bearPutSpread = BearPutSpread(canonicalOption, higherStrike, lowerStrike, expiration);\n            var bullCallSpread = BullCallSpread(canonicalOption, lowerStrike, higherStrike, expiration);\n\n            return new OptionStrategy(OptionStrategyDefinitions.BoxSpread.Name,\n                canonicalOption,\n                bearPutSpread.OptionLegs.Concat(bullCallSpread.OptionLegs).ToList());\n        }\n\n        /// <summary>\n        /// Creates a Short Box Spread strategy which consists of a long call and a short put (buy side) of the same strikes,\n        /// coupled with a short call and a long put (sell side) of lower but same strikes. All options have the same expiry.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the buy side</param>\n        /// <param name=\"lowerStrike\">The strike price of the sell side</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortBoxSpread(Symbol canonicalOption, decimal higherStrike, decimal lowerStrike, DateTime expiration)\n        {\n            // Since a short box spread is an inverted box spread, we can just use the BoxSpread method and invert the legs\n            return InvertStrategy(BoxSpread(canonicalOption, higherStrike, lowerStrike, expiration), OptionStrategyDefinitions.ShortBoxSpread.Name);\n        }\n\n        /// <summary>\n        /// Creates new Jelly Roll strategy which combines a long call calendar spread and a short put calendar spread\n        /// with the same strikes and the same pair of expiration dates.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the all legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the short call and the long put</param>\n        /// <param name=\"farExpiration\">Far expiration date for the long call and the short put</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy JellyRoll(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            var callCalendarSpread = CallCalendarSpread(canonicalOption, strike, nearExpiration, farExpiration);\n            var shortPutCalendarSpread = ShortPutCalendarSpread(canonicalOption, strike, nearExpiration, farExpiration);\n\n            return new OptionStrategy(OptionStrategyDefinitions.JellyRoll.Name,\n                canonicalOption,\n                callCalendarSpread.OptionLegs.Concat(shortPutCalendarSpread.OptionLegs).ToList());\n        }\n\n        /// <summary>\n        /// Creates new Short Jelly Roll strategy which combines a long call calendar spread and a short put calendar spread\n        /// with the same strikes and the same pair of expiration dates.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"strike\">The strike price of the all legs</param>\n        /// <param name=\"nearExpiration\">Near expiration date for the short call and the long put</param>\n        /// <param name=\"farExpiration\">Far expiration date for the long call and the short put</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortJellyRoll(Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)\n        {\n            return InvertStrategy(JellyRoll(canonicalOption, strike, nearExpiration, farExpiration), OptionStrategyDefinitions.ShortJellyRoll.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Bear Call Ladder strategy, that consists of three calls with the same expiration but different strikes.\n        /// The strike price of the short call is below the strikes of the two long calls.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"lowerStrike\">The strike price of the short call</param>\n        /// <param name=\"middleStrike\">The middle strike price of one long call</param>\n        /// <param name=\"higherStrike\">The strike price of one long call with higher strike price</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BearCallLadder(\n            Symbol canonicalOption,\n            decimal lowerStrike,\n            decimal middleStrike,\n            decimal higherStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BearCallLadder\");\n            CheckExpirationDate(expiration, \"BearCallLadder\", nameof(expiration));\n\n            if (lowerStrike >= middleStrike || lowerStrike >= higherStrike || middleStrike >= higherStrike)\n            {\n                throw new ArgumentException(\"BearCallLadder: strike prices must be in ascending order\", \n                    $\"{nameof(lowerStrike)}, {nameof(middleStrike)}, {nameof(higherStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BearCallLadder.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = lowerStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = middleStrike, Quantity = 1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = higherStrike, Quantity = 1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bear Put Ladder strategy, that consists of three puts with the same expiration but different strikes.\n        /// The strike price of the long put is above the strikes of the two short puts.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the long put</param>\n        /// <param name=\"middleStrike\">The middle strike price of one short put</param>\n        /// <param name=\"lowerStrike\">The strike price of one short put with lower strike price</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BearPutLadder(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal middleStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"BearPutLadder\");\n            CheckExpirationDate(expiration, \"BearPutLadder\", nameof(expiration));\n\n            if (higherStrike <= middleStrike || higherStrike <= lowerStrike || middleStrike <= lowerStrike)\n            {\n                throw new ArgumentException(\"BearPutLadder: strike prices must be in descending order\", \n                    $\"{nameof(higherStrike)}, {nameof(middleStrike)}, {nameof(lowerStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.BearPutLadder.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = higherStrike, Quantity = 1,\n                        Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = middleStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = lowerStrike, Quantity = -1, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Bull Call Ladder strategy, that consists of three calls with the same expiration but different strikes.\n        /// The strike price of the long call is below the strikes of the two short calls.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"lowerStrike\">The strike price of the long call</param>\n        /// <param name=\"middleStrike\">The middle strike price of one short call</param>\n        /// <param name=\"higherStrike\">The strike price of one short call with higher strike price</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BullCallLadder(\n            Symbol canonicalOption,\n            decimal lowerStrike,\n            decimal middleStrike,\n            decimal higherStrike,\n            DateTime expiration\n            )\n        {\n            return InvertStrategy(BearCallLadder(canonicalOption, lowerStrike, middleStrike, higherStrike, expiration), OptionStrategyDefinitions.BullCallLadder.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Bull Put Ladder strategy, that consists of three puts with the same expiration but different strikes.\n        /// The strike price of the short put is above the strikes of the two long puts.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the short put</param>\n        /// <param name=\"middleStrike\">The middle strike price of one long put</param>\n        /// <param name=\"lowerStrike\">The strike price of one long put with lower strike price</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy BullPutLadder(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal middleStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            return InvertStrategy(BearPutLadder(canonicalOption, higherStrike, middleStrike, lowerStrike, expiration), OptionStrategyDefinitions.BullPutLadder.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Long Call Backspread strategy, that consists of two calls with the same expiration but different strikes.\n        /// It involves selling the lower strike call, while buying twice the number of the higher strike call.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"lowerStrike\">The strike price of the short call</param>\n        /// <param name=\"higherStrike\">The strike price of the long call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy CallBackspread(\n            Symbol canonicalOption,\n            decimal lowerStrike,\n            decimal higherStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"CallBackspread\");\n            CheckExpirationDate(expiration, \"CallBackspread\", nameof(expiration));\n\n            if (lowerStrike >= higherStrike)\n            {\n                throw new ArgumentException($\"CallBackspread: strike prices must be in ascending order, {nameof(lowerStrike)}, {nameof(higherStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.CallBackspread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = lowerStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Call, Strike = higherStrike, Quantity = 2, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Long Put Backspread strategy, that consists of two puts with the same expiration but different strikes.\n        /// It involves selling the higher strike put, while buying twice the number of the lower strike put.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the short put</param>\n        /// <param name=\"lowerStrike\">The strike price of the long put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy PutBackspread(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            CheckCanonicalOptionSymbol(canonicalOption, \"PutBackspread\");\n            CheckExpirationDate(expiration, \"PutBackspread\", nameof(expiration));\n\n            if (higherStrike <= lowerStrike)\n            {\n                throw new ArgumentException($\"PutBackspread: strike prices must be in descending order, {nameof(higherStrike)}, {nameof(lowerStrike)}\");\n            }\n\n            return new OptionStrategy(OptionStrategyDefinitions.PutBackspread.Name,\n                canonicalOption,\n                new List<OptionStrategy.OptionLegData>\n                {\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = higherStrike, Quantity = -1, Expiration = expiration\n                    },\n                    new OptionStrategy.OptionLegData\n                    {\n                        Right = OptionRight.Put, Strike = lowerStrike, Quantity = 2, Expiration = expiration\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Method creates new Short Call Backspread strategy, that consists of two calls with the same expiration but different strikes.\n        /// It involves buying the lower strike call, while shorting twice the number of the higher strike call.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"lowerStrike\">The strike price of the long call</param>\n        /// <param name=\"higherStrike\">The strike price of the short call</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        public static OptionStrategy ShortCallBackspread(\n            Symbol canonicalOption,\n            decimal lowerStrike,\n            decimal higherStrike,\n            DateTime expiration\n            )\n        {\n            return InvertStrategy(CallBackspread(canonicalOption, lowerStrike, higherStrike, expiration), OptionStrategyDefinitions.ShortCallBackspread.Name);\n        }\n\n        /// <summary>\n        /// Method creates new Short Put Backspread strategy, that consists of two puts with the same expiration but different strikes.\n        /// It involves buying the higher strike put, while selling twice the number of the lower strike put.\n        /// </summary>\n        /// <param name=\"canonicalOption\">Option symbol</param>\n        /// <param name=\"higherStrike\">The strike price of the long put</param>\n        /// <param name=\"lowerStrike\">The strike price of the short put</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>Option strategy specification</returns>\n        public static OptionStrategy ShortPutBackspread(\n            Symbol canonicalOption,\n            decimal higherStrike,\n            decimal lowerStrike,\n            DateTime expiration\n            )\n        {\n            return InvertStrategy(PutBackspread(canonicalOption, higherStrike, lowerStrike, expiration), OptionStrategyDefinitions.ShortPutBackspread.Name);\n        }\n\n        /// <summary>\n        /// Checks that canonical option symbol is valid\n        /// </summary>\n        private static void CheckCanonicalOptionSymbol(Symbol canonicalOption, string strategyName)\n        {\n            if (!canonicalOption.HasUnderlying || canonicalOption.ID.StrikePrice != 0.0m)\n            {\n                throw new ArgumentException($\"{strategyName}: canonicalOption must contain canonical option symbol\", nameof(canonicalOption));\n            }\n        }\n\n        /// <summary>\n        /// Checks that expiration date is valid\n        /// </summary>\n        private static void CheckExpirationDate(DateTime expiration, string strategyName, string parameterName)\n        {\n            if (expiration == DateTime.MaxValue || expiration == DateTime.MinValue)\n            {\n                throw new ArgumentException($\"{strategyName}: expiration must contain expiration date\", parameterName);\n            }\n        }\n\n        /// <summary>\n        /// Inverts the given strategy by multiplying all legs' quantities by -1 and changing the strategy name.\n        /// </summary>\n        private static OptionStrategy InvertStrategy(OptionStrategy strategy, string invertedStrategyName)\n        {\n            strategy.Name = invertedStrategyName;\n            foreach (var leg in strategy.OptionLegs.Cast<Leg>().Concat(strategy.UnderlyingLegs))\n            {\n                leg.Quantity *= -1;\n            }\n\n            return strategy;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionStrategy.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option strategy specification class. Describes option strategy and its parameters for trading.\n    /// </summary>\n    public class OptionStrategy\n    {\n        /// <summary>\n        /// Option strategy name\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// The canonical Option symbol of the strategy\n        /// </summary>\n        public Symbol CanonicalOption { get; set; }\n\n        /// <summary>\n        /// Underlying symbol of the strategy\n        /// </summary>\n        public Symbol Underlying { get; set; }\n\n        /// <summary>\n        /// Option strategy legs\n        /// </summary>\n        public List<OptionLegData> OptionLegs { get; set; }\n\n        /// <summary>\n        /// Option strategy underlying legs (usually 0 or 1 legs)\n        /// </summary>\n        public List<UnderlyingLegData> UnderlyingLegs { get; set; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionStrategy\"/> with the specified parameters\n        /// </summary>\n        /// <param name=\"name\">The strategy name</param>\n        /// <param name=\"canonicalSymbol\">The canonical option symbol</param>\n        /// <param name=\"optionLegs\">The option legs data</param>\n        /// <param name=\"underlyingLegs\">The underlying legs data</param>\n        public OptionStrategy(string name, Symbol canonicalSymbol, List<OptionLegData> optionLegs = null, List<UnderlyingLegData> underlyingLegs = null)\n        {\n            Name = name;\n            CanonicalOption = canonicalSymbol;\n            Underlying = canonicalSymbol.Underlying;\n            OptionLegs = optionLegs ?? new List<OptionLegData>();\n            UnderlyingLegs = underlyingLegs ?? new List<UnderlyingLegData>();\n\n            SetSymbols();\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionStrategy\"/> with default parameters\n        /// </summary>\n        public OptionStrategy()\n        {\n            OptionLegs = new List<OptionLegData>();\n            UnderlyingLegs = new List<UnderlyingLegData>();\n        }\n\n        /// <summary>\n        /// Sets the option legs symbols based on the canonical symbol and the leg data. \n        /// If the canonical symbol is not set, it will be created using the underlying symbol.\n        /// </summary>\n        public void SetSymbols()\n        {\n            if (CanonicalOption == null)\n            {\n                if (Underlying == null)\n                {\n                    // Let's be polite and try to get the underlying symbol from the underlying legs as a last resort\n                    var underlyingLeg = UnderlyingLegs.Count > 0 ? UnderlyingLegs[0] : null;\n                    if (underlyingLeg == null || underlyingLeg.Symbol == null)\n                    {\n                        return;\n                    }\n\n                    Underlying = underlyingLeg.Symbol;\n                }\n\n                CanonicalOption = Symbol.CreateCanonicalOption(Underlying);\n            }\n\n            foreach (var optionLeg in OptionLegs.Where(leg => leg.Symbol == null))\n            {\n                var targetOption = CanonicalOption.ID.Symbol;\n                optionLeg.Symbol = Symbol.CreateOption(Underlying, targetOption, Underlying.ID.Market, CanonicalOption.ID.OptionStyle,\n                    optionLeg.Right, optionLeg.Strike, optionLeg.Expiration);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"OptionStrategy\"/> with the specified name and legs data.\n        /// The method will try to infer the canonical symbol and underlying symbol from the legs data, but they can also be set manually after the strategy creation.\n        /// </summary>\n        public static OptionStrategy Create(string name, IEnumerable<Leg> legs)\n        {\n            var underlyingLegs = new List<UnderlyingLegData>();\n            var optionLegs = new List<OptionLegData>();\n            Symbol canonicalSymbol = null;\n\n            foreach (var leg in legs)\n            {\n                if (leg is UnderlyingLegData underlyingLeg)\n                {\n                    underlyingLegs.Add(underlyingLeg);\n                }\n                else if (leg is OptionLegData optionLeg)\n                {\n                    optionLegs.Add(optionLeg);\n\n                    if (canonicalSymbol == null)\n                    {\n                        canonicalSymbol = optionLeg.Symbol.Canonical;\n                    }\n                }\n                else\n                {\n                    throw new ArgumentException($\"Invalid leg type: {leg.GetType().FullName}\");\n                }\n            }\n\n            return new OptionStrategy(name, canonicalSymbol, optionLegs, underlyingLegs);\n        }\n\n        /// <summary>\n        /// This class is a POCO containing basic data for the option legs of the strategy\n        /// </summary>\n        public class OptionLegData : Leg\n        {\n            /// <summary>\n            /// Option right (type) of the option leg\n            /// </summary>\n            public OptionRight Right { get; set; }\n\n            /// <summary>\n            /// Expiration date of the leg\n            /// </summary>\n            public DateTime Expiration { get; set; }\n\n            /// <summary>\n            /// Strike price of the leg\n            /// </summary>\n            public decimal Strike { get; set; }\n\n            /// <summary>\n            /// Creates a new instance of <see cref=\"OptionLegData\"/> from the specified parameters\n            /// </summary>\n            public static OptionLegData Create(int quantity, Symbol symbol, decimal? orderPrice = null)\n            {\n                return new OptionLegData\n                {\n                    Symbol = symbol,\n                    Quantity = quantity,\n                    Expiration = symbol.ID.Date,\n                    OrderPrice = orderPrice,\n                    Right = symbol.ID.OptionRight,\n                    Strike = symbol.ID.StrikePrice\n                };\n            }\n\n            /// <summary>\n            /// Returns a string that represents the option leg\n            /// </summary>\n            public override string ToString()\n            {\n                return $\"Leg: {Quantity}. Right: {Right}. Strike: {Strike}. Expiration: {Expiration:yyyyMMdd}\";\n            }\n        }\n\n        /// <summary>\n        /// This class is a POCO containing basic data for the underlying leg of the strategy\n        /// </summary>\n        public class UnderlyingLegData : Leg\n        {\n            /// <summary>\n            /// Creates a new instance of <see cref=\"UnderlyingLegData\"/> for the specified <paramref name=\"quantity\"/> of underlying shares.\n            /// </summary>\n            public static UnderlyingLegData Create(int quantity, Symbol symbol, decimal? orderPrice = null)\n            {\n                var data = Create(quantity, orderPrice);\n                data.Symbol = symbol;\n                return data;\n            }\n\n            /// <summary>\n            /// Creates a new instance of <see cref=\"UnderlyingLegData\"/> for the specified <paramref name=\"quantity\"/> of underlying shares.\n            /// </summary>\n            public static UnderlyingLegData Create(int quantity, decimal? orderPrice = null)\n            {\n                return new UnderlyingLegData\n                {\n                    Quantity = quantity,\n                    OrderPrice = orderPrice\n                };\n            }\n\n            /// <summary>\n            /// Returns a string that represents the underlying leg.\n            /// </summary>\n            public override string ToString()\n            {\n                return Symbol != null ? $\"Leg: {Quantity}. {Symbol}\" : string.Empty;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing System.Collections.Generic;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Option strategy buying power model\n    /// </summary>\n    /// <remarks>\n    /// Reference used https://www.interactivebrokers.com/en/index.php?f=26660\n    /// </remarks>\n    public class OptionStrategyPositionGroupBuyingPowerModel : PositionGroupBuyingPowerModel\n    {\n        private readonly OptionStrategy _optionStrategy;\n\n        /// <summary>\n        /// Creates a new instance for a target option strategy\n        /// </summary>\n        /// <param name=\"optionStrategy\">The option strategy to model</param>\n        public OptionStrategyPositionGroupBuyingPowerModel(OptionStrategy optionStrategy)\n        {\n            _optionStrategy = optionStrategy;\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the </returns>\n        public override MaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters)\n        {\n            if (_optionStrategy == null)\n            {\n                // we could be liquidating a position\n                return new MaintenanceMargin(0);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ProtectivePut.Name || _optionStrategy.Name == OptionStrategyDefinitions.ProtectiveCall.Name)\n            {\n                // Minimum (((10% * Call/Put Strike Price) + Call/Put Out of the Money Amount), Short Stock/Long Maintenance Requirement)\n                var optionPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => position.Symbol.SecurityType.IsOption());\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var optionSecurity = (Option)parameters.Portfolio.Securities[optionPosition.Symbol];\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                var absOptionQuantity = Math.Abs(optionPosition.Quantity);\n                var outOfTheMoneyAmount = optionSecurity.OutOfTheMoneyAmount(underlyingSecurity.Price) * optionSecurity.ContractUnitOfTrade * absOptionQuantity;\n\n                var underlyingMarginRequired = Math.Abs(underlyingSecurity.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(\n                    underlyingSecurity, underlyingPosition.Quantity)));\n\n                var result = Math.Min(0.1m * optionSecurity.StrikePrice * optionSecurity.ContractUnitOfTrade * absOptionQuantity + outOfTheMoneyAmount, underlyingMarginRequired);\n                var inAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n\n                return new MaintenanceMargin(inAccountCurrency);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CoveredCall.Name)\n            {\n                // MAX[In-the-money amount + Margin(long stock evaluated at min(mark price, strike(short call))), min(stock value, max(call value, long stock margin))]\n                var optionPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => position.Symbol.SecurityType.IsOption());\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var optionSecurity = (Option)parameters.Portfolio.Securities[optionPosition.Symbol];\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                var intrinsicValue = optionSecurity.GetIntrinsicValue(underlyingSecurity.Price);\n                var inTheMoneyAmount = intrinsicValue * optionSecurity.ContractUnitOfTrade * Math.Abs(optionPosition.Quantity);\n\n                var underlyingValue = underlyingSecurity.Holdings.GetQuantityValue(underlyingPosition.Quantity).InAccountCurrency;\n                var optionValue = optionSecurity.Holdings.GetQuantityValue(optionPosition.Quantity).InAccountCurrency;\n\n                // mark price, strike price\n                var underlyingPriceToEvaluate = Math.Min(underlyingSecurity.Price, optionSecurity.ScaledStrikePrice);\n                var underlyingHypotheticalValue = underlyingSecurity.Holdings.GetQuantityValue(underlyingPosition.Quantity, underlyingPriceToEvaluate).InAccountCurrency;\n\n                var hypotheticalMarginRequired = underlyingSecurity.BuyingPowerModel.GetMaintenanceMargin(\n                        new MaintenanceMarginParameters(underlyingSecurity, underlyingPosition.Quantity, 0, underlyingHypotheticalValue));\n                var marginRequired = underlyingSecurity.BuyingPowerModel.GetMaintenanceMargin(\n                    new MaintenanceMarginParameters(underlyingSecurity, underlyingPosition.Quantity, 0, underlyingValue));\n\n                var secondOperand = Math.Min(underlyingValue, Math.Max(optionValue, marginRequired));\n                var result = Math.Max(inTheMoneyAmount + hypotheticalMarginRequired, secondOperand);\n                var inAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n\n                return new MaintenanceMargin(inAccountCurrency);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CoveredPut.Name)\n            {\n                // Initial Stock Margin Requirement + In the Money Amount\n                var optionPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => position.Symbol.SecurityType.IsOption());\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var optionSecurity = (Option)parameters.Portfolio.Securities[optionPosition.Symbol];\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                var intrinsicValue = optionSecurity.GetIntrinsicValue(underlyingSecurity.Price);\n                var inTheMoneyAmount = intrinsicValue * optionSecurity.ContractUnitOfTrade * Math.Abs(optionPosition.Quantity);\n\n                var initialMarginRequirement = underlyingSecurity.BuyingPowerModel.GetInitialMarginRequirement(underlyingSecurity, underlyingPosition.Quantity);\n\n                var result = Math.Abs(initialMarginRequirement) + inTheMoneyAmount;\n                var inAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n\n                return new MaintenanceMargin(inAccountCurrency);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ProtectiveCollar.Name)\n            {\n                // Minimum (((10% * Put Strike Price) + Put Out of the Money Amount), (25% * Call Strike Price))\n                var putPosition = parameters.PositionGroup.Positions.Single(position =>\n                    position.Symbol.SecurityType.IsOption() && position.Symbol.ID.OptionRight == OptionRight.Put);\n                var callPosition = parameters.PositionGroup.Positions.Single(position =>\n                    position.Symbol.SecurityType.IsOption() && position.Symbol.ID.OptionRight == OptionRight.Call);\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var putSecurity = (Option)parameters.Portfolio.Securities[putPosition.Symbol];\n                var callSecurity = (Option)parameters.Portfolio.Securities[callPosition.Symbol];\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                var putMarginRequirement = 0.1m * putSecurity.StrikePrice + putSecurity.OutOfTheMoneyAmount(underlyingSecurity.Price);\n                var callMarginRequirement = 0.25m * callSecurity.StrikePrice;\n\n                // call and put has the exact same number of contracts\n                var contractUnits = Math.Abs(putPosition.Quantity) * putSecurity.ContractUnitOfTrade;\n                var result = Math.Min(putMarginRequirement, callMarginRequirement) * contractUnits;\n                var inAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, underlyingSecurity.QuoteCurrency.Symbol);\n\n                return new MaintenanceMargin(inAccountCurrency);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.Conversion.Name)\n            {\n                return GetConversionMaintenanceMargin(parameters.PositionGroup, parameters.Portfolio, OptionRight.Call);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ReverseConversion.Name)\n            {\n                return GetConversionMaintenanceMargin(parameters.PositionGroup, parameters.Portfolio, OptionRight.Put);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.NakedCall.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.NakedPut.Name)\n            {\n                var option = parameters.PositionGroup.Positions.Single();\n                var security = (Option)parameters.Portfolio.Securities[option.Symbol];\n                var margin = security.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(security,\n                    option.Quantity));\n\n                return new MaintenanceMargin(margin);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearCallSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.BullCallSpread.Name)\n            {\n                var result = GetLongCallShortCallStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CallCalendarSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.PutCalendarSpread.Name)\n            {\n                return new MaintenanceMargin(0);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortCallCalendarSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.ShortPutCalendarSpread.Name)\n            {\n                var shortCall = parameters.PositionGroup.Positions.Single(position => position.Quantity < 0);\n                var shortCallSecurity = (Option)parameters.Portfolio.Securities[shortCall.Symbol];\n                var result = shortCallSecurity.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(\n                    shortCallSecurity, shortCall.Quantity));\n\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearPutSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.BullPutSpread.Name)\n            {\n                var result = GetShortPutLongPutStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.Straddle.Name || _optionStrategy.Name == OptionStrategyDefinitions.Strangle.Name)\n            {\n                // Margined as two long options: since there is not margin requirements for long options, we return 0\n                return new MaintenanceMargin(0);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortStraddle.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortStrangle.Name)\n            {\n                var result = GetShortStraddleStrangleMargin(parameters.PositionGroup, parameters.Portfolio,\n                    (option, quantity) => Math.Abs(option.BuyingPowerModel.GetMaintenanceMargin(\n                        MaintenanceMarginParameters.ForQuantityAtCurrentPrice(option, quantity))));\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ButterflyCall.Name || _optionStrategy.Name == OptionStrategyDefinitions.ButterflyPut.Name)\n            {\n                return new MaintenanceMargin(0);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortButterflyPut.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortButterflyCall.Name)\n            {\n                var result = GetMiddleAndLowStrikeDifference(parameters.PositionGroup, parameters.Portfolio);\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.IronCondor.Name || _optionStrategy.Name == OptionStrategyDefinitions.IronButterfly.Name ||\n                _optionStrategy.Name == OptionStrategyDefinitions.ShortIronCondor.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortIronButterfly.Name)\n            {\n                var result = GetShortPutLongPutStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BoxSpread.Name)\n            {\n                return new MaintenanceMargin(0);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortBoxSpread.Name)\n            {\n                // MAX(1.02 x cost to close, Long Call Strike – Short Call Strike)\n                var longCallPosition = parameters.PositionGroup.Positions.Single(\n                    position => position.Quantity > 0 && position.Symbol.ID.OptionRight == OptionRight.Call);\n                var shortCallPosition = parameters.PositionGroup.Positions.Single(\n                    position => position.Quantity < 0 && position.Symbol.ID.OptionRight == OptionRight.Call);\n                var longPutPosition = parameters.PositionGroup.Positions.Single(\n                    position => position.Quantity > 0 && position.Symbol.ID.OptionRight == OptionRight.Put);\n                var shortPutPosition = parameters.PositionGroup.Positions.Single(\n                    position => position.Quantity < 0 && position.Symbol.ID.OptionRight == OptionRight.Put);\n                var longCallSecurity = (Option)parameters.Portfolio.Securities[longCallPosition.Symbol];\n                var shortCallSecurity = (Option)parameters.Portfolio.Securities[shortCallPosition.Symbol];\n                var longPutSecurity = (Option)parameters.Portfolio.Securities[longPutPosition.Symbol];\n                var shortPutSecurity = (Option)parameters.Portfolio.Securities[shortPutPosition.Symbol];\n\n                // commission cost: MAX($1, $0.65/contract * quantity) + bid/ask price\n                var commissionFees = Math.Max(Math.Abs(longCallPosition.Quantity) * 0.65m, 1m) * 4m;    // 4 contracts in total\n                var orderCosts = shortCallSecurity.AskPrice - longCallSecurity.BidPrice + shortPutSecurity.AskPrice - longPutSecurity.BidPrice;\n                var multiplier = Math.Abs(longCallPosition.Quantity) * longCallSecurity.ContractUnitOfTrade;\n                var closeCost = commissionFees + orderCosts * multiplier;\n\n                var strikeDifference = longCallPosition.Symbol.ID.StrikePrice - shortCallPosition.Symbol.ID.StrikePrice;\n\n                var result = Math.Max(1.02m * closeCost, strikeDifference * multiplier);\n                var inAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, longCallSecurity.QuoteCurrency.Symbol);\n\n                return new MaintenanceMargin(inAccountCurrency);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.JellyRoll.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.ShortJellyRoll.Name)\n            {\n                // long calendar spread part has no margin requirement due to same strike\n                // only the short calendar spread's short option has margin requirement\n                var furtherExpiry = parameters.PositionGroup.Positions.Max(position => position.Symbol.ID.Date);\n                var shortCalendarSpreadShortLeg = parameters.PositionGroup.Positions.Single(position =>\n                    position.Quantity < 0 && position.Symbol.ID.Date == furtherExpiry);\n                var shortCalendarSpreadShortLegSecurity = (Option)parameters.Portfolio.Securities[shortCalendarSpreadShortLeg.Symbol];\n                var result = Math.Abs(shortCalendarSpreadShortLegSecurity.BuyingPowerModel.GetMaintenanceMargin(\n                    MaintenanceMarginParameters.ForQuantityAtCurrentPrice(shortCalendarSpreadShortLegSecurity, shortCalendarSpreadShortLeg.Quantity)));\n\n                return new MaintenanceMargin(result);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearCallLadder.Name)\n            {\n                return GetCallLadderMargin(parameters, true);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearPutLadder.Name)\n            {\n                return GetPutLadderMargin(parameters, false);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BullCallLadder.Name)\n            {\n                return GetCallLadderMargin(parameters, false);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BullPutLadder.Name)\n            {\n                return GetPutLadderMargin(parameters, true);\n            }\n\n            throw new NotImplementedException($\"Option strategy {_optionStrategy.Name} margin modeling has yet to be implemented\");\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        public override InitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters)\n        {\n            var result = 0m;\n\n            if (_optionStrategy == null)\n            {\n                result = 0;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ProtectivePut.Name || _optionStrategy.Name == OptionStrategyDefinitions.ProtectiveCall.Name)\n            {\n                // \tInitial Standard Stock Margin Requirement\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                result = Math.Abs(underlyingSecurity.BuyingPowerModel.GetInitialMarginRequirement(underlyingSecurity, underlyingPosition.Quantity));\n                result = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, underlyingSecurity.QuoteCurrency.Symbol);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CoveredCall.Name)\n            {\n                // Max(Call Value, Long Stock Initial Margin)\n                var optionPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => position.Symbol.SecurityType.IsOption());\n                var underlyingPosition = parameters.PositionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n                var optionSecurity = (Option)parameters.Portfolio.Securities[optionPosition.Symbol];\n                var underlyingSecurity = parameters.Portfolio.Securities[underlyingPosition.Symbol];\n\n                var optionValue = Math.Abs(optionSecurity.Holdings.GetQuantityValue(optionPosition.Quantity).InAccountCurrency);\n\n                var marginRequired = underlyingSecurity.BuyingPowerModel.GetInitialMarginRequirement(underlyingSecurity, underlyingPosition.Quantity);\n\n                // IB charges more than expected, this formula was inferred based on actual requirements see 'CoveredCallInitialMarginRequirementsTestCases'\n                result = optionValue * 0.8m + marginRequired;\n                result = parameters.Portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CoveredPut.Name)\n            {\n                // Initial Stock Margin Requirement + In the Money Amount\n                result = GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(parameters.Portfolio, parameters.PositionGroup));\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ProtectiveCollar.Name || _optionStrategy.Name == OptionStrategyDefinitions.Conversion.Name)\n            {\n                result = GetCollarConversionInitialMargin(parameters.PositionGroup, parameters.Portfolio, OptionRight.Call);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ReverseConversion.Name)\n            {\n                result = GetCollarConversionInitialMargin(parameters.PositionGroup, parameters.Portfolio, OptionRight.Put);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.NakedCall.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.NakedPut.Name)\n            {\n                var option = parameters.PositionGroup.Positions.Single();\n                var security = (Option)parameters.Portfolio.Securities[option.Symbol];\n                var margin = security.BuyingPowerModel.GetInitialMarginRequirement(new InitialMarginParameters(security, option.Quantity));\n                var optionMargin = margin as OptionInitialMargin;\n\n                if (optionMargin != null)\n                {\n                    return new OptionInitialMargin(Math.Abs(optionMargin.ValueWithoutPremium), optionMargin.Premium);\n                }\n\n                return margin;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearCallSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.BullCallSpread.Name)\n            {\n                result = GetLongCallShortCallStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.CallCalendarSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.PutCalendarSpread.Name)\n            {\n                result = 0m;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortCallCalendarSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.ShortPutCalendarSpread.Name)\n            {\n                var shortOptionPosition = parameters.PositionGroup.Positions.Single(position => position.Quantity < 0);\n                var shortOption = (Option)parameters.Portfolio.Securities[shortOptionPosition.Symbol];\n                result = Math.Abs(shortOption.BuyingPowerModel.GetInitialMarginRequirement(shortOption, shortOptionPosition.Quantity));\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearPutSpread.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.BullPutSpread.Name)\n            {\n                result = GetShortPutLongPutStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.Straddle.Name || _optionStrategy.Name == OptionStrategyDefinitions.Strangle.Name)\n            {\n                // Margined as two long options: since there is not margin requirements for long options, we return 0\n                result = 0m;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortStraddle.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortStrangle.Name)\n            {\n                result = GetShortStraddleStrangleMargin(parameters.PositionGroup, parameters.Portfolio,\n                    (option, quantity) => Math.Abs(option.BuyingPowerModel.GetInitialMarginRequirement(option, quantity)));\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ButterflyCall.Name || _optionStrategy.Name == OptionStrategyDefinitions.ButterflyPut.Name)\n            {\n                result = 0m;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortButterflyPut.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortButterflyCall.Name)\n            {\n                result = GetMiddleAndLowStrikeDifference(parameters.PositionGroup, parameters.Portfolio);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.IronCondor.Name || _optionStrategy.Name == OptionStrategyDefinitions.IronButterfly.Name ||\n                _optionStrategy.Name == OptionStrategyDefinitions.ShortIronCondor.Name || _optionStrategy.Name == OptionStrategyDefinitions.ShortIronButterfly.Name)\n            {\n                result = GetShortPutLongPutStrikeDifferenceMargin(parameters.PositionGroup.Positions, parameters.Portfolio, parameters.PositionGroup.Quantity);\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BoxSpread.Name)\n            {\n                result = 0m;\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.ShortBoxSpread.Name)\n            {\n                result = GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(parameters.Portfolio, parameters.PositionGroup));\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.JellyRoll.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.ShortJellyRoll.Name)\n            {\n                result = GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(parameters.Portfolio, parameters.PositionGroup));\n            }\n            else if (_optionStrategy.Name == OptionStrategyDefinitions.BearCallLadder.Name || _optionStrategy.Name == OptionStrategyDefinitions.BearPutLadder.Name\n                || _optionStrategy.Name == OptionStrategyDefinitions.BullCallLadder.Name || _optionStrategy.Name == OptionStrategyDefinitions.BullPutLadder.Name)\n            {\n                result = GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(parameters.Portfolio, parameters.PositionGroup));\n            }\n            else\n            {\n                throw new NotImplementedException($\"Option strategy {_optionStrategy.Name} margin modeling has yet to be implemented\");\n            }\n\n            // Add premium to initial margin only when it is positive (the user must pay the premium)\n            var premium = 0m;\n            foreach (var position in parameters.PositionGroup.Positions.Where(position => position.Symbol.SecurityType.IsOption()))\n            {\n                var option = (Option)parameters.Portfolio.Securities[position.Symbol];\n                premium += option.Holdings.GetQuantityValue(position.Quantity).InAccountCurrency;\n            }\n\n            return new OptionInitialMargin(result, premium);\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public override InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInitialMarginForOrderParameters parameters)\n        {\n            var security = parameters.Portfolio.Securities[parameters.Order.Symbol];\n            var fees = security.FeeModel.GetOrderFee(new OrderFeeParameters(security, parameters.Order));\n            var feesInAccountCurrency = parameters.Portfolio.CashBook.ConvertToAccountCurrency(fees.Value);\n\n            var initialMarginRequired = GetInitialMarginRequirement(new PositionGroupInitialMarginParameters(parameters.Portfolio, parameters.PositionGroup));\n\n            var feesWithSign = Math.Sign(initialMarginRequired) * feesInAccountCurrency.Amount;\n\n            return new InitialMargin(feesWithSign + initialMarginRequired);\n        }\n\n        /// <summary>\n        /// Gets the initial margin required for the specified contemplated position group.\n        /// Used by <see cref=\"QuantConnect.Securities.Positions.PositionGroupBuyingPowerModel.GetReservedBuyingPowerImpact\"/> to get the contemplated groups margin.\n        /// </summary>\n        protected override decimal GetContemplatedGroupsInitialMargin(SecurityPortfolioManager portfolio, PositionGroupCollection contemplatedGroups,\n            List<IPosition> ordersPositions)\n        {\n            var contemplatedMargin = 0m;\n            foreach (var contemplatedGroup in contemplatedGroups)\n            {\n                // We use the initial margin requirement as the contemplated groups margin in order to ensure\n                // the available buying power is enough to execute the order.\n                var initialMargin = contemplatedGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                    new PositionGroupInitialMarginParameters(portfolio, contemplatedGroup));\n                var optionInitialMargin = initialMargin as OptionInitialMargin;\n                contemplatedMargin += optionInitialMargin?.ValueWithoutPremium ?? initialMargin;\n            }\n\n            // Now we need to add the premium paid for the order:\n            // This should always return a single group since it is a single order/combo\n            var ordersGroups = portfolio.Positions.ResolvePositionGroups(new PositionCollection(ordersPositions));\n            foreach (var orderGroup in ordersGroups)\n            {\n                var initialMargin = orderGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                    new PositionGroupInitialMarginParameters(portfolio, orderGroup));\n                var optionInitialMargin = initialMargin as OptionInitialMargin;\n\n                if (optionInitialMargin != null)\n                {\n                    // We need to add the premium paid for the order. We use the TotalValue-Value difference instead of Premium\n                    // to add it only when needed -- when it is debited from the account\n                    contemplatedMargin += optionInitialMargin.Value - optionInitialMargin.ValueWithoutPremium;\n                }\n            }\n\n            return contemplatedMargin;\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return _optionStrategy.Name;\n        }\n\n        /// <summary>\n        /// Returns the Maximum (Short Put Strike - Long Put Strike, 0)\n        /// </summary>\n        private static decimal GetShortPutLongPutStrikeDifferenceMargin(IEnumerable<IPosition> positions, SecurityPortfolioManager portfolio, decimal quantity)\n        {\n            var longOption = positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Put && position.Quantity > 0);\n            var shortOption = positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Put && position.Quantity < 0);\n            var optionSecurity = (Option)portfolio.Securities[longOption.Symbol];\n\n            // Maximum (Short Put Strike - Long Put Strike, 0)\n            var strikeDifference = shortOption.Symbol.ID.StrikePrice - longOption.Symbol.ID.StrikePrice;\n\n            var result = Math.Max(strikeDifference * optionSecurity.ContractUnitOfTrade * Math.Abs(quantity), 0);\n\n            // convert into account currency\n            return portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n        }\n\n        /// <summary>\n        /// Returns the Maximum (Strike Long Call - Strike Short Call, 0)\n        /// </summary>\n        private static decimal GetLongCallShortCallStrikeDifferenceMargin(IEnumerable<IPosition> positions, SecurityPortfolioManager portfolio, decimal quantity)\n        {\n            var longOption = positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Call && position.Quantity > 0);\n            var shortOption = positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Call && position.Quantity < 0);\n            var optionSecurity = (Option)portfolio.Securities[longOption.Symbol];\n\n            var strikeDifference = longOption.Symbol.ID.StrikePrice - shortOption.Symbol.ID.StrikePrice;\n\n            var result = Math.Max(strikeDifference * optionSecurity.ContractUnitOfTrade * Math.Abs(quantity), 0);\n\n            // convert into account currency\n            return portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n        }\n\n        /// <summary>\n        /// Returns the Maximum (Middle Strike - Lowest Strike, 0)\n        /// </summary>\n        private static decimal GetMiddleAndLowStrikeDifference(IPositionGroup positionGroup, SecurityPortfolioManager portfolio)\n        {\n            var options = positionGroup.Positions.OrderBy(position => position.Symbol.ID.StrikePrice).ToList();\n            var lowestCallStrike = options[0].Symbol.ID.StrikePrice;\n            var middleCallStrike = options[1].Symbol.ID.StrikePrice;\n            var optionSecurity = (Option)portfolio.Securities[options[0].Symbol];\n\n            var strikeDifference = Math.Max((middleCallStrike - lowestCallStrike) * optionSecurity.ContractUnitOfTrade * Math.Abs(positionGroup.Quantity), 0);\n\n            // convert into account currency\n            return portfolio.CashBook.ConvertToAccountCurrency(strikeDifference, optionSecurity.QuoteCurrency.Symbol);\n        }\n\n        /// <summary>\n        /// Returns the margin for a short straddle or strangle.\n        /// This is the same for both the initial margin requirement and the maintenance margin.\n        /// </summary>\n        private static decimal GetShortStraddleStrangleMargin(IPositionGroup positionGroup, SecurityPortfolioManager portfolio,\n            Func<Option, decimal, decimal> getOptionMargin)\n        {\n            var callOption = positionGroup.Positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Call);\n            var callSecurity = (Option)portfolio.Securities[callOption.Symbol];\n            var callMargin = getOptionMargin(callSecurity, callOption.Quantity);\n\n            var putOption = positionGroup.Positions.Single(position => position.Symbol.ID.OptionRight == OptionRight.Put);\n            var putSecurity = (Option)portfolio.Securities[putOption.Symbol];\n            var putMargin = getOptionMargin(putSecurity, putOption.Quantity);\n\n            var result = 0m;\n\n            if (putMargin > callMargin)\n            {\n                result = putMargin + callSecurity.Price * callSecurity.ContractUnitOfTrade * Math.Abs(callOption.Quantity);\n            }\n            else\n            {\n                result = callMargin + putSecurity.Price * putSecurity.ContractUnitOfTrade * Math.Abs(putOption.Quantity);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Returns the maintenance margin for a conversion or reverse conversion.\n        /// </summary>\n        private static decimal GetConversionMaintenanceMargin(IPositionGroup positionGroup, SecurityPortfolioManager portfolio, OptionRight optionRight)\n        {\n            // 10% * Strike Price + Call/Put In the Money Amount\n            var optionPosition = positionGroup.Positions.Single(position =>\n                position.Symbol.SecurityType.IsOption() && position.Symbol.ID.OptionRight == optionRight);\n            var underlyingPosition = positionGroup.Positions.FirstOrDefault(position => !position.Symbol.SecurityType.IsOption());\n            var optionSecurity = (Option)portfolio.Securities[optionPosition.Symbol];\n            var underlyingSecurity = portfolio.Securities[underlyingPosition.Symbol];\n\n            var marginRequirement = 0.1m * optionSecurity.StrikePrice + optionSecurity.GetIntrinsicValue(underlyingSecurity.Price);\n            var result = marginRequirement * Math.Abs(optionPosition.Quantity) * optionSecurity.ContractUnitOfTrade;\n            var inAccountCurrency = portfolio.CashBook.ConvertToAccountCurrency(result, underlyingSecurity.QuoteCurrency.Symbol);\n\n            return new MaintenanceMargin(inAccountCurrency);\n        }\n\n        /// <summary>\n        /// Returns the initial margin requirement for a collar, conversion, or reverse conversion.\n        /// </summary>\n        private static decimal GetCollarConversionInitialMargin(IPositionGroup positionGroup, SecurityPortfolioManager portfolio, OptionRight optionRight)\n        {\n            // Initial Stock Margin Requirement + In the Money Call/Put Amount\n            var optionPosition = positionGroup.Positions.Single(position =>\n                position.Symbol.SecurityType.IsOption() && position.Symbol.ID.OptionRight == optionRight);\n            var underlyingPosition = positionGroup.Positions.Single(position => !position.Symbol.SecurityType.IsOption());\n            var optionSecurity = (Option)portfolio.Securities[optionPosition.Symbol];\n            var underlyingSecurity = portfolio.Securities[underlyingPosition.Symbol];\n\n            var intrinsicValue = optionSecurity.GetIntrinsicValue(underlyingSecurity.Price);\n            var inTheMoneyAmount = intrinsicValue * optionSecurity.ContractUnitOfTrade * Math.Abs(optionPosition.Quantity);\n\n            var initialMarginRequirement = underlyingSecurity.BuyingPowerModel.GetInitialMarginRequirement(underlyingSecurity, underlyingPosition.Quantity);\n\n            var result = Math.Abs(initialMarginRequirement) + inTheMoneyAmount;\n            return portfolio.CashBook.ConvertToAccountCurrency(result, optionSecurity.QuoteCurrency.Symbol);\n        }\n\n        /// <summary>\n        /// Returns the initial/maintenance margin requirement for a call ladder\n        /// </summary>\n        private static decimal GetCallLadderMargin(PositionGroupMaintenanceMarginParameters parameters, bool bearCallLadder)\n        {\n            var quantity = parameters.PositionGroup.Quantity;\n\n            if ((quantity >= 0 && bearCallLadder) || (quantity < 0 && !bearCallLadder))\n            {\n                // Bear Call Ladder = Bear Call Spread of 2 lower strike prices + Long Call with the highest strike price (margin: 0)\n                var callSpread = parameters.PositionGroup.Positions.OrderBy(position => position.Symbol.ID.StrikePrice).Take(2).ToList();\n                return GetLongCallShortCallStrikeDifferenceMargin(callSpread, parameters.Portfolio, Math.Abs(quantity));\n            }\n            else\n            {\n                // Bull Call Ladder = Bull Call Spread of 2 lower strike prices (margin: 0) + Short Call with the highest strike price\n                var shortNakedCall = parameters.PositionGroup.Positions.OrderByDescending(position => position.Symbol.ID.StrikePrice).First();\n                var security = (Option)parameters.Portfolio.Securities[shortNakedCall.Symbol];\n                var margin = security.BuyingPowerModel.GetInitialMarginRequirement(new InitialMarginParameters(security, shortNakedCall.Quantity));\n                return new MaintenanceMargin(Math.Abs(margin));\n            }\n        }\n\n        /// <summary>\n        /// Returns the initial/maintenance margin requirement for a put ladder\n        /// </summary>\n        private static decimal GetPutLadderMargin(PositionGroupMaintenanceMarginParameters parameters, bool bullPutLadder)\n        {\n            var quantity = parameters.PositionGroup.Quantity;\n\n            if ((quantity >= 0 && bullPutLadder) || (quantity < 0 && !bullPutLadder))\n            {\n                // Bull Put Ladder = Bull Put Spread of 2 higher strike prices + Long Put with the lowest strike price (margin: 0)\n                var putSpread = parameters.PositionGroup.Positions.OrderByDescending(position => position.Symbol.ID.StrikePrice).Take(2).ToList();\n                return GetShortPutLongPutStrikeDifferenceMargin(putSpread, parameters.Portfolio, Math.Abs(quantity));\n            }\n            else\n            {\n                // Bear Put Ladder = Bear Put Spread of 2 higher strike prices (margin: 0) + Short Put with the lowest strike price\n                var shortNakedPut = parameters.PositionGroup.Positions.OrderBy(position => position.Symbol.ID.StrikePrice).First();\n                var security = (Option)parameters.Portfolio.Securities[shortNakedPut.Symbol];\n                var margin = security.BuyingPowerModel.GetInitialMarginRequirement(new InitialMarginParameters(security, shortNakedPut.Quantity));\n                return new MaintenanceMargin(Math.Abs(margin));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionSymbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.IndexOption;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Static class contains common utility methods specific to symbols representing the option contracts\n    /// </summary>\n    public static class OptionSymbol\n    {\n        private static readonly Dictionary<string, byte> _optionExpirationErrorLog = new();\n\n        /// <summary>\n        /// Returns true if the option is a standard contract that expires 3rd Friday of the month\n        /// </summary>\n        /// <param name=\"symbol\">Option symbol</param>\n        /// <returns></returns>\n        public static bool IsStandardContract(Symbol symbol)\n        {\n            return IsStandard(symbol);\n        }\n\n        /// <summary>\n        /// Returns true if the option is a standard contract that expires 3rd Friday of the month\n        /// </summary>\n        /// <param name=\"symbol\">Option symbol</param>\n        /// <returns></returns>\n        public static bool IsStandard(Symbol symbol)\n        {\n            var date = symbol.ID.Date;\n\n            // first we find out the day of week of the first day in the month\n            var firstDayOfMonth = new DateTime(date.Year, date.Month, 1).DayOfWeek;\n\n            // find out the day of first Friday in this month\n            var firstFriday = firstDayOfMonth == DayOfWeek.Saturday ? 7 : 6 - (int)firstDayOfMonth;\n\n            // check if the expiration date is within the week containing 3rd Friday\n            // we exclude monday, wednesday, and friday weeklys\n            return firstFriday + 7 + 5 /*sat -> wed */ < date.Day && date.Day < firstFriday + 2 * 7 + 2 /* sat, sun*/;\n        }\n\n        /// <summary>\n        /// Returns true if the option is a weekly contract that expires on Friday , except 3rd Friday of the month\n        /// </summary>\n        /// <param name=\"symbol\">Option symbol</param>\n        /// <returns></returns>\n        public static bool IsWeekly(Symbol symbol)\n        {\n            return !IsStandard(symbol) && symbol.ID.Date.DayOfWeek == DayOfWeek.Friday;\n        }\n\n        /// <summary>\n        /// Maps the option ticker to it's underlying\n        /// </summary>\n        /// <param name=\"optionTicker\">The option ticker to map</param>\n        /// <param name=\"securityType\">The security type of the option or underlying</param>\n        /// <returns>The underlying ticker</returns>\n        public static string MapToUnderlying(string optionTicker, SecurityType securityType)\n        {\n            if(securityType == SecurityType.FutureOption || securityType == SecurityType.Future)\n            {\n                return FuturesOptionsSymbolMappings.MapFromOption(optionTicker);\n            }\n            else if (securityType == SecurityType.IndexOption || securityType == SecurityType.Index)\n            {\n                return IndexOptionSymbol.MapToUnderlying(optionTicker);\n            }\n\n            return optionTicker;\n        }\n\n        /// <summary>\n        /// Returns the last trading date for the option contract\n        /// </summary>\n        /// <param name=\"symbol\">Option symbol</param>\n        /// <returns></returns>\n        public static DateTime GetLastDayOfTrading(Symbol symbol)\n        {\n            // The OCC proposed rule change: starting from 1 Feb 2015 standard monthly contracts\n            // expire on 3rd Friday, not Saturday following 3rd Friday as it was before.\n            // More details: https://www.sec.gov/rules/sro/occ/2013/34-69480.pdf\n\n            int daysBefore = 0;\n            var symbolDateTime = symbol.ID.Date;\n\n            if (IsStandard(symbol) &&\n                symbolDateTime.DayOfWeek == DayOfWeek.Saturday &&\n                symbolDateTime < new DateTime(2015, 2, 1))\n            {\n                daysBefore--;\n            }\n\n            var exchangeHours = MarketHoursDatabase.FromDataFolder()\n                                              .GetEntry(symbol.ID.Market, symbol, symbol.SecurityType)\n                                              .ExchangeHours;\n\n            while (!exchangeHours.IsDateOpen(symbolDateTime.AddDays(daysBefore)))\n            {\n                daysBefore--;\n            }\n\n            return symbolDateTime.AddDays(daysBefore).Date;\n        }\n\n        /// <summary>\n        /// Returns the settlement date time of the option contract.\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <returns>The settlement date time</returns>\n        public static DateTime GetSettlementDateTime(Symbol symbol)\n        {\n            if (!TryGetExpirationDateTime(symbol, out var expiryTime, out var exchangeHours))\n            {\n                throw new ArgumentException($\"The symbol {symbol} is not an option type\");\n            }\n\n            // Standard index options are AM-settled, which means they settle on market open of the expiration date\n            if (expiryTime.Date == symbol.ID.Date.Date && symbol.SecurityType == SecurityType.IndexOption && IsStandard(symbol))\n            {\n                expiryTime = exchangeHours.GetNextMarketOpen(expiryTime.Date, false);\n            }\n\n            return expiryTime;\n        }\n\n        /// <summary>\n        /// Returns true if the option contract is expired at the specified time\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <param name=\"currentTimeUtc\">The current time (UTC)</param>\n        /// <returns>True if the option contract is expired at the specified time, false otherwise</returns>\n        public static bool IsOptionContractExpired(Symbol symbol, DateTime currentTimeUtc)\n        {\n            if (TryGetExpirationDateTime(symbol, out var expiryTime, out var exchangeHours))\n            {\n                var currentTime = currentTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);\n                return currentTime >= expiryTime;\n            }\n\n            return false;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static bool TryGetExpirationDateTime(Symbol symbol, out DateTime expiryTime, out SecurityExchangeHours exchangeHours)\n        {\n            if (!symbol.SecurityType.IsOption())\n            {\n                expiryTime = default;\n                exchangeHours = null;\n                return false;\n            }\n\n            exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            // Ideally we can calculate expiry on the date of the symbol ID, but if that exchange is not open on that day we\n            // will consider expired on the last trading day close before this; Example in AddOptionContractExpiresRegressionAlgorithm\n            var lastTradingDay = exchangeHours.IsDateOpen(symbol.ID.Date)\n                ? symbol.ID.Date\n                : exchangeHours.GetPreviousTradingDay(symbol.ID.Date);\n\n            expiryTime = exchangeHours.GetLastDailyMarketClose(lastTradingDay, false);\n\n            // Once bug 6189 was solved in ´GetNextMarketClose()´ there was found possible bugs on some futures symbol.ID.Date or delisting/liquidation handle event.\n            // Specifically see 'DelistingFutureOptionRegressionAlgorithm' where Symbol.ID.Date: 4/1/2012 00:00 ExpiryTime: 4/2/2012 16:00 for Milk 3 futures options.\n            // See 'bug-milk-class-3-future-options-expiration' branch. So let's limit the expiry time to up to end of day of expiration\n            if (expiryTime >= symbol.ID.Date.AddDays(1).Date)\n            {\n                lock (_optionExpirationErrorLog)\n                {\n                    if (symbol.ID.Underlying != null\n                        // let's log this once per underlying and expiration date: avoiding the same log for multiple option contracts with different strikes/rights\n                        && _optionExpirationErrorLog.TryAdd($\"{symbol.ID.Underlying}-{symbol.ID.Date}\", 1))\n                    {\n                        Logging.Log.Error($\"OptionSymbol.IsOptionContractExpired(): limiting unexpected option expiration time for symbol {symbol.ID}. Symbol.ID.Date {symbol.ID.Date}. ExpiryTime: {expiryTime}\");\n                    }\n                }\n                expiryTime = symbol.ID.Date.AddDays(1).Date;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/OptionSymbolProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Represents common properties for a specific option contract\n    /// </summary>\n    public class OptionSymbolProperties : SymbolProperties\n    {\n        /// <summary>\n        /// The contract multiplier for the security.\n        /// </summary>\n        /// <remarks>\n        /// If manually set by a consumer, this value will be used instead of the\n        /// <see cref=\"SymbolProperties.ContractMultiplier\"/> and also allows to make\n        /// sure it is not overridden when the symbol properties database gets updated.\n        /// </remarks>\n        private decimal? _contractMultiplier;\n\n        /// <summary>\n        /// The contract multiplier for the security\n        /// </summary>\n        public override decimal ContractMultiplier => _contractMultiplier ?? base.ContractMultiplier;\n\n        /// <summary>\n        /// When the holder of an equity option exercises one contract, or when the writer of an equity option is assigned\n        /// an exercise notice on one contract, this unit of trade, usually 100 shares of the underlying security, changes hands.\n        /// </summary>\n        public int ContractUnitOfTrade\n        {\n            get; protected set;\n        }\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"OptionSymbolProperties\"/> class\n        /// </summary>\n        public OptionSymbolProperties(string description, string quoteCurrency, decimal contractMultiplier, decimal pipSize, decimal lotSize)\n            : this(new SymbolProperties(description, quoteCurrency, contractMultiplier, pipSize, lotSize, string.Empty))\n        {\n        }\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"OptionSymbolProperties\"/> class from <see cref=\"SymbolProperties\"/> class\n        /// </summary>\n        public OptionSymbolProperties(SymbolProperties properties)\n            : base(properties)\n        {\n            ContractUnitOfTrade = (int)properties.ContractMultiplier;\n        }\n\n        internal void SetContractUnitOfTrade(int unitOfTrade)\n        {\n            ContractUnitOfTrade = unitOfTrade;\n        }\n\n        internal void SetContractMultiplier(decimal multiplier)\n        {\n            _contractMultiplier = multiplier;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/QLOptionPriceModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QLNet;\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option\n{\n    using PricingEngineFunc = Func<GeneralizedBlackScholesProcess, IPricingEngine>;\n    using PricingEngineFuncEx = Func<Symbol, GeneralizedBlackScholesProcess, IPricingEngine>;\n\n    /// <summary>\n    /// Provides QuantLib(QL) implementation of <see cref=\"IOptionPriceModel\"/> to support major option pricing models, available in QL.\n    /// </summary>\n    public class QLOptionPriceModel : OptionPriceModel\n    {\n        private static readonly OptionStyle[] _defaultAllowedOptionStyles = { OptionStyle.European, OptionStyle.American };\n        private static readonly IQLUnderlyingVolatilityEstimator _defaultUnderlyingVolEstimator = new ConstantQLUnderlyingVolatilityEstimator();\n        private static readonly IQLRiskFreeRateEstimator _defaultRiskFreeRateEstimator = new FedRateQLRiskFreeRateEstimator();\n        private static readonly IQLDividendYieldEstimator _defaultDividendYieldEstimator = new ConstantQLDividendYieldEstimator();\n\n        private readonly IQLUnderlyingVolatilityEstimator _underlyingVolEstimator;\n        private readonly IQLDividendYieldEstimator _dividendYieldEstimator;\n        private readonly IQLRiskFreeRateEstimator _riskFreeRateEstimator;\n        private readonly PricingEngineFuncEx _pricingEngineFunc;\n\n        /// <summary>\n        /// When enabled, approximates Greeks if corresponding pricing model didn't calculate exact numbers.\n        /// The default value is true.\n        /// </summary>\n        public bool EnableGreekApproximation { get; set; } = true;\n\n        /// <summary>\n        /// True if volatility model is warmed up, i.e. has generated volatility value different from zero, otherwise false.\n        /// </summary>\n        public bool VolatilityEstimatorWarmedUp => _underlyingVolEstimator.IsReady;\n\n        /// <summary>\n        /// List of option styles supported by the pricing model.\n        /// By default, both American and European option styles are supported.\n        /// </summary>\n        public IReadOnlyCollection<OptionStyle> AllowedOptionStyles { get; }\n\n        /// <summary>\n        /// Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield\n        /// </summary>\n        /// <param name=\"pricingEngineFunc\">Function modeled stochastic process, and returns new pricing engine to run calculations for that option</param>\n        /// <param name=\"underlyingVolEstimator\">The underlying volatility estimator</param>\n        /// <param name=\"riskFreeRateEstimator\">The risk free rate estimator</param>\n        /// <param name=\"dividendYieldEstimator\">The underlying dividend yield estimator</param>\n        /// <param name=\"allowedOptionStyles\">List of option styles supported by the pricing model. It defaults to both American and European option styles</param>\n        public QLOptionPriceModel(PricingEngineFunc pricingEngineFunc,\n                                  IQLUnderlyingVolatilityEstimator underlyingVolEstimator = null,\n                                  IQLRiskFreeRateEstimator riskFreeRateEstimator = null,\n                                  IQLDividendYieldEstimator dividendYieldEstimator = null,\n                                  OptionStyle[] allowedOptionStyles = null)\n            : this((option, process) => pricingEngineFunc(process), underlyingVolEstimator, riskFreeRateEstimator, dividendYieldEstimator, allowedOptionStyles)\n        { }\n        /// <summary>\n        /// Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield\n        /// </summary>\n        /// <param name=\"pricingEngineFunc\">Function takes option and modeled stochastic process, and returns new pricing engine to run calculations for that option</param>\n        /// <param name=\"underlyingVolEstimator\">The underlying volatility estimator</param>\n        /// <param name=\"riskFreeRateEstimator\">The risk free rate estimator</param>\n        /// <param name=\"dividendYieldEstimator\">The underlying dividend yield estimator</param>\n        /// <param name=\"allowedOptionStyles\">List of option styles supported by the pricing model. It defaults to both American and European option styles</param>\n        public QLOptionPriceModel(PricingEngineFuncEx pricingEngineFunc,\n                                  IQLUnderlyingVolatilityEstimator underlyingVolEstimator = null,\n                                  IQLRiskFreeRateEstimator riskFreeRateEstimator = null,\n                                  IQLDividendYieldEstimator dividendYieldEstimator = null,\n                                  OptionStyle[] allowedOptionStyles = null)\n        {\n            _pricingEngineFunc = pricingEngineFunc;\n            _underlyingVolEstimator = underlyingVolEstimator ?? _defaultUnderlyingVolEstimator;\n            _riskFreeRateEstimator = riskFreeRateEstimator ?? _defaultRiskFreeRateEstimator;\n            _dividendYieldEstimator = dividendYieldEstimator ?? _defaultDividendYieldEstimator;\n\n            AllowedOptionStyles = allowedOptionStyles ?? _defaultAllowedOptionStyles;\n        }\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"security\">The option security object</param>\n        /// <param name=\"slice\">The current data slice. This can be used to access other information\n        /// available to the algorithm</param>\n        /// <param name=\"contract\">The option contract to evaluate</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public override OptionPriceModelResult Evaluate(Security security, Slice slice, OptionContract contract)\n        {\n            if (!AllowedOptionStyles.Contains(contract.Symbol.ID.OptionStyle))\n            {\n                throw new ArgumentException($\"{contract.Symbol.ID.OptionStyle} style options are not supported by option price model '{this.GetType().Name}'\");\n            }\n\n            try\n            {\n                // expired options have no price\n                if (contract.Time.Date > contract.Expiry.Date)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"QLOptionPriceModel.Evaluate(). Expired {contract.Symbol}. Time > Expiry: {contract.Time.Date} > {contract.Expiry.Date}\");\n                    }\n                    return OptionPriceModelResult.None;\n                }\n\n                var dayCounter = new Actual365Fixed();\n                var securityExchangeHours = security.Exchange.Hours;\n                var maturityDate = AddDays(contract.Expiry.Date, Option.DefaultSettlementDays, securityExchangeHours);\n\n                // Get time until maturity (in year)\n                var maturity = dayCounter.yearFraction(contract.Time.Date, maturityDate);\n                if (maturity < 0)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"QLOptionPriceModel.Evaluate(). negative time ({maturity}) given for {contract.Symbol}. Time: {contract.Time.Date}. Maturity {maturityDate}\");\n                    }\n                    return OptionPriceModelResult.None;\n                }\n\n                // setting up option pricing parameters\n                var optionSecurity = (Option)security;\n                var premium = (double)optionSecurity.Price;\n                var spot = (double)optionSecurity.Underlying.Price;\n\n                if (spot <= 0d || premium <= 0d)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"QLOptionPriceModel.Evaluate(). Non-positive prices for {contract.Symbol}. Premium: {premium}. Underlying price {spot}\");\n                    }\n\n                    return OptionPriceModelResult.None;\n                }\n\n                var calendar = new UnitedStates();\n                var settlementDate = AddDays(contract.Time.Date, Option.DefaultSettlementDays, securityExchangeHours);\n                var underlyingQuoteValue = new SimpleQuote(spot);\n\n                var dividendYieldValue = new SimpleQuote(_dividendYieldEstimator.Estimate(security, slice, contract));\n                var dividendYield = new Handle<YieldTermStructure>(new FlatForward(0, calendar, dividendYieldValue, dayCounter));\n\n                var riskFreeRateValue = new SimpleQuote((double)_riskFreeRateEstimator.Estimate(security, slice, contract));\n                var riskFreeRate = new Handle<YieldTermStructure>(new FlatForward(0, calendar, riskFreeRateValue, dayCounter));\n\n                // Get discount factor by dividend and risk free rate using the maturity\n                var dividendDiscount = dividendYield.link.discount(maturity);\n                var riskFreeDiscount = riskFreeRate.link.discount(maturity);\n                var forwardPrice = spot * dividendDiscount / riskFreeDiscount;\n\n                // Initial guess for volatility by Brenner and Subrahmanyam (1988)\n                var initialGuess = Math.Sqrt(2 * Math.PI / maturity) * premium / spot;\n\n                var underlyingVolEstimate = _underlyingVolEstimator.Estimate(security, slice, contract);\n\n                // If the volatility estimator is not ready, we will use initial guess\n                if (!_underlyingVolEstimator.IsReady)\n                {\n                    underlyingVolEstimate = initialGuess;\n                }\n\n                var underlyingVolValue = new SimpleQuote(underlyingVolEstimate);\n                var underlyingVol = new Handle<BlackVolTermStructure>(new BlackConstantVol(0, calendar, new Handle<Quote>(underlyingVolValue), dayCounter));\n\n                // preparing stochastic process and payoff functions\n                var stochasticProcess = new BlackScholesMertonProcess(new Handle<Quote>(underlyingQuoteValue), dividendYield, riskFreeRate, underlyingVol);\n                var payoff = new PlainVanillaPayoff(contract.Right == OptionRight.Call ? QLNet.Option.Type.Call : QLNet.Option.Type.Put, (double)contract.Strike);\n\n                // creating option QL object\n                var option = contract.Symbol.ID.OptionStyle == OptionStyle.American ?\n                            new VanillaOption(payoff, new AmericanExercise(settlementDate, maturityDate)) :\n                            new VanillaOption(payoff, new EuropeanExercise(maturityDate));\n\n                // preparing pricing engine QL object\n                option.setPricingEngine(_pricingEngineFunc(contract.Symbol, stochasticProcess));\n\n                // Setting the evaluation date before running the calculations\n                var evaluationDate = contract.Time.Date;\n                SetEvaluationDate(evaluationDate);\n\n                // running calculations\n                var npv = EvaluateOption(option);\n\n                BlackCalculator blackCalculator = null;\n\n                // Calculate the Implied Volatility\n                var impliedVol = 0d;\n                try\n                {\n                    SetEvaluationDate(evaluationDate);\n                    impliedVol = option.impliedVolatility(premium, stochasticProcess);\n                }\n                catch (Exception e)\n                {\n                    // A Newton-Raphson optimization estimate of the implied volatility\n                    impliedVol = ImpliedVolatilityEstimation(premium, initialGuess, maturity, riskFreeDiscount, forwardPrice, payoff, out blackCalculator);\n                    if (Log.DebuggingEnabled)\n                    {\n                        var referenceDate = underlyingVol.link.referenceDate();\n                        Log.Debug($\"QLOptionPriceModel.Evaluate(). Cannot calculate Implied Volatility for {contract.Symbol}. Implied volatility from Newton-Raphson optimization: {impliedVol}. Premium: {premium}. Underlying price: {spot}. Initial guess volatility: {initialGuess}. Maturity: {maturity}. Risk Free: {riskFreeDiscount}. Forward price: {forwardPrice}. Data time: {evaluationDate}. Reference date: {referenceDate}. {e.Message} {e.StackTrace}\");\n                    }\n                }\n\n                // Update the Black Vol Term Structure with the Implied Volatility to improve Greek calculation\n                // We assume that the underlying volatility model does not yield a good estimate and \n                // other sources, e.g. Interactive Brokers, use the implied volatility to calculate the Greeks\n                // After this operation, the Theoretical Price (NPV) will match the Premium, so we do not re-evalute\n                // it and let users compare NPV and the Premium if they wish. \n                underlyingVolValue.setValue(impliedVol);\n\n                // function extracts QL greeks catching exception if greek is not generated by the pricing engine and reevaluates option to get numerical estimate of the seisitivity\n                decimal tryGetGreekOrReevaluate(Func<double> greek, Func<BlackCalculator, double> black)\n                {\n                    double result;\n                    var isApproximation = false;\n                    Exception exception = null;\n\n                    try\n                    {\n                        SetEvaluationDate(evaluationDate);\n                        result = greek();\n                    }\n                    catch (Exception err)\n                    {\n                        exception = err;\n\n                        if (!EnableGreekApproximation)\n                        {\n                            return 0.0m;\n                        }\n\n                        if (blackCalculator == null)\n                        {\n                            // Define Black Calculator to calculate Greeks that are not defined by the option object\n                            // Some models do not evaluate all greeks under some circumstances (e.g. low dividend yield)\n                            // We override this restriction to calculate the Greeks directly with the BlackCalculator\n                            var vol = underlyingVol.link.blackVol(maturityDate, (double)contract.Strike);\n                            blackCalculator = CreateBlackCalculator(forwardPrice, riskFreeDiscount, vol, payoff);\n                        }\n\n                        isApproximation = true;\n                        result = black(blackCalculator);\n                    }\n\n                    if (result.IsNaNOrInfinity())\n                    {\n                        if (Log.DebuggingEnabled)\n                        {\n                            var referenceDate = underlyingVol.link.referenceDate();\n                            Log.Debug($\"QLOptionPriceModel.Evaluate(). NaN or Infinity greek for {contract.Symbol}. Premium: {premium}. Underlying price: {spot}. Initial guess volatility: {initialGuess}. Maturity: {maturity}. Risk Free: {riskFreeDiscount}. Forward price: {forwardPrice}. Implied Volatility: {impliedVol}. Is Approximation? {isApproximation}. Data time: {evaluationDate}. Reference date: {referenceDate}. {exception?.Message} {exception?.StackTrace}\");\n                        }\n\n                        return 0m;\n                    }\n\n                    var value = result.SafeDecimalCast();\n\n                    if (value == decimal.Zero && Log.DebuggingEnabled)\n                    {\n                        var referenceDate = underlyingVol.link.referenceDate();\n                        Log.Debug($\"QLOptionPriceModel.Evaluate(). Zero-value greek for {contract.Symbol}. Premium: {premium}. Underlying price: {spot}. Initial guess volatility: {initialGuess}. Maturity: {maturity}. Risk Free: {riskFreeDiscount}. Forward price: {forwardPrice}. Implied Volatility: {impliedVol}. Is Approximation? {isApproximation}. Data time: {evaluationDate}. Reference date: {referenceDate}. {exception?.Message} {exception?.StackTrace}\");\n                        return value;\n                    }\n\n                    return value;\n                }\n\n                // producing output with lazy calculations of greeks\n                return new OptionPriceModelResult(npv,  // EvaluateOption ensure it is not NaN or Infinity\n                            () => impliedVol.IsNaNOrInfinity() ? 0m : impliedVol.SafeDecimalCast(),\n                            () => new ModeledGreeks(() => tryGetGreekOrReevaluate(() => option.delta(), (black) => black.delta(spot)),\n                                            () => tryGetGreekOrReevaluate(() => option.gamma(), (black) => black.gamma(spot)),\n                                            () => tryGetGreekOrReevaluate(() => option.vega(), (black) => black.vega(maturity)) / 100,   // per cent\n                                            () => tryGetGreekOrReevaluate(() => option.theta(), (black) => black.theta(spot, maturity)),\n                                            () => tryGetGreekOrReevaluate(() => option.rho(), (black) => black.rho(maturity)) / 100,        // per cent\n                                            () => tryGetGreekOrReevaluate(() => option.elasticity(), (black) => black.elasticity(spot))));\n            }\n            catch (Exception err)\n            {\n                Log.Debug($\"QLOptionPriceModel.Evaluate() error: {err.Message} {(Log.DebuggingEnabled ? err.StackTrace : string.Empty)} for {contract.Symbol}\");\n                return OptionPriceModelResult.None;\n            }\n        }\n\n        /// <summary>\n        /// Evaluates the specified option contract to compute a theoretical price, IV and greeks\n        /// </summary>\n        /// <param name=\"parameters\">A <see cref=\"OptionPriceModelParameters\"/> object\n        /// containing the security, slice and contract</param>\n        /// <returns>An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract</returns>\n        public override OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters)\n        {\n            return Evaluate(parameters.Security, parameters.Slice, parameters.Contract);\n        }\n\n        /// <summary>\n        /// Runs option evaluation and logs exceptions\n        /// </summary>\n        /// <param name=\"option\"></param>\n        /// <returns></returns>\n        private static decimal EvaluateOption(VanillaOption option)\n        {\n            try\n            {\n                var npv = option.NPV();\n\n                if (double.IsNaN(npv) ||\n                    double.IsInfinity(npv))\n                    return 0;\n\n                // can return negative value in neighborhood of 0\n                return Math.Max(0, npv).SafeDecimalCast();\n            }\n            catch (Exception err)\n            {\n                Log.Debug($\"QLOptionPriceModel.EvaluateOption() error: {err.Message}\");\n                return 0;\n            }\n        }\n\n        /// <summary>\n        /// An implied volatility approximation by Newton-Raphson method. Return 0 if result is not converged\n        /// </summary>\n        /// <remarks>\n        /// Orlando G, Taglialatela G. A review on implied volatility calculation. Journal of Computational and Applied Mathematics. 2017 Aug 15;320:202-20.\n        /// https://www.sciencedirect.com/science/article/pii/S0377042717300602\n        /// </remarks>\n        /// <param name=\"price\">current price of the option</param>\n        /// <param name=\"initialGuess\">initial guess of the IV</param>\n        /// <param name=\"timeTillExpiry\">time till option contract expiry</param>\n        /// <param name=\"riskFreeDiscount\">risk free rate discount factor</param>\n        /// <param name=\"forwardPrice\">future value of underlying price</param>\n        /// <param name=\"payoff\">payoff structure of the option contract</param>\n        /// <param name=\"black\">black calculator instance</param>\n        /// <returns>implied volatility estimation</returns>\n        protected double ImpliedVolatilityEstimation(double price, double initialGuess, double timeTillExpiry, double riskFreeDiscount,\n                                                     double forwardPrice, PlainVanillaPayoff payoff, out BlackCalculator black)\n        {\n            // Set up the optimizer\n            const double tolerance = 1e-3d;\n            const double lowerBound = 1e-7d;\n            const double upperBound = 4d;\n            var iterRemain = 10;\n            var error = double.MaxValue;\n            var impliedVolEstimate = initialGuess;\n\n            // Set up option calculator\n            black = CreateBlackCalculator(forwardPrice, riskFreeDiscount, initialGuess, payoff);\n\n            while (error > tolerance && iterRemain > 0)\n            {\n                var oldImpliedVol = impliedVolEstimate;\n\n                // Set up calculator by previous IV estimate to get new theoretical price, vega and IV\n                black = CreateBlackCalculator(forwardPrice, riskFreeDiscount, oldImpliedVol, payoff);\n                impliedVolEstimate -= (black.value() - price) / black.vega(timeTillExpiry);\n\n                if (impliedVolEstimate < lowerBound)\n                {\n                    impliedVolEstimate = lowerBound;\n                }\n                else if (impliedVolEstimate > upperBound)\n                {\n                    impliedVolEstimate = upperBound;\n                }\n\n                error = Math.Abs(impliedVolEstimate - oldImpliedVol) / impliedVolEstimate;\n                iterRemain--;\n            }\n\n            if (iterRemain == 0)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug(\"QLOptionPriceModel.ImpliedVolatilityEstimation() error: Implied Volatility approxiation did not converge, returning 0.\");\n                }\n                return 0d;\n            }\n\n            return impliedVolEstimate;\n        }\n\n        /// <summary>\n        /// Define Black Calculator to calculate Greeks that are not defined by the option object\n        /// Some models do not evaluate all greeks under some circumstances (e.g. low dividend yield)\n        /// We override this restriction to calculate the Greeks directly with the BlackCalculator\n        /// </summary>\n        private BlackCalculator CreateBlackCalculator(double forwardPrice, double riskFreeDiscount, double stdDev, PlainVanillaPayoff payoff)\n        {\n            return new BlackCalculator(payoff, forwardPrice, stdDev, riskFreeDiscount);\n        }\n\n        private static DateTime AddDays(DateTime date, int days, SecurityExchangeHours marketHours)\n        {\n            var forwardDate = date.AddDays(days);\n\n            if (!marketHours.IsDateOpen(forwardDate))\n            {\n                forwardDate = marketHours.GetNextTradingDay(forwardDate);\n            }\n\n            return forwardDate;\n        }\n\n        /// <summary>\n        /// Set the evaluation date\n        /// </summary>\n        /// <param name=\"evaluationDate\">The current evaluation date</param>\n        private void SetEvaluationDate(DateTime evaluationDate)\n        {\n            if (Settings.evaluationDate().ToDateTime() != evaluationDate)\n            {\n                Settings.setEvaluationDate(evaluationDate);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/QLOptionPriceModelProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QLNet;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Securities.Option\n{\n    /// <summary>\n    /// Provides option price models for option securities based on QuantLib implementations\n    /// </summary>\n    public class QLOptionPriceModelProvider : IOptionPriceModelProvider\n    {\n        internal const int TimeStepsBinomial = 100;\n\n        /// <summary>\n        /// Singleton instance of the <see cref=\"QLOptionPriceModelProvider\"/>\n        /// </summary>\n        public static QLOptionPriceModelProvider Instance { get; } = new();\n\n        private QLOptionPriceModelProvider()\n        {\n        }\n\n        /// <summary>\n        /// Gets the option price model for the specified option symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"pricingModelType\">The option pricing model type to use</param>\n        /// <returns>The option price model for the given symbol</returns>\n        public IOptionPriceModel GetOptionPriceModel(Symbol symbol, OptionPricingModelType? pricingModelType = null)\n        {\n            if (pricingModelType.HasValue)\n            {\n                return GetOptionPriceModel(pricingModelType.Value);\n            }\n\n            return symbol.ID.OptionStyle switch\n            {\n                // CRR model has the best accuracy and speed suggested by\n                // Branka, Zdravka & Tea (2014). Numerical Methods versus Bjerksund and Stensland Approximations for American Options Pricing.\n                // International Journal of Economics and Management Engineering. 8:4.\n                // Available via: https://downloads.dxfeed.com/specifications/dxLibOptions/Numerical-Methods-versus-Bjerksund-and-Stensland-Approximations-for-American-Options-Pricing-.pdf\n                // Also refer to OptionPriceModelTests.MatchesIBGreeksBulk() test,\n                // we select the most accurate and computational efficient model\n                OptionStyle.American => GetOptionPriceModel(OptionPricingModelType.BinomialCoxRossRubinstein),\n                OptionStyle.European => GetOptionPriceModel(OptionPricingModelType.BlackScholes),\n                _ => throw new ArgumentException(\"Invalid OptionStyle\")\n            };\n        }\n        \n        private static QLOptionPriceModel GetOptionPriceModel(OptionPricingModelType pricingModelType)\n        {\n            return pricingModelType switch\n            {\n                OptionPricingModelType.BlackScholes => new QLOptionPriceModel(process => new AnalyticEuropeanEngine(process),\n                    allowedOptionStyles: [OptionStyle.European]),\n                OptionPricingModelType.BinomialCoxRossRubinstein => new QLOptionPriceModel(process => new BinomialVanillaEngine<CoxRossRubinstein>(process, TimeStepsBinomial)),\n                _ => throw new ArgumentException($\"Unsupported pricing model type: {pricingModelType}\")\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/AbsoluteRiskOptionPositionCollectionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Stub class providing an idea towards an optimal <see cref=\"IOptionPositionCollectionEnumerator\"/> implementation\n    /// that still needs to be implemented.\n    /// </summary>\n    public class AbsoluteRiskOptionPositionCollectionEnumerator : IOptionPositionCollectionEnumerator\n    {\n        private readonly Func<Symbol, decimal> _marketPriceProvider;\n\n        /// <summary>\n        /// Intializes a new instance of the <see cref=\"AbsoluteRiskOptionPositionCollectionEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"marketPriceProvider\">Function providing the current market price for a provided symbol</param>\n        public AbsoluteRiskOptionPositionCollectionEnumerator(Func<Symbol, decimal> marketPriceProvider)\n        {\n            _marketPriceProvider = marketPriceProvider;\n        }\n\n        /// <summary>\n        /// Enumerates the provided <paramref name=\"positions\"/>. Positions enumerated first are more\n        /// likely to be matched than those appearing later in the enumeration.\n        /// </summary>\n        public IEnumerable<OptionPosition> Enumerate(OptionPositionCollection positions)\n        {\n            if (positions.IsEmpty)\n            {\n                yield break;\n            }\n\n            var marketPrice = _marketPriceProvider(positions.Underlying);\n\n            var longPositions = new List<OptionPosition>();\n            var shortPuts = new SortedDictionary<decimal, OptionPosition>();\n            var shortCalls = new SortedDictionary<decimal, OptionPosition>();\n            foreach (var position in positions)\n            {\n                if (!position.Symbol.HasUnderlying)\n                {\n                    yield return position;\n                }\n\n                if (position.Quantity > 0)\n                {\n                    longPositions.Add(position);\n                }\n                else\n                {\n                    switch (position.Right)\n                    {\n                        case OptionRight.Put:\n                            shortPuts.Add(position.Strike, position);\n                            break;\n\n                        case OptionRight.Call:\n                            shortCalls.Add(position.Strike, position);\n                            break;\n\n                        default:\n                            throw new ApplicationException(\n                                \"The skies are falling, the oceans rising - you're having a bad time\"\n                            );\n                    }\n                }\n            }\n\n            throw new NotImplementedException(\"This implementation needs to be completed.\");\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/ConstantOptionStrategyLegPredicateReferenceValue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> that represents a constant value.\n    /// </summary>\n    public class ConstantOptionStrategyLegPredicateReferenceValue<T> : IOptionStrategyLegPredicateReferenceValue\n    {\n        private readonly T _value;\n\n        /// <summary>\n        /// Gets the target of this value\n        /// </summary>\n        public PredicateTargetValue Target { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConstantOptionStrategyLegPredicateReferenceValue{T}\"/> class\n        /// </summary>\n        /// <param name=\"value\">The constant reference value</param>\n        /// <param name=\"target\">The value target in relation to the <see cref=\"OptionPosition\"/></param>\n        public ConstantOptionStrategyLegPredicateReferenceValue(T value, PredicateTargetValue target)\n        {\n            _value = value;\n            Target = target;\n        }\n\n        /// <summary>\n        /// Returns the constant value provided at initialization\n        /// </summary>\n        public object Resolve(IReadOnlyList<OptionPosition> legs)\n        {\n            return _value;\n        }\n    }\n\n    /// <summary>\n    /// Provides methods for easily creating instances of <see cref=\"ConstantOptionStrategyLegPredicateReferenceValue{T}\"/>\n    /// </summary>\n    public static class ConstantOptionStrategyLegReferenceValue\n    {\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"ConstantOptionStrategyLegPredicateReferenceValue{T}\"/> class for\n        /// the specified <paramref name=\"value\"/>\n        /// </summary>\n        public static IOptionStrategyLegPredicateReferenceValue Create(object value)\n        {\n            if (value is DateTime)\n            {\n                return new ConstantOptionStrategyLegPredicateReferenceValue<DateTime>((DateTime) value, PredicateTargetValue.Expiration);\n            }\n\n            if (value is decimal)\n            {\n                return new ConstantOptionStrategyLegPredicateReferenceValue<decimal>((decimal) value, PredicateTargetValue.Strike);\n            }\n\n            if (value is OptionRight)\n            {\n                return new ConstantOptionStrategyLegPredicateReferenceValue<OptionRight>((OptionRight) value, PredicateTargetValue.Right);\n            }\n\n            throw new NotSupportedException($\"{value?.GetType().GetBetterTypeName()} is not supported.\");\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/DefaultOptionPositionCollectionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides a default implementation of the <see cref=\"IOptionPositionCollectionEnumerator\"/> abstraction.\n    /// </summary>\n    public class DefaultOptionPositionCollectionEnumerator : IOptionPositionCollectionEnumerator\n    {\n        /// <summary>\n        /// Enumerates <paramref name=\"positions\"/> according to its default enumerator implementation.\n        /// </summary>\n        public IEnumerable<OptionPosition> Enumerate(OptionPositionCollection positions)\n        {\n            return positions;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/DescendingByLegCountOptionStrategyDefinitionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionStrategyDefinitionEnumerator\"/> that enumerates definitions\n    /// requiring more leg matches first. This ensures more complex definitions are evaluated before simpler definitions.\n    /// </summary>\n    public class DescendingByLegCountOptionStrategyDefinitionEnumerator : IOptionStrategyDefinitionEnumerator\n    {\n        /// <summary>\n        /// Enumerates definitions in descending order of <see cref=\"OptionStrategyDefinition.LegCount\"/>\n        /// </summary>\n        public IEnumerable<OptionStrategyDefinition> Enumerate(IReadOnlyList<OptionStrategyDefinition> definitions)\n        {\n            return definitions.OrderByDescending(d => d.LegCount);\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/FunctionalOptionPositionCollectionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides a functional implementation of <see cref=\"IOptionPositionCollectionEnumerator\"/>\n    /// </summary>\n    public class FunctionalOptionPositionCollectionEnumerator : IOptionPositionCollectionEnumerator\n    {\n        private readonly Func<OptionPositionCollection, IEnumerable<OptionPosition>> _enumerate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FunctionalOptionPositionCollectionEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerate\"></param>\n        public FunctionalOptionPositionCollectionEnumerator(\n            Func<OptionPositionCollection, IEnumerable<OptionPosition>> enumerate\n            )\n        {\n            _enumerate = enumerate;\n        }\n\n        /// <summary>\n        /// Enumerate the Option Positions Collection\n        /// </summary>\n        /// <param name=\"positions\">The positions to enumerate on</param>\n        /// <returns>Enumerable of Option Positions</returns>\n        public IEnumerable<OptionPosition> Enumerate(OptionPositionCollection positions)\n        {\n            return _enumerate(positions);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/IOptionPositionCollectionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Enumerates an <see cref=\"OptionPositionCollection\"/>. The intent is to evaluate positions that\n    /// may be more important sooner. Positions appearing earlier in the enumeration are evaluated before\n    /// positions showing later. This effectively prioritizes individual positions. This should not be\n    /// used filter filtering, but it could also be used to split a position, for example a position with\n    /// 10 could be changed to two 5s and they don't need to be enumerated back to-back either. In this\n    /// way you could prioritize the first 5 and then delay matching of the final 5.\n    /// </summary>\n    public interface IOptionPositionCollectionEnumerator\n    {\n        /// <summary>\n        /// Enumerates the provided <paramref name=\"positions\"/>. Positions enumerated first are more\n        /// likely to be matched than those appearing later in the enumeration.\n        /// </summary>\n        IEnumerable<OptionPosition> Enumerate(OptionPositionCollection positions);\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/IOptionStrategyDefinitionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Enumerates <see cref=\"OptionStrategyDefinition\"/> for the purposes of providing a bias towards definitions\n    /// that are more favorable to be matched before matching less favorable definitions.\n    /// </summary>\n    public interface IOptionStrategyDefinitionEnumerator\n    {\n        /// <summary>\n        /// Enumerates the <paramref name=\"definitions\"/> according to the implementation's own concept of favorability.\n        /// </summary>\n        IEnumerable<OptionStrategyDefinition> Enumerate(IReadOnlyList<OptionStrategyDefinition> definitions);\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/IOptionStrategyLegPredicateReferenceValue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// When decoding leg predicates, we extract the value we're comparing against\n    /// If we're comparing against another leg's value (such as legs[0].Strike), then\n    /// we'll create a OptionStrategyLegPredicateReferenceValue. If we're comparing against a literal/constant value,\n    /// then we'll create a ConstantOptionStrategyLegPredicateReferenceValue. These reference values are used to slice\n    /// the <see cref=\"OptionPositionCollection\"/> to only include positions matching the\n    /// predicate.\n    /// </summary>\n    public interface IOptionStrategyLegPredicateReferenceValue\n    {\n        /// <summary>\n        /// Gets the target of this value\n        /// </summary>\n        PredicateTargetValue Target { get; }\n\n        /// <summary>\n        /// Resolves the value of the comparand specified in an <see cref=\"OptionStrategyLegPredicate\"/>.\n        /// For example, the predicate may include ... > legs[0].Strike, and upon evaluation, we need to\n        /// be able to extract leg[0].Strike for the currently contemplated set of legs adhering to a\n        /// strategy's definition.\n        /// </summary>\n        object Resolve(IReadOnlyList<OptionPosition> legs);\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/IOptionStrategyMatchObjectiveFunction.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Evaluates the provided match to assign an objective score. Higher scores are better.\n    /// </summary>\n    public interface IOptionStrategyMatchObjectiveFunction\n    {\n        /// <summary>\n        /// Evaluates the objective function for the provided match solution. Solution with the highest score will be selected\n        /// as the solution. NOTE: This part of the match has not been implemented as of 2020-11-06 as it's only evaluating the\n        /// first solution match (MatchOnce).\n        /// </summary>\n        decimal ComputeScore(OptionPositionCollection input, OptionStrategyMatch match, OptionPositionCollection unmatched);\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/IdentityOptionStrategyDefinitionEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"IOptionStrategyDefinitionEnumerator\"/> that enumerates\n    /// definitions according to the order that they were provided to <see cref=\"OptionStrategyMatcherOptions\"/>\n    /// </summary>\n    public class IdentityOptionStrategyDefinitionEnumerator : IOptionStrategyDefinitionEnumerator\n    {\n        /// <summary>\n        /// Enumerates the <paramref name=\"definitions\"/> in the same order as provided.\n        /// </summary>\n        public IEnumerable<OptionStrategyDefinition> Enumerate(IReadOnlyList<OptionStrategyDefinition> definitions)\n        {\n            return definitions;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionPosition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines a lightweight structure representing a position in an option contract or underlying.\n    /// This type is heavily utilized by the options strategy matcher and is the parameter type of\n    /// option strategy definition predicates. Underlying quantities should be represented in lot sizes,\n    /// which is equal to the quantity of shares divided by the contract's multiplier and then rounded\n    /// down towards zero (truncate)\n    /// </summary>\n    public struct OptionPosition : IEquatable<OptionPosition>\n    {\n        /// <summary>\n        /// Gets a new <see cref=\"OptionPosition\"/> with zero <see cref=\"Quantity\"/>\n        /// </summary>\n        public static OptionPosition Empty(Symbol symbol)\n            => new OptionPosition(symbol, 0);\n\n        /// <summary>\n        /// Determines whether or not this position has any quantity\n        /// </summary>\n        public bool HasQuantity => Quantity != 0;\n\n        /// <summary>\n        /// Determines whether or not this position is for the underlying symbol\n        /// </summary>\n        public bool IsUnderlying => !Symbol.HasUnderlying;\n\n        /// <summary>\n        /// Number of contracts held, can be positive or negative\n        /// </summary>\n        public int Quantity { get; }\n\n        /// <summary>\n        /// Option contract symbol\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the underlying symbol. If this position represents the underlying,\n        /// then this property is the same as the <see cref=\"Symbol\"/> property\n        /// </summary>\n        public Symbol Underlying => IsUnderlying ? Symbol : Symbol.Underlying;\n\n        /// <summary>\n        /// Option contract expiration date\n        /// </summary>\n        public DateTime Expiration\n        {\n            get\n            {\n                if (Symbol.HasUnderlying)\n                {\n                    return Symbol.ID.Date;\n                }\n\n                throw new InvalidOperationException($\"{nameof(Expiration)} is not valid for underlying symbols: {Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Option contract strike price\n        /// </summary>\n        public decimal Strike\n        {\n            get\n            {\n                if (Symbol.HasUnderlying)\n                {\n                    return Symbol.ID.StrikePrice;\n                }\n\n                throw new InvalidOperationException($\"{nameof(Strike)} is not valid for underlying symbols: {Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Option contract right (put/call)\n        /// </summary>\n        public OptionRight Right\n        {\n            get\n            {\n                if (Symbol.HasUnderlying)\n                {\n                    return Symbol.ID.OptionRight;\n                }\n\n                throw new InvalidOperationException($\"{nameof(Right)} is not valid for underlying symbols: {Symbol}\");\n            }\n        }\n\n        /// <summary>\n        /// Gets whether this position is short/long/none\n        /// </summary>\n        public PositionSide Side => (PositionSide) Math.Sign(Quantity);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPosition\"/> structure\n        /// </summary>\n        /// <param name=\"symbol\">The option contract symbol</param>\n        /// <param name=\"quantity\">The number of contracts held</param>\n        public OptionPosition(Symbol symbol, int quantity)\n        {\n            Symbol = symbol;\n            Quantity = quantity;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPosition\"/> instance with negative <see cref=\"Quantity\"/>\n        /// </summary>\n        public OptionPosition Negate()\n        {\n            return new OptionPosition(Symbol, -Quantity);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPosition\"/> with this position's <see cref=\"Symbol\"/>\n        /// and the provided <paramref name=\"quantity\"/>\n        /// </summary>\n        public OptionPosition WithQuantity(int quantity)\n        {\n            return new OptionPosition(Symbol, quantity);\n        }\n\n        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.</returns>\n        public bool Equals(OptionPosition other)\n        {\n            return Equals(Symbol, other.Symbol) && Quantity == other.Quantity;\n        }\n\n        /// <summary>Indicates whether this instance and a specified object are equal.</summary>\n        /// <param name=\"obj\">The object to compare with the current instance. </param>\n        /// <returns>true if <paramref name=\"obj\" /> and this instance are the same type and represent the same value; otherwise, false. </returns>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return false;\n            }\n\n            if (obj.GetType() != GetType())\n            {\n                return false;\n            }\n\n            return Equals((OptionPosition) obj);\n        }\n\n        /// <summary>Returns the hash code for this instance.</summary>\n        /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((Symbol != null ? Symbol.GetHashCode() : 0) * 397) ^ Quantity;\n            }\n        }\n\n        /// <summary>Returns the fully qualified type name of this instance.</summary>\n        /// <returns>The fully qualified type name.</returns>\n        public override string ToString()\n        {\n            var s = Quantity == 1 ? \"\" : \"s\";\n            if (Symbol.HasUnderlying)\n            {\n                return $\"{Quantity} {Right.ToLower()}{s} on {Symbol.Underlying.Value} at ${Strike} expiring on {Expiration:yyyy-MM-dd}\";\n            }\n\n            return $\"{Quantity} share{s} of {Symbol.Value}\";\n        }\n\n        /// <summary>\n        /// OptionPosition * Operator, will multiple quantity by given factor\n        /// </summary>\n        /// <param name=\"left\">OptionPosition to operate on</param>\n        /// <param name=\"factor\">Factor to multiply by</param>\n        /// <returns>Resulting OptionPosition</returns>\n        public static OptionPosition operator *(OptionPosition left, int factor)\n        {\n            return new OptionPosition(left.Symbol, factor * left.Quantity);\n        }\n\n        /// <summary>\n        /// OptionPosition * Operator, will multiple quantity by given factor\n        /// </summary>\n        /// <param name=\"right\">OptionPosition to operate on</param>\n        /// <param name=\"factor\">Factor to multiply by</param>\n        /// <returns>Resulting OptionPosition</returns>\n        public static OptionPosition operator *(int factor, OptionPosition right)\n        {\n            return new OptionPosition(right.Symbol, factor * right.Quantity);\n        }\n\n        /// <summary>\n        /// OptionPosition + Operator, will add quantities together if they are for the same symbol.\n        /// </summary>\n        /// <returns>Resulting OptionPosition</returns>\n        public static OptionPosition operator +(OptionPosition left, OptionPosition right)\n        {\n            if (!Equals(left.Symbol, right.Symbol))\n            {\n                if (left == default(OptionPosition))\n                {\n                    return right;\n                }\n\n                if (right == default(OptionPosition))\n                {\n                    return left;\n                }\n\n                throw new InvalidOperationException(\"Unable to add OptionPosition instances with different symbols\");\n            }\n\n            return new OptionPosition(left.Symbol, left.Quantity + right.Quantity);\n        }\n\n        /// <summary>\n        /// OptionPosition - Operator, will subtract left - right quantities if they are for the same symbol.\n        /// </summary>\n        /// <returns>Resulting OptionPosition</returns>\n        public static OptionPosition operator -(OptionPosition left, OptionPosition right)\n        {\n            if (!Equals(left.Symbol, right.Symbol))\n            {\n                if (left == default(OptionPosition))\n                {\n                    // 0 - right\n                    return right.Negate();\n                }\n\n                if (right == default(OptionPosition))\n                {\n                    // left - 0\n                    return left;\n                }\n\n                throw new InvalidOperationException(\"Unable to subtract OptionPosition instances with different symbols\");\n            }\n\n            return new OptionPosition(left.Symbol, left.Quantity - right.Quantity);\n        }\n\n        /// <summary>\n        /// Option Position == Operator\n        /// </summary>\n        /// <returns>True if they are the same</returns>\n        public static bool operator ==(OptionPosition left, OptionPosition right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Option Position != Operator\n        /// </summary>\n        /// <returns>True if they are not the same</returns>\n        public static bool operator !=(OptionPosition left, OptionPosition right)\n        {\n            return !Equals(left, right);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides indexing of option contracts\n    /// </summary>\n    public class OptionPositionCollection : IEnumerable<OptionPosition>\n    {\n        /// <summary>\n        /// Gets an empty instance of <see cref=\"OptionPositionCollection\"/>\n        /// </summary>\n        public static OptionPositionCollection Empty { get; } = new OptionPositionCollection(\n            ImmutableDictionary<Symbol, OptionPosition>.Empty,\n            ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>>.Empty,\n            ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>>.Empty,\n            ImmutableSortedDictionary<decimal, ImmutableHashSet<Symbol>>.Empty,\n            ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>>.Empty\n        );\n\n        private readonly ImmutableDictionary<Symbol, OptionPosition> _positions;\n        private readonly ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>> _rights;\n        private readonly ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>> _sides;\n        private readonly ImmutableSortedDictionary<decimal,  ImmutableHashSet<Symbol>> _strikes;\n        private readonly ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>> _expirations;\n\n        /// <summary>\n        /// Gets the underlying security's symbol\n        /// </summary>\n        public Symbol Underlying => UnderlyingPosition.Symbol ?? Symbol.Empty;\n\n        /// <summary>\n        /// Gets the total count of unique positions, including the underlying\n        /// </summary>\n        public int Count => _positions.Count;\n\n        /// <summary>\n        /// Gets whether or not there's any positions in this collection.\n        /// </summary>\n        public bool IsEmpty => _positions.IsEmpty;\n\n        /// <summary>\n        /// Gets the quantity of underlying shares held\n        /// TODO : Change to UnderlyingLots\n        /// </summary>\n        public int UnderlyingQuantity => UnderlyingPosition.Quantity;\n\n        /// <summary>\n        /// Gets the number of unique put contracts held (long or short)\n        /// </summary>\n        public int UniquePuts => _rights[OptionRight.Put].Count;\n\n        /// <summary>\n        /// Gets the unique number of expirations\n        /// </summary>\n        public int UniqueExpirations => _expirations.Count;\n\n        /// <summary>\n        /// Gets the number of unique call contracts held (long or short)\n        /// </summary>\n        public int UniqueCalls => _rights[OptionRight.Call].Count;\n\n        /// <summary>\n        /// Determines if this collection contains a position in the underlying\n        /// </summary>\n        public bool HasUnderlying => UnderlyingQuantity != 0;\n\n        /// <summary>\n        /// Gets the <see cref=\"Underlying\"/> position\n        /// </summary>\n        public OptionPosition UnderlyingPosition { get; }\n\n        /// <summary>\n        /// Gets all unique strike prices in the collection, in ascending order.\n        /// </summary>\n        public IEnumerable<decimal> Strikes => _strikes.Keys;\n\n        /// <summary>\n        /// Gets all unique expiration dates in the collection, in chronological order.\n        /// </summary>\n        public IEnumerable<DateTime> Expirations => _expirations.Keys;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionPositionCollection\"/> class\n        /// </summary>\n        /// <param name=\"positions\">All positions</param>\n        /// <param name=\"rights\">Index of position symbols by option right</param>\n        /// <param name=\"sides\">Index of position symbols by position side (short/long/none)</param>\n        /// <param name=\"strikes\">Index of position symbols by strike price</param>\n        /// <param name=\"expirations\">Index of position symbols by expiration</param>\n        public OptionPositionCollection(\n            ImmutableDictionary<Symbol, OptionPosition> positions,\n            ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>> rights,\n            ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>> sides,\n            ImmutableSortedDictionary<decimal, ImmutableHashSet<Symbol>> strikes,\n            ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>> expirations\n            )\n        {\n            _sides = sides;\n            _rights = rights;\n            _strikes = strikes;\n            _positions = positions;\n            _expirations = expirations;\n\n            if (_rights.Count != 2)\n            {\n                // ensure we always have both rights indexed, even if empty\n                ImmutableHashSet<Symbol> value;\n                if (!_rights.TryGetValue(OptionRight.Call, out value))\n                {\n                    _rights = _rights.SetItem(OptionRight.Call, ImmutableHashSet<Symbol>.Empty);\n                }\n                if (!_rights.TryGetValue(OptionRight.Put, out value))\n                {\n                    _rights = _rights.SetItem(OptionRight.Put, ImmutableHashSet<Symbol>.Empty);\n                }\n            }\n\n            if (_sides.Count != 3)\n            {\n                // ensure we always have all three sides indexed, even if empty\n                ImmutableHashSet<Symbol> value;\n                if (!_sides.TryGetValue(PositionSide.None, out value))\n                {\n                    _sides = _sides.SetItem(PositionSide.None, ImmutableHashSet<Symbol>.Empty);\n                }\n                if (!_sides.TryGetValue(PositionSide.Short, out value))\n                {\n                    _sides = _sides.SetItem(PositionSide.Short, ImmutableHashSet<Symbol>.Empty);\n                }\n                if (!_sides.TryGetValue(PositionSide.Long, out value))\n                {\n                    _sides = _sides.SetItem(PositionSide.Long, ImmutableHashSet<Symbol>.Empty);\n                }\n            }\n\n            if (!positions.IsEmpty)\n            {\n                // assumption here is that 'positions' includes the underlying equity position and\n                // ONLY option contracts, so all symbols have the underlying equity symbol embedded\n                // via the Underlying property, except of course, for the underlying itself.\n                var underlying = positions.First().Key;\n                if (underlying.HasUnderlying)\n                {\n                    underlying = underlying.Underlying;\n                }\n\n                // OptionPosition is struct, so no worry about null ref via .Quantity\n                var underlyingQuantity = positions.GetValueOrDefault(underlying).Quantity;\n                UnderlyingPosition = new OptionPosition(underlying, underlyingQuantity);\n            }\n#if DEBUG\n            var errors = Validate().ToList();\n            if (errors.Count > 0)\n            {\n                throw new ArgumentException(\"OptionPositionCollection validation failed: \"\n                    + Environment.NewLine + string.Join(Environment.NewLine, errors)\n                );\n            }\n#endif\n        }\n\n        /// <summary>\n        /// Determines if a position is held in the specified <paramref name=\"symbol\"/>\n        /// </summary>\n        public bool HasPosition(Symbol symbol)\n        {\n            OptionPosition position;\n            return TryGetPosition(symbol, out position) && position.Quantity != 0;\n        }\n\n        /// <summary>\n        /// Retrieves the <see cref=\"OptionPosition\"/> for the specified <paramref name=\"symbol\"/>\n        /// if one exists in this collection.\n        /// </summary>\n        public bool TryGetPosition(Symbol symbol, out OptionPosition position)\n        {\n            return _positions.TryGetValue(symbol, out position);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPositionCollection\"/> from the specified enumerable of <paramref name=\"positions\"/>\n        /// </summary>\n        public static OptionPositionCollection FromPositions(IEnumerable<OptionPosition> positions)\n        {\n            return Empty.AddRange(positions);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPositionCollection\"/> from the specified enumerable of <paramref name=\"positions\"/>\n        /// </summary>\n        public static OptionPositionCollection FromPositions(IEnumerable<IPosition> positions, decimal contractMultiplier)\n        {\n            return Empty.AddRange(positions.Select(position =>\n            {\n                var quantity = (int)position.Quantity;\n                if (position.Symbol.SecurityType.HasOptions())\n                {\n                    quantity = (int) (quantity / contractMultiplier);\n                }\n                return new OptionPosition(position.Symbol, quantity);\n            }));\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPositionCollection\"/> from the specified <paramref name=\"holdings\"/>,\n        /// filtering based on the <paramref name=\"underlying\"/>\n        /// </summary>\n        public static OptionPositionCollection Create(Symbol underlying, decimal contractMultiplier, IEnumerable<SecurityHolding> holdings)\n        {\n            var positions = Empty;\n            foreach (var holding in holdings)\n            {\n                var symbol = holding.Symbol;\n                if (!symbol.HasUnderlying)\n                {\n                    if (symbol == underlying)\n                    {\n                        var underlyingLots = (int) (holding.Quantity / contractMultiplier);\n                        positions = positions.Add(new OptionPosition(symbol, underlyingLots));\n                    }\n\n                    continue;\n                }\n\n                if (symbol.Underlying != underlying)\n                {\n                    continue;\n                }\n\n                var position = new OptionPosition(symbol, (int) holding.Quantity);\n                positions = positions.Add(position);\n            }\n\n            return positions;\n        }\n\n        /// <summary>\n        /// Creates a new collection that is the result of adding the specified <paramref name=\"position\"/> to this collection.\n        /// </summary>\n        public OptionPositionCollection Add(OptionPosition position)\n        {\n            if (!position.HasQuantity)\n            {\n                // adding nothing doesn't change the collection\n                return this;\n            }\n\n            var sides = _sides;\n            var rights = _rights;\n            var strikes = _strikes;\n            var positions = _positions;\n            var expirations = _expirations;\n\n            var exists = false;\n            OptionPosition existing;\n            var symbol = position.Symbol;\n            if (positions.TryGetValue(symbol, out existing))\n            {\n                exists = true;\n                position += existing;\n            }\n\n            if (position.HasQuantity)\n            {\n                positions = positions.SetItem(symbol, position);\n                if (!exists && symbol.HasUnderlying)\n                {\n                    // update indexes when adding a new option contract\n                    sides = sides.Add(position.Side, symbol);\n                    rights = rights.Add(position.Right, symbol);\n                    strikes = strikes.Add(position.Strike, symbol);\n                    positions = positions.SetItem(symbol, position);\n                    expirations = expirations.Add(position.Expiration, symbol);\n                }\n            }\n            else\n            {\n                // if the position's quantity went to zero, remove it entirely from the collection when\n                // removing, be sure to remove strike/expiration indexes. we purposefully keep the rights\n                // index populated, even with a zero count entry because it's bounded to 2 items (put/call)\n\n                positions = positions.Remove(symbol);\n                if (symbol.HasUnderlying)\n                {\n                    // keep call/put entries even if goes to zero\n                    var rightsValue = rights[position.Right].Remove(symbol);\n                    rights = rights.SetItem(position.Right, rightsValue);\n\n                    // keep short/none/long entries even if goes to zero\n                    var sidesValue = sides[position.Side].Remove(symbol);\n                    sides = sides.SetItem(position.Side, sidesValue);\n\n                    var strikesValue = strikes[position.Strike].Remove(symbol);\n                    strikes = strikesValue.Count > 0\n                        ? strikes.SetItem(position.Strike, strikesValue)\n                        : strikes.Remove(position.Strike);\n\n                    var expirationsValue = expirations[position.Expiration].Remove(symbol);\n                    expirations = expirationsValue.Count > 0\n                        ? expirations.SetItem(position.Expiration, expirationsValue)\n                        : expirations.Remove(position.Expiration);\n                }\n            }\n\n            return new OptionPositionCollection(positions, rights, sides, strikes, expirations);\n        }\n\n        /// <summary>\n        /// Creates a new collection that is the result of removing the specified <paramref name=\"position\"/>\n        /// </summary>\n        public OptionPositionCollection Remove(OptionPosition position)\n        {\n            return Add(position.Negate());\n        }\n\n        /// <summary>\n        /// Creates a new collection that is the result of adding the specified <paramref name=\"positions\"/> to this collection.\n        /// </summary>\n        public OptionPositionCollection AddRange(params OptionPosition[] positions)\n        {\n            return AddRange((IEnumerable<OptionPosition>) positions);\n        }\n\n        /// <summary>\n        /// Creates a new collection that is the result of adding the specified <paramref name=\"positions\"/> to this collection.\n        /// </summary>\n        public OptionPositionCollection AddRange(IEnumerable<OptionPosition> positions)\n        {\n            return positions.Aggregate(this, (current, position) => current + position);\n        }\n\n        /// <summary>\n        /// Creates a new collection that is the result of removing the specified <paramref name=\"positions\"/>\n        /// </summary>\n        public OptionPositionCollection RemoveRange(IEnumerable<OptionPosition> positions)\n        {\n            return AddRange(positions.Select(position => position.Negate()));\n        }\n\n        /// <summary>\n        /// Slices this collection, returning a new collection containing only\n        /// positions with the specified <paramref name=\"right\"/>\n        /// </summary>\n        public OptionPositionCollection Slice(OptionRight right, bool includeUnderlying = true)\n        {\n            var rights = _rights.Remove(right.Invert());\n\n            var positions = ImmutableDictionary<Symbol, OptionPosition>.Empty;\n            if (includeUnderlying && HasUnderlying)\n            {\n                positions = positions.Add(Underlying, UnderlyingPosition);\n            }\n\n            var sides = ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>>.Empty;\n            var strikes = ImmutableSortedDictionary<decimal, ImmutableHashSet<Symbol>>.Empty;\n            var expirations = ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>>.Empty;\n            foreach (var symbol in rights.SelectMany(kvp => kvp.Value))\n            {\n                var position = _positions[symbol];\n                sides = sides.Add(position.Side, symbol);\n                positions = positions.Add(symbol, position);\n                strikes = strikes.Add(position.Strike, symbol);\n                expirations = expirations.Add(position.Expiration, symbol);\n            }\n\n            return new OptionPositionCollection(positions, rights, sides, strikes, expirations);\n        }\n\n        /// <summary>\n        /// Slices this collection, returning a new collection containing only\n        /// positions with the specified <paramref name=\"side\"/>\n        /// </summary>\n        public OptionPositionCollection  Slice(PositionSide side, bool includeUnderlying = true)\n        {\n            var otherSides = GetOtherSides(side);\n            var sides = _sides.Remove(otherSides[0]).Remove(otherSides[1]);\n\n            var positions = ImmutableDictionary<Symbol, OptionPosition>.Empty;\n            if (includeUnderlying && HasUnderlying)\n            {\n                positions = positions.Add(Underlying, UnderlyingPosition);\n            }\n\n            var rights = ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>>.Empty;\n            var strikes = ImmutableSortedDictionary<decimal, ImmutableHashSet<Symbol>>.Empty;\n            var expirations = ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>>.Empty;\n            foreach (var symbol in sides.SelectMany(kvp => kvp.Value))\n            {\n                var position = _positions[symbol];\n                rights = rights.Add(position.Right, symbol);\n                positions = positions.Add(symbol, position);\n                strikes = strikes.Add(position.Strike, symbol);\n                expirations = expirations.Add(position.Expiration, symbol);\n            }\n\n            return new OptionPositionCollection(positions, rights, sides, strikes, expirations);\n        }\n\n        /// <summary>\n        /// Slices this collection, returning a new collection containing only\n        /// positions matching the specified <paramref name=\"comparison\"/> and <paramref name=\"strike\"/>\n        /// </summary>\n        public OptionPositionCollection Slice(BinaryComparison comparison, decimal strike, bool includeUnderlying = true)\n        {\n            var strikes = comparison.Filter(_strikes, strike);\n            if (strikes.IsEmpty)\n            {\n                return includeUnderlying && HasUnderlying ? Empty.Add(UnderlyingPosition) : Empty;\n            }\n\n            var positions = ImmutableDictionary<Symbol, OptionPosition>.Empty;\n            if (includeUnderlying)\n            {\n                OptionPosition underlyingPosition;\n                if (_positions.TryGetValue(Underlying, out underlyingPosition))\n                {\n                    positions = positions.Add(Underlying, underlyingPosition);\n                }\n            }\n\n            var sides = ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>>.Empty;\n            var rights = ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>>.Empty;\n            var expirations = ImmutableSortedDictionary<DateTime, ImmutableHashSet<Symbol>>.Empty;\n            foreach (var symbol in strikes.SelectMany(kvp => kvp.Value))\n            {\n                var position = _positions[symbol];\n                sides = sides.Add(position.Side, symbol);\n                positions = positions.Add(symbol, position);\n                rights = rights.Add(symbol.ID.OptionRight, symbol);\n                expirations = expirations.Add(symbol.ID.Date, symbol);\n            }\n\n            return new OptionPositionCollection(positions, rights, sides, strikes, expirations);\n        }\n\n        /// <summary>\n        /// Slices this collection, returning a new collection containing only\n        /// positions matching the specified <paramref name=\"comparison\"/> and <paramref name=\"expiration\"/>\n        /// </summary>\n        public OptionPositionCollection Slice(BinaryComparison comparison, DateTime expiration, bool includeUnderlying = true)\n        {\n            var expirations = comparison.Filter(_expirations, expiration);\n            if (expirations.IsEmpty)\n            {\n                return includeUnderlying && HasUnderlying ? Empty.Add(UnderlyingPosition) : Empty;\n            }\n\n            var positions = ImmutableDictionary<Symbol, OptionPosition>.Empty;\n            if (includeUnderlying)\n            {\n                OptionPosition underlyingPosition;\n                if (_positions.TryGetValue(Underlying, out underlyingPosition))\n                {\n                    positions = positions.Add(Underlying, underlyingPosition);\n                }\n            }\n\n            var sides = ImmutableDictionary<PositionSide, ImmutableHashSet<Symbol>>.Empty;\n            var rights = ImmutableDictionary<OptionRight, ImmutableHashSet<Symbol>>.Empty;\n            var strikes = ImmutableSortedDictionary<decimal, ImmutableHashSet<Symbol>>.Empty;\n            foreach (var symbol in expirations.SelectMany(kvp => kvp.Value))\n            {\n                var position = _positions[symbol];\n                sides = sides.Add(position.Side, symbol);\n                positions = positions.Add(symbol, position);\n                rights = rights.Add(symbol.ID.OptionRight, symbol);\n                strikes = strikes.Add(symbol.ID.StrikePrice, symbol);\n            }\n\n            return new OptionPositionCollection(positions, rights, sides, strikes, expirations);\n        }\n\n        /// <summary>\n        /// Returns the set of <see cref=\"OptionPosition\"/> with the specified <paramref name=\"symbols\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> ForSymbols(IEnumerable<Symbol> symbols)\n        {\n            foreach (var symbol in symbols)\n            {\n                OptionPosition position;\n                if (_positions.TryGetValue(symbol, out position))\n                {\n                    yield return position;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns the set of <see cref=\"OptionPosition\"/> with the specified <paramref name=\"right\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> ForRight(OptionRight right)\n        {\n            ImmutableHashSet<Symbol> symbols;\n            return _rights.TryGetValue(right, out symbols)\n                ? ForSymbols(symbols)\n                : Enumerable.Empty<OptionPosition>();\n        }\n\n        /// <summary>\n        /// Returns the set of <see cref=\"OptionPosition\"/> with the specified <paramref name=\"side\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> ForSide(PositionSide side)\n        {\n            ImmutableHashSet<Symbol> symbols;\n            return _sides.TryGetValue(side, out symbols)\n                ? ForSymbols(symbols)\n                : Enumerable.Empty<OptionPosition>();\n        }\n\n        /// <summary>\n        /// Returns the set of <see cref=\"OptionPosition\"/> with the specified <paramref name=\"strike\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> ForStrike(decimal strike)\n        {\n            ImmutableHashSet<Symbol> symbols;\n            return _strikes.TryGetValue(strike, out symbols)\n                ? ForSymbols(symbols)\n                : Enumerable.Empty<OptionPosition>();\n        }\n\n        /// <summary>\n        /// Returns the set of <see cref=\"OptionPosition\"/> with the specified <paramref name=\"expiration\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> ForExpiration(DateTime expiration)\n        {\n            ImmutableHashSet<Symbol> symbols;\n            return _expirations.TryGetValue(expiration, out symbols)\n                ? ForSymbols(symbols)\n                : Enumerable.Empty<OptionPosition>();\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            if (Count == 0)\n            {\n                return \"Empty\";\n            }\n\n            return HasUnderlying\n                ? $\"{UnderlyingQuantity} {Underlying.Value}: {_positions.Count - 1} contract positions\"\n                : $\"{Underlying.Value}: {_positions.Count} contract positions\";\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<OptionPosition> GetEnumerator()\n        {\n            return _positions.Select(kvp => kvp.Value).GetEnumerator();\n        }\n\n        /// <summary>\n        /// Validates this collection returning an enumerable of validation errors.\n        /// This should only be invoked via tests and is automatically invoked via\n        /// the constructor in DEBUG builds.\n        /// </summary>\n        internal IEnumerable<string> Validate()\n        {\n            foreach (var kvp in _positions)\n            {\n                var position = kvp.Value;\n                var symbol = position.Symbol;\n                if (position.Quantity == 0)\n                {\n                    yield return $\"{position}: Quantity == 0\";\n                }\n\n                if (!symbol.HasUnderlying)\n                {\n                    continue;\n                }\n\n                ImmutableHashSet<Symbol> strikes;\n                if (!_strikes.TryGetValue(position.Strike, out strikes) || !strikes.Contains(symbol))\n                {\n                    yield return $\"{position}: Not indexed by strike price\";\n                }\n\n                ImmutableHashSet<Symbol> expirations;\n                if (!_expirations.TryGetValue(position.Expiration, out expirations) || !expirations.Contains(symbol))\n                {\n                    yield return $\"{position}: Not indexed by expiration date\";\n                }\n            }\n        }\n\n        private static readonly PositionSide[] OtherSidesForNone = {PositionSide.Short, PositionSide.Long};\n        private static readonly PositionSide[] OtherSidesForShort = {PositionSide.None, PositionSide.Long};\n        private static readonly PositionSide[] OtherSidesForLong = {PositionSide.Short, PositionSide.None};\n        private static PositionSide[] GetOtherSides(PositionSide side)\n        {\n            switch (side)\n            {\n                case PositionSide.Short: return OtherSidesForShort;\n                case PositionSide.None:  return OtherSidesForNone;\n                case PositionSide.Long:  return OtherSidesForLong;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(side), side, null);\n            }\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// OptionPositionCollection + Operator\n        /// </summary>\n        /// <param name=\"positions\">Collection to add to</param>\n        /// <param name=\"position\">OptionPosition to add</param>\n        /// <returns>OptionPositionCollection with the new position added</returns>\n        public static OptionPositionCollection operator+(OptionPositionCollection positions, OptionPosition position)\n        {\n            return positions.Add(position);\n        }\n\n        /// <summary>\n        /// OptionPositionCollection - Operator\n        /// </summary>\n        /// <param name=\"positions\">Collection to remove from</param>\n        /// <param name=\"position\">OptionPosition to remove</param>\n        /// <returns>OptionPositionCollection with the position removed</returns>\n        public static OptionPositionCollection operator-(OptionPositionCollection positions, OptionPosition position)\n        {\n            return positions.Remove(position);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyDefinition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides a definitional object for an <see cref=\"OptionStrategy\"/>. This definition is used to 'match' option\n    /// positions via <see cref=\"OptionPositionCollection\"/>. The <see cref=\"OptionStrategyMatcher\"/> utilizes a full\n    /// collection of these definitional objects in order to match an algorithm's option position holdings to the\n    /// set of strategies in an effort to reduce the total margin required for holding the positions.\n    /// </summary>\n    public class OptionStrategyDefinition : IEnumerable<OptionStrategyLegDefinition>\n    {\n        /// <summary>\n        /// Gets the definition's name\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Gets the number of underlying lots required to match this definition. A lot size\n        /// is equal to the contract's multiplier and is usually equal to 100.\n        /// </summary>\n        public int UnderlyingLots { get; }\n\n        /// <summary>\n        /// Gets the option leg definitions. This list does NOT contain a definition for the\n        /// required underlying lots, due to its simplicity. Instead the required underlying\n        /// lots are defined via the <see cref=\"UnderlyingLots\"/> property of the definition.\n        /// </summary>\n        public IReadOnlyList<OptionStrategyLegDefinition> Legs { get; }\n\n        /// <summary>\n        /// Gets the total number of legs, INCLUDING the underlying leg if applicable. This\n        /// is used to perform a coarse filter as the minimum number of unique positions in\n        /// the positions collection.\n        /// </summary>\n        public int LegCount => Legs.Count + (UnderlyingLots == 0 ? 0 : 1);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyDefinition\"/> class\n        /// </summary>\n        /// <param name=\"name\">The definition's name</param>\n        /// <param name=\"underlyingLots\">The required number of underlying lots</param>\n        /// <param name=\"legs\">Definitions for each option leg</param>\n        public OptionStrategyDefinition(string name, int underlyingLots, IEnumerable<OptionStrategyLegDefinition> legs)\n        {\n            Name = name;\n            Legs = legs.ToList();\n            UnderlyingLots = underlyingLots;\n        }\n\n        /// <summary>\n        /// Creates the <see cref=\"OptionStrategy\"/> instance using this definition and the provided leg matches\n        /// </summary>\n        public OptionStrategy CreateStrategy(IReadOnlyList<OptionStrategyLegDefinitionMatch> legs)\n        {\n            return OptionStrategy.Create(Name, Enumerable.Range(0, Math.Min(Legs.Count, legs.Count)).Select(i => Legs[i].CreateLegData(legs[i])));\n        }\n\n        /// <summary>\n        /// Attempts to match the positions to this definition exactly once, by evaluating the enumerable and\n        /// taking the first entry matched. If not match is found, then false is returned and <paramref name=\"match\"/>\n        /// will be null.\n        /// </summary>\n        public bool TryMatchOnce(OptionStrategyMatcherOptions options, OptionPositionCollection positions, out OptionStrategyDefinitionMatch match)\n        {\n            match = Match(options, positions).FirstOrDefault();\n            return match != null;\n        }\n\n        /// <summary>\n        /// Determines all possible matches for this definition using the provided <paramref name=\"positions\"/>.\n        /// This includes OVERLAPPING matches. It's up to the actual matcher to make decisions based on which\n        /// matches to accept. This allows the matcher to prioritize matching certain positions over others.\n        /// </summary>\n        public IEnumerable<OptionStrategyDefinitionMatch> Match(OptionPositionCollection positions)\n        {\n            return Match(OptionStrategyMatcherOptions.ForDefinitions(this), positions);\n        }\n\n        /// <summary>\n        /// Determines all possible matches for this definition using the provided <paramref name=\"positions\"/>.\n        /// This includes OVERLAPPING matches. It's up to the actual matcher to make decisions based on which\n        /// matches to accept. This allows the matcher to prioritize matching certain positions over others.\n        /// </summary>\n        public IEnumerable<OptionStrategyDefinitionMatch> Match(\n            OptionStrategyMatcherOptions options,\n            OptionPositionCollection positions\n            )\n        {\n            // TODO : Pass OptionStrategyMatcherOptions in and respect applicable options\n            if (positions.Count < LegCount)\n            {\n                return Enumerable.Empty<OptionStrategyDefinitionMatch>();\n            }\n\n            var multiplier = int.MaxValue;\n\n            // first check underlying lots has correct sign and sufficient magnitude\n            var underlyingLotsSign = Math.Sign(UnderlyingLots);\n            if (underlyingLotsSign != 0)\n            {\n                var underlyingPositionSign = Math.Sign(positions.UnderlyingQuantity);\n                if (underlyingLotsSign != underlyingPositionSign ||\n                    Math.Abs(positions.UnderlyingQuantity) < Math.Abs(UnderlyingLots))\n                {\n                    return Enumerable.Empty<OptionStrategyDefinitionMatch>();\n                }\n\n                // set multiplier for underlying\n                multiplier = positions.UnderlyingQuantity / UnderlyingLots;\n            }\n\n            // TODO : Consider add OptionStrategyLegDefinition for underlying for consistency purposes.\n            //        Might want to enforce that it's always the first leg definition as well for easier slicing.\n            return Match(options,\n                ImmutableList<OptionStrategyLegDefinitionMatch>.Empty,\n                ImmutableList<OptionPosition>.Empty,\n                positions,\n                multiplier\n            ).Distinct();\n        }\n\n        private IEnumerable<OptionStrategyDefinitionMatch> Match(\n            OptionStrategyMatcherOptions options,\n            ImmutableList<OptionStrategyLegDefinitionMatch> legMatches,\n            ImmutableList<OptionPosition> legPositions,\n            OptionPositionCollection positions,\n            int multiplier\n            )\n        {\n            var nextLegIndex = legPositions.Count;\n            if (nextLegIndex == Legs.Count)\n            {\n                if (nextLegIndex > 0)\n                {\n                    yield return new OptionStrategyDefinitionMatch(this, legMatches, multiplier);\n                }\n            }\n            else if (positions.Count >= LegCount - nextLegIndex)\n            {\n                // grab the next leg definition and perform the match, restricting total to configured maximum per leg\n                var nextLeg = Legs[nextLegIndex];\n                var maxLegMatch = options.GetMaximumLegMatches(nextLegIndex);\n                foreach (var legMatch in nextLeg.Match(options, legPositions, positions).Take(maxLegMatch))\n                {\n                    // add match to the match we're constructing and deduct matched position from positions collection\n                    // we track the min multiplier in line so when we're done, we have the total number of matches for\n                    // the matched set of positions in this 'thread' (OptionStrategy.Quantity)\n                    foreach (var definitionMatch in Match(options,\n                        legMatches.Add(legMatch),\n                        legPositions.Add(legMatch.Position),\n                        positions - legMatch.Position,\n                        Math.Min(multiplier, legMatch.Multiplier)\n                    ))\n                    {\n                        yield return definitionMatch;\n                    }\n                }\n            }\n            else\n            {\n                // positions.Count < LegsCount indicates a failed match\n\n                // could include partial matches, would allow an algorithm to determine if adding a\n                // new position could help reduce overall margin exposure by completing a strategy\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return Name;\n        }\n\n        /// <summary>\n        /// Factory function for creating definitions\n        /// </summary>\n        public static OptionStrategyDefinition Create(string name, int underlyingLots, params OptionStrategyLegDefinition[] legs)\n        {\n            return new OptionStrategyDefinition(name, underlyingLots, legs);\n        }\n\n        /// <summary>\n        /// Factory function for creating definitions\n        /// </summary>\n        public static OptionStrategyDefinition Create(string name, params OptionStrategyLegDefinition[] legs)\n        {\n            return new OptionStrategyDefinition(name, 0, legs);\n        }\n\n        /// <summary>\n        /// Factory function for creating definitions\n        /// </summary>\n        public static OptionStrategyDefinition Create(string name, params Func<Builder, Builder>[] predicates)\n        {\n            return predicates.Aggregate(new Builder(name),\n                (builder, predicate) => predicate(builder)\n            ).Build();\n        }\n\n        /// <summary>\n        /// Factory function for creating a call leg definition\n        /// </summary>\n        public static OptionStrategyLegDefinition CallLeg(int quantity,\n            params Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>>[] predicates\n            )\n        {\n            return OptionStrategyLegDefinition.Create(OptionRight.Call, quantity, predicates);\n        }\n\n        /// <summary>\n        /// Factory function for creating a put leg definition\n        /// </summary>\n        public static OptionStrategyLegDefinition PutLeg(int quantity,\n            params Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>>[] predicates\n            )\n        {\n            return OptionStrategyLegDefinition.Create(OptionRight.Put, quantity, predicates);\n        }\n\n        /// <summary>\n        /// Builder class supporting fluent syntax in constructing <see cref=\"OptionStrategyDefinition\"/>.\n        /// </summary>\n        public class Builder\n        {\n            private readonly string _name;\n\n            private int _underlyingLots;\n            private List<OptionStrategyLegDefinition> _legs;\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"Builder\"/> class\n            /// </summary>\n            public Builder(string name)\n            {\n                _name = name;\n                _legs = new List<OptionStrategyLegDefinition>();\n            }\n\n            /// <summary>\n            /// Sets the required number of underlying lots\n            /// </summary>\n            public Builder WithUnderlyingLots(int lots)\n            {\n                if (_underlyingLots != 0)\n                {\n                    throw new InvalidOperationException(\"Underlying lots has already been set.\");\n                }\n\n                _underlyingLots = lots;\n                return this;\n            }\n\n            /// <summary>\n            /// Adds a call leg\n            /// </summary>\n            public Builder WithCall(int quantity,\n                params Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>>[] predicates\n                )\n            {\n                _legs.Add(OptionStrategyLegDefinition.Create(OptionRight.Call, quantity, predicates));\n                return this;\n            }\n\n            /// <summary>\n            /// Adds a put leg\n            /// </summary>\n            public Builder WithPut(int quantity,\n                params Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>>[] predicates\n                )\n            {\n                _legs.Add(OptionStrategyLegDefinition.Create(OptionRight.Put, quantity, predicates));\n                return this;\n            }\n\n            /// <summary>\n            /// Builds the <see cref=\"OptionStrategyDefinition\"/>\n            /// </summary>\n            public OptionStrategyDefinition Build()\n            {\n                return new OptionStrategyDefinition(_name, _underlyingLots, _legs);\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<OptionStrategyLegDefinition> GetEnumerator()\n        {\n            return Legs.GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitionMatch.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines a match of <see cref=\"OptionPosition\"/> to a <see cref=\"OptionStrategyDefinition\"/>\n    /// </summary>\n    public class OptionStrategyDefinitionMatch : IEquatable<OptionStrategyDefinitionMatch>\n    {\n        /// <summary>\n        /// The <see cref=\"OptionStrategyDefinition\"/> matched\n        /// </summary>\n        public OptionStrategyDefinition Definition { get; }\n\n        /// <summary>\n        /// The number of times the definition is able to match the available positions.\n        /// Since definitions are formed at the 'unit' level, such as having 1 contract,\n        /// the multiplier defines how many times the definition matched. This multiplier\n        /// is used to scale the quantity defined in each leg definition when creating the\n        /// <see cref=\"OptionStrategy\"/> objects.\n        /// </summary>\n        public int Multiplier { get; }\n\n        /// <summary>\n        /// The <see cref=\"OptionStrategyLegDefinitionMatch\"/> instances matched to the definition.\n        /// </summary>\n        public IReadOnlyList<OptionStrategyLegDefinitionMatch> Legs { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyDefinitionMatch\"/> class\n        /// </summary>\n        public OptionStrategyDefinitionMatch(\n            OptionStrategyDefinition definition,\n            IReadOnlyList<OptionStrategyLegDefinitionMatch> legs,\n            int multiplier\n            )\n        {\n            Legs = legs;\n            Multiplier = multiplier;\n            Definition = definition;\n        }\n\n        /// <summary>\n        /// Deducts the matched positions from the specified <paramref name=\"positions\"/> taking into account the multiplier\n        /// </summary>\n        public OptionPositionCollection RemoveFrom(OptionPositionCollection positions)\n        {\n            var optionPositions = Legs.Select(leg => leg.CreateOptionPosition(Multiplier));\n            if (Definition.UnderlyingLots != 0)\n            {\n                optionPositions = optionPositions.Concat(new[]\n                {\n                    new OptionPosition(Legs[0].Position.Symbol.Underlying, Definition.UnderlyingLots * Multiplier)\n                });\n            }\n            return positions.RemoveRange(optionPositions);\n        }\n\n        /// <summary>\n        /// Creates the <see cref=\"OptionStrategy\"/> instance this match represents\n        /// </summary>\n        public OptionStrategy CreateStrategy()\n        {\n            var legs = Legs\n                // if Definition.UnderlyingLots is not 0, we will create the underlying leg separately\n                .Where(leg => leg.Position.Symbol.HasUnderlying || Definition.UnderlyingLots == 0)\n                .Select(leg => leg.CreateOptionStrategyLeg(Multiplier));\n\n            if (Definition.UnderlyingLots != 0)\n            {\n                legs = legs.Concat([OptionStrategy.UnderlyingLegData.Create(Definition.UnderlyingLots * Multiplier, Legs[0].Position.Underlying)]);\n            }\n\n            return OptionStrategy.Create(Definition.Name, legs);\n        }\n\n        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.</returns>\n        public bool Equals(OptionStrategyDefinitionMatch other)\n        {\n            if (ReferenceEquals(null, other))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, other))\n            {\n                return true;\n            }\n\n            if (!Equals(Definition, other.Definition))\n            {\n                return false;\n            }\n\n            // index legs by OptionPosition so we can do the equality while ignoring ordering\n            var positions = other.Legs.ToDictionary(leg => leg.Position, leg => leg.Multiplier);\n            foreach (var leg in other.Legs)\n            {\n                int multiplier;\n                if (!positions.TryGetValue(leg.Position, out multiplier))\n                {\n                    return false;\n                }\n\n                if (leg.Multiplier != multiplier)\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        /// <summary>Determines whether the specified object is equal to the current object.</summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>true if the specified object  is equal to the current object; otherwise, false.</returns>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, obj))\n            {\n                return true;\n            }\n\n            if (obj.GetType() != GetType())\n            {\n                return false;\n            }\n\n            return Equals((OptionStrategyDefinitionMatch) obj);\n        }\n\n        /// <summary>Serves as the default hash function. </summary>\n        /// <returns>A hash code for the current object.</returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                // we want to ensure that the ordering of legs does not impact equality operators in\n                // pursuit of this, we compute the hash codes of each leg, placing them into an array\n                // and then sort the array. using the sorted array, aggregates the hash codes\n\n                var hashCode = Definition.GetHashCode();\n                var arr = new int[Legs.Count];\n                for (int i = 0; i < Legs.Count; i++)\n                {\n                    arr[i] = Legs[i].GetHashCode();\n                }\n\n                Array.Sort(arr);\n\n                for (int i = 0; i < arr.Length; i++)\n                {\n                    hashCode = (hashCode * 397) ^ arr[i];\n                }\n\n                return hashCode;\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return $\"{Definition.Name}: {string.Join(\"|\", Legs.Select(leg => leg.Position))}\";\n        }\n\n        /// <summary>\n        /// OptionStrategyDefinitionMatch == Operator\n        /// </summary>\n        /// <returns>True if they are the same</returns>\n        public static bool operator ==(OptionStrategyDefinitionMatch left, OptionStrategyDefinitionMatch right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// OptionStrategyDefinitionMatch != Operator\n        /// </summary>\n        /// <returns>True if they are not the same</returns>\n        public static bool operator !=(OptionStrategyDefinitionMatch left, OptionStrategyDefinitionMatch right)\n        {\n            return !Equals(left, right);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides a listing of pre-defined <see cref=\"OptionStrategyDefinition\"/>\n    /// These definitions are blueprints for <see cref=\"OptionStrategy\"/> instances.\n    /// Factory functions for those can be found at <see cref=\"OptionStrategies\"/>\n    /// </summary>\n    public static class OptionStrategyDefinitions\n    {\n        // lazy since 'AllDefinitions' is at top of file and static members are evaluated in order\n        private static readonly Lazy<ImmutableList<OptionStrategyDefinition>> All\n            = new Lazy<ImmutableList<OptionStrategyDefinition>>(() =>\n                typeof(OptionStrategyDefinitions)\n                    .GetProperties(BindingFlags.Public | BindingFlags.Static)\n                    .Where(property => property.PropertyType == typeof(OptionStrategyDefinition))\n                    .Select(property => (OptionStrategyDefinition)property.GetValue(null))\n                    .ToImmutableList()\n            );\n\n        /// <summary>\n        /// Collection of all OptionStrategyDefinitions\n        /// </summary>\n        public static ImmutableList<OptionStrategyDefinition> AllDefinitions\n        {\n            get\n            {\n                var strategies = All.Value;\n\n                return strategies\n                    .SelectMany(optionStrategy => {\n                        // when selling the strategy can get reverted and it's still valid, we need the definition to match against\n                        var inverted = new OptionStrategyDefinition(optionStrategy.Name, optionStrategy.UnderlyingLots * -1,\n                            optionStrategy.Legs.Select(leg => new OptionStrategyLegDefinition(leg.Right, leg.Quantity * -1, leg)));\n\n                        if (strategies.Any(strategy => strategy.UnderlyingLots == inverted.UnderlyingLots\n                            && strategy.Legs.Count == inverted.Legs.Count\n                            && strategy.Legs.All(leg => inverted.Legs.\n                                Any(invertedLeg => invertedLeg.Right == leg.Right\n                                    && leg.Quantity == invertedLeg.Quantity\n                                    && leg.All(predicate => invertedLeg.Any(invertedPredicate => invertedPredicate.ToString() == predicate.ToString()))))))\n                        {\n                            // some strategies inverted have a different name we already know, let's skip those\n                            return new[] { optionStrategy };\n                        }\n                        return new[] { optionStrategy, inverted };\n                    })\n                    .ToImmutableList();\n            }\n        }\n\n        /// <summary>\n        /// Hold 1 lot of the underlying and sell 1 call contract\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"ProtectiveCall\"/></remarks>\n        public static OptionStrategyDefinition CoveredCall { get; }\n            = OptionStrategyDefinition.Create(\"Covered Call\", 1,\n                OptionStrategyDefinition.CallLeg(-1)\n            );\n\n        /// <summary>\n        /// Hold -1 lot of the underlying and buy 1 call contract\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"CoveredCall\"/></remarks>\n        public static OptionStrategyDefinition ProtectiveCall { get; }\n            = OptionStrategyDefinition.Create(\"Protective Call\", -1,\n                OptionStrategyDefinition.CallLeg(1)\n            );\n\n        /// <summary>\n        /// Hold -1 lot of the underlying and sell 1 put contract\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"ProtectivePut\"/></remarks>\n        public static OptionStrategyDefinition CoveredPut { get; }\n            = OptionStrategyDefinition.Create(\"Covered Put\", -1,\n                OptionStrategyDefinition.PutLeg(-1)\n            );\n\n        /// <summary>\n        /// Hold 1 lot of the underlying and buy 1 put contract\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"CoveredPut\"/></remarks>\n        public static OptionStrategyDefinition ProtectivePut { get; }\n            = OptionStrategyDefinition.Create(\"Protective Put\", 1,\n                OptionStrategyDefinition.PutLeg(1)\n            );\n\n        /// <summary>\n        /// Hold 1 lot of the underlying, sell 1 call contract and buy 1 put contract.\n        /// The strike price of the short call is below the strike of the long put with the same expiration.\n        /// </summary>\n        /// <remarks>Combination of <see cref=\"CoveredCall\"/> and <see cref=\"ProtectivePut\"/></remarks>\n        public static OptionStrategyDefinition ProtectiveCollar { get; }\n            = OptionStrategyDefinition.Create(\"Protective Collar\", 1,\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.PutLeg(1, (legs, p) => p.Strike < legs[0].Strike,\n                                                   (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Hold 1 lot of the underlying, sell 1 call contract and buy 1 put contract.\n        /// The strike price of the call and put are the same, with the same expiration.\n        /// </summary>\n        /// <remarks>A special case of <see cref=\"ProtectiveCollar\"/></remarks>\n        public static OptionStrategyDefinition Conversion { get; }\n            = OptionStrategyDefinition.Create(\"Conversion\", 1,\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.PutLeg(1, (legs, p) => p.Strike == legs[0].Strike,\n                                                   (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Hold 1 lot of the underlying, sell 1 call contract and buy 1 put contract.\n        /// The strike price of the call and put are the same, with the same expiration.\n        /// </summary>\n        /// <remarks>Inverse of <see cref=\"Conversion\"/></remarks>\n        public static OptionStrategyDefinition ReverseConversion { get; }\n            = OptionStrategyDefinition.Create(\"Reverse Conversion\", -1,\n                OptionStrategyDefinition.CallLeg(1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                   (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Sell 1 call contract without holding the underlying\n        /// </summary>\n        public static OptionStrategyDefinition NakedCall { get; }\n            = OptionStrategyDefinition.Create(\"Naked Call\",\n                OptionStrategyDefinition.CallLeg(-1)\n            );\n\n        /// <summary>\n        /// Sell 1 put contract without holding the underlying\n        /// </summary>\n        public static OptionStrategyDefinition NakedPut { get; }\n            = OptionStrategyDefinition.Create(\"Naked Put\",\n                OptionStrategyDefinition.PutLeg(-1)\n            );\n\n        /// <summary>\n        /// Bear Call Spread strategy consists of two calls with the same expiration but different strikes.\n        /// The strike price of the short call is below the strike of the long call. This is a credit spread.\n        /// </summary>\n        public static OptionStrategyDefinition BearCallSpread { get; }\n            = OptionStrategyDefinition.Create(\"Bear Call Spread\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+1, (legs, p) => p.Strike > legs[0].Strike,\n                                                     (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Bear Put Spread strategy consists of two puts with the same expiration but different strikes.\n        /// The strike price of the short put is below the strike of the long put. This is a debit spread.\n        /// </summary>\n        public static OptionStrategyDefinition BearPutSpread { get; }\n            = OptionStrategyDefinition.Create(\"Bear Put Spread\",\n                OptionStrategyDefinition.PutLeg(1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Bull Call Spread strategy consists of two calls with the same expiration but different strikes.\n        /// The strike price of the short call is higher than the strike of the long call. This is a debit spread.\n        /// </summary>\n        public static OptionStrategyDefinition BullCallSpread { get; }\n            = OptionStrategyDefinition.Create(\"Bull Call Spread\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-1, (legs, p) => p.Strike > legs[0].Strike,\n                                                     (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Method creates new Bull Put Spread strategy, that consists of two puts with the same expiration but\n        /// different strikes. The strike price of the short put is above the strike of the long put. This is a\n        /// credit spread.\n        /// </summary>\n        public static OptionStrategyDefinition BullPutSpread { get; }\n            = OptionStrategyDefinition.Create(\"Bull Put Spread\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Straddle strategy is a combination of buying a call and buying a put, both with the same strike price\n        /// and expiration.\n        /// </summary>\n        public static OptionStrategyDefinition Straddle { get; }\n            = OptionStrategyDefinition.Create(\"Straddle\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Straddle strategy is a combination of selling a call and selling a put, both with the same strike price\n        /// and expiration.\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"Straddle\"/></remarks>\n        public static OptionStrategyDefinition ShortStraddle { get; }\n            = OptionStrategyDefinition.Create(\"Short Straddle\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Strangle strategy consists of buying a call option and a put option with the same expiration date.\n        /// The strike price of the call is above the strike of the put.\n        /// </summary>\n        public static OptionStrategyDefinition Strangle { get; }\n            = OptionStrategyDefinition.Create(\"Strangle\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Strangle strategy consists of selling a call option and a put option with the same expiration date.\n        /// The strike price of the call is above the strike of the put.\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"Strangle\"/></remarks>\n        public static OptionStrategyDefinition ShortStrangle { get; }\n            = OptionStrategyDefinition.Create(\"Short Strangle\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Butterfly Call strategy consists of two short calls at a middle strike, and one long call each at a lower\n        /// and upper strike. The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        public static OptionStrategyDefinition ButterflyCall { get; }\n            = OptionStrategyDefinition.Create(\"Butterfly Call\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-2, (legs, p) => p.Strike >= legs[0].Strike,\n                                                     (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, p) => p.Strike >= legs[1].Strike,\n                                                     (legs, p) => p.Expiration == legs[0].Expiration,\n                                                     (legs, p) => p.Strike - legs[1].Strike == legs[1].Strike - legs[0].Strike)\n            );\n\n        /// <summary>\n        /// Butterfly Call strategy consists of two long calls at a middle strike, and one short call each at a lower\n        /// and upper strike. The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        public static OptionStrategyDefinition ShortButterflyCall { get; }\n            = OptionStrategyDefinition.Create(\"Short Butterfly Call\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+2, (legs, p) => p.Strike >= legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, p) => p.Strike >= legs[1].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration,\n                    (legs, p) => p.Strike - legs[1].Strike == legs[1].Strike - legs[0].Strike)\n            );\n\n        /// <summary>\n        /// Butterfly Put strategy consists of two short puts at a middle strike, and one long put each at a lower and\n        /// upper strike. The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        public static OptionStrategyDefinition ButterflyPut { get; }\n            = OptionStrategyDefinition.Create(\"Butterfly Put\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-2, (legs, p) => p.Strike >= legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike >= legs[1].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration,\n                                                    (legs, p) => p.Strike - legs[1].Strike == legs[1].Strike - legs[0].Strike)\n            );\n\n\n        /// <summary>\n        /// Short Butterfly Put strategy consists of two long puts at a middle strike, and one short put each at a lower and\n        /// upper strike. The upper and lower strikes must both be equidistant from the middle strike.\n        /// </summary>\n        public static OptionStrategyDefinition ShortButterflyPut { get; }\n            = OptionStrategyDefinition.Create(\"Short Butterfly Put\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+2, (legs, p) => p.Strike >= legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike >= legs[1].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration,\n                    (legs, p) => p.Strike - legs[1].Strike == legs[1].Strike - legs[0].Strike)\n            );\n\n        /// <summary>\n        /// Call Calendar Spread strategy is a short one call option and long a second call option with a more distant\n        /// expiration.\n        /// </summary>\n        public static OptionStrategyDefinition CallCalendarSpread { get; }\n            = OptionStrategyDefinition.Create(\"Call Calendar Spread\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+1, (legs, p) => p.Strike == legs[0].Strike,\n                                                     (legs, p) => p.Expiration > legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Call Calendar Spread strategy is long one call option and short a second call option with a more distant\n        /// expiration.\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"CallCalendarSpread\"/></remarks>\n        public static OptionStrategyDefinition ShortCallCalendarSpread { get; }\n            = OptionStrategyDefinition.Create(\"Short Call Calendar Spread\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                     (legs, p) => p.Expiration > legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Put Calendar Spread strategy is a short one put option and long a second put option with a more distant\n        /// expiration.\n        /// </summary>\n        public static OptionStrategyDefinition PutCalendarSpread { get; }\n            = OptionStrategyDefinition.Create(\"Put Calendar Spread\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration > legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Put Calendar Spread strategy is long one put option and short a second put option with a more distant\n        /// expiration.\n        /// </summary>\n        /// <remarks>Inverse of the <see cref=\"PutCalendarSpread\"/></remarks>\n        public static OptionStrategyDefinition ShortPutCalendarSpread { get; }\n            = OptionStrategyDefinition.Create(\"Short Put Calendar Spread\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration > legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Iron Butterfly strategy consists of a short ATM call, a short ATM put, a long OTM call, and a long OTM put.\n        /// The strike spread between ATM and OTM call and put are the same. All at the same expiration date.\n        /// </summary>\n        public static OptionStrategyDefinition IronButterfly { get; }\n            = OptionStrategyDefinition.Create(\"Iron Butterfly\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike == legs[0].Strike,\n                    (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike == legs[0].Strike * 2 - legs[1].Strike,\n                    (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Iron Butterfly strategy consists of a long ATM call, a long ATM put, a short OTM call, and a short OTM put.\n        /// The strike spread between ATM and OTM call and put are the same. All at the same expiration date.\n        /// </summary>\n        public static OptionStrategyDefinition ShortIronButterfly { get; }\n            = OptionStrategyDefinition.Create(\"Short Iron Butterfly\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike == legs[0].Strike,\n                    (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike == legs[0].Strike * 2 - legs[1].Strike,\n                    (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Iron Condor strategy is buying a put, selling a put with a higher strike price, selling a call and buying a call with a higher strike price.\n        /// All at the same expiration date\n        /// </summary>\n        public static OptionStrategyDefinition IronCondor { get; }\n            = OptionStrategyDefinition.Create(\"Iron Condor\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike > legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, p) => p.Strike > legs[1].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(1, (legs, p) => p.Strike > legs[2].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Iron Condor strategy is selling a put, buying a put with a higher strike price, buying a call and selling a call with a higher strike price.\n        /// All at the same expiration date\n        /// </summary>\n        public static OptionStrategyDefinition ShortIronCondor { get; }\n            = OptionStrategyDefinition.Create(\"Short Iron Condor\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike > legs[0].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, p) => p.Strike > legs[1].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, p) => p.Strike > legs[2].Strike,\n                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Long Box Spread strategy is long 1 call and short 1 put with the same strike,\n        /// while short 1 call and long 1 put with a higher, same strike. All options have the same expiry.\n        /// expiration.\n        /// </summary>\n        public static OptionStrategyDefinition BoxSpread { get; }\n            = OptionStrategyDefinition.Create(\"Box Spread\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike == legs[1].Strike,\n                                                    (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike == legs[0].Strike,\n                                                    (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Box Spread strategy is short 1 call and long 1 put with the same strike,\n        /// while long 1 call and short 1 put with a higher, same strike. All options have the same expiry.\n        /// expiration.\n        /// </summary>\n        public static OptionStrategyDefinition ShortBoxSpread { get; }\n            = OptionStrategyDefinition.Create(\"Short Box Spread\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike == legs[1].Strike,\n                                                    (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike == legs[0].Strike,\n                                                    (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Jelly Roll is short 1 call and long 1 call with the same strike but further expiry, together with\n        /// long 1 put and short 1 put with the same strike and expiries as calls.\n        /// </summary>\n        public static OptionStrategyDefinition JellyRoll { get; }\n            = OptionStrategyDefinition.Create(\"Jelly Roll\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike == legs[0].Strike,\n                                                     (legs, c) => c.Expiration > legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[1].Expiration)\n            );\n\n        /// <summary>\n        /// Short Jelly Roll is long 1 call and short 1 call with the same strike but further expiry, together with\n        /// short 1 put and long 1 put with the same strike and expiries as calls.\n        /// </summary>\n        public static OptionStrategyDefinition ShortJellyRoll { get; }\n            = OptionStrategyDefinition.Create(\"Short Jelly Roll\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike == legs[0].Strike,\n                                                     (legs, c) => c.Expiration > legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike == legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[1].Expiration)\n            );\n\n        /// <summary>\n        /// Bear Call Ladder strategy is short 1 call and long 2 calls, with ascending strike prices in order,\n        /// All options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition BearCallLadder { get; }\n            = OptionStrategyDefinition.Create(\"Bear Call Ladder\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike > legs[0].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(+1, (legs, c) => c.Strike > legs[1].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Bear Put Ladder strategy is long 1 put and short 2 puts, with descending strike prices in order,\n        /// All options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition BearPutLadder { get; }\n            = OptionStrategyDefinition.Create(\"Bear Put Ladder\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(-1, (legs, p) => p.Strike < legs[1].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Bull Call Ladder strategy is long 1 call and short 2 calls, with ascending strike prices in order,\n        /// All options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition BullCallLadder { get; }\n            = OptionStrategyDefinition.Create(\"Bull Call Ladder\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike > legs[0].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.CallLeg(-1, (legs, c) => c.Strike > legs[1].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Bull Put Ladder strategy is short 1 put and long 2 puts, with descending strike prices in order,\n        /// All options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition BullPutLadder { get; }\n            = OptionStrategyDefinition.Create(\"Bull Put Ladder\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration),\n                OptionStrategyDefinition.PutLeg(+1, (legs, p) => p.Strike < legs[1].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Call Backspread strategy is short 1 call and long 2 calls, with ascending strike prices in order,\n        /// both options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition CallBackspread { get; }\n            = OptionStrategyDefinition.Create(\"Call Backspread\",\n                OptionStrategyDefinition.CallLeg(-1),\n                OptionStrategyDefinition.CallLeg(+2, (legs, c) => c.Strike > legs[0].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Put Backspread strategy is short 1 put and long 2 puts, with descending strike prices in order,\n        /// both options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition PutBackspread { get; }\n            = OptionStrategyDefinition.Create(\"Put Backspread\",\n                OptionStrategyDefinition.PutLeg(-1),\n                OptionStrategyDefinition.PutLeg(+2, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Call Backspread strategy is long 1 call and short 2 calls, with ascending strike prices in order,\n        /// both options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition ShortCallBackspread { get; }\n            = OptionStrategyDefinition.Create(\"Short Call Backspread\",\n                OptionStrategyDefinition.CallLeg(+1),\n                OptionStrategyDefinition.CallLeg(-2, (legs, c) => c.Strike > legs[0].Strike,\n                                                     (legs, c) => c.Expiration == legs[0].Expiration)\n            );\n\n        /// <summary>\n        /// Short Put Backspread strategy is long 1 put and short 2 puts, with descending strike prices in order,\n        /// both options have the same expiry.\n        /// </summary>\n        public static OptionStrategyDefinition ShortPutBackspread { get; }\n            = OptionStrategyDefinition.Create(\"Short Put Backspread\",\n                OptionStrategyDefinition.PutLeg(+1),\n                OptionStrategyDefinition.PutLeg(-2, (legs, p) => p.Strike < legs[0].Strike,\n                                                    (legs, p) => p.Expiration == legs[0].Expiration)\n            );\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyLegDefinition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines a single option leg in an option strategy. This definition supports direct\n    /// match (does position X match the definition) and position collection filtering (filter\n    /// collection to include matches)\n    /// </summary>\n    public class OptionStrategyLegDefinition : IEnumerable<OptionStrategyLegPredicate>\n    {\n        private readonly OptionStrategyLegPredicate[] _predicates;\n\n        /// <summary>\n        /// Gets the unit quantity\n        /// </summary>\n        public int Quantity { get; }\n\n        /// <summary>\n        /// Gets the contract right\n        /// </summary>\n        public OptionRight Right { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyLegDefinition\"/> class\n        /// </summary>\n        /// <param name=\"right\">The leg's contract right</param>\n        /// <param name=\"quantity\">The leg's unit quantity</param>\n        /// <param name=\"predicates\">The conditions a position must meet in order to match this definition</param>\n        public OptionStrategyLegDefinition(OptionRight right, int quantity, IEnumerable<OptionStrategyLegPredicate> predicates)\n        {\n            Right = right;\n            Quantity = quantity;\n            _predicates = predicates.ToArray();\n        }\n\n        /// <summary>\n        /// Yields all possible matches for this leg definition held within the collection of <paramref name=\"positions\"/>\n        /// </summary>\n        /// <param name=\"options\">Strategy matcher options guiding matching behaviors</param>\n        /// <param name=\"legs\">The preceding legs already matched for the parent strategy definition</param>\n        /// <param name=\"positions\">The remaining, unmatched positions available to be matched against</param>\n        /// <returns>An enumerable of potential matches</returns>\n        public IEnumerable<OptionStrategyLegDefinitionMatch> Match(\n            OptionStrategyMatcherOptions options,\n            IReadOnlyList<OptionPosition> legs,\n            OptionPositionCollection positions\n            )\n        {\n            foreach (var position in options.Enumerate(Filter(legs, positions, false)))\n            {\n                var multiplier = position.Quantity / Quantity;\n                if (multiplier != 0)\n                {\n                    yield return new OptionStrategyLegDefinitionMatch(multiplier,\n                        position.WithQuantity(multiplier * Quantity)\n                    );\n                }\n            }\n        }\n\n        /// <summary>\n        /// Filters the provided <paramref name=\"positions\"/> collection such that any remaining positions are all\n        /// valid options that match this leg definition instance.\n        /// </summary>\n        public OptionPositionCollection Filter(IReadOnlyList<OptionPosition> legs, OptionPositionCollection positions, bool includeUnderlying = true)\n        {\n            // first filter down to applicable right\n            positions = positions.Slice(Right, includeUnderlying);\n            if (positions.IsEmpty)\n            {\n                return positions;\n            }\n\n            // second filter according to the required side\n            var side = (PositionSide) Math.Sign(Quantity);\n            positions = positions.Slice(side, includeUnderlying);\n            if (positions.IsEmpty)\n            {\n                return positions;\n            }\n\n            // these are ordered such that indexed filters are performed force and\n            // opaque/complex predicates follow since they require full table scans\n            foreach (var predicate in _predicates)\n            {\n                positions = predicate.Filter(legs, positions, includeUnderlying);\n                if (positions.IsEmpty)\n                {\n                    break;\n                }\n            }\n\n            // at this point, every position in the positions\n            // collection is a valid match for this definition\n            return positions;\n        }\n\n        /// <summary>\n        /// Creates the appropriate <see cref=\"Leg\"/> for the specified <paramref name=\"match\"/>\n        /// </summary>\n        public Leg CreateLegData(OptionStrategyLegDefinitionMatch match)\n        {\n            return CreateLegData(\n                match.Position.Symbol,\n                match.Position.Quantity / Quantity\n            );\n        }\n\n        /// <summary>\n        /// Creates the appropriate <see cref=\"OptionStrategy.LegData\"/> with the specified <paramref name=\"quantity\"/>\n        /// </summary>\n        public static Leg CreateLegData(Symbol symbol, int quantity)\n        {\n            if (symbol.SecurityType == SecurityType.Option)\n            {\n                return OptionStrategy.OptionLegData.Create(quantity, symbol);\n            }\n\n            return OptionStrategy.UnderlyingLegData.Create(quantity);\n        }\n\n        /// <summary>\n        /// Determines whether or not this leg definition matches the specified <paramref name=\"position\"/>,\n        /// and if so, what the resulting quantity of the <see cref=\"OptionStrategy.OptionLegData\"/> should be.\n        /// </summary>\n        public bool TryMatch(OptionPosition position, out Leg leg)\n        {\n            if (Right != position.Right ||\n                Math.Sign(Quantity) != Math.Sign(position.Quantity))\n            {\n                leg = null;\n                return false;\n            }\n\n            var quantity = position.Quantity / Quantity;\n            if (quantity == 0)\n            {\n                leg = null;\n                return false;\n            }\n\n            leg = position.Symbol.SecurityType == SecurityType.Option\n                ? (Leg) OptionStrategy.OptionLegData.Create(quantity, position.Symbol)\n                : OptionStrategy.UnderlyingLegData.Create(quantity);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionStrategyLegDefinition\"/> matching the specified parameters\n        /// </summary>\n        public static OptionStrategyLegDefinition Create(OptionRight right, int quantity,\n            IEnumerable<Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>>> predicates\n            )\n        {\n            return new OptionStrategyLegDefinition(right, quantity,\n                // sort predicates such that indexed predicates are evaluated first\n                // this leaves fewer positions to be evaluated by the full table scan\n                predicates.Select(OptionStrategyLegPredicate.Create).OrderBy(p => p.IsIndexed ? 0 : 1)\n            );\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<OptionStrategyLegPredicate> GetEnumerator()\n        {\n            foreach (var predicate in _predicates)\n            {\n                yield return predicate;\n            }\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyLegDefinitionMatch.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines the item result type of <see cref=\"OptionStrategyLegDefinition.Match\"/>, containing the number of\n    /// times the leg definition matched the position (<see cref=\"Multiplier\"/>) and applicable portion of the position.\n    /// </summary>\n    public struct OptionStrategyLegDefinitionMatch : IEquatable<OptionStrategyLegDefinitionMatch>\n    {\n        /// <summary>\n        /// The number of times the definition is able to match the position. For example,\n        /// if the definition requires +2 contracts and the algorithm's position has +5\n        /// contracts, then this multiplier would equal 2.\n        /// </summary>\n        public int Multiplier { get; }\n\n        /// <summary>\n        /// The position that was successfully matched with the total quantity matched. For example,\n        /// if the definition requires +2 contracts and this multiplier equals 2, then this position\n        /// would have a quantity of 4. This may be different than the remaining/total quantity\n        /// available in the positions collection.\n        /// </summary>\n        public OptionPosition Position { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyLegDefinitionMatch\"/> struct\n        /// </summary>\n        /// <param name=\"multiplier\">The number of times the positions matched the leg definition</param>\n        /// <param name=\"position\">The position that matched the leg definition</param>\n        public OptionStrategyLegDefinitionMatch(int multiplier, OptionPosition position)\n        {\n            Position = position;\n            Multiplier = multiplier;\n        }\n\n        /// <summary>\n        /// Creates the appropriate type of <see cref=\"Leg\"/> for this matched position\n        /// </summary>\n        /// <param name=\"multiplier\">The multiplier to use for creating the leg data. This multiplier will be\n        /// the minimum multiplier of all legs within a strategy definition match. Each leg defines its own\n        /// multiplier which is the max matches for that leg and the strategy definition's multiplier is the\n        /// min of the individual legs.</param>\n        public Leg CreateOptionStrategyLeg(int multiplier)\n        {\n            var quantity = Position.Quantity;\n            if (Multiplier != multiplier)\n            {\n                if (multiplier > Multiplier)\n                {\n                    throw new ArgumentOutOfRangeException(nameof(multiplier), \"Unable to create strategy leg with a larger multiplier than matched.\");\n                }\n\n                // back out the unit quantity and scale it up to the requested multiplier\n                var unit = Position.Quantity / Multiplier;\n                quantity = unit * multiplier;\n            }\n\n            return Position.IsUnderlying\n                ? (Leg) OptionStrategy.UnderlyingLegData.Create(quantity, Position.Symbol)\n                : OptionStrategy.OptionLegData.Create(quantity, Position.Symbol);\n        }\n\n        /// <summary>\n        /// Creates the appropriate <see cref=\"OptionPosition\"/> for this matched position\n        /// </summary>\n        /// <param name=\"multiplier\">The multiplier to use for creating the OptionPosition. This multiplier will be\n        /// the minimum multiplier of all legs within a strategy definition match. Each leg defines its own\n        /// multiplier which is the max matches for that leg and the strategy definition's multiplier is the\n        /// min of the individual legs.</param>\n        public OptionPosition CreateOptionPosition(int multiplier)\n        {\n            var quantity = Position.Quantity;\n            if (Multiplier != multiplier)\n            {\n                if (multiplier > Multiplier)\n                {\n                    throw new ArgumentOutOfRangeException(nameof(multiplier), \"Unable to create strategy leg with a larger multiplier than matched.\");\n                }\n\n                // back out the unit quantity and scale it up to the requested multiplier\n                var unit = Position.Quantity / Multiplier;\n                quantity = unit * multiplier;\n            }\n\n            return new OptionPosition(Position.Symbol, quantity);\n        }\n\n        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.</returns>\n        public bool Equals(OptionStrategyLegDefinitionMatch other)\n        {\n            return Multiplier == other.Multiplier && Position.Equals(other.Position);\n        }\n\n        /// <summary>Indicates whether this instance and a specified object are equal.</summary>\n        /// <param name=\"obj\">The object to compare with the current instance. </param>\n        /// <returns>true if <paramref name=\"obj\" /> and this instance are the same type and represent the same value; otherwise, false. </returns>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return false;\n            }\n\n            return obj is OptionStrategyLegDefinitionMatch && Equals((OptionStrategyLegDefinitionMatch) obj);\n        }\n\n        /// <summary>Returns the hash code for this instance.</summary>\n        /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (Multiplier * 397) ^ Position.GetHashCode();\n            }\n        }\n\n        /// <summary>Returns the fully qualified type name of this instance.</summary>\n        /// <returns>The fully qualified type name.</returns>\n        public override string ToString()\n        {\n            return $\"{Multiplier} Matches|{Position}\";\n        }\n\n        /// <summary>\n        /// OptionStrategyLegDefinitionMatch == Operator\n        /// </summary>\n        /// <returns>True if they are equal</returns>\n        public static bool operator ==(OptionStrategyLegDefinitionMatch left, OptionStrategyLegDefinitionMatch right)\n        {\n            return left.Equals(right);\n        }\n\n        /// <summary>\n        /// OptionStrategyLegDefinitionMatch != Operator\n        /// </summary>\n        /// <returns>True if they are not equal</returns>\n        public static bool operator !=(OptionStrategyLegDefinitionMatch left, OptionStrategyLegDefinitionMatch right)\n        {\n            return !left.Equals(right);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyLegPredicate.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines a condition under which a particular <see cref=\"OptionPosition\"/> can be combined with\n    /// a preceding list of leg (also of type <see cref=\"OptionPosition\"/>) to achieve a particular\n    /// option strategy.\n    /// </summary>\n    public class OptionStrategyLegPredicate\n    {\n        private readonly BinaryComparison _comparison;\n        private readonly IOptionStrategyLegPredicateReferenceValue _reference;\n        private readonly Func<IReadOnlyList<OptionPosition>, OptionPosition, bool> _predicate;\n        private readonly Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>> _expression;\n\n        /// <summary>\n        /// Determines whether or not this predicate is able to utilize <see cref=\"OptionPositionCollection\"/> indexes.\n        /// </summary>\n        public bool IsIndexed => _comparison != null && _reference != null;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyLegPredicate\"/> class\n        /// </summary>\n        /// <param name=\"comparison\">The <see cref=\"BinaryComparison\"/> invoked</param>\n        /// <param name=\"reference\">The reference value, such as a strike price, encapsulated within the\n        /// <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> to enable resolving the value from different potential sets.</param>\n        /// <param name=\"predicate\">The compiled predicate expression</param>\n        /// <param name=\"expression\">The predicate expression, from which, all other values were derived.</param>\n        public OptionStrategyLegPredicate(\n            BinaryComparison comparison,\n            IOptionStrategyLegPredicateReferenceValue reference,\n            Func<IReadOnlyList<OptionPosition>, OptionPosition, bool> predicate,\n            Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>> expression\n            )\n        {\n            _reference = reference;\n            _predicate = predicate;\n            _comparison = comparison;\n            _expression = expression;\n        }\n\n        /// <summary>\n        /// Determines whether or not the provided combination of preceding <paramref name=\"legs\"/>\n        /// and current <paramref name=\"position\"/> adhere to this predicate's requirements.\n        /// </summary>\n        public bool Matches(IReadOnlyList<OptionPosition> legs, OptionPosition position)\n        {\n            try\n            {\n                return _predicate(legs, position);\n            }\n            catch (InvalidOperationException)\n            {\n                // attempt to access option SecurityIdentifier values, such as strike, on the underlying\n                // this simply means we don't match and can safely ignore this exception. now, this does\n                // somewhat indicate a potential design flaw, but I content that this is better than having\n                // to manage the underlying position separately throughout the entire matching process.\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Filters the specified <paramref name=\"positions\"/> by applying this predicate based on the referenced legs.\n        /// </summary>\n        public OptionPositionCollection Filter(IReadOnlyList<OptionPosition> legs, OptionPositionCollection positions, bool includeUnderlying)\n        {\n            if (!IsIndexed)\n            {\n                // if the predicate references non-indexed properties or contains complex/multiple conditions then\n                // we'll need to do a full table scan. this is not always avoidable, but we should try to avoid it\n                return OptionPositionCollection.Empty.AddRange(\n                    positions.Where(position => _predicate(legs, position))\n                );\n            }\n\n            var referenceValue = _reference.Resolve(legs);\n            switch (_reference.Target)\n            {\n                case PredicateTargetValue.Right:        return positions.Slice((OptionRight) referenceValue, includeUnderlying);\n                case PredicateTargetValue.Strike:       return positions.Slice(_comparison, (decimal) referenceValue, includeUnderlying);\n                case PredicateTargetValue.Expiration:   return positions.Slice(_comparison, (DateTime) referenceValue, includeUnderlying);\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Gets the underlying <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> value used by this predicate.\n        /// </summary>\n        public IOptionStrategyLegPredicateReferenceValue GetReferenceValue()\n        {\n            return _reference;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionStrategyLegPredicate\"/> from the specified predicate <paramref name=\"expression\"/>\n        /// </summary>\n        public static OptionStrategyLegPredicate Create(\n            Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>> expression\n            )\n        {\n            // expr must NOT include compound comparisons\n            // expr is a lambda of one of the following forms:\n            // (legs, position) => position.{target} {comparison} legs[i].{reference-target}\n            // (legs, position) => legs[i].{reference-target} {comparison} position.{target}\n            // (legs, position) => position.{target} {comparison} {literal-reference-target}\n            // (legs, position) => {literal-reference-target} {comparison} position.{target}\n\n            // we want to make the comparison of a common form, specifically:\n            // position.{target} {comparison} {reference-target}\n            // this is so when we invoke OptionPositionCollection we have the correct comparison type\n            // for example, legs[0].Strike > position.Strike\n            // needs to be inverted into position.Strike < legs[0].Strike\n            // so we can call OptionPositionCollection.Slice(BinaryComparison.LessThan, legs[0].Strike);\n\n            try\n            {\n                var legsParameter = expression.Parameters[0];\n                var positionParameter = expression.Parameters[1];\n                var binary = expression.OfType<BinaryExpression>().Single(e => e.NodeType.IsBinaryComparison());\n                var comparison = BinaryComparison.FromExpressionType(binary.NodeType);\n                var leftReference = CreateReferenceValue(legsParameter, positionParameter, binary.Left);\n                var rightReference = CreateReferenceValue(legsParameter, positionParameter, binary.Right);\n                if (leftReference != null && rightReference != null)\n                {\n                    throw new ArgumentException($\"The provided expression is not of the required form: {expression}\");\n                }\n\n                // we want the left side to be null, indicating position.{target}\n                // if not, then we need to flip the comparison operand\n                var reference = rightReference;\n                if (rightReference == null)\n                {\n                    reference = leftReference;\n                    comparison = comparison.FlipOperands();\n                }\n\n                return new OptionStrategyLegPredicate(comparison, reference, expression.Compile(), expression);\n            }\n            catch\n            {\n                // we can still handle arbitrary predicates, they just require a full search of the positions\n                // as we're unable to leverage any of the pre-build indexes via Slice methods.\n                return new OptionStrategyLegPredicate(null, null, expression.Compile(), expression);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> from the specified lambda parameters\n        /// and expression to be evaluated.\n        /// </summary>\n        private static IOptionStrategyLegPredicateReferenceValue CreateReferenceValue(\n            Expression legsParameter,\n            Expression positionParameter,\n            Expression expression\n            )\n        {\n            // if we're referencing the position parameter then this isn't a reference value\n            // this 'value' is the positions being matched in OptionPositionCollection\n            // verify the legs parameter doesn't appear in here either\n            var expressions = expression.AsEnumerable().ToList();\n            var containsLegParameter = expressions.Any(e => ReferenceEquals(e, legsParameter));\n            var containsPositionParameter = expressions.Any(e => ReferenceEquals(e, positionParameter));\n            if (containsPositionParameter)\n            {\n                if (containsLegParameter)\n                {\n                    throw new NotSupportedException(\"Expressions containing references to both parameters \" +\n                        \"(legs and positions) on the same side of an equality operator are not supported.\"\n                    );\n                }\n\n                // this expression is of the form position.Strike/position.Expiration/position.Right\n                // and as such, is not a reference value, simply return null\n                return null;\n            }\n\n            if (!containsLegParameter)\n            {\n                // this is a literal and we'll attempt to evaluate it.\n                var value = Expression.Lambda(expression).Compile().DynamicInvoke();\n                if (value == null)\n                {\n                    throw new ArgumentNullException($\"Failed to evaluate expression literal: {expressions}\");\n                }\n\n                return ConstantOptionStrategyLegReferenceValue.Create(value);\n            }\n\n            // we're looking for an array indexer into the legs list\n            var methodCall = expressions.Single<MethodCallExpression>();\n            Debug.Assert(methodCall.Method.Name == \"get_Item\");\n            // compile and dynamically invoke the argument to get_Item(x) {legs[x]}\n            var arrayIndex = (int) Expression.Lambda(methodCall.Arguments[0]).Compile().DynamicInvoke();\n\n            // and then a member expression denoting the property (target)\n            var member = expressions.Single<MemberExpression>().Member;\n            var target = GetPredicateTargetValue(member.Name);\n\n            return new OptionStrategyLegPredicateReferenceValue(arrayIndex, target);\n        }\n\n        private static PredicateTargetValue GetPredicateTargetValue(string memberName)\n        {\n            switch (memberName)\n            {\n                case nameof(OptionPosition.Right):      return PredicateTargetValue.Right;\n                case nameof(OptionPosition.Strike):     return PredicateTargetValue.Strike;\n                case nameof(OptionPosition.Expiration): return PredicateTargetValue.Expiration;\n                default:\n                    throw new NotImplementedException(\n                        $\"Failed to resolve member name '{memberName}' to {nameof(PredicateTargetValue)}\"\n                    );\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return _expression.ToString();\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyLegPredicateReferenceValue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> that references an option\n    /// leg from the list of already matched legs by index. The property referenced is defined by <see cref=\"PredicateTargetValue\"/>\n    /// </summary>\n    public class OptionStrategyLegPredicateReferenceValue : IOptionStrategyLegPredicateReferenceValue\n    {\n        private readonly int _index;\n\n        /// <summary>\n        /// Gets the target of this value\n        /// </summary>\n        public PredicateTargetValue Target { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IOptionStrategyLegPredicateReferenceValue\"/> class\n        /// </summary>\n        /// <param name=\"index\">The legs list index</param>\n        /// <param name=\"target\">The property value being referenced</param>\n        public OptionStrategyLegPredicateReferenceValue(int index, PredicateTargetValue target)\n        {\n            _index = index;\n            Target = target;\n        }\n\n        /// <summary>\n        /// Resolves the value of the comparand specified in an <see cref=\"OptionStrategyLegPredicate\"/>.\n        /// For example, the predicate may include ... > legs[0].Strike, and upon evaluation, we need to\n        /// be able to extract leg[0].Strike for the currently contemplated set of legs adhering to a\n        /// strategy's definition.\n        /// </summary>\n        public object Resolve(IReadOnlyList<OptionPosition> legs)\n        {\n            if (_index >= legs.Count)\n            {\n                throw new InvalidOperationException(\n                    $\"OptionStrategyLegPredicateReferenceValue[{_index}] is unable to be resolved. Only {legs.Count} legs were provided.\"\n                );\n            }\n\n            var leg = legs[_index];\n            switch (Target)\n            {\n                case PredicateTargetValue.Right:      return leg.Right;\n                case PredicateTargetValue.Strike:     return leg.Strike;\n                case PredicateTargetValue.Expiration: return leg.Expiration;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyMatch.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines a complete result from running the matcher on a collection of positions.\n    /// The matching process will return one these matches for every potential combination\n    /// of strategies conforming to the search settings and the positions provided.\n    /// </summary>\n    public class OptionStrategyMatch\n    {\n        /// <summary>\n        /// The strategies that were matched\n        /// </summary>\n        public List<OptionStrategy> Strategies { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyMatch\"/> class\n        /// </summary>\n        public OptionStrategyMatch(List<OptionStrategy> strategies)\n        {\n            Strategies = strategies;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyMatcher.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Matches <see cref=\"OptionPositionCollection\"/> against a collection of <see cref=\"OptionStrategyDefinition\"/>\n    /// according to the <see cref=\"OptionStrategyMatcherOptions\"/> provided.\n    /// </summary>\n    public class OptionStrategyMatcher\n    {\n        /// <summary>\n        /// Specifies options controlling how the matcher operates\n        /// </summary>\n        public OptionStrategyMatcherOptions Options { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyMatcher\"/> class\n        /// </summary>\n        /// <param name=\"options\">Specifies definitions and other options controlling the matcher</param>\n        public OptionStrategyMatcher(OptionStrategyMatcherOptions options)\n        {\n            Options = options;\n        }\n\n        // TODO : Implement matching multiple permutations and using the objective function to select the best solution\n\n        /// <summary>\n        /// Using the definitions provided in <see cref=\"Options\"/>, attempts to match all <paramref name=\"positions\"/>.\n        /// The resulting <see cref=\"OptionStrategyMatch\"/> presents a single, valid solution for matching as many positions\n        /// as possible.\n        /// </summary>\n        public OptionStrategyMatch MatchOnce(OptionPositionCollection positions)\n        {\n            // these definitions are enumerated according to the configured IOptionStrategyDefinitionEnumerator\n\n            var strategies = new List<OptionStrategy>();\n            foreach (var definition in Options.Definitions)\n            {\n                // simplest implementation here is to match one at a time, updating positions in between\n                // a better implementation would be to evaluate all possible matches and make decisions\n                // prioritizing positions that would require more margin if not matched\n\n                OptionStrategyDefinitionMatch match;\n                while (definition.TryMatchOnce(Options, positions, out match))\n                {\n                    positions = match.RemoveFrom(positions);\n                    strategies.Add(match.CreateStrategy());\n                }\n\n                if (positions.IsEmpty)\n                {\n                    break;\n                }\n            }\n\n            return new OptionStrategyMatch(strategies);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/OptionStrategyMatcherOptions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Defines options that influence how the matcher operates.\n    /// </summary>\n    /// <remarks>\n    /// Many properties in this type are not implemented in the matcher but are provided to document\n    /// the types of things that can be added to the matcher in the future as necessary. Some of the\n    /// features contemplated in this class would require updating the various matching/filtering/slicing\n    /// functions to accept these options, or a particular property. This is the case for the enumerators\n    /// which would be used to prioritize which positions to try and match first. A great implementation\n    /// of the <see cref=\"IOptionPositionCollectionEnumerator\"/> would be to yield positions with the\n    /// highest margin requirements first. At time of writing, the goal is to achieve a workable rev0,\n    /// and we can later improve the efficiency/optimization of the matching process.\n    /// </remarks>\n    public class OptionStrategyMatcherOptions\n    {\n        /// <summary>\n        /// The maximum amount of time spent trying to find an optimal solution.\n        /// </summary>\n        public TimeSpan MaximumDuration { get; }\n\n        /// <summary>\n        /// The maximum number of matches to evaluate for the entire portfolio.\n        /// </summary>\n        public int MaximumSolutionCount { get; }\n\n        /// <summary>\n        /// Indexed by leg index, defines the max matches to evaluate per leg.\n        /// For example, MaximumCountPerLeg[1] is the max matches to evaluate\n        /// for the second leg (index=1).\n        /// </summary>\n        public IReadOnlyList<int> MaximumCountPerLeg { get; }\n\n        /// <summary>\n        /// The definitions to be used for matching.\n        /// </summary>\n        public IEnumerable<OptionStrategyDefinition> Definitions\n            => _definitionEnumerator.Enumerate(_definitions);\n\n        /// <summary>\n        /// Objective function used to compare different match solutions for a given set of positions/definitions\n        /// </summary>\n        public IOptionStrategyMatchObjectiveFunction ObjectiveFunction { get; }\n\n        private readonly IReadOnlyList<OptionStrategyDefinition> _definitions;\n        private readonly IOptionPositionCollectionEnumerator _positionEnumerator;\n        private readonly IOptionStrategyDefinitionEnumerator _definitionEnumerator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionStrategyMatcherOptions\"/> class, providing\n        /// options that control the behavior of the <see cref=\"OptionStrategyMatcher\"/>\n        /// </summary>\n        public OptionStrategyMatcherOptions(\n            IReadOnlyList<OptionStrategyDefinition> definitions,\n            IReadOnlyList<int> maximumCountPerLeg,\n            TimeSpan maximumDuration = default(TimeSpan),\n            int maximumSolutionCount = 100,\n            IOptionStrategyDefinitionEnumerator definitionEnumerator = null,\n            IOptionStrategyMatchObjectiveFunction objectiveFunction = null,\n            IOptionPositionCollectionEnumerator positionEnumerator = null\n            )\n        {\n            if (maximumDuration == default(TimeSpan))\n            {\n                maximumDuration = Time.OneMinute;\n            }\n\n            if (definitionEnumerator == null)\n            {\n                // by default we want more complex option strategies to have matching priority\n                definitionEnumerator = new DescendingByLegCountOptionStrategyDefinitionEnumerator();\n            }\n\n            if (objectiveFunction == null)\n            {\n                objectiveFunction = new UnmatchedPositionCountOptionStrategyMatchObjectiveFunction();\n            }\n\n            if (positionEnumerator == null)\n            {\n                positionEnumerator = new DefaultOptionPositionCollectionEnumerator();\n            }\n\n            _definitions = definitions;\n            MaximumDuration = maximumDuration;\n            ObjectiveFunction = objectiveFunction;\n            MaximumCountPerLeg = maximumCountPerLeg;\n            _positionEnumerator = positionEnumerator;\n            _definitionEnumerator = definitionEnumerator;\n            MaximumSolutionCount = maximumSolutionCount;\n        }\n\n        /// <summary>\n        /// Gets the maximum number of leg matches to be evaluated. This is to limit evaluating exponential\n        /// numbers of potential matches as a result of large numbers of unique option positions for the same\n        /// underlying security.\n        /// </summary>\n        public int GetMaximumLegMatches(int legIndex)\n        {\n            return MaximumCountPerLeg[legIndex];\n        }\n\n        /// <summary>\n        /// Enumerates the specified <paramref name=\"positions\"/> according to the configured\n        /// <see cref=\"IOptionPositionCollectionEnumerator\"/>\n        /// </summary>\n        public IEnumerable<OptionPosition> Enumerate(OptionPositionCollection positions)\n        {\n            return _positionEnumerator.Enumerate(positions);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionStrategyMatcherOptions\"/> with the specified <paramref name=\"definitions\"/>,\n        /// with no limits of maximum matches per leg and default values for the remaining options\n        /// </summary>\n        public static OptionStrategyMatcherOptions ForDefinitions(params OptionStrategyDefinition[] definitions)\n        {\n            return ForDefinitions(definitions.AsEnumerable());\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionStrategyMatcherOptions\"/> with the specified <paramref name=\"definitions\"/>,\n        /// with no limits of maximum matches per leg and default values for the remaining options\n        /// </summary>\n        public static OptionStrategyMatcherOptions ForDefinitions(IEnumerable<OptionStrategyDefinition> definitions)\n        {\n            var maximumCountPerLeg = new[] {int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue};\n            return new OptionStrategyMatcherOptions(definitions.ToList(), maximumCountPerLeg);\n        }\n\n        /// <summary>\n        /// Specifies the maximum time provided for obtaining an optimal solution.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithMaximumDuration(TimeSpan duration)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                MaximumCountPerLeg,\n                duration,\n                MaximumSolutionCount,\n                _definitionEnumerator,\n                ObjectiveFunction,\n                _positionEnumerator\n            );\n        }\n\n        /// <summary>\n        /// Specifies the maximum number of solutions to evaluate via the objective function.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithMaximumSolutionCount(int count)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                MaximumCountPerLeg,\n                MaximumDuration,\n                count,\n                _definitionEnumerator,\n                ObjectiveFunction,\n                _positionEnumerator\n            );\n        }\n\n        /// <summary>\n        /// Specifies the maximum number of solutions per leg index in a solution. Matching is a recursive\n        /// process, for example, we'll find a very large number of positions to match the first leg. Matching\n        /// the second leg we'll see less, and third still even less. This is because each subsequent leg must\n        /// abide by all the previous legs. This parameter defines how many potential matches to evaluate at\n        /// each leg. For the first leg, we'll evaluate counts[0] matches. For the second leg we'll evaluate\n        /// counts[1] matches and so on. By decreasing this parameter we can evaluate more total, complete\n        /// solutions for the entire portfolio rather than evaluation every single permutation of matches for\n        /// a particular strategy definition, which grows in absurd exponential fashion as the portfolio grows.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithMaximumCountPerLeg(IReadOnlyList<int> counts)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                counts,\n                MaximumDuration,\n                MaximumSolutionCount,\n                _definitionEnumerator,\n                ObjectiveFunction,\n                _positionEnumerator\n            );\n        }\n\n        /// <summary>\n        /// Specifies a function used to evaluate how desirable a particular solution is. A good implementation for\n        /// this would be to minimize the total margin required to hold all of the positions.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithObjectiveFunction(IOptionStrategyMatchObjectiveFunction function)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                MaximumCountPerLeg,\n                MaximumDuration,\n                MaximumSolutionCount,\n                _definitionEnumerator,\n                function,\n                _positionEnumerator\n            );\n        }\n\n        /// <summary>\n        /// Specifies the order in which definitions are evaluated. Definitions evaluated sooner are more likely to\n        /// find matches than ones evaluated later.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithDefinitionEnumerator(IOptionStrategyDefinitionEnumerator enumerator)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                MaximumCountPerLeg,\n                MaximumDuration,\n                MaximumSolutionCount,\n                enumerator,\n                ObjectiveFunction,\n                _positionEnumerator\n            );\n        }\n\n        /// <summary>\n        /// Specifies the order in which positions are evaluated. Positions evaluated sooner are more likely to\n        /// find matches than ones evaluated later. A good implementation for this is its stand-alone margin required,\n        /// which would encourage the algorithm to match higher margin positions before matching lower margin positiosn.\n        /// </summary>\n        public OptionStrategyMatcherOptions WithPositionEnumerator(IOptionPositionCollectionEnumerator enumerator)\n        {\n            return new OptionStrategyMatcherOptions(\n                _definitions,\n                MaximumCountPerLeg,\n                MaximumDuration,\n                MaximumSolutionCount,\n                _definitionEnumerator,\n                ObjectiveFunction,\n                enumerator\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/PredicateTargetValue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Specifies the type of value being compared against in a <see cref=\"OptionStrategyLegPredicate\"/>.\n    /// These values define the limits of what can be filtered and must match available slice methods in\n    /// <see cref=\"OptionPositionCollection\"/>\n    /// </summary>\n    public enum PredicateTargetValue\n    {\n        /// <summary>\n        /// Predicate matches on <see cref=\"OptionPosition.Right\"/> (0)\n        /// </summary>\n        Right,\n\n        /// <summary>\n        /// Predicate match on <see cref=\"OptionPosition.Quantity\"/> (1)\n        /// </summary>\n        Quantity,\n\n        /// <summary>\n        /// Predicate matches on <see cref=\"OptionPosition.Strike\"/> (2)\n        /// </summary>\n        Strike,\n\n        /// <summary>\n        /// Predicate matches on <see cref=\"OptionPosition.Expiration\"/> (3)\n        /// </summary>\n        Expiration\n    }\n}"
  },
  {
    "path": "Common/Securities/Option/StrategyMatcher/UnmatchedPositionCountOptionStrategyMatchObjectiveFunction.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Option.StrategyMatcher\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionStrategyMatchObjectiveFunction\"/> that evaluates the number of unmatched\n    /// positions, in number of contracts, giving precedence to solutions that have fewer unmatched contracts.\n    /// </summary>\n    public class UnmatchedPositionCountOptionStrategyMatchObjectiveFunction : IOptionStrategyMatchObjectiveFunction\n    {\n        /// <summary>\n        /// Computes the delta in matched vs unmatched positions, which gives precedence to solutions that match more contracts.\n        /// </summary>\n        public decimal ComputeScore(OptionPositionCollection input, OptionStrategyMatch match, OptionPositionCollection unmatched)\n        {\n            var value = 0m;\n            foreach (var strategy in match.Strategies)\n            {\n                foreach (var leg in strategy.OptionLegs.Concat<Leg>(strategy.UnderlyingLegs))\n                {\n                    value += leg.Quantity;\n                }\n            }\n\n            return value - unmatched.Count;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/OptionInitialMargin.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Result type for <see cref=\"Option.OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement\"/>\n    /// </summary>\n    public class OptionInitialMargin : InitialMargin\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"OptionInitialMargin\"/> with zero values\n        /// </summary>\n        public static OptionInitialMargin Zero { get; } = new OptionInitialMargin(0m, 0m);\n\n        /// <summary>\n        /// The option/strategy premium value in account currency\n        /// </summary>\n        public decimal Premium { get; }\n\n        /// <summary>\n        /// The initial margin value in account currency, not including the premium in cases that apply (premium debited)\n        /// </summary>\n        public decimal ValueWithoutPremium { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OptionInitialMargin\"/> class\n        /// </summary>\n        /// <param name=\"value\">The initial margin</param>\n        /// <param name=\"premium\">The premium of the option/option strategy</param>\n        public OptionInitialMargin(decimal value, decimal premium)\n            : base(value + Math.Max(premium, 0))\n        {\n            Premium = premium;\n            ValueWithoutPremium = value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/PatternDayTradingMarginModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a simple margining model where margin/leverage depends on market state (open or close).\n    /// During regular market hours, leverage is 4x, otherwise 2x\n    /// </summary>\n    public class PatternDayTradingMarginModel : SecurityMarginModel\n    {\n        private readonly decimal _closedMarginCorrectionFactor;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PatternDayTradingMarginModel\" />\n        /// </summary>\n        public PatternDayTradingMarginModel()\n            : this(2.0m, 4.0m)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PatternDayTradingMarginModel\" />\n        /// </summary>\n        /// <param name=\"closedMarketLeverage\">Leverage used outside regular market hours</param>\n        /// <param name=\"openMarketLeverage\">Leverage used during regular market hours</param>\n        public PatternDayTradingMarginModel(decimal closedMarketLeverage, decimal openMarketLeverage)\n            : base(openMarketLeverage)\n        {\n            _closedMarginCorrectionFactor = openMarketLeverage/closedMarketLeverage;\n        }\n\n        /// <summary>\n        /// Sets the leverage for the applicable securities, i.e, equities\n        /// </summary>\n        /// <remarks>\n        /// Do nothing, we use a constant leverage for this model\n        /// </remarks>\n        /// <param name=\"security\">The security to set leverage to</param>\n        /// <param name=\"leverage\">The new leverage</param>\n        public override void SetLeverage(Security security, decimal leverage)\n        {\n        }\n\n        /// <summary>\n        /// Gets the current leverage of the security\n        /// </summary>\n        /// <param name=\"security\">The security to get leverage for</param>\n        /// <returns>The current leverage in the security</returns>\n        public override decimal GetLeverage(Security security)\n        {\n            return base.GetLeverage(security) * (1 / GetMarginCorrectionFactor(security));\n        }\n\n        /// <summary>\n        /// The percentage of an order's absolute cost that must be held in free cash in order to place the order\n        /// </summary>\n        public override InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            return new InitialMargin(base.GetInitialMarginRequirement(parameters).Value\n                * GetMarginCorrectionFactor(parameters.Security)\n            );\n        }\n\n        /// <summary>\n        /// The percentage of the holding's absolute cost that must be held in free cash in order to avoid a margin call\n        /// </summary>\n        public override MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            return base.GetMaintenanceMargin(parameters) * GetMarginCorrectionFactor(parameters.Security);\n        }\n\n        /// <summary>\n        /// Get margin correction factor if not in regular market hours\n        /// </summary>\n        /// <param name=\"security\">The security to apply conditional leverage to</param>\n        /// <returns>The margin correction factor</returns>\n        private decimal GetMarginCorrectionFactor(Security security)\n        {\n            // when the market is open the base type returns the correct values\n            // when the market is closed or when its closing soon, we need to multiply by a correction factor\n            return security.Exchange.ExchangeOpen && !security.Exchange.ClosingSoon ? 1m :_closedMarginCorrectionFactor;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/CompositePositionGroupResolver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPositionGroupResolver\"/> that invokes multiple wrapped implementations\n    /// in succession. Each successive call to <see cref=\"IPositionGroupResolver.Resolve\"/> will receive\n    /// the remaining positions that have yet to be grouped. Any non-grouped positions are placed into identity groups.\n    /// </summary>\n    public class CompositePositionGroupResolver : IPositionGroupResolver\n    {\n        /// <summary>\n        /// Gets the count of registered resolvers\n        /// </summary>\n        public int Count => _resolvers.Count;\n\n        private readonly List<IPositionGroupResolver> _resolvers;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositePositionGroupResolver\"/> class\n        /// </summary>\n        /// <param name=\"resolvers\">The position group resolvers to be invoked in order</param>\n        public CompositePositionGroupResolver(params IPositionGroupResolver[] resolvers)\n            : this((IEnumerable<IPositionGroupResolver>)resolvers)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositePositionGroupResolver\"/> class\n        /// </summary>\n        /// <param name=\"resolvers\">The position group resolvers to be invoked in order</param>\n        public CompositePositionGroupResolver(IEnumerable<IPositionGroupResolver> resolvers)\n        {\n            _resolvers = resolvers.ToList();\n        }\n\n        /// <summary>\n        /// Adds the specified <paramref name=\"resolver\"/> to the end of the list of resolvers. This resolver will run last.\n        /// </summary>\n        /// <param name=\"resolver\">The resolver to be added</param>\n        public void Add(IPositionGroupResolver resolver)\n        {\n            _resolvers.Add(resolver);\n        }\n\n        /// <summary>\n        /// Inserts the specified <paramref name=\"resolver\"/> into the list of resolvers at the specified index.\n        /// </summary>\n        /// <param name=\"resolver\">The resolver to be inserted</param>\n        /// <param name=\"index\">The zero based index indicating where to insert the resolver, zero inserts to the beginning\n        /// of the list making this resolver un first and <see cref=\"Count\"/> inserts the resolver to the end of the list\n        /// making this resolver run last</param>\n        public void Add(IPositionGroupResolver resolver, int index)\n        {\n            // insert handles bounds checking\n            _resolvers.Insert(index, resolver);\n        }\n\n        /// <summary>\n        /// Removes the specified <paramref name=\"resolver\"/> from the list of resolvers\n        /// </summary>\n        /// <param name=\"resolver\">The resolver to be removed</param>\n        /// <returns>True if the resolver was removed, false if it wasn't found in the list</returns>\n        public bool Remove(IPositionGroupResolver resolver)\n        {\n            return _resolvers.Remove(resolver);\n        }\n\n        /// <summary>\n        /// Resolves the optimal set of <see cref=\"IPositionGroup\"/> from the provided <paramref name=\"positions\"/>.\n        /// Implementations are required to deduct grouped positions from the <paramref name=\"positions\"/> collection.\n        /// </summary>\n        public PositionGroupCollection Resolve(PositionCollection positions)\n        {\n            // we start with no groups, each resolver's result will get merged in\n            var groups = PositionGroupCollection.Empty;\n\n            // each call to ResolvePositionGroups is expected to deduct grouped positions from the PositionCollection\n            foreach (var resolver in _resolvers)\n            {\n                var resolved = resolver.Resolve(positions);\n                groups = groups.CombineWith(resolved);\n            }\n\n            if (positions.Count > 0)\n            {\n                throw new InvalidOperationException(\"All positions must be resolved into groups.\");\n            }\n\n            return groups;\n        }\n\n        /// <summary>\n        /// Attempts to group the specified positions into a new <see cref=\"IPositionGroup\"/> using an\n        /// appropriate <see cref=\"IPositionGroupBuyingPowerModel\"/> for position groups created via this\n        /// resolver.\n        /// </summary>\n        /// <param name=\"newPositions\">The positions to be grouped</param>\n        /// <param name=\"currentPositions\">The currently grouped positions</param>\n        /// <param name=\"group\">The grouped positions when this resolver is able to, otherwise null</param>\n        /// <returns>True if this resolver can group the specified positions, otherwise false</returns>\n        public bool TryGroup(IReadOnlyCollection<IPosition> newPositions, PositionGroupCollection currentPositions, out IPositionGroup group)\n        {\n            foreach (var resolver in _resolvers)\n            {\n                if (resolver.TryGroup(newPositions, currentPositions, out group))\n                {\n                    return true;\n                }\n            }\n\n            group = null;\n            return false;\n        }\n\n        /// <summary>\n        /// Determines the position groups that would be evaluated for grouping of the specified\n        /// positions were passed into the <see cref=\"Resolve\"/> method.\n        /// </summary>\n        /// <remarks>\n        /// This function allows us to determine a set of impacted groups and run the resolver on just\n        /// those groups in order to support what-if analysis\n        /// </remarks>\n        /// <param name=\"groups\">The existing position groups</param>\n        /// <param name=\"positions\">The positions being changed</param>\n        /// <returns>An enumerable containing the position groups that could be impacted by the specified position changes</returns>\n        public IEnumerable<IPositionGroup> GetImpactedGroups(PositionGroupCollection groups, IReadOnlyCollection<IPosition> positions)\n        {\n            // we keep track of yielded groups for all resolvers\n            var seen = new HashSet<PositionGroupKey>();\n            foreach (var resolver in _resolvers)\n            {\n                foreach (var group in resolver.GetImpactedGroups(groups, positions))\n                {\n                    if (seen.Add(group.Key))\n                    {\n                        yield return group;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/GetMaximumLotsForDeltaBuyingPowerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetMaximumLotsForDeltaBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumLotsForDeltaBuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// The delta buying power.\n        /// </summary>\n        /// <remarks>Sign defines the position side to apply the delta, positive long, negative short side.</remarks>\n        public decimal DeltaBuyingPower { get; }\n\n        /// <summary>\n        /// True enables the <see cref=\"IBuyingPowerModel\"/> to skip setting <see cref=\"GetMaximumLotsResult.Reason\"/>\n        /// for non error situations, for performance\n        /// </summary>\n        public bool SilenceNonErrorReasons { get; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes\n        /// </summary>\n        /// <remarks>Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings</remarks>\n        public decimal MinimumOrderMarginPortfolioPercentage { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumLotsForDeltaBuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"deltaBuyingPower\">The delta buying power to apply. Sign defines the position side to apply the delta</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes</param>\n        /// <param name=\"silenceNonErrorReasons\">True will not return <see cref=\"GetMaximumLotsResult.Reason\"/>\n        /// set for non error situation, this is for performance</param>\n        public GetMaximumLotsForDeltaBuyingPowerParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            decimal deltaBuyingPower,\n            decimal minimumOrderMarginPortfolioPercentage,\n            bool silenceNonErrorReasons = false\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n            DeltaBuyingPower = deltaBuyingPower;\n            SilenceNonErrorReasons = silenceNonErrorReasons;\n            MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and an error message.\n        /// </summary>\n        public GetMaximumLotsResult Error(string reason)\n        {\n            return new GetMaximumLotsResult(0, reason, true);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and no message.\n        /// </summary>\n        public GetMaximumLotsResult Zero()\n        {\n            return new GetMaximumLotsResult(0, string.Empty, false);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and an info message.\n        /// </summary>\n        public GetMaximumLotsResult Zero(string reason)\n        {\n            return new GetMaximumLotsResult(0, reason, false);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> for the specified quantity and no message.\n        /// </summary>\n        public GetMaximumLotsResult Result(decimal quantity)\n        {\n            return new GetMaximumLotsResult(quantity, string.Empty, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/GetMaximumLotsForTargetBuyingPowerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumLotsForTargetBuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// The target buying power.\n        /// </summary>\n        /// <remarks>Sign defines the position side, positive long, negative short side.</remarks>\n        public decimal TargetBuyingPower { get; }\n\n        /// <summary>\n        /// True enables the <see cref=\"IBuyingPowerModel\"/> to skip setting <see cref=\"GetMaximumLotsResult.Reason\"/>\n        /// for non error situations, for performance\n        /// </summary>\n        public bool SilenceNonErrorReasons { get; }\n\n        /// <summary>\n        /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes\n        /// </summary>\n        /// <remarks>Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings</remarks>\n        public decimal MinimumOrderMarginPortfolioPercentage { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumLotsForTargetBuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"targetBuyingPower\">The target buying power</param>\n        /// <param name=\"minimumOrderMarginPortfolioPercentage\">Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes</param>\n        /// <param name=\"silenceNonErrorReasons\">True will not return <see cref=\"GetMaximumLotsResult.Reason\"/>\n        /// set for non error situation, this is for performance</param>\n        public GetMaximumLotsForTargetBuyingPowerParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            decimal targetBuyingPower,\n            decimal minimumOrderMarginPortfolioPercentage,\n            bool silenceNonErrorReasons = false\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n            TargetBuyingPower = targetBuyingPower;\n            SilenceNonErrorReasons = silenceNonErrorReasons;\n            MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and an error message.\n        /// </summary>\n        public GetMaximumLotsResult Error(string reason)\n        {\n            return new GetMaximumLotsResult(0, reason, true);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and no message.\n        /// </summary>\n        public GetMaximumLotsResult Zero()\n        {\n            return new GetMaximumLotsResult(0, string.Empty, false);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> with zero quantity and an info message.\n        /// </summary>\n        public GetMaximumLotsResult Zero(string reason)\n        {\n            return new GetMaximumLotsResult(0, reason, false);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"GetMaximumLotsResult\"/> for the specified quantity and no message.\n        /// </summary>\n        public GetMaximumLotsResult Result(decimal quantity)\n        {\n            return new GetMaximumLotsResult(quantity, string.Empty, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/GetMaximumLotsResult.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Result type for <see cref=\"IPositionGroupBuyingPowerModel.GetMaximumLotsForDeltaBuyingPower\"/>\n    /// and <see cref=\"IPositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower\"/>\n    /// </summary>\n    public class GetMaximumLotsResult\n    {\n        /// <summary>\n        /// Returns the maximum number of lots of the position group that can be\n        /// ordered. This is a whole number and is the <see cref=\"IPositionGroup.Quantity\"/>\n        /// </summary>\n        public decimal NumberOfLots { get; }\n\n        /// <summary>\n        /// Returns the reason for which the maximum order quantity is zero\n        /// </summary>\n        public string Reason { get; }\n\n        /// <summary>\n        /// Returns true if the zero order quantity is an error condition and will be shown to the user.\n        /// </summary>\n        public bool IsError { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityResult\"/> class\n        /// </summary>\n        /// <param name=\"numberOfLots\">Returns the maximum number of lots of the position group that can be ordered</param>\n        /// <param name=\"reason\">The reason for which the maximum order quantity is zero</param>\n        public GetMaximumLotsResult(decimal numberOfLots, string reason = null)\n        {\n            NumberOfLots = numberOfLots;\n            Reason = reason ?? string.Empty;\n            IsError = !string.IsNullOrEmpty(Reason);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GetMaximumOrderQuantityResult\"/> class\n        /// </summary>\n        /// <param name=\"numberOfLots\">Returns the maximum number of lots of the position group that can be ordered</param>\n        /// <param name=\"reason\">The reason for which the maximum order quantity is zero</param>\n        /// <param name=\"isError\">True if the zero order quantity is an error condition</param>\n        public GetMaximumLotsResult(decimal numberOfLots, string reason, bool isError = true)\n        {\n            IsError = isError;\n            NumberOfLots = numberOfLots;\n            Reason = reason ?? string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/HasSufficientPositionGroupBuyingPowerForOrderParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IPositionGroupBuyingPowerModel.HasSufficientBuyingPowerForOrder\"/>\n    /// </summary>\n    public class HasSufficientPositionGroupBuyingPowerForOrderParameters\n    {\n        /// <summary>\n        /// The orders associated with this request\n        /// </summary>\n        public List<Order> Orders { get; }\n\n        /// <summary>\n        /// Gets the position group representing the holdings changes contemplated by the order\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HasSufficientPositionGroupBuyingPowerForOrderParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"orders\">The orders</param>\n        public HasSufficientPositionGroupBuyingPowerForOrderParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            List<Order> orders\n            )\n        {\n            Orders = orders;\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n        }\n\n        /// <summary>\n        /// This may be called for non-combo type orders where the position group is guaranteed to have exactly one position\n        /// </summary>\n        public static implicit operator HasSufficientBuyingPowerForOrderParameters(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n            )\n        {\n            var position = parameters.PositionGroup.Single();\n            var security = parameters.Portfolio.Securities[position.Symbol];\n            return new HasSufficientBuyingPowerForOrderParameters(parameters.Portfolio, security, parameters.Orders.Single());\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there is sufficient buying power for the contemplated order\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Sufficient()\n        {\n            return new HasSufficientBuyingPowerForOrderResult(true);\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there is insufficient buying power for the contemplated order\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Insufficient(string reason)\n        {\n            return new HasSufficientBuyingPowerForOrderResult(false, reason);\n        }\n\n        /// <summary>\n        /// Creates a new result indicating that there was an error\n        /// </summary>\n        public HasSufficientBuyingPowerForOrderResult Error(string reason)\n        {\n            return new HasSufficientBuyingPowerForOrderResult(false, reason);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/IPosition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines a position for inclusion in a group\n    /// </summary>\n    public interface IPosition\n    {\n        /// <summary>\n        /// The symbol\n        /// </summary>\n        Symbol Symbol { get; }\n\n        /// <summary>\n        /// The quantity\n        /// </summary>\n        decimal Quantity { get; }\n\n        /// <summary>\n        /// The unit quantity. The unit quantities of a group define the group. For example, a covered\n        /// call has 100 units of stock and -1 units of call contracts.\n        /// </summary>\n        decimal UnitQuantity { get; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/IPositionGroup.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines a group of positions allowing for more efficient use of portfolio margin\n    /// </summary>\n    public interface IPositionGroup : IReadOnlyCollection<IPosition>\n    {\n        /// <summary>\n        /// Gets the key identifying this group\n        /// </summary>\n        PositionGroupKey Key { get; }\n\n        /// <summary>\n        /// Gets the whole number of units in this position group\n        /// </summary>\n        decimal Quantity { get; }\n\n        /// <summary>\n        /// Gets the positions in this group\n        /// </summary>\n        IEnumerable<IPosition> Positions { get; }\n\n        /// <summary>\n        /// Gets the buying power model defining how margin works in this group\n        /// </summary>\n        IPositionGroupBuyingPowerModel BuyingPowerModel { get; }\n\n        /// <summary>\n        /// Attempts to retrieve the position with the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"position\">The position, if found</param>\n        /// <returns>True if the position was found, otherwise false</returns>\n        bool TryGetPosition(Symbol symbol, out IPosition position);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/IPositionGroupBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Represents a position group's model of buying power\n    /// </summary>\n    public interface IPositionGroupBuyingPowerModel : IEquatable<IPositionGroupBuyingPowerModel>\n    {\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the </returns>\n        MaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters);\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        InitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters);\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInitialMarginForOrderParameters parameters);\n\n        /// <summary>\n        /// Computes the impact on the portfolio's buying power from adding the position group to the portfolio. This is\n        /// a 'what if' analysis to determine what the state of the portfolio would be if these changes were applied. The\n        /// delta (before - after) is the margin requirement for adding the positions and if the margin used after the changes\n        /// are applied is less than the total portfolio value, this indicates sufficient capital.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio and a position group containing the contemplated\n        /// changes to the portfolio</param>\n        /// <returns>Returns the portfolio's total portfolio value and margin used before and after the position changes are applied</returns>\n        ReservedBuyingPowerImpact GetReservedBuyingPowerImpact(\n            ReservedBuyingPowerImpactParameters parameters\n            );\n\n        /// <summary>\n        /// Check if there is sufficient buying power for the position group to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the order</param>\n        /// <returns>Returns buying power information for an order against a position group</returns>\n        HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n            );\n\n        /// <summary>\n        /// Computes the amount of buying power reserved by the provided position group\n        /// </summary>\n        ReservedBuyingPowerForPositionGroup GetReservedBuyingPowerForPositionGroup(\n            ReservedBuyingPowerForPositionGroupParameters parameters\n            );\n\n        /// <summary>\n        /// Get the maximum position group order quantity to obtain a position with a given buying power\n        /// percentage. Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the target\n        ///     signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        GetMaximumLotsResult GetMaximumLotsForTargetBuyingPower(\n            GetMaximumLotsForTargetBuyingPowerParameters parameters\n            );\n\n        /// <summary>\n        /// Get the maximum market position group order quantity to obtain a delta in the buying power used by a position group.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        GetMaximumLotsResult GetMaximumLotsForDeltaBuyingPower(\n            GetMaximumLotsForDeltaBuyingPowerParameters parameters\n            );\n\n        /// <summary>\n        /// Gets the buying power available for a position group trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        PositionGroupBuyingPower GetPositionGroupBuyingPower(PositionGroupBuyingPowerParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/IPositionGroupResolver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Resolves position groups from a collection of positions.\n    /// </summary>\n    public interface IPositionGroupResolver\n    {\n        /// <summary>\n        /// Attempts to group the specified positions into a new <see cref=\"IPositionGroup\"/> using an\n        /// appropriate <see cref=\"IPositionGroupBuyingPowerModel\"/> for position groups created via this\n        /// resolver.\n        /// </summary>\n        /// <param name=\"newPositions\">The positions to be grouped</param>\n        /// <param name=\"currentPositions\">The currently grouped positions</param>\n        /// <param name=\"group\">The grouped positions when this resolver is able to, otherwise null</param>\n        /// <returns>True if this resolver can group the specified positions, otherwise false</returns>\n        bool TryGroup(IReadOnlyCollection<IPosition> newPositions, PositionGroupCollection currentPositions, out IPositionGroup group);\n\n        /// <summary>\n        /// Resolves the position groups that exist within the specified collection of positions.\n        /// </summary>\n        /// <param name=\"positions\">The collection of positions</param>\n        /// <returns>An enumerable of position groups</returns>\n        PositionGroupCollection Resolve(PositionCollection positions);\n\n        /// <summary>\n        /// Determines the position groups that would be evaluated for grouping of the specified\n        /// positions were passed into the <see cref=\"Resolve\"/> method.\n        /// </summary>\n        /// <remarks>\n        /// This function allows us to determine a set of impacted groups and run the resolver on just\n        /// those groups in order to support what-if analysis\n        /// </remarks>\n        /// <param name=\"groups\">The existing position groups</param>\n        /// <param name=\"positions\">The positions being changed</param>\n        /// <returns>An enumerable containing the position groups that could be impacted by the specified position changes</returns>\n        IEnumerable<IPositionGroup> GetImpactedGroups(\n            PositionGroupCollection groups,\n            IReadOnlyCollection<IPosition> positions\n            );\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/NullSecurityPositionGroupModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Responsible for managing the resolution of position groups for an algorithm.\n    /// Will only resolve single position groups\n    /// </summary>\n    public class NullSecurityPositionGroupModel : SecurityPositionGroupModel\n    {\n        /// <summary>\n        /// Get the position group resolver instance to use\n        /// </summary>\n        /// <returns>The position group resolver instance</returns>\n        protected override IPositionGroupResolver GetPositionGroupResolver()\n        {\n            return new CompositePositionGroupResolver(new SecurityPositionGroupResolver(PositionGroupBuyingPowerModel));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/OptionStrategyPositionGroupResolver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Class in charge of resolving option strategy groups which will use the <see cref=\"OptionStrategyPositionGroupBuyingPowerModel\"/>\n    /// </summary>\n    public class OptionStrategyPositionGroupResolver : IPositionGroupResolver\n    {\n        private readonly SecurityManager _securities;\n        private readonly OptionStrategyMatcher _strategyMatcher;\n\n        /// <summary>\n        /// Creates the default option strategy group resolver for <see cref=\"OptionStrategyDefinitions.AllDefinitions\"/>\n        /// </summary>\n        public OptionStrategyPositionGroupResolver(SecurityManager securities)\n            : this(securities, OptionStrategyMatcherOptions.ForDefinitions(OptionStrategyDefinitions.AllDefinitions))\n        {\n        }\n\n        /// <summary>\n        /// Creates a custom option strategy group resolver\n        /// </summary>\n        /// <param name=\"strategyMatcherOptions\">The option strategy matcher options instance to use</param>\n        /// <param name=\"securities\">The algorithms securities</param>\n        public OptionStrategyPositionGroupResolver(SecurityManager securities, OptionStrategyMatcherOptions strategyMatcherOptions)\n        {\n            _securities = securities;\n            _strategyMatcher = new OptionStrategyMatcher(strategyMatcherOptions);\n        }\n\n        /// <summary>\n        /// Attempts to group the specified positions into a new <see cref=\"IPositionGroup\"/> using an\n        /// appropriate <see cref=\"IPositionGroupBuyingPowerModel\"/> for position groups created via this\n        /// resolver.\n        /// </summary>\n        /// <param name=\"newPositions\">The positions to be grouped</param>\n        /// <param name=\"currentPositions\">The currently grouped positions</param>\n        /// <param name=\"group\">The grouped positions when this resolver is able to, otherwise null</param>\n        /// <returns>True if this resolver can group the specified positions, otherwise false</returns>\n        public bool TryGroup(IReadOnlyCollection<IPosition> newPositions, PositionGroupCollection currentPositions, out IPositionGroup @group)\n        {\n            IEnumerable<IPosition> positions;\n            if (currentPositions.Count > 0)\n            {\n                var impactedGroups = GetImpactedGroups(currentPositions, newPositions);\n                var positionsToConsiderInNewGroup = impactedGroups.SelectMany(positionGroup => positionGroup.Positions);\n                positions = newPositions.Concat(positionsToConsiderInNewGroup);\n            }\n            else\n            {\n                if (newPositions.Count == 1)\n                {\n                    // there's no existing position and there's only a single position, no strategy will match\n                    @group = null;\n                    return false;\n                }\n                positions = newPositions;\n            }\n\n            @group = GetPositionGroups(positions)\n                .Select(positionGroup =>\n                {\n                    if (positionGroup.Count == 0)\n                    {\n                        return positionGroup;\n                    }\n\n                    if (newPositions.Any(position => positionGroup.TryGetPosition(position.Symbol, out position)))\n                    {\n                        return positionGroup;\n                    }\n\n                    // When none of the new positions are contained in the position group,\n                    // it means that we are liquidating the assets in the new positions\n                    // but some other existing positions were considered as impacted groups.\n                    // Example:\n                    //   Buy(OptionStrategies.BullCallSpread(...), 1);\n                    //   Buy(OptionStrategies.BearPutSpread(...), 1);\n                    //   ...\n                    //   Sell(OptionStrategies.BullCallSpread(...), 1);\n                    //   Sell(OptionStrategies.BearPutSpread(...), 1);\n                    //   -----\n                    //   When attempting revert the bull call position group, the bear put group\n                    //   will be selected as impacted group, so the group will contain the put positions\n                    //   but not the call ones. In this case, we return an valid empty group because the\n                    //   liquidation is happening.\n                    return PositionGroup.Empty(new OptionStrategyPositionGroupBuyingPowerModel(null));\n                })\n                .Where(positionGroup => positionGroup != null)\n                .FirstOrDefault();\n\n            return @group != null;\n        }\n\n        /// <summary>\n        /// Resolves the position groups that exist within the specified collection of positions.\n        /// </summary>\n        /// <param name=\"positions\">The collection of positions</param>\n        /// <returns>An enumerable of position groups</returns>\n        public PositionGroupCollection Resolve(PositionCollection positions)\n        {\n            var result = PositionGroupCollection.Empty;\n\n            var groups = GetPositionGroups(positions).ToList();\n            if (groups.Count != 0)\n            {\n                result = new PositionGroupCollection(groups);\n\n                // we are expected to remove any positions which we resolved into a position group\n                positions.Remove(result);\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Determines the position groups that would be evaluated for grouping of the specified\n        /// positions were passed into the <see cref=\"Resolve\"/> method.\n        /// </summary>\n        /// <remarks>\n        /// This function allows us to determine a set of impacted groups and run the resolver on just\n        /// those groups in order to support what-if analysis\n        /// </remarks>\n        /// <param name=\"groups\">The existing position groups</param>\n        /// <param name=\"positions\">The positions being changed</param>\n        /// <returns>An enumerable containing the position groups that could be impacted by the specified position changes</returns>\n        public IEnumerable<IPositionGroup> GetImpactedGroups(PositionGroupCollection groups, IReadOnlyCollection<IPosition> positions)\n        {\n            if(groups.Count == 0)\n            {\n                // there's no existing groups, nothing to impact\n                return Enumerable.Empty<IPositionGroup>();\n            }\n\n            var symbolsSet = positions.Where(position => position.Symbol.SecurityType.HasOptions() || position.Symbol.SecurityType.IsOption())\n                .SelectMany(position =>\n                {\n                    return position.Symbol.HasUnderlying ? new[] { position.Symbol, position.Symbol.Underlying } : new[] { position.Symbol };\n                })\n                .ToHashSet();\n\n            if (symbolsSet.Count == 0)\n            {\n                return Enumerable.Empty<IPositionGroup>();\n            }\n\n            // will select groups for which we actually hold some security quantity and any of the changed symbols or underlying are in it if they are options\n            return groups.Where(group => group.Quantity != 0\n                && group.Positions.Any(position1 => symbolsSet.Contains(position1.Symbol)\n                    || position1.Symbol.HasUnderlying && position1.Symbol.SecurityType.IsOption() && symbolsSet.Contains(position1.Symbol.Underlying)));\n        }\n\n        private IEnumerable<IPositionGroup> GetPositionGroups(IEnumerable<IPosition> positions)\n        {\n            foreach (var positionsByUnderlying in positions\n                .Where(position => position.Symbol.SecurityType.HasOptions() || position.Symbol.SecurityType.IsOption())\n                .GroupBy(position => position.Symbol.HasUnderlying? position.Symbol.Underlying : position.Symbol)\n                .Select(x => x.ToList()))\n            {\n                var optionPosition = positionsByUnderlying.FirstOrDefault(position => position.Symbol.SecurityType.IsOption());\n                if (optionPosition == null)\n                {\n                    // if there isn't any option position we aren't really interested, can't create any option strategy!\n                    continue;\n                }\n                var contractMultiplier = (_securities[optionPosition.Symbol].SymbolProperties as OptionSymbolProperties)?.ContractUnitOfTrade ?? 100;\n\n                var optionPositionCollection = OptionPositionCollection.FromPositions(positionsByUnderlying, contractMultiplier);\n\n                if (optionPositionCollection.Count == 0 && positionsByUnderlying.Count > 0)\n                {\n                    // we could be liquidating there will be no position left!\n                    yield return PositionGroup.Empty(new OptionStrategyPositionGroupBuyingPowerModel(null));\n                    yield break;\n                }\n\n                var matches = _strategyMatcher.MatchOnce(optionPositionCollection);\n                if (matches.Strategies.Count == 0)\n                {\n                    continue;\n                }\n\n                foreach (var matchedStrategy in matches.Strategies)\n                {\n                    var groupQuantity = Math.Abs(matchedStrategy.OptionLegs.Cast<Leg>().Concat(matchedStrategy.UnderlyingLegs)\n                        .Select(leg => leg.Quantity)\n                        .GreatestCommonDivisor());\n                    var positionsToGroup = matchedStrategy.OptionLegs\n                        .Select(optionLeg => (IPosition)new Position(optionLeg.Symbol, optionLeg.Quantity,\n                            // The unit quantity of each position is the ratio of the quantity of the leg to the group quantity.\n                            // e.g. a butterfly call strategy three legs: 10:-20:10, the unit quantity of each leg is 1:2:1\n                            Math.Abs(optionLeg.Quantity) / groupQuantity))\n                        .Concat(matchedStrategy.UnderlyingLegs.Select(underlyingLeg => new Position(underlyingLeg.Symbol,\n                            underlyingLeg.Quantity * contractMultiplier,\n                            // Same as for the option legs, but we need to multiply by the contract multiplier.\n                            // e.g. a covered call strategy has 100 shares of the underlying, per shorted contract\n                            (Math.Abs(underlyingLeg.Quantity) * contractMultiplier / groupQuantity))))\n                        .ToDictionary(position => position.Symbol);\n\n                    yield return new PositionGroup(\n                        new PositionGroupKey(new OptionStrategyPositionGroupBuyingPowerModel(matchedStrategy), positionsToGroup.Values),\n                        groupQuantity,\n                        positionsToGroup);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PortfolioMarginChart.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Drawing;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Helper method to sample portfolio margin chart\n    /// </summary>\n    public static class PortfolioMarginChart\n    {\n        private static string PortfolioMarginTooltip = \"{SERIES_NAME}: {VALUE}%\";\n        private static string PortfolioMarginIndexName = \"Margin Used (%)\";\n        private static readonly int _portfolioMarginSeriesCount = Configuration.Config.GetInt(\"portfolio-margin-series-count\", 40);\n\n        /// <summary>\n        /// Helper method to add the portfolio margin series into the given chart\n        /// </summary>\n        public static void AddSample(Chart portfolioChart, PortfolioState portfolioState, IMapFileProvider mapFileProvider, DateTime currentTime)\n        {\n            if (portfolioState == null || portfolioState.PositionGroups == null)\n            {\n                return;\n            }\n\n            var topSeries = new HashSet<string>(_portfolioMarginSeriesCount);\n            foreach (var positionGroup in portfolioState.PositionGroups\n                .OrderByDescending(x => x.PortfolioValuePercentage)\n                .DistinctBy(x => GetPositionGroupName(x, mapFileProvider, currentTime))\n                .Take(_portfolioMarginSeriesCount))\n            {\n                topSeries.Add(positionGroup.Name);\n            }\n\n            Series others = null;\n            ChartPoint currentOthers = null;\n            foreach (var positionGroup in portfolioState.PositionGroups)\n            {\n                var name = GetPositionGroupName(positionGroup, mapFileProvider, currentTime);\n                if (topSeries.Contains(name))\n                {\n                    var series = GetOrAddSeries(portfolioChart, name, Color.Empty);\n                    series.AddPoint(new ChartPoint(portfolioState.Time, positionGroup.PortfolioValuePercentage * 100));\n                    continue;\n                }\n\n                others ??= GetOrAddSeries(portfolioChart, \"OTHERS\", Color.Gray);\n                var value = positionGroup.PortfolioValuePercentage * 100;\n                if (currentOthers != null && currentOthers.Time == portfolioState.Time)\n                {\n                    // we aggregate\n                    currentOthers.y += value;\n                }\n                else\n                {\n                    currentOthers = new ChartPoint(portfolioState.Time, value);\n                    others.AddPoint(currentOthers);\n                }\n            }\n\n            foreach (var series in portfolioChart.Series.Values)\n            {\n                // let's add a null point for the series which have no value for this time\n                var lastPoint = series.Values.LastOrDefault() as ChartPoint;\n                if (lastPoint == null || lastPoint.Time != portfolioState.Time && lastPoint.Y.HasValue)\n                {\n                    series.AddPoint(new ChartPoint(portfolioState.Time, null));\n                }\n            }\n        }\n\n        private static string GetPositionGroupName(PositionGroupState positionGroup, IMapFileProvider mapFileProvider, DateTime currentTime)\n        {\n            if (positionGroup.Positions.Count == 0)\n            {\n                return string.Empty;\n            }\n\n            if (string.IsNullOrEmpty(positionGroup.Name))\n            {\n                positionGroup.Name = string.Join(\", \", positionGroup.Positions.Select(x =>\n                {\n                    if (mapFileProvider == null)\n                    {\n                        return x.Symbol.Value;\n                    }\n                    return GetMappedSymbol(mapFileProvider, x.Symbol, currentTime).Value;\n                }));\n            }\n\n            return positionGroup.Name;\n        }\n\n        private static Series GetOrAddSeries(Chart portfolioChart, string seriesName, Color color)\n        {\n            if (!portfolioChart.Series.TryGetValue(seriesName, out var series))\n            {\n                series = portfolioChart.Series[seriesName] = new Series(seriesName, SeriesType.Bar, 0, \"%\")\n                {\n                    Color = color,\n                    Tooltip = PortfolioMarginTooltip,\n                    IndexName = PortfolioMarginIndexName,\n                    ScatterMarkerSymbol = ScatterMarkerSymbol.None\n                };\n            }\n            return (Series)series;\n        }\n\n        private static Symbol GetMappedSymbol(IMapFileProvider mapFileProvider, Symbol symbol, DateTime referenceTime)\n        {\n            if (symbol.RequiresMapping())\n            {\n                var mapFileResolver = mapFileProvider.Get(AuxiliaryDataKey.Create(symbol));\n                if (mapFileResolver.Any())\n                {\n                    var mapFile = mapFileResolver.ResolveMapFile(symbol);\n                    if (mapFile.Any())\n                    {\n                        symbol = symbol.UpdateMappedSymbol(mapFile.GetMappedSymbol(referenceTime.Date, symbol.Value));\n                    }\n                }\n            }\n            return symbol;\n        }\n\n        /// <summary>\n        /// Helper method to set the tooltip values after we've sampled and filter series with a single value\n        /// </summary>\n        public static void RemoveSinglePointSeries(Chart portfolioChart)\n        {\n            // let's remove series which have a single value, since it's a area chart they can't be drawn\n            portfolioChart.Series = portfolioChart.Series.Values\n                .Where(x =>\n                {\n                    var notNullPointsCount = 0;\n                    foreach (var point in x.Values.OfType<ChartPoint>())\n                    {\n                        if (point != null && point.Y.HasValue)\n                        {\n                            notNullPointsCount++;\n                            if (notNullPointsCount > 1)\n                            {\n                                return true;\n                            }\n                        }\n                    }\n                    return notNullPointsCount > 1;\n                })\n                .ToDictionary(x => x.Name, x => x);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PortfolioState.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Snapshot of an algorithms portfolio state\n    /// </summary>\n    public class PortfolioState\n    {\n        /// <summary>\n        /// Utc time this portfolio snapshot was taken\n        /// </summary>\n        public DateTime Time { get; set; }\n\n        /// <summary>\n        /// The current total portfolio value\n        /// </summary>\n        public decimal TotalPortfolioValue { get; set; }\n\n        /// <summary>\n        /// The margin used\n        /// </summary>\n        public decimal TotalMarginUsed { get; set; }\n\n        /// <summary>\n        /// The different positions groups\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public List<PositionGroupState> PositionGroups { get; set; }\n\n        /// <summary>\n        /// Gets the cash book that keeps track of all currency holdings (only settled cash)\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Dictionary<string, Cash> CashBook { get; set; }\n\n        /// <summary>\n        /// Gets the cash book that keeps track of all currency holdings (only unsettled cash)\n        /// </summary>\n        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n        public Dictionary<string, Cash> UnsettledCashBook { get; set; }\n\n        /// <summary>\n        /// Helper method to create the portfolio state snapshot\n        /// </summary>\n        public static PortfolioState Create(SecurityPortfolioManager portfolioManager, DateTime utcNow, decimal currentPortfolioValue)\n        {\n            try\n            {\n                var totalMarginUsed = 0m;\n                var positionGroups = new List<PositionGroupState>(portfolioManager.Positions.Groups.Count);\n                foreach (var group in portfolioManager.Positions.Groups)\n                {\n                    var buyingPowerForPositionGroup = group.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(portfolioManager, group);\n\n                    var positionGroupState = new PositionGroupState\n                    {\n                        MarginUsed = buyingPowerForPositionGroup,\n                        Positions = group.Positions.ToList()\n                    };\n                    if (currentPortfolioValue != 0)\n                    {\n                        positionGroupState.PortfolioValuePercentage = (buyingPowerForPositionGroup / currentPortfolioValue).RoundToSignificantDigits(4);\n                    }\n\n                    positionGroups.Add(positionGroupState);\n                    totalMarginUsed += buyingPowerForPositionGroup;\n                }\n\n                var result = new PortfolioState\n                {\n                    Time = utcNow,\n                    TotalPortfolioValue = currentPortfolioValue,\n                    TotalMarginUsed = totalMarginUsed,\n                    CashBook = portfolioManager.CashBook.Where(pair => pair.Value.Amount != 0).ToDictionary(pair => pair.Key, pair => pair.Value)\n                };\n\n                var unsettledCashBook = portfolioManager.UnsettledCashBook\n                    .Where(pair => pair.Value.Amount != 0)\n                    .ToDictionary(pair => pair.Key, pair => pair.Value);\n                if (positionGroups.Count > 0)\n                {\n                    result.PositionGroups = positionGroups;\n                }\n                if (unsettledCashBook.Count > 0)\n                {\n                    result.UnsettledCashBook = unsettledCashBook;\n                }\n                return result;\n            }\n            catch (Exception e)\n            {\n                Log.Error(e);\n                return null;\n            }\n        }\n    }\n\n    /// <summary>\n    /// Snapshot of a position group state\n    /// </summary>\n    public class PositionGroupState\n    {\n        /// <summary>\n        /// Name of this position group\n        /// </summary>\n        [JsonIgnore]\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Currently margin used\n        /// </summary>\n        public decimal MarginUsed { get; set; }\n\n        /// <summary>\n        /// The margin used by this position in relation to the total portfolio value\n        /// </summary>\n        public decimal PortfolioValuePercentage { get; set; }\n\n        /// <summary>\n        /// The positions which compose this group\n        /// </summary>\n        public List<IPosition> Positions { get; set; }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/Position.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines a quantity of a security's holdings for inclusion in a position group\n    /// </summary>\n    public class Position : IPosition\n    {\n        /// <summary>\n        /// The symbol\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// The quantity\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// The unit quantity. The unit quantities of a group define the group. For example, a covered\n        /// call has 100 units of stock and -1 units of call contracts.\n        /// </summary>\n        public decimal UnitQuantity { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Position\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"quantity\">The quantity</param>\n        /// <param name=\"unitQuantity\">The position's unit quantity within its group</param>\n        public Position(Symbol symbol, decimal quantity, decimal unitQuantity)\n        {\n            Symbol = symbol;\n            Quantity = quantity;\n            UnitQuantity = unitQuantity;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Position\"/> class using the security's lot size\n        /// as it's unit quantity. If quantity is null, then the security's holdings quantity is used.\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"quantity\">The quantity, if null, the security's holdings quantity is used</param>\n        public Position(Security security, decimal? quantity = null)\n            : this(security.Symbol, quantity ?? security.Holdings.Quantity, security.SymbolProperties.LotSize)\n        {\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return $\"{Symbol}: {Quantity}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides a collection type for <see cref=\"IPosition\"/> aimed at providing indexing for\n    /// common operations required by the resolver implementations.\n    /// </summary>\n    public class PositionCollection : IEnumerable<IPosition>\n    {\n        private Dictionary<Symbol, IPosition> _positions;\n\n        /// <summary>Gets the number of elements in the collection.</summary>\n        /// <returns>The number of elements in the collection. </returns>\n        public int Count => _positions.Count;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionCollection\"/> class\n        /// </summary>\n        /// <param name=\"positions\">The positions to include in this collection</param>\n        public PositionCollection(Dictionary<Symbol, IPosition> positions)\n        {\n            _positions = positions;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionCollection\"/> class\n        /// </summary>\n        /// <param name=\"positions\">The positions to include in this collection</param>\n        public PositionCollection(IEnumerable<IPosition> positions)\n            : this(positions.ToDictionary(p => p.Symbol))\n        {\n        }\n\n        /// <summary>\n        /// Removes the quantities in the provided groups from this position collection.\n        /// This should be called following <see cref=\"IPositionGroupResolver\"/> has resolved\n        /// position groups in order to update the collection of positions for the next resolver,\n        /// if one exists.\n        /// </summary>\n        /// <param name=\"groups\">The resolved position groups</param>\n        /// <returns></returns>\n        public void Remove(IEnumerable<IPositionGroup> groups)\n        {\n            foreach (var group in groups)\n            {\n                foreach (var position in group.Positions)\n                {\n                    IPosition existing;\n                    if (!_positions.TryGetValue(position.Symbol, out existing))\n                    {\n                        throw new InvalidOperationException($\"Position with symbol {position.Symbol} not found.\");\n                    }\n\n                    var resultingPosition = existing.Deduct(position.Quantity);\n                    // directly remove positions hows quantity is 0\n                    if(resultingPosition.Quantity == 0)\n                    {\n                        _positions.Remove(position.Symbol);\n                    }\n                    else\n                    {\n                        _positions[position.Symbol] = resultingPosition;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Clears this collection of all positions\n        /// </summary>\n        public void Clear()\n        {\n            _positions.Clear();\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the position with the specified symbol from this collection\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"position\">The position</param>\n        /// <returns>True if the position is found, otherwise false</returns>\n        public bool TryGetPosition(Symbol symbol, out IPosition position)\n        {\n            return _positions.TryGetValue(symbol, out position);\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<IPosition> GetEnumerator()\n        {\n            return _positions.Values.GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides extension methods for <see cref=\"IPosition\"/>\n    /// </summary>\n    public static class PositionExtensions\n    {\n        /// <summary>\n        /// Deducts the specified <paramref name=\"quantityToDeduct\"/> from the specified <paramref name=\"position\"/>\n        /// </summary>\n        /// <param name=\"position\">The source position</param>\n        /// <param name=\"quantityToDeduct\">The quantity to deduct</param>\n        /// <returns>A new position with the same properties but quantity reduced by the specified amount</returns>\n        public static IPosition Deduct(this IPosition position, decimal quantityToDeduct)\n        {\n            var newQuantity = position.Quantity - quantityToDeduct;\n            return new Position(position.Symbol, newQuantity, position.UnitQuantity);\n        }\n\n        /// <summary>\n        /// Combines the provided positions into a single position with the quantities added and the minimum unit quantity.\n        /// </summary>\n        /// <param name=\"position\">The position</param>\n        /// <param name=\"other\">The other position to add</param>\n        /// <returns>The combined position</returns>\n        public static IPosition Combine(this IPosition position, IPosition other)\n        {\n            if (!position.Symbol.Equals(other.Symbol))\n            {\n                throw new ArgumentException($\"Position symbols must match in order to combine quantities.\");\n            }\n\n            return new Position(position.Symbol,\n                position.Quantity + other.Quantity,\n                Math.Min(position.UnitQuantity, other.UnitQuantity)\n            );\n        }\n\n        /// <summary>\n        /// Consolidates the provided <paramref name=\"positions\"/> into a dictionary\n        /// </summary>\n        /// <param name=\"positions\">The positions to be consolidated</param>\n        /// <returns>A dictionary containing the consolidated positions</returns>\n        public static Dictionary<Symbol, IPosition> Consolidate(this IEnumerable<IPosition> positions)\n        {\n            var consolidated = new Dictionary<Symbol, IPosition>();\n            foreach (var position in positions)\n            {\n                IPosition existing;\n                if (consolidated.TryGetValue(position.Symbol, out existing))\n                {\n                    // if it already exists then combine it with the existing\n                    consolidated[position.Symbol] = existing.Combine(position);\n                }\n                else\n                {\n                    consolidated[position.Symbol] = position;\n                }\n            }\n\n            return consolidated;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"IPosition\"/> with quantity equal to <paramref name=\"numberOfLots\"/> times its unit quantity\n        /// </summary>\n        /// <param name=\"position\">The position</param>\n        /// <param name=\"numberOfLots\">The number of lots for the new position</param>\n        /// <returns>A new position with the specified number of lots</returns>\n        public static IPosition WithLots(this IPosition position, decimal numberOfLots)\n        {\n            var sign = position.Quantity < 0 ? -1 : +1;\n            return new Position(position.Symbol, numberOfLots * position.UnitQuantity * sign, position.UnitQuantity);\n        }\n\n        /// <summary>\n        /// Gets the quantity a group would have if the given position were part of it.\n        /// </summary>\n        /// <param name=\"position\">The position</param>\n        /// <returns>The group quantity</returns>\n        public static decimal GetGroupQuantity(this IPosition position)\n        {\n            return position.Quantity / position.UnitQuantity;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroup.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"IPositionGroup\"/>\n    /// </summary>\n    public class PositionGroup : IPositionGroup\n    {\n        /// <summary>\n        /// Gets the number of positions in the group\n        /// </summary>\n        public int Count => _positions.Count;\n\n        /// <summary>\n        /// Gets the key identifying this group\n        /// </summary>\n        public PositionGroupKey Key { get; }\n\n        /// <summary>\n        /// Gets the whole number of units in this position group\n        /// </summary>\n        public decimal Quantity { get; }\n\n        /// <summary>\n        /// Gets the positions in this group\n        /// </summary>\n        public IEnumerable<IPosition> Positions => _positions.Values;\n\n        /// <summary>\n        /// Gets the buying power model defining how margin works in this group\n        /// </summary>\n        public IPositionGroupBuyingPowerModel BuyingPowerModel => Key.BuyingPowerModel;\n\n        private readonly Dictionary<Symbol, IPosition> _positions;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroup\"/> class\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">The buying power model to use for this group</param>\n        /// <param name=\"quantity\">The group quantity, which must be the ratio of quantity to unit quantity of each position</param>\n        /// <param name=\"positions\">The positions comprising this group</param>\n        /// <exception cref=\"ArgumentException\">Thrown when the quantity is not the ratio of quantity to unit quantity of each position</exception>\n        public PositionGroup(IPositionGroupBuyingPowerModel buyingPowerModel, decimal quantity, params IPosition[] positions)\n            : this(new PositionGroupKey(buyingPowerModel, positions), quantity, positions.ToDictionary(p => p.Symbol))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroup\"/> class\n        /// </summary>\n        /// <param name=\"key\">The deterministic key for this group</param>\n        /// <param name=\"quantity\">The group quantity, which must be the ratio of quantity to unit quantity of each position</param>\n        /// <param name=\"positions\">The positions comprising this group</param>\n        /// <exception cref=\"ArgumentException\">Thrown when the quantity is not the ratio of quantity to unit quantity of each position</exception>\n        public PositionGroup(PositionGroupKey key, decimal quantity, params IPosition[] positions)\n            : this(key, quantity, positions.ToDictionary(p => p.Symbol))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroup\"/> class\n        /// </summary>\n        /// <param name=\"key\">The deterministic key for this group</param>\n        /// <param name=\"quantity\">The group quantity, which must be the ratio of quantity to unit quantity of each position</param>\n        /// <param name=\"positions\">The positions comprising this group</param>\n        /// <exception cref=\"ArgumentException\">Thrown when the quantity is not the ratio of quantity to unit quantity of each position</exception>\n        public PositionGroup(PositionGroupKey key, decimal quantity, Dictionary<Symbol, IPosition> positions)\n        {\n            Key = key;\n            Quantity = quantity;\n            _positions = positions;\n\n#if DEBUG\n            if (positions.Any(kvp => Math.Abs(kvp.Value.Quantity / kvp.Value.UnitQuantity) != Math.Abs(Quantity)))\n            {\n                throw new ArgumentException(Messages.PositionGroup.InvalidQuantity(Quantity, positions.Values));\n            }\n#endif\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the position with the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"position\">The position, if found</param>\n        /// <returns>True if the position was found, otherwise false</returns>\n        public bool TryGetPosition(Symbol symbol, out IPosition position)\n        {\n            return _positions.TryGetValue(symbol, out position);\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return $\"{Key}: {Quantity}\";\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<IPosition> GetEnumerator()\n        {\n            return Positions.GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Instantiates a default empty position group instance\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">The buying power model to use for this group</param>\n        public static PositionGroup Empty(IPositionGroupBuyingPowerModel buyingPowerModel)\n        {\n            return new PositionGroup(new PositionGroupKey(buyingPowerModel, new List<IPosition>()), 0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupBuyingPower.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the result for <see cref=\"IPositionGroupBuyingPowerModel.GetPositionGroupBuyingPower\"/>\n    /// </summary>\n    public class PositionGroupBuyingPower\n    {\n        /// <summary>\n        /// Gets the buying power\n        /// </summary>\n        public decimal Value { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupBuyingPower\"/> class\n        /// </summary>\n        /// <param name=\"buyingPower\">The buying power</param>\n        public PositionGroupBuyingPower(decimal buyingPower)\n        {\n            Value = buyingPower;\n        }\n\n        /// <summary>\n        /// Implicit operator from decimal\n        /// </summary>\n        public static implicit operator PositionGroupBuyingPower(decimal result)\n        {\n            return new PositionGroupBuyingPower(result);\n        }\n\n        /// <summary>\n        /// Implicit operator to decimal\n        /// </summary>\n        public static implicit operator decimal(PositionGroupBuyingPower result)\n        {\n            return result.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides a base class for implementations of <see cref=\"IPositionGroupBuyingPowerModel\"/>\n    /// </summary>\n    public abstract class PositionGroupBuyingPowerModel : IPositionGroupBuyingPowerModel\n    {\n        /// <summary>\n        /// Gets the percentage of portfolio buying power to leave as a buffer\n        /// </summary>\n        protected decimal RequiredFreeBuyingPowerPercent { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupBuyingPowerModel\"/> class\n        /// </summary>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage of portfolio buying power to leave as a buffer</param>\n        protected PositionGroupBuyingPowerModel(decimal requiredFreeBuyingPowerPercent = 0m)\n        {\n            RequiredFreeBuyingPowerPercent = requiredFreeBuyingPowerPercent;\n        }\n\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the </returns>\n        public abstract MaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters);\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        public abstract InitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters);\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public abstract InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInitialMarginForOrderParameters parameters);\n\n        /// <summary>\n        /// Computes the impact on the portfolio's buying power from adding the position group to the portfolio. This is\n        /// a 'what if' analysis to determine what the state of the portfolio would be if these changes were applied. The\n        /// delta (before - after) is the margin requirement for adding the positions and if the margin used after the changes\n        /// are applied is less than the total portfolio value, this indicates sufficient capital.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio and a position group containing the contemplated\n        /// changes to the portfolio</param>\n        /// <returns>Returns the portfolio's total portfolio value and margin used before and after the position changes are applied</returns>\n        public virtual ReservedBuyingPowerImpact GetReservedBuyingPowerImpact(ReservedBuyingPowerImpactParameters parameters)\n        {\n            // This process aims to avoid having to compute buying power on the entire portfolio and instead determines\n            // the set of groups that can be impacted by the changes being contemplated. The only real way to determine\n            // the change in maintenance margin is to determine what groups we'll have after the changes and compute the\n            // margin based on that.\n            //   1. Determine impacted groups (depends on IPositionGroupResolver.GetImpactedGroups)\n            //   2. Compute the currently reserved buying power of impacted groups\n            //   3. Create position collection using impacted groups and apply contemplated changes\n            //   4. Resolve new position groups using position collection with applied contemplated changes\n            //   5. Compute the contemplated reserved buying power on these newly resolved groups\n\n            // 1. Determine impacted groups\n            var positionManager = parameters.Portfolio.Positions;\n\n            // 2. Compute current reserved buying power\n            var current = 0m;\n            var impactedGroups = new List<IPositionGroup>();\n\n            // 3. Determine set of impacted positions to be grouped\n            var positions = parameters.Orders.Select(o => o.CreatePositions(parameters.Portfolio.Securities)).SelectMany(p => p).ToList();\n\n            var impactedPositions = positions.ToDictionary(p => p.Symbol);\n\n            foreach (var impactedGroup in positionManager.GetImpactedGroups(positions))\n            {\n                impactedGroups.Add(impactedGroup);\n                current += impactedGroup.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(\n                    parameters.Portfolio, impactedGroup\n                );\n\n                foreach (var position in impactedGroup)\n                {\n                    IPosition existing;\n                    if (impactedPositions.TryGetValue(position.Symbol, out existing))\n                    {\n                        // if it already exists then combine it with the existing\n                        impactedPositions[position.Symbol] = existing.Combine(position);\n                    }\n                    else\n                    {\n                        impactedPositions[position.Symbol] = position;\n                    }\n                }\n            }\n\n            // 4. Resolve new position groups\n            var contemplatedGroups = positionManager.ResolvePositionGroups(new PositionCollection(impactedPositions.Values));\n\n            // 5. Compute contemplated margin\n            var contemplated = GetContemplatedGroupsInitialMargin(parameters.Portfolio, contemplatedGroups, positions);\n\n            return new ReservedBuyingPowerImpact(current, contemplated, impactedGroups, parameters.ContemplatedChanges, contemplatedGroups);\n        }\n\n        /// <summary>\n        /// Gets the initial margin required for the specified contemplated position group.\n        /// Used by <see cref=\"GetReservedBuyingPowerImpact\"/> to get the contemplated groups margin.\n        /// </summary>\n        protected virtual decimal GetContemplatedGroupsInitialMargin(SecurityPortfolioManager portfolio, PositionGroupCollection contemplatedGroups,\n            List<IPosition> ordersPositions)\n        {\n            var contemplatedMargin = 0m;\n            foreach (var contemplatedGroup in contemplatedGroups)\n            {\n                // We use the initial margin requirement as the contemplated groups margin in order to ensure\n                // the available buying power is enough to execute the order.\n                contemplatedMargin += contemplatedGroup.BuyingPowerModel.GetInitialMarginRequirement(portfolio, contemplatedGroup);\n            }\n\n            return contemplatedMargin;\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power for the position group to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the order</param>\n        /// <returns>Returns buying power information for an order against a position group</returns>\n        public virtual HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n            )\n        {\n            // The addition of position groups requires that we not only check initial margin requirements, but also\n            // that we confirm that after the changes have been applied and the new groups resolved our maintenance\n            // margin is still in a valid range (less than TPV). For this model, we use the security's sufficient buying\n            // power impl to confirm initial margin requirements and lean heavily on GetReservedBuyingPowerImpact for\n            // help with confirming that our expected maintenance margin is still less than TPV.\n            //   1. Confirm we have sufficient buying power to execute the trade using security's BP model\n            //   2. Confirm we pass position group specific checks\n            //   3. Confirm we haven't exceeded maintenance margin limits via GetReservedBuyingPowerImpact's delta\n\n            // 1. Confirm we meet initial margin requirements, accounting for buffer\n            var deltaBuyingPowerArgs = new ReservedBuyingPowerImpactParameters(parameters.Portfolio, parameters.PositionGroup, parameters.Orders);\n            var deltaBuyingPower = GetReservedBuyingPowerImpact(deltaBuyingPowerArgs).Delta;\n\n            // When order only reduces or closes a security position, capital is always sufficient\n            if (deltaBuyingPower < 0)\n            {\n                return parameters.Sufficient();\n            }\n\n            var availableBuyingPower = parameters.Portfolio.MarginRemaining;\n\n            // 2. Confirm we pass position group specific checks\n            var result = PassesPositionGroupSpecificBuyingPowerForOrderChecks(parameters, availableBuyingPower);\n            if (result?.IsSufficient == false)\n            {\n                return result;\n            }\n\n            // 3. Confirm that the new groupings arising from the change doesn't make maintenance margin exceed TPV\n            // We can just compare the delta to the available buying power because the delta how much the maintenance margin will increase by\n            // if the order is executed, so it needs to stay below the available buying power\n            if (deltaBuyingPower <= availableBuyingPower)\n            {\n                return parameters.Sufficient();\n            }\n\n            return parameters.Insufficient(Invariant($@\"Id: {string.Join(\",\", parameters.Orders.Select(o => o.Id))}, Maintenance Margin Delta: {\n                deltaBuyingPower.Normalize()}, Free Margin: {availableBuyingPower.Normalize()}\"\n            ));\n        }\n\n        /// <summary>\n        /// Provides a mechanism for derived types to add their own buying power for order checks without needing to\n        /// recompute the available buying power. Implementations should return null if all checks pass and should\n        /// return an instance of <see cref=\"HasSufficientBuyingPowerForOrderResult\"/> with IsSufficient=false if it\n        /// fails.\n        /// </summary>\n        protected virtual HasSufficientBuyingPowerForOrderResult PassesPositionGroupSpecificBuyingPowerForOrderChecks(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters,\n            decimal availableBuyingPower\n            )\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Computes the amount of buying power reserved by the provided position group\n        /// </summary>\n        public virtual ReservedBuyingPowerForPositionGroup GetReservedBuyingPowerForPositionGroup(\n            ReservedBuyingPowerForPositionGroupParameters parameters\n            )\n        {\n            return this.GetMaintenanceMargin(parameters.Portfolio, parameters.PositionGroup);\n        }\n\n        /// <summary>\n        /// Get the maximum position group order quantity to obtain a position with a given buying power\n        /// percentage. Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the target\n        ///     signed buying power percentage</param>\n        /// <returns>\n        /// Returns the maximum allowed market order quantity and if zero, also the reason.\n        ///\n        /// Since there is no sense of \"short\" or \"long\" on position groups with multiple positions,\n        /// the sign of the returned quantity will indicate the direction of the order regarding the\n        /// reference position group passed in the parameters:\n        ///     - quantity &gt; 0: the order should be placed in the same direction as the reference position group to increase it,\n        ///                        without changing the positions' signs.\n        ///     - quantity &lt; 0: the order should be placed in the opposite direction as the reference position group to reduce it,\n        ///                        using each position's opposite sign.\n        /// </returns>\n        public virtual GetMaximumLotsResult GetMaximumLotsForTargetBuyingPower(\n            GetMaximumLotsForTargetBuyingPowerParameters parameters\n            )\n        {\n            // In order to determine maximum order quantity for a particular amount of buying power, we must resolve\n            // the group's 'unit' as this will be the quantity step size. If we don't step according to these units\n            // then we could be left with a different type of group with vastly different margin requirements, so we\n            // must keep the ratios between all of the position quantities the same. First we'll determine the target\n            // buying power, taking into account RequiredFreeBuyingPowerPercent to ensure a buffer. Then we'll evaluate\n            // the initial margin requirement using the provided position group position quantities. From this value,\n            // we can determine if we need to add more quantity or remove quantity by looking at the delta from the target\n            // to the computed initial margin requirement. We can also compute, assuming linearity, the change in initial\n            // margin requirements for each 'unit' of the position group added. The final value we need before starting to\n            // iterate to solve for quantity is the minimum quantities. This is the 'unit' of the position group, and any\n            // quantities less than the unit's quantity would yield an entirely different group w/ different margin calcs.\n            // Now that we've resolved our target, our group unit and the unit's initial margin requirement, we can iterate\n            // increasing/decreasing quantities in multiples of the unit's quantities until we're within a unit's amount of\n            // initial margin to the target buying power.\n            // NOTE: The first estimate MUST be greater than the target and iteration will successively decrease quantity estimates.\n            //   1. Determine current holdings of position group\n            //   2. Determine target buying power, taking into account RequiredFreeBuyingPowerPercent\n            //  2a. If targeting zero, simply return the negative of the quantity\n            //   3. Determine current used margin [we're using initial here to match BuyingPowerModel]\n            //   4. Check that the change of margin is above our models minimum percentage change\n            //   5. Resolve the group's 'unit' quantities, this is our step size\n            //  5a. Compute the initial margin requirement for a single unit\n            //   6. Begin iterating until the allocated holdings margin (after order fees are applied) less or equal to the expected target margin\n            //  6a. Calculate the amount to order to get the target margin\n            //  6b. Apply order fees to the allocated holdings margin and compare to the target margin to end loop.\n\n            var portfolio = parameters.Portfolio;\n\n            // 1. Determine current holdings of position group\n            var currentPositionGroup = portfolio.Positions[parameters.PositionGroup.Key];\n\n            var inverted = false;\n            var targetBuyingPower = parameters.TargetBuyingPower;\n            // The reference position group is not necessarily in the same side as the position group in the portfolio, it could be the inverted.\n            // So the consumer needs the result relative to that position group instead of the one being held.\n            if (parameters.PositionGroup.IsInvertedOf(currentPositionGroup))\n            {\n                inverted = true;\n                targetBuyingPower = -targetBuyingPower;\n            }\n\n            // 2. Determine target buying power, taking into account RequiredFreeBuyingPowerPercent\n            var bufferFactor = 1 - RequiredFreeBuyingPowerPercent;\n            var targetBufferFactor = bufferFactor * targetBuyingPower;\n            var totalPortfolioValue = portfolio.TotalPortfolioValue;\n            var targetFinalMargin = targetBufferFactor * totalPortfolioValue;\n\n            // 2a. If targeting zero, simply return the negative of the quantity\n            if (targetFinalMargin == 0)\n            {\n                var quantity = -Math.Abs(currentPositionGroup.Quantity);\n                return parameters.Result(inverted ? -quantity : quantity);\n            }\n\n            // 3. Determine initial margin requirement for current holdings\n            var currentUsedMargin = 0m;\n            if (currentPositionGroup.Quantity != 0)\n            {\n                currentUsedMargin = Math.Abs(currentPositionGroup.BuyingPowerModel.GetInitialMarginRequirement(portfolio, currentPositionGroup));\n            }\n\n            // 4. Check that the change of margin is above our models minimum percentage change\n            var absDifferenceOfMargin = Math.Abs(targetFinalMargin - currentUsedMargin);\n            if (!BuyingPowerModelExtensions.AboveMinimumOrderMarginPortfolioPercentage(parameters.Portfolio,\n                parameters.MinimumOrderMarginPortfolioPercentage, absDifferenceOfMargin))\n            {\n                string reason = null;\n                if (!parameters.SilenceNonErrorReasons)\n                {\n                    var minimumValue = totalPortfolioValue * parameters.MinimumOrderMarginPortfolioPercentage;\n                    reason = Messages.BuyingPowerModel.TargetOrderMarginNotAboveMinimum(absDifferenceOfMargin, minimumValue);\n                }\n                return new GetMaximumLotsResult(0, reason, false);\n            }\n\n            // 5. Resolve 'unit' group -- this is our step size\n            var groupUnit = currentPositionGroup.CreateUnitGroup(parameters.Portfolio.Positions);\n\n            // 5a. Compute initial margin requirement for a single unit\n            var unitMargin = Math.Abs(groupUnit.BuyingPowerModel.GetInitialMarginRequirement(portfolio, groupUnit));\n            if (unitMargin == 0m)\n            {\n                // likely due to missing price data\n                var zeroPricedPosition = parameters.PositionGroup.FirstOrDefault(\n                    p => portfolio.Securities.GetValueOrDefault(p.Symbol)?.Price == 0m\n                );\n                return parameters.Error(zeroPricedPosition?.Symbol.GetZeroPriceMessage()\n                    ?? Messages.PositionGroupBuyingPowerModel.ComputedZeroInitialMargin(parameters.PositionGroup));\n            }\n\n            // 6. Begin iterating\n            var lastPositionGroupOrderQuantity = 0m;    // For safety check\n            decimal orderFees;\n            decimal targetHoldingsMargin;\n            decimal positionGroupQuantity;\n            do\n            {\n                // 6a.Calculate the amount to order to get the target margin\n                positionGroupQuantity = GetPositionGroupOrderQuantity(portfolio, currentPositionGroup, currentUsedMargin, targetFinalMargin,\n                    groupUnit, unitMargin, out targetHoldingsMargin);\n                if (positionGroupQuantity == 0)\n                {\n                    string reason = null;\n                    if (!parameters.SilenceNonErrorReasons)\n                    {\n                        reason = Messages.PositionGroupBuyingPowerModel.PositionGroupQuantityRoundedToZero(targetFinalMargin - currentUsedMargin);\n                    }\n\n                    return new GetMaximumLotsResult(0, reason, false);\n                }\n\n                // 6b.Apply order fees to the allocated holdings margin\n                orderFees = GetOrderFeeInAccountCurrency(portfolio, currentPositionGroup.WithQuantity(positionGroupQuantity, portfolio.Positions));\n\n                // Update our target portfolio margin allocated when considering fees, then calculate the new FinalOrderMargin\n                targetFinalMargin = (totalPortfolioValue - orderFees) * targetBufferFactor;\n\n                // Start safe check after first loop, stops endless recursion\n                if (lastPositionGroupOrderQuantity == positionGroupQuantity)\n                {\n                    throw new ArgumentException(Messages.PositionGroupBuyingPowerModel.FailedToConvergeOnTargetMargin(targetFinalMargin,\n                        positionGroupQuantity, orderFees, parameters));\n                }\n\n                lastPositionGroupOrderQuantity = positionGroupQuantity;\n\n            }\n            // Ensure that our target holdings margin will be less than or equal to our target allocated margin\n            while (Math.Abs(targetHoldingsMargin) > Math.Abs(targetFinalMargin));\n\n            return parameters.Result(inverted ? -positionGroupQuantity : positionGroupQuantity);\n        }\n\n        /// <summary>\n        /// Get the maximum market position group order quantity to obtain a delta in the buying power used by a position group.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        public virtual GetMaximumLotsResult GetMaximumLotsForDeltaBuyingPower(\n            GetMaximumLotsForDeltaBuyingPowerParameters parameters\n            )\n        {\n            // we convert this delta request into a target buying power request through projection\n            // by determining the currently used (reserved) buying power and adding the delta to\n            // arrive at a target buying power percentage\n\n            var currentPositionGroup = parameters.Portfolio.Positions[parameters.PositionGroup.Key];\n            var usedBuyingPower = parameters.PositionGroup.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(\n                parameters.Portfolio, currentPositionGroup\n            );\n\n            var targetBuyingPower = usedBuyingPower + parameters.DeltaBuyingPower;\n            // The reference position group is not necessarily in the same side as the position group in the portfolio, it could be the inverted.\n            // So the consumer needs the result relative to that position group instead of the one being held.\n            if (parameters.PositionGroup.IsInvertedOf(currentPositionGroup))\n            {\n                targetBuyingPower = parameters.DeltaBuyingPower - usedBuyingPower;\n            }\n\n            var targetBuyingPowerPercent = parameters.Portfolio.TotalPortfolioValue != 0\n                ? targetBuyingPower / parameters.Portfolio.TotalPortfolioValue\n                : 0;\n\n            return GetMaximumLotsForTargetBuyingPower(new GetMaximumLotsForTargetBuyingPowerParameters(\n                parameters.Portfolio, parameters.PositionGroup, targetBuyingPowerPercent, parameters.MinimumOrderMarginPortfolioPercentage\n            ));\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a position group trade\n        /// </summary>\n        /// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n        /// <returns>The buying power available for the trade</returns>\n        public PositionGroupBuyingPower GetPositionGroupBuyingPower(PositionGroupBuyingPowerParameters parameters)\n        {\n            // SecurityPositionGroupBuyingPowerModel models buying power the same as non-grouped, so we can simply delegate\n            // to the security's model. For posterity, however, I'll lay out the process for computing the available buying\n            // power for a position group trade. There's two separate cases, one where we're increasing the position and one\n            // where we're decreasing the position and potentially crossing over zero. When decreasing the position we have\n            // to account for the reserved buying power that the position currently holds and add that to any free buying power\n            // in the portfolio.\n            //   1. Get portfolio's MarginRemaining (free buying power)\n            //   2. Determine if closing position\n            //   2a. Add reserved buying power freed up by closing the position\n            //   2b. Rebate initial buying power required for current position [to match current behavior, might not be possible]\n\n            // 1. Get MarginRemaining\n            var buyingPower = parameters.Portfolio.MarginRemaining;\n\n            // 2. Determine if closing position\n            IPositionGroup existing;\n            if (parameters.Portfolio.Positions.Groups.TryGetGroup(parameters.PositionGroup.Key, out existing))\n            {\n                var isInverted = parameters.PositionGroup.IsInvertedOf(existing);\n                if (isInverted && parameters.Direction == OrderDirection.Buy || !isInverted && parameters.Direction == OrderDirection.Sell)\n                {\n                    // 2a. Add reserved buying power of current position\n                    // Using the existing position group's buying power model to compute its reserved buying power and initial margin requirement.\n                    // This is necessary because the margin calculations depend on the option strategy underneath the position group's BPM.\n                    buyingPower += existing.Key.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(parameters.Portfolio, existing);\n\n                    // 2b. Rebate the initial margin equivalent of current position\n                    // this interface doesn't have a concept of initial margin as it's an impl detail of the BuyingPowerModel base class\n                    buyingPower += Math.Abs(existing.Key.BuyingPowerModel.GetInitialMarginRequirement(parameters.Portfolio, existing));\n                }\n            }\n\n            return buyingPower;\n        }\n\n        /// <summary>\n        /// Helper function to convert a <see cref=\"CashAmount\"/> to the account currency\n        /// </summary>\n        protected virtual decimal ToAccountCurrency(SecurityPortfolioManager portfolio, CashAmount cash)\n        {\n            return portfolio.CashBook.ConvertToAccountCurrency(cash).Amount;\n        }\n\n        /// <summary>\n        /// Helper function to compute the order fees associated with executing market orders for the specified <paramref name=\"positionGroup\"/>\n        /// </summary>\n        protected virtual decimal GetOrderFeeInAccountCurrency(SecurityPortfolioManager portfolio, IPositionGroup positionGroup)\n        {\n            // TODO : Add Order parameter to support Combo order type, pulling the orders per position\n\n            var orderFee = 0m;\n            var utcTime = portfolio.Securities.UtcTime;\n\n            foreach (var position in positionGroup)\n            {\n                var security = portfolio.Securities[position.Symbol];\n                var order = new MarketOrder(position.Symbol, position.Quantity, utcTime);\n                var positionOrderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(security, order)).Value;\n                orderFee += ToAccountCurrency(portfolio, positionOrderFee);\n            }\n\n            return orderFee;\n        }\n\n        /// <summary>\n        /// Checks if the margin difference is not growing in final margin calculation, just making sure we don't end up in an infinite loop.\n        /// This function was split out to support derived types using the same error message as well as removing the added noise of the check\n        /// and message creation.\n        /// </summary>\n        protected static bool UnableToConverge(decimal currentMarginDifference, decimal lastMarginDifference, IPositionGroup groupUnit,\n            SecurityPortfolioManager portfolio, decimal positionGroupQuantity, decimal targetMargin, decimal currentMargin,\n            decimal absUnitMargin, out ArgumentException error)\n        {\n            // determine if we're unable to converge by seeing if quantity estimate hasn't changed\n            if (Math.Abs(currentMarginDifference) > Math.Abs(lastMarginDifference) &&\n                Math.Sign(currentMarginDifference) == Math.Sign(lastMarginDifference)\n                || currentMarginDifference == lastMarginDifference)\n            {\n                string message;\n                if (groupUnit.Count == 1)\n                {\n                    // single security group\n                    var security = portfolio.Securities[groupUnit.Single().Symbol];\n                    message = \"GetMaximumPositionGroupOrderQuantityForTargetBuyingPower failed to converge to target margin \" +\n                        Invariant($\"{targetMargin}. Current margin is {currentMargin}. Position group quantity {positionGroupQuantity}. \") +\n                        Invariant($\"Lot size is {security.SymbolProperties.LotSize}.Security symbol \") +\n                        Invariant($\"{security.Symbol}. Margin unit {absUnitMargin}.\");\n                }\n                else\n                {\n                    message = \"GetMaximumPositionGroupOrderQuantityForTargetBuyingPower failed to converge to target margin \" +\n                        Invariant($\"{targetMargin}. Current margin is {currentMargin}. Position group quantity {positionGroupQuantity}. \") +\n                        Invariant($\"Position Group Unit is {groupUnit.Key}. Position Group Name \") +\n                        Invariant($\"{groupUnit.GetUserFriendlyName()}. Margin unit {absUnitMargin}.\");\n                }\n\n                error = new ArgumentException(message);\n                return true;\n            }\n\n            error = null;\n            return false;\n        }\n\n        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.</returns>\n        public virtual bool Equals(IPositionGroupBuyingPowerModel other)\n        {\n            if (ReferenceEquals(null, other))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, other))\n            {\n                return true;\n            }\n\n            return GetType() == other.GetType();\n        }\n\n        /// <summary>Determines whether the specified object is equal to the current object.</summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>true if the specified object  is equal to the current object; otherwise, false.</returns>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, obj))\n            {\n                return true;\n            }\n\n            if (obj.GetType() != GetType())\n            {\n                return false;\n            }\n\n            return Equals((IPositionGroupBuyingPowerModel) obj);\n        }\n\n        /// <summary>Serves as the default hash function. </summary>\n        /// <returns>A hash code for the current object.</returns>\n        public override int GetHashCode()\n        {\n            return GetType().GetHashCode();\n        }\n\n        /// <summary>\n        /// Helper method that determines the amount to order to get to a given target safely.\n        /// Meaning it will either be at or just below target always.\n        /// </summary>\n        /// <param name=\"portfolio\">Current portfolio</param>\n        /// <param name=\"currentPositionGroup\">Current position group</param>\n        /// <param name=\"currentUsedMargin\">Current margin reserved for the position</param>\n        /// <param name=\"targetFinalMargin\">The target margin</param>\n        /// <param name=\"groupUnit\">Unit position group corresponding to the <paramref name=\"currentPositionGroup\"/></param>\n        /// <param name=\"unitMargin\">Margin required for the <paramref name=\"groupUnit\"/></param>\n        /// <param name=\"finalMargin\">Output the final margin allocated for the position group</param>\n        /// <returns>The size of the order to get safely to our target</returns>\n        public decimal GetPositionGroupOrderQuantity(SecurityPortfolioManager portfolio, IPositionGroup currentPositionGroup,\n            decimal currentUsedMargin, decimal targetFinalMargin, IPositionGroup groupUnit, decimal unitMargin,\n            out decimal finalMargin)\n        {\n            // Determine the direction to go towards when updating the estimate: +1 to increase, -1 to decrease.\n            var quantityStep = targetFinalMargin > currentUsedMargin ? +1 : -1;\n\n            // Compute initial position group quantity estimate -- group quantities are whole numbers [number of lots/unit quantities].\n            //   - If going to the opposite side (target margin < 0), move towards said side from 0 since we need to completely close the position.\n            //   - Else, just start with a unit step towards the determined direction.\n            var currentGroupAbsQuantity = Math.Abs(currentPositionGroup.Quantity);\n            var positionGroupQuantity = targetFinalMargin < 0 ? -currentGroupAbsQuantity + quantityStep : quantityStep;\n\n            // Calculate the initial value for the wanted final margin after the delta is applied.\n            var finalPositionGroup = currentPositionGroup.WithQuantity(currentGroupAbsQuantity + positionGroupQuantity, portfolio.Positions);\n            finalMargin = Math.Abs(finalPositionGroup.BuyingPowerModel.GetInitialMarginRequirement(portfolio, finalPositionGroup));\n\n            // Keep the previous calculated final margin we would get after the delta is applied.\n            // This is useful for the cases were the final group gets us with final margin greater than the target.\n            var prevFinalMargin = finalMargin;\n\n            // Begin iterating until the final margin is equal or greater than the target margin.\n            var absTargetFinalMargin = Math.Abs(targetFinalMargin);\n            var getMarginDifference = (decimal currentFinalMargin) =>\n                targetFinalMargin < 0 ? absTargetFinalMargin - currentFinalMargin : currentFinalMargin - absTargetFinalMargin;\n\n            var marginDifference = getMarginDifference(finalMargin);\n            while ((quantityStep < 0 && marginDifference > 0) || (quantityStep > 0 && marginDifference < 0))\n            {\n                positionGroupQuantity += quantityStep;\n                finalPositionGroup = currentPositionGroup.WithQuantity(currentGroupAbsQuantity + positionGroupQuantity, portfolio.Positions);\n                finalMargin = Math.Abs(finalPositionGroup.BuyingPowerModel.GetInitialMarginRequirement(portfolio, finalPositionGroup));\n\n                var newMarginDifference = getMarginDifference(finalMargin);\n                if (UnableToConverge(newMarginDifference, marginDifference, groupUnit, portfolio, positionGroupQuantity,\n                    targetFinalMargin, currentUsedMargin, unitMargin, out var error))\n                {\n                    throw error;\n                }\n\n                marginDifference = newMarginDifference;\n            }\n\n            // If the final margin is greater than the target, the result is the previous quantity,\n            // which is the maximum allowed to be within the target margin.\n            if (finalMargin > absTargetFinalMargin)\n            {\n                finalMargin = prevFinalMargin;\n                return positionGroupQuantity - quantityStep;\n            }\n\n            return positionGroupQuantity;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupBuyingPowerModelExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides methods aimed at reducing the noise introduced from having result/parameter types for each method.\n    /// These methods aim to accept raw arguments and return the desired value type directly.\n    /// </summary>\n    public static class PositionGroupBuyingPowerModelExtensions\n    {\n        /// <summary>\n        /// Gets the margin currently allocated to the specified position group\n        /// </summary>\n        public static decimal GetMaintenanceMargin(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            return model.GetMaintenanceMargin(\n                new PositionGroupMaintenanceMarginParameters(portfolio, positionGroup)\n            );\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to change positions by the changes defined by the provided position group\n        /// </summary>\n        public static decimal GetInitialMarginRequirement(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            return model.GetInitialMarginRequirement(\n                new PositionGroupInitialMarginParameters(portfolio, positionGroup)\n            ).Value;\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        public static decimal GetInitialMarginRequiredForOrder(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            Order order\n            )\n        {\n            return model.GetInitialMarginRequiredForOrder(\n                new PositionGroupInitialMarginForOrderParameters(portfolio, positionGroup, order)\n            ).Value;\n        }\n\n        /// <summary>\n        /// Computes the amount of buying power reserved by the provided position group\n        /// </summary>\n        public static decimal GetReservedBuyingPowerForPositionGroup(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            return model.GetReservedBuyingPowerForPositionGroup(\n                new ReservedBuyingPowerForPositionGroupParameters(portfolio, positionGroup)\n            ).AbsoluteUsedBuyingPower;\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power for the position group to execute this order.\n        /// </summary>\n        public static HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            List<Order> orders\n            )\n        {\n            return model.HasSufficientBuyingPowerForOrder(new HasSufficientPositionGroupBuyingPowerForOrderParameters(\n                portfolio, positionGroup, orders\n            ));\n        }\n\n        /// <summary>\n        /// Gets the buying power available for a position group trade\n        /// </summary>\n        public static PositionGroupBuyingPower GetPositionGroupBuyingPower(\n            this IPositionGroupBuyingPowerModel model,\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            OrderDirection direction\n            )\n        {\n            return model.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                portfolio, positionGroup, direction\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupBuyingPowerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetPositionGroupBuyingPower\"/>\n    /// </summary>\n    public class PositionGroupBuyingPowerParameters\n    {\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the direction in which buying power is to be computed\n        /// </summary>\n        public OrderDirection Direction { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupBuyingPowerParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"direction\">The direction to compute buying power in</param>\n        public PositionGroupBuyingPowerParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            OrderDirection direction\n            )\n        {\n            Portfolio = portfolio;\n            Direction = direction;\n            PositionGroup = positionGroup;\n        }\n\n        /// <summary>\n        /// Implicit operator to dependent function to remove noise\n        /// </summary>\n        public static implicit operator ReservedBuyingPowerForPositionGroupParameters(\n            PositionGroupBuyingPowerParameters parameters\n            )\n        {\n            return new ReservedBuyingPowerForPositionGroupParameters(parameters.Portfolio, parameters.PositionGroup);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides a collection type for <see cref=\"IPositionGroup\"/>\n    /// </summary>\n    public class PositionGroupCollection : IReadOnlyCollection<IPositionGroup>\n    {\n        /// <summary>\n        /// Gets an empty instance of the <see cref=\"PositionGroupCollection\"/> class\n        /// </summary>\n        public static PositionGroupCollection Empty => new(new Dictionary<PositionGroupKey, IPositionGroup>(), new Dictionary<Symbol, HashSet<IPositionGroup>>());\n\n        /// <summary>\n        /// Gets the number of positions in this group\n        /// </summary>\n        public int Count => _groups.Count;\n\n        /// <summary>\n        /// Gets whether or not this collection contains only default position groups\n        /// </summary>\n        public bool IsOnlyDefaultGroups\n        {\n            get\n            {\n                if (_hasNonDefaultGroups == null)\n                {\n                    _hasNonDefaultGroups = _groups.Count == 0 || _groups.All(grp => grp.Key.IsDefaultGroup);\n                }\n\n                return _hasNonDefaultGroups.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the position groups keys in this collection\n        /// </summary>\n        public IReadOnlyCollection<PositionGroupKey> Keys => _groups.Keys;\n\n        /// <summary>\n        /// Gets the position groups in this collection\n        /// </summary>\n        public IReadOnlyCollection<IPositionGroup> Values => _groups.Values;\n\n        private bool? _hasNonDefaultGroups;\n        private readonly Dictionary<PositionGroupKey, IPositionGroup> _groups;\n        private readonly Dictionary<Symbol, HashSet<IPositionGroup>> _groupsBySymbol;\n\n        internal IEnumerable<KeyValuePair<PositionGroupKey, IPositionGroup>> GetGroups() => _groups;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupCollection\"/> class\n        /// </summary>\n        /// <param name=\"groups\">The position groups keyed by their group key</param>\n        /// <param name=\"groupsBySymbol\">The position groups keyed by the symbol of each position</param>\n        public PositionGroupCollection(\n            Dictionary<PositionGroupKey, IPositionGroup> groups,\n            Dictionary<Symbol, HashSet<IPositionGroup>> groupsBySymbol\n            )\n        {\n            _groups = groups;\n            _groupsBySymbol = groupsBySymbol;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupCollection\"/> class\n        /// </summary>\n        /// <param name=\"groups\">The position groups</param>\n        public PositionGroupCollection(IReadOnlyCollection<IPositionGroup> groups)\n        {\n            _groups = new();\n            _groupsBySymbol = new();\n            foreach (var group in groups)\n            {\n                Add(group);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"PositionGroupCollection\"/> that contains all of the position groups\n        /// in this collection in addition to the specified <paramref name=\"group\"/>. If a group with the\n        /// same key already exists then it is overwritten.\n        /// </summary>\n        public PositionGroupCollection Add(IPositionGroup group)\n        {\n            foreach (var position in group)\n            {\n                if (!_groupsBySymbol.TryGetValue(position.Symbol, out var groups))\n                {\n                    _groupsBySymbol[position.Symbol] = groups = new();\n                }\n                groups.Add(group);\n            }\n            _groups[group.Key] = group;\n\n            return this;\n        }\n\n        /// <summary>\n        /// Determines whether or not a group with the specified key exists in this collection\n        /// </summary>\n        /// <param name=\"key\">The group key to search for</param>\n        /// <returns>True if a group with the specified key was found, false otherwise</returns>\n        public bool Contains(PositionGroupKey key)\n        {\n            return _groups.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IPositionGroup\"/> matching the specified key. If one does not exist, then an empty\n        /// group is returned matching the unit quantities defined in the <paramref name=\"key\"/>\n        /// </summary>\n        /// <param name=\"key\">The position group key to search for</param>\n        /// <returns>The position group matching the specified key, or a new empty group if no matching group is found.</returns>\n        public IPositionGroup this[PositionGroupKey key]\n        {\n            get\n            {\n                IPositionGroup group;\n                if (!TryGetGroup(key, out group))\n                {\n                    return new PositionGroup(key, 0m, key.CreateEmptyPositions());\n                }\n\n                return group;\n            }\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the group with the specified key\n        /// </summary>\n        /// <param name=\"key\">The group key to search for</param>\n        /// <param name=\"group\">The position group</param>\n        /// <returns>True if group with key found, otherwise false</returns>\n        public bool TryGetGroup(PositionGroupKey key, out IPositionGroup group)\n        {\n            return _groups.TryGetValue(key, out group);\n        }\n\n        /// <summary>\n        /// Attempts to retrieve all groups that contain the provided symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"groups\">The groups if any were found, otherwise null</param>\n        /// <returns>True if groups were found for the specified symbol, otherwise false</returns>\n        public bool TryGetGroups(Symbol symbol, out IReadOnlyCollection<IPositionGroup> groups)\n        {\n            HashSet<IPositionGroup> list;\n            if (_groupsBySymbol.TryGetValue(symbol, out list) && list?.Count > 0)\n            {\n                groups = list;\n                return true;\n            }\n\n            groups = null;\n            return false;\n        }\n\n        /// <summary>\n        /// Merges this position group collection with the provided <paramref name=\"other\"/> collection.\n        /// </summary>\n        public PositionGroupCollection CombineWith(PositionGroupCollection other)\n        {\n            if(other.Count == 0)\n            {\n                return this;\n            }\n            if (Count == 0)\n            {\n                return other;\n            }\n\n            var result = this;\n            foreach (var positionGroup in other)\n            {\n                result = result.Add(positionGroup);\n            }\n\n            return result;\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n        public IEnumerator<IPositionGroup> GetEnumerator()\n        {\n            return _groups.Values.GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides extension methods for <see cref=\"IPositionGroup\"/>\n    /// </summary>\n    public static class PositionGroupExtensions\n    {\n        /// <summary>\n        /// Gets the position in the <paramref name=\"group\"/> matching the provided <param name=\"symbol\"></param>\n        /// </summary>\n        public static IPosition GetPosition(this IPositionGroup group, Symbol symbol)\n        {\n            IPosition position;\n            if (!group.TryGetPosition(symbol, out position))\n            {\n                throw new KeyNotFoundException($\"No position with symbol '{symbol}' exists in the group: {group}\");\n            }\n\n            return position;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"IPositionGroup\"/> with the specified <paramref name=\"groupQuantity\"/>.\n        /// If the quantity provided equals the template's quantity then the template is returned.\n        /// </summary>\n        /// <param name=\"template\">The group template</param>\n        /// <param name=\"groupQuantity\">The quantity of the new group</param>\n        /// <param name=\"positionMananger\">The position manager to use to resolve positions</param>\n        /// <returns>A position group with the same position ratios as the template but with the specified group quantity</returns>\n        public static IPositionGroup WithQuantity(this IPositionGroup template, decimal groupQuantity, SecurityPositionGroupModel positionMananger)\n        {\n            var positions = template.ToArray(p => p.WithLots(groupQuantity));\n\n            // Could result in an inverse strategy that would not get resolved by using the same key\n            if (groupQuantity < 0)\n            {\n                return positionMananger.ResolvePositionGroups(new PositionCollection(positions)).Single();\n            }\n\n            return new PositionGroup(template.Key, groupQuantity, positions);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"IPositionGroup\"/> with each position's quantity equaling it's unit quantity\n        /// </summary>\n        /// <param name=\"template\">The group template</param>\n        /// <returns>A position group with the same position ratios as the template but with the specified group quantity</returns>\n        public static IPositionGroup CreateUnitGroup(this IPositionGroup template, SecurityPositionGroupModel positionMananger)\n        {\n            return template.WithQuantity(1, positionMananger);\n        }\n\n        /// <summary>\n        /// Determines whether the position group is empty\n        /// </summary>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <returns>True if the position group is empty, that is, it has no positions, false otherwise</returns>\n        public static bool IsEmpty(this IPositionGroup positionGroup)\n        {\n            return positionGroup.Count == 0;\n        }\n\n        /// <summary>\n        /// Checks whether the provided groups are in opposite sides, that is, each of their positions are in opposite sides.\n        /// </summary>\n        /// <param name=\"group\">The group to check</param>\n        /// <param name=\"other\">The group to check against</param>\n        /// <returns>\n        /// Whether the position groups are the inverted version of each other, that is, contain the same positions each on the opposite side\n        /// </returns>\n        public static bool IsInvertedOf(this IPositionGroup group, IPositionGroup other)\n        {\n            return group.Count == other.Count\n                && group.All(position => Math.Sign(position.Quantity) == -Math.Sign(other.GetPosition(position.Symbol).Quantity));\n        }\n\n        /// <summary>\n        /// Checks whether the provided groups are closing/reducing each other, that is, each of their positions are in opposite sides.\n        /// </summary>\n        /// <param name=\"finalGroup\">The final position group that would result from a trade</param>\n        /// <param name=\"initialGroup\">The initial position group before a trade</param>\n        /// <returns>Whether final resulting position group is a reduction of the initial one</returns>\n        public static bool Closes(this IPositionGroup finalGroup, IPositionGroup initialGroup)\n        {\n            // Liquidating\n            if (finalGroup.IsEmpty())\n            {\n                return true;\n            }\n\n            if (finalGroup.Count != initialGroup.Count)\n            {\n                return false;\n            }\n\n            // Liquidating\n            if (finalGroup.Quantity == 0 &&\n                // The initial group includes all positions being liquidated\n                finalGroup.All(position => initialGroup.TryGetPosition(position.Symbol, out _)))\n            {\n                return true;\n            }\n\n            // Each of the positions have opposite quantity signs\n            if (finalGroup.IsInvertedOf(initialGroup))\n            {\n                return true;\n            }\n\n            // The final group has a smaller quantity than the initial group\n            return Math.Abs(finalGroup.Quantity) < Math.Abs(initialGroup.Quantity) &&\n                finalGroup.All(position => Math.Sign(position.Quantity) == Math.Sign(initialGroup.GetPosition(position.Symbol).Quantity));\n        }\n\n        /// <summary>\n        /// Gets a user friendly name for the provided <paramref name=\"group\"/>\n        /// </summary>\n        public static string GetUserFriendlyName(this IPositionGroup group)\n        {\n            if (group.Count == 1)\n            {\n                return group.Single().Symbol.ToString();\n            }\n\n            return string.Join(\"|\", group.Select(p => p.Symbol.ToString()));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupInitialMarginForOrderParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetInitialMarginRequiredForOrder\"/>\n    /// </summary>\n    public class PositionGroupInitialMarginForOrderParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Gets the order\n        /// </summary>\n        public Order Order { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupInitialMarginForOrderParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        /// <param name=\"order\">The order</param>\n        public PositionGroupInitialMarginForOrderParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup,\n            Order order\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n            Order = order;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupInitialMarginParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetInitialMarginRequirement\"/>\n    /// </summary>\n    public class PositionGroupInitialMarginParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupInitialMarginParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        public PositionGroupInitialMarginParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupKey.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines a unique and deterministic key for <see cref=\"IPositionGroup\"/>\n    /// </summary>\n    public sealed class PositionGroupKey : IEquatable<PositionGroupKey>\n    {\n        /// <summary>\n        /// Gets whether or not this key defines a default group\n        /// </summary>\n        public bool IsDefaultGroup { get; }\n\n        /// <summary>\n        /// Gets the <see cref=\"IPositionGroupBuyingPowerModel\"/> being used by the group\n        /// </summary>\n        public IPositionGroupBuyingPowerModel BuyingPowerModel { get; }\n\n        /// <summary>\n        /// Gets the unit quantities defining the ratio between position quantities in the group\n        /// </summary>\n        public IReadOnlyList<Tuple<Symbol, decimal>> UnitQuantities { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupKey\"/> class for groups with a single security\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">The group's buying power model</param>\n        /// <param name=\"security\">The security</param>\n        public PositionGroupKey(IPositionGroupBuyingPowerModel buyingPowerModel, Security security)\n        {\n            IsDefaultGroup = buyingPowerModel.GetType() == typeof(SecurityPositionGroupBuyingPowerModel);\n            BuyingPowerModel = buyingPowerModel;\n            UnitQuantities = new[]\n            {\n                Tuple.Create(security.Symbol, security.SymbolProperties.LotSize)\n            };\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupKey\"/> class\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">The group's buying power model</param>\n        /// <param name=\"positions\">The positions comprising the group</param>\n        public PositionGroupKey(IPositionGroupBuyingPowerModel buyingPowerModel, IReadOnlyCollection<IPosition> positions)\n        {\n            BuyingPowerModel = buyingPowerModel;\n            if(positions.Count == 1)\n            {\n                var position = positions.First();\n                UnitQuantities = new[]\n                {\n                    Tuple.Create(position.Symbol, position.UnitQuantity)\n                };\n            }\n            else\n            {\n                // these have to be sorted for determinism\n                UnitQuantities = positions.OrderBy(x => x.Symbol).Select(p => Tuple.Create(p.Symbol, p.UnitQuantity)).ToList();\n            }\n            IsDefaultGroup = UnitQuantities.Count == 1 && BuyingPowerModel.GetType() == typeof(SecurityPositionGroupBuyingPowerModel);\n        }\n\n        /// <summary>\n        /// Creates a new array of empty positions with unit quantities according to this key\n        /// </summary>\n        public IPosition[] CreateEmptyPositions()\n        {\n            var positions = new IPosition[UnitQuantities.Count];\n            for (var i = 0; i < UnitQuantities.Count; i++)\n            {\n                var unitQuantity = UnitQuantities[i];\n                positions[i] = new Position(unitQuantity.Item1, 0m, unitQuantity.Item2);\n            }\n            return positions;\n        }\n\n        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        /// <returns>true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.</returns>\n        public bool Equals(PositionGroupKey other)\n        {\n            if (ReferenceEquals(null, other))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, other))\n            {\n                return true;\n            }\n\n            return BuyingPowerModel.Equals(other.BuyingPowerModel)\n                && UnitQuantities.ListEquals(other.UnitQuantities);\n        }\n\n        /// <summary>Determines whether the specified object is equal to the current object.</summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>true if the specified object  is equal to the current object; otherwise, false.</returns>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return false;\n            }\n\n            if (ReferenceEquals(this, obj))\n            {\n                return true;\n            }\n\n            return obj is PositionGroupKey && Equals((PositionGroupKey) obj);\n        }\n\n        /// <summary>Serves as the default hash function. </summary>\n        /// <returns>A hash code for the current object.</returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (BuyingPowerModel.GetHashCode() * 397) ^ UnitQuantities.GetListHashCode();\n            }\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        public override string ToString()\n        {\n            return $\"{string.Join(\"|\", UnitQuantities.Select(x => $\"{x.Item1}:{x.Item2.Normalize()}\"))}\";\n        }\n\n        /// <summary>\n        /// Equals operator\n        /// </summary>\n        public static bool operator ==(PositionGroupKey left, PositionGroupKey right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Not equals operator\n        /// </summary>\n        public static bool operator !=(PositionGroupKey left, PositionGroupKey right)\n        {\n            return !Equals(left, right);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/PositionGroupMaintenanceMarginParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines parameters for <see cref=\"IPositionGroupBuyingPowerModel.GetMaintenanceMargin\"/>\n    /// </summary>\n    public class PositionGroupMaintenanceMarginParameters\n    {\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Gets the position group\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PositionGroupMaintenanceMarginParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        public PositionGroupMaintenanceMarginParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/ReservedBuyingPowerForPositionGroup.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the result for <see cref=\"IBuyingPowerModel.GetReservedBuyingPowerForPosition\"/>\n    /// </summary>\n    public class ReservedBuyingPowerForPositionGroup\n    {\n        /// <summary>\n        /// Gets the reserved buying power\n        /// </summary>\n        public decimal AbsoluteUsedBuyingPower { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerForPosition\"/> class\n        /// </summary>\n        /// <param name=\"reservedBuyingPowerForPosition\">The reserved buying power for the security's holdings</param>\n        public ReservedBuyingPowerForPositionGroup(decimal reservedBuyingPowerForPosition)\n        {\n            AbsoluteUsedBuyingPower = reservedBuyingPowerForPosition;\n        }\n\n        /// <summary>\n        /// Implicit operator to <see cref=\"decimal\"/> to remove noise\n        /// </summary>\n        public static implicit operator decimal(ReservedBuyingPowerForPositionGroup reservedBuyingPower)\n        {\n            return reservedBuyingPower.AbsoluteUsedBuyingPower;\n        }\n\n        /// <summary>\n        /// Implicit operator to <see cref=\"decimal\"/> to remove noise\n        /// </summary>\n        public static implicit operator ReservedBuyingPowerForPositionGroup(decimal reservedBuyingPower)\n        {\n            return new ReservedBuyingPowerForPositionGroup(reservedBuyingPower);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/ReservedBuyingPowerForPositionGroupParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.GetReservedBuyingPowerForPosition\"/>\n    /// </summary>\n    public class ReservedBuyingPowerForPositionGroupParameters\n    {\n        /// <summary>\n        /// Gets the <see cref=\"IPositionGroup\"/>\n        /// </summary>\n        public IPositionGroup PositionGroup { get; }\n\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerForPositionGroupParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"positionGroup\">The position group</param>\n        public ReservedBuyingPowerForPositionGroupParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup positionGroup\n            )\n        {\n            Portfolio = portfolio;\n            PositionGroup = positionGroup;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/ReservedBuyingPowerImpact.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Specifies the impact on buying power from changing security holdings that affects current <see cref=\"IPositionGroup\"/>,\n    /// including the current reserved buying power, without the change, and a contemplate reserved buying power, which takes\n    /// into account a contemplated change to the algorithm's positions that impacts current position groups.\n    /// </summary>\n    public class ReservedBuyingPowerImpact\n    {\n        /// <summary>\n        /// Gets the current reserved buying power for the impacted groups\n        /// </summary>\n        public decimal Current { get; }\n\n        /// <summary>\n        /// Gets the reserved buying power for groups resolved after applying a contemplated change to the impacted groups\n        /// </summary>\n        public decimal Contemplated { get; }\n\n        /// <summary>\n        /// Gets the change in reserved buying power, <see cref=\"Current\"/> minus <see cref=\"Contemplated\"/>\n        /// </summary>\n        public decimal Delta { get; }\n\n        /// <summary>\n        /// Gets the impacted groups used as the basis for these reserved buying power numbers\n        /// </summary>\n        public IReadOnlyCollection<IPositionGroup> ImpactedGroups { get; }\n\n        /// <summary>\n        /// Gets the position changes being contemplated\n        /// </summary>\n        public IReadOnlyCollection<IPosition> ContemplatedChanges { get; }\n\n        /// <summary>\n        /// Gets the newly resolved groups resulting from applying the contemplated changes to the impacted groups\n        /// </summary>\n        public IReadOnlyCollection<IPositionGroup> ContemplatedGroups { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerImpact\"/> class\n        /// </summary>\n        /// <param name=\"current\">The current reserved buying power for impacted groups</param>\n        /// <param name=\"contemplated\">The reserved buying power for impacted groups after applying the contemplated changes</param>\n        /// <param name=\"impactedGroups\">The groups impacted by the contemplated changes</param>\n        /// <param name=\"contemplatedChanges\">The position changes being contemplated</param>\n        /// <param name=\"contemplatedGroups\">The groups resulting from applying the contemplated changes</param>\n        public ReservedBuyingPowerImpact(\n            decimal current,\n            decimal contemplated,\n            IReadOnlyCollection<IPositionGroup> impactedGroups,\n            IReadOnlyCollection<IPosition> contemplatedChanges,\n            IReadOnlyCollection<IPositionGroup> contemplatedGroups\n            )\n        {\n            Current = current;\n            Contemplated = contemplated;\n            Delta = Contemplated - Current;\n            ImpactedGroups = impactedGroups;\n            ContemplatedGroups = contemplatedGroups;\n            ContemplatedChanges = contemplatedChanges;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/ReservedBuyingPowerImpactParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Parameters for the <see cref=\"IPositionGroupBuyingPowerModel.GetReservedBuyingPowerImpact\"/>\n    /// </summary>\n    public class ReservedBuyingPowerImpactParameters\n    {\n        /// <summary>\n        /// Gets the position changes being contemplated\n        /// </summary>\n        public IPositionGroup ContemplatedChanges { get; }\n\n        /// <summary>\n        /// Gets the algorithm's portfolio manager\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; }\n\n        /// <summary>\n        /// The orders associated with this request\n        /// </summary>\n        public List<Order> Orders { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerImpactParameters\"/> class\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio manager</param>\n        /// <param name=\"contemplatedChanges\">The position changes being contemplated</param>\n        /// <param name=\"orders\">The orders associated with this request</param>\n        public ReservedBuyingPowerImpactParameters(\n            SecurityPortfolioManager portfolio,\n            IPositionGroup contemplatedChanges,\n            List<Order> orders\n            )\n        {\n            Orders = orders;\n            Portfolio = portfolio;\n            ContemplatedChanges = contemplatedChanges;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPositionGroupBuyingPowerModel\"/> for groups containing exactly one security\n    /// </summary>\n    public class SecurityPositionGroupBuyingPowerModel : PositionGroupBuyingPowerModel\n    {\n        /// <summary>\n        /// Gets the margin currently allocated to the specified holding\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security</param>\n        /// <returns>The maintenance margin required for the </returns>\n        public override MaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters)\n        {\n            // SecurityPositionGroupBuyingPowerModel models buying power the same as non-grouped, so we can simply sum up\n            // the reserved buying power via the security's model. We should really only ever get a single position here,\n            // but it's not incorrect to ask the model for what the reserved buying power would be using default modeling\n            var buyingPower = 0m;\n            foreach (var position in parameters.PositionGroup)\n            {\n                var security = parameters.Portfolio.Securities[position.Symbol];\n                var result = security.BuyingPowerModel.GetMaintenanceMargin(\n                    MaintenanceMarginParameters.ForQuantityAtCurrentPrice(security, position.Quantity)\n                );\n\n                buyingPower += result;\n            }\n\n            return buyingPower;\n        }\n\n        /// <summary>\n        /// The margin that must be held in order to increase the position by the provided quantity\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the security and quantity</param>\n        public override InitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters)\n        {\n            var initialMarginRequirement = 0m;\n            foreach (var position in parameters.PositionGroup)\n            {\n                var security = parameters.Portfolio.Securities[position.Symbol];\n                initialMarginRequirement += security.BuyingPowerModel.GetInitialMarginRequirement(\n                    security, position.Quantity\n                );\n            }\n\n            return initialMarginRequirement;\n        }\n\n        /// <summary>\n        /// Gets the total margin required to execute the specified order in units of the account currency including fees\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n        /// <returns>The total margin in terms of the currency quoted in the order</returns>\n        public override InitialMargin GetInitialMarginRequiredForOrder(\n            PositionGroupInitialMarginForOrderParameters parameters\n            )\n        {\n            var initialMarginRequirement = 0m;\n            foreach (var position in parameters.PositionGroup)\n            {\n                // TODO : Support combo order by pull symbol-specific order\n                var security = parameters.Portfolio.Securities[position.Symbol];\n                initialMarginRequirement += security.BuyingPowerModel.GetInitialMarginRequiredForOrder(\n                    new InitialMarginRequiredForOrderParameters(parameters.Portfolio.CashBook, security, parameters.Order)\n                );\n            }\n\n            return initialMarginRequirement;\n        }\n\n        /// <summary>\n        /// Get the maximum position group order quantity to obtain a position with a given buying power\n        /// percentage. Will not take into account free buying power.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the target\n        ///     signed buying power percentage</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        public override GetMaximumLotsResult GetMaximumLotsForTargetBuyingPower(\n            GetMaximumLotsForTargetBuyingPowerParameters parameters\n            )\n        {\n            if (parameters.PositionGroup.Count != 1)\n            {\n                return parameters.Error(\n                    $\"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position.\"\n                );\n            }\n\n            var position = parameters.PositionGroup.Single();\n            var security = parameters.Portfolio.Securities[position.Symbol];\n            var result = security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(\n                parameters.Portfolio, security, parameters.TargetBuyingPower, parameters.MinimumOrderMarginPortfolioPercentage\n            );\n\n            var quantity = result.Quantity / security.SymbolProperties.LotSize;\n            return new GetMaximumLotsResult(quantity, result.Reason, result.IsError);\n        }\n\n        /// <summary>\n        /// Get the maximum market position group order quantity to obtain a delta in the buying power used by a position group.\n        /// The deltas sign defines the position side to apply it to, positive long, negative short.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the delta buying power</param>\n        /// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n        /// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\n        public override GetMaximumLotsResult GetMaximumLotsForDeltaBuyingPower(\n            GetMaximumLotsForDeltaBuyingPowerParameters parameters\n            )\n        {\n            if (parameters.PositionGroup.Count != 1)\n            {\n                return parameters.Error(\n                    $\"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position.\"\n                );\n            }\n\n            var position = parameters.PositionGroup.Single();\n            var security = parameters.Portfolio.Securities[position.Symbol];\n            var result = security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(\n                new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(\n                    parameters.Portfolio, security, parameters.DeltaBuyingPower, parameters.MinimumOrderMarginPortfolioPercentage\n                )\n            );\n\n            var quantity = result.Quantity / security.SymbolProperties.LotSize;\n            return new GetMaximumLotsResult(quantity, result.Reason, result.IsError);\n        }\n\n        /// <summary>\n        /// Check if there is sufficient buying power for the position group to execute this order.\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the portfolio, the position group and the order</param>\n        /// <returns>Returns buying power information for an order against a position group</returns>\n        public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n            )\n        {\n            if (parameters.PositionGroup.Count != 1)\n            {\n                return parameters.Error(\n                    $\"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position.\"\n                );\n            }\n\n            var position = parameters.PositionGroup.Single();\n            var security = parameters.Portfolio.Securities[position.Symbol];\n            return security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                parameters.Portfolio, security, parameters.Orders.Single()\n            );\n        }\n\n        /// <summary>\n        /// Additionally check initial margin requirements if the algorithm only has default position groups\n        /// </summary>\n        protected override HasSufficientBuyingPowerForOrderResult PassesPositionGroupSpecificBuyingPowerForOrderChecks(\n            HasSufficientPositionGroupBuyingPowerForOrderParameters parameters,\n            decimal availableBuyingPower\n            )\n        {\n            // only check initial margin requirements when the algorithm is only using default position groups\n            if (!parameters.Portfolio.Positions.IsOnlyDefaultGroups)\n            {\n                return null;\n            }\n\n            var symbol = parameters.PositionGroup.Single().Symbol;\n            var security = parameters.Portfolio.Securities[symbol];\n            return security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                parameters.Portfolio, security, parameters.Orders.Single()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/SecurityPositionGroupModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Responsible for managing the resolution of position groups for an algorithm\n    /// </summary>\n    public class SecurityPositionGroupModel : ExtendedDictionary<PositionGroupKey, IPositionGroup>\n    {\n        /// <summary>\n        /// Gets an implementation of <see cref=\"SecurityPositionGroupModel\"/> that will not group multiple securities\n        /// </summary>\n        public static readonly SecurityPositionGroupModel Null = new NullSecurityPositionGroupModel();\n\n        private bool _requiresGroupResolution;\n\n        private SecurityManager _securities;\n        private PositionGroupCollection _groups;\n        private IPositionGroupResolver _resolver;\n\n        /// <summary>\n        /// Get's the single security position group buying power model to use\n        /// </summary>\n        protected virtual IPositionGroupBuyingPowerModel PositionGroupBuyingPowerModel { get; } = new SecurityPositionGroupBuyingPowerModel();\n\n        /// <summary>\n        /// Gets the set of currently resolved position groups\n        /// </summary>\n        public PositionGroupCollection Groups\n        {\n            get\n            {\n                ResolvePositionGroups();\n                return _groups;\n            }\n            private set\n            {\n                _groups = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets whether or not the algorithm is using only default position groups\n        /// </summary>\n        public bool IsOnlyDefaultGroups => Groups.IsOnlyDefaultGroups;\n\n        /// <summary>\n        /// Gets the number of position groups in this collection\n        /// </summary>\n        public override int Count => Groups.Count;\n\n        /// <summary>\n        /// Gets all the available position group keys\n        /// </summary>\n        protected override IEnumerable<PositionGroupKey> GetKeys => Groups.Keys;\n\n        /// <summary>\n        /// Gets all the available position groups\n        /// </summary>\n        protected override IEnumerable<IPositionGroup> GetValues => Groups.Values;\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<PositionGroupKey, IPositionGroup>> GetItems() => Groups.GetGroups();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityPositionGroupModel\"/> class\n        /// </summary>\n        /// <param name=\"securities\">The algorithm's security manager</param>\n        public virtual void Initialize(SecurityManager securities)\n        {\n            _securities = securities;\n            Groups = PositionGroupCollection.Empty;\n            _resolver = GetPositionGroupResolver();\n\n            foreach (var security in _securities.Values)\n            {\n                // if any security already present let's wire the holdings change event\n                security.Holdings.QuantityChanged += HoldingsOnQuantityChanged;\n            }\n\n            // we must be notified each time our holdings change, so each time a security is added, we\n            // want to bind to its SecurityHolding.QuantityChanged event so we can trigger the resolver\n\n            securities.CollectionChanged += (sender, args) =>\n            {\n                var items = args.NewItems ?? new List<object>();\n                if (args.OldItems != null)\n                {\n                    foreach (var item in args.OldItems)\n                    {\n                        items.Add(item);\n                    }\n                }\n\n                foreach (Security security in items)\n                {\n                    if (args.Action == NotifyCollectionChangedAction.Add)\n                    {\n                        security.Holdings.QuantityChanged += HoldingsOnQuantityChanged;\n                        if (security.Invested)\n                        {\n                            // if this security has holdings then we'll need to resolve position groups\n                            _requiresGroupResolution = true;\n                        }\n                    }\n                    else if (args.Action == NotifyCollectionChangedAction.Remove)\n                    {\n                        security.Holdings.QuantityChanged -= HoldingsOnQuantityChanged;\n                        if (security.Invested)\n                        {\n                            // only trigger group resolution if we had holdings in the removed security\n                            _requiresGroupResolution = true;\n                        }\n                    }\n                }\n            };\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IPositionGroup\"/> matching the specified <paramref name=\"key\"/>. If one is not found,\n        /// then a new empty position group is returned.\n        /// </summary>\n        public override IPositionGroup this[PositionGroupKey key]\n        {\n            get => Groups[key];\n            set => throw new NotImplementedException(\"Read-only collection. Cannot set value.\");\n        }\n\n        /// <summary>\n        /// Creates a position group for the specified order, pulling\n        /// </summary>\n        /// <param name=\"orders\">The order</param>\n        /// <param name=\"group\">The resulting position group</param>\n        /// <returns>A new position group matching the provided order</returns>\n        public bool TryCreatePositionGroup(List<Order> orders, out IPositionGroup group)\n        {\n            var newPositions = orders.Select(order => order.CreatePositions(_securities)).SelectMany(x => x).ToList();\n\n            // We send new and current positions to try resolve any strategy being executed by multiple orders\n            // else the PositionGroup we will get out here will just be the default in those cases\n            if (!_resolver.TryGroup(newPositions, Groups, out group))\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Resolves position groups using the specified collection of positions\n        /// </summary>\n        /// <param name=\"positions\">The positions to be grouped</param>\n        /// <returns>A collection of position groups containing all of the provided positions</returns>\n        public PositionGroupCollection ResolvePositionGroups(PositionCollection positions)\n        {\n            return _resolver.Resolve(positions);\n        }\n\n        /// <summary>\n        /// Determines which position groups could be impacted by changes in the specified positions\n        /// </summary>\n        /// <param name=\"positions\">The positions to be changed</param>\n        /// <returns>All position groups that need to be re-evaluated due to changes in the positions</returns>\n        public IEnumerable<IPositionGroup> GetImpactedGroups(IReadOnlyCollection<IPosition> positions)\n        {\n            return _resolver.GetImpactedGroups(Groups, positions);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"PositionGroupKey\"/> for the security's default position group\n        /// </summary>\n        public PositionGroupKey CreateDefaultKey(Security security)\n        {\n            return new PositionGroupKey(PositionGroupBuyingPowerModel, security);\n        }\n\n        /// <summary>\n        /// Gets or creates the default position group for the specified <paramref name=\"security\"/>\n        /// </summary>\n        /// <remarks>\n        /// TODO: position group used here is the default, is this what callers want?\n        /// </remarks>\n        public IPositionGroup GetOrCreateDefaultGroup(Security security)\n        {\n            var key = CreateDefaultKey(security);\n            return Groups[key];\n        }\n\n        /// <summary>\n        /// Get the position group resolver instance to use\n        /// </summary>\n        /// <returns>The position group resolver instance</returns>\n        protected virtual IPositionGroupResolver GetPositionGroupResolver()\n        {\n            return new CompositePositionGroupResolver(new OptionStrategyPositionGroupResolver(_securities), new SecurityPositionGroupResolver(PositionGroupBuyingPowerModel));\n        }\n\n        private void HoldingsOnQuantityChanged(object sender, SecurityHoldingQuantityChangedEventArgs e)\n        {\n            _requiresGroupResolution = true;\n        }\n\n        /// <summary>\n        /// Resolves the algorithm's position groups from all of its holdings\n        /// </summary>\n        private void ResolvePositionGroups()\n        {\n            if (_requiresGroupResolution)\n            {\n                _requiresGroupResolution = false;\n                // TODO : Replace w/ special IPosition impl to always equal security.Quantity and we'll\n                // use them explicitly for resolution collection so we don't do this each time\n                var investedPositions = _securities.Where(kvp => kvp.Value.Invested).Select(kvp => (IPosition)new Position(kvp.Value));\n                var positionsCollection = new PositionCollection(investedPositions);\n                Groups = ResolvePositionGroups(positionsCollection);\n            }\n        }\n\n        /// <summary>\n        /// Tries to get the position group matching the specified key\n        /// </summary>\n        /// <param name=\"key\">The key to search for</param>\n        /// <param name=\"value\">The position group matching the specified key</param>\n        /// <returns>True if a group with the specified key was found, false otherwise</returns>\n        public override bool TryGetValue(PositionGroupKey key, out IPositionGroup value)\n        {\n            return Groups.TryGetGroup(key, out value);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/SecurityPositionGroupResolver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities.Positions\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IPositionGroupResolver\"/> that places all positions into a default group of one security.\n    /// </summary>\n    public class SecurityPositionGroupResolver : IPositionGroupResolver\n    {\n        private readonly IPositionGroupBuyingPowerModel _buyingPowerModel;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityPositionGroupResolver\"/> class\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">The buying power model to use for created groups</param>\n        public SecurityPositionGroupResolver(IPositionGroupBuyingPowerModel buyingPowerModel)\n        {\n            _buyingPowerModel = buyingPowerModel;\n        }\n\n        /// <summary>\n        /// Attempts to group the specified positions into a new <see cref=\"IPositionGroup\"/> using an\n        /// appropriate <see cref=\"IPositionGroupBuyingPowerModel\"/> for position groups created via this\n        /// resolver.\n        /// </summary>\n        /// <param name=\"newPositions\">The positions to be grouped</param>\n        /// <param name=\"currentPositions\">The currently grouped positions</param>\n        /// <param name=\"group\">The grouped positions when this resolver is able to, otherwise null</param>\n        /// <returns>True if this resolver can group the specified positions, otherwise false</returns>\n        public bool TryGroup(IReadOnlyCollection<IPosition> newPositions, PositionGroupCollection currentPositions, out IPositionGroup group)\n        {\n            // we can only create default groupings containing a single security\n            if (newPositions.Count != 1)\n            {\n                group = null;\n                return false;\n            }\n\n            var key = new PositionGroupKey(_buyingPowerModel, newPositions);\n            var position = newPositions.First();\n            group = new PositionGroup(key, position.GetGroupQuantity(), newPositions.ToDictionary(p => p.Symbol));\n            return true;\n        }\n\n        /// <summary>\n        /// Resolves the position groups that exist within the specified collection of positions.\n        /// </summary>\n        /// <param name=\"positions\">The collection of positions</param>\n        /// <returns>An enumerable of position groups</returns>\n        public PositionGroupCollection Resolve(PositionCollection positions)\n        {\n            var result = new PositionGroupCollection(positions\n                .Select(position => new PositionGroup(_buyingPowerModel, position.GetGroupQuantity(), position)).ToList()\n            );\n\n            positions.Clear();\n            return result;\n        }\n\n        /// <summary>\n        /// Determines the position groups that would be evaluated for grouping of the specified\n        /// positions were passed into the <see cref=\"IPositionGroupResolver.Resolve\"/> method.\n        /// </summary>\n        /// <remarks>\n        /// This function allows us to determine a set of impacted groups and run the resolver on just\n        /// those groups in order to support what-if analysis\n        /// </remarks>\n        /// <param name=\"groups\">The existing position groups</param>\n        /// <param name=\"positions\">The positions being changed</param>\n        /// <returns>An enumerable containing the position groups that could be impacted by the specified position changes</returns>\n        public IEnumerable<IPositionGroup> GetImpactedGroups(\n            PositionGroupCollection groups,\n            IReadOnlyCollection<IPosition> positions\n            )\n        {\n            var seen = new HashSet<PositionGroupKey>();\n            foreach (var position in positions)\n            {\n                IReadOnlyCollection<IPositionGroup> groupsForSymbol;\n                if (!groups.TryGetGroups(position.Symbol, out groupsForSymbol))\n                {\n                    continue;\n                }\n\n                foreach (var group in groupsForSymbol)\n                {\n                    if (seen.Add(group.Key))\n                    {\n                        yield return group;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Positions/readme.md",
    "content": "# Position Groups\n\n## Motivation\n\nThe motivation behind the position groups feature is to enable algorithms to submit an order for a logical grouping of securities in a single action. In some cases, the margin required for the group is far less than the sum of the margin required for each piece individually. This happens when the grouping provides some sort of hedge, thereby reducing the overall risk of the position, and in some cases, can be a completely market neutral position. A simple example is a covered call strategy, which nominally consists of 100 shares of the underlying equity and short 1 option contract. Since the short contract position is _covered_ by the account holding the underlying, brokerages reduce the margin requirements. The end goal is to enable LEAN to not only accurately model such groupings, but also submit a multi-leg order so the brokerage can process it as a single order. There are some cases where submitting the legs individually is not possible due to margin requirements, but grouping them together allows the order to be successfully processed.\n\n## Design\n\nThe position groups feature introduces some new abstractions and key concepts that will be covered in this section.\n\n### IPosition\n\nA position defines _some_ quantity of a security. It may be all of the security's holdings or only a fraction of the holdings. Each position defines a few key properties listed below:\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/IPosition.cs\n\n/// <summary>\n/// The symbol\n/// </summary>\nSymbol Symbol { get; }\n\n/// <summary>\n/// The quantity\n/// </summary>\ndecimal Quantity { get; }\n\n/// <summary>\n/// The unit quantity. The unit quantities of a group define the group. For example, a covered\n/// call has 100 units of stock and -1 units of call contracts.\n/// </summary>\ndecimal UnitQuantity { get; }\n\n```\n\nThe `Symbol` property is everything you expect it to be, uniquely identifying which security this position is in and the `Quantity` is likewise uninteresting, denoting the directional (position for long negative for short) quantity of the position. The `UnitQuantity` defines the smallest allowable quantity increment according to the definition of the group the position belongs to. For the default group, `SecurityPositionGroup`, the `UnitQuantity` is equal to the security's lot size (`SymbolProperties.LotSize`). An equity position in a group with option contracts will have a `UnitQuantity` equal to the contract's multiplier (`SymbolProperties.ContractMultiplier`). There's an important relationship between the `Quantity` and the `UnitQuantity` which is that `Quantity/UnitQuantity` **must** always yield a whole number and denotes the number of lots. Using the covered call example from earlier, we may have 5 covered calls. Each contract will have a `UnitQuantity` equal to -1 and the underlying equity will have a `UnitQuantity` normally equal to 100, so 5 covered calls yields -5 contracts and 500 shares in the underlying.\n\n### PositionGroupKey\n\nBefore diving into the `IPositionGroup` abstraction, it's important to briefly mention the `PositionGroupKey`. This class uniquely defines a position group within the algorithm and is a deterministic identifier constructed from the contained positions' `Symbol` and `UnitQuantity` properties coupled with an `IPositionGroupBuyingPowerModel`. We'll discuss modelling in a later section, but for now it's enough to understand that if two position group contain the same exact position **but** are modeled differently, then LEAN will treat them as different positions. The `UnitQuantities` list is, under the covers, an `ImmutableSortedSet` which guarantees determinism. In other words, `-1 GOOG CALL; +100 GOOG` is the same as `+100 GOOG; -1 GOOG CALL`. The `PositionGroupKey` can be used to index into collection types containing position groups as well as into the `PositionManager` (to be discussed later). This class also offers a variety of convenience functions for creating empty and unit positions and groups, which is pretty cool as it implies that the `PositionGroupKey` contains sufficient information to create an entire `IPositionGroup`. It's essentially a template for a particular group type with an exact set of symbol. More on group _types_ later.\n\n``` csharp\n\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/PositionGroupKey.cs\n\n/// <summary>\n/// Gets whether or not this key defines a default group\n/// </summary>\npublic bool IsDefaultGroup { get; }\n\n/// <summary>\n/// Gets the <see cref=\"IPositionGroupBuyingPowerModel\"/> being used by the group\n/// </summary>\npublic IPositionGroupBuyingPowerModel BuyingPowerModel { get; }\n\n/// <summary>\n/// Gets the unit quantities defining the ratio between position quantities in the group\n/// </summary>\npublic IReadOnlyList<Tuple<Symbol, decimal>> UnitQuantities { get; }\n\n```\n\n\n### IPositionGroup\n\nA position group is unsurprisingly a grouping of `IPosition` instances. More importantly though, a position group contains the definition of the group, which includes the ratios between the `UnitQuantity` of its constituent positions and the `IPositionGroupBuyingPowerModel`. These definitional pieces are all contained within the `PositionGroupKey` discussed in the previous section. `IPositionGroup` implements the `IReadOnlyCollection<IPosition>` interface, which allows it to be used as an `IEnumerable<IPosition>`. The `Key` property exposes the deterministic identifier and the `Quantity` property exposes how many _units_ of the group there are. Recalling the earlier discussion in the `IPosition` section, where we showed that `Quantity/UnitQuantity` yields the number of lots; the number of lots is exactly equal to, by definition, the position group's quantity. Further, **every** position within the group **must** have the same exact number of lots, and if not, then something has gone terribly wrong! Position groups have definitions that define the ratios between the positions. We keep using the covered call example, but they can be far more complicated. Due to its simplicity, we'll continue with the covered call example, and more specifically, consider a covered call position group with a `Quantity` equal to 5. This means that the ratio of the option contract position's `Quantity/UnitQuantity` equals 5 **and** the ratio of the equity position's `Quantity/UnitQuantity` equal 5. As mentioned earlier, modeling is an important part of the position group's definition, and as such, `IPositionGroup` directly exposes its own model via the `BuyingPowerModel` property, and in this way, `IPositionGroup` is analogous to a `Security` object, in that it's the smallest unit of modelling and trading within LEAN with respect to the position group subsystems. There are some extension methods provided that we'll touch on later and only one method is exposed directly by the interface: `TryGetPosition`, which is intended to behave identically to `IDictionary<K, V>.TryGetValue`, returning `true` and a valid `position` instance _or_ `false` and `default(IPosition)` when the group doesn't contain a position with the provided symbol.\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/IPositionGroup.cs\n\n/// <summary>\n/// Gets the key identifying this group\n/// </summary>\nPositionGroupKey Key { get; }\n\n/// <summary>\n/// Gets the whole number of units in this position group\n/// </summary>\ndecimal Quantity { get; }\n\n/// <summary>\n/// Gets the positions in this group\n/// </summary>\nIEnumerable<IPosition> Positions { get; }\n\n/// <summary>\n/// Gets the buying power model defining how margin works in this group\n/// </summary>\nIPositionGroupBuyingPowerModel BuyingPowerModel { get; }\n\n/// <summary>\n/// Attempts to retrieve the position with the specified symbol\n/// </summary>\n/// <param name=\"symbol\">The symbol</param>\n/// <param name=\"position\">The position, if found</param>\n/// <returns>True if the position was found, otherwise false</returns>\nbool TryGetPosition(Symbol symbol, out IPosition position);\n\n```\n\n### IPositionGroupResolver\n\nThe position group resolver is responsible for inspecting an algorithm's security holdings and creating a set of groups that minimizes the margin requirement of the entire portfolio. Some brokerages do this automatically for you, such as IB. The default resolver used to match ungrouped security holdings into the default `SecurityPositionGroup` is the `SecurityPositionGroupResolver`. Each _type_ of group (default/options/futures) will have its own resolver. The options resolver (not yet implemented), will integrate the `OptionStrategyMatcher`. The `OptionStrategyMatcher` looks at a set of security holdings with the same underlying, for example, GOOG and all GOOG option contracts, and attempts to arrange these holdings into groups to minimize the total margin required. When adding futures we'll need to add a `FutureStrategyMatcher`. The matchers work by looking at a set of definitions that define the specific ways in which securities can be grouped, such as covered call, but also more complex groupings such as the `Straddle` and `Strangle`. You can see the complete set of option strategy definitions in the `OptionStrategyDefinitions` class. The `OptionStrategyMatcher` loads all of these definitions and matches them to the algorithm's holdings. Once integrated into the yet-to-be-implemented `OptionStrategyPositionGroupResolver`, the results of the match operation will need to be projected into position group instances. Every time the algorithm's holdings change we need to evaluate at least a subset of the holdings to look for unexpected broken groups and determine whether or not breaking the group pushes the margin requirement up too high. It's entirely possible that the algorithm might **not** be able to sell that single share of GOOG from our earlier example because doing so breaks the covered call group and has the potential to increase the margin requirement beyond the maximum allowed.\n\nIn addition to performing matching functions, it also serves as a descriptor for how groups are constructed and therefore, the impacts of breaking a particular group. Since running all resolvers on the entire portfolio is an expensive operation, when holdings change its beneficial to only consider groups impacted by the change. Since each _type_ of group has different rules regarding how the positions relate to one another, the resolver exposes the `GetImpactedGroups` function. The first argument is usually the entire set of groups being maintained by the `PositionManager` and the second argument represents the changes being contemplated. I say contemplated because this is part of the 'what if' analysis that is done _before_ LEAN validates an order as being executable/submittable. We ask the resolver which groups are impacted by the requested change, for example -1 GOOG. In this example, the response would include all position groups that the equity GOOG is a member of in addition to all position groups that contain a GOOG option contract. We can then apply our changed positions to this reduced set of position groups and resolve the new position groups. We can then calculate the margin requirements on this new set of position groups and verify that its within bounds. If so, the order may proceed, if not, the order is flagged as insufficient buying power.\n\nThis idea of needing to run 'what if' analysis might take a minute before you're convinced that it's absolutely required, but once you understand how dynamic groups are and likewise how easily they can be broken and particularly how much margin is _saved_ through grouping (sometimes over 75%), it quickly becomes clear that breaking a group can have severe implications on the available margin in the algorithm's portfolio. Despite much effort and ample trying, we were unable to come up with a more performant mechanism and at this point are extremely confident that running 'what if' analysis is actually the only way to confidently and consistently get the correct answer every time. This is what led to the introduction of the `GetImpactGroups`, which saves a lot of time in algorithms with hundreds of security holdings and potentially hundreds of non-default groups. Consider being long 100 securities and writing a covered call on each. With `GetImpactedGroups`, if you sell one of the underlying shares, we'll only evaluate groups related to that equity and ignore the other 99 equity/option related groups.\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/IPositionGroupResolver.cs\n\n/// <summary>\n/// Attempts to group the specified positions into a new <see cref=\"IPositionGroup\"/> using an\n/// appropriate <see cref=\"IPositionGroupBuyingPowerModel\"/> for position groups created via this\n/// resolver.\n/// </summary>\n/// <param name=\"positions\">The positions to be grouped</param>\n/// <param name=\"group\">The grouped positions when this resolver is able to, otherwise null</param>\n/// <returns>True if this resolver can group the specified positions, otherwise false</returns>\nbool TryGroup(IReadOnlyCollection<IPosition> positions, out IPositionGroup group);\n\n/// <summary>\n/// Resolves the position groups that exist within the specified collection of positions.\n/// </summary>\n/// <param name=\"positions\">The collection of positions</param>\n/// <returns>An enumerable of position groups</returns>\nPositionGroupCollection Resolve(PositionCollection positions);\n\n/// <summary>\n/// Determines the position groups that would be evaluated for grouping of the specified\n/// positions were passed into the <see cref=\"Resolve\"/> method.\n/// </summary>\n/// <remarks>\n/// This function allows us to determine a set of impacted groups and run the resolver on just\n/// those groups in order to support what-if analysis\n/// </remarks>\n/// <param name=\"groups\">The existing position groups</param>\n/// <param name=\"positions\">The positions being changed</param>\n/// <returns>An enumerable containing the position groups that could be impacted by the specified position changes</returns>\nIEnumerable<IPositionGroup> GetImpactedGroups(\n    PositionGroupCollection groups,\n    IReadOnlyCollection<IPosition> positions\n    );\n\n```\n\n### IPositionGroupBuyingPowerModel\n\nAnother appropriately named abstraction that leaves mystery on the sidelines. This interface aims to be an `IPositionGroup`-centric one-for-one mapping of the `Security`-centric `IBuyingPowerModel`. The only operations that were not ported from the original are the ones focused on getting/setting leverage, which simply doesn't apply to position groups. As you can see from the below excerpt, position groups require their own margin calculations, their own sufficient buying power for order checks and their own functions for determining the maximum quantity for a given delta/target buying power. I won't go into all of the methods as they're identical in purpose as their `IBuyingPower` counterparts, however, there is one _added_ method, and that is the `GetReservedBuyingPowerImpact`. One of the challenges of dealing with position groups is determining how a particular trade will impact the algorithm's groups. Consider our default case of 5 units of GOOG covered call. If we try to sell 1 GOOG share, bringing our total to 499 (500 - 1) shares of GOOG, it will _break_ one of the position group units. This will likely **increase** the total margin requirement of the portfolio. The `GetReservedBuyingPowerImpact` function exists to perform this 'what if' analysis.\n\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/IPositionGroupBuyingPowerModel.cs\n\n/// <summary>\n/// Gets the margin currently allocated to the specified holding\n/// </summary>\n/// <param name=\"parameters\">An object containing the security</param>\n/// <returns>The maintenance margin required for the </returns>\nMaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters);\n\n/// <summary>\n/// The margin that must be held in order to increase the position by the provided quantity\n/// </summary>\n/// <param name=\"parameters\">An object containing the security and quantity</param>\nInitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters);\n\n/// <summary>\n/// Gets the total margin required to execute the specified order in units of the account currency including fees\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n/// <returns>The total margin in terms of the currency quoted in the order</returns>\nInitialMargin GetInitialMarginRequiredForOrder(PositionGroupInitialMarginForOrderParameters parameters);\n\n/// <summary>\n/// Computes the impact on the portfolio's buying power from adding the position group to the portfolio. This is\n/// a 'what if' analysis to determine what the state of the portfolio would be if these changes were applied. The\n/// delta (before - after) is the margin requirement for adding the positions and if the margin used after the changes\n/// are applied is less than the total portfolio value, this indicates sufficient capital.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio and a position group containing the contemplated\n/// changes to the portfolio</param>\n/// <returns>Returns the portfolio's total portfolio value and margin used before and after the position changes are applied</returns>\nReservedBuyingPowerImpact GetReservedBuyingPowerImpact(\n    ReservedBuyingPowerImpactParameters parameters\n    );\n\n/// <summary>\n/// Check if there is sufficient buying power for the position group to execute this order.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the order</param>\n/// <returns>Returns buying power information for an order against a position group</returns>\nHasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n    HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n    );\n\n/// <summary>\n/// Computes the amount of buying power reserved by the provided position group\n/// </summary>\nReservedBuyingPowerForPositionGroup GetReservedBuyingPowerForPositionGroup(\n    ReservedBuyingPowerForPositionGroupParameters parameters\n    );\n\n/// <summary>\n/// Get the maximum position group order quantity to obtain a position with a given buying power\n/// percentage. Will not take into account free buying power.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the target\n///     signed buying power percentage</param>\n/// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\nGetMaximumLotsResult GetMaximumLotsForTargetBuyingPower(\n    GetMaximumLotsForTargetBuyingPowerParameters parameters\n    );\n\n/// <summary>\n/// Get the maximum market position group order quantity to obtain a delta in the buying power used by a position group.\n/// The deltas sign defines the position side to apply it to, positive long, negative short.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the delta buying power</param>\n/// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n/// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\nGetMaximumLotsResult GetMaximumLotsForDeltaBuyingPower(\n    GetMaximumLotsForDeltaBuyingPowerParameters parameters\n    );\n\n/// <summary>\n/// Gets the buying power available for a position group trade\n/// </summary>\n/// <param name=\"parameters\">A parameters object containing the algorithm's portfolio, security, and order direction</param>\n/// <returns>The buying power available for the trade</returns>\nPositionGroupBuyingPower GetPositionGroupBuyingPower(PositionGroupBuyingPowerParameters parameters);\n\n\n```\n\n### PositionGroupBuyingPowerModel\n\nIn the spirit of `BuyingPowerModel`, we've provided a base class for position group specific models to extend, as much of the logic is agnostic to the details of the group thanks to the way the various abstractions have been defined. That being said, when integrating options groups we **will** need to add an `OptionStrategyPositionGroupBuyingPowerModel` which subclasses the default base class `PositionGroupBuyingPowerModel`. The option strategy specific type will need to reference the table provided by Interactive Brokers which describes the margin requirements for each type of option strategy. You can find this table on IB's website [here](https://www.interactivebrokers.com/en/index.php?f=26660). This link, along with research notes and heaps of information outlining the general thought pattern and some of the concerns considered, all accumulated during the initial analysis/investigation phase in the github feature request issue [#4065](https://github.com/QuantConnect/Lean/issues/4065). IB seems to be what the users want, but once that's done I think it makes sense to also implement FINRA models. The takeaway from reading all of the regulations is that FINRA provides a baseline and brokers are free make them more strict (and maybe less strict, but IIRC FINRA set a limit), and indeed brokers can decide to _not_ support the concept of grouping at all. In such cases the broker would charge margin as the simple sum of the constituent parts, ie, no savings from groupings. We'll want to have a mechanism to support this case easily. This can be easily done by configuring the `PositionManager` to only use the `SecurityPositionGroupResolver` (more on that later though).\n\nBack to the `PositionGroupBuyingPowerModel` - you'll notice that these methods make no assumptions as to the type or structure of the position group being evaluated, and as such, uses a lot of 'what if' analysis to make determinations. A particularly interesting bit is the `GetMaximumLotsForTargetBuyingPower` function. This function _should_ be suitable for all subclasses as its phrased in the most general way possible. The `SecurityPositionGroupBuyingPowerModel` _does_ override it for backwards compatibility reasons, particularly because each `IBuyingPowerModel` implementation (I'm looking at you `CashBuyingPowerModel`) implements this functions _slightly_ differently and especially when it comes to how fees are handled. Fees can either be _part_ of the pro-rata operation or fees can be viewed as a fixed cost coming off of the top. It took a while to arrive at a logical reasoning for one or the other, but the `PositionGroupBuyingPowerModel` removes fees off of the top. The reason for this is based on this function's usage, most notably, `QCAlgorithm.SetHoldings`. The purpose of this function is to allocate a particular percentage of the total portfolio value into _something_ (a position group in this case). If the fees were part of the pro-rata allocation then that's like saying we seek a quantity where the **cost** of the order is a particular percentage of total portfolio value, whereas taking the fees off the top is saying that we seek a quantity such that **after** the trade is completed, that position group (or security) will be the requested percentage of the total portfolio value.\n\nSome time was taken to improve the Newton-Rhapson root finding. For some reason all of the `IBuyingPowerModel` implementations of this method have degraded over the years, now requiring two full iterations before returning. This is unnecessary. In a very common case, where fees are directly proportional to the total order value, it all breaks down into a simple linear equation and can by analytically solved exactly _without_ iterating at all (very common in crypto). The time should be taken to refactor the existing `IBuyingPowerModel` implementations by extracting to a single common implementation and parameterizing anything that's special.\n\nAnother function worth mentioning is `HasSufficientBuyingPowerForOrder` which has to perform multiple checks now. First we determine that our free buying power is enough to cover the initial margin requirement, then we provide a mechanism via a virtual method `PassesPositionGroupSpecificBuyingPowerForOrderChecks` for subclasses to inject their own checks and finally we perform the 'what if' analysis by invoking `GetChangeInReservedBuyingPower` and verifying that the change isn't greater than the free buying power. The `SecurityPositionGroupBuyingPowerModel` overrides the `PassesPositionGroupSpecificBuyingPowerForOrderChecks` in order to invoke `security.BuyingPowerModel`.\n\nIt's worth noting here that **ALL** implementations of `IPositionGroupBuyingPowerModel` should provide reasonable/idiomatic implementations of `GetHashCode` and `Equals`. This is because the model types are used in the `PositionGroupKey`, and as such, equality checks are done against it, but we want to treat these models as value types when it comes to equality checking, i.e, verify private fields are equal and the types are equal - even better, let a tool like ReSharper implement them for you :)\n\nAlso worth mentioning here is that **ALL** derived types will have to provide implementations for `GetInitialMarginRequirement`/`GetMaintenanceMargin`/`GetInitialMarginRequiredForOrder`. These functions enable us to implement the tougher functions in the base class and keeps subclasses laser focused on what makes them special, with an aim of preventing and/or reducing copy pasta. An optional override is the `PassesPositionGroupSpecificBuyingPowerForOrderChecks` which the `SecurityPositionGroupBuyingPowerModel` uses to invoke `security.BuyingPowerModel` functions directly.\n\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/PositionGroupBuyingPowerModel.cs\n```\n\n### SecurityPositionGroupBuyingPowerModel\n\nProvides an implementation of `IPositionGroupBuyingPowerModel` that delegates to `security.BuyingPowerModel`. This model is intended to be used with the 'default' group and its aim is to provide 100% backwards compatible behavior. Below are the overriden methods with a _very_ brief comment describing how the delegating to the security's models happens. It's important to note here that `IPositionGroup.Quantity` is, from the security's perspective, a number of lots. In our 5 covered call example, there's 5 lots of (-1 GOOG CALL & 100 GOOG) for a total of -5 GOOG CALL & 500 GOOG shares. This is a position group quantity of 5. There are 5 lots of the GOOG equity and 5 lots of -1 GOOG CALL.\n\n``` csharp\n// See: https://github.com/QuantConnect/Lean/blob/refactor-4065-position-groups/Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs\n\n/// <summary>\n/// Gets the margin currently allocated to the specified holding\n/// </summary>\n/// <param name=\"parameters\">An object containing the security</param>\n/// <returns>The maintenance margin required for the </returns>\npublic override MaintenanceMargin GetMaintenanceMargin(PositionGroupMaintenanceMarginParameters parameters)\n{\n    // simply delegate to security.BuyingPowerModel.GetMaintenanceMargin\n}\n\n/// <summary>\n/// The margin that must be held in order to increase the position by the provided quantity\n/// </summary>\n/// <param name=\"parameters\">An object containing the security and quantity</param>\npublic override InitialMargin GetInitialMarginRequirement(PositionGroupInitialMarginParameters parameters)\n{\n    // simply delegates to security.BuyingPowerModel.GetInitialMarginRequirement\n}\n\n/// <summary>\n/// Gets the total margin required to execute the specified order in units of the account currency including fees\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the security and the order</param>\n/// <returns>The total margin in terms of the currency quoted in the order</returns>\npublic override InitialMargin GetInitialMarginRequiredForOrder(\n    PositionGroupInitialMarginForOrderParameters parameters\n    )\n{\n    // simply delegates to security.BuyingPowerModel.GetInitialMarginRequiredForOrder\n}\n\n/// <summary>\n/// Get the maximum position group order quantity to obtain a position with a given buying power\n/// percentage. Will not take into account free buying power.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the target\n///     signed buying power percentage</param>\n/// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\npublic override GetMaximumLotsResult GetMaximumLotsForTargetBuyingPower(\n    GetMaximumLotsForTargetBuyingPowerParameters parameters\n    )\n{\n    // simply delegates to security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower\n    // and then converts the result which is in number of lots into a quantity using the lot size\n    var quantity = result.Quantity / security.SymbolProperties.LotSize;\n}\n\n/// <summary>\n/// Get the maximum market position group order quantity to obtain a delta in the buying power used by a position group.\n/// The deltas sign defines the position side to apply it to, positive long, negative short.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the delta buying power</param>\n/// <returns>Returns the maximum allowed market order quantity and if zero, also the reason</returns>\n/// <remarks>Used by the margin call model to reduce the position by a delta percent.</remarks>\npublic override GetMaximumLotsResult GetMaximumLotsForDeltaBuyingPower(\n    GetMaximumLotsForDeltaBuyingPowerParameters parameters\n    )\n{\n    // simply delegates to security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower\n    // and converts the maximum quantity into number of lots using the security's lot size\n}\n\n/// <summary>\n/// Check if there is sufficient buying power for the position group to execute this order.\n/// </summary>\n/// <param name=\"parameters\">An object containing the portfolio, the position group and the order</param>\n/// <returns>Returns buying power information for an order against a position group</returns>\npublic override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n    HasSufficientPositionGroupBuyingPowerForOrderParameters parameters\n    )\n{\n    // simply delegates to security.BuyingPowerModel.HasSufficientBuyingPowerForOrder\n}\n\n/// <summary>\n/// Additionally check initial margin requirements if the algorithm only has default position groups\n/// </summary>\nprotected override HasSufficientBuyingPowerForOrderResult PassesPositionGroupSpecificBuyingPowerForOrderChecks(\n    HasSufficientPositionGroupBuyingPowerForOrderParameters parameters,\n    decimal availableBuyingPower\n    )\n{\n    // simply delegates to security.BuyingPowerModel.HasSufficientBuyingPowerForOrder for default groups\n}\n\n```\n\n## LEAN Integration\n\nThe above highlights the main abstractions and key terms used throughout the position groups feature code changes and commit messages. If you don't understand anything written prior to this sentence, stop, and go read it again. The aforementioned concepts are critical to have a firm understanding in before moving forward with how it all integrates into LEAN, and the rest of this document _assumes_ that the reader understands all of the terminology by this point.\n\n### PositionManager\n\nThe `PositionManager` provides a mechanism similar to `SecurityPortfolioManager` to manage positions and position groups. Event handlers are wired up such that after _every_ fill event the `PositionManager` is notified and if required, will invoke the configured `IPositionGroupResolver` to determine the latest and greatest set of groups. Any ungrouped holdings get moved into the default `SecurityPositionGroup` -- the group of last resort. ALL HOLDINGS ARE ALWAYS GROUPED.\n\nThe `CompositePositionGroupResolver` needs to be added to the manager. The idea behind this guy is he would hold a list of resolvers configured by the algorithm, for example, one for options, one for futures and the last one would be the default (resolver of last resort) `SecurityPositionGroupResolver`. There's a WIP branch (`origin/refactor-4065-position-groups.wip`) that has an implementation of the composite resolver as well as having it all wired up properly in the position manager. Feel free to pull that in, minor edits are required. The order in which the resolvers are invoked is obviously important. If the `SecurityPositionGroupResolver` went _firsT_ then everything would be grouped before the other resolvers ran, so obviously he needs to run last. His entire job is to group everything that didn't get grouped. Foot stomping here. The ordering of invocation matters. **GREATLY**\n\nOnce a `CompositePositionGroupResolver` is implemented, should probably start with it just having the single default resolver for simplicity (`SecurityPositionGroupResolver`), make sure all unit/regression tests are passing and that's a clean/solid breakpoint.\n\n### Other Touch Points\n\n`SecurityHolding.QuantityChanged` event was added and the `PositionManager` listens to this. Every time quantities change (fill) we need to know so that we can re-run the resolvers. `PositionManager.ResolveGroups()` is _also_ invoked via `SecurityPortfolioManager.ProcessFill` when it's a partial/completed fill event (quantity changed). In order for all the margin maths to be correct, we must resolve groups immediately. Consider multiple market orders set to synchronous in the same `OnData` -- if we don't run the resolvers then the buying power models won't even know those orders executed because the buying power models' view of the world is through the lense of position groups, so it's incredibly important that **EVERY** time security holdings change we run the position group resolves to ensure consistent state.\n"
  },
  {
    "path": "Common/Securities/ProjectedHoldings.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// DTO for the projected holdings of a security\n    /// </summary>\n    public class ProjectedHoldings\n    {\n        /// <summary>\n        /// The current holdings for the security\n        /// </summary>\n        public decimal HoldingsQuantity { get; set; }\n\n        /// <summary>\n        /// The currently open orders quantity for the security\n        /// </summary>\n        public decimal OpenOrdersQuantity { get; set; }\n\n        /// <summary>\n        /// Gets the projected holdings for the specified security, which is the sum of the current holdings\n        /// plus the sum of the open orders quantity.\n        /// </summary>\n        public decimal ProjectedQuantity => HoldingsQuantity + OpenOrdersQuantity;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ProjectedHoldings\"/> class.\n        /// </summary>\n        /// <param name=\"holdingsQuantity\">The current holdings quantity</param>\n        /// <param name=\"openOrdersQuantity\">The currently open orders quantity for the security</param>\n        public ProjectedHoldings(decimal holdingsQuantity, decimal openOrdersQuantity)\n        {\n            HoldingsQuantity = holdingsQuantity;\n            OpenOrdersQuantity = openOrdersQuantity;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/RegisteredSecurityDataTypesProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRegisteredSecurityDataTypesProvider\"/> that permits the\n    /// consumer to modify the expected types\n    /// </summary>\n    public class RegisteredSecurityDataTypesProvider : IRegisteredSecurityDataTypesProvider\n    {\n        /// <summary>\n        /// Provides a reference to an instance of <see cref=\"IRegisteredSecurityDataTypesProvider\"/> that contains no registered types\n        /// </summary>\n        public static readonly IRegisteredSecurityDataTypesProvider Null = new RegisteredSecurityDataTypesProvider();\n\n        private readonly Dictionary<string, Type> _types = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase);\n\n        /// <summary>\n        /// Registers the specified type w/ the provider\n        /// </summary>\n        /// <returns>True if the type was previously not registered</returns>\n        public bool RegisterType(Type type)\n        {\n            lock (_types)\n            {\n                Type existingType;\n                if (_types.TryGetValue(type.Name, out existingType))\n                {\n                    if (existingType != type)\n                    {\n                        // shouldn't happen but we want to know if it does\n                        throw new InvalidOperationException(\n                            Messages.RegisteredSecurityDataTypesProvider.TwoDifferentTypesDetectedForTheSameTypeName(type, existingType));\n                    }\n                    return true;\n                }\n\n                _types[type.Name] = type;\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Removes the registration for the specified type\n        /// </summary>\n        /// <returns>True if the type was previously registered</returns>\n        public bool UnregisterType(Type type)\n        {\n            lock (_types)\n            {\n                return _types.Remove(type.Name);\n            }\n        }\n\n        /// <summary>\n        /// Gets an enumerable of data types expected to be contained in a <see cref=\"DynamicSecurityData\"/> instance\n        /// </summary>\n        public bool TryGetType(string name, out Type type)\n        {\n            lock (_types)\n            {\n                return _types.TryGetValue(name, out type);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/ReservedBuyingPowerForPosition.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the result for <see cref=\"IBuyingPowerModel.GetReservedBuyingPowerForPosition\"/>\n    /// </summary>\n    public class ReservedBuyingPowerForPosition\n    {\n        /// <summary>\n        /// Gets the reserved buying power\n        /// </summary>\n        public decimal AbsoluteUsedBuyingPower { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerForPosition\"/> class\n        /// </summary>\n        /// <param name=\"reservedBuyingPowerForPosition\">The reserved buying power for the security's holdings</param>\n        public ReservedBuyingPowerForPosition(decimal reservedBuyingPowerForPosition)\n        {\n            AbsoluteUsedBuyingPower = reservedBuyingPowerForPosition;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/ReservedBuyingPowerForPositionParameters.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"IBuyingPowerModel.GetReservedBuyingPowerForPosition\"/>\n    /// </summary>\n    public class ReservedBuyingPowerForPositionParameters\n    {\n        /// <summary>\n        /// Gets the security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReservedBuyingPowerForPositionParameters\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        public ReservedBuyingPowerForPositionParameters(Security security)\n        {\n            Security = security;\n        }\n\n        /// <summary>\n        /// Creates the result using the specified reserved buying power in units of the account currency\n        /// </summary>\n        /// <param name=\"reservedBuyingPower\">The reserved buying power in units of the account currency</param>\n        /// <returns>The reserved buying power</returns>\n        public ReservedBuyingPowerForPosition ResultInAccountCurrency(decimal reservedBuyingPower)\n        {\n            return new ReservedBuyingPowerForPosition(reservedBuyingPower);\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/ScanSettlementModelParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// The settlement model <see cref=\"ISettlementModel.Scan(ScanSettlementModelParameters)\"/> parameters\n    /// </summary>\n    public class ScanSettlementModelParameters\n    {\n        /// <summary>\n        /// The algorithm portfolio instance\n        /// </summary>\n        public SecurityPortfolioManager Portfolio { get; set; }\n\n        /// <summary>\n        /// The associated security type\n        /// </summary>\n        public Security Security { get; set; }\n\n        /// <summary>\n        /// The current Utc time\n        /// </summary>\n        public DateTime UtcTime { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm portfolio</param>\n        /// <param name=\"security\">The associated security type</param>\n        /// <param name=\"timeUtc\">The current utc time</param>\n        public ScanSettlementModelParameters(SecurityPortfolioManager portfolio, Security security, DateTime timeUtc)\n        {\n            Portfolio = portfolio;\n            Security = security;\n            UtcTime = timeUtc;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Security.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Dynamic;\nusing System.Reflection;\nusing System.Globalization;\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Interfaces;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing Python.Runtime;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// A base vehicle properties class for providing a common interface to all assets in QuantConnect.\n    /// </summary>\n    /// <remarks>\n    /// Security object is intended to hold properties of the specific security asset. These properties can include trade start-stop dates,\n    /// price, market hours, resolution of the security, the holdings information for this security and the specific fill model.\n    /// </remarks>\n    public class Security : DynamicObject, ISecurityPrice\n    {\n        private SecurityExchange _exchange;\n        private LocalTimeKeeper _localTimeKeeper;\n\n        /// <summary>\n        /// Collection of SubscriptionDataConfigs for this security.\n        /// Uses concurrent bag to avoid list enumeration threading issues\n        /// </summary>\n        /// <remarks>Just use a list + lock, not concurrent bag, avoid garbage it creates for features we don't need here. See https://github.com/dotnet/runtime/issues/23103</remarks>\n        private readonly HashSet<SubscriptionDataConfig> _subscriptionsBag;\n\n        /// <summary>\n        /// Flag to keep track of initialized securities, to avoid double initialization.\n        /// </summary>\n        internal bool IsInitialized { get; set; }\n\n        /// <summary>\n        /// This securities <see cref=\"IShortableProvider\"/>\n        /// </summary>\n        public IShortableProvider ShortableProvider { get; private set; }\n\n        /// <summary>\n        /// A null security leverage value\n        /// </summary>\n        /// <remarks>This value is used to determine when the\n        /// <see cref=\"SecurityInitializer\"/> leverage is used</remarks>\n        public const decimal NullLeverage = 0;\n\n        /// <summary>\n        /// Gets all the subscriptions for this security\n        /// </summary>\n        public IEnumerable<SubscriptionDataConfig> Subscriptions\n        {\n            get\n            {\n                lock (_subscriptionsBag)\n                {\n                    return _subscriptionsBag.ToList();\n                }\n            }\n        }\n\n        /// <summary>\n        /// <see cref=\"Symbol\"/> for the asset.\n        /// </summary>\n        public Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the Cash object used for converting the quote currency to the account currency\n        /// </summary>\n        public Cash QuoteCurrency\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the symbol properties for this security\n        /// </summary>\n        public SymbolProperties SymbolProperties\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Type of the security.\n        /// </summary>\n        /// <remarks>\n        /// QuantConnect currently only supports Equities and Forex\n        /// </remarks>\n        public SecurityType Type => Symbol.ID.SecurityType;\n\n        /// <summary>\n        /// Resolution of data requested for this security.\n        /// </summary>\n        /// <remarks>Tick, second or minute resolution for QuantConnect assets.</remarks>\n        [Obsolete(\"This property is obsolete. Use the 'SubscriptionDataConfig' exposed by 'SubscriptionManager'\")]\n        public Resolution Resolution { get; private set; }\n\n        /// <summary>\n        /// Indicates the data will use previous bars when there was no trading in this time period. This was a configurable datastream setting set in initialization.\n        /// </summary>\n        [Obsolete(\"This property is obsolete. Use the 'SubscriptionDataConfig' exposed by 'SubscriptionManager'\")]\n        public bool IsFillDataForward { get; private set; }\n\n        /// <summary>\n        /// Indicates the security will continue feeding data after the primary market hours have closed. This was a configurable setting set in initialization.\n        /// </summary>\n        [Obsolete(\"This property is obsolete. Use the 'SubscriptionDataConfig' exposed by 'SubscriptionManager'\")]\n        public bool IsExtendedMarketHours { get; private set; }\n\n        /// <summary>\n        /// Gets the data normalization mode used for this security\n        /// </summary>\n        [Obsolete(\"This property is obsolete. Use the 'SubscriptionDataConfig' exposed by 'SubscriptionManager'\")]\n        public DataNormalizationMode DataNormalizationMode { get; private set; }\n\n        /// <summary>\n        /// Gets the subscription configuration for this security\n        /// </summary>\n        [Obsolete(\"This property returns only the first subscription. Use the 'Subscriptions' property for all of this security's subscriptions.\")]\n        public SubscriptionDataConfig SubscriptionDataConfig\n        {\n            get\n            {\n                lock (_subscriptionsBag)\n                {\n                    return _subscriptionsBag.FirstOrDefault();\n                }\n            }\n        }\n\n        /// <summary>\n        /// There has been at least one datapoint since our algorithm started running for us to determine price.\n        /// </summary>\n        public bool HasData => GetLastData() != null;\n\n        /// <summary>\n        /// Gets or sets whether or not this security should be considered tradable\n        /// </summary>\n        public virtual bool IsTradable\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// True if the security has been delisted from exchanges and is no longer tradable\n        /// </summary>\n        public bool IsDelisted { get; set; }\n\n        /// <summary>\n        /// Data cache for the security to store previous price information.\n        /// </summary>\n        /// <seealso cref=\"EquityCache\"/>\n        /// <seealso cref=\"ForexCache\"/>\n        public SecurityCache Cache\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Holdings class contains the portfolio, cash and processes order fills.\n        /// </summary>\n        /// <seealso cref=\"EquityHolding\"/>\n        /// <seealso cref=\"ForexHolding\"/>\n        public SecurityHolding Holdings\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Exchange class contains the market opening hours, along with pre-post market hours.\n        /// </summary>\n        /// <seealso cref=\"EquityExchange\"/>\n        /// <seealso cref=\"ForexExchange\"/>\n        public SecurityExchange Exchange\n        {\n            get => _exchange;\n            set\n            {\n                _exchange = value;\n                if (_localTimeKeeper != null)\n                {\n                    _exchange.SetLocalDateTimeFrontierProvider(_localTimeKeeper);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Fee model used to compute order fees for this security\n        /// </summary>\n        public IFeeModel FeeModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Fill model used to produce fill events for this security\n        /// </summary>\n        public IFillModel FillModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Slippage model use to compute slippage of market orders\n        /// </summary>\n        public ISlippageModel SlippageModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the portfolio model used by this security\n        /// </summary>\n        public ISecurityPortfolioModel PortfolioModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the buying power model used for this security\n        /// </summary>\n        public IBuyingPowerModel BuyingPowerModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the buying power model used for this security, an alias for <see cref=\"BuyingPowerModel\"/>\n        /// </summary>\n        public IBuyingPowerModel MarginModel\n        {\n            get { return BuyingPowerModel; }\n            set { BuyingPowerModel = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the margin interest rate model\n        /// </summary>\n        public IMarginInterestRateModel MarginInterestRateModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the settlement model used for this security\n        /// </summary>\n        public ISettlementModel SettlementModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets the volatility model used for this security\n        /// </summary>\n        public IVolatilityModel VolatilityModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Customizable data filter to filter outlier ticks before they are passed into user event handlers.\n        /// By default all ticks are passed into the user algorithms.\n        /// </summary>\n        /// <remarks>TradeBars (seconds and minute bars) are prefiltered to ensure the ticks which build the bars are realistically tradeable</remarks>\n        /// <seealso cref=\"EquityDataFilter\"/>\n        /// <seealso cref=\"ForexDataFilter\"/>\n        public ISecurityDataFilter DataFilter\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Customizable price variation model used to define the minimum price variation of this security.\n        /// By default minimum price variation is a constant find in the symbol-properties-database.\n        /// </summary>\n        /// <seealso cref=\"AdjustedPriceVariationModel\"/>\n        /// <seealso cref=\"SecurityPriceVariationModel\"/>\n        /// <seealso cref=\"EquityPriceVariationModel\"/>\n        public IPriceVariationModel PriceVariationModel\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Provides dynamic access to data in the cache\n        /// </summary>\n        public dynamic Data\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the current session of this security\n        /// </summary>\n        public virtual Session Session => Cache.Session;\n\n        /// <summary>\n        /// Construct a new security vehicle based on the user options.\n        /// </summary>\n        public Security(SecurityExchangeHours exchangeHours,\n            SubscriptionDataConfig config,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            SecurityCache cache\n            )\n            : this(config,\n                quoteCurrency,\n                symbolProperties,\n                new SecurityExchange(exchangeHours),\n                cache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(),\n                new SecurityDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypesProvider,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n        }\n\n        /// <summary>\n        /// Construct a new security vehicle based on the user options.\n        /// </summary>\n        public Security(Symbol symbol,\n            SecurityExchangeHours exchangeHours,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            SecurityCache cache\n            )\n            : this(symbol,\n                quoteCurrency,\n                symbolProperties,\n                new SecurityExchange(exchangeHours),\n                cache,\n                new SecurityPortfolioModel(),\n                new ImmediateFillModel(),\n                new InteractiveBrokersFeeModel(),\n                NullSlippageModel.Instance,\n                new ImmediateSettlementModel(),\n                Securities.VolatilityModel.Null,\n                new SecurityMarginModel(),\n                new SecurityDataFilter(),\n                new SecurityPriceVariationModel(),\n                currencyConverter,\n                registeredTypesProvider,\n                Securities.MarginInterestRateModel.Null\n                )\n        {\n        }\n\n        /// <summary>\n        /// Construct a new security vehicle based on the user options.\n        /// </summary>\n        protected Security(Symbol symbol,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            SecurityExchange exchange,\n            SecurityCache cache,\n            ISecurityPortfolioModel portfolioModel,\n            IFillModel fillModel,\n            IFeeModel feeModel,\n            ISlippageModel slippageModel,\n            ISettlementModel settlementModel,\n            IVolatilityModel volatilityModel,\n            IBuyingPowerModel buyingPowerModel,\n            ISecurityDataFilter dataFilter,\n            IPriceVariationModel priceVariationModel,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            IMarginInterestRateModel marginInterestRateModel\n            )\n        {\n            if (symbolProperties == null)\n            {\n                throw new ArgumentNullException(nameof(symbolProperties), Messages.Security.ValidSymbolPropertiesInstanceRequired);\n            }\n\n            if (symbolProperties.QuoteCurrency != quoteCurrency.Symbol)\n            {\n                throw new ArgumentException(Messages.Security.UnmatchingQuoteCurrencies);\n            }\n\n            Symbol = symbol;\n            _subscriptionsBag = new();\n            QuoteCurrency = quoteCurrency;\n            SymbolProperties = symbolProperties;\n\n            if (Symbol.SecurityType != SecurityType.Index)\n            {\n                IsTradable = true;\n            }\n\n            Cache = cache;\n            Exchange = exchange;\n            DataFilter = dataFilter;\n            PriceVariationModel = priceVariationModel;\n            PortfolioModel = portfolioModel;\n            BuyingPowerModel = buyingPowerModel;\n            FillModel = fillModel;\n            FeeModel = feeModel;\n            SlippageModel = slippageModel;\n            SettlementModel = settlementModel;\n            VolatilityModel = volatilityModel;\n            MarginInterestRateModel = marginInterestRateModel;\n            Holdings = new SecurityHolding(this, currencyConverter);\n            Data = new DynamicSecurityData(registeredTypesProvider, Cache);\n            ShortableProvider = NullShortableProvider.Instance;\n\n            UpdateSubscriptionProperties();\n        }\n\n\n        /// <summary>\n        /// Temporary convenience constructor\n        /// </summary>\n        protected Security(SubscriptionDataConfig config,\n            Cash quoteCurrency,\n            SymbolProperties symbolProperties,\n            SecurityExchange exchange,\n            SecurityCache cache,\n            ISecurityPortfolioModel portfolioModel,\n            IFillModel fillModel,\n            IFeeModel feeModel,\n            ISlippageModel slippageModel,\n            ISettlementModel settlementModel,\n            IVolatilityModel volatilityModel,\n            IBuyingPowerModel buyingPowerModel,\n            ISecurityDataFilter dataFilter,\n            IPriceVariationModel priceVariationModel,\n            ICurrencyConverter currencyConverter,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            IMarginInterestRateModel marginInterestRateModel\n            )\n            : this(config.Symbol,\n                quoteCurrency,\n                symbolProperties,\n                exchange,\n                cache,\n                portfolioModel,\n                fillModel,\n                feeModel,\n                slippageModel,\n                settlementModel,\n                volatilityModel,\n                buyingPowerModel,\n                dataFilter,\n                priceVariationModel,\n                currencyConverter,\n                registeredTypesProvider,\n                marginInterestRateModel\n                )\n        {\n            _subscriptionsBag.Add(config);\n            UpdateSubscriptionProperties();\n        }\n\n        /// <summary>\n        /// Read only property that checks if we currently own stock in the company.\n        /// </summary>\n        public virtual bool HoldStock => Holdings.HoldStock;\n\n        /// <summary>\n        /// Alias for HoldStock - Do we have any of this security\n        /// </summary>\n        public virtual bool Invested => HoldStock;\n\n        /// <summary>\n        /// Local time for this market\n        /// </summary>\n        public virtual DateTime LocalTime\n        {\n            get\n            {\n                if (_localTimeKeeper == null)\n                {\n                    throw new InvalidOperationException(Messages.Security.SetLocalTimeKeeperMustBeCalledBeforeUsingLocalTime);\n                }\n\n                return _localTimeKeeper.LocalTime;\n            }\n        }\n\n        /// <summary>\n        /// Get the current value of the security.\n        /// </summary>\n        public virtual decimal Price => Cache.Price;\n\n        /// <summary>\n        /// Leverage for this Security.\n        /// </summary>\n        public virtual decimal Leverage => Holdings.Leverage;\n\n        /// <summary>\n        /// If this uses tradebar data, return the most recent high.\n        /// </summary>\n        public virtual decimal High => Cache.High == 0 ? Price : Cache.High;\n\n        /// <summary>\n        /// If this uses tradebar data, return the most recent low.\n        /// </summary>\n        public virtual decimal Low => Cache.Low == 0 ? Price : Cache.Low;\n\n        /// <summary>\n        /// If this uses tradebar data, return the most recent close.\n        /// </summary>\n        public virtual decimal Close => Cache.Close == 0 ? Price : Cache.Close;\n\n        /// <summary>\n        /// If this uses tradebar data, return the most recent open.\n        /// </summary>\n        public virtual decimal Open => Cache.Open == 0 ? Price : Cache.Open;\n\n        /// <summary>\n        /// Access to the volume of the equity today\n        /// </summary>\n        public virtual decimal Volume => Cache.Volume;\n\n        /// <summary>\n        /// Gets the most recent bid price if available\n        /// </summary>\n        public virtual decimal BidPrice => Cache.BidPrice == 0 ? Price : Cache.BidPrice;\n\n        /// <summary>\n        /// Gets the most recent bid size if available\n        /// </summary>\n        public virtual decimal BidSize => Cache.BidSize;\n\n        /// <summary>\n        /// Gets the most recent ask price if available\n        /// </summary>\n        public virtual decimal AskPrice => Cache.AskPrice == 0 ? Price : Cache.AskPrice;\n\n        /// <summary>\n        /// Gets the most recent ask size if available\n        /// </summary>\n        public virtual decimal AskSize => Cache.AskSize;\n\n        /// <summary>\n        /// Access to the open interest of the security today\n        /// </summary>\n        public virtual long OpenInterest => Cache.OpenInterest;\n\n        /// <summary>\n        /// Gets the fundamental data associated with the security if there is any, otherwise null.\n        /// </summary>\n        public Fundamental Fundamentals\n        {\n            get\n            {\n                return Fundamental.ForDate(LocalTime, Symbol);\n            }\n        }\n\n        /// <summary>\n        /// Get the last price update set to the security if any else null\n        /// </summary>\n        /// <returns>BaseData object for this security</returns>\n        public BaseData GetLastData() => Cache.GetData();\n\n        /// <summary>\n        /// Sets the <see cref=\"LocalTimeKeeper\"/> to be used for this <see cref=\"Security\"/>.\n        /// This is the source of this instance's time.\n        /// </summary>\n        /// <param name=\"localTimeKeeper\">The source of this <see cref=\"Security\"/>'s time.</param>\n        public virtual void SetLocalTimeKeeper(LocalTimeKeeper localTimeKeeper)\n        {\n            _localTimeKeeper = localTimeKeeper;\n            Cache.SetLocalTimeKeeper(localTimeKeeper);\n            Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n        }\n\n        /// <summary>\n        /// Update any security properties based on the latest market data and time\n        /// </summary>\n        /// <param name=\"data\">New data packet from LEAN</param>\n        public void SetMarketPrice(BaseData data)\n        {\n            //Add new point to cache:\n            if (data == null) return;\n            Cache.AddData(data);\n\n            UpdateMarketPrice(data);\n        }\n\n        /// <summary>\n        /// Updates all of the security properties, such as price/OHLCV/bid/ask based\n        /// on the data provided. Data is also stored into the security's data cache\n        /// </summary>\n        /// <param name=\"data\">The security update data</param>\n        /// <param name=\"dataType\">The data type</param>\n        /// <param name=\"containsFillForwardData\">Flag indicating whether\n        /// <param name=\"isInternalConfig\">True if this update data corresponds to an internal subscription\n        /// such as currency or security benchmark</param>\n        /// <paramref name=\"data\"/> contains any fill forward bar or not</param>\n        public void Update(IReadOnlyList<BaseData> data, Type dataType, bool? containsFillForwardData = null, bool isInternalConfig = false)\n        {\n            Cache.AddDataList(data, dataType, containsFillForwardData, isInternalConfig);\n\n            UpdateMarketPrice(data[data.Count - 1]);\n        }\n\n        /// <summary>\n        /// Returns true if the security contains at least one subscription that represents custom data\n        /// </summary>\n        [Obsolete(\"This method is obsolete. Use the 'SubscriptionDataConfig' exposed by\" +\n            \" 'SubscriptionManager' and the 'IsCustomData()' extension method\")]\n        public bool IsCustomData()\n        {\n            if (Subscriptions == null || !Subscriptions.Any())\n            {\n                return false;\n            }\n\n            return Subscriptions.Any(x => x.IsCustomData);\n        }\n\n        /// <summary>\n        /// Set the leverage parameter for this security\n        /// </summary>\n        /// <param name=\"leverage\">Leverage for this asset</param>\n        public void SetLeverage(decimal leverage)\n        {\n            if (Symbol.ID.SecurityType == SecurityType.Future || Symbol.ID.SecurityType.IsOption())\n            {\n                return;\n            }\n\n            BuyingPowerModel.SetLeverage(this, leverage);\n        }\n\n        /// <summary>\n        /// Sets the data normalization mode to be used by this security\n        /// </summary>\n        [Obsolete(\"This method is obsolete. Use the 'SubscriptionDataConfig' exposed by\" +\n            \" 'SubscriptionManager' and the 'SetDataNormalizationMode()' extension method\")]\n        public virtual void SetDataNormalizationMode(DataNormalizationMode mode)\n        {\n            lock (_subscriptionsBag)\n            {\n                foreach (var subscription in _subscriptionsBag)\n                {\n                    subscription.DataNormalizationMode = mode;\n                }\n                UpdateSubscriptionProperties();\n            }\n        }\n\n        /// <summary>\n        /// This method will refresh the value of the <see cref=\"DataNormalizationMode\"/> property.\n        /// This is required for backward-compatibility.\n        /// TODO: to be deleted with the DataNormalizationMode property\n        /// </summary>\n        public void RefreshDataNormalizationModeProperty()\n        {\n            lock (_subscriptionsBag)\n            {\n                DataNormalizationMode = _subscriptionsBag\n                    .Select(x => x.DataNormalizationMode)\n                    .DefaultIfEmpty(DataNormalizationMode.Adjusted)\n                    .FirstOrDefault();\n            }\n        }\n\n        /// <summary>\n        /// Sets the fee model\n        /// </summary>\n        /// <param name=\"feelModel\">Model that represents a fee model</param>\n        public void SetFeeModel(IFeeModel feelModel)\n        {\n            FeeModel = feelModel;\n        }\n\n        /// <summary>\n        /// Sets the fee model\n        /// </summary>\n        /// <param name=\"feelModel\">Model that represents a fee model</param>\n        public void SetFeeModel(PyObject feelModel)\n        {\n            FeeModel = PythonUtil.CreateInstanceOrWrapper<IFeeModel>(\n                feelModel,\n                py => new FeeModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the fill model\n        /// </summary>\n        /// <param name=\"fillModel\">Model that represents a fill model</param>\n        public void SetFillModel(IFillModel fillModel)\n        {\n            FillModel = fillModel;\n        }\n\n        /// <summary>\n        /// Sets the fill model\n        /// </summary>\n        /// <param name=\"fillModel\">Model that represents a fill model</param>\n        public void SetFillModel(PyObject fillModel)\n        {\n            FillModel = PythonUtil.CreateInstanceOrWrapper<IFillModel>(\n                fillModel,\n                py => new FillModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the settlement model\n        /// </summary>\n        /// <param name=\"settlementModel\"> Model that represents a settlement model</param>\n        public void SetSettlementModel(ISettlementModel settlementModel)\n        {\n            SettlementModel = settlementModel;\n        }\n\n        /// <summary>\n        /// Sets the settlement model\n        /// </summary>\n        /// <param name=\"settlementModel\">Model that represents a settlement model</param>\n        public void SetSettlementModel(PyObject settlementModel)\n        {\n            SettlementModel = PythonUtil.CreateInstanceOrWrapper<ISettlementModel>(\n                settlementModel,\n                py => new SettlementModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the slippage model\n        /// </summary>\n        /// <param name=\"slippageModel\">Model that represents a slippage model</param>\n        public void SetSlippageModel(ISlippageModel slippageModel)\n        {\n            SlippageModel = slippageModel;\n        }\n\n        /// <summary>\n        /// Sets the slippage model\n        /// </summary>\n        /// <param name=\"slippageModel\">Model that represents a slippage model</param>\n        public void SetSlippageModel(PyObject slippageModel)\n        {\n            SlippageModel = PythonUtil.CreateInstanceOrWrapper<ISlippageModel>(\n                slippageModel,\n                py => new SlippageModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the volatility model\n        /// </summary>\n        /// <param name=\"volatilityModel\">Model that represents a volatility model</param>\n        public void SetVolatilityModel(IVolatilityModel volatilityModel)\n        {\n            VolatilityModel = volatilityModel;\n        }\n\n        /// <summary>\n        /// Sets the volatility model\n        /// </summary>\n        /// <param name=\"volatilityModel\">Model that represents a volatility model</param>\n        public void SetVolatilityModel(PyObject volatilityModel)\n        {\n            VolatilityModel = PythonUtil.CreateInstanceOrWrapper<IVolatilityModel>(\n                volatilityModel,\n                py => new VolatilityModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the buying power model\n        /// </summary>\n        /// <param name=\"buyingPowerModel\">Model that represents a security's model of buying power</param>\n        public void SetBuyingPowerModel(IBuyingPowerModel buyingPowerModel)\n        {\n            BuyingPowerModel = buyingPowerModel;\n        }\n\n        /// <summary>\n        /// Sets the buying power model\n        /// </summary>\n        /// <param name=\"pyObject\">Model that represents a security's model of buying power</param>\n        public void SetBuyingPowerModel(PyObject pyObject)\n        {\n            BuyingPowerModel = PythonUtil.CreateInstanceOrWrapper<IBuyingPowerModel>(\n                pyObject,\n                py => new BuyingPowerModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the margin interests rate model\n        /// </summary>\n        /// <param name=\"marginInterestRateModel\">Model that represents a security's model of margin interest rate</param>\n        public void SetMarginInterestRateModel(IMarginInterestRateModel marginInterestRateModel)\n        {\n            MarginInterestRateModel = marginInterestRateModel;\n        }\n\n        /// <summary>\n        /// Sets the margin interests rate model\n        /// </summary>\n        /// <param name=\"pyObject\">Model that represents a security's model of margin interest rate</param>\n        public void SetMarginInterestRateModel(PyObject pyObject)\n        {\n            MarginInterestRateModel = PythonUtil.CreateInstanceOrWrapper<IMarginInterestRateModel>(\n                pyObject,\n                py => new MarginInterestRateModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Sets the margin model\n        /// </summary>\n        /// <param name=\"marginModel\">Model that represents a security's model of buying power</param>\n        public void SetMarginModel(IBuyingPowerModel marginModel)\n        {\n            MarginModel = marginModel;\n        }\n\n        /// <summary>\n        /// Sets the margin model\n        /// </summary>\n        /// <param name=\"pyObject\">Model that represents a security's model of buying power</param>\n        public void SetMarginModel(PyObject pyObject)\n        {\n            MarginModel = PythonUtil.CreateInstanceOrWrapper<IBuyingPowerModel>(\n                pyObject,\n                py => new BuyingPowerModelPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Set Python Shortable Provider for this <see cref=\"Security\"/>\n        /// </summary>\n        /// <param name=\"pyObject\">Python class that represents a custom shortable provider</param>\n        public void SetShortableProvider(PyObject pyObject)\n        {\n            ShortableProvider = PythonUtil.CreateInstanceOrWrapper<IShortableProvider>(\n                pyObject,\n                py => new ShortableProviderPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Set Shortable Provider for this <see cref=\"Security\"/>\n        /// </summary>\n        /// <param name=\"shortableProvider\">Provider to use</param>\n        public void SetShortableProvider(IShortableProvider shortableProvider)\n        {\n            ShortableProvider = shortableProvider;\n        }\n\n        /// <summary>\n        /// Set Security Data Filter\n        /// </summary>\n        /// <param name=\"pyObject\">Python class that represents a custom Security Data Filter</param>\n        /// <exception cref=\"ArgumentException\"></exception>\n        public void SetDataFilter(PyObject pyObject)\n        {\n            DataFilter = PythonUtil.CreateInstanceOrWrapper<ISecurityDataFilter>(\n                pyObject,\n                py => new SecurityDataFilterPythonWrapper(py)\n            );\n        }\n\n        /// <summary>\n        /// Set Security Data Filter\n        /// </summary>\n        /// <param name=\"dataFilter\">Security Data Filter</param>\n        public void SetDataFilter(ISecurityDataFilter dataFilter)\n        {\n            DataFilter = dataFilter;\n        }\n\n        #region DynamicObject Overrides and Helper Methods\n\n        /// <summary>\n        /// This is a <see cref=\"DynamicObject\"/> override. Not meant for external use.\n        /// </summary>\n        public override bool TryGetMember(GetMemberBinder binder, out object result)\n        {\n            return Cache.Properties.TryGetValue(binder.Name, out result);\n        }\n\n        /// <summary>\n        /// This is a <see cref=\"DynamicObject\"/> override. Not meant for external use.\n        /// </summary>\n        public override bool TrySetMember(SetMemberBinder binder, object value)\n        {\n            Cache.Properties[binder.Name] = value;\n            return true;\n        }\n\n        /// <summary>\n        /// This is a <see cref=\"DynamicObject\"/> override. Not meant for external use.\n        /// </summary>\n        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)\n        {\n            try\n            {\n                result = Cache.Properties.GetType().InvokeMember(binder.Name, BindingFlags.InvokeMethod, null, Cache.Properties, args,\n                    CultureInfo.InvariantCulture);\n                return true;\n            }\n            catch\n            {\n                result = null;\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified custom property.\n        /// This allows us to use the security object as a dynamic object for quick storage.\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <param name=\"value\">The property value</param>\n        public void Add(string key, object value)\n        {\n            Set(key, value);\n        }\n\n        /// <summary>\n        /// Sets the specified custom property.\n        /// This allows us to use the security object as a dynamic object for quick storage.\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <param name=\"value\">The property value</param>\n        public void Set(string key, object value)\n        {\n            Cache.Properties[key] = value;\n        }\n\n        /// <summary>\n        /// Gets the specified custom property\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <param name=\"value\">The property value</param>\n        /// <returns>True if the property is found.</returns>\n        /// <exception cref=\"InvalidCastException\">If the property is found but its value cannot be casted to the speficied type</exception>\n        public bool TryGet<T>(string key, out T value)\n        {\n            if (Cache.Properties.TryGetValue(key, out var obj))\n            {\n                value = CastDynamicPropertyValue<T>(obj);\n                return true;\n            }\n            value = default;\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the specified custom property\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <returns>The property value is found</returns>\n        /// <exception cref=\"KeyNotFoundException\">If the property is not found</exception>\n        public T Get<T>(string key)\n        {\n            return CastDynamicPropertyValue<T>(Cache.Properties[key]);\n        }\n\n        /// <summary>\n        /// Removes a custom property.\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <returns>True if the property is successfully removed</returns>\n        public bool Remove(string key)\n        {\n            return Cache.Properties.Remove(key);\n        }\n\n        /// <summary>\n        /// Removes a custom property.\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        /// <param name=\"value\">The removed property value</param>\n        /// <returns>True if the property is successfully removed</returns>\n        public bool Remove<T>(string key, out T value)\n        {\n            value = default;\n            var result = Cache.Properties.Remove(key, out object objectValue);\n            if (result)\n            {\n                value = CastDynamicPropertyValue<T>(objectValue);\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Removes every custom property that had been set.\n        /// </summary>\n        public void Clear()\n        {\n            Cache.Properties.Clear();\n        }\n\n        /// <summary>\n        /// Gets or sets the specified custom property through the indexer.\n        /// This is a wrapper around the <see cref=\"Get{T}(string)\"/> and <see cref=\"Add(string,object)\"/> methods.\n        /// </summary>\n        /// <param name=\"key\">The property key</param>\n        public object this[string key]\n        {\n            get\n            {\n                return Get<object>(key);\n            }\n            set\n            {\n                Add(key, value);\n            }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Symbol.ToString();\n        }\n\n        /// <summary>\n        /// Adds the specified data subscription to this security.\n        /// </summary>\n        /// <param name=\"subscription\">The subscription configuration to add. The Symbol and ExchangeTimeZone properties must match the existing Security object</param>\n        internal void AddData(SubscriptionDataConfig subscription)\n        {\n            lock (_subscriptionsBag)\n            {\n                if (subscription.Symbol != Symbol)\n                {\n                    throw new ArgumentException(Messages.Security.UnmatchingSymbols, $\"{nameof(subscription)}.{nameof(subscription.Symbol)}\");\n                }\n                if (!subscription.ExchangeTimeZone.Equals(Exchange.TimeZone))\n                {\n                    throw new ArgumentException(Messages.Security.UnmatchingExchangeTimeZones, $\"{nameof(subscription)}.{nameof(subscription.ExchangeTimeZone)}\");\n                }\n                _subscriptionsBag.Add(subscription);\n                UpdateSubscriptionProperties();\n            }\n        }\n\n        /// <summary>\n        /// Adds the specified data subscriptions to this security.\n        /// </summary>\n        /// <param name=\"subscriptions\">The subscription configuration to add. The Symbol and ExchangeTimeZone properties must match the existing Security object</param>\n        internal void AddData(SubscriptionDataConfigList subscriptions)\n        {\n            lock (_subscriptionsBag)\n            {\n                foreach (var subscription in subscriptions)\n                {\n                    if (subscription.Symbol != Symbol)\n                    {\n                        throw new ArgumentException(Messages.Security.UnmatchingSymbols, $\"{nameof(subscription)}.{nameof(subscription.Symbol)}\");\n                    }\n                    if (!subscription.ExchangeTimeZone.Equals(Exchange.TimeZone))\n                    {\n                        throw new ArgumentException(Messages.Security.UnmatchingExchangeTimeZones, $\"{nameof(subscription)}.{nameof(subscription.ExchangeTimeZone)}\");\n                    }\n                    _subscriptionsBag.Add(subscription);\n                }\n                UpdateSubscriptionProperties();\n            }\n        }\n\n        /// <summary>\n        /// Update market price of this Security\n        /// </summary>\n        /// <param name=\"data\">Data to pull price from</param>\n        protected virtual void UpdateConsumersMarketPrice(BaseData data)\n        {\n            if (data is OpenInterest || data.Price == 0m) return;\n            Holdings.UpdateMarketPrice(Price);\n            VolatilityModel.Update(this, data);\n        }\n\n        /// <summary>\n        /// Caller should hold the lock on '_subscriptionsBag'\n        /// </summary>\n        private void UpdateSubscriptionProperties()\n        {\n            Resolution = _subscriptionsBag.Select(x => x.Resolution).DefaultIfEmpty(Resolution.Daily).Min();\n            IsFillDataForward = _subscriptionsBag.Any(x => x.FillDataForward);\n            IsExtendedMarketHours = _subscriptionsBag.Any(x => x.ExtendedMarketHours);\n            RefreshDataNormalizationModeProperty();\n        }\n\n        /// <summary>\n        /// Updates consumers market price. It will do nothing if the passed data type is auxiliary.\n        /// </summary>\n        private void UpdateMarketPrice(BaseData data)\n        {\n            if (data.DataType != MarketDataType.Auxiliary)\n            {\n                UpdateConsumersMarketPrice(data);\n            }\n        }\n\n        /// <summary>\n        /// Casts a dynamic property value to the specified type.\n        /// Useful for cases where the property value is a PyObject and we want to cast it to the underlying type.\n        /// </summary>\n        private static T CastDynamicPropertyValue<T>(object obj)\n        {\n            T value;\n            var pyObj = obj as PyObject;\n            if (pyObj != null)\n            {\n                using (Py.GIL())\n                {\n                    value = pyObj.As<T>();\n                }\n            }\n            else\n            {\n                value = (T)obj;\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Applies the split to the security\n        /// </summary>\n        internal void ApplySplit(Split split)\n        {\n            Cache.ApplySplit(split);\n            UpdateMarketPrice(Cache.GetData());\n        }\n\n        /// <summary>\n        /// Updates the symbol properties of this security\n        /// </summary>\n        internal virtual void UpdateSymbolProperties(SymbolProperties symbolProperties)\n        {\n            if (symbolProperties != null)\n            {\n                SymbolProperties = symbolProperties;\n            }\n        }\n\n        /// <summary>\n        /// Returns the securities symbol\n        /// </summary>\n        public static implicit operator Symbol(Security security) => security.Symbol;\n\n        /// <summary>\n        /// Resets the security to its initial state by marking it as uninitialized and non-tradable\n        /// and clearing the subscriptions.\n        /// </summary>\n        public virtual void Reset()\n        {\n            IsInitialized = false;\n            IsTradable = false;\n\n            // Reset the subscriptions\n            lock (_subscriptionsBag)\n            {\n                _subscriptionsBag.Clear();\n                UpdateSubscriptionProperties();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityCache.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\nusing Python.Runtime;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Base class caching spot for security data and any other temporary properties.\n    /// </summary>\n    public class SecurityCache\n    {\n        // let's share the empty readonly version, so we don't need null checks\n        private static readonly IReadOnlyList<BaseData> _empty = new List<BaseData>();\n\n        // this is used to prefer quote bar data over the tradebar data\n        private DateTime _lastQuoteBarUpdate;\n        private DateTime _lastOHLCUpdate;\n        private BaseData _lastData;\n\n        private readonly object _locker = new();\n        private IReadOnlyList<BaseData> _lastTickQuotes = _empty;\n        private IReadOnlyList<BaseData> _lastTickTrades = _empty;\n        private Dictionary<Type, IReadOnlyList<BaseData>> _dataByType;\n\n        private Dictionary<string, object> _properties;\n        private LocalTimeKeeper _localTimeKeeper;\n        private bool _subscribeToDateChangedEvent;\n\n        /// <summary>\n        /// Gets the trading session information\n        /// </summary>\n        public Session Session { get; set; }\n\n        /// <summary>\n        /// Gets the most recent price submitted to this cache\n        /// </summary>\n        public decimal Price { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent open submitted to this cache\n        /// </summary>\n        public decimal Open { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent high submitted to this cache\n        /// </summary>\n        public decimal High { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent low submitted to this cache\n        /// </summary>\n        public decimal Low { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent close submitted to this cache\n        /// </summary>\n        public decimal Close { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent bid submitted to this cache\n        /// </summary>\n        public decimal BidPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent ask submitted to this cache\n        /// </summary>\n        public decimal AskPrice { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent bid size submitted to this cache\n        /// </summary>\n        public decimal BidSize { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent ask size submitted to this cache\n        /// </summary>\n        public decimal AskSize { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent volume submitted to this cache\n        /// </summary>\n        public decimal Volume { get; private set; }\n\n        /// <summary>\n        /// Gets the most recent open interest submitted to this cache\n        /// </summary>\n        public long OpenInterest { get; private set; }\n\n        /// <summary>\n        /// Collection of keyed custom properties\n        /// </summary>\n        public Dictionary<string, object> Properties\n        {\n            get\n            {\n                if (_properties == null)\n                {\n                    _properties = new Dictionary<string, object>();\n                }\n                return _properties;\n            }\n        }\n\n        /// <summary>\n        /// Add a list of market data points to the local security cache for the current market price.\n        /// </summary>\n        /// <remarks>Internally uses <see cref=\"AddData\"/> using the last data point of the provided list\n        /// and it stores by type the non fill forward points using <see cref=\"StoreData\"/></remarks>\n        public void AddDataList(IReadOnlyList<BaseData> data, Type dataType, bool? containsFillForwardData = null, bool isInternalConfig = false)\n        {\n            SubscribeToTimeUpdatedEvent();\n            var nonFillForwardData = data;\n            // maintaining regression requires us to NOT cache FF data\n            if (containsFillForwardData != false)\n            {\n                var dataFiltered = new List<BaseData>(data.Count);\n                for (var i = 0; i < data.Count; i++)\n                {\n                    var dataPoint = data[i];\n                    if (!dataPoint.IsFillForward)\n                    {\n                        dataFiltered.Add(dataPoint);\n                    }\n                }\n                nonFillForwardData = dataFiltered;\n            }\n            if (nonFillForwardData.Count != 0)\n            {\n                StoreData(nonFillForwardData, dataType);\n            }\n            else if (dataType == typeof(OpenInterest))\n            {\n                StoreData(data, typeof(OpenInterest));\n            }\n\n            // Session -> Current OHLCV of the day\n            if (Session != null && !isInternalConfig && LeanData.IsCommonLeanDataType(dataType))\n            {\n                for (int i = 0; i < data.Count; i++)\n                {\n                    Session.Update(data[i]);\n                }\n            }\n\n            for (var i = 0; i < data.Count; i++)\n            {\n                ProcessDataPoint(data[i], cacheByType: false);\n            }\n        }\n\n        /// <summary>\n        /// Add a new market data point to the local security cache for the current market price.\n        /// Rules:\n        ///     Don't cache fill forward data.\n        ///     Always return the last observation.\n        ///     If two consecutive data has the same time stamp and one is Quotebars and the other Tradebar, prioritize the Quotebar.\n        /// </summary>\n        public void AddData(BaseData data)\n        {\n            ProcessDataPoint(data, cacheByType: true);\n        }\n\n        /// <summary>\n        /// Will consume the given data point updating the cache state and it's properties\n        /// </summary>\n        /// <param name=\"data\">The data point to process</param>\n        /// <param name=\"cacheByType\">True if this data point should be cached by type</param>\n        protected virtual void ProcessDataPoint(BaseData data, bool cacheByType)\n        {\n            var tick = data as Tick;\n            if (tick?.TickType == TickType.OpenInterest)\n            {\n                if (cacheByType)\n                {\n                    StoreDataPoint(data);\n                }\n                OpenInterest = (long)tick.Value;\n\n                // Update the session with the latest open interest\n                Session?.Update(data);\n                return;\n            }\n\n            // Only cache non fill-forward data and non auxiliary\n            if (data.IsFillForward) return;\n\n            if (cacheByType)\n            {\n                StoreDataPoint(data);\n            }\n\n            // we store auxiliary data by type but we don't use it to set 'lastData' nor price information\n            if (data.DataType == MarketDataType.Auxiliary) return;\n\n            var isDefaultDataType = SubscriptionManager.IsDefaultDataType(data);\n\n            // don't set _lastData if receive quotebar then tradebar w/ same end time. this\n            // was implemented to grant preference towards using quote data in the fill\n            // models and provide a level of determinism on the values exposed via the cache.\n            if ((_lastData == null\n              || _lastQuoteBarUpdate != data.EndTime\n              || data.DataType != MarketDataType.TradeBar)\n                // we will only set the default data type to preserve determinism and backwards compatibility\n                && isDefaultDataType)\n            {\n                _lastData = data;\n            }\n\n            if (tick != null)\n            {\n                if (tick.Value != 0) Price = tick.Value;\n\n                switch (tick.TickType)\n                {\n                    case TickType.Trade:\n                        if (tick.Quantity != 0) Volume = tick.Quantity;\n                        break;\n\n                    case TickType.Quote:\n                        if (tick.BidPrice != 0) BidPrice = tick.BidPrice;\n                        if (tick.BidSize != 0) BidSize = tick.BidSize;\n\n                        if (tick.AskPrice != 0) AskPrice = tick.AskPrice;\n                        if (tick.AskSize != 0) AskSize = tick.AskSize;\n                        break;\n                }\n                return;\n            }\n\n            var bar = data as IBar;\n            if (bar != null)\n            {\n                // we will only set OHLC values using the default data type to preserve determinism and backwards compatibility.\n                // Gives priority to QuoteBar over TradeBar, to be removed when default data type completely addressed GH issue 4196\n                if ((_lastQuoteBarUpdate != data.EndTime || _lastOHLCUpdate != data.EndTime) && isDefaultDataType)\n                {\n                    _lastOHLCUpdate = data.EndTime;\n                    if (bar.Open != 0) Open = bar.Open;\n                    if (bar.High != 0) High = bar.High;\n                    if (bar.Low != 0) Low = bar.Low;\n                    if (bar.Close != 0)\n                    {\n                        Price = bar.Close;\n                        Close = bar.Close;\n                    }\n                }\n\n                var tradeBar = bar as TradeBar;\n                if (tradeBar != null)\n                {\n                    if (tradeBar.Volume != 0) Volume = tradeBar.Volume;\n                }\n\n                var quoteBar = bar as QuoteBar;\n                if (quoteBar != null)\n                {\n                    _lastQuoteBarUpdate = quoteBar.EndTime;\n                    if (quoteBar.Ask != null && quoteBar.Ask.Close != 0) AskPrice = quoteBar.Ask.Close;\n                    if (quoteBar.Bid != null && quoteBar.Bid.Close != 0) BidPrice = quoteBar.Bid.Close;\n                    if (quoteBar.LastBidSize != 0) BidSize = quoteBar.LastBidSize;\n                    if (quoteBar.LastAskSize != 0) AskSize = quoteBar.LastAskSize;\n                }\n            }\n            else if (data.DataType != MarketDataType.Auxiliary)\n            {\n                if (data.DataType != MarketDataType.Base || data.Price != 0)\n                {\n                    Price = data.Price;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Stores the specified data list in the cache WITHOUT updating any of the cache properties, such as Price\n        /// </summary>\n        /// <param name=\"data\">The collection of data to store in this cache</param>\n        /// <param name=\"dataType\">The data type</param>\n        public void StoreData(IReadOnlyList<BaseData> data, Type dataType)\n        {\n            if (dataType == typeof(Tick))\n            {\n                var tick = data[data.Count - 1] as Tick;\n                switch (tick?.TickType)\n                {\n                    case TickType.Trade:\n                        _lastTickTrades = data;\n                        return;\n                    case TickType.Quote:\n                        _lastTickQuotes = data;\n                        return;\n                }\n            }\n\n            lock (_locker)\n            {\n                _dataByType ??= new();\n                _dataByType[dataType] = data;\n            }\n        }\n\n        /// <summary>\n        /// Get last data packet received for this security if any else null\n        /// </summary>\n        /// <returns>BaseData type of the security</returns>\n        public BaseData GetData()\n        {\n            return _lastData;\n        }\n\n        /// <summary>\n        /// Get last data packet received for this security of the specified type\n        /// </summary>\n        /// <typeparam name=\"T\">The data type</typeparam>\n        /// <returns>The last data packet, null if none received of type</returns>\n        public T GetData<T>()\n            where T : BaseData\n        {\n            return GetData(typeof(T)) as T;\n        }\n\n        /// <summary>\n        /// Retrieves the last data packet of the specified Python type.\n        /// </summary>\n        /// <param name=\"pyType\">The Python type to convert and match</param>\n        /// <returns>The last data packet as a PyObject, or null if not found</returns>\n        public PyObject GetData(PyObject pyType)\n        {\n            using var _ = Py.GIL();\n            if (!pyType.TryCreateType(out var type))\n            {\n                return null;\n            }\n            // Try to retrieve data using the exact type\n            var data = GetData(type);\n\n            // If no data is found and the type is or derives from PythonData,\n            // fallback to retrieving data for the base PythonData type\n            if (data == null && typeof(PythonData).IsAssignableFrom(type))\n            {\n                // This can happen when the user manually adds data from Python using AddData()\n                data = GetData<PythonData>();\n            }\n            return data.ToPython();\n        }\n\n        /// <summary>\n        /// Get the last data packet of the specified type\n        /// </summary>\n        /// <param name=\"type\">The type of data to retrieve</param>\n        /// <returns>The last data packet of the specified type, or null if none found</returns>\n        private BaseData GetData(Type type)\n        {\n            IReadOnlyList<BaseData> list;\n            if (!TryGetValue(type, out list) || list.Count == 0)\n            {\n                return null;\n            }\n            return list[list.Count - 1];\n        }\n\n        /// <summary>\n        /// Gets all data points of the specified type from the most recent time step\n        /// that produced data for that type\n        /// </summary>\n        public IEnumerable<T> GetAll<T>()\n        {\n            if (typeof(T) == typeof(Tick))\n            {\n                return _lastTickTrades.Concat(_lastTickQuotes).Cast<T>();\n            }\n\n            lock (_locker)\n            {\n                if (_dataByType == null || !_dataByType.TryGetValue(typeof(T), out var list))\n                {\n                    return new List<T>();\n                }\n\n                return list.Cast<T>();\n            }\n        }\n\n        /// <summary>\n        /// Reset cache storage and free memory\n        /// </summary>\n        public void Reset()\n        {\n            Price = 0;\n\n            Open = 0;\n            High = 0;\n            Low = 0;\n            Close = 0;\n\n            BidPrice = 0;\n            BidSize = 0;\n            AskPrice = 0;\n            AskSize = 0;\n\n            Volume = 0;\n            OpenInterest = 0;\n\n            _lastData = null;\n            _dataByType = null;\n            _lastTickQuotes = _empty;\n            _lastTickTrades = _empty;\n\n            _lastOHLCUpdate = default;\n            _lastQuoteBarUpdate = default;\n            Session?.Reset();\n            UnsubscribeToTimeUpdatedEvent();\n        }\n\n        /// <summary>\n        /// Gets whether or not this dynamic data instance has data stored for the specified type\n        /// </summary>\n        public bool HasData(Type type)\n        {\n            return TryGetValue(type, out _);\n        }\n\n        /// <summary>\n        /// Gets whether or not this dynamic data instance has data stored for the specified type\n        /// </summary>\n        public bool TryGetValue(Type type, out IReadOnlyList<BaseData> data)\n        {\n            if (type == typeof(Fundamentals))\n            {\n                // for backwards compatibility\n                type = typeof(FundamentalUniverse);\n            }\n            else if (type == typeof(ETFConstituentData))\n            {\n                // for backwards compatibility\n                type = typeof(ETFConstituentUniverse);\n            }\n            else if (type == typeof(Tick))\n            {\n                var quote = _lastTickQuotes.LastOrDefault();\n                var trade = _lastTickTrades.LastOrDefault();\n                var isQuoteDefaultDataType = quote != null && SubscriptionManager.IsDefaultDataType(quote);\n                var isTradeDefaultDataType = trade != null && SubscriptionManager.IsDefaultDataType(trade);\n\n                // Currently, IsDefaultDataType returns true for both cases,\n                // So we will return the list with the tick with the most recent timestamp\n                if (isQuoteDefaultDataType && isTradeDefaultDataType)\n                {\n                    data = quote.EndTime > trade.EndTime ? _lastTickQuotes : _lastTickTrades;\n                    return true;\n                }\n\n                data = isQuoteDefaultDataType ? _lastTickQuotes : _lastTickTrades;\n                return data?.Count > 0;\n            }\n\n            data = default;\n            return _dataByType != null && _dataByType.TryGetValue(type, out data);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"LocalTimeKeeper\"/> to be used for this <see cref=\"SecurityCache\"/>.\n        /// This is the source of this instance's time.\n        /// </summary>\n        /// <param name=\"localTimeKeeper\">The source of this <see cref=\"Security\"/>'s time.</param>\n        public virtual void SetLocalTimeKeeper(LocalTimeKeeper localTimeKeeper)\n        {\n            UnsubscribeToTimeUpdatedEvent();\n            // Assign the new LocalTimeKeeper\n            _localTimeKeeper = localTimeKeeper;\n            SubscribeToTimeUpdatedEvent();\n        }\n\n        private void SubscribeToTimeUpdatedEvent()\n        {\n            if (!_subscribeToDateChangedEvent && _localTimeKeeper != null)\n            {\n                _subscribeToDateChangedEvent = true;\n                _localTimeKeeper.TimeUpdated += OnTimeUpdated;\n            }\n        }\n\n        private void UnsubscribeToTimeUpdatedEvent()\n        {\n            if (_localTimeKeeper != null && _subscribeToDateChangedEvent)\n            {\n                _subscribeToDateChangedEvent = false;\n                _localTimeKeeper.TimeUpdated -= OnTimeUpdated;\n            }\n        }\n\n        private void OnTimeUpdated(object sender, TimeUpdatedEventArgs e)\n        {\n            // Triggered when the algorithm sets a new local time from timeSlice.Time\n            Session?.Scan(e.Time);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void StoreDataPoint(BaseData data)\n        {\n            if (data.GetType() == typeof(Tick))\n            {\n                var tick = data as Tick;\n                switch (tick?.TickType)\n                {\n                    case TickType.Trade:\n                        _lastTickTrades = new List<BaseData> { tick };\n                        break;\n                    case TickType.Quote:\n                        _lastTickQuotes = new List<BaseData> { tick };\n                        break;\n                }\n            }\n            else\n            {\n                lock (_locker)\n                {\n                    _dataByType ??= new();\n                    // Always keep track of the last observation\n                    IReadOnlyList<BaseData> list;\n                    if (!_dataByType.TryGetValue(data.GetType(), out list))\n                    {\n                        list = new List<BaseData> { data };\n                        _dataByType[data.GetType()] = list;\n                    }\n                    else\n                    {\n                        // we KNOW this one is actually a list, so this is safe\n                        // we overwrite the zero entry so we're not constantly newing up lists\n                        ((List<BaseData>)list)[0] = data;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper method that modifies the target security cache instance to use the\n        /// type cache of the source\n        /// </summary>\n        /// <remarks>Will set in the source cache any data already present in the target cache</remarks>\n        /// <remarks>This is useful for custom data securities which also have an underlying security,\n        /// will allow both securities to access the same data by type</remarks>\n        /// <param name=\"sourceToShare\">The source cache to use</param>\n        /// <param name=\"targetToModify\">The target security cache that will be modified</param>\n        public static void ShareTypeCacheInstance(SecurityCache sourceToShare, SecurityCache targetToModify)\n        {\n            sourceToShare._dataByType ??= new();\n            if (targetToModify._dataByType != null)\n            {\n                lock (targetToModify._locker)\n                {\n                    lock (sourceToShare._locker)\n                    {\n                        foreach (var kvp in targetToModify._dataByType)\n                        {\n                            sourceToShare._dataByType.TryAdd(kvp.Key, kvp.Value);\n                        }\n                    }\n                }\n            }\n            targetToModify._dataByType = sourceToShare._dataByType;\n            targetToModify._lastTickTrades = sourceToShare._lastTickTrades;\n            targetToModify._lastTickQuotes = sourceToShare._lastTickQuotes;\n        }\n\n        /// <summary>\n        /// Applies the split to the security cache values\n        /// </summary>\n        internal void ApplySplit(Split split)\n        {\n            Price *= split.SplitFactor;\n            Open *= split.SplitFactor;\n            High *= split.SplitFactor;\n            Low *= split.SplitFactor;\n            Close *= split.SplitFactor;\n            Volume /= split.SplitFactor;\n            BidPrice *= split.SplitFactor;\n            AskPrice *= split.SplitFactor;\n            AskSize /= split.SplitFactor;\n            BidSize /= split.SplitFactor;\n\n            // Adjust values for the last data we have cached\n            Action<BaseData> scale = data => data.Scale((target, factor, _) => target * factor, 1 / split.SplitFactor, split.SplitFactor, decimal.Zero);\n            _dataByType?.Values.DoForEach(x => x.DoForEach(scale));\n            _lastTickQuotes.DoForEach(scale);\n            _lastTickTrades.DoForEach(scale);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityCacheDataStoredEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Event args for <see cref=\"SecurityCache\"/>'s DataStored event\n    /// </summary>\n    public class SecurityCacheDataStoredEventArgs : EventArgs\n    {\n        /// <summary>\n        /// The type of data that was stored, such as <see cref=\"TradeBar\"/>\n        /// </summary>\n        public Type DataType { get; }\n\n        /// <summary>\n        /// The list of data points stored\n        /// </summary>\n        public IReadOnlyList<BaseData> Data { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityCacheDataStoredEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"dataType\">The type of data</param>\n        /// <param name=\"data\">The list of data points</param>\n        public SecurityCacheDataStoredEventArgs(Type dataType, IReadOnlyList<BaseData> data)\n        {\n            Data = data;\n            DataType = dataType;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/SecurityCacheProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Index;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// A helper class that will provide <see cref=\"SecurityCache\"/> instances\n    /// </summary>\n    /// <remarks>The value of this class and its logic is performance.\n    /// This class allows for two different <see cref=\"Security\"/> to share the same\n    /// data type cache through different instances of <see cref=\"SecurityCache\"/>.\n    /// This is used to directly access custom data types through their underlying</remarks>\n    public class SecurityCacheProvider\n    {\n        private readonly Dictionary<Symbol, List<Symbol>> _relatedSymbols;\n        private readonly ISecurityProvider _securityProvider;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"securityProvider\">The security provider to use</param>\n        public SecurityCacheProvider(ISecurityProvider securityProvider)\n        {\n            _securityProvider = securityProvider;\n            _relatedSymbols = new ();\n        }\n\n        /// <summary>\n        /// Will return the <see cref=\"SecurityCache\"/> instance to use for a give Symbol.\n        /// If the provided Symbol is a custom type which has an underlying we will try to use the\n        /// underlying SecurityCache type cache, if the underlying is not present we will keep track\n        /// of the custom Symbol in case it is added later.\n        /// </summary>\n        /// <returns>The cache instance to use</returns>\n        public SecurityCache GetSecurityCache(Symbol symbol)\n        {\n            SecurityCache securityCache;\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.Equity:\n                    securityCache = new EquityCache();\n                    break;\n                case SecurityType.Option:\n                    securityCache = new OptionCache();\n                    break;\n                case SecurityType.Forex:\n                    securityCache = new ForexCache();\n                    break;\n                case SecurityType.Future:\n                    securityCache = new FutureCache();\n                    break;\n                case SecurityType.Cfd:\n                    securityCache = new CfdCache();\n                    break;\n                case SecurityType.Index:\n                    securityCache = new IndexCache();\n                    break;\n                default:\n                    securityCache = new SecurityCache();\n                    break;\n            }\n\n            // lock just in case but we do not expect this class be used by multiple consumers\n            lock (_relatedSymbols)\n            {\n                if (symbol.SecurityType == SecurityType.Base && symbol.HasUnderlying)\n                {\n                    var underlyingSecurity = _securityProvider.GetSecurity(symbol.Underlying);\n                    if (underlyingSecurity != null)\n                    {\n                        // we found the underlying, lets use its data type cache\n                        SecurityCache.ShareTypeCacheInstance(underlyingSecurity.Cache, securityCache);\n                    }\n                    else\n                    {\n                        // we didn't find the underlying, lets keep track of the underlying symbol which might get added in the future.\n                        // else when it is added, we would have to go through existing Securities and find any which use it as underlying\n                        if (!_relatedSymbols.TryGetValue(symbol.Underlying, out var relatedSymbols))\n                        {\n                            _relatedSymbols[symbol.Underlying] = relatedSymbols = new List<Symbol>();\n                        }\n                        relatedSymbols.Add(symbol);\n                    }\n                }\n                else\n                {\n                    if (_relatedSymbols.Remove(symbol, out var customSymbols))\n                    {\n                        // if we are here it means we added a symbol which is an underlying of some existing custom symbols\n                        foreach (var customSymbol in customSymbols)\n                        {\n                            var customSecurity = _securityProvider.GetSecurity(customSymbol);\n                            if (customSecurity != null)\n                            {\n                                // we make each existing custom security cache, use the new instance data type cache\n                                // note that if any data already existed in the custom cache it will be passed\n                                SecurityCache.ShareTypeCacheInstance(securityCache, customSecurity.Cache);\n                            }\n                        }\n                    }\n                }\n            }\n\n            return securityCache;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityDataFilter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities.Interfaces;\n\nnamespace QuantConnect.Securities \n{\n    /// <summary>\n    /// Base class implementation for packet by packet data filtering mechanism to dynamically detect bad ticks.\n    /// </summary>\n    public class SecurityDataFilter : ISecurityDataFilter\n    {\n        /// <summary>\n        /// Initialize data filter class\n        /// </summary>\n        public SecurityDataFilter()\n        { }\n\n        /// <summary>\n        /// Filter the data packet passing through this method by returning true to accept, or false to fail/reject the data point.\n        /// </summary>\n        /// <param name=\"data\">BasData data object we're filtering</param>\n        /// <param name=\"vehicle\">Security vehicle for filter</param>\n        public virtual bool Filter(Security vehicle, BaseData data)\n        {\n            //By default the filter does not change data.\n            return true;\n        }\n    } //End Filter\n\n} //End Namespace"
  },
  {
    "path": "Common/Securities/SecurityDataFilterPythonWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\nusing QuantConnect.Securities.Interfaces;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Python Wrapper for custom security data filters from Python\n    /// </summary>\n    public class SecurityDataFilterPythonWrapper : BasePythonWrapper<ISecurityDataFilter>, ISecurityDataFilter\n    {\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"dataFilter\">The Python class to wrapp</param>\n        public SecurityDataFilterPythonWrapper(PyObject dataFilter)\n            : base(dataFilter)\n        {\n        }\n\n        /// <summary>\n        /// Performs Filter method from Python instance returning true to accept, or false to fail/reject the data point.\n        /// </summary>\n        /// <param name=\"data\">BasData data object we're filtering</param>\n        /// <param name=\"vehicle\">Security vehicle for filter</param>\n        public bool Filter(Security vehicle, BaseData data)\n        {\n            return InvokeMethod<bool>(nameof(Filter), vehicle, data);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityDatabaseKey.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the key to a single entry in the <see cref=\"MarketHoursDatabase\"/> or the <see cref=\"SymbolPropertiesDatabase\"/>\n    /// </summary>\n    public class SecurityDatabaseKey : IEquatable<SecurityDatabaseKey>\n    {\n        /// <summary>\n        /// Represents that the specified symbol or market field will match all\n        /// </summary>\n        public const string Wildcard = \"[*]\";\n\n        /// <summary>\n        /// The market. If null, ignore market filtering\n        /// </summary>\n        public string Market { get; init; }\n\n        /// <summary>\n        /// The symbol. If null, ignore symbol filtering\n        /// </summary>\n        public string Symbol { get; init; }\n\n        /// <summary>\n        /// The security type\n        /// </summary>\n        public SecurityType SecurityType { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityDatabaseKey\"/> class\n        /// </summary>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"symbol\">The symbol. specify null to apply to all symbols in market/security type</param>\n        /// <param name=\"securityType\">The security type</param>\n        public SecurityDatabaseKey(string market, string symbol, SecurityType securityType)\n        {\n            Market = string.IsNullOrEmpty(market) ? Wildcard : market;\n            SecurityType = securityType;\n            Symbol = string.IsNullOrEmpty(symbol) ? Wildcard : symbol;\n        }\n\n        /// <summary>\n        /// Based on this entry will initializes the generic market and security type instance of the <see cref=\"SecurityDatabaseKey\"/> class\n        /// </summary>\n        public SecurityDatabaseKey CreateCommonKey()\n        {\n            return new SecurityDatabaseKey(Market, null, SecurityType);\n        }\n\n        /// <summary>\n        /// Parses the specified string as a <see cref=\"SecurityDatabaseKey\"/>\n        /// </summary>\n        /// <param name=\"key\">The string representation of the key</param>\n        /// <returns>A new <see cref=\"SecurityDatabaseKey\"/> instance</returns>\n        public static SecurityDatabaseKey Parse(string key)\n        {\n            var parts = key.Split('-');\n            if (parts.Length != 3 || parts[0] == Wildcard)\n            {\n                throw new FormatException(Messages.SecurityDatabaseKey.KeyNotInExpectedFormat(key));\n            }\n            SecurityType type;\n            if (!parts[0].TryParseSecurityType(out type))\n            {\n                return null;\n            }\n\n            return new SecurityDatabaseKey(parts[1], parts[2], type);\n        }\n\n        #region Equality members\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(SecurityDatabaseKey other)\n        {\n            if (ReferenceEquals(null, other)) return false;\n            if (ReferenceEquals(this, other)) return true;\n            return Market.Equals(other.Market, StringComparison.OrdinalIgnoreCase)\n                   && Symbol.Equals(other.Symbol, StringComparison.OrdinalIgnoreCase)\n                   && SecurityType == other.SecurityType;\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is equal to the current object.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            if (obj.GetType() != this.GetType()) return false;\n            return Equals((SecurityDatabaseKey) obj);\n        }\n\n        /// <summary>\n        /// Serves as the default hash function.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current object.\n        /// </returns>\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = StringComparer.OrdinalIgnoreCase.GetHashCode(Market);\n                hashCode = (hashCode*397) ^ StringComparer.OrdinalIgnoreCase.GetHashCode(Symbol);\n                hashCode = (hashCode*397) ^ (int) SecurityType;\n                return hashCode;\n            }\n        }\n\n        /// <summary>\n        /// Security Database Key == operator\n        /// </summary>\n        /// <returns>True if they are the same</returns>\n        public static bool operator ==(SecurityDatabaseKey left, SecurityDatabaseKey right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Security Database Key != operator\n        /// </summary>\n        /// <returns>True if they are not the same</returns>\n        public static bool operator !=(SecurityDatabaseKey left, SecurityDatabaseKey right)\n        {\n            return !Equals(left, right);\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        public override string ToString()\n        {\n            return Messages.SecurityDatabaseKey.ToString(this);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityDefinition.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Globalization;\nusing System.Collections.Generic;\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Helper class containing various unique identifiers for a given\n    /// <see cref=\"SecurityIdentifier\"/>, such as FIGI, ISIN, CUSIP, SEDOL.\n    /// </summary>\n    public class SecurityDefinition\n    {\n        /// <summary>\n        /// The unique <see cref=\"SecurityIdentifier\"/> identified by\n        /// the industry-standard security identifiers contained within this class.\n        /// </summary>\n        public SecurityIdentifier SecurityIdentifier { get; set; }\n\n        /// <summary>\n        /// The Committee on Uniform Securities Identification Procedures (CUSIP) number of a security\n        /// </summary>\n        /// <remarks>For more information on CUSIP numbers: https://en.wikipedia.org/wiki/CUSIP</remarks>\n        public string CUSIP { get; set; }\n\n        /// <summary>\n        /// The composite Financial Instrument Global Identifier (FIGI) of a security\n        /// </summary>\n        /// <remarks>\n        /// The composite FIGI differs from an exchange-level FIGI, in that it identifies\n        /// an asset across all exchanges in a single country that the asset trades in.\n        /// For more information about the FIGI standard: https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier\n        /// </remarks>\n        public string CompositeFIGI { get; set; }\n\n        /// <summary>\n        /// The Stock Exchange Daily Official List (SEDOL) security identifier of a security\n        /// </summary>\n        /// <remarks>For more information about SEDOL security identifiers: https://en.wikipedia.org/wiki/SEDOL</remarks>\n        public string SEDOL { get; set; }\n\n        /// <summary>\n        /// The International Securities Identification Number (ISIN) of a security\n        /// </summary>\n        /// <remarks>For more information about the ISIN standard: https://en.wikipedia.org/wiki/International_Securities_Identification_Number</remarks>\n        public string ISIN { get; set; }\n\n        /// <summary>\n        /// A Central Index Key or CIK number is a unique number assigned to an individual, company, filing agent or foreign government by the United States\n        /// Securities and Exchange Commission (SEC). The number is used to identify its filings in several online databases, including EDGAR.\n        /// </summary>\n        /// <remarks>For more information about CIK: https://en.wikipedia.org/wiki/Central_Index_Key</remarks>\n        public int? CIK { get; set; }\n\n        /// <summary>\n        /// Reads data from the specified file and converts it to a list of SecurityDefinition\n        /// </summary>\n        /// <param name=\"dataProvider\">Data provider used to obtain symbol mappings data</param>\n        /// <param name=\"securitiesDefinitionKey\">Location to read the securities definition data from</param>\n        /// <returns>List of security definitions</returns>\n        public static List<SecurityDefinition> Read(IDataProvider dataProvider, string securitiesDefinitionKey)\n        {\n            using var stream = dataProvider.Fetch(securitiesDefinitionKey);\n            using var reader = new StreamReader(stream);\n\n            var securityDefinitions = new List<SecurityDefinition>();\n\n            string line;\n            while ((line = reader.ReadLine()) != null)\n            {\n                if (string.IsNullOrWhiteSpace(line) || line.StartsWith(\"#\", StringComparison.InvariantCulture))\n                {\n                    continue;\n                }\n\n                securityDefinitions.Add(FromCsvLine(line));\n            }\n\n            return securityDefinitions;\n        }\n\n        /// <summary>\n        /// Attempts to read data from the specified file and convert it into a list of SecurityDefinition\n        /// </summary>\n        /// <param name=\"dataProvider\">Data provider used to obtain symbol mappings data</param>\n        /// <param name=\"securitiesDatabaseKey\">Location of the file to read from</param>\n        /// <param name=\"securityDefinitions\">Security definitions read</param>\n        /// <returns>true if data was read successfully, false otherwise</returns>\n        public static bool TryRead(IDataProvider dataProvider, string securitiesDatabaseKey, out List<SecurityDefinition> securityDefinitions)\n        {\n            try\n            {\n                securityDefinitions = Read(dataProvider, securitiesDatabaseKey);\n                return true;\n            }\n            catch\n            {\n                securityDefinitions = null;\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Parses a single line of CSV and converts it into an instance\n        /// </summary>\n        /// <param name=\"line\">Line of CSV</param>\n        /// <returns>SecurityDefinition instance</returns>\n        public static SecurityDefinition FromCsvLine(string line)\n        {\n            var csv = line.Split(',');\n            return new SecurityDefinition\n            {\n                SecurityIdentifier = SecurityIdentifier.Parse(csv[0]),\n                CUSIP = string.IsNullOrWhiteSpace(csv[1]) ? null : csv[1],\n                CompositeFIGI = string.IsNullOrWhiteSpace(csv[2]) ? null : csv[2],\n                SEDOL = string.IsNullOrWhiteSpace(csv[3]) ? null : csv[3],\n                ISIN = string.IsNullOrWhiteSpace(csv[4]) ? null : csv[4],\n                CIK = (csv.Length <= 5 || string.IsNullOrWhiteSpace(csv[5])) ? null : int.Parse(csv[5], CultureInfo.InvariantCulture)\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityDefinitionSymbolResolver.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Resolves standardized security definitions such as FIGI, CUSIP, ISIN, SEDOL into\n    /// a properly mapped Lean <see cref=\"Symbol\"/>, and vice-versa.\n    /// </summary>\n    public class SecurityDefinitionSymbolResolver\n    {\n        private static SecurityDefinitionSymbolResolver _securityDefinitionSymbolResolver;\n        private static readonly object _lock = new object();\n\n        private List<SecurityDefinition> _securityDefinitions;\n        private readonly IMapFileProvider _mapFileProvider;\n        private readonly string _securitiesDefinitionKey;\n        private readonly IDataProvider _dataProvider;\n\n        /// <summary>\n        /// Creates an instance of the symbol resolver\n        /// </summary>\n        /// <param name=\"dataProvider\">Data provider used to obtain symbol mappings data</param>\n        /// <param name=\"securitiesDefinitionKey\">Location to read the securities definition data from</param>\n        private SecurityDefinitionSymbolResolver(IDataProvider dataProvider = null, string securitiesDefinitionKey = null)\n        {\n            _securitiesDefinitionKey = securitiesDefinitionKey ?? Path.Combine(Globals.GetDataFolderPath(\"symbol-properties\"), \"security-database.csv\");\n\n            _dataProvider = dataProvider ?? Composer.Instance.GetPart<IDataProvider>();\n\n            _mapFileProvider = Composer.Instance.GetPart<IMapFileProvider>();\n            _mapFileProvider.Initialize(_dataProvider);\n        }\n\n        /// <summary>\n        /// Converts CUSIP into a Lean <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"cusip\">\n        /// The Committee on Uniform Securities Identification Procedures (CUSIP) number of a security\n        /// </param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was trading at with the CUSIP provided. This is used\n        /// to get the ticker of the symbol on this date.\n        /// </param>\n        /// <returns>The Lean Symbol corresponding to the CUSIP number on the trading date provided</returns>\n        public Symbol CUSIP(string cusip, DateTime tradingDate)\n        {\n            if (string.IsNullOrWhiteSpace(cusip))\n            {\n                return null;\n            }\n\n            return SecurityDefinitionToSymbol(\n                GetSecurityDefinitions().FirstOrDefault(x => x.CUSIP != null && x.CUSIP.Equals(cusip, StringComparison.InvariantCultureIgnoreCase)),\n                tradingDate);\n        }\n\n        /// <summary>\n        /// Converts a Lean <see cref=\"Symbol\"/> to its CUSIP number\n        /// </summary>\n        /// <param name=\"symbol\">The Lean <see cref=\"Symbol\"/></param>\n        /// <returns>The Committee on Uniform Securities Identification Procedures (CUSIP) number corresponding to the given Lean <see cref=\"Symbol\"/></returns>\n        public string CUSIP(Symbol symbol)\n        {\n            return SymbolToSecurityDefinition(symbol)?.CUSIP;\n        }\n\n        /// <summary>\n        /// Converts an asset's composite FIGI into a Lean <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"compositeFigi\">\n        /// The composite Financial Instrument Global Identifier (FIGI) of a security\n        /// </param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was trading at with the composite FIGI provided. This is used\n        /// to get the ticker of the symbol on this date.\n        /// </param>\n        /// <returns>The Lean Symbol corresponding to the composite FIGI on the trading date provided</returns>\n        public Symbol CompositeFIGI(string compositeFigi, DateTime tradingDate)\n        {\n            if (string.IsNullOrWhiteSpace(compositeFigi))\n            {\n                return null;\n            }\n\n            return SecurityDefinitionToSymbol(\n                GetSecurityDefinitions().FirstOrDefault(x => x.CompositeFIGI != null && x.CompositeFIGI.Equals(compositeFigi, StringComparison.InvariantCultureIgnoreCase)),\n                tradingDate);\n        }\n\n        /// <summary>\n        /// Converts a Lean <see cref=\"Symbol\"/> to its composite FIGI representation\n        /// </summary>\n        /// <param name=\"symbol\">The Lean <see cref=\"Symbol\"/></param>\n        /// <returns>The composite Financial Instrument Global Identifier (FIGI) corresponding to the given Lean <see cref=\"Symbol\"/></returns>\n        public string CompositeFIGI(Symbol symbol)\n        {\n            return SymbolToSecurityDefinition(symbol)?.CompositeFIGI;\n        }\n\n        /// <summary>\n        /// Converts SEDOL into a Lean <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"sedol\">\n        /// The Stock Exchange Daily Official List (SEDOL) security identifier of a security\n        /// </param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was trading at with the SEDOL provided. This is used\n        /// to get the ticker of the symbol on this date.\n        /// </param>\n        /// <returns>The Lean Symbol corresponding to the SEDOL on the trading date provided</returns>\n        public Symbol SEDOL(string sedol, DateTime tradingDate)\n        {\n            if (string.IsNullOrWhiteSpace(sedol))\n            {\n                return null;\n            }\n\n            return SecurityDefinitionToSymbol(\n                GetSecurityDefinitions().FirstOrDefault(x => x.SEDOL != null && x.SEDOL.Equals(sedol, StringComparison.InvariantCultureIgnoreCase)),\n                tradingDate);\n        }\n\n        /// <summary>\n        /// Converts a Lean <see cref=\"Symbol\"/> to its SEDOL representation\n        /// </summary>\n        /// <param name=\"symbol\">The Lean <see cref=\"Symbol\"/></param>\n        /// <returns>The Stock Exchange Daily Official List (SEDOL) security identifier corresponding to the given Lean <see cref=\"Symbol\"/></returns>\n        public string SEDOL(Symbol symbol)\n        {\n            return SymbolToSecurityDefinition(symbol)?.SEDOL;\n        }\n\n        /// <summary>\n        /// Converts ISIN into a Lean <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"isin\">\n        /// The International Securities Identification Number (ISIN) of a security\n        /// </param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was trading at with the ISIN provided. This is used\n        /// to get the ticker of the symbol on this date.\n        /// </param>\n        /// <returns>The Lean Symbol corresponding to the ISIN on the trading date provided</returns>\n        public Symbol ISIN(string isin, DateTime tradingDate)\n        {\n            if (string.IsNullOrWhiteSpace(isin))\n            {\n                return null;\n            }\n\n            return SecurityDefinitionToSymbol(\n                GetSecurityDefinitions().FirstOrDefault(x => x.ISIN != null && x.ISIN.Equals(isin, StringComparison.InvariantCultureIgnoreCase)),\n                tradingDate);\n        }\n\n        /// <summary>\n        /// Converts a Lean <see cref=\"Symbol\"/> to its ISIN representation\n        /// </summary>\n        /// <param name=\"symbol\">The Lean <see cref=\"Symbol\"/></param>\n        /// <returns>The International Securities Identification Number (ISIN) corresponding to the given Lean <see cref=\"Symbol\"/></returns>\n        public string ISIN(Symbol symbol)\n        {\n            return SymbolToSecurityDefinition(symbol)?.ISIN;\n        }\n\n        /// <summary>\n        /// Get's the CIK value associated with the given <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The Lean <see cref=\"Symbol\"/></param>\n        /// <returns>The Central Index Key number (CIK) corresponding to the given Lean <see cref=\"Symbol\"/> if any, else null</returns>\n        public int? CIK(Symbol symbol)\n        {\n            return SymbolToSecurityDefinition(symbol)?.CIK;\n        }\n\n        /// <summary>\n        /// Converts CIK into a Lean <see cref=\"Symbol\"/> array\n        /// </summary>\n        /// <param name=\"cik\">\n        /// The Central Index Key (CIK) of a company\n        /// </param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was trading at with the CIK provided. This is used\n        /// to get the ticker of the symbol on this date.\n        /// </param>\n        /// <returns>The Lean Symbols corresponding to the CIK on the trading date provided</returns>\n        public Symbol[] CIK(int cik, DateTime tradingDate)\n        {\n            if (cik == 0)\n            {\n                return Array.Empty<Symbol>();\n            }\n\n            return GetSecurityDefinitions()\n                .Where(x => x.CIK != null && x.CIK == cik)\n                .Select(securityDefinition => SecurityDefinitionToSymbol(securityDefinition, tradingDate))\n                .Where(x => x != null)\n                .ToArray();\n        }\n\n        /// <summary>\n        /// Converts a SecurityDefinition to a <see cref=\"Symbol\" />\n        /// </summary>\n        /// <param name=\"securityDefinition\">Security definition</param>\n        /// <param name=\"tradingDate\">\n        /// The date that the stock was being traded. This is used to resolve\n        /// the ticker that the stock was trading under on this date.\n        /// </param>\n        /// <returns>Symbol if matching Lean Symbol was found on the trading date, null otherwise</returns>\n        private Symbol SecurityDefinitionToSymbol(SecurityDefinition securityDefinition, DateTime tradingDate)\n        {\n            if (securityDefinition == null)\n            {\n                return null;\n            }\n\n            var mapFileResolver = _mapFileProvider.Get(AuxiliaryDataKey.Create(securityDefinition.SecurityIdentifier));\n\n            // Get the first ticker the symbol traded under, and then lookup the\n            // trading date to get the ticker on the trading date.\n            var mapFile = mapFileResolver\n                .ResolveMapFile(securityDefinition.SecurityIdentifier.Symbol, securityDefinition.SecurityIdentifier.Date);\n\n            // The mapped ticker will be null if the map file is null or there's\n            // no entry found for the given trading date.\n            var mappedTicker = mapFile?.GetMappedSymbol(tradingDate, null);\n\n            // If we're null, then try again; get the last entry of the map file and use\n            // it as the Symbol we return to the caller.\n            mappedTicker ??= mapFile?\n                .LastOrDefault()?\n                .MappedSymbol;\n\n            return string.IsNullOrWhiteSpace(mappedTicker)\n                ? null\n                : new Symbol(securityDefinition.SecurityIdentifier, mappedTicker);\n        }\n\n        /// <summary>\n        /// Gets the SecurityDefinition corresponding to the given Lean <see cref=\"Symbol\"/>\n        /// </summary>\n        private SecurityDefinition SymbolToSecurityDefinition(Symbol symbol)\n        {\n            if (symbol == null)\n            {\n                return null;\n            }\n\n            return GetSecurityDefinitions().FirstOrDefault(x => x.SecurityIdentifier.Equals(symbol.ID));\n        }\n\n        /// <summary>\n        /// Get's the security definitions using a lazy initialization\n        /// </summary>\n        private IEnumerable<SecurityDefinition> GetSecurityDefinitions()\n        {\n            lock (_lock)\n            {\n                if (_securityDefinitions == null && !SecurityDefinition.TryRead(_dataProvider, _securitiesDefinitionKey, out _securityDefinitions))\n                {\n                    _securityDefinitions = new List<SecurityDefinition>();\n                    Log.Error($\"SecurityDefinitionSymbolResolver(): No security definitions data loaded from file: {_securitiesDefinitionKey}\");\n                }\n            }\n\n            return _securityDefinitions;\n        }\n\n        /// <summary>\n        /// Gets the single instance of the symbol resolver\n        /// </summary>\n        /// <param name=\"dataProvider\">Data provider used to obtain symbol mappings data</param>\n        /// <param name=\"securitiesDefinitionKey\">Location to read the securities definition data from</param>\n        /// <returns>The single instance of the symbol resolver</returns>\n        public static SecurityDefinitionSymbolResolver GetInstance(IDataProvider dataProvider = null, string securitiesDefinitionKey = null)\n        {\n            lock (_lock)\n            {\n                if (_securityDefinitionSymbolResolver == null)\n                {\n                    _securityDefinitionSymbolResolver = new SecurityDefinitionSymbolResolver(dataProvider, securitiesDefinitionKey);\n                }\n            }\n\n            return _securityDefinitionSymbolResolver;\n        }\n\n        /// <summary>\n        /// Resets the security definition symbol resolver, forcing a reload when reused.\n        /// Called in tests where multiple algorithms are run sequentially,\n        /// and we need to guarantee that every test starts with the same environment.\n        /// </summary>\n        public static void Reset()\n        {\n            lock (_lock)\n            {\n                _securityDefinitionSymbolResolver = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Defines a base class for <see cref=\"Security\"/> related events\n    /// </summary>\n    public abstract class SecurityEventArgs\n    {\n        /// <summary>\n        /// Gets the security related to this event\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        protected SecurityEventArgs(Security security)\n        {\n            Security = security;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Base exchange class providing information and helper tools for reading the current exchange situation\n    /// </summary>\n    public class SecurityExchange\n    {\n        private LocalTimeKeeper _timeProvider;\n\n        /// <summary>\n        /// Gets the <see cref=\"SecurityExchangeHours\"/> for this exchange\n        /// </summary>\n        public SecurityExchangeHours Hours { get; private set; }\n\n        /// <summary>\n        /// Gets the time zone for this exchange\n        /// </summary>\n        public DateTimeZone TimeZone => Hours.TimeZone;\n\n        /// <summary>\n        /// Number of trading days per year for this security. By default the market is open 365 days per year.\n        /// </summary>\n        /// <remarks>Used for performance statistics to calculate sharpe ratio accurately</remarks>\n        public virtual int TradingDaysPerYear => 365;\n\n        /// <summary>\n        /// Time from the most recent data\n        /// </summary>\n        public DateTime LocalTime => _timeProvider.LocalTime;\n\n        /// <summary>\n        /// Boolean property for quickly testing if the exchange is open.\n        /// </summary>\n        public bool ExchangeOpen => Hours.IsOpen(LocalTime, false);\n\n        /// <summary>\n        /// Boolean property for quickly testing if the exchange is 10 minutes away from closing.\n        /// </summary>\n        public bool ClosingSoon => IsClosingSoon(minutesToClose:10);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityExchange\"/> class using the specified\n        /// exchange hours to determine open/close times\n        /// </summary>\n        /// <param name=\"exchangeHours\">Contains the weekly exchange schedule plus holidays</param>\n        public SecurityExchange(SecurityExchangeHours exchangeHours)\n        {\n            Hours = exchangeHours;\n        }\n\n        /// <summary>\n        /// Set the current datetime in terms of the exchange's local time zone\n        /// </summary>\n        /// <param name=\"timeProvider\">Most recent data tick</param>\n        public void SetLocalDateTimeFrontierProvider(LocalTimeKeeper timeProvider)\n        {\n            _timeProvider = timeProvider;\n        }\n\n        /// <summary>\n        /// Check if the *date* is open.\n        /// </summary>\n        /// <remarks>This is useful for first checking the date list, and then the market hours to save CPU cycles</remarks>\n        /// <param name=\"dateToCheck\">Date to check</param>\n        /// <param name=\"extendedMarketHours\">True to consider days with extended market hours only as open</param>\n        /// <returns>Return true if the exchange is open for this date</returns>\n        public bool DateIsOpen(DateTime dateToCheck, bool extendedMarketHours = false)\n        {\n            return Hours.IsDateOpen(dateToCheck, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Check if this DateTime is open.\n        /// </summary>\n        /// <param name=\"dateTime\">DateTime to check</param>\n        /// <returns>Boolean true if the market is open</returns>\n        public bool DateTimeIsOpen(DateTime dateTime)\n        {\n            return Hours.IsOpen(dateTime, false);\n        }\n\n        /// <summary>\n        /// Determines if the exchange was open at any time between start and stop\n        /// </summary>\n        public bool IsOpenDuringBar(DateTime barStartTime, DateTime barEndTime, bool isExtendedMarketHours)\n        {\n            return Hours.IsOpen(barStartTime, barEndTime, isExtendedMarketHours);\n        }\n\n        /// <summary>\n        /// Determines if the exchange is going to close in the next provided minutes\n        /// </summary>\n        /// <param name=\"minutesToClose\">Minutes to close to check</param>\n        /// <returns>Returns true if the exchange is going to close in the next provided minutes</returns>\n        public bool IsClosingSoon(int minutesToClose)\n        {\n            return !Hours.IsOpen(LocalTime.AddMinutes(minutesToClose), false);\n        }\n\n        /// <summary>\n        /// Sets the regular market hours for the specified days If no days are specified then\n        /// all days will be updated.\n        /// </summary>\n        /// <param name=\"marketHoursSegments\">Specifies each segment of the market hours, such as premarket/market/postmark</param>\n        /// <param name=\"days\">The days of the week to set these times for</param>\n        public void SetMarketHours(IEnumerable<MarketHoursSegment> marketHoursSegments, params DayOfWeek[] days)\n        {\n            if (days.IsNullOrEmpty()) days = Enum.GetValues(typeof(DayOfWeek)).OfType<DayOfWeek>().ToArray();\n\n            var marketHours = Hours.MarketHours.ToDictionary();\n            marketHoursSegments = marketHoursSegments as IList<MarketHoursSegment> ?? marketHoursSegments.ToList();\n            foreach (var day in days)\n            {\n                marketHours[day] = new LocalMarketHours(day, marketHoursSegments);\n            }\n\n            // create a new exchange hours instance for the new hours\n            Hours = new SecurityExchangeHours(Hours.TimeZone, Hours.Holidays, marketHours, Hours.EarlyCloses, Hours.LateOpens);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityExchangeHours.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing NodaTime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents the schedule of a security exchange. This includes daily regular and extended market hours\n    /// as well as holidays, early closes and late opens.\n    /// </summary>\n    /// <remarks>\n    /// This type assumes that IsOpen will be called with increasingly future times, that is, the calls should never back\n    /// track in time. This assumption is required to prevent time zone conversions on every call.\n    /// </remarks>\n    public class SecurityExchangeHours\n    {\n        private CachedLocalMarketHours _cachedMarketHours;\n\n        private HashSet<long> _holidays;\n        private HashSet<long> _bankHolidays;\n        private IReadOnlyDictionary<DateTime, TimeSpan> _earlyCloses;\n        private IReadOnlyDictionary<DateTime, TimeSpan> _lateOpens;\n\n        // these are listed individually for speed\n        private LocalMarketHours _sunday;\n        private LocalMarketHours _monday;\n        private LocalMarketHours _tuesday;\n        private LocalMarketHours _wednesday;\n        private LocalMarketHours _thursday;\n        private LocalMarketHours _friday;\n        private LocalMarketHours _saturday;\n        private Dictionary<DayOfWeek, LocalMarketHours> _openHoursByDay;\n        private static List<DayOfWeek> daysOfWeek = new List<DayOfWeek>() {\n                DayOfWeek.Sunday,\n                DayOfWeek.Monday,\n                DayOfWeek.Tuesday,\n                DayOfWeek.Wednesday,\n                DayOfWeek.Thursday,\n                DayOfWeek.Friday,\n                DayOfWeek.Saturday\n        };\n\n        /// <summary>\n        /// Gets the time zone this exchange resides in\n        /// </summary>\n        public DateTimeZone TimeZone { get; private set; }\n\n        /// <summary>\n        /// Gets the holidays for the exchange\n        /// </summary>\n        public HashSet<DateTime> Holidays\n        {\n            get { return _holidays.ToHashSet(x => new DateTime(x)); }\n        }\n\n        /// <summary>\n        /// Gets the bank holidays for the exchange\n        /// </summary>\n        /// <remarks>In some markets and assets, like CME futures, there are tradable dates (market open) which\n        /// should not be considered for expiration rules due to banks being closed</remarks>\n        public HashSet<DateTime> BankHolidays\n        {\n            get { return _bankHolidays.ToHashSet(x => new DateTime(x)); }\n        }\n\n        /// <summary>\n        /// Gets the market hours for this exchange\n        /// </summary>\n        /// <remarks>\n        /// This returns the regular schedule for each day, without taking into account special cases\n        /// such as holidays, early closes, or late opens.\n        /// In order to get the actual market hours for a specific date, use <see cref=\"GetMarketHours(DateTime)\"/>\n        /// </remarks>\n        public IReadOnlyDictionary<DayOfWeek, LocalMarketHours> MarketHours => _openHoursByDay;\n\n        /// <summary>\n        /// Gets the early closes for this exchange\n        /// </summary>\n        public IReadOnlyDictionary<DateTime, TimeSpan> EarlyCloses => _earlyCloses;\n\n        /// <summary>\n        /// Gets the late opens for this exchange\n        /// </summary>\n        public IReadOnlyDictionary<DateTime, TimeSpan> LateOpens => _lateOpens;\n\n        /// <summary>\n        /// Gets the most common tradable time during the market week.\n        /// For a normal US equity trading day this is 6.5 hours.\n        /// This does NOT account for extended market hours and only\n        /// considers <see cref=\"MarketHoursState.Market\"/>\n        /// </summary>\n        public TimeSpan RegularMarketDuration { get; private set; }\n\n        /// <summary>\n        /// Checks whether the market is always open or not\n        /// </summary>\n        public bool IsMarketAlwaysOpen { private set; get; }\n\n        /// <summary>\n        /// Gets a <see cref=\"SecurityExchangeHours\"/> instance that is always open\n        /// </summary>\n        public static SecurityExchangeHours AlwaysOpen(DateTimeZone timeZone)\n        {\n            var dayOfWeeks = Enum.GetValues(typeof(DayOfWeek)).OfType<DayOfWeek>();\n            return new SecurityExchangeHours(timeZone,\n                Enumerable.Empty<DateTime>(),\n                dayOfWeeks.Select(LocalMarketHours.OpenAllDay).ToDictionary(x => x.DayOfWeek),\n                new Dictionary<DateTime, TimeSpan>(),\n                new Dictionary<DateTime, TimeSpan>()\n                );\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityExchangeHours\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone the dates and hours are represented in</param>\n        /// <param name=\"holidayDates\">The dates this exchange is closed for holiday</param>\n        /// <param name=\"marketHoursForEachDayOfWeek\">The exchange's schedule for each day of the week</param>\n        /// <param name=\"earlyCloses\">The dates this exchange has an early close</param>\n        /// <param name=\"lateOpens\">The dates this exchange has a late open</param>\n        public SecurityExchangeHours(\n            DateTimeZone timeZone,\n            IEnumerable<DateTime> holidayDates,\n            Dictionary<DayOfWeek, LocalMarketHours> marketHoursForEachDayOfWeek,\n            IReadOnlyDictionary<DateTime, TimeSpan> earlyCloses,\n            IReadOnlyDictionary<DateTime, TimeSpan> lateOpens,\n            IEnumerable<DateTime> bankHolidayDates = null)\n        {\n            TimeZone = timeZone;\n            _holidays = holidayDates.Select(x => x.Date.Ticks).ToHashSet();\n            _bankHolidays = (bankHolidayDates ?? Enumerable.Empty<DateTime>()).Select(x => x.Date.Ticks).ToHashSet();\n            _earlyCloses = earlyCloses;\n            _lateOpens = lateOpens;\n            _openHoursByDay = marketHoursForEachDayOfWeek;\n\n            SetMarketHoursForDay(DayOfWeek.Sunday, out _sunday);\n            SetMarketHoursForDay(DayOfWeek.Monday, out _monday);\n            SetMarketHoursForDay(DayOfWeek.Tuesday, out _tuesday);\n            SetMarketHoursForDay(DayOfWeek.Wednesday, out _wednesday);\n            SetMarketHoursForDay(DayOfWeek.Thursday, out _thursday);\n            SetMarketHoursForDay(DayOfWeek.Friday, out _friday);\n            SetMarketHoursForDay(DayOfWeek.Saturday, out _saturday);\n\n            // pick the most common market hours duration, if there's a tie, pick the larger duration\n            RegularMarketDuration = _openHoursByDay.Values.GroupBy(lmh => lmh.MarketDuration)\n                .OrderByDescending(grp => grp.Count())\n                .ThenByDescending(grp => grp.Key)\n                .First().Key;\n\n            IsMarketAlwaysOpen = CheckIsMarketAlwaysOpen();\n        }\n\n        /// <summary>\n        /// Determines if the exchange is open at the specified local date time.\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to check represented as a local time</param>\n        /// <param name=\"extendedMarketHours\">True to use the extended market hours, false for just regular market hours</param>\n        /// <returns>True if the exchange is considered open at the specified time, false otherwise</returns>\n        public bool IsOpen(DateTime localDateTime, bool extendedMarketHours)\n        {\n            return GetMarketHours(localDateTime).IsOpen(localDateTime.TimeOfDay, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Determines if the exchange is open at any point in time over the specified interval.\n        /// </summary>\n        /// <param name=\"startLocalDateTime\">The start of the interval in local time</param>\n        /// <param name=\"endLocalDateTime\">The end of the interval in local time</param>\n        /// <param name=\"extendedMarketHours\">True to use the extended market hours, false for just regular market hours</param>\n        /// <returns>True if the exchange is considered open at the specified time, false otherwise</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsOpen(DateTime startLocalDateTime, DateTime endLocalDateTime, bool extendedMarketHours)\n        {\n            if (startLocalDateTime == endLocalDateTime)\n            {\n                // if we're testing an instantaneous moment, use the other function\n                return IsOpen(startLocalDateTime, extendedMarketHours);\n            }\n\n            // we must make intra-day requests to LocalMarketHours, so check for a day gap\n            var start = startLocalDateTime;\n            var end = new DateTime(Math.Min(endLocalDateTime.Ticks, start.Date.Ticks + Time.OneDay.Ticks - 1));\n            do\n            {\n                // check to see if the market is open\n                var marketHours = GetMarketHours(start);\n                if (marketHours.IsOpen(start.TimeOfDay, end.TimeOfDay, extendedMarketHours))\n                {\n                    return true;\n                }\n\n                start = start.Date.AddDays(1);\n                end = new DateTime(Math.Min(endLocalDateTime.Ticks, end.Ticks + Time.OneDay.Ticks));\n            }\n            while (end > start);\n\n            return false;\n        }\n\n        /// <summary>\n        /// Determines if the exchange will be open on the date specified by the local date time\n        /// </summary>\n        /// <param name=\"localDateTime\">The date time to check if the day is open</param>\n        /// <param name=\"extendedMarketHours\">True to consider days with extended market hours only as open</param>\n        /// <returns>True if the exchange will be open on the specified date, false otherwise</returns>\n        public bool IsDateOpen(DateTime localDateTime, bool extendedMarketHours = false)\n        {\n            var marketHours = GetMarketHours(localDateTime);\n            if (marketHours.IsClosedAllDay)\n            {\n                // if we don't have hours for this day then we're not open\n                return false;\n            }\n\n            if (marketHours.MarketDuration == TimeSpan.Zero)\n            {\n                // this date only has extended market hours, like sunday for futures, so we only return true if 'extendedMarketHours'\n                return extendedMarketHours;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the first market open to the specified previous date\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for the last market open (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The previous market opening date time to the specified local date time</returns>\n        public DateTime GetFirstDailyMarketOpen(DateTime localDateTime, bool extendedMarketHours)\n        {\n            return GetPreviousMarketOpen(localDateTime, extendedMarketHours, firstOpen: true);\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the previous market open to the specified time\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for the last market open (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The previous market opening date time to the specified local date time</returns>\n        public DateTime GetPreviousMarketOpen(DateTime localDateTime, bool extendedMarketHours)\n        {\n            return GetPreviousMarketOpen(localDateTime, extendedMarketHours, firstOpen: false);\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the previous market open to the specified time\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for the last market open (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The previous market opening date time to the specified local date time</returns>\n        public DateTime GetPreviousMarketOpen(DateTime localDateTime, bool extendedMarketHours, bool firstOpen)\n        {\n            var time = localDateTime;\n            var marketHours = GetMarketHours(time);\n            var nextMarketOpen = GetNextMarketOpen(time, extendedMarketHours);\n\n            if (localDateTime == nextMarketOpen)\n            {\n                return localDateTime;\n            }\n\n            // let's loop for a week\n            for (int i = 0; i < 7; i++)\n            {\n                DateTime? potentialResult = null;\n                foreach (var segment in marketHours.Segments.Reverse())\n                {\n                    if ((time.Date + segment.Start <= localDateTime) &&\n                        (segment.State == MarketHoursState.Market || extendedMarketHours))\n                    {\n                        var timeOfDay = time.Date + segment.Start;\n                        if (firstOpen)\n                        {\n                            potentialResult = timeOfDay;\n                        }\n                        // Check the current segment is not part of another segment before\n                        else if (GetNextMarketOpen(timeOfDay.AddTicks(-1), extendedMarketHours) == timeOfDay)\n                        {\n                            return timeOfDay;\n                        }\n                    }\n                }\n\n                if (potentialResult.HasValue)\n                {\n                    return potentialResult.Value;\n                }\n\n                time = time.AddDays(-1);\n                marketHours = GetMarketHours(time);\n            }\n\n            throw new InvalidOperationException(Messages.SecurityExchangeHours.LastMarketOpenNotFound(localDateTime, IsMarketAlwaysOpen));\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the next market open following the specified time\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for market open (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The next market opening date time following the specified local date time</returns>\n        public DateTime GetNextMarketOpen(DateTime localDateTime, bool extendedMarketHours)\n        {\n            var time = localDateTime;\n            var oneWeekLater = localDateTime.Date.AddDays(15);\n\n            var lastDay = time.Date.AddDays(-1);\n            var lastDayMarketHours = GetMarketHours(lastDay);\n            var lastDaySegment = lastDayMarketHours.Segments.LastOrDefault();\n            do\n            {\n                var marketHours = GetMarketHours(time);\n                if (!marketHours.IsClosedAllDay && !_holidays.Contains(time.Date.Ticks))\n                {\n                    var marketOpenTimeOfDay = marketHours.GetMarketOpen(time.TimeOfDay, extendedMarketHours, lastDaySegment?.End);\n                    if (marketOpenTimeOfDay.HasValue)\n                    {\n                        var marketOpen = time.Date + marketOpenTimeOfDay.Value;\n                        if (localDateTime < marketOpen)\n                        {\n                            return marketOpen;\n                        }\n                    }\n\n                    // If there was an early close the market opens until next day first segment,\n                    // so we don't take into account continuous segments between days, then\n                    // lastDaySegment should be null\n                    if (_earlyCloses.ContainsKey(time.Date))\n                    {\n                        lastDaySegment = null;\n                    }\n                    else\n                    {\n                        lastDaySegment = marketHours.Segments.LastOrDefault();\n                    }\n                }\n                else\n                {\n                    lastDaySegment = null;\n                }\n\n                time = time.Date + Time.OneDay;\n            }\n            while (time < oneWeekLater);\n\n            throw new ArgumentException(Messages.SecurityExchangeHours.UnableToLocateNextMarketOpenInTwoWeeks(IsMarketAlwaysOpen));\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the last market close following the specified date\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for market close (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The next market closing date time following the specified local date time</returns>\n        public DateTime GetLastDailyMarketClose(DateTime localDateTime, bool extendedMarketHours)\n        {\n            return GetNextMarketClose(localDateTime, extendedMarketHours, lastClose: true);\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the next market close following the specified time\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for market close (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <returns>The next market closing date time following the specified local date time</returns>\n        public DateTime GetNextMarketClose(DateTime localDateTime, bool extendedMarketHours)\n        {\n            return GetNextMarketClose(localDateTime, extendedMarketHours, lastClose: false);\n        }\n\n        /// <summary>\n        /// Gets the local date time corresponding to the next market close following the specified time\n        /// </summary>\n        /// <param name=\"localDateTime\">The time to begin searching for market close (non-inclusive)</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours in the search</param>\n        /// <param name=\"lastClose\">True if the last available close of the date should be returned, else the first will be used</param>\n        /// <returns>The next market closing date time following the specified local date time</returns>\n        public DateTime GetNextMarketClose(DateTime localDateTime, bool extendedMarketHours, bool lastClose)\n        {\n            var time = localDateTime;\n            var oneWeekLater = localDateTime.Date.AddDays(15);\n            do\n            {\n                var marketHours = GetMarketHours(time);\n                if (!marketHours.IsClosedAllDay && !_holidays.Contains(time.Date.Ticks))\n                {\n                    // Get next day first segment. This is made because we need to check the segment returned\n                    // by GetMarketClose() ends at segment.End and not continues in the next segment. We get\n                    // the next day first segment for the case in which the next market close is the last segment\n                    // of the current day\n                    var nextSegment = GetNextOrPreviousSegment(time, isNextDay: true);\n                    var marketCloseTimeOfDay = marketHours.GetMarketClose(time.TimeOfDay, extendedMarketHours, lastClose, nextSegment?.Start);\n                    if (marketCloseTimeOfDay.HasValue)\n                    {\n                        var marketClose = time.Date + marketCloseTimeOfDay.Value;\n                        if (localDateTime < marketClose)\n                        {\n                            return marketClose;\n                        }\n                    }\n                }\n\n                time = time.Date + Time.OneDay;\n            }\n            while (time < oneWeekLater);\n\n            throw new ArgumentException(Messages.SecurityExchangeHours.UnableToLocateNextMarketCloseInTwoWeeks(IsMarketAlwaysOpen));\n        }\n\n        /// <summary>\n        /// Returns next day first segment or previous day last segment\n        /// </summary>\n        /// <param name=\"time\">Time of reference</param>\n        /// <param name=\"isNextDay\">True to get next day first segment. False to get previous day last segment</param>\n        /// <returns>Next day first segment or previous day last segment</returns>\n        private MarketHoursSegment GetNextOrPreviousSegment(DateTime time, bool isNextDay)\n        {\n            var nextOrPrevious = isNextDay ? 1 : -1;\n            var nextOrPreviousDay = time.Date.AddDays(nextOrPrevious);\n            if (_earlyCloses.ContainsKey(nextOrPreviousDay.Date))\n            {\n                return null;\n            }\n\n            var segments = GetMarketHours(nextOrPreviousDay).Segments;\n            return isNextDay ? segments.FirstOrDefault() : segments.LastOrDefault();\n        }\n\n        /// <summary>\n        /// Check whether the market is always open or not\n        /// </summary>\n        /// <returns>True if the market is always open, false otherwise</returns>\n        private bool CheckIsMarketAlwaysOpen()\n        {\n            LocalMarketHours marketHours = null;\n            for (var i = 0; i < daysOfWeek.Count; i++)\n            {\n                var day = daysOfWeek[i];\n                switch (day)\n                {\n                    case DayOfWeek.Sunday:\n                        marketHours = _sunday;\n                        break;\n                    case DayOfWeek.Monday:\n                        marketHours = _monday;\n                        break;\n                    case DayOfWeek.Tuesday:\n                        marketHours = _tuesday;\n                        break;\n                    case DayOfWeek.Wednesday:\n                        marketHours = _wednesday;\n                        break;\n                    case DayOfWeek.Thursday:\n                        marketHours = _thursday;\n                        break;\n                    case DayOfWeek.Friday:\n                        marketHours = _friday;\n                        break;\n                    case DayOfWeek.Saturday:\n                        marketHours = _saturday;\n                        break;\n                }\n\n                if (!marketHours.IsOpenAllDay)\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Helper to extract market hours from the <see cref=\"_openHoursByDay\"/> dictionary, filling\n        /// in Closed instantes when not present\n        /// </summary>\n        private void SetMarketHoursForDay(DayOfWeek dayOfWeek, out LocalMarketHours localMarketHoursForDay)\n        {\n            if (!_openHoursByDay.TryGetValue(dayOfWeek, out localMarketHoursForDay))\n            {\n                // assign to our dictionary that we're closed this day, as well as our local field\n                _openHoursByDay[dayOfWeek] = localMarketHoursForDay = LocalMarketHours.ClosedAllDay(dayOfWeek);\n            }\n        }\n\n        /// <summary>\n        /// Helper to access the market hours field based on the day of week\n        /// </summary>\n        /// <param name=\"localDateTime\">The local date time to retrieve market hours for</param>\n        /// <remarks>\n        /// This method will return an adjusted instance of <see cref=\"LocalMarketHours\"/> for the specified date,\n        /// that is, it will account for holidays, early closes, and late opens (e.g. if the security trades regularly on Mondays,\n        /// but a specific Monday is a holiday, this method will return a <see cref=\"LocalMarketHours\"/> that is closed all day).\n        /// In order to get the regular schedule, use the <see cref=\"MarketHours\"/> property.\n        /// </remarks>\n        public LocalMarketHours GetMarketHours(DateTime localDateTime)\n        {\n            var cachedMarketHours = _cachedMarketHours;\n            if (cachedMarketHours?.Date == localDateTime.Date)\n            {\n                return cachedMarketHours.LocalMarketHours;\n            }\n\n            if (_holidays.Contains(localDateTime.Date.Ticks))\n            {\n                var result = LocalMarketHours.ClosedAllDay(localDateTime.DayOfWeek);\n                _cachedMarketHours = new(result, localDateTime);\n                return result;\n            }\n\n            LocalMarketHours marketHours;\n            switch (localDateTime.DayOfWeek)\n            {\n                case DayOfWeek.Sunday:\n                    marketHours = _sunday;\n                    break;\n                case DayOfWeek.Monday:\n                    marketHours = _monday;\n                    break;\n                case DayOfWeek.Tuesday:\n                    marketHours = _tuesday;\n                    break;\n                case DayOfWeek.Wednesday:\n                    marketHours = _wednesday;\n                    break;\n                case DayOfWeek.Thursday:\n                    marketHours = _thursday;\n                    break;\n                case DayOfWeek.Friday:\n                    marketHours = _friday;\n                    break;\n                case DayOfWeek.Saturday:\n                    marketHours = _saturday;\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(localDateTime), localDateTime, null);\n            }\n\n            var hasEarlyClose = _earlyCloses.TryGetValue(localDateTime.Date, out var earlyCloseTime);\n            var hasLateOpen = _lateOpens.TryGetValue(localDateTime.Date, out var lateOpenTime);\n            if (!hasEarlyClose && !hasLateOpen)\n            {\n                _cachedMarketHours = new(marketHours, localDateTime);\n                return marketHours;\n            }\n\n            IReadOnlyList<MarketHoursSegment> marketHoursSegments = marketHours.Segments;\n\n            // If the earlyCloseTime is between a segment, change the close time with it\n            // and add it after the segments prior to the earlyCloseTime\n            // Otherwise, just take the segments prior to the earlyCloseTime\n            List<MarketHoursSegment> segmentsEarlyClose = null;\n            if (hasEarlyClose)\n            {\n                var index = marketHoursSegments.Count;\n                MarketHoursSegment newSegment = null;\n                for (var i = 0; i < marketHoursSegments.Count; i++)\n                {\n                    var segment = marketHoursSegments[i];\n                    if (segment.Start <= earlyCloseTime && earlyCloseTime <= segment.End)\n                    {\n                        newSegment = new MarketHoursSegment(segment.State, segment.Start, earlyCloseTime);\n                        index = i;\n                        break;\n                    }\n                    else if (earlyCloseTime < segment.Start)\n                    {\n                        // we will drop any remaining segment starting by this one\n                        index = i - 1;\n                        break;\n                    }\n                }\n\n                segmentsEarlyClose = new List<MarketHoursSegment>(marketHoursSegments.Take(index));\n                if (newSegment != null)\n                {\n                    segmentsEarlyClose.Add(newSegment);\n                }\n            }\n\n            // It could be the case we have a late open after an early close (the market resumes after the early close), in that case, we should take\n            // the segments before the early close and the the segments after the late opens and append them. Therefore, if that's not the case, this is,\n            // if there was an early close but there is not a late open or it's before the early close, we need to update the variable marketHours with\n            // the value of newMarketHours, so that it contains the segments before the early close\n            if (segmentsEarlyClose != null && (!hasLateOpen || earlyCloseTime >= lateOpenTime))\n            {\n                marketHoursSegments = segmentsEarlyClose;\n            }\n\n            // If the lateOpenTime is between a segment, change the start time with it\n            // and add it before the segments previous to the lateOpenTime\n            // Otherwise, just take the segments previous to the lateOpenTime\n            List<MarketHoursSegment> segmentsLateOpen = null;\n            if (hasLateOpen)\n            {\n                var index = 0;\n                segmentsLateOpen = new List<MarketHoursSegment>();\n                for (var i = 0; i < marketHoursSegments.Count; i++)\n                {\n                    var segment = marketHoursSegments[i];\n                    if (segment.Start <= lateOpenTime && lateOpenTime <= segment.End)\n                    {\n                        segmentsLateOpen.Add(new(segment.State, lateOpenTime, segment.End));\n                        index = i + 1;\n                        break;\n                    }\n                    else if (lateOpenTime < segment.Start)\n                    {\n                        index = i;\n                        break;\n                    }\n                }\n\n                segmentsLateOpen.AddRange(marketHoursSegments.TakeLast(marketHoursSegments.Count - index));\n                marketHoursSegments = segmentsLateOpen;\n            }\n\n            // Since it could be the case we have a late open after an early close (the market resumes after the early close), we need to take\n            // the segments before the early close and the segments after the late open and append them to obtain the expected market hours\n            if (segmentsEarlyClose != null && hasLateOpen && earlyCloseTime <= lateOpenTime)\n            {\n                segmentsEarlyClose.AddRange(segmentsLateOpen);\n                marketHoursSegments = segmentsEarlyClose;\n            }\n\n            marketHours = new LocalMarketHours(localDateTime.DayOfWeek, marketHoursSegments);\n            _cachedMarketHours = new(marketHours, localDateTime);\n            return marketHours;\n        }\n\n        /// <summary>\n        /// Gets the previous trading day\n        /// </summary>\n        /// <param name=\"localDate\">The date to start searching at in this exchange's time zones</param>\n        /// <returns>The previous trading day</returns>\n        public DateTime GetPreviousTradingDay(DateTime localDate)\n        {\n            localDate = localDate.AddDays(-1);\n            while (!IsDateOpen(localDate))\n            {\n                localDate = localDate.AddDays(-1);\n            }\n\n            return localDate;\n        }\n\n        /// <summary>\n        /// Gets the next trading day\n        /// </summary>\n        /// <param name=\"date\">The date to start searching at</param>\n        /// <returns>The next trading day</returns>\n        public DateTime GetNextTradingDay(DateTime date)\n        {\n            date = date.AddDays(1);\n            while (!IsDateOpen(date))\n            {\n                date = date.AddDays(1);\n            }\n\n            return date;\n        }\n\n        /// <summary>\n        /// Sets the exchange hours to be the same as the given exchange hours without changing the reference\n        /// </summary>\n        /// <param name=\"other\">The hours to set</param>\n        internal void Update(SecurityExchangeHours other)\n        {\n            if (other == null)\n            {\n                return;\n            }\n\n            _cachedMarketHours = null;\n            _holidays = other._holidays;\n            _earlyCloses = other._earlyCloses;\n            _lateOpens = other._lateOpens;\n            _sunday = other._sunday;\n            _monday = other._monday;\n            _tuesday = other._tuesday;\n            _wednesday = other._wednesday;\n            _thursday = other._thursday;\n            _friday = other._friday;\n            _saturday = other._saturday;\n            _openHoursByDay = other._openHoursByDay;\n            TimeZone = other.TimeZone;\n            RegularMarketDuration = other.RegularMarketDuration;\n            IsMarketAlwaysOpen = other.IsMarketAlwaysOpen;\n        }\n\n        private class CachedLocalMarketHours\n        {\n            public LocalMarketHours LocalMarketHours { get; }\n            public DateTime Date { get; }\n            public CachedLocalMarketHours(LocalMarketHours localMarketHours, DateTime date)\n            {\n                LocalMarketHours = localMarketHours;\n                Date = date.Date;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityHolding.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// SecurityHolding is a base class for purchasing and holding a market item which manages the asset portfolio\n    /// </summary>\n    public class SecurityHolding\n    {\n        /// <summary>\n        /// Event raised each time the holdings quantity is changed.\n        /// </summary>\n        public event EventHandler<SecurityHoldingQuantityChangedEventArgs> QuantityChanged;\n\n        //Working Variables\n        private bool _invested;\n        private decimal _averagePrice;\n        private decimal _quantity;\n        private decimal _price;\n        private decimal _totalSaleVolume;\n        private decimal _profit;\n        private decimal _lastTradeProfit;\n        private decimal _totalFees;\n        private decimal _totalDividends;\n        private readonly Security _security;\n        private readonly ICurrencyConverter _currencyConverter;\n\n        /// <summary>\n        /// Create a new holding class instance setting the initial properties to $0.\n        /// </summary>\n        /// <param name=\"security\">The security being held</param>\n        /// <param name=\"currencyConverter\">A currency converter instance</param>\n        public SecurityHolding(Security security, ICurrencyConverter currencyConverter)\n        {\n            _security = security;\n            //Total Sales Volume for the day\n            _totalSaleVolume = 0;\n            _lastTradeProfit = 0;\n            _currencyConverter = currencyConverter;\n        }\n\n        /// <summary>\n        /// Create a new holding class instance copying the initial properties\n        /// </summary>\n        /// <param name=\"holding\">The security being held</param>\n        protected SecurityHolding(SecurityHolding holding)\n        {\n            _security = holding._security;\n            _averagePrice = holding._averagePrice;\n            Quantity = holding._quantity;\n            _price = holding._price;\n            _totalSaleVolume = holding._totalSaleVolume;\n            _profit = holding._profit;\n            _lastTradeProfit = holding._lastTradeProfit;\n            _totalFees = holding._totalFees;\n            _currencyConverter = holding._currencyConverter;\n        }\n\n        /// <summary>\n        /// The security being held\n        /// </summary>\n        protected Security Security\n        {\n            get\n            {\n                return _security;\n            }\n        }\n\n        /// <summary>\n        /// Gets the current target holdings for this security\n        /// </summary>\n        public IPortfolioTarget Target\n        {\n            get; set;\n        }\n\n        /// <summary>\n        /// Average price of the security holdings.\n        /// </summary>\n        public decimal AveragePrice\n        {\n            get\n            {\n                return _averagePrice;\n            }\n            protected set\n            {\n                _averagePrice = value;\n            }\n        }\n\n        /// <summary>\n        /// Quantity of the security held.\n        /// </summary>\n        /// <remarks>Positive indicates long holdings, negative quantity indicates a short holding</remarks>\n        /// <seealso cref=\"AbsoluteQuantity\"/>\n        public decimal Quantity\n        {\n            get\n            {\n                return _quantity;\n            }\n            protected set\n            {\n                // avoid any small values, due to differences in lot size, to return invested true but lean not allowing us to trade sice it will be rounded down to 0\n                // specially useful to crypto assets which take fees from the base or quote currency\n                _invested = Math.Abs(value) >= _security.SymbolProperties.LotSize;\n                _quantity = value;\n            }\n        }\n\n        /// <summary>\n        /// Symbol identifier of the underlying security.\n        /// </summary>\n        public Symbol Symbol\n        {\n            get\n            {\n                return _security.Symbol;\n            }\n        }\n\n        /// <summary>\n        /// The security type of the symbol\n        /// </summary>\n        public SecurityType Type\n        {\n            get\n            {\n                return _security.Type;\n            }\n        }\n\n        /// <summary>\n        /// Leverage of the underlying security.\n        /// </summary>\n        public virtual decimal Leverage\n        {\n            get\n            {\n                return _security.BuyingPowerModel.GetLeverage(_security);\n            }\n        }\n\n        /// <summary>\n        /// Acquisition cost of the security total holdings in units of the account's currency.\n        /// </summary>\n        public virtual decimal HoldingsCost\n        {\n            get\n            {\n                if (Quantity == 0)\n                {\n                    return 0;\n                }\n                return GetQuantityValue(Quantity, AveragePrice).InAccountCurrency;\n            }\n        }\n\n        /// <summary>\n        /// Unlevered Acquisition cost of the security total holdings in units of the account's currency.\n        /// </summary>\n        public virtual decimal UnleveredHoldingsCost\n        {\n            get { return HoldingsCost/Leverage; }\n        }\n\n        /// <summary>\n        /// Current market price of the security.\n        /// </summary>\n        public virtual decimal Price\n        {\n            get\n            {\n                return _price;\n            }\n            protected set\n            {\n                _price = value;\n            }\n        }\n\n        /// <summary>\n        /// Absolute holdings cost for current holdings in units of the account's currency.\n        /// </summary>\n        /// <seealso cref=\"HoldingsCost\"/>\n        public virtual decimal AbsoluteHoldingsCost\n        {\n            get\n            {\n                return Math.Abs(HoldingsCost);\n            }\n        }\n\n        /// <summary>\n        /// Unlevered absolute acquisition cost of the security total holdings in units of the account's currency.\n        /// </summary>\n        public virtual decimal UnleveredAbsoluteHoldingsCost\n        {\n            get\n            {\n                return Math.Abs(UnleveredHoldingsCost);\n            }\n        }\n\n        /// <summary>\n        /// Market value of our holdings in units of the account's currency.\n        /// </summary>\n        public virtual decimal HoldingsValue\n        {\n            get\n            {\n                if (Quantity == 0)\n                {\n                    return 0;\n                }\n\n                return GetQuantityValue(Quantity).InAccountCurrency;\n            }\n        }\n\n        /// <summary>\n        /// Absolute of the market value of our holdings in units of the account's currency.\n        /// </summary>\n        /// <seealso cref=\"HoldingsValue\"/>\n        public virtual decimal AbsoluteHoldingsValue\n        {\n            get { return Math.Abs(HoldingsValue); }\n        }\n\n        /// <summary>\n        /// Boolean flag indicating if we hold any of the security\n        /// </summary>\n        public virtual bool HoldStock => _invested;\n\n        /// <summary>\n        /// Boolean flag indicating if we hold any of the security\n        /// </summary>\n        /// <remarks>Alias of HoldStock</remarks>\n        /// <seealso cref=\"HoldStock\"/>\n        public virtual bool Invested => _invested;\n\n        /// <summary>\n        /// The total transaction volume for this security since the algorithm started in units of the account's currency.\n        /// </summary>\n        public virtual decimal TotalSaleVolume\n        {\n            get { return _totalSaleVolume; }\n        }\n\n        /// <summary>\n        /// Total fees for this company since the algorithm started in units of the account's currency.\n        /// </summary>\n        public virtual decimal TotalFees\n        {\n            get { return _totalFees; }\n        }\n\n        /// <summary>\n        /// Total dividends for this company since the algorithm started in units of the account's currency.\n        /// </summary>\n        public virtual decimal TotalDividends\n        {\n            get { return _totalDividends; }\n        }\n\n        /// <summary>\n        /// Boolean flag indicating we have a net positive holding of the security.\n        /// </summary>\n        /// <seealso cref=\"IsShort\"/>\n        public virtual bool IsLong\n        {\n            get\n            {\n                return Quantity > 0;\n            }\n        }\n\n        /// <summary>\n        /// BBoolean flag indicating we have a net negative holding of the security.\n        /// </summary>\n        /// <seealso cref=\"IsLong\"/>\n        public virtual bool IsShort\n        {\n            get\n            {\n                return Quantity < 0;\n            }\n        }\n\n        /// <summary>\n        /// Absolute quantity of holdings of this security\n        /// </summary>\n        /// <seealso cref=\"Quantity\"/>\n        public virtual decimal AbsoluteQuantity\n        {\n            get\n            {\n                return Math.Abs(Quantity);\n            }\n        }\n\n        /// <summary>\n        /// Record of the closing profit from the last trade conducted in units of the account's currency.\n        /// </summary>\n        public virtual decimal LastTradeProfit\n        {\n            get\n            {\n                return _lastTradeProfit;\n            }\n        }\n\n        /// <summary>\n        /// Calculate the total profit for this security in units of the account's currency.\n        /// </summary>\n        /// <seealso cref=\"NetProfit\"/>\n        public virtual decimal Profit\n        {\n            get { return _profit + _totalDividends; }\n        }\n\n        /// <summary>\n        /// Return the net for this company measured by the profit less fees in units of the account's currency.\n        /// </summary>\n        /// <seealso cref=\"Profit\"/>\n        /// <seealso cref=\"TotalFees\"/>\n        public virtual decimal NetProfit\n        {\n            get\n            {\n                return Profit - TotalFees;\n            }\n        }\n\n        /// <summary>\n        /// Gets the unrealized profit as a percentage of holdings cost\n        /// </summary>\n        public virtual decimal UnrealizedProfitPercent\n        {\n            get\n            {\n                if (AbsoluteHoldingsCost == 0) return 0m;\n                return UnrealizedProfit/AbsoluteHoldingsCost;\n            }\n        }\n\n        /// <summary>\n        /// Unrealized profit of this security when absolute quantity held is more than zero in units of the account's currency.\n        /// </summary>\n        public virtual decimal UnrealizedProfit\n        {\n            get { return TotalCloseProfit(); }\n        }\n\n        /// <summary>\n        /// Adds a fee to the running total of total fees in units of the account's currency.\n        /// </summary>\n        /// <param name=\"newFee\"></param>\n        public void AddNewFee(decimal newFee)\n        {\n            _totalFees += newFee;\n        }\n\n        /// <summary>\n        /// Adds a profit record to the running total of profit in units of the account's currency.\n        /// </summary>\n        /// <param name=\"profitLoss\">The cash change in portfolio from closing a position</param>\n        public void AddNewProfit(decimal profitLoss)\n        {\n            _profit += profitLoss;\n        }\n\n        /// <summary>\n        /// Adds a new sale value to the running total trading volume in units of the account's currency.\n        /// </summary>\n        /// <param name=\"saleValue\"></param>\n        public void AddNewSale(decimal saleValue)\n        {\n            _totalSaleVolume += saleValue;\n        }\n\n        /// <summary>\n        /// Adds a new dividend payment to the running total dividend in units of the account's currency.\n        /// </summary>\n        /// <param name=\"dividend\"></param>\n        public void AddNewDividend(decimal dividend)\n        {\n            _totalDividends += dividend;\n        }\n\n        /// <summary>\n        /// Set the last trade profit for this security from a Portfolio.ProcessFill call in units of the account's currency.\n        /// </summary>\n        /// <param name=\"lastTradeProfit\">Value of the last trade profit</param>\n        public void SetLastTradeProfit(decimal lastTradeProfit)\n        {\n            _lastTradeProfit = lastTradeProfit;\n        }\n\n        /// <summary>\n        /// Set the quantity of holdings and their average price after processing a portfolio fill.\n        /// </summary>\n        public virtual void SetHoldings(decimal averagePrice, int quantity)\n        {\n            SetHoldings(averagePrice, (decimal) quantity);\n        }\n\n        /// <summary>\n        /// Set the quantity of holdings and their average price after processing a portfolio fill.\n        /// </summary>\n        public virtual void SetHoldings(decimal averagePrice, decimal quantity)\n        {\n            var previousQuantity = _quantity;\n            var previousAveragePrice = _averagePrice;\n\n            Quantity = quantity;\n            _averagePrice = averagePrice;\n\n            OnQuantityChanged(previousAveragePrice, previousQuantity);\n        }\n\n        /// <summary>\n        /// Update local copy of closing price value.\n        /// </summary>\n        /// <param name=\"closingPrice\">Price of the underlying asset to be used for calculating market price / portfolio value</param>\n        public virtual void UpdateMarketPrice(decimal closingPrice)\n        {\n            _price = closingPrice;\n        }\n\n        /// <summary>\n        /// Gets the total value of the specified <paramref name=\"quantity\"/> of shares of this security\n        /// in the account currency\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of shares</param>\n        /// <returns>The value of the quantity of shares in the account currency</returns>\n        public virtual ConvertibleCashAmount GetQuantityValue(decimal quantity)\n        {\n            return GetQuantityValue(quantity, _price);\n        }\n\n        /// <summary>\n        /// Gets the total value of the specified <paramref name=\"quantity\"/> of shares of this security\n        /// in the account currency\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of shares</param>\n        /// <param name=\"price\">The current price</param>\n        /// <returns>The value of the quantity of shares in the account currency</returns>\n        public virtual ConvertibleCashAmount GetQuantityValue(decimal quantity, decimal price)\n        {\n            var amount = price * quantity * _security.SymbolProperties.ContractMultiplier;\n            return new ConvertibleCashAmount(amount, _security.QuoteCurrency);\n        }\n\n        /// <summary>\n        /// Profit if we closed the holdings right now including the approximate fees in units of the account's currency.\n        /// </summary>\n        /// <remarks>Does not use the transaction model for market fills but should.</remarks>\n        public virtual decimal TotalCloseProfit(bool includeFees = true, decimal? exitPrice = null, decimal? entryPrice = null, decimal? quantity = null)\n        {\n            var quantityToUse = Quantity;\n            if (quantity.HasValue)\n            {\n                quantityToUse = quantity.Value;\n            }\n            else if (!_invested)\n            {\n                return 0;\n            }\n\n            var feesInAccountCurrency = 0m;\n            if (includeFees)\n            {\n                // this is in the account currency\n                var liquidationFees = Extensions.GetMarketOrderFees(_security, -quantityToUse, _security.LocalTime.ConvertToUtc(_security.Exchange.TimeZone));\n                feesInAccountCurrency = _currencyConverter.ConvertToAccountCurrency(liquidationFees).Amount;\n            }\n\n            // if we are long, we would need to sell against the bid\n            var price = IsLong ? _security.BidPrice : _security.AskPrice;\n            if (price == 0)\n            {\n                // Bid/Ask prices can both be equal to 0. This usually happens when we request our holdings from\n                // the brokerage, but only the last trade price was provided.\n                price = _security.Price;\n            }\n\n            var entryValue = GetQuantityValue(quantityToUse, entryPrice ?? AveragePrice).InAccountCurrency;\n            var potentialExitValue = GetQuantityValue(quantityToUse, exitPrice ?? price).InAccountCurrency;\n            return potentialExitValue - entryValue - feesInAccountCurrency;\n        }\n\n        /// <summary>\n        /// Writes out the properties of this instance to string\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.SecurityHolding.ToString(this);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"QuantityChanged\"/> event\n        /// </summary>\n        protected virtual void OnQuantityChanged(decimal previousAveragePrice, decimal previousQuantity)\n        {\n            QuantityChanged?.Invoke(this, new SecurityHoldingQuantityChangedEventArgs(\n                _security, previousAveragePrice, previousQuantity\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityHoldingQuantityChangedEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"SecurityHolding.QuantityChanged\"/> event.\n    /// The event data contains the previous quantity/price. The current quantity/price\n    /// can be accessed via the <see cref=\"SecurityEventArgs.Security\"/> property\n    /// </summary>\n    public class SecurityHoldingQuantityChangedEventArgs : SecurityEventArgs\n    {\n        /// <summary>\n        /// Gets the holdings quantity before this change\n        /// </summary>\n        public decimal PreviousQuantity { get; }\n\n        /// <summary>\n        /// Gets the average holdings price before this change\n        /// </summary>\n        public decimal PreviousAveragePrice { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityHoldingQuantityChangedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"previousAveragePrice\">The security's previous average holdings price</param>\n        /// <param name=\"previousQuantity\">The security's previous holdings quantity</param>\n        public SecurityHoldingQuantityChangedEventArgs(\n            Security security,\n            decimal previousAveragePrice,\n            decimal previousQuantity\n            )\n            : base(security)\n        {\n            PreviousQuantity = previousQuantity;\n            PreviousAveragePrice = previousAveragePrice;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Collections;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Enumerable security management class for grouping security objects into an array and providing any common properties.\n    /// </summary>\n    /// <remarks>Implements IDictionary for the index searching of securities by symbol</remarks>\n    public class SecurityManager : ExtendedDictionary<Symbol, Security>, IDictionary<Symbol, Security>, INotifyCollectionChanged\n    {\n        /// <summary>\n        /// Event fired when a security is added or removed from this collection\n        /// </summary>\n        public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n        private readonly ITimeKeeper _timeKeeper;\n\n        //Internal dictionary implementation:\n        private readonly Dictionary<Symbol, Security> _securityManager;\n        private readonly Dictionary<Symbol, Security> _completeSecuritiesCollection;\n        // let's keep ah thread safe enumerator created which we reset and recreate if required\n        private List<Symbol> _enumeratorKeys;\n        private List<Security> _enumeratorValues;\n        private List<KeyValuePair<Symbol, Security>> _enumerator;\n        private SecurityService _securityService;\n\n        /// <summary>\n        /// Gets the most recent time this manager was updated\n        /// </summary>\n        public DateTime UtcTime\n        {\n            get { return _timeKeeper.UtcTime; }\n        }\n\n        /// <summary>\n        /// Initialise the algorithm security manager with two empty dictionaries\n        /// </summary>\n        /// <param name=\"timeKeeper\"></param>\n        public SecurityManager(ITimeKeeper timeKeeper)\n        {\n            _timeKeeper = timeKeeper;\n            _securityManager = new();\n            _completeSecuritiesCollection = new();\n        }\n\n        /// <summary>\n        /// Add a new security with this symbol to the collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <param name=\"symbol\">symbol for security we're trading</param>\n        /// <param name=\"security\">security object</param>\n        /// <seealso cref=\"Add(Security)\"/>\n        public void Add(Symbol symbol, Security security)\n        {\n            bool changed;\n            lock (_securityManager)\n            {\n                changed = _securityManager.TryAdd(symbol, security);\n                if (changed)\n                {\n                    _completeSecuritiesCollection[symbol] = security;\n                }\n            }\n\n            if (changed)\n            {\n                security.SetLocalTimeKeeper(_timeKeeper.GetLocalTimeKeeper(security.Exchange.TimeZone));\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, security));\n            }\n        }\n\n        /// <summary>\n        /// Add a new security with this symbol to the collection.\n        /// </summary>\n        /// <param name=\"security\">security object</param>\n        public void Add(Security security)\n        {\n            Add(security.Symbol, security);\n        }\n\n        /// <summary>\n        /// Add a symbol-security by its key value pair.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <param name=\"pair\"></param>\n        public void Add(KeyValuePair<Symbol, Security> pair)\n        {\n            Add(pair.Key, pair.Value);\n        }\n\n        /// <summary>\n        /// Clear the securities array to delete all the portfolio and asset information.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        public override void Clear()\n        {\n            lock (_securityManager)\n            {\n                _enumerator = null;\n                _enumeratorKeys = null;\n                _enumeratorValues = null;\n                _securityManager.Clear();\n                _completeSecuritiesCollection.Clear();\n            }\n        }\n\n        /// <summary>\n        /// Check if this collection contains this key value pair.\n        /// </summary>\n        /// <param name=\"pair\">Search key-value pair</param>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Bool true if contains this key-value pair</returns>\n        public bool Contains(KeyValuePair<Symbol, Security> pair)\n        {\n            lock (_securityManager)\n            {\n                return _completeSecuritiesCollection.Contains(pair);\n            }\n        }\n\n        /// <summary>\n        /// Check if this collection contains this symbol.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol we're checking for.</param>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Bool true if contains this symbol pair</returns>\n        public override bool ContainsKey(Symbol symbol)\n        {\n            lock (_securityManager)\n            {\n                return _completeSecuritiesCollection.ContainsKey(symbol);\n            }\n        }\n\n        /// <summary>\n        /// Copy from the internal array to an external array.\n        /// </summary>\n        /// <param name=\"array\">Array we're outputting to</param>\n        /// <param name=\"number\">Starting index of array</param>\n        /// <remarks>IDictionary implementation</remarks>\n        public void CopyTo(KeyValuePair<Symbol, Security>[] array, int number)\n        {\n            lock (_securityManager)\n            {\n                ((IDictionary<Symbol, Security>)_securityManager).CopyTo(array, number);\n            }\n        }\n\n        /// <summary>\n        /// Count of the number of securities in the collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        public override int Count\n        {\n            get\n            {\n                lock (_securityManager)\n                {\n                    return _securityManager.Count;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Flag indicating if the internal array is read only.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        public override bool IsReadOnly\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// Remove a key value of of symbol-securities from the collections.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <param name=\"pair\">Key Value pair of symbol-security to remove</param>\n        /// <returns>Boolean true on success</returns>\n        public bool Remove(KeyValuePair<Symbol, Security> pair)\n        {\n            return Remove(pair.Key);\n        }\n\n        /// <summary>\n        /// Remove this symbol security: Dictionary interface implementation.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol we're searching for</param>\n        /// <returns>true success</returns>\n        public override bool Remove(Symbol symbol)\n        {\n            Security security;\n            lock (_securityManager)\n            {\n                _securityManager.Remove(symbol, out security);\n            }\n\n            if (security != null)\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, security));\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// List of the symbol-keys in the collection of securities.\n        /// </summary>\n        /// <remarks>Excludes non active or delisted securities</remarks>\n        public ICollection<Symbol> Keys\n        {\n            get\n            {\n                var result = _enumeratorKeys;\n                if (result == null)\n                {\n                    lock (_securityManager)\n                    {\n                        _enumeratorKeys = result = _securityManager.Keys.ToList();\n                    }\n                }\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Try and get this security object with matching symbol and return true on success.\n        /// </summary>\n        /// <param name=\"symbol\">String search symbol</param>\n        /// <param name=\"security\">Output Security object</param>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>True on successfully locating the security object</returns>\n        public override bool TryGetValue(Symbol symbol, out Security security)\n        {\n            lock (_securityManager)\n            {\n                return _completeSecuritiesCollection.TryGetValue(symbol, out security);\n            }\n        }\n\n        /// <summary>\n        /// Gets an <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the Symbol objects of the <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <remarks>Excludes non active or delisted securities</remarks>\n        /// <returns>\n        /// An <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the Symbol objects of the object that implements <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </returns>\n        protected override IEnumerable<Symbol> GetKeys => Keys;\n\n        /// <summary>\n        /// Gets an <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the values in the <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <remarks>Excludes non active or delisted securities</remarks>\n        /// <returns>\n        /// An <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the values in the object that implements <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </returns>\n        protected override IEnumerable<Security> GetValues => Values;\n\n        /// <summary>\n        /// Get a list of the security objects for this collection.\n        /// </summary>\n        /// <remarks>Excludes non active or delisted securities</remarks>\n        public ICollection<Security> Values\n        {\n            get\n            {\n                var result = _enumeratorValues;\n                if (result == null)\n                {\n                    lock (_securityManager)\n                    {\n                        _enumeratorValues = result = _securityManager.Values.ToList();\n                    }\n                }\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Get a list of the complete security objects for this collection, including non active or delisted securities\n        /// </summary>\n        public ICollection<Security> Total\n        {\n            get\n            {\n                ICollection<Security> result;\n                lock (_securityManager)\n                {\n                    result = _completeSecuritiesCollection.Values.ToList();\n                }\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Get the enumerator for this security collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Enumerable key value pair</returns>\n        IEnumerator<KeyValuePair<Symbol, Security>> IEnumerable<KeyValuePair<Symbol, Security>>.GetEnumerator()\n        {\n            return GetEnumeratorImplementation();\n        }\n\n        /// <summary>\n        /// Get the enumerator for this securities collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Enumerator.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumeratorImplementation();\n        }\n\n        private List<KeyValuePair<Symbol, Security>> GetEnumerable()\n        {\n            var result = _enumerator;\n            if (result == null)\n            {\n                lock (_securityManager)\n                {\n                    _enumerator = result = _securityManager.ToList();\n                }\n            }\n            return result;\n        }\n\n        private List<KeyValuePair<Symbol, Security>>.Enumerator GetEnumeratorImplementation()\n        {\n            return GetEnumerable().GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<Symbol, Security>> GetItems() => GetEnumerable();\n\n        /// <summary>\n        /// Indexer method for the security manager to access the securities objects by their symbol.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <param name=\"symbol\">Symbol object indexer</param>\n        /// <returns>Security</returns>\n        public override Security this[Symbol symbol]\n        {\n            get\n            {\n                Security security;\n                lock (_securityManager)\n                {\n                    if (!_completeSecuritiesCollection.TryGetValue(symbol, out security))\n                    {\n                        CheckForImplicitlyCreatedSymbol(symbol);\n                        throw new KeyNotFoundException(Messages.SecurityManager.SymbolNotFoundInSecurities(symbol));\n                    }\n                }\n                return security;\n            }\n            set\n            {\n                Security existing;\n                lock (_securityManager)\n                {\n                    if (_securityManager.TryGetValue(symbol, out existing) && existing != value)\n                    {\n                        throw new ArgumentException(Messages.SecurityManager.UnableToOverwriteSecurity(symbol));\n                    }\n                }\n\n                // no security exists for the specified symbol key, add it now\n                if (existing == null)\n                {\n                    Add(symbol, value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"CollectionChanged\"/> event\n        /// </summary>\n        /// <param name=\"changedEventArgs\">Event arguments for the <see cref=\"CollectionChanged\"/> event</param>\n        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs changedEventArgs)\n        {\n            _enumerator = null;\n            _enumeratorKeys = null;\n            _enumeratorValues = null;\n            CollectionChanged?.Invoke(this, changedEventArgs);\n        }\n\n        /// <summary>\n        /// Sets the Security Service to be used\n        /// </summary>\n        public void SetSecurityService(SecurityService securityService)\n        {\n            _securityService = securityService;\n        }\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        public Security CreateSecurity(\n            Symbol symbol,\n            List<SubscriptionDataConfig> subscriptionDataConfigList,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null)\n        {\n            return _securityService.CreateSecurity(symbol, subscriptionDataConfigList, leverage, addToSymbolCache, underlying);\n        }\n\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        public Security CreateSecurity(\n            Symbol symbol,\n            SubscriptionDataConfig subscriptionDataConfig,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null\n            )\n        {\n            return _securityService.CreateSecurity(symbol, subscriptionDataConfig, leverage, addToSymbolCache, underlying);\n        }\n\n        /// <summary>\n        /// Creates a new benchmark security\n        /// </summary>\n        public Security CreateBenchmarkSecurity(Symbol symbol)\n        {\n            return _securityService.CreateBenchmarkSecurity(symbol);\n        }\n\n        /// <summary>\n        /// Set live mode state of the algorithm\n        /// </summary>\n        /// <param name=\"isLiveMode\">True, live mode is enabled</param>\n        public void SetLiveMode(bool isLiveMode)\n        {\n            _securityService.SetLiveMode(isLiveMode);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityMarginModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a simple, constant margin model by specifying the percentages of required margin.\n    /// </summary>\n    public class SecurityMarginModel : BuyingPowerModel\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityMarginModel\"/> with no leverage (1x)\n        /// </summary>\n        public SecurityMarginModel()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityMarginModel\"/>\n        /// </summary>\n        /// <param name=\"initialMarginRequirement\">The percentage of an order's absolute cost\n        /// that must be held in free cash in order to place the order</param>\n        /// <param name=\"maintenanceMarginRequirement\">The percentage of the holding's absolute\n        /// cost that must be held in free cash in order to avoid a margin call</param>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required\n        /// unused buying power for the account.</param>\n        public SecurityMarginModel(\n            decimal initialMarginRequirement,\n            decimal maintenanceMarginRequirement,\n            decimal requiredFreeBuyingPowerPercent\n            )\n            : base(initialMarginRequirement, maintenanceMarginRequirement, requiredFreeBuyingPowerPercent)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityMarginModel\"/>\n        /// </summary>\n        /// <param name=\"leverage\">The leverage</param>\n        /// <param name=\"requiredFreeBuyingPowerPercent\">The percentage used to determine the required\n        /// unused buying power for the account.</param>\n        public SecurityMarginModel(decimal leverage, decimal requiredFreeBuyingPowerPercent = 0)\n            : base(leverage, requiredFreeBuyingPowerPercent)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/SecurityPortfolioManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Python;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Portfolio manager class groups popular properties and makes them accessible through one interface.\n    /// It also provide indexing by the vehicle symbol to get the Security.Holding objects.\n    /// </summary>\n    public class SecurityPortfolioManager : ExtendedDictionary<Symbol, SecurityHolding>, IDictionary<Symbol, SecurityHolding>, ISecurityProvider\n    {\n        private Cash _baseCurrencyCash;\n        private bool _setCashWasCalled;\n        private decimal _totalPortfolioValue;\n        private bool _isTotalPortfolioValueValid;\n        private object _totalPortfolioValueLock = new();\n        private bool _setAccountCurrencyWasCalled;\n        private decimal _freePortfolioValue;\n        private SecurityPositionGroupModel _positions;\n        private IAlgorithmSettings _algorithmSettings;\n\n        /// <summary>\n        /// Local access to the securities collection for the portfolio summation.\n        /// </summary>\n        public SecurityManager Securities { get; init; }\n\n        /// <summary>\n        /// Local access to the transactions collection for the portfolio summation and updates.\n        /// </summary>\n        public SecurityTransactionManager Transactions { get; init; }\n\n        /// <summary>\n        /// Local access to the position manager\n        /// </summary>\n        public SecurityPositionGroupModel Positions\n        {\n            get\n            {\n                return _positions;\n            }\n            set\n            {\n                value?.Initialize(Securities);\n                _positions = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the cash book that keeps track of all currency holdings (only settled cash)\n        /// </summary>\n        public CashBook CashBook { get; }\n\n        /// <summary>\n        /// Gets the cash book that keeps track of all currency holdings (only unsettled cash)\n        /// </summary>\n        public CashBook UnsettledCashBook { get; }\n\n        /// <summary>\n        /// Initialise security portfolio manager.\n        /// </summary>\n        public SecurityPortfolioManager(SecurityManager securityManager, SecurityTransactionManager transactions, IAlgorithmSettings algorithmSettings, IOrderProperties defaultOrderProperties = null)\n        {\n            Securities = securityManager;\n            Transactions = transactions;\n            _algorithmSettings = algorithmSettings;\n            Positions = new SecurityPositionGroupModel();\n            MarginCallModel = new DefaultMarginCallModel(this, defaultOrderProperties);\n\n            CashBook = new CashBook();\n            UnsettledCashBook = new CashBook();\n\n            _baseCurrencyCash = CashBook[CashBook.AccountCurrency];\n\n            // default to $100,000.00\n            _baseCurrencyCash.SetAmount(100000);\n\n            CashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    // add the same currency entry to the unsettled cashbook as well\n                    var cash = args.Cash;\n                    var unsettledCash = new Cash(cash.Symbol, 0m, cash.ConversionRate);\n                    unsettledCash.CurrencyConversion = cash.CurrencyConversion;\n\n                    cash.CurrencyConversionUpdated += (sender, args) =>\n                    {\n                        // Share the currency conversion instance between the settled and unsettled cash instances to synchronize the conversion rates\n                        UnsettledCashBook[((Cash)sender).Symbol].CurrencyConversion = cash.CurrencyConversion;\n                    };\n\n                    UnsettledCashBook.Add(cash.Symbol, unsettledCash);\n                }\n\n                InvalidateTotalPortfolioValue();\n            };\n            UnsettledCashBook.Updated += (sender, args) => InvalidateTotalPortfolioValue();\n        }\n\n        #region IDictionary Implementation\n\n        /// <summary>\n        /// Add a new securities string-security to the portfolio.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol of dictionary</param>\n        /// <param name=\"holding\">SecurityHoldings object</param>\n        /// <exception cref=\"NotImplementedException\">Portfolio object is an adaptor for Security Manager. This method is not applicable for PortfolioManager class.</exception>\n        /// <remarks>This method is not implemented and using it will throw an exception</remarks>\n        public void Add(Symbol symbol, SecurityHolding holding) { throw new NotImplementedException(Messages.SecurityPortfolioManager.DictionaryAddNotImplemented); }\n\n        /// <summary>\n        /// Add a new securities key value pair to the portfolio.\n        /// </summary>\n        /// <param name=\"pair\">Key value pair of dictionary</param>\n        /// <exception cref=\"NotImplementedException\">Portfolio object is an adaptor for Security Manager. This method is not applicable for PortfolioManager class.</exception>\n        /// <remarks>This method is not implemented and using it will throw an exception</remarks>\n        public void Add(KeyValuePair<Symbol, SecurityHolding> pair) { throw new NotImplementedException(Messages.SecurityPortfolioManager.DictionaryAddNotImplemented); }\n\n        /// <summary>\n        /// Clear the portfolio of securities objects.\n        /// </summary>\n        /// <exception cref=\"NotImplementedException\">Portfolio object is an adaptor for Security Manager. This method is not applicable for PortfolioManager class.</exception>\n        /// <remarks>This method is not implemented and using it will throw an exception</remarks>\n        public override void Clear() { throw new NotImplementedException(Messages.SecurityPortfolioManager.DictionaryClearNotImplemented); }\n\n        /// <summary>\n        /// Remove this keyvalue pair from the portfolio.\n        /// </summary>\n        /// <exception cref=\"NotImplementedException\">Portfolio object is an adaptor for Security Manager. This method is not applicable for PortfolioManager class.</exception>\n        /// <param name=\"pair\">Key value pair of dictionary</param>\n        /// <remarks>This method is not implemented and using it will throw an exception</remarks>\n        public bool Remove(KeyValuePair<Symbol, SecurityHolding> pair) { throw new NotImplementedException(Messages.SecurityPortfolioManager.DictionaryRemoveNotImplemented); }\n\n        /// <summary>\n        /// Remove this symbol from the portfolio.\n        /// </summary>\n        /// <exception cref=\"NotImplementedException\">Portfolio object is an adaptor for Security Manager. This method is not applicable for PortfolioManager class.</exception>\n        /// <param name=\"symbol\">Symbol of dictionary</param>\n        /// <remarks>This method is not implemented and using it will throw an exception</remarks>\n        public override bool Remove(Symbol symbol) { throw new NotImplementedException(Messages.SecurityPortfolioManager.DictionaryRemoveNotImplemented); }\n\n        /// <summary>\n        /// Check if the portfolio contains this symbol string.\n        /// </summary>\n        /// <param name=\"symbol\">String search symbol for the security</param>\n        /// <returns>Boolean true if portfolio contains this symbol</returns>\n        public override bool ContainsKey(Symbol symbol)\n        {\n            return Securities.ContainsKey(symbol);\n        }\n\n        /// <summary>\n        /// Check if the key-value pair is in the portfolio.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying Securities collection</remarks>\n        /// <param name=\"pair\">Pair we're searching for</param>\n        /// <returns>True if we have this object</returns>\n        public bool Contains(KeyValuePair<Symbol, SecurityHolding> pair)\n        {\n            return Securities.ContainsKey(pair.Key);\n        }\n\n        /// <summary>\n        /// Count the securities objects in the portfolio.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying Securities collection</remarks>\n        public override int Count\n        {\n            get\n            {\n                return Securities.Count;\n            }\n        }\n\n        /// <summary>\n        /// Check if the underlying securities array is read only.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying Securities collection</remarks>\n        public override bool IsReadOnly\n        {\n            get\n            {\n                return Securities.IsReadOnly;\n            }\n        }\n\n        /// <summary>\n        /// Copy contents of the portfolio collection to a new destination.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying Securities collection</remarks>\n        /// <param name=\"array\">Destination array</param>\n        /// <param name=\"index\">Position in array to start copying</param>\n        public void CopyTo(KeyValuePair<Symbol, SecurityHolding>[] array, int index)\n        {\n            array = new KeyValuePair<Symbol, SecurityHolding>[Securities.Count];\n            var i = 0;\n            foreach (var asset in Securities.Values)\n            {\n                if (i >= index)\n                {\n                    array[i] = new KeyValuePair<Symbol, SecurityHolding>(asset.Symbol, asset.Holdings);\n                }\n                i++;\n            }\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<Symbol, SecurityHolding>> GetItems() =>\n            Securities.GetItems().Select(kvp => KeyValuePair.Create(kvp.Key, kvp.Value.Holdings));\n\n        /// <summary>\n        /// Gets an <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the Symbol objects of the <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the Symbol objects of the object that implements <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </returns>\n        protected override IEnumerable<Symbol> GetKeys => Keys;\n\n        /// <summary>\n        /// Gets an <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the values in the <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"System.Collections.Generic.ICollection{T}\"/> containing the values in the object that implements <see cref=\"System.Collections.Generic.IDictionary{TKey, TValue}\"/>.\n        /// </returns>\n        protected override IEnumerable<SecurityHolding> GetValues => Securities.Select(pair => pair.Value.Holdings);\n\n        /// <summary>\n        /// Symbol keys collection of the underlying assets in the portfolio.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying securities key symbols</remarks>\n        public ICollection<Symbol> Keys\n        {\n            get\n            {\n                return Securities.Keys;\n            }\n        }\n\n        /// <summary>\n        /// Collection of securities objects in the portfolio.\n        /// </summary>\n        /// <remarks>IDictionary implementation calling the underlying securities values collection</remarks>\n        public ICollection<SecurityHolding> Values\n        {\n            get\n            {\n                return GetValues.ToList();\n            }\n        }\n\n        /// <summary>\n        /// Attempt to get the value of the securities holding class if this symbol exists.\n        /// </summary>\n        /// <param name=\"symbol\">String search symbol</param>\n        /// <param name=\"holding\">Holdings object of this security</param>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Boolean true if successful locating and setting the holdings object</returns>\n        public override bool TryGetValue(Symbol symbol, out SecurityHolding holding)\n        {\n            Security security;\n            var success = Securities.TryGetValue(symbol, out security);\n            holding = success ? security.Holdings : null;\n            return success;\n        }\n\n        /// <summary>\n        /// Get the enumerator for the underlying securities collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Enumerable key value pair</returns>\n        IEnumerator<KeyValuePair<Symbol, SecurityHolding>> IEnumerable<KeyValuePair<Symbol, SecurityHolding>>.GetEnumerator()\n        {\n            return Securities.Select(x => new KeyValuePair<Symbol, SecurityHolding>(x.Key, x.Value.Holdings)).GetEnumerator();\n        }\n\n        /// <summary>\n        /// Get the enumerator for the underlying securities collection.\n        /// </summary>\n        /// <remarks>IDictionary implementation</remarks>\n        /// <returns>Enumerator</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return Securities.Select(x => new KeyValuePair<Symbol, SecurityHolding>(x.Key, x.Value.Holdings)).GetEnumerator();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Sum of all currencies in account in US dollars (only settled cash)\n        /// </summary>\n        /// <remarks>\n        /// This should not be mistaken for margin available because Forex uses margin\n        /// even though the total cash value is not impact\n        /// </remarks>\n        public decimal Cash\n        {\n            get { return CashBook.TotalValueInAccountCurrency; }\n        }\n\n        /// <summary>\n        /// Sum of all currencies in account in US dollars (only unsettled cash)\n        /// </summary>\n        /// <remarks>\n        /// This should not be mistaken for margin available because Forex uses margin\n        /// even though the total cash value is not impact\n        /// </remarks>\n        public decimal UnsettledCash\n        {\n            get { return UnsettledCashBook.TotalValueInAccountCurrency; }\n        }\n\n        /// <summary>\n        /// Absolute value of cash discounted from our total cash by the holdings we own.\n        /// </summary>\n        /// <remarks>When account has leverage the actual cash removed is a fraction of the purchase price according to the leverage</remarks>\n        public decimal TotalUnleveredAbsoluteHoldingsCost\n        {\n            get\n            {\n                return Securities.Values.Sum(security => security.Holdings.UnleveredAbsoluteHoldingsCost);\n            }\n        }\n\n        /// <summary>\n        /// Gets the total absolute holdings cost of the portfolio. This sums up the individual\n        /// absolute cost of each holding\n        /// </summary>\n        public decimal TotalAbsoluteHoldingsCost\n        {\n            get\n            {\n                return Securities.Values.Sum(security => security.Holdings.AbsoluteHoldingsCost);\n            }\n        }\n\n        /// <summary>\n        /// Absolute sum the individual items in portfolio.\n        /// </summary>\n        public decimal TotalHoldingsValue\n        {\n            get\n            {\n                //Sum sum of holdings\n                return Securities.Values.Sum(security => security.Holdings.AbsoluteHoldingsValue);\n            }\n        }\n\n        /// <summary>\n        /// Boolean flag indicating we have any holdings in the portfolio.\n        /// </summary>\n        /// <remarks>Assumes no asset can have $0 price and uses the sum of total holdings value</remarks>\n        /// <seealso cref=\"Invested\"/>\n        public bool HoldStock\n        {\n            get\n            {\n                foreach (var security in Securities.Values)\n                {\n                    if (security.HoldStock)\n                    {\n                        return true;\n                    }\n                }\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Alias for HoldStock. Check if we have any holdings.\n        /// </summary>\n        /// <seealso cref=\"HoldStock\"/>\n        public bool Invested => HoldStock;\n\n        /// <summary>\n        /// Get the total unrealised profit in our portfolio from the individual security unrealized profits.\n        /// </summary>\n        public decimal TotalUnrealisedProfit\n        {\n            get\n            {\n                return Securities.Values.Sum(security => security.Holdings.UnrealizedProfit);\n            }\n        }\n\n        /// <summary>\n        /// Get the total unrealised profit in our portfolio from the individual security unrealized profits.\n        /// </summary>\n        /// <remarks>Added alias for American spelling</remarks>\n        public decimal TotalUnrealizedProfit\n        {\n            get { return TotalUnrealisedProfit; }\n        }\n\n        /// <summary>\n        /// Total portfolio value if we sold all holdings at current market rates.\n        /// </summary>\n        /// <remarks>Cash + TotalUnrealisedProfit + TotalUnleveredAbsoluteHoldingsCost</remarks>\n        /// <seealso cref=\"Cash\"/>\n        /// <seealso cref=\"TotalUnrealizedProfit\"/>\n        /// <seealso cref=\"TotalUnleveredAbsoluteHoldingsCost\"/>\n        public decimal TotalPortfolioValue\n        {\n            get\n            {\n                lock (_totalPortfolioValueLock)\n                {\n                    if (!_isTotalPortfolioValueValid)\n                    {\n                        decimal totalHoldingsValueWithoutForexCryptoFutureCfd = 0;\n                        decimal totalFuturesAndCfdHoldingsValue = 0;\n                        foreach (var security in Securities.Values.Where((x) => x.Holdings.Invested))\n                        {\n                            var position = security;\n                            var securityType = position.Type;\n                            // We can't include forex in this calculation since we would be double accounting with respect to the cash book\n                            // We also exclude futures and CFD as they are calculated separately because they do not impact the account's cash.\n                            // We include futures options as part of this calculation because IB chooses to change our account's cash balance\n                            // when we buy or sell a futures options contract.\n                            if (securityType != SecurityType.Forex && securityType != SecurityType.Crypto\n                                && securityType != SecurityType.Future && securityType != SecurityType.Cfd\n                                && securityType != SecurityType.CryptoFuture)\n                            {\n                                totalHoldingsValueWithoutForexCryptoFutureCfd += position.Holdings.HoldingsValue;\n                            }\n\n                            // CFDs don't impact account cash, so they must be calculated\n                            // by applying the unrealized P&L to the cash balance.\n                            if (securityType == SecurityType.Cfd || securityType == SecurityType.CryptoFuture)\n                            {\n                                totalFuturesAndCfdHoldingsValue += position.Holdings.UnrealizedProfit;\n                            }\n                            // Futures P&L is settled daily into cash, here we take into account the current days unsettled profit\n                            if (securityType == SecurityType.Future)\n                            {\n                                var futureHoldings = (FutureHolding)position.Holdings;\n                                totalFuturesAndCfdHoldingsValue += futureHoldings.UnsettledProfit;\n                            }\n                        }\n\n                        _totalPortfolioValue = CashBook.TotalValueInAccountCurrency +\n                           UnsettledCashBook.TotalValueInAccountCurrency +\n                           totalHoldingsValueWithoutForexCryptoFutureCfd +\n                           totalFuturesAndCfdHoldingsValue;\n\n                        _isTotalPortfolioValueValid = true;\n                    }\n                }\n\n                return _totalPortfolioValue;\n            }\n        }\n\n        /// <summary>\n        /// Returns the adjusted total portfolio value removing the free amount\n        /// If the <see cref=\"IAlgorithmSettings.FreePortfolioValue\"/> has not been set, the free amount will have a trailing behavior and be updated when requested\n        /// </summary>\n        public decimal TotalPortfolioValueLessFreeBuffer\n        {\n            get\n            {\n                if (_algorithmSettings.FreePortfolioValue.HasValue)\n                {\n                    // the user set it, we will respect the value set\n                    _freePortfolioValue = _algorithmSettings.FreePortfolioValue.Value;\n                }\n                else\n                {\n                    // keep the free portfolio value up to date every time we use it\n                    _freePortfolioValue = TotalPortfolioValue * _algorithmSettings.FreePortfolioValuePercentage;\n                }\n\n                return TotalPortfolioValue - _freePortfolioValue;\n\n            }\n        }\n\n        /// <summary>\n        /// Will flag the current <see cref=\"TotalPortfolioValue\"/> as invalid\n        /// so it is recalculated when gotten\n        /// </summary>\n        public void InvalidateTotalPortfolioValue()\n        {\n            _isTotalPortfolioValueValid = false;\n        }\n\n        /// <summary>\n        /// Total fees paid during the algorithm operation across all securities in portfolio.\n        /// </summary>\n        public decimal TotalFees\n        {\n            get\n            {\n                return Securities.Total.Sum(security => security.Holdings.TotalFees);\n            }\n        }\n\n        /// <summary>\n        /// Sum of all gross profit across all securities in portfolio and dividend payments.\n        /// </summary>\n        public decimal TotalProfit\n        {\n            get\n            {\n                return Securities.Total.Sum(security => security.Holdings.Profit);\n            }\n        }\n\n        /// <summary>\n        /// Sum of all net profit across all securities in portfolio and dividend payments.\n        /// </summary>\n        public decimal TotalNetProfit\n        {\n            get\n            {\n                return Securities.Total.Sum(security => security.Holdings.NetProfit);\n            }\n        }\n\n        /// <summary>\n        /// Total sale volume since the start of algorithm operations.\n        /// </summary>\n        public decimal TotalSaleVolume\n        {\n            get\n            {\n                return Securities.Total.Sum(security => security.Holdings.TotalSaleVolume);\n            }\n        }\n\n        /// <summary>\n        /// Gets the total margin used across all securities in the account's currency\n        /// </summary>\n        public decimal TotalMarginUsed\n        {\n            get\n            {\n                decimal sum = 0;\n                foreach (var group in Positions.Groups)\n                {\n                    sum += group.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(this, group);\n                }\n\n                return sum;\n            }\n        }\n\n        /// <summary>\n        /// Gets the remaining margin on the account in the account's currency\n        /// </summary>\n        /// <see cref=\"GetMarginRemaining(decimal)\"/>\n        public decimal MarginRemaining => GetMarginRemaining(TotalPortfolioValue);\n\n        /// <summary>\n        /// Gets the remaining margin on the account in the account's currency\n        /// for the given total portfolio value\n        /// </summary>\n        /// <remarks>This method is for performance, for when the user already knows\n        /// the total portfolio value, we can avoid re calculating it. Else use\n        /// <see cref=\"MarginRemaining\"/></remarks>\n        /// <param name=\"totalPortfolioValue\">The total portfolio value <see cref=\"TotalPortfolioValue\"/></param>\n        public decimal GetMarginRemaining(decimal totalPortfolioValue)\n        {\n            return totalPortfolioValue - UnsettledCashBook.TotalValueInAccountCurrency - TotalMarginUsed;\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"MarginCallModel\"/> for the portfolio. This\n        /// is used to executed margin call orders.\n        /// </summary>\n        public IMarginCallModel MarginCallModel { get; set; }\n\n        /// <summary>\n        /// Indexer for the PortfolioManager class to access the underlying security holdings objects.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol object indexer</param>\n        /// <returns>SecurityHolding class from the algorithm securities</returns>\n        public override SecurityHolding this[Symbol symbol]\n        {\n            get\n            {\n                return Securities[symbol].Holdings;\n            }\n            set\n            {\n                Securities[symbol].Holdings = value;\n            }\n        }\n\n        /// <summary>\n        /// Sets the account currency cash symbol this algorithm is to manage, as well\n        /// as the starting cash in this currency if given\n        /// </summary>\n        /// <remarks>Has to be called before calling <see cref=\"SetCash(decimal)\"/>\n        /// or adding any <see cref=\"Security\"/></remarks>\n        /// <param name=\"accountCurrency\">The account currency cash symbol to set</param>\n        /// <param name=\"startingCash\">The account currency starting cash to set</param>\n        public void SetAccountCurrency(string accountCurrency, decimal? startingCash = null)\n        {\n            accountCurrency = accountCurrency.LazyToUpper();\n\n            // only allow setting account currency once\n            // we could try to set it twice when backtesting and the job packet specifies the initial CashAmount to use\n            if (_setAccountCurrencyWasCalled)\n            {\n                if (accountCurrency != CashBook.AccountCurrency)\n                {\n                    Log.Trace(\"SecurityPortfolioManager.SetAccountCurrency(): \" +\n                        Messages.SecurityPortfolioManager.AccountCurrencyAlreadySet(CashBook, accountCurrency));\n                }\n                return;\n            }\n            _setAccountCurrencyWasCalled = true;\n\n            if (Securities.Count > 0)\n            {\n                throw new InvalidOperationException(\"SecurityPortfolioManager.SetAccountCurrency(): \" +\n                    Messages.SecurityPortfolioManager.CannotChangeAccountCurrencyAfterAddingSecurity);\n            }\n\n            if (_setCashWasCalled)\n            {\n                throw new InvalidOperationException(\"SecurityPortfolioManager.SetAccountCurrency(): \" +\n                    Messages.SecurityPortfolioManager.CannotChangeAccountCurrencyAfterSettingCash);\n            }\n\n            Log.Trace(\"SecurityPortfolioManager.SetAccountCurrency(): \" +\n                Messages.SecurityPortfolioManager.SettingAccountCurrency(accountCurrency));\n\n            UnsettledCashBook.AccountCurrency = accountCurrency;\n            CashBook.AccountCurrency = accountCurrency;\n\n            _baseCurrencyCash = CashBook[accountCurrency];\n\n            if (startingCash != null)\n            {\n                SetCash((decimal)startingCash);\n            }\n        }\n\n        /// <summary>\n        /// Set the account currency cash this algorithm is to manage.\n        /// </summary>\n        /// <param name=\"cash\">Decimal cash value of portfolio</param>\n        public void SetCash(decimal cash)\n        {\n            _setCashWasCalled = true;\n            _baseCurrencyCash.SetAmount(cash);\n        }\n\n        /// <summary>\n        /// Set the cash for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The cash symbol to set</param>\n        /// <param name=\"cash\">Decimal cash value of portfolio</param>\n        /// <param name=\"conversionRate\">The current conversion rate for the</param>\n        public void SetCash(string symbol, decimal cash, decimal conversionRate)\n        {\n            _setCashWasCalled = true;\n            Cash item;\n            symbol = symbol.LazyToUpper();\n            if (CashBook.TryGetValue(symbol, out item))\n            {\n                item.SetAmount(cash);\n                item.ConversionRate = conversionRate;\n            }\n            else\n            {\n                CashBook.Add(symbol, cash, conversionRate);\n            }\n        }\n\n        // TODO: Review and fix these comments: it doesn't return what it says it does.\n        /// <summary>\n        /// Gets the margin available for trading a specific symbol in a specific direction.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to compute margin remaining for</param>\n        /// <param name=\"direction\">The order/trading direction</param>\n        /// <returns>The maximum order size that is currently executable in the specified direction</returns>\n        public decimal GetMarginRemaining(Symbol symbol, OrderDirection direction = OrderDirection.Buy)\n        {\n            var security = Securities[symbol];\n\n            var positionGroup = Positions.GetOrCreateDefaultGroup(security);\n            // Order direction in GetPositionGroupBuyingPower is regarding buying or selling the position group sent as parameter.\n            // Since we are passing the same position group as the one in the holdings, we need to invert the direction.\n            // Buying the means increasing the position group (in the same direction it is currently held) and selling means decreasing it.\n            var positionGroupOrderDirection = direction;\n            if (security.Holdings.IsShort)\n            {\n                positionGroupOrderDirection = direction == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            }\n\n            var parameters = new PositionGroupBuyingPowerParameters(this, positionGroup, positionGroupOrderDirection);\n            return positionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(parameters);\n        }\n\n        /// <summary>\n        /// Gets the margin available for trading a specific symbol in a specific direction.\n        /// Alias for <see cref=\"GetMarginRemaining(Symbol, OrderDirection)\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to compute margin remaining for</param>\n        /// <param name=\"direction\">The order/trading direction</param>\n        /// <returns>The maximum order size that is currently executable in the specified direction</returns>\n        public decimal GetBuyingPower(Symbol symbol, OrderDirection direction = OrderDirection.Buy)\n        {\n            return GetMarginRemaining(symbol, direction);\n        }\n\n        /// <summary>\n        /// Calculate the new average price after processing a list of partial/complete order fill events.\n        /// </summary>\n        /// <remarks>\n        ///     For purchasing stocks from zero holdings, the new average price is the sale price.\n        ///     When simply partially reducing holdings the average price remains the same.\n        ///     When crossing zero holdings the average price becomes the trade price in the new side of zero.\n        /// </remarks>\n        public virtual void ProcessFills(List<OrderEvent> fills)\n        {\n            lock (_totalPortfolioValueLock)\n            {\n                for (var i = 0; i < fills.Count; i++)\n                {\n                    var fill = fills[i];\n                    var security = Securities[fill.Symbol];\n                    security.PortfolioModel.ProcessFill(this, security, fill);\n                }\n\n                InvalidateTotalPortfolioValue();\n            }\n\n        }\n\n        /// <summary>\n        /// Applies a dividend to the portfolio\n        /// </summary>\n        /// <param name=\"dividend\">The dividend to be applied</param>\n        /// <param name=\"liveMode\">True if live mode, false for backtest</param>\n        /// <param name=\"mode\">The <see cref=\"DataNormalizationMode\"/> for this security</param>\n        public void ApplyDividend(Dividend dividend, bool liveMode, DataNormalizationMode mode)\n        {\n            // we currently don't properly model dividend payable dates, so in\n            // live mode it's more accurate to rely on the brokerage cash sync\n            if (liveMode)\n            {\n                return;\n            }\n\n            // only apply dividends when we're in raw mode or split adjusted mode\n            if (mode == DataNormalizationMode.Raw || mode == DataNormalizationMode.SplitAdjusted)\n            {\n                var security = Securities[dividend.Symbol];\n\n                // longs get benefits, shorts get clubbed on dividends\n                var total = security.Holdings.Quantity * dividend.Distribution * security.QuoteCurrency.ConversionRate;\n\n                // assuming USD, we still need to add Currency to the security object\n                _baseCurrencyCash.AddAmount(total);\n                security.Holdings.AddNewDividend(total);\n            }\n        }\n\n        /// <summary>\n        /// Applies a split to the portfolio\n        /// </summary>\n        /// <param name=\"split\">The split to be applied</param>\n        /// <param name=\"security\">The security the split will be applied to</param>\n        /// <param name=\"liveMode\">True if live mode, false for backtest</param>\n        /// <param name=\"mode\">The <see cref=\"DataNormalizationMode\"/> for this security</param>\n        public void ApplySplit(Split split, Security security, bool liveMode, DataNormalizationMode mode)\n        {\n            // only apply splits to equities\n            if (security.Type != SecurityType.Equity)\n            {\n                return;\n            }\n\n            // only apply splits in live or raw data mode\n            if (!liveMode && mode != DataNormalizationMode.Raw)\n            {\n                return;\n            }\n\n            // we need to modify our holdings in lght of the split factor\n            var quantity = security.Holdings.Quantity / split.SplitFactor;\n            var avgPrice = security.Holdings.AveragePrice * split.SplitFactor;\n\n            // we'll model this as a cash adjustment\n            var leftOver = quantity - (int)quantity;\n\n            security.Holdings.SetHoldings(avgPrice, (int)quantity);\n\n            // build a 'next' value to update the market prices in light of the split factor\n            var next = security.GetLastData();\n            if (next == null)\n            {\n                // sometimes we can get splits before we receive data which\n                // will cause this to return null, in this case we can't possibly\n                // have any holdings or price to set since we haven't received\n                // data yet, so just do nothing\n                _baseCurrencyCash.AddAmount(leftOver * split.ReferencePrice * split.SplitFactor);\n                return;\n            }\n\n            security.ApplySplit(split);\n            // The data price should have been adjusted already\n            _baseCurrencyCash.AddAmount(leftOver * next.Price);\n\n            // security price updated\n            InvalidateTotalPortfolioValue();\n        }\n\n        /// <summary>\n        /// Record the transaction value and time in a list to later be processed for statistics creation.\n        /// </summary>\n        /// <param name=\"time\">Time of order processed </param>\n        /// <param name=\"transactionProfitLoss\">Profit Loss.</param>\n        /// <param name=\"isWin\">\n        /// Whether the transaction is a win.\n        /// For options exercise, this might not depend only on the profit/loss value\n        /// </param>\n        public void AddTransactionRecord(DateTime time, decimal transactionProfitLoss, bool isWin)\n        {\n            Transactions.AddTransactionRecord(time, transactionProfitLoss, isWin);\n        }\n\n        /// <summary>\n        /// Retrieves a summary of the holdings for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get holdings for</param>\n        /// <returns>The holdings for the symbol or null if the symbol is invalid and/or not in the portfolio</returns>\n        Security ISecurityProvider.GetSecurity(Symbol symbol)\n        {\n            Security security;\n\n            if (Securities.TryGetValue(symbol, out security))\n            {\n                return security;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Logs margin information for debugging\n        /// </summary>\n        public void LogMarginInformation(OrderRequest orderRequest = null)\n        {\n            Log.Trace(Messages.SecurityPortfolioManager.TotalMarginInformation(TotalMarginUsed, MarginRemaining));\n\n            var orderSubmitRequest = orderRequest as SubmitOrderRequest;\n            if (orderSubmitRequest != null)\n            {\n                var direction = orderSubmitRequest.Quantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n                var security = Securities[orderSubmitRequest.Symbol];\n\n                var positionGroup = Positions.GetOrCreateDefaultGroup(security);\n                var marginUsed = positionGroup.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(\n                    this, positionGroup\n                );\n\n                var marginRemaining = positionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(\n                    this, positionGroup, direction\n                );\n\n                Log.Trace(Messages.SecurityPortfolioManager.OrderRequestMarginInformation(marginUsed, marginRemaining.Value));\n            }\n        }\n\n        /// <summary>\n        /// Sets the margin call model\n        /// </summary>\n        /// <param name=\"marginCallModel\">Model that represents a portfolio's model to executed margin call orders.</param>\n        public void SetMarginCallModel(IMarginCallModel marginCallModel)\n        {\n            MarginCallModel = marginCallModel;\n        }\n\n        /// <summary>\n        /// Sets the margin call model\n        /// </summary>\n        /// <param name=\"pyObject\">Model that represents a portfolio's model to executed margin call orders.</param>\n        public void SetMarginCallModel(PyObject pyObject)\n        {\n            SetMarginCallModel(new MarginCallModelPythonWrapper(pyObject));\n        }\n\n        /// <summary>\n        /// Will determine if the algorithms portfolio has enough buying power to fill the given orders\n        /// </summary>\n        /// <param name=\"orders\">The orders to check</param>\n        /// <returns>True if the algorithm has enough buying power available</returns>\n        public HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(List<Order> orders)\n        {\n            if (Positions.TryCreatePositionGroup(orders, out var group))\n            {\n                return group.BuyingPowerModel.HasSufficientBuyingPowerForOrder(new HasSufficientPositionGroupBuyingPowerForOrderParameters(this, group, orders));\n            }\n\n            for (var i = 0; i < orders.Count; i++)\n            {\n                var order = orders[i];\n                var security = Securities[order.Symbol];\n                var result = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(this, security, order);\n                if (!result.IsSufficient)\n                {\n                    // if any fails, we fail all\n                    return result;\n                }\n            }\n            return new HasSufficientBuyingPowerForOrderResult(true);\n        }\n\n        /// <summary>\n        /// Will set the security position group model to use\n        /// </summary>\n        /// <param name=\"positionGroupModel\">The position group model instance</param>\n        public void SetPositions(SecurityPositionGroupModel positionGroupModel)\n        {\n            Positions = positionGroupModel;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityPortfolioModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides a default implementation of <see cref=\"ISecurityPortfolioModel\"/> that simply\n    /// applies the fills to the algorithm's portfolio. This implementation is intended to\n    /// handle all security types.\n    /// </summary>\n    public class SecurityPortfolioModel : ISecurityPortfolioModel\n    {\n        /// <summary>\n        /// Performs application of an OrderEvent to the portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">The algorithm's portfolio</param>\n        /// <param name=\"security\">The fill's security</param>\n        /// <param name=\"fill\">The order event fill object to be applied</param>\n        public virtual void ProcessFill(SecurityPortfolioManager portfolio, Security security, OrderEvent fill)\n        {\n            var quoteCash = security.QuoteCurrency;\n\n            //Get the required information from the vehicle this order will affect\n            var isLong = security.Holdings.IsLong;\n            var isShort = security.Holdings.IsShort;\n            var closedPosition = false;\n            //Make local decimals to avoid any rounding errors from int multiplication\n            var quantityHoldings = (decimal)security.Holdings.Quantity;\n            var averageHoldingsPrice = security.Holdings.AveragePrice;\n\n            try\n            {\n                // apply sales value to holdings in the account currency\n                var saleValue = security.Holdings.GetQuantityValue(fill.AbsoluteFillQuantity, fill.FillPrice).InAccountCurrency;\n                security.Holdings.AddNewSale(saleValue);\n\n                // subtract transaction fees from the portfolio\n                var feeInAccountCurrency = 0m;\n                if (fill.OrderFee != OrderFee.Zero\n                    // this is for user friendliness because some\n                    // Security types default to use 0 USD ConstantFeeModel\n                    && fill.OrderFee.Value.Amount != 0)\n                {\n                    var feeThisOrder = fill.OrderFee.Value;\n                    feeInAccountCurrency = portfolio.CashBook.ConvertToAccountCurrency(feeThisOrder).Amount;\n                    security.Holdings.AddNewFee(feeInAccountCurrency);\n\n                    fill.OrderFee.ApplyToPortfolio(portfolio, fill);\n                }\n\n                // apply the funds using the current settlement model\n                // we dont adjust funds for futures and CFDs: it is zero upfront payment derivative (margin applies though)\n                // We do however apply funds for futures options, pay/gained premium, since they affect our cash balance the moment they are purchased/sold.\n                if (security.Type != SecurityType.Future && security.Type != SecurityType.Cfd && security.Type != SecurityType.CryptoFuture)\n                {\n                    security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, fill.UtcTime, new CashAmount(-fill.FillQuantity * fill.FillPrice * security.SymbolProperties.ContractMultiplier, quoteCash.Symbol), fill));\n                }\n                if (security.Type == SecurityType.Forex || security.Type == SecurityType.Crypto)\n                {\n                    // model forex fills as currency swaps\n                    var forex = (IBaseCurrencySymbol) security;\n                    security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, fill.UtcTime, new CashAmount(fill.FillQuantity, forex.BaseCurrency.Symbol), fill));\n                }\n\n                // did we close or open a position further?\n                closedPosition = isLong && fill.Direction == OrderDirection.Sell\n                             || isShort && fill.Direction == OrderDirection.Buy;\n\n                // calculate the last trade profit\n                if (closedPosition)\n                {\n                    var lastTradeProfit = ProcessCloseTradeProfit(portfolio, security, fill);\n\n                    //Update Vehicle Profit Tracking:\n                    var lastTradeProfitInAccountCurrency = lastTradeProfit.InAccountCurrency;\n                    security.Holdings.AddNewProfit(lastTradeProfitInAccountCurrency);\n                    security.Holdings.SetLastTradeProfit(lastTradeProfitInAccountCurrency);\n                    var transactionProfitLoss = lastTradeProfitInAccountCurrency - 2 * feeInAccountCurrency;\n                    portfolio.AddTransactionRecord(\n                        security.LocalTime.ConvertToUtc(security.Exchange.TimeZone),\n                        transactionProfitLoss,\n                        fill.IsWin(security, transactionProfitLoss));\n                }\n\n                //UPDATE HOLDINGS QUANTITY, AVG PRICE:\n                //Currently NO holdings. The order is ALL our holdings.\n                if (quantityHoldings == 0)\n                {\n                    //First transaction just subtract order from cash and set our holdings:\n                    averageHoldingsPrice = fill.FillPrice;\n                    quantityHoldings = fill.FillQuantity;\n                }\n                else if (isLong)\n                {\n                    //If we're currently LONG on the stock.\n                    switch (fill.Direction)\n                    {\n                        case OrderDirection.Buy:\n                            //Update the Holding Average Price: Total Value / Total Quantity:\n                            averageHoldingsPrice = ((averageHoldingsPrice*quantityHoldings) + (fill.FillQuantity*fill.FillPrice))/(quantityHoldings + fill.FillQuantity);\n                            //Add the new quantity:\n                            quantityHoldings += fill.FillQuantity;\n                            break;\n\n                        case OrderDirection.Sell:\n                            quantityHoldings += fill.FillQuantity; //+ a short = a subtraction\n                            if (quantityHoldings < 0)\n                            {\n                                //If we've now passed through zero from selling stock: new avg price:\n                                averageHoldingsPrice = fill.FillPrice;\n                            }\n                            else if (quantityHoldings == 0)\n                            {\n                                averageHoldingsPrice = 0;\n                            }\n                            break;\n                    }\n                }\n                else if (isShort)\n                {\n                    //We're currently SHORTING the stock: What is the new position now?\n                    switch (fill.Direction)\n                    {\n                        case OrderDirection.Buy:\n                            //Buying when we're shorting moves to close position:\n                            quantityHoldings += fill.FillQuantity;\n                            if (quantityHoldings > 0)\n                            {\n                                //If we were short but passed through zero, new average price is what we paid. The short position was closed.\n                                averageHoldingsPrice = fill.FillPrice;\n                            }\n                            else if (quantityHoldings == 0)\n                            {\n                                averageHoldingsPrice = 0;\n                            }\n                            break;\n\n                        case OrderDirection.Sell:\n                            //We are increasing a Short position:\n                            //E.g.  -100 @ $5, adding -100 @ $10: Avg: $7.5\n                            //      dAvg = (-500 + -1000) / -200 = 7.5\n                            averageHoldingsPrice = ((averageHoldingsPrice*quantityHoldings) + (fill.FillQuantity*fill.FillPrice))/(quantityHoldings + fill.FillQuantity);\n                            quantityHoldings += fill.FillQuantity;\n                            break;\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            //Set the results back to the vehicle.\n            security.Holdings.SetHoldings(averageHoldingsPrice, quantityHoldings);\n        }\n\n        /// <summary>\n        /// Helper method to determine the close trade profit\n        /// </summary>\n        protected virtual ConvertibleCashAmount ProcessCloseTradeProfit(SecurityPortfolioManager portfolio, Security security, OrderEvent fill)\n        {\n            var absoluteHoldingsQuantity = security.Holdings.AbsoluteQuantity;\n\n            // profit = (closed sale value - cost)*conversion to account currency\n            // closed sale value = quantity closed * fill price       BUYs are deemed negative cash flow\n            // cost = quantity closed * average holdings price        SELLS are deemed positive cash flow\n            var absoluteQuantityClosed = Math.Min(fill.AbsoluteFillQuantity, absoluteHoldingsQuantity);\n            var quantityClosed = Math.Sign(-fill.FillQuantity) * absoluteQuantityClosed;\n            var closedCost = security.Holdings.GetQuantityValue(quantityClosed, security.Holdings.AveragePrice);\n            var closedSaleValueInQuoteCurrency = security.Holdings.GetQuantityValue(quantityClosed, fill.FillPrice);\n\n            var lastTradeProfit = new ConvertibleCashAmount(closedSaleValueInQuoteCurrency.Amount - closedCost.Amount, closedSaleValueInQuoteCurrency.Cash);\n\n            // Reflect account cash adjustment for futures/CFD position\n            if (security.Type == SecurityType.Future || security.Type == SecurityType.Cfd || security.Type == SecurityType.CryptoFuture)\n            {\n                security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, fill.UtcTime, lastTradeProfit, fill));\n            }\n\n            return lastTradeProfit;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityPriceVariationModel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides default implementation of <see cref=\"IPriceVariationModel\"/>\n    /// for use in defining the minimum price variation.\n    /// </summary>\n    public class SecurityPriceVariationModel : IPriceVariationModel\n    {\n        /// <summary>\n        /// Get the minimum price variation from a security\n        /// </summary>\n        /// <param name=\"parameters\">An object containing the method parameters</param>\n        /// <returns>Decimal minimum price variation of a given security</returns>\n        public virtual decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters)\n        {\n            return parameters.Security.SymbolProperties.MinimumPriceVariation;\n        }\n    }\n}"
  },
  {
    "path": "Common/Securities/SecurityService.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// This class implements interface <see cref=\"ISecurityService\"/> providing methods for creating new <see cref=\"Security\"/>\n    /// </summary>\n    public class SecurityService : ISecurityService\n    {\n        private readonly CashBook _cashBook;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n        private readonly SymbolPropertiesDatabase _symbolPropertiesDatabase;\n        private readonly IRegisteredSecurityDataTypesProvider _registeredTypes;\n        private readonly ISecurityInitializerProvider _securityInitializerProvider;\n        private readonly SecurityCacheProvider _cacheProvider;\n        private readonly IPrimaryExchangeProvider _primaryExchangeProvider;\n        private readonly IOptionPriceModelProvider _optionPriceModelProvider;\n        private readonly IAlgorithm _algorithm;\n        private bool _isLiveMode;\n        private bool _modelsMismatchWarningSent;\n\n        /// <summary>\n        /// Creates a new instance of the SecurityService class\n        /// </summary>\n        public SecurityService(CashBook cashBook,\n            MarketHoursDatabase marketHoursDatabase,\n            SymbolPropertiesDatabase symbolPropertiesDatabase,\n            ISecurityInitializerProvider securityInitializerProvider,\n            IRegisteredSecurityDataTypesProvider registeredTypes,\n            SecurityCacheProvider cacheProvider,\n            IPrimaryExchangeProvider primaryExchangeProvider = null,\n            IAlgorithm algorithm = null,\n            IOptionPriceModelProvider optionPriceModelProvider = null)\n        {\n            _cashBook = cashBook;\n            _registeredTypes = registeredTypes;\n            _marketHoursDatabase = marketHoursDatabase;\n            _symbolPropertiesDatabase = symbolPropertiesDatabase;\n            _securityInitializerProvider = securityInitializerProvider;\n            _cacheProvider = cacheProvider;\n            _primaryExchangeProvider = primaryExchangeProvider;\n            _algorithm = algorithm;\n            _optionPriceModelProvider = optionPriceModelProvider;\n            OptionPriceModels.DefaultPriceModelProvider = _optionPriceModelProvider;\n        }\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        private Security CreateSecurity(Symbol symbol,\n            List<SubscriptionDataConfig> subscriptionDataConfigList,\n            decimal leverage,\n            bool addToSymbolCache,\n            Security underlying,\n            bool initializeSecurity,\n            bool reCreateSecurity,\n            bool seedSecurity)\n        {\n            var configList = new SubscriptionDataConfigList(symbol);\n            if (subscriptionDataConfigList != null)\n            {\n                configList.AddRange(subscriptionDataConfigList);\n            }\n\n            if (!reCreateSecurity && _algorithm != null && _algorithm.Securities.TryGetValue(symbol, out var existingSecurity))\n            {\n                existingSecurity.AddData(configList);\n\n                // If non-internal, mark as tradable if it was not already since this is an existing security but might include new subscriptions\n                if (!configList.IsInternalFeed)\n                {\n                    existingSecurity.MakeTradable();\n                }\n\n                InitializeSecurity(initializeSecurity, existingSecurity, seedSecurity);\n\n                return existingSecurity;\n            }\n\n            var dataTypes = Enumerable.Empty<Type>();\n            if (symbol.SecurityType == SecurityType.Base && SecurityIdentifier.TryGetCustomDataTypeInstance(symbol.ID.Symbol, out var type))\n            {\n                dataTypes = new[] { type };\n            }\n            var exchangeHours = _marketHoursDatabase.GetEntry(symbol, dataTypes).ExchangeHours;\n\n            var defaultQuoteCurrency = _cashBook.AccountCurrency;\n            if (symbol.ID.SecurityType == SecurityType.Forex)\n            {\n                defaultQuoteCurrency = symbol.Value.Substring(3);\n            }\n\n            if (symbol.ID.SecurityType == SecurityType.Crypto && !_symbolPropertiesDatabase.ContainsKey(symbol.ID.Market, symbol, symbol.ID.SecurityType))\n            {\n                throw new ArgumentException(Messages.SecurityService.SymbolNotFoundInSymbolPropertiesDatabase(symbol));\n            }\n\n            // For Futures Options that don't have a SPDB entry, the futures entry will be used instead.\n            var symbolProperties = _symbolPropertiesDatabase.GetSymbolProperties(\n                symbol.ID.Market,\n                symbol,\n                symbol.SecurityType,\n                defaultQuoteCurrency);\n\n            // add the symbol to our cache\n            if (addToSymbolCache)\n            {\n                SymbolCache.Set(symbol.Value, symbol);\n            }\n\n            // verify the cash book is in a ready state\n            var quoteCurrency = symbolProperties.QuoteCurrency;\n            if (!_cashBook.TryGetValue(quoteCurrency, out var quoteCash))\n            {\n                // since we have none it's safe to say the conversion is zero\n                quoteCash = _cashBook.Add(quoteCurrency, 0, 0);\n            }\n\n            Cash baseCash = null;\n            // we skip cfd because we don't need to add the base cash\n            if (symbol.SecurityType != SecurityType.Cfd)\n            {\n                if (CurrencyPairUtil.TryDecomposeCurrencyPair(symbol, out var baseCurrencySymbol, out _))\n                {\n                    if (!_cashBook.TryGetValue(baseCurrencySymbol, out baseCash))\n                    {\n                        // since we have none it's safe to say the conversion is zero\n                        baseCash = _cashBook.Add(baseCurrencySymbol, 0, 0);\n                    }\n                }\n                else if (CurrencyPairUtil.IsValidSecurityType(symbol.SecurityType, false))\n                {\n                    throw new ArgumentException($\"Failed to resolve base currency for '{symbol.ID.Symbol}', it might be missing from the Symbol database or market '{symbol.ID.Market}' could be wrong\");\n                }\n            }\n\n            var cache = _cacheProvider.GetSecurityCache(symbol);\n\n            List<TickType> sessionDataTypes = null;\n            bool hasDataTypes = _algorithm != null && _algorithm.SubscriptionManager.AvailableDataTypes?.TryGetValue(symbol.SecurityType, out sessionDataTypes) == true;\n            if (!hasDataTypes || sessionDataTypes.Count == 0)\n            {\n                sessionDataTypes = SubscriptionManager.DefaultDataTypes()[symbol.SecurityType];\n            }\n            cache.Session = new Session(sessionDataTypes.First(), exchangeHours, symbol);\n\n            Security security;\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Equity:\n                    var primaryExchange =\n                        _primaryExchangeProvider?.GetPrimaryExchange(symbol.ID) ??\n                        Exchange.UNKNOWN;\n                    security = new Equity.Equity(symbol, exchangeHours, quoteCash, symbolProperties, _cashBook, _registeredTypes, cache, primaryExchange);\n                    break;\n\n                case SecurityType.Option:\n                    if (addToSymbolCache) SymbolCache.Set(symbol.Underlying.Value, symbol.Underlying);\n                    security = new Option.Option(symbol, exchangeHours, quoteCash, new Option.OptionSymbolProperties(symbolProperties), _cashBook, _registeredTypes, cache, underlying, _optionPriceModelProvider);\n                    break;\n\n                case SecurityType.IndexOption:\n                    if (addToSymbolCache) SymbolCache.Set(symbol.Underlying.Value, symbol.Underlying);\n                    security = new IndexOption.IndexOption(symbol, exchangeHours, quoteCash, new IndexOption.IndexOptionSymbolProperties(symbolProperties), _cashBook, _registeredTypes, cache, underlying, priceModelProvider: _optionPriceModelProvider);\n                    break;\n\n                case SecurityType.FutureOption:\n                    if (addToSymbolCache) SymbolCache.Set(symbol.Underlying.Value, symbol.Underlying);\n                    var optionSymbolProperties = new Option.OptionSymbolProperties(symbolProperties);\n\n                    // Future options exercised only gives us one contract back, rather than the\n                    // 100x seen in equities.\n                    optionSymbolProperties.SetContractUnitOfTrade(1);\n\n                    security = new FutureOption.FutureOption(symbol, exchangeHours, quoteCash, optionSymbolProperties, _cashBook, _registeredTypes, cache, underlying);\n                    break;\n\n                case SecurityType.Future:\n                    security = new Future.Future(symbol, exchangeHours, quoteCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                case SecurityType.Forex:\n                    security = new Forex.Forex(symbol, exchangeHours, quoteCash, baseCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                case SecurityType.Cfd:\n                    security = new Cfd.Cfd(symbol, exchangeHours, quoteCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                case SecurityType.Index:\n                    security = new Index.Index(symbol, exchangeHours, quoteCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                case SecurityType.Crypto:\n                    security = new Crypto.Crypto(symbol, exchangeHours, quoteCash, baseCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                case SecurityType.CryptoFuture:\n                    security = new CryptoFuture.CryptoFuture(symbol, exchangeHours, quoteCash, baseCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n\n                default:\n                case SecurityType.Base:\n                    security = new Security(symbol, exchangeHours, quoteCash, symbolProperties, _cashBook, _registeredTypes, cache);\n                    break;\n            }\n\n            // if we're just creating this security and it only has an internal\n            // feed, mark it as non-tradable since the user didn't request this data\n            if (security.IsTradable)\n            {\n                security.IsTradable = !configList.IsInternalFeed;\n            }\n\n            security.AddData(configList);\n\n            // invoke the security initializer\n            InitializeSecurity(initializeSecurity, security, seedSecurity);\n\n            CheckCanonicalSecurityModels(security);\n\n            // if leverage was specified then apply to security after the initializer has run, parameters of this\n            // method take precedence over the intializer\n            if (leverage != Security.NullLeverage)\n            {\n                security.SetLeverage(leverage);\n            }\n\n            var isNotNormalized = configList.DataNormalizationMode() == DataNormalizationMode.Raw;\n\n            // In live mode and non normalized data, equity assumes specific price variation model\n            if ((_isLiveMode || isNotNormalized) && security.Type == SecurityType.Equity)\n            {\n                security.PriceVariationModel = new EquityPriceVariationModel();\n            }\n\n            return security;\n        }\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        public Security CreateSecurity(Symbol symbol,\n            List<SubscriptionDataConfig> subscriptionDataConfigList,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null,\n            bool seedSecurity = true)\n        {\n            return CreateSecurity(symbol, subscriptionDataConfigList, leverage, addToSymbolCache, underlying,\n                initializeSecurity: true, reCreateSecurity: false, seedSecurity: seedSecurity);\n        }\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        public Security CreateSecurity(Symbol symbol,\n            SubscriptionDataConfig subscriptionDataConfig,\n            decimal leverage = 0,\n            bool addToSymbolCache = true,\n            Security underlying = null,\n            bool seedSecurity = true)\n        {\n            return CreateSecurity(symbol, new List<SubscriptionDataConfig> { subscriptionDataConfig }, leverage, addToSymbolCache, underlying, seedSecurity);\n        }\n\n        /// <summary>\n        /// Creates a new security\n        /// </summary>\n        /// <remarks>Following the obsoletion of Security.Subscriptions,\n        /// both overloads will be merged removing <see cref=\"SubscriptionDataConfig\"/> arguments</remarks>\n        public Security CreateBenchmarkSecurity(Symbol symbol)\n        {\n            return CreateSecurity(symbol,\n                new List<SubscriptionDataConfig>(),\n                leverage: 1,\n                addToSymbolCache: false,\n                underlying: null,\n                initializeSecurity: false,\n                reCreateSecurity: true,\n                seedSecurity: false);\n        }\n\n        /// <summary>\n        /// Set live mode state of the algorithm\n        /// </summary>\n        /// <param name=\"isLiveMode\">True, live mode is enabled</param>\n        public void SetLiveMode(bool isLiveMode)\n        {\n            _isLiveMode = isLiveMode;\n        }\n\n        /// <summary>\n        /// Checks whether the created security has the same models as its canonical security (in case it has one)\n        /// and sends a one-time warning if it doesn't.\n        /// </summary>\n        private void CheckCanonicalSecurityModels(Security security)\n        {\n            if (!_modelsMismatchWarningSent &&\n                _algorithm != null &&\n                security.Symbol.HasCanonical() &&\n                _algorithm.Securities.TryGetValue(security.Symbol.Canonical, out var canonicalSecurity))\n            {\n                if (security.FillModel.GetType() != canonicalSecurity.FillModel.GetType() ||\n                    security.FeeModel.GetType() != canonicalSecurity.FeeModel.GetType() ||\n                    security.BuyingPowerModel.GetType() != canonicalSecurity.BuyingPowerModel.GetType() ||\n                    security.MarginInterestRateModel.GetType() != canonicalSecurity.MarginInterestRateModel.GetType() ||\n                    security.SlippageModel.GetType() != canonicalSecurity.SlippageModel.GetType() ||\n                    security.VolatilityModel.GetType() != canonicalSecurity.VolatilityModel.GetType() ||\n                    security.SettlementModel.GetType() != canonicalSecurity.SettlementModel.GetType())\n                {\n                    _modelsMismatchWarningSent = true;\n                    _algorithm.Debug($\"Warning: Security {security.Symbol} its canonical security {security.Symbol.Canonical} have at least one model of different types (fill, fee, buying power, margin interest rate, slippage, volatility, settlement). To avoid this, consider using a security initializer to set the right models to each security type according to your algorithm's requirements.\");\n                }\n            }\n        }\n\n        private void InitializeSecurity(bool initializeSecurity, Security security, bool seedSecurity)\n        {\n            if (initializeSecurity && !security.IsInitialized)\n            {\n                if (seedSecurity && _algorithm != null && _algorithm.Settings.SeedInitialPrices)\n                {\n                    AlgorithmUtils.SeedSecurities([security], _algorithm);\n                }\n\n                _securityInitializerProvider.SecurityInitializer.Initialize(security);\n                security.IsInitialized = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SecurityTransactionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing Python.Runtime;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Algorithm Transactions Manager - Recording Transactions\n    /// </summary>\n    public class SecurityTransactionManager : IOrderProvider\n    {\n        private class TransactionRecordEntry\n        {\n            public decimal ProfitLoss;\n            public bool IsWin;\n        }\n\n        private readonly Dictionary<DateTime, TransactionRecordEntry> _transactionRecord;\n        private readonly IAlgorithm _algorithm;\n        private int _orderId;\n        private int _groupOrderManagerId;\n        private readonly SecurityManager _securities;\n        private TimeSpan _marketOrderFillTimeout = TimeSpan.MinValue;\n\n        private IOrderProcessor _orderProcessor;\n\n        /// <summary>\n        /// Gets the time the security information was last updated\n        /// </summary>\n        public DateTime UtcTime\n        {\n            get { return _securities.UtcTime; }\n        }\n\n        /// <summary>\n        /// Initialise the transaction manager for holding and processing orders.\n        /// </summary>\n        public SecurityTransactionManager(IAlgorithm algorithm, SecurityManager security)\n        {\n            _algorithm = algorithm;\n\n            //Private reference for processing transactions\n            _securities = security;\n\n            //Internal storage for transaction records:\n            _transactionRecord = new Dictionary<DateTime, TransactionRecordEntry>();\n        }\n\n        /// <summary>\n        /// Trade record of profits and losses for each trade statistics calculations\n        /// </summary>\n        /// <remarks>Will return a shallow copy, modifying the returned container\n        /// will have no effect <see cref=\"AddTransactionRecord\"/></remarks>\n        public Dictionary<DateTime, decimal> TransactionRecord\n        {\n            get\n            {\n                lock (_transactionRecord)\n                {\n                    return _transactionRecord.ToDictionary(x => x.Key, x => x.Value.ProfitLoss);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the number or winning transactions\n        /// </summary>\n        public int WinCount\n        {\n            get\n            {\n                lock (_transactionRecord)\n                {\n                    return _transactionRecord.Values.Count(x => x.IsWin);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the number of losing transactions\n        /// </summary>\n        public int LossCount\n        {\n            get\n            {\n                lock (_transactionRecord)\n                {\n                    return _transactionRecord.Values.Count(x => !x.IsWin);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Trade record of profits and losses for each trade statistics calculations that are considered winning trades\n        /// </summary>\n        public Dictionary<DateTime, decimal> WinningTransactions\n        {\n            get\n            {\n                lock (_transactionRecord)\n                {\n                    return _transactionRecord.Where(x => x.Value.IsWin).ToDictionary(x => x.Key, x => x.Value.ProfitLoss);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Trade record of profits and losses for each trade statistics calculations that are considered losing trades\n        /// </summary>\n        public Dictionary<DateTime, decimal> LosingTransactions\n        {\n            get\n            {\n                lock (_transactionRecord)\n                {\n                    return _transactionRecord.Where(x => !x.Value.IsWin).ToDictionary(x => x.Key, x => x.Value.ProfitLoss);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Configurable minimum order value to ignore bad orders, or orders with unrealistic sizes\n        /// </summary>\n        /// <remarks>Default minimum order size is $0 value</remarks>\n        [Obsolete(\"MinimumOrderSize is obsolete and will not be used, please use Settings.MinimumOrderMarginPortfolioPercentage instead\")]\n        public decimal MinimumOrderSize { get; }\n\n        /// <summary>\n        /// Configurable minimum order size to ignore bad orders, or orders with unrealistic sizes\n        /// </summary>\n        /// <remarks>Default minimum order size is 0 shares</remarks>\n        [Obsolete(\"MinimumOrderQuantity is obsolete and will not be used, please use Settings.MinimumOrderMarginPortfolioPercentage instead\")]\n        public int MinimumOrderQuantity { get; }\n\n        /// <summary>\n        /// Get the last order id.\n        /// </summary>\n        public int LastOrderId\n        {\n            get\n            {\n                return _orderId;\n            }\n        }\n\n        /// <summary>\n        /// Configurable timeout for market order fills\n        /// </summary>\n        /// <remarks>Default value is 5 seconds</remarks>\n        public TimeSpan MarketOrderFillTimeout\n        {\n            get\n            {\n                return _marketOrderFillTimeout;\n            }\n            set\n            {\n                _marketOrderFillTimeout = value;\n            }\n        }\n\n        /// <summary>\n        /// Processes the order request\n        /// </summary>\n        /// <param name=\"request\">The request to be processed</param>\n        /// <returns>The order ticket for the request</returns>\n        public OrderTicket ProcessRequest(OrderRequest request)\n        {\n            if (_algorithm != null && _algorithm.IsWarmingUp)\n            {\n                throw new Exception(OrderResponse.WarmingUp(request).ToString());\n            }\n\n            var submit = request as SubmitOrderRequest;\n            if (submit != null)\n            {\n                SetOrderId(submit);\n            }\n            return _orderProcessor.Process(request);\n        }\n\n        /// <summary>\n        /// Sets the order id for the specified submit request\n        /// </summary>\n        /// <param name=\"request\">Request to set the order id for</param>\n        /// <remarks>This method is public so we can request an order id from outside the assembly, for testing for example</remarks>\n        public void SetOrderId(SubmitOrderRequest request)\n        {\n            // avoid setting the order id if it's already been set\n            if (request.OrderId < 1)\n            {\n                request.SetOrderId(GetIncrementOrderId());\n            }\n        }\n\n        /// <summary>\n        /// Add an order to collection and return the unique order id or negative if an error.\n        /// </summary>\n        /// <param name=\"request\">A request detailing the order to be submitted</param>\n        /// <returns>New unique, increasing orderid</returns>\n        public OrderTicket AddOrder(SubmitOrderRequest request)\n        {\n            return ProcessRequest(request);\n        }\n\n        /// <summary>\n        /// Update an order yet to be filled such as stop or limit orders.\n        /// </summary>\n        /// <param name=\"request\">Request detailing how the order should be updated</param>\n        /// <remarks>Does not apply if the order is already fully filled</remarks>\n        public OrderTicket UpdateOrder(UpdateOrderRequest request)\n        {\n            return ProcessRequest(request);\n        }\n\n        /// <summary>\n        /// Added alias for RemoveOrder -\n        /// </summary>\n        /// <param name=\"orderId\">Order id we wish to cancel</param>\n        /// <param name=\"orderTag\">Tag to indicate from where this method was called</param>\n        public OrderTicket CancelOrder(int orderId, string orderTag = null)\n        {\n            return RemoveOrder(orderId, orderTag);\n        }\n\n        /// <summary>\n        /// Cancels all open orders for all symbols\n        /// </summary>\n        /// <returns>List containing the cancelled order tickets</returns>\n        public List<OrderTicket> CancelOpenOrders()\n        {\n            if (_algorithm != null && _algorithm.IsWarmingUp)\n            {\n                throw new InvalidOperationException(Messages.SecurityTransactionManager.CancelOpenOrdersNotAllowedOnInitializeOrWarmUp);\n            }\n\n            var cancelledOrders = new List<OrderTicket>();\n            foreach (var ticket in GetOpenOrderTickets())\n            {\n                ticket.Cancel(Messages.SecurityTransactionManager.OrderCanceledByCancelOpenOrders(_algorithm.UtcTime));\n                cancelledOrders.Add(ticket);\n            }\n            return cancelledOrders;\n        }\n\n        /// <summary>\n        /// Cancels all open orders for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose orders are to be cancelled</param>\n        /// <param name=\"tag\">Custom order tag</param>\n        /// <returns>List containing the cancelled order tickets</returns>\n        public List<OrderTicket> CancelOpenOrders(Symbol symbol, string tag = null)\n        {\n            if (_algorithm != null && _algorithm.IsWarmingUp)\n            {\n                throw new InvalidOperationException(Messages.SecurityTransactionManager.CancelOpenOrdersNotAllowedOnInitializeOrWarmUp);\n            }\n\n            var cancelledOrders = new List<OrderTicket>();\n            foreach (var ticket in GetOpenOrderTickets(x => x.Symbol == symbol))\n            {\n                ticket.Cancel(tag);\n                cancelledOrders.Add(ticket);\n            }\n            return cancelledOrders;\n        }\n\n        /// <summary>\n        /// Remove this order from outstanding queue: user is requesting a cancel.\n        /// </summary>\n        /// <param name=\"orderId\">Specific order id to remove</param>\n        /// <param name=\"tag\">Tag request</param>\n        public OrderTicket RemoveOrder(int orderId, string tag = null)\n        {\n            return ProcessRequest(new CancelOrderRequest(_securities.UtcTime, orderId, tag ?? string.Empty));\n        }\n\n        /// <summary>\n        /// Gets an enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets</param>\n        /// <returns>An enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _orderProcessor.GetOrderTickets(filter ?? (x => true));\n        }\n\n        /// <summary>\n        /// Gets an enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The Python function filter used to find the required order tickets</param>\n        /// <returns>An enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOrderTickets(PyObject filter)\n        {\n            return _orderProcessor.GetOrderTickets(filter.SafeAs<Func<OrderTicket, bool>>());\n        }\n\n        /// <summary>\n        /// Get an enumerable of open <see cref=\"OrderTicket\"/> for the specified symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which to return the order tickets</param>\n        /// <returns>An enumerable of open <see cref=\"OrderTicket\"/>.</returns>\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(Symbol symbol)\n        {\n            return GetOpenOrderTickets(x => x.Symbol == symbol);\n        }\n\n        /// <summary>\n        /// Gets an enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets</param>\n        /// <returns>An enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _orderProcessor.GetOpenOrderTickets(filter ?? (x => true));\n        }\n\n        /// <summary>\n        /// Gets an enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// However, this method can be confused with the override that takes a Symbol as parameter. For this reason\n        /// it first checks if it can convert the parameter into a symbol. If that conversion cannot be aplied it\n        /// assumes the parameter is a Python function object and not a Python representation of a Symbol.\n        /// </summary>\n        /// <param name=\"filter\">The Python function filter used to find the required order tickets</param>\n        /// <returns>An enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(PyObject filter)\n        {\n            Symbol pythonSymbol;\n            if (filter.TryConvert(out pythonSymbol))\n            {\n                return GetOpenOrderTickets(pythonSymbol);\n            }\n            return _orderProcessor.GetOpenOrderTickets(filter.SafeAs<Func<OrderTicket, bool>>());\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity to be filled from open orders, i.e. order size minus quantity filled\n        /// </summary>\n        /// <param name=\"filter\">Filters the order tickets to be included in the aggregate quantity remaining to be filled</param>\n        /// <returns>Total quantity that hasn't been filled yet for all orders that were not filtered</returns>\n        public decimal GetOpenOrdersRemainingQuantity(Func<OrderTicket, bool> filter = null)\n        {\n            return GetOpenOrderTickets(filter)\n                .Aggregate(0m, (d, t) => d + t.QuantityRemaining);\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity to be filled from open orders, i.e. order size minus quantity filled\n        /// However, this method can be confused with the override that takes a Symbol as parameter. For this reason\n        /// it first checks if it can convert the parameter into a symbol. If that conversion cannot be aplied it\n        /// assumes the parameter is a Python function object and not a Python representation of a Symbol.\n        /// </summary>\n        /// <param name=\"filter\">Filters the order tickets to be included in the aggregate quantity remaining to be filled</param>\n        /// <returns>Total quantity that hasn't been filled yet for all orders that were not filtered</returns>\n        public decimal GetOpenOrdersRemainingQuantity(PyObject filter)\n        {\n            Symbol pythonSymbol;\n            if (filter.TryConvert(out pythonSymbol))\n            {\n                return GetOpenOrdersRemainingQuantity(pythonSymbol);\n            }\n\n            return GetOpenOrderTickets(filter)\n                .Aggregate(0m, (d, t) => d + t.QuantityRemaining);\n        }\n\n        /// <summary>\n        /// Gets the remaining quantity to be filled from open orders for a Symbol, i.e. order size minus quantity filled\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to get the remaining quantity of currently open orders</param>\n        /// <returns>Total quantity that hasn't been filled yet for orders matching the Symbol</returns>\n        public decimal GetOpenOrdersRemainingQuantity(Symbol symbol)\n        {\n            return GetOpenOrdersRemainingQuantity(t => t.Symbol == symbol);\n        }\n\n        /// <summary>\n        /// Gets the order ticket for the specified order id. Returns null if not found\n        /// </summary>\n        /// <param name=\"orderId\">The order's id</param>\n        /// <returns>The order ticket with the specified id, or null if not found</returns>\n        public OrderTicket GetOrderTicket(int orderId)\n        {\n            return _orderProcessor.GetOrderTicket(orderId);\n        }\n\n        /// <summary>\n        /// Wait for a specific order to be either Filled, Invalid or Canceled\n        /// </summary>\n        /// <param name=\"orderId\">The id of the order to wait for</param>\n        /// <returns>True if we successfully wait for the fill, false if we were unable\n        /// to wait. This may be because it is not a market order or because the timeout\n        /// was reached</returns>\n        public bool WaitForOrder(int orderId)\n        {\n            var orderTicket = GetOrderTicket(orderId);\n            if (orderTicket == null)\n            {\n                Log.Error($@\"SecurityTransactionManager.WaitForOrder(): {\n                    Messages.SecurityTransactionManager.UnableToLocateOrderTicket(orderId)}\");\n\n                return false;\n            }\n\n            if (!orderTicket.OrderClosed.WaitOne(_marketOrderFillTimeout))\n            {\n                if(_marketOrderFillTimeout > TimeSpan.Zero)\n                {\n                    Log.Error($@\"SecurityTransactionManager.WaitForOrder(): {Messages.SecurityTransactionManager.OrderNotFilledWithinExpectedTime(_marketOrderFillTimeout)}\");\n                }\n\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get a list of all open orders for a symbol.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol for which to return the orders</param>\n        /// <returns>List of open orders.</returns>\n        public List<Order> GetOpenOrders(Symbol symbol)\n        {\n            return GetOpenOrders(x => x.Symbol == symbol);\n        }\n\n        /// <summary>\n        /// Gets open orders matching the specified filter. Specifying null will return an enumerable\n        /// of all open orders.\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All filtered open orders this order provider currently holds</returns>\n        public List<Order> GetOpenOrders(Func<Order, bool> filter = null)\n        {\n            filter = filter ?? (x => true);\n            return _orderProcessor.GetOpenOrders(x => filter(x));\n        }\n\n        /// <summary>\n        /// Gets open orders matching the specified filter. However, this method can be confused with the\n        /// override that takes a Symbol as parameter. For this reason it first checks if it can convert\n        /// the parameter into a symbol. If that conversion cannot be aplied it assumes the parameter is\n        /// a Python function object and not a Python representation of a Symbol.\n        /// </summary>\n        /// <param name=\"filter\">Python function object used to filter the orders</param>\n        /// <returns>All filtered open orders this order provider currently holds</returns>\n        public List<Order> GetOpenOrders(PyObject filter)\n        {\n            Symbol pythonSymbol;\n            if (filter.TryConvert(out pythonSymbol))\n            {\n                return GetOpenOrders(pythonSymbol);\n            }\n            Func<Order, bool> csharpFilter = filter.SafeAs<Func<Order, bool>>();\n            return _orderProcessor.GetOpenOrders(x => csharpFilter(x));\n        }\n\n        /// <summary>\n        /// Gets the current number of orders that have been processed\n        /// </summary>\n        public int OrdersCount\n        {\n            get { return _orderProcessor.OrdersCount; }\n        }\n\n        /// <summary>\n        /// Get the order by its id\n        /// </summary>\n        /// <param name=\"orderId\">Order id to fetch</param>\n        /// <returns>A clone of the order with the specified id, or null if no match is found</returns>\n        public Order GetOrderById(int orderId)\n        {\n            return _orderProcessor.GetOrderById(orderId);\n        }\n\n        /// <summary>\n        /// Gets the order by its brokerage id\n        /// </summary>\n        /// <param name=\"brokerageId\">The brokerage id to fetch</param>\n        /// <returns>The first order matching the brokerage id, or null if no match is found</returns>\n        public List<Order> GetOrdersByBrokerageId(string brokerageId)\n        {\n            return _orderProcessor.GetOrdersByBrokerageId(brokerageId);\n        }\n\n        /// <summary>\n        /// Gets all orders matching the specified filter. Specifying null will return an enumerable\n        /// of all orders.\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All orders this order provider currently holds by the specified filter</returns>\n        public IEnumerable<Order> GetOrders(Func<Order, bool> filter = null)\n        {\n            return _orderProcessor.GetOrders(filter ?? (x => true));\n        }\n\n        /// <summary>\n        /// Gets all orders matching the specified filter.\n        /// </summary>\n        /// <param name=\"filter\">Python function object used to filter the orders</param>\n        /// <returns>All orders this order provider currently holds by the specified filter</returns>\n        public IEnumerable<Order> GetOrders(PyObject filter)\n        {\n            return _orderProcessor.GetOrders(filter.SafeAs<Func<Order, bool>>());\n        }\n\n        /// <summary>\n        /// Get a new order id, and increment the internal counter.\n        /// </summary>\n        /// <returns>New unique int order id.</returns>\n        public int GetIncrementOrderId()\n        {\n            return Interlocked.Increment(ref _orderId);\n        }\n\n        /// <summary>\n        /// Get a new group order manager id, and increment the internal counter.\n        /// </summary>\n        /// <returns>New unique int group order manager id.</returns>\n        public int GetIncrementGroupOrderManagerId()\n        {\n            return Interlocked.Increment(ref _groupOrderManagerId);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"IOrderProvider\"/> used for fetching orders for the algorithm\n        /// </summary>\n        /// <param name=\"orderProvider\">The <see cref=\"IOrderProvider\"/> to be used to manage fetching orders</param>\n        public void SetOrderProcessor(IOrderProcessor orderProvider)\n        {\n            _orderProcessor = orderProvider;\n        }\n\n        /// <summary>\n        /// Record the transaction value and time in a list to later be processed for statistics creation.\n        /// </summary>\n        /// <remarks>\n        /// Bit of a hack -- but using datetime as dictionary key is dangerous as you can process multiple orders within a second.\n        /// For the accounting / statistics generating purposes its not really critical to know the precise time, so just add a millisecond while there's an identical key.\n        /// </remarks>\n        /// <param name=\"time\">Time of order processed </param>\n        /// <param name=\"transactionProfitLoss\">Profit Loss.</param>\n        /// <param name=\"isWin\">\n        /// Whether the transaction is a win.\n        /// For options exercise, this might not depend only on the profit/loss value\n        /// </param>\n        public void AddTransactionRecord(DateTime time, decimal transactionProfitLoss, bool isWin)\n        {\n            lock (_transactionRecord)\n            {\n                var clone = time;\n                while (_transactionRecord.ContainsKey(clone))\n                {\n                    clone = clone.AddMilliseconds(1);\n                }\n                _transactionRecord.Add(clone, new TransactionRecordEntry { ProfitLoss = transactionProfitLoss, IsWin = isWin });\n            }\n        }\n\n        /// <summary>\n        /// Set live mode state of the algorithm\n        /// </summary>\n        /// <param name=\"isLiveMode\">True, live mode is enabled</param>\n        public void SetLiveMode(bool isLiveMode)\n        {\n            if (isLiveMode)\n            {\n                if(MarketOrderFillTimeout == TimeSpan.MinValue)\n                {\n                    // set default value in live trading\n                    MarketOrderFillTimeout = TimeSpan.FromSeconds(5);\n                }\n            }\n            else\n            {\n                // always zero in backtesting, fills happen synchronously, there's no dedicated thread like in live\n                MarketOrderFillTimeout = TimeSpan.Zero;\n            }\n        }\n\n        /// <summary>\n        /// Calculates the projected holdings for the specified security based on the current open orders.\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <returns>\n        /// The projected holdings for the specified security, which is the sum of the current holdings\n        /// plus the sum of the open orders quantity.\n        /// </returns>\n        public ProjectedHoldings GetProjectedHoldings(Security security)\n        {\n            return _orderProcessor.GetProjectedHoldings(security);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SymbolProperties.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents common properties for a specific security, uniquely identified by market, symbol and security type\n    /// </summary>\n    public class SymbolProperties\n    {\n        /// <summary>\n        /// DTO used to hold the properties of the symbol\n        /// </summary>\n        /// <remarks>\n        /// A DTO is used to handle updates to the symbol properties. Since some properties are decimals,\n        /// which is not thread-safe, we get around it by creating a new instance of the DTO and assigning to this property\n        /// </remarks>\n        private SymbolPropertiesHolder _properties;\n\n        /// <summary>\n        /// The description of the security\n        /// </summary>\n        public string Description => _properties.Description;\n\n        /// <summary>\n        /// The quote currency of the security\n        /// </summary>\n        public string QuoteCurrency => _properties.QuoteCurrency;\n\n        /// <summary>\n        /// The contract multiplier for the security\n        /// </summary>\n        public virtual decimal ContractMultiplier\n        {\n            get => _properties.ContractMultiplier;\n            internal set => _properties.ContractMultiplier = value;\n        }\n\n        /// <summary>\n        /// The minimum price variation (tick size) for the security\n        /// </summary>\n        public virtual decimal MinimumPriceVariation => _properties.MinimumPriceVariation;\n\n        /// <summary>\n        /// The lot size (lot size of the order) for the security\n        /// </summary>\n        public decimal LotSize => _properties.LotSize;\n\n        /// <summary>\n        /// The market ticker\n        /// </summary>\n        public string MarketTicker => _properties.MarketTicker;\n\n        /// <summary>\n        /// The minimum order size allowed\n        /// For crypto/forex pairs it's expected to be expressed in base or quote currency\n        /// i.e For BTC/USD the minimum order size allowed with Coinbase is 0.0001 BTC\n        /// while on Binance the minimum order size allowed is 10 USD\n        /// </summary>\n        public decimal? MinimumOrderSize => _properties.MinimumOrderSize;\n\n        /// <summary>\n        /// Allows normalizing live asset prices to US Dollars for Lean consumption. In some exchanges,\n        /// for some securities, data is expressed in cents like for example for corn futures ('ZC').\n        /// </summary>\n        /// <remarks>Default value is 1 but for some futures in cents it's 100</remarks>\n        public decimal PriceMagnifier => _properties.PriceMagnifier;\n\n        /// <summary>\n        /// Scale factor for option's strike price. For some options, such as NQX, the strike price\n        /// is based on a fraction of the underlying, thus this paramater scales the strike price so\n        /// that it can be used in comparation with the underlying such as\n        /// in <see cref=\"OptionFilterUniverse.Strikes(int, int)\"/>\n        /// </summary>\n        public decimal StrikeMultiplier => _properties.StrikeMultiplier;\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"SymbolProperties\"/> class\n        /// </summary>\n        protected SymbolProperties(SymbolProperties properties)\n        {\n            _properties = properties._properties;\n        }\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"SymbolProperties\"/> class\n        /// </summary>\n        public SymbolProperties(string description, string quoteCurrency, decimal contractMultiplier,\n            decimal minimumPriceVariation, decimal lotSize, string marketTicker,\n            decimal? minimumOrderSize = null, decimal priceMagnifier = 1, decimal strikeMultiplier = 1)\n        {\n            _properties = new SymbolPropertiesHolder(description, quoteCurrency, contractMultiplier,\n                minimumPriceVariation, lotSize, marketTicker, minimumOrderSize, priceMagnifier, strikeMultiplier);\n        }\n\n        /// <summary>\n        /// The string representation of these symbol properties\n        /// </summary>\n        public override string ToString()\n        {\n            return Messages.SymbolProperties.ToString(this);\n        }\n\n        /// <summary>\n        /// Gets a default instance of the <see cref=\"SymbolProperties\"/> class for the specified <paramref name=\"quoteCurrency\"/>\n        /// </summary>\n        /// <param name=\"quoteCurrency\">The quote currency of the symbol</param>\n        /// <returns>A default instance of the<see cref=\"SymbolProperties\"/> class</returns>\n        public static SymbolProperties GetDefault(string quoteCurrency)\n        {\n            return new SymbolProperties(string.Empty, quoteCurrency.LazyToUpper(), 1, 0.01m, 1, string.Empty);\n        }\n\n        /// <summary>\n        /// Updates the symbol properties with the values from the specified <paramref name=\"other\"/>\n        /// </summary>\n        /// <param name=\"other\">The symbol properties to take values from</param>\n        internal virtual void Update(SymbolProperties other)\n        {\n            _properties = other._properties;\n        }\n\n        /// <summary>\n        /// DTO used to hold the properties of the symbol\n        /// </summary>\n        private class SymbolPropertiesHolder\n        {\n            public string Description { get; }\n\n            public string QuoteCurrency { get; }\n\n            public decimal ContractMultiplier { get; set; }\n\n            public decimal MinimumPriceVariation { get; }\n\n            public decimal LotSize { get; }\n\n            public string MarketTicker { get; }\n\n            public decimal? MinimumOrderSize { get; }\n\n            public decimal PriceMagnifier { get; }\n\n            public decimal StrikeMultiplier { get; }\n\n\n            /// <summary>\n            /// Creates an instance of the <see cref=\"SymbolPropertiesHolder\"/> class\n            /// </summary>\n            public SymbolPropertiesHolder(string description, string quoteCurrency, decimal contractMultiplier, decimal minimumPriceVariation, decimal lotSize, string marketTicker, decimal? minimumOrderSize, decimal priceMagnifier, decimal strikeMultiplier)\n            {\n                Description = description;\n                QuoteCurrency = quoteCurrency;\n                ContractMultiplier = contractMultiplier;\n                MinimumPriceVariation = minimumPriceVariation;\n                LotSize = lotSize;\n\n                if (LotSize <= 0)\n                {\n                    throw new ArgumentException(Messages.SymbolProperties.InvalidLotSize);\n                }\n\n                MarketTicker = marketTicker;\n                MinimumOrderSize = minimumOrderSize;\n\n                PriceMagnifier = priceMagnifier;\n                if (PriceMagnifier <= 0)\n                {\n                    throw new ArgumentException(Messages.SymbolProperties.InvalidPriceMagnifier);\n                }\n\n                StrikeMultiplier = strikeMultiplier;\n                if (strikeMultiplier <= 0)\n                {\n                    throw new ArgumentException(Messages.SymbolProperties.InvalidStrikeMultiplier);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/SymbolPropertiesDatabase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides access to specific properties for various symbols\n    /// </summary>\n    public class SymbolPropertiesDatabase : BaseSecurityDatabase<SymbolPropertiesDatabase, SymbolProperties>\n    {\n        private IReadOnlyDictionary<SecurityDatabaseKey, SecurityDatabaseKey> _keyBySecurityType;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"SymbolPropertiesDatabase\"/> using the given file\n        /// </summary>\n        /// <param name=\"file\">File to read from</param>\n        protected SymbolPropertiesDatabase(string file)\n            : base(null, FromDataFolder, (entry, newEntry) => entry.Update(newEntry))\n        {\n            var allEntries = new Dictionary<SecurityDatabaseKey, SymbolProperties>();\n            var entriesBySecurityType = new Dictionary<SecurityDatabaseKey, SecurityDatabaseKey>();\n\n            foreach (var keyValuePair in FromCsvFile(file))\n            {\n                if (allEntries.ContainsKey(keyValuePair.Key))\n                {\n                    throw new DuplicateNameException(Messages.SymbolPropertiesDatabase.DuplicateKeyInFile(file, keyValuePair.Key));\n                }\n                // we wildcard the market, so per security type and symbol we will keep the *first* instance\n                // this allows us to fetch deterministically, in O(1), an entry without knowing the market, see 'TryGetMarket()'\n                var key = new SecurityDatabaseKey(SecurityDatabaseKey.Wildcard, keyValuePair.Key.Symbol, keyValuePair.Key.SecurityType);\n                if (!entriesBySecurityType.ContainsKey(key))\n                {\n                    entriesBySecurityType[key] = keyValuePair.Key;\n                }\n                allEntries[keyValuePair.Key] = keyValuePair.Value;\n            }\n\n            Entries = allEntries;\n            _keyBySecurityType = entriesBySecurityType;\n        }\n\n        /// <summary>\n        /// Tries to get the market for the provided symbol/security type\n        /// </summary>\n        /// <param name=\"symbol\">The particular symbol being traded</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"market\">The market the exchange resides in <see cref=\"Market\"/></param>\n        /// <returns>True if market was retrieved, false otherwise</returns>\n        public bool TryGetMarket(string symbol, SecurityType securityType, out string market)\n        {\n            SecurityDatabaseKey result;\n            var key = new SecurityDatabaseKey(SecurityDatabaseKey.Wildcard, symbol, securityType);\n            if (_keyBySecurityType.TryGetValue(key, out result))\n            {\n                market = result.Market;\n                return true;\n            }\n\n            market = null;\n            return false;\n        }\n\n        /// <summary>\n        /// Gets the symbol properties for the specified market/symbol/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"symbol\">The particular symbol being traded (Symbol class)</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <param name=\"defaultQuoteCurrency\">Specifies the quote currency to be used when returning a default instance of an entry is not found in the database</param>\n        /// <returns>The symbol properties matching the specified market/symbol/security-type or null if not found</returns>\n        /// <remarks>For any derivative options asset that is not for equities, we default to the underlying symbol's properties if no entry is found in the database</remarks>\n        public SymbolProperties GetSymbolProperties(string market, Symbol symbol, SecurityType securityType, string defaultQuoteCurrency)\n        {\n            SymbolProperties symbolProperties;\n            var lookupTicker = MarketHoursDatabase.GetDatabaseSymbolKey(symbol);\n            var key = new SecurityDatabaseKey(market, lookupTicker, securityType);\n\n            if (!Entries.TryGetValue(key, out symbolProperties))\n            {\n                if (symbol != null && symbol.SecurityType == SecurityType.FutureOption)\n                {\n                    // Default to looking up the underlying symbol's properties and using those instead if there's\n                    // no existing entry for the future option.\n                    lookupTicker = MarketHoursDatabase.GetDatabaseSymbolKey(symbol.Underlying);\n                    key = new SecurityDatabaseKey(market, lookupTicker, symbol.Underlying.SecurityType);\n\n                    if (Entries.TryGetValue(key, out symbolProperties))\n                    {\n                        return symbolProperties;\n                    }\n                }\n\n                // now check with null symbol key\n                if (!Entries.TryGetValue(new SecurityDatabaseKey(market, null, securityType), out symbolProperties))\n                {\n                    // no properties found, return object with default property values\n                    return SymbolProperties.GetDefault(defaultQuoteCurrency);\n                }\n            }\n\n            return symbolProperties;\n        }\n\n        /// <summary>\n        /// Gets a list of symbol properties for the specified market/security-type\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <param name=\"securityType\">The security type of the symbol</param>\n        /// <returns>An IEnumerable of symbol properties matching the specified market/security-type</returns>\n        public IEnumerable<KeyValuePair<SecurityDatabaseKey, SymbolProperties>> GetSymbolPropertiesList(string market, SecurityType securityType)\n        {\n            foreach (var entry in Entries)\n            {\n                var key = entry.Key;\n                var symbolProperties = entry.Value;\n\n                if (key.Market == market && key.SecurityType == securityType)\n                {\n                    yield return new KeyValuePair<SecurityDatabaseKey, SymbolProperties>(key, symbolProperties);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets a list of symbol properties for the specified market\n        /// </summary>\n        /// <param name=\"market\">The market the exchange resides in, i.e, 'usa', 'fxcm', ect...</param>\n        /// <returns>An IEnumerable of symbol properties matching the specified market</returns>\n        public IEnumerable<KeyValuePair<SecurityDatabaseKey, SymbolProperties>> GetSymbolPropertiesList(string market)\n        {\n            foreach (var entry in Entries)\n            {\n                var key = entry.Key;\n                var symbolProperties = entry.Value;\n\n                if (key.Market == market)\n                {\n                    yield return new KeyValuePair<SecurityDatabaseKey, SymbolProperties>(key, symbolProperties);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Set SymbolProperties entry for a particular market, symbol and security type.\n        /// </summary>\n        /// <param name=\"market\">Market of the entry</param>\n        /// <param name=\"symbol\">Symbol of the entry</param>\n        /// <param name=\"securityType\">Type of security for the entry</param>\n        /// <param name=\"properties\">The new symbol properties to store</param>\n        /// <returns>True if successful</returns>\n        public bool SetEntry(string market, string symbol, SecurityType securityType, SymbolProperties properties)\n        {\n            var key = new SecurityDatabaseKey(market, symbol, securityType);\n            lock (DataFolderDatabaseLock)\n            {\n                Entries[key] = properties;\n                CustomEntries.Add(key);\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the instance of the <see cref=\"SymbolPropertiesDatabase\"/> class produced by reading in the symbol properties\n        /// data found in /Data/symbol-properties/\n        /// </summary>\n        /// <returns>A <see cref=\"SymbolPropertiesDatabase\"/> class that represents the data in the symbol-properties folder</returns>\n        public static SymbolPropertiesDatabase FromDataFolder()\n        {\n            if (DataFolderDatabase == null)\n            {\n                lock (DataFolderDatabaseLock)\n                {\n                    if (DataFolderDatabase == null)\n                    {\n                        var path = Path.Combine(Globals.GetDataFolderPath(\"symbol-properties\"), \"symbol-properties-database.csv\");\n                        DataFolderDatabase = new SymbolPropertiesDatabase(path);\n                    }\n                }\n            }\n            return DataFolderDatabase;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"SymbolPropertiesDatabase\"/> class by reading the specified csv file\n        /// </summary>\n        /// <param name=\"file\">The csv file to be read</param>\n        /// <returns>A new instance of the <see cref=\"SymbolPropertiesDatabase\"/> class representing the data in the specified file</returns>\n        private static IEnumerable<KeyValuePair<SecurityDatabaseKey, SymbolProperties>> FromCsvFile(string file)\n        {\n            if (!File.Exists(file))\n            {\n                throw new FileNotFoundException(Messages.SymbolPropertiesDatabase.DatabaseFileNotFound(file));\n            }\n\n            // skip the first header line, also skip #'s as these are comment lines\n            foreach (var line in File.ReadLines(file).Where(x => !x.StartsWith(\"#\") && !string.IsNullOrWhiteSpace(x)).Skip(1))\n            {\n                SecurityDatabaseKey key;\n                var entry = FromCsvLine(line, out key);\n                if (key == null || entry == null)\n                {\n                    continue;\n                }\n\n                yield return new KeyValuePair<SecurityDatabaseKey, SymbolProperties>(key, entry);\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"SymbolProperties\"/> from the specified csv line\n        /// </summary>\n        /// <param name=\"line\">The csv line to be parsed</param>\n        /// <param name=\"key\">The key used to uniquely identify this security</param>\n        /// <returns>A new <see cref=\"SymbolProperties\"/> for the specified csv line</returns>\n        protected static SymbolProperties FromCsvLine(string line, out SecurityDatabaseKey key)\n        {\n            var csv = line.Split(',');\n\n            SecurityType securityType;\n            if (!csv[2].TryParseSecurityType(out securityType))\n            {\n                key = null;\n                return null;\n            }\n\n            key = new SecurityDatabaseKey(\n                market: csv[0],\n                symbol: csv[1],\n                securityType: securityType);\n\n            return new SymbolProperties(\n                description: csv[3],\n                quoteCurrency: csv[4],\n                contractMultiplier: csv[5].ToDecimal(),\n                minimumPriceVariation: csv[6].ToDecimalAllowExponent(),\n                lotSize: csv[7].ToDecimal(),\n                marketTicker: HasValidValue(csv, 8) ? csv[8] : string.Empty,\n                minimumOrderSize: HasValidValue(csv, 9) ? csv[9].ToDecimal() : null,\n                priceMagnifier: HasValidValue(csv, 10) ? csv[10].ToDecimal() : 1,\n                strikeMultiplier: HasValidValue(csv, 11) ? csv[11].ToDecimal() : 1);\n        }\n\n        private static bool HasValidValue(string[] array, uint position)\n        {\n            return array.Length > position && !string.IsNullOrEmpty(array[position]);\n        }\n\n        internal override void Merge(SymbolPropertiesDatabase newDatabase, bool resetCustomEntries)\n        {\n            base.Merge(newDatabase, resetCustomEntries);\n            _keyBySecurityType = newDatabase._keyBySecurityType.ToReadOnlyDictionary();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/UniverseManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Util;\nusing Common.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Manages the algorithm's collection of universes\n    /// </summary>\n    public class UniverseManager : BaseExtendedDictionary<Symbol, Universe, ConcurrentDictionary<Symbol, Universe>>\n    {\n        private readonly Queue<UniverseManagerChanged> _pendingChanges = new();\n\n        /// <summary>\n        /// Event fired when a universe is added or removed\n        /// </summary>\n        public event EventHandler<UniverseManagerChanged> CollectionChanged;\n\n        /// <summary>\n        /// Read-only dictionary containing all active securities. An active security is\n        /// a security that is currently selected by the universe or has holdings or open orders.\n        /// </summary>\n        public ReadOnlyExtendedDictionary<Symbol, Security> ActiveSecurities => this\n            .SelectMany(ukvp => ukvp.Value.Members.Select(mkvp => mkvp.Value))\n            .DistinctBy(s => s.Symbol)\n            .ToReadOnlyExtendedDictionary(s => s.Symbol);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseManager\"/> class\n        /// </summary>\n        public UniverseManager() : base(new ConcurrentDictionary<Symbol, Universe>())\n        {\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key and value to the dictionary\n        /// </summary>\n        public override void Add(Symbol key, Universe value)\n        {\n            if (Dictionary.TryAdd(key, value))\n            {\n                lock (_pendingChanges)\n                {\n                    _pendingChanges.Enqueue(new UniverseManagerChanged(NotifyCollectionChangedAction.Add, value));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Updates an element with the provided key and value to the dictionary\n        /// </summary>\n        public void Update(Symbol key, Universe value, NotifyCollectionChangedAction action)\n        {\n            if (Dictionary.ContainsKey(key) && !_pendingChanges.Any(x => x.Value == value))\n            {\n                lock (_pendingChanges)\n                {\n                    _pendingChanges.Enqueue(new UniverseManagerChanged(action, value));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Will trigger collection changed event if required\n        /// </summary>\n        public void ProcessChanges()\n        {\n            UniverseManagerChanged universeChange;\n            do\n            {\n                lock (_pendingChanges)\n                {\n                    _pendingChanges.TryDequeue(out universeChange);\n                }\n\n                if (universeChange != null)\n                {\n                    OnCollectionChanged(universeChange);\n                }\n            }\n            while (universeChange != null);\n        }\n\n        /// <summary>\n        /// Removes the element with the specified key from the dictionary\n        /// </summary>\n        public override bool Remove(Symbol key)\n        {\n            if (Dictionary.TryRemove(key, out var universe))\n            {\n                universe.Dispose();\n                OnCollectionChanged(new UniverseManagerChanged(NotifyCollectionChangedAction.Remove, universe));\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Gets or sets the element with the specified key\n        /// </summary>\n        public override Universe this[Symbol symbol]\n        {\n            get\n            {\n                if (!Dictionary.ContainsKey(symbol))\n                {\n                    throw new KeyNotFoundException($\"This universe symbol ({symbol}) was not found in your universe list. Please add this security or check it exists before using it with 'Universes.ContainsKey(\\\"{SymbolCache.GetTicker(symbol)}\\\")'\");\n                }\n                return Dictionary[symbol];\n            }\n            set\n            {\n                Universe existing;\n                if (Dictionary.TryGetValue(symbol, out existing) && existing != value)\n                {\n                    throw new ArgumentException($\"Unable to over write existing Universe: {symbol.Value}\");\n                }\n\n                // no security exists for the specified symbol key, add it now\n                if (existing == null)\n                {\n                    Add(symbol, value);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"CollectionChanged\"/> event\n        /// </summary>\n        protected virtual void OnCollectionChanged(UniverseManagerChanged e)\n        {\n            CollectionChanged?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/UniverseManagerChanged.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Specialized;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Event dto class fired when a universe reports a change\n    /// </summary>\n    public class UniverseManagerChanged\n    {\n        /// <summary>\n        /// The action that occurred\n        /// </summary>\n        public NotifyCollectionChangedAction Action { get; }\n\n        /// <summary>\n        /// Universe reporting a change\n        /// </summary>\n        public Universe Value { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public UniverseManagerChanged(NotifyCollectionChangedAction action, Universe value)\n        {\n            Action = action;\n            Value = value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/UnsettledCashAmount.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a pending cash amount waiting for settlement time\n    /// </summary>\n    public class UnsettledCashAmount\n    {\n        /// <summary>\n        /// The settlement time (in UTC)\n        /// </summary>\n        public DateTime SettlementTimeUtc { get; private set; }\n\n        /// <summary>\n        /// The currency symbol\n        /// </summary>\n        public string Currency { get; private set; }\n\n        /// <summary>\n        /// The amount of cash\n        /// </summary>\n        public decimal Amount { get; private set; }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"UnsettledCashAmount\"/> class\n        /// </summary>\n        public UnsettledCashAmount(DateTime settlementTimeUtc, string currency, decimal amount)\n        {\n            SettlementTimeUtc = settlementTimeUtc;\n            Currency = currency;\n            Amount = amount;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/BaseVolatilityModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities.Volatility\n{\n    /// <summary>\n    /// Represents a base model that computes the volatility of a security\n    /// </summary>\n    public class BaseVolatilityModel : IVolatilityModel\n    {\n        /// <summary>\n        /// Provides access to registered <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        protected ISubscriptionDataConfigProvider SubscriptionDataConfigProvider { get; set; }\n\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        public virtual decimal Volatility { get; }\n\n        /// <summary>\n        /// Sets the <see cref=\"ISubscriptionDataConfigProvider\"/> instance to use.\n        /// </summary>\n        /// <param name=\"subscriptionDataConfigProvider\">Provides access to registered <see cref=\"SubscriptionDataConfig\"/></param>\n        public virtual void SetSubscriptionDataConfigProvider(\n            ISubscriptionDataConfigProvider subscriptionDataConfigProvider)\n        {\n            SubscriptionDataConfigProvider = subscriptionDataConfigProvider;\n        }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\">The new data used to update the model</param>\n        public virtual void Update(Security security, BaseData data)\n        {\n        }\n\n        /// <summary>\n        /// Returns history requirements for the volatility model expressed in the form of history request\n        /// </summary>\n        /// <param name=\"security\">The security of the request</param>\n        /// <param name=\"utcTime\">The date/time of the request</param>\n        /// <returns>History request object list, or empty if no requirements</returns>\n        public virtual IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        {\n            return Enumerable.Empty<HistoryRequest>();\n        }\n\n        /// <summary>\n        /// Gets history requests required for warming up the greeks with the provided resolution\n        /// </summary>\n        /// <param name=\"security\">Security to get history for</param>\n        /// <param name=\"utcTime\">UTC time of the request (end time)</param>\n        /// <param name=\"resolution\">Resolution of the security</param>\n        /// <param name=\"barCount\">Number of bars to lookback for the start date</param>\n        /// <returns>Enumerable of history requests</returns>\n        /// <exception cref=\"InvalidOperationException\">The <see cref=\"SubscriptionDataConfigProvider\"/> has not been set</exception>\n        public IEnumerable<HistoryRequest> GetHistoryRequirements(\n            Security security,\n            DateTime utcTime,\n            Resolution? resolution,\n            int barCount)\n        {\n            if (SubscriptionDataConfigProvider == null)\n            {\n                throw new InvalidOperationException(\n                    \"BaseVolatilityModel.GetHistoryRequirements(): \" +\n                    \"SubscriptionDataConfigProvider was not set.\"\n                );\n            }\n\n            var configurations = SubscriptionDataConfigProvider\n                .GetSubscriptionDataConfigs(security.Symbol)\n                .OrderBy(c => c.TickType)\n                .ToList();\n            var configuration = configurations.First();\n\n            var bar = configuration.Type.GetBaseDataInstance();\n            bar.Symbol = security.Symbol;\n\n            var historyResolution = resolution ?? bar.SupportedResolutions().Max();\n\n            var periodSpan = historyResolution.ToTimeSpan();\n\n            // hour resolution does no have extended market hours data\n            var extendedMarketHours = periodSpan != Time.OneHour && configurations.IsExtendedMarketHours();\n            var localStartTime = Time.GetStartTimeForTradeBars(\n                security.Exchange.Hours,\n                utcTime.ConvertFromUtc(security.Exchange.TimeZone),\n                periodSpan,\n                barCount,\n                extendedMarketHours,\n                configuration.DataTimeZone, dailyPreciseEndTime: false);\n            var utcStartTime = localStartTime.ConvertToUtc(security.Exchange.TimeZone);\n\n            return new[]\n            {\n                new HistoryRequest(utcStartTime,\n                                   utcTime,\n                                   configuration.Type,\n                                   configuration.Symbol,\n                                   historyResolution,\n                                   security.Exchange.Hours,\n                                   configuration.DataTimeZone,\n                                   historyResolution,\n                                   extendedMarketHours,\n                                   configurations.IsCustomData(),\n                                   configuration.DataNormalizationMode,\n                                   LeanData.GetCommonTickTypeForCommonDataTypes(configuration.Type, security.Type))\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/IVolatilityModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Represents a model that computes the volatility of a security\n    /// </summary>\n    /// <remarks>Please use<see cref=\"BaseVolatilityModel\"/> as the base class for\n    /// any implementations of<see cref=\"IVolatilityModel\"/></remarks>\n    public interface IVolatilityModel\n    {\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        decimal Volatility { get; }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\">The new data used to update the model</param>\n        void Update(Security security, BaseData data);\n\n        /// <summary>\n        /// Returns history requirements for the volatility model expressed in the form of history request\n        /// </summary>\n        /// <param name=\"security\">The security of the request</param>\n        /// <param name=\"utcTime\">The date/time of the request</param>\n        /// <returns>History request object list, or empty if no requirements</returns>\n        IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime);\n    }\n\n    /// <summary>\n    /// Provides access to a null implementation for <see cref=\"IVolatilityModel\"/>\n    /// </summary>\n    public static class VolatilityModel\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"IVolatilityModel\"/> that will always\n        /// return 0 for its volatility and does nothing during Update.\n        /// </summary>\n        public static readonly IVolatilityModel Null = new NullVolatilityModel();\n\n        private sealed class NullVolatilityModel : IVolatilityModel\n        {\n            public decimal Volatility { get; private set; }\n\n            public void Update(Security security, BaseData data) { }\n\n            public IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime) { return Enumerable.Empty<HistoryRequest>(); }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/IndicatorVolatilityModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IVolatilityModel\"/> that uses an indicator\n    /// to compute its value\n    /// </summary>\n    public class IndicatorVolatilityModel : BaseVolatilityModel\n    {\n        private readonly IIndicator _indicator;\n        private readonly Action<Security, BaseData, IIndicator> _indicatorUpdate;\n\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        public override decimal Volatility\n        {\n            get { return _indicator.Current.Value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IVolatilityModel\"/> using\n        /// the specified <paramref name=\"indicator\"/>. The <paramref name=\"indicator\"/>\n        /// is assumed to but updated externally from this model, such as being registered\n        /// into the consolidator system.\n        /// </summary>\n        /// <param name=\"indicator\">The auto-updating indicator</param>\n        public IndicatorVolatilityModel(IIndicator indicator)\n        {\n            _indicator = indicator;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IVolatilityModel\"/> using\n        /// the specified <paramref name=\"indicator\"/>. The <paramref name=\"indicator\"/>\n        /// is assumed to but updated externally from this model, such as being registered\n        /// into the consolidator system.\n        /// </summary>\n        /// <param name=\"indicator\">The auto-updating indicator</param>\n        /// <param name=\"indicatorUpdate\">Function delegate used to update the indicator on each call to <see cref=\"Update\"/></param>\n        public IndicatorVolatilityModel(IIndicator indicator, Action<Security, BaseData, IIndicator> indicatorUpdate)\n        {\n            _indicator = indicator;\n            _indicatorUpdate = indicatorUpdate;\n        }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\">The new piece of data for the security</param>\n        public override void Update(Security security, BaseData data)\n        {\n            if (_indicatorUpdate != null)\n            {\n                _indicatorUpdate(security, data, _indicator);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/RelativeStandardDeviationVolatilityModel.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Statistics;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities.Volatility;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IVolatilityModel\"/> that computes the\n    /// relative standard deviation as the volatility of the security\n    /// </summary>\n    public class RelativeStandardDeviationVolatilityModel : BaseVolatilityModel\n    {\n        private bool _needsUpdate;\n        private decimal _volatility;\n        private DateTime _lastUpdate;\n        private readonly TimeSpan _periodSpan;\n        private readonly object _sync = new object();\n        private readonly RollingWindow<double> _window;\n\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        public override decimal Volatility\n        {\n            get\n            {\n                lock (_sync)\n                {\n                    if (_window.Count < 2)\n                    {\n                        return 0m;\n                    }\n\n                    if (_needsUpdate)\n                    {\n                        _needsUpdate = false;\n                        var mean = Math.Abs(_window.Mean().SafeDecimalCast());\n                        if (mean != 0m)\n                        {\n                            // volatility here is supposed to be a percentage\n                            var std = _window.StandardDeviation().SafeDecimalCast();\n                            _volatility = std / mean;\n                        }\n                    }\n                }\n                return _volatility;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RelativeStandardDeviationVolatilityModel\"/> class\n        /// </summary>\n        /// <param name=\"periodSpan\">The time span representing one 'period' length</param>\n        /// <param name=\"periods\">The number of 'period' lengths to wait until updating the value</param>\n        public RelativeStandardDeviationVolatilityModel(\n            TimeSpan periodSpan,\n            int periods)\n        {\n            if (periods < 2) throw new ArgumentOutOfRangeException(nameof(periods), \"'periods' must be greater than or equal to 2.\");\n            _periodSpan = periodSpan;\n            _window = new RollingWindow<double>(periods);\n            _lastUpdate = GetLastUpdateInitialValue(periodSpan, periods);\n        }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\"></param>\n        public override void Update(Security security, BaseData data)\n        {\n            var timeSinceLastUpdate = data.EndTime - _lastUpdate;\n            if (timeSinceLastUpdate >= _periodSpan && data.Price > 0)\n            {\n                lock (_sync)\n                {\n                    _needsUpdate = true;\n                    _window.Add((double)data.Price);\n                }\n                _lastUpdate = data.EndTime;\n            }\n        }\n\n        /// <summary>\n        /// Returns history requirements for the volatility model expressed in the form of history request\n        /// </summary>\n        /// <param name=\"security\">The security of the request</param>\n        /// <param name=\"utcTime\">The date/time of the request</param>\n        /// <returns>History request object list, or empty if no requirements</returns>\n        public override IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        {\n            if (SubscriptionDataConfigProvider == null)\n            {\n                throw new InvalidOperationException(\n                    \"RelativeStandardDeviationVolatilityModel.GetHistoryRequirements(): \" +\n                    \"SubscriptionDataConfigProvider was not set.\"\n                );\n            }\n\n            // Let's reset the model since it will get warmed up again using these history requirements\n            Reset();\n\n            var configurations = SubscriptionDataConfigProvider\n                .GetSubscriptionDataConfigs(security.Symbol)\n                .OrderBy(c => c.TickType)\n                .ToList();\n\n            return GetHistoryRequirements(\n                security,\n                utcTime,\n                configurations.GetHighestResolution(),\n                _window.Size + 1);\n        }\n\n        /// <summary>\n        /// Resets the model to its initial state\n        /// </summary>\n        private void Reset()\n        {\n            _needsUpdate = false;\n            _volatility = 0m;\n            _lastUpdate = GetLastUpdateInitialValue(_periodSpan, _window.Size);\n            _window.Reset();\n        }\n\n        private static DateTime GetLastUpdateInitialValue(TimeSpan periodSpan, int periods)\n        {\n            return DateTime.MinValue + TimeSpan.FromMilliseconds(periodSpan.TotalMilliseconds * periods);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/StandardDeviationOfReturnsVolatilityModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing MathNet.Numerics.Statistics;\n\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities.Volatility;\n\nnamespace QuantConnect.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IVolatilityModel\"/> that computes the\n    /// annualized sample standard deviation of daily returns as the volatility of the security\n    /// </summary>\n    public class StandardDeviationOfReturnsVolatilityModel : BaseVolatilityModel\n    {\n        private bool _needsUpdate;\n        private decimal _volatility;\n        private DateTime _lastUpdate = DateTime.MinValue;\n        private decimal _lastPrice;\n        private Resolution? _resolution;\n        private TimeSpan _periodSpan;\n        private readonly object _sync = new object();\n        private RollingWindow<double> _window;\n\n        /// <summary>\n        /// Gets the volatility of the security as a percentage\n        /// </summary>\n        public override decimal Volatility\n        {\n            get\n            {\n                lock (_sync)\n                {\n                    if (_window.Count < 2)\n                    {\n                        return 0m;\n                    }\n\n                    if (_needsUpdate)\n                    {\n                        _needsUpdate = false;\n                        var std = _window.StandardDeviation().SafeDecimalCast();\n                        _volatility = std * (decimal)Math.Sqrt(252.0);\n                    }\n                }\n\n                return _volatility;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StandardDeviationOfReturnsVolatilityModel\"/> class\n        /// </summary>\n        /// <param name=\"periods\">The max number of samples in the rolling window to be considered for calculating the standard deviation of returns</param>\n        /// <param name=\"resolution\">\n        /// Resolution of the price data inserted into the rolling window series to calculate standard deviation.\n        /// Will be used as the default value for update frequency if a value is not provided for <paramref name=\"updateFrequency\"/>.\n        /// This only has a material effect in live mode. For backtesting, this value does not cause any behavioral changes.\n        /// </param>\n        /// <param name=\"updateFrequency\">Frequency at which we insert new values into the rolling window for the standard deviation calculation</param>\n        /// <remarks>\n        /// The volatility model will be updated with the most granular/highest resolution data that was added to your algorithm.\n        /// That means that if I added <see cref=\"Resolution.Tick\"/> data for my Futures strategy, that this model will be\n        /// updated using <see cref=\"Resolution.Tick\"/> data as the algorithm progresses in time.\n        ///\n        /// Keep this in mind when setting the period and update frequency. The Resolution parameter is only used for live mode, or for\n        /// the default value of the <paramref name=\"updateFrequency\"/> if no value is provided.\n        /// </remarks>\n        public StandardDeviationOfReturnsVolatilityModel(\n            int periods,\n            Resolution? resolution = null,\n            TimeSpan? updateFrequency = null\n            )\n        {\n            if (periods < 2)\n            {\n                throw new ArgumentOutOfRangeException(nameof(periods), \"'periods' must be greater than or equal to 2.\");\n            }\n\n            _window = new RollingWindow<double>(periods);\n            _resolution = resolution;\n            _periodSpan = updateFrequency ?? resolution?.ToTimeSpan() ?? TimeSpan.FromDays(1);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StandardDeviationOfReturnsVolatilityModel\"/> class\n        /// </summary>\n        /// <param name=\"resolution\">\n        /// Resolution of the price data inserted into the rolling window series to calculate standard deviation.\n        /// Will be used as the default value for update frequency if a value is not provided for <paramref name=\"updateFrequency\"/>.\n        /// This only has a material effect in live mode. For backtesting, this value does not cause any behavioral changes.\n        /// </param>\n        /// <param name=\"updateFrequency\">Frequency at which we insert new values into the rolling window for the standard deviation calculation</param>\n        /// <remarks>\n        /// The volatility model will be updated with the most granular/highest resolution data that was added to your algorithm.\n        /// That means that if I added <see cref=\"Resolution.Tick\"/> data for my Futures strategy, that this model will be\n        /// updated using <see cref=\"Resolution.Tick\"/> data as the algorithm progresses in time.\n        ///\n        /// Keep this in mind when setting the period and update frequency. The Resolution parameter is only used for live mode, or for\n        /// the default value of the <paramref name=\"updateFrequency\"/> if no value is provided.\n        /// </remarks>\n        public StandardDeviationOfReturnsVolatilityModel(\n            Resolution resolution,\n            TimeSpan? updateFrequency = null\n            ) : this(PeriodsInResolution(resolution), resolution, updateFrequency)\n        {\n        }\n\n        /// <summary>\n        /// Updates this model using the new price information in\n        /// the specified security instance\n        /// </summary>\n        /// <param name=\"security\">The security to calculate volatility for</param>\n        /// <param name=\"data\">Data to update the volatility model with</param>\n        public override void Update(Security security, BaseData data)\n        {\n            var timeSinceLastUpdate = data.EndTime - _lastUpdate;\n            if (timeSinceLastUpdate >= _periodSpan && data.Price > 0)\n            {\n                lock (_sync)\n                {\n                    if (_lastPrice > 0.0m)\n                    {\n                        _needsUpdate = true;\n                        _window.Add((double)(data.Price / _lastPrice) - 1.0);\n                    }\n                }\n\n                _lastUpdate = data.EndTime;\n                _lastPrice = data.Price;\n            }\n        }\n\n        /// <summary>\n        /// Returns history requirements for the volatility model expressed in the form of history request\n        /// </summary>\n        /// <param name=\"security\">The security of the request</param>\n        /// <param name=\"utcTime\">The date of the request</param>\n        /// <returns>History request object list, or empty if no requirements</returns>\n        public override IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        {\n            // Let's reset the model since it will get warmed up again using these history requirements\n            Reset();\n\n            return GetHistoryRequirements(\n                security,\n                utcTime,\n                _resolution,\n                _window.Size + 1);\n        }\n\n        /// <summary>\n        /// Resets the model to its initial state\n        /// </summary>\n        private void Reset()\n        {\n            _needsUpdate = false;\n            _volatility = 0m;\n            _lastUpdate = DateTime.MinValue;\n            _lastPrice = 0m;\n            _window.Reset();\n        }\n\n        private static int PeriodsInResolution(Resolution resolution)\n        {\n            int periods;\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                case Resolution.Second:\n                    periods = 600;\n                    break;\n                case Resolution.Minute:\n                    periods = 60 * 24;\n                    break;\n                case Resolution.Hour:\n                    periods = 24 * 30;\n                    break;\n                default:\n                    periods = 30;\n                    break;\n            }\n\n            return periods;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Securities/Volatility/VolatilityModelExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing NodaTime;\n\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Securities.Volatility\n{\n    /// <summary>\n    /// Provides extension methods to volatility models\n    /// </summary>\n    public static class VolatilityModelExtensions\n    {\n        /// <summary>\n        /// Warms up the security's volatility model.\n        /// This can happen either on initialization or after a split or dividend is processed.\n        /// </summary>\n        /// <param name=\"volatilityModel\">The volatility model to be warmed up</param>\n        /// <param name=\"historyProvider\">The history provider to use to get historical data</param>\n        /// <param name=\"subscriptionManager\">The subscription manager to use</param>\n        /// <param name=\"security\">The security which volatility model is being warmed up</param>\n        /// <param name=\"utcTime\">The current UTC time</param>\n        /// <param name=\"timeZone\">The algorithm time zone</param>\n        /// <param name=\"liveMode\">Whether the algorithm is in live mode</param>\n        /// <param name=\"dataNormalizationMode\">The security subscribed data normalization mode</param>\n        public static void WarmUp(\n            this IVolatilityModel volatilityModel,\n            IHistoryProvider historyProvider,\n            SubscriptionManager subscriptionManager,\n            Security security,\n            DateTime utcTime,\n            DateTimeZone timeZone,\n            bool liveMode,\n            DataNormalizationMode? dataNormalizationMode = null)\n        {\n            volatilityModel.WarmUp(\n                historyProvider,\n                subscriptionManager,\n                security,\n                timeZone,\n                liveMode,\n                dataNormalizationMode,\n                () => volatilityModel.GetHistoryRequirements(security, utcTime));\n        }\n\n        /// <summary>\n        /// Warms up the security's volatility model.\n        /// This can happen either on initialization or after a split or dividend is processed.\n        /// </summary>\n        /// <param name=\"volatilityModel\">The volatility model to be warmed up</param>\n        /// <param name=\"historyProvider\">The history provider to use to get historical data</param>\n        /// <param name=\"subscriptionManager\">The subscription manager to use</param>\n        /// <param name=\"security\">The security which volatility model is being warmed up</param>\n        /// <param name=\"utcTime\">The current UTC time</param>\n        /// <param name=\"timeZone\">The algorithm time zone</param>\n        /// <param name=\"resolution\">The data resolution required for the indicator</param>\n        /// <param name=\"barCount\">The bar count required to fully warm the indicator up</param>\n        /// <param name=\"liveMode\">Whether the algorithm is in live mode</param>\n        /// <param name=\"dataNormalizationMode\">The security subscribed data normalization mode</param>\n        public static void WarmUp(\n            this IndicatorVolatilityModel volatilityModel,\n            IHistoryProvider historyProvider,\n            SubscriptionManager subscriptionManager,\n            Security security,\n            DateTime utcTime,\n            DateTimeZone timeZone,\n            Resolution? resolution,\n            int barCount,\n            bool liveMode,\n            DataNormalizationMode? dataNormalizationMode = null)\n        {\n            volatilityModel.WarmUp(\n                historyProvider,\n                subscriptionManager,\n                security,\n                timeZone,\n                liveMode,\n                dataNormalizationMode,\n                () => volatilityModel.GetHistoryRequirements(security, utcTime, resolution, barCount));\n        }\n\n        /// <summary>\n        /// Warms up the security's volatility model.\n        /// This can happen either on initialization or after a split or dividend is processed.\n        /// </summary>\n        /// <param name=\"volatilityModel\">The volatility model to be warmed up</param>\n        /// <param name=\"algorithm\">The algorithm running</param>\n        /// <param name=\"security\">The security which volatility model is being warmed up</param>\n        /// <param name=\"resolution\">The data resolution required for the indicator</param>\n        /// <param name=\"barCount\">The bar count required to fully warm the indicator up</param>\n        /// <param name=\"dataNormalizationMode\">The security subscribed data normalization mode</param>\n        public static void WarmUp(\n            this IndicatorVolatilityModel volatilityModel,\n            IAlgorithm algorithm,\n            Security security,\n            Resolution? resolution,\n            int barCount,\n            DataNormalizationMode? dataNormalizationMode = null)\n        {\n            volatilityModel.WarmUp(\n                algorithm.HistoryProvider,\n                algorithm.SubscriptionManager,\n                security,\n                algorithm.UtcTime,\n                algorithm.TimeZone,\n                resolution,\n                barCount,\n                algorithm.LiveMode,\n                dataNormalizationMode);\n        }\n\n        private static void WarmUp(\n            this IVolatilityModel volatilityModel,\n            IHistoryProvider historyProvider,\n            SubscriptionManager subscriptionManager,\n            Security security,\n            DateTimeZone timeZone,\n            bool liveMode,\n            DataNormalizationMode? dataNormalizationMode,\n            Func<IEnumerable<HistoryRequest>> getHistoryRequirementsFunc)\n        {\n            if (historyProvider == null || security == null || volatilityModel == VolatilityModel.Null)\n            {\n                return;\n            }\n\n            // start: this is a work around to maintain retro compatibility\n            // did not want to add IVolatilityModel.SetSubscriptionDataConfigProvider\n            // to prevent breaking existing user models.\n            var baseTypeModel = volatilityModel as BaseVolatilityModel;\n            baseTypeModel?.SetSubscriptionDataConfigProvider(subscriptionManager.SubscriptionDataConfigService);\n            // end\n\n            // Warm up\n            var historyRequests = getHistoryRequirementsFunc().ToList();\n            if (liveMode || (dataNormalizationMode.HasValue && dataNormalizationMode == DataNormalizationMode.Raw))\n            {\n                // If we're in live mode or raw mode, we need to warm up the volatility model with scaled raw data\n                // to avoid jumps in volatility values due to price discontinuities on splits and dividends\n                foreach (var request in historyRequests)\n                {\n                    request.DataNormalizationMode = DataNormalizationMode.ScaledRaw;\n                }\n            }\n\n            var history = historyProvider.GetHistory(historyRequests, timeZone);\n            foreach (var slice in history)\n            {\n                foreach (var request in historyRequests)\n                {\n                    if (slice.TryGet(request.DataType, security.Symbol, out var data))\n                    {\n                        volatilityModel.Update(security, data);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SecurityIdentifier.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Numerics;\nusing Newtonsoft.Json;\nusing ProtoBuf;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Defines a unique identifier for securities\n    /// </summary>\n    /// <remarks>\n    /// The SecurityIdentifier contains information about a specific security.\n    /// This includes the symbol and other data specific to the SecurityType.\n    /// The symbol is limited to 12 characters\n    /// </remarks>\n    [JsonConverter(typeof(SecurityIdentifierJsonConverter))]\n    [ProtoContract(SkipConstructor = true)]\n    public class SecurityIdentifier : IEquatable<SecurityIdentifier>, IComparable<SecurityIdentifier>, IComparable\n    {\n        #region Empty, DefaultDate Fields\n\n        private static bool _logStrikePrecision;\n        private static readonly Dictionary<string, Type> TypeMapping = new();\n        private static readonly Dictionary<string, SecurityIdentifier> SecurityIdentifierCache = new();\n        private static readonly char[] InvalidCharacters = {'|', ' '};\n        private static readonly Lazy<IMapFileProvider> MapFileProvider = new(Composer.Instance.GetPart<IMapFileProvider>);\n\n        /// <summary>\n        /// Gets an instance of <see cref=\"SecurityIdentifier\"/> that is empty, that is, one with no symbol specified\n        /// </summary>\n        public static readonly SecurityIdentifier Empty = new SecurityIdentifier(string.Empty, 0);\n\n        /// <summary>\n        /// Gets an instance of <see cref=\"SecurityIdentifier\"/> that is explicitly no symbol\n        /// </summary>\n        public static readonly SecurityIdentifier None = new SecurityIdentifier(\"NONE\", 0);\n\n        /// <summary>\n        /// Gets the date to be used when it does not apply.\n        /// </summary>\n        public static readonly DateTime DefaultDate = DateTime.FromOADate(0);\n\n        /// <summary>\n        /// Gets the set of invalids symbol characters\n        /// </summary>\n        public static readonly HashSet<char> InvalidSymbolCharacters = new HashSet<char>(InvalidCharacters);\n\n        #endregion\n\n        #region Scales, Widths and Market Maps\n\n        // these values define the structure of the 'otherData'\n        // the constant width fields are used via modulus, so the width is the number of zeros specified,\n        // {put/call:1}{oa-date:5}{style:1}{strike:6}{strike-scale:2}{market:3}{security-type:2}\n\n        private const ulong SecurityTypeWidth = 100;\n        private const ulong SecurityTypeOffset = 1;\n\n        private const ulong MarketWidth = 1000;\n        private const ulong MarketOffset = SecurityTypeOffset * SecurityTypeWidth;\n\n        private const int StrikeDefaultScale = 6;\n        private static readonly ulong StrikeDefaultScaleExpanded = Pow(10, StrikeDefaultScale);\n\n        private const ulong StrikeScaleWidth = 100;\n        private const ulong StrikeScaleOffset = MarketOffset * MarketWidth;\n\n        private const ulong StrikeWidth = 1000000;\n        private const ulong StrikeOffset = StrikeScaleOffset * StrikeScaleWidth;\n\n        private const ulong OptionStyleWidth = 10;\n        private const ulong OptionStyleOffset = StrikeOffset * StrikeWidth;\n\n        private const ulong DaysWidth = 100000;\n        private const ulong DaysOffset = OptionStyleOffset * OptionStyleWidth;\n\n        private const ulong PutCallOffset = DaysOffset * DaysWidth;\n        private const ulong PutCallWidth = 10;\n\n        #endregion\n\n        #region Member variables\n\n        [ProtoMember(1)]\n        private string _symbol;\n        [ProtoMember(2)]\n        private ulong _properties;\n        [ProtoMember(3)]\n        private SecurityIdentifier _underlying;\n        private bool _hashCodeSet;\n        private int _hashCode;\n        private decimal? _strikePrice;\n        private OptionStyle? _optionStyle;\n        private OptionRight? _optionRight;\n        private DateTime? _date;\n        private string _stringRep;\n        private string _market;\n\n        #endregion\n\n        #region Properties\n\n        /// <summary>\n        /// Gets whether or not this <see cref=\"SecurityIdentifier\"/> is a derivative,\n        /// that is, it has a valid <see cref=\"Underlying\"/> property\n        /// </summary>\n        public bool HasUnderlying\n        {\n            get { return _underlying != null; }\n        }\n\n        /// <summary>\n        /// Gets the underlying security identifier for this security identifier. When there is\n        /// no underlying, this property will return a value of <see cref=\"Empty\"/>.\n        /// </summary>\n        public SecurityIdentifier Underlying\n        {\n            get\n            {\n                if (_underlying == null)\n                {\n                    throw new InvalidOperationException(Messages.SecurityIdentifier.NoUnderlyingForIdentifier);\n                }\n                return _underlying;\n            }\n        }\n\n        /// <summary>\n        /// Gets the date component of this identifier. For equities this\n        /// is the first date the security traded. Technically speaking,\n        /// in LEAN, this is the first date mentioned in the map_files.\n        /// For futures and options this is the expiry date of the contract.\n        /// For other asset classes, this property will throw an\n        /// exception as the field is not specified.\n        /// </summary>\n        public DateTime Date\n        {\n            get\n            {\n                if (_date.HasValue)\n                {\n                    return _date.Value;\n                }\n\n                switch (SecurityType)\n                {\n                    case SecurityType.Base:\n                    case SecurityType.Equity:\n                    case SecurityType.Option:\n                    case SecurityType.Future:\n                    case SecurityType.Index:\n                    case SecurityType.FutureOption:\n                    case SecurityType.IndexOption:\n                    case SecurityType.CryptoFuture:\n                        var oadate = ExtractFromProperties(DaysOffset, DaysWidth);\n                        _date = DateTime.FromOADate(oadate);\n                        return _date.Value;\n                    default:\n                        throw new InvalidOperationException(Messages.SecurityIdentifier.DateNotSupportedBySecurityType);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the original symbol used to generate this security identifier.\n        /// For equities, by convention this is the first ticker symbol for which\n        /// the security traded\n        /// </summary>\n        public string Symbol\n        {\n            get { return _symbol; }\n        }\n\n        /// <summary>\n        /// Gets the market component of this security identifier. If located in the\n        /// internal mappings, the full string is returned. If the value is unknown,\n        /// the integer value is returned as a string.\n        /// </summary>\n        public string Market\n        {\n            get\n            {\n                if (_market == null)\n                {\n                    var marketCode = ExtractFromProperties(MarketOffset, MarketWidth);\n                    var market = QuantConnect.Market.Decode((int)marketCode);\n                    // if we couldn't find it, send back the numeric representation\n                    _market = market ?? marketCode.ToStringInvariant();\n                }\n                return _market;\n            }\n        }\n\n        /// <summary>\n        /// Gets the security type component of this security identifier.\n        /// </summary>\n        [ProtoMember(4)]\n        public SecurityType SecurityType { get; }\n\n        /// <summary>\n        /// Gets the option strike price. This only applies if SecurityType is Option, \n        /// IndexOption or FutureOption and will thrown anexception if accessed otherwise.\n        /// </summary>\n        public decimal StrikePrice\n        {\n            get\n            {\n                if (_strikePrice.HasValue)\n                {\n                    return _strikePrice.Value;\n                }\n\n                if (!SecurityType.IsOption())\n                {\n                    throw new InvalidOperationException(Messages.SecurityIdentifier.StrikePriceNotSupportedBySecurityType);\n                }\n\n                // performance: lets calculate strike price once\n                var scale = ExtractFromProperties(StrikeScaleOffset, StrikeScaleWidth);\n                var unscaled = ExtractFromProperties(StrikeOffset, StrikeWidth);\n                var pow = Math.Pow(10, (int)scale - StrikeDefaultScale);\n                // If the 20th bit is set to 1, we have a negative strike price.\n                // Let's normalize the strike and explicitly make it negative\n                if (((unscaled >> 19) & 1) == 1)\n                {\n                    _strikePrice = -((unscaled ^ 1 << 19) * (decimal)pow);\n                }\n                else\n                {\n                    _strikePrice = unscaled * (decimal)pow;\n                }\n\n                return _strikePrice.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the option type component of this security identifier. This\n        /// only applies if SecurityType is Option, IndexOption or FutureOption\n        /// and will throw an exception if accessed otherwise.\n        /// </summary>\n        public OptionRight OptionRight\n        {\n            get\n            {\n                if (_optionRight.HasValue)\n                {\n                    return _optionRight.Value;\n                }\n\n                if (!SecurityType.IsOption())\n                {\n                    throw new InvalidOperationException(Messages.SecurityIdentifier.OptionRightNotSupportedBySecurityType);\n                }\n                _optionRight = (OptionRight)ExtractFromProperties(PutCallOffset, PutCallWidth);\n                return _optionRight.Value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the option style component of this security identifier. This\n        /// only applies if SecurityType is Option, IndexOption or FutureOption\n        /// and will throw an exception if accessed otherwise.\n        /// </summary>\n        public OptionStyle OptionStyle\n        {\n            get\n            {\n                if (_optionStyle.HasValue)\n                {\n                    return _optionStyle.Value;\n                }\n\n                if (!SecurityType.IsOption())\n                {\n                    throw new InvalidOperationException(Messages.SecurityIdentifier.OptionStyleNotSupportedBySecurityType);\n                }\n\n                _optionStyle = (OptionStyle)(ExtractFromProperties(OptionStyleOffset, OptionStyleWidth));\n                return _optionStyle.Value;\n            }\n        }\n\n        #endregion\n\n        #region Constructors\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityIdentifier\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The base36 string encoded as a long using alpha [0-9A-Z]</param>\n        /// <param name=\"properties\">Other data defining properties of the symbol including market,\n        /// security type, listing or expiry date, strike/call/put/style for options, ect...</param>\n        public SecurityIdentifier(string symbol, ulong properties)\n        {\n            if (symbol == null)\n            {\n                throw new ArgumentNullException(nameof(symbol), Messages.SecurityIdentifier.NullSymbol);\n            }\n            if (symbol.IndexOfAny(InvalidCharacters) != -1)\n            {\n                throw new ArgumentException(Messages.SecurityIdentifier.SymbolWithInvalidCharacters, nameof(symbol));\n            }\n            _symbol = symbol;\n            _properties = properties;\n            _underlying = null;\n            _strikePrice = null;\n            _optionStyle = null;\n            _optionRight = null;\n            _date = null;\n            SecurityType = (SecurityType)ExtractFromProperties(SecurityTypeOffset, SecurityTypeWidth, properties);\n            if (!SecurityType.IsValid())\n            {\n                throw new ArgumentException(Messages.SecurityIdentifier.PropertiesDoNotMatchAnySecurityType, nameof(properties));\n            }\n            _hashCode = Math.Abs(unchecked (symbol.GetHashCode() * 397) ^ properties.GetHashCode());\n            _hashCodeSet = true;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityIdentifier\"/> class\n        /// </summary>\n        /// <param name=\"symbol\">The base36 string encoded as a long using alpha [0-9A-Z]</param>\n        /// <param name=\"properties\">Other data defining properties of the symbol including market,\n        /// security type, listing or expiry date, strike/call/put/style for options, ect...</param>\n        /// <param name=\"underlying\">Specifies a <see cref=\"SecurityIdentifier\"/> that represents the underlying security</param>\n        public SecurityIdentifier(string symbol, ulong properties, SecurityIdentifier underlying)\n            : this(symbol, properties)\n        {\n            if (symbol == null)\n            {\n                throw new ArgumentNullException(nameof(symbol), Messages.SecurityIdentifier.NullSymbol);\n            }\n            _symbol = symbol;\n            _properties = properties;\n            // performance: directly call Equals(SecurityIdentifier other), shortcuts Equals(object other)\n            if (!underlying.Equals(Empty))\n            {\n                _underlying = underlying;\n            }\n        }\n\n        #endregion\n\n        #region AddMarket, GetMarketCode, and Generate\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for an option\n        /// </summary>\n        /// <param name=\"expiry\">The date the option expires</param>\n        /// <param name=\"underlying\">The underlying security's symbol</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"strike\">The strike price</param>\n        /// <param name=\"optionRight\">The option type, call or put</param>\n        /// <param name=\"optionStyle\">The option style, American or European</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified option security</returns>\n        public static SecurityIdentifier GenerateOption(DateTime expiry,\n            SecurityIdentifier underlying,\n            string market,\n            decimal strike,\n            OptionRight optionRight,\n            OptionStyle optionStyle)\n        {\n            return GenerateOption(expiry, underlying, null, market, strike, optionRight, optionStyle);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for an option\n        /// </summary>\n        /// <param name=\"expiry\">The date the option expires</param>\n        /// <param name=\"underlying\">The underlying security's symbol</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"strike\">The strike price</param>\n        /// <param name=\"optionRight\">The option type, call or put</param>\n        /// <param name=\"optionStyle\">The option style, American or European</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified option security</returns>\n        public static SecurityIdentifier GenerateOption(DateTime expiry,\n            SecurityIdentifier underlying,\n            string targetOption,\n            string market,\n            decimal strike,\n            OptionRight optionRight,\n            OptionStyle optionStyle)\n        {\n            if (string.IsNullOrEmpty(targetOption))\n            {\n                if (underlying.SecurityType == SecurityType.Future)\n                {\n                    // Futures options tickers might not match, so we need\n                    // to map the provided future Symbol to the actual future option Symbol.\n                    targetOption = FuturesOptionsSymbolMappings.Map(underlying.Symbol);\n                }\n                else\n                {\n                    // by default the target option matches the underlying symbol\n                    targetOption = underlying.Symbol;\n                }\n            }\n\n            return Generate(expiry, targetOption, QuantConnect.Symbol.GetOptionTypeFromUnderlying(underlying.SecurityType), market, strike, optionRight, optionStyle, underlying);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a future\n        /// </summary>\n        /// <param name=\"expiry\">The date the future expires</param>\n        /// <param name=\"symbol\">The security's symbol</param>\n        /// <param name=\"market\">The market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified futures security</returns>\n        public static SecurityIdentifier GenerateFuture(DateTime expiry,\n            string symbol,\n            string market)\n        {\n            return Generate(expiry, symbol, SecurityType.Future, market);\n        }\n\n        /// <summary>\n        /// Helper overload that will search the mapfiles to resolve the first date. This implementation\n        /// uses the configured <see cref=\"IMapFileProvider\"/> via the <see cref=\"Composer.Instance\"/>\n        /// </summary>\n        /// <param name=\"symbol\">The symbol as it is known today</param>\n        /// <param name=\"market\">The market</param>\n        /// <param name=\"mapSymbol\">Specifies if symbol should be mapped using map file provider</param>\n        /// <param name=\"mapFileProvider\">Specifies the IMapFileProvider to use for resolving symbols, specify null to load from Composer</param>\n        /// <param name=\"mappingResolveDate\">The date to use to resolve the map file. Default value is <see cref=\"DateTime.Today\"/></param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified symbol today</returns>\n        public static SecurityIdentifier GenerateEquity(string symbol, string market, bool mapSymbol = true, IMapFileProvider mapFileProvider = null, DateTime? mappingResolveDate = null)\n        {\n            var firstDate = DefaultDate;\n            if (mapSymbol)\n            {\n                var firstTickerDate = GetFirstTickerAndDate(mapFileProvider ?? MapFileProvider.Value, symbol, market, SecurityType.Equity, mappingResolveDate: mappingResolveDate);\n                firstDate = firstTickerDate.Item2;\n                symbol = firstTickerDate.Item1;\n            }\n\n            return GenerateEquity(firstDate, symbol, market);\n        }\n\n        /// <summary>\n        /// For the given symbol will resolve the ticker it used at the requested date\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to get the ticker for</param>\n        /// <param name=\"date\">The date to map the symbol to</param>\n        /// <returns>The ticker for a date and symbol</returns>\n        public static string Ticker(Symbol symbol, DateTime date)\n        {\n            if (symbol.RequiresMapping())\n            {\n                var resolver = MapFileProvider.Value.Get(AuxiliaryDataKey.Create(symbol));\n                var mapfile = resolver.ResolveMapFile(symbol);\n\n                return mapfile.GetMappedSymbol(date.Date, symbol.Value);\n            }\n\n            return symbol.Value;\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for an equity\n        /// </summary>\n        /// <param name=\"date\">The first date this security traded (in LEAN this is the first date in the map_file</param>\n        /// <param name=\"symbol\">The ticker symbol this security traded under on the <paramref name=\"date\"/></param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified equity security</returns>\n        public static SecurityIdentifier GenerateEquity(DateTime date, string symbol, string market)\n        {\n            return Generate(date, symbol, SecurityType.Equity, market);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a <see cref=\"ConstituentsUniverseData\"/>.\n        /// Note that the symbol ticker is case sensitive here.\n        /// </summary>\n        /// <param name=\"symbol\">The ticker to use for this constituent identifier</param>\n        /// <param name=\"securityType\">The security type of this constituent universe</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <remarks>This method is special in the sense that it does not force the Symbol to be upper\n        /// which is required to determine the source file of the constituent\n        /// <see cref=\"ConstituentsUniverseData.GetSource(Data.SubscriptionDataConfig,DateTime,bool)\"/></remarks>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified constituent universe</returns>\n        public static SecurityIdentifier GenerateConstituentIdentifier(string symbol, SecurityType securityType, string market)\n        {\n            return Generate(DefaultDate, symbol, securityType, market, forceSymbolToUpper: false);\n        }\n\n        /// <summary>\n        /// Generates the <see cref=\"Symbol\"/> property for <see cref=\"QuantConnect.SecurityType.Base\"/> security identifiers\n        /// </summary>\n        /// <param name=\"dataType\">The base data custom data type if namespacing is required, null otherwise</param>\n        /// <param name=\"symbol\">The ticker symbol</param>\n        /// <returns>The value used for the security identifier's <see cref=\"Symbol\"/></returns>\n        public static string GenerateBaseSymbol(Type dataType, string symbol)\n        {\n            if (dataType == null)\n            {\n                return symbol;\n            }\n\n            TypeMapping[dataType.Name] = dataType;\n            return $\"{symbol.ToUpperInvariant()}.{dataType.Name}\";\n        }\n\n        /// <summary>\n        /// Tries to fetch the custom data type associated with a symbol\n        /// </summary>\n        /// <remarks>Custom data type <see cref=\"SecurityIdentifier\"/> symbol value holds their data type</remarks>\n        public static bool TryGetCustomDataType(string symbol, out string type)\n        {\n            type = null;\n            if (!string.IsNullOrEmpty(symbol))\n            {\n                var index = symbol.LastIndexOf('.');\n                if (index != -1 && symbol.Length > index + 1)\n                {\n                    type = symbol.Substring(index + 1);\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Tries to fetch the custom data type associated with a symbol\n        /// </summary>\n        /// <remarks>Custom data type <see cref=\"SecurityIdentifier\"/> symbol value holds their data type</remarks>\n        public static bool TryGetCustomDataTypeInstance(string symbol, out Type type)\n        {\n            type = null;\n            return TryGetCustomDataType(symbol, out var strType) && TypeMapping.TryGetValue(strType, out type);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a custom security with the option of providing the first date\n        /// </summary>\n        /// <param name=\"dataType\">The custom data type</param>\n        /// <param name=\"symbol\">The ticker symbol of this security</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <param name=\"mapSymbol\">Whether or not we should map this symbol</param>\n        /// <param name=\"date\">First date that the security traded on</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified base security</returns>\n        public static SecurityIdentifier GenerateBase(Type dataType, string symbol, string market, bool mapSymbol = false, DateTime? date = null)\n        {\n            var firstDate = date ?? DefaultDate;\n\n            if (mapSymbol)\n            {\n                var firstTickerDate = GetFirstTickerAndDate(MapFileProvider.Value, symbol, market, SecurityType.Equity);\n                firstDate = firstTickerDate.Item2;\n                symbol = firstTickerDate.Item1;\n            }\n\n            return Generate(\n                firstDate,\n                GenerateBaseSymbol(dataType, symbol),\n                SecurityType.Base,\n                market,\n                forceSymbolToUpper: false\n            );\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a forex pair\n        /// </summary>\n        /// <param name=\"symbol\">The currency pair in the format similar to: 'EURUSD'</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified forex pair</returns>\n        public static SecurityIdentifier GenerateForex(string symbol, string market)\n        {\n            return Generate(DefaultDate, symbol, SecurityType.Forex, market);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a Crypto pair\n        /// </summary>\n        /// <param name=\"symbol\">The currency pair in the format similar to: 'EURUSD'</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified Crypto pair</returns>\n        public static SecurityIdentifier GenerateCrypto(string symbol, string market)\n        {\n            return Generate(DefaultDate, symbol, SecurityType.Crypto, market);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a CryptoFuture pair\n        /// </summary>\n        /// <param name=\"expiry\">The date the future expires</param>\n        /// <param name=\"symbol\">The currency pair in the format similar to: 'EURUSD'</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified CryptoFuture pair</returns>\n        public static SecurityIdentifier GenerateCryptoFuture(DateTime expiry, string symbol, string market)\n        {\n            return Generate(expiry, symbol, SecurityType.CryptoFuture, market);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a CFD security\n        /// </summary>\n        /// <param name=\"symbol\">The CFD contract symbol</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified CFD security</returns>\n        public static SecurityIdentifier GenerateCfd(string symbol, string market)\n        {\n            return Generate(DefaultDate, symbol, SecurityType.Cfd, market);\n        }\n\n        /// <summary>\n        /// Generates a new <see cref=\"SecurityIdentifier\"/> for a INDEX security\n        /// </summary>\n        /// <param name=\"symbol\">The Index contract symbol</param>\n        /// <param name=\"market\">The security's market</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> representing the specified INDEX security</returns>\n        public static SecurityIdentifier GenerateIndex(string symbol, string market)\n        {\n            return Generate(DefaultDate, symbol, SecurityType.Index, market);\n        }\n\n        /// <summary>\n        /// Generic generate method. This method should be used carefully as some parameters are not required and\n        /// some parameters mean different things for different security types\n        /// </summary>\n        private static SecurityIdentifier Generate(DateTime date,\n            string symbol,\n            SecurityType securityType,\n            string market,\n            decimal strike = 0,\n            OptionRight optionRight = 0,\n            OptionStyle optionStyle = 0,\n            SecurityIdentifier underlying = null,\n            bool forceSymbolToUpper = true)\n        {\n            if ((ulong)securityType >= SecurityTypeWidth || securityType < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(securityType), Messages.SecurityIdentifier.InvalidSecurityType(nameof(securityType)));\n            }\n            if ((int)optionRight > 1 || optionRight < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(optionRight), Messages.SecurityIdentifier.InvalidOptionRight(nameof(optionRight)));\n            }\n            if (date < Time.BeginningOfTime)\n            {\n                throw new ArgumentOutOfRangeException(date.ToStringInvariant(), $\"date must be after the earliest possible date {Time.BeginningOfTime}\");\n            }\n\n            // normalize input strings\n            symbol = forceSymbolToUpper ? symbol.LazyToUpper() : symbol;\n\n            var marketIdentifier = GetMarketIdentifier(market);\n\n            var days = (ulong)date.ToOADate() * DaysOffset;\n            var marketCode = (ulong)marketIdentifier * MarketOffset;\n\n            var strk = NormalizeStrike(strike, out ulong strikeScale) * StrikeOffset;\n            strikeScale *= StrikeScaleOffset;\n            var style = (ulong)optionStyle * OptionStyleOffset;\n            var putcall = (ulong)optionRight * PutCallOffset;\n\n            var otherData = putcall + days + style + strk + strikeScale + marketCode + (ulong)securityType;\n\n            var result = new SecurityIdentifier(symbol, otherData, underlying ?? Empty);\n\n            // we already have these so lets set them. Massive performance improvement!\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                case SecurityType.Future:\n                    result._date = date;\n                    break;\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                case SecurityType.FutureOption:\n                    result._date = date;\n                    result._strikePrice = strike;\n                    result._optionRight = optionRight;\n                    result._optionStyle = optionStyle;\n                    break;\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Resolves the first ticker/date of the security represented by <paramref name=\"tickerToday\"/>\n        /// </summary>\n        /// <param name=\"mapFileProvider\">The IMapFileProvider instance used for resolving map files</param>\n        /// <param name=\"tickerToday\">The security's ticker as it trades today</param>\n        /// <param name=\"market\">The market the security exists in</param>\n        /// <param name=\"securityType\">The securityType the security exists in</param>\n        /// <param name=\"mappingResolveDate\">The date to use to resolve the map file. Default value is <see cref=\"DateTime.Today\"/></param>\n        /// <returns>The security's first ticker/date if mapping data available, otherwise, the provided ticker and DefaultDate are returned</returns>\n        private static Tuple<string, DateTime> GetFirstTickerAndDate(IMapFileProvider mapFileProvider, string tickerToday, string market, SecurityType securityType, DateTime? mappingResolveDate = null)\n        {\n            var resolver = mapFileProvider.Get(new AuxiliaryDataKey(market, securityType));\n            var mapFile = resolver.ResolveMapFile(tickerToday, mappingResolveDate ?? DateTime.Today);\n\n            // if we have mapping data, use the first ticker/date from there, otherwise use provided ticker and DefaultDate\n            return mapFile.Any()\n                ? Tuple.Create(mapFile.FirstTicker, mapFile.FirstDate)\n                : Tuple.Create(tickerToday, DefaultDate);\n        }\n\n        /// <summary>\n        /// The strike is normalized into deci-cents and then a scale factor\n        /// is also saved to bring it back to un-normalized\n        /// </summary>\n        private static ulong NormalizeStrike(decimal strike, out ulong scale)\n        {\n            var str = strike;\n\n            if (strike == 0)\n            {\n                scale = 0;\n                return 0;\n            }\n\n            // convert strike to default scaling, this keeps the scale always positive\n            strike *= StrikeDefaultScaleExpanded;\n\n            scale = 0;\n            while (strike % 10 == 0)\n            {\n                strike /= 10;\n                scale++;\n            }\n\n            // Since our max precision was previously capped at 999999 and it had 20 bits set,\n            // we sacrifice a single bit from the strike price to allow for negative strike prices.\n            // 475711 is the maximum value that can be represented when setting the negative bit because\n            // any number greater than that will cause an overflow in the strike price width and increase\n            // its width to 7 digits.\n            // The idea behind this formula is to determine what number the overflow would happen at.\n            // We get the max number representable in 19 bits, subtract the width to normalize the value,\n            // and then get the difference between the 20 bit mask and the 19 bit normalized value to get\n            // the max strike price + 1. Subtract 1 to normalize the value, and we have established an exclusive\n            // upper bound.\n            const ulong negativeMask = 1 << 19;\n            const ulong maxStrikePrice = negativeMask - ((negativeMask ^ (negativeMask - 1)) - StrikeWidth) - 1;\n\n            if (strike >= maxStrikePrice || strike <= -(long)maxStrikePrice)\n            {\n                throw new ArgumentException(Messages.SecurityIdentifier.InvalidStrikePrice(str));\n            }\n\n            if (!_logStrikePrecision && strike % 1 != 0)\n            {\n                _logStrikePrecision = true;\n                Log.Error($\"SecurityIdentifier.NormalizeStrike(): Warning losing option strike precision {str}!\");\n            }\n\n            var encodedStrike = (long)strike;\n            if (strike < 0)\n            {\n                // Flip the sign\n                encodedStrike = -encodedStrike;\n\n                // Sets the 20th bit equal to 1\n                encodedStrike |= 1 << 19;\n            }\n\n            return (ulong)encodedStrike;\n        }\n\n        /// <summary>\n        /// Accurately performs the integer exponentiation\n        /// </summary>\n        private static ulong Pow(uint x, int pow)\n        {\n            // don't use Math.Pow(double, double) due to precision issues\n            return (ulong)BigInteger.Pow(x, pow);\n        }\n\n        #endregion\n\n        #region Parsing routines\n\n        /// <summary>\n        /// Parses the specified string into a <see cref=\"SecurityIdentifier\"/>\n        /// The string must be a 40 digit number. The first 20 digits must be parseable\n        /// to a 64 bit unsigned integer and contain ancillary data about the security.\n        /// The second 20 digits must also be parseable as a 64 bit unsigned integer and\n        /// contain the symbol encoded from base36, this provides for 12 alpha numeric case\n        /// insensitive characters.\n        /// </summary>\n        /// <param name=\"value\">The string value to be parsed</param>\n        /// <returns>A new <see cref=\"SecurityIdentifier\"/> instance if the <paramref name=\"value\"/> is able to be parsed.</returns>\n        /// <exception cref=\"FormatException\">This exception is thrown if the string's length is not exactly 40 characters, or\n        /// if the components are unable to be parsed as 64 bit unsigned integers</exception>\n        public static SecurityIdentifier Parse(string value)\n        {\n            Exception exception;\n            SecurityIdentifier identifier;\n            if (!TryParse(value, out identifier, out exception))\n            {\n                throw exception;\n            }\n\n            return identifier;\n        }\n\n        /// <summary>\n        /// Attempts to parse the specified <see paramref=\"value\"/> as a <see cref=\"SecurityIdentifier\"/>.\n        /// </summary>\n        /// <param name=\"value\">The string value to be parsed</param>\n        /// <param name=\"identifier\">The result of parsing, when this function returns true, <paramref name=\"identifier\"/>\n        /// was properly created and reflects the input string, when this function returns false <paramref name=\"identifier\"/>\n        /// will equal default(SecurityIdentifier)</param>\n        /// <returns>True on success, otherwise false</returns>\n        public static bool TryParse(string value, out SecurityIdentifier identifier)\n        {\n            Exception exception;\n            return TryParse(value, out identifier, out exception);\n        }\n\n        /// <summary>\n        /// Helper method impl to be used by parse and tryparse\n        /// </summary>\n        private static bool TryParse(string value, out SecurityIdentifier identifier, out Exception exception)\n        {\n            if (!TryParseProperties(value, out exception, out identifier))\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        private static readonly char[] SplitSpace = {' '};\n\n        private static void CacheSid(string key, SecurityIdentifier identifier)\n        {\n            // limit the cache size to help with memory usage\n            if (SecurityIdentifierCache.Count >= 600000)\n            {\n                SecurityIdentifierCache.Clear();\n            }\n            SecurityIdentifierCache[key] = identifier;\n        }\n\n        /// <summary>\n        /// Parses the string into its component ulong pieces\n        /// </summary>\n        private static bool TryParseProperties(string value, out Exception exception, out SecurityIdentifier identifier)\n        {\n            exception = null;\n\n            if (value == null)\n            {\n                identifier = Empty;\n                return true;\n            }\n\n            lock (SecurityIdentifierCache)\n            {\n                // for performance, we first verify if we already have parsed this SecurityIdentifier\n                if (SecurityIdentifierCache.TryGetValue(value, out identifier))\n                {\n                    return identifier != null;\n                }\n\n                if (string.IsNullOrWhiteSpace(value) || value == \" 0\")\n                {\n                    // we know it's not null already let's cache it\n                    identifier = Empty;\n                    CacheSid(value, identifier);\n                    return true;\n                }\n\n                // after calling TryGetValue because if it failed it will set identifier to default\n                identifier = Empty;\n\n                try\n                {\n                    var sids = value.Split('|');\n                    for (var i = sids.Length - 1; i > -1; i--)\n                    {\n                        var current = sids[i];\n                        var parts = current.Split(SplitSpace, StringSplitOptions.RemoveEmptyEntries);\n                        if (parts.Length != 2)\n                        {\n                            exception = new FormatException(Messages.SecurityIdentifier.StringIsNotSplittable);\n                            return false;\n                        }\n\n                        var symbol = parts[0];\n                        var otherData = parts[1];\n                        var props = otherData.DecodeBase36();\n\n                        if (!identifier.Equals(Empty) || !SecurityIdentifierCache.TryGetValue(current, out var cachedIdentifier))\n                        {\n                            // toss the previous in as the underlying, if Empty, ignored by ctor\n                            identifier = new SecurityIdentifier(symbol, props, identifier);\n\n                            // the following method will test if the market is supported/valid\n                            GetMarketIdentifier(identifier.Market);\n\n                            var key = i < sids.Length - 1 ? $\"{current}|{sids[i + 1]}\" : current;\n                            CacheSid(key, identifier);\n                        }\n                        else\n                        {\n                            // we already have this value in the cache, just return it\n                            identifier = cachedIdentifier;\n                        }\n                    }\n                }\n                catch (Exception error)\n                {\n                    exception = error;\n                    Log.Error($@\"SecurityIdentifier.TryParseProperties(): {\n                        Messages.SecurityIdentifier.ErrorParsingSecurityIdentifier(value, exception)}\");\n                    CacheSid(value, null);\n                    return false;\n                }\n\n                return true;\n            }\n        }\n\n        /// <summary>\n        /// Extracts the embedded value from _otherData\n        /// </summary>\n        private ulong ExtractFromProperties(ulong offset, ulong width)\n        {\n            return ExtractFromProperties(offset, width, _properties);\n        }\n\n        /// <summary>\n        /// Extracts the embedded value from _otherData\n        /// </summary>\n        /// <remarks>Static so it can be used in <see cref=\"SecurityIdentifier\"/> initialization</remarks>\n        private static ulong ExtractFromProperties(ulong offset, ulong width, ulong properties)\n        {\n            return (properties / offset) % width;\n        }\n\n        /// <summary>\n        /// Gets the market code for the specified market. Raise exception if the market is not found\n        /// </summary>\n        /// <param name=\"market\">The market to check for (case sensitive)</param>\n        /// <returns>The internal code used for the market. Corresponds to the value used when calling <see cref=\"Market.Add\"/></returns>\n        private static int GetMarketIdentifier(string market)\n        {\n            market = market.ToLowerInvariant();\n\n            var marketIdentifier = QuantConnect.Market.Encode(market);\n            if (marketIdentifier.HasValue)\n            {\n                return marketIdentifier.Value;\n            }\n\n            throw new ArgumentOutOfRangeException(nameof(market), Messages.SecurityIdentifier.MarketNotFound(market));\n        }\n        #endregion\n\n        #region Equality members and ToString\n\n        /// <summary>Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. </summary>\n        /// <param name=\"other\">An object to compare with this instance. </param>\n        /// <returns>A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name=\"other\" /> in the sort order.  Zero This instance occurs in the same position in the sort order as <paramref name=\"other\" />. Greater than zero This instance follows <paramref name=\"other\" /> in the sort order. </returns>\n        public int CompareTo(SecurityIdentifier other)\n        {\n            if (ReferenceEquals(this, other))\n            {\n                return 0;\n            }\n\n            if (ReferenceEquals(null, other))\n            {\n                return 1;\n            }\n\n            return string.Compare(ToString(), other.ToString(), StringComparison.Ordinal);\n        }\n\n        /// <summary>Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.</summary>\n        /// <param name=\"obj\">An object to compare with this instance. </param>\n        /// <returns>A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name=\"obj\" /> in the sort order. Zero This instance occurs in the same position in the sort order as <paramref name=\"obj\" />. Greater than zero This instance follows <paramref name=\"obj\" /> in the sort order. </returns>\n        /// <exception cref=\"T:System.ArgumentException\">\n        /// <paramref name=\"obj\" /> is not the same type as this instance. </exception>\n        public int CompareTo(object obj)\n        {\n            if (ReferenceEquals(null, obj))\n            {\n                return 1;\n            }\n\n            if (ReferenceEquals(this, obj))\n            {\n                return 0;\n            }\n\n            if (!(obj is SecurityIdentifier))\n            {\n                throw new ArgumentException(Messages.SecurityIdentifier.UnexpectedTypeToCompareTo);\n            }\n\n            return CompareTo((SecurityIdentifier) obj);\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(SecurityIdentifier other)\n        {\n            return ReferenceEquals(this, other) || _properties == other._properties\n                && _symbol == other._symbol\n                && _underlying == other._underlying;\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param><filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (obj.GetType() != GetType()) return false;\n            return Equals((SecurityIdentifier)obj);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            if (!_hashCodeSet)\n            {\n                _hashCode = Math.Abs(unchecked(_symbol.GetHashCode() * 397) ^ _properties.GetHashCode());\n                _hashCodeSet = true;\n            }\n            return _hashCode;\n        }\n\n        /// <summary>\n        /// Override equals operator\n        /// </summary>\n        public static bool operator ==(SecurityIdentifier left, SecurityIdentifier right)\n        {\n            return Equals(left, right);\n        }\n\n        /// <summary>\n        /// Override not equals operator\n        /// </summary>\n        public static bool operator !=(SecurityIdentifier left, SecurityIdentifier right)\n        {\n            return !Equals(left, right);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            if (_stringRep == null)\n            {\n                var props = _properties.EncodeBase36();\n                props = props.Length == 0 ? \"0\" : props;\n                _stringRep = HasUnderlying ? $\"{_symbol} {props}|{_underlying}\" : $\"{_symbol} {props}\";\n            }\n\n            return _stringRep;\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Common/Series.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Linq;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing QuantConnect.Util;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Chart Series Object - Series data and properties for a chart:\n    /// </summary>\n    [JsonConverter(typeof(SeriesJsonConverter))]\n    public class Series : BaseSeries\n    {\n        /// <summary>\n        /// Color the series\n        /// </summary>\n        [JsonConverter(typeof(ColorJsonConverter))]\n        public Color Color { get; set; } = Color.Empty;\n\n        /// <summary>\n        /// Shape or symbol for the marker in a scatter plot\n        /// </summary>\n        public ScatterMarkerSymbol ScatterMarkerSymbol { get; set; } = ScatterMarkerSymbol.None;\n\n        /// <summary>\n        /// Default constructor for chart series\n        /// </summary>\n        public Series() : base() { }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        public Series(string name)\n            : base(name, SeriesType.Line)\n        {\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"type\">Type of the series</param>\n        /// <param name=\"index\">Index position on the chart of the series</param>\n        public Series(string name, SeriesType type, int index)\n            : this(name, type, index, \"$\")\n        {\n        }\n\n        /// <summary>\n        /// Foundational constructor on the series class\n        /// </summary>\n        /// <param name=\"name\">Name of the series</param>\n        /// <param name=\"type\">Type of the series</param>\n        /// <param name=\"index\">Index position on the chart of the series</param>\n        /// <param name=\"unit\">Unit for the series axis</param>\n        public Series(string name, SeriesType type, int index, string unit)\n            : this(name, type, unit, Color.Empty, ScatterMarkerSymbol.None)\n        {\n            Index = index;\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"type\">Type of the chart series</param>\n        /// <param name=\"unit\">Unit of the series</param>\n        public Series(string name, SeriesType type = SeriesType.Line, string unit = \"$\")\n            : this(name, type, unit, Color.Empty)\n        {\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"type\">Type of the chart series</param>\n        /// <param name=\"unit\">Unit of the series</param>\n        /// <param name=\"color\">Color of the series</param>\n        public Series(string name, SeriesType type, string unit, Color color)\n            : this(name, type, unit, color, ScatterMarkerSymbol.None)\n        {\n        }\n\n        /// <summary>\n        /// Constructor method for Chart Series\n        /// </summary>\n        /// <param name=\"name\">Name of the chart series</param>\n        /// <param name=\"type\">Type of the chart series</param>\n        /// <param name=\"unit\">Unit of the series</param>\n        /// <param name=\"color\">Color of the series</param>\n        /// <param name=\"symbol\">Symbol for the marker in a scatter plot series</param>\n        public Series(string name, SeriesType type, string unit, Color color, ScatterMarkerSymbol symbol = ScatterMarkerSymbol.None)\n            : base(name, type, 0, unit)\n        {\n            Color = color;\n            ScatterMarkerSymbol = symbol;\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"time\">Time of the chart point</param>\n        /// <param name=\"value\">Value of the chart point</param>\n        public void AddPoint(DateTime time, decimal value)\n        {\n            ISeriesPoint point;\n            if (SeriesType == SeriesType.Scatter)\n            {\n                point = new ScatterChartPoint(time, value);\n            }\n            else\n            {\n                point = new ChartPoint(time, value);\n            }\n            AddPoint(point);\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"point\">The data point to add</param>\n        public override void AddPoint(ISeriesPoint point)\n        {\n            if (point as ChartPoint == null)\n            {\n                throw new ArgumentException(\"Series.AddPoint requires a ChartPoint object\");\n            }\n\n            base.AddPoint(point);\n        }\n\n        /// <summary>\n        /// Add a new point to this series\n        /// </summary>\n        /// <param name=\"time\">The time of the data point</param>\n        /// <param name=\"values\">The values of the data point</param>\n        public override void AddPoint(DateTime time, List<decimal> values)\n        {\n            if (values.Count > 1)\n            {\n                throw new ArgumentException(\"Series.AddPoint requires a single value\");\n            }\n\n            AddPoint(time, values.Count > 0 ? values[0] : 0);\n        }\n\n        /// <summary>\n        /// Will sum up all chart points into a new single value, using the time of latest point\n        /// </summary>\n        /// <returns>The new chart point</returns>\n        public override ISeriesPoint ConsolidateChartPoints()\n        {\n            if (Values.Count <= 0) return null;\n\n            var sum = 0m;\n            foreach (ChartPoint point in Values)\n            {\n                if (point.y.HasValue)\n                {\n                    sum += point.y.Value;\n                }\n            }\n\n            var lastPoint = (ChartPoint)Values.Last();\n            return new ChartPoint(lastPoint.x, sum);\n        }\n\n        /// <summary>\n        /// Return a new instance clone of this object\n        /// </summary>\n        /// <returns></returns>\n        public override BaseSeries Clone(bool empty = false)\n        {\n            var series = new Series(Name, SeriesType, Index, Unit)\n            {\n                Color = Color,\n                ZIndex = ZIndex,\n                Tooltip = Tooltip,\n                IndexName = IndexName,\n                ScatterMarkerSymbol = ScatterMarkerSymbol,\n            };\n\n            if (!empty)\n            {\n                series.Values = CloneValues();\n            }\n\n            return series;\n        }\n    }\n\n    /// <summary>\n    /// Shape or symbol for the marker in a scatter plot\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter))]\n    public enum ScatterMarkerSymbol\n    {\n        /// <summary>\n        /// Circle symbol (0)\n        /// </summary>\n        [EnumMember(Value = \"none\")]\n        None,\n\n        /// <summary>\n        /// Circle symbol (1)\n        /// </summary>\n        [EnumMember(Value = \"circle\")]\n        Circle,\n\n        /// <summary>\n        /// Square symbol (2)\n        /// </summary>\n        [EnumMember(Value = \"square\")]\n        Square,\n\n        /// <summary>\n        /// Diamond symbol (3)\n        /// </summary>\n        [EnumMember(Value = \"diamond\")]\n        Diamond,\n\n        /// <summary>\n        /// Triangle symbol (4)\n        /// </summary>\n        [EnumMember(Value = \"triangle\")]\n        Triangle,\n\n        /// <summary>\n        /// Triangle-down symbol (5)\n        /// </summary>\n        [EnumMember(Value = \"triangle-down\")]\n        TriangleDown\n    }\n}\n"
  },
  {
    "path": "Common/SeriesSampler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// A type capable of taking a chart and resampling using a linear interpolation strategy\n    /// </summary>\n    public class SeriesSampler\n    {\n        /// <summary>\n        /// The desired sampling resolution\n        /// </summary>\n        protected TimeSpan Step { get; set; }\n\n        /// <summary>\n        /// True if sub sampling is enabled, if false only subsampling will happen\n        /// </summary>\n        public bool SubSample { get; set; } = true;\n\n        /// <summary>\n        /// Creates a new SeriesSampler to sample Series data on the specified resolution\n        /// </summary>\n        /// <param name=\"resolution\">The desired sampling resolution</param>\n        public SeriesSampler(TimeSpan resolution)\n        {\n            Step = resolution;\n        }\n\n        /// <summary>\n        /// Samples the given series\n        /// </summary>\n        /// <param name=\"series\">The series to be sampled</param>\n        /// <param name=\"start\">The date to start sampling, if before start of data then start of data will be used</param>\n        /// <param name=\"stop\">The date to stop sampling, if after stop of data, then stop of data will be used</param>\n        /// <param name=\"truncateValues\">True will truncate values to integers</param>\n        /// <returns>The sampled series</returns>\n        public virtual BaseSeries Sample(BaseSeries series, DateTime start, DateTime stop, bool truncateValues = false)\n        {\n            if (!SubSample && series.Values.Count > 1)\n            {\n                var dataDiff = series.Values[1].Time - series.Values[0].Time;\n                if (dataDiff >= Step)\n                {\n                    // we don't want to subsample this case, directly return what we are given as long as is within the range\n                    return GetIdentitySeries(series.Clone(empty: true), series, start, stop, truncateValues: false);\n                }\n            }\n\n            if (series is Series seriesToSample)\n            {\n                return SampleSeries(seriesToSample, start, stop, truncateValues);\n            }\n\n            if (series is CandlestickSeries candlestickSeries)\n            {\n                return SampleCandlestickSeries(candlestickSeries, start, stop, truncateValues);\n            }\n\n            throw new ArgumentException($\"SeriesSampler.Sample(): Sampling only supports {typeof(Series)} and {typeof(CandlestickSeries)}\");\n        }\n\n        /// <summary>\n        /// Samples the given charts\n        /// </summary>\n        /// <param name=\"charts\">The charts to be sampled</param>\n        /// <param name=\"start\">The date to start sampling</param>\n        /// <param name=\"stop\">The date to stop sampling</param>\n        /// <returns>The sampled charts</returns>\n        public Dictionary<string, Chart> SampleCharts(IDictionary<string, Chart> charts, DateTime start, DateTime stop)\n        {\n            var sampledCharts = new Dictionary<string, Chart>();\n            foreach (var chart in charts.Values)\n            {\n                sampledCharts[chart.Name] = SampleChart(chart, start, stop);\n            }\n            return sampledCharts;\n        }\n\n        /// <summary>\n        /// Samples the given chart\n        /// </summary>\n        /// <param name=\"chart\">The chart to be sampled</param>\n        /// <param name=\"start\">The date to start sampling</param>\n        /// <param name=\"stop\">The date to stop sampling</param>\n        /// <returns>The sampled chart</returns>\n        public Chart SampleChart(Chart chart, DateTime start, DateTime stop)\n        {\n            var sampledChart = chart.CloneEmpty();\n            foreach (var series in chart.Series.Values)\n            {\n                var sampledSeries = Sample(series, start, stop);\n                if (sampledSeries.Values.Count == 0)\n                {\n                    continue;\n                }\n                sampledChart.AddSeries(sampledSeries);\n            }\n            return sampledChart;\n        }\n\n        /// <summary>\n        /// Samples the given series\n        /// </summary>\n        /// <param name=\"series\">The series to be sampled</param>\n        /// <param name=\"start\">The date to start sampling, if before start of data then start of data will be used</param>\n        /// <param name=\"stop\">The date to stop sampling, if after stop of data, then stop of data will be used</param>\n        /// <param name=\"truncateValues\">True will truncate values to integers</param>\n        /// <returns>The sampled series</returns>\n        private Series SampleSeries(Series series, DateTime start, DateTime stop, bool truncateValues)\n        {\n            var sampled = (Series)series.Clone(empty: true);\n\n            var nextSampleTime = start;\n\n            // we can't sample a single point and it doesn't make sense to sample scatter plots\n            // in this case just copy the raw data\n            if (series.Values.Count < 2 || series.SeriesType == SeriesType.Scatter || series.SeriesType == SeriesType.StackedArea)\n            {\n                return GetIdentitySeries(sampled, series, start, stop, truncateValues);\n            }\n\n            var enumerator = series.Values.Cast<ChartPoint>().GetEnumerator();\n\n            // initialize current/previous\n            enumerator.MoveNext();\n            var previous = enumerator.Current;\n            enumerator.MoveNext();\n            var current = enumerator.Current;\n\n            // make sure we don't start sampling before the data begins\n            if (nextSampleTime < previous.Time)\n            {\n                nextSampleTime = previous.Time;\n            }\n\n            // make sure to advance into the requested time frame before sampling\n            while (current.Time < nextSampleTime && enumerator.MoveNext())\n            {\n                previous = current;\n                current = enumerator.Current;\n            }\n\n            do\n            {\n                // iterate until we pass where we want our next point\n                while (nextSampleTime <= current.Time && nextSampleTime <= stop)\n                {\n                    ISeriesPoint sampledPoint;\n                    if (series.SeriesType == SeriesType.Treemap)\n                    {\n                        // just carry along the values\n                        sampledPoint = new ChartPoint(nextSampleTime, (nextSampleTime + Step) > current.Time ? current.Y : previous.Y);\n                    }\n                    else\n                    {\n                        sampledPoint = TruncateValue(Interpolate(previous, current, nextSampleTime, (decimal)Step.TotalSeconds), truncateValues, clone: false);\n                    }\n\n                    nextSampleTime += Step;\n                    if (SubSample)\n                    {\n                        sampled.Values.Add(sampledPoint);\n                    }\n                    else\n                    {\n                        if (current.Time < nextSampleTime)\n                        {\n                            sampled.Values.Add(sampledPoint);\n                        }\n                    }\n                }\n\n                // advance our current/previous\n                if (nextSampleTime > current.Time)\n                {\n                    if (enumerator.MoveNext())\n                    {\n                        previous = current;\n                        current = enumerator.Current;\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n            }\n            // if we've passed our stop then we're finished sampling\n            while (nextSampleTime <= stop);\n\n            enumerator.DisposeSafely();\n            return sampled;\n        }\n\n        /// <summary>\n        /// Samples the given candlestick series\n        /// </summary>\n        /// <param name=\"series\">The series to be sampled</param>\n        /// <param name=\"start\">The date to start sampling, if before start of data then start of data will be used</param>\n        /// <param name=\"stop\">The date to stop sampling, if after stop of data, then stop of data will be used</param>\n        /// <param name=\"truncateValues\">True will truncate values to integers</param>\n        /// <returns>The sampled series</returns>\n        private CandlestickSeries SampleCandlestickSeries(CandlestickSeries series, DateTime start, DateTime stop, bool truncateValues)\n        {\n            var sampledSeries = (CandlestickSeries)series.Clone(empty: true);\n\n            var candlesticks = series.Values;\n            var seriesSize = candlesticks.Count;\n\n            // we can't sample a single point, so just copy the raw data\n            if (seriesSize < 2)\n            {\n                return GetIdentitySeries(sampledSeries, series, start, stop, truncateValues);\n            }\n\n            // Make sure we don't start sampling before the data begins.\n            var nextSampleTime = start;\n            if (start < candlesticks[0].Time)\n            {\n                nextSampleTime = candlesticks[0].Time;\n            }\n\n            // Find the first candlestick that is after the start time.\n            // This variable will also be used to keep track of the first candlestick to be aggregated.\n            var startIndex = candlesticks.FindIndex(x => x.Time > nextSampleTime) - 1;\n            if (startIndex < 0)\n            {\n                // there's no value before the start, just return identity\n                return GetIdentitySeries(sampledSeries, series, start, stop, truncateValues);\n            }\n            if (candlesticks[startIndex].Time == nextSampleTime && nextSampleTime <= stop)\n            {\n                sampledSeries.Values.Add(candlesticks[startIndex].Clone());\n                nextSampleTime += Step;\n                startIndex++;\n            }\n\n            // We iterate ignoring the last candlestick because we need to check the next candlestick on each iteration.\n            for (var i = startIndex; i < seriesSize && nextSampleTime <= stop; i++)\n            {\n                var current = (Candlestick)candlesticks[i];\n                Candlestick next = null;\n                if (i + 1 < candlesticks.Count)\n                {\n                    next = (Candlestick)candlesticks[i + 1];\n                }\n                if (nextSampleTime > current.Time)\n                {\n                    // these bars will be aggregated\n                    continue;\n                }\n\n                // Form the bar(s) between candlesticks at startIndex and i\n                var aggregated = startIndex != i;\n                var sampledCandlestick = AggregateCandlesticks(candlesticks, startIndex, i + 1, nextSampleTime, truncateValues);\n\n                var first = (Candlestick)candlesticks[startIndex];\n                var firstOpenTime = startIndex > 0\n                    ? candlesticks[startIndex - 1].Time\n                    : first.Time - (candlesticks[startIndex + 1].Time - candlesticks[startIndex].Time);\n                Candlestick previous = null;\n                var isNull = false;\n                do\n                {\n                    var interpolated = Interpolate(sampledCandlestick, first, current, firstOpenTime, nextSampleTime, (decimal)Step.TotalSeconds);\n                    nextSampleTime += Step;\n\n                    if (SubSample)\n                    {\n                        if (previous != null)\n                        {\n                            interpolated.Open = previous.Close;\n                        }\n                        sampledSeries.Values.Add(interpolated);\n                    }\n                    else if (current.Time < nextSampleTime)\n                    {\n                        sampledSeries.Values.Add(interpolated);\n                    }\n                    previous = interpolated;\n\n                    if (!aggregated)\n                    {\n                        // when subsampling, we build the high and low based on the open and close of the interpolated bar, not the bar we are sampling\n                        interpolated.High = interpolated.Close;\n                        interpolated.Low = interpolated.Close;\n                        if (interpolated.Open.HasValue)\n                        {\n                            if (!interpolated.Close.HasValue || interpolated.Open > interpolated.Close.Value)\n                            {\n                                interpolated.High = interpolated.Open.Value;\n                            }\n                            if (!interpolated.Close.HasValue || interpolated.Open < interpolated.Close.Value)\n                            {\n                                interpolated.Low = interpolated.Open.Value;\n                            }\n                        }\n                    }\n\n                    if (next != null && (nextSampleTime + Step) < next.Time && interpolated.Open == null)\n                    {\n                        isNull = true;\n                    }\n                    else\n                    {\n                        isNull = false;\n                    }\n                }\n                while ((nextSampleTime <= current.Time || isNull) && nextSampleTime <= stop);\n\n                // Update the start index\n                startIndex = i + 1;\n            }\n\n            return sampledSeries;\n        }\n\n        /// <summary>\n        /// Aggregates the candlesticks in the given range into a single candlestick,\n        /// keeping the first open and last close and calculating highest high and lowest low\n        /// </summary>\n        private static Candlestick AggregateCandlesticks(List<ISeriesPoint> candlesticks, int start, int end, DateTime time, bool truncateValues)\n        {\n            var aggregatedCandlestick = new Candlestick\n            {\n                Time = time\n            };\n\n            for (var j = start; j < end; j++)\n            {\n                var current = (Candlestick)candlesticks[j];\n                aggregatedCandlestick.Update(current.Open);\n                aggregatedCandlestick.Update(current.High);\n                aggregatedCandlestick.Update(current.Low);\n                aggregatedCandlestick.Update(current.Close);\n            }\n\n            return (Candlestick)TruncateValue(aggregatedCandlestick, truncateValues, clone: false);\n        }\n\n        /// <summary>\n        /// Linear interpolation used for sampling\n        /// </summary>\n        protected static decimal? Interpolate(decimal x0, decimal? y0, decimal x1, decimal? y1, decimal xTarget, decimal step)\n        {\n            if (!y1.HasValue)\n            {\n                // if the next point isn't there we wont interpolate the value, it means it's the end, unless the target time is the current time or close\n                if (xTarget - x0 <= step)\n                {\n                    return y0;\n                }\n                return null;\n            }\n\n            if (!y0.HasValue)\n            {\n                // if the previous value isn't there, return null unlesss we reach the target end time or close enough\n                if (x1 - xTarget <= step)\n                {\n                    return y1;\n                }\n                return null;\n            }\n\n            //  y=mx+b\n            return (y1 - y0) * (xTarget - x0) / (x1 - x0) + y0;\n        }\n\n        /// <summary>\n        /// Linear interpolation used for sampling\n        /// </summary>\n        private static ChartPoint Interpolate(ChartPoint previous, ChartPoint current, DateTime targetTime, decimal step)\n        {\n            if (current.X == previous.X)\n            {\n                return (ChartPoint)current.Clone();\n            }\n\n            var targetUnixTime = Time.DateTimeToUnixTimeStamp(targetTime).SafeDecimalCast();\n\n            return new ChartPoint(targetTime, Interpolate(previous.X, previous.Y, current.X, current.Y, targetUnixTime, step));\n        }\n\n        /// <summary>\n        /// Linear interpolation used for sampling\n        /// </summary>\n        private static Candlestick Interpolate(Candlestick template, Candlestick first, Candlestick current,\n            DateTime firstOpenTime, DateTime targetTime, decimal step)\n        {\n            Candlestick result;\n            if (firstOpenTime == current.Time)\n            {\n                result = (Candlestick)current.Clone();\n                result.Time = targetTime;\n                return result;\n            }\n\n            result = (Candlestick)template.Clone();\n            result.Time = targetTime;\n\n            var targetUnixTime = Time.DateTimeToUnixTimeStamp(targetTime).SafeDecimalCast();\n            var firstOpenUnitTime = Time.DateTimeToUnixTimeStamp(firstOpenTime).SafeDecimalCast();\n            result.Close = Interpolate(firstOpenUnitTime, first.Open, current.LongTime, current.Close, targetUnixTime, step);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Truncates the value/values of the point after cloning it to avoid mutating the original point\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static ISeriesPoint TruncateValue(ISeriesPoint point, bool truncate, bool clone = false)\n        {\n            if (!truncate)\n            {\n                return point;\n            }\n\n            var truncatedPoint = clone ? point.Clone() : point;\n\n            if (truncatedPoint is ChartPoint chartPoint)\n            {\n                chartPoint.y = SafeTruncate(chartPoint.y);\n            }\n            else if (truncatedPoint is Candlestick candlestick)\n            {\n                candlestick.Open = SafeTruncate(candlestick.Open);\n                candlestick.High = SafeTruncate(candlestick.High);\n                candlestick.Low = SafeTruncate(candlestick.Low);\n                candlestick.Close = SafeTruncate(candlestick.Close);\n            }\n\n            return truncatedPoint;\n        }\n\n        /// <summary>\n        /// Gets the identity series, this is the series with no sampling applied.\n        /// </summary>\n        protected static T GetIdentitySeries<T>(T sampled, T series, DateTime start, DateTime stop, bool truncateValues)\n            where T : BaseSeries\n        {\n            // we can minimally verify we're within the start/stop interval\n            foreach (var point in series.Values)\n            {\n                if (point.Time >= start && point.Time <= stop)\n                {\n                    sampled.Values.Add(TruncateValue(point, truncateValues, clone: true));\n                }\n            }\n            return sampled;\n        }\n\n        private static decimal? SafeTruncate(decimal? value)\n        {\n            if (value.HasValue)\n            {\n                return Math.Truncate(value.Value);\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/AlgorithmPerformance.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"AlgorithmPerformance\"/> class is a wrapper for <see cref=\"TradeStatistics\"/> and <see cref=\"PortfolioStatistics\"/>\n    /// </summary>\n    public class AlgorithmPerformance\n    {\n        /// <summary>\n        /// The algorithm statistics on closed trades\n        /// </summary>\n        public TradeStatistics TradeStatistics { get; set; }\n\n        /// <summary>\n        /// The algorithm statistics on portfolio\n        /// </summary>\n        public PortfolioStatistics PortfolioStatistics { get; set; }\n\n        /// <summary>\n        /// The list of closed trades\n        /// </summary>\n        public List<Trade> ClosedTrades { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmPerformance\"/> class\n        /// </summary>\n        /// <param name=\"trades\">The list of closed trades</param>\n        /// <param name=\"profitLoss\">Trade record of profits and losses</param>\n        /// <param name=\"equity\">The list of daily equity values</param>\n        /// <param name=\"portfolioTurnover\">The algorithm portfolio turnover</param>\n        /// <param name=\"listPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"listBenchmark\">The list of benchmark values</param>\n        /// <param name=\"startingCapital\">The algorithm starting capital</param>\n        /// <param name=\"winningTransactions\">Number of winning transactions</param>\n        /// <param name=\"losingTransactions\">Number of losing transactions</param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to use</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year</param>\n        public AlgorithmPerformance(\n            List<Trade> trades,\n            SortedDictionary<DateTime, decimal> profitLoss,\n            SortedDictionary<DateTime, decimal> equity,\n            SortedDictionary<DateTime, decimal> portfolioTurnover,\n            List<double> listPerformance,\n            List<double> listBenchmark,\n            decimal startingCapital,\n            int winningTransactions,\n            int losingTransactions,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel,\n            int tradingDaysPerYear)\n        {\n\n            TradeStatistics = new TradeStatistics(trades);\n            PortfolioStatistics = new PortfolioStatistics(profitLoss, equity, portfolioTurnover, listPerformance, listBenchmark, startingCapital,\n                riskFreeInterestRateModel, tradingDaysPerYear, winningTransactions, losingTransactions);\n            ClosedTrades = trades;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmPerformance\"/> class\n        /// </summary>\n        public AlgorithmPerformance()\n        {\n            TradeStatistics = new TradeStatistics();\n            PortfolioStatistics = new PortfolioStatistics();\n            ClosedTrades = new List<Trade>();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmPerformance\"/> class\n        /// </summary>\n        /// <param name=\"other\">The performance instance to use as a base</param>\n        public AlgorithmPerformance(AlgorithmPerformance other)\n        {\n            TradeStatistics = other.TradeStatistics;\n            PortfolioStatistics = other.PortfolioStatistics;\n            ClosedTrades = other.ClosedTrades;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/DrawdownMetrics.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// Represents the result of a drawdown analysis, including the maximum drawdown percentage\n    /// and the maximum recovery time in days.\n    /// </summary>\n    public class DrawdownMetrics\n    {\n        /// <summary>\n        /// Gets the maximum drawdown as a positive percentage.\n        /// </summary>\n        public decimal Drawdown { get; }\n\n        /// <summary>\n        /// Gets the maximum recovery time in days from peak to full recovery.\n        /// </summary>\n        public int DrawdownRecovery { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DrawdownMetrics\"/> class\n        /// with the specified maximum drawdown and recovery time.\n        /// </summary>\n        /// <param name=\"drawdown\">The maximum drawdown as a positive percentage.</param>\n        /// <param name=\"recoveryTime\">The maximum number of days it took to recover from a drawdown.</param>\n        public DrawdownMetrics(decimal drawdown, int recoveryTime)\n        {\n            Drawdown = drawdown;\n            DrawdownRecovery = recoveryTime;\n        }\n    }\n}"
  },
  {
    "path": "Common/Statistics/IStatisticsService.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.ComponentModel.Composition;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// This interface exposes methods for accessing algorithm statistics results at runtime.\n    /// </summary>\n    public interface IStatisticsService\n    {\n        /// <summary>\n        /// Calculates and gets the current statistics for the algorithm\n        /// </summary>\n        /// <returns>The current statistics</returns>\n        StatisticsResults StatisticsResults();\n\n        /// <summary>\n        /// Sets or updates a custom summary statistic\n        /// </summary>\n        /// <param name=\"name\">The statistic name</param>\n        /// <param name=\"value\">The statistic value</param>\n        void SetSummaryStatistic(string name, string value);\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/PerformanceMetrics.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// PerformanceMetrics contains the names of the various performance metrics used for evaluation purposes.\n    /// </summary>\n    public static class PerformanceMetrics\n    {\n        /// <summary>\n        /// Algorithm \"Alpha\" statistic - abnormal returns over the risk free rate and the relationshio (beta) with the benchmark returns.\n        /// </summary>\n        public const string Alpha = \"Alpha\";\n\n        /// <summary>\n        /// Annualized standard deviation\n        /// </summary>\n        public const string AnnualStandardDeviation = \"Annual Standard Deviation\";\n\n        /// <summary>\n        /// Annualized variance statistic calculation using the daily performance variance and trading days per year.\n        /// </summary>\n        public const string AnnualVariance = \"Annual Variance\";\n\n        /// <summary>\n        /// The average rate of return for losing trades\n        /// </summary>\n        public const string AverageLoss = \"Average Loss\";\n\n        /// <summary>\n        /// The average rate of return for winning trades\n        /// </summary>\n        public const string AverageWin = \"Average Win\";\n\n        /// <summary>\n        /// Algorithm \"beta\" statistic - the covariance between the algorithm and benchmark performance, divided by benchmark's variance\n        /// </summary>\n        public const string Beta = \"Beta\";\n\n        /// <summary>\n        /// Annual compounded returns statistic based on the final-starting capital and years.\n        /// </summary>\n        public const string CompoundingAnnualReturn = \"Compounding Annual Return\";\n\n        /// <summary>\n        /// Drawdown maximum percentage.\n        /// </summary>\n        public const string Drawdown = \"Drawdown\";\n\n        /// <summary>\n        /// Total capacity of the algorithm\n        /// </summary>\n        public const string EstimatedStrategyCapacity = \"Estimated Strategy Capacity\";\n\n        /// <summary>\n        /// The expected value of the rate of return\n        /// </summary>\n        public const string Expectancy = \"Expectancy\";\n\n        /// <summary>\n        /// Initial Equity Total Value\n        /// </summary>\n        public const string StartEquity = \"Start Equity\";\n\n        /// <summary>\n        /// Final Equity Total Value\n        /// </summary>\n        public const string EndEquity = \"End Equity\";\n\n        /// <summary>\n        /// Information ratio - risk adjusted return\n        /// </summary>\n        public const string InformationRatio = \"Information Ratio\";\n\n        /// <summary>\n        /// The ratio of the number of losing trades to the total number of trades\n        /// </summary>\n        public const string LossRate = \"Loss Rate\";\n\n        /// <summary>\n        /// Total net profit percentage\n        /// </summary>\n        public const string NetProfit = \"Net Profit\";\n\n        /// <summary>\n        /// Probabilistic Sharpe Ratio is a probability measure associated with the Sharpe ratio.\n        /// It informs us of the probability that the estimated Sharpe ratio is greater than a chosen benchmark\n        /// </summary>\n        /// <remarks>See https://www.quantconnect.com/forum/discussion/6483/probabilistic-sharpe-ratio/p1</remarks>\n        public const string ProbabilisticSharpeRatio = \"Probabilistic Sharpe Ratio\";\n\n        /// <summary>\n        /// The ratio of the average win rate to the average loss rate\n        /// </summary>\n        /// <remarks>If the average loss rate is zero, ProfitLossRatio is set to 0</remarks>\n        public const string ProfitLossRatio = \"Profit-Loss Ratio\";\n\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        public const string SharpeRatio = \"Sharpe Ratio\";\n\n        /// <summary>\n        /// Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        public const string SortinoRatio = \"Sortino Ratio\";\n\n        /// <summary>\n        /// Total amount of fees in the account currency\n        /// </summary>\n        public const string TotalFees = \"Total Fees\";\n\n        /// <summary>\n        /// Total amount of orders in the algorithm\n        /// </summary>\n        public const string TotalOrders = \"Total Orders\";\n\n        /// <summary>\n        /// Tracking error volatility (TEV) statistic - a measure of how closely a portfolio follows the index to which it is benchmarked\n        /// </summary>\n        /// <remarks>If algo = benchmark, TEV = 0</remarks>\n        public const string TrackingError = \"Tracking Error\";\n\n        /// <summary>\n        /// Treynor ratio statistic is a measurement of the returns earned in excess of that which could have been earned on an investment that has no diversifiable risk\n        /// </summary>\n        public const string TreynorRatio = \"Treynor Ratio\";\n\n        /// <summary>\n        /// The ratio of the number of winning trades to the total number of trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, WinRate is set to zero</remarks>\n        public const string WinRate = \"Win Rate\";\n\n        /// <summary>\n        /// Provide a reference to the lowest capacity symbol used in scaling down the capacity for debugging.\n        /// </summary>\n        public const string LowestCapacityAsset = \"Lowest Capacity Asset\";\n\n        /// <summary>\n        /// The average Portfolio Turnover\n        /// </summary>\n        public const string PortfolioTurnover = \"Portfolio Turnover\";\n\n        /// <summary>\n        /// The recovery time of the maximum drawdown.\n        /// </summary>\n        public const string DrawdownRecovery = \"Drawdown Recovery\";\n\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/PortfolioStatistics.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing MathNet.Numerics.Distributions;\nusing MathNet.Numerics.Statistics;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"PortfolioStatistics\"/> class represents a set of statistics calculated from equity and benchmark samples\n    /// </summary>\n    public class PortfolioStatistics\n    {\n        /// <summary>\n        /// The average rate of return for winning trades\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageWinRate { get; set; }\n\n        /// <summary>\n        /// The average rate of return for losing trades\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageLossRate { get; set; }\n\n        /// <summary>\n        /// The ratio of the average win rate to the average loss rate\n        /// </summary>\n        /// <remarks>If the average loss rate is zero, ProfitLossRatio is set to 0</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitLossRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of winning trades to the total number of trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, WinRate is set to zero</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal WinRate { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of losing trades to the total number of trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, LossRate is set to zero</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LossRate { get; set; }\n\n        /// <summary>\n        /// The expected value of the rate of return\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal Expectancy { get; set; }\n\n        /// <summary>\n        /// Initial Equity Total Value\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal StartEquity { get; set; }\n\n        /// <summary>\n        /// Final Equity Total Value\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal EndEquity { get; set; }\n\n        /// <summary>\n        /// Annual compounded returns statistic based on the final-starting capital and years.\n        /// </summary>\n        /// <remarks>Also known as Compound Annual Growth Rate (CAGR)</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal CompoundingAnnualReturn { get; set; }\n\n        /// <summary>\n        /// Drawdown maximum percentage.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal Drawdown { get; set; }\n\n        /// <summary>\n        /// The total net profit percentage.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TotalNetProfit { get; set; }\n\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal SharpeRatio { get; set; }\n\n        /// <summary>\n        /// Probabilistic Sharpe Ratio is a probability measure associated with the Sharpe ratio.\n        /// It informs us of the probability that the estimated Sharpe ratio is greater than a chosen benchmark\n        /// </summary>\n        /// <remarks>See https://www.quantconnect.com/forum/discussion/6483/probabilistic-sharpe-ratio/p1</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProbabilisticSharpeRatio { get; set; }\n\n        /// <summary>\n        /// Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal SortinoRatio { get; set; }\n\n        /// <summary>\n        /// Algorithm \"Alpha\" statistic - abnormal returns over the risk free rate and the relationshio (beta) with the benchmark returns.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal Alpha { get; set; }\n\n        /// <summary>\n        /// Algorithm \"beta\" statistic - the covariance between the algorithm and benchmark performance, divided by benchmark's variance\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal Beta { get; set; }\n\n        /// <summary>\n        /// Annualized standard deviation\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AnnualStandardDeviation { get; set; }\n\n        /// <summary>\n        /// Annualized variance statistic calculation using the daily performance variance and trading days per year.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AnnualVariance { get; set; }\n\n        /// <summary>\n        /// Information ratio - risk adjusted return\n        /// </summary>\n        /// <remarks>(risk = tracking error volatility, a volatility measures that considers the volatility of both algo and benchmark)</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal InformationRatio { get; set; }\n\n        /// <summary>\n        /// Tracking error volatility (TEV) statistic - a measure of how closely a portfolio follows the index to which it is benchmarked\n        /// </summary>\n        /// <remarks>If algo = benchmark, TEV = 0</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TrackingError { get; set; }\n\n        /// <summary>\n        /// Treynor ratio statistic is a measurement of the returns earned in excess of that which could have been earned on an investment that has no diversifiable risk\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TreynorRatio { get; set; }\n\n        /// <summary>\n        /// The average Portfolio Turnover\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal PortfolioTurnover { get; set; }\n\n        /// <summary>\n        /// The 1-day VaR for the portfolio, using the Variance-covariance approach.\n        /// Assumes a 99% confidence level, 1 year lookback period, and that the returns are normally distributed.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ValueAtRisk99 { get; set; }\n\n        /// <summary>\n        /// The 1-day VaR for the portfolio, using the Variance-covariance approach.\n        /// Assumes a 95% confidence level, 1 year lookback period, and that the returns are normally distributed.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ValueAtRisk95 { get; set; }\n\n        /// <summary>\n        /// The recovery time of the maximum drawdown.\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public int DrawdownRecovery { get; set; }\n\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PortfolioStatistics\"/> class\n        /// </summary>\n        /// <param name=\"profitLoss\">Trade record of profits and losses</param>\n        /// <param name=\"equity\">The list of daily equity values</param>\n        /// <param name=\"portfolioTurnover\">The algorithm portfolio turnover</param>\n        /// <param name=\"listPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"listBenchmark\">The list of benchmark values</param>\n        /// <param name=\"startingCapital\">The algorithm starting capital</param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to use</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year</param>\n        /// <param name=\"winCount\">\n        /// The number of wins, including ITM options with profitLoss less than 0.\n        /// If this and <paramref name=\"lossCount\"/> are null, they will be calculated from <paramref name=\"profitLoss\"/>\n        /// </param>\n        /// <param name=\"lossCount\">The number of losses</param>\n        public PortfolioStatistics(\n            SortedDictionary<DateTime, decimal> profitLoss,\n            SortedDictionary<DateTime, decimal> equity,\n            SortedDictionary<DateTime, decimal> portfolioTurnover,\n            List<double> listPerformance,\n            List<double> listBenchmark,\n            decimal startingCapital,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel,\n            int tradingDaysPerYear,\n            int? winCount = null,\n            int? lossCount = null)\n        {\n            StartEquity = startingCapital;\n            EndEquity = equity.LastOrDefault().Value;\n\n            if (portfolioTurnover.Count > 0)\n            {\n                PortfolioTurnover = portfolioTurnover.Select(kvp => kvp.Value).Average();\n            }\n\n            if (startingCapital == 0\n                // minimum amount of samples to calculate variance\n                || listBenchmark.Count < 2\n                || listPerformance.Count < 2)\n            {\n                return;\n            }\n\n            var runningCapital = startingCapital;\n            var totalProfit = 0m;\n            var totalLoss = 0m;\n            var totalWins = 0;\n            var totalLosses = 0;\n            foreach (var pair in profitLoss)\n            {\n                var tradeProfitLoss = pair.Value;\n\n                if (tradeProfitLoss > 0)\n                {\n                    totalProfit += tradeProfitLoss / runningCapital;\n                    totalWins++;\n                }\n                else\n                {\n                    totalLoss += tradeProfitLoss / runningCapital;\n                    totalLosses++;\n                }\n\n                runningCapital += tradeProfitLoss;\n            }\n\n            AverageWinRate = totalWins == 0 ? 0 : totalProfit / totalWins;\n            AverageLossRate = totalLosses == 0 ? 0 : totalLoss / totalLosses;\n            ProfitLossRatio = AverageLossRate == 0 ? 0 : AverageWinRate / Math.Abs(AverageLossRate);\n\n            // Set the actual total wins and losses count.\n            // Some options assignments (ITM) count as wins even though they are losses.\n            if (winCount.HasValue && lossCount.HasValue)\n            {\n                totalWins = winCount.Value;\n                totalLosses = lossCount.Value;\n            }\n\n            var totalTrades = totalWins + totalLosses;\n            WinRate = totalTrades == 0 ? 0 : (decimal)totalWins / totalTrades;\n            LossRate = totalTrades == 0 ? 0 : (decimal)totalLosses / totalTrades;\n            Expectancy = WinRate * ProfitLossRatio - LossRate;\n\n            if (startingCapital != 0)\n            {\n                TotalNetProfit = equity.Values.LastOrDefault() / startingCapital - 1;\n            }\n\n            var fractionOfYears = (decimal)(equity.Keys.LastOrDefault() - equity.Keys.FirstOrDefault()).TotalDays / 365;\n            CompoundingAnnualReturn = Statistics.CompoundingAnnualPerformance(startingCapital, equity.Values.LastOrDefault(), fractionOfYears);\n\n            AnnualVariance = Statistics.AnnualVariance(listPerformance, tradingDaysPerYear).SafeDecimalCast();\n            AnnualStandardDeviation = (decimal)Math.Sqrt((double)AnnualVariance);\n\n            var benchmarkAnnualPerformance = GetAnnualPerformance(listBenchmark, tradingDaysPerYear);\n            var annualPerformance = GetAnnualPerformance(listPerformance, tradingDaysPerYear);\n\n            var riskFreeRate = riskFreeInterestRateModel.GetAverageRiskFreeRate(equity.Select(x => x.Key));\n            SharpeRatio = AnnualStandardDeviation == 0 ? 0 : Statistics.SharpeRatio(annualPerformance, AnnualStandardDeviation, riskFreeRate);\n\n            var annualDownsideDeviation = Statistics.AnnualDownsideStandardDeviation(listPerformance, tradingDaysPerYear).SafeDecimalCast();\n            SortinoRatio = annualDownsideDeviation == 0 ? 0 : Statistics.SharpeRatio(annualPerformance, annualDownsideDeviation, riskFreeRate);\n\n            var benchmarkVariance = listBenchmark.Variance();\n            Beta = benchmarkVariance.IsNaNOrZero() ? 0 : (decimal)(listPerformance.Covariance(listBenchmark) / benchmarkVariance);\n\n            Alpha = Beta == 0 ? 0 : annualPerformance - (riskFreeRate + Beta * (benchmarkAnnualPerformance - riskFreeRate));\n\n            TrackingError = (decimal)Statistics.TrackingError(listPerformance, listBenchmark, (double)tradingDaysPerYear);\n\n            InformationRatio = TrackingError == 0 ? 0 : Extensions.SafeDecimalCast((double)annualPerformance - (double)benchmarkAnnualPerformance).SafeDivision(TrackingError);\n\n            TreynorRatio = Beta == 0 ? 0 : Extensions.SafeDecimalCast((double)annualPerformance - (double)riskFreeRate).SafeDivision(Beta);\n\n            // deannualize a 1 sharpe ratio\n            var benchmarkSharpeRatio = 1.0d / Math.Sqrt(tradingDaysPerYear);\n            ProbabilisticSharpeRatio = Statistics.ProbabilisticSharpeRatio(listPerformance, benchmarkSharpeRatio).SafeDecimalCast();\n\n            ValueAtRisk99 = GetValueAtRisk(listPerformance, tradingDaysPerYear, 0.99d);\n            ValueAtRisk95 = GetValueAtRisk(listPerformance, tradingDaysPerYear, 0.95d);\n\n            var drawdownMetrics = Statistics.CalculateDrawdownMetrics(equity, 3);\n            Drawdown = drawdownMetrics.Drawdown;\n            DrawdownRecovery = drawdownMetrics.DrawdownRecovery;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PortfolioStatistics\"/> class\n        /// </summary>\n        public PortfolioStatistics()\n        {\n        }\n\n        /// <summary>\n        /// Annualized return statistic calculated as an average of daily trading performance multiplied by the number of trading days per year.\n        /// </summary>\n        /// <param name=\"performance\">Dictionary collection of double performance values</param>\n        /// <param name=\"tradingDaysPerYear\">Trading days per year for the assets in portfolio</param>\n        /// <remarks>May be inaccurate for forex algorithms with more trading days in a year</remarks>\n        /// <returns>Double annual performance percentage</returns>\n        private static decimal GetAnnualPerformance(List<double> performance, int tradingDaysPerYear)\n        {\n            try\n            {\n                return Statistics.AnnualPerformance(performance, tradingDaysPerYear).SafeDecimalCast();\n            }\n            catch (ArgumentException ex)\n            {\n                var partialSums = 0.0;\n                var points = 0;\n                double troublePoint = default;\n                foreach (var point in performance)\n                {\n                    points++;\n                    partialSums += point;\n                    if (Math.Pow(partialSums / points, tradingDaysPerYear).IsNaNOrInfinity())\n                    {\n                        troublePoint = point;\n                        break;\n                    }\n                }\n\n                throw new ArgumentException($\"PortfolioStatistics.GetAnnualPerformance(): An exception was thrown when trying to cast the annual performance value due to the following performance point: {troublePoint}. \" +\n                    $\"The exception thrown was the following: {ex.Message}.\");\n            }\n        }\n\n        private static decimal GetValueAtRisk(\n            List<double> performance,\n            int lookbackPeriodDays,\n            double confidenceLevel,\n            int rounding = 3)\n        {\n            var periodPerformance = performance.TakeLast(lookbackPeriodDays);\n            var mean = periodPerformance.Mean();\n            var standardDeviation = periodPerformance.StandardDeviation();\n            var valueAtRisk = (decimal)Normal.InvCDF(mean, standardDeviation, 1 - confidenceLevel);\n            return Math.Round(valueAtRisk, rounding);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/Statistics.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing MathNet.Numerics.Distributions;\nusing MathNet.Numerics.Statistics;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// Calculate all the statistics required from the backtest, based on the equity curve and the profit loss statement.\n    /// </summary>\n    /// <remarks>This is a particularly ugly class and one of the first ones written. It should be thrown out and re-written.</remarks>\n    public class Statistics\n    {\n        /// <summary>\n        /// Annual compounded returns statistic based on the final-starting capital and years.\n        /// </summary>\n        /// <param name=\"startingCapital\">Algorithm starting capital</param>\n        /// <param name=\"finalCapital\">Algorithm final capital</param>\n        /// <param name=\"years\">Years trading</param>\n        /// <returns>Decimal fraction for annual compounding performance</returns>\n        public static decimal CompoundingAnnualPerformance(decimal startingCapital, decimal finalCapital, decimal years)\n        {\n            if (years == 0 || startingCapital == 0)\n            {\n                return 0;\n            }\n            var power = 1 / (double)years;\n            var baseNumber = (double)finalCapital / (double)startingCapital;\n            var result = Math.Pow(baseNumber, power) - 1;\n            return result.IsNaNOrInfinity() ? 0 : result.SafeDecimalCast();\n        }\n\n        /// <summary>\n        /// Annualized return statistic calculated as an average of daily trading performance multiplied by the number of trading days per year.\n        /// </summary>\n        /// <param name=\"performance\">Dictionary collection of double performance values</param>\n        /// <param name=\"tradingDaysPerYear\">Trading days per year for the assets in portfolio</param>\n        /// <remarks>May be unaccurate for forex algorithms with more trading days in a year</remarks>\n        /// <returns>Double annual performance percentage</returns>\n        public static double AnnualPerformance(List<double> performance, double tradingDaysPerYear)\n        {\n            return Math.Pow((performance.Average() + 1), tradingDaysPerYear) - 1;\n        }\n\n        /// <summary>\n        /// Annualized variance statistic calculation using the daily performance variance and trading days per year.\n        /// </summary>\n        /// <param name=\"performance\"></param>\n        /// <param name=\"tradingDaysPerYear\"></param>\n        /// <remarks>Invokes the variance extension in the MathNet Statistics class</remarks>\n        /// <returns>Annual variance value</returns>\n        public static double AnnualVariance(List<double> performance, double tradingDaysPerYear)\n        {\n            var variance = performance.Variance();\n            return variance.IsNaNOrZero() ? 0 : variance * tradingDaysPerYear;\n        }\n\n        /// <summary>\n        /// Annualized standard deviation\n        /// </summary>\n        /// <param name=\"performance\">Collection of double values for daily performance</param>\n        /// <param name=\"tradingDaysPerYear\">Number of trading days for the assets in portfolio to get annualize standard deviation.</param>\n        /// <remarks>\n        ///     Invokes the variance extension in the MathNet Statistics class.\n        ///     Feasibly the trading days per year can be fetched from the dictionary of performance which includes the date-times to get the range; if is more than 1 year data.\n        /// </remarks>\n        /// <returns>Value for annual standard deviation</returns>\n        public static double AnnualStandardDeviation(List<double> performance, double tradingDaysPerYear)\n        {\n            return Math.Sqrt(AnnualVariance(performance, tradingDaysPerYear));\n        }\n\n        /// <summary>\n        /// Annualized variance statistic calculation using the daily performance variance and trading days per year.\n        /// </summary>\n        /// <param name=\"performance\"></param>\n        /// <param name=\"tradingDaysPerYear\"></param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return</param>\n        /// <remarks>Invokes the variance extension in the MathNet Statistics class</remarks>\n        /// <returns>Annual variance value</returns>\n        public static double AnnualDownsideVariance(List<double> performance, double tradingDaysPerYear, double minimumAcceptableReturn = 0)\n        {\n            return AnnualVariance(performance.Where(ret => ret < minimumAcceptableReturn).ToList(), tradingDaysPerYear);\n        }\n\n        /// <summary>\n        /// Annualized downside standard deviation\n        /// </summary>\n        /// <param name=\"performance\">Collection of double values for daily performance</param>\n        /// <param name=\"tradingDaysPerYear\">Number of trading days for the assets in portfolio to get annualize standard deviation.</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return</param>\n        /// <returns>Value for annual downside standard deviation</returns>\n        public static double AnnualDownsideStandardDeviation(List<double> performance, double tradingDaysPerYear, double minimumAcceptableReturn = 0)\n        {\n            return Math.Sqrt(AnnualDownsideVariance(performance, tradingDaysPerYear, minimumAcceptableReturn));\n        }\n\n        /// <summary>\n        /// Tracking error volatility (TEV) statistic - a measure of how closely a portfolio follows the index to which it is benchmarked\n        /// </summary>\n        /// <remarks>If algo = benchmark, TEV = 0</remarks>\n        /// <param name=\"algoPerformance\">Double collection of algorithm daily performance values</param>\n        /// <param name=\"benchmarkPerformance\">Double collection of benchmark daily performance values</param>\n        /// <param name=\"tradingDaysPerYear\">Number of trading days per year</param>\n        /// <returns>Value for tracking error</returns>\n        public static double TrackingError(List<double> algoPerformance, List<double> benchmarkPerformance, double tradingDaysPerYear)\n        {\n            // Un-equal lengths will blow up other statistics, but this will handle the case here\n            if (algoPerformance.Count != benchmarkPerformance.Count)\n            {\n                return 0.0;\n            }\n\n            var performanceDifference = new List<double>();\n            for (var i = 0; i < algoPerformance.Count; i++)\n            {\n                performanceDifference.Add(algoPerformance[i] - benchmarkPerformance[i]);\n            }\n\n            return Math.Sqrt(AnnualVariance(performanceDifference, tradingDaysPerYear));\n        }\n\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        /// <param name=\"averagePerformance\">Average daily performance</param>\n        /// <param name=\"standardDeviation\">Standard deviation of the daily performance</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <returns>Value for sharpe ratio</returns>\n        public static double SharpeRatio(double averagePerformance, double standardDeviation, double riskFreeRate)\n        {\n            return standardDeviation == 0 ? 0 : (averagePerformance - riskFreeRate) / standardDeviation;\n        }\n\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        /// <param name=\"averagePerformance\">Average daily performance</param>\n        /// <param name=\"standardDeviation\">Standard deviation of the daily performance</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <returns>Value for sharpe ratio</returns>\n        public static decimal SharpeRatio(decimal averagePerformance, decimal standardDeviation, decimal riskFreeRate)\n        {\n            return SharpeRatio((double)averagePerformance, (double)standardDeviation, (double)riskFreeRate).SafeDecimalCast();\n        }\n\n        /// <summary>\n        /// Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        /// <param name=\"algoPerformance\">Collection of double values for the algorithm daily performance</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"tradingDaysPerYear\">Trading days per year for the assets in portfolio</param>\n        /// <returns>Value for sharpe ratio</returns>\n        public static double SharpeRatio(List<double> algoPerformance, double riskFreeRate, double tradingDaysPerYear)\n        {\n            return SharpeRatio(AnnualPerformance(algoPerformance, tradingDaysPerYear), AnnualStandardDeviation(algoPerformance, tradingDaysPerYear), riskFreeRate);\n        }\n\n        /// <summary>\n        /// Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk.\n        /// </summary>\n        /// <remarks>With risk defined as the algorithm's volatility</remarks>\n        /// <param name=\"algoPerformance\">Collection of double values for the algorithm daily performance</param>\n        /// <param name=\"riskFreeRate\">The risk free rate</param>\n        /// <param name=\"tradingDaysPerYear\">Trading days per year for the assets in portfolio</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return for Sortino ratio calculation</param>\n        /// <returns>Value for Sortino ratio</returns>\n        public static double SortinoRatio(List<double> algoPerformance, double riskFreeRate, double tradingDaysPerYear, double minimumAcceptableReturn = 0)\n        {\n            return SharpeRatio(AnnualPerformance(algoPerformance, tradingDaysPerYear), AnnualDownsideStandardDeviation(algoPerformance, tradingDaysPerYear, minimumAcceptableReturn), riskFreeRate);\n        }\n\n        /// <summary>\n        /// Helper method to calculate the probabilistic sharpe ratio\n        /// </summary>\n        /// <param name=\"listPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"benchmarkSharpeRatio\">The benchmark sharpe ratio to use</param>\n        /// <returns>Probabilistic Sharpe Ratio</returns>\n        public static double ProbabilisticSharpeRatio(List<double> listPerformance,\n             double benchmarkSharpeRatio)\n        {\n            var observedSharpeRatio = ObservedSharpeRatio(listPerformance);\n\n            var skewness = listPerformance.Skewness();\n            var kurtosis = listPerformance.Kurtosis();\n\n            var operandA = skewness * observedSharpeRatio;\n            var operandB = ((kurtosis - 1) / 4) * (Math.Pow(observedSharpeRatio, 2));\n\n            // Calculated standard deviation of point estimate\n            var estimateStandardDeviation = Math.Pow((1 - operandA + operandB) / (listPerformance.Count - 1), 0.5);\n\n            if (double.IsNaN(estimateStandardDeviation))\n            {\n                return 0;\n            }\n\n            // Calculate PSR(benchmark)\n            var value = estimateStandardDeviation.IsNaNOrZero() ? 0 : (observedSharpeRatio - benchmarkSharpeRatio) / estimateStandardDeviation;\n            return (new Normal()).CumulativeDistribution(value);\n        }\n\n        /// <summary>\n        /// Calculates the observed sharpe ratio\n        /// </summary>\n        /// <param name=\"listPerformance\">The performance samples to use</param>\n        /// <returns>The observed sharpe ratio</returns>\n        public static double ObservedSharpeRatio(List<double> listPerformance)\n        {\n            var performanceAverage = listPerformance.Average();\n            var standardDeviation = listPerformance.StandardDeviation();\n            // we don't annualize it\n            return standardDeviation.IsNaNOrZero() ? 0 : performanceAverage / standardDeviation;\n        }\n\n        /// <summary>\n        /// Calculate the drawdown between a high and current value\n        /// </summary>\n        /// <param name=\"current\">Current value</param>\n        /// <param name=\"high\">Latest maximum</param>\n        /// <param name=\"roundingDecimals\">Digits to round the result too</param>\n        /// <returns>Drawdown percentage</returns>\n        public static decimal DrawdownPercent(decimal current, decimal high, int roundingDecimals = 2)\n        {\n            if (high == 0)\n            {\n                throw new ArgumentException(\"High value must not be 0\");\n            }\n\n            var drawdownPercentage = ((current / high) - 1) * 100;\n            return Math.Round(drawdownPercentage, roundingDecimals);\n        }\n\n        /// <summary>\n        /// Calculates the maximum drawdown percentage and the maximum recovery time (in days)\n        /// from a historical equity time series.\n        /// </summary>\n        /// <param name=\"equityOverTime\">Time series of equity values indexed by date</param>\n        /// <param name=\"rounding\">Number of decimals to round the results to</param>\n        /// <returns>A <see cref=\"DrawdownMetrics\"/> object containing MaxDrawdown (percentage) and MaxRecoveryTime (in days)</returns>\n        public static DrawdownMetrics CalculateDrawdownMetrics(SortedDictionary<DateTime, decimal> equityOverTime, int rounding = 2)\n        {\n            decimal maxDrawdown = 0m;\n            decimal maxRecoveryTime = 0m;\n\n            try\n            {\n                if (equityOverTime.Count < 2) return new DrawdownMetrics(0m, 0);\n\n                var equityList = equityOverTime.ToList();\n\n                var peakEquity = equityList[0].Value;\n                var peakDate = equityList[0].Key;\n                DateTime? drawdownStartDate = null;\n\n                foreach (var point in equityList)\n                {\n                    // Update peak equity if a new high is reached (or matched)\n                    if (point.Value >= peakEquity)\n                    {\n                        // If we were in a drawdown, calculate recovery time\n                        if (drawdownStartDate.HasValue)\n                        {\n                            var recoveryDays = (decimal)(point.Key - drawdownStartDate.Value).TotalDays;\n                            maxRecoveryTime = Math.Max(maxRecoveryTime, recoveryDays);\n                            drawdownStartDate = null;\n                        }\n                        peakEquity = point.Value;\n                        peakDate = point.Key;\n                    }\n\n                    // Calculate current drawdown from peak\n                    var currentDrawdown = (point.Value / peakEquity) - 1;\n                    if (currentDrawdown < 0)\n                    {\n                        maxDrawdown = Math.Min(maxDrawdown, currentDrawdown);\n\n                        // Mark the start of the drawdown period\n                        if (!drawdownStartDate.HasValue)\n                        {\n                            drawdownStartDate = peakDate;\n                        }\n                    }\n                }\n\n                // Return absolute drawdown percentage and max recovery time in days\n                return new DrawdownMetrics(Math.Round(Math.Abs(maxDrawdown), rounding), (int)maxRecoveryTime);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                return new DrawdownMetrics(0m, 0);\n            }\n        }\n    } // End of Statistics\n\n} // End of Namespace\n"
  },
  {
    "path": "Common/Statistics/StatisticsBuilder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"StatisticsBuilder\"/> class creates summary and rolling statistics from trades, equity and benchmark points\n    /// </summary>\n    public static class StatisticsBuilder\n    {\n        /// <summary>\n        /// Generates the statistics and returns the results\n        /// </summary>\n        /// <param name=\"trades\">The list of closed trades</param>\n        /// <param name=\"profitLoss\">Trade record of profits and losses</param>\n        /// <param name=\"pointsEquity\">The list of daily equity values</param>\n        /// <param name=\"pointsPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"pointsBenchmark\">The list of benchmark values</param>\n        /// <param name=\"pointsPortfolioTurnover\">The list of portfolio turnover daily samples</param>\n        /// <param name=\"startingCapital\">The algorithm starting capital</param>\n        /// <param name=\"totalFees\">The total fees</param>\n        /// <param name=\"totalOrders\">The total number of transactions</param>\n        /// <param name=\"estimatedStrategyCapacity\">The estimated capacity of this strategy</param>\n        /// <param name=\"accountCurrencySymbol\">The account currency symbol</param>\n        /// <param name=\"transactions\">\n        /// The transaction manager to get number of winning and losing transactions\n        /// </param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to use</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year</param>       \n        /// <returns>Returns a <see cref=\"StatisticsResults\"/> object</returns>\n        public static StatisticsResults Generate(\n            List<Trade> trades,\n            SortedDictionary<DateTime, decimal> profitLoss,\n            List<ISeriesPoint> pointsEquity,\n            List<ISeriesPoint> pointsPerformance,\n            List<ISeriesPoint> pointsBenchmark,\n            List<ISeriesPoint> pointsPortfolioTurnover,\n            decimal startingCapital,\n            decimal totalFees,\n            int totalOrders,\n            CapacityEstimate estimatedStrategyCapacity,\n            string accountCurrencySymbol,\n            SecurityTransactionManager transactions,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel,\n            int tradingDaysPerYear)\n        {\n            var equity = ChartPointToDictionary(pointsEquity);\n\n            var firstDate = equity.Keys.FirstOrDefault().Date;\n            var lastDate = equity.Keys.LastOrDefault().Date;\n\n            var totalPerformance = GetAlgorithmPerformance(firstDate, lastDate, trades, profitLoss, equity, pointsPerformance, pointsBenchmark,\n                pointsPortfolioTurnover, startingCapital, transactions, riskFreeInterestRateModel, tradingDaysPerYear);\n            var rollingPerformances = GetRollingPerformances(firstDate, lastDate, trades, profitLoss, equity, pointsPerformance, pointsBenchmark,\n                pointsPortfolioTurnover, startingCapital, transactions, riskFreeInterestRateModel, tradingDaysPerYear);\n            var summary = GetSummary(totalPerformance, estimatedStrategyCapacity, totalFees, totalOrders, accountCurrencySymbol);\n\n            return new StatisticsResults(totalPerformance, rollingPerformances, summary);\n        }\n\n        /// <summary>\n        /// Returns the performance of the algorithm in the specified date range\n        /// </summary>\n        /// <param name=\"fromDate\">The initial date of the range</param>\n        /// <param name=\"toDate\">The final date of the range</param>\n        /// <param name=\"trades\">The list of closed trades</param>\n        /// <param name=\"profitLoss\">Trade record of profits and losses</param>\n        /// <param name=\"equity\">The list of daily equity values</param>\n        /// <param name=\"pointsPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"pointsBenchmark\">The list of benchmark values</param>\n        /// <param name=\"pointsPortfolioTurnover\">The list of portfolio turnover daily samples</param>\n        /// <param name=\"startingCapital\">The algorithm starting capital</param>\n        /// <param name=\"transactions\">\n        /// The transaction manager to get number of winning and losing transactions\n        /// </param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to use</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year</param>\n        /// <returns>The algorithm performance</returns>\n        private static AlgorithmPerformance GetAlgorithmPerformance(\n            DateTime fromDate,\n            DateTime toDate,\n            List<Trade> trades,\n            SortedDictionary<DateTime, decimal> profitLoss,\n            SortedDictionary<DateTime, decimal> equity,\n            List<ISeriesPoint> pointsPerformance,\n            List<ISeriesPoint> pointsBenchmark,\n            List<ISeriesPoint> pointsPortfolioTurnover,\n            decimal startingCapital,\n            SecurityTransactionManager transactions,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel,\n            int tradingDaysPerYear)\n        {\n            var periodEquity = new SortedDictionary<DateTime, decimal>(equity.Where(x => x.Key.Date >= fromDate && x.Key.Date < toDate.AddDays(1)).ToDictionary(x => x.Key, y => y.Value));\n\n            // No portfolio equity for the period means that there is no performance to be computed\n            if (periodEquity.IsNullOrEmpty())\n            {\n                return new AlgorithmPerformance();\n            }\n\n            var periodTrades = trades.Where(x => x.ExitTime.Date >= fromDate && x.ExitTime < toDate.AddDays(1)).ToList();\n            var periodProfitLoss = new SortedDictionary<DateTime, decimal>(profitLoss.Where(x => x.Key >= fromDate && x.Key.Date < toDate.AddDays(1)).ToDictionary(x => x.Key, y => y.Value));\n            var periodWinCount = transactions.WinningTransactions.Count(x => x.Key >= fromDate && x.Key.Date < toDate.AddDays(1));\n            var periodLossCount = transactions.LosingTransactions.Count(x => x.Key >= fromDate && x.Key.Date < toDate.AddDays(1));\n\n            // Convert our charts to dictionaries\n            // NOTE: Day 0 refers to sample taken at 12AM on StartDate, performance[0] always = 0, benchmark[0] is benchmark value preceding start date.\n            var benchmark = ChartPointToDictionary(pointsBenchmark, fromDate, toDate);\n            var performance = ChartPointToDictionary(pointsPerformance, fromDate, toDate);\n            var portfolioTurnover = ChartPointToDictionary(pointsPortfolioTurnover, fromDate, toDate);\n\n            // Ensure our series are aligned\n            if (benchmark.Count != performance.Count)\n            {\n                throw new ArgumentException($\"Benchmark and performance series has {Math.Abs(benchmark.Count - performance.Count)} misaligned values.\");\n            }\n\n            // Convert our benchmark values into a percentage daily performance of the benchmark, this will shorten the series by one since\n            // its the percentage change between each entry (No day 0 sample)\n            var benchmarkEnumerable = CreateBenchmarkDifferences(benchmark, fromDate, toDate);\n\n            var listBenchmark = benchmarkEnumerable.Select(x => x.Value).ToList();\n            var listPerformance = PreprocessPerformanceValues(performance).Select(x => x.Value).ToList();\n\n            var runningCapital = equity.Count == periodEquity.Count ? startingCapital : periodEquity.Values.FirstOrDefault();\n\n            return new AlgorithmPerformance(periodTrades, periodProfitLoss, periodEquity, portfolioTurnover, listPerformance, listBenchmark,\n                runningCapital, periodWinCount, periodLossCount, riskFreeInterestRateModel, tradingDaysPerYear);\n        }\n\n        /// <summary>\n        /// Returns the rolling performances of the algorithm\n        /// </summary>\n        /// <param name=\"firstDate\">The first date of the total period</param>\n        /// <param name=\"lastDate\">The last date of the total period</param>\n        /// <param name=\"trades\">The list of closed trades</param>\n        /// <param name=\"profitLoss\">Trade record of profits and losses</param>\n        /// <param name=\"equity\">The list of daily equity values</param>\n        /// <param name=\"pointsPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"pointsBenchmark\">The list of benchmark values</param>\n        /// <param name=\"pointsPortfolioTurnover\">The list of portfolio turnover daily samples</param>\n        /// <param name=\"startingCapital\">The algorithm starting capital</param>\n        /// <param name=\"transactions\">\n        /// The transaction manager to get number of winning and losing transactions\n        /// </param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to use</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year</param>\n        /// <returns>A dictionary with the rolling performances</returns>\n        private static Dictionary<string, AlgorithmPerformance> GetRollingPerformances(\n            DateTime firstDate,\n            DateTime lastDate,\n            List<Trade> trades,\n            SortedDictionary<DateTime, decimal> profitLoss,\n            SortedDictionary<DateTime, decimal> equity,\n            List<ISeriesPoint> pointsPerformance,\n            List<ISeriesPoint> pointsBenchmark,\n            List<ISeriesPoint> pointsPortfolioTurnover,\n            decimal startingCapital,\n            SecurityTransactionManager transactions,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel,\n            int tradingDaysPerYear)\n        {\n            var rollingPerformances = new Dictionary<string, AlgorithmPerformance>();\n\n            var monthPeriods = new[] { 1, 3, 6, 12 };\n            foreach (var monthPeriod in monthPeriods)\n            {\n                var ranges = GetPeriodRanges(monthPeriod, firstDate, lastDate);\n\n                foreach (var period in ranges)\n                {\n                    var key = $\"M{monthPeriod}_{period.EndDate.ToStringInvariant(\"yyyyMMdd\")}\";\n                    var periodPerformance = GetAlgorithmPerformance(period.StartDate, period.EndDate, trades, profitLoss, equity, pointsPerformance,\n                        pointsBenchmark, pointsPortfolioTurnover, startingCapital, transactions, riskFreeInterestRateModel, tradingDaysPerYear);\n                    rollingPerformances[key] = periodPerformance;\n                }\n            }\n\n            return rollingPerformances;\n        }\n\n        /// <summary>\n        /// Returns a summary of the algorithm performance as a dictionary\n        /// </summary>\n        private static Dictionary<string, string> GetSummary(AlgorithmPerformance totalPerformance, CapacityEstimate estimatedStrategyCapacity,\n            decimal totalFees, int totalOrders, string accountCurrencySymbol)\n        {\n            var capacity = 0m;\n            var lowestCapacitySymbol = Symbol.Empty;\n            if (estimatedStrategyCapacity != null)\n            {\n                capacity = estimatedStrategyCapacity.Capacity;\n                lowestCapacitySymbol = estimatedStrategyCapacity.LowestCapacityAsset ?? Symbol.Empty;\n            }\n\n            return new Dictionary<string, string>\n            {\n                { PerformanceMetrics.TotalOrders, totalOrders.ToStringInvariant() },\n                { PerformanceMetrics.AverageWin, Math.Round(totalPerformance.PortfolioStatistics.AverageWinRate.SafeMultiply100(), 2).ToStringInvariant() + \"%\"  },\n                { PerformanceMetrics.AverageLoss, Math.Round(totalPerformance.PortfolioStatistics.AverageLossRate.SafeMultiply100(), 2).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.CompoundingAnnualReturn, Math.Round(totalPerformance.PortfolioStatistics.CompoundingAnnualReturn.SafeMultiply100(), 3).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.Drawdown, Math.Round(totalPerformance.PortfolioStatistics.Drawdown.SafeMultiply100(), 3).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.Expectancy, Math.Round(totalPerformance.PortfolioStatistics.Expectancy, 3).ToStringInvariant() },\n                { PerformanceMetrics.StartEquity, Math.Round(totalPerformance.PortfolioStatistics.StartEquity, 2).ToStringInvariant() },\n                { PerformanceMetrics.EndEquity, Math.Round(totalPerformance.PortfolioStatistics.EndEquity, 2).ToStringInvariant() },\n                { PerformanceMetrics.NetProfit, Math.Round(totalPerformance.PortfolioStatistics.TotalNetProfit.SafeMultiply100(), 3).ToStringInvariant() + \"%\"},\n                { PerformanceMetrics.SharpeRatio, Math.Round((double)totalPerformance.PortfolioStatistics.SharpeRatio, 3).ToStringInvariant() },\n                { PerformanceMetrics.SortinoRatio, Math.Round((double)totalPerformance.PortfolioStatistics.SortinoRatio, 3).ToStringInvariant() },\n                { PerformanceMetrics.ProbabilisticSharpeRatio, Math.Round(totalPerformance.PortfolioStatistics.ProbabilisticSharpeRatio.SafeMultiply100(), 3).ToStringInvariant() + \"%\"},\n                { PerformanceMetrics.LossRate, Math.Round(totalPerformance.PortfolioStatistics.LossRate.SafeMultiply100()).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.WinRate, Math.Round(totalPerformance.PortfolioStatistics.WinRate.SafeMultiply100()).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.ProfitLossRatio, Math.Round(totalPerformance.PortfolioStatistics.ProfitLossRatio, 2).ToStringInvariant() },\n                { PerformanceMetrics.Alpha, Math.Round((double)totalPerformance.PortfolioStatistics.Alpha, 3).ToStringInvariant() },\n                { PerformanceMetrics.Beta, Math.Round((double)totalPerformance.PortfolioStatistics.Beta, 3).ToStringInvariant() },\n                { PerformanceMetrics.AnnualStandardDeviation, Math.Round((double)totalPerformance.PortfolioStatistics.AnnualStandardDeviation, 3).ToStringInvariant() },\n                { PerformanceMetrics.AnnualVariance, Math.Round((double)totalPerformance.PortfolioStatistics.AnnualVariance, 3).ToStringInvariant() },\n                { PerformanceMetrics.InformationRatio, Math.Round((double)totalPerformance.PortfolioStatistics.InformationRatio, 3).ToStringInvariant() },\n                { PerformanceMetrics.TrackingError, Math.Round((double)totalPerformance.PortfolioStatistics.TrackingError, 3).ToStringInvariant() },\n                { PerformanceMetrics.TreynorRatio, Math.Round((double)totalPerformance.PortfolioStatistics.TreynorRatio, 3).ToStringInvariant() },\n                { PerformanceMetrics.TotalFees, accountCurrencySymbol + totalFees.ToStringInvariant(\"0.00\") },\n                { PerformanceMetrics.EstimatedStrategyCapacity, accountCurrencySymbol + capacity.RoundToSignificantDigits(2).ToStringInvariant() },\n                { PerformanceMetrics.LowestCapacityAsset, lowestCapacitySymbol != Symbol.Empty ? lowestCapacitySymbol.ID.ToString() : \"\" },\n                { PerformanceMetrics.PortfolioTurnover, Math.Round(totalPerformance.PortfolioStatistics.PortfolioTurnover.SafeMultiply100(), 2).ToStringInvariant() + \"%\" },\n                { PerformanceMetrics.DrawdownRecovery, totalPerformance.PortfolioStatistics.DrawdownRecovery.ToStringInvariant() },\n            };\n        }\n\n        /// <summary>\n        /// Helper class for rolling statistics\n        /// </summary>\n        private class PeriodRange\n        {\n            internal DateTime StartDate { get; set; }\n            internal DateTime EndDate { get; set; }\n        }\n\n        /// <summary>\n        /// Gets a list of date ranges for the requested monthly period\n        /// </summary>\n        /// <remarks>The first and last ranges created are partial periods</remarks>\n        /// <param name=\"periodMonths\">The number of months in the period (valid inputs are [1, 3, 6, 12])</param>\n        /// <param name=\"firstDate\">The first date of the total period</param>\n        /// <param name=\"lastDate\">The last date of the total period</param>\n        /// <returns>The list of date ranges</returns>\n        private static IEnumerable<PeriodRange> GetPeriodRanges(int periodMonths, DateTime firstDate, DateTime lastDate)\n        {\n            // get end dates\n            var date = lastDate.Date;\n            var endDates = new List<DateTime>();\n            do\n            {\n                endDates.Add(date);\n                date = new DateTime(date.Year, date.Month, 1).AddDays(-1);\n            } while (date >= firstDate);\n\n            // build period ranges\n            var ranges = new List<PeriodRange> { new PeriodRange { StartDate = firstDate, EndDate = endDates[endDates.Count - 1] } };\n            for (var i = endDates.Count - 2; i >= 0; i--)\n            {\n                var startDate = ranges[ranges.Count - 1].EndDate.AddDays(1).AddMonths(1 - periodMonths);\n                if (startDate < firstDate) startDate = firstDate;\n\n                ranges.Add(new PeriodRange\n                {\n                    StartDate = startDate,\n                    EndDate = endDates[i]\n                });\n            }\n\n            return ranges;\n        }\n\n        /// <summary>\n        /// Convert the charting data into an equity array.\n        /// </summary>\n        /// <remarks>This is required to convert the equity plot into a usable form for the statistics calculation</remarks>\n        /// <param name=\"points\">ChartPoints Array</param>\n        /// <param name=\"fromDate\">An optional starting date</param>\n        /// <param name=\"toDate\">An optional ending date</param>\n        /// <returns>SortedDictionary of the equity decimal values ordered in time</returns>\n        private static SortedDictionary<DateTime, decimal> ChartPointToDictionary(IEnumerable<ISeriesPoint> points, DateTime? fromDate = null, DateTime? toDate = null)\n        {\n            var dictionary = new SortedDictionary<DateTime, decimal>();\n\n            foreach (var point in points)\n            {\n                if (fromDate != null && point.Time.Date < fromDate) continue;\n                if (toDate != null && point.Time.Date >= ((DateTime)toDate).AddDays(1)) break;\n\n                dictionary[point.Time] = GetPointValue(point);\n            }\n\n            return dictionary;\n        }\n\n        /// <summary>\n        /// Gets the value of a point, either ChartPoint.y or Candlestick.Close\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static decimal GetPointValue(ISeriesPoint point)\n        {\n            if (point is ChartPoint)\n            {\n                return ((ChartPoint)point).y.Value;\n            }\n\n            return ((Candlestick)point).Close.Value;\n        }\n\n        /// <summary>\n        /// Yields pairs of date and percentage change for the period\n        /// </summary>\n        /// <param name=\"points\">The values to calculate percentage change for</param>\n        /// <param name=\"fromDate\">Starting date (inclusive)</param>\n        /// <param name=\"toDate\">Ending date (inclusive)</param>\n        /// <returns>Pairs of date and percentage change</returns>\n        public static IEnumerable<KeyValuePair<DateTime, double>> CreateBenchmarkDifferences(IEnumerable<KeyValuePair<DateTime, decimal>> points, DateTime fromDate, DateTime toDate)\n        {\n            DateTime dtPrevious = default;\n            var previous = 0m;\n            var firstValueSkipped = false;\n            double deltaPercentage;\n\n            // Get points performance array for the given period:\n            foreach (var kvp in points.Where(kvp => kvp.Key >= fromDate.Date && kvp.Key.Date <= toDate))\n            {\n                var dt = kvp.Key;\n                var value = kvp.Value;\n\n                if (dtPrevious != default)\n                {\n                    deltaPercentage = 0;\n                    if (previous != 0)\n                    {\n                        deltaPercentage = (double)((value - previous) / previous);\n                    }\n\n                    // We will skip past day 1 of performance values to deal with the OnOpen orders causing misalignment between benchmark and\n                    // algorithm performance. So we drop the first value of listBenchmark (Day 1), and drop two values from performance (Day 0, Day 1)\n                    if (firstValueSkipped)\n                    {\n                        yield return new KeyValuePair<DateTime, double>(dt, deltaPercentage);\n                    }\n                    else\n                    {\n                        firstValueSkipped = true;\n                    }\n                }\n\n                dtPrevious = dt;\n                previous = value;\n            }\n        }\n\n        /// <summary>\n        /// Skips the first two entries from the given points and divides each entry by 100\n        /// </summary>\n        /// <param name=\"points\">The values to divide by 100</param>\n        /// <returns>Pairs of date and performance value divided by 100</returns>\n        public static IEnumerable<KeyValuePair<DateTime, double>> PreprocessPerformanceValues(IEnumerable<KeyValuePair<DateTime, decimal>> points)\n        {\n            // We will skip past day 1 of performance values to deal with the OnOpen orders causing misalignment between benchmark and\n            // algorithm performance. So we drop two values from performance (Day 0, Day 1)\n            foreach (var kvp in points.Skip(2))\n            {\n                yield return new KeyValuePair<DateTime, double>(kvp.Key, (double)(kvp.Value / 100));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/StatisticsResults.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"StatisticsResults\"/> class represents total and rolling statistics for an algorithm\n    /// </summary>\n    public class StatisticsResults\n    {\n        /// <summary>\n        /// The performance of the algorithm over the whole period\n        /// </summary>\n        public AlgorithmPerformance TotalPerformance { get; private set; }\n\n        /// <summary>\n        /// The rolling performance of the algorithm over 1, 3, 6, 12 month periods\n        /// </summary>\n        public Dictionary<string, AlgorithmPerformance> RollingPerformances { get; private set; }\n\n        /// <summary>\n        /// Returns a summary of the algorithm performance as a dictionary\n        /// </summary>\n        public Dictionary<string, string> Summary { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StatisticsResults\"/> class\n        /// </summary>\n        /// <param name=\"totalPerformance\">The algorithm total performance</param>\n        /// <param name=\"rollingPerformances\">The algorithm rolling performances</param>\n        /// <param name=\"summary\">The summary performance dictionary</param>\n        public StatisticsResults(AlgorithmPerformance totalPerformance, Dictionary<string, AlgorithmPerformance> rollingPerformances, Dictionary<string, string> summary)\n        {\n            TotalPerformance = totalPerformance;\n            RollingPerformances = rollingPerformances;\n            Summary = summary;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StatisticsResults\"/> class\n        /// </summary>\n        public StatisticsResults()\n        {\n            TotalPerformance = new AlgorithmPerformance();\n            RollingPerformances = new Dictionary<string, AlgorithmPerformance>();\n            Summary = new Dictionary<string, string>();\n        }\n\n        internal void AddCustomSummaryStatistics(IDictionary<string, string> customSummary)\n        {\n            foreach (var kvp in customSummary)\n            {\n                if (!Summary.ContainsKey(kvp.Key))\n                {\n                    Summary[kvp.Key] = kvp.Value;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/Trade.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// Represents a closed trade\n    /// </summary>\n    public class Trade\n    {\n        private List<Symbol> _symbols;\n\n        /// <summary>\n        /// A unique identifier for the trade\n        /// </summary>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// The symbol of the traded instrument\n        /// </summary>\n        [Obsolete(\"Use Symbols property instead\")]\n        [JsonIgnore]\n        public Symbol Symbol\n        {\n            get\n            {\n                return _symbols != null && _symbols.Count > 0 ? _symbols[0] : Symbol.Empty;\n            }\n            private set\n            {\n                _symbols = new List<Symbol>() { value };\n            }\n        }\n\n        /// <summary>\n        /// Just needed so that \"Symbol\" is never serialized but can be deserialized, if present, for backward compatibility\n        /// </summary>\n        [JsonProperty(\"Symbol\")]\n        private Symbol SymbolForDeserialization { set => Symbol = value; }\n\n        /// <summary>\n        /// The symbol associated to the traded instruments\n        /// </summary>\n        public List<Symbol> Symbols\n        {\n            get { return _symbols; }\n            set { _symbols = value; }\n        }\n\n        /// <summary>\n        /// The date and time the trade was opened\n        /// </summary>\n        public DateTime EntryTime { get; set; }\n\n        /// <summary>\n        /// The price at which the trade was opened (or the average price if multiple entries)\n        /// </summary>\n        public decimal EntryPrice { get; set; }\n\n        /// <summary>\n        /// The direction of the trade (Long or Short)\n        /// </summary>\n        public TradeDirection Direction { get; set; }\n\n        /// <summary>\n        /// The total unsigned quantity of the trade\n        /// </summary>\n        public decimal Quantity { get; set; }\n\n        /// <summary>\n        /// The date and time the trade was closed\n        /// </summary>\n        public DateTime ExitTime { get; set; }\n\n        /// <summary>\n        /// The price at which the trade was closed (or the average price if multiple exits)\n        /// </summary>\n        public decimal ExitPrice { get; set; }\n\n        /// <summary>\n        /// The gross profit/loss of the trade (as account currency)\n        /// </summary>\n        public decimal ProfitLoss { get; set; }\n\n        /// <summary>\n        /// The total fees associated with the trade (always positive value) (as account currency)\n        /// </summary>\n        public decimal TotalFees { get; set; }\n\n        /// <summary>\n        /// The Maximum Adverse Excursion (as account currency)\n        /// </summary>\n        public decimal MAE { get; set; }\n\n        /// <summary>\n        /// The Maximum Favorable Excursion (as account currency)\n        /// </summary>\n        public decimal MFE { get; set; }\n\n        /// <summary>\n        /// Returns the duration of the trade\n        /// </summary>\n        public TimeSpan Duration\n        {\n            get { return ExitTime - EntryTime; }\n        }\n\n        /// <summary>\n        /// Returns the amount of profit given back before the trade was closed\n        /// </summary>\n        public decimal EndTradeDrawdown { get; set; }\n\n        /// <summary>\n        /// Returns whether the trade was profitable (is a win) or not (a loss)\n        /// </summary>\n        /// <returns>True if the trade was profitable</returns>\n        /// <remarks>\n        /// Even when a trade is not profitable, it may still be a win:\n        ///     - For an ITM option buyer, an option assignment trade is not profitable (money was paid),\n        ///       but it might count as a win if the ITM amount is greater than the amount paid for the option.\n        ///     - For an ITM option seller, an option assignment trade is profitable (money was received),\n        ///       but it might count as a loss if the ITM amount is less than the amount received for the option.\n        /// </remarks>\n        public bool IsWin { get; set; }\n\n        /// <summary>\n        /// The IDs of the orders related to this trade\n        /// </summary>\n        public HashSet<int> OrderIds { get; init; } = new HashSet<int>();\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"Trade\"/> class\n        /// </summary>\n        public Trade()\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"Trade\"/> class by copying another trade\n        /// </summary>\n        /// <param name=\"other\">The trade to copy</param>\n        public Trade(Trade other)\n        {\n            Id = other.Id;\n            _symbols = other._symbols != null ? [.. other._symbols] : null;\n            EntryTime = other.EntryTime;\n            EntryPrice = other.EntryPrice;\n            Direction = other.Direction;\n            Quantity = other.Quantity;\n            ExitTime = other.ExitTime;\n            ExitPrice = other.ExitPrice;\n            ProfitLoss = other.ProfitLoss;\n            TotalFees = other.TotalFees;\n            MAE = other.MAE;\n            MFE = other.MFE;\n            EndTradeDrawdown = other.EndTradeDrawdown;\n            IsWin = other.IsWin;\n            OrderIds = [.. other.OrderIds];\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/TradeBuilder.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"TradeBuilder\"/> class generates trades from executions and market price updates\n    /// </summary>\n    public class TradeBuilder : ITradeBuilder\n    {\n        private class TradeState\n        {\n            internal Trade Trade { get; set; }\n            internal decimal MaxProfit { get; set; }\n            internal decimal MaxDrawdown { get; set; }\n\n            /// <summary>\n            /// Updates the drawdown state given the current profit\n            /// </summary>\n            public void UpdateDrawdown(decimal currentProfit)\n            {\n                if (currentProfit < MaxProfit)\n                {\n                    // There is a drawdown, but we only care about the maximum drawdown\n                    var drawdown = MaxProfit - currentProfit;\n                    if (drawdown > MaxDrawdown)\n                    {\n                        MaxDrawdown = drawdown;\n                    }\n                }\n                else\n                {\n                    // New maximum profit\n                    MaxProfit = currentProfit;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper class to manage pending trades and market price updates for a symbol\n        /// </summary>\n        private class Position\n        {\n            internal List<TradeState> PendingTrades { get; set; }\n            internal List<OrderEvent> PendingFills { get; set; }\n            internal decimal TotalFees { get; set; }\n            internal decimal MaxPrice { get; set; }\n            internal decimal MinPrice { get; set; }\n\n            public Position()\n            {\n                PendingTrades = new List<TradeState>();\n                PendingFills = new List<OrderEvent>();\n            }\n        }\n\n        private const int LiveModeMaxTradeCount = 10000;\n        private const int LiveModeMaxTradeAgeMonths = 12;\n        private const int MaxOrderIdCacheSize = 1000;\n\n        private readonly List<Trade> _closedTrades = new List<Trade>();\n        private readonly Dictionary<Symbol, Position> _positions = new Dictionary<Symbol, Position>();\n        private readonly FixedSizeHashQueue<int> _ordersWithFeesAssigned = new FixedSizeHashQueue<int>(MaxOrderIdCacheSize);\n        private readonly FillGroupingMethod _groupingMethod;\n        private readonly FillMatchingMethod _matchingMethod;\n        private SecurityManager _securities;\n        private bool _liveMode;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TradeBuilder\"/> class\n        /// </summary>\n        public TradeBuilder(FillGroupingMethod groupingMethod, FillMatchingMethod matchingMethod)\n        {\n            _groupingMethod = groupingMethod;\n            _matchingMethod = matchingMethod;\n        }\n\n        /// <summary>\n        /// Sets the live mode flag\n        /// </summary>\n        /// <param name=\"live\">The live mode flag</param>\n        public void SetLiveMode(bool live)\n        {\n            _liveMode = live;\n        }\n\n        /// <summary>\n        /// Sets the security manager instance\n        /// </summary>\n        /// <param name=\"securities\">The security manager</param>\n        public void SetSecurityManager(SecurityManager securities)\n        {\n            _securities = securities;\n        }\n\n        /// <summary>\n        /// The list of closed trades\n        /// </summary>\n        public List<Trade> ClosedTrades\n        {\n            get\n            {\n                lock (_closedTrades)\n                {\n                    return new List<Trade>(_closedTrades);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns true if there is an open position for the symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>true if there is an open position for the symbol</returns>\n        public bool HasOpenPosition(Symbol symbol)\n        {\n            Position position;\n            if (!_positions.TryGetValue(symbol, out position)) return false;\n\n            if (_groupingMethod == FillGroupingMethod.FillToFill)\n                return position.PendingTrades.Count > 0;\n\n            return position.PendingFills.Count > 0;\n        }\n\n        /// <summary>\n        /// Sets the current market price for the symbol\n        /// </summary>\n        /// <param name=\"symbol\"></param>\n        /// <param name=\"price\"></param>\n        public void SetMarketPrice(Symbol symbol, decimal price)\n        {\n            Position position;\n            if (!_positions.TryGetValue(symbol, out position)) return;\n\n            if (price > position.MaxPrice)\n                position.MaxPrice = price;\n            else if (price < position.MinPrice)\n                position.MinPrice = price;\n\n            for (var i = 0; i < position.PendingTrades.Count; i++)\n            {\n                var tradeState = position.PendingTrades[i];\n                var trade = tradeState.Trade;\n                var currentProfit = trade.Direction == TradeDirection.Long ? price - trade.EntryPrice : trade.EntryPrice - price;\n                tradeState.UpdateDrawdown(currentProfit);\n            }\n        }\n\n        /// <summary>\n        /// Applies a split to the trade builder\n        /// </summary>\n        /// <param name=\"split\">The split to be applied</param>\n        /// <param name=\"liveMode\">True if live mode, false for backtest</param>\n        /// <param name=\"dataNormalizationMode\">The <see cref=\"DataNormalizationMode\"/> for this security</param>\n        public void ApplySplit(Split split, bool liveMode, DataNormalizationMode dataNormalizationMode)\n        {\n            // only apply splits to equities, in live or raw data mode, and for open positions\n            if (split.Symbol.SecurityType != SecurityType.Equity ||\n                (!liveMode && dataNormalizationMode != DataNormalizationMode.Raw) ||\n                !_positions.TryGetValue(split.Symbol, out var position))\n            {\n                return;\n            }\n\n            position.MinPrice *= split.SplitFactor;\n            position.MaxPrice *= split.SplitFactor;\n\n            foreach (var tradeState in position.PendingTrades)\n            {\n                tradeState.Trade.Quantity /= split.SplitFactor;\n                tradeState.Trade.EntryPrice *= split.SplitFactor;\n                tradeState.Trade.ExitPrice *= split.SplitFactor;\n                tradeState.MaxProfit *= split.SplitFactor;\n                tradeState.MaxDrawdown *= split.SplitFactor;\n            }\n\n            foreach (var pendingFill in position.PendingFills)\n            {\n                pendingFill.FillQuantity /= split.SplitFactor;\n                pendingFill.FillPrice *= split.SplitFactor;\n\n                if (pendingFill.LimitPrice.HasValue)\n                {\n                    pendingFill.LimitPrice *= split.SplitFactor;\n                }\n                if (pendingFill.StopPrice.HasValue)\n                {\n                    pendingFill.StopPrice *= split.SplitFactor;\n                }\n                if (pendingFill.TriggerPrice.HasValue)\n                {\n                    pendingFill.TriggerPrice *= split.SplitFactor;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Processes a new fill, eventually creating new trades\n        /// </summary>\n        /// <param name=\"fill\">The new fill order event</param>\n        /// <param name=\"securityConversionRate\">The current security market conversion rate into the account currency</param>\n        /// <param name=\"feeInAccountCurrency\">The current order fee in the account currency</param>\n        /// <param name=\"multiplier\">The contract multiplier</param>\n        public void ProcessFill(OrderEvent fill,\n            decimal securityConversionRate,\n            decimal feeInAccountCurrency,\n            decimal multiplier = 1.0m)\n        {\n            // If we have multiple fills per order, we assign the order fee only to its first fill\n            // to avoid counting the same order fee multiple times.\n            var orderFee = 0m;\n            if (!_ordersWithFeesAssigned.Contains(fill.OrderId))\n            {\n                orderFee = feeInAccountCurrency;\n                _ordersWithFeesAssigned.Add(fill.OrderId);\n            }\n\n            switch (_groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    ProcessFillUsingFillToFill(fill.Clone(), orderFee, securityConversionRate, multiplier);\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    ProcessFillUsingFlatToFlat(fill.Clone(), orderFee, securityConversionRate, multiplier);\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    ProcessFillUsingFlatToReduced(fill.Clone(), orderFee, securityConversionRate, multiplier);\n                    break;\n            }\n        }\n\n        private void ProcessFillUsingFillToFill(OrderEvent fill, decimal orderFee, decimal conversionRate, decimal multiplier)\n        {\n            Position position;\n            if (!_positions.TryGetValue(fill.Symbol, out position) || position.PendingTrades.Count == 0)\n            {\n                // no pending trades for symbol\n                _positions[fill.Symbol] = new Position\n                {\n                    PendingTrades = new List<TradeState>\n                    {\n                        new TradeState\n                        {\n                            Trade = new Trade\n                            {\n                                Symbols = [fill.Symbol],\n                                EntryTime = fill.UtcTime,\n                                EntryPrice = fill.FillPrice,\n                                Direction = fill.FillQuantity > 0 ? TradeDirection.Long : TradeDirection.Short,\n                                Quantity = fill.AbsoluteFillQuantity,\n                                TotalFees = orderFee,\n                                OrderIds = new HashSet<int>() { fill.OrderId }\n                            }\n                        }\n                    },\n                    MinPrice = fill.FillPrice,\n                    MaxPrice = fill.FillPrice\n                };\n                return;\n            }\n\n            SetMarketPrice(fill.Symbol, fill.FillPrice);\n\n            var index = _matchingMethod == FillMatchingMethod.FIFO ? 0 : position.PendingTrades.Count - 1;\n\n            if (Math.Sign(fill.FillQuantity) == (position.PendingTrades[index].Trade.Direction == TradeDirection.Long ? +1 : -1))\n            {\n                // execution has same direction of trade\n                position.PendingTrades.Add(new TradeState\n                {\n                    Trade = new Trade\n                    {\n                        Symbols = [fill.Symbol],\n                        EntryTime = fill.UtcTime,\n                        EntryPrice = fill.FillPrice,\n                        Direction = fill.FillQuantity > 0 ? TradeDirection.Long : TradeDirection.Short,\n                        Quantity = fill.AbsoluteFillQuantity,\n                        TotalFees = orderFee,\n                        OrderIds = new HashSet<int>() { fill.OrderId }\n                    }\n                });\n            }\n            else\n            {\n                // execution has opposite direction of trade\n                var totalExecutedQuantity = 0m;\n                var orderFeeAssigned = false;\n                while (position.PendingTrades.Count > 0 && Math.Abs(totalExecutedQuantity) < fill.AbsoluteFillQuantity)\n                {\n                    var tradeState = position.PendingTrades[index];\n                    var trade = tradeState.Trade;\n                    var absoluteUnexecutedQuantity = fill.AbsoluteFillQuantity - Math.Abs(totalExecutedQuantity);\n\n                    if (absoluteUnexecutedQuantity >= trade.Quantity)\n                    {\n                        totalExecutedQuantity -= trade.Quantity * (trade.Direction == TradeDirection.Long ? +1 : -1);\n                        position.PendingTrades.RemoveAt(index);\n                        trade.OrderIds.Add(fill.OrderId);\n\n                        if (index > 0 && _matchingMethod == FillMatchingMethod.LIFO) index--;\n\n                        trade.ExitTime = fill.UtcTime;\n                        trade.ExitPrice = fill.FillPrice;\n                        trade.ProfitLoss = Math.Round((trade.ExitPrice - trade.EntryPrice) * trade.Quantity * (trade.Direction == TradeDirection.Long ? +1 : -1) * conversionRate * multiplier, 2);\n                        // if closing multiple trades with the same order, assign order fee only once\n                        trade.TotalFees += orderFeeAssigned ? 0 : orderFee;\n                        trade.MAE = Math.Round((trade.Direction == TradeDirection.Long ? position.MinPrice - trade.EntryPrice : trade.EntryPrice - position.MaxPrice) * trade.Quantity * conversionRate * multiplier, 2);\n                        trade.MFE = Math.Round((trade.Direction == TradeDirection.Long ? position.MaxPrice - trade.EntryPrice : trade.EntryPrice - position.MinPrice) * trade.Quantity * conversionRate * multiplier, 2);\n                        trade.EndTradeDrawdown = Math.Round(tradeState.MaxDrawdown * trade.Quantity * conversionRate * multiplier, 2);\n\n                        AddNewTrade(trade, fill);\n                    }\n                    else\n                    {\n                        totalExecutedQuantity += absoluteUnexecutedQuantity * (trade.Direction == TradeDirection.Long ? -1 : +1);\n                        trade.Quantity -= absoluteUnexecutedQuantity;\n\n                        var newTrade = new Trade\n                        {\n                            Symbols = trade.Symbols,\n                            EntryTime = trade.EntryTime,\n                            EntryPrice = trade.EntryPrice,\n                            Direction = trade.Direction,\n                            Quantity = absoluteUnexecutedQuantity,\n                            ExitTime = fill.UtcTime,\n                            ExitPrice = fill.FillPrice,\n                            ProfitLoss = Math.Round((fill.FillPrice - trade.EntryPrice) * absoluteUnexecutedQuantity * (trade.Direction == TradeDirection.Long ? +1 : -1) * conversionRate * multiplier, 2),\n                            TotalFees = trade.TotalFees + (orderFeeAssigned ? 0 : orderFee),\n                            MAE = Math.Round((trade.Direction == TradeDirection.Long ? position.MinPrice - trade.EntryPrice : trade.EntryPrice - position.MaxPrice) * absoluteUnexecutedQuantity * conversionRate * multiplier, 2),\n                            MFE = Math.Round((trade.Direction == TradeDirection.Long ? position.MaxPrice - trade.EntryPrice : trade.EntryPrice - position.MinPrice) * absoluteUnexecutedQuantity * conversionRate * multiplier, 2),\n                            EndTradeDrawdown = Math.Round(tradeState.MaxDrawdown * absoluteUnexecutedQuantity * conversionRate * multiplier, 2),\n                            OrderIds = new HashSet<int>([..trade.OrderIds, fill.OrderId])\n                        };\n\n                        AddNewTrade(newTrade, fill);\n\n                        trade.TotalFees = 0;\n                    }\n\n                    orderFeeAssigned = true;\n                }\n\n                if (Math.Abs(totalExecutedQuantity) == fill.AbsoluteFillQuantity && position.PendingTrades.Count == 0)\n                {\n                    _positions.Remove(fill.Symbol);\n                }\n                else if (Math.Abs(totalExecutedQuantity) < fill.AbsoluteFillQuantity)\n                {\n                    // direction reversal\n                    fill.FillQuantity -= totalExecutedQuantity;\n                    position.PendingTrades = new List<TradeState>\n                    {\n                        new TradeState\n                        {\n                            Trade = new Trade\n                            {\n                                Symbols =[fill.Symbol],\n                                EntryTime = fill.UtcTime,\n                                EntryPrice = fill.FillPrice,\n                                Direction = fill.FillQuantity > 0 ? TradeDirection.Long : TradeDirection.Short,\n                                Quantity = fill.AbsoluteFillQuantity,\n                                TotalFees = 0,\n                                OrderIds = new HashSet<int>() { fill.OrderId }\n                            }\n                        }\n                    };\n                    position.MinPrice = fill.FillPrice;\n                    position.MaxPrice = fill.FillPrice;\n                }\n            }\n        }\n\n        private void ProcessFillUsingFlatToFlat(OrderEvent fill, decimal orderFee, decimal conversionRate, decimal multiplier)\n        {\n            Position position;\n            if (!_positions.TryGetValue(fill.Symbol, out position) || position.PendingFills.Count == 0)\n            {\n                // no pending executions for symbol\n                _positions[fill.Symbol] = new Position\n                {\n                    PendingFills = new List<OrderEvent> { fill },\n                    TotalFees = orderFee,\n                    MinPrice = fill.FillPrice,\n                    MaxPrice = fill.FillPrice\n                };\n                return;\n            }\n\n            SetMarketPrice(fill.Symbol, fill.FillPrice);\n\n            if (Math.Sign(position.PendingFills[0].FillQuantity) == Math.Sign(fill.FillQuantity))\n            {\n                // execution has same direction of trade\n                position.PendingFills.Add(fill);\n                position.TotalFees += orderFee;\n            }\n            else\n            {\n                // execution has opposite direction of trade\n                if (position.PendingFills.Aggregate(0m, (d, x) => d + x.FillQuantity) + fill.FillQuantity == 0 || fill.AbsoluteFillQuantity > Math.Abs(position.PendingFills.Aggregate(0m, (d, x) => d + x.FillQuantity)))\n                {\n                    // trade closed\n                    position.PendingFills.Add(fill);\n                    position.TotalFees += orderFee;\n\n                    var reverseQuantity = position.PendingFills.Sum(x => x.FillQuantity);\n\n                    var index = _matchingMethod == FillMatchingMethod.FIFO ? 0 : position.PendingFills.Count - 1;\n\n                    var entryTime = position.PendingFills[0].UtcTime;\n                    var totalEntryQuantity = 0m;\n                    var totalExitQuantity = 0m;\n                    var entryAveragePrice = 0m;\n                    var exitAveragePrice = 0m;\n                    var relatedOrderIds = new HashSet<int>();\n\n                    while (position.PendingFills.Count > 0)\n                    {\n                        var currentFill = position.PendingFills[index];\n                        if (Math.Sign(currentFill.FillQuantity) != Math.Sign(fill.FillQuantity))\n                        {\n                            // entry\n                            totalEntryQuantity += currentFill.FillQuantity;\n                            entryAveragePrice += (currentFill.FillPrice - entryAveragePrice) * currentFill.FillQuantity / totalEntryQuantity;\n                        }\n                        else\n                        {\n                            // exit\n                            totalExitQuantity += currentFill.FillQuantity;\n                            exitAveragePrice += (currentFill.FillPrice - exitAveragePrice) * currentFill.FillQuantity / totalExitQuantity;\n                        }\n                        relatedOrderIds.Add(currentFill.OrderId);\n                        position.PendingFills.RemoveAt(index);\n\n                        if (_matchingMethod == FillMatchingMethod.LIFO && index > 0) index--;\n                    }\n\n                    var direction = Math.Sign(fill.FillQuantity) < 0 ? TradeDirection.Long : TradeDirection.Short;\n                    var trade = new Trade\n                    {\n                        Symbols = [fill.Symbol],\n                        EntryTime = entryTime,\n                        EntryPrice = entryAveragePrice,\n                        Direction = direction,\n                        Quantity = Math.Abs(totalEntryQuantity),\n                        ExitTime = fill.UtcTime,\n                        ExitPrice = exitAveragePrice,\n                        ProfitLoss = Math.Round((exitAveragePrice - entryAveragePrice) * Math.Abs(totalEntryQuantity) * Math.Sign(totalEntryQuantity) * conversionRate * multiplier, 2),\n                        TotalFees = position.TotalFees,\n                        OrderIds = relatedOrderIds\n                        // MAE, MFE, EndTradeDrawdown are zero for FlatToFlat grouping method.\n                        // WE can fix this in the future if needed, but it might require tracking market prices\n                        // during the life of the trade, so that we can compute these metrics accurately accounting for\n                        // time, each fill entry price and quantity, which affect profit and drawdown and \n                        // adds complexity and memory overhead.\n                    };\n\n                    AddNewTrade(trade, fill);\n\n                    _positions.Remove(fill.Symbol);\n\n                    if (reverseQuantity != 0)\n                    {\n                        // direction reversal\n                        fill.FillQuantity = reverseQuantity;\n                        _positions[fill.Symbol] = new Position\n                        {\n                            PendingFills = new List<OrderEvent> { fill },\n                            TotalFees = 0,\n                            MinPrice = fill.FillPrice,\n                            MaxPrice = fill.FillPrice\n                        };\n                    }\n                }\n                else\n                {\n                    // trade open\n                    position.PendingFills.Add(fill);\n                    position.TotalFees += orderFee;\n                }\n            }\n        }\n\n        private void ProcessFillUsingFlatToReduced(OrderEvent fill, decimal orderFee, decimal conversionRate, decimal multiplier)\n        {\n            Position position;\n            if (!_positions.TryGetValue(fill.Symbol, out position) || position.PendingFills.Count == 0)\n            {\n                // no pending executions for symbol\n                _positions[fill.Symbol] = new Position\n                {\n                    PendingFills = new List<OrderEvent> { fill },\n                    TotalFees = orderFee,\n                    MinPrice = fill.FillPrice,\n                    MaxPrice = fill.FillPrice\n                };\n                return;\n            }\n\n            SetMarketPrice(fill.Symbol, fill.FillPrice);\n\n            var index = _matchingMethod == FillMatchingMethod.FIFO ? 0 : position.PendingFills.Count - 1;\n\n            if (Math.Sign(fill.FillQuantity) == Math.Sign(position.PendingFills[index].FillQuantity))\n            {\n                // execution has same direction of trade\n                position.PendingFills.Add(fill);\n                position.TotalFees += orderFee;\n            }\n            else\n            {\n                // execution has opposite direction of trade\n                var entryTime = position.PendingFills[index].UtcTime;\n                var totalExecutedQuantity = 0m;\n                var entryPrice = 0m;\n                position.TotalFees += orderFee;\n                var relatedOrderIds = new HashSet<int> { fill.OrderId };\n\n                while (position.PendingFills.Count > 0 && Math.Abs(totalExecutedQuantity) < fill.AbsoluteFillQuantity)\n                {\n                    var currentFill = position.PendingFills[index];\n                    var absoluteUnexecutedQuantity = fill.AbsoluteFillQuantity - Math.Abs(totalExecutedQuantity);\n                    if (absoluteUnexecutedQuantity >= Math.Abs(currentFill.FillQuantity))\n                    {\n                        if (_matchingMethod == FillMatchingMethod.LIFO)\n                            entryTime = currentFill.UtcTime;\n\n                        totalExecutedQuantity -= currentFill.FillQuantity;\n                        entryPrice -= (currentFill.FillPrice - entryPrice) * currentFill.FillQuantity / totalExecutedQuantity;\n                        position.PendingFills.RemoveAt(index);\n\n                        if (_matchingMethod == FillMatchingMethod.LIFO && index > 0) index--;\n                    }\n                    else\n                    {\n                        var executedQuantity = absoluteUnexecutedQuantity * Math.Sign(fill.FillQuantity);\n                        totalExecutedQuantity += executedQuantity;\n                        entryPrice += (currentFill.FillPrice - entryPrice) * executedQuantity / totalExecutedQuantity;\n                        currentFill.FillQuantity += executedQuantity;\n                    }\n                    relatedOrderIds.Add(currentFill.OrderId);\n                }\n\n                var direction = totalExecutedQuantity < 0 ? TradeDirection.Long : TradeDirection.Short;\n                var trade = new Trade\n                {\n                    Symbols = [fill.Symbol],\n                    EntryTime = entryTime,\n                    EntryPrice = entryPrice,\n                    Direction = direction,\n                    Quantity = Math.Abs(totalExecutedQuantity),\n                    ExitTime = fill.UtcTime,\n                    ExitPrice = fill.FillPrice,\n                    ProfitLoss = Math.Round((fill.FillPrice - entryPrice) * Math.Abs(totalExecutedQuantity) * Math.Sign(-totalExecutedQuantity) * conversionRate * multiplier, 2),\n                    TotalFees = position.TotalFees,\n                    OrderIds = relatedOrderIds\n\n                    // MAE, MFE, EndTradeDrawdown are zero for FlatToReduce grouping method.\n                    // See comment in FlatToFlat method for more details.541\n                };\n\n                AddNewTrade(trade, fill);\n\n                if (Math.Abs(totalExecutedQuantity) < fill.AbsoluteFillQuantity)\n                {\n                    // direction reversal\n                    fill.FillQuantity -= totalExecutedQuantity;\n                    position.PendingFills = new List<OrderEvent> { fill };\n                    position.TotalFees = 0;\n                    position.MinPrice = fill.FillPrice;\n                    position.MaxPrice = fill.FillPrice;\n                }\n                else if (Math.Abs(totalExecutedQuantity) == fill.AbsoluteFillQuantity)\n                {\n                    if (position.PendingFills.Count == 0)\n                        _positions.Remove(fill.Symbol);\n                    else\n                        position.TotalFees = 0;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Adds a trade to the list of closed trades, capping the total number only in live mode\n        /// </summary>\n        private void AddNewTrade(Trade trade, OrderEvent fill)\n        {\n            lock (_closedTrades)\n            {\n                trade.IsWin = _securities != null && _securities.TryGetValue(trade.Symbol, out var security)\n                    ? fill.IsWin(security, trade.ProfitLoss)\n                    : trade.ProfitLoss > 0;\n\n                trade.Id = Guid.NewGuid().ToString();\n                _closedTrades.Add(trade);\n\n                // Due to memory constraints in live mode, we cap the number of trades\n                if (!_liveMode)\n                    return;\n\n                // maximum number of trades\n                if (_closedTrades.Count > LiveModeMaxTradeCount)\n                {\n                    _closedTrades.RemoveRange(0, _closedTrades.Count - LiveModeMaxTradeCount);\n                }\n\n                // maximum age of trades\n                while (_closedTrades.Count > 0 && _closedTrades[0].ExitTime.Date.AddMonths(LiveModeMaxTradeAgeMonths) < DateTime.Today)\n                {\n                    _closedTrades.RemoveAt(0);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/TradeEnums.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// Direction of a trade\n    /// </summary>\n    public enum TradeDirection\n    {\n        /// <summary>\n        /// Long direction (0)\n        /// </summary>\n        Long,\n\n        /// <summary>\n        /// Short direction (1)\n        /// </summary>\n        Short\n    }\n\n    /// <summary>\n    /// The method used to group order fills into trades\n    /// </summary>\n    public enum FillGroupingMethod\n    {\n        /// <summary>\n        /// A Trade is defined by a fill that establishes or increases a position and an offsetting fill that reduces the position size (0)\n        /// </summary>\n        FillToFill,\n\n        /// <summary>\n        /// A Trade is defined by a sequence of fills, from a flat position to a non-zero position which may increase or decrease in quantity, and back to a flat position (1)\n        /// </summary>\n        FlatToFlat,\n\n        /// <summary>\n        /// A Trade is defined by a sequence of fills, from a flat position to a non-zero position and an offsetting fill that reduces the position size (2)\n        /// </summary>\n        FlatToReduced\n    }\n\n    /// <summary>\n    /// The method used to match offsetting order fills\n    /// </summary>\n    public enum FillMatchingMethod\n    {\n        /// <summary>\n        /// First In First Out fill matching method (0)\n        /// </summary>\n        FIFO,\n\n        /// <summary>\n        /// Last In Last Out fill matching method (1)\n        /// </summary>\n        LIFO\n    }\n}\n"
  },
  {
    "path": "Common/Statistics/TradeStatistics.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Statistics\n{\n    /// <summary>\n    /// The <see cref=\"TradeStatistics\"/> class represents a set of statistics calculated from a list of closed trades\n    /// </summary>\n    public class TradeStatistics\n    {\n        /// <summary>\n        /// The entry date/time of the first trade\n        /// </summary>\n        public DateTime? StartDateTime { get; set; }\n\n        /// <summary>\n        /// The exit date/time of the last trade\n        /// </summary>\n        public DateTime? EndDateTime { get; set; }\n\n        /// <summary>\n        /// The total number of trades\n        /// </summary>\n        public int TotalNumberOfTrades { get; set; }\n\n        /// <summary>\n        /// The total number of winning trades\n        /// </summary>\n        public int NumberOfWinningTrades { get; set; }\n\n        /// <summary>\n        /// The total number of losing trades\n        /// </summary>\n        public int NumberOfLosingTrades { get; set; }\n\n        /// <summary>\n        /// The total profit/loss for all trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TotalProfitLoss { get; set; }\n\n        /// <summary>\n        /// The total profit for all winning trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TotalProfit { get; set; }\n\n        /// <summary>\n        /// The total loss for all losing trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TotalLoss { get; set; }\n\n        /// <summary>\n        /// The largest profit in a single trade (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LargestProfit { get; set; }\n\n        /// <summary>\n        /// The largest loss in a single trade (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LargestLoss { get; set; }\n\n        /// <summary>\n        /// The average profit/loss (a.k.a. Expectancy or Average Trade) for all trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageProfitLoss { get; set; }\n\n        /// <summary>\n        /// The average profit for all winning trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageProfit { get; set; }\n\n        /// <summary>\n        /// The average loss for all winning trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageLoss { get; set; }\n\n        /// <summary>\n        /// The average duration for all trades\n        /// </summary>\n        public TimeSpan AverageTradeDuration { get; set; }\n\n        /// <summary>\n        /// The average duration for all winning trades\n        /// </summary>\n        public TimeSpan AverageWinningTradeDuration { get; set; }\n\n        /// <summary>\n        /// The average duration for all losing trades\n        /// </summary>\n        public TimeSpan AverageLosingTradeDuration { get; set; }\n\n        /// <summary>\n        /// The median duration for all trades\n        /// </summary>\n        public TimeSpan MedianTradeDuration { get; set; }\n\n        /// <summary>\n        /// The median duration for all winning trades\n        /// </summary>\n        public TimeSpan MedianWinningTradeDuration { get; set; }\n\n        /// <summary>\n        /// The median duration for all losing trades\n        /// </summary>\n        public TimeSpan MedianLosingTradeDuration { get; set; }\n\n        /// <summary>\n        /// The maximum number of consecutive winning trades\n        /// </summary>\n        public int MaxConsecutiveWinningTrades { get; set; }\n\n        /// <summary>\n        /// The maximum number of consecutive losing trades\n        /// </summary>\n        public int MaxConsecutiveLosingTrades { get; set; }\n\n        /// <summary>\n        /// The ratio of the average profit per trade to the average loss per trade\n        /// </summary>\n        /// <remarks>If the average loss is zero, ProfitLossRatio is set to 0</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitLossRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of winning trades to the number of losing trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, WinLossRatio is set to zero</remarks>\n        /// <remarks>If the number of losing trades is zero and the number of winning trades is nonzero, WinLossRatio is set to 10</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal WinLossRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of winning trades to the total number of trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, WinRate is set to zero</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal WinRate { get; set; }\n\n        /// <summary>\n        /// The ratio of the number of losing trades to the total number of trades\n        /// </summary>\n        /// <remarks>If the total number of trades is zero, LossRate is set to zero</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LossRate { get; set; }\n\n        /// <summary>\n        /// The average Maximum Adverse Excursion for all trades\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageMAE { get; set; }\n\n        /// <summary>\n        /// The average Maximum Favorable Excursion for all trades\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageMFE { get; set; }\n\n        /// <summary>\n        /// The largest Maximum Adverse Excursion in a single trade (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LargestMAE { get; set; }\n\n        /// <summary>\n        /// The largest Maximum Favorable Excursion in a single trade (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal LargestMFE { get; set; }\n\n        /// <summary>\n        /// The maximum closed-trade drawdown for all trades (as symbol currency)\n        /// </summary>\n        /// <remarks>The calculation only takes into account the profit/loss of each trade</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal MaximumClosedTradeDrawdown { get; set; }\n\n        /// <summary>\n        /// The maximum intra-trade drawdown for all trades (as symbol currency)\n        /// </summary>\n        /// <remarks>The calculation takes into account MAE and MFE of each trade</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal MaximumIntraTradeDrawdown { get; set; }\n\n        /// <summary>\n        /// The standard deviation of the profits/losses for all trades (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitLossStandardDeviation { get; set; }\n\n        /// <summary>\n        /// The downside deviation of the profits/losses for all trades (as symbol currency)\n        /// </summary>\n        /// <remarks>This metric only considers deviations of losing trades</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitLossDownsideDeviation { get; set; }\n\n        /// <summary>\n        /// The ratio of the total profit to the total loss\n        /// </summary>\n        /// <remarks>If the total profit is zero, ProfitFactor is set to zero</remarks>\n        /// <remarks>if the total loss is zero and the total profit is nonzero, ProfitFactor is set to 10</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitFactor { get; set; }\n\n        /// <summary>\n        /// The ratio of the average profit/loss to the standard deviation\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal SharpeRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the average profit/loss to the downside deviation\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal SortinoRatio { get; set; }\n\n        /// <summary>\n        /// The ratio of the total profit/loss to the maximum closed trade drawdown\n        /// </summary>\n        /// <remarks>If the total profit/loss is zero, ProfitToMaxDrawdownRatio is set to zero</remarks>\n        /// <remarks>if the drawdown is zero and the total profit is nonzero, ProfitToMaxDrawdownRatio is set to 10</remarks>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal ProfitToMaxDrawdownRatio { get; set; }\n\n        /// <summary>\n        /// The maximum amount of profit given back by a single trade before exit (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal MaximumEndTradeDrawdown { get; set; }\n\n        /// <summary>\n        /// The average amount of profit given back by all trades before exit (as symbol currency)\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal AverageEndTradeDrawdown { get; set; }\n\n        /// <summary>\n        /// The maximum amount of time to recover from a drawdown (longest time between new equity highs or peaks)\n        /// </summary>\n        public TimeSpan MaximumDrawdownDuration { get; set; }\n\n        /// <summary>\n        /// The sum of fees for all trades\n        /// </summary>\n        [JsonConverter(typeof(JsonRoundingConverter))]\n        public decimal TotalFees { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TradeStatistics\"/> class\n        /// </summary>\n        /// <param name=\"trades\">The list of closed trades</param>\n        public TradeStatistics(IEnumerable<Trade> trades)\n        {\n            var maxConsecutiveWinners = 0;\n            var maxConsecutiveLosers = 0;\n            var maxTotalProfitLoss = 0m;\n            var maxTotalProfitLossWithMfe = 0m;\n            var sumForVariance = 0m;\n            var sumForDownsideVariance = 0m;\n            var lastPeakTime = DateTime.MinValue;\n            var isInDrawdown = false;\n            var allTradeDurationsTicks = new List<long>();\n            var winningTradeDurationsTicks = new List<long>();\n            var losingTradeDurationsTicks = new List<long>();\n            var numberOfITMOptionsWinningTrades = 0;\n\n            foreach (var trade in trades)\n            {\n                if (lastPeakTime == DateTime.MinValue) lastPeakTime = trade.EntryTime;\n\n                if (StartDateTime == null || trade.EntryTime < StartDateTime)\n                    StartDateTime = trade.EntryTime;\n\n                if (EndDateTime == null || trade.ExitTime > EndDateTime)\n                    EndDateTime = trade.ExitTime;\n\n                TotalNumberOfTrades++;\n\n                if (TotalProfitLoss + trade.MFE > maxTotalProfitLossWithMfe)\n                    maxTotalProfitLossWithMfe = TotalProfitLoss + trade.MFE;\n\n                if (TotalProfitLoss + trade.MAE - maxTotalProfitLossWithMfe < MaximumIntraTradeDrawdown)\n                    MaximumIntraTradeDrawdown = TotalProfitLoss + trade.MAE - maxTotalProfitLossWithMfe;\n\n                if (trade.ProfitLoss > 0)\n                {\n                    // winning trade\n                    NumberOfWinningTrades++;\n\n                    TotalProfitLoss += trade.ProfitLoss;\n                    TotalProfit += trade.ProfitLoss;\n                    AverageProfit += (trade.ProfitLoss - AverageProfit) / NumberOfWinningTrades;\n\n                    AverageWinningTradeDuration += TimeSpan.FromSeconds((trade.Duration.TotalSeconds - AverageWinningTradeDuration.TotalSeconds) / NumberOfWinningTrades);\n\n                    winningTradeDurationsTicks.Add(trade.Duration.Ticks);\n\n                    if (trade.ProfitLoss > LargestProfit)\n                        LargestProfit = trade.ProfitLoss;\n\n                    maxConsecutiveWinners++;\n                    maxConsecutiveLosers = 0;\n                    if (maxConsecutiveWinners > MaxConsecutiveWinningTrades)\n                        MaxConsecutiveWinningTrades = maxConsecutiveWinners;\n\n                    if (TotalProfitLoss > maxTotalProfitLoss)\n                    {\n                        // new equity high\n                        maxTotalProfitLoss = TotalProfitLoss;\n\n                        if (isInDrawdown && trade.ExitTime - lastPeakTime > MaximumDrawdownDuration)\n                            MaximumDrawdownDuration = trade.ExitTime - lastPeakTime;\n\n                        lastPeakTime = trade.ExitTime;\n                        isInDrawdown = false;\n                    }\n                }\n                else\n                {\n                    // losing trade\n                    NumberOfLosingTrades++;\n\n                    TotalProfitLoss += trade.ProfitLoss;\n                    TotalLoss += trade.ProfitLoss;\n                    var prevAverageLoss = AverageLoss;\n                    AverageLoss += (trade.ProfitLoss - AverageLoss) / NumberOfLosingTrades;\n\n                    sumForDownsideVariance += (trade.ProfitLoss - prevAverageLoss) * (trade.ProfitLoss - AverageLoss);\n                    var downsideVariance = NumberOfLosingTrades > 1 ? sumForDownsideVariance / (NumberOfLosingTrades - 1) : 0;\n                    ProfitLossDownsideDeviation = (decimal)Math.Sqrt((double)downsideVariance);\n\n                    AverageLosingTradeDuration += TimeSpan.FromSeconds((trade.Duration.TotalSeconds - AverageLosingTradeDuration.TotalSeconds) / NumberOfLosingTrades);\n\n                    losingTradeDurationsTicks.Add(trade.Duration.Ticks);\n\n                    if (trade.ProfitLoss < LargestLoss)\n                        LargestLoss = trade.ProfitLoss;\n\n                    // even though losing money, an ITM option trade is a winning trade,\n                    // so IsWin for an ITM OptionTrade will return true even if the trade was not profitable.\n                    if (trade.IsWin)\n                    {\n                        numberOfITMOptionsWinningTrades++;\n                        maxConsecutiveLosers = 0;\n                        maxConsecutiveWinners++;\n                        if (maxConsecutiveWinners > MaxConsecutiveWinningTrades)\n                            MaxConsecutiveWinningTrades = maxConsecutiveWinners;\n                    }\n                    else\n                    {\n                        maxConsecutiveWinners = 0;\n                        maxConsecutiveLosers++;\n                        if (maxConsecutiveLosers > MaxConsecutiveLosingTrades)\n                            MaxConsecutiveLosingTrades = maxConsecutiveLosers;\n                    }\n\n                    if (TotalProfitLoss - maxTotalProfitLoss < MaximumClosedTradeDrawdown)\n                        MaximumClosedTradeDrawdown = TotalProfitLoss - maxTotalProfitLoss;\n\n                    isInDrawdown = true;\n                }\n\n                var prevAverageProfitLoss = AverageProfitLoss;\n                AverageProfitLoss += (trade.ProfitLoss - AverageProfitLoss) / TotalNumberOfTrades;\n\n                sumForVariance += (trade.ProfitLoss - prevAverageProfitLoss) * (trade.ProfitLoss - AverageProfitLoss);\n                var variance = TotalNumberOfTrades > 1 ? sumForVariance / (TotalNumberOfTrades - 1) : 0;\n                ProfitLossStandardDeviation = (decimal)Math.Sqrt((double)variance);\n\n                AverageTradeDuration += TimeSpan.FromSeconds((trade.Duration.TotalSeconds - AverageTradeDuration.TotalSeconds) / TotalNumberOfTrades);\n                allTradeDurationsTicks.Add(trade.Duration.Ticks);\n                AverageMAE += (trade.MAE - AverageMAE) / TotalNumberOfTrades;\n                AverageMFE += (trade.MFE - AverageMFE) / TotalNumberOfTrades;\n\n                if (trade.MAE < LargestMAE)\n                    LargestMAE = trade.MAE;\n\n                if (trade.MFE > LargestMFE)\n                    LargestMFE = trade.MFE;\n\n                if (trade.EndTradeDrawdown > MaximumEndTradeDrawdown)\n                    MaximumEndTradeDrawdown = trade.EndTradeDrawdown;\n\n                TotalFees += trade.TotalFees;\n            }\n\n            // Adjust number of winning and losing trades: ITM options assignment loss counts as a loss for profit and loss calculations,\n            // but adds a win to the wins count since this is an actual win even though premium paid is a loss.\n            NumberOfWinningTrades += numberOfITMOptionsWinningTrades;\n            NumberOfLosingTrades -= numberOfITMOptionsWinningTrades;\n\n            ProfitLossRatio = AverageLoss == 0 ? 0 : AverageProfit / Math.Abs(AverageLoss);\n            WinLossRatio = TotalNumberOfTrades == 0 ? 0 : (NumberOfLosingTrades > 0 ? (decimal)NumberOfWinningTrades / NumberOfLosingTrades : 10);\n            WinRate = TotalNumberOfTrades > 0 ? (decimal)NumberOfWinningTrades / TotalNumberOfTrades : 0;\n            LossRate = TotalNumberOfTrades > 0 ? 1 - WinRate : 0;\n            ProfitFactor = TotalProfit == 0 ? 0 : (TotalLoss < 0 ? TotalProfit / Math.Abs(TotalLoss) : 10);\n            SharpeRatio = ProfitLossStandardDeviation > 0 ? AverageProfitLoss / ProfitLossStandardDeviation : 0;\n            SortinoRatio = ProfitLossDownsideDeviation > 0 ? AverageProfitLoss / ProfitLossDownsideDeviation : 0;\n            ProfitToMaxDrawdownRatio = TotalProfitLoss == 0 ? 0 : (MaximumClosedTradeDrawdown < 0 ? TotalProfitLoss / Math.Abs(MaximumClosedTradeDrawdown) : 10);\n\n            AverageEndTradeDrawdown = AverageProfitLoss - AverageMFE;\n\n            if (allTradeDurationsTicks.Count > 0)\n                MedianTradeDuration = TimeSpan.FromTicks(allTradeDurationsTicks.Median());\n            if (winningTradeDurationsTicks.Count > 0)\n                MedianWinningTradeDuration = TimeSpan.FromTicks(winningTradeDurationsTicks.Median());\n            if (losingTradeDurationsTicks.Count > 0)\n                MedianLosingTradeDuration = TimeSpan.FromTicks(losingTradeDurationsTicks.Median());\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TradeStatistics\"/> class\n        /// </summary>\n        public TradeStatistics()\n        {\n        }\n\n    }\n}\n"
  },
  {
    "path": "Common/Storage/ObjectStore.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Xml.Serialization;\nusing Newtonsoft.Json;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Storage\n{\n    /// <summary>\n    /// Helper class for easier access to <see cref=\"IObjectStore\"/> methods\n    /// </summary>\n    public class ObjectStore : IObjectStore\n    {\n        /// <summary>\n        /// Gets the maximum storage limit in bytes\n        /// </summary>\n        public long MaxSize => _store.MaxSize;\n\n        /// <summary>\n        /// Gets the maximum number of files allowed\n        /// </summary>\n        public int MaxFiles => _store.MaxFiles;\n\n        /// <summary>\n        /// Event raised each time there's an error\n        /// </summary>\n        public event EventHandler<ObjectStoreErrorRaisedEventArgs> ErrorRaised\n        {\n            add { _store.ErrorRaised += value; }\n            remove { _store.ErrorRaised -= value; }\n        }\n\n        private readonly IObjectStore _store;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ObjectStore\"/> class\n        /// </summary>\n        /// <param name=\"store\">The <see cref=\"IObjectStore\"/> instance to wrap</param>\n        public ObjectStore(IObjectStore store)\n        {\n            _store = store;\n        }\n\n        /// <summary>\n        /// Initializes the object store\n        /// </summary>\n        /// <param name=\"userId\">The user id</param>\n        /// <param name=\"projectId\">The project id</param>\n        /// <param name=\"userToken\">The user token</param>\n        /// <param name=\"controls\">The job controls instance</param>\n        /// <param name=\"algorithmMode\">The algorithm mode</param>\n        public void Initialize(int userId, int projectId, string userToken, Controls controls, AlgorithmMode algorithmMode)\n        {\n            _store.Initialize(userId, projectId, userToken, controls, algorithmMode);\n        }\n\n        /// <summary>\n        /// Returns the file paths present in the object store. This is specially useful not to load the object store into memory\n        /// </summary>\n        public ICollection<string> Keys => _store.Keys;\n\n        /// <summary>\n        /// Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information\n        /// </summary>\n        public void Clear() => _store.Clear();\n\n        /// <summary>\n        /// Determines whether the store contains data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the key was found</returns>\n        public bool ContainsKey(string path)\n        {\n            return _store.ContainsKey(path);\n        }\n\n        /// <summary>\n        /// Returns the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>A byte array containing the data</returns>\n        public byte[] ReadBytes(string path)\n        {\n            return _store.ReadBytes(path);\n        }\n\n        /// <summary>\n        /// Saves the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"contents\">The object data</param>\n        /// <returns>True if the save operation was successful</returns>\n        public bool SaveBytes(string path, byte[] contents)\n        {\n            return _store.SaveBytes(path, contents);\n        }\n\n        /// <summary>\n        /// Deletes the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the delete operation was successful</returns>\n        public bool Delete(string path)\n        {\n            return _store.Delete(path);\n        }\n\n        /// <summary>\n        /// Returns the file path for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>The path for the file</returns>\n        public string GetFilePath(string path)\n        {\n            return _store.GetFilePath(path);\n        }\n\n        /// <summary>\n        /// Returns the string object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <returns>A string containing the data</returns>\n        public string Read(string path, Encoding encoding = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            var data = _store.ReadBytes(path);\n            return data != null ? encoding.GetString(data) : null;\n        }\n\n        /// <summary>\n        /// Returns the string object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <returns>A string containing the data</returns>\n        public string ReadString(string path, Encoding encoding = null)\n        {\n            return Read(path, encoding);\n        }\n\n        /// <summary>\n        /// Returns the JSON deserialized object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <param name=\"settings\">The settings used by the JSON deserializer</param>\n        /// <returns>An object containing the data</returns>\n        public T ReadJson<T>(string path, Encoding encoding = null, JsonSerializerSettings settings = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            var json = Read(path, encoding);\n            return JsonConvert.DeserializeObject<T>(json, settings);\n        }\n\n        /// <summary>\n        /// Returns the XML deserialized object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <returns>An object containing the data</returns>\n        public T ReadXml<T>(string path, Encoding encoding = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            var xml = Read(path, encoding);\n\n            var serializer = new XmlSerializer(typeof(T));\n            using (var reader = new StringReader(xml))\n            {\n                return (T)serializer.Deserialize(reader);\n            }\n        }\n\n        /// <summary>\n        /// Saves the data from a local file path associated with the specified path\n        /// </summary>\n        /// <remarks>If the file does not exist it will throw an exception</remarks>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the object was saved successfully</returns>\n        public bool Save(string path)\n        {\n            // Check the file exists\n            var filePath = GetFilePath(path);\n            if (!File.Exists(filePath))\n            {\n                throw new ArgumentException($\"There is no file associated with path {path} in '{filePath}'\");\n            }\n            var bytes = File.ReadAllBytes(filePath);\n\n            return _store.SaveBytes(path, bytes);\n        }\n\n        /// <summary>\n        /// Saves the object data in text format for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"text\">The string object to be saved</param>\n        /// <param name=\"encoding\">The string encoding used, <see cref=\"Encoding.UTF8\"/> by default</param>\n        /// <returns>True if the object was saved successfully</returns>\n        public bool Save(string path, string text, Encoding encoding = null)\n        {\n            encoding ??= Encoding.UTF8;\n            return _store.SaveBytes(path, encoding.GetBytes(text));\n        }\n\n        /// <summary>\n        /// Saves the object data in text format for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"text\">The string object to be saved</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <returns>True if the object was saved successfully</returns>\n        public bool SaveString(string path, string text, Encoding encoding = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            return _store.SaveBytes(path, encoding.GetBytes(text));\n        }\n\n        /// <summary>\n        /// Saves the object data in JSON format for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"obj\">The object to be saved</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <param name=\"settings\">The settings used by the JSON serializer</param>\n        /// <returns>True if the object was saved successfully</returns>\n        public bool SaveJson<T>(string path, T obj, Encoding encoding = null, JsonSerializerSettings settings = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            var json = JsonConvert.SerializeObject(obj, settings);\n            return SaveString(path, json, encoding);\n        }\n\n        /// <summary>\n        /// Saves the object data in XML format for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"obj\">The object to be saved</param>\n        /// <param name=\"encoding\">The string encoding used</param>\n        /// <returns>True if the object was saved successfully</returns>\n        public bool SaveXml<T>(string path, T obj, Encoding encoding = null)\n        {\n            encoding = encoding ?? Encoding.UTF8;\n\n            using (var writer = new StringWriter())\n            {\n                var serializer = new XmlSerializer(typeof(T));\n                serializer.Serialize(writer, obj);\n\n                var xml = writer.ToString();\n                return SaveString(path, xml, encoding);\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<KeyValuePair<string, byte[]>> GetEnumerator()\n        {\n            return _store.GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return ((IEnumerable)_store).GetEnumerator();\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _store.Dispose();\n        }\n    }\n}"
  },
  {
    "path": "Common/StringExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Text;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides extension methods for properly parsing and serializing values while properly using\n    /// an IFormatProvider/CultureInfo when applicable\n    /// </summary>\n    public static class StringExtensions\n    {\n        private static readonly CultureInfo CultureInfo = CultureInfo.InvariantCulture;\n        private static readonly IFormatProvider FormatProvider = CultureInfo;\n        private static readonly StringComparison StringComparison = StringComparison.InvariantCulture;\n\n        /// <summary>\n        /// Converts the provided <paramref name=\"value\"/> as <typeparamref name=\"T\"/>\n        /// using <see cref=\"CultureInfo\"/>\n        /// </summary>\n        public static T ConvertInvariant<T>(this object value)\n        {\n            return (T) value.ConvertInvariant(typeof(T));\n        }\n\n        /// <summary>\n        /// Converts the provided <paramref name=\"value\"/> as <paramref name=\"conversionType\"/>\n        /// using <see cref=\"CultureInfo\"/>\n        /// </summary>\n        /// <remarks>\n        /// This implementation uses the Convert.ToXXX methods. This causes null values to be converted to the default value\n        /// for the provided <paramref name=\"conversionType\"/>. This is in contrast to directly calling <see cref=\"IConvertible.ToType\"/>\n        /// which results in an <see cref=\"InvalidCastException\"/> or a <see cref=\"FormatException\"/>. Since existing code is\n        /// dependent on this null -> default value conversion behavior, it has been preserved in this method.\n        /// </remarks>\n        public static object ConvertInvariant(this object value, Type conversionType)\n        {\n            switch (Type.GetTypeCode(conversionType))\n            {\n                // these cases are purposefully ordered to ensure the compiler can generate a jump table vs a binary tree\n                case TypeCode.Empty:\n                    throw new ArgumentException(Messages.StringExtensions.ConvertInvariantCannotConvertTo(TypeCode.Empty));\n\n                case TypeCode.Object:\n                    var convertible = value as IConvertible;\n                    if (convertible != null)\n                    {\n                        return convertible.ToType(conversionType, FormatProvider);\n                    }\n\n                    return Convert.ChangeType(value, conversionType, FormatProvider);\n\n                case TypeCode.DBNull:\n                    throw new ArgumentException(Messages.StringExtensions.ConvertInvariantCannotConvertTo(TypeCode.DBNull));\n\n                case TypeCode.Boolean:\n                    return Convert.ToBoolean(value, FormatProvider);\n\n                case TypeCode.Char:\n                    return Convert.ToChar(value, FormatProvider);\n\n                case TypeCode.SByte:\n                    return Convert.ToSByte(value, FormatProvider);\n\n                case TypeCode.Byte:\n                    return Convert.ToByte(value, FormatProvider);\n\n                case TypeCode.Int16:\n                    return Convert.ToInt16(value, FormatProvider);\n\n                case TypeCode.UInt16:\n                    return Convert.ToUInt16(value, FormatProvider);\n\n                case TypeCode.Int32:\n                    return Convert.ToInt32(value, FormatProvider);\n\n                case TypeCode.UInt32:\n                    return Convert.ToUInt32(value, FormatProvider);\n\n                case TypeCode.Int64:\n                    return Convert.ToInt64(value, FormatProvider);\n\n                case TypeCode.UInt64:\n                    return Convert.ToUInt64(value, FormatProvider);\n\n                case TypeCode.Single:\n                    return Convert.ToSingle(value, FormatProvider);\n\n                case TypeCode.Double:\n                    return Convert.ToDouble(value, FormatProvider);\n\n                case TypeCode.Decimal:\n                    return Convert.ToDecimal(value, FormatProvider);\n\n                case TypeCode.DateTime:\n                    return Convert.ToDateTime(value, FormatProvider);\n\n                case TypeCode.String:\n                    return Convert.ToString(value, FormatProvider);\n\n                default:\n                    return Convert.ChangeType(value, conversionType, FormatProvider);\n            }\n        }\n\n        /// <summary>\n        /// Non-extension method alias for <see cref=\"FormattableString.Invariant\"/>\n        /// This supports the <code>using static QuantConnect.StringExtensions</code> syntax\n        /// and is aimed at ensuring all formatting is piped through this class instead of\n        /// alternatively piping through directly to <see cref=\"FormattableString.Invariant\"/>\n        /// </summary>\n        public static string Invariant(FormattableString formattable)\n        {\n            return FormattableString.Invariant(formattable);\n        }\n\n        /// <summary>\n        /// Converts the provided value to a string using <see cref=\"CultureInfo\"/>\n        /// </summary>\n        public static string ToStringInvariant(this IConvertible convertible)\n        {\n            if (convertible == null)\n            {\n                return string.Empty;\n            }\n\n            return convertible.ToString(FormatProvider);\n        }\n\n        /// <summary>\n        /// Formats the provided value using the specified <paramref name=\"format\"/> and\n        /// <see cref=\"CultureInfo\"/>\n        /// </summary>\n        public static string ToStringInvariant(this IFormattable formattable, string format)\n        {\n            if (formattable == null)\n            {\n                return string.Empty;\n            }\n\n            // if we have a colon, this implies there's a width parameter in the format it seems this isn't handled\n            // as one would expect. For example, specifying something like $\"{value,10:0.00}\" would force the string\n            // to be at least 10 characters wide with extra padding in the front, but passing the string '10:0.00' or\n            // ',10:0.00' doesn't work. If we are able to detect a colon in the format and the values preceding the colon,\n            // are numeric, then we know it starts with a width parameter and we can pipe it into a custom-formed\n            // string.format call to get the correct output\n            if (format != null)\n            {\n                var indexOfColon = format.IndexOfInvariant(\":\");\n                if (indexOfColon != -1)\n                {\n                    int padding;\n                    var beforeColon = format.Substring(0, indexOfColon);\n                    if (int.TryParse(beforeColon, out padding))\n                    {\n                        return string.Format(FormatProvider, $\"{{0,{format}}}\", formattable);\n                    }\n                }\n            }\n\n            return formattable.ToString(format, FormatProvider);\n        }\n\n        /// <summary>\n        /// Provides a convenience methods for converting a <see cref=\"DateTime\"/> to an invariant ISO-8601 string\n        /// </summary>\n        public static string ToIso8601Invariant(this DateTime dateTime)\n        {\n            return dateTime.ToStringInvariant(\"O\");\n        }\n\n        /// <summary>\n        /// Checks if the string starts with the provided <paramref name=\"beginning\"/> using <see cref=\"CultureInfo\"/>\n        /// while optionally ignoring case.\n        /// </summary>\n        public static bool StartsWithInvariant(this string value, string beginning, bool ignoreCase = false)\n        {\n            return value.StartsWith(beginning, ignoreCase, CultureInfo);\n        }\n\n        /// <summary>\n        /// Checks if the string ends with the provided <paramref name=\"ending\"/> using <see cref=\"CultureInfo\"/>\n        /// while optionally ignoring case.\n        /// </summary>\n        public static bool EndsWithInvariant(this string value, string ending, bool ignoreCase = false)\n        {\n            return value.EndsWith(ending, ignoreCase, CultureInfo);\n        }\n\n        /// <summary>\n        /// Gets the index of the specified <paramref name=\"character\"/> using <see cref=\"StringComparison\"/>\n        /// </summary>\n        public static int IndexOfInvariant(this string value, char character)\n        {\n            return value.IndexOf(character);\n        }\n\n        /// <summary>\n        /// Gets the index of the specified <paramref name=\"substring\"/> using <see cref=\"StringComparison\"/>\n        /// or <see cref=\"System.StringComparison.InvariantCultureIgnoreCase\"/> when <paramref name=\"ignoreCase\"/> is true\n        /// </summary>\n        public static int IndexOfInvariant(this string value, string substring, bool ignoreCase = false)\n        {\n            return value.IndexOf(substring, ignoreCase\n                ? StringComparison.InvariantCultureIgnoreCase\n                : StringComparison\n            );\n        }\n\n        /// <summary>\n        /// Gets the index of the specified <paramref name=\"substring\"/> using <see cref=\"StringComparison\"/>\n        /// or <see cref=\"System.StringComparison.InvariantCultureIgnoreCase\"/> when <paramref name=\"ignoreCase\"/> is true\n        /// </summary>\n        public static int LastIndexOfInvariant(this string value, string substring, bool ignoreCase = false)\n        {\n            return value.LastIndexOf(substring, ignoreCase\n                ? StringComparison.InvariantCultureIgnoreCase\n                : StringComparison\n            );\n        }\n\n        /// <summary>\n        /// Provides a shorthand for avoiding the more verbose ternary equivalent.\n        /// Consider the following:\n        /// <code>\n        /// string.IsNullOrEmpty(str) ? (decimal?)null : Convert.ToDecimal(str, CultureInfo.InvariantCulture)\n        /// </code>\n        /// Can be expressed as:\n        /// <code>\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => Convert.ToDecimal(str, CultureInfo.InvariantCulture))\n        /// </code>\n        /// When combined with additional methods from this class, reducing further to a declarative:\n        /// <code>\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => s.ParseDecimalInvariant())\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => s.ConvertInvariant&lt;decimal&gt;())\n        /// </code>\n        /// </summary>\n        /// <paramref name=\"value\">The string value to check for null or empty</paramref>\n        /// <paramref name=\"defaultValue\">The default value to use if null or empty</paramref>\n        /// <paramref name=\"func\">Function run on non-null string w/ length > 0</paramref>\n        public static T IfNotNullOrEmpty<T>(this string value, T defaultValue, Func<string, T> func)\n        {\n            if (string.IsNullOrEmpty(value))\n            {\n                return defaultValue;\n            }\n\n            return func(value);\n        }\n\n        /// <summary>\n        /// Provides a shorthand for avoiding the more verbose ternary equivalent.\n        /// Consider the following:\n        /// <code>\n        /// string.IsNullOrEmpty(str) ? (decimal?)null : Convert.ToDecimal(str, CultureInfo.InvariantCulture)\n        /// </code>\n        /// Can be expressed as:\n        /// <code>\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => Convert.ToDecimal(str, CultureInfo.InvariantCulture))\n        /// </code>\n        /// When combined with additional methods from this class, reducing further to a declarative:\n        /// <code>\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => s.ParseDecimalInvariant())\n        /// str.IfNotNullOrEmpty&lt;decimal?&gt;(s => s.ConvertInvariant&lt;decimal&gt;())\n        /// </code>\n        /// </summary>\n        /// <paramref name=\"value\">The string value to check for null or empty</paramref>\n        /// <paramref name=\"func\">Function run on non-null string w/ length > 0</paramref>\n        public static T IfNotNullOrEmpty<T>(this string value, Func<string, T> func)\n        {\n            return value.IfNotNullOrEmpty(default(T), func);\n        }\n\n        /// <summary>\n        /// Retrieves a substring from this instance. The substring starts at a specified\n        /// character position and has a specified length.\n        /// </summary>\n        /// <paramref name=\"startIndex\">The zero-based starting character position of a substring in this instance</paramref>\n        /// <paramref name=\"length\">The number of characters in the substring</paramref>\n        public static string SafeSubstring(this string value, int startIndex, int length)\n        {\n            if (string.IsNullOrEmpty(value))\n            {\n                return value;\n            }\n\n            if (startIndex > value.Length - 1)\n            {\n                return string.Empty;\n            }\n\n            if (startIndex < - 1)\n            {\n                startIndex = 0;\n            }\n\n            return value.Substring(startIndex, Math.Min(length, value.Length - startIndex));\n        }\n\n        /// <summary>\n        /// Truncates a string to the specified maximum length\n        /// </summary>\n        /// <param name=\"value\">The string</param>\n        /// <param name=\"maxLength\">The maximum allowed string</param>\n        /// <returns>\n        /// A new string with <paramref name=\"maxLength\"/> characters if the original one's length was greater than the maximum allowed length.\n        /// Otherwise, the original string is returned.\n        /// </returns>\n        public static string Truncate(this string value, int maxLength)\n        {\n            if (value.Length > maxLength)\n            {\n                return value.Substring(0, maxLength);\n            }\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/StubsAvoidImplicitsAttribute.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Custom attribute used for marking properties, fields or arguments types that should not\n    /// be expanded to include other types they can be implicitly converted to.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.All)]\n    public sealed class StubsAvoidImplicitsAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "Common/StubsIgnoreAttribute.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect\n{\n    /// <summary>P\n    /// Custom attribute used for marking classes, methods, properties, etc. that should be ignored by the stubs generator\n    /// </summary>\n    [AttributeUsage(AttributeTargets.All)]\n    public sealed class StubsIgnoreAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "Common/Symbol.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing ProtoBuf;\nusing Python.Runtime;\nusing Newtonsoft.Json;\nusing QuantConnect.Securities;\nusing QuantConnect.Python;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Represents a unique security identifier. This is made of two components,\n    /// the unique SID and the Value. The value is the current ticker symbol while\n    /// the SID is constant over the life of a security\n    /// </summary>\n    [JsonConverter(typeof(SymbolJsonConverter))]\n    [ProtoContract(SkipConstructor = true)]\n    [PandasNonExpandable]\n    public sealed class Symbol : IEquatable<Symbol>, IComparable\n    {\n        private static readonly Lazy<SecurityDefinitionSymbolResolver> _securityDefinitionSymbolResolver = new (() => SecurityDefinitionSymbolResolver.GetInstance());\n\n        private Symbol _canonical;\n        // for performance we register how we compare with empty\n        private bool? _isEmpty;\n\n        /// <summary>\n        /// Represents an unassigned symbol. This is intended to be used as an\n        /// uninitialized, default value\n        /// </summary>\n        public static readonly Symbol Empty = new Symbol(SecurityIdentifier.Empty, string.Empty);\n\n        /// <summary>\n        /// Represents no symbol. This is intended to be used when no symbol is explicitly intended\n        /// </summary>\n        public static readonly Symbol None = new Symbol(SecurityIdentifier.None, \"NONE\");\n\n        /// <summary>\n        /// Provides a convenience method for creating a Symbol for most security types.\n        /// This method currently does not support Commodities\n        /// </summary>\n        /// <param name=\"ticker\">The string ticker symbol</param>\n        /// <param name=\"securityType\">The security type of the ticker. If securityType == Option, then a canonical symbol is created</param>\n        /// <param name=\"market\">The market the ticker resides in</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from different markets</param>\n        /// <param name=\"baseDataType\">Optional for <see cref=\"SecurityType.Base\"/> and used for generating the base data SID</param>\n        /// <returns>A new Symbol object for the specified ticker</returns>\n        public static Symbol Create(string ticker, SecurityType securityType, string market, string alias = null, Type baseDataType = null)\n        {\n            SecurityIdentifier sid;\n\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                    sid = SecurityIdentifier.GenerateBase(baseDataType, ticker, market);\n                    break;\n\n                case SecurityType.Equity:\n                    sid = SecurityIdentifier.GenerateEquity(ticker, market);\n                    break;\n\n                case SecurityType.Forex:\n                    sid = SecurityIdentifier.GenerateForex(ticker, market);\n                    break;\n\n                case SecurityType.Cfd:\n                    sid = SecurityIdentifier.GenerateCfd(ticker, market);\n                    break;\n\n                case SecurityType.Index:\n                    sid = SecurityIdentifier.GenerateIndex(ticker, market);\n                    break;\n\n                case SecurityType.Option:\n                    return CreateOption(ticker, market, default, default, default, SecurityIdentifier.DefaultDate);\n\n                case SecurityType.Future:\n                    sid = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, ticker, market);\n                    break;\n\n                case SecurityType.Crypto:\n                    sid = SecurityIdentifier.GenerateCrypto(ticker, market);\n                    break;\n\n                case SecurityType.CryptoFuture:\n                    sid = SecurityIdentifier.GenerateCryptoFuture(SecurityIdentifier.DefaultDate, ticker, market);\n                    break;\n\n                case SecurityType.IndexOption:\n                    return CreateOption(\n                        Create(ticker, SecurityType.Index, market),\n                        market,\n                        OptionStyle.European,\n                        default,\n                        default,\n                        SecurityIdentifier.DefaultDate);\n\n                case SecurityType.FutureOption:\n                    throw new NotImplementedException(Messages.Symbol.InsufficientInformationToCreateFutureOptionSymbol);\n\n                case SecurityType.Commodity:\n                default:\n                    throw new NotImplementedException(Messages.Symbol.SecurityTypeNotImplementedYet(securityType));\n            }\n\n            return new Symbol(sid, alias ?? ticker);\n        }\n\n        /// <summary>\n        /// Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol\n        /// using the first ticker and the first traded date from the provided underlying Symbol. This avoids\n        /// the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today.\n        /// See <see cref=\"SecurityIdentifier\"/>'s private method GetFirstTickerAndDate.\n        /// The provided symbol is also set to <see cref=\"Symbol.Underlying\"/> so that it can be accessed using the custom data Symbol.\n        /// This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data\n        /// and place trades on the underlying asset based on the filtered custom data.\n        /// </summary>\n        /// <param name=\"baseType\">Type of BaseData instance</param>\n        /// <param name=\"underlying\">Underlying symbol to set for the Base Symbol</param>\n        /// <param name=\"market\">Market</param>\n        /// <returns>New non-mapped Base Symbol that contains an Underlying Symbol</returns>\n        public static Symbol CreateBase(PyObject baseType, Symbol underlying, string market = null)\n        {\n            return CreateBase(baseType.CreateType(), underlying, market);\n        }\n\n        /// <summary>\n        /// Creates a new Symbol for custom data. This method allows for the creation of a new Base Symbol\n        /// using the first ticker and the first traded date from the provided underlying Symbol. This avoids\n        /// the issue for mappable types, where the ticker is remapped supposing the provided ticker value is from today.\n        /// See <see cref=\"SecurityIdentifier\"/>'s private method GetFirstTickerAndDate.\n        /// The provided symbol is also set to <see cref=\"Symbol.Underlying\"/> so that it can be accessed using the custom data Symbol.\n        /// This is useful for associating custom data Symbols to other asset classes so that it is possible to filter using custom data\n        /// and place trades on the underlying asset based on the filtered custom data.\n        /// </summary>\n        /// <param name=\"baseType\">Type of BaseData instance</param>\n        /// <param name=\"underlying\">Underlying symbol to set for the Base Symbol</param>\n        /// <param name=\"market\">Market</param>\n        /// <returns>New non-mapped Base Symbol that contains an Underlying Symbol</returns>\n        public static Symbol CreateBase(Type baseType, Symbol underlying, string market = null)\n        {\n            // The SID Date is only defined for the following security types: base, equity, future, option.\n            // Default to SecurityIdentifier.DefaultDate if there's no matching SecurityType\n            var firstDate = underlying.SecurityType == SecurityType.Equity ||\n                underlying.SecurityType.IsOption() ||\n                underlying.SecurityType == SecurityType.Future ||\n                underlying.SecurityType == SecurityType.Base\n                    ? underlying.ID.Date\n                    : (DateTime?)null;\n\n            var sid = SecurityIdentifier.GenerateBase(baseType, underlying.ID.Symbol, market ?? Market.USA, mapSymbol: false, date: firstDate);\n            return new Symbol(sid, underlying.Value, underlying);\n        }\n\n        /// <summary>\n        /// Provides a convenience method for creating an option Symbol.\n        /// </summary>\n        /// <param name=\"underlying\">The underlying ticker</param>\n        /// <param name=\"market\">The market the underlying resides in</param>\n        /// <param name=\"style\">The option style (American, European, ect..)</param>\n        /// <param name=\"right\">The option right (Put/Call)</param>\n        /// <param name=\"strike\">The option strike price</param>\n        /// <param name=\"expiry\">The option expiry date</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from different markets</param>\n        /// <param name=\"mapSymbol\">Specifies if symbol should be mapped using map file provider</param>\n        /// <returns>A new Symbol object for the specified option contract</returns>\n        public static Symbol CreateOption(string underlying, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias = null, bool mapSymbol = true)\n        {\n            var underlyingSid = SecurityIdentifier.GenerateEquity(underlying, market, mapSymbol);\n            var underlyingSymbol = new Symbol(underlyingSid, underlying);\n\n            return CreateOption(underlyingSymbol, market, style, right, strike, expiry, alias);\n        }\n\n        /// <summary>\n        /// Provides a convenience method for creating an option Symbol using SecurityIdentifier.\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">The underlying security symbol</param>\n        /// <param name=\"market\">The market the underlying resides in</param>\n        /// <param name=\"style\">The option style (American, European, ect..)</param>\n        /// <param name=\"right\">The option right (Put/Call)</param>\n        /// <param name=\"strike\">The option strike price</param>\n        /// <param name=\"expiry\">The option expiry date</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from diferent markets</param>\n        /// <returns>A new Symbol object for the specified option contract</returns>\n        public static Symbol CreateOption(Symbol underlyingSymbol, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias = null)\n        {\n            return CreateOption(underlyingSymbol, null, market, style, right, strike, expiry, alias);\n        }\n\n        /// <summary>\n        /// Provides a convenience method for creating an option Symbol using SecurityIdentifier.\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">The underlying security symbol</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"market\">The market the underlying resides in</param>\n        /// <param name=\"style\">The option style (American, European, ect..)</param>\n        /// <param name=\"right\">The option right (Put/Call)</param>\n        /// <param name=\"strike\">The option strike price</param>\n        /// <param name=\"expiry\">The option expiry date</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from diferent markets</param>\n        /// <returns>A new Symbol object for the specified option contract</returns>\n        public static Symbol CreateOption(Symbol underlyingSymbol, string targetOption, string market, OptionStyle style, OptionRight right, decimal strike, DateTime expiry, string alias = null)\n        {\n            var sid = SecurityIdentifier.GenerateOption(expiry, underlyingSymbol.ID, targetOption, market, strike, right, style);\n\n            return new Symbol(sid, alias ?? GetAlias(sid, underlyingSymbol), underlyingSymbol);\n        }\n\n        /// <summary>\n        /// Provides a convenience method for creating an option Symbol from its SecurityIdentifier and alias.\n        /// </summary>\n        /// <param name=\"sid\">The option SID</param>\n        /// <param name=\"value\">The alias</param>\n        /// <param name=\"underlying\">Optional underlying symbol to use. If null, it will we created from the given option SID and value</param>\n        /// <returns>A new Symbol object for the specified option</returns>\n        public static Symbol CreateOption(SecurityIdentifier sid, string value, Symbol underlying = null)\n        {\n            if (value == null)\n            {\n                throw new ArgumentNullException(nameof(value));\n            }\n\n            if (!sid.SecurityType.IsOption())\n            {\n                throw new ArgumentException(Messages.Symbol.SidNotForOption(sid), nameof(value));\n            }\n\n            if (IsCanonical(sid))\n            {\n                return new Symbol(sid, value);\n            }\n\n            if (underlying == null)\n            {\n                SymbolRepresentation.TryDecomposeOptionTickerOSI(value, sid.SecurityType,\n                    out var _, out var underlyingValue, out var _, out var _, out var _);\n                underlying = new Symbol(sid.Underlying, underlyingValue);\n            }\n            else if (underlying.ID != sid.Underlying)\n            {\n                throw new ArgumentException(Messages.Symbol.UnderlyingSidDoesNotMatch(sid, underlying), nameof(underlying));\n            }\n\n            return new Symbol(sid, value, underlying);\n        }\n\n        /// <summary>\n        /// Simple method to create the canonical option symbol for any given underlying symbol\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">Underlying of this option</param>\n        /// <param name=\"market\">Market for this option</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from different markets</param>\n        /// <returns>New Canonical Option</returns>\n        public static Symbol CreateCanonicalOption(Symbol underlyingSymbol, string market = null, string alias = null)\n        {\n            return CreateCanonicalOption(underlyingSymbol, null, market, alias);\n        }\n\n        /// <summary>\n        /// Simple method to create the canonical option symbol for any given underlying symbol\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">Underlying of this option</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"market\">Market for this option</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from different markets</param>\n        /// <returns>New Canonical Option</returns>\n        public static Symbol CreateCanonicalOption(Symbol underlyingSymbol, string targetOption, string market = null, string alias = null)\n        {\n            var optionType = GetOptionTypeFromUnderlying(underlyingSymbol);\n            market ??= underlyingSymbol.ID.Market;\n\n            return CreateOption(underlyingSymbol,\n                targetOption,\n                market,\n                optionType.DefaultOptionStyle(),\n                default,\n                default,\n                SecurityIdentifier.DefaultDate,\n                alias);\n        }\n\n\n        /// <summary>\n        /// Provides a convenience method for creating a future Symbol.\n        /// </summary>\n        /// <param name=\"ticker\">The ticker</param>\n        /// <param name=\"market\">The market the future resides in</param>\n        /// <param name=\"expiry\">The future expiry date</param>\n        /// <param name=\"alias\">An alias to be used for the symbol cache. Required when\n        /// adding the same security from different markets</param>\n        /// <returns>A new Symbol object for the specified future contract</returns>\n        public static Symbol CreateFuture(string ticker, string market, DateTime expiry, string alias = null)\n        {\n            var sid = SecurityIdentifier.GenerateFuture(expiry, ticker, market);\n\n            return new Symbol(sid, alias ?? GetAlias(sid));\n        }\n\n        /// <summary>\n        /// Method returns true, if symbol is a derivative canonical symbol\n        /// </summary>\n        /// <returns>true, if symbol is a derivative canonical symbol</returns>\n        public bool IsCanonical()\n        {\n            return IsCanonical(ID);\n        }\n\n        /// <summary>\n        /// Get's the canonical representation of this symbol\n        /// </summary>\n        /// <remarks>This is useful for access and performance</remarks>\n        public Symbol Canonical\n        {\n            get\n            {\n                if (_canonical != null)\n                {\n                    return _canonical;\n                }\n\n                _canonical = this;\n                if (!IsCanonical())\n                {\n                    if (SecurityType.IsOption())\n                    {\n                        _canonical = CreateCanonicalOption(Underlying, ID.Symbol, ID.Market, null);\n                    }\n                    else if (SecurityType == SecurityType.Future)\n                    {\n                        _canonical = Create(ID.Symbol, SecurityType.Future, ID.Market);\n                    }\n                    else\n                    {\n                        throw new InvalidOperationException(Messages.Symbol.CanonicalNotDefined);\n                    }\n                }\n                return _canonical;\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the symbol has a canonical representation\n        /// </summary>\n        public bool HasCanonical()\n        {\n            return !IsCanonical() && (SecurityType.IsOption() || SecurityType == SecurityType.Future);\n        }\n\n        /// <summary>\n        /// Determines if the specified <paramref name=\"symbol\"/> is an underlying of this symbol instance\n        /// </summary>\n        /// <param name=\"symbol\">The underlying to check for</param>\n        /// <returns>True if the specified <paramref name=\"symbol\"/> is an underlying of this symbol instance</returns>\n        public bool HasUnderlyingSymbol(Symbol symbol)\n        {\n            var current = this;\n            while (current.HasUnderlying)\n            {\n                if (current.Underlying == symbol)\n                {\n                    return true;\n                }\n\n                current = current.Underlying;\n            }\n\n            return false;\n        }\n\n        #region Properties\n\n        /// <summary>\n        /// Gets the current symbol for this ticker\n        /// </summary>\n        [ProtoMember(1)]\n        public string Value { get; private set; }\n\n        /// <summary>\n        /// Gets the security identifier for this symbol\n        /// </summary>\n        [ProtoMember(2)]\n        public SecurityIdentifier ID { get; private set; }\n\n        /// <summary>\n        /// Gets whether or not this <see cref=\"Symbol\"/> is a derivative,\n        /// that is, it has a valid <see cref=\"Underlying\"/> property\n        /// </summary>\n        public bool HasUnderlying\n        {\n            get { return !ReferenceEquals(Underlying, null); }\n        }\n\n        /// <summary>\n        /// Gets the security underlying symbol, if any\n        /// </summary>\n        [ProtoMember(3)]\n        public Symbol Underlying { get; private set; }\n\n\n        /// <summary>\n        /// Gets the security type of the symbol\n        /// </summary>\n        public SecurityType SecurityType\n        {\n            get { return ID.SecurityType; }\n        }\n\n        /// <summary>\n        /// The Committee on Uniform Securities Identification Procedures (CUSIP) number corresponding to this <see cref=\"Symbol\"/>\n        /// </summary>\n        public string CUSIP { get { return _securityDefinitionSymbolResolver.Value.CUSIP(this); } }\n\n        /// <summary>\n        /// The composite Financial Instrument Global Identifier (FIGI) corresponding to this <see cref=\"Symbol\"/>\n        /// </summary>\n        public string CompositeFIGI { get { return _securityDefinitionSymbolResolver.Value.CompositeFIGI(this); } }\n\n        /// <summary>\n        /// The Stock Exchange Daily Official List (SEDOL) security identifier corresponding to this <see cref=\"Symbol\"/>\n        /// </summary>\n        public string SEDOL { get { return _securityDefinitionSymbolResolver.Value.SEDOL(this); } }\n\n        /// <summary>\n        /// The International Securities Identification Number (ISIN) corresponding to this <see cref=\"Symbol\"/>\n        /// </summary>\n        public string ISIN { get { return _securityDefinitionSymbolResolver.Value.ISIN(this); } }\n\n        /// <summary>\n        /// The Central Index Key number (CIK) corresponding to this <see cref=\"Symbol\"/>\n        /// </summary>\n        public int? CIK { get { return _securityDefinitionSymbolResolver.Value.CIK(this); } }\n\n        #endregion\n\n        #region Constructors\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Symbol\"/> class\n        /// </summary>\n        /// <param name=\"sid\">The security identifier for this symbol</param>\n        /// <param name=\"value\">The current ticker symbol value</param>\n        public Symbol(SecurityIdentifier sid, string value)\n        {\n            if (value == null)\n            {\n                throw new ArgumentNullException(nameof(value));\n            }\n            ID = sid;\n            if (ID.HasUnderlying)\n            {\n                Underlying = new Symbol(ID.Underlying, ID.Underlying.Symbol);\n            }\n\n            Value = GetAlias(sid, Underlying) ?? value.LazyToUpper();\n        }\n\n        /// <summary>\n        /// Creates new symbol with updated mapped symbol. Symbol Mapping: When symbols change over time (e.g. CHASE-> JPM) need to update the symbol requested.\n        /// Method returns newly created symbol\n        /// </summary>\n        public Symbol UpdateMappedSymbol(string mappedSymbol, uint contractDepthOffset = 0)\n        {\n            // Throw for any option SecurityType that is not for equities, we don't support mapping for them (FOPs and Index Options)\n            if (ID.SecurityType.IsOption() && SecurityType != SecurityType.Option)\n            {\n                throw new ArgumentException(Messages.Symbol.SecurityTypeCannotBeMapped(ID.SecurityType));\n            }\n\n            if(ID.SecurityType == SecurityType.Future)\n            {\n                if (mappedSymbol == Value)\n                {\n                    // futures with no real continuous mapping\n                    return this;\n                }\n                var id = SecurityIdentifier.Parse(mappedSymbol);\n                var underlying = new Symbol(id, mappedSymbol);\n                underlying = underlying.AdjustSymbolByOffset(contractDepthOffset);\n\n                // we map the underlying\n                return new Symbol(ID, underlying.Value, underlying);\n            }\n\n            // Avoid updating the current instance's underlying Symbol.\n            var underlyingSymbol = Underlying;\n\n            // Some universe Symbols, such as Constituent ETF universe Symbols and mapped custom data Symbols, have an\n            // underlying equity ETF Symbol as their underlying. When we're checking to see if a specific BaseData\n            // instance requires mapping, only the parent Symbol will be updated, which might not even need to be mapped\n            // (e.g. universe symbols with no equity ticker in symbol value).\n            // This will ensure that we map all of the underlying Symbol(s) that also require mapping updates.\n            if (HasUnderlying)\n            {\n                underlyingSymbol = Underlying.UpdateMappedSymbol(mappedSymbol, contractDepthOffset);\n            }\n\n            // If this Symbol is not a custom data type, and the security type does not support mapping,\n            // then we know for a fact that this Symbol should not be mapped.\n            // Custom data types should be mapped, especially if this method is called on them because\n            // they can have an underlying that is also mapped.\n            if (SecurityType != SecurityType.Base && !this.RequiresMapping())\n            {\n                return new Symbol(ID, Value, underlyingSymbol);\n            }\n\n            if (SecurityType == SecurityType.Option)\n            {\n                mappedSymbol = !IsCanonical()\n                    ? SymbolRepresentation.GenerateOptionTickerOSI(mappedSymbol, ID.OptionRight, ID.StrikePrice, ID.Date)\n                    : Value;\n            }\n\n            return new Symbol(ID, mappedSymbol, underlyingSymbol);\n        }\n\n        /// <summary>\n        /// Determines the SecurityType based on the underlying Symbol's SecurityType\n        /// </summary>\n        /// <param name=\"underlyingSymbol\">Underlying Symbol of an option</param>\n        /// <returns>SecurityType of the option</returns>\n        /// <exception cref=\"ArgumentException\">The provided underlying has no SecurityType able to represent it as an option</exception>\n        public static SecurityType GetOptionTypeFromUnderlying(Symbol underlyingSymbol)\n        {\n            return GetOptionTypeFromUnderlying(underlyingSymbol.SecurityType);\n        }\n\n        /// <summary>\n        /// Determines the SecurityType based on the underlying Symbol's SecurityType  <see cref=\"GetUnderlyingFromOptionType(SecurityType)\"/>\n        /// </summary>\n        /// <param name=\"securityType\">SecurityType of the underlying Symbol</param>\n        /// <returns>SecurityType of the option</returns>\n        /// <exception cref=\"ArgumentException\">The provided underlying has no SecurityType able to represent it as an option</exception>\n        public static SecurityType GetOptionTypeFromUnderlying(SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    return SecurityType.Option;\n                case SecurityType.Future:\n                    return SecurityType.FutureOption;\n                case SecurityType.Index:\n                    return SecurityType.IndexOption;\n                default:\n                    throw new ArgumentException(Messages.Symbol.NoOptionTypeForUnderlying(securityType));\n            }\n        }\n\n        /// <summary>\n        /// Determines the underlying SecurityType based on the option Symbol's SecurityType <see cref=\"GetOptionTypeFromUnderlying(SecurityType)\"/>\n        /// </summary>\n        /// <param name=\"securityType\">SecurityType of the option Symbol</param>\n        /// <returns>SecurityType of the underlying</returns>\n        /// <exception cref=\"ArgumentException\">The provided option has no SecurityType able to represent it as an underlying</exception>\n        public static SecurityType GetUnderlyingFromOptionType(SecurityType securityType)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Option:\n                    return SecurityType.Equity;\n                case SecurityType.FutureOption:\n                    return SecurityType.Future;\n                case SecurityType.IndexOption:\n                    return SecurityType.Index;\n                default:\n                    throw new ArgumentException(Messages.Symbol.NoUnderlyingForOption(securityType));\n            }\n        }\n\n        /// <summary>\n        /// Private constructor initializes a new instance of the <see cref=\"Symbol\"/> class with underlying\n        /// </summary>\n        /// <param name=\"sid\">The security identifier for this symbol</param>\n        /// <param name=\"value\">The current ticker symbol value</param>\n        /// <param name=\"underlying\">The underlying symbol</param>\n        internal Symbol(SecurityIdentifier sid, string value, Symbol underlying)\n        {\n            if (value == null)\n            {\n                throw new ArgumentNullException(nameof(value));\n            }\n            ID = sid;\n            Value = value.LazyToUpper();\n            Underlying = underlying;\n        }\n\n        #endregion\n\n        #region Overrides of Object\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param><filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n\n            // compare strings just as you would a symbol object\n            if (obj is string stringSymbol)\n            {\n                return Equals((Symbol)stringSymbol);\n            }\n\n            // compare a sid just as you would a symbol object\n            if (obj is SecurityIdentifier sid)\n            {\n                return ID.Equals(sid);\n            }\n\n            if (obj.GetType() != GetType()) return false;\n            return Equals((Symbol)obj);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            // only SID is used for comparisons\n            unchecked { return ID.GetHashCode(); }\n        }\n\n        /// <summary>\n        /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.\n        /// </summary>\n        /// <returns>\n        /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name=\"obj\"/> in the sort order. Zero This instance occurs in the same position in the sort order as <paramref name=\"obj\"/>. Greater than zero This instance follows <paramref name=\"obj\"/> in the sort order.\n        /// </returns>\n        /// <param name=\"obj\">An object to compare with this instance. </param><exception cref=\"T:System.ArgumentException\"><paramref name=\"obj\"/> is not the same type as this instance. </exception><filterpriority>2</filterpriority>\n        public int CompareTo(object obj)\n        {\n            var str = obj as string;\n            if (str != null)\n            {\n                return string.Compare(Value, str, StringComparison.OrdinalIgnoreCase);\n            }\n            var sym = obj as Symbol;\n            if (sym != null)\n            {\n                return string.Compare(Value, sym.Value, StringComparison.OrdinalIgnoreCase);\n            }\n\n            throw new ArgumentException(Messages.Symbol.UnexpectedObjectTypeToCompareTo);\n        }\n\n        /// <summary>\n        /// Returns a string that represents the current object.\n        /// </summary>\n        /// <returns>\n        /// A string that represents the current object.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return SymbolCache.GetTicker(this);\n        }\n\n        #endregion\n\n        #region Equality members\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(Symbol other)\n        {\n            if (ReferenceEquals(this, other)) return true;\n\n            if (ReferenceEquals(other, null)\n                || ReferenceEquals(other, Empty))\n            {\n                // other is null or empty (equivalents)\n                // so we need to know how We compare with Empty\n                if (!_isEmpty.HasValue)\n                {\n                    // for accuracy we compare IDs not references here\n                    _isEmpty = ID.Equals(Empty.ID);\n                }\n                return _isEmpty.Value;\n            }\n\n            // only SID is used for comparisons\n            return ID.Equals(other.ID);\n        }\n\n        /// <summary>\n        /// Equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are equal, otherwise false</returns>\n        public static bool operator ==(Symbol left, Symbol right)\n        {\n            if (ReferenceEquals(left, right))\n            {\n                // this is a performance shortcut\n                return true;\n            }\n\n            if (left is null)\n            {\n                // Rely on the Equals method if possible\n                return right is null || right.Equals(left);\n            }\n\n            return left.Equals(right);\n        }\n\n        /// <summary>\n        /// Equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are equal, otherwise false</returns>\n        /// <remarks>This is necessary in cases like Pythonnet passing a string\n        /// as an object instead of using the implicit conversion</remarks>\n        public static bool operator ==(Symbol left, object right)\n        {\n            if (ReferenceEquals(left, right))\n            {\n                // this is a performance shortcut\n                return true;\n            }\n\n            if (left is null)\n            {\n                // Rely on the Equals method if possible\n                return right is null || right.Equals(left);\n            }\n\n            return left.Equals(right);\n        }\n\n        /// <summary>\n        /// Equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are equal, otherwise false</returns>\n        /// <remarks>This is necessary in cases like Pythonnet passing a string\n        /// as an object instead of using the implicit conversion</remarks>\n        public static bool operator ==(object left, Symbol right)\n        {\n            if (ReferenceEquals(left, right))\n            {\n                // this is a performance shortcut\n                return true;\n            }\n\n            if (left is null)\n            {\n                return right is null;\n            }\n\n            if (left is Symbol leftSymbol)\n            {\n                return leftSymbol.Equals(right);\n            }\n\n            if (left is string leftStr)\n            {\n                return leftStr.Equals(right?.ToString(), StringComparison.InvariantCulture);\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Not equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are not equal, otherwise false</returns>\n        public static bool operator !=(Symbol left, Symbol right)\n        {\n            return !(left == right);\n        }\n\n        /// <summary>\n        /// Not equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are not equal, otherwise false</returns>\n        public static bool operator !=(Symbol left, object right)\n        {\n            return !(left == right);\n        }\n\n        /// <summary>\n        /// Not equals operator\n        /// </summary>\n        /// <param name=\"left\">The left operand</param>\n        /// <param name=\"right\">The right operand</param>\n        /// <returns>True if both symbols are not equal, otherwise false</returns>\n        public static bool operator !=(object left, Symbol right)\n        {\n            return !(left == right);\n        }\n\n        #endregion\n\n        #region Implicit operators\n\n        /// <summary>\n        /// Returns the symbol's string ticker\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <returns>The string ticker</returns>\n        [Obsolete(\"Symbol implicit operator to string is provided for algorithm use only.\")]\n        public static implicit operator string(Symbol symbol)\n        {\n            return symbol.ToString();\n        }\n\n        /// <summary>\n        /// Creates symbol using string as sid\n        /// </summary>\n        /// <param name=\"ticker\">The string</param>\n        /// <returns>The symbol</returns>\n        [Obsolete(\"Symbol implicit operator from string is provided for algorithm use only.\")]\n        public static implicit operator Symbol(string ticker)\n        {\n            Symbol symbol;\n            if (SymbolCache.TryGetSymbol(ticker, out symbol))\n            {\n                return symbol;\n            }\n\n            return new Symbol(new SecurityIdentifier(ticker, 0), ticker);\n        }\n\n        #endregion\n\n        #region String methods\n\n        // in order to maintain better compile time backwards compatibility,\n        // we'll redirect a few common string methods to Value, but mark obsolete\n#pragma warning disable 1591\n        [Obsolete(\"Symbol.Contains is a pass-through for Symbol.Value.Contains\")]\n        public bool Contains(string value) { return Value.Contains(value); }\n        [Obsolete(\"Symbol.EndsWith is a pass-through for Symbol.Value.EndsWith\")]\n        public bool EndsWith(string value) { return Value.EndsWithInvariant(value); }\n        [Obsolete(\"Symbol.StartsWith is a pass-through for Symbol.Value.StartsWith\")]\n        public bool StartsWith(string value) { return Value.StartsWithInvariant(value); }\n        [Obsolete(\"Symbol.ToLower is a pass-through for Symbol.Value.ToLower\")]\n        public string ToLower() { return Value.ToLowerInvariant(); }\n        [Obsolete(\"Symbol.ToUpper is a pass-through for Symbol.Value.ToUpper\")]\n        public string ToUpper() { return Value.LazyToUpper(); }\n#pragma warning restore 1591\n\n        #endregion\n\n        /// <summary>\n        /// Centralized helper method to resolve alias for a symbol\n        /// </summary>\n        public static string GetAlias(SecurityIdentifier securityIdentifier, Symbol underlying = null)\n        {\n            string sym;\n            switch (securityIdentifier.SecurityType)\n            {\n                case SecurityType.FutureOption:\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    sym = underlying.Value;\n                    if (securityIdentifier.Symbol != underlying.ID.Symbol)\n                    {\n                        // If we have changed the SID and it does not match the underlying,\n                        // we've mapped a future into another Symbol. We want to have a value\n                        // representing the mapped ticker, not of the underlying.\n                        // e.g. we want:\n                        //     OG  C3200...|GC18Z20\n                        // NOT\n                        //     GC  C3200...|GC18Z20\n                        sym = securityIdentifier.Symbol;\n                    }\n\n                    if (securityIdentifier.Date == SecurityIdentifier.DefaultDate)\n                    {\n                        return $\"?{sym.LazyToUpper()}\";\n                    }\n\n                    if (sym.Length > 5) sym += \" \";\n\n                    return SymbolRepresentation.GenerateOptionTickerOSI(sym, securityIdentifier.OptionRight, securityIdentifier.StrikePrice, securityIdentifier.Date);\n                case SecurityType.Future:\n                    sym = securityIdentifier.Symbol;\n                    if (securityIdentifier.Date == SecurityIdentifier.DefaultDate)\n                    {\n                        return $\"/{sym}\";\n                    }\n                    return SymbolRepresentation.GenerateFutureTicker(sym, securityIdentifier.Date);\n                default:\n                    return null;\n            }\n        }\n\n        private static bool IsCanonical(SecurityIdentifier sid)\n        {\n            return\n                (sid.SecurityType == SecurityType.Future ||\n                (sid.SecurityType.IsOption() && sid.HasUnderlying)) &&\n                sid.Date == SecurityIdentifier.DefaultDate;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SymbolCache.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides a string->Symbol mapping to allow for user defined strings to be lifted into a Symbol\n    /// This is mainly used via the Symbol implicit operator, but also functions that create securities\n    /// should also call Set to add new mappings\n    /// </summary>\n    public static class SymbolCache\n    {\n        // we aggregate the two maps into a class so we can assign a new one as an atomic operation\n        private static readonly Dictionary<string, Symbol> Symbols = new(StringComparer.OrdinalIgnoreCase);\n        private static readonly Dictionary<Symbol, string> Tickers = new();\n\n        /// <summary>\n        /// Adds a mapping for the specified ticker\n        /// </summary>\n        /// <param name=\"ticker\">The string ticker symbol</param>\n        /// <param name=\"symbol\">The symbol object that maps to the string ticker symbol</param>\n        public static void Set(string ticker, Symbol symbol)\n        {\n            lock (Symbols)\n            {\n                Symbols[ticker] = symbol;\n                Tickers[symbol] = ticker;\n\n                var index = ticker.IndexOf('.');\n                if (index != -1)\n                {\n                    var related = ticker.Substring(0, index);\n                    if (Symbols.TryGetValue(related, out symbol) && symbol is null)\n                    {\n                        Symbols.Remove(related);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the Symbol object that is mapped to the specified string ticker symbol\n        /// </summary>\n        /// <param name=\"ticker\">The string ticker symbol</param>\n        /// <returns>The symbol object that maps to the specified string ticker symbol</returns>\n        public static Symbol GetSymbol(string ticker)\n        {\n            var result = TryGetSymbol(ticker);\n            if (!result.Item1)\n            {\n                throw result.Item3 ?? throw new InvalidOperationException(Messages.SymbolCache.UnableToLocateTicker(ticker));\n            }\n            return result.Item2;\n        }\n\n        /// <summary>\n        /// Gets the Symbol object that is mapped to the specified string ticker symbol\n        /// </summary>\n        /// <param name=\"ticker\">The string ticker symbol</param>\n        /// <param name=\"symbol\">The output symbol object</param>\n        /// <returns>The symbol object that maps to the specified string ticker symbol</returns>\n        public static bool TryGetSymbol(string ticker, out Symbol symbol)\n        {\n            var result = TryGetSymbol(ticker);\n            symbol = result.Item2;\n            return result.Item1;\n        }\n\n        /// <summary>\n        /// Gets the string ticker symbol that is mapped to the specified Symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol object</param>\n        /// <returns>The string ticker symbol that maps to the specified symbol object</returns>\n        public static string GetTicker(Symbol symbol)\n        {\n            lock (Symbols)\n            {\n                return Tickers.TryGetValue(symbol, out var ticker) ? ticker : symbol.ID.ToString();\n            }\n        }\n\n        /// <summary>\n        /// Gets the string ticker symbol that is mapped to the specified Symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol object</param>\n        /// <param name=\"ticker\">The output string ticker symbol</param>\n        /// <returns>The string ticker symbol that maps to the specified symbol object</returns>\n        public static bool TryGetTicker(Symbol symbol, out string ticker)\n        {\n            lock (Symbols)\n            {\n                return Tickers.TryGetValue(symbol, out ticker);\n            }\n        }\n\n        /// <summary>\n        /// Removes the mapping for the specified symbol from the cache\n        /// </summary>\n        /// <param name=\"symbol\">The symbol whose mappings are to be removed</param>\n        /// <returns>True if the symbol mapping were removed from the cache</returns>\n        /// <remarks>Just used for testing</remarks>\n        public static bool TryRemove(Symbol symbol)\n        {\n            lock (Symbols)\n            {\n                return Tickers.Remove(symbol, out var ticker) && Symbols.Remove(ticker, out symbol);\n            }\n        }\n\n        /// <summary>\n        /// Removes the mapping for the specified symbol from the cache\n        /// </summary>\n        /// <param name=\"ticker\">The ticker whose mappings are to be removed</param>\n        /// <returns>True if the symbol mapping were removed from the cache</returns>\n        /// <remarks>Just used for testing</remarks>\n        public static bool TryRemove(string ticker)\n        {\n            lock (Symbols)\n            {\n                return Symbols.Remove(ticker, out var symbol) && Tickers.Remove(symbol, out ticker);\n            }\n        }\n\n        /// <summary>\n        /// Clears the current caches\n        /// </summary>\n        /// <remarks>Just used for testing</remarks>\n        public static void Clear()\n        {\n            lock (Symbols)\n            {\n                Symbols.Clear();\n                Tickers.Clear();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static Tuple<bool, Symbol, InvalidOperationException> TryGetSymbol(string ticker)\n        {\n            lock (Symbols)\n            {\n                if (!TryGetSymbolCached(ticker, out var symbol))\n                {\n                    // fall-back full-text search as a back-shim for custom data symbols.\n                    // permitting a user to use BTC to resolve to BTC.Bitcoin\n                    var search = $\"{ticker}.\";\n                    var match = Symbols.Where(kvp => kvp.Key.StartsWith(search, StringComparison.InvariantCultureIgnoreCase) && kvp.Value is not null).ToList();\n\n                    if (match.Count == 0)\n                    {\n                        // no matches, cache the miss! else it will get expensive\n                        Symbols[ticker] = null;\n                        return new(false, null, null);\n                    }\n                    else if (match.Count == 1)\n                    {\n                        // exactly one match\n                        Symbols[ticker] = match[0].Value;\n                        return new(true, match[0].Value, null);\n                    }\n                    else if (match.Count > 1)\n                    {\n                        // too many matches\n                        return new(false, null, new InvalidOperationException(\n                            Messages.SymbolCache.MultipleMatchingTickersLocated(match.Select(kvp => kvp.Key))));\n                    }\n                }\n                return new(symbol is not null, symbol, null);\n            }\n        }\n\n        /// <summary>\n        /// Attempts to resolve the ticker to a Symbol via the cache. If not found in the\n        /// cache then\n        /// </summary>\n        /// <param name=\"ticker\">The ticker to resolver to a symbol</param>\n        /// <param name=\"symbol\">The resolves symbol</param>\n        /// <returns>True if we successfully resolved a symbol, false otherwise</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static bool TryGetSymbolCached(string ticker, out Symbol symbol)\n        {\n            if (Symbols.TryGetValue(ticker, out symbol))\n            {\n                return true;\n            }\n            if (SecurityIdentifier.TryParse(ticker, out var sid))\n            {\n                symbol = new Symbol(sid, sid.Symbol);\n                return true;\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SymbolCapacity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Per-symbol capacity estimations, tightly coupled with the <see cref=\"CapacityEstimate\"/> class.\n    /// </summary>\n    internal class SymbolCapacity\n    {\n        /// <summary>\n        /// The period for which a symbol trade influentiates capacity estimate\n        /// </summary>\n        public static TimeSpan CapacityEffectPeriod = TimeSpan.FromDays(30);\n\n        /// <summary>\n        /// An estimate of how much volume the FX market trades per minute\n        /// </summary>\n        /// <remarks>\n        /// Any mentions of \"dollar volume\" are in account currency. They are not always in dollars.\n        /// </remarks>\n        private const decimal _forexMinuteVolume = 25000000m;\n\n        /// <summary>\n        /// An estimate of how much volume the CFD market trades per minute\n        /// </summary>\n        /// <remarks>\n        /// This is pure estimation since we don't have CFD volume data. Based on 300k per day.\n        /// </remarks>\n        private const decimal _cfdMinuteVolume = 200m;\n        private const decimal _fastTradingVolumeScalingFactor = 2m;\n\n        private readonly IAlgorithm _algorithm;\n        private readonly Symbol _symbol;\n\n        private decimal _previousVolume;\n        private DateTime? _previousTime;\n\n        private bool _isInternal;\n        private decimal _averageDollarVolume;\n        private decimal _resolutionScaleFactor;\n        private decimal _marketCapacityDollarVolume;\n        private bool _resetMarketCapacityDollarVolume;\n        private decimal _fastTradingVolumeDiscountFactor;\n        private OrderEvent _previousOrderEvent;\n\n        /// <summary>\n        /// Total trades made in between snapshots\n        /// </summary>\n        public int Trades { get; private set; }\n\n        /// <summary>\n        /// The Symbol's Security\n        /// </summary>\n        public Security Security { get; }\n\n        /// <summary>\n        /// The absolute dollar volume (in account currency) we've traded\n        /// </summary>\n        public decimal SaleVolume { get; private set; }\n\n        /// <summary>\n        /// Market capacity dollar volume, i.e. the capacity the market is able to provide for this Symbol\n        /// </summary>\n        /// <remarks>\n        /// Dollar volume is in account currency, but name is used for consistency with financial literature.\n        /// </remarks>\n        public decimal MarketCapacityDollarVolume => _marketCapacityDollarVolume * _resolutionScaleFactor;\n\n        /// <summary>\n        /// Creates a new SymbolCapacity object, capable of determining market capacity for a Symbol\n        /// </summary>\n        /// <param name=\"algorithm\"></param>\n        /// <param name=\"symbol\"></param>\n        public SymbolCapacity(IAlgorithm algorithm, Symbol symbol)\n        {\n            _algorithm = algorithm;\n            Security = _algorithm.Securities[symbol];\n            _symbol = symbol;\n\n            _isInternal = _algorithm\n                .SubscriptionManager\n                .SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(symbol, includeInternalConfigs: true)\n                .All(config => config.IsInternalFeed);\n        }\n\n        /// <summary>\n        /// New order event handler. Handles the aggregation of SaleVolume and\n        /// sometimes resetting the <seealso cref=\"MarketCapacityDollarVolume\"/>\n        /// </summary>\n        /// <param name=\"orderEvent\">Parent class filters out other events so only fill events reach this method.</param>\n        public void OnOrderEvent(OrderEvent orderEvent)\n        {\n            SaleVolume += Security.QuoteCurrency.ConversionRate * orderEvent.FillPrice * orderEvent.AbsoluteFillQuantity * Security.SymbolProperties.ContractMultiplier;\n\n            // To reduce the capacity of high frequency strategies, we scale down the\n            // volume captured on each bar proportional to the trades per day.\n            // Default to -1 day for the first order to not reduce the volume of the first order.\n            _fastTradingVolumeDiscountFactor = _fastTradingVolumeScalingFactor * ((decimal)((orderEvent.UtcTime - (_previousOrderEvent?.UtcTime ?? orderEvent.UtcTime.AddDays(-1))).TotalMinutes) / 390m);\n            _fastTradingVolumeDiscountFactor = _fastTradingVolumeDiscountFactor > 1 ? 1 : Math.Max(0.20m, _fastTradingVolumeDiscountFactor);\n\n            if (_resetMarketCapacityDollarVolume)\n            {\n                _marketCapacityDollarVolume = 0;\n                Trades = 0;\n                _resetMarketCapacityDollarVolume = false;\n            }\n\n            Trades++;\n            _previousOrderEvent = orderEvent;\n        }\n\n        /// <summary>\n        /// Determines whether we should add the Market Volume to the <see cref=\"MarketCapacityDollarVolume\"/>\n        /// </summary>\n        /// <returns></returns>\n        private bool IncludeMarketVolume(Resolution resolution)\n        {\n            if (_previousOrderEvent == null)\n            {\n                return false;\n            }\n\n            var dollarVolumeScaleFactor = 6000000;\n            DateTime timeout;\n            decimal k;\n\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                case Resolution.Second:\n                    dollarVolumeScaleFactor = dollarVolumeScaleFactor / 60;\n                    k = _averageDollarVolume != 0\n                        ? dollarVolumeScaleFactor / _averageDollarVolume\n                        : 10;\n\n                    var timeoutPeriod = k > 120 ? 120 : (int)Math.Max(5, (double)k);\n                    timeout = _previousOrderEvent.UtcTime.AddMinutes(timeoutPeriod);\n                    break;\n\n                case Resolution.Minute:\n                    k = _averageDollarVolume != 0\n                        ? dollarVolumeScaleFactor / _averageDollarVolume\n                        : 10;\n\n                    var timeoutMinutes = k > 120 ? 120 : (int)Math.Max(1, (double)k);\n                    timeout = _previousOrderEvent.UtcTime.AddMinutes(timeoutMinutes);\n                    break;\n\n                case Resolution.Hour:\n                    return _algorithm.UtcTime == _previousOrderEvent.UtcTime.RoundUp(resolution.ToTimeSpan());\n\n                case Resolution.Daily:\n                    // At the end of a daily bar, the EndTime is the next day.\n                    // Increment the order by one day to match it\n                    return _algorithm.UtcTime == _previousOrderEvent.UtcTime ||\n                        _algorithm.UtcTime.Date == _previousOrderEvent.UtcTime.RoundUp(resolution.ToTimeSpan());\n\n                default:\n                    timeout = _previousOrderEvent.UtcTime.AddHours(1);\n                    break;\n            }\n\n            return _algorithm.UtcTime <= timeout;\n        }\n\n        /// <summary>\n        /// Updates the market capacity of the Symbol. Called on each time step of the algorithm\n        /// </summary>\n        /// <returns>False if we're currently within the timeout period, True if the Symbol has went past the timeout</returns>\n        public bool UpdateMarketCapacity()\n        {\n            var bar = GetBar();\n            if (bar == null || bar.Volume == 0)\n            {\n                return false;\n            }\n\n            var utcTime = _algorithm.UtcTime;\n            var resolution = bar.Period.ToHigherResolutionEquivalent(false);\n            var conversionRate = Security.QuoteCurrency.ConversionRate;\n            var timeBetweenBars = (decimal)(utcTime - (_previousTime ?? utcTime)).TotalMinutes;\n\n            if (_previousTime == null || timeBetweenBars == 0)\n            {\n                _averageDollarVolume = conversionRate * bar.Close * bar.Volume;\n            }\n            else\n            {\n                _averageDollarVolume = ((bar.Close * conversionRate) * (bar.Volume + _previousVolume)) / timeBetweenBars;\n            }\n\n            _previousTime = utcTime;\n            _previousVolume = bar.Volume;\n\n            var includeMarketVolume = IncludeMarketVolume(resolution);\n            if (includeMarketVolume)\n            {\n                _resolutionScaleFactor = ResolutionScaleFactor(resolution);\n                _marketCapacityDollarVolume += bar.Close * _fastTradingVolumeDiscountFactor * bar.Volume * conversionRate * Security.SymbolProperties.ContractMultiplier;\n            }\n\n            // When we've finished including market volume, signal completed\n            return !includeMarketVolume;\n        }\n\n        /// <summary>\n        /// Gets the TradeBar for the given time step. For Quotes, we convert\n        /// it into a TradeBar using market depth as a proxy for volume.\n        /// </summary>\n        /// <returns>TradeBar</returns>\n        private TradeBar GetBar()\n        {\n            TradeBar bar;\n            if (_algorithm.CurrentSlice.Bars.TryGetValue(_symbol, out bar))\n            {\n                return bar;\n            }\n\n            QuoteBar quote;\n            if (_algorithm.CurrentSlice.QuoteBars.TryGetValue(_symbol, out quote))\n            {\n                // Fake a tradebar for quote data using market depth as a proxy for volume\n                var volume = (quote.LastBidSize + quote.LastAskSize) / 2;\n\n                // Handle volume estimation for security types that don't have volume values\n                switch (_symbol.SecurityType)\n                {\n                    case SecurityType.Forex:\n                        volume = _forexMinuteVolume;\n                        break;\n                    case SecurityType.Cfd:\n                        volume = _cfdMinuteVolume;\n                        break;\n                }\n                \n\n                return new TradeBar(\n                    quote.Time,\n                    quote.Symbol,\n                    quote.Open,\n                    quote.High,\n                    quote.Low,\n                    quote.Close,\n                    volume,\n                    quote.Period);\n            }\n\n            if (!_isInternal)\n            {\n                return null;\n            }\n            // internal subscriptions, like mapped continuous future contract won't be sent through the slice\n            // but will be available in the security cache, if not present will return null\n            var result = Security.Cache.GetData<TradeBar>();\n            if (result != null\n                && _algorithm.UtcTime == result.EndTime.ConvertToUtc(Security.Exchange.Hours.TimeZone))\n            {\n                return result;\n            }\n\n            return null;\n        }\n\n        private static decimal ResolutionScaleFactor(Resolution resolution)\n        {\n            switch (resolution)\n            {\n                case Resolution.Daily:\n                    return 0.02m;\n\n                case Resolution.Hour:\n                    return 0.05m;\n\n                case Resolution.Minute:\n                    return 0.20m;\n\n                case Resolution.Tick:\n                case Resolution.Second:\n                    return 0.50m;\n\n                default:\n                    return 1m;\n            }\n        }\n\n        /// <summary>\n        /// Signals a reset for the <see cref=\"MarketCapacityDollarVolume\"/> and <see cref=\"SaleVolume\"/>\n        /// </summary>\n        public void Reset()\n        {\n            _resetMarketCapacityDollarVolume = true;\n            SaleVolume = 0;\n        }\n\n        /// <summary>\n        /// Determines if we should remove a symbol from capacity estimation\n        /// </summary>\n        public bool ShouldRemove()\n        {\n            if (Security.Invested || _algorithm.UtcTime < _previousOrderEvent.UtcTime + CapacityEffectPeriod)\n            {\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SymbolJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Defines a <see cref=\"JsonConverter\"/> to be used when deserializing to\n    /// the <see cref=\"Symbol\"/> class.\n    /// </summary>\n    public class SymbolJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var symbol = value as Symbol;\n            if (ReferenceEquals(symbol, null)) return;\n\n            writer.WriteStartObject();\n            writer.WritePropertyName(\"value\");\n            writer.WriteValue(symbol.Value);\n            writer.WritePropertyName(\"id\");\n            writer.WriteValue(symbol.ID.ToString());\n            writer.WritePropertyName(\"permtick\");\n            writer.WriteValue(symbol.Value);\n            if (symbol.HasUnderlying)\n            {\n                writer.WritePropertyName(\"underlying\");\n                WriteJson(writer, symbol.Underlying, serializer);\n            }\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jobject = JObject.Load(reader);\n\n            if (jobject.TryGetValue(\"type\", StringComparison.InvariantCultureIgnoreCase, out var type))\n            {\n                return BuildSymbolFromUserFriendlyValue(jobject);\n            }\n            return ReadSymbolFromJson(jobject);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof (Symbol);\n        }\n\n        private Symbol ReadSymbolFromJson(JObject jObject)\n        {\n            JToken symbolId;\n            JToken value;\n\n            if ((jObject.TryGetValue(\"ID\", StringComparison.InvariantCultureIgnoreCase, out symbolId)\n                && jObject.TryGetValue(\"Value\", StringComparison.InvariantCultureIgnoreCase, out value))\n                || (jObject.TryGetValue(\"id\", StringComparison.InvariantCultureIgnoreCase, out symbolId)\n                && jObject.TryGetValue(\"value\", StringComparison.InvariantCultureIgnoreCase, out value)))\n            {\n                Symbol underlyingSymbol = null;\n                JToken underlying;\n                if (jObject.TryGetValue(\"Underlying\", StringComparison.InvariantCultureIgnoreCase, out underlying)\n                    || jObject.TryGetValue(\"underlying\", StringComparison.InvariantCultureIgnoreCase, out underlying))\n                {\n                    underlyingSymbol = ReadSymbolFromJson(underlying as JObject);\n                }\n\n                return new Symbol(SecurityIdentifier.Parse(symbolId.ToString()), value.ToString(), underlyingSymbol);\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Creates a symbol from the user friendly string representation\n        /// </summary>\n        private static Symbol BuildSymbolFromUserFriendlyValue(JObject jObject)\n        {\n            if (jObject.TryGetValue(\"value\", StringComparison.InvariantCultureIgnoreCase, out var value)\n                && jObject.TryGetValue(\"type\", StringComparison.InvariantCultureIgnoreCase, out var securityTypeToken)\n                && securityTypeToken.ToString().TryParseSecurityType(out var securityType))\n            {\n                if (!jObject.TryGetValue(\"market\", StringComparison.InvariantCultureIgnoreCase, out var market))\n                {\n                    market = Market.USA;\n                }\n                return SymbolRepresentation.ParseTickerFromUserInput(value.ToString(), securityType, market.ToString());\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SymbolRepresentation.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Logging;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\nusing static QuantConnect.StringExtensions;\nusing System.Text.RegularExpressions;\nusing QuantConnect.Securities.IndexOption;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Public static helper class that does parsing/generation of symbol representations (options, futures)\n    /// </summary>\n    public static class SymbolRepresentation\n    {\n        // Define the regex as a private readonly static field and compile it\n        private static readonly Regex _optionTickerRegex = new Regex(@\"^([A-Z0-9]+)\\s*(\\d{6})([CP])(\\d{8})$\", RegexOptions.IgnoreCase | RegexOptions.Compiled);\n\n        /// <summary>\n        /// Class contains future ticker properties returned by ParseFutureTicker()\n        /// </summary>\n        public class FutureTickerProperties\n        {\n            /// <summary>\n            /// Underlying name\n            /// </summary>\n            public string Underlying { get; set; }\n\n            /// <summary>\n            /// Short expiration year\n            /// </summary>\n            public int ExpirationYearShort { get; set; }\n\n            /// <summary>\n            /// Short expiration year digits\n            /// </summary>\n            public int ExpirationYearShortLength { get; set; }\n\n            /// <summary>\n            /// Expiration month\n            /// </summary>\n            public int ExpirationMonth { get; set; }\n\n            /// <summary>\n            /// Expiration day\n            /// </summary>\n            public int ExpirationDay { get; set; }\n        }\n\n        /// <summary>\n        /// Class contains option ticker properties returned by ParseOptionTickerIQFeed()\n        /// </summary>\n        public class OptionTickerProperties\n        {\n            /// <summary>\n            /// Underlying name\n            /// </summary>\n            public string Underlying { get; set; }\n\n            /// <summary>\n            /// Option right\n            /// </summary>\n            public OptionRight OptionRight { get; set; }\n\n            /// <summary>\n            /// Option strike\n            /// </summary>\n            public decimal OptionStrike { get; set; }\n\n            /// <summary>\n            /// Expiration date\n            /// </summary>\n            public DateTime ExpirationDate { get; set; }\n        }\n\n\n        /// <summary>\n        /// Function returns underlying name, expiration year, expiration month, expiration day for the future contract ticker. Function detects if\n        /// the format used is either 1 or 2 digits year, and if day code is present (will default to 1rst day of month). Returns null, if parsing failed.\n        /// Format [Ticker][2 digit day code OPTIONAL][1 char month code][2/1 digit year code]\n        /// </summary>\n        /// <param name=\"ticker\"></param>\n        /// <returns>Results containing 1) underlying name, 2) short expiration year, 3) expiration month</returns>\n        public static FutureTickerProperties ParseFutureTicker(string ticker)\n        {\n            var doubleDigitYear = char.IsDigit(ticker.Substring(ticker.Length - 2, 1)[0]);\n            var doubleDigitOffset = doubleDigitYear ? 1 : 0;\n\n            var expirationDayOffset = 0;\n            var expirationDay = 1;\n            if (ticker.Length > 4 + doubleDigitOffset)\n            {\n                var potentialExpirationDay = ticker.Substring(ticker.Length - 4 - doubleDigitOffset, 2);\n                var containsExpirationDay = char.IsDigit(potentialExpirationDay[0]) && char.IsDigit(potentialExpirationDay[1]);\n                expirationDayOffset = containsExpirationDay ? 2 : 0;\n                if (containsExpirationDay && !int.TryParse(potentialExpirationDay, out expirationDay))\n                {\n                    return null;\n                }\n            }\n\n            var expirationYearString = ticker.Substring(ticker.Length - 1 - doubleDigitOffset, 1 + doubleDigitOffset);\n            var expirationMonthString = ticker.Substring(ticker.Length - 2 - doubleDigitOffset, 1);\n            var underlyingString = ticker.Substring(0, ticker.Length - 2 - doubleDigitOffset - expirationDayOffset);\n\n            int expirationYearShort;\n\n            if (!int.TryParse(expirationYearString, out expirationYearShort))\n            {\n                return null;\n            }\n\n            if (!FuturesMonthCodeLookup.ContainsKey(expirationMonthString))\n            {\n                return null;\n            }\n\n            var expirationMonth = FuturesMonthCodeLookup[expirationMonthString];\n\n            return new FutureTickerProperties\n            {\n                Underlying = underlyingString,\n                ExpirationYearShort = expirationYearShort,\n                ExpirationYearShortLength = expirationYearString.Length,\n                ExpirationMonth = expirationMonth,\n                ExpirationDay = expirationDay\n            };\n        }\n\n        /// <summary>\n        /// Helper method to parse and generate a future symbol from a given user friendly representation\n        /// </summary>\n        /// <param name=\"ticker\">The future ticker, for example 'ESZ1'</param>\n        /// <param name=\"futureYear\">Clarifies the year for the current future</param>\n        /// <returns>The future symbol or null if failed</returns>\n        public static Symbol ParseFutureSymbol(string ticker, int? futureYear = null)\n        {\n            var parsed = ParseFutureTicker(ticker);\n            if (parsed == null)\n            {\n                return null;\n            }\n\n            var underlying = parsed.Underlying;\n            var expirationMonth = parsed.ExpirationMonth;\n            var expirationYear = GetExpirationYear(futureYear, parsed);\n\n            if (!SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(underlying, SecurityType.Future, out var market))\n            {\n                Log.Debug($@\"SymbolRepresentation.ParseFutureSymbol(): {Messages.SymbolRepresentation.FailedToGetMarketForTickerAndUnderlying(ticker, underlying)}\");\n                return null;\n            }\n\n            var expiryFunc = FuturesExpiryFunctions.FuturesExpiryFunction(Symbol.Create(underlying, SecurityType.Future, market));\n            var expiryDate = expiryFunc(new DateTime(expirationYear, expirationMonth, 1));\n\n            return Symbol.CreateFuture(underlying, market, expiryDate);\n        }\n\n        /// <summary>\n        /// Creates a future option Symbol from the provided ticker\n        /// </summary>\n        /// <param name=\"ticker\">The future option ticker, for example 'ESZ0 P3590'</param>\n        /// <param name=\"strikeScale\">Optional the future option strike scale factor</param>\n        public static Symbol ParseFutureOptionSymbol(string ticker, int strikeScale = 1)\n        {\n            var split = ticker.Split(' ');\n            if (split.Length != 2)\n            {\n                return null;\n            }\n\n            var parsed = ParseFutureTicker(split[0]);\n            if (parsed == null)\n            {\n                return null;\n            }\n            ticker = parsed.Underlying;\n\n            OptionRight right;\n            if (split[1][0] == 'P' || split[1][0] == 'p')\n            {\n                right = OptionRight.Put;\n            }\n            else if (split[1][0] == 'C' || split[1][0] == 'c')\n            {\n                right = OptionRight.Call;\n            }\n            else\n            {\n                return null;\n            }\n            var strike = split[1].Substring(1);\n\n            if (parsed.ExpirationYearShort < 10)\n            {\n                parsed.ExpirationYearShort += 20;\n            }\n            var expirationYearParsed = 2000 + parsed.ExpirationYearShort;\n\n            var expirationDate = new DateTime(expirationYearParsed, parsed.ExpirationMonth, 1);\n\n            var strikePrice = decimal.Parse(strike, NumberStyles.Any, CultureInfo.InvariantCulture);\n            var futureTicker = FuturesOptionsSymbolMappings.MapFromOption(ticker);\n\n            if (!SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(futureTicker, SecurityType.Future, out var market))\n            {\n                Log.Debug($\"SymbolRepresentation.ParseFutureOptionSymbol(): {Messages.SymbolRepresentation.NoMarketFound(futureTicker)}\");\n                return null;\n            }\n\n            var canonicalFuture = Symbol.Create(futureTicker, SecurityType.Future, market);\n            var futureExpiry = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFuture)(expirationDate);\n            var future = Symbol.CreateFuture(futureTicker, market, futureExpiry);\n\n            var futureOptionExpiry = FuturesOptionsExpiryFunctions.GetFutureOptionExpiryFromFutureExpiry(future);\n\n            return Symbol.CreateOption(future,\n                market,\n                OptionStyle.American,\n                right,\n                strikePrice / strikeScale,\n                futureOptionExpiry);\n        }\n\n        /// <summary>\n        /// Returns future symbol ticker from underlying and expiration date. Function can generate tickers of two formats: one and two digits year.\n        /// Format [Ticker][2 digit day code][1 char month code][2/1 digit year code], more information at http://help.tradestation.com/09_01/tradestationhelp/symbology/futures_symbology.htm\n        /// </summary>\n        /// <param name=\"underlying\">String underlying</param>\n        /// <param name=\"expiration\">Expiration date</param>\n        /// <param name=\"doubleDigitsYear\">True if year should represented by two digits; False - one digit</param>\n        /// <param name=\"includeExpirationDate\">True if expiration date should be included</param>\n        /// <returns>The user friendly future ticker</returns>\n        public static string GenerateFutureTicker(string underlying, DateTime expiration, bool doubleDigitsYear = true, bool includeExpirationDate = true)\n        {\n            var year = doubleDigitsYear ? expiration.Year % 100 : expiration.Year % 10;\n            var month = expiration.Month;\n\n            var contractMonthDelta = FuturesExpiryUtilityFunctions.GetDeltaBetweenContractMonthAndContractExpiry(underlying, expiration.Date);\n            if (contractMonthDelta < 0)\n            {\n                // For futures that have an expiry after the contract month.\n                // This is for dairy contracts, which can and do expire after the contract month.\n                var expirationMonth = expiration.AddDays(-(expiration.Day - 1))\n                    .AddMonths(contractMonthDelta);\n\n                month = expirationMonth.Month;\n                year = doubleDigitsYear ? expirationMonth.Year % 100 : expirationMonth.Year % 10;\n            }\n            else\n            {\n                // These futures expire in the month before or in the contract month\n                month += contractMonthDelta;\n\n                // Get the month back into the allowable range, allowing for a wrap\n                // Below is a little algorithm for wrapping numbers with a certain bounds.\n                // In this case, were dealing with months, wrapping to years once we get to January\n                // As modulo works for [0, x), it's best to subtract 1 (as months are [1, 12] to convert to [0, 11]),\n                // do the modulo/integer division, then add 1 back on to get into the correct range again\n                month--;\n                year += month / 12;\n                month %= 12;\n                month++;\n            }\n\n            var expirationDay = includeExpirationDate ? $\"{expiration.Day:00}\" : string.Empty;\n\n            return $\"{underlying}{expirationDay}{FuturesMonthLookup[month]}{year}\";\n        }\n\n        /// <summary>\n        /// Returns option symbol ticker in accordance with OSI symbology\n        /// More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf\n        /// </summary>\n        /// <param name=\"symbol\">Symbol object to create OSI ticker from</param>\n        /// <returns>The OSI ticker representation</returns>\n        public static string GenerateOptionTickerOSI(this Symbol symbol)\n        {\n            if (!symbol.SecurityType.IsOption())\n            {\n                throw new ArgumentException(\n                    Messages.SymbolRepresentation.UnexpectedSecurityTypeForMethod(nameof(GenerateOptionTickerOSI), symbol.SecurityType));\n            }\n\n            return GenerateOptionTickerOSI(symbol.Underlying.Value, symbol.ID.OptionRight, symbol.ID.StrikePrice, symbol.ID.Date);\n        }\n\n        /// <summary>\n        /// Returns option symbol ticker in accordance with OSI symbology\n        /// More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf\n        /// </summary>\n        /// <param name=\"underlying\">Underlying string</param>\n        /// <param name=\"right\">Option right</param>\n        /// <param name=\"strikePrice\">Option strike</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>The OSI ticker representation</returns>\n        public static string GenerateOptionTickerOSI(string underlying, OptionRight right, decimal strikePrice, DateTime expiration)\n        {\n            if (underlying.Length > 5) underlying += \" \";\n            return Invariant($\"{underlying,-6}{expiration.ToStringInvariant(DateFormat.SixCharacter)}{right.ToStringPerformance()[0]}{(strikePrice * 1000m):00000000}\");\n        }\n\n        /// <summary>\n        /// Returns option symbol ticker in accordance with OSI symbology\n        /// More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf\n        /// </summary>\n        /// <param name=\"symbol\">Symbol object to create OSI ticker from</param>\n        /// <returns>The OSI ticker representation</returns>\n        public static string GenerateOptionTickerOSICompact(this Symbol symbol)\n        {\n            // First, validate that the symbol is of the correct security type\n            if (!symbol.SecurityType.IsOption())\n            {\n                throw new ArgumentException(\n                    Messages.SymbolRepresentation.UnexpectedSecurityTypeForMethod(nameof(GenerateOptionTickerOSICompact), symbol.SecurityType));\n            }\n            return GenerateOptionTickerOSICompact(symbol.Underlying.Value, symbol.ID.OptionRight, symbol.ID.StrikePrice, symbol.ID.Date);\n        }\n\n        /// <summary>\n        /// Returns option symbol ticker in accordance with OSI symbology\n        /// More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf\n        /// </summary>\n        /// <param name=\"underlying\">Underlying string</param>\n        /// <param name=\"right\">Option right</param>\n        /// <param name=\"strikePrice\">Option strike</param>\n        /// <param name=\"expiration\">Option expiration date</param>\n        /// <returns>The OSI ticker representation</returns>\n        public static string GenerateOptionTickerOSICompact(string underlying, OptionRight right, decimal strikePrice, DateTime expiration)\n        {\n            return Invariant($\"{underlying}{expiration.ToStringInvariant(DateFormat.SixCharacter)}{right.ToStringPerformance()[0]}{(strikePrice * 1000m):00000000}\");\n        }\n\n        /// <summary>\n        /// Parses the specified OSI options ticker into a Symbol object\n        /// </summary>\n        /// <param name=\"ticker\">The OSI compliant option ticker string</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <param name=\"market\">The associated market</param>\n        /// <returns>Symbol object for the specified OSI option ticker string</returns>\n        public static Symbol ParseOptionTickerOSI(string ticker, SecurityType securityType = SecurityType.Option, string market = Market.USA)\n        {\n            return ParseOptionTickerOSI(ticker, securityType, OptionStyle.American, market);\n        }\n\n        /// <summary>\n        /// Parses the specified OSI options ticker into a Symbol object\n        /// </summary>\n        /// <param name=\"ticker\">The OSI compliant option ticker string</param>\n        /// <param name=\"securityType\">The security type</param>\n        /// <param name=\"market\">The associated market</param>\n        /// <param name=\"optionStyle\">The option style</param>\n        /// <returns>Symbol object for the specified OSI option ticker string</returns>\n        public static Symbol ParseOptionTickerOSI(string ticker, SecurityType securityType, OptionStyle optionStyle, string market)\n        {\n            if (!TryDecomposeOptionTickerOSI(ticker, out var optionTicker, out var expiry, out var right, out var strike))\n            {\n                throw new FormatException(Messages.SymbolRepresentation.InvalidOSITickerFormat(ticker));\n            }\n\n            SecurityIdentifier underlyingSid;\n            string underlyingSymbolValue;\n            if (securityType == SecurityType.Option)\n            {\n                underlyingSid = SecurityIdentifier.GenerateEquity(optionTicker, market);\n                // We have the mapped symbol in the OSI ticker\n                underlyingSymbolValue = optionTicker;\n                // let it fallback to it's default handling, which include mapping\n                optionTicker = null;\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                underlyingSid = SecurityIdentifier.GenerateIndex(OptionSymbol.MapToUnderlying(optionTicker, securityType), market);\n                underlyingSymbolValue = underlyingSid.Symbol;\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                var futureTickerInfo = ParseFutureTicker(optionTicker);\n                underlyingSid = SecurityIdentifier.GenerateFuture(expiry, futureTickerInfo.Underlying, market);\n                underlyingSymbolValue = underlyingSid.Symbol;\n            }\n            else\n            {\n                throw new NotImplementedException($\"ParseOptionTickerOSI(): {Messages.SymbolRepresentation.SecurityTypeNotImplemented(securityType)}\");\n            }\n            var sid = SecurityIdentifier.GenerateOption(expiry, underlyingSid, optionTicker, market, strike, right, optionStyle);\n            return new Symbol(sid, ticker, new Symbol(underlyingSid, underlyingSymbolValue));\n        }\n\n        /// <summary>\n        /// Tries to decompose the specified OSI options ticker into its components\n        /// </summary>\n        /// <param name=\"ticker\">The OSI option ticker</param>\n        /// <param name=\"optionTicker\">The option ticker extracted from the OSI symbol</param>\n        /// <param name=\"expiry\">The option contract expiry date</param>\n        /// <param name=\"right\">The option contract right</param>\n        /// <param name=\"strike\">The option contract strike price</param>\n        /// <returns>True if the OSI symbol was in the right format and could be decomposed</returns>\n        public static bool TryDecomposeOptionTickerOSI(string ticker, out string optionTicker, out DateTime expiry,\n            out OptionRight right, out decimal strike)\n        {\n            optionTicker = null;\n            expiry = default;\n            right = OptionRight.Call;\n            strike = decimal.Zero;\n\n            if (string.IsNullOrEmpty(ticker))\n            {\n                return false;\n            }\n\n            var match = _optionTickerRegex.Match(ticker);\n            if (!match.Success)\n            {\n                return false;\n            }\n\n            optionTicker = match.Groups[1].Value;\n            expiry = DateTime.ParseExact(match.Groups[2].Value, DateFormat.SixCharacter, null);\n            right = match.Groups[3].Value.ToUpperInvariant() == \"C\" ? OptionRight.Call : OptionRight.Put;\n            strike = Parse.Decimal(match.Groups[4].Value) / 1000m;\n\n            return true;\n        }\n\n        /// <summary>\n        /// Tries to decompose the specified OSI options ticker into its components\n        /// </summary>\n        /// <param name=\"ticker\">The OSI option ticker</param>\n        /// <param name=\"securityType\">The option security type</param>\n        /// <param name=\"optionTicker\">The option ticker extracted from the OSI symbol</param>\n        /// <param name=\"underlyingTicker\">The underlying ticker</param>\n        /// <param name=\"expiry\">The option contract expiry date</param>\n        /// <param name=\"right\">The option contract right</param>\n        /// <param name=\"strike\">The option contract strike price</param>\n        /// <returns>True if the OSI symbol was in the right format and could be decomposed</returns>\n        public static bool TryDecomposeOptionTickerOSI(string ticker, SecurityType securityType, out string optionTicker,\n            out string underlyingTicker, out DateTime expiry, out OptionRight right, out decimal strike)\n        {\n            optionTicker = null;\n            underlyingTicker = null;\n            expiry = default;\n            right = OptionRight.Call;\n            strike = decimal.Zero;\n\n            if (!securityType.IsOption())\n            {\n                return false;\n            }\n\n            var result = TryDecomposeOptionTickerOSI(ticker, out optionTicker, out expiry, out right, out strike);\n            underlyingTicker = securityType != SecurityType.IndexOption ? optionTicker : IndexOptionSymbol.MapToUnderlying(optionTicker);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Function returns option ticker from IQFeed option ticker\n        /// For example CSCO1220V19 Cisco October Put at 19.00 Expiring on 10/20/12\n        /// Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&amp;displayaction=support%C2%A7ion=guide&amp;web=iqfeed&amp;guide=options&amp;web=IQFeed&amp;type=stock\n        /// </summary>\n        /// <param name=\"symbol\">THe option symbol</param>\n        /// <returns>The option ticker</returns>\n        public static string GenerateOptionTicker(Symbol symbol)\n        {\n            var symbolTicker = symbol.SecurityType == SecurityType.IndexOption ? symbol.Canonical.Value.Replace(\"?\", string.Empty) : SecurityIdentifier.Ticker(symbol.Underlying, symbol.ID.Date);\n            var letter = OptionCodeLookup.Where(x => x.Value.Item2 == symbol.ID.OptionRight && x.Value.Item1 == symbol.ID.Date.Month).Select(x => x.Key).Single();\n            var twoYearDigit = symbol.ID.Date.ToString(\"yy\");\n            return $\"{symbolTicker}{twoYearDigit}{symbol.ID.Date.Day:00}{letter}{symbol.ID.StrikePrice.ToStringInvariant()}\";\n        }\n\n        /// <summary>\n        /// Function returns option contract parameters (underlying name, expiration date, strike, right) from IQFeed option ticker\n        /// Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&amp;displayaction=support%C2%A7ion=guide&amp;web=iqfeed&amp;guide=options&amp;web=IQFeed&amp;type=stock\n        /// </summary>\n        /// <param name=\"ticker\">IQFeed option ticker</param>\n        /// <returns>Results containing 1) underlying name, 2) option right, 3) option strike 4) expiration date</returns>\n        public static OptionTickerProperties ParseOptionTickerIQFeed(string ticker)\n        {\n            var letterRange = OptionCodeLookup.Keys\n                            .Select(x => x[0])\n                            .ToArray();\n            var optionTypeDelimiter = ticker.LastIndexOfAny(letterRange);\n            var strikePriceString = ticker.Substring(optionTypeDelimiter + 1, ticker.Length - optionTypeDelimiter - 1);\n\n            var lookupResult = OptionCodeLookup[ticker[optionTypeDelimiter].ToStringInvariant()];\n            var month = lookupResult.Item1;\n            var optionRight = lookupResult.Item2;\n\n            var dayString = ticker.Substring(optionTypeDelimiter - 2, 2);\n            var yearString = ticker.Substring(optionTypeDelimiter - 4, 2);\n            var underlying = ticker.Substring(0, optionTypeDelimiter - 4);\n\n            // if we cannot parse strike price, we ignore this contract, but log the information.\n            Decimal strikePrice;\n            if (!Decimal.TryParse(strikePriceString, NumberStyles.Any, CultureInfo.InvariantCulture, out strikePrice))\n            {\n                return null;\n            }\n\n            int day;\n\n            if (!int.TryParse(dayString, out day))\n            {\n                return null;\n            }\n\n            int year;\n\n            if (!int.TryParse(yearString, out year))\n            {\n                return null;\n            }\n\n            var expirationDate = new DateTime(2000 + year, month, day);\n\n            return new OptionTickerProperties\n            {\n                Underlying = underlying,\n                OptionRight = optionRight,\n                OptionStrike = strikePrice,\n                ExpirationDate = expirationDate\n            };\n        }\n\n\n        /// <summary>\n        /// A dictionary that maps option symbols to a tuple containing the option series number and the option right (Call or Put).\n        /// The key represents a single character option symbol, and the value contains the series number and the associated option right.\n        /// </summary>\n        /// <remarks>\n        /// The dictionary is designed to map each option symbol (e.g., \"A\", \"M\", \"B\", etc.) to an option series number and \n        /// the corresponding option right (either a Call or Put). The series number determines the group of options the symbol belongs to,\n        /// and the option right indicates whether the option is a Call (buyer has the right to buy) or Put (buyer has the right to sell).\n        /// </remarks>\n        public static IReadOnlyDictionary<string, Tuple<int, OptionRight>> OptionCodeLookup { get; } = new Dictionary<string, Tuple<int, OptionRight>>\n        {\n            { \"A\", Tuple.Create(1, OptionRight.Call) }, { \"M\", Tuple.Create(1, OptionRight.Put) },\n            { \"B\", Tuple.Create(2, OptionRight.Call) }, { \"N\", Tuple.Create(2, OptionRight.Put) },\n            { \"C\", Tuple.Create(3, OptionRight.Call) }, { \"O\", Tuple.Create(3, OptionRight.Put) },\n            { \"D\", Tuple.Create(4, OptionRight.Call) }, { \"P\", Tuple.Create(4, OptionRight.Put) },\n            { \"E\", Tuple.Create(5, OptionRight.Call) }, { \"Q\", Tuple.Create(5, OptionRight.Put) },\n            { \"F\", Tuple.Create(6, OptionRight.Call) }, { \"R\", Tuple.Create(6, OptionRight.Put) },\n            { \"G\", Tuple.Create(7, OptionRight.Call) }, { \"S\", Tuple.Create(7, OptionRight.Put) },\n            { \"H\", Tuple.Create(8, OptionRight.Call) }, { \"T\", Tuple.Create(8, OptionRight.Put) },\n            { \"I\", Tuple.Create(9, OptionRight.Call) }, { \"U\", Tuple.Create(9, OptionRight.Put) },\n            { \"J\", Tuple.Create(10, OptionRight.Call) }, { \"V\", Tuple.Create(10, OptionRight.Put) },\n            { \"K\", Tuple.Create(11, OptionRight.Call) }, { \"W\", Tuple.Create(11, OptionRight.Put) },\n            { \"L\", Tuple.Create(12, OptionRight.Call) }, { \"X\", Tuple.Create(12, OptionRight.Put) },\n        };\n\n\n        /// <summary>\n        /// Provides a lookup dictionary for mapping futures month codes to their corresponding numeric values.\n        /// </summary>\n        public static IReadOnlyDictionary<string, int> FuturesMonthCodeLookup { get; } = new Dictionary<string, int>\n        {\n            { \"F\", 1 }, // January\n            { \"G\", 2 }, // February\n            { \"H\", 3 }, // March\n            { \"J\", 4 }, // April\n            { \"K\", 5 }, // May\n            { \"M\", 6 }, // June\n            { \"N\", 7 }, // July\n            { \"Q\", 8 }, // August\n            { \"U\", 9 }, // September\n            { \"V\", 10 }, // October\n            { \"X\", 11 }, // November\n            { \"Z\", 12 } // December\n        };\n\n        /// <summary>\n        /// Provides a lookup dictionary for mapping numeric values to their corresponding futures month codes.\n        /// </summary>\n        public static IReadOnlyDictionary<int, string> FuturesMonthLookup { get; } = FuturesMonthCodeLookup.ToDictionary(kv => kv.Value, kv => kv.Key);\n\n        /// <summary>\n        /// Converts a user-provided ticker string into a <see cref=\"Symbol\"/> object,\n        /// handling different security types such as stocks, options, futures, and index options.\n        /// </summary>\n        /// <param name=\"ticker\">The ticker string input by the user.</param>\n        /// <param name=\"securityType\">The type of security (e.g., Equity, Option, Future).</param>\n        /// <param name=\"market\">The market or exchange the symbol belongs to (optional for some types).</param>\n        /// <returns>A <see cref=\"Symbol\"/> representing the specified security.</returns>\n        public static Symbol ParseTickerFromUserInput(string ticker, SecurityType securityType, string market)\n        {\n            if (securityType == SecurityType.Option)\n            {\n                return ParseOptionTickerOSI(ticker);\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                return ParseFutureSymbol(ticker);\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                return ParseFutureOptionSymbol(ticker);\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                return ParseOptionTickerOSI(ticker, securityType);\n            }\n\n            return Symbol.Create(ticker, securityType, market);\n        }\n\n        /// <summary>\n        /// Get the expiration year from short year (two-digit integer).\n        /// Examples: NQZ23 and NQZ3 for Dec 2023\n        /// </summary>\n        /// <param name=\"futureYear\">Clarifies the year for the current future</param>\n        /// <param name=\"parsed\">Contains useful information about the future expiration year</param>\n        /// <remarks>Tickers from live trading may not provide the four-digit year.</remarks>\n        private static int GetExpirationYear(int? futureYear, FutureTickerProperties parsed)\n        {\n            if (futureYear.HasValue)\n            {\n                var referenceYear = 1900 + parsed.ExpirationYearShort;\n                while (referenceYear < futureYear.Value)\n                {\n                    referenceYear += 10;\n                }\n\n                return referenceYear;\n            }\n\n            var currentYear = DateTime.UtcNow.Year;\n            if (parsed.ExpirationYearShortLength > 1)\n            {\n                // we are given a double digit year\n                return 2000 + parsed.ExpirationYearShort;\n            }\n\n            var baseYear = ((int)Math.Floor(currentYear / 10.0)) * 10 + parsed.ExpirationYearShort;\n            while (baseYear < currentYear)\n            {\n                baseYear += 10;\n            }\n            return baseYear;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/SymbolValueJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Defines a <see cref=\"JsonConverter\"/> to be used when you only want to serialize\n    /// the <see cref=\"Symbol.Value\"/> property instead of the full <see cref=\"Symbol\"/>\n    /// instance\n    /// </summary>\n    public class SymbolValueJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var symbol = value as Symbol;\n            if (symbol != null)\n            {\n                writer.WriteValue(symbol.Value);\n            }\n            else\n            {\n                serializer.Serialize(writer, value);\n            }\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            throw new NotImplementedException(Messages.SymbolValueJsonConverter.ConverterIsWriteOnly);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            throw new NotImplementedException(Messages.SymbolValueJsonConverter.ConverterIsIntendedToBeDirectlyDecoratedInMember);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Time.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Converters;\nusing NodaTime;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Time helper class collection for working with trading dates\n    /// </summary>\n    public static class Time\n    {\n        /// <summary>\n        /// Allows specifying an offset to trigger the tradable date event\n        /// </summary>\n        /// <remarks>Useful for delaying the tradable date event until new auxiliary data is available to refresh map and factor files</remarks>\n        public static TimeSpan LiveAuxiliaryDataOffset { get; set; } = TimeSpan.FromHours(8);\n\n        /// <summary>\n        /// Provides a value far enough in the future the current computer hardware will have decayed :)\n        /// </summary>\n        /// <value>\n        /// new DateTime(2050, 12, 31)\n        /// </value>\n        public static readonly DateTime EndOfTime = new DateTime(2050, 12, 31);\n\n        /// <summary>\n        /// Provides a time span based on <see cref=\"EndOfTime\"/>\n        /// </summary>\n        public static TimeSpan EndOfTimeTimeSpan = new TimeSpan(EndOfTime.Ticks);\n\n        /// <summary>\n        /// Provides a common and normalized start time for Lean data\n        /// </summary>\n        public static readonly DateTime Start = new DateTime(1998, 1, 2);\n\n        /// <summary>\n        /// Provides a value far enough in the past that can be used as a lower bound on dates, 12/30/1899\n        /// </summary>\n        /// <value>\n        /// DateTime.FromOADate(0)\n        /// </value>\n        public static readonly DateTime BeginningOfTime = DateTime.FromOADate(0);\n\n        /// <summary>\n        /// Provides a value large enough that we won't hit the limit, while small enough\n        /// we can still do math against it without checking everywhere for <see cref=\"TimeSpan.MaxValue\"/>\n        /// </summary>\n        public static readonly TimeSpan MaxTimeSpan = TimeSpan.FromDays(1000*365);\n\n        /// <summary>\n        /// One Year TimeSpan Period Constant\n        /// </summary>\n        /// <remarks>365 days</remarks>\n        public static readonly TimeSpan OneYear = TimeSpan.FromDays(365);\n\n        /// <summary>\n        /// One Day TimeSpan Period Constant\n        /// </summary>\n        public static readonly TimeSpan OneDay = TimeSpan.FromDays(1);\n\n        /// <summary>\n        /// One Hour TimeSpan Period Constant\n        /// </summary>\n        public static readonly TimeSpan OneHour = TimeSpan.FromHours(1);\n\n        /// <summary>\n        /// One Minute TimeSpan Period Constant\n        /// </summary>\n        public static readonly TimeSpan OneMinute = TimeSpan.FromMinutes(1);\n\n        /// <summary>\n        /// One Second TimeSpan Period Constant\n        /// </summary>\n        public static readonly TimeSpan OneSecond = TimeSpan.FromSeconds(1);\n\n        /// <summary>\n        /// One Millisecond TimeSpan Period Constant\n        /// </summary>\n        public static readonly TimeSpan OneMillisecond = TimeSpan.FromMilliseconds(1);\n\n        /// <summary>\n        /// Live charting is sensitive to timezone so need to convert the local system time to a UTC and display in browser as UTC.\n        /// </summary>\n        public struct DateTimeWithZone\n        {\n            private readonly DateTime utcDateTime;\n            private readonly TimeZoneInfo timeZone;\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"QuantConnect.Time.DateTimeWithZone\"/> struct.\n            /// </summary>\n            /// <param name=\"dateTime\">Date time.</param>\n            /// <param name=\"timeZone\">Time zone.</param>\n            public DateTimeWithZone(DateTime dateTime, TimeZoneInfo timeZone)\n            {\n                utcDateTime = TimeZoneInfo.ConvertTimeToUtc(dateTime, timeZone);\n                this.timeZone = timeZone;\n            }\n\n            /// <summary>\n            /// Gets the universal time.\n            /// </summary>\n            /// <value>The universal time.</value>\n            public DateTime UniversalTime { get { return utcDateTime; } }\n\n            /// <summary>\n            /// Gets the time zone.\n            /// </summary>\n            /// <value>The time zone.</value>\n            public TimeZoneInfo TimeZone { get { return timeZone; } }\n\n            /// <summary>\n            /// Gets the local time.\n            /// </summary>\n            /// <value>The local time.</value>\n            public DateTime LocalTime\n            {\n                get\n                {\n                    return TimeZoneInfo.ConvertTime(utcDateTime, timeZone);\n                }\n            }\n        }\n\n        private static readonly DateTime EpochTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);\n        private const long SecondToMillisecond = 1000;\n\n        /// <summary>\n        /// Helper method to get the new live auxiliary data due time\n        /// </summary>\n        /// <returns>The due time for the new auxiliary data emission</returns>\n        public static TimeSpan GetNextLiveAuxiliaryDataDueTime()\n        {\n            return GetNextLiveAuxiliaryDataDueTime(DateTime.UtcNow);\n        }\n\n        /// <summary>\n        /// Helper method to get the new live auxiliary data due time\n        /// </summary>\n        /// <param name=\"utcNow\">The current utc time</param>\n        /// <returns>The due time for the new auxiliary data emission</returns>\n        public static TimeSpan GetNextLiveAuxiliaryDataDueTime(DateTime utcNow)\n        {\n            var nowNewYork = utcNow.ConvertFromUtc(TimeZones.NewYork);\n            if (nowNewYork.TimeOfDay < LiveAuxiliaryDataOffset)\n            {\n                return LiveAuxiliaryDataOffset - nowNewYork.TimeOfDay;\n            }\n            return nowNewYork.Date.AddDays(1).Add(+LiveAuxiliaryDataOffset) - nowNewYork;\n        }\n\n        /// <summary>\n        /// Helper method to adjust a waiting time, in milliseconds, so it's uneven with the second turn around\n        /// </summary>\n        /// <param name=\"waitTimeMillis\">The desired wait time</param>\n        /// <remarks>This is useful for real time performance in live trading. We want to avoid adding unnecessary cpu usage,\n        /// during periods where we know there will be cpu time demand, like a second turn around where data is emitted.</remarks>\n        /// <returns>The adjusted wait time</returns>\n        public static int GetSecondUnevenWait(int waitTimeMillis)\n        {\n            return DateTime.UtcNow.GetSecondUnevenWait(waitTimeMillis);\n        }\n\n        /// <summary>\n        /// Helper method to adjust a waiting time, in milliseconds, so it's uneven with the second turn around\n        /// </summary>\n        /// <param name=\"now\">The current time</param>\n        /// <param name=\"waitTimeMillis\">The desired wait time</param>\n        /// <remarks>This is useful for real time performance in live trading. We want to avoid adding unnecessary cpu usage,\n        /// during periods where we know there will be cpu time demand, like a second turn around where data is emitted.</remarks>\n        /// <returns>The adjusted wait time</returns>\n        public static int GetSecondUnevenWait(this DateTime now, int waitTimeMillis)\n        {\n            var wakeUpTime = now.AddMilliseconds(waitTimeMillis);\n            if (wakeUpTime.Millisecond < 100 || wakeUpTime.Millisecond > 900)\n            {\n                // if we are going to wake before/after the next second we add an offset to avoid it\n                var offsetMillis = waitTimeMillis >= 1000 ? 500 : 100;\n                return waitTimeMillis + offsetMillis;\n            }\n            return waitTimeMillis;\n        }\n\n        /// <summary>\n        /// Create a C# DateTime from a UnixTimestamp\n        /// </summary>\n        /// <param name=\"unixTimeStamp\">Double unix timestamp (Time since Midnight Jan 1 1970)</param>\n        /// <returns>C# date timeobject</returns>\n        public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)\n        {\n            DateTime time;\n            try\n            {\n                var ticks = unixTimeStamp * TimeSpan.TicksPerSecond;\n                time = EpochTime.AddTicks((long)ticks);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"UnixTimeStamp: {unixTimeStamp}\"));\n                time = DateTime.Now;\n            }\n            return time;\n        }\n\n        /// <summary>\n        /// Create a C# DateTime from a UnixTimestamp\n        /// </summary>\n        /// <param name=\"unixTimeStamp\">Decimal unix timestamp (Time since Midnight Jan 1 1970)</param>\n        /// <returns>C# date time object</returns>\n        public static DateTime UnixTimeStampToDateTime(decimal unixTimeStamp)\n        {\n            return UnixMillisecondTimeStampToDateTime(unixTimeStamp * SecondToMillisecond);\n        }\n\n        /// <summary>\n        /// Create a C# DateTime from a UnixTimestamp\n        /// </summary>\n        /// <param name=\"unixTimeStamp\">Long unix timestamp (Time since Midnight Jan 1 1970)</param>\n        /// <returns>C# date time object</returns>\n        public static DateTime UnixTimeStampToDateTime(long unixTimeStamp)\n        {\n            return UnixTimeStampToDateTime(Convert.ToDecimal(unixTimeStamp));\n        }\n\n        /// <summary>\n        /// Create a C# DateTime from a UnixTimestamp\n        /// </summary>\n        /// <param name=\"unixTimeStamp\">Decimal unix timestamp (Time since Midnight Jan 1 1970) in milliseconds</param>\n        /// <returns>C# date time object</returns>\n        public static DateTime UnixMillisecondTimeStampToDateTime(decimal unixTimeStamp)\n        {\n            DateTime time;\n            try\n            {\n                // Any residual decimal numbers that remain are nanoseconds from [0, 100) nanoseconds.\n                // If we cast to (long), only the integer component of the decimal is taken, and can\n                // potentially result in look-ahead bias in increments of 100 nanoseconds, i.e. 1 DateTime tick.\n                var ticks = Math.Ceiling(unixTimeStamp * TimeSpan.TicksPerMillisecond);\n                time = EpochTime.AddTicks((long)ticks);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"UnixTimeStamp: {unixTimeStamp}\"));\n                time = DateTime.Now;\n            }\n            return time;\n        }\n\n        /// <summary>\n        /// Create a C# DateTime from a UnixTimestamp\n        /// </summary>\n        /// <param name=\"unixTimeStamp\">Int64 unix timestamp (Time since Midnight Jan 1 1970) in nanoseconds</param>\n        /// <returns>C# date time object</returns>\n        public static DateTime UnixNanosecondTimeStampToDateTime(long unixTimeStamp)\n        {\n            DateTime time;\n            try\n            {\n                var ticks = unixTimeStamp / 100;\n                time = EpochTime.AddTicks(ticks);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"UnixTimeStamp: {unixTimeStamp}\"));\n                time = DateTime.Now;\n            }\n            return time;\n        }\n\n        /// <summary>\n        /// Convert a Datetime to Unix Timestamp\n        /// </summary>\n        /// <param name=\"time\">C# datetime object</param>\n        /// <returns>Double unix timestamp</returns>\n        public static double DateTimeToUnixTimeStamp(DateTime time)\n        {\n            double timestamp = 0;\n            try\n            {\n                timestamp = (time - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"{time:o}\"));\n            }\n            return timestamp;\n        }\n\n        /// <summary>\n        /// Convert a Datetime to Unix Timestamp\n        /// </summary>\n        /// <param name=\"time\">C# datetime object</param>\n        /// <returns>Double unix timestamp</returns>\n        public static double DateTimeToUnixTimeStampMilliseconds(DateTime time)\n        {\n            double timestamp = 0;\n            try\n            {\n                timestamp = (time - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalMilliseconds;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"{time:o}\"));\n            }\n            return timestamp;\n        }\n\n        /// <summary>\n        /// Convert a Datetime to Unix Timestamp\n        /// </summary>\n        /// <param name=\"time\">C# datetime object</param>\n        /// <returns>Int64 unix timestamp</returns>\n        public static long DateTimeToUnixTimeStampNanoseconds(DateTime time)\n        {\n            long timestamp = 0;\n            try\n            {\n                timestamp = (time - new DateTime(1970, 1, 1, 0, 0, 0, 0)).Ticks * 100;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, Invariant($\"{time:o}\"));\n            }\n            return timestamp;\n        }\n\n        /// <summary>\n        /// Get the current time as a unix timestamp\n        /// </summary>\n        /// <returns>Double value of the unix as UTC timestamp</returns>\n        public static double TimeStamp()\n        {\n            return DateTimeToUnixTimeStamp(DateTime.UtcNow);\n        }\n\n        /// <summary>\n        /// Returns the timespan with the larger value\n        /// </summary>\n        public static TimeSpan Max(TimeSpan one, TimeSpan two)\n        {\n            return TimeSpan.FromTicks(Math.Max(one.Ticks, two.Ticks));\n        }\n\n        /// <summary>\n        /// Returns the timespan with the smaller value\n        /// </summary>\n        public static TimeSpan Min(TimeSpan one, TimeSpan two)\n        {\n            return TimeSpan.FromTicks(Math.Min(one.Ticks, two.Ticks));\n        }\n\n        /// <summary>\n        /// Returns the larger of two date times\n        /// </summary>\n        public static DateTime Max(DateTime one, DateTime two)\n        {\n            return one > two ? one : two;\n        }\n\n        /// <summary>\n        /// Returns the smaller of two date times\n        /// </summary>\n        public static DateTime Min(DateTime one, DateTime two)\n        {\n            return one < two ? one : two;\n        }\n\n        /// <summary>\n        /// Multiplies the specified interval by the multiplier\n        /// </summary>\n        /// <param name=\"interval\">The interval to be multiplied, such as TimeSpan.FromSeconds(1)</param>\n        /// <param name=\"multiplier\">The number of times to multiply the interval</param>\n        /// <returns>The multiplied interval, such as 1s*5 = 5s</returns>\n        public static TimeSpan Multiply(this TimeSpan interval, double multiplier)\n        {\n            return TimeSpan.FromTicks((long) (interval.Ticks * multiplier));\n        }\n\n        /// <summary>\n        /// Parse a standard YY MM DD date into a DateTime. Attempt common date formats\n        /// </summary>\n        /// <param name=\"dateToParse\">String date time to parse</param>\n        /// <returns>Date time</returns>\n        public static DateTime ParseDate(string dateToParse)\n        {\n            try\n            {\n                //First try the exact options:\n                DateTime date;\n                if (DateTime.TryParseExact(dateToParse, DateFormat.SixCharacter, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.EightCharacter, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.TwelveCharacter, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse.SafeSubstring(0, 19), DateFormat.JsonFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.USShort, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.USShortDateOnly, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.US, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.USDateOnly, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParse(dateToParse, out date))\n                {\n                    return date;\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return DateTime.Now;\n        }\n\n        /// <summary>\n        /// Parse a standard YY MM DD date into a DateTime. Attempt common date formats\n        /// </summary>\n        /// <param name=\"dateToParse\">String date time to parse</param>\n        /// <returns>Date time</returns>\n        public static DateTime ParseFIXUtcTimestamp(string dateToParse)\n        {\n            try\n            {\n                //First try the exact options:\n                DateTime date;\n                if (DateTime.TryParseExact(dateToParse, DateFormat.FIX, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n                if (DateTime.TryParseExact(dateToParse, DateFormat.FIXWithMillisecond, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))\n                {\n                    return date;\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return DateTime.UtcNow;\n        }\n\n        /// <summary>\n        /// Define an enumerable date time range using the given time step\n        /// </summary>\n        /// <param name=\"from\">DateTime start date time</param>\n        /// <param name=\"thru\">DateTime end date time</param>\n        /// <returns>Enumerable date time range</returns>\n        public static IEnumerable<DateTime> DateTimeRange(DateTime from, DateTime thru, TimeSpan step)\n        {\n            for (var dateTime = from; dateTime <= thru; dateTime = dateTime.Add(step))\n                yield return dateTime;\n        }\n\n        /// <summary>\n        /// Define an enumerable date range and return each date as a datetime object in the date range\n        /// </summary>\n        /// <param name=\"from\">DateTime start date</param>\n        /// <param name=\"thru\">DateTime end date</param>\n        /// <returns>Enumerable date range</returns>\n        public static IEnumerable<DateTime> EachDay(DateTime from, DateTime thru)\n        {\n            return DateTimeRange(from.Date, thru.Date, TimeSpan.FromDays(1));\n        }\n\n\n        /// <summary>\n        /// Define an enumerable date range of tradeable dates - skip the holidays and weekends when securities in this algorithm don't trade.\n        /// </summary>\n        /// <param name=\"securities\">Securities we have in portfolio</param>\n        /// <param name=\"from\">Start date</param>\n        /// <param name=\"thru\">End date</param>\n        /// <returns>Enumerable date range</returns>\n        public static IEnumerable<DateTime> EachTradeableDay(ICollection<Security> securities, DateTime from, DateTime thru)\n        {\n            for (var day = from.Date; day.Date <= thru.Date; day = day.AddDays(1))\n            {\n                if (TradableDate(securities, day))\n                {\n                    yield return day;\n                }\n            }\n        }\n\n\n        /// <summary>\n        /// Define an enumerable date range of tradeable dates - skip the holidays and weekends when securities in this algorithm don't trade.\n        /// </summary>\n        /// <param name=\"security\">The security to get tradeable dates for</param>\n        /// <param name=\"from\">Start date</param>\n        /// <param name=\"thru\">End date</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>Enumerable date range</returns>\n        public static IEnumerable<DateTime> EachTradeableDay(Security security, DateTime from, DateTime thru, bool extendedMarketHours = false)\n        {\n            return EachTradeableDay(security.Exchange.Hours, from, thru, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Define an enumerable date range of tradeable dates - skip the holidays and weekends when securities in this algorithm don't trade.\n        /// </summary>\n        /// <param name=\"exchange\">The security to get tradeable dates for</param>\n        /// <param name=\"from\">Start date</param>\n        /// <param name=\"thru\">End date</param>\n        /// <param name=\"extendedMarketHours\">True to include days with extended market hours only, like sunday for futures</param>\n        /// <returns>Enumerable date range</returns>\n        public static IEnumerable<DateTime> EachTradeableDay(SecurityExchangeHours exchange, DateTime from, DateTime thru, bool extendedMarketHours = false)\n        {\n            for (var day = from.Date; day.Date <= thru.Date; day = day.AddDays(1))\n            {\n                if (exchange.IsDateOpen(day, extendedMarketHours))\n                {\n                    yield return day;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Define an enumerable date range of tradeable dates but expressed in a different time zone.\n        /// </summary>\n        /// <remarks>\n        /// This is mainly used to bridge the gap between exchange time zone and data time zone for file written to disk. The returned\n        /// enumerable of dates is guaranteed to be the same size or longer than those generated via <see cref=\"EachTradeableDay(ICollection{Security},DateTime,DateTime)\"/>\n        /// </remarks>\n        /// <param name=\"exchange\">The exchange hours</param>\n        /// <param name=\"from\">The start time in the exchange time zone</param>\n        /// <param name=\"thru\">The end time in the exchange time zone (inclusive of the final day)</param>\n        /// <param name=\"timeZone\">The timezone to project the dates into (inclusive of the final day)</param>\n        /// <param name=\"includeExtendedMarketHours\">True to include extended market hours trading in the search, false otherwise</param>\n        /// <returns></returns>\n        public static IEnumerable<DateTime> EachTradeableDayInTimeZone(SecurityExchangeHours exchange, DateTime from, DateTime thru, DateTimeZone timeZone, bool includeExtendedMarketHours = true)\n        {\n            var currentExchangeTime = from;\n            thru = thru.Date.AddDays(1); // we want to include the full thru date\n            while (currentExchangeTime < thru)\n            {\n                // take steps of max size of one day in the data time zone\n                var currentInTimeZone = currentExchangeTime.ConvertTo(exchange.TimeZone, timeZone);\n                var currentInTimeZoneEod = currentInTimeZone.Date.AddDays(1);\n\n                var currentExchangeTimeEod = currentInTimeZoneEod.ConvertTo(timeZone, exchange.TimeZone);\n\n                // don't pass the end\n                if (currentExchangeTimeEod > thru)\n                {\n                    currentExchangeTimeEod = thru;\n                }\n\n                // perform market open checks in the exchange time zone\n                if (exchange.IsOpen(currentExchangeTime, currentExchangeTimeEod, includeExtendedMarketHours))\n                {\n                    yield return currentInTimeZone.Date;\n                }\n\n                currentExchangeTime = currentExchangeTimeEod;\n            }\n        }\n\n        /// <summary>\n        /// Make sure this date is not a holiday, or weekend for the securities in this algorithm.\n        /// </summary>\n        /// <param name=\"securities\">Security manager from the algorithm</param>\n        /// <param name=\"day\">DateTime to check if trade-able.</param>\n        /// <returns>True if tradeable date</returns>\n        public static bool TradableDate(IEnumerable<Security> securities, DateTime day)\n        {\n            try\n            {\n                foreach (var security in securities)\n                {\n                    if (security.Exchange.DateIsOpen(day.Date)) return true;\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return false;\n        }\n\n\n        /// <summary>\n        /// Could of the number of tradeable dates within this period.\n        /// </summary>\n        /// <param name=\"securities\">Securities we're trading</param>\n        /// <param name=\"start\">Start of Date Loop</param>\n        /// <param name=\"finish\">End of Date Loop</param>\n        /// <returns>Number of dates</returns>\n        public static int TradeableDates(ICollection<Security> securities, DateTime start, DateTime finish)\n        {\n            var count = 0;\n            Log.Trace(Invariant($\"Time.TradeableDates(): {Messages.Time.SecurityCount(securities.Count)}\"));\n            try\n            {\n                foreach (var day in EachDay(start, finish))\n                {\n                    if (TradableDate(securities, day))\n                    {\n                        count++;\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return count;\n        }\n\n        /// <summary>\n        /// Determines the start time required to produce the requested number of bars and the given size\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange hours used to test for market open hours</param>\n        /// <param name=\"end\">The end time of the last bar over the requested period</param>\n        /// <param name=\"barSize\">The length of each bar</param>\n        /// <param name=\"barCount\">The number of bars requested</param>\n        /// <param name=\"extendedMarketHours\">True to allow extended market hours bars, otherwise false for only normal market hours</param>\n        /// <param name=\"dataTimeZone\">Timezone for this data</param>\n        /// <param name=\"dailyPreciseEndTime\">True if daily strict end times are enabled</param>\n        /// <returns>The start time that would provide the specified number of bars ending at the specified end time, rounded down by the requested bar size</returns>\n        public static DateTime GetStartTimeForTradeBars(SecurityExchangeHours exchangeHours, DateTime end, TimeSpan barSize, int barCount,\n            bool extendedMarketHours, DateTimeZone dataTimeZone, bool dailyPreciseEndTime = false)\n        {\n            if (barSize <= TimeSpan.Zero)\n            {\n                throw new ArgumentException(Messages.Time.InvalidBarSize, nameof(barSize));\n            }\n\n            var current = end;\n            if (dailyPreciseEndTime && barSize == OneDay)\n            {\n                if (\n                    // Round down so that time in the current date (closed) is not accounted for when counting business days\n                    !exchangeHours.IsDateOpen(current) ||\n                    // we round down, because data for today isn't ready/wont pass through current time.\n                    // for example, for equities, current time is 3pm, 1 bar in daily should be yesterdays, today does not count\n                    exchangeHours.GetNextMarketClose(current.Date, extendedMarketHours) > current)\n                {\n                    current = end.RoundDownInTimeZone(barSize, exchangeHours.TimeZone, dataTimeZone);\n                }\n            }\n            else\n            {\n                // need to round down in data timezone because data is stored in this time zone but only if not doing daily resolution or\n                // dailyPreciseEndTime is disabled because if we round down we might include 2 bars when we want 1, for example: say\n                // current is monday 8pm NY, if we round down we get minight monday which will return false as open, so we will return\n                // friday and monday data for daily equity, when we want only monday.\n                current = end.RoundDownInTimeZone(barSize, exchangeHours.TimeZone, dataTimeZone);\n            }\n\n            for (int i = 0; i < barCount;)\n            {\n                var previous = current;\n                current = current - barSize;\n                if (exchangeHours.IsOpen(current, previous, extendedMarketHours))\n                {\n                    i++;\n                }\n            }\n            return current;\n        }\n\n        /// <summary>\n        /// Determines the end time at which the requested number of bars of the given  will have elapsed.\n        /// NOTE: The start time is not discretized by barSize units like is done in <see cref=\"GetStartTimeForTradeBars\"/>\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange hours used to test for market open hours</param>\n        /// <param name=\"start\">The end time of the last bar over the requested period</param>\n        /// <param name=\"barSize\">The length of each bar</param>\n        /// <param name=\"barCount\">The number of bars requested</param>\n        /// <param name=\"extendedMarketHours\">True to allow extended market hours bars, otherwise false for only normal market hours</param>\n        /// <returns>The start time that would provide the specified number of bars ending at the specified end time, rounded down by the requested bar size</returns>\n        public static DateTime GetEndTimeForTradeBars(SecurityExchangeHours exchangeHours, DateTime start, TimeSpan barSize, int barCount, bool extendedMarketHours)\n        {\n            if (barSize <= TimeSpan.Zero)\n            {\n                throw new ArgumentException(Messages.Time.InvalidBarSize, nameof(barSize));\n            }\n\n            var current = start;\n            if (barSize == OneDay)\n            {\n                for (int i = 0; i < barCount;)\n                {\n                    current = current + OneDay;\n                    if (exchangeHours.IsDateOpen(current))\n                    {\n                        i++;\n                    }\n                }\n\n                return current;\n            }\n\n            for (int i = 0; i < barCount;)\n            {\n                var previous = current;\n                current = current + barSize;\n                if (exchangeHours.IsOpen(previous, current, extendedMarketHours))\n                {\n                    i++;\n                }\n            }\n            return current;\n        }\n\n        /// <summary>\n        /// Gets the number of trade bars of the specified <paramref name=\"barSize\"/> that fit between the <paramref name=\"start\"/> and <paramref name=\"end\"/>\n        /// </summary>\n        /// <param name=\"exchangeHours\">The exchange used to test for market open hours</param>\n        /// <param name=\"start\">The start time of the interval in the exchange time zone</param>\n        /// <param name=\"end\">The end time of the interval in the exchange time zone</param>\n        /// <param name=\"barSize\">The step size used to count number of bars between start and end</param>\n        /// <returns>The number of bars of the specified size between start and end times</returns>\n        public static int GetNumberOfTradeBarsInInterval(SecurityExchangeHours exchangeHours, DateTime start, DateTime end, TimeSpan barSize)\n        {\n            if (barSize <= TimeSpan.Zero)\n            {\n                throw new ArgumentException(Messages.Time.InvalidBarSize, nameof(barSize));\n            }\n\n            var count = 0;\n            var current = start;\n            if (barSize == OneDay)\n            {\n                while (current < end)\n                {\n                    if (exchangeHours.IsDateOpen(current))\n                    {\n                        count++;\n                    }\n\n                    current = current + OneDay;\n                }\n\n                return count;\n            }\n\n            while (current < end)\n            {\n                var previous = current;\n                current = current + barSize;\n                if (exchangeHours.IsOpen(previous, current, false))\n                {\n                    count++;\n                }\n            }\n\n            return count;\n        }\n\n        /// <summary>\n        /// Normalizes the current time within the specified period\n        /// time = start => 0\n        /// time = start + period => 1\n        /// </summary>\n        /// <param name=\"start\">The start time of the range</param>\n        /// <param name=\"current\">The current time we seek to normalize</param>\n        /// <param name=\"period\">The time span of the range</param>\n        /// <returns>The normalized time</returns>\n        public static double NormalizeInstantWithinRange(DateTime start, DateTime current, TimeSpan period)\n        {\n            // normalization of a point time only has a value at that specific point\n            if (period == TimeSpan.Zero)\n            {\n                return start == current ? 1 : 0;\n            }\n\n            var delta = (current - start).TotalSeconds;\n            return delta / period.TotalSeconds;\n        }\n\n        /// <summary>\n        /// Normalizes the step size as a percentage of the period.\n        /// </summary>\n        /// <param name=\"period\">The period to normalize against</param>\n        /// <param name=\"stepSize\">The step size to be normaized</param>\n        /// <returns>The normalized step size as a percentage of the period</returns>\n        public static double NormalizeTimeStep(TimeSpan period, TimeSpan stepSize)\n        {\n            // normalization of a time step for an instantaneous period will always be zero\n            if (period == TimeSpan.Zero)\n            {\n                return 0;\n            }\n\n            return stepSize.TotalSeconds / period.TotalSeconds;\n        }\n\n        /// <summary>\n        /// Gets the absolute value of the specified time span\n        /// </summary>\n        /// <param name=\"timeSpan\">Time span whose absolute value we seek</param>\n        /// <returns>The absolute value of the specified time span</returns>\n        public static TimeSpan Abs(this TimeSpan timeSpan)\n        {\n            return TimeSpan.FromTicks(Math.Abs(timeSpan.Ticks));\n        }\n\n        /// <summary>\n        /// Helper method to deserialize month/year\n        /// </summary>\n        public class MonthYearJsonConverter : IsoDateTimeConverter\n        {\n            /// <summary>\n            /// Creates a new instance\n            /// </summary>\n            public MonthYearJsonConverter()\n            {\n                DateTimeFormat = @\"MM/yy\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/TimeKeeper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides a means of centralizing time for various time zones.\n    /// </summary>\n    public class TimeKeeper : ITimeKeeper\n    {\n        private DateTime _utcDateTime;\n\n        private readonly Dictionary<string, LocalTimeKeeper> _localTimeKeepers;\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        public DateTime UtcTime\n        {\n            get { return _utcDateTime; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeKeeper\"/> class at the specified\n        /// UTC time and for the specified time zones. Each time zone specified will cause the\n        /// creation of a <see cref=\"LocalTimeKeeper\"/> to handle conversions for that time zone.\n        /// </summary>\n        /// <param name=\"utcDateTime\">The initial time</param>\n        /// <param name=\"timeZones\">The time zones used to instantiate <see cref=\"LocalTimeKeeper\"/> instances.</param>\n        public TimeKeeper(DateTime utcDateTime, params DateTimeZone[] timeZones)\n            : this(utcDateTime, timeZones ?? Enumerable.Empty<DateTimeZone>())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeKeeper\"/> class at the specified\n        /// UTC time and for the specified time zones. Each time zone specified will cause the\n        /// creation of a <see cref=\"LocalTimeKeeper\"/> to handle conversions for that time zone.\n        /// </summary>\n        /// <param name=\"utcDateTime\">The initial time</param>\n        /// <param name=\"timeZones\">The time zones used to instantiate <see cref=\"LocalTimeKeeper\"/> instances.</param>\n        public TimeKeeper(DateTime utcDateTime, IEnumerable<DateTimeZone> timeZones)\n        {\n            _utcDateTime = utcDateTime;\n            _localTimeKeepers = timeZones.Distinct().Select(x => new LocalTimeKeeper(utcDateTime, x)).ToDictionary(x => x.TimeZone.Id);\n        }\n\n        /// <summary>\n        /// Sets the current UTC time for this time keeper and the attached child <see cref=\"LocalTimeKeeper\"/> instances.\n        /// </summary>\n        /// <param name=\"utcDateTime\">The current time in UTC</param>\n        public virtual void SetUtcDateTime(DateTime utcDateTime)\n        {\n            _utcDateTime = utcDateTime;\n            foreach (var timeZone in _localTimeKeepers)\n            {\n                timeZone.Value.UpdateTime(utcDateTime);\n            }\n        }\n\n        /// <summary>\n        /// Gets the local time in the specified time zone. If the specified <see cref=\"DateTimeZone\"/>\n        /// has not already been added, this will throw a <see cref=\"KeyNotFoundException\"/>.\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone to get local time for</param>\n        /// <returns>The local time in the specifed time zone</returns>\n        public DateTime GetTimeIn(DateTimeZone timeZone)\n        {\n            return GetLocalTimeKeeper(timeZone).LocalTime;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"LocalTimeKeeper\"/> instance for the specified time zone\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone whose <see cref=\"LocalTimeKeeper\"/> we seek</param>\n        /// <returns>The <see cref=\"LocalTimeKeeper\"/> instance for the specified time zone</returns>\n        public LocalTimeKeeper GetLocalTimeKeeper(DateTimeZone timeZone)\n        {\n            LocalTimeKeeper localTimeKeeper;\n            if (!_localTimeKeepers.TryGetValue(timeZone.Id, out localTimeKeeper))\n            {\n                localTimeKeeper = new LocalTimeKeeper(UtcTime, timeZone);\n                _localTimeKeepers[timeZone.Id] = localTimeKeeper;\n            }\n            return localTimeKeeper;\n        }\n\n        /// <summary>\n        /// Adds the specified time zone to this time keeper\n        /// </summary>\n        /// <param name=\"timeZone\"></param>\n        public void AddTimeZone(DateTimeZone timeZone)\n        {\n            if (!_localTimeKeepers.ContainsKey(timeZone.Id))\n            {\n                _localTimeKeepers[timeZone.Id] = new LocalTimeKeeper(_utcDateTime, timeZone);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/TimeUpdatedEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Event arguments class for the <see cref=\"LocalTimeKeeper.TimeUpdated\"/> event\n    /// </summary>\n    public sealed class TimeUpdatedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the new time\n        /// </summary>\n        public DateTime Time { get; init; }\n\n        /// <summary>\n        /// Gets the time zone\n        /// </summary>\n        public DateTimeZone TimeZone { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeUpdatedEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"time\">The newly updated time</param>\n        /// <param name=\"timeZone\">The time zone of the new time</param>\n        public TimeUpdatedEventArgs(DateTime time, DateTimeZone timeZone)\n        {\n            Time = time;\n            TimeZone = timeZone;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/TimeZoneOffsetProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing NodaTime;\nusing NodaTime.TimeZones;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Represents the discontinuties in a single time zone and provides offsets to UTC.\n    /// This type assumes that times will be asked in a forward marching manner.\n    /// This type is not thread safe.\n    /// </summary>\n    public class TimeZoneOffsetProvider\n    {\n        private static readonly long DateTimeMaxValueTicks = DateTime.MaxValue.Ticks;\n\n        private long _nextDiscontinuity;\n        private long _currentOffsetTicks;\n        private readonly DateTimeZone _timeZone;\n        private readonly Queue<long> _discontinuities;\n\n        /// <summary>\n        /// Gets the time zone this instances provides offsets for\n        /// </summary>\n        public DateTimeZone TimeZone\n        {\n            get { return _timeZone; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeZoneOffsetProvider\"/> class\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone to provide offsets for</param>\n        /// <param name=\"utcStartTime\">The start of the range of offsets.\n        /// Careful here, it will determine the current discontinuity offset value. When requested to convert a date we only look forward for new discontinuities\n        /// but we suppose the current offset is correct for the requested date if in the past.</param>\n        /// <param name=\"utcEndTime\">The end of the range of offsets</param>\n        public TimeZoneOffsetProvider(DateTimeZone timeZone, DateTime utcStartTime, DateTime utcEndTime)\n        {\n            _timeZone = timeZone;\n\n            // pad the end so we get the correct zone interval\n            utcEndTime += TimeSpan.FromDays(2*365);\n\n            var start = DateTimeZone.Utc.AtLeniently(LocalDateTime.FromDateTime(utcStartTime));\n            var end = DateTimeZone.Utc.AtLeniently(LocalDateTime.FromDateTime(utcEndTime));\n            var zoneIntervals = _timeZone.GetZoneIntervals(start.ToInstant(), end.ToInstant()).ToList();\n\n            // In NodaTime v3.0.5, ZoneInterval throws if `ZoneInterval.HasStart` is false and `ZoneInterval.Start` is called.\n            // short circuit time zones with no discontinuities\n            if (zoneIntervals.Count == 1 && zoneIntervals[0].HasStart && zoneIntervals[0].Start == Instant.MinValue && zoneIntervals[0].End == Instant.MaxValue)\n            {\n                // end of discontinuities\n                _discontinuities = new Queue<long>();\n                _nextDiscontinuity = DateTime.MaxValue.Ticks;\n                _currentOffsetTicks = _timeZone.GetUtcOffset(Instant.FromDateTimeUtc(DateTime.UtcNow)).Ticks;\n            }\n            else\n            {\n                // get the offset just before the next discontinuity to initialize\n                _discontinuities = new Queue<long>(zoneIntervals.Select(GetDateTimeUtcTicks));\n                _nextDiscontinuity = _discontinuities.Dequeue();\n                _currentOffsetTicks = _timeZone.GetUtcOffset(Instant.FromDateTimeUtc(new DateTime(_nextDiscontinuity - 1, DateTimeKind.Utc))).Ticks;\n            }\n        }\n\n        /// <summary>\n        /// Gets the offset in ticks from this time zone to UTC, such that UTC time + offset = local time\n        /// </summary>\n        /// <param name=\"utcTime\">The time in UTC to get an offset to local</param>\n        /// <returns>The offset in ticks between UTC and the local time zone</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public long GetOffsetTicks(DateTime utcTime)\n        {\n            // keep advancing our discontinuity until the requested time, don't recompute if already at max value\n            while (utcTime.Ticks >= _nextDiscontinuity && _nextDiscontinuity != DateTimeMaxValueTicks)\n            {\n                // grab the next discontinuity\n                _nextDiscontinuity = _discontinuities.Count == 0\n                    ? DateTime.MaxValue.Ticks\n                    : _discontinuities.Dequeue();\n\n                // get the offset just before the next discontinuity\n                var offset = _timeZone.GetUtcOffset(Instant.FromDateTimeUtc(new DateTime(_nextDiscontinuity - 1, DateTimeKind.Utc)));\n                _currentOffsetTicks = offset.Ticks;\n            }\n\n            return _currentOffsetTicks;\n        }\n\n        /// <summary>\n        /// Converts the specified local time to UTC. This function will advance this offset provider\n        /// </summary>\n        /// <param name=\"localTime\">The local time to be converted to UTC</param>\n        /// <returns>The specified time in UTC</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public DateTime ConvertToUtc(DateTime localTime)\n        {\n            // it's important to walk forward to the next time zone discontinuity\n            // to ensure a deterministic read. We continue reading with the current\n            // offset until the converted value is beyond the next discontinuity, at\n            // which time we advance the offset again.\n            var currentEndTimeTicks = localTime.Ticks;\n            var currentEndTimeUtc = new DateTime(currentEndTimeTicks - _currentOffsetTicks);\n            var offsetTicks = GetOffsetTicks(currentEndTimeUtc);\n            var emitTimeUtcTicks = currentEndTimeTicks - offsetTicks;\n            while (emitTimeUtcTicks > _nextDiscontinuity)\n            {\n                // advance to the next discontinuity to get the new offset\n                offsetTicks = GetOffsetTicks(new DateTime(_nextDiscontinuity));\n                emitTimeUtcTicks = currentEndTimeTicks - offsetTicks;\n            }\n\n            return new DateTime(emitTimeUtcTicks);\n        }\n\n        /// <summary>\n        /// Gets this offset provider's next discontinuity\n        /// </summary>\n        /// <returns>The next discontinuity in UTC ticks</returns>\n        public long GetNextDiscontinuity()\n        {\n            return _nextDiscontinuity;\n        }\n\n        /// <summary>\n        /// Converts the specified <paramref name=\"utcTime\"/> using the offset resolved from\n        /// a call to <see cref=\"GetOffsetTicks\"/>\n        /// </summary>\n        /// <param name=\"utcTime\">The time to convert from utc</param>\n        /// <returns>The same instant in time represented in the <see cref=\"TimeZone\"/></returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public virtual DateTime ConvertFromUtc(DateTime utcTime)\n        {\n            return new DateTime(utcTime.Ticks + GetOffsetTicks(utcTime));\n        }\n\n        /// <summary>\n        /// Gets the zone interval's start time in DateTimeKind.Utc ticks\n        /// </summary>\n        private static long GetDateTimeUtcTicks(ZoneInterval zoneInterval)\n        {\n            // can't convert these values directly to date times, so just shortcut these here\n            // we set the min value to one since the logic in the ctor will decrement this value to\n            // determine the last instant BEFORE the discontinuity\n            if (!zoneInterval.HasStart || zoneInterval.Start == Instant.MinValue) return 1;\n            if (zoneInterval.HasStart && zoneInterval.Start == Instant.MaxValue) return DateTime.MaxValue.Ticks;\n            if (zoneInterval.HasStart) return zoneInterval.Start.ToDateTimeUtc().Ticks;\n\n            return 1;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/TimeZones.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides access to common time zones\n    /// </summary>\n    public static class TimeZones\n    {\n        /// <summary>\n        /// Gets the Universal Coordinated time zone.\n        /// </summary>\n        public static readonly DateTimeZone Utc = DateTimeZone.Utc;\n\n        /// <summary>\n        /// Gets the time zone for New York City, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone NewYork = DateTimeZoneProviders.Tzdb[\"America/New_York\"];\n\n        /// <summary>\n        /// Get the Eastern Standard Time (EST) WITHOUT daylight savings, this is a constant -5 hour offset\n        /// </summary>\n        public static readonly DateTimeZone EasternStandard = DateTimeZoneProviders.Tzdb[\"UTC-05\"];\n\n        /// <summary>\n        /// Gets the time zone for London, England. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone London = DateTimeZoneProviders.Tzdb[\"Europe/London\"];\n\n        /// <summary>\n        /// Gets the time zone for Hong Kong, China.\n        /// </summary>\n        public static readonly DateTimeZone HongKong = DateTimeZoneProviders.Tzdb[\"Asia/Hong_Kong\"];\n\n        /// <summary>\n        /// Gets the time zone for Tokyo, Japan.\n        /// </summary>\n        public static readonly DateTimeZone Tokyo = DateTimeZoneProviders.Tzdb[\"Asia/Tokyo\"];\n\n        /// <summary>\n        /// Gets the time zone for Rome, Italy. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Rome = DateTimeZoneProviders.Tzdb[\"Europe/Rome\"];\n\n        /// <summary>\n        /// Gets the time zone for Sydney, Australia. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Sydney = DateTimeZoneProviders.Tzdb[\"Australia/Sydney\"];\n\n        /// <summary>\n        /// Gets the time zone for Vancouver, Canada.\n        /// </summary>\n        public static readonly DateTimeZone Vancouver = DateTimeZoneProviders.Tzdb[\"America/Vancouver\"];\n\n        /// <summary>\n        /// Gets the time zone for Toronto, Canada. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Toronto = DateTimeZoneProviders.Tzdb[\"America/Toronto\"];\n\n        /// <summary>\n        /// Gets the time zone for Chicago, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Chicago = DateTimeZoneProviders.Tzdb[\"America/Chicago\"];\n\n        /// <summary>\n        /// Gets the time zone for Los Angeles, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone LosAngeles = DateTimeZoneProviders.Tzdb[\"America/Los_Angeles\"];\n\n        /// <summary>\n        /// Gets the time zone for Phoenix, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Phoenix = DateTimeZoneProviders.Tzdb[\"America/Phoenix\"];\n\n        /// <summary>\n        /// Gets the time zone for Auckland, New Zealand. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Auckland = DateTimeZoneProviders.Tzdb[\"Pacific/Auckland\"];\n\n        /// <summary>\n        /// Gets the time zone for Moscow, Russia.\n        /// </summary>\n        public static readonly DateTimeZone Moscow = DateTimeZoneProviders.Tzdb[\"Europe/Moscow\"];\n\n        /// <summary>\n        /// Gets the time zone for Madrid, Span. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Madrid = DateTimeZoneProviders.Tzdb[\"Europe/Madrid\"];\n\n        /// <summary>\n        /// Gets the time zone for Buenos Aires, Argentia.\n        /// </summary>\n        public static readonly DateTimeZone BuenosAires = DateTimeZoneProviders.Tzdb[\"America/Argentina/Buenos_Aires\"];\n\n        /// <summary>\n        /// Gets the time zone for Brisbane, Australia.\n        /// </summary>\n        public static readonly DateTimeZone Brisbane = DateTimeZoneProviders.Tzdb[\"Australia/Brisbane\"];\n\n        /// <summary>\n        /// Gets the time zone for Sao Paulo, Brazil. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone SaoPaulo = DateTimeZoneProviders.Tzdb[\"America/Sao_Paulo\"];\n\n        /// <summary>\n        /// Gets the time zone for Cairo, Egypt.\n        /// </summary>\n        public static readonly DateTimeZone Cairo = DateTimeZoneProviders.Tzdb[\"Africa/Cairo\"];\n\n        /// <summary>\n        /// Gets the time zone for Johannesburg, South Africa.\n        /// </summary>\n        public static readonly DateTimeZone Johannesburg = DateTimeZoneProviders.Tzdb[\"Africa/Johannesburg\"];\n\n        /// <summary>\n        /// Gets the time zone for Anchorage, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Anchorage = DateTimeZoneProviders.Tzdb[\"America/Anchorage\"];\n\n        /// <summary>\n        /// Gets the time zone for Denver, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Denver = DateTimeZoneProviders.Tzdb[\"America/Denver\"];\n\n        /// <summary>\n        /// Gets the time zone for Detroit, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Detroit = DateTimeZoneProviders.Tzdb[\"America/Detroit\"];\n\n        /// <summary>\n        /// Gets the time zone for Mexico City, Mexico. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone MexicoCity = DateTimeZoneProviders.Tzdb[\"America/Mexico_City\"];\n\n        /// <summary>\n        /// Gets the time zone for Jerusalem, Israel. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Jerusalem = DateTimeZoneProviders.Tzdb[\"Asia/Jerusalem\"];\n\n        /// <summary>\n        /// Gets the time zone for Shanghai, China.\n        /// </summary>\n        public static readonly DateTimeZone Shanghai = DateTimeZoneProviders.Tzdb[\"Asia/Shanghai\"];\n\n        /// <summary>\n        /// Gets the time zone for Melbourne, Australia. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Melbourne = DateTimeZoneProviders.Tzdb[\"Australia/Melbourne\"];\n\n        /// <summary>\n        /// Gets the time zone for Amsterdam, Netherlands. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Amsterdam = DateTimeZoneProviders.Tzdb[\"Europe/Amsterdam\"];\n\n        /// <summary>\n        /// Gets the time zone for Athens, Greece. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Athens = DateTimeZoneProviders.Tzdb[\"Europe/Athens\"];\n\n        /// <summary>\n        /// Gets the time zone for Berlin, Germany. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Berlin = DateTimeZoneProviders.Tzdb[\"Europe/Berlin\"];\n\n        /// <summary>\n        /// Gets the time zone for Bucharest, Romania. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Bucharest = DateTimeZoneProviders.Tzdb[\"Europe/Bucharest\"];\n\n        /// <summary>\n        /// Gets the time zone for Dublin, Ireland. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Dublin = DateTimeZoneProviders.Tzdb[\"Europe/Dublin\"];\n\n        /// <summary>\n        /// Gets the time zone for Helsinki, Finland. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Helsinki = DateTimeZoneProviders.Tzdb[\"Europe/Helsinki\"];\n\n        /// <summary>\n        /// Gets the time zone for Istanbul, Turkey. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Istanbul = DateTimeZoneProviders.Tzdb[\"Europe/Istanbul\"];\n\n        /// <summary>\n        /// Gets the time zone for Minsk, Belarus.\n        /// </summary>\n        public static readonly DateTimeZone Minsk = DateTimeZoneProviders.Tzdb[\"Europe/Minsk\"];\n\n        /// <summary>\n        /// Gets the time zone for Paris, France. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Paris = DateTimeZoneProviders.Tzdb[\"Europe/Paris\"];\n\n        /// <summary>\n        /// Gets the time zone for Zurich, Switzerland. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Zurich = DateTimeZoneProviders.Tzdb[\"Europe/Zurich\"];\n\n        /// <summary>\n        /// Gets the time zone for Honolulu, USA. This is a daylight savings time zone.\n        /// </summary>\n        public static readonly DateTimeZone Honolulu = DateTimeZoneProviders.Tzdb[\"Pacific/Honolulu\"];\n\n        /// <summary>\n        /// Gets the time zone for Kolkata, India.\n        /// </summary>\n        public static readonly DateTimeZone Kolkata = DateTimeZoneProviders.Tzdb[\"Asia/Kolkata\"];\n    }\n}\n"
  },
  {
    "path": "Common/TradingCalendar.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing QLNet;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Class represents trading calendar, populated with variety of events relevant to currently trading instruments\n    /// </summary>\n    public class TradingCalendar\n    {\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n        private readonly SecurityManager _securityManager;\n\n        /// <summary>\n        /// Initialize a new <see cref=\"TradingCalendar\"/> instance.\n        /// </summary>\n        /// <param name=\"securityManager\">SecurityManager for this calendar</param>\n        /// <param name=\"marketHoursDatabase\">MarketHoursDatabase for this calendar</param>\n        public TradingCalendar(SecurityManager securityManager, MarketHoursDatabase marketHoursDatabase)\n        {\n            _securityManager = securityManager;\n            _marketHoursDatabase = marketHoursDatabase;\n        }\n        /// <summary>\n        /// Method returns <see cref=\"TradingDay\"/> that contains trading events associated with today's date\n        /// </summary>\n        /// <returns>Populated instance of <see cref=\"TradingDay\"/></returns>\n        public TradingDay GetTradingDay()\n        {\n            var today = _securityManager.UtcTime.Date;\n\n            return GetTradingDay(today);\n        }\n\n        /// <summary>\n        /// Method returns <see cref=\"TradingDay\"/> that contains trading events associated with the given date\n        /// </summary>\n        /// <returns>Populated instance of <see cref=\"TradingDay\"/></returns>\n        public TradingDay GetTradingDay(DateTime day)\n        {\n            return GetTradingDays(day, day).First();\n        }\n\n        /// <summary>\n        /// Method returns <see cref=\"TradingDay\"/> that contains trading events associated with the range of dates\n        /// </summary>\n        /// <param name=\"start\">Start date of the range (inclusive)</param>\n        /// <param name=\"end\">End date of the range (inclusive)</param>\n        /// <returns>>Populated list of <see cref=\"TradingDay\"/></returns>\n        public IEnumerable<TradingDay> GetTradingDays(DateTime start, DateTime end)\n        {\n            return PopulateTradingDays(start, end);\n        }\n\n        /// <summary>\n        /// Method returns <see cref=\"TradingDay\"/> of the specified type (<see cref=\"TradingDayType\"/>) that contains trading events associated with the range of dates\n        /// </summary>\n        /// <param name=\"type\">Type of the events</param>\n        /// <param name=\"start\">Start date of the range (inclusive)</param>\n        /// <param name=\"end\">End date of the range (inclusive)</param>\n        /// <returns>>Populated list of <see cref=\"TradingDay\"/></returns>\n        public IEnumerable<TradingDay> GetDaysByType(TradingDayType type, DateTime start, DateTime end)\n        {\n            Func<TradingDay, bool> typeFilter = day =>\n                {\n                    switch (type)\n                    {\n                        case TradingDayType.BusinessDay:\n                            return day.BusinessDay;\n                        case TradingDayType.PublicHoliday:\n                            return day.PublicHoliday;\n                        case TradingDayType.Weekend:\n                            return day.Weekend;\n                        case TradingDayType.OptionExpiration:\n                            return day.OptionExpirations.Any();\n                        case TradingDayType.FutureExpiration:\n                            return day.FutureExpirations.Any();\n                        case TradingDayType.FutureRoll:\n                            return day.FutureRolls.Any();\n                        case TradingDayType.SymbolDelisting:\n                            return day.SymbolDelistings.Any();\n                        case TradingDayType.EquityDividends:\n                            return day.EquityDividends.Any();\n                    };\n                    return false;\n                };\n            return GetTradingDays(start, end).Where(typeFilter);\n        }\n\n\n        private IEnumerable<TradingDay> PopulateTradingDays(DateTime start, DateTime end)\n        {\n            var symbols = _securityManager.Keys;\n\n            var holidays = new HashSet<DateTime>();\n            foreach (var symbol in symbols)\n            {\n                var entry = _marketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n\n                foreach (var holiday in entry.ExchangeHours.Holidays)\n                {\n                    holidays.Add(holiday.Date);\n                }\n            }\n\n            var qlCalendar = new UnitedStates();\n            var options = symbols.Where(x => x.ID.SecurityType.IsOption()).ToList();\n            var futures = symbols.Where(x => x.ID.SecurityType == SecurityType.Future).ToList();\n\n            var totalDays = (int)(end.Date.AddDays(1.0) - start.Date).TotalDays;\n            if (totalDays < 0)\n            {\n                throw new ArgumentException($\"TradingCalendar.PopulateTradingDays(): {Messages.TradingCalendar.InvalidTotalDays(totalDays)}\");\n            }\n\n            foreach (var dayIdx in Enumerable.Range(0, totalDays))\n            {\n                var currentDate = start.Date.AddDays(dayIdx);\n\n                var publicHoliday = holidays.Contains(currentDate) || !qlCalendar.isBusinessDay(currentDate);\n                var weekend = currentDate.DayOfWeek == DayOfWeek.Sunday ||\n                                currentDate.DayOfWeek == DayOfWeek.Saturday;\n                var businessDay = !publicHoliday && !weekend;\n\n                yield return\n                    new TradingDay\n                    {\n                        Date = currentDate,\n                        PublicHoliday = publicHoliday,\n                        Weekend = weekend,\n                        BusinessDay = businessDay,\n                        OptionExpirations = options.Where(x => x.ID.Date.Date == currentDate),\n                        FutureExpirations = futures.Where(x => x.ID.Date.Date == currentDate)\n                    };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/TradingDay.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Enum lists available trading events\n    /// </summary>\n    public enum TradingDayType\n    {\n        /// <summary>\n        /// Business day (0)\n        /// </summary>\n        BusinessDay,\n\n        /// <summary>\n        /// Public Holiday (1)\n        /// </summary>\n        PublicHoliday,\n\n        /// <summary>\n        /// Weekend (2)\n        /// </summary>\n        Weekend,\n\n        /// <summary>\n        /// Option Expiration Date (3)\n        /// </summary>\n        OptionExpiration,\n\n        /// <summary>\n        /// Futures Expiration Date (4)\n        /// </summary>\n        FutureExpiration,\n\n        /// <summary>\n        /// Futures Roll Date (5)\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        FutureRoll,\n\n        /// <summary>\n        /// Symbol Delisting Date (6)\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        SymbolDelisting,\n\n        /// <summary>\n        /// Equity Ex-dividend Date (7)\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        EquityDividends,\n\n        /// <summary>\n        /// FX Economic Event (8)\n        /// </summary>\n        /// <remarks>FX Economic Event e.g. from DailyFx (DailyFx.cs). Not used yet. For future use.</remarks>\n        EconomicEvent\n    }\n\n    /// <summary>\n    /// Class contains trading events associated with particular day in <see cref=\"TradingCalendar\"/>\n    /// </summary>\n    public class TradingDay\n    {\n        /// <summary>\n        /// The date that this instance is associated with\n        /// </summary>\n        public DateTime Date { get; internal set; }\n\n        /// <summary>\n        /// Property returns true, if the day is a business day\n        /// </summary>\n        public bool BusinessDay { get; internal set; }\n\n        /// <summary>\n        /// Property returns true, if the day is a public holiday\n        /// </summary>\n        public bool PublicHoliday { get; internal set; }\n\n        /// <summary>\n        /// Property returns true, if the day is a weekend\n        /// </summary>\n        public bool Weekend { get; internal set; }\n\n        /// <summary>\n        /// Property returns the list of options (among currently traded) that expire on this day\n        /// </summary>\n        public IEnumerable<Symbol> OptionExpirations { get; internal set; }\n\n        /// <summary>\n        /// Property returns the list of futures (among currently traded) that expire on this day\n        /// </summary>\n        public IEnumerable<Symbol> FutureExpirations { get; internal set; }\n\n        /// <summary>\n        /// Property returns the list of futures (among currently traded) that roll forward on this day\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        public IEnumerable<Symbol> FutureRolls { get; internal set; }\n\n        /// <summary>\n        /// Property returns the list of symbols (among currently traded) that are delisted on this day\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        public IEnumerable<Symbol> SymbolDelistings { get; internal set; }\n\n        /// <summary>\n        /// Property returns the list of symbols (among currently traded) that have ex-dividend date on this day\n        /// </summary>\n        /// <remarks>Not used yet. For future use.</remarks>\n        public IEnumerable<Symbol> EquityDividends { get; internal set; }\n    }\n}\n"
  },
  {
    "path": "Common/Util/BaseExtendedDictionary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect;\nusing QuantConnect.Python;\n\nnamespace Common.Util\n{\n    /// <summary>\n    /// Provides a generic implementation of ExtendedDictionary with specific dictionary type\n    /// </summary>\n    [PandasNonExpandable]\n    public class BaseExtendedDictionary<TKey, TValue, TDictionary> : ExtendedDictionary<TKey, TValue>, IDictionary<TKey, TValue>\n        where TDictionary : IDictionary<TKey, TValue>, new()\n    {\n        /// <summary>\n        /// The dictionary instance\n        /// </summary>\n        protected TDictionary Dictionary { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class that is empty\n        /// </summary>\n        public BaseExtendedDictionary()\n        {\n            Dictionary = new TDictionary();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class that contains elements copied from the specified dictionary\n        /// </summary>\n        /// <param name=\"dictionary\">The dictionary whose elements are copied to the new dictionary</param>\n        public BaseExtendedDictionary(TDictionary dictionary)\n        {\n            Dictionary = dictionary;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class\n        /// using the specified <paramref name=\"data\"/> as a data source\n        /// </summary>\n        /// <param name=\"data\">The data source for this dictionary</param>\n        /// <param name=\"keySelector\">Delegate used to select a key from the value</param>\n        public BaseExtendedDictionary(IEnumerable<TValue> data, Func<TValue, TKey> keySelector)\n            : this()\n        {\n            foreach (var datum in data)\n            {\n                Dictionary[keySelector(datum)] = datum;\n            }\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the dictionary\n        /// </summary>\n        public override int Count => Dictionary.Count;\n\n        /// <summary>\n        /// Gets a value indicating whether the dictionary is read-only\n        /// </summary>\n        public override bool IsReadOnly => Dictionary.IsReadOnly;\n\n        /// <summary>\n        /// Gets the value associated with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key whose value to get</param>\n        /// <param name=\"value\">When this method returns, the value associated with the specified key</param>\n        /// <returns>true if the key was found; otherwise, false</returns>\n        public override bool TryGetValue(TKey key, out TValue value)\n        {\n            return Dictionary.TryGetValue(key, out value);\n        }\n\n        /// <summary>\n        /// Gets all the items in the dictionary\n        /// </summary>\n        /// <returns>All the items in the dictionary</returns>\n        public override IEnumerable<KeyValuePair<TKey, TValue>> GetItems()\n        {\n            return Dictionary;\n        }\n\n        /// <summary>\n        /// Gets a collection containing the keys in the dictionary\n        /// </summary>\n        protected override IEnumerable<TKey> GetKeys => Dictionary.Keys;\n\n        /// <summary>\n        /// Gets a collection containing the values in the dictionary\n        /// </summary>\n        protected override IEnumerable<TValue> GetValues => Dictionary.Values;\n\n        /// <summary>\n        /// Gets a collection containing the keys of the dictionary\n        /// </summary>\n        public virtual ICollection<TKey> Keys => Dictionary.Keys;\n\n        /// <summary>\n        /// Gets a collection containing the values of the dictionary\n        /// </summary>\n        public virtual ICollection<TValue> Values => Dictionary.Values;\n\n        /// <summary>\n        /// Gets or sets the value associated with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key of the value to get or set</param>\n        /// <returns>The value associated with the specified key</returns>\n        public override TValue this[TKey key]\n        {\n            get => Dictionary[key];\n            set => Dictionary[key] = value;\n        }\n\n        /// <summary>\n        /// Removes all items from the dictionary\n        /// </summary>\n        public override void Clear()\n        {\n            Dictionary.Clear();\n        }\n\n        /// <summary>\n        /// Removes the value with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key of the element to remove</param>\n        /// <returns>true if the element was successfully found and removed; otherwise, false</returns>\n        public override bool Remove(TKey key)\n        {\n            return Dictionary.Remove(key);\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key and value to the dictionary\n        /// </summary>\n        /// <param name=\"key\">The key of the element to add</param>\n        /// <param name=\"value\">The value of the element to add</param>\n        public virtual void Add(TKey key, TValue value)\n        {\n            Dictionary.Add(key, value);\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key-value pair to the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to add</param>\n        public virtual void Add(KeyValuePair<TKey, TValue> item)\n        {\n            Dictionary.Add(item);\n        }\n\n        /// <summary>\n        /// Determines whether the dictionary contains the specified key\n        /// </summary>\n        /// <param name=\"key\">The key to locate in the dictionary</param>\n        /// <returns>true if the dictionary contains an element with the specified key; otherwise, false</returns>\n        public override bool ContainsKey(TKey key)\n        {\n            return Dictionary.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Determines whether the dictionary contains a specific key-value pair\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to locate</param>\n        /// <returns>true if the key-value pair was found; otherwise, false</returns>\n        public virtual bool Contains(KeyValuePair<TKey, TValue> item)\n        {\n            return Dictionary.Contains(item);\n        }\n\n        /// <summary>\n        /// Copies the elements of the dictionary to an array, starting at a particular array index\n        /// </summary>\n        /// <param name=\"array\">The array to copy to</param>\n        /// <param name=\"arrayIndex\">The starting index in the array</param>\n        public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)\n        {\n            Dictionary.CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to remove</param>\n        /// <returns>true if the key-value pair was successfully removed; otherwise, false</returns>\n        public virtual bool Remove(KeyValuePair<TKey, TValue> item)\n        {\n            return Dictionary.Remove(item);\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the dictionary\n        /// </summary>\n        /// <returns>An enumerator for the dictionary</returns>\n        public virtual IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()\n        {\n            return Dictionary.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the dictionary\n        /// </summary>\n        /// <returns>An enumerator for the dictionary</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n\n    /// <summary>\n    /// Provides a default implementation of ExtendedDictionary using Dictionary{TKey, TValue}\n    /// </summary>\n    [PandasNonExpandable]\n    public class BaseExtendedDictionary<TKey, TValue> : BaseExtendedDictionary<TKey, TValue, Dictionary<TKey, TValue>>\n    {\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class that is empty\n        /// </summary>\n        public BaseExtendedDictionary() : base()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class that contains elements copied from the specified dictionary\n        /// </summary>\n        /// <param name=\"dictionary\">The dictionary whose elements are copied to the new dictionary</param>\n        public BaseExtendedDictionary(IDictionary<TKey, TValue> dictionary) : base(new Dictionary<TKey, TValue>(dictionary))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BaseExtendedDictionary class\n        /// using the specified <paramref name=\"data\"/> as a data source\n        /// </summary>\n        /// <param name=\"data\">The data source for this dictionary</param>\n        /// <param name=\"keySelector\">Delegate used to select a key from the value</param>\n        public BaseExtendedDictionary(IEnumerable<TValue> data, Func<TValue, TKey> keySelector) : base(data, keySelector)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/BusyBlockingCollection.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Threading;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// A small wrapper around <see cref=\"BlockingCollection{T}\"/> used to communicate busy state of the items\n    /// being processed\n    /// </summary>\n    /// <typeparam name=\"T\">The item type being processed</typeparam>\n    public class BusyBlockingCollection<T> : IBusyCollection<T>\n    {\n        private readonly BlockingCollection<T> _collection;\n        private readonly ManualResetEventSlim _processingCompletedEvent;\n        private readonly object _lock = new object();\n\n        /// <summary>\n        /// Gets a wait handle that can be used to wait until this instance is done\n        /// processing all of it's item\n        /// </summary>\n        public WaitHandle WaitHandle\n        {\n            get { return _processingCompletedEvent.WaitHandle; }\n        }\n\n        /// <summary>\n        /// Gets the number of items held within this collection\n        /// </summary>\n        public int Count\n        {\n            get { return _collection.Count; }\n        }\n\n        /// <summary>\n        /// Returns true if processing, false otherwise\n        /// </summary>\n        public bool IsBusy\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    return _collection.Count > 0 || !_processingCompletedEvent.IsSet;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BusyBlockingCollection{T}\"/> class\n        /// with a bounded capacity of <see cref=\"int.MaxValue\"/>\n        /// </summary>\n        public BusyBlockingCollection()\n            : this(int.MaxValue)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BusyBlockingCollection{T}\"/> class\n        /// with the specified <paramref name=\"boundedCapacity\"/>\n        /// </summary>\n        /// <param name=\"boundedCapacity\">The maximum number of items allowed in the collection</param>\n        public BusyBlockingCollection(int boundedCapacity)\n        {\n            _collection = new BlockingCollection<T>(boundedCapacity);\n\n            // initialize as not busy\n            _processingCompletedEvent = new ManualResetEventSlim(true);\n        }\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        public void Add(T item)\n        {\n            Add(item, CancellationToken.None);\n        }\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        public void Add(T item, CancellationToken cancellationToken)\n        {\n            bool added;\n            lock (_lock)\n            {\n                // we're adding work to be done, mark us as busy\n                _processingCompletedEvent.Reset();\n                added = _collection.TryAdd(item, 0, cancellationToken);\n            }\n\n            if (!added)\n            {\n                _collection.Add(item, cancellationToken);\n            }\n        }\n\n        /// <summary>\n        /// Marks the <see cref=\"BusyBlockingCollection{T}\"/> as not accepting any more additions\n        /// </summary>\n        public void CompleteAdding()\n        {\n            _collection.CompleteAdding();\n        }\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        public IEnumerable<T> GetConsumingEnumerable()\n        {\n            return GetConsumingEnumerable(CancellationToken.None);\n        }\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        public IEnumerable<T> GetConsumingEnumerable(CancellationToken cancellationToken)\n        {\n            while (!_collection.IsCompleted)\n            {\n                T item;\n\n                // check to see if something is immediately available\n                bool tookItem;\n\n                try\n                {\n                    tookItem = _collection.TryTake(out item, 0, cancellationToken);\n                }\n                catch (OperationCanceledException)\n                {\n                    // if the operation was canceled, just bail on the enumeration\n                    yield break;\n                }\n\n                if (tookItem)\n                {\n                    // something was immediately available, emit it\n                    yield return item;\n                    continue;\n                }\n\n\n                // we need to lock this with the Add method since we need to model the act of\n                // taking/flipping the switch and adding/flipping the switch as one operation\n                lock (_lock)\n                {\n                    // double check that there's nothing in the collection within a lock, it's possible\n                    // that between the TryTake above and this statement, the Add method was called, so we\n                    // don't want to flip the switch if there's something in the collection\n                    if (_collection.Count == 0)\n                    {\n                        // nothing was immediately available, mark us as idle\n                        _processingCompletedEvent.Set();\n                    }\n                }\n\n                try\n                {\n                    // now block until something is available\n                    tookItem = _collection.TryTake(out item, Timeout.Infinite, cancellationToken);\n                }\n                catch (OperationCanceledException)\n                {\n                    // if the operation was canceled, just bail on the enumeration\n                    yield break;\n                }\n\n                if (tookItem)\n                {\n                    // emit the item we found\n                    yield return item;\n                }\n            }\n\n            // no more items to process\n            _processingCompletedEvent.Set();\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _collection.Dispose();\n            _processingCompletedEvent.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/BusyCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Threading;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// A non blocking <see cref=\"IBusyCollection{T}\"/> implementation\n    /// </summary>\n    /// <typeparam name=\"T\">The item type being processed</typeparam>\n    public class BusyCollection<T> : IBusyCollection<T>\n    {\n        private readonly ConcurrentQueue<T> _collection = new ConcurrentQueue<T>();\n        private readonly ManualResetEventSlim _processingCompletedEvent = new ManualResetEventSlim(true);\n        private bool _completedAdding;\n\n        /// <summary>\n        /// Gets a wait handle that can be used to wait until this instance is done\n        /// processing all of it's item\n        /// </summary>\n        public WaitHandle WaitHandle => _processingCompletedEvent.WaitHandle;\n\n        /// <summary>\n        /// Gets the number of items held within this collection\n        /// </summary>\n        public int Count => _collection.Count;\n\n        /// <summary>\n        /// Returns true if processing, false otherwise\n        /// </summary>\n        public bool IsBusy => !_collection.IsEmpty || !_processingCompletedEvent.IsSet;\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        public void Add(T item)\n        {\n            Add(item, CancellationToken.None);\n        }\n\n        /// <summary>\n        /// Adds the items to this collection\n        /// </summary>\n        /// <param name=\"item\">The item to be added</param>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        public void Add(T item, CancellationToken cancellationToken)\n        {\n            if (_completedAdding)\n            {\n                throw new InvalidOperationException(\"Collection has already been marked as not \" +\n                    $\"accepting more additions, see {nameof(CompleteAdding)}\");\n            }\n\n            // locking to avoid race condition with GetConsumingEnumerable()\n            lock (_processingCompletedEvent)\n            {\n                // we're adding work to be done, mark us as busy\n                _processingCompletedEvent.Reset();\n                _collection.Enqueue(item);\n            }\n        }\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        public IEnumerable<T> GetConsumingEnumerable()\n        {\n            return GetConsumingEnumerable(CancellationToken.None);\n        }\n\n        /// <summary>\n        /// Provides a consuming enumerable for items in this collection.\n        /// </summary>\n        /// <param name=\"cancellationToken\">A cancellation token to observer</param>\n        /// <returns>An enumerable that removes and returns items from the collection</returns>\n        public IEnumerable<T> GetConsumingEnumerable(CancellationToken cancellationToken)\n        {\n            T item;\n            while (_collection.TryDequeue(out item))\n            {\n                yield return item;\n            }\n\n            // locking to avoid race condition with Add()\n            lock (_processingCompletedEvent)\n            {\n                if (!_collection.TryPeek(out item))\n                {\n                    _processingCompletedEvent.Set();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _collection.Clear();\n            _processingCompletedEvent.Dispose();\n        }\n\n        /// <summary>\n        /// Marks the collection as not accepting any more additions\n        /// </summary>\n        public void CompleteAdding()\n        {\n            _completedAdding = true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/CandlestickJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Candlestick Json Converter\n    /// </summary>\n    public class CandlestickJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Write Series to Json\n        /// </summary>\n        /// <param name=\"writer\">The Json Writer to use</param>\n        /// <param name=\"value\">The value to written to Json</param>\n        /// <param name=\"serializer\">The Json Serializer to use</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            // Candlesticks will be written as a single array of 5 values: [time, open, high, low, close]\n\n            var candlestick = value as Candlestick;\n            if (candlestick == null)\n            {\n                return;\n            }\n\n            writer.WriteStartArray();\n\n            writer.WriteValue(candlestick.LongTime);\n            writer.WriteValue(candlestick.Open);\n            writer.WriteValue(candlestick.High);\n            writer.WriteValue(candlestick.Low);\n            writer.WriteValue(candlestick.Close);\n\n            writer.WriteEndArray();\n        }\n\n        /// <summary>\n        /// Json reader implementation which handles backwards compatiblity for old equity chart points\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if(reader.TokenType == JsonToken.StartObject)\n            {\n                var chartPoint = serializer.Deserialize<ChartPoint>(reader);\n                if(chartPoint == null)\n                {\n                    return null;\n                }\n                return new Candlestick(chartPoint.X, chartPoint.Y, chartPoint.Y, chartPoint.Y, chartPoint.Y);\n            }\n            var jArray = JArray.Load(reader);\n            if(jArray.Count <= 2)\n            {\n                var chartPoint = jArray.ToObject<ChartPoint>();\n                if (chartPoint == null)\n                {\n                    return null;\n                }\n                return new Candlestick(chartPoint.X, chartPoint.Y, chartPoint.Y, chartPoint.Y, chartPoint.Y);\n            }\n            return new Candlestick(jArray[0].Value<long>(), jArray[1].Value<decimal?>(), jArray[2].Value<decimal?>(),\n                jArray[3].Value<decimal?>(), jArray[4].Value<decimal?>());\n        }\n\n        /// <summary>\n        /// Determine if this Converter can convert this type\n        /// </summary>\n        /// <param name=\"objectType\">Type that we would like to convert</param>\n        /// <returns>True if <see cref=\"Series\"/></returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(Candlestick);\n        }\n\n        /// <summary>\n        /// This converter wont be used to read JSON. Will throw exception if manually called.\n        /// </summary>\n        public override bool CanRead => true;\n    }\n}\n"
  },
  {
    "path": "Common/Util/CashAmountUtil.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides utility methods for working with <see cref=\"CashAmount\"/> instances\n    /// </summary>\n    public static class CashAmountUtil\n    {\n        /// <summary>\n        /// Determines if a cash balance should be added to the cash book\n        /// </summary>\n        /// <param name=\"balance\">The cash balance to check</param>\n        /// <param name=\"accountCurrency\">The algorithm's account currency</param>\n        /// <returns>True if the balance should be added, false otherwise</returns>\n        public static bool ShouldAddCashBalance(CashAmount balance, string accountCurrency)\n        {\n            // Don't add zero quantity currencies except the account currency\n            // we do add 'BNFCR' even if zero as it's used to track brokerage fees, we need lean to setup conversion rates for it\n            return balance.Amount != 0 || balance.Currency == accountCurrency || balance.Currency == \"BNFCR\";\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ChartPointJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Json Converter for ChartPoint which handles special reading\n    /// </summary>\n    public class ChartPointJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Determine if this Converter can convert this type\n        /// </summary>\n        /// <param name=\"objectType\">Type that we would like to convert</param>\n        /// <returns>True if <see cref=\"Series\"/></returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(ChartPoint);\n        }\n\n        /// <summary>\n        /// Reads series from Json\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.StartObject)\n            {\n                var jObject = JObject.Load(reader);\n                var x = jObject[\"x\"];\n\n                if (!jObject.ContainsKey(\"y\"))\n                {\n                    return new ChartPoint(x.Value<long>(), 0);\n                }\n\n                var y = jObject[\"y\"];\n                if (y != null && (y.Type == JTokenType.Float || y.Type == JTokenType.Integer))\n                {\n                    return new ChartPoint(x.Value<long>(), y.Value<decimal>());\n                }\n\n                if (y.Type == JTokenType.Null)\n                {\n                    return new ChartPoint(x.Value<long>(), null);\n                }\n\n                return null;\n            }\n\n            var jArray = JArray.Load(reader);\n            return new ChartPoint(jArray[0].Value<long>(), jArray[1].Value<decimal?>());\n        }\n\n        /// <summary>\n        /// Write point to Json\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var chartPoint = (ChartPoint)value;\n            writer.WriteStartArray();\n            writer.WriteValue(chartPoint.X);\n            writer.WriteValue(chartPoint.Y);\n            writer.WriteEndArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/CircularQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// A never ending queue that will dequeue and reenqueue the same item\n    /// </summary>\n    public class CircularQueue<T>\n    {\n        private readonly T _head;\n        private readonly Queue<T> _queue;\n\n        /// <summary>\n        /// Fired when we do a full circle\n        /// </summary>\n        public event EventHandler CircleCompleted;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CircularQueue{T}\"/> class\n        /// </summary>\n        /// <param name=\"items\">The items in the queue</param>\n        public CircularQueue(params T[] items)\n            : this((IEnumerable<T>)items)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CircularQueue{T}\"/> class\n        /// </summary>\n        /// <param name=\"items\">The items in the queue</param>\n        public CircularQueue(IEnumerable<T> items)\n        {\n            _queue = new Queue<T>();\n\n            var first = true;\n            foreach (var item in items)\n            {\n                if (first)\n                {\n                    first = false;\n                    _head = item;\n                }\n                _queue.Enqueue(item);\n            }\n        }\n\n        /// <summary>\n        /// Dequeues the next item\n        /// </summary>\n        /// <returns>The next item</returns>\n        public T Dequeue()\n        {\n            var item = _queue.Dequeue();\n            if (item.Equals(_head))\n            {\n                OnCircleCompleted();\n            }\n            _queue.Enqueue(item);\n            return item;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"CircleCompleted\"/> evet\n        /// </summary>\n        protected virtual void OnCircleCompleted()\n        {\n            var handler = CircleCompleted;\n            if (handler != null) handler(this, EventArgs.Empty);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/ColorJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Drawing;\nusing System.Globalization;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// A <see cref=\"JsonConverter\" /> implementation that serializes a <see cref=\"Color\" /> as a string.\n    /// If Color is empty, string is also empty and vice-versa. Meaning that color is autogen.\n    /// </summary>\n    public class ColorJsonConverter : TypeChangeJsonConverter<Color, string>\n    {\n        /// <summary>\n        /// Converts a .NET Color to a hexadecimal as a string\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialization</param>\n        /// <returns>Hexadecimal number as a string. If .NET Color is null, returns default #000000</returns>\n        protected override string Convert(Color value)\n        {\n            return value.IsEmpty ? string.Empty : $\"#{value.R.ToStringInvariant(\"X2\")}{value.G.ToStringInvariant(\"X2\")}{value.B.ToStringInvariant(\"X2\")}\";\n        }\n\n        /// <summary>\n        /// Converts the input string to a .NET Color object\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override Color Convert(string value)\n        {\n            if (string.IsNullOrWhiteSpace(value))\n            {\n                return Color.Empty;\n            }\n            if (value.Length != 7)\n            {\n                var message = $\"Unable to convert '{value}' to a Color. Requires string length of 7 including the leading hashtag.\";\n                throw new FormatException(message);\n            }\n\n            var red = HexToInt(value.Substring(1, 2));\n            var green = HexToInt(value.Substring(3, 2));\n            var blue = HexToInt(value.Substring(5, 2));\n            return Color.FromArgb(red, green, blue);\n        }\n\n        /// <summary>\n        /// Converts hexadecimal number to integer\n        /// </summary>\n        /// <param name=\"hexValue\">Hexadecimal number</param>\n        /// <returns>Integer representation of the hexadecimal</returns>\n        private int HexToInt(string hexValue)\n        {\n            if (hexValue.Length != 2)\n            {\n                var message = $\"Unable to convert '{hexValue}' to an Integer. Requires string length of 2.\";\n                throw new FormatException(message);\n            }\n\n            int result;\n            if (!int.TryParse(hexValue, NumberStyles.HexNumber, null, out result))\n            {\n                throw new FormatException($\"Invalid hex number: {hexValue}\");\n            }\n\n            return result;\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/ComparisonOperator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Utility Comparison Operator class\n    /// </summary>\n    public static class ComparisonOperator\n    {\n        /// <summary>\n        /// Compares two values using given operator\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"op\">Comparison operator</param>\n        /// <param name=\"arg1\">The first value</param>\n        /// <param name=\"arg2\">The second value</param>\n        /// <returns>Returns true if its left-hand operand meets the operator value to its right-hand operand, false otherwise</returns>\n        public static bool Compare<T>(ComparisonOperatorTypes op, T arg1, T arg2) where T : IComparable\n        {\n            switch (op)\n            {\n                case ComparisonOperatorTypes.Equals:\n                    return arg1.CompareTo(arg2) == 0;\n                case ComparisonOperatorTypes.NotEqual:\n                    return arg1.CompareTo(arg2) != 0;\n                case ComparisonOperatorTypes.Greater:\n                    return arg1.CompareTo(arg2) == 1;\n                case ComparisonOperatorTypes.GreaterOrEqual:\n                    return arg1.CompareTo(arg2) >= 0;\n                case ComparisonOperatorTypes.Less:\n                    return arg1.CompareTo(arg2) == -1;\n                case ComparisonOperatorTypes.LessOrEqual:\n                    return arg1.CompareTo(arg2) <= 0;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(op), $\"Operator '{op}' is not supported.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ComparisonOperatorTypes.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Comparison operators\n    /// </summary>\n    [JsonConverter(typeof(StringEnumConverter), true)]\n    public enum ComparisonOperatorTypes\n    {\n        /// <summary>\n        /// Check if their operands are equal\n        /// </summary>\n        Equals,\n\n        /// <summary>\n        /// Check if their operands are not equal\n        /// </summary>\n        NotEqual,\n\n        /// <summary>\n        /// Checks left-hand operand is greater than its right-hand operand\n        /// </summary>\n        Greater,\n\n        /// <summary>\n        /// Checks left-hand operand is greater or equal to its right-hand operand\n        /// </summary>\n        GreaterOrEqual,\n\n        /// <summary>\n        /// Checks left-hand operand is less than its right-hand operand\n        /// </summary>\n        Less,\n\n        /// <summary>\n        /// Checks left-hand operand is less or equal to its right-hand operand\n        /// </summary>\n        LessOrEqual\n    }\n}\n"
  },
  {
    "path": "Common/Util/Composer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing System.ComponentModel.Composition.Hosting;\nusing System.ComponentModel.Composition.Primitives;\nusing System.ComponentModel.Composition.ReflectionModel;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides methods for obtaining exported MEF instances\n    /// </summary>\n    public class Composer\n    {\n        private static string PluginDirectory;\n        private static readonly Lazy<Composer> LazyComposer = new Lazy<Composer>(\n            () =>\n            {\n                PluginDirectory = Config.Get(\"plugin-directory\");\n                return new Composer();\n            });\n\n        /// <summary>\n        /// Gets the singleton instance\n        /// </summary>\n        /// <remarks>Intentionally using a property so that when its gotten it will\n        /// trigger the lazy construction which will be after the right configuration\n        /// is loaded. See GH issue 3258</remarks>\n        public static Composer Instance => LazyComposer.Value;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Composer\"/> class. This type\n        /// is a light wrapper on top of an MEF <see cref=\"CompositionContainer\"/>\n        /// </summary>\n        public Composer()\n        {\n            // Determine what directory to grab our assemblies from if not defined by 'composer-dll-directory' configuration key\n            var dllDirectoryString = Config.Get(\"composer-dll-directory\");\n            if (string.IsNullOrWhiteSpace(dllDirectoryString))\n            {\n                // Check our appdomain directory for QC Dll's, for most cases this will be true and fine to use\n                if (!string.IsNullOrEmpty(AppDomain.CurrentDomain.BaseDirectory) && Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory, \"QuantConnect.*.dll\").Any())\n                {\n                    dllDirectoryString = AppDomain.CurrentDomain.BaseDirectory;\n                }\n                else\n                {\n                    // Otherwise check out our parent and current working directory\n                    // this is helpful for research because kernel appdomain defaults to kernel location\n                    var currentDirectory = Directory.GetCurrentDirectory();\n                    var parentDirectory = Directory.GetParent(currentDirectory)?.FullName ?? currentDirectory; // If parent == null will just use current\n\n                    // If our parent directory contains QC Dlls use it, otherwise default to current working directory\n                    // In cloud and CLI research cases we expect the parent directory to contain the Dlls; but locally it's likely current directory\n                    dllDirectoryString = Directory.EnumerateFiles(parentDirectory, \"QuantConnect.*.dll\").Any() ? parentDirectory : currentDirectory;\n                }\n            }\n\n            // Resolve full path name just to be safe\n            var primaryDllLookupDirectory = new DirectoryInfo(dllDirectoryString).FullName;\n            Log.Trace($\"Composer(): Loading Assemblies from {primaryDllLookupDirectory}\");\n\n            var loadFromPluginDir = !string.IsNullOrWhiteSpace(PluginDirectory)\n                && Directory.Exists(PluginDirectory) &&\n                new DirectoryInfo(PluginDirectory).FullName != primaryDllLookupDirectory;\n            var fileNames = Directory.EnumerateFiles(primaryDllLookupDirectory, \"*.dll\");\n            if (loadFromPluginDir)\n            {\n                fileNames = fileNames.Concat(Directory.EnumerateFiles(PluginDirectory, \"*.dll\"));\n            }\n            LoadPartsSafely(fileNames.DistinctBy(Path.GetFileName));\n        }\n\n        private CompositionContainer _compositionContainer;\n        private IReadOnlyList<Type> _exportedTypes;\n        private List<ComposablePartDefinition> _composableParts;\n        private readonly object _exportedValuesLockObject = new object();\n        private readonly Dictionary<Type, IEnumerable> _exportedValues = new Dictionary<Type, IEnumerable>();\n\n        /// <summary>\n        /// Gets the export matching the predicate\n        /// </summary>\n        /// <param name=\"predicate\">Function used to pick which imported instance to return, if null the first instance is returned</param>\n        /// <returns>The only export matching the specified predicate</returns>\n        public T Single<T>(Func<T, bool> predicate)\n        {\n            if (predicate == null)\n            {\n                throw new ArgumentNullException(nameof(predicate));\n            }\n\n            return GetExportedValues<T>().Single(predicate);\n        }\n\n        /// <summary>\n        /// Adds the specified instance to this instance to allow it to be recalled via GetExportedValueByTypeName\n        /// </summary>\n        /// <typeparam name=\"T\">The contract type</typeparam>\n        /// <param name=\"instance\">The instance to add</param>\n        public void AddPart<T>(T instance)\n        {\n            lock (_exportedValuesLockObject)\n            {\n                IEnumerable values;\n                if (_exportedValues.TryGetValue(typeof(T), out values))\n                {\n                    ((IList<T>)values).Add(instance);\n                }\n                else\n                {\n                    values = new List<T> { instance };\n                    _exportedValues[typeof(T)] = values;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the first type T instance if any\n        /// </summary>\n        /// <typeparam name=\"T\">The contract type</typeparam>\n        public T GetPart<T>()\n        {\n            return GetPart<T>(null);\n        }\n\n        /// <summary>\n        /// Gets the first type T instance if any\n        /// </summary>\n        /// <typeparam name=\"T\">The contract type</typeparam>\n        public T GetPart<T>(Func<T, bool> filter)\n        {\n            return GetParts<T>().Where(x => filter == null || filter(x)).FirstOrDefault();\n        }\n\n        /// <summary>\n        /// Gets all parts of type T instance if any\n        /// </summary>\n        /// <typeparam name=\"T\">The contract type</typeparam>\n        public IEnumerable<T> GetParts<T>()\n        {\n            lock (_exportedValuesLockObject)\n            {\n                IEnumerable values;\n                if (_exportedValues.TryGetValue(typeof(T), out values))\n                {\n                    return ((IEnumerable<T>)values).ToList();\n                }\n                return Enumerable.Empty<T>();\n            }\n        }\n\n        /// <summary>\n        /// Will return all loaded types that are assignable to T type\n        /// </summary>\n        public IEnumerable<Type> GetExportedTypes<T>() where T : class\n        {\n            var type = typeof(T);\n            return _exportedTypes.Where(type1 =>\n                {\n                    try\n                    {\n                        return type.IsAssignableFrom(type1);\n                    }\n                    catch\n                    {\n                        return false;\n                    }\n                });\n        }\n\n        /// <summary>\n        /// Extension method to searches the composition container for an export that has a matching type name. This function\n        /// will first try to match on Type.AssemblyQualifiedName, then Type.FullName, and finally on Type.Name\n        ///\n        /// This method will not throw if multiple types are found matching the name, it will just return the first one it finds.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the export</typeparam>\n        /// <param name=\"typeName\">The name of the type to find. This can be an assembly qualified name, a full name, or just the type's name</param>\n        /// <param name=\"forceTypeNameOnExisting\">When false, if any existing instance of type T is found, it will be returned even if type name doesn't match.\n        /// This is useful in cases where a single global instance is desired, like for <see cref=\"IDataAggregator\"/></param>\n        /// <returns>The export instance</returns>\n        public T GetExportedValueByTypeName<T>(string typeName, bool forceTypeNameOnExisting = true)\n            where T : class\n        {\n            try\n            {\n                // if we've already loaded this part, then just return the same one\n                var instance = GetParts<T>().FirstOrDefault(x => !forceTypeNameOnExisting || x.GetType().MatchesTypeName(typeName));\n                if (instance != null)\n                {\n                    return instance;\n                }\n\n                var type = typeof(T);\n                var typeT = _exportedTypes.Where(type1 =>\n                    {\n                        try\n                        {\n                            return type.IsAssignableFrom(type1) && type1.MatchesTypeName(typeName);\n                        }\n                        catch\n                        {\n                            return false;\n                        }\n                    })\n                .FirstOrDefault();\n\n                if (typeT != null)\n                {\n                    instance = (T)Activator.CreateInstance(typeT);\n                }\n\n                if (instance == null)\n                {\n                    // we want to get the requested part without instantiating each one of that type\n                    var selectedPart = _composableParts\n                        .Where(x =>\n                            {\n                                try\n                                {\n                                    var xType = ReflectionModelServices.GetPartType(x).Value;\n                                    return type.IsAssignableFrom(xType) && xType.MatchesTypeName(typeName);\n                                }\n                                catch\n                                {\n                                    return false;\n                                }\n                            }\n                        )\n                        .FirstOrDefault();\n\n                    if (selectedPart == null)\n                    {\n                        throw new ArgumentException(\n                            $\"Unable to locate any exports matching the requested typeName: {typeName}. Type: {type}\", nameof(typeName));\n                    }\n\n                    var exportDefinition =\n                        selectedPart.ExportDefinitions.First(\n                            x => x.ContractName == AttributedModelServices.GetContractName(type));\n                    instance = (T)selectedPart.CreatePart().GetExportedValue(exportDefinition);\n                }\n\n                var exportedParts = instance.GetType().GetInterfaces()\n                    .Where(interfaceType => interfaceType.GetCustomAttribute<InheritedExportAttribute>() != null);\n\n                lock (_exportedValuesLockObject)\n                {\n                    foreach (var export in exportedParts)\n                    {\n                        var exportList = _exportedValues.SingleOrDefault(kvp => kvp.Key == export).Value;\n\n                        // cache the new value for next time\n                        if (exportList == null)\n                        {\n                            var list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(export));\n                            list.Add(instance);\n                            _exportedValues[export] = list;\n                        }\n                        else\n                        {\n                            ((IList)exportList).Add(instance);\n                        }\n                    }\n\n                    return instance;\n                }\n            }\n            catch (ReflectionTypeLoadException err)\n            {\n                foreach (var exception in err.LoaderExceptions)\n                {\n                    Log.Error(exception);\n                    Log.Error(exception.ToString());\n                }\n\n                if (err.InnerException != null) Log.Error(err.InnerException);\n\n                throw;\n            }\n        }\n        /// <summary>\n        /// Gets all exports of type T\n        /// </summary>\n        public IEnumerable<T> GetExportedValues<T>()\n        {\n            try\n            {\n                lock (_exportedValuesLockObject)\n                {\n                    IEnumerable values;\n                    if (_exportedValues.TryGetValue(typeof(T), out values))\n                    {\n                        return values.OfType<T>();\n                    }\n\n                    values = _compositionContainer.GetExportedValues<T>().ToList();\n                    _exportedValues[typeof(T)] = values;\n                    return values.OfType<T>();\n                }\n            }\n            catch (ReflectionTypeLoadException err)\n            {\n                foreach (var exception in err.LoaderExceptions)\n                {\n                    Log.Error(exception);\n                }\n\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Clears the cache of exported values, causing new instances to be created.\n        /// </summary>\n        public void Reset()\n        {\n            lock (_exportedValuesLockObject)\n            {\n                _exportedValues.Clear();\n            }\n        }\n\n        private void LoadPartsSafely(IEnumerable<string> files)\n        {\n            try\n            {\n                var exportedTypes = new ConcurrentBag<Type>();\n                var catalogs = new ConcurrentBag<ComposablePartCatalog>();\n                Parallel.ForEach(files, file =>\n                {\n                    try\n                    {\n                        // we need to load assemblies so that C# algorithm dependencies are resolved correctly\n                        // at the same time we need to load all QC dependencies to find all exports\n                        Assembly assembly;\n                        try\n                        {\n                            var asmName = AssemblyName.GetAssemblyName(file);\n                            assembly = Assembly.Load(asmName);\n                        }\n                        catch\n                        {\n                            // handles dependencies that are not in the probing path but might duplicate loading an already loaded assembly\n                            assembly = Assembly.LoadFrom(file);\n                        }\n\n                        if (Path.GetFileName(file).StartsWith($\"{nameof(QuantConnect)}.\", StringComparison.InvariantCulture))\n                        {\n                            foreach (var type in assembly.ExportedTypes.Where(type => !type.IsAbstract && !type.IsInterface && !type.IsEnum))\n                            {\n                                exportedTypes.Add(type);\n                            }\n                        }\n                        var asmCatalog = new AssemblyCatalog(assembly);\n                        var parts = asmCatalog.Parts.ToArray();\n                        if (parts.Length > 0)\n                        {\n                            catalogs.Add(asmCatalog);\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        if (!file.Contains(\"quickfix.fix\", StringComparison.InvariantCultureIgnoreCase))\n                        {\n                            Log.Trace($\"Composer.LoadPartsSafely({file}): Skipping {ex.GetType().Name}: {ex.Message}\");\n                        }\n                    }\n                });\n\n                _exportedTypes = new List<Type>(exportedTypes);\n                var aggregate = new AggregateCatalog(catalogs);\n                _compositionContainer = new CompositionContainer(aggregate);\n                _composableParts = _compositionContainer.Catalog.Parts.ToList();\n            }\n            catch (Exception exception)\n            {\n                // ThreadAbortException is triggered when we shutdown ignore the error log\n                if (!(exception is ThreadAbortException))\n                {\n                    Log.Error(exception);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ConcurrentSet.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides a thread-safe set collection that mimics the behavior of <see cref=\"HashSet{T}\"/>\n    /// and will be keep insertion order\n    /// </summary>\n    /// <typeparam name=\"T\">The item type</typeparam>\n    public class ConcurrentSet<T> : ISet<T>\n    {\n        private readonly IEnumerator<T> _emptyEnumerator = Enumerable.Empty<T>().GetEnumerator();\n        private readonly OrderedDictionary _set = new OrderedDictionary();\n        // for performance we will keep a enumerator list which we will refresh only if required\n        private readonly List<T> _enumerator = new List<T>();\n        private bool _refreshEnumerator;\n\n        /// <summary>Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <returns>The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</returns>\n        public int Count\n        {\n            get\n            {\n                lock (_set)\n                {\n                    return _set.Count;\n                }\n            }\n        }\n\n        /// <summary>Gets a value indicating whether the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.</summary>\n        /// <returns>true if the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only; otherwise, false.</returns>\n        public bool IsReadOnly => false;\n\n        /// <summary>Adds an item to the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <param name=\"item\">The object to add to the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.</exception>\n        void ICollection<T>.Add(T item)\n        {\n            if (item == null)\n            {\n                throw new ArgumentNullException(nameof(item));\n            }\n\n            lock (_set)\n            {\n                AddImpl(item);\n            }\n        }\n\n        /// <summary>Modifies the current set so that it contains all elements that are present in either the current set or the specified collection.</summary>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public void UnionWith(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n\n            lock (_set)\n            {\n                foreach (var item in otherSet)\n                {\n                    // wont overwrite existing references of same key\n                    AddImpl(item);\n                }\n            }\n        }\n\n        /// <summary>Modifies the current set so that it contains only elements that are also in a specified collection.</summary>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public void IntersectWith(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n\n            lock (_set)\n            {\n                // remove items in '_set' that are not in 'other'\n                // enumerating this and not '_set' so its safe to modify\n                foreach (var item in this)\n                {\n                    if (!otherSet.Contains(item))\n                    {\n                        RemoveImpl(item);\n                    }\n                }\n            }\n        }\n\n        /// <summary>Removes all elements in the specified collection from the current set.</summary>\n        /// <param name=\"other\">The collection of items to remove from the set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public void ExceptWith(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n\n            lock (_set)\n            {\n                // remove items from 'other'\n                foreach (var item in otherSet)\n                {\n                    RemoveImpl(item);\n                }\n            }\n        }\n\n        /// <summary>Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. </summary>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public void SymmetricExceptWith(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n\n            lock (_set)\n            {\n                foreach (var item in otherSet)\n                {\n                    if (!AddImpl(item))\n                    {\n                        // remove items in both collections\n                        RemoveImpl(item);\n                    }\n                }\n            }\n        }\n\n        /// <summary>Determines whether a set is a subset of a specified collection.</summary>\n        /// <returns>true if the current set is a subset of <paramref name=\"other\" />; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool IsSubsetOf(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n            lock (_set)\n            {\n                foreach (var item in otherSet)\n                {\n                    if (!_set.Contains(item))\n                    {\n                        return false;\n                    }\n                }\n\n                // non-strict subset can be equal\n                return _set.Keys.Count == 0;\n            }\n        }\n\n        /// <summary>Determines whether the current set is a superset of a specified collection.</summary>\n        /// <returns>true if the current set is a superset of <paramref name=\"other\" />; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool IsSupersetOf(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n            lock (_set)\n            {\n                foreach (DictionaryEntry item in _set)\n                {\n                    if (!otherSet.Remove((T)item.Key))\n                    {\n                        return false;\n                    }\n                }\n            }\n\n            // non-strict superset can be equal\n            return true;\n        }\n\n        /// <summary>Determines whether the current set is a proper (strict) superset of a specified collection.</summary>\n        /// <returns>true if the current set is a proper superset of <paramref name=\"other\" />; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set. </param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool IsProperSupersetOf(IEnumerable<T> other)\n        {\n            var hasOther = false;\n            var otherSet = other.ToHashSet();\n            lock (_set)\n            {\n                foreach (DictionaryEntry item in _set)\n                {\n                    if (!otherSet.Remove((T)item.Key))\n                    {\n                        return false;\n                    }\n\n                    hasOther = true;\n                }\n            }\n\n            // to be a strict superset, _set must contain extra elements and contain all of other\n            return hasOther;\n        }\n\n        /// <summary>Determines whether the current set is a proper (strict) subset of a specified collection.</summary>\n        /// <returns>true if the current set is a proper subset of <paramref name=\"other\" />; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool IsProperSubsetOf(IEnumerable<T> other)\n        {\n            var hasOther = false;\n            var otherSet = other.ToHashSet();\n            lock (_set)\n            {\n                foreach (var item in otherSet)\n                {\n                    if (!_set.Contains(item))\n                    {\n                        return false;\n                    }\n\n                    hasOther = true;\n                }\n\n                // to be a strict subset, other must contain extra elements and _set must contain all of other\n                return hasOther && _set.Keys.Count == 0;\n            }\n        }\n\n        /// <summary>Determines whether the current set overlaps with the specified collection.</summary>\n        /// <returns>true if the current set and <paramref name=\"other\" /> share at least one common element; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool Overlaps(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n\n            lock (_set)\n            {\n                foreach (var item in otherSet)\n                {\n                    if (_set.Contains(item))\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>Determines whether the current set and the specified collection contain the same elements.</summary>\n        /// <returns>true if the current set is equal to <paramref name=\"other\" />; otherwise, false.</returns>\n        /// <param name=\"other\">The collection to compare to the current set.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"other\" /> is null.</exception>\n        public bool SetEquals(IEnumerable<T> other)\n        {\n            var otherSet = other.ToHashSet();\n            lock (_set)\n            {\n                foreach (DictionaryEntry item in _set)\n                {\n                    if (!otherSet.Remove((T) item.Key))\n                    {\n                        return false;\n                    }\n                }\n            }\n\n            return otherSet.Count == 0;\n        }\n\n        /// <summary>Adds an element to the current set and returns a value to indicate if the element was successfully added. </summary>\n        /// <returns>true if the element is added to the set; false if the element is already in the set.</returns>\n        /// <param name=\"item\">The element to add to the set.</param>\n        public bool Add(T item)\n        {\n            lock (_set)\n            {\n                return AddImpl(item);\n            }\n        }\n\n        /// <summary>Removes all items from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only. </exception>\n        public void Clear()\n        {\n            lock (_set)\n            {\n                _refreshEnumerator = true;\n                _set.Clear();\n            }\n        }\n\n        /// <summary>Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> contains a specific value.</summary>\n        /// <returns>true if <paramref name=\"item\" /> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />; otherwise, false.</returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        public bool Contains(T item)\n        {\n            lock (_set)\n            {\n                return item != null && _set.Contains(item);\n            }\n        }\n\n        /// <summary>Copies the elements of the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> to an <see cref=\"T:System.Array\" />, starting at a particular <see cref=\"T:System.Array\" /> index.</summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\" /> that is the destination of the elements copied from <see cref=\"T:System.Collections.Generic.ICollection`1\" />. The <see cref=\"T:System.Array\" /> must have zero-based indexing.</param>\n        /// <param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\" /> at which copying begins.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// <paramref name=\"array\" /> is null.</exception>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// <paramref name=\"arrayIndex\" /> is less than 0.</exception>\n        /// <exception cref=\"T:System.ArgumentException\">The number of elements in the source <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is greater than the available space from <paramref name=\"arrayIndex\" /> to the end of the destination <paramref name=\"array\" />.</exception>\n        public void CopyTo(T[] array, int arrayIndex)\n        {\n            lock (_set)\n            {\n                foreach (DictionaryEntry item in _set)\n                {\n                    array[arrayIndex++] = (T) item.Key;\n                }\n            }\n        }\n\n        /// <summary>Removes the first occurrence of a specific object from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</summary>\n        /// <returns>true if <paramref name=\"item\" /> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />; otherwise, false. This method also returns false if <paramref name=\"item\" /> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</returns>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\" />.</param>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.</exception>\n        public bool Remove(T item)\n        {\n            lock (_set)\n            {\n                if (item != null && _set.Contains(item))\n                {\n                    RemoveImpl(item);\n                    return true;\n                }\n                return false;\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <remarks>For thread safety will return a snapshot of the collection</remarks>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<T> GetEnumerator()\n        {\n            lock (_set)\n            {\n                if (_refreshEnumerator)\n                {\n                    _enumerator.Clear();\n                    foreach (DictionaryEntry item in _set)\n                    {\n                        _enumerator.Add((T)item.Key);\n                    }\n\n                    _refreshEnumerator = false;\n                }\n\n                return _enumerator.Count == 0 ? _emptyEnumerator : _enumerator.GetEnumerator();\n            }\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <remarks>For thread safety will return a snapshot of the collection</remarks>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        private bool AddImpl(T item)\n        {\n            if (!_set.Contains(item))\n            {\n                _refreshEnumerator = true;\n                _set.Add(item, item);\n                return true;\n            }\n\n            return false;\n        }\n\n        private void RemoveImpl(T item)\n        {\n            _refreshEnumerator = true;\n            _set.Remove(item);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/CurrencyPairUtil.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Utility methods for decomposing and comparing currency pairs\n    /// </summary>\n    public static class CurrencyPairUtil\n    {\n        private static readonly Lazy<SymbolPropertiesDatabase> SymbolPropertiesDatabase =\n            new Lazy<SymbolPropertiesDatabase>(Securities.SymbolPropertiesDatabase.FromDataFolder);\n\n        private static readonly int[][] PotentialStableCoins = { [1, 3], [1, 2], [0, 3], [0, 2] };\n\n        /// <summary>\n        /// Tries to decomposes the specified currency pair into a base and quote currency provided as out parameters\n        /// </summary>\n        /// <param name=\"currencyPair\">The input currency pair to be decomposed</param>\n        /// <param name=\"baseCurrency\">The output base currency</param>\n        /// <param name=\"quoteCurrency\">The output quote currency</param>\n        /// <returns>True if was able to decompose the currency pair</returns>\n        public static bool TryDecomposeCurrencyPair(Symbol currencyPair, out string baseCurrency, out string quoteCurrency)\n        {\n            baseCurrency = null;\n            quoteCurrency = null;\n\n            if (!IsValidSecurityType(currencyPair?.SecurityType, throwException: false))\n            {\n                return false;\n            }\n\n            try\n            {\n                DecomposeCurrencyPair(currencyPair, out baseCurrency, out quoteCurrency);\n                return true;\n            }\n            catch\n            {\n                // ignored\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Decomposes the specified currency pair into a base and quote currency provided as out parameters\n        /// </summary>\n        /// <param name=\"currencyPair\">The input currency pair to be decomposed</param>\n        /// <param name=\"baseCurrency\">The output base currency</param>\n        /// <param name=\"quoteCurrency\">The output quote currency</param>\n        /// <param name=\"defaultQuoteCurrency\">Optionally can provide a default quote currency</param>\n        public static void DecomposeCurrencyPair(Symbol currencyPair, out string baseCurrency, out string quoteCurrency, string defaultQuoteCurrency = Currencies.USD)\n        {\n            IsValidSecurityType(currencyPair?.SecurityType, throwException: true);\n            var securityType = currencyPair.SecurityType;\n\n            if (securityType == SecurityType.Forex)\n            {\n                Forex.DecomposeCurrencyPair(currencyPair.Value, out baseCurrency, out quoteCurrency);\n                return;\n            }\n\n            var symbolProperties = SymbolPropertiesDatabase.Value.GetSymbolProperties(\n                currencyPair.ID.Market,\n                currencyPair,\n                currencyPair.SecurityType,\n                defaultQuoteCurrency);\n\n            if (securityType == SecurityType.Cfd)\n            {\n                Cfd.DecomposeCurrencyPair(currencyPair, symbolProperties, out baseCurrency, out quoteCurrency);\n            }\n            else\n            {\n                Crypto.DecomposeCurrencyPair(currencyPair, symbolProperties, out baseCurrency, out quoteCurrency);\n            }\n        }\n\n        /// <summary>\n        /// Checks whether a symbol is decomposable into a base and a quote currency\n        /// </summary>\n        /// <param name=\"currencyPair\">The pair to check for</param>\n        /// <returns>True if the pair can be decomposed into base and quote currencies, false if not</returns>\n        public static bool IsForexDecomposable(string currencyPair)\n        {\n            return !string.IsNullOrEmpty(currencyPair) && currencyPair.Length == 6;\n        }\n\n        /// <summary>\n        /// Checks whether a symbol is decomposable into a base and a quote currency\n        /// </summary>\n        /// <param name=\"currencyPair\">The pair to check for</param>\n        /// <returns>True if the pair can be decomposed into base and quote currencies, false if not</returns>\n        public static bool IsDecomposable(Symbol currencyPair)\n        {\n            if (currencyPair == null)\n            {\n                return false;\n            }\n\n            if (currencyPair.SecurityType == SecurityType.Forex)\n            {\n                return currencyPair.Value.Length == 6;\n            }\n\n            if (currencyPair.SecurityType == SecurityType.Cfd || currencyPair.SecurityType == SecurityType.Crypto || currencyPair.SecurityType == SecurityType.CryptoFuture)\n            {\n                var symbolProperties = SymbolPropertiesDatabase.Value.GetSymbolProperties(\n                    currencyPair.ID.Market,\n                    currencyPair,\n                    currencyPair.SecurityType,\n                    Currencies.USD);\n\n                return currencyPair.Value.EndsWith(symbolProperties.QuoteCurrency);\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// You have currencyPair AB and one known symbol (A or B). This function returns the other symbol (B or A).\n        /// </summary>\n        /// <param name=\"currencyPair\">Currency pair AB</param>\n        /// <param name=\"knownSymbol\">Known part of the currencyPair (either A or B)</param>\n        /// <returns>The other part of currencyPair (either B or A), or null if known symbol is not part of currencyPair</returns>\n        public static string CurrencyPairDual(this Symbol currencyPair, string knownSymbol)\n        {\n            string baseCurrency;\n            string quoteCurrency;\n\n            DecomposeCurrencyPair(currencyPair, out baseCurrency, out quoteCurrency);\n\n            return CurrencyPairDual(baseCurrency, quoteCurrency, knownSymbol);\n        }\n\n        /// <summary>\n        /// You have currencyPair AB and one known symbol (A or B). This function returns the other symbol (B or A).\n        /// </summary>\n        /// <param name=\"baseCurrency\">The base currency of the currency pair</param>\n        /// <param name=\"quoteCurrency\">The quote currency of the currency pair</param>\n        /// <param name=\"knownSymbol\">Known part of the currencyPair (either A or B)</param>\n        /// <returns>The other part of currencyPair (either B or A), or null if known symbol is not part of the currency pair</returns>\n        public static string CurrencyPairDual(string baseCurrency, string quoteCurrency, string knownSymbol)\n        {\n            if (baseCurrency == knownSymbol)\n            {\n                return quoteCurrency;\n            }\n\n            if (quoteCurrency == knownSymbol)\n            {\n                return baseCurrency;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Represents the relation between two currency pairs\n        /// </summary>\n        public enum Match\n        {\n            /// <summary>\n            /// The two currency pairs don't match each other normally nor when one is reversed\n            /// </summary>\n            NoMatch,\n\n            /// <summary>\n            /// The two currency pairs match each other exactly\n            /// </summary>\n            ExactMatch,\n\n            /// <summary>\n            /// The two currency pairs are the inverse of each other\n            /// </summary>\n            InverseMatch\n        }\n\n        /// <summary>\n        /// Returns how two currency pairs are related to each other\n        /// </summary>\n        /// <param name=\"pairA\">The first pair</param>\n        /// <param name=\"baseCurrencyB\">The base currency of the second pair</param>\n        /// <param name=\"quoteCurrencyB\">The quote currency of the second pair</param>\n        /// <returns>The <see cref=\"Match\"/> member that represents the relation between the two pairs</returns>\n        public static Match ComparePair(this Symbol pairA, string baseCurrencyB, string quoteCurrencyB)\n        {\n            if (!TryDecomposeCurrencyPair(pairA, out var baseCurrencyA, out var quoteCurrencyA))\n            {\n                return Match.NoMatch;\n            }\n\n            // Check for a stablecoin between the currencies\n            var currencies = new string[] { baseCurrencyA, quoteCurrencyA, baseCurrencyB, quoteCurrencyB };\n            var isThereAnyMatch = false;\n\n            // Compute all the potential stablecoins\n            foreach (var pair in PotentialStableCoins)\n            {\n                if (Currencies.IsStableCoinWithoutPair(currencies[pair[0]] + currencies[pair[1]], pairA.ID.Market)\n                    || Currencies.IsStableCoinWithoutPair(currencies[pair[1]] + currencies[pair[0]], pairA.ID.Market))\n                {\n                    // If there's a stablecoin between them, assign to currency in pair A the value\n                    // of the currency in pair B \n                    currencies[pair[0]] = currencies[pair[1]];\n                    isThereAnyMatch = true;\n                }\n            }\n\n            string pairAValue = isThereAnyMatch ? string.Concat(currencies[0], \"||\", currencies[1]) : string.Concat(baseCurrencyA, \"||\", quoteCurrencyA);\n\n            var directPair = string.Concat(baseCurrencyB, \"||\", quoteCurrencyB);\n            if (pairAValue == directPair)\n            {\n                return Match.ExactMatch;\n            }\n\n            var inversePair = string.Concat(quoteCurrencyB, \"||\", baseCurrencyB);\n            if (pairAValue == inversePair)\n            {\n                return Match.InverseMatch;\n            }\n\n            return Match.NoMatch;\n        }\n\n        public static bool IsValidSecurityType(SecurityType? securityType, bool throwException)\n        {\n            if (securityType == null)\n            {\n                if (throwException)\n                {\n                    throw new ArgumentException(\"Currency pair must not be null\");\n                }\n                return false;\n            }\n\n            if (securityType != SecurityType.Forex &&\n                securityType != SecurityType.Cfd &&\n                securityType != SecurityType.Crypto &&\n                securityType != SecurityType.CryptoFuture)\n            {\n                if (throwException)\n                {\n                    throw new ArgumentException($\"Unsupported security type: {securityType}\");\n                }\n                return false;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/DateTimeJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides a json converter that allows defining the date time format used\n    /// </summary>\n    public class DateTimeJsonConverter : JsonConverter\n    {\n        private readonly List<IsoDateTimeConverter> _converters;\n\n        /// <summary>\n        /// True, can read a json into a date time\n        /// </summary>\n        public override bool CanRead => true;\n\n        /// <summary>\n        /// True, can write a datetime to json\n        /// </summary>\n        public override bool CanWrite => true;\n\n        /// <summary>\n        ///  Initializes a new instance of the <see cref=\"DateTimeJsonConverter\"/> class\n        /// </summary>\n        /// <param name=\"format\">>The date time format</param>\n        public DateTimeJsonConverter(string format)\n        {\n            _converters = [new IsoDateTimeConverter() { DateTimeFormat = format }];\n        }\n\n        /// <summary>\n        ///  Initializes a new instance of the <see cref=\"DateTimeJsonConverter\"/> class\n        /// </summary>\n        /// <param name=\"format\">>The date time format</param>\n        /// <param name=\"format2\">Other format for backwards compatibility</param>\n        public DateTimeJsonConverter(string format, string format2) : this(format)\n        {\n            _converters.Add(new IsoDateTimeConverter() { DateTimeFormat = format2 });\n        }\n\n        /// <summary>\n        ///  Initializes a new instance of the <see cref=\"DateTimeJsonConverter\"/> class\n        /// </summary>\n        /// <param name=\"format\">>The date time format</param>\n        /// <param name=\"format2\">Other format for backwards compatibility</param>\n        /// <param name=\"format3\">Other format for backwards compatibility</param>\n        public DateTimeJsonConverter(string format, string format2, string format3) : this(format, format2)\n        {\n            _converters.Add(new IsoDateTimeConverter() { DateTimeFormat = format3 });\n        }\n\n        /// <summary>\n        /// True if can convert the given object type\n        /// </summary>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(DateTime) || objectType == typeof(string) || objectType == typeof(DateTime?);\n        }\n\n        /// <summary>\n        /// Converts the given value\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            foreach (var converter in _converters)\n            {\n                try\n                {\n                    return converter.ReadJson(reader, objectType, existingValue, serializer);\n                }\n                catch\n                {\n                }\n            }\n            throw new JsonSerializationException($\"Unexpected value when converting date. Expected formats: {string.Join(\",\", _converters.Select(x => x.DateTimeFormat))}\");\n        }\n\n        /// <summary>\n        /// Writes the given value to json\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            _converters[0].WriteJson(writer, value, serializer);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/DecimalJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util;\n\n/// <summary>\n/// Json converter to represent decimals as strings\n/// </summary>\npublic class DecimalJsonConverter : JsonConverter\n{\n    /// <summary>\n    /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can write JSON.\n    /// </summary>\n    /// <remarks>\n    /// This property always returns <c>false</c>, indicating that this converter does not support writing JSON.\n    /// </remarks>\n    public override bool CanWrite => false;\n\n    /// <summary>\n    /// Determines whether this instance can convert the specified object type.\n    /// </summary>\n    /// <param name=\"objectType\">Type of the object.</param>\n    /// <returns><c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.</returns>\n    public override bool CanConvert(Type objectType)\n    {\n        return objectType == typeof(decimal) || objectType == typeof(decimal?);\n    }\n\n    /// <summary>\n    /// Writes the JSON representation of the object.\n    /// </summary>\n    /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n    /// <param name=\"value\">The value.</param>\n    /// <param name=\"serializer\">The calling serializer.</param>\n    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n    {\n        throw new NotImplementedException();\n    }\n\n    /// <summary>\n    /// Reads the JSON representation of the object.\n    /// </summary>\n    /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n    /// <param name=\"objectType\">Type of the object.</param>\n    /// <param name=\"existingValue\">The existing value of object being read.</param>\n    /// <param name=\"serializer\">The calling serializer.</param>\n    /// <returns>The object value.</returns>\n    public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n    {\n        var val = reader.Value;\n\n        if (val == null)\n        {\n            if (objectType == typeof(decimal?))\n            {\n                return null;\n            }\n            throw new JsonSerializationException($\"Cannot convert null value to {objectType}.\");\n        }\n\n        if (val is decimal dec)\n        {\n            return dec;\n        }\n\n        if (val is double d)\n        {\n            return d.SafeDecimalCast();\n        }\n\n        if (val is string str && TryParse(str, out var res))\n        {\n            return res;\n        }\n\n        return Convert.ToDecimal(val, CultureInfo.InvariantCulture);\n    }\n\n    private static bool TryParse(string str, out decimal value)\n    {\n        return decimal.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out value);\n    }\n}\n"
  },
  {
    "path": "Common/Util/DisposableExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides extensions methods for <see cref=\"IDisposable\"/>\n    /// </summary>\n    public static class DisposableExtensions\n    {\n        /// <summary>\n        /// Calls <see cref=\"IDisposable.Dispose\"/> within a try/catch and logs any errors.\n        /// </summary>\n        /// <param name=\"disposable\">The <see cref=\"IDisposable\"/> to be disposed</param>\n        /// <returns>True if the object was successfully disposed, false if an error was thrown</returns>\n        public static bool DisposeSafely(this IDisposable disposable)\n        {\n            return disposable.DisposeSafely(error => Log.Error(error));\n        }\n\n        /// <summary>\n        /// Calls <see cref=\"IDisposable.Dispose\"/> within a try/catch and invokes the\n        /// <paramref name=\"errorHandler\"/> on any errors.\n        /// </summary>\n        /// <param name=\"disposable\">The <see cref=\"IDisposable\"/> to be disposed</param>\n        /// <param name=\"errorHandler\">Error handler delegate invoked if an exception is thrown\n        /// while calling <see cref=\"IDisposable.Dispose\"/></param> on <paramref name=\"disposable\"/>\n        /// <returns>True if the object was successfully disposed, false if an error was thrown or\n        /// the specified disposable was null</returns>\n        public static bool DisposeSafely(this IDisposable disposable, Action<Exception> errorHandler)\n        {\n            if (disposable == null)\n            {\n                return false;\n            }\n\n            try\n            {\n                disposable.Dispose();\n                return true;\n            }\n            catch (ObjectDisposedException)\n            {\n                // we got what we wanted, the object has been disposed\n                return true;\n            }\n            catch (Exception error)\n            {\n                errorHandler(error);\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/DoubleUnixSecondsDateTimeJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Defines a <see cref=\"JsonConverter\"/> that serializes <see cref=\"DateTime\"/> use the number of whole and fractional seconds since unix epoch\n    /// </summary>\n    public class DoubleUnixSecondsDateTimeJsonConverter : TypeChangeJsonConverter<DateTime?, double?>\n    {\n        private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(DateTime)\n                || objectType == typeof(DateTime?);\n        }\n\n        /// <summary>\n        /// Convert the input value to a value to be serialzied\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialziation</param>\n        /// <returns>A new instance of TResult that is to be serialzied</returns>\n        protected override double? Convert(DateTime? value)\n        {\n            if (value == null)\n            {\n                return null;\n            }\n\n            return (value.Value - UnixEpoch).TotalSeconds;\n        }\n\n        /// <summary>\n        /// Converts the input value to be deserialized\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override DateTime? Convert(double? value)\n        {\n            if (value == null)\n            {\n                return null;\n            }\n\n            return UnixEpoch.AddSeconds(value.Value);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/EnumeratorExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides convenience of linq extension methods for <see cref=\"IEnumerator{T}\"/> types\n    /// </summary>\n    public static class EnumeratorExtensions\n    {\n        /// <summary>\n        /// Filter the enumerator using the specified predicate\n        /// </summary>\n        public static IEnumerator<T> Where<T>(this IEnumerator<T> enumerator, Func<T, bool> predicate)\n        {\n            using (enumerator)\n            {\n                while (enumerator.MoveNext())\n                {\n                    if (predicate(enumerator.Current))\n                    {\n                        yield return enumerator.Current;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Project the enumerator using the specified selector\n        /// </summary>\n        public static IEnumerator<TResult> Select<T, TResult>(this IEnumerator<T> enumerator, Func<T, TResult> selector)\n        {\n            using (enumerator)\n            {\n                while (enumerator.MoveNext())\n                {\n                    yield return selector(enumerator.Current);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Project the enumerator using the specified selector\n        /// </summary>\n        public static IEnumerator<TResult> SelectMany<T, TResult>(this IEnumerator<T> enumerator, Func<T, IEnumerator<TResult>> selector)\n        {\n            using (enumerator)\n            {\n                while (enumerator.MoveNext())\n                {\n                    using (var inner = selector(enumerator.Current))\n                    {\n                        while (inner.MoveNext())\n                        {\n                            yield return inner.Current;\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ExpressionBuilder.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides methods for constructing expressions at runtime\n    /// </summary>\n    public static class ExpressionBuilder\n    {\n        /// <summary>\n        /// Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type'\n        /// </summary>\n        /// <param name=\"type\">The type of the parameter in the expression</param>\n        /// <param name=\"propertyOrField\">The name of the property or field to bind to</param>\n        /// <returns>A new lambda expression that represents accessing the property or field on 'type'</returns>\n        public static LambdaExpression MakePropertyOrFieldSelector(Type type, string propertyOrField)\n        {\n            var parameter = Expression.Parameter(type);\n            var property = Expression.PropertyOrField(parameter, propertyOrField);\n            var lambda = Expression.Lambda(property, parameter);\n            return lambda;\n        }\n\n        /// <summary>\n        /// Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type'\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter in the expression</typeparam>\n        /// <typeparam name=\"TProperty\">The type of the property or field being accessed in the expression</typeparam>\n        /// <param name=\"propertyOrField\">The name of the property or field to bind to</param>\n        /// <returns>A new lambda expression that represents accessing the property or field on 'type'</returns>\n        public static Expression<Func<T, TProperty>> MakePropertyOrFieldSelector<T, TProperty>(string propertyOrField)\n        {\n            return (Expression<Func<T, TProperty>>) MakePropertyOrFieldSelector(typeof (T), propertyOrField);\n        }\n\n        /// <summary>\n        /// Constructs a lambda expression that accepts two parameters of type <typeparamref name=\"T\"/> and applies\n        /// the specified binary comparison and returns the boolean result.\n        /// </summary>\n        public static Expression<Func<T, T, bool>> MakeBinaryComparisonLambda<T>(ExpressionType type)\n        {\n            if (!type.IsBinaryComparison())\n            {\n                throw new ArgumentException($\"Provided ExpressionType '{type}' is not a binary comparison.\");\n            }\n\n            var left = Expression.Parameter(typeof(T), \"left\");\n            var right = Expression.Parameter(typeof(T), \"right\");\n            var body = Expression.MakeBinary(type, left, right);\n            var lambda = Expression.Lambda<Func<T, T, bool>>(body, left, right);\n            return lambda;\n        }\n\n        /// <summary>\n        /// Determines whether or not the specified <paramref name=\"type\"/> is a binary comparison.\n        /// </summary>\n        public static bool IsBinaryComparison(this ExpressionType type)\n        {\n            switch (type)\n            {\n                case ExpressionType.Equal:\n                case ExpressionType.NotEqual:\n                case ExpressionType.LessThan:\n                case ExpressionType.LessThanOrEqual:\n                case ExpressionType.GreaterThan:\n                case ExpressionType.GreaterThanOrEqual:\n                    return true;\n\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified expression into an enumerable of expressions by walking the expression tree\n        /// </summary>\n        /// <param name=\"expression\">The expression to enumerate</param>\n        /// <returns>An enumerable containing all expressions in the input expression</returns>\n        public static IEnumerable<Expression> AsEnumerable(this Expression expression)\n        {\n            var walker = new ExpressionWalker();\n            walker.Visit(expression);\n            return walker.Expressions;\n        }\n\n        /// <summary>\n        /// Returns all the expressions of the specified type in the given expression tree\n        /// </summary>\n        /// <typeparam name=\"T\">The type of expression to search for</typeparam>\n        /// <param name=\"expression\">The expression to search</param>\n        /// <returns>All expressions of the given type in the specified expression</returns>\n        public static IEnumerable<T> OfType<T>(this Expression expression)\n            where T : Expression\n        {\n            return expression.AsEnumerable().OfType<T>();\n        }\n\n        /// <summary>\n        /// Returns the single expression of the specified type or throws if none or more than one expression\n        /// of the specified type is contained within the expression.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of expression to search for</typeparam>\n        /// <param name=\"expression\">The expression to search</param>\n        /// <returns>Expression of the specified type</returns>\n        public static T Single<T>(this Expression expression)\n            where T : Expression\n        {\n            return expression.AsEnumerable().OfType<T>().Single();\n        }\n\n        /// <summary>\n        /// Returns the single expression of the specified type or throws if none or more than one expression\n        /// of the specified type is contained within the expression.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of expression to search for</typeparam>\n        /// <param name=\"expressions\">The expressions to search</param>\n        /// <returns>Expression of the specified type</returns>\n        public static T Single<T>(this IEnumerable<Expression> expressions)\n            where T : Expression\n        {\n            return expressions.OfType<T>().Single();\n        }\n\n        private class ExpressionWalker : ExpressionVisitor\n        {\n            public readonly HashSet<Expression> Expressions = new HashSet<Expression>();\n            public override Expression Visit(Expression node)\n            {\n                Expressions.Add(node);\n                return base.Visit(node);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/FixedSizeHashQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides an implementation of an add-only fixed length, unique queue system\n    /// </summary>\n    public class FixedSizeHashQueue<T> : IEnumerable<T>\n    {\n        private readonly int _size;\n        private readonly Queue<T> _queue; \n        private readonly HashSet<T> _hash; \n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FixedSizeHashQueue{T}\"/> class\n        /// </summary>\n        /// <param name=\"size\">The maximum number of items to hold</param>\n        public FixedSizeHashQueue(int size)\n        {\n            _size = size;\n            _queue = new Queue<T>(size);\n            _hash = new HashSet<T>();\n        }\n\n        /// <summary>\n        /// Returns true if the item was added and didn't already exists\n        /// </summary>\n        public bool Add(T item)\n        {\n            if (_hash.Add(item))\n            {\n                _queue.Enqueue(item);\n                if (_queue.Count > _size)\n                {\n                    // remove the item from both\n                    _hash.Remove(_queue.Dequeue());\n                }\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Tries to inspect the first item in the queue\n        /// </summary>\n        public bool TryPeek(out T item)\n        {\n            return _queue.TryPeek(out item);\n        }\n\n        /// <summary>\n        /// Dequeues and returns the next item in the queue\n        /// </summary>\n        public T Dequeue()\n        {\n            var item = _queue.Dequeue();\n            _hash.Remove(item);\n            return item;\n        }\n\n        /// <summary>\n        /// Returns true if the specified item exists in the collection\n        /// </summary>\n        public bool Contains(T item)\n        {\n            return _hash.Contains(item);\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<T> GetEnumerator()\n        {\n            return _queue.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/FixedSizeQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util \n{\n    /// <summary>\n    /// Helper method for a limited length queue which self-removes the extra elements.\n    /// http://stackoverflow.com/questions/5852863/fixed-size-queue-which-automatically-dequeues-old-values-upon-new-enques\n    /// </summary>\n    /// <typeparam name=\"T\">The type of item the queue holds</typeparam>\n    public class FixedSizeQueue<T> : Queue<T>\n    {\n        private int _limit = -1;\n\n        /// <summary>\n        /// Max Length \n        /// </summary>\n        public int Limit\n        {\n            get { return _limit; }\n            set { _limit = value; }\n        }\n\n        /// <summary>\n        /// Create a new fixed length queue:\n        /// </summary>\n        public FixedSizeQueue(int limit)\n            : base(limit)\n        {\n            Limit = limit;\n        }\n\n        /// <summary>\n        /// Enqueue a new item int the generic fixed length queue:\n        /// </summary>\n        public new void Enqueue(T item)\n        {\n            while (Count >= Limit)\n            {\n                Dequeue();\n            }\n            base.Enqueue(item);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/FuncTextWriter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Text;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"TextWriter\"/> that redirects Write(string) and WriteLine(string)\n    /// </summary>\n    public class FuncTextWriter : TextWriter\n    {\n        private readonly Action<string> _writer;\n\n        /// <inheritdoc />\n        public override Encoding Encoding\n        {\n            get { return Encoding.Default; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncTextWriter\"/> that will direct\n        /// messages to the algorithm's Debug function.\n        /// </summary>\n        /// <param name=\"writer\">The algorithm hosting the Debug function where messages will be directed</param>\n        public FuncTextWriter(Action<string> writer)\n        {\n            _writer = writer;\n        }\n\n        /// <summary>\n        /// Writes the string value using the delegate provided at construction\n        /// </summary>\n        /// <param name=\"value\">The string value to be written</param>\n        public override void Write(string value)\n        {\n            _writer(value);\n        }\n\n        /// <summary>\n        /// Writes the string value using the delegate provided at construction\n        /// </summary>\n        /// <param name=\"value\"></param>\n        public override void WriteLine(string value)\n        {\n            // these are grouped in a list so we don't need to add new line characters here\n            _writer(value);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/JsonRoundingConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Helper <see cref=\"JsonConverter\"/> that will round decimal and double types,\n    /// to <see cref=\"FractionalDigits\"/> fractional digits\n    /// </summary>\n    public class JsonRoundingConverter : JsonConverter\n    {\n        /// <summary>\n        /// The number of fractional digits to round to\n        /// </summary>\n        public const int FractionalDigits = 4;\n\n        /// <summary>\n        /// Will always return false.\n        /// Gets a value indicating whether this <see cref=\"T:Newtonsoft.Json.JsonConverter\" /> can read JSON.\n        /// </summary>\n        public override bool CanRead => false;\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>True if this instance can convert the specified object type</returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(decimal)\n                || objectType == typeof(double);\n        }\n\n        /// <summary>\n        /// Not implemented, will throw <see cref=\"NotImplementedException\"/>\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            if (value is double)\n            {\n                var rounded = Math.Round((double)value, FractionalDigits);\n                writer.WriteValue(rounded.ToString(CultureInfo.InvariantCulture));\n            }\n            else\n            {\n                // we serialize decimal as string so that json doesn't use exponential notation which actually will lose precision\n                var rounded = Math.Round(Convert.ToDecimal(value, CultureInfo.InvariantCulture), FractionalDigits);\n                writer.WriteValue(rounded.ToString(CultureInfo.InvariantCulture));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/KeyStringSynchronizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Helper class to synchronize execution based on a string key\n    /// </summary>\n    public class KeyStringSynchronizer\n    {\n        private readonly Dictionary<string, string> _currentStrings = new ();\n\n        /// <summary>\n        /// Execute the given action synchronously with any other thread using the same key\n        /// </summary>\n        /// <param name=\"key\">The synchronization key</param>\n        /// <param name=\"singleExecution\">True if execution should happen only once at the same time for multiple threads</param>\n        /// <param name=\"action\">The action to execute</param>\n        public void Execute(string key, bool singleExecution, Action action)\n        {\n            ExecuteImplementation(key, singleExecution, action);\n        }\n\n        /// <summary>\n        /// Execute the given function synchronously with any other thread using the same key\n        /// </summary>\n        /// <param name=\"key\">The synchronization key</param>\n        /// <param name=\"action\">The function to execute</param>\n        public T Execute<T>(string key, Func<T> action)\n        {\n            T result = default;\n            ExecuteImplementation(key, singleExecution: false, () =>\n            {\n                result = action();\n            });\n            return result;\n        }\n\n        private void ExecuteImplementation(string key, bool singleExecution, Action action)\n        {\n            lock (key)\n            {\n                while (true)\n                {\n                    bool lockTaken = false;\n                    string existingKey;\n                    lock (_currentStrings)\n                    {\n                        if(!_currentStrings.TryGetValue(key, out existingKey))\n                        {\n                            _currentStrings[key] = existingKey = key;\n                        }\n                    }\n\n                    try\n                    {\n                        lockTaken = Monitor.TryEnter(existingKey);\n                        // this way we can handle reentry with no issues\n                        if (lockTaken)\n                        {\n                            try\n                            {\n                                // happy case\n                                action();\n                                return;\n                            }\n                            finally\n                            {\n                                lock (_currentStrings)\n                                {\n                                    // even if we fail we need to release it\n                                    _currentStrings.Remove(key);\n                                }\n                            }\n                        }\n                    }\n                    finally\n                    {\n                        if (lockTaken)\n                        {\n                            Monitor.Exit(existingKey);\n                        }\n                    }\n\n                    lock (existingKey)\n                    {\n                        // if we are here the thread that had the lock finished\n                        if (!singleExecution)\n                        {\n                            // time to try again!\n                            continue;\n                        }\n                        return;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/LeanData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides methods for generating lean data file content\n    /// </summary>\n    public static class LeanData\n    {\n        private static readonly HashSet<Type> _strictDailyEndTimesDataTypes = new()\n        {\n            // the underlying could yield auxiliary data which we don't want to change\n            typeof(TradeBar), typeof(QuoteBar), typeof(BaseDataCollection), typeof(OpenInterest)\n        };\n\n        /// <summary>\n        /// The different <see cref=\"SecurityType\"/> used for data paths\n        /// </summary>\n        /// <remarks>This includes 'alternative'</remarks>\n        public static HashSet<string> SecurityTypeAsDataPath => Enum.GetNames(typeof(SecurityType))\n            .Select(x => x.ToLowerInvariant()).Union(new[] { \"alternative\" }).ToHashSet();\n\n        /// <summary>\n        /// Converts the specified base data instance into a lean data file csv line.\n        /// This method takes into account the fake that base data instances typically\n        /// are time stamped in the exchange time zone, but need to be written to disk\n        /// in the data time zone.\n        /// </summary>\n        public static string GenerateLine(IBaseData data, Resolution resolution, DateTimeZone exchangeTimeZone, DateTimeZone dataTimeZone)\n        {\n            var clone = data.Clone();\n            clone.Time = data.Time.ConvertTo(exchangeTimeZone, dataTimeZone);\n            return GenerateLine(clone, clone.Symbol.ID.SecurityType, resolution);\n        }\n\n        /// <summary>\n        /// Helper method that will parse a given data line in search of an associated date time\n        /// </summary>\n        public static DateTime ParseTime(string line, DateTime date, Resolution resolution)\n        {\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                case Resolution.Second:\n                case Resolution.Minute:\n                    var index = line.IndexOf(',', StringComparison.InvariantCulture);\n                    return date.AddTicks(Convert.ToInt64(10000 * decimal.Parse(line.AsSpan(0, index))));\n                case Resolution.Hour:\n                case Resolution.Daily:\n                    return DateTime.ParseExact(line.AsSpan(0, DateFormat.TwelveCharacter.Length), DateFormat.TwelveCharacter, CultureInfo.InvariantCulture);\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n            }\n        }\n\n        /// <summary>\n        /// Converts the specified base data instance into a lean data file csv line\n        /// </summary>\n        public static string GenerateLine(IBaseData data, SecurityType securityType, Resolution resolution)\n        {\n            var milliseconds = data.Time.TimeOfDay.TotalMilliseconds.ToString(CultureInfo.InvariantCulture);\n            var longTime = data.Time.ToStringInvariant(DateFormat.TwelveCharacter);\n\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = (Tick)data;\n                            if (tick.TickType == TickType.Trade)\n                            {\n                                return ToCsv(milliseconds, Scale(tick.LastPrice), tick.Quantity, tick.ExchangeCode, tick.SaleCondition, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.Quote)\n                            {\n                                return ToCsv(milliseconds, Scale(tick.BidPrice), tick.BidSize, Scale(tick.AskPrice), tick.AskSize, tick.ExchangeCode, tick.SaleCondition, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            break;\n                        case Resolution.Minute:\n                        case Resolution.Second:\n                            var tradeBar = data as TradeBar;\n                            if (tradeBar != null)\n                            {\n                                return ToCsv(milliseconds, Scale(tradeBar.Open), Scale(tradeBar.High), Scale(tradeBar.Low), Scale(tradeBar.Close), tradeBar.Volume);\n                            }\n                            var quoteBar = data as QuoteBar;\n                            if (quoteBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    ToScaledCsv(quoteBar.Bid), quoteBar.LastBidSize,\n                                    ToScaledCsv(quoteBar.Ask), quoteBar.LastAskSize);\n                            }\n                            break;\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            var bigTradeBar = data as TradeBar;\n                            if (bigTradeBar != null)\n                            {\n                                return ToCsv(longTime, Scale(bigTradeBar.Open), Scale(bigTradeBar.High), Scale(bigTradeBar.Low), Scale(bigTradeBar.Close), bigTradeBar.Volume);\n                            }\n                            var bigQuoteBar = data as QuoteBar;\n                            if (bigQuoteBar != null)\n                            {\n                                return ToCsv(longTime,\n                                    ToScaledCsv(bigQuoteBar.Bid), bigQuoteBar.LastBidSize,\n                                    ToScaledCsv(bigQuoteBar.Ask), bigQuoteBar.LastAskSize);\n                            }\n                            break;\n                    }\n                    break;\n\n                case SecurityType.Crypto:\n                case SecurityType.CryptoFuture:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = data as Tick;\n                            if (tick == null)\n                            {\n                                throw new ArgumentException($\"{securityType} tick could not be created\", nameof(data));\n                            }\n                            if (tick.TickType == TickType.Trade)\n                            {\n                                return ToCsv(milliseconds, tick.LastPrice, tick.Quantity, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.Quote)\n                            {\n                                return ToCsv(milliseconds, tick.BidPrice, tick.BidSize, tick.AskPrice, tick.AskSize, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            throw new ArgumentException($\"{securityType} tick could not be created\");\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            var quoteBar = data as QuoteBar;\n                            if (quoteBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    ToNonScaledCsv(quoteBar.Bid), quoteBar.LastBidSize,\n                                    ToNonScaledCsv(quoteBar.Ask), quoteBar.LastAskSize);\n                            }\n                            var tradeBar = data as TradeBar;\n                            if (tradeBar != null)\n                            {\n                                return ToCsv(milliseconds, tradeBar.Open, tradeBar.High, tradeBar.Low, tradeBar.Close, tradeBar.Volume);\n                            }\n                            throw new ArgumentException($\"{securityType} minute/second bar could not be created\", nameof(data));\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            var bigQuoteBar = data as QuoteBar;\n                            if (bigQuoteBar != null)\n                            {\n                                return ToCsv(longTime,\n                                    ToNonScaledCsv(bigQuoteBar.Bid), bigQuoteBar.LastBidSize,\n                                    ToNonScaledCsv(bigQuoteBar.Ask), bigQuoteBar.LastAskSize);\n                            }\n                            var bigTradeBar = data as TradeBar;\n                            if (bigTradeBar != null)\n                            {\n                                return ToCsv(longTime,\n                                             bigTradeBar.Open,\n                                             bigTradeBar.High,\n                                             bigTradeBar.Low,\n                                             bigTradeBar.Close,\n                                             bigTradeBar.Volume);\n                            }\n                            throw new ArgumentException($\"{securityType} hour/daily bar could not be created\", nameof(data));\n                    }\n                    break;\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = data as Tick;\n                            if (tick == null)\n                            {\n                                throw new ArgumentException(\"Expected data of type 'Tick'\", nameof(data));\n                            }\n                            return ToCsv(milliseconds, tick.BidPrice, tick.AskPrice);\n\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            var bar = data as QuoteBar;\n                            if (bar == null)\n                            {\n                                throw new ArgumentException(\"Expected data of type 'QuoteBar'\", nameof(data));\n                            }\n                            return ToCsv(milliseconds,\n                                ToNonScaledCsv(bar.Bid), bar.LastBidSize,\n                                ToNonScaledCsv(bar.Ask), bar.LastAskSize);\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            var bigBar = data as QuoteBar;\n                            if (bigBar == null)\n                            {\n                                throw new ArgumentException(\"Expected data of type 'QuoteBar'\", nameof(data));\n                            }\n                            return ToCsv(longTime,\n                                ToNonScaledCsv(bigBar.Bid), bigBar.LastBidSize,\n                                ToNonScaledCsv(bigBar.Ask), bigBar.LastAskSize);\n                    }\n                    break;\n\n                case SecurityType.Index:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = (Tick)data;\n                            return ToCsv(milliseconds, tick.LastPrice, tick.Quantity, string.Empty, string.Empty, \"0\");\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            var bar = data as TradeBar;\n                            if (bar == null)\n                            {\n                                throw new ArgumentException(\"Expected data of type 'TradeBar'\", nameof(data));\n                            }\n                            return ToCsv(milliseconds, bar.Open, bar.High, bar.Low, bar.Close, bar.Volume);\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            var bigTradeBar = data as TradeBar;\n                            return ToCsv(longTime, bigTradeBar.Open, bigTradeBar.High, bigTradeBar.Low, bigTradeBar.Close, bigTradeBar.Volume);\n                    }\n                    break;\n\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = (Tick)data;\n                            if (tick.TickType == TickType.Trade)\n                            {\n                                return ToCsv(milliseconds,\n                                    Scale(tick.LastPrice), tick.Quantity, tick.ExchangeCode, tick.SaleCondition, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.Quote)\n                            {\n                                return ToCsv(milliseconds,\n                                    Scale(tick.BidPrice), tick.BidSize, Scale(tick.AskPrice), tick.AskSize, tick.ExchangeCode, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.OpenInterest)\n                            {\n                                return ToCsv(milliseconds, tick.Value);\n                            }\n                            break;\n\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            // option and future data can be quote or trade bars\n                            var quoteBar = data as QuoteBar;\n                            if (quoteBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    ToScaledCsv(quoteBar.Bid), quoteBar.LastBidSize,\n                                    ToScaledCsv(quoteBar.Ask), quoteBar.LastAskSize);\n                            }\n                            var tradeBar = data as TradeBar;\n                            if (tradeBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    Scale(tradeBar.Open), Scale(tradeBar.High), Scale(tradeBar.Low), Scale(tradeBar.Close), tradeBar.Volume);\n                            }\n                            var openInterest = data as OpenInterest;\n                            if (openInterest != null)\n                            {\n                                return ToCsv(milliseconds, openInterest.Value);\n                            }\n                            break;\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            // option and future data can be quote or trade bars\n                            var bigQuoteBar = data as QuoteBar;\n                            if (bigQuoteBar != null)\n                            {\n                                return ToCsv(longTime,\n                                    ToScaledCsv(bigQuoteBar.Bid), bigQuoteBar.LastBidSize,\n                                    ToScaledCsv(bigQuoteBar.Ask), bigQuoteBar.LastAskSize);\n                            }\n                            var bigTradeBar = data as TradeBar;\n                            if (bigTradeBar != null)\n                            {\n                                return ToCsv(longTime, ToScaledCsv(bigTradeBar), bigTradeBar.Volume);\n                            }\n                            var bigOpenInterest = data as OpenInterest;\n                            if (bigOpenInterest != null)\n                            {\n                                return ToCsv(longTime, bigOpenInterest.Value);\n                            }\n                            break;\n\n                        default:\n                            throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n                    }\n                    break;\n\n                case SecurityType.FutureOption:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = (Tick)data;\n                            if (tick.TickType == TickType.Trade)\n                            {\n                                return ToCsv(milliseconds,\n                                    tick.LastPrice, tick.Quantity, tick.ExchangeCode, tick.SaleCondition, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.Quote)\n                            {\n                                return ToCsv(milliseconds,\n                                    tick.BidPrice, tick.BidSize, tick.AskPrice, tick.AskSize, tick.ExchangeCode, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.OpenInterest)\n                            {\n                                return ToCsv(milliseconds, tick.Value);\n                            }\n                            break;\n\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            // option and future data can be quote or trade bars\n                            var quoteBar = data as QuoteBar;\n                            if (quoteBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    ToNonScaledCsv(quoteBar.Bid), quoteBar.LastBidSize,\n                                    ToNonScaledCsv(quoteBar.Ask), quoteBar.LastAskSize);\n                            }\n                            var tradeBar = data as TradeBar;\n                            if (tradeBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    tradeBar.Open, tradeBar.High, tradeBar.Low, tradeBar.Close, tradeBar.Volume);\n                            }\n                            var openInterest = data as OpenInterest;\n                            if (openInterest != null)\n                            {\n                                return ToCsv(milliseconds, openInterest.Value);\n                            }\n                            break;\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            // option and future data can be quote or trade bars\n                            var bigQuoteBar = data as QuoteBar;\n                            if (bigQuoteBar != null)\n                            {\n                                return ToCsv(longTime,\n                                    ToNonScaledCsv(bigQuoteBar.Bid), bigQuoteBar.LastBidSize,\n                                    ToNonScaledCsv(bigQuoteBar.Ask), bigQuoteBar.LastAskSize);\n                            }\n                            var bigTradeBar = data as TradeBar;\n                            if (bigTradeBar != null)\n                            {\n                                return ToCsv(longTime, ToNonScaledCsv(bigTradeBar), bigTradeBar.Volume);\n                            }\n                            var bigOpenInterest = data as OpenInterest;\n                            if (bigOpenInterest != null)\n                            {\n                                return ToCsv(longTime, bigOpenInterest.Value);\n                            }\n                            break;\n\n                        default:\n                            throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n                    }\n                    break;\n\n                case SecurityType.Future:\n                    switch (resolution)\n                    {\n                        case Resolution.Tick:\n                            var tick = (Tick)data;\n                            if (tick.TickType == TickType.Trade)\n                            {\n                                return ToCsv(milliseconds,\n                                             tick.LastPrice, tick.Quantity, tick.ExchangeCode, tick.SaleCondition, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.Quote)\n                            {\n                                return ToCsv(milliseconds,\n                                             tick.BidPrice, tick.BidSize, tick.AskPrice, tick.AskSize, tick.ExchangeCode, tick.Suspicious ? \"1\" : \"0\");\n                            }\n                            if (tick.TickType == TickType.OpenInterest)\n                            {\n                                return ToCsv(milliseconds, tick.Value);\n                            }\n                            break;\n\n                        case Resolution.Second:\n                        case Resolution.Minute:\n                            // option and future data can be quote or trade bars\n                            var quoteBar = data as QuoteBar;\n                            if (quoteBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                    ToNonScaledCsv(quoteBar.Bid), quoteBar.LastBidSize,\n                                    ToNonScaledCsv(quoteBar.Ask), quoteBar.LastAskSize);\n                            }\n                            var tradeBar = data as TradeBar;\n                            if (tradeBar != null)\n                            {\n                                return ToCsv(milliseconds,\n                                             tradeBar.Open, tradeBar.High, tradeBar.Low, tradeBar.Close, tradeBar.Volume);\n                            }\n                            var openInterest = data as OpenInterest;\n                            if (openInterest != null)\n                            {\n                                return ToCsv(milliseconds, openInterest.Value);\n                            }\n                            break;\n\n                        case Resolution.Hour:\n                        case Resolution.Daily:\n                            // option and future data can be quote or trade bars\n                            var bigQuoteBar = data as QuoteBar;\n                            if (bigQuoteBar != null)\n                            {\n                                return ToCsv(longTime,\n                                    ToNonScaledCsv(bigQuoteBar.Bid), bigQuoteBar.LastBidSize,\n                                    ToNonScaledCsv(bigQuoteBar.Ask), bigQuoteBar.LastAskSize);\n                            }\n                            var bigTradeBar = data as TradeBar;\n                            if (bigTradeBar != null)\n                            {\n                                return ToCsv(longTime, ToNonScaledCsv(bigTradeBar), bigTradeBar.Volume);\n                            }\n                            var bigOpenInterest = data as OpenInterest;\n                            if (bigOpenInterest != null)\n                            {\n                                return ToCsv(longTime, bigOpenInterest.Value);\n                            }\n                            break;\n\n                        default:\n                            throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n                    }\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(securityType), securityType, null);\n            }\n\n            throw new NotImplementedException(Invariant(\n                $\"LeanData.GenerateLine has not yet been implemented for security type: {securityType} at resolution: {resolution}\"\n            ));\n        }\n\n        /// <summary>\n        /// Gets the data type required for the specified combination of resolution and tick type\n        /// </summary>\n        /// <param name=\"resolution\">The resolution, if Tick, the Type returned is always Tick</param>\n        /// <param name=\"tickType\">The <see cref=\"TickType\"/> that primarily dictates the type returned</param>\n        /// <returns>The Type used to create a subscription</returns>\n        public static Type GetDataType(Resolution resolution, TickType tickType)\n        {\n            if (resolution == Resolution.Tick) return typeof(Tick);\n            if (tickType == TickType.OpenInterest) return typeof(OpenInterest);\n            if (tickType == TickType.Quote) return typeof(QuoteBar);\n            return typeof(TradeBar);\n        }\n\n\n        /// <summary>\n        /// Determines if the Type is a 'common' type used throughout lean\n        /// This method is helpful in creating <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <param name=\"baseDataType\">The Type to check</param>\n        /// <returns>A bool indicating whether the type is of type <see cref=\"TradeBar\"/>\n        ///  <see cref=\"QuoteBar\"/> or <see cref=\"OpenInterest\"/></returns>\n        public static bool IsCommonLeanDataType(Type baseDataType)\n        {\n            if (baseDataType == typeof(Tick) ||\n                baseDataType == typeof(TradeBar) ||\n                baseDataType == typeof(QuoteBar) ||\n                baseDataType == typeof(OpenInterest))\n            {\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Helper method to determine if a configuration set is valid\n        /// </summary>\n        public static bool IsValidConfiguration(SecurityType securityType, Resolution resolution, TickType tickType)\n        {\n            if (securityType == SecurityType.Equity && (resolution == Resolution.Daily || resolution == Resolution.Hour))\n            {\n                return tickType != TickType.Quote;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Generates the full zip file path rooted in the <paramref name=\"dataDirectory\"/>\n        /// </summary>\n        public static string GenerateZipFilePath(string dataDirectory, Symbol symbol, DateTime date, Resolution resolution, TickType tickType)\n        {\n            // we could call 'GenerateRelativeZipFilePath' but we don't to avoid an extra string & path combine we are doing to drop right away\n            return Path.Combine(dataDirectory, GenerateRelativeZipFileDirectory(symbol, resolution), GenerateZipFileName(symbol, date, resolution, tickType));\n        }\n\n        /// <summary>\n        /// Generates the full zip file path rooted in the <paramref name=\"dataDirectory\"/>\n        /// </summary>\n        public static string GenerateZipFilePath(string dataDirectory, string symbol, SecurityType securityType, string market, DateTime date, Resolution resolution)\n        {\n            return Path.Combine(dataDirectory, GenerateRelativeZipFilePath(symbol, securityType, market, date, resolution));\n        }\n\n        /// <summary>\n        /// Generates the relative zip directory for the specified symbol/resolution\n        /// </summary>\n        public static string GenerateRelativeZipFileDirectory(Symbol symbol, Resolution resolution)\n        {\n            var isHourOrDaily = resolution == Resolution.Hour || resolution == Resolution.Daily;\n            var securityType = symbol.SecurityType.SecurityTypeToLower();\n\n            var market = symbol.ID.Market.ToLowerInvariant();\n            var res = resolution.ResolutionToLower();\n            var directory = Path.Combine(securityType, market, res);\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                case SecurityType.Index:\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                case SecurityType.Crypto:\n                    return !isHourOrDaily ? Path.Combine(directory, symbol.Value.ToLowerInvariant()) : directory;\n\n                case SecurityType.IndexOption:\n                    // For index options, we use the canonical option ticker since it can differ from the underlying's ticker.\n                    return !isHourOrDaily ? Path.Combine(directory, symbol.ID.Symbol.ToLowerInvariant()) : directory;\n\n                case SecurityType.Option:\n                    // options uses the underlying symbol for pathing.\n                    return !isHourOrDaily ? Path.Combine(directory, symbol.Underlying.Value.ToLowerInvariant()) : directory;\n\n                case SecurityType.FutureOption:\n                    // For futures options, we use the canonical option ticker plus the underlying's expiry\n                    // since it can differ from the underlying's ticker. We differ from normal futures\n                    // because the option chain can be extraordinarily large compared to equity option chains.\n                    var futureOptionPath = Path.Combine(symbol.ID.Symbol.ToLowerInvariant(),\n                         FuturesExpiryUtilityFunctions.GetFutureContractMonth(symbol).ToStringInvariant(DateFormat.YearMonth));\n\n                    return Path.Combine(directory, futureOptionPath);\n\n                case SecurityType.Future:\n                case SecurityType.CryptoFuture:\n                    return !isHourOrDaily ? Path.Combine(directory, symbol.ID.Symbol.ToLowerInvariant()) : directory;\n\n                case SecurityType.Commodity:\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Generates relative factor file paths for equities\n        /// </summary>\n        public static string GenerateRelativeFactorFilePath(Symbol symbol)\n        {\n            return Path.Combine(Globals.DataFolder,\n                                        \"equity\",\n                                        symbol.ID.Market,\n                                        \"factor_files\",\n                                        symbol.Value.ToLowerInvariant() + \".csv\");\n        }\n\n        /// <summary>\n        /// Generates the relative zip file path rooted in the /Data directory\n        /// </summary>\n        public static string GenerateRelativeZipFilePath(Symbol symbol, DateTime date, Resolution resolution, TickType tickType)\n        {\n            return Path.Combine(GenerateRelativeZipFileDirectory(symbol, resolution), GenerateZipFileName(symbol, date, resolution, tickType));\n        }\n\n        /// <summary>\n        /// Generates the relative zip file path rooted in the /Data directory\n        /// </summary>\n        public static string GenerateRelativeZipFilePath(string symbol, SecurityType securityType, string market, DateTime date, Resolution resolution)\n        {\n            var directory = Path.Combine(securityType.SecurityTypeToLower(), market.ToLowerInvariant(), resolution.ResolutionToLower());\n            if (resolution != Resolution.Daily && resolution != Resolution.Hour)\n            {\n                directory = Path.Combine(directory, symbol.ToLowerInvariant());\n            }\n\n            return Path.Combine(directory, GenerateZipFileName(symbol, securityType, date, resolution));\n        }\n\n        /// <summary>\n        /// Generates the relative directory to the universe files for the specified symbol\n        /// </summary>\n        public static string GenerateRelativeUniversesDirectory(Symbol symbol)\n        {\n            var path = Path.Combine(symbol.SecurityType.SecurityTypeToLower(), symbol.ID.Market, \"universes\");\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.Option:\n                    path = Path.Combine(path, symbol.Underlying.Value.ToLowerInvariant());\n                    break;\n\n                case SecurityType.Future:\n                case SecurityType.IndexOption:\n                    path = Path.Combine(path, symbol.ID.Symbol.ToLowerInvariant());\n                    break;\n\n                case SecurityType.FutureOption:\n                    path = Path.Combine(path,\n                        symbol.ID.Symbol.ToLowerInvariant(),\n                        FuturesExpiryUtilityFunctions.GetFutureContractMonth(symbol).ToStringInvariant(DateFormat.YearMonth));\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException($\"Unsupported security type {symbol.SecurityType}\");\n            }\n\n            return path;\n        }\n\n        /// <summary>\n        /// Generates the directory to the universe files for the specified symbol\n        /// </summary>\n        public static string GenerateUniversesDirectory(string dataDirectory, Symbol symbol)\n        {\n            return Path.Combine(dataDirectory, GenerateRelativeUniversesDirectory(symbol));\n        }\n\n        /// <summary>\n        /// Generate's the zip entry name to hold the specified data.\n        /// </summary>\n        public static string GenerateZipEntryName(Symbol symbol, DateTime date, Resolution resolution, TickType tickType)\n        {\n            var formattedDate = date.ToStringInvariant(DateFormat.EightCharacter);\n            var isHourOrDaily = resolution == Resolution.Hour || resolution == Resolution.Daily;\n\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                case SecurityType.Index:\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                case SecurityType.Crypto:\n                    if (resolution == Resolution.Tick && symbol.SecurityType == SecurityType.Equity)\n                    {\n                        return Invariant($\"{formattedDate}_{symbol.Value.ToLowerInvariant()}_{tickType}_{resolution}.csv\");\n                    }\n\n                    if (isHourOrDaily)\n                    {\n                        return $\"{symbol.Value.ToLowerInvariant()}.csv\";\n                    }\n\n                    return Invariant($\"{formattedDate}_{symbol.Value.ToLowerInvariant()}_{resolution.ResolutionToLower()}_{tickType.TickTypeToLower()}.csv\");\n\n                case SecurityType.Option:\n                    var optionPath = symbol.Underlying.Value.ToLowerInvariant();\n\n                    if (isHourOrDaily)\n                    {\n                        return string.Join(\"_\",\n                            optionPath,\n                            tickType.TickTypeToLower(),\n                            symbol.ID.OptionStyle.OptionStyleToLower(),\n                            symbol.ID.OptionRight.OptionRightToLower(),\n                            Scale(symbol.ID.StrikePrice),\n                            symbol.ID.Date.ToStringInvariant(DateFormat.EightCharacter)\n                            ) + \".csv\";\n                    }\n\n                    return string.Join(\"_\",\n                        formattedDate,\n                        optionPath,\n                        resolution.ResolutionToLower(),\n                        tickType.TickTypeToLower(),\n                        symbol.ID.OptionStyle.OptionStyleToLower(),\n                        symbol.ID.OptionRight.OptionRightToLower(),\n                        Scale(symbol.ID.StrikePrice),\n                        symbol.ID.Date.ToStringInvariant(DateFormat.EightCharacter)\n                        ) + \".csv\";\n\n                case SecurityType.IndexOption:\n                case SecurityType.FutureOption:\n                    // We want the future/index option ticker as the lookup name inside the ZIP file\n                    var optionTickerBasedPath = symbol.ID.Symbol.ToLowerInvariant();\n\n                    if (isHourOrDaily)\n                    {\n                        return string.Join(\"_\",\n                            optionTickerBasedPath,\n                            tickType.TickTypeToLower(),\n                            symbol.ID.OptionStyle.OptionStyleToLower(),\n                            symbol.ID.OptionRight.OptionRightToLower(),\n                            Scale(symbol.ID.StrikePrice),\n                            symbol.ID.Date.ToStringInvariant(DateFormat.EightCharacter)\n                            ) + \".csv\";\n                    }\n\n                    return string.Join(\"_\",\n                        formattedDate,\n                        optionTickerBasedPath,\n                        resolution.ResolutionToLower(),\n                        tickType.TickTypeToLower(),\n                        symbol.ID.OptionStyle.OptionStyleToLower(),\n                        symbol.ID.OptionRight.OptionRightToLower(),\n                        Scale(symbol.ID.StrikePrice),\n                        symbol.ID.Date.ToStringInvariant(DateFormat.EightCharacter)\n                        ) + \".csv\";\n\n                case SecurityType.Future:\n                case SecurityType.CryptoFuture:\n                    if (symbol.HasUnderlying)\n                    {\n                        symbol = symbol.Underlying;\n                    }\n\n                    string expirationTag;\n                    if (symbol.ID.Date != SecurityIdentifier.DefaultDate)\n                    {\n                        expirationTag = FuturesExpiryUtilityFunctions.GetFutureContractMonth(symbol).ToStringInvariant(DateFormat.YearMonth);\n                    }\n                    else\n                    {\n                        expirationTag = \"perp\";\n                    }\n\n                    if (isHourOrDaily)\n                    {\n                        return string.Join(\"_\",\n                            symbol.ID.Symbol.ToLowerInvariant(),\n                            tickType.TickTypeToLower(),\n                            expirationTag\n                            ) + \".csv\";\n                    }\n\n                    return string.Join(\"_\",\n                        formattedDate,\n                        symbol.ID.Symbol.ToLowerInvariant(),\n                        resolution.ResolutionToLower(),\n                        tickType.TickTypeToLower(),\n                        expirationTag\n                        ) + \".csv\";\n\n                case SecurityType.Commodity:\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Generates the zip file name for the specified date of data.\n        /// </summary>\n        public static string GenerateZipFileName(Symbol symbol, DateTime date, Resolution resolution, TickType tickType)\n        {\n            var tickTypeString = tickType.TickTypeToLower();\n            var formattedDate = date.ToStringInvariant(DateFormat.EightCharacter);\n            var isHourOrDaily = resolution == Resolution.Hour || resolution == Resolution.Daily;\n\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Index:\n                case SecurityType.Equity:\n                case SecurityType.Forex:\n                case SecurityType.Cfd:\n                    if (isHourOrDaily)\n                    {\n                        return $\"{symbol.Value.ToLowerInvariant()}.zip\";\n                    }\n\n                    return $\"{formattedDate}_{tickTypeString}.zip\";\n                case SecurityType.Crypto:\n                    if (isHourOrDaily)\n                    {\n                        return $\"{symbol.Value.ToLowerInvariant()}_{tickTypeString}.zip\";\n                    }\n\n                    return $\"{formattedDate}_{tickTypeString}.zip\";\n                case SecurityType.Option:\n                    if (isHourOrDaily)\n                    {\n                        // see TryParsePath: he knows tick type position is 3\n                        var optionPath = symbol.Underlying.Value.ToLowerInvariant();\n                        return $\"{optionPath}_{date.Year}_{tickTypeString}_{symbol.ID.OptionStyle.OptionStyleToLower()}.zip\";\n                    }\n\n                    return $\"{formattedDate}_{tickTypeString}_{symbol.ID.OptionStyle.OptionStyleToLower()}.zip\";\n\n                case SecurityType.IndexOption:\n                case SecurityType.FutureOption:\n                    if (isHourOrDaily)\n                    {\n                        // see TryParsePath: he knows tick type position is 3\n                        var optionTickerBasedPath = symbol.ID.Symbol.ToLowerInvariant();\n                        return $\"{optionTickerBasedPath}_{date.Year}_{tickTypeString}_{symbol.ID.OptionStyle.OptionStyleToLower()}.zip\";\n                    }\n\n                    return $\"{formattedDate}_{tickTypeString}_{symbol.ID.OptionStyle.OptionStyleToLower()}.zip\";\n\n                case SecurityType.Future:\n                case SecurityType.CryptoFuture:\n                    if (isHourOrDaily)\n                    {\n                        return $\"{symbol.ID.Symbol.ToLowerInvariant()}_{tickTypeString}.zip\";\n                    }\n\n                    return $\"{formattedDate}_{tickTypeString}.zip\";\n\n                case SecurityType.Commodity:\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Creates the zip file name for a QC zip data file\n        /// </summary>\n        public static string GenerateZipFileName(string symbol, SecurityType securityType, DateTime date, Resolution resolution, TickType? tickType = null)\n        {\n            if (resolution == Resolution.Hour || resolution == Resolution.Daily)\n            {\n                return $\"{symbol.ToLowerInvariant()}.zip\";\n            }\n\n            var zipFileName = date.ToStringInvariant(DateFormat.EightCharacter);\n\n            if (tickType == null)\n            {\n                if (securityType == SecurityType.Forex || securityType == SecurityType.Cfd)\n                {\n                    tickType = TickType.Quote;\n                }\n                else\n                {\n                    tickType = TickType.Trade;\n                }\n            }\n\n            var suffix = Invariant($\"_{tickType.Value.TickTypeToLower()}.zip\");\n            return zipFileName + suffix;\n        }\n\n        /// <summary>\n        /// Gets the tick type most commonly associated with the specified security type\n        /// </summary>\n        /// <param name=\"securityType\">The security type</param>\n        /// <returns>The most common tick type for the specified security type</returns>\n        public static TickType GetCommonTickType(SecurityType securityType)\n        {\n            if (securityType == SecurityType.Forex || securityType == SecurityType.Cfd || securityType == SecurityType.Crypto)\n            {\n                return TickType.Quote;\n            }\n            return TickType.Trade;\n        }\n\n        /// <summary>\n        /// Creates a symbol from the specified zip entry name\n        /// </summary>\n        /// <param name=\"symbol\">The root symbol of the output symbol</param>\n        /// <param name=\"resolution\">The resolution of the data source producing the zip entry name</param>\n        /// <param name=\"zipEntryName\">The zip entry name to be parsed</param>\n        /// <returns>A new symbol representing the zip entry name</returns>\n        public static Symbol ReadSymbolFromZipEntry(Symbol symbol, Resolution resolution, string zipEntryName)\n        {\n            var isHourlyOrDaily = resolution == Resolution.Hour || resolution == Resolution.Daily;\n            var parts = zipEntryName.Replace(\".csv\", string.Empty).Split('_');\n            switch (symbol.ID.SecurityType)\n            {\n                case SecurityType.Option:\n                case SecurityType.FutureOption:\n                case SecurityType.IndexOption:\n                    if (isHourlyOrDaily)\n                    {\n                        var style = parts[2].ParseOptionStyle();\n                        var right = parts[3].ParseOptionRight();\n                        var strike = Parse.Decimal(parts[4]) / 10000m;\n                        var expiry = Parse.DateTimeExact(parts[5], DateFormat.EightCharacter);\n                        return Symbol.CreateOption(symbol.Underlying, symbol.ID.Symbol, symbol.ID.Market, style, right, strike, expiry);\n                    }\n                    else\n                    {\n                        var style = parts[4].ParseOptionStyle();\n                        var right = parts[5].ParseOptionRight();\n                        var strike = Parse.Decimal(parts[6]) / 10000m;\n                        var expiry = DateTime.ParseExact(parts[7], DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                        return Symbol.CreateOption(symbol.Underlying, symbol.ID.Symbol, symbol.ID.Market, style, right, strike, expiry);\n                    }\n\n                case SecurityType.Future:\n                    string expiryYearMonth;\n                    if (isHourlyOrDaily)\n                    {\n                        expiryYearMonth = parts[2];\n                    }\n                    else\n                    {\n                        expiryYearMonth = parts[4];\n                    }\n                    var futureExpiry = FuturesExpiryUtilityFunctions.GetFutureExpirationFromContractMonth(symbol, Parse.DateTimeExact(expiryYearMonth, DateFormat.YearMonth));\n                    return Symbol.CreateFuture(symbol.ID.Symbol, symbol.ID.Market, futureExpiry);\n\n                default:\n                    throw new NotImplementedException(Invariant(\n                        $\"ReadSymbolFromZipEntry is not implemented for {symbol.ID.SecurityType} {symbol.ID.Market} {resolution}\"\n                    ));\n            }\n        }\n\n        /// <summary>\n        /// Scales the value by 10_000 and returns a normalized string.\n        /// </summary>\n        private static string Scale(decimal value)\n        {\n            return Extensions.NormalizeToStr(value * 10_000m);\n        }\n\n        /// <summary>\n        /// Create a csv line from the specified arguments\n        /// </summary>\n        private static string ToCsv(params object[] args)\n        {\n            // use culture neutral formatting for decimals\n            for (var i = 0; i < args.Length; i++)\n            {\n                var value = args[i];\n                if (value is decimal)\n                {\n                    args[i] = ((decimal)value).Normalize();\n                }\n            }\n\n            var argsFormatted = args.Select(x => Convert.ToString(x, CultureInfo.InvariantCulture));\n            return string.Join(\",\", argsFormatted);\n        }\n\n        /// <summary>\n        /// Creates a scaled csv line for the bar, if null fills in empty strings\n        /// </summary>\n        private static string ToScaledCsv(IBar bar)\n        {\n            if (bar == null)\n            {\n                return ToCsv(string.Empty, string.Empty, string.Empty, string.Empty);\n            }\n\n            return ToCsv(Scale(bar.Open), Scale(bar.High), Scale(bar.Low), Scale(bar.Close));\n        }\n\n\n        /// <summary>\n        /// Creates a non scaled csv line for the bar, if null fills in empty strings\n        /// </summary>\n        private static string ToNonScaledCsv(IBar bar)\n        {\n            if (bar == null)\n            {\n                return ToCsv(string.Empty, string.Empty, string.Empty, string.Empty);\n            }\n\n            return ToCsv(bar.Open, bar.High, bar.Low, bar.Close);\n        }\n\n        /// <summary>\n        /// Get the <see cref=\"TickType\"/> for common Lean data types.\n        /// If not a Lean common data type, return a TickType of Trade.\n        /// </summary>\n        /// <param name=\"type\">A Type used to determine the TickType</param>\n        /// <param name=\"securityType\">The SecurityType used to determine the TickType</param>\n        /// <returns>A TickType corresponding to the type</returns>\n        public static TickType GetCommonTickTypeForCommonDataTypes(Type type, SecurityType securityType)\n        {\n            if (type == typeof(TradeBar))\n            {\n                return TickType.Trade;\n            }\n            if (type == typeof(QuoteBar))\n            {\n                return TickType.Quote;\n            }\n            if (type == typeof(OpenInterest))\n            {\n                return TickType.OpenInterest;\n            }\n            if (type.IsAssignableTo(typeof(BaseChainUniverseData)))\n            {\n                return TickType.Quote;\n            }\n            if (type == typeof(Tick))\n            {\n                return GetCommonTickType(securityType);\n            }\n\n            return TickType.Trade;\n        }\n\n        /// <summary>\n        /// Matches a data path security type with the <see cref=\"SecurityType\"/>\n        /// </summary>\n        /// <remarks>This includes 'alternative'</remarks>\n        /// <param name=\"securityType\">The data path security type</param>\n        /// <returns>The matching security type for the given data path</returns>\n        public static SecurityType ParseDataSecurityType(string securityType)\n        {\n            if (securityType.Equals(\"alternative\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                return SecurityType.Base;\n            }\n            return (SecurityType)Enum.Parse(typeof(SecurityType), securityType, true);\n        }\n\n        /// <summary>\n        /// Parses file name into a <see cref=\"Security\"/> and DateTime\n        /// </summary>\n        /// <param name=\"fileName\">File name to be parsed</param>\n        /// <param name=\"securityType\">The securityType as parsed from the fileName</param>\n        /// <param name=\"market\">The market as parsed from the fileName</param>\n        public static bool TryParseSecurityType(string fileName, out SecurityType securityType, out string market)\n        {\n            securityType = SecurityType.Base;\n            market = string.Empty;\n\n            try\n            {\n                var info = SplitDataPath(fileName);\n\n                // find the securityType and parse it\n                var typeString = info.Find(x => SecurityTypeAsDataPath.Contains(x.ToLowerInvariant()));\n                securityType = ParseDataSecurityType(typeString);\n\n                var existingMarkets = Market.SupportedMarkets();\n                var foundMarket = info.Find(x => existingMarkets.Contains(x.ToLowerInvariant()));\n                if (foundMarket != null)\n                {\n                    market = foundMarket;\n                }\n            }\n            catch (Exception e)\n            {\n                Log.Error($\"LeanData.TryParsePath(): Error encountered while parsing the path {fileName}. Error: {e.GetBaseException()}\");\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Parses file name into a <see cref=\"Security\"/> and DateTime\n        /// </summary>\n        /// <param name=\"filePath\">File path to be parsed</param>\n        /// <param name=\"symbol\">The symbol as parsed from the fileName</param>\n        /// <param name=\"date\">Date of data in the file path. Only returned if the resolution is lower than Hourly</param>\n        /// <param name=\"resolution\">The resolution of the symbol as parsed from the filePath</param>\n        /// <param name=\"tickType\">The tick type</param>\n        /// <param name=\"dataType\">The data type</param>\n        public static bool TryParsePath(string filePath, out Symbol symbol, out DateTime date,\n            out Resolution resolution, out TickType tickType, out Type dataType)\n        {\n            symbol = default;\n            tickType = default;\n            dataType = default;\n            date = default;\n            resolution = default;\n\n            try\n            {\n                if (!TryParsePath(filePath, out symbol, out date, out resolution, out var isUniverses))\n                {\n                    return false;\n                }\n\n                tickType = GetCommonTickType(symbol.SecurityType);\n                var fileName = Path.GetFileNameWithoutExtension(filePath);\n                if (fileName.Contains('_', StringComparison.InvariantCulture))\n                {\n                    // example: 20140606_openinterest_american.zip\n                    var tickTypePosition = 1;\n                    if (resolution >= Resolution.Hour && symbol.SecurityType.IsOption())\n                    {\n                        // daily and hourly have the year too, example: aapl_2014_openinterest_american.zip\n                        // see GenerateZipFileName he's creating these paths\n                        tickTypePosition = 2;\n                    }\n                    tickType = (TickType)Enum.Parse(typeof(TickType), fileName.Split('_')[tickTypePosition], true);\n                }\n\n                dataType = isUniverses ? typeof(OptionUniverse) : GetDataType(resolution, tickType);\n                return true;\n            }\n            catch (Exception ex)\n            {\n                Log.Debug($\"LeanData.TryParsePath(): Error encountered while parsing the path {filePath}. Error: {ex.GetBaseException()}\");\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Parses file name into a <see cref=\"Security\"/> and DateTime\n        /// </summary>\n        /// <param name=\"fileName\">File name to be parsed</param>\n        /// <param name=\"symbol\">The symbol as parsed from the fileName</param>\n        /// <param name=\"date\">Date of data in the file path. Only returned if the resolution is lower than Hourly</param>\n        /// <param name=\"resolution\">The resolution of the symbol as parsed from the filePath</param>\n        public static bool TryParsePath(string fileName, out Symbol symbol, out DateTime date, out Resolution resolution)\n        {\n            return TryParsePath(fileName, out symbol, out date, out resolution, out _);\n        }\n\n        /// <summary>\n        /// Parses file name into a <see cref=\"Security\"/> and DateTime\n        /// </summary>\n        /// <param name=\"fileName\">File name to be parsed</param>\n        /// <param name=\"symbol\">The symbol as parsed from the fileName</param>\n        /// <param name=\"date\">Date of data in the file path. Only returned if the resolution is lower than Hourly</param>\n        /// <param name=\"resolution\">The resolution of the symbol as parsed from the filePath</param>\n        /// <param name=\"isUniverses\">Outputs whether the file path represents a universe data file.</param>\n        public static bool TryParsePath(string fileName, out Symbol symbol, out DateTime date, out Resolution resolution, out bool isUniverses)\n        {\n            symbol = null;\n            resolution = Resolution.Daily;\n            date = default(DateTime);\n            isUniverses = default;\n\n            try\n            {\n                var info = SplitDataPath(fileName);\n\n                // find where the useful part of the path starts - i.e. the securityType\n                var startIndex = info.FindIndex(x => SecurityTypeAsDataPath.Contains(x.ToLowerInvariant()));\n\n                if (startIndex == -1)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"LeanData.TryParsePath(): Failed to parse '{fileName}' unexpected SecurityType\");\n                    }\n                    // SPDB & MHDB folders\n                    return false;\n                }\n                var securityType = ParseDataSecurityType(info[startIndex]);\n\n                var market = Market.USA;\n                string ticker;\n\n                if (!Enum.TryParse(info[startIndex + 2], true, out resolution))\n                {\n                    resolution = Resolution.Daily;\n                    isUniverses = info[startIndex + 2].Equals(\"universes\", StringComparison.InvariantCultureIgnoreCase);\n                    if (securityType != SecurityType.Base)\n                    {\n                        if (!isUniverses)\n                        {\n                            if (Log.DebuggingEnabled)\n                            {\n                                Log.Debug($\"LeanData.TryParsePath(): Failed to parse '{fileName}' unexpected Resolution\");\n                            }\n                            // only acept a failure to parse resolution if we are facing a universes path\n                            return false;\n                        }\n\n                        (symbol, date) = ParseUniversePath(info, securityType);\n                        return true;\n                    }\n                }\n\n                if (securityType == SecurityType.Base)\n                {\n                    // the last part of the path is the file name\n                    var fileNameNoPath = info[info.Count - 1].Split('_').First();\n\n                    if (!DateTime.TryParseExact(fileNameNoPath,\n                        DateFormat.EightCharacter,\n                        DateTimeFormatInfo.InvariantInfo,\n                        DateTimeStyles.None,\n                        out date))\n                    {\n                        // if parsing the date failed we assume filename is ticker\n                        ticker = fileNameNoPath;\n                    }\n                    else\n                    {\n                        // ticker must be the previous part of the path\n                        ticker = info[info.Count - 2];\n                    }\n                }\n                else\n                {\n                    // Gather components used to create the security\n                    market = info[startIndex + 1];\n                    var components = info[startIndex + 3].Split('_');\n\n                    // Remove the ticktype from the ticker (Only exists in Crypto and Future data but causes no issues)\n                    ticker = components[0];\n\n                    if (resolution < Resolution.Hour)\n                    {\n                        // Future options are special and have the following format Market/Resolution/Ticker/FutureExpiry/Date\n                        var dateIndex = securityType == SecurityType.FutureOption ? startIndex + 5 : startIndex + 4;\n                        date = Parse.DateTimeExact(info[dateIndex].Substring(0, 8), DateFormat.EightCharacter);\n                    }\n                    // If resolution is Daily or Hour for options and index options, we can only get the year from the path\n                    else if (securityType == SecurityType.Option || securityType == SecurityType.IndexOption)\n                    {\n                        var year = int.Parse(components[1], CultureInfo.InvariantCulture);\n                        date = new DateTime(year, 01, 01);\n                    }\n                }\n\n                if (securityType == SecurityType.FutureOption)\n                {\n                    // Future options have underlying future contract month date as the parent dir for the zips, we need this for our underlying\n                    var futureContractMonth = Parse.DateTimeExact(info[startIndex + 4].Substring(0, 6), DateFormat.YearMonth);\n                    symbol = CreateSymbol(ticker, securityType, market, null, futureContractMonth);\n                }\n                else\n                {\n                    symbol = CreateSymbol(ticker, securityType, market, null, date);\n                }\n            }\n            catch (Exception ex)\n            {\n                Log.Debug($\"LeanData.TryParsePath(): Error encountered while parsing the path {fileName}. Error: {ex.GetBaseException()}\");\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Parses the universe file path and extracts the corresponding symbol and file date.\n        /// </summary>\n        /// <param name=\"filePathParts\">\n        /// A list of strings representing the file path segments. The expected structure is:\n        /// <para>General format: [\"data\", SecurityType, Market, \"universes\", ...]</para>\n        /// <para>Examples:</para>\n        /// <list type=\"bullet\">\n        /// <item><description>Equity: <c>data/equity/usa/universes/etf/spy/20201130.csv</c></description></item>\n        /// <item><description>Option: <c>data/option/usa/universes/aapl/20241112.csv</c></description></item>\n        /// <item><description>Future: <c>data/future/cme/universes/es/20130710.csv</c></description></item>\n        /// <item><description>Future Option: <c>data/futureoption/cme/universes/20120401/20111230.csv</c></description></item>\n        /// </list>\n        /// </param>\n        /// <param name=\"securityType\">The type of security for which the symbol is being created.</param>\n        /// <returns>A tuple containing the parsed <see cref=\"Symbol\"/> and the universe processing file date.</returns>\n        /// <exception cref=\"ArgumentException\">Thrown if the file path does not contain 'universes'.</exception>\n        /// <exception cref=\"NotSupportedException\">Thrown if the security type is not supported.</exception>\n        private static (Symbol symbol, DateTime processingDate) ParseUniversePath(IReadOnlyList<string> filePathParts, SecurityType securityType)\n        {\n            if (!filePathParts.Contains(\"universes\", StringComparer.InvariantCultureIgnoreCase))\n            {\n                throw new ArgumentException($\"LeanData.{nameof(ParseUniversePath)}:The file path must contain a 'universes' part, but it was not found.\");\n            }\n\n            var symbol = default(Symbol);\n            var market = filePathParts[2];\n            var ticker = filePathParts[^2];\n            var universeFileDate = DateTime.ParseExact(filePathParts[^1], DateFormat.EightCharacter, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None);\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    securityType = SecurityType.Base;\n                    var dataType = filePathParts.Contains(\"etf\", StringComparer.InvariantCultureIgnoreCase) ? typeof(ETFConstituentUniverse) : default;\n                    symbol = CreateSymbol(ticker, securityType, market, dataType, universeFileDate);\n                    break;\n                case SecurityType.Option:\n                    symbol = CreateSymbol(ticker, securityType, market, null, universeFileDate);\n                    break;\n                case SecurityType.IndexOption:\n                    symbol = CreateSymbol(ticker, securityType, market, null, default);\n                    break;\n                case SecurityType.FutureOption:\n                    symbol = CreateSymbol(filePathParts[^3], securityType, market, null, Parse.DateTimeExact(filePathParts[^2], DateFormat.YearMonth));\n                    break;\n                case SecurityType.Future:\n                    var mapUnderlyingTicker = OptionSymbol.MapToUnderlying(ticker, securityType);\n                    symbol = Symbol.CreateFuture(mapUnderlyingTicker, market, SecurityIdentifier.DefaultDate);\n                    break;\n                default:\n                    throw new NotSupportedException($\"LeanData.{nameof(ParseUniversePath)}:The security type '{securityType}' is not supported for data universe files.\");\n            }\n\n            return (symbol, universeFileDate);\n        }\n\n        /// <summary>\n        /// Creates a new Symbol based on parsed data path information.\n        /// </summary>\n        /// <param name=\"ticker\">The parsed ticker symbol.</param>\n        /// <param name=\"securityType\">The parsed type of security.</param>\n        /// <param name=\"market\">The parsed market or exchange.</param>\n        /// <param name=\"dataType\">Optional type used for generating the base data SID (applicable only for SecurityType.Base).</param>\n        /// <param name=\"mappingResolveDate\">The date used in path parsing to create the correct symbol.</param>\n        /// <returns>A unique security identifier.</returns>\n        /// <example>\n        /// <code>\n        /// path: equity/usa/minute/spwr/20071223_trade.zip\n        /// ticker: spwr\n        /// securityType: equity\n        /// market: usa\n        /// mappingResolveDate: 2007/12/23\n        /// </code>\n        /// </example>\n        private static Symbol CreateSymbol(string ticker, SecurityType securityType, string market, Type dataType, DateTime mappingResolveDate = default)\n        {\n            if (mappingResolveDate != default && (securityType == SecurityType.Equity || securityType == SecurityType.Option))\n            {\n                var symbol = new Symbol(SecurityIdentifier.GenerateEquity(ticker, market, mappingResolveDate: mappingResolveDate), ticker);\n                return securityType == SecurityType.Option ? Symbol.CreateCanonicalOption(symbol) : symbol;\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                var underlyingTicker = OptionSymbol.MapToUnderlying(ticker, securityType);\n                // Create our underlying future and then the Canonical option for this future\n                var underlyingExpiry = FuturesExpiryUtilityFunctions.GetFutureExpirationFromContractMonth(underlyingTicker, market, mappingResolveDate);\n                var underlyingFuture = Symbol.CreateFuture(underlyingTicker, market, underlyingExpiry);\n                return Symbol.CreateCanonicalOption(underlyingFuture);\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                var underlyingTicker = OptionSymbol.MapToUnderlying(ticker, securityType);\n                // Create our underlying index and then the Canonical option\n                var underlyingIndex = Symbol.Create(underlyingTicker, SecurityType.Index, market);\n                return Symbol.CreateCanonicalOption(underlyingIndex, ticker, market, null);\n            }\n            else\n            {\n                return Symbol.Create(ticker, securityType, market, baseDataType: dataType);\n            }\n        }\n\n        private static List<string> SplitDataPath(string fileName)\n        {\n            var pathSeparators = new[] { '/', '\\\\' };\n\n            // Removes file extension\n            fileName = fileName.Replace(fileName.GetExtension(), string.Empty);\n\n            // remove any relative file path\n            while (fileName.First() == '.' || pathSeparators.Any(x => x == fileName.First()))\n            {\n                fileName = fileName.Remove(0, 1);\n            }\n\n            // split path into components\n            return fileName.Split(pathSeparators, StringSplitOptions.RemoveEmptyEntries).ToList();\n        }\n\n        /// <summary>\n        /// Aggregates a list of second/minute bars at the requested resolution\n        /// </summary>\n        /// <param name=\"bars\">List of <see cref=\"TradeBar\"/>s</param>\n        /// <param name=\"symbol\">Symbol of all tradeBars</param>\n        /// <param name=\"resolution\">Desired resolution for new <see cref=\"TradeBar\"/>s</param>\n        /// <returns>List of aggregated <see cref=\"TradeBar\"/>s</returns>\n        public static IEnumerable<TradeBar> AggregateTradeBars(IEnumerable<TradeBar> bars, Symbol symbol, TimeSpan resolution)\n        {\n            return Aggregate(new TradeBarConsolidator(resolution), bars, symbol);\n        }\n\n        /// <summary>\n        /// Aggregates a list of second/minute bars at the requested resolution\n        /// </summary>\n        /// <param name=\"bars\">List of <see cref=\"QuoteBar\"/>s</param>\n        /// <param name=\"symbol\">Symbol of all QuoteBars</param>\n        /// <param name=\"resolution\">Desired resolution for new <see cref=\"QuoteBar\"/>s</param>\n        /// <returns>List of aggregated <see cref=\"QuoteBar\"/>s</returns>\n        public static IEnumerable<QuoteBar> AggregateQuoteBars(IEnumerable<QuoteBar> bars, Symbol symbol, TimeSpan resolution)\n        {\n            return Aggregate(new QuoteBarConsolidator(resolution), bars, symbol);\n        }\n\n        /// <summary>\n        /// Aggregates a list of ticks at the requested resolution\n        /// </summary>\n        /// <param name=\"ticks\">List of quote ticks</param>\n        /// <param name=\"symbol\">Symbol of all ticks</param>\n        /// <param name=\"resolution\">Desired resolution for new <see cref=\"QuoteBar\"/>s</param>\n        /// <returns>List of aggregated <see cref=\"QuoteBar\"/>s</returns>\n        public static IEnumerable<QuoteBar> AggregateTicks(IEnumerable<Tick> ticks, Symbol symbol, TimeSpan resolution)\n        {\n            return Aggregate(new TickQuoteBarConsolidator(resolution), ticks, symbol);\n        }\n\n        /// <summary>\n        /// Aggregates a list of ticks at the requested resolution\n        /// </summary>\n        /// <param name=\"ticks\">List of trade ticks</param>\n        /// <param name=\"symbol\">Symbol of all ticks</param>\n        /// <param name=\"resolution\">Desired resolution for new <see cref=\"TradeBar\"/>s</param>\n        /// <returns>List of aggregated <see cref=\"TradeBar\"/>s</returns>\n        public static IEnumerable<TradeBar> AggregateTicksToTradeBars(IEnumerable<Tick> ticks, Symbol symbol, TimeSpan resolution)\n        {\n            return Aggregate(new TickConsolidator(resolution), ticks, symbol);\n        }\n\n        /// <summary>\n        /// Helper method to calculate the start time of a consolidator bar given a period, and anchor start time and the current data time\n        /// </summary>\n        public static DateTime GetConsolidatorStartTime(TimeSpan period, TimeSpan startTime, DateTime time)\n        {\n            var referenceStart = time.Date + startTime;\n            if (period >= TimeSpan.FromDays(7))\n            {\n                // anchor to start of the month\n                referenceStart = new DateTime(time.Year, time.Month, 1) + startTime;\n            }\n\n            var difference = time - referenceStart;\n\n            var intervalsPassed = Math.Floor(difference.TotalSeconds / period.TotalSeconds);\n            return referenceStart + TimeSpan.FromSeconds(intervalsPassed * period.TotalSeconds);\n        }\n\n        /// <summary>\n        /// Helper method to return the start time and period of a bar the given point time should be part of\n        /// </summary>\n        /// <param name=\"exchangeTimeZoneDate\">The point in time we want to get the bar information about</param>\n        /// <param name=\"exchange\">The associated security exchange</param>\n        /// <param name=\"extendedMarketHours\">True if extended market hours should be taken into consideration</param>\n        /// <returns>The calendar information that holds a start time and a period</returns>\n        public static CalendarInfo GetDailyCalendar(DateTime exchangeTimeZoneDate, SecurityExchange exchange, bool extendedMarketHours)\n        {\n            return GetDailyCalendar(exchangeTimeZoneDate, exchange.Hours, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Helper method to return the start time and period of a bar the given point time should be part of\n        /// </summary>\n        /// <param name=\"exchangeTimeZoneDate\">The point in time we want to get the bar information about</param>\n        /// <param name=\"exchangeHours\">The associated exchange hours</param>\n        /// <param name=\"extendedMarketHours\">True if extended market hours should be taken into consideration</param>\n        /// <returns>The calendar information that holds a start time and a period</returns>\n        public static CalendarInfo GetDailyCalendar(DateTime exchangeTimeZoneDate, SecurityExchangeHours exchangeHours, bool extendedMarketHours)\n        {\n            var startTime = exchangeHours.GetFirstDailyMarketOpen(exchangeTimeZoneDate, extendedMarketHours);\n            var endTime = exchangeHours.GetLastDailyMarketClose(startTime, extendedMarketHours);\n            var period = endTime - startTime;\n            return new CalendarInfo(startTime, period);\n        }\n\n        /// <summary>\n        /// Helper method to get the next daily end time, taking into account strict end times if appropriate\n        /// </summary>\n        public static DateTime GetNextDailyEndTime(Symbol symbol, DateTime exchangeTimeZoneDate, SecurityExchangeHours exchangeHours)\n        {\n            var nextMidnight = exchangeTimeZoneDate.Date.AddDays(1);\n            if (!UseStrictEndTime(true, symbol, Time.OneDay, exchangeHours))\n            {\n                return nextMidnight;\n            }\n\n            var nextMarketClose = exchangeHours.GetLastDailyMarketClose(exchangeTimeZoneDate, extendedMarketHours: false);\n            if (nextMarketClose > nextMidnight)\n            {\n                // if exchangeTimeZoneDate is after the previous close, the next close might be tomorrow\n                if (!exchangeHours.IsOpen(exchangeTimeZoneDate, extendedMarketHours: false))\n                {\n                    return nextMarketClose;\n                }\n                return nextMidnight;\n            }\n            return nextMarketClose;\n        }\n\n        /// <summary>\n        /// Helper method that defines the types of options that should use scale factor\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool OptionUseScaleFactor(Symbol symbol)\n        {\n            return symbol.SecurityType == SecurityType.Option || symbol.SecurityType == SecurityType.IndexOption;\n        }\n\n        /// <summary>\n        /// Helper method to determine if we should use strict end time\n        /// </summary>\n        /// <param name=\"symbol\">The associated symbol</param>\n        /// <param name=\"increment\">The datas time increment</param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool UseStrictEndTime(bool dailyStrictEndTimeEnabled, Symbol symbol, TimeSpan increment, SecurityExchangeHours exchangeHours)\n        {\n            if (exchangeHours.IsMarketAlwaysOpen\n                || increment <= Time.OneHour\n                || symbol.SecurityType == SecurityType.Cfd && symbol.ID.Market == Market.Oanda\n                || symbol.SecurityType == SecurityType.Forex\n                || symbol.SecurityType == SecurityType.Base)\n            {\n                return false;\n            }\n            return dailyStrictEndTimeEnabled;\n        }\n\n        /// <summary>\n        /// Helper method to determine if we should use strict end time\n        /// </summary>\n        public static bool UseDailyStrictEndTimes(IAlgorithmSettings settings, BaseDataRequest request, Symbol symbol, TimeSpan increment,\n            SecurityExchangeHours exchangeHours = null)\n        {\n            return UseDailyStrictEndTimes(settings, request.DataType, symbol, increment, exchangeHours ?? request.ExchangeHours);\n        }\n\n        /// <summary>\n        /// Helper method to determine if we should use strict end time\n        /// </summary>\n        public static bool UseDailyStrictEndTimes(IAlgorithmSettings settings, Type dataType, Symbol symbol, TimeSpan increment, SecurityExchangeHours exchangeHours)\n        {\n            return UseDailyStrictEndTimes(settings.DailyPreciseEndTime, dataType, symbol, increment, exchangeHours);\n        }\n\n        /// <summary>\n        /// Helper method to determine if we should use strict end time\n        /// </summary>\n        public static bool UseDailyStrictEndTimes(bool dailyStrictEndTimeEnabled, Type dataType, Symbol symbol, TimeSpan increment, SecurityExchangeHours exchangeHours)\n        {\n            return UseDailyStrictEndTimes(dataType) && UseStrictEndTime(dailyStrictEndTimeEnabled, symbol, increment, exchangeHours);\n        }\n\n        /// <summary>\n        /// True if this data type should use strict daily end times\n        /// </summary>\n        public static bool UseDailyStrictEndTimes(Type dataType)\n        {\n            return dataType != null && _strictDailyEndTimesDataTypes.Contains(dataType);\n        }\n\n        /// <summary>\n        /// Helper method that if appropiate, will set the Time and EndTime of the given data point to it's daily strict times\n        /// </summary>\n        /// <param name=\"baseData\">The target data point</param>\n        /// <param name=\"exchange\">The associated exchange hours</param>\n        /// <remarks>This method is used to set daily times on pre existing data, assuming it does not cover extended market hours</remarks>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool SetStrictEndTimes(IBaseData baseData, SecurityExchangeHours exchange)\n        {\n            if (baseData == null)\n            {\n                return false;\n            }\n\n            var dataType = baseData.GetType();\n            if (!UseDailyStrictEndTimes(dataType))\n            {\n                return false;\n            }\n\n            var dailyCalendar = GetDailyCalendar(baseData.EndTime, exchange, extendedMarketHours: false);\n            if (dailyCalendar.End < baseData.Time)\n            {\n                // this data point we were given is probably from extended market hours which we don't support for daily backtesting data\n                return false;\n            }\n            baseData.Time = dailyCalendar.Start;\n            baseData.EndTime = dailyCalendar.End;\n            return true;\n        }\n\n        /// <summary>\n        /// Helper to separate filename and entry from a given key for DataProviders\n        /// </summary>\n        /// <param name=\"key\">The key to parse</param>\n        /// <param name=\"fileName\">File name extracted</param>\n        /// <param name=\"entryName\">Entry name extracted</param>\n        public static void ParseKey(string key, out string fileName, out string entryName)\n        {\n            // Default scenario, no entryName included in key\n            entryName = null; // default to all entries\n            fileName = key;\n\n            if (key == null)\n            {\n                return;\n            }\n\n            // Try extracting an entry name; Anything after a # sign\n            var hashIndex = key.LastIndexOf(\"#\", StringComparison.Ordinal);\n            if (hashIndex != -1)\n            {\n                entryName = key.Substring(hashIndex + 1);\n                fileName = key.Substring(0, hashIndex);\n            }\n        }\n\n        /// <summary>\n        /// Helper method to determine if the specified data type supports extended market hours\n        /// </summary>\n        /// <param name=\"dataType\">The data type</param>\n        /// <returns>Whether the specified data type supports extended market hours</returns>\n        public static bool SupportsExtendedMarketHours(Type dataType)\n        {\n            return !dataType.IsAssignableTo(typeof(BaseChainUniverseData));\n        }\n\n        /// <summary>\n        /// Helper method to aggregate ticks or bars into lower frequency resolutions\n        /// </summary>\n        /// <typeparam name=\"T\">Output type</typeparam>\n        /// <typeparam name=\"K\">Input type</typeparam>\n        /// <param name=\"consolidator\">The consolidator to use</param>\n        /// <param name=\"dataPoints\">The data point source</param>\n        /// <param name=\"symbol\">The symbol to output</param>\n        private static IEnumerable<T> Aggregate<T, K>(PeriodCountConsolidatorBase<K, T> consolidator, IEnumerable<K> dataPoints, Symbol symbol)\n            where T : BaseData\n            where K : BaseData\n        {\n            IBaseData lastAggregated = null;\n            var getConsolidatedBar = () =>\n            {\n                if (lastAggregated != consolidator.Consolidated && consolidator.Consolidated != null)\n                {\n                    // if there's a new aggregated bar we set the symbol & return it\n                    lastAggregated = consolidator.Consolidated;\n                    lastAggregated.Symbol = symbol;\n                    return lastAggregated;\n                }\n                return null;\n            };\n\n            foreach (var dataPoint in dataPoints)\n            {\n                consolidator.Update(dataPoint);\n                var consolidated = getConsolidatedBar();\n                if (consolidated != null)\n                {\n                    yield return (T)consolidated;\n                }\n            }\n\n            // flush any partial bar\n            consolidator.Scan(Time.EndOfTime);\n            var lastConsolidated = getConsolidatedBar();\n            if (lastConsolidated != null)\n            {\n                yield return (T)lastConsolidated;\n            }\n\n            // cleanup\n            consolidator.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/LeanDataPathComponents.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Type representing the various pieces of information emebedded into a lean data file path\n    /// </summary>\n    public class LeanDataPathComponents\n    {\n        /// <summary>\n        /// Gets the date component from the file name\n        /// </summary>\n        public DateTime Date\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the security type from the path\n        /// </summary>\n        public SecurityType SecurityType\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the market from the path\n        /// </summary>\n        public string Market\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the resolution from the path\n        /// </summary>\n        public Resolution Resolution\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the file name, not inluding directory information\n        /// </summary>\n        public string Filename\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the symbol object implied by the path. For options, or any\n        /// multi-entry zip file, this should be the canonical symbol\n        /// </summary>\n        public Symbol Symbol\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the tick type from the file name\n        /// </summary>\n        public TickType TickType\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanDataPathComponents\"/> class\n        /// </summary>\n        public LeanDataPathComponents(SecurityType securityType, string market, Resolution resolution, Symbol symbol, string filename, DateTime date, TickType tickType)\n        {\n            Date = date;\n            SecurityType = securityType;\n            Market = market;\n            Resolution = resolution;\n            Filename = filename;\n            Symbol = symbol;\n            TickType = tickType;\n        }\n\n        /// <summary>\n        /// Parses the specified path into a new instance of the <see cref=\"LeanDataPathComponents\"/> class\n        /// </summary>\n        /// <param name=\"path\">The path to be parsed</param>\n        /// <returns>A new instance of the <see cref=\"LeanDataPathComponents\"/> class representing the specified path</returns>\n        public static LeanDataPathComponents Parse(string path)\n        {\n            //\"../Data/equity/usa/hour/spy.zip\"\n            //\"../Data/equity/usa/hour/spy/20160218_trade.zip\"\n            var fileinfo = new FileInfo(path);\n            var filename = fileinfo.Name;\n            var parts = path.Split('/', '\\\\');\n\n            // defines the offsets of the security relative to the end of the path\n            const int LowResSecurityTypeOffset = 4;\n            const int HighResSecurityTypeOffset = 5;\n\n            // defines other offsets relative to the beginning of the substring produce by the above offsets\n            const int MarketOffset = 1;\n            const int ResolutionOffset = 2;\n            const int TickerOffset = 3;\n\n\n            if (parts.Length < LowResSecurityTypeOffset)\n            {\n                throw new FormatException($\"Unexpected path format: {path}\");\n            }\n\n            var securityTypeOffset = LowResSecurityTypeOffset;\n            SecurityType securityType;\n            var rawValue = parts[parts.Length - securityTypeOffset];\n            if (!Enum.TryParse(rawValue, true, out securityType))\n            {\n                securityTypeOffset = HighResSecurityTypeOffset;\n                rawValue = parts[parts.Length - securityTypeOffset];\n                if (!Enum.TryParse(rawValue, true, out securityType))\n                {\n                    throw new FormatException($\"Unexpected path format: {path}\");\n                }\n            }\n\n            var market = parts[parts.Length - securityTypeOffset + MarketOffset];\n            var resolution = (Resolution) Enum.Parse(typeof (Resolution), parts[parts.Length - securityTypeOffset + ResolutionOffset], true);\n            string ticker;\n            if (securityTypeOffset == LowResSecurityTypeOffset)\n            {\n                ticker = Path.GetFileNameWithoutExtension(path);\n                if (securityType.IsOption())\n                {\n                    // ticker_year_trade_american\n                    ticker = ticker.Substring(0, ticker.IndexOf(\"_\", StringComparison.InvariantCulture));\n                }\n                if (securityType == SecurityType.Future || securityType == SecurityType.CryptoFuture)\n                {\n                    // ticker_trade\n                    ticker = ticker.Substring(0, ticker.LastIndexOfInvariant(\"_\"));\n                }\n                if (securityType == SecurityType.Crypto &&\n                    (resolution == Resolution.Daily || resolution == Resolution.Hour))\n                {\n                    // ticker_trade or ticker_quote\n                    ticker = ticker.Substring(0, ticker.LastIndexOfInvariant(\"_\"));\n                }\n            }\n            else\n            {\n                ticker = parts[parts.Length - securityTypeOffset + TickerOffset];\n            }\n\n            var date = securityTypeOffset == LowResSecurityTypeOffset ? DateTime.MinValue : DateTime.ParseExact(filename.Substring(0, filename.IndexOf(\"_\", StringComparison.Ordinal)), DateFormat.EightCharacter, null);\n\n            Symbol symbol;\n            if (securityType == SecurityType.Option)\n            {\n                var withoutExtension = Path.GetFileNameWithoutExtension(filename);\n                rawValue = withoutExtension.Substring(withoutExtension.LastIndexOf(\"_\", StringComparison.Ordinal) + 1);\n                var style = (OptionStyle) Enum.Parse(typeof (OptionStyle), rawValue, true);\n                symbol = Symbol.CreateOption(ticker, market, style, default, 0, SecurityIdentifier.DefaultDate);\n            }\n            else if (securityType == SecurityType.FutureOption || securityType == SecurityType.IndexOption)\n            {\n                var withoutExtension = Path.GetFileNameWithoutExtension(filename);\n                rawValue = withoutExtension.Substring(withoutExtension.LastIndexOf(\"_\", StringComparison.Ordinal) + 1);\n                var style = (OptionStyle) Enum.Parse(typeof (OptionStyle), rawValue, true);\n                var underlyingSecurityType = Symbol.GetUnderlyingFromOptionType(securityType);\n                var underlyingSymbol = Symbol.Create(OptionSymbol.MapToUnderlying(ticker, securityType), underlyingSecurityType, market);\n                symbol = Symbol.CreateOption(underlyingSymbol, ticker, market, style, default, 0, SecurityIdentifier.DefaultDate);\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                symbol = Symbol.CreateFuture(ticker, market, SecurityIdentifier.DefaultDate);\n            }\n            else\n            {\n                symbol = Symbol.Create(ticker, securityType, market);\n            }\n\n            var tickType = filename.Contains(\"_quote\") ? TickType.Quote : (filename.Contains(\"_openinterest\") ? TickType.OpenInterest : TickType.Trade);\n\n            return new LeanDataPathComponents(securityType, market, resolution, symbol, filename, date, tickType);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/LinqExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing Common.Util;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides more extension methods for the enumerable types\n    /// </summary>\n    public static class LinqExtensions\n    {\n        /// <summary>\n        /// Creates a new read-only dictionary from the key value pairs\n        /// </summary>\n        /// <typeparam name=\"K\">The key type</typeparam>\n        /// <typeparam name=\"V\">The value type</typeparam>\n        /// <param name=\"enumerable\">The IEnumerable of KeyValuePair instances to convert to a dictionary</param>\n        /// <returns>A read-only dictionary holding the same data as the enumerable</returns>\n        public static IReadOnlyDictionary<K, V> ToReadOnlyDictionary<K, V>(this IEnumerable<KeyValuePair<K, V>> enumerable)\n        {\n            return new ReadOnlyDictionary<K, V>(enumerable.ToDictionary());\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"HashSet{T}\"/> from the elements in the specified enumerable\n        /// </summary>\n        /// <typeparam name=\"T\">The item type of the source enumerable</typeparam>\n        /// <typeparam name=\"TResult\">The type of the items in the output <see cref=\"HashSet{T}\"/></typeparam>\n        /// <param name=\"enumerable\">The items to be placed into the enumerable</param>\n        /// <param name=\"selector\">Selects items from the enumerable to be placed into the <see cref=\"HashSet{T}\"/></param>\n        /// <returns>A new <see cref=\"HashSet{T}\"/> containing the items in the enumerable</returns>\n        public static HashSet<TResult> ToHashSet<T, TResult>(this IEnumerable<T> enumerable, Func<T, TResult> selector)\n        {\n            return new HashSet<TResult>(enumerable.Select(selector));\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"IList{T}\"/> from the projected elements in the specified enumerable\n        /// </summary>\n        /// <typeparam name=\"T\">The item type of the source enumerable</typeparam>\n        /// <typeparam name=\"TResult\">The type of the items in the output <see cref=\"List{T}\"/></typeparam>\n        /// <param name=\"enumerable\">The items to be placed into the list</param>\n        /// <param name=\"selector\">Selects items from the enumerable to be placed into the <see cref=\"List{T}\"/></param>\n        /// <returns>A new <see cref=\"List{T}\"/> containing the items in the enumerable</returns>\n        public static List<TResult> ToList<T, TResult>(this IEnumerable<T> enumerable, Func<T, TResult> selector)\n        {\n            return enumerable.Select(selector).ToList();\n        }\n\n        /// <summary>\n        /// Creates a new array from the projected elements in the specified enumerable\n        /// </summary>\n        /// <typeparam name=\"T\">The item type of the source enumerable</typeparam>\n        /// <typeparam name=\"TResult\">The type of the items in the output array</typeparam>\n        /// <param name=\"enumerable\">The items to be placed into the array</param>\n        /// <param name=\"selector\">Selects items from the enumerable to be placed into the array</param>\n        /// <returns>A new array containing the items in the enumerable</returns>\n        public static TResult[] ToArray<T, TResult>(this IEnumerable<T> enumerable, Func<T, TResult> selector)\n        {\n            return enumerable.Select(selector).ToArray();\n        }\n\n        /// <summary>\n        /// Creates a new immutable array from the projected elements in the specified enumerable\n        /// </summary>\n        /// <typeparam name=\"T\">The item type of the source enumerable</typeparam>\n        /// <typeparam name=\"TResult\">The type of the items in the output array</typeparam>\n        /// <param name=\"enumerable\">The items to be placed into the array</param>\n        /// <param name=\"selector\">Selects items from the enumerable to be placed into the array</param>\n        /// <returns>A new array containing the items in the enumerable</returns>\n        public static ImmutableArray<TResult> ToImmutableArray<T, TResult>(this IEnumerable<T> enumerable, Func<T, TResult> selector)\n        {\n            return enumerable.Select(selector).ToImmutableArray();\n        }\n\n        /// <summary>\n        /// Returns true if the specified enumerable is null or has no elements\n        /// </summary>\n        /// <typeparam name=\"T\">The enumerable's item type</typeparam>\n        /// <param name=\"enumerable\">The enumerable to check for a value</param>\n        /// <returns>True if the enumerable has elements, false otherwise</returns>\n        public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)\n        {\n            return enumerable == null || !enumerable.Any();\n        }\n\n        /// <summary>\n        /// Gets the median value in the collection\n        /// </summary>\n        /// <typeparam name=\"T\">The item type in the collection</typeparam>\n        /// <param name=\"enumerable\">The enumerable of items to search</param>\n        /// <returns>The median value, throws InvalidOperationException if no items are present</returns>\n        public static T Median<T>(this IEnumerable<T> enumerable)\n        {\n            var collection = enumerable.ToList();\n            return collection.OrderBy(x => x).Skip(collection.Count / 2).First();\n        }\n\n        /// <summary>\n        /// Gets the median value in the collection\n        /// </summary>\n        /// <typeparam name=\"T\">The item type in the collection</typeparam>\n        /// <typeparam name=\"TProperty\">The type of the value selected</typeparam>\n        /// <param name=\"collection\">The collection of items to search</param>\n        /// <param name=\"selector\">Function used to select a value from collection items</param>\n        /// <returns>The median value, throws InvalidOperationException if no items are present</returns>\n        public static TProperty Median<T, TProperty>(this IEnumerable<T> collection, Func<T, TProperty> selector)\n        {\n            return collection.Select(selector).Median();\n        }\n\n        /// <summary>\n        /// Performs a binary search on the specified collection.\n        /// </summary>\n        /// <typeparam name=\"TItem\">The type of the item.</typeparam>\n        /// <typeparam name=\"TSearch\">The type of the searched item.</typeparam>\n        /// <param name=\"list\">The list to be searched.</param>\n        /// <param name=\"value\">The value to search for.</param>\n        /// <param name=\"comparer\">The comparer that is used to compare the value with the list items.</param>\n        /// <returns>The index of the item if found, otherwise the bitwise complement where the value should be per MSDN specs</returns>\n        public static int BinarySearch<TItem, TSearch>(this IList<TItem> list, TSearch value, Func<TSearch, TItem, int> comparer)\n        {\n            if (list == null)\n            {\n                throw new ArgumentNullException(nameof(list));\n            }\n            if (comparer == null)\n            {\n                throw new ArgumentNullException(nameof(comparer));\n            }\n\n            var lower = 0;\n            var upper = list.Count - 1;\n\n            while (lower <= upper)\n            {\n                var middle = lower + (upper - lower) / 2;\n                var comparisonResult = comparer(value, list[middle]);\n                if (comparisonResult < 0)\n                {\n                    upper = middle - 1;\n                }\n                else if (comparisonResult > 0)\n                {\n                    lower = middle + 1;\n                }\n                else\n                {\n                    return middle;\n                }\n            }\n\n            return ~lower;\n        }\n\n        /// <summary>\n        /// Performs a binary search on the specified collection.\n        /// </summary>\n        /// <typeparam name=\"TItem\">The type of the item.</typeparam>\n        /// <param name=\"list\">The list to be searched.</param>\n        /// <param name=\"value\">The value to search for.</param>\n        /// <returns>The index of the item if found, otherwise the bitwise complement where the value should be per MSDN specs</returns>\n        public static int BinarySearch<TItem>(this IList<TItem> list, TItem value)\n        {\n            return BinarySearch(list, value, Comparer<TItem>.Default);\n        }\n\n        /// <summary>\n        /// Performs a binary search on the specified collection.\n        /// </summary>\n        /// <typeparam name=\"TItem\">The type of the item.</typeparam>\n        /// <param name=\"list\">The list to be searched.</param>\n        /// <param name=\"value\">The value to search for.</param>\n        /// <param name=\"comparer\">The comparer that is used to compare the value with the list items.</param>\n        /// <returns>The index of the item if found, otherwise the bitwise complement where the value should be per MSDN specs</returns>\n        public static int BinarySearch<TItem>(this IList<TItem> list, TItem value, IComparer<TItem> comparer)\n        {\n            return list.BinarySearch(value, comparer.Compare);\n        }\n\n        /// <summary>\n        /// Wraps the specified enumerable such that it will only be enumerated once\n        /// </summary>\n        /// <typeparam name=\"T\">The enumerable's element type</typeparam>\n        /// <param name=\"enumerable\">The source enumerable to be wrapped</param>\n        /// <returns>A new enumerable that can be enumerated multiple times without re-enumerating the source enumerable</returns>\n        public static IEnumerable<T> Memoize<T>(this IEnumerable<T> enumerable)\n        {\n            if (enumerable is MemoizingEnumerable<T>) return enumerable;\n            return new MemoizingEnumerable<T>(enumerable);\n        }\n\n        /// <summary>\n        /// Produces the an enumerable of the range of values between start and end using the specified\n        /// incrementing function\n        /// </summary>\n        /// <typeparam name=\"T\">The enumerable item type</typeparam>\n        /// <param name=\"start\">The start of the range</param>\n        /// <param name=\"end\">The end of the range, non-inclusive by default</param>\n        /// <param name=\"incrementer\">The incrementing function, with argument of the current item</param>\n        /// <param name=\"includeEndPoint\">True to emit the end point, false otherwise</param>\n        /// <returns>An enumerable of the range of items between start and end</returns>\n        public static IEnumerable<T> Range<T>(T start, T end, Func<T, T> incrementer, bool includeEndPoint = false)\n            where T : IComparable\n        {\n            var current = start;\n            if (includeEndPoint)\n            {\n                while (current.CompareTo(end) <= 0)\n                {\n                    yield return current;\n                    current = incrementer(current);\n                }\n            }\n            else\n            {\n                while (current.CompareTo(end) < 0)\n                {\n                    yield return current;\n                    current = incrementer(current);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Groups adjacent elements of the enumerale using the specified grouper function\n        /// </summary>\n        /// <typeparam name=\"T\">The enumerable item type</typeparam>\n        /// <param name=\"enumerable\">The source enumerable to be grouped</param>\n        /// <param name=\"grouper\">A function that accepts the previous value and the next value and returns\n        /// true if the next value belongs in the same group as the previous value, otherwise returns false</param>\n        /// <returns>A new enumerable of the groups defined by grouper. These groups don't have a key\n        /// and are only grouped by being emitted separately from this enumerable</returns>\n        public static IEnumerable<IEnumerable<T>> GroupAdjacentBy<T>(this IEnumerable<T> enumerable, Func<T, T, bool> grouper)\n        {\n            using (var e = enumerable.GetEnumerator())\n            {\n                if (e.MoveNext())\n                {\n                    var list = new List<T> { e.Current };\n                    var pred = e.Current;\n                    while (e.MoveNext())\n                    {\n                        if (grouper(pred, e.Current))\n                        {\n                            list.Add(e.Current);\n                        }\n                        else\n                        {\n                            yield return list;\n                            list = new List<T> { e.Current };\n                        }\n                        pred = e.Current;\n                    }\n                    yield return list;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if there are any differences between the left and right collections.\n        /// This method uses sets to improve performance and also uses lazy evaluation so if a\n        /// difference is found, true is immediately returned and evaluation is halted.\n        /// </summary>\n        /// <typeparam name=\"T\">The item type</typeparam>\n        /// <param name=\"left\">The left set</param>\n        /// <param name=\"right\">The right set</param>\n        /// <returns>True if there are any differences between the two sets, false otherwise</returns>\n        public static bool AreDifferent<T>(this ISet<T> left, ISet<T> right)\n        {\n            if (ReferenceEquals(left, right))\n            {\n                return false;\n            }\n            return !left.SetEquals(right);\n        }\n\n        /// <summary>\n        /// Converts an <see cref=\"IEnumerator{T}\"/> to an <see cref=\"IEnumerable{T}\"/>\n        /// </summary>\n        /// <typeparam name=\"T\">Collection element type</typeparam>\n        /// <param name=\"enumerator\">The enumerator to convert to an enumerable</param>\n        /// <returns>An enumerable wrapping the specified enumerator</returns>\n        public static IEnumerable<T> AsEnumerable<T>(this IEnumerator<T> enumerator)\n        {\n            using (enumerator)\n            {\n                while (enumerator.MoveNext())\n                {\n                    yield return enumerator.Current;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the value associated with the specified key or provided default value if key is not found.\n        /// </summary>\n        /// <typeparam name=\"K\">The key type</typeparam>\n        /// <typeparam name=\"V\">The value type</typeparam>\n        /// <param name=\"dictionary\">The dictionary instance</param>\n        /// <param name=\"key\">Lookup key</param>\n        /// <param name=\"defaultValue\">Default value</param>\n        /// <returns>Value associated with the specified key or  default value</returns>\n        public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key, V defaultValue = default(V))\n        {\n            V obj;\n            return dictionary.TryGetValue(key, out obj) ? obj : defaultValue;\n        }\n\n        /// <summary>\n        /// Performs an action for each element in collection source\n        /// </summary>\n        /// <typeparam name=\"T\"></typeparam>\n        /// <param name=\"source\">Collection source</param>\n        /// <param name=\"action\">An action to perform</param>\n        public static void DoForEach<T>(this IEnumerable<T> source, Action<T> action)\n        {\n            foreach (var element in source)\n            {\n                action(element);\n            }\n        }\n\n        /// <summary>\n        /// Converts a dictionary to a ReadOnlyExtendedDictionary\n        /// </summary>\n        public static ReadOnlyExtendedDictionary<TKey, TValue> ToReadOnlyExtendedDictionary<TKey, TValue>(\n            this IDictionary<TKey, TValue> dictionary)\n        {\n            return new ReadOnlyExtendedDictionary<TKey, TValue>(dictionary);\n        }\n\n        /// <summary>\n        /// Creates a ReadOnlyExtendedDictionary from an IEnumerable according to specified key selector\n        /// </summary>\n        public static ReadOnlyExtendedDictionary<TKey, TValue> ToReadOnlyExtendedDictionary<TValue, TKey>(\n            this IEnumerable<TValue> source,\n            Func<TValue, TKey> keySelector)\n        {\n            return new ReadOnlyExtendedDictionary<TKey, TValue>(source, keySelector);\n        }\n\n        /// <summary>\n        /// Creates a DataDictionary from an IEnumerable according to specified key and value selectors\n        /// </summary>\n        public static DataDictionary<TValue> ToDataDictionary<TSource, TValue>(\n            this IEnumerable<TSource> source,\n            Func<TSource, Symbol> keySelector,\n            Func<TSource, TValue> valueSelector)\n        {\n            var result = new DataDictionary<TValue>();\n            foreach (var item in source)\n            {\n                result.Add(keySelector(item), valueSelector(item));\n            }\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ListComparer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IEqualityComparer{T}\"/> for <see cref=\"List{T}\"/>.\n    /// Useful when using a <see cref=\"List{T}\"/> as the key of a collection.\n    /// </summary>\n    /// <typeparam name=\"T\">The list type</typeparam>\n    public class ListComparer<T> : IEqualityComparer<IReadOnlyCollection<T>>\n    {\n        /// <summary>Determines whether the specified objects are equal.</summary>\n        /// <returns>true if the specified objects are equal; otherwise, false.</returns>\n        public bool Equals(IReadOnlyCollection<T> x, IReadOnlyCollection<T> y)\n        {\n            return x.SequenceEqual(y);\n        }\n\n        /// <summary>Returns a hash code for the specified object.</summary>\n        /// <returns>A hash code for the specified object created from combining the hash\n        /// code of all the elements in the collection.</returns>\n        public int GetHashCode(IReadOnlyCollection<T> obj)\n        {\n            var hashCode = 0;\n            foreach (var dateTime in obj)\n            {\n                hashCode = (hashCode * 397) ^ dateTime.GetHashCode();\n            }\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/MarketHoursDatabaseJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing NodaTime;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides json conversion for the <see cref=\"MarketHoursDatabase\"/> class\n    /// </summary>\n    public class MarketHoursDatabaseJsonConverter : TypeChangeJsonConverter<MarketHoursDatabase, MarketHoursDatabaseJsonConverter.MarketHoursDatabaseJson>\n    {\n        /// <summary>\n        /// Convert the input value to a value to be serialzied\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialziation</param>\n        /// <returns>A new instance of TResult that is to be serialzied</returns>\n        protected override MarketHoursDatabaseJson Convert(MarketHoursDatabase value)\n        {\n            return new MarketHoursDatabaseJson(value);\n        }\n\n        /// <summary>\n        /// Converts the input value to be deserialized\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override MarketHoursDatabase Convert(MarketHoursDatabaseJson value)\n        {\n            return value.Convert();\n        }\n\n        /// <summary>\n        /// Creates an instance of the un-projected type to be deserialized\n        /// </summary>\n        /// <param name=\"type\">The input object type, this is the data held in the token</param>\n        /// <param name=\"token\">The input data to be converted into a T</param>\n        /// <returns>A new instance of T that is to be serialized using default rules</returns>\n        protected override MarketHoursDatabase Create(Type type, JToken token)\n        {\n            var jobject = (JObject) token;\n            var instance = jobject.ToObject<MarketHoursDatabaseJson>();\n            return Convert(instance);\n        }\n\n        /// <summary>\n        /// Defines the json structure of the market-hours-database.json file\n        /// </summary>\n        [JsonObject(MemberSerialization.OptIn)]\n        public class MarketHoursDatabaseJson\n        {\n            /// <summary>\n            /// The entries in the market hours database, keyed by <see cref=\"SecurityDatabaseKey\"/>\n            /// </summary>\n            [JsonProperty(\"entries\")]\n            public Dictionary<string, MarketHoursDatabaseEntryJson> Entries { get; set; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"MarketHoursDatabaseJson\"/> class\n            /// </summary>\n            /// <param name=\"database\">The database instance to copy</param>\n            public MarketHoursDatabaseJson(MarketHoursDatabase database)\n            {\n                if (database == null) return;\n                Entries = new Dictionary<string, MarketHoursDatabaseEntryJson>();\n                foreach (var kvp in database.ExchangeHoursListing)\n                {\n                    var key = kvp.Key;\n                    var entry = kvp.Value;\n                    Entries[key.ToString()] = new MarketHoursDatabaseEntryJson(entry);\n                }\n            }\n\n            /// <summary>\n            /// Converts this json representation to the <see cref=\"MarketHoursDatabase\"/> type\n            /// </summary>\n            /// <returns>A new instance of the <see cref=\"MarketHoursDatabase\"/> class</returns>\n            public MarketHoursDatabase Convert()\n            {\n                // first we parse the entries keys so that later we can sort by security type\n                var entries = new Dictionary<SecurityDatabaseKey, MarketHoursDatabaseEntryJson>(Entries.Count);\n                foreach (var entry in Entries)\n                {\n                    try\n                    {\n                        var key = SecurityDatabaseKey.Parse(entry.Key);\n                        if (key != null)\n                        {\n                            entries[key] = entry.Value;\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err);\n                    }\n                }\n\n                var result = new Dictionary<SecurityDatabaseKey, MarketHoursDatabase.Entry>(Entries.Count);\n                // we sort so we process generic entries and non options first\n                foreach (var entry in entries.OrderBy(kvp => kvp.Key.Symbol != null ? 1 : 0).ThenBy(kvp => kvp.Key.SecurityType.IsOption() ? 1 : 0))\n                {\n                    try\n                    {\n                        result.TryGetValue(entry.Key.CreateCommonKey(), out var marketEntry);\n                        var underlyingEntry = GetUnderlyingEntry(entry.Key, result);\n                        result[entry.Key] = entry.Value.Convert(underlyingEntry, marketEntry);\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err);\n                    }\n                }\n                return new MarketHoursDatabase(result);\n            }\n\n            /// <summary>\n            /// Helper method to get the already processed underlying entry for options\n            /// </summary>\n            private static MarketHoursDatabase.Entry GetUnderlyingEntry(SecurityDatabaseKey key, Dictionary<SecurityDatabaseKey, MarketHoursDatabase.Entry> result)\n            {\n                MarketHoursDatabase.Entry underlyingEntry = null;\n                if (key.SecurityType.IsOption())\n                {\n                    // if option, let's get the underlyings entry\n                    var underlyingSecurityType = Symbol.GetUnderlyingFromOptionType(key.SecurityType);\n                    var underlying = OptionSymbol.MapToUnderlying(key.Symbol, key.SecurityType);\n                    var underlyingKey = new SecurityDatabaseKey(key.Market, underlying, underlyingSecurityType);\n\n                    if (!result.TryGetValue(underlyingKey, out underlyingEntry)\n                        // let's retry with the wildcard\n                        && underlying != SecurityDatabaseKey.Wildcard)\n                    {\n                        var underlyingKeyWildCard = new SecurityDatabaseKey(key.Market, SecurityDatabaseKey.Wildcard, underlyingSecurityType);\n                        result.TryGetValue(underlyingKeyWildCard, out underlyingEntry);\n                    }\n                }\n                return underlyingEntry;\n            }\n        }\n\n        /// <summary>\n        /// Defines the json structure of a single entry in the market-hours-database.json file\n        /// </summary>\n        [JsonObject(MemberSerialization.OptIn)]\n        public class MarketHoursDatabaseEntryJson\n        {\n            /// <summary>\n            /// The data's raw time zone\n            /// </summary>\n            [JsonProperty(\"dataTimeZone\")]\n            public string DataTimeZone { get; set; }\n\n            /// <summary>\n            /// The exchange's time zone id from the tzdb\n            /// </summary>\n            [JsonProperty(\"exchangeTimeZone\")]\n            public string ExchangeTimeZone { get; set; }\n\n            /// <summary>\n            /// Sunday market hours segments\n            /// </summary>\n            [JsonProperty(\"sunday\")]\n            public List<MarketHoursSegment> Sunday { get; set; }\n\n            /// <summary>\n            /// Monday market hours segments\n            /// </summary>\n            [JsonProperty(\"monday\")]\n            public List<MarketHoursSegment> Monday { get; set; }\n\n            /// <summary>\n            /// Tuesday market hours segments\n            /// </summary>\n            [JsonProperty(\"tuesday\")]\n            public List<MarketHoursSegment> Tuesday { get; set; }\n\n            /// <summary>\n            /// Wednesday market hours segments\n            /// </summary>\n            [JsonProperty(\"wednesday\")]\n            public List<MarketHoursSegment> Wednesday { get; set; }\n\n            /// <summary>\n            /// Thursday market hours segments\n            /// </summary>\n            [JsonProperty(\"thursday\")]\n            public List<MarketHoursSegment> Thursday { get; set; }\n\n            /// <summary>\n            /// Friday market hours segments\n            /// </summary>\n            [JsonProperty(\"friday\")]\n            public List<MarketHoursSegment> Friday { get; set; }\n\n            /// <summary>\n            /// Saturday market hours segments\n            /// </summary>\n            [JsonProperty(\"saturday\")]\n            public List<MarketHoursSegment> Saturday { get; set; }\n\n            /// <summary>\n            /// Holiday date strings\n            /// </summary>\n            [JsonProperty(\"holidays\")]\n            public List<string> Holidays { get; set; } = new();\n\n            /// <summary>\n            /// Early closes by date\n            /// </summary>\n            [JsonProperty(\"earlyCloses\")]\n            public Dictionary<string, TimeSpan> EarlyCloses { get; set; } = new Dictionary<string, TimeSpan>();\n\n            /// <summary>\n            /// Late opens by date\n            /// </summary>\n            [JsonProperty(\"lateOpens\")]\n            public Dictionary<string, TimeSpan> LateOpens { get; set; } = new Dictionary<string, TimeSpan>();\n\n            /// <summary>\n            /// Bank holidays date strings\n            /// </summary>\n            [JsonProperty(\"bankHolidays\")]\n            public List<string> BankHolidays { get; set; } = new();\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"MarketHoursDatabaseEntryJson\"/> class\n            /// </summary>\n            /// <param name=\"entry\">The entry instance to copy</param>\n            public MarketHoursDatabaseEntryJson(MarketHoursDatabase.Entry entry)\n            {\n                if (entry == null) return;\n                DataTimeZone = entry.DataTimeZone.Id;\n                var hours = entry.ExchangeHours;\n                ExchangeTimeZone = hours.TimeZone.Id;\n                SetSegmentsForDay(hours, DayOfWeek.Sunday, out var sunday);\n                Sunday = sunday;\n                SetSegmentsForDay(hours, DayOfWeek.Monday, out var monday);\n                Monday = monday;\n                SetSegmentsForDay(hours, DayOfWeek.Tuesday, out var tuesday);\n                Tuesday = tuesday;\n                SetSegmentsForDay(hours, DayOfWeek.Wednesday, out var wednesday);\n                Wednesday = wednesday;\n                SetSegmentsForDay(hours, DayOfWeek.Thursday, out var thursday);\n                Thursday = thursday;\n                SetSegmentsForDay(hours, DayOfWeek.Friday, out var friday);\n                Friday = friday;\n                SetSegmentsForDay(hours, DayOfWeek.Saturday, out var saturday);\n                Saturday = saturday;\n                Holidays = hours.Holidays.Select(x => x.ToString(\"M/d/yyyy\", CultureInfo.InvariantCulture)).ToList();\n                EarlyCloses = entry.ExchangeHours.EarlyCloses.ToDictionary(pair => pair.Key.ToString(\"M/d/yyyy\", CultureInfo.InvariantCulture), pair => pair.Value);\n                LateOpens = entry.ExchangeHours.LateOpens.ToDictionary(pair => pair.Key.ToString(\"M/d/yyyy\", CultureInfo.InvariantCulture), pair => pair.Value);\n            }\n\n            /// <summary>\n            /// Converts this json representation to the <see cref=\"MarketHoursDatabase.Entry\"/> type\n            /// </summary>\n            /// <returns>A new instance of the <see cref=\"MarketHoursDatabase.Entry\"/> class</returns>\n            public MarketHoursDatabase.Entry Convert(MarketHoursDatabase.Entry underlyingEntry, MarketHoursDatabase.Entry marketEntry)\n            {\n                var hours = new Dictionary<DayOfWeek, LocalMarketHours>\n                {\n                    { DayOfWeek.Sunday, new LocalMarketHours(DayOfWeek.Sunday, Sunday) },\n                    { DayOfWeek.Monday, new LocalMarketHours(DayOfWeek.Monday, Monday) },\n                    { DayOfWeek.Tuesday, new LocalMarketHours(DayOfWeek.Tuesday, Tuesday) },\n                    { DayOfWeek.Wednesday, new LocalMarketHours(DayOfWeek.Wednesday, Wednesday) },\n                    { DayOfWeek.Thursday, new LocalMarketHours(DayOfWeek.Thursday, Thursday) },\n                    { DayOfWeek.Friday, new LocalMarketHours(DayOfWeek.Friday, Friday) },\n                    { DayOfWeek.Saturday, new LocalMarketHours(DayOfWeek.Saturday, Saturday) }\n                };\n                var holidayDates = Holidays.Select(x => DateTime.ParseExact(x, \"M/d/yyyy\", CultureInfo.InvariantCulture)).ToHashSet();\n                var bankHolidayDates = BankHolidays.Select(x => DateTime.ParseExact(x, \"M/d/yyyy\", CultureInfo.InvariantCulture)).ToHashSet();\n                IReadOnlyDictionary<DateTime, TimeSpan> earlyCloses = EarlyCloses.ToDictionary(x => DateTime.ParseExact(x.Key, \"M/d/yyyy\", CultureInfo.InvariantCulture), x => x.Value);\n                IReadOnlyDictionary<DateTime, TimeSpan> lateOpens = LateOpens.ToDictionary(x => DateTime.ParseExact(x.Key, \"M/d/yyyy\", CultureInfo.InvariantCulture), x => x.Value);\n\n                if(underlyingEntry != null)\n                {\n                    // If we have no entries but the underlying does, let's use the underlyings\n                    if (holidayDates.Count == 0)\n                    {\n                        holidayDates = underlyingEntry.ExchangeHours.Holidays;\n                    }\n                    if (bankHolidayDates.Count == 0)\n                    {\n                        bankHolidayDates = underlyingEntry.ExchangeHours.BankHolidays;\n                    }\n                    if (earlyCloses.Count == 0)\n                    {\n                        earlyCloses = underlyingEntry.ExchangeHours.EarlyCloses;\n                    }\n                    if (lateOpens.Count == 0)\n                    {\n                        lateOpens = underlyingEntry.ExchangeHours.LateOpens;\n                    }\n                }\n\n                if(marketEntry != null)\n                {\n                    if (marketEntry.ExchangeHours.Holidays.Count > 0)\n                    {\n                        holidayDates.UnionWith(marketEntry.ExchangeHours.Holidays);\n                    }\n\n                    if (marketEntry.ExchangeHours.BankHolidays.Count > 0)\n                    {\n                        bankHolidayDates.UnionWith(marketEntry.ExchangeHours.BankHolidays);\n                    }\n\n                    if (marketEntry.ExchangeHours.EarlyCloses.Count > 0 )\n                    {\n                        earlyCloses = MergeLateOpensAndEarlyCloses(marketEntry.ExchangeHours.EarlyCloses, earlyCloses);\n                    }\n\n                    if (marketEntry.ExchangeHours.LateOpens.Count > 0)\n                    {\n                        lateOpens = MergeLateOpensAndEarlyCloses(marketEntry.ExchangeHours.LateOpens, lateOpens);\n                    }\n                }\n\n                var exchangeHours = new SecurityExchangeHours(DateTimeZoneProviders.Tzdb[ExchangeTimeZone], holidayDates, hours, earlyCloses, lateOpens, bankHolidayDates);\n                return new MarketHoursDatabase.Entry(DateTimeZoneProviders.Tzdb[DataTimeZone], exchangeHours);\n            }\n\n            private void SetSegmentsForDay(SecurityExchangeHours hours, DayOfWeek day, out List<MarketHoursSegment> segments)\n            {\n                LocalMarketHours local;\n                if (hours.MarketHours.TryGetValue(day, out local))\n                {\n                    segments = local.Segments.ToList();\n                }\n                else\n                {\n                    segments = new List<MarketHoursSegment>();\n                }\n            }\n\n            /// <summary>\n            /// Merges the late opens or early closes from the common entry (with wildcards) with the specific entry\n            /// (e.g. Indices-usa-[*] with Indices-usa-VIX).\n            /// The specific entry takes precedence.\n            /// </summary>\n            private static Dictionary<DateTime, TimeSpan> MergeLateOpensAndEarlyCloses(IReadOnlyDictionary<DateTime, TimeSpan> common,\n                IReadOnlyDictionary<DateTime, TimeSpan> specific)\n            {\n                var result = common.ToDictionary();\n                foreach (var (key, value) in specific)\n                {\n                    result[key] = value;\n                }\n\n                return result;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/MemoizingEnumerable.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Defines an enumerable that can be enumerated many times while\n    /// only performing a single enumeration of the root enumerable\n    /// </summary>\n    /// <typeparam name=\"T\"></typeparam>\n    public class MemoizingEnumerable<T> : IEnumerable<T>\n    {\n        private List<T> _buffer;\n        private IEnumerator<T> _enumerator;\n\n        /// <summary>\n        /// Allow disableing the buffering\n        /// </summary>\n        /// <remarks>Should be called before the enumeration starts</remarks>\n        public bool Enabled { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MemoizingEnumerable{T}\"/> class\n        /// </summary>\n        /// <param name=\"enumerable\">The source enumerable to be memoized</param>\n        public MemoizingEnumerable(IEnumerable<T> enumerable)\n        {\n            Enabled = true;\n            _enumerator = enumerable.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<T> GetEnumerator()\n        {\n            if (!Enabled)\n            {\n                if (_enumerator != null)\n                {\n                    while (_enumerator.MoveNext())\n                    {\n                        yield return _enumerator.Current;\n                    }\n\n                    // important to avoid leak!\n                    _enumerator.Dispose();\n                    _enumerator = null;\n                }\n            }\n            else\n            {\n                if (_buffer == null)\n                {\n                    // lazy create our buffer\n                    _buffer = new List<T>();\n                }\n\n                int i = 0;\n                while (i <= _buffer.Count)\n                {\n                    // sync for multiple threads access to _enumerator and _buffer\n                    lock (_buffer)\n                    {\n                        // check to see if we need to move next\n                        if (_enumerator != null && i >= _buffer.Count)\n                        {\n                            if (_enumerator.MoveNext())\n                            {\n                                var value = _enumerator.Current;\n                                _buffer.Add(value);\n                                yield return value;\n                            }\n                            else\n                            {\n                                // important to avoid leak!\n                                _enumerator.Dispose();\n                                _enumerator = null;\n                            }\n                        }\n                        else\n                        {\n                            // we have a value if it's in the buffer\n                            if (_buffer.Count > i)\n                            {\n                                yield return _buffer[i];\n                            }\n                        }\n                    }\n\n                    // increment for next time\n                    i++;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/NullStringValueConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Converts the string \"null\" into a new instance of T.\n    /// This converter only handles deserialization concerns.\n    /// </summary>\n    /// <typeparam name=\"T\">The output type of the converter</typeparam>\n    public class NullStringValueConverter<T> : JsonConverter\n        where T : new()\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.Null || (reader.TokenType == JsonToken.String && (string)reader.Value == \"null\"))\n            {\n                return new T();\n            }\n            return serializer.Deserialize<T>(reader);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ObjectActivator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing CloneExtensions;\nusing Fasterflect;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides methods for creating new instances of objects\n    /// </summary>\n    public static class ObjectActivator\n    {\n        private static readonly object _lock = new object();\n        private static readonly Dictionary<Type, MethodInvoker> _cloneMethodsByType = new Dictionary<Type, MethodInvoker>();\n        private static readonly Dictionary<Type, Func<object[], object>> _activatorsByType = new Dictionary<Type, Func<object[], object>>();\n\n        static ObjectActivator()\n        {\n            // we can reuse the symbol instance in the clone since it's immutable\n            ((HashSet<Type>) CloneFactory.KnownImmutableTypes).Add(typeof (Symbol));\n            ((HashSet<Type>) CloneFactory.KnownImmutableTypes).Add(typeof (SecurityIdentifier));\n        }\n\n        /// <summary>\n        /// Fast Object Creator from Generic Type:\n        /// Modified from http://rogeralsing.com/2008/02/28/linq-expressions-creating-objects/\n        /// </summary>\n        /// <remarks>This assumes that the type has a parameterless, default constructor</remarks>\n        /// <param name=\"dataType\">Type of the object we wish to create</param>\n        /// <returns>Method to return an instance of object</returns>\n        public static Func<object[], object> GetActivator(Type dataType)\n        {\n            lock (_lock)\n            {\n                // if we already have it, just use it\n                Func<object[], object> factory;\n                if (_activatorsByType.TryGetValue(dataType, out factory))\n                {\n                    return factory;\n                }\n\n                var ctor = dataType.GetConstructor(new Type[] {});\n\n                //User has forgotten to include a parameterless constructor:\n                if (ctor == null) return null;\n\n                var paramsInfo = ctor.GetParameters();\n\n                //create a single param of type object[]\n                var param = Expression.Parameter(typeof (object[]), \"args\");\n                var argsExp = new Expression[paramsInfo.Length];\n\n                for (var i = 0; i < paramsInfo.Length; i++)\n                {\n                    var index = Expression.Constant(i);\n                    var paramType = paramsInfo[i].ParameterType;\n                    var paramAccessorExp = Expression.ArrayIndex(param, index);\n                    var paramCastExp = Expression.Convert(paramAccessorExp, paramType);\n                    argsExp[i] = paramCastExp;\n                }\n\n                var newExp = Expression.New(ctor, argsExp);\n                var lambda = Expression.Lambda(typeof (Func<object[], object>), newExp, param);\n                factory = (Func<object[], object>) lambda.Compile();\n\n                // save it for later\n                _activatorsByType.Add(dataType, factory);\n\n                return factory;\n            }\n        }\n\n        /// <summary>\n        /// Clones the specified instance using reflection\n        /// </summary>\n        /// <param name=\"instanceToClone\">The instance to be cloned</param>\n        /// <returns>A field/property wise, non-recursive clone of the instance</returns>\n        public static object Clone(object instanceToClone)\n        {\n            var type = instanceToClone.GetType();\n            MethodInvoker func;\n            if (_cloneMethodsByType.TryGetValue(type, out func))\n            {\n                return func(null, instanceToClone);\n            }\n\n            // public static T GetClone<T>(this T source, CloningFlags flags)\n            var method = typeof (CloneFactory).GetMethods().FirstOrDefault(x => x.Name == \"GetClone\" && x.GetParameters().Length == 1);\n            method = method.MakeGenericMethod(type);\n            func = method.DelegateForCallMethod();\n            _cloneMethodsByType[type] = func;\n            return func(null, instanceToClone);\n        }\n\n        /// <summary>\n        /// Clones the specified instance and then casts it to T before returning\n        /// </summary>\n        public static T Clone<T>(T instanceToClone) where T : class\n        {\n            var clone = Clone((object)instanceToClone) as T;\n            if (clone == null)\n            {\n                throw new ArgumentException($\"Unable to clone instance of type {instanceToClone.GetType().Name} to {typeof(T).Name}\");\n            }\n            return clone;\n        }\n\n        /// <summary>\n        /// Adds method to return an instance of object\n        /// </summary>\n        /// <param name=\"key\">The key of the method to add</param>\n        /// <param name=\"value\">The value of the method to add</param>\n        public static void AddActivator(Type key, Func<object[], object> value)\n        {\n            if (!_activatorsByType.ContainsKey(key))\n            {\n                _activatorsByType.Add(key, value);\n            }\n            else\n            {\n                throw new ArgumentException($\"ObjectActivator.AddActivator(): a method to return an instance of {key.Name} has already been added\");\n            }\n        }\n\n        /// <summary>\n        /// Reset the object activators\n        /// </summary>\n        public static void ResetActivators()\n        {\n            _activatorsByType.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/OptionPayoff.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Static class containing useful methods related with options payoff\n    /// </summary>\n    public static class OptionPayoff\n    {\n        /// <summary>\n        /// Intrinsic value function of the option\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <param name=\"strike\">The strike price of the option</param>\n        /// <param name=\"right\">The option right of the option, call or put</param>\n        /// <returns>The intrinsic value remains for the option at expiry</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal GetIntrinsicValue(decimal underlyingPrice, decimal strike, OptionRight right)\n        {\n            return Math.Max(0.0m, GetPayOff(underlyingPrice, strike, right));\n        }\n\n        /// <summary>\n        /// Intrinsic value function of the option\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <param name=\"strike\">The strike price of the option</param>\n        /// <param name=\"right\">The option right of the option, call or put</param>\n        /// <returns>The intrinsic value remains for the option at expiry</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static double GetIntrinsicValue(double underlyingPrice, double strike, OptionRight right)\n        {\n            return Math.Max(0.0, GetPayOff(underlyingPrice, strike, right));\n        }\n\n        /// <summary>\n        /// Option payoff function at expiration time\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <param name=\"strike\">The strike price of the option</param>\n        /// <param name=\"right\">The option right of the option, call or put</param>\n        /// <returns></returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal GetPayOff(decimal underlyingPrice, decimal strike, OptionRight right)\n        {\n            return right == OptionRight.Call ? underlyingPrice - strike : strike - underlyingPrice;\n        }\n\n        /// <summary>\n        /// Option payoff function at expiration time\n        /// </summary>\n        /// <param name=\"underlyingPrice\">The price of the underlying</param>\n        /// <param name=\"strike\">The strike price of the option</param>\n        /// <param name=\"right\">The option right of the option, call or put</param>\n        /// <returns></returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static double GetPayOff(double underlyingPrice, double strike, OptionRight right)\n        {\n            return right == OptionRight.Call ? underlyingPrice - strike : strike - underlyingPrice;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/PerformanceTimer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Helper class to keep track of wall time, an efficient stop watch implementation\n    /// </summary>\n    public class PerformanceTimer\n    {\n        private static readonly double _frequency = Stopwatch.Frequency;\n        private long _start;\n        private long _currentTicks;\n        private double _totalSeconds;\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Start()\n        {\n            _start = Stopwatch.GetTimestamp();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Stop()\n        {\n            _currentTicks += Stopwatch.GetTimestamp() - _start;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public decimal GetAndReset()\n        {\n            var currentSeconds = _currentTicks / _frequency;\n            _currentTicks = 0;\n            _totalSeconds += currentSeconds;\n            return (decimal)Math.Round(currentSeconds, 2);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public decimal GetTotalTime()\n        {\n            return (decimal)Math.Round(_totalSeconds, 1);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/PerformanceTrackingTool.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Helper class to track algorithm performance\n    /// </summary>\n    public class PerformanceTrackingTool\n    {\n        private Series _onDataSeries;\n        private Series _dataSubscriptionSeries;\n        private Series _scheduleSeries;\n        private Series _selectionSeries;\n        private Series _sliceCreationSeries;\n        private Series _wallTimeSeries;\n        private Series _securityUpdatesSeries;\n        private Series _consolidatorsSeries;\n        private Series _transactionSeries;\n        private Series _splitsDividendsDelistingSeries;\n\n        private Series _activeSecuritiesCount;\n        private Series _consumedDataPointsCount;\n        private Series _consumedHistoryDataPointsCount;\n\n        private Series _cpuUsage;\n        private Series _managedRamUsage;\n        private Series _totalRamUsage;\n\n        private PerformanceTimer _onData;\n        private PerformanceTimer _dataSubscription;\n        private PerformanceTimer _schedule;\n        private PerformanceTimer _selection;\n        private PerformanceTimer _securityUpdates;\n        private PerformanceTimer _sliceCreation;\n        private PerformanceTimer _consolidators;\n        private PerformanceTimer _transactions;\n        private PerformanceTimer _splitsDividendsDelisting;\n        private bool _sampleEnabled;\n\n        private IAlgorithm _algorithm;\n        private long _previousDps;\n        private long _previousHistoryDps;\n        private DateTime _startWallTime;\n        private DateTime _nextSampleAlgoTime;\n        private DateTime _previousSampleAlgoTime;\n\n        private DateTime _previousSampleWallTime;\n\n        /// <summary>\n        /// Gets the number of data points processed per second\n        /// </summary>\n        public long DataPoints { get; private set; }\n\n        /// <summary>\n        /// Gets the number of data points of algorithm history provider\n        /// </summary>\n        public int HistoryDataPoints => _algorithm?.HistoryProvider?.DataPointCount ?? 0;\n\n        public void Initialize(IAlgorithm algorithm)\n        {\n            _algorithm = algorithm;\n            _sampleEnabled = algorithm.Settings.PerformanceSamplePeriod > TimeSpan.Zero;\n            if (_sampleEnabled)\n            {\n                _onData = new();\n                _dataSubscription = new();\n                _schedule = new();\n                _selection = new();\n                _sliceCreation = new();\n                _consolidators = new();\n                _securityUpdates = new();\n                _transactions = new();\n                _splitsDividendsDelisting = new();\n\n                var chart = new Chart(\"Performance\");\n\n                _onDataSeries = new Series(PerformanceTarget.OnData.ToString(), unit: \"Δ\");\n                _dataSubscriptionSeries = new Series(PerformanceTarget.Subscriptions.ToString(), unit: \"Δ\");\n                _scheduleSeries = new Series(PerformanceTarget.Schedule.ToString(), unit: \"Δ\");\n                _selectionSeries = new Series(PerformanceTarget.Selection.ToString(), unit: \"Δ\");\n                _sliceCreationSeries = new Series(PerformanceTarget.Slice.ToString(), unit: \"Δ\");\n                _consolidatorsSeries = new Series(PerformanceTarget.Consolidators.ToString(), unit: \"Δ\");\n                _securityUpdatesSeries = new Series(PerformanceTarget.Securities.ToString(), unit: \"Δ\");\n                _transactionSeries = new Series(PerformanceTarget.Transactions.ToString(), unit: \"Δ\");\n                _splitsDividendsDelistingSeries = new Series(PerformanceTarget.SplitsDividendsDelisting.ToString(), unit: \"Δ\");\n                _wallTimeSeries = new Series(\"WallTime\", unit: \"Δ\");\n                _activeSecuritiesCount = new Series(\"ActiveSecurities\", unit: \"#\");\n                _consumedDataPointsCount = new Series(\"DataPoints\", SeriesType.Bar, 1, unit: \"#\");\n                _consumedHistoryDataPointsCount = new Series(\"HistoryDataPoints\", SeriesType.Bar, 1, unit: \"#\");\n                _cpuUsage = new Series(\"CPU\", unit: \"%\");\n                _managedRamUsage = new Series(\"ManagedRAM\", unit: string.Empty);\n                _totalRamUsage = new Series(\"TotalRAM\", unit: string.Empty);\n\n                chart.AddSeries(_cpuUsage);\n                chart.AddSeries(_managedRamUsage);\n                chart.AddSeries(_totalRamUsage);\n                chart.AddSeries(_onDataSeries);\n                chart.AddSeries(_consolidatorsSeries);\n                chart.AddSeries(_dataSubscriptionSeries);\n                chart.AddSeries(_scheduleSeries);\n                chart.AddSeries(_wallTimeSeries);\n                chart.AddSeries(_securityUpdatesSeries);\n                chart.AddSeries(_selectionSeries);\n                chart.AddSeries(_sliceCreationSeries);\n                chart.AddSeries(_activeSecuritiesCount);\n                chart.AddSeries(_consumedDataPointsCount);\n                chart.AddSeries(_consumedHistoryDataPointsCount);\n                chart.AddSeries(_transactionSeries);\n                chart.AddSeries(_splitsDividendsDelistingSeries);\n                algorithm.AddChart(chart);\n\n                _previousSampleWallTime = _startWallTime = DateTime.UtcNow;\n                _previousSampleAlgoTime = algorithm.UtcTime;\n                _nextSampleAlgoTime = _previousSampleAlgoTime + _algorithm.Settings.PerformanceSamplePeriod;\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Sample(int dataPointCount, DateTime utcAlgoTime)\n        {\n            DataPoints += dataPointCount;\n            if (!_sampleEnabled)\n            {\n                return;\n            }\n\n            if (utcAlgoTime >= _nextSampleAlgoTime)\n            {\n                var nowUtc = DateTime.UtcNow;\n\n                // these share the same unit, real wall time\n                _onDataSeries.AddPoint(utcAlgoTime, _onData.GetAndReset());\n                _dataSubscriptionSeries.AddPoint(utcAlgoTime, _dataSubscription.GetAndReset());\n                _scheduleSeries.AddPoint(utcAlgoTime, _schedule.GetAndReset());\n                _selectionSeries.AddPoint(utcAlgoTime, _selection.GetAndReset());\n                _sliceCreationSeries.AddPoint(utcAlgoTime, _sliceCreation.GetAndReset());\n                _consolidatorsSeries.AddPoint(utcAlgoTime, _consolidators.GetAndReset());\n                _securityUpdatesSeries.AddPoint(utcAlgoTime, _securityUpdates.GetAndReset());\n                _transactionSeries.AddPoint(utcAlgoTime, _transactions.GetAndReset());\n                _splitsDividendsDelistingSeries.AddPoint(utcAlgoTime, _splitsDividendsDelisting.GetAndReset());\n                _wallTimeSeries.AddPoint(utcAlgoTime, (decimal)Math.Round((nowUtc - _previousSampleWallTime).TotalSeconds, 2));\n\n                _activeSecuritiesCount.AddPoint(utcAlgoTime, _algorithm.UniverseManager.ActiveSecurities.Count);\n                _consumedDataPointsCount.AddPoint(utcAlgoTime, DataPoints - _previousDps);\n                _consumedHistoryDataPointsCount.AddPoint(utcAlgoTime, HistoryDataPoints - _previousHistoryDps);\n\n                _cpuUsage.AddPoint(utcAlgoTime, (int)OS.CpuUsage);\n                _managedRamUsage.AddPoint(utcAlgoTime, OS.TotalPhysicalMemoryUsed);\n                _totalRamUsage.AddPoint(utcAlgoTime, OS.ApplicationMemoryUsed);\n\n                _previousHistoryDps = HistoryDataPoints;\n                _previousDps = DataPoints;\n                _previousSampleWallTime = nowUtc;\n                _nextSampleAlgoTime = utcAlgoTime + _algorithm.Settings.PerformanceSamplePeriod;\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Start(PerformanceTarget target)\n        {\n            if (!_sampleEnabled)\n            {\n                return;\n            }\n            Get(target).Start();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Stop(PerformanceTarget target)\n        {\n            if (!_sampleEnabled)\n            {\n                return;\n            }\n            Get(target).Stop();\n        }\n\n        public void Shutdown()\n        {\n            if (!_sampleEnabled)\n            {\n                return;\n            }\n\n            var endTime = DateTime.UtcNow;\n            var message = $\"Dps {DataPoints}. HistoryDps {HistoryDataPoints}.\" +\n                $\" TotalRuntime: {(endTime - _startWallTime):hh\\\\:mm\\\\:ss}.\" +\n                $\" OnData: {_onData.GetTotalTime()}s.\" +\n                $\" DataSubscription: {_dataSubscription.GetTotalTime()}s.\" +\n                $\" SliceCreation: {_sliceCreation.GetTotalTime()}s.\" +\n                $\" Selection: {_selection.GetTotalTime()}s.\" +\n                $\" Schedule: {_schedule.GetTotalTime()}s.\" +\n                $\" Consolidators: {_consolidators.GetTotalTime()}s.\" +\n                $\" Securities: {_securityUpdates.GetTotalTime()}s.\" +\n                $\" Transactions: {_transactions.GetTotalTime()}s.\" +\n                $\" SplitsDividendsDelisting: {_splitsDividendsDelisting.GetTotalTime()}s.\" +\n                $\" ActiveSecurities: {_algorithm.UniverseManager.ActiveSecurities.Count}\";\n\n            Logging.Log.Trace($\"PerformanceTrackingTool.Summary(): {message}\");\n            _algorithm.Debug(message);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private PerformanceTimer Get(PerformanceTarget target)\n        {\n            switch (target)\n            {\n                case PerformanceTarget.Subscriptions:\n                    return _dataSubscription;\n                case PerformanceTarget.Slice:\n                    return _sliceCreation;\n                case PerformanceTarget.Selection:\n                    return _selection;\n                case PerformanceTarget.Schedule:\n                    return _schedule;\n                case PerformanceTarget.OnData:\n                    return _onData;\n                case PerformanceTarget.Consolidators:\n                    return _consolidators;\n                case PerformanceTarget.Securities:\n                    return _securityUpdates;\n                case PerformanceTarget.Transactions:\n                    return _transactions;\n                case PerformanceTarget.SplitsDividendsDelisting:\n                    return _splitsDividendsDelisting;\n                default:\n                    throw new ArgumentException(nameof(target));\n            }\n        }\n    }\n\n    public enum PerformanceTarget\n    {\n        Selection,\n        Subscriptions,\n        Slice,\n        OnData,\n        Schedule,\n        Consolidators,\n        Securities,\n        Transactions,\n        SplitsDividendsDelisting,\n    }\n}\n"
  },
  {
    "path": "Common/Util/PythonUtil.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing System.Text.RegularExpressions;\nusing QuantConnect.Data.UniverseSelection;\nusing System.Globalization;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Collection of utils for python objects processing\n    /// </summary>\n    public class PythonUtil\n    {\n        private static Regex LineRegex = new Regex(\"line (\\\\d+)\", RegexOptions.Compiled);\n        private static Regex StackTraceFileLineRegex = new Regex(\"\\\"(.+)\\\", line (\\\\d+), in (.+)\", RegexOptions.Compiled | RegexOptions.Singleline);\n        private static readonly Lazy<dynamic> lazyInspect = new Lazy<dynamic>(() => Py.Import(\"inspect\"));\n\n        /// <summary>\n        /// The python exception stack trace line shift to use\n        /// </summary>\n        public static int ExceptionLineShift { get; set; } = 0;\n\n        /// <summary>\n        /// Encapsulates a python method with a <see cref=\"System.Action{T1}\"/>\n        /// </summary>\n        /// <typeparam name=\"T1\">The input type</typeparam>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"System.Action{T1}\"/> that encapsulates the python method</returns>\n        public static Action<T1> ToAction<T1>(PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                long count = 0;\n                if (!TryGetArgLength(pyObject, out count) || count != 1)\n                {\n                    return null;\n                }\n                dynamic method = GetModule().GetAttr(\"to_action1\");\n                return method(pyObject, typeof(T1)).AsManagedObject(typeof(Action<T1>));\n            }\n        }\n\n        /// <summary>\n        /// Encapsulates a python method with a <see cref=\"System.Action{T1, T2}\"/>\n        /// </summary>\n        /// <typeparam name=\"T1\">The first input type</typeparam>\n        /// <typeparam name=\"T2\">The second input type type</typeparam>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"System.Action{T1, T2}\"/> that encapsulates the python method</returns>\n        public static Action<T1, T2> ToAction<T1, T2>(PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                long count = 0;\n                if (!TryGetArgLength(pyObject, out count) || count != 2)\n                {\n                    return null;\n                }\n                dynamic method = GetModule().GetAttr(\"to_action2\");\n                return method(pyObject, typeof(T1), typeof(T2)).AsManagedObject(typeof(Action<T1, T2>));\n            }\n        }\n\n        /// <summary>\n        /// Encapsulates a python method with a <see cref=\"System.Func{T1, T2}\"/>\n        /// </summary>\n        /// <typeparam name=\"T1\">The data type</typeparam>\n        /// <typeparam name=\"T2\">The output type</typeparam>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"System.Func{T1, T2}\"/> that encapsulates the python method</returns>\n        public static Func<T1, T2> ToFunc<T1, T2>(PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                long count = 0;\n                if (!TryGetArgLength(pyObject, out count) || count != 1)\n                {\n                    return null;\n                }\n                dynamic method = GetModule().GetAttr(\"to_func1\");\n                return method(pyObject, typeof(T1), typeof(T2)).AsManagedObject(typeof(Func<T1, T2>));\n            }\n        }\n\n        /// <summary>\n        /// Encapsulates a python method with a <see cref=\"System.Func{T1, T2, T3}\"/>\n        /// </summary>\n        /// <typeparam name=\"T1\">The first argument's type</typeparam>\n        /// <typeparam name=\"T2\">The first argument's type</typeparam>\n        /// <typeparam name=\"T3\">The output type</typeparam>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"System.Func{T1, T2, T3}\"/> that encapsulates the python method</returns>\n        public static Func<T1, T2, T3> ToFunc<T1, T2, T3>(PyObject pyObject)\n        {\n            using (Py.GIL())\n            {\n                long count = 0;\n                if (!TryGetArgLength(pyObject, out count) || count != 2)\n                {\n                    return null;\n                }\n                dynamic method = GetModule().GetAttr(\"to_func2\");\n                return method(pyObject, typeof(T1), typeof(T2), typeof(T3)).AsManagedObject(typeof(Func<T1, T2, T3>));\n            }\n        }\n\n        /// <summary>\n        /// Encapsulates a python method in coarse fundamental universe selector.\n        /// </summary>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"Func{T, TResult}\"/> (parameter is <see cref=\"IEnumerable{CoarseFundamental}\"/>, return value is <see cref=\"IEnumerable{Symbol}\"/>) that encapsulates the python method</returns>\n        public static Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> ToCoarseFundamentalSelector(PyObject pyObject)\n        {\n            var selector = ToFunc<IEnumerable<CoarseFundamental>, Symbol[]>(pyObject);\n            if (selector == null)\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"{pyObject.Repr()} is not a valid coarse fundamental universe selector method.\");\n                }\n            }\n            return selector;\n        }\n\n        /// <summary>\n        /// Encapsulates a python method in fine fundamental universe selector.\n        /// </summary>\n        /// <param name=\"pyObject\">The python method</param>\n        /// <returns>A <see cref=\"Func{T, TResult}\"/> (parameter is <see cref=\"IEnumerable{FineFundamental}\"/>, return value is <see cref=\"IEnumerable{Symbol}\"/>) that encapsulates the python method</returns>\n        public static Func<IEnumerable<FineFundamental>, IEnumerable<Symbol>> ToFineFundamentalSelector(PyObject pyObject)\n        {\n            var selector = ToFunc<IEnumerable<FineFundamental>, Symbol[]>(pyObject);\n            if (selector == null)\n            {\n                using (Py.GIL())\n                {\n                    throw new ArgumentException($\"{pyObject.Repr()} is not a valid fine fundamental universe selector method.\");\n                }\n            }\n            return selector;\n        }\n\n        /// <summary>\n        /// Parsers <see cref=\"PythonException\"/> into a readable message\n        /// </summary>\n        /// <param name=\"pythonException\">The exception to parse</param>\n        /// <returns>String with relevant part of the stacktrace</returns>\n        public static string PythonExceptionParser(PythonException pythonException)\n        {\n            return PythonExceptionMessageParser(pythonException.Message) + PythonExceptionStackParser(pythonException.StackTrace);\n        }\n\n        /// <summary>\n        /// Parsers <see cref=\"Exception.Message\"/> into a readable message\n        /// </summary>\n        /// <param name=\"message\">The python exception message</param>\n        /// <returns>String with relevant part of the stacktrace</returns>\n        public static string PythonExceptionMessageParser(string message)\n        {\n            var match = LineRegex.Match(message);\n            if (match.Success)\n            {\n                foreach (Match lineCapture in match.Captures)\n                {\n                    var newLineNumber = int.Parse(lineCapture.Groups[1].Value) + ExceptionLineShift;\n                    message = Regex.Replace(message, lineCapture.ToString(), $\"line {newLineNumber}\");\n                }\n            }\n            else if (message.Contains(\" value cannot be converted to \", StringComparison.InvariantCulture))\n            {\n                message += \": This error is often encountered when assigning to a member defined in the base QCAlgorithm class. For example, self.universe conflicts with 'QCAlgorithm.Universe' but can be fixed by prefixing private variables with an underscore, self._universe.\";\n            }\n\n            return message;\n        }\n\n        /// <summary>\n        /// Parsers <see cref=\"PythonException.StackTrace\"/> into a readable message\n        /// </summary>\n        /// <param name=\"value\">String with the stacktrace information</param>\n        /// <returns>String with relevant part of the stacktrace</returns>\n        public static string PythonExceptionStackParser(string value)\n        {\n            if (string.IsNullOrWhiteSpace(value))\n            {\n                return string.Empty;\n            }\n\n            // The stack trace info before \"at Python.Runtime.\" is the trace we want,\n            // which is for user Python code.\n            var endIndex = value.IndexOf(\"at Python.Runtime.\", StringComparison.InvariantCulture);\n            var neededStackTrace = endIndex > 0 ? value.Substring(0, endIndex) : value;\n\n            // The stack trace is separated in blocks by file\n            var blocks = neededStackTrace.Split(\"  File \", StringSplitOptions.RemoveEmptyEntries)\n                .Select(fileTrace =>\n                {\n                    var trimedTrace = fileTrace.Trim();\n                    if (string.IsNullOrWhiteSpace(trimedTrace))\n                    {\n                        return string.Empty;\n                    }\n\n                    var match = StackTraceFileLineRegex.Match(trimedTrace);\n                    if (!match.Success)\n                    {\n                        return string.Empty;\n                    }\n\n                    var capture = match.Captures[0] as Match;\n\n                    var filePath = capture.Groups[1].Value;\n                    var lastFileSeparatorIndex = Math.Max(filePath.LastIndexOf('/'), filePath.LastIndexOf('\\\\'));\n                    if (lastFileSeparatorIndex < 0)\n                    {\n                        return string.Empty;\n                    }\n\n                    var fileName = filePath.Substring(lastFileSeparatorIndex + 1);\n                    var lineNumber = int.Parse(capture.Groups[2].Value, CultureInfo.InvariantCulture) + ExceptionLineShift;\n                    var locationAndInfo = capture.Groups[3].Value.Trim();\n\n                    return $\"  at {locationAndInfo}{Environment.NewLine} in {fileName}: line {lineNumber}\";\n                })\n                .Where(x => !string.IsNullOrWhiteSpace(x));\n\n            var result = string.Join(Environment.NewLine, blocks);\n            result = Logging.Log.ClearLeanPaths(result);\n\n            return string.IsNullOrWhiteSpace(result)\n                ? string.Empty\n                : $\"{Environment.NewLine}{result}{Environment.NewLine}\";\n        }\n\n        /// <summary>\n        /// Try to get the length of arguments of a method\n        /// </summary>\n        /// <param name=\"pyObject\">Object representing a method</param>\n        /// <param name=\"length\">Lenght of arguments</param>\n        /// <returns>True if pyObject is a method</returns>\n        private static bool TryGetArgLength(PyObject pyObject, out long length)\n        {\n            using (Py.GIL())\n            {\n                var inspect = lazyInspect.Value;\n                if (inspect.isfunction(pyObject))\n                {\n                    var args = inspect.getfullargspec(pyObject).args as PyObject;\n                    var pyList = new PyList(args);\n                    length = pyList.Length();\n                    pyList.Dispose();\n                    args.Dispose();\n                    return true;\n                }\n\n                if (inspect.ismethod(pyObject))\n                {\n                    var args = inspect.getfullargspec(pyObject).args as PyObject;\n                    var pyList = new PyList(args);\n                    length = pyList.Length() - 1;\n                    pyList.Dispose();\n                    args.Dispose();\n                    return true;\n                }\n            }\n            length = 0;\n            return false;\n        }\n\n        /// <summary>\n        /// Creates a python module with utils methods\n        /// </summary>\n        /// <returns>PyObject with a python module</returns>\n        private static PyObject GetModule()\n        {\n            return PyModule.FromString(\"x\",\n                \"from clr import AddReference\\n\" +\n                \"AddReference(\\\"System\\\")\\n\" +\n                \"from System import Action, Func\\n\" +\n                \"def to_action1(pyobject, t1):\\n\" +\n                \"    return Action[t1](pyobject)\\n\" +\n                \"def to_action2(pyobject, t1, t2):\\n\" +\n                \"    return Action[t1, t2](pyobject)\\n\" +\n                \"def to_func1(pyobject, t1, t2):\\n\" +\n                \"    return Func[t1, t2](pyobject)\\n\" +\n                \"def to_func2(pyobject, t1, t2, t3):\\n\" +\n                \"    return Func[t1, t2, t3](pyobject)\");\n        }\n\n        /// <summary>\n        /// Convert Python input to a list of Symbols\n        /// </summary>\n        /// <param name=\"input\">Object with the desired property</param>\n        /// <returns>List of Symbols</returns>\n        public static IEnumerable<Symbol> ConvertToSymbols(PyObject input)\n        {\n            List<Symbol> symbolsList;\n            Symbol symbol;\n\n            using (Py.GIL())\n            {\n                // Handle the possible types of conversions\n                if (PyList.IsListType(input))\n                {\n                    List<string> symbolsStringList;\n\n                    //Check if an entry in the list is a string type, if so then try and convert the whole list\n                    if (PyString.IsStringType(input[0]) && input.TryConvert(out symbolsStringList))\n                    {\n                        symbolsList = new List<Symbol>();\n                        foreach (var stringSymbol in symbolsStringList)\n                        {\n                            symbol = QuantConnect.Symbol.Create(stringSymbol, SecurityType.Equity, Market.USA);\n                            symbolsList.Add(symbol);\n                        }\n                    }\n                    //Try converting it to list of symbols, if it fails throw exception\n                    else if (!input.TryConvert(out symbolsList))\n                    {\n                        throw new ArgumentException($\"Cannot convert list {input.Repr()} to symbols\");\n                    }\n                }\n                else\n                {\n                    //Check if its a single string, and try and convert it\n                    string symbolString;\n                    if (PyString.IsStringType(input) && input.TryConvert(out symbolString))\n                    {\n                        symbol = QuantConnect.Symbol.Create(symbolString, SecurityType.Equity, Market.USA);\n                        symbolsList = new List<Symbol> { symbol };\n                    }\n                    else if (input.TryConvert(out symbol))\n                    {\n                        symbolsList = new List<Symbol> { symbol };\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"Cannot convert object {input.Repr()} to symbol\");\n                    }\n                }\n            }\n            return symbolsList;\n        }\n\n        /// <summary>\n        /// Attempts to convert a PyObject into a pure C# instance of <typeparamref name=\"T\"/>.\n        /// If conversion fails, a wrapper instance is created/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The C# type expected, which may be an interface or a concrete class</typeparam>\n        /// <param name=\"pyObject\">The Python object to convert.</param>\n        /// <param name=\"createWrapper\">Factory function used to create a wrapper around the Python object</param>\n        /// <returns>\n        /// A pure C# instance if conversion is possible, otherwise a wrapper instance.\n        /// </returns>\n        public static T CreateInstanceOrWrapper<T>(PyObject pyObject, Func<PyObject, T> createWrapper)\n        {\n            if (pyObject.TryConvert<T>(out var instance))\n            {\n                // Successfully converted to pure C#\n                return instance;\n            }\n\n            // Fallback to wrapper\n            return createWrapper(pyObject);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/RateGate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Used to control the rate of some occurrence per unit of time.\n    /// </summary>\n    /// <see href=\"http://www.jackleitch.net/2010/10/better-rate-limiting-with-dot-net/\"/>\n    /// <remarks>\n    ///     <para>\n    ///     To control the rate of an action using a <see cref=\"RateGate\"/>,\n    ///     code should simply call <see cref=\"WaitToProceed()\"/> prior to\n    ///     performing the action. <see cref=\"WaitToProceed()\"/> will block\n    ///     the current thread until the action is allowed based on the rate\n    ///     limit.\n    ///     </para>\n    ///     <para>\n    ///     This class is thread safe. A single <see cref=\"RateGate\"/> instance\n    ///     may be used to control the rate of an occurrence across multiple\n    ///     threads.\n    ///     </para>\n    /// </remarks>\n    public class RateGate : IDisposable\n    {\n        // Semaphore used to count and limit the number of occurrences per\n        // unit time.\n        private readonly SemaphoreSlim _semaphore;\n\n        // Times (in millisecond ticks) at which the semaphore should be exited.\n        private readonly Queue<int> _exitTimes;\n\n        // Timer used to trigger exiting the semaphore.\n        private readonly Timer _exitTimer;\n\n        // Whether this instance is disposed.\n        private bool _isDisposed;\n\n        /// <summary>\n        /// Number of occurrences allowed per unit of time.\n        /// </summary>\n        public int Occurrences\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// The length of the time unit, in milliseconds.\n        /// </summary>\n        public int TimeUnitMilliseconds\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Flag indicating we are currently being rate limited\n        /// </summary>\n        public bool IsRateLimited\n        {\n            get { return !WaitToProceed(0); }\n        }\n\n        /// <summary>\n        /// Initializes a <see cref=\"RateGate\"/> with a rate of <paramref name=\"occurrences\"/>\n        /// per <paramref name=\"timeUnit\"/>.\n        /// </summary>\n        /// <param name=\"occurrences\">Number of occurrences allowed per unit of time.</param>\n        /// <param name=\"timeUnit\">Length of the time unit.</param>\n        /// <exception cref=\"ArgumentOutOfRangeException\">\n        /// If <paramref name=\"occurrences\"/> or <paramref name=\"timeUnit\"/> is negative.\n        /// </exception>\n        public RateGate(int occurrences, TimeSpan timeUnit)\n        {\n            // Check the arguments.\n            if (occurrences <= 0)\n                throw new ArgumentOutOfRangeException(nameof(occurrences), \"Number of occurrences must be a positive integer\");\n            if (timeUnit != timeUnit.Duration())\n                throw new ArgumentOutOfRangeException(nameof(timeUnit), \"Time unit must be a positive span of time\");\n            if (timeUnit >= TimeSpan.FromMilliseconds(UInt32.MaxValue))\n                throw new ArgumentOutOfRangeException(nameof(timeUnit), \"Time unit must be less than 2^32 milliseconds\");\n\n            Occurrences = occurrences;\n            TimeUnitMilliseconds = (int)timeUnit.TotalMilliseconds;\n\n            // Create the semaphore, with the number of occurrences as the maximum count.\n            _semaphore = new SemaphoreSlim(Occurrences, Occurrences);\n\n            // Create a queue to hold the semaphore exit times.\n            _exitTimes = new ();\n\n            // Create a timer to exit the semaphore. Use the time unit as the original\n            // interval length because that's the earliest we will need to exit the semaphore.\n            _exitTimer = new Timer(ExitTimerCallback, null, Timeout.Infinite, Timeout.Infinite);\n        }\n\n        // Callback for the exit timer that exits the semaphore based on exit times\n        // in the queue and then sets the timer for the nextexit time.\n        // Credit to Jim: http://www.jackleitch.net/2010/10/better-rate-limiting-with-dot-net/#comment-3620\n        // for providing the code below, fixing issue #3499 - https://github.com/QuantConnect/Lean/issues/3499\n        private void ExitTimerCallback(object state)\n        {\n            try\n            {\n                // While there are exit times that are passed due still in the queue,\n                // exit the semaphore and dequeue the exit time.\n                var exitTime = 0;\n                var exitTimeValid = false;\n                var tickCount = Environment.TickCount;\n                lock (_exitTimes)\n                {\n                    exitTimeValid = _exitTimes.TryPeek(out exitTime);\n                    while (exitTimeValid)\n                    {\n                        if (unchecked(exitTime - tickCount) > 0)\n                        {\n                            break;\n                        }\n                        _semaphore.Release();\n                        _exitTimes.Dequeue();\n                        exitTimeValid = _exitTimes.TryPeek(out exitTime);\n                    }\n\n                    // only schedule if there's someone waiting\n                    if (exitTimeValid)\n                    {\n                        // we are already holding the next item from the queue, do not peek again\n                        // although this exit time may have already pass by this stmt.\n                        var timeUntilNextCheck = Math.Min(TimeUnitMilliseconds, Math.Max(0, exitTime - tickCount));\n                        _exitTimer.Change(timeUntilNextCheck, Timeout.Infinite);\n                    }\n                }\n            }\n            catch (Exception)\n            {\n                // can throw if called when disposing\n            }\n        }\n\n        /// <summary>\n        /// Blocks the current thread until allowed to proceed or until the\n        /// specified timeout elapses.\n        /// </summary>\n        /// <param name=\"millisecondsTimeout\">Number of milliseconds to wait, or -1 to wait indefinitely.</param>\n        /// <returns>true if the thread is allowed to proceed, or false if timed out</returns>\n        public bool WaitToProceed(int millisecondsTimeout)\n        {\n            // Check the arguments.\n            if (millisecondsTimeout < -1)\n                throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout));\n\n            CheckDisposed();\n\n            // Block until we can enter the semaphore or until the timeout expires.\n            var entered = _semaphore.Wait(millisecondsTimeout);\n\n            // If we entered the semaphore, compute the corresponding exit time\n            // and add it to the queue.\n            if (entered)\n            {\n                var timeToExit = unchecked(Environment.TickCount + TimeUnitMilliseconds);\n                lock(_exitTimes)\n                {\n                    if (_exitTimes.Count == 0)\n                    {\n                        // schedule, there was no one so it's not scheduled\n                        _exitTimer.Change(TimeUnitMilliseconds, Timeout.Infinite);\n                    }\n                    _exitTimes.Enqueue(timeToExit);\n                }\n            }\n\n            return entered;\n        }\n\n        /// <summary>\n        /// Blocks the current thread until allowed to proceed or until the\n        /// specified timeout elapses.\n        /// </summary>\n        /// <param name=\"timeout\"></param>\n        /// <returns>true if the thread is allowed to proceed, or false if timed out</returns>\n        public bool WaitToProceed(TimeSpan timeout)\n        {\n            return WaitToProceed((int)timeout.TotalMilliseconds);\n        }\n\n        /// <summary>\n        /// Blocks the current thread indefinitely until allowed to proceed.\n        /// </summary>\n        public void WaitToProceed()\n        {\n            WaitToProceed(Timeout.Infinite);\n        }\n\n        // Throws an ObjectDisposedException if this object is disposed.\n        private void CheckDisposed()\n        {\n            if (_isDisposed)\n                throw new ObjectDisposedException(\"RateGate is already disposed\");\n        }\n\n        /// <summary>\n        /// Releases unmanaged resources held by an instance of this class.\n        /// </summary>\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Releases unmanaged resources held by an instance of this class.\n        /// </summary>\n        /// <param name=\"isDisposing\">Whether this object is being disposed.</param>\n        protected virtual void Dispose(bool isDisposing)\n        {\n            if (!_isDisposed)\n            {\n                if (isDisposing)\n                {\n                    // The semaphore and timer both implement IDisposable and\n                    // therefore must be disposed.\n                    _semaphore.Dispose();\n                    _exitTimer.Dispose();\n\n                    _isDisposed = true;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/RateLimit/BusyWaitSleepStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Threading;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides a CPU intensive means of waiting for more tokens to be available in <see cref=\"ITokenBucket\"/>.\n    /// This strategy is only viable when the requested number of tokens is expected to become available in an\n    /// extremely short period of time. This implementation aims to keep the current thread executing to prevent\n    /// potential content switches arising from a thread yielding or sleeping strategy.\n    /// </summary>\n    public class BusyWaitSleepStrategy : ISleepStrategy\n    {\n        /// <summary>\n        /// Provides a CPU intensive sleep by executing <see cref=\"Thread.SpinWait\"/> for a single spin.\n        /// </summary>\n        public void Sleep()\n        {\n            Thread.SpinWait(1);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/FixedIntervalRefillStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides a refill strategy that has a constant, quantized refill rate.\n    /// For example, after 1 minute passes add 5 units. If 59 seconds has passed, it will add zero unit,\n    /// but if 2 minutes have passed, then 10 units would be added.\n    /// </summary>\n    public class FixedIntervalRefillStrategy : IRefillStrategy\n    {\n        private readonly object _sync = new object();\n\n        private long _nextRefillTimeTicks;\n\n        private readonly long _refillAmount;\n        private readonly long _refillIntervalTicks;\n        private readonly ITimeProvider _timeProvider;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FixedIntervalRefillStrategy\"/> class.\n        /// </summary>\n        /// <param name=\"timeProvider\">Provides the current time used for determining how much time has elapsed\n        /// between invocations of the refill method</param>\n        /// <param name=\"refillAmount\">Defines the constant number of tokens to be made available for consumption\n        /// each time the provided <paramref name=\"refillInterval\"/> has passed</param>\n        /// <param name=\"refillInterval\">The amount of time that must pass before adding the specified <paramref name=\"refillAmount\"/>\n        /// back to the bucket</param>\n        public FixedIntervalRefillStrategy(ITimeProvider timeProvider, long refillAmount, TimeSpan refillInterval)\n        {\n            _timeProvider = timeProvider;\n            _refillAmount = refillAmount;\n            _refillIntervalTicks = refillInterval.Ticks;\n            _nextRefillTimeTicks = _timeProvider.GetUtcNow().Ticks + _refillIntervalTicks;\n        }\n\n        /// <summary>\n        /// Computes the number of new tokens made available to the bucket for consumption by determining the\n        /// number of time intervals that have passed and multiplying by the number of tokens to refill for\n        /// each time interval.\n        /// </summary>\n        public long Refill()\n        {\n            lock (_sync)\n            {\n                var currentTimeTicks = _timeProvider.GetUtcNow().Ticks;\n                if (currentTimeTicks < _nextRefillTimeTicks)\n                {\n                    return 0L;\n                }\n\n                // determine number of time increments that have passed\n                var deltaTimeTicks = currentTimeTicks - _nextRefillTimeTicks;\n                var intervalsElapsed = 1 + Math.Max(deltaTimeTicks / _refillIntervalTicks, 0);\n\n                // update next refill time as quantized via the number of passed intervals\n                _nextRefillTimeTicks += _refillIntervalTicks * intervalsElapsed;\n\n                // refill by the tokens per interval times the number of intervals elapsed\n                return _refillAmount * intervalsElapsed;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/IRefillStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides a strategy for making tokens available for consumption in the <see cref=\"ITokenBucket\"/>\n    /// </summary>\n    public interface IRefillStrategy\n    {\n        /// <summary>\n        /// Computes the number of new tokens made available, typically via the passing of time.\n        /// </summary>\n        long Refill();\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/ISleepStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Defines a strategy for sleeping the current thread of execution. This is currently used via the\n    /// <see cref=\"ITokenBucket.Consume\"/> in order to wait for new tokens to become available for consumption.\n    /// </summary>\n    public interface ISleepStrategy\n    {\n        /// <summary>\n        /// Sleeps the current thread in an implementation specific way\n        /// and for an implementation specific amount of time\n        /// </summary>\n        void Sleep();\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/ITokenBucket.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Defines a token bucket for rate limiting\n    /// See: https://en.wikipedia.org/wiki/Token_bucket\n    /// </summary>\n    /// <remarks>\n    /// This code is ported from https://github.com/mxplusb/TokenBucket - since it's a dotnet core\n    /// project, there were issued importing the nuget package directly. The referenced repository\n    /// is provided under the Apache V2 license.\n    /// </remarks>\n    public interface ITokenBucket\n    {\n        /// <summary>\n        /// Gets the maximum capacity of tokens this bucket can hold.\n        /// </summary>\n        long Capacity { get; }\n\n        /// <summary>\n        /// Gets the total number of currently available tokens for consumption\n        /// </summary>\n        long AvailableTokens { get; }\n\n        /// <summary>\n        /// Blocks until the specified number of tokens are available for consumption\n        /// and then consumes that number of tokens.\n        /// </summary>\n        /// <param name=\"tokens\">The number of tokens to consume</param>\n        /// <param name=\"timeout\">The maximum amount of time, in milliseconds, to block. A <see cref=\"TimeoutException\"/>\n        /// is throw in the event it takes longer than the stated timeout to consume the requested number of tokens.\n        /// The default timeout is set to infinite, which will block forever.</param>\n        void Consume(long tokens, long timeout = Timeout.Infinite);\n\n        /// <summary>\n        /// Attempts to consume the specified number of tokens from the bucket. If the\n        /// requested number of tokens are not immediately available, then this method\n        /// will return false to indicate that zero tokens have been consumed.\n        /// </summary>\n        bool TryConsume(long tokens);\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/LeakyBucket.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ITokenBucket\"/> that implements the leaky bucket algorithm\n    /// See: https://en.wikipedia.org/wiki/Leaky_bucket\n    /// </summary>\n    public class LeakyBucket : ITokenBucket\n    {\n        private readonly object _sync = new object();\n\n        private long _available;\n        private readonly ISleepStrategy _sleep;\n        private readonly IRefillStrategy _refill;\n        private readonly ITimeProvider _timeProvider;\n\n        /// <summary>\n        /// Gets the maximum capacity of tokens this bucket can hold.\n        /// </summary>\n        public long Capacity { get; }\n\n        /// <summary>\n        /// Gets the total number of currently available tokens for consumption\n        /// </summary>\n        public long AvailableTokens\n        {\n            // synchronized read w/ the modification of available tokens in TryConsume\n            get { lock (_sync) return _available; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeakyBucket\"/> class.\n        /// This constructor initializes the bucket using the <see cref=\"ThreadSleepStrategy.Sleep\"/> with a 1 millisecond\n        /// sleep to prevent being CPU intensive and uses the <see cref=\"FixedIntervalRefillStrategy\"/> to refill bucket\n        /// tokens according to the <paramref name=\"refillAmount\"/> and <paramref name=\"refillInterval\"/> parameters.\n        /// </summary>\n        /// <param name=\"capacity\">The maximum number of tokens this bucket can hold</param>\n        /// <param name=\"refillAmount\">The number of tokens to add to the bucket each <paramref name=\"refillInterval\"/></param>\n        /// <param name=\"refillInterval\">The interval which after passing more tokens are added to the bucket</param>\n        public LeakyBucket(long capacity, long refillAmount, TimeSpan refillInterval)\n            : this(capacity, ThreadSleepStrategy.Sleeping(1),\n                new FixedIntervalRefillStrategy(RealTimeProvider.Instance, refillAmount, refillInterval)\n            )\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeakyBucket\"/> class\n        /// </summary>\n        /// <param name=\"capacity\">The maximum number of tokens this bucket can hold</param>\n        /// <param name=\"sleep\">Defines the <see cref=\"ISleepStrategy\"/> used when <see cref=\"Consume\"/> is invoked\n        /// but the bucket does not have enough tokens yet</param>\n        /// <param name=\"refill\">Defines the <see cref=\"IRefillStrategy\"/> that computes how many tokens to add\n        /// back to the bucket each time consumption is attempted</param>\n        /// <param name=\"timeProvider\">Defines the <see cref=\"ITimeProvider\"/> used to enforce timeouts when\n        /// invoking <see cref=\"Consume\"/></param>\n        public LeakyBucket(long capacity, ISleepStrategy sleep, IRefillStrategy refill, ITimeProvider timeProvider = null)\n        {\n            _sleep = sleep;\n            _refill = refill;\n            Capacity = capacity;\n            _available = capacity;\n            _timeProvider = timeProvider ?? RealTimeProvider.Instance;\n        }\n\n        /// <summary>\n        /// Blocks until the specified number of tokens are available for consumption\n        /// and then consumes that number of tokens.\n        /// </summary>\n        /// <param name=\"tokens\">The number of tokens to consume</param>\n        /// <param name=\"timeout\">The maximum amount of time, in milliseconds, to block. An exception is\n        /// throw in the event it takes longer than the stated timeout to consume the requested number\n        /// of tokens</param>\n        public void Consume(long tokens, long timeout = Timeout.Infinite)\n        {\n            if (timeout < Timeout.Infinite)\n            {\n                throw new ArgumentOutOfRangeException(nameof(timeout),\n                    \"Invalid timeout. Use -1 for no timeout, 0 for immediate timeout and a positive number \" +\n                    \"of milliseconds to indicate a timeout. All other values are out of range.\"\n                );\n            }\n\n            var startTime = _timeProvider.GetUtcNow();\n\n            while (true)\n            {\n                if (TryConsume(tokens))\n                {\n                    break;\n                }\n\n                if (timeout != Timeout.Infinite)\n                {\n                    // determine if the requested timeout has elapsed\n                    var currentTime = _timeProvider.GetUtcNow();\n                    var elapsedMilliseconds = (currentTime - startTime).TotalMilliseconds;\n                    if (elapsedMilliseconds > timeout)\n                    {\n                        throw new TimeoutException(\"The operation timed out while waiting for the rate limit to be lifted.\");\n                    }\n                }\n\n                _sleep.Sleep();\n            }\n        }\n\n        /// <summary>\n        /// Attempts to consume the specified number of tokens from the bucket. If the\n        /// requested number of tokens are not immediately available, then this method\n        /// will return false to indicate that zero tokens have been consumed.\n        /// </summary>\n        public bool TryConsume(long tokens)\n        {\n            if (tokens <= 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(tokens),\n                    \"Number of tokens to consume must be positive\"\n                );\n            }\n\n            if (tokens > Capacity)\n            {\n                throw new ArgumentOutOfRangeException(nameof(tokens),\n                    \"Number of tokens to consume must be less than or equal to the capacity\"\n                );\n            }\n\n            lock (_sync)\n            {\n                // determine how many units have become available since last invocation\n                var refilled = Math.Max(0, _refill.Refill());\n\n                // the number of tokens to add, the max of which is the difference between capacity and currently available\n                var deltaTokens = Math.Min(Capacity - _available, refilled);\n\n                // update the available number of units with the new tokens\n                _available += deltaTokens;\n\n                if (tokens > _available)\n                {\n                    // we don't have enough tokens yet\n                    Logging.Log.Trace($\"LeakyBucket.TryConsume({tokens}): Failed to consumed tokens. Available: {_available}\");\n                    return false;\n                }\n\n                // subtract the number of tokens consumed\n                _available = _available - tokens;\n                Logging.Log.Trace($\"LeakyBucket.TryConsume({tokens}): Successfully consumed tokens. Available: {_available}\");\n                return true;\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Common/Util/RateLimit/ThreadSleepStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Threading;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides a CPU non-intensive means of waiting for more tokens to be available in <see cref=\"ITokenBucket\"/>.\n    /// This strategy should be the most commonly used as it either sleeps or yields the currently executing thread,\n    /// allowing for other threads to execute while the current thread is blocked and waiting for new tokens to become\n    /// available in the bucket for consumption.\n    /// </summary>\n    public class ThreadSleepStrategy : ISleepStrategy\n    {\n        /// <summary>\n        /// Gets an instance of <see cref=\"ISleepStrategy\"/> that yields the current thread\n        /// </summary>\n        public static readonly ISleepStrategy Yielding = new ThreadSleepStrategy(0);\n\n        /// <summary>\n        /// Gets an instance of <see cref=\"ISleepStrategy\"/> that sleeps the current thread for\n        /// the specified number of milliseconds\n        /// </summary>\n        /// <param name=\"milliseconds\">The duration of time to sleep, in milliseconds</param>\n        public static ISleepStrategy Sleeping(int milliseconds) => new ThreadSleepStrategy(milliseconds);\n\n        private readonly int _milliseconds;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreadSleepStrategy\"/> using the specified\n        /// number of <paramref name=\"milliseconds\"/> for each <see cref=\"Sleep\"/> invocation.\n        /// </summary>\n        /// <param name=\"milliseconds\">The duration of time to sleep, in milliseconds</param>\n        public ThreadSleepStrategy(int milliseconds)\n        {\n            _milliseconds = milliseconds;\n        }\n\n        /// <summary>\n        /// Sleeps the current thread using the initialized number of milliseconds\n        /// </summary>\n        public void Sleep()\n        {\n            Thread.Sleep(_milliseconds);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/RateLimit/TokenBucket.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\n\nnamespace QuantConnect.Util.RateLimit\n{\n    /// <summary>\n    /// Provides extension methods for interacting with <see cref=\"ITokenBucket\"/> instances as well\n    /// as access to the <see cref=\"NullTokenBucket\"/> via <see cref=\"TokenBucket.Null\"/>\n    /// </summary>\n    public static class TokenBucket\n    {\n        /// <summary>\n        /// Gets an <see cref=\"ITokenBucket\"/> that always permits consumption\n        /// </summary>\n        public static ITokenBucket Null = new NullTokenBucket();\n\n        /// <summary>\n        /// Provides an overload of <see cref=\"ITokenBucket.Consume\"/> that accepts a <see cref=\"TimeSpan\"/> timeout\n        /// </summary>\n        public static void Consume(this ITokenBucket bucket, long tokens, TimeSpan timeout)\n        {\n            bucket.Consume(tokens, (long) timeout.TotalMilliseconds);\n        }\n\n        /// <summary>\n        /// Provides an implementation of <see cref=\"ITokenBucket\"/> that does not enforce rate limiting\n        /// </summary>\n        private class NullTokenBucket : ITokenBucket\n        {\n            public long Capacity => long.MaxValue;\n            public long AvailableTokens => long.MaxValue;\n            public bool TryConsume(long tokens) { return true; }\n            public void Consume(long tokens, long timeout = Timeout.Infinite) { }\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/ReadOnlyExtendedDictionary.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Python;\n\nnamespace Common.Util\n{\n    /// <summary>\n    /// Provides a read-only implementation of ExtendedDictionary\n    /// </summary>\n    [PandasNonExpandable]\n    public class ReadOnlyExtendedDictionary<TKey, TValue> : BaseExtendedDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>\n    {\n        /// <summary>\n        /// Initializes a new instance of the ReadOnlyExtendedDictionary class that is empty\n        /// </summary>\n        public ReadOnlyExtendedDictionary()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ReadOnlyExtendedDictionary class that contains elements copied from the specified dictionary\n        /// </summary>\n        /// <param name=\"dictionary\">The dictionary whose elements are copied to the new dictionary</param>\n        public ReadOnlyExtendedDictionary(IDictionary<TKey, TValue> dictionary) : base(dictionary)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ReadOnlyExtendedDictionary class\n        /// using the specified <paramref name=\"data\"/> as a data source\n        /// </summary>\n        /// <param name=\"data\">The data source for this dictionary</param>\n        /// <param name=\"keySelector\">Delegate used to select a key from the value</param>\n        public ReadOnlyExtendedDictionary(IEnumerable<TValue> data, Func<TValue, TKey> keySelector) : base(data, keySelector)\n        {\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the dictionary is read-only\n        /// </summary>\n        public override bool IsReadOnly => true;\n\n        /// <summary>\n        /// Gets an enumerable collection containing the keys of the read-only dictionary\n        /// </summary>\n        IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys => base.Keys;\n\n        /// <summary>\n        /// Gets an enumerable collection containing the values of the read-only dictionary\n        /// </summary>\n        IEnumerable<TValue> IReadOnlyDictionary<TKey, TValue>.Values => base.Values;\n\n        /// <summary>\n        /// Gets or sets the value associated with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key of the value to get or set</param>\n        /// <returns>The value associated with the specified key</returns>\n        public override TValue this[TKey key]\n        {\n            get => base[key];\n            set => throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n\n        /// <summary>\n        /// Removes all items from the dictionary\n        /// </summary>\n        public override void Clear()\n        {\n            throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n\n        /// <summary>\n        /// Removes the value with the specified key\n        /// </summary>\n        /// <param name=\"key\">The key of the element to remove</param>\n        /// <returns>true if the element was successfully found and removed; otherwise, false</returns>\n        public override bool Remove(TKey key)\n        {\n            throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key and value to the dictionary\n        /// </summary>\n        /// <param name=\"key\">The key of the element to add</param>\n        /// <param name=\"value\">The value of the element to add</param>\n        public new void Add(TKey key, TValue value)\n        {\n            throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n\n        /// <summary>\n        /// Adds an element with the provided key-value pair to the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to add</param>\n        public new void Add(KeyValuePair<TKey, TValue> item)\n        {\n            throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the dictionary\n        /// </summary>\n        /// <param name=\"item\">The key-value pair to remove</param>\n        /// <returns>true if the key-value pair was successfully removed; otherwise, false</returns>\n        public new bool Remove(KeyValuePair<TKey, TValue> item)\n        {\n            throw new InvalidOperationException(\"Dictionary is read-only\");\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/ReaderWriterLockSlimExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides extension methods to make working with the <see cref=\"ReaderWriterLockSlim\"/> class easier\n    /// </summary>\n    public static class ReaderWriterLockSlimExtensions\n    {\n        /// <summary>\n        /// Opens the read lock\n        /// </summary>\n        /// <param name=\"readerWriterLockSlim\">The lock to open for read</param>\n        /// <returns>A disposable reference which will release the lock upon disposal</returns>\n        public static IDisposable Read(this ReaderWriterLockSlim readerWriterLockSlim)\n        {\n            return new ReaderLockToken(readerWriterLockSlim);\n        }\n\n        /// <summary>\n        /// Opens the write lock\n        /// </summary>\n        /// <param name=\"readerWriterLockSlim\">The lock to open for write</param>\n        /// <returns>A disposale reference which will release thelock upon disposal</returns>\n        public static IDisposable Write(this ReaderWriterLockSlim readerWriterLockSlim)\n        {\n            return new WriteLockToken(readerWriterLockSlim);\n        }\n\n        private sealed class ReaderLockToken : ReaderWriterLockSlimToken\n        {\n            public ReaderLockToken(ReaderWriterLockSlim readerWriterLockSlim)\n                : base(readerWriterLockSlim)\n            {\n            }\n\n            protected override void EnterLock(ReaderWriterLockSlim readerWriterLockSlim)\n            {\n                readerWriterLockSlim.EnterReadLock();\n            }\n\n            protected override void ExitLock(ReaderWriterLockSlim readerWriterLockSlim)\n            {\n                readerWriterLockSlim.ExitReadLock();\n            }\n        }\n\n        private sealed class WriteLockToken : ReaderWriterLockSlimToken\n        {\n            public WriteLockToken(ReaderWriterLockSlim readerWriterLockSlim)\n                : base(readerWriterLockSlim)\n            {\n            }\n\n            protected override void EnterLock(ReaderWriterLockSlim readerWriterLockSlim)\n            {\n                readerWriterLockSlim.EnterWriteLock();\n            }\n\n            protected override void ExitLock(ReaderWriterLockSlim readerWriterLockSlim)\n            {\n                readerWriterLockSlim.ExitWriteLock();\n            }\n        }\n\n        private abstract class ReaderWriterLockSlimToken : IDisposable\n        {\n            private ReaderWriterLockSlim _readerWriterLockSlim;\n\n            public ReaderWriterLockSlimToken(ReaderWriterLockSlim readerWriterLockSlim)\n            {\n                _readerWriterLockSlim = readerWriterLockSlim;\n                // ReSharper disable once DoNotCallOverridableMethodsInConstructor -- we control the subclasses, this is fine\n                EnterLock(_readerWriterLockSlim);\n            }\n\n            protected abstract void EnterLock(ReaderWriterLockSlim readerWriterLockSlim);\n            protected abstract void ExitLock(ReaderWriterLockSlim readerWriterLockSlim);\n\n            public void Dispose()\n            {\n                if (_readerWriterLockSlim != null)\n                {\n                    ExitLock(_readerWriterLockSlim);\n                    _readerWriterLockSlim = null;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/Ref.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Represents a read-only reference to any value, T\n    /// </summary>\n    /// <typeparam name=\"T\">The data type the reference points to</typeparam>\n    public interface IReadOnlyRef<out T>\n    {\n        /// <summary>\n        /// Gets the current value this reference points to\n        /// </summary>\n        T Value { get; }\n    }\n\n    /// <summary>\n    /// Represents a reference to any value, T\n    /// </summary>\n    /// <typeparam name=\"T\">The data type the reference points to</typeparam>\n    public sealed class Ref<T> : IReadOnlyRef<T>\n    {\n        private readonly Func<T> _getter;\n        private readonly Action<T> _setter;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Ref{T}\"/> class\n        /// </summary>\n        /// <param name=\"getter\">A function delegate to get the current value</param>\n        /// <param name=\"setter\">A function delegate to set the current value</param>\n        public Ref(Func<T> getter, Action<T> setter)\n        {\n            _getter = getter;\n            _setter = setter;\n        }\n\n        /// <summary>\n        /// Gets or sets the value of this reference\n        /// </summary>\n        public T Value\n        {\n            get { return _getter(); }\n            set { _setter(value); }\n        }\n\n        /// <summary>\n        /// Returns a read-only version of this instance\n        /// </summary>\n        /// <returns>A new instance with read-only semantics/gaurantees</returns>\n        public IReadOnlyRef<T> AsReadOnly()\n        {\n            return new Ref<T>(_getter, value =>\n            {\n                throw new InvalidOperationException(\"This instance is read-only.\");\n            });\n        }\n    }\n\n    /// <summary>\n    /// Provides some helper methods that leverage C# type inference\n    /// </summary>\n    public static class Ref\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"Ref{T}\"/> instance\n        /// </summary>\n        public static Ref<T> Create<T>(Func<T> getter, Action<T> setter)\n        {\n            return new Ref<T>(getter, setter);\n        }\n        /// <summary>\n        /// Creates a new <see cref=\"IReadOnlyRef{T}\"/> instance\n        /// </summary>\n        public static IReadOnlyRef<T> CreateReadOnly<T>(Func<T> getter)\n        {\n            return new Ref<T>(getter, value =>\n            {\n                throw new InvalidOperationException(\"This instance is read-only.\");\n            });\n        }\n        /// <summary>\n        /// Creates a new <see cref=\"Ref{T}\"/> instance by closing over\n        /// the specified <paramref name=\"initialValue\"/> variable.\n        /// NOTE: This won't close over the variable input to the function,\n        /// but rather a copy of the variable. This reference will use it's\n        /// own storage.\n        /// </summary>\n        public static Ref<T> Create<T>(T initialValue)\n        {\n            return new Ref<T>(() => initialValue, value => { initialValue = value; });\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/ReferenceWrapper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// We wrap a T instance, a value type, with a class, a reference type, to achieve thread safety when assigning new values\n    /// and reading from multiple threads. This is possible because assignments are atomic operations in C# for reference types (among others).\n    /// </summary>\n    /// <remarks>This is a simpler, performance oriented version of <see cref=\"Ref\"/></remarks>\n    public class ReferenceWrapper<T> \n        where T : struct\n    {\n        /// <summary>\n        /// The current value\n        /// </summary>\n        public T Value { get; init; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"value\">The value to use</param>\n        public ReferenceWrapper(T value)\n        {\n            Value = value;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/SecurityExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides useful infrastructure methods to the <see cref=\"Security\"/> class.\n    /// These are added in this way to avoid mudding the class's public API\n    /// </summary>\n    public static class SecurityExtensions\n    {\n        /// <summary>\n        /// Determines if all subscriptions for the security are internal feeds\n        /// </summary>\n        public static bool IsInternalFeed(this Security security)\n        {\n            return security.Subscriptions.All(x => x.IsInternalFeed);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/SecurityIdentifierJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// A <see cref=\"JsonConverter\"/> implementation that serializes a <see cref=\"SecurityIdentifier\"/> as a string\n    /// </summary>\n    public class SecurityIdentifierJsonConverter : TypeChangeJsonConverter<SecurityIdentifier, string>\n    {\n        /// <summary>\n        /// Converts as security identifier to a string\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialziation</param>\n        /// <returns>A new instance of TResult that is to be serialzied</returns>\n        protected override string Convert(SecurityIdentifier value)\n        {\n            return value.ToString();\n        }\n\n        /// <summary>\n        /// Converts the input string to a security identifier\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override SecurityIdentifier Convert(string value)\n        {\n            return SecurityIdentifier.Parse(value);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/SeriesJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Drawing;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Json Converter for Series which handles special Pie Series serialization case\n    /// </summary>\n    public class SeriesJsonConverter : JsonConverter\n    {\n        private ColorJsonConverter _colorJsonConverter = new ();\n\n        /// <summary>\n        /// Write Series to Json\n        /// </summary>\n        /// <param name=\"writer\">The Json Writer to use</param>\n        /// <param name=\"value\">The value to written to Json</param>\n        /// <param name=\"serializer\">The Json Serializer to use</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            var baseSeries = value as BaseSeries;\n            if (baseSeries == null)\n            {\n                return;\n            }\n\n            writer.WriteStartObject();\n\n            writer.WritePropertyName(\"name\");\n            writer.WriteValue(baseSeries.Name);\n            writer.WritePropertyName(\"unit\");\n            writer.WriteValue(baseSeries.Unit);\n            writer.WritePropertyName(\"index\");\n            writer.WriteValue(baseSeries.Index);\n            writer.WritePropertyName(\"seriesType\");\n            writer.WriteValue(baseSeries.SeriesType);\n\n            if (baseSeries.ZIndex.HasValue)\n            {\n                writer.WritePropertyName(\"zIndex\");\n                writer.WriteValue(baseSeries.ZIndex.Value);\n            }\n\n            if (baseSeries.IndexName != null)\n            {\n                writer.WritePropertyName(\"indexName\");\n                writer.WriteValue(baseSeries.IndexName);\n            }\n\n            if (baseSeries.Tooltip != null)\n            {\n                writer.WritePropertyName(\"tooltip\");\n                writer.WriteValue(baseSeries.Tooltip);\n            }\n\n            switch (value)\n            {\n                case Series series:\n                    var values = series.Values;\n                    if (series.SeriesType == SeriesType.Pie)\n                    {\n                        values = new List<ISeriesPoint>();\n                        var dataPoint = series.ConsolidateChartPoints();\n                        if (dataPoint != null)\n                        {\n                            values.Add(dataPoint);\n                        }\n                    }\n\n                    // have to add the converter we want to use, else will use default\n                    serializer.Converters.Add(_colorJsonConverter);\n\n                    writer.WritePropertyName(\"values\");\n                    serializer.Serialize(writer, values);\n                    writer.WritePropertyName(\"color\");\n                    serializer.Serialize(writer, series.Color);\n                    writer.WritePropertyName(\"scatterMarkerSymbol\");\n                    serializer.Serialize(writer, series.ScatterMarkerSymbol);\n                    break;\n\n                default:\n                    writer.WritePropertyName(\"values\");\n                    serializer.Serialize(writer, baseSeries.Values);\n                    break;\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads series from Json\n        /// </summary>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n\n            var name = (jObject[\"Name\"] ?? jObject[\"name\"]).Value<string>();\n            var unit = (jObject[\"Unit\"] ?? jObject[\"unit\"]).Value<string>();\n            var index = (jObject[\"Index\"] ?? jObject[\"index\"]).Value<int>();\n            var seriesType = (SeriesType)(jObject[\"SeriesType\"] ?? jObject[\"seriesType\"]).Value<int>();\n            var values = (JArray)(jObject[\"Values\"] ?? jObject[\"values\"]);\n\n            var zindex = jObject.TryGetPropertyValue<int?>(\"ZIndex\") ?? jObject.TryGetPropertyValue<int?>(\"zIndex\");\n            var indexName = jObject.TryGetPropertyValue<string>(\"IndexName\") ?? jObject.TryGetPropertyValue<string>(\"indexName\");\n            var tooltip = jObject.TryGetPropertyValue<string>(\"Tooltip\") ?? jObject.TryGetPropertyValue<string>(\"tooltip\");\n\n            if (seriesType == SeriesType.Candle)\n            {\n                return new CandlestickSeries()\n                {\n                    Name = name,\n                    Unit = unit,\n                    Index = index,\n                    ZIndex = zindex,\n                    Tooltip = tooltip,\n                    IndexName = indexName,\n                    SeriesType = seriesType,\n                    Values = values.ToObject<List<Candlestick>>(serializer).Where(x => x != null).Cast<ISeriesPoint>().ToList()\n                };\n            }\n\n            var result = new Series()\n            {\n                Name = name,\n                Unit = unit,\n                Index = index,\n                ZIndex = zindex,\n                Tooltip = tooltip,\n                IndexName = indexName,\n                SeriesType = seriesType,\n                Color = (jObject[\"Color\"] ?? jObject[\"color\"])?.ToObject<Color>(serializer) ?? Color.Empty,\n                ScatterMarkerSymbol = (jObject[\"ScatterMarkerSymbol\"] ?? jObject[\"scatterMarkerSymbol\"])?.ToObject<ScatterMarkerSymbol>(serializer) ?? ScatterMarkerSymbol.None\n            };\n\n            if (seriesType == SeriesType.Scatter)\n            {\n                result.Values = values.ToObject<List<ScatterChartPoint>>(serializer).Where(x => x != null).Cast<ISeriesPoint>().ToList();\n            }\n            else\n            {\n                result.Values = values.ToObject<List<ChartPoint>>(serializer).Where(x => x != null).Cast<ISeriesPoint>().ToList();\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Determine if this Converter can convert this type\n        /// </summary>\n        /// <param name=\"objectType\">Type that we would like to convert</param>\n        /// <returns>True if <see cref=\"Series\"/></returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(BaseSeries).IsAssignableFrom(objectType);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/SingleValueListConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Reads json and always produces a List, even if the input has just an object\n    /// </summary>\n    public class SingleValueListConverter<T> : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object. If the instance is not a list then it will\n        /// be wrapped in a list\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            if (value is T)\n            {\n                value = new List<T> {(T)value};\n            }\n            serializer.Serialize(writer, value);\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object. If the JSON represents a singular instance, it will be returned\n        /// in a list.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            switch (reader.TokenType)\n            {\n                case JsonToken.String:\n                case JsonToken.StartObject:\n                    return new List<T> {serializer.Deserialize<T>(reader)};\n                case JsonToken.StartArray:\n                    return serializer.Deserialize<List<T>>(reader);\n                default:\n                    throw new ArgumentException(\"The JsonReader is expected to point at a JsonToken.StartObject or JsonToken.StartArray.\");\n            }\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns><c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.</returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(T) || objectType == typeof(List<T>);\n        }\n    }\n}"
  },
  {
    "path": "Common/Util/StreamReaderEnumerable.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Converts a <see cref=\"StreamReader\"/> into an enumerable of string\n    /// </summary>\n    public class StreamReaderEnumerable : IEnumerable<string>, IDisposable\n    {\n        private int _disposed;\n        private int _createdEnumerator;\n        private readonly StreamReader _reader;\n        private readonly IDisposable[] _disposables;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StreamReaderEnumerable\"/> class\n        /// </summary>\n        /// <param name=\"stream\">The stream to be read</param>\n        /// <param name=\"disposables\">Allows specifying other resources that should be disposed when this instance is disposed</param>\n        public StreamReaderEnumerable(Stream stream, params IDisposable[] disposables)\n        {\n            _disposables = disposables;\n\n            // this StreamReader constructor gives ownership of the stream to the StreamReader\n            // which is mediated by the LeaveOpen property, so when _reader is disposed, stream\n            // will also be disposed\n            _reader = new StreamReader(stream);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StreamReaderEnumerable\"/> class\n        /// </summary>\n        /// <param name=\"reader\">The stream reader instance to convert to an enumerable of string</param>\n        /// <param name=\"disposables\">Allows specifying other resources that should be disposed when this instance is disposed</param>\n        public StreamReaderEnumerable(StreamReader reader, params IDisposable[] disposables)\n        {\n            _reader = reader;\n            _disposables = disposables;\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<string> GetEnumerator()\n        {\n            // can't share the underlying stream instance -- barf\n            if (Interlocked.CompareExchange(ref _createdEnumerator, 1, 0) == 1)\n            {\n                throw new InvalidOperationException(\"A StreamReaderEnumerable may only be enumerated once. Consider using memoization or materialization.\");\n            }\n\n            return new Enumerator(this);\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            if (Interlocked.CompareExchange(ref _disposed, 1, 0) == 1)\n            {\n                return;\n            }\n\n            _reader.DisposeSafely();\n            if (_disposables != null)\n            {\n                foreach (var disposable in _disposables)\n                {\n                    disposable.DisposeSafely();\n                }\n            }\n        }\n\n        /// <summary>Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.</summary>\n        ~StreamReaderEnumerable()\n        {\n            // be sure to clean up unmanaged resources via finalizer if\n            // dispose wasn't explicitly called by consuming code\n            Dispose();\n        }\n\n        private class Enumerator : IEnumerator<string>\n        {\n            private readonly StreamReaderEnumerable _enumerable;\n\n            public string Current { get; private set; }\n\n            object IEnumerator.Current => Current;\n\n            public Enumerator(StreamReaderEnumerable enumerable)\n            {\n                _enumerable = enumerable;\n            }\n\n            public bool MoveNext()\n            {\n                var line = _enumerable._reader.ReadLine();\n                if (line == null)\n                {\n                    return false;\n                }\n\n                Current = line;\n                return true;\n            }\n\n            public void Reset()\n            {\n                if (!_enumerable._reader.BaseStream.CanSeek)\n                {\n                    throw new InvalidOperationException(\"The underlying stream is unseekable\");\n                }\n\n                _enumerable._reader.BaseStream.Seek(0, SeekOrigin.Begin);\n            }\n\n            public void Dispose()\n            {\n                _enumerable.Dispose();\n            }\n\n            ~Enumerator()\n            {\n                _enumerable.Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/StreamReaderExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing System.Globalization;\nusing System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Extension methods to fetch data from a <see cref=\"StreamReader\"/> instance\n    /// </summary>\n    /// <remarks>The value of these methods is performance. The objective is to avoid  using\n    /// <see cref=\"StreamReader.ReadLine\"/> and having to create intermediate substrings, parsing and splitting</remarks>\n    public static class StreamReaderExtensions\n    {\n        // we use '-1' value as a flag to determine whether we have decimal places or not, so we avoid having another variable required\n        private const int NoDecimalPlaces = -1;\n        private const char NoMoreData = unchecked((char)-1);\n        private const char DefaultDelimiter = ',';\n\n        /// <summary>\n        /// Gets a decimal from the provided stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The decimal read from the stream</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal GetDecimal(this StreamReader stream, char delimiter = DefaultDelimiter)\n        {\n            return GetDecimal(stream, out _, delimiter);\n        }\n\n        /// <summary>\n        /// Gets a decimal from the provided stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <param name=\"pastEndLine\">True if end line was past, useful for consumers to know a line ended</param>\n        /// <returns>The decimal read from the stream</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static decimal GetDecimal(this StreamReader stream, out bool pastEndLine, char delimiter = DefaultDelimiter)\n        {\n            long value = 0;\n            var decimalPlaces = NoDecimalPlaces;\n            var current = (char)stream.Read();\n\n            while (current == ' ')\n            {\n                current = (char)stream.Read();\n            }\n\n            var isNegative = current == '-';\n            if (isNegative)\n            {\n                current = (char)stream.Read();\n            }\n\n            pastEndLine = current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData;\n            while (!(current == delimiter || pastEndLine || current == ' '))\n            {\n                if (current == '.')\n                {\n                    decimalPlaces = 0;\n                }\n                else\n                {\n                    value = value * 10 + (current - '0');\n                    if (decimalPlaces != NoDecimalPlaces)\n                    {\n                        decimalPlaces++;\n                    }\n                }\n                current = (char)stream.Read();\n                pastEndLine = current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData;\n            }\n\n            var lo = (int)value;\n            var mid = (int)(value >> 32);\n            return new decimal(lo, mid, 0, isNegative, (byte)(decimalPlaces != NoDecimalPlaces ? decimalPlaces : 0));\n        }\n\n        /// <summary>\n        /// Gets a date time instance from a stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"format\">The format in which the date time is</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The date time instance read</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static DateTime GetDateTime(this StreamReader stream, string format = DateFormat.TwelveCharacter, char delimiter = DefaultDelimiter)\n        {\n            var current = (char)stream.Read();\n            while (current == ' ')\n            {\n                current = (char)stream.Read();\n            }\n\n            var index = 0;\n            // we know the exact format we want to parse so we can allocate the char array and not use an expensive string builder\n            var data = new char[format.Length];\n            while (!(current == delimiter || current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData))\n            {\n                data[index++] = current;\n                current = (char)stream.Read();\n            }\n\n            return DateTime.ParseExact(data,\n                format,\n                CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Gets an integer from a stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The integer instance read</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static int GetInt32(this StreamReader stream, char delimiter = DefaultDelimiter)\n        {\n            var result = 0;\n            var current = (char)stream.Read();\n\n            while (current == ' ')\n            {\n                current = (char)stream.Read();\n            }\n\n            var isNegative = current == '-';\n            if (isNegative)\n            {\n                current = (char)stream.Read();\n            }\n\n            while (!(current == delimiter || current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData || current == ' '))\n            {\n                result = (current - '0') + result * 10;\n                current = (char)stream.Read();\n            }\n            return isNegative ? result * -1 : result;\n        }\n\n        /// <summary>\n        /// Gets an integer from a stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The integer instance read</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static long GetInt64(this StreamReader stream, char delimiter = DefaultDelimiter)\n        {\n            var result = 0L;\n            var current = (char)stream.Read();\n\n            while (current == ' ')\n            {\n                current = (char)stream.Read();\n            }\n\n            var isNegative = current == '-';\n            if (isNegative)\n            {\n                current = (char)stream.Read();\n            }\n\n            while (!(current == delimiter || current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData || current == ' '))\n            {\n                result = (current - '0') + result * 10L;\n                current = (char)stream.Read();\n            }\n            return isNegative ? result * -1L : result;\n        }\n\n        private readonly static ConcurrentBag<StringBuilder> StringBuilders = new();\n\n        /// <summary>\n        /// Gets a string from a stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The string instance read</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string GetString(this StreamReader stream, char delimiter = DefaultDelimiter)\n        {\n            if (!StringBuilders.TryTake(out var builder))\n            {\n                builder = new();\n            }\n\n            try\n            {\n                var current = (char)stream.Read();\n\n                while (!(current == delimiter || current == '\\n' || current == '\\r' && (stream.Peek() != '\\n' || stream.Read() == '\\n') || current == NoMoreData))\n                {\n                    builder.Append(current);\n                    current = (char)stream.Read();\n                }\n                return builder.ToString();\n            }\n            finally\n            {\n                builder.Clear();\n                StringBuilders.Add(builder);\n            }\n        }\n\n        /// <summary>\n        /// Gets a character from a stream reader\n        /// </summary>\n        /// <param name=\"stream\">The data stream</param>\n        /// <param name=\"delimiter\">The data delimiter character to use, default is ','</param>\n        /// <returns>The string instance read</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static char GetChar(this StreamReader stream, char delimiter = DefaultDelimiter)\n        {\n            var current = (char)stream.Read();\n            var next = (char)stream.Peek();\n\n            if (current == delimiter || current == '\\n' || current == '\\r' && (next != '\\n' || stream.Read() == '\\n') || current == NoMoreData)\n            {\n                return '\\0';\n            }\n\n            if (next == delimiter || next == '\\n' || next == '\\r' && stream.Read() == '\\r' && stream.Peek() == '\\n' || next == NoMoreData)\n            {\n                // Consume the delimiter\n                stream.Read();\n            }\n\n            return current;\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/StringDecimalJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Allows for conversion of string numeric values from JSON to the <see cref=\"decimal\"/> type\n    /// </summary>\n    public class StringDecimalJsonConverter : TypeChangeJsonConverter<decimal, string>\n    {\n        private readonly bool _defaultOnFailure;\n\n        /// <summary>\n        /// Creates an instance of the class, with an optional flag to default to decimal's default value on failure.\n        /// </summary>\n        /// <param name=\"defaultOnFailure\">Default to decimal's default value on failure</param>\n        public StringDecimalJsonConverter(bool defaultOnFailure = false)\n        {\n            _defaultOnFailure = defaultOnFailure;\n        }\n\n        /// <summary>\n        /// Converts a decimal to a string\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialization</param>\n        /// <returns>String representation of the decimal</returns>\n        protected override string Convert(decimal value)\n        {\n            return value.ToStringInvariant();\n        }\n\n        /// <summary>\n        /// Converts the input string to a decimal\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected override decimal Convert(string value)\n        {\n            try\n            {\n                return decimal.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture);\n            }\n            catch (Exception)\n            {\n                if (_defaultOnFailure)\n                {\n                    return default(decimal);\n                }\n\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/TypeChangeJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides a base class for a <see cref=\"JsonConverter\"/> that serializes a\n    /// an input type as some other output type\n    /// </summary>\n    /// <typeparam name=\"T\">The type to be serialized</typeparam>\n    /// <typeparam name=\"TResult\">The output serialized type</typeparam>\n    public abstract class TypeChangeJsonConverter<T, TResult> : JsonConverter\n    {\n        // we use a json serializer which allows using non public default constructor\n        private readonly JsonSerializer _jsonSerializer = new JsonSerializer {ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor};\n\n        /// <summary>\n        /// True will populate TResult object returned by <see cref=\"Convert(TResult)\"/> with json properties\n        /// </summary>\n        protected virtual bool PopulateProperties => true;\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"T:Newtonsoft.Json.JsonReader\"/> to read from.</param><param name=\"objectType\">Type of the object.</param><param name=\"existingValue\">The existing value of object being read.</param><param name=\"serializer\">The calling serializer.</param>\n        /// <returns>\n        /// The object value.\n        /// </returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            // Load token from stream\n            var token = JToken.Load(reader);\n\n            // Create target object based on token\n            var target = Create(objectType, token);\n\n            return target;\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"T:Newtonsoft.Json.JsonWriter\"/> to write to.</param><param name=\"value\">The value.</param><param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            // Convert the value into TResult to be serialized\n            var valueToSerialize = Convert((T)value);\n\n            serializer.Serialize(writer, valueToSerialize);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(T) == objectType;\n        }\n\n        /// <summary>\n        /// Creates an instance of the un-projected type to be deserialized\n        /// </summary>\n        /// <param name=\"type\">The input object type, this is the data held in the token</param>\n        /// <param name=\"token\">The input data to be converted into a T</param>\n        /// <returns>A new instance of T that is to be serialized using default rules</returns>\n        protected virtual T Create(Type type, JToken token)\n        {\n            // reads the token as an object type\n            if (typeof(TResult).IsClass && typeof(T) != typeof(string))\n            {\n                return Convert(token.ToObject<TResult>(_jsonSerializer));\n            }\n\n            // reads the token as a value type\n            return Convert(token.Value<TResult>());\n        }\n\n        /// <summary>\n        /// Convert the input value to a value to be serialized\n        /// </summary>\n        /// <param name=\"value\">The input value to be converted before serialziation</param>\n        /// <returns>A new instance of TResult that is to be serialzied</returns>\n        protected abstract TResult Convert(T value);\n\n        /// <summary>\n        /// Converts the input value to be deserialized\n        /// </summary>\n        /// <param name=\"value\">The deserialized value that needs to be converted to T</param>\n        /// <returns>The converted value</returns>\n        protected abstract T Convert(TResult value);\n    }\n}\n"
  },
  {
    "path": "Common/Util/Validate.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides methods for validating strings following a certain format, such as an email address\n    /// </summary>\n    public static class Validate\n    {\n        /// <summary>\n        /// Validates the provided email address\n        /// </summary>\n        /// <remarks>\n        /// Implementation taken from msdn (with slight refactoring for readability and C#6 compliance):\n        /// https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format\n        /// </remarks>\n        /// <param name=\"emailAddress\">The email address to be validated</param>\n        /// <returns>True if the provided email address is valid</returns>\n        public static bool EmailAddress(string emailAddress)\n        {\n            if (emailAddress == null)\n            {\n                return true;\n            }\n\n            if (string.IsNullOrWhiteSpace(emailAddress))\n            {\n                return false;\n            }\n\n            emailAddress = NormalizeEmailAddressDomainName(emailAddress);\n            if (emailAddress == null)\n            {\n                // an error occurred during domain name normalization\n                return false;\n            }\n\n            try\n            {\n                return RegularExpression.Email.IsMatch(emailAddress);\n            }\n            catch\n            {\n                return false;\n            }\n        }\n\n        private static string NormalizeEmailAddressDomainName(string emailAddress)\n        {\n            try\n            {\n                // Normalize the domain\n                emailAddress = RegularExpression.EmailDomainName.Replace(emailAddress, match =>\n                {\n                    // Use IdnMapping class to convert Unicode domain names.\n                    var idn = new IdnMapping();\n\n                    // Pull out and process domain name (throws ArgumentException on invalid)\n                    var domainName = idn.GetAscii(match.Groups[2].Value);\n\n                    return match.Groups[1].Value + domainName;\n                });\n            }\n            catch\n            {\n                return null;\n            }\n\n            return emailAddress;\n        }\n\n        /// <summary>\n        /// Provides static storage of compiled regular expressions to preclude parsing on each invocation\n        /// </summary>\n        public static class RegularExpression\n        {\n            private static readonly TimeSpan MatchTimeout = TimeSpan.FromMilliseconds(100);\n\n            /// <summary>\n            /// Matches the domain name in an email address ignored@[domain.com]\n            /// Pattern sourced via msdn:\n            /// https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format\n            /// </summary>\n            public static readonly Regex EmailDomainName = new Regex(@\"(@)(.+)$\", RegexOptions.Compiled, MatchTimeout);\n\n            /// <summary>\n            /// Matches a valid email address address@sub.domain.com\n            /// Pattern sourced via msdn:\n            /// https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format\n            /// </summary>\n            public static readonly Regex Email = new Regex(@\"^(?(\"\")(\"\".+?(?<!\\\\)\"\"@)|(([0-9a-z]((\\.(?!\\.))|[-!#\\$%&'\\*\\+/=\\?\\^`\\{\\}\\|~\\w])*)(?<=[0-9a-z])@))(?(\\[)(\\[(\\d{1,3}\\.){3}\\d{1,3}\\])|(([0-9a-z][-0-9a-z]*[0-9a-z]*\\.)+[a-z0-9][\\-a-z0-9]{0,22}[a-z0-9]))$\", RegexOptions.IgnoreCase | RegexOptions.Compiled, MatchTimeout);\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/WorkerThread.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Threading;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// This worker tread is required to guarantee all python operations are\n    /// executed by the same thread, to enable complete debugging functionality.\n    /// We don't use the main thread, to avoid any chance of blocking the process\n    /// </summary>\n    public class WorkerThread : IDisposable\n    {\n        private readonly BlockingCollection<Action> _blockingCollection;\n        private readonly CancellationTokenSource _threadCancellationTokenSource;\n        private readonly Thread _workerThread;\n\n        /// <summary>\n        /// The worker thread instance\n        /// </summary>\n        public static WorkerThread Instance = new WorkerThread();\n\n        /// <summary>\n        /// Will be set when the worker thread finishes a work item\n        /// </summary>\n        public AutoResetEvent FinishedWorkItem { get; }\n\n        /// <summary>\n        /// Creates a new instance, which internally launches a new worker thread\n        /// </summary>\n        /// <remarks><see cref=\"Dispose\"/></remarks>\n        protected WorkerThread()\n        {\n            _threadCancellationTokenSource = new CancellationTokenSource();\n            FinishedWorkItem = new AutoResetEvent(false);\n            _blockingCollection = new BlockingCollection<Action>();\n            _workerThread = new Thread(() =>\n            {\n                try\n                {\n                    foreach (var action in _blockingCollection.GetConsumingEnumerable(_threadCancellationTokenSource.Token))\n                    {\n                        FinishedWorkItem.Reset();\n                        try\n                        {\n                            action();\n                        }\n                        catch (Exception exception)\n                        {\n                            Log.Error(exception, \"WorkerThread(): exception thrown when running task\");\n                        }\n                        FinishedWorkItem.Set();\n                    }\n                }\n                catch (OperationCanceledException)\n                {\n                    // pass, when the token gets cancelled\n                }\n            })\n            {\n                IsBackground = true,\n                Name = \"Isolator Thread\",\n                Priority = ThreadPriority.Highest\n            };\n            _workerThread.Start();\n        }\n\n        /// <summary>\n        /// Adds a new item of work\n        /// </summary>\n        /// <param name=\"action\">The work item to add</param>\n        public void Add(Action action)\n        {\n            _blockingCollection.Add(action);\n        }\n\n        /// <summary>\n        /// Disposes the worker thread.\n        /// </summary>\n        /// <remarks>Note that the worker thread is a background thread,\n        /// so it won't block the process from terminating even if not disposed</remarks>\n        public virtual void Dispose()\n        {\n            try\n            {\n                _blockingCollection.CompleteAdding();\n                _workerThread.StopSafely(TimeSpan.FromMilliseconds(50), _threadCancellationTokenSource);\n                _threadCancellationTokenSource.DisposeSafely();\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Common/Util/XElementExtensions.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Xml.Linq;\n\nnamespace QuantConnect.Util\n{\n    /// <summary>\n    /// Provides extension methods for the XML to LINQ types\n    /// </summary>\n    public static class XElementExtensions\n    {\n        /// <summary>\n        /// Gets the value from the element and converts it to the specified type.\n        /// </summary>\n        /// <typeparam name=\"T\">The output type</typeparam>\n        /// <param name=\"element\">The element to access</param>\n        /// <param name=\"name\">The attribute name to access on the element</param>\n        /// <returns>The converted value</returns>\n        public static T Get<T>(this XElement element, string name) \n            where T : IConvertible\n        {\n            var xAttribute = element.Descendants(name).Single();\n            string value = xAttribute.Value;\n            return value.ConvertTo<T>();\n        }\n    }\n}\n"
  },
  {
    "path": "Compression/Compression.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ICSharpCode.SharpZipLib.Core;\nusing ICSharpCode.SharpZipLib.GZip;\nusing ICSharpCode.SharpZipLib.Tar;\nusing QuantConnect.Logging;\nusing ZipEntry = ICSharpCode.SharpZipLib.Zip.ZipEntry;\nusing ZipFile = Ionic.Zip.ZipFile;\nusing ZipInputStream = ICSharpCode.SharpZipLib.Zip.ZipInputStream;\nusing ZipOutputStream = ICSharpCode.SharpZipLib.Zip.ZipOutputStream;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Compression class manages the opening and extraction of compressed files (zip, tar, tar.gz).\n    /// </summary>\n    /// <remarks>QuantConnect's data library is stored in zip format locally on the hard drive.</remarks>\n    public static class Compression\n    {\n        /// <summary>\n        /// Global Flag :: Operating System\n        /// </summary>\n        private static bool IsLinux\n        {\n            get\n            {\n                var p = (int)Environment.OSVersion.Platform;\n                return (p == 4) || (p == 6) || (p == 128);\n            }\n        }\n\n        /// <summary>\n        /// Create a zip file of the supplied file names and string data source\n        /// </summary>\n        /// <param name=\"zipPath\">Output location to save the file.</param>\n        /// <param name=\"filenamesAndData\">File names and data in a dictionary format.</param>\n        /// <returns>True on successfully creating the zip file.</returns>\n        public static bool ZipData(string zipPath, Dictionary<string, string> filenamesAndData)\n        {\n            try\n            {\n                //Create our output\n                using (var stream = new ZipOutputStream(File.Create(zipPath)))\n                {\n                    stream.SetLevel(0);\n                    foreach (var kvp in filenamesAndData)\n                    {\n                        var filename = kvp.Key;\n                        //Create the space in the zip file:\n                        var entry = new ZipEntry(filename);\n                        var bytes = Encoding.Default.GetBytes(kvp.Value);\n                        stream.PutNextEntry(entry);\n                        stream.Write(bytes, 0, bytes.Length);\n                        stream.CloseEntry();\n                    } // End For Each File.\n\n                    //Close stream:\n                    stream.Finish();\n                    stream.Close();\n                } // End Using\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Create a zip file of the supplied file names and data using a byte array\n        /// </summary>\n        /// <param name=\"zipPath\">Output location to save the file.</param>\n        /// <param name=\"filenamesAndData\">File names and data in a dictionary format.</param>\n        /// <returns>True on successfully saving the file</returns>\n        public static bool ZipData(string zipPath, IEnumerable<KeyValuePair<string, byte[]>> filenamesAndData)\n        {\n            var success = true;\n            var buffer = new byte[4096];\n\n            try\n            {\n                //Create our output\n                using (var stream = new ZipOutputStream(File.Create(zipPath)))\n                {\n                    foreach (var file in filenamesAndData)\n                    {\n                        //Create the space in the zip file:\n                        var entry = new ZipEntry(file.Key);\n                        //Get a Byte[] of the file data:\n                        stream.PutNextEntry(entry);\n\n                        using (var ms = new MemoryStream(file.Value))\n                        {\n                            int sourceBytes;\n                            do\n                            {\n                                sourceBytes = ms.Read(buffer, 0, buffer.Length);\n                                stream.Write(buffer, 0, sourceBytes);\n                            }\n                            while (sourceBytes > 0);\n                        }\n                    } // End For Each File.\n\n                    //Close stream:\n                    stream.Finish();\n                    stream.Close();\n                } // End Using\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                success = false;\n            }\n            return success;\n        }\n\n        /// <summary>\n        /// Zips the specified lines of text into the zipPath\n        /// </summary>\n        /// <param name=\"zipPath\">The destination zip file path</param>\n        /// <param name=\"zipEntry\">The entry name in the zip</param>\n        /// <param name=\"lines\">The lines to be written to the zip</param>\n        /// <returns>True if successful, otherwise false</returns>\n        public static bool ZipData(string zipPath, string zipEntry, IEnumerable<string> lines)\n        {\n            try\n            {\n                using (var stream = new ZipOutputStream(File.Create(zipPath)))\n                using (var writer = new StreamWriter(stream))\n                {\n                    var entry = new ZipEntry(zipEntry);\n                    stream.PutNextEntry(entry);\n                    foreach (var line in lines)\n                    {\n                        writer.WriteLine(line);\n                    }\n                }\n                return true;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Append the zip data to the file-entry specified.\n        /// </summary>\n        /// <param name=\"path\">The zip file path</param>\n        /// <param name=\"entry\">The entry name</param>\n        /// <param name=\"data\">The entry data</param>\n        /// <param name=\"overrideEntry\">True if should override entry if it already exists</param>\n        /// <returns>True on success</returns>\n        public static bool ZipCreateAppendData(string path, string entry, string data, bool overrideEntry = false)\n        {\n            return ZipCreateAppendData(path, entry, Encoding.UTF8.GetBytes(data), overrideEntry);\n        }\n\n        /// <summary>\n        /// Append the zip data to the file-entry specified.\n        /// </summary>\n        /// <param name=\"path\">The zip file path</param>\n        /// <param name=\"entry\">The entry name</param>\n        /// <param name=\"data\">The entry data</param>\n        /// <param name=\"overrideEntry\">True if should override entry if it already exists</param>\n        /// <returns>True on success</returns>\n        public static bool ZipCreateAppendData(string path, string entry, byte[] data, bool overrideEntry = false)\n        {\n            return ZipCreateAppendData(path, entry, s => s.Write(data, 0, data.Length), overrideEntry);\n        }\n\n        /// <summary>\n        /// Append the zip data to the file-entry specified.\n        /// </summary>\n        /// <param name=\"path\">The zip file path</param>\n        /// <param name=\"entry\">The entry name</param>\n        /// <param name=\"write\">Write data callback</param>\n        /// <param name=\"overrideEntry\">True if should override entry if it already exists</param>\n        /// <returns>True on success</returns>\n        private static bool ZipCreateAppendData(string path, string entry, Action<Stream> write, bool overrideEntry = false)\n        {\n            try\n            {\n                using var fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);\n                using var archive = new ZipArchive(fs, ZipArchiveMode.Update, leaveOpen: false);\n\n                var existing = archive.GetEntry(entry);\n                if (existing != null)\n                {\n                    if (!overrideEntry)\n                    {\n                        return false;\n                    }\n                    existing.Delete();\n                }\n\n                var zipEntry = archive.CreateEntry(entry, CompressionLevel.Optimal);\n\n                using var entryStream = zipEntry.Open();\n                write(entryStream);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, $\"file: {path} entry: {entry}\");\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Uncompress zip data byte array into a dictionary string array of filename-contents.\n        /// </summary>\n        /// <param name=\"zipData\">Byte data array of zip compressed information</param>\n        /// <param name=\"encoding\">Specifies the encoding used to read the bytes. If not specified, defaults to ASCII</param>\n        /// <returns>Uncompressed dictionary string-sting of files in the zip</returns>\n        public static Dictionary<string, string> UnzipData(byte[] zipData, Encoding encoding = null)\n        {\n            using var stream = new MemoryStream(zipData);\n            return UnzipDataAsync(stream, encoding).ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Uncompress zip data byte array into a dictionary string array of filename-contents.\n        /// </summary>\n        /// <param name=\"stream\">Stream data of zip compressed information</param>\n        /// <param name=\"encoding\">Specifies the encoding used to read the bytes. If not specified, defaults to ASCII</param>\n        /// <returns>Uncompressed dictionary string-sting of files in the zip</returns>\n        public static async Task<Dictionary<string, string>> UnzipDataAsync(Stream stream, Encoding encoding = null)\n        {\n            // Initialize:\n            var data = new Dictionary<string, string>();\n\n            try\n            {\n                //Read out the zipped data into a string, save in array:\n                using (var zipStream = new ZipInputStream(stream))\n                {\n                    while (true)\n                    {\n                        //Get the next file\n                        var entry = zipStream.GetNextEntry();\n\n                        if (entry != null)\n                        {\n                            // Read the file into buffer:\n                            var buffer = new byte[entry.Size];\n                            await zipStream.ReadAsync(buffer, 0, (int)entry.Size).ConfigureAwait(false);\n\n                            //Save into array:\n                            var str = (encoding ?? Encoding.ASCII).GetString(buffer);\n                            data[entry.Name] = str;\n                        }\n                        else\n                        {\n                            break;\n                        }\n                    }\n                } // End Zip Stream.\n\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return data;\n        }\n\n        /// <summary>\n        /// Performs an in memory zip of the specified bytes\n        /// </summary>\n        /// <param name=\"bytes\">The file contents in bytes to be zipped</param>\n        /// <param name=\"zipEntryName\">The zip entry name</param>\n        /// <returns>The zipped file as a byte array</returns>\n        public static byte[] ZipBytes(byte[] bytes, string zipEntryName)\n        {\n            using var memoryStream = new MemoryStream();\n            ZipBytesAsync(memoryStream, bytes, zipEntryName, null).ConfigureAwait(false).GetAwaiter().GetResult();\n            return memoryStream.ToArray();\n        }\n\n        /// <summary>\n        /// Performs an in memory zip of the specified bytes in the target stream\n        /// </summary>\n        /// <param name=\"target\">The target stream</param>\n        /// <param name=\"data\">The file contents in bytes to be zipped</param>\n        /// <param name=\"zipEntryName\">The zip entry name</param>\n        /// <param name=\"mode\">The archive mode</param>\n        /// <param name=\"compressionLevel\">The desired compression level</param>\n        /// <returns>The zipped file as a byte array</returns>\n        public static async Task ZipBytesAsync(Stream target, byte[] data, string zipEntryName, ZipArchiveMode? mode = null,\n            CompressionLevel? compressionLevel = null)\n        {\n            await ZipBytesAsync(target, [new KeyValuePair<byte[], string>(data, zipEntryName)], mode, compressionLevel).ConfigureAwait(false);\n        }\n\n        /// <summary>\n        /// Performs an in memory zip of the specified bytes in the target stream\n        /// </summary>\n        /// <param name=\"target\">The target stream</param>\n        /// <param name=\"data\">The file contents in bytes to be zipped</param>\n        /// <param name=\"mode\">The archive mode</param>\n        /// <param name=\"compressionLevel\">The desired compression level</param>\n        /// <returns>The zipped file as a byte array</returns>\n        public static async Task ZipBytesAsync(Stream target, IEnumerable<KeyValuePair<byte[], string>> data, ZipArchiveMode? mode = null,\n            CompressionLevel? compressionLevel = null)\n        {\n            compressionLevel ??= CompressionLevel.SmallestSize;\n            using var archive = new ZipArchive(target, mode ?? ZipArchiveMode.Create, true);\n            foreach (var kvp in data)\n            {\n                var entry = archive.CreateEntry(kvp.Value, compressionLevel.Value);\n                using var entryStream = entry.Open();\n                await entryStream.WriteAsync(kvp.Key).ConfigureAwait(false);\n            }\n        }\n\n        /// <summary>\n        /// Performs an in memory zip of the specified stream in the target stream\n        /// </summary>\n        /// <param name=\"target\">The target stream</param>\n        /// <param name=\"data\">The file contents in bytes to be zipped</param>\n        /// <param name=\"mode\">The archive mode</param>\n        /// <param name=\"compressionLevel\">The desired compression level</param>\n        /// <returns>The zipped file as a byte array</returns>\n        public static async Task ZipStreamsAsync(string target, IEnumerable<KeyValuePair<string, Stream>> data, ZipArchiveMode? mode = null,\n            CompressionLevel? compressionLevel = null)\n        {\n            using var fileStream = mode == ZipArchiveMode.Update\n                ? new FileStream(target, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)\n                : new FileStream(target, FileMode.Create, FileAccess.Write, FileShare.None);\n            await ZipStreamsAsync(fileStream, data, mode, compressionLevel).ConfigureAwait(false);\n        }\n\n        /// <summary>\n        /// Performs an in memory zip of the specified stream in the target stream\n        /// </summary>\n        /// <param name=\"target\">The target stream</param>\n        /// <param name=\"data\">The file contents in bytes to be zipped</param>\n        /// <param name=\"mode\">The archive mode</param>\n        /// <param name=\"compressionLevel\">The desired compression level</param>\n        /// <param name=\"leaveStreamOpen\">True to leave the taget stream open</param>\n        /// <returns>The zipped file as a byte array</returns>\n        public static async Task ZipStreamsAsync(Stream target, IEnumerable<KeyValuePair<string, Stream>> data, ZipArchiveMode? mode = null,\n            CompressionLevel? compressionLevel = null, bool leaveStreamOpen = false)\n        {\n            compressionLevel ??= CompressionLevel.SmallestSize;\n            using var archive = new ZipArchive(target, mode ?? ZipArchiveMode.Create, leaveStreamOpen);\n            foreach (var kvp in data)\n            {\n                if (archive.Mode == ZipArchiveMode.Update)\n                {\n                    var existingEntry = archive.GetEntry(kvp.Key);\n                    existingEntry?.Delete();\n                }\n                var entry = archive.CreateEntry(kvp.Key, compressionLevel.Value);\n                using var entryStream = entry.Open();\n                await kvp.Value.CopyToAsync(entryStream).ConfigureAwait(false);\n            }\n        }\n\n        /// <summary>\n        /// Extract .gz files to disk\n        /// </summary>\n        /// <param name=\"gzipFileName\"></param>\n        /// <param name=\"targetDirectory\"></param>\n        public static string UnGZip(string gzipFileName, string targetDirectory)\n        {\n            // Use a 4K buffer. Any larger is a waste.\n            var dataBuffer = new byte[4096];\n            var newFileOutput = Path.Combine(targetDirectory, Path.GetFileNameWithoutExtension(gzipFileName));\n            using (Stream fileStream = new FileStream(gzipFileName, FileMode.Open, FileAccess.Read))\n            using (var gzipStream = new GZipInputStream(fileStream))\n            using (var fileOutput = File.Create(newFileOutput))\n            {\n                StreamUtils.Copy(gzipStream, fileOutput, dataBuffer);\n            }\n            return newFileOutput;\n        }\n\n        /// <summary>\n        /// Compress a given file and delete the original file. Automatically rename the file to name.zip.\n        /// </summary>\n        /// <param name=\"textPath\">Path of the original file</param>\n        /// <param name=\"zipEntryName\">The name of the entry inside the zip file</param>\n        /// <param name=\"deleteOriginal\">Boolean flag to delete the original file after completion</param>\n        /// <returns>String path for the new zip file</returns>\n        public static string Zip(string textPath, string zipEntryName, bool deleteOriginal = true)\n        {\n            var zipPath = textPath.Replace(\".csv\", \".zip\").Replace(\".txt\", \".zip\");\n            Zip(textPath, zipPath, zipEntryName, deleteOriginal);\n            return zipPath;\n        }\n\n        /// <summary>\n        /// Compresses the specified source file.\n        /// </summary>\n        /// <param name=\"source\">The source file to be compressed</param>\n        /// <param name=\"destination\">The destination zip file path</param>\n        /// <param name=\"zipEntryName\">The zip entry name for the file</param>\n        /// <param name=\"deleteOriginal\">True to delete the source file upon completion</param>\n        public static void Zip(string source, string destination, string zipEntryName, bool deleteOriginal)\n        {\n            try\n            {\n                var buffer = new byte[4096];\n                using (var stream = new ZipOutputStream(File.Create(destination)))\n                {\n                    //Zip the text file.\n                    var entry = new ZipEntry(zipEntryName);\n                    stream.PutNextEntry(entry);\n\n                    using (var fs = File.OpenRead(source))\n                    {\n                        int sourceBytes;\n                        do\n                        {\n                            sourceBytes = fs.Read(buffer, 0, buffer.Length);\n                            stream.Write(buffer, 0, sourceBytes);\n                        }\n                        while (sourceBytes > 0);\n                    }\n                }\n\n                //Delete the old text file:\n                if (deleteOriginal)\n                {\n                    File.Delete(source);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Compress a given file and delete the original file. Automatically rename the file to name.zip.\n        /// </summary>\n        /// <param name=\"textPath\">Path of the original file</param>\n        /// <param name=\"deleteOriginal\">Boolean flag to delete the original file after completion</param>\n        /// <returns>String path for the new zip file</returns>\n        public static string Zip(string textPath, bool deleteOriginal = true)\n        {\n            return Zip(textPath, Path.GetFileName(textPath), deleteOriginal);\n        }\n\n        /// <summary>\n        /// Compress given data to the path given\n        /// </summary>\n        /// <param name=\"data\">Data to write to zip</param>\n        /// <param name=\"zipPath\">Path to write to</param>\n        /// <param name=\"zipEntry\">Entry to save the data as</param>\n        public static void Zip(string data, string zipPath, string zipEntry)\n        {\n            using (var stream = new ZipOutputStream(File.Create(zipPath)))\n            {\n                var entry = new ZipEntry(zipEntry);\n                stream.PutNextEntry(entry);\n                var buffer = new byte[4096];\n                using (var dataReader = new MemoryStream(Encoding.Default.GetBytes(data)))\n                {\n                    int sourceBytes;\n                    do\n                    {\n                        sourceBytes = dataReader.Read(buffer, 0, buffer.Length);\n                        stream.Write(buffer, 0, sourceBytes);\n                    }\n                    while (sourceBytes > 0);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Zips the specified directory, preserving folder structure\n        /// </summary>\n        /// <param name=\"directory\">The directory to be zipped</param>\n        /// <param name=\"destination\">The output zip file destination</param>\n        /// <param name=\"includeRootInZip\">True to include the root 'directory' in the zip, false otherwise</param>\n        /// <returns>True on a successful zip, false otherwise</returns>\n        public static bool ZipDirectory(string directory, string destination, bool includeRootInZip = true)\n        {\n            try\n            {\n                if (File.Exists(destination)) File.Delete(destination);\n                System.IO.Compression.ZipFile.CreateFromDirectory(directory, destination, CompressionLevel.Fastest, includeRootInZip, new PathEncoder());\n                return true;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Encode the paths as linux format for cross platform compatibility\n        /// </summary>\n        private class PathEncoder : UTF8Encoding\n        {\n            public override byte[] GetBytes(string s)\n            {\n                s = s.Replace(\"\\\\\", \"/\");\n                return base.GetBytes(s);\n            }\n        }\n\n        /// <summary>\n        /// Unzips the specified zip file to the specified directory\n        /// </summary>\n        /// <param name=\"zip\">The zip to be unzipped</param>\n        /// <param name=\"directory\">The directory to place the unzipped files</param>\n        /// <param name=\"overwrite\">Flag specifying whether or not to overwrite existing files</param>\n        public static bool Unzip(string zip, string directory, bool overwrite = false)\n        {\n            if (!File.Exists(zip)) return false;\n\n            try\n            {\n                if (!overwrite)\n                {\n                    System.IO.Compression.ZipFile.ExtractToDirectory(zip, directory);\n                }\n                else\n                {\n                    using (var archive = new ZipArchive(File.OpenRead(zip)))\n                    {\n                        foreach (var file in archive.Entries)\n                        {\n                            // skip directories\n                            if (string.IsNullOrEmpty(file.Name)) continue;\n                            var filepath = Path.Combine(directory, file.FullName);\n                            if (IsLinux) filepath = filepath.Replace(@\"\\\", \"/\");\n                            var outputFile = new FileInfo(filepath);\n                            if (!outputFile.Directory.Exists)\n                            {\n                                outputFile.Directory.Create();\n                            }\n                            file.ExtractToFile(outputFile.FullName, true);\n                        }\n                    }\n                }\n\n                return true;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Zips all files specified to a new zip at the destination path\n        /// </summary>\n        public static void ZipFiles(string destination, IEnumerable<string> files)\n        {\n            try\n            {\n                using (var zipStream = new ZipOutputStream(File.Create(destination)))\n                {\n                    var buffer = new byte[4096];\n                    foreach (var file in files)\n                    {\n                        if (!File.Exists(file))\n                        {\n                            Log.Trace($\"ZipFiles(): File does not exist: {file}\");\n                            continue;\n                        }\n\n                        var entry = new ZipEntry(Path.GetFileName(file));\n                        zipStream.PutNextEntry(entry);\n                        using (var fstream = File.OpenRead(file))\n                        {\n                            StreamUtils.Copy(fstream, zipStream, buffer);\n                        }\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n        }\n\n        /// <summary>\n        /// Streams a local zip file using a streamreader.\n        /// Important: the caller must call Dispose() on the returned ZipFile instance.\n        /// </summary>\n        /// <param name=\"filename\">Location of the original zip file</param>\n        /// <param name=\"zip\">The ZipFile instance to be returned to the caller</param>\n        /// <returns>Stream reader of the first file contents in the zip file</returns>\n        public static StreamReader Unzip(string filename, out ZipFile zip)\n        {\n            return Unzip(filename, null, out zip);\n        }\n\n        /// <summary>\n        /// Streams a local zip file using a streamreader.\n        /// Important: the caller must call Dispose() on the returned ZipFile instance.\n        /// </summary>\n        /// <param name=\"filename\">Location of the original zip file</param>\n        /// <param name=\"zipEntryName\">The zip entry name to open a reader for. Specify null to access the first entry</param>\n        /// <param name=\"zip\">The ZipFile instance to be returned to the caller</param>\n        /// <returns>Stream reader of the first file contents in the zip file</returns>\n        public static StreamReader Unzip(string filename, string zipEntryName, out ZipFile zip)\n        {\n            StreamReader reader = null;\n            zip = null;\n\n            try\n            {\n                if (File.Exists(filename))\n                {\n                    try\n                    {\n                        zip = new ZipFile(filename);\n                        var entry = zip.FirstOrDefault(x => zipEntryName == null || string.Compare(x.FileName, zipEntryName, StringComparison.OrdinalIgnoreCase) == 0);\n                        if (entry == null)\n                        {\n                            // Unable to locate zip entry\n                            return null;\n                        }\n\n                        reader = new StreamReader(entry.OpenReader());\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err, \"Inner try/catch\");\n                        if (zip != null) zip.Dispose();\n                        if (reader != null) reader.Close();\n                    }\n                }\n                else\n                {\n                    Log.Error($\"Data.UnZip(2): File doesn\\'t exist: {filename}\");\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, \"File: \" + filename);\n            }\n            return reader;\n        }\n\n        /// <summary>\n        /// Streams the unzipped file as key value pairs of file name to file contents.\n        /// NOTE: When the returned enumerable finishes enumerating, the zip stream will be\n        /// closed rendering all key value pair Value properties unaccessible. Ideally this\n        /// would be enumerated depth first.\n        /// </summary>\n        /// <remarks>\n        /// This method has the potential for a memory leak if each kvp.Value enumerable is not disposed\n        /// </remarks>\n        /// <param name=\"filename\">The zip file to stream</param>\n        /// <returns>The stream zip contents</returns>\n        public static IEnumerable<KeyValuePair<string, List<string>>> Unzip(string filename)\n        {\n            if (!File.Exists(filename))\n            {\n                Log.Error($\"Compression.Unzip(): File does not exist: {filename}\");\n                return Enumerable.Empty<KeyValuePair<string, List<string>>>();\n            }\n\n            try\n            {\n                return ReadLinesImpl(filename);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return Enumerable.Empty<KeyValuePair<string, List<string>>>();\n        }\n\n        /// <summary>\n        /// Lazily unzips the specified stream\n        /// </summary>\n        /// <param name=\"stream\">The zipped stream to be read</param>\n        /// <returns>An enumerable whose elements are zip entry key value pairs with\n        /// a key of the zip entry name and the value of the zip entry's file lines</returns>\n        public static IEnumerable<KeyValuePair<string, List<string>>> Unzip(Stream stream)\n        {\n            using (var zip = ZipFile.Read(stream))\n            {\n                foreach (var entry in zip)\n                {\n                    yield return new KeyValuePair<string, List<string>>(entry.FileName, ReadZipEntry(entry));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Streams each line from the first zip entry in the specified zip file\n        /// </summary>\n        /// <param name=\"filename\">The zip file path to stream</param>\n        /// <returns>An enumerable containing each line from the first unzipped entry</returns>\n        public static List<string> ReadLines(string filename)\n        {\n            if (!File.Exists(filename))\n            {\n                Log.Error($\"Compression.ReadFirstZipEntry(): File does not exist: {filename}\");\n                return new List<string>();\n            }\n\n            try\n            {\n                return ReadLinesImpl(filename, firstEntryOnly: true).Single().Value;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n            return new List<string>();\n        }\n\n        private static IEnumerable<KeyValuePair<string, List<string>>> ReadLinesImpl(string filename, bool firstEntryOnly = false)\n        {\n            using (var zip = ZipFile.Read(filename))\n            {\n                for (var i = 0; i < zip.Count; i++)\n                {\n                    var entry = zip[i];\n                    yield return new KeyValuePair<string, List<string>>(entry.FileName, ReadZipEntry(entry));\n                    if (firstEntryOnly)\n                    {\n                        yield break;\n                    }\n                }\n            }\n        }\n\n        private static List<string> ReadZipEntry(Ionic.Zip.ZipEntry entry)\n        {\n            var result = new List<string>();\n            using var entryReader = new StreamReader(entry.OpenReader());\n            var line = entryReader.ReadLine();\n            while (line != null)\n            {\n                result.Add(line);\n                line = entryReader.ReadLine();\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Unzip a local file and return its contents via streamreader:\n        /// </summary>\n        public static StreamReader UnzipStreamToStreamReader(Stream zipstream)\n        {\n            StreamReader reader = null;\n            try\n            {\n                //Initialise:\n                MemoryStream file;\n\n                //If file exists, open a zip stream for it.\n                using (var zipStream = new ZipInputStream(zipstream))\n                {\n                    //Read the file entry into buffer:\n                    var entry = zipStream.GetNextEntry();\n                    var buffer = new byte[entry.Size];\n                    zipStream.Read(buffer, 0, (int)entry.Size);\n\n                    //Load the buffer into a memory stream.\n                    file = new MemoryStream(buffer);\n                }\n\n                //Open the memory stream with a stream reader.\n                reader = new StreamReader(file);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return reader;\n        } // End UnZip\n\n        /// <summary>\n        /// Unzip a stream that represents a zip file and return the first entry as a stream\n        /// </summary>\n        public static Stream UnzipStream(Stream zipstream, out ZipFile zipFile, string entryName = null)\n        {\n            zipFile = ZipFile.Read(zipstream);\n\n            try\n            {\n                Ionic.Zip.ZipEntry entry;\n                if (string.IsNullOrEmpty(entryName))\n                {\n                    //Read the file entry into buffer:\n                    entry = zipFile.Entries.FirstOrDefault();\n                }\n                else\n                {\n                    // Attempt to find our specific entry\n                    if (!zipFile.ContainsEntry(entryName))\n                    {\n                        return null;\n                    }\n                    entry = zipFile[entryName];\n                }\n\n                if (entry != null)\n                {\n                    return entry.OpenReader();\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return null;\n        } // End UnZip\n\n        /// <summary>\n        /// Unzip the given byte array and return the created file names.\n        /// </summary>\n        /// <param name=\"zipData\">A byte array containing the zip</param>\n        /// <param name=\"outputFolder\">The target output folder</param>\n        /// <returns>List of unzipped file names</returns>\n        public static List<string> UnzipToFolder(byte[] zipData, string outputFolder)\n        {\n            var stream = new MemoryStream(zipData);\n            return UnzipToFolder(stream, outputFolder);\n        }\n\n        /// <summary>\n        /// Unzip a local file and return the created file names\n        /// </summary>\n        /// <param name=\"zipFile\">Location of the zip on the HD</param>\n        /// <returns>List of unzipped file names</returns>\n        public static List<string> UnzipToFolder(string zipFile)\n        {\n            var outFolder = Path.GetDirectoryName(zipFile);\n            var stream = File.OpenRead(zipFile);\n            return UnzipToFolder(stream, outFolder);\n        }\n\n        /// <summary>\n        /// Unzip the given data stream into the target output folder and return the created file names\n        /// </summary>\n        /// <param name=\"dataStream\">The zip data stream</param>\n        /// <param name=\"outFolder\">The target output folder</param>\n        /// <returns>List of unzipped file names</returns>\n        private static List<string> UnzipToFolder(Stream dataStream, string outFolder)\n        {\n            //1. Initialize:\n            var files = new List<string>();\n            if (string.IsNullOrEmpty(outFolder))\n            {\n                outFolder = Directory.GetCurrentDirectory();\n            }\n            ICSharpCode.SharpZipLib.Zip.ZipFile zf = null;\n\n            try\n            {\n                zf = new ICSharpCode.SharpZipLib.Zip.ZipFile(dataStream);\n\n                foreach (ZipEntry zipEntry in zf)\n                {\n                    //Ignore Directories\n                    if (!zipEntry.IsFile) continue;\n\n                    var buffer = new byte[4096]; // 4K is optimum\n                    var zipStream = zf.GetInputStream(zipEntry);\n\n                    // Manipulate the output filename here as desired.\n                    var fullZipToPath = Path.Combine(outFolder, zipEntry.Name);\n\n                    var targetFile = new FileInfo(fullZipToPath);\n                    if (targetFile.Directory != null && !targetFile.Directory.Exists)\n                    {\n                        targetFile.Directory.Create();\n                    }\n\n                    //Save the file name for later:\n                    files.Add(fullZipToPath);\n\n                    //Copy the data in buffer chunks\n                    using (var streamWriter = File.Create(fullZipToPath))\n                    {\n                        StreamUtils.Copy(zipStream, streamWriter, buffer);\n                    }\n                }\n            }\n            catch\n            {\n                // lets catch the exception just to log some information about the zip file\n                Log.Error($\"Compression.UnzipToFolder(): Failure: outFolder: {outFolder} - files: {string.Join(\",\", files)}\");\n                throw;\n            }\n            finally\n            {\n                if (zf != null)\n                {\n                    zf.IsStreamOwner = true; // Makes close also shut the underlying stream\n                    zf.Close(); // Ensure we release resources\n                }\n            }\n            return files;\n        } // End UnZip\n\n        /// <summary>\n        /// Extracts all file from a zip archive and copies them to a destination folder.\n        /// </summary>\n        /// <param name=\"source\">The source zip file.</param>\n        /// <param name=\"destination\">The destination folder to extract the file to.</param>\n        public static void UnTarFiles(string source, string destination)\n        {\n            var inStream = File.OpenRead(source);\n            var tarArchive = TarArchive.CreateInputTarArchive(inStream);\n            tarArchive.ExtractContents(destination);\n            tarArchive.Close();\n            inStream.Close();\n        }\n\n        /// <summary>\n        /// Extract tar.gz files to disk\n        /// </summary>\n        /// <param name=\"source\">Tar.gz source file</param>\n        /// <param name=\"destination\">Location folder to unzip to</param>\n        public static void UnTarGzFiles(string source, string destination)\n        {\n            var inStream = File.OpenRead(source);\n            var gzipStream = new GZipInputStream(inStream);\n            var tarArchive = TarArchive.CreateInputTarArchive(gzipStream);\n            tarArchive.ExtractContents(destination);\n            tarArchive.Close();\n            gzipStream.Close();\n            inStream.Close();\n        }\n\n        /// <summary>\n        /// Enumerate through the files of a TAR and get a list of KVP names-byte arrays\n        /// </summary>\n        /// <param name=\"stream\">The input tar stream</param>\n        /// <param name=\"isTarGz\">True if the input stream is a .tar.gz or .tgz</param>\n        /// <returns>An enumerable containing each tar entry and it's contents</returns>\n        public static IEnumerable<KeyValuePair<string, byte[]>> UnTar(Stream stream, bool isTarGz)\n        {\n            using (var tar = new TarInputStream(isTarGz ? (Stream)new GZipInputStream(stream) : stream))\n            {\n                TarEntry entry;\n                while ((entry = tar.GetNextEntry()) != null)\n                {\n                    if (entry.IsDirectory) continue;\n\n                    using (var output = new MemoryStream())\n                    {\n                        tar.CopyEntryContents(output);\n                        yield return new KeyValuePair<string, byte[]>(entry.Name, output.ToArray());\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Enumerate through the files of a TAR and get a list of KVP names-byte arrays.\n        /// </summary>\n        /// <param name=\"source\"></param>\n        /// <returns></returns>\n        public static IEnumerable<KeyValuePair<string, byte[]>> UnTar(string source)\n        {\n            //This is a tar.gz file.\n            var gzip = (source.Substring(Math.Max(0, source.Length - 6)) == \"tar.gz\");\n\n            using (var file = File.OpenRead(source))\n            {\n                var tarIn = new TarInputStream(file);\n\n                if (gzip)\n                {\n                    var gzipStream = new GZipInputStream(file);\n                    tarIn = new TarInputStream(gzipStream);\n                }\n\n                TarEntry tarEntry;\n                while ((tarEntry = tarIn.GetNextEntry()) != null)\n                {\n                    if (tarEntry.IsDirectory) continue;\n\n                    using (var stream = new MemoryStream())\n                    {\n                        tarIn.CopyEntryContents(stream);\n                        yield return new KeyValuePair<string, byte[]>(tarEntry.Name, stream.ToArray());\n                    }\n                }\n                tarIn.Close();\n            }\n        }\n\n        /// <summary>\n        /// Validates whether the zip is corrupted or not\n        /// </summary>\n        /// <param name=\"path\">Path to the zip file</param>\n        /// <returns>true if archive tests ok; false otherwise.</returns>\n        public static bool ValidateZip(string path)\n        {\n            using (var zip = new ICSharpCode.SharpZipLib.Zip.ZipFile(path))\n            {\n                return zip.TestArchive(true);\n            }\n        }\n\n        /// <summary>\n        /// Returns the entry file names contained in a zip file\n        /// </summary>\n        /// <param name=\"zipFileName\">The zip file name</param>\n        /// <returns>An IEnumerable of entry file names</returns>\n        public static IEnumerable<string> GetZipEntryFileNames(string zipFileName)\n        {\n            using (var zip = ZipFile.Read(zipFileName))\n            {\n                return zip.EntryFileNames;\n            }\n        }\n\n        /// <summary>\n        /// Return the entry file names contained in a zip file\n        /// </summary>\n        /// <param name=\"zipFileStream\">Stream to the file</param>\n        /// <returns>IEnumerable of entry file names</returns>\n        public static IEnumerable<string> GetZipEntryFileNames(Stream zipFileStream)\n        {\n            using (var zip = ZipFile.Read(zipFileStream))\n            {\n                return zip.EntryFileNames;\n            }\n        }\n\n        /// <summary>\n        /// Extracts a 7-zip archive to disk, using the 7-zip CLI utility\n        /// </summary>\n        /// <param name=\"inputFile\">Path to the 7z file</param>\n        /// <param name=\"outputDirectory\">Directory to output contents of 7z</param>\n        /// <param name=\"execTimeout\">Timeout in seconds for how long we should wait for the extraction to complete</param>\n        /// <exception cref=\"Exception\">The extraction failed because of a timeout or the exit code was not 0</exception>\n        public static void Extract7ZipArchive(string inputFile, string outputDirectory, int execTimeout = 60000)\n        {\n            var zipper = IsLinux ? \"7z\" : \"C:/Program Files/7-Zip/7z.exe\";\n            var psi = new ProcessStartInfo(zipper, \" e \" + inputFile + \" -o\" + outputDirectory)\n            {\n                CreateNoWindow = true,\n                WindowStyle = ProcessWindowStyle.Hidden,\n                UseShellExecute = false,\n                RedirectStandardOutput = false\n            };\n\n            var process = new Process();\n            process.StartInfo = psi;\n            process.Start();\n\n            if (!process.WaitForExit(execTimeout))\n            {\n                throw new TimeoutException($\"Timed out extracting 7Zip archive: {inputFile} ({execTimeout} seconds)\");\n            }\n            if (process.ExitCode > 0)\n            {\n                throw new Exception($\"Compression.Extract7ZipArchive(): 7Zip exited unsuccessfully (code {process.ExitCode})\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Compression/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Compression\")]\n[assembly: AssemblyProduct(\"QuantConnect.Compression\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"fb6df234-1fe6-4556-86f9-0d206c6a2eb7\")]"
  },
  {
    "path": "Compression/QuantConnect.Compression.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Compression</RootNamespace>\n    <AssemblyName>QuantConnect.Compression</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Compression.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Compression Project - A library with compression tools</Description>\n    <NoWarn>CA1062</NoWarn>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"DotNetZip\" Version=\"1.16.0\" />\n    <PackageReference Include=\"SharpZipLib\" Version=\"1.3.3\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Compression/ZipStreamWriter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.IO.Compression;\nusing System.Text;\n\nnamespace QuantConnect\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"TextWriter\"/> to write to a zip file\n    /// </summary>\n    public class ZipStreamWriter : TextWriter\n    {\n        private readonly ZipArchive _archive;\n        private readonly StreamWriter _writer;\n\n        /// <summary>\n        /// When overridden in a derived class, returns the character encoding in which the output is written.\n        /// </summary>\n        /// <returns>\n        /// The character encoding in which the output is written.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public override Encoding Encoding => Encoding.Default;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ZipStreamWriter\"/> class\n        /// </summary>\n        /// <param name=\"filename\">The output zip file name</param>\n        /// <param name=\"zipEntry\">The file name in the zip file</param>\n        public ZipStreamWriter(string filename, string zipEntry)\n        {\n            if(!File.Exists(filename))\n            {\n                _archive = ZipFile.Open(filename, ZipArchiveMode.Create);\n                var entry = _archive.CreateEntry(zipEntry);\n                _writer = new StreamWriter(entry.Open());\n            }\n            else\n            {\n                _archive = ZipFile.Open(filename, ZipArchiveMode.Update);\n                 var entry = _archive.GetEntry(zipEntry);\n                 var nonExisting = entry == null;\n                 if (nonExisting)\n                 {\n                     entry = _archive.CreateEntry(zipEntry);\n                 }\n                _writer = new StreamWriter(entry.Open());\n\n                if (!nonExisting)\n                {\n                    // can only seek when it already existed\n                    _writer.BaseStream.Seek(0L, SeekOrigin.End);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Writes a character to the text string or stream.\n        /// </summary>\n        /// <param name=\"value\">The character to write to the text stream. </param>\n        /// <exception cref=\"T:System.ObjectDisposedException\">The <see cref=\"T:System.IO.TextWriter\"/> is closed. </exception>\n        /// <exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n        /// <filterpriority>1</filterpriority>\n        public override void Write(char value)\n        {\n            _writer.Write(value);\n        }\n\n        /// <summary>\n        /// Writes a string followed by a line terminator to the text string or stream.\n        /// </summary>\n        /// <param name=\"value\">The string to write. If <paramref name=\"value\"/> is null, only the line terminator is written. </param>\n        /// <exception cref=\"T:System.ObjectDisposedException\">The <see cref=\"T:System.IO.TextWriter\"/> is closed. </exception>\n        /// <exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n        /// <filterpriority>1</filterpriority>\n        public override void WriteLine(string value)\n        {\n            _writer.WriteLine(value);\n        }\n\n        /// <summary>\n        /// Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.\n        /// </summary>\n        public override void Flush()\n        {\n            _writer.Flush();\n        }\n\n        /// <summary>\n        /// Releases the unmanaged resources used by the <see cref=\"T:System.IO.TextWriter\"/> and optionally releases the managed resources.\n        /// </summary>\n        /// <param name=\"disposing\">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>\n        protected override void Dispose(bool disposing)\n        {\n            if (_writer == null || !disposing)\n                return;\n            _writer.Flush();\n            _writer.Close();\n            _writer.Dispose();\n            _archive.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/ApplicationParser.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Command Line application parser\n    /// </summary>\n    public static class ApplicationParser\n    {\n        /// <summary>\n        /// This function will parse args based on options and will show application name, version, help\n        /// </summary>\n        /// <param name=\"applicationName\">The application name to be shown</param>\n        /// <param name=\"applicationDescription\">The application description to be shown</param>\n        /// <param name=\"applicationHelpText\">The application help text</param>\n        /// <param name=\"args\">The command line arguments</param>\n        /// <param name=\"options\">The applications command line available options</param>\n        /// <param name=\"noArgsShowHelp\">To show help when no command line arguments were provided</param>\n        /// <returns>The user provided options. Key is option name</returns>\n        public static Dictionary<string, object> Parse(string applicationName, string applicationDescription, string applicationHelpText,\n                                                       string[] args, List<CommandLineOption> options, bool noArgsShowHelp = false)\n        {\n            var application = new CommandLineApplication\n            {\n                Name = applicationName,\n                Description = applicationDescription,\n                ExtendedHelpText = applicationHelpText\n            };\n\n            application.HelpOption(\"-?|-h|--help\");\n\n            // This is a helper/shortcut method to display version info - it is creating a regular Option, with some defaults.\n            // The default help text is \"Show version Information\"\n            application.VersionOption(\"-v|-V|--version\",\n                () =>\n                    $\"Version {Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion}\");\n\n            var optionsObject = new Dictionary<string, object>();\n\n            var listOfOptions = new List<CommandOption>();\n\n            foreach (var option in options)\n            {\n                listOfOptions.Add(application.Option($\"--{option.Name}\", option.Description, option.Type));\n            }\n\n            application.OnExecute(() =>\n            {\n                foreach (var commandOption in listOfOptions.Where(option => option.HasValue()))\n                {\n                    var optionKey = commandOption.Template.Replace(\"--\", \"\");\n                    var matchingOption = options.Find(o => o.Name == optionKey);\n                    switch (matchingOption.Type)\n                    {\n                        // Booleans\n                        case CommandOptionType.NoValue:\n                            optionsObject[optionKey] = true;\n                            break;\n\n                        // Strings and numbers\n                        case CommandOptionType.SingleValue:\n                            optionsObject[optionKey] = commandOption.Value();\n                            break;\n\n                        // Parsing nested objects\n                        case CommandOptionType.MultipleValue:\n                            var keyValuePairs = commandOption.Value().Split(',');\n                            var subDictionary = new Dictionary<string, string>();\n                            foreach (var keyValuePair in keyValuePairs)\n                            {\n                                var subKeys = keyValuePair.Split(':');\n                                subDictionary[subKeys[0]] = subKeys.Length > 1 ? subKeys[1] : \"\";\n                            }\n\n                            optionsObject[optionKey] = subDictionary;\n                            break;\n                        default:\n                            throw new ArgumentOutOfRangeException();\n                    }\n                }\n\n                return 0;\n            });\n\n            application.Execute(args);\n            if (noArgsShowHelp && args.Length == 0)\n            {\n                application.ShowHelp();\n            }\n            return optionsObject;\n        }\n\n        /// <summary>\n        /// Prints a message advising the user to use the --help parameter for more information\n        /// </summary>\n        public static void PrintMessageAndExit(int exitCode = 0, string message = \"\")\n        {\n            if (!string.IsNullOrEmpty(message))\n            {\n                Console.WriteLine(\"\\n\" + message);\n            }\n            Console.WriteLine(\"\\nUse the '--help' parameter for more information\");\n            Console.WriteLine(\"Press any key to quit\");\n            Console.ReadLine();\n            Environment.Exit(exitCode);\n        }\n\n        /// <summary>\n        /// Gets the parameter object from the given parameter (if it exists)\n        /// </summary>\n        public static string GetParameterOrExit(IReadOnlyDictionary<string, object> optionsObject, string parameter)\n        {\n            if (!optionsObject.ContainsKey(parameter))\n            {\n                PrintMessageAndExit(1, \"ERROR: REQUIRED parameter --\" + parameter + \"= is missing\");\n            }\n            return optionsObject[parameter].ToString();\n        }\n\n        /// <summary>\n        /// Gets the parameter object from the given parameter. If it does not exists, it returns a default parameter object\n        /// </summary>\n        public static string GetParameterOrDefault(IReadOnlyDictionary<string, object> optionsObject, string parameter, string defaultValue)\n        {\n            object value;\n            if (!optionsObject.TryGetValue(parameter, out value))\n            {\n                Console.WriteLine($\"'{parameter}' was not specified. Using default value: '{defaultValue}'\");\n                return defaultValue;\n            }\n\n            return value.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/CommandLineOption.cs",
    "content": "﻿using McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Auxiliary class to keep information about a specific command line option\n    /// </summary>\n    public class CommandLineOption\n    {\n        /// <summary>\n        /// Command line option type\n        /// </summary>\n        public CommandOptionType Type { get; }\n\n        /// <summary>\n        /// Command line option description\n        /// </summary>\n        public string Description { get; }\n\n        /// <summary>\n        /// Command line option name\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Command line option contructor\n        /// </summary>\n        public CommandLineOption(string name, CommandOptionType type, string description = \"\")\n        {\n            Type = type;\n            Description = description;\n            Name = name;\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/Config.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Logging;\nusing static System.FormattableString;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Configuration class loads the required external setup variables to launch the Lean engine.\n    /// </summary>\n    public static class Config\n    {\n        //Location of the configuration file.\n        private static string ConfigurationFileName = \"config.json\";\n\n        /// <summary>\n        /// Set configuration file on-fly\n        /// </summary>\n        /// <param name=\"fileName\"></param>\n        public static void SetConfigurationFile(string fileName)\n        {\n            if (File.Exists(fileName))\n            {\n                Log.Trace(Invariant($\"Using {fileName} as configuration file\"));\n                ConfigurationFileName = fileName;\n            }\n            else\n            {\n                Log.Error(Invariant($\"Configuration file {fileName} does not exist, using {ConfigurationFileName}\"));\n            }\n        }\n\n        /// <summary>\n        /// Merge CLI arguments with configuration file + load custom config file via CLI arg\n        /// </summary>\n        /// <param name=\"cliArguments\"></param>\n        public static void MergeCommandLineArgumentsWithConfiguration(Dictionary<string, object> cliArguments)\n        {\n            if (cliArguments.ContainsKey(\"config\"))\n            {\n                SetConfigurationFile(cliArguments[\"config\"] as string);\n                Reset();\n            }\n\n            var jsonArguments = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(cliArguments));\n\n            Settings.Value.Merge(jsonArguments, new JsonMergeSettings\n            {\n                MergeArrayHandling = MergeArrayHandling.Union\n            });\n        }\n\n        /// <summary>\n        /// Resets the config settings to their default values.\n        /// Called in regression tests where multiple algorithms are run sequentially,\n        /// and we need to guarantee that every test starts with the same configuration.\n        /// </summary>\n        public static void Reset()\n        {\n            Settings = new Lazy<JObject>(ConfigFactory);\n        }\n\n        private static Lazy<JObject> Settings = new Lazy<JObject>(ConfigFactory);\n\n        private static JObject ConfigFactory()\n        {\n            // initialize settings inside a lazy for free thread-safe, one-time initialization\n            if (!File.Exists(ConfigurationFileName))\n            {\n                return new JObject\n                {\n                    {\"algorithm-type-name\", \"BasicTemplateAlgorithm\"},\n                    {\"live-mode\", false},\n                    {\"data-folder\", \"../../../Data/\"},\n                    {\"messaging-handler\", \"QuantConnect.Messaging.Messaging\"},\n                    {\"job-queue-handler\", \"QuantConnect.Queues.JobQueue\"},\n                    {\"api-handler\", \"QuantConnect.Api.Api\"},\n                    {\"setup-handler\", \"QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler\"},\n                    {\"result-handler\", \"QuantConnect.Lean.Engine.Results.BacktestingResultHandler\"},\n                    {\"data-feed-handler\", \"QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed\"},\n                    {\"real-time-handler\", \"QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler\"},\n                    {\"transaction-handler\", \"QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler\"}\n                };\n            }\n\n            return JObject.Parse(File.ReadAllText(ConfigurationFileName));\n        }\n\n        /// <summary>\n        /// Gets the currently selected environment. If sub-environments are defined,\n        /// they'll be returned as {env1}.{env2}\n        /// </summary>\n        /// <returns>The fully qualified currently selected environment</returns>\n        public static string GetEnvironment()\n        {\n            var environments = new List<string>();\n            JToken currentEnvironment = Settings.Value;\n            var env = currentEnvironment[\"environment\"];\n            while (currentEnvironment != null && env != null)\n            {\n                var currentEnv = env.Value<string>();\n                environments.Add(currentEnv);\n                var moreEnvironments = currentEnvironment[\"environments\"];\n                if (moreEnvironments == null)\n                {\n                    break;\n                }\n\n                currentEnvironment = moreEnvironments[currentEnv];\n                env = currentEnvironment[\"environment\"];\n            }\n            return string.Join(\".\", environments);\n        }\n\n        /// <summary>\n        /// Get the matching config setting from the file searching for this key.\n        /// </summary>\n        /// <param name=\"key\">String key value we're seaching for in the config file.</param>\n        /// <param name=\"defaultValue\"></param>\n        /// <returns>String value of the configuration setting or empty string if nothing found.</returns>\n        public static string Get(string key, string defaultValue = \"\")\n        {\n            // special case environment requests\n            if (key == \"environment\") return GetEnvironment();\n\n            var token = GetToken(Settings.Value, key);\n            if (token == null)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug(Invariant($\"Config.Get(): Configuration key not found. Key: {key} - Using default value: {defaultValue}\"));\n                }\n                return defaultValue;\n            }\n            return token.ToString();\n        }\n\n        /// <summary>\n        /// Gets the underlying JToken for the specified key\n        /// </summary>\n        public static JToken GetToken(string key)\n        {\n            return GetToken(Settings.Value, key);\n        }\n\n        /// <summary>\n        /// Sets a configuration value. This is really only used to help testing. The key heye can be\n        /// specified as {environment}.key to set a value on a specific environment\n        /// </summary>\n        /// <param name=\"key\">The key to be set</param>\n        /// <param name=\"value\">The new value</param>\n        public static void Set(string key, dynamic value)\n        {\n            JToken environment = Settings.Value;\n            while (key.Contains('.', StringComparison.InvariantCulture))\n            {\n                var envName = key.Substring(0, key.IndexOf(\".\", StringComparison.InvariantCulture));\n                key = key.Substring(key.IndexOf(\".\", StringComparison.InvariantCulture) + 1);\n                var environments = environment[\"environments\"];\n                if (environments == null)\n                {\n                    environment[\"environments\"] = environments = new JObject();\n                }\n                environment = environments[envName];\n            }\n            environment[key] = value;\n        }\n\n        /// <summary>\n        /// Get a boolean value configuration setting by a configuration key.\n        /// </summary>\n        /// <param name=\"key\">String value of the configuration key.</param>\n        /// <param name=\"defaultValue\">The default value to use if not found in configuration</param>\n        /// <returns>Boolean value of the config setting.</returns>\n        public static bool GetBool(string key, bool defaultValue = false)\n        {\n            return GetValue(key, defaultValue);\n        }\n\n        /// <summary>\n        /// Get the int value of a config string.\n        /// </summary>\n        /// <param name=\"key\">Search key from the config file</param>\n        /// <param name=\"defaultValue\">The default value to use if not found in configuration</param>\n        /// <returns>Int value of the config setting.</returns>\n        public static int GetInt(string key, int defaultValue = 0)\n        {\n            return GetValue(key, defaultValue);\n        }\n\n        /// <summary>\n        /// Get the double value of a config string.\n        /// </summary>\n        /// <param name=\"key\">Search key from the config file</param>\n        /// <param name=\"defaultValue\">The default value to use if not found in configuration</param>\n        /// <returns>Double value of the config setting.</returns>\n        public static double GetDouble(string key, double defaultValue = 0.0)\n        {\n            return GetValue(key, defaultValue);\n        }\n\n        /// <summary>\n        /// Gets a value from configuration and converts it to the requested type, assigning a default if\n        /// the configuration is null or empty\n        /// </summary>\n        /// <typeparam name=\"T\">The requested type</typeparam>\n        /// <param name=\"key\">Search key from the config file</param>\n        /// <param name=\"defaultValue\">The default value to use if not found in configuration</param>\n        /// <returns>Converted value of the config setting.</returns>\n        public static T GetValue<T>(string key, T defaultValue = default(T))\n        {\n            // special case environment requests\n            if (key == \"environment\" && typeof(T) == typeof(string)) return (T)(object)GetEnvironment();\n\n            var token = GetToken(Settings.Value, key);\n            if (token == null)\n            {\n                var defaultValueString = defaultValue is IConvertible\n                    ? ((IConvertible)defaultValue).ToString(CultureInfo.InvariantCulture)\n                    : defaultValue is IFormattable\n                        ? ((IFormattable)defaultValue).ToString(null, CultureInfo.InvariantCulture)\n                        : Invariant($\"{defaultValue}\");\n\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug(Invariant($\"Config.GetValue(): {key} - Using default value: {defaultValueString}\"));\n                }\n                return defaultValue;\n            }\n\n            var type = typeof(T);\n            string value;\n            try\n            {\n                value = token.Value<string>();\n            }\n            catch (Exception)\n            {\n                value = token.ToString();\n            }\n\n            if (type.IsEnum)\n            {\n                return (T)Enum.Parse(type, value, true);\n            }\n\n            if (typeof(IConvertible).IsAssignableFrom(type))\n            {\n                return (T)Convert.ChangeType(value, type, CultureInfo.InvariantCulture);\n            }\n\n            // try and find a static parse method\n            try\n            {\n                var parse = type.GetMethod(\"Parse\", new[] { typeof(string) });\n                if (parse != null)\n                {\n                    var result = parse.Invoke(null, new object[] { value });\n                    return (T)result;\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Trace(Invariant($\"Config.GetValue<{typeof(T).Name}>({key},{defaultValue}): Failed to parse: {value}. Using default value.\"));\n                Log.Error(err);\n                return defaultValue;\n            }\n\n            try\n            {\n                return JsonConvert.DeserializeObject<T>(value);\n            }\n            catch (Exception err)\n            {\n                Log.Trace(Invariant($\"Config.GetValue<{typeof(T).Name}>({key},{defaultValue}): Failed to JSON deserialize: {value}. Using default value.\"));\n                Log.Error(err);\n                return defaultValue;\n            }\n        }\n\n        /// <summary>\n        /// Tries to find the specified key and parse it as a T, using\n        /// default(T) if unable to locate the key or unable to parse it\n        /// </summary>\n        /// <typeparam name=\"T\">The desired output type</typeparam>\n        /// <param name=\"key\">The configuration key</param>\n        /// <param name=\"value\">The output value. If the key is found and parsed successfully, it will be the parsed value, else default(T).</param>\n        /// <returns>True on successful parse or if they key is not found. False only when key is found but fails to parse.</returns>\n        public static bool TryGetValue<T>(string key, out T value)\n        {\n            return TryGetValue(key, default(T), out value);\n        }\n\n        /// <summary>\n        /// Tries to find the specified key and parse it as a T, using\n        /// defaultValue if unable to locate the key or unable to parse it\n        /// </summary>\n        /// <typeparam name=\"T\">The desired output type</typeparam>\n        /// <param name=\"key\">The configuration key</param>\n        /// <param name=\"defaultValue\">The default value to use on key not found or unsuccessful parse</param>\n        /// <param name=\"value\">The output value. If the key is found and parsed successfully, it will be the parsed value, else defaultValue.</param>\n        /// <returns>True on successful parse or if they key is not found and using defaultValue. False only when key is found but fails to parse.</returns>\n        public static bool TryGetValue<T>(string key, T defaultValue, out T value)\n        {\n            try\n            {\n                value = GetValue(key, defaultValue);\n                return true;\n            }\n            catch\n            {\n                value = defaultValue;\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Write the contents of the serialized configuration back to the disk.\n        /// </summary>\n        public static void Write(string targetPath = null)\n        {\n            if (!Settings.IsValueCreated) return;\n            var serialized = JsonConvert.SerializeObject(Settings.Value, Formatting.Indented);\n\n            var taget = ConfigurationFileName;\n            if (!string.IsNullOrEmpty(targetPath))\n            {\n                taget = Path.Combine(targetPath, ConfigurationFileName);\n            }\n            File.WriteAllText(taget, serialized);\n        }\n\n        /// <summary>\n        /// Flattens the jobject with respect to the selected environment and then\n        /// removes the 'environments' node\n        /// </summary>\n        /// <param name=\"overrideEnvironment\">The environment to use</param>\n        /// <returns>The flattened JObject</returns>\n        public static JObject Flatten(string overrideEnvironment)\n        {\n            return Flatten(Settings.Value, overrideEnvironment);\n        }\n\n        /// <summary>\n        /// Flattens the jobject with respect to the selected environment and then\n        /// removes the 'environments' node\n        /// </summary>\n        /// <param name=\"config\">The configuration represented as a JObject</param>\n        /// <param name=\"overrideEnvironment\">The environment to use</param>\n        /// <returns>The flattened JObject</returns>\n        public static JObject Flatten(JObject config, string overrideEnvironment)\n        {\n            var clone = (JObject)config.DeepClone();\n\n            // remove the environment declaration\n            var environmentProperty = clone.Property(\"environment\");\n            if (environmentProperty != null) environmentProperty.Remove();\n\n            if (!string.IsNullOrEmpty(overrideEnvironment))\n            {\n                var environmentSections = overrideEnvironment.Split('.');\n\n                for (int i = 0; i < environmentSections.Length; i++)\n                {\n                    var env = string.Join(\".environments.\", environmentSections.Where((x, j) => j <= i));\n\n                    var environments = config[\"environments\"];\n                    if (!(environments is JObject)) continue;\n\n                    var settings = ((JObject)environments).SelectToken(env);\n                    if (settings == null) continue;\n\n                    // copy values for the selected environment to the root\n                    foreach (var token in settings)\n                    {\n                        var path = Path.GetExtension(token.Path);\n                        var dot = path.IndexOf(\".\", StringComparison.InvariantCulture);\n                        if (dot != -1) path = path.Substring(dot + 1);\n\n                        // remove if already exists on clone\n                        var jProperty = clone.Property(path);\n                        if (jProperty != null) jProperty.Remove();\n\n                        var value = (token is JProperty ? ((JProperty)token).Value : token).ToString();\n                        clone.Add(path, value);\n                    }\n                }\n            }\n\n            // remove all environments\n            var environmentsProperty = clone.Property(\"environments\");\n            environmentsProperty?.Remove();\n\n            return clone;\n        }\n\n        private static JToken GetToken(JToken settings, string key)\n        {\n            return GetToken(settings, key, settings.SelectToken(key));\n        }\n\n        private static JToken GetToken(JToken settings, string key, JToken current)\n        {\n            var environmentSetting = settings.SelectToken(\"environment\");\n            if (environmentSetting != null)\n            {\n                var environmentSettingValue = environmentSetting.Value<string>();\n                if (!string.IsNullOrWhiteSpace(environmentSettingValue))\n                {\n                    var environment = settings.SelectToken(\"environments.\" + environmentSettingValue);\n                    if (environment != null)\n                    {\n                        var setting = environment.SelectToken(key);\n                        if (setting != null)\n                        {\n                            current = setting;\n                        }\n                        // allows nesting of environments, live.tradier, live.interactive, ect...\n                        return GetToken(environment, key, current);\n                    }\n                }\n            }\n            if (current == null)\n            {\n                return settings.SelectToken(key);\n            }\n            return current;\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/LeanArgumentParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Command Line arguments parser for Lean configuration\n    /// </summary>\n    public static class LeanArgumentParser\n    {\n        private const string ApplicationName = \"Lean Platform\";\n\n        private const string ApplicationDescription =\n            \"Lean Engine is an open-source algorithmic trading engine built for easy strategy research, backtesting and live trading. We integrate with common data providers and brokerages so you can quickly deploy algorithmic trading strategies.\";\n\n        private const string ApplicationHelpText =\n            \"If you are looking for help, please go to https://www.quantconnect.com/lean/docs\";\n\n        private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n            {\n                // the location of the configuration to use\n                new CommandLineOption(\"config\", CommandOptionType.SingleValue),\n\n                // true will close lean console automatically without waiting for input\n                new CommandLineOption(\"close-automatically\", CommandOptionType.SingleValue),\n\n                // the result destination folder this algorithm should use for logging and result.json\n                new CommandLineOption(\"results-destination-folder\", CommandOptionType.SingleValue),\n\n                // the algorithm name\n                new CommandLineOption(\"backtest-name\", CommandOptionType.SingleValue),\n\n                // the unique algorithm id\n                new CommandLineOption(\"algorithm-id\", CommandOptionType.SingleValue),\n\n                // the unique optimization id\n                new CommandLineOption(\"optimization-id\", CommandOptionType.SingleValue),\n\n                // Options grabbed from json file\n                new CommandLineOption(\"environment\", CommandOptionType.SingleValue),\n\n                // algorithm class selector\n                new CommandLineOption(\"algorithm-type-name\", CommandOptionType.SingleValue),\n\n                // Algorithm language selector - options CSharp, Python\n                new CommandLineOption(\"algorithm-language\", CommandOptionType.SingleValue),\n\n                //Physical DLL location\n                new CommandLineOption(\"algorithm-location\", CommandOptionType.SingleValue),\n\n                //Research notebook\n                new CommandLineOption(\"composer-dll-directory\", CommandOptionType.SingleValue),\n\n                // engine\n                new CommandLineOption(\"data-folder\", CommandOptionType.SingleValue),\n\n                // handlers\n                new CommandLineOption(\"log-handler\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"messaging-handler\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"job-queue-handler\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"api-handler\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"map-file-provider\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"factor-file-provider\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"data-provider\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"alpha-handler\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"history-provider\", CommandOptionType.SingleValue),\n\n                // limits on number of symbols to allow\n                new CommandLineOption(\"symbol-minute-limit\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"symbol-second-limit\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"symbol-tick-limit\", CommandOptionType.SingleValue),\n\n                // if one uses true in following token, market hours will remain open all hours and all days.\n                // if one uses false will make lean operate only during regular market hours.\n                new CommandLineOption(\"force-exchange-always-open\", CommandOptionType.NoValue),\n\n                // save list of transactions to the specified csv file\n                new CommandLineOption(\"transaction-log\", CommandOptionType.SingleValue),\n\n                // To get your api access token go to quantconnect.com/account\n                new CommandLineOption(\"job-user-id\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"api-access-token\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"job-organization-id\", CommandOptionType.SingleValue),\n\n                // live data configuration\n                new CommandLineOption(\"live-data-url\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"live-data-port\", CommandOptionType.SingleValue),\n\n                // interactive brokers configuration\n                new CommandLineOption(\"ib-account\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-user-name\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-password\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-host\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-port\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-agent-description\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-tws-dir\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"ib-trading-mode\", CommandOptionType.SingleValue),\n\n                // tradier configuration\n                new CommandLineOption(\"tradier-account-id\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"tradier-access-token\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"tradier-refresh-token\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"tradier-issued-at\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"tradier-lifespan\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"tradier-refresh-session\", CommandOptionType.NoValue),\n\n                // oanda configuration\n                new CommandLineOption(\"oanda-environment\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"oanda-access-token\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"oanda-account-id\", CommandOptionType.SingleValue),\n\n                // fxcm configuration\n                new CommandLineOption(\"fxcm-server\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"fxcm-terminal\", CommandOptionType.SingleValue), //Real or Demo\n                new CommandLineOption(\"fxcm-user-name\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"fxcm-password\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"fxcm-account-id\", CommandOptionType.SingleValue),\n\n                // coinbase configuration\n                new CommandLineOption(\"coinbase-rest-api\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"coinbase-url\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"coinbase-api-key\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"coinbase-api-secret\", CommandOptionType.SingleValue),\n\n                // Required to access data from Quandl\n                // To get your access token go to https://www.quandl.com/account/api\n                new CommandLineOption(\"quandl-auth-token\", CommandOptionType.SingleValue),\n\n                // parameters to set in the algorithm (the below are just samples)\n                new CommandLineOption(\"parameters\", CommandOptionType.MultipleValue),\n                new CommandLineOption(\"environments\", CommandOptionType.MultipleValue)\n            };\n\n        /// <summary>\n        /// Argument parser contructor\n        /// </summary>\n        public static Dictionary<string, object> ParseArguments(string[] args)\n        {\n            return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/OptimizerArgumentParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Command Line arguments parser for Lean Optimizer\n    /// </summary>\n    public static class OptimizerArgumentParser\n    {\n        private const string ApplicationName = \"Lean Optimizer\";\n\n        private const string ApplicationDescription = \"Lean Optimizer is a strategy optimization engine for algorithms.\";\n\n        private const string ApplicationHelpText = \"If you are looking for help, please go to https://www.quantconnect.com/lean/docs\";\n\n        private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n            {\n                new CommandLineOption(\"estimate\", CommandOptionType.NoValue, \"Estimate the optimization run time\")\n            };\n\n        /// <summary>\n        /// Parse and construct the args\n        /// </summary>\n        public static Dictionary<string, object> ParseArguments(string[] args)\n        {\n            return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Configuration\")]\n[assembly: AssemblyProduct(\"QuantConnect.Configuration\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"1339b429-9256-4d54-abf5-d30112a484db\")]"
  },
  {
    "path": "Configuration/QuantConnect.Configuration.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Configuration</RootNamespace>\n    <AssemblyName>QuantConnect.Configuration</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <RestorePackages>true</RestorePackages>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Configuration.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Configuration Project - The Config and argument parser implementation</Description>\n    <NoWarn>CA1062</NoWarn>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"McMaster.Extensions.CommandLineUtils\" Version=\"2.6.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Configuration/ReportArgumentParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Command Line arguments parser for Report Creator\n    /// </summary>\n    public static class ReportArgumentParser\n    {\n        private const string ApplicationName = \"Report Creator\";\n\n        private const string ApplicationDescription =\n            \"LEAN Report Creator generates beautiful PDF reports from your backtesting strategies for sharing with prospective partners.\";\n\n        private const string ApplicationHelpText =\n            \"If you are looking for help, please go to https://www.quantconnect.com/docs\";\n\n        private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n            {\n                new CommandLineOption(\"close-automatically\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"data-folder\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"strategy-name\", CommandOptionType.SingleValue, \"Strategy name\"),\n                new CommandLineOption(\"strategy-description\", CommandOptionType.SingleValue, \"Strategy description\"),\n                new CommandLineOption(\"live-data-source-file\", CommandOptionType.SingleValue, \"Live source data json file\"),\n                new CommandLineOption(\"backtest-data-source-file\", CommandOptionType.SingleValue, \"Backtest source data json file\"),\n                new CommandLineOption(\"report-destination\", CommandOptionType.SingleValue, \"Destination of processed report file\"),\n                new CommandLineOption(\"report-css-override-file\", CommandOptionType.SingleValue, \"CSS override source file\"),\n                new CommandLineOption(\"report-html-custom-file\", CommandOptionType.SingleValue, \"Custom HTML source file\"),\n                new CommandLineOption(\"python-venv\", CommandOptionType.SingleValue, \"Python virtual environment path\"),\n            };\n\n        /// <summary>\n        /// Parse and construct the args.\n        /// </summary>\n        public static Dictionary<string, object> ParseArguments(string[] args)\n        {\n            return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);\n        }\n    }\n}\n"
  },
  {
    "path": "Configuration/ToolboxArgumentParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing McMaster.Extensions.CommandLineUtils;\n\nnamespace QuantConnect.Configuration\n{\n    /// <summary>\n    /// Command Line arguments parser for Toolbox configuration\n    /// </summary>\n    public static class ToolboxArgumentParser\n    {\n        private const string ApplicationName = \"QuantConnect.ToolBox.exe\";\n        private const string ApplicationDescription = \"Lean Engine ToolBox\";\n        private const string ApplicationHelpText = \"\\nThe ToolBox is a wrapper of >15 tools. \"\n                                                   + \"Each require a different set of parameters. Example: --app=RandomDataGenerator --tickers=\"\n                                                   + \"SPY,AAPL --resolution=Daily --from-date=yyyyMMdd-HH:mm:ss --to-date=yyyyMMdd-HH:mm:ss\";\n        private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n            {\n                new CommandLineOption(\"app\", CommandOptionType.SingleValue,\n                                                     \"[REQUIRED] Target tool, CASE INSENSITIVE: GDAXDownloader or GDAXDL\"\n                                                     + \"/GoogleDownloader or GDL/IBDownloader or IBDL\"\n                                                     + \"/AlgoSeekFuturesConverter or ASFC\"\n                                                     + \"/KaikoDataConverter or KDC\"\n                                                     + \"/CoarseUniverseGenerator or CUG/\\n\"\n                                                     + \"RandomDataGenerator or RDG\\n\"\n                                                     + \"Example 1: --app=RDG\"),\n                new CommandLineOption(\"tickers\", CommandOptionType.MultipleValue, \"[REQUIRED ALL downloaders] \"\n                                                                                  + \"--tickers=SPY,AAPL,etc\"),\n                new CommandLineOption(\"resolution\", CommandOptionType.SingleValue, \"[REQUIRED ALL downloaders]\"\n                                                                                   + \" *Not all downloaders support all resolutions. Send empty for more information.*\"\n                                                                                   + \" CASE SENSITIVE: --resolution=Tick/Second/Minute/Hour/Daily/All\" +Environment.NewLine+\n                                                                                   \"[OPTIONAL for RandomDataGenerator - same format as downloaders, Options only support Minute\"),\n                new CommandLineOption(\"from-date\", CommandOptionType.SingleValue, \"[REQUIRED ALL downloaders] --from-date=yyyyMMdd-HH:mm:ss\"),\n                new CommandLineOption(\"to-date\", CommandOptionType.SingleValue, \"[OPTIONAL for downloaders] If not provided 'DateTime.UtcNow' will \"\n                                                                                + \"be used. --to-date=yyyyMMdd-HH:mm:ss\"),\n                new CommandLineOption(\"exchange\", CommandOptionType.SingleValue, \"[Optional for KaikoDataConverter] The exchange to process, if not defined, all exchanges will be processed.\"),\n                new CommandLineOption(\"date\", CommandOptionType.SingleValue, \"[REQUIRED for AlgoSeekFuturesConverter, AlgoSeekOptionsConverter, KaikoDataConverter]\"\n                                                                             + \"Date for the option bz files: --date=yyyyMMdd\"),\n                new CommandLineOption(\"source-dir\", CommandOptionType.SingleValue, \"[REQUIRED for KaikoDataConverter,\"),\n                new CommandLineOption(\"destination-dir\", CommandOptionType.SingleValue, \"[REQUIRED for RandomDataGenerator]\"),\n                new CommandLineOption(\"start\", CommandOptionType.SingleValue, \"[REQUIRED for RandomDataGenerator. Format yyyyMMdd Example: --start=20010101]\"),\n                new CommandLineOption(\"end\", CommandOptionType.SingleValue, \"[REQUIRED for RandomDataGenerator. Format yyyyMMdd Example: --end=20020101]\"),\n                new CommandLineOption(\"market\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Market of generated symbols. Defaults to default market for security type: Example: --market=usa]\"),\n                new CommandLineOption(\"symbol-count\", CommandOptionType.SingleValue, \"[REQUIRED for RandomDataGenerator. Number of symbols to generate data for: Example: --symbol-count=10]\"),\n                new CommandLineOption(\"security-type\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Security type of generated symbols, defaults to Equity: Example: --security-type=Equity/Option/Forex/Future/Cfd/Crypto]\"),\n                new CommandLineOption(\"data-density\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Defaults to Dense. Valid values: --data-density=Dense/Sparse/VerySparse ]\"),\n                new CommandLineOption(\"include-coarse\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Only used for Equity, defaults to true: Example: --include-coarse=true]\"),\n                new CommandLineOption(\"quote-trade-ratio\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the ratio of generated quotes to generated trades. Values larger than 1 mean more quotes than trades. Only used for Option, Future and Crypto, defaults to 1: Example: --quote-trade-ratio=1.75 ]\"),\n                new CommandLineOption(\"random-seed\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the random number generator seed. Defaults to null (random seed). Example: --random-seed=11399 ]\"),\n                new CommandLineOption(\"ipo-percentage\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the probability each equity generated will have an IPO event. Note that this is not the total probability for all symbols generated. Only used for Equity. Defaults to 5.0: Example: --ipo-percentage=43.25 ]\"),\n                new CommandLineOption(\"rename-percentage\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the probability each equity generated will have a rename event. Note that this is not the total probability for all symbols generated. Only used for Equity. Defaults to 30.0: Example: --rename-percentage=20.0 ]\"),\n                new CommandLineOption(\"splits-percentage\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the probability each equity generated will have a stock split event. Note that this is not the total probability for all symbols generated. Only used for Equity. Defaults to 15.0: Example: --splits-percentage=10.0 ]\"),\n                new CommandLineOption(\"dividends-percentage\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the probability each equity generated will have dividends. Note that this is not the probability for all symbols genearted. Only used for Equity. Defaults to 60.0: Example: --dividends-percentage=25.5 ]\"),\n                new CommandLineOption(\"dividend-every-quarter-percentage\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the probability each equity generated will have a dividend event every quarter. Note that this is not the total probability for all symbols generated. Only used for Equity. Defaults to 30.0: Example: --dividend-every-quarter-percentage=15.0 ]\"),\n                new CommandLineOption(\"option-price-engine\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the stochastic process, and returns new pricing engine to run calculations for that option. Defaults to BaroneAdesiWhaleyApproximationEngine: Example: --option-price-engine=BaroneAdesiWhaleyApproximationEngine ]\"),\n                new CommandLineOption(\"volatility-model-resolution\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the volatility model period span. Defaults to Daily: Example: --volatility-model-resolution=Daily ]\"),\n                new CommandLineOption(\"chain-symbol-count\", CommandOptionType.SingleValue, \"[OPTIONAL for RandomDataGenerator. Sets the size of the option chain. Defaults to 1 put and 1 call: Example: --chain-symbol-count=2 ]\")\n            };\n\n        /// <summary>\n        /// Argument parser contructor\n        /// </summary>\n        public static Dictionary<string, object> ParseArguments(string[] args)\n        {\n            return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);\n        }\n\n        /// <summary>\n        /// Helper method to get the tickers from the provided options\n        /// </summary>\n        public static List<string> GetTickers(Dictionary<string, object> optionsObject)\n        {\n            return optionsObject.ContainsKey(\"tickers\")\n                ? (optionsObject[\"tickers\"] as Dictionary<string, string>)?.Keys.ToList()\n                : new List<string>();\n        }\n    }\n}\n"
  },
  {
    "path": "Dockerfile",
    "content": "#\n#   LEAN Docker Container 20200522\n#   Cross platform deployment for multiple brokerages\n#\n\n# Use base system\nFROM quantconnect/lean:foundation\n\nMAINTAINER QuantConnect <contact@quantconnect.com>\n\n#Install debugpy and PyDevD for remote python debugging\nRUN pip install --no-cache-dir ptvsd==4.3.2 debugpy~=1.6.7 pydevd-pycharm~=231.9225.15\n\n# Install vsdbg for remote C# debugging in Visual Studio and Visual Studio Code\nRUN wget https://aka.ms/getvsdbgsh -O - 2>/dev/null | /bin/sh /dev/stdin -v 17.10.20209.7 -l /root/vsdbg\n\nCOPY ./DataLibraries /Lean/Launcher/bin/Debug/\nCOPY ./Lean/Data/ /Lean/Data/\nCOPY ./Lean/Launcher/bin/Debug/ /Lean/Launcher/bin/Debug/\nCOPY ./Lean/Optimizer.Launcher/bin/Debug/ /Lean/Optimizer.Launcher/bin/Debug/\nCOPY ./Lean/Report/bin/Debug/ /Lean/Report/bin/Debug/\nCOPY ./Lean/DownloaderDataProvider/bin/Debug/ /Lean/DownloaderDataProvider/bin/Debug/\n\n# Can override with '-w'\nWORKDIR /Lean/Launcher/bin/Debug\n\nENTRYPOINT [ \"dotnet\", \"QuantConnect.Lean.Launcher.dll\" ]\n"
  },
  {
    "path": "DockerfileJupyter",
    "content": "#\n#    LEAN Jupyter Docker Container 20190428\n#\n\n# Use base system for cleaning up wayward processes\nARG LEAN_TAG=latest\nFROM quantconnect/lean:$LEAN_TAG\n\nMAINTAINER QuantConnect <contact@quantconnect.com>\n\n# Install Tini\nRUN if [ \"$(uname -m)\" = \"aarch64\" ]; then \\\n        tini_binary=\"tini-arm64\"; \\\n        tini_sha256=\"07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81\"; \\\n    else \\\n        tini_binary=\"tini-amd64\"; \\\n        tini_sha256=\"93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c\"; \\\n    fi && \\\n    wget --quiet -O tini \"https://github.com/krallin/tini/releases/download/v0.19.0/${tini_binary}\" && \\\n    echo \"${tini_sha256} *tini\" | sha256sum -c - && \\\n    mv tini /usr/local/bin/tini && \\\n    chmod +x /usr/local/bin/tini\n\n# Install clr-loader for PythonNet\nRUN pip install --no-cache-dir clr-loader==0.2.9\n\n# Install .NET Interactive to support C# in Jupyter notebooks\nENV PATH=\"${PATH}:/root/.dotnet/tools\"\nRUN dotnet tool install -g --no-cache --version 1.0.661703 --add-source \"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json\" Microsoft.dotnet-interactive && \\\n    dotnet interactive jupyter install\n\n# Setting some environment variables\nENV WORK /Lean/Launcher/bin/Debug/\nENV PYTHONPATH=${WORK}:${PYTHONPATH}\n\n# Link Python startup file to profile\nRUN mkdir -p /root/.ipython/profile_default/startup/ && \\\n    ln -s /Lean/Launcher/bin/Debug/start.py /root/.ipython/profile_default/startup/start.py\n\nRUN find ${WORK} -type f -not -name '*.py*' -not -name '*.xml' -not -name '*.exe.config' -not -name '*.exe' -not -name '*.so' -not -name '*.dll' -not -name '*.ipynb' -not -name '*.csx' -not -name 'QuantConnect.Lean.Launcher.runtimeconfig.json' -not -name 'decimal.py' -delete\n\n# Create initialize script\nRUN echo \"if [ ! -d \\\"${WORK}Notebooks\\\" ]; then mkdir ${WORK}Notebooks; fi && \\\n    if [ ! -f \\\"${WORK}Notebooks/config.json\\\" ]; then echo '{ \\\"data-folder\\\": \\\"/home/Data/\\\", \\\n    \\\"composer-dll-directory\\\": \\\"$WORK\\\", \\\"algorithm-language\\\": \\\"Python\\\", \\\n    \\\"messaging-handler\\\": \\\"QuantConnect.Messaging.Messaging\\\", \\\"job-queue-handler\\\": \\\"QuantConnect.Queues.JobQueue\\\", \\\n    \\\"api-handler\\\": \\\"QuantConnect.Api.Api\\\" }' > ${WORK}Notebooks/config.json; fi && \\\n    echo \\\"Starting JupyterLab, access in your browser at localhost:8888\\\" && \\\n    jupyter lab --ip='0.0.0.0' --port=8888 --no-browser --allow-root --notebook-dir=\\\"Notebooks\\\" --LabApp.token='' \" \\\n    > start.sh\n\nRUN echo \"{\\\"argv\\\":[\\\"dotnet\\\",\\\"interactive\\\",\\\"jupyter\\\",\\\"--default-kernel\\\",\\\"csharp\\\",\\\"{connection_file}\\\",\\\"--http-port-range\\\",\\\"1000-3000\\\"],\\\"display_name\\\":\\\"Foundation-C#-Default\\\",\\\"language\\\":\\\"C#\\\",\\\"metadata\\\":{\\\"vscode\\\":{\\\"extension_id\\\":\\\"ms-dotnettools.dotnet-interactive-vscode\\\",\\\"kernel_id\\\":\\\"dotnet-interactive\\\"}}}\" > /root/.local/share/jupyter/kernels/.net-csharp/kernel.json\n\nRUN chmod -R 777 ${WORK}\nEXPOSE 8888\nWORKDIR $WORK\n\nENTRYPOINT [ \"/usr/local/bin/tini\", \"--\" ]\nCMD ./start.sh\n"
  },
  {
    "path": "DockerfileLeanFoundation",
    "content": "#\n#   LEAN Foundation Docker Container\n#   Cross platform deployment for multiple brokerages\n#   Intended to be used in conjunction with Dockerfile. This is just the foundation common OS+Dependencies required.\n#\n\n# Use base system for cleaning up wayward processes\nFROM phusion/baseimage:jammy-1.0.1\n\nMAINTAINER QuantConnect <contact@quantconnect.com>\n\n# Use baseimage-docker's init system.\nCMD [\"/sbin/my_init\"]\n\n# Install OS Packages:\n# Misc tools for running Python.NET and IB inside a headless container.\nRUN apt-get update && apt-get -y install wget curl unzip \\\n   && apt-get install -y git bzip2 zlib1g-dev \\\n   xvfb libxrender1 libxtst6 libxi6 libglib2.0-dev libopenmpi-dev libstdc++6 openmpi-bin \\\n   pandoc libcurl4-openssl-dev libgtk2.0.0 build-essential \\\n   # for pyomo solver\n   liblapack-dev \\\n   && apt-get clean && apt-get autoclean && apt-get autoremove --purge -y \\\n   && rm -rf /var/lib/apt/lists/*\n\n# Set PythonDLL variable for PythonNet\nENV PYTHONNET_PYDLL=\"/opt/miniconda3/lib/libpython3.11.so\"\n\n# Install miniconda\nENV CONDA=\"Miniconda3-py311_24.9.2-0-Linux-x86_64.sh\"\nENV PATH=\"/opt/miniconda3/bin:${PATH}\"\nRUN wget -q https://cdn.quantconnect.com/miniconda/${CONDA} && \\\n    bash ${CONDA} -b -p /opt/miniconda3 && rm -rf ${CONDA} && \\\n    conda config --set solver classic && \\\n    conda config --set auto_update_conda false\n\n# Install java runtime for h2o lib\nRUN wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.deb \\\n    && dpkg -i jdk-17.0.12_linux-x64_bin.deb \\\n    && update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-17.0.12-oracle-x64/bin/java 1 \\\n    && rm jdk-17.0.12_linux-x64_bin.deb\n\n# Avoid pip install read timeouts\nENV PIP_DEFAULT_TIMEOUT=120\n\n# Install all packages\nRUN pip install --no-cache-dir      \\\n    cython==3.2.3                   \\\n    pandas==2.3.3                   \\\n    scipy==1.13.1                   \\\n    numpy==1.26.4                   \\\n    wrapt==1.17.3                   \\\n    astropy==7.2.0                  \\\n    beautifulsoup4==4.14.3          \\\n    dill==0.3.8                     \\\n    jsonschema==4.25.1              \\\n    lxml==6.0.2                     \\\n    msgpack==1.1.2                  \\\n    numba-cuda[cu12]==0.14.1        \\\n    numba==0.61.2                   \\\n    xarray==2025.12.0               \\\n    plotly==5.24.1                  \\\n    jupyterlab==4.5.1               \\\n    ipywidgets==8.1.8               \\\n    jupyterlab-widgets==3.0.16      \\\n    tensorflow==2.19.1              \\\n    docutils==0.22.4                \\\n    cvxopt==1.3.2                   \\\n    gensim==4.4.0                   \\\n    keras==3.13.0                   \\\n    lightgbm==4.6.0                 \\\n    nltk==3.9.2                     \\\n    graphviz==0.21                  \\\n    cmdstanpy==1.3.0                \\\n    copulae==0.7.9                  \\\n    featuretools==1.31.0            \\\n    PuLP==3.3.0                     \\\n    pymc==5.25.1                    \\\n    rauth==0.7.3                    \\\n    scikit-learn==1.6.1             \\\n    scikit-optimize==0.10.2         \\\n    tsfresh==0.20.2                 \\\n    tslearn==0.7.0                  \\\n    tweepy==4.16.0                  \\\n    PyWavelets==1.9.0               \\\n    umap-learn==0.5.9.post2         \\\n    fastai==2.8.6                   \\\n    arch==8.0.0                     \\\n    copulas==0.12.3                 \\\n    creme==0.6.1                    \\\n    cufflinks==0.17.3               \\\n    gym==0.26.2                     \\\n    deap==1.4.3                     \\\n    pykalman==0.11.0                \\\n    cvxpy==1.7.5                    \\\n    pyportfolioopt==1.5.6           \\\n    pmdarima==2.1.1                 \\\n    pyro-ppl==1.9.1                 \\\n    riskparityportfolio==0.6.0      \\\n    sklearn-json==0.1.0             \\\n    statsmodels==0.14.6             \\\n    QuantLib==1.40                  \\\n    xgboost==3.0.5                  \\\n    dtw-python==1.5.3               \\\n    gluonts==0.16.2                 \\\n    jax==0.7.1                      \\\n    jaxlib==0.7.1                   \\\n    tf2jax==0.3.7                   \\\n    keras-rl==0.4.2                 \\\n    pennylane==0.43.1               \\\n    PennyLane-Lightning==0.43.0     \\\n    PennyLane-qiskit==0.43.0        \\\n    autoray==0.8.0                  \\\n    qiskit==2.1.2                   \\\n    mplfinance==0.12.10b0           \\\n    hmmlearn==0.3.3                 \\\n    catboost==1.2.8                 \\\n    fastai2==0.0.30                 \\\n    scikit-tda==1.1.1               \\\n    ta==0.11.0                      \\\n    seaborn==0.13.2                 \\\n    optuna==4.6.0                   \\\n    findiff==0.12.2                 \\\n    sktime==0.40.1                  \\\n    hyperopt==0.2.7                 \\\n    bayesian-optimization==3.1.0    \\\n    pingouin==0.5.5                 \\\n    quantecon==0.10.1               \\\n    matplotlib==3.8.4               \\\n    sdeint==0.3.0                   \\\n    pandas_market_calendars==5.2.2  \\\n    dgl==2.1.0                      \\\n    ruptures==1.1.10                \\\n    simpy==4.1.1                    \\\n    scikit-learn-extra==0.3.0       \\\n    ray==2.53.0                     \\\n    \"ray[tune]\"==2.53.0             \\\n    \"ray[rllib]\"==2.53.0            \\\n    \"ray[data]\"==2.53.0             \\\n    \"ray[train]\"==2.53.0            \\\n    fastText==0.9.3                 \\\n    h2o==3.46.0.9                   \\\n    prophet==1.2.1                  \\\n    torch==2.8.0                    \\\n    torchvision==0.23.0             \\\n    ax-platform==1.2.1              \\\n    alphalens-reloaded==0.4.6       \\\n    pyfolio-reloaded==0.9.9         \\\n    altair==6.0.0                   \\\n    modin==0.37.1                   \\\n    persim==0.3.8                   \\\n    ripser==0.6.14                  \\\n    pydmd==2025.8.1                 \\\n    spacy==3.8.11                   \\\n    pytorch-ignite==0.5.3           \\\n    tensorly==0.9.0                 \\\n    mlxtend==0.23.4                 \\\n    shap==0.48.0                    \\\n    lime==0.2.0.1                   \\\n    tensorflow-probability==0.25.0  \\\n    mpmath==1.3.0                   \\\n    tensortrade==1.0.3              \\\n    polars==1.36.1                  \\\n    stockstats==0.6.5               \\\n    autokeras==3.0.0                \\\n    QuantStats==0.0.77              \\\n    hurst==0.0.5                    \\\n    numerapi==2.21.0                \\\n    pymdptoolbox==4.0-b3            \\\n    panel==1.7.5                    \\\n    hvplot==0.12.2                  \\\n    line-profiler==5.0.0            \\\n    py-heat==0.0.6                  \\\n    py-heat-magic==0.0.2            \\\n    bokeh==3.6.3                    \\\n    river==0.21.0                   \\\n    stumpy==1.13.0                  \\\n    pyvinecopulib==0.6.5            \\\n    ijson==3.4.0.post0              \\\n    jupyter-resource-usage==1.2.0   \\\n    injector==0.23.0                \\\n    openpyxl==3.1.5                 \\\n    xlrd==2.0.2                     \\\n    mljar-supervised==1.1.18        \\\n    dm-tree==0.1.9                  \\\n    lz4==4.4.5                      \\\n    ortools==9.12.4544              \\\n    py_vollib==1.0.1                \\\n    thundergbm==0.3.17              \\\n    yellowbrick==1.5                \\\n    livelossplot==0.5.6             \\\n    gymnasium==1.1.1                \\\n    interpret==0.7.2                \\\n    DoubleML==0.10.1                \\\n    jupyter-bokeh==4.0.5            \\\n    imbalanced-learn==0.14.1        \\\n    openai==2.14.0                  \\\n    lazypredict==0.2.16             \\\n    darts==0.39.0                   \\\n    fastparquet==2025.12.0          \\\n    tables==3.10.2                  \\\n    dimod==0.12.21                  \\\n    dwave-samplers==1.7.0           \\\n    python-statemachine==2.5.0      \\\n    pymannkendall==1.4.3            \\\n    Pyomo==6.9.5                    \\\n    gpflow==2.10.0                  \\\n    pyarrow==19.0.1                 \\\n    dwave-ocean-sdk==9.2.0          \\\n    chardet==5.2.0                  \\\n    stable-baselines3==2.7.1        \\\n    sb3-contrib==2.7.1              \\\n    Shimmy==2.0.0                   \\\n    pystan==3.10.0                  \\\n    FixedEffectModel==0.0.5         \\\n    transformers==4.57.3            \\\n    Rbeast==0.1.23                  \\\n    langchain==0.3.27               \\\n    pomegranate==1.1.2              \\\n    MAPIE==1.2.0                    \\\n    mlforecast==1.0.2               \\\n    tensorrt==10.14.1.48.post1      \\\n    x-transformers==2.11.24         \\\n    Werkzeug==3.1.4                 \\\n    TPOT==0.12.2                    \\\n    mlflow==3.4.0                   \\\n    ngboost==0.5.6                  \\\n    control==0.10.2                 \\\n    pgmpy==1.0.0                    \\\n    mgarch==0.3.0                   \\\n    jupyter-ai==2.31.7              \\\n    keras-tcn==3.5.6                \\\n    neuralprophet[live]==0.9.0      \\\n    Riskfolio-Lib==7.0.1            \\\n    fuzzy-c-means==1.7.2            \\\n    EMD-signal==1.9.0               \\\n    dask[complete]==2025.7.0        \\\n    nolds==0.6.2                    \\\n    feature-engine==1.9.3           \\\n    pytorch-tabnet==4.1.0           \\\n    opencv-contrib-python-headless==4.11.0.86 \\\n    POT==0.9.6.post1                \\\n    datasets==3.6.0                 \\\n    scikeras==0.13.0                \\\n    accelerate==1.12.0              \\\n    peft==0.18.0                    \\\n    FlagEmbedding==1.3.5            \\\n    contourpy==1.3.3                \\\n    tensorboardX==2.6.4             \\\n    scikit-image==0.22.0            \\\n    scs==3.2.9                      \\\n    thinc==8.3.4                    \\\n    cesium==0.12.1                  \\\n    cvxportfolio==1.5.1             \\\n    tsfel==0.2.0                    \\\n    ipympl==0.9.8                   \\\n    PyQt6==6.9.1                    \\\n    nixtla==0.7.2                   \\\n    tigramite==5.2.9.4              \\\n    pytorch-forecasting==1.5.0      \\\n    chronos-forecasting==2.2.2      \\\n    setuptools==80.9.0              \\\n    tinygrad==0.11.0                \\\n    DESlib==0.3.7                   \\\n    torchrl==0.10.1                 \\\n    tensordict==0.10.0              \\\n    onnx==1.20.0                    \\\n    onnxmltools==1.14.0             \\\n    onnxruntime==1.23.2             \\\n    skl2onnx==1.19.1                \\\n    sweetviz==2.3.1                 \\\n    filterpy==1.4.5                 \\\n    skfolio==0.7.0                  \\\n    lightweight-charts==2.1         \\\n    KDEpy==1.1.12                   \\\n    lightning==2.6.0                \\\n    google-genai==1.56.0            \\\n    neuralforecast==3.1.2           \\\n    lingam==1.12.1                  \\\n    econml==0.16.0                  \\\n    networkx==3.6.1                 \\\n    causalml==0.15.5                \\\n    transitions==0.9.3              \\\n    sismic==1.6.11                  \\\n    cmaes==0.12.0                   \\\n    cuda-python==12.9.5             \\\n    click==8.2.1                    \\\n    ydf==0.13.0                     \\\n    wurlitzer==3.1.1                \\\n    statsforecast==2.0.3            \\\n    holoviews==1.20.2               \\\n    faiss-cpu==1.13.1               \\\n    ImageIO==2.37.2                 \\\n    lifelines==0.30.0               \\\n    h5py==3.15.1                    \\\n    exchange_calendars==4.11.1      \\\n    formulaic==1.2.1                \\\n    arviz==0.23.0                   \\\n    deprecated==1.2.18              \\\n    pyod==2.0.6\n\n# llama-index-readers-file has a pandas build contraint, see https://github.com/run-llama/llama_index/pull/20387/files\nRUN pip install --no-cache-dir --no-deps \\\n    aiosqlite==0.22.0               \\\n    banks==2.2.0                    \\\n    deprecated==1.2.18              \\\n    dirtyjson==1.0.8                \\\n    filetype==1.2.0                 \\\n    griffe==1.15.0                  \\\n    llama-parse==0.6.54             \\\n    llama-cloud==0.1.35             \\\n    llama-index==0.14.10            \\\n    llama-index-cli==0.5.3          \\\n    llama-index-core==0.14.10       \\\n    llama-cloud-services==0.6.54    \\\n    llama-index-workflows==2.11.5   \\\n    llama-index-llms-openai==0.6.12 \\\n    llama-index-readers-file==0.5.5 \\\n    llama-index-instrumentation==0.4.2 \\\n    llama-index-embeddings-openai==0.5.1 \\\n    llama-index-readers-llama-parse==0.5.1 \\\n    llama-index-indices-managed-llama-cloud==0.9.4 \\\n    pypdf==6.5.0                    \\\n    striprtf==0.0.26                \\\n    tiktoken==0.12.0\n\n# they have older dependency versions that can be ignored\n# https://github.com/onnx/tensorflow-onnx/issues/2328#issuecomment-2682046428\nRUN pip install --no-cache-dir --no-dependencies tf2onnx==1.16.1 tensorflow-decision-forests==1.12.0\n\nRUN conda install -c nvidia -y cuda-compiler=12.8.1 && conda clean -y --all\n\n# for aesara\nENV MKL_THREADING_LAYER=GNU\nENV CUDA_MODULE_LOADING=LAZY\nENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/opt/miniconda3/\nENV LD_LIBRARY_PATH=/opt/miniconda3/lib/python3.11/site-packages/nvidia/nvjitlink/lib/:/opt/miniconda3/lib/python3.11/site-packages/nvidia/cuda_nvrtc/lib/:$LD_LIBRARY_PATH\n# reduces GPU memory usage\nENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True\n\n# required for numba to work correctly\nRUN ln -s /opt/miniconda3/lib/python3.11/site-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so.12 /opt/miniconda3/lib/python3.11/site-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so\n\n# iisignature requires numpy to be already installed. cupy requires cuda installed\n# https://github.com/omadson/fuzzy-c-means/issues/109 requires older tabulate but pandas requires 0.9.0, forcing version\nRUN pip install --no-cache-dir tabulate==0.9.0 iisignature==0.24 cupy-cuda12x==13.6.0 https://github.com/state-spaces/mamba/releases/download/v2.2.5/mamba_ssm-2.2.5+cu12torch2.8cxx11abiTRUE-cp311-cp311-linux_x86_64.whl https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.5.4/causal_conv1d-1.5.4+cu12torch2.8cxx11abiTRUE-cp311-cp311-linux_x86_64.whl\n\n# Install dwave tool\nRUN dwave install --all -y\n\n# Install 'ipopt' solver for 'Pyomo'\nRUN conda install -c conda-forge -y ipopt==3.14.19 coincbc==2.10.12 openmpi=5.0.8    \\\n    && conda clean -y --all\n\n# Install spacy models\nRUN python -m spacy download en_core_web_md && python -m spacy download en_core_web_sm\n\n# Install PyTorch Geometric\nRUN TORCH=$(python -c \"import torch; print(torch.__version__)\") && \\\n    CUDA=$(python -c \"import torch; print('cu' + torch.version.cuda.replace('.', ''))\") && \\\n    pip install --no-cache-dir -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html \\\n    torch-scatter==2.1.2 torch-sparse==0.6.18 torch-cluster==1.6.3 torch-spline-conv==1.2.2 torch-geometric==2.6.1\n\n# Install nltk data\nRUN python -m nltk.downloader -d /usr/share/nltk_data punkt && \\\n    python -m nltk.downloader -d /usr/share/nltk_data punkt_tab && \\\n    python -m nltk.downloader -d /usr/share/nltk_data vader_lexicon && \\\n    python -m nltk.downloader -d /usr/share/nltk_data stopwords && \\\n    python -m nltk.downloader -d /usr/share/nltk_data wordnet\n\n# Install Pyrb\nRUN wget -q https://cdn.quantconnect.com/pyrb/pyrb-master-250054e.zip && \\\n    unzip -q pyrb-master-250054e.zip && cd pyrb-master && \\\n    pip install . && cd .. && rm -rf pyrb-master && rm pyrb-master-250054e.zip\n\n# Install SSM\nRUN wget -q https://cdn.quantconnect.com/ssm/ssm-master-646e188.zip && \\\n    unzip -q ssm-master-646e188.zip && cd ssm-master && \\\n    pip install . && cd .. && rm -rf ssm-master && rm ssm-master-646e188.zip\n\n# Install TA-lib and pandas-ta for python\nRUN wget -q https://github.com/ta-lib/ta-lib/releases/download/v0.6.4/ta-lib_0.6.4_amd64.deb && \\\n    dpkg -i ta-lib_0.6.4_amd64.deb && rm ta-lib_0.6.4_amd64.deb && \\\n    pip install --no-cache-dir TA-Lib==0.6.7 && \\\n    wget -q https://cdn.quantconnect.com/ta-lib/pandas_ta-0.3.14b.tar.gz && \\\n    pip install --no-cache-dir pandas_ta-0.3.14b.tar.gz && rm pandas_ta-0.3.14b.tar.gz\n\n# chronos-forecasting we manually copy the 'scripts' folder which holds the fine tuning tools\nRUN wget -q https://cdn.quantconnect.com/chronos-forecasting/chronos-forecasting-main-133761a.zip && \\\n    unzip -q chronos-forecasting-main-133761a.zip && cd chronos-forecasting-main && \\\n    cp -r scripts /opt/miniconda3/lib/python3.11/site-packages/chronos/ && \\\n    cd .. && rm -rf chronos-forecasting-main && rm chronos-forecasting-main-133761a.zip\n\nRUN echo \"{\\\"argv\\\":[\\\"python\\\",\\\"-m\\\",\\\"ipykernel_launcher\\\",\\\"-f\\\",\\\"{connection_file}\\\"],\\\"display_name\\\":\\\"Foundation-Py-Default\\\",\\\"language\\\":\\\"python\\\",\\\"metadata\\\":{\\\"debugger\\\":true}}\" > /opt/miniconda3/share/jupyter/kernels/python3/kernel.json\n\n# Install wkhtmltopdf and xvfb to support HTML to PDF conversion of reports\nRUN apt-get update && apt install -y xvfb wkhtmltopdf && \\\n    apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/*\n\n# Install fonts for matplotlib\nRUN wget -q https://cdn.quantconnect.com/fonts/foundation.zip && unzip -q foundation.zip && rm foundation.zip \\\n    && mv \"lean fonts/\"* /usr/share/fonts/truetype/ && rm -rf \"lean fonts/\" \"__MACOSX/\"\n\n# Install IB Gateway and it's dependencies: Installs to /root/ibgateway\nRUN apt-get update && apt-get -y install libasound2 libnss3 libnspr4 && apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/* && \\\n    mkdir -p /root/ibgateway && \\\n    wget -q https://cdn.quantconnect.com/interactive/ibgateway-latest-standalone-linux-x64.v10.39.1f.sh && \\\n    chmod 777 ibgateway-latest-standalone-linux-x64.v10.39.1f.sh && \\\n    ./ibgateway-latest-standalone-linux-x64.v10.39.1f.sh -q -dir /root/ibgateway && \\\n    rm ibgateway-latest-standalone-linux-x64.v10.39.1f.sh\n\n# Install dotnet sdk & runtime\nRUN add-apt-repository ppa:dotnet/backports && apt-get update && apt-get install -y dotnet-sdk-10.0 && \\\n    apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/*\n\n# label definitions\nLABEL strict_python_version=3.11.11\nLABEL python_version=3.11\nLABEL target_framework=net10.0"
  },
  {
    "path": "DockerfileLeanFoundationARM",
    "content": "# This is a version of DockerfileLeanFoundation for ARM\n# Some packages from the AMD image are excluded because they are not available on ARM or take too long to build\n\n# Use base system for cleaning up wayward processes\nFROM phusion/baseimage:jammy-1.0.1\n\nMAINTAINER QuantConnect <contact@quantconnect.com>\n\n# Use baseimage-docker's init system.\nCMD [\"/sbin/my_init\"]\n\n# Install OS Packages:\n# Misc tools for running Python.NET and IB inside a headless container.\nRUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update \\\n    && apt-get install -y git libgtk2.0.0 bzip2 curl unzip wget python3-pip python3-opengl zlib1g-dev \\\n    xvfb libxrender1 libxtst6 libxi6 libglib2.0-dev libopenmpi-dev libstdc++6 openmpi-bin \\\n    r-base pandoc libcurl4-openssl-dev \\\n    openjdk-11-jdk openjdk-11-jre bbe \\\n    && apt-get clean && apt-get autoclean && apt-get autoremove --purge -y \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Set PythonDLL variable for PythonNet\nENV PYTHONNET_PYDLL=\"/opt/miniconda3/lib/libpython3.11.so\"\n\n# Install miniconda\nENV CONDA=\"Miniconda3-py311_24.9.2-0-Linux-aarch64.sh\"\nENV PATH=\"/opt/miniconda3/bin:${PATH}\"\nRUN wget -q https://cdn.quantconnect.com/miniconda/${CONDA} && \\\n    bash ${CONDA} -b -p /opt/miniconda3 && rm -rf ${CONDA}\n\n# Install java runtime for h2o lib\nRUN apt-get update && apt-get install -y alien dpkg-dev debhelper build-essential && wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.rpm \\\n    && alien -i jdk-17.0.12_linux-aarch64_bin.rpm \\\n    && update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-17.0.12-oracle-aarch64/bin/java 1 \\\n    && rm jdk-17.0.12_linux-aarch64_bin.rpm\n\n# Avoid pip install read timeouts\nENV PIP_DEFAULT_TIMEOUT=120\n\n# Install numpy first to avoid it not being resolved when installing libraries that depend on it next\nRUN pip install --no-cache-dir numpy==1.26.4\n\n# Install newer (than provided by ubuntu) cmake required by scikit build process\nRUN conda install -c conda-forge cmake==3.28.4 && conda clean -y --all\n\n# The list of packages in this image is shorter than the list in the AMD images\n# This list only includes packages that can be installed within 2 minutes on ARM\nRUN pip install --no-cache-dir      \\\n    cython==3.2.3                   \\\n    pandas==2.3.3                   \\\n    scipy==1.13.1                   \\\n    numpy==1.26.4                   \\\n    wrapt==1.17.3                   \\\n    astropy==7.2.0                  \\\n    beautifulsoup4==4.14.3          \\\n    dill==0.3.8                     \\\n    jsonschema==4.25.1              \\\n    lxml==6.0.2                     \\\n    msgpack==1.1.2                  \\\n    numba==0.61.2                   \\\n    xarray==2025.12.0               \\\n    plotly==5.24.1                  \\\n    jupyterlab==4.5.1               \\\n    ipywidgets==8.1.8               \\\n    jupyterlab-widgets==3.0.16      \\\n    tensorflow==2.19.1              \\\n    docutils==0.22.4                \\\n    gensim==4.4.0                   \\\n    keras==3.13.0                   \\\n    lightgbm==4.6.0                 \\\n    nltk==3.9.2                     \\\n    graphviz==0.21                  \\\n    cmdstanpy==1.3.0                \\\n    copulae==0.7.9                  \\\n    featuretools==1.31.0            \\\n    PuLP==3.3.0                     \\\n    pymc==5.25.1                    \\\n    rauth==0.7.3                    \\\n    scikit-learn==1.6.1             \\\n    scikit-optimize==0.10.2         \\\n    tsfresh==0.20.2                 \\\n    tslearn==0.7.0                  \\\n    tweepy==4.16.0                  \\\n    PyWavelets==1.9.0               \\\n    umap-learn==0.5.9.post2         \\\n    fastai==2.8.6                   \\\n    arch==8.0.0                     \\\n    copulas==0.12.3                 \\\n    cufflinks==0.17.3               \\\n    gym==0.26.2                     \\\n    deap==1.4.3                     \\\n    pykalman==0.11.0                \\\n    cvxpy==1.7.5                    \\\n    pyro-ppl==1.9.1                 \\\n    sklearn-json==0.1.0             \\\n    dtw-python==1.5.3               \\\n    gluonts==0.16.2                 \\\n    jax==0.7.1                      \\\n    pennylane==0.43.1               \\\n    PennyLane-Lightning==0.43.0     \\\n    PennyLane-qiskit==0.43.0        \\\n    mplfinance==0.12.10b0           \\\n    hmmlearn==0.3.3                 \\\n    ta==0.11.0                      \\\n    seaborn==0.13.2                 \\\n    optuna==4.6.0                   \\\n    findiff==0.12.2                 \\\n    sktime==0.40.1                  \\\n    hyperopt==0.2.7                 \\\n    bayesian-optimization==3.1.0    \\\n    matplotlib==3.8.4               \\\n    sdeint==0.3.0                   \\\n    pandas_market_calendars==5.2.2  \\\n    ruptures==1.1.10                \\\n    simpy==4.1.1                    \\\n    scikit-learn-extra==0.3.0       \\\n    ray==2.53.0                     \\\n    \"ray[tune]\"==2.53.0             \\\n    \"ray[rllib]\"==2.53.0            \\\n    \"ray[data]\"==2.53.0             \\\n    \"ray[train]\"==2.53.0            \\\n    fastText==0.9.3                 \\\n    h2o==3.46.0.9                   \\\n    prophet==1.2.1                  \\\n    Riskfolio-Lib==7.0.1            \\\n    torch==2.8.0                    \\\n    torchvision==0.23.0             \\\n    ax-platform==1.2.1              \\\n    alphalens-reloaded==0.4.6       \\\n    pyfolio-reloaded==0.9.9         \\\n    altair==6.0.0                   \\\n    modin==0.37.1                   \\\n    persim==0.3.8                   \\\n    ripser==0.6.14                  \\\n    pydmd==2025.8.1                 \\\n    EMD-signal==1.6.4               \\\n    spacy==3.8.11                   \\\n    pytorch-ignite==0.5.3           \\\n    tensorly==0.9.0                 \\\n    mlxtend==0.23.4                 \\\n    shap==0.48.0                    \\\n    lime==0.2.0.1                   \\\n    mpmath==1.3.0                   \\\n    polars==1.36.1                  \\\n    stockstats==0.6.5               \\\n    QuantStats==0.0.77              \\\n    hurst==0.0.5                    \\\n    numerapi==2.21.0                \\\n    pymdptoolbox==4.0-b3            \\\n    panel==1.7.5                    \\\n    hvplot==0.12.2                  \\\n    py-heat==0.0.6                  \\\n    py-heat-magic==0.0.2            \\\n    bokeh==3.6.3                    \\\n    river==0.21.0                   \\\n    stumpy==1.13.0                  \\\n    pyvinecopulib==0.6.5            \\\n    ijson==3.4.0.post0              \\\n    jupyter-resource-usage==1.2.0   \\\n    injector==0.22.0                \\\n    openpyxl==3.1.5                 \\\n    xlrd==2.0.2                     \\\n    mljar-supervised==1.1.18        \\\n    dm-tree==0.1.9                  \\\n    lz4==4.4.4                      \\\n    ortools==9.12.4544              \\\n    py_vollib==1.0.1                \\\n    thundergbm==0.3.17              \\\n    yellowbrick==1.5                \\\n    livelossplot==0.5.6             \\\n    gymnasium==1.1.1                \\\n    interpret==0.7.2                \\\n    DoubleML==0.10.1                \\\n    jupyter-bokeh==4.0.5            \\\n    imbalanced-learn==0.14.1        \\\n    openai==2.14.0                  \\\n    lazypredict==0.2.16             \\\n    darts==0.39.0                   \\\n    fastparquet==2025.12.0          \\\n    tables==3.10.2                  \\\n    dimod==0.12.21                  \\\n    dwave-samplers==1.7.0           \\\n    python-statemachine==2.5.0      \\\n    pymannkendall==1.4.3            \\\n    Pyomo==6.9.5                    \\\n    gpflow==2.10.0                  \\\n    pyarrow==19.0.1                 \\\n    dwave-ocean-sdk==9.2.0          \\\n    chardet==5.2.0                  \\\n    stable-baselines3==2.7.1        \\\n    sb3-contrib==2.7.1              \\\n    Shimmy==2.0.0                   \\\n    FixedEffectModel==0.0.5         \\\n    transformers==4.57.3            \\\n    langchain==0.3.27               \\\n    pomegranate==1.1.2              \\\n    MAPIE==1.2.0                    \\\n    mlforecast==1.0.2               \\\n    x-transformers==2.11.24         \\\n    Werkzeug==3.1.4                 \\\n    nolds==0.6.2                    \\\n    feature-engine==1.9.3           \\\n    pytorch-tabnet==4.1.0           \\\n    opencv-contrib-python-headless==4.11.0.86 \\\n    POT==0.9.6.post1                \\\n    datasets==3.6.0                 \\\n    scikeras==0.13.0                \\\n    contourpy==1.3.3                \\\n    click==8.2.1\n\n# Install dwave tool\nRUN dwave install --all -y\n\n# Install 'ipopt' solver for 'Pyomo'\nRUN conda install -c conda-forge ipopt==3.14.19 \\\n    && conda clean -y --all\n\n# We install need to install separately else fails to find numpy\nRUN pip install --no-cache-dir iisignature==0.24\n\n# Install spacy models\nRUN python -m spacy download en_core_web_md && python -m spacy download en_core_web_sm\n\nRUN conda config --set solver classic && conda install -y -c conda-forge \\\n    openmpi=5.0.8                   \\\n    && conda clean -y --all\n\n# Install nltk data\nRUN python -m nltk.downloader -d /usr/share/nltk_data punkt && \\\n    python -m nltk.downloader -d /usr/share/nltk_data punkt_tab && \\\n    python -m nltk.downloader -d /usr/share/nltk_data vader_lexicon && \\\n    python -m nltk.downloader -d /usr/share/nltk_data stopwords && \\\n    python -m nltk.downloader -d /usr/share/nltk_data wordnet\n\n# Install Pyrb\nRUN wget -q https://cdn.quantconnect.com/pyrb/pyrb-master-250054e.zip && \\\n    unzip -q pyrb-master-250054e.zip && cd pyrb-master && \\\n    pip install . && cd .. && rm -rf pyrb-master && rm pyrb-master-250054e.zip\n\n# Install SSM\nRUN wget -q https://cdn.quantconnect.com/ssm/ssm-master-646e188.zip && \\\n    unzip -q ssm-master-646e188.zip && cd ssm-master && \\\n    pip install . && cd .. && rm -rf ssm-master && rm ssm-master-646e188.zip\n\n# Install uni2ts\nRUN wget -q https://cdn.quantconnect.com/uni2ts/uni2ts-main-ffe78db.zip && \\\n    unzip -q uni2ts-main-ffe78db.zip && cd uni2ts-main && \\\n    pip install . && cd .. && rm -rf uni2ts-main && rm uni2ts-main-ffe78db.zip\n\n# Install chronos-forecasting\nRUN wget -q https://cdn.quantconnect.com/chronos-forecasting/chronos-forecasting-main-b0bdbd9.zip && \\\n    unzip -q chronos-forecasting-main-b0bdbd9.zip && cd chronos-forecasting-main && \\\n    pip install \".[training]\" && cd .. && rm -rf chronos-forecasting-main && rm chronos-forecasting-main-b0bdbd9.zip\n\nRUN echo \"{\\\"argv\\\":[\\\"python\\\",\\\"-m\\\",\\\"ipykernel_launcher\\\",\\\"-f\\\",\\\"{connection_file}\\\"],\\\"display_name\\\":\\\"Foundation-Py-Default\\\",\\\"language\\\":\\\"python\\\",\\\"metadata\\\":{\\\"debugger\\\":true}}\" > /opt/miniconda3/share/jupyter/kernels/python3/kernel.json\n\n# Install wkhtmltopdf and xvfb to support HTML to PDF conversion of reports\nRUN apt-get update && apt install -y xvfb wkhtmltopdf && \\\n    apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/*\n\n# Install fonts for matplotlib\nRUN wget -q https://cdn.quantconnect.com/fonts/foundation.zip && unzip -q foundation.zip && rm foundation.zip \\\n    && mv \"lean fonts/\"* /usr/share/fonts/truetype/ && rm -rf \"lean fonts/\" \"__MACOSX/\"\n\n# Install dotnet 9 sdk & runtime\n# The .deb packages don't support ARM, the install script does\nENV PATH=\"/root/.dotnet:${PATH}\"\nRUN wget https://dot.net/v1/dotnet-install.sh && \\\n    chmod 777 dotnet-install.sh && \\\n    ./dotnet-install.sh -c 10.0 && \\\n    rm dotnet-install.sh\nENV DOTNET_ROOT=\"/root/.dotnet\"\n\n# label definitions\nLABEL strict_python_version=3.11.11\nLABEL python_version=3.11\nLABEL target_framework=net10.0"
  },
  {
    "path": "Documentation/readme.md",
    "content": "For full documentation please see https://www.quantconnect.com/lean\n\n## System Overview ##\n\n![alt tag](2-Overview-Detailed-New.png)\n\nLean outsourced key infrastructure management to plugins. The most important plugins are:\n\n - **Result Processing**\n   > Handle all messages from the algorithmic trading engine. Decide what should be sent, and where the messages should go. The result processing system can send messages to a local GUI, or the web interface.\n\n - **Datafeed Sourcing**\n   > Connect and download data required for the algorithmic trading engine. For backtesting this sources files from the disk, for live trading it connects to a stream and generates the data objects.\n\n - **Transaction Processing**\n   > Process new order requests; either using the fill models provided by the algorithm, or with an actual brokerage. Send the processed orders back to the algorithm's portfolio to be filled.\n\n - **Realtime Event Management**\n   > Generate real time events - such as end of day events. Trigger callbacks to real time event handlers. For backtesting this is mocked-up an works on simulated time. \n \n - **Algorithm State Setup**\n   > Configure the algorithm cash, portfolio and data requested. Initialize all state parameters required.\n\nFor more information on the system design and contributing please see the Lean Website Documentation.\n\nTo update or change the above diagram, please see [this google sheet](https://docs.google.com/presentation/d/1LHOBjAjAOD0TTXu0jBc6pIqSGGeQ4ZxoUQgX6m7A8pM/edit?usp=sharing)\n\n"
  },
  {
    "path": "DownloaderDataProvider/DownloaderDataProviderArgumentParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Configuration;\nusing McMaster.Extensions.CommandLineUtils;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models.Constants;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher;\n\npublic static class DownloaderDataProviderArgumentParser\n{\n    private const string ApplicationName = \"QuantConnect.DownloaderDataProvider.exe\";\n    private const string ApplicationDescription = \"Welcome to Lean Downloader Data Provider! 🚀 Easily download historical data from various sources with our user-friendly application. Start exploring financial data effortlessly!\";\n    private const string ApplicationHelpText = \"Hm...\";\n\n    private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n    {\n        new CommandLineOption(DownloaderCommandArguments.CommandDownloaderDataDownloader, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandDataType, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandTickers, CommandOptionType.MultipleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandSecurityType, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandMarketName, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandResolution, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandStartDate, CommandOptionType.SingleValue),\n        new CommandLineOption(DownloaderCommandArguments.CommandEndDate, CommandOptionType.SingleValue)\n    };\n\n    /// <summary>\n    /// Parses the command-line arguments and returns a dictionary containing parsed values.\n    /// </summary>\n    /// <param name=\"args\">An array of command-line arguments.</param>\n    /// <returns>A dictionary containing parsed values from the command-line arguments.</returns>\n    /// <remarks>\n    /// The <paramref name=\"args\"/> parameter should contain the command-line arguments to be parsed.\n    /// The method uses the ApplicationParser class to parse the arguments based on the ApplicationName, \n    /// ApplicationDescription, ApplicationHelpText, and Options properties.\n    /// </remarks>\n    public static Dictionary<string, object> ParseArguments(string[] args)\n    {\n        return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Models/BaseDataDownloadConfig.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Util;\nusing System.Globalization;\nusing QuantConnect.Logging;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Configuration;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models.Constants;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher.Models;\n\n/// <summary>\n/// Abstract base class for configuring data download parameters, including common properties and initialization logic.\n/// </summary>\npublic abstract class BaseDataDownloadConfig\n{\n    /// <summary>\n    /// Gets the start date for the data download.\n    /// </summary>\n    public DateTime StartDate { get; set; }\n\n    /// <summary>\n    /// Gets the end date for the data download.\n    /// </summary>\n    public DateTime EndDate { get; set; }\n\n    /// <summary>\n    /// Gets or sets the resolution of the downloaded data.\n    /// </summary>\n    public Resolution Resolution { get; protected set; }\n\n    /// <summary>\n    /// Gets or sets the market name for which the data will be downloaded.\n    /// </summary>\n    public string MarketName { get; protected set; }\n\n    /// <summary>\n    /// Gets the type of security for which the data is being downloaded.\n    /// </summary>\n    public SecurityType SecurityType { get; set; }\n\n    /// <summary>\n    /// Gets or sets the type of tick data to be downloaded.\n    /// </summary>\n    public TickType TickType { get; protected set; }\n\n    /// <summary>\n    /// The type of data based on <see cref=\"TickTypes\"/>\n    /// </summary>\n    public abstract Type DataType { get; }\n\n    /// <summary>\n    /// Gets the list of symbols for which the data will be downloaded.\n    /// </summary>\n    public IReadOnlyCollection<Symbol> Symbols { get; protected set; } = [];\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"BaseDataDownloadConfig\"/> class.\n    /// </summary>\n    protected BaseDataDownloadConfig()\n    {\n        StartDate = ParseDate(Config.Get(DownloaderCommandArguments.CommandStartDate).ToString());\n        EndDate = ParseDate(Config.Get(DownloaderCommandArguments.CommandEndDate).ToString());\n\n        SecurityType = ParseEnum<SecurityType>(Config.Get(DownloaderCommandArguments.CommandSecurityType).ToString());\n\n        MarketName = Config.Get(DownloaderCommandArguments.CommandMarketName).ToString().ToLower(CultureInfo.InvariantCulture);\n\n        if (string.IsNullOrEmpty(MarketName))\n        {\n            MarketName = DefaultBrokerageModel.DefaultMarketMap[SecurityType];\n            Log.Trace($\"{nameof(BaseDataDownloadConfig)}: Default market '{MarketName}' applied for SecurityType '{SecurityType}'\");\n        }\n\n        if (!Market.SupportedMarkets().Contains(MarketName))\n        {\n            throw new ArgumentException($\"The specified market '{MarketName}' is not supported. Supported markets are: {string.Join(\", \", Market.SupportedMarkets())}.\");\n        }\n\n        Symbols = LoadSymbols(Config.GetValue<Dictionary<string, string>>(DownloaderCommandArguments.CommandTickers), SecurityType, MarketName);\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DataDownloadConfig\"/> class with the specified parameters.\n    /// </summary>\n    /// <param name=\"tickType\">The type of tick data to be downloaded.</param>\n    /// <param name=\"securityType\">The type of security for which data is being downloaded.</param>\n    /// <param name=\"resolution\">The resolution of the data being downloaded.</param>\n    /// <param name=\"startDate\">The start date for the data download range.</param>\n    /// <param name=\"endDate\">The end date for the data download range.</param>\n    /// <param name=\"marketName\">The name of the market from which the data is being downloaded.</param>\n    /// <param name=\"symbols\">A list of symbols for which data is being downloaded.</param>\n    protected BaseDataDownloadConfig(TickType tickType, SecurityType securityType, Resolution resolution, DateTime startDate, DateTime endDate, string marketName, List<Symbol> symbols)\n    {\n        StartDate = startDate;\n        EndDate = endDate;\n        Resolution = resolution;\n        MarketName = marketName;\n        SecurityType = securityType;\n        TickType = tickType;\n        Symbols = symbols;\n    }\n\n    /// <summary>\n    /// Loads the symbols for which data will be downloaded.\n    /// </summary>\n    /// <param name=\"tickers\">A dictionary of tickers to load symbols for.</param>\n    /// <param name=\"securityType\">The type of security to download data for.</param>\n    /// <param name=\"market\">The market for which the symbols are valid.</param>\n    /// <returns>A collection of symbols for the specified market and security type.</returns>\n    /// <summary>\n    private static IReadOnlyCollection<Symbol> LoadSymbols(Dictionary<string, string> tickers, SecurityType securityType, string market)\n    {\n        if (tickers == null || tickers.Count == 0)\n        {\n            throw new ArgumentException($\"{nameof(BaseDataDownloadConfig)}.{nameof(LoadSymbols)}: The tickers dictionary cannot be null or empty.\");\n        }\n\n        return tickers.Keys.ToList((ticker) => ParseTicker(ticker, securityType, market));\n    }\n\n    /// <summary>\n    /// Parse input 'ticker' to a Symbol or Canonical Symbol based on the provided security type and market.\n    /// </summary>\n    /// <param name=\"ticker\">The ticker string input by the user.</param>\n    /// <param name=\"securityType\">The security type.</param>\n    /// <param name=\"market\">The market name.</param>\n    /// <returns>A <see cref=\"Symbol\"/> representing the specified security.</returns>\n    private static Symbol ParseTicker(string ticker, SecurityType securityType, string market)\n    {\n        var symbol = default(Symbol);\n        try\n        {\n            symbol = SymbolRepresentation.ParseTickerFromUserInput(ticker, securityType, market);\n        }\n        catch (Exception ex)\n        {\n            Log.Debug($\"{nameof(BaseDataDownloadConfig)}.{nameof(ParseTicker)}: Failed to parse symbol. Exception: {ex.Message}\");\n        }\n\n        return symbol ?? Symbol.Create(ticker, securityType, market);\n    }\n\n    /// <summary>\n    /// Parses a string to a <see cref=\"DateTime\"/> using a specific date format.\n    /// </summary>\n    /// <param name=\"date\">The date string to parse.</param>\n    /// <returns>The parsed <see cref=\"DateTime\"/> value.</returns>\n    protected static DateTime ParseDate(string date) => DateTime.ParseExact(date, DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n\n\n    /// <summary>\n    /// Parses a string value into an enum of the specified type.\n    /// </summary>\n    /// <typeparam name=\"TEnum\">The enum type to parse the value into.</typeparam>\n    /// <param name=\"value\">The string value to parse.</param>\n    /// <returns>The parsed enum value.</returns>\n    /// <exception cref=\"ArgumentException\">Thrown if the value cannot be parsed or is not a valid enum value.</exception>\n    protected static TEnum ParseEnum<TEnum>(string value) where TEnum : struct, Enum\n    {\n        if (!Enum.TryParse(value, true, out TEnum result) || !Enum.IsDefined(result))\n        {\n            throw new ArgumentException($\"Invalid {typeof(TEnum).Name} specified: '{value}'. Please provide a valid {typeof(TEnum).Name}. \" +\n                $\"Valid values are: {string.Join(\", \", Enum.GetNames<TEnum>())}.\");\n        }\n        return result;\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Models/BrokerageDataDownloader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher.Models\n{\n    /// <summary>\n    /// Class for downloading data from a brokerage.\n    /// </summary>\n    public class BrokerageDataDownloader : IDataDownloader, IDisposable\n    {\n        /// <summary>\n        /// Represents the Brokerage implementation.\n        /// </summary>\n        private IBrokerage _brokerage;\n\n        /// <summary>\n        /// Provides access to exchange hours and raw data times zones in various markets\n        /// </summary>\n        private readonly MarketHoursDatabase _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BrokerageDataDownloader\"/> class.\n        /// </summary>\n        public BrokerageDataDownloader()\n        {\n            var liveNodeConfiguration = new LiveNodePacket()\n            {\n                Brokerage = Config.Get(\"data-downloader-brokerage\"),\n                UserToken = Globals.UserToken,\n                UserId = Globals.UserId,\n                ProjectId = Globals.ProjectId,\n                OrganizationId = Globals.OrganizationID,\n                Version = Globals.Version,\n                DeploymentTarget = DeploymentTarget.LocalPlatform\n            };\n\n            try\n            {\n                // import the brokerage data for the configured brokerage\n                var brokerageFactory = Composer.Instance.Single<IBrokerageFactory>(factory => factory.BrokerageType.MatchesTypeName(liveNodeConfiguration.Brokerage));\n                liveNodeConfiguration.BrokerageData = brokerageFactory.BrokerageData;\n            }\n            catch (InvalidOperationException error)\n            {\n                throw new InvalidOperationException($\"{nameof(BrokerageDataDownloader)}.An error occurred while resolving brokerage data for a live job. Brokerage: {liveNodeConfiguration.Brokerage}.\", error);\n            }\n\n            _brokerage = Composer.Instance.GetExportedValueByTypeName<IBrokerage>(liveNodeConfiguration.Brokerage);\n\n            _brokerage.Message += (object _, Brokerages.BrokerageMessageEvent e) =>\n            {\n                if (e.Type == Brokerages.BrokerageMessageType.Error)\n                {\n                    Logging.Log.Error(e.Message);\n                }\n                else\n                {\n                    Logging.Log.Trace(e.Message);\n                }\n            };\n\n            ((IDataQueueHandler)_brokerage).SetJob(liveNodeConfiguration);\n        }\n\n        /// <summary>\n        /// Get historical data enumerable for a single symbol, type and resolution given this start and end time (in UTC).\n        /// </summary>\n        /// <param name=\"dataDownloaderGetParameters\">model class for passing in parameters for historical data</param>\n        /// <returns>Enumerable of base data for this symbol</returns>\n        public IEnumerable<BaseData>? Get(DataDownloaderGetParameters dataDownloaderGetParameters)\n        {\n            var symbol = dataDownloaderGetParameters.Symbol;\n            var resolution = dataDownloaderGetParameters.Resolution;\n            var startUtc = dataDownloaderGetParameters.StartUtc;\n            var endUtc = dataDownloaderGetParameters.EndUtc;\n            var tickType = dataDownloaderGetParameters.TickType;\n\n            var dataType = LeanData.GetDataType(resolution, tickType);\n            var exchangeHours = _marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var dataTimeZone = _marketHoursDatabase.GetDataTimeZone(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            var symbols = new List<Symbol> { symbol };\n            if (symbol.IsCanonical())\n            {\n                symbols = GetChainSymbols(symbol, true).ToList();\n            }\n\n            return symbols\n                .Select(symbol =>\n                {\n                    var request = new Data.HistoryRequest(startUtc, endUtc, dataType, symbol, resolution, exchangeHours: exchangeHours, dataTimeZone: dataTimeZone, resolution,\n                        // let's not ask for extended market hours for hour and daily resolutions to match lean\n                        includeExtendedMarketHours: resolution != Resolution.Hour && resolution != Resolution.Daily, false, DataNormalizationMode.Raw, tickType);\n\n                    var history = _brokerage.GetHistory(request);\n\n                    if (history == null)\n                    {\n                        Logging.Log.Trace($\"{nameof(BrokerageDataDownloader)}.{nameof(Get)}: Ignoring history request for unsupported symbol {symbol}\");\n                    }\n\n                    return history;\n                })\n                .Where(history => history != null)\n                .SelectMany(history => history);\n        }\n\n        /// <summary>\n        /// Returns an IEnumerable of Future/Option contract symbols for the given root ticker\n        /// </summary>\n        /// <param name=\"symbol\">The Symbol to get futures/options chain for</param>\n        /// <param name=\"includeExpired\">Include expired contracts</param>\n        private IEnumerable<Symbol> GetChainSymbols(Symbol symbol, bool includeExpired)\n        {\n            if (_brokerage is IDataQueueUniverseProvider universeProvider)\n            {\n                return universeProvider.LookupSymbols(symbol, includeExpired);\n            }\n            else\n            {\n                throw new InvalidOperationException($\"{nameof(BrokerageDataDownloader)}.{nameof(GetChainSymbols)}: The current brokerage does not support fetching canonical symbols. Please ensure your brokerage instance supports this feature.\");\n            }\n        }\n\n        public void Dispose()\n        {\n            _brokerage.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Models/Constants/DownloaderCommandArguments.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher.Models.Constants\n{\n    public sealed class DownloaderCommandArguments\n    {\n        public const string CommandDownloaderDataDownloader = \"data-downloader\";\n\n        public const string CommandDataType = \"data-type\";\n\n        public const string CommandTickers = \"tickers\";\n\n        public const string CommandSecurityType = \"security-type\";\n\n        public const string CommandMarketName = \"market\";\n\n        public const string CommandResolution = \"resolution\";\n\n        public const string CommandStartDate = \"start-date\";\n\n        public const string CommandEndDate = \"end-date\";\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Models/DataDownloadConfig.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Configuration;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models.Constants;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher.Models;\n\n/// <summary>\n/// Represents the configuration for downloading data.\n/// </summary>\npublic sealed class DataDownloadConfig : BaseDataDownloadConfig\n{\n    /// <summary>\n    /// Gets the type of data download.\n    /// </summary>\n    public override Type DataType { get => LeanData.GetDataType(Resolution, TickType); }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DataDownloadConfig\"/> class.\n    /// </summary>s\n    public DataDownloadConfig()\n    {\n        TickType = ParseEnum<TickType>(Config.Get(DownloaderCommandArguments.CommandDataType));\n        Resolution = ParseEnum<Resolution>(Config.Get(DownloaderCommandArguments.CommandResolution));\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DataDownloadConfig\"/> class with the specified parameters.\n    /// </summary>\n    /// <param name=\"tickType\">The type of tick data to be downloaded.</param>\n    /// <param name=\"securityType\">The type of security for which data is being downloaded.</param>\n    /// <param name=\"resolution\">The resolution of the data being downloaded.</param>\n    /// <param name=\"startDate\">The start date for the data download range.</param>\n    /// <param name=\"endDate\">The end date for the data download range.</param>\n    /// <param name=\"marketName\">The name of the market from which the data is being downloaded.</param>\n    /// <param name=\"symbols\">A list of symbols for which data is being downloaded.</param>\n    public DataDownloadConfig(TickType tickType, SecurityType securityType, Resolution resolution, DateTime startDate, DateTime endDate, string marketName, List<Symbol> symbols)\n        : base(tickType, securityType, resolution, startDate, endDate, marketName, symbols)\n    { }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Models/DataUniverseDownloadConfig.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher.Models;\n\n/// <summary>\n/// Represents the configuration for downloading data for a universe of securities.\n/// </summary>\npublic sealed class DataUniverseDownloadConfig : BaseDataDownloadConfig\n{\n    /// <summary>\n    /// Gets the type of data universe download.\n    /// </summary>\n    public override Type DataType { get; }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DataUniverseDownloadConfig\"/> class using configuration settings.\n    /// </summary>\n    /// <exception cref=\"ArgumentException\">Thrown when an unsupported security type is specified.</exception>\n    public DataUniverseDownloadConfig()\n    {\n        Resolution = Resolution.Daily;\n        DataType = GetDataUniverseType(SecurityType);\n    }\n\n    /// <summary>\n    /// Retrieves the corresponding data universe type based on the specified security type.\n    /// </summary>\n    /// <param name=\"securityType\">The security type for which the data universe type is determined.</param>\n    /// <returns>The corresponding <see cref=\"Type\"/> of the data universe.</returns>\n    /// <exception cref=\"NotImplementedException\">\n    /// Thrown when the specified <paramref name=\"securityType\"/> is not supported.\n    /// </exception>\n    private static Type GetDataUniverseType(SecurityType securityType)\n    {\n        switch (securityType)\n        {\n            case SecurityType.Option:\n            case SecurityType.IndexOption:\n                return typeof(OptionUniverse);\n            default:\n                throw new NotImplementedException($\"DataUniverseDownloadConfig.GetDataUniverseType(): The data universe type for SecurityType '{securityType}' is not implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/Program.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.UniverseSelection;\nusing DataFeeds = QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.DataDownloader;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models.Constants;\n\nnamespace QuantConnect.DownloaderDataProvider.Launcher;\n\npublic static class Program\n{\n    /// <summary>\n    /// Synchronizer in charge of guaranteeing a single operation per file path\n    /// </summary>\n    private readonly static KeyStringSynchronizer DiskSynchronizer = new();\n\n    /// <summary>\n    /// The provider used to cache history data files\n    /// </summary>\n    private static readonly IDataCacheProvider _dataCacheProvider = new DiskDataCacheProvider(DiskSynchronizer);\n\n    /// <summary>\n    /// Represents the time interval of 5 seconds.\n    /// </summary>\n    private static TimeSpan _logDisplayInterval = TimeSpan.FromSeconds(5);\n\n    /// <summary>\n    /// Provides access to exchange hours and raw data times zones in various markets\n    /// </summary>\n    private static readonly MarketHoursDatabase _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n    /// <summary>\n    /// The main entry point for the application.\n    /// </summary>\n    /// <param name=\"args\">Command-line arguments passed to the application.</param>\n    public static void Main(string[] args)\n    {\n        // Parse report arguments and merge with config to use in the optimizer\n        if (args.Length > 0)\n        {\n            Config.MergeCommandLineArgumentsWithConfiguration(DownloaderDataProviderArgumentParser.ParseArguments(args));\n        }\n\n        var dataDownloaderSelector = InitializeConfigurations();\n\n        var commandDataType = Config.Get(DownloaderCommandArguments.CommandDataType).ToUpperInvariant();\n\n        var dataDownloadConfig = default(BaseDataDownloadConfig);\n        switch (commandDataType)\n        {\n            case \"UNIVERSE\":\n                dataDownloadConfig = new DataUniverseDownloadConfig();\n                RunUniverseDownloader(dataDownloaderSelector.GetDataDownloader(dataDownloadConfig.DataType), dataDownloadConfig);\n                break;\n            case \"TRADE\":\n            case \"QUOTE\":\n            case \"OPENINTEREST\":\n                dataDownloadConfig = new DataDownloadConfig();\n                RunDownload(dataDownloaderSelector.GetDataDownloader(dataDownloadConfig.DataType), dataDownloadConfig, Globals.DataFolder, _dataCacheProvider);\n                break;\n            default:\n                Log.Error($\"QuantConnect.DownloaderDataProvider.Launcher: Unsupported command data type '{commandDataType}'. Valid options: UNIVERSE, TRADE, QUOTE, OPENINTEREST.\");\n                break;\n        }\n\n        dataDownloaderSelector.Dispose();\n    }\n\n    /// <summary>\n    /// Executes a data download operation using the specified data downloader.\n    /// </summary>\n    /// <param name=\"dataDownloader\">An instance of an object implementing the <see cref=\"IDataDownloader\"/> interface, responsible for downloading data.</param>\n    /// <param name=\"dataDownloadConfig\">Configuration settings for the data download operation.</param>\n    /// <param name=\"dataDirectory\">The directory where the downloaded data will be stored.</param>\n    /// <param name=\"dataCacheProvider\">The provider used to cache history data files</param>\n    /// <param name=\"mapSymbol\">True if the symbol should be mapped while writing the data</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"dataDownloader\"/> is null.</exception>\n    public static void RunDownload(IDataDownloader dataDownloader, BaseDataDownloadConfig dataDownloadConfig, string dataDirectory, IDataCacheProvider dataCacheProvider, bool mapSymbol = true)\n    {\n        if (dataDownloader == null)\n        {\n            throw new ArgumentNullException(nameof(dataDownloader), \"The data downloader instance cannot be null. Please ensure that a valid instance of data downloader is provided.\");\n        }\n\n        var totalDownloadSymbols = dataDownloadConfig.Symbols.Count;\n        var completeSymbolCount = 0;\n        var startDownloadUtcTime = DateTime.UtcNow;\n\n        foreach (var symbol in dataDownloadConfig.Symbols)\n        {\n            var downloadParameters = new DataDownloaderGetParameters(symbol, dataDownloadConfig.Resolution, dataDownloadConfig.StartDate, dataDownloadConfig.EndDate, dataDownloadConfig.TickType);\n\n            Log.Trace($\"DownloaderDataProvider.Main(): Starting download {downloadParameters}\");\n            var downloadedData = dataDownloader.Get(downloadParameters);\n\n            if (downloadedData == null)\n            {\n                completeSymbolCount++;\n                Log.Trace($\"DownloaderDataProvider.Main(): No data available for the following parameters: {downloadParameters}\");\n                continue;\n            }\n\n            var (dataTimeZone, exchangeTimeZone) = GetDataAndExchangeTimeZoneBySymbol(symbol);\n\n            var writer = new LeanDataWriter(dataDownloadConfig.Resolution, symbol, dataDirectory, dataDownloadConfig.TickType, dataCacheProvider, mapSymbol: mapSymbol);\n\n            var groupedData = DataFeeds.DownloaderDataProvider.FilterAndGroupDownloadDataBySymbol(\n                downloadedData,\n                symbol,\n                dataDownloadConfig.DataType,\n                exchangeTimeZone,\n                dataTimeZone,\n                downloadParameters.StartUtc,\n                downloadParameters.EndUtc);\n\n            var lastLogStatusTime = DateTime.UtcNow;\n\n            foreach (var data in groupedData)\n            {\n                writer.Write(data.Select(data =>\n                {\n                    var utcNow = DateTime.UtcNow;\n                    if (utcNow - lastLogStatusTime >= _logDisplayInterval)\n                    {\n                        lastLogStatusTime = utcNow;\n                        Log.Trace($\"Downloading data for {downloadParameters.Symbol}. Please hold on...\");\n                    }\n                    return data;\n                }));\n            }\n\n            completeSymbolCount++;\n            var symbolPercentComplete = (double)completeSymbolCount / totalDownloadSymbols * 100;\n            Log.Trace($\"DownloaderDataProvider.RunDownload(): {symbolPercentComplete:F2}% complete ({completeSymbolCount} out of {totalDownloadSymbols} symbols)\");\n\n            Log.Trace($\"DownloaderDataProvider.RunDownload(): Download completed for {downloadParameters.Symbol} at {downloadParameters.Resolution} resolution, \" +\n                $\"covering the period from {dataDownloadConfig.StartDate} to {dataDownloadConfig.EndDate}.\");\n        }\n        Log.Trace($\"All downloads completed in {(DateTime.UtcNow - startDownloadUtcTime).TotalSeconds:F2} seconds.\");\n    }\n\n    /// <summary>\n    /// Initiates the universe downloader using the provided configuration.\n    /// </summary>\n    /// <param name=\"dataDownloader\">The data downloader instance.</param>\n    /// <param name=\"dataUniverseDownloadConfig\">The universe download configuration.</param>\n    private static void RunUniverseDownloader(IDataDownloader dataDownloader, BaseDataDownloadConfig dataUniverseDownloadConfig)\n    {\n        foreach (var symbol in dataUniverseDownloadConfig.Symbols)\n        {\n            var universeDownloadParameters = new DataUniverseDownloaderGetParameters(symbol, dataUniverseDownloadConfig.StartDate, dataUniverseDownloadConfig.EndDate);\n            UniverseExtensions.RunUniverseDownloader(dataDownloader, universeDownloadParameters);\n        }\n    }\n\n    /// <summary>\n    /// Retrieves the data time zone and exchange time zone associated with the specified symbol.\n    /// </summary>\n    /// <param name=\"symbol\">The symbol for which to retrieve time zones.</param>\n    /// <returns>\n    /// A tuple containing the data time zone and exchange time zone.\n    /// The data time zone represents the time zone for data related to the symbol.\n    /// The exchange time zone represents the time zone for trading activities related to the symbol.\n    /// </returns>\n    private static (DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone) GetDataAndExchangeTimeZoneBySymbol(Symbol symbol)\n    {\n        var entry = _marketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n        return (entry.DataTimeZone, entry.ExchangeHours.TimeZone);\n    }\n\n    /// <summary>\n    /// Initializes various configurations for the application.\n    /// This method sets up logging, data providers, map file providers, and factor file providers.\n    /// </summary>\n    /// <remarks>\n    /// The method reads configuration values to determine whether debugging is enabled,\n    /// which log handler to use, and which data, map file, and factor file providers to initialize.\n    /// </remarks>\n    /// <seealso cref=\"Log\"/>\n    /// <seealso cref=\"Config\"/>\n    /// <seealso cref=\"Composer\"/>\n    /// <seealso cref=\"ILogHandler\"/>\n    /// <seealso cref=\"IDataProvider\"/>\n    /// <seealso cref=\"IMapFileProvider\"/>\n    /// <seealso cref=\"IFactorFileProvider\"/>\n    public static DataDownloaderSelector InitializeConfigurations()\n    {\n        Log.DebuggingEnabled = Config.GetBool(\"debug-mode\", false);\n        Log.LogHandler = Composer.Instance.GetExportedValueByTypeName<ILogHandler>(Config.Get(\"log-handler\", \"ConsoleLogHandler\"));\n\n        var dataProvider = Composer.Instance.GetExportedValueByTypeName<IDataProvider>(\"DefaultDataProvider\");\n        var mapFileProvider = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"));\n        var factorFileProvider = Composer.Instance.GetExportedValueByTypeName<IFactorFileProvider>(Config.Get(\"factor-file-provider\", \"LocalDiskFactorFileProvider\"));\n\n        mapFileProvider.Initialize(dataProvider);\n        factorFileProvider.Initialize(mapFileProvider, dataProvider);\n\n        var dataDownloader = Composer.Instance.GetExportedValueByTypeName<IDataDownloader>(Config.Get(DownloaderCommandArguments.CommandDownloaderDataDownloader));\n        return new DataDownloaderSelector(dataDownloader, mapFileProvider, dataProvider, factorFileProvider);\n    }\n}\n"
  },
  {
    "path": "DownloaderDataProvider/QuantConnect.DownloaderDataProvider.Launcher.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>QuantConnect.DownloaderDataProvider.Launcher</RootNamespace>\n    <AssemblyName>QuantConnect.DownloaderDataProvider.Launcher</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <Description>QuantConnect LEAN Downloader Data Provider: Project - Main startup executable for download data from various sources with our Lean-friendly application.</Description>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"config.example.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "DownloaderDataProvider/config.example.json",
    "content": "{\n  \"map-file-provider\": \"LocalDiskMapFileProvider\",\n  \"data-provider\": \"DefaultDataProvider\",\n  \"log-handler\": \"ConsoleLogHandler\",\n  \"factor-file-provider\": \"LocalDiskFactorFileProvider\",\n\n  // The root directory of the data folder for this application\n  \"data-folder\": \"../../../Data/\",\n\n  // To get your api access token go to quantconnect.com/account\n  \"job-user-id\": \"0\",\n  \"api-access-token\": \"\",\n  \"job-organization-id\": \"\",\n\n  // Data downloader provider\n  \"data-downloader\": \"\",\n\n  // Specifies the name of the brokerage service used for data downloading (optional).\n  \"data-downloader-brokerage\": \"\"\n}\n"
  },
  {
    "path": "Engine/AlgorithmManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing Fasterflect;\nusing QuantConnect.Util;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Server;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Volatility;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// Algorithm manager class executes the algorithm and generates and passes through the algorithm events.\n    /// </summary>\n    public class AlgorithmManager\n    {\n        private IAlgorithm _algorithm;\n        private readonly object _lock;\n        private readonly bool _liveMode;\n        private bool _cancelRequested;\n        private PerformanceTrackingTool _performanceTrackingTool;\n        private CancellationTokenSource _cancellationTokenSource;\n\n        /// <summary>\n        /// Publicly accessible algorithm status\n        /// </summary>\n        public AlgorithmStatus State => _algorithm?.Status ?? AlgorithmStatus.Running;\n\n        /// <summary>\n        /// Public access to the currently running algorithm id.\n        /// </summary>\n        public string AlgorithmId { get; private set; }\n\n        /// <summary>\n        /// Provides the isolator with a function for verifying that we're not spending too much time in each\n        /// algorithm manager time loop\n        /// </summary>\n        public AlgorithmTimeLimitManager TimeLimit { get; }\n\n        /// <summary>\n        /// Quit state flag for the running algorithm. When true the user has requested the backtest stops through a Quit() method.\n        /// </summary>\n        /// <seealso cref=\"QCAlgorithm.Quit(String)\"/>\n        public bool QuitState => State == AlgorithmStatus.Deleted;\n\n        /// <summary>\n        /// Gets the number of data points processed per second\n        /// </summary>\n        public long DataPoints => _performanceTrackingTool?.DataPoints ?? 0;\n\n        /// <summary>\n        /// Gets the number of data points of algorithm history provider\n        /// </summary>\n        public int AlgorithmHistoryDataPoints => _performanceTrackingTool?.HistoryDataPoints ?? 0;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmManager\"/> class\n        /// </summary>\n        /// <param name=\"liveMode\">True if we're running in live mode, false for backtest mode</param>\n        /// <param name=\"job\">Provided by LEAN when creating a new algo manager. This is the job\n        /// that the algo manager is about to execute. Research and other consumers can provide the\n        /// default value of null</param>\n        public AlgorithmManager(bool liveMode, AlgorithmNodePacket job = null)\n        {\n            AlgorithmId = \"\";\n            _liveMode = liveMode;\n            _lock = new object();\n\n            // initialize the time limit manager\n            TimeLimit = new AlgorithmTimeLimitManager(\n                CreateTokenBucket(job?.Controls?.TrainingLimits),\n                TimeSpan.FromMinutes(Config.GetDouble(\"algorithm-manager-time-loop-maximum\", 20))\n            );\n        }\n\n        /// <summary>\n        /// Launch the algorithm manager to run this strategy\n        /// </summary>\n        /// <param name=\"job\">Algorithm job</param>\n        /// <param name=\"algorithm\">Algorithm instance</param>\n        /// <param name=\"synchronizer\">Instance which implements <see cref=\"ISynchronizer\"/>. Used to stream the data</param>\n        /// <param name=\"transactions\">Transaction manager object</param>\n        /// <param name=\"results\">Result handler object</param>\n        /// <param name=\"realtime\">Realtime processing object</param>\n        /// <param name=\"leanManager\">ILeanManager implementation that is updated periodically with the IAlgorithm instance</param>\n        /// <param name=\"cancellationTokenSource\">Cancellation token source to monitor</param>\n        /// <remarks>Modify with caution</remarks>\n        public void Run(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer synchronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime,\n            ILeanManager leanManager, CancellationTokenSource cancellationTokenSource, PerformanceTrackingTool performanceTrackingTool)\n        {\n            //Initialize:\n            _algorithm = algorithm;\n            _performanceTrackingTool = performanceTrackingTool;\n\n            var token = cancellationTokenSource.Token;\n            _cancellationTokenSource = cancellationTokenSource;\n\n            var backtestMode = (job.Type == PacketType.BacktestNode);\n            var methodInvokers = new Dictionary<Type, MethodInvoker>();\n            var marginCallFrequency = TimeSpan.FromMinutes(5);\n            var nextMarginCallTime = DateTime.MinValue;\n            var nextSecurityModelScan = algorithm.UtcTime.RoundDown(Time.OneHour) + Time.OneHour;\n            var time = algorithm.StartDate.Date;\n\n            var pendingDelistings = new List<Delisting>();\n            var splitWarnings = new List<Split>();\n\n            //Initialize Properties:\n            AlgorithmId = job.AlgorithmId;\n\n            //Go through the subscription types and create invokers to trigger the event handlers for each custom type:\n            foreach (var config in algorithm.SubscriptionManager.Subscriptions)\n            {\n                //If type is a custom feed, check for a dedicated event handler\n                if (config.IsCustomData)\n                {\n                    //Get the matching method for this event handler - e.g. public void OnData(Quandl data) { .. }\n                    var genericMethod = (algorithm.GetType()).GetMethod(\"OnData\", new[] { config.Type });\n\n                    //If we already have this Type-handler then don't add it to invokers again.\n                    if (methodInvokers.ContainsKey(config.Type)) continue;\n\n                    if (genericMethod != null)\n                    {\n                        methodInvokers.Add(config.Type, genericMethod.DelegateForCallMethod());\n                    }\n                }\n            }\n\n            // Schedule a daily event for sampling at midnight every night\n            algorithm.Schedule.On(\"Daily Sampling\", algorithm.Schedule.DateRules.EveryDay(),\n                algorithm.Schedule.TimeRules.Midnight, () =>\n                {\n                    results.Sample(algorithm.UtcTime);\n                });\n\n            //Loop over the queues: get a data collection, then pass them all into relevent methods in the algorithm.\n            Log.Trace($\"AlgorithmManager.Run(): Begin DataStream - Start: {algorithm.StartDate} Stop: {algorithm.EndDate} Time: {algorithm.Time} Warmup: {algorithm.IsWarmingUp}\");\n            foreach (var timeSlice in Stream(algorithm, synchronizer, results, token))\n            {\n                // reset our timer on each loop\n                TimeLimit.StartNewTimeStep();\n\n                //Check this backtest is still running:\n                if (_algorithm.Status != AlgorithmStatus.Running && _algorithm.RunTimeError == null)\n                {\n                    Log.Error($\"AlgorithmManager.Run(): Algorithm state changed to {_algorithm.Status} at {timeSlice.Time.ToStringInvariant()}\");\n                    break;\n                }\n\n                //Execute with TimeLimit Monitor:\n                if (token.IsCancellationRequested)\n                {\n                    Log.Error($\"AlgorithmManager.Run(): CancellationRequestion at {timeSlice.Time.ToStringInvariant()}\");\n                    return;\n                }\n\n                // Update the ILeanManager\n                leanManager.Update();\n\n                time = timeSlice.Time;\n                performanceTrackingTool.Sample(timeSlice.DataPointCount, time);\n\n                if (backtestMode && algorithm.Portfolio.TotalPortfolioValue <= 0)\n                {\n                    var logMessage = \"AlgorithmManager.Run(): Portfolio value is less than or equal to zero, stopping algorithm.\";\n                    Log.Error(logMessage);\n                    results.SystemDebugMessage(logMessage);\n                    break;\n                }\n\n                // If backtesting/warmup, we need to check if there are realtime events in the past\n                // which didn't fire because at the scheduled times there was no data (i.e. markets closed)\n                // and fire them with the correct date/time.\n                performanceTrackingTool.Start(PerformanceTarget.Schedule);\n                realtime.ScanPastEvents(time);\n                performanceTrackingTool.Stop(PerformanceTarget.Schedule);\n\n                // will scan registered consolidators for which we've past the expected scan call.\n                // In live mode we want to round down to the second, so we don't scan too far into the future:\n                // The time slice might carry the data needed to complete a current consolidated bar but the\n                // time slice time might be slightly ahead (a few milliseconds or even ticks) because in live we\n                // use DateTime.UtcNow. So we don't want to scan past the data time so that the consolidators can\n                // complete the current bar.\n                var pastConsolidatorsScanTime = _liveMode ? time.RoundDown(Time.OneSecond) : time;\n                performanceTrackingTool.Start(PerformanceTarget.Consolidators);\n                algorithm.SubscriptionManager.ScanPastConsolidators(pastConsolidatorsScanTime, algorithm);\n                performanceTrackingTool.Stop(PerformanceTarget.Consolidators);\n\n                performanceTrackingTool.Start(PerformanceTarget.Securities);\n                //Set the algorithm and real time handler's time\n                algorithm.SetDateTime(time);\n\n                // the time pulse are just to advance algorithm time, lets shortcut the loop here\n                if (timeSlice.IsTimePulse)\n                {\n                    continue;\n                }\n\n                // Update the current slice before firing scheduled events or any other task\n                algorithm.SetCurrentSlice(timeSlice.Slice);\n\n                if (timeSlice.SecurityChanges != SecurityChanges.None)\n                {\n                    algorithm.ProcessSecurityChanges(timeSlice.SecurityChanges);\n\n                    leanManager.OnSecuritiesChanged(timeSlice.SecurityChanges);\n                    realtime.OnSecuritiesChanged(timeSlice.SecurityChanges);\n                    results.OnSecuritiesChanged(timeSlice.SecurityChanges);\n                }\n\n                //Update the securities properties: first before calling user code to avoid issues with data\n                foreach (var update in timeSlice.SecuritiesUpdateData)\n                {\n                    var security = update.Target;\n\n                    security.Update(update.Data, update.DataType, update.ContainsFillForwardData, update.IsInternalConfig);\n\n                    // Send market price updates to the TradeBuilder\n                    algorithm.TradeBuilder.SetMarketPrice(security.Symbol, security.Price);\n                }\n\n                // TODO: potentially push into a scheduled event\n                if (time >= nextSecurityModelScan)\n                {\n                    foreach (var security in algorithm.Securities.Values)\n                    {\n                        security.MarginInterestRateModel.ApplyMarginInterestRate(new MarginInterestRateParameters(security, time));\n\n                        // perform check for settlement of unsettled funds\n                        security.SettlementModel.Scan(new ScanSettlementModelParameters(algorithm.Portfolio, security, time));\n                    }\n                    nextSecurityModelScan = time.RoundDown(Time.OneHour) + Time.OneHour;\n                }\n\n                //Update the securities properties with any universe data\n                if (timeSlice.UniverseData.Count > 0)\n                {\n                    foreach (var dataCollection in timeSlice.UniverseData.Values)\n                    {\n                        if (!dataCollection.ShouldCacheToSecurity()) continue;\n\n                        foreach (var data in dataCollection.Data)\n                        {\n                            if (algorithm.Securities.TryGetValue(data.Symbol, out var security))\n                            {\n                                security.Cache.StoreData(new[] { data }, data.GetType());\n                            }\n                        }\n                    }\n                }\n\n                // poke each cash object to update from the recent security data\n                foreach (var cash in algorithm.Portfolio.CashBook.Values.Where(x => x.CurrencyConversion != null))\n                {\n                    cash.Update();\n                }\n\n                // security prices got updated\n                algorithm.Portfolio.InvalidateTotalPortfolioValue();\n\n                if (timeSlice.Slice.SymbolChangedEvents.Count != 0)\n                {\n                    try\n                    {\n                        algorithm.OnSymbolChangedEvents(timeSlice.Slice.SymbolChangedEvents);\n                    }\n                    catch (Exception err)\n                    {\n                        algorithm.SetRuntimeError(err, \"OnSymbolChangedEvents\");\n                        return;\n                    }\n\n                    foreach (var symbol in timeSlice.Slice.SymbolChangedEvents.Keys)\n                    {\n                        // cancel all orders for the old symbol\n                        foreach (var ticket in transactions.GetOpenOrderTickets(x => x.Symbol == symbol))\n                        {\n                            ticket.Cancel(\"Open order cancelled on symbol changed event\");\n                        }\n                    }\n                }\n                performanceTrackingTool.Stop(PerformanceTarget.Securities);\n\n                // process fill models on the updated data before entering algorithm, applies to all non-market orders\n                performanceTrackingTool.Start(PerformanceTarget.Transactions);\n                transactions.ProcessSynchronousEvents();\n                performanceTrackingTool.Stop(PerformanceTarget.Transactions);\n\n                // fire real time events after we've updated based on the new data\n                performanceTrackingTool.Start(PerformanceTarget.Schedule);\n                realtime.SetTime(timeSlice.Time);\n                performanceTrackingTool.Stop(PerformanceTarget.Schedule);\n\n                // process split warnings for options\n                performanceTrackingTool.Start(PerformanceTarget.SplitsDividendsDelisting);\n                ProcessSplitSymbols(algorithm, splitWarnings, pendingDelistings);\n                performanceTrackingTool.Stop(PerformanceTarget.SplitsDividendsDelisting);\n\n                //Check if the user's signalled Quit: loop over data until day changes.\n                if (_algorithm.Status != AlgorithmStatus.Running && _algorithm.RunTimeError == null)\n                {\n                    Log.Error($\"AlgorithmManager.Run(): Algorithm state changed to {_algorithm.Status} at {timeSlice.Time.ToStringInvariant()}\");\n                    break;\n                }\n                if (algorithm.RunTimeError != null)\n                {\n                    Log.Error($\"AlgorithmManager.Run(): Stopping, encountered a runtime error at {algorithm.UtcTime} UTC.\");\n                    return;\n                }\n\n                // perform margin calls, in live mode we can also use realtime to emit these\n                if (time >= nextMarginCallTime || (_liveMode && nextMarginCallTime > DateTime.UtcNow))\n                {\n                    // determine if there are possible margin call orders to be executed\n                    bool issueMarginCallWarning;\n                    var marginCallOrders = algorithm.Portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n                    var executedTicketsCount = 0;\n                    if (marginCallOrders.Count != 0)\n                    {\n                        var executingMarginCall = false;\n                        try\n                        {\n\n                            if (marginCallOrders.All(order => algorithm.Portfolio.Securities[order.Symbol].Exchange.ExchangeOpen))\n                            {\n                                // tell the algorithm we're about to issue the margin call\n                                algorithm.OnMarginCall(marginCallOrders);\n\n                                // execute the margin call orders\n                                var executedTickets = algorithm.Portfolio.MarginCallModel.ExecuteMarginCall(marginCallOrders);\n                                executedTicketsCount = executedTickets.Count;\n\n                                foreach (var ticket in executedTickets)\n                                {\n                                    algorithm.Error($\"{algorithm.Time.ToStringInvariant()} - Executed MarginCallOrder: {ticket.Symbol} - \" +\n                                        $\"Quantity: {ticket.Quantity.ToStringInvariant()} @ {ticket.AverageFillPrice.ToStringInvariant()}\"\n                                    );\n                                }\n                            }\n                        }\n                        catch (Exception err)\n                        {\n                            algorithm.SetRuntimeError(err, executingMarginCall ? \"Portfolio.MarginCallModel.ExecuteMarginCall\" : \"OnMarginCall\");\n                            return;\n                        }\n                    }\n                    // we didn't perform a margin call, but got the warning flag back, so issue the warning to the algorithm\n                    if (executedTicketsCount == 0 && issueMarginCallWarning)\n                    {\n                        try\n                        {\n                            algorithm.OnMarginCallWarning();\n                        }\n                        catch (Exception err)\n                        {\n                            algorithm.SetRuntimeError(err, \"OnMarginCallWarning\");\n                            return;\n                        }\n                    }\n\n                    nextMarginCallTime = time + marginCallFrequency;\n                }\n\n                // before we call any events, let the algorithm know about universe changes\n                if (timeSlice.SecurityChanges != SecurityChanges.None)\n                {\n                    try\n                    {\n                        var algorithmSecurityChanges = new SecurityChanges(timeSlice.SecurityChanges)\n                        {\n                            // by default for user code we want to filter out custom securities\n                            FilterCustomSecurities = true,\n                            // by default for user code we want to filter out internal securities\n                            FilterInternalSecurities = true\n                        };\n\n                        algorithm.OnSecuritiesChanged(algorithmSecurityChanges);\n                        algorithm.OnFrameworkSecuritiesChanged(algorithmSecurityChanges);\n                    }\n                    catch (Exception err)\n                    {\n                        algorithm.SetRuntimeError(err, \"OnSecuritiesChanged\");\n                        return;\n                    }\n                }\n\n                performanceTrackingTool.Start(PerformanceTarget.SplitsDividendsDelisting);\n                // apply dividends\n                HandleDividends(timeSlice, algorithm, _liveMode);\n\n                // apply splits\n                HandleSplits(timeSlice, algorithm, _liveMode);\n                performanceTrackingTool.Stop(PerformanceTarget.SplitsDividendsDelisting);\n\n                //Update registered consolidators for this symbol index\n                performanceTrackingTool.Start(PerformanceTarget.Consolidators);\n                try\n                {\n                    if (timeSlice.ConsolidatorUpdateData.Count > 0)\n                    {\n                        var timeKeeper = algorithm.TimeKeeper;\n                        foreach (var update in timeSlice.ConsolidatorUpdateData)\n                        {\n                            var localTime = timeKeeper.GetLocalTimeKeeper(update.Target.ExchangeTimeZone).LocalTime;\n                            var consolidators = update.Target.Consolidators;\n                            foreach (var consolidator in consolidators)\n                            {\n                                foreach (var dataPoint in update.Data)\n                                {\n                                    consolidator.Update(dataPoint);\n                                }\n\n                                // scan for time after we've pumped all the data through for this consolidator\n                                consolidator.Scan(localTime);\n                            }\n                        }\n                    }\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"Consolidators update\");\n                    return;\n                }\n                performanceTrackingTool.Stop(PerformanceTarget.Consolidators);\n\n                // fire custom event handlers\n                foreach (var update in timeSlice.CustomData)\n                {\n                    MethodInvoker methodInvoker;\n                    if (!methodInvokers.TryGetValue(update.DataType, out methodInvoker))\n                    {\n                        continue;\n                    }\n\n                    try\n                    {\n                        foreach (var dataPoint in update.Data)\n                        {\n                            if (update.DataType.IsInstanceOfType(dataPoint))\n                            {\n                                methodInvoker(algorithm, dataPoint);\n                            }\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        algorithm.SetRuntimeError(err, \"Custom Data\");\n                        return;\n                    }\n                }\n\n                performanceTrackingTool.Start(PerformanceTarget.SplitsDividendsDelisting);\n                try\n                {\n                    if (timeSlice.Slice.Splits.Count != 0)\n                    {\n                        algorithm.OnSplits(timeSlice.Slice.Splits);\n                    }\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"OnSplits\");\n                    return;\n                }\n\n                try\n                {\n                    if (timeSlice.Slice.Dividends.Count != 0)\n                    {\n                        algorithm.OnDividends(timeSlice.Slice.Dividends);\n                    }\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"OnDividends\");\n                    return;\n                }\n\n                try\n                {\n                    if (timeSlice.Slice.Delistings.Count != 0)\n                    {\n                        algorithm.OnDelistings(timeSlice.Slice.Delistings);\n                    }\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"OnDelistings\");\n                    return;\n                }\n\n                // Only track pending delistings in non-live mode.\n                if (!algorithm.LiveMode)\n                {\n                    // Keep this up to date even though we don't process delistings here anymore\n                    foreach (var delisting in timeSlice.Slice.Delistings.Values)\n                    {\n                        if (delisting.Type == DelistingType.Warning)\n                        {\n                            // Store our delistings warnings because they are still used by ProcessSplitSymbols above\n                            pendingDelistings.Add(delisting);\n                        }\n                        else\n                        {\n                            // If we have an actual delisting event, remove it from pending delistings\n                            var index = pendingDelistings.FindIndex(x => x.Symbol == delisting.Symbol);\n                            if (index != -1)\n                            {\n                                pendingDelistings.RemoveAt(index);\n                            }\n                        }\n                    }\n                }\n\n                // run split logic after firing split events\n                HandleSplitSymbols(timeSlice.Slice.Splits, splitWarnings);\n                performanceTrackingTool.Stop(PerformanceTarget.SplitsDividendsDelisting);\n\n                try\n                {\n                    performanceTrackingTool.Start(PerformanceTarget.OnData);\n                    if (timeSlice.Slice.HasData)\n                    {\n                        // EVENT HANDLER v3.0 -- all data in a single event\n                        algorithm.OnData(algorithm.CurrentSlice);\n                    }\n\n                    // always turn the crank on this method to ensure universe selection models function properly on day changes w/out data\n                    algorithm.OnFrameworkData(timeSlice.Slice);\n                    performanceTrackingTool.Stop(PerformanceTarget.OnData);\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"OnData\");\n                    return;\n                }\n\n                performanceTrackingTool.Start(PerformanceTarget.Transactions);\n                //If its the historical/paper trading models, wait until market orders have been \"filled\"\n                // Manually trigger the event handler to prevent thread switch.\n                transactions.ProcessSynchronousEvents();\n                performanceTrackingTool.Stop(PerformanceTarget.Transactions);\n\n                // Process any required events of the results handler such as sampling assets, equity, or stock prices.\n                results.ProcessSynchronousEvents();\n\n                // poke the algorithm at the end of each time step\n                algorithm.OnEndOfTimeStep();\n            } // End of ForEach feed.Bridge.GetConsumingEnumerable\n            _performanceTrackingTool.Shutdown();\n\n            // stop timing the loops\n            TimeLimit.StopEnforcingTimeLimit();\n\n            //Stream over:: Send the final packet and fire final events:\n            Log.Trace(\"AlgorithmManager.Run(): Firing On End Of Algorithm...\");\n            try\n            {\n                algorithm.OnEndOfAlgorithm();\n            }\n            catch (Exception err)\n            {\n                algorithm.SetRuntimeError(err, \"OnEndOfAlgorithm\");\n                return;\n            }\n\n            // Process any required events of the results handler such as sampling assets, equity, or stock prices.\n            results.ProcessSynchronousEvents(forceProcess: true);\n\n            //Liquidate Holdings for Calculations:\n            if (_algorithm.Status == AlgorithmStatus.Liquidated && _liveMode)\n            {\n                Log.Trace(\"AlgorithmManager.Run(): Liquidating algorithm holdings...\");\n                algorithm.Liquidate();\n                results.LogMessage(\"Algorithm Liquidated\");\n                results.SendStatusUpdate(AlgorithmStatus.Liquidated);\n            }\n\n            //Manually stopped the algorithm\n            if (_algorithm.Status == AlgorithmStatus.Stopped)\n            {\n                Log.Trace(\"AlgorithmManager.Run(): Stopping algorithm...\");\n                results.LogMessage(\"Algorithm Stopped\");\n                results.SendStatusUpdate(AlgorithmStatus.Stopped);\n            }\n\n            //Backtest deleted.\n            if (_algorithm.Status == AlgorithmStatus.Deleted)\n            {\n                Log.Trace(\"AlgorithmManager.Run(): Deleting algorithm...\");\n                results.DebugMessage(\"Algorithm Id:(\" + job.AlgorithmId + \") Deleted by request.\");\n                results.SendStatusUpdate(AlgorithmStatus.Deleted);\n            }\n\n            //Algorithm finished, send regardless of commands:\n            results.SendStatusUpdate(AlgorithmStatus.Completed);\n            SetStatus(AlgorithmStatus.Completed);\n\n            //Take final samples:\n            results.Sample(time);\n\n        } // End of Run();\n\n        /// <summary>\n        /// Set the quit state.\n        /// </summary>\n        public void SetStatus(AlgorithmStatus state)\n        {\n            lock (_lock)\n            {\n                //We don't want anyone else to set our internal state to \"Running\".\n                //This is controlled by the algorithm private variable only.\n                //Algorithm could be null after it's initialized and they call Run on us\n                if (state != AlgorithmStatus.Running && _algorithm != null)\n                {\n                    _algorithm.SetStatus(state);\n                }\n\n                if (_cancellationTokenSource != null && !_cancellationTokenSource.IsCancellationRequested && !_cancelRequested)\n                {\n                    if (state == AlgorithmStatus.Deleted)\n                    {\n                        _cancelRequested = true;\n                        // if the algorithm was deleted, let's give the algorithm a few seconds to shutdown and cancel it out\n                        _cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(5));\n                    }\n                    else if (state == AlgorithmStatus.Stopped)\n                    {\n                        _cancelRequested = true;\n                        // if the algorithm was stopped, let's give the algorithm a few seconds to shutdown and cancel it out\n                        _cancellationTokenSource.CancelAfter(TimeSpan.FromMinutes(1));\n                    }\n                }\n            }\n        }\n\n        private IEnumerable<TimeSlice> Stream(IAlgorithm algorithm, ISynchronizer synchronizer, IResultHandler results, CancellationToken cancellationToken)\n        {\n            var nextWarmupStatusTime = DateTime.MinValue;\n            var warmingUp = algorithm.IsWarmingUp;\n            var warmingUpPercent = 0;\n            var logSubscriptionCountFlag = false;\n            if (warmingUp)\n            {\n                nextWarmupStatusTime = DateTime.UtcNow.AddSeconds(1);\n                algorithm.Debug(\"Algorithm starting warm up...\");\n                results.SendStatusUpdate(AlgorithmStatus.History, $\"{warmingUpPercent}\");\n            }\n            else\n            {\n                results.SendStatusUpdate(AlgorithmStatus.Running);\n                // let's be polite, and call warmup finished even though there was no warmup period and avoid algorithms having to handle it instead.\n                // we trigger this callback here and not internally in the algorithm so that we can go through python if required\n                algorithm.OnWarmupFinished();\n            }\n\n            // bellow we compare with slice.Time which is in UTC\n            var startTimeTicks = algorithm.UtcTime.Ticks;\n            var warmupEndTicks = algorithm.StartDate.ConvertToUtc(algorithm.TimeZone).Ticks;\n\n            // fulfilling history requirements of volatility models in live mode\n            if (algorithm.LiveMode)\n            {\n                warmupEndTicks = DateTime.UtcNow.Ticks;\n                ProcessVolatilityHistoryRequirements(algorithm, _liveMode);\n            }\n\n            foreach (var timeSlice in synchronizer.StreamData(cancellationToken))\n            {\n                if (algorithm.IsWarmingUp)\n                {\n                    var now = DateTime.UtcNow;\n                    if (now > nextWarmupStatusTime)\n                    {\n                        // send some status to the user letting them know we're done history, but still warming up,\n                        // catching up to real time data\n                        nextWarmupStatusTime = now.AddSeconds(2);\n                        var newPercent = (int)(100 * (timeSlice.Time.Ticks - startTimeTicks) / (double)(warmupEndTicks - startTimeTicks));\n                        // if there isn't any progress don't send the same update many times\n                        if (newPercent != warmingUpPercent)\n                        {\n                            warmingUpPercent = newPercent;\n                            algorithm.Debug($\"Processing algorithm warm-up request {warmingUpPercent}%...\");\n                            results.SendStatusUpdate(AlgorithmStatus.History, $\"{warmingUpPercent}\");\n                        }\n                    }\n                    if (!logSubscriptionCountFlag)\n                    {\n                        Log.Trace($\"AlgorithmManager.Stream(): Subscriptions count before warm up: {algorithm.SubscriptionManager.Count}\");\n                        logSubscriptionCountFlag = true;\n                    }\n                }\n                else if (warmingUp)\n                {\n                    // warmup finished, send an update\n                    warmingUp = false;\n                    // we trigger this callback here and not internally in the algorithm so that we can go through python if required\n                    algorithm.OnWarmupFinished();\n                    algorithm.Debug(\"Algorithm finished warming up.\");\n                    Log.Trace($\"AlgorithmManager.Stream(): Subscriptions count after warm up: {algorithm.SubscriptionManager.Count}\");\n                    results.SendStatusUpdate(AlgorithmStatus.Running, \"100\");\n                }\n                yield return timeSlice;\n            }\n        }\n\n        /// <summary>\n        /// Helper method used to process securities volatility history requirements\n        /// </summary>\n        /// <remarks>Implemented as static to facilitate testing</remarks>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"liveMode\">Whether the algorithm is in live mode</param>\n        public static void ProcessVolatilityHistoryRequirements(IAlgorithm algorithm, bool liveMode)\n        {\n            Log.Trace(\"ProcessVolatilityHistoryRequirements(): Updating volatility models with historical data...\");\n\n            foreach (var security in algorithm.Securities.Values)\n            {\n                security.VolatilityModel.WarmUp(algorithm.HistoryProvider, algorithm.SubscriptionManager, security, algorithm.UtcTime,\n                    algorithm.TimeZone, liveMode);\n            }\n\n            Log.Trace(\"ProcessVolatilityHistoryRequirements(): finished.\");\n        }\n\n        /// <summary>\n        /// Helper method to apply a split to an algorithm instance\n        /// </summary>\n        public static void HandleSplits(TimeSlice timeSlice, IAlgorithm algorithm, bool liveMode)\n        {\n            foreach (var split in timeSlice.Slice.Splits.Values)\n            {\n                try\n                {\n                    // only process split occurred events (ignore warnings)\n                    if (split.Type != SplitType.SplitOccurred)\n                    {\n                        continue;\n                    }\n\n                    if (algorithm.Securities.TryGetValue(split.Symbol, out var security) && liveMode && !algorithm.IsWarmingUp)\n                    {\n                        Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Pre-Split for {split}. Security Price: {security.Price} Holdings: {security.Holdings.Quantity}\");\n                    }\n\n                    var mode = algorithm.SubscriptionManager.SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(split.Symbol)\n                        .DataNormalizationMode();\n\n                    if (algorithm.IsWarmingUp)\n                    {\n                        // skip past split during live warmup, the algorithms position already reflects them\n                        Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Skip Split during warmup: {split}\");\n                    }\n                    else\n                    {\n                        if (Log.DebuggingEnabled)\n                        {\n                            Log.Debug($\"AlgorithmManager.Run(): {algorithm.Time}: Applying Split for {split.Symbol}\");\n                        }\n\n                        // apply the split event to the portfolio\n                        algorithm.Portfolio.ApplySplit(split, security, liveMode, mode);\n\n                        // apply the split event to the trade builder\n                        algorithm.TradeBuilder.ApplySplit(split, liveMode, mode);\n\n                        // apply the split to open orders as well in raw mode, all other modes are split adjusted\n                        if (liveMode || mode == DataNormalizationMode.Raw)\n                        {\n                            // in live mode we always want to have our order match the order at the brokerage, so apply the split to the orders\n                            var openOrders = algorithm.Transactions.GetOpenOrderTickets(ticket => ticket.Symbol == split.Symbol);\n                            algorithm.BrokerageModel.ApplySplit(openOrders.ToList(), split);\n                        }\n                    }\n\n                    // apply the split event to the security volatility model\n                    ApplySplitOrDividendToVolatilityModel(algorithm, security, liveMode, mode);\n\n                    if (liveMode && security != null && !algorithm.IsWarmingUp)\n                    {\n                        Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Post-Split for {split}. Security Price: {security.Price} Holdings: {security.Holdings.Quantity}\");\n                    }\n                }\n                catch (Exception err)\n                {\n                    algorithm.SetRuntimeError(err, \"Split event\");\n                    return;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Helper method to apply a dividend to an algorithm instance\n        /// </summary>\n        public static void HandleDividends(TimeSlice timeSlice, IAlgorithm algorithm, bool liveMode)\n        {\n            foreach (var dividend in timeSlice.Slice.Dividends.Values)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"AlgorithmManager.Run(): {algorithm.Time}: Applying Dividend: {dividend}\");\n                }\n\n                if (algorithm.Securities.TryGetValue(dividend.Symbol, out var security) && liveMode && !algorithm.IsWarmingUp)\n                {\n                    Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Pre-Dividend: {dividend}. \" +\n                        $\"Security Holdings: {security.Holdings.Quantity} Account Currency Holdings: \" +\n                        $\"{algorithm.Portfolio.CashBook[algorithm.AccountCurrency].Amount}\");\n                }\n\n                var mode = algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(dividend.Symbol)\n                    .DataNormalizationMode();\n\n                if (algorithm.IsWarmingUp)\n                {\n                    // skip past dividends during warmup, the algorithms position already reflects them\n                    Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Skip Dividend during warmup: {dividend}\");\n                }\n                else\n                {\n                    // apply the dividend event to the portfolio\n                    algorithm.Portfolio.ApplyDividend(dividend, liveMode, mode);\n                }\n\n                // apply the dividend event to the security volatility model\n                ApplySplitOrDividendToVolatilityModel(algorithm, security, liveMode, mode);\n\n                if (liveMode && security != null && !algorithm.IsWarmingUp)\n                {\n                    Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Post-Dividend: {dividend}. Security \" +\n                        $\"Holdings: {security.Holdings.Quantity} Account Currency Holdings: \" +\n                        $\"{algorithm.Portfolio.CashBook[algorithm.AccountCurrency].Amount}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Keeps track of split warnings so we can later liquidate option contracts\n        /// </summary>\n        private void HandleSplitSymbols(Splits newSplits, List<Split> splitWarnings)\n        {\n            foreach (var split in newSplits.Values)\n            {\n                if (split.Type != SplitType.Warning)\n                {\n                    if (Log.DebuggingEnabled)\n                    {\n                        Log.Debug($\"AlgorithmManager.HandleSplitSymbols(): {_algorithm.Time} - Security split occurred: Split Factor: {split} Reference Price: {split.ReferencePrice}\");\n                    }\n                    continue;\n                }\n\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"AlgorithmManager.HandleSplitSymbols(): {_algorithm.Time} - Security split warning: {split}\");\n                }\n\n                if (!splitWarnings.Any(x => x.Symbol == split.Symbol && x.Type == SplitType.Warning))\n                {\n                    splitWarnings.Add(split);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Liquidate option contact holdings who's underlying security has split\n        /// </summary>\n        private void ProcessSplitSymbols(IAlgorithm algorithm, List<Split> splitWarnings, List<Delisting> pendingDelistings)\n        {\n            // NOTE: This method assumes option contracts have the same core trading hours as their underlying contract\n            //       This is a small performance optimization to prevent scanning every contract on every time step,\n            //       instead we scan just the underlyings, thereby reducing the time footprint of this methods by a factor\n            //       of N, the number of derivative subscriptions\n            for (int i = splitWarnings.Count - 1; i >= 0; i--)\n            {\n                var split = splitWarnings[i];\n                var security = algorithm.Securities[split.Symbol];\n\n                if (!security.IsTradable\n                    && !algorithm.UniverseManager.ActiveSecurities.Keys.Contains(split.Symbol))\n                {\n                    Log.Debug($\"AlgorithmManager.ProcessSplitSymbols(): {_algorithm.Time} - Removing split warning for {security.Symbol}\");\n\n                    // remove the warning from out list\n                    splitWarnings.RemoveAt(i);\n                    // Since we are storing the split warnings for a loop\n                    // we need to check if the security was removed.\n                    // When removed, it will be marked as non tradable but just in case\n                    // we expect it not to be an active security either\n                    continue;\n                }\n\n                var nextMarketClose = security.Exchange.Hours.GetNextMarketClose(security.LocalTime, false);\n\n                // determine the latest possible time we can submit a MOC order\n                var configs = algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(security.Symbol);\n\n                if (configs.Count == 0)\n                {\n                    // should never happen at this point, if it does let's give some extra info\n                    throw new Exception(\n                        $\"AlgorithmManager.ProcessSplitSymbols(): {_algorithm.Time} - No subscriptions found for {security.Symbol}\" +\n                        $\", IsTradable: {security.IsTradable}\" +\n                        $\", Active: {algorithm.UniverseManager.ActiveSecurities.Keys.Contains(split.Symbol)}\");\n                }\n\n                var latestMarketOnCloseTimeRoundedDownByResolution = nextMarketClose.Subtract(MarketOnCloseOrder.SubmissionTimeBuffer)\n                    .RoundDownInTimeZone(configs.GetHighestResolution().ToTimeSpan(), security.Exchange.TimeZone, configs.First().DataTimeZone);\n\n                // we don't need to do anyhing until the market closes\n                if (security.LocalTime < latestMarketOnCloseTimeRoundedDownByResolution) continue;\n\n                // Skip processing split warnings during warmup\n                // Historical splits are already reflected in current positions\n                if (algorithm.IsWarmingUp)\n                {\n                    splitWarnings.RemoveAt(i);\n                    // skip past split during warmup, the algorithms position already reflects them\n                    Log.Trace($\"AlgorithmManager.Run(): {algorithm.Time}: Skip Splits during warmup {split}\");\n                    continue;\n                }\n\n                // fetch all option derivatives of the underlying with holdings (excluding the canonical security)\n                var derivatives = algorithm.Securities.Values.Where(potentialDerivate =>\n                    potentialDerivate.Symbol.SecurityType.IsOption() &&\n                    potentialDerivate.Symbol.Underlying == security.Symbol &&\n                    !potentialDerivate.Symbol.Underlying.IsCanonical() &&\n                    potentialDerivate.HoldStock\n                );\n\n                foreach (var derivative in derivatives)\n                {\n                    var optionContractSymbol = derivative.Symbol;\n                    var optionContractSecurity = (Option)derivative;\n\n                    if (pendingDelistings.Any(x => x.Symbol == optionContractSymbol\n                        && x.Time.Date == optionContractSecurity.LocalTime.Date))\n                    {\n                        // if the option is going to be delisted today we skip sending the market on close order\n                        continue;\n                    }\n\n                    // close any open orders\n                    algorithm.Transactions.CancelOpenOrders(optionContractSymbol, \"Canceled due to impending split. Separate MarketOnClose order submitted to liquidate position.\");\n\n                    var request = new SubmitOrderRequest(OrderType.MarketOnClose, optionContractSecurity.Type, optionContractSymbol,\n                        -optionContractSecurity.Holdings.Quantity, 0, 0, algorithm.UtcTime,\n                        \"Liquidated due to impending split. Option splits are not currently supported.\"\n                    );\n\n                    // send MOC order to liquidate option contract holdings\n                    algorithm.Transactions.AddOrder(request);\n\n                    // mark option contract as not tradable\n                    optionContractSecurity.IsTradable = false;\n\n                    algorithm.Debug($\"MarketOnClose order submitted for option contract '{optionContractSymbol}' due to impending {split.Symbol.Value} split event. \"\n                        + \"Option splits are not currently supported.\");\n                }\n\n                // remove the warning from out list\n                splitWarnings.RemoveAt(i);\n            }\n        }\n\n        /// <summary>\n        /// Warms up the security's volatility model in the case of a split or dividend to avoid discontinuities when data is raw or in live mode\n        /// </summary>\n        private static void ApplySplitOrDividendToVolatilityModel(IAlgorithm algorithm, Security security, bool liveMode,\n            DataNormalizationMode dataNormalizationMode)\n        {\n            if (security.Type == SecurityType.Equity && (liveMode || dataNormalizationMode == DataNormalizationMode.Raw))\n            {\n                security?.VolatilityModel.WarmUp(algorithm.HistoryProvider, algorithm.SubscriptionManager, security, algorithm.UtcTime,\n                    algorithm.TimeZone, liveMode, dataNormalizationMode);\n            }\n        }\n\n        /// <summary>\n        /// Constructs the correct <see cref=\"ITokenBucket\"/> instance per the provided controls.\n        /// The provided controls will be null when\n        /// </summary>\n        private static ITokenBucket CreateTokenBucket(LeakyBucketControlParameters controls)\n        {\n            if (controls == null)\n            {\n                // this will only be null when the AlgorithmManager is being initialized outside of LEAN\n                // for example, in unit tests that don't provide a job package as well as from Research\n                // in each of the above cases, it seems best to not enforce the leaky bucket restrictions\n                return TokenBucket.Null;\n            }\n\n            Log.Trace(\"AlgorithmManager.CreateTokenBucket(): Initializing LeakyBucket: \" +\n                $\"Capacity: {controls.Capacity} \" +\n                $\"RefillAmount: {controls.RefillAmount} \" +\n                $\"TimeInterval: {controls.TimeIntervalMinutes}\"\n            );\n\n            // these parameters view 'minutes' as the resource being rate limited. the capacity is the total\n            // number of minutes available for burst operations and after controls.TimeIntervalMinutes time\n            // has passed, we'll add controls.RefillAmount to the 'minutes' available, maxing at controls.Capacity\n            return new LeakyBucket(\n                controls.Capacity,\n                controls.RefillAmount,\n                TimeSpan.FromMinutes(controls.TimeIntervalMinutes)\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/AlgorithmTimeLimitManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IIsolatorLimitResultProvider\"/> that tracks the algorithm\n    /// manager's time loops and enforces a maximum amount of time that each time loop may take to execute.\n    /// The isolator uses the result provided by <see cref=\"IsWithinLimit\"/> to determine if it should\n    /// terminate the algorithm for violation of the imposed limits.\n    /// </summary>\n    public class AlgorithmTimeLimitManager : IIsolatorLimitResultProvider\n    {\n        private volatile bool _failed;\n        private volatile bool _stopped;\n        private long _additionalMinutes;\n\n        private volatile ReferenceWrapper<DateTime> _currentTimeStepTime;\n        private readonly TimeSpan _timeLoopMaximum;\n\n        /// <summary>\n        /// Gets the additional time bucket which is responsible for tracking additional time requested\n        /// for processing via long-running scheduled events. In LEAN, we use the <see cref=\"LeakyBucket\"/>\n        /// </summary>\n        public ITokenBucket AdditionalTimeBucket { get; }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"AlgorithmTimeLimitManager\"/> to manage the\n        /// creation of <see cref=\"IsolatorLimitResult\"/> instances as it pertains to the\n        /// algorithm manager's time loop\n        /// </summary>\n        /// <param name=\"additionalTimeBucket\">Provides a bucket of additional time that can be requested to be\n        /// spent to give execution time for things such as training scheduled events</param>\n        /// <param name=\"timeLoopMaximum\">Specifies the maximum amount of time the algorithm is permitted to\n        /// spend in a single time loop. This value can be overriden if certain actions are taken by the\n        /// algorithm, such as invoking the training methods.</param>\n        public AlgorithmTimeLimitManager(ITokenBucket additionalTimeBucket, TimeSpan timeLoopMaximum)\n        {\n            _timeLoopMaximum = timeLoopMaximum;\n            AdditionalTimeBucket = additionalTimeBucket;\n            _currentTimeStepTime = new ReferenceWrapper<DateTime>(DateTime.MinValue);\n        }\n\n        /// <summary>\n        /// Invoked by the algorithm at the start of each time loop. This resets the current time step\n        /// elapsed time.\n        /// </summary>\n        /// <remarks>\n        /// This class is the result of a mechanical refactor with the intention of preserving all existing\n        /// behavior, including setting the <code>_currentTimeStepTime</code> to <see cref=\"DateTime.MinValue\"/>\n        /// </remarks>\n        public void StartNewTimeStep()\n        {\n            if (_stopped)\n            {\n                throw new InvalidOperationException(\"The AlgorithmTimeLimitManager may not be stopped and restarted.\");\n            }\n\n            // maintains existing implementation behavior to reset the time to min value and then\n            // when the isolator pings IsWithinLimit, invocation of CurrentTimeStepElapsed will cause\n            // it to update to the current time. This was done as a performance improvement and moved\n            // accessing DateTime.UtcNow from the algorithm manager thread to the isolator thread\n            _currentTimeStepTime = new ReferenceWrapper<DateTime>(DateTime.MinValue);\n            Interlocked.Exchange(ref _additionalMinutes, 0L);\n        }\n\n        /// <summary>\n        /// Stops this instance from tracking the algorithm manager's time loop elapsed time.\n        /// This is invoked at the end of the algorithm to prevent the isolator from terminating\n        /// the algorithm during final clean up and shutdown.\n        /// </summary>\n        internal void StopEnforcingTimeLimit()\n        {\n            _stopped = true;\n        }\n\n        /// <summary>\n        /// Determines whether or not the algorithm time loop is considered within the limits\n        /// </summary>\n        public IsolatorLimitResult IsWithinLimit()\n        {\n            TimeSpan currentTimeStepElapsed;\n            var message = IsOutOfTime(out currentTimeStepElapsed) ? GetErrorMessage(currentTimeStepElapsed) : string.Empty;\n            return new IsolatorLimitResult(currentTimeStepElapsed, message);\n        }\n\n        /// <summary>\n        /// Requests additional time to continue executing the current time step.\n        /// At time of writing, this is intended to be used to provide training scheduled events\n        /// additional time to allow complex training models time to execute while also preventing\n        /// abuse by enforcing certain control parameters set via the job packet.\n        ///\n        /// Each time this method is invoked, this time limit manager will increase the allowable\n        /// execution time by the specified number of whole minutes\n        /// </summary>\n        public void RequestAdditionalTime(int minutes)\n        {\n            if (!TryRequestAdditionalTime(minutes))\n            {\n                _failed = true;\n                Log.Debug($\"AlgorithmTimeLimitManager.RequestAdditionalTime({minutes}): Failed to acquire additional time. Marking failed.\");\n            }\n        }\n\n        /// <summary>\n        /// Attempts to requests additional time to continue executing the current time step.\n        /// At time of writing, this is intended to be used to provide training scheduled events\n        /// additional time to allow complex training models time to execute while also preventing\n        /// abuse by enforcing certain control parameters set via the job packet.\n        ///\n        /// Each time this method is invoked, this time limit manager will increase the allowable\n        /// execution time by the specified number of whole minutes\n        /// </summary>\n        public bool TryRequestAdditionalTime(int minutes)\n        {\n            Log.Debug($\"AlgorithmTimeLimitManager.TryRequestAdditionalTime({minutes}): Requesting additional time. Available: {AdditionalTimeBucket.AvailableTokens}\");\n\n            // safely attempts to consume from the bucket, returning false if insufficient resources available\n            if (AdditionalTimeBucket.TryConsume(minutes))\n            {\n                var newValue = Interlocked.Add(ref _additionalMinutes, minutes);\n                Log.Debug($\"AlgorithmTimeLimitManager.TryRequestAdditionalTime({minutes}): Success: AdditionalMinutes: {newValue}\");\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Determines whether or not the algorithm should be terminated due to exceeding the time limits\n        /// </summary>\n        private bool IsOutOfTime(out TimeSpan currentTimeStepElapsed)\n        {\n            if (_stopped)\n            {\n                currentTimeStepElapsed = TimeSpan.Zero;\n                return false;\n            }\n\n            currentTimeStepElapsed = GetCurrentTimeStepElapsed();\n            if (_failed)\n            {\n                return true;\n            }\n\n            var additionalMinutes = TimeSpan.FromMinutes(Interlocked.Read(ref _additionalMinutes));\n            return currentTimeStepElapsed > _timeLoopMaximum.Add(additionalMinutes);\n        }\n\n        /// <summary>\n        /// Gets the current amount of time that has elapsed since the beginning of the\n        /// most recent algorithm manager time loop\n        /// </summary>\n        private TimeSpan GetCurrentTimeStepElapsed()\n        {\n            var currentValue = _currentTimeStepTime.Value;\n            if (currentValue == DateTime.MinValue)\n            {\n                _currentTimeStepTime = new ReferenceWrapper<DateTime>(DateTime.UtcNow);\n                return TimeSpan.Zero;\n            }\n            // here we use currentValue on purpose since '_currentTimeStepTime' could have been overwritten to 'DateTime.MinValue'\n            return DateTime.UtcNow - currentValue;\n        }\n\n        private string GetErrorMessage(TimeSpan currentTimeStepElapsed)\n        {\n            var message = $\"Algorithm took longer than {_timeLoopMaximum.TotalMinutes} minutes on a single time loop.\";\n\n            var minutesAboveStandardLimit = _additionalMinutes - (int) _timeLoopMaximum.TotalMinutes;\n            if (minutesAboveStandardLimit > 0)\n            {\n                message = $\"{message} An additional {minutesAboveStandardLimit} minutes were also allocated and consumed.\";\n            }\n\n            message = $\"{message} CurrentTimeStepElapsed: {currentTimeStepElapsed.TotalMinutes:0.0} minutes\";\n\n            return message;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/AggregationManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Common;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Aggregates ticks and bars based on given subscriptions.\n    /// Current implementation is based on <see cref=\"IDataConsolidator\"/> that consolidates ticks and put them into enumerator.\n    /// </summary>\n    public class AggregationManager : IDataAggregator\n    {\n        private readonly ConcurrentDictionary<SecurityIdentifier, List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>>> _enumerators\n            = new ConcurrentDictionary<SecurityIdentifier, List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>>>();\n        private bool _dailyStrictEndTimeEnabled;\n\n        /// <summary>\n        /// Continuous UTC time provider\n        /// </summary>\n        protected ITimeProvider TimeProvider { get; set; } = RealTimeProvider.Instance;\n\n        /// <summary>\n        /// Initialize this instance\n        /// </summary>\n        /// <param name=\"parameters\">The parameters dto instance</param>\n        public void Initialize(DataAggregatorInitializeParameters parameters)\n        {\n            _dailyStrictEndTimeEnabled = parameters.AlgorithmSettings.DailyPreciseEndTime;\n            Log.Trace($\"AggregationManager.Initialize(): daily strict end times: {_dailyStrictEndTimeEnabled}\");\n        }\n\n        /// <summary>\n        /// Add new subscription to current <see cref=\"IDataAggregator\"/> instance\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        public IEnumerator<BaseData> Add(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n        {\n            var consolidator = GetConsolidator(dataConfig);\n            var isPeriodBased = (dataConfig.Type.Name == nameof(QuoteBar) ||\n                    dataConfig.Type.Name == nameof(TradeBar) ||\n                    dataConfig.Type.Name == nameof(OpenInterest)) &&\n                dataConfig.Resolution != Resolution.Tick;\n            var enumerator = new ScannableEnumerator<BaseData>(consolidator, dataConfig.ExchangeTimeZone, TimeProvider, newDataAvailableHandler, isPeriodBased);\n\n            _enumerators.AddOrUpdate(\n                dataConfig.Symbol.ID,\n                new List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>> { new KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>(dataConfig, enumerator) },\n                (k, v) => { return v.Concat(new[] { new KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>(dataConfig, enumerator) }).ToList(); });\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Removes the handler with the specified identifier\n        /// </summary>\n        /// <param name=\"dataConfig\">Subscription data configuration to be removed</param>\n        public bool Remove(SubscriptionDataConfig dataConfig)\n        {\n            List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>> enumerators;\n            if (_enumerators.TryGetValue(dataConfig.Symbol.ID, out enumerators))\n            {\n                if (enumerators.Count == 1)\n                {\n                    List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>> output;\n                    return _enumerators.TryRemove(dataConfig.Symbol.ID, out output);\n                }\n                else\n                {\n                    _enumerators[dataConfig.Symbol.ID] = enumerators.Where(pair => pair.Key != dataConfig).ToList();\n                    return true;\n                }\n            }\n            else\n            {\n                Log.Debug($\"AggregationManager.Update(): IDataConsolidator for symbol ({dataConfig.Symbol.Value}) was not found.\");\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Add new data to aggregator\n        /// </summary>\n        /// <param name=\"input\">The new data</param>\n        public void Update(BaseData input)\n        {\n            try\n            {\n                List<KeyValuePair<SubscriptionDataConfig, ScannableEnumerator<BaseData>>> enumerators;\n                if (_enumerators.TryGetValue(input.Symbol.ID, out enumerators))\n                {\n                    for (var i = 0; i < enumerators.Count; i++)\n                    {\n                        var kvp = enumerators[i];\n\n                        // for non tick resolution subscriptions drop suspicious ticks\n                        if (kvp.Key.Resolution != Resolution.Tick)\n                        {\n                            var tick = input as Tick;\n                            if (tick != null && tick.Suspicious)\n                            {\n                                continue;\n                            }\n                        }\n\n                        kvp.Value.Update(input);\n                    }\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n            }\n        }\n\n        /// <summary>\n        /// Dispose of the aggregation manager.\n        /// </summary>\n        public void Dispose() { }\n\n        /// <summary>\n        /// Gets the consolidator to aggregate data for the given config\n        /// </summary>\n        protected virtual IDataConsolidator GetConsolidator(SubscriptionDataConfig config)\n        {\n            var period = config.Resolution.ToTimeSpan();\n            if (config.Resolution == Resolution.Daily && (config.Type == typeof(QuoteBar) || config.Type == typeof(TradeBar)))\n            {\n                // in backtesting, daily resolution data does not have extended market hours even if requested, so let's respect the same behavior for live\n                // also this allows us to enable the daily strict end times if required. See 'SetStrictEndTimes'\n                return new MarketHourAwareConsolidator(_dailyStrictEndTimeEnabled, config.Resolution, typeof(Tick), config.TickType, extendedMarketHours: false);\n            }\n            if (config.Type == typeof(QuoteBar))\n            {\n                return new TickQuoteBarConsolidator(period);\n            }\n            if (config.Type == typeof(TradeBar))\n            {\n                return new TickConsolidator(period);\n            }\n            if (config.Type == typeof(OpenInterest))\n            {\n                return new OpenInterestConsolidator(period);\n            }\n            if (config.Type == typeof(Tick))\n            {\n                return FilteredIdentityDataConsolidator.ForTickType(config.TickType);\n            }\n            if (config.Type == typeof(Split))\n            {\n                return new IdentityDataConsolidator<Split>();\n            }\n            if (config.Type == typeof(Dividend))\n            {\n                return new IdentityDataConsolidator<Dividend>();\n            }\n\n            // streaming custom data subscriptions can pass right through\n            return new FilteredIdentityDataConsolidator<BaseData>(data => data.GetType() == config.Type);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ApiDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Api;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An instance of the <see cref=\"IDataProvider\"/> that will download and update data files as needed via QC's Api.\n    /// </summary>\n    public class ApiDataProvider : BaseDownloaderDataProvider\n    {\n        private decimal _purchaseLimit = Config.GetValue(\"data-purchase-limit\", decimal.MaxValue); //QCC\n\n        private readonly HashSet<SecurityType> _unsupportedSecurityType;\n        private readonly DataPricesList _dataPrices;\n        private readonly IApi _api;\n        private readonly bool _subscribedToIndiaEquityMapAndFactorFiles;\n        private readonly bool _subscribedToUsaEquityMapAndFactorFiles;\n        private readonly bool _subscribedToFutureMapAndFactorFiles;\n        private volatile bool _invalidSecurityTypeLog;\n\n        /// <summary>\n        /// Initialize a new instance of the <see cref=\"ApiDataProvider\"/>\n        /// </summary>\n        public ApiDataProvider()\n        {\n            _unsupportedSecurityType = new HashSet<SecurityType> { SecurityType.Future, SecurityType.FutureOption, SecurityType.Index, SecurityType.IndexOption };\n\n            _api = Composer.Instance.GetPart<IApi>();\n\n            // If we have no value for organization get account preferred\n            if (string.IsNullOrEmpty(Globals.OrganizationID))\n            {\n                var account = _api.ReadAccount();\n                Globals.OrganizationID = account?.OrganizationId;\n                Log.Trace($\"ApiDataProvider(): Will use organization Id '{Globals.OrganizationID}'.\");\n            }\n\n            // Read in data prices and organization details\n            _dataPrices = _api.ReadDataPrices(Globals.OrganizationID);\n            var organization = _api.ReadOrganization(Globals.OrganizationID);\n\n            foreach (var productItem in organization.Products.Where(x => x.Type == ProductType.Data).SelectMany(product => product.Items))\n            {\n                if (productItem.Id == 37)\n                {\n                    // Determine if the user is subscribed to Equity map and factor files (Data product Id 37)\n                    _subscribedToUsaEquityMapAndFactorFiles = true;\n                }\n                else if (productItem.Id == 137)\n                {\n                    // Determine if the user is subscribed to Future map and factor files (Data product Id 137)\n                    _subscribedToFutureMapAndFactorFiles = true;\n                }\n                else if (productItem.Id == 172)\n                {\n                    // Determine if the user is subscribed to India map and factor files (Data product Id 172)\n                    _subscribedToIndiaEquityMapAndFactorFiles = true;\n                }\n            }\n\n            // Verify user has agreed to data provider agreements\n            if (organization.DataAgreement.Signed)\n            {\n                //Log Agreement Highlights\n                Log.Trace(\"ApiDataProvider(): Data Terms of Use has been signed. \\r\\n\" +\n                    $\" Find full agreement at: {_dataPrices.AgreementUrl} \\r\\n\" +\n                    \"==========================================================================\\r\\n\" +\n                    $\"CLI API Access Agreement: On {organization.DataAgreement.SignedTime:d} You Agreed:\\r\\n\" +\n                    \" - Display or distribution of data obtained through CLI API Access is not permitted.  \\r\\n\" +\n                    \" - Data and Third Party Data obtained via CLI API Access can only be used for individual or internal employee's use.\\r\\n\" +\n                    \" - Data is provided in LEAN format can not be manipulated for transmission or use in other applications. \\r\\n\" +\n                    \" - QuantConnect is not liable for the quality of data received and is not responsible for trading losses. \\r\\n\" +\n                    \"==========================================================================\");\n                Thread.Sleep(TimeSpan.FromSeconds(3));\n            }\n            else\n            {\n                // Log URL to go accept terms\n                throw new InvalidOperationException($\"ApiDataProvider(): Must agree to terms at {_dataPrices.AgreementUrl}, before using the ApiDataProvider\");\n            }\n\n            // Verify we have the balance to maintain our purchase limit, if not adjust it to meet our balance\n            var balance = organization.Credit.Balance;\n            if (balance < _purchaseLimit)\n            {\n                if (_purchaseLimit != decimal.MaxValue)\n                {\n                    Log.Error(\"ApiDataProvider(): Purchase limit is greater than balance.\" +\n                        $\" Setting purchase limit to balance : {balance}\");\n                }\n                _purchaseLimit = balance;\n            }\n        }\n\n        /// <summary>\n        /// Retrieves data to be used in an algorithm.\n        /// If file does not exist, an attempt is made to download them from the api\n        /// </summary>\n        /// <param name=\"key\">File path representing where the data requested</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        public override Stream Fetch(string key)\n        {\n            return DownloadOnce(key, s =>\n            {\n                // Verify we have enough credit to handle this\n                var pricePath = Api.Api.FormatPathForDataRequest(key);\n                var price = _dataPrices.GetPrice(pricePath);\n\n                // No price found\n                if (price == -1)\n                {\n                    throw new ArgumentException($\"ApiDataProvider.Fetch(): No price found for {pricePath}\");\n                }\n\n                if (_purchaseLimit < price)\n                {\n                    throw new ArgumentException($\"ApiDataProvider.Fetch(): Cost {price} for {pricePath} data exceeds remaining purchase limit: {_purchaseLimit}\");\n                }\n\n                if (DownloadData(key))\n                {\n                    // Update our purchase limit.\n                    _purchaseLimit -= price;\n                }\n            });\n        }\n\n        /// <summary>\n        /// Main filter to determine if this file needs to be downloaded\n        /// </summary>\n        /// <param name=\"filePath\">File we are looking at</param>\n        /// <returns>True if should download</returns>\n        protected override bool NeedToDownload(string filePath)\n        {\n            // Ignore null\n            if (filePath == null)\n            {\n                return false;\n            }\n\n            // Some security types can't be downloaded, lets attempt to extract that information\n            if (LeanData.TryParseSecurityType(filePath, out SecurityType securityType, out var market) &&\n                _unsupportedSecurityType.Contains(securityType) &&\n                // We do support universe data for some security types (options and futures)\n                !IsUniverseData(securityType, filePath))\n            {\n                // we do support future auxiliary data (map and factor files)\n                if (securityType != SecurityType.Future || !IsAuxiliaryData(filePath))\n                {\n                    if (!_invalidSecurityTypeLog)\n                    {\n                        // let's log this once. Will still use any existing data on disk\n                        _invalidSecurityTypeLog = true;\n                        Log.Error($\"ApiDataProvider(): does not support security types: {string.Join(\", \", _unsupportedSecurityType)}\");\n                    }\n                    return false;\n                }\n            }\n\n            if (securityType == SecurityType.Equity && filePath.Contains(\"fine\", StringComparison.InvariantCultureIgnoreCase) && filePath.Contains(\"fundamental\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                // Ignore fine fundamental data requests\n                return false;\n            }\n\n            // Only download if it doesn't exist or is out of date.\n            // Files are only \"out of date\" for non date based files (hour, daily, margins, etc.) because this data is stored all in one file\n            var shouldDownload = !File.Exists(filePath) || filePath.IsOutOfDate();\n\n            if (shouldDownload)\n            {\n                if (securityType == SecurityType.Future)\n                {\n                    if (!_subscribedToFutureMapAndFactorFiles)\n                    {\n                        throw new ArgumentException(\"ApiDataProvider(): Must be subscribed to map and factor files to use the ApiDataProvider \" +\n                            \"to download Future auxiliary data from QuantConnect. \" +\n                            \"Please visit https://www.quantconnect.com/datasets/quantconnect-us-futures-security-master for details.\");\n                    }\n                }\n                // Final check; If we want to download and the request requires equity data we need to be sure they are subscribed to map and factor files\n                else if (!_subscribedToUsaEquityMapAndFactorFiles && market.Equals(Market.USA, StringComparison.InvariantCultureIgnoreCase)\n                         && (securityType == SecurityType.Equity || securityType == SecurityType.Option || IsAuxiliaryData(filePath)))\n                {\n                    throw new ArgumentException(\"ApiDataProvider(): Must be subscribed to map and factor files to use the ApiDataProvider \" +\n                        \"to download Equity data from QuantConnect. \" +\n                        \"Please visit https://www.quantconnect.com/datasets/quantconnect-security-master for details.\");\n                }\n                else if (!_subscribedToIndiaEquityMapAndFactorFiles && market.Equals(Market.India, StringComparison.InvariantCultureIgnoreCase)\n                         && (securityType == SecurityType.Equity || securityType == SecurityType.Option || IsAuxiliaryData(filePath)))\n                {\n                    throw new ArgumentException(\"ApiDataProvider(): Must be subscribed to map and factor files to use the ApiDataProvider \" +\n                        \"to download India data from QuantConnect. \" +\n                        \"Please visit https://www.quantconnect.com/datasets/truedata-india-equity-security-master for details.\");\n                }\n            }\n\n            return shouldDownload;\n        }\n\n        /// <summary>\n        /// Attempt to download data using the Api for and return a FileStream of that data.\n        /// </summary>\n        /// <param name=\"filePath\">The path to store the file</param>\n        /// <returns>A FileStream of the data</returns>\n        protected virtual bool DownloadData(string filePath)\n        {\n            if (Log.DebuggingEnabled)\n            {\n                Log.Debug($\"ApiDataProvider.Fetch(): Attempting to get data from QuantConnect.com's data library for {filePath}.\");\n            }\n\n            if (_api.DownloadData(filePath, Globals.OrganizationID))\n            {\n                Log.Trace($\"ApiDataProvider.Fetch(): Successfully retrieved data for {filePath}.\");\n                return true;\n            }\n            // Failed to download; _api.DownloadData() will post error\n            return false;\n        }\n\n        /// <summary>\n        /// Helper method to determine if this filepath is auxiliary data\n        /// </summary>\n        /// <param name=\"filepath\">The target file path</param>\n        /// <returns>True if this file is of auxiliary data</returns>\n        private static bool IsAuxiliaryData(string filepath)\n        {\n            return filepath.Contains(\"map_files\", StringComparison.InvariantCulture)\n                || filepath.Contains(\"factor_files\", StringComparison.InvariantCulture)\n                || filepath.Contains(\"fundamental\", StringComparison.InvariantCulture)\n                || filepath.Contains(\"shortable\", StringComparison.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Helper method to determine if this file path if for a universe file\n        /// </summary>\n        private static bool IsUniverseData(SecurityType securityType, string filepath)\n        {\n            return (securityType.IsOption() || securityType == SecurityType.Future) &&\n                filepath.Contains(\"universes\", StringComparison.InvariantCulture);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BacktestingChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Base backtesting cache provider which will source symbols from local zip files\n    /// </summary>\n    public abstract class BacktestingChainProvider\n    {\n        /// <summary>\n        /// The map file provider instance to use\n        /// </summary>\n        protected IMapFileProvider MapFileProvider { get; private set; }\n\n        /// <summary>\n        /// The history provider instance to use\n        /// </summary>\n        protected IHistoryProvider HistoryProvider { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BacktestingChainProvider\"/> class\n        /// </summary>\n        protected BacktestingChainProvider()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BacktestingChainProvider\"/> class\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        // TODO: This should be in the chain provider interfaces.\n        // They might be even be unified in a single interface (futures and options chains providers)\n        public void Initialize(ChainProviderInitializeParameters parameters)\n        {\n            HistoryProvider = parameters.HistoryProvider;\n            MapFileProvider = parameters.MapFileProvider;\n        }\n\n        /// <summary>\n        /// Get the contract symbols associated with the given canonical symbol and date\n        /// </summary>\n        /// <param name=\"canonicalSymbol\">The canonical symbol</param>\n        /// <param name=\"date\">The date to search for</param>\n        protected IEnumerable<Symbol> GetSymbols(Symbol canonicalSymbol, DateTime date)\n        {\n            var marketHoursDataBase = MarketHoursDatabase.FromDataFolder();\n            var universeType = canonicalSymbol.SecurityType.IsOption() ? typeof(OptionUniverse) : typeof(FutureUniverse);\n            // Use this GetEntry extension method since it's data type dependent, so we get the correct entry for the option universe\n            var marketHoursEntry = marketHoursDataBase.GetEntry(canonicalSymbol, new[] { universeType });\n\n            // We will add a safety measure in case the universe file for the current time is not available:\n            // we will use the latest available universe file within the last 3 trading dates.\n            // This is useful in cases like live trading when the algorithm is deployed at a time of day when\n            // the universe file is not available yet.\n            var history = (List<Slice>)null;\n            var periods = 1;\n            while ((history == null || history.Count == 0) && periods <= 3)\n            {\n                var startDate = Time.GetStartTimeForTradeBars(marketHoursEntry.ExchangeHours, date, Time.OneDay, periods++,\n                    extendedMarketHours: false, marketHoursEntry.DataTimeZone);\n                var request = new HistoryRequest(\n                    startDate.ConvertToUtc(marketHoursEntry.ExchangeHours.TimeZone),\n                    date.ConvertToUtc(marketHoursEntry.ExchangeHours.TimeZone),\n                    universeType,\n                    canonicalSymbol,\n                    Resolution.Daily,\n                    marketHoursEntry.ExchangeHours,\n                    marketHoursEntry.DataTimeZone,\n                    null,\n                    false,\n                    false,\n                    DataNormalizationMode.Raw,\n                    TickType.Quote);\n                history = HistoryProvider.GetHistory([request], marketHoursEntry.DataTimeZone)?.ToList();\n            }\n\n            var symbols = history == null || history.Count == 0\n                ? Enumerable.Empty<Symbol>()\n                : history.Take(1).GetUniverseData().SelectMany(x => x.Values.Single()).Select(x => x.Symbol);\n\n            if (canonicalSymbol.SecurityType.IsOption())\n            {\n                symbols = symbols.Where(symbol => symbol.SecurityType.IsOption());\n            }\n\n            return symbols.Where(symbol => symbol.ID.Date >= date.Date);\n        }\n\n        /// <summary>\n        /// Helper method to determine if a contract is expired for the requested date\n        /// </summary>\n        protected static bool IsContractExpired(Symbol symbol, DateTime date)\n        {\n            return symbol.ID.Date.Date < date.Date;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BacktestingFutureChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IFutureChainProvider\"/> that reads the list of contracts from open interest zip data files\n    /// </summary>\n    public class BacktestingFutureChainProvider : BacktestingChainProvider, IFutureChainProvider\n    {\n        /// <summary>\n        /// Gets the list of future contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the future chain (only used in backtesting)</param>\n        /// <returns>The list of future contracts</returns>\n        public virtual IEnumerable<Symbol> GetFutureContractList(Symbol symbol, DateTime date)\n        {\n            return GetSymbols(GetSymbol(symbol), date);\n        }\n\n        /// <summary>\n        /// Helper method to get the symbol to use\n        /// </summary>\n        protected static Symbol GetSymbol(Symbol symbol)\n        {\n            if (symbol.SecurityType != SecurityType.Future)\n            {\n                if (symbol.SecurityType == SecurityType.FutureOption && symbol.Underlying != null)\n                {\n                    // be user friendly and take the underlying\n                    symbol = symbol.Underlying;\n                }\n                else\n                {\n                    throw new NotSupportedException($\"BacktestingFutureChainProvider.GetFutureContractList():\" +\n                        $\" {nameof(SecurityType.Future)} or {nameof(SecurityType.FutureOption)} is expected but was {symbol.SecurityType}\");\n                }\n            }\n\n            return symbol.Canonical;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BacktestingOptionChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IOptionChainProvider\"/> that reads the list of contracts from open interest zip data files\n    /// </summary>\n    public class BacktestingOptionChainProvider : BacktestingChainProvider, IOptionChainProvider\n    {\n        /// <summary>\n        /// Gets the list of option contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The option or the underlying symbol to get the option chain for.\n        /// Providing the option allows targeting an option ticker different than the default e.g. SPXW</param>\n        /// <param name=\"date\">The date for which to request the option chain (only used in backtesting)</param>\n        /// <returns>The list of option contracts</returns>\n        public virtual IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date)\n        {\n            Symbol canonicalSymbol;\n            if (!symbol.SecurityType.HasOptions())\n            {\n                // we got an option\n                if (symbol.SecurityType.IsOption() && symbol.Underlying != null)\n                {\n                    canonicalSymbol = GetCanonical(symbol, date);\n                }\n                else\n                {\n                    throw new NotSupportedException($\"BacktestingOptionChainProvider.GetOptionContractList(): \" +\n                        $\"{nameof(SecurityType.Equity)}, {nameof(SecurityType.Future)}, or {nameof(SecurityType.Index)} is expected but was {symbol.SecurityType}\");\n                }\n            }\n            else\n            {\n                // we got the underlying\n                var mappedUnderlyingSymbol = MapUnderlyingSymbol(symbol, date);\n                canonicalSymbol = Symbol.CreateCanonicalOption(mappedUnderlyingSymbol);\n            }\n\n            return GetSymbols(canonicalSymbol, date);\n        }\n\n        private Symbol GetCanonical(Symbol optionSymbol, DateTime date)\n        {\n            // Resolve any mapping before requesting option contract list for equities\n            // Needs to be done in order for the data file key to be accurate\n            if (optionSymbol.Underlying.RequiresMapping())\n            {\n                var mappedUnderlyingSymbol = MapUnderlyingSymbol(optionSymbol.Underlying, date);\n\n                return Symbol.CreateCanonicalOption(mappedUnderlyingSymbol);\n            }\n            else\n            {\n                return optionSymbol.Canonical;\n            }\n        }\n\n        private Symbol MapUnderlyingSymbol(Symbol underlying, DateTime date)\n        {\n            if (underlying.RequiresMapping())\n            {\n                var mapFileResolver = MapFileProvider.Get(AuxiliaryDataKey.Create(underlying));\n                var mapFile = mapFileResolver.ResolveMapFile(underlying);\n                var ticker = mapFile.GetMappedSymbol(date, underlying.Value);\n                return underlying.UpdateMappedSymbol(ticker);\n            }\n            else\n            {\n                return underlying;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BaseDataCollectionAggregatorReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Data source reader that will aggregate data points into a base data collection\n    /// </summary>\n    public class BaseDataCollectionAggregatorReader : TextSubscriptionDataSourceReader\n    {\n        private readonly Type _collectionType;\n        private BaseDataCollection _collection;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TextSubscriptionDataSourceReader\"/> class\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">This provider caches files if needed</param>\n        /// <param name=\"config\">The subscription's configuration</param>\n        /// <param name=\"date\">The date this factory was produced to read data for</param>\n        /// <param name=\"isLiveMode\">True if we're in live mode, false for backtesting</param>\n        /// <param name=\"objectStore\">The object storage for data persistence</param>\n        public BaseDataCollectionAggregatorReader(IDataCacheProvider dataCacheProvider, SubscriptionDataConfig config, DateTime date,\n            bool isLiveMode, IObjectStore objectStore)\n            : base(dataCacheProvider, config, date, isLiveMode, objectStore)\n        {\n            // if the type is not a BaseDataCollection, we'll default to BaseDataCollection.\n            // e.g. custom Python dynamic folding collections need to be aggregated into a BaseDataCollection,\n            // but they implement PythonData, so casting an instance of PythonData to BaseDataCollection will fail.\n            _collectionType = config.Type.IsAssignableTo(typeof(BaseDataCollection)) ? config.Type : typeof(BaseDataCollection);\n        }\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public override IEnumerable<BaseData> Read(SubscriptionDataSource source)\n        {\n            foreach (var point in base.Read(source))\n            {\n                if (point is BaseDataCollection collection && !collection.Data.IsNullOrEmpty())\n                {\n                    // if underlying already is returning an aggregated collection let it through as is\n                    yield return point;\n                }\n                else\n                {\n                    if (_collection != null && _collection.EndTime != point.EndTime)\n                    {\n                        // when we get a new time we flush current collection instance, if any\n                        yield return _collection;\n                        _collection = null;\n                    }\n\n                    if (_collection == null)\n                    {\n                        _collection = (BaseDataCollection)Activator.CreateInstance(_collectionType);\n                        _collection.Time = point.Time;\n                        _collection.Symbol = Config.Symbol;\n                        _collection.EndTime = point.EndTime;\n                    }\n                    // aggregate the data points\n                    _collection.Add(point);\n                }\n            }\n\n            // underlying reader ended, flush current collection instance if any\n            if (_collection != null)\n            {\n                yield return _collection;\n                _collection = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BaseDataExchange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides a means of distributing output from enumerators from a dedicated separate thread\n    /// </summary>\n    public class BaseDataExchange\n    {\n        private Thread _thread;\n        private uint _sleepInterval = 1;\n        private Func<Exception, bool> _isFatalError;\n        private readonly CancellationTokenSource _cancellationTokenSource;\n\n        private readonly string _name;\n        private ManualResetEventSlim _manualResetEventSlim;\n        private ConcurrentDictionary<Symbol, EnumeratorHandler> _enumerators;\n\n        /// <summary>\n        /// Gets or sets how long this thread will sleep when no data is available\n        /// </summary>\n        public uint SleepInterval\n        {\n            get => _sleepInterval;\n            set\n            {\n                if (value == 0)\n                {\n                    throw new ArgumentException(\"Sleep interval should be bigger than 0\");\n                }\n                _sleepInterval = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a name for this exchange\n        /// </summary>\n        public string Name\n        {\n            get { return _name; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataExchange\"/>\n        /// </summary>\n        /// <param name=\"name\">A name for this exchange</param>\n        public BaseDataExchange(string name)\n        {\n            _name = name;\n            _isFatalError = x => false;\n            _cancellationTokenSource = new CancellationTokenSource();\n            _manualResetEventSlim = new ManualResetEventSlim(false);\n            _enumerators = new ConcurrentDictionary<Symbol, EnumeratorHandler>();\n        }\n\n        /// <summary>\n        /// Adds the enumerator to this exchange. If it has already been added\n        /// then it will remain registered in the exchange only once\n        /// </summary>\n        /// <param name=\"handler\">The handler to use when this symbol's data is encountered</param>\n        public void AddEnumerator(EnumeratorHandler handler)\n        {\n            _enumerators[handler.Symbol] = handler;\n            _manualResetEventSlim.Set();\n        }\n\n        /// <summary>\n        /// Adds the enumerator to this exchange. If it has already been added\n        /// then it will remain registered in the exchange only once\n        /// </summary>\n        /// <param name=\"symbol\">A unique symbol used to identify this enumerator</param>\n        /// <param name=\"enumerator\">The enumerator to be added</param>\n        /// <param name=\"shouldMoveNext\">Function used to determine if move next should be called on this\n        /// enumerator, defaults to always returning true</param>\n        /// <param name=\"enumeratorFinished\">Delegate called when the enumerator move next returns false</param>\n        /// <param name=\"handleData\">Handler for data if HandlesData=true</param>\n        public void AddEnumerator(Symbol symbol, IEnumerator<BaseData> enumerator, Func<bool> shouldMoveNext = null, Action<EnumeratorHandler> enumeratorFinished = null, Action<BaseData> handleData = null)\n        {\n            var enumeratorHandler = new EnumeratorHandler(symbol, enumerator, shouldMoveNext, handleData);\n            if (enumeratorFinished != null)\n            {\n                enumeratorHandler.EnumeratorFinished += (sender, args) => enumeratorFinished(args);\n            }\n            AddEnumerator(enumeratorHandler);\n        }\n\n        /// <summary>\n        /// Sets the specified function as the error handler. This function\n        /// returns true if it is a fatal error and queue consumption should\n        /// cease.\n        /// </summary>\n        /// <param name=\"isFatalError\">The error handling function to use when an\n        /// error is encountered during queue consumption. Returns true if queue\n        /// consumption should be stopped, returns false if queue consumption should\n        /// continue</param>\n        public void SetErrorHandler(Func<Exception, bool> isFatalError)\n        {\n            // default to false;\n            _isFatalError = isFatalError ?? (x => false);\n        }\n\n        /// <summary>\n        /// Removes and returns enumerator handler with the specified symbol.\n        /// The removed handler is returned, null if not found\n        /// </summary>\n        public EnumeratorHandler RemoveEnumerator(Symbol symbol)\n        {\n            EnumeratorHandler handler;\n            if (_enumerators.TryRemove(symbol, out handler))\n            {\n                handler.OnEnumeratorFinished();\n                handler.Enumerator.Dispose();\n            }\n            return handler;\n        }\n\n        /// <summary>\n        /// Begins consumption of the wrapped <see cref=\"IDataQueueHandler\"/> on\n        /// a separate thread\n        /// </summary>\n        public void Start()\n        {\n            var manualEvent = new ManualResetEventSlim(false);\n            _thread = new Thread(() =>\n            {\n                manualEvent.Set();\n                Log.Trace($\"BaseDataExchange({Name}) Starting...\");\n                ConsumeEnumerators();\n            }) {  IsBackground = true, Name = Name };\n            _thread.Start();\n\n            manualEvent.Wait();\n            manualEvent.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Ends consumption of the wrapped <see cref=\"IDataQueueHandler\"/>\n        /// </summary>\n        public void Stop()\n        {\n            _thread.StopSafely(TimeSpan.FromSeconds(5), _cancellationTokenSource);\n        }\n\n        /// <summary> Entry point for queue consumption </summary>\n        /// <remarks> This function only returns after <see cref=\"Stop\"/> is called or the token is cancelled</remarks>\n        private void ConsumeEnumerators()\n        {\n            while (!_cancellationTokenSource.Token.IsCancellationRequested)\n            {\n                try\n                {\n                    // call move next each enumerator and invoke the appropriate handlers\n                    _manualResetEventSlim.Reset();\n                    var handled = false;\n                    foreach (var kvp in _enumerators)\n                    {\n                        if (_cancellationTokenSource.Token.IsCancellationRequested)\n                        {\n                            Log.Trace($\"BaseDataExchange({Name}).ConsumeQueue(): Exiting...\");\n                            return;\n                        }\n                        var enumeratorHandler = kvp.Value;\n                        var enumerator = enumeratorHandler.Enumerator;\n\n                        // check to see if we should advance this enumerator\n                        if (!enumeratorHandler.ShouldMoveNext()) continue;\n\n                        if (!enumerator.MoveNext())\n                        {\n                            enumeratorHandler.OnEnumeratorFinished();\n                            enumeratorHandler.Enumerator.Dispose();\n                            _enumerators.TryRemove(enumeratorHandler.Symbol, out enumeratorHandler);\n                            continue;\n                        }\n\n                        if (enumerator.Current == null) continue;\n\n                        handled = true;\n                        enumeratorHandler.HandleData(enumerator.Current);\n                    }\n\n                    if (!handled)\n                    {\n                        // if we didn't handle anything on this past iteration, take a nap\n                        // wait until we timeout, we are cancelled or there is a new enumerator added\n                        _manualResetEventSlim.Wait(Time.GetSecondUnevenWait((int)_sleepInterval), _cancellationTokenSource.Token);\n                    }\n                }\n                catch (OperationCanceledException)\n                {\n                    // thrown by the event watcher\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n                    if (_isFatalError(err))\n                    {\n                        Log.Trace($\"BaseDataExchange({Name}).ConsumeQueue(): Fatal error encountered. Exiting...\");\n                        return;\n                    }\n                }\n            }\n\n            Log.Trace($\"BaseDataExchange({Name}).ConsumeQueue(): Exiting...\");\n        }\n\n        /// <summary>\n        /// Handler used to manage a single enumerator's move next/end of stream behavior\n        /// </summary>\n        public class EnumeratorHandler\n        {\n            private readonly Func<bool> _shouldMoveNext;\n            private readonly Action<BaseData> _handleData;\n\n            /// <summary>\n            /// Event fired when MoveNext returns false\n            /// </summary>\n            public event EventHandler<EnumeratorHandler> EnumeratorFinished;\n\n            /// <summary>\n            /// A unique symbol used to identify this enumerator\n            /// </summary>\n            public Symbol Symbol { get; init; }\n\n            /// <summary>\n            /// The enumerator this handler handles\n            /// </summary>\n            public IEnumerator<BaseData> Enumerator { get; init; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"EnumeratorHandler\"/> class\n            /// </summary>\n            /// <param name=\"symbol\">The symbol to identify this enumerator</param>\n            /// <param name=\"enumerator\">The enumeator this handler handles</param>\n            /// <param name=\"shouldMoveNext\">Predicate function used to determine if we should call move next\n            /// on the symbol's enumerator</param>\n            /// <param name=\"handleData\">Handler for data if HandlesData=true</param>\n            public EnumeratorHandler(Symbol symbol, IEnumerator<BaseData> enumerator, Func<bool> shouldMoveNext = null, Action<BaseData> handleData = null)\n            {\n                Symbol = symbol;\n                Enumerator = enumerator;\n\n                _handleData = handleData;\n                _shouldMoveNext = shouldMoveNext ?? (() => true);\n            }\n\n            /// <summary>\n            /// Event invocator for the <see cref=\"EnumeratorFinished\"/> event\n            /// </summary>\n            public void OnEnumeratorFinished()\n            {\n                EnumeratorFinished?.Invoke(this, this);\n            }\n\n            /// <summary>\n            /// Returns true if this enumerator should move next\n            /// </summary>\n            public bool ShouldMoveNext()\n            {\n                return _shouldMoveNext();\n            }\n\n            /// <summary>\n            /// Handles the specified data.\n            /// </summary>\n            /// <param name=\"data\">The data to be handled</param>\n            public void HandleData(BaseData data)\n            {\n                _handleData?.Invoke(data);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BaseDownloaderDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Base downloader implementation with some helper methods\n    /// </summary>\n    public abstract class BaseDownloaderDataProvider : DefaultDataProvider\n    {\n        /// <summary>\n        /// Synchronizer in charge of guaranteeing a single download per path request\n        /// </summary>\n        private readonly KeyStringSynchronizer _singleDownloadSynchronizer = new();\n\n        /// <summary>\n        /// Helper method which guarantees each requested key is downloaded only once concurrently if required based on <see cref=\"NeedToDownload\"/>\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <param name=\"download\">The download operation we want to perform once concurrently per key</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        protected Stream DownloadOnce(string key, Action<string> download)\n        {\n            // If we don't already have this file or its out of date, download it\n            if (NeedToDownload(key))\n            {\n                // only the first thread will download the rest will wait for him to finish\n                _singleDownloadSynchronizer.Execute(key, singleExecution: true, () => download(key));\n                // single download finished, let's get the stream!\n                return GetStream(key);\n            }\n\n            // even if we are not downloading the file because it exists we need to synchronize because the download might still be updating the file on disk\n            return _singleDownloadSynchronizer.Execute(key, () => GetStream(key));\n        }\n\n        /// <summary>\n        /// Get's the stream for a given file path\n        /// </summary>\n        protected virtual Stream GetStream(string key)\n        {\n            return base.Fetch(key);\n        }\n\n        /// <summary>\n        /// Main filter to determine if this file needs to be downloaded\n        /// </summary>\n        /// <param name=\"filePath\">File we are looking at</param>\n        /// <returns>True if should download</returns>\n        protected abstract bool NeedToDownload(string filePath);\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/BaseSubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.ComponentModel;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.Transport;\nusing QuantConnect.Algorithm;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// A base class for implementations of the <see cref=\"ISubscriptionDataSourceReader\"/>\n    /// </summary>\n    public abstract class BaseSubscriptionDataSourceReader : ISubscriptionDataSourceReader\n    {\n        /// <summary>\n        /// True if we're in live mode, false for backtesting\n        /// </summary>\n        protected bool IsLiveMode { get; }\n\n        /// <summary>\n        /// The data cache provider to use\n        /// </summary>\n        protected IDataCacheProvider DataCacheProvider { get; }\n\n        /// <summary>\n        /// The object store to use\n        /// </summary>\n        protected IObjectStore ObjectStore { get; }\n\n        /// <summary>\n        /// Event fired when the specified source is considered invalid, this may\n        /// be from a missing file or failure to download a remote source\n        /// </summary>\n        public event EventHandler<InvalidSourceEventArgs> InvalidSource;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        protected BaseSubscriptionDataSourceReader(IDataCacheProvider dataCacheProvider, bool isLiveMode, IObjectStore objectStore)\n        {\n            DataCacheProvider = dataCacheProvider;\n            IsLiveMode = isLiveMode;\n            ObjectStore = objectStore;\n        }\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public abstract IEnumerable<BaseData> Read(SubscriptionDataSource source);\n\n        /// <summary>\n        /// Creates a new <see cref=\"IStreamReader\"/> for the specified <paramref name=\"subscriptionDataSource\"/>\n        /// </summary>\n        /// <param name=\"subscriptionDataSource\">The source to produce an <see cref=\"IStreamReader\"/> for</param>\n        /// <returns>A new instance of <see cref=\"IStreamReader\"/> to read the source, or null if there was an error</returns>\n        protected IStreamReader CreateStreamReader(SubscriptionDataSource subscriptionDataSource)\n        {\n            IStreamReader reader = null;\n            try\n            {\n                switch (subscriptionDataSource.TransportMedium)\n                {\n                    case SubscriptionTransportMedium.LocalFile:\n                        reader = new LocalFileSubscriptionStreamReader(DataCacheProvider, subscriptionDataSource.Source);\n                        break;\n\n                    case SubscriptionTransportMedium.RemoteFile:\n                        reader = HandleRemoteSourceFile(subscriptionDataSource);\n                        break;\n\n                    case SubscriptionTransportMedium.Rest:\n                        reader = new RestSubscriptionStreamReader(subscriptionDataSource.Source, subscriptionDataSource.Headers, IsLiveMode);\n                        break;\n\n                    case SubscriptionTransportMedium.ObjectStore:\n                        reader = new ObjectStoreSubscriptionStreamReader(ObjectStore, subscriptionDataSource.Source);\n                        break;\n\n                    default:\n                        throw new InvalidEnumArgumentException(\"Unexpected SubscriptionTransportMedium specified: \" + subscriptionDataSource.TransportMedium);\n                }\n            }\n            catch (Exception e)\n            {\n                OnInvalidSource(subscriptionDataSource, e);\n                return reader;\n            }\n\n            if (reader == null || reader.EndOfStream)\n            {\n                OnInvalidSource(subscriptionDataSource, new Exception($\"The reader was empty for source: ${subscriptionDataSource.Source}\"));\n                return null;\n            }\n            return reader;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"InvalidSource\"/> event\n        /// </summary>\n        /// <param name=\"source\">The <see cref=\"SubscriptionDataSource\"/> that was invalid</param>\n        /// <param name=\"exception\">The exception if one was raised, otherwise null</param>\n        protected void OnInvalidSource(SubscriptionDataSource source, Exception exception)\n        {\n            InvalidSource?.Invoke(this, new InvalidSourceEventArgs(source, exception));\n        }\n\n        /// <summary>\n        /// Opens up an IStreamReader for a remote file source\n        /// </summary>\n        private IStreamReader HandleRemoteSourceFile(SubscriptionDataSource source)\n        {\n            SubscriptionDataSourceReader.CheckRemoteFileCache();\n\n            try\n            {\n                // this will fire up a web client in order to download the 'source' file to the cache\n                return new RemoteFileSubscriptionStreamReader(DataCacheProvider, source.Source, Globals.Cache, source.Headers);\n            }\n            catch (Exception)\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/CachingFutureChainProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IFutureChainProvider\"/> that will cache by date future contracts returned by another future chain provider.\n    /// </summary>\n    public class CachingFutureChainProvider : IFutureChainProvider\n    {\n        private readonly ConcurrentDictionary<Symbol, FutureChainCacheEntry> _cache = new ConcurrentDictionary<Symbol, FutureChainCacheEntry>();\n        private readonly IFutureChainProvider _futureChainProvider;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CachingFutureChainProvider\"/> class\n        /// </summary>\n        /// <param name=\"futureChainProvider\"></param>\n        public CachingFutureChainProvider(IFutureChainProvider futureChainProvider)\n        {\n            _futureChainProvider = futureChainProvider;\n        }\n\n        /// <summary>\n        /// Gets the list of future contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the future chain (only used in backtesting)</param>\n        /// <returns>The list of future contracts</returns>\n        public IEnumerable<Symbol> GetFutureContractList(Symbol symbol, DateTime date)\n        {\n            List<Symbol> symbols;\n\n            FutureChainCacheEntry entry;\n            if (!_cache.TryGetValue(symbol, out entry) || date.Date != entry.Date)\n            {\n                symbols = _futureChainProvider.GetFutureContractList(symbol, date.Date).ToList();\n                _cache[symbol] = new FutureChainCacheEntry(date.Date, symbols);\n            }\n            else\n            {\n                symbols = entry.Symbols;\n            }\n\n            return symbols;\n        }\n\n        private class FutureChainCacheEntry\n        {\n            public DateTime Date { get; }\n            public List<Symbol> Symbols { get; }\n\n            public FutureChainCacheEntry(DateTime date, List<Symbol> symbols)\n            {\n                Date = date;\n                Symbols = symbols;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/CachingOptionChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IOptionChainProvider\"/> that will cache by date option contracts returned by another option chain provider.\n    /// </summary>\n    public class CachingOptionChainProvider : IOptionChainProvider\n    {\n        private readonly ConcurrentDictionary<Symbol, OptionChainCacheEntry> _cache = new ConcurrentDictionary<Symbol, OptionChainCacheEntry>();\n        private readonly IOptionChainProvider _optionChainProvider;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CachingOptionChainProvider\"/> class\n        /// </summary>\n        /// <param name=\"optionChainProvider\"></param>\n        public CachingOptionChainProvider(IOptionChainProvider optionChainProvider)\n        {\n            _optionChainProvider = optionChainProvider;\n        }\n\n        /// <summary>\n        /// Gets the list of option contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The option or the underlying symbol to get the option chain for.\n        /// Providing the option allows targetting an option ticker different than the default e.g. SPXW</param>\n        /// <param name=\"date\">The date for which to request the option chain (only used in backtesting)</param>\n        /// <returns>The list of option contracts</returns>\n        public IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date)\n        {\n            List<Symbol> symbols;\n\n            OptionChainCacheEntry entry;\n            if (!_cache.TryGetValue(symbol, out entry) || date.Date != entry.Date)\n            {\n                symbols = _optionChainProvider.GetOptionContractList(symbol, date.Date).ToList();\n                _cache[symbol] = new OptionChainCacheEntry(date.Date, symbols);\n            }\n            else\n            {\n                symbols = entry.Symbols;\n            }\n\n            return symbols;\n        }\n\n        private class OptionChainCacheEntry\n        {\n            public DateTime Date { get; }\n            public List<Symbol> Symbols { get; }\n\n            public OptionChainCacheEntry(DateTime date, List<Symbol> symbols)\n            {\n                Date = date;\n                Symbols = symbols;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ChainProviderInitializeParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// DTO for initializing the <see cref=\"BacktestingOptionChainProvider\"/>\n    /// </summary>\n    public class ChainProviderInitializeParameters\n    {\n        /// <summary>\n        /// The map file provider instance to us\n        /// </summary>\n        public IMapFileProvider MapFileProvider { get; set; }\n\n        /// <summary>\n        /// The history provider to use\n        /// </summary>\n        public IHistoryProvider HistoryProvider { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChainProviderInitializeParameters\"/> class\n        /// </summary>\n        /// <param name=\"mapFileProvider\">The map file provider instance to use</param>\n        /// <param name=\"historyProvider\">The history provider to use</param>\n        public ChainProviderInitializeParameters(IMapFileProvider mapFileProvider, IHistoryProvider historyProvider)\n        {\n            MapFileProvider = mapFileProvider;\n            HistoryProvider = historyProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/CollectionSubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Collection Subscription Factory takes a BaseDataCollection from BaseData factories\n    /// and yields it one point at a time to the algorithm\n    /// </summary>\n    public class CollectionSubscriptionDataSourceReader : BaseSubscriptionDataSourceReader\n    {\n        private readonly DateTime _date;\n        private readonly BaseData _factory;\n        private readonly SubscriptionDataConfig _config;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CollectionSubscriptionDataSourceReader\"/> class\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">Used to cache data for requested from the IDataProvider</param>\n        /// <param name=\"config\">The subscription's configuration</param>\n        /// <param name=\"date\">The date this factory was produced to read data for</param>\n        /// <param name=\"isLiveMode\">True if we're in live mode, false for backtesting</param>\n        public CollectionSubscriptionDataSourceReader(IDataCacheProvider dataCacheProvider, SubscriptionDataConfig config, DateTime date, bool isLiveMode, IObjectStore objectStore)\n            :base(dataCacheProvider, isLiveMode, objectStore)\n        {\n            _date = date;\n            _config = config;\n            _factory = _config.GetBaseDataInstance();\n        }\n\n        /// <summary>\n        /// Event fired when an exception is thrown during a call to\n        /// <see cref=\"BaseData.Reader(SubscriptionDataConfig, string, DateTime, bool)\"/>\n        /// </summary>\n        public event EventHandler<ReaderErrorEventArgs> ReaderError;\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public override IEnumerable<BaseData> Read(SubscriptionDataSource source)\n        {\n            SubscriptionDataSourceReader.CheckRemoteFileCache();\n\n            IStreamReader reader = null;\n            try\n            {\n                reader = CreateStreamReader(source);\n                if (reader == null)\n                {\n                    yield break;\n                }\n\n                var raw = \"\";\n                while (!reader.EndOfStream)\n                {\n                    BaseDataCollection instances = null;\n                    try\n                    {\n                        raw = reader.ReadLine();\n                        var result = _factory.Reader(_config, raw, _date, IsLiveMode);\n                        instances = result as BaseDataCollection;\n                        if (instances == null && !reader.ShouldBeRateLimited)\n                        {\n                            OnInvalidSource(source, new Exception(\"Reader must generate a BaseDataCollection with the FileFormat.Collection\"));\n                            continue;\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        OnReaderError(raw, err);\n                        if (!reader.ShouldBeRateLimited)\n                        {\n                            continue;\n                        }\n                    }\n\n                    if (IsLiveMode\n                        // this shouldn't happen, rest reader is the only one to be rate limited\n                        // and in live mode, but just in case...\n                        || instances == null && reader.ShouldBeRateLimited)\n                    {\n                        // in live trading these data points will be unrolled at the\n                        // 'LiveCustomDataSubscriptionEnumeratorFactory' level\n                        yield return instances;\n                    }\n                    else\n                    {\n                        foreach (var instance in instances.Data)\n                        {\n                            if (instance != null && instance.EndTime != default(DateTime))\n                            {\n                                yield return instance;\n                            }\n                        }\n                    }\n                }\n            }\n            finally\n            {\n                reader.DisposeSafely();\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ReaderError\"/> event\n        /// </summary>\n        /// <param name=\"line\">The line that caused the exception</param>\n        /// <param name=\"exception\">The exception that was caught</param>\n        private void OnReaderError(string line, Exception exception)\n        {\n            var handler = ReaderError;\n            if (handler != null) handler(this, new ReaderErrorEventArgs(line, exception));\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/CompositeDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// This data provider will wrap and use multiple data providers internally in the provided order\n    /// </summary>\n    public class CompositeDataProvider : IDataProvider\n    {\n        /// <summary>\n        /// Event raised each time data fetch is finished (successfully or not)\n        /// </summary>\n        public event EventHandler<DataProviderNewDataRequestEventArgs> NewDataRequest;\n\n        private readonly List<IDataProvider> _dataProviders;\n\n        /// <summary>\n        /// Creates a new instance and initialize data providers used\n        /// </summary>\n        public CompositeDataProvider()\n        {\n            _dataProviders = new List<IDataProvider>();\n\n            var dataProvidersConfig = Config.Get(\"composite-data-providers\");\n            if (!string.IsNullOrEmpty(dataProvidersConfig))\n            {\n                var dataProviders = JsonConvert.DeserializeObject<List<string>>(dataProvidersConfig);\n                foreach (var dataProvider in dataProviders)\n                {\n                    _dataProviders.Add(Composer.Instance.GetExportedValueByTypeName<IDataProvider>(dataProvider));\n                }\n\n                if (_dataProviders.Count == 0)\n                {\n                    throw new ArgumentException(\"CompositeDataProvider(): requires at least 1 valid data provider in 'composite-data-providers'\");\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"CompositeDataProvider(): requires 'composite-data-providers' to be set with a valid type name\");\n            }\n\n            _dataProviders.ForEach(x => x.NewDataRequest += OnNewDataRequest);\n        }\n\n        /// <summary>\n        /// Retrieves data to be used in an algorithm\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        public Stream Fetch(string key)\n        {\n            for (var i = 0; i < _dataProviders.Count; i++)\n            {\n                var result = _dataProviders[i].Fetch(key);\n\n                if (result != null)\n                {\n                    return result;\n                }\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NewDataRequest\"/> event\n        /// </summary>\n        private void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs e)\n        {\n            NewDataRequest?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/CompositeTimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// The composite time provider will source it's current time using the smallest time from the given providers\n    /// </summary>\n    public class CompositeTimeProvider : ITimeProvider\n    {\n        private readonly ITimeProvider[] _timeProviders;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeProviders\">The time providers to use. Will default to the real time provider if empty</param>\n        public CompositeTimeProvider(IEnumerable<ITimeProvider> timeProviders)\n        {\n            _timeProviders = timeProviders.DefaultIfEmpty(RealTimeProvider.Instance).ToArray();\n        }\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        public DateTime GetUtcNow()\n        {\n            var result = DateTime.MaxValue;\n            for (var i = 0; i < _timeProviders.Length; i++)\n            {\n                var utcNow = _timeProviders[i].GetUtcNow();\n\n                if (utcNow < result)\n                {\n                    // we return the smallest\n                    result = utcNow;\n                }\n            }\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/CreateStreamReaderErrorEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"TextSubscriptionDataSourceReader\"/>'s CreateStreamReader event\n    /// </summary>\n    public sealed class CreateStreamReaderErrorEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the date of the source\n        /// </summary>\n        public DateTime Date\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the source that caused the error\n        /// </summary>\n        public SubscriptionDataSource Source\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CreateStreamReaderErrorEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"date\">The date of the source</param>\n        /// <param name=\"source\">The source that cause the error</param>\n        public CreateStreamReaderErrorEventArgs(DateTime date, SubscriptionDataSource source)\n        {\n            Date = date;\n            Source = source;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/CurrencySubscriptionDataConfigManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Helper class to keep track of required internal currency <see cref=\"SubscriptionDataConfig\"/>.\n    /// This class is used by the <see cref=\"UniverseSelection\"/>\n    /// </summary>\n    public class CurrencySubscriptionDataConfigManager\n    {\n        private readonly HashSet<SubscriptionDataConfig> _toBeAddedCurrencySubscriptionDataConfigs;\n        private readonly HashSet<SubscriptionDataConfig> _addedCurrencySubscriptionDataConfigs;\n        private bool _ensureCurrencyDataFeeds;\n        private bool _pendingSubscriptionDataConfigs;\n        private readonly CashBook _cashBook;\n        private readonly Resolution _defaultResolution;\n        private readonly SecurityManager _securityManager;\n        private readonly SubscriptionManager _subscriptionManager;\n        private readonly ISecurityService _securityService;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"cashBook\">The cash book instance</param>\n        /// <param name=\"securityManager\">The SecurityManager, required by the cash book for creating new securities</param>\n        /// <param name=\"subscriptionManager\">The SubscriptionManager, required by the cash book for creating new subscription data configs</param>\n        /// <param name=\"securityService\">The SecurityService, required by the cash book for creating new securities</param>\n        /// <param name=\"defaultResolution\">The default resolution to use for the internal subscriptions</param>\n        public CurrencySubscriptionDataConfigManager(CashBook cashBook,\n            SecurityManager securityManager,\n            SubscriptionManager subscriptionManager,\n            ISecurityService securityService,\n            Resolution defaultResolution)\n        {\n            cashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    _ensureCurrencyDataFeeds = true;\n                }\n            };\n\n            _defaultResolution = defaultResolution;\n            _pendingSubscriptionDataConfigs = false;\n            _securityManager = securityManager;\n            _subscriptionManager = subscriptionManager;\n            _securityService = securityService;\n            _cashBook = cashBook;\n            _addedCurrencySubscriptionDataConfigs = new HashSet<SubscriptionDataConfig>();\n            _toBeAddedCurrencySubscriptionDataConfigs = new HashSet<SubscriptionDataConfig>();\n        }\n\n        /// <summary>\n        /// Will verify if there are any <see cref=\"SubscriptionDataConfig\"/> to be removed\n        /// for a given added <see cref=\"Symbol\"/>.\n        /// </summary>\n        /// <param name=\"addedSymbol\">The symbol that was added to the data feed system</param>\n        /// <returns>The SubscriptionDataConfig to be removed, null if none</returns>\n        public SubscriptionDataConfig GetSubscriptionDataConfigToRemove(Symbol addedSymbol)\n        {\n            if (addedSymbol.SecurityType == SecurityType.Crypto\n                || addedSymbol.SecurityType == SecurityType.CryptoFuture\n                || addedSymbol.SecurityType == SecurityType.Forex\n                || addedSymbol.SecurityType == SecurityType.Cfd)\n            {\n                var currencyDataFeed = _addedCurrencySubscriptionDataConfigs\n                    .FirstOrDefault(x => x.Symbol == addedSymbol);\n                if (currencyDataFeed != null)\n                {\n                    return currencyDataFeed;\n                }\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Will update pending currency <see cref=\"SubscriptionDataConfig\"/>\n        /// </summary>\n        /// <returns>True when there are pending currency subscriptions <see cref=\"GetPendingSubscriptionDataConfigs\"/></returns>\n        public bool UpdatePendingSubscriptionDataConfigs(IBrokerageModel brokerageModel)\n        {\n            if (_ensureCurrencyDataFeeds)\n            {\n                // this allows us to handle the case where SetCash is called when no security has been really added\n                EnsureCurrencySubscriptionDataConfigs(SecurityChanges.None, brokerageModel);\n            }\n            return _pendingSubscriptionDataConfigs;\n        }\n\n        /// <summary>\n        /// Will return any pending internal currency <see cref=\"SubscriptionDataConfig\"/> and remove them as pending.\n        /// </summary>\n        /// <returns>Will return the <see cref=\"SubscriptionDataConfig\"/> to be added</returns>\n        public IEnumerable<SubscriptionDataConfig> GetPendingSubscriptionDataConfigs()\n        {\n            var result = new List<SubscriptionDataConfig>();\n            if (_pendingSubscriptionDataConfigs)\n            {\n                foreach (var subscriptionDataConfig in _toBeAddedCurrencySubscriptionDataConfigs)\n                {\n                    _addedCurrencySubscriptionDataConfigs.Add(subscriptionDataConfig);\n                    result.Add(subscriptionDataConfig);\n                }\n                _toBeAddedCurrencySubscriptionDataConfigs.Clear();\n                _pendingSubscriptionDataConfigs = false;\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Checks the current <see cref=\"SubscriptionDataConfig\"/> and adds new necessary currency pair feeds to provide real time conversion data\n        /// </summary>\n        public void EnsureCurrencySubscriptionDataConfigs(SecurityChanges securityChanges, IBrokerageModel brokerageModel)\n        {\n            _ensureCurrencyDataFeeds = false;\n            // remove any 'to be added' if the security has already been added\n            _toBeAddedCurrencySubscriptionDataConfigs.RemoveWhere(\n                config => securityChanges.AddedSecurities.Any(x => x.Symbol == config.Symbol));\n\n            var newConfigs = _cashBook.EnsureCurrencyDataFeeds(\n                _securityManager,\n                _subscriptionManager,\n                brokerageModel.DefaultMarkets,\n                securityChanges,\n                _securityService,\n                _defaultResolution);\n            foreach (var config in newConfigs)\n            {\n                _toBeAddedCurrencySubscriptionDataConfigs.Add(config);\n            }\n            _pendingSubscriptionDataConfigs = _toBeAddedCurrencySubscriptionDataConfigs.Any();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataChannelProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Specifies data channel settings\n    /// </summary>\n    public class DataChannelProvider : IDataChannelProvider\n    {\n        /// <summary>\n        /// Initializes the instance with an algorithm node packet\n        /// </summary>\n        /// <param name=\"packet\">Algorithm node packet</param>\n        public virtual void Initialize(AlgorithmNodePacket packet)\n        {\n        }\n\n        /// <summary>\n        /// True if this subscription request should be streamed\n        /// </summary>\n        public virtual bool ShouldStreamSubscription(SubscriptionDataConfig config)\n        {\n            return IsStreamingType(config) || !config.IsCustomData && config.Type != typeof(CoarseFundamental) && config.Type != typeof(Fundamental) && config.Type != typeof(MarginInterestRate);\n        }\n\n        /// <summary>\n        /// Returns true if the data type for the given subscription configuration supports streaming\n        /// </summary>\n        protected static bool IsStreamingType(SubscriptionDataConfig configuration)\n        {\n            var dataTypeInstance = configuration.Type.GetBaseDataInstance();\n            var source = dataTypeInstance.GetSource(configuration, DateTime.UtcNow, true);\n            return source != null && source.TransportMedium == SubscriptionTransportMedium.Streaming;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataDownloader/CanonicalDataDownloaderDecorator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2026 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing QuantConnect.Lean.Engine.HistoricalData;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.DataDownloader\n{\n    /// <summary>\n    /// Decorates an <see cref=\"IDataDownloader\"/> to support canonical symbols by automatically\n    /// resolving their option or future contract chains and downloading data for each constituent contract.\n    /// </summary>\n    public class CanonicalDataDownloaderDecorator : IDataDownloader\n    {\n        /// <summary>\n        /// Prevents multiple warnings being fired when the underlying data downloader doesn't support canonical symbols.\n        /// </summary>\n        private bool _firedCanonicalNotSupportedWarning;\n\n        /// <summary>\n        /// Lazily initialized option chain provider for resolving option contract lists.\n        /// </summary>\n        private readonly IOptionChainProvider _optionChainProvider;\n\n        /// <summary>\n        /// Lazily initialized future chain provider for resolving future contract lists.\n        /// </summary>\n        private readonly IFutureChainProvider _futureChainProvider;\n\n        /// <summary>\n        /// The underlying data downloader that performs the actual data retrieval.\n        /// </summary>\n        private readonly IDataDownloader _dataDownloader;\n\n        /// <summary>\n        /// Controls parallelism for concurrent operations, \n        /// limiting execution to a configurable number of threads (default: 4) on the default task scheduler.\n        /// </summary>\n        private readonly ParallelOptions _parallelOptions = new()\n        {\n            MaxDegreeOfParallelism = Config.GetInt(\"downloader-thread-count\", 4),\n            TaskScheduler = TaskScheduler.Default\n        };\n\n        /// <summary>\n        /// Configurable look-back period for canonical option symbols, used to limit the date range of underlying contract data downloads.\n        /// </summary>\n        private static readonly int _optionLookbackYeard = Config.GetInt(\"options-lookback-years\", 1);\n\n        /// <summary>\n        /// Configurable look-back period for canonical future symbols, used to limit the date range of underlying contract data downloads.\n        /// </summary>\n        private static readonly int _futureLookbackYeard = Config.GetInt(\"futures-lookback-years\", 2);\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CanonicalDataDownloaderDecorator\"/> class.\n        /// </summary>\n        /// <param name=\"dataDownloader\">The underlying data downloader to decorate with canonical symbol support.</param>\n        /// <param name=\"dataProvider\">The data provider used for initializing chain providers.</param>\n        /// <param name=\"mapFileProvider\">The map file provider used for initializing chain providers.</param>\n        /// <param name=\"factorFileProvider\">The factor file provider used for initializing chain providers.</param>\n        public CanonicalDataDownloaderDecorator(IDataDownloader dataDownloader, IDataProvider dataProvider, IMapFileProvider mapFileProvider, IFactorFileProvider factorFileProvider)\n        {\n            _dataDownloader = dataDownloader;\n\n            var historyManager = new HistoryProviderManager();\n            historyManager.Initialize(\n                new HistoryProviderInitializeParameters(\n                    job: null,\n                    api: null,\n                    dataProvider,\n                    new SingleEntryDataCacheProvider(dataProvider, isDataEphemeral: true),\n                    mapFileProvider,\n                    factorFileProvider: factorFileProvider, // Probably not needed since canonical data doesn't require factor files\n                    statusUpdateAction: null,\n                    parallelHistoryRequestsEnabled: false,\n                    new DataPermissionManager(),\n                    objectStore: null,\n                    new AlgorithmSettings()));\n\n            _optionChainProvider = Composer.Instance.GetPart<IOptionChainProvider>();\n            if (_optionChainProvider == null)\n            {\n                var baseOptionChainProvider = new LiveOptionChainProvider();\n                baseOptionChainProvider.Initialize(new(mapFileProvider, historyManager));\n                _optionChainProvider = new CachingOptionChainProvider(baseOptionChainProvider);\n                Composer.Instance.AddPart(_optionChainProvider);\n            }\n\n            _futureChainProvider = Composer.Instance.GetPart<IFutureChainProvider>();\n            if (_futureChainProvider == null)\n            {\n                var baseFutureChainProvider = new BacktestingFutureChainProvider();\n                baseFutureChainProvider.Initialize(new(mapFileProvider, historyManager));\n                _futureChainProvider = new CachingFutureChainProvider(baseFutureChainProvider);\n                Composer.Instance.AddPart(_futureChainProvider);\n            }\n        }\n\n        /// <summary>\n        /// Get historical data enumerable for a single symbol, type and resolution given this start and end time (in UTC).\n        /// For canonical symbols, automatically resolves and downloads data for all underlying contracts.\n        /// </summary>\n        /// <param name=\"dataDownloaderGetParameters\">model class for passing in parameters for historical data</param>\n        /// <returns>Enumerable of base data for this symbol</returns>\n        public IEnumerable<BaseData>? Get(DataDownloaderGetParameters dataDownloaderGetParameters)\n        {\n            var downloadedData = default(IEnumerable<BaseData>?);\n            try\n            {\n                downloadedData = _dataDownloader.Get(dataDownloaderGetParameters);\n            }\n            catch (Exception ex)\n            {\n                Log.Error($\"{nameof(CanonicalDataDownloaderDecorator)}.{nameof(Get)}.Exceptoin: {ex.Message}\");\n            }\n\n            if (downloadedData == null && dataDownloaderGetParameters.Symbol.IsCanonical())\n            {\n                if (!_firedCanonicalNotSupportedWarning)\n                {\n                    _firedCanonicalNotSupportedWarning = true;\n                    Log.Trace($\"{nameof(CanonicalDataDownloaderDecorator)}.{nameof(Get)}: {_dataDownloader.GetType().Name} does not support canonical symbols. Falling back to chain provider.\");\n                }\n                downloadedData = GetContractsData(dataDownloaderGetParameters);\n            }\n\n            return downloadedData;\n        }\n\n        /// <summary>\n        /// Tries to adjust the date range for a given contract based on its security type and expiry date.\n        /// The start date is clamped to a minimum look-back period and the end date is clamped to the contract expiry date.\n        /// Returns false if the minimum look-back period exceeds the requested end date, meaning no valid range exists.\n        /// </summary>\n        /// <param name=\"contract\">The contract symbol containing the security type and expiry date.</param>\n        /// <param name=\"originalStartDateUtc\">The requested start date in UTC.</param>\n        /// <param name=\"originalEndDateUtc\">The requested end date in UTC.</param>\n        /// <param name=\"adjustedStartDateUtc\">The adjusted start date in UTC, or default if no valid range exists.</param>\n        /// <param name=\"adjustedEndDateUtc\">The adjusted end date in UTC, or default if no valid range exists.</param>\n        /// <returns>True if a valid adjusted date range was found, false otherwise.</returns>\n        public static bool TryAdjustDateRangeForContract(Symbol contract, DateTime originalStartDateUtc, DateTime originalEndDateUtc,\n            out DateTime adjustedStartDateUtc, out DateTime adjustedEndDateUtc)\n        {\n            var expiryDate = contract.ID.Date;\n            var minLookBack = expiryDate;\n            if (contract.ID.SecurityType.IsOption())\n            {\n                minLookBack = expiryDate.AddYears(-_optionLookbackYeard);\n            }\n            else if (contract.ID.SecurityType == SecurityType.Future)\n            {\n                minLookBack = expiryDate.AddYears(-_futureLookbackYeard);\n            }\n\n            if (minLookBack > originalEndDateUtc || expiryDate < originalStartDateUtc)\n            {\n                adjustedStartDateUtc = default;\n                adjustedEndDateUtc = default;\n                return false;\n            }\n\n            adjustedStartDateUtc = minLookBack >= originalStartDateUtc ? minLookBack : originalStartDateUtc;\n            adjustedEndDateUtc = expiryDate <= originalEndDateUtc ? expiryDate.AddDays(1) : originalEndDateUtc;\n            return true;\n        }\n\n        /// <summary>\n        /// Downloads data for all contracts of a canonical symbol in parallel, streaming results as they arrive.\n        /// </summary>\n        private IEnumerable<BaseData>? GetContractsData(DataDownloaderGetParameters parameters)\n        {\n            var contracts = GetContracts(parameters.Symbol, parameters.StartUtc, parameters.EndUtc);\n\n            var blockingCollection = new BlockingCollection<BaseData>();\n\n            var processedContracts = 0L;\n            var producerTask = Task.Run(() =>\n            {\n                try\n                {\n                    Parallel.ForEach(\n                        contracts,\n                        _parallelOptions,\n                        contract =>\n                        {\n                            Interlocked.Increment(ref processedContracts);\n                            if (!TryAdjustDateRangeForContract(contract, parameters.StartUtc, parameters.EndUtc, out var adjustedStartDateUtc, out var adjustedEndDateUtc))\n                            {\n                                return;\n                            }\n\n                            var contractParameters = new DataDownloaderGetParameters(\n                                contract,\n                                parameters.Resolution,\n                                adjustedStartDateUtc,\n                                adjustedEndDateUtc,\n                                parameters.TickType);\n\n                            try\n                            {\n                                var contractData = _dataDownloader.Get(contractParameters);\n\n                                foreach (var data in contractData)\n                                {\n                                    blockingCollection.Add(data);\n                                }\n                            }\n                            catch (Exception ex)\n                            {\n                                Log.Debug($\"{nameof(CanonicalDataDownloaderDecorator)}.{nameof(GetContractsData)}: \" +\n                                    $\"Error downloading data for {contractParameters}. Exception: {ex.Message}. Continuing...\");\n                                return;\n                            }\n                        });\n                }\n                finally\n                {\n                    Log.Debug($\"{nameof(CanonicalDataDownloaderDecorator)}.{nameof(GetContractsData)}: Finished downloading {processedContracts} for canonical symbol.\");\n                    blockingCollection.CompleteAdding();\n                }\n            });\n\n            var consumingEnumerable = blockingCollection.GetConsumingEnumerable();\n\n            if (!consumingEnumerable.Any())\n            {\n                if (Interlocked.Read(ref processedContracts) == 0)\n                {\n                    Log.Error($\"{nameof(CanonicalDataDownloaderDecorator)}.{nameof(GetContractsData)}: No contracts were found. Do you have universe data?\");\n                }\n                return null;\n            }\n\n            return consumingEnumerable;\n        }\n\n        /// <summary>\n        /// Retrieves unique contracts for the given canonical symbol across the specified date range.\n        /// </summary>\n        private IEnumerable<Symbol> GetContracts(Symbol symbol, DateTime startUtc, DateTime endUtc)\n        {\n            var chainProvider = default(Func<Symbol, DateTime, IEnumerable<Symbol>>);\n            if (symbol.SecurityType == SecurityType.Future)\n            {\n                chainProvider = _futureChainProvider.GetFutureContractList;\n            }\n            else if (symbol.SecurityType.IsOption())\n            {\n                chainProvider = _optionChainProvider.GetOptionContractList;\n            }\n            else\n            {\n                throw new ArgumentException($\"Unsupported security type {symbol.SecurityType} for canonical data downloader\", nameof(symbol));\n            }\n\n            var contractsCache = new HashSet<Symbol>();\n            foreach (var date in Time.EachDay(startUtc.Date, endUtc.Date))\n            {\n                foreach (var contract in chainProvider(symbol, date))\n                {\n                    if (contractsCache.Add(contract))\n                    {\n                        yield return contract;\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataDownloader/DataDownloaderSelector.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2026 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.DataDownloader\n{\n    /// <summary>Selects the appropriate data downloader based on the data type.</summary>\n    public class DataDownloaderSelector : IDisposable\n    {\n        private readonly IDataDownloader _baseDataDownloader;\n        private readonly CanonicalDataDownloaderDecorator _canonicalDataDownloaderDecorator;\n\n        /// <summary>Initializes a new instance of the <see cref=\"DataDownloaderSelector\"/> class.</summary>\n        /// <param name=\"baseDataDownloader\">The base data downloader instance.</param>\n        /// <param name=\"mapFileProvider\">The map file provider used for initializing chain providers.</param>\n        /// <param name=\"dataProvider\">The data provider used for initializing chain providers.</param>\n        /// <param name=\"factorFileProvider\">The factor file provider used for initializing chain providers.</param>\n        public DataDownloaderSelector(\n            IDataDownloader baseDataDownloader,\n            IMapFileProvider mapFileProvider,\n            IDataProvider dataProvider,\n            IFactorFileProvider factorFileProvider = null)\n        {\n            factorFileProvider ??= Composer.Instance.GetPart<IFactorFileProvider>();\n            if (factorFileProvider == null)\n            {\n                factorFileProvider = Composer.Instance.GetExportedValueByTypeName<IFactorFileProvider>(Config.Get(\"factor-file-provider\", \"LocalDiskFactorFileProvider\"));\n                factorFileProvider.Initialize(mapFileProvider, dataProvider);\n            }\n\n            _baseDataDownloader = baseDataDownloader;\n            _canonicalDataDownloaderDecorator = new CanonicalDataDownloaderDecorator(_baseDataDownloader, dataProvider, mapFileProvider, factorFileProvider);\n        }\n\n        /// <summary>Disposes the base downloader and the decorator if it was initialized.</summary>\n        public void Dispose()\n        {\n            (_baseDataDownloader as IDisposable)?.DisposeSafely();\n        }\n\n        /// <summary>Returns the appropriate downloader for the given data type.</summary>\n        /// <param name=\"dataType\">The type of data to download.</param>\n        /// <returns>The base downloader for common lean data types, otherwise the canonical decorator.</returns>\n        public IDataDownloader GetDataDownloader(Type dataType)\n        {\n            return LeanData.IsCommonLeanDataType(dataType) ? _canonicalDataDownloaderDecorator : _baseDataDownloader;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataFeedPacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Defines a container type to hold data produced by a data feed subscription\n    /// </summary>\n    public class DataFeedPacket\n    {\n        private static readonly IReadOnlyRef<bool> _false = Ref.CreateReadOnly(() => false);\n        private readonly IReadOnlyRef<bool> _isRemoved;\n\n        /// <summary>\n        /// The security\n        /// </summary>\n        public ISecurityPrice Security\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// The subscription configuration that produced this data\n        /// </summary>\n        public SubscriptionDataConfig Configuration\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the number of data points held within this packet\n        /// </summary>\n        public int Count => Data.Count;\n\n        /// <summary>\n        /// The data for the security\n        /// </summary>\n        public List<BaseData> Data { get; }\n\n        /// <summary>\n        /// Gets whether or not this packet should be filtered out due to the subscription being removed\n        /// </summary>\n        public bool IsSubscriptionRemoved => _isRemoved.Value;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataFeedPacket\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security whose data is held in this packet</param>\n        /// <param name=\"configuration\">The subscription configuration that produced this data</param>\n        /// <param name=\"isSubscriptionRemoved\">Reference to whether or not the subscription has since been removed, defaults to false</param>\n        public DataFeedPacket(ISecurityPrice security, SubscriptionDataConfig configuration, IReadOnlyRef<bool> isSubscriptionRemoved = null)\n            : this(security,\n                configuration,\n                new List<BaseData>(4), // performance: by default the list has 0 capacity, so lets initialize it with at least 4 (which is the default)\n                isSubscriptionRemoved)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DataFeedPacket\"/> class\n        /// </summary>\n        /// <param name=\"security\">The security whose data is held in this packet</param>\n        /// <param name=\"configuration\">The subscription configuration that produced this data</param>\n        /// <param name=\"data\">The data to add to this packet. The list reference is reused\n        /// internally and NOT copied.</param>\n        /// <param name=\"isSubscriptionRemoved\">Reference to whether or not the subscription has since been removed, defaults to false</param>\n        public DataFeedPacket(ISecurityPrice security, SubscriptionDataConfig configuration, List<BaseData> data, IReadOnlyRef<bool> isSubscriptionRemoved = null)\n        {\n            Security = security;\n            Configuration = configuration;\n            Data = data;\n            _isRemoved = isSubscriptionRemoved ?? _false;\n        }\n\n        /// <summary>\n        /// Adds the specified data to this packet\n        /// </summary>\n        /// <param name=\"data\">The data to be added to this packet</param>\n        public void Add(BaseData data)\n        {\n            Data.Add(data);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// DataManager will manage the subscriptions for both the DataFeeds and the SubscriptionManager\n    /// </summary>\n    public class DataManager : IAlgorithmSubscriptionManager, IDataFeedSubscriptionManager, IDataManager\n    {\n        private readonly IDataFeed _dataFeed;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n        private readonly ITimeKeeper _timeKeeper;\n        private readonly bool _liveMode;\n        private bool _sentUniverseScheduleWarning;\n        private readonly IRegisteredSecurityDataTypesProvider _registeredTypesProvider;\n        private readonly IDataPermissionManager _dataPermissionManager;\n        private List<SubscriptionDataConfig> _subscriptionDataConfigsEnumerator;\n        private readonly IAlgorithm _algorithm;\n\n        private bool _unsupportedUniverseSettingsResolutionWarningSent;\n\n        /// There is no ConcurrentHashSet collection in .NET,\n        /// so we use ConcurrentDictionary with byte value to minimize memory usage\n        private readonly Dictionary<SubscriptionDataConfig, SubscriptionDataConfig> _subscriptionManagerSubscriptions = new();\n\n        /// <summary>\n        /// Event fired when a new subscription is added\n        /// </summary>\n        public event EventHandler<Subscription> SubscriptionAdded;\n\n        /// <summary>\n        /// Event fired when an existing subscription is removed\n        /// </summary>\n        public event EventHandler<Subscription> SubscriptionRemoved;\n\n        /// <summary>\n        /// Creates a new instance of the DataManager\n        /// </summary>\n        public DataManager(\n            IDataFeed dataFeed,\n            UniverseSelection universeSelection,\n            IAlgorithm algorithm,\n            ITimeKeeper timeKeeper,\n            MarketHoursDatabase marketHoursDatabase,\n            bool liveMode,\n            IRegisteredSecurityDataTypesProvider registeredTypesProvider,\n            IDataPermissionManager dataPermissionManager)\n        {\n            _dataFeed = dataFeed;\n            UniverseSelection = universeSelection;\n            UniverseSelection.SetDataManager(this);\n            AvailableDataTypes = SubscriptionManager.DefaultDataTypes();\n            _timeKeeper = timeKeeper;\n            _marketHoursDatabase = marketHoursDatabase;\n            _liveMode = liveMode;\n            _registeredTypesProvider = registeredTypesProvider;\n            _dataPermissionManager = dataPermissionManager;\n            _algorithm = algorithm;\n\n            // wire ourselves up to receive notifications when universes are added/removed\n            algorithm.UniverseManager.CollectionChanged += (sender, args) =>\n            {\n                var universe = args.Value;\n                switch (args.Action)\n                {\n                    case NotifyCollectionChangedAction.Replace:\n                    case NotifyCollectionChangedAction.Add:\n                        var config = universe.Configuration;\n                        var start = algorithm.UtcTime;\n                        if (algorithm.GetLocked() && args.Action == NotifyCollectionChangedAction.Add && universe is UserDefinedUniverse)\n                        {\n                            // If it is an add, after initialize, we will set time 1 tick ahead to properly sync data\n                            // with next timeslice, avoid emitting now twice, if it is a remove then we will set time to now\n                            // we do the same in the 'DataManager' when handling FF resolution changes\n                            start = start.AddTicks(1);\n                        }\n\n                        var end = algorithm.LiveMode ? Time.EndOfTime\n                            : algorithm.EndDate.ConvertToUtc(algorithm.TimeZone);\n\n                        Security security;\n                        if (!algorithm.Securities.TryGetValue(config.Symbol, out security))\n                        {\n                            // create a canonical security object if it doesn't exist\n                            security = new Security(\n                                _marketHoursDatabase.GetExchangeHours(config),\n                                config,\n                                algorithm.Portfolio.CashBook[algorithm.AccountCurrency],\n                                SymbolProperties.GetDefault(algorithm.AccountCurrency),\n                                algorithm.Portfolio.CashBook,\n                                RegisteredSecurityDataTypesProvider.Null,\n                                new SecurityCache()\n                             );\n                        }\n\n                        // Let's adjust the start time to the previous tradable date\n                        // so universe selection always happens right away at the start of the algorithm.\n                        var universeType = universe.GetType();\n                        if (\n                            // We exclude the UserDefinedUniverse because their selection already happens at the algorithm start time.\n                            // For instance, ETFs universe selection depends its first trigger time to be before the equity universe\n                            // (the UserDefinedUniverse), because the ETFs are EndTime-indexed and that would make their first selection\n                            // time to be before the algorithm start time, with the EndTime being the algorithms's start date,\n                            // and both the Equity and the ETFs constituents first selection to happen together.\n                            !universeType.IsAssignableTo(typeof(UserDefinedUniverse)) &&\n                            // We exclude the ScheduledUniverse because it's already scheduled to run at a specific time.\n                            // Adjusting the start time would cause the first selection trigger time to be before the algorithm start time,\n                            // making the selection to be triggered at the first algorithm time, which would be the exact StartDate.\n                            universeType != typeof(ScheduledUniverse))\n                        {\n                            const int maximumLookback = 365;\n                            var loopCount = 0;\n                            var startLocalTime = start.ConvertFromUtc(security.Exchange.TimeZone);\n                            if (universe.UniverseSettings.Schedule.Initialized)\n                            {\n                                do\n                                {\n                                    // determine if there's a scheduled selection time at the current start local time date, note that next\n                                    // we get the previous day of the first scheduled date we find, so we are sure the data is available to trigger selection\n                                    if (universe.UniverseSettings.Schedule.Get(startLocalTime.Date, startLocalTime.Date).Any())\n                                    {\n                                        break;\n                                    }\n                                    startLocalTime = startLocalTime.AddDays(-1);\n                                    if (++loopCount >= maximumLookback)\n                                    {\n                                        // fallback to the original, we found none\n                                        startLocalTime = algorithm.UtcTime.ConvertFromUtc(security.Exchange.TimeZone);\n                                        if (!_sentUniverseScheduleWarning)\n                                        {\n                                            // just in case\n                                            _sentUniverseScheduleWarning = true;\n                                            algorithm.Debug($\"Warning: Found no valid start time for scheduled universe, will use default\");\n                                        }\n                                    }\n                                } while (loopCount < maximumLookback);\n                            }\n\n                            startLocalTime = Time.GetStartTimeForTradeBars(security.Exchange.Hours, startLocalTime,\n                                // disable universe selection on extended market hours, for example futures/index options have a sunday pre market we are not interested on\n                                Time.OneDay, 1, extendedMarketHours: false, config.DataTimeZone,\n                                LeanData.UseDailyStrictEndTimes(algorithm.Settings, config.Type, security.Symbol, Time.OneDay, security.Exchange.Hours));\n                            start = startLocalTime.ConvertToUtc(security.Exchange.TimeZone);\n                        }\n\n                        AddSubscription(\n                            new SubscriptionRequest(true,\n                                universe,\n                                security,\n                                config,\n                                start,\n                                end));\n                        break;\n\n                    case NotifyCollectionChangedAction.Remove:\n                        // removing the subscription will be handled by the SubscriptionSynchronizer\n                        // in the next loop as well as executing a UniverseSelection one last time.\n                        if (!universe.DisposeRequested)\n                        {\n                            universe.Dispose();\n                        }\n                        break;\n\n                    default:\n                        throw new NotImplementedException(\"The specified action is not implemented: \" + args.Action);\n                }\n            };\n\n            DataFeedSubscriptions = new SubscriptionCollection();\n            if (!_liveMode)\n            {\n                DataFeedSubscriptions.FillForwardResolutionChanged += (object sender, FillForwardResolutionChangedEvent changedEvent) =>\n                {\n                    var requests = DataFeedSubscriptions\n                        // we don't fill forward tick resolution so we don't need to touch their subscriptions\n                        .Where(subscription => subscription.Configuration.FillDataForward && subscription.Configuration.Resolution != Resolution.Tick)\n                        .SelectMany(subscription => subscription.SubscriptionRequests)\n                        .ToList();\n\n                    if (requests.Count > 0)\n                    {\n                        Log.Trace($\"DataManager(): Fill forward resolution has changed from {changedEvent.Old} to {changedEvent.New} at utc: {algorithm.UtcTime}. \" +\n                            $\"Restarting {requests.Count} subscriptions...\");\n\n                        // disable reentry while we remove and re add\n                        DataFeedSubscriptions.FreezeFillForwardResolution(true);\n\n                        // remove\n                        foreach (var request in requests)\n                        {\n                            // force because we want them actually removed even if still a member of the universe, because the FF res changed\n                            // which means we will drop any data points that could be in the next potential slice being created\n                            RemoveSubscriptionInternal(request.Configuration, universe: request.Universe, forceSubscriptionRemoval: true);\n                        }\n\n                        // re add\n                        foreach (var request in requests)\n                        {\n                            // If it is an add we will set time 1 tick ahead to properly sync data\n                            // with next timeslice, avoid emitting now twice.\n                            // We do the same in the 'TimeTriggeredUniverseSubscriptionEnumeratorFactory' when handling changes\n                            var startUtc = algorithm.UtcTime;\n                            // If the algorithm is not initialized (locked) the request start time can be even before the algorithm start time,\n                            // like in the case of universe requests that are scheduled to run at a specific time in the past for immediate selection.\n                            if (!algorithm.GetLocked() && request.StartTimeUtc < startUtc)\n                            {\n                                startUtc = request.StartTimeUtc;\n                            }\n                            AddSubscription(new SubscriptionRequest(request,\n                                startTimeUtc: startUtc.AddTicks(1),\n                                configuration: new SubscriptionDataConfig(request.Configuration)));\n                        }\n\n                        DataFeedSubscriptions.FreezeFillForwardResolution(false);\n                    }\n                };\n            }\n        }\n\n        #region IDataFeedSubscriptionManager\n\n        /// <summary>\n        /// Gets the data feed subscription collection\n        /// </summary>\n        public SubscriptionCollection DataFeedSubscriptions { get; }\n\n        /// <summary>\n        /// Will remove all current <see cref=\"Subscription\"/>\n        /// </summary>\n        public void RemoveAllSubscriptions()\n        {\n            // remove each subscription from our collection\n            foreach (var subscription in DataFeedSubscriptions)\n            {\n                try\n                {\n                    RemoveSubscription(subscription.Configuration);\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err, \"DataManager.RemoveAllSubscriptions():\" +\n                        $\"Error removing: {subscription.Configuration}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Adds a new <see cref=\"Subscription\"/> to provide data for the specified security.\n        /// </summary>\n        /// <param name=\"request\">Defines the <see cref=\"SubscriptionRequest\"/> to be added</param>\n        /// <returns>True if the subscription was created and added successfully, false otherwise</returns>\n        public bool AddSubscription(SubscriptionRequest request)\n        {\n            lock (_subscriptionManagerSubscriptions)\n            {\n                // guarantee the configuration is present in our config collection\n                // this is related to GH issue 3877: where we added a configuration which we also removed\n                if (_subscriptionManagerSubscriptions.TryAdd(request.Configuration, request.Configuration))\n                {\n                    _subscriptionDataConfigsEnumerator = null;\n                }\n            }\n\n            Subscription subscription;\n            if (DataFeedSubscriptions.TryGetValue(request.Configuration, out subscription))\n            {\n                if (!subscription.EndOfStream)\n                {\n                    // duplicate subscription request\n                    subscription.AddSubscriptionRequest(request);\n                    // only result true if the existing subscription is internal, we actually added something from the users perspective\n                    return subscription.Configuration.IsInternalFeed;\n                }\n                DataFeedSubscriptions.TryRemove(request.Configuration, out _);\n            }\n\n            if (request.Configuration.DataNormalizationMode == DataNormalizationMode.ScaledRaw)\n            {\n                throw new InvalidOperationException($\"{DataNormalizationMode.ScaledRaw} normalization mode only intended for history requests.\");\n            }\n\n            // before adding the configuration to the data feed let's assert it's valid\n            _dataPermissionManager.AssertConfiguration(request.Configuration, request.StartTimeLocal, request.EndTimeLocal);\n\n            subscription = _dataFeed.CreateSubscription(request);\n\n            if (subscription == null)\n            {\n                Log.Trace($\"DataManager.AddSubscription(): Unable to add subscription for: {request.Configuration}\");\n                // subscription will be null when there's no tradeable dates for the security between the requested times, so\n                // don't even try to load the data\n                return false;\n            }\n\n            if (_liveMode)\n            {\n                OnSubscriptionAdded(subscription);\n                Log.Trace($\"DataManager.AddSubscription(): Added {request.Configuration}.\" +\n                    $\" Start: {request.StartTimeUtc}. End: {request.EndTimeUtc}\");\n            }\n            else if (Log.DebuggingEnabled)\n            {\n                // for performance lets not create the message string if debugging is not enabled\n                // this can be executed many times and its in the algorithm thread\n                Log.Debug($\"DataManager.AddSubscription(): Added {request.Configuration}.\" +\n                    $\" Start: {request.StartTimeUtc}. End: {request.EndTimeUtc}\");\n            }\n\n            return DataFeedSubscriptions.TryAdd(subscription);\n        }\n\n        /// <summary>\n        /// Removes the <see cref=\"Subscription\"/>, if it exists\n        /// </summary>\n        /// <param name=\"configuration\">The <see cref=\"SubscriptionDataConfig\"/> of the subscription to remove</param>\n        /// <param name=\"universe\">Universe requesting to remove <see cref=\"Subscription\"/>.\n        /// Default value, null, will remove all universes</param>\n        /// <returns>True if the subscription was successfully removed, false otherwise</returns>\n        public bool RemoveSubscription(SubscriptionDataConfig configuration, Universe universe = null)\n        {\n            return RemoveSubscriptionInternal(configuration, universe, forceSubscriptionRemoval: false);\n        }\n\n        /// <summary>\n        /// Removes the <see cref=\"Subscription\"/>, if it exists\n        /// </summary>\n        /// <param name=\"configuration\">The <see cref=\"SubscriptionDataConfig\"/> of the subscription to remove</param>\n        /// <param name=\"universe\">Universe requesting to remove <see cref=\"Subscription\"/>.\n        /// Default value, null, will remove all universes</param>\n        /// <param name=\"forceSubscriptionRemoval\">We force the subscription removal by marking it as removed from universe, so that all it's data is dropped</param>\n        /// <returns>True if the subscription was successfully removed, false otherwise</returns>\n        private bool RemoveSubscriptionInternal(SubscriptionDataConfig configuration, Universe universe, bool forceSubscriptionRemoval)\n        {\n            // remove the subscription from our collection, if it exists\n            Subscription subscription;\n\n            if (DataFeedSubscriptions.TryGetValue(configuration, out subscription))\n            {\n                // we remove the subscription when there are no other requests left\n                if (subscription.RemoveSubscriptionRequest(universe))\n                {\n                    if (!DataFeedSubscriptions.TryRemove(configuration, out subscription))\n                    {\n                        Log.Error($\"DataManager.RemoveSubscription(): Unable to remove {configuration}\");\n                        return false;\n                    }\n\n                    _dataFeed.RemoveSubscription(subscription);\n\n                    if (_liveMode)\n                    {\n                        OnSubscriptionRemoved(subscription);\n                    }\n\n                    subscription.Dispose();\n\n                    RemoveSubscriptionDataConfig(subscription);\n\n                    if (forceSubscriptionRemoval)\n                    {\n                        subscription.MarkAsRemovedFromUniverse();\n                    }\n\n                    if (_liveMode)\n                    {\n                        Log.Trace($\"DataManager.RemoveSubscription(): Removed {configuration}\");\n                    }\n                    else if (Log.DebuggingEnabled)\n                    {\n                        // for performance lets not create the message string if debugging is not enabled\n                        // this can be executed many times and its in the algorithm thread\n                        Log.Debug($\"DataManager.RemoveSubscription(): Removed {configuration}\");\n                    }\n                    return true;\n                }\n            }\n            else if (universe != null)\n            {\n                // a universe requested removal of a subscription which wasn't present anymore, this can happen when a subscription ends\n                // it will get removed from the data feed subscription list, but the configuration will remain until the universe removes it\n                // why? the effect I found is that the fill models are using these subscriptions to determine which data they could use\n                lock (_subscriptionManagerSubscriptions)\n                {\n                    if (_subscriptionManagerSubscriptions.Remove(configuration))\n                    {\n                        _subscriptionDataConfigsEnumerator = null;\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"SubscriptionAdded\"/> event\n        /// </summary>\n        /// <param name=\"subscription\">The added subscription</param>\n        private void OnSubscriptionAdded(Subscription subscription)\n        {\n            SubscriptionAdded?.Invoke(this, subscription);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"SubscriptionRemoved\"/> event\n        /// </summary>\n        /// <param name=\"subscription\">The removed subscription</param>\n        private void OnSubscriptionRemoved(Subscription subscription)\n        {\n            SubscriptionRemoved?.Invoke(this, subscription);\n        }\n\n        #endregion\n\n        #region IAlgorithmSubscriptionManager\n\n        /// <summary>\n        /// Gets all the current data config subscriptions that are being processed for the SubscriptionManager\n        /// </summary>\n        public IEnumerable<SubscriptionDataConfig> SubscriptionManagerSubscriptions\n        {\n            get\n            {\n                lock (_subscriptionManagerSubscriptions)\n                {\n                    if (_subscriptionDataConfigsEnumerator == null)\n                    {\n                        _subscriptionDataConfigsEnumerator = _subscriptionManagerSubscriptions.Values.ToList();\n                    }\n                    return _subscriptionDataConfigsEnumerator;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets existing or adds new <see cref=\"SubscriptionDataConfig\" />\n        /// </summary>\n        /// <returns>Returns the SubscriptionDataConfig instance used</returns>\n        public SubscriptionDataConfig SubscriptionManagerGetOrAdd(SubscriptionDataConfig newConfig)\n        {\n            SubscriptionDataConfig config;\n            lock (_subscriptionManagerSubscriptions)\n            {\n                if (!_subscriptionManagerSubscriptions.TryGetValue(newConfig, out config))\n                {\n                    _subscriptionManagerSubscriptions[newConfig] = config = newConfig;\n                    _subscriptionDataConfigsEnumerator = null;\n                }\n            }\n\n            // if the reference is not the same, means it was already there and we did not add anything new\n            if (!ReferenceEquals(config, newConfig))\n            {\n                // for performance lets not create the message string if debugging is not enabled\n                // this can be executed many times and its in the algorithm thread\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug(\"DataManager.SubscriptionManagerGetOrAdd(): subscription already added: \" + config);\n                }\n            }\n            else\n            {\n                // add the time zone to our time keeper\n                _timeKeeper.AddTimeZone(newConfig.ExchangeTimeZone);\n            }\n\n            return config;\n        }\n\n        /// <summary>\n        /// Will try to remove a <see cref=\"SubscriptionDataConfig\"/> and update the corresponding\n        /// consumers accordingly\n        /// </summary>\n        /// <param name=\"subscription\">The <see cref=\"Subscription\"/> owning the configuration to remove</param>\n        private void RemoveSubscriptionDataConfig(Subscription subscription)\n        {\n            // the subscription could of ended but might still be part of the universe\n            if (subscription.RemovedFromUniverse.Value)\n            {\n                lock (_subscriptionManagerSubscriptions)\n                {\n                    if (_subscriptionManagerSubscriptions.Remove(subscription.Configuration))\n                    {\n                        _subscriptionDataConfigsEnumerator = null;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns the amount of data config subscriptions processed for the SubscriptionManager\n        /// </summary>\n        public int SubscriptionManagerCount()\n        {\n            lock (_subscriptionManagerSubscriptions)\n            {\n                return _subscriptionManagerSubscriptions.Count;\n            }\n        }\n\n        #region ISubscriptionDataConfigService\n\n        /// <summary>\n        /// The different <see cref=\"TickType\" /> each <see cref=\"SecurityType\" /> supports\n        /// </summary>\n        public Dictionary<SecurityType, List<TickType>> AvailableDataTypes { get; }\n\n        /// <summary>\n        /// Creates and adds a list of <see cref=\"SubscriptionDataConfig\" /> for a given symbol and configuration.\n        /// Can optionally pass in desired subscription data type to use.\n        /// If the config already existed will return existing instance instead\n        /// </summary>\n        public SubscriptionDataConfig Add(\n            Type dataType,\n            Symbol symbol,\n            Resolution? resolution = null,\n            bool fillForward = true,\n            bool extendedMarketHours = false,\n            bool isFilteredSubscription = true,\n            bool isInternalFeed = false,\n            bool isCustomData = false,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0\n            )\n        {\n            return Add(symbol, resolution, fillForward, extendedMarketHours, isFilteredSubscription, isInternalFeed, isCustomData,\n                new List<Tuple<Type, TickType>> { new Tuple<Type, TickType>(dataType, LeanData.GetCommonTickTypeForCommonDataTypes(dataType, symbol.SecurityType)) },\n                dataNormalizationMode, dataMappingMode, contractDepthOffset)\n                .First();\n        }\n\n        /// <summary>\n        /// Creates and adds a list of <see cref=\"SubscriptionDataConfig\" /> for a given symbol and configuration.\n        /// Can optionally pass in desired subscription data types to use.\n        ///  If the config already existed will return existing instance instead\n        /// </summary>\n        public List<SubscriptionDataConfig> Add(\n            Symbol symbol,\n            Resolution? resolution = null,\n            bool fillForward = true,\n            bool extendedMarketHours = false,\n            bool isFilteredSubscription = true,\n            bool isInternalFeed = false,\n            bool isCustomData = false,\n            List<Tuple<Type, TickType>> subscriptionDataTypes = null,\n            DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,\n            DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,\n            uint contractDepthOffset = 0\n            )\n        {\n            var dataTypes = subscriptionDataTypes;\n            if(dataTypes == null)\n            {\n                if (symbol.SecurityType == SecurityType.Base && SecurityIdentifier.TryGetCustomDataTypeInstance(symbol.ID.Symbol, out var type))\n                {\n                    // we've detected custom data request if we find a type let's use it\n                    dataTypes = new List<Tuple<Type, TickType>> { new Tuple<Type, TickType>(type, TickType.Trade) };\n                }\n                else\n                {\n                    dataTypes = LookupSubscriptionConfigDataTypes(symbol.SecurityType, resolution ?? Resolution.Minute, symbol.IsCanonical());\n                }\n            }\n\n            if (!dataTypes.Any())\n            {\n                throw new ArgumentNullException(nameof(dataTypes), \"At least one type needed to create new subscriptions\");\n            }\n\n            var resolutionWasProvided = resolution.HasValue;\n            foreach (var typeTuple in dataTypes)\n            {\n                var baseInstance = typeTuple.Item1.GetBaseDataInstance();\n                baseInstance.Symbol = symbol;\n                if (!resolutionWasProvided)\n                {\n                    var defaultResolution = baseInstance.DefaultResolution();\n                    if (LeanData.IsCommonLeanDataType(typeTuple.Item1))\n                    {\n                        var res = _algorithm.UniverseSettings.Resolution;\n\n                        if (!_liveMode && !baseInstance.SupportedResolutions().Contains(res))\n                        {\n                            if (!_unsupportedUniverseSettingsResolutionWarningSent)\n                            {\n                                _algorithm.Log($\"Warning: Resolution {_algorithm.UniverseSettings.Resolution} for {symbol} and type {typeTuple.Item1} is not supported. \" +\n                                    $\"The data type default resolution '{defaultResolution}' will be used instead\");\n                                _unsupportedUniverseSettingsResolutionWarningSent = true;\n                            }\n                        }\n                        else\n                        {\n                            defaultResolution = res;\n                        }\n                    }\n\n                    if (resolution.HasValue && resolution != defaultResolution)\n                    {\n                        // we are here because there are multiple 'dataTypes'.\n                        // if we get different default resolutions lets throw, this shouldn't happen\n                        throw new InvalidOperationException(\n                            $\"Different data types ({string.Join(\",\", dataTypes.Select(tuple => tuple.Item1))})\" +\n                            $\" provided different default resolutions {defaultResolution} and {resolution}, this is an unexpected invalid operation.\");\n                    }\n                    resolution = defaultResolution;\n                }\n                else\n                {\n                    // only assert resolution in backtesting, live can use other data source\n                    // for example daily data for options\n                    if (!_liveMode)\n                    {\n                        var supportedResolutions = baseInstance.SupportedResolutions();\n                        if (supportedResolutions.Contains(resolution.Value))\n                        {\n                            continue;\n                        }\n\n                        throw new ArgumentException($\"Sorry {resolution.ToStringInvariant()} is not a supported resolution for {typeTuple.Item1.Name}\" +\n                                                    $\" and SecurityType.{symbol.SecurityType.ToStringInvariant()}.\" +\n                                                    $\" Please change your AddData to use one of the supported resolutions ({string.Join(\",\", supportedResolutions)}).\");\n                    }\n                }\n            }\n            var marketHoursDbEntry = _marketHoursDatabase.GetEntry(symbol, dataTypes.Select(tuple => tuple.Item1));\n\n            var exchangeHours = marketHoursDbEntry.ExchangeHours;\n            if (symbol.ID.SecurityType.IsOption() ||\n                symbol.ID.SecurityType == SecurityType.Index)\n            {\n                dataNormalizationMode = DataNormalizationMode.Raw;\n            }\n\n            if (marketHoursDbEntry.DataTimeZone == null)\n            {\n                throw new ArgumentNullException(nameof(marketHoursDbEntry.DataTimeZone),\n                    \"DataTimeZone is a required parameter for new subscriptions. Set to the time zone the raw data is time stamped in.\");\n            }\n\n            if (exchangeHours.TimeZone == null)\n            {\n                throw new ArgumentNullException(nameof(exchangeHours.TimeZone),\n                    \"ExchangeTimeZone is a required parameter for new subscriptions. Set to the time zone the security exchange resides in.\");\n            }\n\n            var result = (from subscriptionDataType in dataTypes\n                let dataType = subscriptionDataType.Item1\n                let tickType = subscriptionDataType.Item2\n                select new SubscriptionDataConfig(\n                    dataType,\n                    symbol,\n                    resolution.Value,\n                    marketHoursDbEntry.DataTimeZone,\n                    exchangeHours.TimeZone,\n                    fillForward,\n                    extendedMarketHours,\n                    // if the subscription data types were not provided and the tick type is OpenInterest we make it internal\n                    subscriptionDataTypes == null && tickType == TickType.OpenInterest || isInternalFeed,\n                    isCustomData,\n                    isFilteredSubscription: isFilteredSubscription,\n                    tickType: tickType,\n                    dataNormalizationMode: dataNormalizationMode,\n                    dataMappingMode: dataMappingMode,\n                    contractDepthOffset: contractDepthOffset)).ToList();\n\n            for (int i = 0; i < result.Count; i++)\n            {\n                result[i] = SubscriptionManagerGetOrAdd(result[i]);\n\n                // track all registered data types\n                _registeredTypesProvider.RegisterType(result[i].Type);\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Get the data feed types for a given <see cref=\"SecurityType\" /> <see cref=\"Resolution\" />\n        /// </summary>\n        /// <param name=\"symbolSecurityType\">The <see cref=\"SecurityType\" /> used to determine the types</param>\n        /// <param name=\"resolution\">The resolution of the data requested</param>\n        /// <param name=\"isCanonical\">Indicates whether the security is Canonical (future and options)</param>\n        /// <returns>Types that should be added to the <see cref=\"SubscriptionDataConfig\" /></returns>\n        /// <remarks>TODO: data type additions are very related to ticktype and should be more generic/independent of each other</remarks>\n        public List<Tuple<Type, TickType>> LookupSubscriptionConfigDataTypes(\n            SecurityType symbolSecurityType,\n            Resolution resolution,\n            bool isCanonical\n            )\n        {\n            if (isCanonical)\n            {\n                if (symbolSecurityType.IsOption())\n                {\n                    return new List<Tuple<Type, TickType>> { new Tuple<Type, TickType>(typeof(OptionUniverse), TickType.Quote) };\n                }\n\n                return new List<Tuple<Type, TickType>> { new Tuple<Type, TickType>(typeof(FutureUniverse), TickType.Quote) };\n            }\n\n            IEnumerable<TickType> availableDataType = AvailableDataTypes[symbolSecurityType]\n                // Equities will only look for trades in case of low resolutions.\n                .Where(tickType => LeanData.IsValidConfiguration(symbolSecurityType, resolution, tickType));\n\n            var result = availableDataType\n                .Select(tickType => new Tuple<Type, TickType>(LeanData.GetDataType(resolution, tickType), tickType)).ToList();\n\n            if(symbolSecurityType == SecurityType.CryptoFuture)\n            {\n                result.Add(new Tuple<Type, TickType>(typeof(MarginInterestRate), TickType.Quote));\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Gets a list of all registered <see cref=\"SubscriptionDataConfig\"/> for a given <see cref=\"Symbol\"/>\n        /// </summary>\n        /// <remarks>Will not return internal subscriptions by default</remarks>\n        public List<SubscriptionDataConfig> GetSubscriptionDataConfigs(Symbol symbol = null, bool includeInternalConfigs = false)\n        {\n            lock (_subscriptionManagerSubscriptions)\n            {\n                return _subscriptionManagerSubscriptions.Keys\n                    .Where(config => (includeInternalConfigs || !config.IsInternalFeed) && (symbol == null || config.Symbol.ID == symbol.ID))\n                    .OrderBy(config => config.IsInternalFeed)\n                    .ToList();\n            }\n        }\n\n        #endregion\n\n        #endregion\n\n        #region IDataManager\n\n        /// <summary>\n        /// Get the universe selection instance\n        /// </summary>\n        public UniverseSelection UniverseSelection { get; }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataPermissionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Entity in charge of handling data permissions\n    /// </summary>\n    public class DataPermissionManager : IDataPermissionManager\n    {\n        /// <summary>\n        /// The data channel provider instance\n        /// </summary>\n        public IDataChannelProvider DataChannelProvider { get; private set; }\n\n        [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(DataPermissionManager))]\n        public DataPermissionManager()\n        {\n        }\n\n        /// <summary>\n        /// Initialize the data permission manager\n        /// </summary>\n        /// <param name=\"job\">The job packet</param>\n        public virtual void Initialize(AlgorithmNodePacket job)\n        {\n            var liveJob = job as LiveNodePacket;\n            if (liveJob != null)\n            {\n                Log.Trace($\"LiveTradingDataFeed.GetDataChannelProvider(): will use {liveJob.DataChannelProvider}\");\n                DataChannelProvider = Composer.Instance.GetExportedValueByTypeName<IDataChannelProvider>(liveJob.DataChannelProvider);\n                DataChannelProvider.Initialize(liveJob);\n            }\n        }\n\n        /// <summary>\n        /// Will assert the requested configuration is valid for the current job\n        /// </summary>\n        /// <param name=\"subscriptionRequest\">The data subscription configuration to assert</param>\n        /// <param name=\"startTimeLocal\">The start time of this request</param>\n        /// <param name=\"endTimeLocal\">The end time of this request</param>\n        public virtual void AssertConfiguration(SubscriptionDataConfig subscriptionRequest, DateTime startTimeLocal, DateTime endTimeLocal)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DataQueueHandlerManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// This is an implementation of <see cref=\"IDataQueueHandler\"/> used to handle multiple live datafeeds\n    /// </summary>\n    public class DataQueueHandlerManager : IDataQueueHandler, IDataQueueUniverseProvider\n    {\n        private readonly IAlgorithmSettings _algorithmSettings;\n        private readonly Dictionary<SubscriptionDataConfig, Queue<IDataQueueHandler>> _dataConfigAndDataHandler = new();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public DataQueueHandlerManager(IAlgorithmSettings settings)\n        {\n            _algorithmSettings = settings;\n        }\n\n        /// <summary>\n        /// Frontier time provider to use\n        /// </summary>\n        /// <remarks>Protected for testing purposes</remarks>\n        protected ITimeProvider FrontierTimeProvider { get; set; }\n\n        /// <summary>\n        /// Collection of data queue handles being used\n        /// </summary>\n        /// <remarks>Protected for testing purposes</remarks>\n        protected List<IDataQueueHandler> DataHandlers { get; set; } = new();\n\n        /// <summary>\n        /// True if the composite queue handler has any <see cref=\"IDataQueueUniverseProvider\"/> instance\n        /// </summary>\n        public bool HasUniverseProvider => DataHandlers.OfType<IDataQueueUniverseProvider>().Any();\n\n        /// <summary>\n        /// Event triggered when an unsupported configuration is detected\n        /// </summary>\n        public event EventHandler<SubscriptionDataConfig> UnsupportedConfiguration;\n\n        /// <summary>\n        /// Subscribe to the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n        {\n            Exception failureException = null;\n            foreach (var dataHandler in DataHandlers)\n            {\n                // Emit ticks & custom data as soon as we get them, they don't need any kind of batching behavior applied to them\n                // only use the frontier time provider if we need to\n                var immediateEmission = dataConfig.Resolution == Resolution.Tick || dataConfig.IsCustomData || FrontierTimeProvider == null;\n                var exchangeTimeZone = dataConfig.ExchangeTimeZone;\n\n                IEnumerator<BaseData> enumerator;\n                try\n                {\n                    enumerator = dataHandler.Subscribe(dataConfig, immediateEmission ? newDataAvailableHandler\n                        : (sender, eventArgs) => {\n                            // let's only wake up the main thread if the data point is allowed to be emitted, else we could fill forward previous bar and not let this one through\n                            var dataAvailable = eventArgs as NewDataAvailableEventArgs;\n                            if (dataAvailable == null || dataAvailable.DataPoint == null\n                                || dataAvailable.DataPoint.EndTime.ConvertToUtc(exchangeTimeZone) <= FrontierTimeProvider.GetUtcNow())\n                            {\n                                newDataAvailableHandler?.Invoke(sender, eventArgs);\n                            }\n                        });\n                }\n                catch (Exception exception)\n                {\n                    // we will try the next DQH if any, if it handles the request correctly we ignore the error\n                    failureException = exception;\n                    continue;\n                }\n\n                // Check if the enumerator is not empty\n                if (enumerator != null)\n                {\n                    if (!_dataConfigAndDataHandler.TryGetValue(dataConfig, out var dataQueueHandlers))\n                    {\n                        // we can get the same subscription request multiple times, the aggregator manager handles updating each enumerator\n                        // but we need to keep track so we can call unsubscribe later to the target data queue handler\n                        _dataConfigAndDataHandler[dataConfig] = dataQueueHandlers = new Queue<IDataQueueHandler>();\n                    }\n                    dataQueueHandlers.Enqueue(dataHandler);\n\n                    if (immediateEmission)\n                    {\n                        return enumerator;\n                    }\n\n                    var utcStartTime = FrontierTimeProvider.GetUtcNow();\n\n                    var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(dataConfig.Symbol.ID.Market, dataConfig.Symbol, dataConfig.Symbol.SecurityType);\n                    if (LeanData.UseStrictEndTime(_algorithmSettings.DailyPreciseEndTime, dataConfig.Symbol, dataConfig.Increment, exchangeHours))\n                    {\n                        // before the first frontier enumerator we adjust the endtimes if required\n                        enumerator = new StrictDailyEndTimesEnumerator(enumerator, exchangeHours, utcStartTime.ConvertFromUtc(exchangeTimeZone));\n                    }\n\n                    return new FrontierAwareEnumerator(enumerator, FrontierTimeProvider,\n                        new TimeZoneOffsetProvider(exchangeTimeZone, utcStartTime, Time.EndOfTime)\n                    );\n                }\n            }\n\n            if (failureException != null)\n            {\n                // we were not able to serve the request with any DQH and we got an exception, let's bubble it up\n                throw failureException;\n            }\n\n            // filter out warning for expected cases to reduce noise\n            if (!dataConfig.Symbol.Value.Contains(\"-UNIVERSE-\", StringComparison.InvariantCultureIgnoreCase)\n                && dataConfig.Type != typeof(Delisting)\n                && !dataConfig.Symbol.IsCanonical())\n            {\n                UnsupportedConfiguration?.Invoke(this, dataConfig);\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Removes the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">Subscription config to be removed</param>\n        public virtual void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            if (_dataConfigAndDataHandler.TryGetValue(dataConfig, out var dataHandlers))\n            {\n                var dataHandler = dataHandlers.Dequeue();\n                dataHandler.Unsubscribe(dataConfig);\n\n                if (dataHandlers.Count == 0)\n                {\n                    // nothing left\n                    _dataConfigAndDataHandler.Remove(dataConfig);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the job we're subscribing for\n        /// </summary>\n        /// <param name=\"job\">Job we're subscribing for</param>\n        public void SetJob(LiveNodePacket job)\n        {\n            var dataHandlersConfig = job.DataQueueHandler;\n            Log.Trace($\"CompositeDataQueueHandler.SetJob(): will use {dataHandlersConfig}\");\n            foreach (var dataHandlerName in dataHandlersConfig.DeserializeList())\n            {\n                var dataHandler = Composer.Instance.GetExportedValueByTypeName<IDataQueueHandler>(dataHandlerName);\n                dataHandler.SetJob(job);\n                DataHandlers.Add(dataHandler);\n            }\n\n            FrontierTimeProvider = InitializeFrontierTimeProvider();\n        }\n\n        /// <summary>\n        /// Returns whether the data provider is connected\n        /// </summary>\n        /// <returns>true if the data provider is connected</returns>\n        public bool IsConnected => true;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var dataHandler in DataHandlers)\n            {\n                dataHandler.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Method returns a collection of Symbols that are available at the data source.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup</param>\n        /// <param name=\"includeExpired\">Include expired contracts</param>\n        /// <param name=\"securityCurrency\">Expected security currency(if any)</param>\n        /// <returns>Enumerable of Symbols, that are associated with the provided Symbol</returns>\n        public IEnumerable<Symbol> LookupSymbols(Symbol symbol, bool includeExpired, string securityCurrency = null)\n        {\n            foreach (var dataHandler in GetUniverseProviders())\n            {\n                var symbols = dataHandler.LookupSymbols(symbol, includeExpired, securityCurrency);\n                if (symbols == null)\n                {\n                    // the universe provider does not support it\n                    continue;\n                }\n\n                var result = symbols.ToList();\n                if (result.Any())\n                {\n                    return result;\n                }\n            }\n            return Enumerable.Empty<Symbol>();\n        }\n\n        /// <summary>\n        /// Returns whether selection can take place or not.\n        /// </summary>\n        /// <remarks>This is useful to avoid a selection taking place during invalid times, for example IB reset times or when not connected,\n        /// because if allowed selection would fail since IB isn't running and would kill the algorithm</remarks>\n        /// <returns>True if selection can take place</returns>\n        public bool CanPerformSelection()\n        {\n            return GetUniverseProviders().Any(provider => provider.CanPerformSelection());\n        }\n\n        /// <summary>\n        /// Creates the frontier time provider instance\n        /// </summary>\n        /// <remarks>Protected for testing purposes</remarks>\n        protected virtual ITimeProvider InitializeFrontierTimeProvider()\n        {\n            var timeProviders = DataHandlers.OfType<ITimeProvider>().ToList();\n            if (timeProviders.Any())\n            {\n                Log.Trace($\"DataQueueHandlerManager.InitializeFrontierTimeProvider(): will use the following IDQH frontier time providers: [{string.Join(\",\", timeProviders.Select(x => x.GetType()))}]\");\n                return new CompositeTimeProvider(timeProviders);\n            }\n            return null;\n        }\n\n        private IEnumerable<IDataQueueUniverseProvider> GetUniverseProviders()\n        {\n            var yielded = false;\n            foreach (var universeProvider in DataHandlers.OfType<IDataQueueUniverseProvider>())\n            {\n                yielded = true;\n                yield return universeProvider;\n            }\n\n            if (!yielded)\n            {\n                throw new NotSupportedException(\"The DataQueueHandler does not support Options and Futures.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DateChangeTimeKeeper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Time keeper specialization to keep time for a subscription both in data and exchange time zones.\n    /// It also emits events when the exchange date changes, which is useful to emit date change events\n    /// required for some daily actions like mapping symbols, delistings, splits, etc.\n    /// </summary>\n    internal class DateChangeTimeKeeper : TimeKeeper, IDisposable\n    {\n        private IEnumerator<DateTime> _tradableDatesInDataTimeZone;\n        private SubscriptionDataConfig _config;\n        private SecurityExchangeHours _exchangeHours;\n        private DateTime _delistingDate;\n\n        private DateTime _previousNewExchangeDate;\n\n        private bool _needsMoveNext;\n        private bool _initialized;\n\n        private DateTime _exchangeTime;\n        private DateTime _dataTime;\n        private bool _exchangeTimeNeedsUpdate;\n        private bool _dataTimeNeedsUpdate;\n\n        /// <summary>\n        /// The current time in the data time zone\n        /// </summary>\n        public DateTime DataTime\n        {\n            get\n            {\n                if (_dataTimeNeedsUpdate)\n                {\n                    _dataTime = GetTimeIn(_config.DataTimeZone);\n                    _dataTimeNeedsUpdate = false;\n                }\n                return _dataTime;\n            }\n        }\n\n        /// <summary>\n        /// The current time in the exchange time zone\n        /// </summary>\n        public DateTime ExchangeTime\n        {\n            get\n            {\n                if (_exchangeTimeNeedsUpdate)\n                {\n                    _exchangeTime = GetTimeIn(_exchangeHours.TimeZone);\n                    _exchangeTimeNeedsUpdate = false;\n                }\n                return _exchangeTime;\n            }\n        }\n\n        /// <summary>\n        /// Event that fires every time the exchange date changes\n        /// </summary>\n        public event EventHandler<DateTime> NewExchangeDate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DateChangeTimeKeeper\"/> class\n        /// </summary>\n        /// <param name=\"tradableDatesInDataTimeZone\">The tradable dates in data time zone</param>\n        /// <param name=\"config\">The subscription data configuration this instance will keep track of time for</param>\n        /// <param name=\"exchangeHours\">The exchange hours</param>\n        /// <param name=\"delistingDate\">The symbol's delisting date</param>\n        public DateChangeTimeKeeper(IEnumerable<DateTime> tradableDatesInDataTimeZone, SubscriptionDataConfig config,\n            SecurityExchangeHours exchangeHours, DateTime delistingDate)\n            : base(Time.BeginningOfTime, new[] { config.DataTimeZone, config.ExchangeTimeZone })\n        {\n            _tradableDatesInDataTimeZone = tradableDatesInDataTimeZone.GetEnumerator();\n            _config = config;\n            _exchangeHours = exchangeHours;\n            _delistingDate = delistingDate;\n            _exchangeTimeNeedsUpdate = true;\n            _dataTimeNeedsUpdate = true;\n            _needsMoveNext = true;\n        }\n\n        /// <summary>\n        /// Disposes the resources\n        /// </summary>\n        public void Dispose()\n        {\n            _tradableDatesInDataTimeZone.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Sets the current UTC time for this time keeper\n        /// </summary>\n        /// <param name=\"utcDateTime\">The current time in UTC</param>\n        public override void SetUtcDateTime(DateTime utcDateTime)\n        {\n            base.SetUtcDateTime(utcDateTime);\n            _exchangeTimeNeedsUpdate = true;\n            _dataTimeNeedsUpdate = true;\n        }\n\n        /// <summary>\n        /// Advances the time keeper towards the target exchange time.\n        /// If an exchange date is found before the target time, it is emitted and the time keeper is set to that date.\n        /// The caller must check whether the target time was reached or if the time keeper was set to a new exchange date before the target time.\n        /// </summary>\n        public void AdvanceTowardsExchangeTime(DateTime targetExchangeTime)\n        {\n            if (!_initialized)\n            {\n                throw new InvalidOperationException($\"The time keeper has not been initialized. \" +\n                    $\"{nameof(TryAdvanceUntilNextDataDate)} needs to be called at least once to flush the first date before advancing.\");\n            }\n\n            var currentExchangeTime = ExchangeTime;\n            // Advancing within the same exchange date, just update the time, no new exchange date will be emitted\n            if (targetExchangeTime.Date == currentExchangeTime.Date)\n            {\n                SetExchangeTime(targetExchangeTime);\n                return;\n            }\n\n            while (currentExchangeTime < targetExchangeTime)\n            {\n                var newExchangeTime = currentExchangeTime + Time.OneDay;\n                if (newExchangeTime > targetExchangeTime)\n                {\n                    newExchangeTime = targetExchangeTime;\n                }\n\n                var newExchangeDate = newExchangeTime.Date;\n\n                // We found a new exchange date before the target time, emit it first\n                if (newExchangeDate != currentExchangeTime.Date &&\n                    _exchangeHours.IsDateOpen(newExchangeDate, _config.ExtendedMarketHours))\n                {\n                    // Stop here, set the new exchange date\n                    SetExchangeTime(newExchangeDate);\n                    EmitNewExchangeDate(newExchangeDate);\n                    return;\n                }\n\n                currentExchangeTime = newExchangeTime;\n            }\n\n            // We reached the target time, set it\n            SetExchangeTime(targetExchangeTime);\n        }\n\n        /// <summary>\n        /// Advances the time keeper until the next data date, emitting the new exchange date if this happens before the new data date\n        /// </summary>\n        public bool TryAdvanceUntilNextDataDate()\n        {\n            if (!_initialized)\n            {\n                return EmitFirstExchangeDate();\n            }\n\n            // Before moving forward, check whether we need to emit a new exchange date\n            if (TryEmitPassedExchangeDate())\n            {\n                return true;\n            }\n\n            if (!_needsMoveNext || _tradableDatesInDataTimeZone.MoveNext())\n            {\n                var nextDataDate = _tradableDatesInDataTimeZone.Current;\n                var nextExchangeTime = nextDataDate.ConvertTo(_config.DataTimeZone, _exchangeHours.TimeZone);\n                var nextExchangeDate = nextExchangeTime.Date;\n\n                if (nextExchangeDate > _delistingDate)\n                {\n                    // We are done, but an exchange date might still need to be emitted\n                    TryEmitPassedExchangeDate();\n                    _needsMoveNext = false;\n                    return false;\n                }\n\n                // If the exchange is not behind the data, the data might have not been enough to emit the exchange date,\n                // which already passed if we are moving on to the next data date. So we need to check if we need to emit it here.\n                // e.g. moving data date from tuesday to wednesday, but the exchange date is already past the end of tuesday\n                // (by N hours, depending on the time zones offset). If data didn't trigger the exchange date change, we need to do it here.\n                if (!IsExchangeBehindData(nextExchangeTime, nextDataDate) && nextExchangeDate > _previousNewExchangeDate)\n                {\n                    EmitNewExchangeDate(nextExchangeDate);\n                    SetExchangeTime(nextExchangeDate);\n                    // nextExchangeDate == DataTime means time zones are synchronized, need to move next only when exchange is actually ahead\n                    _needsMoveNext = nextExchangeDate == DataTime;\n                    return true;\n                }\n\n                _needsMoveNext = true;\n                SetDataTime(nextDataDate);\n                return true;\n            }\n\n            _needsMoveNext = false;\n            return false;\n        }\n\n        /// <summary>\n        /// Emits the first exchange date for the algorithm so that the first daily events are triggered (mappings, delistings, etc.)\n        /// </summary>\n        /// <returns>True if the new exchange date is emitted. False if already done or the tradable dates enumerable is empty</returns>\n        private bool EmitFirstExchangeDate()\n        {\n            if (_initialized)\n            {\n                return false;\n            }\n\n            if (!_tradableDatesInDataTimeZone.MoveNext())\n            {\n                _initialized = true;\n                return false;\n            }\n\n            var firstDataDate = _tradableDatesInDataTimeZone.Current;\n            var firstExchangeTime = firstDataDate.ConvertTo(_config.DataTimeZone, _exchangeHours.TimeZone);\n            var firstExchangeDate = firstExchangeTime.Date;\n\n            DateTime exchangeDateToEmit;\n            // The exchange is ahead of the data, so we need to emit the current exchange date, which already passed\n            if (firstExchangeTime < firstDataDate && _exchangeHours.IsDateOpen(firstExchangeDate, _config.ExtendedMarketHours))\n            {\n                exchangeDateToEmit = firstExchangeDate;\n                SetExchangeTime(exchangeDateToEmit);\n                // Don't move, the current data date still needs to be consumed\n                _needsMoveNext = false;\n            }\n            // The exchange is behind of (or in sync with) data: exchange has not passed to this new date, but with emit it here\n            // so that first daily things are done (mappings, delistings, etc.)\n            else\n            {\n                exchangeDateToEmit = firstDataDate;\n                SetDataTime(firstDataDate);\n                _needsMoveNext = true;\n            }\n\n            EmitNewExchangeDate(exchangeDateToEmit);\n            _initialized = true;\n            return true;\n        }\n\n        /// <summary>\n        /// Determines whether the exchange time zone is behind the data time zone\n        /// </summary>\n        /// <returns></returns>\n        public bool IsExchangeBehindData()\n        {\n            return IsExchangeBehindData(ExchangeTime, DataTime);\n        }\n\n        /// <summary>\n        /// Determines whether the exchange time zone is behind the data time zone\n        /// </summary>\n        private static bool IsExchangeBehindData(DateTime exchangeTime, DateTime dataTime)\n        {\n            return dataTime > exchangeTime;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void SetExchangeTime(DateTime exchangeTime)\n        {\n            SetUtcDateTime(exchangeTime.ConvertToUtc(_exchangeHours.TimeZone));\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void SetDataTime(DateTime dataTime)\n        {\n            SetUtcDateTime(dataTime.ConvertToUtc(_config.DataTimeZone));\n        }\n\n        /// <summary>\n        /// Checks that before moving to the next data date, if the exchange date has already passed and has been emitted, else it emits it.\n        /// This can happen when the exchange is behind of the data. e.g We advance data date from Monday to Tuesday, then the data itself\n        /// will drive the exchange data change (N hours later, depending on the time zones offset).\n        /// But if there is no enough data or the file is not found, the new exchange date will not be emitted, so we need to do it here.\n        /// </summary>\n        private bool TryEmitPassedExchangeDate()\n        {\n            if (_needsMoveNext && _tradableDatesInDataTimeZone.Current != default)\n            {\n                // This data date passed, and it should have emitted as an exchange tradable date when detected\n                // as a date change in the data itself, if not, emit it now before moving to the next data date\n                var currentDataDate = _tradableDatesInDataTimeZone.Current;\n                if (_previousNewExchangeDate < currentDataDate &&\n                    _exchangeHours.IsDateOpen(currentDataDate, _config.ExtendedMarketHours))\n                {\n                    var nextExchangeDate = currentDataDate;\n                    SetExchangeTime(nextExchangeDate);\n                    EmitNewExchangeDate(nextExchangeDate);\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Emits a new exchange date event\n        /// </summary>\n        private void EmitNewExchangeDate(DateTime newExchangeDate)\n        {\n            NewExchangeDate?.Invoke(this, newExchangeDate);\n            _previousNewExchangeDate = newExchangeDate;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DefaultDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Default file provider functionality that retrieves data from disc to be used in an algorithm\n    /// </summary>\n    public class DefaultDataProvider : IDataProvider, IDisposable\n    {\n        private bool _oneTimeWarningLog;\n\n        /// <summary>\n        /// Event raised each time data fetch is finished (successfully or not)\n        /// </summary>\n        public event EventHandler<DataProviderNewDataRequestEventArgs> NewDataRequest;\n\n        /// <summary>\n        /// Retrieves data from disc to be used in an algorithm\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        public virtual Stream Fetch(string key)\n        {\n            var success = true;\n            var errorMessage = string.Empty;\n            try\n            {\n                return new FileStream(FileExtension.ToNormalizedPath(key), FileMode.Open, FileAccess.Read, FileShare.Read);\n            }\n            catch (Exception exception)\n            {\n                success = false;\n                errorMessage = exception.Message;\n                if (exception is DirectoryNotFoundException)\n                {\n                    if (!_oneTimeWarningLog)\n                    {\n                        _oneTimeWarningLog = true;\n                        Logging.Log.Debug($\"DefaultDataProvider.Fetch(): DirectoryNotFoundException: please review data paths, current 'Globals.DataFolder': {Globals.DataFolder}\");\n                    }\n                    return null;\n                }\n                else if (exception is FileNotFoundException)\n                {\n                    return null;\n                }\n\n                throw;\n            }\n            finally\n            {\n                OnNewDataRequest(new DataProviderNewDataRequestEventArgs(key, success, errorMessage));\n            }\n        }\n\n        /// <summary>\n        /// The stream created by this type is passed up the stack to the IStreamReader\n        /// The stream is closed when the StreamReader that wraps this stream is disposed</summary>\n        public void Dispose()\n        {\n            //\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NewDataRequest\"/> event\n        /// </summary>\n        protected virtual void OnNewDataRequest(DataProviderNewDataRequestEventArgs e)\n        {\n            NewDataRequest?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/DownloaderDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing System.Collections.Concurrent;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds.DataDownloader;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Data provider which downloads data using an <see cref=\"IDataDownloader\"/> or <see cref=\"IBrokerage\"/> implementation\n    /// </summary>\n    public class DownloaderDataProvider : BaseDownloaderDataProvider\n    {\n        /// <summary>\n        /// Synchronizer in charge of guaranteeing a single operation per file path\n        /// </summary>\n        private readonly static KeyStringSynchronizer DiskSynchronizer = new();\n\n        private bool _customDataDownloadError;\n        private readonly ConcurrentDictionary<Symbol, Symbol> _marketHoursWarning = new();\n        private readonly MarketHoursDatabase _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n        private readonly DataDownloaderSelector _dataDownloader;\n        private readonly IDataCacheProvider _dataCacheProvider = new DiskDataCacheProvider(DiskSynchronizer);\n        private readonly IMapFileProvider _mapFileProvider = Composer.Instance.GetPart<IMapFileProvider>();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public DownloaderDataProvider()\n        {\n            var dataDownloaderConfig = Config.Get(\"data-downloader\");\n            if (!string.IsNullOrEmpty(dataDownloaderConfig))\n            {\n                _dataDownloader = new DataDownloaderSelector(Composer.Instance.GetExportedValueByTypeName<IDataDownloader>(dataDownloaderConfig), _mapFileProvider, this);\n            }\n            else\n            {\n                throw new ArgumentException(\"DownloaderDataProvider(): requires 'data-downloader' to be set with a valid type name\");\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance using a target data downloader used for testing\n        /// </summary>\n        public DownloaderDataProvider(IDataDownloader dataDownloader)\n        {\n            _dataDownloader = new DataDownloaderSelector(dataDownloader, _mapFileProvider, this);\n        }\n\n        /// <summary>\n        /// Determines if it should downloads new data and retrieves data from disc\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        public override Stream Fetch(string key)\n        {\n            return DownloadOnce(key, s =>\n            {\n                if (LeanData.TryParsePath(key, out var symbol, out var date, out var resolution, out var tickType, out var dataType))\n                {\n                    if (symbol.SecurityType == SecurityType.Base)\n                    {\n                        if (!_customDataDownloadError)\n                        {\n                            _customDataDownloadError = true;\n                            // lean data writter doesn't support it\n                            Log.Trace($\"DownloaderDataProvider.Get(): custom data is not supported, requested: {symbol}\");\n                        }\n                        return;\n                    }\n\n                    MarketHoursDatabase.Entry entry;\n                    try\n                    {\n                        entry = _marketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n                    }\n                    catch\n                    {\n                        // this could happen for some sources using the data provider but with not market hours data base entry, like interest rates\n                        if (_marketHoursWarning.TryAdd(symbol, symbol))\n                        {\n                            // log once\n                            Log.Trace($\"DownloaderDataProvider.Get(): failed to find market hours for {symbol}, skipping\");\n                        }\n                        // this shouldn't happen for data we want can download\n                        return;\n                    }\n\n                    var dataTimeZone = entry.DataTimeZone;\n                    var exchangeTimeZone = entry.ExchangeHours.TimeZone;\n                    DateTime startTimeUtc;\n                    DateTime endTimeUtc;\n                    // we will download until yesterday so we are sure we don't get partial data\n                    var endTimeUtcLimit = DateTime.UtcNow.Date.AddDays(-1);\n                    if (resolution < Resolution.Hour)\n                    {\n                        // we can get the date from the path\n                        startTimeUtc = date.ConvertToUtc(dataTimeZone);\n                        // let's get the whole day\n                        endTimeUtc = date.AddDays(1).ConvertToUtc(dataTimeZone);\n                        if (endTimeUtc > endTimeUtcLimit)\n                        {\n                            // we are at the limit, avoid getting partial data\n                            return;\n                        }\n                    }\n                    else\n                    {\n                        // since hourly & daily are a single file we fetch the whole file\n                        endTimeUtc = endTimeUtcLimit;\n                        try\n                        {\n                            // we don't really know when Futures, FutureOptions, Cryptos, etc, start date so let's give it a good guess\n                            if (symbol.SecurityType == SecurityType.Crypto)\n                            {\n                                // bitcoin start\n                                startTimeUtc = new DateTime(2009, 1, 1);\n                            }\n                            else if (symbol.SecurityType.IsOption() && symbol.SecurityType != SecurityType.FutureOption)\n                            {\n                                // For options, an hourly or daily file contains a year of data, so we need to get the year of the date\n                                startTimeUtc = new DateTime(date.Year, 1, 1);\n                                endTimeUtc = startTimeUtc.AddYears(1);\n                            }\n                            else\n                            {\n                                startTimeUtc = symbol.ID.Date;\n                            }\n                        }\n                        catch (InvalidOperationException)\n                        {\n                            startTimeUtc = Time.Start;\n                        }\n\n                        if (startTimeUtc < Time.Start)\n                        {\n                            startTimeUtc = Time.Start;\n                        }\n\n                        if (endTimeUtc > endTimeUtcLimit)\n                        {\n                            endTimeUtc = endTimeUtcLimit;\n                        }\n                    }\n\n                    try\n                    {\n                        if (dataType == typeof(OptionUniverse))\n                        {\n                            var processingDate = date.ConvertToUtc(dataTimeZone);\n                            UniverseExtensions.RunUniverseDownloader(_dataDownloader.GetDataDownloader(dataType), new DataUniverseDownloaderGetParameters(symbol, processingDate, processingDate.AddDays(1), entry.ExchangeHours));\n                            return;\n                        }\n\n                        LeanDataWriter writer = null;\n                        var getParams = new DataDownloaderGetParameters(symbol, resolution, startTimeUtc, endTimeUtc, tickType);\n\n                        var downloaderDataParameters = getParams.GetDataDownloaderParameterForAllMappedSymbols(_mapFileProvider, exchangeTimeZone);\n\n                        var downloadedData = GetDownloadedData(downloaderDataParameters, symbol, exchangeTimeZone, dataTimeZone, dataType);\n\n                        foreach (var dataPerSymbol in downloadedData)\n                        {\n                            if (writer == null)\n                            {\n                                writer = new LeanDataWriter(resolution, symbol, Globals.DataFolder, tickType, mapSymbol: true, dataCacheProvider: _dataCacheProvider);\n                            }\n                            // Save the data\n                            writer.Write(dataPerSymbol);\n                        }\n                    }\n                    catch (Exception e)\n                    {\n                        Log.Error(e);\n                    }\n                }\n            });\n        }\n\n        /// <summary>\n        /// Retrieves downloaded data grouped by symbol based on <see cref=\"IDownloadProvider\"/>.\n        /// </summary>\n        /// <param name=\"downloaderDataParameters\">Parameters specifying the data to be retrieved.</param>\n        /// <param name=\"symbol\">Represents a unique security identifier, generate by ticker name.</param>\n        /// <param name=\"exchangeTimeZone\">The time zone of the exchange where the symbol is traded.</param>\n        /// <param name=\"dataTimeZone\">The time zone in which the data is represented.</param>\n        /// <param name=\"dataType\">The type of data to be retrieved. (e.g. <see cref=\"Data.Market.TradeBar\"/>)</param>\n        /// <returns>An IEnumerable containing groups of data grouped by symbol. Each group contains data related to a specific symbol.</returns>\n        /// <exception cref=\"ArgumentException\"> Thrown when the downloaderDataParameters collection is null or empty.</exception>\n        public IEnumerable<IGrouping<Symbol, BaseData>> GetDownloadedData(\n            IEnumerable<DataDownloaderGetParameters> downloaderDataParameters,\n            Symbol symbol,\n            DateTimeZone exchangeTimeZone,\n            DateTimeZone dataTimeZone,\n            Type dataType)\n        {\n            if (downloaderDataParameters.IsNullOrEmpty())\n            {\n                throw new ArgumentException($\"{nameof(DownloaderDataProvider)}.{nameof(GetDownloadedData)}: DataDownloaderGetParameters are empty or equal to null.\");\n            }\n\n            foreach (var downloaderDataParameter in downloaderDataParameters)\n            {\n                var downloadedData = _dataDownloader.GetDataDownloader(dataType).Get(downloaderDataParameter);\n\n                if (downloadedData == null)\n                {\n                    // doesn't support this download request, that's okay\n                    continue;\n                }\n\n                var groupedData = FilterAndGroupDownloadDataBySymbol(\n                    downloadedData,\n                    symbol,\n                    dataType,\n                    exchangeTimeZone,\n                    dataTimeZone,\n                    downloaderDataParameter.StartUtc,\n                    downloaderDataParameter.EndUtc);\n\n                foreach (var data in groupedData)\n                {\n                    yield return data;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Get's the stream for a given file path\n        /// </summary>\n        protected override Stream GetStream(string key)\n        {\n            if (LeanData.TryParsePath(key, out var symbol, out var date, out var resolution, out var _) && resolution > Resolution.Minute && symbol.RequiresMapping())\n            {\n                // because the file could be updated even after it's created because of symbol mapping we can't stream from disk\n                return DiskSynchronizer.Execute(key, () =>\n                {\n                    var baseStream = base.Fetch(key);\n                    if (baseStream != null)\n                    {\n                        var result = new MemoryStream();\n                        baseStream.CopyTo(result);\n                        baseStream.Dispose();\n                        // move position back to the start\n                        result.Position = 0;\n\n                        return result;\n                    }\n                    return null;\n                });\n            }\n\n            return base.Fetch(key);\n        }\n\n        /// <summary>\n        /// Main filter to determine if this file needs to be downloaded\n        /// </summary>\n        /// <param name=\"filePath\">File we are looking at</param>\n        /// <returns>True if should download</returns>\n        protected override bool NeedToDownload(string filePath)\n        {\n            // Ignore null and invalid data requests\n            if (filePath == null\n                || filePath.Contains(\"fine\", StringComparison.InvariantCultureIgnoreCase) && filePath.Contains(\"fundamental\", StringComparison.InvariantCultureIgnoreCase)\n                || filePath.Contains(\"map_files\", StringComparison.InvariantCultureIgnoreCase)\n                || filePath.Contains(\"factor_files\", StringComparison.InvariantCultureIgnoreCase)\n                || filePath.Contains(\"margins\", StringComparison.InvariantCultureIgnoreCase) && filePath.Contains(\"future\", StringComparison.InvariantCultureIgnoreCase))\n            {\n                return false;\n            }\n\n            // Only download if it doesn't exist or is out of date.\n            // Files are only \"out of date\" for non date based files (hour, daily, margins, etc.) because this data is stored all in one file\n            return !File.Exists(filePath) || filePath.IsOutOfDate();\n        }\n\n        /// <summary>\n        /// Filters and groups the provided download data by symbol, based on specified criteria.\n        /// </summary>\n        /// <param name=\"downloadData\">The collection of download data to process.</param>\n        /// <param name=\"symbol\">The symbol to filter the data for.</param>\n        /// <param name=\"dataType\">The type of data to filter for.</param>\n        /// <param name=\"exchangeTimeZone\">The time zone of the exchange.</param>\n        /// <param name=\"dataTimeZone\">The desired time zone for the data.</param>\n        /// <param name=\"downloaderStartTimeUtc\">The start time of data downloading in UTC.</param>\n        /// <param name=\"downloaderEndTimeUtc\">The end time of data downloading in UTC.</param>\n        /// <returns>\n        /// An enumerable collection of groupings of download data, grouped by symbol.\n        /// </returns>\n        public static IEnumerable<IGrouping<Symbol, BaseData>> FilterAndGroupDownloadDataBySymbol(\n            IEnumerable<BaseData> downloadData,\n            Symbol symbol,\n            Type dataType,\n            DateTimeZone exchangeTimeZone,\n            DateTimeZone dataTimeZone,\n            DateTime downloaderStartTimeUtc,\n            DateTime downloaderEndTimeUtc)\n        {\n            var startDateTimeInExchangeTimeZone = downloaderStartTimeUtc.ConvertFromUtc(exchangeTimeZone);\n            var endDateTimeInExchangeTimeZone = downloaderEndTimeUtc.ConvertFromUtc(exchangeTimeZone);\n\n            return downloadData\n                .Where(baseData =>\n                {\n                    // Sometimes, external Downloader provider returns excess data\n                    if (baseData.Time < startDateTimeInExchangeTimeZone || baseData.Time > endDateTimeInExchangeTimeZone)\n                    {\n                        return false;\n                    }\n\n                    if (symbol.SecurityType == SecurityType.Base || baseData.GetType() == dataType)\n                    {\n                        // we need to store the data in data time zone\n                        baseData.Time = baseData.Time.ConvertTo(exchangeTimeZone, dataTimeZone);\n                        baseData.EndTime = baseData.EndTime.ConvertTo(exchangeTimeZone, dataTimeZone);\n                        return true;\n                    }\n                    return false;\n                })\n                // for canonical symbols, downloader will return data for all of the chain\n                .GroupBy(baseData => baseData.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/AuxiliaryDataEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing System.Collections;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Auxiliary data enumerator that will, initialize and call the <see cref=\"ITradableDateEventProvider.GetEvents\"/>\n    /// implementation each time there is a new tradable day for every <see cref=\"ITradableDateEventProvider\"/>\n    /// provided.\n    /// </summary>\n    public class AuxiliaryDataEnumerator : IEnumerator<BaseData>\n    {\n        private readonly Queue<BaseData> _auxiliaryData;\n        private bool _initialized;\n        private DateTime _startTime;\n        private IMapFileProvider _mapFileProvider;\n        private IFactorFileProvider _factorFileProvider;\n        private ITradableDateEventProvider[] _tradableDateEventProviders;\n\n        /// <summary>\n        /// The associated data configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"MapFile\"/> provider to use</param>\n        /// <param name=\"tradableDateEventProviders\">The tradable dates event providers</param>\n        /// <param name=\"tradableDayNotifier\">Tradable dates provider</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        public AuxiliaryDataEnumerator(\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            ITradableDateEventProvider []tradableDateEventProviders,\n            ITradableDatesNotifier tradableDayNotifier,\n            DateTime startTime)\n        {\n            Config = config;\n            _startTime = startTime;\n            _mapFileProvider = mapFileProvider;\n            _auxiliaryData = new Queue<BaseData>();\n            _factorFileProvider = factorFileProvider;\n            _tradableDateEventProviders = tradableDateEventProviders;\n\n            if (tradableDayNotifier != null)\n            {\n                tradableDayNotifier.NewTradableDate += NewTradableDate;\n            }\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element.\n        /// </summary>\n        /// <returns>Always true</returns>\n        public virtual bool MoveNext()\n        {\n            Current = _auxiliaryData.Count != 0 ? _auxiliaryData.Dequeue() : null;\n            return true;\n        }\n\n        /// <summary>\n        /// Handle a new tradable date, drives the <see cref=\"ITradableDateEventProvider\"/> instances\n        /// </summary>\n        protected void NewTradableDate(object sender, NewTradableDateEventArgs eventArgs)\n        {\n            Initialize();\n            for (var i = 0; i < _tradableDateEventProviders.Length; i++)\n            {\n                foreach (var newEvent in _tradableDateEventProviders[i].GetEvents(eventArgs))\n                {\n                    _auxiliaryData.Enqueue(newEvent);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes the underlying tradable data event providers\n        /// </summary>\n        protected void Initialize()\n        {\n            if (!_initialized)\n            {\n                _initialized = true;\n                // Late initialization so it is performed in the data feed stack\n                for (var i = 0; i < _tradableDateEventProviders.Length; i++)\n                {\n                    _tradableDateEventProviders[i].Initialize(Config, _factorFileProvider, _mapFileProvider, _startTime);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Dispose of the Stream Reader and close out the source stream and file connections.\n        /// </summary>\n        public void Dispose()\n        {\n            for (var i = 0; i < _tradableDateEventProviders.Length; i++)\n            {\n                var disposable =_tradableDateEventProviders[i] as IDisposable;\n                disposable?.DisposeSafely();\n            }\n        }\n\n        /// <summary>\n        /// Reset the IEnumeration\n        /// </summary>\n        /// <remarks>Not used</remarks>\n        public void Reset()\n        {\n            throw new NotImplementedException(\"Reset method not implemented. Assumes loop will only be used once.\");\n        }\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Last read BaseData object from this type and source\n        /// </summary>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/BaseDataCollectionAggregatorEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IEnumerator{BaseDataCollection}\"/>\n    /// that aggregates an underlying <see cref=\"IEnumerator{BaseData}\"/> into a single\n    /// data packet\n    /// </summary>\n    public class BaseDataCollectionAggregatorEnumerator : IEnumerator<BaseDataCollection>\n    {\n        private bool _endOfStream;\n        private bool _needsMoveNext;\n        private bool _liveMode;\n        private readonly Symbol _symbol;\n        private readonly IEnumerator<BaseData> _enumerator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BaseDataCollectionAggregatorEnumerator\"/> class\n        /// This will aggregate instances emitted from the underlying enumerator and tag them with the\n        /// specified symbol\n        /// </summary>\n        /// <param name=\"enumerator\">The underlying enumerator to aggregate</param>\n        /// <param name=\"symbol\">The symbol to place on the aggregated collection</param>\n        /// <param name=\"liveMode\">True if running in live mode</param>\n        public BaseDataCollectionAggregatorEnumerator(IEnumerator<BaseData> enumerator, Symbol symbol, bool liveMode = false)\n        {\n            _symbol = symbol;\n            _enumerator = enumerator;\n            _liveMode = liveMode;\n            _needsMoveNext = true;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            if (_endOfStream)\n            {\n                return false;\n            }\n\n            BaseDataCollection collection = null;\n            while (true)\n            {\n                if (_needsMoveNext)\n                {\n                    // move next if we dequeued the last item last time we were invoked\n                    if (!_enumerator.MoveNext())\n                    {\n                        _endOfStream = true;\n                        if (!IsValid(collection))\n                        {\n                            // we don't emit\n                            collection = null;\n                        }\n                        break;\n                    }\n                }\n\n                if (_enumerator.Current == null)\n                {\n                    // the underlying returned null, stop here and start again on the next call\n                    _needsMoveNext = true;\n                    break;\n                }\n\n                if (collection == null)\n                {\n                    // we have new data, set the collection's symbol/times\n                    var current = _enumerator.Current;\n                    collection = CreateCollection(_symbol, current.Time, current.EndTime);\n                }\n\n                if (collection.EndTime != _enumerator.Current.EndTime)\n                {\n                    // the data from the underlying is at a different time, stop here\n                    _needsMoveNext = false;\n                    if (IsValid(collection))\n                    {\n                        // we emit\n                        break;\n                    }\n                    // we try again\n                    collection = null;\n                    continue;\n                }\n\n                // this data belongs in this collection, keep going until null or bad time\n                Add(collection, _enumerator.Current);\n                _needsMoveNext = true;\n            }\n\n            Current = collection;\n            return _liveMode || collection != null;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseDataCollection Current\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Creates a new, empty <see cref=\"BaseDataCollection\"/>.\n        /// </summary>\n        /// <param name=\"symbol\">The base data collection symbol</param>\n        /// <param name=\"time\">The start time of the collection</param>\n        /// <param name=\"endTime\">The end time of the collection</param>\n        /// <returns>A new, empty <see cref=\"BaseDataCollection\"/></returns>\n        private BaseDataCollection CreateCollection(Symbol symbol, DateTime time, DateTime endTime)\n        {\n            return new BaseDataCollection\n            {\n                Symbol = symbol,\n                Time = time,\n                EndTime = endTime\n            };\n        }\n\n        /// <summary>\n        /// Adds the specified instance of <see cref=\"BaseData\"/> to the current collection\n        /// </summary>\n        /// <param name=\"collection\">The collection to be added to</param>\n        /// <param name=\"current\">The data to be added</param>\n        private void Add(BaseDataCollection collection, BaseData current)\n        {\n            var baseDataCollection = current as BaseDataCollection;\n            if (_symbol.HasUnderlying && _symbol.Underlying == current.Symbol)\n            {\n                // if the underlying has been aggregated, even if it shouldn't need to be, let's handle it nicely\n                if (baseDataCollection != null)\n                {\n                    collection.Underlying = baseDataCollection.Data[0];\n                }\n                else\n                {\n                    collection.Underlying = current;\n                }\n            }\n            else\n            {\n                if (baseDataCollection != null)\n                {\n                    // datapoint is already aggregated, let's see if it's a single point or a collection we can use already\n                    if(baseDataCollection.Data.Count > 1)\n                    {\n                        collection.Data = baseDataCollection.Data;\n                    }\n                    else\n                    {\n                        collection.Data.Add(baseDataCollection.Data[0]);\n                    }\n\n                    // Let's keep the underlying in case it's already there\n                    collection.Underlying ??= baseDataCollection.Underlying;\n                }\n                else\n                {\n                    collection.Data.Add(current);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines if a given data point is valid and can be emitted\n        /// </summary>\n        /// <param name=\"collection\">The collection to be emitted</param>\n        /// <returns>True if its a valid data point</returns>\n        private static bool IsValid(BaseDataCollection collection)\n        {\n            return collection != null && collection.Data?.Count > 0;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/ConcatEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing System.Collections;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Enumerator that will concatenate enumerators together sequentially enumerating them in the provided order\n    /// </summary>\n    public class ConcatEnumerator : IEnumerator<BaseData>\n    {\n        private readonly List<IEnumerator<BaseData>> _enumerators;\n        private readonly bool _skipDuplicateEndTimes;\n        private DateTime? _lastEnumeratorEndTime;\n        private int _currentIndex;\n\n        /// <summary>\n        /// The current BaseData object\n        /// </summary>\n        public BaseData Current { get; set; }\n\n        /// <summary>\n        /// True if emitting a null data point is expected\n        /// </summary>\n        /// <remarks>Warmup enumerators are not allowed to return true and setting current to Null, this is because it's not a valid behavior for backtesting enumerators,\n        /// for example <see cref=\"FillForwardEnumerator\"/></remarks>\n        public bool CanEmitNull { get; set; }\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"skipDuplicateEndTimes\">True will skip data points from enumerators if before or at the last end time</param>\n        /// <param name=\"enumerators\">The sequence of enumerators to concatenate. Note that the order here matters, it will consume enumerators\n        /// and dispose of them, even if they return true and their current is null, except for the last which will be kept!</param>\n        public ConcatEnumerator(bool skipDuplicateEndTimes,\n            params IEnumerator<BaseData>[] enumerators\n            )\n        {\n            CanEmitNull = true;\n            _skipDuplicateEndTimes = skipDuplicateEndTimes;\n            _enumerators = enumerators.Where(enumerator => enumerator != null).ToList();\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>True if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>\n        public bool MoveNext()\n        {\n            for (; _currentIndex < _enumerators.Count; _currentIndex++)\n            {\n                var enumerator = _enumerators[_currentIndex];\n                while (enumerator.MoveNext())\n                {\n                    if (enumerator.Current == null && (_currentIndex < _enumerators.Count - 1 || !CanEmitNull))\n                    {\n                        // if there are more enumerators and the current stopped providing data drop it\n                        // in live trading, some enumerators will always return true (see TimeTriggeredUniverseSubscriptionEnumeratorFactory & InjectionEnumerator)\n                        // but unless it's the last enumerator we drop it, because these first are the warmup enumerators\n                        // or we are not allowed to return null\n                        break;\n                    }\n\n                    if (_skipDuplicateEndTimes\n                        && _lastEnumeratorEndTime.HasValue\n                        && enumerator.Current != null\n                        && enumerator.Current.EndTime <= _lastEnumeratorEndTime)\n                    {\n                        continue;\n                    }\n\n                    Current = enumerator.Current;\n                    return true;\n                }\n\n                _lastEnumeratorEndTime = Current?.EndTime;\n\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"ConcatEnumerator.MoveNext(): disposing enumerator at position: {_currentIndex} Name: {enumerator.GetType().Name}\");\n                }\n\n                // we wont be using this enumerator again, dispose of it and clear reference\n                enumerator.DisposeSafely();\n                _enumerators[_currentIndex] = null;\n            }\n\n            Current = null;\n            return false;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        public void Reset()\n        {\n            throw new InvalidOperationException($\"Can not reset {nameof(ConcatEnumerator)}\");\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var enumerator in _enumerators)\n            {\n                enumerator.DisposeSafely();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/DelistingEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"Delisting\"/> events\n    /// </summary>\n    public class DelistingEventProvider : ITradableDateEventProvider\n    {\n        // we'll use these flags to denote we've already fired off the DelistingType.Warning\n        // and a DelistedType.Delisted Delisting object, the _delistingType object is save here\n        // since we need to wait for the next trading day before emitting\n        private bool _delisted;\n        private bool _delistedWarning;\n        private IMapFileProvider _mapFileProvider;\n\n        /// <summary>\n        /// The delisting date\n        /// </summary>\n        protected ReferenceWrapper<DateTime> DelistingDate { get; set; }\n\n        /// <summary>\n        /// The current instance being used\n        /// </summary>\n        protected MapFile MapFile { get; private set; }\n\n        /// <summary>\n        /// The associated configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; private set; }\n\n        /// <summary>\n        /// Initializes this instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"Data.Auxiliary.MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        public virtual void Initialize(\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime)\n        {\n            Config = config;\n            _mapFileProvider = mapFileProvider;\n\n            InitializeMapFile();\n        }\n\n        /// <summary>\n        /// Check for delistings\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New delisting event if any</returns>\n        public virtual IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            if (Config.Symbol == eventArgs.Symbol)\n            {\n                // we send the delisting warning when we reach the delisting date, here we make sure we compare using the date component\n                // of the delisting date since for example some futures can trade a few hours in their delisting date, else we would skip on\n                // emitting the delisting warning, which triggers us to handle liquidation once delisted\n                if (!_delistedWarning && eventArgs.Date >= DelistingDate.Value.Date)\n                {\n                    _delistedWarning = true;\n                    var price = eventArgs.LastBaseData?.Price ?? 0;\n                    yield return new Delisting(\n                        eventArgs.Symbol,\n                        DelistingDate.Value.Date,\n                        price,\n                        DelistingType.Warning);\n                }\n                if (!_delisted && eventArgs.Date > DelistingDate.Value)\n                {\n                    _delisted = true;\n                    var price = eventArgs.LastBaseData?.Price ?? 0;\n                    // delisted at EOD\n                    yield return new Delisting(\n                        eventArgs.Symbol,\n                        DelistingDate.Value.AddDays(1),\n                        price,\n                        DelistingType.Delisted);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes the factor file to use\n        /// </summary>\n        protected void InitializeMapFile()\n        {\n            MapFile = _mapFileProvider.ResolveMapFile(Config);\n            DelistingDate = new ReferenceWrapper<DateTime>(Config.Symbol.GetDelistingDate(MapFile));\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/DividendEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"Dividend\"/> events\n    /// </summary>\n    public class DividendEventProvider : ITradableDateEventProvider\n    {\n        // we set the price factor ratio when we encounter a dividend in the factor file\n        // and on the next trading day we use this data to produce the dividend instance\n        private decimal? _priceFactorRatio;\n        private decimal _referencePrice;\n        private IFactorFileProvider _factorFileProvider;\n        private MapFile _mapFile;\n\n        /// <summary>\n        /// The current instance being used\n        /// </summary>\n        protected CorporateFactorProvider FactorFile { get; private set; }\n\n        /// <summary>\n        /// The associated configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; private set; }\n\n        /// <summary>\n        /// Initializes this instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"Data.Auxiliary.MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        public void Initialize(\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime)\n        {\n            Config = config;\n            _factorFileProvider = factorFileProvider;\n            _mapFile = mapFileProvider.ResolveMapFile(Config);\n            InitializeFactorFile();\n        }\n\n        /// <summary>\n        /// Check for dividends and returns them\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New Dividend event if any</returns>\n        public  virtual IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            if (Config.Symbol == eventArgs.Symbol\n                && FactorFile != null\n                && _mapFile.HasData(eventArgs.Date))\n            {\n                if (_priceFactorRatio != null)\n                {\n                    if (_referencePrice == 0)\n                    {\n                        throw new InvalidOperationException($\"Zero reference price for {Config.Symbol} dividend at {eventArgs.Date}\");\n                    }\n\n                    var baseData = Dividend.Create(\n                        Config.Symbol,\n                        eventArgs.Date,\n                        _referencePrice,\n                        _priceFactorRatio.Value\n                    );\n                    // let the config know about it for normalization\n                    Config.SumOfDividends += baseData.Distribution;\n                    _priceFactorRatio = null;\n                    _referencePrice = 0;\n\n                    yield return baseData;\n                }\n\n                // check the factor file to see if we have a dividend event tomorrow\n                decimal priceFactorRatio;\n                decimal referencePrice;\n                if (FactorFile.HasDividendEventOnNextTradingDay(eventArgs.Date, out priceFactorRatio, out referencePrice))\n                {\n                    _priceFactorRatio = priceFactorRatio;\n                    _referencePrice = referencePrice;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes the factor file to use\n        /// </summary>\n        protected void InitializeFactorFile()\n        {\n            FactorFile = _factorFileProvider.Get(Config.Symbol) as CorporateFactorProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/EnqueueableEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IEnumerator{T}\"/> that relies on the\n    /// <see cref=\"Enqueue\"/> method being called and only ends when <see cref=\"Stop\"/>\n    /// is called\n    /// </summary>\n    /// <typeparam name=\"T\">The item type yielded by the enumerator</typeparam>\n    public class EnqueueableEnumerator<T> : IEnumerator<T>\n    {\n        private T _current;\n        private bool _end;\n\n        private readonly bool _isBlocking;\n        private long _consumerCount;\n        private Queue<T> _consumer = new();\n        private Queue<T> _producer = new();\n        private readonly object _lock = new object();\n        private readonly ManualResetEventSlim _resetEvent = new(false);\n\n        /// <summary>\n        /// Gets the current number of items held in the internal queue\n        /// </summary>\n        public int Count\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    if (_end) return 0;\n                    return _producer.Count + (int)Interlocked.Read(ref _consumerCount);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns true if the enumerator has finished and will not accept any more data\n        /// </summary>\n        public bool HasFinished\n        {\n            get { return _end; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EnqueueableEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"blocking\">Specifies whether or not to use the blocking behavior</param>\n        public EnqueueableEnumerator(bool blocking = false)\n        {\n            _isBlocking = blocking;\n        }\n\n        /// <summary>\n        /// Enqueues the new data into this enumerator\n        /// </summary>\n        /// <param name=\"data\">The data to be enqueued</param>\n        public void Enqueue(T data)\n        {\n            lock (_lock)\n            {\n                _producer.Enqueue(data);\n                // most of the time this will be set\n                if(!_resetEvent.IsSet)\n                {\n                    _resetEvent.Set();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Signals the enumerator to stop enumerating when the items currently\n        /// held inside are gone. No more items will be added to this enumerator.\n        /// </summary>\n        public void Stop()\n        {\n            lock (_lock)\n            {\n                if (_end) return;\n                _end = true;\n\n                // no more items can be added, so no need to wait anymore\n                _resetEvent.Set();\n                _resetEvent.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            // we read with no lock most of the time\n            if (_consumer.TryDequeue(out _current))\n            {\n                Interlocked.Decrement(ref _consumerCount);\n                return true;\n            }\n\n            bool ended;\n            do\n            {\n                var producer = _producer;\n                lock (_lock)\n                {\n                    // swap queues\n                    ended = _end;\n                    _producer = _consumer;\n                }\n                _consumer = producer;\n                if(_consumer.Count > 0)\n                {\n                    _current = _consumer.Dequeue();\n                    Interlocked.Exchange(ref _consumerCount, _consumer.Count);\n                    break;\n                }\n\n                // if we are here no queue has data\n                if (ended)\n                {\n                    return false;\n                }\n\n                if (_isBlocking)\n                {\n                    try\n                    {\n                        _resetEvent.Wait(Timeout.Infinite);\n                        _resetEvent.Reset();\n                    }\n                    catch (ObjectDisposedException)\n                    {\n                        // can happen if disposed\n                    }\n                }\n                else\n                {\n                    break;\n                }\n            }\n            while (!ended);\n\n            // even if we don't have data to return, we haven't technically\n            // passed the end of the collection, so always return true until\n            // the enumerator is explicitly disposed or ended\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            throw new NotImplementedException(\"EnqueableEnumerator.Reset() has not been implemented yet.\");\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public T Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Stop();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/Factories/BaseDataCollectionSubscriptionEnumeratorFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISubscriptionEnumeratorFactory\"/> that reads\n    /// an entire <see cref=\"SubscriptionDataSource\"/> into a single <see cref=\"BaseDataCollection\"/>\n    /// to be emitted on the tradable date at midnight\n    /// </summary>\n    /// <remarks>This enumerator factory is currently only used in backtesting with coarse data</remarks>\n    public class BaseDataCollectionSubscriptionEnumeratorFactory : ISubscriptionEnumeratorFactory\n    {\n        private IObjectStore _objectStore;\n\n        /// <summary>\n        /// Instanciates a new <see cref=\"BaseDataCollectionSubscriptionEnumeratorFactory\"/>\n        /// </summary>\n        /// <param name=\"objectStore\">The object store to use</param>\n        public BaseDataCollectionSubscriptionEnumeratorFactory(IObjectStore objectStore)\n        {\n            _objectStore = objectStore;\n        }\n\n        /// <summary>\n        /// Creates an enumerator to read the specified request\n        /// </summary>\n        /// <param name=\"request\">The subscription request to be read</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <returns>An enumerator reading the subscription request</returns>\n        public IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, IDataProvider dataProvider)\n        {\n            using (var dataCacheProvider = new SingleEntryDataCacheProvider(dataProvider))\n            {\n                var configuration = request.Configuration;\n                var sourceFactory = (BaseData)Activator.CreateInstance(request.Configuration.Type);\n\n                // Behaves in the same way as in live trading\n                // (i.e. only emit coarse data on dates following a trading day)\n                // The shifting of dates is needed to ensure we never emit coarse data on the same date,\n                // because it would enable look-ahead bias.\n\n                foreach (var date in request.TradableDaysInDataTimeZone)\n                {\n                    var source = sourceFactory.GetSource(configuration, date, false);\n                    var factory = SubscriptionDataSourceReader.ForSource(source, dataCacheProvider, configuration, date, false, sourceFactory,\n                        dataProvider, _objectStore);\n                    var coarseFundamentalForDate = factory.Read(source);\n                    //  shift all date of emitting the file forward one day to model emitting coarse midnight the next day.\n                    yield return new BaseDataCollection(date.AddDays(1), configuration.Symbol, coarseFundamentalForDate);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/Factories/CorporateEventEnumeratorFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories\n{\n    /// <summary>\n    /// Helper class used to create the corporate event providers\n    /// <see cref=\"MappingEventProvider\"/>, <see cref=\"SplitEventProvider\"/>,\n    /// <see cref=\"DividendEventProvider\"/>, <see cref=\"DelistingEventProvider\"/>\n    /// </summary>\n    public static class CorporateEventEnumeratorFactory\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"AuxiliaryDataEnumerator\"/> that will hold the\n        /// corporate event providers\n        /// </summary>\n        /// <param name=\"rawDataEnumerator\">The underlying raw data enumerator</param>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">Used for getting factor files</param>\n        /// <param name=\"tradableDayNotifier\">Tradable dates provider</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        /// <param name=\"endTime\">\n        /// End date for the data request.\n        /// This will be used for <see cref=\"DataNormalizationMode.ScaledRaw\"/> data normalization mode to adjust prices to the given end date\n        /// </param>\n        /// <param name=\"enablePriceScaling\">Applies price factor</param>\n        /// <returns>The new auxiliary data enumerator</returns>\n        public static IEnumerator<BaseData> CreateEnumerators(\n            IEnumerator<BaseData> rawDataEnumerator,\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            ITradableDatesNotifier tradableDayNotifier,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime,\n            DateTime endTime,\n            bool enablePriceScaling = true)\n        {\n\n            var tradableEventProviders = new List<ITradableDateEventProvider>();\n\n            if (config.EmitSplitsAndDividends())\n            {\n                tradableEventProviders.Add(new SplitEventProvider());\n                tradableEventProviders.Add(new DividendEventProvider());\n            }\n\n            if (config.TickerShouldBeMapped())\n            {\n                tradableEventProviders.Add(new MappingEventProvider());\n            }\n\n            if (config.CanBeDelisted())\n            {\n                tradableEventProviders.Add(new DelistingEventProvider());\n            }\n\n            var enumerator = new AuxiliaryDataEnumerator(\n                config,\n                factorFileProvider,\n                mapFileProvider,\n                tradableEventProviders.ToArray(),\n                tradableDayNotifier,\n                startTime);\n\n            // avoid price scaling for backtesting; calculate it directly in worker\n            // and allow subscription to extract the the data depending on config data mode\n            var dataEnumerator = rawDataEnumerator;\n            if (enablePriceScaling && config.PricesShouldBeScaled())\n            {\n                dataEnumerator = new PriceScaleFactorEnumerator(\n                    rawDataEnumerator,\n                    config,\n                    factorFileProvider,\n                    endDate: endTime);\n            }\n\n            return new SynchronizingBaseDataEnumerator(dataEnumerator, enumerator);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/Factories/LiveCustomDataSubscriptionEnumeratorFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISubscriptionEnumeratorFactory\"/> to handle live custom data.\n    /// </summary>\n    public class LiveCustomDataSubscriptionEnumeratorFactory : ISubscriptionEnumeratorFactory\n    {\n        private readonly TimeSpan _minimumIntervalCheck;\n        private readonly ITimeProvider _timeProvider;\n        private readonly Func<DateTime, DateTime> _dateAdjustment;\n        private readonly IObjectStore _objectStore;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LiveCustomDataSubscriptionEnumeratorFactory\"/> class\n        /// </summary>\n        /// <param name=\"timeProvider\">Time provider from data feed</param>\n        /// <param name=\"objectStore\">The object store to use</param>\n        /// <param name=\"dateAdjustment\">Func that allows adjusting the datetime to use</param>\n        /// <param name=\"minimumIntervalCheck\">Allows specifying the minimum interval between each enumerator refresh and data check, default is 30 minutes</param>\n        public LiveCustomDataSubscriptionEnumeratorFactory(ITimeProvider timeProvider, IObjectStore objectStore,\n            Func<DateTime, DateTime> dateAdjustment = null, TimeSpan? minimumIntervalCheck = null)\n        {\n            _timeProvider = timeProvider;\n            _dateAdjustment = dateAdjustment;\n            _minimumIntervalCheck = minimumIntervalCheck ?? TimeSpan.FromMinutes(30);\n            _objectStore = objectStore;\n        }\n\n        /// <summary>\n        /// Creates an enumerator to read the specified request.\n        /// </summary>\n        /// <param name=\"request\">The subscription request to be read</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <returns>An enumerator reading the subscription request</returns>\n        public IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, IDataProvider dataProvider)\n        {\n            var config = request.Configuration;\n\n            // frontier value used to prevent emitting duplicate time stamps between refreshed enumerators\n            // also provides some immediate fast-forward to handle spooling through remote files quickly\n            var frontier = Ref.Create(_dateAdjustment?.Invoke(request.StartTimeLocal) ?? request.StartTimeLocal);\n            var lastSourceRefreshTime = DateTime.MinValue;\n            var sourceFactory = config.GetBaseDataInstance();\n\n            // this is refreshing the enumerator stack for each new source\n            var refresher = new RefreshEnumerator<BaseData>(() =>\n            {\n                // rate limit the refresh of this enumerator stack\n                var utcNow = _timeProvider.GetUtcNow();\n                var minimumTimeBetweenCalls = GetMinimumTimeBetweenCalls(config.Increment, _minimumIntervalCheck);\n                if (utcNow - lastSourceRefreshTime < minimumTimeBetweenCalls)\n                {\n                    return Enumerable.Empty<BaseData>().GetEnumerator();\n                }\n\n                lastSourceRefreshTime = utcNow;\n                var localDate = _dateAdjustment?.Invoke(utcNow.ConvertFromUtc(config.ExchangeTimeZone).Date) ?? utcNow.ConvertFromUtc(config.ExchangeTimeZone).Date;\n                var source = sourceFactory.GetSource(config, localDate, true);\n\n                // fetch the new source and enumerate the data source reader\n                var enumerator = EnumerateDataSourceReader(config, dataProvider, frontier, source, localDate, sourceFactory);\n\n                if (SourceRequiresFastForward(source))\n                {\n                    // The FastForwardEnumerator implements these two features:\n                    // (1) make sure we never emit past data\n                    // (2) data filtering based on a maximum data age\n                    // For custom data we don't want feature (2) because we would reject data points emitted later\n                    // (e.g. Quandl daily data after a weekend), so we disable it using a huge maximum data age.\n\n                    // apply fast forward logic for file transport mediums\n                    var maximumDataAge = GetMaximumDataAge(Time.MaxTimeSpan);\n                    enumerator = new FastForwardEnumerator(enumerator, _timeProvider, config.ExchangeTimeZone, maximumDataAge);\n                }\n                else\n                {\n                    // rate limit calls to this enumerator stack\n                    enumerator = new RateLimitEnumerator<BaseData>(enumerator, _timeProvider, minimumTimeBetweenCalls);\n                }\n\n                if (source.Format == FileFormat.UnfoldingCollection)\n                {\n                    // unroll collections into individual data points after fast forward/rate limiting applied\n                    enumerator = enumerator.SelectMany(data =>\n                    {\n                        var collection = data as BaseDataCollection;\n                        IEnumerator<BaseData> collectionEnumerator;\n                        if (collection != null)\n                        {\n                            if (source.TransportMedium == SubscriptionTransportMedium.Rest || source.TransportMedium == SubscriptionTransportMedium.RemoteFile)\n                            {\n                                // we want to make sure the data points we *unroll* are not past\n                                collectionEnumerator = collection.Data\n                                    .Where(baseData => baseData.EndTime > frontier.Value)\n                                    .GetEnumerator();\n                            }\n                            else\n                            {\n                                collectionEnumerator = collection.Data.GetEnumerator();\n                            }\n                        }\n                        else\n                        {\n                            collectionEnumerator = new List<BaseData> { data }.GetEnumerator();\n                        }\n                        return collectionEnumerator;\n                    });\n                }\n\n                return enumerator;\n            });\n\n            return refresher;\n        }\n\n        private IEnumerator<BaseData> EnumerateDataSourceReader(SubscriptionDataConfig config, IDataProvider dataProvider, Ref<DateTime> localFrontier, SubscriptionDataSource source, DateTime localDate, BaseData baseDataInstance)\n        {\n            using (var dataCacheProvider = new SingleEntryDataCacheProvider(dataProvider))\n            {\n                var newLocalFrontier = localFrontier.Value;\n                var dataSourceReader = GetSubscriptionDataSourceReader(source, dataCacheProvider, config, localDate, baseDataInstance, dataProvider);\n                using var subscriptionEnumerator = SortEnumerator<DateTime>.TryWrapSortEnumerator(source.Sort, dataSourceReader.Read(source));\n                foreach (var datum in subscriptionEnumerator)\n                {\n                    // always skip past all times emitted on the previous invocation of this enumerator\n                    // this allows data at the same time from the same refresh of the source while excluding\n                    // data from different refreshes of the source\n                    if (datum != null && datum.EndTime > localFrontier.Value)\n                    {\n                        yield return datum;\n                    }\n                    else if (!SourceRequiresFastForward(source))\n                    {\n                        // if the 'source' is Rest and there is no new value,\n                        // we *break*, else we will be caught in a tight loop\n                        // because Rest source never ends!\n                        // edit: we 'break' vs 'return null' so that the source is refreshed\n                        // allowing date changes to impact the source value\n                        // note it will respect 'minimumTimeBetweenCalls'\n                        break;\n                    }\n\n                    if (datum != null)\n                    {\n                        newLocalFrontier = Time.Max(datum.EndTime, newLocalFrontier);\n\n                        if (!SourceRequiresFastForward(source))\n                        {\n                            // if the 'source' is Rest we need to update the localFrontier here\n                            // because Rest source never ends!\n                            // Should be advance frontier for all source types here?\n                            localFrontier.Value = newLocalFrontier;\n                        }\n                    }\n                }\n\n                localFrontier.Value = newLocalFrontier;\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"ISubscriptionDataSourceReader\"/> for the specified source\n        /// </summary>\n        protected virtual ISubscriptionDataSourceReader GetSubscriptionDataSourceReader(SubscriptionDataSource source,\n            IDataCacheProvider dataCacheProvider,\n            SubscriptionDataConfig config,\n            DateTime date,\n            BaseData baseDataInstance,\n            IDataProvider dataProvider\n            )\n        {\n            return SubscriptionDataSourceReader.ForSource(source, dataCacheProvider, config, date, true, baseDataInstance, dataProvider, _objectStore);\n        }\n\n        private bool SourceRequiresFastForward(SubscriptionDataSource source)\n        {\n            return source.TransportMedium == SubscriptionTransportMedium.LocalFile\n                || source.TransportMedium == SubscriptionTransportMedium.RemoteFile;\n        }\n\n        private static TimeSpan GetMinimumTimeBetweenCalls(TimeSpan increment, TimeSpan minimumInterval)\n        {\n            return TimeSpan.FromTicks(Math.Min(increment.Ticks, minimumInterval.Ticks));\n        }\n\n        private static TimeSpan GetMaximumDataAge(TimeSpan increment)\n        {\n            return TimeSpan.FromTicks(Math.Max(increment.Ticks, TimeSpan.FromSeconds(5).Ticks));\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/Factories/SubscriptionDataReaderSubscriptionEnumeratorFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISubscriptionEnumeratorFactory\"/> that used the <see cref=\"SubscriptionDataReader\"/>\n    /// </summary>\n    /// <remarks>Only used on backtesting by the <see cref=\"FileSystemDataFeed\"/></remarks>\n    public class SubscriptionDataReaderSubscriptionEnumeratorFactory : ISubscriptionEnumeratorFactory, IDisposable\n    {\n        private readonly IResultHandler _resultHandler;\n        private readonly IFactorFileProvider _factorFileProvider;\n        private readonly IDataCacheProvider _dataCacheProvider;\n        private readonly ConcurrentDictionary<Symbol, string> _numericalPrecisionLimitedWarnings;\n        private readonly int _numericalPrecisionLimitedWarningsMaxCount = 10;\n        private readonly ConcurrentDictionary<Symbol, string> _startDateLimitedWarnings;\n        private readonly int _startDateLimitedWarningsMaxCount = 10;\n        private readonly IMapFileProvider _mapFileProvider;\n        private readonly bool _enablePriceScaling;\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionDataReaderSubscriptionEnumeratorFactory\"/> class\n        /// </summary>\n        /// <param name=\"resultHandler\">The result handler for the algorithm</param>\n        /// <param name=\"mapFileProvider\">The map file provider</param>\n        /// <param name=\"factorFileProvider\">The factor file provider</param>\n        /// <param name=\"cacheProvider\">Provider used to get data when it is not present on disk</param>\n        /// <param name=\"algorithm\">The algorithm instance to use</param>\n        /// <param name=\"enablePriceScaling\">Applies price factor</param>\n        public SubscriptionDataReaderSubscriptionEnumeratorFactory(IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataCacheProvider cacheProvider,\n            IAlgorithm algorithm,\n            bool enablePriceScaling = true\n            )\n        {\n            _algorithm = algorithm;\n            _resultHandler = resultHandler;\n            _mapFileProvider = mapFileProvider;\n            _factorFileProvider = factorFileProvider;\n            _dataCacheProvider = cacheProvider;\n            _numericalPrecisionLimitedWarnings = new ConcurrentDictionary<Symbol, string>();\n            _startDateLimitedWarnings = new ConcurrentDictionary<Symbol, string>();\n            _enablePriceScaling = enablePriceScaling;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"SubscriptionDataReader\"/> to read the specified request\n        /// </summary>\n        /// <param name=\"request\">The subscription request to be read</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <returns>An enumerator reading the subscription request</returns>\n        public IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, IDataProvider dataProvider)\n        {\n            var dataReader = new SubscriptionDataReader(request.Configuration,\n                request,\n                _mapFileProvider,\n                _factorFileProvider,\n                _dataCacheProvider,\n                dataProvider,\n                _algorithm.ObjectStore);\n\n            dataReader.InvalidConfigurationDetected += (sender, args) => { _resultHandler.ErrorMessage(args.Message); };\n            dataReader.StartDateLimited += (sender, args) =>\n            {\n                // Queue this warning into our dictionary to report on dispose\n                if (_startDateLimitedWarnings.Count <= _startDateLimitedWarningsMaxCount)\n                {\n                    _startDateLimitedWarnings.TryAdd(args.Symbol, args.Message);\n                }\n            };\n            dataReader.DownloadFailed += (sender, args) => { _resultHandler.ErrorMessage(args.Message, args.StackTrace); };\n            dataReader.ReaderErrorDetected += (sender, args) => { _resultHandler.RuntimeError(args.Message, args.StackTrace); };\n            dataReader.NumericalPrecisionLimited += (sender, args) =>\n            {\n                // Set a hard limit to keep this warning list from getting unnecessarily large\n                if (_numericalPrecisionLimitedWarnings.Count <= _numericalPrecisionLimitedWarningsMaxCount)\n                {\n                    _numericalPrecisionLimitedWarnings.TryAdd(args.Symbol, args.Message);\n                }\n            };\n\n            IEnumerator<BaseData> enumerator = dataReader;\n            if (LeanData.UseDailyStrictEndTimes(_algorithm.Settings, request, request.Configuration.Symbol, request.Configuration.Increment))\n            {\n                // before corporate events which might yield data and we synchronize both feeds\n                enumerator = new StrictDailyEndTimesEnumerator(enumerator, request.ExchangeHours, request.StartTimeLocal);\n            }\n\n            enumerator = CorporateEventEnumeratorFactory.CreateEnumerators(\n                enumerator,\n                request.Configuration,\n                _factorFileProvider,\n                dataReader,\n                _mapFileProvider,\n                request.StartTimeLocal,\n                request.EndTimeLocal,\n                _enablePriceScaling);\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            // Log our numerical precision limited warnings if any\n            if (!_numericalPrecisionLimitedWarnings.IsNullOrEmpty())\n            {\n                var message = \"Due to numerical precision issues in the factor file, data for the following\" +\n                    $\" symbols was adjust to a later starting date: {string.Join(\", \", _numericalPrecisionLimitedWarnings.Values.Take(_numericalPrecisionLimitedWarningsMaxCount))}\";\n\n                // If we reached our max warnings count suggest that more may have been left out\n                if (_numericalPrecisionLimitedWarnings.Count >= _numericalPrecisionLimitedWarningsMaxCount)\n                {\n                    message += \"...\";\n                }\n\n                _resultHandler.DebugMessage(message);\n            }\n\n            // Log our start date adjustments because of map files\n            if (!_startDateLimitedWarnings.IsNullOrEmpty())\n            {\n                var message = \"The starting dates for the following symbols have been adjusted to match their\" +\n                    $\" map files first date: {string.Join(\", \", _startDateLimitedWarnings.Values.Take(_startDateLimitedWarningsMaxCount))}\";\n\n                // If we reached our max warnings count suggest that more may have been left out\n                if (_startDateLimitedWarnings.Count >= _startDateLimitedWarningsMaxCount)\n                {\n                    message += \"...\";\n                }\n\n                _resultHandler.DebugMessage(message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/Factories/TimeTriggeredUniverseSubscriptionEnumeratorFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISubscriptionEnumeratorFactory\"/> to emit\n    /// ticks based on <see cref=\"UserDefinedUniverse.GetTriggerTimes\"/>, allowing universe\n    /// selection to fire at planned times.\n    /// </summary>\n    public class TimeTriggeredUniverseSubscriptionEnumeratorFactory : ISubscriptionEnumeratorFactory\n    {\n        private readonly ITimeTriggeredUniverse _universe;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TimeTriggeredUniverseSubscriptionEnumeratorFactory\"/> class\n        /// </summary>\n        /// <param name=\"universe\">The user defined universe</param>\n        /// <param name=\"marketHoursDatabase\">The market hours database</param>\n        public TimeTriggeredUniverseSubscriptionEnumeratorFactory(ITimeTriggeredUniverse universe, MarketHoursDatabase marketHoursDatabase)\n        {\n            _universe = universe;\n            _marketHoursDatabase = marketHoursDatabase;\n        }\n\n        /// <summary>\n        /// Creates an enumerator to read the specified request\n        /// </summary>\n        /// <param name=\"request\">The subscription request to be read</param>\n        /// <param name=\"dataProvider\">Provider used to get data when it is not present on disk</param>\n        /// <returns>An enumerator reading the subscription request</returns>\n        public IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, IDataProvider dataProvider)\n        {\n            return _universe.GetTriggerTimes(request.StartTimeUtc, request.EndTimeUtc, _marketHoursDatabase)\n                .Select(x => new Tick { Time = x, Symbol = request.Configuration.Symbol })\n                .GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/FastForwardEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides the ability to fast forward an enumerator based on the age of the data\n    /// </summary>\n    public class FastForwardEnumerator : IEnumerator<BaseData>\n    {\n        private BaseData _current;\n\n        private readonly DateTimeZone _timeZone;\n        private readonly TimeSpan _maximumDataAge;\n        private readonly ITimeProvider _timeProvider;\n        private readonly IEnumerator<BaseData> _enumerator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FastForwardEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerator\">The source enumerator</param>\n        /// <param name=\"timeProvider\">A time provider used to determine age of data</param>\n        /// <param name=\"timeZone\">The data's time zone</param>\n        /// <param name=\"maximumDataAge\">The maximum age of data allowed</param>\n        public FastForwardEnumerator(IEnumerator<BaseData> enumerator, ITimeProvider timeProvider, DateTimeZone timeZone, TimeSpan maximumDataAge)\n        {\n            _enumerator = enumerator;\n            _timeProvider = timeProvider;\n            _timeZone = timeZone;\n            _maximumDataAge = maximumDataAge;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        public bool MoveNext()\n        {\n            // keep churning until recent data or null\n            while (_enumerator.MoveNext())\n            {\n                // we can't fast forward nulls or bad times\n                if (_enumerator.Current == null || _enumerator.Current.Time == DateTime.MinValue)\n                {\n                    _current = null;\n                    return true;\n                }\n\n                // make sure we never emit past data\n                if (_current != null && _current.EndTime > _enumerator.Current.EndTime)\n                {\n                    continue;\n                }\n\n                // comute the age of the data, if within limits we're done\n                var age = _timeProvider.GetUtcNow().ConvertFromUtc(_timeZone) - _enumerator.Current.EndTime;\n                if (age <= _maximumDataAge)\n                {\n                    _current = _enumerator.Current;\n                    return true;\n                }\n            }\n\n            // we've exhausted the underlying enumerator, iterator completed\n            _current = null;\n            return false;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseData Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// The FillForwardEnumerator wraps an existing base data enumerator and inserts extra 'base data' instances\n    /// on a specified fill forward resolution\n    /// </summary>\n    public class FillForwardEnumerator : IEnumerator<BaseData>\n    {\n        private DateTime? _delistedTime;\n        private BaseData _previous;\n        private bool _ended;\n        private bool _isFillingForward;\n        private bool _initialized;\n\n        /// <summary>\n        /// Whether to use strict daily end times\n        /// </summary>\n        protected bool UseStrictEndTime { get; }\n\n        private readonly TimeSpan _dataResolution;\n        private readonly DateTimeZone _dataTimeZone;\n        private readonly bool _isExtendedMarketHours;\n        private readonly DateTime _subscriptionStartTime;\n        private readonly DateTime _subscriptionEndTime;\n        private readonly CalendarInfo _subscriptionEndDataCalendar;\n        private readonly IEnumerator<BaseData> _enumerator;\n        private readonly IReadOnlyRef<TimeSpan> _fillForwardResolution;\n        private readonly bool _strictEndTimeIntraDayFillForward;\n\n        /// <summary>\n        /// The exchange used to determine when to insert fill forward data\n        /// </summary>\n        protected SecurityExchange Exchange { get; init; }\n\n        /// <summary>\n        /// A reference to the last point emitted for the subscription.\n        /// This is used to feed the last point of a previous enumerator in cases like concatenated enumerators.\n        /// For instance, if this enumerator is concatenated to a warm up one, we can use this to feed\n        /// the last point of the warm up enumerator to this one, so that it can use it to fill forward if\n        /// the first actual point of this enumerator is ahead of the subscription start time or the first market open after it.\n        /// </summary>\n        private LastPointTracker _lastPointTracker;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FillForwardEnumerator\"/> class that accepts\n        /// a reference to the fill forward resolution, useful if the fill forward resolution is dynamic\n        /// and changing as the enumeration progresses\n        /// </summary>\n        /// <param name=\"enumerator\">The source enumerator to be filled forward</param>\n        /// <param name=\"exchange\">The exchange used to determine when to insert fill forward data</param>\n        /// <param name=\"fillForwardResolution\">The resolution we'd like to receive data on</param>\n        /// <param name=\"isExtendedMarketHours\">True to use the exchange's extended market hours, false to use the regular market hours</param>\n        /// <param name=\"subscriptionStartTime\">The start time of the subscription</param>\n        /// <param name=\"subscriptionEndTime\">The end time of the subscription, once passing this date the enumerator will stop</param>\n        /// <param name=\"dataResolution\">The source enumerator's data resolution</param>\n        /// <param name=\"dataTimeZone\">The time zone of the underlying source data. This is used for rounding calculations and\n        /// is NOT the time zone on the BaseData instances (unless of course data time zone equals the exchange time zone)</param>\n        /// <param name=\"dailyStrictEndTimeEnabled\">True if daily strict end times are enabled</param>\n        /// <param name=\"dataType\">The configuration data type this enumerator is for</param>\n        /// <param name=\"lastPointTracker\">A reference to the last point emitted before this enumerator is first enumerated</param>\n        public FillForwardEnumerator(IEnumerator<BaseData> enumerator,\n            SecurityExchange exchange,\n            IReadOnlyRef<TimeSpan> fillForwardResolution,\n            bool isExtendedMarketHours,\n            DateTime subscriptionStartTime,\n            DateTime subscriptionEndTime,\n            TimeSpan dataResolution,\n            DateTimeZone dataTimeZone,\n            bool dailyStrictEndTimeEnabled,\n            Type dataType = null,\n            LastPointTracker lastPointTracker = null\n            )\n        {\n            _subscriptionStartTime = subscriptionStartTime;\n            _subscriptionEndTime = subscriptionEndTime;\n            Exchange = exchange;\n            _enumerator = enumerator;\n            _dataResolution = dataResolution;\n            _dataTimeZone = dataTimeZone;\n            _fillForwardResolution = fillForwardResolution;\n            _isExtendedMarketHours = isExtendedMarketHours;\n            _lastPointTracker = lastPointTracker;\n            UseStrictEndTime = dailyStrictEndTimeEnabled;\n            // OI data is fill-forwarded to the market close time when strict end times is enabled.\n            // Open interest data can arrive at any time and this would allow to synchronize it with trades and quotes when daily\n            // strict end times is enabled\n            _strictEndTimeIntraDayFillForward = dailyStrictEndTimeEnabled && dataType != null && dataType == typeof(OpenInterest);\n\n            // '_dataResolution' and '_subscriptionEndTime' are readonly they won't change, so lets calculate this once here since it's expensive.\n            // if UseStrictEndTime and also _strictEndTimeIntraDayFillForward, this is a subscription with data that is not adjusted\n            // for the strict end time (like open interest) but require fill forward to synchronize with other data.\n            // Use the non strict end time calendar for the last day of data so that all data for that date is emitted.\n            if (UseStrictEndTime && !_strictEndTimeIntraDayFillForward)\n            {\n                var lastDayCalendar = GetDailyCalendar(_subscriptionEndTime);\n                while (lastDayCalendar.End > _subscriptionEndTime)\n                {\n                    lastDayCalendar = GetDailyCalendar(lastDayCalendar.Start.AddDays(-1));\n                }\n                _subscriptionEndDataCalendar = lastDayCalendar;\n            }\n            else\n            {\n                _subscriptionEndDataCalendar = new (RoundDown(_subscriptionEndTime, _dataResolution), _dataResolution);\n            }\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current => Current;\n\n        private void Initialize()\n        {\n            if (_initialized)\n            {\n                return;\n            }\n\n            if (_lastPointTracker?.LastDataPoint != null)\n            {\n                // adjust the previous data point to the subscription start time to\n                // avoid emitting fill forward data before that\n                _previous = _lastPointTracker.LastDataPoint.Clone();\n                _previous.Time = _subscriptionStartTime - _dataResolution;\n            }\n\n            _initialized = true;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            Initialize();\n\n            if (_delistedTime.HasValue)\n            {\n                // don't fill forward after data after the delisted date\n                if (_previous == null || _previous.EndTime >= _delistedTime.Value)\n                {\n                    return false;\n                }\n            }\n\n            if (Current != null && Current.DataType != MarketDataType.Auxiliary)\n            {\n                // only set the _previous if the last item we emitted was NOT auxilliary data,\n                // since _previous is used for fill forward behavior\n                _previous = Current;\n            }\n\n            BaseData fillForward;\n\n            if (!_isFillingForward)\n            {\n                // if we're filling forward we don't need to move next since we haven't emitted _enumerator.Current yet\n                if (!_enumerator.MoveNext())\n                {\n                    _ended = true;\n                    if (_delistedTime.HasValue)\n                    {\n                        // don't fill forward delisted data\n                        return false;\n                    }\n\n                    // check to see if we ran out of data before the end of the subscription\n                    if (_previous == null || _previous.EndTime >= _subscriptionEndTime)\n                    {\n                        // we passed the end of subscription, we're finished\n                        return false;\n                    }\n\n                    // we can fill forward the rest of this subscription if required\n                    var endOfSubscription = (Current ?? _previous).Clone(true);\n                    endOfSubscription.Time = _subscriptionEndDataCalendar.Start;\n                    endOfSubscription.EndTime = endOfSubscription.Time + _subscriptionEndDataCalendar.Period;\n                    if (RequiresFillForwardData(_fillForwardResolution.Value, _previous, endOfSubscription, out fillForward))\n                    {\n                        // don't mark as filling forward so we come back into this block, subscription is done\n                        //_isFillingForward = true;\n                        Current = fillForward;\n                        return true;\n                    }\n\n                    // don't emit the last bar if the market isn't considered open!\n                    if (!Exchange.IsOpenDuringBar(endOfSubscription.Time, endOfSubscription.EndTime, _isExtendedMarketHours))\n                    {\n                        return false;\n                    }\n\n                    if (Current != null && Current.EndTime == endOfSubscription.EndTime\n                        // TODO this changes stats, why would the FF enumerator emit a data point beyoned the end time he was requested\n                        //|| endOfSubscription.EndTime > _subscriptionEndTime\n                        )\n                    {\n                        return false;\n                    }\n                    Current = endOfSubscription;\n                    return true;\n                }\n            }\n            // If we are filling forward and the underlying is null, let's MoveNext() as long as it didn't end.\n            // This only applies for live trading, so that the LiveFillForwardEnumerator does not stall whenever\n            // we generate a fill-forward bar. The underlying enumerator is advanced so that we don't get stuck\n            // in a cycle of generating infinite fill-forward bars.\n            else if (_enumerator.Current == null && !_ended)\n            {\n                _ended = _enumerator.MoveNext();\n            }\n\n            var underlyingCurrent = _enumerator.Current;\n            if (underlyingCurrent != null && underlyingCurrent.DataType == MarketDataType.Auxiliary)\n            {\n                var delisting = underlyingCurrent as Delisting;\n                if (delisting?.Type == DelistingType.Delisted)\n                {\n                    _delistedTime = delisting.EndTime;\n                }\n            }\n\n            if (_previous == null)\n            {\n                // first data point we dutifully emit without modification\n                Current = underlyingCurrent;\n                return true;\n            }\n\n            if (RequiresFillForwardData(_fillForwardResolution.Value, _previous, underlyingCurrent, out fillForward))\n            {\n                if (_previous.EndTime >= _subscriptionEndTime)\n                {\n                    // we passed the end of subscription, we're finished\n                    return false;\n                }\n                // we require fill forward data because the _enumerator.Current is too far in future\n                _isFillingForward = true;\n                Current = fillForward;\n                return true;\n            }\n\n            _isFillingForward = false;\n            Current = underlyingCurrent;\n            return true;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Determines whether or not fill forward is required, and if true, will produce the new fill forward data\n        /// </summary>\n        /// <param name=\"fillForwardResolution\"></param>\n        /// <param name=\"previous\">The last piece of data emitted by this enumerator</param>\n        /// <param name=\"next\">The next piece of data on the source enumerator</param>\n        /// <param name=\"fillForward\">When this function returns true, this will have a non-null value, null when the function returns false</param>\n        /// <returns>True when a new fill forward piece of data was produced and should be emitted by this enumerator</returns>\n        protected virtual bool RequiresFillForwardData(TimeSpan fillForwardResolution, BaseData previous, BaseData next, out BaseData fillForward)\n        {\n            // in live trading next can be null, in which case we create a potential FF bar and the live FF enumerator will decide what to do\n            var nextCalculatedEndTimeUtc = DateTime.MaxValue;\n            if (next != null)\n            {\n                // convert times to UTC for accurate comparisons and differences across DST changes\n                var previousTimeUtc = previous.Time.ConvertToUtc(Exchange.TimeZone);\n                var nextTimeUtc = next.Time.ConvertToUtc(Exchange.TimeZone);\n                var nextEndTimeUtc = next.EndTime.ConvertToUtc(Exchange.TimeZone);\n\n                if (nextEndTimeUtc < previousTimeUtc)\n                {\n                    if (_lastPointTracker == null || next.EndTime > _subscriptionStartTime)\n                    {\n                        // in some cases we might emit auxiliary data even before our actual start time, which can happen in some cases during warmup\n                        // where previous was initialized through the last point tracker, this point will be filtered out\n                        // but in any other case though let's log it, shouldn't happen\n                        Log.Error(\"FillForwardEnumerator received data out of order. Symbol: \" + previous.Symbol.ID);\n                    }\n                    fillForward = null;\n                    return false;\n                }\n\n                // check to see if the gap between previous and next warrants fill forward behavior\n                if (!ShouldFillForward(previousTimeUtc, nextTimeUtc, fillForwardResolution))\n                {\n                    fillForward = null;\n                    return false;\n                }\n\n                // Double check!\n                // This might be the last FF bar before the next data point, and it might not be to be\n                // emitted because it will overlap with the next point.\n                // If the previous point was fill forwarded, its time might have been rounded down,\n                // we need to compare apples to apples.\n                // (e.g. daily bars with times != midnight and without strict end times)\n                var nextPeriod = nextEndTimeUtc - nextTimeUtc;\n                if (previous.IsFillForward && (!UseStrictEndTime || nextPeriod <= Time.OneHour))\n                {\n                    var roundedNextTimeUtc = RoundDown(next.Time, nextPeriod).ConvertToUtc(Exchange.TimeZone);\n                    if (!ShouldFillForward(previousTimeUtc, roundedNextTimeUtc, fillForwardResolution))\n                    {\n                        fillForward = null;\n                        return false;\n                    }\n                }\n\n                var period = _dataResolution;\n                if (UseStrictEndTime)\n                {\n                    // the period is not the data resolution (1 day) and can actually change dynamically, for example early close/late open\n                    period = next.EndTime - next.Time;\n                }\n                else if (next.Time == next.EndTime)\n                {\n                    // we merge corporate event data points (mapping, delisting, splits, dividend) which do not have\n                    // a period or resolution\n                    period = TimeSpan.Zero;\n                }\n                nextCalculatedEndTimeUtc = nextTimeUtc + period;\n            }\n\n            // every bar emitted MUST be of the data resolution.\n\n            // compute end times of the four potential fill forward scenarios\n            // 1. the next fill forward bar. 09:00-10:00 followed by 10:00-11:00 where 01:00 is the fill forward resolution\n            // 2. the next data resolution bar, same as above but with the data resolution instead\n            // 3. the next fill forward bar following the next market open, 15:00-16:00 followed by 09:00-10:00 the following open market day\n            // 4. the next data resolution bar following the next market open, same as above but with the data resolution instead\n\n            // the precedence for validation is based on the order of the end times, obviously if a potential match\n            // is before a later match, the earliest match should win.\n\n            foreach (var item in GetSortedReferenceDateIntervals(previous, fillForwardResolution, _dataResolution))\n            {\n                // issue GH 4925 , more description https://github.com/QuantConnect/Lean/pull/4941\n                // To build Time/EndTime we always use '+'/'-' dataResolution\n                // DataTime TZ = UTC -5; Exchange TZ = America/New York (-5/-4)\n                // Standard TimeZone    00:00:00 + 1 day = 1.00:00:00\n                // Daylight Time        01:00:00 + 1 day = 1.01:00:00\n\n                // daylight saving time starts/end at 2 a.m. on Sunday\n                // Having this information we find that the specific bar of Sunday\n                // Starts in one TZ (Standard TZ), but finishes in another (Daylight TZ) (consider winter => summer)\n                // During simple arithmetic operations like +/- we shift the time, but not the time zone\n                // which is sensitive for specific dates (daylight movement) if we are  in Exchange TimeZone, for example\n                // We have 00:00:00 + 1 day = 1.00:00:00, so both are in Standard TZ, but we expect endTime in Daylight, i.e. 1.01:00:00\n\n                // futher down double Convert (Exchange TZ => data TZ => Exchange TZ)\n                // allows us to calculate Time using it's own TZ (aka reapply)\n                // and don't rely on TZ of bar start/end time\n                // i.e. 00:00:00 + 1 day = 1.01:00:00, both start and end are in their own TZ\n                // it's interesting that NodaTime  consider next\n                // if time great or equal than 01:00 AM it's considered as \"moved\" (Standard, not Daylight)\n                // when time less than 01:00 AM it's considered as previous TZ (Standard, not Daylight)\n                // it's easy to fix this behavior by substract 1 tick  before first convert, and then return it back.\n                // so we work with 0:59:59.. AM instead.\n                // but now follow native behavior\n\n                // all above means, that all Time values, calculated using simple +/- operations\n                // sticks to original Time Zone, swallowing its own TZ and movement i.e.\n                // EndTime = Time + resolution, both Time and EndTime in the TZ of Time (Standard/Daylight)\n                // Time = EndTime - resolution, both Time and EndTime in the TZ of EndTime (Standard/Daylight)\n\n                // next.EndTime sticks to Time TZ,\n                // potentialBarEndTime should be calculated in the same way as bar.EndTime, i.e. Time + resolution\n                // round down doesn't make sense for daily data using strict times\n                var startTime = (UseStrictEndTime && item.Period > Time.OneHour) ? item.Start : RoundDown(item.Start, item.Period);\n                var potentialBarEndTime = startTime.ConvertToUtc(Exchange.TimeZone) + item.Period;\n\n                // to avoid duality it's necessary to compare potentialBarEndTime with\n                // next.EndTime calculated as Time + resolution,\n                // and both should be based on the same TZ (for example UTC)\n                if (potentialBarEndTime < nextCalculatedEndTimeUtc\n                    // let's fill forward based on previous (which isn't auxiliary) if next is auxiliary and they share the end time\n                    // we do allow emitting both an auxiliary data point and a Filled Forwared data for the same end time\n                    || next != null && next.DataType == MarketDataType.Auxiliary && potentialBarEndTime == nextCalculatedEndTimeUtc)\n                {\n                    // to check open hours we need to convert potential\n                    // bar EndTime into exchange time zone\n                    var potentialBarEndTimeInExchangeTZ =\n                        potentialBarEndTime.ConvertFromUtc(Exchange.TimeZone);\n                    var nextFillForwardBarStartTime = potentialBarEndTimeInExchangeTZ - item.Period;\n\n                    if (Exchange.IsOpenDuringBar(nextFillForwardBarStartTime, potentialBarEndTimeInExchangeTZ, _isExtendedMarketHours))\n                    {\n                        fillForward = previous.Clone(true);\n\n                        // bar are ALWAYS of the data resolution\n                        var expectedPeriod = _dataResolution;\n                        if (UseStrictEndTime)\n                        {\n                            // TODO: what about extended market hours\n                            // NOTE: Not using Exchange.Hours.RegularMarketDuration so we can handle things like early closes.\n\n                            // The earliest start time would be endTime - regularMarketDuration,\n                            // we use that as the potential time to get the exchange hours.\n                            // We don't use directly nextFillForwardBarStartTime because there might be cases where there are\n                            // adjacent extended and regular market hours segments that might cause the calendar start to be\n                            // in the previous date, and if it's an extended hours-only date like a Sunday for futures,\n                            // the market duration would be zero.\n                            var marketHoursDateTime = potentialBarEndTimeInExchangeTZ - Exchange.Hours.RegularMarketDuration;\n                            // That potential start is even before the calendar start, so we use the calendar start\n                            if (marketHoursDateTime < item.Start)\n                            {\n                                marketHoursDateTime = item.Start;\n                            }\n                            var marketHours = Exchange.Hours.GetMarketHours(marketHoursDateTime);\n                            expectedPeriod = marketHours.MarketDuration;\n                        }\n                        fillForward.Time = (potentialBarEndTime - expectedPeriod).ConvertFromUtc(Exchange.TimeZone);\n                        fillForward.EndTime = potentialBarEndTimeInExchangeTZ;\n                        return true;\n                    }\n                }\n                else\n                {\n                    break;\n                }\n            }\n\n            // the next is before the next fill forward time, so do nothing\n            fillForward = null;\n            return false;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private bool ShouldFillForward(DateTime previousTimeUtc, DateTime nextTimeUtc, TimeSpan fillForwardResolution)\n        {\n            var nextPreviousTimeUtcDelta = nextTimeUtc - previousTimeUtc;\n            return nextPreviousTimeUtcDelta > fillForwardResolution ||\n                nextPreviousTimeUtcDelta > _dataResolution ||\n                // even if there is no gap between the two data points, we still fill forward to ensure a FF bar is emitted at strict end time\n                _strictEndTimeIntraDayFillForward;\n        }\n\n        private IEnumerable<CalendarInfo> GetSortedReferenceDateIntervals(BaseData previous, TimeSpan fillForwardResolution, TimeSpan dataResolution)\n        {\n            if (fillForwardResolution < dataResolution)\n            {\n                return GetReferenceDateIntervals(previous.EndTime, fillForwardResolution, dataResolution);\n            }\n\n            if (fillForwardResolution > dataResolution)\n            {\n                return GetReferenceDateIntervals(previous.EndTime, dataResolution, fillForwardResolution);\n            }\n\n            return GetReferenceDateIntervals(previous.EndTime, fillForwardResolution);\n        }\n\n        /// <summary>\n        /// Get potential next fill forward bars.\n        /// </summary>\n        /// <remarks>Special case where fill forward resolution and data resolution are equal</remarks>\n        private IEnumerable<CalendarInfo> GetReferenceDateIntervals(DateTime previousEndTime, TimeSpan resolution)\n        {\n            // say daily bar goes from 9:30 to 16:00, if resolution is 1 day, IsOpenDuringBar can return true but it's not what we want\n            if (!UseStrictEndTime && Exchange.IsOpenDuringBar(previousEndTime, previousEndTime + resolution, _isExtendedMarketHours))\n            {\n                // if next in market us it\n                yield return new (previousEndTime, resolution);\n            }\n\n            if (UseStrictEndTime)\n            {\n                // If we're using strict end times for open interest data, for instance, the actual data comes at any time\n                // but we want to emit a ff point at market close. If extended market hours are enabled, and previousEndTime\n                // is Thursday after last segment open time, the daily calendar will be for Monday, because a next market open\n                // won't be found for Friday. So we use the Date of the previousEndTime to get calendar starting that day (Thursday)\n                // and ending the next one (Friday).\n                if (_strictEndTimeIntraDayFillForward)\n                {\n                    var firtMarketOpen = Exchange.Hours.GetNextMarketOpen(previousEndTime.Date, _isExtendedMarketHours);\n                    var firstCalendar = LeanData.GetDailyCalendar(firtMarketOpen, Exchange.Hours, false);\n\n                    if (firstCalendar.End > previousEndTime)\n                    {\n                        yield return firstCalendar;\n                    }\n                }\n\n                // now we can try the bar after next market open\n                var marketOpen = Exchange.Hours.GetNextMarketOpen(previousEndTime, false);\n                yield return GetDailyCalendar(marketOpen);\n            }\n            else\n            {\n                // now we can try the bar after next market open\n                var marketOpen = Exchange.Hours.GetNextMarketOpen(previousEndTime, _isExtendedMarketHours);\n                yield return new(marketOpen, resolution);\n            }\n        }\n\n        /// <summary>\n        /// Get potential next fill forward bars.\n        /// </summary>\n        private IEnumerable<CalendarInfo> GetReferenceDateIntervals(DateTime previousEndTime, TimeSpan smallerResolution, TimeSpan largerResolution)\n        {\n            List<CalendarInfo> result = null;\n            if (Exchange.IsOpenDuringBar(previousEndTime, previousEndTime + smallerResolution, _isExtendedMarketHours))\n            {\n                if (UseStrictEndTime)\n                {\n                    // case A\n                    result = new()\n                    {\n                        new(previousEndTime, smallerResolution)\n                    };\n                }\n                else\n                {\n                    // at the end of this method we perform an OrderBy which does not apply for this case because the consumer of this method\n                    // will perform a round down that will end up using an unexpected FF bar. This behavior is covered by tests\n                    yield return new (previousEndTime, smallerResolution);\n                }\n            }\n            result ??= new List<CalendarInfo>(4);\n\n            // we need to round down because previous end time could be of the smaller resolution, in data TZ!\n            if (UseStrictEndTime)\n            {\n                // case B: say smaller resolution (FF res) is 1 hour, larget resolution (daily data resolution) is 1 day\n                // For example for SPX we need to emit the daily FF bar from 8:30->15:15, even before the 'A' case above which would be 15->16 bar\n                var dailyCalendar = GetDailyCalendar(previousEndTime);\n                if (previousEndTime < (dailyCalendar.Start + dailyCalendar.Period))\n                {\n                    result.Add(new(dailyCalendar.Start, dailyCalendar.Period));\n                }\n            }\n            else\n            {\n                var start = RoundDown(previousEndTime, largerResolution);\n                if (Exchange.IsOpenDuringBar(start, start + largerResolution, _isExtendedMarketHours))\n                {\n                    result.Add(new(start, largerResolution));\n                }\n            }\n\n            // this is typically daily data being filled forward on a higher resolution\n            // since the previous bar was not in market hours then we can just fast forward\n            // to the next market open\n            var marketOpen = Exchange.Hours.GetNextMarketOpen(previousEndTime, _isExtendedMarketHours);\n            result.Add(new (marketOpen, smallerResolution));\n            if (UseStrictEndTime)\n            {\n                result.Add(GetDailyCalendar(Exchange.Hours.GetNextMarketOpen(previousEndTime, false)));\n            }\n\n            // we need to order them because they might not be in an incremental order and consumer expects them to be\n            foreach (var referenceDateInterval in result.OrderBy(interval => interval.Start + interval.Period))\n            {\n                yield return referenceDateInterval;\n            }\n        }\n\n        /// <summary>\n        /// We need to round down in data timezone.\n        /// For example GH issue 4392: Forex daily data, exchange tz time is 8PM, but time in data tz is 12AM\n        /// so rounding down on exchange tz will crop it, while rounding on data tz will return the same data point time.\n        /// Why are we even doing this? being able to determine the next valid data point for a resolution from a data point that might be in another resolution\n        /// </summary>\n        private DateTime RoundDown(DateTime value, TimeSpan interval)\n        {\n            return value.RoundDownInTimeZone(interval, Exchange.TimeZone, _dataTimeZone);\n        }\n\n        private CalendarInfo GetDailyCalendar(DateTime localReferenceTime)\n        {\n            // daily data does not have extended market hours, even if requested\n            // and it's times are always market hours if using strict end times see 'SetStrictEndTimes'\n            return LeanData.GetDailyCalendar(localReferenceTime, Exchange.Hours, extendedMarketHours: false);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/FilterEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Enumerator that allow applying a filtering function\n    /// </summary>\n    /// <typeparam name=\"T\"></typeparam>\n    public class FilterEnumerator<T> : IEnumerator<T>\n    {\n        private readonly IEnumerator<T> _enumerator;\n        private readonly Func<T, bool> _filter;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"enumerator\">The underlying enumerator to filter on</param>\n        /// <param name=\"filter\">The filter to apply</param>\n        public FilterEnumerator(IEnumerator<T> enumerator, Func<T, bool> filter)\n        {\n            _enumerator = enumerator;\n            _filter = filter;\n        }\n\n        #region Implementation of IDisposable\n\n        /// <summary>\n        /// Disposes the FilterEnumerator\n        /// </summary>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        #endregion\n\n        #region Implementation of IEnumerator\n\n        /// <summary>\n        /// Moves the FilterEnumerator to the next item\n        /// </summary>\n        public bool MoveNext()\n        {\n            // run the enumerator until it passes the specified filter\n            while (_enumerator.MoveNext())\n            {\n                if (_filter(_enumerator.Current))\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Resets the FilterEnumerator\n        /// </summary>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the current item in the FilterEnumerator\n        /// </summary>\n        public T Current\n        {\n            get { return _enumerator.Current; }\n        }\n\n        object IEnumerator.Current\n        {\n            get { return _enumerator.Current; }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/FrontierAwareEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IEnumerator{BaseData}\"/> that will not emit\n    /// data ahead of the frontier as specified by an instance of <see cref=\"ITimeProvider\"/>.\n    /// An instance of <see cref=\"TimeZoneOffsetProvider\"/> is used to convert between UTC\n    /// and the data's native time zone\n    /// </summary>\n    public class FrontierAwareEnumerator : IEnumerator<BaseData>\n    {\n        private BaseData _current;\n        private bool _needsMoveNext = true;\n\n        private readonly ITimeProvider _timeProvider;\n        private readonly IEnumerator<BaseData> _enumerator;\n        private readonly TimeZoneOffsetProvider _offsetProvider;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FrontierAwareEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerator\">The underlying enumerator to make frontier aware</param>\n        /// <param name=\"timeProvider\">The time provider used for resolving the current frontier time</param>\n        /// <param name=\"offsetProvider\">An offset provider used for converting the frontier UTC time into the data's native time zone</param>\n        public FrontierAwareEnumerator(IEnumerator<BaseData> enumerator, ITimeProvider timeProvider, TimeZoneOffsetProvider offsetProvider)\n        {\n            _enumerator = enumerator;\n            _timeProvider = timeProvider;\n            _offsetProvider = offsetProvider;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            var underlyingCurrent = _enumerator.Current;\n            var frontier = _timeProvider.GetUtcNow();\n            var localFrontier = new DateTime(frontier.Ticks + _offsetProvider.GetOffsetTicks(frontier));\n\n            // if we moved next, but didn't emit, check to see if it's time to emit yet\n            if (!_needsMoveNext && underlyingCurrent != null)\n            {\n                if (underlyingCurrent.EndTime <= localFrontier)\n                {\n                    // we can now emit the underlyingCurrent as part of this time slice\n                    _current = underlyingCurrent;\n                    _needsMoveNext = true;\n                }\n                else\n                {\n                    // it's still not time to emit the underlyingCurrent, keep waiting for time to advance\n                    _current = null;\n                    _needsMoveNext = false;\n                }\n                return true;\n            }\n\n            // we've exhausted the underlying enumerator, iteration completed\n            if (_needsMoveNext && !_enumerator.MoveNext())\n            {\n                _needsMoveNext = true;\n                _current = null;\n                return false;\n            }\n\n            underlyingCurrent = _enumerator.Current;\n\n            if (underlyingCurrent != null && underlyingCurrent.EndTime <= localFrontier)\n            {\n                _needsMoveNext = true;\n                _current = underlyingCurrent;\n            }\n            else\n            {\n                _current = null;\n                _needsMoveNext = underlyingCurrent == null;\n            }\n\n            // technically we still need to return true since the iteration is not completed,\n            // however, Current may be null follow a true result here\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseData Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/ITradableDateEventProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Interface for event providers for new tradable dates\n    /// </summary>\n    public interface ITradableDateEventProvider\n    {\n        /// <summary>\n        /// Called each time there is a new tradable day\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New corporate event if any</returns>\n        IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs);\n\n        /// <summary>\n        /// Initializes the event provider instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        void Initialize(SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime);\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/ITradableDatesNotifier.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Interface which will provide an event handler\n    /// who will be fired with each new tradable day\n    /// </summary>\n    public interface ITradableDatesNotifier\n    {\n        /// <summary>\n        /// Event fired when there is a new tradable date\n        /// </summary>\n        event EventHandler<NewTradableDateEventArgs> NewTradableDate;\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LastPointTracker.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Tracks the last data point received by an enumerator.\n    /// </summary>\n    public class LastPointTracker\n    {\n        private BaseData _lastPoint;\n\n        /// <summary>\n        /// Tracks the last data point received by the enumerator.\n        /// </summary>\n        public BaseData LastDataPoint\n        {\n            get => _lastPoint;\n            set\n            {\n                if (value != null && !value.IsFillForward && value.DataType != MarketDataType.Auxiliary)\n                {\n                    _lastPoint = value;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveAuxiliaryDataEnumerator.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Auxiliary data enumerator that will trigger new tradable dates event accordingly\n    /// </summary>\n    public class LiveAuxiliaryDataEnumerator : AuxiliaryDataEnumerator\n    {\n        private DateTime _lastTime;\n        private ITimeProvider _timeProvider;\n        private SecurityCache _securityCache;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"MapFile\"/> provider to use</param>\n        /// <param name=\"tradableDateEventProviders\">The tradable dates event providers</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        /// <param name=\"timeProvider\">The time provider to use</param>\n        /// <param name=\"securityCache\">The security cache</param>\n        public LiveAuxiliaryDataEnumerator(SubscriptionDataConfig config, IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider, ITradableDateEventProvider[] tradableDateEventProviders,\n            DateTime startTime,\n            ITimeProvider timeProvider,\n            SecurityCache securityCache)\n            // tradableDayNotifier: null -> we are going to trigger the new tradables events for the base implementation\n            : base(config, factorFileProvider, mapFileProvider, tradableDateEventProviders, tradableDayNotifier:null, startTime)\n        {\n            _securityCache = securityCache;\n            _timeProvider = timeProvider;\n\n            // initialize providers right away so mapping happens before we subscribe\n            Initialize();\n        }\n\n        /// <summary>\n        /// Moves the LiveAuxiliaryDataEnumerator to the next item\n        /// </summary>\n        public override bool MoveNext()\n        {\n            var currentDate = _timeProvider.GetUtcNow().ConvertFromUtc(Config.ExchangeTimeZone).Add(-Time.LiveAuxiliaryDataOffset).Date;\n            if (currentDate != _lastTime)\n            {\n                // when the date changes for the security we trigger a new tradable date event\n                var newDayEvent = new NewTradableDateEventArgs(currentDate, _securityCache.GetData(), Config.Symbol, null);\n\n                NewTradableDate(this, newDayEvent);\n                // update last time\n                _lastTime = currentDate;\n            }\n\n            return base.MoveNext();\n        }\n\n        /// <summary>\n        /// Helper method to create a new instance.\n        /// Knows which security types should create one and determines the appropriate delisting event provider to use\n        /// </summary>\n        public static bool TryCreate(SubscriptionDataConfig dataConfig, ITimeProvider timeProvider,\n            SecurityCache securityCache, IMapFileProvider mapFileProvider, IFactorFileProvider fileProvider, DateTime startTime,\n            out IEnumerator<BaseData> enumerator)\n        {\n            enumerator = null;\n            var securityType = dataConfig.SecurityType;\n            if (securityType.IsOption() || securityType == SecurityType.Future || securityType == SecurityType.Equity)\n            {\n                var providers = new List<ITradableDateEventProvider>\n                {\n                    securityType == SecurityType.Equity\n                        ? new LiveDelistingEventProvider()\n                        : new DelistingEventProvider()\n                };\n\n                if (dataConfig.TickerShouldBeMapped())\n                {\n                    providers.Add(new LiveMappingEventProvider());\n                }\n\n                if (dataConfig.EmitSplitsAndDividends())\n                {\n                    providers.Add(new LiveDividendEventProvider());\n                    providers.Add(new LiveSplitEventProvider());\n                }\n\n                enumerator = new LiveAuxiliaryDataEnumerator(dataConfig, fileProvider, mapFileProvider,\n                    providers.ToArray(), startTime, timeProvider, securityCache);\n            }\n            return enumerator != null;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveAuxiliaryDataSynchronizingEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Represents an enumerator capable of synchronizing live equity data enumerators in time.\n    /// This assumes that all enumerators have data time stamped in the same time zone.\n    /// </summary>\n    public class LiveAuxiliaryDataSynchronizingEnumerator : IEnumerator<BaseData>\n    {\n        private readonly ITimeProvider _timeProvider;\n        private readonly DateTimeZone _exchangeTimeZone;\n        private readonly List<IEnumerator<BaseData>> _auxDataEnumerators;\n        private readonly IEnumerator<BaseData> _tradeBarAggregator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LiveAuxiliaryDataSynchronizingEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"timeProvider\">The source of time used to gauge when this enumerator should emit extra bars when null data is returned from the source enumerator</param>\n        /// <param name=\"exchangeTimeZone\">The time zone the raw data is time stamped in</param>\n        /// <param name=\"tradeBarAggregator\">The trade bar aggregator enumerator</param>\n        /// <param name=\"auxDataEnumerators\">The auxiliary data enumerators</param>\n        public LiveAuxiliaryDataSynchronizingEnumerator(ITimeProvider timeProvider, DateTimeZone exchangeTimeZone, IEnumerator<BaseData> tradeBarAggregator, List<IEnumerator<BaseData>> auxDataEnumerators)\n        {\n            _timeProvider = timeProvider;\n            _exchangeTimeZone = exchangeTimeZone;\n            _auxDataEnumerators = auxDataEnumerators;\n            _tradeBarAggregator = tradeBarAggregator;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns> true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created.</exception>\n        public bool MoveNext()\n        {\n            // use manual time provider from LiveTradingDataFeed\n            var frontierUtc = _timeProvider.GetUtcNow();\n\n            // check if any enumerator is ready to emit\n            if (DataPointEmitted(frontierUtc))\n                return true;\n\n            // advance enumerators with no current data\n            for (var i = 0; i < _auxDataEnumerators.Count; i++)\n            {\n                if (_auxDataEnumerators[i].Current == null)\n                {\n                    _auxDataEnumerators[i].MoveNext();\n                }\n            }\n            if (_tradeBarAggregator.Current == null) _tradeBarAggregator.MoveNext();\n\n            // check if any enumerator is ready to emit\n            if (DataPointEmitted(frontierUtc))\n                return true;\n\n            Current = null;\n\n            // IEnumerator contract dictates that we return true unless we're actually\n            // finished with the 'collection' and since this is live, we're never finished\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created.</exception>\n        public void Reset()\n        {\n            foreach (var auxDataEnumerator in _auxDataEnumerators)\n            {\n                auxDataEnumerator.Reset();\n            }\n            _tradeBarAggregator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>The element in the collection at the current position of the enumerator.</returns>\n        public BaseData Current { get; private set; }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>The current element in the collection.</returns>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var auxDataEnumerator in _auxDataEnumerators)\n            {\n                auxDataEnumerator.DisposeSafely();\n            }\n            _tradeBarAggregator.DisposeSafely();\n        }\n\n        private bool DataPointEmitted(DateTime frontierUtc)\n        {\n            // we get the aux enumerator that has the smallest endTime if any\n            IEnumerator<BaseData> auxDataEnumerator = null;\n            for (var i = 0; i < _auxDataEnumerators.Count; i++)\n            {\n                var currentEnum = _auxDataEnumerators[i];\n                if (currentEnum.Current != null)\n                {\n                    if (auxDataEnumerator == null)\n                    {\n                        auxDataEnumerator = currentEnum;\n                    }\n                    else\n                    {\n                        auxDataEnumerator = auxDataEnumerator.Current.EndTime > currentEnum.Current.EndTime ? currentEnum : auxDataEnumerator;\n                    }\n                }\n            }\n\n            // check if any enumerator is ready to emit\n            if (auxDataEnumerator?.Current != null && _tradeBarAggregator.Current != null)\n            {\n                var auxDataEndTime = auxDataEnumerator.Current.EndTime.ConvertToUtc(_exchangeTimeZone);\n                var tradeBarEndTime = _tradeBarAggregator.Current.EndTime.ConvertToUtc(_exchangeTimeZone);\n                if (auxDataEndTime < tradeBarEndTime)\n                {\n                    if (auxDataEndTime <= frontierUtc)\n                    {\n                        Current = auxDataEnumerator.Current;\n                        auxDataEnumerator.MoveNext();\n                        return true;\n                    }\n                }\n                else\n                {\n                    if (tradeBarEndTime <= frontierUtc)\n                    {\n                        Current = _tradeBarAggregator.Current;\n                        _tradeBarAggregator.MoveNext();\n                        return true;\n                    }\n                }\n            }\n            else if (auxDataEnumerator?.Current != null)\n            {\n                var auxDataEndTime = auxDataEnumerator.Current.EndTime.ConvertToUtc(_exchangeTimeZone);\n                if (auxDataEndTime <= frontierUtc)\n                {\n                    Current = auxDataEnumerator.Current;\n                    auxDataEnumerator.MoveNext();\n                    return true;\n                }\n            }\n            else if (_tradeBarAggregator.Current != null)\n            {\n                var tradeBarEndTime = _tradeBarAggregator.Current.EndTime.ConvertToUtc(_exchangeTimeZone);\n                if (tradeBarEndTime <= frontierUtc)\n                {\n                    Current = _tradeBarAggregator.Current;\n                    _tradeBarAggregator.MoveNext();\n                    return true;\n                }\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveDelistingEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Delisting event provider implementation which will source the delisting date based on new map files\n    /// </summary>\n    public class LiveDelistingEventProvider : DelistingEventProvider\n    {\n        /// <summary>\n        /// Check for delistings\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New delisting event if any</returns>\n        public override IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            var currentInstance = MapFile;\n            // refresh map file instance\n            InitializeMapFile();\n            var newInstance = MapFile;\n\n            if (currentInstance?.LastOrDefault()?.Date != newInstance?.LastOrDefault()?.Date)\n            {\n                // All future and option contracts sharing the same canonical symbol, share the same configuration too. Thus, in\n                // order to reduce logs, we log the configuration using the canonical symbol. See the optional parameter\n                // \"overrideMessageFloodProtection\" in Log.Trace() method for more information\n                var symbol = Config.Symbol.HasCanonical() ? Config.Symbol.Canonical.Value : Config.Symbol.Value;\n                Log.Trace($\"LiveDelistingEventProvider({Config.ToString(symbol)}): new tradable date {eventArgs.Date:yyyyMMdd}. \" +\n                    $\"MapFile.LastDate Old: {currentInstance?.LastOrDefault()?.Date:yyyyMMdd} New: {newInstance?.LastOrDefault()?.Date:yyyyMMdd}\");\n            }\n\n            return base.GetEvents(eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"SymbolChangedEvent\"/> events\n    /// </summary>\n    /// <remarks>Only special behavior is that it will refresh factor file on each new tradable date event</remarks>\n    public class LiveDividendEventProvider : DividendEventProvider\n    {\n        /// <summary>\n        /// Check for dividends and returns them\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New Dividend event if any</returns>\n        public override IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            var currentInstance = FactorFile;\n            // refresh factor file instance\n            InitializeFactorFile();\n            var newInstance = FactorFile;\n\n            if (currentInstance?.Count() != newInstance?.Count())\n            {\n                // All future and option contracts sharing the same canonical symbol, share the same configuration too. Thus, in\n                // order to reduce logs, we log the configuration using the canonical symbol. See the optional parameter\n                // \"overrideMessageFloodProtection\" in Log.Trace() method for more information\n                var symbol = Config.Symbol.HasCanonical() ? Config.Symbol.Canonical.Value : Config.Symbol.Value;\n                Log.Trace($\"LiveDividendEventProvider({Config.ToString(symbol)}): new tradable date {eventArgs.Date:yyyyMMdd}. \" +\n                    $\"New FactorFile: {!ReferenceEquals(currentInstance, newInstance)}. \" +\n                    $\"FactorFile.Count Old: {currentInstance?.Count()} New: {newInstance?.Count()}\");\n            }\n\n            return base.GetEvents(eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveFillForwardEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// An implementation of the <see cref=\"FillForwardEnumerator\"/> that uses an <see cref=\"ITimeProvider\"/>\n    /// to determine if a fill forward bar needs to be emitted\n    /// </summary>\n    public class LiveFillForwardEnumerator : FillForwardEnumerator\n    {\n        private readonly TimeSpan _dataResolution;\n        private readonly TimeSpan _underlyingTimeout;\n        private readonly ITimeProvider _timeProvider;\n\n        private TimeSpan _marketCloseTimeSpan;\n        private TimeSpan _marketOpenTimeSpan;\n        private DateTime _lastDate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LiveFillForwardEnumerator\"/> class that accepts\n        /// a reference to the fill forward resolution, useful if the fill forward resolution is dynamic\n        /// and changing as the enumeration progresses\n        /// </summary>\n        /// <param name=\"timeProvider\">The source of time used to gauage when this enumerator should emit extra bars when\n        /// null data is returned from the source enumerator</param>\n        /// <param name=\"enumerator\">The source enumerator to be filled forward</param>\n        /// <param name=\"exchange\">The exchange used to determine when to insert fill forward data</param>\n        /// <param name=\"fillForwardResolution\">The resolution we'd like to receive data on</param>\n        /// <param name=\"isExtendedMarketHours\">True to use the exchange's extended market hours, false to use the regular market hours</param>\n        /// <param name=\"subscriptionStartTime\">The start time of the subscription</param>\n        /// <param name=\"subscriptionEndTime\">The end time of the subscription, once passing this date the enumerator will stop</param>\n        /// <param name=\"dataResolution\">The source enumerator's data resolution</param>\n        /// <param name=\"dataTimeZone\">Time zone of the underlying source data</param>\n        /// <param name=\"dailyStrictEndTimeEnabled\">True if daily strict end times are enabled</param>\n        /// <param name=\"dataType\">The configuration data type this enumerator is for</param>\n        /// <param name=\"lastPointTracker\">A reference to the last point emitted before this enumerator is first enumerated</param>\n        public LiveFillForwardEnumerator(ITimeProvider timeProvider, IEnumerator<BaseData> enumerator, SecurityExchange exchange, IReadOnlyRef<TimeSpan> fillForwardResolution,\n            bool isExtendedMarketHours, DateTime subscriptionStartTime, DateTime subscriptionEndTime, Resolution dataResolution, DateTimeZone dataTimeZone, bool dailyStrictEndTimeEnabled,\n            Type dataType = null, LastPointTracker lastPointTracker = null)\n            : base(enumerator, exchange, fillForwardResolution, isExtendedMarketHours, subscriptionStartTime, subscriptionEndTime, dataResolution.ToTimeSpan(), dataTimeZone,\n                  dailyStrictEndTimeEnabled, dataType, lastPointTracker)\n        {\n            _timeProvider = timeProvider;\n            _dataResolution = dataResolution.ToTimeSpan();\n            _underlyingTimeout = GetMaximumDataTimeout(dataResolution);\n        }\n\n        /// <summary>\n        /// Determines whether or not fill forward is required, and if true, will produce the new fill forward data\n        /// </summary>\n        /// <param name=\"fillForwardResolution\"></param>\n        /// <param name=\"previous\">The last piece of data emitted by this enumerator</param>\n        /// <param name=\"next\">The next piece of data on the source enumerator, this may be null</param>\n        /// <param name=\"fillForward\">When this function returns true, this will have a non-null value, null when the function returns false</param>\n        /// <returns>True when a new fill forward piece of data was produced and should be emitted by this enumerator</returns>\n        protected override bool RequiresFillForwardData(TimeSpan fillForwardResolution, BaseData previous, BaseData next, out BaseData fillForward)\n        {\n            if (base.RequiresFillForwardData(fillForwardResolution, previous, next, out fillForward))\n            {\n                var underlyingTimeout = TimeSpan.Zero;\n                if (fillForwardResolution >= _dataResolution && ShouldWaitForData(fillForward))\n                {\n                    // we enforce the underlying FF timeout when the FF resolution matches it or is bigger, not the other way round, for example:\n                    // this is a daily enumerator and FF resolution is second, we are expected to emit a bar every second, we can't wait until the timeout each time\n                    underlyingTimeout = _underlyingTimeout;\n                }\n\n                var nextEndTimeUtc = (fillForward.EndTime + underlyingTimeout).ConvertToUtc(Exchange.TimeZone);\n                if (next != null || nextEndTimeUtc <= _timeProvider.GetUtcNow())\n                {\n                    // we FF if next is here but in the future or next has not come yet and we've wait enough time\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Helper method to determine if we should wait for data before emitting a fill forward bar.\n        /// We only wait for data if the fill forward bar is either in the market open or close time.\n        /// </summary>\n        private bool ShouldWaitForData(BaseData fillForward)\n        {\n            if (fillForward.Symbol.SecurityType != SecurityType.Equity || Exchange.Hours.IsMarketAlwaysOpen)\n            {\n                return false;\n            }\n\n            // Update market open and close daily\n            if (_lastDate != fillForward.EndTime.Date ||\n                // Update market open and close for days with multiple sessions, e.g. early close and then late open\n                fillForward.Time.TimeOfDay > _marketCloseTimeSpan)\n            {\n                _lastDate = fillForward.EndTime.Date;\n                var marketOpen = Exchange.Hours.GetNextMarketOpen(_lastDate, false);\n                var marketClose = Exchange.Hours.GetNextMarketClose(_lastDate, false);\n\n                if (_dataResolution == Time.OneHour || (_dataResolution == Time.OneDay && !UseStrictEndTime))\n                {\n                    marketOpen = marketOpen.RoundDown(_dataResolution);\n                    marketClose = marketClose.RoundUp(_dataResolution);\n                }\n\n                _marketOpenTimeSpan = marketOpen.TimeOfDay;\n                _marketCloseTimeSpan = marketClose.TimeOfDay;\n            }\n\n            // we only wait for data if the fill forward bar is not in the market open or close time\n            return fillForward.Time.TimeOfDay == _marketOpenTimeSpan || fillForward.EndTime.TimeOfDay == _marketCloseTimeSpan;\n        }\n\n        /// <summary>\n        /// Helper method to know how much we should wait before fill forwarding a bar in live trading\n        /// </summary>\n        /// <remarks>This allows us to create bars taking into account the market auction close and open official prices. Also it will\n        /// allow data providers which might have some delay on creating the bars on their end, to be consumed correctly, when available, by Lean</remarks>\n        public static TimeSpan GetMaximumDataTimeout(Resolution resolution)\n        {\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                    return TimeSpan.Zero;\n                case Resolution.Second:\n                    return TimeSpan.FromSeconds(0.9);\n                case Resolution.Minute:\n                    return TimeSpan.FromMinutes(0.9);\n                case Resolution.Hour:\n                    return TimeSpan.FromMinutes(10);\n                case Resolution.Daily:\n                    return TimeSpan.FromMinutes(10);\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveMappingEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"SymbolChangedEvent\"/> events\n    /// </summary>\n    /// <remarks>Only special behavior is that it will refresh map file on each new tradable date event</remarks>\n    public class LiveMappingEventProvider : MappingEventProvider\n    {\n        /// <summary>\n        /// Check for new mappings\n        /// </summary>\n        public override IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            var currentInstance = MapFile;\n            // refresh map file instance\n            InitializeMapFile();\n            var newInstance = MapFile;\n\n            // All future and option contracts sharing the same canonical symbol, share the same configuration too. Thus, in\n            // order to reduce logs, we log the configuration using the canonical symbol. See the optional parameter\n            // \"overrideMessageFloodProtection\" in Log.Trace() method for more information\n            var symbol = Config.Symbol.HasCanonical() ? Config.Symbol.Canonical.Value : Config.Symbol.Value;\n            Log.Trace($\"LiveMappingEventProvider({Config.ToString(symbol)}): new tradable date {eventArgs.Date:yyyyMMdd}. \" +\n                $\"New MapFile: {!ReferenceEquals(currentInstance, newInstance)}. \" +\n                $\"MapFile.Count Old: {currentInstance?.Count()} New: {newInstance?.Count()}\");\n\n            return base.GetEvents(eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"SymbolChangedEvent\"/> events\n    /// </summary>\n    /// <remarks>Only special behavior is that it will refresh factor file on each new tradable date event</remarks>\n    public class LiveSplitEventProvider : SplitEventProvider\n    {\n        /// <summary>\n        /// Check for dividends and returns them\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New Dividend event if any</returns>\n        public override IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            var currentInstance = FactorFile;\n            // refresh factor file instance\n            InitializeFactorFile();\n            var newInstance = FactorFile;\n\n            if(currentInstance?.Count() != newInstance?.Count())\n            {\n                // All future and option contracts sharing the same canonical symbol, share the same configuration too. Thus, in\n                // order to reduce logs, we log the configuration using the canonical symbol. See the optional parameter\n                // \"overrideMessageFloodProtection\" in Log.Trace() method for more information\n                var symbol = Config.Symbol.HasCanonical() ? Config.Symbol.Canonical.Value : Config.Symbol.Value;\n                Log.Trace($\"LiveSplitEventProvider({Config.ToString(symbol)}): new tradable date {eventArgs.Date:yyyyMMdd}. \" +\n                    $\"New FactorFile: {!ReferenceEquals(currentInstance, newInstance)}. \" +\n                    $\"FactorFile.Count Old: {currentInstance?.Count()} New: {newInstance?.Count()}\");\n            }\n\n            return base.GetEvents(eventArgs);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/LiveSubscriptionEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing System.Collections;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Enumerator that will subscribe through the provided data queue handler and refresh the subscription if any mapping occurs\n    /// </summary>\n    public class LiveSubscriptionEnumerator : IEnumerator<BaseData>\n    {\n        private BaseData _current;\n        private readonly Symbol _requestedSymbol;\n        private SubscriptionDataConfig _currentConfig;\n        private IEnumerator<BaseData> _previousEnumerator;\n        private IEnumerator<BaseData> _underlyingEnumerator;\n\n        /// <summary>\n        /// The current data object instance\n        /// </summary>\n        public BaseData Current => _current;\n\n        /// <summary>\n        /// The current data object instance\n        /// </summary>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public LiveSubscriptionEnumerator(SubscriptionDataConfig dataConfig, IDataQueueHandler dataQueueHandler, EventHandler handler, Func<SubscriptionDataConfig, bool> isExpired)\n        {\n            _requestedSymbol = dataConfig.Symbol;\n            _underlyingEnumerator = dataQueueHandler.SubscribeWithMapping(dataConfig, handler, isExpired, out _currentConfig);\n\n            // for any mapping event we will re subscribe\n            dataConfig.NewSymbol += (_, _) =>\n            {\n                dataQueueHandler.Unsubscribe(_currentConfig);\n                _previousEnumerator = _underlyingEnumerator;\n\n                var oldSymbol = _currentConfig.Symbol;\n                _underlyingEnumerator = dataQueueHandler.SubscribeWithMapping(dataConfig, handler, isExpired, out _currentConfig);\n\n                Log.Trace($\"LiveSubscriptionEnumerator({_requestedSymbol}): \" +\n                    $\"resubscribing old: '{oldSymbol.Value}' new '{_currentConfig.Symbol.Value}'\");\n            };\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element.\n        /// </summary>\n        public bool MoveNext()\n        {\n            if (_previousEnumerator != null)\n            {\n                // if previous is set we dispose of it here since we are the consumers of it\n                _previousEnumerator.DisposeSafely();\n                _previousEnumerator = null;\n            }\n\n            var result = _underlyingEnumerator.MoveNext();\n            if (result)\n            {\n                _current = _underlyingEnumerator.Current;\n            }\n            else\n            {\n                _current = null;\n            }\n\n            if (_current != null && _current.Symbol != _requestedSymbol)\n            {\n                // if we've done some mapping at this layer let's clone the underlying and set the requested symbol,\n                // don't trust the IDQH implementations for data uniqueness, since the configuration could be shared\n                _current = _current.Clone();\n                _current.Symbol = _requestedSymbol;\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Reset the IEnumeration\n        /// </summary>\n        public void Reset()\n        {\n            _underlyingEnumerator.Reset();\n        }\n\n        /// <summary>\n        /// Disposes of the used enumerators\n        /// </summary>\n        public void Dispose()\n        {\n            _previousEnumerator.DisposeSafely();\n            _underlyingEnumerator.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/MappingEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"SymbolChangedEvent\"/> events\n    /// </summary>\n    public class MappingEventProvider : ITradableDateEventProvider\n    {\n        private IMapFileProvider _mapFileProvider;\n\n        /// <summary>\n        /// The associated configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; private set; }\n\n        /// <summary>\n        /// The current instance being used\n        /// </summary>\n        protected MapFile MapFile { get; private set; }\n\n        /// <summary>\n        /// Initializes this instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"Data.Auxiliary.MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        public virtual void Initialize(\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime)\n        {\n            _mapFileProvider = mapFileProvider;\n            Config = config;\n            InitializeMapFile();\n\n            if (MapFile.HasData(startTime.Date))\n            {\n                // initialize mapped symbol using request start date\n                Config.MappedSymbol = MapFile.GetMappedSymbol(startTime.Date, Config.MappedSymbol, Config.DataMappingMode);\n            }\n        }\n\n        /// <summary>\n        /// Check for new mappings\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New mapping event if any</returns>\n        public virtual IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            if (Config.Symbol == eventArgs.Symbol\n                && MapFile.HasData(eventArgs.Date))\n            {\n                var old = Config.MappedSymbol;\n                var newSymbol = MapFile.GetMappedSymbol(eventArgs.Date, Config.MappedSymbol, Config.DataMappingMode);\n                Config.MappedSymbol = newSymbol;\n\n                // check to see if the symbol was remapped\n                if (old != Config.MappedSymbol)\n                {\n                    var changed = new SymbolChangedEvent(\n                        Config.Symbol,\n                        eventArgs.Date,\n                        old,\n                        Config.MappedSymbol);\n                    yield return changed;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes the map file to use\n        /// </summary>\n        protected void InitializeMapFile()\n        {\n            MapFile = _mapFileProvider.ResolveMapFile(Config);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/NewDataAvailableEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event args for when a new data point is ready to be emitted\n    /// </summary>\n    public class NewDataAvailableEventArgs : EventArgs\n    {\n        /// <summary>\n        /// The new data point\n        /// </summary>\n        public IBaseData DataPoint { get; set; }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/PriceScaleFactorEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// This enumerator will update the <see cref=\"SubscriptionDataConfig.PriceScaleFactor\"/> when required\n    /// and adjust the raw <see cref=\"BaseData\"/> prices based on the provided <see cref=\"SubscriptionDataConfig\"/>.\n    /// Assumes the prices of the provided <see cref=\"IEnumerator\"/> are in raw mode.\n    /// </summary>\n    public class PriceScaleFactorEnumerator : IEnumerator<BaseData>\n    {\n        private readonly IEnumerator<BaseData> _rawDataEnumerator;\n        private readonly SubscriptionDataConfig _config;\n        private readonly IFactorFileProvider _factorFileProvider;\n        private DateTime _nextTradableDate;\n        private IFactorProvider _factorFile;\n        private bool _liveMode;\n        private DateTime? _endDate;\n\n        /// <summary>\n        /// Explicit interface implementation for <see cref=\"Current\"/>\n        /// </summary>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Last read <see cref=\"BaseData\"/> object from this type and source\n        /// </summary>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"PriceScaleFactorEnumerator\"/>.\n        /// </summary>\n        /// <param name=\"rawDataEnumerator\">The underlying raw data enumerator</param>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/> to enumerate for.\n        /// Will determine the <see cref=\"DataNormalizationMode\"/> to use.</param>\n        /// <param name=\"factorFileProvider\">The <see cref=\"IFactorFileProvider\"/> instance to use</param>\n        /// <param name=\"liveMode\">True, is this is a live mode data stream</param>\n        /// <param name=\"endDate\">The enumerator end date</param>\n        /// <remarks>\n        /// For <see cref=\"DataNormalizationMode.ScaledRaw\"/> normalization mode,\n        /// the prices are scaled to the prices on the <paramref name=\"endDate\"/>\n        /// </remarks>\n        public PriceScaleFactorEnumerator(\n            IEnumerator<BaseData> rawDataEnumerator,\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            bool liveMode = false,\n            DateTime? endDate = null)\n        {\n            _config = config;\n            _liveMode = liveMode;\n            _nextTradableDate = DateTime.MinValue;\n            _rawDataEnumerator = rawDataEnumerator;\n            _factorFileProvider = factorFileProvider;\n            _endDate = endDate;\n        }\n\n        /// <summary>\n        /// Dispose of the underlying enumerator.\n        /// </summary>\n        public void Dispose()\n        {\n            _rawDataEnumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// True if the enumerator was successfully advanced to the next element;\n        /// False if the enumerator has passed the end of the collection.\n        /// </returns>\n        public bool MoveNext()\n        {\n            var underlyingReturnValue = _rawDataEnumerator.MoveNext();\n            Current = _rawDataEnumerator.Current;\n\n            if (underlyingReturnValue\n                && Current != null\n                && _factorFileProvider != null\n                && _config.DataNormalizationMode != DataNormalizationMode.Raw)\n            {\n                var priceScaleFrontier = Current.GetUpdatePriceScaleFrontier();\n                if (priceScaleFrontier >= _nextTradableDate)\n                {\n                    _factorFile = _factorFileProvider.Get(_config.Symbol);\n                    _config.PriceScaleFactor = _factorFile.GetPriceScale(priceScaleFrontier.Date, _config.DataNormalizationMode, _config.ContractDepthOffset, _config.DataMappingMode, _endDate);\n\n                    // update factor files every day\n                    _nextTradableDate = priceScaleFrontier.Date.AddDays(1);\n                    if (_liveMode)\n                    {\n                        // in live trading we add a offset to make sure new factor files are available\n                        _nextTradableDate = _nextTradableDate.Add(Time.LiveAuxiliaryDataOffset);\n                    }\n                }\n\n                Current = Current.Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);\n            }\n\n            return underlyingReturnValue;\n        }\n\n        /// <summary>\n        /// Reset the IEnumeration\n        /// </summary>\n        /// <remarks>Not used</remarks>\n        public void Reset()\n        {\n            throw new NotImplementedException(\"Reset method not implemented. Assumes loop will only be used once.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/QuoteBarFillForwardEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// The QuoteBarFillForwardEnumerator wraps an existing base data enumerator\n    /// If the current QuoteBar has null Bid and/or Ask bars, it copies them from the previous QuoteBar\n    /// </summary>\n    public class QuoteBarFillForwardEnumerator : IEnumerator<BaseData>\n    {\n        private QuoteBar _previous;\n        private readonly IEnumerator<BaseData> _enumerator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FillForwardEnumerator\"/> class\n        /// </summary>\n        public QuoteBarFillForwardEnumerator(IEnumerator<BaseData> enumerator)\n        {\n            _enumerator = enumerator;\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception>\n        public bool MoveNext()\n        {\n            if (!_enumerator.MoveNext()) return false;\n\n            var bar = _enumerator.Current as QuoteBar;\n            if (bar != null)\n            {\n                if (_previous != null)\n                {\n                    if (bar.Bid == null)\n                    {\n                        bar.Bid = _previous.Bid;\n                    }\n\n                    if (bar.Ask == null)\n                    {\n                        bar.Ask = _previous.Ask;\n                    }\n                }\n\n                _previous = bar;\n            }\n\n            Current = _enumerator.Current;\n\n            return true;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/RateLimitEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides augmentation of how often an enumerator can be called. Time is measured using\n    /// an <see cref=\"ITimeProvider\"/> instance and calls to the underlying enumerator are limited\n    /// to a minimum time between each call.\n    /// </summary>\n    public class RateLimitEnumerator<T> : IEnumerator<T>\n    {\n        private T _current;\n        private DateTime _lastCallTime;\n\n        private readonly ITimeProvider _timeProvider;\n        private readonly IEnumerator<T> _enumerator;\n        private readonly TimeSpan _minimumTimeBetweenCalls;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RateLimitEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"enumerator\">The underlying enumerator to place rate limits on</param>\n        /// <param name=\"timeProvider\">Time provider used for determing the time between calls</param>\n        /// <param name=\"minimumTimeBetweenCalls\">The minimum time allowed between calls to the underlying enumerator</param>\n        public RateLimitEnumerator(IEnumerator<T> enumerator, ITimeProvider timeProvider, TimeSpan minimumTimeBetweenCalls)\n        {\n            _enumerator = enumerator;\n            _timeProvider = timeProvider;\n            _minimumTimeBetweenCalls = minimumTimeBetweenCalls;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            // determine time since last successful call, do this on units of the minimum time\n            // this will give us nice round emit times\n            var currentTime = _timeProvider.GetUtcNow().RoundDown(_minimumTimeBetweenCalls);\n            var timeBetweenCalls = currentTime - _lastCallTime;\n\n            // if within limits, patch it through to move next\n            if (timeBetweenCalls >= _minimumTimeBetweenCalls)\n            {\n                if (!_enumerator.MoveNext())\n                {\n                    // our underlying is finished\n                    _current = default(T);\n                    return false;\n                }\n\n                // only update last call time on non rate limited requests\n                _lastCallTime = currentTime;\n                _current = _enumerator.Current;\n            }\n            else\n            {\n                // we've been rate limitted\n                _current = default(T);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public T Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/RefreshEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Util;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IEnumerator{T}\"/> that will\n    /// always return true via MoveNext.\n    /// </summary>\n    /// <typeparam name=\"T\"></typeparam>\n    public class RefreshEnumerator<T> : IEnumerator<T>\n    {\n        private T _current;\n        private IEnumerator<T> _enumerator;\n        private readonly Func<IEnumerator<T>> _enumeratorFactory;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RefreshEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"enumeratorFactory\">Enumerator factory used to regenerate the underlying\n        /// enumerator when it ends</param>\n        public RefreshEnumerator(Func<IEnumerator<T>> enumeratorFactory)\n        {\n            _enumeratorFactory = enumeratorFactory;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            if (_enumerator == null)\n            {\n                _enumerator = _enumeratorFactory.Invoke();\n            }\n\n            var moveNext = false;\n            try\n            {\n                moveNext = _enumerator.MoveNext();\n                if (moveNext)\n                {\n                    _current = _enumerator.Current;\n                }\n            }\n            catch (IOException exception)\n            {\n                // we will ignore stale file handle exceptions and retry instead, enumerator will be refreshed\n                if (exception.Message == null || !exception.Message.Contains(\"Stale file handle\", StringComparison.InvariantCultureIgnoreCase))\n                {\n                    throw;\n                }\n            }\n\n            if (!moveNext)\n            {\n                _enumerator.DisposeSafely();\n\n                _enumerator = null;\n                _current = default(T);\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            if (_enumerator != null)\n            {\n                _enumerator.Reset();\n            }\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public T Current\n        {\n            get { return _current; }\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            if (_enumerator != null)\n            {\n                _enumerator.Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/ScannableEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IEnumerator{T}\"/> that relies on \"consolidated\" data\n    /// </summary>\n    /// <typeparam name=\"T\">The item type yielded by the enumerator</typeparam>\n    public class ScannableEnumerator<T> : IEnumerator<T> where T : class, IBaseData\n    {\n        private T _current;\n        private bool _consolidated;\n        private bool _isPeriodBase;\n        private bool _validateInputType;\n        private Type _consolidatorInputType;\n        private readonly DateTimeZone _timeZone;\n        private readonly ConcurrentQueue<T> _queue;\n        private readonly ITimeProvider _timeProvider;\n        private readonly EventHandler _newDataAvailableHandler;\n        private readonly IDataConsolidator _consolidator;\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public T Current => _current;\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ScannableEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"consolidator\">Consolidator taking BaseData updates and firing events containing new 'consolidated' data</param>\n        /// <param name=\"timeZone\">The time zone the raw data is time stamped in</param>\n        /// <param name=\"timeProvider\">The time provider instance used to determine when bars are completed and can be emitted</param>\n        /// <param name=\"newDataAvailableHandler\">The event handler for a new available data point</param>\n        /// <param name=\"isPeriodBased\">The consolidator is period based, this will enable scanning on <see cref=\"MoveNext\"/></param>\n        public ScannableEnumerator(IDataConsolidator consolidator, DateTimeZone timeZone, ITimeProvider timeProvider, EventHandler newDataAvailableHandler, bool isPeriodBased = true)\n        {\n            _timeZone = timeZone;\n            _timeProvider = timeProvider;\n            _consolidator = consolidator;\n            _isPeriodBase = isPeriodBased;\n            _queue = new ConcurrentQueue<T>();\n            _consolidatorInputType = consolidator.InputType;\n            _validateInputType = _consolidatorInputType != typeof(BaseData);\n            _newDataAvailableHandler = newDataAvailableHandler ?? ((s, e) => { });\n\n            _consolidator.DataConsolidated += DataConsolidatedHandler;\n        }\n\n        /// <summary>\n        /// Updates the consolidator\n        /// </summary>\n        /// <param name=\"data\">The data to consolidate</param>\n        public void Update(T data)\n        {\n            // if the input type of the consolidator isn't generic we validate it's correct before sending it in\n            if (_validateInputType && data.GetType() != _consolidatorInputType)\n            {\n                return;\n            }\n\n            if (_isPeriodBase)\n            {\n                // we only need to lock if it's period base since the move next call could trigger a scan\n                lock (_consolidator)\n                {\n                    _consolidator.Update(data);\n                }\n            }\n            else\n            {\n                _consolidator.Update(data);\n            }\n        }\n\n        /// <summary>\n        /// Enqueues the new data into this enumerator\n        /// </summary>\n        /// <param name=\"data\">The data to be enqueued</param>\n        private void Enqueue(T data)\n        {\n            _queue.Enqueue(data);\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            if (!_queue.TryDequeue(out _current) && _isPeriodBase)\n            {\n                _consolidated = false;\n                lock (_consolidator)\n                {\n                    // if there is a working bar we will try to pull it out if the time is right, each consolidator knows when it's right\n                    var localTime = _timeProvider.GetUtcNow().ConvertFromUtc(_timeZone);\n                    _consolidator.Scan(localTime);\n                }\n\n                if (_consolidated)\n                {\n                    _queue.TryDequeue(out _current);\n                }\n            }\n\n            // even if we don't have data to return, we haven't technically\n            // passed the end of the collection, so always return true until\n            // the enumerator is explicitly disposed or ended\n            return true;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _consolidator.DataConsolidated -= DataConsolidatedHandler;\n        }\n\n        private void DataConsolidatedHandler(object sender, IBaseData data)\n        {\n            var dataPoint = data as T;\n            _consolidated = true;\n            Enqueue(dataPoint);\n            _newDataAvailableHandler(sender, new NewDataAvailableEventArgs { DataPoint = dataPoint });\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/ScheduledEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// This enumerator will filter out data of the underlying enumerator based on a provided schedule.\n    /// Will respect the schedule above the data, meaning will let older data through if the underlying provides none for the schedule date\n    /// </summary>\n    public class ScheduledEnumerator : IEnumerator<BaseData>\n    {\n        private readonly IEnumerator<BaseData> _underlyingEnumerator;\n        private readonly IEnumerator<DateTime> _scheduledTimes;\n        private readonly ITimeProvider _frontierTimeProvider;\n        private readonly DateTimeZone _scheduleTimeZone;\n        private BaseData _underlyingCandidateDataPoint;\n        private bool _scheduledTimesEnded;\n\n        /// <summary>\n        /// The current data point\n        /// </summary>\n        public BaseData Current { get; private set; }\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"underlyingEnumerator\">The underlying enumerator to filter</param>\n        /// <param name=\"scheduledTimes\">The scheduled times to emit new data points</param>\n        /// <param name=\"frontierTimeProvider\"></param>\n        /// <param name=\"scheduleTimeZone\"></param>\n        /// <param name=\"startTime\">the underlying request start time</param>\n        public ScheduledEnumerator(IEnumerator<BaseData> underlyingEnumerator,\n            IEnumerable<DateTime> scheduledTimes,\n            ITimeProvider frontierTimeProvider,\n            DateTimeZone scheduleTimeZone,\n            DateTime startTime)\n        {\n            _scheduleTimeZone = scheduleTimeZone;\n            _frontierTimeProvider = frontierTimeProvider;\n            _underlyingEnumerator = underlyingEnumerator;\n            _scheduledTimes = scheduledTimes.GetEnumerator();\n            // move our schedule enumerator to current start time\n            MoveScheduleForward(startTime);\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns> True if the enumerator was successfully advanced to the next element;\n        /// false if the enumerator has passed the end of the collection.\n        /// </returns>\n        public bool MoveNext()\n        {\n            if (_scheduledTimesEnded)\n            {\n                Current = null;\n                return false;\n            }\n\n            // lets get our candidate data point to emit\n            if (_underlyingCandidateDataPoint == null)\n            {\n                if (_underlyingEnumerator.Current != null && _underlyingEnumerator.Current.EndTime <= _scheduledTimes.Current)\n                {\n                    _underlyingCandidateDataPoint = _underlyingEnumerator.Current;\n                }\n                else if (Current != null)\n                {\n                    // we will keep the last data point, even if we already emitted it, there could be a case where the user has a schedule in a\n                    // period where there's not new data (or it's far in the future) so let's just FF the previous point\n                    _underlyingCandidateDataPoint = Current.Clone(fillForward: true);\n                }\n            }\n\n            // lets try to get a better candidate\n            if (_underlyingEnumerator.Current == null\n                || _underlyingEnumerator.Current.EndTime < _scheduledTimes.Current)\n            {\n                bool pullAgain;\n                do\n                {\n                    pullAgain = false;\n                    if (!_underlyingEnumerator.MoveNext())\n                    {\n                        if (_underlyingCandidateDataPoint != null)\n                        {\n                            // if we still have a candidate wait till we emit him before stopping\n                            break;\n                        }\n                        Current = null;\n                        return false;\n                    }\n\n                    if (_underlyingEnumerator.Current != null)\n                    {\n                        if (_underlyingEnumerator.Current.EndTime <= _scheduledTimes.Current)\n                        {\n                            // lets try again\n                            pullAgain = true;\n                            // we got another data point which is a newer candidate to emit so let use it instead\n                            // and drop the previous\n                            _underlyingCandidateDataPoint = _underlyingEnumerator.Current;\n                        }\n                        else if (_underlyingCandidateDataPoint == null)\n                        {\n                            // this is the first data point we got and it's After our schedule, let's move our schedule forward\n                            _underlyingCandidateDataPoint = _underlyingEnumerator.Current;\n                            MoveScheduleForward();\n                        }\n                    }\n                } while (pullAgain);\n            }\n\n            if (_underlyingCandidateDataPoint != null\n            // if we are at or past the schedule time we try to emit, in backtest this emits right away, since time is data driven, in live though\n            // we don't emit right away because the underlying might provide us with a newer data point\n                && _scheduledTimes.Current.ConvertToUtc(_scheduleTimeZone) <= GetUtcNow())\n            {\n                Current = _underlyingCandidateDataPoint;\n                // we align the data endtime with the schedule, we respect the schedule above the data time. In backtesting,\n                // time is driven by the data, so let's make sure we emit at the scheduled time even if the data is older\n                Current.EndTime = _scheduledTimes.Current;\n                if (Current.Time > Current.EndTime)\n                {\n                    Current.Time = _scheduledTimes.Current;\n                }\n\n                MoveScheduleForward();\n                _underlyingCandidateDataPoint = null;\n                return true;\n            }\n\n            Current = null;\n            return true;\n        }\n\n        /// <summary>\n        /// Resets the underlying enumerator\n        /// </summary>\n        public void Reset()\n        {\n            _underlyingEnumerator.Reset();\n        }\n\n        /// <summary>\n        /// Disposes of the underlying enumerator\n        /// </summary>\n        public void Dispose()\n        {\n            _scheduledTimes.Dispose();\n            _underlyingEnumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Available in live trading only, in backtesting frontier is driven and sycned already by the data itself\n        /// so we can't hold data here based on it\n        /// </summary>\n        private DateTime GetUtcNow()\n        {\n            if (_frontierTimeProvider != null)\n            {\n                return _frontierTimeProvider.GetUtcNow();\n            }\n            return DateTime.MaxValue;\n        }\n\n        private void MoveScheduleForward(DateTime? frontier = null)\n        {\n            do\n            {\n                _scheduledTimesEnded = !_scheduledTimes.MoveNext();\n            }\n            while (!_scheduledTimesEnded && frontier.HasValue && _scheduledTimes.Current < frontier.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SortEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Provides an enumerator for sorting collections of <see cref=\"BaseData\"/> objects based on a specified property.\n    /// The sorting occurs lazily, only when enumeration begins.\n    /// </summary>\n    /// <typeparam name=\"TKey\">The type of the key used for sorting.</typeparam>\n    public sealed class SortEnumerator<TKey> : IEnumerator<BaseData>, IDisposable\n    {\n        private readonly IEnumerable<BaseData> _data;\n#pragma warning disable CA2213 // call csutom DisposeSafely() in Dispose()\n        private IEnumerator<BaseData> _sortedEnumerator;\n#pragma warning restore CA2213 // call csutom DisposeSafely() in Dispose()\n        private readonly Func<BaseData, TKey> _keySelector;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SortEnumerator{TKey}\"/> class.\n        /// </summary>\n        /// <param name=\"data\">The collection of <see cref=\"BaseData\"/> to enumerate over.</param>\n        /// <param name=\"keySelector\">A function that defines the key to sort by. Defaults to sorting by <see cref=\"BaseData.EndTime\"/>.</param>\n        public SortEnumerator(IEnumerable<BaseData> data, Func<BaseData, TKey> keySelector = null)\n        {\n            _data = data;\n            _sortedEnumerator = GetSortedData().GetEnumerator();\n            _keySelector = keySelector ??= baseData => (TKey)(object)baseData.EndTime;\n        }\n\n        /// <summary>\n        /// Static method to wrap an enumerable with the sort enumerator.\n        /// </summary>\n        /// <param name=\"preSorted\">Indicates if the data is pre-sorted.</param>\n        /// <param name=\"data\">The data to be wrapped into the enumerator.</param>\n        /// <returns>An enumerator over the <see cref=\"BaseData\"/>.</returns>\n        public static IEnumerator<BaseData> TryWrapSortEnumerator(bool preSorted, IEnumerable<BaseData> data)\n        {\n            return preSorted ? new SortEnumerator<TKey>(data) : data.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Lazily retrieves the sorted data.\n        /// </summary>\n        /// <returns>An enumerable collection of <see cref=\"BaseData\"/>.</returns>\n        private IEnumerable<BaseData> GetSortedData()\n        {\n            foreach (var item in _data.OrderBy(_keySelector))\n            {\n                yield return item;\n            }\n        }\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Gets the current <see cref=\"BaseData\"/> element in the collection.\n        /// </summary>\n        public BaseData Current\n        {\n            get => _sortedEnumerator.Current;\n        }\n\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// <c>true</c> if the enumerator was successfully advanced to the next element; \n        /// <c>false</c> if the enumerator has passed the end of the collection.\n        /// </returns>\n        public bool MoveNext()\n        {\n            return _sortedEnumerator.MoveNext();\n        }\n\n        /// <summary>\n        /// Resets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        public void Reset()\n        {\n            _sortedEnumerator = null;\n        }\n\n        /// <summary>\n        /// Releases all resources used by the <see cref=\"SortEnumerator{TKey}\"/> and suppresses finalization.\n        /// </summary>\n        public void Dispose()\n        {\n            _sortedEnumerator?.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SplitEventProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Event provider who will emit <see cref=\"Split\"/> events\n    /// </summary>\n    public class SplitEventProvider : ITradableDateEventProvider\n    {\n        // we set the split factor when we encounter a split in the factor file\n        // and on the next trading day we use this data to produce the split instance\n        private decimal? _splitFactor;\n        private decimal _referencePrice;\n        private IFactorFileProvider _factorFileProvider;\n        private MapFile _mapFile;\n\n        /// <summary>\n        /// The current instance being used\n        /// </summary>\n        protected CorporateFactorProvider FactorFile { get; private set; }\n\n        /// <summary>\n        /// The associated configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; private set; }\n\n        /// <summary>\n        /// Initializes this instance\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"factorFileProvider\">The factor file provider to use</param>\n        /// <param name=\"mapFileProvider\">The <see cref=\"Data.Auxiliary.MapFile\"/> provider to use</param>\n        /// <param name=\"startTime\">Start date for the data request</param>\n        public void Initialize(\n            SubscriptionDataConfig config,\n            IFactorFileProvider factorFileProvider,\n            IMapFileProvider mapFileProvider,\n            DateTime startTime)\n        {\n            Config = config;\n            _factorFileProvider = factorFileProvider;\n            _mapFile = mapFileProvider.ResolveMapFile(Config);\n            InitializeFactorFile();\n        }\n\n        /// <summary>\n        /// Check for new splits\n        /// </summary>\n        /// <param name=\"eventArgs\">The new tradable day event arguments</param>\n        /// <returns>New split event if any</returns>\n        public virtual IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            if (Config.Symbol == eventArgs.Symbol\n                && FactorFile != null\n                && _mapFile.HasData(eventArgs.Date))\n            {\n                var factor = _splitFactor;\n                if (factor != null)\n                {\n                    var close = _referencePrice;\n                    if (close == 0)\n                    {\n                        throw new InvalidOperationException($\"Zero reference price for {Config.Symbol} split at {eventArgs.Date}\");\n                    }\n\n                    _splitFactor = null;\n                    _referencePrice = 0;\n                    yield return new Split(\n                        eventArgs.Symbol,\n                        eventArgs.Date,\n                        close,\n                        factor.Value,\n                        SplitType.SplitOccurred);\n                }\n\n                decimal splitFactor;\n                decimal referencePrice;\n                if (FactorFile.HasSplitEventOnNextTradingDay(eventArgs.Date, out splitFactor, out referencePrice))\n                {\n                    _splitFactor = splitFactor;\n                    _referencePrice = referencePrice;\n                    yield return new Split(\n                        eventArgs.Symbol,\n                        eventArgs.Date,\n                        eventArgs.LastRawPrice ?? 0,\n                        splitFactor,\n                        SplitType.Warning);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes the factor file to use\n        /// </summary>\n        protected void InitializeFactorFile()\n        {\n            FactorFile = _factorFileProvider.Get(Config.Symbol) as CorporateFactorProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/StrictDailyEndTimesEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing System.Collections;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Enumerator that will handle adjusting daily strict end times if appropriate\n    /// </summary>\n    public class StrictDailyEndTimesEnumerator : IEnumerator<BaseData>\n    {\n        private readonly DateTime _localStartTime;\n        private readonly SecurityExchangeHours _securityExchange;\n        private readonly IEnumerator<BaseData> _underlying;\n\n        /// <summary>\n        /// Current value of the enumerator\n        /// </summary>\n        public BaseData Current { get; private set; }\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public StrictDailyEndTimesEnumerator(IEnumerator<BaseData> underlying, SecurityExchangeHours securityExchangeHours, DateTime localStartTime)\n        {\n            _underlying = underlying;\n            _localStartTime = localStartTime;\n            _securityExchange = securityExchangeHours;\n        }\n\n        /// <summary>\n        /// Move to the next date\n        /// </summary>\n        public bool MoveNext()\n        {\n            Current = null;\n            bool result;\n            do\n            {\n                result = _underlying.MoveNext();\n                if (!result || !LeanData.UseDailyStrictEndTimes(_underlying.Current?.GetType()))\n                {\n                    break;\n                }\n\n                // before setting the strict daily end times, let's clone it because underlying enumerator (SubscriptionDataReader) might be using it\n                var pontentialNewBar = _underlying.Current.Clone();\n                if (LeanData.SetStrictEndTimes(pontentialNewBar, _securityExchange) && pontentialNewBar.EndTime >= _localStartTime)\n                {\n                    Current = pontentialNewBar;\n                    break;\n                }\n            }\n            while (true);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Reset the enumerator\n        /// </summary>\n        public void Reset()\n        {\n            _underlying.Reset();\n        }\n\n        /// <summary>\n        /// Dispose the enumerator\n        /// </summary>\n        public void Dispose()\n        {\n            _underlying.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SubscriptionDataEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// An <see cref=\"IEnumerator{SubscriptionData}\"/> which wraps an existing <see cref=\"IEnumerator{BaseData}\"/>.\n    /// </summary>\n    /// <remarks>Using this class is important, versus directly yielding, because we setup the <see cref=\"Dispose\"/> chain</remarks>\n    public class SubscriptionDataEnumerator : IEnumerator<SubscriptionData>\n    {\n        private readonly IEnumerator<BaseData> _enumerator;\n        private readonly SubscriptionDataConfig _configuration;\n        private readonly SecurityExchangeHours _exchangeHours;\n        private readonly TimeZoneOffsetProvider _offsetProvider;\n        private readonly bool _isUniverse;\n        private readonly bool _dailyStrictEndTimeEnabled;\n\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        public SubscriptionData Current { get; private set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"configuration\">The subscription's configuration</param>\n        /// <param name=\"exchangeHours\">The security's exchange hours</param>\n        /// <param name=\"offsetProvider\">The subscription's time zone offset provider</param>\n        /// <param name=\"enumerator\">The underlying data enumerator</param>\n        /// <param name=\"isUniverse\">The subscription is a universe subscription</param>\n        /// <returns>A subscription data enumerator</returns>\n        public SubscriptionDataEnumerator(SubscriptionDataConfig configuration,\n            SecurityExchangeHours exchangeHours,\n            TimeZoneOffsetProvider offsetProvider,\n            IEnumerator<BaseData> enumerator,\n            bool isUniverse,\n            bool dailyStrictEndTimeEnabled)\n        {\n            _enumerator = enumerator;\n            _offsetProvider = offsetProvider;\n            _exchangeHours = exchangeHours;\n            _configuration = configuration;\n            _isUniverse = isUniverse;\n            _dailyStrictEndTimeEnabled = dailyStrictEndTimeEnabled;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>True if the enumerator was successfully advanced to the next element;\n        /// False if the enumerator has passed the end of the collection.</returns>\n        public bool MoveNext()\n        {\n            var result = _enumerator.MoveNext();\n            if (result)\n            {\n                // Use our config filter to see if we should emit this\n                // This currently catches Auxiliary data that we don't want to emit\n                if (_enumerator.Current != null && !_configuration.ShouldEmitData(_enumerator.Current, _isUniverse))\n                {\n                    // We shouldn't emit this data, so we will MoveNext() again.\n                    return MoveNext();\n                }\n\n                Current = SubscriptionData.Create(_dailyStrictEndTimeEnabled, _configuration, _exchangeHours, _offsetProvider, _enumerator.Current, _configuration.DataNormalizationMode);\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SubscriptionFilterEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Implements a wrapper around a base data enumerator to provide a final filtering step\n    /// </summary>\n    public class SubscriptionFilterEnumerator : IEnumerator<BaseData>\n    {\n        /// <summary>\n        /// Fired when there's an error executing a user's data filter\n        /// </summary>\n        public event EventHandler<Exception> DataFilterError;\n\n        private readonly bool _liveMode;\n        private readonly Security _security;\n        private readonly DateTime _endTime;\n        private readonly bool _extendedMarketHours;\n        private readonly SecurityExchangeHours _exchangeHours;\n        private readonly ISecurityDataFilter _dataFilter;\n        private readonly IEnumerator<BaseData> _enumerator;\n\n        /// <summary>\n        /// Convenience method to wrap the enumerator and attach the data filter event to log and alery users of errors\n        /// </summary>\n        /// <param name=\"resultHandler\">Result handler reference used to send errors</param>\n        /// <param name=\"enumerator\">The source enumerator to be wrapped</param>\n        /// <param name=\"security\">The security who's data is being enumerated</param>\n        /// <param name=\"endTime\">The end time of the subscription</param>\n        /// <param name=\"extendedMarketHours\">True if extended market hours are enabled</param>\n        /// <param name=\"liveMode\">True if live mode</param>\n        /// <param name=\"securityExchangeHours\">The security exchange hours instance to use</param>\n        /// <returns>A new instance of the <see cref=\"SubscriptionFilterEnumerator\"/> class that has had it's <see cref=\"DataFilterError\"/>\n        /// event subscribed to to send errors to the result handler</returns>\n        public static SubscriptionFilterEnumerator WrapForDataFeed(IResultHandler resultHandler, IEnumerator<BaseData> enumerator, Security security, DateTime endTime, bool extendedMarketHours, bool liveMode,\n            SecurityExchangeHours securityExchangeHours)\n        {\n            var filter = new SubscriptionFilterEnumerator(enumerator, security, endTime, extendedMarketHours, liveMode, securityExchangeHours);\n            filter.DataFilterError += (sender, exception) =>\n            {\n                Log.Error(exception, \"WrapForDataFeed\");\n                resultHandler.RuntimeError(\"Runtime error applying data filter. Assuming filter pass: \" + exception.Message, exception.StackTrace);\n            };\n            return filter;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionFilterEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerator\">The source enumerator to be wrapped</param>\n        /// <param name=\"security\">The security containing an exchange and data filter</param>\n        /// <param name=\"endTime\">The end time of the subscription</param>\n        /// <param name=\"extendedMarketHours\">True if extended market hours are enabled</param>\n        /// <param name=\"liveMode\">True if live mode</param>\n        /// <param name=\"securityExchangeHours\">The security exchange hours instance to use</param>\n        public SubscriptionFilterEnumerator(IEnumerator<BaseData> enumerator, Security security, DateTime endTime, bool extendedMarketHours, bool liveMode, SecurityExchangeHours securityExchangeHours)\n        {\n            _liveMode = liveMode;\n            _enumerator = enumerator;\n            _security = security;\n            _endTime = endTime;\n            _exchangeHours = securityExchangeHours;\n            _dataFilter = _security.DataFilter;\n            _extendedMarketHours = extendedMarketHours;\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            while (_enumerator.MoveNext())\n            {\n                var current = _enumerator.Current;\n                if (current != null)\n                {\n                    try\n                    {\n                        // execute user data filters\n                        if (current.DataType != MarketDataType.Auxiliary && !_dataFilter.Filter(_security, current))\n                        {\n                            continue;\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        OnDataFilterError(err);\n                        continue;\n                    }\n\n                    // verify that the bar is within the exchange's market hours\n                    if (current.DataType != MarketDataType.Auxiliary && !_exchangeHours.IsOpen(current.Time, current.EndTime, _extendedMarketHours))\n                    {\n                        if (_liveMode && !current.IsFillForward)\n                        {\n                            // TODO: replace for setting security.RealTimePrice not to modify security cache data directly\n                            _security.SetMarketPrice(current);\n                        }\n                        continue;\n                    }\n\n                    // make sure we haven't passed the end\n                    if (current.Time > _endTime)\n                    {\n                        return false;\n                    }\n                }\n\n                Current = current;\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            _enumerator.Dispose();\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Event invocated for the <see cref=\"DataFilterError\"/> event\n        /// </summary>\n        /// <param name=\"exception\">The exception that was thrown when trying to perform data filtering</param>\n        private void OnDataFilterError(Exception exception)\n        {\n            var handler = DataFilterError;\n            if (handler != null) handler(this, exception);\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SynchronizingBaseDataEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Represents an enumerator capable of synchronizing other base data enumerators in time.\n    /// This assumes that all enumerators have data time stamped in the same time zone\n    /// </summary>\n    public class SynchronizingBaseDataEnumerator : SynchronizingEnumerator<BaseData>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingBaseDataEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        public SynchronizingBaseDataEnumerator(params IEnumerator<BaseData>[] enumerators)\n            : this((IEnumerable<IEnumerator>)enumerators)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingBaseDataEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        public SynchronizingBaseDataEnumerator(IEnumerable<IEnumerator> enumerators) : base((IEnumerable<IEnumerator<BaseData>>)enumerators)\n        {\n        }\n\n        /// <summary>\n        /// Gets the Timestamp for the data\n        /// </summary>\n        protected override DateTime GetInstanceTime(BaseData instance)\n        {\n            return instance.EndTime;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Represents an enumerator capable of synchronizing other enumerators of type T in time.\n    /// This assumes that all enumerators have data time stamped in the same time zone\n    /// </summary>\n    public abstract class SynchronizingEnumerator<T> : IEnumerator<T>\n    {\n        private IEnumerator<T> _syncer;\n        private readonly IEnumerator<T>[] _enumerators;\n\n        /// <summary>\n        /// Gets the Timestamp for the data\n        /// </summary>\n        protected abstract DateTime GetInstanceTime(T instance);\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public T Current\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        /// <remark>The type of data we want, for example, <see cref=\"BaseData\"/> or <see cref=\"Slice\"/>, ect...</remark>\n        protected SynchronizingEnumerator(params IEnumerator<T>[] enumerators)\n            : this ((IEnumerable<IEnumerator<T>>)enumerators)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingEnumerator{T}\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        /// <remark>The type of data we want, for example, <see cref=\"BaseData\"/> or <see cref=\"Slice\"/>, ect...</remark>\n        protected SynchronizingEnumerator(IEnumerable<IEnumerator<T>> enumerators)\n        {\n            _enumerators = enumerators.ToArray();\n            _syncer = GetSynchronizedEnumerator(_enumerators);\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception>\n        public bool MoveNext()\n        {\n            var moveNext =  _syncer.MoveNext();\n            Current = moveNext ? _syncer.Current : default(T);\n            return moveNext;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception>\n        public void Reset()\n        {\n            foreach (var enumerator in _enumerators)\n            {\n                enumerator.Reset();\n            }\n            // don't call syncer.reset since the impl will just throw\n            _syncer = GetSynchronizedEnumerator(_enumerators);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var enumerator in _enumerators)\n            {\n                enumerator.Dispose();\n            }\n            _syncer.Dispose();\n        }\n\n        /// <summary>\n        /// Synchronization system for the enumerator:\n        /// </summary>\n        /// <param name=\"enumerators\"></param>\n        /// <returns></returns>\n        private IEnumerator<T> GetSynchronizedEnumerator(IEnumerator<T>[] enumerators)\n        {\n            return GetBruteForceMethod(enumerators);\n        }\n\n        /// <summary>\n        /// Brute force implementation for synchronizing the enumerator.\n        /// Will remove enumerators returning false to the call to MoveNext.\n        /// Will not remove enumerators with Current Null returning true to the call to MoveNext\n        /// </summary>\n        private IEnumerator<T> GetBruteForceMethod(IEnumerator<T>[] enumerators)\n        {\n            var ticks = DateTime.MaxValue.Ticks;\n            var collection = new HashSet<IEnumerator<T>>();\n            foreach (var enumerator in enumerators)\n            {\n                if (enumerator.MoveNext())\n                {\n                    if (enumerator.Current != null)\n                    {\n                        ticks = Math.Min(ticks, GetInstanceTime(enumerator.Current).Ticks);\n                    }\n                    collection.Add(enumerator);\n                }\n                else\n                {\n                    enumerator.Dispose();\n                }\n            }\n\n            var frontier = new DateTime(ticks);\n            var toRemove = new List<IEnumerator<T>>();\n            while (collection.Count > 0)\n            {\n                var nextFrontierTicks = DateTime.MaxValue.Ticks;\n                foreach (var enumerator in collection)\n                {\n                    while (enumerator.Current == null || GetInstanceTime(enumerator.Current) <= frontier)\n                    {\n                        if (enumerator.Current != null)\n                        {\n                            yield return enumerator.Current;\n                        }\n                        if (!enumerator.MoveNext())\n                        {\n                            toRemove.Add(enumerator);\n                            break;\n                        }\n                        if (enumerator.Current == null)\n                        {\n                            break;\n                        }\n                    }\n\n                    if (enumerator.Current != null)\n                    {\n                        nextFrontierTicks = Math.Min(nextFrontierTicks, GetInstanceTime(enumerator.Current).Ticks);\n                    }\n                }\n\n                if (toRemove.Count > 0)\n                {\n                    foreach (var enumerator in toRemove)\n                    {\n                        collection.Remove(enumerator);\n                    }\n                    toRemove.Clear();\n                }\n\n                frontier = new DateTime(nextFrontierTicks);\n                if (frontier == DateTime.MaxValue)\n                {\n                    break;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Enumerators/SynchronizingSliceEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Enumerators\n{\n    /// <summary>\n    /// Represents an enumerator capable of synchronizing other slice enumerators in time.\n    /// This assumes that all enumerators have data time stamped in the same time zone\n    /// </summary>\n    public class SynchronizingSliceEnumerator : SynchronizingEnumerator<Slice>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingSliceEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        public SynchronizingSliceEnumerator(params IEnumerator<Slice>[] enumerators)\n            : this((IEnumerable<IEnumerator>)enumerators)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SynchronizingSliceEnumerator\"/> class\n        /// </summary>\n        /// <param name=\"enumerators\">The enumerators to be synchronized. NOTE: Assumes the same time zone for all data</param>\n        public SynchronizingSliceEnumerator(IEnumerable<IEnumerator> enumerators) : base((IEnumerable<IEnumerator<Slice>>)enumerators)\n        {\n        }\n\n        /// <summary>\n        /// Gets the Timestamp for the data\n        /// </summary>\n        protected override DateTime GetInstanceTime(Slice instance)\n        {\n            return instance.UtcTime;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/FileSystemDataFeed.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Historical datafeed stream reader for processing files on a local disk.\n    /// </summary>\n    /// <remarks>Filesystem datafeeds are incredibly fast</remarks>\n    public class FileSystemDataFeed : IDataFeed\n    {\n        private IAlgorithm _algorithm;\n        private ITimeProvider _timeProvider;\n        private IResultHandler _resultHandler;\n        private IMapFileProvider _mapFileProvider;\n        private IFactorFileProvider _factorFileProvider;\n        private IDataProvider _dataProvider;\n        private IDataCacheProvider _cacheProvider;\n        private SubscriptionCollection _subscriptions;\n        private MarketHoursDatabase _marketHoursDatabase;\n        private SubscriptionDataReaderSubscriptionEnumeratorFactory _subscriptionFactory;\n\n        /// <summary>\n        /// Flag indicating the hander thread is completely finished and ready to dispose.\n        /// </summary>\n        public bool IsActive { get; private set; }\n\n        /// <summary>\n        /// Initializes the data feed for the specified job and algorithm\n        /// </summary>\n        public virtual void Initialize(IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider)\n        {\n            _algorithm = algorithm;\n            _resultHandler = resultHandler;\n            _mapFileProvider = mapFileProvider;\n            _factorFileProvider = factorFileProvider;\n            _dataProvider = dataProvider;\n            _timeProvider = dataFeedTimeProvider.FrontierTimeProvider;\n            _subscriptions = subscriptionManager.DataFeedSubscriptions;\n            _cacheProvider = new ZipDataCacheProvider(dataProvider, isDataEphemeral: false);\n            _subscriptionFactory = new SubscriptionDataReaderSubscriptionEnumeratorFactory(\n                _resultHandler,\n                _mapFileProvider,\n                _factorFileProvider,\n                _cacheProvider,\n                algorithm,\n                enablePriceScaling: false);\n\n            IsActive = true;\n            _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n        }\n\n        /// <summary>\n        /// Creates a file based data enumerator for the given subscription request\n        /// </summary>\n        /// <remarks>Protected so it can be used by the <see cref=\"LiveTradingDataFeed\"/> to warmup requests</remarks>\n        protected IEnumerator<BaseData> CreateEnumerator(SubscriptionRequest request, Resolution? fillForwardResolution = null,\n            LastPointTracker lastPointTracker = null, bool isWarmUp = false)\n        {\n            return request.IsUniverseSubscription ? CreateUniverseEnumerator(request) : CreateDataEnumerator(request, fillForwardResolution, lastPointTracker, isWarmUp);\n        }\n\n        private IEnumerator<BaseData> CreateDataEnumerator(SubscriptionRequest request, Resolution? fillForwardResolution, LastPointTracker lastPointTracker, bool isWarmUp)\n        {\n            // ReSharper disable once PossibleMultipleEnumeration\n            var enumerator = _subscriptionFactory.CreateEnumerator(request, _dataProvider);\n            enumerator = ConfigureEnumerator(request, false, enumerator, fillForwardResolution, lastPointTracker, isWarmUp);\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Creates a new subscription to provide data for the specified security.\n        /// </summary>\n        /// <param name=\"request\">Defines the subscription to be added, including start/end times the universe and security</param>\n        /// <returns>The created <see cref=\"Subscription\"/> if successful, null otherwise</returns>\n        public virtual Subscription CreateSubscription(SubscriptionRequest request)\n        {\n            IEnumerator<BaseData> enumerator;\n            if(_algorithm.IsWarmingUp)\n            {\n                var pivotTimeUtc = _algorithm.StartDate.ConvertToUtc(_algorithm.TimeZone);\n\n                var lastPointTracker = new LastPointTracker();\n\n                var warmupRequest = new SubscriptionRequest(request, endTimeUtc: pivotTimeUtc,\n                    configuration: new SubscriptionDataConfig(request.Configuration, resolution: _algorithm.Settings.WarmupResolution));\n                IEnumerator<BaseData> warmupEnumerator = null;\n                if (warmupRequest.TradableDaysInDataTimeZone.Any()\n                    // since we change the resolution, let's validate it's still valid configuration (example daily equity quotes are not!)\n                    && LeanData.IsValidConfiguration(warmupRequest.Configuration.SecurityType, warmupRequest.Configuration.Resolution, warmupRequest.Configuration.TickType))\n                {\n                    // let them overlap a day if possible to avoid data gaps since each request will FFed it's own since they are different resolutions\n                    pivotTimeUtc = Time.GetStartTimeForTradeBars(request.Security.Exchange.Hours,\n                        _algorithm.StartDate.ConvertTo(_algorithm.TimeZone, request.Security.Exchange.TimeZone),\n                        Time.OneDay,\n                        1,\n                        false,\n                        warmupRequest.Configuration.DataTimeZone,\n                        LeanData.UseDailyStrictEndTimes(_algorithm.Settings, request, request.Security.Symbol, Time.OneDay))\n                        .ConvertToUtc(request.Security.Exchange.TimeZone);\n                    if (pivotTimeUtc < warmupRequest.StartTimeUtc)\n                    {\n                        pivotTimeUtc = warmupRequest.StartTimeUtc;\n                    }\n\n                    warmupEnumerator = CreateEnumerator(warmupRequest, _algorithm.Settings.WarmupResolution, lastPointTracker, true);\n                    // don't let future data past\n                    warmupEnumerator = new FilterEnumerator<BaseData>(warmupEnumerator, data => data == null || data.EndTime <= warmupRequest.EndTimeLocal);\n                }\n\n                var normalEnumerator = CreateEnumerator(new SubscriptionRequest(request, startTimeUtc: pivotTimeUtc), lastPointTracker: lastPointTracker);\n                // don't let pre start data pass, since we adjust start so they overlap 1 day let's not let this data pass, we just want it for fill forwarding after the target start\n                // this is also useful to drop any initial selection point which was already emitted during warmup\n                normalEnumerator = new FilterEnumerator<BaseData>(normalEnumerator, data => data == null || data.EndTime >= warmupRequest.EndTimeLocal);\n\n                // after the warmup enumerator we concatenate the 'normal' one\n                enumerator = new ConcatEnumerator(true, warmupEnumerator, normalEnumerator);\n            }\n            else\n            {\n                enumerator = CreateEnumerator(request);\n            }\n\n            enumerator = AddScheduleWrapper(request, enumerator, null);\n\n            return SubscriptionUtils.CreateAndScheduleWorker(request, enumerator, _factorFileProvider, true, _algorithm.Settings.DailyPreciseEndTime);\n        }\n\n        /// <summary>\n        /// Removes the subscription from the data feed, if it exists\n        /// </summary>\n        /// <param name=\"subscription\">The subscription to remove</param>\n        public virtual void RemoveSubscription(Subscription subscription)\n        {\n        }\n\n        /// <summary>\n        /// Creates a universe enumerator from the Subscription request, the underlying enumerator func and the fill forward resolution (in some cases)\n        /// </summary>\n        protected IEnumerator<BaseData> CreateUniverseEnumerator(SubscriptionRequest request)\n        {\n            ISubscriptionEnumeratorFactory factory = _subscriptionFactory;\n            if (request.Universe is ITimeTriggeredUniverse)\n            {\n                factory = new TimeTriggeredUniverseSubscriptionEnumeratorFactory(request.Universe as ITimeTriggeredUniverse, _marketHoursDatabase);\n            }\n            else if (request.Configuration.Type == typeof(FundamentalUniverse))\n            {\n                factory = new BaseDataCollectionSubscriptionEnumeratorFactory(_algorithm.ObjectStore);\n            }\n\n            // define our data enumerator\n            var enumerator = factory.CreateEnumerator(request, _dataProvider);\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Returns a scheduled enumerator from the given arguments. It can also return the given underlying enumerator\n        /// </summary>\n        protected IEnumerator<BaseData> AddScheduleWrapper(SubscriptionRequest request, IEnumerator<BaseData> underlying, ITimeProvider timeProvider)\n        {\n            if (!request.IsUniverseSubscription || !request.Universe.UniverseSettings.Schedule.Initialized)\n            {\n                return underlying;\n            }\n\n            var schedule = request.Universe.UniverseSettings.Schedule.Get(request.StartTimeLocal, request.EndTimeLocal);\n            if (schedule != null)\n            {\n                return new ScheduledEnumerator(underlying, schedule, timeProvider, request.Configuration.ExchangeTimeZone, request.StartTimeLocal);\n            }\n            return underlying;\n        }\n\n        /// <summary>\n        /// Send an exit signal to the thread.\n        /// </summary>\n        public virtual void Exit()\n        {\n            if (IsActive)\n            {\n                IsActive = false;\n                Log.Trace(\"FileSystemDataFeed.Exit(): Start. Setting cancellation token...\");\n                _subscriptionFactory?.DisposeSafely();\n                _cacheProvider.DisposeSafely();\n                Log.Trace(\"FileSystemDataFeed.Exit(): Exit Finished.\");\n            }\n        }\n\n        /// <summary>\n        /// Configure the enumerator with aggregation/fill-forward/filter behaviors. Returns new instance if re-configured\n        /// </summary>\n        protected IEnumerator<BaseData> ConfigureEnumerator(SubscriptionRequest request, bool aggregate, IEnumerator<BaseData> enumerator, Resolution? fillForwardResolution, LastPointTracker lastPointTracker, bool isWarmUpEnumerator = false)\n        {\n            if (aggregate)\n            {\n                enumerator = new BaseDataCollectionAggregatorEnumerator(enumerator, request.Configuration.Symbol);\n            }\n\n            enumerator = TryAddFillForwardEnumerator(request, enumerator, request.Configuration.FillDataForward, fillForwardResolution, lastPointTracker);\n\n            // optionally apply exchange/user filters\n            if (request.Configuration.IsFilteredSubscription)\n            {\n                enumerator = SubscriptionFilterEnumerator.WrapForDataFeed(_resultHandler, enumerator, request.Security,\n                    request.EndTimeLocal, request.Configuration.ExtendedMarketHours, false, request.ExchangeHours);\n            }\n\n            enumerator = ConfigureLastPointTracker(enumerator, lastPointTracker, isWarmUpEnumerator);\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Configures the enumerator to track the last data point, if requested, and if this is a warmup enumerator\n        /// </summary>\n        protected IEnumerator<BaseData> ConfigureLastPointTracker(IEnumerator<BaseData> enumerator, LastPointTracker lastPointTracker, bool isWarmUpEnumerator)\n        {\n            if (lastPointTracker != null && isWarmUpEnumerator)\n            {\n                enumerator = new FilterEnumerator<BaseData>(enumerator,\n                    data =>\n                    {\n                        lastPointTracker.LastDataPoint = data;\n                        return true;\n                    });\n            }\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Will add a fill forward enumerator if requested\n        /// </summary>\n        protected IEnumerator<BaseData> TryAddFillForwardEnumerator(SubscriptionRequest request, IEnumerator<BaseData> enumerator, bool fillForward, Resolution? fillForwardResolution, LastPointTracker lastPointTracker = null)\n        {\n            // optionally apply fill forward logic, but never for tick data\n            if (fillForward && request.Configuration.Resolution != Resolution.Tick)\n            {\n                // copy forward Bid/Ask bars for QuoteBars\n                if (request.Configuration.Type == typeof(QuoteBar))\n                {\n                    enumerator = new QuoteBarFillForwardEnumerator(enumerator);\n                }\n\n                var fillForwardSpan = _subscriptions.UpdateAndGetFillForwardResolution(request.Configuration);\n                if (fillForwardResolution != null && fillForwardResolution != Resolution.Tick)\n                {\n                    // if we are giving a FFspan we use it instead of the collection based one. This is useful during warmup when the warmup resolution has been set\n                    fillForwardSpan = Ref.Create(fillForwardResolution.Value.ToTimeSpan());\n                }\n\n                // Pass the security exchange hours explicitly to avoid using the ones in the request, since\n                // those could be different. e.g. when requests are created for open interest data the exchange\n                // hours are set to always open to avoid OI data being filtered out due to the exchange being closed.\n                // This way we allow OI data to be fill-forwarded to the market close time when strict end times is enabled,\n                // so that OI data is available at the same time as trades and quotes.\n                var useDailyStrictEndTimes = LeanData.UseDailyStrictEndTimes(_algorithm.Settings, request, request.Configuration.Symbol,\n                    request.Configuration.Increment, request.Security.Exchange.Hours);\n                enumerator = new FillForwardEnumerator(enumerator, request.Security.Exchange, fillForwardSpan,\n                    request.Configuration.ExtendedMarketHours, request.StartTimeLocal, request.EndTimeLocal, request.Configuration.Increment,\n                    request.Configuration.DataTimeZone, useDailyStrictEndTimes, request.Configuration.Type, lastPointTracker);\n            }\n\n            return enumerator;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/FillForwardResolutionChangedEvent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Helper class for fill forward resolution change events\n    /// </summary>\n    public class FillForwardResolutionChangedEvent\n    {\n        /// <summary>\n        /// The old fill forward time span\n        /// </summary>\n        public TimeSpan Old { get; set; }\n\n        /// <summary>\n        /// The new fill forward time span\n        /// </summary>\n        public TimeSpan New { get; set; }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/IDataFeed.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Datafeed interface for creating custom datafeed sources.\n    /// </summary>\n    [InheritedExport(typeof(IDataFeed))]\n    public interface IDataFeed\n    {\n        /// <summary>\n        /// Public flag indicator that the thread is still busy.\n        /// </summary>\n        bool IsActive\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Initializes the data feed for the specified job and algorithm\n        /// </summary>\n        void Initialize(IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider);\n\n        /// <summary>\n        /// Creates a new subscription to provide data for the specified security.\n        /// </summary>\n        /// <param name=\"request\">Defines the subscription to be added, including start/end times the universe and security</param>\n        /// <returns>The created <see cref=\"Subscription\"/> if successful, null otherwise</returns>\n        Subscription CreateSubscription(SubscriptionRequest request);\n\n        /// <summary>\n        /// Removes the subscription from the data feed, if it exists\n        /// </summary>\n        /// <param name=\"subscription\">The subscription to remove</param>\n        void RemoveSubscription(Subscription subscription);\n\n        /// <summary>\n        /// External controller calls to signal a terminate of the thread.\n        /// </summary>\n        void Exit();\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/IDataFeedSubscriptionManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// DataFeedSubscriptionManager interface will manage the subscriptions for the Data Feed\n    /// </summary>\n    public interface IDataFeedSubscriptionManager\n    {\n        /// <summary>\n        /// Event fired when a new subscription is added\n        /// </summary>\n        event EventHandler<Subscription> SubscriptionAdded;\n\n        /// <summary>\n        /// Event fired when an existing subscription is removed\n        /// </summary>\n        event EventHandler<Subscription> SubscriptionRemoved;\n\n        /// <summary>\n        /// Gets the data feed subscription collection\n        /// </summary>\n        SubscriptionCollection DataFeedSubscriptions { get; }\n\n        /// <summary>\n        /// Get the universe selection instance\n        /// </summary>\n        UniverseSelection UniverseSelection { get; }\n\n        /// <summary>\n        /// Removes the <see cref=\"Subscription\"/>, if it exists\n        /// </summary>\n        /// <param name=\"configuration\">The <see cref=\"SubscriptionDataConfig\"/> of the subscription to remove</param>\n        /// <param name=\"universe\">Universe requesting to remove <see cref=\"Subscription\"/>.\n        /// Default value, null, will remove all universes</param>\n        /// <returns>True if the subscription was successfully removed, false otherwise</returns>\n        bool RemoveSubscription(SubscriptionDataConfig configuration, Universe universe = null);\n\n        /// <summary>\n        /// Adds a new <see cref=\"Subscription\"/> to provide data for the specified security.\n        /// </summary>\n        /// <param name=\"request\">Defines the <see cref=\"SubscriptionRequest\"/> to be added</param>\n        /// <returns>True if the subscription was created and added successfully, false otherwise</returns>\n        bool AddSubscription(SubscriptionRequest request);\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/IDataFeedTimeProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Reduced interface which exposes required <see cref=\"ITimeProvider\"/> for <see cref=\"IDataFeed\"/> implementations\n    /// </summary>\n    public interface IDataFeedTimeProvider\n    {\n        /// <summary>\n        /// Continuous UTC time provider\n        /// </summary>\n        ITimeProvider TimeProvider { get; }\n\n        /// <summary>\n        /// Time provider which returns current UTC frontier time\n        /// </summary>\n        ITimeProvider FrontierTimeProvider { get; }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/IDataManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// IDataManager is the engines view of the Data Manager.\n    /// </summary>\n    public interface IDataManager\n    {\n        /// <summary>\n        /// Get the universe selection instance\n        /// </summary>\n        UniverseSelection UniverseSelection { get; }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ISubscriptionDataSourceReader.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Represents a type responsible for accepting an input <see cref=\"SubscriptionDataSource\"/>\n    /// and returning an enumerable of the source's <see cref=\"BaseData\"/>\n    /// </summary>\n    public interface ISubscriptionDataSourceReader\n    {\n        /// <summary>\n        /// Event fired when the specified source is considered invalid, this may\n        /// be from a missing file or failure to download a remote source\n        /// </summary>\n        event EventHandler<InvalidSourceEventArgs> InvalidSource;\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        IEnumerable<BaseData> Read(SubscriptionDataSource source);\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/ISubscriptionSynchronizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides the ability to synchronize subscriptions into time slices\n    /// </summary>\n    public interface ISubscriptionSynchronizer\n    {\n        /// <summary>\n        /// Event fired when a subscription is finished\n        /// </summary>\n        event EventHandler<Subscription> SubscriptionFinished;\n\n        /// <summary>\n        /// Syncs the specified subscriptions. The frontier time used for synchronization is\n        /// managed internally and dependent upon previous synchronization operations.\n        /// </summary>\n        /// <param name=\"subscriptions\">The subscriptions to sync</param>\n        /// <param name=\"cancellationToken\">The cancellation token to stop enumeration</param>\n        IEnumerable<TimeSlice> Sync(IEnumerable<Subscription> subscriptions, CancellationToken cancellationToken);\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/ISynchronizer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Interface which provides the data to stream to the algorithm\n    /// </summary>\n    public interface ISynchronizer\n    {\n        /// <summary>\n        /// Returns an enumerable which provides the data to stream to the algorithm\n        /// </summary>\n        IEnumerable<TimeSlice> StreamData(CancellationToken cancellationToken);\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/IndexSubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// This <see cref=\"ISubscriptionDataSourceReader\"/> implementation supports\n    /// the <see cref=\"FileFormat.Index\"/> and <see cref=\"IndexedBaseData\"/> types.\n    /// Handles the layer of indirection for the index data source and forwards\n    /// the target source to the corresponding <see cref=\"ISubscriptionDataSourceReader\"/>\n    /// </summary>\n    public class IndexSubscriptionDataSourceReader : BaseSubscriptionDataSourceReader\n    {\n        private readonly SubscriptionDataConfig _config;\n        private readonly DateTime _date;\n        private IDataProvider _dataProvider;\n        private readonly IndexedBaseData _factory;\n\n        /// <summary>\n        /// Creates a new instance of this <see cref=\"ISubscriptionDataSourceReader\"/>\n        /// </summary>\n        public IndexSubscriptionDataSourceReader(IDataCacheProvider dataCacheProvider,\n            SubscriptionDataConfig config,\n            DateTime date,\n            bool isLiveMode,\n            IDataProvider dataProvider,\n            IObjectStore objectStore)\n        : base(dataCacheProvider, isLiveMode, objectStore)\n        {\n            _config = config;\n            _date = date;\n            _dataProvider = dataProvider;\n            _factory = config.Type.GetBaseDataInstance() as IndexedBaseData;\n            if (_factory == null)\n            {\n                throw new ArgumentException($\"{nameof(IndexSubscriptionDataSourceReader)} should be used\" +\n                                            $\"with a data type which implements {nameof(IndexedBaseData)}\");\n            }\n        }\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public override IEnumerable<BaseData> Read(SubscriptionDataSource source)\n        {\n            // handles zip or text files\n            using (var reader = CreateStreamReader(source))\n            {\n                // if the reader doesn't have data then we're done with this subscription\n                if (reader == null || reader.EndOfStream)\n                {\n                    OnInvalidSource(source, new Exception($\"The reader was empty for source: ${source.Source}\"));\n                    yield break;\n                }\n\n                // while the reader has data\n                while (!reader.EndOfStream)\n                {\n                    // read a line and pass it to the base data factory\n                    var line = reader.ReadLine();\n                    if (line.IsNullOrEmpty())\n                    {\n                        continue;\n                    }\n\n                    SubscriptionDataSource dataSource;\n                    try\n                    {\n                        dataSource = _factory.GetSourceForAnIndex(_config, _date, line, IsLiveMode);\n                    }\n                    catch\n                    {\n                        OnInvalidSource(source, new Exception(\"Factory.GetSourceForAnIndex() failed to return a valid source\"));\n                        yield break;\n                    }\n\n                    if (dataSource != null)\n                    {\n                        var dataReader = SubscriptionDataSourceReader.ForSource(\n                            dataSource,\n                            DataCacheProvider,\n                            _config,\n                            _date,\n                            IsLiveMode,\n                            _factory,\n                            _dataProvider,\n                            ObjectStore);\n\n                        var enumerator = dataReader.Read(dataSource).GetEnumerator();\n                        while (enumerator.MoveNext())\n                        {\n                            yield return enumerator.Current;\n                        }\n                        enumerator.DisposeSafely();\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/InternalSubscriptionManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Class in charge of handling Leans internal subscriptions\n    /// </summary>\n    public class InternalSubscriptionManager\n    {\n        private readonly Dictionary<Symbol, List<SubscriptionRequest>> _subscriptionRequests;\n        private readonly Resolution _resolution;\n        private readonly IAlgorithm _algorithm;\n\n        /// <summary>\n        /// Event fired when a new internal subscription request is to be added\n        /// </summary>\n        public EventHandler<SubscriptionRequest> Added { get; set; }\n\n        /// <summary>\n        /// Event fired when an existing internal subscription should be removed\n        /// </summary>\n        public EventHandler<SubscriptionRequest> Removed { get; set; }\n\n        /// <summary>\n        /// Creates a new instances\n        /// </summary>\n        /// <param name=\"algorithm\">The associated algorithm</param>\n        /// <param name=\"resolution\">The resolution to use for the internal subscriptions</param>\n        public InternalSubscriptionManager(IAlgorithm algorithm, Resolution resolution)\n        {\n            _algorithm = algorithm;\n            _resolution = resolution;\n            _subscriptionRequests = new Dictionary<Symbol, List<SubscriptionRequest>>();\n        }\n\n        /// <summary>\n        /// Notifies about a removed subscription request\n        /// </summary>\n        /// <param name=\"request\">The removed subscription request</param>\n        public void AddedSubscriptionRequest(SubscriptionRequest request)\n        {\n            if (PreFilter(request))\n            {\n                var lowResolution = request.Configuration.Resolution > Resolution.Minute;\n                List<SubscriptionRequest> internalRequests;\n                var existing = _subscriptionRequests.TryGetValue(request.Configuration.Symbol, out internalRequests);\n                var alreadyInternal = existing && internalRequests.Any(internalRequest => internalRequest.Configuration.Type == request.Configuration.Type\n                    && request.Configuration.TickType == internalRequest.Configuration.TickType);\n\n                if (lowResolution && !alreadyInternal)\n                {\n                    // low resolution subscriptions we will add internal Resolution.Minute subscriptions\n                    // if we don't already have this symbol added\n                    var config = new SubscriptionDataConfig(request.Configuration, resolution: _resolution, isInternalFeed: true, extendedHours: true, isFilteredSubscription: false);\n                    var startTimeUtc = request.StartTimeUtc;\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        // during warmup in live trading do not add these internal subscription until the algorithm starts\n                        // these subscription are only added for realtime price in low resolution subscriptions which isn't required for warmup\n                        startTimeUtc = DateTime.UtcNow;\n                    }\n                    var internalRequest = new SubscriptionRequest(false, null, request.Security, config, startTimeUtc, request.EndTimeUtc);\n                    if (existing)\n                    {\n                        _subscriptionRequests[request.Configuration.Symbol].Add(internalRequest);\n                    }\n                    else\n                    {\n                        _subscriptionRequests[request.Configuration.Symbol] = new List<SubscriptionRequest>{ internalRequest };\n                    }\n                    Added?.Invoke(this, internalRequest);\n                }\n                else if (!lowResolution && alreadyInternal)\n                {\n                    _subscriptionRequests.Remove(request.Configuration.Symbol);\n                    // the user added a higher resolution configuration, we can remove the internal we added\n                    foreach (var subscriptionRequest in internalRequests)\n                    {\n                        Removed?.Invoke(this, subscriptionRequest);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Notifies about an added subscription request\n        /// </summary>\n        /// <param name=\"request\">The added subscription request</param>\n        public void RemovedSubscriptionRequest(SubscriptionRequest request)\n        {\n            if (PreFilter(request) && _subscriptionRequests.ContainsKey(request.Configuration.Symbol))\n            {\n                var userConfigs = _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(request.Configuration.Symbol).ToList();\n\n                if (userConfigs.Count == 0 || userConfigs.Any(config => config.Resolution <= Resolution.Minute))\n                {\n                    var requests = _subscriptionRequests[request.Configuration.Symbol];\n                    _subscriptionRequests.Remove(request.Configuration.Symbol);\n                    // if we had a config and the user no longer has a config for this symbol we remove the internal subscription\n                    foreach (var subscriptionRequest in requests)\n                    {\n                        Removed?.Invoke(this, subscriptionRequest);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// True for for live trading, non internal, non universe subscriptions, non custom data subscriptions\n        /// </summary>\n        private bool PreFilter(SubscriptionRequest request)\n        {\n            return _algorithm.LiveMode && !request.Configuration.IsInternalFeed && !request.IsUniverseSubscription && !request.Configuration.IsCustomData;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/InvalidSourceEventArgs.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"ISubscriptionDataSourceReader.InvalidSource\"/> event\n    /// </summary>\n    public sealed class InvalidSourceEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the source that was considered invalid\n        /// </summary>\n        public SubscriptionDataSource Source\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the exception that was encountered\n        /// </summary>\n        public Exception Exception\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InvalidSourceEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"source\">The source that was considered invalid</param>\n        /// <param name=\"exception\">The exception that was encountered</param>\n        public InvalidSourceEventArgs(SubscriptionDataSource source, Exception exception)\n        {\n            Source = source;\n            Exception = exception;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/LiveFutureChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IFutureChainProvider\"/> that fetches the list of contracts\n    /// from an external source\n    /// </summary>\n    public class LiveFutureChainProvider : BacktestingFutureChainProvider\n    {\n        /// <summary>\n        /// Gets the list of future contracts for a given underlying symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"date\">The date for which to request the future chain (only used in backtesting)</param>\n        /// <returns>The list of future contracts</returns>\n        public override IEnumerable<Symbol> GetFutureContractList(Symbol symbol, DateTime date)\n        {\n            var result = Enumerable.Empty<Symbol>();\n            try\n            {\n                result = base.GetFutureContractList(symbol, date);\n            }\n            catch (Exception ex)\n            {\n                // this shouldn't happen but just in case let's log it\n                Log.Error(ex);\n            }\n\n            bool yielded = false;\n            foreach (var symbols in result)\n            {\n                yielded = true;\n                yield return symbols;\n            }\n\n            if (!yielded)\n            {\n                throw new NotImplementedException(\"LiveFutureChainProvider.GetFutureContractList() has not been implemented yet.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/LiveOptionChainProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Net;\nusing System.Linq;\nusing System.Net.Http;\nusing Newtonsoft.Json;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\nusing QuantConnect.Securities.FutureOption.Api;\nusing System.Net.Http.Headers;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// An implementation of <see cref=\"IOptionChainProvider\"/> that fetches the list of contracts\n    /// from the Options Clearing Corporation (OCC) website\n    /// </summary>\n    public class LiveOptionChainProvider : BacktestingOptionChainProvider\n    {\n        private static readonly HttpClient _client;\n        private static readonly DateTime _epoch = new DateTime(1970, 1, 1);\n\n        private static RateGate _cmeRateGate;\n\n        private const string CMESymbolReplace = \"{{SYMBOL}}\";\n        private const string CMEProductCodeReplace = \"{{PRODUCT_CODE}}\";\n        private const string CMEProductExpirationReplace = \"{{PRODUCT_EXPIRATION}}\";\n\n        private const string CMEProductSlateURL = \"https://www.cmegroup.com/CmeWS/mvc/ProductSlate/V2/List?pageNumber=1&sortAsc=false&sortField=rank&searchString=\" + CMESymbolReplace + \"&pageSize=5\";\n        private const string CMEOptionsTradeDateAndExpirations = \"https://www.cmegroup.com/CmeWS/mvc/Settlements/Options/TradeDateAndExpirations/\" + CMEProductCodeReplace;\n        private const string CMEOptionChainQuotesURL = \"https://www.cmegroup.com/CmeWS/mvc/Quotes/Option/\" + CMEProductCodeReplace + \"/G/\" + CMEProductExpirationReplace + \"/ALL?_=\";\n\n        private const int MaxDownloadAttempts = 5;\n\n        /// <summary>\n        /// Static constructor for the <see cref=\"LiveOptionChainProvider\"/> class\n        /// </summary>\n        static LiveOptionChainProvider()\n        {\n            // The OCC website now requires at least TLS 1.1 for API requests.\n            // NET 4.5.2 and below does not enable these more secure protocols by default, so we add them in here\n            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;\n\n            _client = new HttpClient(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate });\n            _client.DefaultRequestHeaders.Connection.Add(\"keep-alive\");\n            _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(\"*/*\", 0.8));\n            _client.DefaultRequestHeaders.UserAgent.ParseAdd(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0\");\n            _client.DefaultRequestHeaders.AcceptLanguage.Add(new StringWithQualityHeaderValue(\"en-US\", 0.5));\n        }\n\n        /// <summary>\n        /// Gets the option chain associated with the underlying Symbol\n        /// </summary>\n        /// <param name=\"symbol\">The option or the underlying symbol to get the option chain for.\n        /// Providing the option allows targetting an option ticker different than the default e.g. SPXW</param>\n        /// <param name=\"date\">The date to ask for the option contract list for</param>\n        /// <returns>Option chain</returns>\n        /// <exception cref=\"ArgumentException\">Option underlying Symbol is not Future or Equity</exception>\n        public override IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date)\n        {\n            HashSet<Symbol> result = null;\n            try\n            {\n                result = base.GetOptionContractList(symbol, date).ToHashSet();\n            }\n            catch (Exception ex)\n            {\n                result = new();\n                // this shouldn't happen but just in case let's log it\n                Log.Error(ex);\n            }\n\n            // during warmup we rely on the backtesting provider, but as we get closer to current time let's join the data with our live chain sources\n            if (date.Date >= DateTime.UtcNow.Date.AddDays(-5) || result.Count == 0)\n            {\n                var underlyingSymbol = symbol;\n                if (symbol.SecurityType.IsOption())\n                {\n                    // we were given the option\n                    underlyingSymbol = symbol.Underlying;\n                }\n\n                if (underlyingSymbol.SecurityType == SecurityType.Equity || underlyingSymbol.SecurityType == SecurityType.Index)\n                {\n                    var expectedOptionTicker = underlyingSymbol.Value;\n                    if (underlyingSymbol.SecurityType == SecurityType.Index)\n                    {\n                        expectedOptionTicker = symbol.ID.Symbol;\n                    }\n\n                    // Source data from TheOCC if we're trading equity or index options\n                    foreach (var optionSymbol in GetEquityIndexOptionContractList(underlyingSymbol, expectedOptionTicker).Where(symbol => !IsContractExpired(symbol, date)))\n                    {\n                        result.Add(optionSymbol);\n                    }\n                }\n                else if (underlyingSymbol.SecurityType == SecurityType.Future)\n                {\n                    // We get our data from CME if we're trading future options\n                    foreach (var optionSymbol in GetFutureOptionContractList(underlyingSymbol, date).Where(symbol => !IsContractExpired(symbol, date)))\n                    {\n                        result.Add(optionSymbol);\n                    }\n                }\n                else\n                {\n                    throw new ArgumentException(\"Option Underlying SecurityType is not supported. Supported types are: Equity, Index, Future\");\n                }\n            }\n\n            foreach (var optionSymbol in result)\n            {\n                yield return optionSymbol;\n            }\n        }\n\n        private IEnumerable<Symbol> GetFutureOptionContractList(Symbol futureContractSymbol, DateTime date)\n        {\n            var symbols = new List<Symbol>();\n            var retries = 0;\n            var maxRetries = 5;\n\n            // rate gate will start a timer in the background, so let's avoid it we if don't need it\n            _cmeRateGate ??= new RateGate(1, TimeSpan.FromSeconds(0.5));\n\n            while (++retries <= maxRetries)\n            {\n                try\n                {\n                    _cmeRateGate.WaitToProceed();\n\n                    var productResponse = _client.GetAsync(CMEProductSlateURL.Replace(CMESymbolReplace, futureContractSymbol.ID.Symbol))\n                        .SynchronouslyAwaitTaskResult();\n\n                    productResponse.EnsureSuccessStatusCode();\n\n                    var productResults = JsonConvert.DeserializeObject<CMEProductSlateV2ListResponse>(productResponse.Content\n                        .ReadAsStringAsync()\n                        .SynchronouslyAwaitTaskResult());\n\n                    productResponse.Dispose();\n\n                    // We want to gather the future product to get the future options ID\n                    var futureProductId = productResults.Products.Where(p => p.Globex == futureContractSymbol.ID.Symbol && p.GlobexTraded && p.Cleared == \"Futures\")\n                        .Select(p => p.Id)\n                        .Single();\n\n\n                    var optionsTradesAndExpiries = CMEOptionsTradeDateAndExpirations.Replace(CMEProductCodeReplace, futureProductId.ToStringInvariant());\n\n                    _cmeRateGate.WaitToProceed();\n\n                    var optionsTradesAndExpiriesResponse = _client.GetAsync(optionsTradesAndExpiries).SynchronouslyAwaitTaskResult();\n                    optionsTradesAndExpiriesResponse.EnsureSuccessStatusCode();\n\n                    var tradesAndExpiriesResponse = JsonConvert.DeserializeObject<List<CMEOptionsTradeDatesAndExpiration>>(optionsTradesAndExpiriesResponse.Content\n                        .ReadAsStringAsync()\n                        .SynchronouslyAwaitTaskResult());\n\n                    optionsTradesAndExpiriesResponse.Dispose();\n\n                    // For now, only support American options on CME\n                    var selectedOption = tradesAndExpiriesResponse\n                        .FirstOrDefault(x => !x.Daily && !x.Weekly && !x.Sto && x.OptionType == \"AME\");\n\n                    if (selectedOption == null)\n                    {\n                        Log.Error($\"LiveOptionChainProvider.GetFutureOptionContractList(): Found no matching future options for contract {futureContractSymbol}\");\n                        yield break;\n                    }\n\n                    // Gather the month code and the year's last number to query the next API, which expects an expiration as `<MONTH_CODE><YEAR_LAST_NUMBER>`\n                    var expiryFunction = FuturesExpiryFunctions.FuturesExpiryFunction(futureContractSymbol.Canonical);\n\n                    var futureContractExpiration = selectedOption.Expirations\n                        .Select(x => new KeyValuePair<CMEOptionsExpiration, DateTime>(x, expiryFunction(new DateTime(x.Expiration.Year, x.Expiration.Month, 1))))\n                        .FirstOrDefault(x => x.Value.Year == futureContractSymbol.ID.Date.Year && x.Value.Month == futureContractSymbol.ID.Date.Month)\n                        .Key;\n\n                    if (futureContractExpiration == null)\n                    {\n                        Log.Error($\"LiveOptionChainProvider.GetFutureOptionContractList(): Found no future options with matching expiry year and month for contract {futureContractSymbol}\");\n                        yield break;\n                    }\n\n                    var futureContractMonthCode = futureContractExpiration.Expiration.Code;\n\n                    _cmeRateGate.WaitToProceed();\n\n                    // Subtract one day from now for settlement API since settlement may not be available for today yet\n                    var optionChainQuotesResponseResult = _client.GetAsync(CMEOptionChainQuotesURL\n                        .Replace(CMEProductCodeReplace, selectedOption.ProductId.ToStringInvariant())\n                        .Replace(CMEProductExpirationReplace, futureContractMonthCode)\n                        + Math.Floor((DateTime.UtcNow - _epoch).TotalMilliseconds).ToStringInvariant());\n\n                    optionChainQuotesResponseResult.Result.EnsureSuccessStatusCode();\n\n                    var futureOptionChain = JsonConvert.DeserializeObject<CMEOptionChainQuotes>(optionChainQuotesResponseResult.Result.Content\n                        .ReadAsStringAsync()\n                        .SynchronouslyAwaitTaskResult())\n                        .Quotes\n                        .DistinctBy(s => s.StrikePrice)\n                        .ToList();\n\n                    optionChainQuotesResponseResult.Dispose();\n\n                    // Each CME contract can have arbitrary scaling applied to the strike price, so we normalize it to the\n                    // underlying's price via static entries.\n                    var optionStrikePriceScaleFactor = CMEStrikePriceScalingFactors.GetScaleFactor(futureContractSymbol);\n                    var canonicalOption = Symbol.CreateOption(\n                        futureContractSymbol,\n                        futureContractSymbol.ID.Market,\n                        futureContractSymbol.SecurityType.DefaultOptionStyle(),\n                        default(OptionRight),\n                        default(decimal),\n                        SecurityIdentifier.DefaultDate);\n\n                    foreach (var optionChainEntry in futureOptionChain)\n                    {\n                        var futureOptionExpiry = FuturesOptionsExpiryFunctions.GetFutureOptionExpiryFromFutureExpiry(futureContractSymbol, canonicalOption);\n                        var scaledStrikePrice = optionChainEntry.StrikePrice / optionStrikePriceScaleFactor;\n\n                        // Calls and puts share the same strike, create two symbols per each to avoid iterating twice.\n                        symbols.Add(Symbol.CreateOption(\n                            futureContractSymbol,\n                            futureContractSymbol.ID.Market,\n                            OptionStyle.American,\n                            OptionRight.Call,\n                            scaledStrikePrice,\n                            futureOptionExpiry));\n\n                        symbols.Add(Symbol.CreateOption(\n                            futureContractSymbol,\n                            futureContractSymbol.ID.Market,\n                            OptionStyle.American,\n                            OptionRight.Put,\n                            scaledStrikePrice,\n                            futureOptionExpiry));\n                    }\n\n                    break;\n                }\n                catch (HttpRequestException err)\n                {\n                    if (retries != maxRetries)\n                    {\n                        Log.Error(err, $\"Failed to retrieve futures options chain from CME, retrying ({retries} / {maxRetries})\");\n                        continue;\n                    }\n\n                    Log.Error(err, $\"Failed to retrieve futures options chain from CME, returning empty result ({retries} / {retries})\");\n                }\n            }\n\n            foreach (var symbol in symbols)\n            {\n                yield return symbol;\n            }\n        }\n\n        /// <summary>\n        /// Gets the list of option contracts for a given underlying equity symbol\n        /// </summary>\n        /// <param name=\"symbol\">The underlying symbol</param>\n        /// <param name=\"expectedOptionTicker\">The expected option ticker</param>\n        /// <returns>The list of option contracts</returns>\n        private static IEnumerable<Symbol> GetEquityIndexOptionContractList(Symbol symbol, string expectedOptionTicker)\n        {\n            var attempt = 1;\n            IEnumerable<Symbol> contracts;\n\n            while (true)\n            {\n                try\n                {\n                    Log.Trace($\"LiveOptionChainProvider.GetOptionContractList(): Fetching option chain for option {expectedOptionTicker} underlying {symbol.Value} [Attempt {attempt}]\");\n\n                    contracts = FindOptionContracts(symbol, expectedOptionTicker);\n                    break;\n                }\n                catch (WebException exception)\n                {\n                    Log.Error(exception);\n\n                    if (++attempt > MaxDownloadAttempts)\n                    {\n                        throw;\n                    }\n\n                    Thread.Sleep(1000);\n                }\n            }\n\n            return contracts;\n        }\n\n        /// <summary>\n        /// Retrieve the list of option contracts for an underlying symbol from the OCC website\n        /// </summary>\n        private static IEnumerable<Symbol> FindOptionContracts(Symbol underlyingSymbol, string expectedOptionTicker)\n        {\n            var symbols = new List<Symbol>();\n\n            // use QC url to bypass TLS issues with Mono pre-4.8 version\n            var url = \"https://www.quantconnect.com/api/v2/theocc/series-search?symbolType=U&symbol=\" + underlyingSymbol.Value;\n\n            // download the text file\n            var fileContent = _client.DownloadData(url);\n\n            // read the lines, skipping the headers\n            var lines = fileContent.Split(new[] { \"\\r\\n\" }, StringSplitOptions.None).Skip(7);\n\n            // Example of a line:\n            // SPY\t\t2021\t03\t26\t190\t000\tC P \t0\t612\t360000000\n\n            // avoid being sensitive to case\n            expectedOptionTicker = expectedOptionTicker.LazyToUpper();\n\n            var optionStyle = underlyingSymbol.SecurityType.DefaultOptionStyle();\n\n            // parse the lines, creating the Lean option symbols\n            foreach (var line in lines)\n            {\n                var fields = line.Split('\\t');\n\n                var ticker = fields[0].Trim();\n                if (ticker != expectedOptionTicker)\n                {\n                    // skip undesired options. For example SPX underlying has SPX & SPXW option tickers\n                    continue;\n                }\n\n                var expiryDate = new DateTime(fields[2].ToInt32(), fields[3].ToInt32(), fields[4].ToInt32());\n                var strike = (fields[5] + \".\" + fields[6]).ToDecimal();\n\n                foreach (var right in fields[7].Trim().Split(' '))\n                {\n                    OptionRight? targetRight = null;\n\n                    if (right.Equals(\"C\", StringComparison.OrdinalIgnoreCase))\n                    {\n                        targetRight = OptionRight.Call;\n                    }\n                    else if (right.Equals(\"P\", StringComparison.OrdinalIgnoreCase))\n                    {\n                        targetRight = OptionRight.Put;\n                    }\n\n                    if (targetRight.HasValue)\n                    {\n                        symbols.Add(Symbol.CreateOption(\n                            underlyingSymbol,\n                            expectedOptionTicker,\n                            underlyingSymbol.ID.Market,\n                            optionStyle,\n                            targetRight.Value,\n                            strike,\n                            expiryDate));\n                    }\n                }\n            }\n\n            return symbols;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/LiveSynchronizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Implementation of the <see cref=\"ISynchronizer\"/> interface which provides the mechanism to stream live data to the algorithm\n    /// </summary>\n    public class LiveSynchronizer : Synchronizer\n    {\n        /// <summary>\n        /// Consumer batching timeout in ms\n        /// </summary>\n        public static readonly int BatchingDelay = Config.GetInt(\"consumer-batching-timeout-ms\");\n\n        private ITimeProvider _timeProvider;\n        private LiveTimeProvider _frontierTimeProvider;\n        private RealTimeScheduleEventService _realTimeScheduleEventService;\n        private readonly ManualResetEventSlim _newLiveDataEmitted = new ManualResetEventSlim(false);\n\n        /// <summary>\n        /// Continuous UTC time provider\n        /// </summary>\n        public override ITimeProvider TimeProvider => _timeProvider;\n\n        /// <summary>\n        /// Initializes the instance of the Synchronizer class\n        /// </summary>\n        public override void Initialize(\n            IAlgorithm algorithm,\n            IDataFeedSubscriptionManager dataFeedSubscriptionManager,\n            PerformanceTrackingTool performanceTrackingTool)\n        {\n            base.Initialize(algorithm, dataFeedSubscriptionManager, performanceTrackingTool);\n\n            // the time provider, is the real time provider\n            _timeProvider = GetTimeProvider();\n            _frontierTimeProvider = new LiveTimeProvider(realTime: TimeProvider);\n            // the synchronizer will use our '_frontierTimeProvider' which initially during warmup will be using\n            // the base time provider which is the subscription based time provider (like backtesting)\n            // once wawrmup finishes it will start using the realtime provider\n            SubscriptionSynchronizer.SetTimeProvider(_frontierTimeProvider);\n\n            // attach event handlers to subscriptions\n            dataFeedSubscriptionManager.SubscriptionAdded += (sender, subscription) =>\n            {\n                subscription.NewDataAvailable += OnSubscriptionNewDataAvailable;\n            };\n\n            dataFeedSubscriptionManager.SubscriptionRemoved += (sender, subscription) =>\n            {\n                subscription.NewDataAvailable -= OnSubscriptionNewDataAvailable;\n            };\n\n            _realTimeScheduleEventService = new RealTimeScheduleEventService(new RealTimeProvider());\n            // this schedule event will be our time pulse\n            _realTimeScheduleEventService.NewEvent += (sender, args) => _newLiveDataEmitted.Set();\n        }\n\n        /// <summary>\n        /// Returns an enumerable which provides the data to stream to the algorithm\n        /// </summary>\n        public override IEnumerable<TimeSlice> StreamData(CancellationToken cancellationToken)\n        {\n            PostInitialize();\n\n            var shouldSendExtraEmptyPacket = false;\n            var nextEmit = DateTime.MinValue;\n            var lastLoopStart = DateTime.UtcNow;\n\n            var enumerator = SubscriptionSynchronizer\n                .Sync(SubscriptionManager.DataFeedSubscriptions, cancellationToken)\n                .GetEnumerator();\n\n            var previousWasTimePulse = false;\n            while (!cancellationToken.IsCancellationRequested)\n            {\n                var now = DateTime.UtcNow;\n                if (!previousWasTimePulse)\n                {\n                    if (!_newLiveDataEmitted.IsSet\n                        // we warmup as fast as we can even if no new data point is available\n                        && !Algorithm.IsWarmingUp)\n                    {\n                        // if we just crossed into the next second let's loop again, we will flush any consolidator bar\n                        // else we will wait to be notified by the subscriptions or our scheduled event service every second\n                        if (lastLoopStart.Second == now.Second)\n                        {\n                            _realTimeScheduleEventService.ScheduleEvent(TimeSpan.FromMilliseconds(GetPulseDueTime(now)), now);\n                            _newLiveDataEmitted.Wait();\n                        }\n                    }\n                    _newLiveDataEmitted.Reset();\n                }\n\n                lastLoopStart = now;\n\n                TimeSlice timeSlice;\n                try\n                {\n                    if (!enumerator.MoveNext())\n                    {\n                        // the enumerator ended\n                        break;\n                    }\n\n                    timeSlice = enumerator.Current;\n                }\n                catch (Exception err)\n                {\n                    // notify the algorithm about the error, so it can be reported to the user\n                    Algorithm.SetRuntimeError(err, \"LiveSynchronizer\");\n                    shouldSendExtraEmptyPacket = true;\n                    break;\n                }\n\n                // check for cancellation\n                if (timeSlice == null || cancellationToken.IsCancellationRequested) break;\n\n                var frontierUtc = FrontierTimeProvider.GetUtcNow();\n                // emit on data or if we've elapsed a full second since last emit or there are security changes\n                if (timeSlice.SecurityChanges != SecurityChanges.None\n                    || timeSlice.IsTimePulse\n                    || timeSlice.Data.Count != 0\n                    || frontierUtc >= nextEmit)\n                {\n                    previousWasTimePulse = timeSlice.IsTimePulse;\n                    yield return timeSlice;\n\n                    // ignore if time pulse because we will emit a slice with the same time just after this one\n                    if (!timeSlice.IsTimePulse)\n                    {\n                        // force emitting every second since the data feed is\n                        // the heartbeat of the application\n                        nextEmit = frontierUtc.RoundDown(Time.OneSecond).Add(Time.OneSecond);\n                    }\n                }\n            }\n\n            if (shouldSendExtraEmptyPacket)\n            {\n                // send last empty packet list before terminating,\n                // so the algorithm manager has a chance to detect the runtime error\n                // and exit showing the correct error instead of a timeout\n                nextEmit = FrontierTimeProvider.GetUtcNow().RoundDown(Time.OneSecond);\n                if (!cancellationToken.IsCancellationRequested)\n                {\n                    var timeSlice = TimeSliceFactory.Create(\n                        nextEmit,\n                        new List<DataFeedPacket>(),\n                        SecurityChanges.None,\n                        new Dictionary<Universe, BaseDataCollection>());\n                    yield return timeSlice;\n                }\n            }\n\n            enumerator.DisposeSafely();\n            Log.Trace(\"LiveSynchronizer.GetEnumerator(): Exited thread.\");\n        }\n\n        /// <summary>\n        /// Free resources\n        /// </summary>\n        public override void Dispose()\n        {\n            _newLiveDataEmitted.Set();\n            _newLiveDataEmitted?.DisposeSafely();\n            _realTimeScheduleEventService?.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"ITimeProvider\"/> to use. By default this will load the\n        /// <see cref=\"RealTimeProvider\"/> for live mode, else <see cref=\"SubscriptionFrontierTimeProvider\"/>\n        /// </summary>\n        /// <returns>The <see cref=\"ITimeProvider\"/> to use</returns>\n        protected override ITimeProvider GetTimeProvider()\n        {\n            return RealTimeProvider.Instance;\n        }\n\n        /// <summary>\n        /// Performs additional initialization steps after algorithm initialization\n        /// </summary>\n        protected override void PostInitialize()\n        {\n            base.PostInitialize();\n            _frontierTimeProvider.Initialize(base.GetTimeProvider());\n        }\n\n        /// <summary>\n        /// Will return the amount of milliseconds that are missing for the next time pulse\n        /// </summary>\n        protected virtual int GetPulseDueTime(DateTime now)\n        {\n            // let's wait until the next second starts\n            return 1000 - now.Millisecond + BatchingDelay;\n        }\n\n        /// <summary>\n        /// Trigger new data event\n        /// </summary>\n        /// <param name=\"sender\">Sender of the event</param>\n        /// <param name=\"args\">Event information</param>\n        protected virtual void OnSubscriptionNewDataAvailable(object sender, EventArgs args)\n        {\n            _newLiveDataEmitted.Set();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/LiveTimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Live time provide which supports an initial warmup period using the given time provider <see cref=\"SubscriptionFrontierTimeProvider\"/>, used by the <see cref=\"LiveSynchronizer\"/>\n    /// </summary>\n    public class LiveTimeProvider : ITimeProvider\n    {\n        private DateTime _previous;\n        private readonly DateTime _liveStart;\n        private readonly ITimeProvider _realTime;\n        private ITimeProvider _warmupTimeProvider;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"realTime\">Real time provider</param>\n        public LiveTimeProvider(ITimeProvider realTime)\n        {\n            _realTime = realTime;\n            _liveStart = _realTime.GetUtcNow();\n        }\n\n        /// <summary>\n        /// Fully initializes this instance providing the initial warmup time provider to use\n        /// </summary>\n        /// <param name=\"warmupTimeProvider\">The warmup provider to use</param>\n        public void Initialize(ITimeProvider warmupTimeProvider)\n        {\n            _warmupTimeProvider = warmupTimeProvider;\n        }\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        public DateTime GetUtcNow()\n        {\n            if(ReferenceEquals(_realTime, _warmupTimeProvider))\n            {\n                // warmup ended\n                return _realTime.GetUtcNow();\n            }\n\n            if (_warmupTimeProvider == null)\n            {\n                // don't let any live data point through until we are fully initialized\n                return Time.BeginningOfTime;\n            }\n\n            var newTime = _warmupTimeProvider.GetUtcNow();\n            if (_previous == newTime || newTime >= _liveStart)\n            {\n                // subscription time provider swap ended, start using live\n                _warmupTimeProvider = _realTime;\n                return GetUtcNow();\n            }\n            _previous = newTime;\n            return newTime;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/LiveTradingDataFeed.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Custom.Tiingo;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataFeed\"/> that is designed to deal with\n    /// live, remote data sources\n    /// </summary>\n    public class LiveTradingDataFeed : FileSystemDataFeed\n    {\n        private static readonly int MaximumWarmupHistoryDaysLookBack = Config.GetInt(\"maximum-warmup-history-days-look-back\", 5);\n\n        private LiveNodePacket _job;\n\n        // used to get current time\n        private ITimeProvider _timeProvider;\n        private IAlgorithm _algorithm;\n        private ITimeProvider _frontierTimeProvider;\n        private IDataProvider _dataProvider;\n        private IMapFileProvider _mapFileProvider;\n        private IDataQueueHandler _dataQueueHandler;\n        private BaseDataExchange _customExchange;\n        private SubscriptionCollection _subscriptions;\n        private IFactorFileProvider _factorFileProvider;\n        private IDataChannelProvider _channelProvider;\n        // in live trading we delay scheduled universe selection between 11 & 12 hours after midnight UTC so that we allow new selection data to be piped in\n        // NY goes from -4/-5 UTC time, so:\n        // 11 UTC - 4 => 7am NY\n        // 12 UTC - 4 => 8am NY\n        private readonly TimeSpan _scheduledUniverseUtcTimeShift = TimeSpan.FromMinutes(11 * 60 + DateTime.UtcNow.Second);\n        private readonly HashSet<string> _unsupportedConfigurations = new();\n\n        /// <summary>\n        /// Public flag indicator that the thread is still busy.\n        /// </summary>\n        public bool IsActive\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes the data feed for the specified job and algorithm\n        /// </summary>\n        public override void Initialize(IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider)\n        {\n            if (!(job is LiveNodePacket))\n            {\n                throw new ArgumentException(\"The LiveTradingDataFeed requires a LiveNodePacket.\");\n            }\n\n            _algorithm = algorithm;\n            _job = (LiveNodePacket)job;\n            _timeProvider = dataFeedTimeProvider.TimeProvider;\n            _dataProvider = dataProvider;\n            _mapFileProvider = mapFileProvider;\n            _factorFileProvider = factorFileProvider;\n            _channelProvider = dataChannelProvider;\n            _frontierTimeProvider = dataFeedTimeProvider.FrontierTimeProvider;\n            _customExchange = GetBaseDataExchange();\n            _subscriptions = subscriptionManager.DataFeedSubscriptions;\n\n            _dataQueueHandler = GetDataQueueHandler();\n            _dataQueueHandler?.SetJob(_job);\n\n            // run the custom data exchange\n            _customExchange.Start();\n\n            IsActive = true;\n\n            base.Initialize(algorithm, job, resultHandler, mapFileProvider, factorFileProvider, dataProvider, subscriptionManager, dataFeedTimeProvider, dataChannelProvider);\n        }\n\n        /// <summary>\n        /// Creates a new subscription to provide data for the specified security.\n        /// </summary>\n        /// <param name=\"request\">Defines the subscription to be added, including start/end times the universe and security</param>\n        /// <returns>The created <see cref=\"Subscription\"/> if successful, null otherwise</returns>\n        public override Subscription CreateSubscription(SubscriptionRequest request)\n        {\n            Subscription subscription = null;\n            try\n            {\n                // create and add the subscription to our collection\n                subscription = request.IsUniverseSubscription\n                    ? CreateUniverseSubscription(request)\n                    : CreateDataSubscription(request);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, $\"CreateSubscription(): Failed configuration: '{request.Configuration}'\");\n                // kill the algorithm, this shouldn't happen\n                _algorithm.SetRuntimeError(err, $\"Failed to subscribe to {request.Configuration.Symbol}\");\n            }\n\n            return subscription;\n        }\n\n        /// <summary>\n        /// Removes the subscription from the data feed, if it exists\n        /// </summary>\n        /// <param name=\"subscription\">The subscription to remove</param>\n        public override void RemoveSubscription(Subscription subscription)\n        {\n            var symbol = subscription.Configuration.Symbol;\n\n            // remove the subscriptions\n            if (!_channelProvider.ShouldStreamSubscription(subscription.Configuration))\n            {\n                _customExchange.RemoveEnumerator(symbol);\n            }\n            else\n            {\n                _dataQueueHandler.UnsubscribeWithMapping(subscription.Configuration);\n            }\n        }\n\n        /// <summary>\n        /// External controller calls to signal a terminate of the thread.\n        /// </summary>\n        public override void Exit()\n        {\n            if (IsActive)\n            {\n                IsActive = false;\n                Log.Trace(\"LiveTradingDataFeed.Exit(): Start. Setting cancellation token...\");\n                if (_dataQueueHandler is DataQueueHandlerManager manager)\n                {\n                    manager.UnsupportedConfiguration -= HandleUnsupportedConfigurationEvent;\n                }\n                _customExchange?.Stop();\n                Log.Trace(\"LiveTradingDataFeed.Exit(): Exit Finished.\");\n\n                base.Exit();\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IDataQueueHandler\"/> to use by default <see cref=\"DataQueueHandlerManager\"/>\n        /// </summary>\n        /// <remarks>Useful for testing</remarks>\n        /// <returns>The loaded <see cref=\"IDataQueueHandler\"/></returns>\n        protected virtual IDataQueueHandler GetDataQueueHandler()\n        {\n            var result = new DataQueueHandlerManager(_algorithm.Settings);\n            result.UnsupportedConfiguration += HandleUnsupportedConfigurationEvent;\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"BaseDataExchange\"/> to use\n        /// </summary>\n        /// <remarks>Useful for testing</remarks>\n        protected virtual BaseDataExchange GetBaseDataExchange()\n        {\n            return new BaseDataExchange(\"CustomDataExchange\") { SleepInterval = 100 };\n        }\n\n        /// <summary>\n        /// Creates a new subscription for the specified security\n        /// </summary>\n        /// <param name=\"request\">The subscription request</param>\n        /// <returns>A new subscription instance of the specified security</returns>\n        private Subscription CreateDataSubscription(SubscriptionRequest request)\n        {\n            Subscription subscription = null;\n\n            // let's keep track of the last point we got from the file based enumerator and start our history enumeration from this point\n            // this is much more efficient since these duplicated points will be dropped by the filter righ away causing memory usage spikes\n            var lastPointTracker = new LastPointTracker();\n\n            var localStartTime = request.StartTimeUtc.ConvertFromUtc(request.Security.Exchange.TimeZone);\n            var localEndTime = request.EndTimeUtc.ConvertFromUtc(request.Security.Exchange.TimeZone);\n            var timeZoneOffsetProvider = new TimeZoneOffsetProvider(request.Configuration.ExchangeTimeZone, request.StartTimeUtc, request.EndTimeUtc);\n\n            IEnumerator<BaseData> enumerator = null;\n            if (!_channelProvider.ShouldStreamSubscription(request.Configuration))\n            {\n                if (!Tiingo.IsAuthCodeSet)\n                {\n                    // we're not using the SubscriptionDataReader, so be sure to set the auth token here\n                    Tiingo.SetAuthCode(Config.Get(\"tiingo-auth-token\"));\n                }\n\n                var factory = new LiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _algorithm.ObjectStore);\n                var enumeratorStack = factory.CreateEnumerator(request, _dataProvider);\n\n                var enqueable = new EnqueueableEnumerator<BaseData>();\n                _customExchange.AddEnumerator(request.Configuration.Symbol, enumeratorStack, handleData: data =>\n                {\n                    enqueable.Enqueue(data);\n\n                    subscription?.OnNewDataAvailable();\n                });\n\n                enumerator = enqueable;\n            }\n            else\n            {\n                var auxEnumerators = new List<IEnumerator<BaseData>>();\n\n                if (LiveAuxiliaryDataEnumerator.TryCreate(request.Configuration, _timeProvider, request.Security.Cache, _mapFileProvider,\n                    _factorFileProvider, request.StartTimeLocal, out var auxDataEnumator))\n                {\n                    auxEnumerators.Add(auxDataEnumator);\n                }\n\n                EventHandler handler = (_, _) => subscription?.OnNewDataAvailable();\n                enumerator = Subscribe(request.Configuration, handler, IsExpired);\n\n                if (auxEnumerators.Count > 0)\n                {\n                    enumerator = new LiveAuxiliaryDataSynchronizingEnumerator(_timeProvider, request.Configuration.ExchangeTimeZone, enumerator, auxEnumerators);\n                }\n            }\n\n            // scale prices before 'SubscriptionFilterEnumerator' since it updates securities realtime price\n            // and before fill forwarding so we don't happen to apply twice the factor\n            if (request.Configuration.PricesShouldBeScaled(liveMode: true))\n            {\n                enumerator = new PriceScaleFactorEnumerator(\n                    enumerator,\n                    request.Configuration,\n                    _factorFileProvider,\n                    liveMode: true);\n            }\n\n            if (request.Configuration.FillDataForward)\n            {\n                var fillForwardResolution = _subscriptions.UpdateAndGetFillForwardResolution(request.Configuration);\n                // Pass the security exchange hours explicitly to avoid using the ones in the request, since\n                // those could be different. e.g. when requests are created for open interest data the exchange\n                // hours are set to always open to avoid OI data being filtered out due to the exchange being closed.\n                var useDailyStrictEndTimes = LeanData.UseDailyStrictEndTimes(_algorithm.Settings, request, request.Configuration.Symbol, request.Configuration.Increment, request.Security.Exchange.Hours);\n\n                enumerator = new LiveFillForwardEnumerator(_frontierTimeProvider, enumerator, request.Security.Exchange, fillForwardResolution,\n                    request.Configuration.ExtendedMarketHours, localStartTime, localEndTime, request.Configuration.Resolution, request.Configuration.DataTimeZone,\n                    useDailyStrictEndTimes, request.Configuration.Type, lastPointTracker);\n            }\n\n            // make our subscriptions aware of the frontier of the data feed, prevents future data from spewing into the feed\n            enumerator = new FrontierAwareEnumerator(enumerator, _frontierTimeProvider, timeZoneOffsetProvider);\n\n            // define market hours and user filters to incoming data after the frontier enumerator so during warmup we avoid any realtime data making it's way into the securities\n            if (request.Configuration.IsFilteredSubscription)\n            {\n                enumerator = new SubscriptionFilterEnumerator(enumerator, request.Security, localEndTime, request.Configuration.ExtendedMarketHours, true, request.ExchangeHours);\n            }\n\n            enumerator = GetWarmupEnumerator(request, enumerator, lastPointTracker);\n\n            var subscriptionDataEnumerator = new SubscriptionDataEnumerator(request.Configuration, request.Security.Exchange.Hours, timeZoneOffsetProvider,\n                enumerator, request.IsUniverseSubscription, _algorithm.Settings.DailyPreciseEndTime);\n            subscription = new Subscription(request, subscriptionDataEnumerator, timeZoneOffsetProvider);\n\n            return subscription;\n        }\n\n        /// <summary>\n        /// Helper method to determine if the symbol associated with the requested configuration is expired or not\n        /// </summary>\n        /// <remarks>This is useful during warmup where we can be requested to add some already expired asset. We want to skip sending it\n        /// to our live <see cref=\"_dataQueueHandler\"/> instance to avoid explosions. But we do want to add warmup enumerators</remarks>\n        private bool IsExpired(SubscriptionDataConfig dataConfig)\n        {\n            var mapFile = _mapFileProvider.ResolveMapFile(dataConfig);\n            var delistingDate = dataConfig.Symbol.GetDelistingDate(mapFile);\n            return _timeProvider.GetUtcNow().Date > delistingDate.ConvertToUtc(dataConfig.ExchangeTimeZone);\n        }\n\n        private IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler, Func<SubscriptionDataConfig, bool> isExpired)\n        {\n            return new LiveSubscriptionEnumerator(dataConfig, _dataQueueHandler, newDataAvailableHandler, isExpired);\n        }\n\n        /// <summary>\n        /// Creates a new subscription for universe selection\n        /// </summary>\n        /// <param name=\"request\">The subscription request</param>\n        private Subscription CreateUniverseSubscription(SubscriptionRequest request)\n        {\n            Subscription subscription = null;\n\n            // TODO : Consider moving the creating of universe subscriptions to a separate, testable class\n\n            // grab the relevant exchange hours\n            var config = request.Universe.Configuration;\n            var localEndTime = request.EndTimeUtc.ConvertFromUtc(request.Security.Exchange.TimeZone);\n            var tzOffsetProvider = new TimeZoneOffsetProvider(request.Configuration.ExchangeTimeZone, request.StartTimeUtc, request.EndTimeUtc);\n\n            IEnumerator<BaseData> enumerator = null;\n            if (request.Universe is ITimeTriggeredUniverse timeTriggered)\n            {\n                Log.Trace($\"LiveTradingDataFeed.CreateUniverseSubscription(): Creating user defined universe: {config.Symbol.ID}\");\n\n                // spoof a tick on the requested interval to trigger the universe selection function\n                var enumeratorFactory = new TimeTriggeredUniverseSubscriptionEnumeratorFactory(timeTriggered, MarketHoursDatabase.FromDataFolder());\n                enumerator = enumeratorFactory.CreateEnumerator(request, _dataProvider);\n\n                enumerator = new FrontierAwareEnumerator(enumerator, _timeProvider, tzOffsetProvider);\n                if (request.Universe is not UserDefinedUniverse)\n                {\n                    var enqueueable = new EnqueueableEnumerator<BaseData>();\n                    _customExchange.AddEnumerator(new EnumeratorHandler(config.Symbol, enumerator, enqueueable));\n                    enumerator = enqueueable;\n                }\n            }\n            else if (config.Type.IsAssignableTo(typeof(ETFConstituentUniverse)) ||\n                config.Type.IsAssignableTo(typeof(FundamentalUniverse)) ||\n                request.Universe is OptionChainUniverse ||\n                request.Universe is FuturesChainUniverse)\n            {\n                Log.Trace($\"LiveTradingDataFeed.CreateUniverseSubscription(): Creating {config.Type.Name} universe: {config.Symbol.ID}\");\n\n                // Will try to pull data from the data folder every 10min, file with yesterdays date.\n                // If lean is started today it will trigger initial coarse universe selection\n                var factory = new LiveCustomDataSubscriptionEnumeratorFactory(_timeProvider,\n                    _algorithm.ObjectStore,\n                    // we adjust time to the previous tradable date\n                    time => Time.GetStartTimeForTradeBars(request.Security.Exchange.Hours, time, Time.OneDay, 1, false, config.DataTimeZone, _algorithm.Settings.DailyPreciseEndTime),\n                    TimeSpan.FromMinutes(10)\n                );\n                var enumeratorStack = factory.CreateEnumerator(request, _dataProvider);\n\n                // aggregates each coarse data point into a single BaseDataCollection\n                var aggregator = new BaseDataCollectionAggregatorEnumerator(enumeratorStack, config.Symbol, true);\n                var enqueable = new EnqueueableEnumerator<BaseData>();\n                _customExchange.AddEnumerator(config.Symbol, aggregator, handleData: data =>\n                {\n                    enqueable.Enqueue(data);\n                    subscription?.OnNewDataAvailable();\n                });\n\n                enumerator = GetConfiguredFrontierAwareEnumerator(enqueable, tzOffsetProvider,\n                    // advance time if before 23pm or after 5am and not on Saturdays\n                    time => time.Hour < 23 && time.Hour > 5 && time.DayOfWeek != DayOfWeek.Saturday);\n            }\n            else\n            {\n                Log.Trace(\"LiveTradingDataFeed.CreateUniverseSubscription(): Creating custom universe: \" + config.Symbol.ID);\n\n                var factory = new LiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _algorithm.ObjectStore);\n                var enumeratorStack = factory.CreateEnumerator(request, _dataProvider);\n                enumerator = new BaseDataCollectionAggregatorEnumerator(enumeratorStack, config.Symbol, liveMode: true);\n\n                var enqueueable = new EnqueueableEnumerator<BaseData>();\n                _customExchange.AddEnumerator(new EnumeratorHandler(config.Symbol, enumerator, enqueueable));\n                enumerator = enqueueable;\n            }\n\n            enumerator = AddScheduleWrapper(request, enumerator, new PredicateTimeProvider(_frontierTimeProvider, (currentUtcDateTime) => {\n                // will only let time advance after it's passed the live time shift frontier\n                return currentUtcDateTime.TimeOfDay > _scheduledUniverseUtcTimeShift;\n            }));\n\n            enumerator = GetWarmupEnumerator(request, enumerator);\n\n            // create the subscription\n            var subscriptionDataEnumerator = new SubscriptionDataEnumerator(request.Configuration, request.Security.Exchange.Hours, tzOffsetProvider,\n                enumerator, request.IsUniverseSubscription, _algorithm.Settings.DailyPreciseEndTime);\n            subscription = new Subscription(request, subscriptionDataEnumerator, tzOffsetProvider);\n\n            return subscription;\n        }\n\n        /// <summary>\n        /// Build and apply the warmup enumerators when required\n        /// </summary>\n        private IEnumerator<BaseData> GetWarmupEnumerator(SubscriptionRequest request, IEnumerator<BaseData> liveEnumerator, LastPointTracker lastPointTracker = null)\n        {\n            if (_algorithm.IsWarmingUp)\n            {\n                var warmupRequest = new SubscriptionRequest(request, endTimeUtc: _timeProvider.GetUtcNow(),\n                    // we will not fill forward each warmup enumerators separately but concatenated bellow\n                    configuration: new SubscriptionDataConfig(request.Configuration, fillForward: false,\n                    resolution: _algorithm.Settings.WarmupResolution));\n                if (warmupRequest.TradableDaysInDataTimeZone.Any()\n                    // make sure there is at least room for a single bar of the requested resolution, else can cause issues with some history providers\n                    // this could happen when we create some internal subscription whose start time is 'Now', which we don't really want to warmup\n                    && warmupRequest.EndTimeUtc - warmupRequest.StartTimeUtc >= warmupRequest.Configuration.Resolution.ToTimeSpan()\n                    // since we change the resolution, let's validate it's still valid configuration (example daily equity quotes are not!)\n                    && LeanData.IsValidConfiguration(warmupRequest.Configuration.SecurityType, warmupRequest.Configuration.Resolution, warmupRequest.Configuration.TickType))\n                {\n                    // since we will source data locally and from the history provider, let's limit the history request size\n                    // by setting a start date respecting the 'MaximumWarmupHistoryDaysLookBack'\n                    var historyWarmup = warmupRequest;\n                    var warmupHistoryStartDate = warmupRequest.EndTimeUtc.AddDays(-MaximumWarmupHistoryDaysLookBack);\n                    if (warmupHistoryStartDate > warmupRequest.StartTimeUtc)\n                    {\n                        historyWarmup = new SubscriptionRequest(warmupRequest, startTimeUtc: warmupHistoryStartDate);\n                    }\n\n                    lastPointTracker ??= new LastPointTracker();\n\n                    var synchronizedWarmupEnumerator = TryAddFillForwardEnumerator(warmupRequest,\n                        // we concatenate the file based and history based warmup enumerators, dropping duplicate time stamps\n                        new ConcatEnumerator(true, GetFileBasedWarmupEnumerator(warmupRequest), GetHistoryWarmupEnumerator(historyWarmup, lastPointTracker)) { CanEmitNull = false },\n                        // if required by the original request, we will fill forward the Synced warmup data\n                        request.Configuration.FillDataForward,\n                        _algorithm.Settings.WarmupResolution);\n                    synchronizedWarmupEnumerator = ConfigureLastPointTracker(synchronizedWarmupEnumerator, lastPointTracker, isWarmUpEnumerator: true);\n                    synchronizedWarmupEnumerator = AddScheduleWrapper(warmupRequest, synchronizedWarmupEnumerator, null);\n\n                    // don't let future data past. We let null pass because that's letting the next enumerator know we've ended because we always return true in live\n                    synchronizedWarmupEnumerator = new FilterEnumerator<BaseData>(synchronizedWarmupEnumerator, data => data == null || data.EndTime <= warmupRequest.EndTimeLocal);\n\n                    // the order here is important, concat enumerator will keep the last enumerator given and dispose of the rest\n                    liveEnumerator = new ConcatEnumerator(true, synchronizedWarmupEnumerator, liveEnumerator);\n                }\n            }\n            return liveEnumerator;\n        }\n\n        /// <summary>\n        /// File based warmup enumerator\n        /// </summary>\n        private IEnumerator<BaseData> GetFileBasedWarmupEnumerator(SubscriptionRequest warmup)\n        {\n            IEnumerator<BaseData> result = null;\n            try\n            {\n                var enumerator = CreateEnumerator(warmup);\n                if (warmup.Configuration.PricesShouldBeScaled())\n                {\n                    enumerator = new PriceScaleFactorEnumerator(enumerator, warmup.Configuration, _factorFileProvider);\n                }\n                result = new FilterEnumerator<BaseData>(enumerator,\n                    // don't let future data past, nor fill forward, that will be handled after merging with the history request response\n                    data => data == null || data.EndTime < warmup.EndTimeLocal && !data.IsFillForward);\n            }\n            catch (Exception e)\n            {\n                Log.Error(e, $\"File based warmup: {warmup.Configuration}\");\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// History based warmup enumerator\n        /// </summary>\n        private IEnumerator<BaseData> GetHistoryWarmupEnumerator(SubscriptionRequest warmup, LastPointTracker lastPointTracker)\n        {\n            IEnumerator<BaseData> result;\n            if (warmup.IsUniverseSubscription)\n            {\n                // we ignore the fill forward time span argument because we will fill forwared the concatenated file and history based enumerators next in the stack\n                result = CreateUniverseEnumerator(warmup);\n            }\n            else\n            {\n                // we create an enumerable of which we get the enumerator to defer the creation of the history request until the file based enumeration ended\n                // and potentially the 'lastPointTracker' is available to adjust our start time\n                result = new[] { warmup }.SelectMany(_ =>\n                {\n                    var startTimeUtc = warmup.StartTimeUtc;\n                    if (lastPointTracker != null && lastPointTracker.LastDataPoint != null)\n                    {\n                        var lastPointExchangeTime = lastPointTracker.LastDataPoint.Time;\n                        if (warmup.Configuration.Resolution == Resolution.Daily)\n                        {\n                            // time could be 9.30 for example using strict daily end times, but we just want the date in this case\n                            lastPointExchangeTime = lastPointExchangeTime.Date;\n                        }\n\n                        var utcLastPointTime = lastPointExchangeTime.ConvertToUtc(warmup.ExchangeHours.TimeZone);\n                        if (utcLastPointTime > startTimeUtc)\n                        {\n                            if (Log.DebuggingEnabled)\n                            {\n                                Log.Debug($\"LiveTradingDataFeed.GetHistoryWarmupEnumerator(): Adjusting history warmup start time to {utcLastPointTime} from {startTimeUtc} for {warmup.Configuration}\");\n                            }\n                            startTimeUtc = utcLastPointTime;\n                        }\n                    }\n                    var historyRequest = new Data.HistoryRequest(warmup.Configuration, warmup.ExchangeHours, startTimeUtc, warmup.EndTimeUtc);\n                    try\n                    {\n                        return _algorithm.HistoryProvider.GetHistory(new[] { historyRequest }, _algorithm.TimeZone).Select(slice =>\n                        {\n                            try\n                            {\n                                var data = slice.Get(historyRequest.DataType);\n                                return (BaseData)data[warmup.Configuration.Symbol];\n                            }\n                            catch (Exception e)\n                            {\n                                Log.Error(e, $\"History warmup: {warmup.Configuration}\");\n                            }\n                            return null;\n                        });\n                    }\n                    catch\n                    {\n                        // some history providers could throw if they do not support a type\n                    }\n                    return Enumerable.Empty<BaseData>();\n                }).GetEnumerator();\n            }\n\n            return new FilterEnumerator<BaseData>(result,\n                // don't let future data past, nor fill forward, that will be handled after merging with the file based enumerator\n                data => data == null || data.EndTime < warmup.EndTimeLocal && !data.IsFillForward);\n        }\n\n        /// <summary>\n        /// Will wrap the provided enumerator with a <see cref=\"FrontierAwareEnumerator\"/>\n        /// using a <see cref=\"PredicateTimeProvider\"/> that will advance time based on the provided\n        /// function\n        /// </summary>\n        /// <remarks>Won't advance time if now.Hour is bigger or equal than 23pm, less or equal than 5am or Saturday.\n        /// This is done to prevent universe selection occurring in those hours so that the subscription changes\n        /// are handled correctly.</remarks>\n        private IEnumerator<BaseData> GetConfiguredFrontierAwareEnumerator(\n            IEnumerator<BaseData> enumerator,\n            TimeZoneOffsetProvider tzOffsetProvider,\n            Func<DateTime, bool> customStepEvaluator)\n        {\n            var stepTimeProvider = new PredicateTimeProvider(_frontierTimeProvider, customStepEvaluator);\n\n            return new FrontierAwareEnumerator(enumerator, stepTimeProvider, tzOffsetProvider);\n        }\n\n        private IDataQueueUniverseProvider GetUniverseProvider(SecurityType securityType)\n        {\n            if (_dataQueueHandler is not IDataQueueUniverseProvider or DataQueueHandlerManager { HasUniverseProvider: false })\n            {\n                throw new NotSupportedException($\"The DataQueueHandler does not support {securityType}.\");\n            }\n            return (IDataQueueUniverseProvider)_dataQueueHandler;\n        }\n\n        private void HandleUnsupportedConfigurationEvent(object _, SubscriptionDataConfig config)\n        {\n            if (_algorithm != null)\n            {\n                lock (_unsupportedConfigurations)\n                {\n                    var key = $\"{config.Symbol.ID.Market} {config.Symbol.ID.SecurityType} {config.Type.Name}\";\n                    if (_unsupportedConfigurations.Add(key))\n                    {\n                        Log.Trace($\"LiveTradingDataFeed.HandleUnsupportedConfigurationEvent(): detected unsupported configuration: {config}\");\n\n                        _algorithm.Debug($\"Warning: {key} data not supported. Please consider reviewing the data providers selection.\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Overrides methods of the base data exchange implementation\n        /// </summary>\n        private class EnumeratorHandler : BaseDataExchange.EnumeratorHandler\n        {\n            public EnumeratorHandler(Symbol symbol, IEnumerator<BaseData> enumerator, EnqueueableEnumerator<BaseData> enqueueable)\n                : base(symbol, enumerator, handleData: enqueueable.Enqueue)\n            {\n                EnumeratorFinished += (_, _) => enqueueable.Stop();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ManualTimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ITimeProvider\"/> that can be\n    /// manually advanced through time\n    /// </summary>\n    public class ManualTimeProvider : ITimeProvider\n    {\n        private volatile ReferenceWrapper<DateTime> _currentTime;\n        private readonly DateTimeZone _setCurrentTimeTimeZone;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualTimeProvider\"/>\n        /// </summary>\n        /// <param name=\"setCurrentTimeTimeZone\">Specify to use this time zone when calling <see cref=\"SetCurrentTime\"/>,\n        /// leave null for the default of <see cref=\"TimeZones.Utc\"/></param>\n        public ManualTimeProvider(DateTimeZone setCurrentTimeTimeZone = null)\n        {\n            _setCurrentTimeTimeZone = setCurrentTimeTimeZone ?? TimeZones.Utc;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ManualTimeProvider\"/> class\n        /// </summary>\n        /// <param name=\"currentTime\">The current time in the specified time zone, if the time zone is\n        /// null then the time is interpreted as being in <see cref=\"TimeZones.Utc\"/></param>\n        /// <param name=\"setCurrentTimeTimeZone\">Specify to use this time zone when calling <see cref=\"SetCurrentTime\"/>,\n        /// leave null for the default of <see cref=\"TimeZones.Utc\"/></param>\n        public ManualTimeProvider(DateTime currentTime, DateTimeZone setCurrentTimeTimeZone = null)\n            : this(setCurrentTimeTimeZone)\n        {\n            _currentTime = new ReferenceWrapper<DateTime>(currentTime.ConvertToUtc(_setCurrentTimeTimeZone));\n        }\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        public DateTime GetUtcNow()\n        {\n            return _currentTime.Value;\n        }\n\n        /// <summary>\n        /// Sets the current time interpreting the specified time as a UTC time\n        /// </summary>\n        /// <param name=\"time\">The current time in UTC</param>\n        public void SetCurrentTimeUtc(DateTime time)\n        {\n            _currentTime = new ReferenceWrapper<DateTime>(time);\n        }\n\n        /// <summary>\n        /// Sets the current time interpeting the specified time as a local time\n        /// using the time zone used at instatiation.\n        /// </summary>\n        /// <param name=\"time\">The local time to set the current time time, will be\n        /// converted into UTC</param>\n        public void SetCurrentTime(DateTime time)\n        {\n            SetCurrentTimeUtc(time.ConvertToUtc(_setCurrentTimeTimeZone));\n        }\n\n        /// <summary>\n        /// Advances the current time by the specified span\n        /// </summary>\n        /// <param name=\"span\">The amount of time to advance the current time by</param>\n        public void Advance(TimeSpan span)\n        {\n            _currentTime = new ReferenceWrapper<DateTime>(_currentTime.Value + span);\n        }\n\n        /// <summary>\n        /// Advances the current time by the specified number of seconds\n        /// </summary>\n        /// <param name=\"seconds\">The number of seconds to advance the current time by</param>\n        public void AdvanceSeconds(double seconds)\n        {\n            Advance(TimeSpan.FromSeconds(seconds));\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/NullDataFeed.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Null data feed implementation. <seealso cref=\"DataManager\"/>\n    /// </summary>\n    public class NullDataFeed : IDataFeed\n    {\n        /// <summary>\n        /// Allows specifying if this implementation should throw always or not\n        /// </summary>\n        public bool ShouldThrow { get; set; } = true;\n\n        /// <inheritdoc />\n        public bool IsActive\n        {\n            get\n            {\n                if (!ShouldThrow)\n                {\n                    return true;\n                }\n                throw new NotImplementedException(\"Unexpected usage of null data feed implementation.\");\n            }\n        }\n\n        /// <inheritdoc />\n        public void Initialize(\n            IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider\n            )\n        {\n            if (!ShouldThrow)\n            {\n                return;\n            }\n            throw new NotImplementedException(\"Unexpected usage of null data feed implementation.\");\n        }\n\n        /// <inheritdoc />\n        public Subscription CreateSubscription(SubscriptionRequest request)\n        {\n            if (!ShouldThrow)\n            {\n                return null;\n            }\n            throw new NotImplementedException(\"Unexpected usage of null data feed implementation.\");\n        }\n\n        /// <inheritdoc />\n        public void RemoveSubscription(Subscription subscription)\n        {\n            if (!ShouldThrow)\n            {\n                return;\n            }\n            throw new NotImplementedException(\"Unexpected usage of null data feed implementation.\");\n        }\n\n        /// <inheritdoc />\n        public void Exit()\n        {\n            if (!ShouldThrow)\n            {\n                return;\n            }\n            throw new NotImplementedException(\"Unexpected usage of null data feed implementation.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/PendingRemovalsManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Helper class used to managed pending security removals <see cref=\"UniverseSelection\"/>\n    /// </summary>\n    public class PendingRemovalsManager\n    {\n        private readonly Dictionary<Universe, List<Universe.Member>> _pendingRemovals;\n        private readonly IOrderProvider _orderProvider;\n\n        /// <summary>\n        /// Current pending removals\n        /// </summary>\n        public IReadOnlyDictionary<Universe, List<Universe.Member>> PendingRemovals => _pendingRemovals;\n\n        /// <summary>\n        /// Create a new instance\n        /// </summary>\n        /// <param name=\"orderProvider\">The order provider used to determine if it is safe to remove a security</param>\n        public PendingRemovalsManager(IOrderProvider orderProvider)\n        {\n            _orderProvider = orderProvider;\n            _pendingRemovals = new Dictionary<Universe, List<Universe.Member>>();\n        }\n\n        /// <summary>\n        /// Determines if we can safely remove the security member from a universe.\n        /// We must ensure that we have zero holdings, no open orders, and no existing portfolio targets\n        /// </summary>\n        private bool IsSafeToRemove(Universe.Member member, Universe universe)\n        {\n            var security = member.Security;\n\n            // but don't physically remove it from the algorithm if we hold stock or have open orders against it or an open target\n            var openOrders = _orderProvider.GetOpenOrders(x => x.Symbol == security.Symbol);\n            if (!security.HoldStock && !openOrders.Any() && (security.Holdings.Target == null || security.Holdings.Target.Quantity == 0))\n            {\n                if (universe.Securities.Any(pair =>\n                    pair.Key.Underlying == security.Symbol && !IsSafeToRemove(pair.Value, universe)))\n                {\n                    // don't remove if any member in the universe which uses this 'member' as underlying can't be removed\n                    // covers the options use case\n                    return false;\n                }\n\n                // don't remove if there are unsettled positions\n                var unsettledCash = security.SettlementModel.GetUnsettledCash();\n                if (unsettledCash != default && unsettledCash.Amount > 0)\n                {\n                    return false;\n                }\n\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Will determine if the <see cref=\"Security\"/> can be removed.\n        /// If it can be removed will add it to <see cref=\"PendingRemovals\"/>\n        /// </summary>\n        /// <param name=\"member\">The security to remove</param>\n        /// <param name=\"universe\">The universe which the security is a member of</param>\n        /// <returns>The member to remove</returns>\n        public List<RemovedMember> TryRemoveMember(Universe.Member member, Universe universe)\n        {\n            if (IsSafeToRemove(member, universe))\n            {\n                return new List<RemovedMember> {new RemovedMember(universe, member.Security)};\n            }\n\n            if (_pendingRemovals.ContainsKey(universe))\n            {\n                if (!_pendingRemovals[universe].Contains(member))\n                {\n                    _pendingRemovals[universe].Add(member);\n                }\n            }\n            else\n            {\n                _pendingRemovals.Add(universe, new List<Universe.Member> { member });\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Will check if the security is pending for removal\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <param name=\"isInternal\">Whether it's an internal subscription</param>\n        /// <returns>Whether the security is pending for removal</returns>\n        public bool IsPendingForRemoval(Security security, bool isInternal)\n        {\n            return _pendingRemovals.Values.Any(x => x.Any(y => y.IsInternal == isInternal && y.Security.Symbol == security.Symbol));\n        }\n\n        /// <summary>\n        /// Will check if the member is pending for removal\n        /// </summary>\n        /// <param name=\"member\">The universe member</param>\n        /// <returns>Whether the security is pending for removal</returns>\n        public bool IsPendingForRemoval(Universe.Member member)\n        {\n            return IsPendingForRemoval(member.Security, member.IsInternal);\n        }\n\n        /// <summary>\n        /// Will check pending security removals\n        /// </summary>\n        /// <param name=\"selectedSymbols\">Currently selected symbols</param>\n        /// <param name=\"currentUniverse\">Current universe</param>\n        /// <returns>The members to be removed</returns>\n        public List<RemovedMember> CheckPendingRemovals(\n            HashSet<Symbol> selectedSymbols,\n            Universe currentUniverse)\n        {\n            var result = new List<RemovedMember>();\n            // remove previously deselected members which were kept in the universe because of holdings or open orders\n            foreach (var kvp in _pendingRemovals.ToList())\n            {\n                var universeRemoving = kvp.Key;\n                foreach (var member in kvp.Value.ToList())\n                {\n                    var isSafeToRemove = IsSafeToRemove(member, universeRemoving);\n                    if (isSafeToRemove\n                        ||\n                        // if we are re selecting it we remove it as a pending removal\n                        // else we might remove it when we do not want to do so\n                        universeRemoving == currentUniverse\n                        && selectedSymbols.Contains(member.Security.Symbol))\n                    {\n                        if (isSafeToRemove)\n                        {\n                            result.Add(new RemovedMember(universeRemoving, member.Security));\n                        }\n\n                        _pendingRemovals[universeRemoving].Remove(member);\n\n                        // if there are no more pending removals for this universe lets remove it\n                        if (!_pendingRemovals[universeRemoving].Any())\n                        {\n                            _pendingRemovals.Remove(universeRemoving);\n                        }\n                    }\n                }\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Helper class used to report removed universe members\n        /// </summary>\n        public class RemovedMember\n        {\n            /// <summary>\n            /// Universe the security was removed from\n            /// </summary>\n            public Universe Universe { get; }\n\n            /// <summary>\n            /// Security that is removed\n            /// </summary>\n            public Security Security { get; }\n\n            /// <summary>\n            /// Initialize a new instance of <see cref=\"RemovedMember\"/>\n            /// </summary>\n            /// <param name=\"universe\"><see cref=\"Universe\"/> the security was removed from</param>\n            /// <param name=\"security\"><see cref=\"Security\"/> that is removed</param>\n            public RemovedMember(Universe universe, Security security)\n            {\n                Universe = universe;\n                Security = security;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/PrecalculatedSubscriptionData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Store data both raw and adjusted and the time at which it should be synchronized\n    /// </summary>\n    public class PrecalculatedSubscriptionData : SubscriptionData\n    {\n        private BaseData _normalizedData;\n        private SubscriptionDataConfig _config;\n        private readonly DataNormalizationMode _mode;\n\n        /// <summary>\n        /// Gets the data\n        /// </summary>\n        public override BaseData Data\n        {\n            get\n            {\n                if (_config.DataNormalizationMode == DataNormalizationMode.Raw)\n                {\n                    return _data;\n                }\n                else if (_config.DataNormalizationMode == _mode)\n                {\n                    return _normalizedData;\n                }\n                else\n                {\n                    throw new ArgumentException($\"DataNormalizationMode.{_config.DataNormalizationMode} was requested for \" \n                                                + $\"symbol {_data.Symbol} but only {_mode} and Raw DataNormalizationMode are available. \" \n                                                + \"Please configure the desired DataNormalizationMode initially when adding the Symbol\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PrecalculatedSubscriptionData\"/> class\n        /// </summary>\n        /// <param name=\"configuration\">The subscription's configuration</param>\n        /// <param name=\"rawData\">The base data</param>\n        /// <param name=\"normalizedData\">The normalized calculated based on raw data</param>\n        /// <param name=\"normalizationMode\">Specifies how data is normalized</param>\n        /// <param name=\"emitTimeUtc\">The emit time for the data</param>\n        public PrecalculatedSubscriptionData(SubscriptionDataConfig configuration, BaseData rawData, BaseData normalizedData, DataNormalizationMode normalizationMode, DateTime emitTimeUtc)\n            : base(rawData, emitTimeUtc)\n        {\n            _config = configuration;\n            _normalizedData = normalizedData;\n            _mode = normalizationMode;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/PredicateTimeProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Will generate time steps around the desired <see cref=\"ITimeProvider\"/>\n    /// Provided step evaluator should return true when the next time step\n    /// is valid and time can advance\n    /// </summary>\n    public class PredicateTimeProvider : ITimeProvider\n    {\n        private readonly ITimeProvider _underlyingTimeProvider;\n        private readonly Func<DateTime, bool> _customStepEvaluator;\n        private DateTime _currentUtc = DateTime.MinValue;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"underlyingTimeProvider\">The timer provider instance to wrap</param>\n        /// <param name=\"customStepEvaluator\">Function to evaluate whether or not\n        /// to advance time. Should return true if provided <see cref=\"DateTime\"/> is a\n        /// valid new next time. False will avoid time advancing</param>\n        public PredicateTimeProvider(ITimeProvider underlyingTimeProvider,\n            Func<DateTime, bool> customStepEvaluator)\n        {\n            _underlyingTimeProvider = underlyingTimeProvider;\n            _customStepEvaluator = customStepEvaluator;\n        }\n\n        /// <summary>\n        /// Gets the current utc time step\n        /// </summary>\n        public DateTime GetUtcNow()\n        {\n            if (_currentUtc == DateTime.MinValue)\n            {\n                Initialize();\n            }\n            var utcNow = _underlyingTimeProvider.GetUtcNow();\n\n            // we check if we should advance time based on the provided custom step evaluator\n            if (_customStepEvaluator(utcNow))\n            {\n                _currentUtc = utcNow;\n            }\n            return _currentUtc;\n        }\n\n        private void Initialize()\n        {\n            // to determine the current time we go backwards up to 2 days until we reach a valid time we don't want to start on an invalid time\n            var utcNow = _underlyingTimeProvider.GetUtcNow();\n            for (var i = 0; i < 48; i++)\n            {\n                var before = utcNow.AddHours(-1 * i);\n                if (_customStepEvaluator(before))\n                {\n                    _currentUtc = before;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ProcessedDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*/\n\nusing System.IO;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// A data provider that will check the processed data folder first\n    /// </summary>\n    public class ProcessedDataProvider : IDataProvider, IDisposable\n    {\n        private readonly DefaultDataProvider _defaultDataProvider;\n        private readonly string _processedDataDirectory;\n\n        /// <summary>\n        /// Ignored\n        /// </summary>\n        public event EventHandler<DataProviderNewDataRequestEventArgs> NewDataRequest;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public ProcessedDataProvider()\n        {\n            _defaultDataProvider = new();\n            _processedDataDirectory = Config.Get(\"processed-data-directory\") ?? string.Empty;\n            Log.Trace($\"ProcessedDataProvider(): processed data directory to use {_processedDataDirectory}, exists: {Directory.Exists(_processedDataDirectory)}\");\n        }\n\n        /// <summary>\n        /// Retrieves data from disc to be used in an algorithm\n        /// </summary>\n        /// <param name=\"key\">A string representing where the data is stored</param>\n        /// <returns>A <see cref=\"Stream\"/> of the data requested</returns>\n        public Stream Fetch(string key)\n        {\n            Stream result = null;\n\n            // we will try the processed data folder first\n            if (_processedDataDirectory.Length != 0 && key.StartsWith(Globals.DataFolder, StringComparison.OrdinalIgnoreCase))\n            {\n                result = _defaultDataProvider.Fetch(Path.Combine(_processedDataDirectory, key.Remove(0, Globals.DataFolder.Length).TrimStart('/', '\\\\')));\n                if (result != null)\n                {\n                    Log.Trace($\"ProcessedDataProvider.Fetch({key}): fetched from processed data directory\");\n                }\n            }\n\n            // fall back to existing data folder path\n            return result ?? _defaultDataProvider.Fetch(key);\n        }\n\n        /// <summary>\n        /// Disposes of resources\n        /// </summary>\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Disposes of the internal data provider\n        /// </summary>\n        protected virtual void Dispose(bool disposing)\n        {\n            if (disposing)\n            {\n                _defaultDataProvider.Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Queues/DataQueue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Queues\n{\n    /// <summary>\n    /// Live Data Queue is the cut out implementation of how to bind a custom live data source\n    /// </summary>\n    public class LiveDataQueue : IDataQueueHandler\n    {\n        /// <summary>\n        /// Desktop/Local doesn't support live data from this handler\n        /// </summary>\n        public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n        {\n            throw new NotImplementedException(\"QuantConnect.Queues.LiveDataQueue has not implemented live data.\");\n        }\n\n        /// <summary>\n        /// Desktop/Local doesn't support live data from this handler\n        /// </summary>\n        public virtual void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            throw new NotImplementedException(\"QuantConnect.Queues.LiveDataQueue has not implemented live data.\");\n        }\n\n        /// <summary>\n        /// Sets the job we're subscribing for\n        /// </summary>\n        /// <param name=\"job\">Job we're subscribing for</param>\n        public void SetJob(LiveNodePacket job)\n        {\n        }\n\n        /// <summary>\n        /// Returns whether the data provider is connected\n        /// </summary>\n        /// <returns>true if the data provider is connected</returns>\n        public bool IsConnected => false;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Queues/FakeDataQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing Timer = System.Timers.Timer;\nusing QuantConnect.Lean.Engine.HistoricalData;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Queues\n{\n    /// <summary>\n    /// This is an implementation of <see cref=\"IDataQueueHandler\"/> used for testing. <see cref=\"FakeHistoryProvider\"/>\n    /// </summary>\n    public class FakeDataQueue : IDataQueueHandler, IDataQueueUniverseProvider\n    {\n        private int _count;\n        private readonly Random _random = new Random();\n        private int _dataPointsPerSecondPerSymbol;\n\n        private readonly Timer _timer;\n        private readonly IOptionChainProvider _optionChainProvider;\n        private readonly EventBasedDataQueueHandlerSubscriptionManager _subscriptionManager;\n        private readonly IDataAggregator _aggregator;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n        private readonly Dictionary<Symbol, TimeZoneOffsetProvider> _symbolExchangeTimeZones;\n\n        /// <summary>\n        /// Continuous UTC time provider\n        /// </summary>\n        protected virtual ITimeProvider TimeProvider { get; } = RealTimeProvider.Instance;\n\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FakeDataQueue\"/> class to randomly emit data for each symbol\n        /// </summary>\n        public FakeDataQueue()\n            : this(Composer.Instance.GetExportedValueByTypeName<IDataAggregator>(nameof(AggregationManager)))\n        {\n\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FakeDataQueue\"/> class to randomly emit data for each symbol\n        /// </summary>\n        public FakeDataQueue(IDataAggregator dataAggregator, int dataPointsPerSecondPerSymbol = 500000)\n        {\n            _aggregator = dataAggregator;\n            _dataPointsPerSecondPerSymbol = dataPointsPerSecondPerSymbol;\n\n            var mapFileProvider = Composer.Instance.GetPart<IMapFileProvider>();\n            var historyManager = (IHistoryProvider)Composer.Instance.GetPart<HistoryProviderManager>();\n            if (historyManager == null)\n            {\n                historyManager = Composer.Instance.GetPart<IHistoryProvider>();\n            }\n            var optionChainProvider = new LiveOptionChainProvider();\n            optionChainProvider.Initialize(new(mapFileProvider, historyManager));\n            _optionChainProvider = optionChainProvider;\n\n            _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            _symbolExchangeTimeZones = new Dictionary<Symbol, TimeZoneOffsetProvider>();\n            _subscriptionManager = new EventBasedDataQueueHandlerSubscriptionManager();\n            _subscriptionManager.SubscribeImpl += (s, t) => true;\n            _subscriptionManager.UnsubscribeImpl += (s, t) => true;\n\n            _timer = new Timer\n            {\n                AutoReset = false,\n                Enabled = true,\n                Interval = 1000,\n            };\n\n            var lastCount = 0;\n            var lastTime = DateTime.UtcNow;\n            _timer.Elapsed += (sender, args) =>\n            {\n                var elapsed = (DateTime.UtcNow - lastTime);\n                var ticksPerSecond = (_count - lastCount)/elapsed.TotalSeconds;\n                Log.Trace(\"TICKS PER SECOND:: \" + ticksPerSecond.ToStringInvariant(\"000000.0\") + \" ITEMS IN QUEUE:: \" + 0);\n                lastCount = _count;\n                lastTime = DateTime.UtcNow;\n                PopulateQueue();\n                try\n                {\n                    _timer.Reset();\n                }\n                catch (ObjectDisposedException)\n                {\n                    // pass\n                }\n            };\n        }\n\n        /// <summary>\n        /// Subscribe to the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n        {\n            var enumerator = _aggregator.Add(dataConfig, newDataAvailableHandler);\n            _subscriptionManager.Subscribe(dataConfig);\n\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Sets the job we're subscribing for\n        /// </summary>\n        /// <param name=\"job\">Job we're subscribing for</param>\n        public void SetJob(LiveNodePacket job)\n        {\n        }\n\n        /// <summary>\n        /// Removes the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">Subscription config to be removed</param>\n        public void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            _subscriptionManager.Unsubscribe(dataConfig);\n            _aggregator.Remove(dataConfig);\n        }\n\n        /// <summary>\n        /// Returns whether the data provider is connected\n        /// </summary>\n        /// <returns>true if the data provider is connected</returns>\n        public bool IsConnected => true;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _timer.Stop();\n            _timer.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Pumps a bunch of ticks into the queue\n        /// </summary>\n        private void PopulateQueue()\n        {\n            var symbols = _subscriptionManager.GetSubscribedSymbols();\n\n\n            foreach (var symbol in symbols)\n            {\n                if (symbol.IsCanonical() || symbol.Contains(\"UNIVERSE\"))\n                {\n                    continue;\n                }\n                var offsetProvider = GetTimeZoneOffsetProvider(symbol);\n                var trades = SubscriptionManager.DefaultDataTypes()[symbol.SecurityType].Contains(TickType.Trade);\n                var quotes = SubscriptionManager.DefaultDataTypes()[symbol.SecurityType].Contains(TickType.Quote);\n\n                // emits 500k per second\n                for (var i = 0; i < _dataPointsPerSecondPerSymbol; i++)\n                {\n                    var now = TimeProvider.GetUtcNow();\n                    var exchangeTime = offsetProvider.ConvertFromUtc(now);\n                    var lastTrade = 100 + (decimal)Math.Abs(Math.Sin(now.TimeOfDay.TotalMilliseconds));\n                    if (trades)\n                    {\n                        _count++;\n                        _aggregator.Update(new Tick\n                        {\n                            Time = exchangeTime,\n                            Symbol = symbol,\n                            Value = lastTrade,\n                            TickType = TickType.Trade,\n                            Quantity = _random.Next(10, (int)_timer.Interval)\n                        });\n                    }\n\n                    if (quotes)\n                    {\n                        _count++;\n                        var bidPrice = lastTrade * 0.95m;\n                        var askPrice = lastTrade * 1.05m;\n                        var bidSize = _random.Next(10, (int) _timer.Interval);\n                        var askSize = _random.Next(10, (int)_timer.Interval);\n                        _aggregator.Update(new Tick(exchangeTime, symbol, \"\", \"\", bidSize: bidSize, bidPrice: bidPrice, askPrice: askPrice, askSize: askSize));\n                    }\n                }\n            }\n        }\n\n        private TimeZoneOffsetProvider GetTimeZoneOffsetProvider(Symbol symbol)\n        {\n            TimeZoneOffsetProvider offsetProvider;\n            if (!_symbolExchangeTimeZones.TryGetValue(symbol, out offsetProvider))\n            {\n                // read the exchange time zone from market-hours-database\n                var exchangeTimeZone = _marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType).TimeZone;\n                _symbolExchangeTimeZones[symbol] = offsetProvider = new TimeZoneOffsetProvider(exchangeTimeZone, TimeProvider.GetUtcNow(), Time.EndOfTime);\n            }\n            return offsetProvider;\n        }\n\n        /// <summary>\n        /// Method returns a collection of Symbols that are available at the data source.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup</param>\n        /// <param name=\"includeExpired\">Include expired contracts</param>\n        /// <param name=\"securityCurrency\">Expected security currency(if any)</param>\n        /// <returns>Enumerable of Symbols, that are associated with the provided Symbol</returns>\n        public IEnumerable<Symbol> LookupSymbols(Symbol symbol, bool includeExpired, string securityCurrency = null)\n        {\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                case SecurityType.FutureOption:\n                    foreach (var result in _optionChainProvider.GetOptionContractList(symbol, DateTime.UtcNow.Date))\n                    {\n                        yield return result;\n                    }\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Checks if the FakeDataQueue can perform selection\n        /// </summary>\n        public bool CanPerformSelection()\n        {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ReaderErrorEventArgs.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Event arguments for the <see cref=\"TextSubscriptionDataSourceReader.ReaderError\"/> event.\n    /// </summary>\n    public sealed class ReaderErrorEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the line that caused the error\n        /// </summary>\n        public string Line\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Gets the exception that was caught\n        /// </summary>\n        public Exception Exception\n        {\n            get; private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReaderErrorEventArgs\"/> class\n        /// </summary>\n        /// <param name=\"line\">The line that caused the error</param>\n        /// <param name=\"exception\">The exception that was caught during the read</param>\n        public ReaderErrorEventArgs(string line, Exception exception)\n        {\n            Line = line;\n            Exception = exception;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/RealTimeScheduleEventService.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Allows to setup a real time scheduled event, internally using a <see cref=\"Thread\"/>,\n    /// that is guaranteed to trigger at or after the requested time, never before.\n    /// </summary>\n    /// <remarks>This class is of value because <see cref=\"Timer\"/> could fire the\n    /// event before time.</remarks>\n    public class RealTimeScheduleEventService : IDisposable\n    {\n        private readonly Thread _pulseThread;\n        private readonly Queue<DateTime> _work;\n        private readonly ManualResetEvent _event;\n        private readonly CancellationTokenSource _tokenSource;\n\n        /// <summary>\n        /// Event fired when the scheduled time is past\n        /// </summary>\n        public event EventHandler NewEvent;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeProvider\">The time provider to use</param>\n        public RealTimeScheduleEventService(ITimeProvider timeProvider)\n        {\n            _tokenSource = new CancellationTokenSource();\n            _event = new ManualResetEvent(false);\n            _work = new Queue<DateTime>();\n            _pulseThread = new Thread(() =>\n                {\n                    while (!_tokenSource.Token.IsCancellationRequested)\n                    {\n                        DateTime nextUtcScheduledEvent;\n                        lock (_work)\n                        {\n                            _work.TryDequeue(out nextUtcScheduledEvent);\n                        }\n\n                        if (nextUtcScheduledEvent == default)\n                        {\n                            _event.WaitOne(_tokenSource.Token);\n                            _event.Reset();\n                            if (_tokenSource.Token.IsCancellationRequested)\n                            {\n                                return;\n                            }\n                            continue;\n                        }\n\n                        // testing has shown that it sometimes requires more than one loop\n                        var diff = nextUtcScheduledEvent - timeProvider.GetUtcNow();\n                        while (diff.Ticks > 0)\n                        {\n                            _tokenSource.Token.WaitHandle.WaitOne(diff);\n\n                            diff = nextUtcScheduledEvent - timeProvider.GetUtcNow();\n\n                            if (_tokenSource.Token.IsCancellationRequested)\n                            {\n                                return;\n                            }\n                        }\n\n                        NewEvent?.Invoke(this, EventArgs.Empty);\n                    }\n                }) { IsBackground = true, Name = \"RealTimeScheduleEventService\" };\n            _pulseThread.Start();\n        }\n\n        /// <summary>\n        /// Schedules a new event\n        /// </summary>\n        /// <param name=\"dueTime\">The desired due time</param>\n        /// <param name=\"utcNow\">Current utc time</param>\n        /// <remarks>Scheduling a new event will try to disable previous scheduled event,\n        /// but it is not guaranteed.</remarks>\n        public void ScheduleEvent(TimeSpan dueTime, DateTime utcNow)\n        {\n            lock (_work)\n            {\n                _work.Enqueue(utcNow + dueTime);\n                _event.Set();\n            }\n        }\n\n        /// <summary>\n        /// Disposes of the underlying <see cref=\"Timer\"/> instance\n        /// </summary>\n        public void Dispose()\n        {\n            _pulseThread.StopSafely(TimeSpan.FromSeconds(1), _tokenSource);\n            _tokenSource.DisposeSafely();\n            _event.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SingleEntryDataCacheProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing Ionic.Zip;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Default implementation of the <see cref=\"IDataCacheProvider\"/>\n    /// Does not cache data.  If the data is a zip, the first entry is returned\n    /// </summary>\n    public class SingleEntryDataCacheProvider : IDataCacheProvider\n    {\n        private readonly IDataProvider _dataProvider;\n        private ZipFile _zipFile;\n        private Stream _zipFileStream;\n\n        /// <summary>\n        /// Property indicating the data is temporary in nature and should not be cached.\n        /// </summary>\n        public bool IsDataEphemeral { get; }\n\n        /// <summary>\n        /// Constructor that takes the <see cref=\"IDataProvider\"/> to be used to retrieve data\n        /// </summary>\n        public SingleEntryDataCacheProvider(IDataProvider dataProvider, bool isDataEphemeral = true)\n        {\n            _dataProvider = dataProvider;\n            IsDataEphemeral = isDataEphemeral;\n        }\n\n        /// <summary>\n        /// Fetch data from the cache\n        /// </summary>\n        /// <param name=\"key\">A string representing the key of the cached data</param>\n        /// <returns>An <see cref=\"Stream\"/> of the cached data</returns>\n        public Stream Fetch(string key)\n        {\n            LeanData.ParseKey(key, out var filePath, out var entryName);\n            var stream = _dataProvider.Fetch(filePath);\n\n            if (filePath.EndsWith(\".zip\") && stream != null)\n            {\n                // get the first entry from the zip file\n                try\n                {\n                    var entryStream = Compression.UnzipStream(stream, out _zipFile, entryName);\n\n                    // save the file stream so it can be disposed later\n                    _zipFileStream = stream;\n\n                    return entryStream;\n                }\n                catch (ZipException exception)\n                {\n                    Log.Error(\"SingleEntryDataCacheProvider.Fetch(): Corrupt file: \" + key + \" Error: \" + exception);\n                    stream.DisposeSafely();\n                    return null;\n                }\n            }\n\n            return stream;\n        }\n\n        /// <summary>\n        /// Not implemented\n        /// </summary>\n        /// <param name=\"key\">The source of the data, used as a key to retrieve data in the cache</param>\n        /// <param name=\"data\">The data to cache as a byte array</param>\n        public void Store(string key, byte[] data)\n        {\n            //\n        }\n\n        /// <summary>\n        /// Returns a list of zip entries in a provided zip file\n        /// </summary>\n        public List<string> GetZipEntries(string zipFile)\n        {\n            var stream = _dataProvider.Fetch(zipFile);\n            if (stream == null)\n            {\n                throw new ArgumentException($\"Failed to create source stream {zipFile}\");\n            }\n            var entryNames = Compression.GetZipEntryFileNames(stream).ToList();\n            stream.DisposeSafely();\n\n            return entryNames;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _zipFile?.DisposeSafely();\n            _zipFileStream?.DisposeSafely();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Subscription.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Represents the data required for a data feed to process a single subscription\n    /// </summary>\n    public class Subscription : IEnumerator<SubscriptionData>\n    {\n        private bool _removedFromUniverse;\n        private readonly IEnumerator<SubscriptionData> _enumerator;\n\n        /// <summary>\n        /// The subcription requests associated with this subscription\n        /// </summary>\n        internal List<SubscriptionRequest> SubscriptionRequests { get; private set; }\n\n        /// <summary>\n        /// Event fired when a new data point is available\n        /// </summary>\n        public event EventHandler NewDataAvailable;\n\n        /// <summary>\n        /// Gets the universe for this subscription\n        /// </summary>\n        public IEnumerable<Universe> Universes => SubscriptionRequests\n            .Where(x => x.Universe != null)\n            .Select(x => x.Universe);\n\n        /// <summary>\n        /// Gets the security this subscription points to\n        /// </summary>\n        public ISecurityPrice Security { get; init; }\n\n        /// <summary>\n        /// Gets the configuration for this subscritions\n        /// </summary>\n        public SubscriptionDataConfig Configuration { get; init; }\n\n        /// <summary>\n        /// Gets the exchange time zone associated with this subscription\n        /// </summary>\n        public DateTimeZone TimeZone { get; }\n\n        /// <summary>\n        /// Gets the offset provider for time zone conversions to and from the data's local time\n        /// </summary>\n        public TimeZoneOffsetProvider OffsetProvider { get; init; }\n\n        /// <summary>\n        /// Gets the most current value from the subscription source\n        /// </summary>\n        public decimal RealtimePrice { get; set; }\n\n        /// <summary>\n        /// Gets true if this subscription is finished, false otherwise\n        /// </summary>\n        public bool EndOfStream { get; private set; }\n\n        /// <summary>\n        /// Gets true if this subscription is used in universe selection\n        /// </summary>\n        public bool IsUniverseSelectionSubscription { get; }\n\n        /// <summary>\n        /// Gets the start time of this subscription in UTC\n        /// </summary>\n        public DateTime UtcStartTime { get; }\n\n        /// <summary>\n        /// Gets the end time of this subscription in UTC\n        /// </summary>\n        public DateTime UtcEndTime { get; }\n\n        /// <summary>\n        /// Gets whether or not this subscription has been removed from its parent universe\n        /// </summary>\n        public IReadOnlyRef<bool> RemovedFromUniverse { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Subscription\"/> class with a universe\n        /// </summary>\n        /// <param name=\"subscriptionRequest\">Specified for universe subscriptions</param>\n        /// <param name=\"enumerator\">The subscription's data source</param>\n        /// <param name=\"timeZoneOffsetProvider\">The offset provider used to convert data local times to utc</param>\n        public Subscription(\n            SubscriptionRequest subscriptionRequest,\n            IEnumerator<SubscriptionData> enumerator,\n            TimeZoneOffsetProvider timeZoneOffsetProvider)\n        {\n            SubscriptionRequests = new List<SubscriptionRequest> { subscriptionRequest };\n            _enumerator = enumerator;\n            Security = subscriptionRequest.Security;\n            IsUniverseSelectionSubscription = subscriptionRequest.IsUniverseSubscription;\n            Configuration = subscriptionRequest.Configuration;\n            OffsetProvider = timeZoneOffsetProvider;\n            TimeZone = subscriptionRequest.Security.Exchange.TimeZone;\n            UtcStartTime = subscriptionRequest.StartTimeUtc;\n            UtcEndTime = subscriptionRequest.EndTimeUtc;\n\n            RemovedFromUniverse = Ref.CreateReadOnly(() => _removedFromUniverse);\n        }\n\n        /// <summary>\n        /// Adds a <see cref=\"SubscriptionRequest\"/> for this subscription\n        /// </summary>\n        /// <param name=\"subscriptionRequest\">The <see cref=\"SubscriptionRequest\"/> to add</param>\n        public bool AddSubscriptionRequest(SubscriptionRequest subscriptionRequest)\n        {\n            if (IsUniverseSelectionSubscription\n                || subscriptionRequest.IsUniverseSubscription)\n            {\n                if (subscriptionRequest.Universe is UserDefinedUniverse)\n                {\n                    // for different reasons a user defined universe can trigger a subscription request, likes additions/removals\n                    return false;\n                }\n                throw new Exception(\"Subscription.AddSubscriptionRequest(): Universe selection\" +\n                    \" subscriptions should not have more than 1 SubscriptionRequest\");\n            }\n\n            // this shouldn't happen but just in case..\n            if (subscriptionRequest.Configuration != Configuration)\n            {\n                throw new Exception(\"Subscription.AddSubscriptionRequest(): Requesting to add\" +\n                    \"a different SubscriptionDataConfig\");\n            }\n\n            // Only allow one subscription request per universe\n            if (!Universes.Contains(subscriptionRequest.Universe))\n            {\n                SubscriptionRequests.Add(subscriptionRequest);\n                // TODO this might update the 'UtcStartTime' and 'UtcEndTime' of this subscription\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Removes one or all <see cref=\"SubscriptionRequest\"/> from this subscription\n        /// </summary>\n        /// <param name=\"universe\">Universe requesting to remove <see cref=\"SubscriptionRequest\"/>.\n        /// Default value, null, will remove all universes</param>\n        /// <returns>True, if the subscription is empty and ready to be removed</returns>\n        public bool RemoveSubscriptionRequest(Universe universe = null)\n        {\n            // TODO this might update the 'UtcStartTime' and 'UtcEndTime' of this subscription\n            IEnumerable<Universe> removedUniverses;\n            if (universe == null)\n            {\n                var subscriptionRequests = SubscriptionRequests;\n                SubscriptionRequests = new List<SubscriptionRequest>();\n                removedUniverses = subscriptionRequests.Where(x => x.Universe != null)\n                    .Select(x => x.Universe);\n            }\n            else\n            {\n                SubscriptionRequests.RemoveAll(x => x.Universe == universe);\n                removedUniverses = new[] {universe};\n            }\n\n            var emptySubscription = !SubscriptionRequests.Any();\n            if (emptySubscription)\n            {\n                // if the security is no longer a member of the universe, then mark the subscription properly\n                // universe may be null for internal currency conversion feeds\n                // TODO : Put currency feeds in their own internal universe\n                if (!removedUniverses.Any(x => x.Securities.ContainsKey(Configuration.Symbol)))\n                {\n                    MarkAsRemovedFromUniverse();\n                }\n            }\n\n            return emptySubscription;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public virtual bool MoveNext()\n        {\n            if (EndOfStream)\n            {\n                return false;\n            }\n\n            var moveNext = _enumerator.MoveNext();\n            EndOfStream = !moveNext;\n            Current = _enumerator.Current;\n            return moveNext;\n        }\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public void Reset()\n        {\n            _enumerator.Reset();\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>\n        /// The element in the collection at the current position of the enumerator.\n        /// </returns>\n        public SubscriptionData Current { get; private set; }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            EndOfStream = true;\n            _enumerator.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Mark this subscription as having been removed from the universe.\n        /// Data for this time step will be discarded.\n        /// </summary>\n        public void MarkAsRemovedFromUniverse()\n        {\n            _removedFromUniverse = true;\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return Configuration.GetHashCode();\n        }\n\n        /// <summary>Determines whether the specified object is equal to the current object.</summary>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        /// <returns>\n        /// <see langword=\"true\" /> if the specified object  is equal to the current object; otherwise, <see langword=\"false\" />.</returns>\n        public override bool Equals(object obj)\n        {\n            var subscription = obj as Subscription;\n            if (subscription == null)\n            {\n                return false;\n            }\n\n            return subscription.Configuration.Equals(Configuration);\n        }\n\n        /// <summary>Returns a string that represents the current object.</summary>\n        /// <returns>A string that represents the current object.</returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Configuration.ToString();\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NewDataAvailable\"/> event\n        /// </summary>\n        public void OnNewDataAvailable()\n        {\n            NewDataAvailable?.Invoke(this, EventArgs.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionCollection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides a collection for holding subscriptions.\n    /// </summary>\n    public class SubscriptionCollection : IEnumerable<Subscription>\n    {\n        private readonly ConcurrentDictionary<SubscriptionDataConfig, Subscription> _subscriptions;\n        private bool _sortingSubscriptionRequired;\n        private bool _frozen;\n        private readonly Ref<TimeSpan> _fillForwardResolution;\n\n        // some asset types (options, futures, crypto) have multiple subscriptions for different tick types,\n        // we keep a sorted list of subscriptions so we can return them in a deterministic order\n        private List<Subscription> _subscriptionsByTickType;\n\n        /// <summary>\n        /// Event fired when the fill forward resolution changes\n        /// </summary>\n        public event EventHandler<FillForwardResolutionChangedEvent> FillForwardResolutionChanged;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionCollection\"/> class\n        /// </summary>\n        public SubscriptionCollection()\n        {\n            _subscriptions = new ConcurrentDictionary<SubscriptionDataConfig, Subscription>();\n            _subscriptionsByTickType = new List<Subscription>();\n            var ffres = Time.OneMinute;\n            _fillForwardResolution = Ref.Create(() => ffres, res => ffres = res);\n        }\n\n        /// <summary>\n        /// Checks the collection for the specified subscription configuration\n        /// </summary>\n        /// <param name=\"configuration\">The subscription configuration to check for</param>\n        /// <returns>True if a subscription with the specified configuration is found in this collection, false otherwise</returns>\n        public bool Contains(SubscriptionDataConfig configuration)\n        {\n            return _subscriptions.ContainsKey(configuration);\n        }\n\n        /// <summary>\n        /// Attempts to add the specified subscription to the collection. If another subscription\n        /// exists with the same configuration then it won't be added.\n        /// </summary>\n        /// <param name=\"subscription\">The subscription to add</param>\n        /// <returns>True if the subscription is successfully added, false otherwise</returns>\n        public bool TryAdd(Subscription subscription)\n        {\n            if (_subscriptions.TryAdd(subscription.Configuration, subscription))\n            {\n                UpdateFillForwardResolution(FillForwardResolutionOperation.AfterAdd, subscription.Configuration);\n                _sortingSubscriptionRequired = true;\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Attempts to retrieve the subscription with the specified configuration\n        /// </summary>\n        /// <param name=\"configuration\">The subscription's configuration</param>\n        /// <param name=\"subscription\">The subscription matching the configuration, null if not found</param>\n        /// <returns>True if the subscription is successfully retrieved, false otherwise</returns>\n        public bool TryGetValue(SubscriptionDataConfig configuration, out Subscription subscription)\n        {\n            return _subscriptions.TryGetValue(configuration, out subscription);\n        }\n\n        /// <summary>\n        /// Attempts to remove the subscription with the specified configuraton from the collection.\n        /// </summary>\n        /// <param name=\"configuration\">The configuration of the subscription to remove</param>\n        /// <param name=\"subscription\">The removed subscription, null if not found.</param>\n        /// <returns>True if the subscription is successfully removed, false otherwise</returns>\n        public bool TryRemove(SubscriptionDataConfig configuration, out Subscription subscription)\n        {\n            if (_subscriptions.TryRemove(configuration, out subscription))\n            {\n                // for user friendlyness only look at removals triggerd by the user not those that are due to a data feed ending because of no more data,\n                // let's try to respect the users original FF enumerator request\n                if (!subscription.EndOfStream)\n                {\n                    UpdateFillForwardResolution(FillForwardResolutionOperation.AfterRemove, configuration);\n                }\n                _sortingSubscriptionRequired = true;\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// An enumerator that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<Subscription> GetEnumerator()\n        {\n            SortSubscriptions();\n            return _subscriptionsByTickType.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets and updates the fill forward resolution by checking specified subscription configurations and\n        /// selecting the smallest resoluton not equal to tick\n        /// </summary>\n        public Ref<TimeSpan> UpdateAndGetFillForwardResolution(SubscriptionDataConfig configuration = null)\n        {\n            if (configuration != null)\n            {\n                UpdateFillForwardResolution(FillForwardResolutionOperation.BeforeAdd, configuration);\n            }\n            return _fillForwardResolution;\n        }\n\n        /// <summary>\n        /// Will disable or enable fill forward resolution updates\n        /// </summary>\n        public void FreezeFillForwardResolution(bool freeze)\n        {\n            _frozen = freeze;\n        }\n\n        /// <summary>\n        /// Helper method to validate a configuration to be included in the fill forward calculation\n        /// </summary>\n        private static bool ValidateFillForwardResolution(SubscriptionDataConfig configuration)\n        {\n            return !configuration.IsInternalFeed && configuration.Resolution != Resolution.Tick;\n        }\n        /// <summary>\n        /// Gets and updates the fill forward resolution by checking specified subscription configurations and\n        /// selecting the smallest resoluton not equal to tick\n        /// </summary>\n        private void UpdateFillForwardResolution(FillForwardResolutionOperation operation, SubscriptionDataConfig configuration)\n        {\n            if(_frozen)\n            {\n                return;\n            }\n\n            // Due to performance implications let's be jealous in updating the _fillForwardResolution\n            if (ValidateFillForwardResolution(configuration) &&\n                (\n                    ((FillForwardResolutionOperation.BeforeAdd == operation || FillForwardResolutionOperation.AfterAdd == operation)\n                     && configuration.Increment != _fillForwardResolution.Value) // check if the new Increment is different\n                ||\n                    (operation == FillForwardResolutionOperation.AfterRemove // We are removing\n                    && configuration.Increment == _fillForwardResolution.Value // True: We are removing the resolution we were using\n                    // False: there is at least another one equal, no need to update, but we only look at those valid configuration which are the ones which set the FF resolution\n                    && _subscriptions.Keys.All(x => !ValidateFillForwardResolution(x) || x.Resolution != configuration.Resolution)))\n                )\n            {\n                var configurations = (operation == FillForwardResolutionOperation.BeforeAdd)\n                    ? _subscriptions.Keys.Concat(new[] { configuration }) : _subscriptions.Keys;\n\n                var eventArgs = new FillForwardResolutionChangedEvent { Old = _fillForwardResolution.Value };\n                _fillForwardResolution.Value = configurations.Where(ValidateFillForwardResolution)\n                                                             .Select(x => x.Resolution)\n                                                             .Distinct()\n                                                             .DefaultIfEmpty(Resolution.Minute)\n                                                             .Min().ToTimeSpan();\n                if (_fillForwardResolution.Value != eventArgs.Old)\n                {\n                    eventArgs.New = _fillForwardResolution.Value;\n                    // notify consumers if any\n                    FillForwardResolutionChanged?.Invoke(this, eventArgs);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sorts subscriptions so that equity subscriptions are enumerated before option\n        /// securities to ensure the underlying data is available when we process the options data\n        /// </summary>\n        private void SortSubscriptions()\n        {\n            if (_sortingSubscriptionRequired)\n            {\n                _sortingSubscriptionRequired = false;\n                // it's important that we enumerate underlying securities before derivatives to this end,\n                // we order by security type so that equity subscriptions are enumerated before option\n                // securities to ensure the underlying data is available when we process the options data\n                _subscriptionsByTickType = _subscriptions\n                    .Select(x => x.Value)\n                    .OrderBy(x => x.Configuration.SecurityType)\n                    .ThenBy(x => x.Configuration.TickType)\n                    .ThenBy(x => x.Configuration.Symbol)\n                    .ToList();\n            }\n        }\n\n        private enum FillForwardResolutionOperation\n        {\n            AfterRemove,\n            BeforeAdd,\n            AfterAdd\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Store data (either raw or adjusted) and the time at which it should be synchronized\n    /// </summary>\n    public class SubscriptionData\n    {\n        /// <summary>\n        /// Data\n        /// </summary>\n        protected BaseData _data { get; set; }\n\n        /// <summary>\n        /// Gets the data\n        /// </summary>\n        public virtual BaseData Data => _data;\n\n        /// <summary>\n        /// Gets the UTC emit time for this data\n        /// </summary>\n        public DateTime EmitTimeUtc { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionData\"/> class\n        /// </summary>\n        /// <param name=\"data\">The base data</param>\n        /// <param name=\"emitTimeUtc\">The emit time for the data</param>\n        public SubscriptionData(BaseData data, DateTime emitTimeUtc)\n        {\n            _data = data;\n            EmitTimeUtc = emitTimeUtc;\n        }\n\n        /// <summary>\n        /// Clones the data, computes the utc emit time and performs exchange round down behavior, storing the result in a new <see cref=\"SubscriptionData\"/> instance\n        /// </summary>\n        /// <param name=\"configuration\">The subscription's configuration</param>\n        /// <param name=\"exchangeHours\">The exchange hours of the security</param>\n        /// <param name=\"offsetProvider\">The subscription's offset provider</param>\n        /// <param name=\"data\">The data being emitted</param>\n        /// <param name=\"normalizationMode\">Specifies how data is normalized</param>\n        /// <param name=\"factor\">price scale factor</param>\n        /// <returns>A new <see cref=\"SubscriptionData\"/> containing the specified data</returns>\n        public static SubscriptionData Create(bool dailyStrictEndTimeEnabled, SubscriptionDataConfig configuration, SecurityExchangeHours exchangeHours, TimeZoneOffsetProvider offsetProvider, BaseData data, DataNormalizationMode normalizationMode, decimal? factor = null)\n        {\n            if (data == null)\n            {\n                return null;\n            }\n\n            data = data.Clone(data.IsFillForward);\n            var emitTimeUtc = offsetProvider.ConvertToUtc(data.EndTime);\n            // during warmup, data might be emitted with a different span based on the warmup resolution, so let's get the actual bar span here\n            var barSpan = data.EndTime - data.Time;\n            // rounding down does not make sense for daily increments using strict end times\n            if (!LeanData.UseDailyStrictEndTimes(dailyStrictEndTimeEnabled, configuration.Type, configuration.Symbol, barSpan, exchangeHours))\n            {\n                // Let's round down for any data source that implements a time delta between\n                // the start of the data and end of the data (usually used with Bars).\n                // The time delta ensures that the time collected from `EndTime` has\n                // no look-ahead bias, and is point-in-time.\n                // When fill forwarding time and endtime might not respect the original ends times, here we will enforce it\n                // note we do this after fetching the 'emitTimeUtc' which should use the end time set by the fill forward enumerator\n                if (barSpan != TimeSpan.Zero)\n                {\n                    if (barSpan != configuration.Increment)\n                    {\n                        // when we detect a difference let's refetch the span in utc using noda time 'ConvertToUtc' that will not take into account day light savings difference\n                        // we don't do this always above because it's expensive, only do it if we need to.\n                        // Behavior asserted by tests 'FillsForwardBarsAroundDaylightMovementForDifferentResolutions_Algorithm' && 'ConvertToUtcAndDayLightSavings'.\n                        // Note: we don't use 'configuration.Increment' because during warmup, if the warmup resolution is set, we will emit data respecting it instead of the 'configuration'\n                        barSpan = data.EndTime.ConvertToUtc(configuration.ExchangeTimeZone) - data.Time.ConvertToUtc(configuration.ExchangeTimeZone);\n                    }\n                    data.Time = data.Time.ExchangeRoundDownInTimeZone(barSpan, exchangeHours, configuration.DataTimeZone, configuration.ExtendedMarketHours);\n                }\n            }\n            else if (data.IsFillForward)\n            {\n                // we need to adjust the time for a strict end time daily bar:\n                // If this is fill-forwarded with a lower resolution, the daily calendar for data.Time will be for the previous date\n                // (which is correct, since the last daily bar belongs to the previous date).\n                // If this is a fill-forwarded complete daily bar (ending at market close),\n                // the daily calendar will have the same time/end time so the bar times will not be adjusted.\n                // TODO: What about extended market hours? How to handle non-adjacent market hour segments in a day? Same in FillForwardEnumerator\n                var calendar = LeanData.GetDailyCalendar(data.Time, exchangeHours, false);\n                data.Time = calendar.Start;\n                data.EndTime = calendar.End;\n            }\n\n            if (factor.HasValue && (configuration.SecurityType != SecurityType.Equity || (factor.Value != 1 || configuration.SumOfDividends != 0)))\n            {\n                var normalizedData = data.Clone(data.IsFillForward).Normalize(factor.Value, normalizationMode, configuration.SumOfDividends);\n\n                return new PrecalculatedSubscriptionData(configuration, data, normalizedData, normalizationMode, emitTimeUtc);\n            }\n\n            return new SubscriptionData(data, emitTimeUtc);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionDataReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing System.Collections;\nusing System.Globalization;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Custom.Tiingo;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Subscription data reader is a wrapper on the stream reader class to download, unpack and iterate over a data file.\n    /// </summary>\n    /// <remarks>The class accepts any subscription configuration and automatically makes it available to enumerate</remarks>\n    public class SubscriptionDataReader : IEnumerator<BaseData>, ITradableDatesNotifier, IDataProviderEvents\n    {\n        private IDataProvider _dataProvider;\n        private IObjectStore _objectStore;\n        private bool _initialized;\n\n        // Source string to create memory stream:\n        private SubscriptionDataSource _source;\n\n        private bool _endOfStream;\n\n        private IEnumerator<BaseData> _subscriptionFactoryEnumerator;\n\n        /// Configuration of the data-reader:\n        private readonly SubscriptionDataConfig _config;\n\n        /// true if we can find a scale factor file for the security of the form: ..\\Lean\\Data\\equity\\market\\factor_files\\{SYMBOL}.csv\n        private bool _hasScaleFactors;\n\n        // Location of the datafeed - the type of this data.\n\n        // Create a single instance to invoke all Type Methods:\n        private BaseData _dataFactory;\n\n        //Start finish times of the backtest:\n        private DateTime _periodStart;\n        private readonly DateTime _periodFinish;\n\n        private readonly IMapFileProvider _mapFileProvider;\n        private readonly IFactorFileProvider _factorFileProvider;\n        private IFactorProvider _factorFile;\n        private MapFile _mapFile;\n\n        private bool _pastDelistedDate;\n\n        private BaseData _previous;\n        private decimal? _lastRawPrice;\n        private DateChangeTimeKeeper _timeKeeper;\n        private readonly IEnumerable<DateTime> _tradableDatesInDataTimeZone;\n        private readonly SecurityExchangeHours _exchangeHours;\n\n        // used when emitting aux data from within while loop\n        private readonly IDataCacheProvider _dataCacheProvider;\n        private DateTime _delistingDate;\n\n        private bool _updatingDataEnumerator;\n\n        /// <summary>\n        /// Event fired when an invalid configuration has been detected\n        /// </summary>\n        public event EventHandler<InvalidConfigurationDetectedEventArgs> InvalidConfigurationDetected;\n\n        /// <summary>\n        /// Event fired when the numerical precision in the factor file has been limited\n        /// </summary>\n        public event EventHandler<NumericalPrecisionLimitedEventArgs> NumericalPrecisionLimited;\n\n        /// <summary>\n        /// Event fired when the start date has been limited\n        /// </summary>\n        public event EventHandler<StartDateLimitedEventArgs> StartDateLimited;\n\n        /// <summary>\n        /// Event fired when there was an error downloading a remote file\n        /// </summary>\n        public event EventHandler<DownloadFailedEventArgs> DownloadFailed;\n\n        /// <summary>\n        /// Event fired when there was an error reading the data\n        /// </summary>\n        public event EventHandler<ReaderErrorDetectedEventArgs> ReaderErrorDetected;\n\n        /// <summary>\n        /// Event fired when there is a new tradable date\n        /// </summary>\n        public event EventHandler<NewTradableDateEventArgs> NewTradableDate;\n\n        /// <summary>\n        /// Last read BaseData object from this type and source\n        /// </summary>\n        public BaseData Current\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Explicit Interface Implementation for Current\n        /// </summary>\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        /// <summary>\n        /// Subscription data reader takes a subscription request, loads the type, accepts the data source and enumerate on the results.\n        /// </summary>\n        /// <param name=\"config\">Subscription configuration object</param>\n        /// <param name=\"dataRequest\">The data request</param>\n        /// <param name=\"mapFileProvider\">Used for resolving the correct map files</param>\n        /// <param name=\"factorFileProvider\">Used for getting factor files</param>\n        /// <param name=\"dataCacheProvider\">Used for caching files</param>\n        /// <param name=\"dataProvider\">The data provider to use</param>\n        public SubscriptionDataReader(SubscriptionDataConfig config,\n            BaseDataRequest dataRequest,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataCacheProvider dataCacheProvider,\n            IDataProvider dataProvider,\n            IObjectStore objectStore)\n        {\n            //Save configuration of data-subscription:\n            _config = config;\n\n            //Save Start and End Dates:\n            _periodStart = dataRequest.StartTimeLocal;\n            _periodFinish = dataRequest.EndTimeLocal;\n            _mapFileProvider = mapFileProvider;\n            _factorFileProvider = factorFileProvider;\n            _dataCacheProvider = dataCacheProvider;\n\n            _dataProvider = dataProvider;\n            _objectStore = objectStore;\n\n            _tradableDatesInDataTimeZone = dataRequest.TradableDaysInDataTimeZone;\n            _exchangeHours = dataRequest.ExchangeHours;\n        }\n\n        /// <summary>\n        /// Initializes the <see cref=\"SubscriptionDataReader\"/> instance\n        /// </summary>\n        /// <remarks>Should be called after all consumers of <see cref=\"NewTradableDate\"/> event are set,\n        /// since it will produce events.</remarks>\n        public void Initialize()\n        {\n            if (_initialized)\n            {\n                return;\n            }\n\n            //Save the type of data we'll be getting from the source.\n            try\n            {\n                _dataFactory = _config.GetBaseDataInstance();\n            }\n            catch (ArgumentException exception)\n            {\n                OnInvalidConfigurationDetected(new InvalidConfigurationDetectedEventArgs(_config.Symbol, exception.Message));\n                _endOfStream = true;\n                return;\n            }\n\n            // If Tiingo data, set the access token in data factory\n            var tiingo = _dataFactory as TiingoPrice;\n            if (tiingo != null)\n            {\n                if (!Tiingo.IsAuthCodeSet)\n                {\n                    Tiingo.SetAuthCode(Config.Get(\"tiingo-auth-token\"));\n                }\n            }\n\n            // load up the map files for equities, options, and custom data if it supports it.\n            // Only load up factor files for equities\n            if (_dataFactory.RequiresMapping())\n            {\n                try\n                {\n                    var mapFile = _mapFileProvider.ResolveMapFile(_config);\n\n                    // only take the resolved map file if it has data, otherwise we'll use the empty one we defined above\n                    if (mapFile.Any()) _mapFile = mapFile;\n\n                    if (_config.PricesShouldBeScaled())\n                    {\n                        var factorFile = _factorFileProvider.Get(_config.Symbol);\n                        _hasScaleFactors = factorFile != null;\n                        if (_hasScaleFactors)\n                        {\n                            _factorFile = factorFile;\n\n                            // if factor file has minimum date, update start period if before minimum date\n                            if (_factorFile != null && _factorFile.FactorFileMinimumDate.HasValue)\n                            {\n                                if (_periodStart < _factorFile.FactorFileMinimumDate.Value)\n                                {\n                                    _periodStart = _factorFile.FactorFileMinimumDate.Value;\n\n                                    OnNumericalPrecisionLimited(\n                                        new NumericalPrecisionLimitedEventArgs(_config.Symbol,\n                                            $\"[{_config.Symbol.Value}, {_factorFile.FactorFileMinimumDate.Value.ToShortDateString()}]\"));\n                                }\n                            }\n                        }\n\n                        if (_periodStart < mapFile.FirstDate)\n                        {\n                            _periodStart = mapFile.FirstDate;\n\n                            OnStartDateLimited(\n                                new StartDateLimitedEventArgs(_config.Symbol,\n                                    $\"[{_config.Symbol.Value},\" +\n                                    $\" {mapFile.FirstDate.ToString(\"yyyy-MM-dd\", CultureInfo.InvariantCulture)}]\"));\n                        }\n                    }\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err, \"Fetching Price/Map Factors: \" + _config.Symbol.ID + \": \");\n                }\n            }\n\n            _factorFile ??= _config.Symbol.GetEmptyFactorFile();\n            _mapFile ??= new MapFile(_config.Symbol.Value, Enumerable.Empty<MapFileRow>());\n\n            _delistingDate = _config.Symbol.GetDelistingDate(_mapFile);\n\n            _timeKeeper = new DateChangeTimeKeeper(_tradableDatesInDataTimeZone, _config, _exchangeHours, _delistingDate);\n            _timeKeeper.NewExchangeDate += HandleNewTradableDate;\n\n            // we now have the map file associated and the delisting date. In some cases during warm up,\n            // the non warmup enumerator does not make sense cause the asset got delisted already\n            _endOfStream = _periodStart.Date > _delistingDate;\n            if (!_endOfStream)\n            {\n                UpdateDataEnumerator(true);\n            }\n            _initialized = true;\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns>\n        /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n        /// </returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n        public bool MoveNext()\n        {\n            if (!_initialized)\n            {\n                // Late initialization so it is performed in the data feed stack\n                // and not in the algorithm thread\n                Initialize();\n            }\n\n            if (_endOfStream)\n            {\n                return false;\n            }\n\n            if (Current != null)\n            {\n                // only save previous price data\n                _previous = Current;\n            }\n\n            if (_subscriptionFactoryEnumerator == null)\n            {\n                _endOfStream = true;\n                return false;\n            }\n\n            do\n            {\n                if (_pastDelistedDate)\n                {\n                    break;\n                }\n\n                // keep enumerating until we find something that is within our time frame\n                while (_subscriptionFactoryEnumerator.MoveNext())\n                {\n                    var instance = _subscriptionFactoryEnumerator.Current;\n                    if (instance == null)\n                    {\n                        // keep reading until we get valid data\n                        continue;\n                    }\n\n                    // We rely on symbol change to detect a mapping or symbol change, instead of using SubscriptionDataConfig.NewSymbol\n                    // because only one of the configs with the same symbol will trigger a symbol change event.\n                    var previousMappedSymbol = _config.MappedSymbol;\n\n                    // Advance the time keeper either until the current instance time (to synchronize) or until the source changes.\n                    // Note: use time instead of end time to avoid skipping instances that all have the same timestamps in the same file (e.g. universe data)\n                    var currentSource = _source;\n                    var nextExchangeDate = _config.Resolution == Resolution.Daily\n                        && _timeKeeper.IsExchangeBehindData()\n                        && !_config.Type.IsAssignableTo(typeof(BaseDataCollection))\n                        // If daily and exchange is behind data, data for date X will have a start time within date X-1,\n                        // so we use the actual date from end time. e.g. a daily bar for Jan15 can have a start time of Jan14 8PM\n                        // (exchange tz 4 hours behind data tz) and end time would be Jan15 8PM.\n                        // This doesn't apply to universe files (BaseDataCollection check) because they are not read in the same way\n                        // price daily files are read: they are read in a collection with end time of X+1. We don't want to skip them or advance time yet.\n                        ? instance.EndTime\n                        : instance.Time;\n                    while (_timeKeeper.ExchangeTime < nextExchangeDate && currentSource == _source)\n                    {\n                        _timeKeeper.AdvanceTowardsExchangeTime(nextExchangeDate);\n                    }\n\n                    // Source change, check if we should emit the current instance\n                    if (currentSource != _source\n                        && (\n                            // After a mapping for every resolution except daily:\n                            // For other resolutions, the instance that triggered the exchange date change should be skipped,\n                            // it's end time will be either midnight or for a future date. The new source might have a data point with this times.\n                            (_config.MappedSymbol != previousMappedSymbol && _config.Resolution != Resolution.Daily)\n                            // Skip if the exchange time zone is behind of the data time zone:\n                            // The new source might have data for these same times, we want data for the new symbol\n                            || (_config.Resolution == Resolution.Daily && _timeKeeper.IsExchangeBehindData())\n                            // skip if the instance if it's beyond what the previous source should have.\n                            // e.g. A file mistakenly has data for the next day\n                            // (see SubscriptionDataReaderTests.DoesNotEmitDataBeyondTradableDate unit test)\n                            // or the instance that triggered the exchange date change is for a future date (no data found in between)\n                            || instance.EndTime.ConvertTo(_config.ExchangeTimeZone, _config.DataTimeZone).Date >= _timeKeeper.DataTime.Date\n                        ))\n                    {\n                        continue;\n                    }\n\n                    // This can happen after a mapping, we already have data but we need to skip some points that belong to a previous date.\n                    if (Current != null && instance.EndTime < _timeKeeper.ExchangeTime)\n                    {\n                        continue;\n                    }\n\n                    // prevent emitting past data, this can happen when switching symbols on daily data\n                    if (_previous != null && _config.Resolution != Resolution.Tick)\n                    {\n                        if (_config.IsCustomData)\n                        {\n                            // Skip the point if time went backwards for custom data?\n                            // TODO: Should this be the case for all datapoints?\n                            if (instance.EndTime < _previous.EndTime) continue;\n                        }\n                        else\n                        {\n                            // all other resolutions don't allow duplicate end times\n                            if (instance.EndTime <= _previous.EndTime) continue;\n                        }\n                    }\n\n                    if (instance.EndTime < _periodStart)\n                    {\n                        // keep reading until we get a value on or after the start\n                        _previous = instance;\n                        continue;\n                    }\n\n                    // We have to perform this check after refreshing the enumerator, if appropriate\n                    // 'instance' could be a data point far in the future due to remapping (GH issue 5232) in which case it will be dropped\n                    if (instance.Time > _periodFinish)\n                    {\n                        // stop reading when we get a value after the end\n                        _endOfStream = true;\n                        return false;\n                    }\n\n                    // we've made it past all of our filters, we're withing the requested start/end of the subscription,\n                    // we've satisfied user and market hour filters, so this data is good to go as current\n                    Current = instance;\n\n                    // we keep the last raw price registered before we return so we are not affected by anyone (price scale) modifying our current\n                    _lastRawPrice = Current.Price;\n                    return true;\n                }\n\n                // we've ended the enumerator, time to refresh\n                UpdateDataEnumerator(true);\n            }\n            while (_subscriptionFactoryEnumerator != null);\n\n            _endOfStream = true;\n            return false;\n        }\n\n        /// <summary>\n        /// Emits a new tradable date event and tries to update the data enumerator if necessary\n        /// </summary>\n        private void HandleNewTradableDate(object sender, DateTime date)\n        {\n            OnNewTradableDate(new NewTradableDateEventArgs(date, _previous, _config.Symbol, _lastRawPrice));\n            UpdateDataEnumerator(false);\n        }\n\n        /// <summary>\n        /// Resolves the next enumerator to be used in <see cref=\"MoveNext\"/> and updates\n        /// <see cref=\"_subscriptionFactoryEnumerator\"/>\n        /// </summary>\n        /// <returns>True, if the enumerator has been updated (even if updated to null)</returns>\n        private bool UpdateDataEnumerator(bool endOfEnumerator)\n        {\n            // Guard for infinite recursion: during an enumerator update, we might ask for a new date,\n            // which might end up with a new exchange date being detected and another update being requested.\n            // Just skip that update and let's do it ourselves after the date is resolved\n            if (_updatingDataEnumerator)\n            {\n                return false;\n            }\n\n            _updatingDataEnumerator = true;\n            try\n            {\n                do\n                {\n                    var date = _timeKeeper.DataTime.Date;\n\n                    // Update current date only if the enumerator has ended, else we might just need to change files\n                    // (e.g. same date, but symbol was mapped)\n                    if (endOfEnumerator && !TryGetNextDate(out date))\n                    {\n                        _subscriptionFactoryEnumerator = null;\n                        // if we run out of dates then we're finished with this subscription\n                        return true;\n                    }\n\n                    // fetch the new source, using the data time zone for the date\n                    var newSource = _dataFactory.GetSource(_config, date, false);\n                    if (newSource == null)\n                    {\n                        // move to the next day\n                        continue;\n                    }\n\n                    // check if we should create a new subscription factory\n                    var sourceChanged = _source != newSource && !string.IsNullOrEmpty(newSource.Source);\n                    if (sourceChanged)\n                    {\n                        // dispose of the current enumerator before creating a new one\n                        _subscriptionFactoryEnumerator.DisposeSafely();\n\n                        // save off for comparison next time\n                        _source = newSource;\n                        var subscriptionFactory = CreateSubscriptionFactory(newSource, _dataFactory, _dataProvider);\n                        _subscriptionFactoryEnumerator = SortEnumerator<DateTime>.TryWrapSortEnumerator(newSource.Sort, subscriptionFactory.Read(newSource));\n                        return true;\n                    }\n\n                    // if there's still more in the enumerator and we received the same source from the GetSource call\n                    // above, then just keep using the same enumerator as we were before\n                    if (!endOfEnumerator) // && !sourceChanged is always true here\n                    {\n                        return false;\n                    }\n\n                    // keep churning until we find a new source or run out of tradeable dates\n                    // in live mode tradeable dates won't advance beyond today's date, but\n                    // TryGetNextDate will return false if it's already at today\n                }\n                while (true);\n            }\n            finally\n            {\n                _updatingDataEnumerator = false;\n            }\n        }\n\n        private ISubscriptionDataSourceReader CreateSubscriptionFactory(SubscriptionDataSource source, BaseData baseDataInstance, IDataProvider dataProvider)\n        {\n            var factory = SubscriptionDataSourceReader.ForSource(source, _dataCacheProvider, _config, _timeKeeper.DataTime.Date, false, baseDataInstance, dataProvider, _objectStore);\n            AttachEventHandlers(factory, source);\n            return factory;\n        }\n\n        private void AttachEventHandlers(ISubscriptionDataSourceReader dataSourceReader, SubscriptionDataSource source)\n        {\n            dataSourceReader.InvalidSource += (sender, args) =>\n            {\n                if (_config.IsCustomData && !_config.Type.GetBaseDataInstance().IsSparseData())\n                {\n                    OnDownloadFailed(\n                        new DownloadFailedEventArgs(_config.Symbol,\n                            \"We could not fetch the requested data. \" +\n                            \"This may not be valid data, or a failed download of custom data. \" +\n                            $\"Skipping source ({args.Source.Source}).\"));\n                    return;\n                }\n\n                switch (args.Source.TransportMedium)\n                {\n                    case SubscriptionTransportMedium.LocalFile:\n                        // the local uri doesn't exist, write an error and return null so we we don't try to get data for today\n                        // Log.Trace(string.Format(\"SubscriptionDataReader.GetReader(): Could not find QC Data, skipped: {0}\", source));\n                        break;\n\n                    case SubscriptionTransportMedium.RemoteFile:\n                        OnDownloadFailed(\n                            new DownloadFailedEventArgs(_config.Symbol,\n                                $\"Error downloading custom data source file, skipped: {source} \" +\n                                $\"Error: {args.Exception.Message}\", args.Exception.StackTrace));\n                        break;\n\n                    case SubscriptionTransportMedium.Rest:\n                        break;\n\n                    case SubscriptionTransportMedium.ObjectStore:\n                        break;\n\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n            };\n\n            if (dataSourceReader is TextSubscriptionDataSourceReader)\n            {\n                // handle empty files/instantiation errors\n                var textSubscriptionFactory = (TextSubscriptionDataSourceReader)dataSourceReader;\n                // handle parser errors\n                textSubscriptionFactory.ReaderError += (sender, args) =>\n                {\n                    OnReaderErrorDetected(\n                        new ReaderErrorDetectedEventArgs(_config.Symbol,\n                            $\"Error invoking {_config.Symbol} data reader. \" +\n                            $\"Line: {args.Line} Error: {args.Exception.Message}\",\n                            args.Exception.StackTrace));\n                };\n            }\n        }\n\n        /// <summary>\n        /// Iterates the tradeable dates enumerator\n        /// </summary>\n        /// <param name=\"date\">The next tradeable date</param>\n        /// <returns>True if we got a new date from the enumerator, false if it's exhausted, or in live mode if we're already at today</returns>\n        private bool TryGetNextDate(out DateTime date)\n        {\n            while (_timeKeeper.TryAdvanceUntilNextDataDate())\n            {\n                date = _timeKeeper.DataTime.Date;\n\n                if (!_mapFile.HasData(date))\n                {\n                    continue;\n                }\n\n                // don't do other checks if we haven't gotten data for this date yet\n                if (_previous != null && _previous.EndTime.ConvertTo(_config.ExchangeTimeZone, _config.DataTimeZone) > date)\n                {\n                    continue;\n                }\n\n                // we've passed initial checks,now go get data for this date!\n                return true;\n            }\n\n            if (_timeKeeper.ExchangeTime.Date > _delistingDate)\n            {\n                _pastDelistedDate = true;\n            }\n\n            // no more tradeable dates, we've exhausted the enumerator\n            date = DateTime.MaxValue.Date;\n            return false;\n        }\n\n        /// <summary>\n        /// Reset the IEnumeration\n        /// </summary>\n        /// <remarks>Not used</remarks>\n        public void Reset()\n        {\n            throw new NotImplementedException(\"Reset method not implemented. Assumes loop will only be used once.\");\n        }\n\n        /// <summary>\n        /// Dispose of the Stream Reader and close out the source stream and file connections.\n        /// </summary>\n        public void Dispose()\n        {\n            _subscriptionFactoryEnumerator.DisposeSafely();\n\n            if (_initialized)\n            {\n                _timeKeeper.NewExchangeDate -= HandleNewTradableDate;\n                _timeKeeper.DisposeSafely();\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"InvalidConfigurationDetected\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"InvalidConfigurationDetected\"/> event</param>\n        protected virtual void OnInvalidConfigurationDetected(InvalidConfigurationDetectedEventArgs e)\n        {\n            InvalidConfigurationDetected?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NumericalPrecisionLimited\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"NumericalPrecisionLimited\"/> event</param>\n        protected virtual void OnNumericalPrecisionLimited(NumericalPrecisionLimitedEventArgs e)\n        {\n            NumericalPrecisionLimited?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"StartDateLimited\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"StartDateLimited\"/> event</param>\n        protected virtual void OnStartDateLimited(StartDateLimitedEventArgs e)\n        {\n            StartDateLimited?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"DownloadFailed\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"DownloadFailed\"/> event</param>\n        protected virtual void OnDownloadFailed(DownloadFailedEventArgs e)\n        {\n            DownloadFailed?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ReaderErrorDetected\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"ReaderErrorDetected\"/> event</param>\n        protected virtual void OnReaderErrorDetected(ReaderErrorDetectedEventArgs e)\n        {\n            ReaderErrorDetected?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"NewTradableDate\"/> event\n        /// </summary>\n        /// <param name=\"e\">Event arguments for the <see cref=\"NewTradableDate\"/> event</param>\n        protected virtual void OnNewTradableDate(NewTradableDateEventArgs e)\n        {\n            NewTradableDate?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides a factory method for creating <see cref=\"ISubscriptionDataSourceReader\"/> instances\n    /// </summary>\n    public static class SubscriptionDataSourceReader\n    {\n        private static readonly bool ShowMissingDataLogs = Config.GetBool(\"show-missing-data-logs\", false);\n\n        /// <summary>\n        /// Creates a new <see cref=\"ISubscriptionDataSourceReader\"/> capable of handling the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The subscription data source to create a factory for</param>\n        /// <param name=\"dataCacheProvider\">Used to cache data</param>\n        /// <param name=\"config\">The configuration of the subscription</param>\n        /// <param name=\"date\">The date to be processed</param>\n        /// <param name=\"isLiveMode\">True for live mode, false otherwise</param>\n        /// <param name=\"factory\">The base data instance factory</param>\n        /// <param name=\"dataProvider\">The data provider to use</param>\n        /// <returns>A new <see cref=\"ISubscriptionDataSourceReader\"/> that can read the specified <paramref name=\"source\"/></returns>\n        public static ISubscriptionDataSourceReader ForSource(SubscriptionDataSource source, IDataCacheProvider dataCacheProvider, SubscriptionDataConfig config, DateTime date, bool isLiveMode, BaseData factory, IDataProvider dataProvider, IObjectStore objectStore)\n        {\n            ISubscriptionDataSourceReader reader;\n            switch (source.Format)\n            {\n                case FileFormat.Csv:\n                    reader = new TextSubscriptionDataSourceReader(dataCacheProvider, config, date, isLiveMode, objectStore);\n                    break;\n\n                case FileFormat.UnfoldingCollection:\n                    reader = new CollectionSubscriptionDataSourceReader(dataCacheProvider, config, date, isLiveMode, objectStore);\n                    break;\n\n                case FileFormat.ZipEntryName:\n                    reader = new ZipEntryNameSubscriptionDataSourceReader(dataCacheProvider, config, date, isLiveMode);\n                    break;\n\n                case FileFormat.Index:\n                    return new IndexSubscriptionDataSourceReader(dataCacheProvider, config, date, isLiveMode, dataProvider, objectStore);\n\n                case FileFormat.FoldingCollection:\n                    reader = new BaseDataCollectionAggregatorReader(dataCacheProvider, config, date, isLiveMode, objectStore);\n                    break;\n\n                default:\n                    throw new NotImplementedException(\"SubscriptionFactory.ForSource(\" + source + \") has not been implemented yet.\");\n            }\n\n            // wire up event handlers for logging missing files\n            if (ShowMissingDataLogs && source.TransportMedium == SubscriptionTransportMedium.LocalFile)\n            {\n                if (!factory.IsSparseData())\n                {\n                    reader.InvalidSource += (sender, args) => Log.Error($\"SubscriptionDataSourceReader.InvalidSource(): File not found: {args.Source.Source}\");\n                }\n            }\n\n            return reader;\n        }\n\n        /// <summary>\n        /// Creates cache directory if not existing and deletes old files from the cache\n        /// </summary>\n        public static void CheckRemoteFileCache()\n        {\n            // create cache directory if not existing\n            if (!Directory.Exists(Globals.Cache)) Directory.CreateDirectory(Globals.Cache);\n\n            var frontierToDelete = DateTime.Now.AddHours(-24);\n            // clean old files out of the cache\n            foreach (var file in Directory.EnumerateFiles(Globals.Cache))\n            {\n                if (File.GetCreationTime(file) < frontierToDelete) File.Delete(file);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionFrontierTimeProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// A time provider which updates 'now' time based on the current data emit time of all subscriptions\n    /// </summary>\n    /// <remarks>This class is not thread safe but there is no need for it to be since it's only consumed by the\n    /// <see cref=\"SubscriptionSynchronizer\"/></remarks>\n    public class SubscriptionFrontierTimeProvider : ITimeProvider\n    {\n        private static readonly long MaxDateTimeTicks = DateTime.MaxValue.Ticks;\n        private DateTime _utcNow;\n        private readonly IDataFeedSubscriptionManager _subscriptionManager;\n\n        /// <summary>\n        /// Creates a new instance of the SubscriptionFrontierTimeProvider\n        /// </summary>\n        /// <param name=\"utcNow\">Initial UTC now time</param>\n        /// <param name=\"subscriptionManager\">Subscription manager. Will be used to obtain current subscriptions</param>\n        public SubscriptionFrontierTimeProvider(DateTime utcNow, IDataFeedSubscriptionManager subscriptionManager)\n        {\n            _utcNow = utcNow;\n            _subscriptionManager = subscriptionManager;\n        }\n\n        /// <summary>\n        /// Gets the current time in UTC\n        /// </summary>\n        /// <returns>The current time in UTC</returns>\n        public DateTime GetUtcNow()\n        {\n            UpdateCurrentTime();\n            return _utcNow;\n        }\n\n        /// <summary>\n        /// Sets the current time calculated as the minimum current data emit time of all the subscriptions.\n        /// If there are no subscriptions current time will remain unchanged\n        /// </summary>\n        private void UpdateCurrentTime()\n        {\n            long earlyBirdTicks = MaxDateTimeTicks;\n            foreach (var subscription in _subscriptionManager.DataFeedSubscriptions)\n            {\n                // this if should just be 'subscription.Current == null' but its affected by GH issue 3914\n                if (// this is a data subscription we just added\n                    // lets move it next to find the initial emit time\n                    subscription.Current == null\n                    && !subscription.IsUniverseSelectionSubscription\n                    && subscription.UtcStartTime == _utcNow\n                    ||\n                    // UserDefinedUniverse, through the AddData calls\n                    // will add new universe selection data points when is has too\n                    // so lets move it next to check if there is any\n                    subscription.Current == null\n                    && subscription.IsUniverseSelectionSubscription)\n                {\n                    subscription.MoveNext();\n                }\n\n                if (subscription.Current != null)\n                {\n                    if (earlyBirdTicks == MaxDateTimeTicks)\n                    {\n                        earlyBirdTicks = subscription.Current.EmitTimeUtc.Ticks;\n                    }\n                    else\n                    {\n                        // take the earliest between the next piece of data or the current earliest bird\n                        earlyBirdTicks = Math.Min(earlyBirdTicks, subscription.Current.EmitTimeUtc.Ticks);\n                    }\n                }\n            }\n\n            if (earlyBirdTicks != MaxDateTimeTicks)\n            {\n                _utcNow = new DateTime(Math.Max(earlyBirdTicks, _utcNow.Ticks), DateTimeKind.Utc);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionSynchronizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides the ability to synchronize subscriptions into time slices\n    /// </summary>\n    public class SubscriptionSynchronizer : ISubscriptionSynchronizer, ITimeProvider\n    {\n        private readonly UniverseSelection _universeSelection;\n        private TimeSliceFactory _timeSliceFactory;\n        private ITimeProvider _timeProvider;\n        private ManualTimeProvider _frontierTimeProvider;\n        private PerformanceTrackingTool _perfTrackingTool;\n\n        /// <summary>\n        /// Event fired when a <see cref=\"Subscription\"/> is finished\n        /// </summary>\n        public event EventHandler<Subscription> SubscriptionFinished;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SubscriptionSynchronizer\"/> class\n        /// </summary>\n        /// <param name=\"universeSelection\">The universe selection instance used to handle universe\n        /// selection subscription output</param>\n        /// <returns>A time slice for the specified frontier time</returns>\n        public SubscriptionSynchronizer(UniverseSelection universeSelection, PerformanceTrackingTool performanceTrackingTool)\n        {\n            _universeSelection = universeSelection;\n            _perfTrackingTool = performanceTrackingTool;\n        }\n\n        /// <summary>\n        /// Sets the time provider. If already set will throw.\n        /// </summary>\n        /// <param name=\"timeProvider\">The time provider, used to obtain the current frontier UTC value</param>\n        public void SetTimeProvider(ITimeProvider timeProvider)\n        {\n            if (_timeProvider != null)\n            {\n                throw new Exception(\"SubscriptionSynchronizer.SetTimeProvider(): can only be called once\");\n            }\n            _timeProvider = timeProvider;\n            _frontierTimeProvider = new ManualTimeProvider(_timeProvider.GetUtcNow());\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"TimeSliceFactory\"/> instance to use\n        /// </summary>\n        /// <param name=\"timeSliceFactory\">Used to create the new <see cref=\"TimeSlice\"/></param>\n        public void SetTimeSliceFactory(TimeSliceFactory timeSliceFactory)\n        {\n            if (_timeSliceFactory != null)\n            {\n                throw new Exception(\"SubscriptionSynchronizer.SetTimeSliceFactory(): can only be called once\");\n            }\n            _timeSliceFactory = timeSliceFactory;\n        }\n\n        /// <summary>\n        /// Syncs the specified subscriptions. The frontier time used for synchronization is\n        /// managed internally and dependent upon previous synchronization operations.\n        /// </summary>\n        /// <param name=\"subscriptions\">The subscriptions to sync</param>\n        /// <param name=\"cancellationToken\">The cancellation token to stop enumeration</param>\n        public IEnumerable<TimeSlice> Sync(IEnumerable<Subscription> subscriptions,\n            CancellationToken cancellationToken)\n        {\n            var delayedSubscriptionFinished = new Queue<Subscription>();\n\n            while (!cancellationToken.IsCancellationRequested)\n            {\n                var changes = SecurityChanges.None;\n                var data = new List<DataFeedPacket>(1);\n                // NOTE: Tight coupling in UniverseSelection.ApplyUniverseSelection\n                Dictionary<Universe, BaseDataCollection> universeData = null; // lazy construction for performance\n                var universeDataForTimeSliceCreate = new Dictionary<Universe, BaseDataCollection>();\n\n                var frontierUtc = _timeProvider.GetUtcNow();\n                _frontierTimeProvider.SetCurrentTimeUtc(frontierUtc);\n\n                SecurityChanges newChanges;\n                do\n                {\n                    newChanges = SecurityChanges.None;\n                    _perfTrackingTool.Start(PerformanceTarget.Subscriptions);\n                    foreach (var subscription in subscriptions)\n                    {\n                        if (subscription.EndOfStream)\n                        {\n                            OnSubscriptionFinished(subscription);\n                            continue;\n                        }\n\n                        // prime if needed\n                        if (subscription.Current == null)\n                        {\n                            if (!subscription.MoveNext())\n                            {\n                                OnSubscriptionFinished(subscription);\n                                continue;\n                            }\n                        }\n\n                        DataFeedPacket packet = null;\n\n                        while (subscription.Current != null && subscription.Current.EmitTimeUtc <= frontierUtc)\n                        {\n                            if (packet == null)\n                            {\n                                // for performance, lets be selfish about creating a new instance\n                                packet = new DataFeedPacket(\n                                    subscription.Security,\n                                    subscription.Configuration,\n                                    subscription.RemovedFromUniverse\n                                );\n                            }\n\n                            // If our subscription is a universe, and we get a delisting event emitted for it, then\n                            // the universe itself should be unselected and removed, because the Symbol that the\n                            // universe is based on has been delisted. Doing the disposal here allows us to\n                            // process the delisting at this point in time before emitting out to the algorithm.\n                            // This is very useful for universes that can be delisted, such as ETF constituent\n                            // universes (e.g. for ETF constituent universes, since the ETF itself is used to create\n                            // the universe Symbol (and set as its underlying), once the ETF is delisted, the\n                            // universe should cease to exist, since there are no more constituents of that ETF).\n                            if (subscription.Current.Data.DataType == MarketDataType.Auxiliary && subscription.Current.Data is Delisting delisting)\n                            {\n                                if(subscription.IsUniverseSelectionSubscription)\n                                {\n                                    subscription.Universes.Single().Dispose();\n                                }\n                                else if(delisting.Type == DelistingType.Delisted)\n                                {\n                                    changes += _universeSelection.HandleDelisting(subscription.Current.Data, subscription.Configuration.IsInternalFeed);\n                                }\n                            }\n\n                            packet.Add(subscription.Current.Data);\n\n                            if (!subscription.MoveNext())\n                            {\n                                delayedSubscriptionFinished.Enqueue(subscription);\n                                break;\n                            }\n                        }\n\n                        if (packet?.Count > 0)\n                        {\n                            // we have new universe data to select based on, store the subscription data until the end\n                            if (!subscription.IsUniverseSelectionSubscription)\n                            {\n                                data.Add(packet);\n                            }\n                            else\n                            {\n                                // assume that if the first item is a base data collection then the enumerator handled the aggregation,\n                                // otherwise, load all the the data into a new collection instance\n                                var packetBaseDataCollection = packet.Data[0] as BaseDataCollection;\n                                var packetData = packetBaseDataCollection == null\n                                    ? packet.Data\n                                    : packetBaseDataCollection.Data;\n\n                                BaseDataCollection collection;\n                                if (universeData != null\n                                    && universeData.TryGetValue(subscription.Universes.Single(), out collection))\n                                {\n                                    collection.AddRange(packetData);\n                                }\n                                else\n                                {\n                                    collection = new BaseDataCollection(frontierUtc, frontierUtc, subscription.Configuration.Symbol, packetData, packetBaseDataCollection?.Underlying, packetBaseDataCollection?.FilteredContracts);\n                                    if (universeData == null)\n                                    {\n                                        universeData = new Dictionary<Universe, BaseDataCollection>();\n                                    }\n                                    universeData[subscription.Universes.Single()] = collection;\n                                }\n                            }\n                        }\n\n                        if (subscription.IsUniverseSelectionSubscription\n                            && subscription.Universes.Single().DisposeRequested)\n                        {\n                            var universe = subscription.Universes.Single();\n                            // check if a universe selection isn't already scheduled for this disposed universe\n                            if (universeData == null || !universeData.ContainsKey(universe))\n                            {\n                                if (universeData == null)\n                                {\n                                    universeData = new Dictionary<Universe, BaseDataCollection>();\n                                }\n                                // we force trigger one last universe selection for this disposed universe, so it deselects all subscriptions it added\n                                universeData[universe] = new BaseDataCollection(frontierUtc, subscription.Configuration.Symbol);\n                            }\n\n                            // we need to do this after all usages of subscription.Universes\n                            OnSubscriptionFinished(subscription);\n                        }\n                    }\n                    _perfTrackingTool.Stop(PerformanceTarget.Subscriptions);\n\n                    if (universeData != null && universeData.Count > 0)\n                    {\n                        // if we are going to perform universe selection we emit an empty\n                        // time pulse to align algorithm time with current frontier\n                        yield return _timeSliceFactory.CreateTimePulse(frontierUtc);\n\n                        // trigger the smalled resolution first, so that FF res get's set once from the start correctly\n                        // while at it, let's make it determininstic and sort by universe sid later\n                        foreach (var kvp in universeData.OrderBy(x => x.Key.Configuration.Resolution).ThenBy(x => x.Key.Symbol.ID))\n                        {\n                            var universe = kvp.Key;\n                            var baseDataCollection = kvp.Value;\n                            universeDataForTimeSliceCreate[universe] = baseDataCollection;\n                            _perfTrackingTool.Start(PerformanceTarget.Selection);\n                            newChanges += _universeSelection.ApplyUniverseSelection(universe, frontierUtc, baseDataCollection);\n                            _perfTrackingTool.Stop(PerformanceTarget.Selection);\n                        }\n                        universeData.Clear();\n                    }\n\n                    changes += newChanges;\n                }\n                while (newChanges != SecurityChanges.None\n                    || _universeSelection.AddPendingInternalDataFeeds(frontierUtc));\n                _perfTrackingTool.Start(PerformanceTarget.Slice);\n                var timeSlice = _timeSliceFactory.Create(frontierUtc, data, changes, universeDataForTimeSliceCreate);\n                _perfTrackingTool.Stop(PerformanceTarget.Slice);\n\n                while (delayedSubscriptionFinished.Count > 0)\n                {\n                    // these subscriptions added valid data to the packet\n                    // we need to trigger OnSubscriptionFinished after we create the TimeSlice\n                    // else it will drop the data\n                    var subscription = delayedSubscriptionFinished.Dequeue();\n                    OnSubscriptionFinished(subscription);\n                }\n\n                yield return timeSlice;\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"SubscriptionFinished\"/> event\n        /// </summary>\n        protected virtual void OnSubscriptionFinished(Subscription subscription)\n        {\n            SubscriptionFinished?.Invoke(this, subscription);\n        }\n\n        /// <summary>\n        /// Returns the current UTC frontier time\n        /// </summary>\n        public DateTime GetUtcNow()\n        {\n            return _frontierTimeProvider.GetUtcNow();\n        }\n    }\n}\n\n"
  },
  {
    "path": "Engine/DataFeeds/SubscriptionUtils.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Lean.Engine.DataFeeds.WorkScheduling;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Utilities related to data <see cref=\"Subscription\"/>\n    /// </summary>\n    public static class SubscriptionUtils\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"Subscription\"/> which will directly consume the provided enumerator\n        /// </summary>\n        /// <param name=\"request\">The subscription data request</param>\n        /// <param name=\"enumerator\">The data enumerator stack</param>\n        /// <returns>A new subscription instance ready to consume</returns>\n        public static Subscription Create(\n            SubscriptionRequest request,\n            IEnumerator<BaseData> enumerator,\n            bool dailyStrictEndTimeEnabled)\n        {\n            if (enumerator == null)\n            {\n                return GetEndedSubscription(request);\n            }\n            var exchangeHours = request.Security.Exchange.Hours;\n            var timeZoneOffsetProvider = new TimeZoneOffsetProvider(request.Configuration.ExchangeTimeZone, request.StartTimeUtc, request.EndTimeUtc);\n            var dataEnumerator = new SubscriptionDataEnumerator(\n                request.Configuration,\n                exchangeHours,\n                timeZoneOffsetProvider,\n                enumerator,\n                request.IsUniverseSubscription,\n                dailyStrictEndTimeEnabled\n            );\n            return new Subscription(request, dataEnumerator, timeZoneOffsetProvider);\n        }\n\n        /// <summary>\n        /// Setups a new <see cref=\"Subscription\"/> which will consume a blocking <see cref=\"EnqueueableEnumerator{T}\"/>\n        /// that will be feed by a worker task\n        /// </summary>\n        /// <param name=\"request\">The subscription data request</param>\n        /// <param name=\"enumerator\">The data enumerator stack</param>\n        /// <param name=\"factorFileProvider\">The factor file provider</param>\n        /// <param name=\"enablePriceScale\">Enables price factoring</param>\n        /// <returns>A new subscription instance ready to consume</returns>\n        public static Subscription CreateAndScheduleWorker(\n            SubscriptionRequest request,\n            IEnumerator<BaseData> enumerator,\n            IFactorFileProvider factorFileProvider,\n            bool enablePriceScale,\n            bool dailyStrictEndTimeEnabled)\n        {\n            if(enumerator == null)\n            {\n                return GetEndedSubscription(request);\n            }\n            var exchangeHours = request.Security.Exchange.Hours;\n            var enqueueable = new EnqueueableEnumerator<SubscriptionData>(true);\n            var timeZoneOffsetProvider = new TimeZoneOffsetProvider(request.ExchangeHours.TimeZone, request.StartTimeUtc, request.EndTimeUtc);\n            var subscription = new Subscription(request, enqueueable, timeZoneOffsetProvider);\n            var config = subscription.Configuration;\n            enablePriceScale = enablePriceScale && config.PricesShouldBeScaled();\n            var lastTradableDate = DateTime.MinValue;\n\n            Func<int, bool> produce = (workBatchSize) =>\n            {\n                try\n                {\n                    var count = 0;\n                    while (enumerator.MoveNext())\n                    {\n                        // subscription has been removed, no need to continue enumerating\n                        if (enqueueable.HasFinished)\n                        {\n                            enumerator.DisposeSafely();\n                            return false;\n                        }\n\n                        var data = enumerator.Current;\n\n                        // Use our config filter to see if we should emit this\n                        // This currently catches Auxiliary data that we don't want to emit\n                        if (data != null && !config.ShouldEmitData(data, request.IsUniverseSubscription))\n                        {\n                            continue;\n                        }\n\n                        // In the event we have \"Raw\" configuration, we will force our subscription data\n                        // to precalculate adjusted data. The data will still be emitted as raw, but\n                        // if the config is changed at any point it can emit adjusted data as well\n                        // See SubscriptionData.Create() and PrecalculatedSubscriptionData for more\n                        var requestMode = config.DataNormalizationMode;\n                        if (config.SecurityType == SecurityType.Equity)\n                        {\n                            requestMode = requestMode != DataNormalizationMode.Raw ? requestMode : DataNormalizationMode.Adjusted;\n                        }\n\n                        var priceScaleFrontierDate = data.GetUpdatePriceScaleFrontier().Date;\n\n                        // We update our price scale factor when the date changes for non fill forward bars or if we haven't initialized yet.\n                        // We don't take into account auxiliary data because we don't scale it and because the underlying price data could be fill forwarded\n                        if (enablePriceScale && priceScaleFrontierDate > lastTradableDate && data.DataType != MarketDataType.Auxiliary && (!data.IsFillForward || lastTradableDate == DateTime.MinValue))\n                        {\n                            var factorFile = factorFileProvider.Get(request.Configuration.Symbol);\n                            lastTradableDate = priceScaleFrontierDate;\n                            request.Configuration.PriceScaleFactor = factorFile.GetPriceScale(lastTradableDate, requestMode, config.ContractDepthOffset, config.DataMappingMode);\n                        }\n\n                        SubscriptionData subscriptionData = SubscriptionData.Create(dailyStrictEndTimeEnabled,\n                            config,\n                            exchangeHours,\n                            subscription.OffsetProvider,\n                            data,\n                            requestMode,\n                            enablePriceScale ? request.Configuration.PriceScaleFactor : null);\n\n                        // drop the data into the back of the enqueueable\n                        enqueueable.Enqueue(subscriptionData);\n\n                        count++;\n                        // stop executing if added more data than the work batch size, we don't want to fill the ram\n                        if (count > workBatchSize)\n                        {\n                            return true;\n                        }\n                    }\n                }\n                catch (Exception exception)\n                {\n                    Log.Error(exception, $\"Subscription worker task exception {request.Configuration}.\");\n                }\n\n                // we made it here because MoveNext returned false or we exploded, stop the enqueueable\n                enqueueable.Stop();\n                // we have to dispose of the enumerator\n                enumerator.DisposeSafely();\n                return false;\n            };\n\n            WeightedWorkScheduler.Instance.QueueWork(config.Symbol, produce,\n                // if the subscription finished we return 0, so the work is prioritized and gets removed\n                () =>\n                {\n                    if (enqueueable.HasFinished)\n                    {\n                        return 0;\n                    }\n                    return enqueueable.Count;\n                }\n            );\n\n            return subscription;\n        }\n\n        /// <summary>\n        /// Return an ended subscription so it doesn't blow up at runtime on the data worker, this can happen if there's no tradable date\n        /// </summary>\n        private static Subscription GetEndedSubscription(SubscriptionRequest request)\n        {\n            var result = new Subscription(request, null, null);\n            // set subscription as ended\n            result.Dispose();\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Synchronizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing NodaTime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Implementation of the <see cref=\"ISynchronizer\"/> interface which provides the mechanism to stream data to the algorithm\n    /// </summary>\n    public class Synchronizer : ISynchronizer, IDataFeedTimeProvider, IDisposable\n    {\n        private DateTimeZone _dateTimeZone;\n\n        /// <summary>\n        /// The algorithm instance\n        /// </summary>\n        protected IAlgorithm Algorithm { get; set; }\n\n        /// <summary>\n        /// The subscription manager\n        /// </summary>\n        protected IDataFeedSubscriptionManager SubscriptionManager { get; set; }\n\n        /// <summary>\n        /// The subscription synchronizer\n        /// </summary>\n        protected SubscriptionSynchronizer SubscriptionSynchronizer { get; set; }\n\n        /// <summary>\n        /// The time slice factory\n        /// </summary>\n        protected TimeSliceFactory TimeSliceFactory { get; set; }\n\n        /// <summary>\n        /// Continuous UTC time provider, only valid for live trading see <see cref=\"LiveSynchronizer\"/>\n        /// </summary>\n        public virtual ITimeProvider TimeProvider => null;\n\n        /// <summary>\n        /// Time provider which returns current UTC frontier time\n        /// </summary>\n        public ITimeProvider FrontierTimeProvider => SubscriptionSynchronizer;\n\n        /// <summary>\n        /// Initializes the instance of the Synchronizer class\n        /// </summary>\n        public virtual void Initialize(\n            IAlgorithm algorithm,\n            IDataFeedSubscriptionManager dataFeedSubscriptionManager,\n            PerformanceTrackingTool performanceTrackingTool)\n        {\n            SubscriptionManager = dataFeedSubscriptionManager;\n            Algorithm = algorithm;\n            SubscriptionSynchronizer = new SubscriptionSynchronizer(\n                SubscriptionManager.UniverseSelection, performanceTrackingTool);\n        }\n\n        /// <summary>\n        /// Returns an enumerable which provides the data to stream to the algorithm\n        /// </summary>\n        public virtual IEnumerable<TimeSlice> StreamData(CancellationToken cancellationToken)\n        {\n            PostInitialize();\n\n            // GetTimeProvider() will call GetInitialFrontierTime() which\n            // will consume added subscriptions so we need to do this after initialization\n            SubscriptionSynchronizer.SetTimeProvider(GetTimeProvider());\n\n            var previousEmitTime = DateTime.MaxValue;\n\n            var enumerator = SubscriptionSynchronizer\n                .Sync(SubscriptionManager.DataFeedSubscriptions, cancellationToken)\n                .GetEnumerator();\n            var previousWasTimePulse = false;\n            // this is a just in case flag to stop looping if time does not advance\n            var retried = false;\n            while (!cancellationToken.IsCancellationRequested)\n            {\n                TimeSlice timeSlice;\n                try\n                {\n                    if (!enumerator.MoveNext())\n                    {\n                        // the enumerator ended\n                        break;\n                    }\n                    timeSlice = enumerator.Current;\n                }\n                catch (Exception err)\n                {\n                    // notify the algorithm about the error, so it can be reported to the user\n                    Algorithm.SetRuntimeError(err, \"Synchronizer\");\n                    break;\n                }\n\n                // check for cancellation\n                if (timeSlice == null || cancellationToken.IsCancellationRequested) break;\n\n                if (timeSlice.IsTimePulse && Algorithm.UtcTime == timeSlice.Time)\n                {\n                    previousWasTimePulse = timeSlice.IsTimePulse;\n                    // skip time pulse when algorithms already at that time\n                    continue;\n                }\n\n                // SubscriptionFrontierTimeProvider will return twice the same time if there are no more subscriptions or if Subscription.Current is null\n                if (timeSlice.Time != previousEmitTime || previousWasTimePulse || timeSlice.UniverseData.Count != 0)\n                {\n                    previousEmitTime = timeSlice.Time;\n                    previousWasTimePulse = timeSlice.IsTimePulse;\n                    // if we emitted, clear retry flag\n                    retried = false;\n                    yield return timeSlice;\n                }\n                else\n                {\n                    // if the slice has data lets retry just once more... this could happen\n                    // with subscriptions added after initialize using algorithm.AddSecurity() API,\n                    // where the subscription start time is the current time loop (but should just happen once)\n                    if (!timeSlice.Slice.HasData || retried)\n                    {\n                        // there's no more data to pull off, we're done (frontier is max value and no security changes)\n                        break;\n                    }\n                    retried = true;\n                }\n            }\n\n            enumerator.DisposeSafely();\n            Log.Trace(\"Synchronizer.GetEnumerator(): Exited thread.\");\n        }\n\n        /// <summary>\n        /// Performs additional initialization steps after algorithm initialization\n        /// </summary>\n        protected virtual void PostInitialize()\n        {\n            SubscriptionSynchronizer.SubscriptionFinished += (sender, subscription) =>\n            {\n                SubscriptionManager.RemoveSubscription(subscription.Configuration);\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug(\"Synchronizer.SubscriptionFinished(): Finished subscription:\" +\n                              $\"{subscription.Configuration} at {FrontierTimeProvider.GetUtcNow()} UTC\");\n                }\n            };\n\n            // this is set after the algorithm initializes\n            _dateTimeZone = Algorithm.TimeZone;\n            TimeSliceFactory = new TimeSliceFactory(_dateTimeZone);\n            SubscriptionSynchronizer.SetTimeSliceFactory(TimeSliceFactory);\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"ITimeProvider\"/> to use. By default this will load the\n        /// <see cref=\"RealTimeProvider\"/> for live mode, else <see cref=\"SubscriptionFrontierTimeProvider\"/>\n        /// </summary>\n        /// <returns>The <see cref=\"ITimeProvider\"/> to use</returns>\n        protected virtual ITimeProvider GetTimeProvider()\n        {\n            return new SubscriptionFrontierTimeProvider(GetInitialFrontierTime(), SubscriptionManager);\n        }\n\n        private DateTime GetInitialFrontierTime()\n        {\n            var frontier = DateTime.MaxValue;\n            foreach (var subscription in SubscriptionManager.DataFeedSubscriptions)\n            {\n                var current = subscription.Current;\n                if (current == null)\n                {\n                    continue;\n                }\n\n                // we need to initialize both the frontier time and the offset provider, in order to do\n                // this we'll first convert the current.EndTime to UTC time, this will allow us to correctly\n                // determine the offset in ticks using the OffsetProvider, we can then use this to recompute\n                // the UTC time. This seems odd, but is necessary given Noda time's lenient mapping, the\n                // OffsetProvider exists to give forward marching mapping\n\n                // compute the initial frontier time\n                if (current.EmitTimeUtc < frontier)\n                {\n                    frontier = current.EmitTimeUtc;\n                }\n            }\n\n            if (frontier == DateTime.MaxValue)\n            {\n                // here we use Time and not StartDate because Time will be before the start during warmup period.\n                frontier = Algorithm.Time.ConvertToUtc(_dateTimeZone);\n            }\n            return frontier;\n        }\n\n        /// <summary>\n        /// Free resources\n        /// </summary>\n        public virtual void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/TextSubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementations of <see cref=\"ISubscriptionDataSourceReader\"/> that uses the\n    /// <see cref=\"BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool)\"/>\n    /// method to read lines of text from a <see cref=\"SubscriptionDataSource\"/>\n    /// </summary>\n    public class TextSubscriptionDataSourceReader : BaseSubscriptionDataSourceReader\n    {\n        private readonly bool _implementsStreamReader;\n        private readonly DateTime _date;\n        private BaseData _factory;\n        private bool _shouldCacheDataPoints;\n\n        private static int CacheSize = 100;\n        private static volatile Dictionary<string, List<BaseData>> BaseDataSourceCache = new Dictionary<string, List<BaseData>>(100);\n        private static Queue<string> CacheKeys = new Queue<string>(100);\n\n        /// <summary>\n        /// The requested subscription configuration\n        /// </summary>\n        protected SubscriptionDataConfig Config { get; set; }\n\n        /// <summary>\n        /// Event fired when an exception is thrown during a call to\n        /// <see cref=\"BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool)\"/>\n        /// </summary>\n        public event EventHandler<ReaderErrorEventArgs> ReaderError;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TextSubscriptionDataSourceReader\"/> class\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">This provider caches files if needed</param>\n        /// <param name=\"config\">The subscription's configuration</param>\n        /// <param name=\"date\">The date this factory was produced to read data for</param>\n        /// <param name=\"isLiveMode\">True if we're in live mode, false for backtesting</param>\n        /// <param name=\"objectStore\">The object storage for data persistence.</param>\n        public TextSubscriptionDataSourceReader(IDataCacheProvider dataCacheProvider, SubscriptionDataConfig config, DateTime date, bool isLiveMode,\n            IObjectStore objectStore)\n            : base(dataCacheProvider, isLiveMode, objectStore)\n        {\n            _date = date;\n            Config = config;\n            _shouldCacheDataPoints = !Config.IsCustomData && Config.Resolution >= Resolution.Hour\n                && Config.Type != typeof(FineFundamental) && Config.Type != typeof(CoarseFundamental) && Config.Type != typeof(Fundamental)\n                // don't cache universe data, doesn't make much sense and we don't want to change the symbol of the clone\n                && !Config.Type.IsAssignableTo(typeof(BaseDataCollection))\n                && !DataCacheProvider.IsDataEphemeral;\n\n            _implementsStreamReader = Config.Type.ImplementsStreamReader();\n        }\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public override IEnumerable<BaseData> Read(SubscriptionDataSource source)\n        {\n            List<BaseData> cache = null;\n            _shouldCacheDataPoints = _shouldCacheDataPoints &&\n                // only cache local files\n                source.TransportMedium == SubscriptionTransportMedium.LocalFile;\n\n            string cacheKey = null;\n            if (_shouldCacheDataPoints)\n            {\n                cacheKey = source.Source + Config.Type;\n                BaseDataSourceCache.TryGetValue(cacheKey, out cache);\n            }\n            if (cache == null)\n            {\n                cache = _shouldCacheDataPoints ? new List<BaseData>(30000) : null;\n                using (var reader = CreateStreamReader(source))\n                {\n                    if (reader == null)\n                    {\n                        // if the reader doesn't have data then we're done with this subscription\n                        yield break;\n                    }\n\n                    if (_factory == null)\n                    {\n                        // only create a factory if the stream isn't null\n                        _factory = Config.GetBaseDataInstance();\n                    }\n                    // while the reader has data\n                    while (!reader.EndOfStream)\n                    {\n                        BaseData instance = null;\n                        string line = null;\n                        try\n                        {\n                            if (reader.StreamReader != null && _implementsStreamReader)\n                            {\n                                instance = _factory.Reader(Config, reader.StreamReader, _date, IsLiveMode);\n                            }\n                            else\n                            {\n                                // read a line and pass it to the base data factory\n                                line = reader.ReadLine();\n                                instance = _factory.Reader(Config, line, _date, IsLiveMode);\n                            }\n                        }\n                        catch (Exception err)\n                        {\n                            OnReaderError(line ?? \"StreamReader\", err);\n                        }\n\n                        if (instance != null && instance.EndTime != default)\n                        {\n                            if (_shouldCacheDataPoints)\n                            {\n                                cache.Add(instance);\n                            }\n                            else\n                            {\n                                yield return instance;\n                            }\n                        }\n                        else if (reader.ShouldBeRateLimited)\n                        {\n                            yield return instance;\n                        }\n                    }\n                }\n\n                if (!_shouldCacheDataPoints)\n                {\n                    yield break;\n                }\n\n                lock (CacheKeys)\n                {\n                    CacheKeys.Enqueue(cacheKey);\n                    // we create a new dictionary, so we don't have to take locks when reading, and add our new item\n                    var newCache = new Dictionary<string, List<BaseData>>(BaseDataSourceCache) { [cacheKey] = cache };\n\n                    if (BaseDataSourceCache.Count > CacheSize)\n                    {\n                        var removeCount = 0;\n                        // we remove a portion of the first in entries\n                        while (++removeCount < (CacheSize / 4))\n                        {\n                            newCache.Remove(CacheKeys.Dequeue());\n                        }\n                        // update the cache instance\n                        BaseDataSourceCache = newCache;\n                    }\n                    else\n                    {\n                        // update the cache instance\n                        BaseDataSourceCache = newCache;\n                    }\n                }\n            }\n\n            if (cache == null)\n            {\n                throw new InvalidOperationException($\"Cache should not be null. Key: {cacheKey}\");\n            }\n            // Find the first data point 10 days (just in case) before the desired date\n            // and subtract one item (just in case there was a time gap and data.Time is after _date)\n            var frontier = _date.AddDays(-10);\n            var index = cache.FindIndex(data => data.Time > frontier);\n            index = index > 0 ? (index - 1) : 0;\n            foreach (var data in cache.Skip(index))\n            {\n                var clone = data.Clone();\n                clone.Symbol = Config.Symbol;\n                yield return clone;\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ReaderError\"/> event\n        /// </summary>\n        /// <param name=\"line\">The line that caused the exception</param>\n        /// <param name=\"exception\">The exception that was caught</param>\n        private void OnReaderError(string line, Exception exception)\n        {\n            var handler = ReaderError;\n            if (handler != null) handler(this, new ReaderErrorEventArgs(line, exception));\n        }\n\n        /// <summary>\n        /// Set the cache size to use\n        /// </summary>\n        /// <remarks>How to size this cache: Take worst case scenario, BTCUSD hour, 60k QuoteBar entries, which are roughly 200 bytes in size -> 11 MB * CacheSize</remarks>\n        public static void SetCacheSize(int megaBytesToUse)\n        {\n            if (megaBytesToUse != 0)\n            {\n                // we take worst case scenario, each entry is 12 MB\n                CacheSize = megaBytesToUse / 12;\n                Log.Trace($\"TextSubscriptionDataSourceReader.SetCacheSize(): Setting cache size to {CacheSize} items\");\n            }\n        }\n\n        /// <summary>\n        /// Will clear the data cache.\n        /// Used for testing different time zones for the same data set and allow a clean fresh start for each backtest\n        /// </summary>\n        public static void ClearCache()\n        {\n            BaseDataSourceCache = new();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/TimeSlice.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Represents a grouping of data emitted at a certain time.\n    /// </summary>\n    public class TimeSlice\n    {\n        /// <summary>\n        /// Gets the count of data points in this <see cref=\"TimeSlice\"/>\n        /// </summary>\n        public int DataPointCount { get; }\n\n        /// <summary>\n        /// Gets the UTC time this data was emitted\n        /// </summary>\n        public DateTime Time { get; }\n\n        /// <summary>\n        /// Gets the data in the time slice\n        /// </summary>\n        public List<DataFeedPacket> Data { get; }\n\n        /// <summary>\n        /// Gets the <see cref=\"Slice\"/> that will be used as input for the algorithm\n        /// </summary>\n        public Slice Slice { get; }\n\n        /// <summary>\n        /// Gets the data used to update securities\n        /// </summary>\n        public List<UpdateData<ISecurityPrice>> SecuritiesUpdateData { get; }\n\n        /// <summary>\n        /// Gets the data used to update the consolidators\n        /// </summary>\n        public List<UpdateData<SubscriptionDataConfig>> ConsolidatorUpdateData { get; }\n\n        /// <summary>\n        /// Gets all the custom data in this <see cref=\"TimeSlice\"/>\n        /// </summary>\n        public List<UpdateData<ISecurityPrice>> CustomData { get; }\n\n        /// <summary>\n        /// Gets the changes to the data subscriptions as a result of universe selection\n        /// </summary>\n        public SecurityChanges SecurityChanges { get; }\n\n        /// <summary>\n        /// Gets the universe data generated this time step.\n        /// </summary>\n        public Dictionary<Universe, BaseDataCollection> UniverseData { get; }\n\n        /// <summary>\n        /// True indicates this time slice is a time pulse for the algorithm containing no data\n        /// </summary>\n        public bool IsTimePulse { get; }\n\n        /// <summary>\n        /// Initializes a new <see cref=\"TimeSlice\"/> containing the specified data\n        /// </summary>\n        public TimeSlice(DateTime time,\n            int dataPointCount,\n            Slice slice,\n            List<DataFeedPacket> data,\n            List<UpdateData<ISecurityPrice>> securitiesUpdateData,\n            List<UpdateData<SubscriptionDataConfig>> consolidatorUpdateData,\n            List<UpdateData<ISecurityPrice>> customData,\n            SecurityChanges securityChanges,\n            Dictionary<Universe, BaseDataCollection> universeData,\n            bool isTimePulse = false)\n        {\n            Time = time;\n            Data = data;\n            Slice = slice;\n            CustomData = customData;\n            DataPointCount = dataPointCount;\n            SecuritiesUpdateData = securitiesUpdateData;\n            ConsolidatorUpdateData = consolidatorUpdateData;\n            SecurityChanges = securityChanges;\n            UniverseData = universeData;\n            IsTimePulse = isTimePulse;\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/TimeSliceFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing System.Linq;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Instance base class that will provide methods for creating new <see cref=\"TimeSlice\"/>\n    /// </summary>\n    public class TimeSliceFactory\n    {\n        private readonly DateTimeZone _timeZone;\n\n        // performance: these collections are not always used so keep a reference to an empty\n        // instance to use and avoid unnecessary constructors and allocations\n        private readonly List<UpdateData<ISecurityPrice>> _emptyCustom = new List<UpdateData<ISecurityPrice>>();\n        private readonly TradeBars _emptyTradeBars = new TradeBars();\n        private readonly QuoteBars _emptyQuoteBars = new QuoteBars();\n        private readonly Ticks _emptyTicks = new Ticks();\n        private readonly Splits _emptySplits = new Splits();\n        private readonly Dividends _emptyDividends = new Dividends();\n        private readonly Delistings _emptyDelistings = new Delistings();\n        private readonly OptionChains _emptyOptionChains = new OptionChains();\n        private readonly FuturesChains _emptyFuturesChains = new FuturesChains();\n        private readonly SymbolChangedEvents _emptySymbolChangedEvents = new SymbolChangedEvents();\n        private readonly MarginInterestRates _emptyMarginInterestRates = new MarginInterestRates();\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"timeZone\">The time zone required for computing algorithm and slice time</param>\n        public TimeSliceFactory(DateTimeZone timeZone)\n        {\n            _timeZone = timeZone;\n        }\n\n        /// <summary>\n        /// Creates a new empty <see cref=\"TimeSlice\"/> to be used as a time pulse\n        /// </summary>\n        /// <remarks>The objective of this method is to standardize the time pulse creation</remarks>\n        /// <param name=\"utcDateTime\">The UTC frontier date time</param>\n        /// <returns>A new <see cref=\"TimeSlice\"/> time pulse</returns>\n        public TimeSlice CreateTimePulse(DateTime utcDateTime)\n        {\n            // setting all data collections to null, this time slice shouldn't be used\n            // for its data, we want to see fireworks it someone tries\n            return new TimeSlice(utcDateTime,\n                0,\n                null,\n                null,\n                null,\n                null,\n                null,\n                SecurityChanges.None,\n                null,\n                isTimePulse:true);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"TimeSlice\"/> for the specified time using the specified data\n        /// </summary>\n        /// <param name=\"utcDateTime\">The UTC frontier date time</param>\n        /// <param name=\"data\">The data in this <see cref=\"TimeSlice\"/></param>\n        /// <param name=\"changes\">The new changes that are seen in this time slice as a result of universe selection</param>\n        /// <param name=\"universeData\"></param>\n        /// <returns>A new <see cref=\"TimeSlice\"/> containing the specified data</returns>\n        public TimeSlice Create(DateTime utcDateTime,\n            List<DataFeedPacket> data,\n            SecurityChanges changes,\n            Dictionary<Universe, BaseDataCollection> universeData)\n        {\n            int count = 0;\n            var security = new List<UpdateData<ISecurityPrice>>(data.Count);\n            List<UpdateData<ISecurityPrice>> custom = null;\n            var consolidator = new List<UpdateData<SubscriptionDataConfig>>(data.Count);\n            var allDataForAlgorithm = new List<BaseData>(data.Count);\n            var optionUnderlyingUpdates = new Dictionary<Symbol, BaseData>();\n\n            Split split;\n            Dividend dividend;\n            Delisting delisting;\n            SymbolChangedEvent symbolChange;\n            MarginInterestRate marginInterestRate;\n\n            // we need to be able to reference the slice being created in order to define the\n            // evaluation of option price models, so we define a 'future' that can be referenced\n            // in the option price model evaluation delegates for each contract\n            Slice slice = null;\n            var sliceFuture = new Lazy<Slice>(() => slice);\n\n            var algorithmTime = utcDateTime.ConvertFromUtc(_timeZone);\n            TradeBars tradeBars = null;\n            QuoteBars quoteBars = null;\n            Ticks ticks = null;\n            Splits splits = null;\n            Dividends dividends = null;\n            Delistings delistings = null;\n            OptionChains optionChains = null;\n            FuturesChains futuresChains = null;\n            SymbolChangedEvents symbolChanges = null;\n            MarginInterestRates marginInterestRates = null;\n\n            UpdateEmptyCollections(algorithmTime);\n\n            if (universeData.Count > 0)\n            {\n                // count universe data\n                foreach (var kvp in universeData)\n                {\n                    count += kvp.Value.Data.Count;\n                }\n            }\n\n            // ensure we read equity data before option data, so we can set the current underlying price\n            foreach (var packet in data)\n            {\n                // filter out packets for removed subscriptions\n                if (packet.IsSubscriptionRemoved)\n                {\n                    continue;\n                }\n\n                var list = packet.Data;\n                var symbol = packet.Configuration.Symbol;\n\n                if (list.Count == 0) continue;\n\n                // keep count of all data points\n                if (list.Count == 1 && list[0] is BaseDataCollection)\n                {\n                    var baseDataCollectionCount = ((BaseDataCollection)list[0]).Data.Count;\n                    if (baseDataCollectionCount == 0)\n                    {\n                        continue;\n                    }\n                    count += baseDataCollectionCount;\n                }\n                else\n                {\n                    count += list.Count;\n                }\n\n                if (!packet.Configuration.IsInternalFeed && packet.Configuration.IsCustomData)\n                {\n                    if (custom == null)\n                    {\n                        custom = new List<UpdateData<ISecurityPrice>>(1);\n                    }\n                    // This is all the custom data\n                    custom.Add(new UpdateData<ISecurityPrice>(packet.Security, packet.Configuration.Type, list, packet.Configuration.IsInternalFeed));\n                }\n\n                var securityUpdate = new List<BaseData>(list.Count);\n                var consolidatorUpdate = new List<BaseData>(list.Count);\n                var containsFillForwardData = false;\n                for (var i = 0; i < list.Count; i++)\n                {\n                    var baseData = list[i];\n                    if (!packet.Configuration.IsInternalFeed)\n                    {\n                        // this is all the data that goes into the algorithm\n                        allDataForAlgorithm.Add(baseData);\n                    }\n\n                    containsFillForwardData |= baseData.IsFillForward;\n\n                    // don't add internal feed data to ticks/bars objects\n                    if (baseData.DataType != MarketDataType.Auxiliary)\n                    {\n                        var tick = baseData as Tick;\n\n                        if (!packet.Configuration.IsInternalFeed)\n                        {\n                            // populate data dictionaries\n                            switch (baseData.DataType)\n                            {\n                                case MarketDataType.Tick:\n                                    if (ticks == null)\n                                    {\n                                        ticks = new Ticks(algorithmTime);\n                                    }\n                                    ticks.Add(baseData.Symbol, (Tick)baseData);\n                                    break;\n\n                                case MarketDataType.TradeBar:\n                                    if (tradeBars == null)\n                                    {\n                                        tradeBars = new TradeBars(algorithmTime);\n                                    }\n\n                                    var newTradeBar = (TradeBar)baseData;\n                                    TradeBar existingTradeBar;\n                                    // if we have an existing bar keep the highest resolution one\n                                    // e.g Hour and Minute resolution subscriptions for the same symbol\n                                    // see CustomUniverseWithBenchmarkRegressionAlgorithm\n                                    if (!tradeBars.TryGetValue(baseData.Symbol, out existingTradeBar)\n                                        || existingTradeBar.Period > newTradeBar.Period)\n                                    {\n                                        tradeBars[baseData.Symbol] = newTradeBar;\n                                    }\n                                    break;\n\n                                case MarketDataType.QuoteBar:\n                                    if (quoteBars == null)\n                                    {\n                                        quoteBars = new QuoteBars(algorithmTime);\n                                    }\n\n                                    var newQuoteBar = (QuoteBar)baseData;\n                                    QuoteBar existingQuoteBar;\n                                    // if we have an existing bar keep the highest resolution one\n                                    // e.g Hour and Minute resolution subscriptions for the same symbol\n                                    // see CustomUniverseWithBenchmarkRegressionAlgorithm\n                                    if (!quoteBars.TryGetValue(baseData.Symbol, out existingQuoteBar)\n                                        || existingQuoteBar.Period > newQuoteBar.Period)\n                                    {\n                                        quoteBars[baseData.Symbol] = newQuoteBar;\n                                    }\n                                    break;\n\n                                case MarketDataType.OptionChain:\n                                    if (optionChains == null)\n                                    {\n                                        optionChains = new OptionChains(algorithmTime);\n                                    }\n                                    optionChains[baseData.Symbol] = (OptionChain)baseData;\n                                    break;\n\n                                case MarketDataType.FuturesChain:\n                                    if (futuresChains == null)\n                                    {\n                                        futuresChains = new FuturesChains(algorithmTime);\n                                    }\n                                    futuresChains[baseData.Symbol] = (FuturesChain)baseData;\n                                    break;\n                            }\n\n                            // this is data used to update consolidators\n                            // do not add it if it is a Suspicious tick\n                            if (tick == null || !tick.Suspicious)\n                            {\n                                consolidatorUpdate.Add(baseData);\n                            }\n                        }\n\n                        // special handling of options data to build the option chain\n                        if (symbol.SecurityType.IsOption() && baseData.Symbol.SecurityType.IsOption())\n                        {\n                            // internal feeds, like open interest, will not create the chain but will update it if it exists\n                            // this is because the open interest could arrive at some closed market hours in which there is no other data and we don't\n                            // want to generate a chain object in this case\n                            if (optionChains == null && !packet.Configuration.IsInternalFeed)\n                            {\n                                optionChains = new OptionChains(algorithmTime);\n                            }\n\n                            if (optionChains != null)\n                            {\n                                if (baseData.DataType == MarketDataType.OptionChain)\n                                {\n                                    optionChains[baseData.Symbol] = (OptionChain)baseData;\n                                }\n                                else if (!HandleOptionData(algorithmTime, baseData, optionChains, packet.Security, sliceFuture, optionUnderlyingUpdates))\n                                {\n                                    continue;\n                                }\n                            }\n                        }\n\n                        // special handling of futures data to build the futures chain. Don't push canonical continuous contract\n                        // We don't push internal feeds because it could be a continuous mapping future not part of the requested chain\n                        if (symbol.SecurityType == SecurityType.Future && !symbol.IsCanonical() && baseData.Symbol.SecurityType == SecurityType.Future)\n                        {\n                            if (futuresChains == null && !packet.Configuration.IsInternalFeed)\n                            {\n                                futuresChains = new FuturesChains(algorithmTime);\n                            }\n\n                            if (futuresChains != null)\n                            {\n                                if (baseData.DataType == MarketDataType.FuturesChain)\n                                {\n                                    futuresChains[baseData.Symbol] = (FuturesChain)baseData;\n                                }\n                                else if (!HandleFuturesData(algorithmTime, baseData, futuresChains, packet.Security, packet.Configuration))\n                                {\n                                    continue;\n                                }\n                            }\n\n                        }\n\n                        // this is the data used set market prices\n                        // do not add it if it is a Suspicious tick\n                        if (tick != null && tick.Suspicious) continue;\n\n                        securityUpdate.Add(baseData);\n\n                        // option underlying security update\n                        if (!packet.Configuration.IsInternalFeed)\n                        {\n                            optionUnderlyingUpdates[symbol] = baseData;\n                        }\n                    }\n                    // We emit aux data for non internal subscriptions only, except for delistings which are required in case\n                    // of holdings in the algorithm that may require liquidation, or just for marking the security as delisted and not tradable\n                    else if ((delisting = baseData as Delisting) != null || !packet.Configuration.IsInternalFeed)\n                    {\n                        // include checks for various aux types so we don't have to construct the dictionaries in Slice\n                        if (delisting != null)\n                        {\n                            if (delistings == null)\n                            {\n                                delistings = new Delistings(algorithmTime);\n                            }\n                            delistings[symbol] = delisting;\n                        }\n                        else if ((dividend = baseData as Dividend) != null)\n                        {\n                            if (dividends == null)\n                            {\n                                dividends = new Dividends(algorithmTime);\n                            }\n                            dividends[symbol] = dividend;\n                        }\n                        else if ((split = baseData as Split) != null)\n                        {\n                            if (splits == null)\n                            {\n                                splits = new Splits(algorithmTime);\n                            }\n                            splits[symbol] = split;\n                        }\n                        else if ((symbolChange = baseData as SymbolChangedEvent) != null)\n                        {\n                            if (symbolChanges == null)\n                            {\n                                symbolChanges = new SymbolChangedEvents(algorithmTime);\n                            }\n                            // symbol changes is keyed by the requested symbol\n                            symbolChanges[packet.Configuration.Symbol] = symbolChange;\n                        }\n                        else if ((marginInterestRate = baseData as MarginInterestRate) != null)\n                        {\n                            if (marginInterestRates == null)\n                            {\n                                marginInterestRates = new MarginInterestRates(algorithmTime);\n                            }\n                            marginInterestRates[packet.Configuration.Symbol] = marginInterestRate;\n                        }\n\n                        // let's make it available to the user through the cache\n                        security.Add(new UpdateData<ISecurityPrice>(packet.Security, baseData.GetType(), new List<BaseData> { baseData }, packet.Configuration.IsInternalFeed, baseData.IsFillForward));\n                    }\n                }\n\n                if (securityUpdate.Count > 0)\n                {\n                    security.Add(new UpdateData<ISecurityPrice>(packet.Security, packet.Configuration.Type, securityUpdate, packet.Configuration.IsInternalFeed, containsFillForwardData));\n                }\n                if (consolidatorUpdate.Count > 0)\n                {\n                    consolidator.Add(new UpdateData<SubscriptionDataConfig>(packet.Configuration, packet.Configuration.Type, consolidatorUpdate, packet.Configuration.IsInternalFeed, containsFillForwardData));\n                }\n            }\n\n            slice = new Slice(algorithmTime, allDataForAlgorithm, tradeBars ?? _emptyTradeBars, quoteBars ?? _emptyQuoteBars, ticks ?? _emptyTicks, optionChains ?? _emptyOptionChains, futuresChains ?? _emptyFuturesChains, splits ?? _emptySplits, dividends ?? _emptyDividends, delistings ?? _emptyDelistings, symbolChanges ?? _emptySymbolChangedEvents, marginInterestRates ?? _emptyMarginInterestRates, utcDateTime, allDataForAlgorithm.Count > 0);\n\n            return new TimeSlice(utcDateTime, count, slice, data, security, consolidator, custom ?? _emptyCustom, changes, universeData);\n        }\n\n        private void UpdateEmptyCollections(DateTime algorithmTime)\n        {\n            // just in case\n            _emptyTradeBars.Clear();\n            _emptyQuoteBars.Clear();\n            _emptyTicks.Clear();\n            _emptySplits.Clear();\n            _emptyDividends.Clear();\n            _emptyDelistings.Clear();\n            _emptyOptionChains.Clear();\n            _emptyFuturesChains.Clear();\n            _emptySymbolChangedEvents.Clear();\n            _emptyMarginInterestRates.Clear();\n\n#pragma warning disable 0618 // DataDictionary.Time is deprecated, ignore until removed entirely\n            _emptyTradeBars.Time\n                = _emptyQuoteBars.Time\n                = _emptyTicks.Time\n                = _emptySplits.Time\n                = _emptyDividends.Time\n                = _emptyDelistings.Time\n                = _emptyOptionChains.Time\n                = _emptyFuturesChains.Time\n                = _emptySymbolChangedEvents.Time\n                = _emptyMarginInterestRates.Time = algorithmTime;\n#pragma warning restore 0618\n        }\n\n        private bool HandleOptionData(DateTime algorithmTime, BaseData baseData, OptionChains optionChains, ISecurityPrice security, Lazy<Slice> sliceFuture, IReadOnlyDictionary<Symbol, BaseData> optionUnderlyingUpdates)\n        {\n            var symbol = baseData.Symbol;\n\n            OptionChain chain;\n            var canonical = symbol.Canonical;\n            if (!optionChains.TryGetValue(canonical, out chain))\n            {\n                chain = new OptionChain(canonical, algorithmTime);\n                optionChains[canonical] = chain;\n            }\n\n            // set the underlying current data point in the option chain\n            var option = security as IOptionPrice;\n            if (option != null)\n            {\n                if (option.Underlying == null)\n                {\n                    Log.Error($\"TimeSlice.HandleOptionData(): {algorithmTime}: Option underlying is null\");\n                    return false;\n                }\n\n                BaseData underlyingData;\n                if (!optionUnderlyingUpdates.TryGetValue(option.Underlying.Symbol, out underlyingData))\n                {\n                    underlyingData = option.Underlying.GetLastData();\n                }\n\n                if (underlyingData == null)\n                {\n                    Log.Error($\"TimeSlice.HandleOptionData(): {algorithmTime}: Option underlying GetLastData returned null\");\n                    return false;\n                }\n                chain.Underlying = underlyingData;\n            }\n\n            var universeData = baseData as BaseDataCollection;\n            if (universeData != null)\n            {\n                if (universeData.Underlying != null)\n                {\n                    foreach (var addedContract in chain.Contracts)\n                    {\n                        addedContract.Value.Update(chain.Underlying);\n                    }\n                }\n                foreach (var contractSymbol in universeData.FilteredContracts ?? Enumerable.Empty<Symbol>())\n                {\n                    chain.FilteredContracts.Add(contractSymbol);\n                }\n                return false;\n            }\n\n            if (!chain.Contracts.TryGetValue(baseData.Symbol, out var contract))\n            {\n                contract = OptionContract.Create(baseData, security, chain.Underlying);\n                chain.Contracts[baseData.Symbol] = contract;\n\n                if (option != null)\n                {\n                    contract.SetOptionPriceModel(() => option.EvaluatePriceModel(sliceFuture.Value, contract));\n                }\n            }\n\n            contract.Update(baseData);\n            chain.AddData(baseData);\n\n            return true;\n        }\n\n\n        private bool HandleFuturesData(DateTime algorithmTime, BaseData baseData, FuturesChains futuresChains, ISecurityPrice security, SubscriptionDataConfig configuration)\n        {\n            var symbol = baseData.Symbol;\n\n            FuturesChain chain;\n            var canonical = symbol.Canonical;\n            if (!futuresChains.TryGetValue(canonical, out chain))\n            {\n                // We don't create a chain for internal feeds, this data might belong to a continuous mapping future\n                if (configuration.IsInternalFeed)\n                {\n                    return false;\n                }\n\n                chain = new FuturesChain(canonical, algorithmTime);\n                futuresChains[canonical] = chain;\n            }\n\n            var universeData = baseData as BaseDataCollection;\n            if (universeData != null)\n            {\n                foreach (var contractSymbol in universeData.FilteredContracts ?? Enumerable.Empty<Symbol>())\n                {\n                    chain.FilteredContracts.Add(contractSymbol);\n                }\n                return false;\n            }\n\n            if (!chain.Contracts.TryGetValue(baseData.Symbol, out var contract))\n            {\n                // We don't create a contract for internal feeds, this data might belong to a continuous mapping future\n                if (configuration.IsInternalFeed)\n                {\n                    return false;\n                }\n\n                contract = new FuturesContract(baseData.Symbol);\n                chain.Contracts[baseData.Symbol] = contract;\n            }\n\n            contract.Update(baseData);\n            chain.AddData(baseData);\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Transport/LocalFileSubscriptionStreamReader.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing Ionic.Zip;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Transport\n{\n    /// <summary>\n    /// Represents a stream reader capable of reading lines from disk\n    /// </summary>\n    public class LocalFileSubscriptionStreamReader : IStreamReader\n    {\n        private readonly ZipFile _zipFile;\n\n        /// <summary>\n        /// Gets whether or not this stream reader should be rate limited\n        /// </summary>\n        public bool ShouldBeRateLimited => false;\n\n        /// <summary>\n        /// Direct access to the StreamReader instance\n        /// </summary>\n        public StreamReader StreamReader { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalFileSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">The <see cref=\"IDataCacheProvider\"/> used to retrieve a stream of data</param>\n        /// <param name=\"source\">The local file to be read</param>\n        /// <param name=\"entryName\">Specifies the zip entry to be opened. Leave null if not applicable,\n        /// or to open the first zip entry found regardless of name</param>\n        public LocalFileSubscriptionStreamReader(IDataCacheProvider dataCacheProvider, string source, string entryName = null)\n        {\n            var stream = dataCacheProvider.Fetch(source);\n\n            if (stream != null)\n            {\n                StreamReader = new StreamReader(stream);\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalFileSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">The <see cref=\"IDataCacheProvider\"/> used to retrieve a stream of data</param>\n        /// <param name=\"source\">The local file to be read</param>\n        /// <param name=\"startingPosition\">The position in the stream from which to start reading</param>\n        public LocalFileSubscriptionStreamReader(IDataCacheProvider dataCacheProvider, string source, long startingPosition)\n        {\n            var stream = dataCacheProvider.Fetch(source);\n\n            if (stream != null)\n            {\n                StreamReader = new StreamReader(stream);\n\n                if (startingPosition != 0)\n                {\n                    StreamReader.BaseStream.Seek(startingPosition, SeekOrigin.Begin);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LocalFileSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"zipFile\">The local zip archive to be read</param>\n        /// <param name=\"entryName\">Specifies the zip entry to be opened. Leave null if not applicable,\n        /// or to open the first zip entry found regardless of name</param>\n        public LocalFileSubscriptionStreamReader(ZipFile zipFile, string entryName = null)\n        {\n            _zipFile = zipFile;\n            var entry = _zipFile.Entries.FirstOrDefault(x => entryName == null || string.Compare(x.FileName, entryName, StringComparison.OrdinalIgnoreCase) == 0);\n            if (entry != null)\n            {\n                var stream = new MemoryStream();\n                entry.OpenReader().CopyTo(stream);\n                stream.Position = 0;\n                StreamReader = new StreamReader(stream);\n            }\n        }\n\n        /// <summary>\n        /// Returns the list of zip entries if local file stream reader is reading zip archive\n        /// </summary>\n        public IEnumerable<string> EntryFileNames\n        {\n            get\n            {\n                return _zipFile != null ? _zipFile.Entries.Select(x => x.FileName).ToList() : Enumerable.Empty<string>();\n            }\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"SubscriptionTransportMedium.LocalFile\"/>\n        /// </summary>\n        public SubscriptionTransportMedium TransportMedium\n        {\n            get { return SubscriptionTransportMedium.LocalFile; }\n        }\n\n        /// <summary>\n        /// Gets whether or not there's more data to be read in the stream\n        /// </summary>\n        public bool EndOfStream\n        {\n            get { return StreamReader == null || StreamReader.EndOfStream; }\n        }\n\n        /// <summary>\n        /// Gets the next line/batch of content from the stream\n        /// </summary>\n        public string ReadLine()\n        {\n            return StreamReader.ReadLine();\n        }\n\n        /// <summary>\n        /// Disposes of the stream\n        /// </summary>\n        public void Dispose()\n        {\n            if (StreamReader != null)\n            {\n                StreamReader.Dispose();\n                StreamReader = null;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Engine/DataFeeds/Transport/ObjectStoreSubscriptionStreamReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing Ionic.Zip;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Transport\n{\n    /// <summary>\n    /// Represents a stream reader capable of reading lines from the object store\n    /// </summary>\n    public class ObjectStoreSubscriptionStreamReader : IStreamReader\n    {\n        private IObjectStore _objectStore;\n        private string _key;\n        private StreamReader _streamReader;\n\n        /// <summary>\n        /// Gets whether or not this stream reader should be rate limited\n        /// </summary>\n        public bool ShouldBeRateLimited => false;\n\n        /// <summary>\n        /// Direct access to the StreamReader instance\n        /// </summary>\n        public StreamReader StreamReader\n        {\n            get\n            {\n                if (_streamReader == null && !string.IsNullOrEmpty(_key) && _objectStore.ContainsKey(_key))\n                {\n                    var data = _objectStore.ReadBytes(_key);\n                    var stream = new MemoryStream(data);\n\n                    if (_key.EndsWith(\".zip\", StringComparison.InvariantCulture))\n                    {\n                        using var zipFile = ZipFile.Read(stream);\n                        // we only support single file zip files for now\n                        var zipEntry = zipFile[0];\n                        var tempStream = new MemoryStream();\n                        zipEntry.Extract(tempStream);\n                        tempStream.Position = 0;\n                        _streamReader = new StreamReader(tempStream);\n\n                        stream.DisposeSafely();\n                    }\n                    else\n                    {\n                        _streamReader = new StreamReader(stream);\n                    }\n                }\n\n                return _streamReader;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ObjectStoreSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"objectStore\">The <see cref=\"IObjectStore\"/> used to retrieve a stream of data</param>\n        /// <param name=\"key\">The object store key the data should be fetched from</param>\n        public ObjectStoreSubscriptionStreamReader(IObjectStore objectStore, string key)\n        {\n            _objectStore = objectStore;\n            _key = key;\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"SubscriptionTransportMedium.LocalFile\"/>\n        /// </summary>\n        public SubscriptionTransportMedium TransportMedium\n        {\n            get { return SubscriptionTransportMedium.ObjectStore; }\n        }\n\n        /// <summary>\n        /// Gets whether or not there's more data to be read in the stream\n        /// </summary>\n        public bool EndOfStream\n        {\n            get { return StreamReader == null || StreamReader.EndOfStream; }\n        }\n\n        /// <summary>\n        /// Gets the next line/batch of content from the stream\n        /// </summary>\n        public string ReadLine()\n        {\n            return StreamReader.ReadLine();\n        }\n\n        /// <summary>\n        /// Disposes of the stream\n        /// </summary>\n        public void Dispose()\n        {\n            if (_streamReader != null)\n            {\n                _streamReader.Dispose();\n                _streamReader = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Transport/RemoteFileSubscriptionStreamReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Transport\n{\n    /// <summary>\n    /// Represents a stream reader capabable of downloading a remote file and then\n    /// reading it from disk\n    /// </summary>\n    public class RemoteFileSubscriptionStreamReader : IStreamReader\n    {\n        private readonly IStreamReader _streamReader;\n        private static IDownloadProvider _downloader;\n        // lock for multi thread scenarios where we are sharing the same cached file\n        private static readonly object _fileSystemLock = new object();\n\n        /// <summary>\n        /// Gets whether or not this stream reader should be rate limited\n        /// </summary>\n        public bool ShouldBeRateLimited => false;\n\n        /// <summary>\n        /// Direct access to the StreamReader instance\n        /// </summary>\n        public StreamReader StreamReader => _streamReader.StreamReader;\n\n        /// <summary>\n        /// The local file name of the downloaded file\n        /// </summary>\n        public string LocalFileName { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RemoteFileSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"dataCacheProvider\">The <see cref=\"IDataCacheProvider\"/> used to retrieve a stream of data</param>\n        /// <param name=\"source\">The remote url to be downloaded via web client</param>\n        /// <param name=\"downloadDirectory\">The local directory and destination of the download</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        public RemoteFileSubscriptionStreamReader(IDataCacheProvider dataCacheProvider, string source, string downloadDirectory, IEnumerable<KeyValuePair<string, string>> headers)\n        {\n            // don't use cache if data is ephemeral\n            // will be false for live history requests and live subscriptions\n            var useCache = !dataCacheProvider.IsDataEphemeral;\n\n            // create a hash for a new filename\n            string baseFileName = string.Empty;\n            string extension = string.Empty;\n            string entryName = string.Empty;\n            try\n            {\n                var uri = new Uri(source);\n                baseFileName = uri.OriginalString;\n                if (!string.IsNullOrEmpty(uri.Fragment))\n                {\n                    baseFileName = baseFileName.Replace(uri.Fragment, \"\", StringComparison.InvariantCulture);\n                }\n                extension = uri.AbsolutePath.GetExtension();\n                entryName = uri.Fragment;\n            }\n            catch\n            {\n                LeanData.ParseKey(source, out baseFileName, out entryName);\n                extension = Path.GetExtension(baseFileName);\n            }\n\n            var cacheFileName = (useCache ? baseFileName.ToMD5() : Guid.NewGuid().ToString()) + extension;\n            LocalFileName = Path.Combine(downloadDirectory, cacheFileName);\n\n            byte[] bytes = null;\n            if (useCache)\n            {\n                lock (_fileSystemLock)\n                {\n                    if (!File.Exists(LocalFileName))\n                    {\n                        bytes = _downloader.DownloadBytes(source, headers, null, null);\n                    }\n                }\n            }\n            else\n            {\n                bytes = _downloader.DownloadBytes(source, headers, null, null);\n            }\n\n            if (bytes != null)\n            {\n                File.WriteAllBytes(LocalFileName, bytes);\n\n                // Send the file to the dataCacheProvider so it is available when the streamReader asks for it\n                dataCacheProvider.Store(LocalFileName, bytes);\n            }\n\n            // now we can just use the local file reader.\n            // add the entry name to the local file name so the correct entry is read\n            var fileNameWithEntry = LocalFileName;\n            if (!string.IsNullOrEmpty(entryName))\n            {\n                fileNameWithEntry += entryName;\n            }\n            _streamReader = new LocalFileSubscriptionStreamReader(dataCacheProvider, fileNameWithEntry);\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"SubscriptionTransportMedium.RemoteFile\"/>\n        /// </summary>\n        public SubscriptionTransportMedium TransportMedium\n        {\n            get { return SubscriptionTransportMedium.RemoteFile; }\n        }\n\n        /// <summary>\n        /// Gets whether or not there's more data to be read in the stream\n        /// </summary>\n        public bool EndOfStream\n        {\n            get { return _streamReader.EndOfStream; }\n        }\n\n        /// <summary>\n        /// Gets the next line/batch of content from the stream\n        /// </summary>\n        public string ReadLine()\n        {\n            return _streamReader.ReadLine();\n        }\n\n        /// <summary>\n        /// Disposes of the stream\n        /// </summary>\n        public void Dispose()\n        {\n            _streamReader.Dispose();\n        }\n\n        /// <summary>\n        /// Save reference to the download system.\n        /// </summary>\n        /// <param name=\"downloader\">Downloader provider for the remote file fetching.</param>\n        public static void SetDownloadProvider(IDownloadProvider downloader)\n        {\n            _downloader = downloader;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/Transport/RestSubscriptionStreamReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.Transport\n{\n    /// <summary>\n    /// Represents a stream reader capable of polling a rest client\n    /// </summary>\n    public class RestSubscriptionStreamReader : IStreamReader\n    {\n        private static readonly HttpClient _client = new HttpClient();\n\n        private readonly string _baseUrl;\n        private readonly Dictionary<string, string> _headers;\n        private readonly bool _isLiveMode;\n        private bool _delivered;\n\n        /// <summary>\n        /// Gets whether or not this stream reader should be rate limited\n        /// </summary>\n        public bool ShouldBeRateLimited => _isLiveMode;\n\n        /// <summary>\n        /// Direct access to the StreamReader instance\n        /// </summary>\n        public StreamReader StreamReader => null;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RestSubscriptionStreamReader\"/> class.\n        /// </summary>\n        /// <param name=\"source\">The source url to poll with a GET</param>\n        /// <param name=\"headers\">Defines header values to add to the request</param>\n        /// <param name=\"isLiveMode\">True for live mode, false otherwise</param>\n        public RestSubscriptionStreamReader(string source, IEnumerable<KeyValuePair<string, string>> headers, bool isLiveMode)\n        {\n            _baseUrl = source;\n            if (headers != null)\n            {\n                _headers = new Dictionary<string, string>(headers);\n            }\n            _isLiveMode = isLiveMode;\n            _delivered = false;\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"SubscriptionTransportMedium.Rest\"/>\n        /// </summary>\n        public SubscriptionTransportMedium TransportMedium\n        {\n            get { return SubscriptionTransportMedium.Rest; }\n        }\n\n        /// <summary>\n        /// Gets whether or not there's more data to be read in the stream\n        /// </summary>\n        public bool EndOfStream\n        {\n            get { return !_isLiveMode && _delivered; }\n        }\n\n        /// <summary>\n        /// Gets the next line/batch of content from the stream\n        /// </summary>\n        public string ReadLine()\n        {\n            try\n            {\n                if (_client.TryDownloadData(_baseUrl, out string data, out _, _headers))\n                {\n                    _delivered = true;\n                    return data;\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n            }\n\n            return string.Empty;\n        }\n\n        /// <summary>\n        /// This stream reader doesn't require disposal\n        /// </summary>\n        public void Dispose()\n        {\n            _client.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/UniverseSelection.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides methods for apply the results of universe selection to an algorithm\n    /// </summary>\n    public class UniverseSelection\n    {\n        private IDataFeedSubscriptionManager _dataManager;\n        private readonly IAlgorithm _algorithm;\n        private readonly ISecurityService _securityService;\n        private readonly Dictionary<DateTime, Dictionary<Symbol, Security>> _pendingSecurityAdditions = new Dictionary<DateTime, Dictionary<Symbol, Security>>();\n        private readonly PendingRemovalsManager _pendingRemovalsManager;\n        private readonly CurrencySubscriptionDataConfigManager _currencySubscriptionDataConfigManager;\n        private readonly InternalSubscriptionManager _internalSubscriptionManager;\n        private bool _initializedSecurityBenchmark;\n        private bool _anyDoesNotHaveFundamentalDataWarningLogged;\n        private readonly SecurityChangesConstructor _securityChangesConstructor;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniverseSelection\"/> class\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm to add securities to</param>\n        /// <param name=\"securityService\">The security service</param>\n        /// <param name=\"dataPermissionManager\">The data permissions manager</param>\n        /// <param name=\"dataProvider\">The data provider to use</param>\n        /// <param name=\"internalConfigResolution\">The resolution to use for internal configuration</param>\n        public UniverseSelection(\n            IAlgorithm algorithm,\n            ISecurityService securityService,\n            IDataPermissionManager dataPermissionManager,\n            IDataProvider dataProvider,\n            Resolution internalConfigResolution = Resolution.Minute)\n        {\n            _algorithm = algorithm;\n            _securityService = securityService;\n            _pendingRemovalsManager = new PendingRemovalsManager(algorithm.Transactions);\n            _currencySubscriptionDataConfigManager = new CurrencySubscriptionDataConfigManager(algorithm.Portfolio.CashBook,\n                algorithm.Securities,\n                algorithm.SubscriptionManager,\n                _securityService,\n                Resolution.Minute);\n            // TODO: next step is to merge currency internal subscriptions under the same 'internal manager' instance and we could move this directly into the DataManager class\n            _internalSubscriptionManager = new InternalSubscriptionManager(_algorithm, internalConfigResolution);\n            _securityChangesConstructor = new SecurityChangesConstructor();\n        }\n\n        /// <summary>\n        /// Sets the data manager\n        /// </summary>\n        public void SetDataManager(IDataFeedSubscriptionManager dataManager)\n        {\n            if (_dataManager != null)\n            {\n                throw new Exception(\"UniverseSelection.SetDataManager(): can only be set once\");\n            }\n            _dataManager = dataManager;\n\n            _internalSubscriptionManager.Added += (sender, request) =>\n            {\n                _dataManager.AddSubscription(request);\n            };\n            _internalSubscriptionManager.Removed += (sender, request) =>\n            {\n                _dataManager.RemoveSubscription(request.Configuration);\n            };\n        }\n\n        /// <summary>\n        /// Applies universe selection the the data feed and algorithm\n        /// </summary>\n        /// <param name=\"universe\">The universe to perform selection on</param>\n        /// <param name=\"dateTimeUtc\">The current date time in utc</param>\n        /// <param name=\"universeData\">The data provided to perform selection with</param>\n        public SecurityChanges ApplyUniverseSelection(Universe universe, DateTime dateTimeUtc, BaseDataCollection universeData)\n        {\n            var algorithmEndDateUtc = _algorithm.EndDate.ConvertToUtc(_algorithm.TimeZone);\n            if (dateTimeUtc > algorithmEndDateUtc)\n            {\n                return SecurityChanges.None;\n            }\n\n            IEnumerable<Symbol> selectSymbolsResult;\n\n            // check if this universe must be filtered with fine fundamental data\n            Universe fineFiltered = (universe as FineFundamentalFilteredUniverse)?.FineFundamentalUniverse;\n            fineFiltered ??= (universe as FundamentalFilteredUniverse)?.FundamentalUniverse;\n\n            if (fineFiltered != null\n                // if the universe has been disposed we don't perform selection. This us handled bellow by 'Universe.PerformSelection'\n                // but in this case we directly call 'SelectSymbols' because we want to perform fine selection even if coarse returns the same\n                // symbols, see 'Universe.PerformSelection', which detects this and returns 'Universe.Unchanged'\n                && !universe.DisposeRequested)\n            {\n                // perform initial filtering and limit the result\n                selectSymbolsResult = universe.SelectSymbols(dateTimeUtc, universeData);\n\n                if (!ReferenceEquals(selectSymbolsResult, Universe.Unchanged))\n                {\n                    // prepare a BaseDataCollection of FineFundamental instances\n                    var fineCollection = new BaseDataCollection();\n\n                    // if the input is already fundamental data we just need to filter it and pass it through\n                    var hasFundamentalData = universeData.Data.Count > 0 && universeData.Data[0] is Fundamental;\n                    if(hasFundamentalData)\n                    {\n                        // Remove selected symbols that does not have fine fundamental data\n                        var anyDoesNotHaveFundamentalData = false;\n\n                        // only pre filter selected symbols if there actually is any fundamental data. This way we can support custom universe filtered by fine fundamental data\n                        // which do not use coarse data as underlying, in which case it could happen that we try to load fine fundamental data that is missing, but no problem,\n                        // 'FineFundamentalSubscriptionEnumeratorFactory' won't emit it\n                        var set = selectSymbolsResult.ToHashSet();\n                        fineCollection.Data.AddRange(universeData.Data.OfType<Fundamental>().Where(fundamental => {\n                            // we remove to we distict by symbol\n                            if (set.Remove(fundamental.Symbol))\n                            {\n                                if (!fundamental.HasFundamentalData)\n                                {\n                                    anyDoesNotHaveFundamentalData = true;\n                                    return false;\n                                }\n                                return true;\n                            }\n                            return false;\n                        }));\n\n                        if (!_anyDoesNotHaveFundamentalDataWarningLogged && anyDoesNotHaveFundamentalData)\n                        {\n                            _algorithm.Debug(\"Note: Your coarse selection filter was updated to exclude symbols without fine fundamental data. Make sure your coarse filter excludes symbols where HasFundamental is false.\");\n                            _anyDoesNotHaveFundamentalDataWarningLogged = true;\n                        }\n                    }\n                    else\n                    {\n                        // we need to load the fundamental data\n                        var currentTime = dateTimeUtc.ConvertFromUtc(TimeZones.NewYork);\n                        foreach (var symbol in selectSymbolsResult)\n                        {\n                            fineCollection.Data.Add(new Fundamental(currentTime, symbol));\n                        }\n                    }\n\n                    universeData.Data = fineCollection.Data;\n                    // perform the fine fundamental universe selection\n                    selectSymbolsResult = fineFiltered.PerformSelection(dateTimeUtc, fineCollection);\n                }\n            }\n            else\n            {\n                // perform initial filtering and limit the result\n                selectSymbolsResult = universe.PerformSelection(dateTimeUtc, universeData);\n            }\n\n            if (!ReferenceEquals(selectSymbolsResult, Universe.Unchanged))\n            {\n                // materialize the enumerable into a set for processing\n                universe.Selected = selectSymbolsResult.ToHashSet();\n            }\n\n            // first check for no pending removals, even if the universe selection\n            // didn't change we might need to remove a security because a position was closed\n            RemoveSecurityFromUniverse(\n                _pendingRemovalsManager.CheckPendingRemovals(universe.Selected, universe),\n                dateTimeUtc,\n                algorithmEndDateUtc);\n\n            // check for no changes second\n            if (ReferenceEquals(selectSymbolsResult, Universe.Unchanged))\n            {\n                return SecurityChanges.None;\n            }\n\n            // determine which data subscriptions need to be removed from this universe\n            foreach (var member in universe.Securities.Values.OrderBy(member => member.Security.Symbol.SecurityType).ThenBy(x => x.Security.Symbol.ID))\n            {\n                var security = member.Security;\n                // if we've selected this subscription again, keep it\n                if (universe.Selected.Contains(security.Symbol)) continue;\n\n                // don't remove if the universe wants to keep him in\n                if (!universe.CanRemoveMember(dateTimeUtc, security)) continue;\n\n                if (!member.Security.IsDelisted && !_pendingRemovalsManager.IsPendingForRemoval(member))\n                {\n                    // TODO: here we are not checking if other universes have this security still selected\n                    _securityChangesConstructor.Remove(member.Security, member.IsInternal);\n                }\n\n                RemoveSecurityFromUniverse(_pendingRemovalsManager.TryRemoveMember(member, universe),\n                    dateTimeUtc,\n                    algorithmEndDateUtc);\n            }\n\n            Dictionary<Symbol, Security> pendingAdditions;\n            if (!_pendingSecurityAdditions.TryGetValue(dateTimeUtc, out pendingAdditions))\n            {\n                // if the frontier moved forward then we've added these securities to the algorithm\n                _pendingSecurityAdditions.Clear();\n\n                // keep track of created securities so we don't create the same security twice, leads to bad things :)\n                pendingAdditions = new Dictionary<Symbol, Security>();\n                _pendingSecurityAdditions[dateTimeUtc] = pendingAdditions;\n            }\n\n            // find new selections and add them to the algorithm\n            foreach (var symbol in universe.Selected)\n            {\n                if (universe.Securities.ContainsKey(symbol))\n                {\n                    // if its already part of the universe no need to re add it\n                    continue;\n                }\n\n                Security underlying = null;\n                if (symbol.HasUnderlying)\n                {\n                    underlying = GetOrCreateSecurity(pendingAdditions, symbol.Underlying, universe.UniverseSettings);\n                }\n                // create the new security, the algorithm thread will add this at the appropriate time\n                var security = GetOrCreateSecurity(pendingAdditions, symbol, universe.UniverseSettings, underlying);\n\n                var addedSubscription = false;\n                var dataFeedAdded = false;\n                var internalFeed = true;\n                foreach (var request in universe.GetSubscriptionRequests(security, dateTimeUtc, algorithmEndDateUtc,\n                                                                         _algorithm.SubscriptionManager.SubscriptionDataConfigService))\n                {\n                    if (!request.TradableDaysInDataTimeZone.Any())\n                    {\n                        // Remove the config from the data manager. universe.GetSubscriptionRequests() might have added the configs\n                        _dataManager.RemoveSubscription(request.Configuration, universe);\n                        continue;\n                    }\n\n                    if (security.Symbol == request.Configuration.Symbol // Just in case check its the same symbol, else AddData will throw.\n                        && !security.Subscriptions.Contains(request.Configuration))\n                    {\n                        // For now this is required for retro compatibility with usages of security.Subscriptions\n                        security.AddData(request.Configuration);\n                    }\n\n                    var toRemove = _currencySubscriptionDataConfigManager.GetSubscriptionDataConfigToRemove(request.Configuration.Symbol);\n                    if (toRemove != null)\n                    {\n                        Log.Trace($\"UniverseSelection.ApplyUniverseSelection(): Removing internal currency data feed {toRemove}\");\n                        _dataManager.RemoveSubscription(toRemove);\n                    }\n\n                    // 'dataFeedAdded' will help us notify the user for security changes only once per non internal subscription\n                    // for example two universes adding the sample configuration, we don't want two notifications\n                    dataFeedAdded = _dataManager.AddSubscription(request);\n\n                    // only update our security changes if we actually added data\n                    if (!request.IsUniverseSubscription)\n                    {\n                        addedSubscription = true;\n                        // if any config isn't internal then it's not internal\n                        internalFeed &= request.Configuration.IsInternalFeed;\n                        _internalSubscriptionManager.AddedSubscriptionRequest(request);\n                    }\n                }\n\n                if (addedSubscription)\n                {\n                    var addedMember = universe.AddMember(dateTimeUtc, security, internalFeed);\n\n                    if (addedMember && dataFeedAdded)\n                    {\n                        _securityChangesConstructor.Add(security, internalFeed);\n                    }\n                }\n            }\n\n            var securityChanges = _securityChangesConstructor.Flush();\n\n            // Add currency data feeds that weren't explicitly added in Initialize\n            if (securityChanges.AddedSecurities.Count > 0)\n            {\n                EnsureCurrencyDataFeeds(securityChanges);\n            }\n\n            if (securityChanges != SecurityChanges.None && Log.DebuggingEnabled)\n            {\n                // for performance lets not create the message string if debugging is not enabled\n                // this can be executed many times and its in the algorithm thread\n                Log.Debug(\"UniverseSelection.ApplyUniverseSelection(): \" + dateTimeUtc + \": \" + securityChanges);\n            }\n\n            SeedAddedSecurities(securityChanges);\n\n            return securityChanges;\n        }\n\n        /// <summary>\n        /// Will add any pending internal currency subscriptions\n        /// </summary>\n        /// <param name=\"utcStart\">The current date time in utc</param>\n        /// <returns>Will return true if any subscription was added</returns>\n        public bool AddPendingInternalDataFeeds(DateTime utcStart)\n        {\n            var added = false;\n            if (!_initializedSecurityBenchmark)\n            {\n                _initializedSecurityBenchmark = true;\n\n                var securityBenchmark = _algorithm.Benchmark as SecurityBenchmark;\n                if (securityBenchmark != null)\n                {\n                    var resolution = _algorithm.LiveMode ? Resolution.Minute : Resolution.Hour;\n\n                    // Check that the tradebar subscription we are using can support this resolution GH #5893\n                    var subscriptionType = _algorithm.SubscriptionManager.SubscriptionDataConfigService.LookupSubscriptionConfigDataTypes(securityBenchmark.Security.Type, resolution, securityBenchmark.Security.Symbol.IsCanonical()).First();\n                    var symbol = securityBenchmark.Security.Symbol;\n                    var isCustomData = false;\n\n                    // Check if the benchmark security is a custom data in order to make sure we get the correct\n                    // type\n                    if (symbol.SecurityType == SecurityType.Base)\n                    {\n                        var symbolDataConfigs = _algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol);\n                        if (symbolDataConfigs.Any())\n                        {\n                            subscriptionType = new Tuple<Type, TickType>(symbolDataConfigs.First().Type, TickType.Trade);\n                            isCustomData = true;\n                        }\n                    }\n\n                    var baseInstance = subscriptionType.Item1.GetBaseDataInstance();\n                    baseInstance.Symbol = securityBenchmark.Security.Symbol;\n                    var supportedResolutions = baseInstance.SupportedResolutions();\n                    if (!supportedResolutions.Contains(resolution))\n                    {\n                        resolution = supportedResolutions.OrderByDescending(x => x).First();\n                    }\n\n                    var subscriptionList = new List<Tuple<Type, TickType>>() {subscriptionType};\n                    var dataConfig = _algorithm.SubscriptionManager.SubscriptionDataConfigService.Add(\n                        securityBenchmark.Security.Symbol,\n                        resolution,\n                        isInternalFeed: true,\n                        fillForward: false,\n                        isCustomData: isCustomData,\n                        subscriptionDataTypes: subscriptionList\n                        ).First();\n\n                    // we want to start from the previous tradable bar so the benchmark security\n                    // never has 0 price\n                    var previousTradableBar = Time.GetStartTimeForTradeBars(\n                        securityBenchmark.Security.Exchange.Hours,\n                        utcStart.ConvertFromUtc(securityBenchmark.Security.Exchange.TimeZone),\n                        _algorithm.LiveMode ? Time.OneMinute : Time.OneDay,\n                        1,\n                        false,\n                        dataConfig.DataTimeZone,\n                        LeanData.UseStrictEndTime(_algorithm.Settings.DailyPreciseEndTime, securityBenchmark.Security.Symbol, _algorithm.LiveMode ? Time.OneMinute : Time.OneDay, securityBenchmark.Security.Exchange.Hours)\n                        ).ConvertToUtc(securityBenchmark.Security.Exchange.TimeZone);\n\n                    if (dataConfig != null)\n                    {\n                        added |= _dataManager.AddSubscription(new SubscriptionRequest(\n                            false,\n                            null,\n                            securityBenchmark.Security,\n                            dataConfig,\n                            previousTradableBar,\n                            _algorithm.EndDate.ConvertToUtc(_algorithm.TimeZone)));\n\n                        Log.Trace($\"UniverseSelection.AddPendingInternalDataFeeds(): Adding internal benchmark data feed {dataConfig}\");\n                    }\n                }\n            }\n\n            if (_currencySubscriptionDataConfigManager.UpdatePendingSubscriptionDataConfigs(_algorithm.BrokerageModel))\n            {\n                foreach (var subscriptionDataConfig in _currencySubscriptionDataConfigManager\n                    .GetPendingSubscriptionDataConfigs())\n                {\n                    var security = _algorithm.Securities[subscriptionDataConfig.Symbol];\n                    added |= _dataManager.AddSubscription(new SubscriptionRequest(\n                        false,\n                        null,\n                        security,\n                        subscriptionDataConfig,\n                        utcStart,\n                        _algorithm.EndDate.ConvertToUtc(_algorithm.TimeZone)));\n                }\n            }\n            return added;\n        }\n\n        /// <summary>\n        /// Checks the current subscriptions and adds necessary currency pair feeds to provide real time conversion data\n        /// </summary>\n        public void EnsureCurrencyDataFeeds(SecurityChanges securityChanges)\n        {\n            _currencySubscriptionDataConfigManager.EnsureCurrencySubscriptionDataConfigs(securityChanges, _algorithm.BrokerageModel);\n        }\n\n        /// <summary>\n        /// Handles the delisting process of the given data symbol from the algorithm securities\n        /// </summary>\n        public SecurityChanges HandleDelisting(BaseData data, bool isInternalFeed)\n        {\n            if (_algorithm.Securities.TryGetValue(data.Symbol, out var security))\n            {\n                // don't allow users to open a new position once delisted\n                security.IsDelisted = true;\n                security.Reset();\n\n                _algorithm.Securities.Remove(data.Symbol);\n\n                // Add the security removal to the security changes but only if not pending for removal.\n                // If pending, the removed change event was already emitted for this security\n                if (!_pendingRemovalsManager.IsPendingForRemoval(security, isInternalFeed))\n                {\n                    _securityChangesConstructor.Remove(security, isInternalFeed);\n\n                    return _securityChangesConstructor.Flush();\n                }\n            }\n\n            return SecurityChanges.None;\n        }\n\n        private void RemoveSecurityFromUniverse(\n            List<PendingRemovalsManager.RemovedMember> removedMembers,\n            DateTime dateTimeUtc,\n            DateTime algorithmEndDateUtc)\n        {\n            if (removedMembers == null)\n            {\n                return;\n            }\n            foreach (var removedMember in removedMembers)\n            {\n                var universe = removedMember.Universe;\n                var member = removedMember.Security;\n\n                // safe to remove the member from the universe\n                universe.RemoveMember(dateTimeUtc, member);\n\n                var isActive = _algorithm.UniverseManager.ActiveSecurities.ContainsKey(member.Symbol);\n                foreach (var subscription in universe.GetSubscriptionRequests(member, dateTimeUtc, algorithmEndDateUtc,\n                                                                              _algorithm.SubscriptionManager.SubscriptionDataConfigService))\n                {\n                    if (_dataManager.RemoveSubscription(subscription.Configuration, universe))\n                    {\n                        _internalSubscriptionManager.RemovedSubscriptionRequest(subscription);\n\n                        // if not used by any universe\n                        if (!isActive)\n                        {\n                            member.Reset();\n                            // We need to mark this security as untradeable while it has no data subscription\n                            // it is expected that this function is called while in sync with the algo thread,\n                            // so we can make direct edits to the security here.\n                            // We only clear the cache once the subscription is removed from the data stack\n                            // Note: Security.Reset() won't clear the cache, it only clears the data subscription\n                            // and marks it as non-tradable, because in some cases the cache needs to be kept,\n                            // like when delisting, which could lead to a liquidation or option exercise.\n                            member.Cache.Reset();\n\n                            _algorithm.Securities.Remove(member.Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        private Security GetOrCreateSecurity(Dictionary<Symbol, Security> pendingAdditions, Symbol symbol, UniverseSettings universeSettings, Security underlying = null)\n        {\n            // create the new security, the algorithm thread will add this at the appropriate time\n            Security security;\n            if (!pendingAdditions.TryGetValue(symbol, out security))\n            {\n                security = _securityService.CreateSecurity(symbol,\n                    (List<SubscriptionDataConfig>)null,\n                    universeSettings.Leverage,\n                    symbol.ID.SecurityType.IsOption(),\n                    underlying,\n                    // Securities will be seeded after all selections are applied\n                    seedSecurity: false);\n\n                pendingAdditions.Add(symbol, security);\n            }\n\n            return security;\n        }\n\n        private void SeedAddedSecurities(SecurityChanges changes)\n        {\n            if (_algorithm.Settings.SeedInitialPrices)\n            {\n                AlgorithmUtils.SeedSecurities(changes.AddedSecurities, _algorithm);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/UpdateData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Transport type for algorithm update data. This is intended to provide a\n    /// list of base data used to perform updates against the specified target\n    /// </summary>\n    /// <typeparam name=\"T\">The target type</typeparam>\n    public class UpdateData<T>\n    {\n        /// <summary>\n        /// Flag indicating whether <see cref=\"Data\"/> contains any fill forward bar or not\n        /// </summary>\n        /// <remarks>This is useful for performance, it allows consumers to skip re enumerating the entire data\n        /// list to filter any fill forward data</remarks>\n        public bool? ContainsFillForwardData { get; init; }\n\n        /// <summary>\n        /// The target, such as a security or subscription data config\n        /// </summary>\n        public T Target { get; init; }\n\n        /// <summary>\n        /// The data used to update the target\n        /// </summary>\n        public IReadOnlyList<BaseData> Data { get; init; }\n\n        /// <summary>\n        /// The type of data in the data list\n        /// </summary>\n        public Type DataType { get; init; }\n\n        /// <summary>\n        /// True if this update data corresponds to an internal subscription\n        /// such as currency or security benchmark\n        /// </summary>\n        public bool IsInternalConfig { get; init; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateData{T}\"/> class\n        /// </summary>\n        /// <param name=\"target\">The end consumer/user of the dat</param>\n        /// <param name=\"dataType\">The type of data in the list</param>\n        /// <param name=\"data\">The update data</param>\n        /// <param name=\"isInternalConfig\">True if this update data corresponds to an internal subscription\n        /// such as currency or security benchmark</param>\n        /// <param name=\"containsFillForwardData\">True if this update data contains fill forward bars</param>\n        public UpdateData(T target, Type dataType, IReadOnlyList<BaseData> data, bool isInternalConfig, bool? containsFillForwardData = null)\n        {\n            Target = target;\n            Data = data;\n            DataType = dataType;\n            IsInternalConfig = isInternalConfig;\n            ContainsFillForwardData = containsFillForwardData;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/WorkScheduling/BaseWorkScheduler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.WorkScheduling\n{\n    /// <summary>\n    /// Base work scheduler abstraction\n    /// </summary>\n    public abstract class WorkScheduler\n    {\n        /// <summary>\n        /// The quantity of workers to be used\n        /// </summary>\n        public static int WorkersCount = Configuration.Config.GetInt(\"data-feed-workers-count\", Environment.ProcessorCount);\n\n        /// <summary>\n        /// Add a new work item to the queue\n        /// </summary>\n        /// <param name=\"symbol\">The symbol associated with this work</param>\n        /// <param name=\"workFunc\">The work function to run</param>\n        /// <param name=\"weightFunc\">The weight function.\n        /// Work will be sorted in ascending order based on this weight</param>\n        public abstract void QueueWork(Symbol symbol, Func<int, bool> workFunc, Func<int> weightFunc);\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/WorkScheduling/WeightedWorkQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.WorkScheduling\n{\n    internal class WeightedWorkQueue\n    {\n        private int _pointer;\n        private bool _removed;\n        private Action _singleCallWork;\n        private readonly List<WorkItem> _workQueue;\n\n        /// <summary>\n        /// Event used to notify there is work ready to execute in this queue\n        /// </summary>\n        private AutoResetEvent _workAvailableEvent;\n\n        /// <summary>\n        /// Returns the thread priority to use for this work queue\n        /// </summary>\n        public ThreadPriority ThreadPriority => ThreadPriority.Lowest;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public WeightedWorkQueue()\n        {\n            _workQueue = new List<WorkItem>();\n            _workAvailableEvent = new AutoResetEvent(false);\n        }\n\n        /// <summary>\n        /// This is the worker thread loop.\n        /// It will first try to take a work item from the new work queue else will check his own queue.\n        /// </summary>\n        public void WorkerThread(ConcurrentQueue<WorkItem> newWork, AutoResetEvent newWorkEvent)\n        {\n            var waitHandles = new WaitHandle[] { _workAvailableEvent, newWorkEvent };\n            var waitedPreviousLoop = 0;\n            while (true)\n            {\n                WorkItem workItem;\n                if (!newWork.TryDequeue(out workItem))\n                {\n                    workItem = Get();\n                    if (workItem == null)\n                    {\n                        if(_singleCallWork != null)\n                        {\n                            try\n                            {\n                                _singleCallWork();\n                            }\n                            catch (Exception exception)\n                            {\n                                // this shouldn't happen but just in case\n                                Logging.Log.Error(exception);\n                            }\n                            // we execute this once only and clear it's reference\n                            _singleCallWork = null;\n                        }\n\n                        // no work to do, lets sleep and try again\n                        WaitHandle.WaitAny(waitHandles, Math.Min(1 + (waitedPreviousLoop * 10), 250));\n                        waitedPreviousLoop++;\n                        continue;\n                    }\n                }\n                else\n                {\n                    Add(workItem);\n                }\n\n                try\n                {\n                    waitedPreviousLoop = 0;\n                    if (!workItem.Work(WeightedWorkScheduler.WorkBatchSize))\n                    {\n                        Remove(workItem);\n                    }\n                }\n                catch (Exception exception)\n                {\n                    Remove(workItem);\n                    Logging.Log.Error(exception);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Adds a new item to this work queue\n        /// </summary>\n        /// <param name=\"work\">The work to add</param>\n        private void Add(WorkItem work)\n        {\n            _workQueue.Add(work);\n        }\n\n        /// <summary>\n        /// Adds a new item to this work queue\n        /// </summary>\n        /// <param name=\"work\">The work to add</param>\n        public void AddSingleCall(Action work)\n        {\n            _singleCallWork = work;\n            _workAvailableEvent.Set();\n        }\n\n        /// <summary>\n        /// Removes an item from the work queue\n        /// </summary>\n        /// <param name=\"workItem\">The work item to remove</param>\n        private void Remove(WorkItem workItem)\n        {\n            _workQueue.Remove(workItem);\n            _removed = true;\n        }\n\n        /// <summary>\n        /// Gets the next work item to process\n        /// </summary>\n        /// <returns>The work item to process, null if none available</returns>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        protected WorkItem Get()\n        {\n            var count = _workQueue.Count;\n            if (count == 0)\n            {\n                return null;\n            }\n            var countFactor = (10 + 10 / count) / 10;\n\n            if (_removed)\n            {\n                // if we removed an item don't really trust the pointer any more\n                _removed = false;\n                _pointer = Math.Min(_pointer, count - 1);\n            }\n\n            var initial = _pointer;\n            do\n            {\n                var item = _workQueue[_pointer++];\n                if (_pointer >= count)\n                {\n                    _pointer = 0;\n\n                    // this will only really make a difference if there are many work items\n                    if (25 > count)\n                    {\n                        // if we looped around let's sort the queue leave the jobs with less points at the start\n                        _workQueue.Sort(WorkItem.Compare);\n                    }\n                }\n\n                if (item.UpdateWeight() < WeightedWorkScheduler.MaxWorkWeight * countFactor)\n                {\n                    return item;\n                }\n            } while (initial != _pointer);\n\n            // no work item is ready, pointer still will keep it's same value\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/WorkScheduling/WeightedWorkScheduler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.WorkScheduling\n{\n    /// <summary>\n    /// This singleton class will create a thread pool to processes work\n    /// that will be prioritized based on it's weight\n    /// </summary>\n    /// <remarks>The threads in the pool will take ownership of the\n    /// <see cref=\"WorkItem\"/> and not share it with another thread.\n    /// This is required because the data enumerator stack yields, which state\n    /// depends on the thread id</remarks>\n    public class WeightedWorkScheduler : WorkScheduler\n    {\n        private static readonly Lazy<WeightedWorkScheduler> _instance = new Lazy<WeightedWorkScheduler>(() => new WeightedWorkScheduler());\n\n        /// <summary>\n        /// This is the size of each work sprint\n        /// </summary>\n        public const int WorkBatchSize = 50;\n\n        /// <summary>\n        /// This is the maximum size a work item can weigh,\n        /// if reached, it will be ignored and not executed until its less\n        /// </summary>\n        /// <remarks>This is useful to limit RAM and CPU usage</remarks>\n        public static int MaxWorkWeight;\n\n        private readonly ConcurrentQueue<WorkItem> _newWork;\n        private readonly AutoResetEvent _newWorkEvent;\n        private Task _initializationTask;\n        private readonly List<WeightedWorkQueue> _workerQueues;\n\n        /// <summary>\n        /// Singleton instance\n        /// </summary>\n        public static WeightedWorkScheduler Instance => _instance.Value;\n\n        private WeightedWorkScheduler()\n        {\n            _newWork = new ConcurrentQueue<WorkItem>();\n            _newWorkEvent = new AutoResetEvent(false);\n            _workerQueues = new List<WeightedWorkQueue>(WorkersCount);\n\n            _initializationTask = Task.Run(() =>\n            {\n                MaxWorkWeight = Configuration.Config.GetInt(\"data-feed-max-work-weight\", 400);\n                Logging.Log.Trace($\"WeightedWorkScheduler(): will use {WorkersCount} workers and MaxWorkWeight is {MaxWorkWeight}\");\n\n                for (var i = 0; i < WorkersCount; i++)\n                {\n                    var workQueue = new WeightedWorkQueue();\n                    _workerQueues.Add(workQueue);\n                    var thread = new Thread(() => workQueue.WorkerThread(_newWork, _newWorkEvent))\n                    {\n                        IsBackground = true,\n                        Priority = workQueue.ThreadPriority,\n                        Name = $\"WeightedWorkThread{i}\"\n                    };\n                    thread.Start();\n                }\n            });\n        }\n\n        /// <summary>\n        /// Add a new work item to the queue\n        /// </summary>\n        /// <param name=\"symbol\">The symbol associated with this work</param>\n        /// <param name=\"workFunc\">The work function to run</param>\n        /// <param name=\"weightFunc\">The weight function.\n        /// Work will be sorted in ascending order based on this weight</param>\n        public override void QueueWork(Symbol symbol, Func<int, bool> workFunc, Func<int> weightFunc)\n        {\n            _newWork.Enqueue(new WorkItem(workFunc, weightFunc));\n            _newWorkEvent.Set();\n        }\n\n        /// <summary>\n        /// Execute the given action in all workers once\n        /// </summary>\n        public void AddSingleCallForAll(Action action)\n        {\n            if (!_initializationTask.Wait(TimeSpan.FromSeconds(10)))\n            {\n                throw new TimeoutException(\"Timeout waiting for worker threads to start\");\n            }\n\n            for (var i = 0; i < _workerQueues.Count; i++)\n            {\n                _workerQueues[i].AddSingleCall(action);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/WorkScheduling/WorkItem.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds.WorkScheduling\n{\n    /// <summary>\n    /// Class to represent a work item\n    /// </summary>\n    public class WorkItem\n    {\n        /// <summary>\n        /// Function to determine weight of item\n        /// </summary>\n        private Func<int> _weightFunc;\n\n        /// <summary>\n        /// The current weight\n        /// </summary>\n        public int Weight { get; private set; }\n\n        /// <summary>\n        /// The work function to execute\n        /// </summary>\n        public Func<int, bool> Work { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"work\">The work function, takes an int, the amount of work to do\n        /// and returns a bool, false if this work item is finished</param>\n        /// <param name=\"weightFunc\">The function used to determine the current weight</param>\n        public WorkItem(Func<int, bool> work, Func<int> weightFunc)\n        {\n            Work = work;\n            _weightFunc = weightFunc;\n        }\n\n        /// <summary>\n        /// Updates the weight of this work item\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public int UpdateWeight()\n        {\n            Weight = _weightFunc();\n            return Weight;\n        }\n\n        /// <summary>\n        /// Compares two work items based on their weights\n        /// </summary>\n        public static int Compare(WorkItem obj, WorkItem other)\n        {\n            if (ReferenceEquals(obj, other))\n            {\n                return 0;\n            }\n            // By definition, any object compares greater than null\n            if (ReferenceEquals(obj, null))\n            {\n                return -1;\n            }\n            if (ReferenceEquals(null, other))\n            {\n                return 1;\n            }\n\n            return other.Weight.CompareTo(obj.Weight);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ZipDataCacheProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing Ionic.Zip;\nusing Ionic.Zlib;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing System.Collections.Concurrent;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// File provider implements optimized zip archives caching facility. Cache is thread safe.\n    /// </summary>\n    public class ZipDataCacheProvider : IDataCacheProvider\n    {\n        private readonly double _cacheSeconds;\n\n        // ZipArchive cache used by the class\n        private readonly ConcurrentDictionary<string, CachedZipFile> _zipFileCache = new ConcurrentDictionary<string, CachedZipFile>();\n        private readonly IDataProvider _dataProvider;\n        private readonly Timer _cacheCleaner;\n\n        /// <summary>\n        /// Property indicating the data is temporary in nature and should not be cached.\n        /// </summary>\n        public bool IsDataEphemeral { get; }\n\n        /// <summary>\n        /// Constructor that sets the <see cref=\"IDataProvider\"/> used to retrieve data\n        /// </summary>\n        public ZipDataCacheProvider(IDataProvider dataProvider, bool isDataEphemeral = true, double cacheTimer = double.NaN)\n        {\n            IsDataEphemeral = isDataEphemeral;\n            _cacheSeconds = double.IsNaN(cacheTimer) ? Config.GetDouble(\"zip-data-cache-provider\", 10) : cacheTimer;\n            _dataProvider = dataProvider;\n            _cacheCleaner = new Timer(state => CleanCache(), null, TimeSpan.FromSeconds(_cacheSeconds), Timeout.InfiniteTimeSpan);\n        }\n\n        /// <summary>\n        /// Does not attempt to retrieve any data\n        /// </summary>\n        public Stream Fetch(string key)\n        {\n            LeanData.ParseKey(key, out var filename, out var entryName);\n\n            // handles zip files\n            if (filename.EndsWith(\".zip\", StringComparison.InvariantCulture))\n            {\n                Stream stream = null;\n\n                try\n                {\n                    CachedZipFile existingZip;\n                    if (!_zipFileCache.TryGetValue(filename, out existingZip))\n                    {\n                        stream = CacheAndCreateEntryStream(filename, entryName);\n                    }\n                    else\n                    {\n                        try\n                        {\n                            lock (existingZip)\n                            {\n                                if (existingZip.Disposed)\n                                {\n                                    // bad luck, thread race condition\n                                    // it was disposed and removed after we got it\n                                    // so lets create it again and add it\n                                    stream = CacheAndCreateEntryStream(filename, entryName);\n                                }\n                                else\n                                {\n                                    existingZip.Refresh();\n                                    stream = CreateEntryStream(existingZip, entryName, filename);\n                                }\n                            }\n                        }\n                        catch (Exception exception)\n                        {\n                            if (exception is ZipException || exception is ZlibException)\n                            {\n                                Log.Error(\"ZipDataCacheProvider.Fetch(): Corrupt zip file/entry: \" + filename + \"#\" + entryName + \" Error: \" + exception);\n                            }\n                            else throw;\n                        }\n                    }\n\n                    return stream;\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err, \"Inner try/catch\");\n                    stream?.DisposeSafely();\n                    return null;\n                }\n            }\n            else\n            {\n                // handles text files\n                return _dataProvider.Fetch(filename);\n            }\n        }\n\n        /// <summary>\n        /// Store the data in the cache.\n        /// </summary>\n        /// <param name=\"key\">The source of the data, used as a key to retrieve data in the cache</param>\n        /// <param name=\"data\">The data as a byte array</param>\n        public void Store(string key, byte[] data)\n        {\n            LeanData.ParseKey(key, out var fileName, out var entryName);\n\n            // We only support writing to zips with this provider, we also need an entryName to write\n            // Return silently because RemoteFileSubscriptionStreamReader depends on this function not throwing.\n            if (!fileName.EndsWith(\".zip\", StringComparison.InvariantCulture) || entryName == null)\n            {\n                return;\n            }\n\n            // Only allow one thread at a time to modify our cache\n            lock (_zipFileCache)\n            {\n                // If its not in the cache, and can not be cached we need to create it\n                if (!_zipFileCache.TryGetValue(fileName, out var cachedZip) && !Cache(fileName, out cachedZip))\n                {\n                    // Create the zip, if successful, cache it for later use\n                    if (Compression.ZipCreateAppendData(fileName, entryName, data))\n                    {\n                        Cache(fileName, out _);\n                    }\n                    else\n                    {\n                        throw new InvalidOperationException($\"Failed to store data {fileName}#{entryName}\");\n                    }\n\n                    return;\n                }\n\n                lock (cachedZip)\n                {\n                    if (cachedZip.Disposed)\n                    {\n                        // if disposed and we have the lock means it's not in the dictionary anymore, let's assert it\n                        // but there is a window for another thread to add a **new/different** instance which is okay\n                        // we will pick it up on the store call bellow\n                        if (_zipFileCache.TryGetValue(fileName, out var existing) && ReferenceEquals(existing, cachedZip))\n                        {\n                            Log.Error($\"ZipDataCacheProvider.Store(): unexpected cache state for {fileName}\");\n                            throw new InvalidOperationException(\n                                \"LEAN entered an unexpected state. Please contact support@quantconnect.com so we may debug this further.\");\n                        }\n                        Store(key, data);\n                    }\n                    else\n                    {\n                        cachedZip.WriteEntry(entryName, data);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns a list of zip entries in a provided zip file\n        /// </summary>\n        public List<string> GetZipEntries(string zipFile)\n        {\n            if (!_zipFileCache.TryGetValue(zipFile, out var cachedZip))\n            {\n                if (!Cache(zipFile, out cachedZip))\n                {\n                    throw new ArgumentException($\"Failed to get zip entries from {zipFile}\");\n                }\n            }\n\n            lock (cachedZip)\n            {\n                cachedZip.Refresh();\n                return cachedZip.EntryCache.Keys.ToList();\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            // stop the cache cleaner timer\n            _cacheCleaner.DisposeSafely();\n            CachedZipFile zip;\n            foreach (var zipFile in _zipFileCache)\n            {\n                if (_zipFileCache.TryRemove(zipFile.Key, out zip))\n                {\n                    zip.DisposeSafely();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Remove items in the cache that are older than the cutoff date\n        /// </summary>\n        private void CleanCache()\n        {\n            var utcNow = DateTime.UtcNow;\n            try\n            {\n                var clearCacheIfOlderThan = utcNow.AddSeconds(-_cacheSeconds);\n                // clean all items that that are older than CacheSeconds than the current date\n                foreach (var zip in _zipFileCache)\n                {\n                    if (zip.Value.Uncache(clearCacheIfOlderThan))\n                    {\n                        // only clear items if they are not being used\n                        if (Monitor.TryEnter(zip.Value))\n                        {\n                            try\n                            {\n                                // we first dispose it since if written it will refresh the file on disk and we don't\n                                // want anyone reading it directly which should be covered by the entry being in the cache\n                                // and us holding the instance lock\n                                zip.Value.Dispose();\n                                // removing it from the cache\n                                _zipFileCache.TryRemove(zip.Key, out _);\n                            }\n                            finally\n                            {\n                                Monitor.Exit(zip.Value);\n                            }\n                        }\n                    }\n                }\n            }\n            finally\n            {\n                try\n                {\n                    var nextDueTime = Time.GetSecondUnevenWait((int)Math.Ceiling(_cacheSeconds * 1000));\n                    _cacheCleaner.Change(nextDueTime, Timeout.Infinite);\n                }\n                catch (ObjectDisposedException)\n                {\n                    // ignored disposed\n                }\n            }\n        }\n\n        private Stream CacheAndCreateEntryStream(string filename, string entryName)\n        {\n            Stream stream = null;\n            var dataStream = _dataProvider.Fetch(filename);\n\n            if (dataStream != null)\n            {\n                try\n                {\n                    var newItem = new CachedZipFile(dataStream, DateTime.UtcNow, filename);\n\n                    // here we don't need to lock over the cache item\n                    // because it was still not added in the cache\n                    stream = CreateEntryStream(newItem, entryName, filename);\n\n                    if (!_zipFileCache.TryAdd(filename, newItem))\n                    {\n                        // some other thread could of added it already, lets dispose ours\n                        newItem.Dispose();\n                    }\n                }\n                catch (Exception exception)\n                {\n                    // don't leak the file stream!\n                    dataStream.DisposeSafely();\n                    if (exception is ZipException || exception is ZlibException)\n                    {\n                        Log.Error(\"ZipDataCacheProvider.Fetch(): Corrupt zip file/entry: \" + filename + \"#\" + entryName + \" Error: \" + exception);\n                    }\n                    else throw;\n                }\n            }\n            return stream;\n        }\n\n        /// <summary>\n        /// Create a stream of a specific ZipEntry\n        /// </summary>\n        /// <param name=\"zipFile\">The zipFile containing the zipEntry</param>\n        /// <param name=\"entryName\">The name of the entry</param>\n        /// <param name=\"fileName\">The name of the zip file on disk</param>\n        /// <returns>A <see cref=\"Stream\"/> of the appropriate zip entry</returns>\n        private Stream CreateEntryStream(CachedZipFile zipFile, string entryName, string fileName)\n        {\n            ZipEntryCache entryCache;\n            if (entryName == null)\n            {\n                entryCache = zipFile.EntryCache.FirstOrDefault().Value;\n            }\n            else\n            {\n                zipFile.EntryCache.TryGetValue(entryName, out entryCache);\n            }\n\n            if (entryCache is { Modified: true })\n            {\n                // we want to read an entry in the zip that has be edited, we need to start over\n                // because of the zip library else it blows up, we need to call 'Save'\n                zipFile.Dispose();\n                _zipFileCache.Remove(fileName, out _);\n\n                return CacheAndCreateEntryStream(fileName, entryName);\n            }\n\n            var entry = entryCache?.Entry;\n\n            if (entry != null)\n            {\n                var stream = new MemoryStream();\n\n                try\n                {\n                    stream.SetLength(entry.UncompressedSize);\n                }\n                catch (ArgumentOutOfRangeException)\n                {\n                    // The needed size of the MemoryStream is longer than allowed.\n                    // just read the data directly from the file.\n                    // Note that we cannot use entry.OpenReader() because only one OpenReader\n                    // can be open at a time without causing corruption.\n\n                    // We must use fileName instead of zipFile.Name,\n                    // because zipFile is initialized from a stream and not a file.\n                    var zipStream = new ZipInputStream(fileName);\n\n                    var zipEntry = zipStream.GetNextEntry();\n\n                    // The zip file was empty!\n                    if (zipEntry == null)\n                    {\n                        return null;\n                    }\n\n                    // Null entry name, return the first.\n                    if (entryName == null)\n                    {\n                        return zipStream;\n                    }\n\n                    // Non-default entry name, return matching one if it exists, otherwise null.\n                    while (zipEntry != null)\n                    {\n                        if (string.Compare(zipEntry.FileName, entryName, StringComparison.OrdinalIgnoreCase) == 0)\n                        {\n                            return zipStream;\n                        }\n\n                        zipEntry = zipStream.GetNextEntry();\n                    }\n                }\n\n                // extract directly into the stream\n                entry.Extract(stream);\n                stream.Position = 0;\n                return stream;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Cache a Zip\n        /// </summary>\n        /// <param name=\"filename\">Zip to cache</param>\n        /// <param name=\"cachedZip\">The resulting CachedZipFile</param>\n        /// <returns></returns>\n        private bool Cache(string filename, out CachedZipFile cachedZip)\n        {\n            cachedZip = null;\n            var dataStream = _dataProvider.Fetch(filename);\n            if (dataStream != null)\n            {\n                try\n                {\n                    cachedZip = new CachedZipFile(dataStream, DateTime.UtcNow, filename);\n\n                    if (!_zipFileCache.TryAdd(filename, cachedZip))\n                    {\n                        // some other thread could of added it already, lets dispose ours\n                        cachedZip.Dispose();\n                        return _zipFileCache.TryGetValue(filename, out cachedZip);\n                    }\n\n                    return true;\n                }\n                catch (Exception exception)\n                {\n                    if (exception is ZipException || exception is ZlibException)\n                    {\n                        Log.Error(\"ZipDataCacheProvider.Fetch(): Corrupt zip file/entry: \" + filename + \" Error: \" + exception);\n                    }\n                    else throw;\n                }\n\n                dataStream.Dispose();\n            }\n\n            return false;\n        }\n\n\n        /// <summary>\n        /// Type for storing zipfile in cache\n        /// </summary>\n        private class CachedZipFile : IDisposable\n        {\n            private ReferenceWrapper<DateTime> _dateCached;\n            private readonly Stream _dataStream;\n            private readonly string _filePath;\n            private long _disposed;\n            private long _modified;\n\n            /// <summary>\n            /// The ZipFile this object represents\n            /// </summary>\n            private readonly ZipFile _zipFile;\n\n            /// <summary>\n            /// Contains all entries of the zip file by filename\n            /// </summary>\n            public readonly Dictionary<string, ZipEntryCache> EntryCache = new (StringComparer.OrdinalIgnoreCase);\n\n            /// <summary>\n            /// Returns if this cached zip file is disposed\n            /// </summary>\n            public bool Disposed => Interlocked.Read(ref _disposed) != 0;\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"CachedZipFile\"/>\n            /// </summary>\n            /// <param name=\"dataStream\">Stream containing the zip file</param>\n            /// <param name=\"utcNow\">Current utc time</param>\n            /// <param name=\"filePath\">Path of the zip file</param>\n            public CachedZipFile(Stream dataStream, DateTime utcNow, string filePath)\n            {\n                _dataStream = dataStream;\n                _zipFile = ZipFile.Read(dataStream);\n                _zipFile.UseZip64WhenSaving = Zip64Option.Always;\n                foreach (var entry in _zipFile.Entries)\n                {\n                    EntryCache[entry.FileName] = new ZipEntryCache{ Entry = entry };\n                }\n                _dateCached = new ReferenceWrapper<DateTime>(utcNow);\n                _filePath = filePath;\n            }\n\n            /// <summary>\n            /// Method used to check if this object was created before a certain time\n            /// </summary>\n            /// <param name=\"date\">DateTime which is compared to the DateTime this object was created</param>\n            /// <returns>Bool indicating whether this object is older than the specified time</returns>\n            public bool Uncache(DateTime date)\n            {\n                return _dateCached.Value < date;\n            }\n\n            /// <summary>\n            /// Write to this entry, will be updated on disk when uncached\n            /// Meaning either when timer finishes or on dispose\n            /// </summary>\n            /// <param name=\"entryName\">Entry to write this as</param>\n            /// <param name=\"content\">Content of the entry</param>\n            public void WriteEntry(string entryName, byte[] content)\n            {\n                Interlocked.Increment(ref _modified);\n                Refresh();\n\n                // If the entry already exists remove it \n                if (_zipFile.ContainsEntry(entryName))\n                {\n                    _zipFile.RemoveEntry(entryName);\n                    EntryCache.Remove(entryName);\n                }\n\n                // Write this entry to zip file\n                var newEntry = _zipFile.AddEntry(entryName, content);\n                EntryCache.Add(entryName, new ZipEntryCache { Entry = newEntry, Modified = true });\n            }\n\n            /// <summary>\n            /// We refresh our cache time when used to avoid it being clean up\n            /// </summary>\n            public void Refresh()\n            {\n                _dateCached = new ReferenceWrapper<DateTime>(DateTime.UtcNow);\n            }\n\n            /// <summary>\n            /// Dispose of the ZipFile\n            /// </summary>\n            public void Dispose()\n            {\n                if (Interlocked.CompareExchange(ref _disposed, 1, 0) == 1)\n                {\n                    // compare will return the original value, if it's already 1 means already being disposed off\n                    return;\n                }\n\n                // If we changed this zip we need to save\n                string tempFileName = null;\n                var modified = Interlocked.Read(ref _modified) != 0;\n                if (modified)\n                {\n                    // Write our changes to disk as temp\n                    tempFileName = Path.GetTempFileName();\n                    _zipFile.Save(tempFileName);\n                }\n\n                _zipFile?.DisposeSafely();\n                _dataStream?.DisposeSafely();\n\n                //After disposal we will move it to the final location\n                if (modified && tempFileName != null)\n                { \n                    File.Move(tempFileName, _filePath, true);\n                }\n            }\n        }\n\n        /// <summary>\n        /// ZipEntry wrapper which handles flagging a modified entry\n        /// </summary>\n        private class ZipEntryCache\n        {\n            public ZipEntry Entry { get; set; }\n            public bool Modified { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/DataFeeds/ZipEntryNameSubscriptionDataSourceReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.Transport;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ISubscriptionDataSourceReader\"/> that reads zip entry names\n    /// </summary>\n    public class ZipEntryNameSubscriptionDataSourceReader : BaseSubscriptionDataSourceReader\n    {\n        private readonly IDataCacheProvider _dataProvider;\n        private readonly SubscriptionDataConfig _config;\n        private readonly DateTime _date;\n        private readonly bool _isLiveMode;\n        private readonly BaseData _factory;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ZipEntryNameSubscriptionDataSourceReader\"/> class\n        /// </summary>\n        /// <param name=\"dataProvider\">Used to fetch data</param>\n        /// <param name=\"config\">The subscription's configuration</param>\n        /// <param name=\"date\">The date this factory was produced to read data for</param>\n        /// <param name=\"isLiveMode\">True if we're in live mode, false for backtesting</param>\n        public ZipEntryNameSubscriptionDataSourceReader(IDataCacheProvider dataProvider, SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            : base(dataProvider, isLiveMode, null)\n        {\n            _date = date;\n            _config = config;\n            _isLiveMode = isLiveMode;\n            _dataProvider = dataProvider;\n            _factory = config.GetBaseDataInstance();\n        }\n\n        /// <summary>\n        /// Reads the specified <paramref name=\"source\"/>\n        /// </summary>\n        /// <param name=\"source\">The source to be read</param>\n        /// <returns>An <see cref=\"IEnumerable{BaseData}\"/> that contains the data in the source</returns>\n        public override IEnumerable<BaseData> Read(SubscriptionDataSource source)\n        {\n            var fileName = source.Source;\n\n            if (source.TransportMedium == SubscriptionTransportMedium.RemoteFile)\n            {\n                using var reader = CreateStreamReader(source) as RemoteFileSubscriptionStreamReader;\n                if (reader != null)\n                {\n                    fileName = reader.LocalFileName;\n                }\n            }\n\n            List<string> entryNames;\n            try\n            {\n                entryNames = _dataProvider.GetZipEntries(fileName);\n            }\n            catch (Exception err)\n            {\n                OnInvalidSource(source, err);\n                yield break;\n            }\n\n            foreach (var entryFileName in entryNames)\n            {\n                var instance = _factory.Reader(_config, entryFileName, _date, _isLiveMode);\n                if (instance != null && instance.EndTime != default(DateTime))\n                {\n                    yield return instance;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"BaseSubscriptionDataSourceReader.InvalidSource\"/> event\n        /// </summary>\n        /// <param name=\"source\">The <see cref=\"SubscriptionDataSource\"/> that was invalid</param>\n        /// <param name=\"exception\">The exception if one was raised, otherwise null</param>\n        private void OnInvalidSource(SubscriptionDataSource source, Exception exception)\n        {\n            OnInvalidSource(source, exception);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Engine.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Exceptions;\nusing QuantConnect.Indicators;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// LEAN ALGORITHMIC TRADING ENGINE: ENTRY POINT.\n    ///\n    /// The engine loads new tasks, create the algorithms and threads, and sends them\n    /// to Algorithm Manager to be executed. It is the primary operating loop.\n    /// </summary>\n    public class Engine\n    {\n        private bool _historyStartDateLimitedWarningEmitted;\n        private bool _historyNumericalPrecisionLimitedWarningEmitted;\n        private readonly bool _liveMode;\n        private readonly Task<MarketHoursDatabase> _marketHoursDatabaseTask;\n\n        /// <summary>\n        /// Gets the configured system handlers for this engine instance\n        /// </summary>\n        public LeanEngineSystemHandlers SystemHandlers { get; }\n\n        /// <summary>\n        /// Gets the configured algorithm handlers for this engine instance\n        /// </summary>\n        public LeanEngineAlgorithmHandlers AlgorithmHandlers { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Engine\"/> class using the specified handlers\n        /// </summary>\n        /// <param name=\"systemHandlers\">The system handlers for controlling acquisition of jobs, messaging, and api calls</param>\n        /// <param name=\"algorithmHandlers\">The algorithm handlers for managing algorithm initialization, data, results, transaction, and real time events</param>\n        /// <param name=\"liveMode\">True when running in live mode, false otherwise</param>\n        public Engine(LeanEngineSystemHandlers systemHandlers, LeanEngineAlgorithmHandlers algorithmHandlers, bool liveMode)\n        {\n            _liveMode = liveMode;\n            SystemHandlers = systemHandlers;\n            AlgorithmHandlers = algorithmHandlers;\n            _marketHoursDatabaseTask = Task.Run(StaticInitializations);\n        }\n\n        /// <summary>\n        /// Runs a single backtest/live job from the job queue\n        /// </summary>\n        /// <param name=\"job\">The algorithm job to be processed</param>\n        /// <param name=\"manager\">The algorithm manager instance</param>\n        /// <param name=\"assemblyPath\">The path to the algorithm's assembly</param>\n        /// <param name=\"workerThread\">The worker thread instance</param>\n        public void Run(AlgorithmNodePacket job, AlgorithmManager manager, string assemblyPath, WorkerThread workerThread)\n        {\n            var algorithm = default(IAlgorithm);\n            var algorithmManager = manager;\n\n            try\n            {\n                Log.Trace($\"Engine.Run(): Resource limits '{job.Controls.CpuAllocation}' CPUs. {job.Controls.RamAllocation} MB RAM.\");\n                TextSubscriptionDataSourceReader.SetCacheSize((int) (job.RamAllocation * 0.4));\n\n                //Reset thread holders.\n                var initializeComplete = false;\n\n                //-> Initialize messaging system\n                SystemHandlers.Notify.SetAuthentication(job);\n\n                //-> Set the result handler type for this algorithm job, and launch the associated result thread.\n                AlgorithmHandlers.Results.Initialize(new (job, SystemHandlers.Notify, SystemHandlers.Api, AlgorithmHandlers.Transactions, AlgorithmHandlers.MapFileProvider));\n\n                IBrokerage brokerage = null;\n                DataManager dataManager = null;\n                var performanceTrackingTool = new PerformanceTrackingTool();\n                var synchronizer = _liveMode ? new LiveSynchronizer() : new Synchronizer();\n                try\n                {\n                    // we get the mhdb before creating the algorithm instance,\n                    // since the algorithm constructor will use it\n                    var marketHoursDatabase = _marketHoursDatabaseTask.Result;\n\n                    AlgorithmHandlers.Setup.WorkerThread = workerThread;\n\n                    // Save algorithm to cache, load algorithm instance:\n                    algorithm = AlgorithmHandlers.Setup.CreateAlgorithmInstance(job, assemblyPath);\n\n                    algorithm.ProjectId = job.ProjectId;\n\n                    // Set algorithm in ILeanManager\n                    SystemHandlers.LeanManager.SetAlgorithm(algorithm);\n\n                    // initialize the object store\n                    AlgorithmHandlers.ObjectStore.Initialize(job.UserId, job.ProjectId, job.UserToken, job.Controls, algorithm.AlgorithmMode);\n\n                    // initialize the data permission manager\n                    AlgorithmHandlers.DataPermissionsManager.Initialize(job);\n\n                    // notify the user of any errors w/ object store persistence\n                    AlgorithmHandlers.ObjectStore.ErrorRaised += (sender, args) => algorithm.Debug($\"ObjectStore Persistence Error: {args.Error.Message}\");\n\n                    // set the order processor on the transaction manager,needs to be done before initializing the brokerage which might start using it\n                    algorithm.Transactions.SetOrderProcessor(AlgorithmHandlers.Transactions);\n\n                    // Initialize the brokerage\n                    IBrokerageFactory factory;\n                    brokerage = AlgorithmHandlers.Setup.CreateBrokerage(job, algorithm, out factory);\n\n                    // forward brokerage message events to the result handler\n                    brokerage.Message += (_, e) => AlgorithmHandlers.Results.BrokerageMessage(e);\n\n                    var symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n                    var mapFilePrimaryExchangeProvider = new MapFilePrimaryExchangeProvider(AlgorithmHandlers.MapFileProvider);\n                    var registeredTypesProvider = new RegisteredSecurityDataTypesProvider();\n                    var securityService = new SecurityService(algorithm.Portfolio.CashBook,\n                        marketHoursDatabase,\n                        symbolPropertiesDatabase,\n                        algorithm,\n                        registeredTypesProvider,\n                        new SecurityCacheProvider(algorithm.Portfolio),\n                        mapFilePrimaryExchangeProvider,\n                        algorithm,\n                        new IndicatorBasedOptionPriceModelProvider(algorithm.Securities));\n\n                    algorithm.Securities.SetSecurityService(securityService);\n\n                    dataManager = new DataManager(AlgorithmHandlers.DataFeed,\n                        new UniverseSelection(\n                            algorithm,\n                            securityService,\n                            AlgorithmHandlers.DataPermissionsManager,\n                            AlgorithmHandlers.DataProvider),\n                        algorithm,\n                        algorithm.TimeKeeper,\n                        marketHoursDatabase,\n                        _liveMode,\n                        registeredTypesProvider,\n                        AlgorithmHandlers.DataPermissionsManager);\n\n                    algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n                    synchronizer.Initialize(algorithm, dataManager, performanceTrackingTool);\n\n                    // Set the algorithm's object store before initializing the data feed, which might use it\n                    algorithm.SetObjectStore(AlgorithmHandlers.ObjectStore);\n\n                    // Initialize the data feed before we initialize so he can intercept added securities/universes via events\n                    AlgorithmHandlers.DataFeed.Initialize(\n                        algorithm,\n                        job,\n                        AlgorithmHandlers.Results,\n                        AlgorithmHandlers.MapFileProvider,\n                        AlgorithmHandlers.FactorFileProvider,\n                        AlgorithmHandlers.DataProvider,\n                        dataManager,\n                        (IDataFeedTimeProvider) synchronizer,\n                        AlgorithmHandlers.DataPermissionsManager.DataChannelProvider);\n\n                    // set the history provider before setting up the algorithm\n                    var historyProvider = GetHistoryProvider();\n                    historyProvider.SetBrokerage(brokerage);\n                    historyProvider.Initialize(\n                        new HistoryProviderInitializeParameters(\n                            job,\n                            SystemHandlers.Api,\n                            AlgorithmHandlers.DataProvider,\n                            AlgorithmHandlers.DataCacheProvider,\n                            AlgorithmHandlers.MapFileProvider,\n                            AlgorithmHandlers.FactorFileProvider,\n                            progress =>\n                            {\n                                // send progress updates to the result handler only during initialization\n                                if (!algorithm.GetLocked() || algorithm.IsWarmingUp)\n                                {\n                                    AlgorithmHandlers.Results.SendStatusUpdate(AlgorithmStatus.History,\n                                        Invariant($\"Processing history {progress}%...\"));\n                                }\n                            },\n                            // disable parallel history requests for live trading\n                            parallelHistoryRequestsEnabled: !_liveMode,\n                            dataPermissionManager: AlgorithmHandlers.DataPermissionsManager,\n                            objectStore: algorithm.ObjectStore,\n                            algorithmSettings: algorithm.Settings\n                        )\n                    );\n\n                    historyProvider.InvalidConfigurationDetected += (sender, args) => { AlgorithmHandlers.Results.ErrorMessage(args.Message); };\n                    historyProvider.DownloadFailed += (sender, args) => { AlgorithmHandlers.Results.ErrorMessage(args.Message, args.StackTrace); };\n                    historyProvider.ReaderErrorDetected += (sender, args) => { AlgorithmHandlers.Results.RuntimeError(args.Message, args.StackTrace); };\n\n                    Composer.Instance.AddPart(historyProvider);\n                    algorithm.HistoryProvider = historyProvider;\n\n                    // initialize the default brokerage message handler\n                    algorithm.BrokerageMessageHandler = factory.CreateBrokerageMessageHandler(algorithm, job, SystemHandlers.Api);\n\n                    var brokerageDataQueueHandlers = Composer.Instance.GetParts<IDataQueueHandler>().OfType<IBrokerage>()\n                        // In backtesting, brokerages can be used as data downloaders (BrokerageDataDownloader)\n                        // and are added to the composer as IBrokerage\n                        .Concat(Composer.Instance.GetParts<IBrokerage>())\n                        .Where(x => !ReferenceEquals(brokerage, x));\n                    foreach (var x in new[] { brokerage }.Concat(brokerageDataQueueHandlers))\n                    {\n                        x.Message += (sender, message) =>\n                        {\n                            algorithm.BrokerageMessageHandler.HandleMessage(message);\n\n                            if (algorithm.GetLocked())\n                            {\n                                // fire brokerage message events\n                                algorithm.OnBrokerageMessage(message);\n                                switch (message.Type)\n                                {\n                                    case BrokerageMessageType.Disconnect:\n                                        algorithm.OnBrokerageDisconnect();\n                                        break;\n                                    case BrokerageMessageType.Reconnect:\n                                        algorithm.OnBrokerageReconnect();\n                                        break;\n                                }\n                            }\n                        };\n                    }\n\n                    //Initialize the internal state of algorithm and job: executes the algorithm.Initialize() method.\n                    initializeComplete = AlgorithmHandlers.Setup.Setup(new SetupHandlerParameters(dataManager.UniverseSelection, algorithm,\n                        brokerage, job, AlgorithmHandlers.Results, AlgorithmHandlers.Transactions, AlgorithmHandlers.RealTime,\n                        AlgorithmHandlers.DataCacheProvider, AlgorithmHandlers.MapFileProvider));\n\n                    // set this again now that we've actually added securities\n                    AlgorithmHandlers.Results.SetAlgorithm(algorithm, AlgorithmHandlers.Setup.StartingPortfolioValue);\n\n                    //If there are any reasons it failed, pass these back to the IDE.\n                    if (!initializeComplete || AlgorithmHandlers.Setup.Errors.Count > 0)\n                    {\n                        initializeComplete = false;\n                        //Get all the error messages: internal in algorithm and external in setup handler.\n                        var errorMessage = string.Join(\",\", algorithm.ErrorMessages);\n                        string stackTrace = \"\";\n                        errorMessage += string.Join(\",\", AlgorithmHandlers.Setup.Errors.Select(e =>\n                        {\n                            var message = e.Message;\n                            if (e.InnerException != null)\n                            {\n                                var interpreter = StackExceptionInterpreter.Instance.Value;\n                                var err = interpreter.Interpret(e.InnerException);\n                                var stackMessage = interpreter.GetExceptionMessageHeader(err);\n                                message += stackMessage;\n                                stackTrace += stackMessage;\n                            }\n                            return message;\n                        }));\n                        Log.Error(\"Engine.Run(): \" + errorMessage);\n                        AlgorithmHandlers.Results.RuntimeError(errorMessage, stackTrace);\n                        SystemHandlers.Api.SetAlgorithmStatus(job.AlgorithmId, AlgorithmStatus.RuntimeError, errorMessage);\n                    }\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n\n                    // for python we don't add the ugly pythonNet stack trace\n                    var stackTrace = job.Language == Language.Python ? err.Message : err.ToString();\n\n                    var runtimeMessage = \"Algorithm.Initialize() Error: \" + err.Message + \" Stack Trace: \" + stackTrace;\n                    AlgorithmHandlers.Results.RuntimeError(runtimeMessage, stackTrace);\n                    SystemHandlers.Api.SetAlgorithmStatus(job.AlgorithmId, AlgorithmStatus.RuntimeError, runtimeMessage);\n                }\n\n\n                var historyProviderName = algorithm?.HistoryProvider != null ? algorithm.HistoryProvider.GetType().FullName : string.Empty;\n                // log the job endpoints\n                Log.Trace($\"JOB HANDLERS:{Environment.NewLine}\" +\n                    $\"         DataFeed:             {AlgorithmHandlers.DataFeed.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         Setup:                {AlgorithmHandlers.Setup.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         RealTime:             {AlgorithmHandlers.RealTime.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         Results:              {AlgorithmHandlers.Results.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         Transactions:         {AlgorithmHandlers.Transactions.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         Object Store:         {AlgorithmHandlers.ObjectStore.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         History Provider:     {historyProviderName}{Environment.NewLine}\" +\n                    $\"         Brokerage:            {brokerage?.GetType().FullName}{Environment.NewLine}\" +\n                    $\"         Data Provider:        {AlgorithmHandlers.DataProvider.GetType().FullName}{Environment.NewLine}\");\n\n                //-> Using the job + initialization: load the designated handlers:\n                if (initializeComplete)\n                {\n                    performanceTrackingTool.Initialize(algorithm);\n                    // notify the LEAN manager that the algorithm is initialized and starting\n                    SystemHandlers.LeanManager.OnAlgorithmStart();\n\n                    //-> Reset the backtest stopwatch; we're now running the algorithm.\n                    var startTime = DateTime.UtcNow;\n\n                    //Set algorithm as locked; set it to live mode if we're trading live, and set it to locked for no further updates.\n                    algorithm.SetAlgorithmId(job.AlgorithmId);\n                    algorithm.SetLocked();\n\n                    //Load the associated handlers for transaction and realtime events:\n                    AlgorithmHandlers.Transactions.Initialize(algorithm, brokerage, AlgorithmHandlers.Results);\n                    try\n                    {\n                        AlgorithmHandlers.RealTime.Setup(algorithm, job, AlgorithmHandlers.Results, SystemHandlers.Api, algorithmManager.TimeLimit);\n\n                        // Result manager scanning message queue: (started earlier)\n                        AlgorithmHandlers.Results.DebugMessage(\n                            $\"Launching analysis for {job.AlgorithmId} with LEAN Engine v{Globals.Version}\");\n\n                        //Create a new engine isolator class\n                        var isolator = new Isolator();\n\n                        // Execute the Algorithm Code:\n                        var complete = isolator.ExecuteWithTimeLimit(AlgorithmHandlers.Setup.MaximumRuntime, algorithmManager.TimeLimit.IsWithinLimit, () =>\n                        {\n                            try\n                            {\n                                //Run Algorithm Job:\n                                // -> Using this Data Feed,\n                                // -> Send Orders to this TransactionHandler,\n                                // -> Send Results to ResultHandler.\n                                algorithmManager.Run(job, algorithm, synchronizer, AlgorithmHandlers.Transactions, AlgorithmHandlers.Results, AlgorithmHandlers.RealTime, SystemHandlers.LeanManager, isolator.CancellationTokenSource, performanceTrackingTool);\n                            }\n                            catch (Exception err)\n                            {\n                                algorithm.SetRuntimeError(err, \"AlgorithmManager.Run\");\n                                return;\n                            }\n\n                            Log.Trace(\"Engine.Run(): Exiting Algorithm Manager\");\n                        }, job.Controls.RamAllocation, workerThread:workerThread, sleepIntervalMillis: algorithm.LiveMode ? 10000 : 1000);\n\n                        if (!complete)\n                        {\n                            Log.Error(\"Engine.Main(): Failed to complete in time: \" + AlgorithmHandlers.Setup.MaximumRuntime.ToStringInvariant(\"F\"));\n                            throw new Exception(\"Failed to complete algorithm within \" + AlgorithmHandlers.Setup.MaximumRuntime.ToStringInvariant(\"F\")\n                                + \" seconds. Please make it run faster.\");\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        //Error running the user algorithm: purge datafeed, send error messages, set algorithm status to failed.\n                        algorithm.SetRuntimeError(err, \"Engine Isolator\");\n                    }\n\n                    // Algorithm runtime error:\n                    if (algorithm.RunTimeError != null)\n                    {\n                        HandleAlgorithmError(job, algorithm.RunTimeError);\n                    }\n\n                    // notify the LEAN manager that the algorithm has finished\n                    SystemHandlers.LeanManager.OnAlgorithmEnd();\n\n                    try\n                    {\n                        var csvTransactionsFileName = Config.Get(\"transaction-log\");\n                        if (!string.IsNullOrEmpty(csvTransactionsFileName))\n                        {\n                            SaveListOfTrades(AlgorithmHandlers.Transactions, csvTransactionsFileName);\n                        }\n\n                        if (!_liveMode)\n                        {\n                            //Diagnostics Completed, Send Result Packet:\n                            var totalSeconds = (DateTime.UtcNow - startTime).TotalSeconds;\n                            var dataPoints = algorithmManager.DataPoints + algorithm.HistoryProvider.DataPointCount;\n                            var kps = dataPoints / (double) 1000 / totalSeconds;\n                            AlgorithmHandlers.Results.DebugMessage($\"Algorithm Id:({job.AlgorithmId}) completed in {totalSeconds:F2} seconds at {kps:F0}k data points per second. Processing total of {dataPoints:N0} data points.\");\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err, \"Error sending analysis results\");\n                    }\n\n                    //Before we return, send terminate commands to close up the threads\n                    AlgorithmHandlers.Transactions.Exit();\n                    AlgorithmHandlers.RealTime.Exit();\n                    dataManager?.RemoveAllSubscriptions();\n                    workerThread?.Dispose();\n                }\n\n                synchronizer.DisposeSafely();\n                // Close data feed, alphas. Could be running even if algorithm initialization failed\n                AlgorithmHandlers.DataFeed.Exit();\n\n                //Close result handler:\n                AlgorithmHandlers.Results.Exit();\n\n                //Wait for the threads to complete:\n                var millisecondInterval = 10;\n                var millisecondTotalWait = 0;\n                while ((AlgorithmHandlers.Results.IsActive\n                    || (AlgorithmHandlers.Transactions != null && AlgorithmHandlers.Transactions.IsActive)\n                    || (AlgorithmHandlers.DataFeed != null && AlgorithmHandlers.DataFeed.IsActive)\n                    || (AlgorithmHandlers.RealTime != null && AlgorithmHandlers.RealTime.IsActive))\n                    && millisecondTotalWait < 30*1000)\n                {\n                    Thread.Sleep(millisecondInterval);\n                    if (millisecondTotalWait % (millisecondInterval * 10) == 0)\n                    {\n                        Log.Trace(\"Waiting for threads to exit...\");\n                    }\n                    millisecondTotalWait += millisecondInterval;\n                }\n\n                if (brokerage != null)\n                {\n                    Log.Trace(\"Engine.Run(): Disconnecting from brokerage...\");\n                    brokerage.Disconnect();\n                    brokerage.Dispose();\n                }\n                if (AlgorithmHandlers.Setup != null)\n                {\n                    Log.Trace(\"Engine.Run(): Disposing of setup handler...\");\n                    AlgorithmHandlers.Setup.Dispose();\n                }\n\n                Log.Trace(\"Engine.Main(): Analysis Completed and Results Posted.\");\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, \"Error running algorithm\");\n            }\n            finally\n            {\n                //No matter what for live mode; make sure we've set algorithm status in the API for \"not running\" conditions:\n                if (_liveMode && algorithmManager.State != AlgorithmStatus.Running && algorithmManager.State != AlgorithmStatus.RuntimeError)\n                    SystemHandlers.Api.SetAlgorithmStatus(job.AlgorithmId, algorithmManager.State);\n\n                AlgorithmHandlers.Results.Exit();\n                AlgorithmHandlers.DataFeed.Exit();\n                AlgorithmHandlers.Transactions.Exit();\n                AlgorithmHandlers.RealTime.Exit();\n                AlgorithmHandlers.DataMonitor.Exit();\n                (algorithm as AlgorithmPythonWrapper)?.DisposeSafely();\n            }\n        }\n\n        /// <summary>\n        /// Handle an error in the algorithm.Run method.\n        /// </summary>\n        /// <param name=\"job\">Job we're processing</param>\n        /// <param name=\"err\">Error from algorithm stack</param>\n        private void HandleAlgorithmError(AlgorithmNodePacket job, Exception err)\n        {\n            AlgorithmHandlers.DataFeed?.Exit();\n            if (AlgorithmHandlers.Results != null)\n            {\n                var message = $\"Runtime Error: {err.Message}\";\n                Log.Trace(\"Engine.Run(): Sending runtime error to user...\");\n                AlgorithmHandlers.Results.LogMessage(message);\n\n                // for python we don't add the ugly pythonNet stack trace\n                var stackTrace = job.Language == Language.Python ? err.Message : err.ToString();\n\n                AlgorithmHandlers.Results.RuntimeError(message, stackTrace);\n                SystemHandlers.Api.SetAlgorithmStatus(job.AlgorithmId, AlgorithmStatus.RuntimeError, $\"{message} Stack Trace: {stackTrace}\");\n            }\n        }\n\n        /// <summary>\n        /// Load the history provider from the Composer\n        /// </summary>\n        private HistoryProviderManager GetHistoryProvider()\n        {\n            var provider = new HistoryProviderManager();\n\n            provider.InvalidConfigurationDetected += (sender, args) => { AlgorithmHandlers.Results.ErrorMessage(args.Message); };\n            provider.NumericalPrecisionLimited += (sender, args) =>\n            {\n                if (!_historyNumericalPrecisionLimitedWarningEmitted)\n                {\n                    _historyNumericalPrecisionLimitedWarningEmitted = true;\n                    AlgorithmHandlers.Results.DebugMessage(\"Warning: when performing history requests, the start date will be adjusted if there are numerical precision errors in the factor files.\");\n                }\n            };\n            provider.StartDateLimited += (sender, args) =>\n            {\n                if (!_historyStartDateLimitedWarningEmitted)\n                {\n                    _historyStartDateLimitedWarningEmitted = true;\n                    AlgorithmHandlers.Results.DebugMessage(\"Warning: when performing history requests, the start date will be adjusted if it is before the first known date for the symbol.\");\n                }\n            };\n            provider.DownloadFailed += (sender, args) => { AlgorithmHandlers.Results.ErrorMessage(args.Message, args.StackTrace); };\n            provider.ReaderErrorDetected += (sender, args) => { AlgorithmHandlers.Results.RuntimeError(args.Message, args.StackTrace); };\n\n            return provider;\n        }\n\n        /// <summary>\n        /// Save a list of trades to disk for a given path\n        /// </summary>\n        /// <param name=\"transactions\">Transactions list via an OrderProvider</param>\n        /// <param name=\"csvFileName\">File path to create</param>\n        private static void SaveListOfTrades(IOrderProvider transactions, string csvFileName)\n        {\n            var orders = transactions.GetOrders(x => x.Status.IsFill());\n\n            var path = Path.GetDirectoryName(csvFileName);\n            if (path != null && !Directory.Exists(path))\n                Directory.CreateDirectory(path);\n\n            using (var writer = new StreamWriter(csvFileName))\n            {\n                foreach (var order in orders)\n                {\n                    var line = Invariant($\"{order.Time.ToStringInvariant(\"yyyy-MM-dd HH:mm:ss\")},\") +\n                               Invariant($\"{order.Symbol.Value},{order.Direction},{order.Quantity},{order.Price}\");\n                    writer.WriteLine(line);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initialize slow static variables\n        /// </summary>\n        [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]\n        private static MarketHoursDatabase StaticInitializations()\n        {\n            SymbolPropertiesDatabase.FromDataFolder();\n            // This is slow because it create all static timezones\n            var nyTime = TimeZones.NewYork;\n            // slow because if goes to disk and parses json\n            return MarketHoursDatabase.FromDataFolder();\n        }\n\n    } // End Algorithm Node Core Thread\n} // End Namespace\n"
  },
  {
    "path": "Engine/HistoricalData/BrokerageHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IHistoryProvider\"/> that relies on\n    /// a brokerage connection to retrieve historical data\n    /// </summary>\n    public class BrokerageHistoryProvider : SynchronizingHistoryProvider\n    {\n        private IDataPermissionManager _dataPermissionManager;\n        private IBrokerage _brokerage;\n        private bool _initialized;\n\n        /// <summary>\n        /// Sets the brokerage to be used for historical requests\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage instance</param>\n        public void SetBrokerage(IBrokerage brokerage)\n        {\n            _brokerage = brokerage;\n        }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n            if (_initialized)\n            {\n                // let's make sure no one tries to change our parameters values\n                throw new InvalidOperationException(\"BrokerageHistoryProvider can only be initialized once\");\n            }\n            _initialized = true;\n            _brokerage.Connect();\n            AlgorithmSettings = parameters.AlgorithmSettings;\n            _dataPermissionManager = parameters.DataPermissionManager;\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            // create subscription objects from the configs\n            var subscriptions = new List<Subscription>();\n            foreach (var request in requests)\n            {\n                var history = _brokerage.GetHistory(request);\n                if (history == null)\n                {\n                    // doesn't support this history request, that's okay\n                    continue;\n                }\n                var subscription = CreateSubscription(request, history);\n                subscriptions.Add(subscription);\n            }\n\n            if (subscriptions.Count == 0)\n            {\n                return null;\n            }\n            return CreateSliceEnumerableFromSubscriptions(subscriptions, sliceTimeZone);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/FakeHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.DataFeeds.Queues;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides FAKE implementation of <see cref=\"IHistoryProvider\"/> used for testing. <see cref=\"FakeDataQueue\"/>\n    /// </summary>\n    public class FakeHistoryProvider : HistoryProviderBase\n    {\n        private int _historyCount;\n\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        public override int DataPointCount => _historyCount;\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            var single = requests.FirstOrDefault();\n            if (single == null)\n            {\n                yield break;\n            }\n\n            var currentLocalTime = single.StartTimeLocal;\n            while (currentLocalTime < single.EndTimeLocal)\n            {\n                if (single.ExchangeHours.IsOpen(currentLocalTime, single.IncludeExtendedMarketHours))\n                {\n                    _historyCount++;\n\n                    BaseData data;\n                    if (single.DataType == typeof(TradeBar))\n                    {\n                        data = new TradeBar\n                        {\n                            Symbol = single.Symbol,\n                            Time = currentLocalTime,\n                            Open = _historyCount,\n                            Low = _historyCount,\n                            High = _historyCount,\n                            Close = _historyCount,\n                            Volume = _historyCount,\n                            Period = single.Resolution.ToTimeSpan()\n                        };\n                    }\n                    else if (single.DataType == typeof(QuoteBar))\n                    {\n                        data = new QuoteBar\n                        {\n                            Symbol = single.Symbol,\n                            Time = currentLocalTime,\n                            Ask = new Bar(_historyCount, _historyCount, _historyCount, _historyCount),\n                            Bid = new Bar(_historyCount, _historyCount, _historyCount, _historyCount),\n                            Period = single.Resolution.ToTimeSpan()\n                        };\n                    }\n                    else\n                    {\n                        yield break;\n                    }\n\n                    yield return new Slice(data.EndTime, new BaseData[] { data }, data.EndTime.ConvertFromUtc(single.ExchangeHours.TimeZone));\n                }\n\n                currentLocalTime = currentLocalTime.Add(single.Resolution.ToTimeSpan());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/HistoryProviderManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IHistoryProvider\"/> which\n    /// acts as a wrapper to use multiple history providers together\n    /// </summary>\n    public class HistoryProviderManager : HistoryProviderBase\n    {\n        private AlgorithmNodePacket _job;\n        private IDataPermissionManager _dataPermissionManager;\n        private IBrokerage _brokerage;\n        private bool _initialized;\n        private bool _loggedEquityShortcutWarning;\n\n        /// <summary>\n        /// Collection of history providers being used\n        /// </summary>\n        /// <remarks>Protected for testing purposes</remarks>\n        private List<IHistoryProvider> _historyProviders = new();\n\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        public override int DataPointCount => GetDataPointCount();\n\n        /// <summary>\n        /// Sets the brokerage to be used for historical requests\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage instance</param>\n        public void SetBrokerage(IBrokerage brokerage)\n        {\n            _brokerage = brokerage;\n        }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n            if (_initialized)\n            {\n                // let's make sure no one tries to change our parameters values\n                throw new InvalidOperationException(\"BrokerageHistoryProvider can only be initialized once\");\n            }\n            _initialized = true;\n            _job = parameters.Job;\n\n            var dataProvidersList = parameters.Job?.HistoryProvider.DeserializeList() ?? new List<string>();\n            if (dataProvidersList.IsNullOrEmpty())\n            {\n                dataProvidersList.AddRange(Config.Get(\"history-provider\", \"SubscriptionDataReaderHistoryProvider\").DeserializeList());\n            }\n\n            _dataPermissionManager = parameters.DataPermissionManager;\n            foreach (var historyProviderName in dataProvidersList)\n            {\n                IHistoryProvider historyProvider;\n                if (HistoryExtensions.TryGetBrokerageName(historyProviderName, out var brokerageName))\n                {\n                    // we get the data queue handler if it already exists\n                    var dataQueueHandler = Composer.Instance.GetPart<IDataQueueHandler>((x) => x.GetType().Name == brokerageName);\n                    if (dataQueueHandler == null)\n                    {\n                        // we need to create the brokerage/data queue handler\n                        dataQueueHandler = Composer.Instance.GetExportedValueByTypeName<IDataQueueHandler>(brokerageName);\n                        // initialize it\n                        dataQueueHandler.SetJob((Packets.LiveNodePacket)parameters.Job);\n                        Log.Trace($\"HistoryProviderManager.Initialize(): Created and wrapped '{brokerageName}' as '{typeof(BrokerageHistoryProvider).Name}'\");\n                    }\n                    else\n                    {\n                        Log.Trace($\"HistoryProviderManager.Initialize(): Wrapping '{brokerageName}' instance as '{typeof(BrokerageHistoryProvider).Name}'\");\n                    }\n\n                    // wrap it\n                    var brokerageHistoryProvider = new BrokerageHistoryProvider();\n                    brokerageHistoryProvider.SetBrokerage((IBrokerage)dataQueueHandler);\n                    historyProvider = brokerageHistoryProvider;\n                }\n                else\n                {\n                    historyProvider = Composer.Instance.GetExportedValueByTypeName<IHistoryProvider>(historyProviderName);\n                    if (historyProvider is BrokerageHistoryProvider)\n                    {\n                        (historyProvider as BrokerageHistoryProvider).SetBrokerage(_brokerage);\n                    }\n                }\n                historyProvider.Initialize(parameters);\n                historyProvider.InvalidConfigurationDetected += (sender, args) => { OnInvalidConfigurationDetected(args); };\n                historyProvider.NumericalPrecisionLimited += (sender, args) => { OnNumericalPrecisionLimited(args); };\n                historyProvider.StartDateLimited += (sender, args) => { OnStartDateLimited(args); };\n                historyProvider.DownloadFailed += (sender, args) => { OnDownloadFailed(args); };\n                historyProvider.ReaderErrorDetected += (sender, args) => { OnReaderErrorDetected(args); };\n                _historyProviders.Add(historyProvider);\n            }\n\n            Log.Trace($\"HistoryProviderManager.Initialize(): history providers [{string.Join(\",\", _historyProviders.Select(x => x.GetType().Name))}]\");\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            List<IEnumerator<Slice>> historyEnumerators = new(_historyProviders.Count);\n\n            var historyRequests = new List<HistoryRequest>();\n            foreach (var request in requests)\n            {\n                var config = request.ToSubscriptionDataConfig();\n                _dataPermissionManager?.AssertConfiguration(config, request.StartTimeLocal, request.EndTimeLocal);\n                historyRequests.Add(request);\n            }\n\n            foreach (var historyProvider in _historyProviders)\n            {\n                try\n                {\n                    var history = historyProvider.GetHistory(historyRequests, sliceTimeZone);\n                    if (history == null)\n                    {\n                        // doesn't support this history request, that's okay\n                        continue;\n                    }\n                    historyEnumerators.Add(history.GetEnumerator());\n\n                    if (_job != null && _job.DeploymentTarget == DeploymentTarget.CloudPlatform\n                        && _historyProviders.Count > 1 && historyRequests.All(x => x.Symbol.SecurityType == SecurityType.Equity))\n                    {\n                        if (!_loggedEquityShortcutWarning)\n                        {\n                            _loggedEquityShortcutWarning = true;\n                            Log.Trace($\"HistoryProviderManager.GetHistory(): using {_historyProviders[0].GetType().Name} provider for equity,\" +\n                                $\" skipping: [{string.Join(\",\", _historyProviders.Skip(1).Select(x => x.GetType().Name))}]\");\n                        }\n                        break;\n                    }\n                }\n                catch (Exception e)\n                {\n                    // ignore\n                }\n            }\n            using var synchronizer = new SynchronizingSliceEnumerator(historyEnumerators);\n            Slice latestMergeSlice = null;\n            while (synchronizer.MoveNext())\n            {\n                if (synchronizer.Current == null)\n                {\n                    continue;\n                }\n                if (latestMergeSlice == null)\n                {\n                    latestMergeSlice = synchronizer.Current;\n                    continue;\n                }\n                if (synchronizer.Current.UtcTime > latestMergeSlice.UtcTime)\n                {\n                    // a newer slice we emit the old and keep a reference of the new\n                    // so in the next loop we merge if required\n                    yield return latestMergeSlice;\n                    latestMergeSlice = synchronizer.Current;\n                }\n                else\n                {\n                    // a new slice with same time we merge them into 'latestMergeSlice'\n                    latestMergeSlice.MergeSlice(synchronizer.Current);\n                }\n            }\n            if (latestMergeSlice != null)\n            {\n                yield return latestMergeSlice;\n            }\n        }\n\n        private int GetDataPointCount()\n        {\n            var dataPointCount = 0;\n            foreach (var historyProvider in _historyProviders)\n            {\n                dataPointCount += historyProvider.DataPointCount;\n            }\n            return dataPointCount;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/MappedSynchronizingHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2026 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Base class for history providers that resolve symbol mappings\n    /// and synchronize multiple data streams into time-aligned slices.\n    /// </summary>\n    public abstract class MappedSynchronizingHistoryProvider : SynchronizingHistoryProvider\n    {\n        /// <summary>\n        /// Resolves map files to correctly handle current and historical ticker symbols.\n        /// </summary>\n        private static readonly Lazy<IMapFileProvider> _mapFileProvider = new(Composer.Instance.GetPart<IMapFileProvider>);\n\n        /// <summary>\n        /// Gets historical data for a single resolved history request.\n        /// Implementations should assume the symbol is already correctly mapped.\n        /// </summary>\n        /// <param name=\"request\">The resolved history request.</param>\n        /// <returns>The historical data.</returns>\n        public abstract IEnumerable<BaseData>? GetHistory(HistoryRequest request);\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice>? GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            var subscriptions = new List<Subscription>();\n            foreach (var request in requests)\n            {\n                var history = request\n                    .SplitHistoryRequestWithUpdatedMappedSymbol(_mapFileProvider.Value)\n                    .SelectMany(x => GetHistory(x) ?? []);\n                var subscription = CreateSubscription(request, history);\n                if (!subscription.MoveNext())\n                {\n                    continue;\n                }\n\n                subscriptions.Add(subscription);\n            }\n\n            if (subscriptions.Count == 0)\n            {\n                return null;\n            }\n\n            // Ownership of subscription is transferred to CreateSliceEnumerableFromSubscriptions\n            return CreateSliceEnumerableFromSubscriptions(subscriptions, sliceTimeZone);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/SineHistoryProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Implements a History provider that always return a IEnumerable of Slice with prices following a sine function\n    /// </summary>\n    public class SineHistoryProvider : HistoryProviderBase\n    {\n        private readonly SecurityChanges _securityChanges = SecurityChanges.None;\n        private readonly SecurityManager _securities;\n\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        public override int DataPointCount => 0;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SineHistoryProvider\"/> class\n        /// </summary>\n        /// <param name=\"securities\">Collection of securities that a history request can return</param>\n        public SineHistoryProvider(SecurityManager securities)\n        {\n            _securities = securities;\n        }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            var configsByDateTime = GetSubscriptionDataConfigByDateTime(requests);\n            var count = configsByDateTime.Count;\n            var i = 0;\n            var timeSliceFactory = new TimeSliceFactory(sliceTimeZone);\n            foreach (var kvp in configsByDateTime)\n            {\n                var utcDateTime = kvp.Key;\n                var configs = kvp.Value;\n                var last = Convert.ToDecimal(100 + 10 * Math.Sin(Math.PI * (360 - count + i) / 180.0));\n                var high = last * 1.005m;\n                var low = last / 1.005m;\n\n                var packets = new List<DataFeedPacket>();\n\n                foreach (var config in configs)\n                {\n                    Security security;\n                    if (!_securities.TryGetValue(config.Symbol, out security))\n                    {\n                        continue;\n                    }\n\n                    var period = config.Resolution.ToTimeSpan();\n                    var time = (utcDateTime - period).ConvertFromUtc(config.DataTimeZone);\n                    var data = new TradeBar(time, config.Symbol, last, high, last, last, 1000, period);\n                    security.SetMarketPrice(data);\n                    packets.Add(new DataFeedPacket(security, config, new List<BaseData> { data }));\n                }\n\n                i++;\n                yield return timeSliceFactory.Create(utcDateTime, packets, _securityChanges, new Dictionary<Universe, BaseDataCollection>()).Slice;\n            }\n        }\n\n        private Dictionary<DateTime, List<SubscriptionDataConfig>> GetSubscriptionDataConfigByDateTime(\n            IEnumerable<HistoryRequest> requests)\n        {\n            var dictionary = new Dictionary<DateTime, List<SubscriptionDataConfig>>();\n\n            var barSize = requests.Select(x => x.Resolution.ToTimeSpan()).Min();\n            var startUtc = requests.Min(x => x.StartTimeUtc);\n            var endUtc = requests.Max(x => x.EndTimeUtc);\n\n            for (var utcDateTime = startUtc; utcDateTime < endUtc; utcDateTime += barSize)\n            {\n                var subscriptionDataConfig = new List<SubscriptionDataConfig>();\n\n                foreach (var request in requests)\n                {\n                    var exchange = request.ExchangeHours;\n                    var extendedMarket = request.IncludeExtendedMarketHours;\n                    var localDateTime = utcDateTime.ConvertFromUtc(exchange.TimeZone);\n                    if (!exchange.IsOpen(localDateTime, extendedMarket))\n                    {\n                        continue;\n                    }\n\n                    var config = request.ToSubscriptionDataConfig();\n                    subscriptionDataConfig.Add(config);\n                }\n\n                if (subscriptionDataConfig.Count > 0)\n                {\n                    dictionary.Add(utcDateTime.Add(barSize), subscriptionDataConfig);\n                }\n            }\n\n            return dictionary;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IHistoryProvider\"/> that uses <see cref=\"BaseData\"/>\n    /// instances to retrieve historical data\n    /// </summary>\n    public class SubscriptionDataReaderHistoryProvider : SynchronizingHistoryProvider\n    {\n        private SymbolProperties _nullSymbolProperties;\n        private SecurityCache _nullCache;\n        private Cash _nullCash;\n\n        private IDataProvider _dataProvider;\n        private IMapFileProvider _mapFileProvider;\n        private IFactorFileProvider _factorFileProvider;\n        private IDataCacheProvider _dataCacheProvider;\n        private IObjectStore _objectStore;\n        private bool _parallelHistoryRequestsEnabled;\n        private bool _initialized;\n\n        /// <summary>\n        /// Manager used to allow or deny access to a requested datasource for specific users\n        /// </summary>\n        protected IDataPermissionManager DataPermissionManager { get; set; }\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n            if (_initialized)\n            {\n                return;\n            }\n            _initialized = true;\n            _dataProvider = parameters.DataProvider;\n            _mapFileProvider = parameters.MapFileProvider;\n            _dataCacheProvider = parameters.DataCacheProvider;\n            _factorFileProvider = parameters.FactorFileProvider;\n            _objectStore = parameters.ObjectStore;\n            AlgorithmSettings = parameters.AlgorithmSettings;\n            DataPermissionManager = parameters.DataPermissionManager;\n            _parallelHistoryRequestsEnabled = parameters.ParallelHistoryRequestsEnabled;\n\n            _nullCache = new SecurityCache();\n            _nullCash = new Cash(Currencies.NullCurrency, 0, 1m);\n            _nullSymbolProperties = SymbolProperties.GetDefault(Currencies.NullCurrency);\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            // create subscription objects from the configs\n            var subscriptions = new List<Subscription>();\n            foreach (var request in requests)\n            {\n                var subscription = CreateSubscription(request);\n                subscriptions.Add(subscription);\n            }\n\n            return CreateSliceEnumerableFromSubscriptions(subscriptions, sliceTimeZone);\n        }\n\n        /// <summary>\n        /// Creates a subscription to process the request\n        /// </summary>\n        private Subscription CreateSubscription(HistoryRequest request)\n        {\n            var config = request.ToSubscriptionDataConfig();\n\n            // this security is internal only we do not need to worry about a few of it's properties\n            // TODO: we don't need fee/fill/BPM/etc either. Even better we should refactor & remove the need for the security\n            var security = new Security(\n                request.ExchangeHours,\n                config,\n                _nullCash,\n                _nullSymbolProperties,\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                _nullCache\n            );\n\n            var dataReader = new SubscriptionDataReader(config,\n                request,\n                _mapFileProvider,\n                _factorFileProvider,\n                _dataCacheProvider,\n                _dataProvider,\n                _objectStore);\n\n            dataReader.InvalidConfigurationDetected += (sender, args) => { OnInvalidConfigurationDetected(args); };\n            dataReader.NumericalPrecisionLimited += (sender, args) => { OnNumericalPrecisionLimited(args); };\n            dataReader.StartDateLimited += (sender, args) => { OnStartDateLimited(args); };\n            dataReader.DownloadFailed += (sender, args) => { OnDownloadFailed(args); };\n            dataReader.ReaderErrorDetected += (sender, args) => { OnReaderErrorDetected(args); };\n\n            IEnumerator<BaseData> reader = dataReader;\n            var intraday = GetIntradayDataEnumerator(dataReader, request);\n            if (intraday != null)\n            {\n                // we optionally concatenate the intraday data enumerator\n                reader = new ConcatEnumerator(true, reader, intraday);\n            }\n\n            var useDailyStrictEndTimes = LeanData.UseDailyStrictEndTimes(AlgorithmSettings, request, config.Symbol, config.Increment);\n            if (useDailyStrictEndTimes)\n            {\n                // before corporate events which might yield data and we synchronize both feeds\n                reader = new StrictDailyEndTimesEnumerator(reader, request.ExchangeHours, request.StartTimeLocal);\n            }\n\n            reader = CorporateEventEnumeratorFactory.CreateEnumerators(\n                reader,\n                config,\n                _factorFileProvider,\n                dataReader,\n                _mapFileProvider,\n                request.StartTimeLocal,\n                request.EndTimeLocal);\n\n            // optionally apply fill forward behavior\n            if (request.FillForwardResolution.HasValue)\n            {\n                // copy forward Bid/Ask bars for QuoteBars\n                if (request.DataType == typeof(QuoteBar))\n                {\n                    reader = new QuoteBarFillForwardEnumerator(reader);\n                }\n\n                var readOnlyRef = Ref.CreateReadOnly(() => request.FillForwardResolution.Value.ToTimeSpan());\n                var exchange = GetSecurityExchange(security.Exchange, request.DataType, request.Symbol);\n                reader = new FillForwardEnumerator(reader, exchange, readOnlyRef, request.IncludeExtendedMarketHours, request.StartTimeLocal, request.EndTimeLocal, config.Increment, config.DataTimeZone, useDailyStrictEndTimes, request.DataType);\n            }\n\n            // since the SubscriptionDataReader performs an any overlap condition on the trade bar's entire\n            // range (time->end time) we can end up passing the incorrect data (too far past, possibly future),\n            // so to combat this we deliberately filter the results from the data reader to fix these cases\n            // which only apply to non-tick data\n\n            reader = new SubscriptionFilterEnumerator(reader, security, request.EndTimeLocal, config.ExtendedMarketHours, false, request.ExchangeHours);\n\n            // allow all ticks\n            if (config.Resolution != Resolution.Tick)\n            {\n                var timeBasedFilter = new TimeBasedFilter(request);\n                reader = new FilterEnumerator<BaseData>(reader, timeBasedFilter.Filter);\n            }\n\n            var subscriptionRequest = new SubscriptionRequest(false, null, security, config, request.StartTimeUtc, request.EndTimeUtc);\n            if (_parallelHistoryRequestsEnabled)\n            {\n                return SubscriptionUtils.CreateAndScheduleWorker(subscriptionRequest, reader, _factorFileProvider, false, AlgorithmSettings.DailyPreciseEndTime);\n            }\n            return SubscriptionUtils.Create(subscriptionRequest, reader, AlgorithmSettings.DailyPreciseEndTime);\n        }\n\n        /// <summary>\n        /// Gets the intraday data enumerator if any\n        /// </summary>\n        protected virtual IEnumerator<BaseData> GetIntradayDataEnumerator(IEnumerator<BaseData> rawData, HistoryRequest request)\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Internal helper class to filter data based on requested times\n        /// </summary>\n        private class TimeBasedFilter\n        {\n            public Type RequestedType { get; set; }\n            public DateTime EndTimeLocal { get; set; }\n            public DateTime StartTimeLocal { get; set; }\n            public TimeBasedFilter(HistoryRequest request)\n            {\n                RequestedType = request.DataType;\n                EndTimeLocal = request.EndTimeLocal;\n                StartTimeLocal = request.StartTimeLocal;\n            }\n            public bool Filter(BaseData data)\n            {\n                // filter out all aux data, unless if we are asking for aux data\n                if (data.DataType == MarketDataType.Auxiliary && data.GetType() != RequestedType) return false;\n                // filter out future data\n                if (data.EndTime > EndTimeLocal) return false;\n                // filter out data before the start\n                return data.EndTime > StartTimeLocal;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/HistoricalData/SynchronizingHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides an abstract implementation of <see cref=\"IHistoryProvider\"/>\n    /// which provides synchronization of multiple history results\n    /// </summary>\n    public abstract class SynchronizingHistoryProvider : HistoryProviderBase\n    {\n        /// <summary>\n        /// The market hours database\n        /// </summary>\n        protected static readonly MarketHoursDatabase MarketHours = MarketHoursDatabase.FromDataFolder();\n        private int _dataPointCount;\n\n        /// <summary>\n        /// The algorithm settings instance to use\n        /// </summary>\n        public IAlgorithmSettings AlgorithmSettings { get; set; } = new AlgorithmSettings();\n\n        /// <summary>\n        /// Gets the total number of data points emitted by this history provider\n        /// </summary>\n        public override int DataPointCount => _dataPointCount;\n\n        /// <summary>\n        /// Enumerates the subscriptions into slices\n        /// </summary>\n        protected IEnumerable<Slice> CreateSliceEnumerableFromSubscriptions(List<Subscription> subscriptions, DateTimeZone sliceTimeZone)\n        {\n            // required by TimeSlice.Create, but we don't need it's behavior\n            var frontier = DateTime.MinValue;\n            // never changes, there's no selection during a history request\n            var universeSelectionData = new Dictionary<Universe, BaseDataCollection>();\n            var timeSliceFactory = new TimeSliceFactory(sliceTimeZone);\n            while (true)\n            {\n                var earlyBirdTicks = long.MaxValue;\n                var data = new List<DataFeedPacket>();\n                foreach (var subscription in subscriptions.Where(subscription => !subscription.EndOfStream))\n                {\n                    if (subscription.Current == null && !subscription.MoveNext())\n                    {\n                        // initial pump. We do it here and not when creating the subscriptions so\n                        // that parallel workers can all start as fast as possible\n                        continue;\n                    }\n\n                    DataFeedPacket packet = null;\n                    while (subscription.Current.EmitTimeUtc <= frontier)\n                    {\n                        if (packet == null)\n                        {\n                            // for performance, lets be selfish about creating a new instance\n                            packet = new DataFeedPacket(subscription.Security, subscription.Configuration);\n\n                            // only add if we have data\n                            data.Add(packet);\n                        }\n\n                        packet.Add(subscription.Current.Data);\n                        Interlocked.Increment(ref _dataPointCount);\n                        if (!subscription.MoveNext())\n                        {\n                            break;\n                        }\n                    }\n                    // update our early bird ticks (next frontier time)\n                    if (subscription.Current != null)\n                    {\n                        // take the earliest between the next piece of data or the next tz discontinuity\n                        earlyBirdTicks = Math.Min(earlyBirdTicks, subscription.Current.EmitTimeUtc.Ticks);\n                    }\n                }\n\n                if (data.Count != 0)\n                {\n                    // reuse the slice construction code from TimeSlice.Create\n                    yield return timeSliceFactory.Create(frontier, data, SecurityChanges.None, universeSelectionData).Slice;\n                }\n\n                // end of subscriptions, after we emit, else we might drop a data point\n                if (earlyBirdTicks == long.MaxValue) break;\n\n                frontier = new DateTime(Math.Max(earlyBirdTicks, frontier.Ticks), DateTimeKind.Utc);\n            }\n\n            // make sure we clean up after ourselves\n            foreach (var subscription in subscriptions)\n            {\n                subscription.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Retrieves the appropriate <see cref=\"SecurityExchange\"/> based on the data type and symbol.\n        /// </summary>\n        /// <param name=\"exchange\">The default exchange instance.</param>\n        /// <param name=\"dataType\">The type of data being processed.</param>\n        /// <param name=\"symbol\">The security symbol.</param>\n        /// <returns>The security exchange with appropriate market hours.</returns>\n        protected static SecurityExchange GetSecurityExchange(SecurityExchange exchange, Type dataType, Symbol symbol)\n        {\n            if (dataType == typeof(OpenInterest))\n            {\n                // Retrieve the original market hours, which include holidays and closed days.\n                var originalExchangeHours = MarketHours.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n                // Use the original market hours to prevent fill-forwarding on non-trading hours.\n                return new SecurityExchange(originalExchangeHours);\n            }\n            return exchange;\n        }\n\n        /// <summary>\n        /// Creates a subscription to process the history request\n        /// </summary>\n        protected Subscription CreateSubscription(HistoryRequest request, IEnumerable<BaseData> history)\n        {\n            var config = request.ToSubscriptionDataConfig();\n            var security = new Security(\n                request.ExchangeHours,\n                config,\n                new Cash(Currencies.NullCurrency, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.NullCurrency),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var reader = history.GetEnumerator();\n\n            var useDailyStrictEndTimes = LeanData.UseDailyStrictEndTimes(AlgorithmSettings, request, config.Symbol, config.Increment);\n            if (useDailyStrictEndTimes)\n            {\n                reader = new StrictDailyEndTimesEnumerator(reader, request.ExchangeHours, request.StartTimeLocal);\n            }\n\n            // optionally apply fill forward behavior\n            if (request.FillForwardResolution.HasValue)\n            {\n                // FillForwardEnumerator expects these values in local times\n                var start = request.StartTimeUtc.ConvertFromUtc(request.ExchangeHours.TimeZone);\n                var end = request.EndTimeUtc.ConvertFromUtc(request.ExchangeHours.TimeZone);\n\n                // copy forward Bid/Ask bars for QuoteBars\n                if (request.DataType == typeof(QuoteBar))\n                {\n                    reader = new QuoteBarFillForwardEnumerator(reader);\n                }\n\n                var readOnlyRef = Ref.CreateReadOnly(() => request.FillForwardResolution.Value.ToTimeSpan());\n                var exchange = GetSecurityExchange(security.Exchange, request.DataType, request.Symbol);\n                reader = new FillForwardEnumerator(reader, exchange, readOnlyRef, request.IncludeExtendedMarketHours, start, end, config.Increment, config.DataTimeZone, useDailyStrictEndTimes, request.DataType);\n            }\n\n            var subscriptionRequest = new SubscriptionRequest(false, null, security, config, request.StartTimeUtc, request.EndTimeUtc);\n\n            return SubscriptionUtils.Create(subscriptionRequest, reader, AlgorithmSettings.DailyPreciseEndTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Initializer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// Helper class to initialize a Lean engine\n    /// </summary>\n    public static class Initializer\n    {\n        /// <summary>\n        /// Basic common Lean initialization\n        /// </summary>\n        public static void Start()\n        {\n            try\n            {\n                var mode = \"RELEASE\";\n                #if DEBUG\n                mode = \"DEBUG\";\n                #endif\n\n                Log.DebuggingEnabled = Config.GetBool(\"debug-mode\");\n                var destinationDir = Globals.ResultsDestinationFolder;\n                if (!string.IsNullOrEmpty(destinationDir))\n                {\n                    Directory.CreateDirectory(destinationDir);\n                    Log.FilePath = Path.Combine(destinationDir, \"log.txt\");\n                }\n                Log.LogHandler = Composer.Instance.GetExportedValueByTypeName<ILogHandler>(Config.Get(\"log-handler\", \"CompositeLogHandler\"));\n\n                Log.Trace($\"Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v{Globals.Version} Mode: {mode} ({(Environment.Is64BitProcess ? \"64\" : \"32\")}bit) Host: {Environment.MachineName}\");\n                Log.Trace(\"Engine.Main(): Started \" + DateTime.Now.ToShortTimeString());\n            }\n            catch (Exception e)\n            {\n                Log.Error(e);\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Get and initializes System Handler\n        /// </summary>\n        public static LeanEngineSystemHandlers GetSystemHandlers()\n        {\n            var systemHandlers = LeanEngineSystemHandlers.FromConfiguration(Composer.Instance);\n\n            //Setup packeting, queue and controls system: These don't do much locally.\n            systemHandlers.Initialize();\n\n            return systemHandlers;\n        }\n\n        /// <summary>\n        /// Get and initializes Algorithm Handler\n        /// </summary>\n        public static LeanEngineAlgorithmHandlers GetAlgorithmHandlers(bool researchMode = false)\n        {\n            return LeanEngineAlgorithmHandlers.FromConfiguration(Composer.Instance, researchMode);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/LeanEngineAlgorithmHandlers.cs",
    "content": " /*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// Provides a container for the algorithm specific handlers\n    /// </summary>\n    public class LeanEngineAlgorithmHandlers : IDisposable\n    {\n        private bool _dataMonitorWired;\n\n        /// <summary>\n        /// Gets the result handler used to communicate results from the algorithm\n        /// </summary>\n        public IResultHandler Results { get; }\n\n        /// <summary>\n        /// Gets the setup handler used to initialize the algorithm state\n        /// </summary>\n        public ISetupHandler Setup { get; }\n\n        /// <summary>\n        /// Gets the data feed handler used to provide data to the algorithm\n        /// </summary>\n        public IDataFeed DataFeed { get; }\n\n        /// <summary>\n        /// Gets the transaction handler used to process orders from the algorithm\n        /// </summary>\n        public ITransactionHandler Transactions { get; }\n\n        /// <summary>\n        /// Gets the real time handler used to process real time events\n        /// </summary>\n        public IRealTimeHandler RealTime { get; }\n\n        /// <summary>\n        /// Gets the map file provider used as a map file source for the data feed\n        /// </summary>\n        public IMapFileProvider MapFileProvider { get; }\n\n        /// <summary>\n        /// Gets the map file provider used as a map file source for the data feed\n        /// </summary>\n        public IFactorFileProvider FactorFileProvider { get; }\n\n        /// <summary>\n        /// Gets the data file provider used to retrieve security data if it is not on the file system\n        /// </summary>\n        public IDataProvider DataProvider { get; }\n\n        /// <summary>\n        /// Gets the data file provider used to retrieve security data if it is not on the file system\n        /// </summary>\n        public IDataCacheProvider DataCacheProvider { get; }\n\n        /// <summary>\n        /// Gets the object store used for persistence\n        /// </summary>\n        public IObjectStore ObjectStore { get; }\n\n        /// <summary>\n        /// Entity in charge of handling data permissions\n        /// </summary>\n        public IDataPermissionManager DataPermissionsManager { get; }\n\n        /// <summary>\n        /// Monitors data requests and reports on missing data\n        /// </summary>\n        public IDataMonitor DataMonitor { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanEngineAlgorithmHandlers\"/> class from the specified handlers\n        /// </summary>\n        /// <param name=\"results\">The result handler for communicating results from the algorithm</param>\n        /// <param name=\"setup\">The setup handler used to initialize algorithm state</param>\n        /// <param name=\"dataFeed\">The data feed handler used to pump data to the algorithm</param>\n        /// <param name=\"transactions\">The transaction handler used to process orders from the algorithm</param>\n        /// <param name=\"realTime\">The real time handler used to process real time events</param>\n        /// <param name=\"mapFileProvider\">The map file provider used to retrieve map files for the data feed</param>\n        /// <param name=\"factorFileProvider\">Map file provider used as a map file source for the data feed</param>\n        /// <param name=\"dataProvider\">file provider used to retrieve security data if it is not on the file system</param>\n        /// <param name=\"objectStore\">The object store used for persistence</param>\n        /// <param name=\"dataPermissionsManager\">The data permission manager to use</param>\n        /// <param name=\"liveMode\">True for live mode, false otherwise</param>\n        /// <param name=\"researchMode\">True for research mode, false otherwise. This has less priority than liveMode</param>\n        /// <param name=\"dataMonitor\">Optionally the data monitor instance to use</param>\n        public LeanEngineAlgorithmHandlers(IResultHandler results,\n            ISetupHandler setup,\n            IDataFeed dataFeed,\n            ITransactionHandler transactions,\n            IRealTimeHandler realTime,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IObjectStore objectStore,\n            IDataPermissionManager dataPermissionsManager,\n            bool liveMode,\n            bool researchMode = false,\n            IDataMonitor dataMonitor = null\n            )\n        {\n            if (results == null)\n            {\n                throw new ArgumentNullException(nameof(results));\n            }\n            if (setup == null)\n            {\n                throw new ArgumentNullException(nameof(setup));\n            }\n            if (dataFeed == null)\n            {\n                throw new ArgumentNullException(nameof(dataFeed));\n            }\n            if (transactions == null)\n            {\n                throw new ArgumentNullException(nameof(transactions));\n            }\n            if (realTime == null)\n            {\n                throw new ArgumentNullException(nameof(realTime));\n            }\n            if (mapFileProvider == null)\n            {\n                throw new ArgumentNullException(nameof(mapFileProvider));\n            }\n            if (factorFileProvider == null)\n            {\n                throw new ArgumentNullException(nameof(factorFileProvider));\n            }\n            if (dataProvider == null)\n            {\n                throw new ArgumentNullException(nameof(dataProvider));\n            }\n            if (objectStore == null)\n            {\n                throw new ArgumentNullException(nameof(objectStore));\n            }\n            if (dataPermissionsManager == null)\n            {\n                throw new ArgumentNullException(nameof(dataPermissionsManager));\n            }\n\n            Results = results;\n            Setup = setup;\n            DataFeed = dataFeed;\n            Transactions = transactions;\n            RealTime = realTime;\n            MapFileProvider = mapFileProvider;\n            FactorFileProvider = factorFileProvider;\n            DataProvider = dataProvider;\n            ObjectStore = objectStore;\n            DataPermissionsManager = dataPermissionsManager;\n            DataCacheProvider = new ZipDataCacheProvider(DataProvider, isDataEphemeral: liveMode);\n            DataMonitor = dataMonitor ?? new DataMonitor();\n\n            if (!liveMode && !researchMode)\n            {\n                _dataMonitorWired = true;\n                DataProvider.NewDataRequest += DataMonitor.OnNewDataRequest;\n            }\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LeanEngineAlgorithmHandlers\"/> class from the specified composer using type names from configuration\n        /// </summary>\n        /// <param name=\"composer\">The composer instance to obtain implementations from</param>\n        /// <param name=\"researchMode\">True for research mode, false otherwise</param>\n        /// <returns>A fully hydrates <see cref=\"LeanEngineSystemHandlers\"/> instance.</returns>\n        /// <exception cref=\"CompositionException\">Throws a CompositionException during failure to load</exception>\n        public static LeanEngineAlgorithmHandlers FromConfiguration(Composer composer, bool researchMode = false)\n        {\n            var setupHandlerTypeName = Config.Get(\"setup-handler\", \"ConsoleSetupHandler\");\n            var transactionHandlerTypeName = Config.Get(\"transaction-handler\", \"BacktestingTransactionHandler\");\n            var realTimeHandlerTypeName = Config.Get(\"real-time-handler\", \"BacktestingRealTimeHandler\");\n            var dataFeedHandlerTypeName = Config.Get(\"data-feed-handler\", \"FileSystemDataFeed\");\n            var resultHandlerTypeName = Config.Get(\"result-handler\", \"BacktestingResultHandler\");\n            var mapFileProviderTypeName = Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\");\n            var factorFileProviderTypeName = Config.Get(\"factor-file-provider\", \"LocalDiskFactorFileProvider\");\n            var dataProviderTypeName = Config.Get(\"data-provider\", \"DefaultDataProvider\");\n            var objectStoreTypeName = Config.Get(\"object-store\", \"LocalObjectStore\");\n            var dataPermissionManager = Config.Get(\"data-permission-manager\", \"DataPermissionManager\");\n            var dataMonitor = Config.Get(\"data-monitor\", \"QuantConnect.Data.DataMonitor\");\n\n            var result = new LeanEngineAlgorithmHandlers(\n                composer.GetExportedValueByTypeName<IResultHandler>(resultHandlerTypeName),\n                composer.GetExportedValueByTypeName<ISetupHandler>(setupHandlerTypeName),\n                composer.GetExportedValueByTypeName<IDataFeed>(dataFeedHandlerTypeName),\n                composer.GetExportedValueByTypeName<ITransactionHandler>(transactionHandlerTypeName),\n                composer.GetExportedValueByTypeName<IRealTimeHandler>(realTimeHandlerTypeName),\n                composer.GetExportedValueByTypeName<IMapFileProvider>(mapFileProviderTypeName),\n                composer.GetExportedValueByTypeName<IFactorFileProvider>(factorFileProviderTypeName),\n                composer.GetExportedValueByTypeName<IDataProvider>(dataProviderTypeName),\n                composer.GetExportedValueByTypeName<IObjectStore>(objectStoreTypeName),\n                composer.GetExportedValueByTypeName<IDataPermissionManager>(dataPermissionManager),\n                Globals.LiveMode,\n                researchMode,\n                composer.GetExportedValueByTypeName<IDataMonitor>(dataMonitor)\n                );\n\n            result.FactorFileProvider.Initialize(result.MapFileProvider, result.DataProvider);\n            result.MapFileProvider.Initialize(result.DataProvider);\n\n            if (result.DataProvider is ApiDataProvider\n                && (result.FactorFileProvider is not LocalZipFactorFileProvider || result.MapFileProvider is not LocalZipMapFileProvider))\n            {\n                throw new ArgumentException($\"The {typeof(ApiDataProvider)} can only be used with {typeof(LocalZipFactorFileProvider)}\" +\n                    $\" and {typeof(LocalZipMapFileProvider)}, please update 'config.json'\");\n            }\n\n            FundamentalService.Initialize(result.DataProvider, Globals.LiveMode);\n\n            return result;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Log.Trace(\"LeanEngineAlgorithmHandlers.Dispose(): start...\");\n\n            DataCacheProvider.DisposeSafely();\n            Setup.DisposeSafely();\n            ObjectStore.DisposeSafely();\n            if (_dataMonitorWired)\n            {\n                DataProvider.NewDataRequest -= DataMonitor.OnNewDataRequest;\n            }\n            DataMonitor.DisposeSafely();\n\n            Log.Trace(\"LeanEngineAlgorithmHandlers.Dispose(): Disposed of algorithm handlers.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/LeanEngineSystemHandlers.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Server;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine\n{\n    /// <summary>\n    /// Provides a container for the system level handlers\n    /// </summary>\n    public class LeanEngineSystemHandlers : IDisposable\n    {\n        private readonly IApi _api;\n        private readonly IMessagingHandler _notify;\n        private readonly IJobQueueHandler _jobQueue;\n        private readonly ILeanManager _leanManager;\n\n        /// <summary>\n        /// Gets the api instance used for communicating algorithm limits, status, and storing of log data\n        /// </summary>\n        public IApi Api\n        {\n            get { return _api; }\n        }\n\n        /// <summary>\n        /// Gets the messaging handler instance used for communicating various packets to listeners, including\n        /// debug/log messages, email/sms/web messages, as well as results and run time errors\n        /// </summary>\n        public IMessagingHandler Notify\n        {\n            get { return _notify; }\n        }\n\n        /// <summary>\n        /// Gets the job queue responsible for acquiring and acknowledging an algorithm job\n        /// </summary>\n        public IJobQueueHandler JobQueue\n        {\n            get { return _jobQueue; }\n        }\n\n        /// <summary>\n        /// Gets the ILeanManager implementation using to enhance the hosting environment\n        /// </summary>\n        public ILeanManager LeanManager\n        {\n            get { return _leanManager; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeanEngineSystemHandlers\"/> class with the specified handles\n        /// </summary>\n        /// <param name=\"jobQueue\">The job queue used to acquire algorithm jobs</param>\n        /// <param name=\"api\">The api instance used for communicating limits and status</param>\n        /// <param name=\"notify\">The messaging handler user for passing messages from the algorithm to listeners</param>\n        /// <param name=\"leanManager\"></param>\n        public LeanEngineSystemHandlers(IJobQueueHandler jobQueue, IApi api, IMessagingHandler notify, ILeanManager leanManager)\n        {\n            if (jobQueue == null)\n            {\n                throw new ArgumentNullException(nameof(jobQueue));\n            }\n            if (api == null)\n            {\n                throw new ArgumentNullException(nameof(api));\n            }\n            if (notify == null)\n            {\n                throw new ArgumentNullException(nameof(notify));\n            }\n            if (leanManager == null)\n            {\n                throw new ArgumentNullException(nameof(leanManager));\n            }\n            _api = api;\n            _jobQueue = jobQueue;\n            _notify = notify;\n            _leanManager = leanManager;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"LeanEngineSystemHandlers\"/> class from the specified composer using type names from configuration\n        /// </summary>\n        /// <param name=\"composer\">The composer instance to obtain implementations from</param>\n        /// <returns>A fully hydrates <see cref=\"LeanEngineSystemHandlers\"/> instance.</returns>\n        /// <exception cref=\"CompositionException\">Throws a CompositionException during failure to load</exception>\n        public static LeanEngineSystemHandlers FromConfiguration(Composer composer)\n        {\n            return new LeanEngineSystemHandlers(\n                composer.GetExportedValueByTypeName<IJobQueueHandler>(Config.Get(\"job-queue-handler\", \"QuantConnect.Queues.JobQueue\")),\n                composer.GetExportedValueByTypeName<IApi>(Config.Get(\"api-handler\", \"QuantConnect.Api.Api\")),\n                composer.GetExportedValueByTypeName<IMessagingHandler>(Config.Get(\"messaging-handler\", \"QuantConnect.Messaging.Messaging\")),\n                composer.GetExportedValueByTypeName<ILeanManager>(Config.Get(\"lean-manager-type\", \"LocalLeanManager\")));\n        }\n\n        /// <summary>\n        /// Initializes the Api, Messaging, and JobQueue components\n        /// </summary>\n        public void Initialize()\n        {\n            Notify.Initialize(new MessagingHandlerInitializeParameters(Api));\n            JobQueue.Initialize(Api, Notify);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Log.Trace(\"LeanEngineSystemHandlers.Dispose(): start...\");\n\n            LeanManager.DisposeSafely();\n            Notify.DisposeSafely();\n            Api.DisposeSafely();\n\n            Log.Trace(\"LeanEngineSystemHandlers.Dispose(): Disposed of system handlers.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Lean.Engine\")]\n[assembly: AssemblyProduct(\"QuantConnect.Lean.Engine\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"5c62be9c-5ecb-413e-bb6e-c6544e5b809c\")]\n\n[assembly: InternalsVisibleTo(\"QuantConnect.Tests\")]\n"
  },
  {
    "path": "Engine/QuantConnect.Lean.Engine.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Lean.Engine</RootNamespace>\n    <AssemblyName>QuantConnect.Lean.Engine</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <RestorePackages>true</RestorePackages>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <MapFileExtensions>true</MapFileExtensions>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Lean.Engine.xml</DocumentationFile>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Engine Project - Core engine and datafeed implementation</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'\">\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'\">\n    <DebugType>pdbonly</DebugType>\n    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"fasterflect\" Version=\"3.0.0\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm.CSharp\\QuantConnect.Algorithm.CSharp.csproj\" />\n    <ProjectReference Include=\"..\\AlgorithmFactory\\QuantConnect.AlgorithmFactory.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Brokerages\\QuantConnect.Brokerages.csproj\" />\n    <ProjectReference Include=\"..\\Compression\\QuantConnect.Compression.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Engine/RealTime/BacktestingRealTimeHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.Results;\n\nnamespace QuantConnect.Lean.Engine.RealTime\n{\n    /// <summary>\n    /// Pseudo realtime event processing for backtesting to simulate realtime events in fast forward.\n    /// </summary>\n    public class BacktestingRealTimeHandler : BaseRealTimeHandler\n    {\n        private bool _sortingScheduledEventsRequired;\n        private List<ScheduledEvent> _scheduledEventsSortedByTime = new List<ScheduledEvent>();\n\n        /// <summary>\n        /// Flag indicating the hander thread is completely finished and ready to dispose.\n        /// this doesn't run as its own thread\n        /// </summary>\n        public override bool IsActive { get; protected set; }\n\n        /// <summary>\n        /// Initializes the real time handler for the specified algorithm and job\n        /// </summary>\n        public override void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider)\n        {\n            // create events for algorithm's end of tradeable dates\n            // set up the events for each security to fire every tradeable date before market close\n            base.Setup(algorithm, job, resultHandler, api, isolatorLimitProvider);\n\n            foreach (var scheduledEvent in GetScheduledEventsSortedByTime())\n            {\n                // zoom past old events\n                scheduledEvent.SkipEventsUntil(algorithm.UtcTime);\n                // set logging accordingly\n                scheduledEvent.IsLoggingEnabled = Log.DebuggingEnabled;\n            }\n            // after skipping events we should re order\n            _sortingScheduledEventsRequired = true;\n        }\n\n        /// <summary>\n        /// Adds the specified event to the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be scheduled, including the date/times the event fires and the callback</param>\n        public override void Add(ScheduledEvent scheduledEvent)\n        {\n            if (Algorithm != null)\n            {\n                scheduledEvent.SkipEventsUntil(Algorithm.UtcTime);\n            }\n\n            ScheduledEvents.AddOrUpdate(scheduledEvent, GetScheduledEventUniqueId());\n\n            if (Log.DebuggingEnabled)\n            {\n                scheduledEvent.IsLoggingEnabled = true;\n            }\n\n            _sortingScheduledEventsRequired = true;\n        }\n\n        /// <summary>\n        /// Removes the specified event from the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be removed</param>\n        public override void Remove(ScheduledEvent scheduledEvent)\n        {\n            int id;\n            ScheduledEvents.TryRemove(scheduledEvent, out id);\n\n            _sortingScheduledEventsRequired = true;\n        }\n\n        /// <summary>\n        /// Set the time for the realtime event handler.\n        /// </summary>\n        /// <param name=\"time\">Current time.</param>\n        public override void SetTime(DateTime time)\n        {\n            var scheduledEvents = GetScheduledEventsSortedByTime();\n\n            // the first element is always the next\n            while (scheduledEvents.Count > 0 && scheduledEvents[0].NextEventUtcTime <= time)\n            {\n                try\n                {\n                    IsolatorLimitProvider.Consume(scheduledEvents[0], time, TimeMonitor);\n                }\n                catch (Exception exception)\n                {\n                    Algorithm.SetRuntimeError(exception, $\"Scheduled event: '{scheduledEvents[0].Name}' at {time}\");\n                    break;\n                }\n\n                SortFirstElement(scheduledEvents);\n            }\n        }\n\n        /// <summary>\n        /// Scan for past events that didn't fire because there was no data at the scheduled time.\n        /// </summary>\n        /// <param name=\"time\">Current time.</param>\n        public override void ScanPastEvents(DateTime time)\n        {\n            var scheduledEvents = GetScheduledEventsSortedByTime();\n\n            // the first element is always the next\n            while (scheduledEvents.Count > 0 && scheduledEvents[0].NextEventUtcTime < time)\n            {\n                var scheduledEvent = scheduledEvents[0];\n                var nextEventUtcTime = scheduledEvent.NextEventUtcTime;\n\n                Algorithm.SetDateTime(nextEventUtcTime);\n\n                try\n                {\n                    IsolatorLimitProvider.Consume(scheduledEvent, nextEventUtcTime, TimeMonitor);\n                }\n                catch (Exception exception)\n                {\n                    Algorithm.SetRuntimeError(exception, $\"Scheduled event: '{scheduledEvent.Name}' at {nextEventUtcTime}\");\n                    break;\n                }\n\n                SortFirstElement(scheduledEvents);\n            }\n        }\n\n        private List<ScheduledEvent> GetScheduledEventsSortedByTime()\n        {\n            if (_sortingScheduledEventsRequired)\n            {\n                _sortingScheduledEventsRequired = false;\n                _scheduledEventsSortedByTime = ScheduledEvents\n                    // we order by next event time\n                    .OrderBy(x => x.Key.NextEventUtcTime)\n                    // then by unique id so that for scheduled events in the same time\n                    // respect their creation order, so its deterministic\n                    .ThenBy(x => x.Value)\n                    .Select(x => x.Key).ToList();\n            }\n\n            return _scheduledEventsSortedByTime;\n        }\n\n        /// <summary>\n        /// Sorts the first element of the provided list and supposes the rest of the collection is sorted.\n        /// Supposes the collection has at least 1 element\n        /// </summary>\n        public static void SortFirstElement(IList<ScheduledEvent> scheduledEvents)\n        {\n            var scheduledEvent = scheduledEvents[0];\n            var nextEventUtcTime = scheduledEvent.NextEventUtcTime;\n\n            if (scheduledEvents.Count > 1\n                // if our NextEventUtcTime is after the next event we sort our selves\n                && nextEventUtcTime > scheduledEvents[1].NextEventUtcTime)\n            {\n                // remove ourselves and re insert at the correct position, the rest of the items are sorted!\n                scheduledEvents.RemoveAt(0);\n\n                var position = scheduledEvents.BinarySearch(nextEventUtcTime,\n                    (time, orderEvent) => time.CompareTo(orderEvent.NextEventUtcTime));\n                if (position >= 0)\n                {\n                    // we have to insert after existing position to respect existing order, see ScheduledEventsOrderRegressionAlgorithm\n                    var finalPosition = position + 1;\n                    if (finalPosition == scheduledEvents.Count)\n                    {\n                        // bigger than all of them add at the end\n                        scheduledEvents.Add(scheduledEvent);\n                    }\n                    else\n                    {\n                        // Calling insert isn't that performant but note that we are doing it once\n                        // and has better performance than sorting the entire collection\n                        scheduledEvents.Insert(finalPosition, scheduledEvent);\n                    }\n                }\n                else\n                {\n                    var index = ~position;\n                    if (index == scheduledEvents.Count)\n                    {\n                        // bigger than all of them insert in the end\n                        scheduledEvents.Add(scheduledEvent);\n                    }\n                    else\n                    {\n                        // index + 1 is bigger than us so insert before\n                        scheduledEvents.Insert(index, scheduledEvent);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/RealTime/BaseRealTimeHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Packets;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Collections.Concurrent;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\n\nnamespace QuantConnect.Lean.Engine.RealTime\n{\n    /// <summary>\n    /// Base class for the real time handler <see cref=\"LiveTradingRealTimeHandler\"/>\n    /// and <see cref=\"BacktestingRealTimeHandler\"/> implementations\n    /// </summary>\n    public abstract class BaseRealTimeHandler : IRealTimeHandler\n    {\n        private int _scheduledEventUniqueId;\n        // For performance only add OnEndOfDay Symbol scheduled events if the method is implemented.\n        // When there are many securities it adds a significant overhead\n        private bool _implementsOnEndOfDaySymbol;\n        private bool _implementsOnEndOfDay;\n\n        /// <summary>\n        /// Keep track of this event so we can remove it when we need to update it\n        /// </summary>\n        private ScheduledEvent _algorithmOnEndOfDay;\n\n        /// <summary>\n        /// Keep a separate track of these scheduled events so we can remove them\n        /// if the security gets removed\n        /// </summary>\n        private readonly ConcurrentDictionary<Symbol, ScheduledEvent> _securityOnEndOfDay = new();\n\n        /// <summary>\n        /// The result handler instance\n        /// </summary>\n        private IResultHandler ResultHandler { get; set; }\n\n        /// <summary>\n        /// Thread status flag.\n        /// </summary>\n        public abstract bool IsActive { get; protected set; }\n\n        /// <summary>\n        /// The scheduled events container\n        /// </summary>\n        /// <remarks>Initialize this immediately since the Initialize method gets\n        /// called after IAlgorithm.Initialize, so we want to be ready to accept\n        /// events as soon as possible</remarks>\n        protected ConcurrentDictionary<ScheduledEvent, int> ScheduledEvents { get; } = new();\n\n        /// <summary>\n        /// The isolator limit result provider instance\n        /// </summary>\n        protected IIsolatorLimitResultProvider IsolatorLimitProvider { get; private set; }\n\n        /// <summary>\n        /// The algorithm instance\n        /// </summary>\n        protected IAlgorithm Algorithm { get; private set; }\n\n        /// <summary>\n        /// The time monitor instance to use\n        /// </summary>\n        protected TimeMonitor TimeMonitor { get; private set; }\n\n        /// <summary>\n        /// Adds the specified event to the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be scheduled, including the date/times\n        /// the event fires and the callback</param>\n        public abstract void Add(ScheduledEvent scheduledEvent);\n\n        /// <summary>\n        /// Removes the specified event from the schedule\n        /// </summary>\n        /// <param name=\"scheduledEvent\">The event to be removed</param>\n        public abstract void Remove(ScheduledEvent scheduledEvent);\n\n        /// <summary>\n        /// Set the current time for the event scanner (so we can use same code for backtesting and live events)\n        /// </summary>\n        /// <param name=\"time\">Current real or backtest time.</param>\n        public abstract void SetTime(DateTime time);\n\n        /// <summary>\n        /// Scan for past events that didn't fire because there was no data at the scheduled time.\n        /// </summary>\n        /// <param name=\"time\">Current time.</param>\n        public abstract void ScanPastEvents(DateTime time);\n\n        /// <summary>\n        /// Initializes the real time handler for the specified algorithm and job.\n        /// Adds EndOfDayEvents\n        /// </summary>\n        public virtual void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider)\n        {\n            Algorithm = algorithm;\n            ResultHandler = resultHandler;\n            TimeMonitor = new TimeMonitor(GetTimeMonitorTimeout());\n            IsolatorLimitProvider = isolatorLimitProvider;\n\n            if (job.Language == Language.CSharp)\n            {\n                var method = Algorithm.GetType().GetMethod(\"OnEndOfDay\", new[] { typeof(Symbol) });\n                var method2 = Algorithm.GetType().GetMethod(\"OnEndOfDay\", new[] { typeof(string) });\n                if (method != null && method.DeclaringType != typeof(QCAlgorithm)\n                    || method2 != null && method2.DeclaringType != typeof(QCAlgorithm))\n                {\n                    _implementsOnEndOfDaySymbol = true;\n                }\n\n                // Also determine if we are using the soon to be deprecated EOD so we don't use it\n                // unnecessarily and post messages about its deprecation to the user\n                var eodMethod = Algorithm.GetType().GetMethod(\"OnEndOfDay\", Type.EmptyTypes);\n                if (eodMethod != null && eodMethod.DeclaringType != typeof(QCAlgorithm))\n                {\n                    _implementsOnEndOfDay = true;\n                }\n            }\n            else if (job.Language == Language.Python)\n            {\n                var wrapper = Algorithm as AlgorithmPythonWrapper;\n                if (wrapper != null)\n                {\n                    _implementsOnEndOfDaySymbol = wrapper.IsOnEndOfDaySymbolImplemented;\n                    _implementsOnEndOfDay = wrapper.IsOnEndOfDayImplemented;\n                }\n            }\n            else\n            {\n                throw new ArgumentException(nameof(job.Language));\n            }\n\n            // Here to maintain functionality until deprecation in August 2021\n            AddAlgorithmEndOfDayEvent(start: algorithm.Time, end: algorithm.EndDate, currentUtcTime: algorithm.UtcTime);\n        }\n\n        /// <summary>\n        /// Gets a new scheduled event unique id\n        /// </summary>\n        /// <remarks>This value is used to order scheduled events in a deterministic way</remarks>\n        protected int GetScheduledEventUniqueId()\n        {\n            return Interlocked.Increment(ref _scheduledEventUniqueId);\n        }\n\n        /// <summary>\n        /// Get's the timeout the scheduled task time monitor should use\n        /// </summary>\n        protected virtual int GetTimeMonitorTimeout()\n        {\n            return 100;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ScheduledEvent\"/> that will fire before market close by the specified time\n        /// </summary>\n        /// <param name=\"start\">The date to start the events</param>\n        /// <param name=\"end\">The date to end the events</param>\n        /// <param name=\"currentUtcTime\">Specifies the current time in UTC, before which,\n        /// no events will be scheduled. Specify null to skip this filter.</param>\n        [Obsolete(\"This method is deprecated. It will add ScheduledEvents for the deprecated IAlgorithm.OnEndOfDay()\")]\n        private void AddAlgorithmEndOfDayEvent(DateTime start, DateTime end, DateTime? currentUtcTime = null)\n        {\n            // If the algorithm didn't implement it no need to support it.\n            if (!_implementsOnEndOfDay) { return; }\n\n            if (_algorithmOnEndOfDay != null)\n            {\n                // if we already set it once we remove the previous and\n                // add a new one, we don't want to keep both\n                Remove(_algorithmOnEndOfDay);\n            }\n\n            // add end of day events for each tradeable day\n            _algorithmOnEndOfDay = ScheduledEventFactory.EveryAlgorithmEndOfDay(\n                Algorithm,\n                ResultHandler,\n                start,\n                end,\n                ScheduledEvent.AlgorithmEndOfDayDelta,\n                currentUtcTime);\n\n            Add(_algorithmOnEndOfDay);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ScheduledEvent\"/> that will fire before market\n        /// close by the specified time for each provided securities.\n        /// </summary>\n        /// <param name=\"securities\">The securities for which we want to add the OnEndOfDay event</param>\n        /// <param name=\"start\">The date to start the events</param>\n        /// <param name=\"end\">The date to end the events</param>\n        /// <param name=\"currentUtcTime\">Specifies the current time in UTC, before which,\n        /// no events will be scheduled. Specify null to skip this filter.</param>\n        private void AddSecurityDependentEndOfDayEvents(\n            IEnumerable<Security> securities,\n            DateTime start,\n            DateTime end,\n            DateTime? currentUtcTime = null)\n        {\n            // add end of trading day events for each security\n            foreach (var security in securities)\n            {\n                var scheduledEvent = ScheduledEventFactory.EverySecurityEndOfDay(\n                    Algorithm, ResultHandler, security, start, end, ScheduledEvent.SecurityEndOfDayDelta, currentUtcTime);\n\n                // we keep separate track so we can remove it later\n                _securityOnEndOfDay[security.Symbol] = scheduledEvent;\n\n                // assumes security.Exchange has been updated with today's hours via RefreshMarketHoursToday\n                Add(scheduledEvent);\n            }\n        }\n\n        /// <summary>\n        /// Event fired each time that we add/remove securities from the data feed\n        /// </summary>\n        public void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            if (changes != SecurityChanges.None)\n            {\n                if (_implementsOnEndOfDaySymbol)\n                {\n                    // we only add and remove on end of day for non internal securities\n                    changes = new SecurityChanges(changes) { FilterInternalSecurities = true };\n                    AddSecurityDependentEndOfDayEvents(changes.AddedSecurities,\n                        Algorithm.UtcTime,\n                        Algorithm.EndDate,\n                        Algorithm.UtcTime);\n\n                    foreach (var security in changes.RemovedSecurities)\n                    {\n                        ScheduledEvent scheduledEvent;\n                        if (_securityOnEndOfDay.TryRemove(security.Symbol, out scheduledEvent))\n                        {\n                            // we remove the schedule events of the securities that were removed\n                            Remove(scheduledEvent);\n                        }\n                    }\n                }\n\n                // we re add the algorithm end of day event because it depends on the securities\n                // tradable dates\n                // Here to maintain functionality until deprecation in August 2021\n                AddAlgorithmEndOfDayEvent(Algorithm.UtcTime, Algorithm.EndDate, Algorithm.UtcTime);\n            }\n        }\n\n        /// <summary>\n        /// Stop the real time thread\n        /// </summary>\n        public virtual void Exit()\n        {\n            TimeMonitor.DisposeSafely();\n            TimeMonitor = null;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/RealTime/IRealTimeHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Lean.Engine.RealTime\n{\n    /// <summary>\n    /// Real time event handler, trigger functions at regular or pretimed intervals\n    /// </summary>\n    [InheritedExport(typeof(IRealTimeHandler))]\n    public interface IRealTimeHandler : IEventSchedule\n    {\n        /// <summary>\n        /// Thread status flag.\n        /// </summary>\n        bool IsActive\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Initializes the real time handler for the specified algorithm and job\n        /// </summary>\n        void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider);\n\n        /// <summary>\n        /// Set the current time for the event scanner (so we can use same code for backtesting and live events)\n        /// </summary>\n        /// <param name=\"time\">Current real or backtest time.</param>\n        void SetTime(DateTime time);\n\n        /// <summary>\n        /// Scan for past events that didn't fire because there was no data at the scheduled time.\n        /// </summary>\n        /// <param name=\"time\">Current time.</param>\n        void ScanPastEvents(DateTime time);\n\n        /// <summary>\n        /// Trigger and exit signal to terminate real time event scanner.\n        /// </summary>\n        void Exit();\n\n        /// <summary>\n        /// Event fired each time that we add/remove securities from the data feed\n        /// </summary>\n        void OnSecuritiesChanged(SecurityChanges changes);\n    }\n}\n"
  },
  {
    "path": "Engine/RealTime/LiveTradingRealTimeHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Lean.Engine.Results;\n\nnamespace QuantConnect.Lean.Engine.RealTime\n{\n    /// <summary>\n    /// Live trading realtime event processing.\n    /// </summary>\n    public class LiveTradingRealTimeHandler : BacktestingRealTimeHandler\n    {\n        private Thread _realTimeThread;\n        private CancellationTokenSource _cancellationTokenSource = new();\n\n        /// <summary>\n        /// Gets the current market hours database instance\n        /// </summary>\n        protected MarketHoursDatabase MarketHoursDatabase { get; set; } = MarketHoursDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Gets the current symbol properties database instance\n        /// </summary>\n        protected SymbolPropertiesDatabase SymbolPropertiesDatabase { get; set; } = SymbolPropertiesDatabase.FromDataFolder();\n\n        /// <summary>\n        /// Gets the time provider\n        /// </summary>\n        /// <remarks>\n        /// This should be fixed to RealTimeHandler, but made a protected property for testing purposes\n        /// </remarks>\n        protected virtual ITimeProvider TimeProvider { get; } = RealTimeProvider.Instance;\n\n        /// <summary>\n        /// Boolean flag indicating thread state.\n        /// </summary>\n        public override bool IsActive { get; protected set; }\n\n        /// <summary>\n        /// Initializes the real time handler for the specified algorithm and job\n        /// </summary>\n        public override void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider)\n        {\n            base.Setup(algorithm, job, resultHandler, api, isolatorLimitProvider);\n\n            var utcNow = TimeProvider.GetUtcNow();\n            var todayInAlgorithmTimeZone = utcNow.ConvertFromUtc(Algorithm.TimeZone).Date;\n\n            // set up an scheduled event to refresh market hours and symbol properties every certain period of time\n            var times = Time.DateTimeRange(utcNow.Date, Time.EndOfTime, Algorithm.Settings.DatabasesRefreshPeriod).Where(date => date > utcNow);\n\n            Add(new ScheduledEvent(\"RefreshMarketHoursAndSymbolProperties\", times, (name, triggerTime) =>\n            {\n                ResetMarketHoursDatabase();\n                ResetSymbolPropertiesDatabase();\n            }));\n        }\n\n        /// <summary>\n        /// Get's the timeout the scheduled task time monitor should use\n        /// </summary>\n        protected override int GetTimeMonitorTimeout()\n        {\n            return 500;\n        }\n\n        /// <summary>\n        /// Execute the live realtime event thread montioring.\n        /// It scans every second monitoring for an event trigger.\n        /// </summary>\n        private void Run()\n        {\n            IsActive = true;\n\n            // continue thread until cancellation is requested\n            while (!_cancellationTokenSource.IsCancellationRequested)\n            {\n                var time = TimeProvider.GetUtcNow();\n                WaitTillNextSecond(time);\n\n                // poke each event to see if it should fire, we order by unique id to be deterministic\n                foreach (var kvp in ScheduledEvents.OrderBySafe(pair => pair.Value))\n                {\n                    var scheduledEvent = kvp.Key;\n                    try\n                    {\n                        IsolatorLimitProvider.Consume(scheduledEvent, time, TimeMonitor);\n                    }\n                    catch (Exception exception)\n                    {\n                        Algorithm.SetRuntimeError(exception, $\"Scheduled event: '{scheduledEvent.Name}' at {time}\");\n                    }\n                }\n            }\n\n            IsActive = false;\n            Log.Trace(\"LiveTradingRealTimeHandler.Run(): Exiting thread... Exit triggered: \" + _cancellationTokenSource.IsCancellationRequested);\n        }\n\n        /// <summary>\n        /// Set the current time. If the date changes re-start the realtime event setup routines.\n        /// </summary>\n        /// <param name=\"time\"></param>\n        public override void SetTime(DateTime time)\n        {\n            if (Algorithm.IsWarmingUp)\n            {\n                base.SetTime(time);\n            }\n            else if (_realTimeThread == null)\n            {\n                // in live mode we use current time for our time keeping\n                // this method is used by backtesting to set time based on the data\n                _realTimeThread = new Thread(Run) { IsBackground = true, Name = \"RealTime Thread\" };\n                _realTimeThread.Start(); // RealTime scan time for time based events\n            }\n        }\n\n        /// <summary>\n        /// Scan for past events that didn't fire because there was no data at the scheduled time.\n        /// </summary>\n        /// <param name=\"time\">Current time.</param>\n        public override void ScanPastEvents(DateTime time)\n        {\n            if (Algorithm.IsWarmingUp)\n            {\n                base.ScanPastEvents(time);\n            }\n            // in live mode we use current time for our time keeping\n            // this method is used by backtesting to scan for past events based on the data\n        }\n\n        /// <summary>\n        /// Stop the real time thread\n        /// </summary>\n        public override void Exit()\n        {\n            _realTimeThread.StopSafely(TimeSpan.FromMinutes(1), _cancellationTokenSource);\n            _cancellationTokenSource.DisposeSafely();\n            base.Exit();\n        }\n\n        /// <summary>\n        /// Helper method to wait until the second passes, useful to testing\n        /// </summary>\n        protected virtual void WaitTillNextSecond(DateTime time)\n        {\n            // pause until the next second\n            var nextSecond = time.RoundUp(TimeSpan.FromSeconds(1));\n            var delay = Convert.ToInt32((nextSecond - time).TotalMilliseconds);\n            Thread.Sleep(delay < 0 ? 1 : delay);\n        }\n\n        /// <summary>\n        /// Resets the market hours database, forcing a reload when reused.\n        /// Called in tests where multiple algorithms are run sequentially,\n        /// and we need to guarantee that every test starts with the same environment.\n        /// </summary>\n        protected virtual void ResetMarketHoursDatabase()\n        {\n            MarketHoursDatabase.UpdateDataFolderDatabase();\n            Log.Trace(\"LiveTradingRealTimeHandler.ResetMarketHoursDatabase(): Updated market hours database.\");\n        }\n\n        /// <summary>\n        /// Resets the symbol properties database, forcing a reload when reused.\n        /// </summary>\n        protected virtual void ResetSymbolPropertiesDatabase()\n        {\n            SymbolPropertiesDatabase.UpdateDataFolderDatabase();\n            Log.Trace(\"LiveTradingRealTimeHandler.ResetSymbolPropertiesDatabase(): Updated symbol properties database.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/RealTime/ScheduledEventFactory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.RealTime\n{\n    /// <summary>\n    /// Provides methods for creating common scheduled events\n    /// </summary>\n    public static class ScheduledEventFactory\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"ScheduledEvent\"/> that will fire at the specified <paramref name=\"timeOfDay\"/> for every day in\n        /// <paramref name=\"dates\"/>\n        /// </summary>\n        /// <param name=\"name\">An identifier for this event</param>\n        /// <param name=\"dates\">The dates to set events for at the specified time. These act as a base time to which\n        /// the <paramref name=\"timeOfDay\"/> is added to, that is, the implementation does not use .Date before\n        /// the addition</param>\n        /// <param name=\"timeOfDay\">The time each tradeable date to fire the event</param>\n        /// <param name=\"callback\">The delegate to call when an event fires</param>\n        /// <param name=\"currentUtcTime\">Specfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.</param>\n        /// <returns>A new <see cref=\"ScheduledEvent\"/> instance that fires events each tradeable day from the start to the finish at the specified time</returns>\n        public static ScheduledEvent EveryDayAt(string name, IEnumerable<DateTime> dates, TimeSpan timeOfDay, Action<string, DateTime> callback, DateTime? currentUtcTime = null)\n        {\n            var eventTimes = dates.Select(x => x.Date + timeOfDay);\n            if (currentUtcTime.HasValue)\n            {\n                eventTimes = eventTimes.Where(x => x < currentUtcTime.Value);\n            }\n            return new ScheduledEvent(name, eventTimes, callback);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ScheduledEvent\"/> that will fire before market close by the specified time\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance the event is fo</param>\n        /// <param name=\"resultHandler\">The result handler, used to communicate run time errors</param>\n        /// <param name=\"start\">The date to start the events</param>\n        /// <param name=\"end\">The date to end the events</param>\n        /// <param name=\"endOfDayDelta\">The time difference between the market close and the event, positive time will fire before market close</param>\n        /// <param name=\"currentUtcTime\">Specfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.</param>\n        /// <returns>The new <see cref=\"ScheduledEvent\"/> that will fire near market close each tradeable dat</returns>\n        [Obsolete(\"This method is deprecated. It will generate ScheduledEvents for the deprecated IAlgorithm.OnEndOfDay()\")]\n        public static ScheduledEvent EveryAlgorithmEndOfDay(IAlgorithm algorithm, IResultHandler resultHandler, DateTime start, DateTime end, TimeSpan endOfDayDelta, DateTime? currentUtcTime = null)\n        {\n            if (endOfDayDelta >= Time.OneDay)\n            {\n                throw new ArgumentException(\"Delta must be less than a day\", nameof(endOfDayDelta));\n            }\n\n            // set up an event to fire every tradeable date for the algorithm as a whole\n            var eodEventTime = Time.OneDay.Subtract(endOfDayDelta);\n\n            // create enumerable of end of day in algorithm's time zone\n            var times =\n                // for every date any exchange is open in the algorithm\n                from date in Time.EachTradeableDay(algorithm.Securities.Values, start, end)\n                // define the time of day we want the event to fire, a little before midnight\n                let eventTime = date + eodEventTime\n                // convert the event time into UTC\n                let eventUtcTime = eventTime.ConvertToUtc(algorithm.TimeZone)\n                // perform filter to verify it's not before the current time\n                where !currentUtcTime.HasValue || eventUtcTime > currentUtcTime.Value\n                select eventUtcTime;\n\n            // Log a message warning the user this EOD will be deprecated soon\n            algorithm.Debug(\"Usage of QCAlgorithm.OnEndOfDay() without a symbol will be deprecated August 2021. Always use a symbol when overriding this method: OnEndOfDay(symbol)\");\n\n            return new ScheduledEvent(CreateEventName(\"Algorithm\", \"EndOfDay\"), times, (name, triggerTime) =>\n            {\n                try\n                {\n                    algorithm.OnEndOfDay();\n                }\n                catch (Exception err)\n                {\n                    resultHandler.RuntimeError($\"Runtime error in {name} event: {err.Message}\", err.StackTrace);\n                    Log.Error(err, $\"ScheduledEvent.{name}:\");\n                }\n            });\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ScheduledEvent\"/> that will fire before market close by the specified time\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance the event is fo</param>\n        /// <param name=\"resultHandler\">The result handler, used to communicate run time errors</param>\n        /// <param name=\"security\">The security used for defining tradeable dates</param>\n        /// <param name=\"start\">The first date for the events</param>\n        /// <param name=\"end\">The date to end the events</param>\n        /// <param name=\"endOfDayDelta\">The time difference between the market close and the event, positive time will fire before market close</param>\n        /// <param name=\"currentUtcTime\">Specfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.</param>\n        /// <returns>The new <see cref=\"ScheduledEvent\"/> that will fire near market close each tradeable dat</returns>\n        public static ScheduledEvent EverySecurityEndOfDay(IAlgorithm algorithm, IResultHandler resultHandler, Security security, DateTime start, DateTime end, TimeSpan endOfDayDelta, DateTime? currentUtcTime = null)\n        {\n            if (endOfDayDelta >= Time.OneDay)\n            {\n                throw new ArgumentException(\"Delta must be less than a day\", nameof(endOfDayDelta));\n            }\n\n            var isMarketAlwaysOpen = security.Exchange.Hours.IsMarketAlwaysOpen;\n\n            // define all the times we want this event to be fired, every tradeable day for the securtiy\n            // at the delta time before market close expressed in UTC\n            var times =\n                // for every date the exchange is open for this security\n                from date in Time.EachTradeableDay(security, start, end)\n                // get the next market close for the specified date if the market closes at some point.\n                // Otherwise, use the given date at midnight\n                let marketClose = isMarketAlwaysOpen ?\n                    date.Date.AddDays(1) : security.Exchange.Hours.GetLastDailyMarketClose(date, security.IsExtendedMarketHours)\n                // define the time of day we want the event to fire before marketclose\n                let eventTime = isMarketAlwaysOpen ? marketClose : marketClose.Subtract(endOfDayDelta)\n                // convert the event time into UTC\n                let eventUtcTime = eventTime.ConvertToUtc(security.Exchange.TimeZone)\n                // perform filter to verify it's not before the current time\n                where !currentUtcTime.HasValue || eventUtcTime > currentUtcTime\n                select eventUtcTime;\n\n            return new ScheduledEvent(CreateEventName(security.Symbol.ToString(), \"EndOfDay\"), times, (name, triggerTime) =>\n            {\n                try\n                {\n                    algorithm.OnEndOfDay(security.Symbol);\n                }\n                catch (Exception err)\n                {\n                    resultHandler.RuntimeError($\"Runtime error in {name} event: {err.Message}\", err.StackTrace);\n                    Log.Error(err, $\"ScheduledEvent.{name}:\");\n                }\n            });\n        }\n\n        /// <summary>\n        /// Defines the format of event names generated by this system.\n        /// </summary>\n        /// <param name=\"scope\">The scope of the event, example, 'Algorithm' or 'Security'</param>\n        /// <param name=\"name\">A name for this specified event in this scope, example, 'EndOfDay'</param>\n        /// <returns>A string representing a fully scoped event name</returns>\n        public static string CreateEventName(string scope, string name)\n        {\n            return $\"{scope}.{name}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Server/ILeanManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Lean.Engine.Server\n{\n    /// <summary>\n    /// Provides scope into Lean that is convenient for managing a lean instance\n    /// </summary>\n    [InheritedExport(typeof(ILeanManager))]\n    public interface ILeanManager : IDisposable\n    {\n        /// <summary>\n        /// Initialize the ILeanManager implementation\n        /// </summary>\n        /// <param name=\"systemHandlers\">Exposes lean engine system handlers running LEAN</param>\n        /// <param name=\"algorithmHandlers\">Exposes the lean algorithm handlers running lean</param>\n        /// <param name=\"job\">The job packet representing either a live or backtest Lean instance</param>\n        /// <param name=\"algorithmManager\">The Algorithm manager</param>\n        void Initialize(LeanEngineSystemHandlers systemHandlers, LeanEngineAlgorithmHandlers algorithmHandlers, AlgorithmNodePacket job, AlgorithmManager algorithmManager);\n\n        /// <summary>\n        /// Sets the IAlgorithm instance in the ILeanManager\n        /// </summary>\n        /// <param name=\"algorithm\">The IAlgorithm instance being run</param>\n        void SetAlgorithm(IAlgorithm algorithm);\n\n        /// <summary>\n        /// Update ILeanManager with the IAlgorithm instance\n        /// </summary>\n        void Update();\n\n        /// <summary>\n        /// This method is called after algorithm initialization\n        /// </summary>\n        void OnAlgorithmStart();\n\n        /// <summary>\n        /// This method is called before algorithm termination\n        /// </summary>\n        void OnAlgorithmEnd();\n\n        /// <summary>\n        /// Callback fired each time that we add/remove securities from the data feed\n        /// </summary>\n        void OnSecuritiesChanged(SecurityChanges changes);\n    }\n}\n"
  },
  {
    "path": "Engine/Server/LocalLeanManager.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Packets;\nusing QuantConnect.Commands;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds.Transport;\n\nnamespace QuantConnect.Lean.Engine.Server\n{\n    /// <summary>\n    /// NOP implementation of the ILeanManager interface\n    /// </summary>\n    public class LocalLeanManager : ILeanManager\n    {\n        /// <summary>\n        /// The current algorithm\n        /// </summary>\n        protected IAlgorithm Algorithm { get; set; }\n\n        private AlgorithmNodePacket _job;\n        private ICommandHandler _commandHandler;\n\n        /// <summary>\n        /// The system handlers\n        /// </summary>\n        protected LeanEngineSystemHandlers SystemHandlers { get; set; }\n\n        /// <summary>\n        /// The algorithm handlers\n        /// </summary>\n        protected LeanEngineAlgorithmHandlers AlgorithmHandlers { get; set; }\n\n        /// <summary>\n        /// Empty implementation of the ILeanManager interface\n        /// </summary>\n        /// <param name=\"systemHandlers\">Exposes lean engine system handlers running LEAN</param>\n        /// <param name=\"algorithmHandlers\">Exposes the lean algorithm handlers running lean</param>\n        /// <param name=\"job\">The job packet representing either a live or backtest Lean instance</param>\n        /// <param name=\"algorithmManager\">The Algorithm manager</param>\n        public virtual void Initialize(LeanEngineSystemHandlers systemHandlers, LeanEngineAlgorithmHandlers algorithmHandlers, AlgorithmNodePacket job, AlgorithmManager algorithmManager)\n        {\n            AlgorithmHandlers = algorithmHandlers;\n            SystemHandlers = systemHandlers;\n            _job = job;\n        }\n\n        /// <summary>\n        /// Sets the IAlgorithm instance in the ILeanManager\n        /// </summary>\n        /// <param name=\"algorithm\">The IAlgorithm instance being run</param>\n        public virtual void SetAlgorithm(IAlgorithm algorithm)\n        {\n            Algorithm = algorithm;\n            algorithm.SetApi(SystemHandlers.Api);\n            RemoteFileSubscriptionStreamReader.SetDownloadProvider((Api.Api)SystemHandlers.Api);\n        }\n\n        /// <summary>\n        /// Execute the commands using the IAlgorithm instance\n        /// </summary>\n        public virtual void Update()\n        {\n            if(_commandHandler != null)\n            {\n                foreach (var commandResultPacket in _commandHandler.ProcessCommands())\n                {\n                    AlgorithmHandlers.Results.Messages.Enqueue(commandResultPacket);\n                }\n            }\n        }\n\n        /// <summary>\n        /// This method is called after algorithm initialization\n        /// </summary>\n        public virtual void OnAlgorithmStart()\n        {\n            if (Algorithm.LiveMode)\n            {\n                SetCommandHandler();\n            }\n        }\n\n        /// <summary>\n        /// This method is called before algorithm termination\n        /// </summary>\n        public virtual void OnAlgorithmEnd()\n        {\n            // NOP\n        }\n\n        /// <summary>\n        /// Callback fired each time that we add/remove securities from the data feed\n        /// </summary>\n        public virtual void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            // NOP\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public virtual void Dispose()\n        {\n            _commandHandler.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Set the command handler to use, protected for testing purposes\n        /// </summary>\n        protected virtual void SetCommandHandler()\n        {\n            _commandHandler = new FileCommandHandler();\n            _commandHandler.Initialize(_job, Algorithm);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/AlgorithmSetupException.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Defines an exception generated in the course of invoking <see cref=\"ISetupHandler.Setup\"/>\n    /// </summary>\n    public class AlgorithmSetupException : Exception\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmSetupException\"/> class\n        /// </summary>\n        /// <param name=\"message\">The error message</param>\n        public AlgorithmSetupException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AlgorithmSetupException\"/> class\n        /// </summary>\n        /// <param name=\"message\">The error message</param>\n        /// <param name=\"inner\">The inner exception being wrapped</param>\n        public AlgorithmSetupException(string message, Exception inner)\n            : base(message, inner)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/BacktestingSetupHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\nusing QuantConnect.AlgorithmFactory;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Brokerages.Backtesting;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Backtesting setup handler processes the algorithm initialize method and sets up the internal state of the algorithm class.\n    /// </summary>\n    public class BacktestingSetupHandler : ISetupHandler\n    {\n        /// <summary>\n        /// Get the maximum time that the initialization of an algorithm can take\n        /// </summary>\n        protected TimeSpan InitializationTimeOut { get; set; } = BaseSetupHandler.InitializationTimeout;\n\n        /// <summary>\n        /// Get the maximum time that the creation of an algorithm can take\n        /// </summary>\n        protected TimeSpan AlgorithmCreationTimeout { get; set; } = BaseSetupHandler.AlgorithmCreationTimeout;\n\n        /// <summary>\n        /// The worker thread instance the setup handler should use\n        /// </summary>\n        public WorkerThread WorkerThread { get; set; }\n\n        /// <summary>\n        /// Internal errors list from running the setup procedures.\n        /// </summary>\n        public List<Exception> Errors { get; set; }\n\n        /// <summary>\n        /// Maximum runtime of the algorithm in seconds.\n        /// </summary>\n        /// <remarks>Maximum runtime is a formula based on the number and resolution of symbols requested, and the days backtesting</remarks>\n        public TimeSpan MaximumRuntime { get; protected set; }\n\n        /// <summary>\n        /// Starting capital according to the users initialize routine.\n        /// </summary>\n        /// <remarks>Set from the user code.</remarks>\n        /// <seealso cref=\"QCAlgorithm.SetCash(decimal)\"/>\n        public decimal StartingPortfolioValue { get; protected set; }\n\n        /// <summary>\n        /// Start date for analysis loops to search for data.\n        /// </summary>\n        /// <seealso cref=\"QCAlgorithm.SetStartDate(DateTime)\"/>\n        public DateTime StartingDate { get; protected set; }\n\n        /// <summary>\n        /// Maximum number of orders for this backtest.\n        /// </summary>\n        /// <remarks>To stop algorithm flooding the backtesting system with hundreds of megabytes of order data we limit it to 100 per day</remarks>\n        public int MaxOrders { get; protected set; }\n\n        /// <summary>\n        /// Initialize the backtest setup handler.\n        /// </summary>\n        public BacktestingSetupHandler()\n        {\n            MaximumRuntime = TimeSpan.FromSeconds(300);\n            Errors = new List<Exception>();\n            StartingDate = new DateTime(1998, 01, 01);\n        }\n\n        /// <summary>\n        /// Create a new instance of an algorithm from a physical dll path.\n        /// </summary>\n        /// <param name=\"assemblyPath\">The path to the assembly's location</param>\n        /// <param name=\"algorithmNodePacket\">Details of the task required</param>\n        /// <returns>A new instance of IAlgorithm, or throws an exception if there was an error</returns>\n        public virtual IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n        {\n            string error;\n            IAlgorithm algorithm;\n\n            var debugNode = algorithmNodePacket as BacktestNodePacket;\n            var debugging = debugNode != null && debugNode.Debugging || Config.GetBool(\"debugging\", false);\n\n            if (debugging && !BaseSetupHandler.InitializeDebugging(algorithmNodePacket, WorkerThread))\n            {\n                throw new AlgorithmSetupException(\"Failed to initialize debugging\");\n            }\n\n            // Limit load times to 90 seconds and force the assembly to have exactly one derived type\n            var loader = new Loader(debugging, algorithmNodePacket.Language, AlgorithmCreationTimeout, names => names.SingleOrAlgorithmTypeName(Config.Get(\"algorithm-type-name\", algorithmNodePacket.AlgorithmId)), WorkerThread);\n            var complete = loader.TryCreateAlgorithmInstanceWithIsolator(assemblyPath, algorithmNodePacket.RamAllocation, out algorithm, out error);\n            if (!complete) throw new AlgorithmSetupException($\"During the algorithm initialization, the following exception has occurred: {error}\");\n\n            return algorithm;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"BacktestingBrokerage\"/> instance\n        /// </summary>\n        /// <param name=\"algorithmNodePacket\">Job packet</param>\n        /// <param name=\"uninitializedAlgorithm\">The algorithm instance before Initialize has been called</param>\n        /// <param name=\"factory\">The brokerage factory</param>\n        /// <returns>The brokerage instance, or throws if error creating instance</returns>\n        public virtual IBrokerage CreateBrokerage(AlgorithmNodePacket algorithmNodePacket, IAlgorithm uninitializedAlgorithm, out IBrokerageFactory factory)\n        {\n            factory = new BacktestingBrokerageFactory();\n            return new BacktestingBrokerage(uninitializedAlgorithm);\n        }\n\n        /// <summary>\n        /// Setup the algorithm cash, dates and data subscriptions as desired.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters object to use</param>\n        /// <returns>Boolean true on successfully initializing the algorithm</returns>\n        public virtual bool Setup(SetupHandlerParameters parameters)\n        {\n            var algorithm = parameters.Algorithm;\n            var job = parameters.AlgorithmNodePacket as BacktestNodePacket;\n            if (job == null)\n            {\n                throw new ArgumentException(\"Expected BacktestNodePacket but received \" + parameters.AlgorithmNodePacket.GetType().Name);\n            }\n\n            BaseSetupHandler.Setup(parameters);\n\n            if (algorithm == null)\n            {\n                Errors.Add(new AlgorithmSetupException(\"Could not create instance of algorithm\"));\n                return false;\n            }\n\n            algorithm.Name = job.Name;\n\n            //Make sure the algorithm start date ok.\n            if (job.PeriodStart == default(DateTime))\n            {\n                Errors.Add(new AlgorithmSetupException(\"Algorithm start date was never set\"));\n                return false;\n            }\n\n            var controls = job.Controls;\n            var isolator = new Isolator();\n            var initializeComplete = isolator.ExecuteWithTimeLimit(InitializationTimeOut, () =>\n            {\n                try\n                {\n                    parameters.ResultHandler.SendStatusUpdate(AlgorithmStatus.Initializing, \"Initializing algorithm...\");\n                    //Set our parameters\n                    algorithm.SetParameters(job.Parameters);\n                    algorithm.SetAvailableDataTypes(BaseSetupHandler.GetConfiguredDataFeeds());\n\n                    //Algorithm is backtesting, not live:\n                    algorithm.SetAlgorithmMode(job.AlgorithmMode);\n\n                    //Set the source impl for the event scheduling\n                    algorithm.Schedule.SetEventSchedule(parameters.RealTimeHandler);\n\n                    // set the option chain provider\n                    var optionChainProvider = new BacktestingOptionChainProvider();\n                    var initParameters = new ChainProviderInitializeParameters(parameters.MapFileProvider, algorithm.HistoryProvider);\n                    optionChainProvider.Initialize(initParameters);\n                    algorithm.SetOptionChainProvider(new CachingOptionChainProvider(optionChainProvider));\n\n                    // set the future chain provider\n                    var futureChainProvider = new BacktestingFutureChainProvider();\n                    futureChainProvider.Initialize(initParameters);\n                    algorithm.SetFutureChainProvider(new CachingFutureChainProvider(futureChainProvider));\n\n                    // before we call initialize\n                    BaseSetupHandler.LoadBacktestJobAccountCurrency(algorithm, job);\n\n                    //Initialise the algorithm, get the required data:\n                    algorithm.Initialize();\n\n                    // set start and end date if present in the job\n                    if (job.PeriodStart.HasValue)\n                    {\n                        algorithm.SetStartDate(job.PeriodStart.Value);\n                    }\n                    if (job.PeriodFinish.HasValue)\n                    {\n                        algorithm.SetEndDate(job.PeriodFinish.Value);\n                    }\n\n                    if (job.OutOfSampleMaxEndDate.HasValue)\n                    {\n                        if (algorithm.EndDate > job.OutOfSampleMaxEndDate.Value)\n                        {\n                            Log.Trace($\"BacktestingSetupHandler.Setup(): setting end date to {job.OutOfSampleMaxEndDate.Value:yyyyMMdd}\");\n                            algorithm.SetEndDate(job.OutOfSampleMaxEndDate.Value);\n\n                            if (algorithm.StartDate > algorithm.EndDate)\n                            {\n                                algorithm.SetStartDate(algorithm.EndDate);\n                            }\n                        }\n                    }\n\n                    // after we call initialize\n                    BaseSetupHandler.LoadBacktestJobCashAmount(algorithm, job);\n\n                    // after algorithm was initialized, should set trading days per year for our great portfolio statistics\n                    BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm);\n\n                    // finalize initialization\n                    algorithm.PostInitialize();\n                }\n                catch (Exception err)\n                {\n                    Errors.Add(new AlgorithmSetupException(\"During the algorithm initialization, the following exception has occurred: \", err));\n                }\n            }, controls.RamAllocation,\n                sleepIntervalMillis: 100,  // entire system is waiting on this, so be as fast as possible\n                workerThread: WorkerThread);\n\n            if (Errors.Count > 0)\n            {\n                // if we already got an error just exit right away\n                return false;\n            }\n\n            //Before continuing, detect if this is ready:\n            if (!initializeComplete) return false;\n\n            MaximumRuntime = TimeSpan.FromMinutes(job.Controls.MaximumRuntimeMinutes);\n\n            BaseSetupHandler.SetupCurrencyConversions(algorithm, parameters.UniverseSelection);\n            StartingPortfolioValue = algorithm.Portfolio.Cash;\n\n            // Get and set maximum orders for this job\n            MaxOrders = job.Controls.BacktestingMaxOrders;\n            algorithm.SetMaximumOrders(MaxOrders);\n\n            //Starting date of the algorithm:\n            StartingDate = algorithm.StartDate;\n\n            //Put into log for debugging:\n            Log.Trace(\"SetUp Backtesting: User: \" + job.UserId + \" ProjectId: \" + job.ProjectId + \" AlgoId: \" + job.AlgorithmId);\n            Log.Trace($\"Dates: Start: {algorithm.StartDate.ToStringInvariant(\"d\")} \" +\n                      $\"End: {algorithm.EndDate.ToStringInvariant(\"d\")} \" +\n                      $\"Cash: {StartingPortfolioValue.ToStringInvariant(\"C\")} \" +\n                      $\"MaximumRuntime: {MaximumRuntime} \" +\n                      $\"MaxOrders: {MaxOrders}\");\n\n            return initializeComplete;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n    } // End Result Handler Thread:\n\n} // End Namespace\n"
  },
  {
    "path": "Engine/Setup/BaseSetupHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.AlgorithmFactory;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds.WorkScheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    ///  Base class that provides shared code for\n    /// the <see cref=\"ISetupHandler\"/> implementations\n    /// </summary>\n    public static class BaseSetupHandler\n    {\n        /// <summary>\n        /// Get the maximum time that the initialization of an algorithm can take\n        /// </summary>\n        public static TimeSpan InitializationTimeout { get; } = TimeSpan.FromSeconds(Config.GetDouble(\"initialization-timeout\", 300));\n\n        /// <summary>\n        /// Get the maximum time that the creation of an algorithm can take\n        /// </summary>\n        public static TimeSpan AlgorithmCreationTimeout { get; } = TimeSpan.FromSeconds(Config.GetDouble(\"algorithm-creation-timeout\", 90));\n\n        /// <summary>\n        /// Primary entry point to setup a new algorithm\n        /// </summary>\n        /// <param name=\"parameters\">The parameters object to use</param>\n        /// <returns>True on successfully setting up the algorithm state, or false on error.</returns>\n        public static bool Setup(SetupHandlerParameters parameters)\n        {\n            var algorithm = parameters.Algorithm;\n            var job = parameters.AlgorithmNodePacket;\n\n            algorithm?.SetDeploymentTarget(job.DeploymentTarget);\n\n            Log.Trace($\"BaseSetupHandler.Setup({job.DeploymentTarget}): UID: {job.UserId.ToStringInvariant()}, \" +\n                $\"PID: {job.ProjectId.ToStringInvariant()}, Version: {job.Version}, Source: {job.RequestSource}\"\n            );\n            return true;\n        }\n\n        /// <summary>\n        /// Will first check and add all the required conversion rate securities\n        /// and later will seed an initial value to them.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"universeSelection\">The universe selection instance</param>\n        /// <param name=\"currenciesToUpdateWhiteList\">\n        /// If passed, the currencies in the CashBook that are contained in this list will be updated.\n        /// By default, if not passed (null), all currencies in the cashbook without a properly set up currency conversion will be updated.\n        /// This is not intended for actual algorithms but for tests or for this method to be used as a helper.\n        /// </param>\n        public static void SetupCurrencyConversions(\n            IAlgorithm algorithm,\n            UniverseSelection universeSelection,\n            IReadOnlyCollection<string> currenciesToUpdateWhiteList = null)\n        {\n            // this is needed to have non-zero currency conversion rates during warmup\n            // will also set the Cash.ConversionRateSecurity\n            universeSelection.EnsureCurrencyDataFeeds(SecurityChanges.None);\n\n            // now set conversion rates\n            Func<Cash, bool> cashToUpdateFilter = currenciesToUpdateWhiteList == null\n                ? (x) => x.CurrencyConversion != null && x.ConversionRate == 0\n                : (x) => currenciesToUpdateWhiteList.Contains(x.Symbol);\n            var cashToUpdate = algorithm.Portfolio.CashBook.Values.Where(cashToUpdateFilter).ToList();\n\n            var securitiesToUpdate = cashToUpdate\n                .SelectMany(x => x.CurrencyConversion.ConversionRateSecurities)\n                .Distinct()\n                .ToList();\n\n            AlgorithmUtils.SeedSecurities(securitiesToUpdate, algorithm);\n\n            foreach (var cash in cashToUpdate)\n            {\n                cash.Update();\n            }\n\n            Log.Trace($\"BaseSetupHandler.SetupCurrencyConversions():{Environment.NewLine}\" +\n                $\"Account Type: {algorithm.BrokerageModel.AccountType}{Environment.NewLine}{Environment.NewLine}{algorithm.Portfolio.CashBook}\");\n            // this is useful for debugging\n            algorithm.Portfolio.LogMarginInformation();\n        }\n\n        /// <summary>\n        /// Initialize the debugger\n        /// </summary>\n        /// <param name=\"algorithmNodePacket\">The algorithm node packet</param>\n        /// <param name=\"workerThread\">The worker thread instance to use</param>\n        public static bool InitializeDebugging(AlgorithmNodePacket algorithmNodePacket, WorkerThread workerThread)\n        {\n            var isolator = new Isolator();\n            return isolator.ExecuteWithTimeLimit(TimeSpan.FromMinutes(5),\n                () =>\n                {\n                    DebuggerHelper.Initialize(algorithmNodePacket.Language, out var workersInitializationCallback);\n\n                    if (workersInitializationCallback != null)\n                    {\n                        // initialize workers for debugging if required\n                        WeightedWorkScheduler.Instance.AddSingleCallForAll(workersInitializationCallback);\n                    }\n                },\n                algorithmNodePacket.RamAllocation,\n                sleepIntervalMillis: 100,\n                workerThread: workerThread);\n        }\n\n        /// <summary>\n        /// Sets the initial cash for the algorithm if set in the job packet.\n        /// </summary>\n        /// <remarks>Should be called after initialize <see cref=\"LoadBacktestJobAccountCurrency\"/></remarks>\n        public static void LoadBacktestJobCashAmount(IAlgorithm algorithm, BacktestNodePacket job)\n        {\n            // set initial cash, if present in the job\n            if (job.CashAmount.HasValue)\n            {\n                // Zero the CashBook - we'll populate directly from job\n                foreach (var kvp in algorithm.Portfolio.CashBook)\n                {\n                    kvp.Value.SetAmount(0);\n                }\n\n                algorithm.SetCash(job.CashAmount.Value.Amount);\n            }\n        }\n\n        /// <summary>\n        /// Sets the account currency the algorithm should use if set in the job packet\n        /// </summary>\n        /// <remarks>Should be called before initialize <see cref=\"LoadBacktestJobCashAmount\"/></remarks>\n        public static void LoadBacktestJobAccountCurrency(IAlgorithm algorithm, BacktestNodePacket job)\n        {\n            // set account currency if present in the job\n            if (job.CashAmount.HasValue)\n            {\n                algorithm.SetAccountCurrency(job.CashAmount.Value.Currency);\n            }\n        }\n\n        /// <summary>\n        /// Get the available data feeds from config.json,\n        /// </summary>\n        public static Dictionary<SecurityType, List<TickType>> GetConfiguredDataFeeds()\n        {\n            var dataFeedsConfigString = Config.Get(\"security-data-feeds\");\n\n            if (!dataFeedsConfigString.IsNullOrEmpty())\n            {\n                var dataFeeds = JsonConvert.DeserializeObject<Dictionary<SecurityType, List<TickType>>>(dataFeedsConfigString);\n                return dataFeeds;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Set the number of trading days per year based on the specified brokerage model.\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <returns>\n        /// The number of trading days per year. For specific brokerages (Coinbase, Binance, Bitfinex, Bybit, FTX, Kraken),\n        /// the value is 365. For other brokerages, the default value is 252.\n        /// </returns>\n        public static void SetBrokerageTradingDayPerYear(IAlgorithm algorithm)\n        {\n            if (algorithm == null)\n            {\n                throw new ArgumentNullException(nameof(algorithm));\n            }\n\n            algorithm.Settings.TradingDaysPerYear ??= algorithm.BrokerageModel switch\n            {\n                CoinbaseBrokerageModel\n                or BinanceBrokerageModel\n                or BitfinexBrokerageModel\n                or BybitBrokerageModel\n                or FTXBrokerageModel\n                or KrakenBrokerageModel => 365,\n                _ => 252\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/BrokerageSetupHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reflection;\nusing Fasterflect;\nusing QuantConnect.AlgorithmFactory;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Defines a set up handler that initializes the algorithm instance using values retrieved from the user's brokerage account\n    /// </summary>\n    public class BrokerageSetupHandler : ISetupHandler\n    {\n        private bool _disposed;\n\n        /// <summary>\n        /// Max allocation limit configuration variable name\n        /// </summary>\n        public static string MaxAllocationLimitConfig = \"max-allocation-limit\";\n\n        /// <summary>\n        /// The worker thread instance the setup handler should use\n        /// </summary>\n        public WorkerThread WorkerThread { get; set; }\n\n        /// <summary>\n        /// Any errors from the initialization stored here:\n        /// </summary>\n        public List<Exception> Errors { get; set; }\n\n        /// <summary>\n        /// Get the maximum runtime for this algorithm job.\n        /// </summary>\n        public TimeSpan MaximumRuntime { get; }\n\n        /// <summary>\n        /// Algorithm starting capital for statistics calculations\n        /// </summary>\n        public decimal StartingPortfolioValue { get; private set; }\n\n        /// <summary>\n        /// Start date for analysis loops to search for data.\n        /// </summary>\n        public DateTime StartingDate { get; private set; }\n\n        /// <summary>\n        /// Maximum number of orders for the algorithm run -- applicable for backtests only.\n        /// </summary>\n        public int MaxOrders { get; }\n\n        // saves ref to algo so we can call quit if runtime error encountered\n        private IBrokerageFactory _factory;\n        private IBrokerage _dataQueueHandlerBrokerage;\n\n        /// <summary>\n        /// Initializes a new BrokerageSetupHandler\n        /// </summary>\n        public BrokerageSetupHandler()\n        {\n            Errors = new List<Exception>();\n            MaximumRuntime = TimeSpan.FromDays(10 * 365);\n            MaxOrders = int.MaxValue;\n        }\n\n        /// <summary>\n        /// Create a new instance of an algorithm from a physical dll path.\n        /// </summary>\n        /// <param name=\"assemblyPath\">The path to the assembly's location</param>\n        /// <param name=\"algorithmNodePacket\">Details of the task required</param>\n        /// <returns>A new instance of IAlgorithm, or throws an exception if there was an error</returns>\n        public IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n        {\n            string error;\n            IAlgorithm algorithm;\n\n            // limit load times to 10 seconds and force the assembly to have exactly one derived type\n            var loader = new Loader(false, algorithmNodePacket.Language, BaseSetupHandler.AlgorithmCreationTimeout, names => names.SingleOrAlgorithmTypeName(Config.Get(\"algorithm-type-name\", algorithmNodePacket.AlgorithmId)), WorkerThread);\n            var complete = loader.TryCreateAlgorithmInstanceWithIsolator(assemblyPath, algorithmNodePacket.RamAllocation, out algorithm, out error);\n            if (!complete) throw new AlgorithmSetupException($\"During the algorithm initialization, the following exception has occurred: {error}\");\n\n            return algorithm;\n        }\n\n        /// <summary>\n        /// Creates the brokerage as specified by the job packet\n        /// </summary>\n        /// <param name=\"algorithmNodePacket\">Job packet</param>\n        /// <param name=\"uninitializedAlgorithm\">The algorithm instance before Initialize has been called</param>\n        /// <param name=\"factory\">The brokerage factory</param>\n        /// <returns>The brokerage instance, or throws if error creating instance</returns>\n        public IBrokerage CreateBrokerage(AlgorithmNodePacket algorithmNodePacket, IAlgorithm uninitializedAlgorithm, out IBrokerageFactory factory)\n        {\n            var liveJob = algorithmNodePacket as LiveNodePacket;\n            if (liveJob == null)\n            {\n                throw new ArgumentException(\"BrokerageSetupHandler.CreateBrokerage requires a live node packet\");\n            }\n\n            Log.Trace($\"BrokerageSetupHandler.CreateBrokerage(): creating brokerage '{liveJob.Brokerage}'\");\n\n            // find the correct brokerage factory based on the specified brokerage in the live job packet\n            _factory = Composer.Instance.Single<IBrokerageFactory>(brokerageFactory => brokerageFactory.BrokerageType.MatchesTypeName(liveJob.Brokerage));\n            factory = _factory;\n\n            PreloadDataQueueHandler(liveJob, uninitializedAlgorithm, factory);\n\n            // initialize the correct brokerage using the resolved factory\n            var brokerage = _factory.CreateBrokerage(liveJob, uninitializedAlgorithm);\n            Composer.Instance.AddPart(brokerage);\n\n            return brokerage;\n        }\n\n        /// <summary>\n        /// Primary entry point to setup a new algorithm\n        /// </summary>\n        /// <param name=\"parameters\">The parameters object to use</param>\n        /// <returns>True on successfully setting up the algorithm state, or false on error.</returns>\n        public bool Setup(SetupHandlerParameters parameters)\n        {\n            var algorithm = parameters.Algorithm;\n            var brokerage = parameters.Brokerage;\n            // verify we were given the correct job packet type\n            var liveJob = parameters.AlgorithmNodePacket as LiveNodePacket;\n            if (liveJob == null)\n            {\n                AddInitializationError(\"BrokerageSetupHandler requires a LiveNodePacket\");\n                return false;\n            }\n\n            algorithm.Name = liveJob.GetAlgorithmName();\n\n            // verify the brokerage was specified\n            if (string.IsNullOrWhiteSpace(liveJob.Brokerage))\n            {\n                AddInitializationError(\"A brokerage must be specified\");\n                return false;\n            }\n\n            BaseSetupHandler.Setup(parameters);\n\n            // attach to the message event to relay brokerage specific initialization messages\n            EventHandler<BrokerageMessageEvent> brokerageOnMessage = (sender, args) =>\n            {\n                if (args.Type == BrokerageMessageType.Error)\n                {\n                    AddInitializationError($\"Brokerage Error Code: {args.Code} - {args.Message}\");\n                }\n            };\n\n            try\n            {\n                // let the world know what we're doing since logging in can take a minute\n                parameters.ResultHandler.SendStatusUpdate(AlgorithmStatus.LoggingIn, \"Logging into brokerage...\");\n\n                brokerage.Message += brokerageOnMessage;\n\n                Log.Trace(\"BrokerageSetupHandler.Setup(): Connecting to brokerage...\");\n                try\n                {\n                    // this can fail for various reasons, such as already being logged in somewhere else\n                    brokerage.Connect();\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n                    AddInitializationError(\n                        $\"Error connecting to brokerage: {err.Message}. \" +\n                        \"This may be caused by incorrect login credentials or an unsupported account type.\", err);\n                    return false;\n                }\n\n                if (!brokerage.IsConnected)\n                {\n                    // if we're reporting that we're not connected, bail\n                    AddInitializationError(\"Unable to connect to brokerage.\");\n                    return false;\n                }\n\n                var message = $\"{brokerage.Name} account base currency: {brokerage.AccountBaseCurrency ?? algorithm.AccountCurrency}\";\n\n\n                var accountCurrency = brokerage.AccountBaseCurrency;\n                if (liveJob.BrokerageData.ContainsKey(MaxAllocationLimitConfig))\n                {\n                    accountCurrency = Currencies.USD;\n                    message += \". Allocation limited, will use 'USD' account currency\";\n                }\n\n                Log.Trace($\"BrokerageSetupHandler.Setup(): {message}\");\n\n                parameters.ResultHandler.DebugMessage(message);\n                if (accountCurrency != null && accountCurrency != algorithm.AccountCurrency)\n                {\n                    algorithm.SetAccountCurrency(accountCurrency);\n                }\n\n                Log.Trace(\"BrokerageSetupHandler.Setup(): Initializing algorithm...\");\n\n                parameters.ResultHandler.SendStatusUpdate(AlgorithmStatus.Initializing, \"Initializing algorithm...\");\n\n                //Execute the initialize code:\n                var controls = liveJob.Controls;\n                var isolator = new Isolator();\n                var initializeComplete = isolator.ExecuteWithTimeLimit(BaseSetupHandler.InitializationTimeout, () =>\n                {\n                    try\n                    {\n                        //Set the default brokerage model before initialize\n                        algorithm.SetBrokerageModel(_factory.GetBrokerageModel(algorithm.Transactions));\n\n                        //Margin calls are disabled by default in live mode\n                        algorithm.Portfolio.MarginCallModel = MarginCallModel.Null;\n\n                        //Set our parameters\n                        algorithm.SetParameters(liveJob.Parameters);\n                        algorithm.SetAvailableDataTypes(BaseSetupHandler.GetConfiguredDataFeeds());\n\n                        //Algorithm is live, not backtesting:\n                        algorithm.SetAlgorithmMode(liveJob.AlgorithmMode);\n\n                        //Initialize the algorithm's starting date\n                        algorithm.SetDateTime(DateTime.UtcNow);\n\n                        //Set the source impl for the event scheduling\n                        algorithm.Schedule.SetEventSchedule(parameters.RealTimeHandler);\n\n                        var optionChainProvider = Composer.Instance.GetPart<IOptionChainProvider>();\n                        if (optionChainProvider == null)\n                        {\n                            var baseOptionChainProvider = new LiveOptionChainProvider();\n                            baseOptionChainProvider.Initialize(new(parameters.MapFileProvider, algorithm.HistoryProvider));\n                            optionChainProvider = new CachingOptionChainProvider(baseOptionChainProvider);\n                            Composer.Instance.AddPart(optionChainProvider);\n                        }\n                        // set the option chain provider\n                        algorithm.SetOptionChainProvider(optionChainProvider);\n\n                        var futureChainProvider = Composer.Instance.GetPart<IFutureChainProvider>();\n                        if (futureChainProvider == null)\n                        {\n                            var baseFutureChainProvider = new LiveFutureChainProvider();\n                            baseFutureChainProvider.Initialize(new(parameters.MapFileProvider, algorithm.HistoryProvider));\n                            futureChainProvider = new CachingFutureChainProvider(baseFutureChainProvider);\n                            Composer.Instance.AddPart(futureChainProvider);\n                        }\n                        // set the future chain provider\n                        algorithm.SetFutureChainProvider(futureChainProvider);\n\n                        //Initialise the algorithm, get the required data:\n                        algorithm.Initialize();\n\n                        if (liveJob.Brokerage != \"PaperBrokerage\")\n                        {\n                            //Zero the CashBook - we'll populate directly from brokerage\n                            foreach (var kvp in algorithm.Portfolio.CashBook)\n                            {\n                                kvp.Value.SetAmount(0);\n                            }\n                        }\n                    }\n                    catch (Exception err)\n                    {\n                        AddInitializationError(err.ToString(), err);\n                    }\n                }, controls.RamAllocation,\n                    sleepIntervalMillis: 100); // entire system is waiting on this, so be as fast as possible\n\n                if (Errors.Count != 0)\n                {\n                    // if we already got an error just exit right away\n                    return false;\n                }\n\n                if (!initializeComplete)\n                {\n                    AddInitializationError(\"Initialization timed out.\");\n                    return false;\n                }\n\n                if (!LoadCashBalance(brokerage, algorithm))\n                {\n                    return false;\n                }\n\n                if (!LoadExistingHoldingsAndOrders(brokerage, algorithm, parameters))\n                {\n                    return false;\n                }\n\n                // after algorithm was initialized, should set trading days per year for our great portfolio statistics\n                BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm);\n\n                var dataAggregator = Composer.Instance.GetPart<IDataAggregator>();\n                dataAggregator?.Initialize(new() { AlgorithmSettings = algorithm.Settings });\n\n                //Finalize Initialization\n                algorithm.PostInitialize();\n\n                BaseSetupHandler.SetupCurrencyConversions(algorithm, parameters.UniverseSelection);\n\n                if (algorithm.Portfolio.TotalPortfolioValue == 0)\n                {\n                    algorithm.Debug(\"Warning: No cash balances or holdings were found in the brokerage account.\");\n                }\n\n                string maxCashLimitStr;\n                if (liveJob.BrokerageData.TryGetValue(MaxAllocationLimitConfig, out maxCashLimitStr))\n                {\n                    var maxCashLimit = decimal.Parse(maxCashLimitStr, NumberStyles.Any, CultureInfo.InvariantCulture);\n\n                    // If allocation exceeded by more than $10,000; block deployment\n                    if (algorithm.Portfolio.TotalPortfolioValue > (maxCashLimit + 10000m))\n                    {\n                        var exceptionMessage = $\"TotalPortfolioValue '{algorithm.Portfolio.TotalPortfolioValue}' exceeds allocation limit '{maxCashLimit}'\";\n                        algorithm.Debug(exceptionMessage);\n                        throw new ArgumentException(exceptionMessage);\n                    }\n                }\n\n                //Set the starting portfolio value for the strategy to calculate performance:\n                StartingPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;\n                StartingDate = DateTime.Now;\n            }\n            catch (Exception err)\n            {\n                AddInitializationError(err.ToString(), err);\n            }\n            finally\n            {\n                if (brokerage != null)\n                {\n                    brokerage.Message -= brokerageOnMessage;\n                }\n            }\n\n            return Errors.Count == 0;\n        }\n\n        private bool LoadCashBalance(IBrokerage brokerage, IAlgorithm algorithm)\n        {\n            Log.Trace(\"BrokerageSetupHandler.Setup(): Fetching cash balance from brokerage...\");\n            try\n            {\n                // set the algorithm's cash balance for each currency\n                var cashBalance = brokerage.GetCashBalance();\n                foreach (var cash in cashBalance)\n                {\n                    if (!CashAmountUtil.ShouldAddCashBalance(cash, algorithm.AccountCurrency))\n                    {\n                        Log.Trace($\"BrokerageSetupHandler.Setup(): Skipping {cash.Currency} cash because quantity is zero\");\n                        continue;\n                    }\n\n                    Log.Trace($\"BrokerageSetupHandler.Setup(): Setting {cash.Currency} cash to {cash.Amount}\");\n                    algorithm.Portfolio.SetCash(cash.Currency, cash.Amount, 0);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                AddInitializationError(\"Error getting cash balance from brokerage: \" + err.Message, err);\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Loads existing holdings and orders\n        /// </summary>\n        protected bool LoadExistingHoldingsAndOrders(IBrokerage brokerage, IAlgorithm algorithm, SetupHandlerParameters parameters)\n        {\n            Log.Trace(\"BrokerageSetupHandler.Setup(): Fetching open orders from brokerage...\");\n            try\n            {\n                GetOpenOrders(algorithm, parameters.ResultHandler, parameters.TransactionHandler, brokerage);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                AddInitializationError(\"Error getting open orders from brokerage: \" + err.Message, err);\n                return false;\n            }\n\n            Log.Trace(\"BrokerageSetupHandler.Setup(): Fetching holdings from brokerage...\");\n            try\n            {\n                var utcNow = DateTime.UtcNow;\n\n                // populate the algorithm with the account's current holdings\n                var holdings = brokerage.GetAccountHoldings();\n\n                // add options first to ensure raw data normalization mode is set on the equity underlyings\n                foreach (var holding in holdings.OrderByDescending(x => x.Type))\n                {\n                    Log.Trace(\"BrokerageSetupHandler.Setup(): Has existing holding: \" + holding);\n\n                    // verify existing holding security type\n                    Security security;\n                    if (!GetOrAddUnrequestedSecurity(algorithm, holding.Symbol, holding.Type, out security))\n                    {\n                        continue;\n                    }\n\n                    var exchangeTime = utcNow.ConvertFromUtc(security.Exchange.TimeZone);\n\n                    security.Holdings.SetHoldings(holding.AveragePrice, holding.Quantity);\n\n                    if (holding.MarketPrice == 0)\n                    {\n                        // try warming current market price\n                        holding.MarketPrice = algorithm.GetLastKnownPrice(security)?.Price ?? 0;\n                    }\n\n                    if (holding.MarketPrice != 0)\n                    {\n                        security.SetMarketPrice(new TradeBar\n                        {\n                            Time = exchangeTime,\n                            Open = holding.MarketPrice,\n                            High = holding.MarketPrice,\n                            Low = holding.MarketPrice,\n                            Close = holding.MarketPrice,\n                            Volume = 0,\n                            Symbol = holding.Symbol,\n                            DataType = MarketDataType.TradeBar\n                        });\n                    }\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                AddInitializationError(\"Error getting account holdings from brokerage: \" + err.Message, err);\n                return false;\n            }\n\n            return true;\n        }\n\n        private bool GetOrAddUnrequestedSecurity(IAlgorithm algorithm, Symbol symbol, SecurityType securityType, out Security security)\n        {\n            return algorithm.GetOrAddUnrequestedSecurity(symbol, out security,\n                onError: (supportedSecurityTypes) => AddInitializationError(\n                    \"Found unsupported security type in existing brokerage holdings: \" + securityType + \". \" +\n                    \"QuantConnect currently supports the following security types: \" + string.Join(\",\", supportedSecurityTypes)));\n        }\n\n        /// <summary>\n        /// Get the open orders from a brokerage. Adds <see cref=\"Orders.Order\"/> and <see cref=\"Orders.OrderTicket\"/> to the transaction handler\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm instance</param>\n        /// <param name=\"resultHandler\">The configured result handler</param>\n        /// <param name=\"transactionHandler\">The configurated transaction handler</param>\n        /// <param name=\"brokerage\">Brokerage output instance</param>\n        protected void GetOpenOrders(IAlgorithm algorithm, IResultHandler resultHandler, ITransactionHandler transactionHandler, IBrokerage brokerage)\n        {\n            // populate the algorithm with the account's outstanding orders\n            var openOrders = brokerage.GetOpenOrders();\n\n            // add options first to ensure raw data normalization mode is set on the equity underlyings\n            foreach (var order in openOrders.OrderByDescending(x => x.SecurityType))\n            {\n                // verify existing holding security type\n                Security security;\n                if (!GetOrAddUnrequestedSecurity(algorithm, order.Symbol, order.SecurityType, out security))\n                {\n                    continue;\n                }\n\n                transactionHandler.AddOpenOrder(order, algorithm);\n                order.PriceCurrency = security?.SymbolProperties.QuoteCurrency;\n\n                Log.Trace($\"BrokerageSetupHandler.Setup(): Has open order: {order}\");\n                resultHandler.DebugMessage($\"BrokerageSetupHandler.Setup(): Open order detected.  Creating order tickets for open order {order.Symbol.Value} with quantity {order.Quantity}. Beware that this order ticket may not accurately reflect the quantity of the order if the open order is partially filled.\");\n            }\n        }\n\n        /// <summary>\n        /// Adds initialization error to the Errors list\n        /// </summary>\n        /// <param name=\"message\">The error message to be added</param>\n        /// <param name=\"inner\">The inner exception being wrapped</param>\n        private void AddInitializationError(string message, Exception inner = null)\n        {\n            Errors.Add(new AlgorithmSetupException(\"During the algorithm initialization, the following exception has occurred: \" + message, inner));\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            if (_disposed)\n            {\n                return;\n            }\n            _disposed = true;\n            _factory?.DisposeSafely();\n\n            if (_dataQueueHandlerBrokerage != null)\n            {\n                if (_dataQueueHandlerBrokerage.IsConnected)\n                {\n                    _dataQueueHandlerBrokerage.Disconnect();\n                }\n                _dataQueueHandlerBrokerage.DisposeSafely();\n            }\n            else\n            {\n                var dataQueueHandler = Composer.Instance.GetPart<IDataQueueHandler>();\n                if (dataQueueHandler != null)\n                {\n                    Log.Trace($\"BrokerageSetupHandler.Setup(): Found data queue handler to dispose: {dataQueueHandler.GetType()}\");\n                    dataQueueHandler.DisposeSafely();\n                }\n                else\n                {\n                    Log.Trace(\"BrokerageSetupHandler.Setup(): did not find any data queue handler to dispose\");\n                }\n            }\n        }\n\n        private void PreloadDataQueueHandler(LiveNodePacket liveJob, IAlgorithm algorithm, IBrokerageFactory factory)\n        {\n            // preload the data queue handler using custom BrokerageFactory attribute\n            var dataQueueHandlerType = Assembly.GetAssembly(typeof(Brokerage))\n                .GetTypes()\n                .FirstOrDefault(x =>\n                    x.FullName != null &&\n                    x.FullName.EndsWith(liveJob.DataQueueHandler) &&\n                    x.HasAttribute(typeof(BrokerageFactoryAttribute)));\n\n            if (dataQueueHandlerType != null)\n            {\n                var attribute = dataQueueHandlerType.GetCustomAttribute<BrokerageFactoryAttribute>();\n\n                // only load the data queue handler if the factory is different from our brokerage factory\n                if (attribute.Type != factory.GetType())\n                {\n                    var brokerageFactory = (BrokerageFactory)Activator.CreateInstance(attribute.Type);\n\n                    // copy the brokerage data (usually credentials)\n                    foreach (var kvp in brokerageFactory.BrokerageData)\n                    {\n                        if (!liveJob.BrokerageData.ContainsKey(kvp.Key))\n                        {\n                            liveJob.BrokerageData.Add(kvp.Key, kvp.Value);\n                        }\n                    }\n\n                    // create the data queue handler and add it to composer\n                    _dataQueueHandlerBrokerage = brokerageFactory.CreateBrokerage(liveJob, algorithm);\n\n                    // open connection for subscriptions\n                    _dataQueueHandlerBrokerage.Connect();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/ConsoleSetupHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Kept for backwards compatibility-\n    /// </summary>\n    [Obsolete(\"Should use BacktestingSetupHandler instead\")]\n    public class ConsoleSetupHandler : BacktestingSetupHandler\n    {\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/ISetupHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Interface to setup the algorithm. Pass in a raw algorithm, return one with portfolio, cash, etc already preset.\n    /// </summary>\n    [InheritedExport(typeof(ISetupHandler))]\n    public interface ISetupHandler : IDisposable\n    {\n        /// <summary>\n        /// The worker thread instance the setup handler should use\n        /// </summary>\n        WorkerThread WorkerThread\n        {\n            set;\n        }\n\n        /// <summary>\n        /// Any errors from the initialization stored here:\n        /// </summary>\n        List<Exception> Errors\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Get the maximum runtime for this algorithm job.\n        /// </summary>\n        TimeSpan MaximumRuntime\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Algorithm starting capital for statistics calculations\n        /// </summary>\n        decimal StartingPortfolioValue\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Start date for analysis loops to search for data.\n        /// </summary>\n        DateTime StartingDate\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Maximum number of orders for the algorithm run -- applicable for backtests only.\n        /// </summary>\n        int MaxOrders\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Create a new instance of an algorithm from a physical dll path.\n        /// </summary>\n        /// <param name=\"assemblyPath\">The path to the assembly's location</param>\n        /// <param name=\"algorithmNodePacket\">Details of the task required</param>\n        /// <returns>A new instance of IAlgorithm, or throws an exception if there was an error</returns>\n        IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath);\n\n        /// <summary>\n        /// Creates the brokerage as specified by the job packet\n        /// </summary>\n        /// <param name=\"algorithmNodePacket\">Job packet</param>\n        /// <param name=\"uninitializedAlgorithm\">The algorithm instance before Initialize has been called</param>\n        /// <param name=\"factory\">The brokerage factory</param>\n        /// <returns>The brokerage instance, or throws if error creating instance</returns>\n        IBrokerage CreateBrokerage(AlgorithmNodePacket algorithmNodePacket, IAlgorithm uninitializedAlgorithm, out IBrokerageFactory factory);\n\n        /// <summary>\n        /// Primary entry point to setup a new algorithm\n        /// </summary>\n        /// <param name=\"parameters\">The parameters object to use</param>\n        /// <returns>True on successfully setting up the algorithm state, or false on error.</returns>\n        bool Setup(SetupHandlerParameters parameters);\n    }\n}\n"
  },
  {
    "path": "Engine/Setup/SetupHandlerParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Lean.Engine.Setup\n{\n    /// <summary>\n    /// Defines the parameters for <see cref=\"ISetupHandler\"/>\n    /// </summary>\n    public class SetupHandlerParameters\n    {\n        /// <summary>\n        /// Gets the universe selection\n        /// </summary>\n        public UniverseSelection UniverseSelection { get; }\n\n        /// <summary>\n        /// Gets the algorithm\n        /// </summary>\n        public IAlgorithm Algorithm { get; }\n\n        /// <summary>\n        /// Gets the Brokerage\n        /// </summary>\n        public IBrokerage Brokerage { get; }\n\n        /// <summary>\n        /// Gets the algorithm node packet\n        /// </summary>\n        public AlgorithmNodePacket AlgorithmNodePacket { get; }\n\n        /// <summary>\n        /// Gets the algorithm node packet\n        /// </summary>\n        public IResultHandler ResultHandler { get; }\n\n        /// <summary>\n        /// Gets the TransactionHandler\n        /// </summary>\n        public ITransactionHandler TransactionHandler { get; }\n\n        /// <summary>\n        /// Gets the RealTimeHandler\n        /// </summary>\n        public IRealTimeHandler RealTimeHandler { get; }\n\n        /// <summary>\n        /// Gets the DataCacheProvider\n        /// </summary>\n        public IDataCacheProvider DataCacheProvider { get; }\n\n        /// <summary>\n        /// The map file provider instance of the algorithm\n        /// </summary>\n        public IMapFileProvider MapFileProvider { get; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"universeSelection\">The universe selection instance</param>\n        /// <param name=\"algorithm\">Algorithm instance</param>\n        /// <param name=\"brokerage\">New brokerage output instance</param>\n        /// <param name=\"algorithmNodePacket\">Algorithm job task</param>\n        /// <param name=\"resultHandler\">The configured result handler</param>\n        /// <param name=\"transactionHandler\">The configured transaction handler</param>\n        /// <param name=\"realTimeHandler\">The configured real time handler</param>\n        /// <param name=\"dataCacheProvider\">The configured data cache provider</param>\n        /// <param name=\"mapFileProvider\">The map file provider</param>\n        public SetupHandlerParameters(UniverseSelection universeSelection,\n            IAlgorithm algorithm,\n            IBrokerage brokerage,\n            AlgorithmNodePacket algorithmNodePacket,\n            IResultHandler resultHandler,\n            ITransactionHandler transactionHandler,\n            IRealTimeHandler realTimeHandler,\n            IDataCacheProvider dataCacheProvider,\n            IMapFileProvider mapFileProvider\n            )\n        {\n            UniverseSelection = universeSelection;\n            Algorithm = algorithm;\n            Brokerage = brokerage;\n            AlgorithmNodePacket = algorithmNodePacket;\n            ResultHandler = resultHandler;\n            TransactionHandler = transactionHandler;\n            RealTimeHandler = realTimeHandler;\n            DataCacheProvider = dataCacheProvider;\n            MapFileProvider = mapFileProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Storage/FileHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Lean.Engine.Storage\n{\n    /// <summary>\n    /// Raw file handler\n    /// </summary>\n    /// <remarks>Useful to abstract file operations for <see cref=\"LocalObjectStore\"/></remarks>\n    public class FileHandler\n    {\n        /// <summary>\n        /// True if the given file path exists\n        /// </summary>\n        public virtual bool Exists(string path)\n        {\n            return File.Exists(path);\n        }\n\n        /// <summary>\n        /// Will delete the given file path\n        /// </summary>\n        public virtual void Delete(string path)\n        {\n            File.Delete(path);\n        }\n\n        /// <summary>\n        /// Will write the given byte array at the target file path\n        /// </summary>\n        public virtual void WriteAllBytes(string path, byte[] data)\n        {\n            File.WriteAllBytes(path, data);\n        }\n\n        /// <summary>\n        /// Read all bytes in the given file path\n        /// </summary>\n        public virtual byte[] ReadAllBytes(string path)\n        {\n            return File.ReadAllBytes(path);\n        }\n\n        /// <summary>\n        /// Will try to fetch the given file length, will return 0 if it doesn't exist\n        /// </summary>\n        public virtual long TryGetFileLength(string path)\n        {\n            var fileInfo = new FileInfo(path);\n            if (fileInfo.Exists)\n            {\n                return fileInfo.Length;\n            }\n            return 0;\n        }\n\n        /// <summary>\n        /// True if the given directory exists\n        /// </summary>\n        public virtual bool DirectoryExists(string path)\n        {\n            return Directory.Exists(path);\n        }\n\n        /// <summary>\n        /// Create the requested directory path\n        /// </summary>\n        public virtual DirectoryInfo CreateDirectory(string path)\n        {\n            return Directory.CreateDirectory(path);\n        }\n\n        /// <summary>\n        /// Enumerate the files in the target path\n        /// </summary>\n        public virtual IEnumerable<FileInfo> EnumerateFiles(string path, string pattern, SearchOption searchOption, out string rootfolder)\n        {\n            var directoryInfo = new DirectoryInfo(path);\n            rootfolder = directoryInfo.FullName;\n            return directoryInfo.EnumerateFiles(pattern, searchOption);\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Storage/LocalObjectStore.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Storage;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.Storage\n{\n    /// <summary>\n    /// A local disk implementation of <see cref=\"IObjectStore\"/>.\n    /// </summary>\n    public class LocalObjectStore : IObjectStore\n    {\n        private AlgorithmMode _algorithmMode;\n\n        /// <summary>\n        /// Gets the maximum storage limit in bytes\n        /// </summary>\n        public long MaxSize => Controls?.StorageLimit ?? 0;\n\n        /// <summary>\n        /// Gets the maximum number of files allowed\n        /// </summary>\n        public int MaxFiles => Controls?.StorageFileCount ?? 0;\n\n        /// <summary>\n        /// No read permissions error message\n        /// </summary>\n        protected const string NoReadPermissionsError = \"The current user does not have permission to read from the organization Object Store.\" +\n                                                        \" Please contact your organization administrator to request permission.\";\n\n        /// <summary>\n        /// No write permissions error message\n        /// </summary>\n        protected const string NoWritePermissionsError = \"The current user does not have permission to write to the organization Object Store.\" +\n                                                         \" Please contact your organization administrator to request permission.\";\n\n        /// <summary>\n        /// No delete permissions error message\n        /// </summary>\n        protected const string NoDeletePermissionsError = \"The current user does not have permission to delete objects from the organization Object Store.\" +\n                                                         \" Please contact your organization administrator to request permission.\";\n\n        /// <summary>\n        /// Event raised each time there's an error\n        /// </summary>\n        public event EventHandler<ObjectStoreErrorRaisedEventArgs> ErrorRaised;\n\n        /// <summary>\n        /// Gets the default object store location\n        /// </summary>\n        public static string DefaultObjectStore { get; set; } = Path.GetFullPath(Config.Get(\"object-store-root\", \"./storage\"));\n\n        /// <summary>\n        /// Flag indicating the state of this object storage has changed since the last <seealso cref=\"Persist\"/> invocation\n        /// </summary>\n        private bool _isDirty;\n        private readonly Lock _dirtyLock = new();\n\n        private bool IsDirty\n        {\n            get\n            {\n                lock (_dirtyLock)\n                {\n                    return _isDirty;\n                }\n            }\n            set\n            {\n                lock (_dirtyLock)\n                {\n                    if (value && !_isDirty && _persistenceTimer != null)\n                    {\n                        // schedule if not scheduled and we should\n                        try\n                        {\n                            _persistenceTimer.Change(Time.GetSecondUnevenWait(Controls.PersistenceIntervalSeconds * 1000), Timeout.Infinite);\n                        }\n                        catch (ObjectDisposedException)\n                        {\n                            // ignored disposed\n                        }\n                    }\n                    _isDirty = value;\n                }\n            }\n        }\n\n        private Timer _persistenceTimer;\n        private Regex _pathRegex = new(@\"^\\.?[a-zA-Z0-9\\\\/_#\\-\\$= ]+\\.?[a-zA-Z0-9]*$\", RegexOptions.Compiled);\n        private readonly ConcurrentDictionary<string, ObjectStoreEntry> _storage = new();\n        private readonly object _persistLock = new object();\n\n        /// <summary>\n        /// Provides access to the controls governing behavior of this instance, such as the persistence interval\n        /// </summary>\n        protected Controls Controls { get; private set; }\n\n        /// <summary>\n        /// The root storage folder for the algorithm\n        /// </summary>\n        protected string AlgorithmStorageRoot { get; private set; }\n\n        /// <summary>\n        /// The file handler instance to use\n        /// </summary>\n        protected FileHandler FileHandler { get; set; } = new();\n\n        /// <summary>\n        /// Initializes the object store\n        /// </summary>\n        /// <param name=\"userId\">The user id</param>\n        /// <param name=\"projectId\">The project id</param>\n        /// <param name=\"userToken\">The user token</param>\n        /// <param name=\"controls\">The job controls instance</param>\n        /// <param name=\"algorithmMode\">The algorithm mode</param>\n        public virtual void Initialize(int userId, int projectId, string userToken, Controls controls, AlgorithmMode algorithmMode)\n        {\n            AlgorithmStorageRoot = StorageRoot();\n\n            // create the root path if it does not exist\n            var directoryInfo = FileHandler.CreateDirectory(AlgorithmStorageRoot);\n            // full name will return a normalized path which is later easier to compare\n            AlgorithmStorageRoot = directoryInfo.FullName;\n\n            Controls = controls;\n            _algorithmMode = algorithmMode;\n\n            // if <= 0 we disable periodic persistence and make it synchronous\n            if (Controls.PersistenceIntervalSeconds > 0)\n            {\n                _persistenceTimer = new Timer(_ => Persist(), null, Controls.PersistenceIntervalSeconds * 1000, Timeout.Infinite);\n            }\n\n            Log.Trace($\"LocalObjectStore.Initialize(): Storage Root: {directoryInfo.FullName}. StorageFileCount {controls.StorageFileCount}. StorageLimit {BytesToMb(controls.StorageLimit)}MB. StoragePermissions {Controls.StorageAccess}\");\n        }\n\n        /// <summary>\n        /// Storage root path\n        /// </summary>\n        protected virtual string StorageRoot()\n        {\n            return DefaultObjectStore;\n        }\n\n        /// <summary>\n        /// Loads objects from the AlgorithmStorageRoot into the ObjectStore\n        /// </summary>\n        private IEnumerable<ObjectStoreEntry> GetObjectStoreEntries(bool loadContent)\n        {\n            HashSet<string> _yielded = [];\n            if (Controls.StorageAccess.Read)\n            {\n                foreach (var kvp in _storage)\n                {\n                    if (!loadContent || kvp.Value.Data != null)\n                    {\n                        // let's first serve what we already have in memory because it might include files which are not on disk yet\n                        _yielded.Add(kvp.Key);\n                        yield return kvp.Value;\n                    }\n                }\n\n                foreach (var file in FileHandler.EnumerateFiles(AlgorithmStorageRoot, \"*\", SearchOption.AllDirectories, out var rootFolder))\n                {\n                    var path = NormalizePath(file.FullName.RemoveFromStart(rootFolder));\n                    if (!_yielded.Add(path))\n                    {\n                        continue;\n                    }\n\n                    ObjectStoreEntry objectStoreEntry;\n                    if (loadContent)\n                    {\n                        if (!_storage.TryGetValue(path, out objectStoreEntry) || objectStoreEntry.Data == null)\n                        {\n                            if (TryCreateObjectStoreEntry(file.FullName, path, out objectStoreEntry))\n                            {\n                                // load file if content is null or not present, we prioritize the version we have in memory\n                                yield return _storage[path] = objectStoreEntry;\n                            }\n                        }\n                    }\n                    else\n                    {\n                        if (!_storage.ContainsKey(path))\n                        {\n                            // we do not read the file contents yet, just the name. We read the contents on demand\n                            yield return _storage[path] = new ObjectStoreEntry(path, null);\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns the file paths present in the object store. This is specially useful not to load the object store into memory\n        /// </summary>\n        public ICollection<string> Keys\n        {\n            get\n            {\n                return GetObjectStoreEntries(loadContent: false).Select(objectStoreEntry => objectStoreEntry.Path).ToList();\n            }\n        }\n\n        /// <summary>\n        /// Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information\n        /// </summary>\n        public void Clear()\n        {\n            // write to disk anything pending first\n            Persist();\n\n            _storage.Clear();\n        }\n\n        /// <summary>\n        /// Determines whether the store contains data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the key was found</returns>\n        public bool ContainsKey(string path)\n        {\n            if (path == null)\n            {\n                throw new ArgumentNullException(nameof(path));\n            }\n            if (!Controls.StorageAccess.Read)\n            {\n                throw new InvalidOperationException($\"LocalObjectStore.ContainsKey(): {NoReadPermissionsError}\");\n            }\n\n            path = NormalizePath(path);\n            if (_storage.ContainsKey(path))\n            {\n                return true;\n            }\n\n            // if we don't have the file but it exists, be friendly and register it\n            var filePath = PathForKey(path);\n            if (FileHandler.Exists(filePath))\n            {\n                _storage[path] = new ObjectStoreEntry(path, null);\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Returns the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>A byte array containing the data</returns>\n        public byte[] ReadBytes(string path)\n        {\n            // Ensure we have the key, also takes care of null or improper access\n            if (!ContainsKey(path))\n            {\n                throw new KeyNotFoundException($\"Object with path '{path}' was not found in the current project. \" +\n                    \"Please use ObjectStore.ContainsKey(key) to check if an object exists before attempting to read.\"\n                );\n            }\n            path = NormalizePath(path);\n\n            if (!_storage.TryGetValue(path, out var objectStoreEntry) || objectStoreEntry.Data == null)\n            {\n                var filePath = PathForKey(path);\n                if (TryCreateObjectStoreEntry(filePath, path, out objectStoreEntry))\n                {\n                    // if there is no data in the cache and the file exists on disk let's load it\n                    _storage[path] = objectStoreEntry;\n                }\n            }\n            return objectStoreEntry?.Data;\n        }\n\n        /// <summary>\n        /// Saves the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <param name=\"contents\">The object data</param>\n        /// <returns>True if the save operation was successful</returns>\n        public bool SaveBytes(string path, byte[] contents)\n        {\n            if (path == null)\n            {\n                throw new ArgumentNullException(nameof(path));\n            }\n            else if (!Controls.StorageAccess.Write)\n            {\n                throw new InvalidOperationException($\"LocalObjectStore.SaveBytes(): {NoWritePermissionsError}\");\n            }\n            else if (!_pathRegex.IsMatch(path))\n            {\n                throw new ArgumentException($\"LocalObjectStore: path is not supported: '{path}'\");\n            }\n            else if (path.Count(c => c == '/') > 100 || path.Count(c => c == '\\\\') > 100)\n            {\n                // just in case\n                throw new ArgumentException($\"LocalObjectStore: path is not supported: '{path}'\");\n            }\n\n            // after we check the regex\n            path = NormalizePath(path);\n\n            if (InternalSaveBytes(path, contents)\n                // only persist if we actually stored some new data, else can skip\n                && contents != null)\n            {\n                IsDirty = true;\n                // if <= 0 we disable periodic persistence and make it synchronous\n                if (Controls.PersistenceIntervalSeconds <= 0)\n                {\n                    Persist();\n                }\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Won't trigger persist nor will check storage write permissions, useful on initialization since it allows read only permissions to load the object store\n        /// </summary>\n        protected bool InternalSaveBytes(string path, byte[] contents)\n        {\n            if (!IsWithinStorageLimit(path, contents))\n            {\n                return false;\n            }\n\n            // Add the dirty entry\n            var entry = _storage[path] = new ObjectStoreEntry(path, contents);\n            entry.SetDirty();\n            return true;\n        }\n\n        /// <summary>\n        /// Validates storage limits are respected on a new save operation\n        /// </summary>\n        protected virtual bool IsWithinStorageLimit(string path, byte[] contents)\n        {\n            // Before saving confirm we are abiding by the control rules\n            // Start by counting our file and its length\n            var fileCount = 1;\n            var expectedStorageSizeBytes = contents?.Length ?? 0L;\n            foreach (var kvp in GetObjectStoreEntries(loadContent: false))\n            {\n                if (path.Equals(kvp.Path))\n                {\n                    // Skip we have already counted this above\n                    // If this key was already in storage it will be replaced.\n                }\n                else\n                {\n                    fileCount++;\n                    if (kvp.Data != null)\n                    {\n                        // if the data is in memory use it\n                        expectedStorageSizeBytes += kvp.Data.Length;\n                    }\n                    else\n                    {\n                        expectedStorageSizeBytes += FileHandler.TryGetFileLength(PathForKey(kvp.Path));\n                    }\n                }\n            }\n\n            if (fileCount > MaxFiles)\n            {\n                var message = $\"You have reached the ObjectStore limit for files it can save: {fileCount}/{MaxFiles}. \" +\n                $\"Unable to save the new file. You can find the limit with the ObjectStore.{nameof(ObjectStore.MaxFiles)} property.\";\n                Log.Error($\"LocalObjectStore.InternalSaveBytes(): {message} File: '{path}'\");\n\n                return HandleStorageLimitExceeded(message);\n            }\n\n            // Verify we are within Storage limit\n            if (expectedStorageSizeBytes > MaxSize)\n            {\n                var message = $\"You have reached the ObjectStore storage capacity limit: {BytesToMb(expectedStorageSizeBytes)}MB/{BytesToMb(MaxSize)}MB. \" +\n                $\"Unable to save the new file. You can find the limit with the ObjectStore.{nameof(ObjectStore.MaxSize)} property.\";\n                Log.Error($\"LocalObjectStore.InternalSaveBytes(): {message} File: '{path}'\");\n\n                return HandleStorageLimitExceeded(message);\n            }\n\n            return true;\n        }\n\n        private bool HandleStorageLimitExceeded(string message)\n        {\n            if (_algorithmMode == AlgorithmMode.Research)\n            {\n                throw new StorageLimitExceededException(message);\n            }\n            else\n            {\n                OnErrorRaised(new StorageLimitExceededException(message));\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Deletes the object data for the specified path\n        /// </summary>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>True if the delete operation was successful</returns>\n        public bool Delete(string path)\n        {\n            if (path == null)\n            {\n                throw new ArgumentNullException(nameof(path));\n            }\n            if (!Controls.StorageAccess.Delete)\n            {\n                throw new InvalidOperationException($\"LocalObjectStore.Delete(): {NoDeletePermissionsError}\");\n            }\n\n            path = NormalizePath(path);\n\n            var wasInCache = _storage.TryRemove(path, out var _);\n\n            var filePath = PathForKey(path);\n            if (FileHandler.Exists(filePath))\n            {\n                try\n                {\n                    FileHandler.Delete(filePath);\n                    return true;\n                }\n                catch\n                {\n                    // This try sentence is to prevent a race condition with the Delete within the PersisData() method\n                }\n            }\n\n            return wasInCache;\n        }\n\n        /// <summary>\n        /// Returns the file path for the specified path\n        /// </summary>\n        /// <remarks>If the key is not already inserted it will just return a path associated with it\n        /// and add the key with null value</remarks>\n        /// <param name=\"path\">The object path</param>\n        /// <returns>The path for the file</returns>\n        public virtual string GetFilePath(string path)\n        {\n            // Ensure we have an object for that key\n            if (!ContainsKey(path))\n            {\n                // Add a key with null value to tell Persist() not to delete the file created in the path associated\n                // with this key and not update it with the value associated with the key(null)\n                SaveBytes(path, null);\n            }\n            else\n            {\n                // Persist to ensure pur files are up to date\n                Persist();\n            }\n\n            // Fetch the path to file and return it\n            var normalizedPathKey = PathForKey(path);\n\n            var parent = Directory.GetParent(normalizedPathKey);\n            if (parent != null && parent.FullName != AlgorithmStorageRoot)\n            {\n                // let's create the parent folder if it's not the root storage and it does not exist\n                if (!FileHandler.DirectoryExists(parent.FullName))\n                {\n                    FileHandler.CreateDirectory(parent.FullName);\n                }\n            }\n            return normalizedPathKey;\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public virtual void Dispose()\n        {\n            Log.Trace(\"LocalObjectStore.Dispose(): start...\");\n            try\n            {\n                if (_persistenceTimer != null)\n                {\n                    _persistenceTimer.Change(Timeout.Infinite, Timeout.Infinite);\n                    var tmp = _persistenceTimer;\n                    // stop persist from rescheduling timer\n                    _persistenceTimer = null;\n\n                    Persist();\n\n                    tmp.DisposeSafely();\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, \"Error deleting storage directory.\");\n            }\n            Log.Trace(\"LocalObjectStore.Dispose(): end\");\n        }\n\n        /// <summary>Returns an enumerator that iterates through the collection.</summary>\n        /// <returns>A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.</returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<KeyValuePair<string, byte[]>> GetEnumerator()\n        {\n            return GetObjectStoreEntries(loadContent: true).Select(objectStore => new KeyValuePair<string, byte[]>(objectStore.Path, objectStore.Data)).GetEnumerator();\n        }\n\n        /// <summary>Returns an enumerator that iterates through a collection.</summary>\n        /// <returns>An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.</returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Get's a file path for a given path.\n        /// Internal use only because it does not guarantee the existence of the file.\n        /// </summary>\n        protected string PathForKey(string path)\n        {\n            return Path.Combine(AlgorithmStorageRoot, NormalizePath(path));\n        }\n\n        /// <summary>\n        /// Invoked periodically to persist the object store's contents\n        /// </summary>\n        private void Persist()\n        {\n            // Acquire the persist lock\n            lock (_persistLock)\n            {\n                try\n                {\n                    // If there are no changes we are fine\n                    if (!IsDirty)\n                    {\n                        return;\n                    }\n                    IsDirty = false;\n\n                    if (!PersistData())\n                    {\n                        IsDirty = true;\n                    }\n                }\n                catch (Exception err)\n                {\n                    Log.Error(\"LocalObjectStore.Persist()\", err);\n                    OnErrorRaised(err);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Overridable persistence function\n        /// </summary>\n        /// <returns>True if persistence was successful, otherwise false</returns>\n        protected virtual bool PersistData()\n        {\n            try\n            {\n                // Write our store data to disk\n                // Skip the key associated with null values. They are not linked to a file yet or not loaded\n                // Also skip fails which are not flagged as dirty\n                foreach (var kvp in _storage)\n                {\n                    if (kvp.Value.Data != null && kvp.Value.IsDirty)\n                    {\n                        var filePath = PathForKey(kvp.Key);\n                        // directory might not exist for custom prefix\n                        var parentDirectory = Path.GetDirectoryName(filePath);\n                        if (!FileHandler.DirectoryExists(parentDirectory))\n                        {\n                            FileHandler.CreateDirectory(parentDirectory);\n                        }\n                        FileHandler.WriteAllBytes(filePath, kvp.Value.Data);\n\n                        // clear the dirty flag\n                        kvp.Value.SetClean();\n\n                        // This kvp could have been deleted by the Delete() method\n                        if (!_storage.Contains(kvp))\n                        {\n                            try\n                            {\n                                FileHandler.Delete(filePath);\n                            }\n                            catch\n                            {\n                                // This try sentence is to prevent a race condition with the Delete() method\n                            }\n                        }\n                    }\n                }\n\n                return true;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err, \"LocalObjectStore.PersistData()\");\n                OnErrorRaised(err);\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Event invocator for the <see cref=\"ErrorRaised\"/> event\n        /// </summary>\n        protected virtual void OnErrorRaised(Exception error)\n        {\n            ErrorRaised?.Invoke(this, new ObjectStoreErrorRaisedEventArgs(error));\n        }\n\n        /// <summary>\n        /// Converts a number of bytes to megabytes as it's more human legible\n        /// </summary>\n        private static double BytesToMb(long bytes)\n        {\n            return bytes / 1024.0 / 1024.0;\n        }\n\n        private static string NormalizePath(string path)\n        {\n            if (string.IsNullOrEmpty(path))\n            {\n                return path;\n            }\n            return path.TrimStart('.').TrimStart('/', '\\\\').Replace('\\\\', '/');\n        }\n\n        private bool TryCreateObjectStoreEntry(string filePath, string path, out ObjectStoreEntry objectStoreEntry)\n        {\n            var count = 0;\n            do\n            {\n                count++;\n                try\n                {\n                    if (FileHandler.Exists(filePath))\n                    {\n                        objectStoreEntry = new ObjectStoreEntry(path, FileHandler.ReadAllBytes(filePath));\n                        return true;\n                    }\n                    objectStoreEntry = null;\n                    return false;\n                }\n                catch (Exception)\n                {\n                    if (count > 3)\n                    {\n                        throw;\n                    }\n                    else\n                    {\n                        // let's be resilient and retry, avoid race conditions, someone updating it or just random io failure\n                        Thread.Sleep(250);\n                    }\n                }\n            } while (true);\n        }\n\n        /// <summary>\n        /// Helper class to hold the state of an object store file\n        /// </summary>\n        private class ObjectStoreEntry\n        {\n            private long _isDirty;\n            public byte[] Data { get; }\n            public string Path { get; }\n            public bool IsDirty => Interlocked.Read(ref _isDirty) != 0;\n            public ObjectStoreEntry(string path, byte[] data)\n            {\n                Path = path;\n                Data = data;\n            }\n            public void SetDirty()\n            {\n                // flag as dirty\n                Interlocked.CompareExchange(ref _isDirty, 1, 0);\n            }\n            public void SetClean()\n            {\n                Interlocked.CompareExchange(ref _isDirty, 0, 1);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/Storage/StorageLimitExceededException.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Lean.Engine.Storage\n{\n    /// <summary>\n    /// Exception thrown when the object store storage limit has been exceeded\n    /// </summary>\n    public class StorageLimitExceededException : Exception\n    {\n        /// <summary>\n        /// Creates a new instance of the storage limit exceeded exception\n        /// </summary>\n        /// <param name=\"message\">The associated message</param>\n        public StorageLimitExceededException(string message)\n            : base(message)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/TransactionHandlers/BacktestingTransactionHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.TransactionHandlers\n{\n    /// <summary>\n    /// This transaction handler is used for processing transactions during backtests\n    /// </summary>\n    public class BacktestingTransactionHandler : BrokerageTransactionHandler\n    {\n        // save off a strongly typed version of the brokerage\n        private BacktestingBrokerage _brokerage;\n        private IAlgorithm _algorithm;\n        private Delistings _lastestDelistings;\n        private bool _enableConcurrency;\n\n        /// <summary>\n        /// Gets current time UTC. This is here to facilitate testing\n        /// </summary>\n        protected override DateTime CurrentTimeUtc => _algorithm.UtcTime;\n\n        /// <summary>\n        /// Creates a new BacktestingTransactionHandler using the BacktestingBrokerage\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"brokerage\">The BacktestingBrokerage</param>\n        /// <param name=\"resultHandler\"></param>\n        public override void Initialize(IAlgorithm algorithm, IBrokerage brokerage, IResultHandler resultHandler)\n        {\n            if (!(brokerage is BacktestingBrokerage))\n            {\n                throw new ArgumentException(\"Brokerage must be of type BacktestingBrokerage for use wth the BacktestingTransactionHandler\");\n            }\n\n            _brokerage = (BacktestingBrokerage)brokerage;\n            _algorithm = algorithm;\n            _enableConcurrency = _brokerage.ConcurrencyEnabled && _algorithm.LiveMode;\n\n            base.Initialize(algorithm, brokerage, resultHandler);\n\n            if (!_enableConcurrency)\n            {\n                // non blocking implementation\n                _orderRequestQueues = new() { new BusyCollection<OrderRequest>() };\n            }\n        }\n\n        /// <summary>\n        /// Processes all synchronous events that must take place before the next time loop for the algorithm\n        /// </summary>\n        public override void ProcessSynchronousEvents()\n        {\n            if (!_enableConcurrency)\n            {\n                // we process pending order requests our selves\n                Run(0);\n            }\n\n            base.ProcessSynchronousEvents();\n\n            _brokerage.Scan();\n\n            // Run our delistings processing, only do this once a slice\n            if (_algorithm.CurrentSlice != null && _algorithm.CurrentSlice.Delistings != _lastestDelistings)\n            {\n                _lastestDelistings = _algorithm.CurrentSlice.Delistings;\n                _brokerage.ProcessDelistings(_algorithm.CurrentSlice.Delistings);\n            }\n        }\n\n        /// <summary>\n        /// Processes asynchronous events on the transaction handler's thread\n        /// </summary>\n        public override void ProcessAsynchronousEvents()\n        {\n            base.ProcessAsynchronousEvents();\n\n            _brokerage.Scan();\n        }\n\n        /// <summary>\n        /// For backtesting we will submit the order ourselves\n        /// </summary>\n        /// <param name=\"ticket\">The <see cref=\"OrderTicket\"/> expecting to be submitted</param>\n        protected override void WaitForOrderSubmission(OrderTicket ticket)\n        {\n            if (_enableConcurrency)\n            {\n                // let the base class handle this\n                base.WaitForOrderSubmission(ticket);\n                return;\n            }\n\n            // we submit the order request our selves\n            Run(0);\n\n            if (!ticket.OrderSet.WaitOne(0))\n            {\n                // this could happen if there was some error handling the order\n                // and it was not set\n                Log.Error(\"BacktestingTransactionHandler.WaitForOrderSubmission(): \" +\n                    $\"The order request (Id={ticket.OrderId}) was not submitted. \" +\n                    \"See the OrderRequest.Response for more information\");\n            }\n        }\n\n        /// <summary>\n        /// For backtesting order requests will be processed by the algorithm thread\n        /// sequentially at <see cref=\"WaitForOrderSubmission\"/> and <see cref=\"ProcessSynchronousEvents\"/>\n        /// </summary>\n        protected override void InitializeTransactionThread()\n        {\n            if (_enableConcurrency)\n            {\n                // let the base class handle this\n                base.InitializeTransactionThread();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/TransactionHandlers/BrokerageTransactionHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Engine.TransactionHandlers\n{\n    /// <summary>\n    /// Transaction handler for all brokerages\n    /// </summary>\n    public class BrokerageTransactionHandler : ITransactionHandler\n    {\n        private IAlgorithm _algorithm;\n        private QCAlgorithm _qcAlgorithmIntance;\n        private SignalExportManager _signalExport;\n        private IExecutionModel _executionModel;\n        private IBrokerage _brokerage;\n        private bool _brokerageIsBacktesting;\n        private bool _loggedFeeAdjustmentWarning;\n\n        // Counter to keep track of total amount of processed orders\n        private int _totalOrderCount;\n\n        // this bool is used to check if the warning message for the rounding of order quantity has been displayed for the first time\n        private bool _firstRoundOffMessage;\n        // this bool is used to check if the warning message for price rounding has been displayed for the first time\n        private bool _hasLoggedPriceRoundingWarning;\n\n        // this value is used for determining how confident we are in our cash balance update\n        private long _lastFillTimeTicks;\n\n        private const int MaxCashSyncAttempts = 5;\n        private int _failedCashSyncAttempts;\n\n        /// <summary>\n        /// OrderQueue holds the newly updated orders from the user algorithm waiting to be processed. Once\n        /// orders are processed they are moved into the Orders queue awaiting the brokerage response.\n        /// </summary>\n        protected List<IBusyCollection<OrderRequest>> _orderRequestQueues { get; set; }\n\n        private List<Thread> _processingThreads;\n        private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();\n\n        private readonly ConcurrentQueue<OrderEvent> _orderEvents = new ConcurrentQueue<OrderEvent>();\n\n        /// <summary>\n        /// The _completeOrders dictionary holds all orders.\n        /// Once the transaction thread has worked on them they get put here while witing for fill updates.\n        /// </summary>\n        private readonly ConcurrentDictionary<int, Order> _completeOrders = new ConcurrentDictionary<int, Order>();\n\n        /// <summary>\n        /// The orders dictionary holds orders which are open. Status: New, Submitted, PartiallyFilled, None, CancelPending\n        /// Once the transaction thread has worked on them they get put here while witing for fill updates.\n        /// </summary>\n        private readonly ConcurrentDictionary<int, OpenOrderState> _openOrders = new ConcurrentDictionary<int, OpenOrderState>();\n\n        /// <summary>\n        /// The _completeOrderTickets dictionary holds all order tickets that the algorithm can use to reference a specific order. This\n        /// includes invoking update and cancel commands. In the future, we can add more features to the ticket, such as events\n        /// and async events (such as run this code when this order fills)\n        /// </summary>\n        private readonly ConcurrentDictionary<int, OrderTicket> _completeOrderTickets = new ConcurrentDictionary<int, OrderTicket>();\n\n        /// <summary>\n        /// Cache collection of price adjustment modes for each symbol\n        /// </summary>\n        private readonly Dictionary<Symbol, DataNormalizationMode> _priceAdjustmentModes = new Dictionary<Symbol, DataNormalizationMode>();\n\n        /// <summary>\n        /// The _cancelPendingOrders instance will help to keep track of CancelPending orders and their Status\n        /// </summary>\n        protected CancelPendingOrders _cancelPendingOrders { get; init; } = new CancelPendingOrders();\n\n        private IResultHandler _resultHandler;\n\n        private readonly object _lockHandleOrderEvent = new object();\n\n        /// <summary>\n        /// Event fired when there is a new <see cref=\"OrderEvent\"/>\n        /// </summary>\n        public event EventHandler<OrderEvent> NewOrderEvent;\n\n        /// <summary>\n        /// Gets the permanent storage for all orders\n        /// </summary>\n        public ConcurrentDictionary<int, Order> Orders\n        {\n            get\n            {\n                return _completeOrders;\n            }\n        }\n\n        /// <summary>\n        /// Gets all order events\n        /// </summary>\n        public IEnumerable<OrderEvent> OrderEvents => _orderEvents;\n\n        /// <summary>\n        /// Gets the permanent storage for all order tickets\n        /// </summary>\n        public ConcurrentDictionary<int, OrderTicket> OrderTickets\n        {\n            get\n            {\n                return _completeOrderTickets;\n            }\n        }\n\n        /// <summary>\n        /// Gets the current number of orders that have been processed\n        /// </summary>\n        public int OrdersCount => _totalOrderCount;\n\n        /// <summary>\n        /// Creates a new BrokerageTransactionHandler to process orders using the specified brokerage implementation\n        /// </summary>\n        /// <param name=\"algorithm\">The algorithm instance</param>\n        /// <param name=\"brokerage\">The brokerage implementation to process orders and fire fill events</param>\n        /// <param name=\"resultHandler\"></param>\n        public virtual void Initialize(IAlgorithm algorithm, IBrokerage brokerage, IResultHandler resultHandler)\n        {\n            if (brokerage == null)\n            {\n                throw new ArgumentNullException(nameof(brokerage));\n            }\n\n            // we don't need to do this today because we just initialized/synced\n            _resultHandler = resultHandler;\n\n            _brokerage = brokerage;\n            _brokerageIsBacktesting = brokerage is BacktestingBrokerage;\n            _algorithm = algorithm;\n\n            _brokerage.OrdersStatusChanged += (sender, orderEvents) =>\n            {\n                HandleOrderEvents(orderEvents);\n            };\n\n            _brokerage.AccountChanged += (sender, account) =>\n            {\n                HandleAccountChanged(account);\n            };\n\n            _brokerage.OptionPositionAssigned += (sender, fill) =>\n            {\n                HandlePositionAssigned(fill);\n            };\n\n            _brokerage.OptionNotification += (sender, e) =>\n            {\n                HandleOptionNotification(e);\n            };\n\n            _brokerage.NewBrokerageOrderNotification += (sender, e) =>\n            {\n                HandleNewBrokerageSideOrder(e);\n            };\n\n            _brokerage.DelistingNotification += (sender, e) =>\n            {\n                HandleDelistingNotification(e);\n            };\n\n            _brokerage.OrderIdChanged += (sender, e) =>\n            {\n                HandlerBrokerageOrderIdChangedEvent(e);\n            };\n\n            _brokerage.OrderUpdated += (sender, e) =>\n            {\n                HandleOrderUpdated(e);\n            };\n\n            IsActive = true;\n\n            if (_algorithm is QCAlgorithm qcAlgorithm)\n            {\n                _qcAlgorithmIntance = qcAlgorithm;\n                _signalExport = qcAlgorithm.SignalExport;\n                _executionModel = qcAlgorithm.Execution;\n            }\n            else\n            {\n                var pyAlgorithmWrapper = _algorithm as AlgorithmPythonWrapper;\n                _qcAlgorithmIntance = pyAlgorithmWrapper.BaseAlgorithm;\n                _signalExport = pyAlgorithmWrapper.SignalExport;\n                _executionModel = pyAlgorithmWrapper.Execution;\n            }\n\n            NewOrderEvent += (s, e) => _signalExport.OnOrderEvent(e);\n            InitializeTransactionThread();\n        }\n\n        /// <summary>\n        /// Create and start the transaction thread, who will be in charge of processing\n        /// the order requests\n        /// </summary>\n        protected virtual void InitializeTransactionThread()\n        {\n            // multi threaded queue, used for live deployments\n            var processingThreadsCount = _brokerage.ConcurrencyEnabled\n                ? Config.GetInt(\"maximum-transaction-threads\", 4)\n                : 1;\n            _orderRequestQueues = new(processingThreadsCount);\n            _processingThreads = new(processingThreadsCount);\n            for (var i = 0; i < processingThreadsCount; i++)\n            {\n                _orderRequestQueues.Add(new BusyBlockingCollection<OrderRequest>());\n                var threadId = i; // avoid modified closure\n                _processingThreads.Add(new Thread(() => Run(threadId)) { IsBackground = true, Name = $\"Transaction Thread {i}\" });\n            }\n            foreach (var thread in _processingThreads)\n            {\n                thread.Start();\n            }\n        }\n\n        /// <summary>\n        /// Boolean flag indicating the Run thread method is busy.\n        /// False indicates it is completely finished processing and ready to be terminated.\n        /// </summary>\n        public bool IsActive { get; private set; }\n\n        #region Order Request Processing\n\n        /// <summary>\n        /// Adds the specified order to be processed\n        /// </summary>\n        /// <param name=\"request\">The order to be processed</param>\n        public OrderTicket Process(OrderRequest request)\n        {\n            if (_algorithm.LiveMode)\n            {\n                Log.Trace(\"BrokerageTransactionHandler.Process(): \" + request);\n\n                _algorithm.Portfolio.LogMarginInformation(request);\n            }\n\n            switch (request.OrderRequestType)\n            {\n                case OrderRequestType.Submit:\n                    return AddOrder((SubmitOrderRequest)request);\n\n                case OrderRequestType.Update:\n                    return UpdateOrder((UpdateOrderRequest)request);\n\n                case OrderRequestType.Cancel:\n                    return CancelOrder((CancelOrderRequest)request);\n\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        /// <summary>\n        /// Add an order to collection and return the unique order id or negative if an error.\n        /// </summary>\n        /// <param name=\"request\">A request detailing the order to be submitted</param>\n        /// <returns>New unique, increasing orderid</returns>\n        public OrderTicket AddOrder(SubmitOrderRequest request)\n        {\n            var response = !_algorithm.IsWarmingUp\n                ? OrderResponse.Success(request)\n                : OrderResponse.WarmingUp(request);\n\n            var shortable = true;\n            if (request.Quantity < 0)\n            {\n                shortable = _algorithm.Shortable(request.Symbol, request.Quantity);\n            }\n\n            if (!shortable)\n            {\n                var message = GetShortableErrorMessage(request.Symbol, request.Quantity);\n                if (_algorithm.LiveMode)\n                {\n                    // in live mode we send a warning but we wont block the order being sent to the brokerage\n                    _algorithm.Debug($\"Warning: {message}\");\n                }\n                else\n                {\n                    response = OrderResponse.Error(request, OrderResponseErrorCode.ExceedsShortableQuantity, message);\n                }\n            }\n\n            request.SetResponse(response);\n            var ticket = new OrderTicket(_algorithm.Transactions, request);\n            var security = _algorithm.Securities[request.Symbol];\n            var order = Order.CreateOrder(request);\n\n            Interlocked.Increment(ref _totalOrderCount);\n\n            _completeOrderTickets.TryAdd(ticket.OrderId, ticket);\n\n            // send the order to be processed after creating the ticket\n            if (response.IsSuccess)\n            {\n                // save current security prices\n                order.OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Close);\n                _openOrders[order.Id] = new OpenOrderState(order, ticket, security);\n\n                EnqueueOrderRequest(request, order);\n\n                WaitForOrderSubmission(ticket);\n            }\n            else\n            {\n                // add it to the orders collection for recall later\n                var orderTag = response.ErrorCode == OrderResponseErrorCode.AlgorithmWarmingUp\n                    ? \"Algorithm warming up.\"\n                    : response.ErrorMessage;\n\n                // ensure the order is tagged with a currency\n                order.PriceCurrency = security.SymbolProperties.QuoteCurrency;\n\n                order.Status = OrderStatus.Invalid;\n                order.Tag = orderTag;\n                ticket.SetOrder(order);\n                _completeOrders.TryAdd(order.Id, order);\n\n                HandleOrderEvent(new OrderEvent(order,\n                    _algorithm.UtcTime,\n                    OrderFee.Zero,\n                    orderTag));\n            }\n            return ticket;\n        }\n\n        /// <summary>\n        /// Wait for the order to be handled by the <see cref=\"_processingThreads\"/>\n        /// </summary>\n        /// <param name=\"ticket\">The <see cref=\"OrderTicket\"/> expecting to be submitted</param>\n        protected virtual void WaitForOrderSubmission(OrderTicket ticket)\n        {\n            // We only wait for synchronous orders to be submitted\n            if (ticket.SubmitRequest.Asynchronous)\n            {\n                return;\n            }\n\n            var orderSetTimeout = Time.OneSecond;\n            if (!ticket.OrderSet.WaitOne(orderSetTimeout))\n            {\n                Log.Error(\"BrokerageTransactionHandler.WaitForOrderSubmission(): \" +\n                    $\"The order request (Id={ticket.OrderId}) was not submitted within {orderSetTimeout.TotalSeconds} second(s).\");\n            }\n        }\n\n        /// <summary>\n        /// Update an order yet to be filled such as stop or limit orders.\n        /// </summary>\n        /// <param name=\"request\">Request detailing how the order should be updated</param>\n        /// <remarks>Does not apply if the order is already fully filled</remarks>\n        public OrderTicket UpdateOrder(UpdateOrderRequest request)\n        {\n            if (!TryGetOrder(request.OrderId, out var order, out var ticket, out _))\n            {\n                return OrderTicket.InvalidUpdateOrderId(_algorithm.Transactions, request);\n            }\n\n            ticket.AddUpdateRequest(request);\n\n            try\n            {\n                //Update the order from the behaviour\n                var orderQuantity = request.Quantity ?? ticket.Quantity;\n\n                var shortable = true;\n                if (order?.Direction == OrderDirection.Sell || orderQuantity < 0)\n                {\n                    shortable = _algorithm.Shortable(ticket.Symbol, orderQuantity, order.Id);\n\n                    if (_algorithm.LiveMode && !shortable)\n                    {\n                        // let's override and just send warning\n                        shortable = true;\n\n                        _algorithm.Debug($\"Warning: {GetShortableErrorMessage(ticket.Symbol, ticket.Quantity)}\");\n                    }\n                }\n\n                if (order == null)\n                {\n                    // can't update an order that doesn't exist!\n                    Log.Error(\"BrokerageTransactionHandler.Update(): Cannot update a null order\");\n                    request.SetResponse(OrderResponse.UnableToFindOrder(request));\n                }\n                else if (order.Status == OrderStatus.New)\n                {\n                    // can't update a pending submit order\n                    Log.Error(\"BrokerageTransactionHandler.Update(): Cannot update a pending submit order with status \" + order.Status);\n                    request.SetResponse(OrderResponse.InvalidNewStatus(request, order));\n                }\n                else if (order.Status.IsClosed() && !request.IsAllowedForClosedOrder())\n                {\n                    // can't update a completed order\n                    Log.Error(\"BrokerageTransactionHandler.Update(): Cannot update closed order with status \" + order.Status);\n                    request.SetResponse(OrderResponse.InvalidStatus(request, order));\n                }\n                else if (request.Quantity.HasValue && request.Quantity.Value == 0)\n                {\n                    request.SetResponse(OrderResponse.ZeroQuantity(request));\n                }\n                else if (_algorithm.IsWarmingUp)\n                {\n                    request.SetResponse(OrderResponse.WarmingUp(request));\n                }\n                else if (!shortable)\n                {\n                    var shortableResponse = OrderResponse.Error(request, OrderResponseErrorCode.ExceedsShortableQuantity,\n                        GetShortableErrorMessage(ticket.Symbol, ticket.Quantity));\n\n                    request.SetResponse(shortableResponse);\n                }\n                else\n                {\n                    request.SetResponse(OrderResponse.Success(request), OrderRequestStatus.Processing);\n                    EnqueueOrderRequest(request, order);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                request.SetResponse(OrderResponse.Error(request, OrderResponseErrorCode.ProcessingError, err.Message));\n            }\n\n            return ticket;\n        }\n\n        /// <summary>\n        /// Remove this order from outstanding queue: user is requesting a cancel.\n        /// </summary>\n        /// <param name=\"request\">Request containing the specific order id to remove</param>\n        public OrderTicket CancelOrder(CancelOrderRequest request)\n        {\n            if (!TryGetOrder(request.OrderId, out var order, out var ticket, out _))\n            {\n                Log.Error(\"BrokerageTransactionHandler.CancelOrder(): Unable to locate ticket for order.\");\n                return OrderTicket.InvalidCancelOrderId(_algorithm.Transactions, request);\n            }\n\n            try\n            {\n                // if we couldn't set this request as the cancellation then another thread/someone\n                // else is already doing it or it in fact has already been cancelled\n                if (!ticket.TrySetCancelRequest(request))\n                {\n                    // the ticket has already been cancelled\n                    request.SetResponse(OrderResponse.Error(request, OrderResponseErrorCode.InvalidRequest, \"Cancellation is already in progress.\"));\n                    return ticket;\n                }\n\n                //Error check\n                if (order != null && request.Tag != null)\n                {\n                    order.Tag = request.Tag;\n                }\n                if (order == null)\n                {\n                    Log.Error(\"BrokerageTransactionHandler.CancelOrder(): Cannot find this id.\");\n                    request.SetResponse(OrderResponse.UnableToFindOrder(request));\n                }\n                else if (order.Status == OrderStatus.New)\n                {\n                    Log.Error(\"BrokerageTransactionHandler.CancelOrder(): Cannot cancel order with status: \" + order.Status);\n                    request.SetResponse(OrderResponse.InvalidNewStatus(request, order));\n                }\n                else if (order.Status.IsClosed())\n                {\n                    Log.Error(\"BrokerageTransactionHandler.CancelOrder(): Cannot cancel order already \" + order.Status);\n                    request.SetResponse(OrderResponse.InvalidStatus(request, order));\n                }\n                else if (_algorithm.IsWarmingUp)\n                {\n                    request.SetResponse(OrderResponse.WarmingUp(request));\n                }\n                else\n                {\n                    _cancelPendingOrders.Set(order.Id, order.Status);\n                    // update the order status\n                    order.Status = OrderStatus.CancelPending;\n\n                    // notify the algorithm with an order event\n                    HandleOrderEvent(new OrderEvent(order,\n                        _algorithm.UtcTime,\n                        OrderFee.Zero));\n\n                    // send the request to be processed\n                    request.SetResponse(OrderResponse.Success(request), OrderRequestStatus.Processing);\n                    EnqueueOrderRequest(request, order);\n                }\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                request.SetResponse(OrderResponse.Error(request, OrderResponseErrorCode.ProcessingError, err.Message));\n            }\n\n            return ticket;\n        }\n\n        /// <summary>\n        /// Gets and enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets</param>\n        /// <returns>An enumerable of <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _completeOrderTickets.Select(x => x.Value).Where(filter ?? (x => true));\n        }\n\n        /// <summary>\n        /// Gets and enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/>\n        /// </summary>\n        /// <param name=\"filter\">The filter predicate used to find the required order tickets</param>\n        /// <returns>An enumerable of opened <see cref=\"OrderTicket\"/> matching the specified <paramref name=\"filter\"/></returns>\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _openOrders.Select(x => x.Value.Ticket).Where(filter ?? (x => true));\n        }\n\n        /// <summary>\n        /// Gets the order ticket for the specified order id. Returns null if not found\n        /// </summary>\n        /// <param name=\"orderId\">The order's id</param>\n        /// <returns>The order ticket with the specified id, or null if not found</returns>\n        public OrderTicket GetOrderTicket(int orderId)\n        {\n            OrderTicket ticket;\n            _completeOrderTickets.TryGetValue(orderId, out ticket);\n            return ticket;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Get the order by its id\n        /// </summary>\n        /// <param name=\"orderId\">Order id to fetch</param>\n        /// <returns>A clone of the order with the specified id, or null if no match is found</returns>\n        public Order GetOrderById(int orderId)\n        {\n            Order order = GetOrderByIdInternal(orderId);\n            return order?.Clone();\n        }\n\n        private Order GetOrderByIdInternal(int orderId)\n        {\n            Order order;\n            return _completeOrders.TryGetValue(orderId, out order) ? order : null;\n        }\n\n        /// <summary>\n        /// Tries to get the order for the specified order id.\n        /// First looks up in the open orders, then in the completed orders.\n        /// NOTE: It will only return the security if the order is still open.\n        /// </summary>\n        private bool TryGetOrder(int orderId, out Order order, out OrderTicket ticket, out Security security)\n        {\n            security = null;\n            if (_openOrders.TryGetValue(orderId, out var openOrder))\n            {\n                order = openOrder.Order;\n                ticket = openOrder.Ticket;\n                security = openOrder.Security;\n            }\n            else if (!_completeOrders.TryGetValue(orderId, out order) || !_completeOrderTickets.TryGetValue(orderId, out ticket))\n            {\n                order = null;\n                ticket = null;\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the order by its brokerage id\n        /// </summary>\n        /// <param name=\"brokerageId\">The brokerage id to fetch</param>\n        /// <returns>The first order matching the brokerage id, or null if no match is found</returns>\n        public List<Order> GetOrdersByBrokerageId(string brokerageId)\n        {\n            var openOrders = GetOrdersByBrokerageId(brokerageId,\n                _openOrders.Select(kvp => KeyValuePair.Create(kvp.Key, kvp.Value.Order)));\n\n            if (openOrders.Count > 0\n                // if it's part of a group, some leg could be filled already, not part of open orders\n                && (openOrders[0].GroupOrderManager == null || openOrders[0].GroupOrderManager.Count == openOrders.Count))\n            {\n                return openOrders;\n            }\n\n            return GetOrdersByBrokerageId(brokerageId, _completeOrders);\n        }\n\n        private static List<Order> GetOrdersByBrokerageId(string brokerageId, IEnumerable<KeyValuePair<int, Order>> orders)\n        {\n            return orders\n                .Where(x => x.Value.BrokerId.Contains(brokerageId))\n                .Select(kvp => kvp.Value.Clone())\n                .ToList();\n        }\n\n        /// <summary>\n        /// Gets all orders matching the specified filter. Specifying null will return an enumerable\n        /// of all orders.\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All orders this order provider currently holds by the specified filter</returns>\n        public IEnumerable<Order> GetOrders(Func<Order, bool> filter = null)\n        {\n            if (filter != null)\n            {\n                // return a clone to prevent object reference shenanigans, you must submit a request to change the order\n                return _completeOrders.Select(x => x.Value).Where(filter).Select(x => x.Clone());\n            }\n            return _completeOrders.Select(x => x.Value).Select(x => x.Clone());\n        }\n\n        /// <summary>\n        /// Gets open orders matching the specified filter\n        /// </summary>\n        /// <param name=\"filter\">Delegate used to filter the orders</param>\n        /// <returns>All open orders this order provider currently holds</returns>\n        public List<Order> GetOpenOrders(Func<Order, bool> filter = null)\n        {\n            var openOrders = _openOrders.Select(kvp => kvp.Value.Order);\n            if (filter != null)\n            {\n                // return a clone to prevent object reference shenanigans, you must submit a request to change the order\n                return openOrders.Where(filter).Select(x => x.Clone()).ToList();\n            }\n            return openOrders.Select(x => x.Clone()).ToList();\n        }\n\n        /// <summary>\n        /// Primary thread entry point to launch the transaction thread.\n        /// </summary>\n        protected void Run(int threadId)\n        {\n            try\n            {\n                foreach (var request in _orderRequestQueues[threadId].GetConsumingEnumerable(_cancellationTokenSource.Token))\n                {\n                    HandleOrderRequest(request);\n                    ProcessAsynchronousEvents();\n                }\n            }\n            catch (Exception err)\n            {\n                // unexpected error, we need to close down shop\n                _algorithm.SetRuntimeError(err, \"HandleOrderRequest\");\n            }\n\n            if (_processingThreads != null)\n            {\n                Log.Trace($\"BrokerageTransactionHandler.Run(): Ending Thread {threadId}...\");\n                IsActive = false;\n            }\n        }\n\n        /// <summary>\n        /// Processes asynchronous events on the transaction handler's thread\n        /// </summary>\n        public virtual void ProcessAsynchronousEvents()\n        {\n            // NOP\n        }\n\n        /// <summary>\n        /// Processes all synchronous events that must take place before the next time loop for the algorithm\n        /// </summary>\n        public virtual void ProcessSynchronousEvents()\n        {\n            // how to do synchronous market orders for real brokerages?\n\n            // in backtesting we need to wait for orders to be removed from the queue and finished processing\n            if (!_algorithm.LiveMode)\n            {\n                if (_orderRequestQueues.Any(queue => queue.IsBusy && !queue.WaitHandle.WaitOne(Time.OneSecond, _cancellationTokenSource.Token)))\n                {\n                    Log.Error(\"BrokerageTransactionHandler.ProcessSynchronousEvents(): Timed out waiting for request queue to finish processing.\");\n                }\n                return;\n            }\n\n            _signalExport.Flush(CurrentTimeUtc);\n\n            // check if the brokerage should perform cash sync now\n            if (!_algorithm.IsWarmingUp && _brokerage.ShouldPerformCashSync(CurrentTimeUtc))\n            {\n                // only perform cash syncs if we haven't had a fill for at least 10 seconds\n                if (TimeSinceLastFill > TimeSpan.FromSeconds(10))\n                {\n                    if (!_brokerage.PerformCashSync(_algorithm, CurrentTimeUtc, () => TimeSinceLastFill))\n                    {\n                        if (++_failedCashSyncAttempts >= MaxCashSyncAttempts)\n                        {\n                            throw new Exception(\"The maximum number of attempts for brokerage cash sync has been reached.\");\n                        }\n                    }\n                }\n            }\n\n            // we want to remove orders older than 10k records, but only in live mode\n            const int maxOrdersToKeep = 10000;\n            if (_completeOrders.Count < maxOrdersToKeep + 1)\n            {\n                return;\n            }\n\n            Log.Debug(\"BrokerageTransactionHandler.ProcessSynchronousEvents(): Start removing old orders...\");\n            var max = _completeOrders.Max(x => x.Key);\n            var lowestOrderIdToKeep = max - maxOrdersToKeep;\n            foreach (var item in _completeOrders.Where(x => x.Key <= lowestOrderIdToKeep))\n            {\n                Order value;\n                OrderTicket ticket;\n                _completeOrders.TryRemove(item.Key, out value);\n                _completeOrderTickets.TryRemove(item.Key, out ticket);\n            }\n\n            Log.Debug($\"BrokerageTransactionHandler.ProcessSynchronousEvents(): New order count {_completeOrders.Count}. Exit\");\n        }\n\n        /// <summary>\n        /// Register an already open Order\n        /// </summary>\n        public void AddOpenOrder(Order order, IAlgorithm algorithm)\n        {\n            if (order.Status == OrderStatus.New || order.Status == OrderStatus.None)\n            {\n                // make sure we have a valid order status\n                order.Status = OrderStatus.Submitted;\n            }\n\n            order.Id = algorithm.Transactions.GetIncrementOrderId();\n\n            if (order.GroupOrderManager != null && order.GroupOrderManager.Id == 0)\n            {\n                order.GroupOrderManager.Id = algorithm.Transactions.GetIncrementGroupOrderManagerId();\n            }\n\n            var orderTicket = order.ToOrderTicket(algorithm.Transactions);\n\n            SetPriceAdjustmentMode(order, algorithm);\n\n            var openOrder = new OpenOrderState(order, orderTicket, algorithm.Securities[order.Symbol]);\n            _openOrders.AddOrUpdate(order.Id, openOrder, (i, o) => openOrder);\n            _completeOrders.AddOrUpdate(order.Id, order, (i, o) => order);\n            _completeOrderTickets.AddOrUpdate(order.Id, orderTicket);\n\n            Interlocked.Increment(ref _totalOrderCount);\n        }\n\n\n        /// <summary>\n        /// Signal a end of thread request to stop monitoring the transactions.\n        /// </summary>\n        public void Exit()\n        {\n            var timeout = TimeSpan.FromSeconds(60);\n            if (_processingThreads != null)\n            {\n                // only wait if the processing thread is running\n                if (_orderRequestQueues.Any(queue => queue.IsBusy && !queue.WaitHandle.WaitOne(timeout)))\n                {\n                    Log.Error(\"BrokerageTransactionHandler.Exit(): Exceed timeout: \" + (int)(timeout.TotalSeconds) + \" seconds.\");\n                }\n\n                foreach (var queue in _orderRequestQueues)\n                {\n                    queue.CompleteAdding();\n                }\n\n                foreach (var thread in _processingThreads)\n                {\n                    thread?.StopSafely(timeout, _cancellationTokenSource);\n                }\n            }\n            IsActive = false;\n            _cancellationTokenSource.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Calculates the projected holdings for the specified security based on the current open orders.\n        /// </summary>\n        /// <param name=\"security\">The security</param>\n        /// <returns>\n        /// The projected holdings for the specified security, which is the sum of the current holdings\n        /// plus the sum of the open orders quantity.\n        /// </returns>\n        public ProjectedHoldings GetProjectedHoldings(Security security)\n        {\n            var openOrderTickets = GetOpenOrderTickets(x => x.Symbol == security.Symbol).ToArray();\n\n            lock (_lockHandleOrderEvent)\n            {\n                var openOrderQuantity = openOrderTickets.Aggregate(0m, (d, t) => d + t.QuantityRemaining);\n                return new ProjectedHoldings(security.Holdings.Quantity, openOrderQuantity);\n            }\n        }\n\n        /// <summary>\n        /// Handles a generic order request\n        /// </summary>\n        /// <param name=\"request\"><see cref=\"OrderRequest\"/> to be handled</param>\n        /// <returns><see cref=\"OrderResponse\"/> for request</returns>\n        public virtual void HandleOrderRequest(OrderRequest request)\n        {\n            OrderResponse response;\n            switch (request.OrderRequestType)\n            {\n                case OrderRequestType.Submit:\n                    response = HandleSubmitOrderRequest((SubmitOrderRequest)request);\n                    break;\n                case OrderRequestType.Update:\n                    response = HandleUpdateOrderRequest((UpdateOrderRequest)request);\n                    break;\n                case OrderRequestType.Cancel:\n                    response = HandleCancelOrderRequest((CancelOrderRequest)request);\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            // mark request as processed\n            request.SetResponse(response, OrderRequestStatus.Processed);\n        }\n\n        /// <summary>\n        /// Handles a request to submit a new order\n        /// </summary>\n        private OrderResponse HandleSubmitOrderRequest(SubmitOrderRequest request)\n        {\n            if (!_openOrders.TryGetValue(request.OrderId, out var openOrder) || !_completeOrders.TryAdd(openOrder.Order.Id, openOrder.Order))\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleSubmitOrderRequest(): Unable to add new order, order not processed.\");\n                return OrderResponse.Error(request, OrderResponseErrorCode.OrderAlreadyExists, \"Cannot process submit request because order with id {0} already exists\");\n            }\n\n            var order = openOrder.Order;\n            var security = openOrder.Security;\n\n            // ensure the order is tagged with a currency\n            order.PriceCurrency = security.SymbolProperties.QuoteCurrency;\n            if (string.IsNullOrEmpty(order.Tag))\n            {\n                order.Tag = order.GetDefaultTag();\n            }\n\n            // rounds off the order towards 0 to the nearest multiple of lot size\n            order.Quantity = RoundOffOrder(order, security);\n\n            var comboIsReady = order.TryGetGroupOrders(GetComboOrderLeg, out var orders);\n            var comboSecuritiesFound = orders.TryGetGroupOrdersSecurities(_algorithm.Portfolio, out var securities);\n\n            // rounds the order prices\n            RoundOrderPrices(order, security, comboIsReady, securities);\n\n            // Set order price adjustment mode\n            SetPriceAdjustmentMode(order, _algorithm);\n\n            // update the ticket's internal storage with this new order reference\n            openOrder.Ticket.SetOrder(order);\n\n            if (!comboIsReady)\n            {\n                // an Order of the group is missing\n                return OrderResponse.Success(request);\n            }\n\n            if (orders.Any(o => o.Quantity == 0))\n            {\n                var response = OrderResponse.ZeroQuantity(request);\n                _algorithm.Error(response.ErrorMessage);\n\n                InvalidateOrders(orders, response.ErrorMessage);\n                return response;\n            }\n\n            if (!comboSecuritiesFound)\n            {\n                var response = OrderResponse.MissingSecurity(request);\n                _algorithm.Error(response.ErrorMessage);\n\n                InvalidateOrders(orders, response.ErrorMessage);\n                return response;\n            }\n\n            // check to see if we have enough money to place the order\n            if (!HasSufficientBuyingPowerForOrders(order, request, out var validationResult, orders, securities))\n            {\n                return validationResult;\n            }\n\n            // verify that our current brokerage can actually take the order\n            foreach (var kvp in securities)\n            {\n                if (!_algorithm.BrokerageModel.CanSubmitOrder(kvp.Value, kvp.Key, out var message))\n                {\n                    var errorMessage = $\"BrokerageModel declared unable to submit order: [{string.Join(\",\", orders.Select(o => o.Id))}]\";\n\n                    // if we couldn't actually process the order, mark it as invalid and bail\n                    message ??= new BrokerageMessageEvent(BrokerageMessageType.Warning, \"InvalidOrder\", string.Empty);\n                    var response = OrderResponse.Error(request, OrderResponseErrorCode.BrokerageModelRefusedToSubmitOrder, $\"{errorMessage} {message}\");\n\n                    InvalidateOrders(orders, response.ErrorMessage);\n                    _algorithm.Error(response.ErrorMessage);\n                    return response;\n                }\n            }\n\n            // set the order status based on whether or not we successfully submitted the order to the market\n            bool orderPlaced;\n            var error = string.Empty;\n            try\n            {\n                orderPlaced = orders.All(o => _brokerage.PlaceOrder(o));\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                orderPlaced = false;\n                error = \" \" + err.Message;\n            }\n\n            if (!orderPlaced)\n            {\n                // we failed to submit the order, invalidate it\n                var errorMessage = $\"Brokerage failed to place orders: [{string.Join(\",\", orders.Select(o => o.Id))}]{error}\";\n\n                InvalidateOrders(orders, errorMessage);\n                _algorithm.Error(errorMessage);\n                return OrderResponse.Error(request, OrderResponseErrorCode.BrokerageFailedToSubmitOrder, errorMessage);\n            }\n\n            return OrderResponse.Success(request);\n        }\n\n        /// <summary>\n        /// Handles a request to update order properties\n        /// </summary>\n        private OrderResponse HandleUpdateOrderRequest(UpdateOrderRequest request)\n        {\n            if (!TryGetOrder(request.OrderId, out var order, out var ticket, out var security))\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleUpdateOrderRequest(): Unable to update order with ID \" + request.OrderId);\n                return OrderResponse.UnableToFindOrder(request);\n            }\n\n            if (order.Status == OrderStatus.New)\n            {\n                return OrderResponse.InvalidNewStatus(request, order);\n            }\n\n            var isClosedOrderUpdate = false;\n\n            if (order.Status.IsClosed())\n            {\n                if (!request.IsAllowedForClosedOrder())\n                {\n                    return OrderResponse.InvalidStatus(request, order);\n                }\n\n                isClosedOrderUpdate = true;\n            }\n\n            // rounds off the order towards 0 to the nearest multiple of lot size\n            security ??= _algorithm.Securities[order.Symbol];\n            order.Quantity = RoundOffOrder(order, security);\n\n            // verify that our current brokerage can actually update the order\n            BrokerageMessageEvent message;\n            if (!_algorithm.LiveMode && !_algorithm.BrokerageModel.CanUpdateOrder(security, order, request, out message))\n            {\n                if (message == null) message = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"InvalidRequest\", \"BrokerageModel declared unable to update order: \" + order.Id);\n                var response = OrderResponse.Error(request, OrderResponseErrorCode.BrokerageModelRefusedToUpdateOrder, \"OrderID: \" + order.Id + \" \" + message);\n                _algorithm.Error(response.ErrorMessage);\n                HandleOrderEvent(new OrderEvent(order,\n                    _algorithm.UtcTime,\n                    OrderFee.Zero,\n                    \"BrokerageModel declared unable to update order\"));\n                return response;\n            }\n\n            // If the order is not part of a ComboLegLimit update, validate sufficient buying power\n            if (order.GroupOrderManager == null)\n            {\n                var updatedOrder = order.Clone();\n                updatedOrder.ApplyUpdateOrderRequest(request);\n                if (!HasSufficientBuyingPowerForOrders(updatedOrder, request, out var validationResult))\n                {\n                    return validationResult;\n                }\n            }\n\n            // modify the values of the order object\n            order.ApplyUpdateOrderRequest(request);\n\n            // rounds the order prices\n            RoundOrderPrices(order, security);\n\n            ticket.SetOrder(order);\n\n            bool orderUpdated;\n            if (isClosedOrderUpdate)\n            {\n                orderUpdated = true;\n            }\n            else\n            {\n                try\n                {\n                    orderUpdated = _brokerage.UpdateOrder(order);\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n                    orderUpdated = false;\n                }\n            }\n\n            if (!orderUpdated)\n            {\n                // we failed to update the order for some reason\n                var errorMessage = \"Brokerage failed to update order with id \" + request.OrderId;\n                _algorithm.Error(errorMessage);\n                HandleOrderEvent(new OrderEvent(order,\n                    _algorithm.UtcTime,\n                    OrderFee.Zero,\n                    \"Brokerage failed to update order\"));\n                return OrderResponse.Error(request, OrderResponseErrorCode.BrokerageFailedToUpdateOrder, errorMessage);\n            }\n\n            return OrderResponse.Success(request);\n        }\n\n        /// <summary>\n        /// Handles a request to cancel an order\n        /// </summary>\n        private OrderResponse HandleCancelOrderRequest(CancelOrderRequest request)\n        {\n            if (!TryGetOrder(request.OrderId, out var order, out var ticket, out _))\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleCancelOrderRequest(): Unable to cancel order with ID \" + request.OrderId + \".\");\n                return OrderResponse.UnableToFindOrder(request);\n            }\n\n            if (order.Status == OrderStatus.New)\n            {\n                _cancelPendingOrders.RemoveAndFallback(order);\n                return OrderResponse.InvalidNewStatus(request, order);\n            }\n\n            if (order.Status.IsClosed())\n            {\n                _cancelPendingOrders.RemoveAndFallback(order);\n                return OrderResponse.InvalidStatus(request, order);\n            }\n\n            ticket.SetOrder(order);\n\n            bool orderCanceled;\n            try\n            {\n                orderCanceled = _brokerage.CancelOrder(order);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                orderCanceled = false;\n            }\n\n            if (!orderCanceled)\n            {\n                // failed to cancel the order\n                var message = \"Brokerage failed to cancel order with id \" + order.Id;\n                _algorithm.Error(message);\n                _cancelPendingOrders.RemoveAndFallback(order);\n                return OrderResponse.Error(request, OrderResponseErrorCode.BrokerageFailedToCancelOrder, message);\n            }\n\n            if (request.Tag != null)\n            {\n                // update the tag, useful for 'why' we canceled the order\n                order.Tag = request.Tag;\n            }\n\n            return OrderResponse.Success(request);\n        }\n\n        /// <summary>\n        /// Validates if there is sufficient buying power for the given order(s).\n        /// Returns an error response if validation fails or an exception occurs.\n        /// Returns null if validation passes.\n        /// </summary>\n        private bool HasSufficientBuyingPowerForOrders(Order order, OrderRequest request, out OrderResponse response, List<Order> orders = null, Dictionary<Order, Security> securities = null)\n        {\n            response = null;\n            HasSufficientBuyingPowerForOrderResult hasSufficientBuyingPowerResult;\n            try\n            {\n                hasSufficientBuyingPowerResult = _algorithm.Portfolio.HasSufficientBuyingPowerForOrder(orders ?? [order]);\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                _algorithm.Error($\"Order Error: id: {order.Id.ToStringInvariant()}, Error executing margin models: {err.Message}\");\n                HandleOrderEvent(new OrderEvent(order, _algorithm.UtcTime, OrderFee.Zero, \"Error executing margin models\"));\n\n                response = OrderResponse.Error(request, OrderResponseErrorCode.ProcessingError, \"An error occurred while checking sufficient buying power for the orders.\");\n                return false;\n            }\n\n            if (!hasSufficientBuyingPowerResult.IsSufficient)\n            {\n                var errorMessage = securities != null\n                    ? securities.GetErrorMessage(hasSufficientBuyingPowerResult)\n                    : $\"Brokerage failed to update order with id: {order.Id.ToStringInvariant()}, Symbol: {order.Symbol.Value}, Insufficient buying power to complete order, Reason: {hasSufficientBuyingPowerResult.Reason}.\";\n\n                _algorithm.Error(errorMessage);\n\n                if (request is UpdateOrderRequest)\n                {\n                    HandleOrderEvent(new OrderEvent(order, _algorithm.UtcTime, OrderFee.Zero, errorMessage));\n                    response = OrderResponse.Error(request, OrderResponseErrorCode.BrokerageFailedToUpdateOrder, errorMessage);\n                }\n                else\n                {\n                    InvalidateOrders(orders, errorMessage);\n                    response = OrderResponse.Error(request, OrderResponseErrorCode.InsufficientBuyingPower, errorMessage);\n                }\n                return false;\n            }\n\n            return true;\n        }\n\n        private void HandleOrderEvents(List<OrderEvent> orderEvents)\n        {\n            lock (_lockHandleOrderEvent)\n            {\n                // Get orders and tickets\n                var orders = new List<OpenOrderState>(orderEvents.Count);\n\n                for (var i = 0; i < orderEvents.Count; i++)\n                {\n                    var orderEvent = orderEvents[i];\n\n                    Order order = null;\n                    OrderTicket ticket = null;\n                    Security security = null;\n                    if (orderEvent.Status.IsClosed() && _openOrders.TryRemove(orderEvent.OrderId, out var openOrder))\n                    {\n                        _completeOrders[orderEvent.OrderId] = order = openOrder.Order;\n                        _completeOrderTickets[orderEvent.OrderId] = ticket = openOrder.Ticket;\n                        security = openOrder.Security;\n                    }\n                    else if (!TryGetOrder(orderEvent.OrderId, out order, out ticket, out security))\n                    {\n                        Log.Error(\"BrokerageTransactionHandler.HandleOrderEvents(): Unable to locate order or ticket for order ID \" + orderEvent.OrderId);\n                        LogOrderEvent(orderEvent);\n                        return;\n                    }\n\n                    orders.Add(new OpenOrderState(order, ticket, security ?? _algorithm.Securities[order.Symbol]));\n                    orderEvent.Ticket = ticket;\n                }\n\n                var fillsToProcess = new List<OrderEvent>(orderEvents.Count);\n\n                // now lets update the orders\n                for (var i = 0; i < orderEvents.Count; i++)\n                {\n                    var orderEvent = orderEvents[i];\n                    var openOrder = orders[i];\n                    var order = openOrder.Order;\n                    var ticket = orderEvent.Ticket;\n\n                    _cancelPendingOrders.UpdateOrRemove(order.Id, orderEvent.Status);\n                    // set the status of our order object based on the fill event except if the order status is filled/cancelled and the event is invalid\n                    // in live trading it can happen that we submit an update which get's rejected by the brokerage because the order is already filled\n                    // so we don't want the invalid update event to set the order status to invalid if it's already filled\n                    if (order.Status != OrderStatus.Filled && order.Status != OrderStatus.Canceled || orderEvent.Status != OrderStatus.Invalid)\n                    {\n                        order.Status = orderEvent.Status;\n                    }\n\n                    orderEvent.Id = order.GetNewId();\n\n                    // set the modified time of the order to the fill's timestamp\n                    switch (orderEvent.Status)\n                    {\n                        case OrderStatus.Canceled:\n                            order.CanceledTime = orderEvent.UtcTime;\n                            break;\n\n                        case OrderStatus.PartiallyFilled:\n                        case OrderStatus.Filled:\n                            order.LastFillTime = orderEvent.UtcTime;\n                            break;\n\n                        case OrderStatus.UpdateSubmitted:\n                        case OrderStatus.Submitted:\n                            // submit events after the initial submission are all order updates\n                            if (ticket.UpdateRequests.Count > 0)\n                            {\n                                order.LastUpdateTime = orderEvent.UtcTime;\n                            }\n                            break;\n                    }\n\n                    // lets always set current Quantity, Limit and Stop prices in the order event so that it's easier for consumers\n                    // to know the current state and detect any update\n                    orderEvent.Quantity = order.Quantity;\n                    switch (order.Type)\n                    {\n                        case OrderType.Limit:\n                            var limit = order as LimitOrder;\n                            orderEvent.LimitPrice = limit.LimitPrice;\n                            break;\n                        case OrderType.ComboLegLimit:\n                            var legLimitOrder = order as ComboLegLimitOrder;\n                            orderEvent.LimitPrice = legLimitOrder.LimitPrice;\n                            break;\n                        case OrderType.StopMarket:\n                            var marketOrder = order as StopMarketOrder;\n                            orderEvent.StopPrice = marketOrder.StopPrice;\n                            break;\n                        case OrderType.StopLimit:\n                            var stopLimitOrder = order as StopLimitOrder;\n                            orderEvent.LimitPrice = stopLimitOrder.LimitPrice;\n                            orderEvent.StopPrice = stopLimitOrder.StopPrice;\n                            break;\n                        case OrderType.TrailingStop:\n                            var trailingStopOrder = order as TrailingStopOrder;\n                            orderEvent.StopPrice = trailingStopOrder.StopPrice;\n                            orderEvent.TrailingAmount = trailingStopOrder.TrailingAmount;\n                            break;\n                        case OrderType.LimitIfTouched:\n                            var limitIfTouchedOrder = order as LimitIfTouchedOrder;\n                            orderEvent.LimitPrice = limitIfTouchedOrder.LimitPrice;\n                            orderEvent.TriggerPrice = limitIfTouchedOrder.TriggerPrice;\n                            break;\n                    }\n\n                    // check if the fill currency and the order currency match the symbol currency\n                    if (orderEvent.Status == OrderStatus.Filled || orderEvent.Status == OrderStatus.PartiallyFilled)\n                    {\n                        fillsToProcess.Add(orderEvent);\n                        Interlocked.Exchange(ref _lastFillTimeTicks, CurrentTimeUtc.Ticks);\n\n                        if (orderEvent.Symbol.SecurityType == SecurityType.Crypto\n                            && order.Direction == OrderDirection.Buy\n                            && CurrencyPairUtil.TryDecomposeCurrencyPair(orderEvent.Symbol, out var baseCurrency, out var quoteCurrency)\n                            && orderEvent.OrderFee.Value.Currency == baseCurrency)\n                        {\n                            // fees are in the base currency, so we have to subtract them from the filled quantity\n                            // else the virtual position will bigger than the real size and we might no be able to liquidate\n                            orderEvent.FillQuantity -= orderEvent.OrderFee.Value.Amount;\n                            orderEvent.OrderFee = new ModifiedFillQuantityOrderFee(orderEvent.OrderFee.Value, quoteCurrency, openOrder.Security.SymbolProperties.ContractMultiplier);\n\n                            if (!_loggedFeeAdjustmentWarning)\n                            {\n                                _loggedFeeAdjustmentWarning = true;\n                                const string message = \"When buying currency pairs, using Cash account types, fees in base currency\" +\n                                    \" will be deducted from the filled quantity so virtual positions reflect actual holdings.\";\n                                Log.Trace($\"BrokerageTransactionHandler.HandleOrderEvent(): {message}\");\n                                _algorithm.Debug(message);\n                            }\n                        }\n                    }\n                }\n\n                //Apply the filled orders to our portfolio:\n                try\n                {\n                    _algorithm.Portfolio.ProcessFills(fillsToProcess);\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err);\n                    _algorithm.Error($\"Fill error: error in TradeBuilder.ProcessFill: {err.Message}\");\n                }\n\n                // Apply the filled orders to the trade builder\n                for (var i = 0; i < orderEvents.Count; i++)\n                {\n                    var orderEvent = orderEvents[i];\n\n                    if (orderEvent.Status == OrderStatus.Filled || orderEvent.Status == OrderStatus.PartiallyFilled)\n                    {\n                        var security = orders[i].Security;\n\n                        var multiplier = security.SymbolProperties.ContractMultiplier;\n                        var securityConversionRate = security.QuoteCurrency.ConversionRate;\n                        var feeInAccountCurrency = _algorithm.Portfolio.CashBook\n                            .ConvertToAccountCurrency(orderEvent.OrderFee.Value).Amount;\n\n                        try\n                        {\n                            _algorithm.TradeBuilder.ProcessFill(\n                                orderEvent,\n                                securityConversionRate,\n                                feeInAccountCurrency,\n                                multiplier);\n                        }\n                        catch (Exception err)\n                        {\n                            Log.Error(err);\n                        }\n                    }\n\n                    // update the ticket after we've processed the fill, but before the event, this way everything is ready for user code\n                    orderEvent.Ticket.AddOrderEvent(orderEvent);\n                }\n            }\n\n            //We have the events! :) Orders filled, send them in to be handled by algorithm portfolio.\n            for (var i = 0; i < orderEvents.Count; i++)\n            {\n                var orderEvent = orderEvents[i];\n\n                if (orderEvent.Status != OrderStatus.None) //order.Status != OrderStatus.Submitted\n                {\n                    _orderEvents.Enqueue(orderEvent);\n\n                    //Create new order event:\n                    _resultHandler.OrderEvent(orderEvent);\n\n                    NewOrderEvent?.Invoke(this, orderEvent);\n\n                    _executionModel.OnOrderEvent(_qcAlgorithmIntance, orderEvent);\n\n                    try\n                    {\n                        //Trigger our order event handler\n                        _algorithm.OnOrderEvent(orderEvent);\n                    }\n                    catch (Exception err)\n                    {\n                        // unexpected error, we need to close down shop\n                        _algorithm.SetRuntimeError(err, \"Order Event Handler\");\n                    }\n                }\n\n                LogOrderEvent(orderEvent);\n            }\n        }\n\n        private void HandleOrderEvent(OrderEvent orderEvent)\n        {\n            HandleOrderEvents(new List<OrderEvent> { orderEvent });\n        }\n\n        private void HandleOrderUpdated(OrderUpdateEvent e)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleOrderUpdated(): Cannot process order update when algorithm is not running.\");\n                return;\n            }\n\n            if (!_completeOrders.TryGetValue(e.OrderId, out var order))\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleOrderUpdated(): Unable to locate open order with id \" + e.OrderId);\n                return;\n            }\n\n            switch (order.Type)\n            {\n                case OrderType.TrailingStop:\n                    ((TrailingStopOrder)order).StopPrice = e.TrailingStopPrice;\n                    break;\n\n                case OrderType.StopLimit:\n                    ((StopLimitOrder)order).StopTriggered = e.StopTriggered;\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Gets the price adjustment mode for the specified symbol from its subscription configurations\n        /// </summary>\n        private void SetPriceAdjustmentMode(Order order, IAlgorithm algorithm)\n        {\n            if (algorithm.LiveMode)\n            {\n                // live trading always uses raw prices\n                order.PriceAdjustmentMode = DataNormalizationMode.Raw;\n                return;\n            }\n\n            if (!_priceAdjustmentModes.TryGetValue(order.Symbol, out var mode))\n            {\n                var configs = algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(order.Symbol, includeInternalConfigs: true);\n                if (configs.Count == 0)\n                {\n                    throw new InvalidOperationException($\"Unable to locate subscription data config for {order.Symbol}\");\n                }\n\n                mode = configs[0].DataNormalizationMode;\n                _priceAdjustmentModes[order.Symbol] = mode;\n            }\n\n            order.PriceAdjustmentMode = mode;\n        }\n\n        /// <summary>\n        /// Debug logging helper method, called after HandleOrderEvent has finished updating status, price and quantity\n        /// </summary>\n        /// <param name=\"e\">The order event</param>\n        private static void LogOrderEvent(OrderEvent e)\n        {\n            if (Log.DebuggingEnabled)\n            {\n                Log.Debug(\"BrokerageTransactionHandler.LogOrderEvent(): \" + e);\n            }\n        }\n\n        /// <summary>\n        /// Brokerages can send account updates, this include cash balance updates. Since it is of\n        /// utmost important to always have an accurate picture of reality, we'll trust this information\n        /// as truth\n        /// </summary>\n        private void HandleAccountChanged(AccountEvent account)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleAccountChanged(): Cannot process account change when algorithm is not running.\");\n                return;\n            }\n\n            // how close are we?\n            var existingCashBalance = _algorithm.Portfolio.CashBook[account.CurrencySymbol].Amount;\n            if (existingCashBalance != account.CashBalance)\n            {\n                Log.Trace($\"BrokerageTransactionHandler.HandleAccountChanged(): {account.CurrencySymbol} Cash Lean: {existingCashBalance} Brokerage: {account.CashBalance}. Will update: {_brokerage.AccountInstantlyUpdated}\");\n            }\n\n            // maybe we don't actually want to do this, this data can be delayed. Must be explicitly supported by brokerage\n            if (_brokerage.AccountInstantlyUpdated)\n            {\n                // override the current cash value so we're always guaranteed to be in sync with the brokerage's push updates\n                _algorithm.Portfolio.CashBook[account.CurrencySymbol].SetAmount(account.CashBalance);\n            }\n        }\n\n        /// <summary>\n        /// Brokerage order id change is applied to the target order\n        /// </summary>\n        private void HandlerBrokerageOrderIdChangedEvent(BrokerageOrderIdChangedEvent brokerageOrderIdChangedEvent)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandlerBrokerageOrderIdChangedEvent(): Cannot process brokerage order id change when algorithm is not running.\");\n                return;\n            }\n\n            var originalOrder = GetOrderByIdInternal(brokerageOrderIdChangedEvent.OrderId);\n\n            if (originalOrder == null)\n            {\n                // shouldn't happen but let's be careful\n                Log.Error($\"BrokerageTransactionHandler.HandlerBrokerageOrderIdChangedEvent(): Lean order id {brokerageOrderIdChangedEvent.OrderId} not found\");\n                return;\n            }\n\n            // we replace the whole collection\n            originalOrder.BrokerId = brokerageOrderIdChangedEvent.BrokerId;\n        }\n\n        /// <summary>\n        /// Option assignment/exercise event is received and propagated to the user algo\n        /// </summary>\n        private void HandlePositionAssigned(OrderEvent fill)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandlePositionAssigned(): Cannot process position assignment when algorithm is not running.\");\n                return;\n            }\n\n            // informing user algorithm that option position has been assigned\n            _algorithm.OnAssignmentOrderEvent(fill);\n        }\n\n        private void HandleDelistingNotification(DelistingNotificationEventArgs e)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleDelistingNotification(): Cannot process delisting notification when algorithm is not running.\");\n                return;\n            }\n\n            if (_algorithm.Securities.TryGetValue(e.Symbol, out var security))\n            {\n                // only log always in live trading, in backtesting log if not 0 holdings\n                if (_algorithm.LiveMode || security.Holdings.Quantity != 0)\n                {\n                    Log.Trace(\n                        $\"BrokerageTransactionHandler.HandleDelistingNotification(): UtcTime: {CurrentTimeUtc} clearing position for delisted holding: \" +\n                        $\"{e}, \" +\n                        $\"Quantity: {security.Holdings.Quantity}\");\n                }\n\n                // Only submit an order if we have holdings\n                var quantity = -security.Holdings.Quantity;\n                if (quantity != 0)\n                {\n                    var tag = \"Liquidate from delisting\";\n\n                    // Create our order and add it\n                    var order = new MarketOrder(security.Symbol, quantity, _algorithm.UtcTime, tag);\n                    AddOpenOrder(order, _algorithm);\n\n                    // Create our fill with the latest price\n                    var fill = new OrderEvent(order, _algorithm.UtcTime, OrderFee.Zero)\n                    {\n                        FillPrice = security.Price,\n                        Status = OrderStatus.Filled,\n                        FillQuantity = order.Quantity\n                    };\n\n                    // Process this order event\n                    HandleOrderEvent(fill);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Option notification event is received and new order events are generated\n        /// </summary>\n        private void HandleOptionNotification(OptionNotificationEventArgs e)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleOptionNotification(): Cannot process option notification when algorithm is not running.\");\n                return;\n            }\n\n            if (_algorithm.Securities.TryGetValue(e.Symbol, out var security))\n            {\n                // let's take the order event lock, we will be looking at orders and security holdings\n                // and we don't want them changing mid processing because of an order event coming in at the same time\n                // for example: DateTime/decimal order attributes are not thread safe by nature!\n                lock (_lockHandleOrderEvent)\n                {\n                    if (OptionSymbol.IsOptionContractExpired(e.Symbol, CurrentTimeUtc))\n                    {\n                        if (e.Position == 0)\n                        {\n                            // only log always in live trading, in backtesting log if not 0 holdings\n                            if (_algorithm.LiveMode || security.Holdings.Quantity != 0)\n                            {\n                                Log.Trace(\n                                    $\"BrokerageTransactionHandler.HandleOptionNotification(): UtcTime: {CurrentTimeUtc} clearing position for expired option holding: \" +\n                                    $\"Symbol: {e.Symbol.Value}, \" +\n                                    $\"Holdings: {security.Holdings.Quantity}\");\n                            }\n\n                            var quantity = -security.Holdings.Quantity;\n\n                            // If the quantity is already 0 for Lean and the brokerage there is nothing else todo here\n                            if (quantity != 0)\n                            {\n                                var exerciseOrder = GenerateOptionExerciseOrder(security, quantity, e.Tag);\n\n                                EmitOptionNotificationEvents(security, exerciseOrder);\n                            }\n                        }\n                        else\n                        {\n                            Log.Error(\"BrokerageTransactionHandler.HandleOptionNotification(): \" +\n                                $\"unexpected position ({e.Position} instead of zero) \" +\n                                $\"for expired option contract: {e.Symbol.Value}\");\n                        }\n                    }\n                    else\n                    {\n                        // if position is reduced, could be an early exercise or early assignment\n                        if (Math.Abs(e.Position) < security.Holdings.AbsoluteQuantity)\n                        {\n                            Log.Trace(\"BrokerageTransactionHandler.HandleOptionNotification(): \" +\n                                $\"Symbol {e.Symbol.Value} EventQuantity {e.Position} Holdings {security.Holdings.Quantity}\");\n\n                            // if we are long the option and there is an open order, assume it's an early exercise\n                            if (security.Holdings.IsLong)\n                            {\n                                // we only care about open option exercise orders, if it's closed it means we already\n                                // processed it and we wouldn't have a need to handle it here\n                                if (GetOpenOrders(x =>\n                                        x.Symbol == e.Symbol &&\n                                        x.Type == OrderType.OptionExercise)\n                                    .FirstOrDefault() is OptionExerciseOrder exerciseOrder)\n                                {\n                                    EmitOptionNotificationEvents(security, exerciseOrder);\n                                }\n                            }\n\n                            // if we are short the option and there are no buy orders (open or recently closed), assume it's an early assignment\n                            else if (security.Holdings.IsShort)\n                            {\n                                var nowUtc = CurrentTimeUtc;\n                                // for some brokerages (like IB) there might be a race condition between getting an option\n                                // notification event and lean processing an order event. So if we are here, there are these options:\n                                // A) holdings -10 position 5\n                                //  1) WE just BOUGHT 15 and Lean doesn't know yet\n                                //  2) WE just SOLD 15 and this notification is old\n                                // B) holdings -10 position -5\n                                //  1) WE just BOUGHT 5 and Lean doesn't know yet\n                                //  2) WE just SOLD 5 more and this notification is old\n                                //          - Seen this in production already\n                                //  3) Brokerage triggered an early assignment\n\n                                // so we get ALL orders for this symbol that were placed or got an update in the last 'orderWindowSeconds'\n\n                                const int orderWindowSeconds = 10;\n                                // NOTE: We do this checks for actual live trading only to handle the race condition stated above\n                                // for actual brokerages (excluding paper trading with PaperBrokerage).\n                                // TODO: If we confirm this race condition applies for IB only, we could move this to the brokerage itself.\n                                if (_brokerageIsBacktesting ||\n                                    !GetOrders(x =>\n                                        x.Symbol == e.Symbol\n                                        && (x.Status.IsOpen() || x.Status.IsFill() &&\n                                            (Math.Abs((x.Time - nowUtc).TotalSeconds) < orderWindowSeconds\n                                                || (x.LastUpdateTime.HasValue && Math.Abs((x.LastUpdateTime.Value - nowUtc).TotalSeconds) < orderWindowSeconds)\n                                                || (x.LastFillTime.HasValue && Math.Abs((x.LastFillTime.Value - nowUtc).TotalSeconds) < orderWindowSeconds)))).Any())\n                                {\n                                    var quantity = e.Position - security.Holdings.Quantity;\n\n                                    var exerciseOrder = GenerateOptionExerciseOrder(security, quantity, e.Tag);\n\n                                    EmitOptionNotificationEvents(security, exerciseOrder);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// New brokerage-side order event handler\n        /// </summary>\n        private void HandleNewBrokerageSideOrder(NewBrokerageOrderNotificationEventArgs e)\n        {\n            if (_algorithm.Status != AlgorithmStatus.Running)\n            {\n                Log.Error(\"BrokerageTransactionHandler.HandleNewBrokerageSideOrder(): Cannot process new brokerage order when algorithm is not running.\");\n                return;\n            }\n\n            void onError(IReadOnlyCollection<SecurityType> supportedSecurityTypes) =>\n                _algorithm.Debug($\"Warning: New brokerage-side order could not be processed due to \" +\n                    $\"it's security not being supported. Supported security types are {string.Join(\", \", supportedSecurityTypes)}\");\n\n            if (_algorithm.BrokerageMessageHandler.HandleOrder(e) &&\n                _algorithm.GetOrAddUnrequestedSecurity(e.Order.Symbol, out _, onError))\n            {\n                AddOpenOrder(e.Order, _algorithm);\n            }\n        }\n\n        private OptionExerciseOrder GenerateOptionExerciseOrder(Security security, decimal quantity, string tag)\n        {\n            // generate new exercise order and ticket for the option\n            var order = new OptionExerciseOrder(security.Symbol, quantity, CurrentTimeUtc, tag);\n\n            // save current security prices\n            order.OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Close);\n            order.PriceCurrency = security.SymbolProperties.QuoteCurrency;\n\n            AddOpenOrder(order, _algorithm);\n            return order;\n        }\n\n        private void EmitOptionNotificationEvents(Security security, OptionExerciseOrder order)\n        {\n            // generate the order events reusing the option exercise model\n            var option = (Option)security;\n            var orderEvents = option.OptionExerciseModel.OptionExercise(option, order);\n\n            foreach (var orderEvent in orderEvents)\n            {\n                HandleOrderEvent(orderEvent);\n\n                if (orderEvent.IsAssignment)\n                {\n                    if (!string.IsNullOrEmpty(order.Tag))\n                    {\n                        orderEvent.Message = string.IsNullOrEmpty(orderEvent.Message)\n                            ? order.Tag\n                            : $\"{orderEvent.Message}. {order.Tag}\";\n                    }\n                    HandlePositionAssigned(orderEvent);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the amount of time since the last call to algorithm.Portfolio.ProcessFill(fill)\n        /// </summary>\n        protected virtual TimeSpan TimeSinceLastFill =>\n            CurrentTimeUtc - new DateTime(Interlocked.Read(ref _lastFillTimeTicks));\n\n        /// <summary>\n        /// Gets current time UTC. This is here to facilitate testing\n        /// </summary>\n        protected virtual DateTime CurrentTimeUtc => DateTime.UtcNow;\n\n        /// <summary>\n        /// Rounds off the order towards 0 to the nearest multiple of Lot Size\n        /// </summary>\n        public decimal RoundOffOrder(Order order, Security security)\n        {\n            var orderLotMod = order.Quantity % security.SymbolProperties.LotSize;\n\n            if (orderLotMod != 0)\n            {\n                order.Quantity = order.Quantity - orderLotMod;\n\n                if (!_firstRoundOffMessage)\n                {\n                    _algorithm.Error(\"Warning: Due to brokerage limitations, orders will be rounded to \" +\n                        $\"the nearest lot size of {security.SymbolProperties.LotSize.ToStringInvariant()}\"\n                    );\n                    _firstRoundOffMessage = true;\n                }\n                return order.Quantity;\n            }\n            else\n            {\n                return order.Quantity;\n            }\n        }\n\n        /// <summary>\n        /// Rounds the order prices to its security minimum price variation.\n        /// <remarks>\n        /// This procedure is needed to meet brokerage precision requirements.\n        /// </remarks>\n        /// </summary>\n        protected void RoundOrderPrices(Order order, Security security)\n        {\n            var comboIsReady = order.TryGetGroupOrders(GetComboOrderLeg, out var orders);\n            orders.TryGetGroupOrdersSecurities(_algorithm.Portfolio, out var securities);\n\n            RoundOrderPrices(order, security, comboIsReady, securities);\n        }\n\n        /// <summary>\n        /// Rounds the order prices to its security minimum price variation.\n        /// <remarks>\n        /// This procedure is needed to meet brokerage precision requirements.\n        /// </remarks>\n        /// </summary>\n        protected void RoundOrderPrices(Order order, Security security, bool comboIsReady, Dictionary<Order, Security> orders)\n        {\n            switch (order.Type)\n            {\n                case OrderType.Limit:\n                    {\n                        var limitOrder = (LimitOrder)order;\n                        RoundOrderPrice(security, limitOrder.LimitPrice, \"LimitPrice\", (roundedPrice) => limitOrder.LimitPrice = roundedPrice);\n                    }\n                    break;\n\n                case OrderType.StopMarket:\n                    {\n                        var stopMarketOrder = (StopMarketOrder)order;\n                        RoundOrderPrice(security, stopMarketOrder.StopPrice, \"StopPrice\", (roundedPrice) => stopMarketOrder.StopPrice = roundedPrice);\n                    }\n                    break;\n\n                case OrderType.StopLimit:\n                    {\n                        var stopLimitOrder = (StopLimitOrder)order;\n                        RoundOrderPrice(security, stopLimitOrder.LimitPrice, \"LimitPrice\", (roundedPrice) => stopLimitOrder.LimitPrice = roundedPrice);\n                        RoundOrderPrice(security, stopLimitOrder.StopPrice, \"StopPrice\", (roundedPrice) => stopLimitOrder.StopPrice = roundedPrice);\n                    }\n                    break;\n\n                case OrderType.TrailingStop:\n                    {\n                        var trailingStopOrder = (TrailingStopOrder)order;\n                        RoundOrderPrice(security, trailingStopOrder.StopPrice, \"StopPrice\",\n                            (roundedPrice) => trailingStopOrder.StopPrice = roundedPrice);\n\n                        if (!trailingStopOrder.TrailingAsPercentage)\n                        {\n                            RoundOrderPrice(security, trailingStopOrder.TrailingAmount, \"TrailingAmount\",\n                                (roundedAmount) => trailingStopOrder.TrailingAmount = roundedAmount);\n                        }\n                    }\n                    break;\n\n                case OrderType.LimitIfTouched:\n                    {\n                        var limitIfTouchedOrder = (LimitIfTouchedOrder)order;\n                        RoundOrderPrice(security, limitIfTouchedOrder.LimitPrice, \"LimitPrice\",\n                            (roundedPrice) => limitIfTouchedOrder.LimitPrice = roundedPrice);\n                        RoundOrderPrice(security, limitIfTouchedOrder.TriggerPrice, \"TriggerPrice\",\n                            (roundedPrice) => limitIfTouchedOrder.TriggerPrice = roundedPrice);\n                    }\n                    break;\n\n                case OrderType.ComboLegLimit:\n                    {\n                        var comboLegOrder = (ComboLegLimitOrder)order;\n                        RoundOrderPrice(security, comboLegOrder.LimitPrice, \"LimitPrice\",\n                            (roundedPrice) => comboLegOrder.LimitPrice = roundedPrice);\n                    }\n                    break;\n\n                case OrderType.ComboLimit:\n                    {\n                        if (comboIsReady)\n                        {\n                            // all orders in the combo have been received.\n                            // we can now round the limit price of the group order,\n                            // for which we need to find the smallest price variation from each leg security\n                            var groupOrderManager = order.GroupOrderManager;\n                            var increment = 0m;\n                            foreach (var (legOrder, legSecurity) in orders)\n                            {\n                                var legIncrement = legSecurity.PriceVariationModel.GetMinimumPriceVariation(\n                                    new GetMinimumPriceVariationParameters(legSecurity, legOrder.Price));\n                                if (legIncrement > 0 && (increment == 0 || legIncrement < increment))\n                                {\n                                    increment = legIncrement;\n                                }\n                            }\n\n                            RoundOrderPrice(groupOrderManager.LimitPrice, increment, \"LimitPrice\",\n                                (roundedPrice) => groupOrderManager.LimitPrice = roundedPrice);\n                        }\n\n                    }\n                    break;\n            }\n        }\n\n        private void RoundOrderPrice(Security security, decimal price, string priceType, Action<decimal> setPrice)\n        {\n            var increment = security.PriceVariationModel.GetMinimumPriceVariation(new GetMinimumPriceVariationParameters(security, price));\n            RoundOrderPrice(price, increment, priceType, setPrice);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void RoundOrderPrice(decimal price, decimal increment, string priceType, Action<decimal> setPrice)\n        {\n            if (increment > 0)\n            {\n                var roundedPrice = Math.Round(price / increment) * increment;\n                setPrice(roundedPrice);\n                SendWarningOnPriceChange(priceType, roundedPrice, price);\n            }\n        }\n\n        private Order GetComboOrderLeg(int orderId)\n        {\n            _completeOrders.TryGetValue(orderId, out var order);\n            return order;\n        }\n\n        private void InvalidateOrders(List<Order> orders, string message)\n        {\n            for (var i = 0; i < orders.Count; i++)\n            {\n                var orderInGroup = orders[i];\n                if (!orderInGroup.Status.IsClosed())\n                {\n                    orderInGroup.Status = OrderStatus.Invalid;\n                }\n                HandleOrderEvents(new List<OrderEvent> { new OrderEvent(orderInGroup, _algorithm.UtcTime, OrderFee.Zero, message) });\n            }\n        }\n\n        private void SendWarningOnPriceChange(string priceType, decimal priceRound, decimal priceOriginal)\n        {\n            if (!priceOriginal.Equals(priceRound) && !_hasLoggedPriceRoundingWarning)\n            {\n                _algorithm.Error(\n                    $\"Warning: To meet brokerage precision requirements, order {priceType.ToStringInvariant()} was rounded to {priceRound.ToStringInvariant()} from {priceOriginal.ToStringInvariant()}\"\n                );\n                _hasLoggedPriceRoundingWarning = true;\n            }\n        }\n\n        private string GetShortableErrorMessage(Symbol symbol, decimal quantity)\n        {\n            var shortableQuantity = _algorithm.ShortableQuantity(symbol);\n            return $\"Order exceeds shortable quantity {shortableQuantity} for Symbol {symbol} requested {quantity})\";\n        }\n\n        private void EnqueueOrderRequest(OrderRequest request, Order order)\n        {\n            var queueKey = request.OrderId;\n            if (order.GroupOrderManager?.Id > 0)\n            {\n                queueKey = order.GroupOrderManager.Id;\n            }\n            _orderRequestQueues[queueKey % _orderRequestQueues.Count].Add(request);\n        }\n\n        /// <summary>\n        /// Holds an order and its state\n        /// </summary>\n        private class OpenOrderState\n        {\n            public Order Order { get; }\n\n            public OrderTicket Ticket { get; }\n\n            public Security Security { get; }\n\n            public OpenOrderState(Order order, OrderTicket ticket, Security security)\n            {\n                Order = order;\n                Ticket = ticket;\n                Security = security;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/TransactionHandlers/CancelPendingOrders.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.Collections.Concurrent;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Lean.Engine.TransactionHandlers\n{\n    /// <summary>\n    /// Class used to keep track of CancelPending orders and their original or updated status\n    /// </summary>\n    public class CancelPendingOrders\n    {\n        private readonly ConcurrentDictionary<int, CancelPendingOrder> _cancelPendingOrders = new ConcurrentDictionary<int, CancelPendingOrder>();\n\n        /// <summary>\n        /// Amount of CancelPending Orders\n        /// </summary>\n        public int GetCancelPendingOrdersSize => _cancelPendingOrders.Count;\n\n        /// <summary>\n        /// Adds an order which will be canceled and we want to keep track of it Status in case of fallback\n        /// </summary>\n        /// <param name=\"orderId\">The order id</param>\n        /// <param name=\"status\">The order Status, before the cancel request</param>\n        public void Set(int orderId, OrderStatus status)\n        {\n            _cancelPendingOrders[orderId] = new CancelPendingOrder { Status = status };\n        }\n\n        /// <summary>\n        /// Updates an order that is pending to be canceled.\n        /// </summary>\n        /// <param name=\"newStatus\">The new status of the order. If its OrderStatus.Canceled or OrderStatus.Filled it will be removed</param>\n        /// <param name=\"orderId\">The id of the order</param>\n        public void UpdateOrRemove(int orderId, OrderStatus newStatus)\n        {\n            CancelPendingOrder cancelPendingOrder;\n            if (_cancelPendingOrders.TryGetValue(orderId, out cancelPendingOrder))\n            {\n                // The purpose of this pattern 'trygetvalue/lock/if containskey' is to guarantee that threads working on the same order will be correctly synchronized\n                // Thread 1 at HandleCancelOrderRequest() processing a failed cancel request will call RemoveAndFallback() and revert order status\n                // Thread 2 at HandleOrderEvent() with a filled order event will call UpdateOrRemove() and remove the order, ignoring its 'saved' status.\n                lock (cancelPendingOrder)\n                {\n                    if (newStatus.IsClosed())\n                    {\n                        RemoveOrderFromCollection(orderId);\n                    }\n                    else if (newStatus != OrderStatus.CancelPending)\n                    {\n                        // check again because it might of been removed by the failed to cancel event\n                        if (_cancelPendingOrders.ContainsKey(orderId))\n                        {\n                            _cancelPendingOrders[orderId].Status = newStatus;\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes an order which we failed to cancel and falls back the order Status to previous value\n        /// </summary>\n        /// <param name=\"order\">The order that failed to be canceled</param>\n        public void RemoveAndFallback(Order order)\n        {\n            CancelPendingOrder cancelPendingOrder;\n            if (_cancelPendingOrders.TryGetValue(order.Id, out cancelPendingOrder))\n            {\n                // The purpose of this pattern 'trygetvalue/lock/if containskey' is to guarantee that threads working on the same order will be correctly synchronized\n                // Thread 1 at HandleCancelOrderRequest() processing a failed cancel request will call RemoveAndFallback() and revert order status\n                // Thread 2 at HandleOrderEvent() with a filled order event will call UpdateOrRemove() and remove the order, ignoring its 'saved' status.\n                lock (cancelPendingOrder)\n                {\n                    if (_cancelPendingOrders.ContainsKey(order.Id))\n                    {\n                        // update Status before removing from _cancelPendingOrders\n                        order.Status = _cancelPendingOrders[order.Id].Status;\n                        RemoveOrderFromCollection(order.Id);\n                    }\n                }\n            }\n        }\n\n        private void RemoveOrderFromCollection(int orderId)\n        {\n            CancelPendingOrder cancelPendingOrderTrash;\n            _cancelPendingOrders.TryRemove(orderId, out cancelPendingOrderTrash);\n        }\n\n        private class CancelPendingOrder\n        {\n            public OrderStatus Status { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Engine/TransactionHandlers/ITransactionHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Lean.Engine.TransactionHandlers\n{\n    /// <summary>\n    /// Transaction handlers define how the transactions are processed and set the order fill information.\n    /// The pass this information back to the algorithm portfolio and ensure the cash and portfolio are synchronized.\n    /// </summary>\n    [InheritedExport(typeof(ITransactionHandler))]\n    public interface ITransactionHandler : IOrderProcessor, IOrderEventProvider\n    {\n        /// <summary>\n        /// Boolean flag indicating the thread is busy.\n        /// False indicates it is completely finished processing and ready to be terminated.\n        /// </summary>\n        bool IsActive\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets the permanent storage for all orders\n        /// </summary>\n        ConcurrentDictionary<int, Order> Orders\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Gets all order events\n        /// </summary>\n        IEnumerable<OrderEvent> OrderEvents { get; }\n\n        /// <summary>\n        /// Gets the permanent storage for all order tickets\n        /// </summary>\n        ConcurrentDictionary<int, OrderTicket> OrderTickets\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Initializes the transaction handler for the specified algorithm using the specified brokerage implementation\n        /// </summary>\n        void Initialize(IAlgorithm algorithm, IBrokerage brokerage, IResultHandler resultHandler);\n\n        /// <summary>\n        /// Signal a end of thread request to stop montioring the transactions.\n        /// </summary>\n        void Exit();\n\n        /// <summary>\n        /// Process any synchronous events from the primary algorithm thread.\n        /// </summary>\n        void ProcessSynchronousEvents();\n\n        /// <summary>\n        /// Register an already open Order\n        /// </summary>\n        void AddOpenOrder(Order order, IAlgorithm algorithm);\n    }\n}\n"
  },
  {
    "path": "Indicators/AbsolutePriceOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Absolute Price Oscillator (APO)\n    /// The Absolute Price Oscillator is calculated using the following formula:\n    /// APO[i] = FastMA[i] - SlowMA[i]\n    /// </summary>\n    /// <remarks>\n    /// The Absolute Price Oscillator is the same as a MACD with the signal period equal to the slow period.\n    /// </remarks>\n    public class AbsolutePriceOscillator : MovingAverageConvergenceDivergence\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AbsolutePriceOscillator\"/> class using the specified name and parameters.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        public AbsolutePriceOscillator(string name, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name, fastPeriod, slowPeriod, slowPeriod, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AbsolutePriceOscillator\"/> class using the specified parameters.\n        /// </summary> \n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        public AbsolutePriceOscillator(int fastPeriod, int slowPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"APO({fastPeriod},{slowPeriod})\", fastPeriod, slowPeriod, movingAverageType)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AccelerationBands.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Acceleration Bands created by Price Headley plots upper and lower envelope bands around a moving average.\n    /// </summary>\n    /// <seealso cref=\"Indicators.IndicatorBase{IBaseDataBar}\" />\n    public class AccelerationBands : IndicatorBase<IBaseDataBar>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly decimal _width;\n\n        /// <summary>\n        /// Gets the type of moving average\n        /// </summary>\n        public MovingAverageType MovingAverageType { get; }\n\n        /// <summary>\n        /// Gets the middle acceleration band (moving average)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> MiddleBand { get; }\n\n        /// <summary>\n        /// Gets the upper acceleration band  (High * ( 1 + Width * (High - Low) / (High + Low)))\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> UpperBand { get; }\n\n        /// <summary>\n        /// Gets the lower acceleration band  (Low * (1 - Width * (High - Low)/ (High + Low)))\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> LowerBand { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccelerationBands\" /> class.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator.</param>\n        /// <param name=\"period\">The period of the three moving average (middle, upper and lower band).</param>\n        /// <param name=\"width\">A coefficient specifying the distance between the middle band and upper or lower bands.</param>\n        /// <param name=\"movingAverageType\">Type of the moving average.</param>\n        public AccelerationBands(string name, int period, decimal width,\n            MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            _width = width;\n            MovingAverageType = movingAverageType;\n            MiddleBand = movingAverageType.AsIndicator(name + \"_MiddleBand\", period);\n            LowerBand = movingAverageType.AsIndicator(name + \"_LowerBand\", period);\n            UpperBand = movingAverageType.AsIndicator(name + \"_UpperBand\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccelerationBands\" /> class.\n        /// </summary>\n        /// <param name=\"period\">The period of the three moving average (middle, upper and lower band).</param>\n        /// <param name=\"width\">A coefficient specifying the distance between the middle band and upper or lower bands.</param>\n        /// <param name=\"movingAverageType\">Type of the moving average.</param>\n        public AccelerationBands(int period, decimal width,\n            MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"ABANDS({period},{width},{movingAverageType})\", period, width, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccelerationBands\" /> class.\n        /// </summary>\n        /// <param name=\"period\">The period of the three moving average (middle, upper and lower band).</param>\n        public AccelerationBands(int period)\n            : this(period, 4)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => MiddleBand.IsReady && LowerBand.IsReady && UpperBand.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            MiddleBand.Reset();\n            LowerBand.Reset();\n            UpperBand.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var coefficient = _width * (input.High - input.Low).SafeDivision(input.High + input.Low);\n\n            LowerBand.Update(input.EndTime, input.Low * (1 - coefficient));\n            UpperBand.Update(input.EndTime, input.High * (1 + coefficient));\n            MiddleBand.Update(input.EndTime, input.Close);\n\n            return MiddleBand.Current.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AccumulationDistribution.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Accumulation/Distribution (AD)\n    /// The Accumulation/Distribution is calculated using the following formula:\n    /// AD = AD + ((Close - Low) - (High - Close)) / (High - Low) * Volume\n    /// </summary>\n    public class AccumulationDistribution : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccumulationDistribution\"/> class using the specified name.\n        /// </summary>\n        public AccumulationDistribution()\n            : this(\"AD\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccumulationDistribution\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public AccumulationDistribution(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 0;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var range = input.High - input.Low;\n            return Current.Value + (range > 0 ? ((input.Close - input.Low) - (input.High - input.Close)) / range * input.Volume : 0m);\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AccumulationDistributionOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Accumulation/Distribution Oscillator (ADOSC)\n    /// The Accumulation/Distribution Oscillator is calculated using the following formula:\n    /// ADOSC = EMA(fast,AD) - EMA(slow,AD)\n    /// </summary>\n    public class AccumulationDistributionOscillator : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly AccumulationDistribution _ad;\n        private readonly ExponentialMovingAverage _emaFast;\n        private readonly ExponentialMovingAverage _emaSlow;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccumulationDistributionOscillator\"/> class using the specified parameters\n        /// </summary> \n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        public AccumulationDistributionOscillator(int fastPeriod, int slowPeriod)\n            : this($\"ADOSC({fastPeriod},{slowPeriod})\", fastPeriod, slowPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AccumulationDistributionOscillator\"/> class using the specified parameters\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        public AccumulationDistributionOscillator(string name, int fastPeriod, int slowPeriod)\n            : base(name)\n        {\n            _period = Math.Max(fastPeriod, slowPeriod);\n            _ad = new AccumulationDistribution(name + \"_AD\");\n            _emaFast = new ExponentialMovingAverage(name + \"_Fast\", fastPeriod);\n            _emaSlow = new ExponentialMovingAverage(name + \"_Slow\", slowPeriod);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            _ad.Update(input);\n            _emaFast.Update(_ad.Current);\n            _emaSlow.Update(_ad.Current);\n\n            return IsReady ? _emaFast.Current.Value - _emaSlow.Current.Value : 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _ad.Reset();\n            _emaFast.Reset();\n            _emaSlow.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AdvanceDeclineDifference.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Advance Decline Difference compute the difference between the number of stocks \n    /// that closed higher and the number of stocks that closed lower than their previous day's closing prices.\n    /// </summary>\n    public class AdvanceDeclineDifference : AdvanceDeclineIndicator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AdvanceDeclineDifference\"/> class\n        /// </summary>\n        public AdvanceDeclineDifference(string name = \"A/D Difference\")\n            : base(name, (entries) => entries.Count(), (advance, decline) => advance - decline) { }\n    }\n}\n"
  },
  {
    "path": "Indicators/AdvanceDeclineIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The advance-decline indicator compares the number of stocks \n    /// that closed higher against the number of stocks \n    /// that closed lower than their previous day's closing prices.\n    /// </summary>\n    public abstract class AdvanceDeclineIndicator : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private IDictionary<SecurityIdentifier, TradeBar> _previousPeriod = new Dictionary<SecurityIdentifier, TradeBar>();\n        private IDictionary<SecurityIdentifier, TradeBar> _currentPeriod = new Dictionary<SecurityIdentifier, TradeBar>();\n        private readonly Func<IEnumerable<TradeBar>, decimal> _computeSubValue;\n        private readonly Func<decimal, decimal, decimal> _computeMainValue;\n        private DateTime? _currentPeriodTime = null;\n        \n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AdvanceDeclineRatio\"/> class\n        /// </summary>\n        public AdvanceDeclineIndicator(string name, Func<IEnumerable<TradeBar>, decimal> computeSub, Func<decimal, decimal, decimal> computeMain)\n            : base(name)\n        {\n            _computeSubValue = computeSub;\n            _computeMainValue = computeMain;\n        }\n\n        /// <summary>\n        /// Add tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">tracking asset issue</param>\n        public virtual void Add(Symbol asset)\n        {\n            if (!_currentPeriod.ContainsKey(asset.ID))\n            {\n                _currentPeriod.Add(asset.ID, null);\n            }\n        }\n\n        /// <summary>\n        /// Deprecated\n        /// </summary>\n        [Obsolete(\"Please use Add(asset)\")]\n        public void AddStock(Symbol asset)\n        {\n            Add(asset);\n        }\n\n        /// <summary>\n        /// Remove tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">tracking asset issue</param>\n        public virtual void Remove(Symbol asset)\n        {\n            _currentPeriod.Remove(asset.ID);\n        }\n\n        /// <summary>\n        /// Deprecated\n        /// </summary>\n        [Obsolete(\"Please use Remove(asset)\")]\n        public void RemoveStock(Symbol asset)\n        {\n            Remove(asset);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _previousPeriod.Keys.Any();\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var advStocks = new List<TradeBar>();\n            var dclStocks = new List<TradeBar>();\n\n            TradeBar tradeBar;\n            foreach (var stock in _currentPeriod)\n            {\n                if (!_previousPeriod.TryGetValue(stock.Key, out tradeBar) || tradeBar == null)\n                {\n                    continue;\n                }\n                else if (stock.Value.Close < tradeBar.Close)\n                {\n                    dclStocks.Add(stock.Value);\n                }\n                else if (stock.Value.Close > tradeBar.Close)\n                {\n                    advStocks.Add(stock.Value);\n                }\n            }\n\n            return _computeMainValue(_computeSubValue(advStocks), _computeSubValue(dclStocks));\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override IndicatorResult ValidateAndComputeNextValue(TradeBar input)\n        {\n            Enqueue(input);\n\n            if (!_previousPeriod.Keys.Any() || _currentPeriod.Any(p => p.Value == null))\n            {\n                return new IndicatorResult(0, IndicatorStatus.ValueNotReady);\n            }\n\n            var vNext = ComputeNextValue(input);\n            return new IndicatorResult(vNext);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previousPeriod.Clear();\n            foreach (var key in _currentPeriod.Keys.ToList())\n            {\n                _currentPeriod[key] = null;\n            }\n\n            base.Reset();\n        }\n\n        private void Enqueue(TradeBar input)\n        {\n            if (input.EndTime == _currentPeriodTime)\n            {\n                _previousPeriod[input.Symbol.ID] = input;\n                return;\n            }\n\n            if (input.Time > _currentPeriodTime)\n            {\n                _previousPeriod.Clear();\n                foreach (var key in _currentPeriod.Keys.ToList())\n                {\n                    _previousPeriod[key] = _currentPeriod[key];\n                    _currentPeriod[key] = null;\n                }\n                _currentPeriodTime = input.Time;\n            }\n\n            if (_currentPeriod.ContainsKey(input.Symbol.ID) && (!_currentPeriodTime.HasValue || input.Time == _currentPeriodTime))\n            {\n                _currentPeriod[input.Symbol.ID] = input;\n                if (!_currentPeriodTime.HasValue)\n                {\n                    _currentPeriodTime = input.Time;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AdvanceDeclineRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The advance-decline ratio (ADR) compares the number of stocks \n    /// that closed higher against the number of stocks \n    /// that closed lower than their previous day's closing prices.\n    /// </summary>\n    public class AdvanceDeclineRatio : AdvanceDeclineIndicator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AdvanceDeclineRatio\"/> class\n        /// </summary>\n        public AdvanceDeclineRatio(string name = \"A/D Ratio\")\n            : base(name, (entries) => entries.Count(), (advance, decline) => decline == 0m ? advance : advance / decline) { }\n    }\n}\n"
  },
  {
    "path": "Indicators/AdvanceDeclineVolumeRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Advance Decline Volume Ratio is a Breadth indicator calculated as ratio of \n    /// summary volume of advancing stocks to summary volume of declining stocks. \n    /// AD Volume Ratio is used in technical analysis to see where the main trading activity is focused.\n    /// </summary>\n    public class AdvanceDeclineVolumeRatio : AdvanceDeclineIndicator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AdvanceDeclineVolumeRatio\"/> class\n        /// </summary>\n        public AdvanceDeclineVolumeRatio(string name = \"A/D Volume Rate\")\n            : base(name, (entries) => entries.Sum(x => x.Volume), (advance, decline) => decline == 0m ? advance : advance / decline) { }\n    }\n}\n"
  },
  {
    "path": "Indicators/Alpha.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// In financial analysis, the Alpha indicator is used to measure the performance of an investment (such as a stock or ETF) \n    /// relative to a benchmark index, often representing the broader market. Alpha indicates the excess return of the investment \n    /// compared to the return of the benchmark index. \n    /// \n    /// The S P 500 index is frequently used as a benchmark in Alpha calculations to represent the overall market performance. \n    /// Alpha is an essential tool for investors to understand the idiosyncratic returns of their investment that aren't caused\n    /// by movement in the underlying benchmark.\n    /// </summary>\n\n    public class Alpha : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Symbol of the reference used\n        /// </summary>\n        private readonly Symbol _referenceSymbol;\n\n        /// <summary>\n        /// Symbol of the target used\n        /// </summary>\n        private readonly Symbol _targetSymbol;\n\n        /// <summary>\n        /// Period of the indicator - alpha\n        /// </summary>\n        private readonly decimal _alphaPeriod;\n\n        /// <summary>\n        /// Rate of change of the target symbol\n        /// </summary>\n        private readonly RateOfChange _targetROC;\n\n        /// <summary>\n        /// Rate of change of the reference symbol\n        /// </summary>\n        private readonly RateOfChange _referenceROC;\n\n        /// <summary>\n        /// Alpha of the target used in relation with the reference\n        /// </summary>\n        private decimal _alpha;\n\n        /// <summary>\n        /// Beta of the target used in relation with the reference\n        /// </summary>\n        private readonly Beta _beta;\n\n        /// <summary>\n        /// Interest rate model used to compute the risk free rate\n        /// </summary>\n        private readonly IRiskFreeInterestRateModel _riskFreeInterestRateModel;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _targetROC.IsReady && _beta.IsReady && _referenceROC.IsReady;\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, IRiskFreeInterestRateModel riskFreeRateModel)\n            : base(name)\n        {\n            // Assert that the target and reference symbols are not the same\n            if (targetSymbol == referenceSymbol)\n            {\n                throw new ArgumentException(\"The target and reference symbols cannot be the same.\");\n            }\n\n            // Assert that the period is greater than 2, otherwise the alpha can not be computed\n            if (alphaPeriod < 1)\n            {\n                throw new ArgumentException(\"The period must be equal or greater than 1.\");\n            }\n\n            // Assert that the beta period is greater than 2, otherwise the beta can not be computed\n            if (betaPeriod < 2)\n            {\n                throw new ArgumentException(\"The beta period must be equal or greater than 2.\");\n            }\n\n            _targetSymbol = targetSymbol;\n            _referenceSymbol = referenceSymbol;\n            _alphaPeriod = alphaPeriod;\n            _riskFreeInterestRateModel = riskFreeRateModel;\n\n            _targetROC = new RateOfChange($\"{name}_TargetROC\", alphaPeriod);\n            _referenceROC = new RateOfChange($\"{name}_ReferenceROC\", alphaPeriod);\n\n            _beta = new Beta($\"{name}_Beta\", _targetSymbol, _referenceSymbol, betaPeriod);\n\n            WarmUpPeriod = alphaPeriod >= betaPeriod ? alphaPeriod + 1 : betaPeriod + 1;\n\n            _alpha = 0m;\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRate\">The risk free rate of this indicator for given period</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, decimal? riskFreeRate = null)\n            : this(name, targetSymbol, referenceSymbol, alphaPeriod, betaPeriod, new ConstantRiskFreeRateInterestRateModel(riskFreeRate ?? 0m))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRate\">The risk free rate of this indicator for given period</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, decimal? riskFreeRate = null)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{alphaPeriod},{betaPeriod},{riskFreeRate})\", targetSymbol, referenceSymbol, alphaPeriod, betaPeriod, new ConstantRiskFreeRateInterestRateModel(riskFreeRate ?? 0m))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period value\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRate\">The risk free rate of this indicator for given period</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int period, decimal? riskFreeRate = null)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{period},{riskFreeRate})\", targetSymbol, referenceSymbol, period, period, new ConstantRiskFreeRateInterestRateModel(riskFreeRate ?? 0m))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period value\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRate\">The risk free rate of this indicator for given period</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int period, decimal? riskFreeRate = null)\n            : this(name, targetSymbol, referenceSymbol, period, period, new ConstantRiskFreeRateInterestRateModel(riskFreeRate ?? 0m))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, IRiskFreeInterestRateModel riskFreeRateModel)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{alphaPeriod},{betaPeriod})\", targetSymbol, referenceSymbol, alphaPeriod, betaPeriod, riskFreeRateModel)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period value\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int period, IRiskFreeInterestRateModel riskFreeRateModel)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{period})\", targetSymbol, referenceSymbol, period, period, riskFreeRateModel)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period value\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int period, IRiskFreeInterestRateModel riskFreeRateModel)\n            : this(name, targetSymbol, referenceSymbol, period, period, riskFreeRateModel)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, PyObject riskFreeRateModel)\n            : this(name, targetSymbol, referenceSymbol, alphaPeriod, betaPeriod, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"alphaPeriod\">Period of the indicator - alpha</param>\n        /// <param name=\"betaPeriod\">Period of the indicator - beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int alphaPeriod, int betaPeriod, PyObject riskFreeRateModel)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{alphaPeriod},{betaPeriod})\", targetSymbol, referenceSymbol, alphaPeriod, betaPeriod, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified target, reference, and period value\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(Symbol targetSymbol, Symbol referenceSymbol, int period, PyObject riskFreeRateModel)\n            : this($\"ALPHA({targetSymbol},{referenceSymbol},{period})\", targetSymbol, referenceSymbol, period, period, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Alpha indicator with the specified name, target, reference, and period value\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"targetSymbol\"></param>\n        /// <param name=\"referenceSymbol\"></param>\n        /// <param name=\"period\">Period of the indicator - alpha and beta</param>\n        /// <param name=\"riskFreeRateModel\">The risk free rate model of this indicator</param>\n        public Alpha(string name, Symbol targetSymbol, Symbol referenceSymbol, int period, PyObject riskFreeRateModel)\n            : this(name, targetSymbol, referenceSymbol, period, period, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\"></param>\n        /// <returns></returns>\n        /// <exception cref=\"ArgumentException\"></exception>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (input is null)\n            {\n                throw new ArgumentNullException(nameof(input));\n            }\n            var inputSymbol = input.Symbol;\n\n            if (inputSymbol == _targetSymbol)\n            {\n                _targetROC.Update(input.EndTime, input.Close);\n            }\n            else if (inputSymbol == _referenceSymbol)\n            {\n                _referenceROC.Update(input.EndTime, input.Close);\n            }\n            else\n            {\n                throw new ArgumentException($\"The input symbol {inputSymbol} is not the target or reference symbol.\");\n            }\n\n            _beta.Update(input);\n\n            if (_targetROC.Samples == _referenceROC.Samples && _referenceROC.Samples > 0)\n            {\n                ComputeAlpha();\n            }\n\n            return _alpha;\n        }\n\n        /// <summary>\n        /// Computes the alpha of the target used in relation with the reference and stores it in the _alpha field\n        /// </summary>\n        private void ComputeAlpha()\n        {\n            if (!_beta.IsReady || !_targetROC.IsReady || !_referenceROC.IsReady)\n            {\n                _alpha = 0m;\n                return;\n            }\n\n            var targetMean = _targetROC.Current.Value / _alphaPeriod;\n            var referenceMean = _referenceROC.Current.Value / _alphaPeriod;\n\n            var riskFreeRate = _riskFreeInterestRateModel.GetInterestRate(_targetROC.Current.EndTime);\n\n            _alpha = targetMean - (riskFreeRate + _beta.Current.Value * (referenceMean - riskFreeRate));\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _targetROC.Reset();\n            _referenceROC.Reset();\n            _beta.Reset();\n            _alpha = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ArmsIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Arms Index, also called the Short-Term Trading Index (TRIN) \n    /// is a technical analysis indicator that compares the number of advancing \n    /// and declining stocks (AD Ratio) to advancing and declining volume (AD volume).\n    /// </summary>\n    public class ArmsIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly IndicatorBase<IndicatorDataPoint> _arms;\n\n        /// <summary>\n        /// Gets the Advance/Decline Ratio (ADR) indicator\n        /// </summary>\n        public AdvanceDeclineRatio ADRatio { get; }\n\n        /// <summary>\n        /// Gets the Advance/Decline Volume Ratio (ADVR) indicator\n        /// </summary>\n        public AdvanceDeclineVolumeRatio ADVRatio { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ArmsIndex\"/> class\n        /// </summary>\n        public ArmsIndex(string name = \"TRIN\") : base(name)\n        {\n            ADRatio = new AdvanceDeclineRatio(name + \"_A/D Ratio\");\n            ADVRatio = new AdvanceDeclineVolumeRatio(name + \"_A/D Volume Ratio\");\n\n            _arms = ADRatio.Over(ADVRatio, name);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => ADRatio.IsReady && ADVRatio.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => System.Math.Max(ADRatio.WarmUpPeriod, ADVRatio.WarmUpPeriod);\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            ADRatio.Update(input);\n            ADVRatio.Update(input);\n\n            if (ADVRatio == 0)\n            {\n                return 0;\n            }\n\n            return _arms.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            ADRatio.Reset();\n            ADVRatio.Reset();\n            _arms.Reset();\n\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Add Tracking stock issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking stock issue</param>\n        public void Add(Symbol asset)\n        {\n            ADRatio.Add(asset);\n            ADVRatio.Add(asset);\n        }\n\n        /// <summary>\n        /// Deprecated\n        /// </summary>\n        [Obsolete(\"Please use Add(asset)\")]\n        public void AddStock(Symbol asset)\n        {\n            Add(asset);\n        }\n\n        /// <summary>\n        /// Remove Tracking stock issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking stock issue</param>\n        public void Remove(Symbol asset)\n        {\n            ADRatio.Remove(asset);\n            ADVRatio.Remove(asset);\n        }\n\n        /// <summary>\n        /// Deprecated\n        /// </summary>\n        [Obsolete(\"Please use Remove(asset)\")]\n        public void RemoveStock(Symbol asset)\n        {\n            Remove(asset);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ArnaudLegouxMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Smooth and high sensitive moving Average. This moving average reduce lag of the information\n    /// but still being smooth to reduce noises.\n    /// Is a weighted moving average, which weights have a Normal shape;\n    /// the parameters Sigma and Offset affect the kurtosis and skewness of the weights respectively.\n    /// Source: https://www.cjournal.cz/files/308.pdf\n    /// </summary>\n    /// <seealso cref=\"IndicatorDataPoint\" />\n    public class ArnaudLegouxMovingAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly decimal[] _weightVector;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _weightVector.Length;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ArnaudLegouxMovingAverage\" /> class.\n        /// </summary>\n        /// <param name=\"name\">string - a name for the indicator</param>\n        /// <param name=\"period\">int - the number of periods to calculate the ALMA</param>\n        /// <param name=\"sigma\">\n        /// int - this parameter is responsible for the shape of the curve coefficients. It affects the weight vector kurtosis.\n        /// </param>\n        /// <param name=\"offset\">\n        /// decimal - This parameter allows regulating the smoothness and high sensitivity of the\n        /// Moving Average. The range for this parameter is [0, 1]. It affects the weight vector skewness.\n        /// </param>\n        public ArnaudLegouxMovingAverage(string name, int period, int sigma = 6, decimal offset = 0.85m)\n            : base(name, period)\n        {\n            if (offset < 0 || offset > 1) throw new ArgumentException($\"Offset parameter range is [0,1]. Value: {offset}\", nameof(offset));\n\n            var m = Math.Floor(offset * (period - 1));\n            var s = period * 1m / sigma;\n\n            var tmpVector = Enumerable.Range(0, period)\n                .Select(i => Math.Exp((double) (-(i - m) * (i - m) / (2 * s * s))))\n                .ToArray();\n\n            _weightVector = tmpVector\n                .Select(i => (decimal) (i / tmpVector.Sum())).Reverse()\n                .ToArray();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ArnaudLegouxMovingAverage\" /> class.\n        /// </summary>\n        /// <param name=\"name\">string - a name for the indicator</param>\n        /// <param name=\"period\">int - the number of periods to calculate the ALMA.</param>\n        public ArnaudLegouxMovingAverage(string name, int period)\n            : this(name, period, 6)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ArnaudLegouxMovingAverage\" /> class.\n        /// </summary>\n        /// <param name=\"period\">int - the number of periods to calculate the ALMA</param>\n        /// <param name=\"sigma\">\n        /// int - this parameter is responsible for the shape of the curve coefficients. It affects the weight\n        /// vector kurtosis.\n        /// </param>\n        /// <param name=\"offset\">\n        /// decimal -  This parameter allows regulating the smoothness and high sensitivity of the Moving\n        /// Average. The range for this parameter is [0, 1]. It affects the weight vector skewness.\n        /// </param>\n        public ArnaudLegouxMovingAverage(int period, int sigma, decimal offset = 0.85m)\n            : this($\"ALMA({period},{sigma},{offset})\", period, sigma, offset)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ArnaudLegouxMovingAverage\" /> class.\n        /// </summary>\n        /// <param name=\"period\">int - the number of periods to calculate the ALMA.</param>\n        public ArnaudLegouxMovingAverage(int period)\n            : this(period, 6)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        /// <exception cref=\"System.NotImplementedException\"></exception>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window,\n            IndicatorDataPoint input)\n        {\n            return IsReady \n                ? window.Select((t, i) => t.Price * _weightVector[i]).Sum()\n                : input.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AroonOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Aroon Oscillator is the difference between AroonUp and AroonDown. The value of this\n    /// indicator fluctuates between -100 and +100. An upward trend bias is present when the oscillator\n    /// is positive, and a negative trend bias is present when the oscillator is negative. AroonUp/Down\n    /// values over 75 identify strong trends in their respective direction.\n    /// </summary>\n    public class AroonOscillator : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the AroonUp indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> AroonUp { get; }\n\n        /// <summary>\n        /// Gets the AroonDown indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> AroonDown { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => AroonUp.IsReady && AroonDown.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new AroonOscillator from the specified up/down periods.\n        /// </summary>\n        /// <param name=\"upPeriod\">The lookback period to determine the highest high for the AroonDown</param>\n        /// <param name=\"downPeriod\">The lookback period to determine the lowest low for the AroonUp</param>\n        public AroonOscillator(int upPeriod, int downPeriod)\n            : this($\"AROON({upPeriod},{downPeriod})\", upPeriod, downPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new AroonOscillator from the specified up/down periods.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"upPeriod\">The lookback period to determine the highest high for the AroonDown</param>\n        /// <param name=\"downPeriod\">The lookback period to determine the lowest low for the AroonUp</param>\n        public AroonOscillator(string name, int upPeriod, int downPeriod)\n            : base(name)\n        {\n            var max = new Maximum(name + \"_Max\", upPeriod + 1);\n            AroonUp = new FunctionalIndicator<IndicatorDataPoint>(name + \"_AroonUp\",\n                input => ComputeAroonUp(upPeriod, max, input),\n                aroonUp => max.IsReady,\n                () => max.Reset()\n                );\n\n            var min = new Minimum(name + \"_Min\", downPeriod + 1);\n            AroonDown = new FunctionalIndicator<IndicatorDataPoint>(name + \"_AroonDown\",\n                input => ComputeAroonDown(downPeriod, min, input),\n                aroonDown => min.IsReady,\n                () => min.Reset()\n                );\n\n            WarmUpPeriod = 1 + Math.Max(upPeriod, downPeriod);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            AroonUp.Update(input.EndTime, input.High);\n            AroonDown.Update(input.EndTime, input.Low);\n\n            return AroonUp.Current.Value - AroonDown.Current.Value;\n        }\n\n        /// <summary>\n        /// AroonUp = 100 * (period - {periods since max})/period\n        /// </summary>\n        /// <param name=\"upPeriod\">The AroonUp period</param>\n        /// <param name=\"max\">A Maximum indicator used to compute periods since max</param>\n        /// <param name=\"input\">The next input data</param>\n        /// <returns>The AroonUp value</returns>\n        private static decimal ComputeAroonUp(int upPeriod, Maximum max, IndicatorDataPoint input)\n        {\n            max.Update(input);\n            return 100m * (upPeriod - max.PeriodsSinceMaximum) / upPeriod;\n        }\n\n        /// <summary>\n        /// AroonDown = 100 * (period - {periods since min})/period\n        /// </summary>\n        /// <param name=\"downPeriod\">The AroonDown period</param>\n        /// <param name=\"min\">A Minimum indicator used to compute periods since min</param>\n        /// <param name=\"input\">The next input data</param>\n        /// <returns>The AroonDown value</returns>\n        private static decimal ComputeAroonDown(int downPeriod, Minimum min, IndicatorDataPoint input)\n        {\n            min.Update(input);\n            return 100m * (downPeriod - min.PeriodsSinceMinimum) / downPeriod;\n        }\n\n        /// <summary>\n        /// Resets this indicator and both sub-indicators (AroonUp and AroonDown)\n        /// </summary>\n        public override void Reset()\n        {\n            AroonUp.Reset();\n            AroonDown.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AugenPriceSpike.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Augen Price Spike indicator is an indicator that measures price \n    /// changes in terms of standard deviations. In the book, The\n    /// Volatility Edge in Options Trading, Jeff Augen describes a\n    /// method for tracking absolute price changes in terms of recent\n    /// volatility, using the standard deviation.\n    /// \n    /// length = x\n    /// closes = closeArray\n    /// closes1 = closeArray shifted right by 1\n    /// closes2 = closeArray shifted right by 2\n    /// closeLog = np.log(np.divide(closes1, closes2))\n    /// SDev = np.std(closeLog)\n    /// m = SDev * closes1[-1]\n    /// spike = (closes[-1]-closes1[-1])/m\n    /// return spike\n    /// \n    /// Augen Price Spike from TradingView\n    /// https://www.tradingview.com/script/fC7Pn2X2-Price-Spike-Jeff-Augen/  \n    /// \n    /// </summary>\n    public class AugenPriceSpike : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly StandardDeviation _standardDeviation;\n        private readonly RollingWindow<decimal> _rollingData;\n\n        /// <summary>\n        /// Initializes a new instance of the AugenPriceSpike class using the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public AugenPriceSpike(int period = 3)\n            : this($\"APS({period})\", period)\n        {\n        }\n        /// <summary>\n        /// Creates a new AugenPriceSpike indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        public AugenPriceSpike(string name, int period)\n            : base(name)\n        {\n            if (period < 3)\n            {\n                throw new ArgumentException(\"AugenPriceSpike Indicator must have a period of at least 3\", nameof(period));\n            }\n            _standardDeviation = new StandardDeviation(period);\n            _rollingData = new RollingWindow<decimal>(3);\n            WarmUpPeriod = period + 2;\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _rollingData.IsReady && _standardDeviation.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A a value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _rollingData.Add(input.Value);\n            if (_rollingData.Count < 3) { return 0m; }\n\n            var previousPoint = _rollingData[1];\n            var previousPoint2 = _rollingData[2];\n\n            var logPoint = 0.0;\n            // Ensure the logarithm operation is valid, as log(0) is undefined, and avoid division by zero.\n            if (previousPoint != 0 && previousPoint2 != 0)\n            {\n                logPoint = Math.Log((double)previousPoint / (double)previousPoint2);\n            }\n\n            _standardDeviation.Update(input.EndTime, (decimal)logPoint);\n\n            if (!_rollingData.IsReady) { return 0m; }\n            if (!_standardDeviation.IsReady) { return 0m; }\n\n            var m = _standardDeviation.Current.Value * previousPoint;\n            if (m == 0) { return 0; }\n\n            var spikeValue = (input.Value - previousPoint) / m;\n            return spikeValue;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _standardDeviation.Reset();\n            _rollingData.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AutoRegressiveIntegratedMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing MathNet.Numerics;\nusing MathNet.Numerics.LinearAlgebra.Double;\nusing MathNet.Numerics.LinearRegression;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// An Autoregressive Intergrated Moving Average (ARIMA) is a time series model which can be used to describe a set of data.\n    /// In particular,with Xₜ representing the series, the model assumes the data are of form\n    /// (after differencing <see cref=\"_diffOrder\" /> times):\n    /// <para>\n    ///     Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ +  Σᵢθᵢεₜ₋ᵢ\n    /// </para>\n    /// where the first sum has an upper limit of <see cref=\"_arOrder\" /> and the second <see cref=\"_maOrder\" />.\n    /// </summary>\n    public class AutoRegressiveIntegratedMovingAverage : TimeSeriesIndicator\n    {\n        private List<double> _residuals;\n        private readonly bool _intercept;\n        private bool _loggedOnceInMovingAverageStep;\n        private bool _loggedOnceInAutoRegressiveStep;\n        private readonly RollingWindow<double> _rollingData;\n\n        /// <summary>\n        /// Differencing coefficient (d). Determines how many times the series should be differenced before fitting the\n        /// model.\n        /// </summary>\n        private readonly int _diffOrder;\n\n        /// <summary>\n        /// AR coefficient -- p\n        /// </summary>\n        private readonly int _arOrder;\n\n        /// <summary>\n        /// MA Coefficient -- q\n        /// </summary>\n        private readonly int _maOrder;\n\n        /// <summary>\n        /// Whether or not to handle potential exceptions, returning a zero value. I.e, the values\n        /// provided as input are not valid by the Normal Equations direct regression method\n        /// </summary>\n        public bool HandleExceptions { get; set; } = true;\n\n        /// <summary>\n        /// Fitted AR parameters (φ terms).\n        /// </summary>\n        public double[] ArParameters { get; private set; }\n\n        /// <summary>\n        /// Fitted MA parameters (θ terms).\n        /// </summary>\n        public double[] MaParameters { get; private set; }\n\n        /// <summary>\n        /// Fitted intercept (c term).\n        /// </summary>\n        public double Intercept { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _rollingData.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// The variance of the residuals (Var(ε)) from the first step of <see cref=\"TwoStepFit\" />.\n        /// </summary>\n        public double ArResidualError { get; private set; }\n\n        /// <summary>\n        /// The variance of the residuals (Var(ε)) from the second step of <see cref=\"TwoStepFit\" />.\n        /// </summary>\n        public double MaResidualError { get; private set; }\n\n        /// <summary>\n        /// Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it <see cref=\"_diffOrder\" /> times):\n        /// <para>\n        ///     Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ +  Σᵢθᵢεₜ₋ᵢ\n        /// </para>\n        /// where the first sum has an upper limit of <see cref=\"_arOrder\" /> and the second <see cref=\"_maOrder\" />.\n        /// This particular constructor fits the model by means of <see cref=\"TwoStepFit\" /> for a specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"arOrder\">AR order (p) -- defines the number of past values to consider in the AR component of the model.</param>\n        /// <param name=\"diffOrder\">Difference order (d) -- defines how many times to difference the model before fitting parameters.</param>\n        /// <param name=\"maOrder\">MA order -- defines the number of past values to consider in the MA component of the model.</param>\n        /// <param name=\"period\">Size of the rolling series to fit onto</param>\n        /// <param name=\"intercept\">Whether or not to include the intercept term</param>\n        public AutoRegressiveIntegratedMovingAverage(\n            string name,\n            int arOrder,\n            int diffOrder,\n            int maOrder,\n            int period,\n            bool intercept = true\n            )\n            : base(name)\n        {\n            if (arOrder < 0 || maOrder < 0)\n            {\n                throw new ArgumentException(\"AR/MA orders cannot be negative.\");\n            }\n\n            if (arOrder == 0)\n            {\n                throw new ArgumentException(\"arOrder (p) must be greater than zero for all \" +\n                    \"currently available fitting methods.\");\n            }\n\n            if (period < Math.Max(arOrder, maOrder))\n            {\n                throw new ArgumentException(\"Period must exceed both arOrder and maOrder\");\n            }\n\n            _arOrder = arOrder;\n            _maOrder = maOrder;\n            _diffOrder = diffOrder;\n            WarmUpPeriod = period;\n            _rollingData = new RollingWindow<double>(period);\n            _intercept = intercept;\n        }\n\n        /// <summary>\n        /// Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it <see cref=\"_diffOrder\" /> times):\n        /// <para>\n        ///     Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ +  Σᵢθᵢεₜ₋ᵢ\n        /// </para>\n        /// where the first sum has an upper limit of <see cref=\"_arOrder\" /> and the second <see cref=\"_maOrder\" />.\n        /// This particular constructor fits the model by means of <see cref=\"TwoStepFit\" /> using ordinary least squares.\n        /// </summary>\n        /// <param name=\"arOrder\">AR order (p) -- defines the number of past values to consider in the AR component of the model.</param>\n        /// <param name=\"diffOrder\">Difference order (d) -- defines how many times to difference the model before fitting parameters.</param>\n        /// <param name=\"maOrder\">MA order (q) -- defines the number of past values to consider in the MA component of the model.</param>\n        /// <param name=\"period\">Size of the rolling series to fit onto</param>\n        /// <param name=\"intercept\">Whether to include an intercept term (c)</param>\n        public AutoRegressiveIntegratedMovingAverage(\n            int arOrder,\n            int diffOrder,\n            int maOrder,\n            int period,\n            bool intercept\n            )\n            : this($\"ARIMA(({arOrder}, {diffOrder}, {maOrder}), {period}, {intercept})\", arOrder, diffOrder, maOrder,\n                period, intercept)\n        {\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _rollingData.Reset();\n        }\n\n        /// <summary>\n        /// Forecasts the series of the fitted model one point ahead.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _rollingData.Add((double)input.Value);\n            if (_rollingData.IsReady)\n            {\n                var arrayData = _rollingData.ToArray();\n                double[] diffHeads = default;\n                arrayData = _diffOrder > 0 ? DifferenceSeries(_diffOrder, arrayData, out diffHeads) : arrayData;\n                _diffHeads = diffHeads;\n                TwoStepFit(arrayData);\n                double summants = 0;\n                if (_arOrder > 0)\n                {\n                    for (var i = 0; i < _arOrder; i++) // AR Parameters\n                    {\n                        summants += ArParameters[i] * arrayData[i];\n                    }\n                }\n\n                if (_maOrder > 0)\n                {\n                    for (var i = 0; i < _maOrder; i++) // MA Parameters\n                    {\n                        summants += MaParameters[i] * _residuals[_maOrder + i + 1];\n                    }\n                }\n\n                summants += Intercept; // By default equals 0\n\n                if (_diffOrder > 0)\n                {\n                    var dataCast = arrayData.ToList();\n                    dataCast.Insert(0, summants); // Prepends\n                    summants = InverseDifferencedSeries(dataCast.ToArray(), _diffHeads).First(); // Returns disintegrated series\n                }\n\n                return (decimal)summants;\n            }\n\n            return 0m;\n        }\n\n        /// <summary>\n        /// Fits the model by means of implementing the following pseudo-code algorithm (in the form of \"if{then}\"):\n        /// <code>\n        /// if diffOrder > 0 {Difference data diffOrder times}\n        /// if arOrder > 0 {Fit the AR model Xₜ = ΣᵢφᵢXₜ; ε's are set to residuals from fitting this.}\n        /// if maOrder > 0 {Fit the MA parameters left over  Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ +  Σᵢθᵢεₜ₋ᵢ}\n        /// Return: φ and θ estimates.\n        /// </code>\n        /// http://mbhauser.com/informal-notes/two-step-arma-estimation.pdf\n        /// </summary>\n        private void TwoStepFit(double[] series) // Protected for any future inheritors (e.g., SARIMA)\n        {\n            _residuals = new List<double>();\n            double errorAr = 0;\n            double errorMa = 0;\n            var lags = _arOrder > 0 ? LaggedSeries(_arOrder, series) : new[] {series};\n\n            AutoRegressiveStep(lags, series, errorAr);\n\n            if (_maOrder <= 0)\n            {\n                return;\n            }\n\n            MovingAverageStep(lags, series, errorMa);\n        }\n\n        /// <summary>\n        /// Fits the moving average component in the <see cref=\"TwoStepFit\"/> method.\n        /// </summary>\n        /// <param name=\"lags\">An array of lagged data (<see cref=\"TimeSeriesIndicator.LaggedSeries\"/>).</param>\n        /// <param name=\"data\">The input series, differenced <see cref=\"_diffOrder\"/> times.</param>\n        /// <param name=\"errorMa\">The summed residuals (by default 0) associated with the MA component.</param>\n        private void MovingAverageStep(double[][] lags, double[] data, double errorMa)\n        {\n            var appendedData = new List<double[]>();\n            var laggedErrors = LaggedSeries(_maOrder, _residuals.ToArray());\n            for (var i = 0; i < laggedErrors.Length; i++)\n            {\n                var doubles = lags[i].ToList();\n                doubles.AddRange(laggedErrors[i]);\n                appendedData.Add(doubles.ToArray());\n            }\n\n            double[] maFits = default;\n            if (HandleExceptions)\n            {\n                try\n                {\n                    maFits = Fit.MultiDim(appendedData.ToArray(), data.Skip(_maOrder).ToArray(),\n                method: DirectRegressionMethod.NormalEquations, intercept: _intercept);\n                }\n                catch (Exception ex)\n                {\n                    if (!_loggedOnceInMovingAverageStep)\n                    {\n                        Logging.Log.Error($\"AutoRegressiveIntegratedMovingAverage.MovingAverageStep(): {ex.Message}\");\n                        _loggedOnceInMovingAverageStep = true;\n                    }\n\n                    // The method Fit.MultiDim takes the appendedData array of mxn(m rows, n columns), computes its\n                    // transpose of size nxm, and then multiplies the tranpose with the original matrix, so the\n                    // resultant matrix is of size nxn. Then a linear system Ax=b is solved where A is the\n                    // aforementioned matrix and b is the data. Thus, the size of the response x is n\n                    //\n                    // It's worth saying that if intercept flag is set to true, the number of columns of the initial\n                    // matrix (appendedData) is increased in one. For more information, please see the implementation\n                    // of Fit.MultiDim() method (Ctrl + right click)\n                    var size = appendedData.ToArray()[0].Length + (_intercept ? 1 : 0);\n                    maFits = new double[size];\n                }\n            }\n            else\n            {\n                maFits = Fit.MultiDim(appendedData.ToArray(), data.Skip(_maOrder).ToArray(),\n                method: DirectRegressionMethod.NormalEquations, intercept: _intercept);\n            }\n\n            for (var i = _maOrder; i < data.Length; i++) // Calculate the error assoc. with model.\n            {\n                var paramVector = _intercept\n                    ? Vector.Build.Dense(maFits.Skip(1).ToArray())\n                    : Vector.Build.Dense(maFits);\n                var residual = data[i] - Vector.Build.Dense(appendedData[i - _maOrder]).DotProduct(paramVector);\n                errorMa += Math.Pow(residual, 2);\n            }\n\n            switch (_intercept)\n            {\n                case true:\n                    MaResidualError = errorMa / (data.Length - Math.Max(_arOrder, _maOrder) - 1);\n                    MaParameters = maFits.Skip(1 + _arOrder).ToArray();\n                    ArParameters = maFits.Skip(1).Take(_arOrder).ToArray();\n                    Intercept = maFits[0];\n                    break;\n                default:\n                    MaResidualError = errorMa / (data.Length - Math.Max(_arOrder, _maOrder) - 1);\n                    MaParameters = maFits.Skip(_arOrder).ToArray();\n                    ArParameters = maFits.Take(_arOrder).ToArray();\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Fits the autoregressive component in the <see cref=\"TwoStepFit\"/> method.\n        /// </summary>\n        /// <param name=\"lags\">An array of lagged data (<see cref=\"TimeSeriesIndicator.LaggedSeries\"/>).</param>\n        /// <param name=\"data\">The input series, differenced <see cref=\"_diffOrder\"/> times.</param>\n        /// <param name=\"errorAr\">The summed residuals (by default 0) associated with the AR component.</param>\n        private void AutoRegressiveStep(double[][] lags, double[] data, double errorAr)\n        {\n            double[] arFits;\n            if (HandleExceptions)\n            {\n                try\n                {\n                    // The function (lags[time][lagged X]) |---> ΣᵢφᵢXₜ₋ᵢ\n                    arFits = Fit.MultiDim(lags, data.Skip(_arOrder).ToArray(),\n                        method: DirectRegressionMethod.NormalEquations);\n                }\n                catch (Exception ex)\n                {\n                    if (!_loggedOnceInAutoRegressiveStep)\n                    {\n                        Logging.Log.Error($\"AutoRegressiveIntegratedMovingAverage.AutoRegressiveStep(): {ex.Message}\");\n                        _loggedOnceInAutoRegressiveStep = true;\n                    }\n\n                    // The method Fit.MultiDim takes the lags array of mxn(m rows, n columns), computes its\n                    // transpose of size nxm, and then multiplies the tranpose with the original matrix, so the\n                    // resultant matrix is of size nxn. Then a linear system Ax=b is solved where A is the\n                    // aforementioned matrix and b is the data. Thus, the size of the response x is n\n                    //\n                    // For more information, please see the implementation of Fit.MultiDim() method (Ctrl + right click)\n                    var size = lags.ToArray()[0].Length;\n                    arFits = new double[size];\n                }\n            }\n            else\n            {\n                // The function (lags[time][lagged X]) |---> ΣᵢφᵢXₜ₋ᵢ\n                arFits = Fit.MultiDim(lags, data.Skip(_arOrder).ToArray(),\n                    method: DirectRegressionMethod.NormalEquations);\n            }\n\n            var fittedVec = Vector.Build.Dense(arFits);\n\n            for (var i = 0; i < data.Length; i++) // Calculate the error assoc. with model.\n            {\n                if (i < _arOrder)\n                {\n                    _residuals.Add(0); // 0-padding\n                    continue;\n                }\n\n                var residual = data[i] - Vector.Build.Dense(lags[i - _arOrder]).DotProduct(fittedVec);\n                errorAr += Math.Pow(residual, 2);\n                _residuals.Add(residual);\n            }\n\n            ArResidualError = errorAr / (data.Length - _arOrder - 1);\n            if (_maOrder == 0)\n            {\n                ArParameters = arFits; // Will not be thrown out\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AverageDirectionalIndex.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes Average Directional Index which measures trend strength without regard to trend direction.\n    /// Firstly, it calculates the Directional Movement and the True Range value, and then the values are accumulated and smoothed\n    /// using a custom smoothing method proposed by Wilder. For an n period smoothing, 1/n of each period's value is added to the total period.\n    /// From these accumulated values we are therefore able to derived the 'Positive Directional Index' (+DI) and 'Negative Directional Index' (-DI)\n    /// which is used to calculate the Average Directional Index.\n    /// Computation source:\n    /// https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_directional_index_adx\n    /// </summary>\n    public class AverageDirectionalIndex : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly IndicatorBase<IBaseDataBar> _trueRange;\n        private readonly IndicatorBase<IBaseDataBar> _directionalMovementPlus;\n        private readonly IndicatorBase<IBaseDataBar> _directionalMovementMinus;\n        private readonly IndicatorBase<IndicatorDataPoint> _smoothedTrueRange;\n        private readonly IndicatorBase<IndicatorDataPoint> _smoothedDirectionalMovementPlus;\n        private readonly IndicatorBase<IndicatorDataPoint> _smoothedDirectionalMovementMinus;\n        private readonly IndicatorBase<IndicatorDataPoint> _averageDirectionalIndex;\n        private IBaseDataBar _previousInput;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _averageDirectionalIndex.IsReady;\n\n        /// <summary>\n        /// Gets the index of the Plus Directional Indicator\n        /// </summary>\n        /// <value>\n        /// The index of the Plus Directional Indicator.\n        /// </value>\n        public IndicatorBase<IndicatorDataPoint> PositiveDirectionalIndex { get; }\n\n        /// <summary>\n        /// Gets the index of the Minus Directional Indicator\n        /// </summary>\n        /// <value>\n        /// The index of the Minus Directional Indicator.\n        /// </value>\n        public IndicatorBase<IndicatorDataPoint> NegativeDirectionalIndex { get; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period * 2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AverageDirectionalIndex\"/> class.\n        /// </summary>\n        /// <param name=\"period\">The period.</param>\n        public AverageDirectionalIndex(int period)\n            : this($\"ADX({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AverageDirectionalIndex\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"period\">The period.</param>\n        public AverageDirectionalIndex(string name, int period)\n            : base(name)\n        {\n            _period = period;\n\n            _trueRange = new FunctionalIndicator<IBaseDataBar>(name + \"_TrueRange\",\n                ComputeTrueRange,\n                isReady => _previousInput != null\n                );\n\n            _directionalMovementPlus = new FunctionalIndicator<IBaseDataBar>(name + \"_PositiveDirectionalMovement\",\n                ComputePositiveDirectionalMovement,\n                isReady => _previousInput != null\n                );\n\n            _directionalMovementMinus = new FunctionalIndicator<IBaseDataBar>(name + \"_NegativeDirectionalMovement\",\n                ComputeNegativeDirectionalMovement,\n                isReady => _previousInput != null\n                );\n\n            PositiveDirectionalIndex = new FunctionalIndicator<IndicatorDataPoint>(name + \"_PositiveDirectionalIndex\",\n                input =>\n                {\n                    // Computes the Plus Directional Indicator(+DI period).\n                    if (_smoothedTrueRange != 0 && _smoothedDirectionalMovementPlus.IsReady)\n                    {\n                        return 100m * _smoothedDirectionalMovementPlus.Current.Value / _smoothedTrueRange.Current.Value;\n                    }\n                    return 0m;\n                },\n                positiveDirectionalIndex => _smoothedDirectionalMovementPlus.IsReady,\n                () =>\n                {\n                    _directionalMovementPlus.Reset();\n                    _trueRange.Reset();\n                }\n                );\n\n            NegativeDirectionalIndex = new FunctionalIndicator<IndicatorDataPoint>(name + \"_NegativeDirectionalIndex\",\n                input =>\n                {\n                    // Computes the Minus Directional Indicator(-DI period).\n                    if (_smoothedTrueRange != 0 && _smoothedDirectionalMovementMinus.IsReady)\n                    {\n                        return 100m * _smoothedDirectionalMovementMinus.Current.Value / _smoothedTrueRange.Current.Value;\n                    }\n                    return 0m;\n                },\n                negativeDirectionalIndex => _smoothedDirectionalMovementMinus.IsReady,\n                () =>\n                {\n                    _directionalMovementMinus.Reset();\n                    _trueRange.Reset();\n                }\n                );\n\n            _smoothedTrueRange = new FunctionalIndicator<IndicatorDataPoint>(name + \"_SmoothedTrueRange\",\n                input =>\n                {\n                    // Computes the Smoothed True Range value.\n                    var value = Samples > _period + 1 ? _smoothedTrueRange.Current.Value / _period : 0m;\n                    return _smoothedTrueRange.Current.Value + _trueRange.Current.Value - value;\n                },\n                isReady => Samples > period\n                );\n\n            _smoothedDirectionalMovementPlus = new FunctionalIndicator<IndicatorDataPoint>(name + \"_SmoothedDirectionalMovementPlus\",\n                input =>\n                {\n                    // Computes the Smoothed Directional Movement Plus value.\n                    var value = Samples > _period + 1 ? _smoothedDirectionalMovementPlus.Current.Value / _period : 0m;\n                    return _smoothedDirectionalMovementPlus.Current.Value + _directionalMovementPlus.Current.Value - value;\n                },\n                isReady => Samples > period\n                );\n\n            _smoothedDirectionalMovementMinus = new FunctionalIndicator<IndicatorDataPoint>(name + \"_SmoothedDirectionalMovementMinus\",\n                input =>\n                {\n                    // Computes the Smoothed Directional Movement Minus value.\n                    var value = Samples > _period + 1 ? _smoothedDirectionalMovementMinus.Current.Value / _period : 0m;\n                    return _smoothedDirectionalMovementMinus.Current.Value + _directionalMovementMinus.Current.Value - value;\n                },\n                isReady => Samples > period\n                );\n\n            _averageDirectionalIndex = new WilderMovingAverage(period);\n        }\n\n        /// <summary>\n        /// Computes the True Range value.\n        /// </summary>\n        /// <param name=\"input\">The input.</param>\n        /// <returns></returns>\n        private decimal ComputeTrueRange(IBaseDataBar input)\n        {\n            if (_previousInput == null) return 0m;\n\n            var range1 = input.High - input.Low;\n            var range2 = Math.Abs(input.High - _previousInput.Close);\n            var range3 = Math.Abs(input.Low - _previousInput.Close);\n\n            return Math.Max(range1, Math.Max(range2, range3));\n        }\n\n        /// <summary>\n        /// Computes the positive directional movement.\n        /// </summary>\n        /// <param name=\"input\">The input.</param>\n        /// <returns></returns>\n        private decimal ComputePositiveDirectionalMovement(IBaseDataBar input)\n        {\n            if (_previousInput != null &&\n                input.High > _previousInput.High &&\n                input.High - _previousInput.High >= _previousInput.Low - input.Low)\n            {\n                return input.High - _previousInput.High;\n            }\n            return 0m;\n        }\n\n        /// <summary>\n        /// Computes the negative directional movement.\n        /// </summary>\n        /// <param name=\"input\">The input.</param>\n        /// <returns></returns>\n        private decimal ComputeNegativeDirectionalMovement(IBaseDataBar input)\n        {\n            if (_previousInput != null &&\n                _previousInput.Low > input.Low &&\n                _previousInput.Low - input.Low > input.High - _previousInput.High)\n            {\n                return _previousInput.Low - input.Low;\n            }\n            return 0m;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _trueRange.Update(input);\n            _directionalMovementPlus.Update(input);\n            _directionalMovementMinus.Update(input);\n            _smoothedTrueRange.Update(Current);\n            _smoothedDirectionalMovementPlus.Update(Current);\n            _smoothedDirectionalMovementMinus.Update(Current);\n            _previousInput = input;\n\n            PositiveDirectionalIndex.Update(Current);\n            NegativeDirectionalIndex.Update(Current);\n\n            var diff = Math.Abs(PositiveDirectionalIndex.Current.Value - NegativeDirectionalIndex.Current.Value);\n            var sum = PositiveDirectionalIndex.Current.Value + NegativeDirectionalIndex.Current.Value;\n            if (sum == 0) return 50m;\n\n            _averageDirectionalIndex.Update(input.EndTime, 100m * diff / sum);\n\n            return _averageDirectionalIndex.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _previousInput = null;\n            _trueRange.Reset();\n            _directionalMovementPlus.Reset();\n            _directionalMovementMinus.Reset();\n            _smoothedTrueRange.Reset();\n            _smoothedDirectionalMovementPlus.Reset();\n            _smoothedDirectionalMovementMinus.Reset();\n            _averageDirectionalIndex.Reset();\n            PositiveDirectionalIndex.Reset();\n            NegativeDirectionalIndex.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AverageDirectionalMovementIndexRating.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Average Directional Movement Index Rating (ADXR). \n    /// The Average Directional Movement Index Rating is calculated with the following formula:\n    /// ADXR[i] = (ADX[i] + ADX[i - period + 1]) / 2\n    /// </summary>\n    public class AverageDirectionalMovementIndexRating : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly RollingWindow<decimal> _adxHistory;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AverageDirectionalMovementIndexRating\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the ADXR</param>\n        public AverageDirectionalMovementIndexRating(string name, int period) \n            : base(name)\n        {\n            _period = period;\n            ADX = new AverageDirectionalIndex(name + \"_ADX\", period);\n            _adxHistory = new RollingWindow<decimal>(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AverageDirectionalMovementIndexRating\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the ADXR</param>\n        public AverageDirectionalMovementIndexRating(int period)\n            : this($\"ADXR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// The Average Directional Index indicator instance being used\n        /// </summary>\n        public AverageDirectionalIndex ADX { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _adxHistory.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period * 3 - 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            ADX.Update(input);\n\n            if (ADX.IsReady)\n            {\n                _adxHistory.Add(ADX.Current.Value);\n            }\n\n            return IsReady ? (ADX.Current.Value + _adxHistory[_period - 1]) / 2 : 50m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            ADX.Reset();\n            _adxHistory.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AverageRange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the Average Range (AR) indicator, which calculates the average price range\n    /// </summary>\n    public class AverageRange : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The Simple Moving Average (SMA) used to calculate the average of the price ranges.\n        /// </summary>\n        private readonly SimpleMovingAverage _sma;\n\n        /// <summary>\n        /// Initializes a new instance of the AverageRange class with the specified name and period.\n        /// </summary>\n        /// <param name=\"name\">The name of the AR indicator.</param>\n        /// <param name=\"period\">The number of periods over which to compute the average range.</param>\n        public AverageRange(string name, int period) : base(name)\n        {\n            _sma = new SimpleMovingAverage(name + \"_SMA\", period);\n        }\n\n        /// <summary>\n        /// Initializes the AR indicator with the default name format and period.\n        /// </summary>\n        public AverageRange(int period)\n            : this($\"AR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Indicates whether the indicator has enough data to start producing valid results.\n        /// </summary>\n        public override bool IsReady => _sma.IsReady;\n\n        /// <summary>\n        /// The number of periods needed to fully initialize the AR indicator.\n        /// </summary>\n        public int WarmUpPeriod => _sma.WarmUpPeriod;\n\n        /// <summary>\n        /// Resets the indicator and clears the internal state, including the SMA.\n        /// </summary>\n        public override void Reset()\n        {\n            _sma.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of the Average Range (AR) by calculating the price range (high - low)\n        /// and passing it to the SMA to get the smoothed value.\n        /// </summary>\n        /// <param name=\"input\">The input data for the current bar, including open, high, low, close values.</param>\n        /// <returns>The computed AR value, which is the smoothed average of price ranges.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var priceRange = input.High - input.Low;\n            // Update the SMA with the price range\n            _sma.Update(new IndicatorDataPoint(input.EndTime, priceRange));\n            return _sma.Current.Value;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/AverageTrueRange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The AverageTrueRange indicator is a measure of volatility introduced by Welles Wilder in his\n    /// book: New Concepts in Technical Trading Systems. This indicator computes the TrueRange and then\n    /// smoothes the TrueRange over a given period.\n    ///\n    /// TrueRange is defined as the maximum of the following:\n    ///   High - Low\n    ///   ABS(High - PreviousClose)\n    ///   ABS(Low - PreviousClose)\n    /// </summary>\n    public class AverageTrueRange : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>This indicator is used to smooth the TrueRange computation</summary>\n        /// <remarks>This is not exposed publicly since it is the same value as this indicator, meaning\n        /// that this '_smoother' computers the ATR directly, so exposing it publicly would be duplication</remarks>\n        private readonly IndicatorBase<IndicatorDataPoint> _smoother;\n\n        /// <summary>\n        /// Gets the true range which is the more volatile calculation to be smoothed by this indicator\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> TrueRange { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _smoother.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new AverageTrueRange indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The smoothing period used to smooth the true range values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public AverageTrueRange(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            TrueRange = new TrueRange(name);\n            _smoother = movingAverageType.AsIndicator($\"{name}_{movingAverageType}\", period).Of(TrueRange, false);\n        }\n\n        /// <summary>\n        /// Creates a new AverageTrueRange indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"period\">The smoothing period used to smooth the true range values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public AverageTrueRange(int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : this($\"ATR({period})\", period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            // compute the true range and then send it to our smoother\n            TrueRange.Update(input);\n\n            return _smoother.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _smoother.Reset();\n            TrueRange.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/AwesomeOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Awesome Oscillator Indicator tracks the price midpoint-movement of a security. Specifically,\n    /// <para>\n    /// AO = MAfast[(H+L)/2] - MAslow[(H+L)/2] \n    /// </para>\n    /// where MAfast and MAslow denote simple moving averages wherein fast has a shorter period.\n    /// https://www.barchart.com/education/technical-indicators/awesome_oscillator\n    /// </summary>\n    public class AwesomeOscillator : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the indicators slow period moving average.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SlowAo { get; }\n\n        /// <summary>\n        /// Gets the indicators fast period moving average.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> FastAo { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => SlowAo.IsReady && FastAo.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new Awesome Oscillator from the specified periods.\n        /// </summary>\n        /// <param name=\"fastPeriod\">The period of the fast moving average associated with the AO</param>\n        /// <param name=\"slowPeriod\">The period of the slow moving average associated with the AO</param>\n        /// <param name=\"type\">The type of moving average used when computing the fast and slow term. Defaults to simple moving average.</param>\n        public AwesomeOscillator(int fastPeriod, int slowPeriod, MovingAverageType type = MovingAverageType.Simple)\n            : this($\"AO({fastPeriod},{slowPeriod},{type})\", fastPeriod, slowPeriod, type)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Awesome Oscillator from the specified periods.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The period of the fast moving average associated with the AO</param>\n        /// <param name=\"slowPeriod\">The period of the slow moving average associated with the AO</param>\n        /// <param name=\"type\">The type of moving average used when computing the fast and slow term. Defaults to simple moving average.</param>\n        public AwesomeOscillator(string name, int fastPeriod, int slowPeriod, MovingAverageType type = MovingAverageType.Simple)\n            : base(name)\n        {\n            SlowAo = type.AsIndicator(slowPeriod);\n            FastAo = type.AsIndicator(fastPeriod);\n            WarmUpPeriod = Math.Max(slowPeriod, fastPeriod);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var presentValue = (input.High + input.Low) / 2;\n            SlowAo.Update(input.EndTime, presentValue);\n            FastAo.Update(input.EndTime, presentValue);\n\n            return IsReady ? FastAo - SlowAo : 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator \n        /// </summary>\n        public override void Reset()\n        {\n            FastAo.Reset();\n            SlowAo.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/BalanceOfPower.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Balance Of Power (BOP).\n    /// The Balance Of Power is calculated with the following formula:\n    /// BOP = (Close - Open) / (High - Low)\n    /// </summary>\n    public class BalanceOfPower : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BalanceOfPower\"/> class using the specified name.\n        /// </summary>\n        public BalanceOfPower()\n            : this(\"BOP\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BalanceOfPower\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public BalanceOfPower(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 0;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var range = input.High - input.Low;\n            return range > 0 ? (input.Close - input.Open) / range : 0m;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/BarIndicator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The BarIndicator is an indicator that accepts IBaseDataBar data as its input.\n    /// \n    /// This type is more of a shim/typedef to reduce the need to refer to things as IndicatorBase&lt;IBaseDataBar&gt;\n    /// </summary>\n    public abstract class BarIndicator : IndicatorBase<IBaseDataBar>\n    {\n        /// <summary>\n        /// Creates a new TradeBarIndicator with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected BarIndicator(string name)\n            : base(name)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Beta.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing MathNet.Numerics.Statistics;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// In technical analysis Beta indicator is used to measure volatility or risk of a target (ETF) relative to the overall\n    /// risk (volatility) of the reference (market indexes). The Beta indicators compares target's price movement to the\n    /// movements of the indexes over the same period of time.\n    ///\n    /// It is common practice to use the SPX index as a benchmark of the overall reference market when it comes to Beta\n    /// calculations.\n    ///\n    /// The indicator only updates when both assets have a price for a time step. When a bar is missing for one of the assets,\n    /// the indicator value fills forward to improve the accuracy of the indicator.\n    /// </summary>\n    public class Beta : DualSymbolIndicator<IBaseDataBar>\n    {\n        /// <summary>\n        /// RollingWindow of returns of the target symbol in the given period\n        /// </summary>\n        private readonly RollingWindow<double> _targetReturns;\n\n        /// <summary>\n        /// RollingWindow of returns of the reference symbol in the given period\n        /// </summary>\n        private readonly RollingWindow<double> _referenceReturns;\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _targetReturns.IsReady && _referenceReturns.IsReady;\n\n        /// <summary>\n        /// Creates a new Beta indicator with the specified name, target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        public Beta(string name, Symbol targetSymbol, Symbol referenceSymbol, int period)\n            : base(name, targetSymbol, referenceSymbol, 2)\n        {\n            // Assert the period is greater than two, otherwise the beta can not be computed\n            if (period < 2)\n            {\n                throw new ArgumentException($\"Period parameter for Beta indicator must be greater than 2 but was {period}.\");\n            }\n\n            _targetReturns = new RollingWindow<double>(period);\n            _referenceReturns = new RollingWindow<double>(period);\n            WarmUpPeriod += (period - 2) + 1;\n        }\n\n        /// <summary>\n        /// Creates a new Beta indicator with the specified target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        public Beta(Symbol targetSymbol, Symbol referenceSymbol, int period)\n            : this($\"B({period})\", targetSymbol, referenceSymbol, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Beta indicator with the specified name, period, target and\n        /// reference values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <remarks>Constructor overload for backward compatibility.</remarks>\n        public Beta(string name, int period, Symbol targetSymbol, Symbol referenceSymbol)\n            : this(name, targetSymbol, referenceSymbol, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the returns with the new given data point and the last given data point\n        /// </summary>\n        /// <param name=\"rollingWindow\">The collection of data points from which we want\n        /// to compute the return</param>\n        /// <returns>The returns with the new given data point</returns>\n        private static double GetNewReturn(IReadOnlyWindow<IBaseDataBar> rollingWindow)\n        {\n            return (double)(rollingWindow[0].Close.SafeDivision(rollingWindow[1].Close) - 1);\n        }\n\n        /// <summary>\n        /// Computes the beta value of the target in relation with the reference\n        /// using the target and reference returns\n        /// </summary>\n        protected override decimal ComputeIndicator()\n        {\n            if (TargetDataPoints.IsReady)\n            {\n                _targetReturns.Add(GetNewReturn(TargetDataPoints));\n            }\n\n            if (ReferenceDataPoints.IsReady)\n            {\n                _referenceReturns.Add(GetNewReturn(ReferenceDataPoints));\n            }\n\n            var varianceComputed = _referenceReturns.Variance();\n            var covarianceComputed = _targetReturns.Covariance(_referenceReturns);\n\n            // Avoid division with NaN or by zero\n            var variance = !varianceComputed.IsNaNOrZero() ? varianceComputed : 1;\n            var covariance = !covarianceComputed.IsNaNOrZero() ? covarianceComputed : 0;\n            return (decimal)(covariance / variance);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _targetReturns.Reset();\n            _referenceReturns.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/BollingerBands.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator creates a moving average (middle band) with an upper band and lower band\n    /// fixed at k standard deviations above and below the moving average.\n    /// </summary>\n    public class BollingerBands : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the type of moving average\n        /// </summary>\n        public MovingAverageType MovingAverageType { get; }\n\n        /// <summary>\n        /// Gets the standard deviation\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> StandardDeviation { get; }\n\n        /// <summary>\n        /// Gets the middle Bollinger band (moving average)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> MiddleBand { get; }\n\n        /// <summary>\n        /// Gets the upper Bollinger band (middleBand + k * stdDev)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> UpperBand { get; }\n\n        /// <summary>\n        /// Gets the lower Bollinger band (middleBand - k * stdDev)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> LowerBand { get; }\n\n        /// <summary>\n        /// Gets the Bollinger BandWidth indicator\n        /// BandWidth = ((Upper Band - Lower Band) / Middle Band) * 100\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> BandWidth { get; }\n\n        /// <summary>\n        /// Gets the Bollinger %B\n        /// %B = (Price - Lower Band)/(Upper Band - Lower Band)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> PercentB { get; }\n\n        /// <summary>\n        /// Gets the Price level\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Price { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the BollingerBands class\n        /// </summary>\n        /// <param name=\"period\">The period of the standard deviation and moving average (middle band)</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the middle band and upper or lower bands</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public BollingerBands(int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"BB({period},{k})\", period, k, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the BollingerBands class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the standard deviation and moving average (middle band)</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the middle band and upper or lower bands</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public BollingerBands(string name, int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            MovingAverageType = movingAverageType;\n            StandardDeviation = new StandardDeviation(name + \"_StandardDeviation\", period);\n            MiddleBand = movingAverageType.AsIndicator(name + \"_MiddleBand\", period);\n            LowerBand = MiddleBand.Minus(StandardDeviation.Times(k), name + \"_LowerBand\");\n            UpperBand = MiddleBand.Plus(StandardDeviation.Times(k), name + \"_UpperBand\");\n\n            var UpperMinusLower = UpperBand.Minus(LowerBand);\n            BandWidth = UpperMinusLower\n                .Over(MiddleBand)\n                .Times(new ConstantIndicator<IndicatorDataPoint>(\"ct\", 100m), name + \"_BandWidth\");\n\n            Price = new Identity(name + \"_Close\");\n            PercentB = IndicatorExtensions.Over(\n                Price.Minus(LowerBand),\n                UpperMinusLower,\n                name + \"_%B\");\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => MiddleBand.IsReady && UpperBand.IsReady && LowerBand.IsReady && BandWidth.IsReady && PercentB.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of the following sub-indicators from the given state:\n        /// StandardDeviation, MiddleBand, UpperBand, LowerBand, BandWidth, %B\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>The input is returned unmodified.</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            StandardDeviation.Update(input);\n            MiddleBand.Update(input);\n            Price.Update(input);\n\n            return input.Value;\n        }\n\n        /// <summary>\n        /// Validate and Compute the next value for this indicator\n        /// </summary>\n        /// <param name=\"input\">Input for this indicator</param>\n        /// <returns><see cref=\"IndicatorResult\"/> of this update</returns>\n        /// <remarks>Override implemented to handle GH issue #4927</remarks>\n        protected override IndicatorResult ValidateAndComputeNextValue(IndicatorDataPoint input)\n        {\n            // Update our Indicators\n            var value = ComputeNextValue(input);\n\n            // If the STD = 0, we know that the our PercentB indicator will fail to update. This is\n            // because the denominator will be 0. When this is the case after fully ready we do not\n            // want the BollingerBands to emit an update because its PercentB property will be stale.\n            return IsReady && StandardDeviation.Current.Value == 0\n                ? new IndicatorResult(value, IndicatorStatus.MathError)\n                : new IndicatorResult(value);\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand, BandWidth, %B)\n        /// </summary>\n        public override void Reset()\n        {\n            StandardDeviation.Reset();\n            MiddleBand.Reset();\n            UpperBand.Reset();\n            LowerBand.Reset();\n            BandWidth.Reset();\n            PercentB.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/AbandonedBaby.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Abandoned Baby candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white (black) real body\n    /// - second candle: doji\n    /// - third candle: black(white) real body that moves well within the first candle's real body\n    /// - upside(downside) gap between the first candle and the doji(the shadows of the two candles don't touch)\n    /// - downside (upside) gap between the doji and the third candle(the shadows of the two candles don't touch)\n    /// The meaning of \"doji\" and \"long\" is specified with SetCandleSettings\n    /// The meaning of \"moves well within\" is specified with penetration and \"moves\" should mean the real body should\n    /// not be short (\"short\" is specified with SetCandleSettings) - Greg Morris wants it to be long, someone else want\n    /// it to be relatively long\n    /// The returned value is positive (+1) when it's an abandoned baby bottom or negative (-1) when it's\n    /// an abandoned baby top; the user should consider that an abandoned baby is significant when it appears in \n    /// an uptrend or downtrend, while this function does not consider the trend\n    /// </remarks>\n    public class AbandonedBaby : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AbandonedBaby\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public AbandonedBaby(string name, decimal penetration = 0.3m) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),\n                  CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2)\n        {\n            _penetration = penetration;\n\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AbandonedBaby\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public AbandonedBaby(decimal penetration)\n            : this(\"ABANDONEDBABY\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AbandonedBaby\"/> class.\n        /// </summary>\n        public AbandonedBaby()\n            : this(\"ABANDONEDBABY\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples > Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples > Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]);\n                }\n                if (Samples > Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, window[1]);\n                }\n                if (Samples > Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                // 2nd: doji\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[1]) &&\n                // 3rd: longer than short\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                ((\n                    // 1st white\n                    GetCandleColor(window[2]) == CandleColor.White &&\n                    // 3rd black\n                    GetCandleColor(input) == CandleColor.Black &&\n                    // 3rd closes well within 1st rb\n                    input.Close < window[2].Close - GetRealBody(window[2]) * _penetration &&\n                    // upside gap between 1st and 2nd\n                    GetCandleGapUp(window[1], window[2]) &&\n                    // downside gap between 2nd and 3rd\n                    GetCandleGapDown(input, window[1])\n                  )\n                  ||\n                  (\n                    // 1st black\n                    GetCandleColor(window[2]) == CandleColor.Black &&\n                    // 3rd white\n                    GetCandleColor(input) == CandleColor.White &&\n                    // 3rd closes well within 1st rb\n                    input.Close > window[2].Close + GetRealBody(window[2]) * _penetration &&\n                    // downside gap between 1st and 2nd\n                    GetCandleGapDown(window[1], window[2]) &&\n                    // upside gap between 2nd and 3rd\n                    GetCandleGapUp(input, window[1])\n                  )\n                )\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod - 1]);\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyDojiPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/AdvanceBlock.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Advance Block candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three white candlesticks with consecutively higher closes\n    /// - each candle opens within or near the previous white real body\n    /// - first candle: long white with no or very short upper shadow(a short shadow is accepted too for more flexibility)\n    /// - second and third candles, or only third candle, show signs of weakening: progressively smaller white real bodies\n    /// and/or relatively long upper shadows; see below for specific conditions\n    /// The meanings of \"long body\", \"short shadow\", \"far\" and \"near\" are specified with SetCandleSettings;\n    /// The returned value is negative(-1): advance block is always bearish;\n    /// The user should consider that advance block is significant when it appears in uptrend, while this function\n    /// does not consider it\n    /// </remarks>\n    public class AdvanceBlock : CandlestickPattern\n    {\n        private readonly int _shadowShortAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _nearAveragePeriod;\n        private readonly int _farAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _shadowShortPeriodTotal = new decimal[3];\n        private decimal[] _shadowLongPeriodTotal = new decimal[2];\n        private decimal[] _nearPeriodTotal = new decimal[3];\n        private decimal[] _farPeriodTotal = new decimal[3];\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AdvanceBlock\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public AdvanceBlock(string name) \n            : base(name, Math.Max(Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod),\n                  Math.Max(CandleSettings.Get(CandleSettingType.Far).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)),\n                  CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 2 + 1)\n        {\n            _shadowShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n            _farAveragePeriod = CandleSettings.Get(CandleSettingType.Far).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"AdvanceBlock\"/> class.\n    /// </summary>\n    public AdvanceBlock()\n            : this(\"ADVANCEBLOCK\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowShortAveragePeriod)\n                {\n                    _shadowShortPeriodTotal[2] += GetCandleRange(CandleSettingType.ShadowShort, window[2]);\n                    _shadowShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowShort, window[1]);\n                    _shadowShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowShort, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowLong, window[1]);\n                    _shadowLongPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal[2] += GetCandleRange(CandleSettingType.Near, window[2]);\n                    _nearPeriodTotal[1] += GetCandleRange(CandleSettingType.Near, window[1]);\n                }\n\n                if (Samples >= Period - _farAveragePeriod)\n                {\n                    _farPeriodTotal[2] += GetCandleRange(CandleSettingType.Far, window[2]);\n                    _farPeriodTotal[1] += GetCandleRange(CandleSettingType.Far, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                // 2nd white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                // 3rd white\n                GetCandleColor(input) == CandleColor.White &&\n                // consecutive higher closes\n                input.Close > window[1].Close && window[1].Close > window[2].Close &&\n                // 2nd opens within/near 1st real body\n                window[1].Open > window[2].Open &&\n                window[1].Open <= window[2].Close + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[2], window[2]) &&\n                // 3rd opens within/near 2nd real body\n                input.Open > window[1].Open &&\n                input.Open <= window[1].Close + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[1], window[1]) &&\n                // 1st: long real body\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                // 1st: short upper shadow\n                GetUpperShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal[2], window[2]) &&\n                (\n                    // ( 2 far smaller than 1 && 3 not longer than 2 )\n                    // advance blocked with the 2nd, 3rd must not carry on the advance\n                    (\n                        GetRealBody(window[1]) < GetRealBody(window[2]) - GetCandleAverage(CandleSettingType.Far, _farPeriodTotal[2], window[2]) &&\n                        GetRealBody(input) < GetRealBody(window[1]) + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[1], window[1])\n                    ) ||\n                    // 3 far smaller than 2\n                    // advance blocked with the 3rd\n                    (\n                        GetRealBody(input) < GetRealBody(window[1]) - GetCandleAverage(CandleSettingType.Far, _farPeriodTotal[1], window[1])\n                    ) ||\n                    // ( 3 smaller than 2 && 2 smaller than 1 && (3 or 2 not short upper shadow) )\n                    // advance blocked with progressively smaller real bodies and some upper shadows\n                    (\n                        GetRealBody(input) < GetRealBody(window[1]) &&\n                        GetRealBody(window[1]) < GetRealBody(window[2]) &&\n                        (\n                            GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal[0], input) ||\n                            GetUpperShadow(window[1]) > GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal[1], window[1])\n                        )\n                    ) ||\n                    // ( 3 smaller than 2 && 3 long upper shadow )\n                    // advance blocked with 3rd candle's long upper shadow and smaller body\n                    (\n                        GetRealBody(input) < GetRealBody(window[1]) &&\n                        GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal[0], input)\n                    )\n                )\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 2; i >= 0; i--)\n            {\n                _shadowShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowShort, window[i]) -\n                                              GetCandleRange(CandleSettingType.ShadowShort, window[i + _shadowShortAveragePeriod]);\n            }\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _shadowLongPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowLong, window[i]) -\n                                             GetCandleRange(CandleSettingType.ShadowLong, window[i + _shadowLongAveragePeriod]);\n            }\n\n            for (var i = 2; i >= 1; i--)\n            {\n                _farPeriodTotal[i] += GetCandleRange(CandleSettingType.Far, window[i]) -\n                                      GetCandleRange(CandleSettingType.Far, window[i + _farAveragePeriod]);\n                _nearPeriodTotal[i] += GetCandleRange(CandleSettingType.Near, window[i]) -\n                                       GetCandleRange(CandleSettingType.Near, window[i + _nearAveragePeriod]);\n            }\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) - \n                                    GetCandleRange(CandleSettingType.BodyLong, window[2 + _bodyLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowShortPeriodTotal = new decimal[3];\n            _shadowLongPeriodTotal = new decimal[2];\n            _nearPeriodTotal = new decimal[3];\n            _farPeriodTotal = new decimal[3];\n            _bodyLongPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/BeltHold.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Belt-hold candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - long white(black) real body\n    /// - no or very short lower(upper) shadow\n    /// The meaning of \"long\" and \"very short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white(bullish), negative(-1) when black(bearish)\n    /// </remarks>\n    public class BeltHold : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BeltHold\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public BeltHold(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BeltHold\"/> class.\n        /// </summary>\n        public BeltHold()\n            : this(\"BELTHOLD\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // long body\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, input) &&             \n                (\n                  ( \n                    // white body and very short lower shadow\n                    GetCandleColor(input) == CandleColor.White &&\n                    GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  ) ||\n                  ( \n                    // black body and very short upper shadow\n                    GetCandleColor(input) == CandleColor.Black &&\n                    GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  )\n                ))\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Breakaway.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Breakaway candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    ///  Must have:\n    /// - first candle: long black(white)\n    /// - second candle: black(white) day whose body gaps down(up)\n    /// - third candle: black or white day with lower(higher) high and lower(higher) low than prior candle's\n    /// - fourth candle: black(white) day with lower(higher) high and lower(higher) low than prior candle's\n    /// - fifth candle: white(black) day that closes inside the gap, erasing the prior 3 days\n    /// The meaning of \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that breakaway is significant in a trend opposite to the last candle, while this\n    /// function does not consider it\n    /// </remarks>\n    public class Breakaway : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Breakaway\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Breakaway(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 4 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Breakaway\"/> class.\n        /// </summary>\n        public Breakaway()\n            : this(\"BREAKAWAY\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[4]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st long\n                GetRealBody(window[4]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[4]) &&\n                // 1st, 2nd, 4th same color, 5th opposite\n                GetCandleColor(window[4]) == GetCandleColor(window[3]) &&\n                GetCandleColor(window[3]) == GetCandleColor(window[1]) &&\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                (\n                  (\n                    // when 1st is black:\n                    GetCandleColor(window[4]) == CandleColor.Black &&\n                    // 2nd gaps down\n                    GetRealBodyGapDown(window[3], window[4]) &&\n                    // 3rd has lower high and low than 2nd\n                    window[2].High < window[3].High && window[2].Low < window[3].Low &&\n                    // 4th has lower high and low than 3rd\n                    window[1].High < window[2].High && window[1].Low < window[2].Low &&\n                    // 5th closes inside the gap\n                    input.Close > window[3].Open && input.Close < window[4].Close\n                  )\n                  ||\n                  (\n                    // when 1st is white:\n                    GetCandleColor(window[4]) == CandleColor.White &&\n                    // 2nd gaps up\n                    GetRealBodyGapUp(window[3], window[4]) &&\n                    // 3rd has higher high and low than 2nd\n                    window[2].High > window[3].High && window[2].Low > window[3].Low &&\n                    // 4th has higher high and low than 3rd\n                    window[1].High > window[2].High && window[1].Low > window[2].Low &&\n                    // 5th closes inside the gap\n                    input.Close < window[3].Open && input.Close > window[4].Close\n                  )\n                )\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[4]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[4 + _bodyLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/CandleEnums.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Types of candlestick settings\n    /// </summary>\n    public enum CandleSettingType\n    {\n        /// <summary>\n        /// Real body is long when it's longer than the average of the 10 previous candles' real body (0)\n        /// </summary>\n        BodyLong,\n\n        /// <summary>\n        /// Real body is very long when it's longer than 3 times the average of the 10 previous candles' real body (1)\n        /// </summary>\n        BodyVeryLong,\n\n        /// <summary>\n        /// Real body is short when it's shorter than the average of the 10 previous candles' real bodies (2)\n        /// </summary>\n        BodyShort,\n\n        /// <summary>\n        /// Real body is like doji's body when it's shorter than 10% the average of the 10 previous candles' high-low range (3)\n        /// </summary>\n        BodyDoji,\n\n        /// <summary>\n        /// Shadow is long when it's longer than the real body (4)\n        /// </summary>\n        ShadowLong,\n\n        /// <summary>\n        /// Shadow is very long when it's longer than 2 times the real body (5)\n        /// </summary>\n        ShadowVeryLong,\n\n        /// <summary>\n        /// Shadow is short when it's shorter than half the average of the 10 previous candles' sum of shadows (6)\n        /// </summary>\n        ShadowShort,\n\n        /// <summary>\n        /// Shadow is very short when it's shorter than 10% the average of the 10 previous candles' high-low range (7)\n        /// </summary>\n        ShadowVeryShort,\n\n        /// <summary>\n        /// When measuring distance between parts of candles or width of gaps\n        /// \"near\" means \"&lt;= 20% of the average of the 5 previous candles' high-low range\" (8)\n        /// </summary>\n        Near,\n\n        /// <summary>\n        /// When measuring distance between parts of candles or width of gaps\n        /// \"far\" means \"&gt;= 60% of the average of the 5 previous candles' high-low range\" (9)\n        /// </summary>\n        Far,\n\n        /// <summary>\n        /// When measuring distance between parts of candles or width of gaps\n        /// \"equal\" means \"&lt;= 5% of the average of the 5 previous candles' high-low range\" (10)\n        /// </summary>\n        Equal\n    }\n\n    /// <summary>\n    /// Types of candlestick ranges\n    /// </summary>\n    public enum CandleRangeType\n    {\n        /// <summary>\n        /// The part of the candle between open and close (0)\n        /// </summary>\n        RealBody,\n\n        /// <summary>\n        /// The complete range of the candle (1)\n        /// </summary>\n        HighLow,\n\n        /// <summary>\n        /// The shadows (or tails) of the candle (2)\n        /// </summary>\n        Shadows\n    }\n\n    /// <summary>\n    /// Colors of a candle\n    /// </summary>\n    public enum CandleColor\n    {\n        /// <summary>\n        /// White is an up candle (close higher or equal than open) (1)\n        /// </summary>\n        White = 1,\n\n        /// <summary>\n        /// Black is a down candle (close lower than open) (-1)\n        /// </summary>\n        Black = -1\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/CandleSettings.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Candle settings for all candlestick patterns\n    /// </summary>\n    public static class CandleSettings\n    {\n        /// <summary>\n        /// Default settings for all candle setting types\n        /// </summary>\n        private static readonly Dictionary<CandleSettingType, CandleSetting> DefaultSettings = new Dictionary<CandleSettingType, CandleSetting>\n        {\n            { CandleSettingType.BodyLong, new CandleSetting(CandleRangeType.RealBody, 10, 1m) },\n            { CandleSettingType.BodyVeryLong, new CandleSetting(CandleRangeType.RealBody, 10, 3m) },\n            { CandleSettingType.BodyShort, new CandleSetting(CandleRangeType.RealBody, 10, 1m) },\n            { CandleSettingType.BodyDoji, new CandleSetting(CandleRangeType.HighLow, 10, 0.1m) },\n            { CandleSettingType.ShadowLong, new CandleSetting(CandleRangeType.RealBody, 0, 1m) },\n            { CandleSettingType.ShadowVeryLong, new CandleSetting(CandleRangeType.RealBody, 0, 2m) },\n            { CandleSettingType.ShadowShort, new CandleSetting(CandleRangeType.Shadows, 10, 1m) },\n            { CandleSettingType.ShadowVeryShort, new CandleSetting(CandleRangeType.HighLow, 10, 0.1m) },\n            { CandleSettingType.Near, new CandleSetting(CandleRangeType.HighLow, 5, 0.2m) },\n            { CandleSettingType.Far, new CandleSetting(CandleRangeType.HighLow, 5, 0.6m) },\n            { CandleSettingType.Equal, new CandleSetting(CandleRangeType.HighLow, 5, 0.05m) }\n        };\n\n        /// <summary>\n        /// Returns the candle setting for the requested type\n        /// </summary>\n        /// <param name=\"type\">The candle setting type</param>\n        public static CandleSetting Get(CandleSettingType type)\n        {\n            CandleSetting setting;\n            DefaultSettings.TryGetValue(type, out setting);\n            return setting;\n        }\n\n        /// <summary>\n        /// Changes the default candle setting for the requested type\n        /// </summary>\n        /// <param name=\"type\">The candle setting type</param>\n        /// <param name=\"setting\">The candle setting</param>\n        public static void Set(CandleSettingType type, CandleSetting setting)\n        {\n            DefaultSettings[type] = setting;\n        }\n    }\n\n    /// <summary>\n    /// Represents a candle setting\n    /// </summary>\n    public class CandleSetting\n    {\n        /// <summary>\n        /// The candle range type\n        /// </summary>\n        public CandleRangeType RangeType\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// The number of previous candles to average\n        /// </summary>\n        public int AveragePeriod\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// A multiplier to calculate candle ranges\n        /// </summary>\n        public decimal Factor\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Creates an instance of the <see cref=\"CandleSetting\"/> class\n        /// </summary>\n        /// <param name=\"rangeType\">The range type</param>\n        /// <param name=\"averagePeriod\">The average period</param>\n        /// <param name=\"factor\">The factor</param>\n        public CandleSetting(CandleRangeType rangeType, int averagePeriod, decimal factor)\n        {\n            RangeType = rangeType;\n            AveragePeriod = averagePeriod;\n            Factor = factor;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/CandlestickPattern.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Abstract base class for a candlestick pattern indicator\n    /// </summary>\n    public abstract class CandlestickPattern : WindowIndicator<IBaseDataBar>\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"CandlestickPattern\"/> with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The number of data points to hold in the window</param>\n        protected CandlestickPattern(string name, int period) \n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Returns the candle color of a candle\n        /// </summary>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static CandleColor GetCandleColor(IBaseDataBar tradeBar)\n        {\n            return tradeBar.Close >= tradeBar.Open ? CandleColor.White : CandleColor.Black;\n        }\n\n        /// <summary>\n        /// Returns the distance between the close and the open of a candle\n        /// </summary>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetRealBody(IBaseDataBar tradeBar)\n        {\n            return Math.Abs(tradeBar.Close - tradeBar.Open);\n        }\n\n        /// <summary>\n        /// Returns the full range of the candle\n        /// </summary>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetHighLowRange(IBaseDataBar tradeBar)\n        {\n            return tradeBar.High - tradeBar.Low;\n        }\n\n        /// <summary>\n        /// Returns the range of a candle\n        /// </summary>\n        /// <param name=\"type\">The type of setting to use</param>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetCandleRange(CandleSettingType type, IBaseDataBar tradeBar)\n        {\n            switch (CandleSettings.Get(type).RangeType)\n            {\n                case CandleRangeType.RealBody:\n                    return GetRealBody(tradeBar);\n                    \n                case CandleRangeType.HighLow:\n                    return GetHighLowRange(tradeBar);\n\n                case CandleRangeType.Shadows:\n                    return GetUpperShadow(tradeBar) + GetLowerShadow(tradeBar);\n\n                default:\n                    return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Returns true if the candle is higher than the previous one\n        /// </summary>\n        protected static bool GetCandleGapUp(IBaseDataBar tradeBar, IBaseDataBar previousBar)\n        {\n            return tradeBar.Low > previousBar.High;\n        }\n\n        /// <summary>\n        /// Returns true if the candle is lower than the previous one\n        /// </summary>\n        protected static bool GetCandleGapDown(IBaseDataBar tradeBar, IBaseDataBar previousBar)\n        {\n            return tradeBar.High < previousBar.Low;\n        }\n\n        /// <summary>\n        /// Returns true if the candle is higher than the previous one (with no body overlap)\n        /// </summary>\n        protected static bool GetRealBodyGapUp(IBaseDataBar tradeBar, IBaseDataBar previousBar)\n        {\n            return Math.Min(tradeBar.Open, tradeBar.Close) > Math.Max(previousBar.Open, previousBar.Close);\n        }\n\n        /// <summary>\n        /// Returns true if the candle is lower than the previous one (with no body overlap)\n        /// </summary>\n        protected static bool GetRealBodyGapDown(IBaseDataBar tradeBar, IBaseDataBar previousBar)\n        {\n            return Math.Max(tradeBar.Open, tradeBar.Close) < Math.Min(previousBar.Open, previousBar.Close);\n        }\n\n        /// <summary>\n        /// Returns the range of the candle's lower shadow\n        /// </summary>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetLowerShadow(IBaseDataBar tradeBar)\n        {\n            return (tradeBar.Close >= tradeBar.Open ? tradeBar.Open : tradeBar.Close) - tradeBar.Low;\n        }\n\n        /// <summary>\n        /// Returns the range of the candle's upper shadow\n        /// </summary>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetUpperShadow(IBaseDataBar tradeBar)\n        {\n            return tradeBar.High - (tradeBar.Close >= tradeBar.Open ? tradeBar.Close : tradeBar.Open);\n        }\n\n        /// <summary>\n        /// Returns the average range of the previous candles\n        /// </summary>\n        /// <param name=\"type\">The type of setting to use</param>\n        /// <param name=\"sum\">The sum of the previous candles ranges</param>\n        /// <param name=\"tradeBar\">The input candle</param>\n        protected static decimal GetCandleAverage(CandleSettingType type, decimal sum, IBaseDataBar tradeBar)\n        {\n            var defaultSetting = CandleSettings.Get(type);\n\n            return defaultSetting.Factor *\n                (defaultSetting.AveragePeriod != 0 ? sum / defaultSetting.AveragePeriod : GetCandleRange(type, tradeBar)) /\n                (defaultSetting.RangeType == CandleRangeType.Shadows ? 2.0m : 1.0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ClosingMarubozu.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Closing Marubozu candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - long white(black) real body\n    /// - no or very short upper(lower) shadow\n    /// The meaning of \"long\" and \"very short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white(bullish), negative(-1) when black(bearish)\n    /// </remarks>\n    public class ClosingMarubozu : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClosingMarubozu\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ClosingMarubozu(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ClosingMarubozu\"/> class.\n        /// </summary>\n        public ClosingMarubozu()\n            : this(\"CLOSINGMARUBOZU\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // long body\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, input) &&             \n                (\n                  ( \n                    // white body and very short upper shadow\n                    GetCandleColor(input) == CandleColor.White &&\n                    GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  ) ||\n                  ( \n                    // black body and very short lower shadow\n                    GetCandleColor(input) == CandleColor.Black &&\n                    GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  )\n                ))\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ConcealedBabySwallow.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Concealed Baby Swallow candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: black marubozu (very short shadows)\n    /// - second candle: black marubozu(very short shadows)\n    /// - third candle: black candle that opens gapping down but has an upper shadow that extends into the prior body\n    /// - fourth candle: black candle that completely engulfs the third candle, including the shadows\n    /// The meanings of \"very short shadow\" are specified with SetCandleSettings;\n    /// The returned value is positive(+1): concealing baby swallow is always bullish;\n    /// The user should consider that concealing baby swallow is significant when it appears in downtrend, while \n    /// this function does not consider it\n    /// </remarks>\n    public class ConcealedBabySwallow : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[4];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConcealedBabySwallow\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ConcealedBabySwallow(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 3 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConcealedBabySwallow\"/> class.\n        /// </summary>\n        public ConcealedBabySwallow()\n            : this(\"CONCEALEDBABYSWALLOW\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[3] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[3]);\n                    _shadowVeryShortPeriodTotal[2] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[2]);\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st black\n                GetCandleColor(window[3]) == CandleColor.Black &&\n                // 2nd black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // 3rd black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // 4th black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 1st: marubozu\n                GetLowerShadow(window[3]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[3], window[3]) &&\n                GetUpperShadow(window[3]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[3], window[3]) &&\n                // 2nd: marubozu\n                GetLowerShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[2], window[2]) &&\n                GetUpperShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[2], window[2]) &&\n                // 3rd: opens gapping down\n                GetRealBodyGapDown(window[1], window[2]) &&\n                //      and has an upper shadow\n                GetUpperShadow(window[1]) > GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                //      that extends into the prior body\n                window[1].High > window[2].Close &&\n                // 4th: engulfs the 3rd including the shadows\n                input.High > window[1].High && input.Low < window[1].Low\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 3; i >= 1; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[4];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Counterattack.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Counterattack candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black (white)\n    /// - second candle: long white(black) with close equal to the prior close\n    /// The meaning of \"equal\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that counterattack is significant in a trend, while this function does not consider it\n    /// </remarks>\n    public class Counterattack : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n        private decimal[] _bodyLongPeriodTotal = new decimal[2];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Counterattack\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Counterattack(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Equal).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Counterattack\"/> class.\n        /// </summary>\n        public Counterattack()\n            : this(\"COUNTERATTACK\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                    _bodyLongPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // opposite candles\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // 1st long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[1], window[1]) &&\n                // 2nd long\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[0], input) &&\n                // equal closes\n                input.Close <= window[1].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Close >= window[1].Close - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1])\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, input) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _bodyLongPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyLong, window[i]) -\n                                           GetCandleRange(CandleSettingType.BodyLong, window[i + _bodyLongAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0;\n            _bodyLongPeriodTotal = new decimal[2];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/DarkCloudCover.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Dark Cloud Cover candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white candle\n    /// - second candle: black candle that opens above previous day high and closes within previous day real body; \n    /// Greg Morris wants the close to be below the midpoint of the previous real body\n    /// The meaning of \"long\" is specified with SetCandleSettings, the penetration of the first real body is specified\n    /// with optInPenetration\n    /// The returned value is negative(-1): dark cloud cover is always bearish\n    /// The user should consider that a dark cloud cover is significant when it appears in an uptrend, while \n    /// this function does not consider it\n    /// </remarks>\n    public class DarkCloudCover : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DarkCloudCover\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public DarkCloudCover(string name, decimal penetration = 0.5m) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 1 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DarkCloudCover\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public DarkCloudCover(decimal penetration)\n            : this(\"DARKCLOUDCOVER\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DarkCloudCover\"/> class.\n        /// </summary>\n        public DarkCloudCover()\n            : this(\"DARKCLOUDCOVER\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                //      long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: black\n                GetCandleColor(input) == CandleColor.Black &&\n                //      open above prior high\n                input.Open > window[1].High &&\n                //      close within prior body\n                input.Close > window[1].Open &&\n                input.Close < window[1].Close - GetRealBody(window[1]) * _penetration\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Doji.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Doji candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - open quite equal to close\n    /// How much can be the maximum distance between open and close is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: doji shows uncertainty and it is\n    /// neither bullish nor bearish when considered alone\n    /// </remarks>\n    public class Doji : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Doji\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Doji(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Doji\"/> class.\n        /// </summary>\n        public Doji()\n            : this(\"DOJI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                return 0m;\n            }\n\n            var value = GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) ? 1m : 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/DojiStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Doji Star candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long real body\n    /// - second candle: star(open gapping up in an uptrend or down in a downtrend) with a doji\n    /// The meaning of \"doji\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// it's defined bullish when the long candle is white and the star gaps up, bearish when the long candle \n    /// is black and the star gaps down; the user should consider that a doji star is bullish when it appears\n    /// in an uptrend and it's bearish when it appears in a downtrend, so to determine the bullishness or \n    /// bearishness of the pattern the trend must be analyzed\n    /// </remarks>\n    public class DojiStar : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyDojiAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyDojiPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DojiStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public DojiStar(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod) + 1 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DojiStar\"/> class.\n        /// </summary>\n        public DojiStar()\n            : this(\"DOJISTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long real body\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: doji\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                //      that gaps up if 1st is white\n                ((GetCandleColor(window[1]) == CandleColor.White && GetRealBodyGapUp(input, window[1]))\n                    ||\n                    //      or down if 1st is black\n                    (GetCandleColor(window[1]) == CandleColor.Black && GetRealBodyGapDown(input, window[1]))\n                ))\n                value = -(int)GetCandleColor(window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _bodyDojiPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/DragonflyDoji.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Dragonfly Doji candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - doji body\n    /// - open and close at the high of the day = no or very short upper shadow\n    /// - lower shadow(to distinguish from other dojis, here lower shadow should not be very short)\n    /// The meaning of \"doji\" and \"very short\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: dragonfly doji must be considered\n    /// relatively to the trend\n    /// </remarks>\n    public class DragonflyDoji : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DragonflyDoji\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public DragonflyDoji(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DragonflyDoji\"/> class.\n        /// </summary>\n        public DragonflyDoji()\n            : this(\"DRAGONFLYDOJI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Engulfing.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Engulfing candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first: black (white) real body\n    /// - second: white(black) real body that engulfs the prior real body\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that an engulfing must appear in a downtrend if bullish or in an uptrend if bearish,\n    /// while this function does not consider it\n    /// </remarks>\n    public class Engulfing : CandlestickPattern\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Engulfing\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Engulfing(string name) \n            : base(name, 3)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Engulfing\"/> class.\n        /// </summary>\n        public Engulfing()\n            : this(\"ENGULFING\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // white engulfs black\n                (GetCandleColor(input) == CandleColor.White && GetCandleColor(window[1]) == CandleColor.Black &&\n                  input.Close > window[1].Open && input.Open < window[1].Close\n                )\n                ||\n                // black engulfs white\n                (GetCandleColor(input) == CandleColor.Black && GetCandleColor(window[1]) == CandleColor.White &&\n                  input.Open > window[1].Close && input.Close < window[1].Open\n                )\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0;\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/EveningDojiStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Evening Doji Star candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white real body\n    /// - second candle: doji gapping up\n    /// - third candle: black real body that moves well within the first candle's real body\n    /// The meaning of \"doji\" and \"long\" is specified with SetCandleSettings\n    /// The meaning of \"moves well within\" is specified with penetration and \"moves\" should mean the real body should\n    /// not be short (\"short\" is specified with SetCandleSettings) - Greg Morris wants it to be long, someone else want\n    /// it to be relatively long\n    /// The returned value is negative(-1): evening star is always bearish;\n    /// The user should consider that an evening star is significant when it appears in an uptrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class EveningDojiStar : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningDojiStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public EveningDojiStar(string name, decimal penetration = 0.3m) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),\n                  CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningDojiStar\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public EveningDojiStar(decimal penetration)\n            : this(\"EVENINGDOJISTAR\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningDojiStar\"/> class.\n        /// </summary>\n        public EveningDojiStar()\n            : this(\"EVENINGDOJISTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyDojiAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                // 2nd: doji\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[1]) &&\n                //      gapping up\n                GetRealBodyGapUp(window[1], window[2]) &&\n                // 3rd: longer than short\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                //      black real body\n                GetCandleColor(input) == CandleColor.Black &&\n                //      closing well within 1st rb\n                input.Close < window[2].Close - GetRealBody(window[2]) * _penetration\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyDojiPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/EveningStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Evening Star candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white real body\n    /// - second candle: star(short real body gapping up)\n    /// - third candle: black real body that moves well within the first candle's real body\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The meaning of \"moves well within\" is specified with penetration and \"moves\" should mean the real body should\n    /// not be short (\"short\" is specified with SetCandleSettings) - Greg Morris wants it to be long, someone else want\n    /// it to be relatively long\n    /// The returned value is negative(-1): evening star is always bearish;\n    /// The user should consider that an evening star is significant when it appears in an uptrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class EveningStar : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n        private decimal _bodyShortPeriodTotal2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public EveningStar(string name, decimal penetration = 0.3m) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 2 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningStar\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public EveningStar(decimal penetration)\n            : this(\"EVENINGSTAR\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"EveningStar\"/> class.\n        /// </summary>\n        public EveningStar()\n            : this(\"EVENINGSTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod && Samples < Period)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, window[1]);\n                    _bodyShortPeriodTotal2 += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                // 2nd: short\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, window[1]) &&\n                //      gapping up\n                GetRealBodyGapUp(window[1], window[2]) &&\n                // 3rd: longer than short\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal2, input) &&\n                //      black real body\n                GetCandleColor(input) == CandleColor.Black &&\n                //      closing well within 1st rb\n                input.Close < window[2].Close - GetRealBody(window[2]) * _penetration\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, window[1]) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal2 += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                      GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            _bodyShortPeriodTotal2 = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/GapSideBySideWhite.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Up/Down-gap side-by-side white lines candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - upside or downside gap (between the bodies)\n    /// - first candle after the window: white candlestick\n    /// - second candle after the window: white candlestick with similar size(near the same) and about the same\n    /// open(equal) of the previous candle\n    /// - the second candle does not close the window\n    /// The meaning of \"near\" and \"equal\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) or negative(-1): the user should consider that upside\n    /// or downside gap side-by-side white lines is significant when it appears in a trend, while this function\n    /// does not consider the trend\n    /// </remarks>\n    public class GapSideBySideWhite : CandlestickPattern\n    {\n        private readonly int _nearAveragePeriod;\n        private readonly int _equalAveragePeriod;\n\n        private decimal _nearPeriodTotal;\n        private decimal _equalPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GapSideBySideWhite\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public GapSideBySideWhite(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Near).AveragePeriod, CandleSettings.Get(CandleSettingType.Equal).AveragePeriod) + 2 + 1)\n        {\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GapSideBySideWhite\"/> class.\n        /// </summary>\n        public GapSideBySideWhite()\n            : this(\"GAPSIDEBYSIDEWHITE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[1]);\n                }\n\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                ( // upside or downside gap between the 1st candle and both the next 2 candles\n                  (GetRealBodyGapUp(window[1], window[2]) && GetRealBodyGapUp(input, window[2]))\n                  ||\n                  (GetRealBodyGapDown(window[1], window[2]) && GetRealBodyGapDown(input, window[2]))\n                ) &&\n                // 2nd: white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                // 3rd: white\n                GetCandleColor(input) == CandleColor.White &&\n                // same size 2 and 3\n                GetRealBody(input) >= GetRealBody(window[1]) - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1]) &&\n                GetRealBody(input) <= GetRealBody(window[1]) + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1]) &&\n                // same open 2 and 3\n                input.Open >= window[1].Open - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Open <= window[1].Open + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1])\n              )\n                value = GetRealBodyGapUp(window[1], window[2]) ? 1m : -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[1]) -\n                                GetCandleRange(CandleSettingType.Near, window[1 + _nearAveragePeriod]);\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[1 + _equalAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _nearPeriodTotal = 0;\n            _equalPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/GravestoneDoji.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Gravestone Doji candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - doji body\n    /// - open and close at the low of the day = no or very short lower shadow\n    /// - upper shadow(to distinguish from other dojis, here upper shadow should not be very short)\n    /// The meaning of \"doji\" and \"very short\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: gravestone doji must be considered\n    /// relatively to the trend\n    /// </remarks>\n    public class GravestoneDoji : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GravestoneDoji\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public GravestoneDoji(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"GravestoneDoji\"/> class.\n        /// </summary>\n        public GravestoneDoji()\n            : this(\"GRAVESTONEDOJI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Hammer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Hammer candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - small real body\n    /// - long lower shadow\n    /// - no, or very short, upper shadow\n    /// - body below or near the lows of the previous candle\n    /// The meaning of \"short\", \"long\" and \"near the lows\" is specified with SetCandleSettings;\n    /// The returned value is positive(+1): hammer is always bullish;\n    /// The user should consider that a hammer must appear in a downtrend, while this function does not consider it\n    /// </remarks>\n    public class Hammer : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _nearAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n        private decimal _nearPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Hammer\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Hammer(string name) \n            : base(name, Math.Max(Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod), CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 1 + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Hammer\"/> class.\n        /// </summary>\n        public Hammer()\n            : this(\"HAMMER\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // small rb\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // long lower shadow\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // very short upper shadow\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                // rb near the prior candle's lows\n                Math.Min(input.Close, input.Open) <= window[1].Low + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1])\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                    GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[1]) -\n                                GetCandleRange(CandleSettingType.Near, window[_nearAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            _shadowLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            _nearPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/HangingMan.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Hanging Man candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - small real body\n    /// - long lower shadow\n    /// - no, or very short, upper shadow\n    /// - body above or near the highs of the previous candle\n    /// The meaning of \"short\", \"long\" and \"near the highs\" is specified with SetCandleSettings;\n    /// The returned value is negative (-1): hanging man is always bearish;\n    /// The user should consider that a hanging man must appear in an uptrend, while this function does not consider it\n    /// </remarks>\n    public class HangingMan : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _nearAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n        private decimal _nearPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HangingMan\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public HangingMan(string name) \n            : base(name, Math.Max(Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod), CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 1 + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HangingMan\"/> class.\n        /// </summary>\n        public HangingMan()\n            : this(\"HANGINGMAN\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // small rb\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // long lower shadow\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // very short upper shadow\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                // rb near the prior candle's highs\n                Math.Min(input.Close, input.Open) >= window[1].High - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1])\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                    GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[1]) -\n                                GetCandleRange(CandleSettingType.Near, window[_nearAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            _shadowLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            _nearPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Harami.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Harami candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white (black) real body\n    /// - second candle: short real body totally engulfed by the first\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that a harami is significant when it appears in a downtrend if bullish or\n    /// in an uptrend when bearish, while this function does not consider the trend\n    /// </remarks>\n    public class Harami : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Harami\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Harami(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 1 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Harami\"/> class.\n        /// </summary>\n        public Harami()\n            : this(\"HARAMI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: short\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                //      engulfed by 1st\n                Math.Max(input.Close, input.Open) < Math.Max(window[1].Close, window[1].Open) &&\n                Math.Min(input.Close, input.Open) > Math.Min(window[1].Close, window[1].Open)\n              )\n                value = -(int)GetCandleColor(window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _bodyShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/HaramiCross.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Harami Cross candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white (black) real body\n    /// - second candle: doji totally engulfed by the first\n    /// The meaning of \"doji\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that a harami cross is significant when it appears in a downtrend if bullish or\n    /// in an uptrend when bearish, while this function does not consider the trend\n    /// </remarks>\n    public class HaramiCross : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyDojiAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyDojiPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HaramiCross\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public HaramiCross(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod) + 1 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HaramiCross\"/> class.\n        /// </summary>\n        public HaramiCross()\n            : this(\"HARAMICROSS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: doji\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                //      engulfed by 1st\n                Math.Max(input.Close, input.Open) < Math.Max(window[1].Close, window[1].Open) &&\n                Math.Min(input.Close, input.Open) > Math.Min(window[1].Close, window[1].Open)\n              )\n                value = -(int)GetCandleColor(window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                     GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _bodyDojiPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/HighWaveCandle.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// High-Wave Candle candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - short real body\n    /// - very long upper and lower shadow\n    /// The meaning of \"short\" and \"very long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white or negative(-1) when black;\n    /// it does not mean bullish or bearish\n    /// </remarks>\n    public class HighWaveCandle : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowVeryLongAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowVeryLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HighWaveCandle\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public HighWaveCandle(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod) + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _shadowVeryLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HighWaveCandle\"/> class.\n        /// </summary>\n        public HighWaveCandle()\n            : this(\"HIGHWAVECANDLE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowVeryLongAveragePeriod)\n                {\n                    _shadowVeryLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowVeryLong, _shadowVeryLongPeriodTotal, input) &&\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowVeryLong, _shadowVeryLongPeriodTotal, input)\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowVeryLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryLong, input) -\n                                          GetCandleRange(CandleSettingType.ShadowVeryLong, window[_shadowVeryLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            _shadowVeryLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Hikkake.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Hikkake candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first and second candle: inside bar (2nd has lower high and higher low than 1st)\n    /// - third candle: lower high and lower low than 2nd(higher high and higher low than 2nd)\n    /// The returned value for the hikkake bar is positive(+1) or negative(-1) meaning bullish or bearish hikkake\n    /// Confirmation could come in the next 3 days with:\n    /// - a day that closes higher than the high(lower than the low) of the 2nd candle\n    /// The returned value for the confirmation bar is equal to 1 + the bullish hikkake result or -1 - the bearish hikkake result\n    /// Note: if confirmation and a new hikkake come at the same bar, only the new hikkake is reported(the new hikkake\n    /// overwrites the confirmation of the old hikkake)\n    /// </remarks>\n    public class Hikkake : CandlestickPattern\n    {\n        private int _patternIndex;\n        private int _patternResult;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Hikkake\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Hikkake(string name) \n            : base(name, 5 + 1)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Hikkake\"/> class.\n        /// </summary>\n        public Hikkake()\n            : this(\"HIKKAKE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= 3)\n                {\n                    // copy here the pattern recognition code below\n                    // 1st + 2nd: lower high and higher low\n                    if (window[1].High < window[2].High && window[1].Low > window[2].Low &&\n                        // (bull) 3rd: lower high and lower low\n                        ((input.High < window[1].High && input.Low < window[1].Low)\n                          ||\n                          // (bear) 3rd: higher high and higher low\n                          (input.High > window[1].High && input.Low > window[1].Low)\n                        )\n                    )\n                    {\n                        _patternResult = (input.High < window[1].High ? 1 : -1);\n                        _patternIndex = (int)Samples - 1;\n                    }\n                    else\n                        // search for confirmation if hikkake was no more than 3 bars ago\n                        if (Samples <= _patternIndex + 4 &&\n                            // close higher than the high of 2nd\n                            ((_patternResult > 0 && input.Close > window[(int)Samples - _patternIndex].High)\n                              ||\n                              // close lower than the low of 2nd\n                              (_patternResult < 0 && input.Close < window[(int)Samples - _patternIndex].Low)\n                            )\n                        )\n                        _patternIndex = 0;\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            // 1st + 2nd: lower high and higher low\n            if (window[1].High < window[2].High && window[1].Low > window[2].Low &&\n                // (bull) 3rd: lower high and lower low\n                ((input.High < window[1].High && input.Low < window[1].Low)\n                 ||\n                 // (bear) 3rd: higher high and higher low\n                 (input.High > window[1].High && input.Low > window[1].Low)\n                    )\n                )\n            {\n                _patternResult = (input.High < window[1].High ? 1 : -1);\n                _patternIndex = (int) Samples - 1;\n                value = _patternResult;\n            }\n            else\n            {\n                // search for confirmation if hikkake was no more than 3 bars ago\n                if (Samples <= _patternIndex + 4 &&\n                    // close higher than the high of 2nd\n                    ((_patternResult > 0 && input.Close > window[(int) Samples - _patternIndex].High)\n                     ||\n                     // close lower than the low of 2nd\n                     (_patternResult < 0 && input.Close < window[(int) Samples - _patternIndex].Low)\n                        )\n                    )\n                {\n                    value = _patternResult + (_patternResult > 0 ? 1 : -1);\n                    _patternIndex = 0;\n                }\n                else\n                    value = 0;\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _patternIndex = 0;\n            _patternResult = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/HikkakeModified.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Hikkake Modified candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle\n    /// - second candle: candle with range less than first candle and close near the bottom(near the top)\n    /// - third candle: lower high and higher low than 2nd\n    /// - fourth candle: lower high and lower low(higher high and higher low) than 3rd\n    /// The returned value for the hikkake bar is positive(+1) or negative(-1) meaning bullish or bearish hikkake\n    /// Confirmation could come in the next 3 days with:\n    /// - a day that closes higher than the high(lower than the low) of the 3rd candle\n    /// The returned value for the confirmation bar is equal to 1 + the bullish hikkake result or -1 - the bearish hikkake result\n    /// Note: if confirmation and a new hikkake come at the same bar, only the new hikkake is reported(the new hikkake\n    /// overwrites the confirmation of the old hikkake);\n    /// The user should consider that modified hikkake is a reversal pattern, while hikkake could be both a reversal\n    /// or a continuation pattern, so bullish(bearish) modified hikkake is significant when appearing in a downtrend(uptrend)\n    /// </remarks>\n    public class HikkakeModified : CandlestickPattern\n    {\n        private readonly int _nearAveragePeriod;\n\n        private decimal _nearPeriodTotal;\n\n        private int _patternIndex;\n        private int _patternResult;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HikkakeModified\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public HikkakeModified(string name) \n            : base(name, Math.Max(1, CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 5 + 1)\n        {\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HikkakeModified\"/> class.\n        /// </summary>\n        public HikkakeModified()\n            : this(\"HIKKAKEMODIFIED\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _nearAveragePeriod - 3 && Samples < Period - 3)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[2]);\n                }\n\n                else if (Samples >= Period - 3)\n                {\n                        // copy here the pattern recognition code below\n                        // 2nd: lower high and higher low than 1st\n                        if (window[2].High < window[3].High && window[2].Low > window[3].Low &&\n                        // 3rd: lower high and higher low than 2nd\n                        window[1].High < window[2].High && window[1].Low > window[2].Low &&\n                        // (bull) 4th: lower high and lower low\n                        ((input.High < window[1].High && input.Low < window[1].Low &&\n                          // (bull) 2nd: close near the low\n                          window[2].Close <= window[2].Low + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[2])\n                            )\n                         ||\n                         // (bear) 4th: higher high and higher low\n                         (input.High > window[1].High && input.Low > window[1].Low &&\n                          // (bull) 2nd: close near the top\n                          window[2].Close >= window[2].High - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[2])\n                             )\n                            )\n                        )\n                    {\n                        _patternResult = (input.High < window[1].High ? 1 : -1);\n                        _patternIndex = (int) Samples - 1;\n                    }\n                    else\n                    {\n                        // search for confirmation if modified hikkake was no more than 3 bars ago\n                        if (Samples <= _patternIndex + 4 &&\n                            // close higher than the high of 3rd\n                            ((_patternResult > 0 && input.Close > window[(int) Samples - _patternIndex].High)\n                             ||\n                             // close lower than the low of 3rd\n                             (_patternResult < 0 && input.Close < window[(int) Samples - _patternIndex].Low))\n                                )\n                            _patternIndex = 0;\n                    }\n\n                    // add the current range and subtract the first range: this is done after the pattern recognition \n                    // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[2]) -\n                                        GetCandleRange(CandleSettingType.Near, window[(int)Samples - 1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            // 2nd: lower high and higher low than 1st\n            if (window[2].High < window[3].High && window[2].Low > window[3].Low &&\n                // 3rd: lower high and higher low than 2nd\n                window[1].High < window[2].High && window[1].Low > window[2].Low &&\n                // (bull) 4th: lower high and lower low\n                ((input.High < window[1].High && input.Low < window[1].Low &&\n                  // (bull) 2nd: close near the low\n                  window[2].Close <= window[2].Low + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[2])\n                    )\n                 ||\n                 // (bear) 4th: higher high and higher low\n                 (input.High > window[1].High && input.Low > window[1].Low &&\n                  // (bull) 2nd: close near the top\n                  window[2].Close >= window[2].High - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[2])\n                     )\n                    )\n                )\n            {\n                _patternResult = (input.High < window[1].High ? 1 : -1);\n                _patternIndex = (int) Samples - 1;\n                value = _patternResult;\n            }\n            else\n            {\n                // search for confirmation if modified hikkake was no more than 3 bars ago\n                if (Samples <= _patternIndex + 4 &&\n                    // close higher than the high of 3rd\n                    ((_patternResult > 0 && input.Close > window[(int)Samples - _patternIndex].High)\n                     ||\n                     // close lower than the low of 3rd\n                     (_patternResult < 0 && input.Close < window[(int)Samples - _patternIndex].Low))\n                        )\n                {\n                    value = _patternResult + (_patternResult > 0 ? 1 : -1);\n                    _patternIndex = 0;\n                }\n                else\n                    value = 0;\n            }\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[2]) -\n                                GetCandleRange(CandleSettingType.Near, window[_nearAveragePeriod + 5]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _nearPeriodTotal = 0;\n            _patternIndex = 0;\n            _patternResult = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/HomingPigeon.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Homing Pigeon candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: short black real body completely inside the previous day's body\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1): homing pigeon is always bullish;\n    /// The user should consider that homing pigeon is significant when it appears in a downtrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class HomingPigeon : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HomingPigeon\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public HomingPigeon(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 1 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HomingPigeon\"/> class.\n        /// </summary>\n        public HomingPigeon()\n            : this(\"HOMINGPIGEON\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // 2nd black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 1st long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd short\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // 2nd engulfed by 1st\n                input.Open < window[1].Open &&\n                input.Close > window[1].Close\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _bodyShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/IdenticalThreeCrows.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Identical Three Crows candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three consecutive and declining black candlesticks\n    /// - each candle must have no or very short lower shadow\n    /// - each candle after the first must open at or very close to the prior candle's close\n    /// The meaning of \"very short\" is specified with SetCandleSettings;\n    /// the meaning of \"very close\" is specified with SetCandleSettings(Equal);\n    /// The returned value is negative(-1): identical three crows is always bearish;\n    /// The user should consider that identical 3 crows is significant when it appears after a mature advance or at high levels,\n    /// while this function does not consider it\n    /// </remarks>\n    public class IdenticalThreeCrows : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _equalAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[3];\n        private decimal[] _equalPeriodTotal = new decimal[3];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IdenticalThreeCrows\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public IdenticalThreeCrows(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.Equal).AveragePeriod) + 2 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IdenticalThreeCrows\"/> class.\n        /// </summary>\n        public IdenticalThreeCrows()\n            : this(\"IDENTICALTHREECROWS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[2] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[2]);\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal[2] += GetCandleRange(CandleSettingType.Near, window[2]);\n                    _equalPeriodTotal[1] += GetCandleRange(CandleSettingType.Near, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[2], window[2]) &&\n                // 2nd black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 3rd black\n                GetCandleColor(input) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                // three declining\n                window[2].Close > window[1].Close &&\n                window[1].Close > input.Close &&\n                // 2nd black opens very close to 1st close\n                window[1].Open <= window[2].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal[2], window[2]) &&\n                window[1].Open >= window[2].Close - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal[2], window[2]) &&\n                // 3rd black opens very close to 2nd close \n                input.Open <= window[1].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal[1], window[1]) &&\n                input.Open >= window[1].Close - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal[1], window[1])\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 2; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n            }\n\n            for (var i = 2; i >= 1; i--)\n            {\n                _equalPeriodTotal[i] += GetCandleRange(CandleSettingType.Equal, window[i]) -\n                                       GetCandleRange(CandleSettingType.Equal, window[i + _equalAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[3];\n            _equalPeriodTotal = new decimal[3];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/InNeck.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// In-Neck candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: white candle with open below previous day low and close slightly into previous day body\n    /// The meaning of \"equal\" is specified with SetCandleSettings\n    /// The returned value is negative(-1): in-neck is always bearish\n    /// The user should consider that in-neck is significant when it appears in a downtrend, while this function\n    /// does not consider it\n    /// </remarks>\n    public class InNeck : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InNeck\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public InNeck(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Equal).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InNeck\"/> class.\n        /// </summary>\n        public InNeck()\n            : this(\"INNECK\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: white\n                GetCandleColor(input) == CandleColor.White &&\n                //      open below prior low\n                input.Open < window[1].Low &&\n                //      close slightly into prior body\n                input.Close <= window[1].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Close >= window[1].Close\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0m;\n            _bodyLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/InvertedHammer.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Inverted Hammer candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - small real body\n    /// - long upper shadow\n    /// - no, or very short, lower shadow\n    /// - gap down\n    /// The meaning of \"short\", \"very short\" and \"long\" is specified with SetCandleSettings;\n    /// The returned value is positive(+1): inverted hammer is always bullish;\n    /// The user should consider that an inverted hammer must appear in a downtrend, while this function does not consider it\n    /// </remarks>\n    public class InvertedHammer : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InvertedHammer\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public InvertedHammer(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1 + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"InvertedHammer\"/> class.\n        /// </summary>\n        public InvertedHammer()\n            : this(\"INVERTEDHAMMER\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // small rb\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // long upper shadow\n                GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // very short lower shadow\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                // gap down\n                GetRealBodyGapDown(input, window[1])\n                )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                    GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            _shadowLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Kicking.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Kicking candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: marubozu\n    /// - second candle: opposite color marubozu\n    /// - gap between the two candles: upside gap if black then white, downside gap if white then black\n    /// The meaning of \"long body\" and \"very short shadow\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish\n    /// </remarks>\n    public class Kicking : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[2];\n        private decimal[] _bodyLongPeriodTotal = new decimal[2];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Kicking\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Kicking(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Kicking\"/> class.\n        /// </summary>\n        public Kicking()\n            : this(\"KICKING\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                    _bodyLongPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // opposite candles\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // 1st marubozu\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[1], window[1]) &&\n                GetUpperShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                GetLowerShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 2nd marubozu\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[0], input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                // gap\n                (\n                  (GetCandleColor(window[1]) == CandleColor.Black && GetCandleGapUp(input, window[1]))\n                  ||\n                  (GetCandleColor(window[1]) == CandleColor.White && GetCandleGapDown(input, window[1]))\n                )\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n\n                _bodyLongPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyLong, window[i]) -\n                                           GetCandleRange(CandleSettingType.BodyLong, window[i + _bodyLongAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[2];\n            _bodyLongPeriodTotal = new decimal[2];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/KickingByLength.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Kicking (bull/bear determined by the longer marubozu) candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: marubozu\n    /// - second candle: opposite color marubozu\n    /// - gap between the two candles: upside gap if black then white, downside gap if white then black\n    /// The meaning of \"long body\" and \"very short shadow\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish; the longer of the two\n    /// marubozu determines the bullishness or bearishness of this pattern\n    /// </remarks>\n    public class KickingByLength : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[2];\n        private decimal[] _bodyLongPeriodTotal = new decimal[2];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KickingByLength\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public KickingByLength(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KickingByLength\"/> class.\n        /// </summary>\n        public KickingByLength()\n            : this(\"KICKINGBYLENGTH\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                    _bodyLongPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // opposite candles\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // 1st marubozu\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[1], window[1]) &&\n                GetUpperShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                GetLowerShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 2nd marubozu\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[0], input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                // gap\n                (\n                  (GetCandleColor(window[1]) == CandleColor.Black && GetCandleGapUp(input, window[1]))\n                  ||\n                  (GetCandleColor(window[1]) == CandleColor.White && GetCandleGapDown(input, window[1]))\n                )\n              )\n                value = (int)GetCandleColor(GetRealBody(input) > GetRealBody(window[1]) ? input : window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n\n                _bodyLongPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyLong, window[i]) -\n                                           GetCandleRange(CandleSettingType.BodyLong, window[i + _bodyLongAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[2];\n            _bodyLongPeriodTotal = new decimal[2];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/LadderBottom.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Ladder Bottom candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three black candlesticks with consecutively lower opens and closes\n    /// - fourth candle: black candle with an upper shadow(it's supposed to be not very short)\n    /// - fifth candle: white candle that opens above prior candle's body and closes above prior candle's high\n    /// The meaning of \"very short\" is specified with SetCandleSettings\n    /// The returned value is positive (+1): ladder bottom is always bullish;\n    /// The user should consider that ladder bottom is significant when it appears in a downtrend,\n    /// while this function does not consider it\n    /// </remarks>\n    public class LadderBottom : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LadderBottom\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public LadderBottom(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 4 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LadderBottom\"/> class.\n        /// </summary>\n        public LadderBottom()\n            : this(\"LADDERBOTTOM\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 3 black candlesticks\n                GetCandleColor(window[4]) == CandleColor.Black && \n                GetCandleColor(window[3]) == CandleColor.Black && \n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // with consecutively lower opens\n                window[4].Open > window[3].Open && window[3].Open > window[2].Open &&\n                // and closes\n                window[4].Close > window[3].Close && window[3].Close > window[2].Close &&\n                // 4th: black with an upper shadow\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                GetUpperShadow(window[1]) > GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, window[1]) &&\n                // 5th: white\n                GetCandleColor(input) == CandleColor.White &&\n                // that opens above prior candle's body\n                input.Open > window[1].Open &&\n                // and closes above prior candle's high\n                input.Close > window[1].High\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/LongLeggedDoji.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Long Legged Doji candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - doji body\n    /// - one or two long shadows\n    /// The meaning of \"doji\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: long legged doji shows uncertainty\n    /// </remarks>\n    public class LongLeggedDoji : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LongLeggedDoji\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public LongLeggedDoji(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod) + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LongLeggedDoji\"/> class.\n        /// </summary>\n        public LongLeggedDoji()\n            : this(\"LONGLEGGEDDOJI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                (GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input)\n                  ||\n                  GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input)\n                )\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            _shadowLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/LongLineCandle.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Long Line Candle candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - long real body\n    /// - short upper and lower shadow\n    /// The meaning of \"long\" and \"short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white(bullish), negative(-1) when black(bearish)\n    /// </remarks>\n    public class LongLineCandle : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _shadowShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _shadowShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LongLineCandle\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public LongLineCandle(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod) + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LongLineCandle\"/> class.\n        /// </summary>\n        public LongLineCandle()\n            : this(\"LONGLINECANDLE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _shadowShortAveragePeriod)\n                {\n                    _shadowShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal, input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal, input)\n                )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            _shadowShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowShort, input) -\n                                       GetCandleRange(CandleSettingType.ShadowShort, window[_shadowShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _shadowShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Marubozu.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Marubozu candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - long real body\n    /// - no or very short upper and lower shadow\n    /// The meaning of \"long\" and \"very short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white(bullish), negative(-1) when black(bearish)\n    /// </remarks>\n    public class Marubozu : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Marubozu\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Marubozu(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Marubozu\"/> class.\n        /// </summary>\n        public Marubozu()\n            : this(\"MARUBOZU\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/MatHold.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Mat Hold candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white candle\n    /// - upside gap between the first and the second bodies\n    /// - second candle: small black candle\n    /// - third and fourth candles: falling small real body candlesticks(commonly black) that hold within the long\n    /// white candle's body and are higher than the reaction days of the rising three methods\n    /// - fifth candle: white candle that opens above the previous small candle's close and closes higher than the \n    /// high of the highest reaction day\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings; \n    /// \"hold within\" means \"a part of the real body must be within\";\n    /// penetration is the maximum percentage of the first white body the reaction days can penetrate(it is \n    /// to specify how much the reaction days should be \"higher than the reaction days of the rising three methods\")\n    /// The returned value is positive(+1): mat hold is always bullish\n    /// </remarks>\n    public class MatHold : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _bodyPeriodTotal = new decimal[5];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MatHold\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MatHold(string name, decimal penetration = 0.5m) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 4 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MatHold\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MatHold(decimal penetration)\n            : this(\"MATHOLD\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MatHold\"/> class.\n        /// </summary>\n        public MatHold()\n            : this(\"MATHOLD\")\n        {\n        }\n        \n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples > Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples > Period - _bodyShortAveragePeriod)\n                {\n                    _bodyPeriodTotal[3] += GetCandleRange(CandleSettingType.BodyShort, window[3]);\n                    _bodyPeriodTotal[2] += GetCandleRange(CandleSettingType.BodyShort, window[2]);\n                    _bodyPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyShort, window[1]);\n                }\n\n                if (Samples > Period - _bodyLongAveragePeriod)\n                {\n                    _bodyPeriodTotal[4] += GetCandleRange(CandleSettingType.BodyLong, window[4]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if ( \n                // 1st long, then 3 small\n                GetRealBody(window[4]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyPeriodTotal[4], window[4]) &&\n                GetRealBody(window[3]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[3], window[3]) &&\n                GetRealBody(window[2]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[2], window[2]) &&\n                GetRealBody(window[1]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[1], window[1]) &&\n                // white, black, 2 black or white, white\n                GetCandleColor(window[4]) == CandleColor.White &&\n                GetCandleColor(window[3]) == CandleColor.Black &&\n                GetCandleColor(input) == CandleColor.White &&\n                // upside gap 1st to 2nd\n                GetRealBodyGapUp(window[3], window[4]) &&\n                // 3rd to 4th hold within 1st: a part of the real body must be within 1st real body\n                Math.Min(window[2].Open, window[2].Close) < window[4].Close &&\n                Math.Min(window[1].Open, window[1].Close) < window[4].Close &&\n                // reaction days penetrate first body less than optInPenetration percent\n                Math.Min(window[2].Open, window[2].Close) > window[4].Close - GetRealBody(window[4]) * _penetration &&\n                Math.Min(window[1].Open, window[1].Close) > window[4].Close - GetRealBody(window[4]) * _penetration &&\n                // 2nd to 4th are falling\n                Math.Max(window[2].Close, window[2].Open) < window[3].Open &&\n                Math.Max(window[1].Close, window[1].Open) < Math.Max(window[2].Close, window[2].Open) &&\n                // 5th opens above the prior close\n                input.Open > window[1].Close &&\n                // 5th closes above the highest high of the reaction days\n                input.Close > Math.Max(Math.Max(window[3].High, window[2].High), window[1].High)\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyPeriodTotal[4] += GetCandleRange(CandleSettingType.BodyLong, window[4]) -\n                                   GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 4]);\n\n            for (var i = 3; i >= 1; i--)\n            {\n                _bodyPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyShort, window[i]) -\n                                       GetCandleRange(CandleSettingType.BodyShort, window[i + _bodyShortAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyPeriodTotal = new decimal[5];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/MatchingLow.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Matching Low candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: black candle\n    /// - second candle: black candle with the close equal to the previous close\n    /// The meaning of \"equal\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1): matching low is always bullish;\n    /// </remarks>\n    public class MatchingLow : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MatchingLow\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public MatchingLow(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.Equal).AveragePeriod + 1 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MatchingLow\"/> class.\n        /// </summary>\n        public MatchingLow()\n            : this(\"MATCHINGLOW\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // first black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // second black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 1st and 2nd same close\n                input.Close <= window[1].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Close >= window[1].Close - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1])\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/MorningDojiStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Morning Doji Star candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black real body\n    /// - second candle: doji gapping down\n    /// - third candle: white real body that moves well within the first candle's real body\n    /// The meaning of \"doji\" and \"long\" is specified with SetCandleSettings\n    /// The meaning of \"moves well within\" is specified with penetration and \"moves\" should mean the real body should\n    /// not be short (\"short\" is specified with SetCandleSettings) - Greg Morris wants it to be long, someone else want\n    /// it to be relatively long\n    /// The returned value is positive(+1): morning doji star is always bullish;\n    /// the user should consider that a morning star is significant when it appears in a downtrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class MorningDojiStar : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningDojiStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MorningDojiStar(string name, decimal penetration = 0.3m) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),\n                  CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningDojiStar\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MorningDojiStar(decimal penetration)\n            : this(\"MORNINGDOJISTAR\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningDojiStar\"/> class.\n        /// </summary>\n        public MorningDojiStar()\n            : this(\"MORNINGDOJISTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyDojiAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // 2nd: doji\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[1]) &&\n                //      gapping down\n                GetRealBodyGapDown(window[1], window[2]) &&\n                // 3rd: longer than short\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                //      white real body\n                GetCandleColor(input) == CandleColor.White &&\n                //      closing well within 1st rb\n                input.Close > window[2].Close + GetRealBody(window[2]) * _penetration\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyDojiPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/MorningStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Morning Star candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black real body\n    /// - second candle: star(Short real body gapping down)\n    /// - third candle: white real body that moves well within the first candle's real body\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The meaning of \"moves well within\" is specified with penetration and \"moves\" should mean the real body should\n    /// not be short (\"short\" is specified with SetCandleSettings) - Greg Morris wants it to be long, someone else want\n    /// it to be relatively long\n    /// The returned value is positive(+1): morning star is always bullish;\n    /// The user should consider that a morning star is significant when it appears in a downtrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class MorningStar : CandlestickPattern\n    {\n        private readonly decimal _penetration;\n\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n        private decimal _bodyShortPeriodTotal2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MorningStar(string name, decimal penetration = 0.3m) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 2 + 1)\n        {\n            _penetration = penetration;\n\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningStar\"/> class.\n        /// </summary>\n        /// <param name=\"penetration\">Percentage of penetration of a candle within another candle</param>\n        public MorningStar(decimal penetration)\n            : this(\"MORNINGSTAR\", penetration)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MorningStar\"/> class.\n        /// </summary>\n        public MorningStar()\n            : this(\"MORNINGSTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                    _bodyShortPeriodTotal2 += GetCandleRange(CandleSettingType.BodyShort, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // 2nd: short\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, window[1]) &&\n                //      gapping down\n                GetRealBodyGapDown(window[1], window[2]) &&\n                // 3rd: longer than short\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal2, input) &&\n                //      white real body\n                GetCandleColor(input) == CandleColor.White &&\n                //      closing well within 1st rb\n                input.Close > window[2].Close + GetRealBody(window[2]) * _penetration\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, window[1]) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod + 1]);\n\n            _bodyShortPeriodTotal2 += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                      GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            _bodyShortPeriodTotal2 = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/OnNeck.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// On-Neck candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: white candle with open below previous day low and close equal to previous day low\n    /// The meaning of \"equal\" is specified with SetCandleSettings\n    /// The returned value is negative(-1): on-neck is always bearish\n    /// The user should consider that on-neck is significant when it appears in a downtrend, while this function\n    /// does not consider it\n    /// </remarks>\n    public class OnNeck : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OnNeck\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public OnNeck(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Equal).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"OnNeck\"/> class.\n        /// </summary>\n        public OnNeck()\n            : this(\"ONNECK\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: white\n                GetCandleColor(input) == CandleColor.White &&\n                //      open below prior low\n                input.Open < window[1].Low &&\n                //      close equal to prior low\n                input.Close <= window[1].Low + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Close >= window[1].Low - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1])\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0m;\n            _bodyLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Piercing.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Piercing candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: long white candle with open below previous day low and close at least at 50% of previous day\n    /// real body\n    /// The meaning of \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1): piercing pattern is always bullish\n    /// The user should consider that a piercing pattern is significant when it appears in a downtrend, while \n    /// this function does not consider it\n    /// </remarks>\n    public class Piercing : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _bodyLongPeriodTotal = new decimal[2];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Piercing\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Piercing(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 1 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Piercing\"/> class.\n        /// </summary>\n        public Piercing()\n            : this(\"PIERCING\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                    _bodyLongPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[1], window[1]) &&\n                // 2nd: white\n                GetCandleColor(input) == CandleColor.White &&\n                //      long\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[0], input) &&\n                //      open below prior low\n                input.Open < window[1].Low &&\n                //      close within prior body\n                input.Close < window[1].Open &&\n                //      above midpoint\n                input.Close > window[1].Close + GetRealBody(window[1]) * 0.5m\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _bodyLongPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyLong, window[i]) -\n                                           GetCandleRange(CandleSettingType.BodyLong, window[i + _bodyLongAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = new decimal[2];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/RickshawMan.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Rickshaw Man candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - doji body\n    /// - two long shadows\n    /// - body near the midpoint of the high-low range\n    /// The meaning of \"doji\" and \"near\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: rickshaw man shows uncertainty\n    /// </remarks>\n    public class RickshawMan : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _nearAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal _nearPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RickshawMan\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public RickshawMan(string name)\n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                  CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RickshawMan\"/> class.\n        /// </summary>\n        public RickshawMan()\n            : this(\"RICKSHAWMAN\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // doji\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                // long shadow\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // long shadow\n                GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // body near midpoint\n                (\n                    Math.Min(input.Open, input.Close)\n                        <= input.Low + GetHighLowRange(input) / 2 + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, input)\n                    &&\n                    Math.Max(input.Open, input.Close)\n                        >= input.Low + GetHighLowRange(input) / 2 - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, input)\n                )\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, input) -\n                                GetCandleRange(CandleSettingType.Near, window[_nearAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0;\n            _shadowLongPeriodTotal = 0;\n            _nearPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/RiseFallThreeMethods.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Rising/Falling Three Methods candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white (black) candlestick\n    /// - then: group of falling(rising) small real body candlesticks(commonly black (white)) that hold within\n    /// the prior long candle's range: ideally they should be three but two or more than three are ok too\n    /// - final candle: long white(black) candle that opens above(below) the previous small candle's close \n    /// and closes above(below) the first long candle's close\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings; here only patterns with 3 small candles\n    /// are considered;\n    /// The returned value is positive(+1) or negative(-1)\n    /// </remarks>\n    public class RiseFallThreeMethods : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal[] _bodyPeriodTotal = new decimal[5];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RiseFallThreeMethods\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public RiseFallThreeMethods(string name)\n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 4 + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RiseFallThreeMethods\"/> class.\n        /// </summary>\n        public RiseFallThreeMethods()\n            : this(\"RISEFALLTHREEMETHODS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples > Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples > Period - _bodyShortAveragePeriod)\n                {\n                    _bodyPeriodTotal[3] += GetCandleRange(CandleSettingType.BodyShort, window[3]);\n                    _bodyPeriodTotal[2] += GetCandleRange(CandleSettingType.BodyShort, window[2]);\n                    _bodyPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyShort, window[1]);\n                }\n\n                if (Samples > Period - _bodyLongAveragePeriod)\n                {\n                    _bodyPeriodTotal[4] += GetCandleRange(CandleSettingType.BodyLong, window[4]);\n                    _bodyPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if ( \n                // 1st long, then 3 small, 5th long\n                GetRealBody(window[4]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyPeriodTotal[4], window[4]) &&\n                GetRealBody(window[3]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[3], window[3]) &&\n                GetRealBody(window[2]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[2], window[2]) &&\n                GetRealBody(window[1]) < GetCandleAverage(CandleSettingType.BodyShort, _bodyPeriodTotal[1], window[1]) &&\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyPeriodTotal[0], input) &&\n                // white, 3 black, white  ||  black, 3 white, black\n                (int)GetCandleColor(window[4]) == -(int)GetCandleColor(window[3]) &&\n                GetCandleColor(window[3]) == GetCandleColor(window[2]) &&\n                GetCandleColor(window[2]) == GetCandleColor(window[1]) &&\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // 2nd to 4th hold within 1st: a part of the real body must be within 1st range\n                Math.Min(window[3].Open, window[3].Close) < window[4].High && Math.Max(window[3].Open, window[3].Close) > window[4].Low &&\n                Math.Min(window[2].Open, window[2].Close) < window[4].High && Math.Max(window[2].Open, window[2].Close) > window[4].Low &&\n                Math.Min(window[1].Open, window[1].Close) < window[4].High && Math.Max(window[1].Open, window[1].Close) > window[4].Low &&\n                // 2nd to 4th are falling (rising)\n                window[2].Close * (int)GetCandleColor(window[4]) < window[3].Close * (int)GetCandleColor(window[4]) &&\n                window[1].Close * (int)GetCandleColor(window[4]) < window[2].Close * (int)GetCandleColor(window[4]) &&\n                // 5th opens above (below) the prior close\n                input.Open * (int)GetCandleColor(window[4]) > window[1].Close * (int)GetCandleColor(window[4]) &&\n                // 5th closes above (below) the 1st close\n                input.Close * (int)GetCandleColor(window[4]) > window[4].Close * (int)GetCandleColor(window[4])\n              )\n                value = (int)GetCandleColor(window[4]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyPeriodTotal[4] += GetCandleRange(CandleSettingType.BodyLong, window[4]) -\n                                   GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 4]);\n\n            for (var i = 3; i >= 1; i--)\n            {\n                _bodyPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyShort, window[i]) -\n                                       GetCandleRange(CandleSettingType.BodyShort, window[i + _bodyShortAveragePeriod]);\n            }\n\n            _bodyPeriodTotal[0] += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                   GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyPeriodTotal = new decimal[5];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/SeparatingLines.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Separating Lines candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: black (white) candle\n    /// - second candle: bullish(bearish) belt hold with the same open as the prior candle\n    /// The meaning of \"long body\" and \"very short shadow\" of the belt hold is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that separating lines is significant when coming in a trend and the belt hold has\n    /// the same direction of the trend, while this function does not consider it\n    /// </remarks>\n    public class SeparatingLines : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _equalAveragePeriod;\n\n        private decimal _shadowVeryShortPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n        private decimal _equalPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SeparatingLines\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public SeparatingLines(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),\n                CandleSettings.Get(CandleSettingType.Equal).AveragePeriod) + 1 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SeparatingLines\"/> class.\n        /// </summary>\n        public SeparatingLines()\n            : this(\"SEPARATINGLINES\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // opposite candles\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // same open\n                input.Open <= window[1].Open + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                input.Open >= window[1].Open - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                // belt hold: long body\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, input) &&\n                (\n                  // with no lower shadow if bullish\n                  (GetCandleColor(input) == CandleColor.White &&\n                    GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  )\n                  ||\n                  // with no upper shadow if bearish\n                  (GetCandleColor(input) == CandleColor.Black &&\n                    GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input)\n                  )\n                )\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod]);\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = 0m;\n            _bodyLongPeriodTotal = 0m;\n            _equalPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ShootingStar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Shooting Star candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - small real body\n    /// - long upper shadow\n    /// - no, or very short, lower shadow\n    /// - gap up from prior real body\n    /// The meaning of \"short\", \"very short\" and \"long\" is specified with SetCandleSettings;\n    /// The returned value is negative(-1): shooting star is always bearish;\n    /// The user should consider that a shooting star must appear in an uptrend, while this function does not consider it\n    /// </remarks>\n    public class ShootingStar : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ShootingStar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ShootingStar(string name)\n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                  CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1 + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ShootingStar\"/> class.\n        /// </summary>\n        public ShootingStar()\n            : this(\"SHOOTINGSTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // small rb\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // long upper shadow\n                GetUpperShadow(input) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, input) &&\n                // very short lower shadow\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                // gap up\n                GetRealBodyGapUp(input, window[1])\n                )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, input) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[_shadowLongAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0;\n            _shadowLongPeriodTotal = 0;\n            _shadowVeryShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ShortLineCandle.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Short Line Candle candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - short real body\n    /// - short upper and lower shadow\n    /// The meaning of \"short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white, negative (-1) when black;\n    /// it does not mean bullish or bearish\n    /// </remarks>\n    public class ShortLineCandle : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowShortAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ShortLineCandle\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ShortLineCandle(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod) + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _shadowShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ShortLineCandle\"/> class.\n        /// </summary>\n        public ShortLineCandle()\n            : this(\"SHORTLINECANDLE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowShortAveragePeriod)\n                {\n                    _shadowShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal, input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowShort, _shadowShortPeriodTotal, input)\n                )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowShort, input) -\n                                       GetCandleRange(CandleSettingType.ShadowShort, window[_shadowShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            _shadowShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/SpinningTop.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Spinning Top candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - small real body\n    /// - shadows longer than the real body\n    /// The meaning of \"short\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when white or negative(-1) when black;\n    /// it does not mean bullish or bearish\n    /// </remarks>\n    public class SpinningTop : CandlestickPattern\n    {\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SpinningTop\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public SpinningTop(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod + 1)\n        {\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SpinningTop\"/> class.\n        /// </summary>\n        public SpinningTop()\n            : this(\"SPINNINGTOP\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                GetUpperShadow(input) > GetRealBody(input) &&\n                GetLowerShadow(input) > GetRealBody(input)\n              )\n                value = (int)GetCandleColor(input);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyShortPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/StalledPattern.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Stalled Pattern candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three white candlesticks with consecutively higher closes\n    /// - first candle: long white\n    /// - second candle: long white with no or very short upper shadow opening within or near the previous white real body\n    /// and closing higher than the prior candle\n    /// - third candle: small white that gaps away or \"rides on the shoulder\" of the prior long real body(= it's at \n    /// the upper end of the prior real body)\n    /// The meanings of \"long\", \"very short\", \"short\", \"near\" are specified with SetCandleSettings;\n    /// The returned value is negative(-1): stalled pattern is always bearish;\n    /// The user should consider that stalled pattern is significant when it appears in uptrend, while this function\n    /// does not consider it\n    /// </remarks>\n    public class StalledPattern : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _nearAveragePeriod;\n\n        private decimal[] _bodyLongPeriodTotal = new decimal[3];\n        private decimal _bodyShortPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n        private decimal[] _nearPeriodTotal = new decimal[3];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StalledPattern\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public StalledPattern(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod),\n                  Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)) + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StalledPattern\"/> class.\n        /// </summary>\n        public StalledPattern()\n            : this(\"STALLEDPATTERN\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal[2] += GetCandleRange(CandleSettingType.BodyLong, window[2]);\n                    _bodyLongPeriodTotal[1] += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal[2] += GetCandleRange(CandleSettingType.Near, window[2]);\n                    _nearPeriodTotal[1] += GetCandleRange(CandleSettingType.Near, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                // 2nd white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                // 3rd white\n                GetCandleColor(input) == CandleColor.White &&\n                // consecutive higher closes\n                input.Close > window[1].Close && window[1].Close > window[2].Close &&\n                // 1st: long real body\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[2], window[2]) &&\n                // 2nd: long real body\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal[1], window[1]) &&\n                // very short upper shadow\n                GetUpperShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, window[1]) &&\n                // opens within/near 1st real body\n                window[1].Open > window[2].Open &&\n                window[1].Open <= window[2].Close + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[2], window[2]) &&\n                // 3rd: small real body\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                // rides on the shoulder of 2nd real body\n                input.Open >= window[1].Close - GetRealBody(input) - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[1], window[1])\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 2; i >= 1; i--)\n            {\n                _bodyLongPeriodTotal[i] += GetCandleRange(CandleSettingType.BodyLong, window[i]) -\n                                           GetCandleRange(CandleSettingType.BodyLong, window[i + _bodyLongAveragePeriod]);\n                _nearPeriodTotal[i] += GetCandleRange(CandleSettingType.Near, window[i]) -\n                                       GetCandleRange(CandleSettingType.Near, window[i + _nearAveragePeriod]);\n            }\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) - \n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_bodyShortAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = new decimal[3];\n            _bodyShortPeriodTotal = 0;\n            _shadowVeryShortPeriodTotal = 0;\n            _nearPeriodTotal = new decimal[3];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/StickSandwich.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Stick Sandwich candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: black candle\n    /// - second candle: white candle that trades only above the prior close(low > prior close)\n    /// - third candle: black candle with the close equal to the first candle's close\n    /// The meaning of \"equal\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1): stick sandwich is always bullish;\n    /// The user should consider that stick sandwich is significant when coming in a downtrend,\n    /// while this function does not consider it\n    /// </remarks>\n    public class StickSandwich : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StickSandwich\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public StickSandwich(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.Equal).AveragePeriod + 2 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StickSandwich\"/> class.\n        /// </summary>\n        public StickSandwich()\n            : this(\"STICKSANDWICH\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // first black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // second white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                // third black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 2nd low > prior close\n                window[1].Low > window[2].Close &&\n                // 1st and 3rd same close\n                input.Close <= window[2].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[2]) &&\n                input.Close >= window[2].Close - GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[2])\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[2]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 2]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Takuri.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Takuri (Dragonfly Doji with very long lower shadow) candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - doji body\n    /// - open and close at the high of the day = no or very short upper shadow\n    /// - very long lower shadow\n    /// The meaning of \"doji\", \"very short\" and \"very long\" is specified with SetCandleSettings\n    /// The returned value is always positive(+1) but this does not mean it is bullish: takuri must be considered\n    /// relatively to the trend\n    /// </remarks>\n    public class Takuri : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _shadowVeryLongAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n        private decimal _shadowVeryShortPeriodTotal;\n        private decimal _shadowVeryLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Takuri\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Takuri(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod),\n                CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod) + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _shadowVeryLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Takuri\"/> class.\n        /// </summary>\n        public Takuri()\n            : this(\"TAKURI\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _shadowVeryLongAveragePeriod)\n                {\n                    _shadowVeryLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryLong, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal, input) &&\n                GetLowerShadow(input) > GetCandleAverage(CandleSettingType.ShadowVeryLong, _shadowVeryLongPeriodTotal, input)\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod]);\n\n            _shadowVeryShortPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryShort, input) -\n                                           GetCandleRange(CandleSettingType.ShadowVeryShort, window[_shadowVeryShortAveragePeriod]);\n\n            _shadowVeryLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowVeryLong, input) -\n                                          GetCandleRange(CandleSettingType.ShadowVeryLong, window[_shadowVeryLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            _shadowVeryShortPeriodTotal = 0m;\n            _shadowVeryLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/TasukiGap.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Tasuki Gap candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - upside (downside) gap\n    /// - first candle after the window: white(black) candlestick\n    /// - second candle: black(white) candlestick that opens within the previous real body and closes under(above)\n    /// the previous real body inside the gap\n    /// - the size of two real bodies should be near the same\n    /// The meaning of \"near\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that tasuki gap is significant when it appears in a trend, while this function does \n    /// not consider it\n    /// </remarks>\n    public class TasukiGap : CandlestickPattern\n    {\n        private readonly int _nearAveragePeriod;\n\n        private decimal _nearPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TasukiGap\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public TasukiGap(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.Near).AveragePeriod + 2 + 1)\n        {\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TasukiGap\"/> class.\n        /// </summary>\n        public TasukiGap()\n            : this(\"TASUKIGAP\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                (\n                    // upside gap    \n                    GetRealBodyGapUp(window[1], window[2]) &&\n                    // 1st: white\n                    GetCandleColor(window[1]) == CandleColor.White &&\n                    // 2nd: black\n                    GetCandleColor(input) == CandleColor.Black &&\n                    //      that opens within the white rb\n                    input.Open < window[1].Close && input.Open > window[1].Open &&\n                    //      and closes under the white rb\n                    input.Close < window[1].Open &&\n                    //      inside the gap\n                    input.Close > Math.Max(window[2].Close, window[2].Open) &&\n                    // size of 2 rb near the same\n                    Math.Abs(GetRealBody(window[1]) - GetRealBody(input)) < GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1])\n                ) ||\n                (\n                    // downside gap\n                    GetRealBodyGapDown(window[1], window[2]) &&\n                    // 1st: black\n                    GetCandleColor(window[1]) == CandleColor.Black &&\n                    // 2nd: white\n                    GetCandleColor(input) == CandleColor.White &&\n                    //      that opens within the black rb\n                    input.Open < window[1].Open && input.Open > window[1].Close &&\n                    //      and closes above the black rb\n                    input.Close > window[1].Open &&\n                    //      inside the gap\n                    input.Close < Math.Min(window[2].Close, window[2].Open) &&\n                    // size of 2 rb near the same\n                    Math.Abs(GetRealBody(window[1]) - GetRealBody(input)) < GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal, window[1])\n                )\n              )\n                value = (int)GetCandleColor(window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _nearPeriodTotal += GetCandleRange(CandleSettingType.Near, window[1]) -\n                                GetCandleRange(CandleSettingType.Near, window[_nearAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _nearPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeBlackCrows.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Black Crows candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three consecutive and declining black candlesticks\n    /// - each candle must have no or very short lower shadow\n    /// - each candle after the first must open within the prior candle's real body\n    /// - the first candle's close should be under the prior white candle's high\n    /// The meaning of \"very short\" is specified with SetCandleSettings\n    /// The returned value is negative (-1): three black crows is always bearish;\n    /// The user should consider that 3 black crows is significant when it appears after a mature advance or at high levels,\n    /// while this function does not consider it\n    /// </remarks>\n    public class ThreeBlackCrows : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[3];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeBlackCrows\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeBlackCrows(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 3 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeBlackCrows\"/> class.\n        /// </summary>\n        public ThreeBlackCrows()\n            : this(\"THREEBLACKCROWS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[2] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[2]);\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // white\n                GetCandleColor(window[3]) == CandleColor.White &&\n                // 1st black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[2], window[2]) &&\n                // 2nd black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 3rd black\n                GetCandleColor(input) == CandleColor.Black &&\n                // very short lower shadow\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                // 2nd black opens within 1st black's rb\n                window[1].Open < window[2].Open && window[1].Open > window[2].Close &&\n                // 3rd black opens within 2nd black's rb\n                input.Open < window[1].Open && input.Open > window[1].Close &&\n                // 1st black closes under prior candle's high\n                window[3].High > window[2].Close &&\n                // three declining\n                window[2].Close > window[1].Close &&\n                // three declining\n                window[1].Close > input.Close\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 2; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[3];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeInside.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Inside Up/Down candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white(black) real body\n    /// - second candle: short real body totally engulfed by the first\n    /// - third candle: black(white) candle that closes lower(higher) than the first candle's open\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive (+1) for the three inside up or negative (-1) for the three inside down;\n    /// The user should consider that a three inside up is significant when it appears in a downtrend and a three inside\n    /// down is significant when it appears in an uptrend, while this function does not consider the trend\n    /// </remarks>\n    public class ThreeInside : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeInside\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeInside(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeInside\"/> class.\n        /// </summary>\n        public ThreeInside()\n            : this(\"THREEINSIDE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                // 2nd: short\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, window[1]) &&\n                //      engulfed by 1st\n                Math.Max(window[1].Close, window[1].Open) < Math.Max(window[2].Close, window[2].Open) &&\n                Math.Min(window[1].Close, window[1].Open) > Math.Min(window[2].Close, window[2].Open) &&\n                // 3rd: opposite to 1st\n                ((GetCandleColor(window[2]) == CandleColor.White && GetCandleColor(input) == CandleColor.Black && input.Close < window[2].Open) ||\n                  //      and closing out\n                  (GetCandleColor(window[2]) == CandleColor.Black && GetCandleColor(input) == CandleColor.White && input.Close > window[2].Open)\n                )\n              )\n                value = -(int)GetCandleColor(window[2]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[2 + _bodyLongAveragePeriod]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, window[1]) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[1 + _bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeLineStrike.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Line Strike candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three white soldiers (three black crows): three white (black) candlesticks with consecutively higher (lower) closes,\n    /// each opening within or near the previous real body\n    /// - fourth candle: black (white) candle that opens above (below) prior candle's close and closes below (above) \n    /// the first candle's open\n    /// The meaning of \"near\" is specified with SetCandleSettings;\n    /// The returned value is positive (+1) when bullish or negative (-1) when bearish;\n    /// The user should consider that 3-line strike is significant when it appears in a trend in the same direction of\n    /// the first three candles, while this function does not consider it\n    /// </remarks>\n    public class ThreeLineStrike : CandlestickPattern\n    {\n        private readonly int _nearAveragePeriod;\n\n        private decimal[] _nearPeriodTotal = new decimal[4];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeLineStrike\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeLineStrike(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.Near).AveragePeriod + 3 + 1)\n        {\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeLineStrike\"/> class.\n        /// </summary>\n        public ThreeLineStrike()\n            : this(\"THREELINESTRIKE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal[3] += GetCandleRange(CandleSettingType.Near, window[3]);\n                    _nearPeriodTotal[2] += GetCandleRange(CandleSettingType.Near, window[2]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // three with same color\n                GetCandleColor(window[3]) == GetCandleColor(window[2]) &&\n                GetCandleColor(window[2]) == GetCandleColor(window[1]) &&\n                // 4th opposite color\n                (int)GetCandleColor(input) == -(int)GetCandleColor(window[1]) &&\n                // 2nd opens within/near 1st rb\n                window[2].Open >= Math.Min(window[3].Open, window[3].Close) - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[3], window[3]) &&\n                window[2].Open <= Math.Max(window[3].Open, window[3].Close) + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[3], window[3]) &&\n                // 3rd opens within/near 2nd rb\n                window[1].Open >= Math.Min(window[2].Open, window[2].Close) - GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[2], window[2]) &&\n                window[1].Open <= Math.Max(window[2].Open, window[2].Close) + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[2], window[2]) &&\n                (\n                    (\n                        // if three white\n                        GetCandleColor(window[1]) == CandleColor.White &&\n                        // consecutive higher closes\n                        window[1].Close > window[2].Close && window[2].Close > window[3].Close &&\n                        // 4th opens above prior close\n                        input.Open > window[1].Close &&\n                        // 4th closes below 1st open\n                        input.Close < window[3].Open\n                    ) ||\n                    (\n                        // if three black\n                        GetCandleColor(window[1]) == CandleColor.Black &&\n                        // consecutive lower closes\n                        window[1].Close < window[2].Close && window[2].Close < window[3].Close &&\n                        // 4th opens below prior close\n                        input.Open < window[1].Close &&\n                        // 4th closes above 1st open\n                        input.Close > window[3].Open\n                    )\n                )\n              )\n                value = (int)GetCandleColor(window[1]);\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 3; i >= 2; i--)\n            {\n                _nearPeriodTotal[i] += GetCandleRange(CandleSettingType.Near, window[i]) -\n                                       GetCandleRange(CandleSettingType.Near, window[i + _nearAveragePeriod]);\n            }\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _nearPeriodTotal = new decimal[4];\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeOutside.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Outside Up/Down candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first: black(white) real body\n    /// - second: white(black) real body that engulfs the prior real body\n    /// - third: candle that closes higher(lower) than the second candle\n    /// The returned value is positive (+1) for the three outside up or negative (-1) for the three outside down;\n    /// The user should consider that a three outside up must appear in a downtrend and three outside down must appear\n    /// in an uptrend, while this function does not consider it\n    /// </remarks>\n    public class ThreeOutside : CandlestickPattern\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeOutside\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeOutside(string name) \n            : base(name, 3)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeOutside\"/> class.\n        /// </summary>\n        public ThreeOutside()\n            : this(\"THREEOUTSIDE\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                return 0m;\n            }\n\n            decimal value;\n            if (\n               (\n                  // white engulfs black\n                  GetCandleColor(window[1]) == CandleColor.White && GetCandleColor(window[2]) == CandleColor.Black &&\n                  window[1].Close > window[2].Open && window[1].Open < window[2].Close &&\n                  // third candle higher\n                  input.Close > window[1].Close\n                )\n                ||\n                (\n                  // black engulfs white\n                  GetCandleColor(window[1]) == CandleColor.Black && GetCandleColor(window[2]) == CandleColor.White &&\n                  window[1].Open > window[2].Close && window[1].Close < window[2].Open &&\n                  // third candle lower\n                  input.Close < window[1].Close\n                )\n              )\n                value = (int)GetCandleColor(window[1]);\n            else\n                value = 0;\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeStarsInSouth.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Stars In The South candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle with long lower shadow\n    /// - second candle: smaller black candle that opens higher than prior close but within prior candle's range \n    /// and trades lower than prior close but not lower than prior low and closes off of its low(it has a shadow)\n    /// - third candle: small black marubozu(or candle with very short shadows) engulfed by prior candle's range\n    /// The meanings of \"long body\", \"short body\", \"very short shadow\" are specified with SetCandleSettings;\n    /// The returned value is positive (+1): 3 stars in the south is always bullish;\n    /// The user should consider that 3 stars in the south is significant when it appears in downtrend, while this function\n    /// does not consider it\n    /// </remarks>\n    public class ThreeStarsInSouth : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _shadowLongAveragePeriod;\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _shadowLongPeriodTotal;\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[2];\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeStarsInSouth\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeStarsInSouth(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),\n                  Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod)) + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeStarsInSouth\"/> class.\n        /// </summary>\n        public ThreeStarsInSouth()\n            : this(\"THREESTARSINSOUTH\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]);\n                }\n\n                if (Samples >= Period - _shadowLongAveragePeriod)\n                {\n                    _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, window[2]);\n                }\n\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // 2nd black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                // 3rd black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      with long lower shadow\n                GetLowerShadow(window[2]) > GetCandleAverage(CandleSettingType.ShadowLong, _shadowLongPeriodTotal, window[2]) &&\n                // 2nd: smaller candle\n                GetRealBody(window[1]) < GetRealBody(window[2]) &&\n                //      that opens higher but within 1st range\n                window[1].Open > window[2].Close && window[1].Open <= window[2].High &&\n                //      and trades lower than 1st close\n                window[1].Low < window[2].Close &&\n                //      but not lower than 1st low\n                window[1].Low >= window[2].Low &&\n                //      and has a lower shadow\n                GetLowerShadow(window[1]) > GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 3rd: small marubozu\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                GetLowerShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                //      engulfed by prior candle's range\n                input.Low > window[1].Low && input.High < window[1].High\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[2 + _bodyLongAveragePeriod]);\n\n            _shadowLongPeriodTotal += GetCandleRange(CandleSettingType.ShadowLong, window[2]) -\n                                      GetCandleRange(CandleSettingType.ShadowLong, window[2 + _shadowLongAveragePeriod]);\n\n            for (var i = 1; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n            }\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _shadowLongPeriodTotal = 0;\n            _shadowVeryShortPeriodTotal = new decimal[2];\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Three Advancing White Soldiers candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - three white candlesticks with consecutively higher closes\n    /// - Greg Morris wants them to be long, Steve Nison doesn't; anyway they should not be short\n    /// - each candle opens within or near the previous white real body\n    /// - each candle must have no or very short upper shadow\n    /// - to differentiate this pattern from advance block, each candle must not be far shorter than the prior candle\n    /// The meanings of \"not short\", \"very short shadow\", \"far\" and \"near\" are specified with SetCandleSettings;\n    /// here the 3 candles must be not short, if you want them to be long use SetCandleSettings on BodyShort;\n    /// The returned value is positive (+1): advancing 3 white soldiers is always bullish;\n    /// The user should consider that 3 white soldiers is significant when it appears in downtrend, while this function \n    /// does not consider it\n    /// </remarks>\n    public class ThreeWhiteSoldiers : CandlestickPattern\n    {\n        private readonly int _shadowVeryShortAveragePeriod;\n        private readonly int _nearAveragePeriod;\n        private readonly int _farAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal[] _shadowVeryShortPeriodTotal = new decimal[3];\n        private decimal[] _nearPeriodTotal = new decimal[3];\n        private decimal[] _farPeriodTotal = new decimal[3];\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeWhiteSoldiers\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public ThreeWhiteSoldiers(string name) \n            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod),\n                  Math.Max(CandleSettings.Get(CandleSettingType.Far).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)) + 2 + 1)\n        {\n            _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;\n            _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;\n            _farAveragePeriod = CandleSettings.Get(CandleSettingType.Far).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ThreeWhiteSoldiers\"/> class.\n        /// </summary>\n        public ThreeWhiteSoldiers()\n            : this(\"THREEWHITESOLDIERS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _shadowVeryShortAveragePeriod)\n                {\n                    _shadowVeryShortPeriodTotal[2] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[2]);\n                    _shadowVeryShortPeriodTotal[1] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[1]);\n                    _shadowVeryShortPeriodTotal[0] += GetCandleRange(CandleSettingType.ShadowVeryShort, input);\n                }\n\n                if (Samples >= Period - _nearAveragePeriod)\n                {\n                    _nearPeriodTotal[2] += GetCandleRange(CandleSettingType.Near, window[2]);\n                    _nearPeriodTotal[1] += GetCandleRange(CandleSettingType.Near, window[1]);\n                }\n\n                if (Samples >= Period - _farAveragePeriod)\n                {\n                    _farPeriodTotal[2] += GetCandleRange(CandleSettingType.Far, window[2]);\n                    _farPeriodTotal[1] += GetCandleRange(CandleSettingType.Far, window[1]);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                // very short upper shadow\n                GetUpperShadow(window[2]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[2], window[2]) &&\n                // 2nd white\n                GetCandleColor(window[1]) == CandleColor.White &&\n                // very short upper shadow\n                GetUpperShadow(window[1]) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[1], window[1]) &&\n                // 3rd white\n                GetCandleColor(input) == CandleColor.White &&\n                // very short upper shadow\n                GetUpperShadow(input) < GetCandleAverage(CandleSettingType.ShadowVeryShort, _shadowVeryShortPeriodTotal[0], input) &&\n                // consecutive higher closes\n                input.Close > window[1].Close && window[1].Close > window[2].Close &&\n                // 2nd opens within/near 1st real body\n                window[1].Open > window[2].Open &&\n                window[1].Open <= window[2].Close + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[2], window[2]) &&\n                // 3rd opens within/near 2nd real body\n                input.Open > window[1].Open &&\n                input.Open <= window[1].Close + GetCandleAverage(CandleSettingType.Near, _nearPeriodTotal[1], window[1]) &&\n                // 2nd not far shorter than 1st\n                GetRealBody(window[1]) > GetRealBody(window[2]) - GetCandleAverage(CandleSettingType.Far, _farPeriodTotal[2], window[2]) &&\n                // 3rd not far shorter than 2nd\n                GetRealBody(input) > GetRealBody(window[1]) - GetCandleAverage(CandleSettingType.Far, _farPeriodTotal[1], window[1]) &&\n                // not short real body\n                GetRealBody(input) > GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input)\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            for (var i = 2; i >= 0; i--)\n            {\n                _shadowVeryShortPeriodTotal[i] += GetCandleRange(CandleSettingType.ShadowVeryShort, window[i]) -\n                                                  GetCandleRange(CandleSettingType.ShadowVeryShort, window[i + _shadowVeryShortAveragePeriod]);\n            }\n\n            for (var i = 2; i >= 1; i--)\n            {\n                _farPeriodTotal[i] += GetCandleRange(CandleSettingType.Far, window[i]) -\n                                      GetCandleRange(CandleSettingType.Far, window[i + _farAveragePeriod]);\n            }\n\n            for (var i = 2; i >= 1; i--)\n            {\n                _nearPeriodTotal[i] += GetCandleRange(CandleSettingType.Near, window[i]) -\n                                       GetCandleRange(CandleSettingType.Near, window[i + _nearAveragePeriod]);\n            }\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _shadowVeryShortPeriodTotal = new decimal[3];\n            _nearPeriodTotal = new decimal[3];\n            _farPeriodTotal = new decimal[3];\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Thrusting.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Thrusting candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: white candle with open below previous day low and close into previous day body under the midpoint;\n    /// to differentiate it from in-neck the close should not be equal to the black candle's close\n    /// The meaning of \"equal\" is specified with SetCandleSettings\n    /// The returned value is negative(-1): thrusting pattern is always bearish\n    /// The user should consider that the thrusting pattern is significant when it appears in a downtrend and it could be\n    /// even bullish \"when coming in an uptrend or occurring twice within several days\" (Steve Nison says), while this\n    /// function does not consider the trend\n    /// </remarks>\n    public class Thrusting : CandlestickPattern\n    {\n        private readonly int _equalAveragePeriod;\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _equalPeriodTotal;\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Thrusting\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Thrusting(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Equal).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)\n        {\n            _equalAveragePeriod = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Thrusting\"/> class.\n        /// </summary>\n        public Thrusting()\n            : this(\"THRUSTING\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _equalAveragePeriod)\n                {\n                    _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]);\n                }\n\n                if (Samples >= Period - _bodyLongAveragePeriod)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      long\n                GetRealBody(window[1]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[1]) &&\n                // 2nd: white\n                GetCandleColor(input) == CandleColor.White &&\n                //      open below prior low\n                input.Open < window[1].Low &&\n                //      close into prior body\n                input.Close > window[1].Close + GetCandleAverage(CandleSettingType.Equal, _equalPeriodTotal, window[1]) &&\n                //      under the midpoint\n                input.Close <= window[1].Close + GetRealBody(window[1]) * 0.5m\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _equalPeriodTotal += GetCandleRange(CandleSettingType.Equal, window[1]) -\n                                 GetCandleRange(CandleSettingType.Equal, window[_equalAveragePeriod + 1]);\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[1]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _equalPeriodTotal = 0m;\n            _bodyLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/Tristar.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Tristar candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - 3 consecutive doji days\n    /// - the second doji is a star\n    /// The meaning of \"doji\" is specified with SetCandleSettings\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish\n    /// </remarks>\n    public class Tristar : CandlestickPattern\n    {\n        private readonly int _bodyDojiAveragePeriod;\n\n        private decimal _bodyDojiPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Tristar\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public Tristar(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod + 2 + 1)\n        {\n            _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Tristar\"/> class.\n        /// </summary>\n        public Tristar()\n            : this(\"TRISTAR\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyDojiAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: doji\n                GetRealBody(window[2]) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[2]) &&\n                // 2nd: doji\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[2]) &&\n                // 3rd: doji\n                GetRealBody(input) <= GetCandleAverage(CandleSettingType.BodyDoji, _bodyDojiPeriodTotal, window[2]))\n            {     \n                value = 0;\n                if (\n                    // 2nd gaps up\n                    GetRealBodyGapUp(window[1], window[2]) &&\n                    // 3rd is not higher than 2nd\n                    Math.Max(input.Open, input.Close) < Math.Max(window[1].Open, window[1].Close)\n                   )\n                    value = -1m;\n                if (\n                    // 2nd gaps down\n                    GetRealBodyGapDown(window[1], window[2]) &&\n                    // 3rd is not lower than 2nd \n                    Math.Min(input.Open, input.Close) > Math.Min(window[1].Open, window[1].Close)\n                   )\n                    value = 1m;\n            }\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyDojiPeriodTotal += GetCandleRange(CandleSettingType.BodyDoji, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyDoji, window[_bodyDojiAveragePeriod + 2]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyDojiPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/TwoCrows.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Two Crows candlestick pattern indicator\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long white candle\n    /// - second candle: black real body\n    /// - gap between the first and the second candle's real bodies\n    /// - third candle: black candle that opens within the second real body and closes within the first real body\n    /// The meaning of \"long\" is specified with SetCandleSettings\n    /// The returned value is negative (-1): two crows is always bearish;\n    /// The user should consider that two crows is significant when it appears in an uptrend, while this function\n    /// does not consider the trend.\n    /// </remarks>\n    public class TwoCrows : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TwoCrows\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public TwoCrows(string name) \n            : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TwoCrows\"/> class.\n        /// </summary>\n        public TwoCrows()\n            : this(\"TWOCROWS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                //      long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                // 2nd: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      gapping up\n                GetRealBodyGapUp(window[1], window[2]) &&\n                // 3rd: black\n                GetCandleColor(input) == CandleColor.Black &&\n                //      opening within 2nd rb\n                input.Open < window[1].Open && input.Open > window[1].Close &&\n                //      closing within 1st rb\n                input.Close > window[2].Open && input.Close < window[2].Close\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[2 + _bodyLongAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0m;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/UniqueThreeRiver.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Unique Three River candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: long black candle\n    /// - second candle: black harami candle with a lower low than the first candle's low\n    /// - third candle: small white candle with open not lower than the second candle's low, better if its open and \n    /// close are under the second candle's close\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is positive(+1): unique 3 river is always bullish and should appear in a downtrend\n    /// to be significant, while this function does not consider the trend\n    /// </remarks>\n    public class UniqueThreeRiver : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniqueThreeRiver\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public UniqueThreeRiver(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UniqueThreeRiver\"/> class.\n        /// </summary>\n        public UniqueThreeRiver()\n            : this(\"UNIQUETHREERIVER\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                //      black\n                GetCandleColor(window[2]) == CandleColor.Black &&\n                // 2nd: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      harami\n                window[1].Close > window[2].Close && window[1].Open <= window[2].Open &&\n                //      lower low\n                window[1].Low < window[2].Low &&\n                // 3rd: short\n                GetRealBody(input) < GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, input) &&\n                //      white\n                GetCandleColor(input) == CandleColor.White &&\n                //      open not lower\n                input.Open > window[1].Low\n              )\n                value = 1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/UpDownGapThreeMethods.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Up/Down Gap Three Methods candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: white (black) candle\n    /// - second candle: white(black) candle\n    /// - upside(downside) gap between the first and the second real bodies\n    /// - third candle: black(white) candle that opens within the second real body and closes within the first real body\n    /// The returned value is positive(+1) when bullish or negative(-1) when bearish;\n    /// The user should consider that up/downside gap 3 methods is significant when it appears in a trend, while this\n    /// function does not consider it\n    /// </remarks>\n    public class UpDownGapThreeMethods : CandlestickPattern\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpDownGapThreeMethods\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public UpDownGapThreeMethods(string name) \n            : base(name, 2 + 1)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpDownGapThreeMethods\"/> class.\n        /// </summary>\n        public UpDownGapThreeMethods()\n            : this(\"UPDOWNGAPTHREEMETHODS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st and 2nd of same color\n                GetCandleColor(window[2]) == GetCandleColor(window[1]) &&\n                // 3rd opposite color\n                (int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) &&\n                // 3rd opens within 2nd rb\n                input.Open < Math.Max(window[1].Close, window[1].Open) &&\n                input.Open > Math.Min(window[1].Close, window[1].Open) &&\n                // 3rd closes within 1st rb\n                input.Close < Math.Max(window[2].Close, window[2].Open) &&\n                input.Close > Math.Min(window[2].Close, window[2].Open) &&\n                ((\n                    // when 1st is white\n                    GetCandleColor(window[2]) == CandleColor.White &&\n                    // upside gap\n                    GetRealBodyGapUp(window[1], window[2])\n                  ) ||\n                  (\n                    // when 1st is black\n                    GetCandleColor(window[2]) == CandleColor.Black &&\n                    // downside gap\n                    GetRealBodyGapDown(window[1], window[2])\n                  )\n                )\n            )\n                value = (int)GetCandleColor(window[2]);\n            else\n                value = 0;\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators.CandlestickPatterns\n{\n    /// <summary>\n    /// Upside Gap Two Crows candlestick pattern\n    /// </summary>\n    /// <remarks>\n    /// Must have:\n    /// - first candle: white candle, usually long\n    /// - second candle: small black real body\n    /// - gap between the first and the second candle's real bodies\n    /// - third candle: black candle with a real body that engulfs the preceding candle\n    /// and closes above the white candle's close\n    /// The meaning of \"short\" and \"long\" is specified with SetCandleSettings\n    /// The returned value is negative(-1): upside gap two crows is always bearish;\n    /// The user should consider that an upside gap two crows is significant when it appears in an uptrend,\n    /// while this function does not consider the trend\n    /// </remarks>\n    public class UpsideGapTwoCrows : CandlestickPattern\n    {\n        private readonly int _bodyLongAveragePeriod;\n        private readonly int _bodyShortAveragePeriod;\n\n        private decimal _bodyLongPeriodTotal;\n        private decimal _bodyShortPeriodTotal;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpsideGapTwoCrows\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public UpsideGapTwoCrows(string name) \n            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)\n        {\n            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;\n            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpsideGapTwoCrows\"/> class.\n        /// </summary>\n        public UpsideGapTwoCrows()\n            : this(\"UPSIDEGAPTWOCROWS\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                if (Samples >= Period - _bodyLongAveragePeriod - 2 && Samples < Period - 2)\n                {\n                    _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, input);\n                }\n\n                if (Samples >= Period - _bodyShortAveragePeriod - 1 && Samples < Period - 1)\n                {\n                    _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, input);\n                }\n\n                return 0m;\n            }\n\n            decimal value;\n            if (\n                // 1st: white\n                GetCandleColor(window[2]) == CandleColor.White &&\n                //      long\n                GetRealBody(window[2]) > GetCandleAverage(CandleSettingType.BodyLong, _bodyLongPeriodTotal, window[2]) &&\n                // 2nd: black\n                GetCandleColor(window[1]) == CandleColor.Black &&\n                //      short\n                GetRealBody(window[1]) <= GetCandleAverage(CandleSettingType.BodyShort, _bodyShortPeriodTotal, window[1]) &&\n                //      gapping up\n                GetRealBodyGapUp(window[1], window[2]) &&\n                // 3rd: black\n                GetCandleColor(input) == CandleColor.Black &&\n                // 3rd: engulfing prior rb\n                input.Open > window[1].Open && input.Close < window[1].Close &&\n                //      closing above 1st\n                input.Close > window[2].Close\n              )\n                value = -1m;\n            else\n                value = 0m;\n\n            // add the current range and subtract the first range: this is done after the pattern recognition \n            // when avgPeriod is not 0, that means \"compare with the previous candles\" (it excludes the current candle)\n\n            _bodyLongPeriodTotal += GetCandleRange(CandleSettingType.BodyLong, window[2]) -\n                                    GetCandleRange(CandleSettingType.BodyLong, window[_bodyLongAveragePeriod + 2]);\n\n            _bodyShortPeriodTotal += GetCandleRange(CandleSettingType.BodyShort, window[1]) -\n                                     GetCandleRange(CandleSettingType.BodyShort, window[_bodyShortAveragePeriod + 1]);\n\n            return value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _bodyLongPeriodTotal = 0;\n            _bodyShortPeriodTotal = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ChaikinMoneyFlow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Chaikin Money Flow Index (CMF) is a volume-weighted average of accumulation and distribution over\n    /// a specified period.\n    ///\n    /// CMF = n-day Sum of [(((C - L) - (H - C)) / (H - L)) x Vol] / n-day Sum of Vol\n    ///\n    /// Where:\n    /// n = number of periods, typically 21\n    /// H = high\n    /// L = low\n    /// C = close\n    /// Vol = volume\n    /// \n    /// https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/cmf\n    /// </summary>\n    public class ChaikinMoneyFlow : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Holds the point-wise flow-sum and volume terms. \n        /// </summary>\n        private readonly Sum _flowRatioSum;\n\n        private readonly Sum _volumeSum;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _flowRatioSum.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _volumeSum.Reset();\n            _flowRatioSum.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ChaikinMoneyFlow class\n        /// </summary>\n        /// <param name=\"name\">A name for the indicator</param>\n        /// <param name=\"period\">The period over which to perform computation</param>\n        public ChaikinMoneyFlow(string name, int period)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            _flowRatioSum = new Sum(period);\n            _volumeSum = new Sum(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ChaikinMoneyFlow class\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform computation</param>\n        public ChaikinMoneyFlow(int period)\n            : this($\"CMF({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var denominator = (input.High - input.Low);\n            var flowRatio = denominator > 0\n                ? input.Volume * (input.Close - input.Low - (input.High - input.Close)) / denominator\n                : 0m;\n\n            _flowRatioSum.Update(input.EndTime, flowRatio);\n            _volumeSum.Update(input.EndTime, input.Volume);\n\n            return !IsReady || _volumeSum == 0m ? 0m : _flowRatioSum / _volumeSum;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ChaikinOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This class is an alias for AccumulationDistributionOscillator (also known as Chaikin Oscillator).\n    /// </summary>\n    public class ChaikinOscillator : AccumulationDistributionOscillator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChaikinOscillator\"/> class using the specified parameters\n        /// </summary> \n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        public ChaikinOscillator(int fastPeriod, int slowPeriod)\n            : base($\"ChaikinOscillator({fastPeriod},{slowPeriod})\", fastPeriod, slowPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChaikinOscillator\"/> class with a custom name\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        public ChaikinOscillator(string name, int fastPeriod, int slowPeriod)\n            : base(name, fastPeriod, slowPeriod)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ChandeKrollStop.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the short stop and lower stop values of the Chande Kroll Stop Indicator.\n    /// It is used to determine the optimal placement of a stop-loss order.\n    /// </summary>\n    public class ChandeKrollStop : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly AverageTrueRange _atr;\n        private readonly decimal _atrMult;\n\n        private readonly Maximum _underlyingMaximum;\n        private readonly Minimum _underlyingMinimum;\n\n        /// <summary>\n        /// Gets the short stop of ChandeKrollStop.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> ShortStop { get; }\n\n        /// <summary>\n        /// Gets the long stop of ChandeKrollStop.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> LongStop { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChandeKrollStop\"/> class.\n        /// </summary>\n        /// <param name=\"atrPeriod\">The period over which to compute the average true range.</param>\n        /// <param name=\"atrMult\">The ATR multiplier to be used to compute stops distance.</param>\n        /// <param name=\"period\">The period over which to compute the max of high stop and min of low stop.</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public ChandeKrollStop(int atrPeriod, decimal atrMult, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : this($\"CKS({atrPeriod},{atrMult},{period})\", atrPeriod, atrMult, period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChandeKrollStop\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"atrPeriod\">The period over which to compute the average true range.</param>\n        /// <param name=\"atrMult\">The ATR multiplier to be used to compute stops distance.</param>\n        /// <param name=\"period\">The period over which to compute the max of high stop and min of low stop.</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public ChandeKrollStop(string name, int atrPeriod, decimal atrMult, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : base(name)\n        {\n            WarmUpPeriod = atrPeriod + period - 1;\n\n            _atr = new AverageTrueRange(atrPeriod, movingAverageType);\n            _atrMult = atrMult;\n            _underlyingMaximum = new Maximum(atrPeriod);\n            _underlyingMinimum = new Minimum(atrPeriod);\n\n            LongStop = new Minimum(name + \"_Long\", period);\n            ShortStop = new Maximum(name + \"_Short\", period);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>The input is returned unmodified.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _atr.Update(input);\n\n            _underlyingMaximum.Update(input.EndTime, input.High);\n            var highStop = _underlyingMaximum.Current.Value - _atr.Current.Value * _atrMult;\n\n            _underlyingMinimum.Update(input.EndTime, input.Low);\n            var lowStop = _underlyingMinimum.Current.Value + _atr.Current.Value * _atrMult;\n\n            ShortStop.Update(input.EndTime, highStop);\n            LongStop.Update(input.EndTime, lowStop);\n\n            return input.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _atr.Reset();\n            _underlyingMaximum.Reset();\n            _underlyingMinimum.Reset();\n            ShortStop.Reset();\n            LongStop.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ChandeMomentumOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Chande Momentum Oscillator (CMO).\n    /// CMO calculation is mostly identical to RSI.\n    /// The only difference is in the last step of calculation:\n    /// RSI = gain / (gain+loss)\n    /// CMO = (gain-loss) / (gain+loss)\n    /// </summary>\n    public class ChandeMomentumOscillator : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private decimal _prevValue;\n        private decimal _prevGain;\n        private decimal _prevLoss;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChandeMomentumOscillator\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the indicator</param>\n        public ChandeMomentumOscillator(int period)\n            : this($\"CMO({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ChandeMomentumOscillator\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the indicator</param>\n        public ChandeMomentumOscillator(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1 + Period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (Samples == 1)\n            {\n                _prevValue = input.Value;\n                return 0m;\n            }\n\n            var difference = input.Value - _prevValue;\n\n            _prevValue = input.Value;\n\n            if (Samples > Period + 1)\n            {\n                _prevLoss *= (Period - 1);\n                _prevGain *= (Period - 1);\n            }\n\n            if (difference < 0)\n                _prevLoss -= difference;\n            else\n                _prevGain += difference;\n\n            if (!IsReady)\n                return 0m;\n\n            _prevLoss /= Period;\n            _prevGain /= Period;\n\n            var sum = _prevGain + _prevLoss;\n            return sum != 0 ? 100m * ((_prevGain - _prevLoss) / sum) : 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _prevValue = 0;\n            _prevGain = 0;\n            _prevLoss = 0;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ChoppinessIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The ChoppinessIndex indicator is an indicator designed to determine if the market is choppy (trading sideways)\n    /// or not choppy (trading within a trend in either direction)\n    /// </summary>\n    public class ChoppinessIndex : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n\n        private readonly int _period;\n        private readonly RollingWindow<decimal> _highs;\n        private readonly RollingWindow<decimal> _lows;\n        private readonly IndicatorBase<IBaseDataBar> _trueRange;\n        private readonly RollingWindow<decimal> _trueRangeHistory;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new ChoppinessIndex indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period used for rolling windows for highs and lows</param>\n        public ChoppinessIndex(string name, int period)\n            : base(name)\n        {\n            _period = period;\n\n            _trueRange = new TrueRange();\n            _trueRangeHistory = new RollingWindow<decimal>(period);\n\n            _highs = new RollingWindow<decimal>(period);\n            _lows = new RollingWindow<decimal>(period);\n\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Creates a new ChoppinessIndex indicator using the specified period\n        /// </summary>\n        /// <param name=\"period\">The period used for rolling windows for highs and lows</param>\n        public ChoppinessIndex(int period)\n            : this($\"CHOP({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            // compute the true range\n            _trueRange.Update(input);\n\n            // store candle high and low\n            _highs.Add(input.High);\n            _lows.Add(input.Low);\n\n            // store true range in rolling window\n            if (_trueRange.IsReady)\n            {\n                _trueRangeHistory.Add(_trueRange.Current.Value);\n            }\n            else\n            {\n                _trueRangeHistory.Add(input.High - input.Low);\n            }           \n\n            if (IsReady)\n            {\n                // calculate max high and min low\n                var maxHigh = _highs.Max();\n                var minLow = _lows.Min();\n\n                if (maxHigh != minLow)\n                {\n                    // return CHOP index\n                    return (decimal)(100.0 * Math.Log10(((double) _trueRangeHistory.Sum()) / ((double) (maxHigh - minLow))) / Math.Log10(_period));\n                }\n                else\n                {\n                    // situation of maxHigh = minLow represents a totally \"choppy\" or stagnant market,\n                    // with no price movement at all.\n                    // It's the extreme case of consolidation, hence the maximum value of 100 for the index\n                    return 100m;\n                }\n            }\n            else\n            {\n                // return 0 when indicator is not ready\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _trueRange.Reset();\n            _trueRangeHistory.Reset();\n            _highs.Reset();\n            _lows.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CommodityChannelIndex.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the traditional commodity channel index (CCI)\n    ///\n    /// CCI = (Typical Price - 20-period SMA of TP) / (.015 * Mean Deviation)\n    /// Typical Price (TP) = (High + Low + Close)/3\n    /// Constant = 0.015\n    ///\n    /// There are four steps to calculating the Mean Deviation, first, subtract\n    /// the most recent 20-period average of the typical price from each period's\n    /// typical price. Second, take the absolute values of these numbers. Third,\n    /// sum the absolute values. Fourth, divide by the total number of periods (20).\n    /// </summary>\n    public class CommodityChannelIndex : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// This constant is used to ensure that CCI values fall between +100 and -100, 70% to 80% of the time\n        /// </summary>\n        private const decimal K = 0.015m;\n\n        /// <summary>\n        /// Gets the type of moving average\n        /// </summary>\n        public MovingAverageType MovingAverageType { get; }\n\n        /// <summary>\n        /// Keep track of the simple moving average of the typical price\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> TypicalPriceAverage { get; }\n\n        /// <summary>\n        /// Keep track of the mean absolute deviation of the typical price\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> TypicalPriceMeanDeviation { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the CommodityChannelIndex class\n        /// </summary>\n        /// <param name=\"period\">The period of the standard deviation and moving average (middle band)</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public CommodityChannelIndex(int period, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"CCI({period})\", period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the CommodityChannelIndex class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the standard deviation and moving average (middle band)</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public CommodityChannelIndex(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            MovingAverageType = movingAverageType;\n            TypicalPriceAverage = movingAverageType.AsIndicator(name + \"_TypicalPriceAvg\", period);\n            TypicalPriceMeanDeviation = new MeanAbsoluteDeviation(name + \"_TypicalPriceMAD\", period);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => TypicalPriceAverage.IsReady && TypicalPriceMeanDeviation.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var typicalPrice = (input.High + input.Low + input.Close) / 3.0m;\n\n            TypicalPriceAverage.Update(input.EndTime, typicalPrice);\n            TypicalPriceMeanDeviation.Update(input.EndTime, typicalPrice);\n\n            // compare this to zero, since if the mean deviation is very small we can get\n            // precision errors due to non-floating point math\n            var weightedMeanDeviation = K * TypicalPriceMeanDeviation.Current.Value;\n            if (weightedMeanDeviation == 0.0m)\n            {\n                return 0.0m;\n            }\n\n            return (typicalPrice - TypicalPriceAverage.Current.Value).SafeDivision(weightedMeanDeviation, Current.Value);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            TypicalPriceAverage.Reset();\n            TypicalPriceMeanDeviation.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/CompositeIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator is capable of wiring up two separate indicators into a single indicator\n    /// such that the output of each will be sent to a user specified function.\n    /// </summary>\n    /// <remarks>\n    /// This type is initialized such that there is no need to call the Update function. This indicator\n    /// will have its values automatically updated each time a new piece of data is received from both\n    /// the left and right indicators.\n    /// </remarks>\n    public class CompositeIndicator : IndicatorBase<IndicatorDataPoint>\n    {\n        /// <summary>\n        /// Delegate type used to compose the output of two indicators into a new value.\n        /// </summary>\n        /// <remarks>\n        /// A simple example would be to compute the difference between the two indicators (such as with MACD)\n        /// (left, right) => left - right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <returns>And indicator result representing the composition of the two indicators</returns>\n        public delegate IndicatorResult IndicatorComposer(IndicatorBase left, IndicatorBase right);\n\n        /// <summary>function used to compose the individual indicators</summary>\n        private readonly IndicatorComposer _composer;\n\n        /// <summary>\n        /// Gets the 'left' indicator for the delegate\n        /// </summary>\n        public IndicatorBase Left { get; private set; }\n\n        /// <summary>\n        /// Gets the 'right' indicator for the delegate\n        /// </summary>\n        public IndicatorBase Right { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Left.IsReady && Right.IsReady; }\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Left.Reset();\n            Right.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator capable of taking the output from the left and right indicators\n        /// and producing a new value via the composer delegate specified\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"left\">The left indicator for the 'composer'</param>\n        /// <param name=\"right\">The right indicator for the 'composer'</param>\n        /// <param name=\"composer\">Function used to compose the left and right indicators</param>\n        public CompositeIndicator(string name, IndicatorBase left, IndicatorBase right, IndicatorComposer composer)\n            : base(name)\n        {\n            _composer = composer;\n            Left = left;\n            Right = right;\n            Name ??= $\"COMPOSE({Left.Name},{Right.Name})\";\n            ConfigureEventHandlers();\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator capable of taking the output from the left and right indicators\n        /// and producing a new value via the composer delegate specified\n        /// </summary>\n        /// <param name=\"left\">The left indicator for the 'composer'</param>\n        /// <param name=\"right\">The right indicator for the 'composer'</param>\n        /// <param name=\"composer\">Function used to compose the left and right indicators</param>\n        public CompositeIndicator(IndicatorBase left, IndicatorBase right, IndicatorComposer composer)\n            : this(null, left, right, composer)\n        { }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"CompositeIndicator\"/> using two indicators\n        /// and a custom function.\n        /// </summary>\n        /// <param name=\"name\">The name of the composite indicator.</param>\n        /// <param name=\"left\">The first indicator in the composition.</param>\n        /// <param name=\"right\">The second indicator in the composition.</param>\n        /// <param name=\"handler\">A Python function that processes the indicator values.</param>\n        /// <exception cref=\"ArgumentException\">\n        /// Thrown if the provided left or right indicator is not a valid QuantConnect Indicator object.\n        /// </exception>\n        public CompositeIndicator(string name, PyObject left, PyObject right, PyObject handler)\n            : this(\n                name,\n                (IndicatorBase)left.GetIndicatorAsManagedObject(),\n                (IndicatorBase)right.GetIndicatorAsManagedObject(),\n                new IndicatorComposer(handler.SafeAs<Func<IndicatorBase, IndicatorBase, IndicatorResult>>())\n            )\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"CompositeIndicator\"/> using two indicators\n        /// and a custom function.\n        /// </summary>\n        /// <param name=\"left\">The first indicator in the composition.</param>\n        /// <param name=\"right\">The second indicator in the composition.</param>\n        /// <param name=\"handler\">A Python function that processes the indicator values.</param>\n        public CompositeIndicator(PyObject left, PyObject right, PyObject handler)\n            : this(null, left, right, handler)\n        { }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// and returns an instance of the <see cref=\"IndicatorResult\"/> class\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>An IndicatorResult object including the status of the indicator</returns>\n        protected override IndicatorResult ValidateAndComputeNextValue(IndicatorDataPoint input)\n        {\n            return _composer.Invoke(Left, Right);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <remarks>\n        /// Since this class overrides <see cref=\"ValidateAndComputeNextValue\"/>, this method is a no-op\n        /// </remarks>\n        /// <param name=\"_\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint _)\n        {\n            // this should never actually be invoked\n            return _composer.Invoke(Left, Right).Value;\n        }\n\n        /// <summary>\n        /// Configures the event handlers for Left.Updated and Right.Updated to update this instance when\n        /// they both have new data.\n        /// </summary>\n        private void ConfigureEventHandlers()\n        {\n            // if either of these are constants then there's no reason\n            bool leftIsConstant = Left.GetType().IsSubclassOfGeneric(typeof(ConstantIndicator<>));\n            bool rightIsConstant = Right.GetType().IsSubclassOfGeneric(typeof(ConstantIndicator<>));\n\n            // wire up the Updated events such that when we get a new piece of data from both left and right\n            // we'll call update on this indicator. It's important to note that the CompositeIndicator only uses\n            // the timestamp that gets passed into the Update function, his compuation is soley a function\n            // of the left and right indicator via '_composer'\n\n            IndicatorDataPoint newLeftData = null;\n            IndicatorDataPoint newRightData = null;\n            Left.Updated += (sender, updated) =>\n            {\n                newLeftData = updated;\n\n                // if we have left and right data (or if right is a constant) then we need to update\n                if (newRightData != null || rightIsConstant)\n                {\n                    var dataPoint = new IndicatorDataPoint { Time = MaxTime(updated) };\n                    Update(dataPoint);\n                    // reset these to null after each update\n                    newLeftData = null;\n                    newRightData = null;\n                }\n            };\n\n            Right.Updated += (sender, updated) =>\n            {\n                newRightData = updated;\n\n                // if we have left and right data (or if left is a constant) then we need to update\n                if (newLeftData != null || leftIsConstant)\n                {\n                    var dataPoint = new IndicatorDataPoint { Time = MaxTime(updated) };\n                    Update(dataPoint);\n                    // reset these to null after each update\n                    newLeftData = null;\n                    newRightData = null;\n                }\n            };\n        }\n\n        private DateTime MaxTime(IndicatorDataPoint updated)\n        {\n            return new DateTime(Math.Max(updated.Time.Ticks, Math.Max(Right.Current.Time.Ticks, Left.Current.Time.Ticks)));\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ConnorsRelativeStrengthIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the Connors Relative Strength Index (CRSI), a combination of \n    /// the traditional Relative Strength Index (RSI), a Streak RSI (SRSI), and  \n    /// Percent Rank.\n    /// This index is designed to provide a more robust measure of market strength \n    /// by combining momentum, streak behavior, and price change.\n    /// </summary>\n    public class ConnorsRelativeStrengthIndex : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Computes the traditional Relative Strength Index (RSI).\n        /// </summary>\n        private readonly RelativeStrengthIndex _rsi;\n\n        /// <summary>\n        /// Computes the RSI based on consecutive price streaks (SRSI).\n        /// </summary>\n        private readonly RelativeStrengthIndex _srsi;\n\n        /// <summary>\n        /// Stores recent price change ratios for calculating the Percent Rank.\n        /// </summary>\n        private readonly RollingWindow<decimal> _priceChangeRatios;\n\n        /// <summary>\n        /// Tracks the current trend streak (positive or negative) of price movements.\n        /// </summary>\n        private int _trendStreak;\n\n        /// <summary>\n        /// Stores the previous input data point.\n        /// </summary>\n        private IndicatorDataPoint _previousInput;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConnorsRelativeStrengthIndex\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator instance.</param>\n        /// <param name=\"rsiPeriod\">The period for the RSI calculation.</param>\n        /// <param name=\"rsiPeriodStreak\">The period for the Streak RSI calculation.</param>\n        /// <param name=\"lookBackPeriod\">The period for calculating the Percent Rank.</param>\n        public ConnorsRelativeStrengthIndex(string name, int rsiPeriod, int rsiPeriodStreak, int lookBackPeriod) : base(name)\n        {\n            _rsi = new RelativeStrengthIndex(rsiPeriod);\n            _srsi = new RelativeStrengthIndex(rsiPeriodStreak);\n            _priceChangeRatios = new RollingWindow<decimal>(lookBackPeriod);\n            _trendStreak = 0;\n            WarmUpPeriod = Math.Max(lookBackPeriod, Math.Max(_rsi.WarmUpPeriod, _srsi.WarmUpPeriod));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ConnorsRelativeStrengthIndex with specified RSI, Streak RSI, \n        /// and lookBack periods, using a default name format based on the provided parameters.\n        /// </summary>\n        public ConnorsRelativeStrengthIndex(int rsiPeriod, int rsiPeriodStreak, int rocPeriod)\n            : this($\"CRSI({rsiPeriod},{rsiPeriodStreak},{rocPeriod})\", rsiPeriod, rsiPeriodStreak, rocPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the indicator is ready for use.\n        /// The indicator is ready when all its components (RSI, SRSI, and PriceChangeRatios) are ready.\n        /// </summary>\n        public override bool IsReady => _rsi.IsReady && _srsi.IsReady && _priceChangeRatios.IsReady;\n\n        /// <summary>\n        /// Gets the warm-up period required for the indicator to be ready.\n        /// This is the maximum period of all components (RSI, SRSI, and PriceChangeRatios).\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value for the Connors Relative Strength Index (CRSI) based on the latest input data point.\n        /// The CRSI is calculated as the average of the traditional RSI, Streak RSI, and Percent Rank.\n        /// </summary>\n        /// <param name=\"input\">The current input data point (typically the price data for the current period).</param>\n        /// <returns>The computed CRSI value, which combines the RSI, Streak RSI, and Percent Rank into a single value. \n        /// Returns zero if the indicator is not yet ready.</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            // RSI\n            _rsi.Update(input);\n\n            ComputeTrendStreak(input);\n            _srsi.Update(new IndicatorDataPoint(input.EndTime, _trendStreak));\n\n            if (_previousInput == null || _previousInput.Value == 0)\n            {\n                _previousInput = input;\n                _priceChangeRatios.Add(0m);\n                return decimal.Zero;\n            }\n\n            // PercentRank\n            var relativeMagnitude = 0m;\n            var priceChangeRatio = (input.Value - _previousInput.Value) / _previousInput.Value;\n\n            // Calculate PercentRank using only the previous values (exclude the current priceChangeRatio)\n            if (_priceChangeRatios.IsReady)\n            {\n                relativeMagnitude = 100m * _priceChangeRatios.Count(x => x < priceChangeRatio) / _priceChangeRatios.Count;\n            }\n\n            // Add the current priceChangeRatio to the rolling window for future calculations\n            _priceChangeRatios.Add(priceChangeRatio);\n\n            _previousInput = input;\n\n            // CRSI\n            if (IsReady)\n            {\n                // Calculate the CRSI only if all components are ready\n                return (_rsi.Current.Value + _srsi.Current.Value + relativeMagnitude) / 3;\n            }\n\n            // If not ready, return 0\n            return decimal.Zero;\n        }\n\n        /// <summary>\n        /// Updates the trend streak based on the price change direction between the current and previous input.\n        /// Resets the streak if the direction changes, otherwise increments or decrements it.\n        /// </summary>\n        /// <param name=\"input\">The current input data point with price information.</param>\n        private void ComputeTrendStreak(IndicatorDataPoint input)\n        {\n            if (_previousInput == null)\n            {\n                return;\n            }\n            var change = input.Value - _previousInput.Value;\n            // If the price changes direction (up to down or down to up), reset the trend streak\n            if ((_trendStreak > 0 && change < 0) || (_trendStreak < 0 && change > 0))\n            {\n                _trendStreak = 0;\n            }\n            // Increment or decrement the trend streak based on price change direction\n            if (change > 0)\n            {\n                _trendStreak++;\n            }\n            else if (change < 0)\n            {\n                _trendStreak--;\n            }\n        }\n\n        /// <summary>\n        /// Resets the indicator to its initial state. This clears all internal data and resets\n        /// the RSI, Streak RSI, and PriceChangeRatios, as well as the trend streak counter.\n        /// </summary>\n        public override void Reset()\n        {\n            _rsi.Reset();\n            _srsi.Reset();\n            _priceChangeRatios.Reset();\n            _trendStreak = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ConstantIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// An indicator that will always return the same value.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of input this indicator takes</typeparam>\n    public sealed class ConstantIndicator<T> : IndicatorBase<T>\n        where T : IBaseData\n    {\n        private readonly decimal _value;\n\n        /// <summary>\n        /// Gets true since the ConstantIndicator is always ready to return the same value\n        /// </summary>\n        public override bool IsReady => true;\n\n        /// <summary>\n        /// Creates a new ConstantIndicator that will always return the specified value\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"value\">The constant value to be returned</param>\n        public ConstantIndicator(string name, decimal value)\n            : base(name)\n        {\n            _value = value;\n\n            // set this immediately so it always has the .Value property correctly set,\n            // the time will be updated anytime this indicators Update method gets called.\n            Current = new IndicatorDataPoint(DateTime.MinValue, value);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(T input)\n        {\n            return _value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n\n            // re-initialize the current value, constant should ALWAYS return this value\n            Current = new IndicatorDataPoint(DateTime.MinValue, _value);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CoppockCurve.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// A momentum indicator developed by Edwin “Sedge” Coppock in October 1965.\n    /// The goal of this indicator is to identify long-term buying opportunities in the S&amp;P500 and Dow Industrials.\n    /// Source: http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:coppock_curve\n    /// </summary>\n    public class CoppockCurve : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RateOfChangePercent _longRoc;\n        private readonly LinearWeightedMovingAverage _lwma;\n        private readonly RateOfChangePercent _shortRoc;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _lwma.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoppockCurve\" /> indicator with its default values.\n        /// </summary>\n        public CoppockCurve()\n            : this(11, 14, 10)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoppockCurve\"/> indicator\n        /// </summary>\n        /// <param name=\"shortRocPeriod\">The period for the short ROC</param>\n        /// <param name=\"longRocPeriod\">The period for the long ROC</param>\n        /// <param name=\"lwmaPeriod\">The period for the LWMA</param>\n        public CoppockCurve(int shortRocPeriod, int longRocPeriod, int lwmaPeriod)\n            : this($\"CC({shortRocPeriod},{longRocPeriod},{lwmaPeriod})\", shortRocPeriod, longRocPeriod, lwmaPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoppockCurve\" /> indicator\n        /// </summary>\n        /// <param name=\"name\">A name for the indicator</param>\n        /// <param name=\"shortRocPeriod\">The period for the short ROC</param>\n        /// <param name=\"longRocPeriod\">The period for the long ROC</param>\n        /// <param name=\"lwmaPeriod\">The period for the LWMA</param>\n        public CoppockCurve(string name, int shortRocPeriod, int longRocPeriod, int lwmaPeriod)\n            : base(name)\n        {\n            _shortRoc = new RateOfChangePercent(shortRocPeriod);\n            _longRoc = new RateOfChangePercent(longRocPeriod);\n            _lwma = new LinearWeightedMovingAverage(lwmaPeriod);\n\n            // Define our warmup\n            // LWMA does not get updated until ROC are warmed up and ready, so add our periods.\n            // Then minus 1 because on the same point ROC is ready LWMA will receive its first point.\n            WarmUpPeriod = Math.Max(_shortRoc.WarmUpPeriod, _longRoc.WarmUpPeriod) + lwmaPeriod - 1;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _shortRoc.Reset();\n            _longRoc.Reset();\n            _lwma.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _shortRoc.Update(input);\n            _longRoc.Update(input);\n            if (!_longRoc.IsReady || !_shortRoc.IsReady)\n            {\n                return decimal.Zero;\n            }\n            _lwma.Update(input.EndTime, _shortRoc.Current.Value + _longRoc.Current.Value);\n            return _lwma.Current.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Correlation.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Correlation Indicator is a valuable tool in technical analysis, designed to quantify the degree of\n    /// relationship between the price movements of a target security (e.g., a stock or ETF) and a reference\n    /// market index. It measures how closely the target’s price changes are aligned with the fluctuations of\n    /// the index over a specific period of time, providing insights into the target’s susceptibility to market\n    /// movements.\n    /// A positive correlation indicates that the target tends to move in the same direction as the market index,\n    /// while a negative correlation suggests an inverse relationship. A correlation close to 0 implies a weak or\n    /// no linear relationship.\n    /// Commonly, the SPX index is employed as the benchmark for the overall market when calculating correlation,\n    /// ensuring a consistent and reliable reference point. This helps traders and investors make informed decisions\n    /// regarding the risk and behavior of the target security in relation to market trends.\n    ///\n    /// The indicator only updates when both assets have a price for a time step. When a bar is missing for one of the assets,\n    /// the indicator value fills forward to improve the accuracy of the indicator.\n    /// </summary>\n    public class Correlation : DualSymbolIndicator<IBaseDataBar>\n    {\n        /// <summary>\n        /// Correlation type\n        /// </summary>\n        private readonly CorrelationType _correlationType;\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => TargetDataPoints.IsReady && ReferenceDataPoints.IsReady;\n\n        /// <summary>\n        /// Creates a new Correlation indicator with the specified name, target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"correlationType\">Correlation type</param>\n        public Correlation(string name, Symbol targetSymbol, Symbol referenceSymbol, int period, CorrelationType correlationType = CorrelationType.Pearson)\n            : base(name, targetSymbol, referenceSymbol, period)\n        {\n            // Assert the period is greater than two, otherwise the correlation can not be computed\n            if (period < 2)\n            {\n                throw new ArgumentException($\"Period parameter for Correlation indicator must be greater than 2 but was {period}\");\n            }\n            _correlationType = correlationType;\n        }\n\n        /// <summary>\n        /// Creates a new Correlation indicator with the specified target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <param name=\"correlationType\">Correlation type</param>\n        public Correlation(Symbol targetSymbol, Symbol referenceSymbol, int period, CorrelationType correlationType = CorrelationType.Pearson)\n            : this($\"Correlation({period})\", targetSymbol, referenceSymbol, period, correlationType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the correlation value usuing symbols values\n        /// correlation values assing into _correlation property\n        /// </summary>\n        protected override decimal ComputeIndicator()\n        {\n            var targetDataPoints = TargetDataPoints.Select(x => (double)x.Close);\n            var referenceDataPoints = ReferenceDataPoints.Select(x => (double)x.Close);\n            var newCorrelation = 0d;\n            if (_correlationType == CorrelationType.Pearson)\n            {\n                newCorrelation = MathNet.Numerics.Statistics.Correlation.Pearson(targetDataPoints, referenceDataPoints);\n            }\n            if (_correlationType == CorrelationType.Spearman)\n            {\n                newCorrelation = MathNet.Numerics.Statistics.Correlation.Spearman(targetDataPoints, referenceDataPoints);\n            }\n            if (newCorrelation.IsNaNOrZero())\n            {\n                newCorrelation = 0;\n            }\n            return Extensions.SafeDecimalCast(newCorrelation);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/CorrelationType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Defines the different types of Correlation\n    /// </summary>  \n    public enum CorrelationType\n    {\n        /// <summary>\n        /// Pearson Correlation (Product-Moment Correlation):\n        /// Measures the linear relationship between two datasets. The coefficient ranges from -1 to 1.\n        /// A value of 1 indicates a perfect positive linear relationship, -1 indicates a perfect\n        /// negative linear relationship, and 0 indicates no linear relationship.\n        /// It assumes that both datasets are normally distributed and the relationship is linear.\n        /// It is sensitive to outliers which can affect the correlation significantly.\n        /// </summary>\n        Pearson,\n        /// <summary>\n        /// Spearman Correlation (Rank Correlation):\n        /// Measures the strength and direction of the monotonic relationship between two datasets.\n        /// Instead of calculating the coefficient using raw data, it uses the rank of the data points.\n        /// This method is non-parametric and does not assume a normal distribution of the datasets.\n        /// It's useful when the data is not normally distributed or when the relationship is not linear.\n        /// Spearman's correlation is less sensitive to outliers than Pearson's correlation.\n        /// The coefficient also ranges from -1 to 1 with similar interpretations for the values,\n        /// but it reflects monotonic relationships rather than only linear ones.\n        /// </summary>\n        Spearman\n\n    }\n}\n"
  },
  {
    "path": "Indicators/Covariance.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing MathNet.Numerics.Statistics;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Covariance of two assets using the given Look-Back period.\n    /// The Covariance of two assets is a measure of their co-movement.\n    /// </summary>\n    public class Covariance : DualSymbolIndicator<IBaseDataBar>\n    {\n        /// <summary>\n        /// RollingWindow of returns of the target symbol in the given period\n        /// </summary>\n        private readonly RollingWindow<double> _targetReturns;\n\n        /// <summary>\n        /// RollingWindow of returns of the reference symbol in the given period\n        /// </summary>\n        private readonly RollingWindow<double> _referenceReturns;\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _targetReturns.IsReady && _referenceReturns.IsReady;\n\n        /// <summary>\n        /// Creates a new Covariance indicator with the specified name, target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        public Covariance(string name, Symbol targetSymbol, Symbol referenceSymbol, int period)\n            : base(name, targetSymbol, referenceSymbol, 2)\n        {\n            // Assert the period is greater than two, otherwise the covariance can not be computed\n            if (period < 2)\n            {\n                throw new ArgumentException($\"Period parameter for Covariance indicator must be greater than 2 but was {period}.\");\n            }\n\n            _targetReturns = new RollingWindow<double>(period);\n            _referenceReturns = new RollingWindow<double>(period);\n            WarmUpPeriod += (period - 2) + 1;\n        }\n\n        /// <summary>\n        /// Creates a new Covariance indicator with the specified target, reference,\n        /// and period values\n        /// </summary>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        public Covariance(Symbol targetSymbol, Symbol referenceSymbol, int period)\n            : this($\"COV({period})\", targetSymbol, referenceSymbol, period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Covariance indicator with the specified name, period, target and\n        /// reference values\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"targetSymbol\">The target symbol of this indicator</param>\n        /// <param name=\"referenceSymbol\">The reference symbol of this indicator</param>\n        /// <remarks>Constructor overload for backward compatibility.</remarks>\n        public Covariance(string name, int period, Symbol targetSymbol, Symbol referenceSymbol)\n            : this(name, targetSymbol, referenceSymbol, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the returns with the new given data point and the last given data point\n        /// </summary>\n        /// <param name=\"rollingWindow\">The collection of data points from which we want\n        /// to compute the return</param>\n        /// <returns>The returns with the new given data point</returns>\n        private static double GetNewReturn(IReadOnlyWindow<IBaseDataBar> rollingWindow)\n        {\n            return (double)(rollingWindow[0].Close.SafeDivision(rollingWindow[1].Close) - 1);\n        }\n\n        /// <summary>\n        /// Computes the covariance value of the target in relation with the reference\n        /// using the target and reference returns\n        /// </summary>\n        protected override decimal ComputeIndicator()\n        {\n            if (TargetDataPoints.IsReady)\n            {\n                _targetReturns.Add(GetNewReturn(TargetDataPoints));\n            }\n\n            if (ReferenceDataPoints.IsReady)\n            {\n                _referenceReturns.Add(GetNewReturn(ReferenceDataPoints));\n            }\n\n            var covarianceComputed = _targetReturns.Covariance(_referenceReturns);\n\n            // Avoid division with NaN or by zero\n            return (decimal)(!covarianceComputed.IsNaNOrZero() ? covarianceComputed : 0);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _targetReturns.Reset();\n            _referenceReturns.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/DeMarkerIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// In the DeMarker strategy, for some period of size N, set:\n    /// <para>\n    /// DeMax = High - Previous High, and \n    /// DeMin = Previous Low - Low\n    /// </para>\n    /// where, in the prior, if either term is less than zero (DeMax or DeMin), set it to zero.\n    /// We can now define the indicator itself, DEM, as:\n    ///<para>\n    /// DEM = MA(DeMax)/(MA(DeMax)+MA(DeMin))\n    ///</para>\n    /// where MA denotes a Moving Average of period N.\n    /// \n    /// https://www.investopedia.com/terms/d/demarkerindicator.asp\n    /// </summary>\n    public class DeMarkerIndicator : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly IndicatorBase<IndicatorDataPoint> _maxMA;\n        private readonly IndicatorBase<IndicatorDataPoint> _minMA;\n        private decimal _lastHigh;\n        private decimal _lastLow;\n\n        /// <summary>\n        /// Initializes a new instance of the DeMarkerIndicator class with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period of the  DeMarker Indicator</param>\n        /// <param name=\"type\">The type of moving average to use in calculations</param>\n        public DeMarkerIndicator(int period, MovingAverageType type = MovingAverageType.Simple)\n            : this($\"DEM({period},{type})\", period, type)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the DeMarkerIndicator class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the  DeMarker Indicator</param>\n        /// <param name=\"type\">The type of moving average to use in calculations</param>\n        public DeMarkerIndicator(string name, int period, MovingAverageType type = MovingAverageType.Simple)\n            : base(name)\n        {\n            _lastHigh = 0m;\n            _lastLow = 0m;\n            WarmUpPeriod = period;\n            _maxMA = type.AsIndicator(period);\n            _minMA = type.AsIndicator(period);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _maxMA.IsReady && _minMA.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _lastHigh = 0m;\n            _lastLow = 0m;\n            _maxMA.Reset();\n            _minMA.Reset();\n            base.Reset();\n        }\n\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var deMax = 0m;\n            var deMin = 0m;\n            if (Samples > 1)\n            {\n                // By default, DeMin and DeMax must be 0m initially\n                deMax = Math.Max(input.High - _lastHigh, 0);\n                deMin = Math.Max(_lastLow - input.Low, 0);\n            }\n\n            _maxMA.Update(input.EndTime, deMax);\n            _minMA.Update(input.EndTime, deMin);\n            _lastHigh = input.High;\n            _lastLow = input.Low;\n\n            if (!IsReady)\n            {\n                return 0m;\n            }\n\n            var currentValue = _maxMA + _minMA;\n            return currentValue > 0m ? _maxMA / currentValue : 0m;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Delay.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// An indicator that delays its input for a certain period\n    /// </summary>\n    public class Delay : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Creates a new Delay indicator that delays its input by the specified period\n        /// </summary>\n        /// <param name=\"period\">The period to delay input, must be greater than zero</param>\n        public Delay(int period)\n            : this($\"DELAY({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Delay indicator that delays its input by the specified period\n        /// </summary>\n        /// <param name=\"name\">Name of the delay window indicator</param>\n        /// <param name=\"period\">The period to delay input, must be greater than zero</param>\n        public Delay(string name, int period) \n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1 + Period;\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (!IsReady)\n            {\n                // grab the initial value until we're ready\n                return window[window.Count - 1].Value;\n            }\n\n            return window.MostRecentlyRemoved.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Delta.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Distributions;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Option Delta indicator that calculate the delta of an option\n    /// </summary>\n    /// <remarks>sensitivity of option price relative to $1 of underlying change</remarks>\n    public class Delta : OptionGreeksIndicatorBase\n    {\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Delta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Delta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Delta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Delta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>am>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Delta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Delta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Delta(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Delta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRate, dividendYield,\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Calculate the Delta of the option\n        /// </summary>\n        protected override decimal CalculateGreek(decimal timeTillExpiry)\n        {\n            var iv = (double)ImpliedVolatility.Current.Value;\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n\n            double result;\n\n            switch (_optionModel)\n            {\n                case OptionPricingModelType.BinomialCoxRossRubinstein:\n                    var upFactor = Math.Exp(iv * Math.Sqrt(timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps));\n                    if (upFactor == 1)\n                    {\n                        // provide a small step to estimate delta\n                        upFactor = 1.00001;\n                    }\n\n                    var sU = underlyingPrice * upFactor;\n                    var sD = underlyingPrice / upFactor;\n\n                    var fU = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, sU, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    var fD = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, sD, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n\n                    result = OptionGreekIndicatorsHelper.Divide(fU - fD, sU - sD);\n                    break;\n\n                case OptionPricingModelType.ForwardTree:\n                    var discount = Math.Exp((riskFreeRate - dividendYield) * timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps);\n                    upFactor = Math.Exp(iv * Math.Sqrt(timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps)) * discount;\n                    if (upFactor == 1)\n                    {\n                        // provide a small step to estimate delta\n                        upFactor = 1.00001;\n                    }\n                    var downFactor = Math.Exp(-iv * Math.Sqrt(timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps)) * discount;\n                    if (downFactor == 1)\n                    {\n                        // provide a small step to estimate delta\n                        downFactor = 0.99999;\n                    }\n\n                    sU = underlyingPrice * upFactor;\n                    sD = underlyingPrice * downFactor;\n\n                    fU = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, sU, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    fD = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, sD, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n\n                    result = OptionGreekIndicatorsHelper.Divide(fU - fD, sU - sD);\n                    break;\n\n                case OptionPricingModelType.BlackScholes:\n                default:\n                    var norm = new Normal();\n                    var d1 = OptionGreekIndicatorsHelper.CalculateD1(underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, iv);\n\n                    double wholeShareDelta;\n                    if (Right == OptionRight.Call)\n                    {\n                        wholeShareDelta = norm.CumulativeDistribution(d1);\n                    }\n                    else\n                    {\n                        wholeShareDelta = -norm.CumulativeDistribution(-d1);\n                    }\n\n                    result = wholeShareDelta * Math.Exp(-dividendYield * timeTillExpiryDouble);\n                    break;\n            }\n\n            return Convert.ToDecimal(result);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/DerivativeOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the Derivative Oscillator Indicator, utilizing\n    /// a moving average convergence-divergence (MACD) histogram to a double-smoothed relative strength index (RSI).\n    /// </summary>\n    public class DerivativeOscillator : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RelativeStrengthIndex _rsi;\n        private readonly ExponentialMovingAverage _smoothedRsi;\n        private readonly ExponentialMovingAverage _doubleSmoothedRsi;\n        private readonly SimpleMovingAverage _signalLine;\n        \n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _signalLine.IsReady;\n        \n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the IndicatorDerivativeOscillator class with the specified name and periods.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"rsiPeriod\">The period for the RSI calculation</param>\n        /// <param name=\"smoothingRsiPeriod\">The period for the smoothing RSI</param>\n        /// <param name=\"doubleSmoothingRsiPeriod\">The period for the double smoothing RSI</param>\n        /// <param name=\"signalLinePeriod\">The period for the signal line</param>\n        public DerivativeOscillator(string name, int rsiPeriod, int smoothingRsiPeriod, int doubleSmoothingRsiPeriod, int signalLinePeriod) : base(name)\n        {\n            _rsi = new RelativeStrengthIndex($\"{name}_RSI\", rsiPeriod);\n            _smoothedRsi = new ExponentialMovingAverage($\"{name}_SmoothedRSI\", smoothingRsiPeriod).Of(_rsi);\n            _doubleSmoothedRsi = new ExponentialMovingAverage($\"{name}_DoubleSmoothedRSI\", doubleSmoothingRsiPeriod).Of(_smoothedRsi);\n            _signalLine = new SimpleMovingAverage($\"{name}_SignalLine\", signalLinePeriod).Of(_doubleSmoothedRsi);\n            WarmUpPeriod = (rsiPeriod + smoothingRsiPeriod + doubleSmoothingRsiPeriod + signalLinePeriod - 3) + 1;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the IndicatorDerivativeOscillator class with the specified name and periods.\n        /// </summary>\n        /// <param name=\"rsiPeriod\">The period for the RSI calculation</param>\n        /// <param name=\"smoothingRsiPeriod\">The period for the smoothing RSI</param>\n        /// <param name=\"doubleSmoothingRsiPeriod\">The period for the double smoothing RSI</param>\n        /// <param name=\"signalLinePeriod\">The period for the signal line</param>\n        public DerivativeOscillator(int rsiPeriod, int smoothingRsiPeriod, int doubleSmoothingRsiPeriod, int signalLinePeriod)\n            : this($\"DO({rsiPeriod},{smoothingRsiPeriod},{doubleSmoothingRsiPeriod},{signalLinePeriod})\", rsiPeriod, smoothingRsiPeriod, doubleSmoothingRsiPeriod, signalLinePeriod)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for the derivative oscillator indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            // Chaining updates all of the other indicators\n            _rsi.Update(input);\n            \n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            return _doubleSmoothedRsi.Current.Value - _signalLine.Current.Value;\n        }\n        \n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rsi.Reset();\n            _smoothedRsi.Reset();\n            _doubleSmoothedRsi.Reset();\n            _signalLine.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/DetrendedPriceOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Detrended Price Oscillator is an indicator designed to remove trend from price\n    /// and make it easier to identify cycles.\n    /// DPO does not extend to the last date because it is based on a displaced moving average.\n    /// Is estimated as Price {X/2 + 1} periods ago less the X-period simple moving average.\n    /// E.g.DPO(20) equals price 11 days ago less the 20-day SMA.\n    /// </summary>\n    /// <seealso cref=\"IndicatorBase{IndicatorDataPoint}\" />\n    public class DetrendedPriceOscillator : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly Delay _priceLag;\n        private readonly SimpleMovingAverage _sma;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _sma.IsReady && _priceLag.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DetrendedPriceOscillator\" /> class.\n        /// </summary>\n        /// <param name=\"name\">The name for the indicator.</param>\n        /// <param name=\"period\">The number of periods to calculate the DPO.</param>\n        public DetrendedPriceOscillator(string name, int period)\n            : base(name)\n        {\n            var lagPeriod = period / 2 + 1;\n            _priceLag = new Delay(lagPeriod);\n            _sma = new SimpleMovingAverage(period);\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DetrendedPriceOscillator\" /> class.\n        /// </summary>\n        /// <param name=\"period\">The number of periods to calculate the DPO.</param>\n        public DetrendedPriceOscillator(int period)\n            : this($\"DPO({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _priceLag.Reset();\n            _sma.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _priceLag.Update(input);\n            _sma.Update(input);\n            return _priceLag.Current.Value - _sma.Current.Value;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/DonchianChannel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the upper and lower band of the Donchian Channel.\n    /// The upper band is computed by finding the highest high over the given period.\n    /// The lower band is computed by finding the lowest low over the given period.\n    /// The primary output value of the indicator is the mean of the upper and lower band for \n    /// the given timeframe.\n    /// </summary>\n    public class DonchianChannel : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the upper band of the Donchian Channel.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> UpperBand { get; }\n\n        /// <summary>\n        /// Gets the lower band of the Donchian Channel.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> LowerBand { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DonchianChannel\"/> class.\n        /// </summary>\n        /// <param name=\"period\">The period for both the upper and lower channels.</param>\n        public DonchianChannel(int period)\n            : this(period, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DonchianChannel\"/> class.\n        /// </summary>\n        /// <param name=\"upperPeriod\">The period for the upper channel.</param>\n        /// <param name=\"lowerPeriod\">The period for the lower channel</param>\n        public DonchianChannel(int upperPeriod, int lowerPeriod)\n            : this($\"DCH({lowerPeriod},{lowerPeriod})\", upperPeriod, lowerPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DonchianChannel\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"period\">The period for both the upper and lower channels.</param>\n        public DonchianChannel(string name, int period)\n            : this(name, period, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DonchianChannel\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"upperPeriod\">The period for the upper channel.</param>\n        /// <param name=\"lowerPeriod\">The period for the lower channel</param>\n        public DonchianChannel(string name, int upperPeriod, int lowerPeriod)\n            : base(name)\n        {\n            WarmUpPeriod = Math.Max(upperPeriod, lowerPeriod);\n            UpperBand = new Maximum(name + \"_UpperBand\", upperPeriod);\n            LowerBand = new Minimum(name + \"_LowerBand\", lowerPeriod);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => UpperBand.IsReady && LowerBand.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator, which by convention is the mean value of the upper band and lower band.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            UpperBand.Update(input.EndTime, input.High);\n            LowerBand.Update(input.EndTime, input.Low);\n            return (UpperBand + LowerBand) / 2;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            UpperBand.Reset();\n            LowerBand.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/DoubleExponentialMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Double Exponential Moving Average (DEMA).\n    /// The Double Exponential Moving Average is calculated with the following formula:\n    /// EMA2 = EMA(EMA(t,period),period)\n    /// DEMA = 2 * EMA(t,period) - EMA2\n    /// The Generalized DEMA (GD) is calculated with the following formula:\n    /// GD = (volumeFactor+1) * EMA(t,period) - volumeFactor * EMA2\n    /// </summary>\n    public class DoubleExponentialMovingAverage : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly decimal _volumeFactor;\n        private readonly ExponentialMovingAverage _ema1;\n        private readonly ExponentialMovingAverage _ema2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DoubleExponentialMovingAverage\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the DEMA</param>\n        /// <param name=\"volumeFactor\">The volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)</param>\n        public DoubleExponentialMovingAverage(string name, int period, decimal volumeFactor = 1m)\n            : base(name)\n        {\n            _period = period;\n            _volumeFactor = volumeFactor;\n            _ema1 = new ExponentialMovingAverage(name + \"_1\", period);\n            _ema2 = new ExponentialMovingAverage(name + \"_2\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DoubleExponentialMovingAverage\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the DEMA</param>\n        /// <param name=\"volumeFactor\">The volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)</param>\n        public DoubleExponentialMovingAverage(int period, decimal volumeFactor = 1m)\n            : this($\"DEMA({period})\", period, volumeFactor)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 2 * (_period - 1);\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1 + 2 * (_period - 1);\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _ema1.Update(input);\n\n            if (!_ema1.IsReady)\n                return _ema1.Current.Value;\n\n            _ema2.Update(_ema1.Current);\n\n            return (_volumeFactor + 1) * _ema1.Current.Value - _volumeFactor * _ema2.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _ema1.Reset();\n            _ema2.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/DualSymbolIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Base class for indicators that work with two different symbols and calculate an indicator based on them.\n    /// </summary>\n    /// <typeparam name=\"TInput\">Indicator input data type</typeparam>\n    public abstract class DualSymbolIndicator<TInput> : MultiSymbolIndicator<TInput>\n        where TInput : IBaseData\n    {\n        /// <summary>\n        /// RollingWindow to store the data points of the target symbol\n        /// </summary>\n        protected IReadOnlyWindow<TInput> TargetDataPoints { get; }\n\n        /// <summary>\n        /// RollingWindow to store the data points of the reference symbol\n        /// </summary>\n        protected IReadOnlyWindow<TInput> ReferenceDataPoints { get; }\n\n        /// <summary>\n        /// Symbol of the reference used\n        /// </summary>\n        protected Symbol ReferenceSymbol { get; }\n\n        /// <summary>\n        /// Symbol of the target used\n        /// </summary>\n        protected Symbol TargetSymbol { get; }\n\n        /// <summary>\n        /// Initializes the dual symbol indicator.\n        /// <para>\n        /// The constructor accepts a target symbol and a reference symbol. It also initializes\n        /// the time zones for both symbols and checks if they are different.\n        /// </para>\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"targetSymbol\">The symbol of the target asset.</param>\n        /// <param name=\"referenceSymbol\">The symbol of the reference asset.</param>\n        /// <param name=\"period\">The period (number of data points) over which to calculate the indicator.</param>\n        protected DualSymbolIndicator(string name, Symbol targetSymbol, Symbol referenceSymbol, int period)\n            : base(name, [targetSymbol, referenceSymbol], period)\n        {\n            TargetDataPoints = DataBySymbol[targetSymbol].DataPoints;\n            ReferenceDataPoints = DataBySymbol[referenceSymbol].DataPoints;\n            TargetSymbol = targetSymbol;\n            ReferenceSymbol = referenceSymbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/EaseOfMovementValue.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period Ease of Movement Value using the following:\n    /// MID = (high_1 + low_1)/2 - (high_0 + low_0)/2 \n    /// RATIO = (currentVolume/10000) / (high_1 - low_1)\n    /// EMV = MID/RATIO\n    /// _SMA = n-period of EMV\n    /// Returns _SMA\n    /// Source: https://www.investopedia.com/terms/e/easeofmovement.asp\n    /// </summary>\n    public class EaseOfMovementValue : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly SimpleMovingAverage _sma;\n        private readonly int _scale = 10000;\n        private decimal _previousHighMaximum;\n        private decimal _previousLowMinimum;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _sma.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _sma.WarmUpPeriod;\n\n        /// <summary>\n        /// Initializeds a new instance of the EaseOfMovement class using the specufued period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        /// <param name=\"scale\">The size of the number outputed by EMV</param>\n        public EaseOfMovementValue(int period = 1, int scale = 10000)\n            : this($\"EMV({period}, {scale})\", period, scale)\n        {\n        }\n        /// <summary>\n        /// Creates a new EaseOfMovement indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        /// <param name=\"scale\">The size of the number outputed by EMV</param>\n        public EaseOfMovementValue(string name, int period, int scale)\n            : base(name)\n        {\n            _sma = new SimpleMovingAverage(period);\n            _scale = scale;\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A a value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            if (_previousHighMaximum == 0 && _previousLowMinimum == 0)\n            {\n                _previousHighMaximum = input.High;\n                _previousLowMinimum = input.Low;\n            }\n\n            if (input.Volume == 0 || input.High == input.Low)\n            {\n                _sma.Update(input.EndTime, 0);\n                return _sma.Current.Value;\n            }\n\n            var midValue = ((input.High + input.Low) / 2) - ((_previousHighMaximum + _previousLowMinimum) / 2);\n            var midRatio = ((input.Volume / _scale) / (input.High - input.Low));\n\n            _previousHighMaximum = input.High;\n            _previousLowMinimum = input.Low;\n\n            _sma.Update(input.EndTime, midValue / midRatio);\n\n            return _sma.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _sma.Reset();\n            _previousHighMaximum = 0.0m;\n            _previousLowMinimum = 0.0m;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ExponentialMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the traditional exponential moving average indicator (EMA).\n    /// When the indicator is ready, the first value of the EMA is equivalent to the simple moving average.\n    /// After the first EMA value, the EMA value is a function of the previous EMA value.\n    /// Therefore, depending on the number of samples\n    /// you feed into the indicator, it can provide different EMA values for a single\n    /// security and lookback period. To make the indicator values consistent\n    /// across time, warm up the indicator with all the trailing security price history.\n    /// </summary>\n    public class ExponentialMovingAverage : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly decimal _k;\n        private readonly int _period;\n\n        private readonly SimpleMovingAverage _initialValueSMA;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Initializes a new instance of the ExponentialMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the EMA</param>\n        public ExponentialMovingAverage(string name, int period)\n            : this(name, period, SmoothingFactorDefault(period))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ExponentialMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the EMA</param>\n        /// <param name=\"smoothingFactor\">The percentage of data from the previous value to be carried into the next value</param>\n        public ExponentialMovingAverage(string name, int period, decimal smoothingFactor)\n            : base(name)\n        {\n            _period = period;\n            _k = smoothingFactor;\n            _initialValueSMA = new SimpleMovingAverage(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ExponentialMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the EMA</param>\n        public ExponentialMovingAverage(int period)\n            : this($\"EMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ExponentialMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the EMA</param>\n        /// <param name=\"smoothingFactor\">The percentage of data from the previous value to be carried into the next value</param>\n        public ExponentialMovingAverage(int period, decimal smoothingFactor)\n            : this($\"EMA({period},{smoothingFactor})\", period, smoothingFactor)\n        {\n        }\n\n        /// <summary>\n        /// Calculates the default smoothing factor for an ExponentialMovingAverage indicator\n        /// </summary>\n        /// <param name=\"period\">The period of the EMA</param>\n        /// <returns>The default smoothing factor</returns>\n        public static decimal SmoothingFactorDefault(int period) => 2.0m / (1 + period);\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _initialValueSMA.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            // we need to compute the initial value for the EMA, which is the SMA of the first N samples\n            if (Samples <= _period)\n            {\n                _initialValueSMA.Update(input);\n            }\n\n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            if (Samples == _period)\n            {\n                // first value is the SMA of the first period\n                return _initialValueSMA.Current.Value;\n            }\n\n            return input.Value * _k + Current.Value * (1 - _k);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/FilteredIdentity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator that is a ready after ingesting a single sample and\n    /// always returns the same value as it is given if it passes a filter condition\n    /// </summary>\n    public class FilteredIdentity : IndicatorBase<IBaseData>\n    {\n        private IBaseData _previousInput;\n        private readonly Func<IBaseData, bool> _filter;\n\n        /// <summary>\n        /// Initializes a new instance of the FilteredIdentity indicator with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        public FilteredIdentity(string name, Func<IBaseData, bool> filter)\n            : base(name)\n        {\n            // default our filter to true (do not filter)\n            _filter = filter ?? (x => true);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the FilteredIdentity indicator with the specified name\n        /// </summary>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        public FilteredIdentity(Func<IBaseData, bool> filter) : this(\"\", filter) { }\n\n        /// <summary>\n        /// Initializes a new instance of the FilteredIdentity indicator with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        public FilteredIdentity(string name, PyObject filter)\n            : this(name, filter.SafeAs<Func<IBaseData, bool>>())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the FilteredIdentity indicator with the specified name\n        /// </summary>\n        /// <param name=\"filter\">Filters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter</param>\n        public FilteredIdentity(PyObject filter) : this(\"\", filter) { }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 0 && Current.Value > 0;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseData input)\n        {\n            if (_filter(input))\n            {\n                _previousInput = input;\n                return input.Value;\n            }\n\n            if (_previousInput != null)\n            {\n                return _previousInput.Value;\n            }\n\n            // if _previousInput is null, create an empty IBaseData object of the same type of the input\n            switch (input.DataType)\n            {\n                case MarketDataType.TradeBar:\n                    _previousInput = new TradeBar();\n                    break;\n                case MarketDataType.QuoteBar:\n                    _previousInput = new QuoteBar();\n                    break;\n                default:\n                    _previousInput = new Tick();\n                    break;\n            }\n\n            return _previousInput.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/FisherTransform.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Fisher transform is a mathematical process which is used to convert any data set to a modified\n    /// data set whose Probability Distribution Function is approximately Gaussian. Once the Fisher transform\n    /// is computed, the transformed data can then be analyzed in terms of it's deviation from the mean.\n    ///\n    /// The equation is y = .5 * ln [ 1 + x / 1 - x ] where\n    /// x is the input\n    /// y is the output\n    /// ln is the natural logarithm\n    ///\n    /// The Fisher transform has much sharper turning points than other indicators such as MACD\n    ///\n    /// For more info, read chapter 1 of Cybernetic Analysis for Stocks and Futures by John F. Ehlers\n    ///\n    /// We are implementing the latest version of this indicator found at Fig. 4 of\n    /// http://www.mesasoftware.com/papers/UsingTheFisherTransform.pdf\n    /// </summary>\n    public class FisherTransform : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private const double _alpha = .33;\n        private double _previous;\n        private readonly Minimum _medianMin;\n        private readonly Maximum _medianMax;\n\n        /// <summary>\n        /// Initializes a new instance of the FisherTransform class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the WMA</param>\n        public FisherTransform(int period)\n            : this($\"FISH({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// A Fisher Transform of Prices\n        /// </summary>\n        /// <param name=\"name\">string - the name of the indicator</param>\n        /// <param name=\"period\">The number of periods for the indicator</param>\n        public FisherTransform(string name, int period)\n            : base(name)\n        {\n            // Initialize the local variables\n            _medianMax = new Maximum(\"MedianMax\", period);\n            _medianMin = new Minimum(\"MedianMin\", period);\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _medianMax.IsReady && _medianMax.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value in the transform.\n        /// value1 is a function used to normalize price withing the last _period day range.\n        /// value1 is centered on its midpoint and then doubled so that value1 wil swing between -1 and +1.\n        /// value1 is also smoothed with an exponential moving average whose alpha is 0.33.\n        ///\n        /// Since the smoothing may allow value1 to exceed the _period day price range, limits are introduced to\n        /// preclude the transform from blowing up by having an input larger than unity.\n        /// </summary>\n        /// <param name=\"input\">IndicatorDataPoint - the time and value of the next price</param>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var price = (input.Low + input.High) / 2m;\n            _medianMin.Update(input.EndTime, price);\n            _medianMax.Update(input.EndTime, price);\n\n            if (!IsReady) return 0;\n\n            var x = 0.0;\n            var y = 0.0;\n            var minL = _medianMin.Current.Value;\n            var maxH = _medianMax.Current.Value;\n\n            if (minL != maxH)\n            {\n                x = _alpha * 2 * ((double)((price - minL) / (maxH - minL)) - .5) + (1 - _alpha) * _previous;\n                y = FisherTransformFunction(x);\n            }\n            _previous = x;\n\n            return Convert.ToDecimal(y) + .5m * Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previous = 0;\n            _medianMax.Reset();\n            _medianMin.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// The Fisher transform is a mathematical process which is used to convert any data set to a modified\n        /// data set whose Probability Distribution Function is approximately Gaussian. Once the Fisher transform\n        /// is computed, the transformed data can then be analyzed in terms of it's deviation from the mean.\n        ///\n        /// The equation is y = .5 * ln [ 1 + x / 1 - x ] where\n        /// x is the input\n        /// y is the output\n        /// ln is the natural logarithm\n        ///\n        /// The Fisher transform has much sharper turning points than other indicators such as MACD\n        ///\n        /// For more info, read chapter 1 of Cybernetic Analysis for Stocks and Futures by John F. Ehlers\n        /// </summary>\n        /// <param name=\"x\">Input</param>\n        /// <returns>Output</returns>\n        private double FisherTransformFunction(double x)\n        {\n            if (x > .999)\n            {\n                x = .999;\n            }\n            if (x < -.999)\n            {\n                x = -.999;\n            }\n\n            return .5 * Math.Log((1.0 + x) / (1.0 - x));\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ForceIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Force Index is calculated by comparing the current market price with the previous market price \n    /// and multiplying its difference with the traded volume during a specific time period.\n    /// </summary>\n    public class ForceIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private TradeBar _previousInput;\n\n        /// <summary>\n        /// This indicator is used to smooth the ForceIndex computation\n        /// </summary>\n        /// <remarks>This is not exposed publicly since it is the same value as this indicator, meaning\n        /// that this '_smoother' computers the ForceIndex directly, so exposing it publicly would be duplication</remarks>\n        private readonly IndicatorBase<IndicatorDataPoint> _smoother;\n\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _smoother.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new ForceIndex indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The smoothing period used to smooth the instantaneous force index values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public ForceIndex(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Exponential)\n            : base(name)\n        {\n            _smoother = movingAverageType.AsIndicator($\"{name}_{movingAverageType}\", period);\n            WarmUpPeriod = period + 1;\n\n        }\n\n        /// <summary>\n        /// Creates a new ForceIndex indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"period\">The smoothing period used to smooth the instantenous force index values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the instantenous force index values</param>\n        public ForceIndex(int period, MovingAverageType movingAverageType = MovingAverageType.Exponential)\n            : this($\"FI({period})\", period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            if (Samples < 2)\n            {\n                _previousInput = input;\n                return 0;\n            }\n            // compute the instantaneous force index and then send it to our smoother\n            \n            _smoother.Update(input.EndTime, (input.Close - _previousInput.Close) * input.Volume);\n\n            _previousInput = input;\n\n            return _smoother.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previousInput = null;\n            _smoother.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/FractalAdaptiveMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Fractal Adaptive Moving Average (FRAMA) by John Ehlers\n    /// </summary>\n    public class FractalAdaptiveMovingAverage : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _n = 16;\n        private readonly double _w = -4.6;\n        private readonly RollingWindow<double> _high;\n        private readonly RollingWindow<double> _low;\n\n        /// <summary>\n        /// Initializes a new instance of the average class\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator instance</param>\n        /// <param name=\"n\">The window period (must be even). Example value: 16</param>\n        /// <param name=\"longPeriod\">The average period. Example value: 198</param>\n        public FractalAdaptiveMovingAverage(string name, int n, int longPeriod)\n            : base(name)\n        {\n            if (n % 2 > 0)\n            {\n                throw new ArgumentException($\"{name}: N must be even, N = {n}\", nameof(n));\n            }\n            _n = n;\n            _w = Math.Log(2d / (1 + longPeriod));\n            _high = new RollingWindow<double>(n);\n            _low = new RollingWindow<double>(n);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the average class\n        /// </summary>\n        /// <param name=\"n\">The window period (must be even). Example value: 16</param>\n        /// <param name=\"longPeriod\">The average period. Example value: 198</param>\n        public FractalAdaptiveMovingAverage(int n, int longPeriod)\n            : this($\"FRAMA({n},{longPeriod})\", n, longPeriod)\n        {\n\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the average class\n        /// </summary>\n        /// <param name=\"n\">The window period (must be even). Example value: 16</param>\n        public FractalAdaptiveMovingAverage(int n)\n            : this(n, 198)\n        {\n        }\n\n        /// <summary>\n        /// Computes the average value\n        /// </summary>\n        /// <param name=\"input\">The data for the calculation</param>\n        /// <returns>The average value</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var price = (input.High + input.Low) / 2;\n            _high.Add((double)input.High);\n            _low.Add((double)input.Low);\n\n            // our first data point just return identity\n            if (_high.Samples <= _high.Size)\n            {\n                return price;\n            }\n\n            var hh = _high.Take(_n / 2).Max();\n            var ll = _low.Take(_n / 2).Min();\n            var n1 = (hh - ll) / (_n / 2);\n\n            hh = _high.Skip(_n / 2).Take(_n / 2).Max();\n            ll = _low.Skip(_n / 2).Take(_n / 2).Min();\n\n            var n2 = (hh - ll) / (_n / 2);\n            var n3 = (_high.Max() - _low.Min()) / _n;\n\n            double dimen = 0;\n\n            if (n1 + n2 > 0 && n3 > 0)\n            {\n                var log = Math.Log((n1 + n2) / n3);\n                dimen = (double.IsNaN(log) ? 0 : log) / Math.Log(2);\n            }\n\n            var alpha = Math.Exp(_w * (dimen - 1));\n\n            if (alpha < .01)\n            {\n                alpha = .01;\n            }\n            if (alpha > 1)\n            {\n                alpha = 1;\n            }\n\n            return (decimal)alpha * price + (1 - (decimal)alpha) * Current.Value;\n        }\n\n        /// <summary>\n        /// Returns whether the indicator will return valid results\n        /// </summary>\n        public override bool IsReady => _high.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _high.Size;\n\n        /// <summary>\n        /// Resets the average to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _high.Reset();\n            _low.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/FunctionalIndicator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The functional indicator is used to lift any function into an indicator. This can be very useful\n    /// when trying to combine output of several indicators, or for expression a mathematical equation\n    /// </summary>\n    /// <typeparam name=\"T\">The input type for this indicator</typeparam>\n    public class FunctionalIndicator<T> : IndicatorBase<T>\n        where T : IBaseData\n    {\n        /// <summary>function implementation of the IndicatorBase.IsReady property</summary>\n        private readonly Func<IndicatorBase<T>, bool> _isReady;\n        /// <summary>Action used to reset this indicator completely along with any indicators this one is dependent on</summary>\n        private readonly Action _reset;\n        /// <summary>function implementation of the IndicatorBase.ComputeNextValue method</summary>\n        private readonly Func<T, decimal> _computeNextValue;\n\n        /// <summary>\n        /// Creates a new FunctionalIndicator using the specified functions as its implementation.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"computeNextValue\">A function accepting the input value and returning this indicator's output value</param>\n        /// <param name=\"isReady\">A function accepting this indicator and returning true if the indicator is ready, false otherwise</param>\n        public FunctionalIndicator(string name, Func<T, decimal> computeNextValue, Func<IndicatorBase<T>, bool> isReady)\n            : base(name)\n        {\n            _computeNextValue = computeNextValue;\n            _isReady = isReady;\n        }\n\n        /// <summary>\n        /// Creates a new FunctionalIndicator using the specified functions as its implementation.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"computeNextValue\">A function accepting the input value and returning this indicator's output value</param>\n        /// <param name=\"isReady\">A function accepting this indicator and returning true if the indicator is ready, false otherwise</param>\n        /// <param name=\"reset\">Function called to reset this indicator and any indicators this is dependent on</param>\n        public FunctionalIndicator(string name, Func<T, decimal> computeNextValue, Func<IndicatorBase<T>, bool> isReady, Action reset)\n            : base(name)\n        {\n            _computeNextValue = computeNextValue;\n            _isReady = isReady;\n            _reset = reset;\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return _isReady(this); }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(T input)\n        {\n            return _computeNextValue(input);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state, optionally using the reset action passed via the constructor\n        /// </summary>\n        public override void Reset()\n        {\n            if (_reset != null)\n            {\n                // if a reset function was specified then use that\n                _reset.Invoke();\n            }\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Gamma.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Distributions;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Option Gamma indicator that calculate the gamma of an option\n    /// </summary>\n    /// <remarks>derivative of option price change relative to $1 underlying changes</remarks>\n    public class Gamma : OptionGreeksIndicatorBase\n    {\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Gamma({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Gamma({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Gamma({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Gamma({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>am>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Gamma class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Gamma</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Gamma(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Gamma({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRate, dividendYield,\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Calculate the Gamma of the option\n        /// </summary>\n        protected override decimal CalculateGreek(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n            var iv = (double)ImpliedVolatility.Current.Value;\n\n            double result;\n\n            switch (_optionModel)\n            {\n                case OptionPricingModelType.BlackScholes:\n                    var norm = new Normal();\n                    var d1 = OptionGreekIndicatorsHelper.CalculateD1(underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, iv);\n\n                    // allow at least 1% IV\n                    result = norm.Density(-d1) / underlyingPrice / Math.Max(iv, 0.01) / Math.Sqrt(timeTillExpiryDouble);\n                    break;\n\n                case OptionPricingModelType.BinomialCoxRossRubinstein:\n                case OptionPricingModelType.ForwardTree:\n                    var upFactor = Math.Exp(iv * Math.Sqrt(timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps));\n                    if (upFactor == 1)\n                    {\n                        // provide a small step to estimate gamma\n                        upFactor = 1.0001;\n                    }\n\n                    // Finite differencing approach\n                    var sU = underlyingPrice * upFactor * upFactor;\n                    var sD = underlyingPrice / upFactor / upFactor;\n\n                    var fU = 0d;\n                    var fM = 0d;\n                    var fD = 0d;\n                    if (_optionModel == OptionPricingModelType.BinomialCoxRossRubinstein)\n                    {\n                        fU = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, sU, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        fM = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        fD = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, sD, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n                    else if (_optionModel == OptionPricingModelType.ForwardTree)\n                    {\n                        fU = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, sU, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        fM = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        fD = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, sD, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n\n                    var gammaU = (fU - fM) / (sU - underlyingPrice);\n                    var gammaD = (fM - fD) / (underlyingPrice - sD);\n\n                    result = OptionGreekIndicatorsHelper.Divide((gammaU - gammaD) * 2, sU - sD);\n                    break;\n\n                default:\n                    throw new Exception(\"Unrecognized Option Pricing Model\");\n            }\n\n            return Convert.ToDecimal(result);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/GreeksIndicators.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Helper class that holds and updates the greeks indicators\n    /// </summary>\n    public class GreeksIndicators\n    {\n        private readonly static IRiskFreeInterestRateModel _interestRateProvider = new InterestRateProvider();\n        private readonly static IDividendYieldModel _constantDividendYieldModel = new ConstantDividendYieldModel(0);\n\n        private readonly Symbol _optionSymbol;\n        private readonly Symbol _mirrorOptionSymbol;\n\n        /// <summary>\n        /// Gets the implied volatility indicator\n        /// </summary>\n        public ImpliedVolatility ImpliedVolatility { get; }\n\n        /// <summary>\n        /// Gets the delta indicator\n        /// </summary>\n        public Delta Delta { get; }\n\n        /// <summary>\n        /// Gets the gamma indicator\n        /// </summary>\n        public Gamma Gamma { get; }\n\n        /// <summary>\n        /// Gets the vega indicator\n        /// </summary>\n        public Vega Vega { get; }\n\n        /// <summary>\n        /// Gets the daily theta indicator\n        /// </summary>\n        public Theta ThetaPerDay { get; }\n\n        /// <summary>\n        /// Gets the rho indicator\n        /// </summary>\n        public Rho Rho { get; }\n\n        /// <summary>\n        /// Gets the interest rate used in the calculations\n        /// </summary>\n        public decimal InterestRate => Delta.RiskFreeRate;\n\n        /// <summary>\n        /// Gets the dividend yield used in the calculations\n        /// </summary>\n        public decimal DividendYield => Delta.DividendYield;\n\n        /// <summary>\n        /// Gets the current greeks values\n        /// </summary>\n        public Greeks Greeks\n        {\n            get\n            {\n                var theta = 0m;\n                var thetaPerDay = ThetaPerDay.Current.Value;\n                try\n                {\n                    theta = thetaPerDay * 365m;\n                }\n                catch (OverflowException)\n                {\n                    theta = thetaPerDay < 0 ? decimal.MinValue : decimal.MaxValue;\n                }\n\n                return new Greeks(Delta, Gamma, Vega, theta, Rho, 0m);\n            }\n        }\n\n        /// <summary>\n        /// Whether the mirror option is set and will be used in the calculations.\n        /// </summary>\n        public bool UseMirrorOption => _mirrorOptionSymbol != null;\n\n        /// <summary>\n        /// Gets the current result of the greeks indicators, including the implied volatility, theoretical price and greeks values\n        /// </summary>\n        public OptionPriceModelResult CurrentResult => new OptionPriceModelResult(ImpliedVolatility.TheoreticalPrice, ImpliedVolatility, Greeks);\n\n        /// <summary>\n        /// Gets the dividend yield model to be used in the calculations for the specified option symbol.\n        /// </summary>\n        public static IDividendYieldModel GetDividendYieldModel(Symbol optionSymbol)\n        {\n            return optionSymbol.SecurityType != SecurityType.IndexOption\n                ? DividendYieldProvider.CreateForOption(optionSymbol)\n                : _constantDividendYieldModel;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"GreeksIndicators\"/> class\n        /// </summary>\n        public GreeksIndicators(Symbol optionSymbol, Symbol mirrorOptionSymbol, OptionPricingModelType? optionModel = null,\n            OptionPricingModelType? ivModel = null, IDividendYieldModel dividendYieldModel = null,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel = null)\n        {\n            _optionSymbol = optionSymbol;\n            _mirrorOptionSymbol = mirrorOptionSymbol;\n\n            dividendYieldModel ??= GetDividendYieldModel(optionSymbol);\n            riskFreeInterestRateModel ??= _interestRateProvider;\n\n            ImpliedVolatility = new ImpliedVolatility(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, ivModel);\n            Delta = new Delta(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, optionModel, ivModel);\n            Gamma = new Gamma(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, optionModel, ivModel);\n            Vega = new Vega(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, optionModel, ivModel);\n            ThetaPerDay = new Theta(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, optionModel, ivModel);\n            Rho = new Rho(_optionSymbol, riskFreeInterestRateModel, dividendYieldModel, _mirrorOptionSymbol, optionModel, ivModel);\n\n            Delta.ImpliedVolatility = ImpliedVolatility;\n            Gamma.ImpliedVolatility = ImpliedVolatility;\n            Vega.ImpliedVolatility = ImpliedVolatility;\n            ThetaPerDay.ImpliedVolatility = ImpliedVolatility;\n            Rho.ImpliedVolatility = ImpliedVolatility;\n        }\n\n        /// <summary>\n        /// Feeds the specified data into the indicators\n        /// </summary>\n        public void Update(IBaseData data)\n        {\n            ImpliedVolatility.Update(data);\n            Delta.Update(data);\n            Gamma.Update(data);\n            Vega.Update(data);\n            ThetaPerDay.Update(data);\n            Rho.Update(data);\n        }\n\n        /// <summary>\n        /// Resets the indicators to their default state\n        /// </summary>\n        public void Reset()\n        {\n            ImpliedVolatility.Reset();\n            Delta.Reset();\n            Gamma.Reset();\n            Vega.Reset();\n            ThetaPerDay.Reset();\n            Rho.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/HeikinAshi.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Heikin-Ashi bar (HA)\n    /// The Heikin-Ashi bar is calculated using the following formulas:\n    /// HA_Close[0] = (Open[0] + High[0] + Low[0] + Close[0]) / 4\n    /// HA_Open[0] = (HA_Open[1] + HA_Close[1]) / 2\n    /// HA_High[0] = MAX(High[0], HA_Open[0], HA_Close[0])\n    /// HA_Low[0] = MIN(Low[0], HA_Open[0], HA_Close[0])\n    /// </summary>\n    public class HeikinAshi : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the Heikin-Ashi Open\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Open { get; }\n\n        /// <summary>\n        /// Gets the Heikin-Ashi High\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> High { get; }\n\n        /// <summary>\n        /// Gets the Heikin-Ashi Low\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Low { get; }\n\n        /// <summary>\n        /// Gets the Heikin-Ashi Close\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Close { get; }\n\n        /// <summary>\n        /// Gets the Heikin-Ashi Volume\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Volume { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HeikinAshi\"/> class using the specified name.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        public HeikinAshi(string name)\n            : base(name)\n        {\n            Open = new Identity(name + \"_Open\");\n            High = new Identity(name + \"_High\");\n            Low = new Identity(name + \"_Low\");\n            Close = new Identity(name + \"_Close\");\n            Volume = new Identity(name + \"_Volume\");\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HeikinAshi\"/> class.\n        /// </summary> \n        public HeikinAshi()\n            : this(\"HA\")\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 1;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns> A new value for this indicator </returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (!IsReady)\n            {\n                Open.Update(input.EndTime, (input.Open + input.Close) / 2);\n                Close.Update(input.EndTime, (input.Open + input.High + input.Low + input.Close) / 4);\n                High.Update(input.EndTime, input.High);\n                Low.Update(input.EndTime, input.Low);\n            }\n            else\n            {\n                Open.Update(input.EndTime, (Open.Current.Value + Close.Current.Value) / 2);\n                Close.Update(input.EndTime, (input.Open + input.High + input.Low + input.Close) / 4);\n                High.Update(input.EndTime, Math.Max(input.High, Math.Max(Open.Current.Value, Close.Current.Value)));\n                Low.Update(input.EndTime, Math.Min(input.Low, Math.Min(Open.Current.Value, Close.Current.Value)));\n            }\n\n            var volume = 0.0m;\n            if (input is TradeBar)\n            {\n                volume = ((TradeBar)input).Volume;\n            }\n            else if (input is RenkoBar)\n            {\n                volume = ((RenkoBar)input).Volume;\n            }\n            Volume.Update(input.EndTime, volume);\n\n            return Close.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Open.Reset();\n            High.Reset();\n            Low.Reset();\n            Close.Reset();\n            Volume.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/HilbertTransform.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Diagnostics;\n\nnamespace QuantConnect.Indicators;\n\n/// <summary>\n/// This indicator computes the Hilbert Transform Indicator by John Ehlers.\n/// By using present and prior price differences, and some feedback, price values are split into their complex number components\n/// of real (inPhase) and imaginary (quadrature) parts.\n/// <remark>Source: http://www.technicalanalysis.org.uk/moving-averages/Ehle.pdf</remark>\n/// </summary>\npublic class HilbertTransform : Indicator, IIndicatorWarmUpPeriodProvider\n{\n    private readonly int _length;\n    private readonly IndicatorBase<IndicatorDataPoint> _input;\n    private readonly IndicatorBase<IndicatorDataPoint> _prev;\n    private readonly IndicatorBase<IndicatorDataPoint> _detrendPrice;\n    private readonly IndicatorBase<IndicatorDataPoint> _detrendPriceDelay2;\n    private readonly IndicatorBase<IndicatorDataPoint> _detrendPriceDelay4;\n    private readonly IndicatorBase<IndicatorDataPoint> _inPhaseDelay3;\n    private readonly IndicatorBase<IndicatorDataPoint> _quadratureDelay2;\n\n    /// <summary>\n    /// Real (inPhase) part of complex number component of price values\n    /// </summary>\n    public IndicatorBase<IndicatorDataPoint> InPhase { get; }\n\n    /// <summary>\n    /// Imaginary (quadrature) part of complex number component of price values\n    /// </summary>\n    public IndicatorBase<IndicatorDataPoint> Quadrature { get; }\n\n    /// <summary>\n    /// Required period, in data points, for the indicator to be ready and fully initialized.\n    /// </summary>\n    public int WarmUpPeriod => _length + 2;\n\n    /// <summary>\n    /// Gets a flag indicating when this indicator is ready and fully initialized\n    /// </summary>\n    public override bool IsReady => Samples >= WarmUpPeriod;\n\n    /// <summary>\n    /// Creates a new Hilbert Transform indicator\n    /// </summary>\n    /// <param name=\"name\">The name of this indicator</param>\n    /// <param name=\"length\">The length of the FIR filter used in the calculation of the Hilbert Transform.\n    /// This parameter determines the number of filter coefficients in the FIR filter.</param>\n    /// <param name=\"inPhaseMultiplicationFactor\">The multiplication factor used in the calculation of the in-phase component of the Hilbert Transform. \n    /// This parameter adjusts the sensitivity and responsiveness of the transform to changes in the input signal.</param>\n    /// <param name=\"quadratureMultiplicationFactor\">The multiplication factor used in the calculation of the quadrature component of the Hilbert Transform. \n    /// This parameter also adjusts the sensitivity and responsiveness of the transform to changes in the input signal.</param>\n    public HilbertTransform(string name, int length, decimal inPhaseMultiplicationFactor, decimal quadratureMultiplicationFactor)\n        : base(name)\n    {\n        _length = length;\n\n        _input = new Identity(name + \"_input\");\n        _prev = new Delay(name + \"_prev\", length);\n        _detrendPrice = _input.Minus(_prev);\n        // 2nd and 4th order difference in detrended price, thus being the 1st and 3rd delay\n        _detrendPriceDelay2 = new Delay(name + \"_detrendPriceDelay2\", 1);\n        _detrendPriceDelay4 = new Delay(name + \"_detrendPriceDelay4\", 3);\n        // Update after InPhase & Quadrature property, so delay length -1\n        _inPhaseDelay3 = new Delay(name + \"_inPhaseDelay3\", 2);\n        _quadratureDelay2 = new Delay(name + \"_quadratureDelay2\", 1);\n\n        InPhase = new FunctionalIndicator<IndicatorDataPoint>(name + \"_inPhase\",\n            _ =>\n            {\n                if (!InPhase!.IsReady)\n                {\n                    return 0m;\n                }\n\n                var v2Value = _detrendPriceDelay2.IsReady ? _detrendPriceDelay2.Current.Value : 0m;\n                var v4Value = _detrendPriceDelay4.IsReady ? _detrendPriceDelay4.Current.Value : 0m;\n                var inPhase3Value = _inPhaseDelay3.IsReady ? _inPhaseDelay3.Current.Value : 0m;\n                return 1.25m * (v4Value - v2Value * inPhaseMultiplicationFactor) + inPhase3Value * inPhaseMultiplicationFactor;\n            },\n            _ => Samples > length + 2,\n            () =>\n            {\n                _detrendPrice.Reset();\n                _detrendPriceDelay2.Reset();\n                _detrendPriceDelay4.Reset();\n                _inPhaseDelay3.Reset();\n            });\n\n        Quadrature = new FunctionalIndicator<IndicatorDataPoint>(name + \"_quad\",\n            _ =>\n            {\n                if (!Quadrature!.IsReady)\n                {\n                    return 0m;\n                }\n\n                var v2Value = _detrendPriceDelay2.IsReady ? _detrendPriceDelay2.Current.Value : 0m;\n                var v1Value = _detrendPrice.IsReady ? _detrendPrice.Current.Value : 0m;\n                var quadrature2Value = _quadratureDelay2.IsReady ? _quadratureDelay2.Current.Value : 0m;\n                return v2Value - v1Value * quadratureMultiplicationFactor + quadrature2Value * quadratureMultiplicationFactor;\n            },\n            _ => Samples > length,\n            () =>\n            {\n                _detrendPrice.Reset();\n                _detrendPriceDelay2.Reset();\n                _quadratureDelay2.Reset();\n            });\n    }\n\n    /// <summary>\n    /// Creates a new Hilbert Transform indicator with default name and default params\n    /// </summary>\n    /// <param name=\"length\">The length of the FIR filter used in the calculation of the Hilbert Transform.\n    /// This parameter determines the number of filter coefficients in the FIR filter.</param>\n    /// <param name=\"inPhaseMultiplicationFactor\">The multiplication factor used in the calculation of the in-phase component\n    /// of the Hilbert Transform. This parameter adjusts the sensitivity and responsiveness of\n    /// the transform to changes in the input signal.</param>\n    /// <param name=\"quadratureMultiplicationFactor\">The multiplication factor used in the calculation of the quadrature component of\n    /// the Hilbert Transform. This parameter also adjusts the sensitivity and responsiveness of the\n    /// transform to changes in the input signal.</param>\n    public HilbertTransform(int length = 7, decimal inPhaseMultiplicationFactor = 0.635m, decimal quadratureMultiplicationFactor = 0.338m)\n        : this($\"Hilbert({length}, {inPhaseMultiplicationFactor}, {quadratureMultiplicationFactor})\", length, inPhaseMultiplicationFactor, quadratureMultiplicationFactor)\n    {\n    }\n\n    /// <summary>\n    /// Computes the next value of this indicator from the given state\n    /// </summary>\n    /// <param name=\"input\">The input given to the indicator</param>\n    /// <returns>A new value for this indicator</returns>\n    protected override decimal ComputeNextValue(IndicatorDataPoint input)\n    {\n        Debug.Assert(input != null, nameof(input) + \" != null\");\n\n        _input.Update(input);\n        _prev.Update(input);\n\n        if (_prev.IsReady)\n        {\n            _detrendPrice.Update(input);\n        }\n\n        if (_detrendPrice.IsReady)\n        {\n            _detrendPriceDelay2.Update(_detrendPrice.Current);\n            _detrendPriceDelay4.Update(_detrendPrice.Current);\n        }\n\n        InPhase.Update(input);\n        if (InPhase.IsReady)\n        {\n            _inPhaseDelay3.Update(InPhase.Current);\n        }\n\n        Quadrature.Update(input);\n        if (Quadrature.IsReady)\n        {\n            _quadratureDelay2.Update(Quadrature.Current);\n        }\n\n        return input.Value;\n    }\n\n    /// <summary>\n    /// Resets this indicator to its initial state\n    /// </summary>\n    public override void Reset()\n    {\n        base.Reset();\n\n        _input.Reset();\n        _prev.Reset();\n        _detrendPrice.Reset();\n        _detrendPriceDelay2.Reset();\n        _detrendPriceDelay4.Reset();\n        _inPhaseDelay3.Reset();\n        _quadratureDelay2.Reset();\n\n        InPhase.Reset();\n        Quadrature.Reset();\n    }\n}\n"
  },
  {
    "path": "Indicators/HullMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Produces a Hull Moving Average as explained at http://www.alanhull.com/hull-moving-average/\n    /// and derived from the instructions for the Excel VBA code at http://finance4traders.blogspot.com/2009/06/how-to-calculate-hull-moving-average.html\n    /// </summary>\n    public class HullMovingAverage : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly LinearWeightedMovingAverage _fastWma;\n        private readonly LinearWeightedMovingAverage _slowWma;\n        private readonly LinearWeightedMovingAverage _hullMa;\n\n        /// <summary>\n        /// A Hull Moving Average \n        /// </summary>\n        /// <param name=\"name\">string - a name for the indicator</param>\n        /// <param name=\"period\">int - the number of periods to calculate the HMA - the period of the slower LWMA</param>\n        public HullMovingAverage(string name, int period)\n            : base(name)\n        {\n            if (period < 2) throw new ArgumentException(\"The Hull Moving Average period should be greater or equal to 2\", nameof(period));\n            _slowWma = new LinearWeightedMovingAverage(period);\n            _fastWma = new LinearWeightedMovingAverage((int)Math.Round(period * 1d / 2));\n            var k = (int)Math.Round(Math.Sqrt(period));\n            _hullMa = new LinearWeightedMovingAverage(k);\n            WarmUpPeriod = period + k - 1;\n        }\n        /// <summary>\n        /// A Hull Moving Average.\n        /// </summary>\n        /// <param name=\"period\">int - the number of periods over which to calculate the HMA - the length of the slower LWMA</param>\n        public HullMovingAverage(int period)\n            : this($\"HMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _slowWma.Reset();\n            _fastWma.Reset();\n            _hullMa.Reset();\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _hullMa.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _fastWma.Update(input);\n            _slowWma.Update(input);\n            if (_fastWma.IsReady && _slowWma.IsReady)\n            {\n                _hullMa.Update(new IndicatorDataPoint(input.EndTime, 2 * _fastWma.Current.Value - _slowWma.Current.Value));\n            }\n            return _hullMa.Current.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/HurstExponent.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the Hurst Exponent indicator, which is used to measure the long-term memory of a time series.\n    /// - H less than 0.5: Mean-reverting; high values followed by low ones, stronger as H approaches 0.\n    /// - H equal to 0.5: Random walk (geometric).\n    /// - H greater than 0.5: Trending; high values followed by higher ones, stronger as H approaches 1.\n    /// </summary>\n    public class HurstExponent : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// A rolling window that holds the most recent price values.\n        /// </summary>\n        private readonly RollingWindow<decimal> _priceWindow;\n\n        /// <summary>\n        /// The list of time lags used to calculate tau values.\n        /// </summary>\n        private readonly List<int> _timeLags;\n\n        /// <summary>\n        /// Sum of the logarithms of the time lags, precomputed for efficiency.\n        /// </summary>\n        private readonly decimal _sumX;\n\n        /// <summary>\n        /// Sum of the squares of the logarithms of the time lags, precomputed for efficiency.\n        /// </summary>\n        private readonly decimal _sumX2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HurstExponent\"/> class.\n        /// The default maxLag value of 20 is chosen for reliable and accurate results, but using a higher lag may reduce precision.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"period\">The period over which to calculate the Hurst Exponent.</param>\n        /// <param name=\"maxLag\">The maximum lag to consider for time series analysis.</param>\n        public HurstExponent(string name, int period, int maxLag = 20) : base(name)\n        {\n            if (maxLag < 3)\n            {\n                throw new ArgumentException(\"The maxLag parameter must be greater than 2 to compute the Hurst Exponent.\", nameof(maxLag));\n            }\n            _priceWindow = new RollingWindow<decimal>(period);\n            _timeLags = new List<int>();\n\n            // Precompute logarithms of time lags and their squares for regression calculations\n            for (var i = 2; i <= maxLag; i++)\n            {\n                var logTimeLag = (decimal)Math.Log(i);\n                _timeLags.Add(i);\n                _sumX += logTimeLag;\n                _sumX2 += logTimeLag * logTimeLag;\n            }\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"HurstExponent\"/> class with the specified period and maxLag.\n        /// The default maxLag value of 20 is chosen for reliable and accurate results, but using a higher lag may reduce precision.\n        /// </summary>\n        /// <param name=\"period\">The period over which to calculate the Hurst Exponent.</param>\n        /// <param name=\"maxLag\">The maximum lag to consider for time series analysis.</param>\n        public HurstExponent(int period, int maxLag = 20)\n            : this($\"HE({period},{maxLag})\", period, maxLag)\n        {\n        }\n\n        /// <summary>\n        /// Gets the period over which the indicator is calculated.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Indicates whether the indicator has enough data to produce a valid result.\n        /// </summary>\n        public override bool IsReady => _priceWindow.IsReady;\n\n        /// <summary>\n        /// Computes the next value of the Hurst Exponent indicator.\n        /// </summary>\n        /// <param name=\"input\">The input data point to use for the next value computation.</param>\n        /// <returns>The computed Hurst Exponent value, or zero if insufficient data is available.</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _priceWindow.Add(input.Value);\n            if (!_priceWindow.IsReady)\n            {\n                return decimal.Zero;\n            }\n\n            // Sum of log(standard deviation) values\n            var sumY = 0m;\n\n            // Sum of log(lag) * log(standard deviation)\n            var sumXY = 0m;\n\n            foreach (var lag in _timeLags)\n            {\n                var mean = 0m;\n                var sumOfSquares = 0m;\n                var count = Math.Max(0, _priceWindow.Size - lag);\n                // Calculate the differences between values separated by the given lag\n                for (var i = 0; i < count; i++)\n                {\n                    var value = _priceWindow[i + lag] - _priceWindow[i];\n                    sumOfSquares += value * value;\n                    mean += value;\n                }\n\n                var standardDeviation = 0.0;\n                // Avoid division by zero\n                if (count > 0)\n                {\n                    mean = mean / count;\n                    var variance = (sumOfSquares / count) - (mean * mean);\n                    standardDeviation = Math.Sqrt((double)variance);\n                }\n\n                // Compute log(standard deviation) and log(lag) for the regression.\n                var logTau = standardDeviation == 0.0 ? 0m : (decimal)Math.Log(standardDeviation);\n                var logLag = (decimal)Math.Log(lag);\n\n                // Accumulate sums for the regression equation.\n                sumY += logTau;\n                sumXY += logLag * logTau;\n            }\n\n            // Number of time lags used for the computation\n            var n = _timeLags.Count;\n\n            // Compute the Hurst Exponent using the slope of the log-log regression.\n            var hurstExponent = (n * sumXY - _sumX * sumY) / (n * _sumX2 - _sumX * _sumX);\n            return hurstExponent;\n        }\n\n        /// <summary>\n        /// Resets the indicator to its initial state. This clears all internal data and resets\n        /// </summary>\n        public override void Reset()\n        {\n            _priceWindow.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/IchimokuKinkoHyo.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Ichimoku Kinko Hyo indicator. It consists of the following main indicators:\n    /// Tenkan-sen: (Highest High + Lowest Low) / 2 for the specific period (normally 9)\n    /// Kijun-sen: (Highest High + Lowest Low) / 2 for the specific period (normally 26)\n    /// Senkou A Span: (Tenkan-sen + Kijun-sen )/ 2 from a specific number of periods ago (normally 26)\n    /// Senkou B Span: (Highest High + Lowest Low) / 2 for the specific period (normally 52), from a specific number of periods ago (normally 26)\n    /// </summary>\n    public class IchimokuKinkoHyo : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The Tenkan-sen component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Tenkan { get; }\n\n        /// <summary>\n        /// The Kijun-sen component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Kijun { get; }\n\n        /// <summary>\n        /// The Senkou A Span component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SenkouA { get; }\n\n        /// <summary>\n        /// The Senkou B Span component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SenkouB { get; }\n\n        /// <summary>\n        /// The Chikou Span component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Chikou { get; }\n\n        /// <summary>\n        /// The Tenkan-sen Maximum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> TenkanMaximum { get; }\n\n        /// <summary>\n        /// The Tenkan-sen Minimum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> TenkanMinimum { get; }\n\n        /// <summary>\n        /// The Kijun-sen Maximum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> KijunMaximum { get; }\n\n        /// <summary>\n        /// The Kijun-sen Minimum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> KijunMinimum { get; }\n\n        /// <summary>\n        /// The Senkou B Maximum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SenkouBMaximum { get; }\n\n        /// <summary>\n        /// The Senkou B Minimum component of the Ichimoku indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SenkouBMinimum { get; }\n\n        /// <summary>\n        /// The Delayed Tenkan Senkou A component of the Ichimoku indicator\n        /// </summary>\n        public WindowIndicator<IndicatorDataPoint> DelayedTenkanSenkouA { get; }\n\n        /// <summary>\n        /// The Delayed Kijun Senkou A component of the Ichimoku indicator\n        /// </summary>\n        public WindowIndicator<IndicatorDataPoint> DelayedKijunSenkouA { get; }\n\n        /// <summary>\n        /// The Delayed Maximum Senkou B component of the Ichimoku indicator\n        /// </summary>\n        public WindowIndicator<IndicatorDataPoint> DelayedMaximumSenkouB { get; }\n\n        /// <summary>\n        /// The Delayed Minimum Senkou B component of the Ichimoku indicator\n        /// </summary>\n        public WindowIndicator<IndicatorDataPoint> DelayedMinimumSenkouB { get; }\n\n        /// <summary>\n        /// Creates a new IchimokuKinkoHyo indicator from the specific periods\n        /// </summary>\n        /// <param name=\"tenkanPeriod\">The Tenkan-sen period</param>\n        /// <param name=\"kijunPeriod\">The Kijun-sen period</param>\n        /// <param name=\"senkouAPeriod\">The Senkou A Span period</param>\n        /// <param name=\"senkouBPeriod\">The Senkou B Span period</param>\n        /// <param name=\"senkouADelayPeriod\">The Senkou A Span delay</param>\n        /// <param name=\"senkouBDelayPeriod\">The Senkou B Span delay</param>\n        public IchimokuKinkoHyo(int tenkanPeriod = 9, int kijunPeriod = 26, int senkouAPeriod = 26,\n            int senkouBPeriod = 52, int senkouADelayPeriod = 26, int senkouBDelayPeriod = 26)\n            : this(\n                $\"ICHIMOKU({tenkanPeriod},{kijunPeriod},{senkouAPeriod},{senkouBPeriod},{senkouADelayPeriod},{senkouBDelayPeriod})\",\n                tenkanPeriod,\n                kijunPeriod,\n                senkouAPeriod,\n                senkouBPeriod,\n                senkouADelayPeriod,\n                senkouBDelayPeriod\n            )\n        {\n        }\n\n        /// <summary>\n        /// Creates a new IchimokuKinkoHyo indicator from the specific periods\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"tenkanPeriod\">The Tenkan-sen period</param>\n        /// <param name=\"kijunPeriod\">The Kijun-sen period</param>\n        /// <param name=\"senkouAPeriod\">The Senkou A Span period</param>\n        /// <param name=\"senkouBPeriod\">The Senkou B Span period</param>\n        /// <param name=\"senkouADelayPeriod\">The Senkou A Span delay</param>\n        /// <param name=\"senkouBDelayPeriod\">The Senkou B Span delay</param>\n        public IchimokuKinkoHyo(string name, int tenkanPeriod = 9, int kijunPeriod = 26, int senkouAPeriod = 26, int senkouBPeriod = 52, int senkouADelayPeriod = 26, int senkouBDelayPeriod = 26)\n            : base(name)\n        {\n            WarmUpPeriod = Math.Max(tenkanPeriod + senkouADelayPeriod, kijunPeriod + senkouADelayPeriod);\n            WarmUpPeriod = Math.Max(WarmUpPeriod, senkouBPeriod + senkouBDelayPeriod);\n\n            TenkanMaximum = new Maximum(name + \"_TenkanMax\", tenkanPeriod);\n            TenkanMinimum = new Minimum(name + \"_TenkanMin\", tenkanPeriod);\n            KijunMaximum = new Maximum(name + \"_KijunMax\", kijunPeriod);\n            KijunMinimum = new Minimum(name + \"_KijunMin\", kijunPeriod);\n            SenkouBMaximum = new Maximum(name + \"_SenkouBMaximum\", senkouBPeriod);\n            SenkouBMinimum = new Minimum(name + \"_SenkouBMinimum\", senkouBPeriod);\n            DelayedMaximumSenkouB = new Delay(name + \"DelayedMax\", senkouBDelayPeriod).Of(SenkouBMaximum);\n            DelayedMinimumSenkouB = new Delay(name + \"DelayedMin\", senkouBDelayPeriod).Of(SenkouBMinimum);\n\n            Tenkan = TenkanMaximum.Plus(TenkanMinimum).Over(2m);\n            DelayedTenkanSenkouA = new Delay(name + \"DelayedTenkan\", senkouADelayPeriod).Of(Tenkan);\n\n            Kijun = KijunMaximum.Plus(KijunMinimum).Over(2m);\n            DelayedKijunSenkouA = new Delay(name + \"DelayedKijun\", senkouADelayPeriod).Of(Kijun);\n\n            SenkouA = DelayedTenkanSenkouA.Plus(DelayedKijunSenkouA).Over(2m);\n            SenkouB = DelayedMaximumSenkouB.Plus(DelayedMinimumSenkouB).Over(2m);\n            Chikou = new Delay(name + \"_Chikou\", senkouADelayPeriod);\n        }\n\n        /// <summary>\n        /// Returns true if all of the sub-components of the Ichimoku indicator is ready\n        /// </summary>\n        public override bool IsReady => Tenkan.IsReady && Kijun.IsReady && SenkouA.IsReady && SenkouB.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            TenkanMaximum.Update(input.EndTime, input.High);\n            TenkanMinimum.Update(input.EndTime, input.Low);\n            KijunMaximum.Update(input.EndTime, input.High);\n            KijunMinimum.Update(input.EndTime, input.Low);\n            SenkouBMaximum.Update(input.EndTime, input.High);\n            SenkouBMinimum.Update(input.EndTime, input.Low);\n            Chikou.Update(input.EndTime, input.Close);\n\n            return input.Close;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            TenkanMaximum.Reset();\n            TenkanMinimum.Reset();\n            Tenkan.Reset();\n            KijunMaximum.Reset();\n            KijunMinimum.Reset();\n            Kijun.Reset();\n            DelayedTenkanSenkouA.Reset();\n            DelayedKijunSenkouA.Reset();\n            SenkouA.Reset();\n            SenkouBMaximum.Reset();\n            SenkouBMinimum.Reset();\n            DelayedMaximumSenkouB.Reset();\n            DelayedMinimumSenkouB.Reset();\n            Chikou.Reset();\n            SenkouB.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Identity.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    ///     Represents an indicator that is a ready after ingesting a single sample and\n    ///     always returns the same value as it is given.\n    /// </summary>\n    public class Identity : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        ///     Initializes a new instance of the Identity indicator with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        public Identity(string name = \"\")\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        ///     Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples > 0; }\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized\n        /// </summary>\n        public int WarmUpPeriod => 1;\n\n        /// <summary>\n        ///     Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            return input.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ImpliedVolatility.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing MathNet.Numerics.RootFinding;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Implied Volatility indicator that calculate the IV of an option using Black-Scholes Model\n    /// </summary>\n    public class ImpliedVolatility : OptionIndicatorBase\n    {\n        private decimal _impliedVolatility;\n        private Func<decimal, decimal, decimal> SmoothingFunction;\n\n        /// <summary>\n        /// Gets the theoretical option price\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> TheoreticalPrice { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel)\n        {\n            if (mirrorOption != null)\n            {\n                // Default smoothing function will be assuming Law of One Price hold,\n                // so both call and put will have the same IV\n                // and using on OTM/ATM options to calculate the IV\n                // by assuming extra volatility coming from extrinsic value\n                SmoothingFunction = (impliedVol, mirrorImpliedVol) =>\n                {\n                    if (Strike > UnderlyingPrice && Right == OptionRight.Put)\n                    {\n                        return mirrorImpliedVol;\n                    }\n                    else if (Strike < UnderlyingPrice && Right == OptionRight.Call)\n                    {\n                        return mirrorImpliedVol;\n                    }\n                    return impliedVol;\n                };\n            }\n\n            TheoreticalPrice = new FunctionalIndicator<IndicatorDataPoint>($\"{name}_TheoreticalPrice\", \n                (iv) =>\n                {\n                    // Volatility is zero, price is not changing, can return current theoretical price.\n                    // This also allows us avoid errors in calculation when IV is zero.\n                    if (iv.Value == 0m)\n                    {\n                        return TheoreticalPrice.Current.Value;\n                    }\n\n                    var theoreticalPrice = CalculateTheoreticalPrice((double)iv.Value, (double)UnderlyingPrice.Current.Value, (double)Strike,\n                        OptionGreekIndicatorsHelper.TimeTillExpiry(Expiry, iv.EndTime), (double)RiskFreeRate.Current.Value, (double)DividendYield.Current.Value, \n                        Right, optionModel);\n                    try\n                    {\n                        return Convert.ToDecimal(theoreticalPrice);\n                    }\n                    catch (OverflowException)\n                    {\n                        return TheoreticalPrice.Current.Value;\n                    }\n                },\n                _ => IsReady)\n                .Of(this);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel,\n            Symbol mirrorOption = null, OptionPricingModelType? optionModel = null)\n            : this($\"IV({option},{mirrorOption},{riskFreeRateModel},{dividendYieldModel},{optionModel})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this(name, option, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel),\n                DividendYieldModelPythonWrapper.FromPyObject(dividendYieldModel), mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this($\"IV({option},{mirrorOption},{riskFreeRateModel},{dividendYieldModel},{optionModel})\", option,\n                  riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this(name, option, riskFreeRateModel, new ConstantDividendYieldModel(dividendYield), mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this($\"IV({option},{mirrorOption},{riskFreeRateModel},{dividendYield},{optionModel})\", option, riskFreeRateModel, dividendYield,\n                  mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this(name, option, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel),\n                new ConstantDividendYieldModel(dividendYield), mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this($\"IV({option},{mirrorOption},{riskFreeRateModel},{dividendYield},{optionModel})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this(name, option, new ConstantRiskFreeRateInterestRateModel(riskFreeRate), new ConstantDividendYieldModel(dividendYield), mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ImpliedVolatility class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate IV</param>\n        public ImpliedVolatility(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null)\n            : this($\"IV({option},{mirrorOption},{riskFreeRate},{dividendYield},{optionModel})\", option, riskFreeRate,\n                  dividendYield, mirrorOption, optionModel)\n        {\n        }\n\n        /// <summary>\n        /// Set the smoothing function of IV, using both call and put IV value\n        /// </summary>\n        /// <param name=\"function\">the smoothing function</param>\n        public void SetSmoothingFunction(Func<decimal, decimal, decimal> function)\n        {\n            SmoothingFunction = function;\n        }\n\n        /// <summary>\n        /// Set the smoothing function of IV, using both call and put IV value\n        /// </summary>\n        /// <param name=\"function\">the smoothing function</param>\n        public void SetSmoothingFunction(PyObject function)\n        {\n            SmoothingFunction = PythonUtil.ToFunc<decimal, decimal, decimal>(function);\n        }\n\n        /// <summary>\n        /// Computes the next value\n        /// </summary>\n        /// <returns>The input is returned unmodified.</returns>\n        protected override decimal ComputeIndicator()\n        {\n            var time = Price.Current.EndTime;\n\n            RiskFreeRate.Update(time, _riskFreeInterestRateModel.GetInterestRate(time));\n            DividendYield.Update(time, _dividendYieldModel.GetDividendYield(time, UnderlyingPrice.Current.Value));\n\n            var timeTillExpiry = Convert.ToDecimal(OptionGreekIndicatorsHelper.TimeTillExpiry(Expiry, time));\n            _impliedVolatility = CalculateIV(timeTillExpiry);\n\n            return _impliedVolatility;\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators\n        /// </summary>\n        public override void Reset()\n        {\n            TheoreticalPrice.Reset();\n            base.Reset();\n        }\n\n        // Calculate the theoretical option price\n        private static double CalculateTheoreticalPrice(double volatility, double spotPrice, double strikePrice, double timeTillExpiry, double riskFreeRate,\n            double dividendYield, OptionRight optionType, OptionPricingModelType? optionModel = null)\n        {\n            if (timeTillExpiry <= 0)\n            {\n                return 0;\n            }\n\n            return optionModel switch\n            {\n                // Binomial model also follows BSM process (log-normal)\n                OptionPricingModelType.BinomialCoxRossRubinstein => OptionGreekIndicatorsHelper.CRRTheoreticalPrice(volatility, spotPrice, strikePrice, timeTillExpiry, riskFreeRate, dividendYield, optionType),\n                OptionPricingModelType.ForwardTree => OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(volatility, spotPrice, strikePrice, timeTillExpiry, riskFreeRate, dividendYield, optionType),\n                _ => OptionGreekIndicatorsHelper.BlackTheoreticalPrice(volatility, spotPrice, strikePrice, timeTillExpiry, riskFreeRate, dividendYield, optionType),\n            };\n        }\n\n        /// <summary>\n        /// Computes the IV of the option\n        /// </summary>\n        /// <param name=\"timeTillExpiry\">the time until expiration in years</param>\n        /// <returns>Smoothened IV of the option</returns>\n        protected virtual decimal CalculateIV(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n            var optionPrice = (double)Price.Current.Value;\n\n            var impliedVol = CalculateIV(OptionSymbol, strike, timeTillExpiryDouble, Right, optionPrice, underlyingPrice, riskFreeRate,\n                dividendYield, _optionModel);\n\n            if (UseMirrorContract)\n            {\n                var mirrorOptionPrice = (double)OppositePrice.Current.Value;\n\n                var mirrorImpliedVol = CalculateIV(_oppositeOptionSymbol, strike, timeTillExpiryDouble, _oppositeOptionSymbol.ID.OptionRight,\n                        mirrorOptionPrice, underlyingPrice, riskFreeRate, dividendYield, _optionModel);\n\n                if (mirrorImpliedVol.HasValue)\n                {\n                    if (impliedVol.HasValue)\n                    {\n                        // use 'SmoothingFunction' if both calculations succeeded\n                        return SmoothingFunction(impliedVol.Value, mirrorImpliedVol.Value);\n                    }\n                    return mirrorImpliedVol.Value;\n                }\n            }\n\n            return impliedVol ?? 0;\n        }\n\n        private decimal? CalculateIV(Symbol optionSymbol, double strike, double timeTillExpiry, OptionRight right, double optionPrice, double underlyingPrice,\n            double riskFreeRate, double dividendYield, OptionPricingModelType optionModel)\n        {\n            GetRootFindingMethodParameters(optionSymbol, strike, timeTillExpiry, optionPrice, underlyingPrice, riskFreeRate, dividendYield,\n                optionModel, out var accuracy, out var lowerBound, out var upperBound);\n\n            decimal? impliedVol = null;\n            try\n            {\n                Func<double, double> f = (vol) => CalculateTheoreticalPrice(vol, underlyingPrice, strike, timeTillExpiry, riskFreeRate, dividendYield, right, optionModel) - optionPrice;\n                impliedVol = Convert.ToDecimal(Brent.FindRoot(f, lowerBound, upperBound, accuracy, 100));\n            }\n            catch\n            {\n                Log.Error(\"ImpliedVolatility.CalculateIV(): Fail to converge, returning 0.\");\n            }\n\n            return impliedVol;\n        }\n\n        private void GetRootFindingMethodParameters(Symbol optionSymbol, double strike, double timeTillExpiry, double optionPrice,\n            double underlyingPrice, double riskFreeRate, double dividendYield, OptionPricingModelType optionModel,\n            out double accuracy, out double lowerBound, out double upperBound)\n        {\n            // Set the accuracy as a factor of the option price when possible\n            accuracy = Math.Max(1e-4, 1e-4 * optionPrice);\n            lowerBound = 1e-7;\n            upperBound = 4.0;\n\n            // Use BSM as initial guess to get a better range for root finding\n            if (optionModel != OptionPricingModelType.BlackScholes)\n            {\n                var initialGuess = (double)(CalculateIV(optionSymbol, strike, timeTillExpiry, optionSymbol.ID.OptionRight, optionPrice,\n                    underlyingPrice, riskFreeRate, dividendYield, OptionPricingModelType.BlackScholes) ?? 0);\n                if (initialGuess != 0)\n                {\n                    lowerBound = Math.Max(lowerBound, initialGuess * 0.5);\n                    upperBound = Math.Min(upperBound, initialGuess * 1.5);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Indicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents a type capable of ingesting a piece of data and producing a new piece of data.\n    /// Indicators can be used to filter and transform data into a new, more informative form.\n    /// </summary>\n    public abstract class Indicator : IndicatorBase<IndicatorDataPoint>\n    {\n        /// <summary>\n        /// The default size of the history window for the indicator\n        /// </summary>\n        public static int DefaultWindowSize { get; } = 2;\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected Indicator(string name)\n            : base(name)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorBase.Operators.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    public abstract partial class IndicatorBase\n    {\n        /// <summary>\n        /// Returns the current value of this instance\n        /// </summary>\n        /// <param name=\"instance\">The indicator instance</param>\n        /// <returns>The current value of the indicator</returns>\n        public static implicit operator decimal(IndicatorBase instance)\n        {\n            return instance.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than the specified value\n        /// </summary>\n        public static bool operator >(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value > (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than the specified value\n        /// </summary>\n        public static bool operator <(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value < (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than the indicator's current value\n        /// </summary>\n        public static bool operator >(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left > right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than the indicator's current value\n        /// </summary>\n        public static bool operator <(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left < right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than or equal to the specified value\n        /// </summary>\n        public static bool operator >=(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value >= (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than or equal to the specified value\n        /// </summary>\n        public static bool operator <=(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value <= (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator >=(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left >= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator <=(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left <= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is equal to the specified value\n        /// </summary>\n        public static bool operator ==(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value == (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is not equal to the specified value\n        /// </summary>\n        public static bool operator !=(IndicatorBase left, double right)\n        {\n            if (ReferenceEquals(left, null)) return true;\n            return left.Current.Value != (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is equal to the indicator's current value\n        /// </summary>\n        public static bool operator ==(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left == right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is not equal to the indicator's current value\n        /// </summary>\n        public static bool operator !=(double left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return true;\n            return (decimal)left != right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than the specified value\n        /// </summary>\n        public static bool operator >(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value > (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than the specified value\n        /// </summary>\n        public static bool operator <(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value < (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than the indicator's current value\n        /// </summary>\n        public static bool operator >(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left > right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than the indicator's current value\n        /// </summary>\n        public static bool operator <(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left < right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than or equal to the specified value\n        /// </summary>\n        public static bool operator >=(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value >= (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than or equal to the specified value\n        /// </summary>\n        public static bool operator <=(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value <= (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator >=(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left >= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator <=(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left <= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is equal to the specified value\n        /// </summary>\n        public static bool operator ==(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value == (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is not equal to the specified value\n        /// </summary>\n        public static bool operator !=(IndicatorBase left, float right)\n        {\n            if (ReferenceEquals(left, null)) return true;\n            return left.Current.Value != (decimal)right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is equal to the indicator's current value\n        /// </summary>\n        public static bool operator ==(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return (decimal)left == right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is not equal to the indicator's current value\n        /// </summary>\n        public static bool operator !=(float left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return true;\n            return (decimal)left != right.Current.Value;\n        }\n        /// <summary>\n        /// Determines if the indicator's current value is greater than the specified value\n        /// </summary>\n        public static bool operator >(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value > right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than the specified value\n        /// </summary>\n        public static bool operator <(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value < right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than the indicator's current value\n        /// </summary>\n        public static bool operator >(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left > right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than the indicator's current value\n        /// </summary>\n        public static bool operator <(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left < right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than or equal to the specified value\n        /// </summary>\n        public static bool operator >=(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value >= right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than or equal to the specified value\n        /// </summary>\n        public static bool operator <=(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value <= right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator >=(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left >= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator <=(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left <= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is equal to the specified value\n        /// </summary>\n        public static bool operator ==(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value == right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is not equal to the specified value\n        /// </summary>\n        public static bool operator !=(IndicatorBase left, int right)\n        {\n            if (ReferenceEquals(left, null)) return true;\n            return left.Current.Value != right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is equal to the indicator's current value\n        /// </summary>\n        public static bool operator ==(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left == right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is not equal to the indicator's current value\n        /// </summary>\n        public static bool operator !=(int left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return true;\n            return left != right.Current.Value;\n        }\n        /// <summary>\n        /// Determines if the indicator's current value is greater than the specified value\n        /// </summary>\n        public static bool operator >(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value > right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than the specified value\n        /// </summary>\n        public static bool operator <(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value < right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than the indicator's current value\n        /// </summary>\n        public static bool operator >(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left > right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than the indicator's current value\n        /// </summary>\n        public static bool operator <(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left < right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is greater than or equal to the specified value\n        /// </summary>\n        public static bool operator >=(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value >= right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is less than or equal to the specified value\n        /// </summary>\n        public static bool operator <=(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value <= right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is greater than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator >=(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left >= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is less than or equal to the indicator's current value\n        /// </summary>\n        public static bool operator <=(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left <= right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is equal to the specified value\n        /// </summary>\n        public static bool operator ==(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return false;\n            return left.Current.Value == right;\n        }\n\n        /// <summary>\n        /// Determines if the indicator's current value is not equal to the specified value\n        /// </summary>\n        public static bool operator !=(IndicatorBase left, long right)\n        {\n            if (ReferenceEquals(left, null)) return true;\n            return left.Current.Value != right;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is equal to the indicator's current value\n        /// </summary>\n        public static bool operator ==(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return false;\n            return left == right.Current.Value;\n        }\n\n        /// <summary>\n        /// Determines if the specified value is not equal to the indicator's current value\n        /// </summary>\n        public static bool operator !=(long left, IndicatorBase right)\n        {\n            if (ReferenceEquals(right, null)) return true;\n            return left != right.Current.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing System.Diagnostics;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Consolidators;\nusing System.Collections;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Abstract Indicator base, meant to contain non-generic fields of indicator base to support non-typed inputs\n    /// </summary>\n    public abstract partial class IndicatorBase : IIndicator, IEnumerable<IndicatorDataPoint>\n    {\n        /// <summary>\n        /// The data consolidators associated with this indicator if any\n        /// </summary>\n        /// <remarks>These references allow us to unregister an indicator from getting future data updates through it's consolidators.\n        /// We need multiple consolitadors because some indicators consume data from multiple different symbols</remarks>\n        public ISet<IDataConsolidator> Consolidators { get; } = new HashSet<IDataConsolidator>();\n\n        /// <summary>\n        /// Gets the current state of this indicator. If the state has not been updated\n        /// then the time on the value will equal DateTime.MinValue.\n        /// </summary>\n        public IndicatorDataPoint Current\n        {\n            get\n            {\n                return Window[0];\n            }\n            protected set\n            {\n                Window.Add(value);\n            }\n        }\n\n        /// <summary>\n        /// Gets the previous state of this indicator. If the state has not been updated\n        /// then the time on the value will equal DateTime.MinValue.\n        /// </summary>\n        public IndicatorDataPoint Previous\n        {\n            get\n            {\n                return Window.Count > 1 ? Window[1] : new IndicatorDataPoint(DateTime.MinValue, 0);\n            }\n        }\n\n        /// <summary>\n        /// Gets a name for this indicator\n        /// </summary>\n        public string Name { get; protected set; }\n\n        /// <summary>\n        /// Gets the number of samples processed by this indicator\n        /// </summary>\n        public long Samples { get; internal set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public abstract bool IsReady { get; }\n\n        /// <summary>\n        /// Event handler that fires after this indicator is updated\n        /// </summary>\n        public event IndicatorUpdatedHandler Updated;\n\n        /// <summary>\n        /// A rolling window keeping a history of the indicator values of a given period\n        /// </summary>\n        public RollingWindow<IndicatorDataPoint> Window { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public abstract void Reset();\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class.\n        /// </summary>\n        protected IndicatorBase()\n        {\n            Window = new RollingWindow<IndicatorDataPoint>(Indicator.DefaultWindowSize);\n            Current = new IndicatorDataPoint(DateTime.MinValue, 0m);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected IndicatorBase(string name)\n            : this()\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        /// Event invocator for the Updated event\n        /// </summary>\n        /// <param name=\"consolidated\">This is the new piece of data produced by this indicator</param>\n        protected virtual void OnUpdated(IndicatorDataPoint consolidated)\n        {\n            Updated?.Invoke(this, consolidated);\n        }\n\n        /// <summary>\n        /// Updates the state of this indicator with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"input\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        public abstract bool Update(IBaseData input);\n\n        /// <summary>\n        /// Indexes the history windows, where index 0 is the most recent indicator value.\n        /// If index is greater or equal than the current count, it returns null.\n        /// If the index is greater or equal than the window size, it returns null and resizes the windows to i + 1.\n        /// </summary>\n        /// <param name=\"i\">The index</param>\n        /// <returns>the ith most recent indicator value</returns>\n        public IndicatorDataPoint this[int i]\n        {\n            get\n            {\n                return Window[i];\n            }\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the history window.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the history window.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<IndicatorDataPoint> GetEnumerator()\n        {\n            return Window.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the history window.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the history window.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// ToString Overload for Indicator Base\n        /// </summary>\n        /// <returns>String representation of the indicator</returns>\n        public override string ToString()\n        {\n            return Current.Value.ToStringInvariant(\"#######0.0####\");\n        }\n\n        /// <summary>\n        /// Provides a more detailed string of this indicator in the form of {Name} - {Value}\n        /// </summary>\n        /// <returns>A detailed string of this indicator's current state</returns>\n        public string ToDetailedString()\n        {\n            return $\"{Name} - {this}\";\n        }\n\n        /// <summary>\n        /// Compares the current object with another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the <paramref name=\"other\"/> parameter.Zero This object is equal to <paramref name=\"other\"/>. Greater than zero This object is greater than <paramref name=\"other\"/>.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public int CompareTo(IIndicator other)\n        {\n            if (ReferenceEquals(other, null))\n            {\n                // everything is greater than null via MSDN\n                return 1;\n            }\n\n            return Current.CompareTo(other.Current);\n        }\n\n        /// <summary>\n        /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.\n        /// </summary>\n        /// <returns>\n        /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name=\"obj\"/> in the sort order. Zero This instance occurs in the same position in the sort order as <paramref name=\"obj\"/>. Greater than zero This instance follows <paramref name=\"obj\"/> in the sort order.\n        /// </returns>\n        /// <param name=\"obj\">An object to compare with this instance. </param><exception cref=\"T:System.ArgumentException\"><paramref name=\"obj\"/> is not the same type as this instance. </exception><filterpriority>2</filterpriority>\n        public int CompareTo(object obj)\n        {\n            var other = obj as IndicatorBase;\n            if (other == null)\n            {\n                throw new ArgumentException(\"Object must be of type \" + GetType().GetBetterTypeName());\n            }\n\n            return CompareTo(other);\n        }\n\n    }\n\n    /// <summary>\n    /// Provides a base type for all indicators\n    /// </summary>\n    /// <typeparam name=\"T\">The type of data input into this indicator</typeparam>\n    [DebuggerDisplay(\"{ToDetailedString()}\")]\n    public abstract class IndicatorBase<T> : IndicatorBase\n        where T : IBaseData\n    {\n        private bool _loggedForwardOnlyIndicatorError;\n\n        /// <summary>the most recent input that was given to this indicator</summary>\n        private Dictionary<SecurityIdentifier, T> _previousInput = new Dictionary<SecurityIdentifier, T>();\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected IndicatorBase(string name)\n            : base(name)\n        { }\n\n        /// <summary>\n        /// Updates the state of this indicator with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"input\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        public override bool Update(IBaseData input)\n        {\n            T _previousSymbolInput = default(T);\n            if (_previousInput.TryGetValue(input.Symbol.ID, out _previousSymbolInput) && input.EndTime < _previousSymbolInput.EndTime)\n            {\n                if (!_loggedForwardOnlyIndicatorError)\n                {\n                    _loggedForwardOnlyIndicatorError = true;\n                    // if we receive a time in the past, log once and return\n                    Log.Error($\"IndicatorBase.Update(): This is a forward only indicator: {Name} Input: {input.EndTime:u} Previous: {_previousSymbolInput.EndTime:u}. It will not be updated with this input.\");\n                }\n                return IsReady;\n            }\n            if (!ReferenceEquals(input, _previousSymbolInput))\n            {\n                // compute a new value and update our previous time\n                Samples++;\n\n                if (!(input is T))\n                {\n                    if (typeof(T) == typeof(IndicatorDataPoint))\n                    {\n                        input = new IndicatorDataPoint(input.Symbol, input.EndTime, input.Value);\n                    }\n                    else\n                    {\n                        throw new ArgumentException($\"IndicatorBase.Update() 'input' expected to be of type {typeof(T)} but is of type {input.GetType()}\");\n                    }\n                }\n                _previousInput[input.Symbol.ID] = (T)input;\n\n                var nextResult = ValidateAndComputeNextValue((T)input);\n                if (nextResult.Status == IndicatorStatus.Success)\n                {\n                    Current = new IndicatorDataPoint(input.Symbol, input.EndTime, nextResult.Value);\n\n                    // let others know we've produced a new data point\n                    OnUpdated(Current);\n                }\n            }\n            return IsReady;\n        }\n\n        /// <summary>\n        /// Updates the state of this indicator with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"time\">The time associated with the value</param>\n        /// <param name=\"value\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        public bool Update(DateTime time, decimal value)\n        {\n            if (typeof(T) == typeof(IndicatorDataPoint))\n            {\n                return Update((T)(object)new IndicatorDataPoint(time, value));\n            }\n\n            var suggestions = new List<string>\n            {\n                \"Update(TradeBar)\",\n                \"Update(QuoteBar)\"\n            };\n\n            if (typeof(T) == typeof(IBaseData))\n            {\n                suggestions.Add(\"Update(Tick)\");\n            }\n\n            throw new NotSupportedException($\"{GetType().Name} does not support the `Update(DateTime, decimal)` method. Use one of the following methods instead: {string.Join(\", \", suggestions)}\");\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Samples = 0;\n            _previousInput.Clear();\n            Window.Reset();\n            Current = new IndicatorDataPoint(DateTime.MinValue, default(decimal));\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected abstract decimal ComputeNextValue(T input);\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// and returns an instance of the <see cref=\"IndicatorResult\"/> class\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>An IndicatorResult object including the status of the indicator</returns>\n        protected virtual IndicatorResult ValidateAndComputeNextValue(T input)\n        {\n            // default implementation always returns IndicatorStatus.Success\n            return new IndicatorResult(ComputeNextValue(input));\n        }\n\n        /// <summary>\n        /// Determines whether the specified object is equal to the current object.\n        /// </summary>\n        /// <returns>\n        /// true if the specified object  is equal to the current object; otherwise, false.\n        /// </returns>\n        /// <param name=\"obj\">The object to compare with the current object. </param>\n        public override bool Equals(object obj)\n        {\n            // this implementation acts as a liason to prevent inconsistency between the operators\n            // == and != against primitive types. the core impl for equals between two indicators\n            // is still reference equality, however, when comparing value types (floats/int, ect..)\n            // we'll use value type semantics on Current.Value\n            // because of this, we shouldn't need to override GetHashCode as well since we're still\n            // solely relying on reference semantics (think hashset/dictionary impls)\n\n            if (ReferenceEquals(obj, null)) return false;\n            var type = obj.GetType();\n\n            while (type != null && type != typeof(object))\n            {\n                var cur = type.IsGenericType ? type.GetGenericTypeDefinition() : type;\n                if (typeof(IndicatorBase<>) == cur)\n                {\n                    return ReferenceEquals(this, obj);\n                }\n                type = type.BaseType;\n            }\n\n            try\n            {\n                // the obj is not an indicator, so let's check for value types, try converting to decimal\n                var converted = obj.ConvertInvariant<decimal>();\n                return Current.Value == converted;\n            }\n            catch (InvalidCastException)\n            {\n                // conversion failed, return false\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Get Hash Code for this Object\n        /// </summary>\n        /// <returns>Integer Hash Code</returns>\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorBasedOptionPriceModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IOptionPriceModel\"/> that uses QuantConnect indicators\n    /// to provide a theoretical price for the option contract.\n    /// </summary>\n    public class IndicatorBasedOptionPriceModel : OptionPriceModel\n    {\n        private readonly OptionPricingModelType? _optionPricingModelType;\n        private readonly OptionPricingModelType? _ivModelType;\n        private IDividendYieldModel _dividendYieldModel;\n        private readonly IRiskFreeInterestRateModel _riskFreeInterestRateModel;\n        private readonly bool _userSpecifiedDividendYieldModel;\n        private readonly bool _useMirrorContract;\n        private readonly SecurityManager _securityProvider;\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"IndicatorBasedOptionPriceModel\"/> class\n        /// </summary>\n        /// <param name=\"optionModel\">The option pricing model type to be used by the indicators</param>\n        /// <param name=\"ivModel\">The option pricing model type to be used by the implied volatility indicator</param>\n        /// <param name=\"dividendYieldModel\">The dividend yield model to be used by the indicators</param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to be used by the indicators</param>\n        /// <param name=\"useMirrorContract\">Whether to use the mirror contract when possible</param>\n        /// <param name=\"securityProvider\">The security provider used to fetch the mirror contract</param>\n        public IndicatorBasedOptionPriceModel(OptionPricingModelType? optionModel = null,\n            OptionPricingModelType? ivModel = null, IDividendYieldModel dividendYieldModel = null,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel = null, bool useMirrorContract = true,\n            SecurityManager securityProvider = null)\n        {\n            _optionPricingModelType = optionModel;\n            _ivModelType = ivModel;\n            _dividendYieldModel = dividendYieldModel;\n            _riskFreeInterestRateModel = riskFreeInterestRateModel;\n            _useMirrorContract = useMirrorContract;\n            _userSpecifiedDividendYieldModel = dividendYieldModel != null;\n            _securityProvider = securityProvider;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"OptionPriceModelResult\"/> containing the theoretical price based on\n        /// QuantConnect indicators.\n        /// </summary>\n        /// <param name=\"parameters\">The evaluation parameters</param>\n        /// <returns>\n        /// An instance of <see cref=\"OptionPriceModelResult\"/> containing the theoretical\n        /// price of the specified option contract.\n        /// </returns>\n        public override OptionPriceModelResult Evaluate(OptionPriceModelParameters parameters)\n        {\n            var contract = parameters.Contract;\n            // expired options have no price\n            if (contract.Time.Date > contract.Expiry.Date)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"IndicatorBasedOptionPriceModel.Evaluate(). Expired {contract.Symbol}. Time > Expiry: {contract.Time.Date} > {contract.Expiry.Date}\");\n                }\n                return OptionPriceModelResult.None;\n            }\n\n            var option = parameters.Security as Option;\n            var underlying = option.Underlying;\n\n            if (option.Price == 0)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"IndicatorBasedOptionPriceModel.Evaluate(). Missing data for the option security {option.Symbol}.\");\n                }\n                return OptionPriceModelResult.None;\n            }\n\n            if (underlying.Price == 0)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    Log.Debug($\"IndicatorBasedOptionPriceModel.Evaluate(). Missing data for the underlying security {underlying.Symbol}.\");\n                }\n                return OptionPriceModelResult.None;\n            }\n\n            var contractSymbol = contract.Symbol;\n            Symbol mirrorContractSymbol = null;\n\n            if (!_userSpecifiedDividendYieldModel)\n            {\n                _dividendYieldModel = GreeksIndicators.GetDividendYieldModel(contractSymbol);\n            }\n\n            if (_useMirrorContract)\n            {\n                mirrorContractSymbol = contractSymbol.GetMirrorOptionSymbol();\n            }\n\n            if (!_securityProvider.TryGetValue(mirrorContractSymbol, out var mirrorOption) || mirrorOption.Price == 0)\n            {\n                if (Log.DebuggingEnabled)\n                {\n                    if (mirrorOption == null)\n                    {\n                        Log.Debug($\"IndicatorBasedOptionPriceModel.Evaluate(). Mirror contract {mirrorContractSymbol} not found. Using contract symbol only.\");\n                    }\n                    else\n                    {\n                        Log.Debug($\"IndicatorBasedOptionPriceModel.Evaluate(). Missing data for the mirror option contract {mirrorContractSymbol}. Using contract symbol only.\");\n                    }\n                }\n\n                // Null so that the indicators don't consider the mirror option and don't expect data for it\n                mirrorContractSymbol = null;\n                mirrorOption = null;\n            }\n\n            var indicators = new GreeksIndicators(contractSymbol, mirrorContractSymbol, _optionPricingModelType, _ivModelType,\n                    _dividendYieldModel, _riskFreeInterestRateModel);\n\n            var time = option.LocalTime;\n            indicators.Update(new IndicatorDataPoint(underlying.Symbol, time, underlying.Price));\n            indicators.Update(new IndicatorDataPoint(option.Symbol, time, option.Price));\n            if (mirrorOption != null)\n            {\n                indicators.Update(new IndicatorDataPoint(mirrorOption.Symbol, time, mirrorOption.Price));\n            }\n\n            return indicators.CurrentResult;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorBasedOptionPriceModelProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Provides option price models for option securities based on Lean's Greeks indicators\n    /// </summary>\n    public class IndicatorBasedOptionPriceModelProvider : IOptionPriceModelProvider\n    {\n        /// <summary>\n        /// Gets the security manager instance to use\n        /// </summary>\n        public SecurityManager Securities { get; }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"IndicatorBasedOptionPriceModelProvider\"/> class\n        /// </summary>\n        public IndicatorBasedOptionPriceModelProvider(SecurityManager securities)\n        {\n            Securities = securities;\n        }\n\n        /// <summary>\n        /// Gets the option price model for the specified option symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol</param>\n        /// <param name=\"pricingModelType\">The option pricing model type to use</param>\n        /// <returns>The option price model for the given symbol</returns>\n        public IOptionPriceModel GetOptionPriceModel(Symbol symbol, OptionPricingModelType? pricingModelType = null)\n        {\n            return new IndicatorBasedOptionPriceModel(pricingModelType, pricingModelType, securityProvider: Securities);\n        }\n\n        /// <summary>\n        /// Gets the option price model with the specified configuration\n        /// </summary>\n        /// <param name=\"optionModel\">The option pricing model type to be used by the indicators</param>\n        /// <param name=\"ivModel\">The option pricing model type to be used by the implied volatility indicator</param>\n        /// <param name=\"dividendYieldModel\">The dividend yield model to be used by the indicators</param>\n        /// <param name=\"riskFreeInterestRateModel\">The risk free interest rate model to be used by the indicators</param>v\n        /// <param name=\"useMirrorContract\">Whether to use the mirror contract when possible</param>\n        /// <returns>The option price model for the given symbol</returns>\n        public IOptionPriceModel GetOptionPriceModel(OptionPricingModelType? optionModel = null,\n            OptionPricingModelType? ivModel = null, IDividendYieldModel dividendYieldModel = null,\n            IRiskFreeInterestRateModel riskFreeInterestRateModel = null,\n            bool useMirrorContract = true)\n        {\n            return new IndicatorBasedOptionPriceModel(optionModel, ivModel, dividendYieldModel, riskFreeInterestRateModel, useMirrorContract, securityProvider: Securities);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n// ReSharper disable InconsistentNaming\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing System.Globalization;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Provides extension methods for Indicator\n    /// </summary>\n    public static class IndicatorExtensions\n    {\n        /// <summary>\n        /// Updates the state of this indicator with the given value and returns true\n        /// if this indicator is ready, false otherwise\n        /// </summary>\n        /// <param name=\"indicator\">The indicator to be updated</param>\n        /// <param name=\"time\">The time associated with the value</param>\n        /// <param name=\"value\">The value to use to update this indicator</param>\n        /// <returns>True if this indicator is ready, false otherwise</returns>\n        public static bool Update(this IndicatorBase<IndicatorDataPoint> indicator, DateTime time, decimal value)\n        {\n            return indicator.Update(new IndicatorDataPoint(time, value));\n        }\n\n        /// <summary>\n        /// Configures the second indicator to receive automatic updates from the first by attaching an event handler\n        /// to first.DataConsolidated\n        /// </summary>\n        /// <param name=\"second\">The indicator that receives data from the first</param>\n        /// <param name=\"first\">The indicator that sends data via DataConsolidated even to the second</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if first.IsReady returns true, false to always send updates to second</param>\n        /// <returns>The reference to the second indicator to allow for method chaining</returns>\n        public static T Of<T>(this T second, IIndicator first, bool waitForFirstToReady = true)\n            where T : IIndicator\n        {\n            first.Updated += (sender, consolidated) =>\n            {\n                // only send the data along if we're ready\n                if (!waitForFirstToReady || first.IsReady)\n                {\n                    second.Update(consolidated);\n                }\n            };\n\n            return second;\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one\n        /// </summary>\n        /// <param name=\"value\">Indicator that will be averaged</param>\n        /// <param name=\"weight\">Indicator that provides the average weights</param>\n        /// <param name=\"period\">Average period</param>\n        /// <returns>Indicator that results of the average of first by weights given by second</returns>\n        public static CompositeIndicator WeightedBy(this IndicatorBase value, IndicatorBase weight, int period)\n        {\n            var x = new WindowIdentity(period);\n            var y = new WindowIdentity(period);\n            var numerator = new Sum(\"Sum_xy\", period);\n            var denominator = new Sum(\"Sum_y\", period);\n\n            value.Updated += (sender, consolidated) =>\n            {\n                x.Update(consolidated);\n                if (x.Samples == y.Samples)\n                {\n                    numerator.Update(consolidated.Time, consolidated.Value * y.Current.Value);\n                }\n            };\n\n            weight.Updated += (sender, consolidated) =>\n            {\n                y.Update(consolidated);\n                if (x.Samples == y.Samples)\n                {\n                    numerator.Update(consolidated.Time, consolidated.Value * x.Current.Value);\n                }\n                denominator.Update(consolidated);\n            };\n\n            var resetCompositeIndicator = new ResetCompositeIndicator(numerator, denominator, GetOverIndicatorComposer(), () =>\n            {\n                x.Reset();\n                y.Reset();\n            });\n\n            return resetCompositeIndicator;\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the sum of the left and the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left + constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The addend</param>\n        /// <returns>The sum of the left and right indicators</returns>\n        public static CompositeIndicator Plus(this IndicatorBase left, decimal constant)\n        {\n            var constantIndicator = new ConstantIndicator<IBaseData>(constant.ToString(CultureInfo.InvariantCulture), constant);\n            return left.Plus(constantIndicator);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the sum of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left + right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <returns>The sum of the left and right indicators</returns>\n        public static CompositeIndicator Plus(this IndicatorBase left, IndicatorBase right)\n        {\n            return new(left, right, (l, r) => l.Current.Value + r.Current.Value);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the sum of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left + right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The sum of the left and right indicators</returns>\n        public static CompositeIndicator Plus(this IndicatorBase left, IndicatorBase right, string name)\n        {\n            return new(name, left, right, (l, r) => l.Current.Value + r.Current.Value);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the difference of the left and constant\n        /// </summary>\n        /// <remarks>\n        /// value = left - constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The subtrahend</param>\n        /// <returns>The difference of the left and right indicators</returns>\n        public static CompositeIndicator Minus(this IndicatorBase left, decimal constant)\n        {\n            var constantIndicator = new ConstantIndicator<IBaseData>(constant.ToString(CultureInfo.InvariantCulture), constant);\n            return left.Minus(constantIndicator);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the difference of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left - right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <returns>The difference of the left and right indicators</returns>\n        public static CompositeIndicator Minus(this IndicatorBase left, IndicatorBase right)\n        {\n            return new(left, right, (l, r) => l.Current.Value - r.Current.Value);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the difference of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left - right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The difference of the left and right indicators</returns>\n        public static CompositeIndicator Minus(this IndicatorBase left, IndicatorBase right, string name)\n        {\n            return new(name, left, right, (l, r) => l.Current.Value - r.Current.Value);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the ratio of the left to the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left/constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The constant value denominator</param>\n        /// <returns>The ratio of the left to the right indicator</returns>\n        public static CompositeIndicator Over(this IndicatorBase left, decimal constant)\n        {\n            var constantIndicator = new ConstantIndicator<IndicatorDataPoint>(constant.ToString(CultureInfo.InvariantCulture), constant);\n            return left.Over(constantIndicator);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the ratio of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left/right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <returns>The ratio of the left to the right indicator</returns>\n        public static CompositeIndicator Over(this IndicatorBase left, IndicatorBase right)\n        {\n            return new(left, right, GetOverIndicatorComposer());\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the ratio of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left/right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The ratio of the left to the right indicator</returns>\n        public static CompositeIndicator Over(this IndicatorBase left, IndicatorBase right, string name)\n        {\n            return new(name, left, right, GetOverIndicatorComposer());\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the product of the left and the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left*constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The constant value to multiple by</param>\n        /// <returns>The product of the left to the right indicators</returns>\n        public static CompositeIndicator Times(this IndicatorBase left, decimal constant)\n        {\n            var constantIndicator = new ConstantIndicator<IndicatorDataPoint>(constant.ToString(CultureInfo.InvariantCulture), constant);\n            return left.Times(constantIndicator);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the product of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left*right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <returns>The product of the left to the right indicators</returns>\n        public static CompositeIndicator Times(this IndicatorBase left, IndicatorBase right)\n        {\n            return new(left, right, (l, r) => l.Current.Value * r.Current.Value);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the product of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left*right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The product of the left to the right indicators</returns>\n        public static CompositeIndicator Times(this IndicatorBase left, IndicatorBase right, string name)\n        {\n            return new(name, left, right, (l, r) => l.Current.Value * r.Current.Value);\n        }\n\n        /// <summary>Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The ExponentialMovingAverage indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the ExponentialMovingAverage indicators</param>\n        /// <param name=\"smoothingFactor\">The percentage of data from the previous value to be carried into the next value</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the ExponentialMovingAverage indicator to allow for method chaining</returns>\n        public static ExponentialMovingAverage EMA(this IndicatorBase left, int period, decimal? smoothingFactor = null, bool waitForFirstToReady = true)\n        {\n            var k = smoothingFactor ?? ExponentialMovingAverage.SmoothingFactorDefault(period);\n            return new ExponentialMovingAverage($\"EMA{period}_Of_{left.Name}\", period, k).Of(left, waitForFirstToReady);\n        }\n\n        /// <summary>Creates a new Maximum indicator with the specified period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The Maximum indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the Maximum indicator</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the Maximum indicator to allow for method chaining</returns>\n        public static Maximum MAX(this IIndicator left, int period, bool waitForFirstToReady = true)\n        {\n            return new Maximum($\"MAX{period}_Of_{left.Name}\", period).Of(left, waitForFirstToReady);\n        }\n\n        /// <summary>Creates a new Minimum indicator with the specified period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The Minimum indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the Minimum indicator</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the Minimum indicator to allow for method chaining</returns>\n        public static Minimum MIN(this IndicatorBase left, int period, bool waitForFirstToReady = true)\n        {\n            return new Minimum($\"MIN{period}_Of_{left.Name}\", period).Of(left, waitForFirstToReady);\n        }\n\n        /// <summary>Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The SimpleMovingAverage indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if first.IsReady returns true, false to always send updates to second</param>\n        /// <returns>The reference to the SimpleMovingAverage indicator to allow for method chaining</returns>\n        public static SimpleMovingAverage SMA(this IndicatorBase left, int period, bool waitForFirstToReady = true)\n        {\n            return new SimpleMovingAverage($\"SMA{period}_Of_{left.Name}\", period).Of(left, waitForFirstToReady);\n        }\n\n\n\n        /// The methods overloads bellow are due to python.net not being able to correctly solve generic methods overload\n\n        /// <summary>\n        /// Configures the second indicator to receive automatic updates from the first by attaching an event handler\n        /// to first.DataConsolidated\n        /// </summary>\n        /// <param name=\"second\">The indicator that receives data from the first</param>\n        /// <param name=\"first\">The indicator that sends data via DataConsolidated even to the second</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if first.IsReady returns true, false to always send updates to second</param>\n        /// <returns>The reference to the second indicator to allow for method chaining</returns>\n        public static IndicatorBase Of(PyObject second, PyObject first, bool waitForFirstToReady = true)\n        {\n            var indicator1 = GetIndicatorAsManagedObject(first);\n            var indicator2 = GetIndicatorAsManagedObject(second);\n            return Of(indicator2, indicator1, waitForFirstToReady);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be average of a first indicator weighted by a second one\n        /// </summary>\n        /// <param name=\"value\">Indicator that will be averaged</param>\n        /// <param name=\"weight\">Indicator that provides the average weights</param>\n        /// <param name=\"period\">Average period</param>\n        /// <returns>Indicator that results of the average of first by weights given by second</returns>\n        // ReSharper disable once UnusedMember.Global\n        public static CompositeIndicator WeightedBy(PyObject value, PyObject weight, int period)\n        {\n            var indicator1 = GetIndicatorAsManagedObject(value);\n            var indicator2 = GetIndicatorAsManagedObject(weight);\n            return WeightedBy(indicator1, indicator2, period);\n        }\n\n        /// <summary>\n        /// Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The ExponentialMovingAverage indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the ExponentialMovingAverage indicators</param>\n        /// <param name=\"smoothingFactor\">The percentage of data from the previous value to be carried into the next value</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the ExponentialMovingAverage indicator to allow for method chaining</returns>\n        public static ExponentialMovingAverage EMA(PyObject left, int period, decimal? smoothingFactor = null, bool waitForFirstToReady = true)\n        {\n            var indicator = GetIndicatorAsManagedObject(left);\n            return EMA(indicator, period, smoothingFactor, waitForFirstToReady);\n        }\n\n        /// <summary>\n        /// Creates a new Maximum indicator with the specified period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The Maximum indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the Maximum indicator</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the Maximum indicator to allow for method chaining</returns>\n        public static Maximum MAX(PyObject left, int period, bool waitForFirstToReady = true)\n        {\n            var indicator = GetIndicatorAsManagedObject(left);\n            return MAX(indicator, period, waitForFirstToReady);\n        }\n\n        /// <summary>\n        /// Creates a new Minimum indicator with the specified period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The Minimum indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the Minimum indicator</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if left.IsReady returns true, false to always send updates</param>\n        /// <returns>A reference to the Minimum indicator to allow for method chaining</returns>\n        public static Minimum MIN(PyObject left, int period, bool waitForFirstToReady = true)\n        {\n            var indicator = GetIndicatorAsManagedObject(left);\n            return MIN(indicator, period, waitForFirstToReady);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator\n        /// </summary>\n        /// <param name=\"left\">The SimpleMovingAverage indicator will be created using the data from left</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        /// <param name=\"waitForFirstToReady\">True to only send updates to the second if first.IsReady returns true, false to always send updates to second</param>\n        /// <returns>The reference to the SimpleMovingAverage indicator to allow for method chaining</returns>\n        public static SimpleMovingAverage SMA(PyObject left, int period, bool waitForFirstToReady = true)\n        {\n            var indicator = GetIndicatorAsManagedObject(left);\n            return SMA(indicator, period, waitForFirstToReady);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the ratio of the left to the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left/constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The constant value denominator</param>\n        /// <returns>The ratio of the left to the right indicator</returns>\n        public static CompositeIndicator Over(PyObject left, decimal constant)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            return Over(indicatorLeft, constant);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the ratio of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left/right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The ratio of the left to the right indicator</returns>\n        public static CompositeIndicator Over(PyObject left, PyObject right, string name = null)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            var indicatorRight = GetIndicatorAsManagedObject(right);\n            return Over(indicatorLeft, indicatorRight, name);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the difference of the left and constant\n        /// </summary>\n        /// <remarks>\n        /// value = left - constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The subtrahend</param>\n        /// <returns>The difference of the left and right indicators</returns>\n        public static CompositeIndicator Minus(PyObject left, decimal constant)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            return Minus(indicatorLeft, constant);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the difference of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left - right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The difference of the left and right indicators</returns>\n        public static CompositeIndicator Minus(PyObject left, PyObject right, string name = null)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            var indicatorRight = GetIndicatorAsManagedObject(right);\n            return Minus(indicatorLeft, indicatorRight, name);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the product of the left and the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left*constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The constant value to multiple by</param>\n        /// <returns>The product of the left to the right indicators</returns>\n        public static CompositeIndicator Times(PyObject left, decimal constant)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            return Times(indicatorLeft, constant);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the product of the left to the right\n        /// </summary>\n        /// <remarks>\n        /// value = left*right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The product of the left to the right indicators</returns>\n        public static CompositeIndicator Times(PyObject left, PyObject right, string name = null)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            var indicatorRight = GetIndicatorAsManagedObject(right);\n            return Times(indicatorLeft, indicatorRight, name);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the sum of the left and the constant\n        /// </summary>\n        /// <remarks>\n        /// value = left + constant\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"constant\">The addend</param>\n        /// <returns>The sum of the left and right indicators</returns>\n        public static CompositeIndicator Plus(PyObject left, decimal constant)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            return Plus(indicatorLeft, constant);\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator such that the result will be the sum of the left and right\n        /// </summary>\n        /// <remarks>\n        /// value = left + right\n        /// </remarks>\n        /// <param name=\"left\">The left indicator</param>\n        /// <param name=\"right\">The right indicator</param>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <returns>The sum of the left and right indicators</returns>\n        public static CompositeIndicator Plus(PyObject left, PyObject right, string name = null)\n        {\n            var indicatorLeft = GetIndicatorAsManagedObject(left);\n            var indicatorRight = GetIndicatorAsManagedObject(right);\n            return Plus(indicatorLeft, indicatorRight, name);\n        }\n\n        internal static IndicatorBase GetIndicatorAsManagedObject(this PyObject indicator)\n        {\n            if (indicator.TryConvert(out PythonIndicator pythonIndicator, true))\n            {\n                pythonIndicator.SetIndicator(indicator);\n                return pythonIndicator;\n            }\n\n            return indicator.SafeAsManagedObject();\n        }\n\n        /// <summary>\n        /// Gets the IndicatorComposer for a CompositeIndicator whose result is the ratio of the left to the right\n        /// </summary>\n        /// <returns>The IndicatorComposer for a CompositeIndicator whose result is the ratio of the left to the right</returns>\n        private static CompositeIndicator.IndicatorComposer GetOverIndicatorComposer()\n        {\n            return (l, r) => r.Current.Value == 0m ? new IndicatorResult(0m, IndicatorStatus.MathError) : new IndicatorResult(l.Current.Value / r.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorResult.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the result of an indicator's calculations\n    /// </summary>\n    public class IndicatorResult\n    {\n        /// <summary>\n        /// The indicator output value\n        /// </summary>\n        public decimal Value\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// The indicator status\n        /// </summary>\n        public IndicatorStatus Status\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IndicatorResult\"/> class\n        /// </summary>\n        /// <param name=\"value\">The value output by the indicator</param>\n        /// <param name=\"status\">The status returned by the indicator</param>\n        public IndicatorResult(decimal value, IndicatorStatus status = IndicatorStatus.Success)\n        {\n            Value = value;\n            Status = status;\n        }\n\n        /// <summary>\n        /// Converts the specified decimal value into a successful indicator result\n        /// </summary>\n        /// <remarks>\n        /// This method is provided for backwards compatibility\n        /// </remarks>\n        /// <param name=\"value\">The decimal value to be converted into an <see cref=\"IndicatorResult\"/></param>\n        public static implicit operator IndicatorResult(decimal value)\n        {\n            return new IndicatorResult(value);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IndicatorStatus.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The possible states returned by <see cref=\"IndicatorBase{T}.ComputeNextValue\"/>\n    /// </summary>\n    public enum IndicatorStatus\n    {\n        /// <summary>\n        /// The indicator successfully calculated a value for the input data (0)\n        /// </summary>\n        Success,\n\n        /// <summary>\n        /// The indicator detected an invalid input data point or tradebar (1)\n        /// </summary>\n        InvalidInput,\n\n        /// <summary>\n        /// The indicator encountered a math error during calculations (2)\n        /// </summary>\n        MathError,\n\n        /// <summary>\n        /// The indicator value is not ready (3)\n        /// </summary>\n        ValueNotReady\n    }\n}\n"
  },
  {
    "path": "Indicators/InternalBarStrength.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The InternalBarStrenght indicator is a measure of the relative position of a period's closing price \n    /// to the same period's high and low.\n    /// The IBS can be interpreted to predict a bullish signal when displaying a low value and a bearish signal when presenting a high value.\n    /// </summary>\n    public class InternalBarStrength : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 0;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1;\n\n        /// <summary>\n        /// Creates a new InternalBarStrenght indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public InternalBarStrength(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new InternalBarStrenght indicator using the specified period and moving average type\n        /// </summary>\n        public InternalBarStrength()\n            : this($\"IBS()\")\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (input.High == input.Low)\n            {\n                return 0.5m;\n            }\n            else\n            {\n                return (input.Close - input.Low) / (input.High - input.Low);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/IntradayVwap.cs",
    "content": "using System;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Defines the canonical intraday VWAP indicator\n    /// </summary>\n    public class IntradayVwap : IndicatorBase<BaseData>\n    {\n        private DateTime _lastDate;\n        private decimal _sumOfVolume;\n        private decimal _sumOfPriceTimesVolume;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _sumOfVolume > 0;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IntradayVwap\"/> class\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        public IntradayVwap(string name = \"VWAP\")\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Computes the new VWAP\n        /// </summary>\n        protected override IndicatorResult ValidateAndComputeNextValue(BaseData input)\n        {\n            decimal volume, averagePrice;\n            if (!TryGetVolumeAndAveragePrice(input, out volume, out averagePrice))\n            {\n                return new IndicatorResult(0, IndicatorStatus.InvalidInput);\n            }\n\n            // reset vwap on daily boundaries\n            if (_lastDate != input.EndTime.Date)\n            {\n                _sumOfVolume = 0m;\n                _sumOfPriceTimesVolume = 0m;\n                _lastDate = input.EndTime.Date;\n            }\n\n            // running totals for Σ PiVi / Σ Vi\n            _sumOfVolume += volume;\n            _sumOfPriceTimesVolume += averagePrice * volume;\n\n            if (_sumOfVolume == 0m)\n            {\n                // if we have no trade volume then use the current price as VWAP\n                return input.Value;\n            }\n\n            return _sumOfPriceTimesVolume / _sumOfVolume;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state.\n        /// NOTE: This must be overriden since it's abstract in the base, but\n        /// will never be invoked since we've override the validate method above.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(BaseData input)\n        {\n            throw new NotImplementedException($\"{nameof(IntradayVwap)}.{nameof(ComputeNextValue)} should never be invoked.\");\n        }\n\n        /// <summary>\n        /// Determines the volume and price to be used for the current input in the VWAP computation\n        /// </summary>\n        protected bool TryGetVolumeAndAveragePrice(BaseData input, out decimal volume, out decimal averagePrice)\n        {\n            var tick = input as Tick;\n\n            if (tick?.TickType == TickType.Trade)\n            {\n                volume = tick.Quantity;\n                averagePrice = tick.LastPrice;\n                return true;\n            }\n\n            var tradeBar = input as TradeBar;\n            if (tradeBar?.IsFillForward == false)\n            {\n                volume = tradeBar.Volume;\n                averagePrice = (tradeBar.High + tradeBar.Low + tradeBar.Close) / 3m;\n                return true;\n            }\n\n            volume = 0;\n            averagePrice = 0;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/KaufmanAdaptiveMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Kaufman Adaptive Moving Average (KAMA).\n    /// The Kaufman Adaptive Moving Average is calculated as explained here:\n    /// http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:kaufman_s_adaptive_moving_average\n    /// </summary>\n    public class KaufmanAdaptiveMovingAverage : KaufmanEfficiencyRatio\n    {\n        private readonly decimal _slowSmoothingFactor;\n        private readonly decimal _diffSmoothingFactor;\n        private decimal _prevKama;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KaufmanAdaptiveMovingAverage\"/> class using the specified name and period.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER)</param>\n        /// <param name=\"fastEmaPeriod\">The period of the fast EMA used to calculate the Smoothing Constant (SC)</param>\n        /// <param name=\"slowEmaPeriod\">The period of the slow EMA used to calculate the Smoothing Constant (SC)</param>\n        public KaufmanAdaptiveMovingAverage(string name, int period, int fastEmaPeriod = 2, int slowEmaPeriod = 30)\n            : base(name, period)\n        {\n            // Smoothing factor of the slow EMA\n            _slowSmoothingFactor = 2m / (slowEmaPeriod + 1m);\n            // Difference between the smoothing factor of the fast and slow EMA\n            _diffSmoothingFactor = 2m / (fastEmaPeriod + 1m) - _slowSmoothingFactor;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KaufmanAdaptiveMovingAverage\"/> class using the specified period.\n        /// </summary>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER)</param>\n        /// <param name=\"fastEmaPeriod\">The period of the fast EMA used to calculate the Smoothing Constant (SC)</param>\n        /// <param name=\"slowEmaPeriod\">The period of the slow EMA used to calculate the Smoothing Constant (SC)</param>\n        public KaufmanAdaptiveMovingAverage(int period, int fastEmaPeriod = 2, int slowEmaPeriod = 30)\n            : this($\"KAMA({period},{fastEmaPeriod},{slowEmaPeriod})\", period, fastEmaPeriod, slowEmaPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            // Calculate the efficiency ratio\n            var efficiencyRatio = base.ComputeNextValue(window, input);\n\n            if (Samples < Period)\n            {\n                return input.Value;\n            }\n\n            if (Samples == Period)\n            {\n                // Calculate the first KAMA\n                // The yesterday price is used here as the previous KAMA.\n                _prevKama = window[1].Value;\n            }\n\n            // Calculate the smoothing constant\n            var smoothingConstant = efficiencyRatio * _diffSmoothingFactor + _slowSmoothingFactor;\n            smoothingConstant *= smoothingConstant;\n\n            // Calculate the KAMA like an EMA, using the\n            // smoothing constant as the adaptive factor.\n            _prevKama = (input.Value - _prevKama) * smoothingConstant + _prevKama;\n\n            return _prevKama;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _prevKama = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/KaufmanEfficiencyRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Kaufman Efficiency Ratio (KER).\n    /// The Kaufman Efficiency Ratio is calculated as explained here:\n    /// https://www.marketvolume.com/technicalanalysis/efficiencyratio.asp\n    /// </summary>\n    public class KaufmanEfficiencyRatio : WindowIndicator<IndicatorDataPoint>\n    {\n        private decimal _sumRoc1;\n        private decimal _periodRoc;\n        private decimal _trailingValue;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= Period;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KaufmanEfficiencyRatio\"/> class using the specified name and period.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER)</param>\n        public KaufmanEfficiencyRatio(string name, int period)\n            : base(name, period + 1)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KaufmanEfficiencyRatio\"/> class using the specified period.\n        /// </summary>\n        /// <param name=\"period\">The period of the Efficiency Ratio (ER)</param>\n        public KaufmanEfficiencyRatio(int period)\n            : this($\"KER({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (Samples < Period)\n            {\n                if (Samples > 1)\n                {\n                    _sumRoc1 += Math.Abs(input.Value - window[1].Value);\n                }\n\n                return input.Value;\n            }\n\n            if (Samples == Period)\n            {\n                _sumRoc1 += Math.Abs(input.Value - window[1].Value);\n            }\n\n            var newTrailingValue = window[Period - 1];\n            _periodRoc = input.Value - newTrailingValue.Value;\n\n            if (Samples > Period)\n            {\n                // Adjust sumROC1:\n                // - Remove trailing ROC1 \n                // - Add new ROC1\n                _sumRoc1 -= Math.Abs(_trailingValue - newTrailingValue.Value);\n                _sumRoc1 += Math.Abs(input.Value - window[1].Value);\n            }\n\n            _trailingValue = newTrailingValue.Value;\n\n            // Calculate the efficiency ratio\n            return _sumRoc1 <= _periodRoc || _sumRoc1 == 0 ? 1m : Math.Abs(_periodRoc / _sumRoc1);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _sumRoc1 = 0;\n            _periodRoc = 0;\n            _trailingValue = 0;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/KeltnerChannels.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary> \n    /// This indicator creates a moving average (middle band) with an upper band and lower band\n    /// fixed at k average true range multiples away from the middle band.  \n    /// </summary>\n    public class KeltnerChannels : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the middle band of the channel\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> MiddleBand { get; }\n\n        /// <summary>\n        /// Gets the upper band of the channel\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> UpperBand { get; }\n\n        /// <summary>\n        /// Gets the lower band of the channel\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> LowerBand { get; }\n\n        /// <summary>\n        /// Gets the average true range\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> AverageTrueRange { get; }\n\n\n        /// <summary>\n        /// Initializes a new instance of the KeltnerChannels class\n        /// </summary>\n        /// <param name=\"period\">The period of the average true range and moving average (middle band)</param>\n        /// <param name=\"k\">The number of multiplies specifying the distance between the middle band and upper or lower bands</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public KeltnerChannels(int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"KC({period},{k})\", period, k, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the KeltnerChannels class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the average true range and moving average (middle band)</param>\n        /// <param name=\"k\">The number of multiples specifying the distance between the middle band and upper or lower bands</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public KeltnerChannels(string name, int period, decimal k, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n\n            //Initialise ATR and SMA\n            AverageTrueRange = new AverageTrueRange(name + \"_AverageTrueRange\", period, MovingAverageType.Simple);\n            MiddleBand = movingAverageType.AsIndicator(name + \"_MiddleBand\", period);\n\n            //Compute Lower Band\n            LowerBand = new FunctionalIndicator<IBaseDataBar>(name + \"_LowerBand\",\n                input => MiddleBand.IsReady ? MiddleBand.Current.Value - AverageTrueRange.Current.Value * k : decimal.Zero,\n                lowerBand => MiddleBand.IsReady,\n                () => MiddleBand.Reset()\n                );\n\n            //Compute Upper Band\n            UpperBand = new FunctionalIndicator<IBaseDataBar>(name + \"_UpperBand\",\n                input => MiddleBand.IsReady ? MiddleBand.Current.Value + AverageTrueRange.Current.Value * k : decimal.Zero,\n                upperBand => MiddleBand.IsReady,\n                () => MiddleBand.Reset()\n                );\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => MiddleBand.IsReady && UpperBand.IsReady && LowerBand.IsReady && AverageTrueRange.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            AverageTrueRange.Reset();\n            MiddleBand.Reset();\n            UpperBand.Reset();\n            LowerBand.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The TradeBar to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            AverageTrueRange.Update(input);\n\n            var typicalPrice = (input.High + input.Low + input.Close) / 3m;\n            MiddleBand.Update(input.EndTime, typicalPrice);\n\n            // poke the upper/lower bands, they actually don't use the input, they compute\n            // based on the ATR and the middle band\n            LowerBand.Update(input);\n            UpperBand.Update(input);\n            return MiddleBand.Current.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/KlingerVolumeOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Klinger Volume Oscillator (KVO) is a technical indicator that analyzes the relationship between\n    /// price movement and trading volume to assess the strength of market trends and identify potential\n    /// trend reversals. As a volume-based oscillator, it measures the force behind price movements by\n    /// incorporating volume data adjusted for price trends and specific conditions. Traders use the KVO\n    /// to analyze its behavior relative to price action, looking for patterns such as divergences or\n    /// crossovers that can provide insights into market trends and potential turning points.\n    /// </summary>\n    public class KlingerVolumeOscillator : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly ExponentialMovingAverage _fastEma;\n        private readonly ExponentialMovingAverage _slowEma;\n\n        private readonly RollingWindow<decimal> _priceIndex;\n        private readonly RollingWindow<decimal> _rangeWindow;\n        private readonly RollingWindow<int> _trendWindow;\n        private decimal _cumulativeMovement;\n\n        // Minimum cumulative movement value to avoid division by zero and near zero in volume force calculation\n        private const decimal MinCumulativeForDivision = 1e-8m;\n\n        /// <summary>\n        /// Gets the public signal line (EMA of KVO)\n        /// </summary>\n        public ExponentialMovingAverage Signal { get; }\n\n        /// <summary>\n        /// Gets the warm-up period required for the indicator to be ready.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Gets a value indicating whether the indicator is ready and has enough data.\n        /// </summary>\n        public override bool IsReady => _fastEma.IsReady && _slowEma.IsReady && Signal.IsReady;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KlingerVolumeOscillator\"/> class with specified fast, slow periods.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"fastPeriod\">The fast EMA period.</param>\n        /// <param name=\"slowPeriod\">The slow EMA period.</param>\n        /// <param name=\"signalPeriod\">The signal line period.</param>\n        public KlingerVolumeOscillator(string name, int fastPeriod, int slowPeriod, int signalPeriod)\n            : base(name)\n        {\n            _fastEma = new ExponentialMovingAverage(name + \"_FastEma\", fastPeriod);\n            _slowEma = new ExponentialMovingAverage(name + \"_SlowEma\", slowPeriod);\n            Signal = new ExponentialMovingAverage(name + \"_Signal\", signalPeriod);\n\n            _priceIndex = new RollingWindow<decimal>(2);\n            _rangeWindow = new RollingWindow<decimal>(2);\n            _trendWindow = new RollingWindow<int>(2);\n\n            WarmUpPeriod = Math.Max(fastPeriod, Math.Max(slowPeriod, signalPeriod)) + 2;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KlingerVolumeOscillator\"/> class with specified fast, slow periods.\n        /// </summary>\n        /// <param name=\"fastPeriod\">The fast EMA period.</param>\n        /// <param name=\"slowPeriod\">The slow EMA period.</param>\n        /// <param name=\"signalPeriod\">The signal line period (default is 13).</param>\n        public KlingerVolumeOscillator(int fastPeriod, int slowPeriod, int signalPeriod = 13)\n            : this($\"KVO({fastPeriod},{slowPeriod},{signalPeriod})\", fastPeriod, slowPeriod, signalPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of the Klinger Volume Oscillator based on the input data point.\n        /// </summary>\n        protected override decimal ComputeNextValue(TradeBar bar)\n        {\n            // daily movement range\n            var todaysMovement = bar.High - bar.Low;\n            _rangeWindow.Add(todaysMovement);\n\n            // price index value, used to compare current and previous price trends\n            var hlc = bar.High + bar.Low + bar.Close;\n            _priceIndex.Add(hlc);\n\n            if (!_priceIndex.IsReady)\n            {\n                // Not enough data\n                return 0m;\n            }\n\n            // determine if the price trend is going up or down, 1 for up, -1 for down\n            var currentTrend = _priceIndex[0] > _priceIndex[1] ? 1 : -1;\n            _trendWindow.Add(currentTrend);\n\n            if (!_trendWindow.IsReady)\n            {\n                // Not enough data\n                return 0m;\n            }\n\n            // Data is ready to calculate KVO\n            var hasMovement = _cumulativeMovement != 0;\n            var trendChanged = _trendWindow[0] != _trendWindow[1];\n            var yesterdaysRange = _rangeWindow[1];\n\n            if (!hasMovement || trendChanged)\n            {\n                // Start new flow accumulation with the previous daily movement\n                _cumulativeMovement = todaysMovement + yesterdaysRange;\n            }\n            else\n            {\n                // Continue flow accumulation in the same trend direction\n                _cumulativeMovement += todaysMovement;\n            }\n\n            // Volume force:  strength of volume flow in the direction of the trend.\n            // There are various definitions of volume force, this is what we used in our implementation:\n            // https://github.com/nardew/talipp/blob/70dc9a26889c9c9329e44321e1362c4db43dbcc3/talipp/indicators/KVO.py#L85\n            // https://www.tradingview.com/support/solutions/43000589157-klinger-oscillator/\n            // Protect from division by zero and near zero from blowing up the volume force calculation\n            var denom = Math.Abs(_cumulativeMovement) < MinCumulativeForDivision ? MinCumulativeForDivision : _cumulativeMovement;\n            var volumeForce = bar.Volume * Math.Abs(2m * (todaysMovement / denom - 1m)) * currentTrend * 100m;\n\n            // update moving averages\n            var dataPoint = new IndicatorDataPoint(bar.EndTime, volumeForce);\n            _fastEma.Update(dataPoint);\n            _slowEma.Update(dataPoint);\n\n            if (!_fastEma.IsReady || !_slowEma.IsReady)\n            {\n                Signal.Update(new IndicatorDataPoint(bar.EndTime, 0m));\n                return 0m;\n            }\n\n            // Calculate KVO value as the difference between fast and slow EMAs\n            var kvo = _fastEma.Current.Value - _slowEma.Current.Value;\n            Signal.Update(new IndicatorDataPoint(bar.EndTime, kvo));\n\n            return kvo;\n        }\n\n        /// <summary>\n        /// Resets the indicator to its initial state.\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            Signal.Reset();\n            _fastEma.Reset();\n            _slowEma.Reset();\n            _priceIndex.Reset();\n            _rangeWindow.Reset();\n            _trendWindow.Reset();\n            _cumulativeMovement = 0m;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/KnowSureThing.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator creates a moving average (middle band) with an upper band and lower band\n    /// fixed at k standard deviations above and below the moving average.\n    /// </summary>\n    public class KnowSureThing : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the type of moving average\n        /// </summary>\n        public MovingAverageType MovingAverageType { get; }\n\n        /// <summary>\n        /// Gets the Rate of Change 1\n        /// </summary>\n        public RateOfChange ROC1 { get; }\n\n        /// <summary>\n        /// Gets the Rate of Change 2\n        /// </summary>\n        public RateOfChange ROC2 { get; }\n\n        /// <summary>\n        /// Gets the Rate of Change 3\n        /// </summary>\n        public RateOfChange ROC3 { get; }\n\n        /// <summary>\n        /// Gets the Rate of Change 4\n        /// </summary>\n        public RateOfChange ROC4 { get; }\n\n        /// <summary>\n        /// Gets the smoothed value of Rate of Change 1\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> ROC1MA { get; }\n\n        /// <summary>\n        /// Gets the smoothed value of Rate of Change 2\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> ROC2MA { get; }\n\n        /// <summary>\n        /// Gets the smoothed value of Rate of Change 3\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> ROC3MA { get; }\n\n        /// <summary>\n        /// Gets the smoothed value of Rate of Change 4\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> ROC4MA { get; }\n\n        /// <summary>\n        /// Gets the signal line\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> SignalLine { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => ROC1MA.IsReady && ROC2MA.IsReady && ROC3MA.IsReady && ROC4MA.IsReady && SignalLine.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the KnowSureThing class\n        /// </summary>\n        /// <param name=\"roc1Period\">The period over which to compute ROC1</param>\n        /// <param name=\"roc1MaPeriod\">The smoothing period used to smooth the computed ROC1 values</param>\n        /// <param name=\"roc2Period\">The period over which to compute ROC2</param>\n        /// <param name=\"roc2MaPeriod\">The smoothing period used to smooth the computed ROC2 values</param>\n        /// <param name=\"roc3Period\">The period over which to compute ROC3</param>\n        /// <param name=\"roc3MaPeriod\">The smoothing period used to smooth the computed ROC3 values</param>\n        /// <param name=\"roc4Period\">The period over which to compute ROC4</param>\n        /// <param name=\"roc4MaPeriod\">The smoothing period used to smooth the computed ROC4 values</param>\n        /// <param name=\"signalPeriod\">The smoothing period used to smooth the signal values</param>\n        /// <param name=\"movingAverageType\">Specifies the type of moving average to be used as smoother for KnowSureThing values</param>\n        public KnowSureThing(int roc1Period, int roc1MaPeriod, int roc2Period, int roc2MaPeriod,\n            int roc3Period, int roc3MaPeriod, int roc4Period, int roc4MaPeriod, int signalPeriod,\n            MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"KST({roc1Period},{roc1MaPeriod},{roc2Period},{roc2MaPeriod},{roc3Period},{roc3MaPeriod},{roc4Period},{roc4MaPeriod},{signalPeriod},{movingAverageType})\", roc1Period, roc1MaPeriod, roc2Period, roc2MaPeriod, roc3Period, roc3MaPeriod, roc4Period, roc4MaPeriod, signalPeriod, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the KnowSureThing class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"roc1Period\">The period over which to compute ROC1</param>\n        /// <param name=\"roc1MaPeriod\">The smoothing period used to smooth the computed ROC1 values</param>\n        /// <param name=\"roc2Period\">The period over which to compute ROC2</param>\n        /// <param name=\"roc2MaPeriod\">The smoothing period used to smooth the computed ROC2 values</param>\n        /// <param name=\"roc3Period\">The period over which to compute ROC3</param>\n        /// <param name=\"roc3MaPeriod\">The smoothing period used to smooth the computed ROC3 values</param>\n        /// <param name=\"roc4Period\">The period over which to compute ROC4</param>\n        /// <param name=\"roc4MaPeriod\">The smoothing period used to smooth the computed ROC4 values</param>\n        /// <param name=\"signalPeriod\">The smoothing period used to smooth the signal values</param>\n        /// <param name=\"movingAverageType\">Specifies the type of moving average to be used as smoother for KnowSureThing values</param>\n        public KnowSureThing(string name, int roc1Period, int roc1MaPeriod, int roc2Period, int roc2MaPeriod,\n            int roc3Period, int roc3MaPeriod, int roc4Period, int roc4MaPeriod, int signalPeriod,\n            MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = (new int[] {roc1Period + roc1MaPeriod, roc2Period + roc2MaPeriod, roc3Period + roc3MaPeriod, roc4Period + roc4MaPeriod }).Max();\n\n            MovingAverageType = movingAverageType;\n\n            ROC1 = new RateOfChange(roc1Period);\n            ROC2 = new RateOfChange(roc2Period);\n            ROC3 = new RateOfChange(roc3Period);\n            ROC4 = new RateOfChange(roc4Period);\n\n            ROC1MA = movingAverageType.AsIndicator(name + \"_ROC1MA\", roc1MaPeriod);\n            ROC2MA = movingAverageType.AsIndicator(name + \"_ROC2MA\", roc2MaPeriod);\n            ROC3MA = movingAverageType.AsIndicator(name + \"_ROC3MA\", roc3MaPeriod);\n            ROC4MA = movingAverageType.AsIndicator(name + \"_ROC4MA\", roc4MaPeriod);\n\n            SignalLine = movingAverageType.AsIndicator(name + \"_SignalLine\", signalPeriod);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>The next value of the KST based on input.</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            ROC1.Update(input);\n            ROC2.Update(input);\n            ROC3.Update(input);\n            ROC4.Update(input);\n\n            if (ROC1.IsReady)\n            {\n                ROC1MA.Update(input.EndTime, 100 * ROC1.Current.Value);\n            }\n            if (ROC2.IsReady)\n            {\n                ROC2MA.Update(input.EndTime, 100 * ROC2.Current.Value);\n            }\n            if (ROC3.IsReady)\n            {\n                ROC3MA.Update(input.EndTime, 100 * ROC3.Current.Value);\n            }\n            if (ROC4.IsReady)\n            {\n                ROC4MA.Update(input.EndTime, 100 * ROC4.Current.Value);\n            }\n\n            var kst = ROC1MA.Current.Value + 2 * ROC2MA.Current.Value + 3 * ROC3MA.Current.Value + 4 * ROC4MA.Current.Value;\n\n            SignalLine.Update(input.EndTime, kst);\n\n            if (!SignalLine.IsReady)\n            {\n                return 0m;\n            }\n\n            return kst;\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators\n        /// </summary>\n        public override void Reset()\n        {\n            ROC1.Reset();\n            ROC2.Reset();\n            ROC3.Reset();\n            ROC4.Reset();\n            ROC1MA.Reset();\n            ROC2MA.Reset();\n            ROC3MA.Reset();\n            ROC4MA.Reset();\n            SignalLine.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/LeastSquaresMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing MathNet.Numerics;\nusing MathNet.Numerics.LinearAlgebra;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Least Squares Moving Average (LSMA) first calculates a least squares regression line\n    /// over the preceding time periods, and then projects it forward to the current period. In\n    /// essence, it calculates what the value would be if the regression line continued.\n    /// Source: https://rtmath.net/assets/docs/finanalysis/html/b3fab79c-f4b2-40fb-8709-fdba43cdb363.htm\n    /// </summary>\n    public class LeastSquaresMovingAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Array representing the time.\n        /// </summary>\n        private readonly double[] _t;\n\n        /// <summary>\n        /// The point where the regression line crosses the y-axis (price-axis)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Intercept { get; }\n\n        /// <summary>\n        /// The regression line slope\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Slope { get; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeastSquaresMovingAverage\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The number of data points to hold in the window</param>\n        public LeastSquaresMovingAverage(string name, int period)\n            : base(name, period)\n        {\n            _t = Vector<double>.Build.Dense(period, i => i + 1).ToArray();\n            Intercept = new Identity(name + \"_Intercept\");\n            Slope = new Identity(name + \"_Slope\");\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeastSquaresMovingAverage\"/> class.\n        /// </summary>\n        /// <param name=\"period\">The number of data points to hold in the window.</param>\n        public LeastSquaresMovingAverage(int period)\n            : this($\"LSMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\"></param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            // Until the window is ready, the indicator returns the input value.\n            if (!window.IsReady) return input.Value;\n\n            // Sort the window by time, convert the observations to double and transform it to an array\n            var series = window\n                .OrderBy(i => i.EndTime)\n                .Select(i => Convert.ToDouble(i.Value))\n                .ToArray();\n            // Fit OLS\n            var ols = Fit.Line(x: _t, y: series);\n            Intercept.Update(input.EndTime, (decimal)ols.Item1);\n            Slope.Update(input.EndTime, (decimal)ols.Item2);\n\n            // Calculate the fitted value corresponding to the input\n            return Intercept.Current.Value + Slope.Current.Value * Period;\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators (Intercept, Slope)\n        /// </summary>\n        public override void Reset()\n        {\n            Intercept.Reset();\n            Slope.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/LinearWeightedMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the traditional Weighted Moving Average indicator. The weight are linearly\n    /// distributed according to the number of periods in the indicator.\n    ///\n    /// For example, a 4 period indicator will have a numerator of (4 * window[0]) + (3 * window[1]) + (2 * window[2]) + window[3]\n    /// and a denominator of 4 + 3 + 2 + 1 = 10\n    ///\n    /// During the warm up period, IsReady will return false, but the LWMA will still be computed correctly because\n    /// the denominator will be the minimum of Samples factorial or Size factorial and\n    /// the computation iterates over that minimum value.\n    ///\n    /// The RollingWindow of inputs is created when the indicator is created.\n    /// A RollingWindow of LWMAs is not saved.  That is up to the caller.\n    /// </summary>\n    public class LinearWeightedMovingAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _denominator;\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Initializes a new instance of the LinearWeightedMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the LWMA</param>\n        public LinearWeightedMovingAverage(string name, int period)\n            : base(name, period)\n        {\n            _denominator = (period * (period + 1)) / 2;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the LinearWeightedMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the LWMA</param>\n        public LinearWeightedMovingAverage(int period)\n            : this($\"LWMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            // our first data point just return identity\n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            var numerator = 0m;\n            var index = window.Size;\n\n            // If the indicator is not ready, the LWMA will still be correct\n            // because the numerator has the minimum of the Size (number of\n            // entries or the Samples (the allocated space)\n            var minSizeSamples = (int)Math.Min(index, window.Samples);\n            for (var i = 0; i < minSizeSamples; i++)\n            {\n                numerator += (index-- * window[i].Value);\n            }\n            return numerator / _denominator;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/LogReturn.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the LogReturn indicator (LOGR)\n    /// - log returns are useful for identifying price convergence/divergence in a given period\n    /// - logr = log (current price / last price in period)\n    /// </summary>\n    public class LogReturn : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Initializes a new instance of the LogReturn class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the LOGR</param>\n        public LogReturn(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the LogReturn class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the SMA</param>\n        public LogReturn(int period)\n            : base($\"LOGR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// - logr = log (current price / last price in period)\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            var valuef = input;\n\n            var value0 = window.Samples <= window.Size\n                ? window[window.Count - 1]\n                : window.MostRecentlyRemoved;\n            var result = Math.Log((double)(valuef.Value.SafeDivision(value0.Value)));\n            if (result == Double.NegativeInfinity || result == Double.PositiveInfinity)\n            {\n                return 0;\n            }\n\n            return result.SafeDecimalCast();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MarketProfile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an Indicator of the Market Profile and its attributes\n    /// \n    /// The concept of Market Profile stems from the idea that\n    /// markets have a form of organization determined by time,\n    /// price, and volume.Each day, the market will develop a range\n    /// for the day and a value area, which represents an equilibrium\n    /// point where there are an equal number of buyers and sellers.\n    /// In this area, prices never stay stagnant. They are constantly\n    /// diverging, and Market Profile records this activity for traders\n    /// to interpret.\n    /// \n    /// It can be computed in two modes: TPO (Time Price Opportunity) or VOL (Volume Profile)\n    /// A discussion on the difference between TPO (Time Price Opportunity) \n    /// and VOL (Volume Profile) chart types: https://jimdaltontrading.com/tpo-vs-volume-profile\n    /// </summary>\n    public abstract class MarketProfile : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Percentage of total volume contained in the ValueArea\n        /// </summary>\n        private readonly decimal _valueAreaVolumePercentage;\n\n        /// <summary>\n        /// The range of roundoff to the prices. i.e two decimal places, three decimal places\n        /// </summary>\n        private readonly decimal _priceRangeRoundOff;\n\n        /// <summary>\n        /// Rolling Window to erase old VolumePerPrice values out of the given period\n        /// First item is going to contain Data Point's close value\n        /// \n        /// Second item is going to contain the Volume, which can be 1 or\n        /// the Data Point's volume value\n        /// </summary>\n        private RollingWindow<Tuple<decimal, decimal>> _oldDataPoints { get; }\n\n        /// <summary>\n        /// Close values and Volume values in the given period of time.\n        /// Close values are the keys and Volume values the values.\n        /// The list is sorted in ascending order of the keys\n        /// </summary>\n        private SortedList<decimal, decimal> _volumePerPrice;\n\n        /// <summary>\n        /// A rolling sum of the Volume values for the given period\n        /// </summary>\n        private IndicatorBase<IndicatorDataPoint> _totalVolume { get; }\n\n        /// <summary>\n        /// POC Index\n        /// </summary>\n        private int _pointOfControl;\n\n        /// <summary>\n        /// Get a copy of the _volumePerPrice field\n        /// </summary>\n        public SortedList<decimal, decimal> VolumePerPrice => new SortedList<decimal, decimal>(_volumePerPrice);\n\n        /// <summary>\n        /// The highest reached close price level during the period.\n        /// That value is called Profile High\n        /// </summary>\n        public decimal ProfileHigh { get; private set; }\n\n        /// <summary>\n        /// The lowest reached close price level during the period.\n        /// That value is called Profile Low\n        /// </summary>\n        public decimal ProfileLow { get; private set; }\n\n        /// <summary>\n        /// Price where the most trading occured (Point of Control(POC))\n        /// This price is MarketProfile.Current.Value\n        /// </summary>\n        public decimal POCPrice { get; private set; }\n\n        /// <summary>\n        /// Volume where the most tradding occured (Point of Control(POC))\n        /// </summary>\n        public decimal POCVolume { get; private set; }\n\n        /// <summary>\n        /// The range of price levels in which a specified percentage of all volume \n        /// was traded during the time period. Typically, this percentage is set \n        /// to 70% however it is up to the trader’s discretion.\n        /// </summary>\n        public decimal ValueAreaVolume { get; private set; }\n\n        /// <summary>\n        /// The highest close price level within the value area\n        /// </summary>\n        public decimal ValueAreaHigh { get; private set; }\n\n        /// <summary>\n        /// The lowest close price level within the value area\n        /// </summary>\n        public decimal ValueAreaLow { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _totalVolume.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; private set; }\n\n        /// <summary>\n        /// Creates a new MarkProfile indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision.\n        /// i.e 0.01 round to two digits exactly. 0.05 by default.</param>\n        protected MarketProfile(string name, int period, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)\n            : base(name)\n        {\n            // Check roundoff is positive\n            if (priceRangeRoundOff <= 0)\n            {\n                throw new ArgumentException(\"Must be strictly bigger than zero.\", nameof(priceRangeRoundOff));\n            }\n\n            WarmUpPeriod = period;\n            _valueAreaVolumePercentage = valueAreaVolumePercentage;\n            _oldDataPoints = new RollingWindow<Tuple<decimal, decimal>>(period);\n            _volumePerPrice = new SortedList<decimal, decimal>();\n            _totalVolume = new Sum(name + \"_Sum\", period);\n            _priceRangeRoundOff = 1 / priceRangeRoundOff;\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A a value for this indicator, Point of Control (POC) price</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            // Define Volume and add it to _volumePerPrice and _oldDataPoints\n            var VolumeQuantity = GetVolume(input);\n            Add(input, VolumeQuantity);\n\n            // Get the index of the close price with maximum volume\n            _pointOfControl = GetMax();\n\n            var volumePerPriceCount = VolumePerPrice.Count;\n\n            // Get the POC price and volume values\n            POCPrice = volumePerPriceCount != 0 ? VolumePerPrice.Keys[_pointOfControl] : 0;\n            POCVolume = volumePerPriceCount != 0 ? VolumePerPrice.Values[_pointOfControl] : 0;\n\n            // Get the highest and lowest close prices\n            ProfileHigh = volumePerPriceCount != 0 ? VolumePerPrice.Keys.Max() : 0;\n            ProfileLow = volumePerPriceCount != 0 ? VolumePerPrice.Keys.Min() : 0;\n\n            // Calculate the Value Area Volume and Value Area High and Low\n            CalculateValueArea();\n\n            return POCPrice;\n        }\n\n        /// <summary>\n        /// Get the Volume value that's going to be used\n        /// </summary>\n        /// <param name=\"input\">Data</param>\n        /// <returns>The Volume value it's going to be used</returns>\n        protected abstract decimal GetVolume(TradeBar input);\n\n        /// <summary>\n        /// Add the new input value to the Close array and Volume dictionary.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <param name=\"VolumeQuantity\">Volume quantity of the data point, it dependes of DefineVolume method.</param>\n        private void Add(TradeBar input, decimal VolumeQuantity) \n        {\n            // Check if the RollingWindow _oldDataPoints has been filled to its capacity\n            var isFilled = _oldDataPoints.IsReady;\n\n            _oldDataPoints.Add(new Tuple<decimal, decimal>(input.Close, VolumeQuantity));\n\n            var ClosePrice = Round(input.Close);\n            if (!_volumePerPrice.Keys.Contains(ClosePrice))\n            {\n                _volumePerPrice.Add(ClosePrice,VolumeQuantity);\n            }\n            else\n            {\n                _volumePerPrice[ClosePrice] += VolumeQuantity;\n            }\n\n            _totalVolume.Update(input.Time, VolumeQuantity);\n\n            // If isFilled is true it means that the capacity was full before we added a new data point\n            // so by this time the RollingWindow has already removed the first added data point, so we\n            // need to remove it from the sortedList _volumePerPrice\n            if (isFilled)\n            {\n                var RemovedDataPoint = _oldDataPoints.MostRecentlyRemoved;\n                ClosePrice = Round(RemovedDataPoint.Item1);\n                // Two equal points can be inserted in _oldDataPoints, where the volume of the second one is zero. Then\n                // when the first one is removed from _oldDataPoints, its value in _volumePerPrice is also removed as\n                // the remaining value is zero.\n                if (_volumePerPrice.ContainsKey(ClosePrice))\n                {\n                    _volumePerPrice[ClosePrice] -= RemovedDataPoint.Item2;\n                    if (_volumePerPrice[ClosePrice] == 0)\n                    {\n                        _volumePerPrice.Remove(ClosePrice);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Finds the close price with biggest volume value.\n        /// </summary>\n        /// <returns> Index of the close price with biggest volume value</returns>\n        private int GetMax()\n        {\n            var maxIdx = 0;\n            for (int index = 0; index < VolumePerPrice.Values.Count; index++)\n            {\n                if (VolumePerPrice.Values[index] > VolumePerPrice.Values[maxIdx])\n                {\n                    maxIdx = index;\n                }\n                else if(VolumePerPrice.Values[index] == VolumePerPrice.Values[maxIdx])\n                {\n                    // Find the maximum with minimum distance to the center\n                    var mid = VolumePerPrice.Count - 1;\n                    if(Math.Abs(mid/2 - index)<Math.Abs(mid/2 - maxIdx))\n                    {\n                        maxIdx = index;\n                    }\n                }\n            }\n            return maxIdx;\n        }\n\n        /// <summary>\n        /// Calculate the Value Area Volume and the highest and lowest prices within it (VAH and VAL).\n        /// </summary>\n        private void CalculateValueArea()\n        {\n            // First ValueArea estimation\n            ValueAreaVolume = _totalVolume.Current.Value * _valueAreaVolumePercentage;\n\n            var currentVolume = POCVolume;\n\n            var minIndex = _pointOfControl;\n            var maxIndex = _pointOfControl;\n\n            int lastMin, lastMax;\n            int nextMinIndex, nextMaxIndex;\n\n            decimal lowVolume, highVolume;\n            \n            // When this loop ends we will have a more accurate value of ValueAreaVolume\n            // but mainly the prices that delimite this area, ValueAreaLow and ValueAreaHigh\n            // so ValueArea, can also be seen as the range between ValueAreaLow and ValueAreaHigh\n            while (currentVolume <= ValueAreaVolume && ValueAreaVolume != 0)\n            {\n                lastMin = minIndex;\n                lastMax = maxIndex;\n\n                nextMinIndex = Math.Max(minIndex - 1, 0);\n                nextMaxIndex = Math.Min(maxIndex + 1, VolumePerPrice.Count - 1);\n\n                if (nextMinIndex != lastMin)\n                {\n                    lowVolume = VolumePerPrice.Values[nextMinIndex];\n                }\n                else\n                {\n                    lowVolume = 0;\n                }\n\n                if (nextMaxIndex != lastMax)\n                {\n                    highVolume = VolumePerPrice.Values[nextMaxIndex];\n                }\n                else\n                {\n                    highVolume = 0;\n                }\n\n                // Take the largest volume value between the above and below prices\n                // of the Point of Control (the initial maxIndex and minIndex respectively)\n\n                if ((highVolume == 0) || ((lowVolume != 0) && (lowVolume > highVolume)))\n                {\n                    currentVolume += lowVolume;\n                    minIndex = nextMinIndex;\n                }\n                else if ((lowVolume == 0) || ((highVolume != 0) && (highVolume >= lowVolume)))\n                {\n                    currentVolume += highVolume;\n                    maxIndex = nextMaxIndex;\n                }\n                else\n                {\n                    break;\n                }\n\n                // We expand this range between minIndex and maxIndex until the sum of all volume values between\n                // them is bigger than the initial ValueAreaVolume value\n            }\n            ValueAreaHigh = VolumePerPrice.Count != 0 ? VolumePerPrice.Keys[maxIndex] : 0;\n            ValueAreaLow = VolumePerPrice.Count != 0 ? VolumePerPrice.Keys[minIndex] : 0;\n        }\n\n        /// <summary>\n        /// Round the decimal number\n        /// </summary>\n        /// <param name=\"a\">The decimal number to round</param>\n        /// <returns>The rounded decimal number</returns>\n        private decimal Round(decimal a)\n        {\n            return Math.Ceiling(a * _priceRangeRoundOff) / _priceRangeRoundOff;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _oldDataPoints.Reset();\n            _volumePerPrice.Clear();\n            _totalVolume.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/MassIndex.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Mass Index uses the high-low range to identify trend reversals based on range expansions.\n    /// In this sense, the Mass Index is a volatility indicator that does not have a directional\n    /// bias. Instead, the Mass Index identifies range bulges that can foreshadow a reversal of the\n    /// current trend. Developed by Donald Dorsey.\n    /// </summary>\n    /// <seealso cref=\"TradeBarIndicator\"/>\n    public class MassIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly ExponentialMovingAverage _ema1;\n        private readonly ExponentialMovingAverage _ema2;\n        private readonly Sum _sum;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MassIndex\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name for this instance.</param>\n        /// <param name=\"emaPeriod\">The period used by both EMA.</param>\n        /// <param name=\"sumPeriod\">The sum period.</param>\n        public MassIndex(string name, int emaPeriod, int sumPeriod)\n            : base(name)\n        {\n            _ema1 = new ExponentialMovingAverage(emaPeriod);\n            _ema2 = _ema1.EMA(emaPeriod);\n            _sum = new Sum(sumPeriod);\n            WarmUpPeriod = 2 * (emaPeriod - 1) + sumPeriod;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MassIndex\"/> class.\n        /// </summary>\n        /// <param name=\"emaPeriod\">The period used by both EMA.</param>\n        /// <param name=\"sumPeriod\">The sum period.</param>\n        public MassIndex(int emaPeriod = 9, int sumPeriod = 25)\n            : this($\"MASS({emaPeriod},{sumPeriod})\", emaPeriod, sumPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _sum.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _ema1.Reset();\n            _ema2.Reset();\n            _sum.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            _ema1.Update(input.EndTime, input.High - input.Low);\n            if (_ema2.IsReady)\n            {\n                _sum.Update(input.EndTime, _ema1.Current.Value.SafeDivision(_ema2.Current.Value));\n            }\n\n            if (!_sum.IsReady)\n            {\n                return _sum.Period;\n            }\n            return _sum.Current.Value;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Maximum.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator capable of tracking the maximum value and how many periods ago it occurred\n    /// </summary>\n    public class Maximum : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The number of periods since the maximum value was encountered\n        /// </summary>\n        public int PeriodsSinceMaximum { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Creates a new Maximum indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to look back</param>\n        public Maximum(int period)\n            : base($\"MAX({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Maximum indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to look back</param>\n        public Maximum(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <inheritdoc />\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (Samples == 1 || input.Value >= Current.Value)\n            {\n                // our first sample or if we're bigger than our previous indicator value\n                // reset the periods since maximum (it's this period) and return the value\n                PeriodsSinceMaximum = 0;\n                return input.Value;\n            }\n\n            if (PeriodsSinceMaximum >= Period - 1)\n            {\n                // at this point we need to find a new maximum\n                // the window enumerates from most recent to oldest\n                // so let's scour the window for the max and it's index\n\n                // this could be done more efficiently if we were to intelligently keep track of the 'next'\n                // maximum, so when one falls off, we have the other... but then we would also need the 'next, next' \n                // maximum, so on and so forth, for now this works.\n\n                var maximum = window.Select((v, i) => new\n                {\n                    Value = v,\n                    Index = i\n                }).OrderByDescending(x => x.Value.Value).First();\n\n                PeriodsSinceMaximum = maximum.Index;\n                return maximum.Value.Value;\n            }\n\n            // if we made it here then we didn't see a new maximum and we haven't reached our period limit,\n            // so just increment our periods since maximum and return the same value as we had before\n            PeriodsSinceMaximum++;\n            return Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            PeriodsSinceMaximum = 0;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/McClellanOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The McClellan Oscillator is a market breadth indicator which was\n    /// developed by Sherman and Marian McClellan. It is based on the\n    /// difference between the number of advancing and declining periods.\n    /// </summary>\n    public class McClellanOscillator : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly IndicatorBase<IndicatorDataPoint> _averageDelta;\n\n        /// <summary>\n        /// Fast period EMA of advance decline difference\n        /// </summary>\n        public ExponentialMovingAverage EMAFast { get; }\n\n        /// <summary>\n        /// Slow period EMA of advance decline difference\n        /// </summary>\n        public ExponentialMovingAverage EMASlow { get; }\n\n        /// <summary>\n        /// The number of advance assets minus the number of decline assets\n        /// </summary>\n        public AdvanceDeclineDifference ADDifference { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => EMASlow.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => EMASlow.WarmUpPeriod + ADDifference.WarmUpPeriod;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"McClellanOscillator\"/> class\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"fastPeriod\">The fast period of EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">The slow period of EMA of advance decline difference</param>\n        /// </summary>\n        public McClellanOscillator(string name, int fastPeriod = 19, int slowPeriod = 39) : base(name)\n        {\n            if (fastPeriod > slowPeriod)\n            {\n                throw new ArgumentException(\"fastPeriod must be less than slowPeriod.\");\n            }\n\n            ADDifference = new AdvanceDeclineDifference(\"ADD\");\n            EMAFast = ADDifference.EMA(fastPeriod);\n            EMASlow = ADDifference.EMA(slowPeriod);\n            _averageDelta = EMAFast.Minus(EMASlow);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"McClellanOscillator\"/> class\n        /// <param name=\"fastPeriod\">The fast period of EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">The slow period of EMA of advance decline difference</param>\n        /// </summary>\n        public McClellanOscillator(int fastPeriod = 19, int slowPeriod = 39)\n            : this(\"McClellanOscillator\", fastPeriod, slowPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            ADDifference.Update(input);\n\n            return _averageDelta.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            ADDifference.Reset();\n            EMAFast.Reset();\n            EMASlow.Reset();\n            _averageDelta.Reset();\n\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Add Tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking asset issue</param>\n        public void Add(Symbol asset)\n        {\n            ADDifference.Add(asset);\n        }\n\n        /// <summary>\n        /// Remove Tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking asset issue</param>\n        public void Remove(Symbol asset)\n        {\n            ADDifference.Remove(asset);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/McClellanSummationIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The McClellan Summation Index (MSI) is a market breadth indicator that is based on the rolling average of difference \n    /// between the number of advancing and declining issues on a stock exchange. It is generally considered as is \n    /// a long-term version of the <see cref=\"McClellanOscillator\"/>\n    /// </summary>\n    public class McClellanSummationIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The McClellan Summation Index value\n        /// </summary>\n        /// <remarks>Protected for testing</remarks>\n        protected IndicatorDataPoint Summation { get; }\n\n        /// <summary>\n        /// The McClellan Oscillator is a market breadth indicator which was developed by Sherman and Marian McClellan. It is based on the difference between the number of advancing and declining periods.\n        /// </summary>\n        public McClellanOscillator McClellanOscillator { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => McClellanOscillator.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => McClellanOscillator.WarmUpPeriod;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"McClellanSummationIndex\"/> class\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"fastPeriod\">The fast period of EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">The slow period of EMA of advance decline difference</param>\n        /// </summary>\n        public McClellanSummationIndex(string name, int fastPeriod = 19, int slowPeriod = 39) : base(name)\n        {\n            Summation = new();\n            McClellanOscillator = new McClellanOscillator(fastPeriod, slowPeriod);\n            McClellanOscillator.Updated += (_, updated) =>\n            {\n                // Update only when new indicator data point was consolidated\n                if (updated.EndTime != Summation.Time)\n                {\n                    Summation.Time = updated.EndTime;\n                    Summation.Value += updated.Value;\n                }\n            };\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"McClellanSummationIndex\"/> class\n        /// <param name=\"fastPeriod\">The fast period of EMA of advance decline difference</param>\n        /// <param name=\"slowPeriod\">The slow period of EMA of advance decline difference</param>\n        /// </summary>\n        public McClellanSummationIndex(int fastPeriod = 19, int slowPeriod = 39)\n            : this(\"McClellanSummationIndex\", fastPeriod, slowPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            McClellanOscillator.Update(input);\n\n            return Summation + McClellanOscillator.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            McClellanOscillator.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Add Tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking asset issue</param>\n        public void Add(Symbol asset)\n        {\n            McClellanOscillator.Add(asset);\n        }\n\n        /// <summary>\n        /// Remove Tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">the tracking asset issue</param>\n        public void Remove(Symbol asset)\n        {\n            McClellanOscillator.Remove(asset);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/McGinleyDynamic.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the McGinley Dynamic (MGD)\n    /// It is a type of moving average that was designed to track the market better \n    /// than existing moving average indicators.\n    /// It is a technical indicator that improves upon moving average lines by adjusting \n    /// for shifts in market speed.\n    /// </summary>\n    public class McGinleyDynamic : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// A rolling sum for computing the average for the given period\n        /// </summary>\n        private readonly IndicatorBase<IndicatorDataPoint> _rollingSum;\n\n        private readonly int _period;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _rollingSum.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Initializes a new instance of the McGinleyDynamic class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the McGinley Dynamic</param>\n        public McGinleyDynamic(string name, int period)\n            : base(name, period)\n        {\n            if (period == 0) throw new ArgumentException(\"Period can not be zero\");\n            _period = period;\n            _rollingSum = new Sum(name + \"_Sum\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the McGinleyDynamic class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the McGinley Dynamic</param>\n        public McGinleyDynamic(int period)\n            : this($\"MGD({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            _rollingSum.Update(input.EndTime, input.Value);\n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            if (Samples == _period)\n            {\n                return _rollingSum.Current.Value / _period;\n            }\n\n            if (Current.Value == 0 || input.Value == 0)\n            {\n                return Current.Value;\n            }\n\n            var ratioValue = (double)input.Value.SafeDivision(Current.Value, 0);\n            if (ratioValue == 0) return Current.Value;\n            var denominator = _period * (decimal)Math.Pow(ratioValue, 4.0);\n            return Current.Value + (input.Value - Current.Value).SafeDivision(denominator, 0);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rollingSum.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/MeanAbsoluteDeviation.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period mean absolute deviation.\n    /// </summary>\n    public class MeanAbsoluteDeviation : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the mean used to compute the deviation\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Mean { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the MeanAbsoluteDeviation class with the specified period.\n        ///\n        /// Evaluates the mean absolute deviation of samples in the lookback period.\n        /// </summary>\n        /// <param name=\"period\">The sample size of the standard deviation</param>\n        public MeanAbsoluteDeviation(int period)\n            : this($\"MAD({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the MeanAbsoluteDeviation class with the specified period.\n        ///\n        /// Evaluates the mean absolute deviation of samples in the look-back period.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The sample size of the mean absolute deviation</param>\n        public MeanAbsoluteDeviation(string name, int period)\n            : base(name, period)\n        {\n            Mean = new SimpleMovingAverage($\"{name}_Mean\", period);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            Mean.Update(input);\n            return Samples < 2 ? 0m : window.Average(v => Math.Abs(v.Value - Mean.Current.Value));\n        }\n\n        /// <summary>\n        /// Resets this indicator and its sub-indicator Mean to their initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Mean.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MesaAdaptiveMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Implements the Mesa Adaptive Moving Average (MAMA) indicator along with the following FAMA (Following Adaptive Moving Average) as a secondary indicator.\n    /// The MAMA adjusts its smoothing factor based on the market's volatility, making it more adaptive than a simple moving average.\n    /// </summary>\n    public class MesaAdaptiveMovingAverage : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The fast limit value used in the adaptive calculation.\n        /// </summary>\n        private readonly decimal _fastLimit;\n\n        /// <summary>\n        /// The slow limit value used in the adaptive calculation.\n        /// </summary>\n        private readonly decimal _slowLimit;\n\n        /// <summary>\n        /// Conversion factor for converting radians to degrees.\n        /// </summary>\n        private readonly decimal _rad2Deg = 180m / (4m * (decimal)Math.Atan(1.0));\n\n        /// <summary>\n        /// Rolling windows to store historical data for calculation purposes.\n        /// </summary>\n        private readonly RollingWindow<decimal> _priceHistory;\n        private readonly RollingWindow<decimal> _smoothHistory;\n        private readonly RollingWindow<decimal> _detrendHistory;\n        private readonly RollingWindow<decimal> _inPhaseHistory;\n        private readonly RollingWindow<decimal> _quadratureHistory;\n\n        /// <summary>\n        /// Variables holding previous calculation values for use in subsequent iterations.\n        /// </summary>\n        private decimal _prevPeriod;\n        private decimal _prevInPhase2;\n        private decimal _prevQuadrature2;\n        private decimal _prevReal;\n        private decimal _prevImaginary;\n        private decimal _prevSmoothPeriod;\n        private decimal _prevPhase;\n        private decimal _prevMama;\n\n        /// <summary>\n        /// Gets the FAMA (Following Adaptive Moving Average) indicator value.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Fama { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the MesaAdaptiveMovingAverage class.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"fastLimit\">The fast limit for the adaptive moving average (default is 0.5).</param>\n        /// <param name=\"slowLimit\">The slow limit for the adaptive moving average (default is 0.05).</param>\n        public MesaAdaptiveMovingAverage(string name, decimal fastLimit = 0.5m, decimal slowLimit = 0.05m)\n            : base(name)\n        {\n            _fastLimit = fastLimit;\n            _slowLimit = slowLimit;\n            _priceHistory = new RollingWindow<decimal>(13);\n            _smoothHistory = new RollingWindow<decimal>(6);\n            _detrendHistory = new RollingWindow<decimal>(6);\n            _inPhaseHistory = new RollingWindow<decimal>(6);\n            _quadratureHistory = new RollingWindow<decimal>(6);\n            _prevPeriod = 0m;\n            _prevInPhase2 = 0m;\n            _prevQuadrature2 = 0m;\n            _prevReal = 0m;\n            _prevImaginary = 0m;\n            _prevSmoothPeriod = 0m;\n            _prevPhase = 0m;\n            _prevMama = 0m;\n            Fama = new Identity(name + \"_Fama\");\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the MesaAdaptiveMovingAverage class with default name (\"MAMA\") \n        /// and the specified fast and slow limits for the adaptive moving average calculation.\n        /// </summary>\n        /// <param name=\"fastLimit\">The fast limit for the adaptive moving average (default is 0.5).</param>\n        /// <param name=\"slowLimit\">The slow limit for the adaptive moving average (default is 0.05).</param>\n        public MesaAdaptiveMovingAverage(decimal fastLimit = 0.5m, decimal slowLimit = 0.05m)\n            : this($\"MAMA\", fastLimit, slowLimit)\n        {\n        }\n\n\n        /// <summary>\n        /// Returns whether the indicator has enough data to be used (ready to calculate values).\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Gets the number of periods required for warming up the indicator.\n        /// 33 periods are sufficient for the MAMA to provide stable and accurate results,\n        /// </summary>\n        public int WarmUpPeriod => 33;\n\n        /// <summary>\n        /// Computes the next value for the Mesa Adaptive Moving Average (MAMA).\n        /// It calculates the MAMA by applying a series of steps including smoothing, detrending, and phase adjustments.\n        /// </summary>\n        /// <param name=\"input\">The input bar (price data).</param>\n        /// <returns>The calculated MAMA value.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var price = (input.High + input.Low) / 2;\n            _priceHistory.Add(price);\n\n            if (!_priceHistory.IsReady)\n            {\n                return decimal.Zero;\n            }\n\n            //Calculate the MAMA and FAMA\n            var (mama, fama) = ComputeMamaAndFama();\n\n            // Update previous values\n            _prevMama = mama;\n            Fama.Update(input.EndTime, fama);\n\n            if (!IsReady)\n            {\n                return decimal.Zero;\n            }\n            return mama;\n        }\n\n        private (decimal, decimal) ComputeMamaAndFama()\n        {\n            const decimal smallCoefficient = 0.0962m;\n            const decimal largeCoefficient = 0.5769m;\n\n            var adjustedPeriod = 0.075m * _prevPeriod + 0.54m;\n\n            // Compute the smoothed price value using a weighted average of the most recent prices.\n            var smooth = (4 * _priceHistory[0] + 3 * _priceHistory[1] + 2 * _priceHistory[2] + _priceHistory[3]) / 10;\n\n            // Detrend the smoothed price to remove market noise, applying coefficients and adjusted period.\n            var detrender = (smallCoefficient * smooth + largeCoefficient * _smoothHistory[1] - largeCoefficient * _smoothHistory[3] - smallCoefficient * _smoothHistory[5]) * adjustedPeriod;\n\n            // Compute the InPhase (I1) and Quadrature (Q1) components for the adaptive moving average.\n            var quadrature1 = (smallCoefficient * detrender + largeCoefficient * _detrendHistory[1] - largeCoefficient * _detrendHistory[3] - smallCoefficient * _detrendHistory[5]) * adjustedPeriod;\n            var inPhase1 = _detrendHistory[2];\n\n            // Advance the phase of I1 and Q1 by 90 degrees\n            var adjustedInPhase = (smallCoefficient * inPhase1 + largeCoefficient * _inPhaseHistory[1] - largeCoefficient * _inPhaseHistory[3] - smallCoefficient * _inPhaseHistory[5]) * adjustedPeriod;\n            var adjustedQuadrature = (smallCoefficient * quadrature1 + largeCoefficient * _quadratureHistory[1] - largeCoefficient * _quadratureHistory[3] - smallCoefficient * _quadratureHistory[5]) * adjustedPeriod;\n            var inPhase2 = inPhase1 - adjustedQuadrature;\n            var quadrature2 = quadrature1 + adjustedInPhase;\n\n            // Smooth the I2 and Q2 components before applying the discriminator\n            inPhase2 = 0.2m * inPhase2 + 0.8m * _prevInPhase2;\n            quadrature2 = 0.2m * quadrature2 + 0.8m * _prevQuadrature2;\n\n            // Get alpha\n            var alpha = ComputeAlpha(inPhase1, quadrature1, inPhase2, quadrature2);\n\n            // Calculate the MAMA and FAMA\n            var mama = alpha * _priceHistory[0] + (1m - alpha) * _prevMama;\n            var fama = 0.5m * alpha * mama + (1m - 0.5m * alpha) * Fama.Current.Value;\n\n            // Update rolling history\n            _smoothHistory.Add(smooth);\n            _detrendHistory.Add(detrender);\n            _inPhaseHistory.Add(inPhase1);\n            _quadratureHistory.Add(quadrature1);\n\n            return (mama, fama);\n        }\n\n        private decimal ComputeAlpha(decimal inPhase1, decimal quadrature1, decimal inPhase2, decimal quadrature2)\n        {\n            var real = inPhase2 * _prevInPhase2 + quadrature2 * _prevQuadrature2;\n            var imaginary = inPhase2 * _prevQuadrature2 - quadrature2 * _prevInPhase2;\n            real = 0.2m * real + 0.8m * _prevReal;\n            imaginary = 0.2m * imaginary + 0.8m * _prevImaginary;\n\n            // Calculate the period \n            var period = 0m;\n            if (imaginary != 0 && real != 0)\n            {\n                var angleInDegrees = (decimal)Math.Atan((double)(imaginary / real)) * _rad2Deg;\n                period = (angleInDegrees > 0) ? 360m / angleInDegrees : 0m;\n            }\n\n            // Limit the period to certain thresholds\n            if (period > 1.5m * _prevPeriod)\n            {\n                period = 1.5m * _prevPeriod;\n            }\n            if (period < 0.67m * _prevPeriod)\n            {\n                period = 0.67m * _prevPeriod;\n            }\n            if (period < 6)\n            {\n                period = 6;\n            }\n            if (period > 50)\n            {\n                period = 50;\n            }\n\n            // Smooth the period and calculate the phase\n            period = 0.2m * period + 0.8m * _prevPeriod;\n            var smoothPeriod = 0.33m * period + 0.67m * _prevSmoothPeriod;\n\n            // Calculate the phase\n            var phase = 0m;\n            if (inPhase1 != 0)\n            {\n                phase = (decimal)Math.Atan((double)(quadrature1 / inPhase1)) * _rad2Deg;\n            }\n\n            // Calculate the delta phase\n            var deltaPhase = _prevPhase - phase;\n            if (deltaPhase < 1m)\n            {\n                deltaPhase = 1m;\n            }\n\n            // Calculate alpha\n            var alpha = _fastLimit / deltaPhase;\n            if (alpha < _slowLimit)\n            {\n                alpha = _slowLimit;\n            }\n\n            // Update previous values\n            _prevInPhase2 = inPhase2;\n            _prevQuadrature2 = quadrature2;\n            _prevReal = real;\n            _prevImaginary = imaginary;\n            _prevPeriod = period;\n            _prevSmoothPeriod = smoothPeriod;\n            _prevPhase = phase;\n\n            return alpha;\n        }\n\n        /// <summary>\n        /// Resets the indicator's state, clearing history and resetting internal values.\n        /// </summary>\n        public override void Reset()\n        {\n            _priceHistory.Reset();\n            _smoothHistory.Reset();\n            _detrendHistory.Reset();\n            _inPhaseHistory.Reset();\n            _quadratureHistory.Reset();\n            _prevPeriod = 0m;\n            _prevInPhase2 = 0m;\n            _prevQuadrature2 = 0m;\n            _prevReal = 0m;\n            _prevImaginary = 0m;\n            _prevSmoothPeriod = 0m;\n            _prevPhase = 0m;\n            _prevMama = 0m;\n            Fama.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/MidPoint.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the MidPoint (MIDPOINT)\n    /// The MidPoint is calculated using the following formula:\n    /// MIDPOINT = (Highest Value + Lowest Value) / 2\n    /// </summary>\n    public class MidPoint : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly Maximum _maximum;\n        private readonly Minimum _minimum;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MidPoint\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the MIDPOINT</param>\n        public MidPoint(string name, int period) \n            : base(name)\n        {\n            _period = period;\n            _maximum = new Maximum(period);\n            _minimum = new Minimum(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MidPoint\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the MIDPOINT</param>\n        public MidPoint(int period)\n            : this($\"MIDPOINT({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _maximum.Update(input);\n            _minimum.Update(input);\n\n            return (_maximum.Current.Value + _minimum.Current.Value) / 2;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _maximum.Reset();\n            _minimum.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MidPrice.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the MidPrice (MIDPRICE).\n    /// The MidPrice is calculated using the following formula:\n    /// MIDPRICE = (Highest High + Lowest Low) / 2\n    /// </summary>\n    public class MidPrice : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly Maximum _maximum;\n        private readonly Minimum _minimum;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MidPrice\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the MIDPRICE</param>\n        public MidPrice(string name, int period) \n            : base(name)\n        {\n            _period = period;\n            _maximum = new Maximum(period);\n            _minimum = new Minimum(period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MidPrice\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the MIDPRICE</param>\n        public MidPrice(int period)\n            : this($\"MIDPRICE({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _maximum.Update(new IndicatorDataPoint { Value = input.High });\n            _minimum.Update(new IndicatorDataPoint { Value = input.Low });\n\n            return (_maximum.Current.Value + _minimum.Current.Value) / 2;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Minimum.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator capable of tracking the minimum value and how many periods ago it occurred\n    /// </summary>\n    public class Minimum : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The number of periods since the minimum value was encountered\n        /// </summary>\n        public int PeriodsSinceMinimum { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Creates a new Minimum indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to look back</param>\n        public Minimum(int period)\n            : base($\"MIN({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Minimum indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to look back</param>\n        public Minimum(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <inheritdoc />\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (Samples == 1 || input.Value <= Current.Value)\n            {\n                // our first sample or if we're bigger than our previous indicator value\n                // reset the periods since minimum (it's this period) and return the value\n                PeriodsSinceMinimum = 0;\n                return input.Value;\n            }\n\n            if (PeriodsSinceMinimum >= Period - 1)\n            {\n                // at this point we need to find a new minimum\n                // the window enumerates from most recent to oldest\n                // so let's scour the window for the max and it's index\n\n                // this could be done more efficiently if we were to intelligently keep track of the 'next'\n                // minimum, so when one falls off, we have the other... but then we would also need the 'next, next'\n                // minimum, so on and so forth, for now this works.\n\n                var minimum = window.Select((v, i) => new\n                {\n                    Value = v,\n                    Index = i\n                }).OrderBy(x => x.Value.Value).First();\n\n                PeriodsSinceMinimum = minimum.Index;\n                return minimum.Value.Value;\n            }\n\n            // if we made it here then we didn't see a new minimum and we haven't reached our period limit,\n            // so just increment our periods since minimum and return the same value as we had before\n            PeriodsSinceMinimum++;\n            return Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            PeriodsSinceMinimum = 0;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Momentum.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period change in a value using the following:\n    /// value_0 - value_n\n    /// </summary>\n    public class Momentum : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod => Period + 1;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > Period;\n\n        /// <summary>\n        /// Creates a new Momentum indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public Momentum(int period)\n            : base($\"MOM({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Momentum indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public Momentum(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (window.Samples <= window.Size)\n            {\n                // keep returning the delta from the first item put in there to init\n                return input.Value - window[window.Count - 1].Value;\n            }\n\n            return input.Value - window.MostRecentlyRemoved.Value;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MomentumPercent.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period percentage rate of change in a value using the following:\n    /// 100 * (value_0 - value_n) / value_n\n    ///\n    /// This indicator yields the same results of RateOfChangePercent\n    /// </summary>\n    public class MomentumPercent : RateOfChangePercent\n    {\n        /// <summary>\n        /// Creates a new MomentumPercent indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public MomentumPercent(int period)\n            : this($\"MOMP({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new MomentumPercent indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public MomentumPercent(string name, int period)\n            : base(name, period)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Momersion.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary> \n    /// Oscillator indicator that measures momentum and mean-reversion over a specified\n    /// period n.\n    /// Source: Harris, Michael. \"Momersion Indicator.\" Price Action Lab.,\n    ///             13 Aug. 2015. Web. http://www.priceactionlab.com/Blog/2015/08/momersion-indicator/.\n    /// </summary>\n    public class Momersion : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The minimum observations needed to consider the indicator ready. After that observation\n        /// number is reached, the indicator will continue gathering data until the full period.\n        /// </summary>\n        private readonly int? _minPeriod;\n\n        /// <summary>\n        /// The rolling window used to store the momentum.\n        /// </summary>\n        private readonly RollingWindow<decimal> _multipliedDiffWindow;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Momersion\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"minPeriod\">The minimum period.</param>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        /// <exception cref=\"System.ArgumentException\">The minimum period should be greater of 3.;minPeriod</exception>\n        public Momersion(string name, int? minPeriod, int fullPeriod)\n            : base(name, fullPeriod)\n        {\n            if (minPeriod < 4)\n            {\n                throw new ArgumentException(\"The minimum period should be 4.\", nameof(minPeriod));\n            }\n            _minPeriod = minPeriod;\n            _multipliedDiffWindow = new RollingWindow<decimal>(fullPeriod);\n            WarmUpPeriod = (minPeriod + 2) ?? (fullPeriod + 3);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Momersion\"/> class.\n        /// </summary>\n        /// <param name=\"minPeriod\">The minimum period.</param>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        public Momersion(int? minPeriod, int fullPeriod)\n            : this($\"Momersion({minPeriod},{fullPeriod})\", minPeriod, fullPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Momersion\"/> class.\n        /// </summary>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        public Momersion(int fullPeriod)\n            : this(null, fullPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get\n            {\n                if (_minPeriod.HasValue)\n                {\n                    return _multipliedDiffWindow.Count >= _minPeriod;\n                }\n                return _multipliedDiffWindow.Samples > _multipliedDiffWindow.Size;\n            }\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _multipliedDiffWindow.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"window\"></param>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (window.Count >= 3)\n            {\n                _multipliedDiffWindow.Add((window[0].Value - window[1].Value) * (window[1].Value - window[2].Value));\n            }\n\n            // Estimate the indicator if less than 50% of observation are zero. Avoid division by\n            // zero and estimations with few real observations in case of forward filled data.\n            if (IsReady && _multipliedDiffWindow.Count(obs => obs == 0) < 0.5 * _multipliedDiffWindow.Count)\n            {\n                var mc = _multipliedDiffWindow.Count(obs => obs > 0);\n                var mRc = _multipliedDiffWindow.Count(obs => obs < 0);\n                return 100m * mc / (mc + mRc);\n            }\n            return 50m;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/MomersionIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Legacy name for the <see cref=\"Momersion\"/> indicator, maintained for backwards compatibility.\n    /// This oscillator measures the balance between momentum and mean-reversion over a specified period.\n    /// </summary>\n    public class MomersionIndicator : Momersion\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MomersionIndicator\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"minPeriod\">The minimum period.</param>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        public MomersionIndicator(string name, int? minPeriod, int fullPeriod)\n            : base(name, minPeriod, fullPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MomersionIndicator\"/> class.\n        /// </summary>\n        /// <param name=\"minPeriod\">The minimum period.</param>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        public MomersionIndicator(int? minPeriod, int fullPeriod)\n            : this($\"Momersion({minPeriod},{fullPeriod})\", minPeriod, fullPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MomersionIndicator\"/> class.\n        /// </summary>\n        /// <param name=\"fullPeriod\">The full period.</param>\n        public MomersionIndicator(int fullPeriod)\n            : this(null, fullPeriod)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MoneyFlowIndex.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Money Flow Index (MFI) is an oscillator that uses both price and volume to\n    /// measure buying and selling pressure\n    ///\n    /// Typical Price = (High + Low + Close)/3\n    /// Money Flow = Typical Price x Volume\n    /// Positive Money Flow = Sum of the money flows of all days where the typical\n    ///     price is greater than the previous day's typical price\n    /// Negative Money Flow = Sum of the money flows of all days where the typical\n    ///     price is less than the previous day's typical price\n    /// Money Flow Ratio = (14-period Positive Money Flow)/(14-period Negative Money Flow)\n    ///\n    /// Money Flow Index = 100 x  Positive Money Flow / ( Positive Money Flow + Negative Money Flow)\n    /// </summary>\n    public class MoneyFlowIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The sum of positive money flow to compute money flow ratio\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> PositiveMoneyFlow { get; }\n\n        /// <summary>\n        /// The sum of negative money flow to compute money flow ratio\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> NegativeMoneyFlow { get; }\n\n        /// <summary>\n        /// The current and previous typical price is used to determine positive or negative money flow\n        /// </summary>\n        public decimal PreviousTypicalPrice { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => PositiveMoneyFlow.IsReady && NegativeMoneyFlow.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            PreviousTypicalPrice = 0.0m;\n            PositiveMoneyFlow.Reset();\n            NegativeMoneyFlow.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the MoneyFlowIndex class\n        /// </summary>\n        /// <param name=\"period\">The period of the negative and positive money flow</param>\n        public MoneyFlowIndex(int period)\n            : this($\"MFI({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the MoneyFlowIndex class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the negative and positive money flow</param>\n        public MoneyFlowIndex(string name, int period)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            PositiveMoneyFlow = new Sum(name + \"_PositiveMoneyFlow\", period);\n            NegativeMoneyFlow = new Sum(name + \"_NegativeMoneyFlow\", period);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var typicalPrice = (input.High + input.Low + input.Close) / 3.0m;\n            var moneyFlow = typicalPrice * input.Volume;\n\n            PositiveMoneyFlow.Update(input.EndTime, typicalPrice > PreviousTypicalPrice ? moneyFlow : 0.0m);\n            NegativeMoneyFlow.Update(input.EndTime, typicalPrice < PreviousTypicalPrice ? moneyFlow : 0.0m);\n            PreviousTypicalPrice = typicalPrice;\n\n            var totalMoneyFlow = PositiveMoneyFlow.Current.Value + NegativeMoneyFlow.Current.Value;\n            if (totalMoneyFlow == 0.0m)\n            {\n                return 100.0m;\n            }\n\n            return 100m * PositiveMoneyFlow.Current.Value / totalMoneyFlow;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MovingAverageConvergenceDivergence.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator creates two moving averages defined on a base indicator and produces the difference\n    /// between the fast and slow averages.\n    /// </summary>\n    public class MovingAverageConvergenceDivergence : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the fast average indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Fast { get; }\n\n        /// <summary>\n        /// Gets the slow average indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Slow { get; }\n\n        /// <summary>\n        /// Gets the signal of the MACD\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Signal { get; }\n\n        /// <summary>\n        /// Developed by Thomas Aspray in 1986, the MACD-Histogram measures the distance between MACD and its signal line, \n        /// is an oscillator that fluctuates above and below the zero line.\n        /// Bullish or bearish divergences in the MACD-Histogram can alert chartists to an imminent signal line crossover in MACD.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Histogram { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Signal.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new MACD with the specified parameters\n        /// </summary>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"signalPeriod\">The signal period</param>\n        /// <param name=\"type\">The type of moving averages to use</param>\n        public MovingAverageConvergenceDivergence(int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type = MovingAverageType.Exponential)\n            : this($\"MACD({fastPeriod},{slowPeriod},{signalPeriod})\", fastPeriod, slowPeriod, signalPeriod, type)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new MACD with the specified parameters\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"signalPeriod\">The signal period</param>\n        /// <param name=\"type\">The type of moving averages to use</param>\n        public MovingAverageConvergenceDivergence(string name, int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type = MovingAverageType.Exponential)\n            : base(name)\n        {\n            if (fastPeriod >= slowPeriod)\n            {\n                throw new ArgumentException(\"MovingAverageConvergenceDivergence: fastPeriod must be less than slowPeriod\", $\"{nameof(fastPeriod)}, {nameof(slowPeriod)}\");\n            }\n\n            Fast = type.AsIndicator(name + \"_Fast\", fastPeriod);\n            Slow = type.AsIndicator(name + \"_Slow\", slowPeriod);\n            Signal = type.AsIndicator(name + \"_Signal\", signalPeriod);\n            Histogram = new Identity(name + \"_Histogram\");\n            WarmUpPeriod = slowPeriod + signalPeriod - 1;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            var fastReady = Fast.Update(input);\n            var slowReady = Slow.Update(input);\n\n            var macd = Fast.Current.Value - Slow.Current.Value;\n\n            if (fastReady && slowReady)\n            {\n                if (Signal.Update(input.EndTime, macd))\n                {\n                    Histogram.Update(input.EndTime, macd - Signal.Current.Value);\n                }\n            }\n\n            return macd;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Fast.Reset();\n            Slow.Reset();\n            Signal.Reset();\n            Histogram.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/MovingAverageType.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Defines the different types of moving averages\n    /// </summary>  \n    public enum MovingAverageType\n    {\n        /// <summary>\n        /// An unweighted, arithmetic mean (0)\n        /// </summary>\n        Simple,\n        /// <summary>\n        /// The standard exponential moving average, using a smoothing factor of 2/(n+1) (1)\n        /// </summary>\n        Exponential,\n        /// <summary>\n        /// An exponential moving average, using a smoothing factor of 1/n and simple moving average as seeding (2)\n        /// </summary>\n        Wilders,\n        /// <summary>\n        /// A weighted moving average type (3)\n        /// </summary>\n        LinearWeightedMovingAverage,\n        /// <summary>\n        /// The double exponential moving average (4)\n        /// </summary>\n        DoubleExponential,\n        /// <summary>\n        /// The triple exponential moving average (5)\n        /// </summary>\n        TripleExponential,\n        /// <summary>\n        /// The triangular moving average (6)\n        /// </summary>\n        Triangular,\n        /// <summary>\n        /// The T3 moving average (7)\n        /// </summary>\n        T3,\n        /// <summary>\n        /// The Kaufman Adaptive Moving Average (8)\n        /// </summary>\n        Kama,\n        /// <summary>\n        /// The Hull Moving Average (9)\n        /// </summary>\n        Hull,\n        /// <summary>\n        /// The Arnaud Legoux Moving Average (10)\n        /// </summary>\n        Alma,\n        /// <summary>\n        /// The Zero Lag Exponential Moving Average (11)\n        /// </summary>\n        Zlema,\n        /// <summary>\n        /// The McGinley Dynamic moving average (12)\n        /// </summary>\n        MGD\n    }\n}\n"
  },
  {
    "path": "Indicators/MovingAverageTypeExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Provides extension methods for the MovingAverageType enumeration\n    /// </summary>\n    public static class MovingAverageTypeExtensions\n    {\n        /// <summary>\n        /// Creates a new indicator from the specified MovingAverageType. So if MovingAverageType.Simple\n        /// is specified, then a new SimpleMovingAverage will be returned.\n        /// </summary>\n        /// <param name=\"movingAverageType\">The type of averaging indicator to create</param>\n        /// <param name=\"period\">The smoothing period</param>\n        /// <returns>A new indicator that matches the MovingAverageType</returns>\n        public static IndicatorBase<IndicatorDataPoint> AsIndicator(this MovingAverageType movingAverageType, int period)\n        {\n            switch (movingAverageType)\n            {\n                case MovingAverageType.Simple:\n                    return new SimpleMovingAverage(period);\n\n                case MovingAverageType.Exponential:\n                    return new ExponentialMovingAverage(period);\n\n                case MovingAverageType.Wilders:\n                    return new WilderMovingAverage(period);\n\n                case MovingAverageType.LinearWeightedMovingAverage:\n                    return new LinearWeightedMovingAverage(period);\n\n                case MovingAverageType.DoubleExponential:\n                    return new DoubleExponentialMovingAverage(period);\n\n                case MovingAverageType.TripleExponential:\n                    return new TripleExponentialMovingAverage(period);\n\n                case MovingAverageType.Triangular:\n                    return new TriangularMovingAverage(period);\n\n                case MovingAverageType.T3:\n                    return new T3MovingAverage(period);\n\n                case MovingAverageType.Kama:\n                    return new KaufmanAdaptiveMovingAverage(period);\n\n                case MovingAverageType.Hull:\n                    return new HullMovingAverage(period);\n\n                case MovingAverageType.Alma:\n                    return new ArnaudLegouxMovingAverage(period);\n\n                case MovingAverageType.Zlema:\n                    return new ZeroLagExponentialMovingAverage(period);\n\n                case MovingAverageType.MGD:\n                    return new McGinleyDynamic(period);\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(movingAverageType));\n            }\n        }\n\n        /// <summary>\n        /// Creates a new indicator from the specified MovingAverageType. So if MovingAverageType.Simple\n        /// is specified, then a new SimpleMovingAverage will be returned.\n        /// </summary>\n        /// <param name=\"movingAverageType\">The type of averaging indicator to create</param>\n        /// <param name=\"name\">The name of the new indicator</param>\n        /// <param name=\"period\">The smoothing period</param>\n        /// <returns>A new indicator that matches the MovingAverageType</returns>\n        public static IndicatorBase<IndicatorDataPoint> AsIndicator(this MovingAverageType movingAverageType, string name, int period)\n        {\n            switch (movingAverageType)\n            {\n                case MovingAverageType.Simple:\n                    return new SimpleMovingAverage(name, period);\n\n                case MovingAverageType.Exponential:\n                    return new ExponentialMovingAverage(name, period);\n\n                case MovingAverageType.Wilders:\n                    return new WilderMovingAverage(name, period);\n\n                case MovingAverageType.LinearWeightedMovingAverage:\n                    return new LinearWeightedMovingAverage(name, period);\n\n                case MovingAverageType.DoubleExponential:\n                    return new DoubleExponentialMovingAverage(name, period);\n\n                case MovingAverageType.TripleExponential:\n                    return new TripleExponentialMovingAverage(name, period);\n\n                case MovingAverageType.Triangular:\n                    return new TriangularMovingAverage(name, period);\n\n                case MovingAverageType.T3:\n                    return new T3MovingAverage(name, period);\n\n                case MovingAverageType.Kama:\n                    return new KaufmanAdaptiveMovingAverage(name, period);\n\n                case MovingAverageType.Hull:\n                    return new HullMovingAverage(name, period);\n                \n                case MovingAverageType.Alma:\n                    return new ArnaudLegouxMovingAverage(name, period);\n\n                case MovingAverageType.Zlema:\n                    return new ZeroLagExponentialMovingAverage(name, period);\n\n                case MovingAverageType.MGD:\n                    return new McGinleyDynamic(name, period);\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(movingAverageType));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/MultiSymbolIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\nusing NodaTime;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Base class for indicators that work with multiple different symbols.\n    /// </summary>\n    /// <typeparam name=\"TInput\">Indicator input data type</typeparam>\n    public abstract class MultiSymbolIndicator<TInput> : IndicatorBase<TInput>, IIndicatorWarmUpPeriodProvider\n        where TInput : IBaseData\n    {\n        /// <summary>\n        /// Relevant data for each symbol the indicator works on, including all inputs\n        /// and actual data points used for calculation.\n        /// </summary>\n        protected Dictionary<Symbol, SymbolData> DataBySymbol { get; }\n\n        /// <summary>\n        /// The most recently computed value of the indicator.\n        /// </summary>\n        protected decimal IndicatorValue { get; set; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => DataBySymbol.Values.All(data => data.DataPoints.IsReady);\n\n        /// <summary>\n        /// Initializes the dual symbol indicator.\n        /// <para>\n        /// The constructor accepts a target symbol and a reference symbol. It also initializes\n        /// the time zones for both symbols and checks if they are different.\n        /// </para>\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"symbols\">The symbols the indicator works on .</param>\n        /// <param name=\"period\">The period (number of data points) over which to calculate the indicator.</param>\n        protected MultiSymbolIndicator(string name, IEnumerable<Symbol> symbols, int period)\n            : base(name)\n        {\n            DataBySymbol = symbols.ToDictionary(symbol => symbol, symbol => new SymbolData(symbol, period));\n            var isTimezoneDifferent = DataBySymbol.Values.Select(data => data.ExchangeTimeZone).Distinct().Count() > 1;\n            WarmUpPeriod = period + (isTimezoneDifferent ? 1 : 0);\n        }\n\n        /// <summary>\n        /// Checks and computes the indicator if the input data matches.\n        /// This method ensures the input data points are from matching time periods and different symbols.\n        /// </summary>\n        /// <param name=\"input\">The input data point (e.g., TradeBar for a symbol).</param>\n        /// <returns>The most recently computed value of the indicator.</returns>\n        protected override decimal ComputeNextValue(TInput input)\n        {\n            if (!DataBySymbol.TryGetValue(input.Symbol, out var symbolData))\n            {\n                throw new ArgumentException($\"Input symbol {input.Symbol} does not correspond to any \" +\n                    $\"of the symbols this indicator works on ({string.Join(\", \", DataBySymbol.Keys)})\");\n            }\n\n            if (Samples == 1)\n            {\n                SetResolution(input);\n                return decimal.Zero;\n            }\n\n            symbolData.CurrentInput = input;\n\n            // Ready to calculate when all symbols get data for the same time\n            if (DataBySymbol.Values.Select(data => data.CurrentInputEndTimeUtc).Distinct().Count() == 1)\n            {\n                // Add the actual inputs that should be used to the rolling windows\n                foreach (var data in DataBySymbol.Values)\n                {\n                    data.DataPoints.Add(data.CurrentInput);\n                }\n                IndicatorValue = ComputeIndicator();\n            }\n\n            return IndicatorValue;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state.\n        /// This will be called only when the indicator is ready, that is,\n        /// when data for all symbols at a given time is available.\n        /// </summary>\n        protected abstract decimal ComputeIndicator();\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            IndicatorValue = 0;\n            foreach (var data in DataBySymbol.Values)\n            {\n                data.Reset();\n            }\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Determines the resolution of the input data based on the time difference between its start and end times.\n        /// Resolution will <see cref=\"Resolution.Daily\"/> if the difference exceeds 1 hour; otherwise, calculates a higher equivalent resolution.\n        /// Then it sets the resolution to the symbols data so that the time alignment is performed correctly.\n        /// </summary>\n        private void SetResolution(TInput input)\n        {\n            var timeDifference = input.EndTime - input.Time;\n            var resolution = timeDifference.TotalHours > 1 ? Resolution.Daily : timeDifference.ToHigherResolutionEquivalent(false);\n            foreach (var (symbol, data) in DataBySymbol)\n            {\n                data.SetResolution(resolution);\n                if (symbol == input.Symbol)\n                {\n                    data.CurrentInput = input;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Contains the data points, the current input and other relevant indicator data for a symbol.\n        /// </summary>\n        protected class SymbolData\n        {\n            private static MarketHoursDatabase _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            private TInput _currentInput;\n            private Resolution _resolution;\n\n            /// <summary>\n            /// The exchange time zone for the security represented by this symbol.\n            /// </summary>\n            public DateTimeZone ExchangeTimeZone { get; }\n\n            /// <summary>\n            /// Data points for the symbol.\n            /// This only hold the data points that have been used to calculate the indicator,\n            /// which are those that had matching end times for every symbol.\n            /// </summary>\n            public RollingWindow<TInput> DataPoints { get; }\n\n            /// <summary>\n            /// The last input data point for the symbol.\n            /// </summary>\n            public TInput CurrentInput\n            {\n                get => _currentInput;\n                set\n                {\n                    _currentInput = value;\n                    if (_currentInput != null)\n                    {\n                        CurrentInputEndTimeUtc = AdjustDateToResolution(_currentInput.EndTime.ConvertToUtc(ExchangeTimeZone));\n                        NewInput?.Invoke(this, _currentInput);\n                    }\n                    else\n                    {\n                        CurrentInputEndTimeUtc = default;\n                    }\n                }\n            }\n\n            /// <summary>\n            /// Event that fires when a new input data point is set for the symbol.\n            /// </summary>\n            public event EventHandler<TInput> NewInput;\n\n            /// <summary>\n            /// The end time of the last input data point for the symbol in UTC.\n            /// </summary>\n            public DateTime CurrentInputEndTimeUtc { get; private set; }\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"SymbolData\"/> class.\n            /// </summary>\n            public SymbolData(Symbol symbol, int period)\n            {\n                ExchangeTimeZone = _marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.ID.SecurityType).TimeZone;\n                DataPoints = new(period);\n            }\n\n            /// <summary>\n            /// Resets this symbol data to its initial state\n            /// </summary>\n            public void Reset()\n            {\n                DataPoints.Reset();\n                CurrentInput = default;\n            }\n\n            /// <summary>\n            /// Truncates the given DateTime based on the specified resolution (Daily, Hourly, Minute, or Second).\n            /// </summary>\n            /// <param name=\"date\">The DateTime to truncate.</param>\n            /// <returns>A DateTime truncated to the specified resolution.</returns>\n            private DateTime AdjustDateToResolution(DateTime date)\n            {\n                switch (_resolution)\n                {\n                    case Resolution.Daily:\n                        return date.Date;\n                    case Resolution.Hour:\n                        return date.Date.AddHours(date.Hour);\n                    case Resolution.Minute:\n                        return date.Date.AddHours(date.Hour).AddMinutes(date.Minute);\n                    default:\n                        return date;\n                }\n            }\n\n            /// <summary>\n            /// Sets the resolution for this symbol data, to be used for time alignment.\n            /// </summary>\n            public void SetResolution(Resolution resolution)\n            {\n                _resolution = resolution;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/NewHighsNewLows.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The NewHighsNewLows is a New Highs / New Lows indicator that accepts IBaseDataBar data as its input.\n    /// \n    /// This type is more of a shim/typedef to reduce the need to refer to things as NewHighsNewLows&lt;IBaseDataBar&gt;\n    /// </summary>\n    public class NewHighsNewLows : NewHighsNewLows<IBaseDataBar>\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NewHighsNewLows\"/> class\n        /// </summary>\n        public NewHighsNewLows(string name, int period) : base(name, period)\n        {\n        }\n    }\n\n    /// <summary>\n    /// The New Highs - New Lows indicator displays the daily difference or ratio between \n    /// the number of assets reaching new highs and the number of stocks reaching new lows\n    /// in defined time period.\n    /// </summary>\n    public abstract class NewHighsNewLows<T> : IndicatorBase<T>, IIndicatorWarmUpPeriodProvider\n        where T : class, IBaseDataBar\n    {\n        private readonly TrackedAssets _trackedAssets;\n        private readonly int _period;\n\n        private DateTime? _currentPeriodTime;\n\n        /// <summary>\n        /// Difference between the number of assets reaching new highs and the number of assets\n        /// reaching new lows in defined time period.\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> Difference { get; }\n\n        /// <summary>\n        /// Ratio between the number of assets reaching new highs and the number of assets\n        /// reaching new lows in defined time period.\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> Ratio { get; }\n\n        /// <summary>\n        /// List of assets that reached new high\n        /// </summary>\n        protected ICollection<T> NewHighs { get; private set; } = [];\n\n        /// <summary>\n        /// List of assets that reached new high \n        /// </summary>\n        protected ICollection<T> NewLows { get; private set; } = [];\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NewHighsNewLows{T}\"/> class\n        /// </summary>\n        protected NewHighsNewLows(string name, int period) : base(name)\n        {\n            _period = period;\n            _trackedAssets = new TrackedAssets(period);\n\n            Difference = new FunctionalIndicator<IBaseDataBar>(\n                $\"{name}_Difference\",\n                (input) =>\n                {\n                    return NewHighs.Count - NewLows.Count;\n                },\n                _ => IsReady);\n\n            Ratio = new FunctionalIndicator<IBaseDataBar>(\n                $\"{name}_Ratio\",\n                (input) =>\n                {\n                    return NewLows.Count == 0m ? NewHighs.Count : (decimal)NewHighs.Count / NewLows.Count;\n                },\n                _ => IsReady);\n        }\n\n        /// <summary>\n        /// Add tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">tracking asset issue</param>\n        public virtual void Add(Symbol asset)\n        {\n            _trackedAssets.Add(asset);\n        }\n\n        /// <summary>\n        /// Remove tracking asset issue\n        /// </summary>\n        /// <param name=\"asset\">tracking asset issue</param>\n        public virtual void Remove(Symbol asset)\n        {\n            _trackedAssets.Remove(asset);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => HasSufficientPreviousDataForComputation();\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _trackedAssets.Reset();\n\n            _currentPeriodTime = null;\n\n            Difference.Reset();\n            Ratio.Reset();\n\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period + 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(T input)\n        {\n            NewHighs.Clear();\n            NewLows.Clear();\n\n            foreach (TrackedAsset asset in _trackedAssets)\n            {\n                if (asset.CurrentPeriodValue.High > asset.RollingPreviousHigh.Current.Value)\n                {\n                    NewHighs.Add(asset.CurrentPeriodValue);\n                }\n\n                if (asset.CurrentPeriodValue.Low < asset.RollingPreviousLow.Current.Value)\n                {\n                    NewLows.Add(asset.CurrentPeriodValue);\n                }\n            }\n\n            Difference.Update(input);\n            Ratio.Update(input);\n\n            return Difference.Current.Value;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override IndicatorResult ValidateAndComputeNextValue(T input)\n        {\n            Enqueue(input);\n\n            if (HasMissingCurrentPeriodValue() || !HasSufficientPreviousDataForComputation())\n            {\n                return new IndicatorResult(0, IndicatorStatus.ValueNotReady);\n            }\n\n            var vNext = ComputeNextValue(input);\n            return new IndicatorResult(vNext);\n        }\n\n        private void Enqueue(T input)\n        {\n            TrackedAsset trackedAsset;\n\n            // In case of unordered input\n            if (input.EndTime == _currentPeriodTime)\n            {\n                // Update the previous values in rolling window\n                if (_trackedAssets.TryGetAsset(input.Symbol, out trackedAsset))\n                {\n                    UpdatePreviousValues(trackedAsset, input);\n                }\n                return;\n            }\n\n            // In case of new period\n            if (input.Time > _currentPeriodTime)\n            {\n                foreach (TrackedAsset asset in _trackedAssets)\n                {\n                    // We got new period and therefore we need to update\n                    // the previous value in rolling window so we can use them for calculation\n                    UpdatePreviousValues(asset, asset.CurrentPeriodValue);\n                    asset.CurrentPeriodValue = default;\n                }\n                _currentPeriodTime = input.Time;\n            }\n\n            if (_trackedAssets.TryGetAsset(input.Symbol, out trackedAsset)\n                && (!_currentPeriodTime.HasValue || input.Time == _currentPeriodTime))\n            {\n                trackedAsset.CurrentPeriodValue = input;\n\n                if (!_currentPeriodTime.HasValue)\n                {\n                    _currentPeriodTime = input.Time;\n                }\n            }\n        }\n\n        private bool HasMissingCurrentPeriodValue()\n        {\n            return _trackedAssets.Any(x => x.CurrentPeriodValue == null);\n        }\n\n        private bool HasSufficientPreviousDataForComputation()\n        {\n            return _trackedAssets.All(asset =>\n                asset.RollingPreviousHigh.IsReady\n                && asset.RollingPreviousLow.IsReady);\n        }\n\n        private void UpdatePreviousValues(TrackedAsset asset, IBaseDataBar bar)\n        {\n            if (bar == null)\n            {\n                return;\n            }\n\n            asset.RollingPreviousHigh.Update(_currentPeriodTime.Value, bar.High);\n            asset.RollingPreviousLow.Update(_currentPeriodTime.Value, bar.Low);\n        }\n\n        /// <summary>\n        /// Assets tracked by NewHighsNewLows indicator\n        /// </summary>\n        private class TrackedAssets : IEnumerable<TrackedAsset>\n        {\n            private readonly int _period;\n\n            private readonly IDictionary<SecurityIdentifier, TrackedAsset> _assets = new Dictionary<SecurityIdentifier, TrackedAsset>();\n\n            public TrackedAssets(int period)\n            {\n                _period = period;\n            }\n\n            /// <summary>\n            /// Add tracking asset issue\n            /// </summary>\n            /// <param name=\"asset\">tracking asset issue</param>\n            public void Add(Symbol asset)\n            {\n                if (!_assets.ContainsKey(asset.ID))\n                {\n                    _assets.Add(asset.ID, new TrackedAsset(_period));\n                }\n            }\n\n            /// <summary>\n            /// Remove tracking asset issue\n            /// </summary>\n            /// <param name=\"asset\">tracking asset issue</param>\n            public void Remove(Symbol asset)\n            {\n                _assets.Remove(asset.ID);\n            }\n\n            /// <summary>\n            /// Resets tracked assets to its initial state\n            /// </summary>\n            public void Reset()\n            {\n                foreach (TrackedAsset asset in this)\n                {\n                    asset.Reset();\n                }\n            }\n\n            public bool TryGetAsset(Symbol asset, out TrackedAsset trackedAsset)\n            {\n                return _assets.TryGetValue(asset.ID, out trackedAsset);\n            }\n\n            public IEnumerator<TrackedAsset> GetEnumerator()\n            {\n                return _assets.Values.GetEnumerator();\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return GetEnumerator();\n            }\n        }\n\n        /// <summary>\n        /// Asset tracked by NewHighsNewLows indicator\n        /// </summary>\n        private class TrackedAsset\n        {\n            public T CurrentPeriodValue { get; set; }\n            public Maximum RollingPreviousHigh { get; init; }\n            public Minimum RollingPreviousLow { get; init; }\n\n            public TrackedAsset(int period)\n            {\n                CurrentPeriodValue = default;\n                RollingPreviousHigh = new Maximum(period);\n                RollingPreviousLow = new Minimum(period);\n            }\n            /// <summary>\n            /// Resets tracked asset to its initial state\n            /// </summary>\n            public void Reset()\n            {\n                CurrentPeriodValue = default;\n                RollingPreviousHigh.Reset();\n                RollingPreviousLow.Reset();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/NewHighsNewLowsVolume.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The New Highs - New Lows Volume Ratio is a Breadth indicator calculated as ratio of \n    /// summary volume of stocks reaching new high to summary volume of stocks reaching new\n    /// low compared to high and low values in defined time period. \n    /// </summary>\n    public class NewHighsNewLowsVolume : NewHighsNewLows<TradeBar>\n    {\n        /// <summary>\n        /// Volume ratio between the number of assets reaching new highs and the number of assets\n        /// reaching new lows in defined time period.\n        /// </summary>\n        public IndicatorBase<TradeBar> VolumeRatio { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NewHighsNewLowsVolume\"/> class\n        /// </summary>\n        public NewHighsNewLowsVolume(string name, int period)\n            : base(name, period)\n        {\n            VolumeRatio = new FunctionalIndicator<TradeBar>(\n                $\"{name}_VolumeRatio\",\n                (input) =>\n                {\n                    decimal newHighsVolume = NewHighs.Sum(x => x.Volume);\n                    decimal newLowsVolume = NewLows.Sum(x => x.Volume);\n\n                    return newLowsVolume == 0m ? newHighsVolume : newHighsVolume / newLowsVolume;\n                },\n                _ => IsReady);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var nextValue = base.ComputeNextValue(input);\n\n            VolumeRatio.Update(input);\n\n            return VolumeRatio.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets tracked assets to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            VolumeRatio.Reset();\n\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/NormalizedAverageTrueRange.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Normalized Average True Range (NATR).\n    /// The Normalized Average True Range is calculated with the following formula:\n    /// NATR = (ATR(period) / Close) * 100\n    /// </summary>\n    public class NormalizedAverageTrueRange : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly TrueRange _tr;\n        private readonly AverageTrueRange _atr;\n        private decimal _lastAtrValue;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NormalizedAverageTrueRange\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the NATR</param>\n        public NormalizedAverageTrueRange(string name, int period) : \n            base(name)\n        {\n            _period = period;\n            _tr = new TrueRange(name + \"_TR\");\n            _atr = new AverageTrueRange(name + \"_ATR\", period, MovingAverageType.Simple);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NormalizedAverageTrueRange\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the NATR</param>\n        public NormalizedAverageTrueRange(int period)\n            : this($\"NATR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period + 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _tr.Update(input);\n\n            if (!IsReady)\n            {\n                _atr.Update(input);\n                return input.Close != 0 ? _atr.Current.Value / input.Close * 100 : 0m;\n            }\n\n            if (Samples == _period + 1)\n            {\n                // first output value is SMA of TrueRange\n                _atr.Update(input);\n                _lastAtrValue = _atr.Current.Value;\n            }\n            else\n            {\n                // next TrueRange values are smoothed using Wilder's approach\n                _lastAtrValue = (_lastAtrValue * (_period - 1) + _tr.Current.Value) / _period;\n            }\n\n            return input.Close != 0 ? _lastAtrValue / input.Close * 100 : 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _tr.Reset();\n            _atr.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/OnBalanceVolume.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the On Balance Volume (OBV). \n    /// The On Balance Volume is calculated by determining the price of the current close price and previous close price.\n    /// If the current close price is equivalent to the previous price the OBV remains the same,\n    /// If the current close price is higher the volume of that day is added to the OBV, while a lower close price will\n    /// result in negative value.\n    /// </summary>\n    public class OnBalanceVolume : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private TradeBar _previousInput;\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class using the specified name.\n        /// </summary> \n        public OnBalanceVolume()\n            : base(\"OBV\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Indicator class using the specified name.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        public OnBalanceVolume(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _previousInput != null;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns> A new value for this indicator </returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var obv = Current.Value;\n\n            if (_previousInput != null)\n            {\n                if (input.Value > _previousInput.Value)\n                {\n                    obv += input.Volume;\n                    Update(input);\n                }\n                else if (input.Value < _previousInput.Value)\n                {\n                    obv -= input.Volume;\n                    Update(input);\n                }\n            }\n            else\n            {\n                obv = input.Volume;\n                Update(input);\n            }\n\n            _previousInput = input;\n            return obv;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previousInput = null;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/OptionGreekIndicatorBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// To provide a base class for option greeks indicator\n    /// </summary>\n    public abstract class OptionGreeksIndicatorBase : OptionIndicatorBase\n    {\n        private ImpliedVolatility _iv;\n        private bool _userProvidedIv;\n\n        /// <summary>\n        /// Gets the implied volatility of the option\n        /// </summary>\n        public ImpliedVolatility ImpliedVolatility\n        {\n            get\n            {\n                return _iv;\n            }\n            set\n            {\n                _iv = value;\n                _userProvidedIv = true;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OptionGreeksIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        protected OptionGreeksIndicatorBase(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel,\n            Symbol mirrorOption = null, OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, period: 1)\n        {\n            ivModel = GetOptionModel(ivModel, option.ID.OptionStyle);\n            _iv = new ImpliedVolatility(name + \"_IV\", option, riskFreeRateModel, dividendYieldModel, mirrorOption, ivModel.Value);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OptionGreeksIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        protected OptionGreeksIndicatorBase(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m,\n            Symbol mirrorOption = null, OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this(name, option, riskFreeRateModel, new ConstantDividendYieldModel(dividendYield), mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OptionGreeksIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        protected OptionGreeksIndicatorBase(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this(name, option, new ConstantRiskFreeRateInterestRateModel(riskFreeRate), new ConstantDividendYieldModel(dividendYield),\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OptionGreeksIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        protected OptionGreeksIndicatorBase(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this(name, option, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel),\n                DividendYieldModelPythonWrapper.FromPyObject(dividendYieldModel), mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the OptionGreeksIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        protected OptionGreeksIndicatorBase(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this(name, option, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel),\n                new ConstantDividendYieldModel(dividendYield), mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => ImpliedVolatility.IsReady;\n\n        /// <summary>\n        /// Computes the next value of the option greek indicator\n        /// </summary>\n        /// <returns>The input is returned unmodified.</returns>\n        protected override decimal ComputeIndicator()\n        {\n            var time = Price.Current.EndTime;\n\n            if (!_userProvidedIv)\n            {\n                ImpliedVolatility.Update(DataBySymbol[OptionSymbol].CurrentInput);\n                ImpliedVolatility.Update(DataBySymbol[_underlyingSymbol].CurrentInput);\n                if (UseMirrorContract)\n                {\n                    ImpliedVolatility.Update(DataBySymbol[_oppositeOptionSymbol].CurrentInput);\n                }\n            }\n\n            RiskFreeRate.Update(time, _riskFreeInterestRateModel.GetInterestRate(time));\n            DividendYield.Update(time, _dividendYieldModel.GetDividendYield(time, UnderlyingPrice.Current.Value));\n\n            var timeTillExpiry = Convert.ToDecimal(OptionGreekIndicatorsHelper.TimeTillExpiry(Expiry, time));\n            try\n            {\n                IndicatorValue = timeTillExpiry < 0 ? 0 : CalculateGreek(timeTillExpiry);\n            }\n            catch (OverflowException)\n            {\n                //Log.Error($\"OptionGreeksIndicatorBase.Calculate: Decimal overflow detected. The previous greek value will be used.\");\n            }\n\n            return IndicatorValue;\n        }\n\n        /// <summary>\n        /// Calculate the greek of the option\n        /// </summary>\n        protected abstract decimal CalculateGreek(decimal timeTillExpiry);\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators\n        /// </summary>\n        public override void Reset()\n        {\n            ImpliedVolatility.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/OptionGreekIndicatorsHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Runtime.CompilerServices;\nusing MathNet.Numerics.Distributions;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Helper class for option greeks related indicators\n    /// </summary>\n    public class OptionGreekIndicatorsHelper\n    {\n        /// <summary>\n        /// Number of steps in binomial tree simulation to obtain Greeks/IV\n        /// </summary>\n        public const int Steps = 200;\n\n        /// <summary>\n        /// Returns the Black theoretical price for the given arguments\n        /// </summary>\n        public static double BlackTheoreticalPrice(double volatility, double spotPrice, double strikePrice, double timeToExpiration, double riskFreeRate, double dividendYield, OptionRight optionType)\n        {\n            var d1 = CalculateD1(spotPrice, strikePrice, timeToExpiration, riskFreeRate, dividendYield, volatility);\n            var d2 = CalculateD2(d1, volatility, timeToExpiration);\n            var norm = new Normal();\n\n            var optionPrice = 0.0;\n            if (optionType == OptionRight.Call)\n            {\n                optionPrice = spotPrice * Math.Exp(-dividendYield * timeToExpiration) * norm.CumulativeDistribution(d1)\n                    - strikePrice * Math.Exp(-riskFreeRate * timeToExpiration) * norm.CumulativeDistribution(d2);\n            }\n            else if (optionType == OptionRight.Put)\n            {\n                optionPrice = strikePrice * Math.Exp(-riskFreeRate * timeToExpiration) * norm.CumulativeDistribution(-d2)\n                    - spotPrice * Math.Exp(-dividendYield * timeToExpiration) * norm.CumulativeDistribution(-d1);\n            }\n            else\n            {\n                throw new ArgumentException(\"Invalid option right.\");\n            }\n\n            return optionPrice;\n        }\n\n        internal static double CalculateD1(double spotPrice, double strikePrice, double timeToExpiration, double riskFreeRate, double dividendYield, double volatility)\n        {\n            var numerator = Math.Log(spotPrice / strikePrice) + (riskFreeRate - dividendYield + 0.5 * volatility * volatility) * timeToExpiration;\n            var denominator = volatility *  Math.Sqrt(Math.Max(0, timeToExpiration));\n            if (denominator == 0)\n            {\n                // return a random variable large enough to produce normal probability density close to 1\n                return 10;\n            }\n            return numerator / denominator;\n        }\n\n        internal static double CalculateD2(double d1, double volatility, double timeToExpiration)\n        {\n            return d1 - volatility * Math.Sqrt(Math.Max(0, timeToExpiration));\n        }\n\n        /// <summary>\n        /// Creates a Binomial Theoretical Price Tree from the given parameters\n        /// </summary>\n        /// <remarks>Reference: https://en.wikipedia.org/wiki/Binomial_options_pricing_model#Step_1:_Create_the_binomial_price_tree</remarks>\n        public static double CRRTheoreticalPrice(double volatility, double spotPrice, double strikePrice,\n            double timeToExpiration, double riskFreeRate, double dividendYield, OptionRight optionType, int steps = Steps)\n        {\n            var deltaTime = timeToExpiration / steps;\n            var upFactor = Math.Exp(volatility * Math.Sqrt(deltaTime));\n            if (upFactor == 1)\n            {\n                // Introduce a very small factor to avoid constant tree while staying low volatility\n                upFactor = 1.0001;\n            }\n            var downFactor = 1 / upFactor;\n            var probUp = (Math.Exp((riskFreeRate - dividendYield) * deltaTime) - downFactor) / (upFactor - downFactor);\n\n            return BinomialTheoreticalPrice(deltaTime, probUp, upFactor, riskFreeRate, spotPrice, strikePrice, optionType, steps);\n        }\n\n        /// <summary>\n        /// Creates the Forward Binomial Theoretical Price Tree from the given parameters\n        /// </summary>\n        public static double ForwardTreeTheoreticalPrice(double volatility, double spotPrice, double strikePrice,\n            double timeToExpiration, double riskFreeRate, double dividendYield, OptionRight optionType, int steps = Steps)\n        {\n            var deltaTime = timeToExpiration / steps;\n            var discount = Math.Exp((riskFreeRate - dividendYield) * deltaTime);\n            var volatilityTimeSqrtDeltaTime = volatility * Math.Sqrt(deltaTime);\n            var upFactor = Math.Exp(volatilityTimeSqrtDeltaTime) * discount;\n            var downFactor = Math.Exp(-volatilityTimeSqrtDeltaTime) * discount;\n            if (upFactor - downFactor == 0)\n            {\n                // Introduce a very small factor\n                // to avoid constant tree while staying low volatility\n                upFactor = 1.0001;\n                downFactor = 0.9999;\n            }\n            var probUp = (discount - downFactor) / (upFactor - downFactor);\n\n            return BinomialTheoreticalPrice(deltaTime, probUp, upFactor, riskFreeRate, spotPrice, strikePrice, optionType, steps);\n        }\n\n        private static double BinomialTheoreticalPrice(double deltaTime, double probUp, double upFactor, double riskFreeRate,\n           double spotPrice, double strikePrice, OptionRight optionType, int steps = Steps)\n        {\n            var probDown = 1 - probUp;\n            var values = new double[steps + 1];\n            // Cache for exercise values for Call options to avoid recalculating them\n            var exerciseValues = optionType == OptionRight.Call ? new double[2 * steps] : null;\n\n            for (int i = 0; i < (exerciseValues?.Length ?? values.Length); i++)\n            {\n                if (i < values.Length)\n                {\n                    var nextPrice = spotPrice * Math.Pow(upFactor, 2 * i - steps);\n                    values[i] = OptionPayoff.GetIntrinsicValue(nextPrice, strikePrice, optionType);\n                }\n\n                if (optionType == OptionRight.Call)\n                {\n                    var nextPrice = spotPrice * Math.Pow(upFactor, i - steps);\n                    exerciseValues[i] = OptionPayoff.GetIntrinsicValue(nextPrice, strikePrice, optionType);\n                }\n            }\n\n            var factor = Math.Exp(-riskFreeRate * deltaTime);\n            var factorA = factor * probDown;\n            var factorB = factor * probUp;\n\n            for (var period = steps - 1; period >= 0; period--)\n            {\n                for (var i = 0; i <= period; i++)\n                {\n                    var binomialValue = values[i] * factorA + values[i + 1] * factorB;\n                    // No advantage for American put option to exercise early in risk-neutral setting\n                    if (optionType == OptionRight.Put)\n                    {\n                        values[i] = binomialValue;\n                        continue;\n                    }\n                    values[i] = Math.Max(binomialValue, exerciseValues[2 * i - period + steps]);\n                }\n            }\n\n            return values[0];\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static double TimeTillExpiry(DateTime expiry, DateTime referenceDate)\n        {\n            return (expiry - referenceDate).TotalDays / 365d;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        internal static double Divide(double numerator, double denominator)\n        {\n            if (denominator != 0)\n            {\n                return numerator / denominator;\n            }\n\n            //Log.Error(\"OptionGreekIndicatorsHelper.Divide(): Division by zero detected. Returning 0.\");\n            return 0;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/OptionIndicatorBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// To provide a base class for option indicator\n    /// </summary>\n    public abstract class OptionIndicatorBase : MultiSymbolIndicator<IBaseData>\n    {\n        private DateTime _expiry;\n\n        /// <summary>\n        /// Option's symbol object\n        /// </summary>\n        [PandasIgnore]\n        public Symbol OptionSymbol { get; init; }\n\n        /// <summary>\n        /// Mirror option symbol (by option right), for implied volatility\n        /// </summary>\n        protected Symbol _oppositeOptionSymbol { get; private set; }\n\n        /// <summary>\n        /// Underlying security's symbol object\n        /// </summary>\n        protected Symbol _underlyingSymbol => OptionSymbol.Underlying;\n\n        /// <summary>\n        /// Option pricing model used to calculate indicator\n        /// </summary>\n        protected OptionPricingModelType _optionModel { get; set; }\n\n        /// <summary>\n        /// Risk-free rate model\n        /// </summary>\n        protected IRiskFreeInterestRateModel _riskFreeInterestRateModel { get; init; }\n\n        /// <summary>\n        /// Dividend yield model, for continuous dividend yield\n        /// </summary>\n        protected IDividendYieldModel _dividendYieldModel { get; init; }\n\n        /// <summary>\n        /// Gets the expiration time of the option\n        /// </summary>\n        [PandasIgnore]\n        public DateTime Expiry\n        {\n            get\n            {\n                if (_expiry == default)\n                {\n                    _expiry = Securities.Option.OptionSymbol.GetSettlementDateTime(OptionSymbol);\n                }\n                return _expiry;\n            }\n        }\n\n        /// <summary>\n        /// Gets the option right (call/put) of the option\n        /// </summary>\n        [PandasIgnore]\n        public OptionRight Right => OptionSymbol.ID.OptionRight;\n\n        /// <summary>\n        /// Gets the strike price of the option\n        /// </summary>\n        [PandasIgnore]\n        public decimal Strike => OptionSymbol.ID.StrikePrice;\n\n        /// <summary>\n        /// Gets the option style (European/American) of the option\n        /// </summary>\n        [PandasIgnore]\n        public OptionStyle Style => OptionSymbol.ID.OptionStyle;\n\n        /// <summary>\n        /// Risk Free Rate\n        /// </summary>\n        [PandasIgnore]\n        public Identity RiskFreeRate { get; set; }\n\n        /// <summary>\n        /// Dividend Yield\n        /// </summary>\n        [PandasIgnore]\n        public Identity DividendYield { get; set; }\n\n        /// <summary>\n        /// Gets the option price level\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Price { get; }\n\n        /// <summary>\n        /// Gets the mirror option price level, for implied volatility\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> OppositePrice { get; private set; }\n\n        /// <summary>\n        /// Gets the underlying's price level\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> UnderlyingPrice { get; }\n\n        /// <summary>\n        /// Flag if mirror option is implemented for parity type calculation\n        /// </summary>\n        [PandasIgnore]\n        public bool UseMirrorContract => _oppositeOptionSymbol != null;\n\n        /// <summary>\n        /// Initializes a new instance of the OptionIndicatorBase class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"period\">The lookback period of volatility</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate the Greek/IV</param>\n        protected OptionIndicatorBase(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel,\n            Symbol mirrorOption = null, OptionPricingModelType? optionModel = null, int period = 1)\n            : base(name, mirrorOption == null ? [option, option.Underlying] : [option, option.Underlying, mirrorOption], period)\n        {\n            var sid = option.ID;\n            if (!sid.SecurityType.IsOption())\n            {\n                throw new ArgumentException(\"OptionIndicatorBase only support SecurityType.Option.\");\n            }\n\n            OptionSymbol = option;\n            _riskFreeInterestRateModel = riskFreeRateModel;\n            _dividendYieldModel = dividendYieldModel;\n            _optionModel = optionModel ?? GetOptionModel(optionModel, sid.OptionStyle);\n\n            RiskFreeRate = new Identity(name + \"_RiskFreeRate\");\n            DividendYield = new Identity(name + \"_DividendYield\");\n            Price = new Identity(name + \"_Close\");\n            UnderlyingPrice = new Identity(name + \"_UnderlyingClose\");\n\n            DataBySymbol[OptionSymbol].NewInput += (sender, input) => Price.Update(input);\n            DataBySymbol[_underlyingSymbol].NewInput += (sender, input) => UnderlyingPrice.Update(input);\n\n            if (mirrorOption != null)\n            {\n                _oppositeOptionSymbol = mirrorOption;\n                OppositePrice = new Identity(Name + \"_OppositeClose\");\n                DataBySymbol[_oppositeOptionSymbol].NewInput += (sender, input) => OppositePrice.Update(input);\n            }\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state.\n        /// This will round the result to 7 decimal places.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseData input)\n        {\n            return Math.Round(base.ComputeNextValue(input), 7);\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators\n        /// </summary>\n        public override void Reset()\n        {\n            RiskFreeRate.Reset();\n            DividendYield.Reset();\n            Price.Reset();\n            UnderlyingPrice.Reset();\n            base.Reset();\n\n            if (UseMirrorContract)\n            {\n                OppositePrice.Reset();\n            }\n        }\n\n        /// <summary>\n        /// Gets the option pricing model based on the option style, if not specified\n        /// </summary>\n        /// <param name=\"optionModel\">The optional option pricing model, which will be returned if not null</param>\n        /// <param name=\"optionStyle\">The option style</param>\n        /// <returns>The option pricing model based on the option style, if not specified</returns>\n        public static OptionPricingModelType GetOptionModel(OptionPricingModelType? optionModel, OptionStyle optionStyle)\n        {\n            if (optionModel.HasValue)\n            {\n                return optionModel.Value;\n            }\n\n            // Default values depend on the option style\n            return optionStyle switch\n            {\n                OptionStyle.European => OptionPricingModelType.BlackScholes,\n                OptionStyle.American => OptionPricingModelType.ForwardTree,\n                _ => throw new ArgumentOutOfRangeException(nameof(optionStyle), optionStyle, null)\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ParabolicStopAndReverse.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Parabolic SAR Indicator \n    /// Based on TA-Lib implementation\n    /// </summary>\n    public class ParabolicStopAndReverse : ParabolicStopAndReverseExtended, IIndicatorWarmUpPeriodProvider\n    {\n\n        /// Create new Parabolic SAR\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"afStart\">Acceleration factor start value</param>\n        /// <param name=\"afIncrement\">Acceleration factor increment value</param>\n        /// <param name=\"afMax\">Acceleration factor max value</param>\n        public ParabolicStopAndReverse(string name, decimal afStart = 0.02m, decimal afIncrement = 0.02m, decimal afMax = 0.2m)\n            : base(name, 0.0m, 0.0m, afStart, afIncrement, afMax, afStart, afIncrement, afMax)\n        {\n        }\n\n        /// <summary>\n        /// Create new Parabolic SAR\n        /// </summary>\n        /// <param name=\"afStart\">Acceleration factor start value</param>\n        /// <param name=\"afIncrement\">Acceleration factor increment value</param>\n        /// <param name=\"afMax\">Acceleration factor max value</param>\n        public ParabolicStopAndReverse(decimal afStart = 0.02m, decimal afIncrement = 0.02m, decimal afMax = 0.2m)\n            : this($\"PSAR({afStart},{afIncrement},{afMax})\", afStart, afIncrement, afMax)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The trade bar input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            // PSAR is special case of SAR except it always positive\n            return Math.Abs(base.ComputeNextValue(input));\n\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ParabolicStopAndReverseExtended.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Parabolic SAR Extended Indicator \n    /// Based on TA-Lib implementation\n    /// </summary>\n    public class ParabolicStopAndReverseExtended : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private bool _isLong;\n        private IBaseDataBar _previousBar;\n        private decimal _sar;\n        private decimal _extremepoint;\n        private decimal _outputSar;\n        private decimal _afShort;\n        private decimal _afLong;\n        private readonly decimal _sarInit;\n        private readonly decimal _offsetOnReverse;\n        private readonly decimal _afInitShort;\n        private readonly decimal _afIncrementShort;\n        private readonly decimal _afMaxShort;\n        private readonly decimal _afInitLong;\n        private readonly decimal _afIncrementLong;\n        private readonly decimal _afMaxLong;\n\n        /// <summary>\n        /// Create a new Parabolic SAR Extended\n        /// </summary>\n        /// <param name=\"name\">The name of the Parabolic Stop and Reverse Extended indicator</param>\n        /// <param name=\"sarStart\">The starting value for the Parabolic Stop and Reverse indicator</param>\n        /// <param name=\"offsetOnReverse\">The offset value to be applied on reverse </param>\n        /// <param name=\"afStartShort\">The starting acceleration factor for short positions</param>\n        /// <param name=\"afIncrementShort\">The increment value for the acceleration factor for short positions</param>\n        /// <param name=\"afMaxShort\">The maximum value for the acceleration factor for short positions</param>\n        /// <param name=\"afStartLong\">The starting acceleration factor for long positions</param>\n        /// <param name=\"afIncrementLong\">The increment value for the acceleration factor for long positions</param>\n        /// <param name=\"afMaxLong\">The maximum value for the acceleration factor for long positions</param>\n        public ParabolicStopAndReverseExtended(string name, decimal sarStart = 0.0m, decimal offsetOnReverse = 0.0m,\n            decimal afStartShort = 0.02m, decimal afIncrementShort = 0.02m, decimal afMaxShort = 0.2m,\n            decimal afStartLong = 0.02m, decimal afIncrementLong = 0.02m, decimal afMaxLong = 0.2m) : base(name)\n        {\n            _sarInit = sarStart;\n            _offsetOnReverse = offsetOnReverse;\n            _afShort = _afInitShort = afStartShort;\n            _afIncrementShort = afIncrementShort;\n            _afMaxShort = afMaxShort;\n            _afLong = _afInitLong = afStartLong;\n            _afIncrementLong = afIncrementLong;\n            _afMaxLong = afMaxLong;\n        }\n\n        /// <summary>\n        /// Create a new Parabolic SAR Extended\n        /// </summary>\n        /// <param name=\"sarStart\">The starting value for the Parabolic Stop and Reverse indicator</param>\n        /// <param name=\"offsetOnReverse\">The offset value to be applied on reverse </param>\n        /// <param name=\"afStartShort\">The starting acceleration factor for short positions</param>\n        /// <param name=\"afIncrementShort\">The increment value for the acceleration factor for short positions</param>\n        /// <param name=\"afMaxShort\">The maximum value for the acceleration factor for short positions</param>\n        /// <param name=\"afStartLong\">The starting acceleration factor for long positions</param>\n        /// <param name=\"afIncrementLong\">The increment value for the acceleration factor for long positions</param>\n        /// <param name=\"afMaxLong\">The maximum value for the acceleration factor for long positions</param>\n        public ParabolicStopAndReverseExtended(decimal sarStart = 0.0m, decimal offsetOnReverse = 0.0m,\n            decimal afStartShort = 0.02m, decimal afIncrementShort = 0.02m, decimal afMaxShort = 0.2m,\n            decimal afStartLong = 0.02m, decimal afIncrementLong = 0.02m, decimal afMaxLong = 0.2m)\n            : this($\"SAREXT({sarStart},{offsetOnReverse},{afStartShort},{afIncrementShort},{afMaxShort},{afStartLong},{afIncrementLong},{afMaxLong})\",\n            sarStart, offsetOnReverse, afStartShort, afIncrementShort, afMaxShort, afStartLong, afIncrementLong, afMaxLong)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= 2;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _afShort = _afInitShort;\n            _afLong = _afInitLong;\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The trade bar input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            // On the first iteration, we can't compute a valid SAR value yet,\n            // so we save the current bar and return the initial SAR if provided,\n            // or fall back to a realistic price (input.Close) to maintain continuity\n            if (Samples == 1)\n            {\n                _previousBar = input;\n                // Makes sense to return _sarInit when its non-zero\n                if (_sarInit != 0)\n                    return _sarInit; \n                // Otherwise, return default\n                return input.Close;\n            }\n\n            // On second iteration we initiate the position of extreme point SAR\n            if (Samples == 2)\n            {\n                Init(input);\n                _previousBar = input;\n            }\n\n            if (_isLong)\n                HandleLongPosition(input);\n            else\n                HandleShortPosition(input);\n\n            _previousBar = input;\n            return _outputSar;\n        }\n\n        /// <summary>\n        /// Initialize the indicator values \n        /// </summary>\n        private void Init(IBaseDataBar currentBar)\n        {\n            // initialize starting sar value \n            if (_sarInit > 0)\n            {\n                _isLong = true;\n                _sar = _sarInit;\n            }\n            else if (_sarInit < 0)\n            {\n                _isLong = false;\n                _sar = Math.Abs(_sarInit);\n            }\n            // same set up as standard PSAR when _sarInit = 0 \n            else\n            {\n                _isLong = !HasNegativeDM(currentBar);\n                _sar = _isLong ? _previousBar.Low : _previousBar.High;\n            }\n\n            // initialize extreme point \n            _extremepoint = _isLong ? currentBar.High : currentBar.Low;\n        }\n\n        /// <summary>\n        /// Returns true if Directional Movement (DM) > 0 between today and yesterday's tradebar (false otherwise)\n        /// </summary>\n        private bool HasNegativeDM(IBaseDataBar currentBar)\n        {\n            if (currentBar.Low >= _previousBar.Low)\n                return false;\n            var highDiff = currentBar.High - _previousBar.High;\n            var lowDiff = _previousBar.Low - currentBar.Low;\n            return highDiff < lowDiff;\n        }\n\n        /// <summary>\n        /// Calculate indicator value when the position is long\n        /// </summary>\n        private void HandleLongPosition(IBaseDataBar currentBar)\n        {\n            // Switch to short if the low penetrates the SAR value.\n            if (currentBar.Low <= _sar)\n            {\n                // Switch and Overide the SAR with the ep\n                _isLong = false;\n                _sar = _extremepoint;\n\n                // Make sure the overide SAR is within yesterday's and today's range.\n                _sar = AdjustSARForHighs(_sar, _previousBar.High, currentBar.High);\n\n                // Output the overide SAR \n                if (_offsetOnReverse != 0.0m)\n                    _sar += _sar * _offsetOnReverse;\n                _outputSar = -_sar;\n\n                // Adjust af and ep\n                _afShort = _afInitShort;\n                _extremepoint = currentBar.Low;\n\n                // Calculate the new SAR\n                _sar = _sar + _afShort * (_extremepoint - _sar);\n\n                // Make sure the new SAR is within yesterday's and today's range.\n                _sar = AdjustSARForHighs(_sar, _previousBar.High, currentBar.High);\n            }\n            // No switch\n            else\n            {\n                // Output the SAR (was calculated in the previous iteration) \n                _outputSar = _sar;\n\n                // Adjust af and ep.\n                if (currentBar.High > _extremepoint)\n                {\n                    _extremepoint = currentBar.High;\n                    _afLong += _afIncrementLong;\n                    if (_afLong > _afMaxLong)\n                        _afLong = _afMaxLong;\n                }\n\n                // Calculate the new SAR\n                _sar = _sar + _afLong * (_extremepoint - _sar);\n\n                // Make sure the new SAR is within yesterday's and today's range.\n                _sar = AdjustSARForLows(_sar, _previousBar.Low, currentBar.Low);\n            }\n        }\n\n        /// <summary>\n        /// Calculate indicator value when the position is short\n        /// </summary>\n        private void HandleShortPosition(IBaseDataBar currentBar)\n        {\n            // Switch to long if the high penetrates the SAR value.\n            if (currentBar.High >= _sar)\n            {\n                // Switch and overide the SAR with the ep\n                _isLong = true;\n                _sar = _extremepoint;\n\n                // Make sure the overide SAR is within yesterday's and today's range. \n                _sar = AdjustSARForLows(_sar, _previousBar.Low, currentBar.Low);\n\n                // Output the overide SAR \n                if (_offsetOnReverse != 0.0m)\n                    _sar -= _sar * _offsetOnReverse;\n                _outputSar = _sar;\n\n                // Adjust af and ep\n                _afLong = _afInitLong;\n                _extremepoint = currentBar.High;\n\n                // Calculate the new SAR\n                _sar = _sar + _afLong * (_extremepoint - _sar);\n\n                // Make sure the new SAR is within yesterday's and today's range.\n                _sar = AdjustSARForLows(_sar, _previousBar.Low, currentBar.Low);\n            }\n            //No switch\n            else\n            {\n                // Output the SAR (was calculated in the previous iteration)\n                _outputSar = -_sar;\n\n                // Adjust af and ep.\n                if (currentBar.Low < _extremepoint)\n                {\n                    _extremepoint = currentBar.Low;\n                    _afShort += _afIncrementShort;\n                    if (_afShort > _afMaxShort)\n                        _afShort = _afMaxShort;\n                }\n\n                // Calculate the new SAR\n                _sar = _sar + _afShort * (_extremepoint - _sar);\n\n                // Make sure the new SAR is within yesterday's and today's range.\n                _sar = AdjustSARForHighs(_sar, _previousBar.High, currentBar.High);\n            }\n        }\n        private static decimal AdjustSARForHighs(decimal sar, decimal previousBar, decimal currentBar)\n        {\n            sar = Math.Max(sar, previousBar);\n            sar = Math.Max(sar, currentBar);\n            return sar;\n        }\n        private static decimal AdjustSARForLows(decimal sar, decimal previousBar, decimal currentBar)\n        {\n            sar = Math.Min(sar, previousBar);\n            sar = Math.Min(sar, currentBar);\n            return sar;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/PercentagePriceOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Percentage Price Oscillator (PPO)\n    /// The Percentage Price Oscillator is calculated using the following formula:\n    /// PPO[i] = 100 * (FastMA[i] - SlowMA[i]) / SlowMA[i]\n    /// </summary>\n    public class PercentagePriceOscillator : AbsolutePriceOscillator\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PercentagePriceOscillator\"/> class using the specified name and parameters.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        public PercentagePriceOscillator(string name, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name, fastPeriod, slowPeriod, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PercentagePriceOscillator\"/> class using the specified parameters.\n        /// </summary> \n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"movingAverageType\">The type of moving average to use</param>\n        public PercentagePriceOscillator(int fastPeriod, int slowPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"PPO({fastPeriod},{slowPeriod})\", fastPeriod, slowPeriod, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            var value = base.ComputeNextValue(input);\n\n            return Slow != 0 ? 100 * value / Slow.Current.Value : 0m;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/PivotPointsHighLow.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Pivot Points (High/Low), also known as Bar Count Reversals, indicator.\n    /// https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/pivot-points-high-low\n    /// </summary>\n    public class PivotPointsHighLow : IndicatorBase<IBaseDataBar>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _surroundingBarsCountForHighPoint;\n        private readonly int _surroundingBarsCountForLowPoint;\n        private readonly RollingWindow<IBaseDataBar> _windowHighs;\n        private readonly RollingWindow<IBaseDataBar> _windowLows;\n        // Stores information of that last N pivot points\n        private readonly RollingWindow<PivotPoint> _windowPivotPoints;\n        private readonly bool _strict;\n\n        /// <summary>\n        /// Event informs of new pivot point formed with new data update\n        /// </summary>\n        public event EventHandler<PivotPointsEventArgs> NewPivotPointFormed;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _windowHighs.IsReady && _windowLows.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; protected set; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PivotPointsHighLow\"/> indicator with an equal high and low length\n        /// </summary>\n        /// <param name=\"surroundingBarsCount\">The length parameter here defines the number of surrounding bars that we compare against the current bar high and lows for the max/min </param>\n        /// <param name=\"lastStoredValues\">The number of last stored indicator values</param>\n        public PivotPointsHighLow(int surroundingBarsCount, int lastStoredValues = 100)\n            : this($\"PivotPointsHighLow({surroundingBarsCount})\", surroundingBarsCount, surroundingBarsCount, lastStoredValues)\n        { }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PivotPointsHighLow\"/> indicator\n        /// </summary>\n        /// <param name=\"surroundingBarsCountForHighPoint\">The number of surrounding bars whose high values should be less than the current bar's for the bar high to be marked as high pivot point</param>\n        /// <param name=\"surroundingBarsCountForLowPoint\">The number of surrounding bars whose low values should be more than the current bar's for the bar low to be marked as low pivot point</param>\n        /// <param name=\"lastStoredValues\">The number of last stored indicator values</param>\n        /// <param name=\"strict\">When true (default), uses strict inequalities (&gt; and &lt;). When false, uses relaxed inequalities (&gt;= and &lt;=) allowing equal values to be detected as pivot points.</param>\n        public PivotPointsHighLow(int surroundingBarsCountForHighPoint, int surroundingBarsCountForLowPoint, int lastStoredValues = 100, bool strict = true)\n            : this($\"PivotPointsHighLow({surroundingBarsCountForHighPoint},{surroundingBarsCountForLowPoint})\", surroundingBarsCountForHighPoint, surroundingBarsCountForLowPoint, lastStoredValues, strict)\n        { }\n\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PivotPointsHighLow\"/> indicator\n        /// </summary>\n        /// <param name=\"name\">The name of an indicator</param>\n        /// <param name=\"surroundingBarsCountForHighPoint\">The number of surrounding bars whose high values should be less than the current bar's for the bar high to be marked as high pivot point</param>\n        /// <param name=\"surroundingBarsCountForLowPoint\">The number of surrounding bars whose low values should be more than the current bar's for the bar low to be marked as low pivot point</param>\n        /// <param name=\"lastStoredValues\">The number of last stored indicator values</param>\n        /// <param name=\"strict\">When true (default), uses strict inequalities (&gt; and &lt;). When false, uses relaxed inequalities (&gt;= and &lt;=) allowing equal values to be detected as pivot points.</param>\n        public PivotPointsHighLow(string name, int surroundingBarsCountForHighPoint, int surroundingBarsCountForLowPoint, int lastStoredValues = 100, bool strict = true)\n            : base(name)\n        {\n            _surroundingBarsCountForHighPoint = surroundingBarsCountForHighPoint;\n            _surroundingBarsCountForLowPoint = surroundingBarsCountForLowPoint;\n            _strict = strict;\n            _windowHighs = new RollingWindow<IBaseDataBar>(2 * surroundingBarsCountForHighPoint + 1);\n            _windowLows = new RollingWindow<IBaseDataBar>(2 * _surroundingBarsCountForLowPoint + 1);\n            _windowPivotPoints = new RollingWindow<PivotPoint>(lastStoredValues);\n            WarmUpPeriod = Math.Max(_windowHighs.Size, _windowLows.Size);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _windowHighs.Add(input);\n            _windowLows.Add(input);\n\n            PivotPoint highPoint = null, lowPoint = null;\n\n            if (_windowHighs.IsReady)\n            {\n                highPoint = FindNextHighPivotPoint(_windowHighs, _surroundingBarsCountForHighPoint);\n            }\n\n            if (_windowLows.IsReady)\n            {\n                lowPoint = FindNextLowPivotPoint(_windowLows, _surroundingBarsCountForLowPoint);\n            }\n\n            OnNewPivotPointFormed(highPoint);\n            OnNewPivotPointFormed(lowPoint);\n\n            return ConvertToComputedValue(highPoint, lowPoint);\n        }\n\n        /// <summary>\n        /// Looks for the next low pivot point.\n        /// </summary>\n        /// <param name=\"windowLows\">rolling window that tracks the lows</param>\n        /// <param name=\"midPointIndexOrSurroundingBarsCount\">The midpoint index or surrounding bars count for lows</param>\n        /// <returns>pivot point if found else null</returns>\n        protected virtual PivotPoint FindNextLowPivotPoint(RollingWindow<IBaseDataBar> windowLows, int midPointIndexOrSurroundingBarsCount)\n        {\n            var isLow = true;\n            var middlePoint = windowLows[midPointIndexOrSurroundingBarsCount];\n            for (var k = 0; k < windowLows.Size && isLow; k++)\n            {\n                if (k == midPointIndexOrSurroundingBarsCount)\n                {\n                    continue;\n                }\n\n                isLow = _strict\n                    ? windowLows[k].Low > middlePoint.Low\n                    : windowLows[k].Low >= middlePoint.Low;\n            }\n\n            PivotPoint low = null;\n            if (isLow)\n            {\n                low = new PivotPoint(PivotPointType.Low, middlePoint.Low, middlePoint.EndTime);\n            }\n\n            return low;\n        }\n\n        /// <summary>\n        /// Looks for the next high pivot point.\n        /// </summary>\n        /// <param name=\"windowHighs\">rolling window that tracks the highs</param>\n        /// <param name=\"midPointIndexOrSurroundingBarsCount\">The midpoint index or surrounding bars count for highs</param>\n        /// <returns>pivot point if found else null</returns>\n        protected virtual PivotPoint FindNextHighPivotPoint(RollingWindow<IBaseDataBar> windowHighs, int midPointIndexOrSurroundingBarsCount)\n        {\n            var isHigh = true;\n            var middlePoint = windowHighs[midPointIndexOrSurroundingBarsCount];\n            for (var k = 0; k < windowHighs.Size && isHigh; k++)\n            {\n                // Skip the middle point\n                if (k == midPointIndexOrSurroundingBarsCount)\n                {\n                    continue;\n                }\n\n                // Check if current high is below middle point high\n                isHigh = _strict\n                    ? windowHighs[k].High < middlePoint.High\n                    : windowHighs[k].High <= middlePoint.High;\n            }\n\n            PivotPoint high = null;\n            if (isHigh)\n            {\n                high = new PivotPoint(PivotPointType.High, middlePoint.High, middlePoint.EndTime);\n            }\n\n            return high;\n        }\n\n        /// <summary>\n        /// Method for converting high and low pivot points to a decimal value.\n        /// </summary>\n        /// <param name=\"highPoint\">new high point or null</param>\n        /// <param name=\"lowPoint\">new low point or null</param>\n        /// <returns>a decimal value representing the values of high and low pivot points</returns>\n        protected virtual decimal ConvertToComputedValue(PivotPoint highPoint, PivotPoint lowPoint)\n        {\n            if (highPoint != null)\n            {\n                if (lowPoint != null)\n                {\n                    // Can be the bar forms both high and low pivot points at the same time\n                    return (decimal)PivotPointType.Both;\n                }\n                return (decimal)PivotPointType.High;\n            }\n\n            if (lowPoint != null)\n            {\n                return (decimal)PivotPointType.Low;\n            }\n\n            return (decimal)PivotPointType.None;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _windowHighs.Reset();\n            _windowLows.Reset();\n            _windowPivotPoints.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Get current high pivot points, in the order such that first element in collection is the nearest to the present date\n        /// </summary>\n        /// <returns>An array of high pivot points.</returns>\n        /// <remarks>Returned array can be empty if no points have been registered yet/</remarks>\n        public PivotPoint[] GetHighPivotPointsArray()\n        {\n            return _windowPivotPoints.Where(p => p.PivotPointType == PivotPointType.High).ToArray();\n        }\n\n        /// <summary>\n        /// Get current low pivot points, in the order such that first element in collection is the nearest to the present date\n        /// </summary>\n        /// <returns>An array of low pivot points.</returns>\n        /// <remarks>Returned array can be empty if no points have been registered yet/</remarks>\n        public PivotPoint[] GetLowPivotPointsArray()\n        {\n            return _windowPivotPoints.Where(p => p.PivotPointType == PivotPointType.Low).ToArray();\n        }\n\n        /// <summary>\n        /// Get all pivot points, in the order such that first element in collection is the nearest to the present date\n        /// </summary>\n        /// <returns>An array of low and high pivot points. Ordered by time in descending order.</returns>\n        /// <remarks>Returned array can be empty if no points have been registered yet/</remarks>\n        public PivotPoint[] GetAllPivotPointsArray()\n        {\n            // Get all pivot points within rolling wind. collection as an array\n            return _windowPivotPoints.ToArray();\n        }\n\n        /// <summary>\n        /// Invokes NewPivotPointFormed event\n        /// </summary>\n        private void OnNewPivotPointFormed(PivotPoint pivotPoint)\n        {\n            if (pivotPoint != null)\n            {\n                _windowPivotPoints.Add(pivotPoint);\n                NewPivotPointFormed?.Invoke(this, new PivotPointsEventArgs(pivotPoint));\n            }\n        }\n    }\n\n    /// <summary>\n    /// Represents the points identified by Pivot Point High/Low Indicator.\n    /// </summary>\n    public class PivotPoint : BaseData\n    {\n        /// <summary>\n        /// Represents pivot point type : High or Low\n        /// </summary>\n        public PivotPointType PivotPointType { get; set; }\n\n        /// <summary>\n        /// Peak value\n        /// </summary>\n        public sealed override decimal Value { get; set; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PivotPoint\"/>\n        /// </summary>\n        public PivotPoint(PivotPointType type, decimal price, DateTime time)\n        {\n            PivotPointType = type;\n            Value = price;\n            Time = time;\n        }\n    }\n\n    /// <summary>\n    /// Pivot point direction\n    /// </summary>\n    public enum PivotPointType\n    {\n        /// <summary>\n        /// Low pivot point (-1)\n        /// </summary>\n        Low = -1,\n\n        /// <summary>\n        /// No pivot point (0)\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// High pivot point (1)\n        /// </summary>\n        High = 1,\n\n        /// <summary>\n        /// Both high and low pivot point (2)\n        /// </summary>\n        Both = 2\n    }\n\n    /// <summary>\n    /// Event arguments class for the <see cref=\"PivotPointsHighLow.NewPivotPointFormed\"/> event\n    /// </summary>\n    public class PivotPointsEventArgs : EventArgs\n    {\n        /// <summary>\n        /// New pivot point\n        /// </summary>\n        public PivotPoint PivotPoint { get; }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"PivotPointsEventArgs\"/>\n        /// </summary>\n        /// <param name=\"pivotPoint\"></param>\n        public PivotPointsEventArgs(PivotPoint pivotPoint)\n        {\n            PivotPoint = pivotPoint;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/PremierStochasticOscillator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Premier Stochastic Oscillator (PSO) Indicator implementation.\n    /// This indicator combines a stochastic oscillator with exponential moving averages to provide\n    /// a normalized output between -1 and 1, which can be useful for identifying trends and \n    /// potential reversal points in the market.\n    /// </summary>\n    public class PremierStochasticOscillator : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Exponential Moving Averages (EMA) used in the calculation of the Premier Stochastic Oscillator (PSO).\n        /// firstSmoothingEma performs the first smoothing of the Normalized Stochastic (0.1 * (Fast%K - 50)),\n        /// and doubleSmoothingEma applies a second smoothing on the result of _ema1, resulting in the Double-Smoothed Normalized Stochastic\n        /// </summary>\n        private readonly ExponentialMovingAverage _firstSmoothingEma;\n        private readonly ExponentialMovingAverage _doubleSmoothingEma;\n\n        /// <summary>\n        /// Stochastic oscillator used to calculate the K value.\n        /// </summary>\n        private readonly Stochastic _stochastic;\n\n        /// <summary>\n        /// The warm-up period necessary before the PSO indicator is considered ready.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Constructor for the Premier Stochastic Oscillator.\n        /// Initializes the Stochastic and EMA indicators and calculates the warm-up period.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"period\">The period given to calculate FastK.</param>\n        /// <param name=\"emaPeriod\">The period for EMA calculations.</param>\n        public PremierStochasticOscillator(string name, int period, int emaPeriod) : base(name)\n        {\n            _stochastic = new Stochastic(name, period, period, period);\n            _firstSmoothingEma = new ExponentialMovingAverage(emaPeriod);\n            _doubleSmoothingEma = _firstSmoothingEma.EMA(emaPeriod);\n            WarmUpPeriod = period + 2 * (emaPeriod - 1);\n        }\n\n        /// <summary>\n        /// Overloaded constructor to facilitate instantiation with a default name format.\n        /// </summary>\n        /// <param name=\"period\">The period given to calculate FastK.</param>\n        /// <param name=\"emaPeriod\">The period for EMA calculations.</param>\n        public PremierStochasticOscillator(int period, int emaPeriod)\n            : this($\"PSO({period},{emaPeriod})\", period, emaPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _doubleSmoothingEma.IsReady;\n\n        /// <summary>\n        /// Computes the Premier Stochastic Oscillator (PSO) based on the current input.\n        /// This calculation involves updating the stochastic oscillator and the EMAs,\n        /// followed by calculating the PSO using the formula:\n        /// PSO = (exp(EMA2) - 1) / (exp(EMA2) + 1)\n        /// </summary>\n        /// <param name=\"input\">The current input bar containing market data.</param>\n        /// <returns>The computed value of the PSO.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _stochastic.Update(input);\n            if (!_stochastic.FastStoch.IsReady)\n            {\n                return decimal.Zero;\n            }\n\n            var k = _stochastic.FastStoch.Current.Value;\n            var nsk = 0.1m * (k - 50);\n            if (!_firstSmoothingEma.Update(new IndicatorDataPoint(input.EndTime, nsk)))\n            {\n                return decimal.Zero;\n            }\n\n            if (!_doubleSmoothingEma.IsReady)\n            {\n                return decimal.Zero;\n            }\n            var expss = (decimal)Math.Exp((double)_doubleSmoothingEma.Current.Value);\n            return (expss - 1) / (expss + 1);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _stochastic.Reset();\n            _firstSmoothingEma.Reset();\n            _doubleSmoothingEma.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Indicators\")]\n[assembly: AssemblyProduct(\"QuantConnect.Indicators\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"40e8725a-6b15-482b-8f0d-ed4178bafff3\")]"
  },
  {
    "path": "Indicators/PythonIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Provides a wrapper for <see cref=\"IndicatorBase{IBaseData}\"/> implementations written in python\n    /// </summary>\n    public class PythonIndicator : IndicatorBase<IBaseData>, IIndicatorWarmUpPeriodProvider\n    {\n        private static string _isReadyName = nameof(IsReady).ToSnakeCase();\n        private PyObject _instance;\n        private bool _isReady;\n        private bool _pythonIsReadyProperty;\n        private BasePythonWrapper<IIndicator> _indicatorWrapper;\n\n        /// <summary>\n        /// Initializes a new instance of the PythonIndicator class using the specified name.\n        /// </summary>\n        /// <remarks>This overload allows inheritance for python classes with no arguments</remarks>\n        public PythonIndicator()\n            : base(\"\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the PythonIndicator class using the specified name.\n        /// </summary>\n        /// <remarks>This overload allows inheritance for python classes with multiple arguments</remarks>\n        public PythonIndicator(params PyObject[] args)\n            : base(GetIndicatorName(args[0]))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the PythonIndicator class using the specified name.\n        /// </summary>\n        /// <param name=\"indicator\">The python implementation of <see cref=\"IndicatorBase{IBaseDataBar}\"/></param>\n        public PythonIndicator(PyObject indicator)\n            : base(GetIndicatorName(indicator))\n        {\n            SetIndicator(indicator);\n        }\n\n        /// <summary>\n        /// Sets the python implementation of the indicator\n        /// </summary>\n        /// <param name=\"indicator\">The python implementation of <see cref=\"IndicatorBase{IBaseDataBar}\"/></param>\n        public void SetIndicator(PyObject indicator)\n        {\n            _instance = indicator;\n            _indicatorWrapper = new BasePythonWrapper<IIndicator>(indicator, validateInterface: false);\n            foreach (var attributeName in new[] { \"IsReady\", \"Update\", \"Value\" })\n            {\n                if (!_indicatorWrapper.HasAttr(attributeName))\n                {\n                    var name = GetIndicatorName(indicator);\n\n                    var message = $\"Indicator.{attributeName.ToSnakeCase()} must be implemented. \" +\n                                    $\"Please implement this missing method in {name}\";\n\n                    if (attributeName == \"IsReady\")\n                    {\n                        message += \" or use PythonIndicator as base:\" +\n                                    $\"{Environment.NewLine}class {name}(PythonIndicator):\";\n                    }\n\n                    throw new NotImplementedException(message);\n                }\n\n                if (attributeName == \"IsReady\")\n                {\n                    using (Py.GIL())\n                    {\n                        _pythonIsReadyProperty = indicator.GetPythonBoolPropertyWithChecks(_isReadyName) != null;\n                    }\n                }\n            }\n\n            WarmUpPeriod = GetIndicatorWarmUpPeriod();\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get\n            {\n                if (_isReady)\n                {\n                    return true;\n                }\n\n                if (_pythonIsReadyProperty)\n                {\n                    using (Py.GIL())\n                    {\n                        /// We get the property again and convert it to bool\n                        var property = _instance.GetPythonBoolPropertyWithChecks(_isReadyName);\n                        return BasePythonWrapper<IIndicator>.PythonRuntimeChecker.ConvertAndDispose<bool>(property, _isReadyName, isMethod: false);\n                    }\n                }\n\n                return _isReady;\n            }\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized\n        /// </summary>\n        public int WarmUpPeriod { get; protected set; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseData input)\n        {\n            _isReady = _indicatorWrapper.InvokeMethod<bool?>(nameof(Update), input)\n                ?? _indicatorWrapper.GetProperty<bool>(nameof(IsReady));\n            return _indicatorWrapper.GetProperty<decimal>(\"Value\");\n        }\n\n        /// <summary>\n        /// Get the indicator WarmUpPeriod parameter. If not defined, use 0\n        /// </summary>\n        /// <returns>The WarmUpPeriod of the indicator.</returns>\n        private int GetIndicatorWarmUpPeriod()\n        {\n            return _indicatorWrapper.HasAttr(nameof(WarmUpPeriod)) ? _indicatorWrapper.GetProperty<int>(nameof(WarmUpPeriod)) : 0;\n        }\n\n        /// <summary>\n        /// Get the indicator Name. If not defined, use the class name\n        /// </summary>\n        /// <param name=\"indicator\">The python implementation of <see cref=\"IndicatorBase{IBaseDataBar}\"/></param>\n        /// <returns>The indicator Name.</returns>\n        private static string GetIndicatorName(PyObject indicator)\n        {\n            using (Py.GIL())\n            {\n                PyObject name;\n                if (indicator.HasAttr(\"Name\"))\n                {\n                    name = indicator.GetAttr(\"Name\");\n                }\n                else if (indicator.HasAttr(\"name\"))\n                {\n                    name = indicator.GetAttr(\"name\");\n                }\n                else\n                {\n                    name = indicator.GetAttr(\"__class__\").GetAttr(\"__name__\");\n                }\n                return name.GetAndDispose<string>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/QuantConnect.Indicators.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Indicators</RootNamespace>\n    <AssemblyName>QuantConnect.Indicators</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Indicators.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Indicators Project - A collection of financial indicators</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <Target Name=\"PrintRID\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Indicators/RateOfChange.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period rate of change in a value using the following:\n    /// (value_0 - value_n) / value_n\n    /// </summary>\n    public class RateOfChange : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized.\n        /// </summary>\n        public override bool IsReady => Samples > Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// Our formula is Period + 1 because we need to fill the window and have one removed before\n        /// it is ready.\n        /// </summary>\n        public int WarmUpPeriod => Period + 1;\n\n        /// <summary>\n        /// Creates a new RateOfChange indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public RateOfChange(int period)\n            : base($\"ROC({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new RateOfChange indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public RateOfChange(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            // if we're not ready just grab the first input point in the window\n            var denominator = window.Samples <= window.Size ? window[window.Count - 1] : window.MostRecentlyRemoved;\n\n            if (denominator.Value == 0)\n            {\n                return 0;\n            }\n\n            return (input.Value - denominator.Value) / denominator.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/RateOfChangePercent.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period percentage rate of change in a value using the following:\n    /// 100 * (value_0 - value_n) / value_n\n    /// </summary>\n    public class RateOfChangePercent : RateOfChange\n    {\n        /// <summary>\n        /// Creates a new RateOfChangePercent indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public RateOfChangePercent(int period)\n            : this($\"ROCP({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new RateOfChangePercent indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to perform to computation</param>\n        public RateOfChangePercent(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            return 100 * base.ComputeNextValue(window, input);\n        }\n    }\n}"
  },
  {
    "path": "Indicators/RateOfChangeRatio.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Rate Of Change Ratio (ROCR). \n    /// The Rate Of Change Ratio is calculated with the following formula:\n    /// ROCR = price / prevPrice\n    /// </summary>\n    public class RateOfChangeRatio : RateOfChange\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RateOfChangeRatio\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the ROCR</param>\n        public RateOfChangeRatio(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RateOfChangeRatio\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the ROCR</param>\n        public RateOfChangeRatio(int period)\n            : this($\"ROCR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            var roc = base.ComputeNextValue(window, input);\n            return roc != 0 ? roc + 1 : 0m;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/RegressionChannel.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Regression Channel indicator extends the <see cref=\"LeastSquaresMovingAverage\"/>\n    /// with the inclusion of two (upper and lower) channel lines that are distanced from\n    /// the linear regression line by a user defined number of standard deviations.\n    /// Reference: http://www.onlinetradingconcepts.com/TechnicalAnalysis/LinRegChannel.html\n    /// </summary>\n    public class RegressionChannel : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the standard deviation\n        /// </summary>\n        private readonly IndicatorBase<IndicatorDataPoint> _standardDeviation;\n\n        /// <summary>\n        /// Gets the linear regression\n        /// </summary>\n        public LeastSquaresMovingAverage LinearRegression { get; }\n\n        /// <summary>\n        /// Gets the upper channel (linear regression + k * stdDev)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> UpperChannel { get; }\n\n        /// <summary>\n        /// Gets the lower channel (linear regression - k * stdDev)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> LowerChannel { get; }\n\n        /// <summary>\n        /// The point where the regression line crosses the y-axis (price-axis)\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Intercept => LinearRegression.Intercept;\n\n        /// <summary>\n        /// The regression line slope\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Slope => LinearRegression.Slope;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _standardDeviation.IsReady && LinearRegression.IsReady && UpperChannel.IsReady && LowerChannel.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegressionChannel\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The number of data points to hold in the window</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the linear regression and upper or lower channel lines</param>\n        public RegressionChannel(string name, int period, decimal k)\n            : base(name)\n        {\n            _standardDeviation = new StandardDeviation(period);\n            LinearRegression = new LeastSquaresMovingAverage(name + \"_LinearRegression\", period);\n            LowerChannel = LinearRegression.Minus(_standardDeviation.Times(k), name + \"_LowerChannel\");\n            UpperChannel = LinearRegression.Plus(_standardDeviation.Times(k), name + \"_UpperChannel\");\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LeastSquaresMovingAverage\"/> class.\n        /// </summary>\n        /// <param name=\"period\">The number of data points to hold in the window.</param>\n        /// <param name=\"k\">The number of standard deviations specifying the distance between the linear regression and upper or lower channel lines</param>\n        public RegressionChannel(int period, decimal k)\n            : this($\"RC({period},{k})\", period, k)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>\n        /// A new value for this indicator\n        /// </returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _standardDeviation.Update(input);\n            LinearRegression.Update(input);\n\n            return LinearRegression.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand)\n        /// </summary>\n        public override void Reset()\n        {\n            _standardDeviation.Reset();\n            LinearRegression.Reset();\n            LowerChannel.Reset();\n            UpperChannel.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/RelativeDailyVolume.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Relative Daily Volume indicator is an indicator that compares current \n    /// cumulative volume to the cumulative volume for a given \n    /// time of day, measured as a ratio.\n    /// \n    /// Current volume from open to current time of day / Average over the past x days from open to current time of day\n    /// </summary>\n    public class RelativeDailyVolume : TradeBarIndicator\n    {\n        private readonly SortedDictionary<TimeSpan, SimpleMovingAverage> _relativeData;\n        private readonly Dictionary<DateTime, decimal> _currentData;\n        private int _previousDay;\n        private int _days;\n        private int _period;\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _days >= _period;\n\n        /// <summary>\n        /// Initializes a new instance of the RelativeDailyVolume class using the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to perform the computation</param>\n        public RelativeDailyVolume(int period = 2)\n            : this($\"RDV({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new RelativeDailyVolume indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        public RelativeDailyVolume(string name, int period)\n            : base(name)\n        {\n            _relativeData = new SortedDictionary<TimeSpan, SimpleMovingAverage>();\n            _currentData = new Dictionary<DateTime, decimal>();\n            _period = period;\n            _previousDay = -1; // No calendar day can be -1, thus default is not a calendar day\n            _days = -1; // Will increment by one after first TradeBar, then will increment by one every new day\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A a value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            if (input.Time.Day != _previousDay)\n            {\n                var cumulativeVolume = 0.0m;\n                foreach (var pair in _currentData)\n                {\n                    var timeBar = pair.Key.TimeOfDay;\n                    SimpleMovingAverage daysAverage;\n                    cumulativeVolume += pair.Value;\n                    if (!_relativeData.TryGetValue(timeBar, out daysAverage))\n                    {\n                        daysAverage = _relativeData[timeBar] = new SimpleMovingAverage(_period);\n                    }\n                    daysAverage.Update(pair.Key, cumulativeVolume);\n                }\n                _currentData.Clear();\n                _previousDay = input.Time.Day;\n                _days += 1; // _days is starting from -1, to reach IsReady => _days == WarmUpPeriod; also means WarmUpPeriod+1\n            }\n\n            _currentData[input.Time] = input.Volume;\n\n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            var currentTimeBar = input.Time.TimeOfDay;\n            var denominator = 0.0m;\n\n            SimpleMovingAverage currentAverage;\n            if (_relativeData.TryGetValue(currentTimeBar, out currentAverage))\n            {\n                denominator = currentAverage.Current.Value;\n            }\n            else\n            {\n                // If there is no historical data for the current time, get most recent historical data\n                // This may come into play for crypto assets or a circuit breaker event\n                var relativeDataKeys = _relativeData.Keys.ToList();\n                for (int i = 1; i < relativeDataKeys.Count; i++)\n                {\n                    if (relativeDataKeys[i] > currentTimeBar)\n                    {\n                        denominator = _relativeData[relativeDataKeys[i - 1]].Current.Value;\n                    }\n                }\n            }\n            if (denominator == 0)\n            {\n                return 0;\n            }\n            var relativeDailyVolume = _currentData.Values.Sum() / denominator;\n            return relativeDailyVolume;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _relativeData.Clear();\n            _currentData.Clear();\n            _previousDay = -1;\n            _days = -1;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/RelativeMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the relative moving average indicator (RMA).\n    /// RMA = SMA(3 x Period) - SMA(2 x Period) + SMA(1 x Period) per formula:\n    /// https://www.hybrid-solutions.com/plugins/client-vtl-plugins/free/rma.html\n    /// </summary>\n    public class RelativeMovingAverage : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the Short Term SMA with 1 x Period of RMA\n        /// </summary>\n        public SimpleMovingAverage ShortAverage { get; }\n\n        /// <summary>\n        /// Gets the Medium Term SMA with 2 x Period of RMA\n        /// </summary>\n        public SimpleMovingAverage MediumAverage { get; }\n\n        /// <summary>\n        /// Gets the Long Term SMA with 3 x Period of RMA\n        /// </summary>\n        public SimpleMovingAverage LongAverage { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => LongAverage.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => LongAverage.WarmUpPeriod;\n\n        /// <summary>\n        /// Initializes a new instance of the RelativeMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the RMA</param>\n        public RelativeMovingAverage(string name, int period) \n            : base(name)\n        {\n            ShortAverage = new SimpleMovingAverage(name + \"_Short\", period);\n            MediumAverage = new SimpleMovingAverage(name + \"_Medium\", period * 2);\n            LongAverage = new SimpleMovingAverage(name + \"_Long\", period * 3);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the SimpleMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\"></param>\n        public RelativeMovingAverage(int period)\n            : this($\"RMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Copmutes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            ShortAverage.Update(input);\n            MediumAverage.Update(input);\n            LongAverage.Update(input);\n\n            return LongAverage.Current.Value - MediumAverage.Current.Value + ShortAverage.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            ShortAverage.Reset();\n            MediumAverage.Reset();\n            LongAverage.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/RelativeStrengthIndex.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the  Relative Strength Index (RSI) developed by K. Welles Wilder.\n    /// You can optionally specified a different moving average type to be used in the computation\n    /// </summary>\n    public class RelativeStrengthIndex : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private IndicatorDataPoint _previousInput;\n\n        /// <summary>\n        /// Gets the type of indicator used to compute AverageGain and AverageLoss\n        /// </summary>\n        public MovingAverageType MovingAverageType { get; }\n\n        /// <summary>\n        /// Gets the EMA for the down days\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> AverageLoss { get; }\n\n        /// <summary>\n        /// Gets the indicator for average gain\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> AverageGain { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the RelativeStrengthIndex class with the specified name and period\n        /// </summary>\n        /// <param name=\"period\">The period used for up and down days</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used for computing the average gain/loss values</param>\n        public RelativeStrengthIndex(int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : this($\"RSI({period})\", period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the RelativeStrengthIndex class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period used for up and down days</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used for computing the average gain/loss values</param>\n        public RelativeStrengthIndex(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : base(name)\n        {\n            MovingAverageType = movingAverageType;\n            AverageGain = movingAverageType.AsIndicator(name + \"Up\", period);\n            AverageLoss = movingAverageType.AsIndicator(name + \"Down\", period);\n            WarmUpPeriod = period + 1;\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => AverageGain.IsReady && AverageLoss.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            if (_previousInput != null && input.Value >= _previousInput.Value)\n            {\n                AverageGain.Update(input.EndTime, input.Value - _previousInput.Value);\n                AverageLoss.Update(input.EndTime, 0m);\n            }\n            else if (_previousInput != null && input.Value < _previousInput.Value)\n            {\n                AverageGain.Update(input.EndTime, 0m);\n                AverageLoss.Update(input.EndTime, _previousInput.Value - input.Value);\n            }\n\n            _previousInput = input;\n\n            // make sure the difference averages are not negative\n            // (can happen with some types of moving averages -- e.g. DEMA)\n            var averageLoss = AverageLoss < 0 ? 0 : AverageLoss.Current.Value;\n            var averageGain = AverageGain < 0 ? 0 : AverageGain.Current.Value;\n\n            // Round AverageLoss to avoid computing RSI with very small numbers that lead to overflow exception on the division operation below\n            if (Math.Round(averageLoss, 10) == 0m)\n            {\n                // all up days is 100\n                return 100m;\n            }\n\n            var rs = averageGain / averageLoss;\n\n            return 100m - 100m / (1 + rs);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previousInput = null;\n            AverageGain.Reset();\n            AverageLoss.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/RelativeVigorIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The Relative Vigor Index (RVI) compares the ratio of the closing price of a security to its trading range.\n    /// For illustration, let:\n    /// <para>a = Close−Open</para>\n    /// <para>b = Close−Open of One Bar Prior to a</para>\n    /// <para>c = Close−Open of One Bar Prior to b</para>\n    /// <para>d = Close−Open of One Bar Prior to c</para>\n    /// <para>e = High−Low of Bar a</para>\n    /// <para>f = High−Low of Bar b</para>\n    /// <para>g = High−Low of Bar c</para>\n    /// <para>h = High−Low of Bar d</para>\n    ///\n    /// Then let (a+2*(b+c)+d)/6 be NUM and (e+2*(f+g)+h)/6 be DENOM.\n    /// <para>RVI = SMA(NUM)/SMA(DENOM)</para>\n    /// for a specified period.\n    /// \n    /// https://www.investopedia.com/terms/r/relative_vigor_index.asp\n    /// </summary>\n    public class RelativeVigorIndex : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RollingWindow<IBaseDataBar> _previousInputs;\n\n        /// <summary>\n        /// Gets the band of Closes for the RVI.\n        /// </summary>\n        private IndicatorBase<IndicatorDataPoint> CloseBand { get; }\n\n        /// <summary>\n        /// Gets the band of Ranges for the RVI.\n        /// </summary>\n        private IndicatorBase<IndicatorDataPoint> RangeBand { get; }\n\n        /// <summary>\n        /// A signal line which behaves like a slowed version of the RVI.\n        /// </summary>\n        public RelativeVigorIndexSignal Signal { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => CloseBand.IsReady && RangeBand.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RelativeVigorIndex\"/> (RVI) class.\n        /// </summary>\n        /// <param name=\"period\">The period for the RelativeVigorIndex.</param>\n        /// <param name=\"type\">The type of Moving Average to use</param>\n        public RelativeVigorIndex(int period, MovingAverageType type)\n            : this($\"RVI({period},{type})\", period, type)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RelativeVigorIndex\"/> (RVI) class.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator.</param>\n        /// <param name=\"period\">The period for the RelativeVigorIndex.</param>\n        /// <param name=\"type\">The type of Moving Average to use</param>\n        public RelativeVigorIndex(string name, int period, MovingAverageType type = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period + 3;\n            CloseBand = type.AsIndicator(\"_closingBand\", period);\n            RangeBand = type.AsIndicator(\"_rangeBand\", period);\n            Signal = new RelativeVigorIndexSignal($\"{name}_S\");\n            _previousInputs = new RollingWindow<IBaseDataBar>(3);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (_previousInputs.IsReady)\n            {\n                var a = input.Close - input.Open;\n                var b = _previousInputs[0].Close - _previousInputs[0].Open;\n                var c = _previousInputs[1].Close - _previousInputs[1].Open;\n                var d = _previousInputs[2].Close - _previousInputs[2].Open;\n                var e = input.High - input.Low;\n                var f = _previousInputs[0].High - _previousInputs[0].Low;\n                var g = _previousInputs[1].High - _previousInputs[1].Low;\n                var h = _previousInputs[2].High - _previousInputs[2].Low;\n\n                CloseBand.Update(input.EndTime, (a + 2 * (b + c) + d) / 6m);\n                RangeBand.Update(input.EndTime, (e + 2 * (f + g) + h) / 6m);\n\n                if (CloseBand.IsReady && RangeBand.IsReady)\n                {\n                    _previousInputs.Add(input);\n                    var rvi = RangeBand != 0m ? CloseBand / RangeBand : 0m;\n\n                    Signal.Update(input.EndTime, rvi);\n\n                    return rvi;\n                }\n            }\n\n            _previousInputs.Add(input);\n            return 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            CloseBand.Reset();\n            RangeBand.Reset();\n            _previousInputs.Reset();\n            Signal.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/RelativeVigorIndexSignal.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The signal for the Relative Vigor Index, itself an indicator. \n    /// </summary>\n    public class RelativeVigorIndexSignal : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RollingWindow<IndicatorDataPoint> _rollingRvi;\n\n        /// <summary>\n        /// Initializes the signal term.\n        /// </summary>\n        /// <param name=\"name\"></param>\n        protected internal RelativeVigorIndexSignal(string name)\n            : base(name) // Accessibility set to prevent out-of-scope use\n        {\n            WarmUpPeriod = 3;\n            _rollingRvi = new RollingWindow<IndicatorDataPoint>(3);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _rollingRvi.IsReady;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            if (IsReady)\n            {\n                var output = (input.Value + 2 * (_rollingRvi[0] + _rollingRvi[1]) + _rollingRvi[2]) / 6;\n                _rollingRvi.Add(input);\n                return output;\n            }\n\n            _rollingRvi.Add(input);\n            return 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _rollingRvi.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ResetCompositeIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Class that extends CompositeIndicator to execute a given action once is reset\n    /// </summary>\n    public class ResetCompositeIndicator : CompositeIndicator\n    {\n        /// <summary>\n        /// Action to execute once this indicator is reset\n        /// </summary>\n        private Action _extraResetAction;\n\n        /// <summary>\n        /// Creates a new ResetCompositeIndicator capable of taking the output from the left and right indicators\n        /// and producing a new value via the composer delegate specified\n        /// </summary>\n        /// <param name=\"left\">The left indicator for the 'composer'</param>\n        /// <param name=\"right\">The right indicator for the 'composer'</param>\n        /// <param name=\"composer\">Function used to compose the left and right indicators</param>\n        /// <param name=\"extraResetAction\">Action to execute once the composite indicator is reset</param>\n        public ResetCompositeIndicator(IndicatorBase left, IndicatorBase right, IndicatorComposer composer, Action extraResetAction)\n            : this($\"RESET_COMPOSE({left.Name},{right.Name})\", left, right, composer, extraResetAction)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new CompositeIndicator capable of taking the output from the left and right indicators\n        /// and producing a new value via the composer delegate specified\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"left\">The left indicator for the 'composer'</param>\n        /// <param name=\"right\">The right indicator for the 'composer'</param>\n        /// <param name=\"composer\">Function used to compose the left and right indicators</param>\n        /// <param name=\"extraResetAction\">Action to execute once the indicator is reset</param>\n        public ResetCompositeIndicator(string name, IndicatorBase left, IndicatorBase right, IndicatorComposer composer, Action extraResetAction)\n            : base(name, left, right, composer)\n        {\n            _extraResetAction = extraResetAction;\n        }\n\n        /// <summary>\n        /// Resets this indicator and invokes the given reset action\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _extraResetAction.Invoke();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Rho.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Distributions;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Option Rho indicator that calculate the rho of an option\n    /// </summary>\n    /// <remarks>sensitivity of option price on interest rate changes</remarks>\n    public class Rho : OptionGreeksIndicatorBase\n    {\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>am>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Rho class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Rho</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Rho(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRate, dividendYield,\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Calculate the Rho of the option\n        /// </summary>\n        protected override decimal CalculateGreek(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n            var iv = (double)ImpliedVolatility.Current.Value;\n\n            double result;\n\n            switch (_optionModel)\n            {\n                case OptionPricingModelType.BinomialCoxRossRubinstein:\n                case OptionPricingModelType.ForwardTree:\n                    // finite differencing method with 0.01% risk free rate changes\n                    var deltaRho = 0.0001;\n\n                    var newPrice = 0d;\n                    var price = 0d;\n                    if (_optionModel == OptionPricingModelType.BinomialCoxRossRubinstein)\n                    {\n                        newPrice = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate + deltaRho, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n                    else if (_optionModel == OptionPricingModelType.ForwardTree)\n                    {\n                        newPrice = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate + deltaRho, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n\n                    result = (newPrice - price) / deltaRho / 100d;\n                        break;\n\n                case OptionPricingModelType.BlackScholes:\n                default:\n                    var norm = new Normal();\n                    var d1 = OptionGreekIndicatorsHelper.CalculateD1(underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, iv);\n                    var d2 = OptionGreekIndicatorsHelper.CalculateD2(d1, iv, timeTillExpiryDouble);\n                    var discount = Math.Exp(-riskFreeRate * timeTillExpiryDouble);\n\n                    if (Right == OptionRight.Call)\n                    {\n                        result = strike * timeTillExpiryDouble * discount * norm.CumulativeDistribution(d2) / 100d;\n                    }\n                    else\n                    {\n                        result = -strike * timeTillExpiryDouble * discount * norm.CumulativeDistribution(-d2) / 100d;\n                    }\n                    break;\n            }\n\n            return Convert.ToDecimal(result);\n        }\n    }\n}\n\n"
  },
  {
    "path": "Indicators/RogersSatchellVolatility.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Rogers-Satchell Volatility\n    /// It is an estimator for measuring the volatility of securities \n    /// with an average return not equal to zero.\n    /// </summary>\n    public class RogersSatchellVolatility : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly IndicatorBase<IndicatorDataPoint> _rollingSum;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RogersSatchellVolatility\"/> class using the specified parameters\n        /// </summary> \n        /// <param name=\"period\">The period of moving window</param>\n        public RogersSatchellVolatility(int period)\n            : this($\"RSV({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RogersSatchellVolatility\"/> class using the specified parameters\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of moving window</param>\n        public RogersSatchellVolatility(string name, int period)\n            : base(name)\n        {\n            _period = period;\n            _rollingSum = new Sum(name + \"_Sum\", period);\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if ((input.Open == 0) || (input.High == 0) || (input.Low == 0) || (input.Close == 0))\n            {\n                // return a sentinel value\n                return 0m;\n            }\n\n            _rollingSum.Update(input.EndTime, (decimal)\n                (Math.Log((double)input.High / (double)input.Close) * Math.Log((double)input.High / (double)input.Open)\n                + Math.Log((double)input.Low / (double)input.Close) * Math.Log((double)input.Low / (double)input.Open))\n            );\n\n            if (IsReady)\n            {\n                return (decimal)Math.Sqrt(((double)_rollingSum.Current.Value) / _period);\n            }\n            else\n            {\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rollingSum.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SchaffTrendCycle.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator creates the Schaff Trend Cycle\n    /// </summary>\n    public class SchaffTrendCycle : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        // MACD Variables\n        private readonly MovingAverageConvergenceDivergence _MACD;\n        private readonly IndicatorBase<IndicatorDataPoint> _maximum;\n        private readonly IndicatorBase<IndicatorDataPoint> _minimum;\n\n        // _K = %K FROM MACD; _D = %D FROM _K\n        private readonly IndicatorBase<IndicatorDataPoint> _K;\n        private readonly IndicatorBase<IndicatorDataPoint> _D;\n        private readonly IndicatorBase<IndicatorDataPoint> _maximumD;\n        private readonly IndicatorBase<IndicatorDataPoint> _minimumD;\n\n        // PF = %K FROM %MACD_D; PFF = %D FROM PF\n        private readonly IndicatorBase<IndicatorDataPoint> _PF;\n        private readonly IndicatorBase<IndicatorDataPoint> _PFF;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _MACD.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates the name string and calls on the indicator constructor with given parameters \n        /// https://www.tradingpedia.com/forex-trading-indicators/schaff-trend-cycle\n        /// </summary>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"cyclePeriod\">The signal period</param>\n        /// <param name=\"type\">The type of moving averages to use</param>\n        public SchaffTrendCycle(int cyclePeriod = 10, int fastPeriod = 23, int slowPeriod = 50, MovingAverageType type = MovingAverageType.Exponential)\n            : this($\"SchaffTrendCycle({cyclePeriod},{fastPeriod},{slowPeriod})\", cyclePeriod, fastPeriod, slowPeriod, type)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new schaff trend cycle with the specified parameters\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"fastPeriod\">The fast moving average period</param>\n        /// <param name=\"slowPeriod\">The slow moving average period</param>\n        /// <param name=\"cyclePeriod\">The signal period</param>\n        /// <param name=\"type\">The type of moving averages to use</param>\n        public SchaffTrendCycle(string name, int cyclePeriod, int fastPeriod, int slowPeriod, MovingAverageType type)\n            : base(name)\n        {\n            //Create MACD indicator and track max and min.\n            _MACD = new MovingAverageConvergenceDivergence(fastPeriod, slowPeriod, cyclePeriod, type);\n            _maximum = _MACD.MAX(cyclePeriod, false);\n            _minimum = _MACD.MIN(cyclePeriod, false);\n\n            //Stochastics of MACD variables\n            _K = new Identity(name + \"_K\");\n            _D = type.AsIndicator(3).Of(_K, false);\n            _maximumD = _D.MAX(cyclePeriod, false);\n            _minimumD = _D.MIN(cyclePeriod, false);\n\n            //Stochastics of MACD Stochastics variables; _PFF is STC\n            _PF = new Identity(name + \"_PF\");\n            _PFF = type.AsIndicator(3).Of(_PF, false);\n\n            WarmUpPeriod = _MACD.WarmUpPeriod;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            // Update internal indicator, automatically updates _maximum and _minimum\n            _MACD.Update(input);\n\n            // Update our Stochastics K, automatically updates our Stochastics D variable which is a smoothed version of K\n            var MACD_K = new IndicatorDataPoint(input.EndTime, ComputeStoch(_MACD.Current.Value, _maximum.Current.Value, _minimum.Current.Value));\n            _K.Update(MACD_K);\n\n            // With our Stochastic D values calculate PF \n            var PF = new IndicatorDataPoint(input.EndTime, ComputeStoch(_D.Current.Value, _maximumD.Current.Value, _minimumD.Current.Value));\n            _PF.Update(PF);\n\n            return _PFF.Current.Value;\n        }\n\n        /// <summary>\n        /// Computes the stochastics value for a series.\n        /// </summary>\n        /// <param name=\"value\">The current value of the set</param>\n        /// <param name=\"highest\">The max value of the set within a given period</param>\n        /// <param name=\"lowest\">The min value of the set within a given period</param>\n        /// <returns>Stochastics value </returns>\n        private decimal ComputeStoch(decimal value, decimal highest, decimal lowest)\n        {\n            var numerator = value - lowest;\n            var denominator = highest - lowest;\n\n            return denominator > 0 ? (numerator / denominator) * 100 : decimal.Zero;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _MACD.Reset();\n            _maximum.Reset();\n            _minimum.Reset();\n            _K.Reset();\n            _D.Reset();\n            _maximumD.Reset();\n            _minimumD.Reset();\n            _PF.Reset();\n            _PFF.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SharpeRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Calculation of the Sharpe Ratio (SR) developed by William F. Sharpe.\n    ///\n    /// Reference: https://www.investopedia.com/articles/07/sharpe_ratio.asp\n    /// Formula: S(x) = (Rx - Rf) / stdDev(Rx)\n    /// Where:\n    /// S(x) - sharpe ratio of x\n    /// Rx - average rate of return for x\n    /// Rf - risk-free rate\n    /// </summary>\n    public class SharpeRatio : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Length of lookback period for the Sharpe ratio calculation\n        /// </summary>\n        private readonly int _period;\n\n        /// <summary>\n        /// Risk-free rate model\n        /// </summary>\n        private readonly IRiskFreeInterestRateModel _riskFreeInterestRateModel;\n\n        /// <summary>\n        /// RateOfChange indicator for calculating the sharpe ratio\n        /// </summary>\n        protected RateOfChange RateOfChange { get; }\n\n        /// <summary>\n        /// RiskFreeRate indicator for calculating the sharpe ratio\n        /// </summary>\n        protected Identity RiskFreeRate { get; }\n\n        /// <summary>\n        /// Indicator to store the calculation of the sharpe ratio\n        /// </summary>\n        protected IndicatorBase Ratio { get; set; }\n\n        /// <summary>\n        /// Indicator to store the numerator of the Sharpe ratio calculation\n        /// </summary>\n        protected IndicatorBase Numerator { get; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Returns whether the indicator is properly initialized with data\n        /// </summary>\n        public override bool IsReady => Ratio.Samples > _period;\n\n        /// <summary>\n        /// Creates a new Sharpe Ratio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        public SharpeRatio(string name, int period, IRiskFreeInterestRateModel riskFreeRateModel)\n            : base(name)\n        {\n            _period = period;\n            _riskFreeInterestRateModel = riskFreeRateModel;\n\n            // calculate sharpe ratio using indicators\n            RateOfChange = new RateOfChange(1);\n            RiskFreeRate = new Identity(name + \"_RiskFreeRate\");\n            Numerator = RateOfChange.SMA(period).Minus(RiskFreeRate);\n            var denominator = new StandardDeviation(period).Of(RateOfChange);\n            Ratio = Numerator.Over(denominator);\n\n            // define warmup value;\n            // _roc is the base of our indicator chain + period of STD and SMA\n            WarmUpPeriod = RateOfChange.WarmUpPeriod + period;\n        }\n\n        /// <summary>\n        /// Creates a new Sharpe Ratio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        public SharpeRatio(int period, IRiskFreeInterestRateModel riskFreeRateModel)\n            : this($\"SR({period})\", period, riskFreeRateModel)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model\n        /// </summary>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        public SharpeRatio(string name, int period, PyObject riskFreeRateModel)\n            : this(name, period, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model\n        /// </summary>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        public SharpeRatio(int period, PyObject riskFreeRateModel)\n            : this(period, RiskFreeInterestRateModelPythonWrapper.FromPyObject(riskFreeRateModel))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Sharpe Ratio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate for sharpe ratio calculation</param>\n        public SharpeRatio(string name, int period, decimal riskFreeRate = 0.0m)\n            : this(name, period, new ConstantRiskFreeRateInterestRateModel(riskFreeRate))\n        {\n        }\n\n        /// <summary>\n        /// Creates a new SharpeRatio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"period\">Period of historical observation for sharpe ratio calculation</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate for sharpe ratio calculation</param>\n        public SharpeRatio(int period, decimal riskFreeRate = 0.0m)\n            : this($\"SR({period},{riskFreeRate})\", period, riskFreeRate)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            RiskFreeRate.Update(input.EndTime, _riskFreeInterestRateModel.GetInterestRate(input.EndTime));\n            RateOfChange.Update(input);\n            return Ratio;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Ratio.Reset();\n            RateOfChange.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SimpleMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the traditional simple moving average indicator (SMA)\n    /// </summary>\n    public class SimpleMovingAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// A rolling sum for computing the average for the given period\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> RollingSum { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => RollingSum.IsReady;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            RollingSum.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the SimpleMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        public SimpleMovingAverage(string name, int period)\n            : base(name, period)\n        {\n            RollingSum = new Sum(name + \"_Sum\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the SimpleMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the SMA</param>\n        public SimpleMovingAverage(int period)\n            : this($\"SMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            RollingSum.Update(input.EndTime, input.Value);\n            return RollingSum.Current.Value / window.Count;\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n    }\n}"
  },
  {
    "path": "Indicators/SmoothedOnBalanceVolume.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The SmoothedOnBalanceVolume indicator is smoothed version of OnBalanceVolume\n    /// This indicator computes the OnBalanceVolume and then\n    /// smoothes it over a given period.\n    public class SmoothedOnBalanceVolume : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>This indicator is used to smooth the OnBalanceVolume computation</summary>\n        /// <remarks>This is not exposed publicly since it is the same value as this indicator, meaning\n        /// that this '_smoother' computers the OnBalanceVolume directly, so exposing it publicly would be duplication</remarks>\n        private readonly IndicatorBase<IndicatorDataPoint> _smoother;\n\n        /// <summary>\n        /// Gets the OnBalanceVolume which is the more volatile calculation to be smoothed by this indicator\n        /// </summary>\n        public OnBalanceVolume OnBalanceVolume { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _smoother.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new SmoothedOnBalanceVolume indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The smoothing period used to smooth the OnBalanceVolume values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the OnBalanceVolume values</param>\n        public SmoothedOnBalanceVolume(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n\n            OnBalanceVolume = new OnBalanceVolume();\n            _smoother = movingAverageType.AsIndicator($\"{name}_{movingAverageType}\", period);\n\n        }\n\n        /// <summary>\n        /// Creates a new SmoothedOnBalanceVolume indicator using the specified period and moving average type\n        /// </summary>\n        /// <param name=\"period\">The smoothing period used to smooth the OnBalanceVolume values</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the OnBalanceVolume values</param>\n        public SmoothedOnBalanceVolume(int period, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"SOBV({period})\", period, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            // compute the OnBalanceVolume\n            OnBalanceVolume.Update(input);\n            \n            if (_smoother.Update(input.EndTime, OnBalanceVolume.Current.Value))  // Send true range to our smoother and test if it's ready\n            {\n                return _smoother.Current.Value;\n            }\n            else\n            {\n                return 0m;\n            }\n            \n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _smoother.Reset();\n            OnBalanceVolume.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SortinoRatio.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Calculation of the Sortino Ratio, a modification of the <see cref=\"SharpeRatio\"/>.\n    ///\n    /// Reference: https://www.cmegroup.com/education/files/rr-sortino-a-sharper-ratio.pdf\n    /// Formula: S(x) = (R - T) / TDD\n    /// Where:\n    /// S(x) - Sortino ratio of x\n    /// R - the average period return\n    /// T - the target or required rate of return for the investment strategy under consideration. In\n    /// Sortino’s early work, T was originally known as the minimum acceptable return, or MAR. In his\n    /// more recent work, MAR is now referred to as the Desired Target Return.\n    /// TDD - the target downside deviation. <see cref=\"TargetDownsideDeviation\"/>\n    /// </summary>\n    public class SortinoRatio : SharpeRatio\n    {\n        /// <summary>\n        /// Downside deviation used as Sortino denominator.\n        /// </summary>\n        private TargetDownsideDeviation _denominator;\n\n        /// <summary>\n        /// Creates a new Sortino Ratio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">Period of historical observation for Sortino ratio calculation</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return for Sortino ratio calculation</param>\n        public SortinoRatio(string name, int period, double minimumAcceptableReturn = 0)\n             : base(name, period, minimumAcceptableReturn.SafeDecimalCast())\n        {\n            _denominator = new TargetDownsideDeviation(period, minimumAcceptableReturn);\n            Ratio = Numerator.Over(_denominator);\n        }\n\n        /// <summary>\n        /// Creates a new SortinoRatio indicator using the specified periods\n        /// </summary>\n        /// <param name=\"period\">Period of historical observation for Sortino ratio calculation</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return for Sortino ratio calculation</param>\n        public SortinoRatio(int period, double minimumAcceptableReturn = 0)\n            : this($\"SORTINO({period},{minimumAcceptableReturn})\", period, minimumAcceptableReturn)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _denominator.Update(input);\n            return base.ComputeNextValue(input);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _denominator.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SqueezeMomentum.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The SqueezeMomentum indicator calculates whether the market is in a \"squeeze\" condition,\n    /// determined by comparing Bollinger Bands to Keltner Channels. When the Bollinger Bands are\n    /// inside the Keltner Channels, the indicator returns 1 (squeeze on). Otherwise, it returns -1 (squeeze off).\n    /// </summary>\n    public class SqueezeMomentum : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The Bollinger Bands indicator used to calculate the upper, lower, and middle bands.\n        /// </summary>\n        public BollingerBands BollingerBands { get; }\n\n        /// <summary>\n        /// The Keltner Channels indicator used to calculate the upper, lower, and middle channels.\n        /// </summary>\n        public KeltnerChannels KeltnerChannels { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SqueezeMomentum\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"bollingerPeriod\">The period used for the Bollinger Bands calculation.</param>\n        /// <param name=\"bollingerMultiplier\">The multiplier for the Bollinger Bands width.</param>\n        /// <param name=\"keltnerPeriod\">The period used for the Average True Range (ATR) calculation in Keltner Channels.</param>\n        /// <param name=\"keltnerMultiplier\">The multiplier applied to the ATR for calculating Keltner Channels.</param>\n        public SqueezeMomentum(string name, int bollingerPeriod, decimal bollingerMultiplier, int keltnerPeriod, decimal keltnerMultiplier) : base(name)\n        {\n            BollingerBands = new BollingerBands(bollingerPeriod, bollingerMultiplier);\n            KeltnerChannels = new KeltnerChannels(keltnerPeriod, keltnerMultiplier, MovingAverageType.Exponential);\n            WarmUpPeriod = Math.Max(bollingerPeriod, keltnerPeriod);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SqueezeMomentum\"/> class.\n        /// </summary>\n        /// <param name=\"bollingerPeriod\">The period used for the Bollinger Bands calculation.</param>\n        /// <param name=\"bollingerMultiplier\">The multiplier for the Bollinger Bands width.</param>\n        /// <param name=\"keltnerPeriod\">The period used for the Average True Range (ATR) calculation in Keltner Channels.</param>\n        /// <param name=\"keltnerMultiplier\">The multiplier applied to the ATR for calculating Keltner Channels.</param>\n        public SqueezeMomentum(int bollingerPeriod, decimal bollingerMultiplier, int keltnerPeriod, decimal keltnerMultiplier)\n            : this($\"SM({bollingerPeriod},{bollingerMultiplier},{keltnerPeriod},{keltnerMultiplier})\", bollingerPeriod, bollingerMultiplier, keltnerPeriod, keltnerMultiplier)\n        {\n        }\n\n        /// <summary>\n        /// Gets the warm-up period required for the indicator to be ready.\n        /// This is determined by the warm-up period of the Bollinger Bands indicator.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Indicates whether the indicator is ready and has enough data for computation.\n        /// The indicator is ready when both the Bollinger Bands and the Average True Range are ready.\n        /// </summary>\n        public override bool IsReady => BollingerBands.IsReady && KeltnerChannels.IsReady;\n\n        /// <summary>\n        /// Computes the next value of the indicator based on the input data bar.\n        /// </summary>\n        /// <param name=\"input\">The input data bar.</param>\n        /// <returns>\n        /// Returns 1 if the Bollinger Bands are inside the Keltner Channels (squeeze on),\n        /// or -1 if the Bollinger Bands are outside the Keltner Channels (squeeze off).\n        /// </returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            BollingerBands.Update(input);\n            KeltnerChannels.Update(input);\n            if (!IsReady)\n            {\n                return decimal.Zero;\n            }\n\n            // Calculate Bollinger Bands upper, lower\n            var bbUpper = BollingerBands.UpperBand.Current.Value;\n            var bbLower = BollingerBands.LowerBand.Current.Value;\n\n            // Calculate Keltner Channels upper and lower bounds\n            var kcUpper = KeltnerChannels.UpperBand.Current.Value;\n            var kcLower = KeltnerChannels.LowerBand.Current.Value;\n\n            // Determine if the squeeze condition is on or off\n            return (kcUpper > bbUpper && kcLower < bbLower) ? 1m : -1m;\n        }\n\n        /// <summary>\n        /// Resets the state of the indicator, including all sub-indicators.\n        /// </summary>\n        public override void Reset()\n        {\n            BollingerBands.Reset();\n            KeltnerChannels.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/StandardDeviation.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period population standard deviation.\n    /// </summary>\n    public class StandardDeviation : Variance\n    {\n        /// <summary>\n        /// Initializes a new instance of the StandardDeviation class with the specified period.\n        ///\n        /// Evaluates the standard deviation of samples in the look-back period. \n        /// On a data set of size N will use an N normalizer and would thus be biased if applied to a subset.\n        /// </summary>\n        /// <param name=\"period\">The sample size of the standard deviation</param>\n        public StandardDeviation(int period)\n            : this($\"STD({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the StandardDeviation class with the specified name and period.\n        /// \n        /// Evaluates the standard deviation of samples in the look-back period.\n        /// On a data set of size N will use an N normalizer and would thus be biased if applied to a subset.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The sample size of the standard deviation</param>\n        public StandardDeviation(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            return (decimal) Math.Sqrt((double) base.ComputeNextValue(window, input));\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Stochastic.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Slow Stochastics %K and %D. The Fast Stochastic %K is is computed by \n    /// (Current Close Price - Lowest Price of given Period) / (Highest Price of given Period - Lowest Price of given Period)\n    /// multiplied by 100. Once the Fast Stochastic %K is calculated the Slow Stochastic %K is calculated by the average/smoothed price of\n    /// of the Fast %K with the given period. The Slow Stochastic %D is then derived from the Slow Stochastic %K with the given period.\n    /// </summary>\n    public class Stochastic : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly IndicatorBase<IndicatorDataPoint> _maximum;\n        private readonly IndicatorBase<IndicatorDataPoint> _minimum;\n        private readonly IndicatorBase<IndicatorDataPoint> _sumFastK;\n        private readonly IndicatorBase<IndicatorDataPoint> _sumSlowK;\n\n        /// <summary>\n        /// Gets the value of the Fast Stochastic %K given Period.\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> FastStoch { get; }\n\n        /// <summary>\n        /// Gets the value of the Slow Stochastic given Period K.\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> StochK { get; }\n\n        /// <summary>\n        /// Gets the value of the Slow Stochastic given Period D.\n        /// </summary>\n        public IndicatorBase<IBaseDataBar> StochD { get; }\n\n        /// <summary>\n        /// Creates a new Stochastic Indicator from the specified periods.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator.</param>\n        /// <param name=\"period\">The period given to calculate the Fast %K</param>\n        /// <param name=\"kPeriod\">The K period given to calculated the Slow %K</param>\n        /// <param name=\"dPeriod\">The D period given to calculated the Slow %D</param>\n        public Stochastic(string name, int period, int kPeriod, int dPeriod)\n            : base(name)\n        {\n            _maximum = new Maximum(name + \"_Max\", period);\n            _minimum = new Minimum(name + \"_Min\", period);\n            _sumFastK = new Sum(name + \"_SumFastK\", kPeriod);\n            _sumSlowK = new Sum(name + \"_SumD\", dPeriod);\n\n            FastStoch = new FunctionalIndicator<IBaseDataBar>(name + \"_FastStoch\",\n                input => ComputeFastStoch(input),\n                fastStoch => _maximum.IsReady\n                );\n\n            StochK = new FunctionalIndicator<IBaseDataBar>(name + \"_StochK\",\n                input => ComputeStochK(kPeriod, input),\n                stochK => _sumFastK.IsReady\n            );\n\n            StochD = new FunctionalIndicator<IBaseDataBar>(\n                name + \"_StochD\",\n                input => ComputeStochD(dPeriod),\n                stochD => _sumSlowK.IsReady\n            );\n\n            // Subtracting 2 since the first value is calculated after 'period' bars, \n            // and each smoothing step adds (kPeriod - 1) and (dPeriod - 1) respectively.\n            WarmUpPeriod = period + kPeriod + dPeriod - 2;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"Stochastic\"/> indicator from the specified inputs.\n        /// </summary>\n        /// <param name=\"period\">The period given to calculate the Fast %K</param>\n        /// <param name=\"kPeriod\">The K period given to calculated the Slow %K</param>\n        /// <param name=\"dPeriod\">The D period given to calculated the Slow %D</param>\n        public Stochastic(int period, int kPeriod, int dPeriod)\n            : this($\"STO({period},{kPeriod},{dPeriod})\", period, kPeriod, dPeriod)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => FastStoch.IsReady && StochK.IsReady && StochD.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _maximum.Update(input.EndTime, input.High);\n            _minimum.Update(input.EndTime, input.Low);\n            FastStoch.Update(input);\n            StochK.Update(input);\n            StochD.Update(input);\n\n            return FastStoch.Current.Value;\n        }\n\n        /// <summary>\n        /// Computes the Fast Stochastic %K.\n        /// </summary>\n        /// <param name=\"input\">The input.</param>\n        /// <returns>The Fast Stochastic %K value.</returns>\n        private decimal ComputeFastStoch(IBaseDataBar input)\n        {\n            var fastStoch = 0m;\n            // It requires at least 'period' data points to compute Fast %K.\n            if (_maximum.IsReady)\n            {\n                var denominator = _maximum.Current.Value - _minimum.Current.Value;\n\n                // if there's no range, just return constant zero\n                if (denominator == 0m)\n                {\n                    return 0m;\n                }\n\n                var numerator = input.Close - _minimum.Current.Value;\n                fastStoch = numerator / denominator;\n                _sumFastK.Update(input.EndTime, fastStoch);\n            }\n            return fastStoch * 100;\n        }\n\n        /// <summary>\n        /// Computes the Slow Stochastic %K.\n        /// </summary>\n        /// <param name=\"constantK\">The constant k.</param>\n        /// <param name=\"input\">The input.</param>\n        /// <returns>The Slow Stochastic %K value.</returns>\n        private decimal ComputeStochK(int constantK, IBaseData input)\n        {\n            var stochK = 0m;\n            // It requires at least 'kPeriod' updates in _sumFastK for calculation.  \n            if (_sumFastK.IsReady)\n            {\n                stochK = _sumFastK.Current.Value / constantK;\n                _sumSlowK.Update(input.EndTime, stochK);\n            }\n            return stochK * 100;\n        }\n\n        /// <summary>\n        /// Computes the Slow Stochastic %D.\n        /// </summary>\n        /// <param name=\"constantD\">The constant d.</param>\n        /// <returns>The Slow Stochastic %D value.</returns>\n        private decimal ComputeStochD(int constantD)\n        {\n            var stochD = 0m;\n            // It requires at least 'dPeriod' updates in _sumSlowK for calculation  \n            if (_sumSlowK.IsReady)\n            {\n                stochD = _sumSlowK.Current.Value / constantD;\n            }\n            return stochD * 100;\n        }\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            FastStoch.Reset();\n            StochK.Reset();\n            StochD.Reset();\n            _maximum.Reset();\n            _minimum.Reset();\n            _sumFastK.Reset();\n            _sumSlowK.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/StochasticRelativeStrengthIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Stochastic RSI, or simply StochRSI, is a technical analysis indicator used to determine whether \n    /// an asset is overbought or oversold, as well as to identify current market trends.\n    /// As the name suggests, the StochRSI is a derivative of the standard Relative Strength Index (RSI) and, \n    /// as such, is considered an indicator of an indicator.\n    /// It is a type of oscillator, meaning that it fluctuates above and below a center line.\n    /// </summary>\n    public class StochasticRelativeStrengthIndex : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RelativeStrengthIndex _rsi;\n        private readonly RollingWindow<decimal> _recentRSIValues;\n\n        /// <summary>\n        /// Gets the %K output\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> K { get; }\n\n        /// <summary>\n        /// Gets the %D output\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> D { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the StochasticRelativeStrengthIndex class\n        /// </summary>\n        /// <param name=\"rsiPeriod\">The period of the relative strength index</param>\n        /// <param name=\"stochPeriod\">The period of the stochastic indicator</param>\n        /// <param name=\"kSmoothingPeriod\">The smoothing period of K output (aka %K)</param>\n        /// <param name=\"dSmoothingPeriod\">The smoothing period of D output (aka %D)</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used for k and d</param>\n        public StochasticRelativeStrengthIndex(int rsiPeriod, int stochPeriod, int kSmoothingPeriod, int dSmoothingPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : this($\"SRSI({rsiPeriod},{stochPeriod},{kSmoothingPeriod},{dSmoothingPeriod},{movingAverageType})\", rsiPeriod, stochPeriod, kSmoothingPeriod, dSmoothingPeriod, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the StochasticRelativeStrengthIndex class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"rsiPeriod\">The period of the relative strength index</param>\n        /// <param name=\"stochPeriod\">The period of the stochastic indicator</param>\n        /// <param name=\"kSmoothingPeriod\">The smoothing period of K output</param>\n        /// <param name=\"dSmoothingPeriod\">The smoothing period of D output</param>\n        /// <param name=\"movingAverageType\">The type of moving average to be used</param>\n        public StochasticRelativeStrengthIndex(string name, int rsiPeriod, int stochPeriod, int kSmoothingPeriod, int dSmoothingPeriod, MovingAverageType movingAverageType = MovingAverageType.Simple)\n            : base(name)\n        {\n            _rsi = new RelativeStrengthIndex(rsiPeriod);\n            _recentRSIValues = new RollingWindow<decimal>(stochPeriod);\n\n            K = movingAverageType.AsIndicator($\"{name}_K_{movingAverageType}\", kSmoothingPeriod);\n            D = movingAverageType.AsIndicator($\"{name}_D_{movingAverageType}\", dSmoothingPeriod);\n\n            WarmUpPeriod = rsiPeriod + stochPeriod + Math.Max(kSmoothingPeriod, dSmoothingPeriod);\n        }\n\n        /// <summary>\n        /// Computes the next value of the following sub-indicators from the given state:\n        /// K (%K) and D (%D)\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>The input is returned unmodified.</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _rsi.Update(input);\n            _recentRSIValues.Add(_rsi.Current.Value);\n\n            if (!_recentRSIValues.IsReady)\n            {\n                return 0m;\n            }\n\n            var maxHigh = _recentRSIValues.Max();\n            var minLow = _recentRSIValues.Min();\n\n            decimal k = 100;\n            if (maxHigh != minLow)\n            {\n                k = 100 * (_rsi.Current.Value - minLow) / (maxHigh - minLow);\n            }\n\n            K.Update(input.EndTime, k);\n            D.Update(input.EndTime, K.Current.Value);\n\n            return input.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator and all sub-indicators\n        /// </summary>\n        public override void Reset()\n        {\n            _rsi.Reset();\n            _recentRSIValues.Reset();\n            K.Reset();\n            D.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Sum.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator capable of tracking the sum for the given period\n    /// </summary>\n    public class Sum : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The sum for the given period\n        /// </summary>\n        private decimal _sum;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _sum = 0.0m;\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Sum class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        public Sum(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Sum class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the SMA</param>\n        public Sum(int period)\n            : this($\"SUM({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            _sum += input.Value;\n            if (window.Samples > window.Size)\n            {\n                _sum -= window.MostRecentlyRemoved.Value;\n            }\n            return _sum;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/SuperTrend.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Super trend indicator. \n    /// Formula can be found here via the excel file:\n    /// https://tradingtuitions.com/supertrend-indicator-excel-sheet-with-realtime-buy-sell-signals/\n    /// </summary>\n    public class SuperTrend : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly decimal _multiplier;\n        private decimal _superTrend;\n        private decimal _currentClose;\n        private decimal _previousTrailingUpperBand;\n        private decimal _previousTrailingLowerBand;\n        private decimal _previousClose;\n        private decimal _prevSuper;\n        private readonly int _period;\n\n        /// <summary>\n        /// Average true range indicator used to calculate super trend's basic upper and lower bands\n        /// </summary>\n        private readonly AverageTrueRange _averageTrueRange;\n\n        /// <summary>\n        /// Basic Upper Band\n        /// </summary>\n        public decimal BasicUpperBand { get; private set; }\n\n        /// <summary>\n        /// Basic Lower band\n        /// </summary>\n        public decimal BasicLowerBand { get; private set; }\n\n        /// <summary>\n        /// Current Trailing Upper Band\n        /// </summary>\n        public decimal CurrentTrailingUpperBand { get; private set; }\n\n        /// <summary>\n        /// Current Trailing Lower Band\n        /// </summary>\n        public decimal CurrentTrailingLowerBand { get; private set; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _averageTrueRange.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Creates a new SuperTrend indicator using the specified name, period, multiplier and moving average type\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The smoothing period used by average true range</param>\n        /// <param name=\"multiplier\">The coefficient used in calculations of basic upper and lower bands</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public SuperTrend(string name, int period, decimal multiplier, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : base(name)\n        {\n            _averageTrueRange = new AverageTrueRange(period, movingAverageType);\n            _multiplier = multiplier;\n            _period = period;\n            _prevSuper = -1;\n        }\n\n        /// <summary>\n        /// Creates a new SuperTrend indicator using the specified period, multiplier and moving average type\n        /// </summary>\n        /// <param name=\"period\">The smoothing period used in average true range</param>\n        /// <param name=\"multiplier\">The coefficient used in calculations of basic upper and lower bands</param>\n        /// <param name=\"movingAverageType\">The type of smoothing used to smooth the true range values</param>\n        public SuperTrend(int period, decimal multiplier, MovingAverageType movingAverageType = MovingAverageType.Wilders)\n            : this($\"SuperTrend({period},{multiplier})\", period, multiplier, movingAverageType)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (!_averageTrueRange.Update(input))\n            {\n                _previousClose = input.Close;\n                return 0m;\n            }\n\n            _currentClose = input.Close;\n            BasicLowerBand = ((input.High + input.Low) / 2) - (_multiplier * _averageTrueRange.Current.Value);\n            BasicUpperBand = ((input.High + input.Low) / 2) + (_multiplier * _averageTrueRange.Current.Value);\n\n            CurrentTrailingLowerBand = ((BasicLowerBand > _previousTrailingLowerBand) || (_previousClose < _previousTrailingLowerBand)) ? BasicLowerBand : _previousTrailingLowerBand;\n            CurrentTrailingUpperBand = ((BasicUpperBand < _previousTrailingUpperBand) || (_previousClose > _previousTrailingUpperBand)) ? BasicUpperBand : _previousTrailingUpperBand;\n\n            if ((_prevSuper == -1) || (_prevSuper == _previousTrailingUpperBand))\n            {\n                _superTrend = (_currentClose <= CurrentTrailingUpperBand) ? CurrentTrailingUpperBand : CurrentTrailingLowerBand;\n            }\n            else if (_prevSuper == _previousTrailingLowerBand)\n            {\n                _superTrend = (_currentClose >= CurrentTrailingLowerBand) ? CurrentTrailingLowerBand : CurrentTrailingUpperBand;\n            }\n\n            // Save the values to be used in next iteration.\n            _previousClose = _currentClose;\n            _prevSuper = _superTrend;\n            _previousTrailingLowerBand = CurrentTrailingLowerBand;\n            _previousTrailingUpperBand = CurrentTrailingUpperBand;\n\n            return _superTrend;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _averageTrueRange.Reset();\n            _previousTrailingLowerBand = 0;\n            _previousTrailingUpperBand = 0;\n            _prevSuper = -1;\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/SwissArmyKnife.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The tools of the Swiss Army Knife. Some of the tools lend well to chaining with the \"Of\" Method, others may be treated as moving averages\n    /// </summary>\n    public enum SwissArmyKnifeTool\n    {\n        /// <summary>\n        /// Two Pole Gaussian Filter (0)\n        /// </summary>\n        Gauss,\n        /// <summary>\n        /// Two Pole Butterworth Filter (1)\n        /// </summary>\n        Butter,\n        /// <summary>\n        /// High Pass Filter (2)\n        /// </summary>\n        HighPass,\n        /// <summary>\n        /// Two Pole High Pass Filter (3)\n        /// </summary>\n        TwoPoleHighPass,\n        /// <summary>\n        /// BandPass Filter (4)\n        /// </summary>\n        BandPass\n    }\n\n    /// <summary>\n    /// Swiss Army Knife indicator by John Ehlers\n    /// </summary>\n    public class SwissArmyKnife : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly RollingWindow<double> _price;\n        private readonly RollingWindow<double> _filt;\n        private readonly int _period;\n        private readonly double _a0 = 1;\n        private readonly double _a1 = 0;\n        private readonly double _a2 = 0;\n        private readonly double _b0 = 1;\n        private readonly double _b1 = 0;\n        private readonly double _b2 = 0;\n        private readonly double _c0 = 1;\n\n        /// <summary>\n        /// Swiss Army Knife indicator by John Ehlers\n        /// </summary>\n        /// <param name=\"period\"></param>\n        /// <param name=\"delta\"></param>\n        /// <param name=\"tool\"></param>\n        public SwissArmyKnife(int period, double delta, SwissArmyKnifeTool tool)\n            : this($\"Swiss({period},{delta},{tool})\", period, delta, tool)\n        {\n        }\n\n        /// <summary>\n        /// Swiss Army Knife indicator by John Ehlers\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"period\"></param>\n        /// <param name=\"delta\"></param>\n        /// <param name=\"tool\"></param>\n        public SwissArmyKnife(string name, int period, double delta, SwissArmyKnifeTool tool)\n            : base(name)\n        {\n            _filt = new RollingWindow<double>(2) {0, 0};\n            _price = new RollingWindow<double>(3);\n            _period = period;\n            var beta = 2.415 * (1 - Math.Cos(2 * Math.PI / period));\n            var alpha = -beta + Math.Sqrt(Math.Pow(beta, 2) + 2d * beta);\n\n            switch (tool)\n            {\n                case SwissArmyKnifeTool.Gauss:\n                    _c0 = alpha * alpha;\n                    _a1 = 2d * (1 - alpha);\n                    _a2 = -(1 - alpha) * (1 - alpha);\n                    break;\n                case SwissArmyKnifeTool.Butter:\n                    _c0 = alpha * alpha / 4d;\n                    _b1 = 2;\n                    _b2 = 1;\n                    _a1 = 2d * (1 - alpha);\n                    _a2 = -(1 - alpha) * (1 - alpha);\n                    break;\n                case SwissArmyKnifeTool.HighPass:\n                    alpha = (Math.Cos(2 * Math.PI / period) + Math.Sin(2 * Math.PI / period) - 1) / Math.Cos(2 * Math.PI / period);\n                    _c0 = (1 + alpha) / 2;\n                    _b1 = -1;\n                    _a1 = 1 - alpha;\n                    break;\n                case SwissArmyKnifeTool.TwoPoleHighPass:\n                    _c0 = (1 + alpha) * (1 + alpha) / 4;\n                    _b1 = -2;\n                    _b2 = 1;\n                    _a1 = 2d * (1 - alpha);\n                    _a2 = -(1 - alpha) * (1 - alpha);\n                    break;\n                case SwissArmyKnifeTool.BandPass:\n                    beta = Math.Cos(2 * Math.PI / period);\n                    var gamma = (1 / Math.Cos(4 * Math.PI * delta / period));\n                    alpha = gamma - Math.Sqrt(Math.Pow(gamma, 2) - 1);\n                    _c0 = (1 - alpha) / 2d;\n                    _b0 = 1;\n                    _b2 = -1;\n                    _a1 = -beta * (1 - alpha);\n                    _a2 = alpha;\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(tool), tool, \"Invalid SwissArmyKnifeTool\");\n            }\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _price.Add((double)input.Price);\n\n            if (_price.Samples == 1)\n            {\n                _price.Add(_price[0]);\n                _price.Add(_price[0]);\n            }\n\n            var signal = _a0 * _c0 * (_b0 * _price[0] + _b1 * _price[1] + _b2 * _price[2]) + _a0 * (_a1 * _filt[0] + _a2 * _filt[1]);\n\n            _filt.Add(signal);\n\n            return (decimal)signal;\n        }\n\n        /// <summary>\n        /// Resets to the initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _price.Reset();\n            _filt.Reset();\n            _filt.Add(0);\n            _filt.Add(0);\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/T3MovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the T3 Moving Average (T3).\n    /// The T3 Moving Average is calculated with the following formula:\n    /// EMA1(x, Period) = EMA(x, Period)\n    /// EMA2(x, Period) = EMA(EMA1(x, Period),Period)\n    /// GD(x, Period, volumeFactor) = (EMA1(x, Period)*(1+volumeFactor)) - (EMA2(x, Period)* volumeFactor)\n    /// T3 = GD(GD(GD(t, Period, volumeFactor), Period, volumeFactor), Period, volumeFactor);\n    /// </summary>\n    public class T3MovingAverage : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly DoubleExponentialMovingAverage _gd1;\n        private readonly DoubleExponentialMovingAverage _gd2;\n        private readonly DoubleExponentialMovingAverage _gd3;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"T3MovingAverage\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the T3MovingAverage</param>\n        /// <param name=\"volumeFactor\">The volume factor of the T3MovingAverage (value must be in the [0,1] range, defaults to 0.7)</param>\n        public T3MovingAverage(string name, int period, decimal volumeFactor = 0.7m) \n            : base(name)\n        {\n            _period = period;\n            _gd1 = new DoubleExponentialMovingAverage(name + \"_1\", period, volumeFactor);\n            _gd2 = new DoubleExponentialMovingAverage(name + \"_2\", period, volumeFactor);\n            _gd3 = new DoubleExponentialMovingAverage(name + \"_3\", period, volumeFactor);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"T3MovingAverage\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the T3MovingAverage</param>\n        /// <param name=\"volumeFactor\">The volume factor of the T3MovingAverage (value must be in the [0,1] range, defaults to 0.7)</param>\n        public T3MovingAverage(int period, decimal volumeFactor = 0.7m)\n            : this($\"T3({period},{volumeFactor})\", period, volumeFactor)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 6 * (_period - 1);\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 1 + 6 * (_period - 1);\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _gd1.Update(input);\n\n            if (!_gd1.IsReady)\n                return _gd1.Current.Value;\n\n            _gd2.Update(_gd1.Current);\n\n            if (!_gd2.IsReady)\n                return _gd2.Current.Value;\n\n            _gd3.Update(_gd2.Current);\n\n            return _gd3.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _gd1.Reset();\n            _gd2.Reset();\n            _gd3.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/TargetDownsideDeviation.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period target downside deviation. The target downside deviation is defined as the \n    /// root-mean-square, or RMS, of the deviations of the realized return’s underperformance from the target return \n    /// where all returns above the target return are treated as underperformance of 0.\n    /// \n    /// Reference: https://www.cmegroup.com/education/files/rr-sortino-a-sharper-ratio.pdf\n    /// </summary>\n    public class TargetDownsideDeviation : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Minimum acceptable return (MAR) for target downside deviation calculation\n        /// </summary>\n        private readonly double _minimumAcceptableReturn;\n\n        /// <summary>\n        /// Calculates the daily returns\n        /// </summary>\n        private RateOfChange _rateOfChange;\n\n        /// <summary>\n        /// The warm-up period necessary before the TDD indicator is considered ready.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Initializes a new instance of the TargetDownsideDeviation class with the specified period and \n        /// minimum acceptable return.\n        ///\n        /// The target downside deviation is defined as the root-mean-square, or RMS, of the deviations of \n        /// the realized return’s underperformance from the target return where all returns above the target \n        /// return are treated as underperformance of 0.\n        /// </summary>\n        /// <param name=\"period\">The sample size of the target downside deviation</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return (MAR) for target downside deviation calculation</param>\n        public TargetDownsideDeviation(int period, double minimumAcceptableReturn = 0)\n            : this($\"TDD({period},{minimumAcceptableReturn})\", period, minimumAcceptableReturn)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the TargetDownsideDeviation class with the specified period and \n        /// minimum acceptable return.\n        /// \n        /// The target downside deviation is defined as the root-mean-square, or RMS, of the deviations of \n        /// the realized return’s underperformance from the target return where all returns above the target \n        /// return are treated as underperformance of 0.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The sample size of the target downside deviation</param>\n        /// <param name=\"minimumAcceptableReturn\">Minimum acceptable return (MAR) for target downside deviation calculation</param>\n        public TargetDownsideDeviation(string name, int period, double minimumAcceptableReturn = 0) : base(name)\n        {\n            _minimumAcceptableReturn = minimumAcceptableReturn;\n            _rateOfChange = new RateOfChange(1);\n            // Resize the ROC's rolling window to hold recent 1-period returns to compute downside deviation\n            _rateOfChange.Window.Size = period;\n            WarmUpPeriod = period + 1;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _rateOfChange.Update(input);\n            var avg = _rateOfChange.Window.Select(x => Math.Pow(Math.Min(0, (double)x.Value - _minimumAcceptableReturn), 2)).Average();\n            return Math.Sqrt(avg).SafeDecimalCast();\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rateOfChange.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Theta.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Distributions;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Option Theta indicator that calculate the theta of an option\n    /// </summary>\n    /// <remarks>sensitivity of option price on time decay</remarks>\n    public class Theta : OptionGreeksIndicatorBase\n    {\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>am>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Theta class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Theta</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Theta(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRate, dividendYield,\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Calculate the Theta of the option\n        /// </summary>\n        protected override decimal CalculateGreek(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n            var iv = (double)ImpliedVolatility.Current.Value;\n\n            double result;\n\n            switch (_optionModel)\n            {\n                case OptionPricingModelType.BinomialCoxRossRubinstein:\n                case OptionPricingModelType.ForwardTree:\n                    var deltaTime = timeTillExpiryDouble / OptionGreekIndicatorsHelper.Steps;\n\n                    var forwardPrice = 0d;\n                    var price = 0d;\n                    if (_optionModel == OptionPricingModelType.BinomialCoxRossRubinstein)\n                    {\n                        forwardPrice = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble - 2 * deltaTime, riskFreeRate, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n                    else if (_optionModel == OptionPricingModelType.ForwardTree)\n                    {\n                        forwardPrice = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble - 2 * deltaTime, riskFreeRate, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n\n                    result = (forwardPrice - price) * 0.5 / deltaTime / 365d;\n                    break;\n\n                case OptionPricingModelType.BlackScholes:\n                default:\n                    var norm = new Normal();\n                    var d1 = OptionGreekIndicatorsHelper.CalculateD1(underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, iv);\n                    var d2 = OptionGreekIndicatorsHelper.CalculateD2(d1, iv, timeTillExpiryDouble);\n                    var discount = Math.Exp(-riskFreeRate * timeTillExpiryDouble);\n                    var adjustment = Math.Exp(-dividendYield * timeTillExpiryDouble);\n\n                    // allow at least 1% IV\n                    var theta = -underlyingPrice * Math.Max(iv, 0.01) * norm.Density(d1) * adjustment * 0.5 / Math.Sqrt(timeTillExpiryDouble);\n\n                    if (Right == OptionRight.Call)\n                    {\n                        d1 = norm.CumulativeDistribution(d1);\n                        d2 = -norm.CumulativeDistribution(d2);\n                    }\n                    else\n                    {\n                        d1 = -norm.CumulativeDistribution(-d1);\n                        d2 = norm.CumulativeDistribution(-d2);\n                    }\n\n                    theta += dividendYield * underlyingPrice * d1 * adjustment + riskFreeRate * strike * discount * d2;\n                    result = theta / 365;\n                    break;\n            }\n\n            return Convert.ToDecimal(result);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/TimeProfile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an Indicator of the Market Profile with Time Price Opportunity (TPO) mode and its attributes\n    /// </summary>\n    public class TimeProfile: MarketProfile\n    {\n        /// <summary>\n        /// Creates a new TimeProfile indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision.\n        public TimeProfile(int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)\n            : this($\"TP({period},{valueAreaVolumePercentage},{priceRangeRoundOff})\", period, valueAreaVolumePercentage, priceRangeRoundOff)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new TimeProfile indicator with the specified name, period and priceRangeRoundOff\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision.\n        /// i.e 0.01 round to two digits exactly.</param>\n        public TimeProfile(string name, int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)\n            : base(name, period, valueAreaVolumePercentage, priceRangeRoundOff)\n        { }\n\n        /// <summary>\n        /// Define the Volume in Time Profile mode\n        /// </summary>\n        /// <param name=\"input\"></param>\n        /// <returns>1</returns>\n        protected override decimal GetVolume(TradeBar input)\n        {\n            return 1;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/TimeSeriesForecast.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator capable of predicting new values given previous data from a window.\n    /// Source: https://tulipindicators.org/tsf\n    /// </summary>\n    public class TimeSeriesForecast : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Creates a new TimeSeriesForecast indicator with the specified period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period over which to look back</param>\n        public TimeSeriesForecast(string name, int period)\n            : base(name, period)\n        {\n            if (period < 2)\n            {\n                throw new ArgumentException(Messages.RollingWindow.InvalidSize(2), nameof(period));\n            }\n        }\n\n        /// <summary>\n        /// Creates a new TimeSeriesForecast indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period over which to look back</param>\n        public TimeSeriesForecast(int period)\n            : this($\"TSF{period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (!IsReady)\n            {\n                return 0;\n            }\n            \n            // calculations are derived from https://tulipindicators.org/tsf\n            decimal x1 = 0;\n            decimal x2 = 0;\n            decimal xy = 0;\n            decimal y = 0;\n\n            var i = Period - 1;\n            for (; i > 0; i--)\n            {\n                x1 += i;\n                x2 += i * i;\n                xy += window[i].Value * (Period - i);\n                y += window[i].Value;\n            }\n\n            x1 += Period;\n            x2 += Period * Period;\n\n            xy += window[0].Value * Period;\n            y += window[0].Value;\n\n            var bd = 1 / (Period * x2 - x1 * x1);\n            var b = (Period * xy - x1 * y) * bd;\n            var a = (y - b * x1) * (1m / Period);\n\n            return a + b * (Period + 1);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/TimeSeriesIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The base class for any Time Series-type indicator, containing methods common to most of such models.\n    /// </summary>\n    public abstract class TimeSeriesIndicator : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// \"Integration\" constants\n        /// </summary>\n        protected double[] _diffHeads { get; set; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public abstract int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// A constructor for a basic Time Series indicator.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected TimeSeriesIndicator(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Differences a time series d times.\n        /// </summary>\n        /// <param name=\"series\">Series to difference</param>\n        /// <param name=\"d\">The differencing order</param>\n        /// <param name=\"diffHeads\">\"Integration\" constants</param>\n        public static double[] DifferenceSeries(int d, double[] series, out double[] diffHeads)\n        {\n            diffHeads = new double[d];\n            if (d == 0)\n            {\n                return null;\n            }\n\n            var localSeries = series;\n            for (var j = 1; j <= d; j++)\n            {\n                var result = new double[localSeries.Length - 1];\n                diffHeads[j - 1] = localSeries.Last();\n\n                for (var i = 0; i <= localSeries.Length - 2; i++)\n                {\n                    result[i] = localSeries[i] - localSeries[i + 1];\n                }\n\n                localSeries = result;\n            }\n\n            return localSeries;\n        }\n\n        /// <summary>\n        /// Undoes the differencing of a time series which has been differenced using <see cref=\"DifferenceSeries\" />.\n        /// https://github.com/statsmodels/statsmodels/blob/04f00006a7aeb1c93d6894caa420698400da6c33/statsmodels/tsa/tsatools.py#L758\n        /// </summary>\n        /// <param name=\"series\">Series to un-difference</param>\n        /// <param name=\"diffHeads\">Series of \"integration\" constants for un-differencing</param>\n        public static double[] InverseDifferencedSeries(double[] series, double[] diffHeads)\n        {\n            var localDiffs = new Stack<double>(diffHeads.Reverse());\n            var localSeries = series.ToList();\n            while (localDiffs.Count > 0)\n            {\n                var first = localDiffs.Pop();\n                localSeries.Add(first);\n                localSeries = CumulativeSum(localSeries, true);\n            }\n\n            return localSeries.ToArray();\n        }\n\n        /// <summary>\n        /// Returns an array of lagged series for each of {1,...,p} lags.\n        /// </summary>\n        /// <param name=\"p\">Max lag order</param>\n        /// <param name=\"series\">Series to calculate the lags of</param>\n        /// <param name=\"includeT\">Whether or not to include t with its lags in the output array</param>\n        /// <returns>A list such that index i returns the series for i+1 lags</returns>\n        public static double[][] LaggedSeries(int p, double[] series, bool includeT = false)\n        {\n            // P-defined lagging - for each X_t, return double[] of the relevant lagged terms\n            var toArray = new List<double[]>();\n            for (var t = p; t < series.Length; t++)\n            {\n                var localLag = new List<double>();\n                for (var j = includeT ? 0 : 1; j <= p; j++)\n                {\n                    localLag.Add(series[t - j]);\n                }\n\n                toArray.Add(localLag.ToArray());\n            }\n\n            return toArray.ToArray();\n        }\n\n        /// <summary>\n        /// Returns a series where each spot is taken by the cumulative sum of all points up to and including\n        /// the value at that spot in the original series.\n        /// </summary>\n        /// <param name=\"series\">Series to cumulatively sum over.</param>\n        /// <param name=\"reverse\">Whether to reverse the series before applying the cumulative sum.</param>\n        /// <returns>Cumulatively summed series.</returns>\n        public static List<double> CumulativeSum(List<double> series, bool reverse = false)\n        {\n            var localSeries = series;\n            if (reverse)\n            {\n                localSeries.Reverse(); // For top-down\n            }\n\n            var sums = 0d;\n            var outSeries = new List<double>();\n            foreach (var val in localSeries)\n            {\n                sums += val;\n                outSeries.Add(sums);\n            }\n\n            if (reverse)\n            {\n                outSeries.Reverse(); // Return to original order\n            }\n\n            return outSeries;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/TomDemarkSequential.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nnamespace QuantConnect.Indicators;\n\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\n/// <summary>\n/// Represents the Tom Demark Sequential indicator, which is used to identify potential trend exhaustion points.\n/// This implementation tracks both the setup and countdown phases, and can be extended to handle bullish and bearish setups,\n/// as well as qualifiers such as Perfect Setups and Countdown completions.\n/// \n/// - **Setup Phase**: Detects a trend by counting 9 consecutive bars where the close is less than (Buy Setup)\n///   or greater than (Sell Setup) the close 4 bars earlier.\n/// - **TDST Support/Resistance**: After a valid 9-bar setup completes, the indicator records the **lowest low** (for Sell Setup)\n///   or **highest high** (for Buy Setup) among the 9 bars. These are referred to as Support Price(for Buy Setup) and\n///   Resistance Price (for Sell Setup), and serve as critical thresholds that validate the continuation of the countdown phase.\n/// - **Countdown Phase**: Once a valid setup is completed, the indicator attempts to count 13 qualifying bars (not necessarily consecutive)\n///   where the close is less than (Buy Countdown) or greater than (Sell Countdown) the low/high 2 bars earlier.\n///   During this phase, the TDST Support/Resistance levels are checked — if the price breaks these levels, the countdown phase is reset,\n///   as the trend reversal condition is considered invalidated.\n/// </summary>\n/// <remarks>\n/// This implementation uses a rolling window of 10 bars and begins logic when at least 5 bars are available.\n/// </remarks>\n/// <seealso cref=\"IBaseDataBar\"/>\n/// <seealso href=\"https://demark.com/sequential-indicator/\"/>\n/// <seealso href=\"https://practicaltechnicalanalysis.blogspot.com/2013/01/tom-demark-sequential.html\"/>\n/// <seealso href=\"https://medium.com/traderlands-blog/tds-td-sequential-indicator-2023-f8675bc5d14\"/>\n\npublic class TomDemarkSequential : WindowIndicator<IBaseDataBar>\n{\n    /// <summary>\n    /// The fixed number of bars used in the setup phase, as defined by the Tom DeMark Sequential (TD Sequential) indicator.\n    /// According to the TomDemark Sequential rules, a setup consists of exactly 9 consecutive qualifying bars.\n    /// </summary>\n    private const int MaxSetupCount = 9;\n\n    /// <summary>\n    /// The fixed number of bars used in the countdown phase, per the Tom Demark Sequential methodology.\n    /// A countdown is completed after exactly 13 qualifying bars.\n    /// These values are not configurable as they are fundamental to the algorithm's definition.\n    /// </summary>\n    private const int MaxCountdownCount = 13;\n    \n    /// <summary>\n    /// The windows of size 10 bars are enough and begin logic when at least 5 bars are available.\n    /// </summary>\n    private const int WindowSize = 10;\n\n    /// <summary>\n    ///  The TomDemark Sequential setup logic requires at least 6 bars to begin evaluating valid price flips and setups\n    /// </summary>\n    private const int RequiredSamples = 6;\n\n    private static decimal Default => (decimal)TomDemarkSequentialPhase.None;\n    private TomDemarkSequentialPhase _currentPhase;\n    \n    /// <summary>\n    /// Gets the current resistance price calculated during a Tom Demark Sequential buy setup.\n    /// This is the highest high of the 9-bar setup and can act as a resistance level.\n    /// </summary>\n    public decimal ResistancePrice { get; private set; }\n\n    /// <summary>\n    /// Gets the current support price calculated during a Tom Demark Sequential sell setup.\n    /// This is the lowest low of the 9-bar setup and can act as a support level.\n    /// </summary>\n    public decimal SupportPrice { get; private set; }\n    \n    /// <summary>\n    /// Gets the current Setup step count in the active Tom Demark Sequential (Buy/Sell) Setup phase \n    /// (e.g., 1 to 9 in Setup), 0 if not in setup phase.\n    /// </summary>\n    public int SetupPhaseStepCount { get; private set; }\n    \n    /// <summary>\n    /// Gets the current Countdown step count in the active TomDemark Sequential (Buy/Sell) Countdown phase\n    /// (e.g., 1 to 13 in Setup), 0 if bar is not in Countdown phase.\n    /// </summary>\n    public int CountdownPhaseStepCount { get; private set; }\n    \n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"TomDemarkSequential\"/> indicator.\n    /// </summary>\n    /// <param name=\"name\">The name of the indicator.</param>\n    public TomDemarkSequential(string name = \"TomDemarkSequential\")\n        : base(name, WindowSize)\n    {\n    }\n\n    /// <summary>\n    /// Gets a value indicating whether the indicator is ready and fully initialized.\n    /// Returns true when at least 6 bars have been received, which is the minimum required\n    /// for checking for pre-requisite price flips and for comparing the current close price\n    /// to the close price 4 bars ago (used in the setup logic).\n    /// </summary>\n    public override bool IsReady => Samples >= RequiredSamples;\n\n    /// <summary>\n    /// Gets the number of data points (bars) required before the indicator is considered ready.\n    /// The TomDemark Sequential setup logic requires at least 6 bars to begin evaluating valid setups.\n    /// </summary>\n    public override int WarmUpPeriod => RequiredSamples;\n\n    /// <summary>\n    /// Resets the indicator to its initial state by clearing all internal counters, flags,\n    /// and historical bar data. This allows the indicator to be reused from a clean state.\n    /// </summary>\n    public override void Reset()\n    {\n        SetupPhaseStepCount = 0;\n        CountdownPhaseStepCount = 0;\n        SupportPrice = 0;\n        ResistancePrice = 0;\n        _currentPhase = TomDemarkSequentialPhase.None;\n        base.Reset();\n    }\n\n    /// <summary>\n    /// Computes the next value of the TD Sequential indicator based on the provided <see cref=\"TradeBar\"/>.\n    /// </summary>\n    /// <param name=\"window\">The window of data held in this indicator</param>\n    /// <param name=\"current\">The current input value to this indicator on this time step</param>\n    /// <returns>The TomDemarkSequentialPhase state of the TD Sequential indicator for the current bar.</returns>\n    protected override decimal ComputeNextValue(IReadOnlyWindow<IBaseDataBar> window, IBaseDataBar current)\n    {\n        if (!IsReady)\n        {\n            return Default;\n        }\n\n        var bar4Ago = window[4];\n        var bar2Ago = window[2];\n\n        // Initialize setup if nothing is active\n        if (IsCurrentPhase(TomDemarkSequentialPhase.None))\n        {\n            var prevBar = window[1]; // previous to current bar\n            var prevBar4Ago = window[5]; // 4 bars before prevBar\n            return InitializeSetupPhase(current, bar4Ago, prevBar, prevBar4Ago);\n        }\n\n        // Buy Setup\n        if (IsCurrentPhase(TomDemarkSequentialPhase.BuySetup))\n        {\n            return HandleBuySetupPhase(current, bar4Ago, bar2Ago, window);\n        }\n\n        // Sell Setup\n        if (IsCurrentPhase(TomDemarkSequentialPhase.SellSetup))\n        {\n            return HandleSellSetupPhase(current, bar4Ago, bar2Ago, window);\n        }\n\n        // Buy Countdown\n        if (IsCurrentPhase(TomDemarkSequentialPhase.BuyCountdown))\n        {\n            return HandleBuyCountDown(current, bar2Ago);\n        }\n\n        // Sell Countdown\n        if (IsCurrentPhase(TomDemarkSequentialPhase.SellCountdown))\n        {\n            return HandleSellCountDown(current, bar2Ago);\n        }\n\n        return Default;\n    }\n\n    private bool IsCurrentPhase(TomDemarkSequentialPhase phase)\n    {\n        return _currentPhase == phase;\n    }\n\n    private decimal HandleSellCountDown(IBaseDataBar current, IBaseDataBar bar2Ago)\n    {\n        if (current.Close >= bar2Ago.High)\n        {\n            CountdownPhaseStepCount++;\n            if (CountdownPhaseStepCount == MaxCountdownCount)\n            {\n                _currentPhase = TomDemarkSequentialPhase.None;\n            }\n            return (decimal)TomDemarkSequentialPhase.SellCountdown;\n        }\n\n        if (current.Close < SupportPrice)\n        {\n            _currentPhase = TomDemarkSequentialPhase.None;\n        }\n\n        return Default;\n    }\n\n    private decimal HandleBuyCountDown(IBaseDataBar current, IBaseDataBar bar2Ago)\n    {\n        if (current.Close <= bar2Ago.Low)\n        {\n            CountdownPhaseStepCount++;\n            if (CountdownPhaseStepCount == MaxCountdownCount)\n            {\n                _currentPhase = TomDemarkSequentialPhase.None;\n            }\n            return (decimal)TomDemarkSequentialPhase.BuyCountdown;\n        }\n\n        if (current.Close > ResistancePrice)\n        {\n            _currentPhase = TomDemarkSequentialPhase.None;\n        }\n\n        return Default;\n    }\n\n    private decimal HandleSellSetupPhase(\n        IBaseDataBar current,\n        IBaseDataBar bar4Ago,\n        IBaseDataBar bar2Ago,\n        IReadOnlyWindow<IBaseDataBar> window\n        )\n    {\n        if (current.Close > bar4Ago.Close)\n        {\n            SetupPhaseStepCount++;\n            if (SetupPhaseStepCount == MaxSetupCount)\n            {\n                var isPerfect = IsSellSetupPerfect(window);\n                _currentPhase = TomDemarkSequentialPhase.SellCountdown;\n                //  Check if the close of bar 9 or current bar is greater than the high two bars earlier\n                if (current.Close > bar2Ago.High)\n                {\n                    CountdownPhaseStepCount = 1;\n                }\n                SupportPrice = window.Skip(window.Count - MaxSetupCount).Take(MaxSetupCount).Min(b => b.Low);\n\n                return\n                    (decimal)(isPerfect\n                        ? TomDemarkSequentialPhase.SellSetupPerfect\n                        : TomDemarkSequentialPhase.SellSetup);\n            }\n\n            return (decimal)TomDemarkSequentialPhase.SellSetup;\n        }\n\n        _currentPhase = TomDemarkSequentialPhase.None;\n        return Default;\n    }\n\n    private decimal HandleBuySetupPhase(\n        IBaseDataBar current,\n        IBaseDataBar bar4Ago,\n        IBaseDataBar bar2Ago,\n        IReadOnlyWindow<IBaseDataBar> window\n        )\n    {\n        if (current.Close < bar4Ago.Close)\n        {\n            SetupPhaseStepCount++;\n            if (SetupPhaseStepCount == MaxSetupCount)\n            {\n                var isPerfect = IsBuySetupPerfect(window);\n                _currentPhase = TomDemarkSequentialPhase.BuyCountdown;\n                ResistancePrice = window.Skip(window.Count - MaxSetupCount).Take(MaxSetupCount).Max(b => b.High);\n                // check the close of bar 9 is less than the low two bars earlier.\n                if (current.Close < bar2Ago.Low)\n                {\n                    CountdownPhaseStepCount = 1;\n                }\n\n                return \n                    (decimal)(isPerfect ? TomDemarkSequentialPhase.BuySetupPerfect : TomDemarkSequentialPhase.BuySetup);\n            }\n\n            return (decimal)TomDemarkSequentialPhase.BuySetup;\n        }\n\n        _currentPhase = TomDemarkSequentialPhase.None;\n        return Default;\n    }\n\n    private decimal InitializeSetupPhase(\n        IBaseDataBar current,\n        IBaseDataBar bar4Ago,\n        IBaseDataBar prevBar,\n        IBaseDataBar prevBar4Ago\n        )\n    {\n        // Bearish flip: prev close > previous's close[4 bars ago] and current close < close[4 bars ago]\n        if (prevBar.Close > prevBar4Ago.Close && current.Close < bar4Ago.Close)\n        {\n            _currentPhase = TomDemarkSequentialPhase.BuySetup;\n            SetupPhaseStepCount = 1;\n\n            return (decimal)TomDemarkSequentialPhase.BuySetup;\n        }\n\n        // Bullish flip: prev close < previous's close[4 bars ago] and current close > close[4 bars ago]\n        if (prevBar.Close < prevBar4Ago.Close && current.Close > bar4Ago.Close)\n        {\n            _currentPhase = TomDemarkSequentialPhase.SellSetup;\n            SetupPhaseStepCount = 1;\n\n            return (decimal)TomDemarkSequentialPhase.SellSetup;\n        }\n\n        return Default;\n    }\n\n    private static bool IsBuySetupPerfect(IReadOnlyWindow<IBaseDataBar> window)\n    {\n        var bar6 = window[3];\n        var bar7 = window[2];\n        var bar8 = window[1];\n        var bar9 = window[0];\n\n        return bar8.Low < bar6.Low && bar8.Low < bar7.Low ||\n            bar9.Low < bar6.Low && bar9.Low < bar7.Low;\n    }\n\n    private static bool IsSellSetupPerfect(IReadOnlyWindow<IBaseDataBar> window)\n    {\n        var bar6 = window[3];\n        var bar7 = window[2];\n        var bar8 = window[1];\n        var bar9 = window[0];\n\n        return bar8.High > bar6.High && bar8.High > bar7.High ||\n            bar9.High > bar6.High && bar9.High > bar7.High;\n    }\n}\n/// <summary>\n/// Represents the different phases of the TomDemark Sequential indicator.\n/// </summary>\npublic enum TomDemarkSequentialPhase\n{\n    /// <summary>\n    /// No active phase.\n    /// </summary>\n    None = 0,\n\n    /// <summary>\n    /// Buy setup phase.\n    /// </summary>\n    BuySetup = 1,\n\n    /// <summary>\n    /// Sell setup phase.\n    /// </summary>\n    SellSetup = 2,\n\n    /// <summary>\n    /// Buy countdown phase.\n    /// </summary>\n    BuyCountdown = 3,\n\n    /// <summary>\n    /// Sell countdown phase.\n    /// </summary>\n    SellCountdown = 4,\n\n    /// <summary>\n    /// Perfect buy setup phase.\n    /// </summary>\n    BuySetupPerfect = 5,\n\n    /// <summary>\n    /// Perfect sell setup phase.\n    /// </summary>\n    SellSetupPerfect = 6\n}\n"
  },
  {
    "path": "Indicators/TradeBarIndicator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The TradeBarIndicator is an indicator that accepts TradeBar data as its input.\n    /// \n    /// This type is more of a shim/typedef to reduce the need to refer to things as IndicatorBase&lt;TradeBar&gt;\n    /// </summary>\n    public abstract class TradeBarIndicator : IndicatorBase<TradeBar>\n    {\n        /// <summary>\n        /// Creates a new TradeBarIndicator with the specified name\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        protected TradeBarIndicator(string name)\n            : base(name)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Indicators/TriangularMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Triangular Moving Average (TRIMA). \n    /// The Triangular Moving Average is calculated with the following formula:\n    /// (1) When the period is even, TRIMA(x,period)=SMA(SMA(x,period/2),(period/2)+1)\n    /// (2) When the period is odd,  TRIMA(x,period)=SMA(SMA(x,(period+1)/2),(period+1)/2)\n    /// </summary>\n    public class TriangularMovingAverage : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly SimpleMovingAverage _sma1;\n        private readonly SimpleMovingAverage _sma2;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TriangularMovingAverage\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the indicator</param>\n        public TriangularMovingAverage(string name, int period)\n            : base(name)\n        {\n            _period = period;\n\n            var periodSma1 = period % 2 == 0 ? period / 2 : (period + 1) / 2;\n            var periodSma2 = period % 2 == 0 ? period / 2 + 1 : (period + 1) / 2;\n\n            _sma1 = new SimpleMovingAverage(name + \"_1\", periodSma1);\n            _sma2 = new SimpleMovingAverage(name + \"_2\", periodSma2);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TriangularMovingAverage\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the indicator</param>\n        public TriangularMovingAverage(int period)\n            : this($\"TRIMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _sma1.Update(input);\n            _sma2.Update(_sma1.Current);\n\n            return _sma2.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _sma1.Reset();\n            _sma2.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/TripleExponentialMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Triple Exponential Moving Average (TEMA). \n    /// The Triple Exponential Moving Average is calculated with the following formula:\n    /// EMA1 = EMA(t,period)\n    /// EMA2 = EMA(EMA(t,period),period)\n    /// EMA3 = EMA(EMA(EMA(t,period),period),period)\n    /// TEMA = 3 * EMA1 - 3 * EMA2 + EMA3\n    /// </summary>\n    public class TripleExponentialMovingAverage : IndicatorBase<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly ExponentialMovingAverage _ema1;\n        private readonly ExponentialMovingAverage _ema2;\n        private readonly ExponentialMovingAverage _ema3;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TripleExponentialMovingAverage\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the TEMA</param>\n        public TripleExponentialMovingAverage(string name, int period)\n            : base(name)\n        {\n            _period = period;\n            _ema1 = new ExponentialMovingAverage(name + \"_1\", period);\n            _ema2 = new ExponentialMovingAverage(name + \"_2\", period);\n            _ema3 = new ExponentialMovingAverage(name + \"_3\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TripleExponentialMovingAverage\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the TEMA</param>\n        public TripleExponentialMovingAverage(int period)\n            : this($\"TEMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _ema3.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 3 * (_period - 1) + 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _ema1.Update(input);\n\n            if (_ema1.IsReady)\n                _ema2.Update(_ema1.Current);\n\n            if (_ema2.IsReady)\n                _ema3.Update(_ema2.Current);\n\n            return IsReady ? 3m * _ema1.Current.Value - 3m * _ema2.Current.Value + _ema3.Current.Value : 0m;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _ema1.Reset();\n            _ema2.Reset();\n            _ema3.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Trix.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the TRIX (1-period ROC of a Triple EMA)\n    /// The TRIX is calculated as explained here:\n    /// http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:trix\n    /// </summary>\n    public class Trix : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly ExponentialMovingAverage _ema1;\n        private readonly ExponentialMovingAverage _ema2;\n        private readonly ExponentialMovingAverage _ema3;\n        private readonly RateOfChangePercent _roc;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Trix\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the indicator</param>\n        public Trix(string name, int period)\n            : base(name)\n        {\n            _period = period;\n            _ema1 = new ExponentialMovingAverage(name + \"_1\", period);\n            _ema2 = new ExponentialMovingAverage(name + \"_2\", period);\n            _ema3 = new ExponentialMovingAverage(name + \"_3\", period);\n            _roc = new RateOfChangePercent(name + \"_ROCP1\", 1);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Trix\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the indicator</param>\n        public Trix(int period)\n            : this($\"TRIX({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _roc.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// We have 3 EMAs chained on base period so every _period points starts the next EMA,\n        /// hence -1 on the multiplication, and finally the last ema updates our _roc which needs\n        /// to be warmed up before this indicator is warmed up.\n        /// </summary>\n        public int WarmUpPeriod => 3 * (_period - 1) + _roc.WarmUpPeriod;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            _ema1.Update(input);\n\n            if (_ema1.IsReady)\n                _ema2.Update(_ema1.Current);\n\n            if (_ema2.IsReady)\n                _ema3.Update(_ema2.Current);\n\n            if (_ema3.IsReady)\n                _roc.Update(_ema3.Current);\n\n            return _roc.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _ema1.Reset();\n            _ema2.Reset();\n            _ema3.Reset();\n            _roc.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/TrueRange.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the True Range (TR).\n    /// The True Range is the greatest of the following values:\n    /// value1 = distance from today's high to today's low.\n    /// value2 = distance from yesterday's close to today's high.\n    /// value3 = distance from yesterday's close to today's low.\n    /// </summary>\n    public class TrueRange : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private IBaseDataBar _previousInput;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrueRange\"/> class using the specified name.\n        /// </summary>\n        public TrueRange()\n            : base(\"TR\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrueRange\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        public TrueRange(string name)\n            : base(name)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > 1;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            var greatest = input.High - input.Low;\n\n            if (!IsReady)\n            {\n                _previousInput = input;\n                return greatest;\n            }\n\n            var value2 = Math.Abs(_previousInput.Close - input.High);\n            if (value2 > greatest)\n                greatest = value2;\n\n            var value3 = Math.Abs(_previousInput.Close - input.Low);\n            if (value3 > greatest)\n                greatest = value3;\n\n            _previousInput = input;\n\n            return greatest;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/TrueStrengthIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the True Strength Index (TSI).\n    /// The True Strength Index is calculated as explained here:\n    /// https://school.stockcharts.com/doku.php?id=technical_indicators:true_strength_index\n    ///\n    /// Briefly, the calculation has three steps:\n    ///   1. Smooth the momentum and the absolute momentum by getting an EMA of them (typically of period 25)\n    ///   2. Double smooth the momentum and the absolute momentum by getting an EMA of their EMA (typically of period 13)\n    ///   3. The TSI formula itself: divide the double-smoothed momentum over the double-smoothed absolute momentum and multiply by 100\n    ///\n    /// The signal is typically a 7-to-12-EMA of the TSI.\n    /// </summary>\n    public class TrueStrengthIndex : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private decimal _prevClose;\n\n        private readonly ExponentialMovingAverage _priceChangeEma;\n\n        private readonly ExponentialMovingAverage _priceChangeEmaEma;\n\n        private readonly ExponentialMovingAverage _absPriceChangeEma;\n\n        private readonly ExponentialMovingAverage _absPriceChangeEmaEma;\n\n        private readonly IndicatorBase<IndicatorDataPoint> _tsi;\n\n        /// <summary>\n        /// Gets the signal line for the TSI indicator\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> Signal { get; }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrueStrengthIndex\"/> class using the specified short and long term smoothing periods, and the signal period and type.\n        /// </summary>\n        /// <param name=\"shortTermPeriod\">Period used for the first price change smoothing</param>\n        /// <param name=\"longTermPeriod\">Period used for the second (double) price change smoothing</param>\n        /// <param name=\"signalPeriod\">The signal period</param>\n        /// <param name=\"signalType\">The type of moving average to use for the signal</param>\n        public TrueStrengthIndex(int longTermPeriod = 25, int shortTermPeriod = 13, int signalPeriod = 7, MovingAverageType signalType = MovingAverageType.Exponential)\n            : this($\"TSI({longTermPeriod},{shortTermPeriod},{signalPeriod})\", longTermPeriod, shortTermPeriod, signalPeriod, signalType)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrueStrengthIndex\"/> class using the specified name, the short and long term smoothing periods, and the signal period and type.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator</param>\n        /// <param name=\"shortTermPeriod\">Period used for the first price change smoothing</param>\n        /// <param name=\"longTermPeriod\">Period used for the second (double) price change smoothing</param>\n        /// <param name=\"signalPeriod\">The signal period</param>\n        /// <param name=\"signalType\">The type of moving average to use for the signal</param>\n        public TrueStrengthIndex(string name, int longTermPeriod = 25, int shortTermPeriod = 13, int signalPeriod = 7, MovingAverageType signalType = MovingAverageType.Exponential)\n            : base(name)\n        {\n            _priceChangeEma = new ExponentialMovingAverage(name + \"_PC_EMA\", longTermPeriod);\n            _absPriceChangeEma = new ExponentialMovingAverage(name + \"_APC_EMA\", longTermPeriod);\n            _priceChangeEmaEma = new ExponentialMovingAverage(name + \"_PC_EMA_EMA\", shortTermPeriod).Of(_priceChangeEma, true);\n            _absPriceChangeEmaEma = new ExponentialMovingAverage(name + \"_APC_EMA_EMA\", shortTermPeriod).Of(_absPriceChangeEma, true);\n            _tsi = _priceChangeEmaEma.Over(_absPriceChangeEmaEma).Times(100m);\n            Signal = signalType.AsIndicator(name + \"_Signal\", signalPeriod).Of(_tsi, true);\n            WarmUpPeriod = longTermPeriod + shortTermPeriod;\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            if (Samples == 1)\n            {\n                _prevClose = input.Price;\n                return 0m;\n            }\n\n            var priceChange = input.Price - _prevClose;\n            _prevClose = input.Price;\n            _priceChangeEma.Update(input.EndTime, priceChange);\n            _absPriceChangeEma.Update(input.EndTime, Math.Abs(priceChange));\n\n            return _tsi.Current.Value;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _prevClose = 0;\n            _priceChangeEma.Reset();\n            _priceChangeEmaEma.Reset();\n            _absPriceChangeEma.Reset();\n            _absPriceChangeEmaEma.Reset();\n            _tsi.Reset();\n            Signal.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/UltimateOscillator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Ultimate Oscillator (ULTOSC)\n    /// The Ultimate Oscillator is calculated as explained here:\n    /// http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:ultimate_oscillator\n    /// </summary>\n    public class UltimateOscillator : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private IBaseDataBar _previousInput;\n        private readonly TrueRange _trueRange;\n        private readonly Sum _sumBuyingPressure1;\n        private readonly Sum _sumBuyingPressure2;\n        private readonly Sum _sumBuyingPressure3;\n        private readonly Sum _sumTrueRange1;\n        private readonly Sum _sumTrueRange2;\n        private readonly Sum _sumTrueRange3;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UltimateOscillator\"/> class using the specified parameters\n        /// </summary>\n        /// <param name=\"period1\">The first period</param>\n        /// <param name=\"period2\">The second period</param>\n        /// <param name=\"period3\">The third period</param>\n        public UltimateOscillator(int period1, int period2, int period3)\n            : this($\"ULTOSC({period1},{period2},{period3})\", period1, period2, period3)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UltimateOscillator\"/> class using the specified parameters\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period1\">The first period</param>\n        /// <param name=\"period2\">The second period</param>\n        /// <param name=\"period3\">The third period</param>\n        public UltimateOscillator(string name, int period1, int period2, int period3)\n            : base(name)\n        {\n            _period = Math.Max(Math.Max(period1, period2), period3);\n            _trueRange = new TrueRange(name + \"_TR\");\n            _sumBuyingPressure1 = new Sum(name + \"_BP1\", period1);\n            _sumBuyingPressure2 = new Sum(name + \"_BP2\", period2);\n            _sumBuyingPressure3 = new Sum(name + \"_BP3\", period3);\n            _sumTrueRange1 = new Sum(name + \"_TR1\", period1);\n            _sumTrueRange2 = new Sum(name + \"_TR2\", period2);\n            _sumTrueRange3 = new Sum(name + \"_TR3\", period3);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period + 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _trueRange.Update(input);\n\n            if (Samples == 1)\n            {\n                _previousInput = input;\n                return 50m;\n            }\n\n            var buyingPressure = new IndicatorDataPoint { Value = input.Close - Math.Min(input.Low, _previousInput.Close) };\n\n            _sumBuyingPressure1.Update(buyingPressure);\n            _sumBuyingPressure2.Update(buyingPressure);\n            _sumBuyingPressure3.Update(buyingPressure);\n\n            _sumTrueRange1.Update(_trueRange.Current);\n            _sumTrueRange2.Update(_trueRange.Current);\n            _sumTrueRange3.Update(_trueRange.Current);\n\n            _previousInput = input;\n\n            if (!IsReady)\n                return 50m;\n\n            if (_sumTrueRange1.Current.Value == 0\n                || _sumTrueRange2.Current.Value == 0\n                || _sumTrueRange3.Current.Value == 0)\n            {\n                return Current.Value;\n            }\n\n            var average1 = _sumBuyingPressure1.Current.Value / _sumTrueRange1.Current.Value;\n            var average2 = _sumBuyingPressure2.Current.Value / _sumTrueRange2.Current.Value;\n            var average3 = _sumBuyingPressure3.Current.Value / _sumTrueRange3.Current.Value;\n\n            return 100m * (4 * average1 + 2 * average2 + average3) / 7;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _previousInput = null;\n            _trueRange.Reset();\n            _sumBuyingPressure1.Reset();\n            _sumBuyingPressure2.Reset();\n            _sumBuyingPressure3.Reset();\n            _sumTrueRange1.Reset();\n            _sumTrueRange2.Reset();\n            _sumTrueRange3.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/ValueAtRisk.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing MathNet.Numerics.Statistics;\nusing MathNet.Numerics.Distributions;\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes 1-day VaR for a specified confidence level and lookback period\n    /// </summary>\n    public class ValueAtRisk : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Confidence level for VaR calculation\n        /// </summary>\n        private readonly double _confidenceLevel;\n\n        /// <summary>\n        /// RateOfChange indicator to calculate the returns\n        /// </summary>\n        private readonly RateOfChange _rateOfChange;\n\n        /// <summary>\n        /// Rolling window to store the returns of the input data\n        /// </summary>\n        private readonly RollingWindow<double> _returns;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when the indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= WarmUpPeriod;\n\n        /// <summary>\n        /// Creates a new ValueAtRisk indicator with a specified period and confidence level\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">Historical lookback period in days</param>\n        /// <param name=\"confidenceLevel\">Confidence level for VaR calculation</param>\n        public ValueAtRisk(string name, int period, double confidenceLevel) \n            : base(name, period)\n        {\n            if (period < 3)\n            {\n                throw new ArgumentException($\"Period parameter for ValueAtRisk indicator must be greater than 2 but was {period}\");\n            }\n\n            WarmUpPeriod = period;\n            _confidenceLevel = confidenceLevel;\n\n            _returns = new RollingWindow<double>(period);\n            _rateOfChange = new RateOfChange(1);\n        }\n\n        /// <summary>\n        /// Creates a new ValueAtRisk indicator with a specified period and confidence level\n        /// </summary>\n        /// <param name=\"period\">Historical lookback period in days</param>\n        /// <param name=\"confidenceLevel\">Confidence level for VaR calculation</param>\n        public ValueAtRisk(int period, double confidenceLevel)\n            : this($\"VaR({period}, {confidenceLevel})\", period, confidenceLevel)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            _rateOfChange.Update(input);\n            _returns.Add((double)_rateOfChange.Current.Value);\n\n            if (_returns.Count < 2)\n            {\n                return 0m;\n            }\n\n            var mean = _returns.Mean();\n            var standardDeviation = _returns.StandardDeviation();\n            return (decimal)Normal.InvCDF(mean, standardDeviation, 1 - _confidenceLevel);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rateOfChange.Reset();\n            _returns.Reset();\n            base.Reset();\n        }\n    }\n}\n\n"
  },
  {
    "path": "Indicators/VariableIndexDynamicAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period adaptive weighted moving average indicator.\n    /// VIDYAi = Pricei x F x ABS(CMOi) + VIDYAi-1 x (1 - F x ABS(CMOi))\n    /// where:\n    /// VIDYAi - is the value of the current period.\n    /// Pricei - is the source price of the period being calculated.\n    /// F = 2/(Period_EMA+1) - is a smoothing factor.\n    /// ABS(CMOi) - is the absolute current value of CMO.\n    /// VIDYAi-1 - is the value of the period immediately preceding the period being calculated.\n    /// </summary>\n    public class VariableIndexDynamicAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private decimal _vidya;\n        private ChandeMomentumOscillator _CMO;\n        private readonly decimal _smoothingFactor;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VariableIndexDynamicAverage\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the indicator</param>\n        public VariableIndexDynamicAverage(int period)\n            : this($\"VIDYA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VariableIndexDynamicAverage\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the indicator</param>\n        public VariableIndexDynamicAverage(string name, int period)\n            : base(name, period)\n        {\n            _CMO = new ChandeMomentumOscillator(period);\n            _smoothingFactor = 2m / (period + 1);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples > Period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod => Period + 1;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            _CMO.Update(input);\n            if (!IsReady)\n            {\n                _vidya = input.Value;\n                return 0m;\n            }\n            var absCMO = Math.Abs(_CMO.Current.Value / 100);\n            _vidya = (input.Value * _smoothingFactor * absCMO) + (_vidya * (1 - _smoothingFactor * absCMO));\n\n            return _vidya;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _vidya = 0;\n            _CMO.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/Variance.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the n-period population variance.\n    /// </summary>\n    public class Variance : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        private decimal _rollingSum;\n        private decimal _rollingSumOfSquares;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Variance\"/> class using the specified period.\n        /// </summary> \n        /// <param name=\"period\">The period of the indicator</param>\n        public Variance(int period)\n            : this($\"VAR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Variance\"/> class using the specified name and period.\n        /// </summary> \n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the indicator</param>\n        public Variance(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <param name=\"window\">The window for the input history</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            _rollingSum += input.Value;\n            _rollingSumOfSquares += input.Value * input.Value;\n\n            if (Samples < 2)\n                return 0m;\n\n            var n = Math.Min(Period, Samples);\n            var meanValue1 = _rollingSum / n;\n            var meanValue2 = _rollingSumOfSquares / n;\n\n            if (n == Period)\n            {\n                var removedValue = window[Period - 1];\n                _rollingSum -= removedValue.Value;\n                _rollingSumOfSquares -= removedValue.Value * removedValue.Value;\n            }\n\n            // Ensure non-negative variance\n            return Math.Max(0m, meanValue2 - meanValue1 * meanValue1);\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rollingSum = 0;\n            _rollingSumOfSquares = 0;\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/Vega.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing MathNet.Numerics.Distributions;\nusing Python.Runtime;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Option Vega indicator that calculate the Vega of an option\n    /// </summary>\n    /// <remarks>sensitivity of option price on IV changes</remarks>\n    public class Vega : OptionGreeksIndicatorBase\n    {\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Vega({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(string name, Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYieldModel\">Dividend yield model</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Vega({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYieldModel, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(string name, Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n                OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(Symbol option, IRiskFreeInterestRateModel riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Vega({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(string name, Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRateModel\">Risk-free rate model</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Vega({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRateModel,\n                  dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"option\">The option to be tracked</param>am>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(string name, Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the Vega class\n        /// </summary>\n        /// <param name=\"option\">The option to be tracked</param>\n        /// <param name=\"riskFreeRate\">Risk-free rate, as a constant</param>\n        /// <param name=\"dividendYield\">Dividend yield, as a constant</param>\n        /// <param name=\"mirrorOption\">The mirror option for parity calculation</param>\n        /// <param name=\"optionModel\">The option pricing model used to estimate Vega</param>\n        /// <param name=\"ivModel\">The option pricing model used to estimate IV</param>\n        public Vega(Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m, Symbol mirrorOption = null,\n            OptionPricingModelType? optionModel = null, OptionPricingModelType? ivModel = null)\n            : this($\"Vega({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})\", option, riskFreeRate, dividendYield,\n                  mirrorOption, optionModel, ivModel)\n        {\n        }\n\n        /// <summary>\n        /// Calculate the Vega of the option\n        /// </summary>\n        protected override decimal CalculateGreek(decimal timeTillExpiry)\n        {\n            var underlyingPrice = (double)UnderlyingPrice.Current.Value;\n            var strike = (double)Strike;\n            var timeTillExpiryDouble = (double)timeTillExpiry;\n            var riskFreeRate = (double)RiskFreeRate.Current.Value;\n            var dividendYield = (double)DividendYield.Current.Value;\n            var iv = (double)ImpliedVolatility.Current.Value;\n\n            double result;\n\n            switch (_optionModel)\n            {\n                case OptionPricingModelType.BinomialCoxRossRubinstein:\n                case OptionPricingModelType.ForwardTree:\n                    // finite differencing method with 1% IV changes\n                    var deltaSigma = 0.01;\n\n                    var newPrice = 0d;\n                    var price = 0d;\n                    if (_optionModel == OptionPricingModelType.BinomialCoxRossRubinstein)\n                    {\n                        newPrice = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv + deltaSigma, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.CRRTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n                    else if (_optionModel == OptionPricingModelType.ForwardTree)\n                    {\n                        newPrice = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv + deltaSigma, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                        price = OptionGreekIndicatorsHelper.ForwardTreeTheoreticalPrice(iv, underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, Right);\n                    }\n\n                    result = (newPrice - price) / deltaSigma / 100d;\n                    break;\n\n                case OptionPricingModelType.BlackScholes:\n                default:\n                    var norm = new Normal();\n                    var d1 = OptionGreekIndicatorsHelper.CalculateD1(underlyingPrice, strike, timeTillExpiryDouble, riskFreeRate, dividendYield, iv);\n\n                    result = underlyingPrice * Math.Sqrt(timeTillExpiryDouble) * norm.Density(d1) * Math.Exp(-dividendYield * timeTillExpiryDouble) / 100d;\n                    break;\n            }\n\n            return Convert.ToDecimal(result);\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/VolumeProfile.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an Indicator of the Market Profile with Volume Profile mode and its attributes\n    /// </summary>\n    public class VolumeProfile: MarketProfile\n    {\n        /// <summary>\n        /// Creates a new VolumeProfile indicator with the specified period\n        /// </summary>\n        /// <param name=\"period\">The period of the indicator</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision.\n        public VolumeProfile(int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)\n            : this($\"VP({period},{valueAreaVolumePercentage},{priceRangeRoundOff})\", period, valueAreaVolumePercentage, priceRangeRoundOff)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new VolumeProfile indicator with the specified name, period and priceRangeRoundOff\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of this indicator</param>\n        /// <param name=\"valueAreaVolumePercentage\">The percentage of volume contained in the value area</param>\n        /// <param name=\"priceRangeRoundOff\">How many digits you want to round and the precision.\n        /// i.e 0.01 round to two digits exactly.</param>\n        public VolumeProfile(string name, int period = 2, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)\n            : base(name, period, valueAreaVolumePercentage, priceRangeRoundOff)\n        { }\n\n        /// <summary>\n        /// Define the Volume for the Volume Profile mode\n        /// </summary>\n        /// <param name=\"input\"></param>\n        /// <returns>The volume of the input Data Point</returns>\n        protected override decimal GetVolume(TradeBar input)\n        {\n            return input.Volume;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/VolumeWeightedAveragePriceIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Volume Weighted Average Price (VWAP) Indicator:\n    /// It is calculated by adding up the dollars traded for every transaction (price multiplied\n    /// by number of shares traded) and then dividing by the total shares traded for the day.\n    /// </summary>\n    public class VolumeWeightedAveragePriceIndicator : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// In this VWAP calculation, typical price is defined by (O + H + L + C) / 4\n        /// </summary>\n        private readonly int _period;\n\n        /// <summary>\n        /// Indentity indicator for price\n        /// </summary>\n        protected Identity Price { get; }\n\n        /// <summary>\n        /// Identity indicator for volume\n        /// </summary>\n        protected Identity Volume { get; }\n\n        /// <summary>\n        /// Volume Weighted Average Price\n        /// </summary>\n        protected CompositeIndicator VWAP { get; }\n\n        /// <summary>\n        /// Initializes a new instance of the VWAP class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the VWAP</param>\n        public VolumeWeightedAveragePriceIndicator(int period)\n            : this($\"VWAP({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the VWAP class with a given name and period\n        /// </summary>\n        /// <param name=\"name\">string - the name of the indicator</param>\n        /// <param name=\"period\">The period of the VWAP</param>\n        public VolumeWeightedAveragePriceIndicator(string name, int period)\n            : base(name)\n        {\n            _period = period;\n\n            Price = new Identity(\"Price\");\n            Volume = new Identity(\"Volume\");\n\n            // This class will be using WeightedBy indicator extension\n            VWAP = Price.WeightedBy(Volume, period);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => VWAP.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            Price.Reset();\n            Volume.Reset();\n            VWAP.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            Price.Update(input.EndTime, GetTimeWeightedAveragePrice(input));\n            Volume.Update(input.EndTime, input.Volume);\n            return VWAP.Current.Value;\n        }\n\n        /// <summary>\n        /// Gets an estimated average price to use for the interval covered by the input trade bar.\n        /// </summary>\n        /// <param name=\"input\">The current trade bar input</param>\n        /// <returns>An estimated average price over the trade bar's interval</returns>\n        protected virtual decimal GetTimeWeightedAveragePrice(TradeBar input)\n        {\n            return (input.Open + input.High + input.Low + input.Value) / 4;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/VolumeWeightedMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator computes the Volume Weighted Moving Average (VWMA)\n    /// It is a technical analysis indicator used by traders to determine the average price of an asset over a given period of time,\n    /// taking into account both price and volume.\n    /// </summary>\n    public class VolumeWeightedMovingAverage : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n\n        private readonly IndicatorBase<IndicatorDataPoint> _rollingSumPriceMultipliedByVolume;\n        private readonly IndicatorBase<IndicatorDataPoint> _rollingSumVolume;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _rollingSumPriceMultipliedByVolume.IsReady && _rollingSumVolume.IsReady;\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeWeightedMovingAverage\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the SMA</param>\n        public VolumeWeightedMovingAverage(string name, int period)\n            : base(name)\n        {\n            WarmUpPeriod = period;\n            _rollingSumPriceMultipliedByVolume = new Sum(name + \"_SumPxV\", period);\n            _rollingSumVolume = new Sum(name + \"_SumVolume\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"VolumeWeightedMovingAverage\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"period\">The period of the SMA</param>\n        public VolumeWeightedMovingAverage(int period)\n            : this($\"VWMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            _rollingSumPriceMultipliedByVolume.Update(input.EndTime, input.Close * input.Volume);\n            _rollingSumVolume.Update(input.EndTime, input.Volume);\n            var sumVolume = _rollingSumVolume.Current.Value;\n            if (sumVolume != 0)\n            {\n                return _rollingSumPriceMultipliedByVolume.Current.Value / sumVolume;\n            }\n            return input.Close;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _rollingSumPriceMultipliedByVolume.Reset();\n            _rollingSumVolume.Reset();\n            base.Reset();\n        }\n\n    }\n}\n"
  },
  {
    "path": "Indicators/Vortex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the Vortex Indicator, which identifies the start and continuation of market trends.\n    /// It includes components that capture positive (upward) and negative (downward) trend movements.\n    /// This indicator compares the ranges within the current period to previous periods to calculate\n    /// upward and downward movement trends.\n    /// </summary>\n    public class Vortex : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly int _period;\n        private readonly AverageTrueRange _atr;\n        private readonly Sum _atrSum;\n        private readonly Sum _plusVMSum;\n        private readonly Sum _minusVMSum;\n        private IBaseDataBar _previousInput;\n\n        /// <summary>\n        /// Gets the Positive Vortex Indicator, which reflects positive trend movements.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> PlusVortex { get; private set; }\n\n        /// <summary>\n        /// Gets the Negative Vortex Indicator, which reflects negative trend movements.\n        /// </summary>\n        public IndicatorBase<IndicatorDataPoint> MinusVortex { get; private set; }\n\n        /// <summary>\n        /// Indicates whether this indicator is fully ready and all buffers have been filled.\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// The minimum number of samples needed for the indicator to be ready and provide reliable values.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Vortex\"/> class using the specified period.\n        /// </summary>\n        /// <param name=\"period\">The number of periods used to construct the Vortex Indicator.</param>\n        public Vortex(int period)\n            : this($\"VTX({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Vortex\"/> class with a custom name and period.\n        /// </summary>\n        /// <param name=\"name\">The custom name for this instance of the Vortex Indicator.</param>\n        /// <param name=\"period\">The number of periods used to construct the Vortex Indicator.</param>\n        public Vortex(string name, int period)\n            : base(name)\n        {\n            _period = period;\n            _atr = new AverageTrueRange($\"{Name}_ATR\", 1, MovingAverageType.Simple);\n            _atrSum = new Sum(\"ATR_Sum\", period).Of(_atr);\n            _plusVMSum = new Sum(\"PlusVM_Sum\", period);\n            _minusVMSum = new Sum(\"MinusVM_Sum\", period);\n\n            PlusVortex = _plusVMSum.Over(_atrSum);\n            MinusVortex = _minusVMSum.Over(_atrSum);\n        }\n\n        /// <summary>\n        /// Computes the next value of the Vortex Indicator based on the provided input.\n        /// </summary>\n        /// <param name=\"input\">The input data used to compute the indicator value.</param>\n        /// <returns>The computed value of the indicator.</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            _atr.Update(input);\n\n            if (_previousInput != null)\n            {\n                var plusVMValue = Math.Abs(input.High - _previousInput.Low);\n                var minusVMValue = Math.Abs(input.Low - _previousInput.High);\n\n                _plusVMSum.Update(input.EndTime, plusVMValue);\n                _minusVMSum.Update(input.EndTime, minusVMValue);\n            }\n\n            _previousInput = input;\n\n            if (!IsReady)\n            {\n                return 0;\n            }\n\n            return (PlusVortex.Current.Value + MinusVortex.Current.Value) / 2;\n        }\n\n        /// <summary>\n        /// Resets all indicators and internal state.\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _atr.Reset();\n            _atrSum.Reset();\n            _plusVMSum.Reset();\n            _minusVMSum.Reset();\n            PlusVortex.Reset();\n            MinusVortex.Reset();\n            _previousInput = null;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/WilderAccumulativeSwingIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator calculates the Accumulative Swing Index (ASI) as defined by\n    /// Welles Wilder in his book 'New Concepts in Technical Trading Systems'.\n    /// <para>\n    /// ASIₜ = ASIₜ₋₁ + SIₜ\n    /// </para>\n    /// <para>\n    ///   Where:\n    ///   <list type=\"bullet\">\n    ///     <item>\n    ///       <term>ASIₜ₋₁</term>\n    ///       <description>\n    ///         The <see cref=\"WilderAccumulativeSwingIndex\"/> for the previous period.\n    ///       </description>\n    ///     </item>\n    ///     <item>\n    ///       <term>SIₜ</term>\n    ///       <description>\n    ///         The <see cref=\"WilderSwingIndex\"/> calculated for the current period.\n    ///       </description>\n    ///     </item>\n    ///   </list>\n    /// </para>\n    /// </summary>\n    /// <seealso cref=\"WilderSwingIndex\"/>\n    public class WilderAccumulativeSwingIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The Swing Index (SI) used in calculating the Accumulative Swing Index.\n        /// </summary>\n        private readonly WilderSwingIndex _si;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WilderAccumulativeSwingIndex\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"limitMove\">A decimal representing the limit move value for the period.</param>\n        public WilderAccumulativeSwingIndex(decimal limitMove)\n            : this (\"ASI\", limitMove)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WilderAccumulativeSwingIndex\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"limitMove\">A decimal representing the limit move value for the period.</param>\n        public WilderAccumulativeSwingIndex(string name, decimal limitMove)\n            : base (name)\n        {\n            _si = new WilderSwingIndex(limitMove); \n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized.\n        /// </summary>\n        public override bool IsReady => Samples > 1;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            var isReady = _si.Update(input);\n\n            if (isReady)\n            {\n                return IsReady\n                    ? Current.Value + _si.Current.Value\n                    : _si.Current.Value;\n            }\n            else\n            {\n                return 0m;\n            }\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state.\n        /// </summary>\n        public override void Reset()\n        {\n            _si.Reset();\n            base.Reset();\n        }\n    }\n}"
  },
  {
    "path": "Indicators/WilderMovingAverage.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the moving average indicator defined by Welles Wilder in his book:\n    /// New Concepts in Technical Trading Systems.\n    /// </summary>\n    public class WilderMovingAverage : Indicator, IIndicatorWarmUpPeriodProvider\n    {\n        private readonly decimal _k;\n        private readonly int _period;\n        private readonly IndicatorBase<IndicatorDataPoint> _sma;\n\n        /// <summary>\n        /// Initializes a new instance of the WilderMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the Wilder Moving Average</param>\n        public WilderMovingAverage(string name, int period)\n            : base(name)\n        {\n            _period = period;\n            _k = 1m / period;\n            _sma = new SimpleMovingAverage(name + \"_SMA\", period);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the WilderMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the Wilder Moving Average</param>\n        public WilderMovingAverage(int period)\n            : this(\"WWMA\" + period, period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Samples >= _period;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => _period;\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _sma.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IndicatorDataPoint input)\n        {\n            if (!IsReady)\n            {\n                _sma.Update(input);\n                return _sma.Current.Value;\n            }\n            return input.Value * _k + Current.Value * (1 - _k);\n        }\n    }\n}"
  },
  {
    "path": "Indicators/WilderSwingIndex.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// This indicator calculates the Swing Index (SI) as defined by Welles Wilder\n    /// in his book 'New Concepts in Technical Trading Systems'.\n    /// <para>\n    /// SIₜ = 50 * ( N / R ) * ( K / T )\n    /// </para>\n    /// <para>\n    ///   Where:\n    ///   <list type=\"bullet\">\n    ///     <item>\n    ///       <term>N</term>\n    ///       <description>\n    ///         Equals: Cₜ - Cₜ₋₁ + 0.5 * (Cₜ - Oₜ) + 0.25 * (Cₜ₋₁ - Oₜ₋₁)\n    ///         <para>\n    ///           <i>See <see cref=\"GetNValue\"/></i>\n    ///         </para>\n    ///       </description>\n    ///     </item>\n    ///     <item>\n    ///       <term>R</term>\n    ///       <description>\n    ///         Found by selecting the expression with the largest value and\n    ///         then using the corresponding formula.\n    ///         <para>\n    ///           Expression =&gt; Formula\n    ///           <list type=\"number\">\n    ///             <item>\n    ///               <description>\n    ///                 |Hₜ - Cₜ₋₁| =&gt; |Hₜ - Cₜ| - 0.5 * |Lₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|\n    ///               </description>\n    ///             </item>\n    ///             <item>\n    ///               <description>\n    ///                 |Lₜ - Cₜ₋₁| =&gt; |Lₜ - Cₜ| - 0.5 * |Hₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|\n    ///               </description>\n    ///             </item>\n    ///             <item>\n    ///               <description>\n    ///                 |Hₜ - Lₜ| =&gt; |Hₜ - Lₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|\n    ///               </description>\n    ///             </item>\n    ///           </list>\n    ///         </para>\n    ///         <para>\n    ///           <i>See <see cref=\"GetRValue\"/></i>\n    ///         </para>\n    ///       </description>\n    ///     </item>\n    ///     <item>\n    ///       <term>K</term>\n    ///       <description>\n    ///         Found by selecting the larger of the two expressions:\n    ///         |Hₜ - Cₜ₋₁|, |Lₜ - Cₜ₋₁|\n    ///         <para>\n    ///           <i>See <see cref=\"GetKValue\"/></i>\n    ///         </para>\n    ///       </description>\n    ///     </item>\n    ///     <item>\n    ///       <term>T</term>\n    ///       <description>\n    ///         The limit move, or the maximum change in price during the time\n    ///         period for the bar. Passed as limitMove via the constructor.\n    ///         <para>\n    ///           <i>See <see cref=\"T\"/></i>\n    ///         </para>\n    ///       </description>\n    ///     </item>\n    ///   </list>\n    /// </para>\n    /// </summary>\n    /// <seealso cref=\"WilderAccumulativeSwingIndex\"/>\n    public class WilderSwingIndex : TradeBarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Holds the bar for the current period.\n        /// </summary>\n        protected IBaseDataBar _currentInput { get; private set; }\n\n        /// <summary>\n        /// Holds the bar for the previous period.\n        /// </summary>\n        protected IBaseDataBar _previousInput { get; private set; }\n\n        /// <summary>\n        /// Gets the value for T (the limit move value) set in the constructor.\n        /// </summary>\n        private readonly decimal T;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WilderSwingIndex\"/> class using the specified name.\n        /// </summary>\n        /// <param name=\"name\">A string for the name of this indicator.</param>\n        /// <param name=\"limitMove\">A decimal representing the limit move value for the period.</param>\n        public WilderSwingIndex(string name, decimal limitMove)\n            : base(name)\n        {\n            T = Math.Abs(limitMove);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"WilderSwingIndex\"/> class using the default name.\n        /// </summary>\n        /// <param name=\"limitMove\">A decimal representing the limit move value for the period.</param>\n        public WilderSwingIndex(decimal limitMove)\n            : this(\"SI\", limitMove)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized.\n        /// </summary>\n        public override bool IsReady => Samples > 1;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod => 2;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state.\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator.</param>\n        /// <returns>A new value for this indicator.</returns>\n        protected override decimal ComputeNextValue(TradeBar input)\n        {\n            if (!IsReady)\n            {\n                _currentInput = input;\n                return 0m;\n            }\n\n            _previousInput = _currentInput;\n            _currentInput = input;\n\n            var N = GetNValue();\n            var R = GetRValue();\n            var K = GetKValue();\n\n            if (R == decimal.Zero || T == decimal.Zero)\n            {\n                return 0m;\n            }\n            return 50m * (N / R) * (K / T);\n        }\n\n        /// <summary>\n        /// Gets the value for N.\n        /// <para>\n        /// N = Cₜ - Cₜ₋₁ + 0.5 * (Cₜ - Oₜ) + 0.25 * (Cₜ₋₁ - Oₜ₋₁)\n        /// </para>\n        /// </summary>\n        private decimal GetNValue()\n        {\n            return (_currentInput.Close - _previousInput.Close)\n                + (0.5m * (_currentInput.Close - _currentInput.Open))\n                + (0.25m * (_previousInput.Close - _previousInput.Open));\n        }\n\n        /// <summary>\n        /// Gets the value for R, determined by using the formula corresponding\n        /// to the expression with the largest value.\n        /// <para>\n        ///   <i>Expressions:</i>\n        ///   <list type=\"number\">\n        ///     <item>\n        ///       <description>|Hₜ - Cₜ₋₁|</description>\n        ///     </item>\n        ///     <item>\n        ///       <description>|Lₜ - Cₜ₋₁|</description>\n        ///     </item>\n        ///     <item>\n        ///       <description>|Hₜ - Lₜ|</description>\n        ///     </item>\n        ///   </list>\n        /// </para>\n        /// <para>\n        ///   <i>Formulas:</i>\n        ///   <list type=\"number\">\n        ///     <item>\n        ///       <description>|Hₜ - Cₜ₋₁| - 0.5 * |Lₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|</description>\n        ///     </item>\n        ///     <item>\n        ///       <description>|Lₜ - Cₜ₋₁| - 0.5 * |Hₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|</description>\n        ///     </item>\n        ///     <item>\n        ///       <description>|Hₜ - Lₜ| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|</description>\n        ///     </item>\n        ///   </list>\n        /// </para>\n        /// </summary>\n        private decimal GetRValue()\n        {\n            var expressions = new decimal[]\n            {\n                Math.Abs(_currentInput.High - _previousInput.Close),\n                Math.Abs(_currentInput.Low - _previousInput.Close),\n                Math.Abs(_currentInput.High - _currentInput.Low)\n            };\n\n            int expressionIndex = Array.IndexOf(expressions, expressions.Max());\n\n            decimal result;\n            switch (expressionIndex)\n            {\n                case 0:\n                    result = Math.Abs(_currentInput.High - _previousInput.Close)\n                        - Math.Abs(0.5m * (_currentInput.Low - _previousInput.Close))\n                        + Math.Abs(0.25m * (_previousInput.Close - _previousInput.Open));\n                    break;\n\n                case 1:\n                    result = Math.Abs(_currentInput.Low - _previousInput.Close)\n                        - Math.Abs(0.5m * (_currentInput.High - _previousInput.Close))\n                        + Math.Abs(0.25m * (_previousInput.Close - _previousInput.Open));\n                    break;\n\n                case 2:\n                    result = Math.Abs(_currentInput.High - _currentInput.Low)\n                        + Math.Abs(0.25m * (_previousInput.Close - _previousInput.Open));\n                    break;\n\n                default:\n                    result = 0m;\n                    break;\n            }\n\n            return result;\n        }\n\n        /// <summary>\n        /// Gets the value for K, which is equal to the larger of the two following expressions.\n        /// <para>\n        ///   <i>Expressions:</i>\n        ///   <list type=\"number\">\n        ///     <item>\n        ///       <description>|Hₜ - Cₜ₋₁|</description>\n        ///     </item>\n        ///     <item>\n        ///       <description>|Lₜ - Cₜ₋₁|</description>\n        ///     </item>\n        ///   </list>\n        /// </para>\n        /// </summary>\n        private decimal GetKValue()\n        {\n            var values = new decimal[]\n            {\n                _currentInput.High - _previousInput.Close,\n                _currentInput.Low - _previousInput.Close\n            };\n\n            return values.Max(x => Math.Abs(x));\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/WilliamsPercentR.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Williams %R, or just %R, is the current closing price in relation to the high and low of\n    /// the past N days (for a given N). The value of this indicator fluctuates between -100 and 0.\n    /// The symbol is said to be oversold when the oscillator is below -80%,\n    /// and overbought when the oscillator is above -20%. \n    /// </summary>\n    public class WilliamsPercentR : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// Gets the Maximum indicator\n        /// </summary>\n        public Maximum Maximum { get; }\n\n        /// <summary>\n        /// Gets the Minimum indicator\n        /// </summary>\n        public Minimum Minimum { get; }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => Maximum.IsReady && Minimum.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public int WarmUpPeriod { get; }\n\n        /// <summary>\n        /// Creates a new Williams %R.\n        /// </summary>\n        /// <param name=\"period\">The look-back period to determine the Williams %R</param>\n        public WilliamsPercentR(int period)\n            : this($\"WILR({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new Williams %R.\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The look-back period to determine the Williams %R</param>\n        public WilliamsPercentR(string name, int period)\n            : base(name)\n        {\n            Maximum = new Maximum(name + \"_Max\", period);\n            Minimum = new Minimum(name + \"_Min\", period);\n            WarmUpPeriod = period;\n        }\n\n        /// <summary>\n        /// Resets this indicator and both sub-indicators (Max and Min)\n        /// </summary>\n        public override void Reset()\n        {\n            Maximum.Reset();\n            Minimum.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            Minimum.Update(input.EndTime, input.Low);\n            Maximum.Update(input.EndTime, input.High);\n\n            if (!IsReady) return 0;\n\n            var range = Maximum.Current.Value - Minimum.Current.Value;\n\n            return range == 0 ? 0 : -100m * (Maximum.Current.Value - input.Close) / range;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/WindowIdentity.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator that is a ready after ingesting enough samples (# samples > period) \n    /// and always returns the same value as it is given.\n    /// </summary>\n    public class WindowIdentity : WindowIndicator<IndicatorDataPoint>\n    {\n        /// <summary>\n        /// Initializes a new instance of the WindowIdentity class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the WindowIdentity</param>\n        public WindowIdentity(string name, int period)\n            : base(name, period)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the WindowIdentity class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the WindowIdentity</param>\n        public WindowIdentity(int period)\n            : this(\"WIN-ID\" + period, period)\n        {\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady\n        {\n            get { return Samples >= Period; }\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            return input.Value;\n        }\n    }\n}"
  },
  {
    "path": "Indicators/WindowIndicator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents an indicator that acts on a rolling window of data\n    /// </summary>\n    public abstract class WindowIndicator<T> : IndicatorBase<T>, IIndicatorWarmUpPeriodProvider\n        where T : IBaseData\n    {\n        // a window of data over a certain look back period\n        private readonly RollingWindow<T> _window;\n\n        /// <summary>\n        /// Gets the period of this window indicator\n        /// </summary>\n        public int Period => _window.Size;\n\n        /// <summary>\n        /// Initializes a new instance of the WindowIndicator class\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The number of data points to hold in the window</param>\n        protected WindowIndicator(string name, int period)\n            : base(name)\n        {\n            if (period < 1)\n            {\n                throw new ArgumentException(Messages.RollingWindow.InvalidSize(1), nameof(period));\n            }\n            _window = new RollingWindow<T>(period);\n        }\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _window.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, to the indicator to be ready and fully initialized\n        /// </summary>\n        public virtual int WarmUpPeriod => Period;\n\n        /// <summary>\n        /// Computes the next value of this indicator from the given state\n        /// </summary>\n        /// <param name=\"input\">The input given to the indicator</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(T input)\n        {\n            _window.Add(input);\n            return ComputeNextValue(_window, input);\n        }\n\n        /// <summary>\n        ///     Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            base.Reset();\n            _window.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected abstract decimal ComputeNextValue(IReadOnlyWindow<T> window, T input);\n    }\n}\n"
  },
  {
    "path": "Indicators/ZeroLagExponentialMovingAverage.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// Represents the zero lag moving average indicator (ZLEMA)\n    /// ie a technical indicator that aims is to eliminate the inherent lag associated to all trend \n    /// following indicators which average a price over time.\n    /// </summary>\n    public class ZeroLagExponentialMovingAverage : WindowIndicator<IndicatorDataPoint>, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// An exponential moving average is used\n        /// </summary>\n        private readonly int _period;\n        private readonly ExponentialMovingAverage _ema;\n        private readonly Delay _delayedPrice;\n\n        /// <summary>\n        /// Gets a flag indicating when this indicator is ready and fully initialized\n        /// </summary>\n        public override bool IsReady => _delayedPrice.IsReady && _ema.IsReady;\n\n        /// <summary>\n        /// Required period, in data points, for the indicator to be ready and fully initialized.\n        /// </summary>\n        public override int WarmUpPeriod => _period + (int)Math.Floor(((float)_period) / 2);\n\n        /// <summary>\n        /// Initializes a new instance of the ZeroLagMovingAverage class with the specified name and period\n        /// </summary>\n        /// <param name=\"name\">The name of this indicator</param>\n        /// <param name=\"period\">The period of the ZLEMA</param>\n        public ZeroLagExponentialMovingAverage(string name, int period)\n            : base(name, period)\n        {\n            _period = period;\n            _ema = new ExponentialMovingAverage(name + \"_EMA\", period);\n            _delayedPrice = new Delay((int)Math.Round((period - 1) / 2.0));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the ZeroLagMovingAverage class with the default name and period\n        /// </summary>\n        /// <param name=\"period\">The period of the ZLEMA</param>\n        public ZeroLagExponentialMovingAverage(int period)\n            : this($\"ZLEMA({period})\", period)\n        {\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _ema.Reset();\n            _delayedPrice.Reset();\n            base.Reset();\n        }\n\n        /// <summary>\n        /// Computes the next value for this indicator from the given state.\n        /// </summary>\n        /// <param name=\"window\">The window of data held in this indicator</param>\n        /// <param name=\"input\">The input value to this indicator on this time step</param>\n        /// <returns>A new value for this indicator</returns>\n        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input)\n        {\n            if (_delayedPrice.Update(input))\n            {\n                _ema.Update(input.EndTime, input.Value + (input.Value - _delayedPrice.Current));\n                return _ema.Current.Value;\n            }\n            return 0;\n        }\n    }\n}\n"
  },
  {
    "path": "Indicators/ZigZag.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Indicators\n{\n    /// <summary>\n    /// The ZigZag indicator identifies significant turning points in price movements,\n    /// filtering out noise using a sensitivity threshold and a minimum trend length.\n    /// It alternates between high and low pivots to determine market trends.\n    /// </summary>\n    public class ZigZag : BarIndicator, IIndicatorWarmUpPeriodProvider\n    {\n        /// <summary>\n        /// The most recent pivot point, represented as a bar of market data.\n        /// Used as a reference for calculating subsequent pivots.\n        /// </summary>\n        private IBaseDataBar _lastPivot;\n\n        /// <summary>\n        /// The minimum number of bars required to confirm a valid trend.\n        /// Ensures that minor fluctuations in price do not create false pivots.\n        /// </summary>\n        private readonly int _minTrendLength;\n\n        /// <summary>\n        /// The sensitivity threshold for detecting significant price movements.\n        /// A decimal value between 0 and 1 that determines the percentage change required\n        /// to recognize a new pivot.\n        /// </summary>\n        private readonly decimal _sensitivity;\n\n        /// <summary>\n        /// A counter to track the number of bars since the last pivot was identified.\n        /// Used to enforce the minimum trend length requirement.\n        /// </summary>\n        private int _count;\n\n        /// <summary>\n        /// Tracks whether the most recent pivot was a low pivot.\n        /// Used to alternate between identifying high and low pivots.\n        /// </summary>\n        private bool _lastPivotWasLow;\n\n        /// <summary>\n        /// Stores the most recent high pivot value in the ZigZag calculation.\n        /// Updated whenever a valid high pivot is identified.\n        /// </summary>\n        [PandasIgnore]\n        public Identity HighPivot { get; }\n\n        /// <summary>\n        /// Stores the most recent low pivot value in the ZigZag calculation.\n        /// Updated whenever a valid low pivot is identified.\n        /// </summary>\n        [PandasIgnore]\n        public Identity LowPivot { get; }\n\n        /// <summary>\n        /// Represents the current type of pivot (High or Low) in the ZigZag calculation.\n        /// The value is updated based on the most recent pivot identified: \n        /// </summary>\n        public PivotPointType PivotType { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ZigZag\"/> class with the specified parameters.\n        /// </summary>\n        /// <param name=\"name\">The name of the indicator.</param>\n        /// <param name=\"sensitivity\">The sensitivity threshold as a decimal value between 0 and 1.</param>\n        /// <param name=\"minTrendLength\">The minimum number of bars required to form a valid trend.</param>\n        public ZigZag(string name, decimal sensitivity = 0.05m, int minTrendLength = 1) : base(name)\n        {\n            if (sensitivity <= 0 || sensitivity >= 1)\n            {\n                throw new ArgumentException(\"Sensitivity must be between 0 and 1.\", nameof(sensitivity));\n            }\n\n            if (minTrendLength < 1)\n            {\n                throw new ArgumentException(\"Minimum trend length must be greater than 0.\", nameof(minTrendLength));\n            }\n            HighPivot = new Identity(name + \"_HighPivot\");\n            LowPivot = new Identity(name + \"_LowPivot\");\n            _sensitivity = sensitivity;\n            _minTrendLength = minTrendLength;\n            PivotType = PivotPointType.Low;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ZigZag\"/> class using default parameters.\n        /// </summary>\n        /// <param name=\"sensitivity\">The sensitivity threshold as a decimal value between 0 and 1.</param>\n        /// <param name=\"minTrendLength\">The minimum number of bars required to form a valid trend.</param>\n        public ZigZag(decimal sensitivity = 0.05m, int minTrendLength = 1)\n            : this($\"ZZ({sensitivity},{minTrendLength})\", sensitivity, minTrendLength)\n        {\n        }\n\n        /// <summary>\n        /// Indicates whether the indicator has enough data to produce meaningful output.\n        /// The indicator is considered \"ready\" when the number of samples exceeds the minimum trend length.\n        /// </summary>\n        public override bool IsReady => Samples > _minTrendLength;\n\n        /// <summary>\n        /// Gets the number of periods required for the indicator to warm up.\n        /// This is equal to the minimum trend length plus one additional bar for initialization.\n        /// </summary>\n        public int WarmUpPeriod => _minTrendLength + 1;\n\n        /// <summary>\n        /// Computes the next value of the ZigZag indicator based on the input bar.\n        /// Determines whether the input bar forms a new pivot or updates the current trend.\n        /// </summary>\n        /// <param name=\"input\">The current bar of market data used for the calculation.</param>\n        /// <returns>\n        /// The value of the most recent pivot, either a high or low, depending on the current trend.\n        /// </returns>\n        protected override decimal ComputeNextValue(IBaseDataBar input)\n        {\n            if (_lastPivot == null)\n            {\n                UpdatePivot(input, true);\n                return decimal.Zero;\n            }\n\n            var currentPivot = _lastPivotWasLow ? _lastPivot.Low : _lastPivot.High;\n\n            if (_lastPivotWasLow)\n            {\n                if (input.High >= _lastPivot.Low * (1m + _sensitivity) && _count >= _minTrendLength)\n                {\n                    UpdatePivot(input, false);\n                    currentPivot = HighPivot;\n                }\n                else if (input.Low <= _lastPivot.Low)\n                {\n                    UpdatePivot(input, true);\n                    currentPivot = LowPivot;\n                }\n            }\n            else\n            {\n                if (input.Low <= _lastPivot.High * (1m - _sensitivity) && _count >= _minTrendLength)\n                {\n                    UpdatePivot(input, true);\n                    currentPivot = LowPivot;\n                }\n                else if (input.High >= _lastPivot.High)\n                {\n                    UpdatePivot(input, false);\n                    currentPivot = HighPivot;\n                }\n            }\n            _count++;\n            return currentPivot;\n        }\n\n        /// <summary>\n        /// Updates the pivot point based on the given input bar. \n        /// If a change in trend is detected, the pivot type is switched and the corresponding pivot (high or low) is updated.\n        /// </summary>\n        /// <param name=\"input\">The current bar of market data used for the update.</param>\n        /// <param name=\"pivotDirection\">Indicates whether the trend has reversed.</param>\n        private void UpdatePivot(IBaseDataBar input, bool pivotDirection)\n        {\n            _lastPivot = input;\n            _count = 0;\n            if (_lastPivotWasLow == pivotDirection)\n            {\n                //Update previous pivot\n                (_lastPivotWasLow ? LowPivot : HighPivot).Update(input.EndTime, _lastPivotWasLow ? input.Low : input.High);\n            }\n            else\n            {\n                //Create new pivot\n                (_lastPivotWasLow ? HighPivot : LowPivot).Update(input.EndTime, _lastPivotWasLow ? input.High : input.Low);\n                PivotType = _lastPivotWasLow ? PivotPointType.High : PivotPointType.Low;\n            }\n            _lastPivotWasLow = pivotDirection;\n        }\n\n        /// <summary>\n        /// Resets this indicator to its initial state\n        /// </summary>\n        public override void Reset()\n        {\n            _lastPivot = null;\n            PivotType = PivotPointType.Low;\n            HighPivot.Reset();\n            LowPivot.Reset();\n            base.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2014 QuantConnect Corporation\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "Launcher/Program.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Lean.Launcher\n{\n    public class Program\n    {\n        private const string _collapseMessage = \"Unhandled exception breaking past controls and causing collapse of algorithm node. This is likely a memory leak of an external dependency or the underlying OS terminating the LEAN engine.\";\n        private static LeanEngineSystemHandlers leanEngineSystemHandlers;\n        private static LeanEngineAlgorithmHandlers leanEngineAlgorithmHandlers;\n        private static AlgorithmNodePacket job;\n        private static AlgorithmManager algorithmManager;\n\n        static Program()\n        {\n            AppDomain.CurrentDomain.AssemblyLoad += (sender, e) =>\n            {\n                if (e.LoadedAssembly.FullName.ToLowerInvariant().Contains(\"python\"))\n                {\n                    Log.Trace($\"Python for .NET Assembly: {e.LoadedAssembly.GetName()}\");\n                }\n            };\n        }\n\n        static void Main(string[] args)\n        {\n            if (OS.IsWindows)\n            {\n                Console.OutputEncoding = System.Text.Encoding.UTF8;\n            }\n\n            // expect first argument to be config file name\n            if (args.Length > 0)\n            {\n                Config.MergeCommandLineArgumentsWithConfiguration(LeanArgumentParser.ParseArguments(args));\n            }\n\n            //Name thread for the profiler:\n            Thread.CurrentThread.Name = \"Algorithm Analysis Thread\";\n\n            Initializer.Start();\n            leanEngineSystemHandlers = Initializer.GetSystemHandlers();\n\n            //-> Pull job from QuantConnect job queue, or, pull local build:\n            job = leanEngineSystemHandlers.JobQueue.NextJob(out var assemblyPath);\n\n            leanEngineAlgorithmHandlers = Initializer.GetAlgorithmHandlers();\n\n            if (job == null)\n            {\n                const string jobNullMessage = \"Engine.Main(): Sorry we could not process this algorithm request.\";\n                Log.Error(jobNullMessage);\n                Exit(1);\n            }\n\n            // Activate our PythonVirtualEnvironment\n            PythonInitializer.ActivatePythonVirtualEnvironment(job.PythonVirtualEnvironment);\n\n            // if the job version doesn't match this instance version then we can't process it\n            // we also don't want to reprocess redelivered jobs\n            if (job.Redelivered)\n            {\n                Log.Error(\"Engine.Run(): Job Version: \" + job.Version + \"  Deployed Version: \" + Globals.Version + \" Redelivered: \" + job.Redelivered);\n                //Tiny chance there was an uncontrolled collapse of a server, resulting in an old user task circulating.\n                //In this event kill the old algorithm and leave a message so the user can later review.\n                leanEngineSystemHandlers.Api.SetAlgorithmStatus(job.AlgorithmId, AlgorithmStatus.RuntimeError, _collapseMessage);\n                leanEngineSystemHandlers.Notify.SetAuthentication(job);\n                leanEngineSystemHandlers.Notify.Send(new RuntimeErrorPacket(job.UserId, job.AlgorithmId, _collapseMessage));\n                leanEngineSystemHandlers.JobQueue.AcknowledgeJob(job);\n                Exit(1);\n            }\n\n            try\n            {\n                // Set our exit handler for the algorithm\n                Console.CancelKeyPress += new ConsoleCancelEventHandler(ExitKeyPress);\n\n                // Create the algorithm manager and start our engine\n                algorithmManager = new AlgorithmManager(Globals.LiveMode, job);\n\n                leanEngineSystemHandlers.LeanManager.Initialize(leanEngineSystemHandlers, leanEngineAlgorithmHandlers, job, algorithmManager);\n\n                OS.Initialize();\n\n                var engine = new Engine.Engine(leanEngineSystemHandlers, leanEngineAlgorithmHandlers, Globals.LiveMode);\n                engine.Run(job, algorithmManager, assemblyPath, WorkerThread.Instance);\n            }\n            finally\n            {\n                var algorithmStatus = algorithmManager?.State ?? AlgorithmStatus.DeployError;\n\n                Exit(algorithmStatus != AlgorithmStatus.Completed ? 1 : 0);\n            }\n        }\n\n        public static void ExitKeyPress(object sender, ConsoleCancelEventArgs args)\n        {\n            // Allow our process to resume after this event\n            args.Cancel = true;\n\n            // Stop the algorithm\n            algorithmManager.SetStatus(AlgorithmStatus.Stopped);\n            Log.Trace(\"Program.ExitKeyPress(): Lean instance has been cancelled, shutting down safely now\");\n        }\n\n        public static void Exit(int exitCode)\n        {\n            // The job can be null if the algorithm file was not found\n            if (job != null)\n            {\n                //Delete the message from the job queue:\n                leanEngineSystemHandlers.JobQueue.AcknowledgeJob(job);\n                Log.Trace(\"Engine.Main(): Packet removed from queue: \" + job.AlgorithmId);\n            }\n\n            // clean up resources\n            leanEngineSystemHandlers.DisposeSafely();\n            leanEngineAlgorithmHandlers.DisposeSafely();\n            Log.LogHandler.DisposeSafely();\n            OS.Dispose();\n\n            PythonInitializer.Shutdown();\n\n            Log.Trace(\"Program.Main(): Exiting Lean...\");\n            Environment.Exit(exitCode);\n        }\n    }\n}\n"
  },
  {
    "path": "Launcher/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Lean.Launcher\")]\n[assembly: AssemblyProduct(\"QuantConnect.Lean.Launcher\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"623da639-ab04-4760-8ea4-9585ce4aaecc\")]"
  },
  {
    "path": "Launcher/QuantConnect.Lean.Launcher.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>QuantConnect.Lean.Launcher</RootNamespace>\n    <AssemblyName>QuantConnect.Lean.Launcher</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <ServerGarbageCollection>true</ServerGarbageCollection>\n    <Description>QuantConnect LEAN Engine: Launcher Project - Main startup executable for live and backtesting</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>QuantConnect.Lean.Launcher.Program</StartupObject>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n    <PackageId>QuantConnect.Lean</PackageId>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"DynamicInterop\" Version=\"0.9.1\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm.CSharp\\QuantConnect.Algorithm.CSharp.csproj\" />\n    <ProjectReference Include=\"..\\AlgorithmFactory\\QuantConnect.AlgorithmFactory.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Brokerages\\QuantConnect.Brokerages.csproj\" />\n    <ProjectReference Include=\"..\\Compression\\QuantConnect.Compression.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\DownloaderDataProvider\\QuantConnect.DownloaderDataProvider.Launcher.csproj\" />\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Optimizer.Launcher\\QuantConnect.Optimizer.Launcher.csproj\" />\n    <ProjectReference Include=\"..\\Research\\QuantConnect.Research.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Messaging\\QuantConnect.Messaging.csproj\" />\n    <ProjectReference Include=\"..\\Queues\\QuantConnect.Queues.csproj\" />\n    <ProjectReference Include=\"..\\ToolBox\\QuantConnect.ToolBox.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"config.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Launcher/config.json",
    "content": "{\n  // this configuration file works by first loading all top-level\n  // configuration items and then will load the specified environment\n  // on top, this provides a layering affect. environment names can be\n  // anything, and just require definition in this file. There's\n  // two predefined environments, 'backtesting' and 'live', feel free\n  // to add more!\n\n  \"environment\": \"backtesting\", // \"live-paper\", \"backtesting\", \"live-interactive\", \"live-interactive-iqfeed\"\n\n  // algorithm class selector\n  \"algorithm-type-name\": \"BasicTemplateFrameworkAlgorithm\",\n\n  // Algorithm language selector - options CSharp, Python\n  \"algorithm-language\": \"CSharp\",\n\n  //Physical DLL location\n  \"algorithm-location\": \"QuantConnect.Algorithm.CSharp.dll\",\n  //\"algorithm-location\": \"../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py\",\n\n  //Research notebook\n  //\"composer-dll-directory\": \".\",\n\n  // engine\n  \"data-folder\": \"../../../Data/\",\n\n  // debugging configuration - options for debugging-method LocalCmdLine, VisualStudio, Debugpy, PyCharm\n  \"debugging\": false,\n  \"debugging-method\": \"LocalCmdline\",\n\n  // location of a python virtual env to use libraries from\n  //\"python-venv\": \"/venv\",\n\n  // handlers\n  \"log-handler\": \"QuantConnect.Logging.CompositeLogHandler\",\n  \"messaging-handler\": \"QuantConnect.Messaging.Messaging\",\n  \"job-queue-handler\": \"QuantConnect.Queues.JobQueue\",\n  \"api-handler\": \"QuantConnect.Api.Api\",\n  \"map-file-provider\": \"QuantConnect.Data.Auxiliary.LocalDiskMapFileProvider\",\n  \"factor-file-provider\": \"QuantConnect.Data.Auxiliary.LocalDiskFactorFileProvider\",\n  \"data-provider\": \"QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider\",\n  \"data-channel-provider\": \"DataChannelProvider\",\n  \"object-store\": \"QuantConnect.Lean.Engine.Storage.LocalObjectStore\",\n  \"data-aggregator\": \"QuantConnect.Lean.Engine.DataFeeds.AggregationManager\",\n\n  // limits on number of symbols to allow\n  \"symbol-minute-limit\": 10000,\n  \"symbol-second-limit\": 10000,\n  \"symbol-tick-limit\": 10000,\n\n  // retry lookback periods for automatic security seed history requests\n  \"seed-lookback-period\": 5,\n  \"seed-retry-minute-lookback-period\": 1440,\n  \"seed-retry-hour-lookback-period\": 24,\n  \"seed-retry-daily-lookback-period\": 10,\n\n  // Ignore unknown asset types from brokerages\n  \"ignore-unknown-asset-holdings\": true,\n\n  // The maximum amount of transaction threads for concurrent order submissions if the brokerage supports it.\n  //\"maximum-transaction-threads\": 4,\n\n  // log missing data files, useful for debugging\n  \"show-missing-data-logs\": false,\n\n  // For live trading during warmup we limit the amount of historical data fetched from the history provider and expect the data to be on disk for older data\n  \"maximum-warmup-history-days-look-back\": 5,\n\n  // limits the amount of data points per chart series. Applies only for backtesting\n  \"maximum-data-points-per-chart-series\": 1000000,\n  \"maximum-chart-series\": 30,\n\n  // if one uses true in following token, market hours will remain open all hours and all days.\n  // if one uses false will make lean operate only during regular market hours.\n  \"force-exchange-always-open\": false,\n\n  // save list of transactions to the specified csv file\n  \"transaction-log\": \"\",\n\n  // Prefix for Windows reserved filenames\n  \"reserved-words-prefix\": \"@\",\n\n  // To get your api access token go to quantconnect.com/account\n  \"job-user-id\": \"0\",\n  \"api-access-token\": \"\",\n  \"job-organization-id\": \"\",\n\n  // live data configuration\n  \"live-data-url\": \"ws://www.quantconnect.com/api/v2/live/data/\",\n  \"live-data-port\": 8020,\n\n  // live portfolio state\n  \"live-cash-balance\": \"\",\n  \"live-holdings\": \"[]\",\n\n  // interactive brokers configuration\n  \"ib-account\": \"\",\n  \"ib-user-name\": \"\",\n  \"ib-password\": \"\",\n  \"ib-host\": \"127.0.0.1\",\n  \"ib-port\": \"4002\",\n  \"ib-agent-description\": \"Individual\",\n  \"ib-tws-dir\": \"C:\\\\Jts\",\n  \"ib-trading-mode\": \"paper\",\n  \"ib-enable-delayed-streaming-data\": false,\n  \"ib-weekly-restart-utc-time\": \"22:00:00\",\n  \"ib-financial-advisors-group-filter\": \"\",\n\n  // tradier configuration\n  \"tradier-environment\": \"paper\",\n  \"tradier-account-id\": \"\",\n  \"tradier-access-token\": \"\",\n\n  // oanda configuration\n  \"oanda-environment\": \"Practice\",\n  \"oanda-access-token\": \"\",\n  \"oanda-account-id\": \"\",\n\n  // fxcm configuration\n  \"fxcm-server\": \"http://www.fxcorporate.com/Hosts.jsp\",\n  \"fxcm-terminal\": \"Demo\", //Real or Demo\n  \"fxcm-user-name\": \"\",\n  \"fxcm-password\": \"\",\n  \"fxcm-account-id\": \"\",\n\n  // iqfeed configuration\n  \"iqfeed-host\": \"127.0.0.1\",\n  \"iqfeed-username\": \"\",\n  \"iqfeed-password\": \"\",\n  \"iqfeed-productName\": \"\",\n  \"iqfeed-version\": \"1.0\",\n\n  // coinbase configuration\n  \"coinbase-rest-api\": \"https://api.coinbase.com\",\n  \"coinbase-url\": \"wss://advanced-trade-ws.coinbase.com\",\n  \"coinbase-api-key\": \"\",\n  \"coinbase-api-secret\": \"\",\n\n  // bitfinex configuration\n  \"bitfinex-api-secret\": \"\",\n  \"bitfinex-api-key\": \"\",\n\n  // binance configuration\n  \"binance-api-secret\": \"\",\n  \"binance-api-key\": \"\",\n  // spot/margin\n  \"binance-api-url\": \"https://api.binance.com\",\n  \"binance-websocket-url\": \"wss://stream.binance.com:9443/ws\",\n  \"binance-orders-websocket-url\": \"wss://ws-api.binance.com:9443/ws-api/v3\",\n  // USDT futures\n  \"binance-fapi-url\": \"https://fapi.binance.com\",\n  \"binance-fwebsocket-url\": \"wss://fstream.binance.com/ws\",\n  // Coin futures\n  \"binance-dapi-url\": \"https://dapi.binance.com\",\n  \"binance-dwebsocket-url\": \"wss://dstream.binance.com/ws\",\n\n  // binance.us configuration\n  \"binanceus-api-secret\": \"\",\n  \"binanceus-api-key\": \"\",\n  \"binanceus-api-url\": \"https://api.binance.us\",\n  \"binanceus-websocket-url\": \"wss://stream.binance.us:9443/ws\",\n\n\n  // bybit configuration\n  \"bybit-api-secret\": \"\",\n  \"bybit-api-key\": \"\",\n  \"bybit-api-url\": \"https://api.bybit.com\",\n  \"bybit-websocket-url\": \"wss://stream.bybit.com\",\n\n  // dydx configuration\n  //\"dydx-mnemonic\": \"\",\n  \"dydx-private-key-hex\": \"\",\n  \"dydx-address\": \"\",\n  \"dydx-subaccount-number\": 0,\n\n  \"dydx-node-api-rest\": \"https://dydx-ops-rest.kingnodes.com\",\n  \"dydx-node-api-grpc\": \"https://dydx-ops-grpc.kingnodes.com:443\",\n  \"dydx-indexer-api-rest\": \"https://indexer.dydx.trade/v4\",\n  \"dydx-indexer-api-wss\": \"wss://indexer.dydx.trade/v4/ws\",\n  \"dydx-chain-id\": \"dydx-mainnet-1\",\n\n  // Eze configuration\n  \"eze-api-address-url\": \"\",\n  \"eze-port\": \"\",\n  \"eze-domain\": \"\",\n  \"eze-locale\": \"\",\n  \"eze-password\": \"\",\n  \"eze-user-name\": \"\",\n  \"eze-trading-route\": \"\",\n  \"eze-trading-account\": \"\",\n\n  // kraken configuration\n  \"kraken-api-secret\": \"\",\n  \"kraken-api-key\": \"\",\n  \"kraken-verification-tier\": \"Starter\", // Starter, Intermediate, Pro\n\n  // wolverine configuration\n  \"wolverine-host\": \"\",\n  \"wolverine-port\": \"\",\n  \"wolverine-account\": \"\",\n  \"wolverine-sender-comp-id\": \"\",\n  \"wolverine-target-comp-id\": \"\",\n  \"wolverine-on-behalf-of-comp-id\": \"\",\n  \"wolverine-log-fix-messages\": false,\n\n  // RBI configuration\n  \"rbi-host\": \"\",\n  \"rbi-port\": \"\",\n  \"rbi-account\": \"\",\n  \"rbi-sender-comp-id\": \"\",\n  \"rbi-target-comp-id\": \"\",\n  \"rbi-on-behalf-of-comp-id\": \"\",\n  \"rbi-log-fix-messages\": false,\n\n  // Trading Technologies configuration\n  \"tt-user-name\": \"\",\n  \"tt-session-password\": \"\",\n  \"tt-account-name\": \"\",\n  \"tt-rest-app-key\": \"\",\n  \"tt-rest-app-secret\": \"\",\n  \"tt-rest-environment\": \"\",\n  \"tt-market-data-sender-comp-id\": \"\",\n  \"tt-market-data-target-comp-id\": \"\",\n  \"tt-market-data-host\": \"\",\n  \"tt-market-data-port\": \"\",\n  \"tt-order-routing-sender-comp-id\": \"\",\n  \"tt-order-routing-target-comp-id\": \"\",\n  \"tt-order-routing-host\": \"\",\n  \"tt-order-routing-port\": \"\",\n  \"tt-log-fix-messages\": false,\n\n  // Trade Station configuration\n  \"trade-station-client-id\": \"\",\n  \"trade-station-client-secret\": \"\",\n  \"trade-station-redirect-url\": \"http://localhost\",\n  \"trade-station-refresh-token\": \"\",\n  \"trade-station-api-url\": \"https://sim-api.tradestation.com\",\n  \"trade-station-account-type\": \"Cash|Margin|Futures\",\n  \"trade-station-account-id\": \"\",\n\n  // Alpaca configuration\n  \"alpaca-api-key\": \"\",\n  \"alpaca-api-secret\": \"\",\n  \"alpaca-access-token\": \"\",\n  \"alpaca-paper-trading\": true,\n\n  // Charles Schwab configuration\n  \"charles-schwab-api-url\": \"https://api.schwabapi.com\",\n  \"charles-schwab-app-key\": \"\",\n  \"charles-schwab-secret\": \"\",\n  \"charles-schwab-account-number\": \"\",\n  // Case 1 (normal)\n  \"charles-schwab-refresh-token\": \"\",\n  // Case 2 (developing)\n  \"charles-schwab-authorization-code-from-url\": \"\",\n  \"charles-schwab-redirect-url\": \"\",\n\n  // Tastytrade configuration\n  \"tastytrade-api-url\": \"\",\n  \"tastytrade-websocket-url\": \"\",\n  \"tastytrade-username\": \"\",\n  \"tastytrade-password\": \"\",\n  \"tastytrade-account-number\": \"\",\n\n  // Exante trading configuration\n  // client-id, application-id, shared-key are required to access Exante REST API\n  // Exante generates them at https://exante.eu/clientsarea/dashboard/ after adding an application\n  \"exante-client-id\": \"\",\n  \"exante-application-id\": \"\",\n  \"exante-shared-key\": \"\",\n  \"exante-account-id\": \"\", // Account-id is assigned after registration at Exante\n  \"exante-platform-type\": \"\", // Environment of the application: live or demo\n\n  // Required to access data from Nasdaq\n  // To get your access token go to https://data.nasdaq.com/account/profile\n  \"nasdaq-auth-token\": \"\",\n\n  // Required to access data from Tiingo\n  // To get your access token go to https://www.tiingo.com\n  \"tiingo-auth-token\": \"\",\n\n  // Required to access data from US Energy Information Administration\n  // To get your access token go to https://www.eia.gov/opendata\n  \"us-energy-information-auth-token\": \"\",\n\n  // Required for IEX history requests\n  \"iex-cloud-api-key\": \"\",\n\n  // Required for market data from Coin API\n  \"coinapi-api-key\": \"\",\n  \"coinapi-product\": \"free\", // free, startup, streamer, professional, enterprise\n\n  // Required for streaming Polygon.io data\n  // To get your access token go to https://polygon.io\n  \"polygon-api-key\": \"\",\n\n  // zerodha configuration goto https://kite.trade\n  \"zerodha-access-token\": \"\",\n  \"zerodha-api-key\": \"\",\n  \"zerodha-product-type\": \"MIS\", //MIS(Intraday) or CNC(Delivery) or NRML(Carry Forward)\n  \"zerodha-trading-segment\": \"EQUITY\", // EQUITY(NSE,BSE) or COMMODITY (MCX)\n  \"zerodha-history-subscription\": \"false\", // \"true\" if History API Subscription available\n\n  //samco configuration go to https://www.samco.in/stocknote-api\n  \"samco-client-id\": \"\",\n  \"samco-client-password\": \"\",\n  \"samco-year-of-birth\": \"\",\n  \"samco-product-type\": \"MIS\", //MIS(Intraday) or CNC(Delivery) or NRML(Carry Forward)\n  \"samco-trading-segment\": \"EQUITY\", // EQUITY(NSE,BSE) or COMMODITY (MCX)\n\n  // FTX configuration\n  \"ftx-account-tier\": \"Tier1\", // accept \"Tier1\", \"Tier2\", \"Tier3\", \"Tier4\", \"Tier5\", \"Tier6\", \"VIP1\", \"VIP2\", \"VIP3\", \"MM1\", \"MM2\", \"MM3\"\n  \"ftx-api-secret\": \"\",\n  \"ftx-api-key\": \"\",\n\n  // FTX.US configuration\n  \"ftxus-account-tier\": \"Tier1\", // accept \"Tier1\", \"Tier2\", \"Tier3\", \"Tier4\", \"Tier5\", \"Tier6\", \"Tier7\", \"Tier8\", \"Tier9\", \"VIP1\", \"VIP2\", \"MM1\", \"MM2\", \"MM3\"\n  \"ftxus-api-secret\": \"\",\n  \"ftxus-api-key\": \"\",\n\n  // parameters to set in the algorithm (the below are just samples)\n  \"parameters\": {\n    // Intrinio account user and password\n    \"intrinio-username\": \"\",\n    \"intrinio-password\": \"\",\n\n    \"ema-fast\": 10,\n    \"ema-slow\": 20\n  },\n\n  // specify supported languages when running regression tests\n  \"regression-test-languages\": [ \"CSharp\", \"Python\" ],\n\n  // Additional paths to include in python for import resolution\n  \"python-additional-paths\": [],\n\n  \"environments\": {\n\n    // defines the 'backtesting' environment\n    \"backtesting\": {\n      \"live-mode\": false,\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.BacktestingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler\",\n      \"history-provider\": [ \"QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider\" ],\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler\"\n    },\n\n    // defines the 'live-paper' environment\n    \"live-paper\": {\n      \"live-mode\": true,\n\n      // the paper brokerage requires the BacktestingTransactionHandler\n      \"live-mode-brokerage\": \"PaperBrokerage\",\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"data-queue-handler\": [ \"QuantConnect.Lean.Engine.DataFeeds.Queues.LiveDataQueue\" ],\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler\"\n    },\n\n    // defines 'live-zerodha' environment\n    \"live-zerodha\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"ZerodhaBrokerage\",\n      \"data-queue-handler\": [ \"ZerodhaBrokerage\" ],\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines 'live-samco' environment\n    \"live-samco\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"SamcoBrokerage\",\n      \"data-queue-handler\": [ \"SamcoBrokerage\" ],\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-tradier' environment\n    \"live-tradier\": {\n      \"live-mode\": true,\n\n      // this setting will save tradier access/refresh tokens to a tradier-tokens.txt file\n      // that can be read in next time, this makes it easier to start/stop a tradier algorithm\n      \"tradier-save-tokens\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"TradierBrokerage\",\n      \"data-queue-handler\": [ \"TradierBrokerage\" ],\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-interactive' environment\n    \"live-interactive\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"InteractiveBrokersBrokerage\",\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"data-queue-handler\": [ \"InteractiveBrokersBrokerage\" ],\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-interactive-iqfeed' environment\n    \"live-interactive-iqfeed\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"InteractiveBrokersBrokerage\",\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"data-queue-handler\": [ \"QuantConnect.IQFeed.IQFeedDataQueueHandler\" ],\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"QuantConnect.IQFeed.IQFeedDataQueueHandler\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-fxcm' environment\n    \"live-fxcm\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"FxcmBrokerage\",\n      \"data-queue-handler\": [ \"FxcmBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-oanda' environment\n    \"live-oanda\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"OandaBrokerage\",\n      \"data-queue-handler\": [ \"OandaBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-coinbase\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"CoinbaseBrokerage\",\n      \"data-queue-handler\": [ \"CoinbaseBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-bitfinex\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BitfinexBrokerage\",\n      \"data-queue-handler\": [ \"BitfinexBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-binance\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BinanceBrokerage\",\n      \"data-queue-handler\": [ \"BinanceBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-futures-binance\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BinanceFuturesBrokerage\",\n      \"data-queue-handler\": [ \"BinanceFuturesBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-coin-futures-binance\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BinanceCoinFuturesBrokerage\",\n      \"data-queue-handler\": [ \"BinanceCoinFuturesBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-binanceus\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BinanceUSBrokerage\",\n      \"data-queue-handler\": [ \"BinanceUSBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-bybit\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BybitBrokerage\",\n      \"data-queue-handler\": [ \"BybitBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-trade-station\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"TradeStationBrokerage\",\n      \"data-queue-handler\": [ \"TradeStationBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-alpaca\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"AlpacaBrokerage\",\n      \"data-queue-handler\": [ \"AlpacaBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-futures-bybit\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"BybitFuturesBrokerage\",\n      \"data-queue-handler\": [ \"BybitFuturesBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-trading-technologies' environment\n    \"live-trading-technologies\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"TradingTechnologiesBrokerage\",\n      \"data-queue-handler\": [ \"TradingTechnologiesBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\"\n    },\n\n    // defines the 'live-kraken' environment\n    \"live-kraken\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"KrakenBrokerage\",\n      \"data-queue-handler\": [ \"KrakenBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-ftx' environment\n    \"live-ftx\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"QuantConnect.FTXBrokerage.FTXBrokerage\",\n      \"data-queue-handler\": [ \"QuantConnect.FTXBrokerage.FTXBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-exante\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"QuantConnect.ExanteBrokerage.ExanteBrokerage\",\n      \"data-queue-handler\": [ \"QuantConnect.ExanteBrokerage.ExanteBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": \"BrokerageHistoryProvider\"\n    },\n\n    // defines the 'live-ftxus' environment\n    \"live-ftxus\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"QuantConnect.FTXBrokerage.FTXUSBrokerage\",\n      \"data-queue-handler\": [ \"QuantConnect.FTXBrokerage.FTXUSBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-wolverine\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"WolverineBrokerage\",\n      \"history-provider\": [ \"SubscriptionDataReaderHistoryProvider\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\"\n    },\n\n    \"live-charlesschwab\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"CharlesSchwabBrokerage\",\n      \"data-queue-handler\": [ \"CharlesSchwabBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-tastytrade\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"TastytradeBrokerage\",\n      \"data-queue-handler\": [ \"TastytradeBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    \"live-rbi\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"RBIBrokerage\",\n      \"data-queue-handler\": [ \"QuantConnect.Lean.Engine.DataFeeds.Queues.LiveDataQueue\" ],\n      \"history-provider\": [ \"SubscriptionDataReaderHistoryProvider\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\"\n    },\n\n    // defines the 'live-eze' environment\n    \"live-eze\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"QuantConnect.EzeBrokerage.EzeBrokerage\",\n      \"data-queue-handler\": [ \"QuantConnect.EzeBrokerage.EzeBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    },\n\n    // defines the 'live-dydx' environment\n    \"live-dydx\": {\n      \"live-mode\": true,\n\n      // real brokerage implementations require the BrokerageTransactionHandler\n      \"live-mode-brokerage\": \"dYdXBrokerage\",\n      \"data-queue-handler\": [ \"dYdXBrokerage\" ],\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.LiveTradingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler\",\n      \"history-provider\": [ \"BrokerageHistoryProvider\", \"SubscriptionDataReaderHistoryProvider\" ]\n    }\n  }\n}"
  },
  {
    "path": "LocalPackages/readme.md",
    "content": "# LocalPackages Directory\n\nThis directory of the repo is used for testing new package deployment in production without needing to publish the package before it is ready.\n\nPlacing any `.nupkg` files in this directory and using `nuget restore .\\QuantConnect.Lean.sln` will allow any packages in this directory to be picked up and used by Lean as a dependency. \n\n\n#### Note: \n\n- `dotnet build` will **not** use this `LocalPackages` source, unless you add it to its sources like so: \n\n``` \ndotnet nuget add source *PathToLeanHere*/LocalPackages\n```\n- Using `nuget restore` works without adding the source because it will pick up on the file `.nuget/NuGet.Config` which defines this source."
  },
  {
    "path": "Logging/CompositeLogHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Provides an <see cref=\"ILogHandler\"/> implementation that composes multiple handlers\n    /// </summary>\n    public class CompositeLogHandler : ILogHandler\n    {\n        private readonly ILogHandler[] _handlers;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeLogHandler\"/> that pipes log messages to the console and log.txt\n        /// </summary>\n        public CompositeLogHandler()\n            : this(new ConsoleLogHandler(), new FileLogHandler())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CompositeLogHandler\"/> class from the specified handlers\n        /// </summary>\n        /// <param name=\"handlers\">The implementations to compose</param>\n        public CompositeLogHandler(params ILogHandler[] handlers)\n        {\n            if (handlers == null || handlers.Length == 0)\n            {\n                throw new ArgumentNullException(nameof(handlers));\n            }\n\n            _handlers = handlers;\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\"></param>\n        public void Error(string text)\n        {\n            foreach (var handler in _handlers)\n            {\n                handler.Error(text);\n            }\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\"></param>\n        public void Debug(string text)\n        {\n            foreach (var handler in _handlers)\n            {\n                handler.Debug(text);\n            }\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\"></param>\n        public void Trace(string text)\n        {\n            foreach (var handler in _handlers)\n            {\n                handler.Trace(text);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            foreach (var handler in _handlers)\n            {\n                handler.Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Logging/ConsoleErrorLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Subclass of ConsoleLogHandler that only logs error messages\n    /// </summary>\n    public class ConsoleErrorLogHandler : ConsoleLogHandler\n    {\n        /// <summary>\n        /// Hide debug messages from log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public override void Debug(string text)\n        {\n        }\n\n        /// <summary>\n        /// Hide trace messages from log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public override void Trace(string text)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Logging/ConsoleLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// ILogHandler implementation that writes log output to console.\n    /// </summary>\n    public class ConsoleLogHandler : ILogHandler\n    {\n        private const string DefaultDateFormat = \"yyyyMMdd HH:mm:ss.fff\";\n        private readonly TextWriter _trace;\n        private readonly TextWriter _error;\n        private readonly string _dateFormat;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Logging.ConsoleLogHandler\"/> class.\n        /// </summary>\n        public ConsoleLogHandler()\n            : this(DefaultDateFormat)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Logging.ConsoleLogHandler\"/> class.\n        /// </summary>\n        /// <param name=\"dateFormat\">Specifies the date format to use when writing log messages to the console window</param>\n        public ConsoleLogHandler(string dateFormat = DefaultDateFormat)\n        {\n            // saves references to the real console text writer since in a deployed state we may overwrite this in order\n            // to redirect messages from algorithm to result handler\n            _trace = Console.Out;\n            _error = Console.Error;\n            _dateFormat = dateFormat;\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        public virtual void Error(string text)\n        {\n#if DEBUG\n            Console.ForegroundColor = ConsoleColor.Red;\n#endif\n            _error.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} ERROR:: {text}\");\n#if DEBUG\n            Console.ResetColor();\n#endif\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public virtual void Debug(string text)\n        {\n            _trace.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} DEBUG:: {text}\");\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public virtual void Trace(string text)\n        {\n            _trace.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} TRACE:: {text}\");\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n    }\n}"
  },
  {
    "path": "Logging/FileLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ILogHandler\"/> that writes all log messages to a file on disk.\n    /// </summary>\n    public class FileLogHandler : ILogHandler\n    {\n        private bool _disposed;\n\n        // we need to control synchronization to our stream writer since it's not inherently thread-safe\n        private readonly object _lock = new object();\n        private readonly Lazy<TextWriter> _writer;\n        private readonly bool _useTimestampPrefix;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FileLogHandler\"/> class to write messages to the specified file path.\n        /// The file will be opened using <see cref=\"FileMode.Append\"/>\n        /// </summary>\n        /// <param name=\"filepath\">The file path use to save the log messages</param>\n        /// <param name=\"useTimestampPrefix\">True to prefix each line in the log which the UTC timestamp, false otherwise</param>\n        public FileLogHandler(string filepath, bool useTimestampPrefix = true)\n        {\n            _useTimestampPrefix = useTimestampPrefix;\n            _writer = new Lazy<TextWriter>(\n                () => new StreamWriter(File.Open(filepath, FileMode.Append, FileAccess.Write, FileShare.Read))\n                );\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FileLogHandler\"/> class using 'log.txt' for the filepath.\n        /// </summary>\n        public FileLogHandler()\n            : this(Log.FilePath)\n        {\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        public void Error(string text)\n        {\n            WriteMessage(text, \"ERROR\");\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public void Debug(string text)\n        {\n            WriteMessage(text, \"DEBUG\");\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public void Trace(string text)\n        {\n            WriteMessage(text, \"TRACE\");\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            lock (_lock)\n            {\n                if (_writer.IsValueCreated)\n                {\n                    _disposed = true;\n                    _writer.Value.Dispose();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates the message to be logged\n        /// </summary>\n        /// <param name=\"text\">The text to be logged</param>\n        /// <param name=\"level\">The logging leel</param>\n        /// <returns></returns>\n        protected virtual string CreateMessage(string text, string level)\n        {\n            if (_useTimestampPrefix)\n            {\n                return $\"{DateTime.UtcNow.ToString(\"o\", CultureInfo.InvariantCulture)} {level}:: {text}\";\n            }\n            return $\"{level}:: {text}\";\n        }\n\n        /// <summary>\n        /// Writes the message to the writer\n        /// </summary>\n        private void WriteMessage(string text, string level)\n        {\n            var message = CreateMessage(text, level);\n            lock (_lock)\n            {\n                if (_disposed) return;\n                _writer.Value.WriteLine(message);\n                _writer.Value.Flush();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Logging/FunctionalLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\nusing System.Globalization;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// ILogHandler implementation that writes log output to result handler\n    /// </summary>\n    [PartNotDiscoverable]\n    public class FunctionalLogHandler : ILogHandler\n    {\n        private const string DateFormat = \"yyyyMMdd HH:mm:ss\";\n        private readonly Action<string> _debug;\n        private readonly Action<string> _trace;\n        private readonly Action<string> _error;\n\n        /// <summary>\n        /// Default constructor to handle MEF.\n        /// </summary>\n        public FunctionalLogHandler()\n        {\n\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QuantConnect.Logging.FunctionalLogHandler\"/> class.\n        /// </summary>\n        public FunctionalLogHandler(Action<string> debug, Action<string> trace, Action<string> error)\n        {\n            // saves references to the real console text writer since in a deployed state we may overwrite this in order\n            // to redirect messages from algorithm to result handler\n            _debug = debug;\n            _trace = trace;\n            _error = error;\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        public void Error(string text)\n        {\n            if (_error != null)\n            {\n                _error(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" ERROR \" + text);\n            }\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public void Debug(string text)\n        {\n            if (_debug != null)\n            {\n                _debug(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" DEBUG \" + text);\n            }\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public void Trace(string text)\n        {\n            if (_trace != null)\n            {\n                _trace(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" TRACE \" + text);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n    }\n}"
  },
  {
    "path": "Logging/ILogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.ComponentModel.Composition;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Interface for redirecting log output\n    /// </summary>\n    [InheritedExport(typeof(ILogHandler))]\n    public interface ILogHandler : IDisposable\n    {\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        void Error(string text);\n       \n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        void Debug(string text);\n       \n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        void Trace(string text);\n    }\n}"
  },
  {
    "path": "Logging/ILogHandlerExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Logging extensions.\n    /// </summary>\n    public static class LogHandlerExtensions\n    {\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"logHandler\"></param>\n        /// <param name=\"text\">Message</param>\n        /// <param name=\"args\">Arguments to format.</param>\n        public static void Error(this ILogHandler logHandler, string text, params object[] args)\n        {\n            if (logHandler == null)\n            {\n                throw new ArgumentNullException(nameof(logHandler), \"Log Handler cannot be null\");\n            }\n\n            logHandler.Error(string.Format(CultureInfo.InvariantCulture, text, args));\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"logHandler\"></param>\n        /// <param name=\"text\">Message</param>\n        /// <param name=\"args\">Arguments to format.</param>\n        public static void Debug(this ILogHandler logHandler, string text, params object[] args)\n        {\n            if (logHandler == null)\n            {\n                throw new ArgumentNullException(nameof(logHandler), \"Log Handler cannot be null\");\n            }\n\n            logHandler.Debug(string.Format(CultureInfo.InvariantCulture, text, args));\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"logHandler\"></param>\n        /// <param name=\"text\">Message</param>\n        /// <param name=\"args\">Arguments to format.</param>\n        public static void Trace(this ILogHandler logHandler, string text, params object[] args)\n        {\n            if (logHandler == null)\n            {\n                throw new ArgumentNullException(nameof(logHandler), \"Log Handler cannot be null\");\n            }\n\n            logHandler.Trace(string.Format(CultureInfo.InvariantCulture, text, args));\n        }\n    }\n}\n"
  },
  {
    "path": "Logging/Log.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Logging management class.\n    /// </summary>\n    public static class Log\n    {\n        private static readonly Regex LeanPathRegex = new Regex(\"(?:\\\\S*?\\\\\\\\pythonnet\\\\\\\\)|(?:\\\\S*?\\\\\\\\Lean\\\\\\\\)|(?:\\\\S*?/Lean/)|(?:\\\\S*?/pythonnet/)\", RegexOptions.Compiled);\n        private static string _lastTraceText = \"\";\n        private static string _lastErrorText = \"\";\n        private static bool _debuggingEnabled;\n        private static int _level = 1;\n        private static ILogHandler _logHandler = new ConsoleLogHandler();\n\n        /// <summary>\n        /// Gets or sets the ILogHandler instance used as the global logging implementation.\n        /// </summary>\n        public static ILogHandler LogHandler\n        {\n            get { return _logHandler; }\n            set { _logHandler = value; }\n        }\n\n        /// <summary>\n        /// Global flag whether to enable debugging logging:\n        /// </summary>\n        public static bool DebuggingEnabled\n        {\n            get { return _debuggingEnabled; }\n            set { _debuggingEnabled = value; }\n        }\n\n        /// <summary>\n        /// Global flag to specify file based log path\n        /// </summary>\n        /// <remarks>Only valid for file based loggers</remarks>\n        public static string FilePath { get; set; } = \"log.txt\";\n\n        /// <summary>\n        /// Set the minimum message level:\n        /// </summary>\n        public static int DebuggingLevel\n        {\n            get { return _level; }\n            set { _level = value; }\n        }\n\n        /// <summary>\n        /// Log error\n        /// </summary>\n        /// <param name=\"error\">String Error</param>\n        /// <param name=\"overrideMessageFloodProtection\">Force sending a message, overriding the \"do not flood\" directive</param>\n        public static void Error(string error, bool overrideMessageFloodProtection = false)\n        {\n            try\n            {\n                if (error == _lastErrorText && !overrideMessageFloodProtection) return;\n                _logHandler.Error(error);\n                _lastErrorText = error; //Stop message flooding filling diskspace.\n            }\n            catch (Exception err)\n            {\n                Console.WriteLine(\"Log.Error(): Error writing error: \" + err.Message);\n            }\n        }\n\n        /// <summary>\n        /// Log error. This overload is usefull when exceptions are being thrown from within an anonymous function.\n        /// </summary>\n        /// <param name=\"method\">The method identifier to be used</param>\n        /// <param name=\"exception\">The exception to be logged</param>\n        /// <param name=\"message\">An optional message to be logged, if null/whitespace the messge text will be extracted</param>\n        /// <param name=\"overrideMessageFloodProtection\">Force sending a message, overriding the \"do not flood\" directive</param>\n        private static void Error(string method, Exception exception, string message = null, bool overrideMessageFloodProtection = false)\n        {\n            message = method + \"(): \" + (message ?? string.Empty) + \" \" + ClearLeanPaths(exception?.ToString());\n            Error(message, overrideMessageFloodProtection);\n        }\n\n        /// <summary>\n        /// Log error\n        /// </summary>\n        /// <param name=\"exception\">The exception to be logged</param>\n        /// <param name=\"message\">An optional message to be logged, if null/whitespace the messge text will be extracted</param>\n        /// <param name=\"overrideMessageFloodProtection\">Force sending a message, overriding the \"do not flood\" directive</param>\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        public static void Error(Exception exception, string message = null, bool overrideMessageFloodProtection = false)\n        {\n            Error(WhoCalledMe.GetMethodName(1), exception, message, overrideMessageFloodProtection);\n        }\n\n        /// <summary>\n        /// Log trace\n        /// </summary>\n        public static void Trace(string traceText, bool overrideMessageFloodProtection = false)\n        {\n            try\n            {\n                if (traceText == _lastTraceText && !overrideMessageFloodProtection) return;\n                _logHandler.Trace(traceText);\n                _lastTraceText = traceText;\n            }\n            catch (Exception err)\n            {\n                Console.WriteLine(\"Log.Trace(): Error writing trace: \"  +err.Message);\n            }\n        }\n\n        /// <summary>\n        /// Writes the message in normal text\n        /// </summary>\n        public static void Trace(string format, params object[] args)\n        {\n            Trace(string.Format(CultureInfo.InvariantCulture, format, args));\n        }\n\n        /// <summary>\n        /// Writes the message in red\n        /// </summary>\n        public static void Error(string format, params object[] args)\n        {\n            Error(string.Format(CultureInfo.InvariantCulture, format, args));\n        }\n\n        /// <summary>\n        /// Output to the console\n        /// </summary>\n        /// <param name=\"text\">The message to show</param>\n        /// <param name=\"level\">debug level</param>\n        public static void Debug(string text, int level = 1)\n        {\n            try\n            {\n                if (!_debuggingEnabled || level < _level) return;\n                _logHandler.Debug(text);\n            }\n            catch (Exception err)\n            {\n                Console.WriteLine(\"Log.Debug(): Error writing debug: \" + err.Message);\n            }\n        }\n\n        /// <summary>\n        /// C# Equivalent of Print_r in PHP:\n        /// </summary>\n        /// <param name=\"obj\"></param>\n        /// <param name=\"recursion\"></param>\n        /// <returns></returns>\n        public static string VarDump(object obj, int recursion = 0)\n        {\n            var result = new StringBuilder();\n\n            // Protect the method against endless recursion\n            if (recursion < 5)\n            {\n                // Determine object type\n                var t = obj.GetType();\n\n                // Get array with properties for this object\n                var properties = t.GetProperties();\n\n                foreach (var property in properties)\n                {\n                    try\n                    {\n                        // Get the property value\n                        var value = property.GetValue(obj, null);\n\n                        // Create indenting string to put in front of properties of a deeper level\n                        // We'll need this when we display the property name and value\n                        var indent = String.Empty;\n                        var spaces = \"|   \";\n                        var trail = \"|...\";\n\n                        if (recursion > 0)\n                        {\n                            indent = new StringBuilder(trail).Insert(0, spaces, recursion - 1).ToString();\n                        }\n\n                        if (value != null)\n                        {\n                            // If the value is a string, add quotation marks\n                            var displayValue = value.ToString();\n                            if (value is string) displayValue = String.Concat('\"', displayValue, '\"');\n\n                            // Add property name and value to return string\n                            result.AppendFormat(CultureInfo.InvariantCulture, \"{0}{1} = {2}\\n\", indent, property.Name, displayValue);\n\n                            try\n                            {\n                                if (!(value is ICollection))\n                                {\n                                    // Call var_dump() again to list child properties\n                                    // This throws an exception if the current property value\n                                    // is of an unsupported type (eg. it has not properties)\n                                    result.Append(VarDump(value, recursion + 1));\n                                }\n                                else\n                                {\n                                    // 2009-07-29: added support for collections\n                                    // The value is a collection (eg. it's an arraylist or generic list)\n                                    // so loop through its elements and dump their properties\n                                    var elementCount = 0;\n                                    foreach (var element in ((ICollection)value))\n                                    {\n                                        var elementName = $\"{property.Name}[{elementCount}]\";\n                                        indent = new StringBuilder(trail).Insert(0, spaces, recursion).ToString();\n\n                                        // Display the collection element name and type\n                                        result.AppendFormat(CultureInfo.InvariantCulture, \"{0}{1} = {2}\\n\", indent, elementName, element.ToString());\n\n                                        // Display the child properties\n                                        result.Append(VarDump(element, recursion + 2));\n                                        elementCount++;\n                                    }\n\n                                    result.Append(VarDump(value, recursion + 1));\n                                }\n                            } catch { }\n                        }\n                        else\n                        {\n                            // Add empty (null) property to return string\n                            result.AppendFormat(CultureInfo.InvariantCulture, \"{0}{1} = {2}\\n\", indent, property.Name, \"null\");\n                        }\n                    }\n                    catch\n                    {\n                        // Some properties will throw an exception on property.GetValue()\n                        // I don't know exactly why this happens, so for now i will ignore them...\n                    }\n                }\n            }\n\n            return result.ToString();\n        }\n\n        /// <summary>\n        /// Helper method to clear undesired paths from stack traces\n        /// </summary>\n        /// <param name=\"error\">The error to cleanup</param>\n        /// <returns>The sanitized error</returns>\n        public static string ClearLeanPaths(string error)\n        {\n            if (string.IsNullOrEmpty(error))\n            {\n                return error;\n            }\n            return LeanPathRegex.Replace(error, string.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "Logging/LogEntry.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Log entry wrapper to make logging simpler:\n    /// </summary>\n    public class LogEntry\n    {\n        /// <summary>\n        /// Time of the log entry\n        /// </summary>\n        public DateTime Time { get; set; }\n\n        /// <summary>\n        /// Message of the log entry\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Descriptor of the message type.\n        /// </summary>\n        public LogType MessageType { get; set; }\n\n        /// <summary>\n        /// Create a default log message with the current time.\n        /// </summary>\n        /// <param name=\"message\"></param>\n        public LogEntry(string message)\n        {\n            Time = DateTime.UtcNow;\n            Message = message;\n            MessageType = LogType.Trace;\n        }\n\n        /// <summary>\n        /// Create a log entry at a specific time in the analysis (for a backtest).\n        /// </summary>\n        /// <param name=\"message\">Message for log</param>\n        /// <param name=\"time\">Utc time of the message</param>\n        /// <param name=\"type\">Type of the log entry</param>\n        public LogEntry(string message, DateTime time, LogType type = LogType.Trace)\n        {\n            Time = time;\n            Message = message;\n            MessageType = type;\n        }\n\n        /// <summary>\n        /// Helper override on the log entry.\n        /// </summary>\n        /// <returns></returns>\n        public override string ToString()\n        {\n            return $\"{Time.ToString(\"o\", CultureInfo.InvariantCulture)} {MessageType} {Message}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Logging/LogType.cs",
    "content": "﻿\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Error level\n    /// </summary>\n    public enum LogType\n    {\n        /// <summary>\n        /// Debug log level\n        /// </summary>\n        Debug,\n        /// <summary>\n        /// Trace log level\n        /// </summary>\n        Trace,\n        /// <summary>\n        /// Error log level\n        /// </summary>\n        Error\n    }\n}\n"
  },
  {
    "path": "Logging/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Logging\")]\n[assembly: AssemblyProduct(\"QuantConnect.Logging\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"687f62a5-f512-459a-9d66-64815d62a790\")]"
  },
  {
    "path": "Logging/QuantConnect.Logging.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Logging</RootNamespace>\n    <AssemblyName>QuantConnect.Logging</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <RestorePackages>true</RestorePackages>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Logging.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Logging Project - The logging library implementation</Description>\n    <NoWarn>CA1062</NoWarn>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' AND '$(SelectedOptimization)' == ''\">\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"System.ComponentModel.Composition\" Version=\"6.0.0\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Logging/QueueLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Globalization;\nusing System.IO;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// ILogHandler implementation that queues all logs and writes them when instructed.\n    /// </summary>\n    public class QueueLogHandler : ILogHandler\n    {\n        private readonly ConcurrentQueue<LogEntry> _logs;\n        private const string DateFormat = \"yyyyMMdd HH:mm:ss\";\n        private readonly TextWriter _trace;\n        private readonly TextWriter _error;\n\n        /// <summary>\n        /// Public access to the queue for log processing.\n        /// </summary>\n        public ConcurrentQueue<LogEntry> Logs\n        {\n            get { return _logs; }\n        }\n\n        /// <summary>\n        /// LOgging event delegate\n        /// </summary>\n        public delegate void LogEventRaised(LogEntry log);\n\n        /// <summary>\n        /// Logging Event Handler\n        /// </summary>\n        public event LogEventRaised LogEvent;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"QueueLogHandler\"/> class.\n        /// </summary>\n        public QueueLogHandler()\n        {\n            _logs = new ConcurrentQueue<LogEntry>();\n            _trace = Console.Out;\n            _error = Console.Error;\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        public void Error(string text)\n        {\n            var log = new LogEntry(text, DateTime.UtcNow, LogType.Error);\n            _logs.Enqueue(log);\n            OnLogEvent(log);\n\n            Console.ForegroundColor = ConsoleColor.Red;\n            _error.WriteLine(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" Error:: \" + text);\n            Console.ResetColor();\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public void Debug(string text)\n        {\n            var log = new LogEntry(text, DateTime.UtcNow, LogType.Debug);\n            _logs.Enqueue(log);\n            OnLogEvent(log);\n\n            _trace.WriteLine(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" Debug:: \" + text);\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public void Trace(string text)\n        {\n            var log = new LogEntry(text, DateTime.UtcNow, LogType.Trace);\n            _logs.Enqueue(log);\n            OnLogEvent(log);\n\n            _trace.WriteLine(DateTime.Now.ToString(DateFormat, CultureInfo.InvariantCulture) + \" Trace:: \" + text);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n\n        /// <summary>\n        /// Raise a log event safely\n        /// </summary>\n        protected virtual void OnLogEvent(LogEntry log)\n        {\n            var handler = LogEvent;\n\n            if (handler != null)\n            {\n                handler(log);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Logging/RegressionFileLogHandler.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"ILogHandler\"/> that writes all log messages to a file on disk\n    /// without timestamps.\n    /// </summary>\n    /// <remarks>\n    /// This type is provided for convenience/setting from configuration\n    /// </remarks>\n    public class RegressionFileLogHandler : FileLogHandler\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegressionFileLogHandler\"/> class\n        /// that will write to a 'regression.log' file in the executing directory\n        /// </summary>\n        public RegressionFileLogHandler()\n            : base(\"regression.log\", false)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Logging/WhoCalledMe.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\n\nnamespace QuantConnect.Logging\n{\n    /// <summary>\n    /// Provides methods for determining higher stack frames\n    /// </summary>\n    public static class WhoCalledMe\n    {\n        /// <summary>\n        /// Gets the method name of the caller\n        /// </summary>\n        /// <param name=\"frame\">The number of stack frames to retrace from the caller's position</param>\n        /// <returns>The method name of the containing scope 'frame' stack frames above the caller</returns>\n        [MethodImpl(MethodImplOptions.NoInlining)] // inlining messes this up pretty badly\n        public static string GetMethodName(int frame = 1)\n        {\n            // we need to increment the frame to account for this method\n            var methodBase = new StackFrame(frame + 1).GetMethod();\n            var declaringType = methodBase.DeclaringType;\n            return declaringType != null ? declaringType.Name + \".\" + methodBase.Name : methodBase.Name;\n        }\n    }\n}\n"
  },
  {
    "path": "Messaging/EventMessagingHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Notifications;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Messaging\n{\n    /// <summary>\n    /// Desktop implementation of messaging system for Lean Engine\n    /// </summary>\n    public class EventMessagingHandler : IMessagingHandler\n    {\n        private AlgorithmNodePacket _job;\n        private volatile bool _loaded;\n        private Queue<Packet> _queue;\n\n        /// <summary>\n        /// Gets or sets whether this messaging handler has any current subscribers.\n        /// When set to false, messages won't be sent.\n        /// </summary>\n        public bool HasSubscribers\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Initialize the Messaging System Plugin.\n        /// </summary>\n        /// <param name=\"initializeParameters\">The parameters required for initialization</param>\n        public void Initialize(MessagingHandlerInitializeParameters initializeParameters)\n        {\n            _queue = new Queue<Packet>();\n\n            ConsumerReadyEvent += () => { _loaded = true; };\n        }\n\n        /// <summary>\n        /// Set Loaded to true\n        /// </summary>\n        public void LoadingComplete()\n        {\n            _loaded = true;\n        }\n\n        /// <summary>\n        /// Set the user communication channel\n        /// </summary>\n        /// <param name=\"job\"></param>\n        public void SetAuthentication(AlgorithmNodePacket job)\n        {\n            _job = job;\n        }\n\n#pragma warning disable 1591\n        public delegate void DebugEventRaised(DebugPacket packet);\n        public event DebugEventRaised DebugEvent;\n\n        public delegate void SystemDebugEventRaised(SystemDebugPacket packet);\n#pragma warning disable 0067 // SystemDebugEvent is not used currently; ignore the warning\n        public event SystemDebugEventRaised SystemDebugEvent;\n#pragma warning restore 0067\n\n        public delegate void LogEventRaised(LogPacket packet);\n        public event LogEventRaised LogEvent;\n\n        public delegate void RuntimeErrorEventRaised(RuntimeErrorPacket packet);\n        public event RuntimeErrorEventRaised RuntimeErrorEvent;\n\n        public delegate void HandledErrorEventRaised(HandledErrorPacket packet);\n        public event HandledErrorEventRaised HandledErrorEvent;\n\n        public delegate void BacktestResultEventRaised(BacktestResultPacket packet);\n        public event BacktestResultEventRaised BacktestResultEvent;\n\n        public delegate void ConsumerReadyEventRaised();\n        public event ConsumerReadyEventRaised ConsumerReadyEvent;\n#pragma warning restore 1591\n\n        /// <summary>\n        /// Send any message with a base type of Packet.\n        /// </summary>\n        public void Send(Packet packet)\n        {\n            //Until we're loaded queue it up\n            if (!_loaded)\n            {\n                _queue.Enqueue(packet);\n                return;\n            }\n\n            //Catch up if this is the first time\n            while (_queue.TryDequeue(out var item))\n            {\n                ProcessPacket(item);\n            }\n\n            //Finally process this new packet\n            ProcessPacket(packet);\n        }\n\n        /// <summary>\n        /// Send any notification with a base type of Notification.\n        /// </summary>\n        /// <param name=\"notification\">The notification to be sent.</param>\n        public void SendNotification(Notification notification)\n        {\n            if (!notification.CanSend())\n            {\n                Log.Error(\"Messaging.SendNotification(): Send not implemented for notification of type: \" + notification.GetType().Name);\n                return;\n            }\n            notification.Send();\n        }\n\n        /// <summary>\n        /// Send any message with a base type of Packet that has been enqueued.\n        /// </summary>\n        public void SendEnqueuedPackets()\n        {\n            while (_loaded && _queue.TryDequeue(out var item))\n            {\n                ProcessPacket(item);\n            }\n        }\n\n        /// <summary>\n        /// Packet processing implementation\n        /// </summary>\n        private void ProcessPacket(Packet packet)\n        {\n            //Packets we handled in the UX.\n            switch (packet.Type)\n            {\n                case PacketType.Debug:\n                    var debug = (DebugPacket)packet;\n                    OnDebugEvent(debug);\n                    break;\n\n                case PacketType.SystemDebug:\n                    var systemDebug = (SystemDebugPacket)packet;\n                    OnSystemDebugEvent(systemDebug);\n                    break;\n\n                case PacketType.Log:\n                    var log = (LogPacket)packet;\n                    OnLogEvent(log);\n                    break;\n\n                case PacketType.RuntimeError:\n                    var runtime = (RuntimeErrorPacket)packet;\n                    OnRuntimeErrorEvent(runtime);\n                    break;\n\n                case PacketType.HandledError:\n                    var handled = (HandledErrorPacket)packet;\n                    OnHandledErrorEvent(handled);\n                    break;\n\n                case PacketType.BacktestResult:\n                    var result = (BacktestResultPacket)packet;\n                    OnBacktestResultEvent(result);\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Raise a debug event safely\n        /// </summary>\n        protected virtual void OnDebugEvent(DebugPacket packet)\n        {\n            var handler = DebugEvent;\n\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n\n        /// <summary>\n        /// Raise a system debug event safely\n        /// </summary>\n        protected virtual void OnSystemDebugEvent(SystemDebugPacket packet)\n        {\n            var handler = DebugEvent;\n\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n\n        /// <summary>\n        /// Handler for consumer ready code.\n        /// </summary>\n        public virtual void OnConsumerReadyEvent()\n        {\n            var handler = ConsumerReadyEvent;\n            if (handler != null)\n            {\n                handler();\n            }\n        }\n\n        /// <summary>\n        /// Raise a log event safely\n        /// </summary>\n        protected virtual void OnLogEvent(LogPacket packet)\n        {\n            var handler = LogEvent;\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n        /// <summary>\n        /// Raise a handled error event safely\n        /// </summary>\n        protected virtual void OnHandledErrorEvent(HandledErrorPacket packet)\n        {\n            var handler = HandledErrorEvent;\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n        /// <summary>\n        /// Raise runtime error safely\n        /// </summary>\n        protected virtual void OnRuntimeErrorEvent(RuntimeErrorPacket packet)\n        {\n            var handler = RuntimeErrorEvent;\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n        /// <summary>\n        /// Raise a backtest result event safely.\n        /// </summary>\n        protected virtual void OnBacktestResultEvent(BacktestResultPacket packet)\n        {\n            var handler = BacktestResultEvent;\n            if (handler != null)\n            {\n                handler(packet);\n            }\n        }\n\n        /// <summary>\n        /// Dispose of any resources\n        /// </summary>\n        public virtual void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Messaging/Messaging.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Notifications;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Messaging\n{\n    /// <summary>\n    /// Local/desktop implementation of messaging system for Lean Engine.\n    /// </summary>\n    public class Messaging : IMessagingHandler\n    {\n        /// <summary>\n        /// This implementation ignores the <seealso cref=\"HasSubscribers\"/> flag and\n        /// instead will always write to the log.\n        /// </summary>\n        public bool HasSubscribers\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Initialize the messaging system\n        /// </summary>\n        /// <param name=\"initializeParameters\">The parameters required for initialization</param>\n        public void Initialize(MessagingHandlerInitializeParameters initializeParameters)\n        {\n            //\n        }\n\n        /// <summary>\n        /// Set the messaging channel\n        /// </summary>\n        public virtual void SetAuthentication(AlgorithmNodePacket job)\n        {\n        }\n\n        /// <summary>\n        /// Send a generic base packet without processing\n        /// </summary>\n        public virtual void Send(Packet packet)\n        {\n            switch (packet.Type)\n            {\n                case PacketType.Debug:\n                    var debug = (DebugPacket)packet;\n                    Log.Trace(\"Debug: \" + debug.Message);\n                    break;\n\n                case PacketType.SystemDebug:\n                    var systemDebug = (SystemDebugPacket)packet;\n                    Log.Trace(\"Debug: \" + systemDebug.Message);\n                    break;\n\n                case PacketType.Log:\n                    var log = (LogPacket)packet;\n                    Log.Trace(\"Log: \" + log.Message);\n                    break;\n\n                case PacketType.RuntimeError:\n                    var runtime = (RuntimeErrorPacket)packet;\n                    var rstack = (!string.IsNullOrEmpty(runtime.StackTrace) ? (Environment.NewLine + \" \" + runtime.StackTrace) : string.Empty);\n                    Log.Error(runtime.Message + rstack);\n                    break;\n\n                case PacketType.HandledError:\n                    var handled = (HandledErrorPacket)packet;\n                    var hstack = (!string.IsNullOrEmpty(handled.StackTrace) ? (Environment.NewLine + \" \" + handled.StackTrace) : string.Empty);\n                    Log.Error(handled.Message + hstack);\n                    break;\n\n                case PacketType.AlphaResult:\n                    break;\n\n                case PacketType.BacktestResult:\n                    var result = (BacktestResultPacket)packet;\n\n                    if (result.Progress == 1)\n                    {\n                        var orderHash = result.Results.Orders.GetHash();\n                        result.Results.Statistics.Add(\"OrderListHash\", orderHash);\n\n                        var statisticsStr = $\"{Environment.NewLine}\" +\n                            $\"{string.Join(Environment.NewLine, result.Results.Statistics.Select(x => $\"STATISTICS:: {x.Key} {x.Value}\"))}\";\n                        Log.Trace(statisticsStr);\n                    }\n                    break;\n            }\n        }\n\n        /// <summary>\n        /// Send any notification with a base type of Notification.\n        /// </summary>\n        public void SendNotification(Notification notification)\n        {\n            if (!notification.CanSend())\n            {\n                Log.Error(\"Messaging.SendNotification(): Send not implemented for notification of type: \" + notification.GetType().Name);\n                return;\n            }\n            notification.Send();\n        }\n\n        /// <summary>\n        /// Dispose of any resources\n        /// </summary>\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Messaging/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Messaging\")]\n[assembly: AssemblyProduct(\"QuantConnect.Messaging\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"ebbf7771-8d17-488e-86a6-b0f33f69612d\")]"
  },
  {
    "path": "Messaging/QuantConnect.Messaging.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Messaging</RootNamespace>\n    <AssemblyName>QuantConnect.Messaging</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Messaging.xml</DocumentationFile>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Messaging Project - The external messaging system implementation</Description>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"NetMQ\" Version=\"4.0.1.6\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Messaging/StreamingMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Net;\nusing System.Net.Sockets;\nusing Newtonsoft.Json;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Notifications;\nusing QuantConnect.Packets;\nusing NetMQ;\nusing NetMQ.Sockets;\nusing QuantConnect.Orders.Serialization;\n\nnamespace QuantConnect.Messaging\n{\n    /// <summary>\n    /// Message handler that sends messages over tcp using NetMQ.\n    /// </summary>\n    public class StreamingMessageHandler : IMessagingHandler\n    {\n        private string _port;\n        private PushSocket _server;\n        private AlgorithmNodePacket _job;\n        private OrderEventJsonConverter _orderEventJsonConverter;\n\n        /// <summary>\n        /// Gets or sets whether this messaging handler has any current subscribers.\n        /// This is not used in this message handler.  Messages are sent via tcp as they arrive\n        /// </summary>\n        public bool HasSubscribers { get; set; }\n\n        /// <summary>\n        /// Initialize the messaging system\n        /// </summary>\n        /// <param name=\"initializeParameters\">The parameters required for initialization</param>\n        public void Initialize(MessagingHandlerInitializeParameters initializeParameters)\n        {\n            _port = Config.Get(\"desktop-http-port\");\n            CheckPort();\n            _server = new PushSocket(\"@tcp://*:\" + _port);\n        }\n\n        /// <summary>\n        /// Set the user communication channel\n        /// </summary>\n        /// <param name=\"job\"></param>\n        public void SetAuthentication(AlgorithmNodePacket job)\n        {\n            _job = job;\n            _orderEventJsonConverter = new OrderEventJsonConverter(job.AlgorithmId);\n            Transmit(_job);\n        }\n\n        /// <summary>\n        /// Send any notification with a base type of Notification.\n        /// </summary>\n        /// <param name=\"notification\">The notification to be sent.</param>\n        public void SendNotification(Notification notification)\n        {\n            if (!notification.CanSend())\n            {\n                Log.Error(\"Messaging.SendNotification(): Send not implemented for notification of type: \" + notification.GetType().Name);\n                return;\n            }\n            notification.Send();\n        }\n\n        /// <summary>\n        /// Send all types of packets\n        /// </summary>\n        public void Send(Packet packet)\n        {\n           Transmit(packet);\n        }\n\n        /// <summary>\n        /// Send a message to the _server using ZeroMQ\n        /// </summary>\n        /// <param name=\"packet\">Packet to transmit</param>\n        public void Transmit(Packet packet)\n        {\n            var payload = JsonConvert.SerializeObject(packet, _orderEventJsonConverter);\n\n            var message = new NetMQMessage();\n\n            message.Append(payload);\n\n            _server.SendMultipartMessage(message);\n        }\n\n        /// <summary>\n        /// Check if port to be used by the desktop application is available.\n        /// </summary>\n        private void CheckPort()\n        {\n            try\n            {\n                TcpListener tcpListener = new TcpListener(IPAddress.Any, _port.ToInt32());\n                tcpListener.Start();\n                tcpListener.Stop();\n            }\n            catch\n            {\n                throw new Exception(\"The port configured in config.json is either being used or blocked by a firewall.\" +\n                    \"Please choose a new port or open the port in the firewall.\");\n            }\n        }\n\n        /// <summary>\n        /// Dispose any resources used before destruction\n        /// </summary>\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/LeanOptimizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Configuration;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\n\nnamespace QuantConnect.Optimizer\n{\n    /// <summary>\n    /// Base Lean optimizer class in charge of handling an optimization job packet\n    /// </summary>\n    public abstract class LeanOptimizer : IDisposable\n    {\n        private readonly int _optimizationUpdateInterval = Config.GetInt(\"optimization-update-interval\", 10);\n\n        private DateTime _startedAt = DateTime.UtcNow;\n\n        private DateTime _lastUpdate;\n        private int _failedBacktest;\n        private int _completedBacktest;\n        private volatile bool _disposed;\n\n        /// <summary>\n        /// The total completed backtests count\n        /// </summary>\n        protected int CompletedBacktests => _failedBacktest + _completedBacktest;\n\n        /// <summary>\n        /// Lock to update optimization status\n        /// </summary>\n        private object _statusLock = new object();\n\n        /// <summary>\n        /// The current optimization status\n        /// </summary>\n        protected OptimizationStatus Status { get; private set; } = OptimizationStatus.New;\n\n        /// <summary>\n        /// The optimization target\n        /// </summary>\n        protected Target OptimizationTarget { get; }\n\n        /// <summary>\n        /// Collection holding <see cref=\"ParameterSet\"/> for each backtest id we are waiting to finish\n        /// </summary>\n        protected ConcurrentDictionary<string, ParameterSet> RunningParameterSetForBacktest { get; init; }\n\n        /// <summary>\n        /// Collection holding <see cref=\"ParameterSet\"/> for each backtest id we are waiting to launch\n        /// </summary>\n        /// <remarks>We can't launch 1 million backtests at the same time</remarks>\n        protected ConcurrentQueue<ParameterSet> PendingParameterSet { get; init; }\n\n        /// <summary>\n        /// The optimization strategy being used\n        /// </summary>\n        protected IOptimizationStrategy Strategy { get; init; }\n\n        /// <summary>\n        /// The optimization packet\n        /// </summary>\n        protected OptimizationNodePacket NodePacket { get; init; }\n\n        /// <summary>\n        /// Indicates whether optimizer was disposed\n        /// </summary>\n        protected bool Disposed => _disposed;\n\n        /// <summary>\n        /// Event triggered when the optimization work ended\n        /// </summary>\n        public event EventHandler<OptimizationResult> Ended;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"nodePacket\">The optimization node packet to handle</param>\n        protected LeanOptimizer(OptimizationNodePacket nodePacket)\n        {\n            if (nodePacket.OptimizationParameters.IsNullOrEmpty())\n            {\n                throw new ArgumentException(\"Cannot start an optimization job with no parameter to optimize\");\n            }\n\n            if (string.IsNullOrEmpty(nodePacket.Criterion?.Target))\n            {\n                throw new ArgumentException(\"Cannot start an optimization job with no target to optimize\");\n            }\n\n            NodePacket = nodePacket;\n            OptimizationTarget = NodePacket.Criterion;\n            OptimizationTarget.Reached += (s, e) =>\n            {\n                // we've reached the optimization target\n                TriggerOnEndEvent();\n            };\n\n            Strategy = (IOptimizationStrategy)Activator.CreateInstance(Type.GetType(NodePacket.OptimizationStrategy));\n\n            RunningParameterSetForBacktest = new ConcurrentDictionary<string, ParameterSet>();\n            PendingParameterSet = new ConcurrentQueue<ParameterSet>();\n\n            Strategy.Initialize(OptimizationTarget, nodePacket.Constraints, NodePacket.OptimizationParameters, NodePacket.OptimizationStrategySettings);\n\n            Strategy.NewParameterSet += (s, parameterSet) =>\n            {\n                if (parameterSet == null)\n                {\n                    // shouldn't happen\n                    Log.Error($\"Strategy.NewParameterSet({GetLogDetails()}): generated a null {nameof(ParameterSet)} instance\");\n                    return;\n                }\n                LaunchLeanForParameterSet(parameterSet);\n            };\n        }\n\n        /// <summary>\n        /// Starts the optimization\n        /// </summary>\n        public virtual void Start()\n        {\n            lock (RunningParameterSetForBacktest)\n            {\n                Strategy.PushNewResults(OptimizationResult.Initial);\n\n                // if after we started there are no running parameter sets means we have failed to start\n                if (RunningParameterSetForBacktest.Count == 0)\n                {\n                    SetOptimizationStatus(OptimizationStatus.Aborted);\n                    throw new InvalidOperationException($\"LeanOptimizer.Start({GetLogDetails()}): failed to start\");\n                }\n                Log.Trace($\"LeanOptimizer.Start({GetLogDetails()}): start ended. Waiting on {RunningParameterSetForBacktest.Count + PendingParameterSet.Count} backtests\");\n            }\n\n            SetOptimizationStatus(OptimizationStatus.Running);\n            ProcessUpdate(forceSend: true);\n        }\n\n        /// <summary>\n        /// Triggers the optimization job end event\n        /// </summary>\n        protected virtual void TriggerOnEndEvent()\n        {\n            if (_disposed)\n            {\n                return;\n            }\n            SetOptimizationStatus(OptimizationStatus.Completed);\n\n            var result = Strategy.Solution;\n            if (result != null)\n            {\n                var constraint = NodePacket.Constraints != null ? $\"Constraints: ({string.Join(\",\", NodePacket.Constraints)})\" : string.Empty;\n                Log.Trace($\"LeanOptimizer.TriggerOnEndEvent({GetLogDetails()}): Optimization has ended. \" +\n                    $\"Result for {OptimizationTarget}: was reached using ParameterSet: ({result.ParameterSet}) backtestId '{result.BacktestId}'. \" +\n                    $\"{constraint}\");\n            }\n            else\n            {\n                Log.Trace($\"LeanOptimizer.TriggerOnEndEvent({GetLogDetails()}): Optimization has ended. Result was not reached\");\n            }\n\n            // we clean up before we send an update so that the runtime stats are updated\n            CleanUpRunningInstance();\n            ProcessUpdate(forceSend: true);\n\n            Ended?.Invoke(this, result);\n        }\n\n        /// <summary>\n        /// Handles starting Lean for a given parameter set\n        /// </summary>\n        /// <param name=\"parameterSet\">The parameter set for the backtest to run</param>\n        /// <param name=\"backtestName\">The backtest name to use</param>\n        /// <returns>The new unique backtest id</returns>\n        protected abstract string RunLean(ParameterSet parameterSet, string backtestName);\n\n        /// <summary>\n        /// Get's a new backtest name\n        /// </summary>\n        protected virtual string GetBacktestName(ParameterSet parameterSet)\n        {\n            return \"OptimizationBacktest\";\n        }\n\n        /// <summary>\n        /// Handles a new backtest json result matching a requested backtest id\n        /// </summary>\n        /// <param name=\"jsonBacktestResult\">The backtest json result</param>\n        /// <param name=\"backtestId\">The associated backtest id</param>\n        protected virtual void NewResult(string jsonBacktestResult, string backtestId)\n        {\n            lock (RunningParameterSetForBacktest)\n            {\n                ParameterSet parameterSet;\n\n                // we take a lock so that there is no race condition with launching Lean adding the new backtest id and receiving the backtest result for that id\n                // before it's even in the collection 'ParameterSetForBacktest'\n\n                if (!RunningParameterSetForBacktest.TryRemove(backtestId, out parameterSet))\n                {\n                    Interlocked.Increment(ref _failedBacktest);\n                    Log.Error(\n                        $\"LeanOptimizer.NewResult({GetLogDetails()}): Optimization compute job with id '{backtestId}' was not found\");\n                    return;\n                }\n\n                // we got a new result if there are any pending parameterSet to run we can now trigger 1\n                // we do this before 'Strategy.PushNewResults' so FIFO is respected\n                if (PendingParameterSet.TryDequeue(out var pendingParameterSet))\n                {\n                    LaunchLeanForParameterSet(pendingParameterSet);\n                }\n\n                var result = new OptimizationResult(null, parameterSet, backtestId);\n                if (string.IsNullOrEmpty(jsonBacktestResult))\n                {\n                    Interlocked.Increment(ref _failedBacktest);\n                    Log.Error(\n                        $\"LeanOptimizer.NewResult({GetLogDetails()}): Got null/empty backtest result for backtest id '{backtestId}'\");\n                }\n                else\n                {\n                    Interlocked.Increment(ref _completedBacktest);\n                    result = new OptimizationResult(jsonBacktestResult, parameterSet, backtestId);\n                }\n\n                // always notify the strategy\n                Strategy.PushNewResults(result);\n\n                // strategy could of added more\n                if (RunningParameterSetForBacktest.Count == 0)\n                {\n                    TriggerOnEndEvent();\n                }\n                else\n                {\n                    ProcessUpdate();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Disposes of any resources\n        /// </summary>\n        public virtual void Dispose()\n        {\n            if (_disposed)\n            {\n                return;\n            }\n            _disposed = true;\n            CleanUpRunningInstance();\n        }\n\n        /// <summary>\n        /// Returns the current optimization status and strategy estimates\n        /// </summary>\n        public int GetCurrentEstimate()\n        {\n            return Strategy.GetTotalBacktestEstimate();\n        }\n\n        /// <summary>\n        /// Get the current runtime statistics\n        /// </summary>\n        public Dictionary<string, string> GetRuntimeStatistics()\n        {\n            var completedCount = _completedBacktest;\n            var totalEndedCount = completedCount + _failedBacktest;\n            var runtime = DateTime.UtcNow - _startedAt;\n            var result = new Dictionary<string, string>\n            {\n                { \"Completed\", $\"{completedCount}\"},\n                { \"Failed\", $\"{_failedBacktest}\"},\n                { \"Running\", $\"{RunningParameterSetForBacktest.Count}\"},\n                { \"In Queue\", $\"{PendingParameterSet.Count}\"},\n                { \"Average Length\", $\"{(totalEndedCount > 0 ? new TimeSpan(runtime.Ticks / totalEndedCount) : TimeSpan.Zero).ToString(@\"hh\\:mm\\:ss\", CultureInfo.InvariantCulture)}\"},\n                { \"Total Runtime\", $\"{runtime.ToString(@\"hh\\:mm\\:ss\", CultureInfo.InvariantCulture)}\" }\n            };\n\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method to have pretty more informative logs\n        /// </summary>\n        protected string GetLogDetails()\n        {\n            if (NodePacket.UserId == 0)\n            {\n                return $\"OID {NodePacket.OptimizationId}\";\n            }\n            return $\"UI {NodePacket.UserId} PID {NodePacket.ProjectId} OID {NodePacket.OptimizationId} S {Status}\";\n        }\n\n        /// <summary>\n        /// Handles stopping Lean process\n        /// </summary>\n        /// <param name=\"backtestId\">Specified backtest id</param>\n        protected abstract void AbortLean(string backtestId);\n\n        /// <summary>\n        /// Sends an update of the current optimization status to the user\n        /// </summary>\n        protected abstract void SendUpdate();\n\n        /// <summary>\n        /// Sets the current optimization status\n        /// </summary>\n        /// <param name=\"optimizationStatus\">The new optimization status</param>\n        protected virtual void SetOptimizationStatus(OptimizationStatus optimizationStatus)\n        {\n            lock (_statusLock)\n            {\n                // we never come back from an aborted/ended status\n                if (Status != OptimizationStatus.Aborted && Status != OptimizationStatus.Completed)\n                {\n                    Status = optimizationStatus;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Clean up any pending or running lean instance\n        /// </summary>\n        private void CleanUpRunningInstance()\n        {\n            PendingParameterSet.Clear();\n\n            lock (RunningParameterSetForBacktest)\n            {\n                foreach (var backtestId in RunningParameterSetForBacktest.Keys)\n                {\n                    ParameterSet parameterSet;\n                    if (RunningParameterSetForBacktest.TryRemove(backtestId, out parameterSet))\n                    {\n                        Interlocked.Increment(ref _failedBacktest);\n                        try\n                        {\n                            AbortLean(backtestId);\n                        }\n                        catch\n                        {\n                            // pass\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Will determine if it's right time to trigger an update call\n        /// </summary>\n        /// <param name=\"forceSend\">True will force send, skipping interval, useful on start and end</param>\n        private void ProcessUpdate(bool forceSend = false)\n        {\n            if (!forceSend && Status == OptimizationStatus.New)\n            {\n                // don't send any update until we finish the Start(), will be creating a bunch of backtests don't want to send partial/multiple updates\n                return;\n            }\n\n            try\n            {\n                var now = DateTime.UtcNow;\n                if (forceSend || (now - _lastUpdate > TimeSpan.FromSeconds(_optimizationUpdateInterval)))\n                {\n                    _lastUpdate = now;\n                    Log.Debug($\"LeanOptimizer.ProcessUpdate({GetLogDetails()}): start sending update...\");\n\n                    SendUpdate();\n\n                    Log.Debug($\"LeanOptimizer.ProcessUpdate({GetLogDetails()}): finished sending update successfully.\");\n                }\n            }\n            catch (Exception e)\n            {\n                Log.Error(e, \"Failed to send status update\");\n            }\n        }\n\n        private void LaunchLeanForParameterSet(ParameterSet parameterSet)\n        {\n            if (_disposed || Status == OptimizationStatus.Completed || Status == OptimizationStatus.Aborted)\n            {\n                return;\n            }\n\n            lock (RunningParameterSetForBacktest)\n            {\n                if (NodePacket.MaximumConcurrentBacktests != 0 && RunningParameterSetForBacktest.Count >= NodePacket.MaximumConcurrentBacktests)\n                {\n                    // we hit the limit on the concurrent backtests\n                    PendingParameterSet.Enqueue(parameterSet);\n                    return;\n                }\n\n                try\n                {\n                    var backtestName = GetBacktestName(parameterSet);\n                    var backtestId = RunLean(parameterSet, backtestName);\n\n                    if (!string.IsNullOrEmpty(backtestId))\n                    {\n                        Log.Trace($\"LeanOptimizer.LaunchLeanForParameterSet({GetLogDetails()}): launched backtest '{backtestId}' with parameters '{parameterSet}'\");\n                        RunningParameterSetForBacktest.TryAdd(backtestId, parameterSet);\n                    }\n                    else\n                    {\n                        Interlocked.Increment(ref _failedBacktest);\n                        // always notify the strategy\n                        Strategy.PushNewResults(new OptimizationResult(null, parameterSet, backtestId));\n                        Log.Error($\"LeanOptimizer.LaunchLeanForParameterSet({GetLogDetails()}): Initial/null optimization compute job could not be placed into the queue\");\n                    }\n\n                    ProcessUpdate();\n                }\n                catch (Exception ex)\n                {\n                    Log.Error($\"LeanOptimizer.LaunchLeanForParameterSet({GetLogDetails()}): Error encountered while placing optimization message into the queue: {ex.Message}\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/OptimizationNodePacket.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Optimizer\n{\n    /// <summary>\n    /// Provide a packet type containing information on the optimization compute job.\n    /// </summary>\n    public class OptimizationNodePacket : Packet\n    {\n        /// <summary>\n        /// The optimization name\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// The creation time\n        /// </summary>\n        [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI)]\n        public DateTime Created { get; set; }\n\n        /// <summary>\n        /// User Id placing request\n        /// </summary>\n        public int UserId { get; set; }\n\n        /// User API Token\n        public string UserToken { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Project Id of the request\n        /// </summary>\n        public int ProjectId { get; set; }\n\n        /// <summary>\n        /// Unique compile id of this optimization\n        /// </summary>\n        public string CompileId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// The unique optimization Id of the request\n        /// </summary>\n        public string OptimizationId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Organization Id of the request\n        /// </summary>\n        public string OrganizationId { get; set; } = string.Empty;\n\n        /// <summary>\n        /// Limit for the amount of concurrent backtests being run\n        /// </summary>\n        public int MaximumConcurrentBacktests { get; set; }\n\n        /// <summary>\n        /// Optimization strategy name\n        /// </summary>\n        public string OptimizationStrategy { get; set; } = \"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\";\n\n        /// <summary>\n        /// Objective settings\n        /// </summary>\n        public Target Criterion { get; set; }\n\n        /// <summary>\n        /// Optimization constraints\n        /// </summary>\n        public IReadOnlyList<Constraint> Constraints { get; set; }\n\n        /// <summary>\n        /// The user optimization parameters\n        /// </summary>\n        public HashSet<OptimizationParameter> OptimizationParameters { get; set; }\n\n        /// <summary>\n        /// The user optimization parameters\n        /// </summary>\n        [JsonProperty(TypeNameHandling = TypeNameHandling.All)]\n        public OptimizationStrategySettings OptimizationStrategySettings { get; set; }\n\n        /// <summary>\n        /// Backtest out of sample maximum end date\n        /// </summary>\n        public DateTime? OutOfSampleMaxEndDate { get; set; }\n\n        /// <summary>\n        /// The backtest out of sample day count\n        /// </summary>\n        public int OutOfSampleDays { get; set; }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        public OptimizationNodePacket() : this(PacketType.OptimizationNode)\n        {\n        }\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        protected OptimizationNodePacket(PacketType packetType) : base(packetType)\n        {\n        }\n    }\n\n}\n"
  },
  {
    "path": "Optimizer/OptimizationResult.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Optimizer\n{\n    /// <summary>\n    /// Defines the result of Lean compute job\n    /// </summary>\n    public class OptimizationResult\n    {\n        /// <summary>\n        /// Corresponds to initial result to drive the optimization strategy\n        /// </summary>\n        public static readonly OptimizationResult Initial = new OptimizationResult(null, null, null);\n\n        /// <summary>\n        /// The backtest id that generated this result\n        /// </summary>\n        public string BacktestId { get; }\n\n        /// <summary>\n        /// Parameter set Id\n        /// </summary>\n        public int Id => ParameterSet?.Id ?? 0;\n\n        /// <summary>\n        /// Json Backtest result\n        /// </summary>\n        public string JsonBacktestResult { get; }\n\n        /// <summary>\n        /// The parameter set at which the result was achieved\n        /// </summary>\n        public ParameterSet ParameterSet { get; }\n\n        /// <summary>\n        /// Create an instance of <see cref=\"OptimizationResult\"/>\n        /// </summary>\n        /// <param name=\"jsonBacktestResult\">Optimization target value for this backtest</param>\n        /// <param name=\"parameterSet\">Parameter set used in compute job</param>\n        /// <param name=\"backtestId\">The backtest id that generated this result</param>\n        public OptimizationResult(string jsonBacktestResult, ParameterSet parameterSet, string backtestId)\n        {\n            JsonBacktestResult = jsonBacktestResult;\n            ParameterSet = parameterSet;\n            BacktestId = backtestId;\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Parameters/OptimizationParameterEnumerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Enumerates all possible values for specific optimization parameter\n    /// </summary>\n    public abstract class OptimizationParameterEnumerator<T> : IEnumerator<string>  where T: OptimizationParameter\n    {\n        /// <summary>\n        /// The target optimization parameter to enumerate\n        /// </summary>\n        protected T OptimizationParameter { get; }\n\n        /// <summary>\n        /// The current enumeration state\n        /// </summary>\n        protected int Index { get; set; } = -1;\n\n        protected OptimizationParameterEnumerator(T optimizationParameter)\n        {\n            OptimizationParameter = optimizationParameter;\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>The element in the collection at the current position of the enumerator.</returns>\n        public abstract string Current { get; }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>The current element in the collection.</returns>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose() { }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns> true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created.</exception>\n        public abstract bool MoveNext();\n\n        /// <summary>\n        /// Sets the enumerator to its initial position, which is before the first element in the collection.\n        /// </summary>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created.</exception>\n        public void Reset()\n        {\n            Index = -1;\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Parameters/OptimizationStepParameterEnumerator.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Optimizer.Parameters\n{\n    /// <summary>\n    /// Enumerates all possible values for specific optimization parameter\n    /// </summary>\n    public class OptimizationStepParameterEnumerator : OptimizationParameterEnumerator<OptimizationStepParameter>\n    {\n        /// <summary>\n        /// Creates an instance of <see cref=\"OptimizationStepParameterEnumerator\"/>\n        /// </summary>\n        /// <param name=\"optimizationParameter\">Step-based optimization parameter</param>\n        public OptimizationStepParameterEnumerator(OptimizationStepParameter optimizationParameter) : base(optimizationParameter)\n        {\n        }\n\n        /// <summary>\n        /// Gets the element in the collection at the current position of the enumerator.\n        /// </summary>\n        /// <returns>The element in the collection at the current position of the enumerator.</returns>\n        public override string Current\n        {\n            get\n            {\n                var value = OptimizationParameter.MinValue + Index * OptimizationParameter.Step;\n                if (Index == -1 || value > OptimizationParameter.MaxValue)\n                    throw new InvalidOperationException();\n\n                return value.ToStringInvariant();\n            }\n        }\n\n        /// <summary>\n        /// Advances the enumerator to the next element of the collection.\n        /// </summary>\n        /// <returns> true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>\n        /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created.</exception>\n        public override bool MoveNext()\n        {\n            var value = OptimizationParameter.MinValue + (Index + 1) * OptimizationParameter.Step;\n            if (value <= OptimizationParameter.MaxValue)\n            {\n                Index++;\n                return true;\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Optimizer\")]\n[assembly: AssemblyProduct(\"QuantConnect.Optimizer\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4ecd7df3-a675-4e9e-aca3-2b51c88736ce\")]"
  },
  {
    "path": "Optimizer/QuantConnect.Optimizer.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Optimizer</RootNamespace>\n    <AssemblyName>QuantConnect.Optimizer</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Optimizer Project - The Lean optimization engine</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <PropertyGroup>\n    <Features>flow-analysis</Features>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Optimizer/Strategies/EulerSearchOptimizationStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Advanced brute-force strategy with search in-depth for best solution on previous step\n    /// </summary>\n    public class EulerSearchOptimizationStrategy : StepBaseOptimizationStrategy\n    {\n        private object _locker = new object();\n        private readonly HashSet<ParameterSet> _runningParameterSet = new HashSet<ParameterSet>();\n        private int _segmentsAmount = 4;\n\n        /// <summary>\n        /// Initializes the strategy using generator, extremum settings and optimization parameters\n        /// </summary>\n        /// <param name=\"target\">The optimization target</param>\n        /// <param name=\"constraints\">The optimization constraints to apply on backtest results</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"settings\">Optimization strategy settings</param>\n        public override void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings)\n        {\n            var stepSettings = settings as StepBaseOptimizationStrategySettings;\n            if (stepSettings == null)\n            {\n                throw new ArgumentNullException(nameof(settings),\n                    \"EulerSearchOptimizationStrategy.Initialize: Optimizations Strategy settings are required for this strategy\");\n            }\n\n            if (stepSettings.DefaultSegmentAmount != 0)\n            {\n                _segmentsAmount = stepSettings.DefaultSegmentAmount;\n            }\n\n            base.Initialize(target, constraints, parameters, settings);\n        }\n\n        /// <summary>\n        /// Checks whether new lean compute job better than previous and run new iteration if necessary.\n        /// </summary>\n        /// <param name=\"result\">Lean compute job result and corresponding parameter set</param>\n        public override void PushNewResults(OptimizationResult result)\n        {\n            if (!Initialized)\n            {\n                throw new InvalidOperationException($\"EulerSearchOptimizationStrategy.PushNewResults: strategy has not been initialized yet.\");\n            }\n\n            lock (_locker)\n            {\n                if (!ReferenceEquals(result, OptimizationResult.Initial) && string.IsNullOrEmpty(result?.JsonBacktestResult))\n                {\n                    // one of the requested backtests failed\n                    _runningParameterSet.Remove(result.ParameterSet);\n                    return;\n                }\n\n                // check if the incoming result is not the initial seed\n                if (result.Id > 0)\n                {\n                    _runningParameterSet.Remove(result.ParameterSet);\n                    ProcessNewResult(result);\n                }\n\n                if (_runningParameterSet.Count > 0)\n                {\n                    // we wait till all backtest end during each euler step\n                    return;\n                }\n\n                // Once all running backtests have ended, for the current collection of optimization parameters, for each parameter we determine if\n                // we can create a new smaller/finer optimization scope\n                if (Target.Current.HasValue && OptimizationParameters.OfType<OptimizationStepParameter>().Any(s => s.Step > s.MinStep))\n                {\n                    var boundaries = new HashSet<OptimizationParameter>();\n                    var parameterSet = Solution.ParameterSet;\n                    foreach (var optimizationParameter in OptimizationParameters)\n                    {\n                        var optimizationStepParameter = optimizationParameter as OptimizationStepParameter;\n                        if (optimizationStepParameter != null && optimizationStepParameter.Step > optimizationStepParameter.MinStep)\n                        {\n                            var newStep = Math.Max(optimizationStepParameter.MinStep.Value, optimizationStepParameter.Step.Value / _segmentsAmount);\n                            var fractal = newStep * ((decimal)_segmentsAmount / 2);\n                            var parameter = parameterSet.Value.First(s => s.Key == optimizationParameter.Name);\n                            boundaries.Add(new OptimizationStepParameter(\n                                optimizationParameter.Name,\n                                Math.Max(optimizationStepParameter.MinValue, parameter.Value.ToDecimal() - fractal),\n                                Math.Min(optimizationStepParameter.MaxValue, parameter.Value.ToDecimal() + fractal),\n                                newStep,\n                                optimizationStepParameter.MinStep.Value));\n                        }\n                        else\n                        {\n                            boundaries.Add(optimizationParameter);\n                        }\n                    }\n\n                    foreach (var staticParam in OptimizationParameters.OfType<StaticOptimizationParameter>())\n                    {\n                        boundaries.Add(staticParam);\n                    }\n                    OptimizationParameters = boundaries;\n                }\n                else if (!ReferenceEquals(result, OptimizationResult.Initial))\n                {\n                    // we ended!\n                    return;\n                }\n\n                foreach (var parameterSet in Step(OptimizationParameters))\n                {\n                    OnNewParameterSet(parameterSet);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Handles new parameter set\n        /// </summary>\n        /// <param name=\"parameterSet\">New parameter set</param>\n        protected override void OnNewParameterSet(ParameterSet parameterSet)\n        {\n            _runningParameterSet.Add(parameterSet);\n            base.OnNewParameterSet(parameterSet);\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Strategies/GridSearchOptimizationStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Find the best solution in first generation\n    /// </summary>\n    public class GridSearchOptimizationStrategy : StepBaseOptimizationStrategy\n    {\n        private object _locker = new object();\n\n        /// <summary>\n        /// Checks whether new lean compute job better than previous and run new iteration if necessary.\n        /// </summary>\n        /// <param name=\"result\">Lean compute job result and corresponding parameter set</param>\n        public override void PushNewResults(OptimizationResult result)\n        {\n            if (!Initialized)\n            {\n                throw new InvalidOperationException($\"GridSearchOptimizationStrategy.PushNewResults: strategy has not been initialized yet.\");\n            }\n\n            lock (_locker)\n            {\n                if (!ReferenceEquals(result, OptimizationResult.Initial) && string.IsNullOrEmpty(result?.JsonBacktestResult))\n                {\n                    // one of the requested backtests failed\n                    return;\n                }\n\n                // check if the incoming result is not the initial seed\n                if (result.Id > 0)\n                {\n                    ProcessNewResult(result);\n                    return;\n                }\n\n                foreach (var parameterSet in Step(OptimizationParameters))\n                {\n                    OnNewParameterSet(parameterSet);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Strategies/IOptimizationStrategy.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Defines the optimization settings, direction, solution and exit, i.e. optimization strategy\n    /// </summary>\n    public interface IOptimizationStrategy\n    {\n        /// <summary>\n        /// Fires when new parameter set is retrieved\n        /// </summary>\n        event EventHandler<ParameterSet> NewParameterSet;\n\n        /// <summary>\n        /// Best found solution, its value and parameter set\n        /// </summary>\n        OptimizationResult Solution { get; }\n\n        /// <summary>\n        /// Initializes the strategy using generator, extremum settings and optimization parameters\n        /// </summary>\n        /// <param name=\"target\">The optimization target</param>\n        /// <param name=\"constraints\">The optimization constraints to apply on backtest results</param>\n        /// <param name=\"parameters\">optimization parameters</param>\n        /// <param name=\"settings\">optimization strategy advanced settings</param>\n        void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings);\n        \n        /// <summary>\n        /// Callback when lean compute job completed.\n        /// </summary>\n        /// <param name=\"result\">Lean compute job result and corresponding parameter set</param>\n        void PushNewResults(OptimizationResult result);\n\n        /// <summary>\n        /// Estimates amount of parameter sets that can be run\n        /// </summary>\n        int GetTotalBacktestEstimate();\n    }\n}\n"
  },
  {
    "path": "Optimizer/Strategies/OptimizationStrategySettings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Defines the specific optimization strategy settings\n    /// </summary>\n    public class OptimizationStrategySettings\n    {\n        /// <summary>\n        /// TODO: implement\n        /// </summary>\n        public TimeSpan MaxRuntime { get; set; } = TimeSpan.MaxValue;\n    }\n}\n"
  },
  {
    "path": "Optimizer/Strategies/StepBaseOptimizationStrategy.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Base class for any optimization built on top of brute force optimization method\n    /// </summary>\n    public abstract class StepBaseOptimizationStrategy : IOptimizationStrategy\n    {\n        private int _i;\n\n        /// <summary>\n        /// Indicates was strategy initialized or no\n        /// </summary>\n        protected bool Initialized { get; set; }\n\n        /// <summary>\n        /// Optimization parameters\n        /// </summary>\n        protected HashSet<OptimizationParameter> OptimizationParameters { get; set; }\n\n        /// <summary>\n        /// Optimization target, i.e. maximize or minimize\n        /// </summary>\n        protected Target Target { get; set; }\n\n        /// <summary>\n        /// Optimization constraints; if it doesn't comply just drop the backtest\n        /// </summary>\n        protected IEnumerable<Constraint> Constraints { get; set; }\n\n        /// <summary>\n        /// Keep the best found solution - lean computed job result and corresponding  parameter set \n        /// </summary>\n        public OptimizationResult Solution { get; protected set; }\n\n        /// <summary>\n        /// Advanced strategy settings\n        /// </summary>\n        public OptimizationStrategySettings Settings { get; protected set; }\n\n        /// <summary>\n        /// Fires when new parameter set is generated\n        /// </summary>\n        public event EventHandler<ParameterSet> NewParameterSet;\n\n        /// <summary>\n        /// Initializes the strategy using generator, extremum settings and optimization parameters\n        /// </summary>\n        /// <param name=\"target\">The optimization target</param>\n        /// <param name=\"constraints\">The optimization constraints to apply on backtest results</param>\n        /// <param name=\"parameters\">Optimization parameters</param>\n        /// <param name=\"settings\">Optimization strategy settings</param>\n        public virtual void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings)\n        {\n            if (Initialized)\n            {\n                throw new InvalidOperationException($\"GridSearchOptimizationStrategy.Initialize: can not be re-initialized.\");\n            }\n\n            Target = target;\n            Constraints = constraints;\n            OptimizationParameters = parameters;\n            Settings = settings;\n\n            foreach (var optimizationParameter in OptimizationParameters.OfType<OptimizationStepParameter>())\n            {\n                // if the Step optimization parameter does not provide a step to use, we calculate one based on settings\n                if (!optimizationParameter.Step.HasValue)\n                {\n                    var stepSettings = Settings as StepBaseOptimizationStrategySettings;\n                    if (stepSettings == null)\n                    {\n                        throw new ArgumentException($\"OptimizationStrategySettings is not of {nameof(StepBaseOptimizationStrategySettings)} type\", nameof(settings));\n                    }\n                    CalculateStep(optimizationParameter, stepSettings.DefaultSegmentAmount);\n                }\n            }\n\n            Initialized = true;\n        }\n\n        /// <summary>\n        /// Checks whether new lean compute job better than previous and run new iteration if necessary.\n        /// </summary>\n        /// <param name=\"result\">Lean compute job result and corresponding parameter set</param>\n        public abstract void PushNewResults(OptimizationResult result);\n\n        /// <summary>\n        /// Calculate number of parameter sets within grid\n        /// </summary>\n        /// <returns>Number of parameter sets for given optimization parameters</returns>\n        public int GetTotalBacktestEstimate()\n        {\n            var total = 1;\n            foreach (var arg in OptimizationParameters)\n            {\n                total *= Estimate(arg);\n            }\n\n            return total;\n        }\n\n        /// <summary>\n        /// Calculates number od data points for step based optimization parameter based on min/max and step values\n        /// </summary>\n        private int Estimate(OptimizationParameter parameter)\n        {\n            if (parameter is StaticOptimizationParameter)\n            {\n                return 1;\n            }\n\n            var stepParameter = parameter as OptimizationStepParameter;\n            if (stepParameter == null)\n            {\n                throw new InvalidOperationException($\"Cannot estimate parameter of type {parameter.GetType().FullName}\");\n            }\n\n            if (!stepParameter.Step.HasValue)\n            {\n                throw new InvalidOperationException(\"Optimization parameter cannot be estimated due to step value is not initialized\");\n            }\n\n            return (int)Math.Floor((stepParameter.MaxValue - stepParameter.MinValue) / stepParameter.Step.Value) + 1;\n        }\n\n        /// <summary>\n        /// Handles new parameter set\n        /// </summary>\n        /// <param name=\"parameterSet\">New parameter set</param>\n        protected virtual void OnNewParameterSet(ParameterSet parameterSet)\n        {\n            NewParameterSet?.Invoke(this, parameterSet);\n        }\n\n        protected virtual void ProcessNewResult(OptimizationResult result)\n        {\n            // check if the incoming result is not the initial seed\n            if (result.Id > 0)\n            {\n                if (Constraints?.All(constraint => constraint.IsMet(result.JsonBacktestResult)) != false)\n                {\n                    if (Target.MoveAhead(result.JsonBacktestResult))\n                    {\n                        Solution = result;\n                        Target.CheckCompliance();\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Enumerate all possible arrangements\n        /// </summary>\n        /// <param name=\"args\"></param>\n        /// <returns>Collection of possible combinations for given optimization parameters settings</returns>\n        protected IEnumerable<ParameterSet> Step(HashSet<OptimizationParameter> args)\n        {\n            foreach (var step in Recursive(new Queue<OptimizationParameter>(args)))\n            {\n                yield return new ParameterSet(\n                    ++_i,\n                    step.ToDictionary(kvp => kvp.Key, kvp => kvp.Value));\n            }\n        }\n\n        /// <summary>\n        /// Calculate step and min step values based on default number of fragments\n        /// </summary>\n        private void CalculateStep(OptimizationStepParameter parameter, int defaultSegmentAmount)\n        {\n            if (defaultSegmentAmount < 1)\n            {\n                throw new ArgumentException($\"Number of segments should be positive number, but specified '{defaultSegmentAmount}'\", nameof(defaultSegmentAmount));\n            }\n\n            parameter.Step = Math.Abs(parameter.MaxValue - parameter.MinValue) / defaultSegmentAmount;\n            parameter.MinStep = parameter.Step / 10;\n        }\n\n        private IEnumerable<Dictionary<string, string>> Recursive(Queue<OptimizationParameter> args)\n        {\n            if (args.Count == 1)\n            {\n                var optimizationParameterLast = args.Dequeue();\n                using (var optimizationParameterLastEnumerator = GetEnumerator(optimizationParameterLast))\n                {\n                    while (optimizationParameterLastEnumerator.MoveNext())\n                    {\n                        yield return new Dictionary<string, string>()\n                        {\n                            {optimizationParameterLast.Name, optimizationParameterLastEnumerator.Current}\n                        };\n                    }\n                }\n\n                yield break;\n            }\n\n            var optimizationParameter = args.Dequeue();\n            using (var optimizationParameterEnumerator = GetEnumerator(optimizationParameter))\n            {\n                while (optimizationParameterEnumerator.MoveNext())\n                {\n                    foreach (var inner in Recursive(new Queue<OptimizationParameter>(args)))\n                    {\n                        inner.Add(optimizationParameter.Name, optimizationParameterEnumerator.Current);\n\n                        yield return inner;\n                    }\n                }\n            }\n        }\n\n        private IEnumerator<string> GetEnumerator(OptimizationParameter parameter)\n        {\n            var staticOptimizationParameter = parameter as StaticOptimizationParameter;\n            if (staticOptimizationParameter != null)\n            {\n                return new List<string> { staticOptimizationParameter.Value }.GetEnumerator();\n            }\n\n            var stepParameter = parameter as OptimizationStepParameter;\n            if (stepParameter == null)\n            {\n                throw new InvalidOperationException(\"\");\n            }\n\n            return new OptimizationStepParameterEnumerator(stepParameter);\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer/Strategies/StepBaseOptimizationStrategySettings.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Optimizer.Strategies\n{\n    /// <summary>\n    /// Defines the specific optimization strategy settings\n    /// </summary>\n    public class StepBaseOptimizationStrategySettings : OptimizationStrategySettings\n    {\n        /// <summary>\n        /// Defines the default number of segments for the next step\n        /// </summary>\n        [JsonProperty(\"default-segment-amount\")]\n        public int DefaultSegmentAmount { get; set; }\n    }\n}\n"
  },
  {
    "path": "Optimizer.Launcher/ConsoleLeanOptimizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Optimizer.Parameters;\nusing Log = QuantConnect.Logging.Log;\n\nnamespace QuantConnect.Optimizer.Launcher\n{\n    /// <summary>\n    /// Optimizer implementation that launches Lean as a local process\n    /// </summary>\n    public class ConsoleLeanOptimizer : LeanOptimizer\n    {\n        private readonly string _leanLocation;\n        private readonly string _rootResultDirectory;\n        private readonly string _extraLeanArguments;\n        private readonly ConcurrentDictionary<string, Process> _processByBacktestId;\n\n        /// <summary>\n        /// Creates a new instance\n        /// </summary>\n        /// <param name=\"nodePacket\">The optimization node packet to handle</param>\n        public ConsoleLeanOptimizer(OptimizationNodePacket nodePacket) : base(nodePacket)\n        {\n            _processByBacktestId = new ConcurrentDictionary<string, Process>();\n\n            _rootResultDirectory = Configuration.Config.Get(\"results-destination-folder\",\n                Path.Combine(Directory.GetCurrentDirectory(), $\"opt-{nodePacket.OptimizationId}\"));\n            Directory.CreateDirectory(_rootResultDirectory);\n\n            _leanLocation = Configuration.Config.Get(\"lean-binaries-location\",\n                Path.Combine(Directory.GetCurrentDirectory(), \"../../../Launcher/bin/Debug/QuantConnect.Lean.Launcher\"));\n\n            var closeLeanAutomatically = Configuration.Config.GetBool(\"optimizer-close-automatically\", true);\n            _extraLeanArguments = $\"--close-automatically {closeLeanAutomatically}\";\n\n            var algorithmTypeName = Configuration.Config.Get(\"algorithm-type-name\");\n            if (!string.IsNullOrEmpty(algorithmTypeName))\n            {\n                _extraLeanArguments += $\" --algorithm-type-name \\\"{algorithmTypeName}\\\"\";\n            }\n\n            var algorithmLanguage = Configuration.Config.Get(\"algorithm-language\");\n            if (!string.IsNullOrEmpty(algorithmLanguage))\n            {\n                _extraLeanArguments += $\" --algorithm-language \\\"{algorithmLanguage}\\\"\";\n            }\n\n            var algorithmLocation = Configuration.Config.Get(\"algorithm-location\");\n            if (!string.IsNullOrEmpty(algorithmLocation))\n            {\n                _extraLeanArguments += $\" --algorithm-location \\\"{algorithmLocation}\\\"\";\n            }\n        }\n\n        /// <summary>\n        /// Handles starting Lean for a given parameter set\n        /// </summary>\n        /// <param name=\"parameterSet\">The parameter set for the backtest to run</param>\n        /// <param name=\"backtestName\">The backtest name to use</param>\n        /// <returns>The new unique backtest id</returns>\n        protected override string RunLean(ParameterSet parameterSet, string backtestName)\n        {\n            var backtestId = Guid.NewGuid().ToString();\n            var optimizationId = NodePacket.OptimizationId;\n            // start each lean instance in its own directory so they store their logs & results, else they fight for the log.txt file\n            var resultDirectory = Path.Combine(_rootResultDirectory, backtestId);\n            Directory.CreateDirectory(resultDirectory);\n\n            // Use ProcessStartInfo class\n            var startInfo = new ProcessStartInfo\n            {\n                FileName = _leanLocation,\n                WorkingDirectory = Directory.GetParent(_leanLocation).FullName,\n                Arguments = $\"--results-destination-folder \\\"{resultDirectory}\\\" --algorithm-id \\\"{backtestId}\\\" --optimization-id \\\"{optimizationId}\\\" --parameters {parameterSet} --backtest-name \\\"{backtestName}\\\" {_extraLeanArguments}\",\n                WindowStyle = ProcessWindowStyle.Minimized\n            };\n\n            var process = new Process\n            {\n                StartInfo = startInfo,\n                EnableRaisingEvents = true\n            };\n            _processByBacktestId[backtestId] = process;\n\n            process.Exited += (sender, args) =>\n            {\n                if (Disposed)\n                {\n                    // handle abort\n                    return;\n                }\n\n                _processByBacktestId.TryRemove(backtestId, out process);\n                var backtestResult = $\"{backtestId}.json\";\n                var resultJson = Path.Combine(_rootResultDirectory, backtestId, backtestResult);\n                NewResult(File.Exists(resultJson) ? File.ReadAllText(resultJson) : null, backtestId);\n                process.DisposeSafely();\n            };\n\n            process.Start();\n\n            return backtestId;\n        }\n\n        /// <summary>\n        /// Stops lean process\n        /// </summary>\n        /// <param name=\"backtestId\">Specified backtest id</param>\n        protected override void AbortLean(string backtestId)\n        {\n            Process process;\n            if (_processByBacktestId.TryRemove(backtestId, out process))\n            {\n                process.Kill();\n                process.DisposeSafely();\n            }\n        }\n\n        /// <summary>\n        /// Sends an update of the current optimization status to the user\n        /// </summary>\n        protected override void SendUpdate()\n        {\n            // end handler will already log a nice message on end\n            if (Status != OptimizationStatus.Completed && Status != OptimizationStatus.Aborted)\n            {\n                var currentEstimate = GetCurrentEstimate();\n                var stats = GetRuntimeStatistics();\n                var message = $\"ConsoleLeanOptimizer.SendUpdate(): {currentEstimate} {string.Join(\", \", stats.Select(pair => $\"{pair.Key}:{pair.Value}\"))}\";\n                var currentBestBacktest = Strategy.Solution;\n                if (currentBestBacktest != null)\n                {\n                    message += $\". Best id:'{currentBestBacktest.BacktestId}'. {OptimizationTarget}. Parameters ({currentBestBacktest.ParameterSet})\";\n                }\n                Log.Trace(message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer.Launcher/Program.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing QuantConnect.Configuration;\nusing QuantConnect.Logging;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\n\nnamespace QuantConnect.Optimizer.Launcher\n{\n    public class Program\n    {\n        public static void Main(string[] args)\n        {\n            // Parse report arguments and merge with config to use in the optimizer\n            if (args.Length > 0)\n            {\n                Config.MergeCommandLineArgumentsWithConfiguration(OptimizerArgumentParser.ParseArguments(args));\n            }\n\n            using var endedEvent = new ManualResetEvent(false);\n\n            try\n            {\n                Log.DebuggingEnabled = Config.GetBool(\"debug-mode\");\n                Log.FilePath = Path.Combine(Config.Get(\"results-destination-folder\"), \"log.txt\");\n                Log.LogHandler = Composer.Instance.GetExportedValueByTypeName<ILogHandler>(Config.Get(\"log-handler\", \"CompositeLogHandler\"));\n\n                var optimizationStrategyName = Config.Get(\"optimization-strategy\",\n                    \"QuantConnect.Optimizer.GridSearchOptimizationStrategy\");\n                var channel = Config.Get(\"data-channel\");\n                var optimizationId = Config.Get(\"optimization-id\", Guid.NewGuid().ToString());\n                var packet = new OptimizationNodePacket\n                {\n                    OptimizationId = optimizationId,\n                    OptimizationStrategy = optimizationStrategyName,\n                    OptimizationStrategySettings = (OptimizationStrategySettings)JsonConvert.DeserializeObject(Config.Get(\n                        \"optimization-strategy-settings\",\n                        \"{\\\"$type\\\":\\\"QuantConnect.Optimizer.Strategies.OptimizationStrategySettings, QuantConnect.Optimizer\\\"}\"), new JsonSerializerSettings(){TypeNameHandling = TypeNameHandling.All}),\n                    Criterion = JsonConvert.DeserializeObject<Target>(Config.Get(\"optimization-criterion\", \"{\\\"target\\\":\\\"Statistics.TotalProfit\\\", \\\"extremum\\\": \\\"max\\\"}\")),\n                    Constraints = JsonConvert.DeserializeObject<List<Constraint>>(Config.Get(\"constraints\", \"[]\")).AsReadOnly(),\n                    OptimizationParameters = JsonConvert.DeserializeObject<HashSet<OptimizationParameter>>(Config.Get(\"parameters\", \"[]\")),\n                    MaximumConcurrentBacktests = Config.GetInt(\"maximum-concurrent-backtests\", Math.Max(1, Environment.ProcessorCount / 2)),\n                    Channel = channel,\n                };\n\n                var outOfSampleMaxEndDate = Config.Get(\"out-of-sample-max-end-date\");\n                if (!string.IsNullOrEmpty(outOfSampleMaxEndDate))\n                {\n                    packet.OutOfSampleMaxEndDate = Time.ParseDate(outOfSampleMaxEndDate);\n                }\n                packet.OutOfSampleDays = Config.GetInt(\"out-of-sample-days\");\n\n                var optimizerType = Config.Get(\"optimization-launcher\", typeof(ConsoleLeanOptimizer).Name);\n                var optimizer = (LeanOptimizer)Activator.CreateInstance(Composer.Instance.GetExportedTypes<LeanOptimizer>().Single(x => x.Name == optimizerType), packet);\n\n                if (Config.GetBool(\"estimate\", false))\n                {\n                    var backtestsCount = optimizer.GetCurrentEstimate();\n                    Log.Trace($\"Optimization estimate: {backtestsCount}\");\n\n                    optimizer.DisposeSafely();\n                    endedEvent.Set();\n                }\n                else\n                {\n                    optimizer.Start();\n\n                    optimizer.Ended += (s, e) =>\n                    {\n                        optimizer.DisposeSafely();\n                        endedEvent.Set();\n                    };\n                }\n            }\n            catch (Exception e)\n            {\n                Log.Error(e);\n            }\n\n            // Wait until the optimizer has stopped running before exiting\n            endedEvent.WaitOne();\n        }\n    }\n}\n"
  },
  {
    "path": "Optimizer.Launcher/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Optimizer.Launcher\")]\n[assembly: AssemblyProduct(\"QuantConnect.Optimizer.Launcher\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"d46d2a8d-340c-4b40-8ee6-6baa7b1198ab\")]"
  },
  {
    "path": "Optimizer.Launcher/QuantConnect.Optimizer.Launcher.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>QuantConnect.Optimizer.Launcher</RootNamespace>\n    <AssemblyName>QuantConnect.Optimizer.Launcher</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Optimizer Launcher Project - The Lean optimization engine launcher</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <Features>flow-analysis</Features>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"config.example.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Optimizer\\QuantConnect.Optimizer.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Optimizer.Launcher/config.example.json",
    "content": "{\n  // optional: algorithm class selector\n  \"algorithm-type-name\": \"ParameterizedAlgorithm\",\n\n  // optional: Algorithm language selector - options CSharp, Python\n  \"algorithm-language\": \"CSharp\",\n\n  // optional: Physical DLL location\n  \"algorithm-location\": \"QuantConnect.Algorithm.CSharp.dll\",\n\n  \"optimizer-close-automatically\": true,\n\n  // How we manage solutions and make decision to continue or stop\n  \"optimization-strategy\": \"QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy\",\n\n  // on-demand settings required for different optimization strategies\n  \"optimization-strategy-settings\": {\n    \"$type\": \"QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategySettings, QuantConnect.Optimizer\",\n    \"default-segment-amount\": 10\n  },\n\n  // optimization problem\n  \"optimization-criterion\": {\n    // path in algorithm output json\n    \"target\": \"Statistics.Sharpe Ratio\",\n\n    // optimization: available options max, min\n    \"extremum\": \"max\",\n\n    // optional, if defined and backtest complies with the targets then trigger ended event\n    \"target-value\": 3\n  },\n\n  // if it doesn't comply just drop the backtest\n  \"constraints\": [\n    {\n      \"target\": \"Drawdown\",\n      \"operator\": \"lessOrEqual\", // less, greaterOrEqual, greater, notEqual, equals\n      \"target-value\": 0.15\n    },\n    {\n      \"target\": \"Total Trades\",\n      \"operator\": \"greater\",\n      \"target-value\": 2\n    }\n  ],\n\n  // optional: default is process count / 2\n  //\"maximum-concurrent-backtests\": 10,\n\n  // optimization parameters\n  \"parameters\": [\n    {\n      \"name\": \"ema-slow\",\n      \"min\": 10,\n      \"max\": 50\n    },\n    {\n      \"name\": \"ema-fast\",\n      \"min\": 50,\n      \"max\": 150,\n      \"step\": 50,\n\n      // optional\n      \"min-step\": 0.0001\n    }\n  ]\n}\n"
  },
  {
    "path": "QuantConnect.Lean.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.4.33205.214\nMinimumVisualStudioVersion = 15.0.0.0\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Lean.Launcher\", \"Launcher\\QuantConnect.Lean.Launcher.csproj\", \"{09E7B916-E58B-4021-BD8B-C10B4446E226}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Lean.Engine\", \"Engine\\QuantConnect.Lean.Engine.csproj\", \"{12156F46-D07E-4E3D-AD2B-7409E82AB62F}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{C5D44209-49A0-4505-A870-043C5EF5FDDF} = {C5D44209-49A0-4505-A870-043C5EF5FDDF}\n\t\t{39A81C16-A1E8-425E-A8F2-1433ADB80228} = {39A81C16-A1E8-425E-A8F2-1433ADB80228}\n\t\t{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8} = {F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}\n\t\t{D6633172-1368-4DF6-9444-825C3E00C819} = {D6633172-1368-4DF6-9444-825C3E00C819}\n\t\t{3240ACA4-BDD4-4D24-AC36-BBB651C39212} = {3240ACA4-BDD4-4D24-AC36-BBB651C39212}\n\tEndProjectSection\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Algorithm\", \"Algorithm\\QuantConnect.Algorithm.csproj\", \"{3240ACA4-BDD4-4D24-AC36-BBB651C39212}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect\", \"Common\\QuantConnect.csproj\", \"{2545C0B4-FABB-49C9-8DD1-9AD7EE23F86B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Logging\", \"Logging\\QuantConnect.Logging.csproj\", \"{01911409-86BE-4E7D-9947-DF714138610D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Indicators\", \"Indicators\\QuantConnect.Indicators.csproj\", \"{73FB2522-C3ED-4E47-8E3D-AFAD48A6B888}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Tests\", \"Tests\\QuantConnect.Tests.csproj\", \"{F15E0E67-E6CA-4BE4-BA36-54D73C5ACC11}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Queues\", \"Queues\\QuantConnect.Queues.csproj\", \"{D6633172-1368-4DF6-9444-825C3E00C819}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Messaging\", \"Messaging\\QuantConnect.Messaging.csproj\", \"{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.AlgorithmFactory\", \"AlgorithmFactory\\QuantConnect.AlgorithmFactory.csproj\", \"{E99D056A-B6FB-48D2-9F7C-683C54CEBBF9}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Brokerages\", \"Brokerages\\QuantConnect.Brokerages.csproj\", \"{2D3E13CF-2D14-4180-A42D-F0A13AF0ADE2}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Configuration\", \"Configuration\\QuantConnect.Configuration.csproj\", \"{0AEB4EA3-28C8-476E-89FD-926F06590B4C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Compression\", \"Compression\\QuantConnect.Compression.csproj\", \"{BC3BC77E-0502-43DB-A727-B94F9765D74B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Api\", \"Api\\QuantConnect.Api.csproj\", \"{C5D44209-49A0-4505-A870-043C5EF5FDDF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Algorithm.CSharp\", \"Algorithm.CSharp\\QuantConnect.Algorithm.CSharp.csproj\", \"{39A81C16-A1E8-425E-A8F2-1433ADB80228}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Algorithm.Python\", \"Algorithm.Python\\QuantConnect.Algorithm.Python.csproj\", \"{48289996-CE56-4EDF-B451-4A2B1519EBC3}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.ToolBox\", \"ToolBox\\QuantConnect.ToolBox.csproj\", \"{AC9A142C-B485-44D7-91FF-015C22C43D05}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Research\", \"Research\\QuantConnect.Research.csproj\", \"{9561D14A-467E-40AD-928E-EE9F758D7D98}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Algorithm.Framework\", \"Algorithm.Framework\\QuantConnect.Algorithm.Framework.csproj\", \"{75981418-7246-4B91-B136-482728E02901}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Report\", \"Report\\QuantConnect.Report.csproj\", \"{2431419F-8BC6-4F59-944E-9A1CD28982DF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Optimizer\", \"Optimizer\\QuantConnect.Optimizer.csproj\", \"{4ECD7DF3-A675-4E9E-ACA3-2B51C88736CE}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.Optimizer.Launcher\", \"Optimizer.Launcher\\QuantConnect.Optimizer.Launcher.csproj\", \"{D46D2A8D-340C-4B40-8EE6-6BAA7B1198AB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"QuantConnect.DownloaderDataProvider.Launcher\", \"DownloaderDataProvider\\QuantConnect.DownloaderDataProvider.Launcher.csproj\", \"{D139191E-50D5-4284-AC9C-247ED60950F4}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{09E7B916-E58B-4021-BD8B-C10B4446E226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{09E7B916-E58B-4021-BD8B-C10B4446E226}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{09E7B916-E58B-4021-BD8B-C10B4446E226}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{09E7B916-E58B-4021-BD8B-C10B4446E226}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{12156F46-D07E-4E3D-AD2B-7409E82AB62F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{12156F46-D07E-4E3D-AD2B-7409E82AB62F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{12156F46-D07E-4E3D-AD2B-7409E82AB62F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{12156F46-D07E-4E3D-AD2B-7409E82AB62F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3240ACA4-BDD4-4D24-AC36-BBB651C39212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3240ACA4-BDD4-4D24-AC36-BBB651C39212}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3240ACA4-BDD4-4D24-AC36-BBB651C39212}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3240ACA4-BDD4-4D24-AC36-BBB651C39212}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2545C0B4-FABB-49C9-8DD1-9AD7EE23F86B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2545C0B4-FABB-49C9-8DD1-9AD7EE23F86B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2545C0B4-FABB-49C9-8DD1-9AD7EE23F86B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2545C0B4-FABB-49C9-8DD1-9AD7EE23F86B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{01911409-86BE-4E7D-9947-DF714138610D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{01911409-86BE-4E7D-9947-DF714138610D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{01911409-86BE-4E7D-9947-DF714138610D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{01911409-86BE-4E7D-9947-DF714138610D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{73FB2522-C3ED-4E47-8E3D-AFAD48A6B888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{73FB2522-C3ED-4E47-8E3D-AFAD48A6B888}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{73FB2522-C3ED-4E47-8E3D-AFAD48A6B888}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{73FB2522-C3ED-4E47-8E3D-AFAD48A6B888}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F15E0E67-E6CA-4BE4-BA36-54D73C5ACC11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F15E0E67-E6CA-4BE4-BA36-54D73C5ACC11}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F15E0E67-E6CA-4BE4-BA36-54D73C5ACC11}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F15E0E67-E6CA-4BE4-BA36-54D73C5ACC11}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D6633172-1368-4DF6-9444-825C3E00C819}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D6633172-1368-4DF6-9444-825C3E00C819}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D6633172-1368-4DF6-9444-825C3E00C819}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D6633172-1368-4DF6-9444-825C3E00C819}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F2E90E2D-BA25-40E2-B39A-0BA31E68F7F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E99D056A-B6FB-48D2-9F7C-683C54CEBBF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E99D056A-B6FB-48D2-9F7C-683C54CEBBF9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E99D056A-B6FB-48D2-9F7C-683C54CEBBF9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E99D056A-B6FB-48D2-9F7C-683C54CEBBF9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D3E13CF-2D14-4180-A42D-F0A13AF0ADE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2D3E13CF-2D14-4180-A42D-F0A13AF0ADE2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2D3E13CF-2D14-4180-A42D-F0A13AF0ADE2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D3E13CF-2D14-4180-A42D-F0A13AF0ADE2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0AEB4EA3-28C8-476E-89FD-926F06590B4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0AEB4EA3-28C8-476E-89FD-926F06590B4C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0AEB4EA3-28C8-476E-89FD-926F06590B4C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0AEB4EA3-28C8-476E-89FD-926F06590B4C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BC3BC77E-0502-43DB-A727-B94F9765D74B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BC3BC77E-0502-43DB-A727-B94F9765D74B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BC3BC77E-0502-43DB-A727-B94F9765D74B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BC3BC77E-0502-43DB-A727-B94F9765D74B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C5D44209-49A0-4505-A870-043C5EF5FDDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C5D44209-49A0-4505-A870-043C5EF5FDDF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C5D44209-49A0-4505-A870-043C5EF5FDDF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C5D44209-49A0-4505-A870-043C5EF5FDDF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{39A81C16-A1E8-425E-A8F2-1433ADB80228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{39A81C16-A1E8-425E-A8F2-1433ADB80228}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{39A81C16-A1E8-425E-A8F2-1433ADB80228}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{39A81C16-A1E8-425E-A8F2-1433ADB80228}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{48289996-CE56-4EDF-B451-4A2B1519EBC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{48289996-CE56-4EDF-B451-4A2B1519EBC3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AC9A142C-B485-44D7-91FF-015C22C43D05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AC9A142C-B485-44D7-91FF-015C22C43D05}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AC9A142C-B485-44D7-91FF-015C22C43D05}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AC9A142C-B485-44D7-91FF-015C22C43D05}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{9561D14A-467E-40AD-928E-EE9F758D7D98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9561D14A-467E-40AD-928E-EE9F758D7D98}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9561D14A-467E-40AD-928E-EE9F758D7D98}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9561D14A-467E-40AD-928E-EE9F758D7D98}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{75981418-7246-4B91-B136-482728E02901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{75981418-7246-4B91-B136-482728E02901}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{75981418-7246-4B91-B136-482728E02901}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{75981418-7246-4B91-B136-482728E02901}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2431419F-8BC6-4F59-944E-9A1CD28982DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2431419F-8BC6-4F59-944E-9A1CD28982DF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2431419F-8BC6-4F59-944E-9A1CD28982DF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2431419F-8BC6-4F59-944E-9A1CD28982DF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4ECD7DF3-A675-4E9E-ACA3-2B51C88736CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4ECD7DF3-A675-4E9E-ACA3-2B51C88736CE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4ECD7DF3-A675-4E9E-ACA3-2B51C88736CE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4ECD7DF3-A675-4E9E-ACA3-2B51C88736CE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D46D2A8D-340C-4B40-8EE6-6BAA7B1198AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D46D2A8D-340C-4B40-8EE6-6BAA7B1198AB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D46D2A8D-340C-4B40-8EE6-6BAA7B1198AB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D46D2A8D-340C-4B40-8EE6-6BAA7B1198AB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D139191E-50D5-4284-AC9C-247ED60950F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D139191E-50D5-4284-AC9C-247ED60950F4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D139191E-50D5-4284-AC9C-247ED60950F4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D139191E-50D5-4284-AC9C-247ED60950F4}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {67BACDB0-1FDB-4AF0-A199-88CF436FB470}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Queues/JobQueue.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Fasterflect;\nusing Newtonsoft.Json;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Python;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Queues\n{\n    /// <summary>\n    /// Implementation of local/desktop job request:\n    /// </summary>\n    public class JobQueue : IJobQueueHandler\n    {\n        // The type name of the QuantConnect.Brokerages.Paper.PaperBrokerage\n        private static readonly TextWriter Console = System.Console.Out;\n\n        private const string PaperBrokerageTypeName = \"PaperBrokerage\";\n        private const string DefaultHistoryProvider = \"SubscriptionDataReaderHistoryProvider\";\n        private const string DefaultDataQueueHandler = \"LiveDataQueue\";\n        private const string DefaultDataChannelProvider = \"DataChannelProvider\";\n        private static readonly string Channel = Config.Get(\"data-channel\");\n        private readonly string AlgorithmTypeName = Config.Get(\"algorithm-type-name\");\n        private Language? _language;\n\n        /// <summary>\n        /// This property is protected for testing purposes\n        /// </summary>\n        protected Language Language\n        {\n            get\n            {\n                if (_language == null)\n                {\n                    string algorithmLanguage = Config.Get(\"algorithm-language\");\n                    if (string.IsNullOrEmpty(algorithmLanguage))\n                    {\n                        var extension = Path.GetExtension(AlgorithmLocation).ToLower();\n                        switch (extension)\n                        {\n                            case \".dll\":\n                                _language = Language.CSharp;\n                                break;\n                            case \".py\":\n                                _language = Language.Python;\n                                break;\n                            default:\n                                throw new ArgumentException($\"Unknown extension, algorithm extension was {extension}\");\n                        }\n                    }\n                    else\n                    {\n                        _language = (Language)Enum.Parse(typeof(Language), algorithmLanguage, ignoreCase: true);\n                    }\n                }\n\n                return (Language)_language;\n            }\n        }\n\n        /// <summary>\n        /// Physical location of Algorithm DLL.\n        /// </summary>\n        /// <remarks>We expect this dll to be copied into the output directory</remarks>\n        private string AlgorithmLocation { get; } = Config.Get(\"algorithm-location\", \"QuantConnect.Algorithm.CSharp.dll\");\n\n        /// <summary>\n        /// Initialize the job queue:\n        /// </summary>\n        public void Initialize(IApi api, IMessagingHandler messagingHandler)\n        {\n            api.Initialize(Globals.UserId, Globals.UserToken, Globals.DataFolder);\n        }\n\n        /// <summary>\n        /// Gets Brokerage Factory for provided IDQH\n        /// </summary>\n        /// <param name=\"dataQueueHandler\"></param>\n        /// <returns>An Instance of Brokerage Factory if possible, otherwise null</returns>\n        public static IBrokerageFactory GetFactoryFromDataQueueHandler(string dataQueueHandler)\n        {\n            IBrokerageFactory brokerageFactory = null;\n            var dataQueueHandlerType = Composer.Instance.GetExportedTypes<IBrokerage>()\n                .FirstOrDefault(x =>\n                    x.FullName != null &&\n                    x.FullName.EndsWith(dataQueueHandler, StringComparison.InvariantCultureIgnoreCase) &&\n                    x.HasAttribute(typeof(BrokerageFactoryAttribute)));\n\n            if (dataQueueHandlerType != null)\n            {\n                var attribute = dataQueueHandlerType.GetCustomAttribute<BrokerageFactoryAttribute>();\n                brokerageFactory = (BrokerageFactory)Activator.CreateInstance(attribute.Type);\n            }\n            return brokerageFactory;\n        }\n\n        /// <summary>\n        /// Desktop/Local Get Next Task - Get task from the Algorithm folder of VS Solution.\n        /// </summary>\n        /// <returns></returns>\n        public AlgorithmNodePacket NextJob(out string algorithmPath)\n        {\n            algorithmPath = GetAlgorithmLocation();\n\n            Log.Trace($\"JobQueue.NextJob(): Selected {algorithmPath}\");\n\n            // check for parameters in the config\n            var parameters = new Dictionary<string, string>();\n\n            var parametersConfigString = Config.Get(\"parameters\");\n            if (!string.IsNullOrEmpty(parametersConfigString))\n            {\n                parameters = JsonConvert.DeserializeObject<Dictionary<string, string>>(parametersConfigString);\n            }\n\n            var controls = new Controls()\n            {\n                MinuteLimit = Config.GetInt(\"symbol-minute-limit\", 10000),\n                SecondLimit = Config.GetInt(\"symbol-second-limit\", 10000),\n                TickLimit = Config.GetInt(\"symbol-tick-limit\", 10000),\n                RamAllocation = int.MaxValue,\n                MaximumDataPointsPerChartSeries = Config.GetInt(\"maximum-data-points-per-chart-series\", 1000000),\n                MaximumChartSeries = Config.GetInt(\"maximum-chart-series\", 30),\n                StorageLimit = Config.GetValue(\"storage-limit\", 10737418240L),\n                StorageFileCount = Config.GetInt(\"storage-file-count\", 10000),\n                StorageAccess = Config.GetValue(\"storage-permissions\", new Packets.StoragePermissions())\n            };\n\n            var algorithmId = Config.Get(\"algorithm-id\", AlgorithmTypeName);\n\n            //If this isn't a backtesting mode/request, attempt a live job.\n            if (Globals.LiveMode)\n            {\n                var dataHandlers = Config.Get(\"data-queue-handler\", DefaultDataQueueHandler);\n                var liveJob = new LiveNodePacket\n                {\n                    Type = PacketType.LiveNode,\n                    Algorithm = File.ReadAllBytes(AlgorithmLocation),\n                    Brokerage = Config.Get(\"live-mode-brokerage\", PaperBrokerageTypeName),\n                    HistoryProvider = Config.Get(\"history-provider\", DefaultHistoryProvider),\n                    DataQueueHandler = dataHandlers,\n                    DataChannelProvider = Config.Get(\"data-channel-provider\", DefaultDataChannelProvider),\n                    Channel = Channel,\n                    UserToken = Globals.UserToken,\n                    UserId = Globals.UserId,\n                    ProjectId = Globals.ProjectId,\n                    OrganizationId = Globals.OrganizationID,\n                    Version = Globals.Version,\n                    DeployId = algorithmId,\n                    Parameters = parameters,\n                    Language = Language,\n                    Controls = controls,\n                    PythonVirtualEnvironment = Config.Get(\"python-venv\"),\n                    DeploymentTarget = DeploymentTarget.LocalPlatform,\n                };\n\n                Type brokerageName = null;\n                try\n                {\n                    // import the brokerage data for the configured brokerage\n                    var brokerageFactory = Composer.Instance.Single<IBrokerageFactory>(factory => factory.BrokerageType.MatchesTypeName(liveJob.Brokerage));\n                    brokerageName = brokerageFactory.BrokerageType;\n                    liveJob.BrokerageData = brokerageFactory.BrokerageData;\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err, $\"Error resolving BrokerageData for live job for brokerage {liveJob.Brokerage}\");\n                }\n\n                var brokerageBasedHistoryProvider = liveJob.HistoryProvider.DeserializeList().Select(x =>\n                {\n                    HistoryExtensions.TryGetBrokerageName(x, out var brokerageName);\n                    return brokerageName;\n                }).Where(x => x != null);\n\n                foreach (var dataHandlerName in dataHandlers.DeserializeList().Concat(brokerageBasedHistoryProvider).Distinct())\n                {\n                    var brokerageFactoryForDataHandler = GetFactoryFromDataQueueHandler(dataHandlerName);\n                    if (brokerageFactoryForDataHandler == null)\n                    {\n                        Log.Trace($\"JobQueue.NextJob(): Not able to fetch brokerage factory with name: {dataHandlerName}\");\n                        continue;\n                    }\n                    if (brokerageFactoryForDataHandler.BrokerageType == brokerageName)\n                    {\n                        //Don't need to add brokerageData again if added by brokerage\n                        continue;\n                    }\n                    foreach (var data in brokerageFactoryForDataHandler.BrokerageData)\n                    {\n                        if (data.Key == \"live-holdings\" || data.Key == \"live-cash-balance\")\n                        {\n                            //live holdings & cash balance not required for data handler\n                            continue;\n                        }\n\n                        liveJob.BrokerageData.TryAdd(data.Key, data.Value);\n                    }\n                }\n                return liveJob;\n            }\n\n            var optimizationId = Config.Get(\"optimization-id\");\n            //Default run a backtesting job.\n            var backtestJob = new BacktestNodePacket(0, 0, \"\", new byte[] { }, Config.Get(\"backtest-name\", \"local\"))\n            {\n                Type = PacketType.BacktestNode,\n                Algorithm = File.ReadAllBytes(AlgorithmLocation),\n                HistoryProvider = Config.Get(\"history-provider\", DefaultHistoryProvider),\n                Channel = Channel,\n                UserToken = Globals.UserToken,\n                UserId = Globals.UserId,\n                ProjectId = Globals.ProjectId,\n                OrganizationId = Globals.OrganizationID,\n                Version = Globals.Version,\n                BacktestId = algorithmId,\n                Language = Language,\n                Parameters = parameters,\n                Controls = controls,\n                PythonVirtualEnvironment = Config.Get(\"python-venv\"),\n                DeploymentTarget = DeploymentTarget.LocalPlatform,\n            };\n\n            var outOfSampleMaxEndDate = Config.Get(\"out-of-sample-max-end-date\");\n            if (!string.IsNullOrEmpty(outOfSampleMaxEndDate))\n            {\n                backtestJob.OutOfSampleMaxEndDate = Time.ParseDate(outOfSampleMaxEndDate);\n            }\n            backtestJob.OutOfSampleDays = Config.GetInt(\"out-of-sample-days\");\n\n            // Only set optimization id when backtest is for optimization\n            if (!optimizationId.IsNullOrEmpty())\n            {\n                backtestJob.OptimizationId = optimizationId;\n            }\n\n            return backtestJob;\n        }\n\n        /// <summary>\n        /// Get the algorithm location for client side backtests.\n        /// </summary>\n        /// <returns></returns>\n        private string GetAlgorithmLocation()\n        {\n            if (Language == Language.Python)\n            {\n                if (!File.Exists(AlgorithmLocation))\n                {\n                    throw new FileNotFoundException($\"JobQueue.TryCreatePythonAlgorithm(): Unable to find py file: {AlgorithmLocation}\");\n                }\n\n                // Add this directory to our Python Path so it may be imported properly\n                var pythonFile = new FileInfo(AlgorithmLocation);\n                PythonInitializer.AddAlgorithmLocationPath(pythonFile.Directory.FullName);\n            }\n\n            return AlgorithmLocation;\n        }\n\n        /// <summary>\n        /// Desktop/Local acknowledge the task processed. Nothing to do.\n        /// </summary>\n        /// <param name=\"job\"></param>\n        public void AcknowledgeJob(AlgorithmNodePacket job)\n        {\n            // Make the console window pause so we can read log output before exiting and killing the application completely\n            Console.WriteLine(\"Engine.Main(): Analysis Complete.\");\n            // closing automatically is useful for optimization, we don't want to leave open all the ended lean instances\n            if (!Config.GetBool(\"close-automatically\"))\n            {\n                Console.WriteLine(\"Engine.Main(): Press any key to continue.\");\n                System.Console.Read();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Queues/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Queues\")]\n[assembly: AssemblyProduct(\"QuantConnect.Queues\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"8c3e97c8-8e81-414c-a93d-9aab9e8f9d2c\")]"
  },
  {
    "path": "Queues/QuantConnect.Queues.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Queues</RootNamespace>\n    <AssemblyName>QuantConnect.Queues</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Queues.xml</DocumentationFile>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Queues Project - Handles and generates live and backtesting algorithm jobs</Description>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Target Name=\"Print\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <ItemGroup>\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Brokerages\\QuantConnect.Brokerages.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Report/Crisis.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Crisis events utility class\n    /// </summary>\n    public class Crisis\n    {\n        /// <summary>\n        /// Crisis events and pre-defined values\n        /// </summary>\n        public static readonly Dictionary<CrisisEvent, Crisis> Events = new Dictionary<CrisisEvent, Crisis>\n        {\n            {CrisisEvent.DotCom, new Crisis(\"DotCom Bubble 2000\", new DateTime(2000, 2, 26), new DateTime(2000, 9, 10)) },\n            {CrisisEvent.SeptemberEleventh, new Crisis(\"September 11, 2001\", new DateTime(2001, 9, 5), new DateTime(2001, 10, 10)) },\n            {CrisisEvent.USHousingBubble2003, new Crisis(\"U.S. Housing Bubble 2003\", new DateTime(2003, 1, 1), new DateTime(2003, 2, 20)) },\n            {CrisisEvent.GlobalFinancialCrisis, new Crisis(\"Global Financial Crisis 2007\", new DateTime(2007, 10, 1), new DateTime(2011, 12, 1))},\n            {CrisisEvent.FlashCrash, new Crisis(\"Flash Crash 2010\", new DateTime(2010, 5, 1), new DateTime(2010, 5, 22))},\n            {CrisisEvent.FukushimaMeltdown, new Crisis(\"Fukushima Meltdown 2011\", new DateTime(2011, 3, 1), new DateTime(2011, 4, 22)) },\n            {CrisisEvent.USDowngradeEuropeanDebt, new Crisis(\"U.S. Credit Downgrade 2011\", new DateTime(2011, 8, 5), new DateTime(2011, 9, 1))},\n            {CrisisEvent.EurozoneSeptember2012, new Crisis(\"ECB IR Event 2012\", new DateTime(2012, 9, 5), new DateTime(2012, 10, 12))},\n            {CrisisEvent.EurozoneOctober2014, new Crisis(\"European Debt Crisis 2014\", new DateTime(2014, 10, 1), new DateTime(2014, 10, 29))},\n            {CrisisEvent.MarketSellOff2015, new Crisis(\"Market Sell-Off 2015\", new DateTime(2015, 8, 10), new DateTime(2015, 10, 10))},\n            {CrisisEvent.Recovery, new Crisis(\"Recovery 2010-2012\", new DateTime(2010, 1, 1), new DateTime(2012, 10, 1))},\n            {CrisisEvent.NewNormal, new Crisis(\"New Normal 2014-2019\", new DateTime(2014, 1, 1), new DateTime(2019, 1, 1))},\n            {CrisisEvent.COVID19, new Crisis(\"COVID-19 Pandemic 2020\", new DateTime(2020, 2, 10), new DateTime(2020, 9, 20))},\n            {CrisisEvent.PostCOVIDRunUp, new Crisis(\"Post-COVID Run-up 2020-2021\", new DateTime(2020, 4, 1), new DateTime(2022, 1, 1))},\n            {CrisisEvent.MemeSeason, new Crisis(\"Meme Season 2021\", new DateTime(2021, 1, 1), new DateTime(2021, 5, 15))},\n            {CrisisEvent.RussiaInvadesUkraine, new Crisis(\"Russia Invades Ukraine 2022-2023\", new DateTime(2022, 2, 1), new DateTime(2024, 1, 1))},\n            {CrisisEvent.AIBoom, new Crisis(\"AI Boom 2022-Present\", new DateTime(2022, 11, 30), DateTime.Now)},\n        };\n\n        /// <summary>\n        /// Start of the crisis event\n        /// </summary>\n        public DateTime Start { get; }\n\n        /// <summary>\n        /// End of the crisis event\n        /// </summary>\n        public DateTime End { get; }\n\n        /// <summary>\n        /// Name of the crisis\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Creates a new crisis instance with the given name and start/end date.\n        /// </summary>\n        /// <param name=\"name\">Name of the crisis</param>\n        /// <param name=\"start\">Start date of the crisis</param>\n        /// <param name=\"end\">End date of the crisis</param>\n        public Crisis(string name, DateTime start, DateTime end)\n        {\n            Name = name;\n            Start = start;\n            End = end;\n        }\n\n        /// <summary>\n        /// Returns a pre-defined crisis event\n        /// </summary>\n        /// <param name=\"crisisEvent\">Crisis Event</param>\n        /// <returns>Pre-defined crisis event</returns>\n        public static Crisis FromCrisis(CrisisEvent crisisEvent)\n        {\n            return Events[crisisEvent];\n        }\n\n        /// <summary>\n        /// Converts instance to string using the dates in the instance as start/end dates\n        /// </summary>\n        /// <returns></returns>\n        public override string ToString()\n        {\n            return ToString(Start, End);\n        }\n\n        /// <summary>\n        /// Converts instance to string using the provided dates\n        /// </summary>\n        /// <param name=\"start\">Start date</param>\n        /// <param name=\"end\">End date</param>\n        /// <returns></returns>\n        public string ToString(DateTime start, DateTime end)\n        {\n            return $\"{Name}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/CrisisEvent.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Crisis Events\n    /// </summary>\n    public enum CrisisEvent\n    {\n        /// <summary>\n        /// DotCom bubble - https://en.wikipedia.org/wiki/Dot-com_bubble (0)\n        /// </summary>\n        DotCom,\n\n        /// <summary>\n        /// September 11, 2001 attacks - https://en.wikipedia.org/wiki/September_11_attacks (1)\n        /// </summary>\n        SeptemberEleventh,\n\n        /// <summary>\n        /// United States housing bubble - https://en.wikipedia.org/wiki/United_States_housing_bubble (2)\n        /// </summary>\n        USHousingBubble2003,\n\n        /// <summary>\n        /// https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80%9308 (3)\n        /// </summary>\n        GlobalFinancialCrisis,\n\n        /// <summary>\n        /// The flash crash of 2010 - https://en.wikipedia.org/wiki/2010_Flash_Crash (4)\n        /// </summary>\n        FlashCrash,\n\n        /// <summary>\n        /// Fukushima nuclear power plant meltdown - https://en.wikipedia.org/wiki/Fukushima_Daiichi_nuclear_disaster (5)\n        /// </summary>\n        FukushimaMeltdown,\n\n        /// <summary>\n        /// United States credit rating downgrade - https://en.wikipedia.org/wiki/United_States_federal_government_credit-rating_downgrades\n        /// European debt crisis - https://en.wikipedia.org/wiki/European_debt_crisis (6)\n        /// </summary>\n        USDowngradeEuropeanDebt,\n\n        /// <summary>\n        /// European debt crisis - https://en.wikipedia.org/wiki/European_debt_crisis (7)\n        /// </summary>\n        EurozoneSeptember2012,\n\n        /// <summary>\n        /// European debt crisis - https://en.wikipedia.org/wiki/European_debt_crisis (8)\n        /// </summary>\n        EurozoneOctober2014,\n\n        /// <summary>\n        /// 2015-2016 market sell off https://en.wikipedia.org/wiki/2015%E2%80%9316_stock_market_selloff (9)\n        /// </summary>\n        MarketSellOff2015,\n\n        /// <summary>\n        /// Crisis recovery (2010 - 2012) (10)\n        /// </summary>\n        Recovery,\n\n        /// <summary>\n        /// 2014 - 2019 market performance (11)\n        /// </summary>\n        NewNormal,\n\n        /// <summary>\n        /// COVID-19 pandemic market crash (12)\n        /// </summary>\n        COVID19,\n\n        /// <summary>\n        /// Post COVID-19 recovery (13)\n        /// </summary>\n        PostCOVIDRunUp,\n\n        /// <summary>\n        /// Meme-craze era like GME, AMC, and DOGE (14)\n        /// </summary>\n        MemeSeason,\n\n        /// <summary>\n        /// Russia invased Ukraine (15)\n        /// </summary>\n        RussiaInvadesUkraine,\n\n        /// <summary>\n        /// Artificial intelligence boom (16)\n        /// </summary>\n        AIBoom\n    }\n}\n"
  },
  {
    "path": "Report/DeedleUtil.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Utility extension methods for Deedle series/frames\n    /// </summary>\n    public static class DeedleUtil\n    {\n        /// <summary>\n        /// Calculates the cumulative sum for the given series\n        /// </summary>\n        /// <param name=\"input\">Series to calculate cumulative sum for</param>\n        /// <returns>Cumulative sum in series form</returns>\n        public static Series<DateTime, double> CumulativeSum(this Series<DateTime, double> input)\n        {\n            if (input.IsEmpty)\n            {\n                return input;\n            }\n\n            var prev = 0.0;\n\n            return input.SelectValues(current =>\n            {\n                var sum = prev + current;\n                prev = sum;\n\n                return sum;\n            });\n        }\n\n        /// <summary>\n        /// Calculates the cumulative product of the series. This is equal to the python pandas method: `df.cumprod()`\n        /// </summary>\n        /// <param name=\"input\">Input series</param>\n        /// <returns>Cumulative product</returns>\n        public static Series<DateTime, double> CumulativeProduct(this Series<DateTime, double> input)\n        {\n            if (input.IsEmpty)\n            {\n                return input;\n            }\n\n            var prev = 1.0;\n\n            return input.SelectValues(current =>\n            {\n                var product = prev * current;\n                prev = product;\n\n                return product;\n            });\n        }\n\n        /// <summary>\n        /// Calculates the cumulative max of the series. This is equal to the python pandas method: `df.cummax()`.\n        /// </summary>\n        /// <param name=\"input\"></param>\n        /// <returns></returns>\n        public static Series<DateTime, double> CumulativeMax(this Series<DateTime, double> input)\n        {\n            if (input.IsEmpty)\n            {\n                return input;\n            }\n\n            var prevMax = double.NegativeInfinity;\n            var values = new List<double>();\n\n            foreach (var point in input.Values)\n            {\n                if (point > prevMax)\n                {\n                    prevMax = point;\n                }\n\n                values.Add(prevMax);\n            }\n\n            return new Series<DateTime, double>(input.Keys, values);\n        }\n\n        /// <summary>\n        /// Calculates the percentage change from the previous value to the current\n        /// </summary>\n        /// <param name=\"input\">Series to calculate percentage change for</param>\n        /// <returns>Percentage change in series form</returns>\n        /// <remarks>Equivalent to `df.pct_change()`</remarks>\n        public static Series<DateTime, double> PercentChange(this Series<DateTime, double> input)\n        {\n            if (input.IsEmpty)\n            {\n                return input;\n            }\n\n            var inputShifted = input.Shift(1);\n\n            return (input - inputShifted) / inputShifted;\n        }\n\n        /// <summary>\n        /// Calculates the cumulative returns series of the given input equity curve\n        /// </summary>\n        /// <param name=\"input\">Equity curve series</param>\n        /// <returns>Cumulative returns over time</returns>\n        public static Series<DateTime, double> CumulativeReturns(this Series<DateTime, double> input)\n        {\n            if (input.IsEmpty)\n            {\n                return input;\n            }\n\n            return (input.PercentChange()\n                .Where(kvp => !double.IsInfinity(kvp.Value)) + 1)\n                .CumulativeProduct() - 1;\n        }\n\n        /// <summary>\n        /// Calculates the total returns over a period of time for the given input\n        /// </summary>\n        /// <param name=\"input\">Equity curve series</param>\n        /// <returns>Total returns over time</returns>\n        public static double TotalReturns(this Series<DateTime, double> input)\n        {\n            var returns = input.CumulativeReturns();\n\n            if (returns.IsEmpty)\n            {\n                return double.NaN;\n            }\n\n            return returns.LastValue();\n        }\n\n        /// <summary>\n        /// Drops sparse columns only if every value is `missing` in the column\n        /// </summary>\n        /// <typeparam name=\"TRowKey\">Frame row key</typeparam>\n        /// <typeparam name=\"TColumnKey\">Frame column key</typeparam>\n        /// <param name=\"frame\">Data Frame</param>\n        /// <returns>new Frame with sparse columns dropped</returns>\n        /// <remarks>Equivalent to `df.dropna(axis=1, how='all')`</remarks>\n        public static Frame<TRowKey, TColumnKey> DropSparseColumnsAll<TRowKey, TColumnKey>(this Frame<TRowKey, TColumnKey> frame)\n        {\n            var newFrame = frame.Clone();\n\n            foreach (var key in frame.ColumnKeys)\n            {\n                if (newFrame[key].DropMissing().ValueCount == 0)\n                {\n                    newFrame.DropColumn(key);\n                }\n            }\n\n            return newFrame;\n        }\n\n        /// <summary>\n        /// Drops sparse rows if and only if every value is `missing` in the Frame\n        /// </summary>\n        /// <typeparam name=\"TRowKey\">Frame row key</typeparam>\n        /// <typeparam name=\"TColumnKey\">Frame column key</typeparam>\n        /// <param name=\"frame\">Data Frame</param>\n        /// <returns>new Frame with sparse rows dropped</returns>\n        /// <remarks>Equivalent to `df.dropna(how='all')`</remarks>\n        public static Frame<TRowKey, TColumnKey> DropSparseRowsAll<TRowKey, TColumnKey>(this Frame<TRowKey, TColumnKey> frame)\n        {\n            if (frame.ColumnKeys.Count() == 0)\n            {\n                return Frame.CreateEmpty<TRowKey, TColumnKey>();\n            }\n\n            var newFrame = frame.Clone().Transpose();\n\n            foreach (var key in frame.RowKeys)\n            {\n                if (newFrame[key].DropMissing().ValueCount == 0)\n                {\n                    newFrame.DropColumn(key);\n                }\n            }\n\n            return newFrame.Transpose();\n        }\n    }\n}\n"
  },
  {
    "path": "Report/DrawdownCollection.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing QuantConnect.Packets;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Collection of drawdowns for the given period marked by start and end date\n    /// </summary>\n    public class DrawdownCollection\n    {\n        /// <summary>\n        /// Starting time of the drawdown collection\n        /// </summary>\n        public DateTime Start { get; private set; }\n\n        /// <summary>\n        /// Ending time of the drawdown collection\n        /// </summary>\n        public DateTime End { get; private set; }\n\n        /// <summary>\n        /// Number of periods to take into consideration for the top N drawdown periods.\n        /// This will be the number of items contained in the <see cref=\"Drawdowns\"/> collection.\n        /// </summary>\n        public int Periods { get; private set; }\n\n        /// <summary>\n        /// Worst drawdowns encountered\n        /// </summary>\n        public List<DrawdownPeriod> Drawdowns { get; private set; }\n\n        /// <summary>\n        /// Creates an instance with a default collection (no items) and the top N worst drawdowns\n        /// </summary>\n        /// <param name=\"periods\"></param>\n        public DrawdownCollection(int periods)\n        {\n            Drawdowns = new List<DrawdownPeriod>();\n            Periods = periods;\n        }\n\n        /// <summary>\n        /// Creates an instance from the given drawdowns and the top N worst drawdowns\n        /// </summary>\n        /// <param name=\"strategySeries\">Equity curve with both live and backtesting merged</param>\n        /// <param name=\"periods\">Periods this collection contains</param>\n        public DrawdownCollection(Series<DateTime, double> strategySeries, int periods)\n        {\n            var drawdowns = GetDrawdownPeriods(strategySeries, periods).ToList();\n\n            Periods = periods;\n            Start = strategySeries.IsEmpty ? DateTime.MinValue : strategySeries.FirstKey();\n            End = strategySeries.IsEmpty ? DateTime.MaxValue : strategySeries.LastKey();\n            Drawdowns = drawdowns.OrderByDescending(x => x.PeakToTrough)\n                .Take(Periods)\n                .ToList();\n        }\n\n        /// <summary>\n        /// Generate a new instance of DrawdownCollection from backtest and live <see cref=\"Result\"/> derived instances\n        /// </summary>\n        /// <param name=\"backtestResult\">Backtest result packet</param>\n        /// <param name=\"liveResult\">Live result packet</param>\n        /// <param name=\"periods\">Top N drawdown periods to get</param>\n        /// <returns>DrawdownCollection instance</returns>\n        public static DrawdownCollection FromResult(BacktestResult backtestResult = null, LiveResult liveResult = null, int periods = 5)\n        {\n            return new DrawdownCollection(NormalizeResults(backtestResult, liveResult), periods);\n        }\n\n        /// <summary>\n        /// Normalizes the Series used to calculate the drawdown plots and charts\n        /// </summary>\n        /// <param name=\"backtestResult\">Backtest result packet</param>\n        /// <param name=\"liveResult\">Live result packet</param>\n        /// <returns></returns>\n        public static Series<DateTime, double> NormalizeResults(BacktestResult backtestResult, LiveResult liveResult)\n        {\n            var backtestPoints = ResultsUtil.EquityPoints(backtestResult);\n            var livePoints = ResultsUtil.EquityPoints(liveResult);\n\n            if (backtestPoints.Count < 2 && livePoints.Count < 2)\n            {\n                return new Series<DateTime, double>(new DateTime[] { }, new double[] { });\n            }\n\n            var startingEquity = backtestPoints.Count == 0 ? livePoints.First().Value : backtestPoints.First().Value;\n\n            // Note: these calculations are *incorrect* for getting the cumulative returns. However, since we're just\n            // trying to normalize these two series with each other, it's a good candidate for it since the original\n            // values can easily be recalculated from this point\n            var backtestSeries = new Series<DateTime, double>(backtestPoints).PercentChange().Where(kvp => !double.IsInfinity(kvp.Value)).CumulativeSum();\n            var liveSeries = new Series<DateTime, double>(livePoints).PercentChange().Where(kvp => !double.IsInfinity(kvp.Value)).CumulativeSum();\n\n            // Get the last key of the backtest series if our series is empty to avoid issues with empty frames\n            var firstLiveKey = liveSeries.IsEmpty ? backtestSeries.LastKey().AddDays(1) : liveSeries.FirstKey();\n\n            // Add the final non-overlapping point of the backtest equity curve to the entire live series to keep continuity.\n            if (!backtestSeries.IsEmpty)\n            {\n                var filtered = backtestSeries.Where(kvp => kvp.Key < firstLiveKey);\n                liveSeries = filtered.IsEmpty ? liveSeries : liveSeries + filtered.LastValue();\n            }\n\n            // Prefer the live values as we don't care about backtest once we've deployed into live.\n            // All in all, this is a normalized equity curve, though it's been normalized\n            // so that there are no discontinuous jumps in equity value if we only used equity cash\n            // to add the last value of the backtest series to the live series.\n            //\n            // Pandas equivalent:\n            //\n            // ```\n            // pd.concat([backtestSeries, liveSeries], axis=1).fillna(method='ffill').dropna().diff().add(1).cumprod().mul(startingEquity)\n            // ```\n            return backtestSeries.Merge(liveSeries, UnionBehavior.PreferRight)\n                .FillMissing(Direction.Forward)\n                .DropMissing()\n                .Diff(1)\n                .SelectValues(x => x + 1)\n                .CumulativeProduct()\n                .SelectValues(x => x * startingEquity);\n        }\n\n        /// <summary>\n        /// Gets the underwater plot for the provided curve.\n        /// Data is expected to be the concatenated output of <see cref=\"ResultsUtil.EquityPoints\"/>.\n        /// </summary>\n        /// <param name=\"curve\">Equity curve</param>\n        /// <returns></returns>\n        public static Series<DateTime, double> GetUnderwater(Series<DateTime, double> curve)\n        {\n            if (curve.IsEmpty)\n            {\n                return curve;\n            }\n\n            var returns = curve / curve.FirstValue();\n            var cumulativeMax = returns.CumulativeMax();\n\n            return (1 - (returns / cumulativeMax)) * -1;\n        }\n\n        /// <summary>\n        /// Gets all the data associated with the underwater plot and everything used to generate it.\n        /// Note that you should instead use <see cref=\"GetUnderwater(Series{DateTime, double})\"/> if you\n        /// want to just generate an underwater plot. This is internally used to get the top N worst drawdown periods.\n        /// </summary>\n        /// <param name=\"curve\">Equity curve</param>\n        /// <returns>Frame containing the following keys: \"returns\", \"cumulativeMax\", \"drawdown\"</returns>\n        public static Frame<DateTime, string> GetUnderwaterFrame(Series<DateTime, double> curve)\n        {\n            var frame = Frame.CreateEmpty<DateTime, string>();\n            if (curve.IsEmpty)\n            {\n                return frame;\n            }\n\n            var returns = curve / curve.FirstValue();\n            var cumulativeMax = returns.CumulativeMax();\n            var drawdown = 1 - (returns / cumulativeMax);\n\n            frame.AddColumn(\"returns\", returns);\n            frame.AddColumn(\"cumulativeMax\", cumulativeMax);\n            frame.AddColumn(\"drawdown\", drawdown);\n\n            return frame;\n        }\n\n        /// <summary>\n        /// Gets the top N worst drawdowns and associated statistics.\n        /// Returns a Frame with the following keys: \"duration\", \"cumulativeMax\", \"drawdown\"\n        /// </summary>\n        /// <param name=\"curve\">Equity curve</param>\n        /// <param name=\"periods\">Top N worst periods. If this is greater than the results, we retrieve all the items instead</param>\n        /// <returns>Frame with the following keys: \"duration\", \"cumulativeMax\", \"drawdown\"</returns>\n        public static Frame<DateTime, string> GetTopWorstDrawdowns(Series<DateTime, double> curve, int periods)\n        {\n            var frame = Frame.CreateEmpty<DateTime, string>();\n            if (curve.IsEmpty)\n            {\n                return frame;\n            }\n\n            var returns = curve / curve.FirstValue();\n            var cumulativeMax = returns.CumulativeMax();\n            var drawdown = 1 - (returns / cumulativeMax);\n\n            var groups = cumulativeMax.GroupBy(kvp => kvp.Value);\n            // In order, the items are: date, duration, cumulative max, max drawdown\n            var drawdownGroups = new List<Tuple<DateTime, double, double, double>>();\n\n            foreach (var group in groups.Values)\n            {\n                var firstDate = group.SortByKey().FirstKey();\n                var lastDate = group.SortByKey().LastKey();\n\n                var cumulativeMaxGroup = cumulativeMax.Between(firstDate, lastDate);\n                var drawdownGroup = drawdown.Between(firstDate, lastDate);\n                var drawdownGroupMax = drawdownGroup.Values.Max();\n\n                var drawdownMax = drawdownGroup.Where(kvp => kvp.Value == drawdownGroupMax);\n\n                drawdownGroups.Add(new Tuple<DateTime, double, double, double>(\n                    drawdownMax.FirstKey(),\n                    group.ValueCount,\n                    cumulativeMaxGroup.FirstValue(),\n                    drawdownMax.FirstValue()\n                ));\n            }\n\n            var drawdowns = new Series<DateTime, double>(drawdownGroups.Select(x => x.Item1), drawdownGroups.Select(x => x.Item4));\n            // Sort by negative drawdown value (in ascending order), which leaves it sorted in descending order 😮\n            var sortedDrawdowns = drawdowns.SortBy(x => -x);\n            // Only get the most we're allowed to take so that we don't overflow trying to get more drawdown items than exist\n            var periodsToTake = periods < sortedDrawdowns.ValueCount ? periods : sortedDrawdowns.ValueCount;\n\n            // Again, in order, the items are: date (Item1), duration (Item2), cumulative max (Item3), max drawdown (Item4).\n            var topDrawdowns = new Series<DateTime, double>(sortedDrawdowns.Keys.Take(periodsToTake), sortedDrawdowns.Values.Take(periodsToTake));\n            var topDurations = new Series<DateTime, double>(topDrawdowns.Keys.OrderBy(x => x), drawdownGroups.Where(t => topDrawdowns.Keys.Contains(t.Item1)).OrderBy(x => x.Item1).Select(x => x.Item2));\n            var topCumulativeMax = new Series<DateTime, double>(topDrawdowns.Keys.OrderBy(x => x), drawdownGroups.Where(t => topDrawdowns.Keys.Contains(t.Item1)).OrderBy(x => x.Item1).Select(x => x.Item3));\n\n            frame.AddColumn(\"duration\", topDurations);\n            frame.AddColumn(\"cumulativeMax\", topCumulativeMax);\n            frame.AddColumn(\"drawdown\", topDrawdowns);\n\n            return frame;\n        }\n\n        /// <summary>\n        /// Gets the given drawdown periods from the equity curve and the set periods\n        /// </summary>\n        /// <param name=\"curve\">Equity curve</param>\n        /// <param name=\"periods\">Top N drawdown periods to get</param>\n        /// <returns>Enumerable of DrawdownPeriod</returns>\n        public static IEnumerable<DrawdownPeriod> GetDrawdownPeriods(Series<DateTime, double> curve, int periods = 5)\n        {\n            var frame = GetUnderwaterFrame(curve);\n            var topDrawdowns = GetTopWorstDrawdowns(curve, periods);\n\n            for (var i = 1; i <= topDrawdowns.RowCount; i++)\n            {\n                var data = DrawdownGroup(frame, topDrawdowns[\"cumulativeMax\"].GetAt(i - 1));\n\n                // Tuple is as follows: Start (Item1: DateTime), End (Item2: DateTime), Max Drawdown (Item3: double)\n                yield return new DrawdownPeriod(data.Item1, data.Item2, data.Item3);\n            }\n        }\n\n        private static Tuple<DateTime, DateTime, double> DrawdownGroup(Frame<DateTime, string> frame, double groupMax)\n        {\n            var drawdownAfter = frame[\"cumulativeMax\"].Where(kvp => kvp.Value > groupMax);\n            var drawdownGroup = frame[\"cumulativeMax\"].Where(kvp => kvp.Value == groupMax);\n            var groupDrawdown = frame[\"drawdown\"].Realign(drawdownGroup.Keys).Max();\n\n            var groupStart = drawdownGroup.FirstKey();\n            // Get the start of the next period if it exists. That is when the drawdown period has officially ended.\n            // We do this to extend the drawdown period enough so that missing values don't stop it early.\n            var groupEnd = drawdownAfter.IsEmpty ? drawdownGroup.LastKey() : drawdownAfter.FirstKey();\n\n            return new Tuple<DateTime, DateTime, double>(groupStart, groupEnd, groupDrawdown);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/DrawdownPeriod.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Represents a period of time where the drawdown ranks amongst the top N drawdowns.\n    /// </summary>\n    public class DrawdownPeriod\n    {\n        /// <summary>\n        /// Start of the drawdown period\n        /// </summary>\n        public DateTime Start { get; }\n\n        /// <summary>\n        /// End of the drawdown period\n        /// </summary>\n        public DateTime End { get; }\n\n        /// <summary>\n        /// Loss in percent from peak to trough\n        /// </summary>\n        public double PeakToTrough { get; }\n\n        /// <summary>\n        /// Loss in percent from peak to trough - Alias for <see cref=\"PeakToTrough\"/>\n        /// </summary>\n        public double Drawdown => PeakToTrough;\n\n        /// <summary>\n        /// Creates an instance with the given start, end, and drawdown\n        /// </summary>\n        /// <param name=\"start\">Start of the drawdown period</param>\n        /// <param name=\"end\">End of the drawdown period</param>\n        /// <param name=\"drawdown\">Max drawdown of the period</param>\n        public DrawdownPeriod(DateTime start, DateTime end, double drawdown)\n        {\n            Start = start;\n            End = end;\n            PeakToTrough = drawdown;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/Metrics.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Strategy metrics collection such as usage of funds and asset allocations\n    /// </summary>\n    public static class Metrics\n    {\n        /// <summary>\n        /// Calculates the leverage used from trades. The series used to call this extension function should\n        /// be the equity curve with the associated <see cref=\"Order\"/> objects that go along with it.\n        /// </summary>\n        /// <param name=\"equityCurve\">Equity curve series</param>\n        /// <param name=\"orders\">Orders associated with the equity curve</param>\n        /// <returns>Leverage utilization over time</returns>\n        public static Series<DateTime, double> LeverageUtilization(Series<DateTime, double> equityCurve, List<Order> orders)\n        {\n            if (equityCurve.IsEmpty || orders.Count == 0)\n            {\n                return new Series<DateTime, double>(new DateTime[] { }, new double[] { });\n            }\n\n            var pointInTimePortfolios = PortfolioLooper.FromOrders(equityCurve, orders)\n                .ToList(); // Required because for some reason our AbsoluteHoldingsValue is multiplied by two whenever we GroupBy on the raw IEnumerable\n\n            return LeverageUtilization(pointInTimePortfolios);\n        }\n\n        /// <summary>\n        /// Gets the leverage utilization from a list of <see cref=\"PointInTimePortfolio\"/>\n        /// </summary>\n        /// <param name=\"portfolios\">Point in time portfolios</param>\n        /// <returns>Series of leverage utilization</returns>\n        public static Series<DateTime, double> LeverageUtilization(List<PointInTimePortfolio> portfolios)\n        {\n            var leverage = portfolios.GroupBy(portfolio => portfolio.Time)\n                .Select(group => new KeyValuePair<DateTime, double>(group.Key, (double)group.Last().Leverage))\n                .ToList();\n\n            // Drop missing because we don't care about the missing values\n            return new Series<DateTime, double>(leverage).DropMissing();\n        }\n\n        /// <summary>\n        /// Calculates the portfolio's asset allocation percentage over time. The series used to call this extension function should\n        /// be the equity curve with the associated <see cref=\"Order\"/> objects that go along with it.\n        /// </summary>\n        /// <param name=\"equityCurve\">Equity curve series</param>\n        /// <param name=\"orders\">Orders associated with the equity curve</param>\n        /// <returns></returns>\n        public static Series<Symbol, double> AssetAllocations(Series<DateTime, double> equityCurve, List<Order> orders)\n        {\n            if (equityCurve.IsEmpty || orders.Count == 0)\n            {\n                return new Series<Symbol, double>(new Symbol[] { }, new double[] { });\n            }\n\n            // Convert PointInTimePortfolios to List because for some reason our AbsoluteHoldingsValue is multiplied by two whenever we GroupBy on the raw IEnumerable\n            return AssetAllocations(PortfolioLooper.FromOrders(equityCurve, orders).ToList());\n        }\n\n        /// <summary>\n        /// Calculates the asset allocation percentage over time.\n        /// </summary>\n        /// <param name=\"portfolios\">Point in time portfolios</param>\n        /// <returns>Series keyed by Symbol containing the percentage allocated to that asset over time</returns>\n        public static Series<Symbol, double> AssetAllocations(List<PointInTimePortfolio> portfolios)\n        {\n            var portfolioHoldings = portfolios.GroupBy(x => x.Time)\n                .Select(kvp => kvp.Last())\n                .ToList();\n\n            var totalPortfolioValueOverTime = (double)portfolioHoldings.Sum(x => x.Holdings.Sum(y => y.AbsoluteHoldingsValue));\n            var holdingsBySymbolOverTime = new Dictionary<Symbol, double>();\n\n            foreach (var portfolio in portfolioHoldings)\n            {\n                foreach (var holding in portfolio.Holdings)\n                {\n                    if (!holdingsBySymbolOverTime.ContainsKey(holding.Symbol))\n                    {\n                        holdingsBySymbolOverTime[holding.Symbol] = (double)holding.AbsoluteHoldingsValue;\n                        continue;\n                    }\n\n                    holdingsBySymbolOverTime[holding.Symbol] = holdingsBySymbolOverTime[holding.Symbol] + (double)holding.AbsoluteHoldingsValue;\n                }\n            }\n\n            return new Series<Symbol, double>(\n                holdingsBySymbolOverTime.Keys,\n                holdingsBySymbolOverTime.Values.Select(x => x / totalPortfolioValueOverTime).ToList()\n            ).DropMissing();\n        }\n\n        /// <summary>\n        /// Strategy long/short exposure by asset class\n        /// </summary>\n        /// <param name=\"equityCurve\">Equity curve</param>\n        /// <param name=\"orders\">Orders of the strategy</param>\n        /// <param name=\"direction\">Long or short</param>\n        /// <returns>\n        /// Frame keyed by <see cref=\"SecurityType\"/> and <see cref=\"OrderDirection\"/>.\n        /// Returns a Frame of exposure per asset per direction over time\n        /// </returns>\n        public static Frame<DateTime, Tuple<SecurityType, OrderDirection>> Exposure(Series<DateTime, double> equityCurve, List<Order> orders, OrderDirection direction)\n        {\n            if (equityCurve.IsEmpty || orders.Count == 0)\n            {\n                return Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n            }\n\n            return Exposure(PortfolioLooper.FromOrders(equityCurve, orders).ToList(), direction);\n        }\n\n        /// <summary>\n        /// Strategy long/short exposure by asset class\n        /// </summary>\n        /// <param name=\"portfolios\">Point in time portfolios</param>\n        /// <param name=\"direction\">Long or short</param>\n        /// <returns>\n        /// Frame keyed by <see cref=\"SecurityType\"/> and <see cref=\"OrderDirection\"/>.\n        /// Returns a Frame of exposure per asset per direction over time\n        /// </returns>\n        public static Frame<DateTime, Tuple<SecurityType, OrderDirection>> Exposure(List<PointInTimePortfolio> portfolios, OrderDirection direction)\n        {\n            // We want to add all of the holdings by asset class to a mock dataframe that is column keyed by SecurityType with\n            // rows being DateTime and values being the exposure at that given time (as double)\n            var holdingsByAssetClass = new Dictionary<SecurityType, List<KeyValuePair<DateTime, double>>>();\n            var multiplier = direction == OrderDirection.Sell ? -1 : 1;\n\n            foreach (var portfolio in portfolios)\n            {\n                List<KeyValuePair<DateTime, double>> holdings;\n                if (!holdingsByAssetClass.TryGetValue(portfolio.Order.SecurityType, out holdings))\n                {\n                    holdings = new List<KeyValuePair<DateTime, double>>();\n                    holdingsByAssetClass[portfolio.Order.SecurityType] = holdings;\n                }\n\n                var assets = portfolio.Holdings\n                   .Where(pointInTimeHoldings => pointInTimeHoldings.Symbol.SecurityType == portfolio.Order.SecurityType)\n                   .ToList();\n\n                if (assets.Count > 0)\n                {\n                    // Use the multiplier to flip the holdings value around\n                    var sum = (double)assets.Where(pointInTimeHoldings => multiplier * pointInTimeHoldings.HoldingsValue > 0)\n                        .Select(pointInTimeHoldings => pointInTimeHoldings.AbsoluteHoldingsValue)\n                        .Sum();\n\n                    holdings.Add(new KeyValuePair<DateTime, double>(portfolio.Time, sum / (double)portfolio.TotalPortfolioValue));\n                }\n            }\n\n            var frame = Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n\n            foreach (var kvp in holdingsByAssetClass)\n            {\n                // Skip Base asset class since we need it as a special value\n                // (and it can't be traded on either way)\n                if (kvp.Key == SecurityType.Base)\n                {\n                    continue;\n                }\n\n                // Select the last entry of a given time to get accurate results of the portfolio's actual value.\n                // Then, select only the long or short holdings.\n                frame = frame.Join(\n                    new Tuple<SecurityType, OrderDirection>(kvp.Key, direction),\n                    new Series<DateTime, double>(kvp.Value.GroupBy(x => x.Key).Select(x => x.Last())) * multiplier\n                );\n            }\n\n            // Equivalent to `pd.fillna(method='ffill').dropna(axis=1, how='all').dropna(how='all')`\n            // First drops any missing SecurityTypes, then drops the rows with missing values\n            // to get rid of any empty data prior to the first value.\n            return frame.FillMissing(Direction.Forward)\n                .DropSparseColumnsAll()\n                .DropSparseRowsAll();\n        }\n    }\n}\n"
  },
  {
    "path": "Report/NullResultValueTypeJsonConverter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Removes null values in the <see cref=\"Result\"/> object's x,y values so that\n    /// deserialization can occur without exceptions.\n    /// </summary>\n    /// <typeparam name=\"T\">Result type to deserialize into</typeparam>\n    public class NullResultValueTypeJsonConverter<T> : JsonConverter\n        where T : Result\n    {\n        private JsonSerializerSettings _settings;\n\n        /// <summary>\n        /// Initialize a new instance of <see cref=\"NullResultValueTypeJsonConverter{T}\"/>\n        /// </summary>\n        public NullResultValueTypeJsonConverter()\n        {\n            _settings = new JsonSerializerSettings\n            {\n                Converters = new List<JsonConverter> { new OrderTypeNormalizingJsonConverter() },\n                FloatParseHandling = FloatParseHandling.Decimal\n            };\n        }\n\n        /// <summary>\n        /// Determine if this converter can convert a given type\n        /// </summary>\n        /// <param name=\"objectType\">Object type to convert</param>\n        /// <returns>Always true</returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType.IsAssignableTo(typeof(T));\n        }\n\n        /// <summary>\n        /// Read Json for conversion\n        /// </summary>\n        /// <returns>Resulting object</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var token = JToken.ReadFrom(reader);\n            if (token.Type == JTokenType.Null)\n            {\n                return null;\n            }\n\n            foreach (JProperty property in GetProperty(token, \"Charts\").Children())\n            {\n                foreach (JProperty seriesProperty in GetProperty(property.Value, \"Series\"))\n                {\n                    var newValues = new List<JToken>();\n                    foreach (var entry in GetProperty(seriesProperty.Value, \"Values\"))\n                    {\n                        if (entry is JObject jobj &&\n                            (jobj[\"x\"] == null || jobj[\"x\"].Value<long?>() == null ||\n                             jobj[\"y\"] == null || jobj[\"y\"].Value<decimal?>() == null))\n                        {\n                            // null chart point\n                            continue;\n                        }\n\n                        if (entry is JArray jArray && jArray.Any(jToken => jToken.Type == JTokenType.Null))\n                        {\n                            // null candlestick\n                            continue;\n                        }\n\n                        newValues.Add(entry);\n                    }\n\n                    var chart = GetProperty(token, \"Charts\")[property.Name];\n                    var series = GetProperty(chart, \"Series\")[seriesProperty.Name];\n                    if (series[\"Values\"] != null)\n                    {\n                        series[\"Values\"] = JArray.FromObject(newValues);\n                    }\n                    else if (series[\"values\"] != null)\n                    {\n                        series[\"values\"] = JArray.FromObject(newValues);\n                    }\n                }\n            }\n\n            // Deserialize with OrderJsonConverter, otherwise it will fail. We convert the token back\n            // to its JSON representation and use the `JsonConvert.DeserializeObject<T>(...)` method instead\n            // of using `token.ToObject<T>()` since it can be provided a JsonConverter in its arguments.\n            return JsonConvert.DeserializeObject<T>(token.ToString(), _settings);\n        }\n\n        /// <summary>\n        /// Write Json; Not implemented\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        private static JToken GetProperty(JToken jToken, string name)\n        {\n            return jToken[name] ?? jToken[name.ToLower()];\n        }\n    }\n}\n"
  },
  {
    "path": "Report/OrderTypeNormalizingJsonConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Normalizes the \"Type\" field to a value that will allow for\n    /// successful deserialization in the <see cref=\"OrderJsonConverter\"/> class.\n    /// </summary>\n    /// <example>\n    /// All of these values should result in the same object:\n    /// <code>\n    /// [\n    ///     { \"Type\": \"marketOnOpen\", ... },\n    ///     { \"Type\": \"MarketOnOpen\", ... },\n    ///     { \"Type\": 4, ... },\n    /// ]\n    /// </code>\n    /// </example>\n    public class OrderTypeNormalizingJsonConverter : JsonConverter\n    {\n        /// <summary>\n        /// Determine if this Converter can convert a given object type\n        /// </summary>\n        /// <param name=\"objectType\">Object type to convert</param>\n        /// <returns>True if assignable from <see cref=\"Order\"/></returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(Order).IsAssignableFrom(objectType);\n        }\n\n        /// <summary>\n        /// Read Json and convert\n        /// </summary>\n        /// <returns>Resulting <see cref=\"Order\"/></returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            var token = JToken.ReadFrom(reader);\n            var jtokenType = token[\"Type\"] ?? token[\"type\"];\n            int orderType = GetOrderType(jtokenType);\n            if (token[\"Type\"] != null)\n            {\n                token[\"Type\"] = orderType;\n            }\n            else if (token[\"type\"] != null)\n            {\n                token[\"type\"] = orderType;\n            }\n\n            return OrderJsonConverter.CreateOrderFromJObject((JObject)token);\n        }\n\n        /// <summary>\n        /// Write Json; Not implemented\n        /// </summary>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotImplementedException();\n        }\n\n        private int GetOrderType(JToken type)\n        {\n            var orderTypeValue = type.Value<string>();\n            int orderTypeNumber;\n            return Parse.TryParse(orderTypeValue, NumberStyles.Any, out orderTypeNumber) ?\n                orderTypeNumber :\n                (int)(OrderType)Enum.Parse(typeof(OrderType), orderTypeValue, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/PointInTimePortfolio.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Lightweight portfolio at a point in time\n    /// </summary>\n    public class PointInTimePortfolio\n    {\n        /// <summary>\n        /// Time that this point in time portfolio is for\n        /// </summary>\n        public DateTime Time { get; private set; }\n\n        /// <summary>\n        /// The total value of the portfolio. This is cash + absolute value of holdings\n        /// </summary>\n        public decimal TotalPortfolioValue { get; private set; }\n\n        /// <summary>\n        /// The cash the portfolio has\n        /// </summary>\n        public decimal Cash { get; private set; }\n\n        /// <summary>\n        /// The order we just processed\n        /// </summary>\n        [JsonIgnore]\n        public Order Order { get; private set; }\n\n        /// <summary>\n        /// A list of holdings at the current moment in time\n        /// </summary>\n        public List<PointInTimeHolding> Holdings { get; private set; }\n\n        /// <summary>\n        /// Portfolio leverage - provided for convenience\n        /// </summary>\n        public decimal Leverage { get; private set; }\n\n        /// <summary>\n        /// Creates an instance of the PointInTimePortfolio object\n        /// </summary>\n        /// <param name=\"order\">Order applied to the portfolio</param>\n        /// <param name=\"portfolio\">Algorithm portfolio at a point in time</param>\n        public PointInTimePortfolio(Order order, SecurityPortfolioManager portfolio)\n        {\n            Time = order.Time;\n            Order = order;\n            TotalPortfolioValue = portfolio.TotalPortfolioValue;\n            Cash = portfolio.Cash;\n            Holdings = portfolio.Securities.Values.Select(x => new PointInTimeHolding(x.Symbol, x.Holdings.HoldingsValue, x.Holdings.Quantity)).ToList();\n            Leverage = Holdings.Sum(x => x.AbsoluteHoldingsValue) / TotalPortfolioValue;\n        }\n\n        /// <summary>\n        /// Clones the provided portfolio\n        /// </summary>\n        /// <param name=\"portfolio\">Portfolio</param>\n        /// <param name=\"time\">Time</param>\n        public PointInTimePortfolio(PointInTimePortfolio portfolio, DateTime time)\n        {\n            Time = time;\n            Order = portfolio.Order;\n            TotalPortfolioValue = portfolio.TotalPortfolioValue;\n            Cash = portfolio.Cash;\n            Holdings = portfolio.Holdings.Select(x => new PointInTimeHolding(x.Symbol, x.HoldingsValue, x.Quantity)).ToList();\n            Leverage = portfolio.Leverage;\n        }\n\n        /// <summary>\n        /// Filters out any empty holdings from the current <see cref=\"Holdings\"/>\n        /// </summary>\n        /// <returns>Current object, but without empty holdings</returns>\n        public PointInTimePortfolio NoEmptyHoldings()\n        {\n            Holdings = Holdings.Where(h => h.Quantity != 0).ToList();\n            return this;\n        }\n\n        /// <summary>\n        /// Holding of an asset at a point in time\n        /// </summary>\n        public class PointInTimeHolding\n        {\n            /// <summary>\n            /// Symbol of the holding\n            /// </summary>\n            public Symbol Symbol { get; private set; }\n\n            /// <summary>\n            /// Value of the holdings of the asset. Can be negative if shorting an asset\n            /// </summary>\n            public decimal HoldingsValue { get; private set; }\n\n            /// <summary>\n            /// Quantity of the asset. Can be negative if shorting an asset\n            /// </summary>\n            public decimal Quantity { get; private set; }\n\n            /// <summary>\n            /// Absolute value of the holdings.\n            /// </summary>\n            [JsonIgnore]\n            public decimal AbsoluteHoldingsValue => Math.Abs(HoldingsValue);\n\n            /// <summary>\n            /// Absolute value of the quantity\n            /// </summary>\n            [JsonIgnore]\n            public decimal AbsoluteHoldingsQuantity => Math.Abs(Quantity);\n\n            /// <summary>\n            /// Creates an instance of PointInTimeHolding, representing a holding at a given point in time\n            /// </summary>\n            /// <param name=\"symbol\">Symbol of the holding</param>\n            /// <param name=\"holdingsValue\">Value of the holding</param>\n            /// <param name=\"holdingsQuantity\">Quantity of the holding</param>\n            public PointInTimeHolding(Symbol symbol, decimal holdingsValue, decimal holdingsQuantity)\n            {\n                Symbol = symbol;\n                HoldingsValue = holdingsValue;\n                Quantity = holdingsQuantity;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Report/PortfolioLooper/MockDataFeed.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Fake IDataFeed\n    /// </summary>\n    public class MockDataFeed : IDataFeed\n    {\n        /// <summary>\n        /// Bool if the feed is active\n        /// </summary>\n        public bool IsActive { get; }\n\n        /// <summary>\n        /// Initialize the data feed\n        /// This implementation does nothing\n        /// </summary>\n        public void Initialize(\n            IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider\n            )\n        {\n        }\n\n        /// <summary>\n        /// Create Subscription\n        /// </summary>\n        /// <param name=\"request\">Subscription request to use</param>\n        /// <returns>Always null</returns>\n        public Subscription CreateSubscription(SubscriptionRequest request)\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Remove Subscription; Not implemented\n        /// </summary>\n        /// <param name=\"subscription\">Subscription to remove</param>\n        public void RemoveSubscription(Subscription subscription)\n        {\n        }\n\n        /// <summary>\n        /// DataFeed Exit\n        /// </summary>\n        public void Exit()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Report/PortfolioLooper/PortfolioLooper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Lean.Engine.HistoricalData;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Runs LEAN to calculate the portfolio at a given time from <see cref=\"Order\"/> objects.\n    /// Generates and returns <see cref=\"PointInTimePortfolio\"/> objects that represents\n    /// the holdings and other miscellaneous metrics at a point in time by reprocessing the orders\n    /// as they were filled.\n    /// </summary>\n    public class PortfolioLooper : IDisposable\n    {\n        /// <summary>\n        /// Default resolution to read. This will affect the granularity of the results generated for FX and Crypto\n        /// </summary>\n        private const Resolution _resolution = Resolution.Hour;\n\n        private SecurityService _securityService;\n        private DataManager _dataManager;\n        private IResultHandler _resultHandler;\n        private IDataCacheProvider _cacheProvider;\n        private IEnumerable<Slice> _conversionSlices = new List<Slice>();\n\n        /// <summary>\n        /// QCAlgorithm derived class that sets up internal data feeds for\n        /// use with crypto and forex data, as well as managing the <see cref=\"SecurityPortfolioManager\"/>\n        /// </summary>\n        public PortfolioLooperAlgorithm Algorithm { get; protected set; }\n\n        /// <summary>\n        /// Creates an instance of the PortfolioLooper class\n        /// </summary>\n        /// <param name=\"startingCash\">Equity curve</param>\n        /// <param name=\"orders\">Order events</param>\n        /// <param name=\"resolution\">Optional parameter to override default resolution (Hourly)</param>\n        /// <param name=\"algorithmConfiguration\">Optional parameter to override default algorithm configuration</param>\n        private PortfolioLooper(double startingCash, List<Order> orders, Resolution resolution = _resolution,\n            AlgorithmConfiguration algorithmConfiguration = null)\n        {\n            // Initialize the providers that the HistoryProvider requires\n            var factorFileProvider = Composer.Instance.GetExportedValueByTypeName<IFactorFileProvider>(\"LocalDiskFactorFileProvider\");\n            var mapFileProvider = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(\"LocalDiskMapFileProvider\");\n            _cacheProvider = new ZipDataCacheProvider(new DefaultDataProvider(), false);\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n\n            Algorithm = new PortfolioLooperAlgorithm((decimal)startingCash, orders, algorithmConfiguration);\n            var dataPermissionManager = new DataPermissionManager();\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(null, null, null, _cacheProvider, mapFileProvider, factorFileProvider, (_) => { }, false, dataPermissionManager, Algorithm.ObjectStore, Algorithm.Settings));\n            Algorithm.SetHistoryProvider(historyProvider);\n\n            // Dummy LEAN datafeed classes and initializations that essentially do nothing\n            var job = new BacktestNodePacket(1, 2, \"3\", null, 9m, $\"\");\n            var feed = new MockDataFeed();\n\n            // Create MHDB and Symbol properties DB instances for the DataManager\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            _dataManager = new DataManager(feed,\n                new UniverseSelection(\n                    Algorithm,\n                    new SecurityService(Algorithm.Portfolio.CashBook,\n                        marketHoursDatabase,\n                        symbolPropertiesDataBase,\n                        Algorithm,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCacheProvider(Algorithm.Portfolio),\n                        algorithm: Algorithm),\n                    dataPermissionManager,\n                    new DefaultDataProvider()),\n                Algorithm,\n                Algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n\n            _securityService = new SecurityService(Algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                Algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(Algorithm.Portfolio),\n                algorithm: Algorithm);\n\n            var transactions = new BacktestingTransactionHandler();\n            _resultHandler = new BacktestingResultHandler();\n\n            // Initialize security services and other properties so that we\n            // don't get null reference exceptions during our re-calculation\n            Algorithm.Securities.SetSecurityService(_securityService);\n            Algorithm.SubscriptionManager.SetDataManager(_dataManager);\n\n            // Initialize the algorithm before adding any securities\n            Algorithm.Initialize();\n            Algorithm.PostInitialize();\n\n            // Initializes all the proper Securities from the orders provided by the user\n            Algorithm.FromOrders(orders);\n\n            // More initialization, this time with Algorithm and other misc. classes\n            _resultHandler.Initialize(new (job, new Messaging.Messaging(), new Api.Api(), transactions, mapFileProvider));\n            _resultHandler.SetAlgorithm(Algorithm, Algorithm.Portfolio.TotalPortfolioValue);\n\n            Algorithm.Transactions.SetOrderProcessor(transactions);\n\n            transactions.Initialize(Algorithm, new BacktestingBrokerage(Algorithm), _resultHandler);\n            feed.Initialize(Algorithm, job, _resultHandler, null, null, null, _dataManager, null, null);\n\n            // Begin setting up the currency conversion feed if needed\n            var coreSecurities = Algorithm.Securities.Values.ToList();\n\n            BaseSetupHandler.SetupCurrencyConversions(Algorithm, _dataManager.UniverseSelection);\n            var conversionSecurities = Algorithm.Securities.Values.Where(s => !coreSecurities.Contains(s)).ToList();\n\n            // Skip the history request if we don't need to convert anything\n            if (conversionSecurities.Any())\n            {\n                // Point-in-time Slices to convert FX and Crypto currencies to the portfolio currency\n                _conversionSlices = GetHistory(Algorithm, conversionSecurities, resolution);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _dataManager.RemoveAllSubscriptions();\n            _cacheProvider.DisposeSafely();\n            _resultHandler.Exit();\n        }\n\n        /// <summary>\n        /// Internal method to get the history for the given securities\n        /// </summary>\n        /// <param name=\"algorithm\">Algorithm</param>\n        /// <param name=\"securities\">Securities to get history for</param>\n        /// <param name=\"resolution\">Resolution to retrieve data in</param>\n        /// <returns>History of the given securities</returns>\n        /// <remarks>Method is static because we want to use it from the constructor as well</remarks>\n        private static IEnumerable<Slice> GetHistory(IAlgorithm algorithm, List<Security> securities, Resolution resolution)\n        {\n            var historyRequests = new List<Data.HistoryRequest>();\n            var historyRequestFactory = new HistoryRequestFactory(algorithm);\n\n            // Create the history requests\n            foreach (var security in securities)\n            {\n                var configs = algorithm.SubscriptionManager\n                    .SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(security.Symbol, includeInternalConfigs: true);\n\n                // we need to order and select a specific configuration type\n                // so the conversion rate is deterministic\n                var configToUse = configs.OrderBy(x => x.TickType).First();\n\n                var startTime = historyRequestFactory.GetStartTimeAlgoTz(\n                    security.Symbol,\n                    1,\n                    resolution,\n                    security.Exchange.Hours,\n                    configToUse.DataTimeZone,\n                    configToUse.Type);\n                var endTime = algorithm.EndDate;\n\n                historyRequests.Add(historyRequestFactory.CreateHistoryRequest(\n                    configToUse,\n                    startTime,\n                    endTime,\n                    security.Exchange.Hours,\n                    resolution\n                ));\n            }\n\n            return algorithm.HistoryProvider.GetHistory(historyRequests, algorithm.TimeZone).ToList();\n        }\n\n        /// <summary>\n        /// Gets the history for the given symbols from the <paramref name=\"start\"/> to the <paramref name=\"end\"/>\n        /// </summary>\n        /// <param name=\"symbols\">Symbols to request history for</param>\n        /// <param name=\"start\">Start date of history request</param>\n        /// <param name=\"end\">End date of history request</param>\n        /// <param name=\"resolution\">Resolution of history request</param>\n        /// <returns>Enumerable of slices</returns>\n        public static IEnumerable<Slice> GetHistory(List<Symbol> symbols, DateTime start, DateTime end, Resolution resolution)\n        {\n            // Handles the conversion of Symbol to Security for us.\n            var looper = new PortfolioLooper(0, new List<Order>(), resolution);\n            var securities = new List<Security>();\n\n            looper.Algorithm.SetStartDate(start);\n            looper.Algorithm.SetEndDate(end);\n\n            foreach (var symbol in symbols)\n            {\n                var configs = looper.Algorithm.SubscriptionManager.SubscriptionDataConfigService.Add(symbol, resolution, false, false);\n                securities.Add(looper.Algorithm.Securities.CreateSecurity(symbol, configs));\n            }\n\n            return GetHistory(looper.Algorithm, securities, resolution);\n        }\n\n        /// <summary>\n        /// Gets the point in time portfolio over multiple deployments\n        /// </summary>\n        /// <param name=\"equityCurve\">Equity curve series</param>\n        /// <param name=\"orders\">Orders</param>\n        /// <param name=\"algorithmConfiguration\">Optional parameter to override default algorithm configuration</param>\n        /// <param name=\"liveSeries\">Equity curve series originates from LiveResult</param>\n        /// <returns>Enumerable of <see cref=\"PointInTimePortfolio\"/></returns>\n        public static IEnumerable<PointInTimePortfolio> FromOrders(Series<DateTime, double> equityCurve, IEnumerable<Order> orders,\n            AlgorithmConfiguration algorithmConfiguration = null, bool liveSeries = false)\n        {\n            // Don't do anything if we have no orders or equity curve to process\n            if (!orders.Any() || equityCurve.IsEmpty)\n            {\n                yield break;\n            }\n\n            // Chunk different deployments into separate Lists for separate processing\n            var portfolioDeployments = new List<List<Order>>();\n\n            // Orders are guaranteed to start counting from 1. This ensures that we have\n            // no collision at all with the start of a deployment\n            var previousOrderId = 0;\n            var currentDeployment = new List<Order>();\n\n            // Make use of reference semantics to add new deployments to the list\n            portfolioDeployments.Add(currentDeployment);\n\n            foreach (var order in orders)\n            {\n                // In case we have two different deployments with only a single\n                // order in the deployments, <= was chosen because it covers duplicate values\n                if (order.Id <= previousOrderId)\n                {\n                    currentDeployment = new List<Order>();\n                    portfolioDeployments.Add(currentDeployment);\n                }\n\n                currentDeployment.Add(order);\n                previousOrderId = order.Id;\n            }\n\n            PortfolioLooper looper = null;\n            PointInTimePortfolio prev = null;\n            foreach (var deploymentOrders in portfolioDeployments)\n            {\n                if (deploymentOrders.Count == 0)\n                {\n                    Log.Trace($\"PortfolioLooper.FromOrders(): Deployment contains no orders\");\n                    continue;\n                }\n                var startTime = deploymentOrders.First().Time;\n                var deployment = equityCurve.Where(kvp => kvp.Key <= startTime);\n                if (deployment.IsEmpty)\n                {\n                    Log.Trace($\"PortfolioLooper.FromOrders(): Equity series is empty after filtering with upper bound: {startTime}\");\n                    continue;\n                }\n\n                // Skip any deployments that haven't been ran long enough to be generated in live mode\n                if (liveSeries && deploymentOrders.First().Time.Date == deploymentOrders.Last().Time.Date)\n                {\n                    Log.Trace(\"PortfolioLooper.FromOrders(): Filtering deployment because it has not been deployed for more than one day\");\n                    continue;\n                }\n\n                // For every deployment, we want to start fresh.\n                looper = new PortfolioLooper(deployment.LastValue(), deploymentOrders, algorithmConfiguration: algorithmConfiguration);\n\n                foreach (var portfolio in looper.ProcessOrders(deploymentOrders))\n                {\n                    prev = portfolio;\n                    yield return portfolio;\n                }\n            }\n\n            if (prev != null)\n            {\n                yield return new PointInTimePortfolio(prev, equityCurve.LastKey());\n            }\n\n            looper.DisposeSafely();\n        }\n\n        /// <summary>\n        /// Process the orders\n        /// </summary>\n        /// <param name=\"orders\">orders</param>\n        /// <returns>PointInTimePortfolio</returns>\n        private IEnumerable<PointInTimePortfolio> ProcessOrders(IEnumerable<Order> orders)\n        {\n            // Portfolio.ProcessFill(...) does not filter out invalid orders. We must do so ourselves\n            foreach (var order in orders)\n            {\n                Algorithm.SetDateTime(order.Time);\n\n                var orderSecurity = Algorithm.Securities[order.Symbol];\n                DateTime lastFillTime;\n\n                if ((order.Type == OrderType.MarketOnOpen || order.Type == OrderType.MarketOnClose) &&\n                    (order.Status == OrderStatus.Filled || order.Status == OrderStatus.PartiallyFilled) && order.LastFillTime == null)\n                {\n                    lastFillTime = order.Time;\n                }\n                else if (order.LastFillTime == null)\n                {\n                    Log.Trace($\"Order with ID: {order.Id} has been skipped because of null LastFillTime\");\n                    continue;\n                }\n                else\n                {\n                    lastFillTime = order.LastFillTime.Value;\n                }\n\n                var tick = new Tick { Quantity = order.Quantity, AskPrice = order.Price, BidPrice = order.Price, Value = order.Price, EndTime = lastFillTime };\n                var tradeBar = new TradeBar\n                {\n                    Open = order.Price,\n                    High = order.Price,\n                    Low = order.Price,\n                    Close = order.Price,\n                    Volume = order.Quantity,\n\n                    DataType = MarketDataType.TradeBar,\n                    Period = TimeSpan.Zero,\n                    Symbol = order.Symbol,\n                    Time = lastFillTime,\n                };\n\n                // Required for crypto so that the Cache Price is updated accordingly,\n                // since its `Security.Price` implementation explicitly requests TradeBars.\n                // For most asset types this might be enough as well, but there is the\n                // possibility that some trades might get filtered, so we cover that\n                // case by setting the market price via Tick as well.\n                orderSecurity.SetMarketPrice(tradeBar);\n                orderSecurity.SetMarketPrice(tick);\n\n                // Check if we have a base currency (i.e. forex or crypto that requires currency conversion)\n                // to ensure the proper conversion rate is set for them\n                var baseCurrency = orderSecurity as IBaseCurrencySymbol;\n\n                if (baseCurrency != null)\n                {\n                    // We want slices that apply to either this point in time, or the last most recent point in time\n                    var updateSlices = _conversionSlices.Where(x => x.Time <= order.Time).ToList();\n\n                    // This is put here because there can potentially be no slices\n                    if (updateSlices.Count != 0)\n                    {\n                        var updateSlice = updateSlices.Last();\n\n                        foreach (var quoteBar in updateSlice.QuoteBars.Values)\n                        {\n                            Algorithm.Securities[quoteBar.Symbol].SetMarketPrice(quoteBar);\n                        }\n                    }\n                }\n\n                // Update our cash holdings before we invalidate the portfolio value\n                // to calculate the proper cash value of other assets the algo owns\n                foreach (var cash in Algorithm.Portfolio.CashBook.Values.Where(x => x.CurrencyConversion != null))\n                {\n                    cash.Update();\n                }\n\n                // Securities prices might have been updated, so we need to recalculate how much\n                // money we have in our portfolio, otherwise we risk being out of date and\n                // calculate on stale data.\n                Algorithm.Portfolio.InvalidateTotalPortfolioValue();\n\n                var ticket = order.ToOrderTicket(Algorithm.Transactions);\n                var orderEvent = new OrderEvent(order, order.Time, Orders.Fees.OrderFee.Zero) { FillPrice = order.Price, FillQuantity = order.Quantity, Ticket = ticket };\n\n                // Process the order\n                Algorithm.Portfolio.ProcessFills(new List<OrderEvent> { orderEvent });\n\n                // Create portfolio statistics and return back to the user\n                yield return new PointInTimePortfolio(order, Algorithm.Portfolio);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Report/PortfolioLooper/PortfolioLooperAlgorithm.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Fake algorithm that initializes portfolio and algorithm securities. Never ran.\n    /// </summary>\n    public class PortfolioLooperAlgorithm : QCAlgorithm\n    {\n        private decimal _startingCash;\n        private List<Order> _orders;\n        private AlgorithmConfiguration _algorithmConfiguration;\n\n        /// <summary>\n        /// Initialize an instance of <see cref=\"PortfolioLooperAlgorithm\"/>\n        /// </summary>\n        /// <param name=\"startingCash\">Starting algorithm cash</param>\n        /// <param name=\"orders\">Orders to use</param>\n        /// <param name=\"algorithmConfiguration\">Optional parameter to override default algorithm configuration</param>\n        public PortfolioLooperAlgorithm(decimal startingCash, IEnumerable<Order> orders, AlgorithmConfiguration algorithmConfiguration = null) : base()\n        {\n            _startingCash = startingCash;\n            _orders = orders.ToList();\n            _algorithmConfiguration = algorithmConfiguration;\n        }\n\n        /// <summary>\n        /// Initializes all the proper Securities from the orders provided by the user\n        /// </summary>\n        /// <param name=\"orders\">Orders to use</param>\n        public void FromOrders(IEnumerable<Order> orders)\n        {\n            foreach (var symbol in orders.Select(x => x.Symbol).Distinct())\n            {\n                Resolution resolution;\n                switch (symbol.SecurityType)\n                {\n                    case SecurityType.Option:\n                    case SecurityType.Future:\n                        resolution = Resolution.Minute;\n                        break;\n                    default:\n                        resolution = Resolution.Daily;\n                        break;\n                }\n\n                var configs = SubscriptionManager.SubscriptionDataConfigService.Add(symbol, resolution, false, false);\n                var security = Securities.CreateSecurity(symbol, configs, 0m);\n                if (symbol.SecurityType == SecurityType.Crypto)\n                {\n                    security.BuyingPowerModel = new SecurityMarginModel();\n                }\n\n                // Set leverage to 10000 to account for unknown leverage values in user algorithms\n                security.SetLeverage(10000m);\n\n                var method = typeof(QCAlgorithm).GetMethod(\"AddToUserDefinedUniverse\", BindingFlags.NonPublic | BindingFlags.Instance);\n                method.Invoke(this, new object[] { security, configs });\n            }\n        }\n\n        /// <summary>\n        /// Initialize this algorithm\n        /// </summary>\n        public override void Initialize()\n        {\n            if (_algorithmConfiguration != null)\n            {\n                SetAccountCurrency(_algorithmConfiguration.AccountCurrency);\n                SetBrokerageModel(_algorithmConfiguration.Brokerage, _algorithmConfiguration.AccountType);\n            }\n\n            SetCash(_startingCash);\n\n            if (_orders.Count != 0)\n            {\n                SetStartDate(_orders.First().Time);\n                SetEndDate(_orders.Last().Time);\n            }\n\n            SetBenchmark(b => 0);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/Program.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing Newtonsoft.Json;\nusing QuantConnect.Util;\nusing System.Diagnostics;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Lean.Engine;\nusing System.Collections.Generic;\nusing QuantConnect.Configuration;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Lean Report creates a PDF strategy summary from the backtest and live json objects.\n    /// </summary>\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Parse report arguments and merge with config to use in report creator:\n            if (args.Length > 0)\n            {\n                Config.MergeCommandLineArgumentsWithConfiguration(ReportArgumentParser.ParseArguments(args));\n            }\n\n            // initialize required lean handlers\n            LeanEngineAlgorithmHandlers.FromConfiguration(Composer.Instance);\n            var name = Config.Get(\"strategy-name\");\n            var description = Config.Get(\"strategy-description\");\n            var version = Config.Get(\"strategy-version\");\n            var backtestDataFile = Config.Get(\"backtest-data-source-file\");\n            var liveDataFile = Config.Get(\"live-data-source-file\");\n            var destination = Config.Get(\"report-destination\");\n            var reportFormat = Config.Get(\"report-format\");\n            var cssOverrideFile = Config.Get(\"report-css-override-file\", \"css/report_override.css\");\n            var htmlCustomFile = Config.Get(\"report-html-custom-file\", \"template.html\");\n            var pythonVirtualEnvironment = Config.Get(\"python-venv\");\n\n            // Activate virtual environment if defined\n            PythonInitializer.ActivatePythonVirtualEnvironment(pythonVirtualEnvironment);\n\n            // Initialize and add our Paths\n            PythonInitializer.Initialize();\n\n            // Parse content from source files into result objects\n            Log.Trace($\"QuantConnect.Report.Main(): Parsing source files...{backtestDataFile}, {liveDataFile}\");\n            var backtestSettings = new JsonSerializerSettings\n            {\n                Converters = new List<JsonConverter> { new NullResultValueTypeJsonConverter<BacktestResult>() },\n                FloatParseHandling = FloatParseHandling.Decimal\n            };\n\n            var backtest = JsonConvert.DeserializeObject<BacktestResult>(File.ReadAllText(backtestDataFile), backtestSettings);\n            LiveResult live = null;\n\n            if (!string.IsNullOrEmpty(liveDataFile))\n            {\n                var settings = new JsonSerializerSettings\n                {\n                    NullValueHandling = NullValueHandling.Ignore,\n                    Converters = new List<JsonConverter> { new NullResultValueTypeJsonConverter<LiveResult>() }\n                };\n\n                live = JsonConvert.DeserializeObject<LiveResult>(File.ReadAllText(liveDataFile), settings);\n            }\n\n            string cssOverrideContent = null;\n            if (!string.IsNullOrEmpty(cssOverrideFile))\n            {\n                if (File.Exists(cssOverrideFile))\n                {\n                    cssOverrideContent = File.ReadAllText(cssOverrideFile);\n                }\n                else\n                {\n                    Log.Trace($\"QuantConnect.Report.Main(): CSS override file {cssOverrideFile} was not found\");\n                }\n            }\n\n            string htmlCustomContent = null;\n            if (!string.IsNullOrEmpty(htmlCustomFile))\n            {\n                if (File.Exists(htmlCustomFile))\n                {\n                    htmlCustomContent = File.ReadAllText(htmlCustomFile);\n                }\n                else\n                {\n                    Log.Trace($\"QuantConnect.Report.Main(): HTML custom file {htmlCustomFile} was not found\");\n                }\n            }\n\n            //Create a new report\n            Log.Trace(\"QuantConnect.Report.Main(): Instantiating report...\");\n            var report = new Report(name, description, version, backtest, live, cssOverride: cssOverrideContent, htmlCustom: htmlCustomContent);\n\n            // Generate the html content\n            Log.Trace(\"QuantConnect.Report.Main(): Starting content compile...\");\n            string html;\n            string _;\n\n            report.Compile(out html, out _);\n\n            //Write it to target destination.\n            if (!string.IsNullOrEmpty(destination))\n            {\n                Log.Trace($\"QuantConnect.Report.Main(): Writing content to file {destination}\");\n                File.WriteAllText(destination, html);\n\n                if (!String.IsNullOrEmpty(reportFormat) && reportFormat.ToUpperInvariant() == \"PDF\")\n                {\n                    try\n                    {\n                        Log.Trace(\"QuantConnect.Report.Main(): Starting conversion to PDF\");\n                        // Ensure wkhtmltopdf and xvfb are installed and accessible from the $PATH\n                        var pdfDestination = destination.Replace(\".html\", \".pdf\");\n                        Process process = new();\n                        process.StartInfo.FileName = \"xvfb-run\";\n                        process.StartInfo.Arguments = $\"--server-args=\\\"-screen 0, 1600x1200x24+32\\\" wkhtmltopdf {destination} {pdfDestination}\";\n                        process.StartInfo.UseShellExecute = false;\n                        process.StartInfo.RedirectStandardOutput = true;\n                        process.StartInfo.RedirectStandardError = true;\n                        process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;\n\n                        process.OutputDataReceived += (sender, e) => Log.Trace($\"QuantConnect.Report.Main(): {e.Data}\");\n                        process.ErrorDataReceived += (sender, e) => Log.Error($\"QuantConnect.Report.Main(): {e.Data}\");\n\n                        process.Start();\n\n                        process.BeginOutputReadLine();\n                        process.BeginErrorReadLine();\n\n                        var processExited = process.WaitForExit(1*60*1000); // wait for up to 1 minutes\n\n                        if (processExited)\n                        {\n                            Log.Trace(\"QuantConnect.Report.Main(): Convert to PDF process exited with code \" + process.ExitCode);\n                        }\n                        else\n                        {\n                            Log.Error(\"QuantConnect.Report.Main(): Process did not exit within the timeout period.\");\n                            process.Kill(); // kill the process if it's still running\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        Log.Error($\"QuantConnect.Report.Main(): {ex.Message}\");\n                    }\n                }\n            }\n            else\n            {\n                Console.Write(html);\n            }\n\n            Log.Trace(\"QuantConnect.Report.Main(): Completed.\");\n\n            if (!Console.IsInputRedirected && !Config.GetBool(\"close-automatically\"))\n            {\n                Console.ReadKey();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Report/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Report\")]\n[assembly: AssemblyProduct(\"QuantConnect.Report\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"2431419f-8bc6-4f59-944e-9a1cd28982df\")]"
  },
  {
    "path": "Report/QuantConnect.Report.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>QuantConnect.Report</RootNamespace>\n    <AssemblyName>QuantConnect.Report</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <DocumentationFile>bin\\$(Configuration)\\QuantConnect.Report.xml</DocumentationFile>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Report Project - Generates live and backtesting reports</Description>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>$(SelectedOptimization)</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>QuantConnect.Report.Program</StartupObject>\n  </PropertyGroup>\n  <Target Name=\"PrintRID\" BeforeTargets=\"Build\">\n    <Message Text=\"SelectedOptimization $(SelectedOptimization)\" Importance=\"high\" />\n  </Target>\n  <PropertyGroup>\n    <Features>flow-analysis</Features>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"Deedle\" Version=\"2.1.0\" />\n    <PackageReference Include=\"MathNet.Numerics\" Version=\"5.0.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"css\\report.css\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"css\\report_override.css\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"ReportCharts.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"config.example.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Brokerages\\QuantConnect.Brokerages.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Messaging\\QuantConnect.Messaging.csproj\" />\n    <ProjectReference Include=\"..\\ToolBox\\QuantConnect.ToolBox.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"ReportChartTests.py\" />\n    <Content Include=\"template.html\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Report/Report.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Deedle;\nusing Newtonsoft.Json;\nusing QuantConnect.Configuration;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Report.ReportElements;\nusing QuantConnect.Orders;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Report class\n    /// </summary>\n    public class Report\n    {\n        private string _template;\n        private readonly List<IReportElement> _elements;\n\n        /// <summary>\n        /// File name for statistics\n        /// </summary>\n        public const string StatisticsFileName = \"report-statistics.json\";\n\n        /// <summary>\n        /// Create beautiful HTML and PDF Reports based on backtest and live data.\n        /// </summary>\n        /// <param name=\"name\">Name of the strategy</param>\n        /// <param name=\"description\">Description of the strategy</param>\n        /// <param name=\"version\">Version number of the strategy</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"pointInTimePortfolioDestination\">Point in time portfolio json output base filename</param>\n        /// <param name=\"cssOverride\">CSS file that overrides some of the default rules defined in report.css</param>\n        /// <param name=\"htmlCustom\">Custom HTML file to replace the default template</param>\n        public Report(string name, string description, string version, BacktestResult backtest, LiveResult live, string pointInTimePortfolioDestination = null, string cssOverride = null, string htmlCustom = null)\n        {\n            _template = htmlCustom ?? File.ReadAllText(\"template.html\");\n            var crisisHtmlContent = GetRegexInInput(@\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\", _template);\n            var parametersHtmlContent = GetRegexInInput(@\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\", _template);\n\n            var backtestCurve = new Series<DateTime, double>(ResultsUtil.EquityPoints(backtest));\n            var liveCurve = new Series<DateTime, double>(ResultsUtil.EquityPoints(live));\n\n            var backtestOrders = backtest?.Orders?.Values.ToList() ?? new List<Order>();\n            var liveOrders = live?.Orders?.Values.ToList() ?? new List<Order>();\n\n            var backtestConfiguration = backtest?.AlgorithmConfiguration;\n            var liveConfiguration = live?.AlgorithmConfiguration;\n\n            // Earlier we use constant's value tradingDaysPerYear = 252\n            // backtestConfiguration?.TradingDaysPerYear equal liveConfiguration?.TradingDaysPerYear\n            var tradingDayPerYear = backtestConfiguration?.TradingDaysPerYear ?? 252;\n\n            Log.Trace($\"QuantConnect.Report.Report(): Processing backtesting orders\");\n            var backtestPortfolioInTime = PortfolioLooper.FromOrders(backtestCurve, backtestOrders, backtestConfiguration).ToList();\n            Log.Trace($\"QuantConnect.Report.Report(): Processing live orders\");\n            var livePortfolioInTime = PortfolioLooper.FromOrders(liveCurve, liveOrders, liveConfiguration, liveSeries: true).ToList();\n\n            var destination = pointInTimePortfolioDestination ?? Config.Get(\"report-destination\");\n            if (!string.IsNullOrWhiteSpace(destination))\n            {\n                if (backtestPortfolioInTime.Count != 0)\n                {\n                    var dailyBacktestPortfolioInTime = backtestPortfolioInTime\n                        .Select(x => new PointInTimePortfolio(x, x.Time.Date).NoEmptyHoldings())\n                        .GroupBy(x => x.Time.Date)\n                        .Select(kvp => kvp.Last())\n                        .OrderBy(x => x.Time)\n                        .ToList();\n\n                    var outputFile = destination.Replace(\".html\", string.Empty) + \"-backtesting-portfolio.json\";\n                    Log.Trace($\"Report.Report(): Writing backtest point-in-time portfolios to JSON file: {outputFile}\");\n                    var backtestPortfolioOutput = JsonConvert.SerializeObject(dailyBacktestPortfolioInTime);\n                    File.WriteAllText(outputFile, backtestPortfolioOutput);\n                }\n                if (livePortfolioInTime.Count != 0)\n                {\n                    var dailyLivePortfolioInTime = livePortfolioInTime\n                        .Select(x => new PointInTimePortfolio(x, x.Time.Date).NoEmptyHoldings())\n                        .GroupBy(x => x.Time.Date)\n                        .Select(kvp => kvp.Last())\n                        .OrderBy(x => x.Time)\n                        .ToList();\n\n                    var outputFile = destination.Replace(\".html\", string.Empty) + \"-live-portfolio.json\";\n                    Log.Trace($\"Report.Report(): Writing live point-in-time portfolios to JSON file: {outputFile}\");\n                    var livePortfolioOutput = JsonConvert.SerializeObject(dailyLivePortfolioInTime);\n                    File.WriteAllText(outputFile, livePortfolioOutput);\n                }\n            }\n\n            _elements = new List<IReportElement>\n            {\n                //Basics\n                new TextReportElement(\"strategy name\", ReportKey.StrategyName, name),\n                new TextReportElement(\"description\", ReportKey.StrategyDescription, description),\n                new TextReportElement(\"version\", ReportKey.StrategyVersion, version),\n                new TextReportElement(\"stylesheet\", ReportKey.Stylesheet, File.ReadAllText(\"css/report.css\") + (cssOverride)),\n                new TextReportElement(\"live marker key\", ReportKey.LiveMarker, live == null ? string.Empty : \"Live \"),\n\n                //KPI's Backtest:\n                new RuntimeDaysReportElement(\"runtime days kpi\", ReportKey.BacktestDays, backtest, live),\n                new CAGRReportElement(\"cagr kpi\", ReportKey.CAGR, backtest, live),\n                new TurnoverReportElement(\"turnover kpi\", ReportKey.Turnover, backtest, live),\n                new MaxDrawdownReportElement(\"max drawdown kpi\", ReportKey.MaxDrawdown, backtest, live),\n                new MaxDrawdownRecoveryReportElement(\"max drawdown recovery kpi\", ReportKey.MaxDrawdownRecovery, backtest, live),\n                new SharpeRatioReportElement(\"sharpe kpi\", ReportKey.SharpeRatio, backtest, live, tradingDayPerYear),\n                new SortinoRatioReportElement(\"sortino kpi\", ReportKey.SortinoRatio, backtest, live, tradingDayPerYear),\n                new PSRReportElement(\"psr kpi\", ReportKey.PSR, backtest, live, tradingDayPerYear),\n                new InformationRatioReportElement(\"ir kpi\", ReportKey.InformationRatio, backtest, live),\n                new MarketsReportElement(\"markets kpi\", ReportKey.Markets, backtest, live),\n                new TradesPerDayReportElement(\"trades per day kpi\", ReportKey.TradesPerDay, backtest, live),\n                new EstimatedCapacityReportElement(\"estimated algorithm capacity\", ReportKey.StrategyCapacity, backtest, live),\n\n                // Generate and insert plots MonthlyReturnsReportElement\n                new MonthlyReturnsReportElement(\"monthly return plot\", ReportKey.MonthlyReturns, backtest, live),\n                new CumulativeReturnsReportElement(\"cumulative returns\", ReportKey.CumulativeReturns, backtest, live),\n                new AnnualReturnsReportElement(\"annual returns\", ReportKey.AnnualReturns, backtest, live),\n                new ReturnsPerTradeReportElement(\"returns per trade\", ReportKey.ReturnsPerTrade, backtest, live),\n                new AssetAllocationReportElement(\"asset allocation over time pie chart\", ReportKey.AssetAllocation, backtest, live, backtestPortfolioInTime, livePortfolioInTime),\n                new DrawdownReportElement(\"drawdown plot\", ReportKey.Drawdown, backtest, live),\n                new DailyReturnsReportElement(\"daily returns plot\", ReportKey.DailyReturns, backtest, live),\n                new RollingPortfolioBetaReportElement(\"rolling beta to equities plot\", ReportKey.RollingBeta, backtest, live, tradingDayPerYear),\n                new RollingSharpeReportElement(\"rolling sharpe ratio plot\", ReportKey.RollingSharpe, backtest, live, tradingDayPerYear),\n                new LeverageUtilizationReportElement(\"leverage plot\", ReportKey.LeverageUtilization, backtest, live, backtestPortfolioInTime, livePortfolioInTime),\n                new ExposureReportElement(\"exposure plot\", ReportKey.Exposure, backtest, live, backtestPortfolioInTime, livePortfolioInTime)\n            };\n\n            // Include Algorithm Parameters\n            if (parametersHtmlContent != null)\n            {\n                _elements.Add(new ParametersReportElement(\"parameters page\", ReportKey.ParametersPageStyle, backtestConfiguration, liveConfiguration, parametersHtmlContent));\n                _elements.Add(new ParametersReportElement(\"parameters\", ReportKey.Parameters, backtestConfiguration, liveConfiguration, parametersHtmlContent));\n            }\n\n            // Array of Crisis Plots:\n            if (crisisHtmlContent != null)\n            {\n                _elements.Add(new CrisisReportElement(\"crisis page\", ReportKey.CrisisPageStyle, backtest, live, crisisHtmlContent));\n                _elements.Add(new CrisisReportElement(\"crisis plots\", ReportKey.CrisisPlots, backtest, live, crisisHtmlContent));\n            }\n\n        }\n\n        /// <summary>\n        /// Compile the backtest data into a report\n        /// </summary>\n        /// <returns></returns>\n        public void Compile(out string html, out string reportStatistics)\n        {\n            html = _template;\n            var statistics = new Dictionary<string, object>();\n\n            // Render the output and replace the report section\n            foreach (var element in _elements)\n            {\n                Log.Trace($\"QuantConnect.Report.Compile(): Rendering {element.Name}...\");\n                html = html.Replace(element.Key, element.Render());\n\n                if (element is TextReportElement || element is CrisisReportElement || element is ParametersReportElement || (element as ReportElement) == null)\n                {\n                    continue;\n                }\n\n                var reportElement = element as ReportElement;\n                statistics[reportElement.JsonKey] = reportElement.Result;\n            }\n\n            reportStatistics = JsonConvert.SerializeObject(statistics, Formatting.None);\n        }\n\n        /// <summary>\n        /// Gets the regex pattern in the given input string\n        /// </summary>\n        /// <param name=\"pattern\">Regex pattern to be find the input string</param>\n        /// <param name=\"input\">Input string that may contain the regex pattern</param>\n        /// <returns>The regex pattern in the input string if found. Otherwise, null</returns>\n        public static string GetRegexInInput(string pattern, string input)\n        {\n            var regex = new Regex(pattern);\n            var match = regex.Match(input);\n            var regexWithinInput = match.Success ? match.Groups[2].Value : null;\n            return regexWithinInput;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportChartTests.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# You can run this test by first running `nPython.exe` (with mono or otherwise):\n# $ ./nPython.exe ReportChartTests.py\n\nimport numpy as np\nimport pandas as pd\nfrom datetime import datetime\nfrom ReportCharts import ReportCharts\n\ncharts = ReportCharts()\n\n## Test GetReturnsPerTrade\nbacktest = list(np.random.normal(0, 1, 1000))\nlive = list(np.random.normal(0.5, 1, 400))\nresult = charts.GetReturnsPerTrade([], [])\nresult = charts.GetReturnsPerTrade(backtest, [])\nresult = charts.GetReturnsPerTrade(backtest, live)\n\n## Test GetCumulativeReturnsPlot\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01T00:00:00', periods=365)]\nstrategy = np.linspace(1, 25, 365)\nbenchmark = np.linspace(2, 26, 365)\nbacktest = [time, strategy, time, benchmark]\n\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2013-10-01T00:00:00', periods=50)]\nstrategy = np.linspace(25, 29, 50)\nbenchmark = np.linspace(26, 30, 50)\nlive = [time, strategy, time, benchmark]\n\nresult = charts.GetCumulativeReturns()\nresult = charts.GetCumulativeReturns(backtest)\nresult = charts.GetCumulativeReturns(backtest, live)\n\n## Test GetDailyReturnsPlot\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01T00:00:00', periods=365)]\ndata = list(np.random.normal(0, 1, 365))\nbacktest = [time, data]\n\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2013-10-01T00:00:00', periods=120)]\ndata = list(np.random.normal(0.5, 1.5, 120))\nlive = [time, data]\n\nempty = [[], []]\nresult = charts.GetDailyReturns(empty, empty)\nresult = charts.GetDailyReturns(backtest, empty)\nresult = charts.GetDailyReturns(backtest, live)\n\n## Test GetMonthlyReturnsPlot\nbacktest = {'2016': [0.5, 0.7, 0.2, 0.23, 1.3, 1.45, 1.67, -2.3, -0.5, 1.23, 1.23, -3.5],\n            '2017': [0.5, 0.7, 0.2, 0.23, 1.3, 1.45, 1.67, -2.3, -0.5, 1.23, 1.23, -3.5][::-1]}\n\nlive = {'2018': [0.5, 0.7, 0.2, 0.23, 1.3, 1.45, 1.67, -2.3, -0.5, 1.23, 1.23, -3.5],\n        '2019': [1.5, 2.7, -3.2, -0.23, 4.3, -2.45, -1.67, 2.3, np.nan, np.nan, np.nan, np.nan]}\n\nresult = charts.GetMonthlyReturns({}, {})\nresult = charts.GetMonthlyReturns(backtest, pd.DataFrame())\nresult = charts.GetMonthlyReturns(backtest, live)\n\n## Test GetAnnualReturnsPlot\ntime = ['2012', '2013', '2014', '2015', '2016']\nstrategy = list(np.random.normal(0, 1, 5))\nbacktest = [time, strategy]\n\ntime = ['2017', '2018']\nstrategy = list(np.random.normal(0.5, 1.5, 2))\nlive = [time, strategy]\n\nempty = [[], []]\nresult = charts.GetAnnualReturns()\nresult = charts.GetAnnualReturns(backtest)\nresult = charts.GetAnnualReturns(backtest, live)\n\n## Test GetDrawdownPlot\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01', periods=365)]\ndata = list(np.random.uniform(-5, 0, 365))\nbacktest = [time, data]\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2013-10-01', periods=100)]\ndata = list(np.random.uniform(-5, 0, 100))\nlive = [time, data]\nworst = [{'Begin': datetime(2012, 10, 1), 'End': datetime(2012, 10, 11)},\n         {'Begin': datetime(2012, 12, 1), 'End': datetime(2012, 12, 11)},\n         {'Begin': datetime(2013, 3, 1), 'End': datetime(2013, 3, 11)},\n         {'Begin': datetime(2013, 4, 1), 'End': datetime(2013, 4, 1)},\n         {'Begin': datetime(2013, 6, 1), 'End': datetime(2013, 6, 11)}]\nempty = [[], []]\nresult = charts.GetDrawdown(empty, empty, {})\nresult = charts.GetDrawdown(backtest, empty, worst)\nresult = charts.GetDrawdown(backtest, live, worst)\n\n## Test GetCrisisPlots  (backtest only)\nequity = list(np.linspace(1, 25, 365))\nbenchmark = list(np.linspace(2, 26, 365))\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01 00:00:00', periods=365)]\nbacktest = [time, equity, benchmark]\n\nempty = [[], [], []]\nresult = charts.GetCrisisEventsPlots(empty, 'empty_crisis')\nresult = charts.GetCrisisEventsPlots(backtest, 'dummy_crisis')\n\n## Test GetRollingBetaPlot\nempty = [[], [], [], []]\ntwelve = [np.nan for x in range(180)] + list(np.random.uniform(-1, 1, 185))\nsix = list(np.random.uniform(-1, 1, 365))\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01 00:00:00', periods=365)]\nbacktest = [time, six, twelve]\n\nresult = charts.GetRollingBeta([time, six, time, twelve], empty)\nresult = charts.GetRollingBeta([time, six, [], []], empty)\nresult = charts.GetRollingBeta(empty, empty)\n\ntwelve = [np.nan for x in range(180)] + list(np.random.uniform(-1, 1, 185))\nsix = list(np.random.uniform(-1, 1, 365))\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2013-10-01 00:00:00', periods=365)]\nlive = [time, six, time, twelve]\n\nresult = charts.GetRollingBeta(live)\n\n## Test GetRollingSharpeRatioPlot\nsix = list(np.random.uniform(1, 3, 365 * 2))\ntwelve = [np.nan for x in range(365)] + list(np.random.uniform(1, 3, 365))\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2012-10-01 00:00:00', periods=365 * 2)]\nsix_live = list(np.random.uniform(1, 3, 365 + 180))\ntwelve_live = [np.nan for x in range(180)] + list(np.random.uniform(1, 3, 365))\ntime_live = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2014-10-01 00:00:00', periods=365 + 180)]\n\nempty = [[], [], [], []]\nresult = charts.GetRollingSharpeRatio([time, six, time, twelve], empty)\nresult = charts.GetRollingSharpeRatio([time, six, [], []], empty)\nresult = charts.GetRollingSharpeRatio([time, six, time, twelve], [time_live, six_live, time_live, twelve_live])\nresult = charts.GetRollingSharpeRatio([time, six, [], []], [time_live, six_live, time_live, twelve_live])\nresult = charts.GetRollingSharpeRatio([time, six, time, twelve], [time_live, six_live, [], []])\nresult = charts.GetRollingSharpeRatio([time, six, [], []], [time_live, six_live, [], []])\n\n## Test GetAssetAllocationPlot\nbacktest = [['SPY', 'IBM', 'NFLX', 'AAPL'], [0.50, 0.25, 0.125, 0.125]]\nlive = [['SPY', 'IBM', 'AAPL'], [0.4, 0.4, 0.2]]\nempty = [[], []]\nresult = charts.GetAssetAllocation(empty, empty)\nresult = charts.GetAssetAllocation(backtest, empty)\nresult = charts.GetAssetAllocation(backtest, live)\n\n## Test GetLeveragePlot\nbacktest = [[pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2014-10-01', periods=365)],\n            list(np.random.uniform(0.5, 1.5, 365))]\nlive = [[pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2015-10-01', periods=100)],\n        list(np.random.uniform(0.5, 2, 100))]\nempty = [[], []]\nresult = charts.GetLeverage(empty, empty)\nresult = charts.GetLeverage(backtest, empty)\nresult = charts.GetLeverage(backtest, live)\n\n## Test GetExposurePlot\ntime = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2014-10-01', periods=365)]\nlong_securities = list(ReportCharts.color_map.keys())\nshort_securities = long_securities\nlong = [np.random.uniform(0, 0.5, 365) for x in long_securities]\nshort = [np.random.uniform(-0.5, 0, 365) for x in short_securities]\n\nlive_time = [pd.Timestamp(x).to_pydatetime() for x in pd.date_range('2015-10-01', periods=100)]\nlive_long_securities = long_securities\nlive_short_securities = long_securities\nlive_long = [np.random.uniform(0, 0.5, 100) for x in live_long_securities]\nlive_short = [np.random.uniform(-0.5, -0, 100) for x in live_short_securities]\n\nresult = charts.GetExposure()\nresult = charts.GetExposure(time, long_securities = long_securities, long_data=long, short_securities=[], short_data=[list(np.zeros(len(long[0])))])\nresult = charts.GetExposure(time, long_securities=[], long_data=[list(np.zeros(len(short[0])))], short_securities = short_securities, short_data=short)\nresult = charts.GetExposure(time, long_securities, short_securities, long, short)\nresult = charts.GetExposure(time, long_securities, short_securities, long, short,\n                                live_time, live_long_securities, live_short_securities,\n                                live_long, live_short)\n"
  },
  {
    "path": "Report/ReportCharts.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport re\nimport matplotlib\nimport numpy as np\nimport pandas as pd\nfrom base64 import b64encode\nfrom datetime import date, datetime, timedelta\nfrom pandas.plotting import register_matplotlib_converters\nfrom clr import AddReference\nAddReference(\"System\")\nfrom System import *\n\nregister_matplotlib_converters()\n\n\n\nmatplotlib.use('Agg')\nfont = {'family': 'DejaVu Sans'}\nmatplotlib.rc('font',**font)\nmatplotlib.rc('axes', edgecolor='#d5d5d5')\n\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport matplotlib.colors as mcolors\nfrom matplotlib.dates import DateFormatter\nfrom matplotlib.ticker import MaxNLocator, NullFormatter, ScalarFormatter, FormatStrFormatter\nla = matplotlib.font_manager.FontManager()\nlu = matplotlib.font_manager.FontProperties(family = \"Open Sans Condensed\")\n\nclass ReportCharts:\n    color_map = {\n            \"Equity\": \"#ff9914\",\n            \"Option\": \"#DAA520\",\n            \"Commodity\": \"#9400D3\",\n            \"Forex\": \"#6495ED\",\n            \"Future\": \"#808000\",\n            \"Cfd\": \"#FFD700\",\n            \"Crypto\": \"#FFDAB9\",\n            \"FutureOption\": \"#1ED3A9\",\n            \"IndexOption\": \"#A4AACC\",\n            \"CryptoFuture\": \"#E55812\"\n        }\n\n    def fig_to_base64(self, filename = '', fig = None, dpi = 200):\n        base64 = 'data:image/png;base64,'\n        if fig is not None:\n            fig.savefig(filename, dpi=dpi, bbox_inches='tight')\n            with open(filename, \"rb\") as fp:\n                base64 += b64encode(fp.read()).decode('utf-8').replace('\\n', '')\n            return base64\n\n    def GetReturnsPerTrade(self, returns_per_trade = [], live_returns_per_trade = [],\n                           name = \"returns-per-trade.png\", width = 7, height = 5,\n                           live_color = \"#ff9914\", backtest_color = \"#71c3fc\"):\n\n        if len(returns_per_trade) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=30,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        if len(live_returns_per_trade) > 0:\n            width = 11.5\n            height = 5\n            plt.figure()\n            fig, ax = plt.subplots(1, 2, tight_layout=True)\n            ax[0].hist(returns_per_trade, bins=75, color=backtest_color)\n            ax[1].hist(live_returns_per_trade, bins=25, color=live_color)\n            for i in range(2):\n                    if i == 0:\n                        ax[i].set_ylabel('Backtest', fontweight='demibold')\n                        ax[i].axvline(x=np.median(returns_per_trade), color=\"red\", ls=\"dashed\", label=\"median\", linewidth=0.5)\n                    else:\n                        ax[i].set_ylabel('Live', fontweight='demibold')\n                        ax[i].axvline(x=np.median(live_returns_per_trade), color=\"red\", ls=\"dashed\", label=\"median\",\n                                      linewidth=0.5)\n                    ax[i].tick_params(labelsize=8)\n                    ax[i].tick_params(axis='x', color='#d5d5d5')\n                    ax[i].tick_params(axis='y', color='#d5d5d5')\n                    plt.setp(ax[i].spines.values(), color='#d5d5d5')\n                    ax[i].spines['right'].set_visible(False)\n                    ax[i].spines['top'].set_visible(False)\n        else:\n            fig = plt.figure()\n            plt.hist(returns_per_trade, bins=75, color=backtest_color)\n            plt.xticks(fontsize=8)\n            plt.yticks(fontsize=8)\n            plt.gca().spines['right'].set_visible(False)\n            plt.gca().spines['top'].set_visible(False)\n            plt.gca().tick_params(axis='x', color='#d5d5d5')\n            plt.gca().tick_params(axis='y', color='#d5d5d5')\n            plt.gca().axvline(x=np.median(returns_per_trade), color=\"red\", ls=\"dashed\", label=\"median\", linewidth=0.5)\n            plt.ylabel('')\n\n        # Set the x ticks as percentage to keep consistency\n        plt.xticks(ticks=plt.xticks()[0], labels=[\"{:.2f}%\".format(tick * 100) for tick in plt.xticks()[0]])\n\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetCumulativeReturns(self, data = None, live_data = None, benchmark_symbol = 'SPY',\n                                 name = \"cumulative-return.png\", width = 11.5, height = 2.5, live_color = \"#ff9914\",\n                                 backtest_color = \"#71c3fc\", gray = \"#b3bcc0\"):\n        '''\n        data: [ [strategyTime], [strategyPoints], [benchTime], [benchResults] ]\n        live_data: [ [strategyTime], [strategyPoints], [benchTime], [benchResults] ]\n        '''\n\n        # Initialize lists here instead of method signature to avoid\n        # unintended behavior when calling this method twice\n        if data is None:\n            data = [[],[],[],[]]\n        if live_data is None:\n            live_data = [[],[],[],[]]\n\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        plt.figure()\n        ax = plt.gca()\n        labels = ['Backtest', 'Benchmark']\n        labels_removed = []\n\n        rectangles = []\n        colors = [backtest_color, gray]\n        values = [[data[0], data[1]], [data[2], data[3]]]\n\n        for i, array in enumerate(values):\n            if any(array[0]):\n                ax.plot(array[0], array[1], linewidth=0.5, color=colors[i], drawstyle='steps-post')\n            else:\n                # We have nothing for this graph. Wipe any mention of it\n                labels_removed.append(labels[i])\n\n            rectangles.append(plt.Rectangle((0, 0), 1, 1, fc=colors[i]))\n\n        # Only get the labels we didn't remove (i.e. labels that have a graph, guaranteed)\n        labels = [label for label in labels if label not in labels_removed]\n\n        # Return if we don't have any valid labels\n        if not any(labels):\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        live_labels = []\n        live_labels_removed = []\n\n        if len(live_data[0]) > 0:\n            colors = [live_color, gray]\n            labels.append('Live')\n            values = [[live_data[0], live_data[1]], [live_data[2], live_data[3]]]\n\n            for i, array in enumerate(values):\n                if any(array[0]):\n                    ax.plot(array[0], array[1], linewidth=0.5, color=colors[i], drawstyle='steps-post')\n                    rectangles.append(plt.Rectangle((0, 0), 1, 1, fc=colors[i]))\n\n        ax.legend(rectangles, labels, handlelength=0.8, handleheight=0.8,\n                  frameon=False, fontsize=8, ncol=len(labels))\n        fig = ax.get_figure()\n        plt.xticks(rotation=0, ha='center', fontsize=8)\n        plt.yticks(fontsize=8)\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n        ax.yaxis.set_major_formatter(ticker.PercentFormatter())\n        ax.yaxis.set_major_locator(MaxNLocator(6))\n        plt.axhline(y=0, color='#d5d5d5', zorder=1)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        plt.ylabel(\"\")\n        plt.xlabel(\"\")\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetDailyReturns(self, returns = [[],[]], live_returns = [[],[]],\n                            name = \"daily-returns.png\", width = 11.5, height = 2.5,\n                            live_color = \"#ff9914\", backtest_color = \"#71c3fc\", gray = \"#b3bcc0\"):\n        if len(returns[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        returns[0] = list(returns[0])\n        returns[1] = list(returns[1])\n        live_returns[0] = list(live_returns[0])\n        live_returns[1] = list(live_returns[1])\n\n        plt.figure()\n        ax = plt.gca()\n\n        backtest_series = pd.Series(returns[1], index=returns[0])\n        live_series = pd.Series(live_returns[1], index=live_returns[0])\n\n        backtest_positive = backtest_series[backtest_series > 0]\n        backtest_negative = backtest_series[backtest_series < 0]\n        live_positive = live_series[live_series > 0]\n        live_negative = live_series[live_series < 0]\n\n        # Backtest\n        #ax.bar(returns[0][:min(len(returns[0]),len(returns[1]))], returns[1], color=backtest_color,zorder=2)\n        ax.bar(backtest_positive.index, backtest_positive.values, color=backtest_color, zorder=2)\n        ax.bar(backtest_negative.index, backtest_negative.values, color=gray, zorder=2)\n\n        # Live\n        #ax.bar(live_returns[0][:min(len(live_returns[0]),len(live_returns[1]))], live_returns[1], color=live_color,zorder=2)\n        ax.bar(live_positive.index, live_positive.values, color=live_color, zorder=2)\n        ax.bar(live_negative.index, live_negative.values, color=gray, zorder=2)\n\n        # Need to handle this since we don't use a legend if it is only backtesting\n        if len(live_returns[0]) > 0:\n            rectangles = [plt.Rectangle((0, 0), 1, 1, fc=backtest_color), plt.Rectangle((0, 0), 1, 1, fc=live_color)]\n            ax.legend(rectangles, [label for label in ['Backtest', \"Live\"]], handlelength=0.8, handleheight=0.8,\n                      frameon=False, fontsize=8)\n\n        fig = ax.get_figure()\n        ax.xaxis_date()\n        #ax.set_xticks(fontsize = 8)\n        #ax.set_yticks(fontsize = 8)\n        ax.set_ylabel(\"\")\n        ax.set_xlabel(\"\")\n        ax.yaxis.set_major_formatter(ticker.PercentFormatter())\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n        plt.axhline(y = 0, color = '#d5d5d5')\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        ax.set_axisbelow(True)\n        ax.yaxis.grid(True, color = \"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        return base64\n\n    def GetMonthlyReturns(self, returns = {}, live_returns = {}, width=7, height=5, name='monthly-returns.png'):\n        '''\n        Expects monthly returns in dictionary keyed by year containing a list of monthly returns (as percentage values, i.e. 1% is 1.0 in the list).\n        Example: {'2019': [10.0, 15.25, -20.05, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]}\n        '''\n        months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n\n        # Populate the list with np.nan so that we can successfully\n        # convert this dict into a DataFrame\n        #for k in returns.keys(): while len(returns[k]) != 12:\n        #                   returns[k].append(np.nan)\n\n        if len(returns) == 0:\n            print(\"No monthly returns found\")\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=30,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        # Make data frame\n        returns = pd.DataFrame(returns, index = months).transpose()\n\n        c = mcolors.ColorConverter().to_rgb\n        colors = [c('#CC0000'), c('#FF0000'), c('#FF3333'),\n                  c('#FF9933'), c('#FFFF66'), c('#FFFF99'),\n                  c('#B2FF66'), c('#99FF33'),\n                  c('#00FF00'), c('#00CC00')]\n\n        abs_cmap = matplotlib.colors.LinearSegmentedColormap.from_list('monthly_returns', colors)\n        norm = plt.Normalize(-10, 10)\n\n        if len(live_returns) > 0:\n            live_returns = pd.DataFrame(live_returns, index=months).transpose()\n\n            fig, ax = plt.subplots(2, 1, gridspec_kw={'height_ratios': [6, 1]})\n            #ax[0].matshow(returns, aspect='auto', cmap=c_map, interpolation='none', vmin=-10, vmax=10)\n            #ax[1].matshow(live_returns, aspect='auto', cmap=live_c_map, interpolation='none')\n            ax[0].matshow(returns, aspect='auto', cmap=abs_cmap, norm=norm, interpolation='none')\n            ax[1].matshow(live_returns, aspect='auto', cmap=abs_cmap, norm=norm, interpolation='none')\n\n            ax[0].xaxis.set_major_locator(ticker.MaxNLocator(min(12, len(returns.columns))))\n            ax[0].yaxis.set_major_locator(ticker.MaxNLocator(len(returns.index.values)))\n            ax[0].set_yticklabels([''] + list(returns.index.values))\n            ax[0].set_xticklabels([''] + [x for x in returns.columns])\n            ax[0].tick_params(labelsize=8, bottom=True, labelbottom=True, top=False, labeltop=False)\n            ax[0].set_ylabel('Backtest', rotation='vertical', fontweight='black')\n            for (j, i), label in np.ndenumerate(returns):\n                if np.isnan(label):\n                    ax[0].text(i, j, \"\", ha='center', va='center', fontsize=7)\n                else:\n                    ax[0].text(i, j, round(label, 1), ha='center', va='center', fontsize=7)\n\n            ax[1].xaxis.set_major_locator(ticker.MaxNLocator(min(12, len(live_returns.columns))))\n            ax[1].yaxis.set_major_locator(ticker.MaxNLocator(len(live_returns.index.values)))\n            ax[1].set_xticklabels([''] + [x for x in live_returns.columns])  ## will need to be fixed for more than 1 year\n            ax[1].set_yticklabels([''] + list(live_returns.index.values))\n            ax[1].tick_params(labelsize=8, bottom=True, labelbottom=True, top=False, labeltop=False)\n            ax[1].set_ylabel('Live', rotation='vertical', fontweight='black')\n            for (j, i), label in np.ndenumerate(live_returns):\n                if np.isnan(label):\n                    ax[1].text(i, j, \"\", ha='center', va='center', fontsize=7)\n                else:\n                    ax[1].text(i, j, round(label, 1), ha='center', va='center', fontsize=7)\n\n            ax[0].tick_params(axis='x', color='#d5d5d5')\n            ax[0].tick_params(axis='y', color='#d5d5d5')\n            ax[1].tick_params(axis='x', color='#d5d5d5')\n            ax[1].tick_params(axis='y', color='#d5d5d5')\n\n        else:\n            ax = plt.imshow(returns, aspect='auto', cmap=abs_cmap, norm=norm, interpolation='none')\n            fig = ax.get_figure()\n            plt.xlabel('')\n            plt.ylabel('')\n            plt.gca().tick_params(axis='x', color='#d5d5d5')\n            plt.gca().tick_params(axis='y', color='#d5d5d5')\n            plt.yticks(range(len(returns.index.values)), returns.index.values, fontsize=8)\n            plt.xticks(range(12), [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"])\n            for (j, i), label in np.ndenumerate(returns):\n                if np.isnan(label):\n                    plt.text(i, j, \"\", ha='center', va='center', fontsize=7)\n                else:\n                    plt.text(i, j, str(round(label, 1)), ha='center', va='center', fontsize=7)\n\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetAnnualReturns(self, data = None, live_data = None, name = \"annual-returns.png\",width = 3.5*2, height = 2.5*2):\n\n        live_color = \"#ff9914\"\n        backtest_color = \"#71c3fc\"\n\n        if data is None:\n            data = [[], []]\n        if live_data is None:\n            live_data = [[], []]\n\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=30,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        # Cast to list just in case\n        time = list(data[0]) + list(live_data[0])\n        returns = list(data[1]) + list(live_data[1])\n\n        plt.figure()\n        ax = plt.gca()\n        # Prevent value speculation on the y-axis ticks by\n        # converting to string before plotting.\n        ax.barh([str(i) for i in time], returns, color = [backtest_color], zorder=1)\n        # Add a percentage sign at the end of each x-axis tick\n        ax.xaxis.set_major_formatter(ticker.PercentFormatter())\n\n        fig = ax.get_figure()\n        plt.xticks(rotation=0, ha='center', fontsize=8)\n        plt.yticks(fontsize=8)\n        plt.axvline(x=0, color='#d5d5d5', linewidth=0.5)\n        vline = plt.axvline(x=np.mean(returns), color=\"red\", ls=\"dashed\", label=\"mean\", linewidth=1)\n        plt.legend([vline], [\"mean\"], loc='upper right', frameon=False, fontsize=8)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        ax.grid(color='#d5d5d5', axis='x', linewidth=1, zorder=0)\n        ax.set_axisbelow(True)\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        plt.xlabel(\"\")\n        plt.ylabel(\"\")\n        ax.xaxis.grid(True)\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetDrawdown(self, data = [[],[]], live_data = [[],[]], worst = [{}], name = \"drawdowns.png\",\n                        width = 11.5, height = 2.5, gray = \"#b3bcc0\"):\n\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        time = list(data[0]) + list(live_data[0])\n        drawdown = list(data[1]) + list(live_data[1])\n\n        colors = [\"#FFCCCCCC\", \"#FFE5CCCC\", \"#FFFFCCCC\", \"#E5FFCCCC\", \"#CCFFCCCC\"]\n        labels = [\"1st Worst\", \"2nd Worst\", \"3rd Worst\", \"4th Worst\", \"5th Worst\"]\n        plt.figure()\n        ax = plt.gca()\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n\n        # Backtest\n        #ax.plot(time, drawdown, color=gray, zorder=2)\n        ax.fill_between(time, drawdown, 0, color=gray, zorder=3, step='post')\n\n        for index, values in enumerate(worst):\n            start = values['Begin']\n            end = values['End']\n\n            if start == end:\n                worst_point = start\n            else:\n                sub_data = drawdown[time.index(start):time.index(end)]\n                worst_point = time[drawdown.index(min(sub_data))]\n\n            plt.axvspan(start, end, 0, 0.95, color = colors[index], zorder = 1)\n            plt.axvline(worst_point, 0, 0.95, ls = 'dashed', color = 'black', zorder = 4, linewidth = 0.5)\n            ax.text(worst_point, min(drawdown) * 0.75, labels[index], rotation = 90, zorder = 4, va='bottom')\n\n        # Live\n        live_time = live_data[0]\n        live_drawdown = live_data[1]\n\n        # No need to draw the live mode stuff since we've already taken care of it.\n        # We're just after the Live trading dotted plot in case it exists\n\n        plt.axvline(live_time[0], 0, 0.95, ls='dotted', color='red', zorder=4) if len(live_time) > 0 else None\n        plt.text(live_time[0], min(min(drawdown), min(live_drawdown)) * 0.75, \"Live Trading\", rotation=90, zorder=4, fontsize=7) if len(live_time) > 0 else None\n\n        fig = ax.get_figure()\n        plt.xticks(rotation=0, ha='center', fontsize=8)\n        plt.yticks(ticks=[i for i in plt.yticks()[0] if i <= 0], labels=['{:.1f}%'.format(i * 100) for i in plt.yticks()[0] if i <= 0], fontsize=8)\n        plt.ylabel(\"\")\n        plt.xlabel(\"\")\n        plt.axhline(y=0, color='#d5d5d5', zorder=1)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetCrisisEventsPlots(self, data = [[],[],[]], name = '', width = 7, height = 5,\n                             backtest_color = \"#71c3fc\", gray = \"#b3bcc0\"):\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n            base64 = self.fig_to_base64(f'{name}.png', fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        plt.figure()\n        ax = plt.gca()\n        fig = ax.get_figure()\n        ax.xaxis.set_major_formatter(DateFormatter(\"%Y-%m-%d\"))\n        colors = [backtest_color, gray]\n        for j, values in enumerate(data[1:]):\n            ax.plot(data[0][:min(len(data[0]),len(values))], values, color=colors[j], linewidth=0.5, zorder=2, drawstyle='steps-post')\n        labels = ['Backtest', 'Benchmark']\n        rectangles = [plt.Rectangle((0, 0), 1, 1, fc=backtest_color), plt.Rectangle((0, 0), 1, 1, fc=gray)]\n        leg = ax.legend(rectangles, labels, handlelength=0.8, handleheight=0.8,\n                        frameon=False, fontsize=8, ncol=len(labels))\n        for line in leg.get_lines(): line.set_linewidth(3)\n        plt.axhline(y=0, color= gray, zorder=1)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        ax.tick_params(axis='x', labelsize=8, labelrotation=45)\n        plt.yticks(ticks=plt.yticks()[0], labels=['{0:g}%'.format(i * 100) for i in plt.yticks()[0]], fontsize=8)\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        plt.xlabel(\"\")\n        plt.ylabel(\"\")\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(f'{name}.png', fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetRollingBeta(self, data = [[],[],[],[]], live_data = [[],[],[],[]], name = \"rolling-portfolio-beta-to-equity.png\",\n                        width = 11.5, height = 2.5, live_six_months_color = \"#ff9914\", live_twelve_months_color = \"#ffd700\",\n                        backtest_six_months_color = \"#71c3fc\", backtest_twelve_months_color = \"#1d7dc1\"):\n\n        if len(data[0]) == 0 and len(live_data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        # Data will come in the following format:\n        # [six month rolling beta time, six month rolling beta, twelve month rolling beta time, twelve month rolling beta]\n\n        backtest_six_month_beta_dates, backtest_six_month_beta = (data[0], data[1])\n        backtest_twelve_month_beta_dates, backtest_twelve_month_beta = (data[2], data[3])\n        live_six_month_beta_dates, live_six_month_beta = (live_data[0], live_data[1])\n        live_twelve_month_beta_dates, live_twelve_month_beta = (live_data[2], live_data[3])\n\n        labels = []\n        rectangles = []\n\n        if len(backtest_six_month_beta) > 0:\n            labels += ['6 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=backtest_six_months_color)]\n        if len(backtest_twelve_month_beta) > 0:\n            labels += ['12 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=backtest_twelve_months_color)]\n        if len(live_six_month_beta) > 0:\n            labels += ['Live 6 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=live_six_months_color)]\n        if len(live_twelve_month_beta) > 0:\n            labels += ['Live 12 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=live_twelve_months_color)]\n\n        plt.figure()\n        ax = plt.gca()\n        fig = ax.get_figure()\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n\n        # Backtest\n        if len(backtest_six_month_beta) > 0:\n            ax.plot(backtest_six_month_beta_dates, backtest_six_month_beta, linewidth=0.5, color=backtest_six_months_color)\n        if len(backtest_twelve_month_beta) > 0:\n            ax.plot(backtest_twelve_month_beta_dates, backtest_twelve_month_beta, linewidth=0.5, color=backtest_twelve_months_color)\n\n        # Live\n        if len(live_six_month_beta) > 0:\n            ax.plot(live_six_month_beta_dates, live_six_month_beta, linewidth=0.5, color=live_six_months_color)\n        if len(live_twelve_month_beta) > 0:\n            ax.plot(live_twelve_month_beta_dates, live_twelve_month_beta, linewidth=0.5, color=live_twelve_months_color)\n\n        leg = ax.legend(rectangles, labels, handlelength=0.8, handleheight=0.8,\n                        frameon=False, fontsize=8, ncol=2)\n        for line in leg.get_lines(): line.set_linewidth(3)\n        plt.axhline(y=0, color='#d5d5d5', zorder=1)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        ax.tick_params(axis='both', labelsize=8, labelrotation=0)\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        plt.xlabel(\"\")\n        plt.ylabel(\"\")\n        ax.set_axisbelow(True)\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetRollingSharpeRatio(self, data = [[],[]], live_data = [[],[]], name = \"rolling-sharpe-ratio.png\",\n                                width = 11.5, height = 2.5, live_six_months_color = \"#ff9914\", live_twelve_months_color = \"#ffd700\",\n                                backtest_six_months_color = \"#71c3fc\", backtest_twelve_months_color = \"#1d7dc1\"):\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        plt.figure()\n        ax = plt.gca()\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n\n        # Data will come in the following format:\n        # [six month rolling sharpe time, six month rolling sharpe, twelve month rolling sharpe time, twelve month rolling sharpe]\n        backtest_six_month_rolling_sharpe_dates, backtest_six_month_rolling_sharpe = (data[0], data[1])\n        backtest_twelve_month_rolling_sharpe_dates, backtest_twelve_month_rolling_sharpe = (data[2], data[3])\n        live_six_month_rolling_sharpe_dates, live_six_month_rolling_sharpe = (live_data[0], live_data[1])\n        live_twelve_month_rolling_sharpe_dates, live_twelve_month_rolling_sharpe = (live_data[2], live_data[3])\n\n        labels = []\n        rectangles = []\n\n        if len(backtest_six_month_rolling_sharpe) > 0:\n            labels += ['6 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=backtest_six_months_color)]\n        if len(backtest_twelve_month_rolling_sharpe) > 0:\n            labels += ['12 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=backtest_twelve_months_color)]\n        if len(live_six_month_rolling_sharpe) > 0:\n            labels += ['Live 6 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=live_six_months_color)]\n        if len(live_twelve_month_rolling_sharpe) > 0:\n            labels += ['Live 12 mo.']\n            rectangles += [plt.Rectangle((0, 0), 1, 1, fc=live_twelve_months_color)]\n\n        # Backtest\n        if len(backtest_six_month_rolling_sharpe) > 0:\n            ax.plot(backtest_six_month_rolling_sharpe_dates, backtest_six_month_rolling_sharpe, linewidth=0.5, color=backtest_six_months_color)\n        if len(backtest_twelve_month_rolling_sharpe) > 0:\n            ax.plot(backtest_twelve_month_rolling_sharpe_dates, backtest_twelve_month_rolling_sharpe, linewidth=0.5, color=backtest_twelve_months_color)\n\n        # Live\n        if len(live_six_month_rolling_sharpe) > 0:\n            ax.plot(live_six_month_rolling_sharpe_dates, live_six_month_rolling_sharpe, linewidth=0.5, color=live_six_months_color)\n        if len(live_twelve_month_rolling_sharpe) > 0:\n            ax.plot(live_twelve_month_rolling_sharpe_dates, live_twelve_month_rolling_sharpe, linewidth=0.5, color=live_twelve_months_color)\n\n        leg = ax.legend(rectangles, labels, handlelength=0.8, handleheight=0.8,\n                        frameon=False, fontsize=8)\n        for line in leg.get_lines(): line.set_linewidth(3)\n        plt.axhline(y=0, color='#d5d5d5', zorder=1)\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        ax.tick_params(axis='both', labelsize=8, labelrotation=0)\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        plt.ylabel(\"\")\n        plt.xlabel(\"\")\n        ax.set_axisbelow(True)\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig = ax.get_figure()\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetAssetAllocation(self, data = [[],[]], live_data = [[],[]],\n                              name=\"asset-allocation.png\", width = 7, height = 5):\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=30,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return {\"Backtest Asset Allocation\": base64}\n\n        symbols = [data[0], live_data[0]]\n\n        data = [data[1], live_data[1]]\n        colors = ['#fce0bd', '#fcd6a7', '#fbcd92', '#fac37c', '#f8af53', '#f79b31', '#de8b2c', \"#dde1e3\"]\n        pies = {}\n\n        for i in range(len(data)):\n            symbols_to_use, to_label = symbols[i], data[i]\n\n            # No need to plot if there are no symbols/data -- necessary as we don't want to return a dictionary\n            # with even a blank plot for live if only using a backtest\n            if len(symbols_to_use) == 0:\n                continue\n\n            to_label = to_label[:7]\n            symbols_to_use = symbols_to_use[:7]\n            if sum(to_label) < 1:\n                to_label.append(1 - sum(to_label))\n                symbols_to_use.append('Others')\n\n            labels = [f'{symbol}\\n' + '{:.2f}%'.format(value * 100) for symbol, value in zip(symbols_to_use, to_label)]\n\n            fig = plt.figure()\n            plt.pie(to_label, colors = colors)\n            plt.legend(labels, frameon = False, fontsize = 8, loc = 'center left', bbox_to_anchor=(0, 0.5))\n            plt.axis('equal')\n            fig.set_size_inches(width, height)\n            if i == 0:\n                pies[\"Backtest Asset Allocation\"] = self.fig_to_base64(f\"asset-allocation-backtest.png\", fig)\n            else:\n                pies[\"Live Asset Allocation\"] = self.fig_to_base64(f\"asset-allocation-live.png\", fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n\n        pies[\"filler\"] = ''\n\n        return pies\n\n    def GetLeverage(self, data = [[],[]], live_data = [[],[]], name = \"leverage.png\",width = 11.5,\n                        height = 2.5, backtest_color = \"#71c3fc\", live_color = \"#ff9914\",):\n\n        if len(data[0]) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        labels = ['Backtest']\n\n        plt.figure()\n        ax = plt.gca()\n        fig = ax.get_figure()\n\n        # Backtest\n        ax.fill_between(data[0], 0, data[1], color = backtest_color, alpha = 0.75, step='post')\n\n        # Live\n        if len(live_data[0]) != 0:\n            labels.append('Live')\n\n        ax.fill_between(live_data[0], 0, live_data[1], color=live_color, alpha=0.75, step = 'post')\n\n        rectangles = [plt.Rectangle((0, 0), 1, 1, fc=backtest_color), plt.Rectangle((0, 0), 1, 1, fc=live_color)]\n        ax.legend(rectangles, [label for label in labels], handlelength=0.8, handleheight=0.8,\n                  frameon=False, fontsize=8)\n        ax.set_xticklabels(ax.get_xticklabels(), rotation=0, ha='center')\n        ax.tick_params(axis='both', labelsize=8, labelrotation=0)\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n        plt.axhline(y=0, color='#d5d5d5')\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        plt.ylabel(\"\")\n        plt.xlabel(\"\")\n        ax.set_axisbelow(True)\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        ax.yaxis.grid(True, color=\"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n\n    def GetExposure(self, time = [], long_securities = [], short_securities = [], long_data = [[]], short_data = [[]],\n                        live_time = [], live_long_securities = [], live_short_securities = [], live_long_data = [[]],\n                        live_short_data = [[]], name = \"exposure.png\", width = 11.5, height = 2.5):\n        if len(time) == 0:\n            fig = plt.figure()\n            fig.set_size_inches(width, height)\n\n            left, box_width = .25, .5\n            bottom, box_height = .25, .5\n            right = left + box_width\n            top = bottom + box_height\n\n            ax = fig.add_axes([0, 0, 1, 1])\n            ax.text(0.5 * (left + right), 0.5 * (top + bottom), 'Insufficient Data', color=\"#d5d5d5\",\n                    horizontalalignment='center',\n                    verticalalignment='center',\n                    fontsize=20,\n                    transform=ax.transAxes)\n\n            ax.axis('off')\n\n            for _, spine in ax.spines.items():\n                spine.set_visible(False)\n\n            base64 = self.fig_to_base64(name, fig)\n            plt.cla()\n            plt.clf()\n            plt.close('all')\n            return base64\n\n        for k, v in list(self.color_map.items()):\n            self.color_map[k + ' - Short'] = '#' + hex(int(v[1:], 16) ^ 0xffffff)[2:].zfill(6)\n\n        # None if no colors can be mapped, so stackplot gets None and doesn't try to access this color list\n        long_colors = [self.color_map[security] for security in long_securities] if len(long_securities) > 0 else None\n        long_live_colors = [self.color_map[security] for security in live_long_securities] if len(live_long_securities) > 0 else None\n        short_colors = [self.color_map[security + ' - Short'] for security in short_securities] if len(short_securities) > 0 else None\n        short_live_colors = [self.color_map[security + ' - Short'] for security in live_short_securities] if len(live_short_securities) > 0 else None\n\n        ax = plt.gca()\n\n        # Create step plot for the stackplot by adding a value\n        # right before the next data point with the same previous value\n        time_copy = []\n        long_data_copy = []\n        short_data_copy = []\n\n        j = 0\n        for time_idx, longs, shorts in zip(time, long_data, short_data):\n            long_data_copy.append([])\n            short_data_copy.append([])\n\n            long_len = len(longs)\n\n            for i in range(1, long_len + 1):\n                if i == long_len :\n                    time_copy.append(time[i - 1])\n                    long_data_copy[j].append(longs[i - 1])\n                    short_data_copy[j].append(shorts[i - 1])\n\n                else:\n                    time_copy.append(time[i - 1])\n                    time_copy.append(time[i])\n                    long_data_copy[j].append(longs[i - 1])\n                    long_data_copy[j].append(longs[i - 1])\n\n                    short_data_copy[j].append(shorts[i - 1])\n                    short_data_copy[j].append(shorts[i - 1])\n\n            j += 1\n\n        if len([x for x in long_data]) == 0:\n            long_data = [[]]\n        if len([x for x in short_data]) == 0:\n            short_data = [[]]\n        if len([x for x in live_long_data]) == 0:\n            live_long_data = [[]]\n        if len([x for x in live_short_data]) == 0:\n            live_short_data = [[]]\n\n        # Create step plot for the stackplot by adding a value\n        # right before the next data point with the same previous value\n        live_time_copy = []\n        live_long_data_copy = []\n        live_short_data_copy = []\n        j = 0\n        for time_idx, longs, shorts in zip(live_time, live_long_data, live_short_data):\n            live_long_data_copy.append([])\n            live_short_data_copy.append([])\n\n            long_len = len(longs)\n\n            for i in range(1, long_len + 1):\n                if i == long_len :\n                    live_time_copy.append(live_time[i - 1])\n                    live_long_data_copy[j].append(longs[i - 1])\n                    live_short_data_copy[j].append(shorts[i - 1])\n\n                else:\n                    live_time_copy.append(live_time[i - 1])\n                    live_time_copy.append(live_time[i])\n                    live_long_data_copy[j].append(longs[i - 1])\n                    live_long_data_copy[j].append(longs[i - 1])\n                    live_short_data_copy[j].append(shorts[i - 1])\n                    live_short_data_copy[j].append(shorts[i - 1])\n\n            j += 1\n\n        if not len(long_data_copy) > 0:\n            long_data_copy.append([])\n        if not len(short_data_copy) > 0:\n            short_data_copy.append([])\n        if not len(live_long_data_copy) > 0:\n            live_long_data_copy.append([])\n        if not len(live_short_data_copy) > 0:\n            live_short_data_copy.append([])\n        if not len(time_copy) > 0:\n            time_copy.append(float('nan'))\n\n        # No need to check if live is empty or not, this will handle it, just needs to plot whichever has the longer time index first\n        if max([len(x) for x in long_data_copy]) > max([len(x) for x in short_data_copy]):\n            ax.stackplot(time_copy[:max([len(x) for x in long_data_copy])], np.vstack(long_data_copy), colors=long_colors, alpha = 0.75)\n            ax.stackplot(time_copy[:max([len(x) for x in short_data_copy])], np.vstack(short_data_copy), colors=short_colors, alpha=0.75)\n        else:\n            ax.stackplot(time_copy[:max([len(x) for x in short_data_copy])], np.vstack(short_data_copy), colors=short_colors, alpha=0.75)\n            ax.stackplot(time_copy[:max([len(x) for x in long_data_copy])], np.vstack(long_data_copy), colors=long_colors, alpha=0.75)\n\n        if max([len(x) for x in live_long_data_copy]) > max([len(x) for x in live_short_data_copy]):\n            ax.stackplot(live_time_copy[:max([len(x) for x in live_long_data_copy])], np.vstack(live_long_data_copy),\n                         colors=long_live_colors, alpha = 0.75)\n            ax.stackplot(live_time_copy[:max([len(x) for x in live_short_data_copy])], np.vstack(live_short_data_copy),\n                         colors=short_live_colors, alpha = 0.75)\n        else:\n            ax.stackplot(live_time_copy[:max([len(x) for x in live_short_data_copy])], np.vstack(live_short_data_copy),\n                         colors=short_live_colors, alpha=0.75)\n            ax.stackplot(live_time_copy[:max([len(x) for x in live_long_data_copy])], np.vstack(live_long_data_copy),\n                         colors=long_live_colors, alpha=0.75)\n\n        labels = long_securities + short_securities\n        live_labels = live_long_securities + live_short_securities\n\n        for security in short_securities:\n            if not all([all([abs(y) == 0.0 for y in x]) for x in short_data]):\n                labels.append(security + ' - Short')\n\n        for security in live_short_securities:\n            if not all([all([abs(y) == 0.0 for y in x]) for x in live_short_data]):\n                live_labels.append(security + ' - Short')\n\n        # use dict.fromkeys() instead of set() to remove duplicates and preserve order\n        labels = list(dict.fromkeys(labels))\n        live_labels = list(dict.fromkeys(live_labels))\n        rectangles = [plt.Rectangle((0, 0), 1, 1, fc=self.color_map[lab]) for lab in labels]\n        live_rectangles = [plt.Rectangle((0, 0), 1, 1, fc=self.color_map[lab]) for lab in live_labels]\n        ax.legend(rectangles + live_rectangles, labels + [f'{lab} - Live' for lab in live_labels], handlelength=0.8,\n                  handleheight=0.8, frameon=False, fontsize=8, ncol=len(labels), loc='upper right')\n        fig = ax.get_figure()\n        plt.xticks(rotation = 0,ha = 'center', fontsize = 8)\n        plt.yticks(fontsize = 8)\n        plt.xlabel(\"\")\n        ax.axhline(y=0, color = 'black', linewidth = 0.5)\n        ax.xaxis.set_major_formatter(DateFormatter(\"%b %Y\"))\n        plt.setp(ax.spines.values(), color='#d5d5d5')\n        ax.spines['right'].set_visible(False)\n        ax.spines['top'].set_visible(False)\n        plt.setp([ax.get_xticklines(), ax.get_yticklines()], color='#d5d5d5')\n        plt.ylabel(\"\")\n        plt.xlabel(\"\")\n        ax.set_axisbelow(True)\n        ax.yaxis.grid(True, color = \"#ececec\")\n        fig.set_size_inches(width, height)\n        base64 = self.fig_to_base64(name, fig)\n        plt.cla()\n        plt.clf()\n        plt.close('all')\n        return base64\n"
  },
  {
    "path": "Report/ReportElements/AnnualReturnsReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class AnnualReturnsReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a new plot of annual returns\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public AnnualReturnsReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the annual returns plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestReturns = ResultsUtil.EquityPoints(_backtest);\n            var liveReturns = ResultsUtil.EquityPoints(_live);\n\n            var backtestTime = backtestReturns.Keys.ToList();\n            var backtestStrategy = backtestReturns.Values.ToList();\n\n            var liveTime = liveReturns.Keys.ToList();\n            var liveStrategy = liveReturns.Values.ToList();\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                var liveList = new PyList();\n\n                // We need to set the datetime index first before we resample\n                //var backtestSeries = Pandas.Series(backtestStrategy.ToPython());\n                var backtestSeries = new Series<DateTime, double>(backtestTime, backtestStrategy);\n\n                // Get the annual returns for the strategy\n                // ResampleEquivalence works similarly to Pandas' DataFrame.resample(...) method\n                // Here we transform the series to resample to the year's start, then we get the aggregate return from the year.\n                // Pandas equivalent:\n                //\n                // df.pct_change().resample('AS').sum().mul(100)\n                var backtestAnnualReturns = backtestSeries.ResampleEquivalence(date => new DateTime(date.Year, 1, 1), agg => agg.TotalReturns() * 100).DropMissing();\n\n                // We need to set the datetime index first before we resample\n                var liveSeries = new Series<DateTime, double>(liveTime, liveStrategy);\n\n                // Get the annual returns for the live strategy.\n                // Same as above, this is equivalent to:\n                //\n                // df.pct_change().resample('AS').sum().mul(100)\n                var liveAnnualReturns = liveSeries.ResampleEquivalence(date => new DateTime(date.Year, 1, 1), agg => agg.TotalReturns() * 100).DropMissing();\n\n                // Select only the year number and pass it to the plotting library\n                backtestList.Append(backtestAnnualReturns.Keys.Select(x => x.Year).ToList().ToPython());\n                backtestList.Append(backtestAnnualReturns.Values.ToList().ToPython());\n                liveList.Append(liveAnnualReturns.Keys.Select(x => x.Year).ToList().ToPython());\n                liveList.Append(liveAnnualReturns.Values.ToList().ToPython());\n\n                base64 = Charting.GetAnnualReturns(backtestList, liveList);\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/AssetAllocationReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class AssetAllocationReportElement : ChartReportElement\n    {\n        private BacktestResult _backtest;\n        private List<PointInTimePortfolio> _backtestPortfolios;\n        private LiveResult _live;\n        private List<PointInTimePortfolio> _livePortfolios;\n\n        /// <summary>\n        /// Create a new plot of the asset allocation over time\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"backtestPortfolios\">Backtest point in time portfolios</param>\n        /// <param name=\"livePortfolios\">Live point in time portfolios</param>\n        public AssetAllocationReportElement(\n            string name,\n            string key,\n            BacktestResult backtest,\n            LiveResult live,\n            List<PointInTimePortfolio> backtestPortfolios,\n            List<PointInTimePortfolio> livePortfolios)\n        {\n            _backtest = backtest;\n            _backtestPortfolios = backtestPortfolios;\n            _live = live;\n            _livePortfolios = livePortfolios;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the asset allocation pie chart using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestSeries = Metrics.AssetAllocations(_backtestPortfolios);\n            var liveSeries = Metrics.AssetAllocations(_livePortfolios);\n\n            PyObject result;\n\n            using (Py.GIL())\n            {\n                var data = new PyList();\n                var liveData = new PyList();\n\n                data.Append(backtestSeries.SortBy(x => -x).Where(x => x.Value != 0).Keys.Select(x => x.Value).ToList().ToPython());\n                data.Append(backtestSeries.SortBy(x => -x).Where(x => x.Value != 0).Values.ToList().ToPython());\n\n                liveData.Append(liveSeries.SortBy(x => -x).Where(x => x.Value != 0).Keys.Select(x => x.Value).ToList().ToPython());\n                liveData.Append(liveSeries.SortBy(x => -x).Where(x => x.Value != 0).Values.ToList().ToPython());\n\n                result = Charting.GetAssetAllocation(data, liveData);\n            }\n\n            var base64 = result.ConvertToDictionary<string, string>();\n            if (base64.ContainsKey(\"Live Asset Allocation\"))\n            {\n                return base64[\"Live Asset Allocation\"];\n            }\n\n            return base64[\"Backtest Asset Allocation\"];\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/CAGRReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Deedle;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class CAGRReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Estimate the CAGR of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public CAGRReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var equityCurve = _live == null\n                ? new Series<DateTime, double>(ResultsUtil.EquityPoints(_backtest))\n                : DrawdownCollection.NormalizeResults(_backtest, _live);\n\n            if (equityCurve.IsEmpty)\n            {\n                return \"-\";\n            }\n            \n            var years = (decimal)(equityCurve.LastKey() - equityCurve.FirstKey()).TotalDays / 365m;\n            \n            Result = Statistics.Statistics.CompoundingAnnualPerformance(\n                equityCurve.FirstValue().SafeDecimalCast(),\n                equityCurve.LastValue().SafeDecimalCast(),\n                years);\n            \n            return ((decimal?)Result)?.ToString(\"P1\") ?? \"-\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/ChartReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Python;\n\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal abstract class ChartReportElement : ReportElement\n    {\n        internal static dynamic Charting;\n\n        /// <summary>\n        /// Charting base class report element\n        /// </summary>\n        protected ChartReportElement()\n        {\n            PythonInitializer.Initialize();\n\n            using (Py.GIL())\n            {\n                dynamic module = Py.Import(\"ReportCharts\");\n                var classObj = module.ReportCharts;\n\n                Charting = classObj.Invoke();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/CrisisReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class CrisisReportElement : ChartReportElement\n    {\n        private const string _emptyChart = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABZ8AAAQPCAYAAAB/ZZXyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAf+0lEQVR4nOzYwQkAIBDAMHX/nc8lCoIkE/TdPTOzAAAAAAAgdF4HAAAAAADwH/MZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkzGcAAAAAAHLmMwAAAAAAOfMZAAAAAICc+QwAAAAAQM58BgAAAAAgZz4DAAAAAJAznwEAAAAAyJnPAAAAAADkbjt2LAAAAAAwyN96EjsLI/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADs5DMAAAAAADv5DAAAAADATj4DAAAAALCTzwAAAAAA7OQzAAAAAAA7+QwAAAAAwE4+AwAAAACwk88AAAAAAOzkMwAAAAAAO/kMAAAAAMBOPgMAAAAAsJPPAAAAAADsAtkSDBqxWCsiAAAAAElFTkSuQmCC\";\n        private LiveResult _live;\n        private BacktestResult _backtest;\n        private string _template;\n\n        /// <summary>\n        /// Create a new array of crisis event plots\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"template\">HTML template to use</param>\n        public CrisisReportElement(string name, string key, BacktestResult backtest, LiveResult live, string template)\n        {\n            _live = live;\n            _backtest = backtest;\n            _template = template;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPoints = ResultsUtil.EquityPoints(_backtest);\n            var backtestBenchmarkPoints = ResultsUtil.BenchmarkPoints(_backtest);\n\n            var backtestSeries = new Series<DateTime, double>(backtestPoints.Keys, backtestPoints.Values);\n            var backtestBenchmarkSeries = new Series<DateTime, double>(backtestBenchmarkPoints.Keys, backtestBenchmarkPoints.Values);\n\n            var html = new List<string>();\n\n            foreach (var crisisEvent in Crisis.Events)\n            {\n                using (Py.GIL())\n                {\n                    var crisis = crisisEvent.Value;\n                    var data = new PyList();\n                    var frame = Frame.CreateEmpty<DateTime, string>();\n\n                    // The two following operations are equivalent to Pandas' `df.resample(\"D\").sum()`\n                    frame[\"Backtest\"] = backtestSeries.ResampleEquivalence(date => date.Date, s => s.LastValue());\n                    frame[\"Benchmark\"] = backtestBenchmarkSeries.ResampleEquivalence(date => date.Date, s => s.LastValue());\n\n                    var crisisFrame = frame.Where(kvp => kvp.Key >= crisis.Start && kvp.Key <= crisis.End);\n                    crisisFrame = crisisFrame.Join(\"BacktestPercent\", crisisFrame[\"Backtest\"].CumulativeReturns());\n                    crisisFrame = crisisFrame.Join(\"BenchmarkPercent\", crisisFrame[\"Benchmark\"].CumulativeReturns());\n\n                    // Pad out all missing values to start from 0 for nice plots\n                    crisisFrame = crisisFrame.FillMissing(Direction.Forward).FillMissing(0.0);\n\n                    data.Append(crisisFrame.RowKeys.ToList().ToPython());\n                    data.Append(crisisFrame[\"BacktestPercent\"].Values.ToList().ToPython());\n                    data.Append(crisisFrame[\"BenchmarkPercent\"].Values.ToList().ToPython());\n\n                    var base64 = (string)Charting.GetCrisisEventsPlots(data, crisis.Name.Replace(\"/\", \"\").Replace(\".\", \"\").Replace(\" \", \"\"));\n\n                    if (base64 == _emptyChart)\n                    {\n                        continue;\n                    }\n\n                    if (!crisisFrame.IsEmpty)\n                    {\n                        var contents = _template.Replace(ReportKey.CrisisTitle, crisis.ToString(crisisFrame.GetRowKeyAt(0), crisisFrame.GetRowKeyAt(crisisFrame.RowCount - 1)));\n                        contents = contents.Replace(ReportKey.CrisisContents, base64);\n\n                        html.Add(contents);\n                    }\n                }\n            }\n\n            if (Key == ReportKey.CrisisPageStyle)\n            {\n                if (html.Count == 0)\n                {\n                    return \"display: none;\";\n                }\n\n                return string.Empty;\n            }\n\n            return string.Join(\"\\n\", html);\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/CumulativeReturnsReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Packets;\nusing System;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class CumulativeReturnsReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a new array of cumulative percentage return of strategy and benchmark\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public CumulativeReturnsReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the cumulative return of the backtest, benchmark, and live\n        /// strategy using the ReportCharts.py python library\n        /// </summary>\n        public override string Render()\n        {\n            var backtestReturns = ResultsUtil.EquityPoints(_backtest);\n            var benchmark = ResultsUtil.BenchmarkPoints(_backtest);\n            var liveReturns = ResultsUtil.EquityPoints(_live);\n            var liveBenchmark = ResultsUtil.BenchmarkPoints(_live);\n\n            var backtestTime = backtestReturns.Keys.ToList();\n            var backtestStrategy = backtestReturns.Values.ToList();\n            var benchmarkTime = benchmark.Keys.ToList();\n            var benchmarkPoints = benchmark.Values.ToList();\n\n            var liveTime = liveReturns.Keys.ToList();\n            var liveStrategy = liveReturns.Values.ToList();\n            var liveBenchmarkTime = liveBenchmark.Keys.ToList();\n            var liveBenchmarkStrategy = liveBenchmark.Values.ToList();\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                var liveList = new PyList();\n\n                var backtestSeries = new Series<DateTime, double>(backtestTime, backtestStrategy);\n                var liveSeries = new Series<DateTime, double>(liveTime, liveStrategy);\n                var backtestBenchmarkSeries = new Series<DateTime, double>(benchmarkTime, benchmarkPoints);\n                var liveBenchmarkSeries = new Series<DateTime, double>(liveBenchmarkTime, liveBenchmarkStrategy);\n\n                // Equivalent in python using pandas for the following operations is:\n                // --------------------------------------------------\n                // >>> # note: [...] denotes the data we're passing in\n                // >>> df = pd.Series([...], index=time)\n                // >>> df_live = pd.Series([...], index=live_time)\n                // >>> df_live = df_live.mul(df.iloc[-1] / df_live.iloc[0]).fillna(method='ffill').dropna()\n                // >>> df_final = pd.concat([df, df_live], axis=0)\n                // >>> df_cumulative_returns = ((df_final.pct_change().dropna() + 1).cumprod() - 1)\n                // --------------------------------------------------\n                //\n                // We multiply the final value of the backtest and benchmark to have a continuous graph showing the performance out of sample\n                // as a continuation of the cumulative returns graph. Otherwise, we start plotting from 0% and not the last value of the backtest data\n\n                var backtestLastValue = backtestSeries.ValueCount == 0 ? 0 : backtestSeries.LastValue();\n                var backtestBenchmarkLastValue = backtestBenchmarkSeries.ValueCount == 0 ? 0 : backtestBenchmarkSeries.LastValue();\n\n                var liveContinuousEquity = liveSeries;\n                var liveBenchContinuousEquity = liveBenchmarkSeries;\n\n                if (liveSeries.ValueCount != 0)\n                {\n                    liveContinuousEquity = (liveSeries * (backtestLastValue / liveSeries.FirstValue()))\n                        .FillMissing(Direction.Forward)\n                        .DropMissing();\n                }\n                if (liveBenchmarkSeries.ValueCount != 0)\n                {\n                    liveBenchContinuousEquity = (liveBenchmarkSeries * (backtestBenchmarkLastValue / liveBenchmarkSeries.FirstValue()))\n                        .FillMissing(Direction.Forward)\n                        .DropMissing();\n                }\n\n                var liveStart = liveContinuousEquity.ValueCount == 0 ? DateTime.MaxValue : liveContinuousEquity.DropMissing().FirstKey();\n                var liveBenchStart = liveBenchContinuousEquity.ValueCount == 0 ? DateTime.MaxValue : liveBenchContinuousEquity.DropMissing().FirstKey();\n\n                var finalEquity = backtestSeries.Where(kvp => kvp.Key < liveStart).Observations.ToList();\n                var finalBenchEquity = backtestBenchmarkSeries.Where(kvp => kvp.Key < liveBenchStart).Observations.ToList();\n\n                finalEquity.AddRange(liveContinuousEquity.Observations);\n                finalBenchEquity.AddRange(liveBenchContinuousEquity.Observations);\n\n                var finalSeries = (new Series<DateTime, double>(finalEquity).CumulativeReturns() * 100)\n                    .FillMissing(Direction.Forward)\n                    .DropMissing();\n\n                var finalBenchSeries = (new Series<DateTime, double>(finalBenchEquity).CumulativeReturns() * 100)\n                    .FillMissing(Direction.Forward)\n                    .DropMissing();\n\n                var backtestCumulativePercent = finalSeries.Where(kvp => kvp.Key < liveStart);\n                var backtestBenchmarkCumulativePercent = finalBenchSeries.Where(kvp => kvp.Key < liveBenchStart);\n\n                var liveCumulativePercent = finalSeries.Where(kvp => kvp.Key >= liveStart);\n                var liveBenchmarkCumulativePercent = finalBenchSeries.Where(kvp => kvp.Key >= liveBenchStart);\n\n                backtestList.Append(backtestCumulativePercent.Keys.ToList().ToPython());\n                backtestList.Append(backtestCumulativePercent.Values.ToList().ToPython());\n                backtestList.Append(backtestBenchmarkCumulativePercent.Keys.ToList().ToPython());\n                backtestList.Append(backtestBenchmarkCumulativePercent.Values.ToList().ToPython());\n\n                liveList.Append(liveCumulativePercent.Keys.ToList().ToPython());\n                liveList.Append(liveCumulativePercent.Values.ToList().ToPython());\n                liveList.Append(liveBenchmarkCumulativePercent.Keys.ToList().ToPython());\n                liveList.Append(liveBenchmarkCumulativePercent.Values.ToList().ToPython());\n\n                base64 = Charting.GetCumulativeReturns(backtestList, liveList);\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/DailyReturnsReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class DailyReturnsReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a new plot of the daily returns in bar chart format\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public DailyReturnsReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the daily returns plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestReturns = ResultsUtil.EquityPoints(_backtest);\n            var liveReturns = ResultsUtil.EquityPoints(_live);\n\n            var backtestSeries = new Series<DateTime, double>(backtestReturns.Keys, backtestReturns.Values);\n            var liveSeries = new Series<DateTime, double>(liveReturns.Keys, liveReturns.Values);\n\n            // The following two operations are equivalent to the Pandas `DataFrame.resample(...)` method\n            var backtestResampled = backtestSeries.ResampleEquivalence(date => date.Date, s => s.LastValue()).PercentChange().DropMissing() * 100;\n            var liveResampled = liveSeries.ResampleEquivalence(date => date.Date, s => s.LastValue()).PercentChange().DropMissing() * 100;\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                backtestList.Append(backtestResampled.Keys.ToList().ToPython());\n                backtestList.Append(backtestResampled.Values.ToList().ToPython());\n\n                var liveList = new PyList();\n                liveList.Append(liveResampled.Keys.ToList().ToPython());\n                liveList.Append(liveResampled.Values.ToList().ToPython());\n\n                base64 = Charting.GetDailyReturns(backtestList, liveList);\n\n                backtestList.Dispose();\n                liveList.Dispose();\n            }\n\n            return base64;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/DrawdownReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class DrawdownReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a new plot of the top N worst drawdown durations\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public DrawdownReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the top N drawdown plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPoints = ResultsUtil.EquityPoints(_backtest);\n            var livePoints = ResultsUtil.EquityPoints(_live);\n\n            var liveSeries = new Series<DateTime, double>(livePoints.Keys, livePoints.Values);\n            var strategySeries = DrawdownCollection.NormalizeResults(_backtest, _live);\n\n            var seriesUnderwaterPlot = DrawdownCollection.GetUnderwater(strategySeries).DropMissing();\n            var liveUnderwaterPlot = backtestPoints.Count == 0 ? seriesUnderwaterPlot : seriesUnderwaterPlot.After(backtestPoints.Last().Key);\n            var drawdownCollection = DrawdownCollection.FromResult(_backtest, _live, periods: 5);\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n\n                if (liveUnderwaterPlot.IsEmpty)\n                {\n                    backtestList.Append(seriesUnderwaterPlot.Keys.ToList().ToPython());\n                    backtestList.Append(seriesUnderwaterPlot.Values.ToList().ToPython());\n                }\n                else\n                {\n                    backtestList.Append(seriesUnderwaterPlot.Before(liveUnderwaterPlot.FirstKey()).Keys.ToList().ToPython());\n                    backtestList.Append(seriesUnderwaterPlot.Before(liveUnderwaterPlot.FirstKey()).Values.ToList().ToPython());\n                }\n\n                var liveList = new PyList();\n                liveList.Append(liveUnderwaterPlot.Keys.ToList().ToPython());\n                liveList.Append(liveUnderwaterPlot.Values.ToList().ToPython());\n\n                var worstList = new PyList();\n                var previousDrawdownPeriods = new List<KeyValuePair<DateTime, DateTime>>();\n\n                foreach (var group in drawdownCollection.Drawdowns)\n                {\n                    // Skip drawdown periods that are overlapping\n                    if (previousDrawdownPeriods.Where(kvp => (group.Start >= kvp.Key && group.Start <= kvp.Value) || (group.End >= kvp.Key && group.End <= kvp.Value)).Any())\n                    {\n                        continue;\n                    }\n\n                    var worst = new PyDict();\n                    worst.SetItem(\"Begin\", group.Start.ToPython());\n                    worst.SetItem(\"End\", group.End.ToPython());\n                    worst.SetItem(\"Total\", group.PeakToTrough.ToPython());\n\n                    worstList.Append(worst);\n                    previousDrawdownPeriods.Add(new KeyValuePair<DateTime, DateTime>(group.Start, group.End));\n                }\n\n                base64 = Charting.GetDrawdown(backtestList, liveList, worstList);\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/EstimatedCapacityReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    /// <summary>\n    /// Capacity Estimation Report Element\n    /// </summary>\n    public sealed class EstimatedCapacityReportElement : ReportElement\n    {\n        private readonly BacktestResult _backtest;\n        private readonly LiveResult _live;\n\n        /// <summary>\n        /// Create a new capacity estimate\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public EstimatedCapacityReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Render element\n        /// </summary>\n        public override string Render()\n        {\n            var statistics = _backtest?.Statistics;\n            string capacityWithCurrency;\n            if (statistics == null || !statistics.TryGetValue(\"Estimated Strategy Capacity\", out capacityWithCurrency))\n            {\n                return \"-\";\n            }\n\n            var capacity = Currencies.Parse(capacityWithCurrency).RoundToSignificantDigits(2);\n\n            Result = capacity;\n\n            if (capacity == 0m)\n            {\n                return \"-\";\n            }\n\n            return capacity.ToFinancialFigures();\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/ExposureReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class ExposureReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n        private List<PointInTimePortfolio> _backtestPortfolios;\n        private List<PointInTimePortfolio> _livePortfolios;\n\n        /// <summary>\n        /// Create a new plot of the exposure\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"backtestPortfolios\">Backtest point in time portfolios</param>\n        /// <param name=\"livePortfolios\">Live point in time portfolios</param>\n        public ExposureReportElement(\n            string name,\n            string key,\n            BacktestResult backtest,\n            LiveResult live,\n            List<PointInTimePortfolio> backtestPortfolios,\n            List<PointInTimePortfolio> livePortfolios)\n        {\n            _backtest = backtest;\n            _backtestPortfolios = backtestPortfolios;\n            _live = live;\n            _livePortfolios = livePortfolios;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the exposure plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var longBacktestFrame = Metrics.Exposure(_backtestPortfolios, OrderDirection.Buy);\n            var shortBacktestFrame = Metrics.Exposure(_backtestPortfolios, OrderDirection.Sell);\n            var longLiveFrame = Metrics.Exposure(_livePortfolios, OrderDirection.Buy);\n            var shortLiveFrame = Metrics.Exposure(_livePortfolios, OrderDirection.Sell);\n\n            var backtestFrame = longBacktestFrame.Join(shortBacktestFrame)\n                .FillMissing(Direction.Forward)\n                .FillMissing(0.0);\n\n            var liveFrame = longLiveFrame.Join(shortLiveFrame)\n                .FillMissing(Direction.Forward)\n                .FillMissing(0.0);\n\n            longBacktestFrame = Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n            shortBacktestFrame = Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n            longLiveFrame = Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n            shortLiveFrame = Frame.CreateEmpty<DateTime, Tuple<SecurityType, OrderDirection>>();\n\n            foreach (var key in backtestFrame.ColumnKeys)\n            {\n                longBacktestFrame[key] = backtestFrame[key].SelectValues(x => x < 0 ? 0 : x);\n                shortBacktestFrame[key] = backtestFrame[key].SelectValues(x => x > 0 ? 0 : x);\n            }\n\n            foreach (var key in liveFrame.ColumnKeys)\n            {\n                longLiveFrame[key] = liveFrame[key].SelectValues(x => x < 0 ? 0 : x);\n                shortLiveFrame[key] = liveFrame[key].SelectValues(x => x > 0 ? 0 : x);\n            }\n\n            longBacktestFrame = longBacktestFrame.DropSparseColumnsAll();\n            shortBacktestFrame = shortBacktestFrame.DropSparseColumnsAll();\n            longLiveFrame = longLiveFrame.DropSparseColumnsAll();\n            shortLiveFrame = shortLiveFrame.DropSparseColumnsAll();\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var time = backtestFrame.RowKeys.ToList().ToPython();\n                var longSecurities = longBacktestFrame.ColumnKeys.Select(x => x.Item1.ToStringInvariant()).ToList().ToPython();\n                var shortSecurities = shortBacktestFrame.ColumnKeys.Select(x => x.Item1.ToStringInvariant()).ToList().ToPython();\n                var longData = longBacktestFrame.ColumnKeys.Select(x => longBacktestFrame[x].Values.ToList().ToPython()).ToPython();\n                var shortData = shortBacktestFrame.ColumnKeys.Select(x => shortBacktestFrame[x].Values.ToList().ToPython()).ToPython();\n                var liveTime = liveFrame.RowKeys.ToList().ToPython();\n                var liveLongSecurities = longLiveFrame.ColumnKeys.Select(x => x.Item1.ToStringInvariant()).ToList().ToPython();\n                var liveShortSecurities = shortLiveFrame.ColumnKeys.Select(x => x.Item1.ToStringInvariant()).ToList().ToPython();\n                var liveLongData = longLiveFrame.ColumnKeys.Select(x => longLiveFrame[x].Values.ToList().ToPython()).ToPython();\n                var liveShortData = shortLiveFrame.ColumnKeys.Select(x => shortLiveFrame[x].Values.ToList().ToPython()).ToPython();\n\n                base64 = Charting.GetExposure(\n                    time,\n                    longSecurities,\n                    shortSecurities,\n                    longData,\n                    shortData,\n                    liveTime,\n                    liveLongSecurities,\n                    liveShortSecurities,\n                    liveLongData,\n                    liveShortData\n                );\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/IReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nnamespace QuantConnect.Report.ReportElements\n{\n    /// <summary>\n    /// Common interface for template elements of the report\n    /// </summary>\n    internal interface IReportElement\n    {\n        /// <summary>\n        /// Name of this report element\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Template key code.\n        /// </summary>\n        string Key { get; }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        string Render();\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/InformationRatioReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class InformationRatioReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Estimate the information ratio of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public InformationRatioReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var informationRatio = _backtest?.TotalPerformance?.PortfolioStatistics?.InformationRatio;\n            Result = informationRatio;\n            return informationRatio?.ToString(\"F1\") ?? \"-\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/LeverageUtilizationReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class LeverageUtilizationReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n        private List<PointInTimePortfolio> _backtestPortfolios;\n        private List<PointInTimePortfolio> _livePortfolios;\n\n        /// <summary>\n        /// Create a new plot of the leverage utilization\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"backtestPortfolios\">Backtest point in time portfolios</param>\n        /// <param name=\"livePortfolios\">Live point in time portfolios</param>\n        public LeverageUtilizationReportElement(\n            string name,\n            string key,\n            BacktestResult backtest,\n            LiveResult live,\n            List<PointInTimePortfolio> backtestPortfolios,\n            List<PointInTimePortfolio> livePortfolios)\n        {\n            _backtest = backtest;\n            _backtestPortfolios = backtestPortfolios;\n            _live = live;\n            _livePortfolios = livePortfolios;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the leverage utilization plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestSeries = Metrics.LeverageUtilization(_backtestPortfolios).FillMissing(Direction.Forward);\n            var liveSeries = Metrics.LeverageUtilization(_livePortfolios).FillMissing(Direction.Forward);\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                var liveList = new PyList();\n\n                backtestList.Append(backtestSeries.Keys.ToList().ToPython());\n                backtestList.Append(backtestSeries.Values.ToList().ToPython());\n\n                liveList.Append(liveSeries.Keys.ToList().ToPython());\n                liveList.Append(liveSeries.Values.ToList().ToPython());\n\n                base64 = Charting.GetLeverage(backtestList, liveList);\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/MarketsReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class MarketsReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Get the markets of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public MarketsReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var liveOrders = _live?.Orders?.Values.ToList();\n            if (liveOrders == null)\n            {\n                liveOrders = new List<Order>();\n            }\n\n            var orders = new List<Order>();\n            var backtestOrders = _backtest?.Orders?.Values;\n            if (backtestOrders != null)\n            {\n                orders = backtestOrders.ToList();\n            }\n\n            orders = orders.Union(liveOrders).ToList();\n\n            var securityTypes = orders.DistinctBy(o => o.SecurityType).Select(s => s.SecurityType.ToString()).ToList();\n            Result = securityTypes;\n\n            return string.Join(\",\", securityTypes);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/MaxDrawdownRecoveryReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class MaxDrawdownRecoveryReportElement : ReportElement\n    {\n        private LiveResult _liveResult;\n        private BacktestResult _backtestResult;\n\n        /// <summary>\n        /// Estimate the max drawdown of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtestResult\">Backtest result object</param>\n        /// <param name=\"liveResult\">Live result object</param>\n        public MaxDrawdownRecoveryReportElement(string name, string key, BacktestResult backtestResult, LiveResult liveResult)\n        {\n            _liveResult = liveResult;\n            _backtestResult = backtestResult;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            if (_liveResult == null)\n            {\n                var backtestDrawdownRecovery = _backtestResult?.TotalPerformance?.PortfolioStatistics?.DrawdownRecovery;\n                Result = backtestDrawdownRecovery;\n                return backtestDrawdownRecovery?.ToStringInvariant() ?? \"-\";\n            }\n            var equityCurve = new SortedDictionary<DateTime, decimal>(DrawdownCollection.NormalizeResults(_backtestResult, _liveResult)\n                .Observations\n                .ToDictionary(kvp => kvp.Key, kvp => (decimal)kvp.Value));\n\n            var maxDrawdownRecovery = Statistics.Statistics.CalculateDrawdownMetrics(equityCurve).DrawdownRecovery;\n            Result = maxDrawdownRecovery;\n\n            return $\"{maxDrawdownRecovery}\";\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/MaxDrawdownReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class MaxDrawdownReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Estimate the max drawdown of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public MaxDrawdownReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            if (_live == null)\n            {\n                var backtestDrawdown = _backtest?.TotalPerformance?.PortfolioStatistics?.Drawdown;\n                Result = backtestDrawdown;\n                return backtestDrawdown?.ToString(\"P1\") ?? \"-\";\n            }\n\n            var equityCurve = new SortedDictionary<DateTime, decimal>(DrawdownCollection.NormalizeResults(_backtest, _live)\n                .Observations\n                .ToDictionary(kvp => kvp.Key, kvp => (decimal)kvp.Value));\n\n            var maxDrawdown = Statistics.Statistics.CalculateDrawdownMetrics(equityCurve).Drawdown;\n            Result = maxDrawdown;\n\n            return $\"{maxDrawdown:P1}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/MonthlyReturnsReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class MonthlyReturnsReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a monthly returns plot\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public MonthlyReturnsReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the monthly returns plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPoints = ResultsUtil.EquityPoints(_backtest);\n            var livePoints = ResultsUtil.EquityPoints(_live);\n\n            var backtestSeries = new Series<DateTime, double>(backtestPoints.Keys, backtestPoints.Values);\n            var liveSeries = new Series<DateTime, double>(livePoints.Keys, livePoints.Values);\n\n            // Equivalent to python pandas line: `backtestSeries.resample('M').apply(lambda x: x.pct_change().sum())`\n            var backtestMonthlyReturns = backtestSeries.ResampleEquivalence(date => new DateTime(date.Year, date.Month, 1).AddMonths(1).AddDays(-1))\n                .Select(kvp => kvp.Value.TotalReturns());\n\n            var liveMonthlyReturns = liveSeries.ResampleEquivalence(date => new DateTime(date.Year, date.Month, 1).AddMonths(1).AddDays(-1))\n                .Select(kvp => kvp.Value.TotalReturns());\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestResults = new PyDict();\n                foreach (var kvp in backtestMonthlyReturns.GroupBy(kvp => kvp.Key.Year).GetObservations())\n                {\n                    var key = kvp.Key.ToStringInvariant();\n                    var monthlyReturns = kvp.Value * 100;\n\n                    var values = new List<double>();\n                    for (var i = 1; i <= 12; i++)\n                    {\n                        var returns = monthlyReturns.Where(row => row.Key.Month == i);\n                        if (!returns.IsEmpty)\n                        {\n                            values.Add(returns.FirstValue());\n                            continue;\n                        }\n\n                        values.Add(double.NaN);\n                    }\n\n                    backtestResults.SetItem(key.ToPython(), values.ToPython());\n                }\n\n                var liveResults = new PyDict();\n                foreach (var kvp in liveMonthlyReturns.GroupBy(kvp => kvp.Key.Year).GetObservations())\n                {\n                    var key = kvp.Key.ToStringInvariant();\n                    var monthlyReturns = kvp.Value * 100;\n\n                    var values = new List<double>();\n                    for (var i = 1; i <= 12; i++)\n                    {\n                        var returns = monthlyReturns.Where(row => row.Key.Month == i);\n                        if (!returns.IsEmpty)\n                        {\n                            values.Add(returns.FirstValue());\n                            continue;\n                        }\n\n                        values.Add(double.NaN);\n                    }\n\n                    liveResults.SetItem(key.ToPython(), values.ToPython());\n                }\n\n                base64 = Charting.GetMonthlyReturns(backtestResults, liveResults);\n            }\n\n            return base64;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/PSRReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Deedle;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class PSRReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// The number of trading days per year to get better result of statistics\n        /// </summary>\n        private int _tradingDaysPerYear;\n\n        /// <summary>\n        /// Estimate the PSR of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        public PSRReportElement(string name, string key, BacktestResult backtest, LiveResult live, int tradingDaysPerYear)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n            _tradingDaysPerYear = tradingDaysPerYear;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            decimal? psr;\n            if (_live == null)\n            {\n                psr = _backtest?.TotalPerformance?.PortfolioStatistics?.ProbabilisticSharpeRatio;\n                Result = psr;\n                if (psr == null)\n                {\n                    return \"-\";\n                }\n                \n                return $\"{psr:P0}\";\n            }\n\n            var equityCurvePerformance = DrawdownCollection.NormalizeResults(_backtest, _live)\n                .ResampleEquivalence(date => date.Date, s => s.LastValue())\n                .PercentChange();\n\n            if (equityCurvePerformance.IsEmpty || equityCurvePerformance.KeyCount < 180)\n            {\n                return \"-\";\n            }\n\n            var sixMonthsBefore = equityCurvePerformance.LastKey() - TimeSpan.FromDays(180);\n\n            var benchmarkSharpeRatio = 1.0d / Math.Sqrt(_tradingDaysPerYear);\n            psr = Statistics.Statistics.ProbabilisticSharpeRatio(\n                equityCurvePerformance\n                    .Where(kvp => kvp.Key >= sixMonthsBefore)\n                    .Values\n                    .ToList(), \n                benchmarkSharpeRatio)\n                .SafeDecimalCast();\n            \n            Result = psr;\n            return $\"{psr:P0}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/ParametersReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    /// <summary>\n    /// Class for creating a two column table for the Algorithm's Parameters in a report\n    /// </summary>\n    public class ParametersReportElement : ReportElement\n    {\n        private IReadOnlyDictionary<string, string> _parameters;\n        private readonly string _template;\n\n        /// <summary>\n        /// Creates a two column table for the Algorithm's Parameters\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtestConfiguration\">The configuration of the backtest algorithm</param>\n        /// <param name=\"liveConfiguration\">The configuration of the live algorithm</param>\n        /// <param name=\"template\">HTML template to use</param>\n        public ParametersReportElement(string name, string key, AlgorithmConfiguration backtestConfiguration, AlgorithmConfiguration liveConfiguration, string template)\n        {\n            Name = name;\n            Key = key;\n            _template = template;\n\n            if (liveConfiguration != null)\n            {\n                _parameters = liveConfiguration.Parameters;\n            }\n            else if (backtestConfiguration != null)\n            {\n                _parameters = backtestConfiguration.Parameters;\n            }\n            else\n            {\n                // This case only happens for the unit tests, then we just create an empty dictionary\n                _parameters = new Dictionary<string, string>();\n            }\n        }\n\n        /// <summary>\n        /// Generates a HTML two column table for the Algorithm's Parameters\n        /// </summary>\n        /// <returns>Returns a string representing a HTML two column table</returns>\n        public override string Render()\n        {\n            var items = new List<string>();\n            int parameterIndex;\n            var columns = (new Regex(@\"{{\\$KEY(\\d+?)}}\")).Matches(_template).Count;\n\n            for (parameterIndex = 0; parameterIndex < _parameters.Count;)\n            {\n                var template = _template;\n                int column;\n                for (column = 0; column < columns; column++)\n                {\n                    var currTemplateKey = \"{{$KEY\" + column.ToString() + \"}}\";\n                    var currTemplateValue = \"{{$VALUE\" + column.ToString() + \"}}\";\n\n                    if (parameterIndex < _parameters.Count)\n                    {\n                        var parameter = _parameters.ElementAt(parameterIndex);\n                        template = template.Replace(currTemplateKey, parameter.Key);\n                        template = template.Replace(currTemplateValue, parameter.Value);\n                    }\n                    else\n                    {\n                        template = template.Replace(currTemplateKey, string.Empty);\n                        template = template.Replace(currTemplateValue, string.Empty);\n                    }\n\n                    parameterIndex++;\n                }\n\n                if (column == 0)\n                {\n                    parameterIndex++;\n                }\n\n                items.Add(template);\n            }\n\n            if (Key == ReportKey.ParametersPageStyle)\n            {\n                if (items.Count == 0)\n                {\n                    return \"display: none;\";\n                }\n\n                return string.Empty;\n            }\n\n            var parameters= string.Join(\"\\n\", items);\n            return parameters;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/ReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Report.ReportElements\n{\n    /// <summary>\n    /// Common interface for template elements of the report\n    /// </summary>\n    public abstract class ReportElement : IReportElement\n    {\n        /// <summary>\n        /// Name of this report element\n        /// </summary>\n        public virtual string Name { get; protected set; }\n\n        /// <summary>\n        /// Template key code.\n        /// </summary>\n        public virtual string Key { get; protected set; }\n\n        /// <summary>\n        /// Normalizes the key into a JSON-friendly key\n        /// </summary>\n        public string JsonKey => Key.Replace(\"KPI-\", \"\").Replace(\"$\", \"\").Replace(\"{\", \"\").Replace(\"}\", \"\") .ToLowerInvariant();\n\n        /// <summary>\n        /// Result of the render as an object for serialization to JSON\n        /// </summary>\n        public virtual object Result { get; protected set; }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public abstract string Render();\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/ReturnsPerTradeReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class ReturnsPerTradeReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Create a new distribution plot of returns per trade\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public ReturnsPerTradeReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate the returns per trade plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPercentagePerTrade = new List<double>();\n            if (_backtest?.TotalPerformance?.ClosedTrades != null)\n            {\n                foreach (var trade in _backtest.TotalPerformance.ClosedTrades)\n                {\n                    if (trade.EntryPrice == 0m)\n                    {\n                        Log.Error($\"ReturnsPerTradeReportElement.Render(): Encountered entry price of 0 in trade with entry time: {trade.EntryTime:yyyy-MM-dd HH:mm:ss} - Exit time: {trade.ExitTime:yyyy-MM-dd HH::mm:ss}\");\n                        continue;\n                    }\n\n                    var sideMultiplier = trade.Direction == TradeDirection.Long ? 1 : -1;\n                    backtestPercentagePerTrade.Add(sideMultiplier * (Convert.ToDouble(trade.ExitPrice) - Convert.ToDouble(trade.EntryPrice)) / Convert.ToDouble(trade.EntryPrice));\n                }\n            }\n\n            // TODO: LiveResult does not contain a TotalPerformance field, so skip live mode for now\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                // Charting library does not expect values to be in whole percentage values (i.e. not 1% == 1.0, but rather 1% == 0.01),\n                base64 = Charting.GetReturnsPerTrade(backtestPercentagePerTrade.ToPython());\n            }\n\n            return base64;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/RollingPortfolioBetaReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Packets;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.Results;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class RollingPortfolioBetaReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// The number of trading days per year to get better result of statistics\n        /// </summary>\n        private int _tradingDaysPerYear;\n\n        /// <summary>\n        /// Create a new plot of the rolling portfolio beta to equities\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        public RollingPortfolioBetaReportElement(string name, string key, BacktestResult backtest, LiveResult live, int tradingDaysPerYear)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n            _tradingDaysPerYear = tradingDaysPerYear;\n        }\n\n        /// <summary>\n        /// Generate the rolling portfolio beta to equities plot using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPoints = GetReturnSeries(_backtest);\n            var backtestBenchmarkPoints = ResultsUtil.BenchmarkPoints(_backtest);\n            var livePoints = GetReturnSeries(_live);\n            var liveBenchmarkPoints = ResultsUtil.BenchmarkPoints(_live);\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                var liveList = new PyList();\n\n                var backtestRollingBetaSixMonths = Rolling.Beta(backtestPoints, backtestBenchmarkPoints, windowSize: 22 * 6);\n                var backtestRollingBetaTwelveMonths = Rolling.Beta(backtestPoints, backtestBenchmarkPoints, windowSize: _tradingDaysPerYear);\n\n                backtestList.Append(backtestRollingBetaSixMonths.Keys.ToList().ToPython());\n                backtestList.Append(backtestRollingBetaSixMonths.Values.ToList().ToPython());\n                backtestList.Append(backtestRollingBetaTwelveMonths.Keys.ToList().ToPython());\n                backtestList.Append(backtestRollingBetaTwelveMonths.Values.ToList().ToPython());\n\n                var liveRollingBetaSixMonths = Rolling.Beta(livePoints, liveBenchmarkPoints, windowSize: 22 * 6);\n                var liveRollingBetaTwelveMonths = Rolling.Beta(livePoints, liveBenchmarkPoints, windowSize: _tradingDaysPerYear);\n\n                liveList.Append(liveRollingBetaSixMonths.Keys.ToList().ToPython());\n                liveList.Append(liveRollingBetaSixMonths.Values.ToList().ToPython());\n                liveList.Append(liveRollingBetaTwelveMonths.Keys.ToList().ToPython());\n                liveList.Append(liveRollingBetaTwelveMonths.Values.ToList().ToPython());\n\n                base64 = Charting.GetRollingBeta(backtestList, liveList);\n            }\n\n            return base64;\n        }\n\n        private static SortedList<DateTime, double> GetReturnSeries(Result leanResult)\n        {\n            var returnSeries = ResultsUtil.EquityPoints(leanResult, BaseResultsHandler.ReturnKey);\n            if (returnSeries == null || returnSeries.Count == 0)\n            {\n                // for backwards compatibility\n                returnSeries = ResultsUtil.EquityPoints(leanResult, \"Daily Performance\");\n            }\n            return returnSeries;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/RollingSharpeReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Deedle;\nusing Python.Runtime;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class RollingSharpeReportElement : ChartReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// The number of trading days per year to get better result of statistics\n        /// </summary>\n        private int _tradingDaysPerYear;\n\n        /// <summary>\n        /// Create a new plot of the rolling sharpe ratio\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        public RollingSharpeReportElement(string name, string key, BacktestResult backtest, LiveResult live, int tradingDaysPerYear)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n            _tradingDaysPerYear = tradingDaysPerYear;\n        }\n\n        /// <summary>\n        /// Generate the rolling sharpe using the python libraries.\n        /// </summary>\n        public override string Render()\n        {\n            var backtestPoints = ResultsUtil.EquityPoints(_backtest);\n            var livePoints = ResultsUtil.EquityPoints(_live);\n\n            var backtestSeries = new Series<DateTime, double>(backtestPoints);\n            var liveSeries = new Series<DateTime, double>(livePoints);\n\n            var backtestRollingSharpeSixMonths = Rolling.Sharpe(backtestSeries, 6, _tradingDaysPerYear).DropMissing();\n            var backtestRollingSharpeTwelveMonths = Rolling.Sharpe(backtestSeries, 12, _tradingDaysPerYear).DropMissing();\n            var liveRollingSharpeSixMonths = Rolling.Sharpe(liveSeries, 6, _tradingDaysPerYear).DropMissing();\n            var liveRollingSharpeTwelveMonths = Rolling.Sharpe(liveSeries, 12, _tradingDaysPerYear).DropMissing();\n\n            var base64 = \"\";\n            using (Py.GIL())\n            {\n                var backtestList = new PyList();\n                var liveList = new PyList();\n\n                backtestList.Append(backtestRollingSharpeSixMonths.Keys.ToList().ToPython());\n                backtestList.Append(backtestRollingSharpeSixMonths.Values.ToList().ToPython());\n                backtestList.Append(backtestRollingSharpeTwelveMonths.Keys.ToList().ToPython());\n                backtestList.Append(backtestRollingSharpeTwelveMonths.Values.ToList().ToPython());\n\n                liveList.Append(liveRollingSharpeSixMonths.Keys.ToList().ToPython());\n                liveList.Append(liveRollingSharpeSixMonths.Values.ToList().ToPython());\n                liveList.Append(liveRollingSharpeTwelveMonths.Keys.ToList().ToPython());\n                liveList.Append(liveRollingSharpeTwelveMonths.Values.ToList().ToPython());\n\n                base64 = Charting.GetRollingSharpeRatio(backtestList, liveList);\n            }\n\n            return base64;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/RuntimeDaysReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal class RuntimeDaysReportElement : ReportElement\n    {\n        private BacktestResult _backtest;\n        private LiveResult _live;\n\n        /// <summary>\n        /// Create a new metric describing the number of days an algorithm ran for.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public RuntimeDaysReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _backtest = backtest;\n            _live = live;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var result = (Result) _live ?? _backtest;\n            if (result == null)\n            {\n                return \"-\";\n            }\n\n            var equityPoints = ResultsUtil.EquityPoints(result);\n            if (equityPoints.Count == 0)\n            {\n                Result = 0;\n                return \"0\";\n            }\n\n            var days = (equityPoints.Last().Key - equityPoints.First().Key).Days;\n            Result = days;\n\n            return days.ToStringInvariant();\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/SharpeRatioReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing QuantConnect.Packets;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    /// <summary>\n    /// Class for render the Sharpe Ratio statistic for a report\n    /// </summary>\n    public class SharpeRatioReportElement : ReportElement\n    {\n        /// <summary>\n        /// The number of trading days per year to get better result of statistics\n        /// </summary>\n        private double _tradingDaysPerYear;\n\n        /// <summary>\n        /// Live result object\n        /// </summary>\n        protected LiveResult LiveResult { get; }\n\n        /// <summary>\n        /// Backtest result object\n        /// </summary>\n        protected BacktestResult BacktestResult { get; }\n\n        /// <summary>\n        /// Sharpe Ratio from a backtest\n        /// </summary>\n        public virtual decimal? BacktestResultValue => BacktestResult?.TotalPerformance?.PortfolioStatistics?.SharpeRatio;\n\n        /// <summary>\n        /// Estimate the sharpe ratio of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        public SharpeRatioReportElement(string name, string key, BacktestResult backtest, LiveResult live, int tradingDaysPerYear)\n        {\n            LiveResult = live;\n            BacktestResult = backtest;\n            Name = name;\n            Key = key;\n            _tradingDaysPerYear = Convert.ToDouble(tradingDaysPerYear, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            if (LiveResult == null)\n            {\n                Result = BacktestResultValue;\n                return BacktestResultValue?.ToString(\"F1\") ?? \"-\";\n            }\n\n            var equityPoints = ResultsUtil.EquityPoints(LiveResult);\n            var performance = DeedleUtil.PercentChange(new Series<DateTime, double>(equityPoints).ResampleEquivalence(date => date.Date, s => s.LastValue()));\n            if (performance.ValueCount == 0)\n            {\n                return \"-\";\n            }\n\n            var sixMonthsAgo = performance.LastKey().AddDays(-180);\n            var trailingPerformance = performance.Where(series => series.Key >= sixMonthsAgo && series.Key.DayOfWeek != DayOfWeek.Saturday && series.Key.DayOfWeek != DayOfWeek.Sunday)\n                .Values\n                .ToList();\n\n            var annualStandardDeviation = trailingPerformance.Count < 7 ? 0 : GetAnnualStandardDeviation(trailingPerformance, _tradingDaysPerYear);\n            if (annualStandardDeviation <= 0)\n            {\n                return \"-\";\n            }\n\n            var annualPerformance = Statistics.Statistics.AnnualPerformance(trailingPerformance, _tradingDaysPerYear);\n            var liveResultValue = Statistics.Statistics.SharpeRatio(annualPerformance, annualStandardDeviation, 0.0);\n            Result = liveResultValue;\n            return liveResultValue.ToString(\"F2\");\n        }\n\n        /// <summary>\n        /// Get annual standard deviation\n        /// </summary>\n        /// <param name=\"trailingPerformance\">The performance for the last period</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        /// <returns>Annual standard deviation.</returns>\n        public virtual double GetAnnualStandardDeviation(List<double> trailingPerformance, double tradingDaysPerYear)\n        {\n            return Statistics.Statistics.AnnualStandardDeviation(trailingPerformance, tradingDaysPerYear);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/SortinoRatioReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing QuantConnect.Packets;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class SortinoRatioReportElement : SharpeRatioReportElement\n    {\n        /// <summary>\n        /// Sortino ratio from a backtest\n        /// </summary>\n        public override decimal? BacktestResultValue => BacktestResult?.TotalPerformance?.PortfolioStatistics?.SortinoRatio;\n\n        /// <summary>\n        /// Estimate the Sortino ratio of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        public SortinoRatioReportElement(string name, string key, BacktestResult backtest, LiveResult live, int tradingDaysPerYear)\n            : base(name, key, backtest, live, tradingDaysPerYear)\n        {\n        }\n\n        /// <summary>\n        /// Get annual standard deviation\n        /// </summary>\n        /// <param name=\"trailingPerformance\">The performance for the last period</param>\n        /// <param name=\"tradingDaysPerYear\">The number of trading days per year to get better result of statistics</param>\n        /// <returns>Annual downside standard deviation.</returns>\n        public override double GetAnnualStandardDeviation(List<double> trailingPerformance, double tradingDaysPerYear)\n        {\n            return Statistics.Statistics.AnnualDownsideStandardDeviation(trailingPerformance, tradingDaysPerYear);\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/TextReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class TextReportElement : ReportElement\n    {\n        private readonly string _content;\n\n        /// <summary>\n        /// Text place holder report element\n        /// </summary>\n        /// <param name=\"name\">Name of this text field</param>\n        /// <param name=\"key\">Report injection point</param>\n        /// <param name=\"content\">Content for injection</param>\n        public TextReportElement(string name, string key, string content)\n        {\n            Name = name;\n            Key = key;\n            _content = content;\n        }\n\n        /// <summary>\n        /// Render the element contents\n        /// </summary>\n        /// <returns></returns>\n        public override string Render()\n        {\n            return _content;\n        }\n    }\n}"
  },
  {
    "path": "Report/ReportElements/TradesPerDayReportElement.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class TradesPerDayReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Estimate the trades per day of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public TradesPerDayReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// Generate trades per day\n        /// </summary>\n        public override string Render()\n        {\n            var liveOrders = _live?.Orders?.Values.ToList();\n            if (liveOrders == null)\n            {\n                liveOrders = new List<Order>();\n            }\n\n            var orders = _backtest?.Orders?.Values.Concat(liveOrders).OrderBy(x => x.Time);\n            if (orders == null)\n            {\n                return \"-\";\n            }\n\n            if (!orders.Any())\n            {\n                return \"-\";\n            }\n\n            var days = orders.Last().Time\n                .Subtract(orders.First().Time)\n                .TotalDays;\n\n            if (days == 0)\n            {\n                days = 1;\n            }\n\n            var tradesPerDay = orders.Count() / days;\n            Result = tradesPerDay;\n\n            if (tradesPerDay > 9)\n            {\n                return $\"{tradesPerDay:F0}\";\n            }\n\n            return $\"{tradesPerDay:F1}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportElements/TurnoverReportElement.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Report.ReportElements\n{\n    internal sealed class TurnoverReportElement : ReportElement\n    {\n        private LiveResult _live;\n        private BacktestResult _backtest;\n\n        /// <summary>\n        /// Estimate the turnover of the strategy.\n        /// </summary>\n        /// <param name=\"name\">Name of the widget</param>\n        /// <param name=\"key\">Location of injection</param>\n        /// <param name=\"backtest\">Backtest result object</param>\n        /// <param name=\"live\">Live result object</param>\n        public TurnoverReportElement(string name, string key, BacktestResult backtest, LiveResult live)\n        {\n            _live = live;\n            _backtest = backtest;\n            Name = name;\n            Key = key;\n        }\n\n        /// <summary>\n        /// The generated output string to be injected\n        /// </summary>\n        public override string Render()\n        {\n            var turnover = _backtest?.TotalPerformance?.PortfolioStatistics?.PortfolioTurnover;\n            Result = turnover;\n            if (turnover == null)\n            {\n                return \"-\";\n            }\n\n            return $\"{turnover:P0}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Report/ReportKey.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Helper shortcuts for report injection points.\n    /// </summary>\n    internal static class ReportKey\n    {\n        public const string Stylesheet = @\"{{$REPORT-STYLESHEET}}\";\n        public const string StrategyName = @\"{{$TEXT-STRATEGY-NAME}}\";\n        public const string StrategyDescription = @\"{{$TEXT-STRATEGY-DESCRIPTION}}\";\n        public const string StrategyVersion = @\"{{$TEXT-STRATEGY-VERSION}}\";\n        public const string LiveMarker = @\"{{$LIVE-MARKER}}\";\n        public const string ParametersPageStyle = @\"{{$CSS-PARAMETERS-PAGE-STYLE}}\";\n        public const string Parameters = @\"{{$PARAMETERS}}\";\n\n        public const string CAGR = @\"{{$KPI-CAGR}}\";\n        public const string Turnover = @\"{{$KPI-TURNOVER}}\";\n        public const string MaxDrawdown = @\"{{$KPI-DRAWDOWN}}\";\n        public const string MaxDrawdownRecovery = @\"{{$KPI-DRAWDOWN-RECOVERY}}\";\n        public const string KellyEstimate = @\"{{$KPI-KELLY-ESTIMATE}}\";\n        public const string SharpeRatio = @\"{{$KPI-SHARPE}}\";\n        public const string SortinoRatio = @\"{{$KPI-SORTINO}}\";\n        public const string BacktestDays = @\"{{$KPI-BACKTEST-DAYS}}\";\n        public const string DaysLive = @\"{{$KPI-DAYS-LIVE}}\";\n        public const string InformationRatio = @\"{{$KPI-INFORMATION-RATIO}}\";\n        public const string TradesPerDay = @\"{{$KPI-TRADES-PER-DAY}}\";\n        public const string Markets = @\"{{$KPI-MARKETS}}\";\n        public const string PSR = @\"{{$KPI-PSR}}\";\n        public const string StrategyCapacity = @\"{{$KPI-STRATEGY-CAPACITY}}\";\n\n        public const string MonthlyReturns = @\"{{$PLOT-MONTHLY-RETURNS}}\";\n        public const string CumulativeReturns = @\"{{$PLOT-CUMULATIVE-RETURNS}}\";\n        public const string AnnualReturns = @\"{{$PLOT-ANNUAL-RETURNS}}\";\n        public const string ReturnsPerTrade = @\"{{$PLOT-RETURNS-PER-TRADE}}\";\n        public const string AssetAllocation = @\"{{$PLOT-ASSET-ALLOCATION}}\";\n        public const string Drawdown = @\"{{$PLOT-DRAWDOWN}}\";\n        public const string DailyReturns = @\"{{$PLOT-DAILY-RETURNS}}\";\n        public const string RollingBeta = @\"{{$PLOT-BETA}}\";\n        public const string RollingSharpe = @\"{{$PLOT-SHARPE}}\";\n        public const string LeverageUtilization = @\"{{$PLOT-LEVERAGE}}\";\n        public const string Exposure = @\"{{$PLOT-EXPOSURE}}\";\n        public const string CrisisPageStyle = @\"{{$CSS-CRISIS-PAGE-STYLE}}\";\n        public const string CrisisPlots = @\"{{$HTML-CRISIS-PLOTS}}\";\n        public const string CrisisTitle = @\"{{$TEXT-CRISIS-TITLE}}\";\n        public const string CrisisContents = @\"{{$PLOT-CRISIS-CONTENT}}\";\n    }\n}\n"
  },
  {
    "path": "Report/ResultsUtil.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.Results;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Utility methods for dealing with the <see cref=\"Result\"/> objects\n    /// </summary>\n    public static class ResultsUtil\n    {\n        /// <summary>\n        /// Get the points, from the Series name given, in Strategy Equity chart\n        /// </summary>\n        /// <param name=\"result\">Result object to extract the chart points</param>\n        /// <param name=\"seriesName\">Series name from which the points will be extracted. By default is Equity series</param>\n        /// <returns></returns>\n        public static SortedList<DateTime, double> EquityPoints(Result result, string seriesName = null)\n        {\n            var points = new SortedList<DateTime, double>();\n\n            seriesName ??= BaseResultsHandler.EquityKey;\n            if (result == null || result.Charts == null ||\n                !result.Charts.ContainsKey(BaseResultsHandler.StrategyEquityKey) ||\n                result.Charts[BaseResultsHandler.StrategyEquityKey].Series == null ||\n                !result.Charts[BaseResultsHandler.StrategyEquityKey].Series.ContainsKey(seriesName))\n            {\n                return points;\n            }\n\n            var series = result.Charts[BaseResultsHandler.StrategyEquityKey].Series[seriesName];\n            switch (series)\n            {\n                case Series s:\n                    foreach (ChartPoint point in s.Values)\n                    {\n                        points[point.Time] = Convert.ToDouble(point.y);\n                    }\n                    break;\n\n                case CandlestickSeries candlestickSeries:\n                    foreach (Candlestick candlestick in candlestickSeries.Values)\n                    {\n                        points[candlestick.Time] = Convert.ToDouble(candlestick.Close);\n                    }\n                    break;\n            }\n\n            return points;\n        }\n\n        /// <summary>\n        /// Gets the points of the benchmark\n        /// </summary>\n        /// <param name=\"result\">Backtesting or live results</param>\n        /// <returns>Sorted list keyed by date and value</returns>\n        public static SortedList<DateTime, double> BenchmarkPoints(Result result)\n        {\n            var points = new SortedList<DateTime, double>();\n\n            if (result == null || result.Charts == null ||\n                !result.Charts.ContainsKey(BaseResultsHandler.BenchmarkKey) ||\n                result.Charts[BaseResultsHandler.BenchmarkKey].Series == null ||\n                !result.Charts[BaseResultsHandler.BenchmarkKey].Series.ContainsKey(BaseResultsHandler.BenchmarkKey))\n            {\n                return points;\n            }\n\n            if (!result.Charts.ContainsKey(BaseResultsHandler.BenchmarkKey))\n            {\n                return new SortedList<DateTime, double>();\n            }\n            if (!result.Charts[BaseResultsHandler.BenchmarkKey].Series.ContainsKey(BaseResultsHandler.BenchmarkKey))\n            {\n                return new SortedList<DateTime, double>();\n            }\n\n            // Benchmark should be a Series, so we cast the points directly to ChartPoint\n            foreach (ChartPoint point in result.Charts[BaseResultsHandler.BenchmarkKey].Series[BaseResultsHandler.BenchmarkKey].Values)\n            {\n                points[Time.UnixTimeStampToDateTime(point.x)] = Convert.ToDouble(point.y);\n            }\n\n            return points;\n        }\n    }\n}\n"
  },
  {
    "path": "Report/Rolling.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing MathNet.Numerics.Statistics;\nusing System;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Report\n{\n    /// <summary>\n    /// Rolling window functions\n    /// </summary>\n    public static class Rolling\n    {\n        private static readonly IRiskFreeInterestRateModel _interestRateProvider = new InterestRateProvider();\n\n        /// <summary>\n        /// Calculate the rolling beta with the given window size (in days)\n        /// </summary>\n        /// <param name=\"performancePoints\">The performance points you want to measure beta for</param>\n        /// <param name=\"benchmarkPoints\">The benchmark/points you want to calculate beta with</param>\n        /// <param name=\"windowSize\">Days/window to lookback</param>\n        /// <returns>Rolling beta</returns>\n        public static Series<DateTime, double> Beta(SortedList<DateTime, double> performancePoints, SortedList<DateTime, double> benchmarkPoints, int windowSize = 132)\n        {\n            var dailyDictionary = StatisticsBuilder.PreprocessPerformanceValues(performancePoints.Select(x => new KeyValuePair<DateTime, decimal>(x.Key, (decimal)x.Value)));\n            var dailyReturnsSeries = new Series<DateTime, double>(dailyDictionary);\n\n            Series<DateTime, double> benchmarkReturns;\n            if (benchmarkPoints.Count != 0)\n            {\n                var benchmarkReturnsDictionary = StatisticsBuilder.CreateBenchmarkDifferences(benchmarkPoints.Select(x => new KeyValuePair<DateTime, decimal>(x.Key, (decimal)x.Value)), benchmarkPoints.Keys.First(), benchmarkPoints.Keys.Last());\n                benchmarkReturns = new Series<DateTime, double>(benchmarkReturnsDictionary);\n            }\n            else\n            {\n                benchmarkReturns = new Series<DateTime, double>(benchmarkPoints);\n            }\n\n            var returns = Frame.CreateEmpty<DateTime, string>();\n            returns[\"strategy\"] = dailyReturnsSeries;\n            returns = returns.Join(\"benchmark\", benchmarkReturns)\n                .FillMissing(Direction.Forward)\n                .DropSparseRows();\n\n            var correlation = returns\n                .Window(windowSize)\n                .SelectValues(x => Correlation.Pearson(x[\"strategy\"].Values, x[\"benchmark\"].Values));\n\n            var portfolioStandardDeviation = dailyReturnsSeries.Window(windowSize).SelectValues(s => s.StdDev());\n            var benchmarkStandardDeviation = benchmarkReturns.Window(windowSize).SelectValues(s => s.StdDev());\n\n            return (correlation * (portfolioStandardDeviation / benchmarkStandardDeviation))\n                .FillMissing(Direction.Forward)\n                .DropMissing();\n        }\n\n        /// <summary>\n        /// Get the rolling sharpe of the given series with a lookback of <paramref name=\"months\"/>. The risk free rate is adjustable\n        /// </summary>\n        /// <param name=\"equityCurve\">Equity curve to calculate rolling sharpe for</param>\n        /// <param name=\"months\">Number of months to calculate the rolling period for</param>\n        /// <param name=\"tradingDayPerYear\">The number of trading days per year to increase result of Annual statistics</param>\n        /// <returns>Rolling sharpe ratio</returns>\n        public static Series<DateTime, double> Sharpe(Series<DateTime, double> equityCurve, int months, int tradingDayPerYear)\n        {\n            var riskFreeRate = (double)_interestRateProvider.GetAverageRiskFreeRate(equityCurve.Keys);\n            if (equityCurve.IsEmpty)\n            {\n                return equityCurve;\n            }\n\n            var dailyReturns = equityCurve.ResampleEquivalence(date => date.Date, s => s.LastValue())\n                .PercentChange();\n\n            var rollingSharpeData = new List<KeyValuePair<DateTime, double>>();\n            var firstDate = equityCurve.FirstKey();\n\n            foreach (var date in equityCurve.Keys)\n            {\n                var nMonthsAgo = date.AddMonths(-months);\n                if (nMonthsAgo < firstDate)\n                {\n                    continue;\n                }\n\n                var algoPerformanceLookback = dailyReturns.Between(nMonthsAgo, date);\n                rollingSharpeData.Add(\n                    new KeyValuePair<DateTime, double>(\n                        date,\n                        Statistics.Statistics.SharpeRatio(algoPerformanceLookback.Values.ToList(), riskFreeRate, tradingDayPerYear)\n                    )\n                );\n            }\n\n            return new Series<DateTime, double>(rollingSharpeData.Select(kvp => kvp.Key), rollingSharpeData.Select(kvp => kvp.Value));\n        }\n    }\n}\n"
  },
  {
    "path": "Report/config.example.json",
    "content": "﻿{\n  \"data-folder\": \"../../../Data\",\n  \"strategy-name\": \"Foobar\",\n  \"strategy-version\": \"v1.0.0\",\n  \"strategy-description\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum\",\n  \"live-data-source-file\": \"Foobar-live.json\",\n  \"backtest-data-source-file\": \"Foobar.json\",\n  \"report-destination\": \"Foobar.html\",\n\n  \"environment\": \"report\",\n\n  // handlers\n  \"log-handler\": \"QuantConnect.Logging.CompositeLogHandler\",\n  \"messaging-handler\": \"QuantConnect.Messaging.Messaging\",\n  \"job-queue-handler\": \"QuantConnect.Queues.JobQueue\",\n  \"api-handler\": \"QuantConnect.Api.Api\",\n  \"map-file-provider\": \"QuantConnect.Data.Auxiliary.LocalDiskMapFileProvider\",\n  \"factor-file-provider\": \"QuantConnect.Data.Auxiliary.LocalDiskFactorFileProvider\",\n  \"data-provider\": \"QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider\",\n  \"alpha-handler\": \"QuantConnect.Lean.Engine.Alphas.DefaultAlphaHandler\",\n  \"data-channel-provider\": \"DataChannelProvider\",\n\n  \"environments\": {\n\n    // defines the 'backtesting' environment\n    \"report\": {\n      \"live-mode\": false,\n\n      \"setup-handler\": \"QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler\",\n      \"result-handler\": \"QuantConnect.Lean.Engine.Results.BacktestingResultHandler\",\n      \"data-feed-handler\": \"QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed\",\n      \"real-time-handler\": \"QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler\",\n      \"history-provider\": \"QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider\",\n      \"transaction-handler\": \"QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler\"\n    },\n  }\n}\n"
  },
  {
    "path": "Report/css/report.css",
    "content": "body {\n    width: 100%;\n    margin: 0;\n    padding: 0;\n    font-size: 12px;\n    background-color: #666666;\n    box-shadow: #0A0A0A;\n    font-family: \"Roboto\";\n}\n\n.table.qc-table.compact thead > tr {\n    height: 1em;\n}\n\n.page .content .text-center {\n    text-align: center;\n}\n\n.page .content .text-left {\n    text-align: left;\n}\n\n.page .content .text-right {\n    text-align: right;\n}\n\n.page {\n    width: 993px;\n    height: 1405px;\n    overflow: hidden;\n    position: relative;\n    margin: 10px auto;\n    background-color: #fff;\n    page-break-after: always; /* Fixes wkhtmltopdf header bug - https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1524*/\n}\n\n\n.text-h1,\nh1 {\n    font-size: 26px;\n    width: 100%;\n    font-family: 'Inter', Helvetica, Arial, sans-serif !important;\n    font-weight: bold;\n}\n\n.footer {\n    bottom: 0;\n    left: 0;\n    right: 0;\n    height: 80px;\n    position: absolute;\n    color: #222;\n    font-family: 'Inter', Helvetica, Arial, sans-serif;\n    text-align: center;\n    line-height: 50px;\n}\n\n.footer .footer-page {\n    position: absolute;\n    top: 0;\n    right: 0;\n    line-height: 50px;\n    margin-right: 40px;\n}\n\n.footer .footer-id {\n    position: absolute;\n    top: 0;\n    left: 0;\n    line-height: 50px;\n    margin-left: 40px;\n}\n\n.header {\n    position: absolute;\n    left: 0;\n    right: 0;\n    top: 0;\n    height: 120px;\n    padding-left: 40px;\n    padding-right: 40px;\n    color: #222;\n    font-family: 'Inter', Helvetica, Arial, sans-serif;\n}\n\n.header .header-left {\n    float: left;\n}\n\n.header .header-left img {\n    height: 58px;\n    padding-top: 25px;\n}\n\n.header .header-right {\n    margin-top: 40px;\n    line-height: 30px;\n    float: right;\n}\n\n.page .content {\n    position: absolute;\n    left: 40px;\n    right: 40px;\n    top: 80px;\n    bottom: 80px;\n    border-top: 1px solid #222;\n    border-bottom: 1px solid #222;\n    padding-top: 6px;\n}\n\ntable.table {\n    width: 100%;\n}\n\n.table.qc-table {\n    border-spacing: 0;\n    border-collapse: separate;\n    margin-bottom: 0;\n}\n\n    .table.qc-table thead th {\n        padding: 5px;\n        border-top: solid 1px #677080;\n        border-left: solid 1px #677080;\n        border-bottom: solid 1px #677080;\n        color: #ffffff;\n        font-family: 'Inter', Helvetica, Arial, sans-serif;\n        font-weight: bold;\n    }\n\n.table.qc-table thead tr {\n    background-color: #677080;\n}\n\n.table.qc-table thead th:last-child {\n    border-right: solid 1px #677080;\n}\n\n.table.qc-table tbody tr td {\n    border-top: none;\n    border-bottom: solid 1px #e9edf1;\n    border-left: solid 1px #e9edf1;\n    padding: 15px;\n    margin: 0;\n    word-wrap: break-word;\n}\n\n.table.qc-table.compact tbody tr td {\n    padding: 5px;\n}\n\n.table.qc-table tbody tr {\n    background-color: #fff;\n}\n\n.table.qc-table tbody tr:nth-child(odd) {\n    background-color: #f8f9fa;\n}\n\n.table.qc-table tbody tr td:last-child {\n    border-right: solid 1px #e9edf1;\n}\n\n    .table.qc-table a,\n    .table.qc-table span,\n    .table.qc-table div,\n    .table.qc-table p {\n        font-family: 'Inter', Helvetica, Arial, sans-serif;\n        font-weight: bold;\n    }\n\n    .table.qc-table.table-itemized tbody tr td:first-child,\n    .table.qc-table.table-itemized tbody tr td:first-child a,\n    .table.qc-table.table-itemized tbody tr td:first-child span,\n    .table.qc-table.table-itemized tbody tr td:first-child div,\n    .table.qc-table.table-itemized tbody tr td:first-child p {\n        font-family: 'Inter', Helvetica, Arial, sans-serif;\n        font-weight: bold;\n    }\n\n.table.qc-table a,\n.table.qc-table a span,\n.table.qc-table a div,\n.table.qc-table a p {\n    color: #f5ae29;\n}\n\n.table.v-top tr td {\n    vertical-align: top;\n}\n\n.table.col-2 td {\n    width: 50%\n}\n\n.table.col-3 td {\n    width: 33.3%\n}\n\n.table.col-4 td {\n    width: 25%\n}\n\n.table.col-5 td {\n    width: 20%\n}\n\n.no-padding {\n    padding: 0 !important;\n}\n\n.no-margin {\n    margin: 0 !important;\n}\n\n.split-text {\n    -webkit-column-count: 2;\n    -moz-column-count: 2;\n    column-count: 2;\n}\n\n.profile img {\n    max-height: 150px;\n    max-width: 100%;\n    width: auto;\n    display: block;\n    margin: auto auto 12px;\n}\n\n.page .content .text-justify,\n.page .content p {\n    text-align: justify;\n}\n\n@media print {\n    body {\n        background-color: #ffffff;\n    }\n\n    .hide-print {\n        display: none;\n    }\n\n    .page {\n        border: none;\n        margin: 0;\n    }\n}\n\n.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {\n    padding: 6px;\n}\n\n.container-row {\n    width: 100%;\n    display: block;\n}\n\n.container-row > div:last-child {\n    padding-right: 0;\n}\n\n.container-row > div:first-child {\n    padding-left: 0;\n}\n\n#table-summary .fa-times {\n    color: #d9534f;\n}\n\n#author-metadata tr > td:first-child,\n#project-metadata tr > td:first-child {\n    width: 66%;\n}\n\n#project-metadata tr > td:last-child {\n    text-align: center;\n}\n\n#key-statistics tr > td:last-child {\n    text-align: right;\n}\n\n#key-statistics tr > td,\n#key-characteristics tr > td,\ntable.table tr > td {\n    vertical-align: middle;\n}\n\ntable.table.align-top tr > td {\n    vertical-align: top;\n}\n\ntable.table {\n    height: 230px;\n}\n\ntable img {\n    width: 100%;\n    height: 100%;\n    max-height: 225px;\n}\n\n.col-xs-12 table > tbody > tr > td {\n    text-align: center;\n}\n\ntable.table > thead > tr > th {\n    border-bottom: none;\n    font-weight: bold;\n    font-size: 18px;\n    padding-top: 15px;\n    font-family: 'Inter', sans-serif;\n}\n\ntable.table > tbody > tr > td {\n    border-top: none;\n    font-size: 15px;\n    padding-top: 10px;\n    padding-bottom: 10px;\n}\n\ntable#key-characteristics {\n    width: calc(100% - 30px);\n}\n\ntable#key-characteristics > thead > tr > th {\n    font-size: 14px;\n    width: 12.5%;\n    text-align: center;\n}\n\n    table#key-characteristics > thead > tr > th.title {\n        font-size: 18px;\n        width: 25%;\n        text-align: left;\n    }\n\ntable#key-characteristics > tbody > tr {\n    border-bottom: 1px solid #cbd1d4;\n}\n\ntable#key-characteristics > tbody > tr > td {\n    position: relative;\n    text-align: center;\n}\n\n    table#key-characteristics > tbody > tr > td.title {\n        text-align: left;\n    }\n\ntable#key-characteristics > tbody > tr:first-child {\n    border-top: 1px solid #9c9c9c;\n}\n\ntable#key-characteristics > tbody > tr > td > span.markets {\n    background: #8f9ca3;\n    font-size: 11px;\n    color: #fff;\n    padding: 8px 14px;\n    border-radius: 4px;\n}\n\n.col-xs-4:nth-child(2) table#key-characteristics > tbody > tr > td:last-child {\n    text-align: right;\n}\n\ntable#key-characteristics > tbody > tr > td:first-child {\n    border-top: #c3cace;\n}\n\ntable#description-box {\n    word-wrap: break-word;\n    min-height: 225px;\n}\n\n    table#description-box > thead > tr > th > p {\n        color: #f5ae29;\n        font-size: 20px;\n    }\n\n        table#description-box > thead > tr > th > p > span {\n            font-weight: 100;\n        }\n\n        table#description-box > thead > tr > th > p > span {\n            margin-right: 10px;\n            width: 1px;\n            height: 24px;\n            background: #f5ae29;\n        }\n\n.page {\n    width: 1200px;\n    height: 1698px;\n}\n\n    .page .content {\n        top: 80px;\n        left: 110px;\n        right: 110px;\n        border-top: 1px solid #888888;\n        border-bottom: none;\n        padding: 0;\n    }\n\n    .page .header {\n        height: 80px;\n        left: 110px;\n        right: 110px;\n        padding: 0;\n    }\n\n.header .header-left img {\n    width: 230px;\n    height: auto;\n    padding-top: 0;\n    margin-top: 25px;\n}\n\n.header .header-right {\n    font-family: 'Inter', sans-serif;\n    font-weight: bold;\n    margin-top: 40px;\n    line-height: 23px;\n    float: right;\n    font-size: 18px;\n    max-width: 70%;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    overflow: hidden;\n}\n\n.container-row {\n    height: auto;\n    overflow: auto;\n    border-bottom: 1px solid #b8b8b8;\n}\n\n    .container-row.first-row .col-xs-4:last-child {\n        text-align: right;\n    }\n\n        .container-row.first-row .col-xs-4:last-child p {\n            font-family: 'Inter', sans-serif;\n            position: absolute;\n            transform: rotate(-90deg);\n            font-size: 12px;\n        }\n\n            .container-row.first-row .col-xs-4:last-child p:first-child {\n                left: -13px;\n                top: 128px;\n            }\n\n            .container-row.first-row .col-xs-4:last-child p:nth-child(2) {\n                bottom: 36px;\n            }\n\n        .container-row.first-row .col-xs-4:last-child table img {\n            width: calc(100% - 25px);\n        }\n\n    .container-row:empty {\n        border: none;\n    }\n\nspan.checkmark, span.exmark {\n    border-radius: 50%;\n    position: absolute;\n    border: none;\n    top: 10px;\n    right: 36%;\n}\n\n    span.checkmark.half, span.exmark.half {\n        right: 44%;\n    }\n\nspan.checkmark {\n    background-color: #46bd6a;\n    height: 20px;\n    width: 20px;\n}\n\n    span.checkmark:after {\n        content: \"\";\n        position: absolute;\n        left: 8px;\n        top: 3px;\n        width: 5px;\n        height: 10px;\n        border: solid #fff;\n        border-width: 0 1px 1px 0;\n        -webkit-transform: rotate(45deg);\n        -ms-transform: rotate(45deg);\n        transform: rotate(45deg);\n    }\n\nspan.exmark {\n    background-color: #bc4143;\n    color: white;\n    font-size: 12px;\n    padding: 4px 5px;\n    padding-top: 4px;\n    line-height: 1;\n}\n\np#strategy-description {\n    overflow: hidden;\n    max-height: 130px;\n    margin-bottom: 0;\n    word-break: break-word;\n}\n\n.kpi-live {\n    display: none;\n}\n\n@media print {\n    body {\n        margin: 0;\n        box-shadow: 0;\n        padding: 0;\n        background-color: #ffffff;\n    }\n\n    .page {\n        margin: 0;\n    }\n}\n\n#monthly-returns-plot {\n    width: 100% !important;\n}\n\n.page .container-row:last-child {\n\tborder-bottom: 0;\n}"
  },
  {
    "path": "Report/css/report_override.css",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n/*\n    Please define here the CSS changes you would like to apply to the HTML file, namely, (template.html).\n    To apply the changes, please pass the content of this file to Report.cs constructor through its arguments .\n    It's worth to be mentioned, that if you need to modify certain property, write it here with the same\n    name since CSS applies always the last rule defined in the stylesheet and this file will be appended\n    at the bottom of the default CSS template, namely, (report.css). \n*/\n"
  },
  {
    "path": "Report/template.html",
    "content": "<!DOCTYPE html>\n        <html xmlns=\"http://www.w3.org/1999/xhtml\">\n            <head>\n                <meta charset=\"utf-8\"/>\n                <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n                <meta property=\"og:title\" content=\"QuantConnect Backtest Report: \"/>\n                <meta property=\"og:type\" content=\"website\"/>\n                <meta property=\"og:site_name\" content=\"QuantConnect.com\"/>\n                <meta property=\"og:description\" content=\"\"/>\n                <meta property=\"og:url\" content=\"https://www.quantconnect.com/terminal/reports/\"/>\n                <meta property=\"og:image\" content=\"{{$PLOT-CUMULATIVE-RETURNS}}\"/>\n                <meta property=\"og:image\" content=\"{{$PLOT-ANNUAL-RETURNS}}\"/>\n                <meta property=\"og:image\" content=\"{{$PNG-AUTHOR-PHOTO}}\"/>\n                <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css\">\n                <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\">\n                <link href=\"https://fonts.googleapis.com/css2?family=Inter&family=Roboto&display=swap\" rel=\"stylesheet\">\n                <style>\n{{$REPORT-STYLESHEET}}\n                </style>\n            </head>\n            <body>\n            <div class=\"page\">\n                <div class=\"header\">\n                    <div class=\"header-left\">\n                        <img src=\"https://cdn.quantconnect.com/web/i/logo.png\">\n                    </div>\n                    <div class=\"header-right\">Strategy Report: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"content\">\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table id=\"description-box\" class=\"table compact no-margin align-top\">\n                                <thead>\n                                <tr>\n                                    <th>\n                                        <p>\n                                            <span>|</span> Strategy Description\n                                        </p>\n                                    </th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td>\n                                        <p id=\"strategy-description\" class=\"text-justify\">\n                                            {{$TEXT-STRATEGY-DESCRIPTION}}\n                                        </p>\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row first-row\">\n                        <div class=\"col-xs-8\">\n                            <table id=\"key-characteristics\" class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th class=\"title\">Key Statistics</th><th class=\"kpi-live\">Backtest</th><th class=\"kpi-live\">Live</th><th class=\"title\"></th><th class=\"kpi-live\">Backtest</th><th class=\"kpi-live\">Live</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                    <tr>\n                                        <td class=\"title\">Runtime Days</td><td>{{$KPI-BACKTEST-DAYS}}</td><td class=\"kpi-live\">{{$KPI-DAYS-LIVE}}</td>\n                                        <td class=\"title\">Drawdown</td><td>{{$KPI-DRAWDOWN}}</td><td class=\"kpi-live\">{{$KPI-LIVE-DRAWDOWN}}</td>\n                                    </tr>\n                                    <tr>\n                                        <td class=\"title\">Turnover</td><td>{{$KPI-TURNOVER}}</td><td class=\"kpi-live\">{{$KPI-LIVE-TURNOVER}}</td>\n                                        <td class=\"title\">Probabilistic SR</td><td>{{$KPI-PSR}}</td><td class=\"kpi-live\">{{$KPI-LIVE-PSR}}</td>\n                                    </tr>\n                                    <tr>\n                                        <td class=\"title\">CAGR</td><td>{{$KPI-CAGR}}</td><td class=\"kpi-live\">{{$KPI-LIVE-CAGR}}</td>\n                                        <td class=\"title\">{{$LIVE-MARKER}}Sharpe Ratio</td><td>{{$KPI-SHARPE}}</td><td class=\"kpi-live\">{{$KPI-LIVE-SHARPE}}</td>\n                                    </tr>\n                                    <tr>\n                                        <td class=\"title\">Capacity (USD)</td><td>{{$KPI-STRATEGY-CAPACITY}}</td>\n                                        <td class=\"title\">Sortino Ratio</td><td>{{$KPI-SORTINO}}</td><td class=\"kpi-live\">{{$KPI-LIVE-SORTINO}}</td>\n                                    </tr>\n                                    <tr>\n                                        <td class=\"title\">Trades per Day</td><td>{{$KPI-TRADES-PER-DAY}}</td><td class=\"kpi-live\">{{$KPI-LIVE-TRADES-PER-DAY}}</td>\n                                        <td class=\"title\">Information Ratio</td><td>{{$KPI-INFORMATION-RATIO}}</td><td class=\"kpi-live\">{{$KPI-LIVE-INFORMATION-RATIO}}</td>\n                                    </tr>\n                                    <tr>\n                                        <td class=\"title\">Drawdown Recovery</td><td>{{$KPI-DRAWDOWN-RECOVERY}}</td><td class=\"kpi-live\">{{$KPI-LIVE-DRAWDOWN-RECOVERY}}</td>\n                                    </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                        <div class=\"col-xs-4\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Monthly Returns</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img id=\"monthly-returns-plot\" src=\"{{$PLOT-MONTHLY-RETURNS}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Cumulative Returns</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-CUMULATIVE-RETURNS}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-4\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Annual Returns</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding:0;\">\n                                        <img src=\"{{$PLOT-ANNUAL-RETURNS}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                        <div class=\"col-xs-4\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Returns Per Trade</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding:0;\">\n                                        <img src=\"{{$PLOT-RETURNS-PER-TRADE}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                        <div class=\"col-xs-4\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Asset Allocation</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding:0;\">\n                                        <img src=\"{{$PLOT-ASSET-ALLOCATION}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Drawdown</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                    <tr>\n                                        <td style=\"padding: 0;\">\n                                            <img src=\"{{$PLOT-DRAWDOWN}}\">\n                                        </td>\n                                    </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"page\">\n                <div class=\"header\">\n                    <div class=\"header-left\">\n                        <img src=\"https://cdn.quantconnect.com/web/i/logo.png\">\n                    </div>\n                    <div class=\"header-right\">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"content\">\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Daily Returns</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-DAILY-RETURNS}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Rolling Portfolio Beta</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-BETA}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Rolling Sharpe Ratio</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-SHARPE}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Leverage</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-LEVERAGE}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th>Long-Short Exposure</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr>\n                                    <td style=\"padding: 0;\">\n                                        <img src=\"{{$PLOT-EXPOSURE}}\">\n                                    </td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"page\" style=\"{{$CSS-CRISIS-PAGE-STYLE}}\">\n                <div class=\"header\">\n                    <div class=\"header-left\">\n                        <img src=\"https://cdn.quantconnect.com/web/i/logo.png\">\n                    </div>\n                    <div class=\"header-right\">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"content\">\n                    <div class=\"container-row\">\n                        {{$HTML-CRISIS-PLOTS}}\n                    </div>\n                </div>\n            </div>\n\t\t\t<div class=\"page\" id=\"parameters\" style=\"{{$CSS-PARAMETERS-PAGE-STYLE}}\">\n                <div class=\"header\">\n                    <div class=\"header-left\">\n                        <img src=\"https://cdn.quantconnect.com/web/i/logo.png\">\n                    </div>\n                    <div class=\"header-right\">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"content\">\n                    <div class=\"container-row\">\n                        <div class=\"col-xs-12\">\n                            <table id=\"key-characteristics\" class=\"table compact\">\n                                <thead>\n                                <tr>\n                                    <th class=\"title\">Parameters</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                    {{$PARAMETERS}}\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                </div>\n            </div>\n    </body>\n    </html>\n\n<!--crisis\n<div class=\"col-xs-4\">\n    <table class=\"crisis-chart table compact\">\n        <thead>\n        <tr>\n            <th style=\"display: block; height: 75px;\">{{$TEXT-CRISIS-TITLE}}</th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr>\n            <td style=\"padding:0;\">\n                <img src=\"{{$PLOT-CRISIS-CONTENT}}\">\n            </td>\n        </tr>\n        </tbody>\n    </table>\n</div>\ncrisis-->\n\n<!--parameters\n<tr>\n\t<td class = \"title\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"title\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\nparameters-->\n"
  },
  {
    "path": "Research/BasicCSharpQuantBookTemplate.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicCSharpQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Load \\\"../QuantConnect.csx\\\" with all the basic imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// We need to load assemblies at the start in their own cell\\n\",\n    \"#load \\\"../Initialize.csx\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#load \\\"../QuantConnect.csx\\\"\\n\",\n    \"\\n\",\n    \"using QuantConnect;\\n\",\n    \"using QuantConnect.Data;\\n\",\n    \"using QuantConnect.Research;\\n\",\n    \"using QuantConnect.Algorithm;\\n\",\n    \"\\n\",\n    \"var qb = new QuantBook();\\n\",\n    \"\\n\",\n    \"// Selecting asset data\\n\",\n    \"var spy = qb.AddEquity(\\\"SPY\\\");\\n\",\n    \"var eur = qb.AddForex(\\\"EURUSD\\\");\\n\",\n    \"var btc = qb.AddCrypto(\\\"BTCUSD\\\");\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Data Requests\\n\",\n    \"\\n\",\n    \"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.\\n\",\n    \"\\n\",\n    \"For more information, please follow the [link](https://www.quantconnect.com/docs#Historical-Data-Historical-Data-Requests).\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution\\n\",\n    \"var h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily);\\n\",\n    \"Console.WriteLine(string.Join(\\\",\\\", h1.SelectMany(slice => slice.Keys).Distinct()))\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \".NET (C#)\",\n   \"language\": \"C#\",\n   \"name\": \".net-csharp\"\n  },\n  \"language_info\": {\n   \"file_extension\": \".cs\",\n   \"mimetype\": \"text/x-csharp\",\n   \"name\": \"C#\",\n   \"pygments_lexer\": \"csharp\",\n   \"version\": \"9.0\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}"
  },
  {
    "path": "Research/BasicQuantBookTemplate.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Add the references and imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Load in our startup script, required to set runtime for PythonNet\\n\",\n    \"%run ../start.py     # %run start.py # in Dev Container\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Create an instance\\n\",\n    \"qb = QuantBook()\\n\",\n    \"\\n\",\n    \"# Select asset data\\n\",\n    \"spy = qb.AddEquity(\\\"SPY\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Data Requests\\n\",\n    \"\\n\",\n    \"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.\\n\",\n    \"\\n\",\n    \"For more information, please follow the [link](https://www.quantconnect.com/docs#Historical-Data-Historical-Data-Requests).\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"scrolled\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution\\n\",\n    \"h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily)\\n\",\n    \"\\n\",\n    \"# Plot closing prices from \\\"SPY\\\" \\n\",\n    \"h1.loc[\\\"SPY\\\"][\\\"close\\\"].plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Indicators\\n\",\n    \"\\n\",\n    \"We can easily get the indicator of a given symbol with QuantBook. \\n\",\n    \"\\n\",\n    \"For all indicators, please checkout QuantConnect Indicators [Reference Table](https://www.quantconnect.com/docs#Indicators-Reference-Table)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Example with BB, it is a datapoint indicator\\n\",\n    \"# Define the indicator\\n\",\n    \"bb = BollingerBands(30, 2)\\n\",\n    \"\\n\",\n    \"# Gets historical data of indicator\\n\",\n    \"bbdf = qb.Indicator(bb, \\\"SPY\\\", 360, Resolution.Daily).data_frame\\n\",\n    \"\\n\",\n    \"# drop undesired fields\\n\",\n    \"bbdf = bbdf.drop('standarddeviation', 1)\\n\",\n    \"\\n\",\n    \"# Plot\\n\",\n    \"bbdf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.6.8\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n"
  },
  {
    "path": "Research/FutureHistory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Research\n{\n    /// <summary>\n    /// Class to manage information from History Request of Futures\n    /// </summary>\n    public class FutureHistory : DataHistory<Slice>\n    {\n        /// <summary>\n        /// Create a new instance of <see cref=\"FutureHistory\"/>.\n        /// </summary>\n        /// <param name=\"data\"></param>\n        public FutureHistory(IEnumerable<Slice> data)\n            : base(data, new Lazy<PyObject>(() => new PandasConverter().GetDataFrame(data), isThreadSafe: false))\n        {\n        }\n\n        /// <summary>\n        /// Gets all data from the History Request that are written in a pandas.DataFrame\n        /// </summary>\n        [Obsolete(\"Please use the 'DataFrame' property\")]\n        public PyObject GetAllData() => DataFrame;\n\n        /// <summary>\n        /// Gets all expity dates in the future history\n        /// </summary>\n        /// <returns></returns>\n        public PyObject GetExpiryDates()\n        {\n            var expiry = Data.SelectMany(x => x.FuturesChains.SelectMany(y => y.Value.Contracts.Keys.Select(z => z.ID.Date).Distinct()));\n            using (Py.GIL())\n            {\n                return expiry.Distinct().ToList().ToPython();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Research/Initialize.csx",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\n\nvar currentDirectory = Directory.GetCurrentDirectory();\nvar parentDirectory = Directory.GetParent(currentDirectory).FullName;\n\n// If our parent directory contains QC Dlls use it, otherwise default to current working directory\n// In cloud and CLI research cases we expect the parent directory to contain the Dlls; but locally it may be cwd\nvar directoryToLoad = Directory.GetFiles(parentDirectory, \"QuantConnect.*.dll\").Any() ? parentDirectory : currentDirectory;\n\n// Load in all QC dll's from this directory\nConsole.WriteLine($\"Initialize.csx: Loading assemblies from {directoryToLoad}\");\nforeach (var file in Directory.GetFiles(directoryToLoad, \"QuantConnect.*.dll\"))\n{\n    try\n    {\n        Assembly.LoadFrom(file.ToString());\n    }\n    catch (Exception e)\n    {\n        Console.WriteLine($\"File: {file}. Exception: {e}\");\n    }\n}\n"
  },
  {
    "path": "Research/KitchenSinkCSharpQuantBookTemplate.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/KitchenSinkCSharpQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"The following example is ready to be used in our Docker container, reference the readme for more details on setting this up.\\n\",\n    \"\\n\",\n    \"In order to use this notebook locally you will need to make a few small changes:\\n\",\n    \"\\n\",\n    \"1. Either create the notebook in your build folder (`bin/debug`) **or** set working directory of the notebook to it like so in the first cell:\\n\",\n    \"\\n\",\n    \"    ```\\n\",\n    \"    using System.IO\\n\",\n    \"    Directory.SetCurrentDirectory(\\\"PathToLean/Lean/Launcher/bin/Debug/\\\");\\n\",\n    \"    ```\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"2. Load \\\"QuantConnect.csx\\\" instead of \\\"../QuantConnect.csx\\\", this is again because of the Notebook position relative to the build files. \\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Load \\\"Initialize.csx\\\" to load our assemblies into our C# Kernel\\n\",\n    \"- Load \\\"QuantConnect.csx\\\" with all the basic imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// We need to load assemblies at the start in their own cell\\n\",\n    \"#load \\\"../Initialize.csx\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Load in our startup script, this creates our Api Object\\n\",\n    \"#load \\\"../QuantConnect.csx\\\"\\n\",\n    \"\\n\",\n    \"// Load in the namespaces we are going to use\\n\",\n    \"using QuantConnect;\\n\",\n    \"using QuantConnect.Data;\\n\",\n    \"using QuantConnect.Data.Custom;\\n\",\n    \"using QuantConnect.Data.Market;\\n\",\n    \"using QuantConnect.Research;\\n\",\n    \"using QuantConnect.Algorithm;\\n\",\n    \"\\n\",\n    \"var qb = new QuantBook();\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Using the Web API\\n\",\n    \"Our script `QuantConnect.csx` automatically loads an instance of the web API for you to use.**\\n\",\n    \"\\n\",\n    \"Look at Lean's [Api](https://github.com/QuantConnect/Lean/tree/master/Api) class for more functions to interact with the cloud\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### **Note: This will only connect if you have your User ID and Api token in `config.json` \"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Show that our api object is connected to the Web Api\\n\",\n    \"Console.WriteLine(api.Connected);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Get our list of projects from the cloud and print their names\\n\",\n    \"var projectResponse = api.ListProjects();\\n\",\n    \"foreach (var project in projectResponse.Projects) {\\n\",\n    \"    Console.WriteLine(project.Name);\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Selecting Asset Data\\n\",\n    \"Checkout the QuantConnect [docs](https://www.quantconnect.com/docs#Initializing-Algorithms-Selecting-Asset-Data) to learn how to select asset data.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"var spy = qb.AddEquity(\\\"SPY\\\");\\n\",\n    \"var eur = qb.AddForex(\\\"EURUSD\\\");\\n\",\n    \"var btc = qb.AddCrypto(\\\"BTCUSD\\\");\\n\",\n    \"var fxv = qb.AddData<FxcmVolume>(\\\"EURUSD_Vol\\\", Resolution.Hour);\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Data Requests\\n\",\n    \"\\n\",\n    \"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.\\n\",\n    \"\\n\",\n    \"For more information, please follow the [link](https://www.quantconnect.com/docs#Historical-Data-Historical-Data-Requests).\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution\\n\",\n    \"var h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Gets historical data from the subscribed assets, from the last 30 days with daily resolution\\n\",\n    \"var h2 = qb.History(qb.Securities.Keys, TimeSpan.FromDays(360), Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Gets historical data from the subscribed assets, between two dates with daily resolution\\n\",\n    \"var h3 = qb.History(btc.Symbol, new DateTime(2014,1,1), DateTime.Now, Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Only fetchs historical data from a desired symbol\\n\",\n    \"var h4 = qb.History(spy.Symbol, 360, Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Only fetchs historical data from a desired symbol\\n\",\n    \"var h5 = qb.History<QuoteBar>(eur.Symbol, TimeSpan.FromDays(360), Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// Fetchs custom data\\n\",\n    \"var h6 = qb.History<FxcmVolume>(fxv.Symbol, TimeSpan.FromDays(360));\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \".NET (C#)\",\n   \"language\": \"C#\",\n   \"name\": \".net-csharp\"\n  },\n  \"language_info\": {\n   \"file_extension\": \".cs\",\n   \"mimetype\": \"text/x-csharp\",\n   \"name\": \"C#\",\n   \"pygments_lexer\": \"csharp\",\n   \"version\": \"9.0\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}"
  },
  {
    "path": "Research/KitchenSinkQuantBookTemplate.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/KitchenSinkQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"The following example is ready to be used in our Docker container, reference the readme for more details on setting this up.\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"In order to use this notebook locally you will need to make a few small changes:\\n\",\n    \"\\n\",\n    \"1. Either create the notebook in your build folder (`bin/debug`) **or** set working directory of the notebook to it like so in the first cell:\\n\",\n    \"\\n\",\n    \"    ```%cd \\\"PathToLean/Lean/Launcher/bin/Debug/```\\n\",\n    \"\\n\",\n    \"2. Run the following command in another cell to load in QuantConnect libraries:\\n\",\n    \"\\n\",\n    \"    ```%run start.py```\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Add the references and imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Load in our startup script, required to set runtime for PythonNet\\n\",\n    \"%run ../start.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Create an instance of our QuantBook\\n\",\n    \"qb = QuantBook()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Using the Web API\\n\",\n    \"Our script `start.py` automatically loads an instance of the web API for you to use.**\\n\",\n    \"\\n\",\n    \"Look at Lean's [Api](https://github.com/QuantConnect/Lean/tree/master/Api) class for more functions to interact with the cloud\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### **Note: This will only connect if you have your User ID and Api token in `config.json` \\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Show that our api object is connected to the Web Api\\n\",\n    \"print(api.Connected)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Get our list of projects from the cloud and print their names\\n\",\n    \"projectResponse = api.ListProjects()\\n\",\n    \"for project in projectResponse.Projects:\\n\",\n    \"    print(project.Name)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Selecting Asset Data\\n\",\n    \"Checkout the QuantConnect [docs](https://www.quantconnect.com/docs#Initializing-Algorithms-Selecting-Asset-Data) to learn how to select asset data.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"spy = qb.AddEquity(\\\"SPY\\\")\\n\",\n    \"eur = qb.AddForex(\\\"EURUSD\\\")\\n\",\n    \"btc = qb.AddCrypto(\\\"BTCUSD\\\")\\n\",\n    \"fxv = qb.AddData[FxcmVolume](\\\"EURUSD_Vol\\\", Resolution.Hour)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Data Requests\\n\",\n    \"\\n\",\n    \"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.\\n\",\n    \"\\n\",\n    \"For more information, please follow the [link](https://www.quantconnect.com/docs#Historical-Data-Historical-Data-Requests).\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"scrolled\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution\\n\",\n    \"h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Plot closing prices from \\\"SPY\\\" \\n\",\n    \"h1.loc[\\\"SPY\\\"][\\\"close\\\"].plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Gets historical data from the subscribed assets, from the last 30 days with daily resolution\\n\",\n    \"h2 = qb.History(qb.Securities.Keys, datetime(2014,1,1), datetime.now(), Resolution.Daily)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Plot high prices from \\\"EURUSD\\\" \\n\",\n    \"h2.loc[\\\"EURUSD\\\"][\\\"high\\\"].plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Gets historical data from the subscribed assets, between two dates with daily resolution\\n\",\n    \"h3 = qb.History([btc.Symbol], datetime(2014,1,1), datetime.now(), Resolution.Daily)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Plot closing prices from \\\"BTCUSD\\\" \\n\",\n    \"h3.loc[\\\"BTCUSD\\\"][\\\"close\\\"].plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Only fetchs historical data from a desired symbol\\n\",\n    \"# NOTE: This will return empty when ran locally because this data is not included\\n\",\n    \"h4 = qb.History([spy.Symbol], timedelta(360), Resolution.Daily)\\n\",\n    \"# or qb.History([\\\"SPY\\\"], 360, Resolution.Daily)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Only fetchs historical data from a desired symbol\\n\",\n    \"# NOTE: This will return empty when ran locally because this data is not included\\n\",\n    \"h5 = qb.History([eur.Symbol], timedelta(30), Resolution.Daily)\\n\",\n    \"# or qb.History([\\\"EURUSD\\\"], 30, Resolution.Daily)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Options Data Requests\\n\",\n    \"- Select the option data\\n\",\n    \"- Sets the filter, otherwise the default will be used SetFilter(-1, 1, timedelta(0), timedelta(35))\\n\",\n    \"- Get the OptionHistory, an object that has information about the historical options data\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"goog = qb.AddOption(\\\"GOOG\\\")\\n\",\n    \"goog.SetFilter(-2, 2, timedelta(0), timedelta(180))\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"option_history = qb.GetOptionHistory(goog.Symbol, datetime(2015, 12, 24))\\n\",\n    \"print (option_history.GetStrikes())\\n\",\n    \"print (option_history.GetExpiryDates())\\n\",\n    \"h7 = option_history.GetAllData()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Future Data Requests\\n\",\n    \"- Select the future data\\n\",\n    \"- Sets the filter, otherwise the default will be used SetFilter(timedelta(0), timedelta(35))\\n\",\n    \"- Get the FutureHistory, an object that has information about the historical future data\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"scrolled\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"es = qb.AddFuture(\\\"ES\\\")\\n\",\n    \"es.SetFilter(timedelta(0), timedelta(180))\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"future_history = qb.GetFutureHistory(es.Symbol, datetime(2013, 10, 7))\\n\",\n    \"print (future_history.GetExpiryDates())\\n\",\n    \"h7 = future_history.GetAllData()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Get Fundamental Data\\n\",\n    \"\\n\",\n    \"- *GetFundamental([symbol], selector, start_date = datetime(1998,1,1), end_date = datetime.now())*\\n\",\n    \"\\n\",\n    \"We will get a pandas.DataFrame with fundamental data.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"data = qb.GetFundamental([\\\"AAPL\\\",\\\"AIG\\\",\\\"BAC\\\",\\\"GOOG\\\",\\\"IBM\\\"], \\\"ValuationRatios.PERatio\\\")\\n\",\n    \"data\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Indicators\\n\",\n    \"\\n\",\n    \"We can easily get the indicator of a given symbol with QuantBook. \\n\",\n    \"\\n\",\n    \"For all indicators, please checkout QuantConnect Indicators [Reference Table](https://www.quantconnect.com/docs#Indicators-Reference-Table)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Example with BB, it is a datapoint indicator\\n\",\n    \"# Define the indicator\\n\",\n    \"bb = BollingerBands(30, 2)\\n\",\n    \"\\n\",\n    \"# Gets historical data of indicator\\n\",\n    \"bbdf = qb.Indicator(bb, \\\"SPY\\\", 360, Resolution.Daily)\\n\",\n    \"\\n\",\n    \"# drop undesired fields\\n\",\n    \"bbdf = bbdf.drop('standarddeviation', 1)\\n\",\n    \"\\n\",\n    \"# Plot\\n\",\n    \"bbdf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# For EURUSD\\n\",\n    \"bbdf = qb.Indicator(bb, \\\"EURUSD\\\", 360, Resolution.Daily)\\n\",\n    \"bbdf = bbdf.drop('standarddeviation', 1)\\n\",\n    \"bbdf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Example with ADX, it is a bar indicator\\n\",\n    \"adx = AverageDirectionalIndex(\\\"adx\\\", 14)\\n\",\n    \"adxdf = qb.Indicator(adx, \\\"SPY\\\", 360, Resolution.Daily)\\n\",\n    \"adxdf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# For EURUSD\\n\",\n    \"adxdf = qb.Indicator(adx, \\\"EURUSD\\\", 360, Resolution.Daily)\\n\",\n    \"adxdf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Example with ADO, it is a tradebar indicator (requires volume in its calculation)\\n\",\n    \"ado = AccumulationDistributionOscillator(\\\"ado\\\", 5, 30)\\n\",\n    \"adodf = qb.Indicator(ado, \\\"SPY\\\", 360, Resolution.Daily)\\n\",\n    \"adodf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# For EURUSD. \\n\",\n    \"# Uncomment to check that this SHOULD fail, since Forex is data type is not TradeBar.\\n\",\n    \"# adodf = qb.Indicator(ado, \\\"EURUSD\\\", 360, Resolution.Daily)\\n\",\n    \"# adodf.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# SMA cross:\\n\",\n    \"symbol = \\\"EURUSD\\\"\\n\",\n    \"# Get History \\n\",\n    \"hist = qb.History([symbol], 500, Resolution.Daily)\\n\",\n    \"# Get the fast moving average\\n\",\n    \"fast = qb.Indicator(SimpleMovingAverage(50), symbol, 500, Resolution.Daily)\\n\",\n    \"# Get the fast moving average\\n\",\n    \"slow = qb.Indicator(SimpleMovingAverage(200), symbol, 500, Resolution.Daily)\\n\",\n    \"\\n\",\n    \"# Remove undesired columns and rename others \\n\",\n    \"fast = fast.drop('rollingsum', 1).rename(columns={'simplemovingaverage': 'fast'})\\n\",\n    \"slow = slow.drop('rollingsum', 1).rename(columns={'simplemovingaverage': 'slow'})\\n\",\n    \"\\n\",\n    \"# Concatenate the information and plot \\n\",\n    \"df = pd.concat([hist.loc[symbol][\\\"close\\\"], fast, slow], axis=1).dropna(axis=0)\\n\",\n    \"df.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Get indicator defining a lookback period in terms of timedelta\\n\",\n    \"ema1 = qb.Indicator(ExponentialMovingAverage(50), \\\"SPY\\\", timedelta(100), Resolution.Daily)\\n\",\n    \"# Get indicator defining a start and end date\\n\",\n    \"ema2 = qb.Indicator(ExponentialMovingAverage(50), \\\"SPY\\\", datetime(2016,1,1), datetime(2016,10,1), Resolution.Daily)\\n\",\n    \"\\n\",\n    \"ema = pd.concat([ema1, ema2], axis=1)\\n\",\n    \"ema.plot()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"rsi = RelativeStrengthIndex(14)\\n\",\n    \"\\n\",\n    \"# Selects which field we want to use in our indicator (default is Field.Close)\\n\",\n    \"rsihi = qb.Indicator(rsi, \\\"SPY\\\", 360, Resolution.Daily, Field.High)\\n\",\n    \"rsilo = qb.Indicator(rsi, \\\"SPY\\\", 360, Resolution.Daily, Field.Low)\\n\",\n    \"rsihi = rsihi.rename(columns={'relativestrengthindex': 'high'})\\n\",\n    \"rsilo = rsilo.rename(columns={'relativestrengthindex': 'low'})\\n\",\n    \"rsi = pd.concat([rsihi['high'], rsilo['low']], axis=1)\\n\",\n    \"rsi.plot()\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.6.8\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}"
  },
  {
    "path": "Research/OptionHistory.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Research\n{\n    /// <summary>\n    /// Class to manage information from History Request of Options\n    /// </summary>\n    public class OptionHistory : DataHistory<Slice>\n    {\n        /// <summary>\n        /// Create a new instance of <see cref=\"OptionHistory\"/>.\n        /// </summary>\n        /// <param name=\"data\"></param>\n        public OptionHistory(IEnumerable<Slice> data)\n            : base(data, new Lazy<PyObject>(() => new PandasConverter().GetDataFrame(data), isThreadSafe: false))\n        {\n        }\n\n        /// <summary>\n        /// Gets all data from the History Request that are written in a pandas.DataFrame\n        /// </summary>\n        [Obsolete(\"Please use the 'DataFrame' property\")]\n        public PyObject GetAllData() => DataFrame;\n\n        /// <summary>\n        /// Gets all strikes in the option history\n        /// </summary>\n        /// <returns></returns>\n        public PyObject GetStrikes()\n        {\n            var strikes = Data.SelectMany(x => x.OptionChains.SelectMany(y => y.Value.Contracts.Keys.Select(z => (double)z.ID.StrikePrice).Distinct()));\n            using (Py.GIL())\n            {\n                return strikes.Distinct().ToList().ToPython();\n            }\n        }\n\n        /// <summary>\n        /// Gets all expiry dates in the option history\n        /// </summary>\n        /// <returns></returns>\n        public PyObject GetExpiryDates()\n        {\n            var expiry = Data.SelectMany(x => x.OptionChains.SelectMany(y => y.Value.Contracts.Keys.Select(z => z.ID.Date).Distinct()));\n            using (Py.GIL())\n            {\n                return expiry.Distinct().ToList().ToPython();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Research/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Research\")]\n[assembly: AssemblyProduct(\"QuantConnect.Research\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"9561d14a-467e-40ad-928e-ee9f758d7d98\")]"
  },
  {
    "path": "Research/QuantBook.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Packets;\nusing System.Threading.Tasks;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Indicators;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Lean.Engine.RealTime;\n\nnamespace QuantConnect.Research\n{\n    /// <summary>\n    /// Provides access to data for quantitative analysis\n    /// </summary>\n    public class QuantBook : QCAlgorithm\n    {\n        private dynamic _pandas;\n        private IDataCacheProvider _dataCacheProvider;\n        private IDataProvider _dataProvider;\n        private static bool _isPythonNotebook;\n\n        static QuantBook()\n        {\n            //Determine if we are in a Python Notebook\n            try\n            {\n                PythonEngine.Initialize();\n                using (Py.GIL())\n                {\n                    var isPython = PyModule.FromString(Guid.NewGuid().ToString(),\n                        \"try:\\n\" +\n                        \"   import IPython\\n\" +\n                        \"   def IsPythonNotebook():\\n\" +\n                        \"       return (IPython.get_ipython() != None)\\n\" +\n                        \"except:\\n\" +\n                        \"   print('No IPython installed')\\n\" +\n                        \"   def IsPythonNotebook():\\n\" +\n                        \"       return false\\n\").GetAttr(\"IsPythonNotebook\").Invoke();\n                    isPython.TryConvert(out _isPythonNotebook);\n                }\n            }\n            catch\n            {\n                //Default to false\n                _isPythonNotebook = false;\n                Logging.Log.Error(\"QuantBook failed to determine Notebook kernel language\");\n            }\n\n            RecycleMemory();\n\n            Logging.Log.Trace($\"QuantBook started; Is Python: {_isPythonNotebook}\");\n        }\n\n        /// <summary>\n        /// <see cref = \"QuantBook\" /> constructor.\n        /// Provides access to data for quantitative analysis\n        /// </summary>\n        public QuantBook() : base()\n        {\n            try\n            {\n                using (Py.GIL())\n                {\n                    _pandas = Py.Import(\"pandas\");\n                }\n\n                // Issue #4892 : Set start time relative to NY time\n                // when the data is available from the previous day\n                var newYorkTime = DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork);\n                var hourThreshold = Config.GetInt(\"qb-data-hour\", 9);\n\n                // If it is after our hour threshold; then we can use today\n                if (newYorkTime.Hour >= hourThreshold)\n                {\n                    SetStartDate(newYorkTime);\n                }\n                else\n                {\n                    SetStartDate(newYorkTime - TimeSpan.FromDays(1));\n                }\n\n                // Sets PandasConverter\n                SetPandasConverter();\n\n                // Reset our composer; needed for re-creation of QuantBook\n                Composer.Instance.Reset();\n                var composer = Composer.Instance;\n                Config.Reset();\n\n                // Create our handlers with our composer instance\n                var systemHandlers = LeanEngineSystemHandlers.FromConfiguration(composer);\n                // init the API\n                systemHandlers.Initialize();\n                var algorithmHandlers = LeanEngineAlgorithmHandlers.FromConfiguration(composer, researchMode: true);\n\n                var algorithmPacket = new BacktestNodePacket\n                {\n                    UserToken = Globals.UserToken,\n                    UserId = Globals.UserId,\n                    ProjectId = Globals.ProjectId,\n                    OrganizationId = Globals.OrganizationID,\n                    Version = Globals.Version,\n                    DeploymentTarget = Config.GetValue(\"deployment-target\", DeploymentTarget.LocalPlatform)\n                };\n\n                ProjectId = algorithmPacket.ProjectId;\n                systemHandlers.LeanManager.Initialize(systemHandlers,\n                    algorithmHandlers,\n                    algorithmPacket,\n                    new AlgorithmManager(false));\n                systemHandlers.LeanManager.SetAlgorithm(this);\n\n                var realTimeHandler = composer.GetPart<IRealTimeHandler>();\n                var algorithmManager = new AlgorithmManager(false, algorithmPacket);\n                realTimeHandler.Setup(this, algorithmPacket, algorithmHandlers.Results, systemHandlers.Api, algorithmManager.TimeLimit);\n                Schedule.SetEventSchedule(realTimeHandler);\n\n                algorithmHandlers.DataPermissionsManager.Initialize(algorithmPacket);\n\n                algorithmHandlers.ObjectStore.Initialize(algorithmPacket.UserId,\n                    algorithmPacket.ProjectId,\n                    algorithmPacket.UserToken,\n                    new Controls\n                    {\n                        // if <= 0 we disable periodic persistence and make it synchronous\n                        PersistenceIntervalSeconds = -1,\n                        StorageLimit = Config.GetValue(\"storage-limit\", 10737418240L),\n                        StorageFileCount = Config.GetInt(\"storage-file-count\", 10000),\n                        StorageAccess = Config.GetValue(\"storage-permissions\", new Packets.StoragePermissions())\n                    },\n                    AlgorithmMode.Research);\n                SetObjectStore(algorithmHandlers.ObjectStore);\n\n                _dataCacheProvider = new ZipDataCacheProvider(algorithmHandlers.DataProvider);\n                _dataProvider = algorithmHandlers.DataProvider;\n\n                var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n                var registeredTypes = new RegisteredSecurityDataTypesProvider();\n                var securityService = new SecurityService(Portfolio.CashBook,\n                    MarketHoursDatabase,\n                    symbolPropertiesDataBase,\n                    this,\n                    registeredTypes,\n                    new SecurityCacheProvider(Portfolio),\n                    algorithm: this);\n                Securities.SetSecurityService(securityService);\n                SubscriptionManager.SetDataManager(\n                    new DataManager(new NullDataFeed(),\n                        new UniverseSelection(this, securityService, algorithmHandlers.DataPermissionsManager, algorithmHandlers.DataProvider),\n                        this,\n                        TimeKeeper,\n                        MarketHoursDatabase,\n                        false,\n                        registeredTypes,\n                        algorithmHandlers.DataPermissionsManager));\n\n                var mapFileProvider = algorithmHandlers.MapFileProvider;\n                HistoryProvider = new HistoryProviderManager();\n                HistoryProvider.Initialize(\n                    new HistoryProviderInitializeParameters(\n                        algorithmPacket,\n                        null,\n                        algorithmHandlers.DataProvider,\n                        _dataCacheProvider,\n                        mapFileProvider,\n                        algorithmHandlers.FactorFileProvider,\n                        null,\n                        true,\n                        algorithmHandlers.DataPermissionsManager,\n                        ObjectStore,\n                        Settings\n                    )\n                );\n\n                var initParameters = new ChainProviderInitializeParameters(mapFileProvider, HistoryProvider);\n                var optionChainProvider = new BacktestingOptionChainProvider();\n                optionChainProvider.Initialize(initParameters);\n                var futureChainProvider = new BacktestingFutureChainProvider();\n                futureChainProvider.Initialize(initParameters);\n                SetOptionChainProvider(new CachingOptionChainProvider(optionChainProvider));\n                SetFutureChainProvider(new CachingFutureChainProvider(futureChainProvider));\n\n                SetAlgorithmMode(AlgorithmMode.Research);\n                SetDeploymentTarget(algorithmPacket.DeploymentTarget);\n            }\n            catch (Exception exception)\n            {\n                throw new Exception(\"QuantBook.Main(): \" + exception);\n            }\n        }\n\n        /// <summary>\n        /// Python implementation of GetFundamental, get fundamental data for input symbols or tickers\n        /// </summary>\n        /// <param name=\"input\">The symbols or tickers to retrieve fundamental data for</param>\n        /// <param name=\"selector\">Selects a value from the Fundamental data to filter the request output</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>pandas DataFrame</returns>\n        [Obsolete(\"Please use the 'UniverseHistory()' API\")]\n        public PyObject GetFundamental(PyObject input, string selector = null, DateTime? start = null, DateTime? end = null)\n        {\n            //Covert to symbols\n            var symbols = PythonUtil.ConvertToSymbols(input);\n\n            //Fetch the data\n            var fundamentalData = GetAllFundamental(symbols, selector, start, end);\n\n            using (Py.GIL())\n            {\n                var data = new PyDict();\n                foreach (var day in fundamentalData.OrderBy(x => x.Key))\n                {\n                    var orderedValues = day.Value.OrderBy(x => x.Key.ID.ToString()).ToList();\n                    var columns = orderedValues.Select(x => x.Key.ID.ToString());\n                    var values = orderedValues.Select(x => x.Value);\n                    var row = _pandas.Series(values, columns);\n                    data.SetItem(day.Key.ToPython(), row);\n                }\n\n                return _pandas.DataFrame.from_dict(data, orient: \"index\");\n            }\n        }\n\n        /// <summary>\n        /// Get fundamental data from given symbols\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve fundamental data for</param>\n        /// <param name=\"selector\">Selects a value from the Fundamental data to filter the request output</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>Enumerable collection of DataDictionaries, one dictionary for each day there is data</returns>\n        [Obsolete(\"Please use the 'UniverseHistory()' API\")]\n        public IEnumerable<DataDictionary<dynamic>> GetFundamental(IEnumerable<Symbol> symbols, string selector = null, DateTime? start = null, DateTime? end = null)\n        {\n            var data = GetAllFundamental(symbols, selector, start, end);\n\n            foreach (var kvp in data.OrderBy(kvp => kvp.Key))\n            {\n                yield return kvp.Value;\n            }\n        }\n\n        /// <summary>\n        /// Get fundamental data for a given symbol\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve fundamental data for</param>\n        /// <param name=\"selector\">Selects a value from the Fundamental data to filter the request output</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>Enumerable collection of DataDictionaries, one Dictionary for each day there is data.</returns>\n        [Obsolete(\"Please use the 'UniverseHistory()' API\")]\n        public IEnumerable<DataDictionary<dynamic>> GetFundamental(Symbol symbol, string selector = null, DateTime? start = null, DateTime? end = null)\n        {\n            var list = new List<Symbol>\n            {\n                symbol\n            };\n\n            return GetFundamental(list, selector, start, end);\n        }\n\n        /// <summary>\n        /// Get fundamental data for a given set of tickers\n        /// </summary>\n        /// <param name=\"tickers\">The tickers to retrieve fundamental data for</param>\n        /// <param name=\"selector\">Selects a value from the Fundamental data to filter the request output</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>Enumerable collection of DataDictionaries, one dictionary for each day there is data.</returns>\n        [Obsolete(\"Please use the 'UniverseHistory()' API\")]\n        public IEnumerable<DataDictionary<dynamic>> GetFundamental(IEnumerable<string> tickers, string selector = null, DateTime? start = null, DateTime? end = null)\n        {\n            var list = new List<Symbol>();\n            foreach (var ticker in tickers)\n            {\n                list.Add(QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA));\n            }\n\n            return GetFundamental(list, selector, start, end);\n        }\n\n        /// <summary>\n        /// Get fundamental data for a given ticker\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve fundamental data for</param>\n        /// <param name=\"selector\">Selects a value from the Fundamental data to filter the request output</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>Enumerable collection of DataDictionaries, one Dictionary for each day there is data.</returns>\n        [Obsolete(\"Please use the 'UniverseHistory()' API\")]\n        public dynamic GetFundamental(string ticker, string selector = null, DateTime? start = null, DateTime? end = null)\n        {\n            //Check if its Python; PythonNet likes to convert the strings, but for python we want the DataFrame as the return object\n            //So we must route the function call to the Python version.\n            if (_isPythonNotebook)\n            {\n                return GetFundamental(ticker.ToPython(), selector, start, end);\n            }\n\n            var symbol = QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            var list = new List<Symbol>\n            {\n                symbol\n            };\n\n            return GetFundamental(list, selector, start, end);\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"OptionHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical option data for</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"OptionHistory\"/> object that contains historical option data.</returns>\n        public OptionHistory OptionHistory(Symbol symbol, string targetOption, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            symbol = GetOptionSymbolForHistoryRequest(symbol, targetOption, resolution, fillForward);\n\n            return OptionHistory(symbol, start, end, resolution, fillForward, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"OptionHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical option data for</param>\n        /// <param name=\"targetOption\">The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"OptionHistory\"/> object that contains historical option data.</returns>\n        [Obsolete(\"Please use the 'OptionHistory()' API\")]\n        public OptionHistory GetOptionHistory(Symbol symbol, string targetOption, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            return OptionHistory(symbol, targetOption, start, end, resolution, fillForward, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"OptionHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical option data for</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"OptionHistory\"/> object that contains historical option data.</returns>\n        public OptionHistory OptionHistory(Symbol symbol, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            if (!end.HasValue || end.Value == start)\n            {\n                end = start.AddDays(1);\n            }\n\n            // Load a canonical option Symbol if the user provides us with an underlying Symbol\n            symbol = GetOptionSymbolForHistoryRequest(symbol, null, resolution, fillForward);\n\n            IEnumerable<Symbol> symbols;\n            if (symbol.IsCanonical())\n            {\n                // canonical symbol, lets find the contracts\n                var option = Securities[symbol] as Option;\n                if (!Securities.ContainsKey(symbol.Underlying))\n                {\n                    var resolutionToUseForUnderlying = resolution ?? SubscriptionManager.SubscriptionDataConfigService\n                                                           .GetSubscriptionDataConfigs(symbol.Underlying)\n                                                           .Select(x => (Resolution?)x.Resolution)\n                                                           .DefaultIfEmpty(null)\n                                                           .Min();\n                    if (!resolutionToUseForUnderlying.HasValue && UniverseManager.TryGetValue(symbol, out var universe))\n                    {\n                        resolutionToUseForUnderlying = universe.UniverseSettings.Resolution;\n                    }\n\n                    if (symbol.Underlying.SecurityType == SecurityType.Equity)\n                    {\n                        // only add underlying if not present\n                        AddEquity(symbol.Underlying.Value, resolutionToUseForUnderlying, fillForward: fillForward,\n                            extendedMarketHours: extendedMarketHours);\n                    }\n                    else if (symbol.Underlying.SecurityType == SecurityType.Index)\n                    {\n                        // only add underlying if not present\n                        AddIndex(symbol.Underlying.Value, resolutionToUseForUnderlying, fillForward: fillForward);\n                    }\n                    else if (symbol.Underlying.SecurityType == SecurityType.Future && symbol.Underlying.IsCanonical())\n                    {\n                        AddFuture(symbol.Underlying.ID.Symbol, resolutionToUseForUnderlying, fillForward: fillForward,\n                            extendedMarketHours: extendedMarketHours);\n                    }\n                    else if (symbol.Underlying.SecurityType == SecurityType.Future)\n                    {\n                        AddFutureContract(symbol.Underlying, resolutionToUseForUnderlying, fillForward: fillForward,\n                            extendedMarketHours: extendedMarketHours);\n                    }\n                }\n\n                var allSymbols = new HashSet<Symbol>();\n                var optionFilterUniverse = new OptionFilterUniverse(option);\n\n                foreach (var (date, chainData, underlyingData) in GetChainHistory<OptionUniverse>(option, start, end.Value, extendedMarketHours))\n                {\n                    if (underlyingData is not null)\n                    {\n                        optionFilterUniverse.Refresh(chainData, underlyingData, underlyingData.EndTime);\n                        allSymbols.UnionWith(option.ContractFilter.Filter(optionFilterUniverse).Select(x => x.Symbol));\n                    }\n                }\n\n                var distinctSymbols = allSymbols.Distinct().Select(x => new OptionUniverse() { Symbol = x, Time = start });\n                symbols = allSymbols.Concat(new[] { symbol.Underlying });\n            }\n            else\n            {\n                // the symbol is a contract\n                symbols = new List<Symbol> { symbol };\n            }\n\n            return new OptionHistory(History(symbols, start, end.Value, resolution, fillForward, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"OptionHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical option data for</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"OptionHistory\"/> object that contains historical option data.</returns>\n        [Obsolete(\"Please use the 'OptionHistory()' API\")]\n        public OptionHistory GetOptionHistory(Symbol symbol, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            return OptionHistory(symbol, start, end, resolution, fillForward, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"FutureHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical future data for</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"FutureHistory\"/> object that contains historical future data.</returns>\n        public FutureHistory FutureHistory(Symbol symbol, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            if (!end.HasValue || end.Value == start)\n            {\n                end = start.AddDays(1);\n            }\n\n            var allSymbols = new HashSet<Symbol>();\n            if (symbol.IsCanonical())\n            {\n                // canonical symbol, lets find the contracts\n                var future = Securities[symbol] as Future;\n\n                foreach (var (date, chainData, underlyingData) in GetChainHistory<FutureUniverse>(future, start, end.Value, extendedMarketHours))\n                {\n                    allSymbols.UnionWith(future.ContractFilter.Filter(new FutureFilterUniverse(chainData, date)).Select(x => x.Symbol));\n                }\n            }\n            else\n            {\n                // the symbol is a contract\n                allSymbols.Add(symbol);\n            }\n\n            return new FutureHistory(History(allSymbols, start, end.Value, resolution, fillForward, extendedMarketHours));\n        }\n\n        /// <summary>\n        /// Gets <see cref=\"FutureHistory\"/> object for a given symbol, date and resolution\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical future data for</param>\n        /// <param name=\"start\">The history request start time</param>\n        /// <param name=\"end\">The history request end time. Defaults to 1 day if null</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"fillForward\">True to fill forward missing data, false otherwise</param>\n        /// <param name=\"extendedMarketHours\">True to include extended market hours data, false otherwise</param>\n        /// <returns>A <see cref=\"FutureHistory\"/> object that contains historical future data.</returns>\n        [Obsolete(\"Please use the 'FutureHistory()' API\")]\n        public FutureHistory GetFutureHistory(Symbol symbol, DateTime start, DateTime? end = null, Resolution? resolution = null,\n            bool fillForward = true, bool extendedMarketHours = false)\n        {\n            return FutureHistory(symbol, start, end, resolution, fillForward, extendedMarketHours);\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var history = History(new[] { symbol }, period, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IBaseDataBar> indicator, Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var history = History(new[] { symbol }, period, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"periods\">The number of bars to request</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<TradeBar> indicator, Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var history = History(new[] { symbol }, period, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, TimeSpan span, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var history = History(new[] { symbol }, span, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IBaseDataBar> indicator, Symbol symbol, TimeSpan span, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var history = History(new[] { symbol }, span, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"span\">The span over which to retrieve recent historical data</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<TradeBar> indicator, Symbol symbol, TimeSpan span, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var history = History(new[] { symbol }, span, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of an indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IndicatorDataPoint> indicator, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)\n        {\n            var history = History(new[] { symbol }, start, end, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<IBaseDataBar> indicator, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)\n        {\n            var history = History(new[] { symbol }, start, end, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Gets the historical data of a bar indicator for the specified symbol. The exact number of bars will be returned.\n        /// The symbol must exist in the Securities collection.\n        /// </summary>\n        /// <param name=\"indicator\">Indicator</param>\n        /// <param name=\"symbol\">The symbol to retrieve historical data for</param>\n        /// <param name=\"start\">The start time in the algorithm's time zone</param>\n        /// <param name=\"end\">The end time in the algorithm's time zone</param>\n        /// <param name=\"resolution\">The resolution to request</param>\n        /// <param name=\"selector\">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>\n        /// <returns>pandas.DataFrame of historical data of a bar indicator</returns>\n        [Obsolete(\"Please use the 'IndicatorHistory()', pandas dataframe available through '.DataFrame'\")]\n        public PyObject Indicator(IndicatorBase<TradeBar> indicator, Symbol symbol, DateTime start, DateTime end, Resolution? resolution = null, Func<IBaseData, TradeBar> selector = null)\n        {\n            var history = History(new[] { symbol }, start, end, resolution);\n            return IndicatorHistory(indicator, history, selector).DataFrame;\n        }\n\n        /// <summary>\n        /// Will return the universe selection data and will optionally perform selection\n        /// </summary>\n        /// <typeparam name=\"T1\">The universe selection universe data type, for example Fundamentals</typeparam>\n        /// <typeparam name=\"T2\">The selection data type, for example Fundamental</typeparam>\n        /// <param name=\"start\">The start date</param>\n        /// <param name=\"end\">Optionally the end date, will default to today</param>\n        /// <param name=\"func\">Optionally the universe selection function</param>\n        /// <param name=\"dateRule\">Date rule to apply for the history data</param>\n        /// <returns>Enumerable of universe selection data for each date, filtered if the func was provided</returns>\n        public IEnumerable<IEnumerable<T2>> UniverseHistory<T1, T2>(DateTime start, DateTime? end = null, Func<IEnumerable<T2>, IEnumerable<Symbol>> func = null, IDateRule dateRule = null)\n            where T1 : BaseDataCollection\n            where T2 : IBaseData\n        {\n            var universeSymbol = ((BaseDataCollection)typeof(T1).GetBaseDataInstance()).UniverseSymbol();\n\n            var symbols = new[] { universeSymbol };\n            var endDate = end ?? DateTime.UtcNow.Date;\n            var requests = CreateDateRangeHistoryRequests(new[] { universeSymbol }, typeof(T1), start, endDate);\n            var history = GetDataTypedHistory<BaseDataCollection>(requests).Select(x => x.Values.Single());\n\n            HashSet<Symbol> filteredSymbols = null;\n            Func<BaseDataCollection, IEnumerable<T2>> castDataPoint = dataPoint =>\n            {\n                var castedType = dataPoint.Data.OfType<T2>();\n                if (func != null)\n                {\n                    var selection = func(castedType);\n                    if (!ReferenceEquals(selection, Universe.Unchanged))\n                    {\n                        filteredSymbols = selection.ToHashSet();\n                    }\n                    return castedType.Where(x => filteredSymbols == null || filteredSymbols.Contains(x.Symbol));\n                }\n                else\n                {\n                    return castedType;\n                }\n            };\n\n            Func<BaseDataCollection, DateTime> getTime = datapoint => datapoint.EndTime.Date;\n\n\n            return PerformSelection<IEnumerable<T2>, BaseDataCollection>(history, castDataPoint, getTime, start, endDate, dateRule);\n        }\n\n        /// <summary>\n        /// Will return the universe selection data and will optionally perform selection\n        /// </summary>\n        /// <param name=\"universe\">The universe to fetch the data for</param>\n        /// <param name=\"start\">The start date</param>\n        /// <param name=\"end\">Optionally the end date, will default to today</param>\n        /// <param name=\"dateRule\">Date rule to apply for the history data</param>\n        /// <returns>Enumerable of universe selection data for each date, filtered if the func was provided</returns>\n        public IEnumerable<IEnumerable<BaseData>> UniverseHistory(Universe universe, DateTime start, DateTime? end = null, IDateRule dateRule = null)\n        {\n            return RunUniverseSelection(universe, start, end, dateRule);\n        }\n\n        /// <summary>\n        /// Will return the universe selection data and will optionally perform selection\n        /// </summary>\n        /// <param name=\"universe\">The universe to fetch the data for</param>\n        /// <param name=\"start\">The start date</param>\n        /// <param name=\"end\">Optionally the end date, will default to today</param>\n        /// <param name=\"func\">Optionally the universe selection function</param>\n        /// <param name=\"dateRule\">Date rule to apply for the history data</param>\n        /// <param name=\"flatten\">Whether to flatten the resulting data frame.\n        /// For universe data, the each row represents a day of data, and the data is stored in a list in a cell of the data frame.\n        /// If flatten is true, the resulting data frame will contain one row per universe constituent,\n        /// and each property of the constituent will be a column in the data frame.</param>\n        /// <returns>Enumerable of universe selection data for each date, filtered if the func was provided</returns>\n        public PyObject UniverseHistory(PyObject universe, DateTime start, DateTime? end = null, PyObject func = null, IDateRule dateRule = null,\n            bool flatten = false)\n        {\n            if (universe.TryConvert<Universe>(out var convertedUniverse))\n            {\n                if (func != null)\n                {\n                    throw new ArgumentException($\"When providing a universe, the selection func argument isn't supported. Please provider a universe or a type and a func\");\n                }\n                var filteredUniverseSelectionData = RunUniverseSelection(convertedUniverse, start, end, dateRule);\n\n                return GetDataFrame(filteredUniverseSelectionData, flatten);\n            }\n            // for backwards compatibility\n            if (universe.TryConvert<Type>(out var convertedType) && convertedType.IsAssignableTo(typeof(BaseDataCollection)))\n            {\n                var endDate = end ?? DateTime.UtcNow.Date;\n                var universeSymbol = ((BaseDataCollection)convertedType.GetBaseDataInstance()).UniverseSymbol();\n                if (func == null)\n                {\n                    return History(universe, universeSymbol, start, endDate, flatten: flatten);\n                }\n\n                var requests = CreateDateRangeHistoryRequests(new[] { universeSymbol }, convertedType, start, endDate);\n                var history = History(requests);\n\n                return GetDataFrame(GetFilteredSlice(history, func, start, endDate, dateRule), flatten, convertedType);\n            }\n\n            throw new ArgumentException($\"Failed to convert given universe {universe}. Please provider a valid {nameof(Universe)}\");\n        }\n\n        /// <summary>\n        /// Gets Portfolio Statistics from a pandas.DataFrame with equity and benchmark values\n        /// </summary>\n        /// <param name=\"dataFrame\">pandas.DataFrame with the information required to compute the Portfolio statistics</param>\n        /// <returns><see cref=\"PortfolioStatistics\"/> object wrapped in a <see cref=\"PyDict\"/> with the portfolio statistics.</returns>\n        public PyDict GetPortfolioStatistics(PyObject dataFrame)\n        {\n            var dictBenchmark = new SortedDictionary<DateTime, double>();\n            var dictEquity = new SortedDictionary<DateTime, double>();\n            var dictPL = new SortedDictionary<DateTime, double>();\n\n            using (Py.GIL())\n            {\n                var result = new PyDict();\n\n                try\n                {\n                    // Converts the data from pandas.DataFrame into dictionaries keyed by time\n                    var df = ((dynamic)dataFrame).dropna();\n                    dictBenchmark = GetDictionaryFromSeries((PyObject)df[\"benchmark\"]);\n                    dictEquity = GetDictionaryFromSeries((PyObject)df[\"equity\"]);\n                    dictPL = GetDictionaryFromSeries((PyObject)df[\"equity\"].pct_change());\n                }\n                catch (PythonException e)\n                {\n                    result.SetItem(\"Runtime Error\", e.Message.ToPython());\n                    return result;\n                }\n\n                // Convert the double into decimal\n                var equity = new SortedDictionary<DateTime, decimal>(dictEquity.ToDictionary(kvp => kvp.Key, kvp => (decimal)kvp.Value));\n                var profitLoss = new SortedDictionary<DateTime, decimal>(dictPL.ToDictionary(kvp => kvp.Key, kvp => double.IsNaN(kvp.Value) ? 0 : (decimal)kvp.Value));\n\n                // Gets the last value of the day of the benchmark and equity\n                var listBenchmark = CalculateDailyRateOfChange(dictBenchmark);\n                var listPerformance = CalculateDailyRateOfChange(dictEquity);\n\n                // Gets the startting capital\n                var startingCapital = Convert.ToDecimal(dictEquity.FirstOrDefault().Value);\n\n                // call method to set tradingDayPerYear for Algorithm (use: backwards compatibility)\n                BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm: this);\n\n                // Compute portfolio statistics\n                var stats = new PortfolioStatistics(profitLoss, equity, new(), listPerformance, listBenchmark, startingCapital, RiskFreeInterestRateModel,\n                    Settings.TradingDaysPerYear.Value);\n\n                result.SetItem(\"Average Win (%)\", Convert.ToDouble(stats.AverageWinRate * 100).ToPython());\n                result.SetItem(\"Average Loss (%)\", Convert.ToDouble(stats.AverageLossRate * 100).ToPython());\n                result.SetItem(\"Compounding Annual Return (%)\", Convert.ToDouble(stats.CompoundingAnnualReturn * 100m).ToPython());\n                result.SetItem(\"Drawdown (%)\", Convert.ToDouble(stats.Drawdown * 100).ToPython());\n                result.SetItem(\"Expectancy\", Convert.ToDouble(stats.Expectancy).ToPython());\n                result.SetItem(\"Net Profit (%)\", Convert.ToDouble(stats.TotalNetProfit * 100).ToPython());\n                result.SetItem(\"Sharpe Ratio\", Convert.ToDouble(stats.SharpeRatio).ToPython());\n                result.SetItem(\"Win Rate (%)\", Convert.ToDouble(stats.WinRate * 100).ToPython());\n                result.SetItem(\"Loss Rate (%)\", Convert.ToDouble(stats.LossRate * 100).ToPython());\n                result.SetItem(\"Profit-Loss Ratio\", Convert.ToDouble(stats.ProfitLossRatio).ToPython());\n                result.SetItem(\"Alpha\", Convert.ToDouble(stats.Alpha).ToPython());\n                result.SetItem(\"Beta\", Convert.ToDouble(stats.Beta).ToPython());\n                result.SetItem(\"Annual Standard Deviation\", Convert.ToDouble(stats.AnnualStandardDeviation).ToPython());\n                result.SetItem(\"Annual Variance\", Convert.ToDouble(stats.AnnualVariance).ToPython());\n                result.SetItem(\"Information Ratio\", Convert.ToDouble(stats.InformationRatio).ToPython());\n                result.SetItem(\"Tracking Error\", Convert.ToDouble(stats.TrackingError).ToPython());\n                result.SetItem(\"Treynor Ratio\", Convert.ToDouble(stats.TreynorRatio).ToPython());\n\n                return result;\n            }\n        }\n\n        /// <summary>\n        /// Get's the universe data for the specified date\n        /// </summary>\n        private IEnumerable<T> GetChainHistory<T>(Symbol canonicalSymbol, DateTime date, out BaseData underlyingData)\n            where T : BaseChainUniverseData\n        {\n            // Use this GetEntry extension method since it's data type dependent, so we get the correct entry for the option universe\n            var marketHoursEntry = MarketHoursDatabase.GetEntry(canonicalSymbol, new[] { typeof(T) });\n            var startInExchangeTz = QuantConnect.Time.GetStartTimeForTradeBars(marketHoursEntry.ExchangeHours, date, QuantConnect.Time.OneDay, 1,\n                extendedMarketHours: false, marketHoursEntry.DataTimeZone);\n            var start = startInExchangeTz.ConvertTo(marketHoursEntry.ExchangeHours.TimeZone, TimeZone);\n            var end = date.ConvertTo(marketHoursEntry.ExchangeHours.TimeZone, TimeZone);\n            var universeData = History<T>(canonicalSymbol, start, end).SingleOrDefault();\n\n            if (universeData is not null)\n            {\n                underlyingData = universeData.Underlying;\n                return universeData.Data.Cast<T>();\n            }\n\n            underlyingData = null;\n            return Enumerable.Empty<T>();\n        }\n\n        /// <summary>\n        /// Helper method to get option/future chain historical data for a given date range\n        /// </summary>\n        private IEnumerable<(DateTime Date, IEnumerable<T> ChainData, BaseData UnderlyingData)> GetChainHistory<T>(\n            Security security, DateTime start, DateTime end, bool extendedMarketHours)\n            where T : BaseChainUniverseData\n        {\n            foreach (var date in QuantConnect.Time.EachTradeableDay(security, start.Date, end.Date, extendedMarketHours))\n            {\n                var universeData = GetChainHistory<T>(security.Symbol, date, out var underlyingData);\n                yield return (date, universeData, underlyingData);\n            }\n        }\n\n        /// <summary>\n        /// Helper method to perform selection on the given data and filter it\n        /// </summary>\n        private IEnumerable<Slice> GetFilteredSlice(IEnumerable<Slice> history, dynamic func, DateTime start, DateTime end, IDateRule dateRule = null)\n        {\n            HashSet<Symbol> filteredSymbols = null;\n            Func<Slice, Slice> processSlice = slice =>\n            {\n                var filteredData = slice.AllData.OfType<BaseDataCollection>();\n                using (Py.GIL())\n                {\n                    using PyObject selection = func(filteredData.SelectMany(baseData => baseData.Data));\n                    if (!selection.TryConvert<object>(out var result) || !ReferenceEquals(result, Universe.Unchanged))\n                    {\n                        filteredSymbols = ((Symbol[])selection.AsManagedObject(typeof(Symbol[]))).ToHashSet();\n                    }\n                }\n                return new Slice(slice.Time, filteredData.Where(x =>\n                {\n                    if (filteredSymbols == null)\n                    {\n                        return true;\n                    }\n                    x.Data = new List<BaseData>(x.Data.Where(dataPoint => filteredSymbols.Contains(dataPoint.Symbol)));\n                    return true;\n                }), slice.UtcTime);\n            };\n\n            Func<Slice, DateTime> getTime = slice => slice.Time.Date;\n            return PerformSelection<Slice, Slice>(history, processSlice, getTime, start, end, dateRule);\n        }\n\n        /// <summary>\n        /// Helper method to perform selection on the given data and filter it using the given universe\n        /// </summary>\n        private IEnumerable<BaseDataCollection> RunUniverseSelection(Universe universe, DateTime start, DateTime? end = null, IDateRule dateRule = null)\n        {\n            var endDate = end ?? DateTime.UtcNow.Date;\n            var history = History(universe, start, endDate);\n\n            HashSet<Symbol> filteredSymbols = null;\n            Func<BaseDataCollection, BaseDataCollection> processDataPoint = dataPoint =>\n            {\n                var utcTime = dataPoint.EndTime.ConvertToUtc(universe.Configuration.ExchangeTimeZone);\n                var selection = universe.SelectSymbols(utcTime, dataPoint);\n                if (!ReferenceEquals(selection, Universe.Unchanged))\n                {\n                    filteredSymbols = selection.ToHashSet();\n                }\n                dataPoint.Data = dataPoint.Data.Where(x => filteredSymbols == null || filteredSymbols.Contains(x.Symbol)).ToList();\n                return dataPoint;\n            };\n\n            Func<BaseDataCollection, DateTime> getTime = dataPoint => dataPoint.EndTime.Date;\n\n            return PerformSelection<BaseDataCollection, BaseDataCollection>(history, processDataPoint, getTime, start, endDate, dateRule);\n        }\n\n        /// <summary>\n        /// Converts a pandas.Series into a <see cref=\"SortedDictionary{DateTime, Double}\"/>\n        /// </summary>\n        /// <param name=\"series\">pandas.Series to be converted</param>\n        /// <returns><see cref=\"SortedDictionary{DateTime, Double}\"/> with pandas.Series information</returns>\n        private SortedDictionary<DateTime, double> GetDictionaryFromSeries(PyObject series)\n        {\n            var dictionary = new SortedDictionary<DateTime, double>();\n\n            var pyDict = new PyDict(((dynamic)series).to_dict());\n            foreach (PyObject item in pyDict.Items())\n            {\n                var key = (DateTime)item[0].AsManagedObject(typeof(DateTime));\n                var value = (double)item[1].AsManagedObject(typeof(double));\n                dictionary.Add(key, value);\n            }\n\n            return dictionary;\n        }\n\n        /// <summary>\n        /// Calculates the daily rate of change\n        /// </summary>\n        /// <param name=\"dictionary\"><see cref=\"IDictionary{DateTime, Double}\"/> with prices keyed by time</param>\n        /// <returns><see cref=\"List{Double}\"/> with daily rate of change</returns>\n        private List<double> CalculateDailyRateOfChange(IDictionary<DateTime, double> dictionary)\n        {\n            var daily = dictionary.GroupBy(kvp => kvp.Key.Date)\n                .ToDictionary(x => x.Key, v => v.LastOrDefault().Value)\n                .Values.ToArray();\n\n            var rocp = new double[daily.Length];\n            for (var i = 1; i < daily.Length; i++)\n            {\n                rocp[i] = (daily[i] - daily[i - 1]) / daily[i - 1];\n            }\n            rocp[0] = 0;\n\n            return rocp.ToList();\n        }\n\n        /// <summary>\n        /// Gets a value of a property\n        /// </summary>\n        /// <param name=\"baseData\">Object with the desired property</param>\n        /// <param name=\"fullName\">Property name</param>\n        /// <returns>Property value</returns>\n        private object GetPropertyValue(object baseData, string fullName)\n        {\n            foreach (var name in fullName.Split('.'))\n            {\n                if (baseData == null) return null;\n\n                // TODO this is expensive and can be cached\n                var info = baseData.GetType().GetProperty(name);\n\n                baseData = info?.GetValue(baseData, null);\n            }\n\n            return baseData;\n        }\n\n        /// <summary>\n        /// Get all fundamental data for given symbols\n        /// </summary>\n        /// <param name=\"symbols\">The symbols to retrieve fundamental data for</param>\n        /// <param name=\"start\">The start date of selected data</param>\n        /// <param name=\"end\">The end date of selected data</param>\n        /// <returns>DataDictionary of Enumerable IBaseData</returns>\n        private Dictionary<DateTime, DataDictionary<dynamic>> GetAllFundamental(IEnumerable<Symbol> symbols, string selector, DateTime? start = null, DateTime? end = null)\n        {\n            //SubscriptionRequest does not except nullable DateTimes, so set a startTime and endTime\n            var startTime = start.HasValue ? (DateTime)start : QuantConnect.Time.Start;\n            var endTime = end.HasValue ? (DateTime)end : DateTime.UtcNow.Date;\n\n            //Collection to store our results\n            var data = new Dictionary<DateTime, DataDictionary<dynamic>>();\n\n            //Get all data for each symbol and fill our dictionary\n            foreach (var symbol in symbols)\n            {\n                var exchangeHours = MarketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n                foreach (var date in QuantConnect.Time.EachTradeableDayInTimeZone(exchangeHours, startTime, endTime, TimeZones.NewYork))\n                {\n                    var currentData = new Fundamental(date, symbol);\n                    var time = currentData.EndTime;\n                    object dataPoint = currentData;\n                    if (!string.IsNullOrWhiteSpace(selector))\n                    {\n                        dataPoint = GetPropertyValue(currentData, selector);\n                        if (BaseFundamentalDataProvider.IsNone(dataPoint))\n                        {\n                            dataPoint = null;\n                        }\n                    }\n\n                    if (!data.TryGetValue(time, out var dataAtTime))\n                    {\n                        dataAtTime = data[time] = new DataDictionary<dynamic>(time);\n                    }\n                    dataAtTime.Add(currentData.Symbol, dataPoint);\n                }\n            }\n            return data;\n        }\n\n        private Symbol GetOptionSymbolForHistoryRequest(Symbol symbol, string targetOption, Resolution? resolution, bool fillForward)\n        {\n            // Load a canonical option Symbol if the user provides us with an underlying Symbol\n            if (!symbol.SecurityType.IsOption())\n            {\n                var option = AddOption(symbol, targetOption, resolution, symbol.ID.Market, fillForward);\n\n                // Allow 20 strikes from the money for futures. No expiry filter is applied\n                // so that any future contract provided will have data returned.\n                if (symbol.SecurityType == SecurityType.Future && symbol.IsCanonical())\n                {\n                    throw new ArgumentException(\"The Future Symbol provided is a canonical Symbol (i.e. a Symbol representing all Futures), which is not supported at this time. \" +\n                        \"If you are using the Symbol accessible from `AddFuture(...)`, use the Symbol from `AddFutureContract(...)` instead. \" +\n                        \"You can use `qb.FutureOptionChainProvider(canonicalFuture, datetime)` to get a list of futures contracts for a given date, and add them to your algorithm with `AddFutureContract(symbol, Resolution)`.\");\n                }\n                if (symbol.SecurityType == SecurityType.Future && !symbol.IsCanonical())\n                {\n                    option.SetFilter(universe => universe.Strikes(-10, +10));\n                }\n\n                symbol = option.Symbol;\n            }\n\n            return symbol;\n        }\n\n        private static void RecycleMemory()\n        {\n            Task.Delay(TimeSpan.FromSeconds(20)).ContinueWith(_ =>\n            {\n                if (Logging.Log.DebuggingEnabled)\n                {\n                    Logging.Log.Debug($\"QuantBook.RecycleMemory(): running...\");\n                }\n\n                GC.Collect();\n\n                RecycleMemory();\n            }, TaskScheduler.Current);\n        }\n\n        protected static IEnumerable<T1> PerformSelection<T1, T2>(\n            IEnumerable<T2> history,\n            Func<T2, T1> processDataPointFunction,\n            Func<T2, DateTime> getTime,\n            DateTime start,\n            DateTime endDate,\n            IDateRule dateRule = null)\n        {\n            if (dateRule == null)\n            {\n                foreach (var dataPoint in history)\n                {\n                    yield return processDataPointFunction(dataPoint);\n                }\n\n                yield break;\n            }\n\n            var targetDatesQueue = new Queue<DateTime>(dateRule.GetDates(start, endDate));\n            T2 previousDataPoint = default;\n            foreach (var dataPoint in history)\n            {\n                var dataPointWasProcessed = false;\n\n                // If the datapoint date is greater than the target date on the top, process the last\n                // datapoint and remove target dates from the queue until the target date on the top is\n                // greater than the current datapoint date\n                while (targetDatesQueue.TryPeek(out var targetDate) && getTime(dataPoint) >= targetDate)\n                {\n                    if (getTime(dataPoint) == targetDate)\n                    {\n                        yield return processDataPointFunction(dataPoint);\n\n                        // We use each data point just once, this is, we cannot return the same datapoint\n                        // twice\n                        dataPointWasProcessed = true;\n                    }\n                    else\n                    {\n                        if (!Equals(previousDataPoint, default(T2)))\n                        {\n                            yield return processDataPointFunction(previousDataPoint);\n                        }\n                    }\n\n                    previousDataPoint = default;\n                    // Search the next target date\n                    targetDatesQueue.Dequeue();\n                }\n\n                if (!dataPointWasProcessed)\n                {\n                    previousDataPoint = dataPoint;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Research/QuantConnect.Research.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Research</RootNamespace>\n    <AssemblyName>QuantConnect.Research</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: Research Project - Core implementation for jupyter research environment</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Plotly.NET\" Version=\"5.1.0\" />\n    <PackageReference Include=\"Plotly.NET.CSharp\" Version=\"0.13.0\" />\n    <PackageReference Include=\"Plotly.NET.Interactive\" Version=\"5.0.0\" />\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm.Framework\\QuantConnect.Algorithm.Framework.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Queues\\QuantConnect.Queues.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"BasicCSharpQuantBookTemplate.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"BasicQuantBookTemplate.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Initialize.csx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"QuantConnect.csx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"readme.md\" />\n    <Content Include=\"start.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n      <PackageCopyToOutput>true</PackageCopyToOutput>\n    </Content>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Research/QuantConnect.csx",
    "content": "#r \"Python.Runtime.dll\"\n#r \"QuantConnect.Algorithm.dll\"\n#r \"QuantConnect.Algorithm.Framework.dll\"\n#r \"QuantConnect.Common.dll\"\n#r \"QuantConnect.Indicators.dll\"\n#r \"QuantConnect.Research.dll\"\n#r \"NodaTime.dll\"\n#r \"Accord.dll\"\n#r \"Accord.Fuzzy.dll\"\n#r \"Accord.Math.Core.dll\"\n#r \"Accord.Math.dll\"\n#r \"MathNet.Numerics.dll\"\n#r \"Newtonsoft.Json.dll\"\n#r \"QuantConnect.AlgorithmFactory.dll\"\n#r \"QuantConnect.Logging.dll\"\n#r \"QuantConnect.Messaging.dll\"\n#r \"QuantConnect.Configuration.dll\"\n#r \"QuantConnect.Lean.Engine.dll\"\n#r \"QuantConnect.Algorithm.CSharp.dll\"\n#r \"QuantConnect.Api.dll\"\n// Note: #r directives must be in the beggining of the file\n\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n/*\n * This C# Script File (.csx) can be loaded in a notebook (ipynb file)\n * in order to reference QuantConnect assemblies\n * https://github.com/scriptcs/scriptcs/wiki/Writing-a-script#referencing-assemblies\n *\n * Usage:\n * #load \"QuantConnect.csx\"\n*/\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Globalization;\nusing QuantConnect;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Api;\nusing QuantConnect.Parameters;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Indicators;\nusing QuantConnect.Research;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Custom;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Notifications;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Interfaces;\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine;\n\nConfig.Reset();\nInitializer.Start();\nApi api = (Api)Initializer.GetSystemHandlers().Api;\nvar algorithmHandlers = Initializer.GetAlgorithmHandlers(researchMode: true);\n"
  },
  {
    "path": "Research/docker.cfg",
    "content": "IMAGE=quantconnect/research:latest\nDATA_DIR=\nNOTEBOOK_DIR=\nUPDATE=Y\n"
  },
  {
    "path": "Research/readme.md",
    "content": "﻿QuantConnect Research Project\n=============\nCurrently we have a few ways to use QuantConnect research notebooks:\n- Lean CLI (Recommended)\n- Install locally and run directly on your OS.\n\nThis document will cover the setup, getting started, and known issues.\n\n<br>\n\n# Setup\nBelow we cover how to get setup with our two options listed above. \n\n<br>\n\n## Research with Lean CLI (Recommended)\n\nOur research docker image has been integrated with Lean CLI to streamline the process and allow user to use their cloud and local projects in the research environment. Please refer to Lean CLI documentation [here](https://www.quantconnect.com/docs/v2/lean-cli/getting-started/lean-cli) on how to get started.\n\nLean CLI research specific documentation is found [here](https://www.quantconnect.com/docs/v2/lean-cli/tutorials/research).\n\nWe highly recommend using Lean CLI with docker for research but below in [Running Jupyter Locally](#running-jupyter-locally) we cover how to install and prepare the environment on your personal desktop. \n\n<br>\n\n## Running Jupyter Locally \nNote: we recommend using the above approach with our Docker container, where the setup and environment is tested and stable.\n\nBefore we enable Jupyter support, follow [Lean installation](https://github.com/QuantConnect/Lean#installation-instructions)\nand [Python installation](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#quantconnect-python-algorithm-project) to get LEAN running Python algorithms on your machine. Then be sure to build Lean at least once before the following. \n\n**1. Installation:**\n   1. Install [JupyterLab](https://pypi.org/project/jupyterlab/):\n```\n    pip install jupyterlab\n```\n 2.  Install [QuantConnect Python API](https://pypi.python.org/pypi/quantconnect/0.1)\n ```\n    pip install quantconnect\n```\n 3.  Install [pythonnet/clr-loader](https://github.com/pythonnet/clr-loader)\n ```\n    pip install clr-loader\n```\n**2. Run Jupyter:**\n   1. Run Jupyter from the command line\n```\n    cd Lean/Launcher/bin/Debug\n    jupyter lab\n```\n<br>\n\n# Getting Started with Research\n\n## C# Notebook\nWhen using C# for research notebooks it requires that you load our setup script CSX file `Initialize.csx` into your notebook. This will load our QuantConnect libraries into your C# Kernel. In both docker setups, the file is one directory above the notebooks dir. Be sure to use the following line in your first cell to load in this csx file:\n\n`#load \"../Initialize.csx\"`\n\nAfter this the environment is ready to use; take a look at our reference notebook `KitchenSinkCSharpQuantBookTemplate.ipynb` for an example of how to use our `QuantBook` interface!\n\nNote: All Lean namespaces you want to use in your notebook need to be directly added via `using` statements.\n\n<br>\n\n## Python Notebook\nWith Python we have a setup script that will automatically load QuantBooks libraries into the Python kernel so there is no need to import them. In our docker image the script should run automatically, but locally you will need to call `%run \"start.py\"` in the first cell.\n\nYou notebook is ready to use; take a look at our reference notebook `KitchenSinkQuantBookTemplate.ipynb` for an example of how to use our `QuantBook` interface!\n\n<br>\n\n## Using the Web Api from Notebook\nBoth of our setup scripts for Python & C# include a instantiated `Api` object under the variable name `api`. Before you can use this api object to interact with the cloud you must edit your config in the **root** of your Notebook directory. Once this has been done once, it does not need to be done again.\n\nIn `config.json` add the following entries with your respective values\n```\njob-user-id: 12345, // Your id here\napi-access-token: \"token13432\", // Your api token here\n```\n\nOnce this has been done, you may restart your kernel and begin to use the `api` variable. \nReference our examples mentioned above for practical uses of this object.\n\n<br>\n\n## Shutting Down the Notebook Lab\nWhen you are done with the research environment be sure to stop the container with **Docker Dashboard** or via **Docker CLI**.\n\n<br>\n\n\n## Build a new image\nFor most users this will not be necessary, simply use `docker pull quantconnect/research` to get the latest image.\n\n`docker build -t quantconnect/research - < DockerfileJupyter` will build a new docker image using the latest version of lean. To build from particular tag of lean a build arg can be provided, for example `--build-arg LEAN_TAG=8631`.\n\n<br>\n\n\n# Known Issues\n- Python research is extremely dependent on the `start.py` script as it is responsible for assigning core clr as the runtime for PythonNet and clr-loader to use for C# library. For local use where the script is not launched automatically by Jupyter, one must call `%run \"start.py\"` in their first notebook cell for research to work properly. Note that the location of `start.py` is in the launcher bin directory so you may have to use `../start.py` or specify the full path.\n\n- C# research latest kernel no longer supports using statements outside of the notebook context, meaning that `#load ./QuantConnect.csx` no longer applies QC namespaces to the notebook out of the box. Therefore one must specify the namespace directly in a cell. Our default notebooks include these statements as examples.\n\n- Python can sometimes have issues when paired with our quantconnect stubs package on Windows. This issue can cause modules not to be found because `site-packages` directory is not present in the python path. If you have the required modules installed and are seeing errors about them not being found, please try the following steps:\n    - remove stubs -> pip uninstall quantconnect-stubs\n    - reinstall stubs -> pip install quantconnect-stubs"
  },
  {
    "path": "Research/start.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# This Python script can be loaded in a notebook (ipynb file)\n# in order to reference QuantConnect assemblies\n#\n# Usage:\n# %run \"start.py\"\n\nimport clr_loader\nimport os\nfrom pythonnet import set_runtime\n\n# The runtimeconfig.json is stored alongside start.py, but start.py may be a\n# symlink and the directory start.py is stored in is not necessarily the\n# current working directory. We therefore construct the absolute path to the\n# start.py file, and find the runtimeconfig.json relative to that.\nset_runtime(clr_loader.get_coreclr(runtime_config=os.path.join(os.path.dirname(os.path.realpath(__file__)), \"QuantConnect.Lean.Launcher.runtimeconfig.json\")))\n\nfrom AlgorithmImports import *\n\n# Used by pythonNet\nAddReference(\"Fasterflect\")\n\nConfig.Reset()\nInitializer.Start()\napi = Initializer.GetSystemHandlers().Api\nalgorithmHandlers = Initializer.GetAlgorithmHandlers(researchMode=True)\n\n# Required to configure pythonpath with additional paths the user may have \n# set in the config, like a project library.\nPythonInitializer.Initialize(False)\n\ntry:\n    get_ipython().run_line_magic('matplotlib', 'inline')\nexcept NameError:\n    # can happen if start is triggered from python and not Ipython\n    pass\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmAddDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Algorithm.Selection;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\nusing Bitcoin = QuantConnect.Algorithm.CSharp.LiveTradingFeaturesAlgorithm.Bitcoin;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmAddDataTests\n    {\n        [Test]\n        public void DefaultDataFeeds_CanBeOverwritten_Successfully()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n\n            // forex defult - should be quotebar\n            var forexTrade = algo.AddForex(\"EURUSD\");\n            Assert.IsTrue(forexTrade.Subscriptions.Count() == 1);\n            Assert.IsTrue(GetMatchingSubscription(algo, forexTrade.Symbol, typeof(QuoteBar)) != null);\n\n            // Change\n            Config.Set(\"security-data-feeds\", \"{ Forex: [\\\"Trade\\\"] }\");\n            var dataFeedsConfigString = Config.Get(\"security-data-feeds\");\n            Dictionary<SecurityType, List<TickType>> dataFeeds = new Dictionary<SecurityType, List<TickType>>();\n            if (!string.IsNullOrEmpty(dataFeedsConfigString))\n            {\n                dataFeeds = JsonConvert.DeserializeObject<Dictionary<SecurityType, List<TickType>>>(dataFeedsConfigString);\n            }\n\n            algo.SetAvailableDataTypes(dataFeeds);\n\n            // new forex - should be tradebar\n            var forexQuote = algo.AddForex(\"EURUSD\");\n            // The quote bar subscription is kept\n            Assert.IsTrue(forexQuote.Subscriptions.Count() == 2);\n            Assert.IsTrue(GetMatchingSubscription(algo, forexQuote.Symbol, typeof(TradeBar)) != null);\n            Assert.IsTrue(GetMatchingSubscription(algo, forexQuote.Symbol, typeof(QuoteBar)) != null);\n\n            // reset to empty string, affects other tests because config is static\n            Config.Set(\"security-data-feeds\", \"\");\n        }\n\n        [Test]\n        public void DefaultDataFeeds_AreAdded_Successfully()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n\n            // forex\n            var forex = algo.AddSecurity(SecurityType.Forex, \"eurusd\");\n            Assert.IsTrue(forex.Subscriptions.Count() == 1);\n            Assert.IsTrue(GetMatchingSubscription(algo, forex.Symbol, typeof(QuoteBar)) != null);\n\n            // equity high resolution\n            var equityMinute = algo.AddSecurity(SecurityType.Equity, \"goog\");\n            Assert.IsTrue(equityMinute.Subscriptions.Count() == 2);\n            Assert.IsTrue(GetMatchingSubscription(algo, equityMinute.Symbol, typeof(TradeBar)) != null);\n            Assert.IsTrue(GetMatchingSubscription(algo, equityMinute.Symbol, typeof(QuoteBar)) != null);\n\n            // equity low resolution\n            var equityDaily = algo.AddSecurity(SecurityType.Equity, \"goog\", Resolution.Daily);\n            Assert.IsTrue(equityDaily.Subscriptions.Count() == 3);\n            Assert.IsTrue(GetMatchingSubscription(algo, equityDaily.Symbol, typeof(TradeBar)) != null);\n            Assert.IsTrue(GetMatchingSubscription(algo, equityMinute.Symbol, typeof(QuoteBar)) != null);\n\n            Assert.IsTrue(ReferenceEquals(equityMinute, equityDaily));\n\n            var equitySubscriptions = algo.SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(equityMinute.Symbol);\n            Assert.IsTrue(equitySubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Trade && s.Type == typeof(TradeBar) && s.Resolution == Resolution.Minute) != null);\n            Assert.IsTrue(equitySubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Quote && s.Type == typeof(QuoteBar) && s.Resolution == Resolution.Minute) != null);\n            Assert.IsTrue(equitySubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Trade && s.Type == typeof(TradeBar) && s.Resolution == Resolution.Daily) != null);\n\n            // option\n            var option = algo.AddSecurity(SecurityType.Option, \"goog\");\n            Assert.IsTrue(option.Subscriptions.Count() == 1);\n            Assert.IsTrue(GetMatchingSubscription(algo, option.Symbol, typeof(OptionUniverse)) != null);\n\n            // index option\n            var indexOption = algo.AddSecurity(SecurityType.IndexOption, \"spx\");\n            Assert.IsTrue(indexOption.Subscriptions.Count() == 1);\n            Assert.IsTrue(GetMatchingSubscription(algo, indexOption.Symbol, typeof(OptionUniverse)) != null);\n\n            // cfd\n            var cfd = algo.AddSecurity(SecurityType.Cfd, \"abc\");\n            Assert.IsTrue(cfd.Subscriptions.Count() == 1);\n            Assert.IsTrue(GetMatchingSubscription(algo, cfd.Symbol, typeof(QuoteBar)) != null);\n\n            // future\n            var future = algo.AddSecurity(SecurityType.Future, \"ES\");\n            Assert.IsTrue(future.Subscriptions.Count() == 1);\n            Assert.IsTrue(future.Subscriptions.FirstOrDefault(x => typeof(FutureUniverse) == x.Type) != null);\n\n            // Crypto high resolution\n            var cryptoMinute = algo.AddSecurity(SecurityType.Crypto, \"btcusd\");\n            Assert.IsTrue(cryptoMinute.Subscriptions.Count() == 2);\n            Assert.IsTrue(GetMatchingSubscription(algo, cryptoMinute.Symbol, typeof(TradeBar)) != null);\n            Assert.IsTrue(GetMatchingSubscription(algo, cryptoMinute.Symbol, typeof(QuoteBar)) != null);\n\n            // Crypto low resolution\n            var cryptoHourly = algo.AddSecurity(SecurityType.Crypto, \"btcusd\", Resolution.Hour);\n            Assert.IsTrue(cryptoHourly.Subscriptions.Count() == 4);\n            Assert.IsTrue(GetMatchingSubscription(algo, cryptoHourly.Symbol, typeof(TradeBar)) != null);\n            Assert.IsTrue(GetMatchingSubscription(algo, cryptoHourly.Symbol, typeof(QuoteBar)) != null);\n\n            Assert.IsTrue(ReferenceEquals(cryptoMinute, cryptoHourly));\n\n            var cryptoSubscriptions = algo.SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(cryptoMinute.Symbol);\n            Assert.IsTrue(cryptoSubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Trade && s.Type == typeof(TradeBar) && s.Resolution == Resolution.Minute) != null);\n            Assert.IsTrue(cryptoSubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Quote && s.Type == typeof(QuoteBar) && s.Resolution == Resolution.Minute) != null);\n            Assert.IsTrue(cryptoSubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Trade && s.Type == typeof(TradeBar) && s.Resolution == Resolution.Hour) != null);\n            Assert.IsTrue(cryptoSubscriptions.SingleOrDefault(\n                s => s.TickType == TickType.Quote && s.Type == typeof(QuoteBar) && s.Resolution == Resolution.Hour) != null);\n        }\n\n\n        [Test]\n        public void CustomDataTypes_AreAddedToSubscriptions_Successfully()\n        {\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            // Add a bitcoin subscription\n            qcAlgorithm.AddData<Bitcoin>(\"BTC\");\n            var bitcoinSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.FirstOrDefault(x => x.Type == typeof(Bitcoin));\n            Assert.AreEqual(bitcoinSubscription.Type, typeof(Bitcoin));\n\n            // Add a unlinkedData subscription\n            qcAlgorithm.AddData<UnlinkedData>(\"EURCAD\");\n            var unlinkedDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.FirstOrDefault(x => x.Type == typeof(UnlinkedData));\n            Assert.AreEqual(unlinkedDataSubscription.Type, typeof(UnlinkedData));\n        }\n\n        [Test]\n        public void OnEndOfTimeStepSeedsUnderlyingSecuritiesThatHaveNoData()\n        {\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm, new MockDataFeed()));\n            qcAlgorithm.SetLiveMode(true);\n            qcAlgorithm.Settings.SeedInitialPrices = false;\n            var testHistoryProvider = new TestHistoryProvider();\n            qcAlgorithm.HistoryProvider = testHistoryProvider;\n\n            var option = qcAlgorithm.AddSecurity(SecurityType.Option, testHistoryProvider.underlyingSymbol);\n            var option2 = qcAlgorithm.AddSecurity(SecurityType.Option, testHistoryProvider.underlyingSymbol2);\n            Assert.IsFalse(qcAlgorithm.Securities.ContainsKey(option.Symbol.Underlying));\n            Assert.IsFalse(qcAlgorithm.Securities.ContainsKey(option2.Symbol.Underlying));\n            qcAlgorithm.OnEndOfTimeStep();\n            var data = qcAlgorithm.Securities[testHistoryProvider.underlyingSymbol].GetLastData();\n            var data2 = qcAlgorithm.Securities[testHistoryProvider.underlyingSymbol2].GetLastData();\n            Assert.IsNotNull(data);\n            Assert.IsNotNull(data2);\n            Assert.AreEqual(data.Price, 2);\n            Assert.AreEqual(data2.Price, 3);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void OnEndOfTimeStepDoesNotThrowWhenSeedsSameUnderlyingForTwoSecurities()\n        {\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm, new MockDataFeed()));\n            qcAlgorithm.SetLiveMode(true);\n            qcAlgorithm.Settings.SeedInitialPrices = false;\n            var testHistoryProvider = new TestHistoryProvider();\n            qcAlgorithm.HistoryProvider = testHistoryProvider;\n            var option = qcAlgorithm.AddOption(testHistoryProvider.underlyingSymbol);\n\n            var symbol = Symbol.CreateOption(testHistoryProvider.underlyingSymbol, Market.USA, OptionStyle.American,\n                OptionRight.Call, 1, new DateTime(2015, 12, 24));\n            var symbol2 = Symbol.CreateOption(testHistoryProvider.underlyingSymbol, Market.USA, OptionStyle.American,\n                OptionRight.Put, 1, new DateTime(2015, 12, 24));\n\n            var optionContract = qcAlgorithm.AddOptionContract(symbol);\n            var optionContract2 = qcAlgorithm.AddOptionContract(symbol2);\n\n            qcAlgorithm.OnEndOfTimeStep();\n            var data = qcAlgorithm.Securities[testHistoryProvider.underlyingSymbol].GetLastData();\n            Assert.IsNotNull(data);\n            Assert.AreEqual(data.Price, 2);\n        }\n\n        [TestCase(\"EURUSD\", typeof(IndexedLinkedData), SecurityType.Cfd, false, true)]\n        [TestCase(\"BTCUSD\", typeof(IndexedLinkedData), SecurityType.Crypto, false, true)]\n        [TestCase(\"CL\", typeof(IndexedLinkedData), SecurityType.Future, true, true)]\n        [TestCase(\"EURUSD\", typeof(IndexedLinkedData), SecurityType.Forex, false, true)]\n        [TestCase(\"AAPL\", typeof(IndexedLinkedData), SecurityType.Equity, true, true)]\n        [TestCase(\"EURUSD\", typeof(UnlinkedData), SecurityType.Cfd, false, false)]\n        [TestCase(\"BTCUSD\", typeof(UnlinkedData), SecurityType.Crypto, false, false)]\n        [TestCase(\"CL\", typeof(UnlinkedData), SecurityType.Future, true, false)]\n        [TestCase(\"AAPL\", typeof(UnlinkedData), SecurityType.Equity, true, false)]\n        [TestCase(\"EURUSD\", typeof(UnlinkedData), SecurityType.Forex, false, false)]\n        public void AddDataSecuritySymbolWithUnderlying(string ticker, Type customDataType, SecurityType securityType, bool securityShouldBeMapped, bool customDataShouldBeMapped)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            Security asset;\n\n            switch (securityType)\n            {\n                case SecurityType.Cfd:\n                    asset = qcAlgorithm.AddCfd(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Crypto:\n                    asset = qcAlgorithm.AddCrypto(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Equity:\n                    asset = qcAlgorithm.AddEquity(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Forex:\n                    asset = qcAlgorithm.AddForex(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Future:\n                    asset = qcAlgorithm.AddFuture(ticker, Resolution.Minute);\n                    break;\n                default:\n                    throw new Exception($\"SecurityType {securityType} is not valid for this test\");\n            }\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, asset.Symbol, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, asset.Symbol, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n\n            Assert.IsTrue(customData.Symbol.HasUnderlying, $\"{customDataType.Name} added as {ticker} Symbol with SecurityType {securityType} does not have underlying\");\n            Assert.AreEqual(customData.Symbol.Underlying, asset.Symbol, $\"Custom data underlying does not match {securityType} Symbol for {ticker}\");\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            var assetShouldBeMapped = assetSubscription.TickerShouldBeMapped();\n            var customShouldBeMapped = customDataSubscription.TickerShouldBeMapped();\n\n            Assert.AreEqual(securityShouldBeMapped, assetShouldBeMapped);\n            Assert.AreEqual(customDataShouldBeMapped, customShouldBeMapped);\n\n            Assert.AreNotEqual(assetSubscription, customDataSubscription);\n\n            if (assetShouldBeMapped == customShouldBeMapped)\n            {\n                Assert.AreEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n                Assert.AreEqual(asset.Symbol.Value, customData.Symbol.Value.Split('.').First());\n            }\n        }\n\n        [TestCase(\"EURUSD\", typeof(IndexedLinkedData), SecurityType.Cfd, false, false)]\n        [TestCase(\"BTCUSD\", typeof(IndexedLinkedData), SecurityType.Crypto, false, false)]\n        [TestCase(\"CL\", typeof(IndexedLinkedData), SecurityType.Future, false, false)]\n        [TestCase(\"EURUSD\", typeof(IndexedLinkedData), SecurityType.Forex, false, false)]\n        [TestCase(\"AAPL\", typeof(IndexedLinkedData), SecurityType.Equity, true, true)]\n        public void AddDataSecurityTickerWithUnderlying(string ticker, Type customDataType, SecurityType securityType, bool securityShouldBeMapped, bool customDataShouldBeMapped)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            Security asset;\n\n            switch (securityType)\n            {\n                case SecurityType.Cfd:\n                    asset = qcAlgorithm.AddCfd(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Crypto:\n                    asset = qcAlgorithm.AddCrypto(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Equity:\n                    asset = qcAlgorithm.AddEquity(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Forex:\n                    asset = qcAlgorithm.AddForex(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Future:\n                    asset = qcAlgorithm.AddFuture(ticker, Resolution.Minute);\n                    break;\n                default:\n                    throw new Exception($\"SecurityType {securityType} is not valid for this test\");\n            }\n\n            // Aliased value for Futures contains a forward-slash, which causes the\n            // lookup in the SymbolCache to fail\n            if (securityType == SecurityType.Future)\n            {\n                ticker = asset.Symbol.Value;\n            }\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n\n            Assert.IsTrue(customData.Symbol.HasUnderlying, $\"Custom data added as {ticker} Symbol with SecurityType {securityType} does not have underlying\");\n            Assert.AreEqual(customData.Symbol.Underlying, asset.Symbol, $\"Custom data underlying does not match {securityType} Symbol for {ticker}\");\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            var assetShouldBeMapped = assetSubscription.TickerShouldBeMapped();\n            var customShouldBeMapped = customDataSubscription.TickerShouldBeMapped();\n\n            if (securityType == SecurityType.Equity)\n            {\n                Assert.AreEqual(securityShouldBeMapped, assetShouldBeMapped);\n                Assert.AreEqual(customDataShouldBeMapped, customShouldBeMapped);\n\n                Assert.AreNotEqual(assetSubscription, customDataSubscription);\n\n                if (assetShouldBeMapped == customShouldBeMapped)\n                {\n                    Assert.AreEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n                    Assert.AreEqual(asset.Symbol.Value, customData.Symbol.Value.Split('.').First());\n                }\n            }\n        }\n\n        [TestCase(\"EURUSD\", typeof(UnlinkedData), SecurityType.Cfd, false, false)]\n        [TestCase(\"BTCUSD\", typeof(UnlinkedData), SecurityType.Crypto, false, false)]\n        [TestCase(\"CL\", typeof(UnlinkedData), SecurityType.Future, true, false)]\n        [TestCase(\"AAPL\", typeof(UnlinkedData), SecurityType.Equity, true, false)]\n        [TestCase(\"EURUSD\", typeof(UnlinkedData), SecurityType.Forex, false, false)]\n        public void AddDataSecurityTickerNoUnderlying(string ticker, Type customDataType, SecurityType securityType, bool securityShouldBeMapped, bool customDataShouldBeMapped)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            Security asset;\n\n            switch (securityType)\n            {\n                case SecurityType.Cfd:\n                    asset = qcAlgorithm.AddCfd(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Crypto:\n                    asset = qcAlgorithm.AddCrypto(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Equity:\n                    asset = qcAlgorithm.AddEquity(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Forex:\n                    asset = qcAlgorithm.AddForex(ticker, Resolution.Daily);\n                    break;\n                case SecurityType.Future:\n                    asset = qcAlgorithm.AddFuture(ticker, Resolution.Minute);\n                    break;\n                default:\n                    throw new Exception($\"SecurityType {securityType} is not valid for this test\");\n            }\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First().DataTimeZone);\n\n            // Check to see if we have an underlying symbol when we shouldn't\n            Assert.IsFalse(customData.Symbol.HasUnderlying, $\"{customDataType.Name} has underlying symbol for SecurityType {securityType} with ticker {ticker}\");\n            Assert.AreEqual(customData.Symbol.Underlying, null, $\"{customDataType.Name} - Custom data underlying Symbol for SecurityType {securityType} is not null\");\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == securityType).First();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            var assetShouldBeMapped = assetSubscription.TickerShouldBeMapped();\n            var customShouldBeMapped = customDataSubscription.TickerShouldBeMapped();\n\n            Assert.AreEqual(securityShouldBeMapped, assetShouldBeMapped);\n            Assert.AreEqual(customDataShouldBeMapped, customShouldBeMapped);\n\n            Assert.AreNotEqual(assetSubscription, customDataSubscription);\n\n            if (assetShouldBeMapped == customShouldBeMapped)\n            {\n                // Would fail with CL future without this check because MappedSymbol returns \"/CL\" for the Future symbol\n                if (assetSubscription.SecurityType == SecurityType.Future)\n                {\n                    Assert.AreNotEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n                    Assert.AreNotEqual(asset.Symbol.Value, customData.Symbol.Value.Split('.').First());\n                }\n                else\n                {\n                    Assert.AreEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n                    Assert.AreEqual(asset.Symbol.Value, customData.Symbol.Value.Split('.').First());\n                }\n            }\n        }\n\n        [Test]\n        public void AddOptionWithUnderlyingFuture()\n        {\n            // Adds an option containing a Future as its underlying Symbol.\n            // This is an essential step in enabling custom derivatives\n            // based on any asset class provided to Option. This test\n            // checks the ability to create Future Options.\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n\n            var underlying = algo.AddFuture(\"ES\", Resolution.Minute, Market.CME);\n            underlying.SetFilter(0, 365);\n\n            var futureOption = algo.AddOption(underlying.Symbol, Resolution.Minute);\n\n            Assert.IsTrue(futureOption.Symbol.HasUnderlying);\n            Assert.AreEqual(underlying.Symbol, futureOption.Symbol.Underlying);\n        }\n\n        [Test]\n        public void AddFutureOptionContractNonEquityOption()\n        {\n            // Adds an option contract containing an underlying future contract.\n            // We test to make sure that the security returned is a specific option\n            // contract and with the future as the underlying.\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n\n            var underlying = algo.AddFutureContract(\n                Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2021, 3, 19)),\n                Resolution.Minute);\n\n            var futureOptionContract = algo.AddFutureOptionContract(\n                Symbol.CreateOption(underlying.Symbol, Market.CME, OptionStyle.American, OptionRight.Call, 2550m, new DateTime(2021, 3, 19)),\n                Resolution.Minute);\n\n            Assert.AreEqual(underlying.Symbol, futureOptionContract.Symbol.Underlying);\n            Assert.AreEqual(underlying, futureOptionContract.Underlying);\n            Assert.IsFalse(underlying.Symbol.IsCanonical());\n            Assert.IsFalse(futureOptionContract.Symbol.IsCanonical());\n        }\n\n        [Test]\n        public void AddFutureOptionAddsUniverseSelectionModel()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n\n            var underlying = algo.AddFuture(\"ES\", Resolution.Minute, Market.CME);\n            underlying.SetFilter(0, 365);\n\n            algo.AddFutureOption(underlying.Symbol, _ => _);\n            Assert.IsTrue(algo.UniverseSelection is CompositeUniverseSelectionModel);\n        }\n\n        [TestCase(\"AAPL\", typeof(IndexedLinkedData), true)]\n        [TestCase(\"TWX\", typeof(IndexedLinkedData), true)]\n        [TestCase(\"FB\", typeof(IndexedLinkedData), true)]\n        [TestCase(\"NFLX\", typeof(IndexedLinkedData), true)]\n        [TestCase(\"TWX\", typeof(UnlinkedData), false)]\n        [TestCase(\"AAPL\", typeof(UnlinkedData), false)]\n        public void AddDataOptionsSymbolHasChainedUnderlyingSymbols(string ticker, Type customDataType, bool customDataShouldBeMapped)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            var asset = qcAlgorithm.AddOption(ticker);\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, asset.Symbol, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, asset.Symbol, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n\n            // Check to see if we have an underlying symbol when we shouldn't\n            Assert.IsTrue(customData.Symbol.HasUnderlying, $\"{customDataType.Name} - {ticker} has no underlying Symbol\");\n            Assert.AreEqual(customData.Symbol.Underlying, asset.Symbol);\n            Assert.AreEqual(customData.Symbol.Underlying.Underlying, asset.Symbol.Underlying);\n            Assert.AreEqual(customData.Symbol.Underlying.Underlying.Underlying, null);\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            Assert.IsTrue(assetSubscription.TickerShouldBeMapped());\n            Assert.AreEqual(customDataShouldBeMapped, customDataSubscription.TickerShouldBeMapped());\n\n            Assert.AreEqual($\"?{assetSubscription.MappedSymbol}\", customDataSubscription.MappedSymbol);\n        }\n\n        [TestCase(\"AAPL\", typeof(IndexedLinkedData))]\n        [TestCase(\"TWX\", typeof(IndexedLinkedData))]\n        [TestCase(\"FB\", typeof(IndexedLinkedData))]\n        [TestCase(\"NFLX\", typeof(IndexedLinkedData))]\n        public void AddDataOptionsTickerHasChainedUnderlyingSymbol(string ticker, Type customDataType)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            var asset = qcAlgorithm.AddOption(ticker);\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n\n            // Check to see if we have an underlying symbol when we shouldn't\n            Assert.IsTrue(customData.Symbol.HasUnderlying, $\"{customDataType.Name} - {ticker} has no underlying Symbol\");\n            Assert.AreNotEqual(customData.Symbol.Underlying, asset.Symbol);\n            Assert.IsFalse(customData.Symbol.Underlying.HasUnderlying);\n            Assert.AreEqual(customData.Symbol.Underlying, asset.Symbol.Underlying);\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            Assert.IsTrue(assetSubscription.TickerShouldBeMapped());\n            Assert.IsTrue(customDataSubscription.TickerShouldBeMapped());\n\n            Assert.AreEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n        }\n\n        [TestCase(\"AAPL\", typeof(UnlinkedData))]\n        [TestCase(\"FDTR\", typeof(UnlinkedData))]\n        public void AddDataOptionsTickerHasNoChainedUnderlyingSymbols(string ticker, Type customDataType)\n        {\n            SymbolCache.Clear();\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            var asset = qcAlgorithm.AddOption(ticker);\n\n            // Dummy here is meant to try to corrupt the SymbolCache. Ideally, SymbolCache should return non-custom data types with higher priority\n            // in case we want to add two custom data types, but still have them associated with the equity from the cache if we're using it.\n            // This covers the case where two idential data subscriptions are created.\n            var dummy = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n            var customData = qcAlgorithm.AddData(customDataType, ticker, Resolution.Daily, qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single().DataTimeZone);\n\n            // Check to see if we have an underlying symbol when we shouldn't\n            Assert.IsFalse(customData.Symbol.HasUnderlying, $\"{customDataType.Name} has an underlying Symbol\");\n\n            var assetSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Option).Single();\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.Where(x => x.SecurityType == SecurityType.Base).Single();\n\n            Assert.IsTrue(assetSubscription.TickerShouldBeMapped());\n            Assert.IsFalse(customDataSubscription.TickerShouldBeMapped());\n\n            //Assert.AreNotEqual(assetSubscription.MappedSymbol, customDataSubscription.MappedSymbol);\n        }\n\n        [Test]\n        public void PythonCustomDataTypes_AreAddedToSubscriptions_Successfully()\n        {\n            var qcAlgorithm = new AlgorithmPythonWrapper(\"Test_CustomDataAlgorithm\");\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            // Initialize contains the statements:\n            // self.AddData(Nifty, \"NIFTY\")\n            // self.AddData(CustomPythonData, \"IBM\", Resolution.Daily)\n            qcAlgorithm.Initialize();\n\n            var niftySubscription = qcAlgorithm.SubscriptionManager.Subscriptions.FirstOrDefault(x => x.Symbol.Value == \"NIFTY\");\n            Assert.IsNotNull(niftySubscription);\n\n            var niftyFactory = (BaseData)ObjectActivator.GetActivator(niftySubscription.Type).Invoke(new object[] { niftySubscription.Type });\n            Assert.DoesNotThrow(() => niftyFactory.GetSource(niftySubscription, DateTime.UtcNow, false));\n\n            var customDataSubscription = qcAlgorithm.SubscriptionManager.Subscriptions.FirstOrDefault(x => x.Symbol.Value == \"IBM\");\n            Assert.IsNotNull(customDataSubscription);\n            Assert.IsTrue(customDataSubscription.IsCustomData);\n            Assert.AreEqual(\"custom_data.CustomPythonData\", customDataSubscription.Type.ToString());\n\n            var customDataFactory = (BaseData)ObjectActivator.GetActivator(customDataSubscription.Type).Invoke(new object[] { customDataSubscription.Type });\n            Assert.DoesNotThrow(() => customDataFactory.GetSource(customDataSubscription, DateTime.UtcNow, false));\n        }\n\n        [Test]\n        public void PythonCustomDataTypes_AreAddedToConsolidator_Successfully()\n        {\n            var qcAlgorithm = new AlgorithmPythonWrapper(\"Test_CustomDataAlgorithm\");\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n\n            // Initialize contains the statements:\n            // self.AddData(Nifty, \"NIFTY\")\n            // self.AddData(CustomPythonData, \"IBM\", Resolution.Daily)\n            qcAlgorithm.Initialize();\n\n            #pragma warning disable CS0618\n            using var niftyConsolidator = new DynamicDataConsolidator(TimeSpan.FromDays(2));\n            Assert.DoesNotThrow(() => qcAlgorithm.SubscriptionManager.AddConsolidator(\"NIFTY\", niftyConsolidator));\n\n            using var customDataConsolidator = new DynamicDataConsolidator(TimeSpan.FromDays(2));\n            Assert.DoesNotThrow(() => qcAlgorithm.SubscriptionManager.AddConsolidator(\"IBM\", customDataConsolidator));\n            #pragma warning restore CS0618\n        }\n\n        [Test]\n        public void AddingInvalidDataTypeThrows()\n        {\n            var qcAlgorithm = new QCAlgorithm();\n            qcAlgorithm.SubscriptionManager.SetDataManager(new DataManagerStub(qcAlgorithm));\n            Assert.Throws<ArgumentException>(() => qcAlgorithm.AddData(typeof(double),\n                \"double\",\n                Resolution.Daily,\n                DateTimeZone.Utc));\n        }\n\n        [Test]\n        public void AppendsCustomDataTypeName_ToSecurityIdentifierSymbol()\n        {\n            const string ticker = \"ticker\";\n            var algorithm = Algorithm();\n\n            var security = algorithm.AddData<UnlinkedData>(ticker);\n            Assert.AreEqual(ticker.ToUpperInvariant(), security.Symbol.Value);\n            Assert.AreEqual($\"{ticker.ToUpperInvariant()}.{typeof(UnlinkedData).Name}\", security.Symbol.ID.Symbol);\n            Assert.AreEqual(SecurityIdentifier.GenerateBaseSymbol(typeof(UnlinkedData), ticker), security.Symbol.ID.Symbol);\n        }\n\n        [Test]\n        public void RegistersSecurityIdentifierSymbol_AsTickerString_InSymbolCache()\n        {\n            var algorithm = Algorithm();\n\n            Symbol cachedSymbol;\n            var security = algorithm.AddData<UnlinkedData>(\"ticker\");\n            var symbolCacheAlias = security.Symbol.ID.Symbol;\n\n            Assert.IsTrue(SymbolCache.TryGetSymbol(symbolCacheAlias, out cachedSymbol));\n            Assert.AreSame(security.Symbol, cachedSymbol);\n        }\n\n        [Test]\n        public void DoesNotCauseCollision_WhenRegisteringMultipleDifferentCustomDataTypes_WithSameTicker()\n        {\n            const string ticker = \"ticker\";\n            var algorithm = Algorithm();\n\n            var security1 = algorithm.AddData<UnlinkedData>(ticker);\n            var security2 = algorithm.AddData<Bitcoin>(ticker);\n\n            var unlinkedData = algorithm.Securities[security1.Symbol];\n            Assert.AreSame(security1, unlinkedData);\n\n            var bitcoin = algorithm.Securities[security2.Symbol];\n            Assert.AreSame(security2, bitcoin);\n\n            Assert.AreNotSame(unlinkedData, bitcoin);\n        }\n\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Index)]\n        [TestCase(SecurityType.Future)]\n        public void AddOptionContractWithDelistedUnderlyingThrows(SecurityType underlyingSecurityType)\n        {\n            var algorithm = Algorithm();\n            algorithm.SetStartDate(2007, 05, 25);\n\n            Security underlying = underlyingSecurityType switch\n            {\n                SecurityType.Equity => algorithm.AddEquity(\"SPY\"),\n                SecurityType.Index => algorithm.AddIndex(\"SPX\"),\n                SecurityType.Future => algorithm.AddFuture(\"ES\"),\n                _ => throw new ArgumentException($\"Invalid test underlying security type {underlyingSecurityType}\")\n            };\n\n            underlying.IsDelisted = true;\n            // let's remove the underlying since it's delisted\n            algorithm.RemoveSecurity(underlying.Symbol);\n\n            var optionContractSymbol = Symbol.CreateOption(underlying.Symbol, Market.USA, OptionStyle.American, OptionRight.Call, 100,\n                new DateTime(2007, 06, 15));\n\n            var exception = Assert.Throws<ArgumentException>(() => algorithm.AddOptionContract(optionContractSymbol));\n            Assert.IsTrue(exception.Message.Contains(\"is delisted\"), $\"Unexpected exception message: {exception.Message}\");\n        }\n\n        private static SubscriptionDataConfig GetMatchingSubscription(QCAlgorithm algorithm, Symbol symbol, Type type)\n        {\n            // find a subscription matchin the requested type with a higher resolution than requested\n            return algorithm.SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(symbol)\n                .Where(config => type.IsAssignableFrom(config.Type))\n                .OrderByDescending(s => s.Resolution)\n                .FirstOrDefault();\n        }\n\n        private static QCAlgorithm Algorithm()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            return algorithm;\n        }\n\n        private class TestHistoryProvider : HistoryProviderBase\n        {\n            public string underlyingSymbol = \"GOOG\";\n            public string underlyingSymbol2 = \"AAPL\";\n            public override int DataPointCount { get; }\n\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                var now = DateTime.UtcNow;\n                #pragma warning disable CS0618\n                var tradeBar1 = new TradeBar(now, underlyingSymbol, 1, 1, 1, 1, 1, TimeSpan.FromDays(1));\n                var tradeBar2 = new TradeBar(now, underlyingSymbol2, 3, 3, 3, 3, 3, TimeSpan.FromDays(1));\n                var slice1 = new Slice(now, new List<BaseData> { tradeBar1, tradeBar2 },\n                                    new TradeBars(now) { tradeBar1, tradeBar2  }, new QuoteBars(),\n                                    new Ticks(), new OptionChains(),\n                                    new FuturesChains(), new Splits(),\n                                    new Dividends(now), new Delistings(),\n                                    new SymbolChangedEvents(), new MarginInterestRates(), now);\n                var tradeBar1_2 = new TradeBar(now, underlyingSymbol, 2, 2, 2, 2, 2, TimeSpan.FromDays(1));\n                #pragma warning restore CS0618\n                var slice2 = new Slice(now, new List<BaseData> { tradeBar1_2 },\n                    new TradeBars(now) { tradeBar1_2 }, new QuoteBars(),\n                    new Ticks(), new OptionChains(),\n                    new FuturesChains(), new Splits(),\n                    new Dividends(now), new Delistings(),\n                    new SymbolChangedEvents(), new MarginInterestRates(), now);\n                return new[] { slice1, slice2 };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmAddSecurityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.IndexOption;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Index = QuantConnect.Securities.Index.Index;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmAddSecurityTests\n    {\n        private QCAlgorithm _algo;\n        private NullDataFeed _dataFeed;\n\n        /// <summary>\n        /// Instatiate a new algorithm before each test.\n        /// Clear the <see cref=\"SymbolCache\"/> so that no symbols and associated brokerage models are cached between test\n        /// </summary>\n        [SetUp]\n        public void Setup()\n        {\n            _algo = new QCAlgorithm();\n            _dataFeed = new NullDataFeed\n            {\n                ShouldThrow = false\n            };\n            _algo.SubscriptionManager.SetDataManager(new DataManagerStub(_dataFeed, _algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestAddSecurityWithSymbol))]\n        public void AddSecurityWithSymbol(Symbol symbol, Type type = null)\n        {\n            var security = type != null ? _algo.AddData(type, symbol.Underlying) : _algo.AddSecurity(symbol);\n            Assert.AreEqual(security.Symbol, symbol);\n            Assert.AreEqual((Symbol)security, symbol);\n            Assert.IsTrue(_algo.Securities.ContainsKey(symbol));\n\n            Assert.DoesNotThrow(() =>\n            {\n                switch (symbol.SecurityType)\n                {\n                    case SecurityType.Equity:\n                        var equity = (Equity)security;\n                        break;\n                    case SecurityType.Option:\n                        var option = (Option)security;\n                        break;\n                    case SecurityType.Forex:\n                        var forex = (Forex)security;\n                        break;\n                    case SecurityType.Future:\n                        var future = (Future)security;\n                        break;\n                    case SecurityType.Cfd:\n                        var cfd = (Cfd)security;\n                        break;\n                    case SecurityType.Index:\n                        var index = (Index)security;\n                        break;\n                    case SecurityType.IndexOption:\n                        var indexOption = (IndexOption)security;\n                        break;\n                    case SecurityType.Crypto:\n                        var crypto = (Crypto)security;\n                        break;\n                    case SecurityType.CryptoFuture:\n                        var cryptoFuture = (CryptoFuture)security;\n                        break;\n                    case SecurityType.Base:\n                        break;\n                    default:\n                        throw new Exception($\"Invalid Security Type: {symbol.SecurityType}\");\n                }\n            });\n\n            if (symbol.IsCanonical())\n            {\n                Assert.DoesNotThrow(() => _algo.OnEndOfTimeStep());\n\n                Assert.IsTrue(_algo.UniverseManager.ContainsKey(symbol));\n            }\n        }\n\n        [TestCaseSource(nameof(GetDataNormalizationModes))]\n        public void AddsEquityWithExpectedDataNormalizationMode(DataNormalizationMode dataNormalizationMode)\n        {\n            var equity = _algo.AddEquity(\"AAPL\", dataNormalizationMode: dataNormalizationMode);\n            Assert.That(_algo.SubscriptionManager.Subscriptions.Where(x => x.Symbol == equity.Symbol).Select(x => x.DataNormalizationMode),\n                Has.All.EqualTo(dataNormalizationMode));\n        }\n\n        [Test]\n        public void ProperlyAddsFutureWithExtendedMarketHours(\n            [Values(true, false)] bool extendedMarketHours,\n            [ValueSource(nameof(FuturesTestCases))] Func<QCAlgorithm, Security> getFuture)\n        {\n            var future = _algo.AddFuture(Futures.Indices.VIX, Resolution.Minute, extendedMarketHours: extendedMarketHours);\n            var subscriptions = _algo.SubscriptionManager.Subscriptions.Where(x => x.Symbol == future.Symbol).ToList();\n\n            var universeSubscriptions = subscriptions.Where(x => x.Type == typeof(FutureUniverse)).ToList();\n            Assert.AreEqual(1, universeSubscriptions.Count);\n            // Universe does not support extended market hours\n            Assert.IsFalse(universeSubscriptions[0].ExtendedMarketHours);\n\n            var nonUniverseSubscriptions = subscriptions.Where(x => x.Type != typeof(FutureUniverse)).ToList();\n            Assert.Greater(nonUniverseSubscriptions.Count, 0);\n            Assert.That(nonUniverseSubscriptions.Select(x => x.ExtendedMarketHours),\n                Has.All.EqualTo(extendedMarketHours));\n        }\n\n        [TestCaseSource(nameof(FuturesTestCases))]\n        public void AddFutureWithExtendedMarketHours(Func<QCAlgorithm, Security> getFuture)\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var marketHoursDatabase = MarketHoursDatabase.FromFile(file);\n            var securityService = new SecurityService(\n                _algo.Portfolio.CashBook,\n                marketHoursDatabase,\n                SymbolPropertiesDatabase.FromDataFolder(),\n                _algo,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(_algo.Portfolio),\n                algorithm: _algo);\n            _algo.Securities.SetSecurityService(securityService);\n\n            var future = getFuture(_algo);\n\n            var now = new DateTime(2022, 6, 26, 17, 0, 0);\n            Assert.AreEqual(DayOfWeek.Sunday, now.DayOfWeek);\n            var regularMarketStartTime = new TimeSpan(8, 30, 0);\n            var regularMarketEndTime = new TimeSpan(15, 0, 0);\n            var firstExtendedMarketStartTime = regularMarketEndTime;\n            var firstExtendedMarketEndTime = new TimeSpan(16, 0, 0);\n            var secondExtendedMarketStartTime = new TimeSpan(17, 0, 0);\n\n            Action<DateTime> checkExtendedHours = (date) =>\n            {\n                Assert.IsFalse(future.Exchange.Hours.IsOpen(now, false));\n                Assert.IsTrue(future.Exchange.Hours.IsOpen(now, true));\n            };\n            Action<DateTime> checkRegularHours = (date) =>\n            {\n                Assert.IsTrue(future.Exchange.Hours.IsOpen(now, false));\n                Assert.IsTrue(future.Exchange.Hours.IsOpen(now, true));\n            };\n            Action<DateTime> checkClosed = (date) =>\n            {\n                Assert.IsFalse(future.Exchange.Hours.IsOpen(now, false));\n                Assert.IsFalse(future.Exchange.Hours.IsOpen(now, true));\n            };\n\n            while (now.DayOfWeek < DayOfWeek.Saturday)\n            {\n                while (now.TimeOfDay < regularMarketStartTime)\n                {\n                    checkExtendedHours(now);\n                    now = now.AddMinutes(1);\n                }\n\n                while (now.TimeOfDay < regularMarketEndTime)\n                {\n                    checkRegularHours(now);\n                    now = now.AddMinutes(1);\n                }\n\n                while (now.TimeOfDay >= firstExtendedMarketStartTime && now.TimeOfDay < firstExtendedMarketEndTime)\n                {\n                    checkExtendedHours(now);\n                    now = now.AddMinutes(1);\n                }\n\n                while (now.TimeOfDay < secondExtendedMarketStartTime)\n                {\n                    checkClosed(now);\n                    now = now.AddMinutes(1);\n                }\n\n                var endOfDay = now.AddDays(1).Date;\n                if (now.DayOfWeek < DayOfWeek.Friday)\n                {\n                    while (now < endOfDay)\n                    {\n                        checkExtendedHours(now);\n                        now = now.AddMinutes(1);\n                    }\n                }\n                else\n                {\n                    now = endOfDay;\n                }\n            }\n\n            while (now.DayOfWeek < DayOfWeek.Sunday)\n            {\n                checkClosed(now);\n                now = now.AddMinutes(1);\n            }\n        }\n\n        // Reproduces https://github.com/QuantConnect/Lean/issues/7451\n        [Test]\n        public void DoesNotAddExtraIndexSubscriptionAfterAddingIndexOptionContract()\n        {\n            var spx = _algo.AddIndex(\"SPX\", Resolution.Minute, fillForward: false);\n\n            Assert.AreEqual(1, _algo.SubscriptionManager.Subscriptions.Count());\n            Assert.AreEqual(spx.Symbol, _algo.SubscriptionManager.Subscriptions.Single().Symbol);\n\n            var spxOption = Symbol.CreateOption(\n                spx.Symbol,\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3200m,\n                new DateTime(2021, 1, 15));\n            _algo.AddIndexOptionContract(spxOption, Resolution.Minute);\n\n            Assert.Greater(_algo.SubscriptionManager.Subscriptions.Count(), 1);\n            Assert.AreEqual(1, _algo.SubscriptionManager.Subscriptions.Count(x => x.Symbol == spx.Symbol));\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AddSecurityInitializerAppendsInitializer(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n\n            Assert.IsNotAssignableFrom<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n            if (language == Language.CSharp)\n            {\n                var classInitializer1 = new TestCustomSecurityInitializer();\n                algorithm.AddSecurityInitializer(classInitializer1);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                var classInitializer2 = new TestCustomSecurityInitializer();\n                algorithm.AddSecurityInitializer(classInitializer2);\n\n                var funcInitializer1CallCount = 0;\n                algorithm.AddSecurityInitializer((_) => funcInitializer1CallCount++);\n\n                var funcInitializer2CallCount = 0;\n                algorithm.AddSecurityInitializer((_) => funcInitializer2CallCount++);\n\n                var security = algorithm.AddEquity(\"SPY\");\n                Assert.AreEqual(1, classInitializer1.CallCount);\n                Assert.AreEqual(1, classInitializer2.CallCount);\n                Assert.AreEqual(1, funcInitializer1CallCount);\n                Assert.AreEqual(1, funcInitializer2CallCount);\n            }\n            else\n            {\n                using var _ = Py.GIL();\n                using var module = PyModule.FromString(\"AddSecurityInitializerAppendsInitializer\", @\"\nclass TestCustomSecurityInitializer:\n    def __init__(self):\n        self.call_count = 0\n\n    def initialize(self, security):\n        self.call_count += 1\n\nclass_initializer1 = TestCustomSecurityInitializer()\nclass_initializer2 = TestCustomSecurityInitializer()\nfunc_call_count1 = 0\nfunc_call_count2 = 0\n\ndef add_security_initializers(algorithm):\n    algorithm.add_security_initializer(class_initializer1)\n    algorithm.add_security_initializer(class_initializer2)\n\n    algorithm.add_security_initializer(func_security_initializer1)\n    algorithm.add_security_initializer(func_security_initializer2)\n\ndef func_security_initializer1(security):\n    global func_call_count1\n    func_call_count1 += 1\n\ndef func_security_initializer2(security):\n    global func_call_count2\n    func_call_count2 += 1\n\");\n\n                using var addSecurityInitializers = module.GetAttr(\"add_security_initializers\");\n                using var pyAlgorithm = algorithm.ToPython();\n                addSecurityInitializers.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                var security = algorithm.AddEquity(\"SPY\");\n\n                using var classInitializer1 = module.GetAttr(\"class_initializer1\");\n                var classInitializer1CallCount = classInitializer1.GetAttr(\"call_count\").GetAndDispose<int>();\n                Assert.AreEqual(1, classInitializer1CallCount);\n\n                using var classInitializer2 = module.GetAttr(\"class_initializer2\");\n                var classInitializer2CallCount = classInitializer2.GetAttr(\"call_count\").GetAndDispose<int>();\n                Assert.AreEqual(1, classInitializer2CallCount);\n\n                var funcCallCount1 = module.GetAttr(\"func_call_count1\").GetAndDispose<int>();\n                Assert.AreEqual(1, funcCallCount1);\n\n                var funcCallCount2 = module.GetAttr(\"func_call_count2\").GetAndDispose<int>();\n                Assert.AreEqual(1, funcCallCount2);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SetSecurityInitializerReplacesInitializer(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n\n            Assert.IsNotAssignableFrom<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n            if (language == Language.CSharp)\n            {\n                var classInitializer1 = new TestCustomSecurityInitializer();\n                algorithm.AddSecurityInitializer(classInitializer1);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                algorithm.SetSecurityInitializer(classInitializer1);\n                Assert.IsInstanceOf<TestCustomSecurityInitializer>(algorithm.SecurityInitializer);\n            }\n            else\n            {\n                using var _ = Py.GIL();\n                using var module = PyModule.FromString(\"AddSecurityInitializerAppendsInitializer\", @\"\nclass TestCustomSecurityInitializer:\n    def initialize(self, security):\n        pass\n\ndef add_security_initializer(algorithm):\n    algorithm.add_security_initializer(TestCustomSecurityInitializer())\n\ndef set_security_initializer(algorithm):\n    algorithm.set_security_initializer(TestCustomSecurityInitializer())\n\");\n\n                using var pyAlgorithm = algorithm.ToPython();\n                using var addSecurityInitializer = module.GetAttr(\"add_security_initializer\");\n                addSecurityInitializer.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                using var setSecurityInitializer = module.GetAttr(\"set_security_initializer\");\n                setSecurityInitializer.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<SecurityInitializerPythonWrapper>(algorithm.SecurityInitializer);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AddsSecurityInitializerAfterSetting(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n\n            if (language == Language.CSharp)\n            {\n                var classInitializer1 = new TestCustomSecurityInitializer();\n                algorithm.SetSecurityInitializer(classInitializer1);\n\n                Assert.IsAssignableFrom<TestCustomSecurityInitializer>(algorithm.SecurityInitializer);\n\n                var classInitializer2 = new TestCustomSecurityInitializer();\n                algorithm.AddSecurityInitializer(classInitializer2);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                var funcInitializer1CallCount = 0;\n                algorithm.AddSecurityInitializer((_) => funcInitializer1CallCount++);\n\n                var funcInitializer2CallCount = 0;\n                algorithm.AddSecurityInitializer((_) => funcInitializer2CallCount++);\n\n                var security = algorithm.AddEquity(\"SPY\");\n                Assert.AreEqual(1, classInitializer1.CallCount);\n                Assert.AreEqual(1, classInitializer2.CallCount);\n                Assert.AreEqual(1, funcInitializer1CallCount);\n                Assert.AreEqual(1, funcInitializer2CallCount);\n            }\n            else\n            {\n                using var _ = Py.GIL();\n                using var module = PyModule.FromString(\"AddSecurityInitializerAppendsInitializer\", @\"\nclass TestCustomSecurityInitializer:\n    def __init__(self):\n        self.call_count = 0\n\n    def initialize(self, security):\n        self.call_count += 1\n\nclass_initializer1 = TestCustomSecurityInitializer()\nclass_initializer2 = TestCustomSecurityInitializer()\nfunc_call_count1 = 0\nfunc_call_count2 = 0\n\ndef set_security_initializer(algorithm):\n    algorithm.set_security_initializer(class_initializer1)\n\ndef add_security_initializers(algorithm):\n    algorithm.add_security_initializer(class_initializer2)\n\n    algorithm.add_security_initializer(func_security_initializer1)\n    algorithm.add_security_initializer(func_security_initializer2)\n\ndef func_security_initializer1(security):\n    global func_call_count1\n    func_call_count1 += 1\n\ndef func_security_initializer2(security):\n    global func_call_count2\n    func_call_count2 += 1\n\");\n\n                using var pyAlgorithm = algorithm.ToPython();\n\n                using var setSecurityInitializer = module.GetAttr(\"set_security_initializer\");\n                setSecurityInitializer.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<SecurityInitializerPythonWrapper>(algorithm.SecurityInitializer);\n\n                using var addSecurityInitializers = module.GetAttr(\"add_security_initializers\");\n                addSecurityInitializers.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                var security = algorithm.AddEquity(\"SPY\");\n\n                using var classInitializer1 = module.GetAttr(\"class_initializer1\");\n                var classInitializer1CallCount = classInitializer1.GetAttr(\"call_count\").GetAndDispose<int>();\n                Assert.AreEqual(1, classInitializer1CallCount);\n\n                using var classInitializer2 = module.GetAttr(\"class_initializer2\");\n                var classInitializer2CallCount = classInitializer2.GetAttr(\"call_count\").GetAndDispose<int>();\n                Assert.AreEqual(1, classInitializer2CallCount);\n\n                var funcCallCount1 = module.GetAttr(\"func_call_count1\").GetAndDispose<int>();\n                Assert.AreEqual(1, funcCallCount1);\n\n                var funcCallCount2 = module.GetAttr(\"func_call_count2\").GetAndDispose<int>();\n                Assert.AreEqual(1, funcCallCount2);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SetBrokerageModelAppendsSecurityIntializerAfterAddSecurityInitializer(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n\n            Assert.IsNotAssignableFrom<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n            var brokerageModel = default(TestBrokerageModel);\n            var security = default(Security);\n\n            if (language == Language.CSharp)\n            {\n                var classInitializer = new TestCustomSecurityInitializer();\n                algorithm.AddSecurityInitializer(classInitializer);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                brokerageModel = new TestBrokerageModel();\n                algorithm.SetBrokerageModel(brokerageModel);\n\n                Assert.AreSame(brokerageModel, algorithm.BrokerageModel);\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                security = algorithm.AddEquity(\"SPY\");\n\n                Assert.AreEqual(1, classInitializer.CallCount);\n            }\n            else\n            {\n                using var _ = Py.GIL();\n                using var module = PyModule.FromString(\"SetBrokerageModelAppendsSecurityIntializerAfterAddSecurityInitializer\", @\"\nfrom QuantConnect.Tests.Algorithm import AlgorithmAddSecurityTests\n\nclass TestCustomSecurityInitializer:\n    def __init__(self):\n        self.call_count = 0\n\n    def initialize(self, security):\n        security.set_fill_model(AlgorithmAddSecurityTests.TestCustomSecurityInitializer.TestFillModel())\n        self.call_count += 1\n\nclass_initializer = TestCustomSecurityInitializer()\n\ndef add_security_initializers(algorithm):\n    algorithm.add_security_initializer(class_initializer)\n\ndef set_brokerage_model(algorithm):\n    algorithm.set_brokerage_model(AlgorithmAddSecurityTests.TestBrokerageModel())\n\");\n\n                using var addSecurityInitializers = module.GetAttr(\"add_security_initializers\");\n                using var pyAlgorithm = algorithm.ToPython();\n                addSecurityInitializers.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n\n                using var setBrokerageModel = module.GetAttr(\"set_brokerage_model\");\n                setBrokerageModel.Invoke(pyAlgorithm);\n\n                Assert.IsInstanceOf<CompositeSecurityInitializer>(algorithm.SecurityInitializer);\n                Assert.IsInstanceOf<TestBrokerageModel>(algorithm.BrokerageModel);\n\n                brokerageModel = (TestBrokerageModel)algorithm.BrokerageModel;\n\n                security = algorithm.AddEquity(\"SPY\");\n\n                using var classInitializer = module.GetAttr(\"class_initializer\");\n                var classInitializer1CallCount = classInitializer.GetAttr(\"call_count\").GetAndDispose<int>();\n                Assert.AreEqual(1, classInitializer1CallCount);\n            }\n\n            Assert.IsTrue(brokerageModel.GetFillModelCalled);\n            Assert.IsTrue(brokerageModel.GetFeeModelCalled);\n            Assert.IsTrue(brokerageModel.GetSlippageModelCalled);\n            Assert.IsTrue(brokerageModel.GetSettlementModelCalled);\n            Assert.IsTrue(brokerageModel.GetBuyingPowerModelCalled);\n            Assert.IsTrue(brokerageModel.GetMarginInterestRateModelCalled);\n            Assert.IsTrue(brokerageModel.GetLeverageCalled);\n            Assert.IsTrue(brokerageModel.GetShortableProviderCalled);\n\n            Assert.IsInstanceOf<TestBrokerageModel.TestFeeModel>(security.FeeModel);\n            Assert.IsInstanceOf<TestBrokerageModel.TestSlippageModel>(security.SlippageModel);\n            Assert.IsInstanceOf<TestBrokerageModel.TestSettlementModel>(security.SettlementModel);\n            Assert.IsInstanceOf<TestBrokerageModel.TestBuyingPowerModel>(security.BuyingPowerModel);\n            Assert.IsInstanceOf<TestBrokerageModel.TestMarginInterestRateModel>(security.MarginInterestRateModel);\n            Assert.IsInstanceOf<TestBrokerageModel.TestShortableProvider>(security.ShortableProvider);\n            Assert.AreEqual(5000, security.Leverage);\n\n            // All models should've been set my the TestBrokerageModel, except the fill model,\n            // which should have been set by the TestCustomSecurityInitializer, because user defined\n            // initializer should run after the brokerage model initializer\n            Assert.IsInstanceOf<TestCustomSecurityInitializer.TestFillModel>(security.FillModel);\n        }\n\n        public class TestCustomSecurityInitializer : ISecurityInitializer\n        {\n            public int CallCount { get; private set; }\n\n            public class TestFillModel : FillModel { }\n\n            public void Initialize(Security security)\n            {\n                CallCount++;\n                security.SetFillModel(new TestFillModel());\n            }\n        }\n\n        public class TestBrokerageModel : DefaultBrokerageModel\n        {\n            public bool GetFillModelCalled { get; private set; }\n            public bool GetFeeModelCalled { get; private set; }\n            public bool GetSlippageModelCalled { get; private set; }\n            public bool GetSettlementModelCalled { get; private set; }\n            public bool GetBuyingPowerModelCalled { get; private set; }\n            public bool GetMarginInterestRateModelCalled { get; private set; }\n            public bool GetLeverageCalled { get; private set; }\n            public bool GetShortableProviderCalled { get; private set; }\n\n            public class TestFillModel : FillModel { }\n            public class TestFeeModel : FeeModel { }\n            public class TestSlippageModel : ISlippageModel\n            {\n                public decimal GetSlippageApproximation(Security asset, Order order)\n                {\n                    return 0;\n                }\n            }\n            public class TestSettlementModel : ImmediateSettlementModel { }\n            public class TestBuyingPowerModel : BuyingPowerModel { }\n            public class TestMarginInterestRateModel : IMarginInterestRateModel\n            {\n                public void ApplyMarginInterestRate(MarginInterestRateParameters marginInterestRateParameters)\n                {\n                }\n            }\n            public class TestShortableProvider : NullShortableProvider { }\n\n            public override IFillModel GetFillModel(Security security)\n            {\n                GetFillModelCalled = true;\n                return new TestFillModel();\n            }\n\n            public override IFeeModel GetFeeModel(Security security)\n            {\n                GetFeeModelCalled = true;\n                return new TestFeeModel();\n            }\n\n            public override ISlippageModel GetSlippageModel(Security security)\n            {\n                GetSlippageModelCalled = true;\n                return new TestSlippageModel();\n            }\n\n            public override ISettlementModel GetSettlementModel(Security security)\n            {\n                GetSettlementModelCalled = true;\n                return new TestSettlementModel();\n            }\n\n            public override IBuyingPowerModel GetBuyingPowerModel(Security security)\n            {\n                GetBuyingPowerModelCalled = true;\n                return new TestBuyingPowerModel();\n            }\n\n            public override IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n            {\n                GetMarginInterestRateModelCalled = true;\n                return new TestMarginInterestRateModel();\n            }\n\n            public override decimal GetLeverage(Security security)\n            {\n                GetLeverageCalled = true;\n                return 5000;\n            }\n\n            public override IShortableProvider GetShortableProvider(Security security)\n            {\n                GetShortableProviderCalled = true;\n                return new TestShortableProvider();\n            }\n        }\n\n        private static TestCaseData[] TestAddSecurityWithSymbol\n        {\n            get\n            {\n                var result = new List<TestCaseData>()\n                {\n                    new TestCaseData(Symbols.SPY, null),\n                    new TestCaseData(Symbols.EURUSD, null),\n                    new TestCaseData(Symbols.DE30EUR, null),\n                    new TestCaseData(Symbols.BTCUSD, null),\n                    new TestCaseData(Symbols.ES_Future_Chain, null),\n                    new TestCaseData(Symbols.Future_ESZ18_Dec2018, null),\n                    new TestCaseData(Symbols.SPY_Option_Chain, null),\n                    new TestCaseData(Symbols.SPY_C_192_Feb19_2016, null),\n                    new TestCaseData(Symbols.SPY_P_192_Feb19_2016, null),\n                    new TestCaseData(Symbol.Create(\"CustomData\", SecurityType.Base, Market.Binance), null),\n                    new TestCaseData(Symbol.Create(\"CustomData2\", SecurityType.Base, Market.COMEX), null)\n                };\n\n                foreach (var market in Market.SupportedMarkets())\n                {\n                    foreach (var kvp in SymbolPropertiesDatabase.FromDataFolder().GetSymbolPropertiesList(market))\n                    {\n                        var securityDatabaseKey = kvp.Key;\n                        if (securityDatabaseKey.SecurityType != SecurityType.FutureOption)\n                        {\n                            result.Add(new TestCaseData(Symbol.Create(securityDatabaseKey.Symbol, securityDatabaseKey.SecurityType,\n                                securityDatabaseKey.Market), null));\n                        }\n                    }\n                }\n\n                return result.ToArray();\n            }\n        }\n\n        private static DataNormalizationMode[] GetDataNormalizationModes()\n        {\n            return ((DataNormalizationMode[])Enum.GetValues(typeof(DataNormalizationMode)))\n                .Where(x => x != DataNormalizationMode.ScaledRaw).ToArray();\n        }\n\n        private static Func<QCAlgorithm, Security>[] FuturesTestCases\n        {\n            get\n            {\n                return new Func<QCAlgorithm, Security>[]\n                {\n                    (algo) => algo.AddFuture(Futures.Indices.VIX, Resolution.Minute, extendedMarketHours: true),\n                    (algo) => algo.AddFutureContract(Symbol.CreateFuture(Futures.Indices.VIX, Market.CFE, new DateTime(2022, 8, 1)),\n                        Resolution.Minute, extendedMarketHours: true)\n                };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmAddUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    public class AlgorithmAddUniverseTests\n    {\n        [TestCaseSource(nameof(ETFConstituentUniverseTestCases))]\n        public void AddUniverseWithETFConstituentUniverseDefinitionTicker(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, false, false, true);\n        }\n\n        [TestCaseSource(nameof(ETFConstituentUniverseTestCases))]\n        public void AddUniverseWithETFConstituentUniverseDefinitionTickerPython(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, false, true, true);\n        }\n        \n        [TestCaseSource(nameof(ETFConstituentUniverseTestCases))]\n        public void AddUniverseWithETFConstituentUniverseDefinitionSymbol(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, true, false, true);\n        }\n\n        [TestCaseSource(nameof(ETFConstituentUniverseTestCases))]\n        public void AddUniverseWithETFConstituentUniverseDefinitionSymbolPython(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, true, true, true);\n        }\n\n        [TestCaseSource(nameof(IndexConstituentUniverseTestCases))]\n        public void AddUniverseWithIndexConstituentUniverseDefinitionTicker(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, false, false, false);\n        }\n\n        [TestCaseSource(nameof(IndexConstituentUniverseTestCases))]\n        public void AddUniverseWithIndexConstituentUniverseDefinitionSymbol(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, true, false, false);\n        }\n\n        [TestCaseSource(nameof(IndexConstituentUniverseTestCases))]\n        public void AddUniverseWithIndexConstituentUniverseDefinitionTickerPython(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, false, true, false);\n        }\n\n        [TestCaseSource(nameof(IndexConstituentUniverseTestCases))]\n        public void AddUniverseWithIndexConstituentUniverseDefinitionSymbolPython(string ticker, string market)\n        {\n            AssertConstituentUniverseDefinitionsSymbol(ticker, market, true, true, false);\n        }\n\n        private void AssertConstituentUniverseDefinitionsSymbol(string ticker, string market, bool isSymbol, bool isPython, bool isEtf)\n        {\n            var algo = CreateAlgorithm();\n            algo.SetStartDate(2021, 8, 23);\n            algo.SetEndDate(2021, 8, 24);\n\n            Universe constituentUniverse;\n            var symbol = Symbol.Create(ticker, isEtf ? SecurityType.Equity : SecurityType.Index, market ?? Market.USA);\n\n            if (isSymbol && isEtf)\n            {\n                constituentUniverse = isPython\n                    ? algo.Universe.ETF(symbol, algo.UniverseSettings, (PyObject) null)\n                    : algo.Universe.ETF(symbol, algo.UniverseSettings, CreateReturnAllFunc());\n            }\n            else if (isEtf)\n            {\n                constituentUniverse = isPython\n                    ? algo.Universe.ETF(ticker, market, algo.UniverseSettings, (PyObject) null)\n                    : algo.Universe.ETF(ticker, market, algo.UniverseSettings, CreateReturnAllFunc());\n            }\n            else if (isSymbol)\n            {\n                constituentUniverse = isPython\n                    ? algo.Universe.Index(symbol, algo.UniverseSettings, (PyObject) null)\n                    : algo.Universe.Index(symbol, algo.UniverseSettings, CreateReturnAllFunc());\n            }\n            else\n            {\n                constituentUniverse = isPython\n                    ? algo.Universe.Index(ticker, market, algo.UniverseSettings, (PyObject) null)\n                    : algo.Universe.Index(ticker, market, algo.UniverseSettings, CreateReturnAllFunc());\n            }\n\n            Assert.IsTrue(constituentUniverse.Configuration.Symbol.HasUnderlying);\n            Assert.AreEqual(symbol, constituentUniverse.Configuration.Symbol.Underlying);\n            \n            Assert.AreEqual(symbol.SecurityType, constituentUniverse.Configuration.Symbol.SecurityType);\n            Assert.IsTrue(constituentUniverse.Configuration.Symbol.ID.Symbol.StartsWithInvariant(\"qc-universe-\"));\n        }\n        \n        private static TestCaseData[] ETFConstituentUniverseTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(\"SPY\", Market.USA),\n                new TestCaseData(\"SPY\", null),\n                new TestCaseData(\"GDVD\", Market.USA),\n                new TestCaseData(\"GDVD\", null)\n            };\n        }\n\n        private static TestCaseData[] IndexConstituentUniverseTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(\"SPX\", Market.USA),\n                new TestCaseData(\"SPX\", null),\n                new TestCaseData(\"NDX\", Market.USA),\n                new TestCaseData(\"NDX\", null)\n            };\n        }\n\n        private QCAlgorithm CreateAlgorithm()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            return algo;\n        }\n\n        private Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> CreateReturnAllFunc()\n        {\n            return x => x.Select(y => y.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmBenchmarkTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Packets;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Statistics;\nusing QuantConnect.Securities;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmBenchmarkTests\n    {\n        private TestBenchmarkAlgorithm _algorithm;\n\n        [TearDown]\n        public void TearDown()\n        {\n            Config.Reset();\n        }\n\n        [TestCase(SecurityType.Forex)]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Crypto)]\n        [TestCase(SecurityType.Index)]\n        [TestCase(SecurityType.Option)]\n        [TestCase(SecurityType.Future)]\n        [TestCase(SecurityType.Cfd)]\n        public void SetBenchmarksSecurityTypes(SecurityType securityType)\n        {\n\n            _algorithm = BenchmarkTestSetupHandler.TestAlgorithm = new TestBenchmarkAlgorithm(securityType);\n            _algorithm.StartDateToUse = new DateTime(2014, 05, 03);\n            _algorithm.EndDateToUse = new DateTime(2014, 05, 04);\n\n            var results = AlgorithmRunner.RunLocalBacktest(nameof(TestBenchmarkAlgorithm),\n                new Dictionary<string, string> { { PerformanceMetrics.TotalOrders, \"0\" } },\n                Language.CSharp,\n                AlgorithmStatus.Completed,\n                setupHandler: \"BenchmarkTestSetupHandler\");\n\n\n            var benchmark = _algorithm.Benchmark as SecurityBenchmark;\n            Assert.IsNotNull(benchmark);\n            Assert.AreEqual(securityType, benchmark.Security.Type);\n            Assert.IsNull(_algorithm.RunTimeError);\n        }\n\n        [TestCase(Resolution.Daily)]\n        [TestCase(Resolution.Hour)]\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Second)]\n        [TestCase(Resolution.Daily, true)]\n        [TestCase(Resolution.Hour, true)]\n        [TestCase(Resolution.Minute, true)]\n        [TestCase(Resolution.Second, true)]\n        public void MisalignedBenchmarkAndAlgorithmTimeZones(Resolution resolution, bool useUniverseSubscription = false)\n        {\n            // Verify that if we have algorithm:\n            // - subscribed to a daily resolution via universe or directly\n            // - a benchmark with timezone that is not algorithm time zone\n            // that we post an warning via log that statistics will be affected\n\n            // Setup a empty algorithm for the test\n            var algorithm = new QCAlgorithm();\n            var dataManager = new DataManagerStub(algorithm, new MockDataFeed(), liveMode: true);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            if (useUniverseSubscription)\n            {\n                // Change our universe resolution\n                algorithm.UniverseSettings.Resolution = resolution;\n            }\n            else\n            {\n                // subscribe to an equity in our provided resolution\n                algorithm.AddEquity(\"AAPL\", resolution);\n            }\n\n            // Default benchmark is SPY which is NY TimeZone,\n            // Set timezone to UTC.\n            algorithm.SetTimeZone(DateTimeZone.Utc);\n            algorithm.PostInitialize();\n\n            // Verify if our log is there (Should only be there in Daily case)\n            switch (resolution)\n            {\n                case Resolution.Daily:\n                    if (algorithm.LogMessages.TryPeek(out string result))\n                    {\n                        Assert.IsTrue(result.Contains(\"Using a security benchmark of a different timezone\", StringComparison.InvariantCulture));\n                    }\n                    else\n                    {\n                        Assert.Fail(\"Warning was not posted\");\n                    }\n                    break;\n                default:\n                    Assert.AreEqual(0, algorithm.LogMessages.Count);\n                    break;\n            }\n        }\n\n        [Test]\n        public void BenchmarkIsNotInitializeWithCustomSecurityInitializer()\n        {\n            var algorithm = new QCAlgorithm();\n            var dataManager = new DataManagerStub(algorithm, new MockDataFeed());\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            var securityInitializer = new CustomSecurityInitializer();\n            algorithm.SetSecurityInitializer(securityInitializer);\n\n            var spy = algorithm.AddEquity(\"SPY\");\n\n            algorithm.SetBenchmark(\"AAPL\");\n            var aapl = (algorithm.Benchmark as SecurityBenchmark).Security;\n\n            algorithm.PostInitialize();\n\n            Assert.IsTrue(securityInitializer.InitializedSecurities.Contains(spy));\n            Assert.IsFalse(securityInitializer.InitializedSecurities.Contains(aapl));\n        }\n\n        [Test]\n        public void BenchmarkIsNotAffectedBySecuritySeederDataNormalizationMode()\n        {\n            var algorithm = new TestBenchmarkDataNormalizationModeAlgorithm();\n            BenchmarkTestSetupHandler.TestAlgorithm = algorithm;\n            algorithm.StartDateToUse = new DateTime(2013, 10, 07);\n            algorithm.EndDateToUse = new DateTime(2013, 10, 11);\n\n            var results = AlgorithmRunner.RunLocalBacktest(nameof(TestBenchmarkAlgorithm),\n                new Dictionary<string, string> { { PerformanceMetrics.TotalOrders, \"0\" } },\n                Language.CSharp,\n                AlgorithmStatus.Completed,\n                setupHandler: nameof(BenchmarkTestSetupHandler));\n\n            var benchmark = algorithm.Benchmark as SecurityBenchmark;\n            Assert.IsNotNull(benchmark);\n            Assert.AreEqual(Symbols.SPY, benchmark.Security.Symbol);\n\n            // All values must be between 142 and 148 (expected adjusted data for the time range) for the benchmark\n            Assert.IsTrue(algorithm.BenchmarkValues.All(x => x >= 142m && x <= 148m),\n                $\"Benchmark values are:\\n{string.Join('\\n', algorithm.BenchmarkValues)}\");\n        }\n\n        public class BenchmarkTestSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            public static TestBenchmarkAlgorithm TestAlgorithm { get; set; }\n\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = TestAlgorithm;\n                return Algorithm;\n            }\n        }\n\n        public class TestBenchmarkAlgorithm : QCAlgorithm\n        {\n            private Symbol _symbol;\n\n            public SecurityType SecurityType { get; set; }\n\n            public DateTime StartDateToUse { get; set; }\n\n            public DateTime EndDateToUse { get; set; }\n\n            public int WarmUpDataCount { get; set; }\n\n            public TestBenchmarkAlgorithm(SecurityType securityType)\n            {\n                SecurityType = securityType;\n            }\n\n            public override void Initialize()\n            {\n                SetStartDate(StartDateToUse);\n                SetEndDate(EndDateToUse);\n\n                _symbol = Symbols.GetBySecurityType(SecurityType);\n                AddSecurity(_symbol);\n                SetBenchmark(_symbol);\n            }\n        }\n\n        public class TestBenchmarkDataNormalizationModeAlgorithm : TestBenchmarkAlgorithm\n        {\n            public List<decimal> BenchmarkValues { get; } = new();\n\n            public TestBenchmarkDataNormalizationModeAlgorithm()\n                : base(SecurityType.Equity)\n            {\n            }\n\n            public override void Initialize()\n            {\n                SetStartDate(StartDateToUse);\n                SetEndDate(EndDateToUse);\n\n                UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n                // If the benchmark is initialized using this security initializer, the security seeder would source data\n                // for using the data normalization mode from the UniverseSettings, which is set to Raw\n                SetSecurityInitializer(new BrokerageModelSecurityInitializer(BrokerageModel, new FuncSecuritySeeder(GetLastKnownPrices)));\n\n                SetBenchmark(\"SPY\");\n\n                Schedule.On(DateRules.EveryDay(), TimeRules.Every(TimeSpan.FromHours(1)), () =>\n                {\n                    var value = (Benchmark as SecurityBenchmark).Evaluate(UtcTime);\n                    BenchmarkValues.Add(value);\n                    Log($\"Benchmark: {value}\");\n                });\n            }\n        }\n\n        public class CustomSecurityInitializer : ISecurityInitializer\n        {\n            public HashSet<Security> InitializedSecurities { get; } = new();\n\n            public void Initialize(Security security)\n            {\n                InitializedSecurities.Add(security);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmChainsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmChainsTest\n    {\n        private QCAlgorithm _algorithm;\n        private BacktestingOptionChainProvider _optionChainProvider;\n        private BacktestingFutureChainProvider _futureChainProvider;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SetHistoryProvider(TestGlobals.HistoryProvider);\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n\n            _optionChainProvider = GetOptionChainProvider(TestGlobals.HistoryProvider);\n            _algorithm.SetOptionChainProvider(_optionChainProvider);\n\n            _futureChainProvider = GetFutureChainProvider(TestGlobals.HistoryProvider);\n            _algorithm.SetFutureChainProvider(_futureChainProvider);\n        }\n\n        private static TestCaseData[] OptionChainTestCases => new TestCaseData[]\n        {\n            // By underlying\n            new(Symbols.AAPL, new DateTime(2014, 06, 06, 12, 0, 0)),\n            new(Symbols.SPX, new DateTime(2021, 01, 04, 12, 0, 0)),\n            // By canonical\n            new(Symbol.CreateCanonicalOption(Symbols.AAPL), new DateTime(2014, 06, 06, 12, 0, 0)),\n            new(Symbol.CreateCanonicalOption(Symbols.SPX), new DateTime(2021, 01, 04, 12, 0, 0)),\n            new(Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 6, 19)), new DateTime(2020, 01, 05, 12, 0, 0)),\n        };\n\n        [TestCaseSource(nameof(OptionChainTestCases))]\n        public void GetsFullDataOptionChain(Symbol symbol, DateTime date)\n        {\n            _algorithm.SetDateTime(date.ConvertToUtc(_algorithm.TimeZone));\n            var optionContractsData = _algorithm.OptionChain(symbol).ToList();\n            Assert.IsNotEmpty(optionContractsData);\n\n            var optionContractsSymbols = _optionChainProvider.GetOptionContractList(symbol, date.Date).ToList();\n\n            CollectionAssert.AreEquivalent(optionContractsSymbols, optionContractsData.Select(x => x.Symbol));\n        }\n\n        private static TestCaseData[] PythonOptionChainTestCases => OptionChainTestCases.SelectMany(x =>\n        {\n            return new object[] { true, false }.Select(y => new TestCaseData(x.OriginalArguments.Concat(new[] { y }).ToArray()));\n        }).ToArray();\n\n        [TestCaseSource(nameof(PythonOptionChainTestCases))]\n        public void GetsFullDataOptionChainAsDataFrame(Symbol symbol, DateTime date, bool flatten)\n        {\n            _algorithm.SetPandasConverter();\n            _algorithm.SetDateTime(date.ConvertToUtc(_algorithm.TimeZone));\n\n            using var _ = Py.GIL();\n\n            using var dataFrame = _algorithm.OptionChain(symbol, flatten).DataFrame;\n            List<Symbol> symbols = null;\n\n            var expectedOptionContractsSymbols = _optionChainProvider.GetOptionContractList(symbol, date.Date).ToList();\n\n            if (flatten)\n            {\n                symbols = AssertFlattenedSingleChainDataFrame(dataFrame, symbol, hasCanonicalIndex: false);\n            }\n            else\n            {\n                var dfLength = dataFrame.GetAttr(\"shape\")[0].GetAndDispose<int>();\n                Assert.AreEqual(1, dfLength);\n\n                symbols = AssertUnflattenedSingleChainDataFrame<OptionContract>(dataFrame, symbol);\n            }\n\n            Assert.IsNotNull(symbols);\n            CollectionAssert.AreEquivalent(expectedOptionContractsSymbols, symbols);\n        }\n\n        [Test]\n        public void GetsMultipleFullDataOptionChainAsDataFrame([Values] bool flatten)\n        {\n            var date = new DateTime(2015, 12, 24, 12, 0, 0);\n            _algorithm.SetPandasConverter();\n            _algorithm.SetDateTime(date.ConvertToUtc(_algorithm.TimeZone));\n\n            using var _ = Py.GIL();\n\n            var symbols = new[] { Symbols.GOOG, Symbols.SPX };\n            using var dataFrame = _algorithm.OptionChains(symbols, flatten).DataFrame;\n\n            var expectedOptionChains = symbols.ToDictionary(x => x, x => _optionChainProvider.GetOptionContractList(x, date).ToList());\n\n            AssertMultiChainsDataFrame<OptionContract>(flatten, symbols, dataFrame, expectedOptionChains, isOptionChain: true);\n        }\n\n        private static List<Symbol> AssertFlattenedSingleChainDataFrame(PyObject dataFrame, Symbol symbol, bool hasCanonicalIndex = true,\n            bool isOptionChain = true)\n        {\n            PyObject subDataFrame = null;\n            try\n            {\n                subDataFrame = GetCanonicalSubDataFrame(dataFrame, symbol, isOptionChain, hasCanonicalIndex, out var canonicalSymbol);\n\n                using var dfColumns = subDataFrame.GetAttr(\"columns\");\n                using var dfColumnsList = dfColumns.InvokeMethod(\"tolist\");\n                using var dfColumnsIterator = dfColumnsList.GetIterator();\n                var columns = new List<string>();\n                foreach (PyObject item in dfColumnsIterator)\n                {\n                    columns.Add(item.ToString());\n                    item.DisposeSafely();\n                }\n\n                var expectedColumns = canonicalSymbol.SecurityType switch\n                {\n                    SecurityType.Future => new[] { \"expiry\", \"volume\", \"askprice\", \"asksize\", \"bidprice\", \"bidsize\", \"lastprice\", \"openinterest\" },\n                    SecurityType.FutureOption => new[]\n                    {\n                        \"expiry\", \"strike\", \"scaledstrike\", \"right\", \"style\", \"volume\", \"askprice\", \"asksize\", \"bidprice\", \"bidsize\",\n                        \"lastprice\", \"underlyingsymbol\", \"underlyinglastprice\"\n                    },\n                    _ => new[]\n                    {\n                        \"expiry\", \"strike\", \"scaledstrike\", \"right\", \"style\", \"volume\", \"askprice\", \"asksize\", \"bidprice\", \"bidsize\",\n                        \"lastprice\", \"openinterest\", \"impliedvolatility\", \"delta\", \"gamma\", \"vega\", \"theta\", \"rho\",\n                        \"underlyingsymbol\", \"underlyinglastprice\"\n                    }\n                };\n\n                CollectionAssert.AreEquivalent(expectedColumns, columns);\n                using var dfIndex = subDataFrame.GetAttr(\"index\");\n\n                return dfIndex.InvokeMethod(\"tolist\").GetAndDispose<List<Symbol>>();\n            }\n            finally\n            {\n                if (hasCanonicalIndex)\n                {\n                    subDataFrame?.DisposeSafely();\n                }\n            }\n        }\n\n        private static List<Symbol> AssertUnflattenedSingleChainDataFrame<T>(PyObject dataFrame, Symbol symbol, bool isOptionChain = true)\n            where T : BaseContract\n        {\n            using var subDataFrame = GetCanonicalSubDataFrame(dataFrame, symbol, isOptionChain, true, out _);\n\n            using var dfOptionChainList = subDataFrame[\"contracts\"];\n            var contracts = dfOptionChainList.GetAndDispose<IEnumerable<T>>().ToList();\n\n            return contracts.Select(x => x.Symbol).ToList();\n        }\n\n        private static PyObject GetCanonicalSubDataFrame(PyObject dataFrame, Symbol symbol, bool forOptionChain, bool hasCanonicalIndex,\n            out Symbol canonicalSymbol)\n        {\n            canonicalSymbol = symbol;\n            if (canonicalSymbol.SecurityType == SecurityType.Future && !forOptionChain)\n            {\n                canonicalSymbol = canonicalSymbol.Canonical;\n            }\n            else if (!canonicalSymbol.SecurityType.IsOption())\n            {\n                canonicalSymbol = Symbol.CreateCanonicalOption(symbol);\n            }\n\n            if (!hasCanonicalIndex)\n            {\n                return dataFrame;\n            }\n\n            using var pySymbol = canonicalSymbol.ToPython();\n            return dataFrame.GetAttr(\"loc\")[pySymbol];\n        }\n\n        private static IEnumerable<TestCaseData> GetOptionChainApisTestData()\n        {\n            var indexSymbol = Symbols.SPX;\n            var equitySymbol = Symbols.GOOG;\n            var futureSymbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 6, 19));\n\n            foreach (var withSecurityAdded in new[] { true, false })\n            {\n                var extendedMarketHoursCases = withSecurityAdded ? [true, false] : new[] { false };\n                foreach (var withExtendedMarketHours in extendedMarketHoursCases)\n                {\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 23, 23, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 0, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 1, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 2, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 6, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 12, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(indexSymbol, new DateTime(2015, 12, 24, 16, 0, 0), withSecurityAdded, withExtendedMarketHours);\n\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 0, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 1, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 2, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 6, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 12, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(equitySymbol, new DateTime(2015, 12, 24, 16, 0, 0), withSecurityAdded, withExtendedMarketHours);\n\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 04, 23, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 0, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 1, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 2, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 6, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 12, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 05, 16, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 0, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 1, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 2, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 6, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 12, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                    yield return new TestCaseData(futureSymbol, new DateTime(2020, 01, 06, 16, 0, 0), withSecurityAdded, withExtendedMarketHours);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetOptionChainApisTestData))]\n        public void OptionChainApisAreConsistent(Symbol symbol, DateTime dateTime, bool withSecurityAdded, bool withExtendedMarketHours)\n        {\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n\n            if (withSecurityAdded)\n            {\n                if (symbol.SecurityType == SecurityType.Future)\n                {\n                    var future = _algorithm.AddFuture(symbol.ID.Symbol, extendedMarketHours: withExtendedMarketHours);\n                    _algorithm.AddFutureOption(future.Symbol);\n                    _algorithm.AddFutureContract(symbol, extendedMarketHours: withExtendedMarketHours);\n                }\n                else\n                {\n                    _algorithm.AddSecurity(symbol, extendedMarketHours: withExtendedMarketHours);\n                }\n            }\n\n            var exchange  = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var chainFromAlgorithmApi = _algorithm.OptionChain(symbol).Select(x => x.Symbol).ToList();\n            var chainFromChainProviderApi = _optionChainProvider.GetOptionContractList(symbol,\n                dateTime.ConvertTo(_algorithm.TimeZone, exchange.TimeZone)).ToList();\n\n            CollectionAssert.IsNotEmpty(chainFromAlgorithmApi);\n            CollectionAssert.AreEquivalent(chainFromAlgorithmApi, chainFromChainProviderApi);\n        }\n\n        private static IEnumerable<TestCaseData> GetFutureChainApisTestData()\n        {\n            var futureSymbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 6, 19));\n            var canonicalFutureSymbol = futureSymbol.Canonical;\n            var futureOptionSymbol = Symbol.CreateOption(futureSymbol, futureSymbol.ID.Market, OptionStyle.American, OptionRight.Call,\n                75m, new DateTime(2020, 5, 19));\n\n            foreach (var symbol in new[] { futureSymbol, canonicalFutureSymbol, futureOptionSymbol })\n            {\n                foreach (var withFutureAdded in new[] { true, false })\n                {\n                    var extendedMarketHoursCases = withFutureAdded ? [true, false] : new[] { false };\n                    foreach (var withExtendedMarketHours in extendedMarketHoursCases)\n                    {\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 06, 23, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 0, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 1, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 2, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 6, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 12, 0, 0), withFutureAdded, withExtendedMarketHours);\n                        yield return new TestCaseData(symbol, new DateTime(2013, 10, 07, 16, 0, 0), withFutureAdded, withExtendedMarketHours);\n                    }\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetFutureChainApisTestData))]\n        public void FuturesChainApisAreConsistent(Symbol symbol, DateTime dateTime, bool withFutureAdded, bool withExtendedMarketHours)\n        {\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n\n            if (withFutureAdded)\n            {\n                // It should work regardless of whether the future is added to the algorithm\n                _algorithm.AddFuture(symbol.ID.Symbol, extendedMarketHours: withExtendedMarketHours);\n            }\n\n            var exchange = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var chainFromAlgorithmApi = _algorithm.FuturesChain(symbol).Select(x => x.Symbol).ToList();\n            var chainFromChainProviderApi = _futureChainProvider.GetFutureContractList(symbol,\n                dateTime.ConvertTo(_algorithm.TimeZone, exchange.TimeZone)).ToList();\n\n            CollectionAssert.IsNotEmpty(chainFromAlgorithmApi);\n            CollectionAssert.AreEquivalent(chainFromAlgorithmApi, chainFromChainProviderApi);\n        }\n\n        [Test]\n        public void GetsFullDataFuturesChainAsDataFrame([Values] bool flatten, [Values] bool withFutureAdded)\n        {\n            _algorithm.SetPandasConverter();\n            var date = new DateTime(2013, 10, 07);\n            _algorithm.SetDateTime(date.ConvertToUtc(_algorithm.TimeZone));\n\n            using var _ = Py.GIL();\n\n            // It should work regardless of whether the future is added to the algorithm\n            var symbol = withFutureAdded ? _algorithm.AddFuture(Futures.Indices.SP500EMini).Symbol : Symbols.ES_Future_Chain;\n            using var dataFrame = _algorithm.FuturesChain(symbol, flatten).DataFrame;\n            List<Symbol> symbols = null;\n\n            var exchange = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var exchangeTime = date.ConvertTo(_algorithm.TimeZone, exchange.TimeZone);\n            var expectedFutureContractSymbols = _futureChainProvider.GetFutureContractList(symbol, exchangeTime).ToList();\n\n            if (flatten)\n            {\n                symbols = AssertFlattenedSingleChainDataFrame(dataFrame, symbol, hasCanonicalIndex: false, isOptionChain: false);\n            }\n            else\n            {\n                var dfLength = dataFrame.GetAttr(\"shape\")[0].GetAndDispose<int>();\n                Assert.AreEqual(1, dfLength);\n\n                symbols = AssertUnflattenedSingleChainDataFrame<FuturesContract>(dataFrame, symbol, isOptionChain: false);\n            }\n\n            Assert.IsNotNull(symbols);\n            CollectionAssert.AreEquivalent(expectedFutureContractSymbols, symbols);\n        }\n\n        [Test]\n        public void GetsMultipleFullDataFuturesChainsAsDataFrame([Values] bool flatten, [Values] bool withFutureAdded)\n        {\n            var dateTime = new DateTime(2013, 10, 07, 12, 0, 0);\n            _algorithm.SetPandasConverter();\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n\n            using var _ = Py.GIL();\n\n            var symbols = withFutureAdded\n                ? new[] { Symbols.ES_Future_Chain, Symbols.CreateFuturesCanonicalSymbol(\"GC\") }\n                : new[] { _algorithm.AddFuture(Futures.Indices.SP500EMini).Symbol, _algorithm.AddFuture(\"GC\").Symbol };\n            using var dataFrame = _algorithm.FuturesChains(symbols, flatten).DataFrame;\n\n            var expectedFuturesChains = symbols.ToDictionary(x => x, x =>\n            {\n                var exchange = MarketHoursDatabase.FromDataFolder().GetExchangeHours(x.ID.Market, x, x.SecurityType);\n                return _futureChainProvider.GetFutureContractList(x, dateTime.ConvertTo(_algorithm.TimeZone, exchange.TimeZone)).ToList();\n            });\n\n            AssertMultiChainsDataFrame<FuturesContract>(flatten, symbols, dataFrame, expectedFuturesChains, isOptionChain: false);\n        }\n\n        private static TestCaseData[] FillForwardTestData => new[] { true, false }\n            .Select(useAlgorithmApi => new TestCaseData[]\n            {\n                new(Symbols.SPY_Option_Chain, new DateTime(2024, 01, 03), useAlgorithmApi),\n                new(Symbol.CreateCanonicalOption(Symbols.SPX), new DateTime(2021, 01, 08), useAlgorithmApi),\n                new(Symbol.CreateCanonicalOption(Symbols.CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2020, 03, 20))),\n                    new DateTime(2020, 01, 07),\n                    useAlgorithmApi),\n                new(Symbols.ES_Future_Chain, new DateTime(2020, 01, 07), useAlgorithmApi)\n            })\n            .SelectMany(x => x)\n            .ToArray();\n\n        [TestCaseSource(nameof(FillForwardTestData))]\n        public void FillForwardsChainFromPreviousTradableDateIfCurrentOneIsNotAvailable(Symbol symbol, DateTime dateTime, bool useAlgorithmApi)\n        {\n            var historyProvider = new FillForwardTestHistoryProvider(_algorithm.HistoryProvider);\n            _algorithm.SetHistoryProvider(historyProvider);\n            _algorithm.SetOptionChainProvider(GetOptionChainProvider(historyProvider));\n            _algorithm.SetFutureChainProvider(GetFutureChainProvider(historyProvider));\n\n            var exchange = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            _algorithm.SetTimeZone(exchange.TimeZone);\n\n            // Get the previous tradable date chain\n            var prevTradableDate = exchange.GetPreviousTradingDay(dateTime);\n\n            historyProvider.RequestDateTime = prevTradableDate;\n            historyProvider.SimulateMissingFile = false;\n            historyProvider.Requests.Clear();\n            var prevDateChain = GetChain(symbol, prevTradableDate, useAlgorithmApi);\n\n            Assert.AreEqual(1, historyProvider.Requests.Count);\n            Assert.AreEqual(1, historyProvider.Requests[0].Count);\n\n            // Get the current date chain, which should be fill-forwarded from the previous date\n            // because the universe file for the current date is missing\n            historyProvider.RequestDateTime = dateTime;\n            historyProvider.SimulateMissingFile = true;\n            historyProvider.Requests.Clear();\n            var currentDateChain = GetChain(symbol, dateTime, useAlgorithmApi);\n\n            Assert.AreEqual(2, historyProvider.Requests.Count);\n            var requestList1 = historyProvider.Requests[0];\n            Assert.AreEqual(1, requestList1.Count);\n            var requestList2 = historyProvider.Requests[1];\n            Assert.AreEqual(1, requestList2.Count);\n            var request1 = requestList1[0];\n            var request2 = requestList2[0];\n            Assert.AreEqual(request1.EndTimeLocal, request2.EndTimeLocal);\n            Assert.Less(request2.StartTimeLocal, request1.StartTimeLocal);\n\n            Assert.IsNotEmpty(currentDateChain);\n            Assert.IsNotEmpty(prevDateChain);\n            CollectionAssert.IsSubsetOf(currentDateChain, prevDateChain);\n            CollectionAssert.AreEquivalent(currentDateChain, prevDateChain.Where(symbol => symbol.ID.Date >= dateTime));\n        }\n\n        private List<Symbol> GetChain(Symbol symbol, DateTime date, bool useAlgorithmApi)\n        {\n            if (useAlgorithmApi)\n            {\n                _algorithm.SetDateTime(date.ConvertToUtc(_algorithm.TimeZone));\n\n                return symbol.SecurityType == SecurityType.Future\n                    ? _algorithm.FuturesChain(symbol).Select(x => x.Symbol).ToList()\n                    : _algorithm.OptionChain(symbol).Select(x => x.Symbol).ToList();\n            }\n\n            return symbol.SecurityType == SecurityType.Future\n                ? _algorithm.FutureChainProvider.GetFutureContractList(symbol, date).ToList()\n                : _algorithm.OptionChainProvider.GetOptionContractList(symbol, date).ToList();\n        }\n\n        private static void AssertMultiChainsDataFrame<T>(bool flatten, Symbol[] symbols, PyObject dataFrame,\n            Dictionary<Symbol, List<Symbol>> expectedChains, bool isOptionChain)\n            where T : BaseContract\n        {\n            var chainsTotalCount = expectedChains.Values.Sum(x => x.Count);\n\n            if (flatten)\n            {\n                var dfLength = dataFrame.GetAttr(\"shape\")[0].GetAndDispose<int>();\n                Assert.AreEqual(chainsTotalCount, dfLength);\n\n                Assert.Multiple(() =>\n                {\n                    foreach (var (symbol, expectedChain) in expectedChains)\n                    {\n                        var chainSymbols = AssertFlattenedSingleChainDataFrame(dataFrame, symbol, isOptionChain: isOptionChain);\n\n                        Assert.IsNotNull(chainSymbols);\n                        CollectionAssert.AreEquivalent(expectedChain, chainSymbols);\n                    }\n                });\n            }\n            else\n            {\n                var dfLength = dataFrame.GetAttr(\"shape\")[0].GetAndDispose<int>();\n                Assert.AreEqual(symbols.Length, dfLength);\n\n                Assert.Multiple(() =>\n                {\n                    foreach (var (symbol, expectedChain) in expectedChains)\n                    {\n                        var chainSymbols = AssertUnflattenedSingleChainDataFrame<T>(dataFrame, symbol, isOptionChain);\n\n                        Assert.IsNotNull(chainSymbols);\n                        CollectionAssert.AreEquivalent(expectedChain, chainSymbols);\n                    }\n                });\n            }\n        }\n\n        private class FillForwardTestHistoryProvider : IHistoryProvider\n        {\n            private readonly IHistoryProvider _historyProvider;\n\n            public DateTime RequestDateTime { get; set; }\n\n            public bool SimulateMissingFile { get; set; }\n\n            public List<List<HistoryRequest>> Requests { get; } = new();\n\n            public int DataPointCount => _historyProvider.DataPointCount;\n\n            public event EventHandler<InvalidConfigurationDetectedEventArgs> InvalidConfigurationDetected\n            {\n                add { _historyProvider.InvalidConfigurationDetected += value; }\n                remove { _historyProvider.InvalidConfigurationDetected -= value; }\n            }\n\n            public event EventHandler<NumericalPrecisionLimitedEventArgs> NumericalPrecisionLimited\n            {\n                add { _historyProvider.NumericalPrecisionLimited += value; }\n                remove { _historyProvider.NumericalPrecisionLimited -= value; }\n            }\n\n            public event EventHandler<DownloadFailedEventArgs> DownloadFailed\n            {\n                add { _historyProvider.DownloadFailed += value; }\n                remove { _historyProvider.DownloadFailed -= value; }\n            }\n\n            public event EventHandler<ReaderErrorDetectedEventArgs> ReaderErrorDetected\n            {\n                add { _historyProvider.ReaderErrorDetected += value; }\n                remove { _historyProvider.ReaderErrorDetected -= value; }\n            }\n\n            public event EventHandler<StartDateLimitedEventArgs> StartDateLimited\n            {\n                add { _historyProvider.StartDateLimited += value; }\n                remove { _historyProvider.StartDateLimited -= value; }\n            }\n\n            public FillForwardTestHistoryProvider(IHistoryProvider historyProvider)\n            {\n                _historyProvider = historyProvider;\n            }\n\n            public IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                // This test history provider will always be used for single requests\n                var historyRequests = requests.ToList();\n                Assert.AreEqual(1, historyRequests.Count);\n                Requests.Add(historyRequests);\n\n                var history = _historyProvider.GetHistory(historyRequests, sliceTimeZone).ToList();\n\n                // Let's ditch the last one to simulate a missing universe file\n                var toSkip = 0;\n                if (SimulateMissingFile)\n                {\n                    if (Requests.Count == 1)\n                    {\n                        toSkip = 1;\n                    }\n                    else\n                    {\n                        toSkip = Requests.Count - 1;\n                    }\n                }\n\n                return history.SkipLast(toSkip);\n            }\n\n            public void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n                _historyProvider.Initialize(parameters);\n            }\n        }\n\n        private static BacktestingOptionChainProvider GetOptionChainProvider(IHistoryProvider historyProvider)\n        {\n            var initParameters = new ChainProviderInitializeParameters(TestGlobals.MapFileProvider, historyProvider);\n            var optionChainProvider = new BacktestingOptionChainProvider();\n            optionChainProvider.Initialize(initParameters);\n            return optionChainProvider;\n        }\n\n        private static BacktestingFutureChainProvider GetFutureChainProvider(IHistoryProvider historyProvider)\n        {\n            var initParameters = new ChainProviderInitializeParameters(TestGlobals.MapFileProvider, historyProvider);\n            var futureChainProvider = new BacktestingFutureChainProvider();\n            futureChainProvider.Initialize(initParameters);\n            return futureChainProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmDownloadTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    // For now these tests are excluded from the Travis build because of occasional web server errors.\n    [TestFixture, Category(\"TravisExclude\")]\n    public class AlgorithmDownloadTests\n    {\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void Download_Without_Parameters_Successfully()\n        {\n            var algo = new QCAlgorithm();\n            using var api = new Api.Api();\n            algo.SetApi(api);\n            var content = string.Empty;\n            Assert.DoesNotThrow(() => content = algo.Download(\"https://www.quantconnect.com/\"));\n            Assert.IsNotEmpty(content);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void Download_With_CSharp_Parameter_Successfully()\n        {\n            var algo = new QCAlgorithm();\n            using var api = new Api.Api();\n            algo.SetApi(api);\n\n            var byteKey = Encoding.ASCII.GetBytes($\"UserName:Password\");\n            var headers = new List<KeyValuePair<string, string>>\n            {\n                new KeyValuePair<string, string>(\"Authorization\", $\"Basic ({Convert.ToBase64String(byteKey)})\")\n            };\n\n            var content = string.Empty;\n            Assert.DoesNotThrow(() => content = algo.Download(\"https://www.quantconnect.com/\", headers));\n            Assert.IsNotEmpty(content);\n        }\n\n        [Test]\n        public void Download_With_Python_Parameter_Successfully()\n        {\n            var algo = new QCAlgorithm();\n            using var api = new Api.Api();\n            algo.SetApi(api);\n\n            var byteKey = Encoding.ASCII.GetBytes($\"UserName:Password\");\n            var value = $\"Basic ({Convert.ToBase64String(byteKey)})\";\n\n            using (Py.GIL())\n            {\n                using var headers = new PyDict();\n                headers.SetItem(\"Authorization\".ToPython(), value.ToPython());\n\n                var content = string.Empty;\n                Assert.DoesNotThrow(() => content = algo.Download(\"https://www.quantconnect.com/\", headers));\n                Assert.IsNotEmpty(content);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmGetParameterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmGetParameterTests\n    {\n        [TestCase(Language.CSharp, \"numeric_parameter\", 2, false)]\n        [TestCase(Language.CSharp, \"not_a_parameter\", 2, true)]\n        [TestCase(Language.CSharp, \"string_parameter\", 2, true)]\n        [TestCase(Language.Python, \"numeric_parameter\", 2, false)]\n        [TestCase(Language.Python, \"not_a_parameter\", 2, true)]\n        [TestCase(Language.Python, \"string_parameter\", 2, true)]\n        public void GetParameterConvertsToNumericTypes(Language language, string parameterName, int defaultValue, bool shouldReturnDefaultValue)\n        {\n            var parameters = new Dictionary<string, string>\n            {\n                { \"numeric_parameter\", \"1\" },\n                { \"string_parameter\", \"string value\" },\n            };\n            var doubleDefaultValue = Convert.ToDouble(defaultValue);\n            var decimalDefaultValue = Convert.ToDecimal(defaultValue);\n\n            if (language == Language.CSharp)\n            {\n                var algorithm = new QCAlgorithm();\n                algorithm.SetParameters(parameters);\n\n                var intValue = algorithm.GetParameter(parameterName, defaultValue);\n                var doubleValue = algorithm.GetParameter(parameterName, doubleDefaultValue);\n                var decimalValue = algorithm.GetParameter(parameterName, decimalDefaultValue);\n\n                Assert.AreEqual(typeof(int), intValue.GetType());\n                Assert.AreEqual(typeof(double), doubleValue.GetType());\n                Assert.AreEqual(typeof(decimal), decimalValue.GetType());\n\n                // If the parameter is not found or is not numeric, the default value should be returned\n                if (!shouldReturnDefaultValue && parameters.TryGetValue(parameterName, out var parameterValue))\n                {\n                    Assert.AreEqual(int.Parse(parameterValue), intValue);\n                    Assert.AreEqual(double.Parse(parameterValue), doubleValue);\n                    Assert.AreEqual(decimal.Parse(parameterValue), decimalValue);\n                }\n                else\n                {\n                    Assert.AreEqual(defaultValue, intValue);\n                    Assert.AreEqual(doubleDefaultValue, doubleValue);\n                    Assert.AreEqual(decimalDefaultValue, decimalValue);\n                }\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getAlgorithm():\n    return QCAlgorithm()\n\ndef isInt(value):\n    return isinstance(value, int)\n\ndef isFloat(value):\n    return isinstance(value, float)\n        \");\n\n                    var getAlgorithm = testModule.GetAttr(\"getAlgorithm\");\n                    var algorithm = getAlgorithm.Invoke();\n                    algorithm.GetAttr(\"SetParameters\").Invoke(PyDict.FromManagedObject(parameters));\n\n                    var intValue = algorithm.GetAttr(\"GetParameter\").Invoke(parameterName.ToPython(), defaultValue.ToPython());\n                    var doubleValue = algorithm.GetAttr(\"GetParameter\").Invoke(parameterName.ToPython(), doubleDefaultValue.ToPython());\n                    var decimalValue = algorithm.GetAttr(\"GetParameter\").Invoke(parameterName.ToPython(), decimalDefaultValue.ToPython());\n\n                    Assert.IsTrue(testModule.GetAttr(\"isInt\").Invoke(intValue).As<bool>(),\n                        $\"Expected 'intValue' to be of type int but was {intValue.GetPythonType().ToString()} instead\");\n                    Assert.IsTrue(testModule.GetAttr(\"isFloat\").Invoke(doubleValue).As<bool>(),\n                        $\"Expected 'doubleValue' to be of type float but was {doubleValue.GetPythonType().ToString()} instead\");\n                    Assert.IsTrue(testModule.GetAttr(\"isFloat\").Invoke(decimalValue).As<bool>(),\n                        $\"Expected 'decimalValue' to be of type float but was {decimalValue.GetPythonType().ToString()} instead\");\n\n                    // If the parameter is not found or is not numeric, the default value should be returned\n                    if (!shouldReturnDefaultValue && parameters.TryGetValue(parameterName, out var parameterValue))\n                    {\n                        Assert.AreEqual(int.Parse(parameterValue), intValue.As<int>());\n                        Assert.AreEqual(double.Parse(parameterValue), doubleValue.As<double>());\n                        Assert.AreEqual(decimal.Parse(parameterValue), decimalValue.As<decimal>());\n                    }\n                    else\n                    {\n                        Assert.AreEqual(defaultValue, intValue.As<int>());\n                        Assert.AreEqual(doubleDefaultValue, doubleValue.As<double>());\n                        Assert.AreEqual(decimalDefaultValue, decimalValue.As<decimal>());\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp, \"numeric_parameter\")]\n        [TestCase(Language.CSharp, \"string_parameter\")]\n        [TestCase(Language.CSharp, \"not_a_parameter\")]\n        [TestCase(Language.Python, \"numeric_parameter\")]\n        [TestCase(Language.Python, \"string_parameter\")]\n        [TestCase(Language.Python, \"not_a_parameter\")]\n        public void GetsParameterWithoutADefaultValue(Language language, string parameterName)\n        {\n            var parameters = new Dictionary<string, string>\n            {\n                { \"numeric_parameter\", \"1\" },\n                { \"string_parameter\", \"string value\" },\n            };\n\n            if (language == Language.CSharp)\n            {\n                var algorithm = new QCAlgorithm();\n                algorithm.SetParameters(parameters);\n                var parameterWithoutDefault = algorithm.GetParameter(parameterName);\n                var parameterWithNullDefault = algorithm.GetParameter(parameterName, null);\n\n                if (parameters.TryGetValue(parameterName, out var parameterValue))\n                {\n                    Assert.AreEqual(typeof(string), parameterWithoutDefault.GetType());\n                    Assert.AreEqual(typeof(string), parameterWithNullDefault.GetType());\n                    Assert.AreEqual(parameterValue, parameterWithoutDefault);\n                    Assert.AreEqual(parameterValue, parameterWithNullDefault);\n                }\n                else\n                {\n                    Assert.IsNull(parameterWithoutDefault);\n                    Assert.IsNull(parameterWithNullDefault);\n                }\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getAlgorithm():\n    return QCAlgorithm()\n\ndef isString(value):\n    return isinstance(value, str)\n        \");\n\n                    dynamic getAlgorithm = testModule.GetAttr(\"getAlgorithm\");\n                    dynamic algorithm = getAlgorithm();\n                    algorithm.SetParameters(PyDict.FromManagedObject(parameters));\n                    dynamic parameterWithoutDefault = algorithm.GetParameter(parameterName.ToPython());\n                    dynamic parameterWithNullDefault = algorithm.GetParameter(parameterName.ToPython(), null);\n\n                    if (parameters.TryGetValue(parameterName, out var parameterValue))\n                    {\n                        dynamic isString = testModule.GetAttr(\"isString\");\n                        Assert.IsTrue(isString(parameterWithoutDefault).As<bool>(),\n                            $\"Expected 'parameterWithoutDefault' to be of type string but was {parameterWithoutDefault.GetPythonType().ToString()} instead\");\n                        Assert.IsTrue(isString(parameterWithNullDefault).As<bool>(),\n                        $\"Expected 'parameterWithNullDefault' to be of type string but was {parameterWithNullDefault.GetPythonType().ToString()} instead\");\n                        Assert.AreEqual(parameterValue, parameterWithoutDefault.As<string>());\n                        Assert.AreEqual(parameterValue, parameterWithNullDefault.As<string>());\n                    }\n                    else\n                    {\n                        Assert.IsNull(parameterWithoutDefault);\n                        Assert.IsNull(parameterWithNullDefault);\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetParameterCannotConvertoToNumberFromNonNumericValues(Language language)\n        {\n            var parameters = new Dictionary<string, string>\n            {\n                { \"date_parameter\", \"2022-8-8\" },\n                { \"string_parameter\", \"string value\" },\n            };\n            int defaultInt = 0;\n            double defaultDouble = 0;\n            decimal defaultDecimal = 0;\n            int intValue;\n            double doubleValue;\n            decimal decimalValue;\n\n            foreach (var parameterName in parameters.Keys)\n            {\n                if (language == Language.CSharp)\n                {\n                    var algorithm = new QCAlgorithm();\n                    algorithm.SetParameters(parameters);\n                    intValue = algorithm.GetParameter(parameterName, defaultInt);\n                    doubleValue = algorithm.GetParameter(parameterName, defaultDouble);\n                    decimalValue = algorithm.GetParameter(parameterName, defaultDecimal);\n                }\n                else\n                {\n                    using (Py.GIL())\n                    {\n                        var testModule = PyModule.FromString(\"testModule\",\n                            @\"\nfrom AlgorithmImports import *\n\ndef getAlgorithm():\n    return QCAlgorithm()\n            \");\n\n                        var getAlgorithm = testModule.GetAttr(\"getAlgorithm\");\n                        dynamic algorithm = getAlgorithm.Invoke();\n                        algorithm.GetAttr(\"SetParameters\").Invoke(PyDict.FromManagedObject(parameters));\n                        intValue = algorithm.GetParameter(parameterName.ToPython(), defaultInt.ToPython()).As<int>();\n                        doubleValue = algorithm.GetParameter(parameterName.ToPython(), defaultDouble.ToPython()).As<double>();\n                        decimalValue = algorithm.GetParameter(parameterName.ToPython(), defaultDecimal.ToPython()).As<decimal>();\n                    }\n                }\n\n                Assert.AreEqual(defaultInt, intValue, $\"Expected '{parameterName}' to be {defaultInt} but was {intValue} instead\");\n                Assert.AreEqual(defaultDouble, doubleValue, $\"Expected '{parameterName}' to be {defaultDouble} but was {doubleValue} instead\");\n                Assert.AreEqual(defaultDecimal, decimalValue, $\"Expected '{parameterName}' to be {defaultDecimal} but was {decimalValue} instead\");\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetParameterConvertsToFloatingPointTypesFromDifferentFormats(Language language)\n        {\n            var parameters = new Dictionary<string, string>\n            {\n                { \"int_parameter\", \"1\" },\n                { \"float_parameter\", \"1.0\" },\n                { \"comma_parameter\", \"1,234.56\" },\n                { \"scientific_parameter\", \"-1.643e6\" },\n            };\n            var expectedDoubles = new Dictionary<string, double>\n            {\n                { \"int_parameter\", 1.0 },\n                { \"float_parameter\", 1.0 },\n                { \"comma_parameter\", 1234.56 },\n                { \"scientific_parameter\", -1643000.0 },\n            };\n            var expectedDecimals = new Dictionary<string, decimal>\n            {\n                { \"int_parameter\", 1m },\n                { \"float_parameter\", 1m },\n                { \"comma_parameter\", 1234.56m },\n                { \"scientific_parameter\", -1643000m },\n            };\n            double defaultDouble = 0;\n            decimal defaultDecimal = 0;\n            double doubleValue;\n            decimal decimalValue;\n\n            foreach (var parameterName in parameters.Keys)\n            {\n                if (language == Language.CSharp)\n                {\n                    var algorithm = new QCAlgorithm();\n                    algorithm.SetParameters(parameters);\n                    doubleValue = algorithm.GetParameter(parameterName, defaultDouble);\n                    decimalValue = algorithm.GetParameter(parameterName, defaultDecimal);\n                }\n                else\n                {\n                    using (Py.GIL())\n                    {\n                        var testModule = PyModule.FromString(\"testModule\",\n                            @\"\nfrom AlgorithmImports import *\n\ndef getAlgorithm():\n    return QCAlgorithm()\n            \");\n\n                        var getAlgorithm = testModule.GetAttr(\"getAlgorithm\");\n                        dynamic algorithm = getAlgorithm.Invoke();\n                        algorithm.GetAttr(\"SetParameters\").Invoke(PyDict.FromManagedObject(parameters));\n                        doubleValue = algorithm.GetParameter(parameterName.ToPython(), defaultDouble.ToPython()).As<double>();\n                        decimalValue = algorithm.GetParameter(parameterName.ToPython(), defaultDecimal.ToPython()).As<decimal>();\n                    }\n                }\n\n                Assert.AreEqual(expectedDoubles[parameterName], doubleValue,\n                    $\"Expected '{parameterName}' to be {expectedDoubles[parameterName]} but was {doubleValue} instead\");\n                Assert.AreEqual(expectedDecimals[parameterName], decimalValue,\n                    $\"Expected '{parameterName}' to be {expectedDecimals[parameterName]} but was {decimalValue} instead\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmHistoryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing System.IO;\nusing System.Linq;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Python;\nusing System.Globalization;\nusing QuantConnect.Packets;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.Storage;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmHistoryTests\n    {\n        private QCAlgorithm _algorithm;\n        private TestHistoryProvider _testHistoryProvider;\n        private IDataProvider _dataProvider;\n        private IMapFileProvider _mapFileProvider;\n        private IDataCacheProvider _cacheProvider;\n        private IFactorFileProvider _factorFileProvider;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _algorithm.HistoryProvider = _testHistoryProvider = new TestHistoryProvider();\n        }\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            _dataProvider = TestGlobals.DataProvider;\n            _mapFileProvider = TestGlobals.MapFileProvider;\n            _factorFileProvider = TestGlobals.FactorFileProvider;\n            _cacheProvider = TestGlobals.DataCacheProvider;\n            FundamentalService.Initialize(_dataProvider, new NullFundamentalDataProvider(), false);\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void FundamentalHistory(Language language)\n        {\n            var start = new DateTime(2014, 04, 07);\n            _algorithm = GetAlgorithm(start);\n\n            if (language == Language.CSharp)\n            {\n                var result = _algorithm.History<Fundamental>(new[] { Symbols.SPY }, 10).ToList();\n\n                Assert.AreEqual(10, result.Count);\n                Assert.IsTrue(result.All(fundamentals =>\n                {\n                    Assert.AreEqual(1, fundamentals.Count);\n                    Assert.IsTrue(fundamentals.Values.All(x => !x.FinancialStatements.CashFlowStatement.CashFlowFromContinuingFinancingActivities.HasValue));\n                    return fundamentals.Values.All(x => double.IsNaN(x.FinancialStatements.CashFlowStatement.CashFlowFromContinuingFinancingActivities));\n                }));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getHistory(algorithm, symbol):\n    return algorithm.History(Fundamental, symbol, 10)\n        \").GetAttr(\"getHistory\");\n                    _algorithm.SetPandasConverter();\n\n                    var result = getHistory.Invoke(_algorithm.ToPython(), Symbols.SPY.ToPython());\n                    Assert.AreEqual(10, result.GetAttr(\"shape\")[0].As<int>());\n\n                    dynamic subDataFrame = result.GetAttr(\"loc\")[Symbols.SPY.ID.ToString()];\n\n                    for (var i = 0; i < 10; i++)\n                    {\n                        var index = subDataFrame.index[i];\n                        var series = subDataFrame.loc[index];\n                        var cashFlow = (double)series.financialstatements.CashFlowStatement.CashFlowFromContinuingFinancingActivities.Value;\n                        Assert.AreEqual(double.NaN, cashFlow);\n                    }\n                }\n            }\n        }\n\n        [TestCase(Resolution.Daily, Language.CSharp, 2)]\n        [TestCase(Resolution.Hour, Language.CSharp, 14)]\n        [TestCase(Resolution.Minute, Language.CSharp, 780)]\n        [TestCase(Resolution.Second, Language.CSharp, 45676)]\n        [TestCase(Resolution.Daily, Language.Python, 2)]\n        [TestCase(Resolution.Hour, Language.Python, 14)]\n        [TestCase(Resolution.Minute, Language.Python, 780)]\n        [TestCase(Resolution.Second, Language.Python, 45676)]\n        public void TickResolutionSubscriptionHistoryRequestOtherResolution(Resolution resolution, Language language, int expectedHistoryCount)\n        {\n            var start = new DateTime(2013, 10, 07);\n            _algorithm = GetAlgorithm(start.AddDays(2));\n\n            _algorithm.AddEquity(Symbols.SPY.Value, Resolution.Tick);\n\n            if (language == Language.CSharp)\n            {\n                // Trades and quotes\n                var result = _algorithm.History(new[] { Symbols.SPY }, start, _algorithm.Time, resolution).ToList();\n\n                var expectedSpan = resolution == Resolution.Daily ? TimeSpan.FromHours(6.5) : resolution.ToTimeSpan();\n                Assert.AreEqual(expectedHistoryCount, result.Count);\n                Assert.IsTrue(result.All(slice =>\n                {\n                    foreach (var bar in slice.Bars.Values)\n                    {\n                        return (bar.EndTime - bar.Time) == expectedSpan;\n                    }\n                    foreach (var bar in slice.QuoteBars.Values)\n                    {\n                        return (bar.EndTime - bar.Time) == expectedSpan;\n                    }\n\n                    return false;\n                }));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getHistory(algorithm, symbol, start, resolution):\n    return algorithm.History(symbol, start, algorithm.Time, resolution).loc[symbol]\n        \").GetAttr(\"getHistory\");\n\n                    _algorithm.SetPandasConverter();\n\n                    var result = getHistory.Invoke(_algorithm.ToPython(), Symbols.SPY.ToPython(), start.ToPython(), resolution.ToPython());\n                    Assert.AreEqual(expectedHistoryCount, result.GetAttr(\"shape\")[0].As<int>());\n\n                    var times = result.GetAttr(\"index\").GetAttr(\"tolist\").Invoke().As<List<DateTime>>();\n\n                    var prevDateTime = times[0].Subtract(resolution.ToTimeSpan());\n                    Assert.IsTrue(times.Any(time =>\n                    {\n                        var timeSpan = time - prevDateTime;\n                        prevDateTime = time;\n                        return timeSpan == resolution.ToTimeSpan();\n                    }));\n                }\n            }\n        }\n\n        [Test]\n        public void GetHistoryWithCustomDataAndUnsortedData()\n        {\n            var customDataKey = \"CustomData/ExampleCustomData\";\n\n            var customData = new string[] {\n                \"2024-10-03 19:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\",\n                \"2024-10-02 18:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\",\n                \"2024-10-01 17:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\",\n                \"2024-09-30 11:00:00,6000.5,6019,5951.15,6009,127707078,6591.27\",\n                \"2024-09-27 10:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\",\n                \"2024-09-26 09:00:00,5869.9,5879.35,5802.85,5816.7,117516350,4820.53\",\n                \"2024-09-25 08:00:00,5834.6,5864.95,5834.6,5859,110427867,4661.55\",\n                \"2024-09-24 07:00:00,5833.15,5833.85,5775.55,5811.55,127624733,4823.52\",\n                \"2024-09-23 06:00:00,5889.95,5900.45,5858.45,5867.9,123586417,4303.93\",\n                \"2024-09-20 05:00:00,5794.75,5848.2,5786.05,5836.95,151929179,5429.87\",\n                \"2024-09-19 04:00:00,5811.95,5815,5760.4,5770.9,160523863,5219.24\",\n                \"2024-09-18 03:00:00,5885.5,5898.8,5852.3,5857.55,145721790,5163.09\",\n                \"2024-09-17 02:00:00,5834.1,5904.35,5822.2,5898.85,144794030,5405.72\",\n                \"2024-09-16 01:00:00,5749.5,5852.95,5749.5,5842.2,214402430,8753.33\",\n                \"2024-09-13 16:00:00,5894.5,5948.85,5887.95,5935.1,120195681,4882.29\",\n                \"2024-09-12 15:00:00,5984.7,6051.1,5974.55,6038.05,171728134,7774.83\",\n                \"2024-09-11 14:00:00,5972.25,5989.8,5926.75,5973.3,191516153,8349.59\",\n                \"2024-09-10 13:00:00,5930.8,5966.05,5910.95,5955.25,151162819,5915.8\",\n                \"2024-09-09 12:00:00,5991.2,6038.2,5980.95,6030.8,116275729,4641.97\"\n            };\n\n            var endDateAlgorithm = new DateTime(2024, 10, 4);\n            var algorithm = GetAlgorithm(endDateAlgorithm.AddDays(1));\n\n            ExampleCustomDataWithSort.CustomDataKey = customDataKey;\n\n            var customSymbol = algorithm.AddData<ExampleCustomDataWithSort>(\"ExampleCustomData\", Resolution.Daily).Symbol;\n\n            algorithm.ObjectStore.Save(customDataKey, string.Join(\"\\n\", customData));\n\n            var history = algorithm.History<ExampleCustomDataWithSort>(customSymbol, algorithm.StartDate, algorithm.EndDate, Resolution.Daily).ToList();\n\n            Assert.IsNotEmpty(history);\n            Assert.That(history.Count, Is.EqualTo(customData.Length));\n\n            for (int i = 0; i < history.Count - 1; i++)\n            {\n                if (history[i].EndTime > history[i + 1].EndTime)\n                {\n                    Assert.Fail($\"Order failure: {history[i].EndTime} > {history[i + 1].EndTime} at index {i}.\");\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TickResolutionHistoryRequest(Language language)\n        {\n            var start = new DateTime(2013, 10, 07);\n            _algorithm = GetAlgorithm(start.AddDays(1));\n\n            if (language == Language.CSharp)\n            {\n                var historyStart = start.AddHours(9.5);\n                var historyEnd = historyStart.AddSeconds(5);\n                var result = _algorithm.History(new[] { Symbols.SPY }, historyStart, historyEnd, Resolution.Tick).ToList();\n                var result2 = _algorithm.History<Tick>(Symbols.SPY, historyStart, historyEnd, Resolution.Tick).ToList();\n\n                Assert.IsNotEmpty(result);\n                Assert.IsNotEmpty(result2);\n\n                Assert.IsTrue(result2.Any(tick => tick.TickType == TickType.Trade));\n                Assert.IsTrue(result2.Any(tick => tick.TickType == TickType.Quote));\n\n                var resultTickCount = result.Sum(slice => slice.Ticks[Symbols.SPY].Count);\n                Assert.AreEqual(resultTickCount, result2.Count);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var pythonModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getTradesAndQuotesHistory(algorithm, symbol, start):\n    return algorithm.History([symbol], start + timedelta(hours=12), start + timedelta(hours=12.2), Resolution.Second).loc[symbol].to_dict()\n\ndef getTradesOnlyHistory(algorithm, symbol, start):\n    history_start = start + timedelta(hours=9.5)\n    history_end = history_start + timedelta(seconds=5)\n    return algorithm.History(Tick, symbol, history_start, history_end, Resolution.Tick).loc[symbol].to_dict()\n        \");\n                    using var getTradesAndQuotesHistory = pythonModule.GetAttr(\"getTradesAndQuotesHistory\");\n                    using var getTradesOnlyHistory = pythonModule.GetAttr(\"getTradesOnlyHistory\");\n                    _algorithm.SetPandasConverter();\n                    using var pySymbol = Symbols.SPY.ToPython();\n                    using var pyAlgorithm = _algorithm.ToPython();\n                    using var pyStart = start.ToPython();\n\n                    using var dict = getTradesAndQuotesHistory.Invoke(pyAlgorithm, pySymbol, pyStart);\n                    var result = GetDataFrameDictionary<dynamic>(dict);\n                    using var dict2 = getTradesOnlyHistory.Invoke(pyAlgorithm, pySymbol, pyStart);\n                    var result2 = GetDataFrameDictionary<dynamic>(dict2);\n\n                    Assert.IsNotEmpty(result);\n                    Assert.IsNotEmpty(result2);\n\n                    CollectionAssert.AreNotEquivalent(result.Keys, result2.Keys);\n                    CollectionAssert.IsNotSubsetOf(result2.Keys, result.Keys);\n                }\n            }\n        }\n\n        [Test]\n        public void ImplicitTickResolutionHistoryRequestTradeBarDoesNotThrowsException()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 1));\n            algorithm.SetStartDate(2013, 10, 8);\n            var spy = algorithm.AddEquity(\"SPY\", Resolution.Tick).Symbol;\n            Assert.AreEqual(100, algorithm.History(spy, 100).Count());\n        }\n\n        [Test]\n        public void ExplicitTickResolutionHistoryRequestTradeBarApiThrowsException()\n        {\n            var spy = _algorithm.AddEquity(\"SPY\", Resolution.Tick).Symbol;\n            Assert.Throws<InvalidOperationException>(() => _algorithm.History(spy, 1, Resolution.Tick).ToList());\n        }\n\n        [TestCase(Resolution.Tick, Resolution.Tick, true)]\n        [TestCase(Resolution.Tick, Resolution.Second, true)]\n        [TestCase(Resolution.Tick, Resolution.Minute, true)]\n        [TestCase(Resolution.Tick, Resolution.Hour, true)]\n        [TestCase(Resolution.Tick, Resolution.Daily, true)]\n        [TestCase(Resolution.Second, Resolution.Tick, true)]\n        [TestCase(Resolution.Second, Resolution.Second, true)]\n        [TestCase(Resolution.Second, Resolution.Minute, true)]\n        [TestCase(Resolution.Second, Resolution.Hour, true)]\n        [TestCase(Resolution.Second, Resolution.Daily, true)]\n        [TestCase(Resolution.Minute, Resolution.Tick, true)]\n        [TestCase(Resolution.Minute, Resolution.Second, true)]\n        [TestCase(Resolution.Minute, Resolution.Minute, true)]\n        [TestCase(Resolution.Minute, Resolution.Hour, true)]\n        [TestCase(Resolution.Minute, Resolution.Daily, true)]\n        [TestCase(Resolution.Hour, Resolution.Tick, false)]\n        [TestCase(Resolution.Hour, Resolution.Second, false)]\n        [TestCase(Resolution.Hour, Resolution.Minute, false)]\n        [TestCase(Resolution.Hour, Resolution.Hour, false)]\n        [TestCase(Resolution.Hour, Resolution.Daily, false)]\n        [TestCase(Resolution.Daily, Resolution.Tick, false)]\n        [TestCase(Resolution.Daily, Resolution.Second, false)]\n        [TestCase(Resolution.Daily, Resolution.Minute, false)]\n        [TestCase(Resolution.Daily, Resolution.Hour, false)]\n        [TestCase(Resolution.Daily, Resolution.Daily, false)]\n        public void VerifyReceivedDataBasedOnHistoryResolutionOnly(Resolution historyResolution, Resolution equityResolution, bool expected)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 1));\n            algorithm.SetStartDate(2013, 10, 8);\n            var spy = algorithm.AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            var ibm = algorithm.AddEquity(\"IBM\", equityResolution).Symbol;\n\n            // Flags to check if there's Quote data for SPY and IBM\n            var spyFlag = false;\n            var ibmFlag = false;\n\n            // If the history resolution is Tick, check for Quote-type ticks\n            if (historyResolution == Resolution.Tick)\n            {\n                var start = new DateTime(2013, 10, 7, 9, 30, 0);\n                var allHistory = algorithm.History(new[] { spy, ibm }, start, start.AddSeconds(5), historyResolution).SelectMany(slice => slice.AllData);\n                // Filter the data to get only the Quote-type ticks\n                var ticks = allHistory.OfType<Tick>().Where(e => e.TickType == TickType.Quote).ToList();\n                spyFlag = ticks.Any(e => e.Symbol == spy);\n                ibmFlag = ticks.Any(e => e.Symbol == ibm);\n            }\n            else\n            {\n                var period = historyResolution != Resolution.Second ? TimeSpan.FromDays(1) : TimeSpan.FromHours(12);\n                var allHistory = algorithm.History(new[] { spy, ibm }, period, historyResolution).SelectMany(slice => slice.AllData).ToList();\n                // Checking for QuoteBar data for SPY and IBM\n                var quoteBars = allHistory.Where(e => e.DataType == MarketDataType.QuoteBar).ToList();\n                spyFlag |= quoteBars.Any(e => e.Symbol == spy);\n                ibmFlag |= quoteBars.Any(e => e.Symbol == ibm);\n            }\n\n            // Assert that the flags match the expected value\n            Assert.AreEqual(expected, spyFlag);\n            Assert.AreEqual(expected, ibmFlag);\n        }\n\n        [Test]\n        public void VerifyHistorySupportsSpecificDataTypes()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n            algorithm.SetStartDate(2013, 10, 10);\n            var spy = algorithm.AddEquity(\"SPY\", Resolution.Minute).Symbol;\n            var ibm = algorithm.AddEquity(\"IBM\", Resolution.Hour).Symbol;\n\n            var tradeBarHistory = algorithm.History<TradeBar>(new[] { spy, ibm }, TimeSpan.FromDays(1), Resolution.Minute).ToList();\n            var generalHistory = algorithm.History(new[] { spy, ibm }, TimeSpan.FromDays(1), Resolution.Minute).ToList();\n\n            // Extract all TradeBars\n            var tradeBars = tradeBarHistory.SelectMany(slice => slice.Values).ToList();\n\n            // Filter and extract only TradeBars from the general history\n            var filteredTradeBars = generalHistory.SelectMany(slice => slice.AllData).Where(e => e.DataType == MarketDataType.TradeBar).ToList();\n\n            // Assert that the count of TradeBars in both methods is consistent\n            Assert.AreEqual(filteredTradeBars.Count, tradeBars.Count);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TickResolutionPeriodBasedHistoryRequestThrowsException(Language language)\n        {\n            var spy = _algorithm.AddEquity(\"SPY\", Resolution.Tick).Symbol;\n\n            if (language == Language.CSharp)\n            {\n                Assert.Throws<InvalidOperationException>(() => _algorithm.History<Tick>(spy, 1).ToList());\n                Assert.Throws<InvalidOperationException>(() => _algorithm.History<Tick>(spy, 1, Resolution.Tick).ToList());\n                Assert.Throws<InvalidOperationException>(() => _algorithm.History<Tick>(new[] { spy }, 1).ToList());\n                Assert.Throws<InvalidOperationException>(() => _algorithm.History<Tick>(new[] { spy }, 1, Resolution.Tick).ToList());\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n\n                    foreach (var testCase in new[] { \"return algorithm.History(Tick, symbol, 1)\", \"return algorithm.History(Tick, symbol, 1)\",\n                        \"return algorithm.History(Tick, [ symbol ], 1)\", \"return algorithm.History(Tick, [ symbol ], 1, Resolution.Tick)\" })\n                    {\n                        dynamic getTickHistory = PyModule.FromString(\"testModule\",\n                            @\"from AlgorithmImports import *\n\ndef getTickHistory(algorithm, symbol):\n    \" + testCase).GetAttr(\"getTickHistory\");\n\n                        Assert.Throws<ClrBubbledException>(() => getTickHistory(_algorithm, spy));\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void TickResolutionHistoryRequestTradeBarApiThrowsException()\n        {\n            Assert.Throws<InvalidOperationException>(\n                () => _algorithm.History(Symbols.SPY, 1, Resolution.Tick).ToList());\n\n            Assert.Throws<InvalidOperationException>(\n                () => _algorithm.History(Symbols.SPY, TimeSpan.FromSeconds(2), Resolution.Tick).ToList());\n\n            Assert.Throws<InvalidOperationException>(\n                () => _algorithm.History(Symbols.SPY, DateTime.UtcNow.AddDays(-1), DateTime.UtcNow, Resolution.Tick).ToList());\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetsTickResolutionHistoricalDataWithoutATickSubscription(Language language)\n        {\n            var spy = _algorithm.AddEquity(\"SPY\", Resolution.Daily).Symbol;\n            var ibm = _algorithm.AddEquity(\"IBM\", Resolution.Daily).Symbol;\n            _algorithm.SetStartDate(2014, 6, 10);\n            var start = new DateTime(2013, 10, 7);\n            var end = new DateTime(2013, 10, 8);\n            _algorithm.SetStartDate(2013, 10, 8);\n\n            _testHistoryProvider.Slices = new[]\n            {\n                new Slice(start, new[] { new Tick(start, spy, 100, 100) { TickType = TickType.Trade } }, start),\n                new Slice(start, new[] { new Tick(start, ibm, 200, 200) { TickType = TickType.Trade } }, start),\n                new Slice(end, new[] { new Tick(end, spy, 110, 110) { TickType = TickType.Trade }, new Tick(end, ibm, 210, 210) { TickType = TickType.Trade } }, end)\n            }.ToList();\n\n            if (language == Language.CSharp)\n            {\n                var spyHistory = _algorithm.History<Tick>(spy, start, end, Resolution.Tick);\n                Assert.AreEqual(2, spyHistory.Count());\n\n                var ibmHistory = _algorithm.History<Tick>(ibm, start, end, Resolution.Tick);\n                Assert.AreEqual(2, ibmHistory.Count());\n\n                var allHistory = _algorithm.History<Tick>(new[] { spy, ibm }, start, end, Resolution.Tick);\n                Assert.AreEqual(3, allHistory.Count());\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getTickHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getTickHistory(algorithm, symbol, start, end):\n    history = algorithm.History(Tick, symbol, start, end, Resolution.Tick)\n    history = history if isinstance(symbol, list) else history.loc[symbol]\n\n    return history.values.tolist()\n\n        \").GetAttr(\"getTickHistory\");\n\n                    _algorithm.SetPandasConverter();\n                    using var pyAlgorithm = _algorithm.ToPython();\n                    using var pySpy = spy.ToPython();\n                    using var pyIbm = ibm.ToPython();\n                    using var pySymbols = new PyList(new[] { pySpy, pyIbm });\n                    using var pyStart = start.ToPython();\n                    using var pyEnd = end.ToPython();\n\n                    var spyHistory = getTickHistory.Invoke(pyAlgorithm, pySpy, pyStart, pyEnd).As<List<dynamic>>();\n                    Assert.AreEqual(2, spyHistory.Count);\n\n                    var ibmHistory = getTickHistory.Invoke(pyAlgorithm, pyIbm, pyStart, pyEnd).As<List<dynamic>>();\n                    Assert.AreEqual(2, ibmHistory.Count);\n\n                    var allHistory = getTickHistory.Invoke(pyAlgorithm, pySymbols, pyStart, pyEnd).As<List<dynamic>>();\n                    Assert.AreEqual(4, allHistory.Count);\n                }\n            }\n        }\n\n        [TestCase(Resolution.Second, Language.CSharp, true)]\n        [TestCase(Resolution.Minute, Language.CSharp, true)]\n        [TestCase(Resolution.Hour, Language.CSharp, true)]\n        [TestCase(Resolution.Daily, Language.CSharp, true)]\n        [TestCase(Resolution.Second, Language.Python, true)]\n        [TestCase(Resolution.Minute, Language.Python, true)]\n        [TestCase(Resolution.Hour, Language.Python, true)]\n        [TestCase(Resolution.Daily, Language.Python, true)]\n        [TestCase(Resolution.Second, Language.CSharp, false)]\n        [TestCase(Resolution.Minute, Language.CSharp, false)]\n        [TestCase(Resolution.Hour, Language.CSharp, false)]\n        [TestCase(Resolution.Daily, Language.CSharp, false)]\n        [TestCase(Resolution.Second, Language.Python, false)]\n        [TestCase(Resolution.Minute, Language.Python, false)]\n        [TestCase(Resolution.Hour, Language.Python, false)]\n        [TestCase(Resolution.Daily, Language.Python, false)]\n        public void TimeSpanHistoryRequestIsCorrectlyBuilt(Resolution resolution, Language language, bool symbolAlreadyAdded)\n        {\n            _algorithm.SetStartDate(2013, 10, 07);\n            _algorithm.Settings.SeedInitialPrices = false;\n\n            var symbol = Symbols.SPY;\n            if (symbolAlreadyAdded)\n            {\n                // it should not matter\n                _algorithm.AddEquity(\"SPY\");\n            }\n            if (language == Language.CSharp)\n            {\n                _algorithm.History(symbol, TimeSpan.FromSeconds(2), resolution);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n                    _algorithm.History(symbol.ToPython(), TimeSpan.FromSeconds(2), resolution);\n                }\n            }\n\n            Resolution? fillForwardResolution = null;\n            if (resolution != Resolution.Tick)\n            {\n                fillForwardResolution = resolution;\n            }\n\n            var expectedCount = resolution == Resolution.Hour || resolution == Resolution.Daily ? 1 : 2;\n            Assert.AreEqual(expectedCount, _testHistoryProvider.HistryRequests.Count);\n            Assert.AreEqual(symbol, _testHistoryProvider.HistryRequests.First().Symbol);\n            Assert.AreEqual(resolution, _testHistoryProvider.HistryRequests.First().Resolution);\n            Assert.IsFalse(_testHistoryProvider.HistryRequests.First().IncludeExtendedMarketHours);\n            Assert.IsFalse(_testHistoryProvider.HistryRequests.First().IsCustomData);\n            Assert.AreEqual(fillForwardResolution, _testHistoryProvider.HistryRequests.First().FillForwardResolution);\n            Assert.AreEqual(DataNormalizationMode.Adjusted, _testHistoryProvider.HistryRequests.First().DataNormalizationMode);\n            Assert.AreEqual(expectedCount == 1 ? TickType.Trade : TickType.Quote, _testHistoryProvider.HistryRequests.First().TickType);\n        }\n\n        private static IEnumerable<TestCaseData> BarCountHistoryRequestTestCases\n        {\n            get\n            {\n                var spyDate = new DateTime(2013, 10, 07);\n\n                yield return new TestCaseData(Resolution.Second, Language.CSharp, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Minute, Language.CSharp, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Hour, Language.CSharp, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Second, Language.Python, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Minute, Language.Python, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Hour, Language.Python, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, Symbols.SPY, true, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Second, Language.CSharp, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Minute, Language.CSharp, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Hour, Language.CSharp, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Second, Language.Python, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Minute, Language.Python, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Hour, Language.Python, Symbols.SPY, false, spyDate, null, false);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, Symbols.SPY, false, spyDate, null, false);\n\n                yield return new TestCaseData(Resolution.Second, Language.CSharp, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Minute, Language.CSharp, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Hour, Language.CSharp, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Second, Language.Python, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Minute, Language.Python, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Hour, Language.Python, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, Symbols.SPY, true, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Second, Language.CSharp, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Minute, Language.CSharp, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Hour, Language.CSharp, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Second, Language.Python, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Minute, Language.Python, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Hour, Language.Python, Symbols.SPY, false, spyDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, Symbols.SPY, false, spyDate, null, true);\n\n                var spxCanonicalOption = Symbol.CreateCanonicalOption(Symbols.SPX);\n                var spxDate = new DateTime(2021, 01, 12);\n\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, spxCanonicalOption, true, spxDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, spxCanonicalOption, true, spxDate, null, true);\n                yield return new TestCaseData(null, Language.CSharp, spxCanonicalOption, true, spxDate, Resolution.Daily, true);\n                yield return new TestCaseData(null, Language.Python, spxCanonicalOption, true, spxDate, Resolution.Daily, true);\n                yield return new TestCaseData(Resolution.Daily, Language.CSharp, spxCanonicalOption, false, spxDate, null, true);\n                yield return new TestCaseData(Resolution.Daily, Language.Python, spxCanonicalOption, false, spxDate, null, true);\n                yield return new TestCaseData(null, Language.CSharp, spxCanonicalOption, false, spxDate, Resolution.Daily, true);\n                yield return new TestCaseData(null, Language.Python, spxCanonicalOption, false, spxDate, Resolution.Daily, true);\n            }\n        }\n\n        [TestCaseSource(nameof(BarCountHistoryRequestTestCases))]\n        public void BarCountHistoryRequestIsCorrectlyBuilt(Resolution? resolution, Language language, Symbol symbol,\n            bool symbolAlreadyAdded, DateTime dateTime, Resolution? defaultResolution, bool multiSymbol)\n        {\n            _algorithm.SetStartDate(dateTime);\n            _algorithm.Settings.SeedInitialPrices = false;\n\n            if (symbolAlreadyAdded)\n            {\n                // it should not matter\n                _algorithm.AddSecurity(symbol);\n            }\n\n            if (language == Language.CSharp)\n            {\n                if (multiSymbol)\n                {\n                    _algorithm.History(new[] { symbol }, 10, resolution);\n                }\n                else\n                {\n                    _algorithm.History(symbol, 10, resolution);\n                }\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n                    if (multiSymbol)\n                    {\n                        using var pySymbols = new[] { symbol }.ToPyListUnSafe();\n                        _algorithm.History(pySymbols, 10, resolution);\n\n                        pySymbols[0].Dispose();\n                    }\n                    else\n                    {\n                        using var pySymbol = symbol.ToPython();\n                        _algorithm.History(pySymbol, 10, resolution);\n                    }\n                }\n            }\n\n            Resolution? fillForwardResolution = null;\n            if (resolution != Resolution.Tick)\n            {\n                fillForwardResolution = resolution ?? defaultResolution;\n            }\n\n            if (symbol.SecurityType == SecurityType.Equity)\n            {\n                var expectedCount = resolution == Resolution.Hour || resolution == Resolution.Daily ? 1 : 2;\n                Assert.AreEqual(expectedCount, _testHistoryProvider.HistryRequests.Count);\n                var request = _testHistoryProvider.HistryRequests.First();\n                Assert.AreEqual(symbol, request.Symbol);\n                Assert.AreEqual(resolution, request.Resolution);\n                Assert.IsFalse(request.IncludeExtendedMarketHours);\n                Assert.IsFalse(request.IsCustomData);\n                Assert.AreEqual(fillForwardResolution, request.FillForwardResolution);\n                Assert.AreEqual(DataNormalizationMode.Adjusted, request.DataNormalizationMode);\n\n                Assert.AreEqual(expectedCount == 1 ? TickType.Trade : TickType.Quote, request.TickType);\n            }\n            else if (symbol.SecurityType == SecurityType.IndexOption)\n            {\n                Assert.AreEqual(1, _testHistoryProvider.HistryRequests.Count);\n                var request = _testHistoryProvider.HistryRequests.Single();\n                Assert.AreEqual(symbol, request.Symbol);\n                Assert.AreEqual(resolution ?? defaultResolution, request.Resolution);\n                Assert.AreEqual(typeof(OptionUniverse), request.DataType);\n                Assert.IsFalse(request.IncludeExtendedMarketHours);\n                Assert.IsFalse(request.IsCustomData);\n            }\n        }\n\n        [TestCase(Language.CSharp, true)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.CSharp, false)]\n        [TestCase(Language.Python, false)]\n        public void TickHistoryRequestIgnoresFillForward(Language language, bool symbolAlreadyAdded)\n        {\n            _algorithm.SetStartDate(2013, 10, 07);\n            _algorithm.Settings.SeedInitialPrices = false;\n\n            var symbol = Symbols.SPY;\n            if (symbolAlreadyAdded)\n            {\n                // it should not matter\n                _algorithm.AddEquity(\"SPY\");\n            }\n            if (language == Language.CSharp)\n            {\n                _algorithm.History(new[] { symbol }, new DateTime(1, 1, 1, 1, 1, 1), new DateTime(1, 1, 1, 1, 1, 2), Resolution.Tick,\n                    fillForward: true);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { symbol.ToPython() });\n                    _algorithm.History(symbols, new DateTime(1, 1, 1, 1, 1, 1), new DateTime(1, 1, 1, 1, 1, 2),\n                        Resolution.Tick, fillForward: true);\n                }\n            }\n\n            Assert.AreEqual(2, _testHistoryProvider.HistryRequests.Count);\n            Assert.AreEqual(symbol, _testHistoryProvider.HistryRequests.First().Symbol);\n            Assert.AreEqual(Resolution.Tick, _testHistoryProvider.HistryRequests.First().Resolution);\n            Assert.IsFalse(_testHistoryProvider.HistryRequests.First().IncludeExtendedMarketHours);\n            Assert.IsFalse(_testHistoryProvider.HistryRequests.First().IsCustomData);\n            Assert.AreEqual(null, _testHistoryProvider.HistryRequests.First().FillForwardResolution);\n            Assert.AreEqual(DataNormalizationMode.Adjusted, _testHistoryProvider.HistryRequests.First().DataNormalizationMode);\n            Assert.AreEqual(TickType.Quote, _testHistoryProvider.HistryRequests.First().TickType);\n        }\n\n        [Test]\n        public void GetLastKnownPriceOfIlliquidAsset_RealData()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 6, 6, 11, 0, 0));\n\n            //20140606_twx_minute_quote_american_call_230000_20150117.csv\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 23, new DateTime(2015, 1, 17));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            var lastKnownPrice = algorithm.GetLastKnownPrice(option);\n            Assert.IsNotNull(lastKnownPrice);\n\n            // Data gap of more than 15 minutes\n            Assert.Greater((algorithm.Time - lastKnownPrice.EndTime).TotalMinutes, 15);\n        }\n\n        [Test]\n        public void GetLastKnownPriceOfIlliquidAsset_TestData()\n        {\n            // Set the start date on Tuesday\n            _algorithm.SetStartDate(2014, 6, 10);\n\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 23, new DateTime(2015, 1, 17));\n            var option = _algorithm.AddOptionContract(optionSymbol);\n\n            // The last known price is on Friday, so we missed data from Monday and no data during Weekend\n            var barTime = new DateTime(2014, 6, 6, 15, 0, 0, 0);\n            _testHistoryProvider.Slices = new[]\n            {\n                new Slice(barTime, new[] { new TradeBar(barTime, optionSymbol, 100, 100, 100, 100, 1) }, barTime)\n            }.ToList();\n\n            var lastKnownPrice = _algorithm.GetLastKnownPrice(option);\n            Assert.IsNotNull(lastKnownPrice);\n            Assert.AreEqual(barTime.AddMinutes(1), lastKnownPrice.EndTime);\n        }\n\n        [Test]\n        public void GetLastKnownPricesEquity()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            var equity = algorithm.AddEquity(\"SPY\");\n\n            var lastKnownPrices = algorithm.GetLastKnownPrices(equity.Symbol).ToList();\n            Assert.AreEqual(2, lastKnownPrices.Count);\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(TradeBar)));\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(QuoteBar)));\n        }\n\n        [TestCase(Resolution.Daily)]\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Hour)]\n        public void GetLastKnownPricesUsesCorrectResolution(Resolution resolution)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            algorithm.SetSecurityInitializer(security =>\n            {\n                var lastKnownPrices = algorithm.GetLastKnownPrices(security).ToList();\n                var data = lastKnownPrices.Where(x => x.GetType() == typeof(TradeBar)).Single().ConvertInvariant<TradeBar>();\n                var expectedPeriod = new TimeSpan();\n                switch (resolution)\n                {\n                    case Resolution.Daily:\n                        expectedPeriod = TimeSpan.FromHours(6.5);\n                        break;\n                    case Resolution.Minute:\n                        expectedPeriod = TimeSpan.FromMinutes(1);\n                        break;\n                    case Resolution.Hour:\n                        expectedPeriod = TimeSpan.FromHours(1);\n                        break;\n                }\n\n                Assert.AreEqual(expectedPeriod, data.Period);\n            });\n\n            algorithm.AddEquity(\"SPY\", resolution);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetLastKnownPricesCustomData(Language language)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            Symbol symbol;\n            if (language == Language.CSharp)\n            {\n                symbol = algorithm.AddData<CustomData>(\"SPY\").Symbol;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    PythonInitializer.Initialize();\n\n                    var customDataType = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\nclass Test(PythonData):\n    def GetSource(self, config, date, isLiveMode):\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, config.Resolution, config.TickType)\n        source = f'{Globals.DataFolder}equity/usa/minute/spy/{fileName}'\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def Reader(self, config, line, date, isLiveMode):\n\n        data = line.split(',')\n\n        result = Test()\n        result.DataType = MarketDataType.Base\n        result.Symbol = config.Symbol\n        result.Time = date + timedelta(milliseconds=int(data[0]))\n        result.Value = 1\n\n        return result\n        \").GetAttr(\"Test\");\n                    symbol = algorithm.AddData(customDataType, \"SPY\").Symbol;\n                }\n            }\n\n            var lastKnownPrices = algorithm.GetLastKnownPrices(symbol).ToList();\n            Assert.AreEqual(1, lastKnownPrices.Count);\n            if (language == Language.CSharp)\n            {\n                Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(CustomData)));\n            }\n            else\n            {\n                Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(PythonData)));\n            }\n        }\n\n        [Test]\n        public void GetLastKnownPriceEquity()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            var equity = algorithm.AddEquity(\"SPY\");\n\n            var lastKnownPrice = algorithm.GetLastKnownPrice(equity);\n            Assert.AreEqual(typeof(TradeBar), lastKnownPrice.GetType());\n        }\n\n        [Test]\n        public void GetLastKnownPriceOption()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 06, 09));\n\n            var option = algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"AAPL\", OptionRight.Call, 250m, new DateTime(2016, 01, 15)));\n\n            var lastKnownPrice = algorithm.GetLastKnownPrice(option);\n            Assert.AreEqual(typeof(QuoteBar), lastKnownPrice.GetType());\n        }\n\n        [Test]\n        public void GetLastKnownPricesOption()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 06, 09));\n\n            var option = algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"AAPL\", OptionRight.Call, 250m, new DateTime(2016, 01, 15)));\n\n            var lastKnownPrices = algorithm.GetLastKnownPrices(option).ToList();\n            Assert.AreEqual(3, lastKnownPrices.Count);\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(TradeBar)));\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(QuoteBar)));\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(OpenInterest)));\n        }\n\n        [Test]\n        public void GetLastKnownPriceFuture()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            var future = algorithm.AddSecurity(Symbols.CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2013, 12, 20)));\n\n            var lastKnownPrice = algorithm.GetLastKnownPrice(future);\n            Assert.AreEqual(typeof(QuoteBar), lastKnownPrice.GetType());\n        }\n\n        [Test]\n        public void GetLastKnownPricesFuture()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            var future = algorithm.AddSecurity(Symbols.CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2013, 12, 20)));\n\n            var lastKnownPrices = algorithm.GetLastKnownPrices(future).ToList();\n            Assert.AreEqual(3, lastKnownPrices.Count);\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(TradeBar)));\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(QuoteBar)));\n            Assert.AreEqual(1, lastKnownPrices.Count(data => data.GetType() == typeof(OpenInterest)));\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TickResolutionOpenInterestHistoryRequestIsNotFilteredWhenRequestedExplicitly(Language language)\n        {\n            var start = new DateTime(2014, 6, 05);\n            var end = start.AddDays(10);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetStartDate(start);\n            _algorithm.SetDateTime(end);\n\n            _algorithm.UniverseSettings.FillForward = false;\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 45, new DateTime(2015, 1, 17));\n            var historyResolution = Resolution.Minute;\n\n            if (language == Language.CSharp)\n            {\n                var openInterests = _algorithm.History<OpenInterest>(optionSymbol, start, end, historyResolution).ToList();\n\n                Assert.AreEqual(2, openInterests.Count);\n                Assert.AreEqual(new DateTime(2014, 06, 05, 6, 31, 0), openInterests[0].Time);\n                Assert.AreEqual(optionSymbol, openInterests[0].Symbol);\n                Assert.AreEqual(new DateTime(2014, 06, 06, 6, 30, 0), openInterests[1].Time);\n                Assert.AreEqual(optionSymbol, openInterests[1].Symbol);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getOpenInterestHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getOpenInterestHistory(algorithm, symbol, start, end, resolution):\n    return algorithm.History(OpenInterest, symbol, start, end, resolution).reset_index().to_dict()\n        \").GetAttr(\"getOpenInterestHistory\");\n\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { optionSymbol.ToPython() });\n                    using var dict = getOpenInterestHistory\n                        .Invoke(_algorithm.ToPython(), symbols, start.ToPython(), end.ToPython(),\n                            historyResolution.ToPython());\n                    var openInterestsDataFrameDict = GetDataFrameDictionary<PyObject>(dict);\n\n                    Assert.That(openInterestsDataFrameDict, Does.ContainKey(\"openinterest\"));\n                    Assert.That(openInterestsDataFrameDict, Does.ContainKey(\"time\"));\n\n                    var openInterests = openInterestsDataFrameDict[\"openinterest\"].ConvertToDictionary<int, decimal>();\n                    var times = openInterestsDataFrameDict[\"time\"].ConvertToDictionary<int, DateTime>();\n\n                    Assert.That(openInterests, Has.Count.EqualTo(2));\n                    Assert.That(times, Has.Count.EqualTo(2));\n                    Assert.That(times[0], Is.EqualTo(new DateTime(2014, 06, 05, 6, 31, 0)));\n                    Assert.That(times[1], Is.EqualTo(new DateTime(2014, 06, 06, 6, 30, 0)));\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TickResolutionOpenInterestHistoryRequestIsFilteredByDefault_SingleSymbol(Language language)\n        {\n            var start = new DateTime(2014, 6, 05);\n            var end = start.AddDays(2);\n            var historyResolution = Resolution.Minute;\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetStartDate(start);\n            _algorithm.SetDateTime(end);\n\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 23, new DateTime(2015, 1, 17));\n\n            if (language == Language.CSharp)\n            {\n                var result = _algorithm.History(new[] { optionSymbol }, start, end, historyResolution, fillForward: false).ToList();\n\n                Assert.Multiple(() =>\n                {\n                    Assert.AreEqual(53, result.Count);\n                    Assert.IsTrue(result.Any(slice => slice.ContainsKey(optionSymbol)));\n\n                    var openInterests = result.Select(slice => slice.Get(typeof(OpenInterest)) as DataDictionary<OpenInterest>).Where(dataDictionary => dataDictionary.Count > 0).ToList();\n\n                    Assert.AreEqual(0, openInterests.Count);\n                });\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getOpenInterestHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getOpenInterestHistory(algorithm, symbol, start, end, resolution):\n    return algorithm.History(symbol, start, end, resolution)\n        \").GetAttr(\"getOpenInterestHistory\");\n\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { optionSymbol.ToPython() });\n                    using var openInterests = getOpenInterestHistory.Invoke(_algorithm.ToPython(), symbols, start.ToPython(), end.ToPython(),\n                        historyResolution.ToPython());\n                    Assert.AreEqual(780, openInterests.GetAttr(\"shape\")[0].As<int>());\n\n                    using var dict = openInterests.GetAttr(\"to_dict\").Invoke();\n                    var dataFrameDict = GetDataFrameDictionary<dynamic>(dict);\n                    Assert.That(dataFrameDict, Does.Not.ContainKey(\"openinterest\"));\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TickResolutionOpenInterestHistoryRequestIsFilteredByDefault_MultipleSymbols(Language language)\n        {\n            if (language == Language.Python)\n            {\n                // required for python so we can assert the resulting DF symbols without other tests affecting us\n                SymbolCache.Clear();\n            }\n            var start = new DateTime(2014, 6, 05);\n            var end = start.AddDays(2);\n            var historyResolution = Resolution.Minute;\n            _algorithm = GetAlgorithm(start.AddDays(1));\n            _algorithm.SetStartDate(start);\n            _algorithm.SetDateTime(start.AddDays(2));\n\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 23, new DateTime(2015, 1, 17));\n            var optionSymbol2 = Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 500, new DateTime(2015, 1, 17));\n\n            if (language == Language.CSharp)\n            {\n                var result = _algorithm.History(new[] { optionSymbol, optionSymbol2 }, start, end, historyResolution, fillForward: false).ToList();\n\n                Assert.AreEqual(415, result.Count);\n                Assert.IsTrue(result.Any(slice => slice.ContainsKey(optionSymbol)));\n                Assert.IsTrue(result.Any(slice => slice.ContainsKey(optionSymbol2)));\n\n                var openInterests = result.Select(slice => slice.Get(typeof(OpenInterest)) as DataDictionary<OpenInterest>).Where(dataDictionary => dataDictionary.Count > 0).ToList();\n\n                Assert.AreEqual(0, openInterests.Count);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var getOpenInterestHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getOpenInterestHistory(algorithm, symbol, start, end, resolution):\n    return algorithm.History(symbol, start, end, resolution)\n        \").GetAttr(\"getOpenInterestHistory\");\n\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { optionSymbol.ToPython(), optionSymbol2.ToPython() });\n                    var result = getOpenInterestHistory\n                        .Invoke(_algorithm.ToPython(), symbols, start.ToPython(), end.ToPython(), historyResolution.ToPython());\n                    Assert.AreEqual(1170, result.GetAttr(\"shape\")[0].As<int>());\n\n                    var dataFrameDict = GetDataFrameDictionary<PyObject>(result\n                        .GetAttr(\"reset_index\").Invoke()\n                        .GetAttr(\"to_dict\").Invoke());\n                    var dataFrameSymbols = dataFrameDict[\"symbol\"].ConvertToDictionary<int, string>().Values.ToHashSet();\n                    CollectionAssert.AreEquivalent(dataFrameSymbols, new[] { optionSymbol.ID.ToString(), optionSymbol2.ID.ToString() });\n\n                    Assert.That(dataFrameDict, Does.Not.ContainKey(\"openinterest\"));\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SubscriptionHistoryRequestWithDifferentDataMappingMode(Language language)\n        {\n            var dataMappingModes = GetAllDataMappingModes();\n            var historyStart = new DateTime(2013, 10, 6);\n            var historyEnd = new DateTime(2014, 1, 1);\n            var resolution = Resolution.Daily;\n            _algorithm = GetAlgorithm(historyEnd);\n            var symbol = _algorithm.AddFuture(Futures.Indices.SP500EMini, resolution, dataMappingMode: dataMappingModes.First(),\n                extendedMarketHours: true).Symbol;\n            var expectedHistoryCount = 61;\n\n            if (language == Language.CSharp)\n            {\n                var historyResults = dataMappingModes\n                     .Select(x => _algorithm.History(new[] { symbol }, historyStart, historyEnd, resolution, dataMappingMode: x).ToList())\n                     .ToList();\n\n                CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n\n                // Check that all history results have a mapping date at some point in the history\n                HashSet<DateTime> mappingDates = new HashSet<DateTime>();\n                for (int i = 0; i < historyResults.Count; i++)\n                {\n                    var underlying = historyResults[i].First().Bars.Keys.First().Underlying;\n                    int mappingsCount = 0;\n\n                    foreach (var slice in historyResults[i])\n                    {\n                        var dataUnderlying = slice.Bars.Keys.First().Underlying;\n                        if (dataUnderlying != underlying)\n                        {\n                            underlying = dataUnderlying;\n                            mappingsCount++;\n                            mappingDates.Add(slice.Time.Date);\n                        }\n                    }\n\n                    if (mappingsCount == 0)\n                    {\n                        throw new Exception($\"History results for {dataMappingModes[i]} data mapping mode did not contain any mappings\");\n                    }\n                }\n\n                if (mappingDates.Count < dataMappingModes.Length)\n                {\n                    throw new Exception(\"History results should have had different mapping dates for each data mapping mode\");\n                }\n\n                CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                    \"History results prices should have been different for each data mapping mode at each time\");\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { symbol.ToPython() });\n                    var historyResults = dataMappingModes\n                        .Select(x => _algorithm.History(symbols, historyStart, historyEnd, resolution, dataMappingMode: x))\n                        .ToList();\n\n                    CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n                    CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                        \"History results prices should have been different for each data mapping mode at each time\");\n                }\n            }\n        }\n\n        [TestCase(DataNormalizationMode.BackwardsRatio, Language.CSharp)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, Language.CSharp)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, Language.CSharp)]\n        [TestCase(DataNormalizationMode.BackwardsRatio, Language.Python)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, Language.Python)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, Language.Python)]\n\n        public void HistoryThrowsForUnsupportedDataNormalizationMode_Equity(DataNormalizationMode dataNormalizationMode, Language language)\n        {\n            _algorithm = GetAlgorithmWithEquity(new DateTime(2014, 6, 6));\n            Assert.AreEqual(2, _algorithm.SubscriptionManager.Subscriptions.ToList().Count);\n            var equity = _algorithm.SubscriptionManager.Subscriptions.First();\n            Assert.AreEqual(SecurityType.Equity, equity.SecurityType);\n\n            var start = _algorithm.Time.AddDays(-1);\n            var end = _algorithm.Time;\n            TestDelegate historyCall;\n\n            if (language == Language.CSharp)\n            {\n                historyCall = () =>\n                {\n                    _algorithm.History(new[] { equity.Symbol }, start, end, equity.Resolution,\n                        dataNormalizationMode: dataNormalizationMode).ToList();\n                };\n            }\n            else\n            {\n                historyCall = () =>\n                {\n                    using (Py.GIL())\n                    {\n                        _algorithm.SetPandasConverter();\n                        var symbols = new PyList(new[] { equity.Symbol.ToPython() });\n                        _algorithm.History(symbols, start, end, equity.Resolution, dataNormalizationMode: dataNormalizationMode);\n                    }\n                };\n            }\n\n            Assert.Throws<ArgumentOutOfRangeException>(historyCall);\n        }\n\n        [TestCase(DataNormalizationMode.Adjusted, Language.CSharp)]\n        [TestCase(DataNormalizationMode.SplitAdjusted, Language.CSharp)]\n        [TestCase(DataNormalizationMode.TotalReturn, Language.CSharp)]\n        [TestCase(DataNormalizationMode.Adjusted, Language.Python)]\n        [TestCase(DataNormalizationMode.SplitAdjusted, Language.Python)]\n        [TestCase(DataNormalizationMode.TotalReturn, Language.Python)]\n        public void HistoryThrowsForUnsupportedDataNormalizationMode_Future(DataNormalizationMode dataNormalizationMode, Language language)\n        {\n            _algorithm = GetAlgorithmWithFuture(new DateTime(2014, 1, 1));\n            Assert.IsNotEmpty(_algorithm.SubscriptionManager.Subscriptions);\n            var future = _algorithm.SubscriptionManager.Subscriptions.First();\n            Assert.AreEqual(SecurityType.Future, future.SecurityType);\n\n            var start = _algorithm.StartDate;\n            var end = _algorithm.EndDate;\n            TestDelegate historyCall;\n\n            if (language == Language.CSharp)\n            {\n                historyCall = () =>\n                {\n                    _algorithm.History(new[] { future.Symbol }, start, end, future.Resolution,\n                        dataNormalizationMode: dataNormalizationMode).ToList();\n                };\n            }\n            else\n            {\n                historyCall = () =>\n                {\n                    using (Py.GIL())\n                    {\n                        _algorithm.SetPandasConverter();\n                        var symbols = new PyList(new[] { future.Symbol.ToPython() });\n                        _algorithm.History(symbols, start, end, future.Resolution, dataNormalizationMode: dataNormalizationMode);\n                    }\n                };\n            }\n\n            Assert.Throws<ArgumentOutOfRangeException>(historyCall);\n        }\n\n        [TestCase(DataNormalizationMode.Raw, Language.CSharp)]\n        [TestCase(DataNormalizationMode.Adjusted, Language.CSharp)]\n        [TestCase(DataNormalizationMode.SplitAdjusted, Language.CSharp)]\n        [TestCase(DataNormalizationMode.TotalReturn, Language.CSharp)]\n        [TestCase(DataNormalizationMode.Raw, Language.Python)]\n        [TestCase(DataNormalizationMode.Adjusted, Language.Python)]\n        [TestCase(DataNormalizationMode.SplitAdjusted, Language.Python)]\n        [TestCase(DataNormalizationMode.TotalReturn, Language.Python)]\n        public void HistoryDoesNotThrowForSupportedDataNormalizationMode_Equity(DataNormalizationMode dataNormalizationMode, Language language)\n        {\n            _algorithm = GetAlgorithmWithEquity(new DateTime(2014, 6, 6));\n            Assert.AreEqual(2, _algorithm.SubscriptionManager.Subscriptions.ToList().Count);\n            var equity = _algorithm.SubscriptionManager.Subscriptions.First();\n            Assert.AreEqual(SecurityType.Equity, equity.SecurityType);\n\n            var start = _algorithm.Time.AddDays(-1);\n            var end = _algorithm.Time;\n            TestDelegate historyCall;\n\n            if (language == Language.CSharp)\n            {\n                historyCall = () =>\n                {\n                    _algorithm.History(new[] { equity.Symbol }, start, end, equity.Resolution,\n                        dataNormalizationMode: dataNormalizationMode).ToList();\n                };\n            }\n            else\n            {\n                historyCall = () =>\n                {\n                    using (Py.GIL())\n                    {\n                        _algorithm.SetPandasConverter();\n                        var symbols = new PyList(new[] { equity.Symbol.ToPython() });\n                        _algorithm.History(symbols, start, end, equity.Resolution, dataNormalizationMode: dataNormalizationMode);\n                    }\n                };\n            }\n\n            Assert.DoesNotThrow(historyCall);\n        }\n\n        [TestCase(DataNormalizationMode.Raw, Language.CSharp)]\n        [TestCase(DataNormalizationMode.BackwardsRatio, Language.CSharp)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, Language.CSharp)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, Language.CSharp)]\n        [TestCase(DataNormalizationMode.Raw, Language.Python)]\n        [TestCase(DataNormalizationMode.BackwardsRatio, Language.Python)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, Language.Python)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, Language.Python)]\n        public void HistoryDoesNotThrowForSupportedDataNormalizationMode_Future(DataNormalizationMode dataNormalizationMode, Language language)\n        {\n            _algorithm = GetAlgorithmWithFuture(new DateTime(2014, 1, 1));\n            Assert.IsNotEmpty(_algorithm.SubscriptionManager.Subscriptions);\n            var future = _algorithm.SubscriptionManager.Subscriptions.First();\n            Assert.AreEqual(SecurityType.Future, future.SecurityType);\n\n            var start = _algorithm.StartDate;\n            var end = _algorithm.Time;\n            TestDelegate historyCall;\n\n            if (language == Language.CSharp)\n            {\n                historyCall = () =>\n                {\n                    _algorithm.History(new[] { future.Symbol }, start, end, future.Resolution,\n                        dataNormalizationMode: dataNormalizationMode).ToList();\n                };\n            }\n            else\n            {\n                historyCall = () =>\n                {\n                    using (Py.GIL())\n                    {\n                        _algorithm.SetPandasConverter();\n                        var symbols = new PyList(new[] { future.Symbol.ToPython() });\n                        _algorithm.History(symbols, start, end, future.Resolution, dataNormalizationMode: dataNormalizationMode);\n                    }\n                };\n            }\n\n            Assert.DoesNotThrow(historyCall);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SubscriptionHistoryRequestWithDifferentDataNormalizationModes_Equity(Language language)\n        {\n            var dataNormalizationModes = new DataNormalizationMode[]{\n                DataNormalizationMode.Raw,\n                DataNormalizationMode.Adjusted,\n                DataNormalizationMode.SplitAdjusted\n            };\n            _algorithm = GetAlgorithmWithEquity(new DateTime(2014, 6, 6));\n            var equity = _algorithm.SubscriptionManager.Subscriptions.First();\n\n            using (Py.GIL())\n            {\n                _algorithm.SetPandasConverter();\n                dynamic symbol = language == Language.CSharp ? equity.Symbol : equity.Symbol.ToPython();\n                CheckHistoryResultsForDataNormalizationModes(_algorithm, symbol, _algorithm.Time.AddDays(-1), _algorithm.Time, equity.Resolution,\n                    dataNormalizationModes, expectedHistoryCount: 390);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SubscriptionHistoryRequestWithDifferentDataNormalizationModes_Future(Language language)\n        {\n            var dataNormalizationModes = new DataNormalizationMode[]{\n                DataNormalizationMode.Raw,\n                DataNormalizationMode.BackwardsRatio,\n                DataNormalizationMode.BackwardsPanamaCanal,\n                DataNormalizationMode.ForwardPanamaCanal\n            };\n            _algorithm = GetAlgorithmWithFuture(new DateTime(2014, 1, 1));\n            var future = _algorithm.SubscriptionManager.Subscriptions.First();\n\n            using (Py.GIL())\n            {\n                _algorithm.SetPandasConverter();\n                dynamic symbol = language == Language.CSharp ? future.Symbol : future.Symbol.ToPython();\n                CheckHistoryResultsForDataNormalizationModes(_algorithm, symbol, new DateTime(2013, 10, 6), _algorithm.Time, future.Resolution,\n                    dataNormalizationModes, expectedHistoryCount: 61);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SubscriptionHistoryRequestForContinuousContractsWithDifferentDepthOffsets(Language language)\n        {\n            var start = new DateTime(2013, 10, 6);\n            var end = new DateTime(2014, 1, 1);\n            _algorithm = GetAlgorithmWithFuture(end);\n            var future = _algorithm.SubscriptionManager.Subscriptions.First();\n            var expectedHistoryCount = 61;\n\n            if (language == Language.CSharp)\n            {\n                Func<int, List<Slice>> getHistoryForContractDepthOffset = (contractDepthOffset) =>\n                {\n                    return _algorithm.History(new[] { future.Symbol }, start, end, future.Resolution, contractDepthOffset: contractDepthOffset).ToList();\n                };\n\n                var frontMonthHistory = getHistoryForContractDepthOffset(0);\n                var backMonthHistory1 = getHistoryForContractDepthOffset(1);\n                var backMonthHistory2 = getHistoryForContractDepthOffset(2);\n\n                Func<List<Slice>, HashSet<Symbol>> getHistoryUnderlyings = (history) =>\n                {\n                    HashSet<Symbol> underlyings = new();\n                    foreach (var slice in history)\n                    {\n                        var underlying = slice.Keys.Single().Underlying;\n                        underlyings.Add(underlying);\n                    }\n\n                    Assert.GreaterOrEqual(underlyings.Count, 2, \"History result did not contain any mappings\");\n\n                    return underlyings;\n                };\n\n                var frontMonthHistoryUnderlyings = getHistoryUnderlyings(frontMonthHistory);\n                var backMonthHistory1Underlyings = getHistoryUnderlyings(backMonthHistory1);\n                var backMonthHistory2Underlyings = getHistoryUnderlyings(backMonthHistory2);\n\n                Assert.AreNotEqual(frontMonthHistoryUnderlyings, backMonthHistory2Underlyings);\n                Assert.AreNotEqual(frontMonthHistoryUnderlyings, backMonthHistory2Underlyings);\n                Assert.AreNotEqual(backMonthHistory1Underlyings, backMonthHistory2Underlyings);\n\n                var historyResults = new List<List<Slice>> { frontMonthHistory, backMonthHistory1, backMonthHistory2 };\n                CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n                CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                    \"History results prices should have been different for each data mapping mode at each time\");\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    _algorithm.SetPandasConverter();\n                    using var symbols = new PyList(new[] { future.Symbol.ToPython() });\n\n                    Func<int, PyObject> getHistoryForContractDepthOffset = (contractDepthOffset) =>\n                    {\n                        return _algorithm.History(symbols, start, end, future.Resolution, contractDepthOffset: contractDepthOffset);\n                    };\n\n                    var frontMonthHistory = getHistoryForContractDepthOffset(0);\n                    var backMonthHistory1 = getHistoryForContractDepthOffset(1);\n                    var backMonthHistory2 = getHistoryForContractDepthOffset(2);\n\n                    Assert.Greater(frontMonthHistory.GetAttr(\"shape\")[0].As<int>(), 0);\n                    Assert.Greater(backMonthHistory1.GetAttr(\"shape\")[0].As<int>(), 0);\n                    Assert.Greater(backMonthHistory2.GetAttr(\"shape\")[0].As<int>(), 0);\n\n                    var historyResults = new List<PyObject> { frontMonthHistory, backMonthHistory1, backMonthHistory2 };\n                    CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n                    CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                        \"History results prices should have been different for each contract depth offset at each time\");\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetHistoryWithCustomDataType(Language language)\n        {\n            var end = new DateTime(2013, 10, 8);\n            var algorithm = GetAlgorithm(end);\n            var start = end.AddDays(-1);\n            var span = end - start;\n            var periods = (int)span.TotalMinutes;\n\n            if (language == Language.CSharp)\n            {\n                var symbol = algorithm.AddData<CustomData>(\"SPY\").Symbol;\n\n                var historyResults = new[]\n                {\n                    algorithm.History<CustomData>(symbol, start, end, Resolution.Minute),\n                    algorithm.History<CustomData>(symbol, span, Resolution.Minute),\n                    algorithm.History<CustomData>(symbol, periods, Resolution.Minute)\n                };\n\n                foreach (var history in historyResults)\n                {\n                    AssertCustomDataTypeHistory(history.ToList());\n                }\n\n                var historyResults2 = new[]\n                {\n                    algorithm.History<CustomData>(new[] { symbol }, start, end, Resolution.Minute),\n                    algorithm.History<CustomData>(new[] { symbol }, span, Resolution.Minute),\n                    algorithm.History<CustomData>(new[] { symbol }, periods, Resolution.Minute)\n                };\n\n                foreach (var history in historyResults2)\n                {\n                    AssertCustomDataTypeHistory(history.ToList());\n                }\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    PythonInitializer.Initialize();\n\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom typing import Union\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\nclass TestCustomMarketData(PythonData):\n    def GetSource(self, config, date, isLiveMode):\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, config.Resolution, config.TickType)\n        source = f'{Globals.DataFolder}equity/usa/minute/spy/{fileName}'\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def Reader(self, config, line, date, isLiveMode):\n\n        data = line.split(',')\n\n        result = TestCustomMarketData()\n        result.DataType = MarketDataType.Base\n        result.Symbol = config.Symbol\n        result.Time = date + timedelta(milliseconds=int(data[0]))\n        result.Value = 1\n\n        return result\n\ndef getDateRangeHistory(algorithm: QCAlgorithm, symbol: Union[Symbol, List[Symbol]], start: datetime, end: datetime):\n    return list(algorithm.History[TestCustomMarketData](symbol, start, end, Resolution.Minute))\n\ndef getTimeSpanHistory(algorithm: QCAlgorithm, symbol: Union[Symbol, List[Symbol]], span: Union[timedelta, int]):\n    return list(algorithm.History[TestCustomMarketData](symbol, span, Resolution.Minute))\n        \");\n                    var customDataType = testModule.GetAttr(\"TestCustomMarketData\");\n                    var symbol = algorithm.AddData(customDataType, \"SPY\").Symbol;\n\n                    dynamic getDateRangeHistory = testModule.GetAttr(\"getDateRangeHistory\");\n                    dynamic getTimeSpanHistory = testModule.GetAttr(\"getTimeSpanHistory\");\n\n                    var historyResults = new[]\n                    {\n                        getDateRangeHistory(algorithm, symbol, start, end),\n                        getTimeSpanHistory(algorithm, symbol, span),\n                        getTimeSpanHistory(algorithm, symbol, periods)\n                    };\n\n                    foreach (var history in historyResults)\n                    {\n                        AssertCustomDataTypeHistory(history.As<List<PythonData>>());\n                    }\n\n                    var historyResults2 = new[]\n                    {\n                        getDateRangeHistory(algorithm, new[] { symbol }, start, end),\n                        getTimeSpanHistory(algorithm, new[] { symbol }, span),\n                        getTimeSpanHistory(algorithm, new[] { symbol }, periods)\n                    };\n\n                    foreach (var history in historyResults2)\n                    {\n                        AssertCustomDataTypeHistory(history.As<List<DataDictionary<PythonData>>>());\n                    }\n                }\n            }\n\n            Assert.That(_testHistoryProvider.HistryRequests, Has.All.Property(\"IsCustomData\").True);\n        }\n\n        [Test]\n        public void GetHistoryFromPythonWithCSharpCustomDataType()\n        {\n            var end = new DateTime(2013, 10, 8);\n            var algorithm = GetAlgorithm(end);\n            var start = end.AddDays(-1);\n            var span = end - start;\n            var periods = (int)span.TotalMinutes;\n\n            using (Py.GIL())\n            {\n                PythonInitializer.Initialize();\n\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom typing import Union\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\nfrom QuantConnect.Tests.Algorithm import AlgorithmHistoryTests\n\ndef getDateRangeHistory(algorithm: QCAlgorithm, symbol: Union[Symbol, List[Symbol]], start: datetime, end: datetime):\n    return list(algorithm.History[AlgorithmHistoryTests.CustomData](symbol, start, end, Resolution.Minute))\n\ndef getTimeSpanHistory(algorithm: QCAlgorithm, symbol: Union[Symbol, List[Symbol]], span: Union[timedelta, int]):\n    return list(algorithm.History[AlgorithmHistoryTests.CustomData](symbol, span, Resolution.Minute))\n        \");\n                var symbol = algorithm.AddData<CustomData>(\"SPY\").Symbol;\n\n                dynamic getDateRangeHistory = testModule.GetAttr(\"getDateRangeHistory\");\n                dynamic getTimeSpanHistory = testModule.GetAttr(\"getTimeSpanHistory\");\n\n                var historyResults = new[]\n                {\n                        getDateRangeHistory(algorithm, symbol, start, end),\n                        getTimeSpanHistory(algorithm, symbol, span),\n                        getTimeSpanHistory(algorithm, symbol, periods)\n                    };\n\n                foreach (var history in historyResults)\n                {\n                    AssertCustomDataTypeHistory(history.As<List<CustomData>>());\n                }\n\n                var historyResults2 = new[]\n                {\n                        getDateRangeHistory(algorithm, new[] { symbol }, start, end),\n                        getTimeSpanHistory(algorithm, new[] { symbol }, span),\n                        getTimeSpanHistory(algorithm, new[] { symbol }, periods)\n                    };\n\n                foreach (var history in historyResults2)\n                {\n                    AssertCustomDataTypeHistory(history.As<List<DataDictionary<CustomData>>>());\n                }\n            }\n\n            Assert.That(_testHistoryProvider.HistryRequests, Has.All.Property(\"IsCustomData\").True);\n        }\n\n        [Test]\n        public void GetHistoryWithCustomDataAndNormalizationMode()\n        {\n            var dataNormalizationModes = new DataNormalizationMode[]{\n                DataNormalizationMode.Raw,\n                DataNormalizationMode.Adjusted,\n                DataNormalizationMode.SplitAdjusted\n            };\n            var start = new DateTime(2014, 6, 5);\n            var end = start.AddDays(1);\n            var algorithm = GetAlgorithm(end);\n\n            using (Py.GIL())\n            {\n                var getHistoryForDataNormalizationMode = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistoryForDataNormalizationMode(algorithm, symbol, start, end, resolution, dataNormalizationMode):\n    return algorithm.History(TradeBar, symbol, start, end, resolution, dataNormalizationMode=dataNormalizationMode)\n        \").GetAttr(\"getHistoryForDataNormalizationMode\");\n\n                algorithm.SetPandasConverter();\n                var symbol = algorithm.AddEquity(\"AAPL\", Resolution.Minute).Symbol.ToPython();\n                var pyAlgorithm = algorithm.ToPython();\n                var pyStart = start.ToPython();\n                var pyEnd = end.ToPython();\n                var pyResolution = Resolution.Minute.ToPython();\n                var historyResults = dataNormalizationModes\n                    .Select(dataNormalizationMode =>\n                        getHistoryForDataNormalizationMode.Invoke(pyAlgorithm, symbol, pyStart, pyEnd, pyResolution, dataNormalizationMode.ToPython()))\n                    .ToList();\n\n                CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount: 390);\n                CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                    \"History results prices should have been different for each data normalization mode at each time\");\n            }\n        }\n\n        [Test]\n        public void GetHistoryWithCustomDataAndDataMappingMode()\n        {\n            var dataMappingModes = GetAllDataMappingModes();\n            var historyStart = new DateTime(2013, 10, 6);\n            var historyEnd = new DateTime(2014, 1, 1);\n            var resolution = Resolution.Daily;\n            var algorithm = GetAlgorithm(historyEnd);\n            var symbol = algorithm.AddFuture(Futures.Indices.SP500EMini, resolution, dataMappingMode: dataMappingModes.First(),\n                extendedMarketHours: true).Symbol;\n\n            using (Py.GIL())\n            {\n                var getHistoryForDataMappingMode = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistoryForDataMappingMode(algorithm, symbol, start, end, resolution, dataMappingMode):\n    return algorithm.History(TradeBar, symbol, start, end, resolution, dataMappingMode=dataMappingMode)\n        \").GetAttr(\"getHistoryForDataMappingMode\");\n\n                algorithm.SetPandasConverter();\n                using var symbols = symbol.ToPython();\n                var pyAlgorithm = algorithm.ToPython();\n                var pyStart = historyStart.ToPython();\n                var pyEnd = historyEnd.ToPython();\n                var pyResolution = resolution.ToPython();\n                var historyResults = dataMappingModes\n                    .Select(dataMappingMode =>\n                        getHistoryForDataMappingMode.Invoke(pyAlgorithm, symbols, pyStart, pyEnd, pyResolution, dataMappingMode.ToPython()))\n                    .ToList();\n\n                CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount: 61);\n                CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                    \"History results prices should have been different for each data mapping mode at each time\");\n            }\n        }\n\n        [Test]\n        public void GetHistoryWithCustomDataAndContractDepthOffset()\n        {\n            var start = new DateTime(2013, 10, 6);\n            var end = new DateTime(2014, 1, 1);\n            var algorithm = GetAlgorithmWithFuture(end);\n            var future = algorithm.SubscriptionManager.Subscriptions.First();\n\n            using (Py.GIL())\n            {\n                var getHistoryForContractDepthOffset = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistoryForContractDepthOffset(algorithm, symbol, start, end, resolution, contractDepthOffset):\n    return algorithm.History(QuoteBar, symbol, start, end, resolution, contractDepthOffset=contractDepthOffset)\n        \").GetAttr(\"getHistoryForContractDepthOffset\");\n\n                algorithm.SetPandasConverter();\n                using var symbols = new PyList(new[] { future.Symbol.ToPython() });\n                var pyAlgorithm = algorithm.ToPython();\n                var pyStart = start.ToPython();\n                var pyEnd = end.ToPython();\n                var pyResolution = future.Resolution.ToPython();\n\n                var frontMonthHistory = getHistoryForContractDepthOffset.Invoke(pyAlgorithm, symbols, pyStart, pyEnd, pyResolution, 0.ToPython());\n                var backMonthHistory1 = getHistoryForContractDepthOffset.Invoke(pyAlgorithm, symbols, pyStart, pyEnd, pyResolution, 1.ToPython());\n                var backMonthHistory2 = getHistoryForContractDepthOffset.Invoke(pyAlgorithm, symbols, pyStart, pyEnd, pyResolution, 2.ToPython());\n\n                Assert.Greater(frontMonthHistory.GetAttr(\"shape\")[0].As<int>(), 0);\n                Assert.Greater(backMonthHistory1.GetAttr(\"shape\")[0].As<int>(), 0);\n                Assert.Greater(backMonthHistory2.GetAttr(\"shape\")[0].As<int>(), 0);\n\n                var historyResults = new List<PyObject> { frontMonthHistory, backMonthHistory1, backMonthHistory2 };\n                CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount: 61);\n                CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                    \"History results prices should have been different for each contract depth offset at each time\");\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetsHistoryWithGivenBarType(Language language)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 6, 6));\n            var ibmSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var twxSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 45, new DateTime(2015, 1, 17));\n\n            var ibmHistoryStart = new DateTime(2013, 10, 7);\n            var ibmHistoryEnd = new DateTime(2013, 10, 8);\n\n            var ibmTickHistoryStart = new DateTime(2013, 10, 7, 9, 30, 0);\n            var ibmTickHistoryEnd = ibmTickHistoryStart.AddSeconds(10);\n\n            var twxHistoryStart = new DateTime(2014, 6, 5);\n            var twxHistoryEnd = new DateTime(2014, 6, 6);\n\n            if (language == Language.CSharp)\n            {\n                var tradeHistory = algorithm.History<TradeBar>(ibmSymbol, ibmHistoryStart, ibmHistoryEnd);\n                Assert.AreEqual(390, tradeHistory.Count());\n\n                var quoteHistory = algorithm.History<QuoteBar>(ibmSymbol, ibmHistoryStart, ibmHistoryEnd);\n                Assert.AreEqual(390, quoteHistory.Count());\n\n                var tickHistory = algorithm.History<Tick>(ibmSymbol, ibmTickHistoryStart, ibmTickHistoryEnd, Resolution.Tick);\n                Assert.AreEqual(46, tickHistory.Count());\n\n                var openInterestHistory = algorithm.History<OpenInterest>(twxSymbol, twxHistoryStart, twxHistoryEnd);\n                Assert.AreEqual(391, openInterestHistory.Count());\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getTradeBarHistory(algorithm, symbol, start, end):\n    return algorithm.History(TradeBar, symbol, start, end)\n\ndef getQuoteBarHistory(algorithm, symbol, start, end):\n    return algorithm.History(QuoteBar, symbol, start, end)\n\ndef getTickHistory(algorithm, symbol, start, end):\n    return algorithm.History(Tick, symbol, start, end, Resolution.Tick)\n\ndef getOpenInterestHistory(algorithm, symbol, start, end):\n    return algorithm.History(OpenInterest, symbol, start, end)\n\");\n\n                    dynamic getTradeBarHistory = testModule.GetAttr(\"getTradeBarHistory\");\n                    dynamic getQuoteBarHistory = testModule.GetAttr(\"getQuoteBarHistory\");\n                    dynamic getTickHistory = testModule.GetAttr(\"getTickHistory\");\n                    dynamic getOpenInterestHistory = testModule.GetAttr(\"getOpenInterestHistory\");\n\n                    algorithm.SetPandasConverter();\n\n                    dynamic tradeHistory = getTradeBarHistory(algorithm, ibmSymbol, ibmHistoryStart, ibmHistoryEnd);\n                    Assert.AreEqual(390, tradeHistory.shape[0].As<int>());\n\n                    dynamic quoteHistory = getQuoteBarHistory(algorithm, ibmSymbol, ibmHistoryStart, ibmHistoryEnd);\n                    Assert.AreEqual(390, quoteHistory.shape[0].As<int>());\n\n                    dynamic tickHistory = getTickHistory(algorithm, ibmSymbol, ibmTickHistoryStart, ibmTickHistoryEnd);\n                    Assert.AreEqual(46, tickHistory.shape[0].As<int>());\n\n                    dynamic openInterestHistory = getOpenInterestHistory(algorithm, twxSymbol, twxHistoryStart, twxHistoryEnd);\n                    Assert.AreEqual(391, openInterestHistory.shape[0].As<int>());\n                }\n            }\n        }\n\n        [Test]\n        public void HistoryCallsGetSameTickCount()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 6, 6));\n            var ibmSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n\n            var start = new DateTime(2013, 10, 7, 9, 30, 0);\n            var end = start.AddSeconds(5);\n\n            var history = algorithm.History(new[] { ibmSymbol }, start, end, Resolution.Tick);\n            var tickCountInSliceHistoryCall = history.Sum(x => x.Ticks[ibmSymbol].Count);\n            Assert.AreEqual(40, tickCountInSliceHistoryCall);\n\n            var tickHistory = algorithm.History<Tick>(ibmSymbol, start, end, Resolution.Tick).ToList();\n            var tickCountInTickHistoryCall = tickHistory.Count;\n            Assert.AreEqual(tickCountInSliceHistoryCall, tickCountInTickHistoryCall);\n        }\n\n        [Test]\n        public void PricesAreProperlyAdjustedForScaledRawHistoryRequest()\n        {\n            var start = new DateTime(2000, 01, 01);\n            var end = new DateTime(2016, 01, 01);\n            var algorithm = GetAlgorithm(end.AddDays(1));\n            var aaplSymbol = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            var rawHistory = algorithm.History(new[] { aaplSymbol }, start, end, Resolution.Daily, dataNormalizationMode: DataNormalizationMode.Raw).ToList();\n            var scaledRawHistory = algorithm.History(new[] { aaplSymbol }, start, end, Resolution.Daily, dataNormalizationMode: DataNormalizationMode.ScaledRaw).ToList();\n\n            Assert.IsNotEmpty(rawHistory);\n            Assert.AreEqual(rawHistory.Count, scaledRawHistory.Count);\n\n            var factorFile = _factorFileProvider.Get(aaplSymbol);\n            var factorDates = new List<DateTime>();\n            var factors = new List<decimal>();\n            var prevFactor = 0m;\n            for (var date = start; date <= end; date = date.AddDays(1))\n            {\n                var factor = factorFile.GetPriceFactor(date, DataNormalizationMode.ScaledRaw);\n                if (factor != prevFactor)\n                {\n                    factorDates.Add(date);\n                    factors.Add(factor);\n                    prevFactor = factor;\n                }\n            }\n            var lastFactorDate = factorDates[factorDates.Count - 1];\n            var lastFactor = factors[factors.Count - 1];\n            factorDates.RemoveAt(0);\n            var currentFactorIndex = 0;\n\n            for (var i = 0; i < rawHistory.Count; i++)\n            {\n                var rawBar = rawHistory[i].Bars[aaplSymbol];\n                var scaledRawBar = scaledRawHistory[i].Bars[aaplSymbol];\n\n                if (currentFactorIndex < factorDates.Count && rawBar.Time > factorDates[currentFactorIndex])\n                {\n                    currentFactorIndex++;\n                }\n\n                if (rawBar.Time <= lastFactorDate)\n                {\n                    Assert.AreNotEqual(rawBar.Price, scaledRawBar.Price,\n                        $@\"Raw price {rawBar.Price} should have been different than scaled raw price {scaledRawBar.Price} at {rawBar.Time} (before and at the last factor date {lastFactorDate})\");\n                }\n                else\n                {\n                    // after the last split/dividend, the factor is 1 because prices are adjusted to the prices after the last factor\n                    Assert.AreEqual(1m, factors[currentFactorIndex] / lastFactor);\n                    Assert.AreEqual(rawBar.Price, scaledRawBar.Price,\n                        $@\"Raw price {rawBar.Price} should have been equal to the scaled raw price {scaledRawBar.Price} at {rawBar.Time} (after the last factor date {lastFactorDate})\");\n                }\n\n                var expectedScaledRawPrice = rawBar.Price * factors[currentFactorIndex] / lastFactor;\n                Assert.Less(Math.Abs(expectedScaledRawPrice - scaledRawBar.Price), 1e-25m, $\"Date: {rawBar.Time}\");\n            }\n        }\n\n        // C#\n        [TestCase(Language.CSharp, Resolution.Second, true, 23400, 23400, 23400)]\n        [TestCase(Language.CSharp, Resolution.Second, false, 23400, 22884, 16093)]\n        [TestCase(Language.CSharp, Resolution.Minute, true, 780, 780, 780)]\n        [TestCase(Language.CSharp, Resolution.Minute, false, 780, 390, 390)]\n        // Python\n        [TestCase(Language.Python, Resolution.Second, true, 23400, 23400, 23400)]\n        [TestCase(Language.Python, Resolution.Second, false, 23400, 22884, 16093)]\n        [TestCase(Language.Python, Resolution.Minute, true, 780, 780, 780)]\n        [TestCase(Language.Python, Resolution.Minute, false, 780, 390, 390)]\n        public void HistoryRequestWithFillForward(Language language, Resolution resolution, bool fillForward, int periods,\n            int expectedHistoryCount, int expectedTradeBarOnlyHistoryCount)\n        {\n            // Theres data only for 2013-10-07 to 2013-10-11 for SPY. Data should be fill forwarded till the 15th.\n            var start = new DateTime(2013, 10, 11);\n            var end = resolution == Resolution.Minute ? new DateTime(2013, 10, 15) : new DateTime(2013, 10, 12);\n            var timeSpan = end - start;\n\n            var algorithm = GetAlgorithm(end);\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var noSymbolTimeSpanHistory = algorithm.History(timeSpan, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(noSymbolTimeSpanHistory, expectedHistoryCount, resolution, fillForward);\n\n                // No symbol, periods\n                var noSymbolPeriodBasedHistory = algorithm.History(periods, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(noSymbolPeriodBasedHistory, expectedHistoryCount, resolution, fillForward);\n\n                // No symbol, date range\n                // TODO: to be implemented\n\n                // Single symbol, time span\n                var singleSymbolTimeSpanHistory = algorithm.History(symbol, timeSpan, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(singleSymbolTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Single symbol, periods\n                var singleSymbolPeriodBasedHistory = algorithm.History(symbol, periods, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(singleSymbolPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Single symbol, date range\n                var singleSymbolDateRangeHistory = algorithm.History(symbol, start, end,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(singleSymbolDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Symbol array, time span\n                var symbolsTimeSpanHistory = algorithm.History(new[] { symbol }, timeSpan, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(symbolsTimeSpanHistory, expectedHistoryCount, resolution, fillForward);\n\n                // Symbol array, periods\n                var symbolsPeriodBasedHistory = algorithm.History(new[] { symbol }, periods, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(symbolsPeriodBasedHistory, expectedHistoryCount, resolution, fillForward);\n\n                // Symbol array, date range\n                var symbolsdateRangeHistory = algorithm.History(new[] { symbol }, start, end, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(symbolsdateRangeHistory, expectedHistoryCount, resolution, fillForward);\n\n                // Generic, no symbol, time span\n                var typedNoSymbolTimeSpanHistory = algorithm.History<TradeBar>(timeSpan, resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedNoSymbolTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, no symbol, periods\n                // TODO: to be implemented\n\n                // Generic, no symbol, date range\n                // TODO: to be implemented\n\n                // Generic, single symbol, time span\n                var typedSingleSymbolTimeSpanHistory = algorithm.History<TradeBar>(symbol, timeSpan,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSingleSymbolTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, single symbol, periods\n                var typedSingleSymbolPeriodBasedHistory = algorithm.History<TradeBar>(symbol, periods,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, single symbol, date range\n                var typedSingleSymbolDateRangeHistory = algorithm.History<TradeBar>(symbol, start, end,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSingleSymbolDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, symbol array, time span\n                var typedSymbolsTimeSpanHistory = algorithm.History<TradeBar>(new[] { symbol }, timeSpan,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSymbolsTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, symbol array, periods\n                var typedSymbolsPeriodBasedHistory = algorithm.History<TradeBar>(new[] { symbol }, periods,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSymbolsPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                // Generic, symbol array, date range\n                var typedSymbolsDateRangeHistory = algorithm.History<TradeBar>(new[] { symbol }, start, end,\n                    resolution, fillForward: fillForward).ToList();\n                AssertFillForwardHistoryResults(typedSymbolsDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\ntradeBar = TradeBar\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTradeBarType = testModule.GetAttr(\"tradeBar\");\n\n                    // Single symbol, time span\n                    var singleSymbolTimeSpanHistory = algorithm.History(pySymbol, timeSpan, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(singleSymbolTimeSpanHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Single symbol, periods\n                    var singleSymbolPeriodBasedHistory = algorithm.History(pySymbol, periods, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(singleSymbolPeriodBasedHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Single symbol, date range\n                    var singleSymbolDateRangeHistory = algorithm.History(pySymbol, start, end, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(singleSymbolDateRangeHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Symbol array, time span\n                    var symbolsTimeSpanHistory = algorithm.History(pySymbols, timeSpan, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(symbolsTimeSpanHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Symbol array, periods\n                    var symbolsPeriodBasedHistory = algorithm.History(pySymbols, periods, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(symbolsPeriodBasedHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Symbol array, date range\n                    var symbolsDateRangeHistory = algorithm.History(pySymbols, start, end, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(symbolsDateRangeHistory, expectedHistoryCount, resolution, fillForward);\n\n                    // Generic, single symbol, time span\n                    var typedSingleSymbolTimeSpanHistory = algorithm.History(pyTradeBarType, pySymbol, timeSpan,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolTimeSpanHistory = algorithm.History(pyTradeBarType, symbol, timeSpan, resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Generic, single symbol, periods\n                    var typedSingleSymbolPeriodBasedHistory = algorithm.History(pyTradeBarType, pySymbol, periods,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolPeriodBasedHistory = algorithm.History(pyTradeBarType, symbol, periods,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Generic, single symbol, date range\n                    var typedSingleSymbolDateRangeHistory = algorithm.History(pyTradeBarType, pySymbol, start, end,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolDateRangeHistory = algorithm.History(pyTradeBarType, symbol, start, end,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSingleSymbolDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Generic, symbol array, time span\n                    var typedSymbolsTimeSpanHistory = algorithm.History(pyTradeBarType, pySymbols, timeSpan,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSymbolsTimeSpanHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Generic, symbol array, periods\n                    var typedSymbolsPeriodBasedHistory = algorithm.History(pyTradeBarType, pySymbols, periods,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSymbolsPeriodBasedHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n\n                    // Generic, symbol array, date range\n                    var typedSymbolsDateRangeHistory = algorithm.History(pyTradeBarType, pySymbols, start, end,\n                        resolution, fillForward: fillForward);\n                    AssertFillForwardHistoryResults(typedSymbolsDateRangeHistory, expectedTradeBarOnlyHistoryCount, resolution, fillForward);\n                }\n            }\n        }\n\n        // C#\n        [TestCase(Language.CSharp, Resolution.Minute, true, 60)]\n        [TestCase(Language.CSharp, Resolution.Minute, false, 30)]\n        [TestCase(Language.CSharp, Resolution.Second, true, 3600)]\n        [TestCase(Language.CSharp, Resolution.Second, false, 1800)]\n        // Python\n        [TestCase(Language.Python, Resolution.Minute, true, 60)]\n        [TestCase(Language.Python, Resolution.Minute, false, 30)]\n        [TestCase(Language.Python, Resolution.Second, true, 3600)]\n        [TestCase(Language.Python, Resolution.Second, false, 1800)]\n        public void HistoryRequestWithExtendedMarketHours(Language language, Resolution resolution, bool extendedMarket, int expectedHistoryCount)\n        {\n            var end = new DateTime(2013, 10, 08, 16, 30, 0);\n            var start = end - TimeSpan.FromHours(1);\n            var algorithm = GetAlgorithm(end);\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var extendedMarketPeriods = expectedHistoryCount;\n            var timeSpan = end - start;\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var noSymbolTimeSpanHistory = algorithm.History(timeSpan, resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(noSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // No symbol, periods\n                var noSymbolPeriodBasedHistory = algorithm.History(extendedMarketPeriods,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(noSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                //// No symbol, date range\n                //// TODO: to be implemented\n\n                // Single symbol, time span\n                var singleSymbolTimeSpanHistory = algorithm.History(symbol, timeSpan,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(singleSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Single symbol, periods\n                var singleSymbolPeriodBasedHistory = algorithm.History(symbol, extendedMarketPeriods,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(singleSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Single symbol, date range\n                var singleSymbolDateRangeHistory = algorithm.History(symbol, start, end,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(singleSymbolDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Symbol array, time span\n                var symbolsTimeSpanHistory = algorithm.History(new[] { symbol }, timeSpan,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(symbolsTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Symbol array, periods\n                var symbolsPeriodBasedHistory = algorithm.History(new[] { symbol }, extendedMarketPeriods,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(symbolsPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Symbol array, date range\n                var symbolsdateRangeHistory = algorithm.History(new[] { symbol }, start, end,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(symbolsdateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, no symbol, time span\n                var typedNoSymbolTimeSpanHistory = algorithm.History<TradeBar>(timeSpan,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedNoSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                //// Generic, no symbol, periods\n                //// TODO: to be implemented\n\n                //// Generic, no symbol, date range\n                //// TODO: to be implemented\n\n                // Generic, single symbol, time span\n                var typedSingleSymbolTimeSpanHistory = algorithm.History<TradeBar>(symbol, timeSpan,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, single symbol, periods\n                var typedSingleSymbolPeriodBasedHistory = algorithm.History<TradeBar>(symbol, extendedMarketPeriods,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, single symbol, date range\n                var typedSingleSymbolDateRangeHistory = algorithm.History<TradeBar>(symbol, start, end,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, symbol array, time span\n                var typedSymbolsTimeSpanHistory = algorithm.History<TradeBar>(new[] { symbol }, timeSpan,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSymbolsTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, symbol array, periods\n                var typedSymbolsPeriodBasedHistory = algorithm.History<TradeBar>(new[] { symbol }, extendedMarketPeriods,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSymbolsPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                // Generic, symbol array, date range\n                var typedSymbolsDateRangeHistory = algorithm.History<TradeBar>(new[] { symbol }, start, end,\n                    resolution, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSymbolsDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\ntradeBar = TradeBar\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTradeBarType = testModule.GetAttr(\"tradeBar\");\n\n                    // Single symbol, time span\n                    var singleSymbolTimeSpanHistory = algorithm.History(pySymbol, timeSpan,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(singleSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Single symbol, periods\n                    var singleSymbolPeriodBasedHistory = algorithm.History(pySymbol, extendedMarketPeriods,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(singleSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Single symbol, date range\n                    var singleSymbolDateRangeHistory = algorithm.History(pySymbol, start, end,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(singleSymbolDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Symbol array, time span\n                    var symbolsTimeSpanHistory = algorithm.History(pySymbols, timeSpan,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(symbolsTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Symbol array, periods\n                    var symbolsPeriodBasedHistory = algorithm.History(pySymbols, extendedMarketPeriods,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(symbolsPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Symbol array, date range\n                    var symbolsDateRangeHistory = algorithm.History(pySymbols, start, end,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(symbolsDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, single symbol, time span\n                    var typedSingleSymbolTimeSpanHistory = algorithm.History(pyTradeBarType, pySymbol, timeSpan,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolTimeSpanHistory = algorithm.History(pyTradeBarType, symbol, timeSpan,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, single symbol, periods\n                    var typedSingleSymbolPeriodBasedHistory = algorithm.History(pyTradeBarType, pySymbol,\n                        extendedMarketPeriods, resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolPeriodBasedHistory = algorithm.History(pyTradeBarType, symbol,\n                        extendedMarketPeriods, resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, single symbol, date range\n                    var typedSingleSymbolDateRangeHistory = algorithm.History(pyTradeBarType, pySymbol, start, end,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolDateRangeHistory = algorithm.History(pyTradeBarType, symbol, start, end,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, symbol array, time span\n                    var typedSymbolsTimeSpanHistory = algorithm.History(pyTradeBarType, pySymbols, timeSpan,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSymbolsTimeSpanHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, symbol array, periods\n                    var typedSymbolsPeriodBasedHistory = algorithm.History(pyTradeBarType, pySymbols, extendedMarketPeriods,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSymbolsPeriodBasedHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n\n                    // Generic, symbol array, date range\n                    var typedSymbolsDateRangeHistory = algorithm.History(pyTradeBarType, pySymbols, start, end,\n                        resolution, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSymbolsDateRangeHistory, expectedHistoryCount, extendedMarket, resolution, symbol);\n                }\n            }\n        }\n\n        // C#\n        [TestCase(Language.CSharp, true, 4023, 800)] // 4023, 800\n        [TestCase(Language.CSharp, false, 2056, 437)] // 2056, 437\n        // Python\n        [TestCase(Language.Python, true, 4023)]    //, 4023\n        [TestCase(Language.Python, false, 2056)] //, 2056\n        public void HistoryRequestWithExtendedMarketHoursTickResolution(\n            Language language,\n            bool extendedMarket,\n            int historyExpectedCount,\n            // History<T> methods that take multiple symbols still have a bug for Tick type,\n            // where slice.Get() returns only the last tick for each symbol, so the expected count is different\n            int cSharpTypedMultiSymbolHistoryExpectedCount = 0)\n        {\n            var start = new DateTime(2013, 10, 07, 15, 59, 55);\n            var end = start.AddSeconds(10);\n            var algorithm = GetAlgorithm(end);\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var timeSpan = end - start;\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var noSymbolTimeSpanHistory = algorithm.History(timeSpan, Resolution.Tick, extendedMarketHours: extendedMarket)\n                    .SelectMany(x => x.Ticks[symbol]).ToList();\n                AssertExtendedMarketHistoryResults(noSymbolTimeSpanHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                // No symbol, periods\n                // Not available for tick resolution\n\n                //// No symbol, date range\n                //// TODO: to be implemented\n\n                // Single symbol, time span\n                // Not available for tick resolution (TradeBar API)\n\n                // Single symbol, periods\n                // Not available for tick resolution\n\n                // Single symbol, date range\n                // Not available for tick resolution (TradeBar API)\n\n                // Symbol array, time span\n                var symbolsTimeSpanHistory = algorithm.History(new[] { symbol }, timeSpan,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).SelectMany(x => x.Ticks[symbol]).ToList();\n                AssertExtendedMarketHistoryResults(symbolsTimeSpanHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                // Symbol array, periods\n                // Not available for tick resolution\n\n                //// Symbol array, date range\n                var symbolsdateRangeHistory = algorithm.History(new[] { symbol }, start, end,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).SelectMany(x => x.Ticks[symbol]).ToList();\n                AssertExtendedMarketHistoryResults(symbolsdateRangeHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                // Generic, no symbol, time span\n                var typedNoSymbolTimeSpanHistory = algorithm.History<Tick>(timeSpan,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedNoSymbolTimeSpanHistory, cSharpTypedMultiSymbolHistoryExpectedCount, extendedMarket,\n                    Resolution.Tick, symbol);\n\n                //// Generic, no symbol, periods\n                //// TODO: to be implemented\n\n                //// Generic, no symbol, date range\n                //// TODO: to be implemented\n\n                //// Generic, single symbol, time span\n                var typedSingleSymbolTimeSpanHistory = algorithm.History<Tick>(symbol, timeSpan,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                // Generic, single symbol, periods\n                // Not available for tick resolution (TradeBar API)\n\n                //// Generic, single symbol, date range\n                var typedSingleSymbolDateRangeHistory = algorithm.History<Tick>(symbol, start, end,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                // Generic, symbol array, time span\n                var typedSymbolsTimeSpanHistory = algorithm.History<Tick>(new[] { symbol }, timeSpan,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSymbolsTimeSpanHistory, cSharpTypedMultiSymbolHistoryExpectedCount, extendedMarket,\n                    Resolution.Tick, symbol);\n\n                // Generic, symbol array, periods\n                // Not available for tick resolution (TradeBar API)\n\n                // Generic, symbol array, date range\n                var typedSymbolsDateRangeHistory = algorithm.History<Tick>(new[] { symbol }, start, end,\n                    Resolution.Tick, extendedMarketHours: extendedMarket).ToList();\n                AssertExtendedMarketHistoryResults(typedSymbolsDateRangeHistory, cSharpTypedMultiSymbolHistoryExpectedCount, extendedMarket,\n                    Resolution.Tick, symbol);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\ntick = Tick\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTickType = testModule.GetAttr(\"tick\");\n\n                    // Single symbol, time span\n                    var singleSymbolTimeSpanHistory = algorithm.History(pySymbol, timeSpan,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(singleSymbolTimeSpanHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                    // Single symbol, periods\n                    // Not available for tick resolution (TradeBar API)\n\n                    // Single symbol, date range\n                    var singleSymbolDateRangeHistory = algorithm.History(pySymbol, start, end,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(singleSymbolDateRangeHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                    // Symbol array, time span\n                    var symbolsTimeSpanHistory = algorithm.History(pySymbols, timeSpan,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(symbolsTimeSpanHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                    // Symbol array, periods\n                    // Not available for tick resolution (TradeBar API)\n\n                    // Symbol array, date range\n                    var symbolsDateRangeHistory = algorithm.History(pySymbols, start, end,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(symbolsDateRangeHistory, historyExpectedCount, extendedMarket, Resolution.Tick, symbol);\n\n                    // Generic, single symbol, time span\n                    var typedSingleSymbolTimeSpanHistory = algorithm.History(pyTickType, pySymbol, timeSpan,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolTimeSpanHistory = algorithm.History(pyTickType, symbol, timeSpan,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolTimeSpanHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n\n                    // Generic, single symbol, periods\n                    // Not available for tick resolution (TradeBar API)\n\n                    // Generic, single symbol, date range\n                    var typedSingleSymbolDateRangeHistory = algorithm.History(pyTickType, pySymbol, start, end,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n\n                    // Same as previous but using a Symbol instead of pySymbol\n                    typedSingleSymbolDateRangeHistory = algorithm.History(pyTickType, symbol, start, end,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSingleSymbolDateRangeHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n\n                    // Generic, symbol array, time span\n                    var typedSymbolsTimeSpanHistory = algorithm.History(pyTickType, pySymbols, timeSpan,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSymbolsTimeSpanHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n\n                    // Generic, symbol array, periods\n                    // Not available for tick resolution (TradeBar API)\n\n                    // Generic, symbol array, date range\n                    var typedSymbolsDateRangeHistory = algorithm.History(pyTickType, pySymbols, start, end,\n                        Resolution.Tick, extendedMarketHours: extendedMarket);\n                    AssertExtendedMarketHistoryResults(typedSymbolsDateRangeHistory, historyExpectedCount, extendedMarket,\n                        Resolution.Tick, symbol);\n                }\n            }\n        }\n\n        // C#\n        [TestCase(Language.CSharp, Resolution.Daily, 51)]\n        [TestCase(Language.CSharp, Resolution.Hour, 400)]\n        [TestCase(Language.CSharp, Resolution.Minute, 22395)]\n        // Python\n        [TestCase(Language.Python, Resolution.Daily, 51)]\n        [TestCase(Language.Python, Resolution.Hour, 400)]\n        [TestCase(Language.Python, Resolution.Minute, 22395)]\n        public void HistoryRequestWithDataMappingMode(Language language, Resolution resolution, int expectedHistoryCount)\n        {\n            var start = new DateTime(2013, 10, 11);\n            var end = new DateTime(2013, 12, 21);\n            var algorithm = GetAlgorithm(end);\n            var symbol = algorithm.AddFuture(Futures.Indices.SP500EMini, resolution, fillForward: true).Symbol;\n\n            var dataMappingModes = GetAllDataMappingModes();\n            var timeSpan = end - start;\n            var periods = expectedHistoryCount;\n\n            var expectedMappingDates = new List<DateTime>\n            {\n                // DataMappingMode.LastTradingDay (0)\n                new DateTime(2013, 12, 20),\n                // DataMappingMode.FirstDayMonth (1)\n                new DateTime(2013, 12, 02),\n                // DataMappingMode.OpenInterest (2)\n                new DateTime(2013, 12, 18),\n                // DataMappingMode.OpenInterestAnnual (3)\n                new DateTime(2013, 11, 18),\n            };\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var historyResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // No symbol, periods\n                historyResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(periods, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // No symbol, date range\n                // TODO: to be implemented\n\n                // Single symbols, time span\n                var tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(symbol, timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Single symbols, periods\n                tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(symbol, periods, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Single symbols, date range\n                tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(symbol, start, end, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Symbol array, time span\n                historyResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(new[] { symbol }, timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount, resolution, expectedMappingDates);\n\n                // Symbol array, periods\n                historyResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(new[] { symbol }, periods, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount, resolution, expectedMappingDates);\n\n                // Symbol array, date range\n                historyResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History(new[] { symbol }, start, end, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount, resolution, expectedMappingDates);\n\n                // Generic, no symbol, time span\n                var typedHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History<TradeBar>(timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, no symbol, periods\n                // TODO: to be implemented\n\n                // Generic, no symbol, date range\n                // TODO: to be implemented\n\n                // Generic, single symbol, time span\n                tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History<TradeBar>(symbol, timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, single symbol, periods\n                tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History<TradeBar>(symbol, periods, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, single symbol, date range\n                tradeBarHistoryResults = dataMappingModes\n                     .Select(mappingMode => algorithm.History<TradeBar>(symbol, start, end, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, symbol array, time span\n                typedHistoryResults = dataMappingModes\n                     .Select(mappingMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, timeSpan, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, symbol array, periods\n                typedHistoryResults = dataMappingModes\n                     .Select(mappingMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, periods, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n\n                // Generic, symbol array, date range\n                typedHistoryResults = dataMappingModes\n                     .Select(mappingMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, start, end, resolution, dataMappingMode: mappingMode).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentMappingModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution,\n                    expectedMappingDates);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\ntradeBar = TradeBar\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTradeBar = testModule.GetAttr(\"tradeBar\");\n\n                    // Single symbols, time span\n                    var historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbol, timeSpan, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, periods\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbol, periods, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, date range\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbol, start, end, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, time span\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbols, timeSpan, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, periods\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbols, periods, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, date range\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pySymbols, start, end, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, time span\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbol, timeSpan, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, symbol, timeSpan, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, periods\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbol, periods, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, symbol, periods, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, date range\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbol, start, end, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, symbol, start, end, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, time span\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbols, timeSpan, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, periods\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbols, periods, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, date range\n                    historyResults = dataMappingModes\n                        .Select(mappingMode => algorithm.History(pyTradeBar, pySymbols, start, end, resolution, dataMappingMode: mappingMode))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, symbol, expectedHistoryCount);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetHistoryWithDataNormalizationModeTestCases))]\n        public void HistoryRequestWithDataNormalizationMode(Language language, Symbol symbol, Resolution resolution,\n            DateTime start, DateTime end, int expectedHistoryCount)\n        {\n            var algorithm = GetAlgorithm(end);\n            algorithm.AddSecurity(symbol, fillForward: true);\n\n            var dataNormalizationModes = symbol.SecurityType == SecurityType.Equity\n                ? new[]\n                {\n                    DataNormalizationMode.Raw,\n                    DataNormalizationMode.Adjusted,\n                    DataNormalizationMode.SplitAdjusted\n                }\n                : new[]\n                {\n                    DataNormalizationMode.Raw,\n                    DataNormalizationMode.BackwardsRatio,\n                    DataNormalizationMode.BackwardsPanamaCanal,\n                    DataNormalizationMode.ForwardPanamaCanal\n                };\n            var timeSpan = end - start;\n            // Request periods is used to get the start and end dates only, the actual number of periods is expectedHistoryCount\n            var periods = expectedHistoryCount;\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var historyResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(timeSpan, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // No symbol, periods\n                historyResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(periods, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // No symbol, date range\n                // TODO: to be implemented\n\n                // Single symbols, time span\n                var tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(symbol, timeSpan, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Single symbols, periods\n                tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(symbol, periods, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Single symbols, date range\n                tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(symbol, start, end, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, time span\n                historyResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(new[] { symbol }, timeSpan, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, periods\n                historyResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(new[] { symbol }, periods, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, date range\n                historyResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History(new[] { symbol }, start, end, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, no symbol, time span\n                var typedHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History<TradeBar>(timeSpan, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, no symbol, periods\n                // TODO: to be implemented\n\n                // Generic, no symbol, date range\n                // TODO: to be implemented\n\n                // Generic, single symbol, time span\n                tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History<TradeBar>(symbol, timeSpan, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, single symbol, periods\n                tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History<TradeBar>(symbol, periods, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, single symbol, date range\n                tradeBarHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode => algorithm.History<TradeBar>(symbol, start, end, resolution,\n                        dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, time span\n                typedHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, timeSpan, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, periods\n                typedHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, periods, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, date range\n                typedHistoryResults = dataNormalizationModes\n                     .Select(normalizationMode =>\n                        algorithm.History<TradeBar>(new[] { symbol }, start, end, resolution, dataNormalizationMode: normalizationMode).ToList())\n                     .ToList();\n                AssertHistoryWithDifferentNormalizationModesResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\ntradeBar = TradeBar\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTradeBar = testModule.GetAttr(\"tradeBar\");\n\n                    // Single symbols, time span\n                    var historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbol, timeSpan, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, periods\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbol, periods, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, date range\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbol, start, end, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, time span\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbols, timeSpan, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, periods\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbols, periods, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, date range\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pySymbols, start, end, resolution, dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, time span\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbol, timeSpan, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, symbol, timeSpan, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, periods\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbol, periods, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, symbol, periods, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, date range\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbol, start, end, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, symbol, start, end, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, time span\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbols, timeSpan, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, periods\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbols, periods, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, date range\n                    historyResults = dataNormalizationModes\n                        .Select(normalizationMode => algorithm.History(pyTradeBar, pySymbols, start, end, resolution,\n                            dataNormalizationMode: normalizationMode))\n                        .ToList();\n                    AssertHistoryWithDifferentNormalizationModesResults(historyResults, symbol, expectedHistoryCount);\n                }\n            }\n        }\n\n        // C#\n        [TestCase(Language.CSharp, Resolution.Daily, 61)]\n        [TestCase(Language.CSharp, Resolution.Hour, 477)]\n        [TestCase(Language.CSharp, Resolution.Minute, 26670)]\n        // Python\n        [TestCase(Language.Python, Resolution.Daily, 61)]\n        [TestCase(Language.Python, Resolution.Hour, 477)]\n        [TestCase(Language.Python, Resolution.Minute, 26670)]\n        public void HistoryRequestWithContracDepthOffsets(Language language, Resolution resolution, int expectedHistoryCount)\n        {\n            var start = new DateTime(2013, 10, 07);\n            var end = new DateTime(2014, 1, 1);\n            var algorithm = GetAlgorithm(end);\n            var symbol = algorithm.AddFuture(Futures.Indices.SP500EMini, fillForward: true).Symbol;\n\n            var timeSpan = end - start;\n            // We are lacking minute data for the contract used for offset=2 on the request start date computed minute when using periods,\n            // So we use a slightly larger number of periods to compensate for that.\n            var periods = resolution != Resolution.Minute ? expectedHistoryCount : (int)(expectedHistoryCount * 1.001);\n            var offsets = new[] { 0, 1, 2 };\n\n            if (language == Language.CSharp)\n            {\n                // No symbol, time span\n                var historyResults = offsets\n                     .Select(offset => algorithm.History(timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // No symbol, periods\n                historyResults = offsets\n                     .Select(offset => algorithm.History(periods, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // No symbol, date range\n                // TODO: to be implemented\n\n                // Single symbols, time span\n                var tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History(symbol, timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Single symbols, periods\n                tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History(symbol, periods, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Single symbols, date range\n                tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History(symbol, start, end, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, time span\n                historyResults = offsets\n                     .Select(offset => algorithm.History(new[] { symbol }, timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, periods\n                historyResults = offsets\n                     .Select(offset => algorithm.History(new[] { symbol }, periods, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Symbol array, date range\n                historyResults = offsets\n                     .Select(offset => algorithm.History(new[] { symbol }, start, end, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, no symbol, time span\n                var typedHistoryResults = offsets\n                     .Select(offset => algorithm.History<TradeBar>(timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, no symbol, periods\n                // TODO: to be implemented\n\n                // Generic, no symbol, date range\n                // TODO: to be implemented\n\n                // Generic, single symbol, time span\n                tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History<TradeBar>(symbol, timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, single symbol, periods\n                tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History<TradeBar>(symbol, periods, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, single symbol, date range\n                tradeBarHistoryResults = offsets\n                     .Select(offset => algorithm.History<TradeBar>(symbol, start, end, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(tradeBarHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, time span\n                typedHistoryResults = offsets\n                     .Select(offset =>\n                        algorithm.History<TradeBar>(new[] { symbol }, timeSpan, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, periods\n                typedHistoryResults = offsets\n                     .Select(offset =>\n                        algorithm.History<TradeBar>(new[] { symbol }, periods, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n\n                // Generic, symbol array, date range\n                typedHistoryResults = offsets\n                     .Select(offset =>\n                        algorithm.History<TradeBar>(new[] { symbol }, start, end, resolution, contractDepthOffset: offset).ToList())\n                     .ToList();\n                AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(typedHistoryResults, symbol, expectedHistoryCount, resolution);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\ntradeBar = TradeBar\n                    \");\n\n                    algorithm.SetPandasConverter();\n                    using var pySymbol = symbol.ToPython();\n                    using var pySymbols = new PyList(new[] { pySymbol });\n                    using var pyTradeBar = testModule.GetAttr(\"tradeBar\");\n\n                    // Single symbols, time span\n                    var historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbol, timeSpan, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, periods\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbol, periods, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Single symbols, date range\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbol, start, end, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, time span\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbols, timeSpan, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, periods\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbols, periods, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Symbol array, date range\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pySymbols, start, end, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, time span\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbol, timeSpan, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, symbol, timeSpan, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, periods\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbol, periods, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, symbol, periods, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, single symbol, date range\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbol, start, end, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n                    // Same as previous but using a Symbol instead of pySymbol\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, symbol, start, end, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, time span\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbols, timeSpan, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, periods\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbols, periods, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n\n                    // Generic, symbol array, date range\n                    historyResults = offsets\n                        .Select(offset => algorithm.History(pyTradeBar, pySymbols, start, end, resolution, contractDepthOffset: offset))\n                        .ToList();\n                    AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(historyResults, symbol, expectedHistoryCount);\n                }\n            }\n        }\n\n        // USA Equity market hours: 4am-9:30am (pre-market), 9:30am-4pm (regular market), 4pm-8pm (post-market)\n        // 6.5h (regular market duration) (rounded to 7)\n        [TestCase(Resolution.Hour, false, false, 7)]\n        // Hour resolution doesn't have extended hours data\n        [TestCase(Resolution.Hour, false, true, 7)]\n        [TestCase(Resolution.Hour, true, false, 7)]\n        [TestCase(Resolution.Hour, true, true, 7)]\n        [TestCase(Resolution.Hour, false, null, 7)]\n        [TestCase(Resolution.Hour, true, null, 7)]\n        // 390 = 6.5h (regular market duration) * 60min/h = 390min (bars)\n        [TestCase(Resolution.Minute, false, false, 390)]\n        // 960 = [5.5h (pre-market duration) + 6.5h (regular market duration) + 4h (post-market duration)] * 60min/h = 16h * 60min/h = 960min (bars)\n        [TestCase(Resolution.Minute, false, true, 960)]\n        [TestCase(Resolution.Minute, true, false, 390)]\n        [TestCase(Resolution.Minute, true, true, 960)]\n        [TestCase(Resolution.Minute, false, null, 390)]\n        [TestCase(Resolution.Minute, true, null, 960)]\n        [TestCase(Resolution.Second, false, false, 390 * 60)]\n        [TestCase(Resolution.Second, false, true, 960 * 60)]\n        [TestCase(Resolution.Second, true, false, 390 * 60)]\n        [TestCase(Resolution.Second, true, true, 960 * 60)]\n        [TestCase(Resolution.Second, false, null, 390 * 60)]\n        [TestCase(Resolution.Second, true, null, 960 * 60)]\n        public void HistoryRequestFactoryGetsTheRightStartTimeForBarCount(Resolution resolution, bool assetWithExtendedMarket,\n            bool? requestWithExtendedMarket, int requestPeriods)\n        {\n            var start = new DateTime(2014, 06, 09);\n            var end = new DateTime(2014, 06, 10);\n            var algorithm = GetAlgorithm(end);\n            var aapl = algorithm.AddEquity(\"AAPL\", extendedMarketHours: assetWithExtendedMarket);\n            var config = algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(aapl.Symbol).First();\n            var exchangeHours = aapl.Exchange.Hours;\n\n            var historyRequestFactory = new HistoryRequestFactory(algorithm);\n            var extendedMarket = resolution != Resolution.Hour ? requestWithExtendedMarket ?? assetWithExtendedMarket : false;\n            var marketOpen = exchangeHours.GetNextMarketOpen(start, extendedMarketHours: extendedMarket);\n            if (resolution == Resolution.Hour)\n            {\n                // Adjust the expected start in case the regular hours segment is not an exact int number of hours\n                var marketClose = exchangeHours.GetNextMarketClose(marketOpen, extendedMarketHours: extendedMarket);\n                marketOpen += TimeSpan.FromHours((marketClose.TimeOfDay - marketOpen.TimeOfDay).TotalHours - requestPeriods);\n            }\n\n            var requestStart = historyRequestFactory.GetStartTimeAlgoTz(aapl.Symbol, requestPeriods, resolution, exchangeHours,\n                config.DataTimeZone, config.Type, extendedMarketHours: requestWithExtendedMarket);\n            Assert.AreEqual(marketOpen, requestStart);\n        }\n\n        // This reproduces https://github.com/QuantConnect/Lean/issues/7504\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DefaultAlwaysOpenMarketHoursForBaseSecurityType(Language language)\n        {\n            var start = new DateTime(2013, 10, 8);\n            var end = start.AddDays(1);\n            var algorithm = GetAlgorithm(end);\n\n            if (language == Language.CSharp)\n            {\n                var spy = algorithm.AddEquity(\"SPY\").Symbol;\n                // We will try to fetch history without a subscription\n                var customSymbol = Symbol.CreateBase(typeof(CustomData), spy);\n\n                List<CustomData> history = null;\n                Assert.DoesNotThrow(() => history = algorithm.History<CustomData>(customSymbol, start, end, Resolution.Minute).ToList());\n                Console.WriteLine(history.Count);\n                Assert.IsNotEmpty(history);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic getHistory = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\nclass TestPythonCustomData(PythonData):\n    def GetSource(self, config, date, isLiveMode):\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, config.Resolution, config.TickType)\n        source = f'{Globals.DataFolder}equity/usa/minute/spy/{fileName}'\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def Reader(self, config, line, date, isLiveMode):\n        data = line.split(',')\n\n        result = TestPythonCustomData()\n        result.DataType = MarketDataType.Base\n        result.Symbol = config.Symbol\n        result.Time = date.date() + timedelta(milliseconds=int(data[0]))\n        result.Value = float(data[4])\n        result[\"\"Open\"\"] = float(data[1])\n        result[\"\"High\"\"] = float(data[2])\n        result[\"\"Low\"\"] = float(data[3])\n        result[\"\"Close\"\"] = float(data[4])\n\n        return result\n\ndef getHistory(algorithm, start, end):\n    spy = algorithm.AddEquity(\"\"SPY\"\").Symbol\n    customSymbol = Symbol.CreateBase(TestPythonCustomData, spy, Market.USA)\n\n    return algorithm.History(TestPythonCustomData, customSymbol, start, end, Resolution.Minute)\n        \").GetAttr(\"getHistory\");\n\n                    algorithm.SetPandasConverter();\n\n                    dynamic history = null;\n                    Assert.DoesNotThrow(() => history = getHistory(algorithm, start, end));\n                    Assert.IsNotNull(history);\n                    Assert.Greater(history.shape[0].As<int>(), 0);\n                }\n            }\n        }\n\n        [Test]\n        public void PythonCustomDataThrowing()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n            algorithm.SetHistoryProvider(new ThrowingHistoryProvider());\n\n            using (Py.GIL())\n            {\n                PythonInitializer.Initialize();\n                algorithm.SetPandasConverter();\n\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistory(algorithm, symbol, period):\n    return algorithm.History(symbol, period, Resolution.Minute)\n    \");\n                dynamic getDateRangeHistory = testModule.GetAttr(\"getHistory\");\n\n                Assert.Throws<ClrBubbledException>(() => getDateRangeHistory(algorithm, Symbols.AAPL, 10));\n            }\n        }\n\n        [Test]\n        public void PythonUniverseHistoryDataFramesAreFlattened()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 03, 28));\n            var universe = algorithm.AddUniverse(x => x.Select(x => x.Symbol));\n\n            using (Py.GIL())\n            {\n                PythonInitializer.Initialize();\n                algorithm.SetPandasConverter();\n\n                var testModule = PyModule.FromString(\"PythonHistoryDataFramesAreFlattened\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getFlattenedUniverseHistory(algorithm, universe, period):\n    return algorithm.history(universe, period, flatten=True)\n\ndef getUnflattenedUniverseHistory(algorithm, universe, period):\n    return algorithm.history(universe, period)\n\ndef assertFlattenedHistoryDates(df, expected_dates):\n    assert df.index.levels[0].to_list() == expected_dates, f'Expected dates: {expected_dates}, actual dates: {df.index.levels[0].to_list()}'\n\ndef assertUnflattenedHistoryDates(df, expected_dates):\n    assert df.index.to_list() == expected_dates, f'Expected dates: {expected_dates}, actual dates: {df.index.levels[0].to_list()}'\n\ndef assertConstituents(flattened_df, unflattened_df, dates, expected_constituents_per_date):\n    for i, date in enumerate(dates):\n        unflattened_universe = unflattened_df.loc[date]\n        assert isinstance(unflattened_universe, list), f'Unflattened DF: expected a list, found {type(unflattened_universe)}'\n        assert len(unflattened_universe) == expected_constituents_per_date[i], f'Unflattened DF: expected {expected_constituents_per_date[i]} constituents for date {date}, got {len(unflattened_universe)}'\n\n        for constituent in unflattened_universe:\n            assert isinstance(constituent, Fundamental), f'Unflattened DF: expected a list of Fundamental, found {type(constituent)}'\n\n        flattened_sub_df = flattened_df.loc[date]\n        assert flattened_sub_df.shape[0] == len(unflattened_universe), f'Flattened DF: expected {len(unflattened_universe)} rows for date {date}, got {flattened_sub_df.shape[0]}'\n\n        flattened_universe_symbols = flattened_sub_df.index.to_list()\n        unflattened_universe_symbols = [constituent.symbol for constituent in unflattened_universe]\n        flattened_universe_symbols.sort()\n        unflattened_universe_symbols.sort()\n        assert flattened_universe_symbols == unflattened_universe_symbols, f'Flattened DF: flattened universe symbols are not equal to unflattened universe symbols for date {date}'\n    \");\n                dynamic getFlattenedUniverseHistory = testModule.GetAttr(\"getFlattenedUniverseHistory\");\n                var flattenedDf = getFlattenedUniverseHistory(algorithm, universe, 3);\n\n                dynamic getUnflattenedUniverseHistory = testModule.GetAttr(\"getUnflattenedUniverseHistory\");\n                var unflattenedDf = getUnflattenedUniverseHistory(algorithm, universe, 3);\n                // Drop the symbol\n                unflattenedDf = unflattenedDf.droplevel(0);\n\n                var expectedDates = new List<DateTime>\n                {\n                    new DateTime(2014, 03, 26),\n                    new DateTime(2014, 03, 27),\n                    new DateTime(2014, 03, 28)\n                };\n                dynamic assertFlattenedHistoryDates = testModule.GetAttr(\"assertFlattenedHistoryDates\");\n                AssertDesNotThrowPythonException(() => assertFlattenedHistoryDates(flattenedDf, expectedDates));\n\n                dynamic assertUnflattenedHistoryDates = testModule.GetAttr(\"assertUnflattenedHistoryDates\");\n                AssertDesNotThrowPythonException(() => assertUnflattenedHistoryDates(unflattenedDf, expectedDates));\n\n                var expectedConstituentsCounts = new[] { 7068, 7055, 7049 };\n                dynamic assertConstituents = testModule.GetAttr(\"assertConstituents\");\n                AssertDesNotThrowPythonException(() => assertConstituents(flattenedDf, unflattenedDf, expectedDates, expectedConstituentsCounts));\n            }\n        }\n\n        [Test]\n        public void CSharpCustomUniverseHistoryDataFramesHaveExpectedFormat()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2015, 01, 15));\n            var universe = algorithm.AddUniverse<CustomUniverseData>(\"CustomUniverse\", Resolution.Daily, (x) => x.Select(y => y.Symbol));\n\n            using (Py.GIL())\n            {\n                PythonInitializer.Initialize();\n                algorithm.SetPandasConverter();\n\n                using var testModule = PyModule.FromString(\"PythonCustomUniverseHistoryDataFramesHaveExpectedFormat\",\n                    $@\"\nfrom AlgorithmImports import *\n\ndef get_universe_history(algorithm, universe, flatten):\n    return algorithm.history(universe, 3, flatten=flatten)\n    \");\n\n                dynamic getUniverseHistory = testModule.GetAttr(\"get_universe_history\");\n                var df = getUniverseHistory(algorithm, universe, false);\n                var flattenedDf = getUniverseHistory(algorithm, universe, true);\n\n                Func<CustomUniverseData, decimal> getWeight = (data) => data.Weight;\n                AssertCustomUniverseDataFrames(df, flattenedDf, getWeight);\n\n                var columns = ((List<PyObject>)flattenedDf.columns.to_list().As<List<PyObject>>())\n                    .Select(column => column.InvokeMethod(\"__str__\").GetAndDispose<string>());\n                CollectionAssert.DoesNotContain(columns, \"data\");\n            }\n        }\n\n        [Test]\n        public void PythonCustomUniverseHistoryDataFramesHaveExpectedFormat()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2015, 01, 15));\n\n            using (Py.GIL())\n            {\n                PythonInitializer.Initialize();\n                algorithm.SetPandasConverter();\n\n                using var testModule = PyModule.FromString(\"PythonCustomUniverseHistoryDataFramesHaveExpectedFormat\",\n                    $@\"\nfrom AlgorithmImports import *\n\nclass CustomUniverseData(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        return SubscriptionDataSource('TestData/portfolio_targets.csv',\n                                      SubscriptionTransportMedium.LOCAL_FILE,\n                                      FileFormat.FOLDING_COLLECTION)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> BaseData:\n        # Skip the header row.\n        if not line[0].isnumeric():\n            return None\n        items = line.split(',')\n        data = CustomUniverseData()\n        data.end_time = datetime.strptime(items[0], '%Y-%m-%d')\n        data.time = data.end_time - timedelta(1)\n        data.symbol = Symbol.create(items[1], SecurityType.EQUITY, Market.USA)\n        data['weight'] = float(items[2])\n        return data\n\ndef get_universe_history(algorithm, flatten):\n    universe = algorithm.add_universe(CustomUniverseData, 'CustomUniverse', Resolution.DAILY, lambda alt_coarse: [x.symbol for x in alt_coarse])\n    return algorithm.history(universe, 3, flatten=flatten)\n\n    \");\n\n                dynamic getUniverseHistory = testModule.GetAttr(\"get_universe_history\");\n                var df = getUniverseHistory(algorithm, false);\n                var flattenedDf = getUniverseHistory(algorithm, true);\n\n                Func<PythonData, decimal> getWeight = (data) => Convert.ToDecimal(data.GetProperty(\"weight\"));\n                AssertCustomUniverseDataFrames(df, flattenedDf, getWeight);\n            }\n        }\n\n        [Test]\n        public void PythonCustomUniverseHistoryCanBeFetchedUsingCSharpApi()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2018, 6, 1));\n\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"PythonCustomUniverseHistoryCanBeFetchedUsingCSharpApi\",\n                    @\"\nfrom AlgorithmImports import *\n\n\nclass StockDataSource(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        source = \"\"../../TestData/daily-stock-picker-backtest.csv\"\"\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        if not (line.strip() and line[0].isdigit()): return None\n\n        stocks = StockDataSource()\n        stocks.symbol = config.symbol\n\n        try:\n            csv = line.split(',')\n            stocks.time = datetime.strptime(csv[0], \"\"%Y%m%d\"\")\n            stocks.end_time = stocks.time + timedelta(days=1)\n            stocks[\"\"Symbols\"\"] = csv[1:]\n\n        except ValueError:\n            # Do nothing\n            return None\n\n        return stocks\n\ndef universe_selector(data):\n        return [x.symbol for x in data]\n\ndef add_universe(algorithm):\n    return algorithm.add_universe(StockDataSource, \"\"universe-stock-data-source\"\", Resolution.DAILY, universe_selector)\n\ndef get_history(algorithm, universe):\n    return list(algorithm.history[StockDataSource](universe.symbol, datetime(2018, 1, 1), datetime(2018, 6, 1), Resolution.DAILY))\n\");\n\n                dynamic getUniverse = testModule.GetAttr(\"add_universe\");\n                dynamic getHistory = testModule.GetAttr(\"get_history\");\n\n                var universe = getUniverse(algorithm);\n                var history = getHistory(algorithm, universe).As<List<PythonData>>() as List<PythonData>;\n                Assert.IsNotEmpty(history);\n            }\n        }\n\n        [Test]\n        public void PythonCustomDataHistoryCanBeFetchedUsingCSharpApi()\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 8));\n\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"PythonCustomDataHistoryCanBeFetchedUsingCSharpApi\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\nclass MyCustomDataType(PythonData):\n\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, Resolution.MINUTE, config.TickType)\n        source = f'{Globals.DataFolder}equity/usa/minute/spy/{fileName}'\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        data = line.split(',')\n        result = MyCustomDataType()\n        result.DataType = MarketDataType.Base\n        result.Symbol = config.Symbol\n        result.Time = date + timedelta(milliseconds=int(data[0]))\n        result.Value = 1\n\n        return result\n\ndef add_data(algorithm):\n    return algorithm.add_data(MyCustomDataType, \"\"MyCustomDataType\"\", Resolution.DAILY)\n\ndef get_history(algorithm, security):\n    return list(algorithm.history[MyCustomDataType](security.symbol, datetime(2013, 10, 7), datetime(2013, 10, 8), Resolution.MINUTE))\n\");\n\n                dynamic getCustomSecurity = testModule.GetAttr(\"add_data\");\n                dynamic getHistory = testModule.GetAttr(\"get_history\");\n\n                var security = getCustomSecurity(algorithm);\n                var history = getHistory(algorithm, security).As<List<PythonData>>() as List<PythonData>;\n                Assert.IsNotEmpty(history);\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void HistoryHandlesSymbolChangedEventsCorrectly(bool useCreateSymbol)\n        {\n            var start = new DateTime(2021, 1, 1);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2021, 1, 5);\n\n            Symbol symbol;\n            if (useCreateSymbol)\n            {\n                symbol = Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n            }\n            else\n            {\n                var future = _algorithm.AddFuture(\n                    Futures.Indices.SP500EMini,\n                    dataMappingMode: DataMappingMode.OpenInterest,\n                    dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                    contractDepthOffset: 0);\n                symbol = future.Symbol;\n            }\n\n            // Retrieve historical SymbolChangedEvent data\n            var history = _algorithm.History<SymbolChangedEvent>(symbol, TimeSpan.FromDays(365)).ToList();\n\n            // Ensure the history contains symbol change events\n            Assert.IsNotEmpty(history);\n            Assert.AreEqual(4, history.Count);\n\n            // Verify each event has valid old and new symbols, and they are different\n            foreach (var symbolChangedEvent in history)\n            {\n                Assert.IsNotNull(symbolChangedEvent.OldSymbol);\n                Assert.IsNotNull(symbolChangedEvent.NewSymbol);\n                Assert.AreNotEqual(symbolChangedEvent.OldSymbol, symbolChangedEvent.NewSymbol);\n            }\n        }\n\n        [Test]\n        public void OpenInterestHistoryOnlyContainsDataDuringRegularTradingHours()\n        {\n            var start = new DateTime(2013, 12, 01);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2013, 12, 31);\n\n            // Add ES (E-mini S&P 500)\n            var future = _algorithm.AddFuture(\"ES\", Resolution.Daily, Market.CME);\n\n            var history = _algorithm.History<OpenInterest>(future.Symbol, new DateTime(2013, 10, 10), new DateTime(2013, 11, 01), Resolution.Daily).ToList();\n\n            /* Expected 16 trading days breakdown:\n                October 2013:\n                10(Thu), 11(Fri),\n                14(Mon), 15(Tue), 16(Wed), 17(Thu), 18(Fri),\n                21(Mon), 22(Tue), 23(Wed), 24(Thu), 25(Fri),\n                28(Mon), 29(Tue), 30(Wed), 31(Thu)\n            */\n            Assert.AreEqual(16, history.Count);\n\n            // Regular trading hours: Monday-Friday 9:30am-5:00pm ET\n            foreach (var data in history)\n            {\n                var date = data.EndTime;\n                var dayOfWeek = date.DayOfWeek;\n                Assert.AreNotEqual(DayOfWeek.Saturday, dayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, dayOfWeek);\n            }\n        }\n\n        [TestCase(true, Resolution.Tick, true, false, false)]\n        [TestCase(true, Resolution.Tick, false, false, false)]\n        [TestCase(true, Resolution.Tick, true, true, false)]\n        [TestCase(true, Resolution.Second, true, true, false)]\n        [TestCase(true, Resolution.Minute, true, true, false)]\n        [TestCase(true, Resolution.Hour, true, true, false)]\n        [TestCase(true, Resolution.Daily, true, true, false)]\n        [TestCase(true, Resolution.Tick, false, true, false)]\n        [TestCase(true, Resolution.Second, false, true, false)]\n        [TestCase(true, Resolution.Minute, false, true, false)]\n        [TestCase(true, Resolution.Hour, false, true, false)]\n        [TestCase(true, Resolution.Daily, false, true, false)]\n        [TestCase(false, null, false, true, false)]\n\n        [TestCase(true, Resolution.Tick, true, false, true)]\n        [TestCase(true, Resolution.Tick, false, false, true)]\n        [TestCase(true, Resolution.Tick, true, true, true)]\n        [TestCase(true, Resolution.Second, true, true, true)]\n        [TestCase(true, Resolution.Minute, true, true, true)]\n        [TestCase(true, Resolution.Hour, true, true, true)]\n        [TestCase(true, Resolution.Daily, true, true, true)]\n        [TestCase(true, Resolution.Tick, false, true, true)]\n        [TestCase(true, Resolution.Second, false, true, true)]\n        [TestCase(true, Resolution.Minute, false, true, true)]\n        [TestCase(true, Resolution.Hour, false, true, true)]\n        [TestCase(true, Resolution.Daily, false, true, true)]\n        [TestCase(false, null, false, true, true)]\n        public void OpenInterestReturnsConsistentResultsWithOrWithoutContract(bool addFutureContract, Resolution resolution, bool extendedMarketHours, bool specifyResolution, bool useContinuous)\n        {\n            var start = new DateTime(2013, 10, 09);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2013, 10, 10);\n\n            Symbol symbol;\n            if (useContinuous)\n            {\n                symbol = Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX);\n                if (addFutureContract)\n                {\n                    _algorithm.AddSecurity(symbol, resolution, extendedMarketHours: extendedMarketHours);\n                }\n            }\n            else\n            {\n                symbol = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2013, 10, 29));\n                if (addFutureContract)\n                {\n                    _algorithm.AddFutureContract(symbol, resolution, extendedMarketHours: extendedMarketHours);\n                }\n            }\n\n            var typedTickHistory = _algorithm.History<OpenInterest>([symbol], TimeSpan.FromDays(1), specifyResolution ? Resolution.Minute : null);\n            var typedTicks = typedTickHistory\n                .SelectMany(x => x.Values)\n                .ToList();\n\n            var typedQuoteTicks = typedTicks.Where(t => t.TickType == TickType.Quote).ToList();\n            var typedTradeTicks = typedTicks.Where(t => t.TickType == TickType.Trade).ToList();\n            var typedOpenInterestTicks = typedTicks.Where(t => t.TickType == TickType.OpenInterest).ToList();\n\n            Assert.AreEqual(0, typedQuoteTicks.Count);\n            Assert.AreEqual(typedQuoteTicks.Count, typedTradeTicks.Count);\n            Assert.AreNotEqual(0, typedOpenInterestTicks.Count);\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(1254, typedOpenInterestTicks.Count);\n            }\n            else\n            {\n                Assert.AreEqual(452, typedOpenInterestTicks.Count);\n            }\n        }\n\n        [TestCase(true, Resolution.Tick, true, false, false)]\n        [TestCase(true, Resolution.Tick, false, false, false)]\n        [TestCase(true, Resolution.Tick, true, true, false)]\n        [TestCase(true, Resolution.Second, true, true, false)]\n        [TestCase(true, Resolution.Minute, true, true, false)]\n        [TestCase(true, Resolution.Hour, true, true, false)]\n        [TestCase(true, Resolution.Daily, true, true, false)]\n        [TestCase(true, Resolution.Tick, false, true, false)]\n        [TestCase(true, Resolution.Second, false, true, false)]\n        [TestCase(true, Resolution.Minute, false, true, false)]\n        [TestCase(true, Resolution.Hour, false, true, false)]\n        [TestCase(true, Resolution.Daily, false, true, false)]\n        [TestCase(false, null, false, true, false)]\n\n        [TestCase(true, Resolution.Tick, true, false, true)]\n        [TestCase(true, Resolution.Tick, false, false, true)]\n        [TestCase(true, Resolution.Tick, true, true, true)]\n        [TestCase(true, Resolution.Second, true, true, true)]\n        [TestCase(true, Resolution.Minute, true, true, true)]\n        [TestCase(true, Resolution.Hour, true, true, true)]\n        [TestCase(true, Resolution.Daily, true, true, true)]\n        [TestCase(true, Resolution.Tick, false, true, true)]\n        [TestCase(true, Resolution.Second, false, true, true)]\n        [TestCase(true, Resolution.Minute, false, true, true)]\n        [TestCase(true, Resolution.Hour, false, true, true)]\n        [TestCase(true, Resolution.Daily, false, true, true)]\n        [TestCase(false, null, false, true, true)]\n        public void TickHistoryReturnsConsistentResultsWithOrWithoutContract(bool addFutureContract, Resolution resolution, bool extendedMarketHours, bool specifyResolution, bool useContinuous)\n        {\n            var start = new DateTime(2013, 10, 07, 20, 0, 0);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2013, 10, 10);\n\n            Symbol symbol;\n            if (useContinuous)\n            {\n                symbol = Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX);\n                if (addFutureContract)\n                {\n                    _algorithm.AddSecurity(symbol, resolution, extendedMarketHours: extendedMarketHours);\n                }\n            }\n            else\n            {\n                symbol = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2013, 10, 29));\n                if (addFutureContract)\n                {\n                    _algorithm.AddFutureContract(symbol, resolution, extendedMarketHours: extendedMarketHours);\n                }\n            }\n\n            var history = _algorithm.History([symbol], TimeSpan.FromHours(8), specifyResolution ? Resolution.Tick : null);\n            var typedTickHistory = _algorithm.History<Tick>([symbol], TimeSpan.FromHours(8), specifyResolution ? Resolution.Tick : null);\n\n            var extractedTicks = history\n                .Select(x => x.Get<Tick>())\n                .Where(x => x.Count > 0)\n                .SelectMany(x => x.Values)\n                .ToList();\n\n            var typedTicks = typedTickHistory\n                .SelectMany(x => x.Values)\n                .ToList();\n\n            var quoteTicks = extractedTicks.Where(t => t.TickType == TickType.Quote).ToList();\n            var tradeTicks = extractedTicks.Where(t => t.TickType == TickType.Trade).ToList();\n\n            var typedQuoteTicks = typedTicks.Where(t => t.TickType == TickType.Quote).ToList();\n            var typedTradeTicks = typedTicks.Where(t => t.TickType == TickType.Trade).ToList();\n\n            Assert.IsTrue(typedTicks.Count > 0);\n            Assert.AreEqual(extractedTicks.Count, typedTicks.Count);\n            Assert.IsTrue(quoteTicks.Count > 0);\n            Assert.IsTrue(tradeTicks.Count > 0);\n            Assert.AreEqual(typedQuoteTicks.Count, quoteTicks.Count);\n            Assert.AreEqual(typedTradeTicks.Count, tradeTicks.Count);\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(11950, extractedTicks.Count);\n                Assert.AreEqual(11944, typedQuoteTicks.Count);\n                Assert.AreEqual(6, typedTradeTicks.Count);\n            }\n            else\n            {\n                Assert.AreEqual(10743, extractedTicks.Count);\n                Assert.AreEqual(10737, typedQuoteTicks.Count);\n                Assert.AreEqual(6, typedTradeTicks.Count);\n            }\n        }\n\n        [TestCase(true, Resolution.Tick, true)]\n        [TestCase(true, Resolution.Second, true)]\n        [TestCase(true, Resolution.Minute, true)]\n        [TestCase(true, Resolution.Hour, true)]\n        [TestCase(true, Resolution.Daily, true)]\n        [TestCase(true, Resolution.Tick, false)]\n        [TestCase(true, Resolution.Second, false)]\n        [TestCase(true, Resolution.Minute, false)]\n        [TestCase(true, Resolution.Hour, false)]\n        [TestCase(true, Resolution.Daily, false)]\n        [TestCase(false, null, false)]\n        public void TickHistoryReturnsConsistentResultsWithOrWithoutEquity(bool addEquity, Resolution resolution, bool extendedMarketHours)\n        {\n            var start = new DateTime(2013, 10, 07);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2013, 10, 11);\n\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            if (addEquity)\n            {\n                _algorithm.AddEquity(\"SPY\", resolution, extendedMarketHours: extendedMarketHours);\n            }\n\n            _algorithm.SetDateTime(new DateTime(2013, 10, 07, 16, 00, 3).ConvertToUtc(_algorithm.TimeZone));\n            var history = _algorithm.History([symbol], TimeSpan.FromSeconds(6), Resolution.Tick).ToList();\n            var typedTickHistory = _algorithm.History<Tick>([symbol], TimeSpan.FromSeconds(6), Resolution.Tick).ToList();\n\n            var extractedTicks = history\n                .Select(x => x.Get<Tick>())\n                .Where(x => x.Count > 0)\n                .SelectMany(x => x.Values)\n                .ToList();\n\n            var typedTicks = typedTickHistory\n                .SelectMany(x => x.Values)\n                .ToList();\n\n            var quoteTicks = extractedTicks.Where(t => t.TickType == TickType.Quote).ToList();\n            var tradeTicks = extractedTicks.Where(t => t.TickType == TickType.Trade).ToList();\n\n            var typedQuoteTicks = typedTicks.Where(t => t.TickType == TickType.Quote).ToList();\n            var typedTradeTicks = typedTicks.Where(t => t.TickType == TickType.Trade).ToList();\n\n            Assert.IsTrue(typedTickHistory.Count > 0);\n            Assert.AreEqual(extractedTicks.Count, typedTickHistory.Count);\n            Assert.IsTrue(quoteTicks.Count > 0);\n            Assert.IsTrue(tradeTicks.Count > 0);\n            Assert.AreEqual(typedQuoteTicks.Count, quoteTicks.Count);\n            Assert.AreEqual(typedTradeTicks.Count, tradeTicks.Count);\n\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(521, extractedTicks.Count);\n                Assert.AreEqual(357, typedQuoteTicks.Count);\n                Assert.AreEqual(164, typedTradeTicks.Count);\n            }\n            else\n            {\n                Assert.AreEqual(263, extractedTicks.Count);\n                Assert.AreEqual(156, typedQuoteTicks.Count);\n                Assert.AreEqual(107, typedTradeTicks.Count);\n            }\n        }\n\n        private static IEnumerable<TestCaseData> GetCustomNonOptionDataHistoryForOptionConfigTestCases()\n        {\n            foreach (var language in new[] { Language.CSharp, Language.Python })\n            {\n                foreach (var symbol in new[] { Symbols.SPY, Symbols.SPY_Option_Chain, Symbols.Future_ESZ18_Dec2018 })\n                {\n                    yield return new TestCaseData(language, symbol);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetCustomNonOptionDataHistoryForOptionConfigTestCases))]\n        public void DoesNotThrowForCustomNonOptionDataHistoryForOptionConfig(Language language, Symbol symbol)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2014, 04, 07));\n\n            if (language == Language.CSharp)\n            {\n                var history = (List<DataDictionary<CustomFundamentalTestData>>)null;\n                Assert.DoesNotThrow(() =>\n                {\n                    history = algorithm.History<CustomFundamentalTestData>([symbol], 10, Resolution.Daily).ToList();\n                });\n                Assert.Greater(history.Count, 0);\n            }\n            else\n            {\n                using var _ = Py.GIL();\n                var module = PyModule.FromString(\"DoesNotThrowForCustomNonOptionDataHistoryForOptionConfig\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests.Algorithm import *\n\ndef get_history(algorithm, symbol):\n    return algorithm.history(AlgorithmHistoryTests.CustomFundamentalTestData, [symbol], 10, Resolution.DAILY)\n\");\n\n                algorithm.SetPandasConverter();\n                dynamic getHistory = module.GetAttr(\"get_history\");\n                dynamic history = null;\n                Assert.DoesNotThrow(() => history = getHistory(algorithm, symbol));\n                Assert.IsNotNull(history);\n                Assert.IsFalse(history.empty.As<bool>());\n            }\n        }\n\n        private static IEnumerable<TestCaseData> GetHistoryRequestFromNonTradableDateTestCases()\n        {\n            foreach (var date in new[]\n            {\n                // Labor day\n                new DateTime(2013, 9, 1),\n                // Sunday\n                new DateTime(2013, 8, 31),\n                // Saturday\n                new DateTime(2013, 8, 30)\n            })\n            {\n                foreach (var timeOfDay in new[] { 0, 12, 17 })\n                {\n                    yield return new TestCaseData(date.AddHours(timeOfDay));\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetHistoryRequestFromNonTradableDateTestCases))]\n        public void GetsRightSliceCountForDailyPeriodHisotryRequestFromNonTradableDate(DateTime dateTime)\n        {\n            var algorithm = GetAlgorithm(dateTime);\n            Assert.AreEqual(dateTime, algorithm.Time);\n            Assert.AreEqual(10, algorithm.History(Symbols.SPY, 10, Resolution.Daily).Count());\n        }\n\n        [Test]\n        public void DailyFuturesHistoryDoesNotIncludeSundaysAndReturnsCorrectSliceCountForPeriod([Values] bool extendedMarketHours)\n        {\n            var algorithm = GetAlgorithm(new DateTime(2013, 10, 28));\n            var future = algorithm.AddFuture(Futures.Indices.SP500EMini);\n            var history = algorithm.History([future.Symbol], 15, Resolution.Daily, fillForward: true, extendedMarketHours: extendedMarketHours).ToList();\n\n            // Five business days per week, 3 weeks from Monday 2013/10/07 to Friday 2013/10/25, Sundays are only open for extended hours\n            Assert.AreEqual(15, history.Count);\n            Assert.AreEqual(new DateTime(2013, 10, 07), history[0].Time.Date);\n\n            foreach (var slice in history)\n            {\n                foreach (var data in slice.AllData)\n                {\n                    Assert.AreNotEqual(DayOfWeek.Saturday, data.Time.DayOfWeek);\n                    Assert.AreNotEqual(DayOfWeek.Sunday, data.Time.DayOfWeek);\n                }\n            }\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void HistoryRequestUsesSecurityConfigOrExplicitValues(bool explicitParameters)\n        {\n            var start = new DateTime(2013, 10, 28);\n            var algorithm = GetAlgorithm(start);\n            var future = algorithm.AddFuture(\n                Futures.Indices.SP500EMini,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0,\n                extendedMarketHours: true);\n\n            var customTestHistoryProvider = new CustomTestHistoryProvider();\n            algorithm.SetHistoryProvider(customTestHistoryProvider);\n            algorithm.HistoryProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                _dataProvider,\n                _cacheProvider,\n                _mapFileProvider,\n                _factorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                algorithm.ObjectStore,\n                algorithm.Settings));\n\n            List<SymbolChangedEvent> history;\n\n            if (!explicitParameters)\n            {\n                history = algorithm.History<SymbolChangedEvent>(\n                    future.Symbol,\n                    new DateTime(2007, 1, 1),\n                    new DateTime(2012, 1, 1)).ToList();\n            }\n            else\n            {\n                history = algorithm.History<SymbolChangedEvent>(\n                    future.Symbol,\n                    new DateTime(2007, 1, 1),\n                    new DateTime(2012, 1, 1),\n                    dataNormalizationMode: DataNormalizationMode.Raw,\n                    dataMappingMode: DataMappingMode.OpenInterest,\n                    contractDepthOffset: 0,\n                    extendedMarketHours: false).ToList();\n            }\n\n            Assert.AreEqual(1, customTestHistoryProvider.HistoryRequests.Count);\n            Assert.Greater(history.Count, 0);\n\n            var request = customTestHistoryProvider.HistoryRequests[0];\n\n            if (!explicitParameters)\n            {\n                // Without explicit parameters: uses values from security configuration\n                Assert.AreEqual(DataNormalizationMode.BackwardsRatio, request.DataNormalizationMode);\n                Assert.AreEqual(DataMappingMode.LastTradingDay, request.DataMappingMode);\n                Assert.AreEqual(true, request.IncludeExtendedMarketHours);\n                Assert.AreEqual(0, request.ContractDepthOffset);\n            }\n            else\n            {\n                // With explicit parameters: uses values from history request\n                Assert.AreEqual(DataNormalizationMode.Raw, request.DataNormalizationMode);\n                Assert.AreEqual(DataMappingMode.OpenInterest, request.DataMappingMode);\n                Assert.AreEqual(false, request.IncludeExtendedMarketHours);\n                Assert.AreEqual(0, request.ContractDepthOffset);\n            }\n        }\n\n        [TestCase(Resolution.Tick)]\n        [TestCase(Resolution.Second)]\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Hour)]\n        [TestCase(Resolution.Daily)]\n        [TestCase(null)]\n        public void TickHistoryRequestsForFuturesShouldReturnSameDataCount(Resolution? resolution)\n        {\n            var start = new DateTime(2013, 10, 09);\n            _algorithm = GetAlgorithm(start);\n            _algorithm.SetEndDate(2013, 10, 10);\n\n            var symbol = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2013, 10, 29));\n            if (resolution == null)\n            {\n                _algorithm.AddFutureContract(symbol);\n            }\n            else\n            {\n                _algorithm.AddFutureContract(symbol, resolution);\n            }\n\n            var startDate = new DateTime(2013, 10, 08, 9, 30, 0);\n            var endDate = startDate.AddMinutes(10);\n\n            var history1 = _algorithm.History<Tick>(symbol, startDate, endDate, Resolution.Tick).ToList();\n            var history1Count = history1.Count;\n            int history2Count = 0;\n            int history3Count = 0;\n            using (Py.GIL())\n            {\n                _algorithm.SetPandasConverter();\n                var type = typeof(Tick).ToPython();\n\n                dynamic history2 = _algorithm.History(symbol.ToPython(), startDate, endDate, Resolution.Tick);\n                history2Count = history2.shape[0].As<int>();\n\n                dynamic history3 = _algorithm.History(type, symbol.ToPython(), startDate, endDate, Resolution.Tick);\n                history3Count = history3.shape[0].As<int>();\n            }\n\n            Assert.AreEqual(4923, history1Count);\n            Assert.AreEqual(history1Count, history2Count);\n            Assert.AreEqual(history1Count, history3Count);\n        }\n\n        private class CustomTestHistoryProvider : SubscriptionDataReaderHistoryProvider\n        {\n            public List<HistoryRequest> HistoryRequests { get; } = new List<HistoryRequest>();\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                HistoryRequests.AddRange(requests);\n                return base.GetHistory(requests, sliceTimeZone);\n            }\n        }\n\n        public class CustomFundamentalTestData : BaseData\n        {\n            private static DateTime _currentDate;\n            private static int _currentDateDataPointCount;\n\n            public override DateTime EndTime => Time.AddDays(1);\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var path = Path.Combine(Globals.DataFolder, \"equity\", \"usa\", \"fundamental\", \"coarse\", $\"{date:yyyyMMdd}.csv\");\n                return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                try\n                {\n                    var csv = line.Split(',');\n                    var sid = SecurityIdentifier.Parse(csv[0]);\n\n                    var data = new CustomFundamentalTestData\n                    {\n                        Symbol = new Symbol(sid, csv[1]),\n                        Time = date,\n                        Value = Convert.ToDecimal(csv[2], CultureInfo.InvariantCulture),\n                    };\n\n                    // Let's limit the amount of data we fetch per date to limit tests duration,\n                    // especially when converting to dataframes\n                    if (date == _currentDate)\n                    {\n                        if (_currentDateDataPointCount >= 10)\n                        {\n                            return null;\n                        }\n\n                        _currentDateDataPointCount++;\n                    }\n                    else\n                    {\n                        _currentDate = date;\n                        _currentDateDataPointCount = 0;\n                    }\n\n                    return data;\n                }\n                catch\n                {\n                }\n                return null;\n            }\n\n            public override BaseData Clone()\n            {\n                return new CustomFundamentalTestData\n                {\n                    Symbol = Symbol,\n                    Time = Time,\n                    Value = Value\n                };\n            }\n        }\n\n        public class CustomUniverseData : BaseDataCollection\n        {\n            public decimal Weight { get; private set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"TestData/portfolio_targets.csv\",\n                    SubscriptionTransportMedium.LocalFile,\n                    FileFormat.FoldingCollection);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(',');\n\n                try\n                {\n                    var endTime = DateTime.ParseExact(csv[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture);\n                    var symbol = Symbol.Create(csv[1], SecurityType.Equity, Market.USA);\n                    var weight = Convert.ToDecimal(csv[2], CultureInfo.InvariantCulture);\n\n                    return new CustomUniverseData\n                    {\n                        Symbol = symbol,\n                        Time = endTime - TimeSpan.FromDays(1),\n                        EndTime = endTime,\n                        Weight = weight\n                    };\n                }\n                catch\n                {\n                    return null;\n                }\n            }\n        }\n\n        private static void AssertCustomUniverseDataFrames<T>(dynamic df, dynamic flattenedDf, Func<T, decimal> getWeight)\n            where T : BaseData\n        {\n            var expectedDates = new List<DateTime>\n                {\n                    new DateTime(2015, 01, 13),\n                    new DateTime(2015, 01, 14),\n                    new DateTime(2015, 01, 15),\n                };\n\n            var flattenedDfDates = ((List<DateTime>)flattenedDf.index.get_level_values(0).to_list().As<List<DateTime>>()).Distinct().ToList();\n            CollectionAssert.AreEqual(expectedDates, flattenedDfDates);\n\n            var dfDates = ((List<DateTime>)df.index.get_level_values(1).to_list().As<List<DateTime>>()).Distinct().ToList();\n            CollectionAssert.AreEqual(expectedDates, dfDates);\n\n            df = df.droplevel(0); // drop symbol just to make access easier\n            foreach (var date in expectedDates)\n            {\n                using var pyDate = date.ToPython();\n                var constituents = (List<T>)df.loc[pyDate].As<List<T>>();\n                var flattendDfConstituents = flattenedDf.loc[pyDate];\n\n                CollectionAssert.IsNotEmpty(constituents);\n                Assert.AreEqual(flattendDfConstituents.shape[0].As<int>(), constituents.Count);\n\n                var constituentsSymbols = constituents.Select(x => x.Symbol).ToList();\n                var flattendDfConstituentsSymbols = ((List<Symbol>)flattendDfConstituents.index.to_list().As<List<Symbol>>()).ToList();\n                CollectionAssert.AreEqual(flattendDfConstituentsSymbols, constituentsSymbols);\n\n                var constituentsWeights = constituents.Select(x => getWeight(x)).ToList();\n                var flattendDfConstituentsWeights = constituentsSymbols\n                    .Select(symbol => flattendDfConstituents.loc[symbol.ToPython()][\"weight\"].As<decimal>())\n                    .Cast<decimal>()\n                    .ToList();\n                CollectionAssert.AreEqual(flattendDfConstituentsWeights, constituentsWeights);\n            }\n\n            Log.Debug((string)df.to_string());\n            Log.Debug((string)flattenedDf.to_string());\n        }\n\n        private static void AssertDesNotThrowPythonException(Action action)\n        {\n            try\n            {\n                action();\n            }\n            catch (PythonException ex)\n            {\n                Assert.Fail(ex.Message);\n            }\n        }\n\n        private class ThrowingHistoryProvider : HistoryProviderBase\n        {\n            public override int DataPointCount => 0;\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                throw new Exception(\"Expected exception\");\n                yield return null;\n            }\n\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n            }\n        }\n\n        private static TestCaseData[] GetHistoryWithDataNormalizationModeTestCases()\n        {\n            var equityStart = new DateTime(2014, 06, 05); // There is an AAPL split on 2014/06/06\n            var futureStart = new DateTime(2013, 12, 18); // There is an ES contract mapping on 2013/12/19\n\n            return new[] { Language.CSharp, Language.Python }.SelectMany(language =>\n            {\n                return new[]\n                {\n                    // Test cases for equity\n                    new TestCaseData(language, Symbols.AAPL, Resolution.Daily, equityStart, equityStart.AddDays(100), 70),\n                    new TestCaseData(language, Symbols.AAPL, Resolution.Hour, equityStart, equityStart.AddDays(20), 98),\n                    new TestCaseData(language, Symbols.AAPL, Resolution.Minute, equityStart, equityStart.AddDays(1), 390),\n\n                    // Test cases for futures\n                    new TestCaseData(language, Symbols.ES_Future_Chain, Resolution.Daily, futureStart, futureStart.AddDays(100), 70),\n                    new TestCaseData(language, Symbols.ES_Future_Chain, Resolution.Hour, futureStart, futureStart.AddDays(20), 93),\n                    new TestCaseData(language, Symbols.ES_Future_Chain, Resolution.Minute, futureStart, futureStart.AddDays(2), 900),\n                };\n            }).ToArray();\n        }\n\n        private QCAlgorithm GetAlgorithm(DateTime dateTime)\n        {\n            var algorithm = new QCAlgorithm();\n\n            // Initialize the object store for the algorithm\n            using var store = new LocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n            algorithm.SetObjectStore(store);\n\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.HistoryProvider = new SubscriptionDataReaderHistoryProvider();\n            algorithm.SetDateTime(dateTime.ConvertToUtc(algorithm.TimeZone));\n\n            algorithm.HistoryProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                _dataProvider,\n                _cacheProvider,\n                _mapFileProvider,\n                _factorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                algorithm.ObjectStore,\n                algorithm.Settings));\n            return algorithm;\n        }\n\n        private class TestHistoryProvider : HistoryProviderBase\n        {\n            public override int DataPointCount { get; }\n            public List<HistoryRequest> HistryRequests { get; } = new List<HistoryRequest>();\n\n            public List<Slice> Slices { get; set; } = new List<Slice>();\n\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                foreach (var request in requests)\n                {\n                    HistryRequests.Add(request);\n                }\n\n                if (!requests.Any()) return Enumerable.Empty<Slice>().ToList();\n\n                var startTime = requests.Min(x => x.StartTimeUtc.ConvertFromUtc(x.DataTimeZone));\n                var endTime = requests.Max(x => x.EndTimeUtc.ConvertFromUtc(x.DataTimeZone));\n\n                return Slices.Where(x => x.Time >= startTime && x.Time <= endTime).ToList();\n            }\n        }\n\n        public class CustomData : TradeBar\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = Path.Combine(Globals.DataFolder, \"equity\", \"usa\", config.Resolution.ToString().ToLower(),\n                    Symbols.SPY.Value.ToLowerInvariant(), LeanData.GenerateZipFileName(Symbols.SPY, date, config.Resolution, config.TickType));\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n            }\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var baseData = base.Reader(new SubscriptionDataConfig(config, symbol: Symbols.SPY), line, date, isLiveMode);\n\n                return new CustomData\n                {\n                    DataType = MarketDataType.Base,\n                    Symbol = config.Symbol,\n                    Time = baseData.EndTime,\n                    Value = baseData.Price\n                };\n            }\n        }\n\n        /// <summary>\n        /// Represents custom data with an optional sorting functionality. The <see cref=\"ExampleCustomDataWithSort\"/> class\n        /// allows you to specify a static property <seealso cref=\"CustomDataKey\"/>, which defines the name of the custom data source.\n        /// Sorting can be enabled or disabled by setting the <seealso cref=\"Sort\"/> property.\n        /// This class overrides <see cref=\"GetSource(SubscriptionDataConfig, DateTime, bool)\"/> to initialize the\n        /// <seealso cref=\"SubscriptionDataSource.Sort\"/> property based on the value of <see cref=\"Sort\"/>.\n        /// </summary>\n        public class ExampleCustomDataWithSort : BaseData\n        {\n            /// <summary>\n            /// The name of the custom data source.\n            /// </summary>\n            public static string CustomDataKey { get; set; }\n\n            /// <summary>\n            /// Specifies whether the data should be sorted. If set to true, the data will be sorted during retrieval.\n            /// </summary>\n            public static bool Sort { get; set; } = true;\n\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n\n            /// <summary>\n            /// Returns the data source for the subscription. It uses the custom data key and sets sorting based on the\n            /// <see cref=\"Sort\"/> property.\n            /// </summary>\n            /// <param name=\"config\">Subscription configuration.</param>\n            /// <param name=\"date\">The data date.</param>\n            /// <param name=\"isLiveMode\">Specifies whether live mode is enabled.</param>\n            /// <returns>The subscription data source with sorting determined by the <see cref=\"Sort\"/> property.</returns>\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(CustomDataKey, SubscriptionTransportMedium.ObjectStore, FileFormat.Csv)\n                {\n                    Sort = Sort\n                };\n            }\n\n            /// <summary>\n            /// Reads a line of CSV data and parses it into an <see cref=\"ExampleCustomDataWithSort\"/> object.\n            /// </summary>\n            /// <param name=\"config\">Subscription configuration.</param>\n            /// <param name=\"line\">The line of data to parse.</param>\n            /// <param name=\"date\">The data date.</param>\n            /// <param name=\"isLiveMode\">Specifies whether live mode is enabled.</param>\n            /// <returns>A populated <see cref=\"ExampleCustomDataWithSort\"/> instance.</returns>\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(\",\");\n                var data = new ExampleCustomDataWithSort\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture),\n                    Value = csv[4].ToDecimal(),\n                    Open = csv[1].ToDecimal(),\n                    High = csv[2].ToDecimal(),\n                    Low = csv[3].ToDecimal(),\n                    Close = csv[4].ToDecimal()\n                };\n\n                return data;\n            }\n        }\n\n        private QCAlgorithm GetAlgorithmWithEquity(DateTime dateTime)\n        {\n            var resolution = Resolution.Minute;\n            var algorithm = GetAlgorithm(dateTime);\n            algorithm.AddEquity(\"AAPL\", resolution);\n\n            return algorithm;\n        }\n\n        private QCAlgorithm GetAlgorithmWithFuture(DateTime dateTime)\n        {\n            var resolution = Resolution.Daily;\n            var algorithm = GetAlgorithm(dateTime);\n            algorithm.AddFuture(Futures.Indices.SP500EMini, resolution, extendedMarketHours: true);\n\n            return algorithm;\n        }\n\n        /// <summary>\n        /// Helper method to check that all history results have the same bar count\n        /// </summary>\n        private static void CheckThatHistoryResultsHaveEqualBarCount<T>(IEnumerable<IEnumerable<T>> historyResults, int expectedHistoryCount)\n        {\n            Assert.That(historyResults, Has.All.Not.Empty.And.All.Count.EqualTo(expectedHistoryCount),\n                $@\"Expected all history results to have {expectedHistoryCount} slices, but counts where {string.Join(\", \", historyResults.Select(x => x.Count()))}\");\n        }\n\n        /// <summary>\n        /// Helper method to check that all history data frame results have the same bar count\n        /// </summary>\n        private static void CheckThatHistoryResultsHaveEqualBarCount(List<PyObject> historyResults, int expectedHistoryCount)\n        {\n            Assert.Greater(expectedHistoryCount, 0);\n            var historyCounts = historyResults.Select(x => x.GetAttr(\"shape\")[0].As<int>()).ToList();\n            Assert.IsTrue(historyCounts.All(count => count == expectedHistoryCount),\n                $\"Expected all history results to have {expectedHistoryCount} slices/bars, but counts where {string.Join(\", \", historyCounts)}\");\n        }\n\n        /// <summary>\n        /// Helper method to check that, for each history result, prices at each time are different\n        /// </summary>\n        private static void CheckThatHistoryResultsHaveDifferentPrices(List<List<BaseData>> historyResults, string message)\n        {\n            for (int i = 0; i < historyResults[0].Count; i++)\n            {\n                var prices = historyResults.Select(hr => hr[i].Price).ToHashSet();\n                Assert.AreEqual(historyResults.Count, prices.Count, message);\n            }\n        }\n\n        /// <summary>\n        /// Helper method to check that, for each history result, prices at each time are different\n        /// </summary>\n        private static void CheckThatHistoryResultsHaveDifferentPrices(IEnumerable<IEnumerable<Slice>> historyResults, string message)\n        {\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults.Select(hr => hr.Select(x => x.Values.First()).ToList()).ToList(), message);\n        }\n\n        /// <summary>\n        /// Helper method to check that, for each history data frame result, prices at each time are different\n        /// </summary>\n        private static void CheckThatHistoryResultsHaveDifferentPrices(List<PyObject> historyResults, string message)\n        {\n            var closesPerResult = historyResults.Select(hr => hr[\"close\"].GetAttr(\"values\").GetAttr(\"tolist\").Invoke().As<List<decimal>>()).ToList();\n\n            for (int i = 0; i < closesPerResult.First().Count; i++)\n            {\n                var closePrices = closesPerResult.Select(close => close[i]).ToHashSet();\n                Assert.AreEqual(historyResults.Count, closePrices.Count, message);\n            }\n        }\n\n        /// <summary>\n        /// Helper method to perform history checks on different data normalization modes\n        /// </summary>\n        private static void CheckHistoryResultsForDataNormalizationModes(QCAlgorithm algorithm, Symbol symbol, DateTime start,\n            DateTime end, Resolution resolution, DataNormalizationMode[] dataNormalizationModes, int expectedHistoryCount)\n        {\n            var historyResults = dataNormalizationModes\n                .Select(x => algorithm.History(new[] { symbol }, start, end, resolution, dataNormalizationMode: x).ToList())\n                .ToList();\n\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                \"History results prices should have been different for each data normalization mode at each time\");\n        }\n\n        /// <summary>\n        /// Helper method to perform history checks on different data normalization modes\n        /// </summary>\n        private static void CheckHistoryResultsForDataNormalizationModes(QCAlgorithm algorithm, PyObject symbol, DateTime start,\n            DateTime end, Resolution resolution, DataNormalizationMode[] dataNormalizationModes, int expectedHistoryCount)\n        {\n            var historyResults = dataNormalizationModes\n                .Select(x => algorithm.History(symbol, start, end, resolution, dataNormalizationMode: x))\n                .ToList();\n\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                \"History results prices should have been different for each data normalization mode at each time\");\n        }\n\n        /// <summary>\n        /// Helper method to assert that the right custom data history is fetched\n        /// </summary>\n        private static void AssertCustomDataTypeHistory<T>(List<T> history)\n            where T : IBaseData\n        {\n            Assert.AreEqual(828, history.Count);\n            Assert.That(history, Has.All.Property(\"DataType\").EqualTo(MarketDataType.Base));\n        }\n\n        /// <summary>\n        /// Helper method to assert that the right custom data history is fetched\n        /// </summary>\n        private static void AssertCustomDataTypeHistory<T>(List<DataDictionary<T>> history)\n            where T : IBaseData\n        {\n            Assert.AreEqual(828, history.Count);\n            Assert.That(history.Select(x => x.Single().Value), Has.All.Property(\"DataType\").EqualTo(MarketDataType.Base));\n        }\n\n        private static DataMappingMode[] GetAllDataMappingModes()\n        {\n            return (DataMappingMode[])Enum.GetValues(typeof(DataMappingMode));\n        }\n\n        private static DataNormalizationMode[] GetAllDataNormalizationModes()\n        {\n            return (DataNormalizationMode[])Enum.GetValues(typeof(DataNormalizationMode));\n        }\n\n        /// <summary>\n        /// Asserts history result has the expected count\n        /// </summary>\n        private static void AssertHistoryResultCount<T>(List<T> history, int expectedCount)\n        {\n            Assert.IsNotEmpty(history);\n            Assert.AreEqual(expectedCount, history.Count);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with fillForward set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/> for Python cases.\n        /// </summary>\n        private static void AssertHistoryResultCount(PyObject history, int expectedCount)\n        {\n            var historyCount = history.GetAttr(\"shape\")[0].As<int>();\n            Assert.Greater(historyCount, 0);\n            Assert.AreEqual(expectedCount, historyCount);\n        }\n\n        /// <summary>\n        /// Asserts that data from a history request has the expected resolution\n        /// </summary>\n        private static void AssertHistoryResultResolution(IEnumerable<BaseData> history, Resolution resolution)\n        {\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var expectedTimeSpan = resolution.ToTimeSpan();\n            Assert.IsTrue(history.All(data =>\n            {\n                if (resolution == Resolution.Daily)\n                {\n                    var exchange = mhdb.GetExchangeHours(data.Symbol.ID.Market, data.Symbol, data.Symbol.SecurityType);\n                    var marketHours = exchange.GetMarketHours(data.EndTime);\n                    expectedTimeSpan = marketHours.MarketDuration;\n                }\n                return data.EndTime - data.Time == expectedTimeSpan;\n            }));\n        }\n\n        private static List<PyObject> GetHistoryDataFrameIndex(PyObject history)\n        {\n            return history\n                .GetAttr(\"index\")\n                .GetAttr(\"to_flat_index\").Invoke()\n                .GetAttr(\"tolist\").Invoke()\n                .As<List<PyObject>>();\n        }\n\n        private static List<Symbol> GetSymbolsFromHistoryDataFrameIndex(List<PyObject> index)\n        {\n            dynamic builtins = Py.Import(\"builtins\");\n            return index.Select(x => x[builtins.len(x) > 2 ? 1 : 0].As<Symbol>()).ToList();\n        }\n\n        private static List<DateTime> GetTimesFromHistoryDataFrameIndex(List<PyObject> index)\n        {\n            dynamic builtins = Py.Import(\"builtins\");\n            return index.Select(x => x[builtins.len(x) > 2 ? 2 : 1].As<DateTime>()).ToList();\n        }\n\n        private static Dictionary<string, T> GetDataFrameDictionary<T>(PyObject dict)\n        {\n            // Using PyObject because our data frames use our PandasColunm class to wrap strings\n            return dict.ConvertToDictionary<PyObject, T>().ToDictionary(\n                kvp =>\n                {\n                    var strKey = kvp.Key.ToString();\n                    kvp.Key.Dispose();\n                    return strKey;\n                },\n                kvp => kvp.Value);\n        }\n\n        #region Fill-forwarded history assertions\n\n        /// <summary>\n        /// Asserts that fill forwarded history results has data for every period in the requested time span\n        /// </summary>\n        private static void AssertFillForwardedHistoryTimes(Symbol symbol, List<DateTime> times, TimeSpan period)\n        {\n            var hours = MarketHoursDatabase.FromDataFolder().GetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType).ExchangeHours;\n\n            // We are assuming one regular segment per day for the test security\n            var periodMultiplier = 0;\n            var baseSegmentTimeIndex = 0;\n            for (var i = 0; i < times.Count; i++)\n            {\n                var currentTime = times[i];\n                if (i > 0 && currentTime.DayOfWeek != times[i - 1].DayOfWeek)\n                {\n                    baseSegmentTimeIndex = i;\n                    periodMultiplier = 0;\n                }\n\n                var expectedCurrentTime = times[baseSegmentTimeIndex] + periodMultiplier++ * period;\n                Assert.AreEqual(expectedCurrentTime, currentTime);\n                Assert.IsTrue(\n                    // subtract `period` since the times list has the EndTime\n                    hours.IsOpen(currentTime - period, extendedMarketHours: false),\n                    $\"Current time {currentTime} is not open\");\n            }\n        }\n\n        /// <summary>\n        /// Asserts that history data, when called with fillForward set to true, has a period that is equal to the resolution used.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryData(List<TradeBar> history, Resolution resolution, bool fillForward)\n        {\n            var expectedPeriod = resolution.ToTimeSpan();\n            Assert.IsTrue(history.All(bar => bar.Period == expectedPeriod));\n            Assert.AreEqual(fillForward, history.Any(x => x.IsFillForward));\n\n            if (fillForward)\n            {\n                var symbol = history.First().Symbol;\n                var times = history.Select(bar => bar.EndTime).ToList();\n                AssertFillForwardedHistoryTimes(symbol, times, expectedPeriod);\n            }\n        }\n\n        /// <summary>\n        /// Asserts that history data, when called with fillForward set to true, has a period that is equal to the resolution used.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryData(List<Slice> history, Resolution resolution, bool fillForward)\n        {\n            AssertFillForwardHistoryData(\n                history.Select(slice => slice.Bars.Values.SingleOrDefault((TradeBar)null)).Where(bar => bar != null).ToList(),\n                resolution,\n                fillForward);\n        }\n\n        ///// <summary>\n        /// Asserts that history data, when called with fillForward set to true, has a period that is equal to the resolution used.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryData(List<DataDictionary<TradeBar>> history, Resolution resolution, bool fillForward)\n        {\n            AssertFillForwardHistoryData(\n                history.Select(x => x.Values.SingleOrDefault((TradeBar)null)).Where(bar => bar != null).ToList(),\n                resolution,\n                fillForward);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with fillForward set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryResults(List<TradeBar> history, int expectedCount, Resolution resolution, bool fillForward)\n        {\n            AssertHistoryResultCount(history, expectedCount);\n            AssertFillForwardHistoryData(history, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with fillForward set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryResults(List<Slice> history, int expectedCount, Resolution resolution, bool fillForward)\n        {\n            AssertHistoryResultCount(history, expectedCount);\n            AssertFillForwardHistoryData(history, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with fillForward set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/>.\n        /// </summary>\n        private static void AssertFillForwardHistoryResults(List<DataDictionary<TradeBar>> history, int expectedCount,\n            Resolution resolution, bool fillForward)\n        {\n            AssertHistoryResultCount(history, expectedCount);\n            AssertFillForwardHistoryData(history, resolution, fillForward);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with fillForward set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithFillForward\"/> for Python cases.\n        /// </summary>\n        private static void AssertFillForwardHistoryResults(PyObject history, int expectedCount, Resolution resolution, bool fillForward)\n        {\n            AssertHistoryResultCount(history, expectedCount);\n\n            if (fillForward)\n            {\n                var index = GetHistoryDataFrameIndex(history);\n                var symbols = GetSymbolsFromHistoryDataFrameIndex(index);\n                var times = GetTimesFromHistoryDataFrameIndex(index);\n                AssertFillForwardedHistoryTimes(symbols[0], times, resolution.ToTimeSpan());\n            }\n        }\n\n        #endregion\n\n        #region History with extended market assertions\n\n        /// <summary>\n        /// Asserts that history with/without extended market results has data for regular hour segments and extended market segments, respectively.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryTimes(Symbol symbol, List<DateTime> times, bool extendedMarket)\n        {\n            var hours = MarketHoursDatabase.FromDataFolder().GetEntry(symbol.ID.Market, symbol, symbol.ID.SecurityType).ExchangeHours;\n\n            var getTimesCheck = (bool inExtendedHours) => (DateTime time) =>\n            {\n                var currentDayHours = hours.GetMarketHours(time);\n                var segments = currentDayHours.Segments\n                    .Where(x => inExtendedHours\n                        ? x.State != MarketHoursState.Market\n                        : x.State == MarketHoursState.Market);\n                return segments.Any(segment => time.TimeOfDay > segment.Start && time.TimeOfDay <= segment.End);\n            };\n            var timeIsInRegularHours = getTimesCheck(false);\n            var timeIsInExtendedHours = getTimesCheck(true);\n\n            if (!extendedMarket)\n            {\n                Assert.IsTrue(times.All(timeIsInRegularHours));\n            }\n            else\n            {\n                Assert.IsTrue(times.Any(timeIsInRegularHours));\n                Assert.IsTrue(times.Any(timeIsInExtendedHours));\n            }\n        }\n\n        /// <summary>\n        /// Asserts that history with/without extended market results has data for regular hour segments and extended market segments, respectively.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResultsData(List<BaseData> history, bool extendedMarket, Resolution resolution,\n            Symbol expectedSymbol)\n        {\n            Assert.IsTrue(history.All(data => data.Symbol == expectedSymbol));\n            var times = history.Select(bar => bar.EndTime).ToList();\n            AssertExtendedMarketHistoryTimes(expectedSymbol, times, extendedMarket);\n            AssertHistoryResultResolution(history, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that history with/without extended market results has data for regular hour segments and extended market segments, respectively.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResultsData(List<Slice> history, bool extendedMarket, Resolution resolution,\n            Symbol expectedSymbol)\n        {\n            var data = history.Select(slice => slice.Bars.Values.Cast<BaseData>().Concat(slice.QuoteBars.Values.Cast<BaseData>())).SelectMany(x => x);\n            Assert.IsTrue(data.All(x => x.Symbol == expectedSymbol));\n\n            var times = data.Select(x => x.EndTime).ToList();\n            AssertExtendedMarketHistoryTimes(expectedSymbol, times, extendedMarket);\n            AssertHistoryResultResolution(data, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/>.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(List<TradeBar> history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertHistoryResultCount(history, expectedHistoryCount);\n            AssertExtendedMarketHistoryResultsData(history.Cast<BaseData>().ToList(), extendedMarket, resolution, expectedSymbol);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/>.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(List<Slice> history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertHistoryResultCount(history, expectedHistoryCount);\n            AssertExtendedMarketHistoryResultsData(history, extendedMarket, resolution, expectedSymbol);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/>.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(List<DataDictionary<TradeBar>> history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertHistoryResultCount(history, expectedHistoryCount);\n            AssertExtendedMarketHistoryResultsData(history.Select(dict => dict.Values.First()).Cast<BaseData>().ToList(), extendedMarket, resolution,\n                expectedSymbol);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/>.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(List<Tick> history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertHistoryResultCount(history, expectedHistoryCount);\n            AssertExtendedMarketHistoryResultsData(history.Cast<BaseData>().ToList(), extendedMarket, resolution, expectedSymbol);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/>.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(List<DataDictionary<Tick>> history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertExtendedMarketHistoryResults(history.SelectMany(dict => dict.Values).ToList(), expectedHistoryCount, extendedMarket, resolution,\n                expectedSymbol);\n        }\n\n        /// <summary>\n        /// Asserts that history result has more data when called with extendedMarket set to true.\n        /// Used in the test <see cref=\"HistoryRequestWithExtendedMarket\"/> for Python cases.\n        /// </summary>\n        private static void AssertExtendedMarketHistoryResults(PyObject history, int expectedHistoryCount, bool extendedMarket,\n            Resolution resolution, Symbol expectedSymbol)\n        {\n            AssertHistoryResultCount(history, expectedHistoryCount);\n\n            var index = GetHistoryDataFrameIndex(history);\n            var symbols = GetSymbolsFromHistoryDataFrameIndex(index);\n            Assert.IsTrue(symbols.All(x => x == expectedSymbol));\n            var times = GetTimesFromHistoryDataFrameIndex(index);\n            AssertExtendedMarketHistoryTimes(expectedSymbol, times, extendedMarket);\n        }\n\n        #endregion\n\n        #region History with different data mapping modes assertions\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data mapping mode, each has its expected mapping date, that is,\n        /// the date when underlying symbol change due to contract expiration.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentMappingModesResults(List<List<TradeBar>> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount, Resolution resolution, List<DateTime> expectedMappingDates)\n        {\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n\n            // Check that all history results have a mapping date at some point in the history\n            for (var i = 0; i < historyResults.Count; i++)\n            {\n                var history = historyResults[i];\n                var prevUnderlying = history[0].Symbol.Underlying;\n                var mappingDates = new List<DateTime>();\n\n                foreach (var bar in history)\n                {\n                    Assert.AreEqual(expectedSymbol, bar.Symbol, $\"All bars symbol must have been {expectedSymbol} but found {bar.Symbol}\");\n\n                    var currentUnderlying = bar.Symbol.Underlying;\n                    if (currentUnderlying != prevUnderlying)\n                    {\n                        mappingDates.Add(bar.EndTime.Date);\n                        prevUnderlying = currentUnderlying;\n                    }\n                }\n\n                Assert.AreEqual(1, mappingDates.Count, \"We are expecting only one mapping for this case.\");\n                var expectedMappingDate = expectedMappingDates[i];\n                Assert.AreEqual(expectedMappingDate, mappingDates[0],\n                    $\"Mapping date {mappingDates[0]} for {i}th history result is not the expected one {expectedMappingDate}.\");\n\n                AssertHistoryResultResolution(history, resolution);\n            }\n\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults.Select(history => history.Cast<BaseData>().ToList()).ToList(),\n                \"History results prices should have been different for each data mapping mode at each time\");\n        }\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data mapping mode, each has its expected mapping date.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentMappingModesResults(List<List<Slice>> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount, Resolution resolution, List<DateTime> expectedMappingDates)\n        {\n            AssertFuturesHistoryWithDifferentMappingModesResults(historyResults.Select(x => x.Select(y => y.Bars.Values.First()).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution, expectedMappingDates);\n        }\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data mapping mode, each has its expected mapping date.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentMappingModesResults(List<List<DataDictionary<TradeBar>>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution, List<DateTime> expectedMappingDates)\n        {\n            AssertFuturesHistoryWithDifferentMappingModesResults(historyResults.Select(x => x.Select(y => y[expectedSymbol]).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution, expectedMappingDates);\n        }\n\n        /// <summary>\n        /// Asserts that for a list of Python history results, one for a different data mapping mode,\n        /// the result counts are the same and contain different prices.\n        /// In the data frames we don't have access to the actual mapping dates, so we cannot do the same checks we do for C# in\n        /// <see cref=\"AssertFuturesHistoryWithDifferentMappingModesResults(List{List{TradeBar}}, Symbol, int, Resolution, List{DateTime})\"/>.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentMappingModesResults(List<PyObject> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount)\n        {\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults,\n                \"History results prices should have been different for each data mapping mode at each time\");\n\n            foreach (var history in historyResults)\n            {\n                var index = GetHistoryDataFrameIndex(history);\n                var symbols = GetSymbolsFromHistoryDataFrameIndex(index);\n                Assert.IsTrue(symbols.All(x => x == expectedSymbol));\n            }\n        }\n\n        #endregion\n\n        #region History with different data normalization modes assertions\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data normalization mode, prices are different for each time.\n        /// </summary>\n        private static void AssertHistoryWithDifferentNormalizationModesResults(List<List<TradeBar>> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount, Resolution resolution)\n        {\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults.Select(history => history.Cast<BaseData>().ToList()).ToList(),\n                \"History results prices should have been different for each data normalization mode at each time\");\n\n            // Assert resolution and symbol\n            foreach (var history in historyResults)\n            {\n                AssertHistoryResultResolution(history, resolution);\n                foreach (var bar in history)\n                {\n                    Assert.AreEqual(expectedSymbol, bar.Symbol, $\"All bars symbol must have been {expectedSymbol} but found {bar.Symbol}\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data normalization mode, prices are different for each time.\n        /// </summary>\n        private static void AssertHistoryWithDifferentNormalizationModesResults(List<List<Slice>> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount, Resolution resolution)\n        {\n            AssertHistoryWithDifferentNormalizationModesResults(historyResults.Select(x => x.Select(y => y.Bars.Values.First()).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data normalization mode, prices are different for each time.\n        /// </summary>\n        private static void AssertHistoryWithDifferentNormalizationModesResults(List<List<DataDictionary<TradeBar>>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution)\n        {\n            AssertHistoryWithDifferentNormalizationModesResults(historyResults.Select(x => x.Select(y => y[expectedSymbol]).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that for a list of history results, one for a different data normalization mode, prices are different for each time.\n        /// </summary>\n        private static void AssertHistoryWithDifferentNormalizationModesResults(List<PyObject> historyResults, Symbol expectedSymbol,\n            int expectedHistoryCount)\n        {\n            // These are the same checks done for mapping modes, even regardless of the security type\n            AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, expectedSymbol, expectedHistoryCount);\n        }\n\n        #endregion\n\n        #region History with different contract depth offsets assertions\n\n        /// <summary>\n        /// Asserts that history request with different contract depth offsets results have the expected mapped symbol depending on the offset used.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List<List<BaseData>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution)\n        {\n            CheckThatHistoryResultsHaveEqualBarCount(historyResults, expectedHistoryCount);\n\n            var futureChainProvider = new BacktestingFutureChainProvider();\n            futureChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n\n            var firstDateTime = historyResults[0][0].EndTime;\n            var futureChain = futureChainProvider.GetFutureContractList(expectedSymbol, firstDateTime).ToList();\n\n            // Check that the first mapped contract corresponds to the one in the future chain depending on the depth offset used,\n            // where historyResults[i] is the history result for contract depth offset = i\n            for (var i = 0; i < historyResults.Count; i++)\n            {\n                var history = historyResults[i];\n                var firstMappedContractSymbol = history[0].Symbol.Underlying;\n\n                Assert.AreEqual(futureChain[i], firstMappedContractSymbol,\n                    $@\"History[{i}]: Expected the first mapped contract to be the one on index {i} ({futureChain[i]}) in the chain for date {firstDateTime}.\");\n\n                // Finally, assert the resolution and symbol\n                AssertHistoryResultResolution(history, resolution);\n                Assert.IsTrue(history.All(x => x.Symbol == expectedSymbol));\n            }\n\n            CheckThatHistoryResultsHaveDifferentPrices(historyResults.Select(history => history.Cast<BaseData>().ToList()).ToList(),\n                \"History results prices should have been different for each available offset at each time\");\n        }\n\n        /// <summary>\n        /// Asserts that history request with different contract depth offsets results have the expected mapped symbol depending on the offset used.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List<List<TradeBar>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution)\n        {\n            AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(\n                historyResults.Select(history => history.Cast<BaseData>().ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that history request with different contract depth offsets results have the expected mapped symbol depending on the offset used.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List<List<Slice>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution)\n        {\n            AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(\n                historyResults.Select(x => x.Select(y => (BaseData)y.Bars.Values.FirstOrDefault() ?? y.QuoteBars.Values.First()).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that history request with different contract depth offsets results have the expected mapped symbol depending on the offset used.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List<List<DataDictionary<TradeBar>>> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount, Resolution resolution)\n        {\n            AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(\n                historyResults.Select(x => x.Select(y => y[expectedSymbol]).ToList()).ToList(),\n                expectedSymbol, expectedHistoryCount, resolution);\n        }\n\n        /// <summary>\n        /// Asserts that history request with different contract depth offsets results have the expected mapped symbol depending on the offset used.\n        /// In the data frames we don't have access to the underylings, so we cannot do the same checks we do for C# in\n        /// <see cref=\"AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List{List{BaseData}}, Symbol, int, Resolution)\"/>.\n        /// </summary>\n        private static void AssertFuturesHistoryWithDifferentContractDepthOffsetsResults(List<PyObject> historyResults,\n            Symbol expectedSymbol, int expectedHistoryCount)\n        {\n            // These are the same checks done for mapping modes\n            AssertFuturesHistoryWithDifferentMappingModesResults(historyResults, expectedSymbol, expectedHistoryCount);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmIndicatorsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Python;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Tests.Research;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmIndicatorsTests\n    {\n        private QCAlgorithm _algorithm;\n        private Symbol _equity;\n        private Symbol _option;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new AlgorithmStub();\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(null, null,\n                TestGlobals.DataProvider, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider,\n                null, true, new DataPermissionManager(), _algorithm.ObjectStore, _algorithm.Settings));\n            _algorithm.SetHistoryProvider(historyProvider);\n\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11, 15, 0, 0));\n            _equity = _algorithm.AddEquity(\"SPY\").Symbol;\n            _option = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 450m, new DateTime(2023, 9, 1));\n            _algorithm.AddOptionContract(_option);\n            _algorithm.Settings.AutomaticIndicatorWarmUp = true;\n        }\n\n        [Test]\n        public void IndicatorsPassSelectorToWarmUp()\n        {\n            var mockSelector = new Mock<Func<IBaseData, TradeBar>>();\n            mockSelector.Setup(_ => _(It.IsAny<IBaseData>())).Returns<TradeBar>(_ => (TradeBar)_);\n\n            var indicator = _algorithm.ABANDS(Symbols.SPY, 20, selector: mockSelector.Object);\n\n            Assert.IsTrue(indicator.IsReady);\n            mockSelector.Verify(_ => _(It.IsAny<IBaseData>()), Times.Exactly(indicator.WarmUpPeriod));\n        }\n\n        [Test]\n        public void SharpeRatioIndicatorUsesAlgorithmsRiskFreeRateModelSetAfterIndicatorRegistration()\n        {\n            // Register indicator\n            var sharpeRatio = _algorithm.SR(Symbols.SPY, 10);\n\n            // Setup risk free rate model\n            var interestRateProviderMock = new Mock<IRiskFreeInterestRateModel>();\n            var reference = new DateTime(2023, 11, 21, 10, 0, 0);\n            interestRateProviderMock.Setup(x => x.GetInterestRate(reference)).Verifiable();\n\n            // Update indicator\n            sharpeRatio.Update(new IndicatorDataPoint(Symbols.SPY, reference, 300m));\n\n            // Our interest rate provider shouldn't have been called yet since it's hasn't been set to the algorithm\n            interestRateProviderMock.Verify(x => x.GetInterestRate(reference), Times.Never);\n\n            // Set the interest rate provider to the algorithm\n            _algorithm.SetRiskFreeInterestRateModel(interestRateProviderMock.Object);\n\n            // Update indicator\n            sharpeRatio.Update(new IndicatorDataPoint(Symbols.SPY, reference, 300m));\n\n            // Our interest rate provider should have been called once\n            interestRateProviderMock.Verify(x => x.GetInterestRate(reference), Times.Once);\n        }\n\n        [TestCase(\"Span\", Language.CSharp)]\n        [TestCase(\"Count\", Language.CSharp)]\n        [TestCase(\"StartAndEndDate\", Language.CSharp)]\n        [TestCase(\"Span\", Language.Python)]\n        [TestCase(\"Count\", Language.Python)]\n        [TestCase(\"StartAndEndDate\", Language.Python)]\n        public void IndicatorsDataPoint(string testCase, Language language)\n        {\n            var period = 10;\n            var indicator = new BollingerBands(period, 2);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            int dataCount;\n\n            IndicatorHistory indicatorValues;\n            if (language == Language.CSharp)\n            {\n                if (testCase == \"StartAndEndDate\")\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, new DateTime(2013, 10, 07), new DateTime(2013, 10, 11), Resolution.Minute);\n                }\n                else if (testCase == \"Span\")\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, TimeSpan.FromDays(5), Resolution.Minute);\n                }\n                else\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, (int)(4 * 60 * 6.5), Resolution.Minute);\n                }\n                // BollingerBands, upper, lower, mid bands, std, band width, percentB, price\n                Assert.AreEqual(8, indicatorValues.First().GetStorageDictionary().Count);\n                dataCount = indicatorValues.ToList().Count;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    if (testCase == \"StartAndEndDate\")\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), new DateTime(2013, 10, 07), new DateTime(2013, 10, 11), Resolution.Minute);\n                    }\n                    else if (testCase == \"Span\")\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), TimeSpan.FromDays(5), Resolution.Minute);\n                    }\n                    else\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), (int)(4 * 60 * 6.5), Resolution.Minute);\n                    }\n                    dataCount = QuantBookIndicatorsTests.GetDataFrameLength(indicatorValues.DataFrame);\n                }\n            }\n\n            // the historical indicator current values\n            Assert.AreEqual(1550 + period, indicatorValues.Current.Count);\n            Assert.AreEqual(1550 + period, indicatorValues[\"current\"].Count);\n            Assert.AreEqual(indicatorValues.Current, indicatorValues[\"current\"]);\n            Assert.IsNull(indicatorValues[\"NonExisting\"]);\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(1550 + period, dataCount);\n\n            var lastData = indicatorValues.Current.Last();\n            Assert.AreEqual(new DateTime(2013, 10, 10, 16, 0, 0), lastData.EndTime);\n            Assert.AreEqual(lastData.EndTime, indicatorValues.Last().EndTime);\n        }\n\n        [TestCase(\"Span\", Language.CSharp)]\n        [TestCase(\"Count\", Language.CSharp)]\n        [TestCase(\"StartAndEndDate\", Language.CSharp)]\n        [TestCase(\"Span\", Language.Python)]\n        [TestCase(\"Count\", Language.Python)]\n        [TestCase(\"StartAndEndDate\", Language.Python)]\n        public void IndicatorsBar(string testCase, Language language)\n        {\n            var period = 10;\n            var indicator = new AverageTrueRange(period);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n\n            IndicatorHistory indicatorValues;\n            int dataCount;\n            if (language == Language.CSharp)\n            {\n                if (testCase == \"StartAndEndDate\")\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, new DateTime(2013, 10, 07), new DateTime(2013, 10, 11), Resolution.Minute);\n                }\n                else if (testCase == \"Span\")\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, TimeSpan.FromDays(5), Resolution.Minute);\n                }\n                else\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator, _equity, (int)(4 * 60 * 6.5), Resolution.Minute);\n                }\n                // the TrueRange & the AVGTrueRange\n                Assert.AreEqual(2, indicatorValues.First().GetStorageDictionary().Count);\n                dataCount = indicatorValues.ToList().Count;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    if (testCase == \"StartAndEndDate\")\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), new DateTime(2013, 10, 07), new DateTime(2013, 10, 11), Resolution.Minute);\n                    }\n                    else if (testCase == \"Span\")\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), TimeSpan.FromDays(5), Resolution.Minute);\n                    }\n                    else\n                    {\n                        indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), _equity.ToPython(), (int)(4 * 60 * 6.5), Resolution.Minute);\n                    }\n                    dataCount = QuantBookIndicatorsTests.GetDataFrameLength(indicatorValues.DataFrame);\n                }\n            }\n\n            // the historical indicator current values\n            Assert.AreEqual(1550 + period, indicatorValues.Current.Count);\n            Assert.AreEqual(1550 + period, indicatorValues[\"current\"].Count);\n            Assert.AreEqual(indicatorValues.Current, indicatorValues[\"current\"]);\n            Assert.IsNull(indicatorValues[\"NonExisting\"]);\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(1550 + period, dataCount);\n\n            var lastData = indicatorValues.Current.Last();\n            Assert.AreEqual(new DateTime(2013, 10, 10, 16, 0, 0), lastData.EndTime);\n            Assert.AreEqual(lastData.EndTime, indicatorValues.Last().EndTime);\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void IndicatorMultiSymbol(Language language)\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new Beta(_equity, referenceSymbol, 10);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n\n            int dataCount;\n            IndicatorHistory indicatorValues;\n            if (language == Language.CSharp)\n            {\n                indicatorValues = _algorithm.IndicatorHistory(indicator, new[] { _equity, referenceSymbol }, TimeSpan.FromDays(5));\n                Assert.AreEqual(1, indicatorValues.First().GetStorageDictionary().Count);\n                dataCount = indicatorValues.ToList().Count;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    indicatorValues = _algorithm.IndicatorHistory(indicator.ToPython(), (new[] { _equity, referenceSymbol }).ToPython(), TimeSpan.FromDays(5));\n                    dataCount = QuantBookIndicatorsTests.GetDataFrameLength(indicatorValues.DataFrame);\n                }\n            }\n\n            // the historical indicator current values\n            Assert.AreEqual(1560, indicatorValues.Current.Count);\n            Assert.AreEqual(1560, indicatorValues[\"current\"].Count);\n            Assert.AreEqual(indicatorValues.Current, indicatorValues[\"current\"]);\n            Assert.IsNull(indicatorValues[\"NonExisting\"]);\n\n            Assert.AreEqual(1560, dataCount);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public void BetaCalculation()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new Beta(_equity, referenceSymbol, 10);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n\n            var indicatorValues = _algorithm.IndicatorHistory(indicator, new[] { _equity, referenceSymbol }, TimeSpan.FromDays(50), Resolution.Daily);\n            var lastPoint = indicatorValues.Last();\n            Assert.AreEqual(0.477585951081753m, lastPoint.Price);\n            Assert.AreEqual(0.477585951081753m, lastPoint.Current.Value);\n            Assert.AreEqual(new DateTime(2013, 10, 10, 16, 0, 0), lastPoint.Current.EndTime);\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void IndicatorsPassingHistory(Language language)\n        {\n            var period = 10;\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new Beta(_equity, referenceSymbol, period);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n\n            var history = _algorithm.History(new[] { _equity, referenceSymbol }, TimeSpan.FromDays(5), Resolution.Minute);\n            int dataCount;\n            if (language == Language.CSharp)\n            {\n                var indicatorValues = _algorithm.IndicatorHistory(indicator, history);\n                Assert.AreEqual(1, indicatorValues.First().GetStorageDictionary().Count);\n                dataCount = indicatorValues.Count;\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var pandasFrame = _algorithm.IndicatorHistory(indicator.ToPython(), history);\n                    dataCount = QuantBookIndicatorsTests.GetDataFrameLength(pandasFrame.DataFrame);\n                }\n            }\n            Assert.AreEqual((int)(4 * 60 * 6.5) - period, dataCount);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public void PythonIndicatorCanBeWarmedUpWithTimespan()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new SimpleMovingAverage(\"SMA\", 100);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            _algorithm.AddEquity(referenceSymbol);\n            using (Py.GIL())\n            {\n                var pythonIndicator = indicator.ToPython();\n                _algorithm.WarmUpIndicator(referenceSymbol, pythonIndicator, TimeSpan.FromMinutes(60));\n                Assert.IsTrue(pythonIndicator.GetAttr(\"is_ready\").GetAndDispose<bool>());\n                Assert.IsTrue(pythonIndicator.GetAttr(\"samples\").GetAndDispose<int>() >= 100);\n            }\n        }\n\n        [Test]\n        public void IndicatorCanBeWarmedUpWithTimespan()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            _algorithm.AddEquity(referenceSymbol);\n            var indicator = new SimpleMovingAverage(\"SMA\", 100);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            _algorithm.WarmUpIndicator(referenceSymbol, indicator, TimeSpan.FromMinutes(60));\n            Assert.IsTrue(indicator.IsReady);\n            Assert.IsTrue(indicator.Samples >= 100);\n        }\n\n        [Test]\n        public void IndicatorCanBeWarmedUpWithoutSymbolInSecurities()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new SimpleMovingAverage(\"SMA\", 100);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            Assert.DoesNotThrow(() => _algorithm.WarmUpIndicator(referenceSymbol, indicator, TimeSpan.FromMinutes(60)));\n            Assert.IsTrue(indicator.IsReady);\n            Assert.IsTrue(indicator.Samples >= 100);\n        }\n\n        [Test]\n        public void PythonCustomIndicatorCanBeWarmedUpWithTimespan()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            _algorithm.AddEquity(referenceSymbol);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                            @\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        super().__init__()\n        self.warm_up_period = period\n        self.name = name\n        self.value = 0\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def update(self, input):\n        self.queue.appendleft(input.value)\n        count = len(self.queue)\n        self.value = np.sum(self.queue) / count\n        return count == self.queue.maxlen\");\n\n                var customIndicator = testModule.GetAttr(\"CustomSimpleMovingAverage\").Invoke(\"custom\".ToPython(), 100.ToPython());\n                _algorithm.WarmUpIndicator(referenceSymbol, customIndicator, TimeSpan.FromMinutes(60));\n                Assert.IsTrue(customIndicator.GetAttr(\"is_ready\").GetAndDispose<bool>());\n                Assert.IsTrue(customIndicator.GetAttr(\"samples\").GetAndDispose<int>() >= 100);\n            }\n        }\n\n        [TestCase(\"count\")]\n        [TestCase(\"StartAndEndDate\")]\n        public void IndicatorUpdatedWithSymbol(string testCase)\n        {\n            var time = new DateTime(2014, 06, 07);\n\n            var put = Symbols.CreateOptionSymbol(\"AAPL\", OptionRight.Call, 250m, new DateTime(2016, 01, 15));\n            var call = Symbols.CreateOptionSymbol(\"AAPL\", OptionRight.Put, 250m, new DateTime(2016, 01, 15));\n            var indicator = new Delta(option: put, mirrorOption: call, optionModel: OptionPricingModelType.BlackScholes, ivModel: OptionPricingModelType.BlackScholes);\n            _algorithm.SetDateTime(time);\n\n            IndicatorHistory indicatorValues;\n            if (testCase == \"count\")\n            {\n                indicatorValues = _algorithm.IndicatorHistory(indicator, new[] { put, call, put.Underlying }, 60 * 10, resolution: Resolution.Minute);\n            }\n            else\n            {\n                indicatorValues = _algorithm.IndicatorHistory(indicator, new[] { put, call, put.Underlying }, TimeSpan.FromMinutes(60 * (10 + 2)), resolution: Resolution.Minute);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(0.9942989m, indicator.Current.Value);\n            Assert.AreEqual(0.3514844m, indicator.ImpliedVolatility.Current.Value);\n            Assert.AreEqual(390, indicatorValues.Count);\n\n            var lastData = indicatorValues.Current.Last();\n            Assert.AreEqual(new DateTime(2014, 6, 6, 16, 0, 0), lastData.EndTime);\n            Assert.AreEqual(lastData.EndTime, indicatorValues.Last().EndTime);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        public void PythonCustomIndicator(int testCases)\n        {\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            using (Py.GIL())\n            {\n                PyModule module;\n                if (testCases == 1)\n                {\n                    module = PyModule.FromString(\"PythonCustomIndicator\",\n                        @\"\nfrom AlgorithmImports import *\nclass GoodCustomIndicator(PythonIndicator):\n    def __init__(self):\n        self.Value = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\");\n                }\n                else\n                {\n                    module = PyModule.FromString(\"PythonCustomIndicator\",\n                        @\"\nfrom AlgorithmImports import *\nclass GoodCustomIndicator:\n    def __init__(self):\n        self.IsReady = True\n        self.Value = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\");\n                }\n\n                var goodIndicator = module.GetAttr(\"GoodCustomIndicator\").Invoke();\n                var pandasFrame = _algorithm.IndicatorHistory(goodIndicator, _equity.ToPython(), TimeSpan.FromDays(5), Resolution.Minute);\n                var dataCount = QuantBookIndicatorsTests.GetDataFrameLength(pandasFrame.DataFrame);\n\n                Assert.IsTrue((bool)((dynamic)goodIndicator).IsReady);\n                Assert.AreEqual((int)(4 * 60 * 6.5), dataCount);\n            }\n        }\n\n        [Test]\n        public void SpecificTTypeIndicator()\n        {\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new CustomIndicator();\n            var result = _algorithm.IndicatorHistory(indicator, referenceSymbol, TimeSpan.FromDays(1), Resolution.Minute).ToList();\n            Assert.AreEqual(390, result.Count);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [TestCase(\"span\", 1)]\n        [TestCase(\"count\", 1)]\n        [TestCase(\"span\", 2)]\n        [TestCase(\"count\", 2)]\n        public void SMAAssertDataCount(string testCase, int requestCount)\n        {\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new SimpleMovingAverage(10);\n            IndicatorHistory result;\n            if (testCase == \"span\")\n            {\n                result = _algorithm.IndicatorHistory(indicator, referenceSymbol, TimeSpan.FromDays(requestCount), Resolution.Daily);\n            }\n            else\n            {\n                result = _algorithm.IndicatorHistory(indicator, referenceSymbol, requestCount, Resolution.Daily);\n            }\n            Assert.AreEqual(requestCount, result.Count);\n            Assert.AreEqual(10 + requestCount - 1, indicator.Samples);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public void IndicatorHistoryIsSupportedInPythonForOptionsIndicators([Range(1, 4)] int overload, [Values] bool useMirrorContract)\n        {\n            _algorithm.SetDateTime(new DateTime(2014, 06, 07));\n\n            var contract = Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 505, new DateTime(2014, 6, 27));\n            var mirrorContract = useMirrorContract\n                ? Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Put, 505, new DateTime(2014, 6, 27))\n                : null;\n            var underlying = contract.Underlying;\n\n            var indicator = new ImpliedVolatility(contract, optionModel: OptionPricingModelType.BlackScholes, mirrorOption: mirrorContract);\n\n            using var _ = Py.GIL();\n\n            using var pyIndicator = indicator.ToPython();\n            var symbols = useMirrorContract ? new[] { contract, mirrorContract, underlying } : new[] { contract, underlying };\n            using var pySymbols = symbols.ToPyListUnSafe();\n\n            var symbolsHistory = overload != 4\n                ? null\n                : _algorithm.History(symbols, TimeSpan.FromDays(2), Resolution.Minute);\n\n            var indicatorHistory = overload switch\n            {\n                1 => _algorithm.IndicatorHistory(pyIndicator, pySymbols, TimeSpan.FromDays(2), Resolution.Minute),\n                2 => _algorithm.IndicatorHistory(pyIndicator, pySymbols, 60 * 24 * 2, Resolution.Minute),\n                3 => _algorithm.IndicatorHistory(pyIndicator, pySymbols, new DateTime(2014, 6, 6), new DateTime(2014, 6, 7), Resolution.Minute),\n                4 => _algorithm.IndicatorHistory(pyIndicator, symbolsHistory),\n                _ => throw new ArgumentOutOfRangeException(nameof(overload), \"Invalid overload\")\n            };\n\n            Assert.AreEqual(390, indicatorHistory.Count);\n\n            using var dataFrame = indicatorHistory.DataFrame;\n            Assert.AreEqual(390, dataFrame.GetAttr(\"shape\")[0].GetAndDispose<int>());\n            // Assert dataframe column names are current, price, oppositeprice and underlyingprice\n            var columns = dataFrame.GetAttr(\"columns\").InvokeMethod<List<string>>(\"tolist\");\n            var expectedColumns = new[] { \"current\", \"price\", \"oppositeprice\", \"underlyingprice\", \"theoreticalprice\" };\n            CollectionAssert.AreEquivalent(expectedColumns, columns);\n        }\n\n        [Test]\n        public void WarmUpIndicatorIsSupportedInPythonForOptionsIndicators([Values(1, 2)] int overload, [Values] bool useMirrorContract)\n        {\n            _algorithm.SetDateTime(new DateTime(2014, 06, 07));\n\n            var contract = Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 505, new DateTime(2014, 07, 19));\n            var mirrorContract = useMirrorContract\n                ? Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Put, 505, new DateTime(2014, 07, 19))\n                : null;\n            var underlying = contract.Underlying;\n\n            var indicator = new ImpliedVolatility(contract, optionModel: OptionPricingModelType.BlackScholes, mirrorOption: mirrorContract);\n\n            using var _ = Py.GIL();\n\n            using var pyIndicator = indicator.ToPython();\n            var symbols = useMirrorContract ? new[] { contract, mirrorContract, underlying } : new[] { contract, underlying };\n            using var pySymbols = symbols.ToPyListUnSafe();\n\n            switch (overload)\n            {\n                case 1:\n                    _algorithm.WarmUpIndicator(pySymbols, pyIndicator, TimeSpan.FromDays(1));\n                    break;\n\n                case 2:\n                    _algorithm.WarmUpIndicator(pySymbols, pyIndicator, Resolution.Daily);\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(overload), \"Invalid overload\");\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            if (useMirrorContract)\n            {\n                Assert.IsNotNull(indicator.OppositePrice);\n            }\n            else\n            {\n                Assert.IsNull(indicator.OppositePrice);\n            }\n        }\n\n        [Test]\n        public void IndicatorHistoryDataFrameDoesNotCointainDefaultDateTimeIndex()\n        {\n            var pandasConverter = new PandasConverter();\n            var indicatorsDataPointPerProperty = new List<InternalIndicatorValues>\n                {\n                    new InternalIndicatorValues(null, \"current\")\n                };\n            var lazyDataFrame = new Lazy<PyObject>(\n                    () => pandasConverter.GetIndicatorDataFrame(indicatorsDataPointPerProperty.Select(x => new KeyValuePair<string, List<IndicatorDataPoint>>(x.Name, x.Values))),\n                    isThreadSafe: false);\n            var indicatorHistory = new IndicatorHistory(new List<IndicatorDataPoints>(), indicatorsDataPointPerProperty, lazyDataFrame);\n            indicatorHistory.Current.Add(new IndicatorDataPoint(Symbols.SPY, new DateTime(2018, 1, 1), 100));\n            indicatorHistory.Current.Add(new IndicatorDataPoint(Symbols.SPY, new DateTime(2018, 1, 2), 100));\n            // Force insertion of a default(DateTime) timestamp to ensure it's excluded from the DataFrame\n            indicatorHistory.Current.Add(new IndicatorDataPoint(Symbols.SPY, default, 100));\n\n            dynamic dataframe = indicatorHistory.DataFrame;\n            using (Py.GIL())\n            {\n                var index = dataframe.index;\n                foreach (dynamic time in index)\n                {\n                    DateTime timestamp = (DateTime)time.AsManagedObject(typeof(DateTime));\n                    // Ensure that no timestamp in the DataFrame index is equal to default(DateTime)\n                    Assert.AreNotEqual(default(DateTime), timestamp);\n                }\n            }\n        }\n\n        [Test]\n        public void IndicatorHistoryShouldIncludeValidIndicatorsAndExplicitlyIncludedProperties()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            var indicator = new TestIndicator();\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            var history = _algorithm.History(new[] { referenceSymbol }, TimeSpan.FromDays(5), Resolution.Minute);\n            var indicatorValues = _algorithm.IndicatorHistory(indicator, history);\n\n            dynamic dataframe = indicatorValues.DataFrame;\n            using (Py.GIL())\n            {\n                var index = dataframe.index;\n                var columns = dataframe.columns;\n                var expectedColumns = new List<string> { \"smaprop\", \"genericprop\", \"current\", \"nongenericprop\", \"counter\", \"indicatortype\", \"description\" };\n                var columnsCount = 0;\n                foreach (dynamic col in columns)\n                {\n                    columnsCount++;\n                    var columnName = (string)col.AsManagedObject(typeof(string));\n                    Assert.IsTrue(expectedColumns.Contains(columnName));\n                }\n                Assert.AreEqual(expectedColumns.Count, columnsCount);\n\n                // Validate that the number of rows in the \"current\" column\n                // matches the row count in \"counter\", \"indicatortype\", and \"description\" columns\n                // Get the number of rows in each relevant column using __len__()\n                int currentLen = dataframe[\"current\"].InvokeMethod(\"__len__\").As<int>();\n                int counterLen = dataframe[\"counter\"].InvokeMethod(\"__len__\").As<int>();\n                int indicatorTypeLen = dataframe[\"indicatortype\"].InvokeMethod(\"__len__\").As<int>();\n                int descriptionLen = dataframe[\"description\"].InvokeMethod(\"__len__\").As<int>();\n\n                // Assert that all lengths match the length of \"current\"\n                Assert.AreEqual(currentLen, counterLen);\n                Assert.AreEqual(currentLen, indicatorTypeLen);\n                Assert.AreEqual(currentLen, descriptionLen);\n            }\n        }\n\n        private enum TestIndicatorType\n        {\n            TypeA,\n            TypeB\n        }\n\n        private class TestIndicator : IndicatorBase<QuoteBar>, IIndicatorWarmUpPeriodProvider\n        {\n            [PandasIgnore]\n            public Identity IgnoredProp { get; }\n            public SimpleMovingAverage SmaProp { get; }\n            public IndicatorBase<IndicatorDataPoint> GenericProp { get; }\n            public IndicatorBase NonGenericProp { get; }\n            public int Counter { get; set; }\n            public TestIndicatorType IndicatorType { get; set; }\n            public string Description { get; set; }\n            private bool _isReady;\n            public int WarmUpPeriod => 1;\n            public override bool IsReady => _isReady;\n            public TestIndicator() : base(\"Pepe\")\n            {\n                SmaProp = new SimpleMovingAverage(\"SMA\", 5);\n                GenericProp = new Identity(\"Generic\");\n                IgnoredProp = new Identity(\"Ignored\");\n                NonGenericProp = new Identity(\"NoGeneric\");\n            }\n            protected override decimal ComputeNextValue(QuoteBar input)\n            {\n                Counter++;\n                _isReady = true;\n                return input.Ask.High;\n            }\n        }\n\n        private class CustomIndicator : IndicatorBase<QuoteBar>, IIndicatorWarmUpPeriodProvider\n        {\n            private bool _isReady;\n            public int WarmUpPeriod => 1;\n            public override bool IsReady => _isReady;\n            public CustomIndicator() : base(\"Pepe\")\n            { }\n            protected override decimal ComputeNextValue(QuoteBar input)\n            {\n                _isReady = true;\n                return input.Ask.High;\n            }\n        }\n\n        [Test]\n        public void SupportsConversionToIndicatorBaseBaseDataCorrectly([Range(1, 6)] int scenario)\n        {\n            const string code = @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Indicators import *\n\ndef create_intraday_vwap_indicator(name):\n    return IntradayVwap(name)\ndef create_consolidator():\n    return TradeBarConsolidator(timedelta(minutes=1))\n\";\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(), code);\n                string name = \"test\";\n\n                // Creates the IntradayVWAP (IndicatorBase<BaseData>)\n                var indicator = module.GetAttr(\"create_intraday_vwap_indicator\").Invoke(name.ToPython());\n                var consolidator = module.GetAttr(\"create_consolidator\").Invoke();\n                var SymbolList = new List<Symbol>\n                {\n                    Symbols.SPY,\n                    Symbols.IBM,\n                };\n\n                // Tests different scenarios based on the \"scenario\" parameter\n                switch (scenario)\n                {\n                    case 1:\n                        Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(Symbols.SPY, indicator, consolidator));\n                        break;\n                    case 2:\n                        Assert.DoesNotThrow(() => _algorithm.WarmUpIndicator(SymbolList.ToPyList(), indicator));\n                        break;\n                    case 3:\n                        Assert.DoesNotThrow(() => _algorithm.WarmUpIndicator(SymbolList.ToPyList(), indicator, TimeSpan.FromDays(1)));\n                        break;\n                    case 4:\n                        Assert.DoesNotThrow(() => _algorithm.IndicatorHistory(indicator, SymbolList.ToPyList(), 10));\n                        break;\n                    case 5:\n                        Assert.DoesNotThrow(() => _algorithm.IndicatorHistory(indicator, SymbolList.ToPyList(), new DateTime(2014, 6, 6), new DateTime(2014, 6, 7)));\n                        break;\n                    case 6:\n                        var symbolsHistory = _algorithm.History(SymbolList, TimeSpan.FromDays(2), Resolution.Minute);\n                        Assert.DoesNotThrow(() => _algorithm.IndicatorHistory(indicator, symbolsHistory));\n                        break;\n                    default:\n                        break;\n                }\n            }\n        }\n\n        [Test]\n        public void IchimokuIndicatorHistoryDataFrameDoesNotContainNaNInCurrentColumn()\n        {\n            var referenceSymbol = Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA);\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            var history = _algorithm.History(new[] { referenceSymbol }, TimeSpan.FromDays(5), Resolution.Minute);\n            var indicator = new IchimokuKinkoHyo(9, 26, 17, 52, 26, 26);\n            var indicatorValues = _algorithm.IndicatorHistory(indicator, history);\n            indicatorValues.Current.Add(new IndicatorDataPoint(referenceSymbol, default(DateTime), 1));\n\n            dynamic dataframe = indicatorValues.DataFrame;\n            using (Py.GIL())\n            {\n                var currentColumn = dataframe[\"current\"];\n                foreach (PyObject value in currentColumn)\n                {\n                    double doubleValue = value.As<double>();\n                    Assert.IsFalse(double.IsNaN(doubleValue));\n                }\n            }\n        }\n\n        [Test]\n        public void CanRegisterIndicatorsWithPythonSelector()\n        {\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            _algorithm.Settings.AutomaticIndicatorWarmUp = true;\n            var symbol = _algorithm.AddEquity(\"SPY\").Symbol;\n\n            using var _ = Py.GIL();\n            var testModule = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\n\nclass LastInputTracker:\n    last_input = None\n\ndef selector(bar):\n    LastInputTracker.last_input = bar\n    return bar.close\n\ndef get_indicator(algo, symbol):\n    indicator = SimpleMovingAverage(10)\n    algo.register_indicator(symbol, indicator, Resolution.MINUTE, selector=selector)\n    algo.warm_up_indicator(symbol, indicator, selector=selector)\n    return indicator\n\");\n\n            using var pyAlgo = _algorithm.ToPython();\n            using var pySymbol = symbol.ToPython();\n            var indicator = testModule.GetAttr(\"get_indicator\").Invoke(pyAlgo, pySymbol).GetAndDispose<IndicatorBase>();\n\n            // The indicator should have been updated during the warm-up period\n            var lastInput = testModule.GetAttr(\"LastInputTracker\").GetAttr(\"last_input\").GetAndDispose<TradeBar>();\n            Assert.IsNotNull(lastInput);\n        }\n\n        // Some specific indicator helper methods tests\n        [TestCase(\"abands\", \"symbol, 2\", false)]\n        [TestCase(\"ad\", \"symbol\", false)]\n        [TestCase(\"adosc\", \"symbol, 2, 3\", false)]\n        [TestCase(\"sma\", \"symbol, 3\", true)]\n        [TestCase(\"ema\", \"symbol, 3\", true)]\n        [TestCase(\"arima\", \"symbol, 1, 1, 1, 10\", true)]\n        public void IndicatorHelperMethodsWorkWithPythonSelectors(string indicatorName, string indicatorArgs, bool decimalSelector)\n        {\n            _algorithm.SetDateTime(new DateTime(2013, 10, 11));\n            _algorithm.Settings.AutomaticIndicatorWarmUp = true;\n\n            var symbol = _algorithm.AddEquity(\"SPY\").Symbol;\n            var selector = decimalSelector ? \"decimal_selector\" : \"selector\";\n\n            using var _ = Py.GIL();\n            var testModule = PyModule.FromString(\"testModule\",\n                @$\"\nfrom AlgorithmImports import *\n\nclass LastInputTracker:\n    last_input = None\n\ndef selector(bar):\n    LastInputTracker.last_input = bar\n    return bar\n\ndef decimal_selector(bar):\n    LastInputTracker.last_input = bar\n    return bar.close\n\ndef get_indicator(algo, symbol):\n    return algo.{indicatorName}({indicatorArgs}, selector={selector})\n\");\n\n            using var pyAlgo = _algorithm.ToPython();\n            using var pySymbol = symbol.ToPython();\n            var indicator = testModule.GetAttr(\"get_indicator\").Invoke(pyAlgo, pySymbol).GetAndDispose<IndicatorBase>();\n\n            // The indicator should have been updated during the warm-up period\n            var lastInput = testModule.GetAttr(\"LastInputTracker\").GetAttr(\"last_input\").GetAndDispose<TradeBar>();\n            Assert.IsNotNull(lastInput);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmInitializeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    /// <summary>\n    /// Test mixed call order combinations of SetSecurityInitializer, SetBrokerageModel and AddSecurity\n    /// </summary>\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmInitializeTests\n    {\n        private const string Ticker = \"EURUSD\";\n        private const Resolution Resolution = QuantConnect.Resolution.Second;\n        private const string Market = QuantConnect.Market.FXCM;\n        private const BrokerageName BrokerageName = QuantConnect.Brokerages.BrokerageName.FxcmBrokerage;\n        private const int RoundingPrecision = 20;\n        private readonly MarketOrder _order = new MarketOrder { Quantity = 1000 };\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void Validates_SetEndTime(bool explicitSet)\n        {\n            var algorithm = GetAlgorithm();\n\n            // We initialize the algorithm with `now` in the algorithm default time zone\n            var end = DateTime.UtcNow.ConvertFromUtc(algorithm.TimeZone);\n\n            if (explicitSet)\n            {\n                algorithm.SetEndDate(end);\n            }\n            var excepted = end.RoundDown(TimeSpan.FromDays(1)).AddTicks(-1);\n            Assert.AreEqual(algorithm.EndDate, excepted);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_AddForex()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n\n            // Leverage and FeeModel from BrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_IB_AddForex()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n\n            // Leverage and FeeModel from BrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForex_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // Leverage and FeeModel from BrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_AddForexWithLeverage()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from BrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForexWithLeverage_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from BrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_AddForex()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n\n            // Leverage and FeeModel from SecurityInitializer\n            Assert.AreEqual(100, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForex_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // SetSecurityInitializer does not apply to securities added before the call\n            // Leverage and FeeModel from DefaultBrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(ConstantFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_AddForexWithLeverage()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from SecurityInitializer\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForexWithLeverage_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // Leverage passed to AddForex always takes precedence\n            // SetSecurityInitializer does not apply to securities added before the call\n            // Leverage from AddForex, FeeModel from DefaultBrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(ConstantFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_AddForex_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // SetSecurityInitializer overrides the brokerage model\n            // Leverage and FeeModel from SecurityInitializer\n            Assert.AreEqual(100, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_SetBrokerageModel_AddForex()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n\n            // SetSecurityInitializer overrides the brokerage model\n            // Leverage and FeeModel from SecurityInitializer\n            Assert.AreEqual(100, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_SetSecurityInitializer_AddForex()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n\n            // SetSecurityInitializer overrides the brokerage model\n            // Leverage and FeeModel from SecurityInitializer\n            Assert.AreEqual(100, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_AddForex_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // SetSecurityInitializer does not apply to securities added before the call\n            // Leverage and FeeModel from BrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForex_SetSecurityInitializer_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // SetSecurityInitializer does not apply to securities added before the call\n            // Leverage and FeeModel from DefaultBrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(ConstantFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForex_SetBrokerageModel_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market);\n            algorithm.SetBrokerageModel(BrokerageName);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // SetSecurityInitializer does not apply to securities added before the call\n            // Leverage and FeeModel from BrokerageModel\n            Assert.AreEqual(50, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_AddForexWithLeverage_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from Initializer\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetSecurityInitializer_SetBrokerageModel_AddForexWithLeverage()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n\n            // Leverage passed to AddForex always takes precedence\n            // SetSecurityInitializer overrides the brokerage model\n            // Leverage from AddForex, FeeModel from SecurityInitializer\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_SetSecurityInitializer_AddForexWithLeverage()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n\n            // Leverage passed to AddForex always takes precedence\n            // SetSecurityInitializer overrides the brokerage model\n            // Leverage from AddForex, FeeModel from SecurityInitializer\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(InteractiveBrokersFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(2, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_SetBrokerageModel_AddForexWithLeverage_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            algorithm.SetBrokerageModel(BrokerageName);\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from BrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForexWithLeverage_SetSecurityInitializer_SetBrokerageModel()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n            algorithm.SetBrokerageModel(BrokerageName);\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from DefaultBrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(ConstantFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        public void Validates_AddForexWithLeverage_SetBrokerageModel_SetSecurityInitializer()\n        {\n            var algorithm = GetAlgorithm();\n\n            var security = algorithm.AddForex(Ticker, Resolution, Market, true, 25);\n            algorithm.SetBrokerageModel(BrokerageName);\n            algorithm.SetSecurityInitializer(x =>\n            {\n                x.SetLeverage(100);\n                x.FeeModel = new InteractiveBrokersFeeModel();\n            });\n\n            // Leverage passed to AddForex always takes precedence\n            // Leverage from AddForex, FeeModel from BrokerageModel\n            Assert.AreEqual(25, Math.Round(security.Leverage, RoundingPrecision));\n            Assert.IsInstanceOf(typeof(FxcmFeeModel), security.FeeModel);\n            var fee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, _order));\n            Assert.AreEqual(0.04, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        private QCAlgorithm GetAlgorithm()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            return algorithm;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmLiveTradingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmLiveTradingTests\n    {\n        [Test]\n        public void SetHoldingsTakesIntoAccountPendingMarketOrders()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetLiveMode(false);\n            var security = algorithm.AddEquity(\"SPY\");\n            security.Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            security.Exchange.SetLocalDateTimeFrontierProvider(algorithm.TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new Tick { Value = 270m });\n            algorithm.SetFinishedWarmingUp();\n\n            using var brokerage = new NullBrokerage();\n            var transactionHandler = new BrokerageTransactionHandler();\n\n            transactionHandler.Initialize(algorithm, brokerage, new LiveTradingResultHandler());\n            Thread.Sleep(250);\n            algorithm.Transactions.SetOrderProcessor(transactionHandler);\n\n            var symbol = security.Symbol;\n\n            // this order should timeout (no fills received within 5 seconds)\n            algorithm.SetHoldings(symbol, 1m);\n            Thread.Sleep(2000);\n\n            var openOrders = algorithm.Transactions.GetOpenOrders();\n            Assert.AreEqual(1, openOrders.Count);\n\n            // this order should never be submitted because of the pending order\n            algorithm.SetHoldings(symbol, 1m);\n            Thread.Sleep(2000);\n\n            openOrders = algorithm.Transactions.GetOpenOrders();\n            Assert.AreEqual(1, openOrders.Count);\n\n            transactionHandler.Exit();\n        }\n    }\n\n    public class NullBrokerage : IBrokerage\n    {\n        public virtual void Dispose() {}\n#pragma warning disable 0067 // NullBrokerage doesn't use any of these so we will just ignore them\n        public event EventHandler<List<OrderEvent>> OrdersStatusChanged;\n        public event EventHandler<OrderEvent> OptionPositionAssigned;\n        public event EventHandler<OptionNotificationEventArgs> OptionNotification;\n        public event EventHandler<AccountEvent> AccountChanged;\n        public event EventHandler<BrokerageMessageEvent> Message;\n        public event EventHandler<DelistingNotificationEventArgs> DelistingNotification;\n        public event EventHandler<BrokerageOrderIdChangedEvent> OrderIdChanged;\n        public event EventHandler<NewBrokerageOrderNotificationEventArgs> NewBrokerageOrderNotification;\n        public event EventHandler<OrderUpdateEvent> OrderUpdated;\n#pragma warning restore 0067\n\n        public string Name => \"NullBrokerage\";\n        public bool IsConnected { get; } = true;\n        public List<Order> GetOpenOrders() { return new List<Order>(); }\n        public List<Holding> GetAccountHoldings() { return new List<Holding>(); }\n        public List<CashAmount> GetCashBalance() { return new List<CashAmount>(); }\n        public bool PlaceOrder(Order order) { return true; }\n        public bool UpdateOrder(Order order) { return true; }\n        public bool CancelOrder(Order order) { return true; }\n        public void Connect() {}\n        public void Disconnect() {}\n        public bool AccountInstantlyUpdated { get; } = true;\n        public string AccountBaseCurrency => Currencies.USD;\n        public virtual IEnumerable<BaseData> GetHistory(HistoryRequest request) { return Enumerable.Empty<BaseData>(); }\n        public DateTime LastSyncDateTimeUtc { get; } = DateTime.UtcNow;\n        public bool ConcurrencyEnabled { get; set; }\n\n        public bool ShouldPerformCashSync(DateTime currentTimeUtc) { return false; }\n        public bool PerformCashSync(IAlgorithm algorithm, DateTime currentTimeUtc, Func<TimeSpan> getTimeSinceLastFill) { return true; }\n\n        public void OnOrderEvent(OrderEvent orderEvent)\n        {\n            OrdersStatusChanged?.Invoke(this, [orderEvent]);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmNamingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AlgorithmNamingTest\n    {\n        #region Naming tests\n\n        private static void SetAlgorithmNameUsingPropertySetter(QCAlgorithm algorithm, string name)\n        {\n            algorithm.Name = name;\n        }\n\n        private static void SetAlgorithmNameUsingSetMethod(QCAlgorithm algorithm, string name)\n        {\n            algorithm.SetName(name);\n        }\n\n        private static void TestSettingAlgorithmName(Action<QCAlgorithm, string> setName)\n        {\n            var algorithm = new QCAlgorithm();\n            var name = \"TestName\";\n            setName(algorithm, name);\n            Assert.AreEqual(name, algorithm.Name);\n        }\n\n        [Test]\n        public void AlgorithmNameIsSetUsingPropertySetter()\n        {\n            TestSettingAlgorithmName(SetAlgorithmNameUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmNameIsSetUsingSetMethod()\n        {\n            TestSettingAlgorithmName(SetAlgorithmNameUsingSetMethod);\n        }\n\n        private static void TestSettingLongAlgorithmName(Action<QCAlgorithm, string> setName)\n        {\n            var algorithm = new QCAlgorithm();\n            var name = new string('a', MaxNameAndTagsLength + 1);\n            setName(algorithm, name);\n            Assert.AreEqual(name.Substring(0, MaxNameAndTagsLength), algorithm.Name);\n        }\n\n        [Test]\n        public void AlgorithmNameTruncatedUsingPropertySetter()\n        {\n            TestSettingLongAlgorithmName(SetAlgorithmNameUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmNameTruncatedUsingSetMethod()\n        {\n            TestSettingLongAlgorithmName(SetAlgorithmNameUsingSetMethod);\n        }\n\n        private static void TestSettingAlgorithmNameAfterInitialization(Action<QCAlgorithm, string> setName)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetLocked();\n            Assert.Throws<InvalidOperationException>(() => setName(algorithm, \"TestName\"));\n        }\n\n        [Test]\n        public void AlgorithmNameCannotBeSetAfterInitializationUsingPropertySetter()\n        {\n            TestSettingAlgorithmNameAfterInitialization(SetAlgorithmNameUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmNameCannotBeSetAfterInitializationUsingSetMethod()\n        {\n            TestSettingAlgorithmNameAfterInitialization(SetAlgorithmNameUsingSetMethod);\n        }\n\n        #endregion\n\n        #region Tagging tests\n\n        private static void SetAlgorithmTagsUsingPropertySetter(QCAlgorithm algorithm, string[] tags)\n        {\n            algorithm.Tags = tags?.ToHashSet();\n        }\n\n        private static void SetAlgorithmTagsUsingSetMethod(QCAlgorithm algorithm, string[] tags)\n        {\n            algorithm.SetTags(tags?.ToHashSet());\n        }\n\n        private static void TestAlgorithmTagsAreSet(Action<QCAlgorithm, string[]> setTags, QCAlgorithm algorithm, string[] tags)\n        {\n            setTags(algorithm, tags);\n            CollectionAssert.AreEquivalent(tags, algorithm.Tags);\n        }\n\n        private static void TestSettingAlgorithmTags(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = new[] { \"tag1\", \"tag2\" };\n            TestAlgorithmTagsAreSet(setTags, algorithm, tags);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreSetUsingPropertySetter()\n        {\n            TestSettingAlgorithmTags(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreSetUsingSetMethod()\n        {\n            TestSettingAlgorithmTags(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        private static void TestOverridingAlgorithmTags(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n\n            var tags = new[] { \"tag1\", \"tag2\" };\n            TestAlgorithmTagsAreSet(setTags, algorithm, tags);\n\n            var newTags = new[] { \"tag3\", \"tag4\" };\n            TestAlgorithmTagsAreSet(setTags, algorithm, newTags);\n        }\n\n        [Test]\n        public void AlgorithmTagsCanBeOverriddenUsingPropertySetter()\n        {\n            TestOverridingAlgorithmTags(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmTagsCanBeOverriddenUsingSetMethod()\n        {\n            TestOverridingAlgorithmTags(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        public static void TestSettingNullAlgorithmTags(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n            setTags(algorithm, null);\n            CollectionAssert.IsEmpty(algorithm.Tags);\n\n            var tags = new[] { \"tag1\", \"tag2\" };\n            setTags(algorithm, tags);\n            setTags(algorithm, null);\n            CollectionAssert.AreEquivalent(tags, algorithm.Tags);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreLeftUntouchedWhenTryingToSetNullUsingPropertySetter()\n        {\n            TestSettingNullAlgorithmTags(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreLeftUntouchedWhenTryingToSetNullUsingSetMethod()\n        {\n            TestSettingNullAlgorithmTags(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        private static void TestSettingTooManyAlgorithmTags(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = Enumerable.Range(0, MaxTagsCount + 1).Select(i => $\"tag{i}\").ToArray();\n            setTags(algorithm, tags);\n            CollectionAssert.AreEquivalent(tags.ToHashSet().Take(MaxTagsCount), algorithm.Tags);\n        }\n\n        [Test]\n        public void AlgorithmTagsCollectionIsTruncatedWhenSettingTooManyUsingPropertySetter()\n        {\n            TestSettingTooManyAlgorithmTags(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmTagsCollectionIsTruncatedWhenSettingTooManyUsingSetMethod()\n        {\n            TestSettingTooManyAlgorithmTags(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        private static void TestSettingTagsAreTruncatedWhenTooLong(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = Enumerable.Range(0, MaxTagsCount)\n                .Select(i => \"tag\" + string.Concat(Enumerable.Repeat(i, MaxNameAndTagsLength + 1)))\n                .ToArray();\n            setTags(algorithm, tags);\n            CollectionAssert.AreEquivalent(tags.ToHashSet(t => t.Substring(0, MaxNameAndTagsLength)), algorithm.Tags);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreTruncatedWhenTooLongUsingPropertySetter()\n        {\n            TestSettingTagsAreTruncatedWhenTooLong(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreTruncatedWhenTooLongUsingSetMethod()\n        {\n            TestSettingTagsAreTruncatedWhenTooLong(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        public static void TestSettingEmptyTagsAreIgnored(Action<QCAlgorithm, string[]> setTags)\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = new[] { \"tag1\", \"\", \"tag2\", null, \"tag3\", \" \" };\n            setTags(algorithm, tags);\n\n            var expectedTags = new[] { \"tag1\", \"tag2\", \"tag3\" };\n            CollectionAssert.AreEquivalent(expectedTags, algorithm.Tags);\n        }\n\n        [Test]\n        public void AlgorithmSetContainingEmptyTagsAreIgnoredUsingPropertySetter()\n        {\n            TestSettingEmptyTagsAreIgnored(SetAlgorithmTagsUsingPropertySetter);\n        }\n\n        [Test]\n        public void AlgorithmSetContainingEmptyTagsAreIgnoredUsingSetMethod()\n        {\n            TestSettingEmptyTagsAreIgnored(SetAlgorithmTagsUsingSetMethod);\n        }\n\n        [Test]\n        public void AlgorithmTagsAreAddedOneByOne()\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = new List<string>();\n            for (var i = 0; i < MaxTagsCount; i++)\n            {\n                tags.Add($\"tag{i}\");\n                algorithm.AddTag(tags.Last());\n                CollectionAssert.AreEquivalent(tags, algorithm.Tags);\n            }\n        }\n\n        [Test]\n        public void DuplicatedTagsAreIgnored()\n        {\n            var algorithm = new QCAlgorithm();\n\n            var tag = \"tag\";\n            algorithm.AddTag(tag);\n            Assert.AreEqual(1, algorithm.Tags.Count);\n            Assert.AreEqual(tag, algorithm.Tags.Single());\n\n            algorithm.AddTag(tag);\n            Assert.AreEqual(1, algorithm.Tags.Count);\n            Assert.AreEqual(tag, algorithm.Tags.Single());\n        }\n\n        [TestCase(\"\")]\n        [TestCase(\" \")]\n        [TestCase(null)]\n        public void EmptyTagsAreIgnored(string emptyTag)\n        {\n            var algorithm = new QCAlgorithm();\n\n            algorithm.AddTag(emptyTag);\n            CollectionAssert.IsEmpty(algorithm.Tags);\n        }\n\n        [Test]\n        public void LongTagsAreTruncatedWhenAddedOneByOne()\n        {\n            var algorithm = new QCAlgorithm();\n            var tag = new string('a', MaxNameAndTagsLength + 1);\n            algorithm.AddTag(tag);\n            Assert.AreEqual(1, algorithm.Tags.Count);\n            Assert.AreEqual(tag.Substring(0, MaxNameAndTagsLength), algorithm.Tags.Single());\n        }\n\n        [Test]\n        public void TagsAreIgnoredWhenAddedOneByOneIfCollectionIsFull()\n        {\n            var algorithm = new QCAlgorithm();\n            var tags = Enumerable.Range(0, MaxTagsCount).Select(i => $\"tag{i}\").ToArray();\n            foreach (var tag in tags)\n            {\n                algorithm.AddTag(tag);\n            }\n            CollectionAssert.AreEquivalent(tags, algorithm.Tags);\n\n            // This will not be added\n            algorithm.AddTag(\"LastTag\");\n            CollectionAssert.AreEquivalent(tags, algorithm.Tags);\n        }\n\n        #endregion\n\n        private class TestQCAlgorithm : QCAlgorithm\n        {\n            public static int PublicMaxNameAndTagsLength => MaxNameAndTagsLength;\n\n            public static int PublicMaxTagsCount => MaxTagsCount;\n        }\n\n        private static int MaxNameAndTagsLength => TestQCAlgorithm.PublicMaxNameAndTagsLength;\n        private static int MaxTagsCount => TestQCAlgorithm.PublicMaxTagsCount;\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmPlottingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Tests.Indicators;\nusing System;\nusing System.Linq;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmPlottingTests\n    {\n        private Symbol _spy;\n        private QCAlgorithm _algorithm;\n        private IEnumerable<Type> _indicatorTestsTypes;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new AlgorithmStub();\n            _spy = _algorithm.AddEquity(\"SPY\").Symbol;\n\n            _indicatorTestsTypes =\n                from type in GetType().Assembly.GetTypes()\n                where type.IsPublic && !type.IsAbstract\n                where\n                   typeof(CommonIndicatorTests<TradeBar>).IsAssignableFrom(type) ||\n                   typeof(CommonIndicatorTests<IBaseDataBar>).IsAssignableFrom(type) ||\n                   typeof(CommonIndicatorTests<IndicatorDataPoint>).IsAssignableFrom(type)\n                select type;\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void IgnorePlotDuringLiveWarmup(bool liveMode)\n        {\n            _algorithm.SetLiveMode(liveMode);\n\n            _algorithm.Plot(\"Chart\", 1);\n            _algorithm.Plot(\"Chart\", \"Series\", 2);\n\n            foreach (var chart in _algorithm.GetChartUpdates(true))\n            {\n                foreach (var serie in chart.Series)\n                {\n                    if (liveMode)\n                    {\n                        Assert.IsEmpty(serie.Value.Values);\n                    }\n                    else\n                    {\n                        Assert.IsNotEmpty(serie.Value.Values);\n                    }\n                }\n            }\n\n            _algorithm.SetFinishedWarmingUp();\n            _algorithm.Plot(\"Chart\", 1);\n            _algorithm.Plot(\"Chart\", \"Series\", 2);\n\n            foreach (var chart in _algorithm.GetChartUpdates(true))\n            {\n                foreach (var serie in chart.Series)\n                {\n                    Assert.IsNotEmpty(serie.Value.Values);\n                }\n            }\n        }\n\n        [Test]\n        public void TestGetChartUpdatesWhileAdding()\n        {\n            var task1 = Task.Factory.StartNew(() =>\n            {\n                for (var i = 0; i < 100; i++)\n                {\n                    _algorithm.AddChart(new Chart($\"Test_{i}\"));\n                    Thread.Sleep(1);\n                }\n            });\n\n            var task2 = Task.Factory.StartNew(() =>\n            {\n                for (var i = 0; i < 100; i++)\n                {\n                    _algorithm.GetChartUpdates(true).ToList();\n                    Thread.Sleep(1);\n                }\n            });\n\n            Task.WaitAll(task1, task2);\n        }\n\n        [Test]\n        public void PlotPythonIndicatorInSeparateChart()\n        {\n            PyObject indicator;\n\n            foreach (var type in _indicatorTestsTypes)\n            {\n                var indicatorTest = Activator.CreateInstance(type);\n                if (indicatorTest is CommonIndicatorTests<IndicatorDataPoint>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<IndicatorDataPoint>).GetIndicatorAsPyObject();\n                }\n                else if (indicatorTest is CommonIndicatorTests<IBaseDataBar>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<IBaseDataBar>).GetIndicatorAsPyObject();\n                }\n                else if (indicatorTest is CommonIndicatorTests<TradeBar>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<TradeBar>).GetIndicatorAsPyObject();\n                }\n                else\n                {\n                    throw new NotSupportedException($\"RegistersIndicatorProperlyPython(): Unsupported indicator data type: {indicatorTest.GetType()}\");\n                }\n\n                Assert.DoesNotThrow(() => _algorithm.Plot($\"TestIndicatorPlot-{type.Name}\", indicator));\n                var charts = _algorithm.GetChartUpdates();\n                Assert.IsTrue(charts.Select(x => x.Name == $\"TestIndicatorPlot-{type.Name}\").Any());\n            }\n        }\n\n        [Test]\n        public void PlotPythonCustomIndicatorProperly()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\nclass PythonCustomIndicator(PythonIndicator):\n    def __init__(self):\n        self.Value = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\"\n                );\n\n                dynamic customIndicator = module.GetAttr(\"PythonCustomIndicator\").Invoke();\n                customIndicator.Name = \"custom\";\n                var input = new IndicatorDataPoint();\n                input.Value = 10;\n                customIndicator.Update(input);\n                customIndicator.Current.Value = customIndicator.Value;\n                Assert.DoesNotThrow(() => _algorithm.Plot(\"PlotTest\", customIndicator));\n                var charts = _algorithm.GetChartUpdates().ToList();\n                Assert.IsTrue(charts.Where(x => x.Name == \"PlotTest\").Any());\n                Assert.AreEqual(10, charts.First().Series[\"custom\"].GetValues<ChartPoint>().First().y);\n            }\n        }\n\n        [Test]\n        public void PlotCustomIndicatorAsDefault()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\n\nclass CustomIndicator:\n    def __init__(self):\n        self.Value = 10\n    def Update(self, input):\n        self.Value = input.Value\n        return True\"\n                );\n\n                var customIndicator = module.GetAttr(\"CustomIndicator\").Invoke();\n                Assert.DoesNotThrow(() => _algorithm.Plot(\"PlotTest\", customIndicator));\n                var charts = _algorithm.GetChartUpdates().ToList();\n                Assert.IsFalse(charts.Where(x => x.Name == \"PlotTest\").Any());\n                Assert.IsTrue(charts.Where(x => x.Name == \"Strategy Equity\").Any());\n                Assert.AreEqual(10, charts.First().Series[\"PlotTest\"].GetValues<ChartPoint>().First().y);\n            }\n        }\n\n        [Test]\n        public void PlotIndicatorPlotsBaseIndicator()\n        {\n            var sma1 = new SimpleMovingAverage(1);\n            var sma2 = new SimpleMovingAverage(1);\n            var ratio = sma1.Over(sma2);\n\n            Assert.DoesNotThrow(() => _algorithm.PlotIndicator(\"PlotTest\", ratio));\n\n            sma1.Update(new DateTime(2022, 11, 15), 1);\n            sma2.Update(new DateTime(2022, 11, 15), 2);\n\n            var charts = _algorithm.GetChartUpdates().ToList();\n            Assert.IsTrue(charts.Where(x => x.Name == \"PlotTest\").Any());\n\n            var chart = charts.First();\n            Assert.AreEqual(\"PlotTest\", chart.Name);\n            Assert.AreEqual(sma1.Current.Value / sma2.Current.Value, chart.Series[ratio.Name].GetValues<ChartPoint>().First().y);\n        }\n\n        private static string[] ReservedSummaryStatisticNames => Enumerable.Range(0, 101).Select(i => i.ToStringInvariant()).ToArray();\n\n        [TestCaseSource(nameof(ReservedSummaryStatisticNames))]\n        public void ThrowsOnReservedSummaryStatisticName(string statisticName)\n        {\n            Assert.Throws<ArgumentException>(() => _algorithm.SetSummaryStatistic(statisticName, 0.1m));\n            Assert.Throws<ArgumentException>(() => _algorithm.SetSummaryStatistic(statisticName, 0.1));\n            Assert.Throws<ArgumentException>(() => _algorithm.SetSummaryStatistic(statisticName, 1));\n            Assert.Throws<ArgumentException>(() => _algorithm.SetSummaryStatistic(statisticName, \"0.1\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmRegisterIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Tests.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing Moq;\nusing NodaTime;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmRegisterIndicatorTests\n    {\n        private Symbol _spy;\n        private Symbol _option;\n        private QCAlgorithm _algorithm;\n        private IEnumerable<Type> _indicatorTestsTypes;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _spy = _algorithm.AddEquity(\"SPY\").Symbol;\n            _option = _algorithm.AddOption(\"SPY\").Symbol;\n\n            _indicatorTestsTypes =\n                from type in GetType().Assembly.GetTypes()\n                where type.IsPublic && !type.IsAbstract\n                where\n                   typeof(CommonIndicatorTests<TradeBar>).IsAssignableFrom(type) ||\n                   typeof(CommonIndicatorTests<IBaseDataBar>).IsAssignableFrom(type) ||\n                   typeof(CommonIndicatorTests<IndicatorDataPoint>).IsAssignableFrom(type)\n                select type;\n        }\n\n        [Test]\n        public void RegistersIndicatorProperly()\n        {\n            var expected = 0;\n\n            foreach (var type in _indicatorTestsTypes)\n            {\n                var indicatorTest = Activator.CreateInstance(type);\n                if (indicatorTest is OptionBaseIndicatorTests<OptionIndicatorBase>)\n                {\n                    var indicator = (indicatorTest as OptionBaseIndicatorTests<OptionIndicatorBase>).Indicator;\n                    Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_option, indicator, Resolution.Minute));\n                    expected++;\n                }\n                else if (indicatorTest is CommonIndicatorTests<IndicatorDataPoint>)\n                {\n                    var indicator = (indicatorTest as CommonIndicatorTests<IndicatorDataPoint>).Indicator;\n                    Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_spy, indicator, Resolution.Minute, Field.Close));\n                    expected++;\n                }\n                else if (indicatorTest is CommonIndicatorTests<IBaseDataBar>)\n                {\n                    var indicator = (indicatorTest as CommonIndicatorTests<IBaseDataBar>).Indicator;\n                    Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_spy, indicator, Resolution.Minute));\n                    expected++;\n                }\n                else if (indicatorTest is CommonIndicatorTests<TradeBar>)\n                {\n                    var indicator = (indicatorTest as CommonIndicatorTests<TradeBar>).Indicator;\n                    Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_spy, indicator, Resolution.Minute));\n                    expected++;\n                }\n                else\n                {\n                    throw new NotSupportedException($\"RegistersIndicatorProperlyPython(): Unsupported indicator data type: {indicatorTest.GetType()}\");\n                }\n                var actual = _algorithm.SubscriptionManager.Subscriptions\n                    .Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity))\n                    .Consolidators.Count;\n                Assert.AreEqual(expected, actual);\n            }\n        }\n\n\n        private static TestCaseData[] IndicatorNameParameters => new[]\n        {\n            new TestCaseData(Symbols.SPY, \"TEST\", Resolution.Tick, \"TEST(SPY_tick)\"),\n            new TestCaseData(Symbols.SPY, \"TEST\", Resolution.Second, \"TEST(SPY_sec)\"),\n            new TestCaseData(Symbols.SPY, \"TEST\", Resolution.Minute, \"TEST(SPY_min)\"),\n            new TestCaseData(Symbols.SPY, \"TEST\", Resolution.Hour, \"TEST(SPY_hr)\"),\n            new TestCaseData(Symbols.SPY, \"TEST\", Resolution.Daily, \"TEST(SPY_day)\"),\n            new TestCaseData(Symbol.Empty, \"TEST\", Resolution.Minute, \"TEST(min)\"),\n            new TestCaseData(Symbol.None, \"TEST\", Resolution.Minute, \"TEST(min)\"),\n            new TestCaseData(Symbol.Empty, \"TEST\", null, \"TEST()\"),\n            new TestCaseData(Symbol.None, \"TEST\", null, \"TEST()\")\n        };\n\n        [Test, TestCaseSource(nameof(IndicatorNameParameters))]\n        public void CreateIndicatorName(Symbol symbol, string baseName, Resolution? resolution, string expectation)\n        {\n            Assert.AreEqual(expectation, _algorithm.CreateIndicatorName(symbol, baseName, resolution));\n        }\n\n        [Test]\n        public void PlotAndRegistersIndicatorProperlyPython()\n        {\n            var expected = 0;\n            PyObject indicator;\n\n            foreach (var type in _indicatorTestsTypes)\n            {\n                var indicatorTest = Activator.CreateInstance(type);\n                if (indicatorTest is OptionBaseIndicatorTests<OptionIndicatorBase>)\n                {\n                    indicator = (indicatorTest as OptionBaseIndicatorTests<OptionIndicatorBase>).GetIndicatorAsPyObject();\n                }\n                else if (indicatorTest is CommonIndicatorTests<IndicatorDataPoint>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<IndicatorDataPoint>).GetIndicatorAsPyObject();\n                }\n                else if (indicatorTest is CommonIndicatorTests<IBaseDataBar>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<IBaseDataBar>).GetIndicatorAsPyObject();\n                }\n                else if (indicatorTest is CommonIndicatorTests<TradeBar>)\n                {\n                    indicator = (indicatorTest as CommonIndicatorTests<TradeBar>).GetIndicatorAsPyObject();\n                }\n                else\n                {\n                    throw new NotSupportedException($\"RegistersIndicatorProperlyPython(): Unsupported indicator data type: {indicatorTest.GetType()}\");\n                }\n                Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_spy, indicator, Resolution.Minute));\n                Assert.DoesNotThrow(() => _algorithm.Plot(_spy.Value, indicator));\n                expected++;\n\n                var actual = _algorithm.SubscriptionManager.Subscriptions\n                    .Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity))\n                    .Consolidators.Count;\n                Assert.AreEqual(expected, actual);\n            }\n        }\n\n        [Test]\n        public void RegisterPythonCustomIndicatorProperly()\n        {\n            const string code = @\"\nclass GoodCustomIndicator:\n    def __init__(self):\n        self.IsReady = True\n        self.Value = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\nclass BadCustomIndicator:\n    def __init__(self):\n        self.IsReady = True\n        self.Value = 0\n    def Updat(self, input):\n        self.Value = input.Value\n        return True\";\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(), code);\n\n                var goodIndicator = module.GetAttr(\"GoodCustomIndicator\").Invoke();\n                Assert.DoesNotThrow(() => _algorithm.RegisterIndicator(_spy, goodIndicator, Resolution.Minute));\n\n                var actual = _algorithm.SubscriptionManager.Subscriptions\n                    .Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity))\n                    .Consolidators.Count;\n                Assert.AreEqual(1, actual);\n\n                var badIndicator = module.GetAttr(\"BadCustomIndicator\").Invoke();\n                Assert.Throws<NotImplementedException>(() => _algorithm.RegisterIndicator(_spy, badIndicator, Resolution.Minute));\n            }\n        }\n\n        [Test]\n        public void RegistersIndicatorProperlyPythonScript()\n        {\n            const string code = @\"\nfrom AlgorithmImports import *\n\nAddReference('QuantConnect.Lean.Engine')\nfrom QuantConnect.Lean.Engine.DataFeeds import *\n\nalgo = QCAlgorithm()\n\nmarketHoursDatabase = MarketHoursDatabase.FromDataFolder()\nsymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder()\nsecurityService =  SecurityService(algo.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDatabase, algo, RegisteredSecurityDataTypesProvider.Null, SecurityCacheProvider(algo.Portfolio), algorithm=algo)\nalgo.Securities.SetSecurityService(securityService)\ndataPermissionManager = DataPermissionManager()\ndataManager = DataManager(None, UniverseSelection(algo, securityService, dataPermissionManager, None), algo, algo.TimeKeeper, marketHoursDatabase, False, RegisteredSecurityDataTypesProvider.Null, dataPermissionManager)\nalgo.SubscriptionManager.SetDataManager(dataManager)\n\n\nforex = algo.AddForex('EURUSD', Resolution.Daily)\nindicator = IchimokuKinkoHyo('EURUSD', 9, 26, 26, 52, 26, 26)\nalgo.RegisterIndicator(forex.Symbol, indicator, Resolution.Daily)\";\n\n            using (Py.GIL())\n            {\n                Assert.DoesNotThrow(() => PyModule.FromString(\"RegistersIndicatorProperlyPythonScript\", code));\n            }\n        }\n\n        [Test]\n        public void IndicatorsCanBeRegisteredWithTickDataSelectors()\n        {\n            var ibm = _algorithm.AddEquity(\"IBM\", Resolution.Tick).Symbol;\n            var indicator = _algorithm.Identity(ibm, Resolution.Tick, Field.BidPrice);\n\n            var consolidator = indicator.Consolidators.Single();\n            consolidator.Update(new Tick() { BidPrice = 101 });\n            Assert.AreEqual(101, indicator.Current.Value);\n        }\n\n        [TestCaseSource(nameof(IndicatorUseDefaultSelectorWhenResolutionDoesNotMatchWithSelectorDataTypeTestCases))]\n        public void IndicatorUseDefaultSelectorWhenDataTypeDoesNotMatchWithSelectorDataType(\n            Symbol symbol,\n            SecurityType securityType,\n            Resolution resolution,\n            Func<IBaseData, decimal> selector,\n            IBaseData input,\n            decimal expectedValue)\n        {\n            _algorithm.AddSecurity(symbol, resolution);\n            var indicator = _algorithm.Identity(symbol, resolution, selector);\n\n            var consolidator = indicator.Consolidators.Single();\n            consolidator.Update(input);\n            Assert.AreEqual(expectedValue, indicator.Current.Value);\n        }\n\n        [Test]\n        public void IndicatorsCanBeRegisteredWithQuoteDataSelectors()\n        {\n            var ibm = _algorithm.AddEquity(\"IBM\", Resolution.Minute).Symbol;\n            var indicator = _algorithm.Identity(ibm, Resolution.Minute, Field.BidClose);\n\n            var consolidator = indicator.Consolidators.Single();\n            consolidator.Update(new QuoteBar() { Bid = new Bar() { Close = 101 }});\n            Assert.AreEqual(101, indicator.Current.Value);\n        }\n\n        [TestCaseSource(nameof(IndicatorsCanBeWarmedUpWithDataSelectorsTestCases))]\n        public void IndicatorsCanBeWarmedUpWithDataSelectors(Symbol symbol,\n            SecurityType securityType,\n            Resolution resolution,\n            Func<IBaseData, decimal> selector,\n            Slice warmUpinput,\n            decimal expectedValue)\n        {\n            _algorithm.Settings.AutomaticIndicatorWarmUp = true;\n            _algorithm.AddSecurity(symbol, resolution);\n\n            var historyProvider = new Mock<SubscriptionDataReaderHistoryProvider>();\n            historyProvider.Setup(x => x.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>())).Returns(new List<Slice>() { warmUpinput });\n            _algorithm.SetHistoryProvider(historyProvider.Object);\n            var indicator = _algorithm.Identity(symbol, resolution, selector);\n\n            Assert.AreEqual(expectedValue, indicator.Current.Value);\n        }\n\n        [Test]\n        public void IndicatorsCanBeRegisteredWithTradeDataSelectors()\n        {\n            var ibm = _algorithm.AddEquity(\"IBM\", Resolution.Minute).Symbol;\n            var indicator = _algorithm.Identity(ibm, Resolution.Minute, Field.Volume);\n\n            var consolidator = indicator.Consolidators.Single();\n            consolidator.Update(new TradeBar() { Volume = 101 });\n            Assert.AreEqual(101, indicator.Current.Value);\n        }\n\n        public static object[] IndicatorUseDefaultSelectorWhenResolutionDoesNotMatchWithSelectorDataTypeTestCases =\n        {\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Tick, Field.BidClose, new Tick() { BidPrice = 101, Value = 102 }, 102m },\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Tick, Field.Volume, new Tick() { Quantity = 101, Value = 102 }, 101m },\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Minute, Field.BidPrice, new QuoteBar() { Value = 102, Bid = new Bar() { Close = 103 } }, 103m },\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Minute, Field.AskPrice, new QuoteBar() { Value = 102, Ask = new Bar() { Close = 103 } }, 103m },\n            new object[] {Symbols.EURGBP, SecurityType.Forex, Resolution.Minute, Field.BidPrice, new QuoteBar() { Value = 102, Bid = new Bar() { Close = 103} }, 103m },\n            new object[] {Symbols.EURGBP, SecurityType.Forex, Resolution.Minute, Field.AskPrice, new QuoteBar() { Value = 102, Ask = new Bar() { Close = 103} }, 103m },\n            new object[] {Symbols.SPY_C_192_Feb19_2016, SecurityType.Option, Resolution.Minute, Field.BidPrice, new QuoteBar() { Value = 102, Bid = new Bar() { Close = 103 } }, 103m },\n            new object[] {Symbols.SPY_C_192_Feb19_2016, SecurityType.Option, Resolution.Minute, Field.AskPrice, new QuoteBar() { Value = 102, Ask = new Bar() { Close = 103 } }, 103m }\n        };\n\n        public static object[] IndicatorsCanBeWarmedUpWithDataSelectorsTestCases =\n        {\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Minute, Field.BidPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.IBM, Bid = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.Fut_SPY_Feb19_2016, SecurityType.Future, Resolution.Minute, Field.Volume, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars() { new TradeBar() { Symbol = Symbols.IBM, Volume = 103m } },\n                    new QuoteBars(),\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.IBM, SecurityType.Equity, Resolution.Minute, Field.AskPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.IBM, Ask = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.EURGBP, SecurityType.Forex, Resolution.Minute, Field.BidPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.EURGBP, Bid = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.EURGBP, SecurityType.Forex, Resolution.Minute, Field.AskPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.EURGBP, Ask = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.SPY_C_192_Feb19_2016, SecurityType.Option, Resolution.Minute, Field.BidPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.SPY_C_192_Feb19_2016, Bid = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m },\n            new object[] {Symbols.SPY_C_192_Feb19_2016, SecurityType.Option, Resolution.Minute, Field.AskPrice, new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.EURGBP, Ask = new Bar(){ Close = 103 } } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), 103m }\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmResolveConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AlgorithmResolveConsolidatorTests\n    {\n        [TestCase(SecurityType.Equity, TickType.Trade, \"SPY\")]\n        [TestCase(SecurityType.Crypto, TickType.Trade, \"BTCUSD\")]\n        [TestCase(SecurityType.Forex, TickType.Quote, \"EURUSD\")]\n        [TestCase(SecurityType.Cfd, TickType.Quote, \"WTICOUSD\")]\n        public void ConsolidatorHasSameTypeAsSubscriptionDataConfig(SecurityType securityType, TickType expectedTickType, string ticker)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddSecurity(securityType, ticker);\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Minute);\n\n            var inputType = security.Subscriptions.Single(s=>s.TickType==expectedTickType).Type;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(inputType, outputType);\n        }\n\n        [Test]\n        public void TradeBarToTradeBar()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddEquity(\"SPY\");\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Minute);\n\n            var inputType = security.Subscriptions.Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity)).Type;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(inputType, outputType);\n        }\n\n        [Test]\n        public void QuoteBarToQuoteBar()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddForex(\"EURUSD\");\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Minute);\n\n            var inputType = security.SubscriptionDataConfig.Type;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(inputType, outputType);\n        }\n\n        [Test]\n        public void TickTypeTradeToTradeBar()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddEquity(\"SPY\", Resolution.Tick);\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Minute);\n\n            var tickType = security.Subscriptions.Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity)).TickType;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(TickType.Trade, tickType);\n            Assert.AreEqual(typeof(TradeBar), outputType);\n        }\n\n        [Test]\n        public void TickTypeQuoteToQuoteBar()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddForex(\"EURUSD\", Resolution.Tick);\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Minute);\n\n            var tickType = security.Subscriptions.Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Forex)).TickType;\n\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(TickType.Quote, tickType);\n            Assert.AreEqual(typeof(QuoteBar), outputType);\n        }\n\n        [Test]\n        public void TickTypeTradeToTick()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddEquity(\"SPY\", Resolution.Tick);\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Tick);\n\n            var tickType = security.Subscriptions.Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity)).TickType;\n            var inputType = security.SubscriptionDataConfig.Type;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(TickType.Trade, tickType);\n            Assert.AreEqual(inputType, outputType);\n        }\n\n        [Test]\n        public void TickTypeQuoteToTick()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddForex(\"EURUSD\", Resolution.Tick);\n            var consolidator = algorithm.ResolveConsolidator(security.Symbol, Resolution.Tick);\n\n            var tickType = security.SubscriptionDataConfig.TickType;\n            var inputType = security.SubscriptionDataConfig.Type;\n            var outputType = consolidator.OutputType;\n\n            Assert.AreEqual(TickType.Quote, tickType);\n            Assert.AreEqual(inputType, outputType);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmSetBrokerageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders.Slippage;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    /// <summary>\n    /// Test class for\n    ///  - SetBrokerageModel() in QCAlgorithm\n    ///  - Default market for new securities\n    /// </summary>\n    [TestFixture]\n    public class AlgorithmSetBrokerageTests\n    {\n        private QCAlgorithm _algo;\n        private const string ForexSym = \"EURUSD\";\n        private const string Sym = \"SPY\";\n\n        /// <summary>\n        /// Instatiate a new algorithm before each test.\n        /// Clear the <see cref=\"SymbolCache\"/> so that no symbols and associated brokerage models are cached between test\n        /// </summary>\n        [SetUp]\n        public void Setup()\n        {\n            _algo = new QCAlgorithm();\n            _algo.SubscriptionManager.SetDataManager(new DataManagerStub(_algo));\n            SymbolCache.TryRemove(ForexSym);\n            SymbolCache.TryRemove(Sym);\n        }\n\n        /// <summary>\n        /// The default market for FOREX should be Oanda\n        /// </summary>\n        [Test]\n        public void DefaultBrokerageModel_IsOanda_ForForex()\n        {\n            var forex = _algo.AddForex(ForexSym);\n\n\n            Assert.IsTrue(forex.Symbol.ID.Market == Market.Oanda);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(DefaultBrokerageModel));\n        }\n\n        [Test]\n        public void PythonCallPureCSharpSetBrokerageModel()\n        {\n            using (Py.GIL())\n            {\n                var model = new AlphaStreamsBrokerageModel().ToPython();\n                _algo.SetBrokerageModel(model);\n                Assert.DoesNotThrow(() => _algo.BrokerageModel.ApplySplit(new List<OrderTicket>(), new Split()));\n            }\n        }\n\n        [Test]\n        public void PythonCallSetBrokerageModel()\n        {\n            using (Py.GIL())\n            {\n                var model = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(AlphaStreamsBrokerageModel):\n    def GetLeverage(self, security):\n        return 12\").GetAttr(\"Test\");\n                _algo.SetBrokerageModel(model.Invoke());\n\n                var equity = _algo.AddEquity(Sym);\n                Assert.DoesNotThrow(() => _algo.BrokerageModel.ApplySplit(new List<OrderTicket>(), new Split()));\n                Assert.AreEqual(12m, _algo.BrokerageModel.GetLeverage(equity));\n            }\n        }\n\n        /// <summary>\n        /// The default market for equities should be USA\n        /// </summary>\n        [Test]\n        public void DefaultBrokerageModel_IsUSA_ForEquity()\n        {\n            var equity = _algo.AddEquity(Sym);\n\n\n            Assert.IsTrue(equity.Symbol.ID.Market == Market.USA);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(DefaultBrokerageModel));\n        }\n\n        /// <summary>\n        /// The default market for options should be USA\n        /// </summary>\n        [Test]\n        public void DefaultBrokerageModel_IsUSA_ForOption()\n        {\n            var option = _algo.AddOption(Sym);\n\n\n            Assert.IsTrue(option.Symbol.ID.Market == Market.USA);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(DefaultBrokerageModel));\n        }\n\n        /// <summary>\n        /// Brokerage model for an algorithm can be changed using <see cref=\"QCAlgorithm.SetBrokerageModel(IBrokerageModel)\"/>\n        /// This changes the brokerage models used when forex currency pairs are added via AddForex and no brokerage is specified.\n        /// </summary>\n        [Test]\n        public void BrokerageModel_CanBeSpecifiedWith_SetBrokerageModel()\n        {\n            _algo.SetBrokerageModel(BrokerageName.OandaBrokerage);\n            var forex = _algo.AddForex(ForexSym);\n\n            string brokerage = GetDefaultBrokerageForSecurityType(SecurityType.Forex);\n\n\n            Assert.IsTrue(forex.Symbol.ID.Market == Market.Oanda);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(OandaBrokerageModel));\n            Assert.IsTrue(brokerage == Market.Oanda);\n        }\n\n        /// <summary>\n        /// Specifying the market in <see cref=\"QCAlgorithm.AddForex\"/> will change the market of the security created.\n        /// </summary>\n        [Test]\n        public void BrokerageModel_CanBeSpecifiedWith_AddForex()\n        {\n            var forex = _algo.AddForex(ForexSym, Resolution.Minute, Market.FXCM);\n\n            string brokerage = GetDefaultBrokerageForSecurityType(SecurityType.Forex);\n\n\n            Assert.IsTrue(forex.Symbol.ID.Market == Market.FXCM);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(DefaultBrokerageModel));\n            Assert.IsTrue(brokerage == Market.Oanda);  // Doesn't change brokerage defined in BrokerageModel.DefaultMarkets\n        }\n\n        /// <summary>\n        /// The method <see cref=\"QCAlgorithm.AddSecurity(SecurityType, string, Resolution, bool, bool)\"/> should use the default brokerage for the sepcific security.\n        /// Setting the brokerage with <see cref=\"QCAlgorithm.SetBrokerageModel(IBrokerageModel)\"/> will affect the market of securities added with  <see cref=\"QCAlgorithm.AddSecurity(SecurityType, string, Resolution, bool, bool)\"/>\n        /// </summary>\n        [Test]\n        public void AddSecurity_Follows_SetBrokerageModel()\n        {\n            // No brokerage set\n            var equity = _algo.AddSecurity(SecurityType.Equity, Sym);\n\n            string equityBrokerage = GetDefaultBrokerageForSecurityType(SecurityType.Equity);\n\n\n            Assert.IsTrue(equity.Symbol.ID.Market == Market.USA);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(DefaultBrokerageModel));\n            Assert.IsTrue(equityBrokerage == Market.USA);\n\n            // Set Brokerage\n            _algo.SetBrokerageModel(BrokerageName.OandaBrokerage);\n\n            var sec = _algo.AddSecurity(SecurityType.Forex, ForexSym, Resolution.Daily, false, 1, false);\n\n            string forexBrokerage = GetDefaultBrokerageForSecurityType(SecurityType.Forex);\n\n\n            Assert.IsTrue(sec.Symbol.ID.Market == Market.Oanda);\n            Assert.IsTrue(_algo.BrokerageModel.GetType() == typeof(OandaBrokerageModel));\n            Assert.IsTrue(forexBrokerage ==  Market.Oanda);\n        }\n\n        [Test]\n        public void AddSecurityCanAddWithSameTickerAndDifferentMarket()\n        {\n            var fxcmSecurity = _algo.AddSecurity(SecurityType.Forex, \"EURUSD\", Resolution.Minute, Market.FXCM, true, 1m, true);\n            var oandaSecurity = _algo.AddSecurity(SecurityType.Forex, \"EURUSD\", Resolution.Minute, Market.Oanda, true, 1m, true);\n\n            Assert.AreEqual(2, _algo.Securities.Count);\n            Assert.IsNotNull(_algo.Securities.Single(pair => pair.Key.ID.Market == Market.FXCM));\n            Assert.IsNotNull(_algo.Securities.Single(pair => pair.Key.ID.Market == Market.Oanda));\n            Assert.AreEqual(Market.FXCM, fxcmSecurity.Symbol.ID.Market);\n            Assert.AreEqual(Market.Oanda, oandaSecurity.Symbol.ID.Market);\n        }\n\n        [Test]\n        public void AddForexCanAddWithSameTickerAndDifferentMarket()\n        {\n            var fxcmSecurity = _algo.AddForex(\"EURUSD\", Resolution.Minute, Market.FXCM);\n            var oandaSecurity = _algo.AddForex(\"EURUSD\", Resolution.Minute, Market.Oanda);\n\n            Assert.AreEqual(2, _algo.Securities.Count);\n            Assert.IsNotNull(_algo.Securities.Single(pair => pair.Key.ID.Market == Market.FXCM));\n            Assert.IsNotNull(_algo.Securities.Single(pair => pair.Key.ID.Market == Market.Oanda));\n            Assert.AreEqual(Market.FXCM, fxcmSecurity.Symbol.ID.Market);\n            Assert.AreEqual(Market.Oanda, oandaSecurity.Symbol.ID.Market);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void BrokerageNameFollowsSetBrokerageModel(Language language)\n        {\n            if (language == Language.CSharp)\n            {\n                Assert.AreEqual(BrokerageName.Default, _algo.BrokerageName);\n\n                _algo.SetBrokerageModel(BrokerageName.OandaBrokerage);\n                Assert.AreEqual(BrokerageName.OandaBrokerage, _algo.BrokerageName);\n\n                _algo.SetBrokerageModel(new InteractiveBrokersBrokerageModel());\n                Assert.AreEqual(BrokerageName.InteractiveBrokersBrokerage, _algo.BrokerageName);\n\n                _algo.SetBrokerageModel(new CustomBrokerageModel());\n                Assert.AreEqual(BrokerageName.Default, _algo.BrokerageName);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom AlgorithmImports import *\n\ndef getAlgorithm():\n    return QCAlgorithm()\n\ndef setBrokerageModel(algorithm, brokerageModel):\n    algorithm.SetBrokerageModel(brokerageModel)\n\ndef getBrokerageName(algorithm):\n    return algorithm.BrokerageName\n        \");\n\n                    var getAlgorithm = testModule.GetAttr(\"getAlgorithm\");\n                    var algorithm = getAlgorithm.Invoke();\n\n                    var setBrokerageModel = testModule.GetAttr(\"setBrokerageModel\");\n                    var getBrokerageName = testModule.GetAttr(\"getBrokerageName\");\n\n                    Assert.AreEqual(BrokerageName.Default, getBrokerageName.Invoke(algorithm).AsManagedObject(typeof(BrokerageName)));\n\n                    setBrokerageModel.Invoke(algorithm, BrokerageName.OandaBrokerage.ToPython());\n                    Assert.AreEqual(BrokerageName.OandaBrokerage, getBrokerageName.Invoke(algorithm).AsManagedObject(typeof(BrokerageName)));\n\n                    setBrokerageModel.Invoke(algorithm, new InteractiveBrokersBrokerageModel().ToPython());\n                    Assert.AreEqual(BrokerageName.InteractiveBrokersBrokerage, getBrokerageName.Invoke(algorithm).AsManagedObject(typeof(BrokerageName)));\n\n                    setBrokerageModel.Invoke(algorithm, new CustomBrokerageModel().ToPython());\n                    Assert.AreEqual(BrokerageName.Default, getBrokerageName.Invoke(algorithm).AsManagedObject(typeof(BrokerageName)));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns the default market for a security type\n        /// </summary>\n        /// <param name=\"secType\">The type of security</param>\n        /// <returns>A string representing the default market of a security</returns>\n        private string GetDefaultBrokerageForSecurityType(SecurityType secType)\n        {\n            string brokerage;\n            _algo.BrokerageModel.DefaultMarkets.TryGetValue(secType, out brokerage);\n            return brokerage;\n        }\n\n        private class CustomBrokerageModel : IBrokerageModel\n        {\n            public AccountType AccountType => throw new System.NotImplementedException();\n\n            public decimal RequiredFreeBuyingPowerPercent => throw new System.NotImplementedException();\n\n            public IReadOnlyDictionary<SecurityType, string> DefaultMarkets => throw new System.NotImplementedException();\n\n            public void ApplySplit(List<OrderTicket> tickets, Split split)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public bool CanExecuteOrder(Security security, Order order)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public bool CanSubmitOrder(Security security, Order order, out BrokerageMessageEvent message)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IBenchmark GetBenchmark(SecurityManager securities)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IBuyingPowerModel GetBuyingPowerModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IBuyingPowerModel GetBuyingPowerModel(Security security, AccountType accountType)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IFeeModel GetFeeModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IFillModel GetFillModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public decimal GetLeverage(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IMarginInterestRateModel GetMarginInterestRateModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public ISettlementModel GetSettlementModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public ISettlementModel GetSettlementModel(Security security, AccountType accountType)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IShortableProvider GetShortableProvider(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public ISlippageModel GetSlippageModel(Security security)\n            {\n                throw new System.NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmSetHoldingsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmSetHoldingsTests\n    {\n        // Test class to enable calling protected methods\n        public class TestSecurityMarginModel : SecurityMarginModel\n        {\n            public TestSecurityMarginModel(decimal leverage) : base(leverage) { }\n\n            public new decimal GetInitialMarginRequiredForOrder(\n                InitialMarginRequiredForOrderParameters parameters)\n            {\n                return base.GetInitialMarginRequiredForOrder(parameters).Value;\n            }\n\n            public new decimal GetMarginRemaining(SecurityPortfolioManager portfolio, Security security, OrderDirection direction)\n            {\n                return base.GetMarginRemaining(portfolio, security, direction);\n            }\n        }\n\n        public enum Position { Zero = 0, Long = 1, Short = -1 }\n        public enum FeeType { None, Small, Large, InteractiveBrokers }\n        public enum PriceMovement { Static, RisingSmall, FallingSmall, RisingLarge, FallingLarge }\n\n        private readonly Dictionary<FeeType, IFeeModel> _feeModels = new Dictionary<FeeType, IFeeModel>\n        {\n            { FeeType.None, new ConstantFeeModel(0) },\n            { FeeType.Small, new ConstantFeeModel(1) },\n            { FeeType.Large, new ConstantFeeModel(100) },\n            { FeeType.InteractiveBrokers, new InteractiveBrokersFeeModel() }\n        };\n\n        private readonly Symbol _symbol = Symbols.SPY;\n        private const decimal Cash = 100000m;\n        private const decimal VeryLowPrice = 155m;\n        private const decimal LowPrice = 159m;\n        private const decimal BasePrice = 160m;\n        private const decimal HighPrice = 161m;\n        private const decimal VeryHighPrice = 165m;\n\n        public class Permuter<T>\n        {\n            private static void Permute(T[] row, int index, IReadOnlyList<List<T>> data, ICollection<T[]> result)\n            {\n                foreach (var dataRow in data[index])\n                {\n                    row[index] = dataRow;\n                    if (index >= data.Count - 1)\n                    {\n                        var rowCopy = new T[row.Length];\n                        row.CopyTo(rowCopy, 0);\n                        result.Add(rowCopy);\n                    }\n                    else\n                    {\n                        Permute(row, index + 1, data, result);\n                    }\n                }\n            }\n\n            public static void Permute(List<List<T>> data, List<T[]> result)\n            {\n                if (data.Count == 0)\n                    return;\n\n                Permute(new T[data.Count], 0, data, result);\n            }\n        }\n\n        private static IEnumerable<object[]> TestParameters\n        {\n            get\n            {\n                var initialPositions = Enum.GetValues(typeof(Position)).Cast<Position>().ToList();\n                var finalPositions = Enum.GetValues(typeof(Position)).Cast<Position>().ToList();\n                var feeTypes = Enum.GetValues(typeof(FeeType)).Cast<FeeType>().ToList();\n                var priceMovements = Enum.GetValues(typeof(PriceMovement)).Cast<PriceMovement>().ToList();\n                var leverages = new List<int> { 1, 100 };\n\n                var data = new List<List<object>>\n                {\n                    initialPositions.Cast<object>().ToList(),\n                    finalPositions.Cast<object>().ToList(),\n                    feeTypes.Cast<object>().ToList(),\n                    priceMovements.Cast<object>().ToList(),\n                    leverages.Cast<object>().ToList()\n                };\n                var permutations = new List<object[]>();\n                Permuter<object>.Permute(data, permutations);\n\n                var ret = permutations\n                    .Where(row => (Position)row[0] != (Position)row[1]);     // initialPosition != finalPosition\n\n                return ret;\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void Run(object[] parameters)\n        {\n            Position initialPosition = (Position)parameters[0];\n            Position finalPosition = (Position)parameters[1];\n            FeeType feeType = (FeeType)parameters[2];\n            PriceMovement priceMovement = (PriceMovement)parameters[3];\n            int leverage = (int)parameters[4];\n\n            //Console.WriteLine(\"----------\");\n            //Console.WriteLine(\"PARAMETERS\");\n            //Console.WriteLine(\"Initial position: \" + initialPosition);\n            //Console.WriteLine(\"Final position: \" + finalPosition);\n            //Console.WriteLine(\"Fee type: \" + feeType);\n            //Console.WriteLine(\"Price movement: \" + priceMovement);\n            //Console.WriteLine(\"Leverage: \" + leverage);\n            //Console.WriteLine(\"----------\");\n            //Console.WriteLine();\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var security = algorithm.AddSecurity(_symbol.ID.SecurityType, _symbol.ID.Symbol);\n            security.FeeModel = _feeModels[feeType];\n            security.SetLeverage(leverage);\n\n            var buyingPowerModel = new TestSecurityMarginModel(leverage);\n            security.BuyingPowerModel = buyingPowerModel;\n\n            algorithm.SetCash(Cash);\n\n            Update(security, BasePrice);\n\n            decimal targetPercentage;\n            OrderDirection orderDirection;\n            MarketOrder order;\n            OrderFee orderFee;\n            OrderEvent fill;\n            decimal orderQuantity;\n            decimal freeMargin;\n            decimal requiredMargin;\n            if (initialPosition != Position.Zero)\n            {\n                targetPercentage = (decimal)initialPosition;\n                orderDirection = initialPosition == Position.Long ? OrderDirection.Buy : OrderDirection.Sell;\n                orderQuantity = algorithm.CalculateOrderQuantity(_symbol, targetPercentage);\n                order = new MarketOrder(_symbol, orderQuantity, DateTime.UtcNow);\n                freeMargin = buyingPowerModel.GetMarginRemaining(algorithm.Portfolio, security, orderDirection);\n                requiredMargin = buyingPowerModel.GetInitialMarginRequiredForOrder(\n                    new InitialMarginRequiredForOrderParameters(\n                        new IdentityCurrencyConverter(algorithm.Portfolio.CashBook.AccountCurrency), security, order));\n\n                //Console.WriteLine(\"Current price: \" + security.Price);\n                //Console.WriteLine(\"Target percentage: \" + targetPercentage);\n                //Console.WriteLine(\"Order direction: \" + orderDirection);\n                //Console.WriteLine(\"Order quantity: \" + orderQuantity);\n                //Console.WriteLine(\"Free margin: \" + freeMargin);\n                //Console.WriteLine(\"Required margin: \" + requiredMargin);\n                //Console.WriteLine();\n\n                Assert.That(Math.Abs(requiredMargin) <= freeMargin);\n\n                orderFee = security.FeeModel.GetOrderFee(\n                    new OrderFeeParameters(security, order));\n                fill = new OrderEvent(order, DateTime.UtcNow, orderFee) { FillPrice = security.Price, FillQuantity = orderQuantity };\n                algorithm.Portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n                //Console.WriteLine(\"Portfolio.Cash: \" + algorithm.Portfolio.Cash);\n                //Console.WriteLine(\"Portfolio.TotalPortfolioValue: \" + algorithm.Portfolio.TotalPortfolioValue);\n                //Console.WriteLine();\n\n                if (priceMovement == PriceMovement.RisingSmall)\n                {\n                    Update(security, HighPrice);\n                }\n                else if (priceMovement == PriceMovement.FallingSmall)\n                {\n                    Update(security, LowPrice);\n                }\n                else if (priceMovement == PriceMovement.RisingLarge)\n                {\n                    Update(security, VeryHighPrice);\n                }\n                else if (priceMovement == PriceMovement.FallingLarge)\n                {\n                    Update(security, VeryLowPrice);\n                }\n            }\n\n            targetPercentage = (decimal)finalPosition;\n            orderDirection = finalPosition == Position.Long || (finalPosition == Position.Zero && initialPosition == Position.Short) ? OrderDirection.Buy : OrderDirection.Sell;\n            orderQuantity = algorithm.CalculateOrderQuantity(_symbol, targetPercentage);\n            order = new MarketOrder(_symbol, orderQuantity, DateTime.UtcNow);\n            freeMargin = buyingPowerModel.GetMarginRemaining(algorithm.Portfolio, security, orderDirection);\n            requiredMargin = buyingPowerModel.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(\n                    new IdentityCurrencyConverter(algorithm.Portfolio.CashBook.AccountCurrency), security, order));\n\n            //Console.WriteLine(\"Current price: \" + security.Price);\n            //Console.WriteLine(\"Target percentage: \" + targetPercentage);\n            //Console.WriteLine(\"Order direction: \" + orderDirection);\n            //Console.WriteLine(\"Order quantity: \" + orderQuantity);\n            //Console.WriteLine(\"Free margin: \" + freeMargin);\n            //Console.WriteLine(\"Required margin: \" + requiredMargin);\n            //Console.WriteLine();\n\n            Assert.That(Math.Abs(requiredMargin) <= freeMargin);\n\n            orderFee = security.FeeModel.GetOrderFee(\n                new OrderFeeParameters(security, order));\n            fill = new OrderEvent(order, DateTime.UtcNow, orderFee) { FillPrice = security.Price, FillQuantity = orderQuantity };\n            algorithm.Portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            //Console.WriteLine(\"Portfolio.Cash: \" + algorithm.Portfolio.Cash);\n            //Console.WriteLine(\"Portfolio.TotalPortfolioValue: \" + algorithm.Portfolio.TotalPortfolioValue);\n            //Console.WriteLine();\n        }\n\n        private static void Update(Security security, decimal price)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = price,\n                High = price,\n                Low = price,\n                Close = price\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmSettingsTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Lean.Engine.Setup;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AlgorithmSettingsTest\n    {\n        [Test]\n        public void DefaultTrueValueOfLiquidateWorksCorrectly()\n        {\n            var algo = new QCAlgorithm();\n            var fakeOrderProcessor = InitializeAndGetFakeOrderProcessor(algo);\n\n            algo.Liquidate();\n\n            // It should send a order to set us flat\n            Assert.IsFalse(fakeOrderProcessor.ProcessedOrdersRequests.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void DisablingLiquidateWorksCorrectly()\n        {\n            var algo = new QCAlgorithm();\n            algo.Settings.LiquidateEnabled = false;\n            var fakeOrderProcessor = InitializeAndGetFakeOrderProcessor(algo);\n\n            algo.Liquidate();\n\n            // It should NOT send a order to set us flat\n            Assert.IsTrue(fakeOrderProcessor.ProcessedOrdersRequests.IsNullOrEmpty());\n        }\n        \n        [Test]\n        public void SettingSetHoldingsBufferWorksCorrectly()\n        {\n            var algo = new QCAlgorithm();\n            algo.Settings.FreePortfolioValue = 0;\n            InitializeAndGetFakeOrderProcessor(algo);\n\n            var actual = algo.CalculateOrderQuantity(Symbols.SPY, 1m);\n            // 100000 / 20 - 2 due to fee =\n            Assert.AreEqual(4998m, actual);\n        }\n\n        [Test]\n        public void DefaultValueOfSetHoldingsBufferWorksCorrectly()\n        {\n            var algo = new QCAlgorithm();\n\n            InitializeAndGetFakeOrderProcessor(algo);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            var actual = algo.CalculateOrderQuantity(Symbols.SPY, 1m);\n            // 100000 / 20 - 1 due to fee - effect of the target being reduced because of FreePortfolioValuePercentage\n            Assert.AreEqual(4986m, actual);\n        }\n\n        [TestCase(BrokerageName.FTX, 365)]\n        [TestCase(BrokerageName.RBI, 252)]\n        [TestCase(BrokerageName.Eze, 252)]\n        [TestCase(BrokerageName.Axos, 252)]\n        [TestCase(BrokerageName.Samco, 252)]\n        [TestCase(BrokerageName.FTXUS, 365)]\n        [TestCase(BrokerageName.Bybit, 365)]\n        [TestCase(BrokerageName.Kraken, 365)]\n        [TestCase(BrokerageName.Exante, 252)]\n        [TestCase(BrokerageName.Binance, 365)]\n        [TestCase(BrokerageName.Default, 252)]\n        [TestCase(BrokerageName.Zerodha, 252)]\n        [TestCase(BrokerageName.Bitfinex, 365)]\n        [TestCase(BrokerageName.Wolverine, 252)]\n        [TestCase(BrokerageName.TDAmeritrade, 252)]\n        [TestCase(BrokerageName.FxcmBrokerage, 252)]\n        [TestCase(BrokerageName.OandaBrokerage, 252)]\n        [TestCase(BrokerageName.BinanceFutures, 365)]\n        [TestCase(BrokerageName.TradierBrokerage, 252)]\n        [TestCase(BrokerageName.BinanceCoinFutures, 365)]\n        [TestCase(BrokerageName.TradingTechnologies, 252)]\n        [TestCase(BrokerageName.QuantConnectBrokerage, 252)]\n        [TestCase(BrokerageName.Coinbase, 365, AccountType.Cash)]\n        [TestCase(BrokerageName.BinanceUS, 365, AccountType.Cash)]\n        [TestCase(BrokerageName.InteractiveBrokersBrokerage, 252)]\n        public void ReturnUniqueTradingDayPerYearDependOnBrokerageName(BrokerageName brokerageName, int expectedTradingDayPerYear, AccountType accountType = AccountType.Margin)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetBrokerageModel(brokerageName, accountType);\n\n            BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm);\n\n            Assert.AreEqual(expectedTradingDayPerYear, algorithm.Settings.TradingDaysPerYear.Value);\n        }\n\n        [TestCase(BrokerageName.Bybit, 202, 365)]\n        [TestCase(BrokerageName.InteractiveBrokersBrokerage, 404, 252)]\n        public void ReturnCustomTradingDayPerYearIndependentlyFromBrokerageName(BrokerageName brokerageName, int customTradingDayPerYear, int expectedDefaultTradingDayPerYearForBrokerage)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetBrokerageModel(brokerageName);\n            algorithm.Settings.TradingDaysPerYear = customTradingDayPerYear;\n\n            // duplicate: make sure that custom value is assigned\n            BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm);\n\n            Assert.AreNotEqual(expectedDefaultTradingDayPerYearForBrokerage, algorithm.Settings.TradingDaysPerYear);\n        }\n\n        [TestCase(252, null)]\n        [TestCase(404, 404)]\n        public void ReturnTradingDayPerYearWithoutSetBrokerage(int expectedTradingDayPerYear, int? customTradingDayPerYear = null)\n        {\n            var algorithm = new QCAlgorithm();\n\n            if (customTradingDayPerYear.HasValue)\n            {\n                algorithm.Settings.TradingDaysPerYear = customTradingDayPerYear.Value;\n            }\n\n            BaseSetupHandler.SetBrokerageTradingDayPerYear(algorithm);\n\n            Assert.AreEqual(expectedTradingDayPerYear, algorithm.Settings.TradingDaysPerYear);\n        }\n\n        private FakeOrderProcessor InitializeAndGetFakeOrderProcessor(QCAlgorithm algo)\n        {\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetFinishedWarmingUp();\n            algo.SetCash(100000);\n            var symbol = algo.AddEquity(\"SPY\").Symbol;\n            var fakeOrderProcessor = new FakeOrderProcessor();\n            algo.Transactions.SetOrderProcessor(fakeOrderProcessor);\n            algo.Portfolio[symbol].SetHoldings(1, 10);\n            var security = algo.Securities[symbol];\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = 20,\n                High = 20,\n                Low = 20,\n                Close = 20\n            });\n\n            Assert.IsTrue(fakeOrderProcessor.ProcessedOrdersRequests.IsNullOrEmpty());\n            return fakeOrderProcessor;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmSubscriptionManagerRemoveConsolidatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AlgorithmSubscriptionManagerRemoveConsolidatorTests\n    {\n        [Test]\n        public void RemoveConsolidatorClearsEventHandlers()\n        {\n            bool eventHandlerFired = false;\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var security = algorithm.AddEquity(\"SPY\");\n            var consolidator = new IdentityDataConsolidator<BaseData>();\n            consolidator.DataConsolidated += (sender, consolidated) => eventHandlerFired = true;\n            security.Subscriptions.First().Consolidators.Add(consolidator);\n\n            algorithm.SubscriptionManager.RemoveConsolidator(security.Symbol, consolidator);\n\n            consolidator.Update(new Tick());\n            Assert.IsFalse(eventHandlerFired);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Algorithm/AlgorithmTradingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing Moq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AlgorithmTradingTests\n    {\n        private static FakeOrderProcessor _fakeOrderProcessor;\n        private static TestCaseData[] TestParameters\n        {\n            get\n            {\n                return new[]\n                {\n                    new TestCaseData(1m),\n                    new TestCaseData(2m),\n                    new TestCaseData(100m),\n                };\n            }\n        }\n\n        private static TestCaseData[] TestParametersDifferentMargins\n        {\n            get\n            {\n                return new[]\n                {\n                    new TestCaseData(0.5m, 0.25m),\n                };\n            }\n        }\n\n        /*****************************************************/\n        //  Isostatic market conditions tests.\n        /*****************************************************/\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToLong(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n            Assert.AreEqual(1995m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToLong_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n            // $100k total value * 0.5 target * 0.9975 FreePortfolioValuePercentage / 25 ~= 1995 - fees\n            Assert.AreEqual(1994m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToLong_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // ($100k total value - 10 k fees) * 0.5 target * 0.9975 FreePortfolioValuePercentage / 25 ~= 1795m\n            Assert.AreEqual(1795m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToShort(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-1995m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToShort_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-1994m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ZeroToShort_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25 & Target 50%\n            Update(msft, 25);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n\n            // ($100k total value - 10 k fees) * -0.5 target * 0.9975 FreePortfolioValuePercentage / 25 ~= -1795m\n            Assert.AreEqual(-1795m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n            Assert.AreEqual(992m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n            Assert.AreEqual(992m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n            Assert.AreEqual(693m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongerToLong(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //75% cash spent on 3000 MSFT shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 3000);\n\n            // TPV =  Cash + Holdings  - Fees  - Buffer => Target = TVP * 0.5\n            // TPV = 25000 + 25 * 3000 - 0 - 250 = 99,750 => 99,750 * 0.5 = 49875\n            // Final Quantity = Target / Unit - Holdings Quantity\n            // Final Quantity = 49875 / 25 - 3000 = 1995 - 3000 = -1,005\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // 3000 - 1005 = 1995. Multiply by unit 1995 * 25 = 49,875. Weight = 49,875 / 99,750 (TPV) = 0.5\n            Assert.AreEqual(-1005m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        /// <summary>\n        /// Reproduce QC Slack Issue https://quantconnect.slack.com/archives/G51920EN4/p1625782914057900\n        /// Original Algorithm: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_e35c58ed9304f452bb43c4fbf76fe153.html\n        ///\n        /// Test to see that in the event of a precision error we still adjust the quantity to reach our target\n        /// </summary>\n        [Test]\n        public void PrecisionFailureAdjustment()\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, 2, 0);\n            Update(msft, 66.5m);\n\n            algo.Portfolio.SetCash(112302.5m);\n            algo.Settings.FreePortfolioValue = 0;\n            algo.Portfolio[Symbols.MSFT].SetHoldings(66.5m, -190);\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.4987458298843655153385005142m * 2);\n\n            Assert.AreEqual(1684, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongerToLong_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //75% cash spent on 3000 MSFT shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 3000);\n\n            // TPV =  Cash + Holdings  - Fees  - Buffer => Target = TVP * 0.5\n            // TPV = 25000 + 25 * 3000 - 1 - 250 = 99,749 => 99,749 * 0.5 = 49874.5\n            // Final Quantity = Target / Unit - Holdings Quantity\n            // Final Quantity = 49874.5 / 25 - 3000 = 1794.98 - 3000 = -1,005.02 -> -1006\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // 3000 - 1006 = 1994. Multiply by unit 1994 * 25 = 49,850. Weight = 49,875 / 99,749 (TPV) = 0.49975 < 0.5\n            Assert.AreEqual(-1006m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongerToLong_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //75% cash spent on 3000 MSFT shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 3000);\n\n            // TPV =  Cash + Holdings  - Fees  - Buffer => Target = TVP * 0.5\n            // TPV = 25000 + 25 * 3000 - 10000 - 250 = 89750 => 89750 * 0.5 = 44875\n            // Final Quantity = Target / Unit - Holdings Quantity\n            // Final Quantity = 44875 / 25 - 3000 = 1795.0 - 3000 = -1205\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // 3000 - 1205 = 1795. Multiply by unit 1795 * 25 = 44875. Weight = 44875 / 89750 (TPV) = 0.5\n            Assert.AreEqual(-1205m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToZero(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(-2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToZero_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(-2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToZero_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(-2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToShort(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -0.5 target * 0.9975 buffer - $50k current holdings) / 50 =~ -3995m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3995m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToShort_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -0.5 target * 0.9975 buffer - $50k current holdings) / 50 =~ -3995m - 1 due to fee\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3994m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToShort_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position (($100k total value - 10 K)* -0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ -3795m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3795m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_HalfLongToFullShort(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -1 target * 0.9975 buffer - $50k current holdings) / 50 =~ -5990m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5990m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_HalfLongToFullShort_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -1 target * 0.9975 buffer - $50k current holdings) / 50 =~ -5990m - 1 due to fee\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5989m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_HalfLongToFullShort_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            // Fee is 10k / 25 ~= 400 shares\n            // Need to sell to make position (($100k total value - 10k fees) * -1 target * 0.9975 buffer - $50k current holdings) / 25 =~ -5591m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5591m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToZero(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            //Buy 2000 to get to 0 holdings.\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToZero_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            //Buy 2000 to get to 0 holdings.\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToZero_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            //Buy 2000 to get to 0 holdings.\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0m);\n            Assert.AreEqual(2000, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToShorter(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            // Cash: 150k\n            // MSFT: -50k\n            // TPV:  100k\n\n            // we should end with -3000 = -.75*(100k/25)\n\n            // ($100k total value * -0.75 target * 0.9975 buffer - $50k current holdings) / 25 =~ 992m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.75m);\n            Assert.AreEqual(-992m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToShorter_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            // Cash: 150k\n            // MSFT: -50k\n            // TPV:  100k\n\n            // we should end with -3000 = -.75*(100k/25)\n            // ($100k total value * -0.75 target * 0.9975 buffer - $50k current holdings) / 25 =~ 992m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.75m);\n            Assert.AreEqual(-992m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToShorter_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            // Cash: 150k\n            // MSFT: -50k\n            // TPV:  100k\n\n            // we should end with -3000 = -.75*(100k/25)\n            // (($100k total value - 10k fees) * -0.75 target * 0.9975 buffer + $50k current holdings) / 25 =~ -693m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.75m);\n            Assert.AreEqual(-693m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToLong(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            // ($100k total value * 0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n            Assert.AreEqual(3995m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToLong_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            // ($100k total value * 0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m - 1 cause order fee\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n            Assert.AreEqual(3994m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToLong_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n            // (($100k total value - 10 k fees) * 0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n            Assert.AreEqual(3795m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToHalfShort_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -2000 to get to -50%\n            // ($100k total value * -0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3995m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToHalfShort_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -1999 to get to -50%\n            // ($100k total value * -0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m - 1 due to fees\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3994m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToHalfShort_HighConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -1600 to get to -50%\n            // ($100k total value * -0.5 target * 0.9975 buffer - $50k current holdings) / 25 =~ 3995m - 200 due to fees\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-3795m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFullShort_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -1 target * 0.9975 buffer - $50k current holdings) / 50 =~ -5990m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5990m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFullShort_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Need to sell to make position ($100k total value * -1 target * 0.9975 buffer - $50k current holdings) / 50 =~ -5990m - 1 due to fee\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5989m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFullShort_HighConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            // Fee is 10k / 25 ~= 400 shares\n            //Need to sell to make position (($100k total value -10k fees) * -1 target * 0.9975 buffer - $50k current holdings) / 50 =~ -5591m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1m);\n            Assert.AreEqual(-5591m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFull2xShort_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -8000 to get to -200%\n            // ($100k total value * -2 target * 0.9975 buffer - $50k current holdings) / 25 =~ 9980m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -2m);\n            Assert.AreEqual(-9980m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFull2xShort_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -7999 to get to -200%\n            // ($100k total value * -2 target * 0.9975 buffer - $50k current holdings) / 25 =~ 9980m - 1 due to fees\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -2m);\n            Assert.AreEqual(-9979m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_HalfLongToFull2xShort_HighConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Sell all 2000 held + -7200 to get to -200%\n            // ($100k total value * -2 target * 0.9975 buffer - $50k current holdings) / 25 =~ 9980m - ~800 due to fees\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -2m);\n            Assert.AreEqual(-9182m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_ZeroToFullShort_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -2m);\n            // ($100k total value * -2 target * 0.9975 buffer - $10k fees * 2) / 25 =~-7182m\n            Assert.AreEqual(-7182m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_ZeroToAlmostFullShort_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -1.5m);\n            // ($100k total value * -1.5 target * 0.9975 buffer - $10k fees * 1.5) / 25 =~ -5386m\n            Assert.AreEqual(-5386m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_ZeroToFullLong_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 2m);\n            // ($100k total value * 2 target * 0.9975 buffer - $10k fees * 2) / 25 =~ 7182m\n            Assert.AreEqual(7182m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParametersDifferentMargins))]\n        public void SetHoldings_ZeroToAlmostFullLong_SmallConstantFeeStructure_DifferentMargins(decimal initialMarginRequirement, decimal maintenanceMarginRequirement)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, initialMarginRequirement, maintenanceMarginRequirement, 10000);\n            //Set price to $25\n            Update(msft, 25);\n\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 1.5m);\n            // ($100k total value * 1.5 target * 0.9975 buffer - $10k fees * 1.5) / 25 =~ 5386m\n            Assert.AreEqual(5386m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n\n        /*****************************************************/\n        //  Rising market conditions tests.\n        /*****************************************************/\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongFixed_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% MSFT::\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // Need to sell ($150k total value * 0.5m  target * 0.9975 buffer - 100k current holdings) / 50 = -503.75 > ~-504\n            Assert.AreEqual(-504m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongFixed_PriceRise_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% MSFT::\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // Need to sell ($150k total value * 0.5m  target * 0.9975 buffer - 100k current holdings) / 50 =~ -503.75 > ~504\n            Assert.AreEqual(-504m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongFixed_PriceRise_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% MSFT::\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // Need to sell (( $150k total value - 10 k fees) * 0.5m  target * 0.9975 buffer - 100k current holdings) / 50 =~ -603.5 > -604\n            Assert.AreEqual(-604, actual);\n            // After the trade: TPV 140k (due to fees), holdings at 1397 shares (2000 - 603) * $50 = 69850 value, which is 0.4989% holdings\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is already 66% of holdings.\n            //Calculate the order for 75% MSFT:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n\n            //Need to buy to make position ($150k total value * 0.75  target * 0.9975 buffer - 100k current holdings) / 50 =~ 244\n            Assert.AreEqual(244m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger_PriceRise_SmallConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 1);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is already 66% of holdings.\n            //Calculate the order for 75% MSFT:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n\n            //Need to buy to make position (150K total value * 0.75  target * 0.9975 buffer - 100k current holdings) / 50 =~ 244\n            Assert.AreEqual(244m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToLonger_PriceRise_HighConstantFeeStructure(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 10000);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is already 66% of holdings.\n            //Calculate the order for 75% MSFT:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n\n            //Need to buy to make position ((150K total value - 10k fees) * 0.75  target * 0.9975 buffer - 100k current holdings) / 50 =~ 94\n            Assert.AreEqual(94m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongerToLong_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n\n            //75% cash spent on 3000 MSFT shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 3000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 3000 * 50 = $150k Holdings, $25k Cash: $175k. MSFT is 86% of holdings.\n            //Calculate the order for 50% MSFT:\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            //Need to sell to make position ($175k total value * 0.5 target * 0.9975 buffer - $150k current holdings) / 50 =~ -1255m\n            Assert.AreEqual(-1255m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_LongToShort_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Half cash spent on 2000 MSFT shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is 66% of holdings.\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n\n            //Need to sell to make position ($150k total value * -0.5 target * 0.9975 buffer - $100k current holdings) / 50 =~ -3496m\n            Assert.AreEqual(-3496m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToShorter_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            //Price rises to $50.\n            Update(msft, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            // Cash: 150k\n            // MSFT: -(2000*50) = -100K\n            // TPV: 50k\n            Assert.AreEqual(50000, algo.Portfolio.TotalPortfolioValue);\n\n            // we should end with -748 shares (-.75*(50000-125)/50)\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.75m);\n\n            // currently -2000, so plus 1252\n            Assert.AreEqual(1252m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToLong_PriceRise_ZeroValue(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            //Price rises to $50: holdings now worthless.\n            Update(msft, 50m);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $0k Net Holdings, $50k Cash: $50k. MSFT is 0% of holdings.\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            //We want to be 50% long, this is currently +2000 holdings + 50% 50k = $25k * 0.9975 buffer/ $50-share~=2498m\n            Assert.AreEqual(2498m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortToLong_PriceRise(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            //Price rises to $50\n            Update(msft, 50m);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            // Cash: 150k\n            // MSFT: -50*2000=100k\n            // TPV: 50k\n            Assert.AreEqual(50000, algo.Portfolio.TotalPortfolioValue);\n\n            // 50k*0.5=25k = 500 end holdings\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n            // ($50k total value * 0.5 target * 0.9975 buffer - (-$100k current holdings)) / 50 =~ 2498m\n            Assert.AreEqual(2498m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n\n\n        /*****************************************************/\n        //  Falling market conditions tests.\n        /*****************************************************/\n\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void SetHoldings_ShortFixed_PriceFall(decimal leverage)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, leverage, 0);\n            //Set price to $25\n            Update(msft, 25);\n            //Sold -2000 MSFT shares, +50k cash\n            algo.Portfolio.SetCash(150000);\n            algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n            Update(msft, 12.5m);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            // Cash: 150k\n            // MSFT: -25k\n            // TPV : 125k\n            // ($125k total value * -0.5 target * 0.9975 buffer - (-$25k current holdings)) / 12.5 =~ -2987m\n            var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n            Assert.AreEqual(-2987m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, msft, algo));\n        }\n\n        /*************************************************************************/\n        //  Rounding the order quantity to the nearest multiple of lot size test\n        /*************************************************************************/\n\n        [Test]\n        public void SetHoldings_Long_RoundOff()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            var symbol = algo.AddForex(\"EURUSD\", market: Market.FXCM).Symbol;\n            algo.SetCash(100000);\n            algo.SetCash(\"BTC\", 0, 8000);\n            algo.SetBrokerageModel(BrokerageName.FxcmBrokerage);\n            algo.Securities[symbol].FeeModel = new ConstantFeeModel(0);\n            Security eurusd = algo.Securities[symbol];\n            // Set Price to $26\n            Update(eurusd, 26);\n            // So 100000/26 = 3846, After Rounding off becomes 3000\n            var actual = algo.CalculateOrderQuantity(symbol, 1m);\n            Assert.AreEqual(3000m, actual);\n\n            var btcusd = algo.AddCrypto(\"BTCUSD\", market: Market.Coinbase);\n            btcusd.FeeModel = new ConstantFeeModel(0);\n            // Set Price to $26\n            Update(btcusd, 26);\n            // (100000 * 0.9975) / 26 = 3836.53846153m\n            actual = algo.CalculateOrderQuantity(Symbols.BTCUSD, 1m);\n            Assert.AreEqual(3836.53846153m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_Short_RoundOff()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            var symbol = algo.AddForex(\"EURUSD\", market: Market.FXCM).Symbol;\n            algo.SetCash(100000);\n            algo.SetBrokerageModel(BrokerageName.FxcmBrokerage);\n            algo.Securities[symbol].FeeModel = new ConstantFeeModel(0);\n            Security eurusd = algo.Securities[symbol];\n            // Set Price to $26\n            Update(eurusd, 26);\n            // So -100000/26 = -3846, After Rounding off becomes -3000\n            var actual = algo.CalculateOrderQuantity(symbol, -1m);\n            Assert.AreEqual(-3000m, actual);\n\n            var btcusd = algo.AddCrypto(\"BTCUSD\", market: Market.Coinbase);\n            btcusd.BuyingPowerModel = new CashBuyingPowerModel();\n            btcusd.FeeModel = new ConstantFeeModel(0);\n            // Set Price to $26\n            Update(btcusd, 26);\n            // Cash model does not allow shorts\n            actual = algo.CalculateOrderQuantity(Symbols.BTCUSD, -1m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_Long_ToZero_RoundOff()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            var symbol = algo.AddForex(\"EURUSD\", market: Market.FXCM).Symbol;\n            algo.SetCash(10000);\n            algo.SetBrokerageModel(BrokerageName.FxcmBrokerage);\n            algo.Securities[symbol].FeeModel = new ConstantFeeModel(0);\n            Security eurusd = algo.Securities[symbol];\n            // Set Price to $25\n            Update(eurusd, 25);\n            // So 10000/25 = 400, After Rounding off becomes 0\n            var actual = algo.CalculateOrderQuantity(symbol, 1m);\n            Assert.AreEqual(0m, actual);\n        }\n\n        //[Test]\n        //public void SetHoldings_LongToLonger_PriceRise()\n        //{\n        //    var algo = GetAlgorithm();\n        //    //Set price to $25\n        //    Update(msft, 25));\n        //    //Half cash spent on 2000 MSFT shares.\n        //    algo.Portfolio.SetCash(50000);\n        //    algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n        //    //Price rises to $50.\n        //    Update(msft, 50));\n\n        //    //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is already 66% of holdings.\n        //    //Calculate the order for 75% MSFT:\n        //    var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.75m);\n\n        //    //Need to buy to make position $112.5k == $12.5k / 50 = 250 shares\n        //    Assert.AreEqual(250, actual);\n        //}\n\n        //[Test]\n        //public void SetHoldings_LongerToLong_PriceRise()\n        //{\n        //    var algo = GetAlgorithm();\n        //    //Set price to $25\n        //    Update(msft, 25));\n\n        //    //75% cash spent on 3000 MSFT shares.\n        //    algo.Portfolio.SetCash(25000);\n        //    algo.Portfolio[Symbols.MSFT].SetHoldings(25, 3000);\n\n        //    //Price rises to $50.\n        //    Update(msft, 50));\n\n        //    //Now: 3000 * 50 = $150k Holdings, $25k Cash: $175k. MSFT is 86% of holdings.\n        //    //Calculate the order for 50% MSFT:\n        //    var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n        //    //Need to sell to 50% = 87.5k target from $150k = 62.5 / $50-share = 1250\n        //    Assert.AreEqual(-1250, actual);\n        //}\n\n\n        //[Test]\n        //public void SetHoldings_LongToShort_PriceRise()\n        //{\n        //    var algo = GetAlgorithm();\n        //    //Set price to $25\n        //    Update(msft, 25));\n        //    //Half cash spent on 2000 MSFT shares.\n        //    algo.Portfolio.SetCash(50000);\n        //    algo.Portfolio[Symbols.MSFT].SetHoldings(25, 2000);\n\n        //    //Price rises to $50.\n        //    Update(msft, 50));\n\n        //    //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. MSFT is 66% of holdings.\n        //    var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.5m);\n\n        //    // Need to hold -75k from $100k = delta: $175k / $50-share = -3500 shares.\n        //    Assert.AreEqual(-3500, actual);\n        //}\n\n        //[Test]\n        //public void SetHoldings_ShortToShorter_PriceRise()\n        //{\n        //    var algo = GetAlgorithm();\n        //    //Set price to $25\n        //    Update(msft, 25));\n        //    //Half cash spent on -2000 MSFT shares.\n        //    algo.Portfolio.SetCash(50000);\n        //    algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n        //    //Price rises to $50.\n        //    Update(msft, 50));\n\n        //    //Now: 2000 * 50 = $0k Net Holdings, $50k Cash: $50k. MSFT is 0% of holdings.\n        //    var actual = algo.CalculateOrderQuantity(Symbols.MSFT, -0.75m);\n\n        //    //Want to hold -75% of MSFT: 50k total, -37.5k / $50-share = -750 TOTAL.\n        //    // Currently -2000, so net order +1250.\n        //    Assert.AreEqual(1250, actual);\n        //}\n\n        //[Test]\n        //public void SetHoldings_ShortToLong_PriceRise()\n        //{\n        //    var algo = GetAlgorithm();\n        //    //Set price to $25\n        //    Update(msft, 25));\n        //    //Half cash spent on -2000 MSFT shares.\n        //    algo.Portfolio.SetCash(50000);\n        //    algo.Portfolio[Symbols.MSFT].SetHoldings(25, -2000);\n\n        //    //Price rises to $50.\n        //    Update(msft, 50));\n\n        //    //Now: 2000 * 50 = $0k Net Holdings, $50k Cash: $50k. MSFT is 0% of holdings.\n        //    var actual = algo.CalculateOrderQuantity(Symbols.MSFT, 0.5m);\n\n        //    //We want to be 50% long, this is currently +2000 holdings + 50% 50k = $25k/ $50-share=500\n        //    Assert.AreEqual(2500, actual);\n        //}\n\n        [TestCaseSource(nameof(SetHoldingReturnsOrderTicketsTestCases))]\n        public void SetHoldingsReturnsOrderTicketsTest(List<Symbol> symbols, bool liquidateExistingHoldings, Dictionary<Symbol, decimal> expectedOrders, string tag)\n        {\n            // Initialize the algorithm and add equities to the portfolio\n            var algo = GetAlgorithm(out _, 1, 0);\n            var appl = algo.AddEquity(\"AAPL\");\n            var spy = algo.AddEquity(\"SPY\");\n            var ibm = algo.AddEquity(\"IBM\");\n\n            // Update prices and set initial holdings for the equities\n            Update(appl, 100);\n            Update(spy, 200);\n            Update(ibm, 300);\n            appl.Holdings.SetHoldings(25, 3);\n            spy.Holdings.SetHoldings(25, 3);\n            ibm.Holdings.SetHoldings(25, 3);\n\n            List<OrderTicket> orderTickets;\n            if (symbols.Count > 1)\n            {\n                // Handle multiple symbols by creating portfolio targets\n                var portfolioTargets = new List<PortfolioTarget>();\n                foreach (var symbol in symbols)\n                {\n                    portfolioTargets.Add(new PortfolioTarget(symbol, 0.5m));\n                }\n                orderTickets = algo.SetHoldings(portfolioTargets, liquidateExistingHoldings, tag: tag);\n            }\n            else\n            {\n                // Handle a single symbol or no symbols\n                if (symbols.Count != 0)\n                {\n                    orderTickets = algo.SetHoldings(symbols.First(), 1, liquidateExistingHoldings, tag: tag);\n                }\n                else\n                {\n                    orderTickets = algo.SetHoldings(new List<PortfolioTarget>(), liquidateExistingHoldings, tag: tag);\n                }\n            }\n\n            // Assert that the number of tickets matches the expected count\n            Assert.AreEqual(expectedOrders.Count, orderTickets.Count);\n\n            // Check each ticket:\n            // 1. Ensure the symbol is in the expectedOrders dictionary.\n            // 2. Verify the quantity matches the expected value for that symbol.\n            foreach (var ticket in orderTickets)\n            {\n                Assert.IsTrue(expectedOrders.ContainsKey(ticket.Symbol));\n                Assert.AreEqual(expectedOrders[ticket.Symbol], ticket.Quantity);\n            }\n        }\n\n        [Test]\n        public void OrderQuantityConversionTest()\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, 1, 0);\n\n            //Set price to $25\n            Update(msft, 25);\n\n            algo.Portfolio.SetCash(150000);\n\n            var mock = new Mock<ITransactionHandler>();\n            var request = new Mock<SubmitOrderRequest>(null, null, null, null, null, null, null, null, null, null, null);\n            mock.Setup(m => m.Process(It.IsAny<OrderRequest>())).Returns(new OrderTicket(null, request.Object));\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algo.Transactions.SetOrderProcessor(mock.Object);\n\n            algo.Buy(Symbols.MSFT, 1);\n            algo.Buy(Symbols.MSFT, 1.0);\n            algo.Buy(Symbols.MSFT, 1.0m);\n            algo.Buy(Symbols.MSFT, 1.0f);\n\n            algo.Sell(Symbols.MSFT, 1);\n            algo.Sell(Symbols.MSFT, 1.0);\n            algo.Sell(Symbols.MSFT, 1.0m);\n            algo.Sell(Symbols.MSFT, 1.0f);\n\n            algo.Order(Symbols.MSFT, 1);\n            algo.Order(Symbols.MSFT, 1.0);\n            algo.Order(Symbols.MSFT, 1.0m);\n            algo.Order(Symbols.MSFT, 1.0f);\n\n            algo.MarketOrder(Symbols.MSFT, 1);\n            algo.MarketOrder(Symbols.MSFT, 1.0);\n            algo.MarketOrder(Symbols.MSFT, 1.0m);\n            algo.MarketOrder(Symbols.MSFT, 1.0f);\n\n            algo.MarketOnOpenOrder(Symbols.MSFT, 1);\n            algo.MarketOnOpenOrder(Symbols.MSFT, 1.0);\n            algo.MarketOnOpenOrder(Symbols.MSFT, 1.0m);\n\n            algo.MarketOnCloseOrder(Symbols.MSFT, 1);\n            algo.MarketOnCloseOrder(Symbols.MSFT, 1.0);\n            algo.MarketOnCloseOrder(Symbols.MSFT, 1.0m);\n\n            algo.LimitOrder(Symbols.MSFT, 1, 1);\n            algo.LimitOrder(Symbols.MSFT, 1.0, 1);\n            algo.LimitOrder(Symbols.MSFT, 1.0m, 1);\n\n            algo.StopMarketOrder(Symbols.MSFT, 1, 1);\n            algo.StopMarketOrder(Symbols.MSFT, 1.0, 1);\n            algo.StopMarketOrder(Symbols.MSFT, 1.0m, 1);\n\n            algo.StopLimitOrder(Symbols.MSFT, 1, 1, 2);\n            algo.StopLimitOrder(Symbols.MSFT, 1.0, 1, 2);\n            algo.StopLimitOrder(Symbols.MSFT, 1.0m, 1, 2);\n\n            algo.TrailingStopOrder(Symbols.MSFT, 1, 1, true);\n            algo.TrailingStopOrder(Symbols.MSFT, 1.0, 1, true);\n            algo.TrailingStopOrder(Symbols.MSFT, 1.0m, 1, true);\n            algo.TrailingStopOrder(Symbols.MSFT, 1, 1, 0.01m, false);\n            algo.TrailingStopOrder(Symbols.MSFT, 1.0, 1, 0.01m, false);\n            algo.TrailingStopOrder(Symbols.MSFT, 1.0m, 1, 0.01m, false);\n\n            algo.LimitIfTouchedOrder(Symbols.MSFT, 1, 1, 2);\n            algo.LimitIfTouchedOrder(Symbols.MSFT, 1.0, 1, 2);\n            algo.LimitIfTouchedOrder(Symbols.MSFT, 1.0m, 1, 2);\n\n            algo.SetHoldings(Symbols.MSFT, 1);\n            algo.SetHoldings(Symbols.MSFT, 1.0);\n            algo.SetHoldings(Symbols.MSFT, 1.0m);\n            algo.SetHoldings(Symbols.MSFT, 1.0f);\n\n            const int expected = 44;\n            Assert.AreEqual(expected, algo.Transactions.LastOrderId);\n        }\n\n        [TestCaseSource(nameof(LiquidateWorksAsExpectedTestCases))]\n        public void LiquidateWorksAsExpected(Language language, bool? multipleSymbols, bool isAsynchronous, TimeInForce timeInForce)\n        {\n            Security msft;\n            var algo = GetAlgorithm(out msft, 1, 0);\n            algo.AddEquity(\"AAPL\");\n            algo.Securities[Symbols.AAPL].FeeModel = new ConstantFeeModel(0);\n            var aapl = algo.Securities[Symbols.AAPL];\n            aapl.SetLeverage(1);\n            msft.Holdings.SetHoldings(25, 3);\n            aapl.Holdings.SetHoldings(25, 7);\n\n            msft.Exchange.SetMarketHours(new List<MarketHoursSegment>() { MarketHoursSegment.OpenAllDay() });\n            aapl.Exchange.SetMarketHours(new List<MarketHoursSegment>() { MarketHoursSegment.OpenAllDay() });\n\n            //Set price to $25\n            Update(msft, 25);\n            Update(aapl, 25);\n\n            algo.Portfolio.SetCash(15000000);\n            var limitOrderCanceled = false;\n\n            // Setup the transaction handler\n            var tickets = new Dictionary<int, OrderTicket>();\n            var mock = new Mock<ITransactionHandler>();\n            var request = new Mock<SubmitOrderRequest>(null, null, null, null, null, null, null, null, null, null, null);\n            mock.Setup(m => m.Process(It.IsAny<OrderRequest>())).Returns<OrderRequest>(s =>\n            {\n                if (s.OrderRequestType == OrderRequestType.Cancel)\n                {\n                    limitOrderCanceled = true;\n                    return new OrderTicket(null, request.Object);\n                }\n                var orderRequest = s as SubmitOrderRequest;\n                var submitOrderRequest = new SubmitOrderRequest(orderRequest.OrderType, SecurityType.Equity, orderRequest.Symbol, orderRequest.Quantity, 0, 0, DateTime.UtcNow, \"\", orderRequest.OrderProperties);\n                submitOrderRequest.SetOrderId((int)orderRequest.Quantity);\n                var ticket = new OrderTicket(null, submitOrderRequest);\n                tickets[ticket.OrderId] = ticket;\n                return ticket;\n            });\n            algo.Transactions.SetOrderProcessor(mock.Object);\n\n            // Make the initial orders\n            var order1 = algo.MarketOrder(Symbols.MSFT, 1);\n            var order2 = algo.MarketOrder(Symbols.MSFT, 2);\n            var order3 = algo.MarketOrder(Symbols.AAPL, 3);\n            var order4 = algo.MarketOrder(Symbols.AAPL, 4);\n            var order5 = algo.LimitOrder(Symbols.AAPL, 5, 10);\n\n            // Setup the transaction handler to get the open orders as well as the order tickets\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns<Func<Order, bool>>(filter => tickets.Values.Select(x => Order.CreateOrder(x.SubmitRequest)).Where(x => filter(x)).ToList());\n            mock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns<int>(s =>\n            {\n                if (s < 0 && isAsynchronous)\n                {\n                    // This means that the method `Transactions.WaitForOrder()` was called, since the\n                    // negative ID's, in these case, come from the cancel orders, this is, from the\n                    // liquidate method\n                    throw new RegressionTestException(\"The orders were supposed to be liquidated asynchronously, but instead\" +\n                        \"they were liquidated synchronously\");\n                }\n                else\n                {\n                    return tickets[s];\n                }\n            });\n\n            // Test different Liquidate() constructors\n            var orderProperties = timeInForce != null ? new OrderProperties() { TimeInForce = timeInForce } : null;\n            List<OrderTicket> liquidatedTickets;\n            if (language == Language.CSharp)\n            {\n                if (multipleSymbols == true)\n                {\n                    liquidatedTickets = algo.Liquidate(new List<Symbol>() { Symbols.AAPL, Symbols.MSFT }, asynchronous: isAsynchronous, orderProperties: orderProperties);\n                }\n                else if (multipleSymbols == false)\n                {\n                    liquidatedTickets = algo.Liquidate(Symbols.AAPL, asynchronous: isAsynchronous, orderProperties: orderProperties);\n                    liquidatedTickets.AddRange(algo.Liquidate(Symbols.MSFT, asynchronous: isAsynchronous, orderProperties: orderProperties));\n                }\n                else\n                {\n                    liquidatedTickets = algo.Liquidate(asynchronous: isAsynchronous, orderProperties: orderProperties);\n                }\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    liquidatedTickets = algo.Liquidate((new List<Symbol>() { Symbols.AAPL, Symbols.MSFT }).ToPython(), asynchronous: isAsynchronous, orderProperties: orderProperties);\n                }\n            }\n\n            // Assert the symbols were liquidated asynchronously\n            var aaplTicket = liquidatedTickets.Where(x => x.Symbol == Symbols.AAPL).Single();\n            var msftTicket = liquidatedTickets.Where(x => x.Symbol == Symbols.MSFT).Single();\n            Assert.AreEqual(aapl.Holdings.Quantity * (-2), aaplTicket.Quantity);\n            Assert.AreEqual(msft.Holdings.Quantity * (-2), msftTicket.Quantity);\n            Assert.AreEqual(timeInForce ?? TimeInForce.GoodTilCanceled, aaplTicket.SubmitRequest.OrderProperties.TimeInForce);\n            Assert.AreEqual(timeInForce ?? TimeInForce.GoodTilCanceled, msftTicket.SubmitRequest.OrderProperties.TimeInForce);\n            Assert.IsTrue(limitOrderCanceled);\n        }\n\n        [Test]\n        public void MarketOrdersAreSupportedForFuturesOnExtendedMarketHours()\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n\n            var mockOrderProcessor = new Mock<ITransactionHandler>();\n            var mockRequest = new Mock<SubmitOrderRequest>(null, null, null, null, null, null, null, null, null, null, null);\n            var mockTicket = new OrderTicket(algo.Transactions, mockRequest.Object);\n            mockOrderProcessor.Setup(m => m.Process(It.IsAny<OrderRequest>())).Returns(mockTicket);\n            mockOrderProcessor.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(mockTicket);\n            algo.Transactions.SetOrderProcessor(mockOrderProcessor.Object);\n\n            var es20h20 = algo.AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute,\n                extendedMarketHours: true);\n            var es20h20FOP = algo.AddFutureOptionContract(\n                Symbol.CreateOption(es20h20.Symbol, Market.CME, OptionStyle.American, OptionRight.Call, 2550m, new DateTime(2020, 3, 20)),\n                Resolution.Minute);\n\n            //Set price to $25\n            Update(es20h20, 25);\n            Update(es20h20FOP, 25);\n            algo.Portfolio.SetCash(150000);\n\n            var testOrders = (DateTime dateTime) =>\n            {\n                algo.SetDateTime(dateTime);\n\n                var ticket = algo.Buy(es20h20.Symbol, 1);\n                Assert.AreEqual(OrderStatus.New, ticket.Status, $\"Future buy market order status should be new at {dateTime}, but was {ticket.Status}\");\n                ticket = algo.Sell(es20h20.Symbol, 1);\n                Assert.AreEqual(OrderStatus.New, ticket.Status, $\"Future sell market order status should be new at {dateTime}, but was {ticket.Status}\");\n\n                ticket = algo.Buy(es20h20FOP.Symbol, 1);\n                Assert.AreEqual(OrderStatus.New, ticket.Status, $\"Future option buy market order status should be new at {dateTime}, but was {ticket.Status}\");\n                ticket = algo.Sell(es20h20FOP.Symbol, 1);\n                Assert.AreEqual(OrderStatus.New, ticket.Status, $\"Future option sell market order status should be new at {dateTime}, but was {ticket.Status}\");\n            };\n\n            // October 7 to 11 (monday to friday). Testing pre-market hours\n            for (var i = 7; i <= 11; i++)\n            {\n                testOrders(new DateTime(2013, 10, i, 5, 0, 0));\n            }\n\n            // October 6 to 10 (sunday to thrusday). Testing post-market hours\n            for (var i = 6; i <= 10; i++)\n            {\n                testOrders(new DateTime(2013, 10, i, 23, 0, 0));\n            }\n        }\n\n        [Test]\n        public void MarketOnOpenOrdersNotSupportedForFutures()\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n            var es20h20 = algo.AddFutureContract(\n                QuantConnect.Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute);\n\n            var ticket = algo.MarketOnOpenOrder(es20h20.Symbol, 1);\n            Assert.That(ticket, Has.Property(\"Status\").EqualTo(OrderStatus.Invalid));\n        }\n\n        [Test]\n        public void OptionOrdersAreNotAllowedDuringASplit()\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n            var aapl = algo.AddEquity(\"AAPL\");\n            var applOptionContract = algo.AddOptionContract(\n                Symbol.CreateOption(aapl.Symbol, Market.USA, OptionStyle.American, OptionRight.Call, 40m, new DateTime(2014, 07, 19)));\n\n            var splitDate = new DateTime(2014, 06, 09);\n            aapl.SetMarketPrice(new IndicatorDataPoint(splitDate, 650m));\n            applOptionContract.SetMarketPrice(new IndicatorDataPoint(splitDate, 5m));\n\n            algo.SetCurrentSlice(new Slice(splitDate, new[] { new Split(aapl.Symbol, splitDate, 650m, 1 / 7, SplitType.SplitOccurred) }, splitDate));\n\n            var ticket = algo.MarketOrder(applOptionContract.Symbol, 1);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.IsTrue(ticket.SubmitRequest.Response.IsError);\n            Assert.AreEqual(OrderResponseErrorCode.OptionOrderOnStockSplit, ticket.SubmitRequest.Response.ErrorCode);\n            Assert.IsTrue(ticket.SubmitRequest.Response.ErrorMessage.Contains(\n                \"Options orders are not allowed when a split occurred for its underlying stock\", StringComparison.InvariantCulture));\n        }\n\n        [TestCase(OrderType.MarketOnOpen)]\n        [TestCase(OrderType.MarketOnClose)]\n        public void GoodTilDateTimeInForceNotSupportedForMOOAndMOCOrders(OrderType orderType)\n        {\n            var algorithm = GetAlgorithm(out var msft, 1, 0);\n            Update(msft, 25);\n\n            var orderProperties = new OrderProperties() { TimeInForce = TimeInForce.GoodTilDate(algorithm.Time.AddDays(1)) };\n\n            OrderTicket ticket;\n            switch (orderType)\n            {\n                case OrderType.MarketOnOpen:\n                    ticket = algorithm.MarketOnOpenOrder(msft.Symbol, 1, orderProperties: orderProperties);\n                    break;\n                case OrderType.MarketOnClose:\n                    ticket = algorithm.MarketOnCloseOrder(msft.Symbol, 1, orderProperties: orderProperties);\n                    break;\n                default:\n                    Assert.Fail(\"Unexpected order type\");\n                    return;\n            }\n\n\n            Assert.AreEqual(OrderStatus.New, ticket.Status);\n            Assert.AreEqual(TimeInForce.GoodTilCanceled, ticket.SubmitRequest.OrderProperties.TimeInForce);\n        }\n\n        [Test]\n        public void EuropeanOptionsCannotBeExercisedBeforeExpiry()\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n\n            var optionExpiry = new DateTime(2020, 3, 20);\n\n            var indexSymbol = Symbol.Create(\"SPX\", SecurityType.Index, Market.USA);\n            var optionSymbol = Symbol.CreateOption(indexSymbol, Market.USA, OptionStyle.European, OptionRight.Call, 1, optionExpiry);\n            var europeanOptionContract = algo.AddOptionContract(optionSymbol, Resolution.Minute);\n            europeanOptionContract.SetMarketPrice(new TradeBar() { Symbol = europeanOptionContract.Symbol, Value = 1, Time = algo.Time });\n\n            europeanOptionContract.Holdings.SetHoldings(1, 1);\n\n            algo.SetDateTime(optionExpiry.AddDays(-1).AddHours(15));\n            var ticket = algo.ExerciseOption(europeanOptionContract.Symbol, 1);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.AreEqual(OrderResponseErrorCode.EuropeanOptionNotExpiredOnExercise, ticket.SubmitRequest.Response.ErrorCode);\n\n            algo.SetDateTime(optionExpiry.AddHours(15));\n            ticket = algo.ExerciseOption(europeanOptionContract.Symbol, 1);\n            Assert.AreEqual(OrderStatus.New, ticket.Status);\n        }\n\n        [Test]\n        public void ComboOrderPreChecks()\n        {\n            var start = DateTime.UtcNow;\n            var algo = new AlgorithmStub();\n            algo.SetFinishedWarmingUp();\n            algo.AddEquity(\"SPY\").SetMarketPrice(new TradeBar\n            {\n                Time = algo.Time,\n                Open = 10m,\n                High = 10,\n                Low = 10,\n                Close = 10,\n                Volume = 0,\n                Symbol = Symbols.SPY,\n                DataType = MarketDataType.TradeBar\n            });\n\n            algo.AddOptionContract(Symbols.SPY_C_192_Feb19_2016);\n            var legs = new List<Leg>\n            {\n                new Leg { Symbol = Symbols.SPY, Quantity = 1 },\n                new Leg { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = 1 },\n            };\n\n            // the underlying has a price but the option does not\n            var result = algo.ComboMarketOrder(legs, 1);\n\n            Assert.AreEqual(1, result.Count);\n            Assert.AreEqual(OrderStatus.Invalid, result.Single().Status);\n            Assert.IsTrue(result.Single().SubmitRequest.Response.IsError);\n            Assert.IsTrue(result.Single().SubmitRequest.Response.ErrorMessage.Contains(\"does not have an accurate price\"));\n\n            Assert.IsTrue(DateTime.UtcNow - start < TimeSpan.FromMilliseconds(500));\n        }\n\n        [TestCase(new int[] { 1, 2 }, false)]\n        [TestCase(new int[] { -1, 10 }, false)]\n        [TestCase(new int[] { 2, -5 }, false)]\n        [TestCase(new int[] { 1, 2, 3 }, false)]\n        [TestCase(new int[] { 200, -11, 7 }, false)]\n        [TestCase(new int[] { 10, 20 }, true)]\n        [TestCase(new int[] { -10, 100 }, true)]\n        [TestCase(new int[] { 20, -50 }, true)]\n        [TestCase(new int[] { 10, 20, 30 }, true)]\n        [TestCase(new int[] { 1000, -55, 35 }, true)]\n        public void ComboOrderLegsRatiosAreValidated(int[] quantities, bool shouldThrow)\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n            var legs = quantities.Select(q => Leg.Create(Symbols.MSFT, q)).ToList();\n\n            if (shouldThrow)\n            {\n                Assert.Throws<ArgumentException>(() => algo.ComboMarketOrder(legs, 1));\n                Assert.Throws<ArgumentException>(() => algo.ComboLimitOrder(legs, 1, 100));\n                Assert.Throws<ArgumentException>(() => algo.ComboLegLimitOrder(legs.Select(leg =>\n                {\n                    leg.OrderPrice = 10;\n                    return leg;\n                }).ToList(), 1));\n            }\n            else\n            {\n                Assert.DoesNotThrow(() => algo.ComboMarketOrder(legs, 1));\n                Assert.DoesNotThrow(() => algo.ComboLimitOrder(legs, 1, 100));\n                Assert.DoesNotThrow(() => algo.ComboLegLimitOrder(legs.Select(leg =>\n                {\n                    leg.OrderPrice = 10;\n                    return leg;\n                }).ToList(), 1));\n            }\n        }\n\n        [Test]\n        public void MarketOnCloseOrdersSubmissionTimeCheck([Values] bool beforeLatestSubmissionTime)\n        {\n            var algo = GetAlgorithm(out _, 1, 0);\n            algo.SetTimeZone(TimeZones.London);\n            algo.SetDateTime(new DateTime(2023, 02, 16));\n\n            var es20h20 = algo.AddFutureContract(\n                Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 3, 20)),\n                Resolution.Minute);\n            es20h20.SetMarketPrice(new Tick(algo.Time, es20h20.Symbol, 1, 1));\n\n            var dateTimeInExchangeTimeZone = algo.Time.Date + new TimeSpan(17, 0, 0) - MarketOnCloseOrder.SubmissionTimeBuffer;\n            if (!beforeLatestSubmissionTime)\n            {\n                dateTimeInExchangeTimeZone += TimeSpan.FromSeconds(1);\n            }\n            algo.SetDateTime(dateTimeInExchangeTimeZone.ConvertTo(es20h20.Exchange.TimeZone, algo.TimeZone));\n\n            var ticket = algo.MarketOnCloseOrder(es20h20.Symbol, 1);\n\n            if (!beforeLatestSubmissionTime)\n            {\n                Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n                Assert.AreEqual(OrderResponseErrorCode.MarketOnCloseOrderTooLate, ticket.SubmitRequest.Response.ErrorCode);\n            }\n            else\n            {\n                Assert.AreNotEqual(OrderStatus.Invalid, ticket.Status, ticket.SubmitRequest.Response.ErrorMessage);\n            }\n        }\n\n        private QCAlgorithm GetAlgorithm(out Security msft, decimal leverage, decimal fee)\n        {\n            //Initialize algorithm\n            var algo = new QCAlgorithm();\n            algo.Settings.MinimumOrderMarginPortfolioPercentage = 0;\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.AddSecurity(SecurityType.Equity, \"MSFT\");\n            algo.SetCash(100000);\n            algo.SetFinishedWarmingUp();\n            algo.Securities[Symbols.MSFT].FeeModel = new ConstantFeeModel(fee);\n            algo.SetLiveMode(false);\n            _fakeOrderProcessor = new FakeOrderProcessor();\n            algo.Transactions.SetOrderProcessor(_fakeOrderProcessor);\n            msft = algo.Securities[Symbols.MSFT];\n            msft.SetLeverage(leverage);\n            algo.SetCurrentSlice(new Slice(DateTime.MinValue, Enumerable.Empty<BaseData>(), DateTime.MinValue));\n            return algo;\n        }\n\n        private QCAlgorithm GetAlgorithm(out Security msft, decimal initialMarginRequirement, decimal maintenanceMarginRequirement, decimal fee)\n        {\n            //Initialize algorithm\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.AddSecurity(SecurityType.Equity, \"MSFT\");\n            algo.SetCash(100000);\n            algo.SetFinishedWarmingUp();\n            algo.Securities[Symbols.MSFT].FeeModel = new ConstantFeeModel(fee);\n            _fakeOrderProcessor = new FakeOrderProcessor();\n            algo.Transactions.SetOrderProcessor(_fakeOrderProcessor);\n            msft = algo.Securities[Symbols.MSFT];\n            msft.BuyingPowerModel = new SecurityMarginModel(initialMarginRequirement, maintenanceMarginRequirement, 0);\n            return algo;\n        }\n\n        private void Update(Security security, decimal close)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n        }\n\n        private bool HasSufficientBuyingPowerForOrder(decimal orderQuantity, Security security, IAlgorithm algo)\n        {\n            var order = new MarketOrder(security.Symbol, orderQuantity, DateTime.UtcNow);\n            _fakeOrderProcessor.AddTicket(order.ToOrderTicket(algo.Transactions));\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(security.Symbol, orderQuantity, DateTime.UtcNow));\n            return hashSufficientBuyingPower.IsSufficient;\n        }\n\n        private static object[] LiquidateWorksAsExpectedTestCases =\n        {\n            new object[] { Language.CSharp, true, true, TimeInForce.Day },\n            new object[] { Language.CSharp, false, true, TimeInForce.Day },\n            new object[] { Language.CSharp, null, true, TimeInForce.Day },\n            new object[] { Language.Python, null, true, TimeInForce.Day },\n            new object[] { Language.CSharp, true, false, TimeInForce.Day },\n            new object[] { Language.CSharp, false, false, TimeInForce.Day },\n            new object[] { Language.CSharp, null, false, TimeInForce.Day },\n            new object[] { Language.Python, null, false, TimeInForce.Day },\n            new object[] { Language.CSharp, true, true, null },\n            new object[] { Language.CSharp, false, true, null },\n            new object[] { Language.CSharp, null, true, null },\n            new object[] { Language.Python, null, true, null },\n            new object[] { Language.CSharp, true, false, null },\n            new object[] { Language.CSharp, false, false, null },\n            new object[] { Language.CSharp, null, false, null },\n            new object[] { Language.Python, null, false, null }\n        };\n        private static object[] SetHoldingReturnsOrderTicketsTestCases =\n        {\n            new object[] { new List<Symbol>(), true, new Dictionary<Symbol, decimal> { { Symbols.AAPL, -3 }, { Symbols.IBM, -3 }, { Symbols.SPY, -3 } }, \"(Empty, true)\"},\n            new object[] { new List<Symbol>(), false, new Dictionary<Symbol, decimal>(), \"(Empty, false)\" },\n            new object[] { new List<Symbol>() { Symbols.IBM }, true, new Dictionary<Symbol, decimal> { { Symbols.AAPL, -3m }, { Symbols.IBM, 335m }, { Symbols.SPY, -3m } }, \"(OneSymbol, true)\" },\n            new object[] { new List<Symbol>() { Symbols.IBM }, false, new Dictionary<Symbol, decimal> { { Symbols.IBM, 335m } }, \"(OneSymbol, true)\" },\n            new object[] { new List<Symbol>() { Symbols.AAPL, Symbols.SPY }, true, new Dictionary<Symbol, decimal> { { Symbols.AAPL, 504m }, { Symbols.IBM, -3m }, { Symbols.SPY, 250m } }, \"(MultipleSymbols, true)\" },\n            new object[] { new List<Symbol>() { Symbols.AAPL, Symbols.SPY }, false, new Dictionary<Symbol, decimal> { { Symbols.AAPL, 504m }, { Symbols.SPY, 250m } }, \"(MultipleSymbols, false)\" },\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmUniverseSettingsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmUniverseSettingsTests\n    {\n        [TestCase(DataNormalizationMode.Raw)]\n        [TestCase(DataNormalizationMode.Adjusted)]\n        [TestCase(DataNormalizationMode.SplitAdjusted)]\n        [TestCase(DataNormalizationMode.TotalReturn)]\n        public void CheckUniverseSelectionSecurityDataNormalizationMode(DataNormalizationMode dataNormalizationMode)\n        {\n            var tuple = GetAlgorithmAndDataManager();\n            var algorithm = tuple.Item1;\n            var dataManager = tuple.Item2;\n\n            var symbol = Symbols.SPY;\n            algorithm.UniverseSettings.DataNormalizationMode = dataNormalizationMode;\n            algorithm.AddUniverse(coarse => new[] { symbol });\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n\n            var changes = dataManager.UniverseSelection\n                .ApplyUniverseSelection(\n                    algorithm.UniverseManager.First().Value,\n                    algorithm.UtcTime,\n                    new BaseDataCollection(algorithm.UtcTime, null, Enumerable.Empty<CoarseFundamental>()));\n\n            Assert.AreEqual(1, changes.AddedSecurities.Count);\n\n            var security = changes.AddedSecurities.First();\n            Assert.AreEqual(symbol, security.Symbol);\n            Assert.AreEqual(dataNormalizationMode, security.DataNormalizationMode);\n        }\n\n        [Test]\n        public void CheckManualSecurityDataNormalizationModePersistence()\n        {\n            var tuple = GetAlgorithmAndDataManager();\n            var algorithm = tuple.Item1;\n            var dataManager = tuple.Item2;\n\n            var expected = DataNormalizationMode.Adjusted;\n            var spy = algorithm.AddEquity(\"SPY\");\n            Assert.AreEqual(expected, spy.DataNormalizationMode);\n\n            var symbol = spy.Symbol;\n            algorithm.UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;\n            algorithm.AddUniverse(coarse => new[] { symbol });\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n\n            var changes = dataManager.UniverseSelection\n                .ApplyUniverseSelection(\n                    algorithm.UniverseManager.First().Value,\n                    algorithm.UtcTime,\n                    new BaseDataCollection(algorithm.UtcTime, null, Enumerable.Empty<CoarseFundamental>()));\n\n            Assert.AreEqual(1, changes.AddedSecurities.Count);\n\n            var security = changes.AddedSecurities.First();\n            Assert.AreEqual(symbol, security.Symbol);\n            Assert.AreEqual(spy, security);\n            Assert.AreEqual(expected, security.DataNormalizationMode);\n        }\n\n        [Test]\n        public void CheckManualSecurityDataNormalizationModePersistenceAfterUniverseSetting()\n        {\n            var tuple = GetAlgorithmAndDataManager();\n            var algorithm = tuple.Item1;\n            var dataManager = tuple.Item2;\n\n            // Set our universe mode to raw\n            var universeMode = DataNormalizationMode.Raw;\n            algorithm.UniverseSettings.DataNormalizationMode = universeMode;\n\n            // Verify that the security was set to raw\n            var spy = algorithm.AddEquity(\"SPY\");\n            Assert.AreEqual(universeMode, spy.DataNormalizationMode);\n\n            // Modify the mode of the security manually\n            var manualMode = DataNormalizationMode.TotalReturn;\n            spy.SetDataNormalizationMode(manualMode);\n            Assert.AreEqual(manualMode, spy.DataNormalizationMode);\n\n            var symbol = spy.Symbol;\n            algorithm.AddUniverse(coarse => new[] { symbol });\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n\n            var changes = dataManager.UniverseSelection\n                .ApplyUniverseSelection(\n                    algorithm.UniverseManager.First().Value,\n                    algorithm.UtcTime,\n                    new BaseDataCollection(algorithm.UtcTime, null, Enumerable.Empty<CoarseFundamental>()));\n\n            Assert.AreEqual(1, changes.AddedSecurities.Count);\n\n            var security = changes.AddedSecurities.First();\n            Assert.AreEqual(symbol, security.Symbol);\n            Assert.AreEqual(spy, security);\n\n            // Assert that our manual setting persisted\n            Assert.AreEqual(manualMode, security.DataNormalizationMode);\n        }\n\n        private Tuple<QCAlgorithm, DataManager> GetAlgorithmAndDataManager()\n        {\n            var algorithm = new QCAlgorithm();\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(\n                new MockDataFeed(),\n                new UniverseSelection(\n                    algorithm,\n                    new SecurityService(\n                        algorithm.Portfolio.CashBook,\n                        marketHoursDatabase,\n                        symbolPropertiesDatabase,\n                        algorithm,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCacheProvider(algorithm.Portfolio),\n                        algorithm: algorithm),\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n\n            var securityService = new SecurityService(\n                algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDatabase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            algorithm.Securities.SetSecurityService(securityService);\n            return Tuple.Create(algorithm, dataManager);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/AlgorithmWarmupTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Indicators;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing Python.Runtime;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Util;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class AlgorithmWarmupTests\n    {\n        private TestWarmupAlgorithm _algorithm;\n\n        [TearDown]\n        public void TearDown()\n        {\n            Config.Reset();\n        }\n\n        [TestCase(Resolution.Tick, SecurityType.Forex)]\n        [TestCase(Resolution.Second, SecurityType.Forex)]\n        [TestCase(Resolution.Hour, SecurityType.Forex)]\n        [TestCase(Resolution.Minute, SecurityType.Forex)]\n        [TestCase(Resolution.Daily, SecurityType.Forex)]\n        [TestCase(Resolution.Tick, SecurityType.Equity)]\n        [TestCase(Resolution.Second, SecurityType.Equity)]\n        [TestCase(Resolution.Hour, SecurityType.Equity)]\n        [TestCase(Resolution.Minute, SecurityType.Equity)]\n        [TestCase(Resolution.Daily, SecurityType.Equity)]\n        [TestCase(Resolution.Minute, SecurityType.Crypto)]\n        [TestCase(Resolution.Daily, SecurityType.Crypto)]\n        public void WarmupDifferentResolutions(Resolution resolution, SecurityType securityType)\n        {\n            var warmupPeriod = resolution != Resolution.Tick ? TimeSpan.FromDays(2) : TimeSpan.FromHours(10);\n            _algorithm = TestSetupHandler.TestAlgorithm = new TestWarmupAlgorithm(resolution, warmupPeriod);\n\n            _algorithm.SecurityType = securityType;\n            if (securityType == SecurityType.Forex)\n            {\n                _algorithm.StartDateToUse = new DateTime(2014, 05, 03);\n                _algorithm.EndDateToUse = new DateTime(2014, 05, 04);\n            }\n            else if (securityType == SecurityType.Equity)\n            {\n                _algorithm.StartDateToUse = new DateTime(2013, 10, 09);\n                _algorithm.EndDateToUse = new DateTime(2013, 10, 10);\n            }\n            else if (securityType == SecurityType.Crypto)\n            {\n                _algorithm.StartDateToUse = new DateTime(2018, 04, 06);\n                _algorithm.EndDateToUse = new DateTime(2018, 04, 07);\n            }\n\n            AlgorithmRunner.RunLocalBacktest(nameof(TestWarmupAlgorithm),\n                new Dictionary<string, string> { { PerformanceMetrics.TotalOrders, \"1\" } },\n                Language.CSharp,\n                AlgorithmStatus.Completed,\n                setupHandler: \"TestSetupHandler\");\n\n            int estimateExpectedDataCount;\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                    estimateExpectedDataCount = 2 * (securityType == SecurityType.Forex ? 19 : 4) * 60;\n                    break;\n                case Resolution.Second:\n                    estimateExpectedDataCount = 2 * (securityType == SecurityType.Forex ? 19 : 6) * 60 * 60;\n                    break;\n                case Resolution.Minute:\n                    estimateExpectedDataCount = 2 * (securityType == SecurityType.Forex ? 19 : 6) * 60;\n                    break;\n                case Resolution.Hour:\n                    estimateExpectedDataCount = 2 * (securityType == SecurityType.Forex ? 19 : 6);\n                    break;\n                case Resolution.Daily:\n                    // Warmup is 2 days. During warmup we expect the daily data point which goes from T-2 to T-1, once warmup finished,\n                    // we will get T-1 to T data point which is let through but the data feed since the algorithm starts at T\n                    estimateExpectedDataCount = 1;\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null);\n            }\n\n            Log.Debug($\"WarmUpDataCount: {_algorithm.WarmUpDataCount}. Resolution {resolution}. SecurityType {securityType}\");\n            Assert.GreaterOrEqual(_algorithm.WarmUpDataCount, estimateExpectedDataCount);\n        }\n\n        [Test]\n        public void WarmUpInternalSubscriptions()\n        {\n            var algo = new AlgorithmStub(new MockDataFeed())\n            {\n                HistoryProvider = new SubscriptionDataReaderHistoryProvider()\n            };\n            algo.Settings.SeedInitialPrices = false;\n\n            algo.SetStartDate(2013, 10, 08);\n            algo.AddCfd(\"DE30EUR\", Resolution.Second, Market.Oanda);\n            algo.SetWarmup(10);\n            algo.PostInitialize();\n            algo.DataManager.UniverseSelection.EnsureCurrencyDataFeeds(SecurityChanges.None);\n\n            Assert.AreEqual(algo.StartDate - TimeSpan.FromSeconds(10), algo.Time);\n        }\n\n        [Test]\n        public void WarmUpUniverseSelection()\n        {\n            var algo = new AlgorithmStub(new MockDataFeed())\n            {\n                HistoryProvider = new SubscriptionDataReaderHistoryProvider()\n            };\n\n            algo.SetStartDate(2013, 10, 08);\n            var universe = algo.AddUniverse((_) => Enumerable.Empty<Symbol>());\n            var barCount = 3;\n            algo.SetWarmup(barCount);\n            algo.PostInitialize();\n\n            // +2 is due to the weekend\n            Assert.AreEqual(algo.StartDate - universe.Configuration.Resolution.ToTimeSpan() * (barCount + 2), algo.Time);\n        }\n\n        [Test]\n        public void WarmUpPythonIndicatorProperly()\n        {\n            var algo = new AlgorithmStub\n            {\n                HistoryProvider = new SubscriptionDataReaderHistoryProvider()\n            };\n            algo.HistoryProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                algo.ObjectStore,\n                algo.Settings));\n            algo.SetStartDate(2013, 10, 08);\n            algo.AddEquity(\"SPY\", Resolution.Minute);\n\n            // Different types of indicators\n            var indicatorDataPoint = new SimpleMovingAverage(\"SPY\", 10);\n            var indicatorDataBar = new AverageTrueRange(\"SPY\", 10);\n            var indicatorTradeBar = new VolumeWeightedAveragePriceIndicator(\"SPY\", 10);\n\n            using (Py.GIL())\n            {\n                var sma = indicatorDataPoint.ToPython();\n                var atr = indicatorTradeBar.ToPython();\n                var vwapi = indicatorDataBar.ToPython();\n                #pragma warning disable CS0618\n                Assert.DoesNotThrow(() => algo.WarmUpIndicator(\"SPY\", sma, Resolution.Minute));\n                Assert.DoesNotThrow(() => algo.WarmUpIndicator(\"SPY\", atr, Resolution.Minute));\n                Assert.DoesNotThrow(() => algo.WarmUpIndicator(\"SPY\", vwapi, Resolution.Minute));\n                #pragma warning restore CS0618\n                var smaIsReady = ((dynamic)sma).IsReady;\n                var atrIsReady = ((dynamic)atr).IsReady;\n                var vwapiIsReady = ((dynamic)vwapi).IsReady;\n\n                Assert.IsTrue(smaIsReady.IsTrue());\n                Assert.IsTrue(atrIsReady.IsTrue());\n                Assert.IsTrue(vwapiIsReady.IsTrue());\n            }\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupStartDate_NoAsset(bool withResolution)\n        {\n            var algo = new AlgorithmStub();\n            algo.SetStartDate(2013, 10, 01);\n            DateTime expected;\n            if (withResolution)\n            {\n                algo.SetWarmUp(100, Resolution.Daily);\n                expected = new DateTime(2013, 06, 23);\n            }\n            else\n            {\n                algo.SetWarmUp(100);\n                // defaults to universe settings\n                expected = new DateTime(2013, 09, 30, 22, 20, 0);\n            }\n            algo.PostInitialize();\n\n            Assert.AreEqual(expected, algo.Time);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupStartDate_Equity_BarCount(bool withResolution)\n        {\n            var algo = new AlgorithmStub(new NullDataFeed { ShouldThrow = false });\n            algo.SetStartDate(2013, 10, 01);\n            algo.AddEquity(\"AAPL\");\n            // since SPY is a smaller resolution, won't affect in the bar count case, only the smallest warmup start time will be used\n            algo.AddEquity(\"SPY\", Resolution.Tick);\n            DateTime expected;\n            if (withResolution)\n            {\n                algo.SetWarmUp(100, Resolution.Daily);\n                expected = new DateTime(2013, 05, 09);\n            }\n            else\n            {\n                algo.SetWarmUp(100);\n                // uses the assets resolution\n                expected = new DateTime(2013, 9, 30, 14, 20, 0);\n            }\n            algo.PostInitialize();\n\n            // before than the case with no asset because takes into account 100 tradable dates of AAPL\n            Assert.AreEqual(expected, algo.Time);\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        public void WarmupStart_Equivalents(int testCase)\n        {\n            var algo = new AlgorithmStub(new NullDataFeed { ShouldThrow = false });\n            algo.SetStartDate(2013, 10, 01);\n            algo.AddEquity(\"AAPL\", Resolution.Daily);\n            // since SPY is a smaller resolution, won't affect in the bar count case, only the smallest warmup start time will be used\n            algo.AddEquity(\"SPY\", Resolution.Tick);\n            var expected = new DateTime(2013, 09, 20);\n            if (testCase == 0)\n            {\n                algo.SetWarmUp(7, Resolution.Daily);\n            }\n            else if (testCase == 1)\n            {\n                algo.SetWarmUp(7);\n            }\n            else if (testCase == 2)\n            {\n                algo.SetWarmUp(7);\n                algo.Settings.WarmupResolution = Resolution.Daily;\n            }\n            else if (testCase == 3)\n            {\n                // account for 2 weeknds\n                algo.SetWarmUp(TimeSpan.FromDays(11), Resolution.Daily);\n            }\n            else if (testCase == 4)\n            {\n                // account for 2 weeknds\n                algo.SetWarmUp(TimeSpan.FromDays(11));\n                algo.Settings.WarmupResolution = Resolution.Daily;\n            }\n            else if (testCase == 5)\n            {\n                // account for 2 weeknds\n                algo.SetWarmUp(TimeSpan.FromDays(11));\n            }\n            algo.PostInitialize();\n\n            Assert.AreEqual(expected, algo.Time);\n        }\n\n        [TestCase(\"UTC\")]\n        [TestCase(\"Asia/Hong_Kong\")]\n        [TestCase(\"America/New_York\")]\n        public void WarmupEndTime(string timeZone)\n        {\n            var algo = new AlgorithmStub(new NullDataFeed { ShouldThrow = false });\n            algo.SetLiveMode(true);\n\n            algo.SetWarmup(TimeSpan.FromDays(1));\n            algo.SetTimeZone(timeZone);\n            algo.PostInitialize();\n            algo.SetLocked();\n\n            Assert.IsTrue(algo.IsWarmingUp);\n\n            var start = DateTime.UtcNow;\n\n            algo.SetDateTime(start.AddMinutes(-1));\n            Assert.IsTrue(algo.IsWarmingUp);\n            algo.SetDateTime(start);\n            Assert.IsFalse(algo.IsWarmingUp);\n        }\n\n        [Test]\n        public void WarmupResolutionPython()\n        {\n            using (Py.GIL())\n            {\n                dynamic algo = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests.Engine.DataFeeds import *\n\nclass TestAlgo(AlgorithmStub):\n    def initialize(self):\n        self.data_feed.should_throw = False\n\n        self.set_start_date(2013, 10, 1)\n        self.add_equity(\"\"AAPL\"\")\n        self.set_warm_up(60)\n\").GetAttr(\"TestAlgo\").Invoke();\n\n                algo.initialize();\n                algo.post_initialize();\n\n                // the last trading hour of the previous day\n                Assert.AreEqual(new DateTime(2013, 09, 30, 15, 0, 0), (DateTime)algo.time);\n            }\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupResolutionPythonPassThrough(bool passThrough)\n        {\n            using (Py.GIL())\n            {\n                dynamic algo = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests.Engine.DataFeeds import *\n\nclass TestAlgo(AlgorithmStub):\n    def __init__(self, pass_through):\n        self.pass_through = pass_through\n\n    def initialize(self):\n        self.data_feed.should_throw = False\n\n        self.set_start_date(2013, 10, 1)\n        self.add_equity(\"\"AAPL\"\")\n        self.set_warm_up(10)\n        if self.pass_through:\n            self.settings.warm_up_resolution = Resolution.DAILY\n        else:\n            self.settings.warmup_resolution = Resolution.DAILY\n\").GetAttr(\"TestAlgo\").Invoke(passThrough.ToPython());\n\n                algo.initialize();\n                algo.post_initialize();\n\n                Assert.AreEqual(passThrough, (bool)algo.pass_through);\n                // 10 daily bars including 2 weekends\n                Assert.AreEqual(new DateTime(2013, 09, 17), (DateTime)algo.time);\n            }\n        }\n\n        private class TestSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            public static TestWarmupAlgorithm TestAlgorithm { get; set; }\n\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = TestAlgorithm;\n                return Algorithm;\n            }\n        }\n\n        private class TestWarmupAlgorithm : QCAlgorithm\n        {\n            private readonly Resolution _resolution;\n            private readonly TimeSpan _warmupPeriod;\n            private Symbol _symbol;\n            public SecurityType SecurityType { get; set; }\n\n            public DateTime StartDateToUse { get; set; }\n\n            public DateTime EndDateToUse { get; set; }\n\n            public int WarmUpDataCount { get; set; }\n\n            public TestWarmupAlgorithm(Resolution resolution, TimeSpan warmupPeriod)\n            {\n                _resolution = resolution;\n                _warmupPeriod = warmupPeriod;\n            }\n\n            public override void Initialize()\n            {\n                SetStartDate(StartDateToUse);\n                SetEndDate(EndDateToUse);\n\n                if (SecurityType == SecurityType.Forex)\n                {\n                    SetCash(\"NZD\", 1);\n                    _symbol = AddForex(\"EURUSD\", _resolution).Symbol;\n                }\n                else if (SecurityType == SecurityType.Equity)\n                {\n                    _symbol = AddEquity(\"SPY\", _resolution).Symbol;\n                }\n                else if (SecurityType == SecurityType.Crypto)\n                {\n                    _symbol = AddCrypto(\"BTCUSD\", _resolution).Symbol;\n                }\n                SetWarmUp(_warmupPeriod);\n            }\n\n            public override void OnData(Slice data)\n            {\n                if (IsWarmingUp)\n                {\n                    WarmUpDataCount += data.Count;\n                }\n                else\n                {\n                    if (!Portfolio.Invested)\n                    {\n                        SetHoldings(_symbol, 1);\n                        Quit();\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/CashModelAlgorithmTradingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing Moq;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class CashModelAlgorithmTradingTests\n    {\n        private static readonly Symbol _symbol = Symbols.BTCUSD;\n        private static readonly string _cashSymbol = \"BTC\";\n\n        /*****************************************************/\n        //  Isostatic market conditions tests.\n        /*****************************************************/\n\n        [Test]\n        public void SetHoldings_ZeroToLong()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(1995m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToLong_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            // $100k total value * 0.5 target * 0.9975 FreePortfolioValuePercentage / 25 ~= 1995 - fees\n            Assert.AreEqual(1994.96m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToLong_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            // 10k in fees = 400 shares (400*25)\n            // $100k total value * 0.5 target * 0.9975 FreePortfolioValuePercentage / 25 ~= 1995 - 400 because of fees\n            Assert.AreEqual(1595m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToShort()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            // no shorting allowed\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToShort_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            // no shorting allowed\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToShort_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            // no shorting allowed\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(992.5m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToFullLong()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            // 100k total value * 1 target * 0.9975 setHoldings buffer - 50K holdings -10K fees / @ 25 ~= 1590m\n            Assert.AreEqual(1590m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            // 100k total value * 0.75 target * 0.9975 setHoldings buffer - 50K holdings / @ 25 ~= 992m\n            Assert.AreEqual(992.46m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Calculate the new holdings:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(592.5m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongerToLong()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //75% cash spent on 3000 shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 3000, 25);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-1005m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongerToLong_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //75% cash spent on 3000 shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 3000, 25);\n            // 100k total value * 0.5 target * 0.9975 setHoldings buffer - 75K holdings / @ 25 ~= -1005m\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-1004.96m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongerToLong_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //75% cash spent on 3000 shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 3000, 25);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-605m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToZero()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-2000, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToZero_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-2000, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToZero_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n            //Sell all 2000 held:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n            Assert.AreEqual(-2000, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToShort()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToShort_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToShort_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_HalfLongToFullShort()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_HalfLongToFullShort_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m);\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_HalfLongToFullShort_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            // no shorting allowed\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m);\n            Assert.AreEqual(0, actual);\n        }\n\n        /*****************************************************/\n        //  Rising market conditions tests.\n        /*****************************************************/\n\n        [Test]\n        public void SetHoldings_LongFixed_PriceRise()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            Assert.AreEqual(100000, algo.Portfolio.TotalPortfolioValue);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n            algo.Portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(150000, algo.Portfolio.TotalPortfolioValue);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% security::\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.5 target * 0.9975 setHoldings buffer - 100K holdings / @ 50 = -503.75m\n            Assert.AreEqual(-503.75m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongFixed_PriceRise_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% security::\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.5 target * 0.9975 setHoldings buffer - 100K holdings / @ 50 = -503.75m - $1 in fees\n            Assert.AreEqual(-503.73m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongFixed_PriceRise_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k.\n            //Calculate the new holdings for 50% security::\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.5 target * 0.9975 setHoldings buffer - 100K holdings / @ 50 = -503.75m - -200 in fees\n            Assert.AreEqual(-303.75m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger_PriceRise()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. security is already 66% of holdings.\n            //Calculate the order for 75% security:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.75 target * 0.9975 setHoldings buffer - 100K holdings / @ 50 = 244.375m\n            Assert.AreEqual(244.375m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger_PriceRise_SmallConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 1);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. security is already 66% of holdings.\n            //Calculate the order for 75% security:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.75 target * 0.9975 setHoldings buffer - 100K holdings / @ 50 = 244.375m -$1 in fees\n            Assert.AreEqual(244.355m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToLonger_PriceRise_HighConstantFeeStructure()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 10000);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. security is already 66% of holdings.\n            //Calculate the order for 75% security:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.75m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // 150k total value * 0.75 target * 0.9975 setHoldings buffer - 100K holdings -10k in fees / @ 50 = 44.375m\n            Assert.AreEqual(44.375m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongerToLong_PriceRise()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n\n            //75% cash spent on 3000 shares.\n            algo.Portfolio.SetCash(25000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 3000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            algo.Settings.FreePortfolioValue =\n                algo.Portfolio.TotalPortfolioValue * algo.Settings.FreePortfolioValuePercentage;\n\n            //Now: 3000 * 50 = $150k Holdings, $25k Cash: $175k. security is 86% of holdings.\n            //Calculate the order for 50% security:\n            var actual = algo.CalculateOrderQuantity(_symbol, 0.5m);\n\n            Assert.IsTrue(security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio, security,\n                new MarketOrder(_symbol, actual, DateTime.UtcNow)).IsSufficient);\n\n            // $175k total value * 0.5 target * 0.9975 setHoldings buffer - $150k holdings / @ 50 = -1254.375m\n            Assert.AreEqual(-1254.375m, actual);\n        }\n\n        [Test]\n        public void SetHoldings_LongToShort_PriceRise()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            //Half cash spent on 2000 shares.\n            algo.Portfolio.SetCash(50000);\n            algo.Portfolio.CashBook.Add(_cashSymbol, 2000, 25);\n\n            //Price rises to $50.\n            Update(algo.Portfolio.CashBook, security, 50);\n\n            //Now: 2000 * 50 = $100k Holdings, $50k Cash: $150k. security is 66% of holdings.\n            var actual = algo.CalculateOrderQuantity(_symbol, -0.5m);\n\n            // no shorting allowed\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullLong()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            // 100000 * 0.9975 / 25 = 3990m\n            Assert.AreEqual(3990m, actual);\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(_symbol, actual, DateTime.UtcNow));\n            Assert.IsTrue(hashSufficientBuyingPower.IsSufficient);\n        }\n\n        [Test]\n        public void SetHoldings_Long_TooBigOfATarget()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security) + 0.1m);\n\n            Assert.AreEqual(4389m, actual);\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(_symbol, actual, DateTime.UtcNow));\n            Assert.IsFalse(hashSufficientBuyingPower.IsSufficient);\n        }\n\n        [Test]\n        public void SetHoldings_PriceRise_VolatilityCoveredByBuffer()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m);\n            Assert.AreEqual(3990m, actual);\n\n            //Price rises to 0.25%. We should be covered by buffer\n            Update(algo.Portfolio.CashBook, security, security.Price * 1.0025m);\n\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(_symbol, actual, DateTime.UtcNow));\n            Assert.IsTrue(hashSufficientBuyingPower.IsSufficient);\n        }\n\n        [Test]\n        public void SetHoldings_PriceRise_VolatilityNotCoveredByBuffer()\n        {\n            Security security;\n            var algo = GetAlgorithm(out security, 0);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m);\n            Assert.AreEqual(3990m, actual);\n\n            // Price rises to 0.26%. We will not be covered by buffer\n            Update(algo.Portfolio.CashBook, security, security.Price * 1.0026m);\n\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(_symbol, actual, DateTime.UtcNow));\n            Assert.IsFalse(hashSufficientBuyingPower.IsSufficient);\n        }\n\n\n        [TestCase(SecurityType.Forex)]\n        [TestCase(SecurityType.Crypto)]\n        public void OrderQuantityConversionTest(SecurityType securityType)\n        {\n            var algo = GetAlgorithm(out var security, 0, securityType);\n            var symbol = security.Symbol;\n            algo.Portfolio.SetCash(150000);\n\n            var mock = new Mock<ITransactionHandler>();\n            var request = new Mock<SubmitOrderRequest>(null, null, null, null, null, null, null, null, null, null, null);\n            mock.Setup(m => m.Process(It.IsAny<OrderRequest>())).Returns(new OrderTicket(null, request.Object));\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algo.Transactions.SetOrderProcessor(mock.Object);\n\n            algo.Buy(symbol, 1);\n            algo.Buy(symbol, 1.0);\n            algo.Buy(symbol, 1.0m);\n            algo.Buy(symbol, 1.0f);\n\n            algo.Sell(symbol, 1);\n            algo.Sell(symbol, 1.0);\n            algo.Sell(symbol, 1.0m);\n            algo.Sell(symbol, 1.0f);\n\n            algo.Order(symbol, 1);\n            algo.Order(symbol, 1.0);\n            algo.Order(symbol, 1.0m);\n            algo.Order(symbol, 1.0f);\n\n            algo.MarketOrder(symbol, 1);\n            algo.MarketOrder(symbol, 1.0);\n            algo.MarketOrder(symbol, 1.0m);\n            algo.MarketOrder(symbol, 1.0f);\n\n            int expected = 32;\n            if (securityType == SecurityType.Crypto)\n            {\n                expected -= 6;\n\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnCloseOrder(symbol, 1));\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnCloseOrder(symbol, 1.0));\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnCloseOrder(symbol, 1.0m));\n\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnOpenOrder(symbol, 1));\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnOpenOrder(symbol, 1.0));\n                Assert.Throws<InvalidOperationException>(() => algo.MarketOnOpenOrder(symbol, 1.0m));\n            }\n            else\n            {\n                algo.SetDateTime(new DateTime(2025, 04, 26, 18, 30, 0).ConvertToUtc(algo.TimeZone));\n                algo.MarketOnOpenOrder(symbol, 1);\n                algo.MarketOnOpenOrder(symbol, 1.0);\n                algo.MarketOnOpenOrder(symbol, 1.0m);\n\n                algo.MarketOnCloseOrder(symbol, 1);\n                algo.MarketOnCloseOrder(symbol, 1.0);\n                algo.MarketOnCloseOrder(symbol, 1.0m);\n            }\n\n            algo.LimitOrder(symbol, 1, 1);\n            algo.LimitOrder(symbol, 1.0, 1);\n            algo.LimitOrder(symbol, 1.0m, 1);\n\n            algo.StopMarketOrder(symbol, 1, 1);\n            algo.StopMarketOrder(symbol, 1.0, 1);\n            algo.StopMarketOrder(symbol, 1.0m, 1);\n\n            algo.SetHoldings(symbol, 1);\n            algo.SetHoldings(symbol, 1.0);\n            algo.SetHoldings(symbol, 1.0m);\n            algo.SetHoldings(symbol, 1.0f);\n\n            Assert.AreEqual(expected, algo.Transactions.LastOrderId);\n        }\n\n        private static QCAlgorithm GetAlgorithm(out Security security, decimal fee, SecurityType securityType = SecurityType.Crypto)\n        {\n            SymbolCache.Clear();\n            // Initialize algorithm\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetCash(100000);\n            algo.SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);\n            algo.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algo.SetFinishedWarmingUp();\n            var cashSymbol = string.Empty;\n            if (securityType == SecurityType.Crypto)\n            {\n                cashSymbol = \"BTC\";\n                security = algo.AddSecurity(securityType, \"BTCUSD\");\n            }\n            else if(securityType == SecurityType.Forex)\n            {\n                cashSymbol = \"EUR\";\n                security = algo.AddSecurity(securityType, \"EURUSD\");\n                // set BPM to cash, since it's not the default\n                security.BuyingPowerModel = new CashBuyingPowerModel();\n            }\n            else\n            {\n                throw new NotImplementedException(\"Unexpected security type\");\n            }\n            security.FeeModel = new ConstantFeeModel(fee);\n            //Set price to $25\n            Update(algo.Portfolio.CashBook, security, 25, cashSymbol);\n            return algo;\n        }\n\n        private static void Update(CashBook cashBook, Security security, decimal close, string cashSymbol = \"BTC\")\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = new DateTime(2022, 3, 15, 8, 0, 0),\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n\n            if (cashBook.TryGetValue(cashSymbol, out var cash))\n            {\n                cash.ConversionRate = close;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/BasePairsTradingAlphaModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class BasePairsTradingAlphaModelTests : CommonAlphaModelTests\n    {\n        private const int _lookback = 15;\n        private const Resolution _resolution = Resolution.Minute;\n\n        protected override int MaxSliceCount => 1500;\n\n        protected override IAlphaModel CreateCSharpAlphaModel()\n        {\n            return new BasePairsTradingAlphaModel(_lookback, _resolution);\n        }\n\n        protected override void InitializeAlgorithm(QCAlgorithm algorithm)\n        {\n            algorithm.SetUniverseSelection(new ManualUniverseSelectionModel(\n                Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA)));\n        }\n\n        protected override string GetExpectedModelName(IAlphaModel model)\n        {\n            return $\"{nameof(BasePairsTradingAlphaModel)}({_lookback},{_resolution},1)\";\n        }\n\n        protected override IAlphaModel CreatePythonAlphaModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic model = Py.Import(\"BasePairsTradingAlphaModel\").GetAttr(\"BasePairsTradingAlphaModel\");\n                var instance = model(_lookback, _resolution);\n                return new AlphaModelPythonWrapper(instance);\n            }\n        }\n\n        protected override IEnumerable<Insight> ExpectedInsights()\n        {\n            Assert.Ignore(\"The CommonAlphaModelTests need to be refactored to support multiple securities with different prices for each security\");\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/CommonAlphaModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Python;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    /// <summary>\n    /// Provides a framework for testing alpha models.\n    /// </summary>\n    public abstract class CommonAlphaModelTests\n    {\n        protected QCAlgorithm Algorithm { get; set; }\n\n        [OneTimeSetUp]\n        public void Initialize()\n        {\n            PythonInitializer.Initialize();\n\n            Algorithm = new QCAlgorithm();\n            Algorithm.PortfolioConstruction = new NullPortfolioConstructionModel();\n            Algorithm.HistoryProvider = new SineHistoryProvider(Algorithm.Securities);\n            Algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(Algorithm));\n            InitializeAlgorithm(Algorithm);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AddAlphaModel(Language language)\n        {\n            IAlphaModel model;\n            IAlphaModel model2 = null;\n            IAlphaModel model3 = null;\n            if (!TryCreateModel(language, out model)\n                || !TryCreateModel(language, out model2)\n                || !TryCreateModel(language, out model3))\n            {\n                Assert.Ignore($\"Ignore {GetType().Name}: Could not create {language} model.\");\n            }\n\n            // Set the alpha model\n            Algorithm.SetAlpha(model);\n            Algorithm.AddAlpha(model2);\n            Algorithm.AddAlpha(model3);\n            Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n            Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n            var actualInsights = new List<Insight>();\n            Algorithm.InsightsGenerated += (s, e) => actualInsights.AddRange(e.Insights);\n\n            var expectedInsights = ExpectedInsights().ToList();\n\n            var consolidators = Algorithm.Securities.SelectMany(kvp => kvp.Value.Subscriptions).SelectMany(x => x.Consolidators);\n            var slices = CreateSlices();\n\n            foreach (var slice in slices.ToList())\n            {\n                Algorithm.SetDateTime(slice.Time);\n\n                foreach (var symbol in slice.Keys)\n                {\n                    var data = slice[symbol];\n                    Algorithm.Securities[symbol].SetMarketPrice(data);\n\n                    foreach (var consolidator in consolidators)\n                    {\n                        consolidator.Update(data);\n                    }\n                }\n\n                Algorithm.OnFrameworkData(slice);\n            }\n\n            Assert.AreEqual(expectedInsights.Count * 3, actualInsights.Count);\n\n            for (var i = 0; i < actualInsights.Count; i = i + 3)\n            {\n                var expected = expectedInsights[i / 3];\n                for (int j = i; j < 3; j++)\n                {\n                    var actual = actualInsights[j];\n                    Assert.AreEqual(expected.Symbol, actual.Symbol);\n                    Assert.AreEqual(expected.Type, actual.Type);\n                    Assert.AreEqual(expected.Direction, actual.Direction);\n                    Assert.LessOrEqual(expected.Period, actual.Period);         // It can be canceled and discarded early\n                    Assert.AreEqual(expected.Magnitude, actual.Magnitude);\n                    Assert.AreEqual(expected.Confidence, actual.Confidence);\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void InsightsGenerationTest(Language language)\n        {\n            IAlphaModel model;\n            if (!TryCreateModel(language, out model))\n            {\n                Assert.Ignore($\"Ignore {GetType().Name}: Could not create {language} model.\");\n            }\n\n            // Set the alpha model\n            Algorithm.SetAlpha(model);\n            Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n            Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n            var actualInsights = new List<Insight>();\n            Algorithm.InsightsGenerated += (s, e) => actualInsights.AddRange(e.Insights);\n\n            var expectedInsights = ExpectedInsights().ToList();\n\n            var consolidators = Algorithm.Securities.SelectMany(kvp => kvp.Value.Subscriptions).SelectMany(x => x.Consolidators);\n            var slices = CreateSlices();\n\n            foreach (var slice in slices.ToList())\n            {\n                Algorithm.SetDateTime(slice.Time);\n\n                foreach (var symbol in slice.Keys)\n                {\n                    var data = slice[symbol];\n                    Algorithm.Securities[symbol].SetMarketPrice(data);\n\n                    foreach (var consolidator in consolidators)\n                    {\n                        consolidator.Update(data);\n                    }\n                }\n\n                Algorithm.OnFrameworkData(slice);\n            }\n\n            Assert.AreEqual(expectedInsights.Count, actualInsights.Count);\n\n            for (var i = 0; i < actualInsights.Count; i++)\n            {\n                var actual = actualInsights[i];\n                var expected = expectedInsights[i];\n                Assert.AreEqual(expected.Symbol, actual.Symbol);\n                Assert.AreEqual(expected.Type, actual.Type);\n                Assert.AreEqual(expected.Direction, actual.Direction);\n                Assert.LessOrEqual(expected.Period, actual.Period);         // It can be canceled and discarded early\n                Assert.AreEqual(expected.Magnitude, actual.Magnitude);\n                Assert.AreEqual(expected.Confidence, actual.Confidence);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AddedSecuritiesTest(Language language)\n        {\n            IAlphaModel model;\n            if (!TryCreateModel(language, out model))\n            {\n                Assert.Ignore($\"Ignore {GetType().Name}: Could not create {language} model.\");\n            }\n\n            var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n\n            Assert.DoesNotThrow(() => model.OnSecuritiesChanged(Algorithm, changes));\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void RemovedSecuritiesTest(Language language)\n        {\n            IAlphaModel model;\n            if (!TryCreateModel(language, out model))\n            {\n                Assert.Ignore($\"Ignore {GetType().Name}: Could not create {language} model.\");\n            }\n\n            var removedSecurities = Algorithm.Securities.Values;\n\n            // We have to add some security if we then want to remove it, that's why we cannot use here\n            // RemovedSecurities, because it doesn't contain any security\n            var changes = SecurityChangesTests.CreateNonInternal(removedSecurities, AddedSecurities);\n\n            Assert.DoesNotThrow(() => model.OnSecuritiesChanged(Algorithm, changes));\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void ModelNameTest(Language language)\n        {\n            IAlphaModel model;\n            if (!TryCreateModel(language, out model))\n            {\n                Assert.Ignore($\"Ignore {GetType().Name}: Could not create {language} model.\");\n            }\n\n            var actual = model.GetModelName();\n            var expected = GetExpectedModelName(model);\n            Assert.AreEqual(expected, actual);\n        }\n\n        /// <summary>\n        /// Returns a new instance of the alpha model to test\n        /// </summary>\n        protected abstract IAlphaModel CreateCSharpAlphaModel();\n\n        /// <summary>\n        /// Returns a new instance of the alpha model to test\n        /// </summary>\n        protected abstract IAlphaModel CreatePythonAlphaModel();\n\n        /// <summary>\n        /// Returns an enumerable with the expected insights\n        /// </summary>\n        protected abstract IEnumerable<Insight> ExpectedInsights();\n\n        /// <summary>\n        /// List of securities to be added to the model\n        /// </summary>\n        protected virtual IEnumerable<Security> AddedSecurities => Algorithm.Securities.Values;\n\n        /// <summary>\n        /// List of securities to be removed to the model\n        /// </summary>\n        protected virtual IEnumerable<Security> RemovedSecurities => Enumerable.Empty<Security>();\n\n        /// <summary>\n        /// To be override for model types that implement <see cref=\"INamedModel\"/>\n        /// </summary>\n        protected abstract string GetExpectedModelName(IAlphaModel model);\n\n        /// <summary>\n        /// Provides derived types a chance to initialize anything special they require\n        /// </summary>\n        protected virtual void InitializeAlgorithm(QCAlgorithm algorithm)\n        {\n            Algorithm.SetStartDate(2018, 1, 4);\n            Algorithm.AddEquity(Symbols.SPY.Value, Resolution.Daily);\n        }\n\n        /// <summary>\n        /// Creates an enumerable of Slice to update the alpha model\n        /// </summary>\n        protected virtual IEnumerable<Slice> CreateSlices()\n        {\n            var timeSliceFactory = new TimeSliceFactory(TimeZones.NewYork);\n            var changes = SecurityChanges.None;\n            var sliceDateTimes = GetSliceDateTimes(MaxSliceCount);\n\n            for (var i = 0; i < sliceDateTimes.Count; i++)\n            {\n                var utcDateTime = sliceDateTimes[i];\n\n                var packets = new List<DataFeedPacket>();\n\n                // TODO : Give securities different values -- will require updating all derived types\n                var last = Convert.ToDecimal(100 + 10 * Math.Sin(Math.PI * i / 180.0));\n                var high = last * 1.005m;\n                var low = last / 1.005m;\n                foreach (var kvp in Algorithm.Securities)\n                {\n                    var security = kvp.Value;\n                    var exchange = security.Exchange.Hours;\n                    var configs = Algorithm.SubscriptionManager.SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(security.Symbol);\n                    var extendedMarket = configs.IsExtendedMarketHours();\n                    var localDateTime = utcDateTime.ConvertFromUtc(exchange.TimeZone);\n                    if (!exchange.IsOpen(localDateTime, extendedMarket))\n                    {\n                        continue;\n                    }\n                    var configuration = security.Subscriptions.FirstOrDefault();\n                    var period = configs.GetHighestResolution().ToTimeSpan();\n                    var time = (utcDateTime - period).ConvertFromUtc(configuration.DataTimeZone);\n                    var tradeBar = new TradeBar(time, security.Symbol, last, high, low, last, 1000, period);\n                    packets.Add(new DataFeedPacket(security, configuration, new List<BaseData> { tradeBar }));\n                }\n\n                if (packets.Count > 0)\n                {\n                    yield return timeSliceFactory.Create(utcDateTime, packets, changes, new Dictionary<Universe, BaseDataCollection>()).Slice;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Set up the HistoryProvider for algorithm\n        /// </summary>\n        protected void SetUpHistoryProvider()\n        {\n            Algorithm.HistoryProvider = new SubscriptionDataReaderHistoryProvider();\n            Algorithm.HistoryProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                Algorithm.ObjectStore,\n                Algorithm.Settings));\n        }\n\n        /// <summary>\n        /// Gets the maximum number of slice objects to generate\n        /// </summary>\n        protected virtual int MaxSliceCount => 360;\n\n        private List<DateTime> GetSliceDateTimes(int maxCount)\n        {\n            var i = 0;\n            var sliceDateTimes = new List<DateTime>();\n            var utcDateTime = Algorithm.StartDate;\n\n            while (sliceDateTimes.Count < maxCount)\n            {\n                foreach (var kvp in Algorithm.Securities)\n                {\n                    var security = kvp.Value;\n                    var configs = Algorithm.SubscriptionManager.SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(security.Symbol);\n                    var resolution = configs.GetHighestResolution().ToTimeSpan();\n                    utcDateTime = utcDateTime.Add(resolution);\n                    if (resolution == Time.OneDay && utcDateTime.TimeOfDay == TimeSpan.Zero)\n                    {\n                        utcDateTime = utcDateTime.AddHours(17);\n                    }\n                    var exchange = security.Exchange.Hours;\n                    var extendedMarket = configs.IsExtendedMarketHours();\n                    var localDateTime = utcDateTime.ConvertFromUtc(exchange.TimeZone);\n                    if (exchange.IsOpen(localDateTime, extendedMarket))\n                    {\n                        sliceDateTimes.Add(utcDateTime);\n                    }\n                    i++;\n                }\n            }\n\n            return sliceDateTimes;\n        }\n\n        private bool TryCreateModel(Language language, out IAlphaModel model)\n        {\n            model = default(IAlphaModel);\n\n            switch (language)\n            {\n                case Language.CSharp:\n                    model = CreateCSharpAlphaModel();\n                    return true;\n                case Language.Python:\n                    Algorithm.SetPandasConverter();\n                    model = CreatePythonAlphaModel();\n                    return true;\n                default:\n                    return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/ConstantAlphaModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing static System.FormattableString;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class ConstantAlphaModelTests : CommonAlphaModelTests\n    {\n        private InsightType _type = InsightType.Price;\n        private InsightDirection _direction = InsightDirection.Up;\n        private TimeSpan _period = Time.OneDay;\n        private double? _magnitude = 0.025;\n        private double? _confidence = null;\n\n        protected override IAlphaModel CreateCSharpAlphaModel() => new ConstantAlphaModel(_type, _direction, _period, _magnitude, _confidence);\n\n        protected override IAlphaModel CreatePythonAlphaModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic model = Py.Import(\"ConstantAlphaModel\").GetAttr(\"ConstantAlphaModel\");\n                var instance = model(_type, _direction, _period, _magnitude, _confidence);\n                return new AlphaModelPythonWrapper(instance);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void ConstructorWithWeightOnlySetsWeightCorrectly(Language language)\n        {\n            IAlphaModel alpha;\n            if (language == Language.CSharp)\n            {\n                alpha = new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(1), weight: 0.1);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"test_module\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef test_constructor():\n    model = ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(1), weight=0.1)\n    return model\n                    \");\n\n                    alpha = testModule.GetAttr(\"test_constructor\").Invoke().As<ConstantAlphaModel>();\n                }\n            }\n\n            var magnitude = GetPrivateField(alpha, \"_magnitude\");\n            var confidence = GetPrivateField(alpha, \"_confidence\");\n            var weight = GetPrivateField(alpha, \"_weight\");\n\n            Assert.IsNull(magnitude);\n            Assert.IsNull(confidence);\n            Assert.AreEqual(0.1, weight);\n        }\n\n        private static object GetPrivateField(object obj, string fieldName)\n        {\n            var field = obj.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);\n            return field?.GetValue(obj);\n        }\n\n        protected override IEnumerable<Insight> ExpectedInsights()\n        {\n            return Enumerable.Range(0, 360).Select(x => new Insight(Symbols.SPY, _period, _type, _direction, _magnitude, _confidence));\n        }\n\n        protected override string GetExpectedModelName(IAlphaModel model)\n        {\n            return Invariant($\"{nameof(ConstantAlphaModel)}({_type},{_direction},{_period},{_magnitude})\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/EmaCrossAlphaModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Util;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class EmaCrossAlphaModelTests : CommonAlphaModelTests\n    {\n        protected override IAlphaModel CreateCSharpAlphaModel() => new EmaCrossAlphaModel();\n\n        protected override IAlphaModel CreatePythonAlphaModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic model = Py.Import(\"EmaCrossAlphaModel\").GetAttr(\"EmaCrossAlphaModel\");\n                var instance = model();\n                return new AlphaModelPythonWrapper(instance);\n            }\n        }\n\n        protected override IEnumerable<Insight> ExpectedInsights()\n        {\n            var period = TimeSpan.FromDays(12);\n\n            return new[]\n            {\n                Insight.Price(Symbols.SPY, period, InsightDirection.Down),\n                Insight.Price(Symbols.SPY, period, InsightDirection.Up)\n            };\n        }\n\n        protected override string GetExpectedModelName(IAlphaModel model)\n        {\n            return $\"{nameof(EmaCrossAlphaModel)}(12,26,Daily)\";\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            SetUpHistoryProvider();\n\n            Algorithm.SetStartDate(2013, 10, 08);\n            Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            // Create a EmaCrossAlphaModel for the test\n            var model = new TestEmaCrossAlphaModel();\n\n            // Set the alpha model\n            Algorithm.SetAlpha(model);\n            Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n            Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n            // Get the dictionary of macd indicators\n            var symbolData = model.GetSymbolData();\n\n            // Check the symbolData dictionary is not empty\n            Assert.NotZero(symbolData.Count);\n\n            // Check all EmaCross indicators from the alpha are ready and have at least\n            // one datapoint\n            foreach (var item in symbolData)\n            {\n                var fast = item.Value.Fast;\n                var slow = item.Value.Slow;\n\n                Assert.IsTrue(fast.IsReady);\n                Assert.NotZero(fast.Samples);\n\n                Assert.IsTrue(slow.IsReady);\n                Assert.NotZero(slow.Samples);\n            }\n        }\n\n        [Test]\n        public void PythonVersionWarmsUpProperly()\n        {\n            using (Py.GIL())\n            {\n                SetUpHistoryProvider();\n                Algorithm.SetStartDate(2013, 10, 08);\n                Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n                // Create and set alpha model\n                dynamic model = Py.Import(\"EmaCrossAlphaModel\").GetAttr(\"EmaCrossAlphaModel\");\n                var instance = model();\n                Algorithm.SetAlpha(instance);\n\n                var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n                Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n                // Get the dictionary of ema cross indicators\n                var symbolData = instance.symbol_data_by_symbol;\n\n                // Check the dictionary is not empty\n                Assert.NotZero(symbolData.Length());\n\n                // Check all Ema Cross indicators from the alpha are ready and have at least\n                // one datapoint\n                foreach (var item in symbolData)\n                {\n                    var fast = symbolData[item].fast;\n                    var slow = symbolData[item].slow;\n\n                    Assert.IsTrue(fast.IsReady.IsTrue());\n                    Assert.NotZero(((PyObject)fast.Samples).GetAndDispose<int>());\n\n                    Assert.IsTrue(slow.IsReady.IsTrue());\n                    Assert.NotZero(((PyObject)slow.Samples).GetAndDispose<int>());\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/InsightCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.Framework.Alphas;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class InsightCollectionTests\n    {\n        private static readonly DateTime _referenceTime = new DateTime(2019, 1, 1);\n\n        [Test]\n        public void InsightCollectionShouldBeAbleToBeConvertedToListWithoutStackOverflow()\n        {\n            var insightCollection = new InsightCollection\n            {\n                new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up)\n                {\n                    CloseTimeUtc = new DateTime(2019, 1, 1),\n                },\n                new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Volatility, InsightDirection.Up)\n                {\n                    CloseTimeUtc = new DateTime(2019, 1, 2),\n                }\n            };\n\n            Assert.DoesNotThrow(() => insightCollection.OrderBy(x => x.CloseTimeUtc).ToList());\n        }\n\n        [Test]\n        public void HasActiveInsights()\n        {\n            var collection = new InsightCollection();\n\n            Assert.IsFalse(collection.HasActiveInsights(Symbols.AAPL, DateTime.MinValue));\n\n            collection.AddRange(GetTestInsight());\n\n            Assert.IsFalse(collection.HasActiveInsights(Symbols.AAPL, DateTime.MaxValue));\n\n            Assert.IsTrue(collection.HasActiveInsights(Symbols.AAPL, _referenceTime));\n        }\n\n        [Test]\n        public void GetNextExpiryTime()\n        {\n            var collection = new InsightCollection();\n\n            Assert.AreEqual(null, collection.GetNextExpiryTime());\n\n            collection.AddRange(GetTestInsight());\n\n            Assert.AreEqual(_referenceTime, collection.GetNextExpiryTime());\n\n            var nextDay = _referenceTime.AddDays(1);\n            Assert.AreEqual(1, collection.RemoveExpiredInsights(nextDay).Count);\n            Assert.AreEqual(nextDay, collection.GetNextExpiryTime());\n        }\n\n        [Test]\n        public void TryGetValue()\n        {\n            var collection = new InsightCollection();\n\n            Assert.IsFalse(collection.TryGetValue(Symbols.AAPL, out var _));\n\n            collection.AddRange(GetTestInsight());\n            Assert.IsTrue(collection.TryGetValue(Symbols.AAPL, out var insights));\n\n            Assert.AreEqual(2, insights.Count);\n            Assert.AreEqual(2, insights.Count(insight => insight.Symbol == Symbols.AAPL));\n        }\n\n        [Test]\n        public void KeyNotFoundException()\n        {\n            var collection = new InsightCollection();\n            Assert.Throws<KeyNotFoundException>(() =>\n            {\n                var insight = collection[Symbols.AAPL];\n            });\n        }\n\n        [Test]\n        public void Contains()\n        {\n            var collection = new InsightCollection();\n            var insights = GetTestInsight();\n            collection.AddRange(insights);\n\n            foreach (var insight in insights)\n            {\n                Assert.IsTrue(collection.Contains(insight));\n                Assert.IsTrue(collection.ContainsKey(insight.Symbol));\n            }\n            Assert.IsFalse(collection.ContainsKey(Symbols.BTCEUR));\n\n            var anotherInsight = new Insight(Symbols.BTCEUR, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up);\n            Assert.IsFalse(collection.Contains(anotherInsight));\n        }\n\n        [Test]\n        public void Addition()\n        {\n            var collection = new InsightCollection();\n            var insight = new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = _referenceTime };\n            collection.Add(insight);\n            collection.Add(new Insight(Symbols.SPY, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = _referenceTime });\n            collection.Add(new Insight(Symbols.IBM, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Down) { CloseTimeUtc = _referenceTime.AddDays(-1) });\n\n            var beforeExpiration = insight.CloseTimeUtc.AddDays(-1);\n\n            Assert.AreEqual(3, collection.Count);\n            Assert.IsTrue(collection.TryGetValue(Symbols.AAPL, out var insightInCollection));\n            Assert.IsTrue(collection.HasActiveInsights(Symbols.AAPL, beforeExpiration));\n            Assert.AreEqual(insight, insightInCollection.Single());\n            Assert.AreEqual(insight, collection[Symbols.AAPL].Single());\n            Assert.AreEqual(3, collection.Count);\n            Assert.AreEqual(3, collection.GetActiveInsights(beforeExpiration).Count);\n            Assert.AreEqual(3, collection.GetInsights().Count);\n            Assert.AreEqual(insight, collection.GetInsights(x => insight == x).Single());\n            Assert.AreEqual(0, collection.GetActiveInsights(_referenceTime.AddYears(1)).Count);\n            Assert.AreEqual(3, collection.TotalCount);\n        }\n\n        [Test]\n        public void GetInsights()\n        {\n            var collection = new InsightCollection();\n            var insights = GetTestInsight();\n            collection.AddRange(insights);\n\n            Assert.AreEqual(5, collection.Count);\n\n            collection.RemoveInsights(x => x == insights[0]);\n            Assert.AreEqual(4, collection.GetInsights().Count);\n            Assert.AreEqual(4, collection.Count);\n        }\n\n        [Test]\n        public void Removal()\n        {\n            var collection = new InsightCollection();\n            var insights = GetTestInsight();\n            collection.AddRange(insights);\n\n            var insightCount = collection.Count;\n            foreach (var insight in insights)\n            {\n                Assert.IsTrue(collection.Remove(insight));\n                Assert.AreEqual(--insightCount, collection.Count);\n            }\n\n            // readd the first insight\n            var firstInsight = insights[0];\n            collection.Add(firstInsight);\n            Assert.AreEqual(1, collection.Count);\n\n            // we only remove 'firstInsight' from the global collection\n            collection.RemoveInsights(x => x == firstInsight);\n            Assert.AreEqual(4, collection.GetInsights().Count);\n            Assert.AreEqual(0, collection.Count);\n            Assert.AreEqual(6, collection.TotalCount);\n        }\n\n        [Test]\n        public void ExpiredRemoval()\n        {\n            var collection = new InsightCollection();\n            var insights = GetTestInsight();\n            collection.AddRange(insights);\n\n            Assert.AreEqual(5, collection.Count);\n            Assert.AreEqual(0, collection.RemoveExpiredInsights(_referenceTime.AddDays(-1)).Count);\n\n            // expire 1 insight\n            Assert.AreEqual(insights[0], collection.RemoveExpiredInsights(_referenceTime.AddDays(1)).Single());\n\n            // expire 2 insights\n            Assert.AreEqual(2, collection.RemoveExpiredInsights(_referenceTime.AddDays(2)).Count);\n            Assert.AreEqual(2, collection.Count);\n            Assert.AreEqual(5, collection.TotalCount);\n        }\n\n        [Test]\n        public void IndexAccess()\n        {\n            var collection = new InsightCollection();\n            collection.AddRange(GetTestInsight());\n\n            collection[Symbols.AAPL] = null;\n            Assert.AreEqual(3, collection.Count);\n\n            var insight = new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = new DateTime(2019, 1, 1) };\n            var insight2 = new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = new DateTime(2019, 1, 2) };\n            collection[Symbols.AAPL] = new() { insight, insight2 };\n            Assert.AreEqual(5, collection.Count);\n\n            collection[Symbols.AAPL] = null;\n            Assert.AreEqual(3, collection.Count);\n\n            Assert.AreEqual(7, collection.TotalCount);\n        }\n\n        [Test]\n        public void AddRange()\n        {\n            var collection = new InsightCollection();\n            var insights = GetTestInsight();\n            collection.AddRange(insights);\n\n            Assert.AreEqual(5, collection.Count);\n\n            foreach (var insight in insights)\n            {\n                Assert.IsTrue(collection.Contains(insight));\n                Assert.IsTrue(collection.ContainsKey(insight.Symbol));\n            }\n            Assert.AreEqual(5, collection.TotalCount);\n        }\n\n        [Test]\n        public void ClearSymbols()\n        {\n            var collection = new InsightCollection();\n            collection.AddRange(GetTestInsight());\n\n            collection.Clear(Array.Empty<Symbol>());\n            Assert.AreEqual(5, collection.Count);\n\n            collection.Clear(new[] { Symbols.AAPL });\n            Assert.AreEqual(3, collection.Count);\n            Assert.IsTrue(collection.ContainsKey(Symbols.SPY));\n            Assert.IsTrue(collection.ContainsKey(Symbols.IBM));\n            Assert.IsFalse(collection.ContainsKey(Symbols.AAPL));\n            Assert.AreEqual(5, collection.TotalCount);\n        }\n\n\n\n        private static List<Insight> GetTestInsight()\n        {\n            var insight = new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = _referenceTime };\n            var insight2 = new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = _referenceTime.AddDays(1) };\n            var insight3 = new Insight(Symbols.SPY, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up) { CloseTimeUtc = _referenceTime.AddDays(1) };\n\n            var insight4 = new Insight(Symbols.SPY, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Down) { CloseTimeUtc = _referenceTime.AddMonths(1) };\n            var insight5 = new Insight(Symbols.IBM, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Down) { CloseTimeUtc = _referenceTime.AddMonths(1) };\n\n            return new List<Insight> { insight, insight2, insight3, insight4, insight5 };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/InsightManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Alphas.Analysis;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class InsightManagerTests\n    {\n        private static readonly DateTime _utcNow = new (2019, 1, 1);\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ExpireSameTime(bool useCancelApi)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(_utcNow);\n            var insightManager = new InsightManager(algorithm);\n            insightManager.AddRange(GetInsights());\n\n            Assert.IsTrue(insightManager.All(insight => insight.IsActive(_utcNow)));\n\n            if (useCancelApi)\n            {\n                insightManager.Cancel(new[] { Symbols.IBM, Symbols.SPY });\n            }\n            else\n            {\n                insightManager.Expire(new[] { Symbols.IBM, Symbols.SPY });\n            }\n\n            Assert.IsTrue(insightManager[Symbols.IBM].All(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == TimeSpan.FromSeconds(-1)));\n            Assert.IsTrue(insightManager[Symbols.SPY].All(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == TimeSpan.FromSeconds(-1)));\n            Assert.IsTrue(insightManager[Symbols.AAPL].All(insight => insight.IsActive(algorithm.UtcTime)));\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ExpireBySymbol(bool useCancelApi)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(_utcNow);\n            var insightManager = new InsightManager(algorithm);\n            insightManager.AddRange(GetInsights());\n\n            Assert.IsTrue(insightManager.All(insight => insight.IsActive(_utcNow)));\n\n            algorithm.SetDateTime(algorithm.UtcTime.AddMinutes(1));\n            if (useCancelApi)\n            {\n                insightManager.Cancel(new[] { Symbols.IBM, Symbols.SPY });\n            }\n            else\n            {\n                insightManager.Expire(new[] { Symbols.IBM, Symbols.SPY });\n            }\n\n            var expectedPeriod = Time.OneMinute.Subtract(Time.OneSecond);\n            Assert.IsTrue(insightManager[Symbols.IBM].All(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == expectedPeriod));\n            Assert.IsTrue(insightManager[Symbols.SPY].All(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == expectedPeriod));\n            Assert.IsTrue(insightManager[Symbols.AAPL].All(insight => insight.IsActive(algorithm.UtcTime)));\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ExpireByInsight(bool useCancelApi)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(_utcNow);\n            var insights = GetInsights();\n            var insightManager = new InsightManager(algorithm);\n            insightManager.AddRange(insights);\n\n            Assert.IsTrue(insightManager.All(insight => insight.IsActive(_utcNow)));\n\n            algorithm.SetDateTime(algorithm.UtcTime.AddMinutes(1));\n            if (useCancelApi)\n            {\n                insightManager.Cancel(new[] { insights[2], insights[3] });\n            }\n            else\n            {\n                insightManager.Expire(new[] { insights[2], insights[3] });\n            }\n\n            var expectedPeriod = Time.OneMinute.Subtract(Time.OneSecond);\n            Assert.IsTrue(insightManager[Symbols.IBM].All(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == expectedPeriod));\n            Assert.AreEqual(1, insightManager[Symbols.SPY].Count(insight => insight.IsExpired(algorithm.UtcTime) && insight.Period == expectedPeriod));\n            Assert.AreEqual(1, insightManager[Symbols.SPY].Count(insight => insight.IsActive(algorithm.UtcTime)));\n            Assert.IsTrue(insightManager[Symbols.AAPL].All(insight => insight.IsActive(algorithm.UtcTime)));\n        }\n\n        private static Insight[] GetInsights()\n        {\n            return new[] {\n                new Insight(Symbols.AAPL, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up)\n                {\n                    GeneratedTimeUtc = _utcNow,\n                    CloseTimeUtc = _utcNow.AddDays(1),\n                },\n                new Insight(Symbols.SPY, new TimeSpan(2, 0, 0, 0), InsightType.Volatility, InsightDirection.Up)\n                {\n                    GeneratedTimeUtc = _utcNow,\n                    CloseTimeUtc = _utcNow.AddDays(2),\n                },\n                new Insight(Symbols.SPY, new TimeSpan(3, 0, 0, 0), InsightType.Volatility, InsightDirection.Up)\n                {\n                    GeneratedTimeUtc = _utcNow,\n                    CloseTimeUtc = _utcNow.AddDays(3),\n                },\n                new Insight(Symbols.IBM, new TimeSpan(4, 0, 0, 0), InsightType.Volatility, InsightDirection.Up)\n                {\n                    GeneratedTimeUtc = _utcNow,\n                    CloseTimeUtc = _utcNow.AddDays(4),\n                } };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/MacdAlphaModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class MacdAlphaModelTests : CommonAlphaModelTests\n    {\n        protected override IAlphaModel CreateCSharpAlphaModel() => new MacdAlphaModel();\n\n        protected override IAlphaModel CreatePythonAlphaModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic model = Py.Import(\"MacdAlphaModel\").GetAttr(\"MacdAlphaModel\");\n                var instance = model();\n                return new AlphaModelPythonWrapper(instance);\n            }\n        }\n\n        protected override IEnumerable<Insight> ExpectedInsights()\n        {\n            var period = TimeSpan.FromDays(12);\n            return new[]\n            {\n                Insight.Price(Symbols.SPY, period, InsightDirection.Up),\n                Insight.Price(Symbols.SPY, period, InsightDirection.Down),\n                Insight.Price(Symbols.SPY, period, InsightDirection.Up)\n            };\n        }\n\n        protected override string GetExpectedModelName(IAlphaModel model)\n        {\n            return $\"{nameof(MacdAlphaModel)}(12,26,9,Exponential,Daily)\";\n        }\n\n        [Test]\n        public void MacdAlphaModelWarmsUpProperly()\n        {\n            SetUpHistoryProvider();\n            Algorithm.SetStartDate(2013, 10, 08);\n\n            // Create a MacdAlphaModel for the test\n            var model = new TestMacdAlphaModel();\n\n            // Set the alpha model\n            Algorithm.SetAlpha(model);\n            Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n            Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n            // Get the dictionary of macd indicators\n            var symbolData = model.GetSymbolData();\n\n            // Check the symbolData dictionary is not empty\n            Assert.NotZero(symbolData.Count);\n\n            // Check all MACD indicators from the alpha are ready and have at least\n            // one datapoint\n            foreach (var item in symbolData)\n            {\n                var macd = item.Value.MACD;\n\n                Assert.IsTrue(macd.IsReady);\n                Assert.NotZero(macd.Samples);\n            }\n        }\n\n        [Test]\n        public void PythonMacdAlphaModelWarmsUpProperly()\n        {\n            using (Py.GIL())\n            {\n                SetUpHistoryProvider();\n                Algorithm.SetStartDate(2013, 10, 08);\n                Algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n                // Create and set alpha model\n                dynamic model = Py.Import(\"MacdAlphaModel\").GetAttr(\"MacdAlphaModel\");\n                var instance = model();\n                Algorithm.SetAlpha(instance);\n\n                var changes = SecurityChangesTests.CreateNonInternal(AddedSecurities, RemovedSecurities);\n                Algorithm.OnFrameworkSecuritiesChanged(changes);\n\n                // Get the dictionary of macd indicators\n                var symbolData = instance.symbolData;\n\n                // Check the dictionary is not empty\n                Assert.NotZero(symbolData.Length());\n\n                // Check all MACD indicators from the alpha are ready and have at least\n                // one datapoint\n                foreach (var item in symbolData)\n                {\n                    var macd = symbolData[item].MACD;\n\n                    Assert.IsTrue(macd.IsReady.IsTrue());\n                    Assert.NotZero(((PyObject)macd.Samples).GetAndDispose<int>());\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/RsiAlphaModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    [TestFixture]\n    public class RsiAlphaModelTests : CommonAlphaModelTests\n    {\n        protected override IAlphaModel CreateCSharpAlphaModel() => new RsiAlphaModel();\n\n        protected override IAlphaModel CreatePythonAlphaModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic model = Py.Import(\"RsiAlphaModel\").GetAttr(\"RsiAlphaModel\");\n                var instance = model();\n                return new AlphaModelPythonWrapper(instance);\n            }\n        }\n\n        protected override IEnumerable<Insight> ExpectedInsights()\n        {\n            var period = TimeSpan.FromDays(14);\n            foreach (var direction in new[] { InsightDirection.Up, InsightDirection.Down })\n            {\n                yield return Insight.Price(Symbols.SPY, period, direction);\n            }\n        }\n\n        protected override string GetExpectedModelName(IAlphaModel model)\n        {\n            return $\"{nameof(RsiAlphaModel)}(14,Daily)\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/Serialization/InsightJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Serialization;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Alphas.Serialization;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas.Serialization\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class InsightJsonConverterTests\n    {\n        private JsonSerializerSettings _serializerSettings = new()\n        {\n            ContractResolver = new DefaultContractResolver\n            {\n                NamingStrategy = new CamelCaseNamingStrategy\n                {\n                    ProcessDictionaryKeys = false,\n                    OverrideSpecifiedNames = true\n                }\n            }\n        };\n\n        [Test]\n        public void DeserializesInsightWithoutScore()\n        {\n            var jObject = JObject.Parse(jsonNoScoreBackwardsCompatible);\n            var result = JsonConvert.DeserializeObject<Insight>(jsonNoScoreBackwardsCompatible);\n            Assert.AreEqual(jObject[\"id\"].Value<string>(), result.Id.ToStringInvariant(\"N\"));\n            Assert.AreEqual(jObject[\"source-model\"].Value<string>(), result.SourceModel);\n            Assert.AreEqual(jObject[\"group-id\"]?.Value<string>(), result.GroupId?.ToStringInvariant(\"N\"));\n            Assert.AreEqual(jObject[\"created-time\"].Value<double>(), Time.DateTimeToUnixTimeStamp(result.GeneratedTimeUtc), 5e-4);\n            Assert.AreEqual(jObject[\"close-time\"].Value<double>(), Time.DateTimeToUnixTimeStamp(result.CloseTimeUtc), 5e-4);\n            Assert.AreEqual(jObject[\"symbol\"].Value<string>(), result.Symbol.ID.ToString());\n            Assert.AreEqual(jObject[\"ticker\"].Value<string>(), result.Symbol.Value);\n            Assert.AreEqual(jObject[\"type\"].Value<string>(), result.Type.ToLower());\n            Assert.AreEqual(jObject[\"reference\"].Value<decimal>(), result.ReferenceValue);\n            Assert.AreEqual(jObject[\"direction\"].Value<string>(), result.Direction.ToLower());\n            Assert.AreEqual(jObject[\"period\"].Value<double>(), result.Period.TotalSeconds);\n            Assert.AreEqual(jObject[\"magnitude\"].Value<double>(), result.Magnitude);\n            Assert.AreEqual(null, result.Confidence);\n\n            // default values for scores\n            Assert.AreEqual(false, result.Score.IsFinalScore);\n            Assert.AreEqual(0, result.ReferenceValueFinal);\n            Assert.AreEqual(0, result.Score.Magnitude);\n            Assert.AreEqual(0, result.Score.Direction);\n        }\n\n        [Test]\n        public void DeserializesInsightWithScore()\n        {\n            var jObject = JObject.Parse(jsonWithScoreBackwardsCompatible);\n            var result = JsonConvert.DeserializeObject<Insight>(jsonWithScoreBackwardsCompatible);\n            Assert.AreEqual(jObject[\"id\"].Value<string>(), result.Id.ToStringInvariant(\"N\"));\n            Assert.AreEqual(jObject[\"source-model\"].Value<string>(), result.SourceModel);\n            Assert.AreEqual(jObject[\"group-id\"]?.Value<string>(), result.GroupId?.ToStringInvariant(\"N\"));\n            Assert.AreEqual(jObject[\"created-time\"].Value<double>(), Time.DateTimeToUnixTimeStamp(result.GeneratedTimeUtc), 5e-4);\n            Assert.AreEqual(jObject[\"close-time\"].Value<double>(), Time.DateTimeToUnixTimeStamp(result.CloseTimeUtc), 5e-4);\n            Assert.AreEqual(jObject[\"symbol\"].Value<string>(), result.Symbol.ID.ToString());\n            Assert.AreEqual(jObject[\"ticker\"].Value<string>(), result.Symbol.Value);\n            Assert.AreEqual(jObject[\"type\"].Value<string>(), result.Type.ToLower());\n            Assert.AreEqual(jObject[\"reference\"].Value<decimal>(), result.ReferenceValue);\n            Assert.AreEqual(jObject[\"direction\"].Value<string>(), result.Direction.ToLower());\n            Assert.AreEqual(jObject[\"period\"].Value<double>(), result.Period.TotalSeconds);\n            Assert.AreEqual(jObject[\"magnitude\"].Value<double>(), result.Magnitude);\n            Assert.AreEqual(null, result.Confidence);\n            Assert.AreEqual(true, result.Score.IsFinalScore);\n            Assert.AreEqual(jObject[\"score-magnitude\"].Value<double>(), result.Score.Magnitude);\n            Assert.AreEqual(jObject[\"score-direction\"].Value<double>(), result.Score.Direction);\n            Assert.AreEqual(jObject[\"reference-final\"].Value<decimal>(), result.ReferenceValueFinal);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SerializesInsightWithoutScore(bool backwardsCompatible)\n        {\n            var serializedInsight = JsonConvert.DeserializeObject<SerializedInsight>(backwardsCompatible ? jsonNoScoreBackwardsCompatible : jsonNoScore2);\n            var insight = Insight.FromSerializedInsight(serializedInsight);\n            var result = JsonConvert.SerializeObject(insight, Formatting.None, _serializerSettings);\n            Assert.AreEqual(jsonNoScore2, result);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SerializesInsightWithScore(bool backwardsCompatible)\n        {\n            var serializedInsight = JsonConvert.DeserializeObject<SerializedInsight>(backwardsCompatible ? jsonWithScoreBackwardsCompatible : jsonWithScore);\n            var insight = Insight.FromSerializedInsight(serializedInsight);\n            var result = JsonConvert.SerializeObject(insight, Formatting.None, _serializerSettings);\n            Assert.AreEqual(jsonWithScore, result);\n        }\n\n        [Test]\n        public void SerializesOldInsightWithMissingCreatedTime()\n        {\n            var serializedInsight = JsonConvert.DeserializeObject<SerializedInsight>(jsonWithMissingCreatedTimeBackwardsCompatible);\n            var insight = Insight.FromSerializedInsight(serializedInsight);\n            var result = JsonConvert.SerializeObject(insight, Formatting.None, _serializerSettings);\n\n            Assert.AreEqual(serializedInsight.CreatedTime, serializedInsight.GeneratedTime);\n            Assert.AreEqual(jsonWithExpectedOutputFromMissingCreatedTimeValue, result);\n        }\n\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SerializesInsightWithTag(bool backwardsCompatible)\n        {\n            var serializedInsight = JsonConvert.DeserializeObject<SerializedInsight>(backwardsCompatible ? jsonWithTagBackwardsCompatible : jsonWithTag);\n            var insight = Insight.FromSerializedInsight(serializedInsight);\n            var result = JsonConvert.SerializeObject(insight, Formatting.None, _serializerSettings);\n            Assert.AreEqual(jsonWithTag, result);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SerializesInsightWithoutTag(bool backwardsCompatible)\n        {\n            var serializedInsight = JsonConvert.DeserializeObject<SerializedInsight>(backwardsCompatible ? jsonWithoutTagBackwardsCompatible : jsonWithoutTag);\n            var insight = Insight.FromSerializedInsight(serializedInsight);\n            var result = JsonConvert.SerializeObject(insight, Formatting.None, _serializerSettings);\n            Assert.AreEqual(jsonWithoutTag, result);\n        }\n\n        [Test]\n        public void DeserializesInsightWithTag()\n        {\n            var jObject = JObject.Parse(jsonWithTagBackwardsCompatible);\n            var result = JsonConvert.DeserializeObject<Insight>(jsonWithTagBackwardsCompatible);\n            Assert.AreEqual(jObject[\"tag\"].Value<string>(), result.Tag);\n        }\n\n        [Test]\n        public void DeserializesInsightWithoutTag()\n        {\n            var result = JsonConvert.DeserializeObject<Insight>(jsonWithoutTagBackwardsCompatible);\n            Assert.IsNull(result.Tag);\n        }\n\n        private string jsonNoScore2 = @\"{\"\"id\"\":\"\"e02be50f56a8496b9ba995d19a904ada\"\",\"\"groupId\"\":null,\"\"sourceModel\"\":\"\"mySourceModel-1\"\",\"\"generatedTime\"\":1520711961.00055,\n\"\"createdTime\"\":1520711961.00055,\"\"closeTime\"\":1520711961.00055,\"\"symbol\"\":\"\"BTCUSD XJ\"\",\"\"ticker\"\":\"\"BTCUSD\"\",\"\"type\"\":\"\"price\"\",\"\"reference\"\":9143.53,\"\"referenceValueFinal\"\":0.0,\n\"\"direction\"\":\"\"up\"\",\"\"period\"\":5.0,\"\"magnitude\"\":\"\"0.025\"\",\"\"confidence\"\":null,\"\"weight\"\":null,\"\"scoreIsFinal\"\":false,\"\"scoreMagnitude\"\":\"\"0\"\",\"\"scoreDirection\"\":\"\"0\"\",\n\"\"estimatedValue\"\":\"\"0\"\",\"\"tag\"\":null}\".ReplaceLineEndings(string.Empty);\n\n        private const string jsonNoScoreBackwardsCompatible =\n            \"{\" +\n            \"\\\"id\\\":\\\"e02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"group-id\\\":null,\" +\n            \"\\\"source-model\\\":\\\"mySourceModel-1\\\",\" +\n            \"\\\"generated-time\\\":1520711961.00055,\" +\n            \"\\\"created-time\\\":1520711961.00055,\" +\n            \"\\\"close-time\\\":1520711961.00055,\" +\n            \"\\\"symbol\\\":\\\"BTCUSD XJ\\\",\" +\n            \"\\\"ticker\\\":\\\"BTCUSD\\\",\" +\n            \"\\\"type\\\":\\\"price\\\",\" +\n            \"\\\"reference\\\":9143.53,\" +\n            \"\\\"reference-final\\\":0.0,\" +\n            \"\\\"direction\\\":\\\"up\\\",\" +\n            \"\\\"period\\\":5.0,\" +\n            \"\\\"magnitude\\\":\\\"0.025\\\",\" +\n            \"\\\"confidence\\\":null,\" +\n            \"\\\"weight\\\":null,\" +\n            \"\\\"score-final\\\":false,\" +\n            \"\\\"score-magnitude\\\":\\\"0\\\",\" +\n            \"\\\"score-direction\\\":\\\"0\\\",\" +\n            \"\\\"estimated-value\\\":\\\"0\\\",\" +\n            \"\\\"tag\\\":null}\";\n\n        private string jsonWithScore = @\"{\"\"id\"\":\"\"e02be50f56a8496b9ba995d19a904ada\"\",\"\"groupId\"\":\"\"a02be50f56a8496b9ba995d19a904ada\"\",\"\"sourceModel\"\":\"\"mySourceModel-1\"\",\n\"\"generatedTime\"\":1520711961.00055,\"\"createdTime\"\":1520711961.00055,\"\"closeTime\"\":1520711961.00055,\"\"symbol\"\":\"\"BTCUSD XJ\"\",\"\"ticker\"\":\"\"BTCUSD\"\",\"\"type\"\":\"\"price\"\",\n\"\"reference\"\":9143.53,\"\"referenceValueFinal\"\":9243.53,\"\"direction\"\":\"\"up\"\",\"\"period\"\":5.0,\"\"magnitude\"\":\"\"0.025\"\",\"\"confidence\"\":null,\"\"weight\"\":null,\n\"\"scoreIsFinal\"\":true,\"\"scoreMagnitude\"\":\"\"1\"\",\"\"scoreDirection\"\":\"\"1\"\",\"\"estimatedValue\"\":\"\"1113.2484\"\",\"\"tag\"\":null}\".ReplaceLineEndings(string.Empty);\n        private const string jsonWithScoreBackwardsCompatible =\n            \"{\" +\n            \"\\\"id\\\":\\\"e02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"group-id\\\":\\\"a02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"source-model\\\":\\\"mySourceModel-1\\\",\" +\n            \"\\\"generated-time\\\":1520711961.00055,\" +\n            \"\\\"created-time\\\":1520711961.00055,\" +\n            \"\\\"close-time\\\":1520711961.00055,\" +\n            \"\\\"symbol\\\":\\\"BTCUSD XJ\\\",\" +\n            \"\\\"ticker\\\":\\\"BTCUSD\\\",\" +\n            \"\\\"type\\\":\\\"price\\\",\" +\n            \"\\\"reference\\\":9143.53,\" +\n            \"\\\"reference-final\\\":9243.53,\" +\n            \"\\\"direction\\\":\\\"up\\\",\" +\n            \"\\\"period\\\":5.0,\" +\n            \"\\\"magnitude\\\":\\\"0.025\\\",\" +\n            \"\\\"confidence\\\":null,\" +\n            \"\\\"weight\\\":null,\" +\n            \"\\\"score-final\\\":true,\" +\n            \"\\\"score-magnitude\\\":\\\"1\\\",\" +\n            \"\\\"score-direction\\\":\\\"1\\\",\" +\n            \"\\\"estimated-value\\\":\\\"1113.2484\\\",\" +\n            \"\\\"tag\\\":null}\";\n\n        private const string jsonWithMissingCreatedTimeBackwardsCompatible =\n            \"{\" +\n            \"\\\"id\\\":\\\"e02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"group-id\\\":\\\"a02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"source-model\\\":\\\"mySourceModel-1\\\",\" +\n            \"\\\"generated-time\\\":1520711961.00055,\" +\n            \"\\\"close-time\\\":1520711961.00055,\" +\n            \"\\\"symbol\\\":\\\"BTCUSD XJ\\\",\" +\n            \"\\\"ticker\\\":\\\"BTCUSD\\\",\" +\n            \"\\\"type\\\":\\\"price\\\",\" +\n            \"\\\"reference\\\":9143.53,\" +\n            \"\\\"reference-final\\\":9243.53,\" +\n            \"\\\"direction\\\":\\\"up\\\",\" +\n            \"\\\"period\\\":5.0,\" +\n            \"\\\"magnitude\\\":0.025,\" +\n            \"\\\"confidence\\\":null,\" +\n            \"\\\"weight\\\":null,\" +\n            \"\\\"score-final\\\":true,\" +\n            \"\\\"score-magnitude\\\":\\\"1\\\",\" +\n            \"\\\"score-direction\\\":\\\"1\\\",\" +\n            \"\\\"estimated-value\\\":\\\"1113.2484\\\",\" +\n            \"\\\"tag\\\":null}\";\n\n        private string jsonWithExpectedOutputFromMissingCreatedTimeValue = @\"{\"\"id\"\":\"\"e02be50f56a8496b9ba995d19a904ada\"\",\"\"groupId\"\":\"\"a02be50f56a8496b9ba995d19a904ada\"\",\n\"\"sourceModel\"\":\"\"mySourceModel-1\"\",\"\"generatedTime\"\":1520711961.00055,\"\"createdTime\"\":1520711961.00055,\"\"closeTime\"\":1520711961.00055,\"\"symbol\"\":\"\"BTCUSD XJ\"\",\"\"ticker\"\":\n\"\"BTCUSD\"\",\"\"type\"\":\"\"price\"\",\"\"reference\"\":9143.53,\"\"referenceValueFinal\"\":9243.53,\"\"direction\"\":\"\"up\"\",\"\"period\"\":5.0,\"\"magnitude\"\":\"\"0.025\"\",\"\"confidence\"\":null,\n\"\"weight\"\":null,\"\"scoreIsFinal\"\":true,\"\"scoreMagnitude\"\":\"\"1\"\",\"\"scoreDirection\"\":\"\"1\"\",\"\"estimatedValue\"\":\"\"1113.2484\"\",\"\"tag\"\":null}\".ReplaceLineEndings(string.Empty);\n\n        private string jsonWithTag = @\"{\"\"id\"\":\"\"e02be50f56a8496b9ba995d19a904ada\"\",\"\"groupId\"\":\"\"a02be50f56a8496b9ba995d19a904ada\"\",\"\"sourceModel\"\":\"\"mySourceModel-1\"\",\n\"\"generatedTime\"\":1520711961.00055,\"\"createdTime\"\":1520711961.00055,\"\"closeTime\"\":1520711961.00055,\"\"symbol\"\":\"\"BTCUSD XJ\"\",\"\"ticker\"\":\"\"BTCUSD\"\",\"\"type\"\":\n\"\"price\"\",\"\"reference\"\":9143.53,\"\"referenceValueFinal\"\":9243.53,\"\"direction\"\":\"\"up\"\",\"\"period\"\":5.0,\"\"magnitude\"\":null,\"\"confidence\"\":null,\"\"weight\"\":null,\n\"\"scoreIsFinal\"\":true,\"\"scoreMagnitude\"\":\"\"1\"\",\"\"scoreDirection\"\":\"\"1\"\",\"\"estimatedValue\"\":\"\"1113.2484\"\",\"\"tag\"\":\"\"additional information\"\"}\".ReplaceLineEndings(string.Empty);\n        private const string jsonWithTagBackwardsCompatible =\n            \"{\" +\n            \"\\\"id\\\":\\\"e02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"group-id\\\":\\\"a02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"source-model\\\":\\\"mySourceModel-1\\\",\" +\n            \"\\\"generated-time\\\":1520711961.00055,\" +\n            \"\\\"created-time\\\":1520711961.00055,\" +\n            \"\\\"close-time\\\":1520711961.00055,\" +\n            \"\\\"symbol\\\":\\\"BTCUSD XJ\\\",\" +\n            \"\\\"ticker\\\":\\\"BTCUSD\\\",\" +\n            \"\\\"type\\\":\\\"price\\\",\" +\n            \"\\\"reference\\\":9143.53,\" +\n            \"\\\"reference-final\\\":9243.53,\" +\n            \"\\\"direction\\\":\\\"up\\\",\" +\n            \"\\\"period\\\":5.0,\" +\n            \"\\\"magnitude\\\":null,\" +\n            \"\\\"confidence\\\":null,\" +\n            \"\\\"weight\\\":null,\" +\n            \"\\\"score-final\\\":true,\" +\n            \"\\\"score-magnitude\\\":\\\"1\\\",\" +\n            \"\\\"score-direction\\\":\\\"1\\\",\" +\n            \"\\\"estimated-value\\\":\\\"1113.2484\\\",\" +\n            \"\\\"tag\\\":\\\"additional information\\\"}\";\n\n        private string jsonWithoutTag = @\"{\"\"id\"\":\"\"e02be50f56a8496b9ba995d19a904ada\"\",\"\"groupId\"\":\"\"a02be50f56a8496b9ba995d19a904ada\"\",\n\"\"sourceModel\"\":\"\"mySourceModel-1\"\",\"\"generatedTime\"\":1520711961.00055,\"\"createdTime\"\":1520711961.00055,\"\"closeTime\"\":1520711961.00055,\"\"symbol\"\":\"\"BTCUSD XJ\"\",\n\"\"ticker\"\":\"\"BTCUSD\"\",\"\"type\"\":\"\"price\"\",\"\"reference\"\":9143.53,\"\"referenceValueFinal\"\":9243.53,\"\"direction\"\":\"\"up\"\",\"\"period\"\":5.0,\"\"magnitude\"\":null,\n\"\"confidence\"\":null,\"\"weight\"\":null,\"\"scoreIsFinal\"\":true,\"\"scoreMagnitude\"\":\"\"1\"\",\"\"scoreDirection\"\":\"\"1\"\",\"\"estimatedValue\"\":\"\"1113.2484\"\",\"\"tag\"\":null}\".ReplaceLineEndings(string.Empty);\n\n        private const string jsonWithoutTagBackwardsCompatible =\n            \"{\" +\n            \"\\\"id\\\":\\\"e02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"group-id\\\":\\\"a02be50f56a8496b9ba995d19a904ada\\\",\" +\n            \"\\\"source-model\\\":\\\"mySourceModel-1\\\",\" +\n            \"\\\"generated-time\\\":1520711961.00055,\" +\n            \"\\\"created-time\\\":1520711961.00055,\" +\n            \"\\\"close-time\\\":1520711961.00055,\" +\n            \"\\\"symbol\\\":\\\"BTCUSD XJ\\\",\" +\n            \"\\\"ticker\\\":\\\"BTCUSD\\\",\" +\n            \"\\\"type\\\":\\\"price\\\",\" +\n            \"\\\"reference\\\":9143.53,\" +\n            \"\\\"reference-final\\\":9243.53,\" +\n            \"\\\"direction\\\":\\\"up\\\",\" +\n            \"\\\"period\\\":5.0,\" +\n            \"\\\"magnitude\\\":null,\" +\n            \"\\\"confidence\\\":null,\" +\n            \"\\\"weight\\\":null,\" +\n            \"\\\"score-final\\\":true,\" +\n            \"\\\"score-magnitude\\\":\\\"1\\\",\" +\n            \"\\\"score-direction\\\":\\\"1\\\",\" +\n            \"\\\"estimated-value\\\":\\\"1113.2484\\\",\" +\n            \"\\\"tag\\\":null}\";\n    }\n\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/TestEmaCrossAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    class TestEmaCrossAlphaModel : EmaCrossAlphaModel\n    {\n        /// <summary>\n        /// Get the _symbolDataBySymbol dictionary from EmaCrossAlphaModel\n        /// </summary>\n        /// <returns>_symbolDataBySymbol dictionary from EmaCrossAlphaModel</returns>\n        public Dictionary<Symbol, SymbolData> GetSymbolData()\n        {\n            return SymbolDataBySymbol;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Alphas/TestMacdAlphaModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Alphas\n{\n    class TestMacdAlphaModel: MacdAlphaModel\n    {\n        /// <summary>\n        /// Get the _symbolData dictionary from MacdAlphaModel\n        /// </summary>\n        /// <returns>_symbolData dictionary from MacdAlphaModel</returns>\n        public Dictionary<Symbol, SymbolData> GetSymbolData()\n        {\n            return _symbolData;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Execution/ImmediateExecutionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Execution\n{\n    [TestFixture]\n    public class ImmediateExecutionModelTests\n    {\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OrdersAreNotSubmittedWhenNoTargetsToExecute(Language language)\n        {\n            var actualOrdersSubmitted = new List<SubmitOrderRequest>();\n\n            var orderProcessor = new Mock<IOrderProcessor>();\n            orderProcessor.Setup(m => m.Process(It.IsAny<SubmitOrderRequest>()))\n                .Returns((OrderTicket)null)\n                .Callback((OrderRequest request) => actualOrdersSubmitted.Add((SubmitOrderRequest)request));\n\n            var algorithm = new AlgorithmStub();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor.Object);\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n            model.OnSecuritiesChanged(algorithm, changes);\n\n            model.Execute(algorithm, new IPortfolioTarget[0]);\n\n            Assert.AreEqual(0, actualOrdersSubmitted.Count);\n        }\n\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 0, 1, 10)]\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 3, 1, 7)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 0, 1, 10)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 3, 1, 7)]\n        public void OrdersAreSubmittedImmediatelyForTargetsToExecute(\n            Language language,\n            double[] historicalPrices,\n            decimal openOrdersQuantity,\n            int expectedOrdersSubmitted,\n            decimal expectedTotalQuantity)\n        {\n            var time = new DateTime(2018, 8, 2, 16, 0, 0);\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(m => m.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(historicalPrices.Select((x, i) =>\n                    new Slice(time.AddMinutes(i),\n                        new List<BaseData>\n                        {\n                            new TradeBar\n                            {\n                                Time = time.AddMinutes(i),\n                                Symbol = Symbols.AAPL,\n                                Open = Convert.ToDecimal(x),\n                                High = Convert.ToDecimal(x),\n                                Low = Convert.ToDecimal(x),\n                                Close = Convert.ToDecimal(x),\n                                Volume = 100m\n                            }\n                        }, time.AddMinutes(i))));\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetHistoryProvider(historyProvider.Object);\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var openOrderRequest = new SubmitOrderRequest(OrderType.Market, SecurityType.Equity, Symbols.AAPL, openOrdersQuantity, 0, 0, DateTime.MinValue, \"\");\n                openOrderRequest.SetOrderId(1);\n                var order = Order.CreateOrder(openOrderRequest);\n                orderProcessor.AddOpenOrder(order, algorithm);\n\n                var model = GetExecutionModel(language, false);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                Assert.AreEqual(expectedOrdersSubmitted + 1, orderProcessor.GetOpenOrders().Count);\n\n                var executionOrder = orderProcessor.GetOpenOrders().OrderByDescending(o => o.Id).First();\n                Assert.AreEqual(expectedTotalQuantity, executionOrder.Quantity);\n                Assert.AreEqual(algorithm.UtcTime, executionOrder.Time);\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void PartiallyFilledOrdersAreTakenIntoAccount(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var openOrderRequest = new SubmitOrderRequest(OrderType.Market, SecurityType.Equity, Symbols.AAPL, 100, 0, 0, DateTime.MinValue, \"\");\n                openOrderRequest.SetOrderId(1);\n                var order = Order.CreateOrder(openOrderRequest);\n                orderProcessor.AddOpenOrder(order, algorithm);\n\n                brokerage.OnOrderEvent(new OrderEvent(order.Id, order.Symbol, DateTime.MinValue, OrderStatus.PartiallyFilled, OrderDirection.Buy, 250, 70, OrderFee.Zero));\n\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 80) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                Assert.AreEqual(2, orderProcessor.OrdersCount);\n\n                // Remaining quantity for partially filled order = 100 - 70 = 30\n                // Holdings from partially filled order = 70\n                // Quantity submitted = target - holdings - remaining open orders quantity = 80 - 70 - 30 = -20\n                Assert.AreEqual(-20, orderProcessor.GetOpenOrders().OrderByDescending(o => o.Id).First().Quantity);\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void NonFilledAsyncOrdersAreTakenIntoAccount(Language language)\n        {\n            var algorithm = new AlgorithmStub();\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language, true);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targetQuantity = 80;\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, targetQuantity) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                Assert.AreEqual(1, orderProcessor.OrdersCount);\n\n                // Quantity submitted = 80\n                Assert.AreEqual(targetQuantity, orderProcessor.GetOpenOrders().First().Quantity);\n\n                var newTargetQuantity = 100;\n                var newTargets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, newTargetQuantity) };\n                model.Execute(algorithm, newTargets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                Assert.AreEqual(2, orderProcessor.OrdersCount);\n\n                // Remaining quantity for non-filled order = targetQuantity = 80\n                // Quantity submitted = newTargetQuantity - targetQuantity = 100 - 80 = 20\n                Assert.AreEqual(newTargetQuantity - targetQuantity, orderProcessor.GetOpenOrders().OrderByDescending(o => o.Id).First().Quantity);\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp, -1)]\n        [TestCase(Language.Python, -1)]\n        [TestCase(Language.CSharp, 1)]\n        [TestCase(Language.Python, 1)]\n        public void LotSizeIsRespected(Language language, int side)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.Settings.MinimumOrderMarginPortfolioPercentage = 0;\n            var security = algorithm.AddForex(Symbols.EURUSD.Value);\n            algorithm.Portfolio.SetCash(\"EUR\", 1, 1);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                model.Execute(algorithm,\n                    new IPortfolioTarget[] { new PortfolioTarget(Symbols.EURUSD, security.SymbolProperties.LotSize * 1.5m * side) });\n                orderProcessor.ProcessSynchronousEvents();\n\n                var orders = orderProcessor.GetOrders().ToList();\n                Assert.AreEqual(1, orders.Count);\n                Assert.AreEqual(security.SymbolProperties.LotSize * side, orders.Single().Quantity);\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [Test]\n        public void CustomPythonExecutionModelDoesNotRequireOnOrderEventMethod()\n        {\n            using var _ = Py.GIL();\n            const string pythonCode = @\"\nclass CustomExecutionModel:\n    def execute(self, algorithm, targets):\n        pass\n    def on_securities_changed(self, algorithm, changes):\n        pass\n\";\n            using var module = PyModule.FromString(\"CustomExecutionModelModule\", pythonCode);\n            using var instance = module.GetAttr(\"CustomExecutionModel\").Invoke();\n            var model = new ExecutionModelPythonWrapper(instance);\n            Assert.DoesNotThrow(() => model.OnOrderEvent(new AlgorithmStub(), new OrderEvent()));\n        }\n\n        private static IExecutionModel GetExecutionModel(Language language, bool asynchronous = false)\n        {\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(ImmediateExecutionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(asynchronous);\n                    return new ExecutionModelPythonWrapper(instance);\n                }\n            }\n\n            return new ImmediateExecutionModel(asynchronous);\n        }\n\n\n        internal static BrokerageTransactionHandler GetAndSetBrokerageTransactionHandler(IAlgorithm algorithm, out NullBrokerage brokerage)\n        {\n            brokerage = new NullBrokerage();\n            var orderProcessor = new BrokerageTransactionHandler();\n            orderProcessor.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n            algorithm.Transactions.MarketOrderFillTimeout = TimeSpan.Zero;\n\n            return orderProcessor;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Execution/SpreadExecutionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Execution\n{\n    [TestFixture]\n    public class SpreadExecutionModelTests\n    {\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OrdersAreNotSubmittedWhenNoTargetsToExecute(Language language)\n        {\n            var actualOrdersSubmitted = new List<SubmitOrderRequest>();\n\n            var orderProcessor = new Mock<IOrderProcessor>();\n            orderProcessor.Setup(m => m.Process(It.IsAny<SubmitOrderRequest>()))\n                .Returns((OrderTicket)null)\n                .Callback((OrderRequest request) => actualOrdersSubmitted.Add((SubmitOrderRequest)request));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.Transactions.SetOrderProcessor(orderProcessor.Object);\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n            model.OnSecuritiesChanged(algorithm, changes);\n\n            model.Execute(algorithm, new IPortfolioTarget[0]);\n\n            Assert.AreEqual(0, actualOrdersSubmitted.Count);\n        }\n\n        [TestCase(Language.CSharp, 240, 1, 10)]\n        [TestCase(Language.CSharp, 250, 0, 0)]\n        [TestCase(Language.Python, 240, 1, 10)]\n        [TestCase(Language.Python, 250, 0, 0)]\n        public void OrdersAreSubmittedWhenRequiredForTargetsToExecute(\n            Language language,\n            decimal currentPrice,\n            int expectedOrdersSubmitted,\n            decimal expectedTotalQuantity)\n        {\n            var time = new DateTime(2018, 8, 2, 14, 0, 0);\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n            // pushing the ask higher will cause the spread the widen and no trade to happen\n            var ask = expectedOrdersSubmitted == 0 ? currentPrice * 1.1m : currentPrice;\n            security.SetMarketPrice(new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.AAPL,\n                Ask = new Bar(ask, ask, ask, ask),\n                Bid = new Bar(currentPrice, currentPrice, currentPrice, currentPrice)\n            });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = ImmediateExecutionModelTests.GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                var orders = orderProcessor.GetOrders().ToList();\n\n                Assert.AreEqual(expectedOrdersSubmitted, orders.Count);\n                Assert.AreEqual(expectedTotalQuantity, orders.Sum(x => x.Quantity));\n\n                if (expectedOrdersSubmitted == 1)\n                {\n                    var order = orders[0];\n                    Assert.AreEqual(expectedTotalQuantity, order.Quantity);\n                    Assert.AreEqual(algorithm.UtcTime, order.Time);\n                }\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp, 1, 10, true)]\n        [TestCase(Language.Python, 1, 10, true)]\n        [TestCase(Language.CSharp, 0, 0, false)]\n        [TestCase(Language.Python, 0, 0, false)]\n        public void FillsOnTradesOnlyRespectingExchangeOpen(Language language, int expectedOrdersSubmitted, decimal expectedTotalQuantity, bool exchangeOpen)\n        {\n            var time = new DateTime(2018, 8, 2, 0, 0, 0);\n            if (exchangeOpen)\n            {\n                time = time.AddHours(14);\n            }\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = ImmediateExecutionModelTests.GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                var orders = orderProcessor.GetOrders().ToList();\n\n                Assert.AreEqual(expectedOrdersSubmitted, orders.Count);\n                Assert.AreEqual(expectedTotalQuantity, orders.Sum(x => x.Quantity));\n\n                if (expectedOrdersSubmitted == 1)\n                {\n                    var order = orders[0];\n                    Assert.AreEqual(expectedTotalQuantity, order.Quantity);\n                    Assert.AreEqual(algorithm.UtcTime, order.Time);\n                }\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp, MarketDataType.TradeBar)]\n        [TestCase(Language.Python, MarketDataType.TradeBar)]\n        [TestCase(Language.CSharp, MarketDataType.QuoteBar)]\n        [TestCase(Language.Python, MarketDataType.QuoteBar)]\n        public void OnSecuritiesChangeDoesNotThrow(\n            Language language,\n            MarketDataType marketDataType)\n        {\n            var time = new DateTime(2018, 8, 2, 16, 0, 0);\n\n            Func<double, int, BaseData> func = (x, i) =>\n            {\n                var price = Convert.ToDecimal(x);\n                switch (marketDataType)\n                {\n                    case MarketDataType.TradeBar:\n                        return new TradeBar(time.AddMinutes(i), Symbols.AAPL, price, price, price, price, 100m);\n                    case MarketDataType.QuoteBar:\n                        var bar = new Bar(price, price, price, price);\n                        return new QuoteBar(time.AddMinutes(i), Symbols.AAPL, bar, 10m, bar, 10m);\n                    default:\n                        throw new ArgumentException($\"Invalid MarketDataType: {marketDataType}\");\n                }\n            };\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n            algorithm.SetFinishedWarmingUp();\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n            Assert.DoesNotThrow(() => model.OnSecuritiesChanged(algorithm, changes));\n        }\n\n        private static IExecutionModel GetExecutionModel(Language language)\n        {\n            const decimal acceptingSpreadPercent = 0.005m;\n\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(SpreadExecutionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(acceptingSpreadPercent.ToPython());\n                    return new ExecutionModelPythonWrapper(instance);\n                }\n            }\n\n            return new SpreadExecutionModel(acceptingSpreadPercent);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Execution/StandardDeviationExecutionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Execution\n{\n    [TestFixture]\n    public class StandardDeviationExecutionModelTests\n    {\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OrdersAreNotSubmittedWhenNoTargetsToExecute(Language language)\n        {\n            var actualOrdersSubmitted = new List<SubmitOrderRequest>();\n\n            var orderProcessor = new Mock<IOrderProcessor>();\n            orderProcessor.Setup(m => m.Process(It.IsAny<SubmitOrderRequest>()))\n                .Returns((OrderTicket)null)\n                .Callback((OrderRequest request) => actualOrdersSubmitted.Add((SubmitOrderRequest)request));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.Transactions.SetOrderProcessor(orderProcessor.Object);\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n            model.OnSecuritiesChanged(algorithm, changes);\n\n            model.Execute(algorithm, new IPortfolioTarget[0]);\n\n            Assert.AreEqual(0, actualOrdersSubmitted.Count);\n        }\n\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 240, 1, 10)]\n        [TestCase(Language.CSharp, new[] { 250d, 250d, 250d }, 250, 0, 0)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 240, 1, 10)]\n        [TestCase(Language.Python, new[] { 250d, 250d, 250d }, 250, 0, 0)]\n        public void OrdersAreSubmittedWhenRequiredForTargetsToExecute(\n            Language language,\n            double[] historicalPrices,\n            decimal currentPrice,\n            int expectedOrdersSubmitted,\n            decimal expectedTotalQuantity)\n        {\n            var time = new DateTime(2018, 8, 2, 16, 0, 0);\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(m => m.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(historicalPrices.Select((x,i) =>\n                    new Slice(time.AddMinutes(i),\n                        new List<BaseData>\n                        {\n                            new TradeBar\n                            {\n                                Time = time.AddMinutes(i),\n                                Symbol = Symbols.AAPL,\n                                Open = Convert.ToDecimal(x),\n                                High = Convert.ToDecimal(x),\n                                Low = Convert.ToDecimal(x),\n                                Close = Convert.ToDecimal(x),\n                                Volume = 100m\n                            }\n                        }, time.AddMinutes(i))));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SetHistoryProvider(historyProvider.Object);\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = currentPrice });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = ImmediateExecutionModelTests.GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                var orders = orderProcessor.GetOrders().ToList();\n\n                Assert.AreEqual(expectedOrdersSubmitted, orders.Count);\n                Assert.AreEqual(expectedTotalQuantity, orders.Sum(x => x.Quantity));\n\n                if (expectedOrdersSubmitted == 1)\n                {\n                    var order = orders[0];\n                    Assert.AreEqual(expectedTotalQuantity, order.Quantity);\n                    Assert.AreEqual(algorithm.UtcTime, order.Time);\n                }\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage?.Dispose();\n            }\n        }\n\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, MarketDataType.TradeBar)]\n        [TestCase(Language.Python, new[] { 250d, 250d, 250d }, MarketDataType.TradeBar)]\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, MarketDataType.QuoteBar)]\n        [TestCase(Language.Python, new[] { 250d, 250d, 250d }, MarketDataType.QuoteBar)]\n        public void OnSecuritiesChangeDoesNotThrow(\n            Language language,\n            double[] historicalPrices,\n            MarketDataType marketDataType)\n        {\n            var time = new DateTime(2018, 8, 2, 16, 0, 0);\n\n            Func<double, int, BaseData> func = (x, i) =>\n            {\n                var price = Convert.ToDecimal(x);\n                switch (marketDataType)\n                {\n                    case MarketDataType.TradeBar:\n                        return new TradeBar(time.AddMinutes(i), Symbols.AAPL, price, price, price, price, 100m);\n                    case MarketDataType.QuoteBar:\n                        var bar = new Bar(price, price, price, price);\n                        return new QuoteBar(time.AddMinutes(i), Symbols.AAPL, bar, 10m, bar, 10m);\n                    default:\n                        throw new ArgumentException($\"Invalid MarketDataType: {marketDataType}\");\n                }\n            };\n\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(m => m.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(historicalPrices.Select((x, i) => new Slice(time.AddMinutes(i), new List<BaseData> { func(x, i) }, time.AddMinutes(i))));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.SetHistoryProvider(historyProvider.Object);\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n            algorithm.SetFinishedWarmingUp();\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n            Assert.DoesNotThrow(() => model.OnSecuritiesChanged(algorithm, changes));\n        }\n\n        private static IExecutionModel GetExecutionModel(Language language)\n        {\n            const int period = 2;\n            const decimal deviations = 1.5m;\n\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(StandardDeviationExecutionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(period.ToPython(), deviations.ToPython());\n                    return new ExecutionModelPythonWrapper(instance);\n                }\n            }\n\n            return new StandardDeviationExecutionModel(period, deviations);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Execution/VolumeWeightedAveragePriceExecutionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Execution;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Execution\n{\n    [TestFixture]\n    public class VolumeWeightedAveragePriceExecutionModelTests\n    {\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OrdersAreNotSubmittedWhenNoTargetsToExecute(Language language)\n        {\n            var actualOrdersSubmitted = new List<SubmitOrderRequest>();\n\n            var orderProcessor = new Mock<IOrderProcessor>();\n            orderProcessor.Setup(m => m.Process(It.IsAny<SubmitOrderRequest>()))\n                .Returns((OrderTicket)null)\n                .Callback((OrderRequest request) => actualOrdersSubmitted.Add((SubmitOrderRequest)request));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor.Object);\n\n            var model = GetExecutionModel(language);\n            algorithm.SetExecution(model);\n\n            var changes = SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>());\n            model.OnSecuritiesChanged(algorithm, changes);\n\n            model.Execute(algorithm, new IPortfolioTarget[0]);\n\n            Assert.AreEqual(0, actualOrdersSubmitted.Count);\n        }\n\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 5000, 1, 10)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 5000, 1, 10)]\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 500, 1, 5)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 500, 1, 5)]\n        [TestCase(Language.CSharp, new[] { 270d, 260d, 250d }, 50, 0, 0)]\n        [TestCase(Language.Python, new[] { 270d, 260d, 250d }, 50, 0, 0)]\n        [TestCase(Language.CSharp, new[] { 230d, 240d, 250d }, 50000, 0, 0)]\n        [TestCase(Language.Python, new[] { 230d, 240d, 250d }, 50000, 0, 0)]\n        public void OrdersAreSubmittedWhenRequiredForTargetsToExecute(\n            Language language,\n            double[] historicalPrices,\n            decimal lastVolume,\n            int expectedOrdersSubmitted,\n            decimal expectedTotalQuantity)\n        {\n            var actualOrdersSubmitted = new List<SubmitOrderRequest>();\n\n            var time = new DateTime(2018, 8, 2, 16, 0, 0);\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(m => m.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(historicalPrices.Select((x, i) =>\n                    new Slice(time.AddMinutes(i),\n                        new List<BaseData>\n                        {\n                            new TradeBar\n                            {\n                                Time = time.AddMinutes(i),\n                                Symbol = Symbols.AAPL,\n                                Open = Convert.ToDecimal(x),\n                                High = Convert.ToDecimal(x),\n                                Low = Convert.ToDecimal(x),\n                                Close = Convert.ToDecimal(x),\n                                Volume = 100m\n                            }\n                        }, time.AddMinutes(i))));\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetPandasConverter();\n            algorithm.SetHistoryProvider(historyProvider.Object);\n            algorithm.SetDateTime(time.AddMinutes(5));\n\n            var security = algorithm.AddEquity(Symbols.AAPL.Value);\n            security.SetMarketPrice(new TradeBar { Value = 250, Volume = lastVolume });\n\n            algorithm.SetFinishedWarmingUp();\n\n            var orderProcessor = ImmediateExecutionModelTests.GetAndSetBrokerageTransactionHandler(algorithm, out var brokerage);\n\n            try\n            {\n                var model = GetExecutionModel(language);\n                algorithm.SetExecution(model);\n\n                var changes = SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>());\n                model.OnSecuritiesChanged(algorithm, changes);\n\n                algorithm.History(new List<Symbol> { security.Symbol }, historicalPrices.Length, Resolution.Minute)\n                    .PushThroughConsolidators(symbol => algorithm.Securities[symbol].Subscriptions.Single(s => s.TickType == LeanData.GetCommonTickType(SecurityType.Equity)).Consolidators.First());\n\n                var targets = new IPortfolioTarget[] { new PortfolioTarget(security.Symbol, 10) };\n                model.Execute(algorithm, targets);\n                orderProcessor.ProcessSynchronousEvents();\n\n                var orders = orderProcessor.GetOrders().ToList();\n\n                Assert.AreEqual(expectedOrdersSubmitted, orders.Count);\n                Assert.AreEqual(expectedTotalQuantity, orders.Sum(x => x.Quantity));\n\n                if (expectedOrdersSubmitted == 1)\n                {\n                    var order = orders[0];\n                    Assert.AreEqual(expectedTotalQuantity, order.Quantity);\n                    Assert.AreEqual(algorithm.UtcTime, order.Time);\n                }\n            }\n            finally\n            {\n                orderProcessor.Exit();\n                brokerage?.Dispose();\n            }\n        }\n\n        private static IExecutionModel GetExecutionModel(Language language)\n        {\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(VolumeWeightedAveragePriceExecutionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke();\n                    return new ExecutionModelPythonWrapper(instance);\n                }\n            }\n\n            return new VolumeWeightedAveragePriceExecutionModel();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/FrameworkModelsPythonInheritanceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Tests.Algorithm.Framework\n{\n    [TestFixture]\n    public class FrameworkModelsPythonInheritanceTests\n    {\n        [Test]\n        public void ManualUniverseSelectionModelCanBeInherited()\n        {\n            var code = @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Common')\n\nfrom QuantConnect import Market, SecurityType, Symbol\nfrom Selection.ManualUniverseSelectionModel import ManualUniverseSelectionModel\n\nclass MockUniverseSelectionModel(ManualUniverseSelectionModel):\n    def __init__(self):\n        super().__init__([Symbol.Create('SPY', SecurityType.Equity, Market.USA)])\";\n\n            using (Py.GIL())\n            {\n                dynamic pyModel = PyModule.FromString(Guid.NewGuid().ToString(), code)\n                    .GetAttr(\"MockUniverseSelectionModel\");\n\n                var model = new UniverseSelectionModelPythonWrapper(pyModel());\n\n                var universes = model.CreateUniverses(new QCAlgorithm()).ToList();\n                Assert.AreEqual(1, universes.Count);\n\n                var universe = universes.First();\n                var symbols = universe.SelectSymbols(DateTime.Now, null).ToList();\n                Assert.AreEqual(1, symbols.Count);\n\n                var expected = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n                var symbol = symbols.First();\n                Assert.AreEqual(expected, symbol);\n            }\n        }\n\n        [Test]\n        public void FundamentalUniverseSelectionModelCanBeInherited()\n        {\n            var code = @\"\nfrom AlgorithmImports import *\nfrom Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel\n\nclass MockUniverseSelectionModel(FundamentalUniverseSelectionModel):\n    def __init__(self):\n        super().__init__(False)\n    def SelectCoarse(self, algorithm, coarse):\n        return [Symbol.Create('SPY', SecurityType.Equity, Market.USA)]\";\n\n            using (Py.GIL())\n            {\n                dynamic pyModel = PyModule.FromString(Guid.NewGuid().ToString(), code)\n                    .GetAttr(\"MockUniverseSelectionModel\");\n\n                var model = new UniverseSelectionModelPythonWrapper(pyModel());\n\n                var universes = model.CreateUniverses(new QCAlgorithm()).ToList();\n                Assert.AreEqual(1, universes.Count);\n\n                var data = new BaseDataCollection();\n                data.Add(new CoarseFundamental());\n\n                var universe = universes.First();\n                var symbols = universe.SelectSymbols(DateTime.Now, data).ToList();\n                Assert.AreEqual(1, symbols.Count);\n\n                var expected = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n                var symbol = symbols.First();\n                Assert.AreEqual(expected, symbol);\n            }\n        }\n\n        [Test]\n        public void PythonCanInheritFromFundamentalUniverseSelectionModelAndOverrideMethods()\n        {\n            var code = @\"\nfrom AlgorithmImports import *\n\nclass MockUniverseSelectionModel(FundamentalUniverseSelectionModel):\n    def __init__(self):\n        super().__init__()\n        self.select_call_count = 0\n        self.select_coarse_call_count = 0\n        self.select_fine_call_count = 0\n        self.create_coarse_call_count = 0\n\n    def select(self, algorithm: QCAlgorithm, fundamental: list[Fundamental]) -> list[Symbol]:\n        self.select_call_count += 1\n        return [Futures.Metals.GOLD]\n    \n    def select_coarse(self, algorithm, coarse):\n        self.select_coarse_call_count += 1\n        self.select_coarse_called = True\n        \n        filtered = [c for c in coarse if c.price > 10]\n        return [c.symbol for c in filtered[:2]]\n    \n    def select_fine(self, algorithm, fine):\n        self.select_fine_call_count += 1\n        self.select_fine_called = True\n        \n        return [f.symbol for f in fine[:2]]\n    \n    def create_coarse_fundamental_universe(self, algorithm):\n        self.create_coarse_call_count += 1\n        self.create_coarse_called = True\n        \n        return CoarseFundamentalUniverse(\n            algorithm.universe_settings, \n            self.custom_coarse_selector\n        )\n    \n    def custom_coarse_selector(self, coarse):\n        filtered = [c for c in coarse if c.has_fundamental_data]\n        return [c.symbol for c in filtered[:5]]\";\n\n            using (Py.GIL())\n            {\n                dynamic pyModel = PyModule.FromString(Guid.NewGuid().ToString(), code)\n                    .GetAttr(\"MockUniverseSelectionModel\");\n\n                PyObject pyModelInstance = pyModel();\n                var algorithm = new QCAlgorithm();\n                var model = new FundamentalUniverseSelectionModel();\n                model.SetPythonInstance(pyModelInstance);\n\n                // call the create_universes method\n                var universes = model.CreateUniverses(algorithm).ToList();\n                var universe = universes.First();\n                var selectedSymbols = universe.SelectSymbols(DateTime.Now, new BaseDataCollection()).ToList();\n                int selectCount = pyModelInstance.GetAttr(\"select_call_count\").As<int>();\n                Assert.Greater(selectCount, 0);\n\n                // call the select method\n                model.Select(algorithm, new List<Fundamental>());\n                selectCount = pyModelInstance.GetAttr(\"select_call_count\").As<int>();\n                Assert.Greater(selectCount, 1);\n\n                // call the select_coarse method\n                model.SelectCoarse(algorithm, new List<CoarseFundamental>());\n                int selectCoarseCount = pyModelInstance.GetAttr(\"select_coarse_call_count\").As<int>();\n                Assert.Greater(selectCoarseCount, 0);\n\n                // call the select_fine method\n                model.SelectFine(algorithm, new List<FineFundamental>());\n                int selectFineCount = pyModelInstance.GetAttr(\"select_fine_call_count\").As<int>();\n                Assert.Greater(selectFineCount, 0);\n\n                // call the create_coarse_fundamental_universe method\n                model.CreateCoarseFundamentalUniverse(algorithm);\n                int createCoarseCount = pyModelInstance.GetAttr(\"create_coarse_call_count\").As<int>();\n                Assert.Greater(createCoarseCount, 0);\n            }\n        }\n\n        [Test]\n        public void PythonCanInheritFromBasePairsTradingAlphaModelAndOverrideMethods()\n        {\n            var code = @\"\nfrom AlgorithmImports import *\n\nclass MockPairsTradingAlphaModel(BasePairsTradingAlphaModel):\n    def __init__(self):\n        super().__init__()\n        self.has_passed_test_call_count = 0\n\n    def has_passed_test(self, algorithm, asset1, asset2):\n        self.has_passed_test_call_count += 1\n        return False\";\n\n            using (Py.GIL())\n            {\n                var pyModel = PyModule.FromString(\"test\", code).GetAttr(\"MockPairsTradingAlphaModel\");\n                var pyInstance = pyModel.Invoke();\n\n                var algorithm = new QCAlgorithm();\n                var model = new BasePairsTradingAlphaModel();\n                model.SetPythonInstance(pyInstance);\n\n                var security1 = new Equity(\n                    Symbols.SPY,\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(\"USD\", 1m, 1m),\n                    SymbolProperties.GetDefault(\"USD\"),\n                    ErrorCurrencyConverter.Instance,\n                    new RegisteredSecurityDataTypesProvider(),\n                    new SecurityCache()\n                );\n\n                var security2 = new Equity(\n                    Symbols.AAPL,\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(\"USD\", 1m, 1m),\n                    SymbolProperties.GetDefault(\"USD\"),\n                    ErrorCurrencyConverter.Instance,\n                    new RegisteredSecurityDataTypesProvider(),\n                    new SecurityCache()\n                );\n\n                var changes = SecurityChanges.Create(\n                    new List<Security> { security1, security2 },\n                    new List<Security>(),\n                    new List<Security>(),\n                    new List<Security>()\n                );\n\n                model.OnSecuritiesChanged(new QCAlgorithm(), changes);\n\n                int hasPassedTestCallCount = pyInstance.GetAttr(\"has_passed_test_call_count\").As<int>();\n                Assert.AreEqual(1, hasPassedTestCallCount);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/InsightTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Algorithm.Framework\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class InsightTests\n    {\n        [Test]\n        public void HasReferenceTypeEqualitySemantics()\n        {\n            var one = Insight.Price(Symbols.SPY, Time.OneSecond, InsightDirection.Up);\n            var two = Insight.Price(Symbols.SPY, Time.OneSecond, InsightDirection.Up);\n            Assert.AreNotEqual(one, two);\n            Assert.AreEqual(one, one);\n            Assert.AreEqual(two, two);\n        }\n\n        [Test]\n        public void SurvivesRoundTripSerializationUsingJsonConvert()\n        {\n            var time = new DateTime(2000, 01, 02, 03, 04, 05, 06);\n            var insight = new Insight(time, Symbols.SPY, Time.OneMinute, InsightType.Volatility, InsightDirection.Up, 1, 2, \"source-model\", 1);\n            Insight.Group(insight);\n            insight.ReferenceValueFinal = 10;\n            var serialized = JsonConvert.SerializeObject(insight);\n            var deserialized = JsonConvert.DeserializeObject<Insight>(serialized);\n\n            Assert.AreEqual(insight.CloseTimeUtc, deserialized.CloseTimeUtc);\n            Assert.AreEqual(insight.Confidence, deserialized.Confidence);\n            Assert.AreEqual(insight.Direction, deserialized.Direction);\n            Assert.AreEqual(insight.EstimatedValue, deserialized.EstimatedValue);\n            Assert.AreEqual(insight.GeneratedTimeUtc, deserialized.GeneratedTimeUtc);\n            Assert.AreEqual(insight.GroupId, deserialized.GroupId);\n            Assert.AreEqual(insight.Id, deserialized.Id);\n            Assert.AreEqual(insight.Magnitude, deserialized.Magnitude);\n            Assert.AreEqual(insight.Period, deserialized.Period);\n            Assert.AreEqual(insight.SourceModel, deserialized.SourceModel);\n            Assert.AreEqual(insight.Score.Direction, deserialized.Score.Direction);\n            Assert.AreEqual(insight.Score.Magnitude, deserialized.Score.Magnitude);\n            Assert.AreEqual(insight.Score.UpdatedTimeUtc, deserialized.Score.UpdatedTimeUtc);\n            Assert.AreEqual(insight.Score.IsFinalScore, deserialized.Score.IsFinalScore);\n            Assert.AreEqual(insight.Symbol, deserialized.Symbol);\n            Assert.AreEqual(insight.Type, deserialized.Type);\n            Assert.AreEqual(insight.Weight, deserialized.Weight);\n            Assert.AreEqual(insight.ReferenceValueFinal, deserialized.ReferenceValueFinal);\n        }\n\n        [Test]\n        public void CancelInsight()\n        {\n            var time = new DateTime(2000, 01, 02, 03, 04, 05, 06);\n            var insight = new Insight(time, Symbols.SPY, Time.OneMinute, InsightType.Volatility, InsightDirection.Up, 1, 2, \"source-model\");\n\n            insight.Cancel(time.AddMinutes(1));\n\n            Assert.AreEqual(TimeSpan.FromSeconds(59), insight.Period);\n\n            insight.Cancel(time.AddDays(1));\n\n            Assert.AreEqual(TimeSpan.FromSeconds(59), insight.Period);\n        }\n\n        [Test]\n        public void SerializationUsingJsonConvertTrimsEstimatedValue()\n        {\n            var time = new DateTime(2000, 01, 02, 03, 04, 05, 06);\n            var insight = new Insight(time, Symbols.SPY, Time.OneMinute, InsightType.Volatility, InsightDirection.Up, 1, 2, \"source-model\");\n            insight.EstimatedValue = 0.00001m;\n            insight.Score.SetScore(InsightScoreType.Direction, 0.00001, DateTime.UtcNow);\n            insight.Score.SetScore(InsightScoreType.Magnitude, 0.00001, DateTime.UtcNow);\n            var serialized = JsonConvert.SerializeObject(insight);\n            var deserialized = JsonConvert.DeserializeObject<Insight>(serialized);\n\n            Assert.AreEqual(0, deserialized.EstimatedValue);\n            Assert.AreEqual(0, deserialized.Score.Direction);\n            Assert.AreEqual(0, deserialized.Score.Magnitude);\n        }\n\n        [Test]\n        public void SurvivesRoundTripCopy()\n        {\n            var time = new DateTime(2000, 01, 02, 03, 04, 05, 06);\n            var original = new Insight(time, Symbols.SPY, Time.OneMinute, InsightType.Volatility, InsightDirection.Up, 1, 2, \"source-model\", 1);\n            original.ReferenceValueFinal = 10;\n            Insight.Group(original);\n\n            var copy = original.Clone();\n\n            Assert.AreEqual(original.CloseTimeUtc, copy.CloseTimeUtc);\n            Assert.AreEqual(original.Confidence, copy.Confidence);\n            Assert.AreEqual(original.Direction, copy.Direction);\n            Assert.AreEqual(original.EstimatedValue, copy.EstimatedValue);\n            Assert.AreEqual(original.GeneratedTimeUtc, copy.GeneratedTimeUtc);\n            Assert.AreEqual(original.GroupId, copy.GroupId);\n            Assert.AreEqual(original.Id, copy.Id);\n            Assert.AreEqual(original.Magnitude, copy.Magnitude);\n            Assert.AreEqual(original.Period, copy.Period);\n            Assert.AreEqual(original.SourceModel, copy.SourceModel);\n            Assert.AreEqual(original.Score.Direction, copy.Score.Direction);\n            Assert.AreEqual(original.Score.Magnitude, copy.Score.Magnitude);\n            Assert.AreEqual(original.Score.UpdatedTimeUtc, copy.Score.UpdatedTimeUtc);\n            Assert.AreEqual(original.Score.IsFinalScore, copy.Score.IsFinalScore);\n            Assert.AreEqual(original.Symbol, copy.Symbol);\n            Assert.AreEqual(original.Type, copy.Type);\n            Assert.AreEqual(original.Weight, copy.Weight);\n            Assert.AreEqual(original.ReferenceValueFinal, copy.ReferenceValueFinal);\n        }\n\n        [Test]\n        public void GroupAssignsGroupId()\n        {\n            var insight1 = Insight.Price(Symbols.SPY, Time.OneMinute, InsightDirection.Up);\n            var insight2 = Insight.Price(Symbols.SPY, Time.OneMinute, InsightDirection.Up);\n            var group = Insight.Group(insight1, insight2).ToList();\n            foreach (var member in group)\n            {\n                Assert.IsTrue(member.GroupId.HasValue);\n            }\n            var groupId = insight1.GroupId.Value;\n            foreach (var member in group)\n            {\n                Assert.AreEqual(groupId, member.GroupId);\n            }\n        }\n\n        [Test]\n        public void GroupThrowsExceptionIfInsightAlreadyHasGroupId()\n        {\n            var insight1 = Insight.Price(Symbols.SPY, Time.OneMinute, InsightDirection.Up);\n            Insight.Group(insight1);\n            Assert.That(() => Insight.Group(insight1), Throws.InvalidOperationException);\n        }\n\n        [Test]\n        [TestCase(Resolution.Tick, 1)]\n        [TestCase(Resolution.Tick, 10)]\n        [TestCase(Resolution.Tick, 100)]\n        [TestCase(Resolution.Second, 1)]\n        [TestCase(Resolution.Second, 10)]\n        [TestCase(Resolution.Second, 100)]\n        [TestCase(Resolution.Minute, 1)]\n        [TestCase(Resolution.Minute, 10)]\n        [TestCase(Resolution.Minute, 100)]\n        [TestCase(Resolution.Hour, 1)]\n        [TestCase(Resolution.Hour, 10)]\n        [TestCase(Resolution.Hour, 100)]\n        [TestCase(Resolution.Daily, 1)]\n        [TestCase(Resolution.Daily, 10)]\n        [TestCase(Resolution.Daily, 100)]\n        public void SetPeriodAndCloseTimeUsingResolutionBarCount(Resolution resolution, int barCount)\n        {\n            var generatedTimeUtc = new DateTime(2018, 08, 06, 13, 31, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var symbol = Symbols.SPY;\n            var insight = Insight.Price(symbol, resolution, barCount, InsightDirection.Up);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            insight.SetPeriodAndCloseTime(exchangeHours);\n            var expectedCloseTime = Insight.ComputeCloseTime(exchangeHours, insight.GeneratedTimeUtc, resolution, barCount);\n            Assert.AreEqual(expectedCloseTime, insight.CloseTimeUtc);\n            Assert.AreEqual(expectedCloseTime - generatedTimeUtc, insight.Period);\n        }\n\n        [Test]\n        [TestCase(Resolution.Second, 1)]\n        [TestCase(Resolution.Second, 10)]\n        [TestCase(Resolution.Second, 100)]\n        [TestCase(Resolution.Minute, 1)]\n        [TestCase(Resolution.Minute, 10)]\n        [TestCase(Resolution.Minute, 100)]\n        [TestCase(Resolution.Hour, 1)]\n        [TestCase(Resolution.Hour, 10)]\n        [TestCase(Resolution.Hour, 100)]\n        [TestCase(Resolution.Daily, 1)]\n        [TestCase(Resolution.Daily, 10)]\n        [TestCase(Resolution.Daily, 100)]\n        public void SetPeriodAndCloseTimeUsingPeriod(Resolution resolution, int barCount)\n        {\n            var period = resolution.ToTimeSpan().Multiply(barCount);\n            var generatedTimeUtc = new DateTime(2018, 08, 06, 13, 31, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var symbol = Symbols.SPY;\n            var insight = Insight.Price(symbol, period, InsightDirection.Up);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            insight.SetPeriodAndCloseTime(exchangeHours);\n            Assert.AreEqual(Time.Max(period, Time.OneSecond), insight.Period);\n\n            var expectedCloseTime = Insight.ComputeCloseTime(exchangeHours, insight.GeneratedTimeUtc, period);\n            Assert.AreEqual(expectedCloseTime, insight.CloseTimeUtc);\n        }\n\n        [Test]\n        [TestCase(Resolution.Tick, 1)]\n        [TestCase(Resolution.Tick, 10)]\n        [TestCase(Resolution.Tick, 100)]\n        [TestCase(Resolution.Second, 1)]\n        [TestCase(Resolution.Second, 10)]\n        [TestCase(Resolution.Second, 100)]\n        [TestCase(Resolution.Minute, 1)]\n        [TestCase(Resolution.Minute, 10)]\n        [TestCase(Resolution.Minute, 100)]\n        [TestCase(Resolution.Hour, 1)]\n        [TestCase(Resolution.Hour, 10)]\n        [TestCase(Resolution.Hour, 100)]\n        [TestCase(Resolution.Daily, 1)]\n        [TestCase(Resolution.Daily, 10)]\n        [TestCase(Resolution.Daily, 100)]\n        public void SetPeriodAndCloseTimeUsingCloseTime(Resolution resolution, int barCount)\n        {\n            // consistency test -- first compute expected close time and then back-compute period to verify\n            var symbol = Symbols.SPY;\n            var generatedTimeUtc = new DateTime(2018, 08, 06, 13, 31, 0).ConvertToUtc(TimeZones.NewYork);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            var baseline = Insight.Price(symbol, resolution, barCount, InsightDirection.Up);\n            baseline.GeneratedTimeUtc = generatedTimeUtc;\n            baseline.SetPeriodAndCloseTime(exchangeHours);\n            var baselineCloseTimeLocal = baseline.CloseTimeUtc.ConvertFromUtc(TimeZones.NewYork);\n\n            var insight = Insight.Price(symbol, baselineCloseTimeLocal, baseline.Direction);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.SetPeriodAndCloseTime(exchangeHours);\n\n            Assert.AreEqual(baseline.Period, insight.Period);\n            Assert.AreEqual(baseline.CloseTimeUtc, insight.CloseTimeUtc);\n        }\n\n        [Test]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, 2018, 12, 4, 9, 30)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, 2018, 12, 4, 0, 0)]\n        public void SetPeriodAndCloseTimeUsingExpiryEndOfDay(string ticker, SecurityType securityType, string market, int year, int month, int day, int hour, int minute)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var generatedTimeUtc = new DateTime(2018, 12, 3, 9, 31, 0).ConvertToUtc(TimeZones.NewYork);\n\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.EndOfDay, InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n        }\n\n        [Test]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, 2018, 12, 10, 9, 30)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, 2018, 12, 10, 0, 0)]\n        public void SetPeriodAndCloseTimeUsingExpiryEndOfWeek(string ticker, SecurityType securityType, string market, int year, int month, int day, int hour, int minute)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var generatedTime = new DateTime(2018, 12, 3, 9, 31, 0);\n            var generatedTimeUtc = generatedTime.ConvertToUtc(TimeZones.NewYork);\n\n            // Using Expiry Func\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.EndOfWeek, InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n\n            // Using DateTime\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.EndOfWeek(generatedTime), InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n        }\n\n        [Test]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, 2019, 1, 2, 9, 30)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, 2019, 1, 2, 0, 0)]\n        public void SetPeriodAndCloseTimeUsingExpiryEndOfMonth(string ticker, SecurityType securityType, string market, int year, int month, int day, int hour, int minute)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var generatedTime = new DateTime(2018, 12, 3, 9, 31, 0);\n            var generatedTimeUtc = generatedTime.ConvertToUtc(TimeZones.NewYork);\n\n            // Using Expiry Func\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.EndOfMonth, InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n\n            // Using DateTime\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.EndOfMonth(generatedTime), InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n        }\n\n        [Test]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, 2019, 1, 3, 9, 31)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, 2019, 1, 3, 9, 31)]\n        public void SetPeriodAndCloseTimeUsingExpiryOneMonth(string ticker, SecurityType securityType, string market, int year, int month, int day, int hour, int minute)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var generatedTime = new DateTime(2018, 12, 3, 9, 31, 0);\n            var generatedTimeUtc = generatedTime.ConvertToUtc(TimeZones.NewYork);\n\n            // Using Expiry Func\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.OneMonth, InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n\n            // Using DateTime\n            SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(\n                Insight.Price(symbol, Expiry.OneMonth(generatedTime), InsightDirection.Up),\n                generatedTimeUtc,\n                new DateTime(year, month, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork));\n        }\n\n        private void SetPeriodAndCloseTimeUsingExpiryFuncOrDateTime(Insight insight, DateTime generatedTimeUtc, DateTime expected)\n        {\n            var symbol = insight.Symbol;\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            insight.SetPeriodAndCloseTime(exchangeHours);\n\n            Assert.AreEqual(expected, insight.CloseTimeUtc);\n        }\n\n\n        [Test]\n        public void ComputeCloseTimeHandlesFractionalDays()\n        {\n            var symbol = Symbols.SPY;\n            // Friday @ 3PM + 2.5 days => Wednesday @ 12:45 by counting 2 dates (Mon, Tues@3PM) and then half a trading day (+3.25hrs) => Wed@11:45AM\n            var generatedTimeUtc = new DateTime(2018, 08, 03, 12+3, 0, 0).ConvertToUtc(TimeZones.NewYork);\n            var expectedClosedTimeUtc = new DateTime(2018, 08, 08, 11, 45, 0).ConvertToUtc(TimeZones.NewYork);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var actualCloseTimeUtc = Insight.ComputeCloseTime(exchangeHours, generatedTimeUtc, TimeSpan.FromDays(2.5));\n            Assert.AreEqual(expectedClosedTimeUtc, actualCloseTimeUtc);\n        }\n\n        [Test]\n        public void ComputeCloseTimeHandlesFractionalHours()\n        {\n            var symbol = Symbols.SPY;\n            // Friday @ 3PM + 2.5 hours => Monday @ 11:00 (1 hr on Friday, 1.5 hours on Monday)\n            var generatedTimeUtc = new DateTime(2018, 08, 03, 12 + 3, 0, 0).ConvertToUtc(TimeZones.NewYork);\n            var expectedClosedTimeUtc = new DateTime(2018, 08, 06, 11, 0, 0).ConvertToUtc(TimeZones.NewYork);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var actualCloseTimeUtc = Insight.ComputeCloseTime(exchangeHours, generatedTimeUtc, TimeSpan.FromHours(2.5));\n            Assert.AreEqual(expectedClosedTimeUtc, actualCloseTimeUtc);\n        }\n\n        [Test]\n        public void ComputeCloseHandlesOffsetHourOverMarketClosuresUsingTimeSpan()\n        {\n            var symbol = Symbols.SPY;\n            // Friday @ 3:59PM + 1 hours => Monday @ 10:29 (1 min on Friday, 59 min on Monday)\n            var generatedTimeUtc = new DateTime(2018, 08, 03, 12 + 3, 59, 0).ConvertToUtc(TimeZones.NewYork);\n            var expectedClosedTimeUtc = new DateTime(2018, 08, 06, 10, 29, 0).ConvertToUtc(TimeZones.NewYork);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var actualCloseTimeUtc = Insight.ComputeCloseTime(exchangeHours, generatedTimeUtc, TimeSpan.FromHours(1));\n            Assert.AreEqual(expectedClosedTimeUtc, actualCloseTimeUtc);\n        }\n\n        [Test]\n        public void ComputeCloseHandlesOffsetHourOverMarketClosuresUsingResolutionBarCount()\n        {\n            var symbol = Symbols.SPY;\n            // Friday @ 3:59PM + 1 hours => Monday @ 10:29 (1 min on Friday, 59 min on Monday)\n            var generatedTimeUtc = new DateTime(2018, 08, 03, 12 + 3, 59, 0).ConvertToUtc(TimeZones.NewYork);\n            var expectedClosedTimeUtc = new DateTime(2018, 08, 06, 10, 29, 0).ConvertToUtc(TimeZones.NewYork);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            var actualCloseTimeUtc = Insight.ComputeCloseTime(exchangeHours, generatedTimeUtc, Resolution.Hour, 1);\n            Assert.AreEqual(expectedClosedTimeUtc, actualCloseTimeUtc);\n        }\n\n        [Test]\n        public void SetPeriodAndCloseTimeThrowsWhenGeneratedTimeUtcNotSet()\n        {\n            var insight = Insight.Price(Symbols.SPY, Time.OneDay, InsightDirection.Up);\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n            Assert.That(() => insight.SetPeriodAndCloseTime(exchangeHours),\n                Throws.InvalidOperationException);\n        }\n\n        [Test]\n        public void SetPeriodAndCloseTimeDoesNotThrowWhenGeneratedTimeUtcIsSet()\n        {\n            var insight = Insight.Price(Symbols.SPY, Time.OneDay, InsightDirection.Up);\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n            insight.GeneratedTimeUtc = new DateTime(2018, 08, 07, 00, 33, 00).ConvertToUtc(TimeZones.NewYork);\n            Assert.That(() => insight.SetPeriodAndCloseTime(exchangeHours),\n                Throws.Nothing);\n        }\n\n        [Test]\n        public void IsExpiredUsesOpenIntervalSemantics()\n        {\n            var generatedTime = new DateTime(2000, 01, 01);\n            var insight = Insight.Price(Symbols.SPY, Time.OneMinute, InsightDirection.Up);\n            insight.GeneratedTimeUtc = generatedTime;\n            insight.CloseTimeUtc = insight.GeneratedTimeUtc + insight.Period;\n\n            Assert.IsFalse(insight.IsExpired(insight.CloseTimeUtc));\n            Assert.IsTrue(insight.IsExpired(insight.CloseTimeUtc.AddTicks(1)));\n        }\n\n        [Test]\n        public void IsActiveUsesClosedIntervalSemantics()\n        {\n            var generatedTime = new DateTime(2000, 01, 01);\n            var insight = Insight.Price(Symbols.SPY, Time.OneMinute, InsightDirection.Up);\n            insight.GeneratedTimeUtc = generatedTime;\n            insight.CloseTimeUtc = insight.GeneratedTimeUtc + insight.Period;\n\n            Assert.IsTrue(insight.IsActive(insight.CloseTimeUtc));\n            Assert.IsFalse(insight.IsActive(insight.CloseTimeUtc.AddTicks(1)));\n        }\n\n        [Test]\n        public void ConstructorsSetsCorrectValues()\n        {\n            var tag = \"Insight Tag\";\n\n            Assert.Multiple(() =>\n            {\n                var insight1 = new Insight(Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, tag);\n                AssertInsigthValues(insight1, Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, null, null, null, null, tag,\n                    default(DateTime), default(DateTime));\n\n                var insight2 = new Insight(Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag);\n                AssertInsigthValues(insight2, Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag,\n                    default(DateTime), default(DateTime));\n\n                var insight3 = new Insight(Symbols.SPY, time => time.AddDays(1), InsightType.Price, InsightDirection.Up, tag);\n                AssertInsigthValues(insight3, Symbols.SPY, new TimeSpan(0), InsightType.Price, InsightDirection.Up, null, null, null, null, tag,\n                                   default(DateTime), default(DateTime));\n\n                var insight4 = new Insight(Symbols.SPY, time => time.AddDays(1), InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag);\n                AssertInsigthValues(insight4, Symbols.SPY, new TimeSpan(0), InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag,\n                    default(DateTime), default(DateTime));\n\n                var generatedTime = new DateTime(2024, 05, 23);\n                var insight5 = new Insight(generatedTime, Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag);\n                AssertInsigthValues(insight5, Symbols.SPY, Time.OneDay, InsightType.Price, InsightDirection.Up, 1.0, 0.5, \"Model\", 0.25, tag,\n                    generatedTime, generatedTime + Time.OneDay);\n\n            });\n        }\n\n        private static void AssertInsigthValues(Insight insight, Symbol symbol, TimeSpan period, InsightType type, InsightDirection direction,\n            double? magnitude, double? confidence, string sourceModel, double? weight, string tag, DateTime generatedTimeUtc, DateTime closeTimeUtc)\n        {\n            Assert.AreEqual(symbol, insight.Symbol);\n            Assert.AreEqual(period, insight.Period);\n            Assert.AreEqual(type, insight.Type);\n            Assert.AreEqual(direction, insight.Direction);\n            Assert.AreEqual(magnitude, insight.Magnitude);\n            Assert.AreEqual(confidence, insight.Confidence);\n            Assert.AreEqual(sourceModel, insight.SourceModel);\n            Assert.AreEqual(weight, insight.Weight);\n            Assert.AreEqual(tag, insight.Tag);\n            Assert.AreEqual(generatedTimeUtc, insight.GeneratedTimeUtc);\n            Assert.AreEqual(closeTimeUtc, insight.CloseTimeUtc);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/NotifiedSecurityChangesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework\n{\n    [TestFixture]\n    public class NotifiedSecurityChangesTests\n    {\n        [Test]\n        public void UpdateCallsDisposeOnDisposableInstances()\n        {\n            var disposable = new Disposable(Symbols.SPY);\n            var dictionary = new Dictionary<Symbol, Disposable>\n            {\n                [Symbols.SPY] = disposable\n            };\n\n            var SPY = new Equity(\n                Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(\"USD\", 1m, 1m),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache()\n            );\n            var changes = SecurityChangesTests.RemovedNonInternal(SPY);\n            NotifiedSecurityChanges.UpdateDictionary(dictionary, changes,\n                security => security.Symbol,\n                security => new Disposable(security.Symbol)\n            );\n\n            Assert.IsTrue(disposable.Disposed);\n        }\n\n        private class Disposable : IDisposable\n        {\n            public bool Disposed { get; private set; }\n            public Symbol Symbol { get; private set; }\n\n            public Disposable(Symbol symbol)\n            {\n                Symbol = symbol;\n            }\n            public void Dispose()\n            {\n                Disposed = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/AccumulativeInsightPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class AccumulativeInsightPortfolioConstructionModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private const decimal _startingCash = 100000;\n        private const double DefaultPercent = 0.03;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n\n            var prices = new Dictionary<Symbol, decimal>\n            {\n                { Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA), 55.22m },\n                { Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA), 145.17m },\n                { Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 281.79m },\n            };\n\n            foreach (var kvp in prices)\n            {\n                var symbol = kvp.Key;\n                var security = GetSecurity(symbol);\n                security.SetMarketPrice(new Tick(_algorithm.Time, symbol, kvp.Value, kvp.Value));\n                _algorithm.Securities.Add(symbol, security);\n            }\n        }\n\n\n        [Test]\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void EmptyInsightsReturnsEmptyTargets(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [Test]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        public void InsightsReturnsTargetsConsistentWithDirection(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)DefaultPercent;\n            var expectedTargets = _algorithm.Securities\n                .Select(x => new PortfolioTarget(x.Key, (int)direction\n                                                        * Math.Floor(amount / x.Value.Price)));\n\n            var insights = _algorithm.Securities.Keys.Select(x => GetInsight(x, direction, _algorithm.UtcTime));\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights.ToArray());\n\n            AssertTargets( expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void LongTermInsightCanceledByNew(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, -1m * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emits short term insight to cancel long\n            SetUtcTime(_algorithm.Time.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, _algorithm.UtcTime, Time.OneMinute) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emit empty insights array, short term insight expires but should stay -1 since long term insight is still valid\n            SetUtcTime(_algorithm.Time.AddMinutes(1.1));\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, -1m * (decimal)DefaultPercent) };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n            AssertTargets(expectedTargets, actualTargets);\n\n            // should stay 0 *after* the long expires\n            SetUtcTime(_algorithm.Time.AddYears(1));\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) };\n\n            actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        public void LongTermInsightAccumulatesByNew(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emits short term insight to add long\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, Time.OneMinute) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * 2 * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emit empty insights array, should return to nomral after the long expires\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1.1));\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n\n            // Create target from an empty insights array\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        public void FlatUndoesAccumulation(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emits insight to add to portfolio\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * 2 * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emits flat insight\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Flat, _algorithm.UtcTime) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n\n            AssertTargets(expectedTargets, targets);\n\n            // now we should reach 0 percent\n            insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Flat, _algorithm.UtcTime) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) };\n\n            AssertTargets(expectedTargets, targets);\n        }\n\n        [Test]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        public void InsightExpirationUndoesAccumulationBySteps(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            SetUtcTime(_algorithm.Time);\n            var insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromMinutes(10)) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // One minute later, emits insight to add to portfolio\n            SetUtcTime(_algorithm.Time.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromMinutes(10)) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * 2 * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // the first insight should expire\n            SetUtcTime(_algorithm.Time.AddMinutes(10));\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n\n            AssertTargets(expectedTargets, targets);\n\n            // the second insight should expire\n            SetUtcTime(_algorithm.Time.AddMinutes(1));\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) };\n\n            AssertTargets(expectedTargets, targets);\n        }\n\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        public void RespectsRebalancingPeriod(Language language, InsightDirection direction)\n        {\n            PortfolioConstructionModel model = new AccumulativeInsightPortfolioConstructionModel(Resolution.Daily);\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    var name = nameof(AccumulativeInsightPortfolioConstructionModel);\n                    dynamic instance = Py.Import(name).GetAttr(name);\n                    model = new PortfolioConstructionModelPythonWrapper(instance(Resolution.Daily));\n                }\n            }\n\n            model.RebalanceOnSecurityChanges = false;\n            model.RebalanceOnInsightChanges = false;\n\n            SetUtcTime(new DateTime(2018, 7, 31));\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromDays(10)) };\n            AssertTargets(new List<IPortfolioTarget>(), model.CreateTargets(_algorithm, insights).ToList());\n\n            // One minute later, emits insight to add to portfolio\n            SetUtcTime(_algorithm.Time.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromMinutes(10)) };\n            AssertTargets(new List<IPortfolioTarget>(), model.CreateTargets(_algorithm, insights));\n\n            // the second insight should expire\n            SetUtcTime(_algorithm.Time.AddMinutes(1));\n            AssertTargets(new List<IPortfolioTarget>(), model.CreateTargets(_algorithm, insights));\n\n            // the rebalancing period is due and the first insight is still valid\n            SetUtcTime(_algorithm.Time.AddDays(1));\n            var targets = model.CreateTargets(_algorithm, new Insight[0]);\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // the rebalancing period is due and no insight is valid\n            SetUtcTime(_algorithm.Time.AddDays(10));\n            AssertTargets(\n                new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) },\n                model.CreateTargets(_algorithm, new Insight[0]));\n\n            AssertTargets(new List<IPortfolioTarget>(), model.CreateTargets(_algorithm, new Insight[0]));\n        }\n\n        [Test]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        public void InsightExpirationUndoesAccumulation(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            SetUtcTime(_algorithm.Time);\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromMinutes(10)),\n                GetInsight(Symbols.SPY, direction, _algorithm.UtcTime, TimeSpan.FromMinutes(10))\n            };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, (int)direction * 1m * 2 * (decimal)DefaultPercent) };\n            AssertTargets(expectedTargets, targets);\n\n            // both insights should expire\n            SetUtcTime(_algorithm.Time.AddMinutes(11));\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]).ToList();\n\n            expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, 0) };\n\n            AssertTargets(expectedTargets, targets);\n\n            // we expect no target\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]).ToList();\n            AssertTargets(new List<IPortfolioTarget>(), targets);\n        }\n\n        [Test]\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void WeightsProportionally(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime),\n                GetInsight(Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                    InsightDirection.Down, _algorithm.UtcTime)\n            };\n\n            // they will each share, proportionally, the total portfolio value\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)DefaultPercent;\n\n            var expectedTargets = _algorithm.Securities.Where(pair => insights.Any(insight => pair.Key == insight.Symbol))\n                .Select(x => new PortfolioTarget(x.Key, (int)InsightDirection.Down * Math.Floor(amount / x.Value.Price)));\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(2, actualTargets.Count);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void GeneratesTargetsForInsightsWithNoConfidence(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime, confidence:null)\n            };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, actualTargets.Count);\n        }\n\n        [Test]\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void GeneratesNormalTargetForZeroInsightConfidence(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime, confidence:0)\n            };\n\n            // they will each share, proportionally, the total portfolio value\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)DefaultPercent;\n\n            var expectedTargets = _algorithm.Securities.Where(pair => insights.Any(insight => pair.Key == insight.Symbol))\n                .Select(x => new PortfolioTarget(x.Key, (int)InsightDirection.Down * Math.Floor(amount / x.Value.Price)));\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [TestCase(Language.CSharp, PortfolioBias.Long)]\n        [TestCase(Language.Python, PortfolioBias.Long)]\n        [TestCase(Language.CSharp, PortfolioBias.Short)]\n        [TestCase(Language.Python, PortfolioBias.Short)]\n        public void PortfolioBiasIsRespected(Language language, PortfolioBias bias)\n        {\n            SetPortfolioConstruction(language, _algorithm, bias);\n            var now = new DateTime(2018, 7, 31);\n            SetUtcTime(now.ConvertFromUtc(_algorithm.TimeZone));\n            var appl = _algorithm.AddEquity(\"AAPL\");\n            appl.SetMarketPrice(new Tick(now, appl.Symbol, 10, 10));\n\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick(now, spy.Symbol, 20, 20));\n\n            var ibm = _algorithm.AddEquity(\"IBM\");\n            ibm.SetMarketPrice(new Tick(now, ibm.Symbol, 30, 30));\n\n            var aig = _algorithm.AddEquity(\"AIG\");\n            aig.SetMarketPrice(new Tick(now, aig.Symbol, 30, 30));\n\n            var qqq = _algorithm.AddEquity(\"QQQ\");\n            qqq.SetMarketPrice(new Tick(now, qqq.Symbol, 30, 30));\n\n            var insights = new[]\n            {\n                new Insight(now, appl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, 0.1d, null),\n                new Insight(now, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, -0.1d, null),\n                new Insight(now, ibm.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, 0d, null),\n                new Insight(now, aig.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, -0.1d, null),\n                new Insight(now, qqq.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, 0.1d, null)\n            };\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(appl, spy, ibm, aig, qqq));\n\n            var createdValidTarget = false;\n            _algorithm.Insights.AddRange(insights);\n            foreach (var target in _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights))\n            {\n                QuantConnect.Logging.Log.Trace($\"{target.Symbol}: {target.Quantity}\");\n                if (target.Quantity == 0)\n                {\n                    continue;\n                }\n\n                createdValidTarget = true;\n                Assert.AreEqual(Math.Sign((int)bias), Math.Sign(target.Quantity));\n            }\n\n            Assert.IsTrue(createdValidTarget);\n        }\n\n        private Security GetSecurity(Symbol symbol)\n        {\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            return new Equity(\n                symbol,\n                exchangeHours,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? confidence = DefaultPercent)\n        {\n            period ??= TimeSpan.FromDays(1);\n            var insight = Insight.Price(symbol, period.Value, direction, confidence: confidence);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.CloseTimeUtc = generatedTimeUtc.Add(period.Value);\n            _algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        private void SetPortfolioConstruction(Language language, QCAlgorithm algorithm, PortfolioBias bias= PortfolioBias.LongShort)\n        {\n            algorithm.SetPortfolioConstruction(new AccumulativeInsightPortfolioConstructionModel((Func<DateTime,DateTime>)null, bias));\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    var name = nameof(AccumulativeInsightPortfolioConstructionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(((object)null).ToPython(), ((int)bias).ToPython());\n                    var model = new PortfolioConstructionModelPythonWrapper(instance);\n                    algorithm.SetPortfolioConstruction(model);\n                }\n            }\n\n            foreach (var kvp in _algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n            _algorithm.Portfolio.SetCash(_startingCash);\n            SetUtcTime(new DateTime(2018, 7, 31));\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToArray());\n            algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        private void SetUtcTime(DateTime dateTime)\n        {\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n        }\n\n        private void AssertTargets(IEnumerable<IPortfolioTarget> expectedTargets, IEnumerable<IPortfolioTarget> actualTargets)\n        {\n            var list = actualTargets.ToList();\n            Assert.AreEqual(expectedTargets.Count(), list.Count);\n\n            foreach (var expected in expectedTargets)\n            {\n                var actual = list.FirstOrDefault(x => x.Symbol == expected.Symbol);\n                Assert.IsNotNull(actual);\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/BaseWeightingPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public abstract class BaseWeightingPortfolioConstructionModelTests\n    {\n        protected decimal StartingCash => 100000;\n\n        protected QCAlgorithm Algorithm { get; set; }\n\n        public virtual double? Weight => Algorithm.Securities.Count == 0 ? default(double) : 1d / Algorithm.Securities.Count;\n\n        [OneTimeSetUp]\n        public virtual void SetUp()\n        {\n            Algorithm = new QCAlgorithm();\n            Algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(Algorithm));\n        }\n        [TearDown]\n        public void TearDown() => Algorithm.Insights.Clear(Algorithm.Securities.Keys.ToArray());\n\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AutomaticallyRemoveInvestedWithoutNewInsights(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // Let's create a position for SPY\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, Algorithm.UtcTime) };\n\n            foreach (var target in Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights))\n            {\n                var holding = Algorithm.Portfolio[target.Symbol];\n                holding.SetHoldings(holding.Price, target.Quantity);\n                Algorithm.Portfolio.SetCash(StartingCash - holding.HoldingsValue);\n            }\n\n            SetUtcTime(Algorithm.UtcTime.AddDays(2));\n\n            var expectedTargets = new List<IPortfolioTarget> { new PortfolioTarget(Symbols.SPY, 0) };\n\n            // Create target from an empty insights array\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DelistedSecurityEmitsFlatTargetWithoutNewInsights(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime) };\n            var targets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            var changes = SecurityChangesTests.RemovedNonInternal(Algorithm.Securities[Symbols.SPY]);\n            Algorithm.PortfolioConstruction.OnSecuritiesChanged(Algorithm, changes);\n\n            var expectedTargets = new List<IPortfolioTarget> { new PortfolioTarget(Symbols.SPY, 0) };\n\n            // Create target from an empty insights array\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotReturnTargetsIfSecurityPriceIsZero(Language language)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.AddEquity(Symbols.SPY.Value);\n            algorithm.SetDateTime(DateTime.MinValue.ConvertToUtc(Algorithm.TimeZone));\n\n            SetPortfolioConstruction(language);\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, algorithm.UtcTime) };\n            var actualTargets = algorithm.PortfolioConstruction.CreateTargets(algorithm, insights);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotThrowWithAlternativeOverloads(Language language)\n        {\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, Resolution.Minute));\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, TimeSpan.FromDays(1)));\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, Expiry.EndOfWeek));\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void EmptyInsightsReturnsEmptyTargets(Language language)\n        {\n            SetPortfolioConstruction(language);\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, new Insight[0]);\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void LongTermInsightPreservesPosition(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime) };\n            var targets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // One minute later, emits short term insight\n            SetUtcTime(Algorithm.UtcTime.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, Algorithm.UtcTime, Time.OneMinute) };\n            targets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // One minute later, emit empty insights array\n            SetUtcTime(Algorithm.UtcTime.AddMinutes(1.1));\n\n            var expectedTargets = GetTargetsForSPY();\n\n            // Create target from an empty insights array\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public abstract void AutomaticallyRemoveInvestedWithNewInsights(Language language, InsightDirection direction);\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public abstract void DelistedSecurityEmitsFlatTargetWithNewInsights(Language language, InsightDirection direction);\n\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public abstract void FlatDirectionNotAccountedToAllocation(Language language, InsightDirection direction);\n\n        public abstract IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null);\n\n        public abstract Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? weight = 0.01);\n\n        public void AssertTargets(IEnumerable<IPortfolioTarget> expectedTargets, IEnumerable<IPortfolioTarget> actualTargets)\n        {\n            var list = actualTargets.ToList();\n            Assert.AreEqual(expectedTargets.Count(), list.Count);\n\n            foreach (var expected in expectedTargets)\n            {\n                var actual = list.FirstOrDefault(x => x.Symbol == expected.Symbol);\n                Assert.IsNotNull(actual);\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n            }\n        }\n\n        protected Security GetSecurity(Symbol symbol) =>\n            new Equity(\n                symbol,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n                );\n\n        public virtual List<IPortfolioTarget> GetTargetsForSPY()\n        {\n            return new List<IPortfolioTarget> { PortfolioTarget.Percent(Algorithm, Symbols.SPY, -1m) };\n        }\n\n        protected void SetPortfolioConstruction(Language language, dynamic paramenter = null)\n        {\n            var model = GetPortfolioConstructionModel(language, paramenter ?? Resolution.Daily);\n            Algorithm.SetPortfolioConstruction(model);\n\n            foreach (var kvp in Algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n            Algorithm.Portfolio.SetCash(StartingCash);\n            SetUtcTime(new DateTime(2018, 7, 31));\n\n            var changes = SecurityChangesTests.AddedNonInternal(Algorithm.Securities.Values.ToArray());\n            Algorithm.PortfolioConstruction.OnSecuritiesChanged(Algorithm, changes);\n        }\n\n        protected void SetUtcTime(DateTime dateTime) => Algorithm.SetDateTime(dateTime.ConvertToUtc(Algorithm.TimeZone));\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.Math;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing System;\nusing System.Linq;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System.Collections.Generic;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class BlackLittermanOptimizationPortfolioConstructionModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private Insight[] _view1Insights;\n        private Insight[] _view2Insights;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n\n            SetUtcTime(new DateTime(2018, 8, 7));\n\n            // Germany will outperform the other European markets by 5%\n            _view1Insights = new[]\n            {\n                GetInsight(\"View 1\", \"AUS\",  0),\n                GetInsight(\"View 1\", \"CAN\",  0),\n                GetInsight(\"View 1\", \"FRA\", -0.01475),\n                GetInsight(\"View 1\", \"GER\",  0.05000),\n                GetInsight(\"View 1\", \"JAP\",  0),\n                GetInsight(\"View 1\", \"UK\" , -0.03525),\n                GetInsight(\"View 1\", \"USA\",  0)\n            };\n\n            // Canadian Equities will outperform US equities by 3 %\n            _view2Insights = new[]\n            {\n                GetInsight(\"View 2\", \"AUS\",  0),\n                GetInsight(\"View 2\", \"CAN\",  0.03),\n                GetInsight(\"View 2\", \"FRA\",  0),\n                GetInsight(\"View 2\", \"GER\",  0),\n                GetInsight(\"View 2\", \"JAP\",  0),\n                GetInsight(\"View 2\", \"UK\" ,  0),\n                GetInsight(\"View 2\", \"USA\", -0.03)\n            };\n\n            foreach (var symbol in _view1Insights.Select(x => x.Symbol))\n            {\n                var security = GetSecurity(symbol, Resolution.Daily);\n                security.SetMarketPrice(new Tick(_algorithm.Time, symbol, 1m, 1m));\n                _algorithm.Securities.Add(symbol, security);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void EmptyInsightsReturnsEmptyTargets(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            var insights = new Insight[0];\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OneViewTest(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // Add outdated insight to check if only the latest one was considered\n            var outdatedInsight = GetInsight(\"View 1\", \"CAN\", 0.05);\n            outdatedInsight.GeneratedTimeUtc -= TimeSpan.FromHours(1);\n            outdatedInsight.CloseTimeUtc -= TimeSpan.FromHours(1);\n\n            // Results from http://www.blacklitterman.org/code/hl_py.html (View 1)\n            var expectedTargets = new[]\n            {\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"AUS\"), 0.0152381),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"CAN\"), 0.02095238),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"FRA\"), -0.03948465),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"GER\"), 0.35410454),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"JAP\"), 0.11047619),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"UK\"), -0.09461989),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"USA\"), 0.58571429)\n            };\n\n            var insights = _view1Insights.Concat(new[] { outdatedInsight }).ToArray();\n            Clear();\n            _algorithm.Insights.AddRange(insights);\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            Assert.AreEqual(expectedTargets.Length, actualTargets.Count());\n\n            foreach (var expected in expectedTargets)\n            {\n                var actual = actualTargets.FirstOrDefault(x => x.Symbol == expected.Symbol);\n                Assert.IsNotNull(actual);\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TwoViewsTest(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // Results from http://www.blacklitterman.org/code/hl_py.html (View 1+2)\n            var expectedTargets = new[]\n            {\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"AUS\"), 0.0152381),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"CAN\"), 0.41863571),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"FRA\"), -0.03409321),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"GER\"), 0.33582847),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"JAP\"), 0.11047619),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"UK\"), -0.08173526),\n                PortfolioTarget.Percent(_algorithm, GetSymbol(\"USA\"), 0.18803095)\n            };\n\n            // Add outdated insight to check if only the latest one was considered\n            var outdatedInsight = GetInsight(\"View 2\", \"USA\", 0.05);\n            outdatedInsight.GeneratedTimeUtc -= TimeSpan.FromHours(1);\n            outdatedInsight.CloseTimeUtc -= TimeSpan.FromHours(1);\n\n            var insights = _view1Insights.Concat(_view2Insights).Concat(new[] { outdatedInsight });\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights.ToArray());\n\n            Assert.AreEqual(expectedTargets.Length, actualTargets.Count());\n\n            foreach (var expected in expectedTargets)\n            {\n                var actual = actualTargets.FirstOrDefault(x => x.Symbol == expected.Symbol);\n                Assert.IsNotNull(actual);\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OneViewDimensionTest(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            if (language == Language.CSharp)\n            {\n                double[,] P;\n                double[] Q;\n                ((BLOPCM)_algorithm.PortfolioConstruction).TestTryGetViews(_view1Insights, out P, out Q);\n\n                Assert.AreEqual(P.GetLength(0), 1);\n                Assert.AreEqual(P.GetLength(1), 7);\n                Assert.AreEqual(Q.GetLength(0), 1);\n\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                var name = nameof(BLOPCM);\n                var instance = PyModule.FromString(name, GetPythonBLOPCM()).GetAttr(name).Invoke(((int)PortfolioBias.LongShort).ToPython());\n                var result = PyList.AsList(instance.InvokeMethod(\"get_views\", _view1Insights.ToPython()));\n                Assert.AreEqual(result[0].Length(), 1);\n                Assert.AreEqual(result[0][0].Length(), 7);\n                Assert.AreEqual(result[1].Length(), 1);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void TwoViewsDimensionTest(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // Test if a symbol has no view in one of the source models\n            var insights = _view1Insights.Concat(_view2Insights.Skip(1)).ToList();\n\n            if (language == Language.CSharp)\n            {\n                double[,] P;\n                double[] Q;\n                ((BLOPCM)_algorithm.PortfolioConstruction).TestTryGetViews(insights, out P, out Q);\n\n                Assert.AreEqual(P.GetLength(0), 2);\n                Assert.AreEqual(P.GetLength(1), 7);\n                Assert.AreEqual(Q.GetLength(0), 2);\n\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                var name = nameof(BLOPCM);\n                var instance = PyModule.FromString(name, GetPythonBLOPCM()).GetAttr(name).Invoke(((int)PortfolioBias.LongShort).ToPython());\n                var result = PyList.AsList(instance.InvokeMethod(\"get_views\", insights.ToPython()));\n                Assert.AreEqual(result[0].Length(), 2);\n                Assert.AreEqual(result[0][0].Length(), 7);\n                Assert.AreEqual(result[1].Length(), 2);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, 11, true)]\n        [TestCase(Language.CSharp, -11, true)]\n        [TestCase(Language.CSharp, 0.001d, true)]\n        [TestCase(Language.CSharp, -0.001d, true)]\n        [TestCase(Language.CSharp, 0.1, false)]\n        [TestCase(Language.CSharp, -0.1, false)]\n        [TestCase(Language.CSharp, 0.011d, false)]\n        [TestCase(Language.CSharp, -0.011d, false)]\n        [TestCase(Language.CSharp, 0, true)]\n        [TestCase(Language.Python, 0, true)]\n        [TestCase(Language.Python, 11, true)]\n        [TestCase(Language.Python, -11, true)]\n        [TestCase(Language.Python, 0.001d, true)]\n        [TestCase(Language.Python, -0.001d, true)]\n        [TestCase(Language.Python, 0.1, false)]\n        [TestCase(Language.Python, -0.1, false)]\n        [TestCase(Language.Python, 0.011d, false)]\n        [TestCase(Language.Python, -0.011d, false)]\n        public void IgnoresInsightsWithInvalidMagnitudeValue(Language language, double magnitude, bool expectZero)\n        {\n            SetPortfolioConstruction(language);\n            _algorithm.Settings.MaxAbsolutePortfolioTargetPercentage = 10;\n            _algorithm.Settings.MinAbsolutePortfolioTargetPercentage = 0.01m;\n            Clear();\n\n            var insights = new[]\n            {\n                GetInsight(\"View 1\", \"AUS\", magnitude),\n                GetInsight(\"View 1\", \"CAN\", magnitude),\n                GetInsight(\"View 1\", \"FRA\", magnitude),\n                GetInsight(\"View 1\", \"GER\", magnitude),\n                GetInsight(\"View 1\", \"JAP\", magnitude),\n                GetInsight(\"View 1\", \"UK\" , magnitude),\n                GetInsight(\"View 1\", \"USA\", magnitude)\n            };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            if (expectZero)\n            {\n                Assert.AreEqual(0, actualTargets.Count());\n            }\n            else\n            {\n                Assert.AreNotEqual(0, actualTargets.Count());\n            }\n        }\n\n        [TestCase(Language.CSharp, PortfolioBias.Long)]\n        [TestCase(Language.Python, PortfolioBias.Long)]\n        [TestCase(Language.CSharp, PortfolioBias.Short)]\n        [TestCase(Language.Python, PortfolioBias.Short)]\n        public void PortfolioBiasIsRespected(Language language, PortfolioBias bias)\n        {\n            SetPortfolioConstruction(language, bias);\n\n            var insights = new[]\n            {\n                GetInsight(\"View 1\", \"AUS\", -10.1),\n                GetInsight(\"View 1\", \"CAN\", -0.1),\n                GetInsight(\"View 1\", \"FRA\", 0.1),\n                GetInsight(\"View 1\", \"GER\", -0.1),\n                GetInsight(\"View 1\", \"JAP\", -0.1),\n                GetInsight(\"View 1\", \"UK\" , 0.1),\n                GetInsight(\"View 1\", \"USA\", -0.1)\n            };\n\n            var createdValidTarget = false;\n            foreach (var target in _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights))\n            {\n                QuantConnect.Logging.Log.Trace($\"{target.Symbol}: {target.Quantity}\");\n                if (target.Quantity == 0)\n                {\n                    continue;\n                }\n\n                createdValidTarget = true;\n                Assert.AreEqual(Math.Sign((int)bias), Math.Sign(target.Quantity));\n            }\n\n            Assert.IsTrue(createdValidTarget);\n        }\n\n        [Test]\n        public void NewSymbolPortfolioConstructionModelDoesNotThrow()\n        {\n            var algorithm = new QCAlgorithm();\n            var timezone = algorithm.TimeZone;\n            algorithm.SetDateTime(new DateTime(2018, 8, 7).ConvertToUtc(timezone));\n            algorithm.SetPortfolioConstruction(new NewSymbolPortfolioConstructionModel());\n\n            var spySymbol = Symbols.SPY;\n            var spy = GetSecurity(spySymbol, Resolution.Daily);\n\n            spy.SetMarketPrice(new Tick(algorithm.Time, spySymbol, 1m, 1m));\n            algorithm.Securities.Add(spySymbol, spy);\n\n            algorithm.PortfolioConstruction.OnSecuritiesChanged(algorithm, SecurityChangesTests.AddedNonInternal(spy));\n\n            var insights = new[] { Insight.Price(spySymbol, Time.OneMinute, InsightDirection.Up, .1) };\n\n            Assert.DoesNotThrow(() => algorithm.PortfolioConstruction.CreateTargets(algorithm, insights));\n\n            algorithm.SetDateTime(algorithm.Time.AddDays(1));\n\n            var aaplSymbol = Symbols.AAPL;\n            var aapl = GetSecurity(spySymbol, Resolution.Daily);\n\n            aapl.SetMarketPrice(new Tick(algorithm.Time, aaplSymbol, 1m, 1m));\n            algorithm.Securities.Add(aaplSymbol, aapl);\n\n            algorithm.PortfolioConstruction.OnSecuritiesChanged(algorithm, SecurityChangesTests.AddedNonInternal(aapl));\n\n            insights = new[] { spySymbol, aaplSymbol }\n                .Select(x => Insight.Price(x, Time.OneMinute, InsightDirection.Up, .1)).ToArray();\n\n            Assert.DoesNotThrow(() => algorithm.PortfolioConstruction.CreateTargets(algorithm, insights));\n        }\n\n        private Security GetSecurity(Symbol symbol, Resolution resolution)\n        {\n            var timezone = _algorithm.TimeZone;\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(timezone);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, resolution, timezone, timezone, true, false, false);\n            return new Security(\n                exchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private Symbol GetSymbol(string ticker) => Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n        private Insight GetInsight(string SourceModel, string ticker, double magnitude)\n        {\n            var period = Time.OneDay;\n            var direction = (InsightDirection)Math.Sign(magnitude);\n            var insight = Insight.Price(GetSymbol(ticker), period, direction, magnitude, sourceModel: SourceModel);\n            insight.GeneratedTimeUtc = _algorithm.UtcTime;\n            insight.CloseTimeUtc = _algorithm.UtcTime.Add(insight.Period);\n            _algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        private void SetPortfolioConstruction(Language language, PortfolioBias portfolioBias = PortfolioBias.LongShort)\n        {\n            _algorithm.SetPortfolioConstruction(new BLOPCM(new UnconstrainedMeanVariancePortfolioOptimizer(), portfolioBias));\n            if (language == Language.Python)\n            {\n                try\n                {\n                    using (Py.GIL())\n                    {\n                        var name = nameof(BLOPCM);\n                        var instance = PyModule.FromString(name, GetPythonBLOPCM()).GetAttr(name).Invoke(((int)portfolioBias).ToPython());\n                        var model = new PortfolioConstructionModelPythonWrapper(instance);\n                        _algorithm.SetPortfolioConstruction(model);\n                    }\n                }\n                catch (Exception e)\n                {\n                    Assert.Ignore(e.Message);\n                }\n            }\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToList().ToArray());\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        private void SetUtcTime(DateTime dateTime)\n        {\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n        }\n\n        private class BLOPCM : BlackLittermanOptimizationPortfolioConstructionModel\n        {\n            public BLOPCM(IPortfolioOptimizer optimizer, PortfolioBias portfolioBias)\n                : base(optimizer: optimizer, portfolioBias: portfolioBias)\n            {\n            }\n\n            public override double[] GetEquilibriumReturns(double[,] returns, out double[,] Σ)\n            {\n                // Take the values from He & Litterman, 1999.\n                var C = new[,]\n                {\n                    { 1.000, 0.488, 0.478, 0.515, 0.439, 0.512, 0.491 },\n                    { 0.488, 1.000, 0.664, 0.655, 0.310, 0.608, 0.779 },\n                    { 0.478, 0.664, 1.000, 0.861, 0.355, 0.783, 0.668 },\n                    { 0.515, 0.655, 0.861, 1.000, 0.354, 0.777, 0.653 },\n                    { 0.439, 0.310, 0.355, 0.354, 1.000, 0.405, 0.306 },\n                    { 0.512, 0.608, 0.783, 0.777, 0.405, 1.000, 0.652 },\n                    { 0.491, 0.779, 0.668, 0.653, 0.306, 0.652, 1.000 }\n                };\n                var σ = new[] { 0.160, 0.203, 0.248, 0.271, 0.210, 0.200, 0.187 };\n                var w = new[] { 0.016, 0.022, 0.052, 0.055, 0.116, 0.124, 0.615 };\n                var delta = 2.5;\n\n                // Equilibrium covariance matrix\n                Σ = Elementwise.Multiply(C, σ.Outer(σ));\n                return w.Dot(Σ.Multiply(delta));\n            }\n\n            public bool TestTryGetViews(ICollection<Insight> insights, out double[,] P, out double[] Q)\n            {\n                return base.TryGetViews(insights, out P, out Q);\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n\n            }\n        }\n\n        private string GetPythonBLOPCM()\n        {\n            return @\"\nfrom AlgorithmImports import *\n\nfrom Portfolio.BlackLittermanOptimizationPortfolioConstructionModel import BlackLittermanOptimizationPortfolioConstructionModel\nfrom Portfolio.UnconstrainedMeanVariancePortfolioOptimizer import UnconstrainedMeanVariancePortfolioOptimizer\n\ndef GetSymbol(ticker):\n    return str(Symbol.Create(ticker, SecurityType.Equity, Market.USA))\n\nclass BLOPCM(BlackLittermanOptimizationPortfolioConstructionModel):\n\n    def __init__(self, portfolioBias):\n        super().__init__(portfolio_bias = portfolioBias, optimizer = UnconstrainedMeanVariancePortfolioOptimizer())\n\n    def get_equilibrium_return(self, returns):\n\n        # Take the values from He & Litterman, 1999.\n        weq = np.array([0.016, 0.022, 0.052, 0.055, 0.116, 0.124, 0.615])\n        C = np.array([[ 1.000, 0.488, 0.478, 0.515, 0.439, 0.512, 0.491],\n                       [0.488, 1.000, 0.664, 0.655, 0.310, 0.608, 0.779],\n                       [0.478, 0.664, 1.000, 0.861, 0.355, 0.783, 0.668],\n                       [0.515, 0.655, 0.861, 1.000, 0.354, 0.777, 0.653],\n                       [0.439, 0.310, 0.355, 0.354, 1.000, 0.405, 0.306],\n                       [0.512, 0.608, 0.783, 0.777, 0.405, 1.000, 0.652],\n                       [0.491, 0.779, 0.668, 0.653, 0.306, 0.652, 1.000]])\n        Sigma = np.array([0.160, 0.203, 0.248, 0.271, 0.210, 0.200, 0.187])\n        refPi = np.array([0.039, 0.069, 0.084, 0.090, 0.043, 0.068, 0.076])\n        assets= [GetSymbol(x) for x in ['AUS', 'CAN', 'FRA', 'GER', 'JAP', 'UK', 'USA']]\n        delta = 2.5\n\n        # Equilibrium covariance matrix\n        V = np.multiply(np.outer(Sigma,Sigma), C)\n\n        return weq.dot(V * delta), pd.DataFrame(V, columns=assets, index=assets)\n\n    def on_securities_changed(self, algorithm, changes):\n        pass\";\n        }\n\n        private void Clear() => _algorithm.Insights.Clear(_algorithm.Securities.Keys.ToArray());\n\n        private class NewSymbolPortfolioConstructionModel : BlackLittermanOptimizationPortfolioConstructionModel\n        {\n            private readonly Dictionary<Symbol, ReturnsSymbolData> _symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n\n            public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                // Updates the ReturnsSymbolData with insights\n                foreach (var insight in insights)\n                {\n                    ReturnsSymbolData symbolData;\n                    if (_symbolDataDict.TryGetValue(insight.Symbol, out symbolData))\n                    {\n                        symbolData.Add(algorithm.Time, .1m);\n                    }\n                }\n\n                double[,] returns = null;\n                Assert.DoesNotThrow(() => returns = _symbolDataDict.FormReturnsMatrix(insights.Select(x => x.Symbol)));\n\n                // Calculate posterior estimate of the mean and uncertainty in the mean\n                double[,] Σ;\n                var Π = GetEquilibriumReturns(returns, out Σ);\n\n                Assert.IsFalse(double.IsNaN(Π[0]));\n\n                return Enumerable.Empty<PortfolioTarget>();\n            }\n\n            public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                const int period = 2;\n                var reference = algorithm.Time.AddDays(-period);\n\n                foreach (var security in changes.AddedSecurities)\n                {\n                    var symbol = security.Symbol;\n                    var symbolData = new ReturnsSymbolData(symbol, 1, period);\n\n                    for (var i = 0; i <= period * 2; i++)\n                    {\n                        symbolData.Update(reference.AddDays(i), i);\n                    }\n\n                    _symbolDataDict[symbol] = symbolData;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/ConfidenceWeightedPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class ConfidenceWeightedPortfolioConstructionModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private const decimal _startingCash = 100000;\n        private const double Confidence = 0.01;\n\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n\n            var prices = new Dictionary<Symbol, decimal>\n            {\n                { Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA), 55.22m },\n                { Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA), 145.17m },\n                { Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 281.79m },\n            };\n\n            foreach (var kvp in prices)\n            {\n                var symbol = kvp.Key;\n                var security = GetSecurity(symbol);\n                security.SetMarketPrice(new Tick(_algorithm.Time, symbol, kvp.Value, kvp.Value));\n                _algorithm.Securities.Add(symbol, security);\n            }\n        }\n\n        [TearDown]\n        public void TearDown() => _algorithm.Insights.Clear(_algorithm.Securities.Keys.ToArray());\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void EmptyInsightsReturnsEmptyTargets(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public void InsightsReturnsTargetsConsistentWithDirection(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)Confidence;\n            var expectedTargets = _algorithm.Securities\n                .Select(x => new PortfolioTarget(x.Key, (int)direction\n                                                        * Math.Floor(amount * (1 - _algorithm.Settings.FreePortfolioValuePercentage)\n                                                                     / x.Value.Price)));\n\n            var insights = _algorithm.Securities.Keys.Select(x => GetInsight(x, direction, _algorithm.UtcTime));\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights.ToArray());\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public void FlatDirectionNotAccountedToAllocation(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // Modifying fee model for a constant one so numbers are simplified\n            foreach (var security in _algorithm.Securities)\n            {\n                security.Value.FeeModel = new ConstantFeeModel(1);\n            }\n\n            // Equity, minus $1 for fees\n            var amount = (_algorithm.Portfolio.TotalPortfolioValue - 1 * (_algorithm.Securities.Count - 1)) * (decimal)Confidence;\n            var expectedTargets = _algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since its insight will have flat direction\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction\n                                                          * Math.Floor(amount * (1 - _algorithm.Settings.FreePortfolioValuePercentage)\n                                                                       / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            var insights = _algorithm.Securities.Keys.Select(x =>\n            {\n                // SPY insight direction is flat\n                var actualDirection = x.Value == \"SPY\" ? InsightDirection.Flat : direction;\n                return GetInsight(x, actualDirection, _algorithm.UtcTime);\n            });\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights.ToArray());\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public void AutomaticallyRemoveInvestedWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // Let's create a position for SPY\n            var insights = new[] { GetInsight(Symbols.SPY, direction, _algorithm.UtcTime) };\n\n            foreach (var target in _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights))\n            {\n                var holding = _algorithm.Portfolio[target.Symbol];\n                holding.SetHoldings(holding.Price, target.Quantity);\n                _algorithm.Portfolio.SetCash(_startingCash - holding.HoldingsValue);\n            }\n\n            SetUtcTime(_algorithm.UtcTime.AddDays(2));\n\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)Confidence;\n            var expectedTargets = _algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since it will be removed\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction\n                                                          * Math.Floor(amount * (1 - _algorithm.Settings.FreePortfolioValuePercentage)\n                                                                       / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            // Do no include SPY in the insights\n            insights = _algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, _algorithm.UtcTime)).ToArray();\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AutomaticallyRemoveInvestedWithoutNewInsights(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // Let's create a position for SPY\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, _algorithm.UtcTime) };\n\n            foreach (var target in _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights))\n            {\n                var holding = _algorithm.Portfolio[target.Symbol];\n                holding.SetHoldings(holding.Price, target.Quantity);\n                _algorithm.Portfolio.SetCash(_startingCash - holding.HoldingsValue);\n            }\n\n            SetUtcTime(_algorithm.UtcTime.AddDays(2));\n\n            var expectedTargets = new List<IPortfolioTarget> { new PortfolioTarget(Symbols.SPY, 0) };\n\n            // Create target from an empty insights array\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void LongTermInsightPreservesPosition(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // First emit long term insight\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // One minute later, emits short term insight\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1));\n            insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Up, _algorithm.UtcTime, Time.OneMinute) };\n            targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // One minute later, emit empty insights array\n            SetUtcTime(_algorithm.UtcTime.AddMinutes(1.1));\n\n            var expectedTargets = new List<IPortfolioTarget> { PortfolioTarget.Percent(_algorithm, Symbols.SPY, -1m * (decimal)Confidence) };\n\n            // Create target from an empty insights array\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DelistedSecurityEmitsFlatTargetWithoutNewInsights(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            var changes = SecurityChangesTests.RemovedNonInternal(_algorithm.Securities[Symbols.SPY]);\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n\n            var expectedTargets = new List<IPortfolioTarget> { new PortfolioTarget(Symbols.SPY, 0) };\n\n            // Create target from an empty insights array\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, new Insight[0]);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public void DelistedSecurityEmitsFlatTargetWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime) };\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // Removing SPY should clear the key in the insight collection\n            var changes = SecurityChangesTests.RemovedNonInternal(_algorithm.Securities[Symbols.SPY]);\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)Confidence;\n            var expectedTargets = _algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since it will be removed\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction\n                                                          * Math.Floor(amount * (1 - _algorithm.Settings.FreePortfolioValuePercentage)\n                                                                       / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            // Do no include SPY in the insights\n            insights = _algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, _algorithm.UtcTime)).ToArray();\n\n            // Create target from an empty insights array\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void WeightsProportionally(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            // create two insights whose confidences sums up to 2\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime, confidence:1),\n                GetInsight(Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                    InsightDirection.Down, _algorithm.UtcTime, confidence:1)\n            };\n\n            // they will each share, proportionally, the total portfolio value\n            var amount = _algorithm.Portfolio.TotalPortfolioValue * (decimal)0.5;\n            var expectedTargets = _algorithm.Securities.Where(pair => insights.Any(insight => pair.Key == insight.Symbol))\n                .Select(x => new PortfolioTarget(x.Key, (int)InsightDirection.Down\n                    * Math.Floor(amount * (1 - _algorithm.Settings.FreePortfolioValuePercentage)\n                        / x.Value.Price)));\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(2, actualTargets.Count);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GeneratesNoTargetsForInsightsWithNoConfidence(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime, confidence:null)\n            };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(0, actualTargets.Count);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GeneratesZeroTargetForZeroInsightConfidence(Language language)\n        {\n            SetPortfolioConstruction(language, _algorithm);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, _algorithm.UtcTime, confidence:0)\n            };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(1, actualTargets.Count);\n            AssertTargets(actualTargets, new[] {new PortfolioTarget(Symbols.SPY, 0)});\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotThrowWithAlternativeOverloads(Language language)\n        {\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, _algorithm, Resolution.Minute));\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, _algorithm, TimeSpan.FromDays(1)));\n            Assert.DoesNotThrow(() => SetPortfolioConstruction(language, _algorithm, Expiry.EndOfWeek));\n        }\n\n        private Security GetSecurity(Symbol symbol)\n        {\n            var config = SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc);\n            return new Equity(\n                symbol,\n                config,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? confidence = Confidence)\n        {\n            period ??= TimeSpan.FromDays(1);\n            var insight = Insight.Price(symbol, period.Value, direction, confidence: confidence);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.CloseTimeUtc = generatedTimeUtc.Add(period.Value);\n            _algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        private void SetPortfolioConstruction(Language language, QCAlgorithm algorithm, dynamic paramenter = null)\n        {\n            paramenter = paramenter ?? Resolution.Daily;\n            algorithm.SetPortfolioConstruction(new ConfidenceWeightedPortfolioConstructionModel(paramenter));\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    var name = nameof(ConfidenceWeightedPortfolioConstructionModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython());\n                    var model = new PortfolioConstructionModelPythonWrapper(instance);\n                    algorithm.SetPortfolioConstruction(model);\n                }\n            }\n\n            foreach (var kvp in _algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n            _algorithm.Portfolio.SetCash(_startingCash);\n            SetUtcTime(new DateTime(2018, 7, 31));\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToArray());\n            algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        private void SetUtcTime(DateTime dateTime)\n        {\n            _algorithm.SetDateTime(dateTime.ConvertToUtc(_algorithm.TimeZone));\n        }\n\n        private void AssertTargets(IEnumerable<IPortfolioTarget> expectedTargets, IEnumerable<IPortfolioTarget> actualTargets)\n        {\n            var list = actualTargets.ToList();\n            Assert.AreEqual(expectedTargets.Count(), list.Count);\n\n            foreach (var expected in expectedTargets)\n            {\n                var actual = list.FirstOrDefault(x => x.Symbol == expected.Symbol);\n                Assert.IsNotNull(actual);\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/EqualWeightingPortfolioConstructionModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class EqualWeightingPortfolioConstructionModelTests : BaseWeightingPortfolioConstructionModelTests\n    {\n        public override double? Weight => Algorithm.Securities.Count == 0 ? default(double) : 1d / Algorithm.Securities.Count;\n\n        public virtual PortfolioBias PortfolioBias => PortfolioBias.LongShort;\n\n        [OneTimeSetUp]\n        public override void SetUp()\n        {\n            base.SetUp();\n\n            var prices = new Dictionary<Symbol, decimal>\n            {\n                { Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA), 55.22m },\n                { Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA), 145.17m },\n                { Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 281.79m },\n            };\n\n            foreach (var kvp in prices)\n            {\n                var symbol = kvp.Key;\n                var security = GetSecurity(symbol);\n                security.SetMarketPrice(new Tick(Algorithm.Time, symbol, kvp.Value, kvp.Value));\n                Algorithm.Securities.Add(symbol, security);\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void AutomaticallyRemoveInvestedWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            if (PortfolioBias != PortfolioBias.LongShort && (int)direction != (int)PortfolioBias)\n            {\n                direction = InsightDirection.Flat;\n            }\n\n            // Let's create a position for SPY\n            var insights = new[] { GetInsight(Symbols.SPY, direction, Algorithm.UtcTime) };\n\n            foreach (var target in Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights))\n            {\n                var holding = Algorithm.Portfolio[target.Symbol];\n                holding.SetHoldings(holding.Price, target.Quantity);\n                Algorithm.Portfolio.SetCash(StartingCash - holding.HoldingsValue);\n            }\n            SetUtcTime(Algorithm.UtcTime.AddDays(2));\n\n            // Equity will be divided by all securities minus 1, since SPY is already invested and we want to remove it\n            var amount = Algorithm.Portfolio.TotalPortfolioValue / (decimal)(1 / Weight - 1) *\n                         (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n            var expectedTargets = Algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since it will be removed\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction * Math.Floor(amount / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            // Do no include SPY in the insights\n            insights = Algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, Algorithm.UtcTime)).ToArray();\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void DelistedSecurityEmitsFlatTargetWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            if (PortfolioBias != PortfolioBias.LongShort && (int)direction != (int)PortfolioBias)\n            {\n                direction = InsightDirection.Flat;\n            }\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime) };\n            var targets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // Removing SPY should clear the key in the insight collection\n            var changes = SecurityChangesTests.RemovedNonInternal(Algorithm.Securities[Symbols.SPY]);\n            Algorithm.PortfolioConstruction.OnSecuritiesChanged(Algorithm, changes);\n\n            // Equity will be divided by all securities minus 1, since SPY is already invested and we want to remove it\n            var amount = Algorithm.Portfolio.TotalPortfolioValue / (decimal)(1 / Weight - 1) *\n                (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n            var expectedTargets = Algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since it will be removed\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction * Math.Floor(amount / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            // Do no include SPY in the insights\n            insights = Algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, Algorithm.UtcTime)).ToArray();\n\n            // Create target from an empty insights array\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights);\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void FlatDirectionNotAccountedToAllocation(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            if (PortfolioBias != PortfolioBias.LongShort && (int)direction != (int)PortfolioBias)\n            {\n                direction = InsightDirection.Flat;\n            }\n\n            // Equity, minus $1 for fees, will be divided by all securities minus 1, since its insight will have flat direction\n            var amount = (Algorithm.Portfolio.TotalPortfolioValue - 1 * (Algorithm.Securities.Count - 1)) * 1 /\n                         (decimal)((1 / Weight) - 1) * (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n            var expectedTargets = Algorithm.Securities.Select(x =>\n            {\n                // Expected target quantity for SPY is zero, since its insight will have flat direction\n                var quantity = x.Key.Value == \"SPY\" ? 0 : (int)direction * Math.Floor(amount / x.Value.Price);\n                return new PortfolioTarget(x.Key, quantity);\n            });\n\n            var insights = Algorithm.Securities.Keys.Select(x =>\n            {\n                // SPY insight direction is flat\n                var actualDirection = x.Value == \"SPY\" ? InsightDirection.Flat : direction;\n                return GetInsight(x, actualDirection, Algorithm.UtcTime);\n            });\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights.ToArray());\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up, 1)]\n        [TestCase(Language.CSharp, InsightDirection.Up, -1)]\n        [TestCase(Language.CSharp, InsightDirection.Down, 1)]\n        [TestCase(Language.CSharp, InsightDirection.Down, -1)]\n        [TestCase(Language.CSharp, InsightDirection.Flat, 1)]\n        [TestCase(Language.CSharp, InsightDirection.Flat, -1)]\n        [TestCase(Language.Python, InsightDirection.Up, 1)]\n        [TestCase(Language.Python, InsightDirection.Up, -1)]\n        [TestCase(Language.Python, InsightDirection.Down, 1)]\n        [TestCase(Language.Python, InsightDirection.Down, -1)]\n        [TestCase(Language.Python, InsightDirection.Flat, 1)]\n        [TestCase(Language.Python, InsightDirection.Flat, -1)]\n        public virtual void InsightsReturnsTargetsConsistentWithDirection(Language language, InsightDirection direction, int weightSign)\n        {\n            SetPortfolioConstruction(language);\n\n            if (PortfolioBias != PortfolioBias.LongShort && (int)direction != (int)PortfolioBias)\n            {\n                direction = InsightDirection.Flat;\n            }\n            // Equity will be divided by all securities\n            var amount = Algorithm.Portfolio.TotalPortfolioValue * (decimal)Weight *\n                (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n            var expectedTargets = Algorithm.Securities\n                .Select(x => new PortfolioTarget(x.Key, (int)direction * Math.Floor(amount / x.Value.Price)));\n\n            var insights = Algorithm.Securities.Keys.Select(x => GetInsight(x, direction, Algorithm.UtcTime, weight: weightSign * Weight));\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights.ToArray());\n\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        public override Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? weight = 0.01)\n        {\n            period ??= TimeSpan.FromDays(1);\n            var insight = Insight.Price(symbol, period.Value, direction, weight: Math.Max(0.01, Algorithm.Securities.Count));\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.CloseTimeUtc = generatedTimeUtc.Add(period.Value);\n            Algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        public override IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null)\n        {\n            if (language == Language.CSharp)\n            {\n                return new EqualWeightingPortfolioConstructionModel(paramenter);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(EqualWeightingPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/InsightWeightingPortfolioConstructionModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class InsightWeightingPortfolioConstructionModelTests : EqualWeightingPortfolioConstructionModelTests\n    {\n        private const double _weight = 0.01;\n\n        public override double? Weight => _weight;\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void WeightsProportionally(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // create two insights whose weights sums up to 2\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Up, Algorithm.UtcTime, weight:1),\n                GetInsight(Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                    InsightDirection.Up, Algorithm.UtcTime, weight:1)\n            };\n\n            // they will each share, proportionally, the total portfolio value\n            var amount = Algorithm.Portfolio.TotalPortfolioValue * (decimal)0.5;\n            var expectedTargets = Algorithm.Securities.Where(pair => insights.Any(insight => pair.Key == insight.Symbol))\n                .Select(x => new PortfolioTarget(x.Key, (int)InsightDirection.Up\n                    * Math.Floor(amount * (1 - Algorithm.Settings.FreePortfolioValuePercentage)\n                        / x.Value.Price)));\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(2, actualTargets.Count);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GeneratesNoTargetsForInsightsWithNoWeight(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime, weight:null)\n            };\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(0, actualTargets.Count);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GeneratesZeroTargetForZeroInsightWeight(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            var insights = new[]\n            {\n                GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime, weight:0)\n            };\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, actualTargets.Count);\n            AssertTargets(actualTargets, new[] {new PortfolioTarget(Symbols.SPY, 0)});\n        }\n\n        public override IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null)\n        {\n            if (language == Language.CSharp)\n            {\n                return new InsightWeightingPortfolioConstructionModel(paramenter);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(InsightWeightingPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        public override Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? weight = _weight)\n        {\n            period ??= TimeSpan.FromDays(1);\n            var insight = Insight.Price(symbol, period.Value, direction, weight: weight);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.CloseTimeUtc = generatedTimeUtc.Add(period.Value);\n            Algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        public override List<IPortfolioTarget> GetTargetsForSPY()\n        {\n            return new List<IPortfolioTarget> { PortfolioTarget.Percent(Algorithm, Symbols.SPY, -_weight) };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/LongOnlyEqualWeightingPortfolioConstructionModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class LongOnlyEqualWeightingPortfolioConstructionModelTests : EqualWeightingPortfolioConstructionModelTests\n    {\n        public override PortfolioBias PortfolioBias => PortfolioBias.Long;\n\n        public override IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null)\n        {\n            if (language == Language.CSharp)\n            {\n                return new EqualWeightingPortfolioConstructionModel(paramenter, PortfolioBias.Long);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(EqualWeightingPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython(), ((int) PortfolioBias.Long).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        public override List<IPortfolioTarget> GetTargetsForSPY()\n        {\n            return new List<IPortfolioTarget> { PortfolioTarget.Percent(Algorithm, Symbols.SPY, 0m) };\n        }\n    }\n}"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/LongOnlyInsightWeightingPortfolioConstructionModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class LongOnlyInsightWeightingPortfolioConstructionModelTests : InsightWeightingPortfolioConstructionModelTests\n    {\n        public override PortfolioBias PortfolioBias => PortfolioBias.Long;\n\n        public override IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null)\n        {\n            if (language == Language.CSharp)\n            {\n                return new InsightWeightingPortfolioConstructionModel(paramenter, PortfolioBias.Long);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(InsightWeightingPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython(), ((int)PortfolioBias.Long).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        public override List<IPortfolioTarget> GetTargetsForSPY()\n        {\n            return new List<IPortfolioTarget> { PortfolioTarget.Percent(Algorithm, Symbols.SPY, 0m) };\n        }\n    }\n}"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class MaximumSharpeRatioPortfolioOptimizerTests : PortfolioOptimizerTestsBase\n    {\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            HistoricalReturns = new List<double[,]>\n            {\n                new double[,] { { 0.02, -0.02, 0.28 }, { -0.50, -0.29, -0.13 }, { 0.81, 0.29, 0.31 }, { -0.03, -0.00, 0.01 } },\n                new double[,] { { 0.10, 0.20, 0.4 }, { 0.12, 0.25, 0.4 }, { 0.11, 0.22, 0.4 } },\n                new double[,] { { -0.19, 0.50, 0.45 }, { -0.62, -0.65, 0.07 }, { -0.14, 1.02, 0.01 }, { 0.00, -0.03, 0.01 } },\n                new double[,] { { 0.46, 0.28, 0.58, 0.26, 0.14 }, { 0.52, 0.31, 0.43, 7.43, -0.00 }, { 0.13, 0.65, 0.52, 0.50, -0.08 }, { -0.41, -0.39, -0.28, -0.65, -0.20 }, { 0.77, 0.58, 0.58, 1.02, 0.03 }, { -0.03, -0.01, -0.01, -0.03, 0.07 } },\n                new double[,] { { -0.50, -0.13 }, { 0.81, 0.31 }, { -0.02, 0.01 } },\n                new double[,] { { 0.31, 0.25, 0.43 }, { 0.65, 0.60, 0.52 }, { -0.39, -0.22, -0.28 }, { 0.58, 0.13, 0.58 }, { -0.01, -0.00, -0.01 } },\n                new double[,] { { 0.13, 0.65, 1.25 }, { -0.41, -0.39, -0.50 }, { 0.77, 0.58, 2.39 }, { -0.03, -0.01, 0.04 } },\n                new double[,] { { 0.31, 0.43, 1.22, 0.03 }, { 0.65, 0.52, 1.25, 0.67 }, { -0.39, -0.28, -0.50, -0.10 }, { 0.58, 0.58, 2.39, -0.41 }, { -0.01, -0.01, 0.04, 0.03 } }\n            };\n\n            ExpectedReturns = new List<double[]>\n            {\n                new double[] { 0.08, -0.01, 0.12 },\n                new double[] { 0.11, 0.23, 0.4 },\n                new double[] { -0.24, 0.21, 0.14 },\n                null,\n                new double[] { 0.10, 0.06 },\n                new double[] { 0.23, 0.15, 0.25 },\n                null,\n                new double[] { 0.23, 0.25, 0.88, 0.04 }\n            };\n\n            Covariances = new List<double[,]>\n            {\n                new double[,] { { 0.29, 0.13, 0.10 }, { 0.13, 0.06, 0.04 }, { 0.10, 0.04, 0.05 } },\n                null,\n                new double[,] { { 0.07, 0.12, -0.00 }, { 0.12, 0.51, 0.03 }, { -0.00, 0.03, 0.04 } },\n                null,\n                new double[,] { { 0.44, 0.15 }, { 0.15, 0.05 } },\n                new double[,] { { 0.19, 0.11, 0.16 }, { 0.11, 0.09, 0.09 }, { 0.16, 0.09, 0.14 } },\n                new double[,] { { 0.24, 0.20, 0.61 }, { 0.20, 0.25, 0.58 }, { 0.61, 0.58, 1.67 } },\n                new double[,] { { 0.19, 0.16, 0.44, 0.05 }, { 0.16, 0.14, 0.40, 0.02 }, { 0.44, 0.40, 1.29, -0.06 }, { 0.05, 0.02, -0.06, 0.15 } }\n            };\n\n            ExpectedResults = new List<double[]>\n            {\n                new double[] { -0.562396, 0.608942, 0.953453 },\n                new double[] { 0.686025, -0.269589, 0.583023 },\n                new double[] { 0.26394, -0.043374, 0.779434 },\n                new double[] { -0.223905, 0.401036, 1, 0.065329, -0.24246 },\n                new double[] { 0.5, 0.5 },\n                new double[] { -0.5, 0.5, 1 },\n                new double[] { -0.242647, 1, 0.242647 },\n                new double[] { -1, 0.922902, 0.364512, 0.712585 },\n            };\n        }\n\n        protected override IPortfolioOptimizer CreateOptimizer()\n        {\n            return new MaximumSharpeRatioPortfolioOptimizer();\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(6)]\n        [TestCase(7)]\n        public override void OptimizeWeightings(int testCaseNumber)\n        {\n            base.OptimizeWeightings(testCaseNumber);\n        }\n\n        [TestCase(0)]\n        public void OptimizeWeightingsSpecifyingLowerBoundAndRiskFreeRate(int testCaseNumber)\n        {\n            var testOptimizer = new MaximumSharpeRatioPortfolioOptimizer(lower: 0, riskFreeRate: 0.04);\n            var expectedResult = new double[] { 0, 0.44898, 0.55102 };\n\n            var result = testOptimizer.Optimize(HistoricalReturns[testCaseNumber]);\n\n            Assert.AreEqual(expectedResult, result.Select(x => Math.Round(x, 6)));\n        }\n\n        [Test]\n        public void SingleSecurityPortfolioReturnsNaN()\n        {\n            var testOptimizer = new MaximumSharpeRatioPortfolioOptimizer();\n            var historicalReturns = new double[,] { { -0.1 } };\n            var expectedReturns = new double[] { -0.1 };\n\n            var expectedResult = new double[] { double.NaN };\n\n            var result = testOptimizer.Optimize(historicalReturns, expectedReturns);\n\n            Assert.AreEqual(result, expectedResult);\n        }\n\n        [Test]\n        public void EqualWeightingsWhenNoSolutionFound()\n        {\n            var testOptimizer = new MaximumSharpeRatioPortfolioOptimizer();\n            var historicalReturns = new double[,] { { -0.10, -0.20 }, { -0.12, -0.25 } };\n            var expectedReturns = new double[] { -0.10, -0.25 };\n            var covariance = new double[,] { { 0.25, 0.12 }, { 0.45, 0.2 } }; // non positive definite\n\n            var expectedResult = new double[] { 0.5, 0.5 };\n\n            var result = testOptimizer.Optimize(historicalReturns, expectedReturns, covariance);\n\n            Assert.AreEqual(result, expectedResult);\n        }\n\n        [Test]\n        public void BoundariesAreNotViolated()\n        {\n            var testCaseNumber = 1;\n            var lower = 0d;\n            var upper = 0.5d;\n            var testOptimizer = new MaximumSharpeRatioPortfolioOptimizer(lower, upper);\n\n            var result = testOptimizer.Optimize(HistoricalReturns[testCaseNumber], null, Covariances[testCaseNumber]);\n\n            foreach (var x in result)\n            {\n                var rounded = Math.Round(x, 6);\n                Assert.GreaterOrEqual(rounded, lower);\n                Assert.LessOrEqual(rounded, upper);\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/MeanReversionPortfolioConstructionModelTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Packets;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class MeanReversionPortfolioConstructionModelTests\n    {\n        private DateTime _nowUtc;\n        private QCAlgorithm _algorithm;\n        private List<double> _simplexTestArray;\n        private double[] _simplexExpectedArray1, _simplexExpectedArray2;\n\n        [SetUp]\n        public virtual void SetUp()\n        {\n            _nowUtc = new DateTime(2021, 1, 10);\n            _algorithm = new AlgorithmStub();\n            _algorithm.SetFinishedWarmingUp();\n            _algorithm.Settings.MinimumOrderMarginPortfolioPercentage = 0;\n            _algorithm.Settings.FreePortfolioValue = 250;\n            _algorithm.SetDateTime(_nowUtc.ConvertToUtc(_algorithm.TimeZone));\n            _algorithm.SetCash(1200);\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            _algorithm.SetHistoryProvider(historyProvider);\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                new BacktestNodePacket(),\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                i => { },\n                true,\n                new DataPermissionManager(),\n                _algorithm.ObjectStore,\n                _algorithm.Settings));\n\n            _simplexTestArray = new List<double> {0.2d, 0.5d, 0.4d, -0.1d, 0d};\n            _simplexExpectedArray1 = new double[] {1d/6, 7d/15, 11d/30, 0d, 0d};\n            _simplexExpectedArray2 = new double[] {0d, 0.3d, 0.2d, 0d, 0d};\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotReturnTargetsIfSecurityPriceIsZero(Language language)\n        {\n            _algorithm.AddEquity(Symbols.SPY.Value);\n            _algorithm.SetDateTime(_nowUtc.ConvertToUtc(_algorithm.TimeZone));\n\n            SetPortfolioConstruction(language, PortfolioBias.Long);\n\n            var insights = new[] { new Insight(_nowUtc, Symbols.SPY, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null) };\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [TestCase(Language.CSharp, PortfolioBias.Long)]\n        [TestCase(Language.Python, PortfolioBias.Long)]\n        [TestCase(Language.CSharp, PortfolioBias.Short)]\n        [TestCase(Language.Python, PortfolioBias.Short)]\n        public void PortfolioBiasIsRespected(Language language, PortfolioBias bias)\n        {\n            if (bias == PortfolioBias.Short)\n            {\n                var throwsConstraint = language == Language.CSharp\n                    ? Throws.InstanceOf<ArgumentException>()\n                    : Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>();\n                Assert.That(() => GetPortfolioConstructionModel(language, bias, Resolution.Daily),\n                    throwsConstraint.And.Message.EqualTo(\"Long position must be allowed in MeanReversionPortfolioConstructionModel.\"));\n                return;\n            }\n\n            var targets = GeneratePortfolioTargets(language, InsightDirection.Up, InsightDirection.Up, 1, 1);\n            foreach (var target in targets)\n            {\n                if (target.Quantity == 0)\n                {\n                    continue;\n                }\n                Assert.AreEqual(Math.Sign((int)bias), Math.Sign(target.Quantity));\n            }\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, null, null, 47, 47)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, null, null, 47, 47)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0, 0, 47, 47)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0, 0, 47, 47)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 1, -0.5, 31, 63)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 1, -0.5, 31, 63)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Down, 1, 0.5, 31, 63)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Down, 1, 0.5, 31, 63)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0, -0.5, 47, 47)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0, -0.5, 47, 47)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0, 1, 94, 0)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0, 1, 94, 0)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0.5, -1, 47, 47)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0.5, -1, 47, 47)]\n        public void CorrectWeightings(Language language,\n                                      InsightDirection direction1,\n                                      InsightDirection direction2,\n                                      double? magnitude1,\n                                      double? magnitude2,\n                                      decimal expectedQty1,\n                                      decimal expectedQty2)\n        {\n            var targets = GeneratePortfolioTargets(language, direction1, direction2, magnitude1, magnitude2);\n            var quantities = targets.ToDictionary(target => {\n                QuantConnect.Logging.Log.Debug($\"{target.Symbol}: {target.Quantity}\");\n                return target.Symbol.Value;\n            },\n            target => target.Quantity);\n\n            Assert.AreEqual(expectedQty1, quantities[\"AAPL\"]);\n            Assert.AreEqual(expectedQty2, quantities.ContainsKey(\"SPY\") ? quantities[\"SPY\"] : 0);\n        }\n\n        [Test]\n        public void CumulativeSum()\n        {\n            var list = new List<double>{1.1d, 2.5d, 0.7d, 13.6d, -5.2d, 3.9d, -1.6d};\n            var expected = new List<double>{1.1d, 3.6d, 4.3d, 17.9d, 12.7d, 16.6d, 15.0d};\n\n            var result = MeanReversionPortfolioConstructionModel.CumulativeSum(list)\n                .Select(x => Math.Round(x, 1));\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void GetPriceRelatives()\n        {\n            var model = new TestMeanReversionPortfolioConstructionModel();\n            SetPortfolioConstruction(Language.CSharp, PortfolioBias.Long, model);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            var insights = new List<Insight>\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n            };\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            var history = _algorithm.History<TradeBar>(new[] {aapl.Symbol, spy.Symbol}, 2, Resolution.Daily);\n            var aaplHist = history.Select(slice => slice[aapl.Symbol].Close);\n            var spyHist = history.Select(slice => slice[spy.Symbol].Close);\n            var aaplRelative = (double) (aaplHist.Last() / aaplHist.Average());\n            var spyRelative = (double) (spyHist.Last() / spyHist.Average());\n\n            var result = model.TestGetPriceRelatives(insights).Select(x => Math.Round(x, 8)).ToArray();\n            var expected = new double[] {aaplRelative, spyRelative};\n            expected = expected.Select(x => Math.Round(x, 8)).ToArray();\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void GetPriceRelativesPython()\n        {\n            SetPortfolioConstruction(Language.Python, PortfolioBias.Long);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            var insights = new List<Insight>\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n            };\n\n            var history = _algorithm.History<TradeBar>(new[] {aapl.Symbol, spy.Symbol}, 2, Resolution.Daily);\n            var aaplHist = history.Select(slice => slice[aapl.Symbol].Close);\n            var spyHist = history.Select(slice => slice[spy.Symbol].Close);\n            var aaplRelative = (double) (aaplHist.Last() / aaplHist.Average());\n            var spyRelative = (double) (spyHist.Last() / spyHist.Average());\n\n            using (Py.GIL())\n            {\n                const string name = nameof(MeanReversionPortfolioConstructionModel);\n                var model = Py.Import(name).GetAttr(name).Invoke(((int)Resolution.Daily).ToPython(), ((int)PortfolioBias.LongShort).ToPython(), 1.ToPython(), 2.ToPython());\n                model.InvokeMethod(\"OnSecuritiesChanged\", _algorithm.ToPython(), SecurityChangesTests.AddedNonInternal(aapl, spy).ToPython());\n\n                var result = PyList.AsList(model.InvokeMethod(\"GetPriceRelatives\", insights.ToPython()));\n                var resultArray = result.Select(x => Math.Round(Convert.ToDouble(x), 8)).ToArray();\n                var expected = new double[] {aaplRelative, spyRelative};\n                expected = expected.Select(x => Math.Round(x, 8)).ToArray();\n                Assert.AreEqual(expected, resultArray);\n            }\n        }\n\n        [Test]\n        public void GetPriceRelativesWithInsightMagnitude()\n        {\n            var model = new TestMeanReversionPortfolioConstructionModel();\n            SetPortfolioConstruction(Language.CSharp, PortfolioBias.Long, model);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            var insights = new List<Insight>\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, 1, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, -0.5, null),\n            };\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            var result = model.TestGetPriceRelatives(insights);\n            var expected = new double[] {2d, 0.5d};\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void GetPriceRelativesWithInsightMagnitudePython()\n        {\n            SetPortfolioConstruction(Language.Python, PortfolioBias.Long);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            var insights = new List<Insight>\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, 1, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, -0.5, null),\n            };\n\n            using (Py.GIL())\n            {\n                const string name = nameof(MeanReversionPortfolioConstructionModel);\n                var model = Py.Import(name).GetAttr(name).Invoke(((int)Resolution.Daily).ToPython());\n                model.InvokeMethod(\"OnSecuritiesChanged\", _algorithm.ToPython(), SecurityChangesTests.AddedNonInternal(aapl, spy).ToPython());\n\n                var result = PyList.AsList(model.InvokeMethod(\"GetPriceRelatives\", insights.ToPython()));\n                var resultArray = result.Select(x => Convert.ToDouble(x)).ToArray();\n                var expected = new double[] {2d, 0.5d};\n                Assert.AreEqual(expected, resultArray);\n            }\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(0)]\n        [TestCase(-0.5)]\n        public void SimplexProjection(double regulator)\n        {\n            if (regulator <= 0)\n            {\n                var exception = Assert.Throws<ArgumentException>(() => MeanReversionPortfolioConstructionModel.SimplexProjection(_simplexTestArray, regulator));\n                Assert.That(exception.Message, Is.EqualTo(\"Total must be > 0 for Euclidean Projection onto the Simplex.\"));\n                return;\n            }\n\n            double[] expected;\n            if (regulator == 1d)\n            {\n                expected = _simplexExpectedArray1;\n            }\n            else\n            {\n                expected = _simplexExpectedArray2;\n            }\n            expected = expected.Select(x => Math.Round(x, 8)).ToArray();\n\n            var result = MeanReversionPortfolioConstructionModel.SimplexProjection(_simplexTestArray, regulator);\n            result = result.Select(x => Math.Round(x, 8)).ToArray();\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(0)]\n        [TestCase(-0.5)]\n        public void SimplexProjectionPython(double regulator)\n        {\n            using (Py.GIL())\n            {\n                const string name = nameof(MeanReversionPortfolioConstructionModel);\n                var model = Py.Import(name).GetAttr(name).Invoke(((int)Resolution.Daily).ToPython());\n\n                if (regulator <= 0)\n                {\n                    Assert.That(() => model.InvokeMethod(\"SimplexProjection\", _simplexTestArray.ToPython(), new PyFloat(regulator)),\n                        Throws.InstanceOf<ClrBubbledException>()\n                            .With.InnerException.InstanceOf<ArgumentException>()\n                            .And.Message.EqualTo(\"Total must be > 0 for Euclidean Projection onto the Simplex.\"));\n                    return;\n                }\n\n                double[] expected;\n                if (regulator == 1d)\n                {\n                    expected = _simplexExpectedArray1;\n                }\n                else\n                {\n                    expected = _simplexExpectedArray2;\n                }\n                var expectedArray = expected.Select(x => Math.Round(x, 8)).ToArray();\n\n                var result = PyList.AsList(model.InvokeMethod(\"SimplexProjection\", _simplexTestArray.ToPython(), new PyFloat(regulator)));\n                var resultArray = result.Select(x => Math.Round(Convert.ToDouble(x), 8)).ToArray();\n                Assert.AreEqual(expectedArray, resultArray);\n            }\n        }\n\n        private IEnumerable<IPortfolioTarget> GeneratePortfolioTargets(Language language, InsightDirection direction1, InsightDirection direction2, double? magnitude1, double? magnitude2)\n        {\n            SetPortfolioConstruction(language, PortfolioBias.Long);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            foreach (var equity in new[] { aapl, spy })\n            {\n                equity.SetMarketPrice(new Tick(_nowUtc, equity.Symbol, 10, 10));\n            }\n\n            var insights = new[]\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, direction1, magnitude1, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, direction2, magnitude2, null),\n            };\n            _algorithm.Insights.AddRange(insights);\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            return _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n        }\n\n        protected void SetPortfolioConstruction(Language language, PortfolioBias bias, IPortfolioConstructionModel defaultModel = null)\n        {\n            var model = defaultModel ?? GetPortfolioConstructionModel(language, bias, Resolution.Daily);\n            _algorithm.SetPortfolioConstruction(model);\n\n            foreach (var kvp in _algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToArray());\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        public IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, PortfolioBias bias, Resolution resolution)\n        {\n            if (language == Language.CSharp)\n            {\n                return new MeanReversionPortfolioConstructionModel(resolution, bias, 1, 1, resolution);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(MeanReversionPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name)\n                    .Invoke(((int)resolution).ToPython(), ((int)bias).ToPython(), 1.ToPython(), 1.ToPython(), ((int)resolution).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        private class TestMeanReversionPortfolioConstructionModel : MeanReversionPortfolioConstructionModel\n        {\n            public TestMeanReversionPortfolioConstructionModel()\n                : base(Resolution.Daily, windowSize: 2)\n            {\n            }\n\n            public double[] TestGetPriceRelatives(List<Insight> insights)\n            {\n                return base.GetPriceRelatives(insights);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Packets;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class MeanVarianceOptimizationPortfolioConstructionModelTests\n    {\n        private DateTime _nowUtc;\n        private QCAlgorithm _algorithm;\n\n        [SetUp]\n        public virtual void SetUp()\n        {\n            _nowUtc = new DateTime(2013, 10, 8);\n            _algorithm = new QCAlgorithm();\n            _algorithm.SetFinishedWarmingUp();\n            _algorithm.SetPandasConverter();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _algorithm.SetDateTime(_nowUtc.ConvertToUtc(_algorithm.TimeZone));\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            _algorithm.SetHistoryProvider(historyProvider);\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                i => { },\n                true,\n                new DataPermissionManager(),\n                _algorithm.ObjectStore,\n                _algorithm.Settings));\n        }\n\n        private void Clear() => _algorithm.Insights.Clear(_algorithm.Securities.Keys.ToArray());\n\n        [TestCase(Language.CSharp, PortfolioBias.Long, 0.1, -0.1)]\n        [TestCase(Language.Python, PortfolioBias.Long, 0.1, -0.1)]\n        [TestCase(Language.CSharp, PortfolioBias.Short, -0.1, 0.1)]\n        [TestCase(Language.Python, PortfolioBias.Short, -0.1, 0.1)]\n        [TestCase(Language.CSharp, PortfolioBias.Long, -0.1, 0.1)]\n        [TestCase(Language.Python, PortfolioBias.Long, -0.1, 0.1)]\n        [TestCase(Language.CSharp, PortfolioBias.Short, 0.1, -0.1)]\n        [TestCase(Language.Python, PortfolioBias.Short, 0.1, -0.1)]\n        public void PortfolioBiasIsRespected(Language language, PortfolioBias bias, double magnitude1, double magnitude2)\n        {\n            var targets = GeneratePortfolioTargets(language, InsightDirection.Up, InsightDirection.Down, magnitude1, magnitude2, bias);\n\n            foreach (var target in targets)\n            {\n                QuantConnect.Logging.Log.Trace($\"{target.Symbol}: {target.Quantity}\");\n                if (target.Quantity == 0)\n                {\n                    continue;\n                }\n                Assert.AreEqual(Math.Sign((int)bias), Math.Sign(target.Quantity));\n            }\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0, 0, 4155, 2493)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0, 0, 4155, 2493)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Down, 0.1, 0.05, 4155, 2493)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Down, 0.1, 0.05, 4155, 2493)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0.1, 0, 4155, 2493)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0.1, 0, 4155, 2493)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Down, 0, 0.1, 4155, 2493)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Down, 0, 0.1, 4155, 2493)]\n        public void CorrectWeightings(Language language,\n                                      InsightDirection direction1,\n                                      InsightDirection direction2,\n                                      double? magnitude1,\n                                      double? magnitude2,\n                                      decimal expectedQty1,\n                                      decimal expectedQty2)\n        {\n            var targets = GeneratePortfolioTargets(language, direction1, direction2, magnitude1, magnitude2).ToList();\n            Clear();\n            var quantities = targets.ToDictionary(target => {\n                QuantConnect.Logging.Log.Trace($\"{target.Symbol}: {target.Quantity}\");\n                return target.Symbol.Value;\n            },\n            target => target.Quantity);\n\n            Assert.AreEqual(expectedQty1, quantities[\"AAPL\"]);\n            Assert.AreEqual(expectedQty2, quantities.ContainsKey(\"SPY\") ? quantities[\"SPY\"] : 0);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotReturnTargetsIfNoInsightMagnitude(Language language)\n        {\n            SetPortfolioConstruction(language, PortfolioBias.LongShort);\n\n            var appl = _algorithm.AddEquity(\"AAPL\");\n\n            var insights = new[]\n            {\n                new Insight(_nowUtc, appl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null)\n            };\n\n            var actualTargets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToList();\n            Assert.AreEqual(0, actualTargets.Count);\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0.1, 0.1)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0.1, 0.1)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0.1, -0.1)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0.1, -0.1)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Up, 0.1, 0)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Up, 0.1, 0)]\n        [TestCase(Language.CSharp, InsightDirection.Up, InsightDirection.Down, 0.1, 0.1)]\n        [TestCase(Language.Python, InsightDirection.Up, InsightDirection.Down, 0.1, 0.1)]\n        public void ObeyBudgetConstraint(Language language,\n                                         InsightDirection direction1,\n                                         InsightDirection direction2,\n                                         double? magnitude1,\n                                         double? magnitude2)\n        {\n            var targets = GeneratePortfolioTargets(language, direction1, direction2, magnitude1, magnitude2);\n            var totalCost = targets.Sum(x => Math.Abs(x.Quantity) * 10);    // Set market price at $10 in the helper method\n            Assert.LessOrEqual(totalCost, _algorithm.Portfolio.TotalPortfolioValue);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(6)]\n        [TestCase(7)]\n        public void PythonConstructorWorksWithDifferentArguments(int arguments)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\ntimeDelta = timedelta(days=1)\nclass CustomPortfolioOptimizer:\n    def Optimize(self, historicalReturns, expectedReturns, covariance):\n        return [0.5]*(np.array(historicalReturns)).shape[1]\"\n                    );\n                var timeDelta = module.GetAttr(\"timeDelta\");\n                var portfolioBias = PortfolioBias.LongShort;\n                var lookback = 1;\n                var period = 63;\n                var resolution = Resolution.Daily;\n                var targetReturn = 0.02;\n                var optimizer = module.GetAttr(\"CustomPortfolioOptimizer\").Invoke();\n\n                switch (arguments)\n                {\n                    case 1:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta));\n                        break;\n                    case 2:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias));\n                        break;\n                    case 3:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias, lookback));\n                        break;\n                    case 4:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias, lookback, period));\n                        break;\n                    case 5:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias, lookback, period, resolution));\n                        break;\n                    case 6:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias, lookback, period, resolution, targetReturn));\n                        break;\n                    case 7:\n                        Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(timeDelta, portfolioBias, lookback, period, resolution, targetReturn, optimizer));\n                        break;\n                }\n            }\n        }\n\n        [TestCase(\"timeDelta\")]\n        [TestCase(\"pyFunc\")]\n        public void PythonConstructorWorksWithDifferentArgumentRebalance(string rebalanceName)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @\"from AlgorithmImports import *\ntimeDelta = timedelta(days=1)\npyFunc = lambda x: x + timedelta(days=1)\");\n                var rebalance = module.GetAttr(rebalanceName);\n                Assert.DoesNotThrow(() => new MeanReversionPortfolioConstructionModel(rebalance));\n            }\n        }\n\n        [TestCase(\"CustomPortfolioOptimizer\")]\n        [TestCase(\"csharpOptimizer\")]\n        public void PythonConstructorWorksWithDifferentOptimizers(string optimizerName)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @\"from AlgorithmImports import *\nrebalance = timedelta(days=1)\ncsharpOptimizer = MinimumVariancePortfolioOptimizer()\n\nclass CustomPortfolioOptimizer:\n    def Optimize(self, historicalReturns, expectedReturns, covariance):\n        pass\");\n\n                var rebalance = module.GetAttr(\"rebalance\");\n                var optimizer = module.GetAttr(optimizerName);\n                if (optimizerName == \"customOptimizer\")\n                {\n                    optimizer = optimizer.Invoke();\n                }\n\n                Assert.DoesNotThrow(() => new MeanVarianceOptimizationPortfolioConstructionModel(rebalance, optimizer: optimizer));\n            }\n        }\n\n        [Test]\n        public void PythonConstructorFailsWhenOptimizerTypeIsInvalid()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @\"from AlgorithmImports import *\nrebalance = timedelta(days=1)\nclass CustomPortfolioOptimizer:\n    pass\");\n                var rebalance = module.GetAttr(\"rebalance\");\n                var optimizer = module.GetAttr(\"CustomPortfolioOptimizer\").Invoke();\n\n                var message = Assert.Throws<NotImplementedException>(() => new MeanVarianceOptimizationPortfolioConstructionModel(rebalance, optimizer: optimizer));\n            }\n        }\n\n        protected void SetPortfolioConstruction(Language language, PortfolioBias bias)\n        {\n            var model = GetPortfolioConstructionModel(language, Resolution.Daily, bias);\n            _algorithm.SetPortfolioConstruction(model);\n\n            foreach (var kvp in _algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToArray());\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        public IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, Resolution resolution, PortfolioBias bias)\n        {\n            if (language == Language.CSharp)\n            {\n                return new MeanVarianceOptimizationPortfolioConstructionModel(resolution, bias, 1, 63, Resolution.Daily, 0.0001);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(MeanVarianceOptimizationPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name)\n                    .Invoke(((int)resolution).ToPython(), ((int)bias).ToPython(), 1.ToPython(), 63.ToPython(), ((int)Resolution.Daily).ToPython(), 0.0001.ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        private IEnumerable<IPortfolioTarget> GeneratePortfolioTargets(Language language, InsightDirection direction1, InsightDirection direction2,\n                                                                       double? magnitude1, double? magnitude2, PortfolioBias bias = PortfolioBias.LongShort)\n        {\n            SetPortfolioConstruction(language, bias);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            aapl.SetMarketPrice(new Tick(_nowUtc, aapl.Symbol, 10, 10));\n            spy.SetMarketPrice(new Tick(_nowUtc, spy.Symbol, 10, 10));\n            aapl.SetMarketPrice(new Tick(_nowUtc.AddDays(1), aapl.Symbol, 8, 8));\n            spy.SetMarketPrice(new Tick(_nowUtc.AddDays(1), spy.Symbol, 15, 15));\n            aapl.SetMarketPrice(new Tick(_nowUtc.AddDays(2), aapl.Symbol, 12, 12));\n            spy.SetMarketPrice(new Tick(_nowUtc.AddDays(2), spy.Symbol, 20, 20));\n\n            var insights = new[]\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, direction1, magnitude1, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, direction2, magnitude2, null),\n            };\n            _algorithm.Insights.AddRange(insights);\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            return _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/MinimumVariancePortfolioOptimizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class MinimumVariancePortfolioOptimizerTests : PortfolioOptimizerTestsBase\n    {\n        private Dictionary<int, double> _targetReturns;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            var historicalReturns1 = new double[,] { { 0.76, -0.06, 1.22, 0.17 }, { 0.02, 0.28, 1.25, -0.00 }, { -0.50, -0.13, -0.50, -0.03 }, { 0.81, 0.31, 2.39, 0.26 }, { -0.02, 0.02, 0.06, 0.01 } };\n            var historicalReturns2 = new double[,] { { -0.15, 0.67, 0.45 }, { -0.44, -0.10, 0.07 }, { 0.04, -0.41, 0.01 }, { 0.01, 0.03, 0.02 } };\n            var historicalReturns3 = new double[,] { { -0.02, 0.65, 1.25 }, { -0.29, -0.39, -0.50 }, { 0.29, 0.58, 2.39 }, { 0.00, -0.01, 0.06 } };\n            var historicalReturns4 = new double[,] { { 0.76, 0.25, 0.21 }, { 0.02, -0.15, 0.45 }, { -0.50, -0.44, 0.07 }, { 0.81, 0.04, 0.01 }, { -0.02, 0.01, 0.02 } };\n\n            var expectedReturns1 = new double[] { 0.21, 0.08, 0.88, 0.08 };\n            var expectedReturns2 = new double[] { -0.13, 0.05, 0.14 };\n            var expectedReturns3 = (double[])null;\n            var expectedReturns4 = (double[])null;\n\n            var covariance1 = new double[,] { { 0.31, 0.05, 0.55, 0.07 }, { 0.05, 0.04, 0.18, 0.01 }, { 0.55, 0.18, 1.28, 0.12 }, { 0.07, 0.01, 0.12, 0.02 } };\n            var covariance2 = new double[,] { { 0.05, -0.02, -0.01 }, { -0.02, 0.21, 0.09 }, { -0.01, 0.09, 0.04 } };\n            var covariance3 = new double[,] { { 0.06, 0.09, 0.28 }, { 0.09, 0.25, 0.58 }, { 0.28, 0.58, 1.66 } };\n            var covariance4 = (double[,])null;\n\n            HistoricalReturns = new List<double[,]>\n            {\n                historicalReturns1, \n                historicalReturns2,\n                historicalReturns3,\n                historicalReturns4,\n                historicalReturns1,\n                historicalReturns2,\n                historicalReturns3,\n                historicalReturns4\n            };\n\n            ExpectedReturns = new List<double[]>\n            {\n                expectedReturns1,\n                expectedReturns2,\n                expectedReturns3,\n                expectedReturns4,\n                expectedReturns1,\n                expectedReturns2,\n                expectedReturns3,\n                expectedReturns4\n            };\n\n            Covariances = new List<double[,]>\n            {\n                covariance1,\n                covariance2,\n                covariance3,\n                covariance4,\n                covariance1,\n                covariance2,\n                covariance3,\n                covariance4\n            };\n\n            ExpectedResults = new List<double[]>\n            {\n                new double[] { -0.089212, 0.23431, -0.040975, 0.635503 },\n                new double[] { 0.366812, -0.139738, 0.49345 },\n                new double[] { 0.562216, 0.36747, -0.070314 },\n                new double[] { -0.119241, 0.443464, 0.437295 },\n                new double[] { -0.215505, 0.130699, 0.084806, 0.56899 },\n                new double[] { -0.275, 0.275, 0.45 },\n                new double[] { -0.129512, 0.551139, 0.319349 },\n                new double[] { 0.052859, 0.144177, 0.802964 },\n            };\n\n            _targetReturns = new Dictionary<int, double>\n            {\n                { 4, 0.15d },\n                { 5, 0.25d },\n                { 6, 0.5d },\n                { 7, 0.125d }\n            };\n        }\n\n        protected override IPortfolioOptimizer CreateOptimizer()\n        {\n            return new MinimumVariancePortfolioOptimizer();\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        public override void OptimizeWeightings(int testCaseNumber)\n        {\n            base.OptimizeWeightings(testCaseNumber);\n        }\n\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(6)]\n        [TestCase(7)]\n        public void OptimizeWeightingsSpecifyingTargetReturns(int testCaseNumber)\n        {\n            var testOptimizer = new MinimumVariancePortfolioOptimizer(targetReturn: _targetReturns[testCaseNumber]);\n\n            var result = testOptimizer.Optimize(\n                HistoricalReturns[testCaseNumber],\n                ExpectedReturns[testCaseNumber],\n                Covariances[testCaseNumber]);\n\n            Assert.AreEqual(ExpectedResults[testCaseNumber], result.Select(x => Math.Round(x, 6)));\n            Assert.AreEqual(1d, result.Select(x => Math.Round(Math.Abs(x), 6)).Sum());\n        }\n\n        [TestCase(0)]\n        public void EqualWeightingsWhenNoSolutionFound(int testCaseNumber)\n        {\n            var testOptimizer = new MinimumVariancePortfolioOptimizer(upper: -1);\n            var expectedResult = new double[] { 0.25, 0.25, 0.25, 0.25 };\n\n            var result = testOptimizer.Optimize(HistoricalReturns[testCaseNumber]);\n\n            Assert.AreEqual(expectedResult, result);\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        public void BoundariesAreNotViolated(int testCaseNumber)\n        {\n            var lower = 0d;\n            var upper = 0.5d;\n            var testOptimizer = new MinimumVariancePortfolioOptimizer(lower, upper);\n\n            var result = testOptimizer.Optimize(\n                HistoricalReturns[testCaseNumber],\n                ExpectedReturns[testCaseNumber],\n                Covariances[testCaseNumber]);\n\n            foreach (var x in result)\n            {\n                var rounded = Math.Round(x, 6);\n                Assert.GreaterOrEqual(rounded, lower);\n                Assert.LessOrEqual(rounded, upper);\n            };\n        }\n\n        [Test]\n        public void SingleSecurityPortfolioReturnsOne()\n        {\n            var testOptimizer = new MinimumVariancePortfolioOptimizer();\n            var historicalReturns = new double[,] { { 0.76 }, { 0.02 }, { -0.50 } };\n            var expectedResult = new double[] { 1 };\n\n            var result = testOptimizer.Optimize(historicalReturns);\n\n            Assert.AreEqual(expectedResult, result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioConstructionModelPythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class PortfolioConstructionModelPythonWrapperTests\n    {\n        [Test]\n        public void PythonCompleteImplementation()\n        {\n            var algorithm = new AlgorithmStub();\n\n            using (Py.GIL())\n            {\n                dynamic model = PyModule.FromString(\n                    \"TestPCM\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass PyPCM(EqualWeightingPortfolioConstructionModel):\n    def __init__(self):\n        super().__init__()\n        self.CreateTargets_WasCalled = False\n        self.OnSecuritiesChanged_WasCalled = False\n        self.ShouldCreateTargetForInsight_WasCalled = False\n        self.IsRebalanceDue_WasCalled = False\n        self.GetTargetInsights_WasCalled = False\n        self.DetermineTargetPercent_WasCalled = False\n\n    def CreateTargets(self, algorithm, insights):\n        self.CreateTargets_WasCalled = True\n        return super().CreateTargets(algorithm, insights)\n\n    def OnSecuritiesChanged(self, algorithm, changes):\n        self.OnSecuritiesChanged_WasCalled = True\n        super().OnSecuritiesChanged(algorithm, changes)\n\n    def ShouldCreateTargetForInsight(self, insight):\n        self.ShouldCreateTargetForInsight_WasCalled = True\n        return super().ShouldCreateTargetForInsight(insight)\n\n    def IsRebalanceDue(self, insights, algorithmUtc):\n        self.IsRebalanceDue_WasCalled = True\n        return True\n\n    def GetTargetInsights(self):\n        self.GetTargetInsights_WasCalled = True\n        return super().GetTargetInsights()\n\n    def DetermineTargetPercent(self, activeInsights):\n        self.DetermineTargetPercent_WasCalled = True\n        return super().DetermineTargetPercent(activeInsights)\n\"\n                ).GetAttr(\"PyPCM\").Invoke();\n                var now = new DateTime(2020, 1, 10);\n                var wrappedModel = new PortfolioConstructionModelPythonWrapper(model);\n                var aapl = algorithm.AddEquity(\"AAPL\");\n                aapl.SetMarketPrice(new Tick(now, aapl.Symbol, 10, 10));\n                algorithm.SetDateTime(now);\n\n                wrappedModel.OnSecuritiesChanged(algorithm, new SecurityChanges(SecurityChangesTests.AddedNonInternal(aapl)));\n                Assert.IsTrue((bool)model.OnSecuritiesChanged_WasCalled);\n\n                var insight = new Insight(now, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, null, null);\n                algorithm.Insights.Add(insight);\n                var result = wrappedModel.CreateTargets(algorithm, new[] { insight }).ToList();\n                Assert.AreEqual(1, result.Count);\n                Assert.IsTrue((bool)model.CreateTargets_WasCalled);\n                Assert.IsTrue((bool)model.GetTargetInsights_WasCalled);\n                Assert.IsTrue((bool)model.IsRebalanceDue_WasCalled);\n                Assert.IsTrue((bool)model.ShouldCreateTargetForInsight_WasCalled);\n                Assert.IsTrue((bool)model.DetermineTargetPercent_WasCalled);\n            }\n        }\n\n        [Test]\n        public void PythonDoesNotImplementDetermineTargetPercent()\n        {\n            var algorithm = new AlgorithmStub();\n\n            using (Py.GIL())\n            {\n                dynamic model = PyModule.FromString(\n                    \"TestPCM\",\n                    @\"\n\nfrom clr import AddReference\nAddReference(\"\"QuantConnect.Algorithm.Framework\"\")\n\nfrom QuantConnect.Algorithm.Framework.Portfolio import *\n\nclass PyPCM(EqualWeightingPortfolioConstructionModel):\n    def __init__(self):\n        super().__init__()\n        self.CreateTargets_WasCalled = False\n        self.OnSecuritiesChanged_WasCalled = False\n        self.ShouldCreateTargetForInsight_WasCalled = False\n        self.IsRebalanceDue_WasCalled = False\n        self.GetTargetInsights_WasCalled = False\n\n    def CreateTargets(self, algorithm, insights):\n        self.CreateTargets_WasCalled = True\n        return super().CreateTargets(algorithm, insights)\n\n    def OnSecuritiesChanged(self, algorithm, changes):\n        self.OnSecuritiesChanged_WasCalled = True\n        super().OnSecuritiesChanged(algorithm, changes)\n\n    def ShouldCreateTargetForInsight(self, insight):\n        self.ShouldCreateTargetForInsight_WasCalled = True\n        return super().ShouldCreateTargetForInsight(insight)\n\n    def IsRebalanceDue(self, insights, algorithmUtc):\n        self.IsRebalanceDue_WasCalled = True\n        return True\n\n    def GetTargetInsights(self):\n        self.GetTargetInsights_WasCalled = True\n        return super().GetTargetInsights()\n\"\n                ).GetAttr(\"PyPCM\").Invoke();\n\n                var now = new DateTime(2020, 1, 10);\n                var wrappedModel = new PortfolioConstructionModelPythonWrapper(model);\n                var aapl = algorithm.AddEquity(\"AAPL\");\n                aapl.SetMarketPrice(new Tick(now, aapl.Symbol, 10, 10));\n                algorithm.SetDateTime(now);\n\n                wrappedModel.OnSecuritiesChanged(algorithm, new SecurityChanges(SecurityChangesTests.AddedNonInternal(aapl)));\n                Assert.IsTrue((bool)model.OnSecuritiesChanged_WasCalled);\n\n                var insight = new Insight(now, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, null, null);\n                algorithm.Insights.Add(insight);\n                var result = wrappedModel.CreateTargets(algorithm, new[] { insight }).ToList();\n                Assert.AreEqual(1, result.Count);\n                Assert.IsTrue((bool)model.CreateTargets_WasCalled);\n                Assert.IsTrue((bool)model.GetTargetInsights_WasCalled);\n                Assert.IsTrue((bool)model.IsRebalanceDue_WasCalled);\n                Assert.IsTrue((bool)model.ShouldCreateTargetForInsight_WasCalled);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing DateTime = System.DateTime;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class PortfolioConstructionModelTests\n    {\n        private QCAlgorithm _algorithm;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _algorithm = new QCAlgorithm();\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionPeriodDue(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(time):\n    return time + timedelta(days=1)\").GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func);\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(time => time.AddDays(1));\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 1, 23, 0, 0), new Insight[0]));\n\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 2), new Insight[0]));\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 2, 1, 0, 0), new Insight[0]));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionSecurityChanges(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(time):\n    return time + timedelta(days=1)\").GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func);\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(time => time.AddDays(1));\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 2, 1, 0, 0), new Insight[0]));\n\n            var security = new Security(Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(Currencies.USD, 1, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache());\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(security));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 2), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 2), new Insight[0]));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionNewInsights(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(time):\n    return time + timedelta(days=1)\").GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func);\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(time => time.AddDays(1));\n            }\n            \n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n\n            var insights = new[] { Insight.Price(Symbols.SPY, Resolution.Daily, 1, InsightDirection.Down) };\n\n            constructionModel.RebalanceOnInsightChanges = false;\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), insights));\n            constructionModel.RebalanceOnInsightChanges = true;\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), insights));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionInsightExpiration(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(time):\n    return time + timedelta(days=10)\").GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func);\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(time => time.AddDays(10));\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            constructionModel.SetNextExpiration(new DateTime(2020, 1, 2));\n            constructionModel.RebalanceOnInsightChanges = false;\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 3), new Insight[0]));\n            constructionModel.RebalanceOnInsightChanges = true;\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 3), new Insight[0]));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void NoRebalanceFunction(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\n                        \"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc():\n    return None\"\n                    ).GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func.Invoke());\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 2), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 3), new Insight[0]));\n\n            var security = new Security(Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(Currencies.USD, 1, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache());\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(security));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionNull(Language language)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    var func = PyModule.FromString(\n                        \"RebalanceFunc\",\n                        @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(time):\n    if time.day == 17:\n        return time + timedelta(hours=1)\n    if time.day == 18:\n        return time\n    return None\"\n                    ).GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func);\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(\n                    time =>\n                    {\n                        if (time.Day == 18)\n                        {\n                            return time;\n                        }\n                        if (time.Day == 17)\n                        {\n                            return time.AddHours(1);\n                        }\n                        return null;\n                    });\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 1), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 1, 23, 0, 0), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 2), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 2, 0, 0, 1), new Insight[0]));\n\n            // day number '17' should trigger rebalance in the next hour\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 17), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 17, 0, 59, 59), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(\n                new DateTime(2020, 1, 17, 1, 0, 0), new Insight[0]));\n\n            constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 20), new Insight[0]);\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 21), new Insight[0]));\n\n            // day number '18' should trigger rebalance immediately\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 18), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 1, 21), new Insight[0]));\n        }\n\n        [TestCase(Language.Python)]\n        [TestCase(Language.CSharp)]\n        public void RebalanceFunctionDateRules(Language language)\n        {\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var dateRules = new DateRules(null, new SecurityManager(\n                new TimeKeeper(new DateTime(2015, 1, 1), DateTimeZone.Utc)), DateTimeZone.Utc, mhdb);\n\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    dynamic func = PyModule.FromString(\"RebalanceFunc\",\n                        @\"\nimport datetime\n\ndef RebalanceFunc(dateRules):\n    return dateRules.On(datetime.datetime(2015, 1, 10), datetime.datetime(2015, 1, 30))\").GetAttr(\"RebalanceFunc\");\n                    constructionModel.SetRebalancingFunc(func(dateRules));\n                }\n            }\n            else\n            {\n                var dateRule = dateRules.On(new DateTime(2015, 1, 10), new DateTime(2015, 1, 30));\n                constructionModel = new TestPortfolioConstructionModel(dateRule);\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 10), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 20), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 29), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 2, 1), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 2, 2), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2020, 10, 2), new Insight[0]));\n        }\n\n        [TestCase(Language.Python, 2)]\n        [TestCase(Language.Python, 1)]\n        [TestCase(Language.Python, 0)]\n        [TestCase(Language.CSharp, 0)]\n        public void RebalanceFunctionTimeSpan(Language language, int version)\n        {\n            TestPortfolioConstructionModel constructionModel;\n            if (language == Language.Python)\n            {\n                constructionModel = new TestPortfolioConstructionModel();\n                using (Py.GIL())\n                {\n                    if (version == 1)\n                    {\n                        dynamic func = PyModule.FromString(\"RebalanceFunc\",\n                            @\"\nfrom System import *\n\ndef RebalanceFunc(timeSpan):\n    return timeSpan\").GetAttr(\"RebalanceFunc\");\n                        constructionModel.SetRebalancingFunc(func(TimeSpan.FromMinutes(20)));\n                    }\n                    else if(version == 2)\n                    {\n                        dynamic func = PyModule.FromString(\"RebalanceFunc\",\n                            @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc(constructionModel):\n    return constructionModel.SetRebalancingFunc(timedelta(minutes = 20))\").GetAttr(\"RebalanceFunc\");\n                        func(constructionModel);\n                    }\n                    else\n                    {\n                        dynamic func = PyModule.FromString(\"RebalanceFunc\",\n                            @\"\nfrom datetime import timedelta\n\ndef RebalanceFunc():\n    return timedelta(minutes = 20)\").GetAttr(\"RebalanceFunc\");\n                        constructionModel.SetRebalancingFunc(func());\n                    }\n                }\n            }\n            else\n            {\n                constructionModel = new TestPortfolioConstructionModel(time => time.AddMinutes(20));\n            }\n\n            constructionModel.OnSecuritiesChanged(_algorithm, SecurityChanges.None);\n\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1, 0, 20, 0), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1, 0, 22, 0), new Insight[0]));\n            Assert.IsFalse(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1, 0, 21, 0), new Insight[0]));\n            Assert.IsTrue(constructionModel.IsRebalanceDueWrapper(new DateTime(2015, 1, 1, 0, 40, 0), new Insight[0]));\n        }\n\n        class TestPortfolioConstructionModel : PortfolioConstructionModel\n        {\n            public TestPortfolioConstructionModel(IDateRule dateRule)\n                : this(dateRule.ToFunc())\n            {\n            }\n\n            public TestPortfolioConstructionModel(Func<DateTime, DateTime> func = null)\n                : base(func)\n            {\n            }\n\n            public TestPortfolioConstructionModel(Func<DateTime, DateTime?> func)\n                : base(func)\n            {\n            }\n\n            public new void SetRebalancingFunc(PyObject rebalancingFunc)\n            {\n                base.SetRebalancingFunc(rebalancingFunc);\n            }\n\n            public bool IsRebalanceDueWrapper(DateTime now, Insight[] insights)\n            {\n                return base.IsRebalanceDue(insights, now);\n            }\n\n            public void SetNextExpiration(DateTime nextExpiration)\n            {\n                Algorithm.Insights.Add(\n                    new Insight(Symbols.SPY, time => nextExpiration, InsightType.Price, InsightDirection.Down));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioOptimizerPythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio;\n\n[TestFixture]\npublic class PortfolioOptimizerPythonWrapperTests\n{\n    [Test]\n    public void OptimizeIsCalled()\n    {\n        using (Py.GIL())\n        {\n            var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomPortfolioOptimizer:\n    def __init__(self):\n        self.OptimizeWasCalled = False\n\n    def Optimize(self, historicalReturns, expectedReturns = None, covariance = None):\n        self.OptimizeWasCalled= True\");\n                \n            var pyCustomOptimizer = module.GetAttr(\"CustomPortfolioOptimizer\").Invoke();\n            var wrapper = new PortfolioOptimizerPythonWrapper(pyCustomOptimizer);\n            var historicalReturns = new double[,] { { -0.50, -0.13 }, { 0.81, 0.31 }, { -0.02, 0.01 } };\n\n            wrapper.Optimize(historicalReturns);\n            pyCustomOptimizer\n                .GetAttr(\"OptimizeWasCalled\")\n                .TryConvert(out bool optimizerWasCalled);\n\n            Assert.IsTrue(optimizerWasCalled);\n        }\n    }\n\n    [Test]\n    public void WrapperThrowsIfOptimizerDoesNotImplementInterface()\n    {\n        using (Py.GIL())\n        {\n            var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomPortfolioOptimizer:\n    def __init__(self):\n        self.OptimizeWasCalled = False\n\n    def Calculate(self, historicalReturns, expectedReturns = None, covariance = None):\n        pass\");\n\n            var pyCustomOptimizer = module.GetAttr(\"CustomPortfolioOptimizer\").Invoke();\n\n            Assert.Throws<NotImplementedException>(() => new PortfolioOptimizerPythonWrapper(pyCustomOptimizer));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioOptimizerTestsBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio;\n\npublic abstract class PortfolioOptimizerTestsBase\n{\n    protected IList<double[,]> HistoricalReturns { get; set; }\n\n    protected IList<double[]> ExpectedReturns { get; set; }\n\n    protected IList<double[,]> Covariances { get; set; }\n\n    protected IList<double[]> ExpectedResults { get; set; }\n\n    protected abstract IPortfolioOptimizer CreateOptimizer();\n\n    public virtual void OptimizeWeightings(int testCaseNumber)\n    {\n        var testOptimizer = CreateOptimizer();\n\n        var result = testOptimizer.Optimize(\n            HistoricalReturns[testCaseNumber],\n            ExpectedReturns[testCaseNumber],\n            Covariances[testCaseNumber]);\n\n        Assert.AreEqual(ExpectedResults[testCaseNumber], result.Select(x => Math.Round(x, 6)));\n    }\n\n    [Test]\n    public virtual void EmptyPortfolioReturnsEmptyArrayOfDouble()\n    {\n        var testOptimizer = CreateOptimizer();\n        var historicalReturns = new double[,] { { } };\n        var expectedResult = Array.Empty<double>();\n\n        var result = testOptimizer.Optimize(historicalReturns);\n\n        Assert.AreEqual(result, expectedResult);\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioTargetCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class PortfolioTargetCollectionTests\n    {\n        private string _symbol = \"SPY\";\n\n        [Test]\n        public void TryGetValue()\n        {\n            var collection = new PortfolioTargetCollection();\n\n            Assert.IsFalse(collection.TryGetValue(Symbols.SPY, out var target));\n\n            collection[Symbols.SPY] = new PortfolioTarget(Symbols.SPY, 1);\n\n            Assert.IsTrue(collection.TryGetValue(Symbols.SPY, out target));\n            Assert.AreEqual(target, collection[Symbols.SPY]);\n        }\n\n        [Test]\n        public void IndexAccess()\n        {\n            var collection = new PortfolioTargetCollection();\n            collection[Symbols.SPY] = new PortfolioTarget(Symbols.SPY, 1);\n\n            Assert.AreEqual(1, collection.Count);\n            Assert.AreEqual(1, collection.Values.Count);\n            Assert.AreEqual(1, collection.Keys.Count);\n\n            collection[Symbols.IBM] = new PortfolioTarget(Symbols.IBM, 1);\n\n            Assert.AreEqual(2, collection.Count);\n            Assert.AreEqual(2, collection.Values.Count);\n            Assert.AreEqual(2, collection.Keys.Count);\n\n            collection[Symbols.IBM] = null;\n\n            Assert.AreEqual(2, collection.Count);\n            Assert.AreEqual(2, collection.Values.Count);\n            Assert.AreEqual(2, collection.Keys.Count);\n        }\n\n        [Test]\n        public void Count()\n        {\n            var collection = new PortfolioTargetCollection();\n            var targets = new[] { new PortfolioTarget(Symbols.SPY, 1) };\n            collection.AddRange(targets);\n\n            Assert.AreEqual(1, collection.Count);\n            collection.AddRange(new[] { new PortfolioTarget(Symbols.IBM, 1), new PortfolioTarget(Symbols.AAPL, 1) });\n            Assert.AreEqual(3, collection.Count);\n\n            collection.Clear();\n        }\n\n        [Test]\n        public void IsEmpty()\n        {\n            var collection = new PortfolioTargetCollection();\n            Assert.IsTrue(collection.IsEmpty);\n            Assert.IsFalse(collection.ContainsKey(Symbols.SPY));\n\n            collection.Add(new PortfolioTarget(Symbols.SPY, 1));\n            Assert.AreEqual(1, collection.Count);\n            Assert.IsFalse(collection.IsEmpty);\n            Assert.IsTrue(collection.ContainsKey(Symbols.SPY));\n        }\n\n        [Test]\n        public void AddRange()\n        {\n            var collection = new PortfolioTargetCollection();\n            var targets = new[] { new PortfolioTarget(Symbols.SPY, 1), new PortfolioTarget(Symbols.AAPL, 1) };\n            collection.AddRange(targets);\n            Assert.AreEqual(2, collection.Count);\n            Assert.IsTrue(collection.ContainsKey(Symbols.SPY));\n            Assert.IsTrue(collection.ContainsKey(Symbols.AAPL));\n\n            Assert.AreEqual(targets[0], collection[Symbols.SPY]);\n            Assert.AreEqual(targets[1], collection[Symbols.AAPL]);\n\n            Assert.AreEqual(1, collection.Values.Count(target => target == targets[0]));\n            Assert.AreEqual(1, collection.Values.Count(target => target == targets[1]));\n            Assert.AreEqual(1, collection.Keys.Count(symbol => symbol == Symbols.SPY));\n            Assert.AreEqual(1, collection.Keys.Count(symbol => symbol == Symbols.AAPL));\n        }\n\n        [Test]\n        public void RemoveTargetRespectsReference()\n        {\n            var symbol = new Symbol(SecurityIdentifier.GenerateBase(null, _symbol, Market.USA), _symbol);\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 1);\n            collection.Add(target);\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(collection.Contains(target));\n            // removes by reference even if same symbol\n            Assert.IsFalse(collection.Remove(new PortfolioTarget(symbol, 1)));\n            Assert.AreEqual(collection.Count, 1);\n        }\n\n        [Test]\n        public void AddContainsAndRemoveWork()\n        {\n            var symbol = new Symbol(SecurityIdentifier.GenerateBase(null, _symbol, Market.USA), _symbol);\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 1);\n            collection.Add(target);\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(collection.Contains(target));\n            Assert.IsTrue(collection.Remove(target));\n            Assert.AreEqual(collection.Count, 0);\n        }\n\n        [Test]\n        public void ClearFulfilledDoesNotRemoveUnreachedTarget()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            #pragma warning disable CS0618\n            var equity = algorithm.AddEquity(symbol);\n            var dummySecurityHolding = new FakeSecurityHolding(equity);\n            equity.Holdings = dummySecurityHolding;\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, -1);\n            collection.Add(target);\n\n            collection.ClearFulfilled(algorithm);\n            Assert.AreEqual(collection.Count, 1);\n        }\n\n        [Test]\n        public void ClearRemovesUnreachedTarget()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            var dummySecurityHolding = new FakeSecurityHolding(equity);\n            equity.Holdings = dummySecurityHolding;\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, -1);\n            collection.Add(target);\n\n            collection.Clear();\n            Assert.AreEqual(collection.Count, 0);\n        }\n\n        [Test]\n        public void ClearFulfilledRemovesPositiveTarget()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            var dummySecurityHolding = new FakeSecurityHolding(equity);\n            equity.Holdings = dummySecurityHolding;\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 1);\n            collection.Add(target);\n\n            dummySecurityHolding.SetQuantity(1);\n            collection.ClearFulfilled(algorithm);\n            Assert.AreEqual(collection.Count, 0);\n        }\n\n        [Test]\n        public void ClearFulfilledRemovesNegativeTarget()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            var dummySecurityHolding = new FakeSecurityHolding(equity);\n            equity.Holdings = dummySecurityHolding;\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, -1);\n            collection.Add(target);\n\n            dummySecurityHolding.SetQuantity(-1);\n            collection.ClearFulfilled(algorithm);\n            Assert.AreEqual(collection.Count, 0);\n        }\n\n        [Test]\n        public void OrderByMarginImpactDoesNotReturnTargetsWithNoData()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            algorithm.AddEquity(symbol);\n\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, -1);\n            collection.Add(target);\n            var targets = collection.OrderByMarginImpact(algorithm);\n\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(targets.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void OrderByMarginImpactReturnsExpectedTargets()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            equity.Cache.AddData(new TradeBar(DateTime.UtcNow, symbol, 1, 1, 1, 1, 1));\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, -1);\n            collection.Add(target);\n\n            var targets = collection.OrderByMarginImpact(algorithm);\n\n            Assert.AreEqual(collection.Count, 1);\n            Assert.AreEqual(targets.Count(), 1);\n            Assert.AreEqual(targets.First(), target);\n        }\n\n        [Test]\n        public void OrderByMarginImpactDoesNotReturnTargetsForWhichUnorderedQuantityIsZeroBecauseTargetIsZero()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            equity.Cache.AddData(new TradeBar(DateTime.UtcNow, symbol, 1, 1, 1, 1, 1));\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 0);\n            collection.Add(target);\n\n            var targets = collection.OrderByMarginImpact(algorithm);\n\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(targets.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void OrderByMarginImpactDoesNotReturnTargetsForWhichUnorderedQuantityIsZeroBecauseTargetReached()\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            var dummySecurityHolding = new FakeSecurityHolding(equity);\n            equity.Holdings = dummySecurityHolding;\n            equity.Cache.AddData(new TradeBar(DateTime.UtcNow, symbol, 1, 1, 1, 1, 1));\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 1);\n            collection.Add(target);\n            dummySecurityHolding.SetQuantity(1);\n\n            var targets = collection.OrderByMarginImpact(algorithm);\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(targets.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void OrderByMarginImpactDoesNotReturnTargetsForWhichUnorderedQuantityIsZeroBecauseOpenOrder()\n        {\n            var orderProcessor = new FakeOrderProcessor();\n            var algorithm = GetAlgorithm(orderProcessor);\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(_symbol, Market.USA), _symbol);\n            var equity = algorithm.AddEquity(symbol);\n            #pragma warning restore CS0618\n            equity.Cache.AddData(new TradeBar(DateTime.UtcNow, symbol, 1, 1, 1, 1, 1));\n            var collection = new PortfolioTargetCollection();\n            var target = new PortfolioTarget(symbol, 1);\n            collection.Add(target);\n\n            var openOrderRequest = new SubmitOrderRequest(OrderType.Market, symbol.SecurityType, symbol, 1, 0, 0, DateTime.UtcNow, \"\");\n            openOrderRequest.SetOrderId(1);\n            var openOrderTicket = new OrderTicket(algorithm.Transactions, openOrderRequest);\n\n            orderProcessor.AddOrder(new MarketOrder(symbol, 1, DateTime.UtcNow));\n            orderProcessor.AddTicket(openOrderTicket);\n\n            var targets = collection.OrderByMarginImpact(algorithm);\n            Assert.AreEqual(collection.Count, 1);\n            Assert.IsTrue(targets.IsNullOrEmpty());\n        }\n\n        private QCAlgorithm GetAlgorithm(IOrderProcessor orderProcessor)\n        {\n            var algorithm = new FakeAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n            return algorithm;\n        }\n\n        private class FakeSecurityHolding : SecurityHolding\n        {\n            public FakeSecurityHolding(Security security) :\n                base(security, new IdentityCurrencyConverter(security.QuoteCurrency.Symbol))\n            {\n            }\n            public void SetQuantity(int quantity)\n            {\n                Quantity = quantity;\n            }\n        }\n\n        private class FakeAlgorithm : QCAlgorithm\n        {\n            public FakeAlgorithm()\n            {\n                SubscriptionManager.SetDataManager(new DataManagerStub(this));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/PortfolioTargetTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class PortfolioTargetTests\n    {\n        [Test]\n        public void PercentInvokesBuyingPowerModelAndAddsInExistingHoldings()\n        {\n            const decimal bpmQuantity = 100;\n            const decimal holdings = 50;\n            const decimal targetPercent = 0.5m;\n\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n            var security = algorithm.Securities.Single().Value;\n            security.SetMarketPrice(new Tick{Value = 1m});\n            security.Holdings.SetHoldings(1m, holdings);\n\n            var buyingPowerMock = new Mock<IBuyingPowerModel>();\n            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetBuyingPower(It.IsAny<GetMaximumOrderQuantityForTargetBuyingPowerParameters>()))\n                .Returns(new GetMaximumOrderQuantityResult(bpmQuantity, null, false));\n            security.BuyingPowerModel = buyingPowerMock.Object;\n            buyingPowerMock.Setup(bpm => bpm.GetLeverage(It.IsAny<Security>())).Returns(1);\n\n            var target = PortfolioTarget.Percent(algorithm, security.Symbol, targetPercent);\n\n            Assert.AreEqual(security.Symbol, target.Symbol);\n            Assert.AreEqual(bpmQuantity + holdings, target.Quantity);\n        }\n\n        [Test]\n        public void PercentReturnsNullIfPriceIsZero()\n        {\n            const decimal holdings = 50;\n            const decimal targetPercent = 1m;\n\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n            var security = algorithm.Securities.Single().Value;\n            security.SetMarketPrice(new Tick { Value = 0m });\n            security.Holdings.SetHoldings(1m, holdings);\n\n            var target = PortfolioTarget.Percent(algorithm, security.Symbol, targetPercent);\n\n            Assert.IsNull(target);\n        }\n\n        [Test]\n        public void PercentReturnsNullIfBuyingPowerModelError()\n        {\n            const decimal holdings = 50;\n            const decimal targetPercent = 1m;\n\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n            var security = algorithm.Securities.Single().Value;\n            security.SetMarketPrice(new Tick { Value = 1m });\n            security.Holdings.SetHoldings(1m, holdings);\n\n            var buyingPowerMock = new Mock<IBuyingPowerModel>();\n            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetBuyingPower(It.IsAny<GetMaximumOrderQuantityForTargetBuyingPowerParameters>()))\n                .Returns(new GetMaximumOrderQuantityResult(0, \"The portfolio does not have enough margin available.\"));\n            security.BuyingPowerModel = buyingPowerMock.Object;\n            buyingPowerMock.Setup(bpm => bpm.GetLeverage(It.IsAny<Security>())).Returns(1);\n\n            var target = PortfolioTarget.Percent(algorithm, security.Symbol, targetPercent);\n\n            Assert.IsNull(target);\n        }\n\n        [TestCase(-3, true)]\n        [TestCase(3, true)]\n        [TestCase(2, false)]\n        [TestCase(-2, false)]\n        [TestCase(0.01, true)]\n        [TestCase(-0.01, true)]\n        [TestCase(0.1, false)]\n        [TestCase(-0.1, false)]\n        [TestCase(0, false)]\n        public void PercentIgnoresExtremeValuesBasedOnSettings(double value, bool shouldBeNull)\n        {\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Settings.MaxAbsolutePortfolioTargetPercentage = 2;\n            algorithm.Settings.MinAbsolutePortfolioTargetPercentage = 0.1m;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n            var security = algorithm.Securities.Single().Value;\n            security.SetMarketPrice(new Tick { Value = 1m });\n\n            var buyingPowerMock = new Mock<IBuyingPowerModel>();\n            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetBuyingPower(It.IsAny<GetMaximumOrderQuantityForTargetBuyingPowerParameters>()))\n                .Returns(new GetMaximumOrderQuantityResult(1, null, false));\n            buyingPowerMock.Setup(bpm => bpm.GetLeverage(It.IsAny<Security>())).Returns(1);\n            security.BuyingPowerModel = buyingPowerMock.Object;\n\n            var target = PortfolioTarget.Percent(algorithm, security.Symbol, value);\n\n            if (shouldBeNull)\n            {\n                Assert.IsNull(target);\n            }\n            else\n            {\n                Assert.IsNotNull(target);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/ReturnsSymbolDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.Math;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class ReturnsSymbolDataTests\n    {\n        [Test]\n        public void ReturnsDoesNotThrowIndexOutOfRangeException()\n        {\n            var dateTime = new DateTime(2020, 02, 01);\n\n            var returnsSymbolData = new ReturnsSymbolData(Symbols.EURGBP, 1, 5);\n            returnsSymbolData.Add(dateTime, 10);\n            returnsSymbolData.Add(dateTime.AddDays(1), 100);\n            returnsSymbolData.Add(dateTime.AddDays(2), 5);\n\n            var returnsSymbolData2 = new ReturnsSymbolData(Symbols.BTCUSD, 1, 5);\n            returnsSymbolData2.Add(dateTime.AddDays(1), 33);\n            returnsSymbolData2.Add(dateTime.AddDays(2), 2);\n\n            var returnsSymbolDatas = new Dictionary<Symbol, ReturnsSymbolData>\n            {\n                {Symbols.EURGBP, returnsSymbolData},\n                {Symbols.BTCUSD, returnsSymbolData2},\n            };\n\n            var result = returnsSymbolDatas.FormReturnsMatrix(new List<Symbol> {Symbols.EURGBP, Symbols.BTCUSD });\n\n            Assert.AreEqual(4, result.Length);\n\n            Assert.AreEqual(5m, result[0, 0]);\n            Assert.AreEqual(2m, result[0, 1]);\n\n            Assert.AreEqual(100m, result[1, 0]);\n            Assert.AreEqual(33m, result[1, 1]);\n        }\n\n        [Test]\n        public void ReturnsDoesNotThrowKeyAlreadyExistsException()\n        {\n            var returnsSymbolData = new ReturnsSymbolData(Symbols.EURGBP, 1, 5);\n\n            var dateTime = new DateTime(2020, 02, 01);\n            returnsSymbolData.Add(dateTime, 10);\n            returnsSymbolData.Add(dateTime, 100);\n\n            Assert.AreEqual(1, returnsSymbolData.Returns.Count);\n            Assert.AreEqual(returnsSymbolData.Returns[dateTime], 10);\n        }\n\n        [Test]\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ReturnsSymbolDataMatrixIsSimilarToPandasDataFrame(bool odd)\n        {\n            var symbols = new[] { \"A\", \"B\", \"C\", \"D\", \"E\" }\n                .Select(x => Symbol.Create(x, SecurityType.Equity, Market.USA, x));\n\n            var slices = GetHistory(symbols, odd);\n\n            var expected = GetExpectedValue(slices);\n\n            var symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n\n            slices.PushThrough(bar =>\n            {\n                ReturnsSymbolData symbolData;\n                if (!symbolDataDict.TryGetValue(bar.Symbol, out symbolData))\n                {\n                    symbolData = new ReturnsSymbolData(bar.Symbol, 1, 5);\n                    symbolDataDict.Add(bar.Symbol, symbolData);\n                }\n                symbolData.Update(bar.EndTime, bar.Value);\n            });\n\n            var matrix = symbolDataDict.FormReturnsMatrix(symbols);\n            var actual = matrix.Determinant();\n\n            Assert.AreEqual(expected, actual, 0.000001);\n        }\n\n        [Test]\n        public void DuplicateKeyPortfolioConstructionModelDoesNotThrow()\n        {\n            var algorithm = new QCAlgorithm();\n            var timezone = algorithm.TimeZone;\n            algorithm.SetDateTime(new DateTime(2018, 8, 7).ConvertToUtc(timezone));\n            algorithm.SetPortfolioConstruction(new DuplicateKeyPortfolioConstructionModel());\n\n            var symbol = Symbols.SPY;\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(timezone),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Daily,\n                    timezone,\n                    timezone,\n                    true,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            security.SetMarketPrice(new Tick(algorithm.Time, symbol, 1m, 1m));\n            algorithm.Securities.Add(symbol, security);\n\n            algorithm.PortfolioConstruction.OnSecuritiesChanged(algorithm, SecurityChangesTests.AddedNonInternal(security));\n\n            var insights = new[] {Insight.Price(symbol, Time.OneMinute, InsightDirection.Up, .1)};\n\n            Assert.DoesNotThrow(() => algorithm.PortfolioConstruction.CreateTargets(algorithm, insights));\n        }\n\n        private List<Slice> GetHistory(IEnumerable<Symbol> symbols, bool odd)\n        {\n            var reference = DateTime.Now;\n            var rnd = new Random(reference.Second);\n            var symbolsArray = symbols.ToArray();\n\n            return Enumerable.Range(0, 10).Select(t =>\n            {\n                var time = reference.AddDays(t);\n\n                var data = Enumerable.Range(0, symbolsArray.Length).Select(i =>\n                {\n                    // Odd data means that one of the symbols have a different timestamp\n                    if (odd && i == symbolsArray.Length - 1)\n                    {\n                        time = time.AddMinutes(10);\n                    }\n                    return new Tick(time, symbolsArray[i], (decimal)rnd.NextDouble(), 0, 0) {TickType = TickType.Trade};\n                });\n\n                return new Slice(time, data, time);\n            }).ToList();\n        }\n\n        private double GetExpectedValue(List<Slice> history)\n        {\n            var code = @\"\nimport numpy as np\nimport pandas as pd\nimport math\nfrom BlackLittermanOptimizationPortfolioConstructionModel import BlackLittermanOptimizationPortfolioConstructionModel as blopcm\n\ndef GetDeterminantFromHistory(history):\n    returns = dict()\n    history = history.lastprice.unstack(0)\n\n    for symbol, df in history.items():\n        symbolData = blopcm.BlackLittermanSymbolData(symbol, 1, 5)\n        for time, close in df.dropna().items():\n            symbolData.update(time, close)\n\n        returns[symbol] = symbolData.return_\n    \n    df = pd.DataFrame(returns)\n    if df.isna().sum().sum() > 0:\n        df[df.columns[-1]] = df[df.columns[-1]].bfill()\n        df = df.dropna()\n\n    return np.linalg.det(df)\";\n\n            using (Py.GIL())\n            {\n                dynamic GetDeterminantFromHistory = PyModule.FromString(\"GetDeterminantFromHistory\", code)\n                    .GetAttr(\"GetDeterminantFromHistory\");\n\n                dynamic df = new PandasConverter().GetDataFrame(history);\n                return GetDeterminantFromHistory(df);\n            }\n        }\n\n        private class DuplicateKeyPortfolioConstructionModel : IPortfolioConstructionModel\n        {\n            private readonly Dictionary<Symbol, ReturnsSymbolData> _symbolDataDict = new Dictionary<Symbol, ReturnsSymbolData>();\n\n            public IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                // Updates the ReturnsSymbolData with insights\n                foreach (var insight in insights)\n                {\n                    ReturnsSymbolData symbolData;\n                    if (_symbolDataDict.TryGetValue(insight.Symbol, out symbolData))\n                    {\n                        symbolData.Add(algorithm.Time, .1m);\n                    }\n                }\n\n                Assert.DoesNotThrow(() => _symbolDataDict.FormReturnsMatrix(insights.Select(x => x.Symbol)));\n\n                return Enumerable.Empty<PortfolioTarget>();\n            }\n\n            public void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)\n            {\n                const int period = 2;\n                var reference = algorithm.Time.AddDays(-period);\n\n                foreach (var security in changes.AddedSecurities)\n                {\n                    var symbol = security.Symbol;\n                    var symbolData = new ReturnsSymbolData(symbol, 1, period);\n\n                    for (var i = 0; i <= period; i++)\n                    {\n                        symbolData.Update(reference.AddDays(i), 1);\n                    }\n\n                    _symbolDataDict[symbol] = symbolData;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/RiskParityPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Accord.Math;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Packets;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class RiskParityPortfolioConstructionModelTests\n    {\n        private DateTime _nowUtc;\n        private QCAlgorithm _algorithm;\n\n        [SetUp]\n        public virtual void SetUp()\n        {\n            _nowUtc = new DateTime(2021, 1, 10);\n            _algorithm = new AlgorithmStub();\n            _algorithm.SetFinishedWarmingUp();\n            _algorithm.Settings.MinimumOrderMarginPortfolioPercentage = 0;\n            _algorithm.Settings.FreePortfolioValue = 250;\n            _algorithm.SetDateTime(_nowUtc.ConvertToUtc(_algorithm.TimeZone));\n            _algorithm.SetCash(1200);\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            _algorithm.SetHistoryProvider(historyProvider);\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                new BacktestNodePacket(),\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                i => { },\n                true,\n                new DataPermissionManager(),\n                _algorithm.ObjectStore,\n                _algorithm.Settings));\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotReturnTargetsIfSecurityPriceIsZero(Language language)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.AddEquity(Symbols.SPY.Value);\n            algorithm.SetDateTime(DateTime.MinValue.ConvertToUtc(algorithm.TimeZone));\n\n            SetPortfolioConstruction(language, PortfolioBias.Long);\n\n            var insights = new[] { new Insight(_nowUtc, Symbols.SPY, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null) };\n            var actualTargets = algorithm.PortfolioConstruction.CreateTargets(algorithm, insights);\n\n            Assert.AreEqual(0, actualTargets.Count());\n        }\n\n        [TestCase(Language.CSharp, PortfolioBias.Long)]\n        [TestCase(Language.Python, PortfolioBias.Long)]\n        [TestCase(Language.CSharp, PortfolioBias.Short)]\n        [TestCase(Language.Python, PortfolioBias.Short)]\n        public void PortfolioBiasIsRespected(Language language, PortfolioBias bias)\n        {\n            if (bias == PortfolioBias.Short)\n            {\n                var throwsConstraint = language == Language.CSharp\n                    ? Throws.InstanceOf<ArgumentException>()\n                    : Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>();\n                Assert.That(() => GetPortfolioConstructionModel(language, bias, Resolution.Daily),\n                    throwsConstraint.And.Message.EqualTo(\"Long position must be allowed in RiskParityPortfolioConstructionModel.\"));\n                return;\n            }\n\n            SetPortfolioConstruction(language, bias);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            foreach (var equity in new[] { aapl, spy })\n            {\n                equity.SetMarketPrice(new Tick(_nowUtc, equity.Symbol, 10, 10));\n            }\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            var insights = new[]\n            {\n                new Insight(_nowUtc, aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n                new Insight(_nowUtc, spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Down, null, null)\n            };\n\n            foreach (var target in _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights))\n            {\n                if (target.Quantity == 0)\n                {\n                    continue;\n                }\n                Assert.AreEqual(Math.Sign((int)bias), Math.Sign(target.Quantity));\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void CorrectWeightings(Language language)\n        {\n            SetPortfolioConstruction(language, PortfolioBias.Long);\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            var spy = _algorithm.AddEquity(\"SPY\");\n\n            aapl.SetMarketPrice(new Tick(_nowUtc, aapl.Symbol, 10, 10));\n            spy.SetMarketPrice(new Tick(_nowUtc, spy.Symbol, 10, 10));\n            aapl.SetMarketPrice(new Tick(_nowUtc.AddDays(1), aapl.Symbol, 12, 12));\n            spy.SetMarketPrice(new Tick(_nowUtc.AddDays(1), spy.Symbol, 20, 20));\n            aapl.SetMarketPrice(new Tick(_nowUtc.AddDays(2), aapl.Symbol, 13, 13));\n            spy.SetMarketPrice(new Tick(_nowUtc.AddDays(2), spy.Symbol, 30, 30));\n\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, SecurityChangesTests.AddedNonInternal(aapl, spy));\n\n            var insights = new[]\n            {\n                new Insight(_nowUtc.AddDays(2), aapl.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null),\n                new Insight(_nowUtc.AddDays(2), spy.Symbol, TimeSpan.FromDays(1), InsightType.Price, InsightDirection.Up, null, null)\n            };\n\n            _algorithm.Insights.AddRange(insights);\n\n            var targets = _algorithm.PortfolioConstruction.CreateTargets(_algorithm, insights).ToArray();\n            Assert.AreEqual(targets[0].Quantity, 30m);      // AAPL\n            Assert.AreEqual(targets[1].Quantity, 18m);      // SPY\n        }\n\n        protected void SetPortfolioConstruction(Language language, PortfolioBias bias, IPortfolioConstructionModel defaultModel = null)\n        {\n            var model = defaultModel ?? GetPortfolioConstructionModel(language, bias, Resolution.Daily);\n            _algorithm.SetPortfolioConstruction(model);\n\n            foreach (var kvp in _algorithm.Portfolio)\n            {\n                kvp.Value.SetHoldings(kvp.Value.Price, 0);\n            }\n\n            var changes = SecurityChangesTests.AddedNonInternal(_algorithm.Securities.Values.ToArray());\n            _algorithm.PortfolioConstruction.OnSecuritiesChanged(_algorithm, changes);\n        }\n\n        public IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, PortfolioBias bias, Resolution resolution)\n        {\n            if (language == Language.CSharp)\n            {\n                return new RiskParityPortfolioConstructionModel(resolution, bias, 1, 252, resolution);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(RiskParityPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name)\n                    .Invoke(((int)resolution).ToPython(), ((int)bias).ToPython(), 1.ToPython(), 252.ToPython(), ((int)resolution).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/RiskParityPortfolioOptimizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord.Math;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class RiskParityPortfolioOptimizerTests\n    {\n        private Dictionary<int, double[][]> _covariances = new();\n        private Dictionary<int, double[]> _riskBudgets = new();\n        private Dictionary<int, double[]> _expectedResults = new();\n\n        [SetUp]\n        public virtual void SetUp()\n        {\n            var riskBudget1 = new double[] {0.5d, 0.5d};                                // equal risk distribution\n            var riskBudget2 = new double[] {0.25d, 0.75d};                              // 25% risk assigned to A, 75% risk assigned to B\n\n            var covariance1 = new double[][] {new[]{0.25, -0.2}, new[]{-0.2, 0.25}};    // both 50% variance, -80% correlation\n            var covariance2 = new double[][] {new[]{0.01, 0}, new[]{0, 0.04}};          // sigma(A) 10%, sigma(B) 20%, 0% correlation\n            var covariance3 = new double[][] {new[]{1, 0.45}, new[]{0.45, 0.25}};       // sigma(A) 100%, sigma(B) 50%, 90% correlation\n            var covariance4 = new double[][] {new[]{0.25, 0.05}, new[]{0.05, 0.04}};    // sigma(A) 50%, sigma(B) 10%, 25% correlation\n\n            var expectedResult1 = new double[] {3.162278d, 3.162278d};\n            var expectedResult2 = new double[] {7.071068d, 3.535534d};\n            var expectedResult3 = new double[] {0.512989d, 1.025978d};\n            var expectedResult4 = new double[] {1.154701d, 2.886751d};\n            var expectedResult5 = new double[] {2.965685d, 3.285618d};\n            var expectedResult6 = new double[] {5d, 4.330127d};\n            var expectedResult7 = new double[] {0.264749d, 1.510089d};\n            var expectedResult8 = new double[] {0.681774d, 3.924933d};\n\n            _covariances.TryAdd(1, covariance1);\n            _covariances.TryAdd(2, covariance2);\n            _covariances.TryAdd(3, covariance3);\n            _covariances.TryAdd(4, covariance4);\n            _covariances.TryAdd(5, covariance1);\n            _covariances.TryAdd(6, covariance2);\n            _covariances.TryAdd(7, covariance3);\n            _covariances.TryAdd(8, covariance4);\n\n            _riskBudgets.TryAdd(1, riskBudget1);\n            _riskBudgets.TryAdd(2, riskBudget1);\n            _riskBudgets.TryAdd(3, riskBudget1);\n            _riskBudgets.TryAdd(4, riskBudget1);\n            _riskBudgets.TryAdd(5, riskBudget2);\n            _riskBudgets.TryAdd(6, riskBudget2);\n            _riskBudgets.TryAdd(7, riskBudget2);\n            _riskBudgets.TryAdd(8, riskBudget2);\n\n            _expectedResults.TryAdd(1, expectedResult1);\n            _expectedResults.TryAdd(2, expectedResult2);\n            _expectedResults.TryAdd(3, expectedResult3);\n            _expectedResults.TryAdd(4, expectedResult4);\n            _expectedResults.TryAdd(5, expectedResult5);\n            _expectedResults.TryAdd(6, expectedResult6);\n            _expectedResults.TryAdd(7, expectedResult7);\n            _expectedResults.TryAdd(8, expectedResult8);\n        }\n\n        [TestCase(1)]\n        [TestCase(0)]\n        [TestCase(1001)]\n        public void TestForExtremeNumberOfVariablesRiskParityNewtonMethodOptimization(int numberOfVariables)\n        {\n            var testOptimizer = new TestRiskParityPortfolioOptimizer();\n\n            if (numberOfVariables < 1 || numberOfVariables > 1000)\n            {\n                var exception = Assert.Throws<ArgumentException>(() => testOptimizer.TestOptimization(numberOfVariables, new double[,]{}, new double[]{}));\n                Assert.That(exception.Message, Is.EqualTo(\"Argument \\\"numberOfVariables\\\" must be a positive integer between 1 and 1000\"));\n                return;\n            }\n\n            var result = testOptimizer.TestOptimization(numberOfVariables, new double[,]{}, new double[]{});\n            Assert.AreEqual(new double[] {1d}, result);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(6)]\n        [TestCase(7)]\n        [TestCase(8)]\n        public void TestRiskParityNewtonMethodOptimizationWeightings(int testCaseNumber)\n        {\n            var testOptimizer = new TestRiskParityPortfolioOptimizer();\n            var covariance = JaggedArrayTo2DArray(_covariances[testCaseNumber]);\n\n            var result = testOptimizer.TestOptimization(2, covariance, _riskBudgets[testCaseNumber]);\n            result = result.Select(x => Math.Round(x, 6)).ToArray();\n\n            Assert.AreEqual(_expectedResults[testCaseNumber], result);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(6)]\n        [TestCase(7)]\n        [TestCase(8)]\n        public void TestOptimizeWeightings(int testCaseNumber)\n        {\n            var testOptimizer = new TestRiskParityPortfolioOptimizer();\n            var covariance = JaggedArrayTo2DArray(_covariances[testCaseNumber]);\n            var result = testOptimizer.Optimize(new double[,]{}, _riskBudgets[testCaseNumber], covariance);\n            result = result.Select(x => Math.Round(x, 6)).ToArray();\n\n            var expected = _expectedResults[testCaseNumber];\n            expected = Elementwise.Divide(expected, expected.Sum()).Select(x => Math.Clamp(x, 1e-05, double.MaxValue)).ToArray();\n            expected = expected.Select(x => Math.Round(x, 6)).ToArray();\n            \n            Assert.AreEqual(expected, result);\n        }\n\n        private T[,] JaggedArrayTo2DArray<T>(T[][] source)\n        {\n            int FirstDim = source.Length;\n            int SecondDim = source.GroupBy(row => row.Length).Single().Key;\n\n            var result = new T[FirstDim, SecondDim];\n            for (int i = 0; i < FirstDim; ++i)\n                for (int j = 0; j < SecondDim; ++j)\n                    result[i, j] = source[i][j];\n\n            return result;\n        }\n\n        private class TestRiskParityPortfolioOptimizer : RiskParityPortfolioOptimizer\n        {\n            public TestRiskParityPortfolioOptimizer()\n                : base()\n            {\n            }\n\n            public double[] TestOptimization(int numOfVar, double[,] covariance, double[] budget)\n            {\n                return base.RiskParityNewtonMethodOptimization(numOfVar, covariance, budget);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/SectorWeightingPortfolioConstructionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class SectorWeightingPortfolioConstructionModelTests : BaseWeightingPortfolioConstructionModelTests\n    {\n        private const double _weight = 0.01;\n\n        public override double? Weight => Algorithm.Securities.Count == 0 ? default(double) : 1d / Algorithm.Securities.Count;\n\n        [OneTimeSetUp]\n        public override void SetUp()\n        {\n            base.SetUp();\n\n            var prices = new Dictionary<Symbol, Tuple<decimal, string>>\n            {\n                { Symbol.Create(\"XXX\", SecurityType.Equity, Market.USA), Tuple.Create(55.22m, \"\") },\n                { Symbol.Create(\"B01\", SecurityType.Equity, Market.USA), Tuple.Create(55.22m, \"B\") },\n                { Symbol.Create(\"B02\", SecurityType.Equity, Market.USA), Tuple.Create(55.22m, \"B\") },\n                { Symbol.Create(\"B03\", SecurityType.Equity, Market.USA), Tuple.Create(55.22m, \"B\") },\n                { Symbol.Create(\"T01\", SecurityType.Equity, Market.USA), Tuple.Create(145.17m, \"T\") },\n                { Symbol.Create(\"T02\", SecurityType.Equity, Market.USA), Tuple.Create(145.17m, \"T\") },\n                { Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), Tuple.Create(281.79m, \"X\") },\n            };\n\n            Func<Symbol, Security> GetSecurity = symbol =>\n                new Equity(\n                    symbol,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 0, 1),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                    );\n\n            var industryTemplateCodeDict = new Dictionary<SecurityIdentifier, string>();\n            foreach (var kvp in prices)\n            {\n                var symbol = kvp.Key;\n                var security = GetSecurity(symbol);\n                var price = kvp.Value.Item1;\n                var sectorCode = kvp.Value.Item2;\n                // The first item does not have a valid sector code,\n                // This procedure shows that the model ignores the securities without it\n                if (!string.IsNullOrEmpty(sectorCode))\n                {\n                    security.SetMarketPrice(new Fundamental(Algorithm.Time, symbol)\n                    {\n                        Value = price\n                    });\n                    industryTemplateCodeDict[symbol.ID] = kvp.Value.Item2;\n                }\n                security.SetMarketPrice(new Tick(Algorithm.Time, symbol, price, price));\n                Algorithm.Securities.Add(symbol, security);\n            }\n\n            FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProvider(industryTemplateCodeDict), false);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void AutomaticallyRemoveInvestedWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            // Let's create a position for SPY\n            var insights = new[] { GetInsight(Symbols.SPY, direction, Algorithm.UtcTime) };\n\n            foreach (var target in Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights))\n            {\n                var holding = Algorithm.Portfolio[target.Symbol];\n                holding.SetHoldings(holding.Price, target.Quantity);\n                Algorithm.Portfolio.SetCash(StartingCash - holding.HoldingsValue);\n            }\n\n            SetUtcTime(Algorithm.UtcTime.AddDays(2));\n\n            // Since we have 3 B, 2 T and 1 X, each security in each sector will get \n            // B => .166%, T => .25, X => 0% (removed)\n            var sectorCount = 2;\n            var groupedBySector = Algorithm.Securities\n                .Where(pair => pair.Value.Fundamentals?.CompanyReference.IndustryTemplateCode != null)\n                .GroupBy(pair => pair.Value.Fundamentals.CompanyReference.IndustryTemplateCode);\n\n            var expectedTargets = new List<PortfolioTarget>();\n\n            foreach (var securities in groupedBySector)\n            {\n                var list = securities.ToList();\n                var amount = Algorithm.Portfolio.TotalPortfolioValue / list.Count / sectorCount *\n                    (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n                expectedTargets.AddRange(list\n                    .Select(x => new PortfolioTarget(x.Key, x.Key.Value == \"SPY\" ? 0\n                        : (int)direction * Math.Floor(amount / x.Value.Price))));\n            }\n\n            // Do no include SPY in the insights\n            insights = Algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, Algorithm.UtcTime)).ToArray();\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights);\n\n            Assert.Greater(Algorithm.Securities.Count, expectedTargets.Count);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void DelistedSecurityEmitsFlatTargetWithNewInsights(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            var insights = new[] { GetInsight(Symbols.SPY, InsightDirection.Down, Algorithm.UtcTime) };\n            var targets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(1, targets.Count);\n\n            // Removing SPY should clear the key in the insight collection\n            var changes = SecurityChangesTests.RemovedNonInternal(Algorithm.Securities[Symbols.SPY]);\n            Algorithm.PortfolioConstruction.OnSecuritiesChanged(Algorithm, changes);\n\n            // Since we have 3 B, 2 T and 1 X, each security in each sector will get \n            // B => .166%, T => .25, X => 0% (removed)\n            var sectorCount = 2;\n            var groupedBySector = Algorithm.Securities\n                .Where(pair => pair.Value.Fundamentals?.CompanyReference.IndustryTemplateCode != null)\n                .GroupBy(pair => pair.Value.Fundamentals.CompanyReference.IndustryTemplateCode);\n\n            var expectedTargets = new List<PortfolioTarget>();\n\n            foreach (var securities in groupedBySector)\n            {\n                var list = securities.ToList();\n                var amount = Algorithm.Portfolio.TotalPortfolioValue / list.Count / sectorCount *\n                    (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n                expectedTargets.AddRange(list\n                    .Select(x => new PortfolioTarget(x.Key, x.Key.Value == \"SPY\" ? 0\n                        : (int)direction * Math.Floor(amount / x.Value.Price))));\n            }\n\n            // Do no include SPY in the insights\n            insights = Algorithm.Securities.Keys.Where(x => x.Value != \"SPY\")\n                .Select(x => GetInsight(x, direction, Algorithm.UtcTime)).ToArray();\n\n            // Create target from an empty insights array\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights);\n\n            Assert.Greater(Algorithm.Securities.Count, expectedTargets.Count);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [TestCase(Language.CSharp, InsightDirection.Up)]\n        [TestCase(Language.CSharp, InsightDirection.Down)]\n        [TestCase(Language.CSharp, InsightDirection.Flat)]\n        [TestCase(Language.Python, InsightDirection.Up)]\n        [TestCase(Language.Python, InsightDirection.Down)]\n        [TestCase(Language.Python, InsightDirection.Flat)]\n        public override void FlatDirectionNotAccountedToAllocation(Language language, InsightDirection direction)\n        {\n            SetPortfolioConstruction(language);\n\n            // Since we have 3 B, 2 T and 1 X, each security in each sector will get \n            // B => .166%, T => .25, X => 0% (removed)\n            var sectorCount = 2;\n            var groupedBySector = Algorithm.Securities\n                .Where(pair => pair.Value.Fundamentals?.CompanyReference.IndustryTemplateCode != null)\n                .GroupBy(pair => pair.Value.Fundamentals.CompanyReference.IndustryTemplateCode);\n\n            var expectedTargets = new List<PortfolioTarget>();\n\n            foreach (var securities in groupedBySector)\n            {\n                var list = securities.ToList();\n                var amount = Algorithm.Portfolio.TotalPortfolioValue / list.Count / sectorCount *\n                    (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n                expectedTargets.AddRange(list\n                    .Select(x => new PortfolioTarget(x.Key, x.Key.Value == \"SPY\" ? 0\n                        : (int)direction * Math.Floor(amount / x.Value.Price))));\n            }\n\n            var insights = Algorithm.Securities.Keys.Select(x =>\n            {\n                // SPY insight direction is flat\n                var actualDirection = x.Value == \"SPY\" ? InsightDirection.Flat : direction;\n                return GetInsight(x, actualDirection, Algorithm.UtcTime);\n            });\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights.ToArray());\n\n            Assert.Greater(Algorithm.Securities.Count, expectedTargets.Count);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void WeightsBySectorProportionally(Language language)\n        {\n            SetPortfolioConstruction(language);\n\n            // create two insights whose weights sums up to 2\n            var insights = Algorithm.Securities\n                .Select(x => GetInsight(x.Key, InsightDirection.Up, Algorithm.UtcTime))\n                .ToArray();\n\n            // Since we have 3 B, 2 T and 1 X, each security in each secotr will get B => .11%, T => .165, X => .33%\n            var sectorCount = 3;\n            var groupedBySector = Algorithm.Securities\n                .Where(pair => pair.Value.Fundamentals?.CompanyReference.IndustryTemplateCode != null)\n                .Where(pair => insights.Any(insight => pair.Key == insight.Symbol))\n                .GroupBy(pair => pair.Value.Fundamentals.CompanyReference.IndustryTemplateCode);\n\n            var expectedTargets = new List<PortfolioTarget>();\n\n            foreach (var securities in groupedBySector)\n            {\n                var list = securities.ToList();\n                var amount = Algorithm.Portfolio.TotalPortfolioValue / list.Count / sectorCount *\n                    (1 - Algorithm.Settings.FreePortfolioValuePercentage);\n\n                expectedTargets.AddRange(list\n                    .Select(x => new PortfolioTarget(x.Key, (int)InsightDirection.Up * Math.Floor(amount / x.Value.Price))));\n            }\n\n            var actualTargets = Algorithm.PortfolioConstruction.CreateTargets(Algorithm, insights).ToList();\n            Assert.AreEqual(6, actualTargets.Count);\n            Assert.Greater(Algorithm.Securities.Count, expectedTargets.Count);\n            AssertTargets(expectedTargets, actualTargets);\n        }\n\n        public override Insight GetInsight(Symbol symbol, InsightDirection direction, DateTime generatedTimeUtc, TimeSpan? period = null, double? weight = _weight)\n        {\n            period ??= TimeSpan.FromDays(1);\n            var insight = Insight.Price(symbol, period.Value, direction, weight: weight);\n            insight.GeneratedTimeUtc = generatedTimeUtc;\n            insight.CloseTimeUtc = generatedTimeUtc.Add(period.Value);\n            Algorithm.Insights.Add(insight);\n            return insight;\n        }\n\n        public override IPortfolioConstructionModel GetPortfolioConstructionModel(Language language, dynamic paramenter = null)\n        {\n            if (language == Language.CSharp)\n            {\n                return new SectorWeightingPortfolioConstructionModel(paramenter);\n            }\n\n            using (Py.GIL())\n            {\n                const string name = nameof(SectorWeightingPortfolioConstructionModel);\n                var instance = Py.Import(name).GetAttr(name).Invoke(((object)paramenter).ToPython());\n                return new PortfolioConstructionModelPythonWrapper(instance);\n            }\n        }\n\n        private class TestFundamentalDataProvider : IFundamentalDataProvider\n        {\n            private readonly Dictionary<SecurityIdentifier, string> _industryTemplateCodeDict;\n\n            public TestFundamentalDataProvider(Dictionary<SecurityIdentifier, string> industryTemplateCodeDict)\n            {\n                _industryTemplateCodeDict = industryTemplateCodeDict;\n            }\n            public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n            {\n                if (securityIdentifier == SecurityIdentifier.Empty)\n                {\n                    return default;\n                }\n                return Get(time, securityIdentifier, name);\n            }\n            private dynamic Get(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty enumName)\n            {\n                var name = Enum.GetName(enumName);\n                switch (name)\n                {\n                    case \"CompanyReference_IndustryTemplateCode\":\n                        if(_industryTemplateCodeDict.TryGetValue(securityIdentifier, out var result))\n                        {\n                            return result;\n                        }\n                        return null;\n                }\n                return null;\n            }\n            public void Initialize(IDataProvider dataProvider, bool liveMode)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/SignalExportTargetTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Portfolio.SignalExports;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class SignalExportTargetTests\n    {\n        [TestCaseSource(nameof(SendsTargetsToCollective2AppropriatelyTestCases))]\n        public void SendsTargetsToCollective2Appropriately(string currency, Symbol symbol, decimal quantity, string expectedMessage)\n        {\n            var targetList = new List<PortfolioTarget>() { new(symbol, quantity) };\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(new DateTime(2016, 02, 16, 11, 53, 30));\n            algorithm.Portfolio.SetAccountCurrency(currency);\n            var security = algorithm.AddSecurity(symbol);\n            security.QuoteCurrency.ConversionRate = 1;\n            security.FeeModel = new ConstantFeeModel(0);\n            security.SetMarketPrice(new Tick { Value = 100 });\n            var initialMarginRequirement = security.BuyingPowerModel.GetInitialMarginRequirement(new(security, 1));\n            if (initialMarginRequirement.Value == 0)\n            {\n                security.SetBuyingPowerModel(BuyingPowerModel.Null);\n            }\n\n            algorithm.Portfolio.SetCash(1500000);\n\n            using var manager = new Collective2SignalExportHandler(\"\", 0);\n\n            var message = manager.GetMessageSent(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n\n            Assert.AreEqual(expectedMessage, message);\n        }\n\n        [Test]\n        public void Collective2SignalExportManagerDoesNotLogMoreThanOnceWhenUnknownMarket()\n        {\n            var targetList = new List<PortfolioTarget>() { new(Symbols.EURUSD, 1), new PortfolioTarget(Symbols.GBPUSD, 1) };\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(new DateTime(2016, 02, 16, 11, 53, 30));\n            algorithm.Portfolio.SetAccountCurrency(\"USD\");\n            var security = algorithm.AddSecurity(Symbols.EURUSD);\n            var security2 = algorithm.AddSecurity(Symbols.GBPUSD);\n            security.SetMarketPrice(new Tick { Value = 100 });\n            security2.SetMarketPrice(new Tick { Value = 100 });\n\n            algorithm.Portfolio.SetCash(50000);\n\n            using var manager = new Collective2SignalExportHandler(\"\", 0);\n\n            for (int count = 0; count < 100; count++)\n            {\n                manager.GetMessageSent(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n            }\n\n            Assert.AreEqual(3, algorithm.DebugMessages.Count);\n            var debugMessages = algorithm.DebugMessages.ToList();\n            Assert.IsTrue(debugMessages[0].Contains($\"The market of the symbol {Symbols.EURUSD.Value} was unexpected: {Symbols.EURUSD.ID.Market}. Using 'DEFAULT' as market\", StringComparison.InvariantCultureIgnoreCase));\n            Assert.IsTrue(debugMessages[1].Contains($\"Warning: Collective2 failed to calculate target quantity for {targetList[0]}. The smallest quantity C2 trades is \\\"1\\\" which is a mini-lot (10,000 currency units), and the target quantity is 498. Will return 0 for all similar cases.\", StringComparison.InvariantCultureIgnoreCase));\n            Assert.IsTrue(debugMessages[2].Contains($\"The market of the symbol {Symbols.GBPUSD.Value} was unexpected: {Symbols.GBPUSD.ID.Market}. Using 'DEFAULT' as market\", StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [Test]\n        public void Collective2SignalExportManagerDoesNotLogMoreThanOnceWhenUnknownSecurityType()\n        {\n            var targetList = new List<PortfolioTarget>() { new(Symbols.BTCUSD, 1), new PortfolioTarget(Symbols.XAUJPY, 1) };\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(new DateTime(2016, 02, 16, 11, 53, 30));\n            algorithm.Portfolio.SetAccountCurrency(\"USD\");\n            var security = algorithm.AddSecurity(Symbols.BTCUSD);\n            var security2 = algorithm.AddSecurity(Symbols.XAUJPY);\n            security.SetMarketPrice(new Tick { Value = 100 });\n            security2.SetMarketPrice(new Tick { Value = 100 });\n\n            algorithm.Portfolio.SetCash(50000);\n\n            using var manager = new Collective2SignalExportHandler(\"\", 0);\n\n            for (int count = 0; count < 100; count++)\n            {\n                manager.GetMessageSent(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n            }\n\n            Assert.AreEqual(2, algorithm.DebugMessages.Count);\n            var debugMessages = algorithm.DebugMessages.ToList();\n            Assert.IsTrue(debugMessages[0].Contains($\"Unexpected security type found: {security.Symbol.SecurityType}. Collective2 just accepts: Equity, Future, Option, Index Option and Stock\", StringComparison.InvariantCultureIgnoreCase));\n            Assert.IsTrue(debugMessages[1].Contains($\"Unexpected security type found: {security2.Symbol.SecurityType}. Collective2 just accepts: Equity, Future, Option, Index Option and Stock\", StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [Test]\n        public void Collective2ConvertsPercentageToQuantityAppropriately()\n        {\n            var symbols = new List<Symbol>()\n            {\n                Symbols.SPY,\n                Symbols.EURUSD,\n                Symbols.AAPL,\n                Symbols.IBM,\n                Symbols.GOOG,\n                Symbols.MSFT,\n                Symbols.CAT\n            };\n\n            var targetList = new List<PortfolioTarget>()\n            {\n                new PortfolioTarget(Symbols.SPY, (decimal)0.01),\n                new PortfolioTarget(Symbols.EURUSD, (decimal)0.99),\n                new PortfolioTarget(Symbols.AAPL, (decimal)(-0.01)),\n                new PortfolioTarget(Symbols.IBM, (decimal)(-0.99)),\n                new PortfolioTarget(Symbols.GOOG, (decimal)0.0),\n                new PortfolioTarget(Symbols.MSFT, (decimal)1.0),\n                new PortfolioTarget(Symbols.CAT, (decimal)(-1.0))\n            };\n\n            var algorithm = new AlgorithmStub();\n            AddSymbols(symbols, algorithm);\n            algorithm.Portfolio.SetCash(50000);\n            algorithm.Settings.MinimumOrderMarginPortfolioPercentage = 0;\n            algorithm.Settings.FreePortfolioValue = 250;\n\n            using var manager = new Collective2SignalExportHandler(\"\", 0);\n\n            var expectedQuantities = new Dictionary<string, int>()\n            {\n                { \"SPY\", 4 },\n                // 492 was rounded down to zero because 1 is a minilot of 10,000 USD\n                // https://support.collective2.com/hc/en-us/articles/360038042774-Forex-minilots\n                { \"EURUSD\", 0},\n                { \"AAPL\", -4 },\n                { \"IBM\", -492 },\n                { \"GOOG\", 0 },\n                { \"MSFT\", 497 },\n                { \"CAT\", -497 }\n            };\n\n            foreach (var target in targetList)\n            {\n                var quantity = manager.ConvertPercentageToQuantity(algorithm, target);\n                Assert.AreEqual(expectedQuantities[target.Symbol.Value], quantity);\n            }\n        }\n\n        [Test]\n        public void SendsTargetsToCrunchDAOAppropriately()\n        {\n            var symbols = new List<Symbol>()\n            {\n                Symbols.SPY,\n                Symbols.AAPL,\n                Symbols.CAT\n            };\n\n            var targetList = new List<PortfolioTarget>()\n            {\n                new PortfolioTarget(Symbols.SPY, (decimal)0.2),\n                new PortfolioTarget(Symbols.AAPL, (decimal)0.2),\n                new PortfolioTarget(Symbols.CAT, (decimal)0.2),\n            };\n\n            var algorithm = new AlgorithmStub();\n            AddSymbols(symbols, algorithm);\n            using var manager = new CrunchDAOSignalExportHandler(\"\", \"\");\n\n            var message = manager.GetMessageSent(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n            var expectedMessage = \"ticker,date,signal\\nSPY,2016-02-16,0.2\\nAAPL,2016-02-16,0.2\\nCAT,2016-02-16,0.2\\n\";\n\n            Assert.AreEqual(expectedMessage, message);\n        }\n\n        [Test]\n        public void CrunchDAOSignalExportReturnsFalseWhenSymbolIsNotAllowed()\n        {\n            var symbols = new List<Symbol>()\n            {\n                Symbols.ES_Future_Chain,\n                Symbols.SPY_Option_Chain,\n                Symbols.EURUSD,\n                Symbols.BTCUSD,\n            };\n\n            var targetList = new List<PortfolioTarget>();\n\n            foreach (var symbol in symbols)\n            {\n                targetList.Add(new PortfolioTarget(symbol, (decimal)0.1));\n            }\n\n            var algorithm = new AlgorithmStub();\n            AddSymbols(symbols, algorithm);\n            algorithm.Portfolio.SetCash(50000);\n            using var manager = new CrunchDAOSignalExport(\"\", \"\");\n\n            var result = manager.Send(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n            Assert.IsFalse(result);\n        }\n\n        [Test]\n        public void CrunchDAOSignalExportReturnsFalseWhenPortfolioTargetListIsEmpty()\n        {\n            var targetList = new List<PortfolioTarget>();\n            using var manager = new CrunchDAOSignalExport(\"\", \"\");\n            var algorithm = new QCAlgorithm();\n\n            var result = manager.Send(new SignalExportTargetParameters { Targets = targetList, Algorithm = algorithm });\n            Assert.IsFalse(result);\n        }\n\n        [Test]\n        public void SendsTargetsToNumeraiAppropriately()\n        {\n            var targets = new List<PortfolioTarget>()\n            {\n                new PortfolioTarget(Symbols.SGX, (decimal)0.05),\n                new PortfolioTarget(Symbols.AAPL, (decimal)0.1),\n                new PortfolioTarget(Symbols.MSFT, (decimal)0.1),\n                new PortfolioTarget(Symbols.ZNGA, (decimal)0.05),\n                new PortfolioTarget(Symbols.FXE, (decimal)0.05),\n                new PortfolioTarget(Symbols.LODE, (decimal)0.05),\n                new PortfolioTarget(Symbols.IBM, (decimal)0.05),\n                new PortfolioTarget(Symbols.GOOG, (decimal)0.1),\n                new PortfolioTarget(Symbols.NFLX, (decimal)0.1),\n                new PortfolioTarget(Symbols.CAT, (decimal)0.1)\n            };\n\n            using var manager = new NumeraiSignalExportHandler(\"\", \"\", \"\");\n            var algorithm = new QCAlgorithm();\n            algorithm.SetDateTime(new DateTime(2023, 03, 03));\n\n            var message = manager.GetMessageSent(new SignalExportTargetParameters { Targets = targets, Algorithm = algorithm });\n            var expectedMessage = \"numerai_ticker,signal\\nSGX SP,0.05\\nAAPL US,0.1\\nMSFT US,0.1\\nZNGA US,0.05\\nFXE US,0.05\\nLODE US,0.05\\nIBM US,0.05\\nGOOG US,0.1\\nNFLX US,0.1\\nCAT US,0.1\\n\";\n\n            Assert.AreEqual(expectedMessage, message);\n        }\n\n        [Test]\n        public void NumeraiReturnsFalseWhenSymbolIsNotAllowed()\n        {\n            var targets = new List<PortfolioTarget>()\n            {\n                new PortfolioTarget(Symbols.SGX, (decimal)0.05),\n                new PortfolioTarget(Symbols.AAPL, (decimal)0.1),\n                new PortfolioTarget(Symbols.MSFT, (decimal)0.1),\n                new PortfolioTarget(Symbols.ZNGA, (decimal)0.05),\n                new PortfolioTarget(Symbols.FXE, (decimal)0.05),\n                new PortfolioTarget(Symbols.LODE, (decimal)0.05),\n                new PortfolioTarget(Symbols.IBM, (decimal)0.05),\n                new PortfolioTarget(Symbols.GOOG, (decimal)0.1),\n                new PortfolioTarget(Symbols.NFLX, (decimal)0.1),\n                new PortfolioTarget(Symbols.EURUSD, (decimal)0.1)\n            };\n\n            using var manager = new NumeraiSignalExport(\"\", \"\", \"\");\n            var algorithm = new QCAlgorithm();\n            var result = manager.Send(new SignalExportTargetParameters { Targets = targets, Algorithm = algorithm });\n            Assert.IsFalse(result);\n        }\n\n        [Test]\n        public void NumeraiReturnsFalseWhenNumberOfTargetsIsLessThanTen()\n        {\n            var targets = new List<PortfolioTarget>()\n            {\n                new PortfolioTarget(Symbols.SGX, (decimal)0.05),\n                new PortfolioTarget(Symbols.AAPL, (decimal)0.1),\n                new PortfolioTarget(Symbols.MSFT, (decimal)0.1),\n                new PortfolioTarget(Symbols.ZNGA, (decimal)0.05),\n                new PortfolioTarget(Symbols.FXE, (decimal)0.05),\n                new PortfolioTarget(Symbols.LODE, (decimal)0.05),\n                new PortfolioTarget(Symbols.IBM, (decimal)0.05),\n                new PortfolioTarget(Symbols.GOOG, (decimal)0.1),\n                new PortfolioTarget(Symbols.NFLX, (decimal)0.1),\n            };\n\n            using var manager = new NumeraiSignalExport(\"\", \"\", \"\");\n            var algorithm = new QCAlgorithm();\n            var result = manager.Send(new SignalExportTargetParameters { Targets = targets, Algorithm = algorithm });\n            Assert.IsFalse(result);\n        }\n\n        [TestCase(SecurityType.Equity, \"SPY\", 68)]\n        [TestCase(SecurityType.Equity, \"AAPL\", -68)]\n        [TestCase(SecurityType.Equity, \"GOOG\", 345)]\n        [TestCase(SecurityType.Equity, \"IBM\", 0)]\n        [TestCase(SecurityType.Forex, \"EURUSD\", 90)]\n        [TestCase(SecurityType.Forex, \"EURUSD\", -90)]\n        [TestCase(SecurityType.Future, \"ES\", 4)]\n        [TestCase(SecurityType.Future, \"ES\", -4)]\n\n        public void SignalExportManagerGetsCorrectPortfolioTargetArray(SecurityType securityType, string ticker, int quantity)\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SetCash(100000);\n\n            var security = algorithm.AddSecurity(securityType, ticker);\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 144.80m, 144.82m));\n            security.Holdings.SetHoldings(144.81m, quantity);\n\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            var result = signalExportManagerHandler.GetPortfolioTargets(out PortfolioTarget[] portfolioTargets);\n\n            Assert.IsTrue(result);\n            var target = portfolioTargets[0];\n            var targetQuantity = (int)PortfolioTarget.Percent(algorithm, target.Symbol, target.Quantity).Quantity;\n            // The quantites can differ by one because of the number of lots for certain securities\n            Assert.AreEqual(quantity, targetQuantity, 1);\n        }\n\n        [Test]\n        public void SignalExportManagerDoesNotThrowOnZeroPrice()\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetDateTime(new DateTime(2024, 02, 16, 11, 53, 30));\n\n            var security = algorithm.AddSecurity(Symbols.SPY);\n            // Set the market price to 0 to simulate the edge case being tested\n            security.SetMarketPrice(new Tick { Value = 0 });\n\n            using var manager = new Collective2SignalExportHandler(\"\", 0);\n            // Ensure ConvertPercentageToQuantity does not throw when price is 0\n            Assert.DoesNotThrow(() =>\n            {\n                var result = manager.ConvertPercentageToQuantity(algorithm, new PortfolioTarget(Symbols.SPY, 0));\n                Assert.AreEqual(0, result);\n            });\n        }\n\n        [Test]\n        public void SignalExportManagerHandlesIndexOptions()\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SetCash(100000);\n\n            int quantity = 123;\n            var underlying = algorithm.AddIndex(\"SPX\", Resolution.Minute).Symbol;\n\n            // Create the option contract (IndexOption) with specific parameters\n            var option = Symbol.CreateOption(\n                underlying,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3800m,\n                new DateTime(2021, 1, 04));\n\n            var security = algorithm.AddIndexOptionContract(option, Resolution.Minute);\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 144.80m, 144.82m));\n            security.Holdings.SetHoldings(144.81m, quantity);\n\n            // Initialize the SignalExportManagerHandler and get portfolio targets\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            var result = signalExportManagerHandler.GetPortfolioTargets(out PortfolioTarget[] portfolioTargets);\n\n            // Assert that the result is successful\n            Assert.IsTrue(result);\n\n            // Get the portfolio target and verify the quantity matches\n            var target = portfolioTargets[0];\n            var targetQuantity = (int)PortfolioTarget.Percent(algorithm, target.Symbol, target.Quantity).Quantity;\n            Assert.AreEqual(quantity, targetQuantity);\n\n            // Ensure the symbol is of type IndexOption\n            Assert.IsTrue(target.Symbol.SecurityType == SecurityType.IndexOption);\n        }\n\n        [Test]\n        public void SignalExportManagerIgnoresIndexSecurities()\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SetCash(100000);\n\n            var security = algorithm.AddIndexOption(\"SPX\", \"SPXW\");\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 144.80m, 144.82m));\n            security.Holdings.SetHoldings(144.81m, 10);\n\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            var result = signalExportManagerHandler.GetPortfolioTargets(out PortfolioTarget[] portfolioTargets);\n\n            Assert.IsTrue(result);\n            Assert.IsFalse(portfolioTargets.Where(x => x.Symbol.SecurityType == SecurityType.Index).Any());\n        }\n\n        [TestCaseSource(nameof(SignalExportManagerSkipsNonTradeableFuturesTestCase))]\n        public void SignalExportManagerSkipsNonTradeableFutures(IEnumerable<Symbol> symbols, int expectedNumberOfTargets)\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SetCash(100000);\n\n            foreach (var symbol in symbols)\n            {\n                var security = algorithm.AddSecurity(symbol);\n                security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 144.80m, 144.82m));\n                security.Holdings.SetHoldings(144.81m, 100);\n            }\n\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            var result = signalExportManagerHandler.GetPortfolioTargets(out PortfolioTarget[] portfolioTargets);\n\n            Assert.IsTrue(result);\n            Assert.AreEqual(expectedNumberOfTargets, portfolioTargets.Length);\n        }\n\n        [Test]\n        public void SignalExportManagerReturnsFalseWhenNegativeTotalPortfolioValue()\n        {\n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SetCash(-100000);\n\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            Assert.IsFalse(signalExportManagerHandler.GetPortfolioTargets(out _));\n        }\n\n        [Test]\n        public void EmptySignalExportList()\n        {   \n            var algorithm = new AlgorithmStub(true);\n            algorithm.SetLiveMode(true);\n            algorithm.SetFinishedWarmingUp();\n\n            algorithm.SetCash(100000);\n\n            var security = algorithm.AddSecurity(Symbols.SPY);\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 144.80m, 144.82m));\n            security.Holdings.SetHoldings(144.81m, 100);\n           \n            var utcTime = DateTime.UtcNow;\n            var signalExportManagerHandler = new SignalExportManagerHandler(algorithm);\n            signalExportManagerHandler.OnOrderEvent(new OrderEvent(0, security.Symbol, utcTime.AddMinutes(-1), OrderStatus.Filled, OrderDirection.Buy, 100, 100, new Orders.Fees.OrderFee(new Securities.CashAmount(1, \"USD\"))));\n\n            Assert.DoesNotThrow(() => signalExportManagerHandler.SetTargetPortfolioFromPortfolio());\n            Assert.DoesNotThrow(() => signalExportManagerHandler.Flush(utcTime));\n        }\n\n        private static object[] SendsTargetsToCollective2AppropriatelyTestCases =\n        {\n            new object[] { \"USD\", Symbols.SPY, 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"CS\"\"},\"\"quantity\"\":2992.0}]}\" },\n            new object[] { \"USD\", Symbols.EURUSD, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbols.EURGBP, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/GBP\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbols.GBPJPY, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GBP/JPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbols.GBPUSD, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GBP/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbols.USDJPY, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"USD/JPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2016, 02, 15)), 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[]}\" },\n            new object[] { \"USD\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2056, 02, 19)), 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"OPT\"\",\"\"maturityMonthYear\"\":\"\"20560218\"\",\"\"putOrCall\"\":1,\"\"strikePrice\"\":192.0},\"\"quantity\"\":29.0}]}\" },\n            new object[] { \"USD\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 192m, new DateTime(2056, 02, 19)), 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"OPT\"\",\"\"maturityMonthYear\"\":\"\"20560218\"\",\"\"putOrCall\"\":0,\"\"strikePrice\"\":192.0},\"\"quantity\"\":29.0}]}\" },\n            new object[] { \"USD\", Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"FXCM\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"USD\", Symbol.Create(\"NQX\", SecurityType.IndexOption, Market.USA), 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"NQX\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"OPT\"\",\"\"putOrCall\"\":1,\"\"strikePrice\"\":0.0},\"\"quantity\"\":29.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"NIFTY\", Market.India, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"NIFTY\"\",\"\"currency\"\":\"\"INR\"\",\"\"securityExchange\"\":\"\"XNSE\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":299250.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"HSI\", Market.HKFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"HSI\"\",\"\"currency\"\":\"\"HKD\"\",\"\"securityExchange\"\":\"\"XHKF\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":24.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"ZG\", Market.NYSELIFFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"ZG\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XNLI\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":73.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"FESX\", Market.EUREX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"FESX\"\",\"\"currency\"\":\"\"EUR\"\",\"\"securityExchange\"\":\"\"XEUR\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":498.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"KC\", Market.ICE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"KC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"IEPA\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":415.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"VIX\", Market.CFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"VIX\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XCBF\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":14962.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"ZC\", Market.CBOT, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"ZC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XCBT\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":2770.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"GC\", Market.COMEX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XCEC\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":316.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"CL\", Market.NYMEX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"CL\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XNYM\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":201.0}]}\" },\n            new object[] { \"USD\", Symbol.CreateFuture(\"NK\", Market.SGX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"NK\"\",\"\"currency\"\":\"\"JPY\"\",\"\"securityExchange\"\":\"\"XSES\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":425.0}]}\" },\n            new object[] { \"EUR\", Symbols.SPY, 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"CS\"\"},\"\"quantity\"\":2992.0}]}\" },\n            new object[] { \"EUR\", Symbols.EURUSD, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbols.EURGBP, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/GBP\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbols.GBPJPY, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GBP/JPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbols.GBPUSD, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GBP/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbols.USDJPY, 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"USD/JPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"OPT\"\",\"\"maturityMonthYear\"\":\"\"20560218\"\",\"\"putOrCall\"\":1,\"\"strikePrice\"\":192.0},\"\"quantity\"\":149.0}]}\" },\n            new object[] { \"EUR\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 192m, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"SPY\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"DEFAULT\"\",\"\"securityType\"\":\"\"OPT\"\",\"\"maturityMonthYear\"\":\"\"20560218\"\",\"\"putOrCall\"\":0,\"\"strikePrice\"\":192.0},\"\"quantity\"\":149.0}]}\" },\n            new object[] { \"EUR\", Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2016, 02, 15)), 0.2m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[]}\" },\n            new object[] { \"EUR\", Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"EUR/USD\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"FXCM\"\",\"\"securityType\"\":\"\"FOR\"\"},\"\"quantity\"\":1.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"NIFTY\", Market.India, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"NIFTY\"\",\"\"currency\"\":\"\"INR\"\",\"\"securityExchange\"\":\"\"XNSE\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":299250.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"HSI\", Market.HKFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"HSI\"\",\"\"currency\"\":\"\"HKD\"\",\"\"securityExchange\"\":\"\"XHKF\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":24.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"ZG\", Market.NYSELIFFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"ZG\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XNLI\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":73.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"FESX\", Market.EUREX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"FESX\"\",\"\"currency\"\":\"\"EUR\"\",\"\"securityExchange\"\":\"\"XEUR\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":498.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"KC\", Market.ICE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"KC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"IEPA\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":415.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"VIX\", Market.CFE, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"VIX\"\",\"\"currency\"\":\"\"EUR\"\",\"\"securityExchange\"\":\"\"XCBF\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":14962.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"ZC\", Market.CBOT, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"ZC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XCBT\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":2770.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"GC\", Market.COMEX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"GC\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XCEC\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":316.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"CL\", Market.NYMEX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"CL\"\",\"\"currency\"\":\"\"USD\"\",\"\"securityExchange\"\":\"\"XNYM\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":201.0}]}\" },\n            new object[] { \"EUR\", Symbol.CreateFuture(\"NK\", Market.SGX, new DateTime(2056, 02, 19)), 1m, @\"{\"\"StrategyId\"\":0,\"\"Positions\"\":[{\"\"exchangeSymbol\"\":{\"\"symbol\"\":\"\"NK\"\",\"\"currency\"\":\"\"JPY\"\",\"\"securityExchange\"\":\"\"XSES\"\",\"\"securityType\"\":\"\"FUT\"\",\"\"maturityMonthYear\"\":\"\"20560219\"\"},\"\"quantity\"\":425.0}]}\" },\n        };\n\n        private static void AddSymbols(List<Symbol> symbols, QCAlgorithm algorithm)\n        {\n            algorithm.SetDateTime(new DateTime(2016, 02, 16, 11, 53, 30));\n\n            foreach (var symbol in symbols)\n            {\n                var security = algorithm.AddSecurity(symbol);\n                security.SetMarketPrice(new Tick { Value = 100 });\n            }\n        }\n\n        /// <summary>\n        /// Creates a TradebarConfiguration for the given symbol\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for which we want to create a TradeBarConfiguration</param>\n        /// <returns>A new TradebarConfiguration for the given symbol</returns>\n        private static SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n\n        /// <summary>\n        /// Handler class to test how SignalExportManager obtains the portfolio targets from the algorithm's portfolio\n        /// </summary>\n        private class SignalExportManagerHandler : SignalExportManager\n        {\n            public SignalExportManagerHandler(IAlgorithm algorithm) : base(algorithm)\n            {\n\n            }\n\n            /// <summary>\n            /// Handler method to obtain portfolio targets from algorithm's portfolio\n            /// </summary>\n            /// <param name=\"targets\">An array of portfolio targets from the algorithm's Portfolio</param>\n            /// <returns>True if TotalPortfolioValue was bigger than zero</returns>\n            public bool GetPortfolioTargets(out PortfolioTarget[] targets)\n            {\n                return base.GetPortfolioTargets(out targets);\n            }\n        }\n\n        /// <summary>\n        /// Handler class to test how Collective2SignalExport converts target percentage to number of shares. Additionally,\n        /// to test the message sent to Collective2 API\n        /// </summary>\n        private class Collective2SignalExportHandler : Collective2SignalExport\n        {\n            public Collective2SignalExportHandler(string apiKey, int systemId) : base(apiKey, systemId)\n            {\n            }\n\n            /// <summary>\n            /// Handler method to test how Collective2SignalExport converts target percentage to number of shares\n            /// </summary>\n            /// <param name=\"algorithm\">Algorithm being ran</param>\n            /// <param name=\"target\">Target with quantity as percentage</param>\n            /// <returns>Number of shares for the given target percentage</returns>\n            public int ConvertPercentageToQuantity(IAlgorithm algorithm, PortfolioTarget target)\n            {\n                return base.ConvertPercentageToQuantity(algorithm, target);\n            }\n\n            /// <summary>\n            /// Handler method to test the message sent to Collective2 API\n            /// </summary>\n            /// <param name=\"parameters\">A list of holdings from the portfolio \n            /// expected to be sent to Collective2 API and the algorithm being ran</param>\n            /// <returns>Message sent to Collective2 API</returns>\n            public string GetMessageSent(SignalExportTargetParameters parameters)\n            {\n                ConvertHoldingsToCollective2(parameters, out List<Collective2Position> positions);\n                var message = CreateMessage(positions);\n\n                return message;\n            }\n        }\n\n        /// <summary>\n        /// Handler class to test the message sent to CrunchDAO API\n        /// </summary>\n        private class CrunchDAOSignalExportHandler : CrunchDAOSignalExport\n        {\n            public CrunchDAOSignalExportHandler(string apiKey, string model, string submissionName = \"\", string comment = \"\") : base(apiKey, model, submissionName, comment)\n            {\n            }\n\n            /// <summary>\n            /// Handler method to test the message sent to CrunchDAO API\n            /// </summary>\n            /// <param name=\"parameters\">A list of holdings from the portfolio \n            /// expected to be sent to CrunchDAO2 API and the algorithm being ran</param>\n            /// <returns>Message sent to CrunchDAO API</returns>\n            public string GetMessageSent(SignalExportTargetParameters parameters)\n            {\n                ConvertToCSVFormat(parameters, out string message);\n                return message;\n            }\n        }\n\n        /// <summary>\n        /// Handler class to test message sent to Numerai API\n        /// </summary>\n        private class NumeraiSignalExportHandler : NumeraiSignalExport\n        {\n            public NumeraiSignalExportHandler(string publicId, string secretId, string modelId, string fileName = \"predictions.csv\") : base(publicId, secretId, modelId, fileName)\n            {\n            }\n\n            /// <summary>\n            /// Handler method to test the message sent to Numerai API\n            /// </summary>\n            /// <param name=\"parameters\">A list of holdings from the portfolio \n            /// expected to be sent to Numerai API and the algorithm being ran</param>\n            /// <returns>Message sent to Numerai API</returns>\n            public string GetMessageSent(SignalExportTargetParameters parameters)\n            {\n                ConvertTargetsToNumerai(parameters, out string message);\n                return message;\n            }\n        }\n\n        private static object[] SignalExportManagerSkipsNonTradeableFuturesTestCase =\n        {\n            new object[] { new List<Symbol>() { Symbols.AAPL, Symbols.SPY, Symbols.SPX }, 2 },\n            new object[] { new List<Symbol>() { Symbols.AAPL, Symbols.SPY, Symbols.NFLX }, 3 },\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Portfolio/UnconstrainedMeanVariancePortfolioOptimizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by aaplicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Portfolio\n{\n    [TestFixture]\n    public class UnconstrainedMeanVariancePortfolioOptimizerTests : PortfolioOptimizerTestsBase\n    {\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            HistoricalReturns = new List<double[,]>\n            {\n                new double[,] { { 0.76, -0.06, 1.22, 0.17 }, { 0.02, 0.28, 1.25, -0.00 }, { -0.50, -0.13, -0.50, -0.03 }, { 0.81, 0.31, 2.39, 0.26 }, { -0.02, 0.02, 0.06, 0.01 } },\n                new double[,] { { -0.15, 0.67, 0.45 }, { -0.44, -0.10, 0.07 }, { 0.04, -0.41, 0.01 }, { 0.01, 0.03, 0.02 } },\n                new double[,] { { -0.02, 0.65, 1.25 }, { -0.29, -0.39, -0.50 }, { 0.29, 0.58, 2.39 }, { 0.00, -0.01, 0.06 } },\n                new double[,] { { 0.76, 0.25, 0.21 }, { 0.02, -0.15, 0.45 }, { -0.50, -0.44, 0.07 }, { 0.81, 0.04, 0.01 }, { -0.02, 0.01, 0.02 } }\n            };\n\n           ExpectedReturns = new List<double[]>\n            {\n                new double[] { 0.21, 0.08, 0.88, 0.08 }, \n                new double[] { -0.13, 0.05, 0.14 },\n                null,\n                null\n            };\n\n            Covariances = new List<double[,]>\n            {\n                new double[,] { { 0.31, 0.05, 0.55, 0.07 }, { 0.05, 0.04, 0.18, 0.01 }, { 0.55, 0.18, 1.28, 0.12 }, { 0.07, 0.01, 0.12, 0.02 } },\n                new double[,] { { 0.05, -0.02, -0.01 }, { -0.02, 0.21, 0.09 }, { -0.01, 0.09, 0.04 } },\n                new double[,] { { 0.06, 0.09, 0.28 }, { 0.09, 0.25, 0.58 }, { 0.28, 0.58, 1.66 } },\n                null\n            };\n\n            ExpectedResults = new List<double[]>\n            {\n                new double[] { -13.288136, -23.322034, 8.79661, 9.389831 },\n                new double[] { -0.142857, -35.285714, 82.857143 },\n                new double[] { -13.232262, -3.709534, 4.009978 },\n                new double[] { 4.621852, -9.651736, 5.098332 },\n            };\n        }\n        \n        protected override IPortfolioOptimizer CreateOptimizer()\n        {\n            return new UnconstrainedMeanVariancePortfolioOptimizer();\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        public override void OptimizeWeightings(int testCaseNumber)\n        {\n            base.OptimizeWeightings(testCaseNumber);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/QCAlgorithmFrameworkTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Algorithm.Framework\n{\n    [TestFixture]\n    public class QCAlgorithmFrameworkTests\n    {\n        [Test]\n        public void SetsInsightGeneratedAndCloseTimes()\n        {\n            var eventFired = false;\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algo.InsightsGenerated += (algorithm, data) =>\n            {\n                eventFired = true;\n                var insights = data.Insights;\n                Assert.AreEqual(1, insights.Length);\n                Assert.IsTrue(insights.All(insight => insight.GeneratedTimeUtc != default(DateTime)));\n                Assert.IsTrue(insights.All(insight => insight.CloseTimeUtc != default(DateTime)));\n            };\n            var security = algo.AddEquity(\"SPY\");\n            algo.SetUniverseSelection(new ManualUniverseSelectionModel());\n\n            var alpha = new FakeAlpha();\n            algo.SetAlpha(alpha);\n\n            var construction = new FakePortfolioConstruction();\n            algo.SetPortfolioConstruction(construction);\n\n            var tick = new Tick\n            {\n                Symbol = security.Symbol,\n                Value = 1,\n                Quantity = 2\n            };\n            security.SetMarketPrice(tick);\n\n            algo.OnFrameworkData(new Slice(new DateTime(2000, 01, 01), algo.Securities.Select(s => tick), new DateTime(2000, 01, 01)));\n\n            Assert.IsTrue(eventFired);\n            Assert.AreEqual(1, construction.Insights.Count);\n            Assert.IsTrue(construction.Insights.All(insight => insight.GeneratedTimeUtc != default(DateTime)));\n            Assert.IsTrue(construction.Insights.All(insight => insight.CloseTimeUtc != default(DateTime)));\n        }\n\n        [TestCase(true, 0)]\n        [TestCase(false, 2)]\n        public void DelistedSecuritiesInsightsTest(bool isDelisted, int expectedCount)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algorithm.SetStartDate(2007, 5, 16);\n            algorithm.SetUniverseSelection(new ManualUniverseSelectionModel());\n            algorithm.SetFinishedWarmingUp();\n\n            var alpha = new FakeAlpha();\n            algorithm.SetAlpha(alpha);\n\n            var construction = new FakePortfolioConstruction();\n            algorithm.SetPortfolioConstruction(construction);\n\n            var actualInsights = new List<Insight>();\n            algorithm.InsightsGenerated += (s, e) => actualInsights.AddRange(e.Insights);\n\n            var security = algorithm.AddEquity(\"SPY\", Resolution.Daily);\n            var tick = new Tick\n            {\n                Symbol = security.Symbol,\n                Value = 1,\n                Quantity = 2\n            };\n\n            security.SetMarketPrice(tick);\n            security.IsDelisted = isDelisted;\n\n            // Trigger Alpha to emit insight\n            algorithm.OnFrameworkData(new Slice(new DateTime(2000, 01, 01), new List<BaseData>() { tick }, new DateTime(2000, 01, 01)));\n\n            // Manually emit insight\n            algorithm.EmitInsights(Insight.Price(Symbols.SPY, TimeSpan.FromDays(1), InsightDirection.Up, .5, .75));\n\n            // Should be zero because security is delisted\n            Assert.AreEqual(expectedCount, actualInsights.Count);\n        }\n\n        class FakeAlpha : AlphaModel\n        {\n            public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)\n            {\n                yield return Insight.Price(Symbols.SPY, TimeSpan.FromDays(1), InsightDirection.Up, .5, .75);\n            }\n        }\n\n        class FakePortfolioConstruction : PortfolioConstructionModel\n        {\n            public IReadOnlyCollection<Insight> Insights { get; private set; }\n            public override IEnumerable<IPortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)\n            {\n                Insights = insights;\n                return insights.Select(insight => PortfolioTarget.Percent(algorithm, insight.Symbol, 0.01m));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Risk/MaximumDrawdownPercentPerSecurityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Risk\n{\n    [TestFixture]\n    public class MaximumDrawdownPercentPerSecurityTests\n    {\n        [Test]\n        [TestCase(Language.CSharp, 0.1, false, 0, 0, false)]\n        [TestCase(Language.CSharp, 0.1, true, -50, 1000, false)]\n        [TestCase(Language.CSharp, 0.1, true, -100, 1000, false)]\n        [TestCase(Language.CSharp, 0.1, true, -150, 1000, true)]\n        [TestCase(Language.Python, 0.1, false, 0, 0, false)]\n        [TestCase(Language.Python, 0.1, true, -50, 1000, false)]\n        [TestCase(Language.Python, 0.1, true, -100, 1000, false)]\n        [TestCase(Language.Python, 0.1, true, -150, 1000, true)]\n        public void ReturnsExpectedPortfolioTarget(\n            Language language,\n            decimal maxDrawdownPercent,\n            bool invested,\n            decimal unrealizedProfit,\n            decimal absoluteHoldingsCost,\n            bool shouldLiquidate)\n        {\n            var security = new Mock<Equity>(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                Exchange.UNKNOWN\n            );\n            security.Setup(m => m.Invested).Returns(invested);\n\n            var holding = new Mock<EquityHolding>(security.Object,\n                new IdentityCurrencyConverter(Currencies.USD));\n            holding.Setup(m => m.UnrealizedProfit).Returns(unrealizedProfit);\n            holding.Setup(m => m.AbsoluteHoldingsCost).Returns(absoluteHoldingsCost);\n            holding.Setup(m => m.UnrealizedProfitPercent).Returns(absoluteHoldingsCost == 0m? 0m : unrealizedProfit / absoluteHoldingsCost);\n\n            security.Object.Holdings = holding.Object;\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.Securities.Add(Symbols.AAPL, security.Object);\n\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(MaximumDrawdownPercentPerSecurity);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(maxDrawdownPercent.ToPython());\n                    var model = new RiskManagementModelPythonWrapper(instance);\n                    algorithm.SetRiskManagement(model);\n                }\n            }\n            else\n            {\n                var model = new MaximumDrawdownPercentPerSecurity(maxDrawdownPercent);\n                algorithm.SetRiskManagement(model);\n            }\n\n            var targets = algorithm.RiskManagement.ManageRisk(algorithm, null).ToList();\n\n            if (shouldLiquidate)\n            {\n                Assert.AreEqual(1, targets.Count);\n                Assert.AreEqual(Symbols.AAPL, targets[0].Symbol);\n                Assert.AreEqual(0, targets[0].Quantity);\n            }\n            else\n            {\n                Assert.AreEqual(0, targets.Count);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Risk/MaximumDrawdownPercentPortfolioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Risk\n{\n    [TestFixture]\n    public class MaximumDrawdownPercentPortfolioTests\n    {\n        [Test]\n        [TestCase(Language.CSharp, false, 0, false)]\n        [TestCase(Language.CSharp, true, -1000, false)]\n        [TestCase(Language.CSharp, true, -10000, false)]\n        [TestCase(Language.CSharp, true, -10001, true)]\n        [TestCase(Language.Python, false, 0, false)]\n        [TestCase(Language.Python, true, -1000, false)]\n        [TestCase(Language.Python, true, -10000, false)]\n        [TestCase(Language.Python, true, -10001, true)]\n        public void ReturnsExpectedPortfolioTarget(\n            Language language,\n            bool invested,\n            decimal absoluteHoldingsCost,\n            bool shouldLiquidate)\n        {\n            var algorithm = CreateAlgorithm(language, 0.1m);\n            var targets = algorithm.RiskManagement.ManageRisk(algorithm, new PortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) }).ToList();\n            Assert.AreEqual(0, targets.Count);\n\n            algorithm.Securities.Add(Symbols.AAPL, GetSecurity(Symbols.AAPL, invested, absoluteHoldingsCost));\n            algorithm.Portfolio.InvalidateTotalPortfolioValue();\n            targets = algorithm.RiskManagement.ManageRisk(algorithm, new PortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10)}).ToList();\n\n            if (shouldLiquidate)\n            {\n                Assert.AreEqual(1, targets.Count);\n                Assert.AreEqual(Symbols.AAPL, targets[0].Symbol);\n                Assert.AreEqual(0, targets[0].Quantity);\n            }\n            else\n            {\n                Assert.AreEqual(0, targets.Count);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void ReturnsExpectedPortfolioTargetsAfterReset(Language language)\n        {\n            var algorithm = CreateAlgorithm(language, 0.1m);\n            var targets = algorithm.RiskManagement.ManageRisk(algorithm, new PortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) }).ToList();\n            algorithm.Securities.Add(Symbols.AAPL, GetSecurity(Symbols.AAPL, true, -10001));\n            algorithm.Portfolio.InvalidateTotalPortfolioValue();\n            targets = algorithm.RiskManagement.ManageRisk(algorithm, new PortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) }).ToList();\n\n            Assert.AreEqual(1, targets.Count);\n            Assert.AreEqual(Symbols.AAPL, targets[0].Symbol);\n            Assert.AreEqual(0, targets[0].Quantity);\n\n            algorithm.Securities.Add(Symbols.AAPL, GetSecurity(Symbols.AAPL, true, 10001));\n            targets = algorithm.RiskManagement.ManageRisk(algorithm, new PortfolioTarget[] { new PortfolioTarget(Symbols.AAPL, 10) }).ToList();\n            Assert.AreEqual(0, targets.Count);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void ReturnsMoreThanOnePortfolioTarget(Language language)\n        {\n            var targetSymbols = new PortfolioTarget[] {\n                new PortfolioTarget(Symbols.AAPL, 10),\n                new PortfolioTarget(Symbols.SPY, 100),\n                new PortfolioTarget(Symbols.MSFT, 1000),\n                new PortfolioTarget(Symbols.GOOG, 10000),\n                new PortfolioTarget(Symbols.IBM, 100000)};\n\n            var algorithm = CreateAlgorithm(language, 0.1m);\n            var returnedTargets = algorithm.RiskManagement.ManageRisk(algorithm, targetSymbols).ToList();\n\n            targetSymbols.ToList().ForEach(x => algorithm.Securities.Add(x.Symbol, GetSecurity( x.Symbol, true, -x.Quantity)));\n            algorithm.Portfolio.InvalidateTotalPortfolioValue();\n            returnedTargets = algorithm.RiskManagement.ManageRisk(algorithm, targetSymbols).ToList();\n\n            Assert.AreEqual(targetSymbols.Length, returnedTargets.Count);\n            Assert.AreEqual(targetSymbols.Select(x => x.Symbol), returnedTargets.Select(x => x.Symbol));\n            Assert.IsTrue(returnedTargets.All(x => x.Quantity == 0));\n        }\n\n        private QCAlgorithm CreateAlgorithm(Language language, decimal maxDrawdownPercent)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n\n            if (language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(MaximumDrawdownPercentPortfolio);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(maxDrawdownPercent.ToPython());\n                    var model = new RiskManagementModelPythonWrapper(instance);\n                    algorithm.SetRiskManagement(model);\n                }\n            }\n            else\n            {\n                var model = new MaximumDrawdownPercentPortfolio(maxDrawdownPercent);\n                algorithm.SetRiskManagement(model);\n            }\n\n            return algorithm;\n        }\n\n        private Security GetSecurity(Symbol symbol, bool invested, decimal absoluteHoldingsCost)\n        {\n            // Add security\n            var security = new Mock<Equity>(\n                symbol,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                Exchange.UNKNOWN\n            );\n            var holding = new Mock<EquityHolding>(security.Object,\n                new IdentityCurrencyConverter(Currencies.USD));\n            holding.Setup(m => m.Invested).Returns(invested);\n            holding.Setup(m => m.HoldingsValue).Returns(absoluteHoldingsCost);\n\n            security.Object.Holdings = holding.Object;\n            return security.Object;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Risk/TrailingStopRiskManagementModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Risk;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Risk\n{\n    [TestFixture]\n    public class TrailingStopRiskManagementModelTests\n    {\n        [Test, TestCaseSource(nameof(GenerateTestData))]\n        public void ReturnsExpectedPortfolioTarget(\n            TrailingStopRiskManagementModelTestParameters parameters)\n        {\n            var decimalPrices = System.Array.ConvertAll(parameters.Prices, x => (decimal) x);\n\n            var security = new Mock<Security>(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 1000m, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.CallBase = true;\n            security.Object.FeeModel = new ConstantFeeModel(0);\n\n            var holding = new SecurityHolding(security.Object, new IdentityCurrencyConverter(Currencies.USD));\n            holding.SetHoldings(parameters.InitialPrice, parameters.Quantity);\n            security.Object.Holdings = holding;\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SetPandasConverter();\n            algorithm.Securities.Add(Symbols.AAPL, security.Object);\n\n            if (parameters.Language == Language.Python)\n            {\n                using (Py.GIL())\n                {\n                    const string name = nameof(TrailingStopRiskManagementModel);\n                    var instance = Py.Import(name).GetAttr(name).Invoke(parameters.MaxDrawdownPercent.ToPython());\n                    var model = new RiskManagementModelPythonWrapper(instance);\n                    algorithm.SetRiskManagement(model);\n                }\n            }\n            else\n            {\n                var model = new TrailingStopRiskManagementModel(parameters.MaxDrawdownPercent);\n                algorithm.SetRiskManagement(model);\n            }\n\n            var quantity = parameters.Quantity;\n\n            for (int i = 0; i < decimalPrices.Length; i++)\n            {\n                var price = decimalPrices[i];\n                security.Object.SetMarketPrice(new Tick(DateTime.Now, security.Object.Symbol, price, price));\n                security.Setup((m => m.Invested)).Returns(parameters.InvestedArray[i]);\n\n                var targets = algorithm.RiskManagement.ManageRisk(algorithm, null).ToList();\n                var shouldLiquidate = parameters.ShouldLiquidateArray[i];\n\n                if (shouldLiquidate)\n                {\n                    Assert.AreEqual(1, targets.Count);\n                    Assert.AreEqual(Symbols.AAPL, targets[0].Symbol);\n                    Assert.AreEqual(0, targets[0].Quantity);\n                }\n                else\n                {\n                    Assert.AreEqual(0, targets.Count);\n                }\n\n                if (shouldLiquidate || parameters.ChangePosition[i])\n                {\n                    // Go from long to short or viceversa\n                    holding.SetHoldings(price, quantity = -quantity);\n                }\n            }\n        }\n\n        static IEnumerable<TestCaseData> GenerateTestData()\n        {\n            Language[] languages = new Language[] { Language.CSharp, Language.Python };\n            TrailingStopRiskManagementModelTestParameters[] datasets = new TrailingStopRiskManagementModelTestParameters[]\n            {\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnCorrectPriceChangeInLongPosition\",\n                    0.05m,\n                    1m,\n                    1m,\n                    new decimal[] { 100m, 99.95m, 99.94m, 95m, 94.99m },\n                    new bool[] { true, true, true, true, true },\n                    new bool[] { false, false, false, false, false },\n                    new bool[] { false, false, false, false, true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnCorrectPriceChangeInShortPosition\",\n                    0.1m,\n                    100m,\n                    -1m,\n                    new decimal[] { 50m, 54.99m, 55m, 55.01m },\n                    new bool[] { true, true, true, true },\n                    new bool[] { false, false, false, false },\n                    new bool[] { false, false, false, true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"DoesntLiquidateIfSecurityIsNotInvested\",\n                    0.05m,\n                    1m,\n                    1m,\n                    new decimal[] { 100m, 94.99m, 90m },\n                    new bool[] { false, false, false },\n                    new bool[] { false, false, false },\n                    new bool[] { false, false, false }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnCorrectPriceChangeInLongPositionWithUnivestedSecurityInFirstPrices\",\n                    0.05m,\n                    1m,\n                    1m,\n                    new decimal[] { 10m, 100m, 99.95m, 99.94m, 95m, 94.99m },\n                    new bool[] { false, true, true, true, true, true },\n                    new bool[] { false, false, false, false, false, false },\n                    new bool[] { false, false, false, false, false, true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnCorrectPriceChangeInShortPositionWithUnivestedSecurityInFirstPrices\",\n                    0.1m,\n                    100m,\n                    -1m,\n                    new decimal[] { 90m, 100m, 50m, 54.99m, 55m, 55.01m },\n                    new bool[] { false, true, true, true, true, true },\n                    new bool[] { false, false, false, false, false, false },\n                    new bool[] { false, false, false, false, false, true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"DoesntLiquidateIfPricesDontChangeInLongPosition\",\n                    0.05m,\n                    1m,\n                    1m,\n                    new decimal[] { 1m, 1m, 1m, 1m },\n                    new bool[] { true, true, true, true },\n                    new bool[] { false, false, false, false },\n                    new bool[] { false, false, false, false }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"DoesntLiquidateIfPricesDontChangeInShortPosition\",\n                    0.05m,\n                    1m,\n                    -1m,\n                    new decimal[] { 1m, 1m, 1m, 1m },\n                    new bool[] { true, true, true, true },\n                    new bool[] { false, false, false, false },\n                    new bool[] { false, false, false, false }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesAfterSwitchingToShortPosition\",\n                    0.05m,\n                    1m,\n                    1m,\n                    new decimal[] { 100m, 90m, 70m, 50m, 52.6m },\n                    new bool[] { true, true, true, true, true },\n                    new bool[] { true, false, false, false, false },\n                    new bool[] { false, false, false, false, true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnFirstCallForLongPosition\",\n                    0.1m,\n                    100m,\n                    1m,\n                    new decimal[] { 89.99m },\n                    new bool[] { true },\n                    new bool[] { false },\n                    new bool[] { true }\n                ),\n                new TrailingStopRiskManagementModelTestParameters(\n                    \"LiquidatesOnFirstCallForShortPosition\",\n                    0.1m,\n                    100m,\n                    -1m,\n                    new decimal[] { 110.01m },\n                    new bool[] { true },\n                    new bool[] { false },\n                    new bool[] { true }\n                )\n            };\n\n            return (\n                from parameters in datasets\n                from language in languages\n                select new TrailingStopRiskManagementModelTestParameters(\n                    parameters.Name,\n                    parameters.MaxDrawdownPercent,\n                    parameters.InitialPrice,\n                    parameters.Quantity,\n                    parameters.Prices,\n                    parameters.InvestedArray,\n                    parameters.ChangePosition,\n                    parameters.ShouldLiquidateArray,\n                    language\n                )\n            )\n            .OrderBy(c => c.Language)\n            // generate test cases from test parameters\n            .Select(x => new TestCaseData(x).SetName(x.Language + \"/\" + x.Name))\n            .ToArray();\n        }\n\n        public class TrailingStopRiskManagementModelTestParameters\n        {\n            public string Name { get; init; }\n            public Language Language { get; init; }\n            public decimal MaxDrawdownPercent { get; init; }\n            public decimal InitialPrice { get; init; }\n            public decimal Quantity { get; init; }\n            public decimal[] Prices { get; init; }\n            public bool[] InvestedArray { get; init; }\n            public bool[] ChangePosition { get; init; }\n            public bool[] ShouldLiquidateArray { get; init; }\n\n            public TrailingStopRiskManagementModelTestParameters(\n                string name,\n                decimal maxDrawdownPercent,\n                decimal initialPrice,\n                decimal quantity,\n                decimal[] prices,\n                bool[] investedArray,\n                bool[] changePosition,\n                bool[] shouldLiquidateArray,\n                Language language = Language.CSharp\n                )\n            {\n                Name = name;\n                Language = language;\n                MaxDrawdownPercent = maxDrawdownPercent;\n                InitialPrice = initialPrice;\n                Quantity = quantity;\n                Prices = prices;\n                InvestedArray = investedArray;\n                ChangePosition = changePosition;\n                ShouldLiquidateArray = shouldLiquidateArray;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Selection/ETFConstituentsUniverseSelectionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing Moq;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Selection\n{\n    [TestFixture]\n    public class ETFConstituentsUniverseSelectionModelTests\n    {\n        [TestCase(\"from Selection.ETFConstituentsUniverseSelectionModel import *\", \"Selection.ETFConstituentsUniverseSelectionModel.ETFConstituentsUniverseSelectionModel\")]\n        [TestCase(\"from QuantConnect.Algorithm.Framework.Selection import *\", \"QuantConnect.Algorithm.Framework.Selection.ETFConstituentsUniverseSelectionModel\")]\n        public void TestPythonAndCSharpImports(string importStatement, string expected)\n        {\n            using (Py.GIL())\n            {\n                dynamic module = PyModule.FromString(\"testModule\",\n                    @$\"{importStatement}\nclass ETFConstituentsFrameworkAlgorithm(QCAlgorithm):\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.DAILY\n        symbol = Symbol.create('SPY', SecurityType.EQUITY, Market.USA)\n        selection_model = ETFConstituentsUniverseSelectionModel(symbol, self.universe_settings, self.etf_constituents_filter)\n        self.universe_type = str(type(selection_model))\n\n    def etf_constituents_filter(self, constituents):\n        return [c.symbol for c in constituents]\");\n\n                dynamic algorithm = module.GetAttr(\"ETFConstituentsFrameworkAlgorithm\").Invoke();\n                algorithm.initialize();\n                string universeTypeStr = algorithm.universe_type.ToString();\n                Assert.IsTrue(universeTypeStr.Contains(expected, StringComparison.InvariantCulture));\n            }\n        }\n\n\n        [TestCase(\"'SPY'\")]\n        [TestCase(\"'SPY', None\")]\n        [TestCase(\"'SPY', None, None\")]\n        [TestCase(\"'SPY', self.universe_settings\")]\n        [TestCase(\"'SPY', self.universe_settings, None\")]\n        [TestCase(\"'SPY', None, self.etf_constituents_filter\")]\n        [TestCase(\"'SPY', self.universe_settings, self.etf_constituents_filter\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA)\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), None, None\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), self.universe_settings\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), self.universe_settings, None\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), None, self.etf_constituents_filter\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), self.universe_settings, self.etf_constituents_filter\")]\n        [TestCase(\"Symbol.create('SPY', SecurityType.EQUITY, Market.USA), universe_filter_func=self.etf_constituents_filter\")]\n        public void ETFConstituentsUniverseSelectionModelWithVariousConstructor(string constructorParameters)\n        {\n            using (Py.GIL())\n            {\n                dynamic module = PyModule.FromString(\"testModule\",\n                    @$\"from AlgorithmImports import *\nfrom Selection.ETFConstituentsUniverseSelectionModel import *\nclass ETFConstituentsFrameworkAlgorithm(QCAlgorithm):\n    selection_model = None\n    def initialize(self):\n        self.universe_settings.resolution = Resolution.DAILY\n        self.selection_model = ETFConstituentsUniverseSelectionModel({constructorParameters})\n\n    def etf_constituents_filter(self, constituents):\n        return [c.symbol for c in constituents]\");\n\n                dynamic algorithm = module.GetAttr(\"ETFConstituentsFrameworkAlgorithm\").Invoke();\n                algorithm.initialize();\n                Assert.IsNotNull(algorithm.selection_model);\n                Assert.IsTrue(algorithm.selection_model.etf_symbol.GetPythonType().ToString().Contains($\"{nameof(Symbol)}\", StringComparison.InvariantCulture));\n                Assert.IsTrue(algorithm.selection_model.etf_symbol.ToString().Contains(Symbols.SPY, StringComparison.InvariantCulture));\n            }\n        }\n\n        [TestCase(\"TSLA\")]\n        public void ETFConstituentsUniverseSelectionModelGetNoCachedSymbol(string ticker)\n        {\n            using (Py.GIL())\n            {\n                var etfAlgorithm = GetETFConstituentsFrameworkAlgorithm(ticker);\n                etfAlgorithm.initialize();\n\n                Assert.IsNotNull(etfAlgorithm.selection_model);\n                Assert.IsTrue(etfAlgorithm.selection_model.etf_symbol.GetPythonType().ToString().Contains($\"{nameof(Symbol)}\", StringComparison.InvariantCulture));\n\n                var etfSymbol = (Symbol)etfAlgorithm.selection_model.etf_symbol;\n\n                Assert.IsTrue(etfSymbol.Value.Contains(ticker, StringComparison.InvariantCulture));\n                Assert.IsTrue(etfSymbol.SecurityType == SecurityType.Equity);\n            }\n        }\n\n        [TestCase(\"SPY\", \"CACHED\")]\n        public void ETFConstituentsUniverseSelectionModelGetCachedSymbol(string ticker, string expectedAlias)\n        {\n            using (Py.GIL())\n            {\n                var etfAlgorithm = GetETFConstituentsFrameworkAlgorithm(ticker);\n                etfAlgorithm.initialize();\n\n                Assert.IsNotNull(etfAlgorithm.selection_model);\n                Assert.IsTrue(etfAlgorithm.selection_model.etf_symbol.GetPythonType().ToString().Contains($\"{nameof(Symbol)}\", StringComparison.InvariantCulture));\n\n                var etfSymbol = (Symbol)etfAlgorithm.selection_model.etf_symbol;\n\n                Assert.IsTrue(etfSymbol.Value.Contains(expectedAlias, StringComparison.InvariantCulture));\n                Assert.IsTrue(etfSymbol.ID == Symbols.SPY.ID);\n                Assert.IsTrue(etfSymbol.SecurityType == SecurityType.Equity);\n            }\n        }\n\n\n        [Test]\n        public void ETFConstituentsUniverseSelectionModelTestAllConstructor()\n        {\n            int numberOfOperation = 0;\n            var ticker = \"SPY\";\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            var universeSettings = new UniverseSettings(Resolution.Minute, Security.NullLeverage, true, false, TimeSpan.FromDays(1));\n\n            do\n            {\n                ETFConstituentsUniverseSelectionModel etfConstituents = numberOfOperation switch\n                {\n                    0 => new ETFConstituentsUniverseSelectionModel(ticker),\n                    1 => new ETFConstituentsUniverseSelectionModel(ticker, universeSettings),\n                    2 => new ETFConstituentsUniverseSelectionModel(ticker, ETFConstituentsFilter),\n                    3 => new ETFConstituentsUniverseSelectionModel(ticker, universeSettings, ETFConstituentsFilter),\n                    4 => new ETFConstituentsUniverseSelectionModel(ticker, universeSettings, default(PyObject)),\n                    5 => new ETFConstituentsUniverseSelectionModel(symbol),\n                    6 => new ETFConstituentsUniverseSelectionModel(symbol, universeSettings),\n                    7 => new ETFConstituentsUniverseSelectionModel(symbol, ETFConstituentsFilter),\n                    8 => new ETFConstituentsUniverseSelectionModel(symbol, universeSettings, ETFConstituentsFilter),\n                    9 => new ETFConstituentsUniverseSelectionModel(symbol, universeSettings, default(PyObject)),\n                    _ => throw new ArgumentException(\"Not recognize number of operation\")\n                };\n\n                var universe = etfConstituents.CreateUniverses(new QCAlgorithm()).First();\n\n                Assert.IsNotNull(etfConstituents);\n                Assert.IsNotNull(universe);\n\n                Assert.IsTrue(universe.Configuration.Symbol.HasUnderlying);\n                Assert.AreEqual(symbol, universe.Configuration.Symbol.Underlying);\n\n                Assert.AreEqual(symbol.SecurityType, universe.Configuration.Symbol.SecurityType);\n                Assert.IsTrue(universe.Configuration.Symbol.ID.Symbol.StartsWithInvariant(\"qc-universe-\"));\n                var data = new Mock<BaseDataCollection>();\n                Assert.DoesNotThrow(() => universe.PerformSelection(DateTime.UtcNow, data.Object));\n\n            } while (++numberOfOperation <= 9) ;\n        }\n\n        private IEnumerable<Symbol> ETFConstituentsFilter(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            return constituents.Select(c => c.Symbol);\n        }\n\n        private static dynamic GetETFConstituentsFrameworkAlgorithm(string etfTicker, string cachedAlias = \"CACHED\")\n        {\n\n            dynamic module = PyModule.FromString(\"testModule\",\n@$\"from AlgorithmImports import *\nfrom Selection.ETFConstituentsUniverseSelectionModel import *\nclass ETFConstituentsFrameworkAlgorithm(QCAlgorithm):\n    selection_model = None\n    def initialize(self):\n        SymbolCache.set('SPY', Symbol.create('SPY', SecurityType.EQUITY, Market.USA, '{cachedAlias}'))\n        self.universe_settings.resolution = Resolution.DAILY\n        self.selection_model = ETFConstituentsUniverseSelectionModel(\"\"{etfTicker}\"\")\"\n);\n\n            dynamic algorithm = module.GetAttr(\"ETFConstituentsFrameworkAlgorithm\").Invoke();\n            return algorithm;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Selection/ManualUniverseSelectionModelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Selection\n{\n    [TestFixture]\n    public class ManualUniverseSelectionModelTests\n    {\n        [Test]\n        public void ExcludesCanonicalSymbols()\n        {\n            var symbols = new[]\n            {\n                Symbols.SPY,\n                Symbol.CreateOption(Symbols.SPY, Market.USA, default(OptionStyle), default(OptionRight), 0m, SecurityIdentifier.DefaultDate, \"?SPY\")\n            };\n\n            var model = new ManualUniverseSelectionModel(symbols);\n            var universe = model.CreateUniverses(new QCAlgorithm()).Single();\n            var selectedSymbols = universe.SelectSymbols(default(DateTime), null).ToList();\n\n            Assert.AreEqual(1, selectedSymbols.Count);\n            Assert.AreEqual(Symbols.SPY, selectedSymbols[0]);\n            Assert.IsFalse(selectedSymbols.Any(s => s.IsCanonical()));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Selection/OpenInterestFutureUniverseSelectionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Selection\n{\n    [TestFixture]\n    public class OpenInterestFutureUniverseSelectionModelTests\n    {\n        private static readonly Symbol Jan = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 01, 01));\n        private static readonly Symbol Feb = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 02, 01));\n        private static readonly Symbol March = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 03, 01));\n        private static readonly Symbol April = Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 04, 01));\n        private static readonly DateTime TestDate = new DateTime(2020, 05, 11, 0, 0, 0, DateTimeKind.Utc);\n        private static readonly DateTime ExpectedPreviousDate = new DateTime(2020, 05, 09, 20, 0, 0, DateTimeKind.Utc);\n        private static readonly IReadOnlyDictionary<Symbol, decimal> OpenInterestData = new Dictionary<Symbol, decimal>\n        {\n            [Jan] = 3,\n            [Feb] = 6,\n            [March] = 3, // Same as Jan.\n            [April] = 1\n        };\n        private static readonly MarketHoursDatabase.Entry MarketHours = MarketHoursDatabase.FromDataFolder().GetEntry(Jan.ID.Market, Jan, Jan.SecurityType);\n        private Mock<IHistoryProvider> _mockHistoryProvider;\n        private OpenInterestFutureUniverseSelectionModel _underTest;\n\n        [Test]\n        public void No_Open_Interest_Returns_Empty()\n        {\n            SetupSubject(OpenInterestData.Count, OpenInterestData.Count);\n            _mockHistoryProvider.Setup(x => x.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns<IEnumerable<HistoryRequest>, DateTimeZone>((r, tz) => new Slice[0])\n                .Verifiable();\n\n            var data = OpenInterestData.Keys.ToDictionary(x => x, x => MarketHours);\n            var results = _underTest.FilterByOpenInterest(data).ToList();\n            _mockHistoryProvider.Verify();\n            Assert.IsEmpty(results);\n        }\n\n        [Test]\n        public void Can_Sort_By_Open_Interest()\n        {\n            SetupSubject(OpenInterestData.Count, OpenInterestData.Count);\n            _mockHistoryProvider.Setup(x => x.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns<IEnumerable<HistoryRequest>, DateTimeZone>(\n                    (r, tz) =>\n                    {\n                        var requests = r.ToList();\n                        Assert.AreEqual(4, requests.Count);\n                        var slices = new List<Slice>(requests.Count);\n                        foreach (var request in requests)\n                        {\n                            Assert.NotNull(request.Symbol);\n                            Assert.AreEqual(typeof(Tick), request.DataType);\n                            Assert.AreEqual(DataNormalizationMode.Raw, request.DataNormalizationMode);\n                            Assert.AreEqual(ExpectedPreviousDate, request.StartTimeUtc);\n                            Assert.AreEqual(TestDate, request.EndTimeUtc);\n                            Assert.AreEqual(Resolution.Tick, request.Resolution);\n                            Assert.AreEqual(TickType.OpenInterest, request.TickType);\n                            Assert.AreEqual(tz, MarketHours.ExchangeHours.TimeZone);\n                            slices.Add(CreateReplySlice(request.Symbol, OpenInterestData[request.Symbol]));\n                        }\n\n                        return slices;\n                    }\n                )\n                .Verifiable();\n\n            var data = OpenInterestData.Keys.ToDictionary(x => x, x => MarketHours);\n            var results = _underTest.FilterByOpenInterest(data).ToList();\n\n            // Results should be sorted by open interest (descending), and then by the date.\n            _mockHistoryProvider.Verify();\n            Assert.AreEqual(4, results.Count);\n            Assert.AreEqual(Feb, results[0]);\n            Assert.AreEqual(Jan, results[1]);\n            Assert.AreEqual(March, results[2]);\n            Assert.AreEqual(April, results[3]);\n        }\n\n        [Test]\n        public void Can_Limit_Number_Of_Contracts()\n        {\n            SetupSubject(6, 4);\n            var expected = Enumerable.Range(1, 4).Select(d => Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 01, d))).ToList();\n\n            // Create 7 requests.  Reverse the list so the order isn't correct, but remains consistent for tests.\n            var data = expected.Concat(Enumerable.Range(5, 3).Select(d => Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, new DateTime(2020, 01, d))))\n                .Reverse()\n                .ToDictionary(x => x, _ => MarketHours);\n\n            // 7 input requests, but the look-up should be limited to only 6.\n            _mockHistoryProvider.Setup(x => x.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns<IEnumerable<HistoryRequest>, DateTimeZone>((rq, tz) => rq.Select(r => CreateReplySlice(r.Symbol, 1)).ToArray());\n\n            // Run the test.\n            var results = _underTest.FilterByOpenInterest(data).ToList();\n\n            // Verify the chain limit was applied.\n            _mockHistoryProvider.Verify(x => x.GetHistory(It.Is<IEnumerable<HistoryRequest>>(r => r.Count() == 6), MarketHours.ExchangeHours.TimeZone), Times.Once);\n\n            // Verify the results.\n            CollectionAssert.AreEqual(expected, results);\n        }\n\n        [Test]\n        public void Limits_Do_Not_Need_To_Be_Provided()\n        {\n            SetupSubject(null, null);\n            var startDate = new DateTime(2020, 01, 01);\n            var items = Enumerable.Range(0, 100).ToDictionary(d => Symbol.CreateFuture(Futures.Metals.Gold, Market.COMEX, startDate.AddDays(d)), _ => MarketHours);\n            _mockHistoryProvider.Setup(x => x.GetHistory(It.IsAny<IEnumerable<HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns<IEnumerable<HistoryRequest>, DateTimeZone>((rq, tz) => rq.Select(r => CreateReplySlice(r.Symbol, 1)).ToArray());\n            var results = _underTest.FilterByOpenInterest(items).ToList();\n            _mockHistoryProvider.Verify(x => x.GetHistory(It.Is<IEnumerable<HistoryRequest>>(r => r.Count() == 100), MarketHours.ExchangeHours.TimeZone), Times.Once);\n            Assert.AreEqual(items.Keys, results);\n        }\n\n        private static Slice CreateReplySlice(Symbol symbol, decimal openInterest)\n        {\n            var ticks = new Ticks {{symbol, new List<Tick> {new OpenInterest(TestDate, symbol, openInterest)}}};\n            return new Slice(TestDate, null, null, null, ticks, null, null, null, null, null, null, null, TestDate, true);\n        }\n\n        private void SetupSubject(int? testChainContractLookupLimit, int? testResultsLimit)\n        {\n            _mockHistoryProvider = new Mock<IHistoryProvider>();\n\n            var mockAlgorithm = new Mock<IAlgorithm>();\n            mockAlgorithm.SetupGet(x => x.HistoryProvider).Returns(_mockHistoryProvider.Object);\n            mockAlgorithm.SetupGet(x => x.UtcTime).Returns(TestDate);\n            _underTest = new OpenInterestFutureUniverseSelectionModel(mockAlgorithm.Object, _ => OpenInterestData.Keys, testChainContractLookupLimit, testResultsLimit);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/Framework/Selection/QC500UniverseSelectionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.Data.UniverseSelection.CoarseFundamentalDataProvider;\n\nnamespace QuantConnect.Tests.Algorithm.Framework.Selection\n{\n    [TestFixture]\n    public class QC500UniverseSelectionModelTests\n    {\n        private readonly Dictionary<char, string> _industryTemplateCodeDict =\n            new Dictionary<char, string>\n            {\n                {'0', \"B\"}, {'1', \"I\"}, {'2', \"M\"}, {'3', \"N\"}, {'4', \"T\"}, {'5', \"U\"}\n            };\n\n        private readonly List<Symbol> _symbols = Enumerable.Range(0, 6000)\n            .Select(x => Symbol.Create($\"{x:0000}\", SecurityType.Equity, Market.USA))\n            .ToList();\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void FiltersUniverseCorrectlyWithValidData(Language language)\n        {\n            QCAlgorithm algorithm;\n            Dictionary<DateTime, int> coarseCountByDateTime;\n            Dictionary<DateTime, int> fineCountByDateTime;\n\n            RunSimulation(language,\n                (symbol, time) => new CoarseFundamentalSource\n                {\n                    Symbol = symbol,\n                    EndTime = time,\n                    Value = 100,\n                    VolumeSetter = 1000,\n                    DollarVolumeSetter = 100000 * double.Parse(symbol.Value.Substring(3)),\n                    HasFundamentalDataSetter = true\n                },\n                (symbol, time) => new FineFundamental(time, symbol)\n                {\n                    Value = 100\n                },\n                new TestFundamentalDataProvider(_industryTemplateCodeDict),\n                out algorithm,\n                out coarseCountByDateTime,\n                out fineCountByDateTime);\n\n            var months = (algorithm.EndDate - algorithm.StartDate).Days / 30;\n            // Universe Changed 4 times\n            Assert.AreEqual(months, coarseCountByDateTime.Count);\n            Assert.AreEqual(months, fineCountByDateTime.Count);\n            // Universe Changed on the 1st. Coarse returned 1000 and Fine 500\n            Assert.IsTrue(coarseCountByDateTime.All(kvp => kvp.Key.Day == 1 && kvp.Value == 1000));\n            Assert.IsTrue(fineCountByDateTime.All(kvp => kvp.Key.Day == 1 && kvp.Value == 500));\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotFilterUniverseWithCoarseDataHasFundamentalFalse(Language language)\n        {\n            QCAlgorithm algorithm;\n            Dictionary<DateTime, int> coarseCountByDateTime;\n            Dictionary<DateTime, int> fineCountByDateTime;\n\n            RunSimulation(language,\n                (symbol, time) => new CoarseFundamentalSource\n                {\n                    Symbol = symbol,\n                    EndTime = time,\n                },\n                (symbol, time) => new FineFundamental(time, symbol),\n                new TestFundamentalDataProvider(_industryTemplateCodeDict),\n                out algorithm,\n                out coarseCountByDateTime,\n                out fineCountByDateTime); ;\n\n            // No Universe Changes\n            Assert.AreEqual(0, coarseCountByDateTime.Count);\n            Assert.AreEqual(0, fineCountByDateTime.Count);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotFilterUniverseWithInvalidFineData(Language language)\n        {\n            QCAlgorithm algorithm;\n            Dictionary<DateTime, int> coarseCountByDateTime;\n            Dictionary<DateTime, int> fineCountByDateTime;\n\n            RunSimulation(language,\n                (symbol, time) => new CoarseFundamentalSource\n                {\n                    Symbol = symbol,\n                    EndTime = time,\n                    Value = 100,\n                    VolumeSetter = 1000,\n                    DollarVolumeSetter = 100000 * double.Parse(symbol.Value.Substring(3)),\n                    HasFundamentalDataSetter = true\n                },\n                (symbol, time) => new FineFundamental(time, symbol)\n                {\n                    Value = 100\n                },\n                new NullFundamentalDataProvider(),\n                out algorithm,\n                out coarseCountByDateTime,\n                out fineCountByDateTime);\n\n            // Coarse Fundamental called every day.\n            Assert.Greater(coarseCountByDateTime.Count, 4);\n            Assert.IsTrue(coarseCountByDateTime.All(kvp => kvp.Value == 1000));\n            // No Universe Changes\n            Assert.AreEqual(0, fineCountByDateTime.Count);\n        }\n\n        private void RunSimulation(Language language,\n            Func<Symbol, DateTime, CoarseFundamental> getCoarseFundamental,\n            Func<Symbol, DateTime, FineFundamental> getFineFundamental,\n            IFundamentalDataProvider fundamentalDataProvider,\n            out QCAlgorithm algorithm,\n            out Dictionary<DateTime, int> coarseCountByDateTime,\n            out Dictionary<DateTime, int> fineCountByDateTime)\n        {\n            algorithm = new QCAlgorithm();\n            algorithm.SetStartDate(2019, 10, 1);\n            algorithm.SetEndDate(2020, 1, 30);\n            algorithm.SetDateTime(algorithm.StartDate.AddHours(6));\n\n            FundamentalService.Initialize(TestGlobals.DataProvider, fundamentalDataProvider, false);\n\n            coarseCountByDateTime = new Dictionary<DateTime, int>();\n            fineCountByDateTime = new Dictionary<DateTime, int>();\n\n            Func<QCAlgorithm, IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> SelectCoarse;\n            Func<QCAlgorithm, IEnumerable<FineFundamental>, IEnumerable<Symbol>> SelectFine;\n            GetUniverseSelectionModel(language, out SelectCoarse, out SelectFine);\n\n            while (algorithm.EndDate > algorithm.UtcTime)\n            {\n                var time = algorithm.UtcTime;\n\n                var coarse = _symbols.Select(x => getCoarseFundamental(x, time));\n\n                var selectSymbolsResult = SelectCoarse(algorithm, coarse);\n\n                if (!ReferenceEquals(selectSymbolsResult, Universe.Unchanged))\n                {\n                    coarseCountByDateTime[time] = selectSymbolsResult.Count();\n\n                    var fine = selectSymbolsResult.Select(x => getFineFundamental(x, time));\n\n                    selectSymbolsResult = SelectFine(algorithm, fine);\n                    if (!ReferenceEquals(selectSymbolsResult, Universe.Unchanged))\n                    {\n                        fineCountByDateTime[time] = selectSymbolsResult.Count();\n                    }\n                }\n\n                algorithm.SetDateTime(time.AddDays(1));\n            }\n        }\n\n        private void GetUniverseSelectionModel(\n            Language language,\n            out Func<QCAlgorithm, IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> SelectCoarse,\n            out Func<QCAlgorithm, IEnumerable<FineFundamental>, IEnumerable<Symbol>> SelectFine)\n        {\n            if (language == Language.CSharp)\n            {\n                var model = new QC500UniverseSelectionModel();\n                SelectCoarse = model.SelectCoarse;\n                SelectFine = model.SelectFine;\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                var name = \"QC500UniverseSelectionModel\";\n                dynamic model = Py.Import(name).GetAttr(name).Invoke();\n                SelectCoarse = ConvertToUniverseSelectionSymbolDelegate<IEnumerable<CoarseFundamental>>(model.select_coarse);\n                SelectFine = ConvertToUniverseSelectionSymbolDelegate<IEnumerable<FineFundamental>>(model.select_fine);\n            }\n        }\n\n        public static Func<QCAlgorithm, T, IEnumerable<Symbol>> ConvertToUniverseSelectionSymbolDelegate<T>(PyObject pySelector)\n        {\n            Func<QCAlgorithm, T, object> selector;\n            pySelector.TrySafeAs(out selector);\n\n            return (algorithm, data) =>\n            {\n                var result = selector(algorithm, data);\n                return ReferenceEquals(result, Universe.Unchanged)\n                    ? Universe.Unchanged\n                    : ((object[])result).Select(x => (Symbol)x);\n            };\n        }\n\n        private class TestFundamentalDataProvider : IFundamentalDataProvider\n        {\n            private readonly Dictionary<char, string> _industryTemplateCodeDict;\n\n            public TestFundamentalDataProvider(Dictionary<char, string> industryTemplateCodeDict)\n            {\n                _industryTemplateCodeDict = industryTemplateCodeDict;\n            }\n            public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n            {\n                if (securityIdentifier == SecurityIdentifier.Empty)\n                {\n                    return default;\n                }\n                return Get(time, securityIdentifier, name);\n            }\n\n            private dynamic Get(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty enumName)\n            {\n                var name = Enum.GetName(enumName);\n                switch (name)\n                {\n                    case \"CompanyProfile_MarketCap\":\n                        return 500000001;\n                    case \"SecurityReference_IPODate\":\n                        return time.AddDays(-200);\n                    case \"EarningReports_BasicAverageShares_ThreeMonths\":\n                        return 5000000.01d;\n                    case \"CompanyReference_CountryId\":\n                        return \"USA\";\n                    case \"CompanyReference_PrimaryExchangeID\":\n                        return \"NYS\";\n                    case \"CompanyReference_IndustryTemplateCode\":\n                        return _industryTemplateCodeDict[securityIdentifier.Symbol[0]];\n                }\n                return null;\n            }\n\n            public void Initialize(IDataProvider dataProvider, bool liveMode)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Algorithm/UniverseDefinitionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Algorithm\n{\n    [TestFixture]\n    public class UniverseDefinitionsTests\n    {\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void ETFOverloadsAreAllUsable(Language language)\n        {\n            var algorithm = new QCAlgorithm();\n            var universeDefinitions = algorithm.Universe;\n            var universeSettings = new UniverseSettings(Resolution.Minute, Security.NullLeverage, true, false, TimeSpan.FromDays(1));\n\n            List<Universe> etfs = null;\n\n            if (language == Language.CSharp)\n            {\n                etfs = new()\n                {\n                    universeDefinitions.ETF(\"SPY\"),\n                    universeDefinitions.ETF(\"SPY\", Market.USA),\n                    universeDefinitions.ETF(\"SPY\", Market.USA, universeSettings),\n                    universeDefinitions.ETF(\"SPY\", Market.USA, universeSettings, Filter),\n                    universeDefinitions.ETF(\"SPY\", Market.USA, universeFilterFunc: Filter),\n                    universeDefinitions.ETF(\"SPY\", universeSettings: universeSettings),\n                    universeDefinitions.ETF(\"SPY\", universeFilterFunc: Filter),\n                    universeDefinitions.ETF(\"SPY\", universeSettings: universeSettings, universeFilterFunc: Filter),\n                    universeDefinitions.ETF(Symbols.SPY),\n                    universeDefinitions.ETF(Symbols.SPY, universeSettings),\n                    universeDefinitions.ETF(Symbols.SPY, universeFilterFunc: Filter),\n                    universeDefinitions.ETF(Symbols.SPY, universeSettings, Filter),\n                };\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom typing import List\nfrom AlgorithmImports import *\n\ndef getETFs(algorithm: QCAlgorithm, symbol: Symbol, universeSettings: UniverseSettings) -> List[Universe]:\n    universeDefinitions = algorithm.Universe;\n    return [\n        universeDefinitions.ETF('SPY'),\n        universeDefinitions.ETF('SPY', Market.USA),\n        universeDefinitions.ETF('SPY', Market.USA, universeSettings),\n        universeDefinitions.ETF('SPY', Market.USA, universeSettings, filterETFs),\n        universeDefinitions.ETF('SPY', Market.USA, universeFilterFunc=filterETFs),\n        universeDefinitions.ETF('SPY', universeSettings, filterETFs),\n        universeDefinitions.ETF('SPY', universeSettings=universeSettings),\n        universeDefinitions.ETF('SPY', universeFilterFunc=filterETFs),\n        universeDefinitions.ETF('SPY', universeSettings=universeSettings, universeFilterFunc=filterETFs),\n        universeDefinitions.ETF(symbol),\n        universeDefinitions.ETF(symbol, universeSettings),\n        universeDefinitions.ETF(symbol, universeFilterFunc=filterETFs),\n        universeDefinitions.ETF(symbol, universeSettings, filterETFs),\n    ]\n\ndef filterETFs(constituents: List[ETFConstituentData]) -> List[Symbol]:\n    return [x.Symbol for x in constituents]\n        \");\n\n                    var getETFs = testModule.GetAttr(\"getETFs\");\n\n                    etfs = getETFs.Invoke(algorithm.ToPython(), Symbols.SPY.ToPython(), universeSettings.ToPython()).As<List<Universe>>();\n                }\n            }\n\n            AssertETFConstituentsUniverses(etfs);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void IndexOverloadsAreAllUsable(Language language)\n        {\n            var algorithm = new QCAlgorithm();\n            var universeDefinitions = algorithm.Universe;\n            var universeSettings = new UniverseSettings(Resolution.Minute, Security.NullLeverage, true, false, TimeSpan.FromDays(1));\n\n            List<Universe> indexes = null;\n\n            if (language == Language.CSharp)\n            {\n                indexes = new()\n                {\n                    universeDefinitions.Index(\"SPY\"),\n                    universeDefinitions.Index(\"SPY\", Market.USA),\n                    universeDefinitions.Index(\"SPY\", Market.USA, universeSettings),\n                    universeDefinitions.Index(\"SPY\", Market.USA, universeSettings, Filter),\n                    universeDefinitions.Index(\"SPY\", Market.USA, universeFilterFunc: Filter),\n                    universeDefinitions.Index(\"SPY\", universeSettings: universeSettings),\n                    universeDefinitions.Index(\"SPY\", universeFilterFunc: Filter),\n                    universeDefinitions.Index(\"SPY\", universeSettings: universeSettings, universeFilterFunc: Filter),\n                    universeDefinitions.Index(Symbols.SPY),\n                    universeDefinitions.Index(Symbols.SPY, universeSettings),\n                    universeDefinitions.Index(Symbols.SPY, universeFilterFunc: Filter),\n                    universeDefinitions.Index(Symbols.SPY, universeSettings, Filter),\n                };\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                        @\"\nfrom typing import List\nfrom AlgorithmImports import *\n\ndef getIndexes(algorithm: QCAlgorithm, symbol: Symbol, universeSettings: UniverseSettings) -> List[Universe]:\n    universeDefinitions = algorithm.Universe;\n    return [\n        universeDefinitions.Index('SPY'),\n        universeDefinitions.Index('SPY', Market.USA),\n        universeDefinitions.Index('SPY', Market.USA, universeSettings),\n        universeDefinitions.Index('SPY', Market.USA, universeSettings, filterIndexes),\n        universeDefinitions.Index('SPY', Market.USA, universeFilterFunc=filterIndexes),\n        universeDefinitions.Index('SPY', universeSettings, filterIndexes),\n        universeDefinitions.Index('SPY', universeSettings=universeSettings),\n        universeDefinitions.Index('SPY', universeFilterFunc=filterIndexes),\n        universeDefinitions.Index('SPY', universeSettings=universeSettings, universeFilterFunc=filterIndexes),\n        universeDefinitions.Index(symbol),\n        universeDefinitions.Index(symbol, universeSettings),\n        universeDefinitions.Index(symbol, universeFilterFunc=filterIndexes),\n        universeDefinitions.Index(symbol, universeSettings, filterIndexes),\n    ]\n\ndef filterIndexes(constituents: List[ETFConstituentData]) -> List[Symbol]:\n    return [x.Symbol for x in constituents]\n        \");\n\n                    var getIndexes = testModule.GetAttr(\"getIndexes\");\n\n                    indexes = getIndexes.Invoke(algorithm.ToPython(), Symbols.SPY.ToPython(), universeSettings.ToPython()).As<List<Universe>>();\n                }\n            }\n\n            AssertETFConstituentsUniverses(indexes);\n        }\n\n        private static void AssertETFConstituentsUniverses(List<Universe> universes)\n        {\n            CollectionAssert.AllItemsAreNotNull(universes, \"Universes should not be null\");\n            CollectionAssert.AllItemsAreInstancesOfType(universes, typeof(ETFConstituentsUniverseFactory),\n                \"Universes should be of type ETFConstituentsUniverse\");\n        }\n\n        private static IEnumerable<Symbol> Filter(IEnumerable<ETFConstituentUniverse> constituents)\n        {\n            return constituents.Select(x => x.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/AlgorithmFactory/LoaderTests.cs",
    "content": "﻿/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.AlgorithmFactory;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.AlgorithmFactory\n{\n    [TestFixture]\n    public class LoaderTests\n    {\n        private WorkerThread _workerThread;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _workerThread = new TestWorkerThread();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _workerThread.Dispose();\n        }\n\n        [Test]\n        public void LoadsSamePythonAlgorithmTwice()\n        {\n            var assemblyPath = \"../../../Algorithm.Python/BasicTemplateAlgorithm.py\";\n\n            string error1;\n            IAlgorithm algorithm1;\n            var one = new Loader(false, Language.Python, TimeSpan.FromMinutes(1), names => names.SingleOrDefault(), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath, 5120, out algorithm1, out error1);\n\n            string error2;\n            IAlgorithm algorithm2;\n            var two = new Loader(false, Language.Python, TimeSpan.FromMinutes(1), names => names.SingleOrDefault(), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath, 5120, out algorithm2, out error2);\n\n            Assert.AreNotEqual(algorithm1.ToString(), algorithm2.ToString());\n        }\n\n        [Test]\n        public void LoadsTwoDifferentPythonAlgorithm()\n        {\n            var assemblyPath1 = \"../../../Algorithm.Python/BasicTemplateAlgorithm.py\";\n            var assemblyPath2 = \"../../../Algorithm.Python/AddRemoveSecurityRegressionAlgorithm.py\";\n\n            string error1;\n            IAlgorithm algorithm1;\n            var one = new Loader(false, Language.Python, TimeSpan.FromMinutes(1), names => names.SingleOrDefault(), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath1, 5120, out algorithm1, out error1);\n\n            string error2;\n            IAlgorithm algorithm2;\n            var two = new Loader(false, Language.Python, TimeSpan.FromMinutes(1), names => names.SingleOrDefault(), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath2, 5120, out algorithm2, out error2);\n\n            Assert.AreNotEqual(algorithm1.ToString(), algorithm2.ToString());\n        }\n\n        [Test]\n        [TestCase(\"BasicTemplateAlgorithm\")]\n        [TestCase(\"QuantConnect.Algorithm.CSharp.BasicTemplateAlgorithm\")]\n        public void LoadsAlgorithm_UsingSingleOrAlgorithmTypeName_ExtensionMethod(string algorithmName)\n        {\n            var assemblyPath1 = \"QuantConnect.Algorithm.CSharp.dll\";\n\n            string error1;\n            IAlgorithm algorithm1;\n            var one = new Loader(false, Language.CSharp, TimeSpan.FromMinutes(1), names => names.SingleOrAlgorithmTypeName(algorithmName), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath1, 5120, out algorithm1, out error1);\n\n            Assert.IsTrue(one);\n        }\n\n        [Test]\n        public void LoadsSepereateAlgorithm_UsingSingleOrAlgorithmTypeName_ExtensionMethod()\n        {\n            var assemblyPath = \"QuantConnect.Algorithm.CSharp.dll\";\n\n            string error1;\n            IAlgorithm algorithm1;\n            var one = new Loader(false, Language.CSharp, TimeSpan.FromMinutes(1), names => names.SingleOrAlgorithmTypeName(\"BasicTemplateAlgorithm\"), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath, 5120, out algorithm1, out error1);\n\n            string error2;\n            IAlgorithm algorithm2;\n            var two = new Loader(false, Language.CSharp, TimeSpan.FromMinutes(1), names => names.SingleOrAlgorithmTypeName(\"BasicTemplateForexAlgorithm\"), _workerThread)\n                .TryCreateAlgorithmInstanceWithIsolator(assemblyPath, 5120, out algorithm2, out error2);\n\n            Assert.IsTrue(one);\n            Assert.IsTrue(two);\n            Assert.AreNotEqual(algorithm1.ToString(), algorithm2.ToString());\n        }\n\n        private class TestWorkerThread : WorkerThread\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "Tests/AlgorithmRunner.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.Storage;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Provides methods for running an algorithm and testing it's performance metrics\n    /// </summary>\n    public static class AlgorithmRunner\n    {\n        public static AlgorithmRunnerResults RunLocalBacktest(\n            string algorithm,\n            Dictionary<string, string> expectedStatistics,\n            Language language,\n            AlgorithmStatus expectedFinalStatus,\n            DateTime? startDate = null,\n            DateTime? endDate = null,\n            string setupHandler = \"RegressionSetupHandlerWrapper\",\n            decimal? initialCash = null,\n            string algorithmLocation = null,\n            bool returnLogs = false,\n            Dictionary<string, string> customConfigurations = null)\n        {\n            AlgorithmManager algorithmManager = null;\n            var statistics = new Dictionary<string, string>();\n            BacktestingResultHandler results = null;\n\n            Composer.Instance.Reset();\n            SymbolCache.Clear();\n            TextSubscriptionDataSourceReader.ClearCache();\n            MarketOnCloseOrder.SubmissionTimeBuffer = MarketOnCloseOrder.DefaultSubmissionTimeBuffer;\n\n            // clean up object storage\n            var objectStorePath = LocalObjectStore.DefaultObjectStore;\n            if (Directory.Exists(objectStorePath))\n            {\n                Directory.Delete(objectStorePath, true);\n            }\n\n            var ordersLogFile = string.Empty;\n            var logFile = $\"./regression/{algorithm}.{language.ToLower()}.log\";\n            Directory.CreateDirectory(Path.GetDirectoryName(logFile));\n            File.Delete(logFile);\n            var logs = new List<string>();\n\n            var reducedDiskSize = TestContext.Parameters.Exists(\"reduced-disk-size\") &&\n                bool.Parse(TestContext.Parameters[\"reduced-disk-size\"]);\n\n            try\n            {\n                Config.Set(\"algorithm-type-name\", algorithm);\n                Config.Set(\"live-mode\", \"false\");\n                Config.Set(\"environment\", \"\");\n                Config.Set(\"messaging-handler\", \"QuantConnect.Tests.RegressionTestMessageHandler\");\n                Config.Set(\"job-queue-handler\", \"QuantConnect.Queues.JobQueue\");\n                Config.Set(\"setup-handler\", setupHandler);\n                Config.Set(\"history-provider\", \"RegressionHistoryProviderWrapper\");\n                Config.Set(\"api-handler\", \"QuantConnect.Api.Api\");\n                Config.Set(\"result-handler\", \"QuantConnect.Lean.Engine.Results.RegressionResultHandler\");\n                Config.Set(\"fundamental-data-provider\", \"QuantConnect.Tests.Common.Data.Fundamental.TestFundamentalDataProvider\");\n                Config.Set(\"algorithm-language\", language.ToString());\n                Config.Set(\"data-monitor\", typeof(NullDataMonitor).Name);\n                if (string.IsNullOrEmpty(algorithmLocation))\n                {\n                    Config.Set(\"algorithm-location\",\n                        language == Language.Python\n                            ? \"../../../Algorithm.Python/\" + algorithm + \".py\"\n                            : \"QuantConnect.Algorithm.\" + language + \".dll\");\n                }\n                else\n                {\n                    Config.Set(\"algorithm-location\", algorithmLocation);\n                }\n                // set the custom configuration\n                if (customConfigurations != null)\n                {\n                    foreach (var (key, value) in customConfigurations)\n                    {\n                        Config.Set(key, value);\n                    }\n                }\n\n                // Store initial log variables\n                var initialLogHandler = Log.LogHandler;\n                var initialDebugEnabled = Log.DebuggingEnabled;\n\n                var newLogHandlers = new List<ILogHandler>();\n                if (MaintainLogHandlerAttribute.LogHandler != null)\n                {\n                    newLogHandlers.Add(MaintainLogHandlerAttribute.LogHandler);\n                }\n                // Use our current test LogHandler and a FileLogHandler\n                if (!reducedDiskSize)\n                {\n                    newLogHandlers.Add(new FileLogHandler(logFile, false));\n                }\n                if (returnLogs)\n                {\n                    var storeLog = (string logMessage) => logs.Add(logMessage);\n                    newLogHandlers.Add(new FunctionalLogHandler(storeLog, storeLog, storeLog));\n                }\n\n                using (Log.LogHandler = new CompositeLogHandler(newLogHandlers.ToArray()))\n                using (var algorithmHandlers = Initializer.GetAlgorithmHandlers())\n                using (var systemHandlers = Initializer.GetSystemHandlers())\n                using (var workerThread  = new TestWorkerThread())\n                {\n                    Log.DebuggingEnabled = !reducedDiskSize;\n\n                    Log.Trace(\"\");\n                    Log.Trace(\"{0}: Running \" + algorithm + \"...\", DateTime.UtcNow);\n                    Log.Trace(\"\");\n\n                    // run the algorithm in its own thread\n                    var engine = new Lean.Engine.Engine(systemHandlers, algorithmHandlers, false);\n                    Task.Factory.StartNew(() =>\n                    {\n                        try\n                        {\n                            string algorithmPath;\n                            var job = (BacktestNodePacket)systemHandlers.JobQueue.NextJob(out algorithmPath);\n                            job.BacktestId = algorithm;\n                            job.PeriodStart = startDate;\n                            job.PeriodFinish = endDate;\n                            if (initialCash.HasValue)\n                            {\n                                job.CashAmount = new CashAmount(initialCash.Value, Currencies.USD);\n                            }\n                            algorithmManager = new AlgorithmManager(false, job);\n\n                            var regressionTestMessageHandler = systemHandlers.Notify as RegressionTestMessageHandler;\n                            if (regressionTestMessageHandler != null)\n                            {\n                                regressionTestMessageHandler.SetAlgorithmManager(algorithmManager);\n                            }\n\n                            systemHandlers.LeanManager.Initialize(systemHandlers, algorithmHandlers, job, algorithmManager);\n\n                            engine.Run(job, algorithmManager, algorithmPath, workerThread);\n                            ordersLogFile = ((RegressionResultHandler)algorithmHandlers.Results).LogFilePath;\n                        }\n                        catch (Exception e)\n                        {\n                            Log.Trace($\"Error in AlgorithmRunner task: {e}\");\n                        }\n                    }).Wait();\n\n                    var regressionResultHandler = (RegressionResultHandler)algorithmHandlers.Results;\n                    results = regressionResultHandler;\n                    statistics = regressionResultHandler.FinalStatistics;\n\n                    if (expectedFinalStatus == AlgorithmStatus.Completed && regressionResultHandler.HasRuntimeError)\n                    {\n                        Assert.Fail($\"There was a runtime error running the algorithm\");\n                    }\n                }\n\n                // Reset settings to initial values\n                Log.LogHandler = initialLogHandler;\n                Log.DebuggingEnabled = initialDebugEnabled;\n            }\n            catch (Exception ex)\n            {\n                if (expectedFinalStatus != AlgorithmStatus.RuntimeError)\n                {\n                    Log.Error(\"{0} {1}\", ex.Message, ex.StackTrace);\n                }\n            }\n\n            AssertAlgorithmState(expectedFinalStatus, algorithmManager?.State, expectedStatistics, statistics);\n\n            if (!reducedDiskSize)\n            {\n                // we successfully passed the regression test, copy the log file so we don't have to continually\n                // re-run master in order to compare against a passing run\n                var passedFile = logFile.Replace(\"./regression/\", \"./passed/\");\n                Directory.CreateDirectory(Path.GetDirectoryName(passedFile));\n                File.Delete(passedFile);\n                File.Copy(logFile, passedFile);\n\n                var passedOrderLogFile = ordersLogFile.Replace(\"./regression/\", \"./passed/\");\n                Directory.CreateDirectory(Path.GetDirectoryName(passedFile));\n                File.Delete(passedOrderLogFile);\n                if (File.Exists(ordersLogFile)) File.Copy(ordersLogFile, passedOrderLogFile);\n\n            }\n            return new AlgorithmRunnerResults(algorithm, language, algorithmManager, results, logs);\n        }\n\n        /// <summary>\n        /// Used to intercept the algorithm instance to aid the <see cref=\"RegressionHistoryProviderWrapper\"/>\n        /// </summary>\n        public class RegressionSetupHandlerWrapper : BacktestingSetupHandler\n        {\n            public static IAlgorithm Algorithm { get; protected set; }\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = base.CreateAlgorithmInstance(algorithmNodePacket, assemblyPath);\n                var framework = Algorithm as QCAlgorithm;\n                if (framework != null)\n                {\n                    framework.DebugMode = true;\n                }\n                return Algorithm;\n            }\n        }\n\n        /// <summary>\n        /// Used to perform checks against history requests for all regression algorithms\n        /// </summary>\n        public class RegressionHistoryProviderWrapper : SubscriptionDataReaderHistoryProvider\n        {\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                requests = requests.ToList();\n                if (requests.Any(r => r.Symbol.SecurityType != SecurityType.Option && r.Symbol.SecurityType != SecurityType.IndexOption\n                        && r.Symbol.SecurityType != SecurityType.FutureOption\n                        && r.Symbol.SecurityType != SecurityType.Future && r.Symbol.IsCanonical()))\n                {\n                    throw new RegressionTestException($\"Invalid history request symbols: {string.Join(\",\", requests.Select(x => x.Symbol))}\");\n                }\n                return base.GetHistory(requests, sliceTimeZone);\n            }\n        }\n\n        public class TestWorkerThread : WorkerThread\n        {\n        }\n        public class NullDataMonitor : IDataMonitor\n        {\n            public void Dispose()\n            { }\n            public void Exit()\n            { }\n            public void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs e)\n            { }\n        }\n        public static void AssertAlgorithmState(AlgorithmStatus expectedFinalStatus, AlgorithmStatus? actualState,\n            IDictionary<string, string> expectedStatistics, IDictionary<string, string> statistics)\n        {\n            if (actualState != expectedFinalStatus)\n            {\n                Assert.Fail($\"Algorithm state should be {expectedFinalStatus} and is: {actualState}\");\n            }\n\n            foreach (var expectedStat in expectedStatistics)\n            {\n                if (statistics == null)\n                {\n                    Assert.Fail(\"Algorithm statistics are null\");\n                    break;\n                }\n\n                string result;\n                Assert.IsTrue(statistics.TryGetValue(expectedStat.Key, out result), \"Missing key: \" + expectedStat.Key);\n\n                // normalize -0 & 0, they are the same thing\n                var expected = expectedStat.Value;\n                if (expected == \"-0\")\n                {\n                    expected = \"0\";\n                }\n\n                if (result == \"-0\")\n                {\n                    result = \"0\";\n                }\n\n                Assert.AreEqual(expected, result, \"Failed on \" + expectedStat.Key);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/AlgorithmRunnerResults.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.Results;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Container class for results generated during an algorithm's execution in <see cref=\"AlgorithmRunner\"/>\n    /// </summary>\n    public class AlgorithmRunnerResults\n    {\n        /// <summary>\n        /// Algorithm name\n        /// </summary>\n        public string Algorithm { get; init; }\n\n        /// <summary>\n        /// Algorithm language (C#, Python)\n        /// </summary>\n        public Language Language { get; init; }\n\n        /// <summary>\n        /// AlgorithmManager instance that is used to run the algorithm\n        /// </summary>\n        public AlgorithmManager AlgorithmManager { get; init; }\n\n        /// <summary>\n        /// Algorithm results containing all of the sampled series\n        /// </summary>\n        public BacktestingResultHandler Results { get; init; }\n\n        /// <summary>\n        /// The logs generated during the algorithm's execution\n        /// </summary>\n        public List<string> Logs { get; init; }\n\n        public AlgorithmRunnerResults(\n            string algorithm,\n            Language language,\n            AlgorithmManager manager,\n            BacktestingResultHandler results,\n            List<string> logs)\n        {\n            Algorithm = algorithm;\n            Language = language;\n            AlgorithmManager = manager;\n            Results = results;\n            Logs = logs;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/AccountTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture]\n    public class AccountTests\n    {\n        [TestCase(\"{\\\"organizationId\\\":\\\"organizationID\\\",\\\"creditBalance\\\":111.56,\\\"card\\\":{\\\"brand\\\":\\\"visa\\\",\\\"expiration\\\":\\\"12\\\\/27\\\",\\\"last4\\\":\\\"0001\\\"},\\\"success\\\":true}\", true)]\n        [TestCase(\"{\\\"organizationId\\\":\\\"organizationID\\\",\\\"creditBalance\\\":111.56,\\\"card\\\":null,\\\"success\\\":true}\", false)]\n        public void Deserialize(string response, bool hasCard)\n        {\n            var account = JsonConvert.DeserializeObject<Account>(response);\n\n            Assert.AreEqual(\"organizationID\", account.OrganizationId);\n            Assert.AreEqual(111.56m, account.CreditBalance);\n\n            if (hasCard)\n            {\n                Assert.AreEqual(1, account.Card.LastFourDigits);\n                Assert.AreEqual(\"visa\", account.Card.Brand);\n                Assert.AreEqual(new DateTime(2027, 12, 1), account.Card.Expiration);\n            }\n            else\n            {\n                Assert.IsNull(account.Card);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/ApiTestBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing QuantConnect.Configuration;\nusing QuantConnect.Logging;\nusing System;\nusing System.Collections;\nusing System.IO;\nusing System.Text.Json;\nusing System.Threading;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// Base test class for Api tests, provides the setup needed for all api tests\n    /// </summary>\n    public class ApiTestBase\n    {\n        internal int TestAccount;\n        internal string TestToken;\n        internal string TestOrganization;\n        internal string DataFolder;\n        internal Api.Api ApiClient;\n\n        protected Project TestProject { get; private set; }\n        protected Backtest TestBacktest { get; private set; }\n\n        /// <summary>\n        /// Run once before any RestApiTests\n        /// </summary>\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            ReloadConfiguration();\n\n            TestAccount = Globals.UserId;\n            TestToken = Globals.UserToken;\n            TestOrganization = Globals.OrganizationID;\n            DataFolder = Globals.DataFolder;\n\n            ApiClient = new Api.Api();\n            ApiClient.Initialize(TestAccount, TestToken, DataFolder);\n\n            // Let's create a project and backtest that can be used for general testing\n            CreateTestProjectAndBacktest();\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            DeleteTestProjectAndBacktest();\n        }\n\n        private void CreateTestProjectAndBacktest()\n        {\n            // Create a new project and backtest that can be used for testing\n            Log.Debug(\"ApiTestBase.Setup(): Creating test project and backtest\");\n            var createProjectResult = ApiClient.CreateProject($\"TestProject{DateTime.UtcNow.ToStringInvariant(\"yyyyMMddHHmmssfff\")}\",\n                Language.CSharp, TestOrganization);\n            if (!createProjectResult.Success)\n            {\n                Assert.Warn(\"Could not create test project, tests using it will fail.\");\n                return;\n            }\n            TestProject = createProjectResult.Projects[0];\n\n            // Create a new compile for the project\n            Log.Debug(\"ApiTestBase.Setup(): Creating test compile\");\n            var compile = ApiClient.CreateCompile(TestProject.ProjectId);\n            if (!compile.Success)\n            {\n                Assert.Warn(\"Could not create compile for the test project, tests using it will fail.\");\n                return;\n            }\n            Log.Debug(\"ApiTestBase.Setup(): Waiting for test compile to complete\");\n            compile = WaitForCompilerResponse(ApiClient, TestProject.ProjectId, compile.CompileId);\n            if (!compile.Success)\n            {\n                Assert.Warn(\"Could not create compile for the test project, tests using it will fail.\");\n                return;\n            }\n\n            // Create a backtest\n            Log.Debug(\"ApiTestBase.Setup(): Creating test backtest\");\n            var backtestName = $\"{DateTime.UtcNow.ToStringInvariant(\"yyyy-MM-dd HH-mm-ss\")} API Backtest\";\n            var backtest = ApiClient.CreateBacktest(TestProject.ProjectId, compile.CompileId, backtestName);\n            if (!backtest.Success)\n            {\n                Assert.Warn(\"Could not create backtest for the test project, tests using it will fail.\");\n                return;\n            }\n            Log.Debug(\"ApiTestBase.Setup(): Waiting for test backtest to complete\");\n            TestBacktest = WaitForBacktestCompletion(ApiClient, TestProject.ProjectId, backtest.BacktestId);\n            if (!TestBacktest.Success)\n            {\n                Assert.Warn(\"Could not create backtest for the test project, tests using it will fail.\");\n                return;\n            }\n\n            Log.Debug(\"ApiTestBase.Setup(): Test project and backtest created successfully\");\n        }\n\n        private void DeleteTestProjectAndBacktest()\n        {\n            if (TestBacktest != null && TestBacktest.Success)\n            {\n                Log.Debug(\"ApiTestBase.TearDown(): Deleting test backtest\");\n                ApiClient.DeleteBacktest(TestProject.ProjectId, TestBacktest.BacktestId);\n            }\n\n            if (TestProject != null)\n            {\n                Log.Debug(\"ApiTestBase.TearDown(): Deleting test project\");\n                ApiClient.DeleteProject(TestProject.ProjectId);\n            }\n        }\n\n        public static bool IsValidJson(string jsonString)\n        {\n            try\n            {\n                using (JsonDocument doc = JsonDocument.Parse(jsonString))\n                {\n\n                }\n                return true;\n            }\n            catch (JsonException)\n            {\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Wait for the compiler to respond to a specified compile request\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project</param>\n        /// <param name=\"compileId\">Id of the compilation of the project</param>\n        /// <returns></returns>\n        public static Compile WaitForCompilerResponse(Api.Api apiClient, int projectId, string compileId, int seconds = 60)\n        {\n            var compile = new Compile();\n            var finish = DateTime.UtcNow.AddSeconds(seconds);\n            do\n            {\n                Thread.Sleep(100);\n                compile = apiClient.ReadCompile(projectId, compileId);\n            } while (compile.State == CompileState.InQueue && DateTime.UtcNow < finish);\n\n            return compile;\n        }\n\n        /// <summary>\n        /// Wait for the backtest to complete\n        /// </summary>\n        /// <param name=\"projectId\">Project id to scan</param>\n        /// <param name=\"backtestId\">Backtest id previously started</param>\n        /// <returns>Completed backtest object</returns>\n        public static Backtest WaitForBacktestCompletion(Api.Api apiClient, int projectId, string backtestId, int secondsTimeout = 60, bool returnFailedBacktest = false)\n        {\n            Backtest backtest;\n            var finish = DateTime.UtcNow.AddSeconds(secondsTimeout);\n            do\n            {\n                Thread.Sleep(1000);\n                backtest = apiClient.ReadBacktest(projectId, backtestId);\n                if (backtest == null)\n                {\n                    // api failed, let's retry\n                    continue;\n                }\n\n                if (!string.IsNullOrEmpty(backtest.Error) || backtest.HasInitializeError)\n                {\n                    if (!returnFailedBacktest)\n                    {\n                        Assert.Fail($\"Backtest {projectId}/{backtestId} failed: {backtest.Error}. Stacktrace: {backtest.Stacktrace}. Api errors: {string.Join(\",\", backtest.Errors)}\");\n                    }\n                    else\n                    {\n                        return backtest;\n                    }\n                }\n            } while (((backtest == null || (backtest.Success && backtest.Progress < 1)) && DateTime.UtcNow < finish));\n\n            return backtest;\n        }\n\n        /// <summary>\n        /// Reload configuration, making sure environment variables are loaded into the config\n        /// </summary>\n        internal static void ReloadConfiguration()\n        {\n            // nunit 3 sets the current folder to a temp folder we need it to be the test bin output folder\n            var dir = TestContext.CurrentContext.TestDirectory;\n            Environment.CurrentDirectory = dir;\n            Directory.SetCurrentDirectory(dir);\n            // reload config from current path\n            Config.Reset();\n\n            var environment = Environment.GetEnvironmentVariables();\n            foreach (DictionaryEntry entry in environment)\n            {\n                var envKey = entry.Key.ToString();\n                var value = entry.Value.ToString();\n\n                if (envKey.StartsWith(\"QC_\", StringComparison.InvariantCulture))\n                {\n                    var key = envKey.Substring(3).Replace(\"_\", \"-\", StringComparison.InvariantCulture).ToLowerInvariant();\n                    Log.Trace($\"TestSetup(): Updating config setting '{key}' from environment var '{envKey}'\");\n                    Config.Set(key, value);\n                }\n            }\n\n            // resets the version among other things\n            Globals.Reset();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/ApiTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// API Object tests\n    /// Tests APIs ability to connect to Web API\n    /// </summary>\n    [TestFixture]\n    public class ApiTest : ApiTestBase\n    {\n        /// <summary>\n        /// Test successfully authenticating with the ApiConnection using valid credentials.\n        /// </summary>\n        [Test, Explicit(\"Requires configured api access\")]\n        public void ApiConnectionWillAuthenticate_ValidCredentials_Successfully()\n        {\n            using var connection = new ApiConnection(TestAccount, TestToken);\n            Assert.IsTrue(connection.Connected);\n        }\n\n        /// <summary>\n        /// Test successfully authenticating with the API using valid credentials.\n        /// </summary>\n        [Test, Explicit(\"Requires configured api access\")]\n        public void ApiWillAuthenticate_ValidCredentials_Successfully()\n        {\n            using var api = new Api.Api();\n            api.Initialize(TestAccount, TestToken, DataFolder);\n            Assert.IsTrue(api.Connected);\n        }\n\n        /// <summary>\n        /// Test that the ApiConnection will reject invalid credentials\n        /// </summary>\n        [Test]\n        public void ApiConnectionWillAuthenticate_InvalidCredentials_Unsuccessfully()\n        {\n            using var connection = new ApiConnection(TestAccount, \"\");\n            Assert.IsFalse(connection.Connected);\n        }\n\n        /// <summary>\n        /// Test that the Api will reject invalid credentials\n        /// </summary>\n        [Test]\n        public void ApiWillAuthenticate_InvalidCredentials_Unsuccessfully()\n        {\n            using var api = new Api.Api();\n            api.Initialize(TestAccount, \"\", DataFolder);\n            Assert.IsFalse(api.Connected);\n        }\n\n        [Test]\n        public void NullDataFolder()\n        {\n            using var api = new Api.Api();\n            Assert.DoesNotThrow(() => api.Initialize(TestAccount, \"\", null));\n        }\n\n        [TestCase(\"C:\\\\Data\", \"forex/oanda/daily/eurusd.zip\")]\n        [TestCase(\"C:\\\\Data\\\\\", \"forex/oanda/daily/eurusd.zip\")]\n        [TestCase(\"C:/Data/\", \"forex/oanda/daily/eurusd.zip\")]\n        [TestCase(\"C:/Data\", \"forex/oanda/daily/eurusd.zip\")]\n        [TestCase(\"C:/Data\", \"forex\\\\oanda\\\\daily\\\\eurusd.zip\")]\n        [TestCase(\"C:/Data/\", \"forex\\\\oanda\\\\daily\\\\eurusd.zip\")]\n        [TestCase(\"C:\\\\Data\\\\\", \"forex\\\\oanda\\\\daily\\\\eurusd.zip\")]\n        [TestCase(\"C:\\\\Data\", \"forex\\\\oanda\\\\daily\\\\eurusd.zip\")]\n        public void FormattingPathForDataRequestsAreCorrect(string dataFolder, string dataToDownload)\n        {\n            var path = Path.Combine(dataFolder, dataToDownload);\n\n            var result = Api.Api.FormatPathForDataRequest(path, dataFolder);\n            Assert.AreEqual(dataToDownload.Replace(\"\\\\\", \"/\", StringComparison.InvariantCulture), result);\n        }\n\n        [TestCase(\"Authorization\", \"AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;range;x-amz-date,Signature=EXAMPLE_SIGNATURE\")]\n        [TestCase(\"Custom-Header\", \"Custom header value\")]\n        public void DownloadBytesAllowsUserDefinedHeaders(string headerKey, string headerValue)\n        {\n            using var api = new Api.Api();\n\n            var headers = new List<KeyValuePair<string, string>>() { new(headerKey, headerValue) };\n            Assert.DoesNotThrow(() => api.Download(\"https://www.dropbox.com/s/ggt6blmib54q36e/CAPE.csv?dl=1\", headers, \"\", \"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/AuthenticationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Web;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing Newtonsoft.Json.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture]\n    public class AuthenticationTests\n    {\n        [Test, Explicit(\"Requires api creds\")]\n        public void Link()\n        {\n            var link = Authentication.Link(\"authenticate\");\n\n            var response = link.DownloadData();\n\n            Assert.IsNotNull(response);\n\n            var jobject = JObject.Parse(response);\n            Assert.IsTrue(jobject[\"success\"].ToObject<bool>());\n        }\n\n        [Test]\n        public void PopulateQueryString()\n        {\n            var payload = new { SomeArray = new[] { 1, 2, 3 }, Symbol = \"SPY\", Parameters = new Dictionary<string, int>() { { \"Quantity\", 10 } } };\n\n            var queryString = HttpUtility.ParseQueryString(string.Empty);\n            Authentication.PopulateQueryString(queryString, new[] { new KeyValuePair<string, object>(\"command\", payload) });\n\n            Assert.AreEqual(\"command%5bSomeArray%5d%5b0%5d=1&command%5bSomeArray%5d%5b1%5d=2&command%5bSomeArray%5d%5b2%5d=3&command%5bSymbol%5d=SPY&command%5bParameters%5d%5bQuantity%5d=10\", queryString.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/CommandTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture, Explicit(\"Requires configured api access, a live node to run on, and brokerage configurations.\")]\n    public class CommandTests\n    {\n        private Api.Api _apiClient;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            ApiTestBase.ReloadConfiguration();\n\n            _apiClient = new Api.Api();\n            _apiClient.Initialize(Globals.UserId, Globals.UserToken, Globals.DataFolder);\n        }\n\n        [TestCase(\"MyCommand\")]\n        [TestCase(\"MyCommand2\")]\n        [TestCase(\"MyCommand3\")]\n        [TestCase(\"\")]\n        public void LiveCommand(string commandType)\n        {\n            var command = new Dictionary<string, object>\n            {\n                { \"quantity\", 0.1 },\n                { \"target\", \"BTCUSD\" },\n                { \"$type\", commandType }\n            };\n\n            var projectId = RunLiveAlgorithm();\n            try\n            {\n                // allow algo to be deployed and prices to be set so we can trade\n                Thread.Sleep(TimeSpan.FromSeconds(10));\n                var result = _apiClient.CreateLiveCommand(projectId, command);\n                Assert.IsTrue(result.Success);\n            }\n            finally\n            {\n                _apiClient.StopLiveAlgorithm(projectId);\n                _apiClient.DeleteProject(projectId);\n            }\n        }\n\n        [TestCase(\"MyCommand\")]\n        [TestCase(\"MyCommand2\")]\n        [TestCase(\"MyCommand3\")]\n        [TestCase(\"\")]\n        [TestCase(\"\", true)]\n        public void BroadcastCommand(string commandType, bool excludeProject = false)\n        {\n            var command = new Dictionary<string, object>\n            {\n                { \"quantity\", 0.1 },\n                { \"target\", \"BTCUSD\" },\n                { \"$type\", commandType }\n            };\n\n            var projectId = RunLiveAlgorithm();\n            try\n            {\n                // allow algo to be deployed and prices to be set so we can trade\n                Thread.Sleep(TimeSpan.FromSeconds(10));\n                // Our project will not receive the broadcast, unless we pass null value, but we can still use it to send a command\n                var result = _apiClient.BroadcastLiveCommand(Globals.OrganizationID, excludeProject ? projectId : null, command);\n                Assert.IsTrue(result.Success);\n            }\n            finally\n            {\n                _apiClient.StopLiveAlgorithm(projectId);\n                _apiClient.DeleteProject(projectId);\n            }\n        }\n\n        private int RunLiveAlgorithm()\n        {\n            var settings = new Dictionary<string, object>()\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n                { \"environment\", \"paper\" },\n                { \"user\", \"\" },\n                { \"password\", \"\" },\n                { \"account\", \"\" }\n            };\n\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = @\"from AlgorithmImports import *\n\nclass MyCommand():\n    quantity = 0\n    target = ''\n    def run(self, algo: QCAlgorithm) -> bool | None:\n        self.execute_order(algo)\n    def execute_order(self, algo):\n        algo.order(self.target, self.quantity)\n\nclass MyCommand2():\n    quantity = 0\n    target = ''\n    def run(self, algo: QCAlgorithm) -> bool | None:\n        algo.order(self.target, self.quantity)\n        return True\n\nclass MyCommand3():\n    quantity = 0\n    target = ''\n    def run(self, algo: QCAlgorithm) -> bool | None:\n        algo.order(self.target, self.quantity)\n        return False\n\nclass DeterminedSkyBlueGorilla(QCAlgorithm):\n    def initialize(self):\n        self.set_start_date(2023, 3, 17)\n        self.add_crypto(\"\"BTCUSD\"\", Resolution.SECOND)\n        self.add_command(MyCommand)\n        self.add_command(MyCommand2)\n        self.add_command(MyCommand3)\n\n    def on_command(self, data):\n        self.order(data.target, data.quantity)\"\n            };\n\n            // Run the live algorithm\n            return LiveTradingTests.RunLiveAlgorithm(_apiClient, settings, file, stopLiveAlgos: false, language: Language.Python);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/DataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// API Data endpoint tests\n    /// </summary>\n    [TestFixture, Explicit(\"Requires configured api access, and also makes calls to data endpoints which are charging transactions\")]\n    public class DataTests : ApiTestBase\n    {\n        private DataPricesList _pricesCache;\n        private static object[] validForexDataTestCases =\n        {\n            new object[] { \"EURUSD\", Market.Oanda, new DateTime(2013,10,07), Resolution.Daily, TickType.Quote },\n            new object[] { \"EURUSD\", Market.Oanda, new DateTime(2013,10,07), Resolution.Minute, TickType.Quote }\n        };\n\n        /// <summary>\n        /// Test downloading data\n        /// </summary>\n        [TestCase(\"forex/oanda/minute/eurusd/20131011_quote.zip\")]\n        [TestCase(\"forex/oanda/daily/eurusd.zip\")]\n        public void DataDownloadedAndSaved(string fileToDownload)\n        {\n            var path = Path.Combine(DataFolder, fileToDownload);\n\n            if (File.Exists(path))\n                File.Delete(path);\n\n            var downloadedData = ApiClient.DownloadData(path, TestOrganization);\n\n            Assert.IsTrue(downloadedData);\n            Assert.IsTrue(File.Exists(path));\n        }\n\n        /// <summary>\n        /// Test attempting to fetch invalid data links\n        /// </summary>\n        [Test]\n        public void InvalidDataLinks()\n        {\n            var fakePath = Path.Combine(DataFolder, \"forex/oanda/minute/eurusd/19891011_quote.zip\");\n            var nonExistentData = ApiClient.DownloadData(fakePath, TestOrganization);\n\n            Assert.IsFalse(nonExistentData);\n            Assert.IsFalse(File.Exists(fakePath));\n        }\n\n        /// <summary>\n        /// Test getting links to forex data for Oanda\n        /// </summary>\n        [TestCaseSource(nameof(validForexDataTestCases))]\n        public void ValidForexDataLinks(string ticker, string market, DateTime date, Resolution resolution, TickType tickType)\n        {\n            var path = LeanData.GenerateRelativeZipFilePath(\n                new Symbol(SecurityIdentifier.GenerateForex(ticker, market), ticker),\n                date, resolution, tickType);\n            var dataLink = ApiClient.ReadDataLink(path, TestOrganization);\n            var stringRepresentation = dataLink.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsTrue(dataLink.Success);\n            Assert.IsFalse(dataLink.Link.IsNullOrEmpty());\n        }\n\n        /// <summary>\n        /// Test getting price for file\n        /// </summary>\n        /// <param name=\"filePath\"></param>\n        [TestCase(\"forex/oanda/daily/eurusd.zip\")]\n        [TestCase(\"crypto/coinbase/daily/btcusd_quote.zip\")]\n        public void GetPrices(string filePath)\n        {\n            if (_pricesCache == null)\n            {\n                _pricesCache = ApiClient.ReadDataPrices(TestOrganization);\n                var stringRepresentation = _pricesCache.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            }\n\n            // Make sure we actually have these prices for the test to work\n            Assert.IsTrue(_pricesCache.Success);\n\n            // Get the price\n            int price = _pricesCache.GetPrice(filePath);\n            Assert.AreNotEqual(price, -1);\n        }\n\n        /// <summary>\n        /// Test regex implementation for DataPriceList price matching\n        /// </summary>\n        /// <param name=\"dataFile\"></param>\n        /// <param name=\"matchingRegex\"></param>\n        [TestCase(\"forex/oanda/daily/eurusd.zip\", \"/^(cfd|forex)\\\\/oanda\\\\/(daily|hour)\\\\/[^\\\\/]+.zip$/m\")]\n        [TestCase(\"forex/oanda/daily/eurusd.zip\", \"/^(cfd|forex)\\\\/oanda\\\\/(daily|hour)\\\\/[^\\\\/]+.zip$\")]\n        [TestCase(\"forex/oanda/daily/eurusd.zip\", \"^(cfd|forex)\\\\/oanda\\\\/(daily|hour)\\\\/[^\\\\/]+.zip$/\")]\n        [TestCase(\"forex/oanda/daily/eurusd.zip\", \"^(cfd|forex)\\\\/oanda\\\\/(daily|hour)\\\\/[^\\\\/]+.zip$\")]\n        public void DataPriceRegex(string dataFile, string matchingRegex)\n        {\n            var setPrice = 10;\n            var dataList = new DataPricesList\n            {\n                Prices = new List<PriceEntry>() { new PriceEntry() { Price = setPrice, RawRegEx = matchingRegex } }\n            };\n\n            int price = dataList.GetPrice(dataFile);\n            Assert.AreEqual(setPrice, price);\n        }\n\n        /// <summary>\n        /// Test getting available data listings for directories\n        /// </summary>\n        /// <param name=\"directory\"></param>\n        [TestCase(\"alternative/sec/aapl/\")]\n        [TestCase(\"cfd/oanda/daily/\")]\n        [TestCase(\"crypto/coinbase/minute/btcusd/\")]\n        [TestCase(\"equity/usa/shortable/\")]\n        [TestCase(\"forex/oanda/minute/eurusd/\")]\n        [TestCase(\"forex\\\\oanda\\\\minute\\\\eurusd\\\\\")] //Windows path case\n        [TestCase(\"future/cbot/minute/zs\")]\n        [TestCase(\"futureoption/comex/minute/og\")]\n        [TestCase(\"index/usa/minute/spx\")]\n        [TestCase(\"indexoption/usa/minute/spx\")]\n        [TestCase(\"option/usa/minute/aapl\")]\n        public void GetDataListings(string directory)\n        {\n            var dataList = ApiClient.ReadDataDirectory(directory);\n            var stringRepresentation = dataList.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(dataList.Success);\n            Assert.IsTrue(dataList.AvailableData.Count > 0);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/LiveTradingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing System.Threading;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\nusing Python.Runtime;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// API Live endpoint tests\n    /// </summary>\n    [TestFixture, Explicit(\"Requires configured api access, a live node to run on, and brokerage configurations.\")]\n    public class LiveTradingTests : ApiTestBase\n    {\n        private const bool StopLiveAlgos = true;\n        private readonly Dictionary<string, object> _defaultSettings = new()\n        {\n            { \"id\", \"QuantConnectBrokerage\" },\n            { \"environment\", \"paper\" },\n            { \"user\", \"\" },\n            { \"password\", \"\" },\n            { \"account\", \"\" }\n        };\n        private readonly ProjectFile _defaultFile = new ProjectFile\n        {\n            Name = \"Main.cs\",\n            Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\")\n        };\n\n        /// <summary>\n        /// Live paper trading via Interactive Brokers\n        /// </summary>\n        [Test]\n        public void LiveIBTest()\n        {\n            var user = Config.Get(\"ib-user-name\");\n            var password = Config.Get(\"ib-password\");\n            var account = Config.Get(\"ib-account\");\n            var environment = account.Substring(0, 2) == \"DU\" ? \"paper\" : \"live\";\n            var ib_weekly_restart_utc_time = Config.Get(\"ib-weekly-restart-utc-time\");\n\n            // Create default algorithm settings\n            var settings = new Dictionary<string, object>() {\n                { \"id\", \"InteractiveBrokersBrokerage\" },\n                { \"ib-trading-mode\", environment },\n                { \"ib-user-name\", user },\n                { \"ib-password\", password },\n                { \"ib-account\", account },\n                { \"ib-weekly-restart-utc-time\", ib_weekly_restart_utc_time},\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var quantConnectDataProvider = new Dictionary<string, object>\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"QuantConnectBrokerage\", quantConnectDataProvider },\n                { \"InteractiveBrokersBrokerage\", settings }\n            };\n\n            RunLiveAlgorithm(settings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        [Test]\n        public void PolygonTest()\n        {\n            var apiKey = Config.Get(\"polygon-api-key\");\n            var polygonDataProvider = new Dictionary<string, object>()\n            {\n                { \"id\", \"Polygon\" },\n                { \"polygon-api-key\", apiKey },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"Polygon\", polygonDataProvider },\n            };\n\n            RunLiveAlgorithm(_defaultSettings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        [Test]\n        public void BinanceTest()\n        {\n            var apiSecret = Config.Get(\"binance-api-secret\");\n            var apiKey = Config.Get(\"binance-api-key\");\n            var apiUrl = Config.Get(\"binance-api-url\");\n            var websocketUrl = Config.Get(\"binance-websocket-url\");\n            var binanceSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BinanceBrokerage\" },\n                { \"binance-use-testnet\", \"paper\" },\n                { \"binance-exchange-name\", \"Binance\" },\n                { \"binance-api-secret\", apiSecret },\n                { \"binance-api-key\", apiKey },\n                { \"binance-api-url\", apiUrl },\n                { \"binance-websocket-url\", websocketUrl },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"BinanceBrokerage\", binanceSettings },\n            };\n\n            RunLiveAlgorithm(binanceSettings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        [Test]\n        public void BinanceUSTest()\n        {\n            var apiSecret = Config.Get(\"binanceus-api-secret\");\n            var apiKey = Config.Get(\"binanceus-api-key\");\n            var apiUrl = Config.Get(\"binanceus-api-url\");\n            var websocketUrl = Config.Get(\"binanceus-websocket-url\");\n            var binanceUSSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BinanceBrokerage\" },\n                { \"binance-exchange-name\", \"BinanceUS\" },\n                { \"binanceus-api-secret\", apiSecret },\n                { \"binanceus-api-key\", apiKey },\n                { \"binanceus-api-url\", apiUrl },\n                { \"binanceus-websocket-url\", websocketUrl },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"BinanceBrokerage\", binanceUSSettings },\n            };\n\n            RunLiveAlgorithm(binanceUSSettings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        [Test]\n        public void BinanceFuturesUSDMTest()\n        {\n            var apiSecret = Config.Get(\"binance-api-secret\");\n            var apiKey = Config.Get(\"binance-api-key\");\n            var apiUrl = Config.Get(\"binance-fapi-url\");\n            var websocketUrl = Config.Get(\"binance-fwebsocket-url\");\n            var binanceSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BinanceBrokerage\" },\n                { \"binance-exchange-name\", \"Binance-USDM-Futures\" },\n                { \"binance-api-secret\", apiSecret },\n                { \"binance-api-key\", apiKey },\n                { \"binance-fapi-url\", apiUrl },\n                { \"binance-fwebsocket-url\", websocketUrl },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"BinanceBrokerage\", binanceSettings },\n            };\n\n            RunLiveAlgorithm(binanceSettings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        [Test]\n        public void BinanceFuturesCOINTest()\n        {\n            var apiSecret = Config.Get(\"binance-api-secret\");\n            var apiKey = Config.Get(\"binance-api-key\");\n            var apiUrl = Config.Get(\"binance-dapi-url\");\n            var websocketUrl = Config.Get(\"binance-dwebsocket-url\");\n            var binanceSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BinanceBrokerage\" },\n                { \"binance-exchange-name\", \"Binance-COIN-Futures\" },\n                { \"binance-api-secret\", apiSecret },\n                { \"binance-api-key\", apiKey },\n                { \"binance-dapi-url\", apiUrl },\n                { \"binance-dwebsocket-url\", websocketUrl },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"BinanceBrokerage\", binanceSettings },\n            };\n\n            RunLiveAlgorithm(binanceSettings, _defaultFile, StopLiveAlgos, dataProviders);\n        }\n\n        /// <summary>\n        /// Live paper trading via FXCM\n        /// </summary>\n        [Test]\n        public void LiveFXCMTest()\n        {\n            var user = Config.Get(\"fxcm-user-name\");\n            var password = Config.Get(\"fxcm-password\");\n            var account = Config.Get(\"fxcm-account-id\");\n\n            // Create default algorithm settings\n            var settings = new Dictionary<string, object>() {\n                { \"id\", \"FxcmBrokerage\" },\n                { \"environment\", \"paper\" },\n                { \"user\", user },\n                { \"password\", password },\n                { \"account\", account }\n            };\n\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateForexAlgorithm.cs\")\n            };\n\n            RunLiveAlgorithm(settings, file, StopLiveAlgos);\n        }\n\n        /// <summary>\n        /// Live paper trading via Oanda\n        /// </summary>\n        [Test]\n        public void LiveOandaTest()\n        {\n            var token = Config.Get(\"oanda-access-token\");\n            var account = Config.Get(\"oanda-account-id\");\n            var environment = Config.Get(\"oanda-environment\");\n\n            // Create default algorithm settings\n            var oandaSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"OandaBrokerage\" },\n                { \"oanda-access-token\", token },\n                { \"oanda-account-id\", account },\n                { \"oanda-environment\", environment }\n            };\n\n            var dataProvider = new Dictionary<string, object>\n            {\n                { \"OandaBrokerage\", oandaSettings }\n            };\n\n            RunLiveAlgorithm(_defaultSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        /// <summary>\n        /// Live paper trading via Tradier\n        /// </summary>\n        [Test]\n        public void LiveTradierTest()\n        {\n            var refreshToken = Config.Get(\"tradier-refresh-token\");\n            var account = Config.Get(\"tradier-account-id\");\n            var accessToken = Config.Get(\"tradier-access-token\");\n            var dateIssued = Config.Get(\"tradier-issued-at\");\n\n            // Create default algorithm settings\n            var tradierSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"TradierBrokerage\" },\n                { \"tradier-account-id\", account },\n                { \"tradier-access-token\", accessToken },\n                { \"tradier-environment\", \"paper\" },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                }\n            };\n\n            var dataProvider = new Dictionary<string, object>()\n            {\n                { \"TradierBrokerage\",  tradierSettings}\n            };\n\n            RunLiveAlgorithm(tradierSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        /// <summary>\n        /// Live trading via Bitfinex\n        /// </summary>\n        [Test]\n        public void LiveBitfinexTest()\n        {\n            var key = Config.Get(\"bitfinex-api-key\");\n            var secretKey = Config.Get(\"bitfinex-api-secret\");\n\n            // Create default algorithm settings\n            var bitfinexSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BitfinexBrokerage\" },\n                { \"bitfinex-api-secret\", secretKey },\n                { \"bitfinex-api-key\", key },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                },\n            };\n\n            var dataProvider = new Dictionary<string, object>()\n            {\n                { \"BitfinexBrokerage\", bitfinexSettings }\n            };\n\n            RunLiveAlgorithm(bitfinexSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        /// <summary>\n        /// Live trading via Coinbase\n        /// </summary>\n        [Test]\n        public void LiveCoinbaseTest()\n        {\n            var key = Config.Get(\"coinbase-api-key\");\n            var secretKey = Config.Get(\"coinbase-api-secret\");\n            var apiUrl = Config.Get(\"coinbase-rest-api\");\n            var wsUrl = Config.Get(\"coinbase-url\");\n\n            // Create default algorithm settings\n            var coinbaseSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"CoinbaseBrokerage\" },\n                { \"coinbase-api-key\", key },\n                { \"coinbase-api-secret\", secretKey },\n                { \"coinbase-rest-api\", apiUrl },\n                { \"coinbase-url\", wsUrl },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                }\n            };\n\n            var dataProvider = new Dictionary<string, object>\n            {\n                { \"CoinbaseBrokerage\", coinbaseSettings }\n            };\n\n            RunLiveAlgorithm(coinbaseSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        [Test]\n        public void KrakenTest()\n        {\n            var krakenSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"KrakenBrokerage\" },\n                { \"kraken-api-key\", Config.Get(\"kraken-api-key\") },\n                { \"kraken-api-secret\", Config.Get(\"kraken-api-secret\") },\n                { \"kraken-verification-tier\", Config.Get(\"kraken-verification-tier\") },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                }\n            };\n\n            var dataProvider = new Dictionary<string, object>\n            {\n                { \"KrakenBrokerage\", krakenSettings }\n            };\n\n            RunLiveAlgorithm(krakenSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        [Test]\n        public void BybitTest()\n        {\n            var bybitSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"BybitBrokerage\" },\n                { \"bybit-api-key\", Config.Get(\"bybit-api-key\") },\n                { \"bybit-api-secret\", Config.Get(\"bybit-api-secret\") },\n                { \"bybit-api-url\", Config.Get(\"bybit-api-url\") },\n                { \"bybit-websocket-url\", Config.Get(\"bybit-websocket-url\") },\n                { \"bybit-use-testnet\", \"paper\" },\n                { \"bybit-vip-level\", \"VIP0\" },\n                { \"holdings\", new List<Holding>() },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 100000}\n                        }\n                    }\n                    }\n                }\n            };\n\n            var dataProvider = new Dictionary<string, object>\n            {\n                { \"BybitBrokerage\", bybitSettings }\n            };\n\n            RunLiveAlgorithm(bybitSettings, _defaultFile, StopLiveAlgos, dataProvider);\n        }\n\n        /// <summary>\n        /// Test creating the settings object that provide the necessary parameters for each broker\n        /// </summary>\n        [Test]\n        public void LiveAlgorithmSettings_CanBeCreated_Successfully()\n        {\n            var user = \"\";\n            var password = \"\";\n            var environment = \"paper\";\n            var account = \"\";\n            var key = \"\";\n            var secretKey = \"\";\n\n            // Oanda Custom Variables\n            var accessToken = \"\";\n\n            // Tradier Custom Variables\n            var dateIssued = \"\";\n            var refreshToken = \"\";\n\n            // Create and test settings for each brokerage\n            foreach (BrokerageName brokerageName in Enum.GetValues(typeof(BrokerageName)))\n            {\n                Dictionary<string, string> settings = null;\n\n                switch (brokerageName)\n                {\n                    case BrokerageName.Default:\n                        user = Config.Get(\"default-username\");\n                        password = Config.Get(\"default-password\");\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", BrokerageName.Default.ToString() },\n                            { \"environment\", environment },\n                            { \"user\", user },\n                            { \"password\", password },\n                            { \"account\", account }\n                        };\n\n                        Assert.IsTrue(settings[\"id\"] == BrokerageName.Default.ToString());\n                        break;\n                    case BrokerageName.FxcmBrokerage:\n                        user = Config.Get(\"fxcm-user-name\");\n                        password = Config.Get(\"fxcm-password\");\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", BrokerageName.FxcmBrokerage.ToString() },\n                            { \"environment\", environment },\n                            { \"user\", user },\n                            { \"password\", password },\n                            { \"account\", account }\n                        };\n\n                        Assert.IsTrue(settings[\"id\"] == BrokerageName.FxcmBrokerage.ToString());\n                        break;\n                    case BrokerageName.InteractiveBrokersBrokerage:\n                        user = Config.Get(\"ib-user-name\");\n                        password = Config.Get(\"ib-password\");\n                        account = Config.Get(\"ib-account\");\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", BrokerageName.InteractiveBrokersBrokerage.ToString() },\n                            { \"environment\", account.Substring(0, 2) == \"DU\" ? \"paper\" : \"live\" },\n                            { \"user\", user },\n                            { \"password\", password },\n                            { \"acount\", account }\n                        };\n\n                        Assert.IsTrue(settings[\"id\"] == BrokerageName.InteractiveBrokersBrokerage.ToString());\n                        break;\n                    case BrokerageName.OandaBrokerage:\n                        accessToken = Config.Get(\"oanda-access-token\");\n                        account = Config.Get(\"oanda-account-id\");\n\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", BrokerageName.OandaBrokerage.ToStringInvariant() },\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"environment\", environment },\n                            { \"account\", account },\n                            { \"accessToken\", accessToken },\n                            { \"dateIssued\", \"1\" }\n                        };\n                        Assert.IsTrue(settings[\"id\"] == BrokerageName.OandaBrokerage.ToString());\n                        break;\n                    case BrokerageName.TradierBrokerage:\n                        dateIssued = Config.Get(\"tradier-issued-at\");\n                        refreshToken = Config.Get(\"tradier-refresh-token\");\n                        account = Config.Get(\"tradier-account-id\");\n\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", BrokerageName.TradierBrokerage.ToString() },\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"environment\", \"live\" },\n                            { \"accessToken\", accessToken },\n                            { \"dateIssued\", dateIssued },\n                            { \"refreshToken\", refreshToken },\n                            { \"lifetime\", \"86399\" },\n                            { \"account\", account }\n                        };\n                        break;\n                    case BrokerageName.Bitfinex:\n                        key = Config.Get(\"bitfinex-api-key\");\n                        secretKey = Config.Get(\"bitfinex-api-secret\");\n\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", \"BitfinexBrokerage\" },\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"environment\", \"live\" },\n                            { \"key\", key },\n                            { \"secret\", secretKey },\n                        };\n                        break;\n                    case BrokerageName.GDAX:\n                    case BrokerageName.Coinbase:\n                        key = Config.Get(\"coinbase-api-key\");\n                        secretKey = Config.Get(\"coinbase-api-secret\");\n                        var apiUrl = Config.Get(\"coinbase-rest-api\");\n                        var wsUrl = Config.Get(\"coinbase-url\");\n\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\",  \"CoinbaseBrokerage\"},\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"environment\", \"live\" },\n                            { \"key\", key },\n                            { \"secret\", secretKey },\n                            { \"apiUrl\", (new Uri(apiUrl)).AbsoluteUri },\n                            { \"wsUrl\", (new Uri(wsUrl)).AbsoluteUri }\n                        };\n                        break;\n                    case BrokerageName.AlphaStreams:\n                        // No live algorithm settings\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", \"\" },\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"account\", \"\" }\n                        };\n                        break;\n                    case BrokerageName.Binance:\n                        // No live algorithm settings\n                        settings = new Dictionary<string, string>()\n                        {\n                            { \"id\", \"\" },\n                            { \"user\", \"\" },\n                            { \"password\", \"\" },\n                            { \"account\", \"\" }\n                        };\n                        break;\n                    default:\n                        throw new Exception($\"Settings have not been implemented for this brokerage: {brokerageName}\");\n                }\n\n                // Tests common to all brokerage configuration classes\n                Assert.IsTrue(settings != null);\n                Assert.IsTrue(settings[\"password\"] == password);\n                Assert.IsTrue(settings[\"user\"] == user);\n\n                // Oanda specific settings\n                if (brokerageName == BrokerageName.OandaBrokerage)\n                {\n                    var oandaSetting = settings;\n                    Assert.IsTrue(oandaSetting[\"accessToken\"] == accessToken);\n                }\n\n                // Tradier specific settings\n                if (brokerageName == BrokerageName.TradierBrokerage)\n                {\n                    var tradierLiveAlogrithmSettings = settings;\n\n                    Assert.IsTrue(tradierLiveAlogrithmSettings[\"dateIssued\"] == dateIssued);\n                    Assert.IsTrue(tradierLiveAlogrithmSettings[\"refreshToken\"] == refreshToken);\n                    Assert.IsTrue(settings[\"environment\"] == \"life\");\n                }\n\n                // reset variables\n                user = \"\";\n                password = \"\";\n                environment = \"paper\";\n                account = \"\";\n            }\n        }\n\n        /// <summary>\n        /// Reading live algorithm tests\n        ///   - Get a list of live algorithms\n        ///   - Get logs for the first algorithm returned\n        /// Will there always be a live algorithm for the test user?\n        /// </summary>\n        [Test]\n        public void LiveAlgorithmsAndLiveLogs_CanBeRead_Successfully()\n        {\n            // Read all currently running algorithms\n            var liveAlgorithms = ApiClient.ListLiveAlgorithms(AlgorithmStatus.Running);\n            var stringRepresentation = liveAlgorithms.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsTrue(liveAlgorithms.Success);\n            // There has to be at least one running algorithm\n            Assert.IsTrue(liveAlgorithms.Algorithms.Any());\n\n            // Read the logs of the first live algorithm\n            var firstLiveAlgo = liveAlgorithms.Algorithms[0];\n            var liveLogs = ApiClient.ReadLiveLogs(firstLiveAlgo.ProjectId, firstLiveAlgo.DeployId, 0, 20);\n            stringRepresentation = liveLogs.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsTrue(liveLogs.Success);\n            Assert.IsTrue(liveLogs.Logs.Any());\n            Assert.IsTrue(liveLogs.Length >= 0);\n            Assert.IsTrue(liveLogs.DeploymentOffset >= 0);\n\n            Assert.Throws<ArgumentException>(() => ApiClient.ReadLiveLogs(firstLiveAlgo.ProjectId, firstLiveAlgo.DeployId, 0, 251));\n        }\n\n        /// <summary>\n        /// Runs the algorithm with the given settings and file\n        /// </summary>\n        /// <param name=\"settings\">Settings for Lean</param>\n        /// <param name=\"file\">File to run</param>\n        /// <param name=\"stopLiveAlgos\">If true the algorithm will be stopped at the end of the method.\n        /// Otherwise, it will keep running</param>\n        /// <param name=\"dataProviders\">Dictionary with the data providers and their corresponding credentials</param>\n        /// <returns>The id of the project created with the algorithm in</returns>\n        private int RunLiveAlgorithm(Dictionary<string, object> settings, ProjectFile file, bool stopLiveAlgos, Dictionary<string, object> dataProviders = null)\n        {\n            return RunLiveAlgorithm(ApiClient, settings, file, stopLiveAlgos, dataProviders);\n        }\n\n        internal static int RunLiveAlgorithm(Api.Api apiClient, Dictionary<string, object> settings, ProjectFile file, bool stopLiveAlgos,\n            Dictionary<string, object> dataProviders = null, Language language = Language.CSharp)\n        {\n            // Create a new project\n            var project = apiClient.CreateProject($\"Test project - {DateTime.Now.ToStringInvariant()}\", language, Globals.OrganizationID);\n            var projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = apiClient.UpdateProjectFileContent(projectId, language == Language.CSharp ? \"Main.cs\" : \"main.py\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            var compile = apiClient.CreateCompile(projectId);\n            Assert.IsTrue(compile.Success);\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(apiClient, projectId, compile.CompileId, 30);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n\n            // Get a live node to launch the algorithm on\n            var nodesResponse = apiClient.ReadProjectNodes(projectId);\n            Assert.IsTrue(nodesResponse.Success);\n            var freeNode = nodesResponse.Nodes.LiveNodes.Where(x => x.Busy == false);\n            Assert.IsNotEmpty(freeNode, \"No free Live Nodes found\");\n\n            // Create live default algorithm\n            var createLiveAlgorithm = apiClient.CreateLiveAlgorithm(projectId, compile.CompileId, freeNode.FirstOrDefault().Id, settings, dataProviders: dataProviders);\n            Assert.IsTrue(createLiveAlgorithm.Success);\n\n            if (stopLiveAlgos)\n            {\n                // Liquidate live algorithm; will also stop algorithm\n                var liquidateLive = apiClient.LiquidateLiveAlgorithm(projectId);\n                Assert.IsTrue(liquidateLive.Success);\n\n                // Delete the project\n                var deleteProject = apiClient.DeleteProject(projectId);\n                Assert.IsTrue(deleteProject.Success);\n            }\n\n            return projectId;\n        }\n\n        [Test]\n        public void ReadLiveOrders()\n        {\n            // Create default algorithm settings\n            var settings = new Dictionary<string, object>()\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n                { \"environment\", \"paper\" },\n                { \"user\", \"\" },\n                { \"password\", \"\" },\n                { \"account\", \"\" }\n            };\n\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\")\n            };\n\n            // Run the live algorithm\n            var projectId = RunLiveAlgorithm(settings, file, false);\n\n            // Wait to receive the orders\n            var readLiveOrders = WaitForReadLiveOrdersResponse(projectId, 60 * 5);\n            Assert.IsTrue(readLiveOrders.Any());\n            Assert.AreEqual(Symbols.SPY, readLiveOrders.First().Symbol);\n\n            // Liquidate live algorithm; will also stop algorithm\n            var liquidateLive = ApiClient.LiquidateLiveAlgorithm(projectId);\n            Assert.IsTrue(liquidateLive.Success);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void RunLiveAlgorithmsFromPython()\n        {\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\")\n            };\n            // Create a new project\n            var project = ApiClient.CreateProject($\"Test project - {DateTime.Now.ToStringInvariant()}\", Language.CSharp, TestOrganization);\n            var projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(projectId, \"Main.cs\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            var compile = ApiClient.CreateCompile(projectId);\n            Assert.IsTrue(compile.Success);\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(ApiClient, projectId, compile.CompileId, 30);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n\n            // Get a live node to launch the algorithm on\n            var nodesResponse = ApiClient.ReadProjectNodes(projectId);\n            Assert.IsTrue(nodesResponse.Success);\n            var freeNode = nodesResponse.Nodes.LiveNodes.Where(x => x.Busy == false);\n            Assert.IsNotEmpty(freeNode, \"No free Live Nodes found\");\n\n            using (Py.GIL())\n            {\n\n                dynamic pythonCall = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef CreateLiveAlgorithmFromPython(apiClient, projectId, compileId, nodeId):\n    user = Config.Get('ib-user-name')\n    password = Config.Get('ib-password')\n    account = Config.Get('ib-account')\n    environment = 'paper'\n    if account[:2] == 'DU':\n        environment = 'live'\n    ib_weekly_restart_utc_time = '22:00:00'\n    settings = {'id':'InteractiveBrokersBrokerage', 'environment': environment, 'ib-user-name': user, 'ib-password': password, 'ib-account': account, 'ib-weekly-restart-utc-time': ib_weekly_restart_utc_time, 'holdings':[], 'cash': [{'currency' : 'USD', 'amount' : 100000}]}\n    dataProviders = {'QuantConnectBrokerage':{'id':'QuantConnectBrokerage'}}\n    apiClient.CreateLiveAlgorithm(projectId, compileId, nodeId, settings, dataProviders = dataProviders)\n\");\n                var createLiveAlgorithmModule = pythonCall.GetAttr(\"CreateLiveAlgorithmFromPython\");\n                var createLiveAlgorithm = createLiveAlgorithmModule(ApiClient, projectId, compile.CompileId, freeNode.FirstOrDefault().Id);\n                Assert.IsTrue(createLiveAlgorithm.Success);\n\n                // Liquidate live algorithm; will also stop algorithm\n                var liquidateLive = ApiClient.LiquidateLiveAlgorithm(projectId);\n                Assert.IsTrue(liquidateLive.Success);\n\n                // Delete the project\n                var deleteProject = ApiClient.DeleteProject(projectId);\n                Assert.IsTrue(deleteProject.Success);\n            }\n        }\n\n        /// <summary>\n        /// Wait to receive at least one order\n        /// </summary>\n        /// <param name=\"projectId\">Id of the project</param>\n        /// <param name=\"seconds\">Seconds to allow for receive an order</param>\n        /// <returns></returns>\n        private List<ApiOrderResponse> WaitForReadLiveOrdersResponse(int projectId, int seconds)\n        {\n            var readLiveOrders = new List<ApiOrderResponse>();\n            var finish = DateTime.UtcNow.AddSeconds(seconds);\n            while (DateTime.UtcNow < finish && !readLiveOrders.Any())\n            {\n                Thread.Sleep(10000);\n                readLiveOrders = ApiClient.ReadLiveOrders(projectId);\n            }\n            return readLiveOrders;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/ObjectStoreTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Api;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture, Explicit(\"Requires configured api access and available backtest node to run on\"), Parallelizable(ParallelScope.Fixtures)]\n    public class ObjectStoreTests: ApiTestBase\n    {\n        private const string _key = \"/Ricardo\";\n        private readonly byte[] _data = new byte[3] { 1, 2, 3 };\n\n        [TestCaseSource(nameof(GetObjectStoreWorksAsExpectedTestCases))]\n        public void GetObjectStoreWorksAsExpected(string testName, List<string> keys, bool isSuccessExpected)\n        {\n            var path = Directory.GetCurrentDirectory() + \"/StoreObjectFolder/\";\n            var result = ApiClient.GetObjectStore(TestOrganization, keys, path);\n            if (isSuccessExpected)\n            {\n                Assert.IsTrue(result);\n                DirectoryAssert.Exists(path);\n                Assert.IsTrue(keys.Where(x => File.Exists(path + x) || Directory.Exists(path + x)).Any()); // For some test cases, just one of the keys is present in the Object Store.\n            }\n            else\n            {\n                Assert.IsFalse(result);\n            }\n        }\n\n        [TestCase(\"/filename.zip\", true)]\n        [TestCase(\"/orats_2024-02-32.json\", false)]\n        [TestCase(\"/mrm8488\", false)]\n        [TestCase(\"/mm_test.csv\", true)]\n        [TestCase(\"/model\", true)]\n        [TestCase(\"/trades_test.json\", true)]\n        public void GetObjectStorePropertiesWorksAsExpected(string key, bool isSuccessExpected)\n        {\n            var result = ApiClient.GetObjectStoreProperties(TestOrganization, key);\n            var stringRepresentation = result.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            if (isSuccessExpected)\n            {\n                Assert.IsTrue(result.Success);\n            }\n            else\n            {\n                Assert.IsFalse(result.Success);\n            }\n        }\n\n        [Test]\n        public void SetObjectStoreWorksAsExpected()\n        {\n            var result = ApiClient.DeleteObjectStore(TestOrganization, _key);\n            Assert.IsFalse(result.Success);\n\n            result = ApiClient.SetObjectStore(TestOrganization, _key, _data);\n            Assert.IsTrue(result.Success);\n\n            result = ApiClient.DeleteObjectStore(TestOrganization, _key);\n            Assert.IsTrue(result.Success);\n        }\n\n        [Test]\n        public void DeleteObjectStoreWorksAsExpected()\n        {\n            var result = ApiClient.SetObjectStore(TestOrganization, _key + \"/test1.txt\", _data);\n            var result2 = ApiClient.SetObjectStore(TestOrganization, _key + \"/test2.txt\", _data);\n            Assert.IsTrue(result.Success);\n            var objectsBefore = ApiClient.ListObjectStore(TestOrganization, _key);\n            var stringRepresentation = objectsBefore.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            var numberOfObjectsBefore = objectsBefore.Objects.Count;\n            var totalSizeBefore = objectsBefore.Objects.Select(o => o.Size).Sum();\n\n            result = ApiClient.DeleteObjectStore(TestOrganization, _key + \"/test1.txt\");\n            Assert.IsTrue(result.Success);\n\n            ListObjectStoreResponse objectsAfter;\n            var time = DateTime.UtcNow;\n            do\n            {\n                objectsAfter = ApiClient.ListObjectStore(TestOrganization, _key);\n            } while (objectsAfter.Objects.Count == numberOfObjectsBefore && DateTime.UtcNow < time.AddMinutes(10));\n\n            var totalSizeAfter = objectsAfter.Objects.Select(o => o.Size).Sum();\n            Assert.IsTrue(totalSizeAfter < totalSizeBefore);\n\n            result = ApiClient.DeleteObjectStore(TestOrganization, _key);\n            Assert.IsTrue(result.Success);\n        }\n\n        [Test]\n        public void ListObjectStoreWorksAsExpected()\n        {\n            var path = \"/\";\n\n            var result = ApiClient.ListObjectStore(TestOrganization, path);\n            Assert.IsTrue(result.Success);\n            Assert.IsNotEmpty(result.Objects);\n            Assert.AreEqual(path, result.Path);\n        }\n\n        private static object[] GetObjectStoreWorksAsExpectedTestCases =\n        {\n            new object[] { \"Two keys present\", new List<string> { \"/trades_test.json\", \"/profile_results.json\" }, true},\n            new object[] { \"No key is given\", new List<string> {}, false},\n            new object[] { \"One key is present and the other one not\", new List<string> { \"/trades_test.json\", \"/orats_2024-02-32.json\" }, true},\n            new object[] { \"The key is not present\", new List<string> { \"/orats_2024-02-32.json\" }, false},\n            new object[] { \"The type of the object store file is directory\", new List<string> { \"/CustomData\" }, true},\n            new object[] { \"The type of the object store file is text/plain\", new List<string> { \"/log.txt\" }, true},\n            new object[] { \"The type of the object store file is application/octet-stream\", new List<string> { \"/model\" }, true},\n            new object[] { \"The type of the object store file is P\", new List<string> { \"/l1_model.p\" }, true},\n            new object[] { \"Heavy object store files\", new List<string> {\n                \"/latency_1_False.txt\",\n                \"/portfolio-targets2.csv\",\n                \"/Regressor\",\n                \"/example_data_2.zip\"\n            }, true}\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Api/OptimizationBacktestJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture]\n    public class OptimizationBacktestJsonConverterTests\n    {\n        private const string _validSerialization = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"startDate\\\":\\\"2023-01-01T00:00:00Z\\\",\\\"endDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleMaxEndDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleDays\\\":10,\\\"statistics\\\":{\\\"0\\\":0.374,\\\"1\\\":0.217,\\\"2\\\":0.047,\\\"3\\\":-4.51,\\\"4\\\":2.86,\\\"5\\\":-0.664,\\\"6\\\":52.602,\\\"7\\\":17.800,\\\"8\\\":6300000.00,\\\"9\\\":0.196,\\\"10\\\":1.571,\\\"11\\\":27.0,\\\"12\\\":123.888,\\\"13\\\":77.188,\\\"14\\\":0.63,\\\"15\\\":1.707,\\\"16\\\":1390.49,\\\"17\\\":180.0,\\\"18\\\":0.233,\\\"19\\\":-0.558,\\\"20\\\":73.0,\\\"21\\\":0.1,\\\"22\\\":100000.0,\\\"23\\\":200000.0,\\\"24\\\":3.0},\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0,1.0,1.0,1.0],[2,2.0,2.0,2.0,2.0],[3,3.0,3.0,3.0,3.0]]}\";\n        private const string _oldValidSerialization = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":{\\\"0\\\":0.374,\\\"1\\\":0.217,\\\"2\\\":0.047,\\\"3\\\":-4.51,\\\"4\\\":2.86,\\\"5\\\":-0.664,\\\"6\\\":52.602,\\\"7\\\":17.800,\\\"8\\\":6300000.00,\\\"9\\\":0.196,\\\"10\\\":1.571,\\\"11\\\":27.0,\\\"12\\\":123.888,\\\"13\\\":77.188,\\\"14\\\":0.63,\\\"15\\\":1.707,\\\"16\\\":1390.49,\\\"17\\\":180.0,\\\"18\\\":0.233,\\\"19\\\":-0.558,\\\"20\\\":73.0,\\\"21\\\":0.1,\\\"22\\\":100000.0,\\\"23\\\":200000.0,\\\"24\\\":3.0},\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0,1.0,1.0,1.0],[2,2.0,2.0,2.0,2.0],[3,3.0,3.0,3.0,3.0]]}\";\n        private const string _oldValid2Serialization = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":{\\\"0\\\":0.374,\\\"1\\\":0.217,\\\"2\\\":0.047,\\\"3\\\":-4.51,\\\"4\\\":2.86,\\\"5\\\":-0.664,\\\"6\\\":52.602,\\\"7\\\":17.800,\\\"8\\\":6300000.00,\\\"9\\\":0.196,\\\"10\\\":1.571,\\\"11\\\":27.0,\\\"12\\\":123.888,\\\"13\\\":77.188,\\\"14\\\":0.63,\\\"15\\\":1.707,\\\"16\\\":1390.49,\\\"17\\\":180.0,\\\"18\\\":0.233,\\\"19\\\":-0.558,\\\"20\\\":73.0,\\\"21\\\":0.1,\\\"22\\\":100000.0,\\\"23\\\":200000.0,\\\"24\\\":3.0},\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0],[2,2.0],[3,3.0]]}\";\n        private const string _oldValid3Serialization = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":{\\\"0\\\":0.374,\\\"1\\\":0.217,\\\"2\\\":0.047,\\\"3\\\":-4.51,\\\"4\\\":2.86,\\\"5\\\":-0.664,\\\"6\\\":52.602,\\\"7\\\":17.800,\\\"8\\\":6300000.00,\\\"9\\\":0.196,\\\"10\\\":1.571,\\\"11\\\":27.0,\\\"12\\\":123.888,\\\"13\\\":77.188,\\\"14\\\":0.63,\\\"15\\\":1.707,\\\"16\\\":1390.49,\\\"17\\\":180.0,\\\"18\\\":0.233,\\\"19\\\":-0.558,\\\"20\\\":73.0},\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0],[2,2.0],[3,3.0]]}\";\n\n        private const string _validSerializationWithCustomStats = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"startDate\\\":\\\"2023-01-01T00:00:00Z\\\",\\\"endDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleMaxEndDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleDays\\\":10,\\\"statistics\\\":{\\\"0\\\":0.374,\\\"1\\\":0.217,\\\"2\\\":0.047,\\\"3\\\":-4.51,\\\"4\\\":2.86,\\\"5\\\":-0.664,\\\"6\\\":52.602,\\\"7\\\":17.800,\\\"8\\\":6300000.00,\\\"9\\\":0.196,\\\"10\\\":1.571,\\\"11\\\":27.0,\\\"12\\\":123.888,\\\"13\\\":77.188,\\\"14\\\":0.63,\\\"15\\\":1.707,\\\"16\\\":1390.49,\\\"17\\\":180.0,\\\"18\\\":0.233,\\\"19\\\":-0.558,\\\"20\\\":73.0,\\\"21\\\":0.1,\\\"22\\\":100000.0,\\\"23\\\":200000.0,\\\"24\\\":3.0,\\\"customstat2\\\":5.4321,\\\"customstat1\\\":1.2345},\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0,1.0,1.0,1.0],[2,2.0,2.0,2.0,2.0],[3,3.0,3.0,3.0,3.0]]}\";\n\n        private const string _validOldStatsDeserialization = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"startDate\\\":\\\"2023-01-01T00:00:00Z\\\",\\\"endDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleMaxEndDate\\\":\\\"2024-01-01T00:00:00Z\\\",\\\"outOfSampleDays\\\":10,\\\"statistics\\\":[0.374,0.217,0.047,-4.51,2.86,-0.664,52.602,17.800,6300000.00,0.196,1.571,27.0,123.888,77.188,0.63,1.707,1390.49,180.0,0.233,-0.558,73.0],\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0,1.0,1.0,1.0],[2,2.0,2.0,2.0,2.0],[3,3.0,3.0,3.0,3.0]]}\";\n        private const string _validOldStatsDeserialization2 = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":[0.374,0.217,0.047,-4.51,2.86,-0.664,52.602,17.800,6300000.00,0.196,1.571,27.0,123.888,77.188,0.63,1.707,1390.49,180.0,0.233,-0.558,73.0],\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0,1.0,1.0,1.0],[2,2.0,2.0,2.0,2.0],[3,3.0,3.0,3.0,3.0]]}\";\n        private const string _validOldStatsDeserialization3 = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":[0.374,0.217,0.047,-4.51,2.86,-0.664,52.602,17.800,6300000.00,0.196,1.571,27.0,123.888,77.188,0.63,1.707,1390.49,180.0,0.233,-0.558,73.0],\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0],[2,2.0],[3,3.0]]}\";\n        private const string _validOldStatsDeserializationWithLessStats = \"{\\\"name\\\":\\\"ImABacktestName\\\",\\\"id\\\":\\\"backtestId\\\",\\\"progress\\\":0.0,\\\"exitCode\\\":0,\" +\n            \"\\\"statistics\\\":[0.374,0.217,0.047,-4.51,2.86,-0.664,52.602,17.800,6300000.00,0.196,1.571,27.0,123.888,77.188,0.63],\" +\n            \"\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"},\\\"equity\\\":[[1,1.0],[2,2.0],[3,3.0]]}\";\n\n        [Test]\n        public void SerializationNulls()\n        {\n            var optimizationBacktest = new OptimizationBacktest(null, null, null);\n\n            var serialized = JsonConvert.SerializeObject(optimizationBacktest);\n            Assert.AreEqual(\"{}\", serialized);\n        }\n\n        [TestCase(1)]\n        [TestCase(0)]\n        public void Serialization(int version)\n        {\n            var optimizationBacktest = new OptimizationBacktest(new ParameterSet(18,\n                new Dictionary<string, string>\n                {\n                    { \"pinocho\", \"19\" },\n                    { \"pepe\", \"-1\" }\n                }), \"backtestId\", \"ImABacktestName\");\n\n            optimizationBacktest.Statistics = new Dictionary<string, string>\n            {\n                { \"Total Orders\", \"180\" },\n                { \"Average Win\", \"2.86%\" },\n                { \"Average Loss\", \"-4.51%\" },\n                { \"Compounding Annual Return\", \"52.602%\" },\n                { \"Drawdown\", \"17.800%\" },\n                { \"Expectancy\", \"0.196\" },\n                { \"Start Equity\", \"100000\" },\n                { \"End Equity\", \"200000\" },\n                { \"Net Profit\", \"123.888%\" },\n                { \"Sharpe Ratio\", \"1.707\" },\n                { \"Sortino Ratio\", \"0.1\" },\n                { \"Probabilistic Sharpe Ratio\", \"77.188%\" },\n                { \"Loss Rate\", \"27%\" },\n                { \"Win Rate\", \"73%\" },\n                { \"Profit-Loss Ratio\", \"0.63\" },\n                { \"Alpha\", \"0.374\" },\n                { \"Beta\", \"-0.664\" },\n                { \"Annual Standard Deviation\", \"0.217\" },\n                { \"Annual Variance\", \"0.047\" },\n                { \"Information Ratio\", \"1.571\" },\n                { \"Tracking Error\", \"0.233\" },\n                { \"Treynor Ratio\", \"-0.558\" },\n                { \"Total Fees\", \"$1390.49\" },\n                { \"Estimated Strategy Capacity\", \"ZRX6300000.00\" },\n                { \"Drawdown Recovery\", \"3\" }\n            };\n\n            optimizationBacktest.Equity = new CandlestickSeries\n            {\n                Values = new List<ISeriesPoint> { new Candlestick(1, 1, 1, 1, 1), new Candlestick(2, 2, 2, 2, 2), new Candlestick(3, 3, 3, 3, 3) }\n            };\n            if (version > 0)\n            {\n                optimizationBacktest.StartDate = new DateTime(2023, 01, 01);\n                optimizationBacktest.EndDate = new DateTime(2024, 01, 01);\n                optimizationBacktest.OutOfSampleMaxEndDate = new DateTime(2024, 01, 01);\n                optimizationBacktest.OutOfSampleDays = 10;\n            }\n\n            var serialized = JsonConvert.SerializeObject(optimizationBacktest);\n\n            var expected = _validSerialization;\n            if (version == 0)\n            {\n                expected = _oldValidSerialization;\n            }\n            Assert.AreEqual(expected, serialized);\n        }\n\n        [Test]\n        public void SerializationWithCustomStatistics()\n        {\n            var optimizationBacktest = new OptimizationBacktest(new ParameterSet(18,\n                new Dictionary<string, string>\n                {\n                    { \"pinocho\", \"19\" },\n                    { \"pepe\", \"-1\" }\n                }), \"backtestId\", \"ImABacktestName\");\n\n            optimizationBacktest.Statistics = new Dictionary<string, string>\n            {\n                { \"customstat2\", \"5.4321\" },\n                { \"customstat1\", \"1.2345\" },\n                { \"Total Orders\", \"180\" },\n                { \"Average Win\", \"2.86%\" },\n                { \"Average Loss\", \"-4.51%\" },\n                { \"Compounding Annual Return\", \"52.602%\" },\n                { \"Drawdown\", \"17.800%\" },\n                { \"Expectancy\", \"0.196\" },\n                { \"Start Equity\", \"100000\" },\n                { \"End Equity\", \"200000\" },\n                { \"Net Profit\", \"123.888%\" },\n                { \"Sharpe Ratio\", \"1.707\" },\n                { \"Sortino Ratio\", \"0.1\" },\n                { \"Probabilistic Sharpe Ratio\", \"77.188%\" },\n                { \"Loss Rate\", \"27%\" },\n                { \"Win Rate\", \"73%\" },\n                { \"Profit-Loss Ratio\", \"0.63\" },\n                { \"Alpha\", \"0.374\" },\n                { \"Beta\", \"-0.664\" },\n                { \"Annual Standard Deviation\", \"0.217\" },\n                { \"Annual Variance\", \"0.047\" },\n                { \"Information Ratio\", \"1.571\" },\n                { \"Tracking Error\", \"0.233\" },\n                { \"Treynor Ratio\", \"-0.558\" },\n                { \"Total Fees\", \"$1390.49\" },\n                { \"Estimated Strategy Capacity\", \"ZRX6300000.00\" },\n                { \"Drawdown Recovery\", \"3\" }\n            };\n\n            optimizationBacktest.Equity = new CandlestickSeries\n            {\n                Values = new List<ISeriesPoint> { new Candlestick(1, 1, 1, 1, 1), new Candlestick(2, 2, 2, 2, 2), new Candlestick(3, 3, 3, 3, 3) }\n            };\n            optimizationBacktest.StartDate = new DateTime(2023, 01, 01);\n            optimizationBacktest.EndDate = new DateTime(2024, 01, 01);\n            optimizationBacktest.OutOfSampleMaxEndDate = new DateTime(2024, 01, 01);\n            optimizationBacktest.OutOfSampleDays = 10;\n\n            var serialized = JsonConvert.SerializeObject(optimizationBacktest);\n\n            Assert.AreEqual(_validSerializationWithCustomStats, serialized);\n        }\n\n        [TestCase(_validSerialization, false, 25)]\n        [TestCase(_oldValidSerialization, false, 25)]\n        [TestCase(_oldValid2Serialization, false, 25)]\n        // This case has only 21 stats because Sortino Ratio, Start Equity, End Equity and Drawdown Recovery were not supported\n        [TestCase(_oldValid3Serialization, false, 21)]\n        [TestCase(_validOldStatsDeserialization, false, 21)]\n        [TestCase(_validOldStatsDeserialization2, false, 21)]\n        [TestCase(_validOldStatsDeserialization3, false, 21)]\n        [TestCase(_validOldStatsDeserializationWithLessStats, false, 15)]\n        [TestCase(_validSerializationWithCustomStats, true, 25)]\n        public void Deserialization(string serialization, bool hasCustomStats, int expectedLeanStats)\n        {\n            var deserialized = JsonConvert.DeserializeObject<OptimizationBacktest>(serialization);\n            Assert.IsNotNull(deserialized);\n            Assert.AreEqual(\"ImABacktestName\", deserialized.Name);\n            Assert.AreEqual(\"backtestId\", deserialized.BacktestId);\n            Assert.AreEqual(0.0m, deserialized.Progress);\n            Assert.AreEqual(0, deserialized.ExitCode);\n            Assert.AreEqual(-1, deserialized.ParameterSet.Id);\n            Assert.IsTrue(deserialized.ParameterSet.Value.Count == 2);\n            Assert.IsTrue(deserialized.ParameterSet.Value[\"pinocho\"] == \"19\");\n            Assert.IsTrue(deserialized.ParameterSet.Value[\"pepe\"] == \"-1\");\n            Assert.IsTrue(deserialized.Equity.Values.Count == 3);\n\n            for (var i = 0; i < 3; i++)\n            {\n                var expected = i + 1;\n                Assert.IsTrue(((Candlestick)deserialized.Equity.Values[i]).LongTime == expected);\n                Assert.IsTrue(((Candlestick)deserialized.Equity.Values[i]).Open == expected);\n                Assert.IsTrue(((Candlestick)deserialized.Equity.Values[i]).High == expected);\n                Assert.IsTrue(((Candlestick)deserialized.Equity.Values[i]).Low == expected);\n                Assert.IsTrue(((Candlestick)deserialized.Equity.Values[i]).Close == expected);\n            }\n            Assert.AreEqual(\"77.188\", deserialized.Statistics[PerformanceMetrics.ProbabilisticSharpeRatio]);\n\n            if (!hasCustomStats)\n            {\n                Assert.AreEqual(expectedLeanStats, deserialized.Statistics.Count);\n            }\n            else\n            {\n                // There are 2 custom stats\n                Assert.AreEqual(expectedLeanStats + 2, deserialized.Statistics.Count);\n\n                Assert.AreEqual(\"1.2345\", deserialized.Statistics[\"customstat1\"]);\n                Assert.AreEqual(\"5.4321\", deserialized.Statistics[\"customstat2\"]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/OptimizationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\nusing System.IO;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// Tests API account and optimizations endpoints\n    /// </summary>\n    [TestFixture, Explicit(\"Requires configured api access\")]\n    public class OptimizationTests : ApiTestBase\n    {\n        private string _validSerialization = \"{\\\"optimizationId\\\":\\\"myOptimizationId\\\",\\\"name\\\":\\\"myOptimizationName\\\",\\\"runtimeStatistics\\\":{\\\"Completed\\\":\\\"1\\\"},\"+\n            \"\\\"constraints\\\":[{\\\"target\\\":\\\"TotalPerformance.PortfolioStatistics.SharpeRatio\\\",\\\"operator\\\":\\\"GreaterOrEqual\\\",\\\"targetValue\\\":1}],\"+\n            \"\\\"parameters\\\":[{\\\"name\\\":\\\"myParamName\\\",\\\"min\\\":2,\\\"max\\\":4,\\\"step\\\":1}, {\\\"name\\\":\\\"myStaticParamName\\\",\\\"value\\\":4}],\\\"nodeType\\\":\\\"O2-8\\\",\\\"parallelNodes\\\":12,\\\"projectId\\\":1234567,\\\"status\\\":\\\"completed\\\",\" +\n            \"\\\"backtests\\\":{\\\"myBacktestKey\\\":{\\\"name\\\":\\\"myBacktestName\\\",\\\"id\\\":\\\"myBacktestId\\\",\\\"progress\\\":1,\\\"exitCode\\\":0,\"+\n            \"\\\"statistics\\\":[0.374,0.217,0.047,-4.51,2.86,-0.664,52.602,17.800,6300000.00,0.196,1.571,27.0,123.888,77.188,0.63,1.707,1390.49,180.0,0.233,-0.558,73.0],\" +\n            \"\\\"parameterSet\\\":{\\\"myParamName\\\":\\\"2\\\"},\\\"equity\\\":[]}},\\\"strategy\\\":\\\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\\\",\" +\n            \"\\\"requested\\\":\\\"2021-12-16 00:51:58\\\",\\\"criterion\\\":{\\\"extremum\\\":\\\"max\\\",\\\"target\\\":\\\"TotalPerformance.PortfolioStatistics.SharpeRatio\\\",\\\"targetValue\\\":null}}\";\n\n        private string _validEstimateSerialization = \"{\\\"estimateId\\\":\\\"myEstimateId\\\",\\\"time\\\":26,\\\"balance\\\":500}\";\n\n        [Test]\n        public void Deserialization()\n        {\n            var deserialized = JsonConvert.DeserializeObject<Optimization>(_validSerialization);\n            Assert.IsNotNull(deserialized);\n            Assert.AreEqual(\"myOptimizationId\", deserialized.OptimizationId);\n            Assert.AreEqual(\"myOptimizationName\", deserialized.Name);\n            Assert.IsTrue(deserialized.RuntimeStatistics.Count == 1);\n            Assert.IsTrue(deserialized.RuntimeStatistics[\"Completed\"] == \"1\");\n            Assert.IsTrue(deserialized.Constraints.Count == 1);\n            Assert.AreEqual(\"['TotalPerformance'].['PortfolioStatistics'].['SharpeRatio']\", deserialized.Constraints[0].Target);\n            Assert.IsTrue(deserialized.Constraints[0].Operator == ComparisonOperatorTypes.GreaterOrEqual);\n            Assert.IsTrue(deserialized.Constraints[0].TargetValue == 1);\n            Assert.IsTrue(deserialized.Parameters.Count == 2);\n            var stepParam = deserialized.Parameters.First().ConvertInvariant<OptimizationStepParameter>();\n            Assert.IsTrue(stepParam.Name == \"myParamName\");\n            Assert.IsTrue(stepParam.MinValue == 2);\n            Assert.IsTrue(stepParam.MaxValue == 4);\n            Assert.IsTrue(stepParam.Step == 1);\n            var staticParam = deserialized.Parameters.ElementAt(1).ConvertInvariant<StaticOptimizationParameter>();\n            Assert.IsTrue(staticParam.Name == \"myStaticParamName\");\n            Assert.IsTrue(staticParam.Value == \"4\");\n            Assert.AreEqual(OptimizationNodes.O2_8, deserialized.NodeType);\n            Assert.AreEqual(12, deserialized.ParallelNodes);\n            Assert.AreEqual(1234567, deserialized.ProjectId);\n            Assert.AreEqual(OptimizationStatus.Completed, deserialized.Status);\n            Assert.IsTrue(deserialized.Backtests.Count == 1);\n            Assert.IsTrue(deserialized.Backtests[\"myBacktestKey\"].BacktestId == \"myBacktestId\");\n            Assert.IsTrue(deserialized.Backtests[\"myBacktestKey\"].Name == \"myBacktestName\");\n            Assert.IsTrue(deserialized.Backtests[\"myBacktestKey\"].ParameterSet.Value[\"myParamName\"] == \"2\");\n            Assert.IsTrue(deserialized.Backtests[\"myBacktestKey\"].Statistics[PerformanceMetrics.ProbabilisticSharpeRatio] == \"77.188\");\n            Assert.AreEqual(\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\", deserialized.Strategy);\n            Assert.AreEqual(new DateTime(2021, 12, 16, 00, 51, 58), deserialized.Requested);\n            Assert.AreEqual(\"['TotalPerformance'].['PortfolioStatistics'].['SharpeRatio']\", deserialized.Criterion.Target);\n            Assert.IsInstanceOf<Maximization>(deserialized.Criterion.Extremum);\n            Assert.IsNull(deserialized.Criterion.TargetValue);\n        }\n\n        [Test]\n        public void EstimateDeserialization()\n        {\n            var deserialized = JsonConvert.DeserializeObject<Estimate>(_validEstimateSerialization);\n            Assert.AreEqual(\"myEstimateId\", deserialized.EstimateId);\n            Assert.AreEqual(26, deserialized.Time);\n            Assert.AreEqual(500, deserialized.Balance);\n        }\n\n        [Test]\n        public void EstimateOptimization()\n        {\n            var projectId = GetProjectCompiledAndWithBacktest(out var compile);\n\n            var estimate = ApiClient.EstimateOptimization(\n                projectId: projectId,\n                name: \"My Testable Optimization\",\n                target: \"TotalPerformance.PortfolioStatistics.SharpeRatio\",\n                targetTo: \"max\",\n                targetValue: null,\n                strategy: \"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\",\n                compileId: compile.CompileId,\n                parameters: new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 20, 50, 1, 1) // Replace params with valid optimization parameter data for test project\n                },\n                constraints: new List<Constraint>\n                {\n                    new Constraint(\"TotalPerformance.PortfolioStatistics.SharpeRatio\", ComparisonOperatorTypes.GreaterOrEqual, 1)\n                }\n            );\n            var stringRepresentation = estimate.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsNotNull(estimate);\n            Assert.IsNotEmpty(estimate.EstimateId);\n            Assert.GreaterOrEqual(estimate.Time, 0);\n            Assert.GreaterOrEqual(estimate.Balance, 0);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void CreateOptimization()\n        {\n            var optimization = GetOptimization(out var projectId);\n            TestBaseOptimization(optimization);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void ListOptimizations()\n        {\n            GetOptimization(out var projectId);\n\n            var optimizations = ApiClient.ListOptimizations(projectId);\n            Assert.IsNotNull(optimizations);\n            Assert.IsTrue(optimizations.Any());\n            TestBaseOptimization(optimizations.First());\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void ReadOptimization()\n        {\n            var optimization = GetOptimization(out var projectId);\n            var readOptimization = ApiClient.ReadOptimization(optimization.OptimizationId);\n\n            TestBaseOptimization(readOptimization);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void AbortOptimization()\n        {\n            var optimization = GetOptimization(out var projectId);\n            var response = ApiClient.AbortOptimization(optimization.OptimizationId);\n            Assert.IsTrue(response.Success);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void UpdateOptimization()\n        {\n            var optimization = GetOptimization(out var projectId);\n            var response = ApiClient.UpdateOptimization(optimization.OptimizationId, \"Alert Yellow Submarine\");\n            Assert.IsTrue(response.Success);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void DeleteOptimization()\n        {\n            var optimization = GetOptimization(out var projectId);\n            var response = ApiClient.DeleteOptimization(optimization.OptimizationId);\n            Assert.IsTrue(response.Success);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        private int GetProjectCompiledAndWithBacktest(out Compile compile)\n        {\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/ParameterizedAlgorithm.cs\")\n            };\n\n            // Create a new project\n            var project = ApiClient.CreateProject($\"Test project - {DateTime.Now.ToStringInvariant()}\", Language.CSharp, TestOrganization);\n            var projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(projectId, \"Main.cs\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            compile = ApiClient.CreateCompile(projectId);\n            Assert.IsTrue(compile.Success);\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(ApiClient, projectId, compile.CompileId);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n\n            var backtestName = $\"Estimate optimization Backtest\";\n            var backtest = ApiClient.CreateBacktest(projectId, compile.CompileId, backtestName);\n\n            // Now wait until the backtest is completed and request the orders again\n            var backtestReady = WaitForBacktestCompletion(ApiClient, projectId, backtest.BacktestId);\n            Assert.IsTrue(backtestReady.Success);\n\n            return projectId;\n        }\n\n        private BaseOptimization GetOptimization(out int projectId)\n        {\n            projectId = GetProjectCompiledAndWithBacktest(out var compile);\n            var optimization = ApiClient.CreateOptimization(\n                projectId: projectId,\n                name: \"My Testable Optimization\",\n                target: \"TotalPerformance.PortfolioStatistics.SharpeRatio\",\n                targetTo: \"max\",\n                targetValue: null,\n                strategy: \"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\",\n                compileId: compile.CompileId,\n                parameters: new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 20, 50, 1, 1) // Replace params with valid optimization parameter data for test project\n                },\n                constraints: new List<Constraint>\n                {\n                    new Constraint(\"TotalPerformance.PortfolioStatistics.SharpeRatio\", ComparisonOperatorTypes.GreaterOrEqual, 1)\n                },\n                estimatedCost: 0.06m,\n                nodeType: OptimizationNodes.O2_8,\n                parallelNodes: 12\n            );\n\n            return optimization;\n        }\n\n        private void TestBaseOptimization(BaseOptimization optimization)\n        {\n            Assert.IsNotNull(optimization);\n            Assert.IsNotEmpty(optimization.OptimizationId);\n            Assert.Positive(optimization.ProjectId);\n            Assert.IsNotEmpty(optimization.Name);\n            Assert.IsInstanceOf<OptimizationStatus>(optimization.Status);\n            Assert.IsNotEmpty(optimization.NodeType);\n            Assert.IsTrue(0 <= optimization.OutOfSampleDays);\n            Assert.AreNotEqual(default(DateTime), optimization.OutOfSampleMaxEndDate);\n            Assert.IsNotNull(optimization.Criterion);\n            foreach (var item in optimization.Parameters)\n            {\n                Assert.IsFalse(string.IsNullOrEmpty(item.Name));\n            }\n\n            if (optimization is OptimizationSummary)\n            {\n                Assert.AreNotEqual(default(DateTime), (optimization as OptimizationSummary).Created);\n            }\n            else if (optimization is Optimization)\n            {\n                TestOptimization(optimization as Optimization);\n            }\n        }\n\n        private void TestOptimization(Optimization optimization)\n        {\n            Assert.AreNotEqual(default(string), optimization.OptimizationTarget);\n            Assert.IsNotNull(optimization.GridLayout);\n            Assert.IsNotNull(optimization.RuntimeStatistics);\n            Assert.IsNotNull(optimization.Constraints);\n            Assert.IsTrue(0 <= optimization.ParallelNodes);\n            Assert.IsNotNull(optimization.Backtests);\n            Assert.AreNotEqual(default(string), optimization.Strategy);\n            Assert.AreNotEqual(default(DateTime), optimization.Requested);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/OrganizationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// Tests API account and organizations endpoints\n    /// </summary>\n    [TestFixture, Explicit(\"Requires configured api access\")]\n    public class OrganizationTests : ApiTestBase\n    {\n        [Test]\n        public void ReadAccount()\n        {\n            var account = ApiClient.ReadAccount();\n            var stringRepresentation = account.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsTrue(account.Success);\n            Assert.IsNotEmpty(account.OrganizationId);\n            Assert.IsNotNull(account.Card);\n            Assert.AreNotEqual(default(DateTime), account.Card.Expiration);\n            Assert.IsNotEmpty(account.Card.Brand);\n            Assert.AreNotEqual(0, account.Card.LastFourDigits);\n        }\n\n        [Test]\n        public void ReadOrganization()\n        {\n            var organization = ApiClient.ReadOrganization(TestOrganization);\n            var stringRepresentation = organization.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.AreNotEqual(default(DateTime), organization.DataAgreement.Signed);\n            Assert.AreNotEqual(0, organization.DataAgreement.EpochSignedTime);\n            Assert.AreNotEqual(0, organization.Credit.Balance);\n            Assert.AreNotEqual(0, organization.Products.Count);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/ParameterSetJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Tests.API\n{\n    [TestFixture]\n    public class ParameterSetJsonConverterTests\n    {\n        private const string ValidSerialization = \"{\\\"parameterSet\\\":{\\\"pinocho\\\":\\\"19\\\",\\\"pepe\\\":\\\"-1\\\"}}\";\n\n        [Test]\n        public void SerializationNulls()\n        {\n            var parameterSet = new ParameterSet(0, null);\n\n            var serialized = JsonConvert.SerializeObject(parameterSet);\n            Assert.AreEqual(\"{}\", serialized);\n        }\n\n        [Test]\n        public void Serialization()\n        {\n            var parameterSet = new ParameterSet(18,\n                new Dictionary<string, string>\n                {\n                    { \"pinocho\", \"19\" },\n                    { \"pepe\", \"-1\" }\n                });\n\n            var serialized = JsonConvert.SerializeObject(parameterSet);\n\n            Assert.AreEqual(ValidSerialization, serialized);\n        }\n\n        [TestCase(\"{}\", 0)]\n        [TestCase(\"[]\", 0)]\n        [TestCase(ValidSerialization, 2)]\n        public void Deserialization(string validSerialization, int count)\n        {\n            var deserialized = JsonConvert.DeserializeObject<ParameterSet>(validSerialization);\n            Assert.IsNotNull(deserialized);\n            Assert.AreEqual(-1, deserialized.Id);\n            Assert.AreEqual(count, deserialized.Value.Count);\n            if (count != 0)\n            {\n                Assert.IsTrue(deserialized.Value[\"pinocho\"] == \"19\");\n                Assert.IsTrue(deserialized.Value[\"pepe\"] == \"-1\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Api/ProjectTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Web;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing System.Collections.Generic;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Util;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing System.Threading;\n\nnamespace QuantConnect.Tests.API\n{\n    /// <summary>\n    /// API Project endpoints, includes some Backtest endpoints testing as well\n    /// </summary>\n    [TestFixture, Explicit(\"Requires configured api access and available backtest node to run on\"), Parallelizable(ParallelScope.Fixtures)]\n    public class ProjectTests : ApiTestBase\n    {\n        private readonly Dictionary<string, object> _defaultSettings = new Dictionary<string, object>()\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n                { \"environment\", \"paper\" },\n                { \"cash\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"currency\" , \"USD\"},\n                            { \"amount\", 300000}\n                        }\n                    }\n                    }\n                },\n                { \"holdings\", new List<Dictionary<object, object>>()\n                    {\n                    {new Dictionary<object, object>\n                        {\n                            { \"symbolId\" , Symbols.AAPL.ID.ToString()},\n                            { \"symbol\", Symbols.AAPL.Value},\n                            { \"quantity\", 1 },\n                            { \"averagePrice\", 1}\n                        }\n                    }\n                    }\n                },\n            };\n\n        [Test]\n        public void ReadProject()\n        {\n            var readProject = ApiClient.ReadProject(TestProject.ProjectId);\n            Assert.IsTrue(readProject.Success);\n            Assert.AreEqual(1, readProject.Projects.Count);\n\n            var project = readProject.Projects[0];\n            Assert.AreNotEqual(0, project.OwnerId);\n        }\n\n        /// <summary>\n        /// Test creating and deleting projects with the Api\n        /// </summary>\n        [Test]\n        public void Projects_CanBeCreatedAndDeleted_Successfully()\n        {\n            var name = $\"TestProject{GetTimestamp()}\";\n\n            //Test create a new project successfully\n            var project = ApiClient.CreateProject(name, Language.CSharp, TestOrganization);\n            var stringRepresentation = project.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(project.Success);\n            Assert.Greater(project.Projects.First().ProjectId, 0);\n            Assert.AreEqual(name, project.Projects.First().Name);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(project.Projects.First().ProjectId);\n            Assert.IsTrue(deleteProject.Success);\n\n            // Make sure the project is really deleted\n            var projectList = ApiClient.ListProjects();\n            Assert.IsFalse(projectList.Projects.Any(p => p.ProjectId == project.Projects.First().ProjectId));\n        }\n\n        /// <summary>\n        /// Test updating the files associated with a project\n        /// </summary>\n        [Test]\n        public void CRUD_ProjectFiles_Successfully()\n        {\n            var fakeFile = new ProjectFile\n            {\n                Name = \"Hello.cs\",\n                Code = HttpUtility.HtmlEncode(\"Hello, world!\")\n            };\n\n            var realFile = new ProjectFile\n            {\n                Name = \"main.cs\",\n                Code = HttpUtility.HtmlEncode(File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\"))\n            };\n\n            var secondRealFile = new ProjectFile()\n            {\n                Name = \"algorithm.cs\",\n                Code = HttpUtility.HtmlEncode(File.ReadAllText(\"../../../Algorithm.CSharp/BubbleAlgorithm.cs\"))\n            };\n\n            // Add random file\n            var randomAdd = ApiClient.AddProjectFile(TestProject.ProjectId, fakeFile.Name, fakeFile.Code);\n            var stringRepresentation = randomAdd.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(randomAdd.Success);\n            // Update names of file\n            var updatedName = ApiClient.UpdateProjectFileName(TestProject.ProjectId, fakeFile.Name, realFile.Name);\n            Assert.IsTrue(updatedName.Success);\n\n            // Replace content of file\n            var updateContents = ApiClient.UpdateProjectFileContent(TestProject.ProjectId, realFile.Name, realFile.Code);\n            Assert.IsTrue(updateContents.Success);\n\n            // Read single file\n            var readFile = ApiClient.ReadProjectFile(TestProject.ProjectId, realFile.Name);\n            stringRepresentation = readFile.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(readFile.Success);\n            Assert.IsTrue(readFile.Files.First().Code == realFile.Code);\n            Assert.IsTrue(readFile.Files.First().Name == realFile.Name);\n\n            // Add a second file\n            var secondFile = ApiClient.AddProjectFile(TestProject.ProjectId, secondRealFile.Name, secondRealFile.Code);\n            Assert.IsTrue(secondFile.Success);\n\n            // Read multiple files\n            var readFiles = ApiClient.ReadProjectFiles(TestProject.ProjectId);\n            Assert.IsTrue(readFiles.Success);\n            Assert.IsTrue(readFiles.Files.Count == 4); // 2 Added + 2 Automatic (Research.ipynb & Main.cs)\n\n            // Delete the second file\n            var deleteFile = ApiClient.DeleteProjectFile(TestProject.ProjectId, secondRealFile.Name);\n            Assert.IsTrue(deleteFile.Success);\n\n            // Read files\n            var readFilesAgain = ApiClient.ReadProjectFiles(TestProject.ProjectId);\n            Assert.IsTrue(readFilesAgain.Success);\n            Assert.IsTrue(readFilesAgain.Files.Count == 3);\n            Assert.IsTrue(readFilesAgain.Files.Any(x => x.Name == realFile.Name));\n        }\n\n        /// <summary>\n        /// Test updating the nodes associated with a project\n        /// </summary>\n        [Test]\n        public void RU_ProjectNodes_Successfully()\n        {\n            // Read the nodes\n            var nodesResponse = ApiClient.ReadProjectNodes(TestProject.ProjectId);\n            var stringRepresentation = nodesResponse.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(nodesResponse.Success);\n            Assert.Greater(nodesResponse.Nodes.BacktestNodes.Count, 0);\n\n            // Save reference node\n            var node = nodesResponse.Nodes.BacktestNodes.First();\n            var nodeId = node.Id;\n            var active = node.Active;\n\n            // If the node is active, deactivate it. Otherwise, set active to true\n            var nodes = node.Active ? Array.Empty<string>() : new[] { nodeId };\n\n            // Update the nodes\n            nodesResponse = ApiClient.UpdateProjectNodes(TestProject.ProjectId, nodes);\n            Assert.IsTrue(nodesResponse.Success);\n\n            // Node has a new active state\n            node = nodesResponse.Nodes.BacktestNodes.First(x => x.Id == nodeId);\n            Assert.AreNotEqual(active, node.Active);\n\n            // Set it back to previous state\n            nodes = node.Active ? Array.Empty<string>() : new[] { nodeId };\n\n            nodesResponse = ApiClient.UpdateProjectNodes(TestProject.ProjectId, nodes);\n            Assert.IsTrue(nodesResponse.Success);\n\n            // Node has a new active state\n            node = nodesResponse.Nodes.BacktestNodes.First(x => x.Id == nodeId);\n            Assert.AreEqual(active, node.Active);\n        }\n\n        /// <summary>\n        /// Test creating, compiling and backtesting a C# project via the Api\n        /// </summary>\n        [Test]\n        public void CSharpProject_CreatedCompiledAndBacktested_Successully()\n        {\n            var language = Language.CSharp;\n            var code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\");\n            var algorithmName = \"Main.cs\";\n            var projectName = $\"{GetTimestamp()} Test {TestAccount} Lang {language}\";\n\n            Perform_CreateCompileBackTest_Tests(projectName, language, algorithmName, code);\n        }\n\n        /// <summary>\n        /// Test creating, compiling and backtesting a Python project via the Api\n        /// </summary>\n        [Test]\n        public void PythonProject_CreatedCompiledAndBacktested_Successully()\n        {\n            var language = Language.Python;\n            var code = File.ReadAllText(\"../../../Algorithm.Python/BasicTemplateAlgorithm.py\");\n            var algorithmName = \"main.py\";\n\n            var projectName = $\"{GetTimestamp()} Test {TestAccount} Lang {language}\";\n\n            Perform_CreateCompileBackTest_Tests(projectName, language, algorithmName, code);\n        }\n\n        private void Perform_CreateCompileBackTest_Tests(string projectName, Language language, string algorithmName, string code, string expectedStatus = \"Completed.\")\n        {\n            //Test create a new project successfully\n            var project = ApiClient.CreateProject(projectName, language, TestOrganization);\n            Assert.IsTrue(project.Success);\n            Assert.Greater(project.Projects.First().ProjectId, 0);\n            Assert.AreEqual(projectName, project.Projects.First().Name);\n\n            // Make sure the project just created is now present\n            var projects = ApiClient.ListProjects();\n            Assert.IsTrue(projects.Success);\n            Assert.IsTrue(projects.Projects.Any(p => p.ProjectId == project.Projects.First().ProjectId));\n\n            // Test read back the project we just created\n            var readProject = ApiClient.ReadProject(project.Projects.First().ProjectId);\n            Assert.IsTrue(readProject.Success);\n            Assert.AreEqual(projectName, readProject.Projects.First().Name);\n\n            // Test change project file name and content\n            var file = new ProjectFile { Name = algorithmName, Code = code };\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(project.Projects.First().ProjectId, file.Name, file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Download the project again to validate its got the new file\n            var verifyRead = ApiClient.ReadProject(project.Projects.First().ProjectId);\n            Assert.IsTrue(verifyRead.Success);\n\n            // Compile the project we've created\n            var compileCreate = ApiClient.CreateCompile(project.Projects.First().ProjectId);\n            Assert.IsTrue(compileCreate.Success);\n            Assert.AreEqual(CompileState.InQueue, compileCreate.State);\n\n            // Read out the compile\n            var compileSuccess = WaitForCompilerResponse(ApiClient, project.Projects.First().ProjectId, compileCreate.CompileId);\n            Assert.IsTrue(compileSuccess.Success);\n            Assert.AreEqual(CompileState.BuildSuccess, compileSuccess.State);\n\n            // Update the file, create a build error, test we get build error\n            file.Code += \"[Jibberish at end of the file to cause a build error]\";\n            ApiClient.UpdateProjectFileContent(project.Projects.First().ProjectId, file.Name, file.Code);\n            var compileError = ApiClient.CreateCompile(project.Projects.First().ProjectId);\n            compileError = WaitForCompilerResponse(ApiClient, project.Projects.First().ProjectId, compileError.CompileId);\n            Assert.IsTrue(compileError.Success); // Successfully processed rest request.\n            Assert.AreEqual(CompileState.BuildError, compileError.State); //Resulting in build fail.\n\n            // Using our successful compile; launch a backtest!\n            var backtestName = $\"{DateTime.UtcNow.ToStringInvariant(\"yyyy-MM-dd HH-mm-ss\")} API Backtest\";\n            var backtest = ApiClient.CreateBacktest(project.Projects.First().ProjectId, compileSuccess.CompileId, backtestName);\n            Assert.IsTrue(backtest.Success);\n\n            // Now read the backtest and wait for it to complete\n            var backtestRead = WaitForBacktestCompletion(ApiClient, project.Projects.First().ProjectId, backtest.BacktestId, secondsTimeout: 600, returnFailedBacktest: true);\n            Assert.IsTrue(backtestRead.Success);\n\n            // Backtest completed, let's wait a second to allow status update\n            backtestRead = ApiClient.ReadBacktest(project.Projects.First().ProjectId, backtestRead.BacktestId);\n            Assert.AreEqual(expectedStatus, backtestRead.Status);\n\n            if (expectedStatus == \"Runtime Error\")\n            {\n                Assert.IsTrue(backtestRead.Error.Contains(\"Intentional Failure\", StringComparison.InvariantCulture) || backtestRead.HasInitializeError);\n            }\n            else\n            {\n                Assert.AreEqual(1, backtestRead.Progress);\n                Assert.AreEqual(backtestName, backtestRead.Name);\n                Assert.AreEqual(\"1\", backtestRead.Statistics[\"Total Orders\"]);\n                Assert.Greater(backtestRead.Charts[\"Benchmark\"].Series.Count, 0);\n\n                // In the same way, read the orders returned in the backtest\n                var backtestOrdersRead = ApiClient.ReadBacktestOrders(project.Projects.First().ProjectId, backtest.BacktestId, 0, 1);\n                Assert.IsTrue(backtestOrdersRead.Any());\n                Assert.AreEqual(Symbols.SPY.Value, backtestOrdersRead.First().Symbol.Value);\n\n                // Verify we have the backtest in our project\n                var listBacktests = ApiClient.ListBacktests(project.Projects.First().ProjectId);\n                Assert.IsTrue(listBacktests.Success);\n                Assert.GreaterOrEqual(listBacktests.Backtests.Count, 1);\n                Assert.AreEqual(backtestName, listBacktests.Backtests[0].Name);\n\n                // Update the backtest name and test its been updated\n                backtestName += \"-Amendment\";\n                var renameBacktest = ApiClient.UpdateBacktest(project.Projects.First().ProjectId, backtest.BacktestId, backtestName);\n                Assert.IsTrue(renameBacktest.Success);\n                backtestRead = ApiClient.ReadBacktest(project.Projects.First().ProjectId, backtest.BacktestId);\n                Assert.AreEqual(backtestName, backtestRead.Name);\n\n                //Update the note and make sure its been updated:\n                var newNote = DateTime.Now.ToStringInvariant(\"yyyy-MM-dd HH-mm-ss\");\n                var noteBacktest = ApiClient.UpdateBacktest(project.Projects.First().ProjectId, backtest.BacktestId, note: newNote);\n                Assert.IsTrue(noteBacktest.Success);\n                backtestRead = ApiClient.ReadBacktest(project.Projects.First().ProjectId, backtest.BacktestId);\n                Assert.AreEqual(newNote, backtestRead.Note);\n            }\n\n            // Delete the backtest we just created\n            var deleteBacktest = ApiClient.DeleteBacktest(project.Projects.First().ProjectId, backtest.BacktestId);\n            Assert.IsTrue(deleteBacktest.Success);\n\n            // Test delete the project we just created\n            var deleteProject = ApiClient.DeleteProject(project.Projects.First().ProjectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void ReadBacktestOrdersReportAndChart()\n        {\n            // Project settings\n            var language = Language.CSharp;\n            var code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\");\n            var algorithmName = \"Main.cs\";\n            var projectName = $\"{GetTimestamp()} Test {TestAccount} Lang {language}\";\n\n            // Create a default project\n            var projectResult = ApiClient.CreateProject(projectName, language, TestOrganization);\n            Assert.IsTrue(projectResult.Success, $\"Error creating project:\\n    {string.Join(\"\\n    \", projectResult.Errors)}\");\n            var project = projectResult.Projects.First();\n\n            var file = new ProjectFile { Name = algorithmName, Code = code };\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(project.ProjectId, file.Name, file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success,\n                $\"Error updating project file:\\n    {string.Join(\"\\n    \", updateProjectFileContent.Errors)}\");\n\n            var compileCreate = ApiClient.CreateCompile(project.ProjectId);\n            var compileSuccess = WaitForCompilerResponse(ApiClient, project.ProjectId, compileCreate.CompileId);\n            Assert.IsTrue(compileSuccess.Success, $\"Error compiling project:\\n    {string.Join(\"\\n    \", compileSuccess.Errors)}\");\n\n            var backtestName = $\"ReadBacktestOrders Backtest {GetTimestamp()}\";\n            var backtest = ApiClient.CreateBacktest(project.ProjectId, compileSuccess.CompileId, backtestName);\n\n            // Read ongoing backtest\n            var backtestRead = ApiClient.ReadBacktest(project.ProjectId, backtest.BacktestId);\n            Assert.IsTrue(backtestRead.Success);\n\n            // Now wait until the backtest is completed and request the orders again\n            backtestRead = WaitForBacktestCompletion(ApiClient, project.ProjectId, backtest.BacktestId);\n            var backtestOrdersRead = ApiClient.ReadBacktestOrders(project.ProjectId, backtest.BacktestId);\n            string stringRepresentation;\n            foreach (var backtestOrder in backtestOrdersRead)\n            {\n                stringRepresentation = backtestOrder.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            }\n            Assert.IsTrue(backtestOrdersRead.Any());\n            Assert.AreEqual(Symbols.SPY.Value, backtestOrdersRead.First().Symbol.Value);\n\n            var readBacktestReport = ApiClient.ReadBacktestReport(project.ProjectId, backtest.BacktestId);\n            stringRepresentation = readBacktestReport.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(readBacktestReport.Success);\n            Assert.IsFalse(string.IsNullOrEmpty(readBacktestReport.Report));\n\n            var readBacktestChart = ApiClient.ReadBacktestChart(\n                project.ProjectId, \"Strategy Equity\",\n                new DateTime(2013, 10, 07).Second,\n                new DateTime(2013, 10, 11).Second,\n                1000,\n                backtest.BacktestId);\n            stringRepresentation = readBacktestChart.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(readBacktestChart.Success);\n            Assert.IsNotNull(readBacktestChart.Chart);\n\n            // Delete the backtest we just created\n            var deleteBacktest = ApiClient.DeleteBacktest(project.ProjectId, backtest.BacktestId);\n            Assert.IsTrue(deleteBacktest.Success);\n\n            // Delete the project we just created\n            var deleteProject = ApiClient.DeleteProject(project.ProjectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void UpdateBacktestName()\n        {\n            // We will be using the existing TestBacktest for this test\n            var originalName = TestBacktest.Name;\n            var newName = $\"{originalName} - Amended - {DateTime.UtcNow.ToStringInvariant(\"yyyy-MM-dd HH-mm-ss\")}\";\n\n            // Update the backtest name\n            var updateResult = ApiClient.UpdateBacktest(TestProject.ProjectId, TestBacktest.BacktestId, name: newName);\n            Assert.IsTrue(updateResult.Success, $\"Error updating backtest name:\\n    {string.Join(\"\\n    \", updateResult.Errors)}\");\n\n            // Read the backtest and verify the name has been updated\n            var readResult = ApiClient.ReadBacktest(TestProject.ProjectId, TestBacktest.BacktestId);\n            Assert.IsTrue(readResult.Success, $\"Error reading backtest:\\n    {string.Join(\"\\n    \", readResult.Errors)}\");\n            Assert.AreEqual(newName, readResult.Name);\n\n            // Revert the name back to the original\n            updateResult = ApiClient.UpdateBacktest(TestProject.ProjectId, TestBacktest.BacktestId, name: originalName);\n            Assert.IsTrue(updateResult.Success, $\"Error updating backtest name:\\n    {string.Join(\"\\n    \", updateResult.Errors)}\");\n\n            // Read the backtest and verify the name has been updated\n            readResult = ApiClient.ReadBacktest(TestProject.ProjectId, TestBacktest.BacktestId);\n            Assert.IsTrue(readResult.Success, $\"Error reading backtest:\\n    {string.Join(\"\\n    \", readResult.Errors)}\");\n            Assert.AreEqual(originalName, readResult.Name);\n        }\n\n        [Test]\n        public void ReadLiveInsightsWorksAsExpected()\n        {\n            var quantConnectDataProvider = new Dictionary<string, object>\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"QuantConnectBrokerage\", quantConnectDataProvider }\n            };\n\n            GetProjectAndCompileIdToReadInsights(out var projectId, out var compileId);\n\n            // Get a live node to launch the algorithm on\n            var nodesResponse = ApiClient.ReadProjectNodes(projectId);\n            Assert.IsTrue(nodesResponse.Success);\n            var freeNode = nodesResponse.Nodes.LiveNodes.Where(x => x.Busy == false);\n            Assert.IsNotEmpty(freeNode, \"No free Live Nodes found\");\n\n            try\n            {\n                // Create live default algorithm\n                var createLiveAlgorithm = ApiClient.CreateLiveAlgorithm(projectId, compileId, freeNode.FirstOrDefault().Id, _defaultSettings, dataProviders: dataProviders);\n                Assert.IsTrue(createLiveAlgorithm.Success, $\"ApiClient.CreateLiveAlgorithm(): Error: {string.Join(\",\", createLiveAlgorithm.Errors)}\");\n\n                // Wait 2 minutes\n                Thread.Sleep(120000);\n\n                // Stop the algorithm\n                var stopLive = ApiClient.StopLiveAlgorithm(projectId);\n                Assert.IsTrue(stopLive.Success, $\"ApiClient.StopLiveAlgorithm(): Error: {string.Join(\",\", stopLive.Errors)}\");\n\n                // Try to read the insights from the algorithm\n                var readInsights = ApiClient.ReadLiveInsights(projectId, 0, 5);\n                var finish = DateTime.UtcNow.AddMinutes(2);\n                do\n                {\n                    Thread.Sleep(5000);\n                    readInsights = ApiClient.ReadLiveInsights(projectId, 0, 5);\n                }\n                while (finish > DateTime.UtcNow && !readInsights.Insights.Any());\n\n                Assert.IsTrue(readInsights.Success, $\"ApiClient.ReadLiveInsights(): Error: {string.Join(\",\", readInsights.Errors)}\");\n                Assert.IsNotEmpty(readInsights.Insights);\n                Assert.IsTrue(readInsights.Length >= 0);\n                Assert.Throws<ArgumentException>(() => ApiClient.ReadLiveInsights(projectId, 0, 101));\n                Assert.DoesNotThrow(() => ApiClient.ReadLiveInsights(projectId));\n            }\n            catch (Exception ex)\n            {\n                // Delete the project in case of an error\n                Assert.IsTrue(ApiClient.DeleteProject(projectId).Success);\n                throw ex;\n            }\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void UpdatesBacktestTags()\n        {\n            // We will be using the existing TestBacktest for this test\n            var tags = new List<string> { \"tag1\", \"tag2\", \"tag3\" };\n\n            // Add the tags to the backtest\n            var addTagsResult = ApiClient.UpdateBacktestTags(TestProject.ProjectId, TestBacktest.BacktestId, tags);\n            Assert.IsTrue(addTagsResult.Success, $\"Error adding tags to backtest:\\n    {string.Join(\"\\n    \", addTagsResult.Errors)}\");\n\n            // Read the backtest and verify the tags were added\n            var backtestsResult = ApiClient.ListBacktests(TestProject.ProjectId);\n            var stringRepresentation = backtestsResult.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(backtestsResult.Success, $\"Error getting backtests:\\n    {string.Join(\"\\n    \", backtestsResult.Errors)}\");\n            Assert.AreEqual(1, backtestsResult.Backtests.Count);\n            CollectionAssert.AreEquivalent(tags, backtestsResult.Backtests[0].Tags);\n\n            // Remove all tags from the backtest\n            var deleteTagsResult = ApiClient.UpdateBacktestTags(TestProject.ProjectId, TestBacktest.BacktestId, new List<string>());\n            Assert.IsTrue(deleteTagsResult.Success, $\"Error deleting tags from backtest:\\n    {string.Join(\"\\n    \", deleteTagsResult.Errors)}\");\n\n            // Read the backtest and verify the tags were deleted\n            backtestsResult = ApiClient.ListBacktests(TestProject.ProjectId);\n            Assert.IsTrue(backtestsResult.Success, $\"Error getting backtests:\\n    {string.Join(\"\\n    \", backtestsResult.Errors)}\");\n            Assert.AreEqual(1, backtestsResult.Backtests.Count);\n            Assert.AreEqual(0, backtestsResult.Backtests[0].Tags.Count);\n        }\n\n        [Test]\n        public void ReadBacktestInsightsWorksAsExpected()\n        {\n            GetProjectAndCompileIdToReadInsights(out var projectId, out var compileId);\n            try\n            {\n                // Create backtest\n                var backtestName = $\"ReadBacktestOrders Backtest {GetTimestamp()}\";\n                var backtest = ApiClient.CreateBacktest(projectId, compileId, backtestName);\n                var stringRepresentation = backtest.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n                // Try to read the insights from the algorithm\n                var readInsights = ApiClient.ReadBacktestInsights(projectId, backtest.BacktestId, 0, 5);\n                stringRepresentation = readInsights.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n                var finish = DateTime.UtcNow.AddMinutes(2);\n                do\n                {\n                    Thread.Sleep(1000);\n                    readInsights = ApiClient.ReadBacktestInsights(projectId, backtest.BacktestId, 0, 5);\n                }\n                while (finish > DateTime.UtcNow && !readInsights.Insights.Any());\n\n                Assert.IsTrue(readInsights.Success, $\"ApiClient.ReadBacktestInsights(): Error: {string.Join(\",\", readInsights.Errors)}\");\n                Assert.IsNotEmpty(readInsights.Insights);\n                Assert.IsTrue(readInsights.Length >= 0);\n                Assert.Throws<ArgumentException>(() => ApiClient.ReadBacktestInsights(projectId, backtest.BacktestId, 0, 101));\n                Assert.DoesNotThrow(() => ApiClient.ReadBacktestInsights(projectId, backtest.BacktestId));\n            }\n            catch (Exception ex)\n            {\n                // Delete the project in case of an error\n                Assert.IsTrue(ApiClient.DeleteProject(projectId).Success);\n                throw ex;\n            }\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void CreatesLiveAlgorithm()\n        {\n            var quantConnectDataProvider = new Dictionary<string, object>\n            {\n                { \"id\", \"QuantConnectBrokerage\" },\n            };\n\n            var dataProviders = new Dictionary<string, object>\n            {\n                { \"QuantConnectBrokerage\", quantConnectDataProvider }\n            };\n\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\")\n            };\n\n            // Create a new project\n            var project = ApiClient.CreateProject($\"Test project - {DateTime.Now.ToStringInvariant()}\", Language.CSharp, TestOrganization);\n            var projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(projectId, \"Main.cs\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            var compile = ApiClient.CreateCompile(projectId);\n            var stringRepresentation = compile.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(compile.Success);\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(ApiClient, projectId, compile.CompileId);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n\n            // Get a live node to launch the algorithm on\n            var nodesResponse = ApiClient.ReadProjectNodes(projectId);\n            Assert.IsTrue(nodesResponse.Success);\n            var freeNode = nodesResponse.Nodes.LiveNodes.Where(x => x.Busy == false);\n            Assert.IsNotEmpty(freeNode, \"No free Live Nodes found\");\n\n            try\n            {\n                // Create live default algorithm\n                var createLiveAlgorithm = ApiClient.CreateLiveAlgorithm(projectId, compile.CompileId, freeNode.FirstOrDefault().Id, _defaultSettings, dataProviders: dataProviders);\n                stringRepresentation = createLiveAlgorithm.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n                Assert.IsTrue(createLiveAlgorithm.Success, $\"ApiClient.CreateLiveAlgorithm(): Error: {string.Join(\",\", createLiveAlgorithm.Errors)}\");\n\n                // Read live algorithm\n                var readLiveAlgorithm = ApiClient.ReadLiveAlgorithm(projectId, createLiveAlgorithm.DeployId);\n                stringRepresentation = readLiveAlgorithm.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n                Assert.IsTrue(readLiveAlgorithm.Success, $\"ApiClient.ReadLiveAlgorithm(): Error: {string.Join(\",\", readLiveAlgorithm.Errors)}\");\n\n                // Stop the algorithm\n                var stopLive = ApiClient.StopLiveAlgorithm(projectId);\n                Assert.IsTrue(stopLive.Success, $\"ApiClient.StopLiveAlgorithm(): Error: {string.Join(\",\", stopLive.Errors)}\");\n\n                var readChart = ApiClient.ReadLiveChart(projectId, \"Strategy Equity\", new DateTime(2013, 10, 07).Second, new DateTime(2013, 10, 11).Second, 1000);\n                Assert.IsTrue(readChart.Success, $\"ApiClient.ReadLiveChart(): Error: {string.Join(\",\", readChart.Errors)}\");\n                Assert.IsNotNull(readChart.Chart);\n\n                var readLivePortfolio = ApiClient.ReadLivePortfolio(projectId);\n                stringRepresentation = readLivePortfolio.ToString();\n                Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n                Assert.IsTrue(readLivePortfolio.Success, $\"ApiClient.ReadLivePortfolio(): Error: {string.Join(\",\", readLivePortfolio.Errors)}\");\n                Assert.IsNotNull(readLivePortfolio.Portfolio, \"Portfolio was null!\");\n                Assert.IsNotNull(readLivePortfolio.Portfolio.Cash, \"Portfolio.Cash was null!\");\n                Assert.IsNotNull(readLivePortfolio.Portfolio.Holdings, \"Portfolio Holdings was null!\");\n\n                var readLiveLogs = ApiClient.ReadLiveLogs(projectId, createLiveAlgorithm.DeployId, 0, 20);\n                Assert.IsTrue(readLiveLogs.Success, $\"ApiClient.ReadLiveLogs(): Error: {string.Join(\",\", readLiveLogs.Errors)}\");\n                Assert.IsNotNull(readLiveLogs.Logs, \"Logs was null!\");\n                Assert.IsTrue(readLiveLogs.Length >= 0, \"The length of the logs was negative!\");\n                Assert.IsTrue(readLiveLogs.DeploymentOffset >= 0, \"The deploymentOffset\");\n            }\n            catch (Exception ex)\n            {\n                // Delete the project in case of an error\n                Assert.IsTrue(ApiClient.DeleteProject(projectId).Success);\n                throw ex;\n            }\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        [Test]\n        public void ReadVersionsWorksAsExpected()\n        {\n            var result = ApiClient.ReadLeanVersions();\n            var stringRepresentation = result.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n            Assert.IsTrue(result.Success);\n            Assert.IsNotEmpty(result.Versions);\n        }\n\n        [Test]\n        public void CreatesOptimization()\n        {\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/ParameterizedAlgorithm.cs\")\n            };\n\n\n            // Create a new project\n            var project = ApiClient.CreateProject($\"Test project optimization - {DateTime.Now.ToStringInvariant()}\", Language.CSharp, TestOrganization);\n            var projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(projectId, \"Main.cs\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            var compile = ApiClient.CreateCompile(projectId);\n            Assert.IsTrue(compile.Success);\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(ApiClient, projectId, compile.CompileId);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n\n            var backtestName = $\"Estimate optimization Backtest\";\n            var backtest = ApiClient.CreateBacktest(projectId, compile.CompileId, backtestName);\n\n            // Now wait until the backtest is completed and request the orders again\n            var backtestReady = WaitForBacktestCompletion(ApiClient, projectId, backtest.BacktestId);\n            Assert.IsTrue(backtestReady.Success);\n\n            var optimization = ApiClient.CreateOptimization(\n                projectId: projectId,\n                name: \"My Testable Optimization\",\n                target: \"TotalPerformance.PortfolioStatistics.SharpeRatio\",\n                targetTo: \"max\",\n                targetValue: null,\n                strategy: \"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\",\n                compileId: compile.CompileId,\n                parameters: new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 50, 150, 1, 1) // Replace params with valid optimization parameter data for test project\n                },\n                constraints: new List<Constraint>\n                {\n                    new Constraint(\"TotalPerformance.PortfolioStatistics.SharpeRatio\", ComparisonOperatorTypes.GreaterOrEqual, 1)\n                },\n                estimatedCost: 0.06m,\n                nodeType: OptimizationNodes.O2_8,\n                parallelNodes: 12\n            );\n            var stringRepresentation = optimization.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            var finish = DateTime.UtcNow.AddMinutes(5);\n            var readOptimization = ApiClient.ReadOptimization(optimization.OptimizationId);\n            do\n            {\n                Thread.Sleep(5000);\n                readOptimization = ApiClient.ReadOptimization(optimization.OptimizationId);\n            }\n            while (finish > DateTime.UtcNow && readOptimization.Status != OptimizationStatus.Completed);\n            stringRepresentation = readOptimization.ToString();\n            Assert.IsTrue(ApiTestBase.IsValidJson(stringRepresentation));\n\n            Assert.IsNotNull(optimization);\n            Assert.IsNotEmpty(optimization.OptimizationId);\n            Assert.AreNotEqual(default(DateTime), optimization.Created);\n            Assert.Positive(optimization.ProjectId);\n            Assert.IsNotEmpty(optimization.Name);\n            Assert.IsInstanceOf<OptimizationStatus>(optimization.Status);\n            Assert.IsNotEmpty(optimization.NodeType);\n            Assert.IsTrue(0 <= optimization.OutOfSampleDays);\n            Assert.AreNotEqual(default(DateTime), optimization.OutOfSampleMaxEndDate);\n            Assert.IsNotNull(optimization.Criterion);\n\n            // Delete the project\n            var deleteProject = ApiClient.DeleteProject(projectId);\n            Assert.IsTrue(deleteProject.Success);\n        }\n\n        private static string GetTimestamp()\n        {\n            return DateTime.UtcNow.ToStringInvariant(\"yyyyMMddHHmmssfffff\");\n        }\n\n        private void GetProjectAndCompileIdToReadInsights(out int projectId, out string compileId)\n        {\n            var file = new ProjectFile\n            {\n                Name = \"Main.cs\",\n                Code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateCryptoFrameworkAlgorithm.cs\")\n            };\n\n            // Create a new project\n            var project = ApiClient.CreateProject($\"Test project insight - {DateTime.Now.ToStringInvariant()}\", Language.CSharp, TestOrganization);\n            projectId = project.Projects.First().ProjectId;\n\n            // Update Project Files\n            var updateProjectFileContent = ApiClient.UpdateProjectFileContent(projectId, \"Main.cs\", file.Code);\n            Assert.IsTrue(updateProjectFileContent.Success);\n\n            // Create compile\n            var compile = ApiClient.CreateCompile(projectId);\n            Assert.IsTrue(compile.Success);\n            compileId = compile.CompileId;\n\n            // Wait at max 30 seconds for project to compile\n            var compileCheck = WaitForCompilerResponse(ApiClient, projectId, compile.CompileId);\n            Assert.IsTrue(compileCheck.Success);\n            Assert.IsTrue(compileCheck.State == CompileState.BuildSuccess);\n        }\n\n        /// <summary>\n        /// Test creating, compiling and backtesting a failure C# project via the Api\n        /// </summary>\n        [TestCase(\"Constructor\")]\n        [TestCase(\"Initialize\")]\n        [TestCase(\"OnData\")]\n\n        public void CSharpProject_CreatedCompiledAndBacktested_Unsuccessully(string section)\n        {\n            var language = Language.CSharp;\n            var code = File.ReadAllText(\"../../../Algorithm.CSharp/BasicTemplateAlgorithm.cs\");\n            if (section == \"Constructor\")\n            {\n                code = code.Replace(\"private Symbol _spy = QuantConnect.Symbol.Create(\\\"SPY\\\", SecurityType.Equity, Market.USA);\",\n                    \"private Symbol _spy = QuantConnect.Symbol.Create(\\\"SPY\\\", SecurityType.Equity, Market.USA);\" +\n                    \"public BasicTemplateAlgorithm(): base() { throw new RegressionTestException(\\\"Intentional Failure\\\"); }\", StringComparison.InvariantCulture);\n            }\n            else if (section == \"Initialize\")\n            {\n                code = code.Replace(\"SetStartDate(2013, 10, 07);\", \"throw new RegressionTestException($\\\"Intentional Failure\\\");\", StringComparison.InvariantCulture);\n            }\n            else if (section == \"OnData\")\n            {\n                code = code.Replace(\"Debug(\\\"Purchased Stock\\\");\", \"throw new RegressionTestException($\\\"Intentional Failure\\\");\", StringComparison.InvariantCulture);\n            }\n            var algorithmName = \"Main.cs\";\n            var projectName = $\"{GetTimestamp()} Test {TestAccount} Lang {language}\";\n\n            Perform_CreateCompileBackTest_Tests(projectName, language, algorithmName, code, \"Runtime Error\");\n        }\n\n        /// <summary>\n        /// Test creating, compiling and backtesting a failure Python project via the Api\n        /// </summary>\n        [TestCase(\"Constructor\")]\n        [TestCase(\"Initialize\")]\n        [TestCase(\"OnData\")]\n\n        public void PythonProject_CreatedCompiledAndBacktested_Unsuccessully(string section)\n        {\n            var language = Language.Python;\n            var code = File.ReadAllText(\"../../../Algorithm.Python/BasicTemplateAlgorithm.py\");\n            if (section == \"Constructor\")\n            {\n                code = code.Replace(\"self.set_start_date(2013,10, 7)  #Set Start Date\",\n                    \"self.set_start_date(2013,10, 7)  #Set Start Date\\n\" +\n                    \"    def __init__(self):\\r\\n        super().__init__()\\r\\n        raise Exception(\\\"Intentional Failure\\\")\", StringComparison.InvariantCulture);\n            }\n            else if (section == \"Initialize\")\n            {\n                code = code.Replace(\"self.set_start_date(2013,10, 7)  #Set Start Date\", \"raise Exception(\\\"Intentional Failure\\\")\", StringComparison.InvariantCulture);\n            }\n            else if (section == \"OnData\")\n            {\n                code = code.Replace(\"self.set_holdings(\\\"SPY\\\", 1)\",\n                    \"self.set_holdings(\\\"SPY\\\", 1)\\r\\n\" +\n                    \"        raise Exception(\\\"Intentional Failure\\\")\", StringComparison.InvariantCulture);\n            }\n            var algorithmName = \"main.py\";\n            var projectName = $\"{GetTimestamp()} Test {TestAccount} Lang {language}\";\n\n            Perform_CreateCompileBackTest_Tests(projectName, language, algorithmName, code, \"Runtime Error\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/AssemblyInitialize.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing NUnit.Framework.Interfaces;\nusing ProtoBuf.Meta;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Logging;\nusing QuantConnect.Python;\nusing QuantConnect.Tests;\nusing QuantConnect.Util;\n\n[assembly: MaintainLogHandler()]\nnamespace QuantConnect.Tests\n{\n    [SetUpFixture]\n    public class AssemblyInitialize\n    {\n        private static bool _initialized;\n\n        [OneTimeSetUp]\n        public void InitializeTestEnvironment()\n        {\n            TryAddIconicDataSubTypes();\n            AdjustCurrentDirectory();\n            TestGlobals.Initialize();\n        }\n\n        public static void AdjustCurrentDirectory()\n        {\n            if (_initialized)\n            {\n                return;\n            }\n            _initialized = true;\n\n            // nunit 3 sets the current folder to a temp folder we need it to be the test bin output folder\n            var dir = TestContext.CurrentContext.TestDirectory;\n            Environment.CurrentDirectory = dir;\n            Directory.SetCurrentDirectory(dir);\n            Config.Reset();\n            Globals.Reset();\n\n            Log.DebuggingEnabled = Config.GetBool(\"debug-mode\");\n            // Activate virtual environment if defined\n            PythonInitializer.ActivatePythonVirtualEnvironment(Config.Get(\"python-venv\"));\n\n            // Initialize and add our Paths\n            PythonInitializer.Initialize();\n            PythonInitializer.AddPythonPaths(\n                new[]\n                {\n                \"./Alphas\",\n                \"./Execution\",\n                \"./Portfolio\",\n                \"./Risk\",\n                \"./Selection\",\n                \"./RegressionAlgorithms\",\n                \"./Research/RegressionScripts\",\n                \"./Python/PandasTests\",\n                \"../../../Algorithm\",\n                \"../../../Algorithm/Selection\",\n                \"../../../Algorithm.Framework\",\n                \"../../../Algorithm.Framework/Selection\",\n                \"../../../Algorithm.Python\"\n                });\n        }\n\n        private static void TryAddIconicDataSubTypes()\n        {\n            try\n            {\n                // Loading of custom data types into BaseData as subtypes will be primarily done at runtime.\n                RuntimeTypeModel.Default[typeof(BaseData)].AddSubType(1111, typeof(IndexedLinkedData));\n                RuntimeTypeModel.Default[typeof(BaseData)].AddSubType(1112, typeof(IndexedLinkedData2));\n                RuntimeTypeModel.Default[typeof(BaseData)].AddSubType(1113, typeof(LinkedData));\n                RuntimeTypeModel.Default[typeof(BaseData)].AddSubType(1114, typeof(UnlinkedData));\n                RuntimeTypeModel.Default[typeof(TradeBar)].AddSubType(1115, typeof(UnlinkedDataTradeBar));\n            }\n            catch\n            {\n            }\n        }\n    }\n\n    [AttributeUsage(AttributeTargets.Assembly)]\n    public class MaintainLogHandlerAttribute : Attribute, ITestAction\n    {\n        public static ILogHandler LogHandler { get; private set; }\n\n        public MaintainLogHandlerAttribute()\n        {\n            LogHandler = LoadLogHandler();\n        }\n\n        /// <summary>\n        /// Replace the log handler if it has been changed\n        /// </summary>\n        /// <param name=\"test\"></param>\n        public void BeforeTest(ITest test)\n        {\n            if (Log.LogHandler != LogHandler)\n            {\n                Log.LogHandler = LogHandler;\n            }\n        }\n\n        public void AfterTest(ITest test)\n        {\n            //NOP\n        }\n\n        /// <summary>\n        /// Set to act on all tests\n        /// </summary>\n        public ActionTargets Targets => ActionTargets.Test;\n\n        /// <summary>\n        /// Load the log handler defined by test context parameters. Defaults to ConsoleLogHandler if no\n        /// \"log-handler\" parameter is found.\n        /// </summary>\n        /// <returns>An instance of a new LogHandler</returns>\n        private static ILogHandler LoadLogHandler()\n        {\n            if (TestContext.Parameters.Exists(\"log-handler\"))\n            {\n                var logHandler = TestContext.Parameters[\"log-handler\"];\n                Log.Trace($\"QuantConnect.Tests.AssemblyInitialize(): Log handler test parameter loaded {logHandler}\");\n\n                return Composer.Instance.GetExportedValueByTypeName<ILogHandler>(logHandler);\n            }\n\n            // If no parameter just use ConsoleLogHandler\n            return new ConsoleLogHandler();\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "Tests/Brokerages/Authentication/AccessTokenMetaDataResponseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Serialization;\nusing QuantConnect.Brokerages.Authentication;\n\nnamespace QuantConnect.Tests.Brokerages.Authentication\n{\n    [TestFixture]\n    public class OAuthTokenResponseTests\n    {\n        // CharlesSchwab omits tokenType entirely; Tastytrade includes it explicitly.\n        // In both cases the result must be Bearer — either from the JSON value or the property default.\n        [TestCase(\"{\\\"accessToken\\\":\\\"abc\\\",\\\"success\\\":true}\", TokenType.Bearer, TestName = \"DefaultsToBearerWhenTokenTypeAbsent\")]\n        [TestCase(\"{\\\"accessToken\\\":\\\"abc\\\",\\\"tokenType\\\":\\\"Bearer\\\",\\\"success\\\":true}\", TokenType.Bearer, TestName = \"DeserializesBearerWhenTokenTypePresent\")]\n        public void OAuthTokenResponseTokenTypeIsBearer(string json, TokenType expectedTokenType)\n        {\n            var settings = new JsonSerializerSettings\n            {\n                ContractResolver = new CamelCasePropertyNamesContractResolver()\n            };\n\n            var response = JsonConvert.DeserializeObject<LeanTokenCredentials>(json, settings);\n\n            Assert.AreEqual(expectedTokenType, response.TokenType);\n            Assert.AreEqual(\"abc\", response.AccessToken);\n            Assert.IsTrue(response.Success);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Authentication/TokenHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Net;\nusing NUnit.Framework;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Brokerages.Authentication;\n\nnamespace QuantConnect.Tests.Brokerages.Authentication\n{\n    [TestFixture]\n    public class TokenHandlerTests\n    {\n        [Test]\n        public void TokenHandlerThrowsWhenGetAccessTokenAlwaysFails()\n        {\n            using var innerHandler = new CountingHandler(0, HttpStatusCode.OK);\n            using var tokenHandler = new AlwaysFailingTokenHandler(innerHandler);\n            using var client = new HttpClient(tokenHandler);\n\n            using var request = new HttpRequestMessage(HttpMethod.Get, \"https://example.com/test\");\n\n            Assert.Throws<InvalidOperationException>(() => client.Send(request));\n            Assert.AreEqual(0, innerHandler.CallCount);\n        }\n\n        [Test]\n        public void TokenHandlerInvokesAuthenticationFailedEventOnFinalFailure()\n        {\n            using var innerHandler = new CountingHandler(0, HttpStatusCode.OK);\n            using var tokenHandler = new AlwaysFailingTokenHandler(innerHandler);\n\n            Exception capturedEx = null;\n            tokenHandler.AuthenticationFailed += (_, ex) => capturedEx = ex;\n\n            using var client = new HttpClient(tokenHandler);\n            using var request = new HttpRequestMessage(HttpMethod.Get, \"https://example.com/test\");\n\n            Assert.Throws<InvalidOperationException>(() => client.Send(request));\n            Assert.IsNotNull(capturedEx);\n            Assert.IsInstanceOf<InvalidOperationException>(capturedEx);\n        }\n\n        [Test]\n        public void TokenHandlerSendsRequestWithValidToken()\n        {\n            using var innerHandler = new CountingHandler(0, HttpStatusCode.OK);\n            using var tokenHandler = new ValidTokenHandler(innerHandler);\n            using var client = new HttpClient(tokenHandler);\n\n            using var request = new HttpRequestMessage(HttpMethod.Get, \"https://example.com/test\");\n\n            var response = client.Send(request);\n\n            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);\n            Assert.AreEqual(1, innerHandler.CallCount);\n        }\n\n        [Test]\n        public async Task TokenHandlerSendsRequestWithValidTokenAsync()\n        {\n            using var innerHandler = new CountingHandler(0, HttpStatusCode.OK);\n            using var tokenHandler = new ValidTokenHandler(innerHandler);\n            using var client = new HttpClient(tokenHandler);\n\n            using var request = new HttpRequestMessage(HttpMethod.Get, \"https://example.com/test\");\n\n            var response = await client.SendAsync(request).ConfigureAwait(false);\n\n            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);\n            Assert.AreEqual(1, innerHandler.CallCount);\n        }\n\n        private class CountingHandler : HttpMessageHandler\n        {\n            private readonly int _failCount;\n            private readonly HttpStatusCode _failCode;\n            private readonly HttpStatusCode _successCode;\n            public int CallCount { get; private set; }\n\n            public CountingHandler(int failCount, HttpStatusCode failCode, HttpStatusCode successCode = HttpStatusCode.OK)\n            {\n                _failCount = failCount;\n                _failCode = failCode;\n                _successCode = successCode;\n            }\n\n            protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n            {\n                return Task.FromResult(Send(request, cancellationToken));\n            }\n\n            protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)\n            {\n                CallCount++;\n                AssertAuthorization(request);\n\n                return CallCount <= _failCount\n                    ? new HttpResponseMessage(_failCode)\n                    : new HttpResponseMessage(_successCode)\n                    {\n                        Content = new StringContent(\"success\")\n                    };\n            }\n        }\n\n        private static void AssertAuthorization(HttpRequestMessage request)\n        {\n            Assert.IsNotNull(request.Headers.Authorization);\n            Assert.AreEqual(\"Bearer\", request.Headers.Authorization.Scheme);\n            Assert.AreEqual(\"123456\", request.Headers.Authorization.Parameter);\n        }\n\n        private class ValidTokenHandler : LeanTokenHandler<LeanTokenCredentials>\n        {\n            public ValidTokenHandler(HttpMessageHandler innerHandler)\n            {\n                InnerHandler = innerHandler;\n            }\n\n            public override LeanTokenCredentials GetAccessToken(CancellationToken cancellationToken)\n            {\n                return new LeanTokenCredentials(TokenType.Bearer, \"123456\");\n            }\n        }\n\n        private class AlwaysFailingTokenHandler : LeanTokenHandler<LeanTokenCredentials>\n        {\n            public AlwaysFailingTokenHandler(HttpMessageHandler innerHandler)\n            {\n                InnerHandler = innerHandler;\n            }\n\n            public override LeanTokenCredentials GetAccessToken(CancellationToken cancellationToken)\n            {\n                var exception = new InvalidOperationException(\"Simulated persistent token failure\");\n                OnAuthenticationFailed(exception);\n                throw exception;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/BaseOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public abstract class BaseOrderTestParameters\n    {\n        /// <summary>\n        /// Calculates the adjusted limit price for an order based on its direction\n        /// and a price adjustment factor, ensuring the price moves toward being filled.\n        /// </summary>\n        /// <param name=\"orderDirection\">The direction of the order (Buy or Sell).</param>\n        /// <param name=\"previousLimitPrice\">The previous limit price of the order.</param>\n        /// <param name=\"targetMarketPrice\">The target market price used to adjust the limit price.</param>\n        /// <param name=\"priceAdjustmentFactor\">The factor by which the price is adjusted.</param>\n        /// <returns>The new, adjusted limit price.</returns>\n        /// <exception cref=\"ArgumentOutOfRangeException\">Thrown if the order direction is not Buy or Sell.</exception>\n        protected virtual decimal CalculateAdjustedLimitPrice(OrderDirection orderDirection, decimal previousLimitPrice, decimal targetMarketPrice, decimal priceAdjustmentFactor)\n        {\n            var adjustmentLimitPrice = orderDirection switch\n            {\n                OrderDirection.Buy => Math.Max(previousLimitPrice * priceAdjustmentFactor, targetMarketPrice * priceAdjustmentFactor),\n                OrderDirection.Sell => Math.Min(previousLimitPrice / priceAdjustmentFactor, targetMarketPrice / priceAdjustmentFactor),\n                _ => throw new NotSupportedException(\"Unsupported order direction: \" + orderDirection)\n            };\n            Log.Trace($\"{nameof(CalculateAdjustedLimitPrice)}: {orderDirection} | Prev: {previousLimitPrice}, Target: {targetMarketPrice}, AdjustmentFactor: {priceAdjustmentFactor}, Result: {adjustmentLimitPrice}\");\n            return adjustmentLimitPrice;\n        }\n\n        /// <summary>\n        /// Rounds the given price to the nearest increment defined by the underlying symbol's minimum price variation.\n        /// </summary>\n        /// <param name=\"price\">The original price to round.</param>\n        /// <param name=\"minimumPriceVariation\">The minimum tick size or price increment for the symbol.</param>\n        /// <returns>The price rounded to the nearest valid increment.</returns>\n        protected virtual decimal RoundPrice(decimal price, decimal minimumPriceVariation)\n        {\n            var roundOffPlaces = minimumPriceVariation.GetDecimalPlaces();\n            var roundedPrice = Math.Round(price / roundOffPlaces) * roundOffPlaces;\n            Log.Trace($\"{nameof(BaseOrderTestParameters)}.{nameof(RoundPrice)}: Price = {price}, Minimum Price increment = {minimumPriceVariation}, Rounded price = {roundedPrice}\");\n            return roundedPrice;\n        }\n\n        protected void ApplyUpdateOrderRequests(IReadOnlyCollection<Order> orders, UpdateOrderFields fields)\n        {\n            foreach (var order in orders)\n            {\n                ApplyUpdateOrderRequest(order, fields);\n            }\n        }\n\n        protected void ApplyUpdateOrderRequest(Order order, UpdateOrderFields fields)\n        {\n            order.ApplyUpdateOrderRequest(new UpdateOrderRequest(DateTime.UtcNow, order.Id, fields));\n        }\n\n        /// <summary>\n        /// Base class for defining order test parameters.\n        /// Implement <see cref=\"ToString\"/> to provide a descriptive name\n        /// for displaying the test case in <c>Visual Studio Test Explorer</c>.\n        /// </summary>\n        /// <returns>A string representing the test parameters for display purposes.</returns>\n        public abstract override string ToString();\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/BrokerageConcurrentMessageHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    [TestFixture]\n    public class BrokerageConcurrentMessageHandlerTests\n    {\n        [Test]\n        public void MessagesHandledCorrectly([Values] bool parallel)\n        {\n            const int expectedCount = 10000;\n            var numbers = new List<string>();\n            void Action(string number) => numbers.Add(number);\n            var handler = new BrokerageConcurrentMessageHandler<string>(Action);\n\n            var task = Task.Factory.StartNew(() =>\n            {\n                var counter = 0;\n                for (var i = 0; i < expectedCount; i++)\n                {\n                    handler.HandleNewMessage($\"{Interlocked.Increment(ref counter)}\");\n\n                    if (i % 50 == 0)\n                    {\n                        Thread.Sleep(1);\n                    }\n                }\n            });\n\n            Action<int> placeOrder = i =>\n            {\n                handler.WithLockedStream(() =>\n                {\n                    // place order\n                });\n\n                if (i % 50 == 0)\n                {\n                    Thread.Sleep(1);\n                }\n            };\n\n            if (parallel)\n            {\n                Parallel.ForEach(Enumerable.Range(0, expectedCount), placeOrder);\n            }\n            else\n            {\n                for (var i = 0; i < expectedCount; i++)\n                {\n                    placeOrder(i);\n                }\n            }\n\n            if(!task.Wait(TimeSpan.FromSeconds(5)))\n            {\n                Assert.Fail(\"BrokerageConcurrentMessageHandlerTests.MessagesHandledCorrectly(): timeout waiting for task to finish\");\n            }\n\n            // all processed\n            Assert.AreEqual(expectedCount, numbers.Count);\n\n            for (var i = 0; i < numbers.Count; i++)\n            {\n                // all in order\n                Assert.AreEqual($\"{i + 1}\", numbers[i]);\n            }\n        }\n\n        [Test]\n        public void ProducersWaitUntilBufferIsNotFull()\n        {\n            const int bufferSize = 10;\n            Config.Set(\"brokerage-concurrent-message-handler-buffer-size\", bufferSize);\n\n            var numbers = new List<string>();\n            void Action(string number) => numbers.Add(number);\n            var handler = new BrokerageConcurrentMessageHandler<string>(Action, concurrencyEnabled: true);\n\n            using var startEvent = new ManualResetEventSlim(false);\n            using var waitingEvent = new ManualResetEventSlim(false);\n\n            // Lock the buffer\n            Task.Run(() =>\n            {\n                handler.WithLockedStream(() =>\n                {\n                    waitingEvent.Set();\n                    startEvent.Wait();\n                });\n            });\n\n            // Wait until the buffer is locked\n            waitingEvent.Wait();\n\n            // Enqueue messages\n            for (var i = 0; i < bufferSize; i++)\n            {\n                handler.HandleNewMessage($\"{i + 1}\");\n            }\n\n            // No messages should have been processed yet\n            Assert.AreEqual(0, numbers.Count);\n\n            // Start producers, they should wait until the buffer is not full\n            var producers = Task.Run(() =>\n            {\n                Parallel.ForEach(Enumerable.Range(0, bufferSize), (int _) =>\n                {\n                    handler.WithLockedStream(() => { });\n                });\n            });\n\n            Assert.IsFalse(producers.Wait(1000));\n\n            startEvent.Set();\n\n            Assert.IsTrue(producers.Wait(1000));\n\n            // All messages should have been processed\n            Assert.AreEqual(bufferSize, numbers.Count);\n            for (var i = 0; i < numbers.Count; i++)\n            {\n                // all in order\n                Assert.AreEqual($\"{i + 1}\", numbers[i]);\n            }\n        }\n\n        [Test]\n        public void MessagesAreProcessedOnlyByLastConcurrentThread()\n        {\n            const int bufferSize = 20;\n            Config.Set(\"brokerage-concurrent-message-handler-buffer-size\", bufferSize);\n\n            const int expectedCount = bufferSize / 2;\n            var numbers = new List<string>();\n\n            var processingThreadIds = new HashSet<int>();\n\n            void Action(string number)\n            {\n                // Store the thread ID that processed the message\n                processingThreadIds.Add(Environment.CurrentManagedThreadId);\n                numbers.Add(number);\n            }\n\n            var handler = new BrokerageConcurrentMessageHandler<string>(Action, concurrencyEnabled: true);\n\n            using var firstProducerUnlockEvent = new ManualResetEventSlim(false);\n            using var waitingEvent = new ManualResetEventSlim(false);\n            var firstProducerThreadId = -1;\n\n            // Lock the buffer\n            var firstProducer = Task.Run(() =>\n            {\n                handler.WithLockedStream(() =>\n                {\n                    // Store the thread ID of the first producer\n                    firstProducerThreadId = Environment.CurrentManagedThreadId;\n                    waitingEvent.Set();\n                    firstProducerUnlockEvent.Wait();\n                });\n            });\n\n            // Wait until the buffer is locked\n            waitingEvent.Wait();\n\n            // Enqueue messages\n            for (var i = 0; i < expectedCount; i++)\n            {\n                handler.HandleNewMessage($\"{i + 1}\");\n            }\n\n            // No messages should have been processed yet\n            Assert.AreEqual(0, numbers.Count);\n\n            // None of this\n            Parallel.ForEach(Enumerable.Range(0, 100), (int _) =>\n            {\n                handler.WithLockedStream(() => { });\n            });\n\n            // No messages should have been processed yet\n            Assert.AreEqual(0, numbers.Count);\n\n            // Unlock the first producer\n            firstProducerUnlockEvent.Set();\n            firstProducer.Wait();\n\n            Assert.AreEqual(expectedCount, numbers.Count);\n            Assert.AreEqual(1, processingThreadIds.Count, \"All messages should be processed by the same thread\");\n            Assert.IsTrue(processingThreadIds.Contains(firstProducerThreadId), \"Messages should be processed by the first producer thread\");\n        }\n\n        [Test]\n        public void StateIsMaintainedAfterExceptions([Values] bool exceptionInConsumer, [Values] bool exceptionInProducer)\n        {\n            var expectedCount = 1000;\n            var numbers = new List<string>();\n            void Action(string number)\n            {\n                numbers.Add(number);\n                if (exceptionInConsumer && number.ToInt32() % 2 == 0)\n                {\n                    throw new Exception(\"Test exception in consumer\");\n                }\n            }\n            var handler = new BrokerageConcurrentMessageHandler<string>(Action, concurrencyEnabled: true);\n\n            var producersCallCount = 0;\n\n            var task = Task.Run(() =>\n            {\n                for (var i = 0; i < expectedCount; i++)\n                {\n                    handler.HandleNewMessage($\"{i + 1}\");\n                }\n            });\n\n            // Start producers\n            var producersCount = 100;\n            Parallel.ForEach(Enumerable.Range(0, producersCount), (int i) =>\n            {\n                try\n                {\n                    handler.WithLockedStream(() =>\n                    {\n                        Interlocked.Increment(ref producersCallCount);\n                        if (exceptionInProducer && i % 2 == 0)\n                        {\n                            throw new Exception(\"Exception in producer\");\n                        }\n                    });\n                }\n                catch\n                {\n                    // nop\n                }\n            });\n\n            Assert.AreEqual(producersCount, producersCallCount);\n\n            task.Wait();\n\n            for (var i = numbers.Count; i < expectedCount; i++)\n            {\n                handler.WithLockedStream(() => { });\n            }\n\n            // All processed\n            Assert.AreEqual(expectedCount, numbers.Count);\n            for (var i = 0; i < numbers.Count; i++)\n            {\n                // all in order\n                Assert.AreEqual($\"{i + 1}\", numbers[i]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/BrokerageFactoryTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    [TestFixture]\n    public class BrokerageFactoryTests\n    {\n        [Test]\n        public void ComposeBrokerageFactories()\n        {\n            var type = typeof(IBrokerageFactory);\n\n            var types = AppDomain.CurrentDomain.Load(\"QuantConnect.Brokerages\")\n                .GetTypes()\n                .Where(p => type.IsAssignableFrom(p) && p.IsClass && !p.IsAbstract)\n                .ToList();\n\n            Assert.NotZero(types.Count);\n\n            types.ForEach(t =>\n            {\n                Assert.NotNull(t.GetConstructor(Type.EmptyTypes));\n                Assert.NotNull(Composer.Instance.GetExportedValueByTypeName<IBrokerageFactory>(t.FullName));\n            });            \n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/BrokerageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public abstract class BrokerageTests\n    {\n        // ideally this class would be abstract, but I wanted to keep the order test cases here which use the\n        // various parameters required from derived types\n\n        private IBrokerage _brokerage;\n        private OrderProvider _orderProvider;\n        private SecurityProvider _securityProvider;\n\n        protected ManualResetEvent OrderFillEvent { get; } = new ManualResetEvent(false);\n\n        protected ManualResetEvent OrderCancelledResetEvent { get; } = new(false);\n\n        #region Test initialization and cleanup\n\n        [SetUp]\n        public void Setup()\n        {\n            Log.LogHandler = new NUnitLogHandler();\n\n            Log.Trace(\"\");\n            Log.Trace(\"\");\n            Log.Trace(\"--- SETUP ---\");\n            Log.Trace(\"\");\n            Log.Trace(\"\");\n            // we want to regenerate these for each test\n            _brokerage = null;\n            _orderProvider = null;\n            _securityProvider = null;\n            Thread.Sleep(1000);\n            CancelOpenOrders();\n            LiquidateHoldings();\n            Thread.Sleep(1000);\n        }\n\n        [TearDown]\n        public void Teardown()\n        {\n            try\n            {\n                Log.Trace(\"\");\n                Log.Trace(\"\");\n                Log.Trace(\"--- TEARDOWN ---\");\n                Log.Trace(\"\");\n                Log.Trace(\"\");\n                Thread.Sleep(1000);\n                CancelOpenOrders();\n                LiquidateHoldings();\n                Thread.Sleep(1000);\n            }\n            finally\n            {\n                if (_brokerage != null)\n                {\n                    DisposeBrokerage(_brokerage);\n                }\n\n                OrderFillEvent.Reset();\n            }\n        }\n\n        public IBrokerage Brokerage\n        {\n            get\n            {\n                if (_brokerage == null)\n                {\n                    _brokerage = InitializeBrokerage();\n                }\n                return _brokerage;\n            }\n        }\n\n        private IBrokerage InitializeBrokerage()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"- INITIALIZING BROKERAGE -\");\n            Log.Trace(\"\");\n\n            var brokerage = CreateBrokerage(OrderProvider, SecurityProvider);\n            brokerage.Connect();\n\n            if (!brokerage.IsConnected)\n            {\n                Assert.Fail(\"Failed to connect to brokerage\");\n            }\n\n            Log.Trace(\"\");\n            Log.Trace(\"GET ACCOUNT HOLDINGS\");\n            Log.Trace(\"\");\n            var counter = 0;\n            foreach (var accountHolding in brokerage.GetAccountHoldings())\n            {\n                // these securities don't need to be real, just used for the ISecurityProvider impl, required\n                // by brokerages to track holdings\n                var security = SecurityProvider.GetSecurity(accountHolding.Symbol);\n                security.Holdings.SetHoldings(accountHolding.AveragePrice, accountHolding.Quantity);\n                Log.Trace($\"#{counter++}. {accountHolding}\");\n            }\n            brokerage.OrdersStatusChanged += HandleEvents;\n            brokerage.OrderIdChanged += HandleOrderIdChangedEvents;\n\n            return brokerage;\n        }\n\n        /// <summary>\n        /// Handles the event triggered when a brokerage order ID has changed.\n        /// Logs the event and forwards it to the order provider for further processing.\n        /// </summary>\n        /// <param name=\"_\">\n        /// The sender of the event (unused).\n        /// </param>\n        /// <param name=\"brokerageOrderIdChangedEvent\">\n        /// The event data containing the updated order ID and brokerage IDs.\n        /// </param>\n        private void HandleOrderIdChangedEvents(object _, BrokerageOrderIdChangedEvent brokerageOrderIdChangedEvent)\n        {\n            Log.Trace(\"\");\n            Log.Trace($\"ORDER ID CHANGED: {brokerageOrderIdChangedEvent}\");\n            Log.Trace(\"\");\n\n            OrderProvider.HandlerBrokerageOrderIdChangedEvent(brokerageOrderIdChangedEvent);\n        }\n\n        private void HandleEvents(object sender, List<OrderEvent> orderEvents)\n        {\n            foreach (var orderEvent in orderEvents)\n            {\n                var order = _orderProvider.GetOrderById(orderEvent.OrderId);\n                order.Status = orderEvent.Status;\n\n                Log.Trace(\"\");\n                Log.Trace($\"ORDER STATUS CHANGED: {orderEvent}, Type: {order.Type}\");\n                Log.Trace(\"\");\n\n                switch (orderEvent.Status)\n                {\n                    case OrderStatus.Canceled:\n                        SignalOrderStatusReached(order, OrderStatus.Canceled, OrderCancelledResetEvent);\n                        break;\n\n                }\n\n                // we need to keep this maintained properly\n                if (orderEvent.Status == OrderStatus.Filled || orderEvent.Status == OrderStatus.PartiallyFilled)\n                {\n                    Log.Trace(\"FILL EVENT: \" + orderEvent.FillQuantity + \" units of \" + orderEvent.Symbol.ToString());\n\n                    var eventFillPrice = orderEvent.FillPrice;\n                    var eventFillQuantity = orderEvent.FillQuantity;\n\n                    Assert.Greater(eventFillPrice, 0m);\n\n                    switch (orderEvent.Direction)\n                    {\n                        case OrderDirection.Buy:\n                            Assert.Greater(eventFillQuantity, 0m);\n                            break;\n                        case OrderDirection.Sell:\n                            Assert.Less(eventFillQuantity, 0m);\n                            break;\n                        default:\n                            throw new ArgumentException($\"{nameof(BrokerageTests)}.{nameof(HandleEvents)}: Not Recognize order Event Direction = {orderEvent.Direction}\");\n                    }\n\n                    var holding = SecurityProvider.GetSecurity(orderEvent.Symbol).Holdings;\n                    holding.SetHoldings(eventFillPrice, holding.Quantity + eventFillQuantity);\n\n                    Log.Trace(\"--HOLDINGS: \" + _securityProvider[orderEvent.Symbol].Holdings);\n                }\n\n                if (orderEvent.Status == OrderStatus.Filled)\n                {\n                    SignalOrderStatusReached(order, OrderStatus.Filled, OrderFillEvent);\n                }\n            }\n        }\n\n        protected virtual BrokerageName BrokerageName { get; set; } = BrokerageName.Default;\n\n        public OrderProvider OrderProvider\n        {\n            get { return _orderProvider ?? (_orderProvider = new OrderProvider()); }\n        }\n\n        public SecurityProvider SecurityProvider\n        {\n            get { return _securityProvider ?? (_securityProvider = new SecurityProvider(new(), BrokerageName, OrderProvider)); }\n        }\n\n        /// <summary>\n        /// Creates the brokerage under test and connects it\n        /// </summary>\n        /// <returns>A connected brokerage instance</returns>\n        protected abstract IBrokerage CreateBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider);\n\n        /// <summary>\n        /// Disposes of the brokerage and any external resources started in order to create it\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage instance to be disposed of</param>\n        protected virtual void DisposeBrokerage(IBrokerage brokerage)\n        {\n            brokerage.OrdersStatusChanged -= HandleEvents;\n            brokerage.OrderIdChanged -= HandleOrderIdChangedEvents;\n            brokerage.Disconnect();\n            brokerage.DisposeSafely();\n        }\n\n        /// <summary>\n        /// This is used to ensure each test starts with a clean, known state.\n        /// </summary>\n        protected void LiquidateHoldings()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"LIQUIDATE HOLDINGS\");\n            Log.Trace(\"\");\n\n            var holdings = Brokerage.GetAccountHoldings();\n\n            foreach (var holding in holdings)\n            {\n                if (holding.Quantity == 0) continue;\n                Log.Trace(\"Liquidating: \" + holding);\n                var order = GetMarketOrder(holding.Symbol, -holding.Quantity);\n                PlaceOrderWaitForStatus(order, OrderStatus.Filled);\n            }\n        }\n\n        protected void CancelOpenOrders()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"CANCEL OPEN ORDERS\");\n            Log.Trace(\"\");\n            foreach (var openOrder in GetOpenOrders())\n            {\n                Log.Trace(\"Canceling: \" + openOrder);\n                Brokerage.CancelOrder(openOrder);\n            }\n        }\n\n        private List<Order> GetOpenOrders()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"GET OPEN ORDERS\");\n            Log.Trace(\"\");\n            var orders = new List<Order>();\n            foreach (var openOrder in Brokerage.GetOpenOrders())\n            {\n                var leanOrders = OrderProvider.GetOrdersByBrokerageId(openOrder.BrokerId.FirstOrDefault());\n                // OrderType.Combo share the same BrokerId across LeanOrders\n                if (leanOrders.Count == 0 || !leanOrders.Any(x => x.Symbol == openOrder.Symbol))\n                {\n                    OrderProvider.Add(openOrder);\n                }\n            }\n\n            return OrderProvider.GetOpenOrders();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Gets the symbol to be traded, must be shortable\n        /// </summary>\n        protected abstract Symbol Symbol { get; }\n\n        /// <summary>\n        /// Gets the security type associated with the <see cref=\"Symbol\"/>\n        /// </summary>\n        protected abstract SecurityType SecurityType { get; }\n\n        /// <summary>\n        /// Global order properties used to manage and properly liquidate positions.\n        /// </summary>\n        /// <remarks>\n        /// This property is initialized before/after each brokerage test. It is used to\n        /// ensure that any pre-existing positions are liquidated correctly and that\n        /// new orders are created with the necessary properties (e.g., specific Route,\n        /// Account) to ensure proper execution during the test.\n        protected virtual OrderProperties OrderProperties { get; }\n\n        /// <summary>\n        /// Returns whether or not the brokers order methods implementation are async\n        /// </summary>\n        protected abstract bool IsAsync();\n\n        /// <summary>\n        /// Returns whether or not the brokers order cancel method implementation is async\n        /// </summary>\n        protected virtual bool IsCancelAsync()\n        {\n            return IsAsync();\n        }\n\n        /// <summary>\n        /// Gets the current market price of the specified security\n        /// </summary>\n        protected abstract decimal GetAskPrice(Symbol symbol);\n\n        /// <summary>\n        /// Gets the default order quantity\n        /// </summary>\n        protected virtual decimal GetDefaultQuantity()\n        {\n            return 1;\n        }\n\n        [Test]\n        public void IsConnected()\n        {\n            Assert.IsTrue(Brokerage.IsConnected);\n        }\n\n        public virtual void CancelComboOrders(ComboLimitOrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"CANCEL COMBO ORDERS\");\n            Log.Trace(\"\");\n\n            CancelOrders(parameters.CreateLongOrder(GetDefaultQuantity()), parameters.ExpectedStatus, parameters.ExpectedCancellationResult);\n        }\n\n        public virtual void CancelOrders(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"CANCEL ORDERS\");\n            Log.Trace(\"\");\n\n            CancelOrders([parameters.CreateLongOrder(GetDefaultQuantity())], parameters.ExpectedStatus, parameters.ExpectedCancellationResult);\n        }\n\n        public virtual void LongFromZero(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"LONG FROM ZERO\");\n            Log.Trace(\"\");\n            PlaceOrderWaitForStatus(parameters.CreateLongOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n        }\n\n        public virtual void CloseFromLong(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"CLOSE FROM LONG\");\n            Log.Trace(\"\");\n            // first go long\n            PlaceOrderWaitForStatus(parameters.CreateLongMarketOrder(GetDefaultQuantity()), OrderStatus.Filled);\n\n            // now close it\n            PlaceOrderWaitForStatus(parameters.CreateShortOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n        }\n\n        public virtual void ShortFromZero(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"SHORT FROM ZERO\");\n            Log.Trace(\"\");\n            PlaceOrderWaitForStatus(parameters.CreateShortOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n        }\n\n        public virtual void CloseFromShort(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"CLOSE FROM SHORT\");\n            Log.Trace(\"\");\n            // first go short\n            PlaceOrderWaitForStatus(parameters.CreateShortMarketOrder(GetDefaultQuantity()), OrderStatus.Filled);\n\n            // now close it\n            PlaceOrderWaitForStatus(parameters.CreateLongOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n        }\n\n        public virtual void ShortFromLong(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"SHORT FROM LONG\");\n            Log.Trace(\"\");\n            // first go long\n            PlaceOrderWaitForStatus(parameters.CreateLongMarketOrder(GetDefaultQuantity()));\n\n            // now go net short\n            var order = PlaceOrderWaitForStatus(parameters.CreateShortOrder(2 * GetDefaultQuantity()), parameters.ExpectedStatus);\n\n            if (parameters.ModifyUntilFilled)\n            {\n                ModifyOrderUntilFilled(order, parameters);\n            }\n        }\n\n        public virtual void LongFromShort(OrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"LONG FROM SHORT\");\n            Log.Trace(\"\");\n            // first fo short\n            PlaceOrderWaitForStatus(parameters.CreateShortMarketOrder(-GetDefaultQuantity()), OrderStatus.Filled);\n\n            // now go long\n            var order = PlaceOrderWaitForStatus(parameters.CreateLongOrder(2 * GetDefaultQuantity()), parameters.ExpectedStatus);\n\n            if (parameters.ModifyUntilFilled)\n            {\n                ModifyOrderUntilFilled(order, parameters);\n            }\n        }\n\n        public virtual void LongCombo(ComboLimitOrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace($\"LONG COMBO: \" + parameters);\n            Log.Trace(\"\");\n\n            var orders = PlaceOrderWaitForStatus(parameters.CreateLongOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n\n            if (parameters.ModifyUntilFilled)\n            {\n                ModifyOrdersUntilFilled(orders, () => parameters.ModifyOrderToFill(orders, GetAskPrice));\n            }\n        }\n\n        public virtual void ShortCombo(ComboLimitOrderTestParameters parameters)\n        {\n            Log.Trace(\"\");\n            Log.Trace($\"SHORT COMBO: \" + parameters);\n            Log.Trace(\"\");\n\n            var orders = PlaceOrderWaitForStatus(parameters.CreateShortOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n\n            if (parameters.ModifyUntilFilled)\n            {\n                ModifyOrdersUntilFilled(orders, () => parameters.ModifyOrderToFill(orders, GetAskPrice));\n            }\n        }\n\n        /// <summary>\n        /// Places a long order, updates it, and then cancels it. Verifies that each operation completes successfully.\n        /// </summary>\n        /// <param name=\"parameters\">The parameters for creating and managing the order.</param>\n        /// <param name=\"quantityIncrement\">The increment to add to the order quantity during the update.</param>\n        /// <param name=\"limitPriceIncrement\">The increment to add to the order's limit price during the update.</param>\n        /// <param name=\"stopPriceIncrement\">The increment to add to the order's stop price during the update.</param>\n        /// <exception cref=\"AssertFailedException\">Thrown if the order fails to update or cancel as expected.</exception>\n        public virtual void LongFromZeroUpdateAndCancel(OrderTestParameters parameters, decimal quantityIncrement = 1, decimal limitPriceIncrement = 0.01m, decimal stopPriceIncrement = 0.01m)\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"LONG FROM ZERO THEN UPDATE AND CANCEL\");\n            Log.Trace(\"\");\n\n            var order = PlaceOrderWaitForStatus(parameters.CreateLongOrder(GetDefaultQuantity()), parameters.ExpectedStatus);\n\n            using var updatedOrderStatusEvent = new AutoResetEvent(false);\n            using var canceledOrderStatusEvent = new AutoResetEvent(false);\n\n            EventHandler<List<OrderEvent>> brokerageOnOrdersStatusChanged = (_, orderEvents) =>\n            {\n                var eventOrderStatus = orderEvents[0].Status;\n\n                order.Status = eventOrderStatus;\n\n                switch (eventOrderStatus)\n                {\n                    case OrderStatus.UpdateSubmitted:\n                        updatedOrderStatusEvent.Set();\n                        break;\n                    case OrderStatus.Canceled:\n                        canceledOrderStatusEvent.Set();\n                        break;\n                }\n            };\n\n            Brokerage.OrdersStatusChanged += brokerageOnOrdersStatusChanged;\n\n            var newQuantity = order.Quantity + quantityIncrement;\n\n            decimal? limitPrice = order switch\n            {\n                LimitOrder lo => lo.LimitPrice,\n                StopLimitOrder slo => slo.LimitPrice,\n                LimitIfTouchedOrder lito => lito.LimitPrice,\n                _ => null\n            };\n\n            decimal? stopPrice = order switch\n            {\n                StopMarketOrder smo => smo.StopPrice,\n                StopLimitOrder slo => slo.StopPrice,\n                _ => null\n            };\n\n            decimal? newLimitPrice = limitPrice.HasValue ? limitPrice.Value + limitPriceIncrement : null;\n            decimal? newStopPrice = stopPrice.HasValue ? stopPrice.Value + stopPriceIncrement : null;\n\n            Log.Trace(\"\");\n            Log.Trace($\"UPDATE ORDER FIELDS: \\n\" +\n                $\"  oldQuantity = {order.Quantity}, newQuantity = {newQuantity}\\n\" +\n                $\"  oldLimitPrice = {limitPrice}, newLimitPrice = {newLimitPrice}\\n\" +\n                $\"  oldStopPrice = {stopPrice}, newStopPrice = {newStopPrice}\");\n            Log.Trace(\"\");\n\n            var updateOrderFields = new UpdateOrderFields()\n            {\n                Quantity = newQuantity,\n                LimitPrice = newLimitPrice,\n                StopPrice = newStopPrice\n            };\n\n            order.ApplyUpdateOrderRequest(new UpdateOrderRequest(DateTime.UtcNow, order.Id, updateOrderFields));\n\n            if (!Brokerage.UpdateOrder(order) || !updatedOrderStatusEvent.WaitOne(TimeSpan.FromSeconds(5)))\n            {\n                Assert.Fail(\"Order is not updated well.\");\n            }\n\n            if (!Brokerage.CancelOrder(order) || !canceledOrderStatusEvent.WaitOne(TimeSpan.FromSeconds(5)))\n            {\n                Assert.Fail(\"Order is not canceled well.\");\n            }\n\n            Brokerage.OrdersStatusChanged -= brokerageOnOrdersStatusChanged;\n        }\n\n        [Test]\n        public virtual void GetCashBalanceContainsSomething()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"GET CASH BALANCE\");\n            Log.Trace(\"\");\n            var balance = Brokerage.GetCashBalance();\n            Assert.IsTrue(balance.Any());\n        }\n\n        [Test]\n        public virtual void GetAccountHoldings()\n        {\n            Log.Trace(\"\");\n            Log.Trace(\"GET ACCOUNT HOLDINGS\");\n            Log.Trace(\"\");\n            var before = Brokerage.GetAccountHoldings();\n\n            PlaceOrderWaitForStatus(GetMarketOrder(Symbol, GetDefaultQuantity()));\n\n            Thread.Sleep(3000);\n\n            var after = Brokerage.GetAccountHoldings();\n\n            var beforeHoldings = before.FirstOrDefault(x => x.Symbol == Symbol);\n            var afterHoldings = after.FirstOrDefault(x => x.Symbol == Symbol);\n\n            var beforeQuantity = beforeHoldings == null ? 0 : beforeHoldings.Quantity;\n            var afterQuantity = afterHoldings == null ? 0 : afterHoldings.Quantity;\n\n            Assert.AreEqual(GetDefaultQuantity(), afterQuantity - beforeQuantity);\n        }\n\n        [Test, Explicit(\"This test requires reading the output and selection of a low volume security for the Brokerage\")]\n        public void PartialFills()\n        {\n            using var manualResetEvent = new ManualResetEvent(false);\n\n            var qty = 1000000m;\n            var remaining = qty;\n            var sync = new object();\n            Brokerage.OrdersStatusChanged += (sender, orderEvents) =>\n            {\n                lock (sync)\n                {\n                    var orderEvent = orderEvents[0];\n                    remaining -= orderEvent.FillQuantity;\n                    Log.Trace(\"Remaining: \" + remaining + \" FillQuantity: \" + orderEvent.FillQuantity);\n                    if (orderEvent.Status == OrderStatus.Filled)\n                    {\n                        manualResetEvent.Set();\n                    }\n                }\n            };\n\n            // pick a security with low, but some, volume\n            var symbol = Symbols.EURUSD;\n            var order = GetMarketOrder(symbol, qty);\n            OrderProvider.Add(order);\n            Brokerage.PlaceOrder(order);\n\n            // pause for a while to wait for fills to come in\n            manualResetEvent.WaitOne(2500);\n            manualResetEvent.WaitOne(2500);\n            manualResetEvent.WaitOne(2500);\n\n            Log.Trace(\"Remaining: \" + remaining);\n            Assert.AreEqual(0, remaining);\n        }\n\n        /// <summary>\n        /// Updates the specified order in the brokerage until it fills or reaches a timeout\n        /// </summary>\n        /// <param name=\"order\">The order to be modified</param>\n        /// <param name=\"parameters\">The order test parameters that define how to modify the order</param>\n        /// <param name=\"secondsTimeout\">Maximum amount of time to wait until the order fills</param>\n        protected virtual void ModifyOrderUntilFilled(Order order, OrderTestParameters parameters, double secondsTimeout = 90)\n        {\n            ModifyOrdersUntilFilled([order], () => parameters.ModifyOrderToFill(Brokerage, order, GetAskPrice(order.Symbol)), secondsTimeout);\n        }\n\n        protected virtual void ModifyOrdersUntilFilled(IReadOnlyCollection<Order> orders, Func<bool> modifyOrderToFill, double secondsTimeout = 90)\n        {\n            if (orders.All(o => o.Status == OrderStatus.Filled))\n            {\n                return;\n            }\n\n            EventHandler<List<OrderEvent>> brokerageOnOrdersStatusChanged = (sender, orderEvents) =>\n            {\n                foreach (var orderEvent in orderEvents)\n                {\n                    if (orderEvent.Status == OrderStatus.Canceled || orderEvent.Status == OrderStatus.Invalid)\n                    {\n                        var order = _orderProvider.GetOrderById(orderEvent.Id);\n                        Log.Trace(\"\");\n                        Log.Trace($\"{nameof(ModifyOrdersUntilFilled)}: \" + order);\n                        Log.Trace(\"\");\n                        Assert.Fail(\"Unexpected order status: \" + orderEvent.Status);\n                    }\n                }\n            };\n\n            Brokerage.OrdersStatusChanged += brokerageOnOrdersStatusChanged;\n\n            Log.Trace(\"\");\n            Log.Trace(\"MODIFY UNTIL FILLED: \" + string.Join(Environment.NewLine, orders));\n            Log.Trace(\"\");\n\n            var stopwatch = Stopwatch.StartNew();\n            while (!orders.All(o => o.Status.IsClosed()) && !OrderFillEvent.WaitOne(TimeSpan.FromSeconds(3)) && stopwatch.Elapsed.TotalSeconds < secondsTimeout)\n            {\n                OrderFillEvent.Reset();\n                if (orders.All(o => o.Status == OrderStatus.PartiallyFilled))\n                {\n                    continue;\n                }\n\n                if (modifyOrderToFill())\n                {\n                    if (orders.All(o => o.Status.IsClosed()))\n                    {\n                        break;\n                    }\n\n                    Log.Trace($\"{nameof(BrokerageTests)}.{nameof(ModifyOrdersUntilFilled)}: \" + string.Join(Environment.NewLine, orders));\n                    foreach (var order in orders)\n                    {\n                        if (!Brokerage.UpdateOrder(order))\n                        {\n                            // could be filling already, partial fill\n                        }\n                    }\n                }\n            }\n            Brokerage.OrdersStatusChanged -= brokerageOnOrdersStatusChanged;\n\n            foreach (var order in orders)\n            {\n                Assert.AreEqual(OrderStatus.Filled, order.Status, $\"Brokerage failed to update the order: Id = {order.Id} by Status = {order.Status}\");\n            }\n        }\n\n        /// <summary>\n        /// Places the specified order with the brokerage and wait until we get the <paramref name=\"expectedStatus\"/> back via an OrdersStatusChanged event.\n        /// This function handles adding the order to the <see cref=\"IOrderProvider\"/> instance as well as incrementing the order ID.\n        /// </summary>\n        /// <param name=\"order\">The order to be submitted</param>\n        /// <param name=\"expectedStatus\">The status to wait for</param>\n        /// <param name=\"secondsTimeout\">Maximum amount of time to wait for <paramref name=\"expectedStatus\"/></param>\n        /// <param name=\"allowFailedSubmission\">Allow failed order submission</param>\n        /// <returns>The same order that was submitted.</returns>\n        protected Order PlaceOrderWaitForStatus(Order order, OrderStatus expectedStatus = OrderStatus.Filled,\n                                                double secondsTimeout = 30.0, bool allowFailedSubmission = false)\n        {\n            return PlaceOrderWaitForStatus([order], expectedStatus, secondsTimeout, allowFailedSubmission).First();\n        }\n\n        /// <summary>\n        /// Places the specified order with the brokerage and wait until we get the <paramref name=\"expectedStatus\"/> back via an OrdersStatusChanged event.\n        /// This function handles adding the order to the <see cref=\"IOrderProvider\"/> instance as well as incrementing the order ID.\n        /// </summary>\n        /// <param name=\"orders\">The collection of orders to submitted.</param>\n        /// <param name=\"expectedStatus\">The status to wait for</param>\n        /// <param name=\"secondsTimeout\">Maximum amount of time to wait for <paramref name=\"expectedStatus\"/></param>\n        /// <param name=\"allowFailedSubmission\">Allow failed order submission</param>\n        /// <returns>The same order that was submitted.</returns>\n        protected IReadOnlyCollection<Order> PlaceOrderWaitForStatus(IReadOnlyCollection<Order> orders, OrderStatus expectedStatus = OrderStatus.Filled,\n                                                double secondsTimeout = 30.0, bool allowFailedSubmission = false)\n        {\n            using var requiredStatusEvent = new ManualResetEvent(false);\n            using var desiredStatusEvent = new ManualResetEvent(false);\n            EventHandler<List<OrderEvent>> brokerageOnOrdersStatusChanged = (sender, orderEvents) =>\n            {\n                foreach (var orderEvent in orderEvents)\n                {\n                    var order = _orderProvider.GetOrderById(orderEvent.OrderId);\n                    order.Status = orderEvent.Status;\n                    // no matter what, every order should fire at least one of these\n                    if (orders.All(o => o.Status is OrderStatus.Submitted or OrderStatus.Invalid))\n                    {\n                        Log.Trace(\"\");\n                        Log.Trace(\"SUBMITTED: \" + orderEvent);\n                        Log.Trace(\"\");\n                        try\n                        {\n                            requiredStatusEvent.Set();\n                        }\n                        catch (ObjectDisposedException)\n                        {\n                        }\n                    }\n                    // make sure we fire the status we're expecting\n                    if (orders.All(o => o.Status == expectedStatus))\n                    {\n                        Log.Trace(\"\");\n                        Log.Trace(\"EXPECTED: \" + orderEvent);\n                        Log.Trace(\"\");\n                        try\n                        {\n                            desiredStatusEvent.Set();\n                        }\n                        catch (ObjectDisposedException)\n                        {\n                        }\n                    }\n                }\n            };\n\n            Brokerage.OrdersStatusChanged += brokerageOnOrdersStatusChanged;\n\n            OrderFillEvent.Reset();\n\n            foreach (var order in orders)\n            {\n                OrderProvider.Add(order);\n                if (!Brokerage.PlaceOrder(order) && !allowFailedSubmission)\n                {\n                    Assert.Fail(\"Brokerage failed to place the order: \" + orders);\n                }\n            }\n\n            // This is due to IB simulating stop orders https://www.interactivebrokers.com/en/trading/orders/stop.php\n            // which causes the Status.Submitted order event to never be set\n            var assertOrderEventStatus = true;\n            if (Brokerage.Name == \"Interactive Brokers Brokerage\" && orders.Any(o => o.Type is OrderType.StopMarket or OrderType.StopLimit))\n            {\n                assertOrderEventStatus = false;\n            }\n\n            var delayMilliseconds = Convert.ToInt32(1000 * secondsTimeout);\n            if (assertOrderEventStatus)\n            {\n                if (requiredStatusEvent.WaitOneAssertFail(delayMilliseconds, \"Expected every order to fire a submitted or invalid status event\"))\n                {\n                    desiredStatusEvent.WaitOneAssertFail(delayMilliseconds,\n                        \"OrderStatus \" + expectedStatus + \" was not encountered within the timeout.\" + string.Join(\"\", orders.Select(x => \" Order Id:\" + x.Id)));\n                }\n            }\n            else\n            {\n                requiredStatusEvent.WaitOne(delayMilliseconds);\n            }\n\n            Brokerage.OrdersStatusChanged -= brokerageOnOrdersStatusChanged;\n\n            return orders;\n        }\n\n        protected static SubscriptionDataConfig GetSubscriptionDataConfig<T>(Symbol symbol, Resolution resolution)\n        {\n            return new SubscriptionDataConfig(\n                typeof(T),\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n        }\n\n        protected static void ProcessFeed(IEnumerator<BaseData> enumerator, CancellationTokenSource cancellationToken, Action<BaseData> callback = null)\n        {\n            Task.Factory.StartNew(() =>\n            {\n                try\n                {\n                    while (enumerator.MoveNext() && !cancellationToken.IsCancellationRequested)\n                    {\n                        BaseData tick = enumerator.Current;\n                        if (callback != null)\n                        {\n                            callback.Invoke(tick);\n                        }\n                    }\n                }\n                catch (AssertionException)\n                {\n                    throw;\n                }\n                catch (Exception err)\n                {\n                    Log.Error(err.Message);\n                }\n            }, cancellationToken.Token);\n        }\n\n        private Order GetMarketOrder(Symbol symbol, decimal quantity)\n        {\n            var mkt = new MarketOrderTestParameters(symbol, OrderProperties);\n            return quantity > 0 ? mkt.CreateLongOrder(quantity) : mkt.CreateShortOrder(quantity);\n        }\n\n        /// <summary>\n        /// Sets the given reset event when the order reaches the expected status.\n        /// For combo orders, all legs must match the expected status.\n        /// For simple orders, the event is set immediately.\n        /// </summary>\n        /// <param name=\"order\">The order to check (simple or combo).</param>\n        /// <param name=\"expectedStatus\">The status to wait for before setting the event.</param>\n        /// <param name=\"resetEvent\">The reset event to signal.</param>\n        private void SignalOrderStatusReached(Order order, OrderStatus expectedStatus, ManualResetEvent resetEvent)\n        {\n            if (GroupOrderExtensions.TryGetGroupOrders(order, _orderProvider.GetOrderById, out var orders))\n            {\n                // Combo order: set immediately if all legs match expected status\n                if (orders.All(o => o.Status == expectedStatus))\n                {\n                    resetEvent.Set();\n                }\n            }\n            else\n            {\n                // Simple order: set after its own status update\n                resetEvent.Set();\n            }\n        }\n\n        /// <summary>\n        /// Cancels the specified <paramref name=\"orders\"/> and waits until each order\n        /// reaches the given <paramref name=\"expectedStatus\"/> (via an <c>OrderStatusChanged</c> event),\n        /// or until the timeout expires.\n        /// <param name=\"orders\">The collection of orders to cancel.</param>\n        /// <param name=\"expectedStatus\">The order status to wait for after cancellation.</param>\n        /// <param name=\"expectedCancellationResult\">Indicates whether the cancellation is expected to succeed.</param></param>\n        /// <param name=\"secondsTimeout\">The maximum number of seconds to wait for the expected cancellation result</param>\n        private void CancelOrders(IReadOnlyCollection<Order> orders, OrderStatus expectedStatus = OrderStatus.Submitted, bool expectedCancellationResult = true, int secondsTimeout = 20)\n        {\n            var submittedOrders = PlaceOrderWaitForStatus(orders, expectedStatus);\n\n            OrderCancelledResetEvent.Reset();\n\n            var cancelResult = false;\n            try\n            {\n                foreach (var order in submittedOrders)\n                {\n                    cancelResult = Brokerage.CancelOrder(order);\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n            }\n\n            Assert.AreEqual(IsCancelAsync() || expectedCancellationResult, cancelResult);\n\n            if (expectedCancellationResult)\n            {\n                // We expect the OrderStatus.Canceled event\n                OrderCancelledResetEvent.WaitOneAssertFail(1000 * secondsTimeout, \"Order timeout to cancel\");\n            }\n\n            var openIds = GetOpenOrders().Select(o => o.Id).ToHashSet();\n\n            var isOrderStillOpen = false;\n            foreach (var order in orders)\n            {\n                if (openIds.Contains(order.Id))\n                {\n                    isOrderStillOpen = true;\n                }\n            }\n\n            Assert.IsFalse(isOrderStillOpen);\n\n            OrderCancelledResetEvent.Reset();\n\n            var cancelResultSecondTime = false;\n            try\n            {\n                foreach (var order in submittedOrders)\n                {\n                    cancelResultSecondTime = Brokerage.CancelOrder(order);\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n            }\n\n            Assert.AreEqual(IsCancelAsync(), cancelResultSecondTime);\n            // We do NOT expect the OrderStatus.Canceled event\n            Assert.IsFalse(OrderCancelledResetEvent.WaitOne(TimeSpan.FromSeconds(10)));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/ComboLimitOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Text;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Provides test parameters and helper methods for creating combo limit orders.\n    /// </summary>\n    public class ComboLimitOrderTestParameters : BaseOrderTestParameters\n    {\n        private readonly OptionStrategy _strategy;\n        private readonly decimal _askPrice;\n        private readonly decimal _bidPrice;\n        private readonly IOrderProperties _orderProperties;\n        private readonly decimal _limitPriceAdjustmentFactor;\n        private readonly SymbolProperties _strategyUnderlyingSymbolProperties;\n\n        /// <summary>\n        /// The status to expect when submitting this order in most test cases.\n        /// </summary>\n        public OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        /// <summary>\n        /// The status to expect when cancelling this order\n        /// </summary>\n        public bool ExpectedCancellationResult => true;\n\n        /// <summary>\n        /// True to continue modifying the order until it is filled, false otherwise\n        /// </summary>\n        public bool ModifyUntilFilled => true;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ComboLimitOrderTestParameters\"/> class.\n        /// </summary>\n        /// <param name=\"strategy\">The Specification of the option strategy to trade.</param>\n        /// <param name=\"askPrice\">The ask price used when constructing bear call spreads.</param>\n        /// <param name=\"bidPrice\">The bid price used when constructing bull call spreads.</param>\n        /// <param name=\"limitPriceAdjustmentFactor\">\n        /// A factor used to modify the limit price of the order. \n        /// For buy orders, the limit price is increased by this factor; \n        /// for sell orders, the limit price is decreased by this factor. \n        /// Default is 1.02 (2% adjustment).</param>\n        /// <param name=\"orderProperties\">Optional order properties to attach to each order.</param>\n        public ComboLimitOrderTestParameters(\n            OptionStrategy strategy,\n            decimal askPrice,\n            decimal bidPrice,\n            decimal limitPriceAdjustmentFactor = 1.02m,\n            IOrderProperties orderProperties = null)\n        {\n            _strategy = strategy;\n            _askPrice = askPrice;\n            _bidPrice = bidPrice;\n            _orderProperties = orderProperties;\n            _limitPriceAdjustmentFactor = limitPriceAdjustmentFactor;\n            _strategyUnderlyingSymbolProperties = SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(\n                strategy.Underlying.ID.Market, strategy.Underlying, strategy.Underlying.SecurityType, Currencies.USD);\n        }\n\n        /// <summary>\n        /// Creates long combo orders (buy) for the specified quantity.\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of the combo order to create.</param>\n        /// <returns>A collection of combo orders representing a long position.</returns>\n        public IReadOnlyCollection<ComboOrder> CreateLongOrder(decimal quantity)\n        {\n            return CreateOrders(quantity, _bidPrice);\n        }\n\n        /// <summary>\n        /// Creates short combo orders (sell) for the specified quantity.\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of the combo order to create (will be negated internally).</param>\n        /// <returns>A collection of combo orders representing a short position.</returns>\n        public IReadOnlyCollection<ComboOrder> CreateShortOrder(decimal quantity)\n        {\n            return CreateOrders(decimal.Negate(Math.Abs(quantity)), _askPrice);\n        }\n\n        /// <summary>\n        /// Creates combo orders for a given quantity and limit price.\n        /// </summary>\n        /// <param name=\"quantity\">The quantity of each leg in the combo order.</param>\n        /// <param name=\"limitPrice\">The limit price to apply to the combo order.</param>\n        /// <returns>A collection of <see cref=\"ComboOrder\"/> instances for all legs.</returns>\n        private IReadOnlyCollection<ComboOrder> CreateOrders(decimal quantity, decimal limitPrice)\n        {\n            var targetOption = _strategy.CanonicalOption?.Canonical.ID.Symbol;\n\n            var legs = new List<Leg>(_strategy.UnderlyingLegs);\n\n            foreach (var optionLeg in _strategy.OptionLegs)\n            {\n                var option = Symbol.CreateOption(\n                    _strategy.Underlying,\n                    targetOption,\n                    _strategy.Underlying.ID.Market,\n                    _strategy.Underlying.SecurityType.DefaultOptionStyle(),\n                    optionLeg.Right,\n                    optionLeg.Strike,\n                    optionLeg.Expiration);\n\n                legs.Add(new Leg { Symbol = option, OrderPrice = optionLeg.OrderPrice, Quantity = optionLeg.Quantity });\n            }\n\n            var groupOrderManager = new GroupOrderManager(legs.Count, quantity, limitPrice);\n\n            return legs.Select(l => CreateComboLimitOrder(l, groupOrderManager)).ToList();\n        }\n\n        /// <summary>\n        /// Modifies the limit price of an order to increase the likelihood of being filled.\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage instance to apply the order update.</param>\n        /// <param name=\"order\">The order to modify.</param>\n        /// <param name=\"lastMarketPrice\">The last observed market price of the order's underlying instrument.</param>\n        /// <returns>Always returns true.</returns>\n        public virtual bool ModifyOrderToFill(IReadOnlyCollection<Order> orders, Func<Symbol, decimal> getMarketPrice)\n        {\n            var newCompositeLimitPrice = 0m;\n            var newPriceBuilder = new StringBuilder($\"{nameof(BrokerageTests)}.{nameof(ModifyOrderToFill)}: \");\n            foreach (var order in orders)\n            {\n                var marketPrice = getMarketPrice(order.Symbol);\n                switch (order.Direction)\n                {\n                    case OrderDirection.Buy:\n                        newPriceBuilder.Append(CultureInfo.InvariantCulture, $\"+ {marketPrice}{Currencies.GetCurrencySymbol(order.PriceCurrency)} ({order.Symbol.Value}) \");\n                        newCompositeLimitPrice += marketPrice;\n                        break;\n                    case OrderDirection.Sell:\n                        newPriceBuilder.Append(CultureInfo.InvariantCulture, $\"- {marketPrice}{Currencies.GetCurrencySymbol(order.PriceCurrency)} ({order.Symbol.Value}) \");\n                        newCompositeLimitPrice -= marketPrice;\n                        break;\n                    default:\n                        throw new ArgumentException($\"Unknown order direction: {order.Direction}\");\n                }\n            }\n            Log.Trace(newPriceBuilder.Append(CultureInfo.InvariantCulture, $\"= {newCompositeLimitPrice} - New Composite Limit Price\").ToString());\n\n            var groupOrderManager = orders.First().GroupOrderManager;\n\n            var newLimitPrice = CalculateAdjustedLimitPrice(groupOrderManager.Direction, groupOrderManager.LimitPrice, newCompositeLimitPrice, _limitPriceAdjustmentFactor);\n\n            var updateFields = new UpdateOrderFields() { LimitPrice = RoundPrice(newLimitPrice, _strategyUnderlyingSymbolProperties.MinimumPriceVariation) };\n\n            ApplyUpdateOrderRequests(orders, updateFields);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Returns a string representation of this instance for debugging and logging purposes.\n        /// </summary>\n        public override string ToString()\n        {\n            return $\"{OrderType.ComboLimit}: {_strategy.Name} ({_strategy.CanonicalOption.Value})\";\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"ComboLimitOrder\"/> for the specified leg and direction.\n        /// </summary>\n        /// <param name=\"leg\">The option leg to create the order for.</param>\n        /// <param name=\"groupOrderManager\">The <see cref=\"GroupOrderManager\"/> responsible for tracking related combo orders.</param>\n        /// <returns>A new <see cref=\"ComboLimitOrder\"/> for the given leg.</returns>\n        private ComboLimitOrder CreateComboLimitOrder(Leg leg, GroupOrderManager groupOrderManager)\n        {\n            return new ComboLimitOrder(\n                leg.Symbol,\n                ((decimal)leg.Quantity).GetOrderLegGroupQuantity(groupOrderManager),\n                groupOrderManager.LimitPrice,\n                DateTime.UtcNow,\n                groupOrderManager,\n                properties: _orderProperties)\n            {\n                Status = OrderStatus.New,\n                PriceCurrency = _strategyUnderlyingSymbolProperties.QuoteCurrency\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/DefaultBrokerageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Additional tests for the base <see cref=\"Brokerage\"/> class\n    /// </summary>\n    public class DefaultBrokerageTests\n    {\n        [TestCase(OrderDirection.Buy, 0, ExpectedResult = OrderPosition.BuyToOpen)]\n        [TestCase(OrderDirection.Buy, 100, ExpectedResult = OrderPosition.BuyToOpen)]\n        [TestCase(OrderDirection.Buy, -100, ExpectedResult = OrderPosition.BuyToClose)]\n        [TestCase(OrderDirection.Sell, 0, ExpectedResult = OrderPosition.SellToOpen)]\n        [TestCase(OrderDirection.Sell, 100, ExpectedResult = OrderPosition.SellToClose)]\n        [TestCase(OrderDirection.Sell, -100, ExpectedResult = OrderPosition.SellToOpen)]\n        public OrderPosition GetsOrderPosition(OrderDirection direction, decimal holdingsQuantity)\n        {\n            return TestableBrokerage.GetOrderPositionPublic(direction, holdingsQuantity);\n        }\n\n        private class TestableBrokerage : Brokerage\n        {\n            public TestableBrokerage(string name) : base(name)\n            {\n            }\n\n            public override bool IsConnected => throw new NotImplementedException();\n\n            public override bool CancelOrder(Order order)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override void Connect()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override void Disconnect()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override List<Holding> GetAccountHoldings()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override List<CashAmount> GetCashBalance()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override List<Order> GetOpenOrders()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override bool PlaceOrder(Order order)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override bool UpdateOrder(Order order)\n            {\n                throw new NotImplementedException();\n            }\n\n            public static OrderPosition GetOrderPositionPublic(OrderDirection direction, decimal holdingsQuantity)\n            {\n                return GetOrderPosition(direction, holdingsQuantity);\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/DowngradeErrorCodeToWarningBrokerageMessageHandlerTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    [TestFixture]\n    public class DowngradeErrorCodeToWarningBrokerageMessageHandlerTests\n    {\n        [Test]\n        [TestCase(BrokerageMessageType.Information)]\n        [TestCase(BrokerageMessageType.Warning)]\n        [TestCase(BrokerageMessageType.Disconnect)]\n        [TestCase(BrokerageMessageType.Reconnect)]\n        public void PatchesNonErrorMessagesToWrappedImplementation(BrokerageMessageType type)\n        {\n            var wrapped = new Mock<IBrokerageMessageHandler>();\n            wrapped.Setup(bmh => bmh.HandleMessage(It.IsAny<BrokerageMessageEvent>())).Verifiable();\n\n            var downgrader = new DowngradeErrorCodeToWarningBrokerageMessageHandler(wrapped.Object, new[] { \"code\" });\n            var message = new BrokerageMessageEvent(type, \"code\", \"message\");\n            downgrader.HandleMessage(message);\n\n            wrapped.Verify(bmh => bmh.HandleMessage(message), Times.Once);\n        }\n\n        [Test]\n        public void PatchesErrorMessageNotMatchingCodeToWrappedImplementation()\n        {\n            var wrapped = new Mock<IBrokerageMessageHandler>();\n            wrapped.Setup(bmh => bmh.HandleMessage(It.IsAny<BrokerageMessageEvent>())).Verifiable();\n\n            var downgrader = new DowngradeErrorCodeToWarningBrokerageMessageHandler(wrapped.Object, new[] { \"code\" });\n            var message = new BrokerageMessageEvent(BrokerageMessageType.Error, \"not-code\", \"message\");\n            downgrader.HandleMessage(message);\n\n            wrapped.Verify(bmh => bmh.HandleMessage(message), Times.Once);\n        }\n\n        [Test]\n        public void RewritesErrorMessageMatchingCodeAsWarning()\n        {\n            var wrapped = new Mock<IBrokerageMessageHandler>();\n            wrapped.Setup(bmh => bmh.HandleMessage(It.IsAny<BrokerageMessageEvent>())).Verifiable();\n\n            var downgrader = new DowngradeErrorCodeToWarningBrokerageMessageHandler(wrapped.Object, new[] { \"code\" });\n            var message = new BrokerageMessageEvent(BrokerageMessageType.Error, \"code\", \"message\");\n            downgrader.HandleMessage(message);\n\n            // verify we converter the message to a warning message w/ the same message and code\n            wrapped.Verify(\n                bmh => bmh.HandleMessage(\n                    It.Is<BrokerageMessageEvent>(\n                        e => e.Type == BrokerageMessageType.Warning\n                            && e.Message == message.Message\n                            && e.Code == message.Code\n                    )\n                ),\n                Times.Once\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Exante/ExanteFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Tests.Brokerages.Exante\n{\n    [TestFixture]\n    public class ExanteFeeModelTests\n    {\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n\n        private static decimal Quantity => 1m;\n        private static Symbol Symbol => Symbols.SPY;\n\n        private static OrderSubmissionData OrderSubmissionData =>\n            new(Security.BidPrice, Security.AskPrice, (Security.BidPrice + Security.AskPrice) / 2);\n\n        private static Security Security\n        {\n            get\n            {\n                var security = new Security(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        Symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        false,\n                        false,\n                        false\n                    ),\n                    new Cash(\"USD\", 0, 1m),\n                    SymbolProperties.GetDefault(\"USD\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n                return security;\n            }\n        }\n\n        [Test]\n        public static void GetFeeModelTest()\n        {\n            var model = new ExanteBrokerageModel();\n            Assert.IsInstanceOf<ExanteFeeModel>(model.GetFeeModel(Security));\n        }\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)\n                { OrderSubmissionData = OrderSubmissionData }),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new OrderProperties())),\n            new TestCaseData(\n                new LimitOrderTestParameters(Symbol, LowPrice, HighPrice,\n                    new OrderProperties()) { OrderSubmissionData = OrderSubmissionData }),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new OrderProperties()))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new OrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice)\n                { OrderSubmissionData = OrderSubmissionData })\n        };\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new ExanteFeeModel();\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                ExanteFeeModel.MarketUsaRate * Math.Abs(Quantity),\n                fee.Value.Amount\n            );\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new ExanteFeeModel();\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                ExanteFeeModel.MarketUsaRate * Math.Abs(Quantity),\n                fee.Value.Amount\n            );\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new ExanteFeeModel();\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                ExanteFeeModel.MarketUsaRate * Math.Abs(Quantity),\n                fee.Value.Amount\n            );\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new ExanteFeeModel();\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                ExanteFeeModel.MarketUsaRate * Math.Abs(Quantity),\n                fee.Value.Amount\n            );\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Kraken/KrakenBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Brokerages.Kraken\n{\n    [TestFixture]\n    public class KrakenBrokerageModelTests\n    {\n        private readonly KrakenBrokerageModel _brokerageModel = new KrakenBrokerageModel(AccountType.Margin);\n        \n        private static TestCaseData[] Symbols => new[]\n        {\n            new TestCaseData(Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Kraken), 5m),\n            new TestCaseData(Symbol.Create(\"USDTUSD\", SecurityType.Crypto, Market.Kraken), 2m),\n            new TestCaseData(Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Kraken), 5m),\n            new TestCaseData(Symbol.Create(\"ADAETH\", SecurityType.Crypto, Market.Kraken), 3m),\n            new TestCaseData(Symbol.Create(\"ADAEUR\", SecurityType.Crypto, Market.Kraken), 3m),\n            new TestCaseData(Symbol.Create(\"XRPBTC\", SecurityType.Crypto, Market.Kraken), 3m),\n            new TestCaseData(Symbol.Create(\"BTCETH\", SecurityType.Crypto, Market.Kraken), 1m), // BTC available only with fiats\n            new TestCaseData(Symbol.Create(\"XRPETH\", SecurityType.Crypto, Market.Kraken), 1m), // XRP not available with ETH\n            new TestCaseData(Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Kraken), 1m), // BTC available only with fiats\n        };\n        \n        \n        [Test]\n        [TestCaseSource(nameof(Symbols))]\n        public void GetLeverageTest(Symbol symbol, decimal expectedLeverage)\n        {\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var leverage = _brokerageModel.GetLeverage(security);\n            \n            Assert.AreEqual(leverage, expectedLeverage, \"Expected leverage doesn't match with returned\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Kraken/KrakenFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Tests.Brokerages.Kraken\n{\n    [TestFixture]\n    public class KrakenFeeModelTests\n    {\n        private static Symbol Symbol => Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Kraken);\n        private static Symbol FiatSymbol => Symbol.Create(\"EURUSD\", SecurityType.Crypto, Market.Kraken);\n        private static Security Security\n        {\n            get\n            {\n                var security = new Security(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        Symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        false,\n                        false,\n                        false\n                    ),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n        \n        private static Security FiatSecurity\n        {\n            get\n            {\n                var security = new Security(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        FiatSymbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        false,\n                        false,\n                        false\n                    ),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n        \n        private static OrderSubmissionData OrderSubmissionData => new OrderSubmissionData(Security.BidPrice, Security.AskPrice, (Security.BidPrice + Security.AskPrice) / 2);\n        private static decimal HighPrice = 1000m;\n        private static decimal LowPrice = 100m;\n        private static decimal Quantity = 1m;\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new KrakenOrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new KrakenOrderProperties() { PostOnly = true}))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new KrakenOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new KrakenOrderProperties()) { OrderSubmissionData = OrderSubmissionData}),\n        };\n        \n        private static TestCaseData[] FiatsOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(FiatSymbol)),\n            new TestCaseData(new MarketOrderTestParameters(FiatSymbol, new KrakenOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(FiatSymbol, LowPrice, HighPrice, new KrakenOrderProperties()) { OrderSubmissionData = OrderSubmissionData}),\n        };\n\n        [Test]\n        public void GetFeeModelTest()\n        {\n            KrakenBrokerageModel model = new KrakenBrokerageModel();\n            Assert.IsInstanceOf<KrakenFeeModel>(model.GetFeeModel(Security));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new KrakenFeeModel();\n\n            Order order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                KrakenFeeModel.MakerTier1CryptoFee * 1 * Math.Abs(Quantity), fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new KrakenFeeModel();\n\n            Order order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee =\n                feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                KrakenFeeModel.TakerTier1CryptoFee * 1 * Math.Abs(Quantity), fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new KrakenFeeModel();\n\n            Order order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee =\n                feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                KrakenFeeModel.MakerTier1CryptoFee * price * Math.Abs(Quantity), fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new KrakenFeeModel();\n\n            Order order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee =\n                feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                KrakenFeeModel.TakerTier1CryptoFee * price * Math.Abs(Quantity), fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n        \n        [Test]\n        [TestCaseSource(nameof(FiatsOrders))]\n        public void ReturnLongFiatCoinFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new KrakenFeeModel();\n\n            Order order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee =\n                feeModel.GetOrderFee(new OrderFeeParameters(FiatSecurity, order));\n\n            Assert.AreEqual(\n                KrakenFeeModel.Tier1FxFee * price * Math.Abs(Quantity), fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n        \n    }\n}\n\n"
  },
  {
    "path": "Tests/Brokerages/LevelOneOrderBook/LevelOneMarketDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages.LevelOneOrderBook;\n\nnamespace QuantConnect.Tests.Brokerages.LevelOneOrderBook\n{\n    [TestFixture]\n    public class LevelOneMarketDataTests\n    {\n        private readonly Symbol _aapl = Symbols.AAPL;\n\n        private readonly DateTime _mockDateTime = new DateTime(2026, 06, 20);\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void LevelOneMarketDataShouldNotRaiseEventWhenTimestampIsInvalid(bool useInvalidTimestamp)\n        {\n            var invalidTimestamp = useInvalidTimestamp ? default(DateTime?) : new DateTime();\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n\n            var eventRaised = default(bool);\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateLastTrade(invalidTimestamp, null, null);\n            levelOneMarketData.UpdateQuote(invalidTimestamp, null, null, null, null);\n            levelOneMarketData.UpdateOpenInterest(invalidTimestamp, null);\n\n            Assert.IsFalse(eventRaised, \"BaseDataReceived should not be raised with invalid timestamp.\");\n        }\n\n        [TestCase(false, null)]\n        [TestCase(true, 0)]\n        [TestCase(true, 100)]\n        public void UpdateOpenInterestShouldRaiseEventBasedOnValuePresence(bool shouldRaiseEvent, decimal? openInterest)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n            var eventRaised = default(bool);\n\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateOpenInterest(_mockDateTime, openInterest);\n\n            Assert.AreEqual(shouldRaiseEvent, eventRaised, $\"Expected event to {(shouldRaiseEvent ? \"\" : \"not \")}be raised for open interest value: {openInterest?.ToStringInvariant() ?? \"null\"}\");\n        }\n\n        [TestCase(false, null, null)]\n        [TestCase(false, 1, null)]\n        [TestCase(true, null, 1)]\n        [TestCase(true, 1, 1)]\n        public void UpdateLastTradeShouldRaiseEventBasedOnPriceAndQuantity(bool shouldRaiseEvent, decimal? lastQuantity, decimal? lastPrice)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n            var eventRaised = default(bool);\n\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateLastTrade(_mockDateTime, lastQuantity, lastPrice);\n\n            Assert.AreEqual(shouldRaiseEvent, eventRaised, $\"Expected event {(shouldRaiseEvent ? \"\" : \"not \")}to be raised for (Qty={lastQuantity}, Price={lastPrice}).\");\n        }\n\n        [TestCase(true, 1, 1, 2, 2)]\n        [TestCase(true, 1, 1, null, 2)]\n        [TestCase(true, 1, 1, 2, null)]\n        [TestCase(false, 1, 1, null, null)]\n        public void UpdateLastTradeShouldTrackLatestTradeCorrectlyOnMultipleUpdates(bool shouldRaiseEvent, decimal? firstLastQuantity, decimal? firstLastPrice, decimal? secondLastQuantity, decimal? secondLastPrice)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n            var eventRaised = default(bool);\n\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateLastTrade(_mockDateTime, firstLastQuantity, firstLastPrice);\n            Assert.IsTrue(eventRaised, \"Expected event to be raised on first update.\");\n            Assert.AreEqual(firstLastQuantity, levelOneMarketData.LastTradeSize, \"First update: unexpected LastTradeSize.\");\n            Assert.AreEqual(firstLastPrice, levelOneMarketData.LastTradePrice, \"First update: unexpected LastTradePrice.\");\n\n            // Reset event flag for second update\n            eventRaised = false;\n\n            levelOneMarketData.UpdateLastTrade(_mockDateTime, secondLastQuantity, secondLastPrice);\n\n            Assert.AreEqual(shouldRaiseEvent, eventRaised, $\"Second update: Expected event {(shouldRaiseEvent ? \"\" : \"not \")}to be raised.\");\n\n            var expectedSize = secondLastQuantity ?? firstLastQuantity;\n            var expectedPrice = secondLastPrice ?? firstLastPrice;\n\n            Assert.AreEqual(expectedSize, levelOneMarketData.LastTradeSize, \"Final LastTradeSize mismatch.\");\n            Assert.AreEqual(expectedPrice, levelOneMarketData.LastTradePrice, \"Final LastTradePrice mismatch.\");\n        }\n\n        [TestCase(false, null, null, null, null)]\n        [TestCase(true, 1, null, 1, null)]\n        [TestCase(true, 1, 0, null, null)]\n        [TestCase(true, null, null, 1, 0)]\n        [TestCase(true, 1, 1, 1, 0)]\n        public void UpdateQuoteShouldRaiseEventBasedOnAskAndBid(bool shouldRaiseEvent, decimal? bidPrice, decimal? bidSize, decimal? askPrice, decimal? askSize)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n            var eventRaised = default(bool);\n\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateQuote(_mockDateTime, bidPrice, bidSize, askPrice, askSize);\n\n            Assert.AreEqual(shouldRaiseEvent, eventRaised);\n        }\n\n        [TestCase(false, 1, 1, 1, 1, null, null, null, null)]\n        [TestCase(false, 1, 1, 1, 1, 1, 1, 1, 1)]\n        [TestCase(true, 1, 1, 1, 1, 2, 2, 2, 2)]\n        public void UpdateQuoteShouldTrackQuoteCorrectlyOnMultipleUpdates(\n            bool shouldRaiseEvent,\n            decimal? firstBidPrice, decimal? firstBidSize, decimal? firstAskPrice, decimal? firstAskSize,\n            decimal? secondBidPrice, decimal? secondBidSize, decimal? secondAskPrice, decimal? secondAskSize)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl);\n            var eventRaised = default(bool);\n\n            levelOneMarketData.BaseDataReceived += (_, e) => eventRaised = true;\n\n            levelOneMarketData.UpdateQuote(_mockDateTime, firstBidPrice, firstBidSize, firstAskPrice, firstAskSize);\n            Assert.IsTrue(eventRaised);\n\n            // Reset event flag for second update\n            eventRaised = false;\n\n            levelOneMarketData.UpdateQuote(_mockDateTime, secondBidPrice, secondBidSize, secondAskPrice, secondAskSize);\n\n            Assert.AreEqual(shouldRaiseEvent, eventRaised, $\"Second update: Expected event {(shouldRaiseEvent ? \"\" : \"not \")}to be raised.\");\n        }\n\n        [TestCase(true, 2, 0, 2, 0)]\n        [TestCase(false, 2, 0, 2, 0)]\n        public void UpdateQuoteShouldIgnoreZeroSizeUpdatesCorrectly(bool ignoreZeroSizeUpdates, decimal? bidPrice, decimal? bidSize, decimal? askPrice, decimal? askSize)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl)\n            {\n                IgnoreZeroSizeUpdates = ignoreZeroSizeUpdates\n            };\n\n            var expectedBestBidSize = 1;\n            var expectedBestAskSize = 1;\n\n            levelOneMarketData.UpdateQuote(_mockDateTime, 1, expectedBestBidSize, 1, expectedBestAskSize);\n\n            levelOneMarketData.UpdateQuote(_mockDateTime, bidPrice, bidSize, askPrice, askSize);\n\n            Assert.AreEqual(bidPrice, levelOneMarketData.BestBidPrice, \"Bid price should update.\");\n            Assert.AreEqual(askPrice, levelOneMarketData.BestAskPrice, \"Ask price should update.\");\n\n            if (ignoreZeroSizeUpdates)\n            {\n                Assert.AreEqual(expectedBestAskSize, levelOneMarketData.BestAskSize, \"Bid size should remain unchanged when ignoring zero size.\");\n                Assert.AreEqual(expectedBestBidSize, levelOneMarketData.BestBidSize, \"Ask size should remain unchanged when ignoring zero size.\");\n            }\n            else\n            {\n                Assert.AreEqual(bidSize, levelOneMarketData.BestAskSize, \"Bid size should be overwritten with 0.\");\n                Assert.AreEqual(askSize, levelOneMarketData.BestBidSize, \"Ask size should be overwritten with 0.\");\n            }\n        }\n\n        [TestCase(true, 0, 2)]\n        [TestCase(false, 0, 2)]\n        public void UpdateLastTradeShouldIgnoreZeroSizeUpdatesCorrectly(bool ignoreZeroSizeUpdates, decimal? lastQuantity, decimal? lastPrice)\n        {\n            var levelOneMarketData = new LevelOneMarketData(_aapl)\n            {\n                IgnoreZeroSizeUpdates = ignoreZeroSizeUpdates\n            };\n\n            var expectedLastQuantity = 1;\n            levelOneMarketData.UpdateLastTrade(_mockDateTime, expectedLastQuantity, 1);\n\n            levelOneMarketData.UpdateLastTrade(_mockDateTime, lastQuantity, lastPrice);\n\n            Assert.AreEqual(lastPrice, levelOneMarketData.LastTradePrice, \"LastTradePrice should update.\");\n\n            if (ignoreZeroSizeUpdates)\n            {\n                Assert.AreEqual(expectedLastQuantity, levelOneMarketData.LastTradeSize);\n            }\n            else\n            {\n                Assert.AreEqual(lastQuantity, levelOneMarketData.LastTradeSize);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/LimitIfTouchedOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class LimitIfTouchedOrderTestParameters : OrderTestParameters\n    {\n        private readonly decimal _highLimit;\n        private readonly decimal _lowLimit;\n\n        public LimitIfTouchedOrderTestParameters(\n            Symbol symbol,\n            decimal highLimit,\n            decimal lowLimit,\n            IOrderProperties properties = null,\n            OrderSubmissionData orderSubmissionData = null\n            )\n            : base(symbol, properties, orderSubmissionData)\n        {\n            _highLimit = highLimit;\n            _lowLimit = lowLimit;\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new LimitIfTouchedOrder(Symbol, -Math.Abs(quantity), _lowLimit, _highLimit, DateTime.UtcNow,\n                properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new LimitIfTouchedOrder(Symbol, Math.Abs(quantity), _highLimit, _lowLimit, DateTime.UtcNow,\n                properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            var roundOffPlaces = GetSymbolProperties(order.Symbol).MinimumPriceVariation.GetDecimalPlaces();\n            var stop = (LimitIfTouchedOrder) order;\n            var previousStop = stop.TriggerPrice;\n            if (order.Quantity > 0)\n            {\n                // for buys we need to decrease the trigger price\n                stop.TriggerPrice = Math.Min(stop.TriggerPrice,\n                    Math.Max(stop.TriggerPrice / 2, Math.Round(lastMarketPrice, roundOffPlaces, MidpointRounding.AwayFromZero)));\n            }\n            else\n            {\n                // for sells we need to increase the trigger price\n                stop.TriggerPrice = Math.Max(stop.TriggerPrice,\n                    Math.Min(stop.TriggerPrice * 2, Math.Round(lastMarketPrice, roundOffPlaces, MidpointRounding.AwayFromZero)));\n            }\n\n            stop.LimitPrice = stop.TriggerPrice;\n            return stop.TriggerPrice != previousStop;\n        }\n\n        // default trigger limit orders will only be submitted, not filled\n        public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        public override bool ExpectedCancellationResult => true;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.LimitIfTouched}: {SecurityType}, {Symbol}\";\n        }\n    }\n    \n    // to be used with brokerages which do not support UpdateOrder\n    public class NonUpdateableLimitIfTouchedOrderTestParameters : LimitIfTouchedOrderTestParameters\n    {\n        public NonUpdateableLimitIfTouchedOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null)\n            : base(symbol, highLimit, lowLimit, properties)\n        {\n        }\n\n        public override bool ModifyUntilFilled => false;\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/LimitOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class LimitOrderTestParameters : OrderTestParameters\n    {\n        private readonly decimal _highLimit;\n        private readonly decimal _lowLimit;\n        private readonly decimal _priceModificationFactor;\n\n        public LimitOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null,\n            OrderSubmissionData orderSubmissionData = null, decimal priceModificationFactor = 1.02m)\n            : base(symbol, properties, orderSubmissionData)\n        {\n            _highLimit = highLimit;\n            _lowLimit = lowLimit;\n            _priceModificationFactor = priceModificationFactor;\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new LimitOrder(Symbol, -Math.Abs(quantity), _highLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new LimitOrder(Symbol, Math.Abs(quantity), _lowLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            \n            var newLimitPrice = CalculateAdjustedLimitPrice(order.Direction, (order as LimitOrder).LimitPrice, lastMarketPrice, _priceModificationFactor);\n\n            var updateFields = new UpdateOrderFields() { LimitPrice = RoundPrice(newLimitPrice, GetSymbolProperties(order.Symbol).MinimumPriceVariation) };\n\n            ApplyUpdateOrderRequest(order, updateFields);\n\n            return true;\n        }\n\n        // default limit orders will only be submitted, not filled\n        public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        public override bool ExpectedCancellationResult => true;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.Limit}: {SecurityType}, {Symbol}\";\n        }\n    }\n\n    // to be used with brokerages which do not support UpdateOrder\n    public class NonUpdateableLimitOrderTestParameters : LimitOrderTestParameters\n    {\n        public NonUpdateableLimitOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null)\n            : base(symbol, highLimit, lowLimit, properties)\n        {\n        }\n\n        public override bool ModifyUntilFilled => false;\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/MarketOnCloseOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Brokerages;\n\n/// <summary>\n/// Represents test parameters for a market-on-close order.\n/// </summary>\npublic class MarketOnCloseOrderTestParameters : MarketOrderTestParameters\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"MarketOnCloseOrderTestParameters\"/> class.\n    /// </summary>\n    /// <param name=\"symbol\">The trading symbol associated with the order.</param>\n    /// <param name=\"properties\">Optional order properties.</param>\n    /// <param name=\"orderSubmissionData\">Optional order submission data.</param>\n    public MarketOnCloseOrderTestParameters(Symbol symbol, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n        : base(symbol, properties, orderSubmissionData)\n    {\n    }\n\n    /// <summary>\n    /// Creates a short market-on-close order.\n    /// </summary>\n    /// <param name=\"quantity\">The quantity to sell (must be a positive value).</param>\n    /// <returns>A new <see cref=\"MarketOnCloseOrder\"/> representing a short order.</returns>\n    public override Order CreateShortOrder(decimal quantity)\n    {\n        return new MarketOnCloseOrder(Symbol, -Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n        {\n            Status = OrderStatus.New,\n            OrderSubmissionData = OrderSubmissionData,\n            PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n        };\n    }\n\n    /// <summary>\n    /// Creates a long market-on-close order.\n    /// </summary>\n    /// <param name=\"quantity\">The quantity to buy (must be a positive value).</param>\n    /// <returns>A new <see cref=\"MarketOnCloseOrder\"/> representing a long order.</returns>\n    public override Order CreateLongOrder(decimal quantity)\n    {\n        return new MarketOnCloseOrder(Symbol, Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n        {\n            Status = OrderStatus.New,\n            OrderSubmissionData = OrderSubmissionData,\n            PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n        };\n    }\n\n    /// <summary>\n    /// Gets the expected status of the market-on-close order during testing.\n    /// </summary>\n    /// <remarks>\n    /// Returns <see cref=\"OrderStatus.Submitted\"/> because this order type is tested \n    /// when the market is open, meaning it remains in the submitted state until market close.\n    /// </remarks>\n    public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n    /// <summary>\n    /// Gets a value indicating whether cancellation is expected for this order type.\n    /// </summary>\n    /// <remarks>\n    /// Always returns <c>true</c> because market-on-close orders can be canceled before execution.\n    /// </remarks>\n    public override bool ExpectedCancellationResult => true;\n\n    public override string ToString()\n    {\n        return $\"{OrderType.MarketOnClose}: {SecurityType}, {Symbol}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/MarketOnOpenOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Brokerages;\n\n/// <summary>\n/// Represents test parameters for a market-on-open order.\n/// </summary>\npublic class MarketOnOpenOrderTestParameters : MarketOrderTestParameters\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"MarketOnOpenOrderTestParameters\"/> class.\n    /// </summary>\n    /// <param name=\"symbol\">The trading symbol associated with the order.</param>\n    /// <param name=\"properties\">Optional order properties.</param>\n    /// <param name=\"orderSubmissionData\">Optional order submission data.</param>\n    public MarketOnOpenOrderTestParameters(Symbol symbol, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n        : base(symbol, properties, orderSubmissionData)\n    {\n    }\n\n    /// <summary>\n    /// Creates a short market-on-open order.\n    /// </summary>\n    /// <param name=\"quantity\">The quantity to sell (must be a positive value).</param>\n    /// <returns>A new <see cref=\"MarketOnOpenOrder\"/> representing a short order.</returns>\n    public override Order CreateShortOrder(decimal quantity)\n    {\n        return new MarketOnOpenOrder(Symbol, -Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n        {\n            Status = OrderStatus.New,\n            OrderSubmissionData = OrderSubmissionData,\n            PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n        };\n    }\n\n    /// <summary>\n    /// Creates a long market-on-open order.\n    /// </summary>\n    /// <param name=\"quantity\">The quantity to buy (must be a positive value).</param>\n    /// <returns>A new <see cref=\"MarketOnOpenOrder\"/> representing a long order.</returns>\n    public override Order CreateLongOrder(decimal quantity)\n    {\n        return new MarketOnOpenOrder(Symbol, Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n        {\n            Status = OrderStatus.New,\n            OrderSubmissionData = OrderSubmissionData,\n            PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n        };\n    }\n\n    /// <summary>\n    /// Gets the expected status of the market-on-open order during testing.\n    /// </summary>\n    /// <remarks>\n    /// Returns <see cref=\"OrderStatus.Submitted\"/> because this order type is tested \n    /// when the market is open, meaning it remains in the submitted state until market open.\n    /// </remarks>\n    public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n    /// <summary>\n    /// Gets a value indicating whether cancellation is expected for this order type.\n    /// </summary>\n    /// <remarks>\n    /// Always returns <c>true</c> because market-on-open orders can be canceled before execution.\n    /// </remarks>\n    public override bool ExpectedCancellationResult => true;\n\n    public override string ToString()\n    {\n        return $\"{OrderType.MarketOnOpen}: {SecurityType}, {Symbol}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/MarketOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class MarketOrderTestParameters : OrderTestParameters\n    {\n        public MarketOrderTestParameters(Symbol symbol, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n            : base(symbol, properties, orderSubmissionData)\n        {\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new MarketOrder(Symbol, -Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new MarketOrder(Symbol, Math.Abs(quantity), DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            // NOP\n            // market orders should fill without modification\n            return false;\n        }\n\n        // all market orders should fill\n        public override OrderStatus ExpectedStatus => OrderStatus.Filled;\n\n        public override bool ExpectedCancellationResult => false;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.Market}: {SecurityType}, {Symbol}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Models/PaperBrokerageWithManualCashBalance.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages.Paper;\n\nnamespace QuantConnect.Tests.Brokerages.Models;\n\n/// <summary>\n/// A customized PaperBrokerage implementation that allows manual control over the cash balance.\n/// </summary>\ninternal class PaperBrokerageWithManualCashBalance : PaperBrokerage\n{\n    private decimal _cashBalance;\n\n    /// <summary>\n    /// Gets the current cash balance.\n    /// </summary>\n    public decimal CashBalance => _cashBalance;\n\n    /// <summary>\n    /// Increases the cash balance by the specified amount.\n    /// </summary>\n    /// <param name=\"amount\">The amount to add to the cash balance.</param>\n    public void IncreaseCashBalance(decimal amount)\n    {\n        _cashBalance += amount;\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"ManualCashBalancePaperBrokerage\"/> class\n    /// with the specified algorithm, job packet, and initial cash balance.\n    /// </summary>\n    /// <param name=\"algorithm\">The algorithm instance.</param>\n    /// <param name=\"job\">The live node job packet.</param>\n    /// <param name=\"initialCashBalance\">The initial cash balance.</param>\n    public PaperBrokerageWithManualCashBalance(IAlgorithm algorithm, LiveNodePacket job, decimal initialCashBalance) : base(algorithm, job)\n    {\n        _cashBalance = initialCashBalance;\n    }\n\n    /// <summary>\n    /// Reduces the cash balance by the specified amount.\n    /// </summary>\n    /// <param name=\"amount\">The amount to subtract from the cash balance.</param>\n    public void DecreaseCashBalance(decimal amount)\n    {\n        _cashBalance -= amount;\n    }\n\n    /// <summary>\n    /// Gets the current cash balances held in the account.\n    /// </summary>\n    /// <returns>A list containing the current cash balance in USD.</returns>\n    public override List<CashAmount> GetCashBalance()\n    {\n        return [new CashAmount(_cashBalance, Currencies.USD)];\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/OrderCrossingBrokerageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\nusing QuantConnect.Brokerages.CrossZero;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    [TestFixture]\n    public class OrderCrossingBrokerageTests\n    {\n        /// <summary>\n        /// Provides a collection of test case data for order scenarios.\n        /// </summary>\n        /// <remarks>\n        /// This property generates test case data for various order statuses, specifically \n        /// for a Stop Market Order on the AAPL symbol.\n        /// </remarks>\n        /// <returns>\n        /// An <see cref=\"IEnumerable{TestCaseData}\"/> containing test cases with a stop market order and an array of order statuses.\n        /// </returns>\n        private static IEnumerable<TestCaseData> OrderParameters\n        {\n            get\n            {\n                var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Filled };\n                yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n            }\n        }\n\n        /// <summary>\n        /// Tests placing an order and updating it, verifying the sequence of order status changes.\n        /// </summary>\n        /// <param name=\"leanOrder\">The order to be placed and updated.</param>\n        /// <param name=\"expectedOrderStatusChangedOrdering\">The expected sequence of order status changes.</param>\n        [Test, TestCaseSource(nameof(OrderParameters))]\n        public void PlaceCrossOrder(Order leanOrder, OrderStatus[] expectedOrderStatusChangedOrdering)\n        {\n            var actualCrossZeroOrderStatusOrdering = new Queue<OrderStatus>();\n            using var autoResetEventPartialFilledStatus = new AutoResetEvent(false);\n            using var autoResetEventFilledStatus = new AutoResetEvent(false);\n\n            using var brokerage = InitializeBrokerage((leanOrder?.Symbol.Value, 180m, 10));\n\n            brokerage.OrdersStatusChanged += (_, orderEvents) =>\n            {\n                var orderEventStatus = orderEvents[0].Status;\n\n                actualCrossZeroOrderStatusOrdering.Enqueue(orderEventStatus);\n\n                Log.Trace($\"{nameof(PlaceCrossOrder)}.OrdersStatusChangedEvent.Status: {orderEventStatus}\");\n\n                if (orderEventStatus == OrderStatus.PartiallyFilled)\n                {\n                    autoResetEventPartialFilledStatus.Set();\n                }\n\n                if (orderEventStatus == OrderStatus.Filled)\n                {\n                    autoResetEventFilledStatus.Set();\n                }\n            };\n\n            var response = brokerage.PlaceOrder(leanOrder);\n\n            Assert.IsTrue(response);\n\n            AssertComingOrderStatusByEvent(autoResetEventPartialFilledStatus, brokerage, OrderStatus.PartiallyFilled);\n\n            AssertComingOrderStatusByEvent(autoResetEventFilledStatus, brokerage, OrderStatus.Filled);\n\n            CollectionAssert.AreEquivalent(expectedOrderStatusChangedOrdering, actualCrossZeroOrderStatusOrdering);\n            Assert.AreEqual(0, brokerage.GetLeanOrderByZeroCrossBrokerageOrderIdCount());\n        }\n\n        /// <summary>\n        /// Provides a collection of test case data for order update scenarios.\n        /// </summary>\n        /// <remarks>\n        /// This property generates test case data for various order statuses, specifically \n        /// for a Stop Market Order on the AAPL symbol.\n        /// </remarks>\n        /// <returns>\n        /// An <see cref=\"IEnumerable{TestCaseData}\"/> containing test cases with a stop market order and an array of order statuses.\n        /// </returns>\n        private static IEnumerable<TestCaseData> OrderUpdateParameters\n        {\n            get\n            {\n                var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.UpdateSubmitted, OrderStatus.Filled };\n                yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n            }\n        }\n\n        /// <summary>\n        /// Tests placing an order and updating it, verifying the sequence of order status changes.\n        /// </summary>\n        /// <param name=\"leanOrder\">The order to be placed and updated.</param>\n        /// <param name=\"expectedOrderStatusChangedOrdering\">The expected sequence of order status changes.</param>\n        [Test, TestCaseSource(nameof(OrderUpdateParameters))]\n        public void PlaceCrossOrderAndUpdate(Order leanOrder, OrderStatus[] expectedOrderStatusChangedOrdering)\n        {\n            var actualCrossZeroOrderStatusOrdering = new Queue<OrderStatus>();\n            using var autoResetEventPartialFilledStatus = new AutoResetEvent(false);\n            using var autoResetEventUpdateSubmittedStatus = new AutoResetEvent(false);\n            using var autoResetEventFilledStatus = new AutoResetEvent(false);\n\n            using var brokerage = InitializeBrokerage((leanOrder?.Symbol.Value, 180m, 10));\n\n            brokerage.OrdersStatusChanged += (_, orderEvents) =>\n            {\n                var orderEventStatus = orderEvents[0].Status;\n\n                actualCrossZeroOrderStatusOrdering.Enqueue(orderEventStatus);\n\n                Log.Trace($\"{nameof(PlaceCrossOrder)}.OrdersStatusChangedEvent.Status: {orderEventStatus}\");\n\n                if (orderEventStatus == OrderStatus.PartiallyFilled)\n                {\n                    autoResetEventPartialFilledStatus.Set();\n                }\n\n                if (orderEventStatus == OrderStatus.UpdateSubmitted)\n                {\n                    autoResetEventUpdateSubmittedStatus.Set();\n                }\n\n                if (orderEventStatus == OrderStatus.Filled)\n                {\n                    autoResetEventFilledStatus.Set();\n                }\n            };\n\n            var response = brokerage.PlaceOrder(leanOrder);\n            Assert.IsTrue(response);\n\n            AssertComingOrderStatusByEvent(autoResetEventPartialFilledStatus, brokerage, OrderStatus.PartiallyFilled);\n\n            var updateResponse = brokerage.UpdateOrder(leanOrder);\n            Assert.IsTrue(updateResponse);\n\n            AssertComingOrderStatusByEvent(autoResetEventUpdateSubmittedStatus, brokerage, OrderStatus.UpdateSubmitted);\n\n            AssertComingOrderStatusByEvent(autoResetEventFilledStatus, brokerage, OrderStatus.Filled);\n\n            CollectionAssert.AreEquivalent(expectedOrderStatusChangedOrdering, actualCrossZeroOrderStatusOrdering);\n            Assert.AreEqual(0, brokerage.GetLeanOrderByZeroCrossBrokerageOrderIdCount());\n        }\n\n        private static IEnumerable<TestCaseData> CrossZeroInvalidFirstPartParameters\n        {\n            get\n            {\n                var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.Invalid };\n                yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n            }\n        }\n\n        [Test, TestCaseSource(nameof(CrossZeroInvalidFirstPartParameters))]\n        public void PlaceCrossOrderInvalid(Order leanOrder, OrderStatus[] expectedOrderStatusChangedOrdering)\n        {\n            var actualCrossZeroOrderStatusOrdering = new Queue<OrderStatus>();\n            using var autoResetEventInvalidStatus = new AutoResetEvent(false);\n\n            using var brokerage = InitializeBrokerage((leanOrder?.Symbol.Value, 180m, 10));\n\n            brokerage.OrdersStatusChanged += (_, orderEvents) =>\n            {\n                var orderEventStatus = orderEvents[0].Status;\n\n                actualCrossZeroOrderStatusOrdering.Enqueue(orderEventStatus);\n\n                Log.Trace($\"{nameof(PlaceCrossOrder)}.OrdersStatusChangedEvent.Status: {orderEventStatus}\");\n\n                if (orderEventStatus == OrderStatus.Invalid)\n                {\n                    autoResetEventInvalidStatus.Set();\n                }\n            };\n\n            brokerage.IsPlaceOrderPhonyBrokerageFirstPartSuccessfully = false;\n            brokerage.IsPlaceOrderPhonyBrokerageSecondPartSuccessfully = false;\n\n            var response = brokerage.PlaceOrder(leanOrder);\n            Assert.IsFalse(response);\n\n            AssertComingOrderStatusByEvent(autoResetEventInvalidStatus, brokerage, OrderStatus.Invalid);\n\n            CollectionAssert.AreEquivalent(expectedOrderStatusChangedOrdering, actualCrossZeroOrderStatusOrdering);\n            Assert.AreEqual(0, brokerage.GetLeanOrderByZeroCrossBrokerageOrderIdCount());\n        }\n\n        private static IEnumerable<TestCaseData> OrderCrossZeroSecondPartParameters\n        {\n            get\n            {\n                var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Canceled };\n                yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n                yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);\n            }\n        }\n\n        [Test, TestCaseSource(nameof(OrderCrossZeroSecondPartParameters))]\n        public void PlaceCrossZeroSecondPartInvalid(Order leanOrder, OrderStatus[] expectedOrderStatusChangedOrdering)\n        {\n            var actualCrossZeroOrderStatusOrdering = new Queue<OrderStatus>();\n            using var autoResetEventInvalidStatus = new AutoResetEvent(false);\n\n            using var brokerage = InitializeBrokerage((leanOrder?.Symbol.Value, 180m, 10));\n\n            var skipFirstFilledEvent = default(bool);\n            brokerage.OrdersStatusChanged += (_, orderEvents) =>\n            {\n                var orderEventStatus = orderEvents[0].Status;\n\n                // Skip processing the first occurrence of the Filled event, The First Part of CrossZeroOrder was filled.\n                if (!skipFirstFilledEvent && orderEventStatus == OrderStatus.Filled)\n                {\n                    skipFirstFilledEvent = true;\n                    return;\n                }\n\n                actualCrossZeroOrderStatusOrdering.Enqueue(orderEventStatus);\n\n                Log.Trace($\"{nameof(PlaceCrossOrder)}.OrdersStatusChangedEvent.Status: {orderEventStatus}\");\n\n                if (orderEventStatus == OrderStatus.Canceled)\n                {\n                    autoResetEventInvalidStatus.Set();\n                }\n            };\n\n            brokerage.IsPlaceOrderPhonyBrokerageFirstPartSuccessfully = true;\n            brokerage.IsPlaceOrderPhonyBrokerageSecondPartSuccessfully = false;\n\n            var response = brokerage.PlaceOrder(leanOrder);\n            Assert.IsTrue(response);\n\n            AssertComingOrderStatusByEvent(autoResetEventInvalidStatus, brokerage, OrderStatus.Canceled);\n\n            CollectionAssert.AreEquivalent(expectedOrderStatusChangedOrdering, actualCrossZeroOrderStatusOrdering);\n            Assert.AreEqual(0, brokerage.GetLeanOrderByZeroCrossBrokerageOrderIdCount());\n        }\n\n        /// <summary>\n        /// Create instance of Phony brokerage.\n        /// </summary>\n        /// <param name=\"equityQuantity\">(\"AAPL\", 190m, 10)</param>\n        /// <returns>The instance of Phony Brokerage</returns>\n        private static PhonyBrokerage InitializeBrokerage(params (string ticker, decimal averagePrice, decimal quantity)[] equityQuantity)\n        {\n            var algorithm = new AlgorithmStub();\n            foreach (var (symbol, averagePrice, quantity) in equityQuantity)\n            {\n                algorithm.AddEquity(symbol).Holdings.SetHoldings(averagePrice, quantity);\n            }\n\n            var brokerage = new PhonyBrokerage(\"Phony\", algorithm);\n\n            AssertThatHoldingIsNotEmpty(brokerage);\n\n            return brokerage;\n        }\n\n        /// <summary>\n        /// Asserts that the brokerage account holdings are not empty and that the first holding has a positive quantity.\n        /// </summary>\n        /// <param name=\"brokerage\">The brokerage instance to check the account holdings.</param>\n        /// <exception cref=\"AssertionException\">\n        /// Thrown if the account holdings are empty or the first holding has a non-positive quantity.\n        /// </exception>\n        private static void AssertThatHoldingIsNotEmpty(IBrokerage brokerage)\n        {\n            var holdings = brokerage.GetAccountHoldings();\n            Assert.Greater(holdings.Count, 0);\n            Assert.Greater(holdings[0].Quantity, 0);\n        }\n\n        /// <summary>\n        /// Asserts that an order with the specified status has arrived by waiting for an event signal.\n        /// </summary>\n        /// <param name=\"resetEvent\">The event to wait on, which signals that an order status update has occurred.</param>\n        /// <param name=\"brokerage\">The phony brokerage instance used to check the order status.</param>\n        /// <param name=\"comingOrderStatus\">The expected status of the coming order to assert.</param>\n        /// <exception cref=\"InvalidOperationException\">\n        /// Thrown if there is not exactly one order with the specified status.\n        /// </exception>\n        private static void AssertComingOrderStatusByEvent(AutoResetEvent resetEvent, PhonyBrokerage brokerage, OrderStatus comingOrderStatus)\n        {\n            Assert.True(resetEvent.WaitOne(TimeSpan.FromSeconds(5)));\n            var partialFilledOrder = brokerage.GetAllOrders(o => o.Status == comingOrderStatus).Single();\n            Assert.IsNotNull(partialFilledOrder);\n        }\n\n        private class PhonyBrokerage : Brokerage\n        {\n            /// <inheritdoc cref=\"IAlgorithm\"/>\n            private readonly IAlgorithm _algorithm;\n\n            /// <inheritdoc cref=\"ISecurityProvider\"/>\n            private readonly ISecurityProvider _securityProvider;\n\n            /// <inheritdoc cref=\"CustomOrderProvider\"/>\n            private readonly CustomOrderProvider _orderProvider;\n\n            /// <inheritdoc cref=\"CancellationTokenSource\"/>\n            private readonly CancellationTokenSource _cancellationTokenSource = new();\n\n            /// <summary>\n            /// Temporarily stores the IDs of brokerage orders for testing purposes.\n            /// </summary>\n            private List<string> _tempBrokerageOrderIds = new();\n\n            /// <summary>\n            /// This field indicates whether the order has been placed successfully with a phony brokerage during testing.\n            /// </summary>\n            /// <remarks>\n            /// The default value is <c>true</c>. This is used specifically for testing purposes to simulate the successful placement of an order.\n            /// </remarks>\n            public bool IsPlaceOrderPhonyBrokerageFirstPartSuccessfully { get; set; } = true;\n\n            /// <summary>\n            /// This field indicates whether the second part of the order has been placed successfully with a phony brokerage during testing.\n            /// </summary>\n            /// <remarks>\n            /// The default value is <c>true</c>. This is used specifically for testing purposes to simulate the successful placement of the second part of an order.\n            /// </remarks>\n            public bool IsPlaceOrderPhonyBrokerageSecondPartSuccessfully { get; set; } = true;\n\n            public override bool IsConnected => true;\n\n            public PhonyBrokerage(string name, IAlgorithm algorithm) : base(name)\n            {\n                _algorithm = algorithm;\n                _orderProvider = new CustomOrderProvider();\n                _securityProvider = algorithm.Portfolio;\n\n                OrdersStatusChanged += OrdersStatusChangedEventHandler;\n                ImitationBrokerageOrderUpdates();\n            }\n\n            private void OrdersStatusChangedEventHandler(object _, List<OrderEvent> orderEvents)\n            {\n                var orderEvent = orderEvents[0];\n\n                var brokerageOrderId = _tempBrokerageOrderIds.Last();\n\n                if (!TryGetOrRemoveCrossZeroOrder(brokerageOrderId, orderEvent.Status, out var leanOrder))\n                {\n                    leanOrder = _orderProvider.GetOrderById(orderEvent.OrderId);\n                }\n\n                if (!TryHandleRemainingCrossZeroOrder(leanOrder, orderEvent))\n                {\n                    _orderProvider.UpdateOrderStatusById(orderEvent.OrderId, orderEvent.Status);\n                }\n            }\n\n            public IEnumerable<Order> GetAllOrders(Func<Order, bool> filter)\n            {\n                return _orderProvider.GetOrders(filter);\n            }\n\n\n            public override bool CancelOrder(Order order)\n            {\n                OnOrderEvent(new OrderEvent(order, new DateTime(2024, 6, 10), OrderFee.Zero, \"CancelOrder\") { Status = OrderStatus.Canceled });\n                return true;\n            }\n\n            public override void Connect()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override void Disconnect()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override List<Holding> GetAccountHoldings()\n            {\n                return base.GetAccountHoldings(null, _algorithm.Securities.Values);\n            }\n\n            public override List<CashAmount> GetCashBalance()\n            {\n                throw new NotImplementedException();\n            }\n\n            public override List<Order> GetOpenOrders()\n            {\n                throw new NotImplementedException();\n            }\n\n            /// <summary>\n            /// Gets the count of Lean orders indexed by ZeroCross brokerage order ID.\n            /// </summary>\n            /// <returns>\n            /// The number of Lean orders that are indexed by ZeroCross brokerage order ID.\n            /// </returns>\n            public int GetLeanOrderByZeroCrossBrokerageOrderIdCount()\n            {\n                return LeanOrderByZeroCrossBrokerageOrderId.Count;\n            }\n\n            public override bool PlaceOrder(Order order)\n            {\n                // For testing purposes only: Adds the specified order to the order provider.\n                _orderProvider.Add(order);\n\n                var holdingQuantity = _securityProvider.GetHoldingsQuantity(order.Symbol);\n\n                var isPlaceCrossOrder = TryCrossZeroPositionOrder(order, holdingQuantity);\n\n                // Alert: This test covers only CrossZeroOrdering scenarios.\n                // If isPlaceCrossOrder is null, it indicates failure to place a cross order.\n                // Please ensure your account has sufficient securities and try again.\n                if (isPlaceCrossOrder == null)\n                {\n                    Assert.Fail(\"Unable to place a cross order. Please ensure your account holds the necessary securities and try again.\");\n                }\n\n                return isPlaceCrossOrder.Value;\n            }\n\n            /// <summary>\n            /// Places a cross-zero order with the PhonyBrokerage.\n            /// </summary>\n            /// <param name=\"crossZeroOrderRequest\">The cross-zero order request.</param>\n            /// <param name=\"isPlaceOrderWithoutLeanEvent\">Flag indicating whether to place the order without Lean event.</param>\n            /// <returns>\n            /// A <see cref=\"CrossZeroOrderResponse\"/> containing the result of placing the order.\n            /// </returns>\n            protected override CrossZeroOrderResponse PlaceCrossZeroOrder(CrossZeroFirstOrderRequest crossZeroOrderRequest, bool isPlaceOrderWithoutLeanEvent)\n            {\n                Log.Trace($\"{nameof(PhonyBrokerage)}.{nameof(PlaceCrossZeroOrder)}\");\n\n                // Step 1: Create order request under the hood of any brokerage\n                var brokeragePhonyParameterRequest = new PhonyPlaceOrderRequest(crossZeroOrderRequest.LeanOrder.Symbol.Value, crossZeroOrderRequest.OrderQuantity,\n                    crossZeroOrderRequest.LeanOrder.Direction, 0m, crossZeroOrderRequest.OrderType);\n\n                // Step 2: Place the order request, paying attention to the flag 'isPlaceOrderWithoutLeanEvent'\n                var response = PlaceOrderPhonyBrokerage(crossZeroOrderRequest.LeanOrder, isPlaceOrderWithoutLeanEvent, brokeragePhonyParameterRequest);\n\n                // Step 3: Return the result of placing the order\n                return new CrossZeroOrderResponse(response.OrderId, response.IsOrderPlacedSuccessfully, response.Message);\n            }\n\n            /// <summary>\n            /// Places an order with the PhonyBrokerage.\n            /// </summary>\n            /// <param name=\"originalLeanOrder\">The original Lean order.</param>\n            /// <param name=\"isSubmittedEvent\">Flag indicating whether to trigger the order submitted event.</param>\n            /// <param name=\"orderRequest\">The order request parameters.</param>\n            /// <returns>\n            /// A <see cref=\"PhonyPlaceOrderResponse\"/> containing the result of placing the order.\n            /// </returns>\n            private PhonyPlaceOrderResponse PlaceOrderPhonyBrokerage(Order originalLeanOrder, bool isSubmittedEvent = true, PhonyPlaceOrderRequest orderRequest = default)\n            {\n                var newOrderId = Guid.NewGuid().ToString();\n                _tempBrokerageOrderIds.Add(newOrderId);\n\n                if (isSubmittedEvent)\n                {\n                    OnOrderEvent(new OrderEvent(originalLeanOrder, new DateTime(2024, 6, 10), OrderFee.Zero) { Status = OrderStatus.Submitted });\n                }\n\n                if (IsPlaceOrderPhonyBrokerageFirstPartSuccessfully)\n                {\n                    IsPlaceOrderPhonyBrokerageFirstPartSuccessfully = false;\n\n                    return new PhonyPlaceOrderResponse(newOrderId, true);\n                }\n\n                if (IsPlaceOrderPhonyBrokerageSecondPartSuccessfully)\n                {\n                    return new PhonyPlaceOrderResponse(newOrderId, true);\n                }\n\n                return new PhonyPlaceOrderResponse(newOrderId, false, \"Something was wrong\");\n            }\n\n            public override void Dispose()\n            {\n                _cancellationTokenSource.Dispose();\n                base.Dispose();\n            }\n\n            public override bool UpdateOrder(Order order)\n            {\n                OnOrderEvent(new OrderEvent(order, new DateTime(2024, 6, 10), OrderFee.Zero, $\"{nameof(PhonyBrokerage)} Order Event\")\n                {\n                    Status = OrderStatus.UpdateSubmitted\n                });\n                return true;\n            }\n\n            /// <summary>\n            /// Simulates a brokerage sending order update events at regular intervals.\n            /// </summary>\n            /// <remarks>\n            /// This method starts a new long-running task that periodically checks for open orders\n            /// and updates their status. Specifically, it transitions orders with statuses \n            /// <see cref=\"OrderStatus.Submitted\"/> or <see cref=\"OrderStatus.PartiallyFilled\"/> \n            /// to <see cref=\"OrderStatus.Filled\"/> after a fixed delay.\n            /// </remarks>\n            /// <example>\n            /// <code>\n            /// // Example usage\n            /// var brokerage = new Brokerage();\n            /// brokerage.ImitationBrokerageOrderUpdates();\n            /// </code>\n            /// </example>\n            /// <exception cref=\"OperationCanceledException\">\n            /// Thrown if the operation is canceled via the cancellation token.\n            /// </exception>\n            private void ImitationBrokerageOrderUpdates()\n            {\n                Task.Factory.StartNew(() =>\n                {\n                    while (!_cancellationTokenSource.IsCancellationRequested)\n                    {\n                        _cancellationTokenSource.Token.WaitHandle.WaitOne(TimeSpan.FromSeconds(3));\n                        var orders = _orderProvider.GetOpenOrders();\n                        foreach (var order in orders)\n                        {\n                            if (order.Status == OrderStatus.Submitted || order.Status == OrderStatus.PartiallyFilled || order.Status == OrderStatus.UpdateSubmitted)\n                            {\n                                var orderEvent = new OrderEvent(order, new DateTime(2024, 6, 10), OrderFee.Zero) { Status = OrderStatus.Filled };\n                                if (!TryHandleRemainingCrossZeroOrder(order, orderEvent))\n                                {\n                                    OnOrderEvent(orderEvent);\n                                }\n                            }\n                        }\n                    }\n                }, _cancellationTokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);\n            }\n\n            /// <summary>\n            /// Represents a request to place an order in the Phony Brokerage system.\n            /// </summary>\n            private protected readonly struct PhonyPlaceOrderRequest\n            {\n                /// <summary>\n                /// Gets the symbol for the order.\n                /// </summary>\n                public string Symbol { get; }\n\n                /// <summary>\n                /// Gets the quantity for the order.\n                /// </summary>\n                public decimal Quantity { get; }\n\n                /// <summary>\n                /// Gets the direction of the order.\n                /// </summary>\n                public OrderPosition Direction { get; }\n\n                /// <summary>\n                /// Gets the custom brokerage order type.\n                /// </summary>\n                public OrderType CustomBrokerageOrderType { get; }\n\n                /// <summary>\n                /// Initializes a new instance of the <see cref=\"PhonyPlaceOrderRequest\"/> struct.\n                /// </summary>\n                /// <param name=\"symbol\">The symbol for the order.</param>\n                /// <param name=\"quantity\">The quantity for the order.</param>\n                /// <param name=\"orderDirection\">The direction of the order.</param>\n                /// <param name=\"holdingQuantity\">The quantity currently held.</param>\n                /// <param name=\"leanOrderType\">The type of the order.</param>\n                public PhonyPlaceOrderRequest(string symbol, decimal quantity, OrderDirection orderDirection, decimal holdingQuantity, OrderType leanOrderType)\n                {\n                    Symbol = symbol;\n                    Quantity = quantity;\n                    Direction = GetOrderPosition(orderDirection, holdingQuantity);\n                    CustomBrokerageOrderType = leanOrderType;\n                }\n            }\n\n            /// <summary>\n            /// Represents a response from placing an order in the Phony Brokerage system.\n            /// </summary>\n            private protected readonly struct PhonyPlaceOrderResponse\n            {\n                /// <summary>\n                /// Gets the unique identifier for the placed order.\n                /// </summary>\n                public string OrderId { get; }\n\n                /// <summary>\n                /// Gets a value indicating whether the order was placed successfully.\n                /// </summary>\n                public bool IsOrderPlacedSuccessfully { get; }\n\n                /// <summary>\n                /// Gets the message associated with the order response.\n                /// </summary>\n                public string Message { get; }\n\n                /// <summary>\n                /// Initializes a new instance of the <see cref=\"PhonyPlaceOrderResponse\"/> struct.\n                /// </summary>\n                /// <param name=\"orderId\">The unique identifier for the placed order.</param>\n                /// <param name=\"isOrderPlacedSuccessfully\">A value indicating whether the order was placed successfully.</param>\n                /// <param name=\"message\">The message associated with the order response. This parameter is optional and defaults to <c>null</c>.</param>\n                public PhonyPlaceOrderResponse(string orderId, bool isOrderPlacedSuccessfully, string message = null)\n                {\n                    OrderId = orderId;\n                    IsOrderPlacedSuccessfully = isOrderPlacedSuccessfully;\n                    Message = message;\n                }\n            }\n        }\n\n        /// <inheritdoc cref=\"OrderProvider\"/>\n        private protected class CustomOrderProvider : OrderProvider\n        {\n            public void UpdateOrderStatusById(int orderId, OrderStatus newOrderStatus)\n            {\n                var order = _orders.First(x => x.Id == orderId);\n                order.Status = newOrderStatus;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/OrderProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Provides a test implementation of order mapping\n    /// </summary>\n    public class OrderProvider : IOrderProvider\n    {\n        private int _orderId;\n        private int _groupOrderManagerId;\n        private protected readonly IList<Order> _orders;\n        private readonly object _lock = new object();\n\n        public OrderProvider(IList<Order> orders)\n        {\n            _orders = orders;\n        }\n\n        public OrderProvider()\n        {\n            _orders = new List<Order>();\n        }\n\n        public void Add(Order order)\n        {\n            order.Id = Interlocked.Increment(ref _orderId);\n\n            if (order.GroupOrderManager != null && order.GroupOrderManager.Id == 0)\n            {\n                order.GroupOrderManager.Id = Interlocked.Increment(ref _groupOrderManagerId);\n            }\n\n            lock (_lock)\n            {\n                _orders.Add(order);\n            }\n        }\n\n        public int OrdersCount => _orders.Count;\n\n        public Order GetOrderById(int orderId)\n        {\n            Order order;\n            lock (_lock)\n            {\n                order = _orders.FirstOrDefault(x => x.Id == orderId);\n            }\n\n            return order;\n        }\n\n        public List<Order> GetOrdersByBrokerageId(string brokerageId)\n        {\n            lock (_lock)\n            {\n                return _orders.Where(o => o.BrokerId.Contains(brokerageId)).Select(o => o.Clone()).ToList();\n            }\n        }\n\n        public IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            throw new NotImplementedException(\"This method has not been implemented\");\n        }\n\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            throw new NotImplementedException();\n        }\n\n        public OrderTicket GetOrderTicket(int orderId)\n        {\n            throw new NotImplementedException(\"This method has not been implemented\");\n        }\n\n        public IEnumerable<Order> GetOrders(Func<Order, bool> filter)\n        {\n            return _orders.Where(filter).Select(x => x.Clone());\n        }\n\n        public List<Order> GetOpenOrders(Func<Order, bool> filter = null)\n        {\n            return _orders.Where(x => x.Status.IsOpen() && (filter == null || filter(x))).Select(x => x.Clone()).ToList();\n        }\n\n        /// <summary>\n        /// Brokerage order id change is applied to the target order\n        /// </summary>\n        internal void HandlerBrokerageOrderIdChangedEvent(BrokerageOrderIdChangedEvent brokerageOrderIdChangedEvent)\n        {\n            lock (_lock)\n            {\n                var originalOrder = _orders.FirstOrDefault(x => x.Id == brokerageOrderIdChangedEvent.OrderId);\n\n                if (originalOrder == null)\n                {\n                    // shouldn't happen but let's be careful\n                    Log.Error($\"OrderProvider.HandlerBrokerageOrderIdChangedEvent(): Lean order id {brokerageOrderIdChangedEvent.OrderId} not found\");\n                    return;\n                }\n\n                originalOrder.BrokerId = brokerageOrderIdChangedEvent.BrokerId;\n            }\n        }\n\n        public ProjectedHoldings GetProjectedHoldings(Security security)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/OrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Helper class to abstract test cases from individual order types\n    /// </summary>\n    public abstract class OrderTestParameters : BaseOrderTestParameters\n    {\n        public Symbol Symbol { get; private set; }\n        public SecurityType SecurityType { get; private set; }\n        public IOrderProperties Properties { get; private set; }\n        public OrderSubmissionData OrderSubmissionData { get; internal set; }\n        public SymbolPropertiesDatabase SPDB { get; internal set; }\n\n        protected OrderTestParameters(Symbol symbol, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n        {\n            Symbol = symbol;\n            SecurityType = symbol.ID.SecurityType;\n            Properties = properties;\n            OrderSubmissionData = orderSubmissionData;\n            SPDB = SymbolPropertiesDatabase.FromDataFolder();\n        }\n\n        public MarketOrder CreateLongMarketOrder(decimal quantity)\n        {\n            return new MarketOrder(Symbol, Math.Abs(quantity), DateTime.Now, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n        public MarketOrder CreateShortMarketOrder(decimal quantity)\n        {\n            return new MarketOrder(Symbol, -Math.Abs(quantity), DateTime.Now, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        /// <summary>\n        /// Creates a sell order of this type\n        /// </summary>\n        public abstract Order CreateShortOrder(decimal quantity);\n        /// <summary>\n        /// Creates a long order of this type\n        /// </summary>\n        public abstract Order CreateLongOrder(decimal quantity);\n        /// <summary>\n        /// Modifies the order so it is more likely to fill\n        /// </summary>\n        public abstract bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice);\n        /// <summary>\n        /// The status to expect when submitting this order, typically just Submitted,\n        /// unless market order, then Filled\n        /// </summary>\n        public abstract OrderStatus ExpectedStatus { get; }\n        /// <summary>\n        /// The status to expect when cancelling this order\n        /// </summary>\n        public abstract bool ExpectedCancellationResult { get; }\n\n        /// <summary>\n        /// True to continue modifying the order until it is filled, false otherwise\n        /// </summary>\n        public virtual bool ModifyUntilFilled => true;\n\n        protected SymbolProperties GetSymbolProperties(Symbol symbol)\n        {\n            return SPDB.GetSymbolProperties(symbol.ID.Market, symbol, SecurityType, Currencies.USD);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Paper/PaperBrokerageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Brokerages.Models;\nusing QuantConnect.Brokerages.Paper;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Messaging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\nusing QuantConnect.Brokerages.Backtesting;\n\nnamespace QuantConnect.Tests.Brokerages.Paper\n{\n    [TestFixture]\n    public class PaperBrokerageTests\n    {\n        [Test]\n        public void AppliesDividendDistributionDirectlyToPortfolioCashBook()\n        {\n            // init algorithm\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.AddSecurities(equities: new List<string> { \"SPY\" });\n            algorithm.PostInitialize();\n\n            // init holdings\n            var SPY = algorithm.Securities[Symbols.SPY];\n            SPY.SetMarketPrice(new Tick { Value = 100m });\n            SPY.Holdings.SetHoldings(100m, 1000);\n\n            // resolve expected outcome\n            var USD = algorithm.Portfolio.CashBook[Currencies.USD];\n            var preDistributionCash = USD.Amount;\n            var distributionPerShare = 10m;\n            var expectedTotalDistribution = distributionPerShare * SPY.Holdings.Quantity;\n\n            // create slice w/ dividend\n            var slice = new Slice(algorithm.Time, new List<BaseData>(), algorithm.Time);\n            slice.Dividends.Add(new Dividend(Symbols.SPY, algorithm.Time, distributionPerShare, 100m));\n            algorithm.SetCurrentSlice(slice);\n\n            // invoke brokerage\n            using var brokerage = new PaperBrokerage(algorithm, null);\n            brokerage.Scan();\n\n            // verify results\n            var postDistributionCash = USD.Amount;\n            Assert.AreEqual(preDistributionCash + expectedTotalDistribution, postDistributionCash);\n        }\n\n        [Test]\n        public void AppliesDividendsOnce()\n        {\n            // init algorithm\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.SetLiveMode(true);\n            var dividend = new Dividend(Symbols.SPY, DateTime.UtcNow, 10m, 100m);\n\n            var feed = new MockDataFeed();\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(feed,\n                new UniverseSelection(\n                    algorithm,\n                    new SecurityService(algorithm.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDataBase, algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(algorithm.Portfolio), algorithm: algorithm),\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                true,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            var synchronizer = new NullSynchronizer(algorithm, dividend);\n\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            algorithm.AddSecurities(equities: new List<string> { \"SPY\" });\n            algorithm.Securities[Symbols.SPY].Holdings.SetHoldings(100m, 1);\n            algorithm.PostInitialize();\n\n            var initializedCash = algorithm.Portfolio.CashBook[Currencies.USD].Amount;\n\n            // init algorithm manager\n            var manager = new AlgorithmManager(true);\n            var job = new LiveNodePacket\n            {\n                UserId = 1,\n                ProjectId = 2,\n                DeployId = $\"{nameof(PaperBrokerageTests)}.{nameof(AppliesDividendsOnce)}\"\n            };\n            var results = new LiveTradingResultHandler();\n            var transactions = new BacktestingTransactionHandler();\n            using var brokerage = new PaperBrokerage(algorithm, job);\n\n            // initialize results and transactions\n            using var eventMessagingHandler = new EventMessagingHandler();\n            using var api = new Api.Api();\n            results.Initialize(new(job, eventMessagingHandler, api, transactions, null));\n            results.SetAlgorithm(algorithm, algorithm.Portfolio.TotalPortfolioValue);\n            transactions.Initialize(algorithm, brokerage, results);\n            var realTime = new BacktestingRealTimeHandler();\n\n            try\n            {\n                using var nullLeanManager = new AlgorithmManagerTests.NullLeanManager();\n\n                using var tokenSource = new CancellationTokenSource();\n                // run algorithm manager\n                manager.Run(job,\n                    algorithm,\n                    synchronizer,\n                    transactions,\n                    results,\n                    realTime,\n                    nullLeanManager,\n                    tokenSource,\n                    new()\n                );\n\n                var postDividendCash = algorithm.Portfolio.CashBook[Currencies.USD].Amount;\n\n                Assert.AreEqual(initializedCash + dividend.Distribution, postDividendCash);\n            }\n            finally\n            {\n                realTime.Exit();\n                results.Exit();\n                transactions.Exit();\n            }\n        }\n\n        [Test]\n        public void PredictableCashSettlement()\n        {\n            var symbol = Symbols.SPY;\n            var securityPrice = 550m;\n            var initialCashBalance = 100_000m;\n            var defaultSettlementTime = Securities.Equity.Equity.DefaultSettlementTime;\n            // Time at which cash sync is typically performed, based on system log (TRACE:: Brokerage.PerformCashSync())\n            var performCashSyncTimeSpan = new TimeSpan(11, 45, 0);\n\n            var feed = new MockDataFeed();\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm, new MockDataFeed()));\n\n            // Initialize()\n            algorithm.SetStartDate(2025, 03, 30);\n            algorithm.SetEndDate(2025, 04, 02);\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n            var security = algorithm.AddSecurity(symbol.ID.SecurityType, symbol.ID.Symbol);\n            algorithm.PostInitialize();\n\n            // Update Security Price like AlgorithmManager\n            security.Update([new Tick(algorithm.Time, symbol, string.Empty, string.Empty, 10m, securityPrice)], typeof(TradeBar));\n\n            var portfolio = algorithm.Portfolio;\n            using var brokerage = new PaperBrokerageWithManualCashBalance(algorithm, new LiveNodePacket(), initialCashBalance: initialCashBalance);\n\n            // Sync initial cash state with the brokerage\n            brokerage.PerformCashSync(algorithm, algorithm.Time, () => TimeSpan.Zero);\n\n            // Market SPY 10\n            var buyQuantity = 10;\n            portfolio.ProcessFills([new OrderEvent(new MarketOrder(symbol, buyQuantity, algorithm.Time), algorithm.Time, OrderFee.Zero)\n            { FillPrice = security.Price, FillQuantity = buyQuantity }]);\n\n            var totalMarginUserAfterBuy = portfolio.TotalMarginUsed;\n            var marginRemainingAfterBuy = portfolio.MarginRemaining;\n\n            // Manually decrease the brokerage cash balance to simulate the cash outflow\n            brokerage.DecreaseCashBalance(buyQuantity * security.Price);\n            brokerage.PerformCashSync(algorithm, algorithm.Time, () => TimeSpan.Zero);\n\n            // Advance to the next day to simulate settlement\n            var timeUtc = algorithm.Time.AddDays(1).ConvertToUtc(algorithm.TimeZone);\n            algorithm.SetDateTime(timeUtc);\n            portfolio.Securities[symbol].SettlementModel.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            brokerage.PerformCashSync(algorithm, timeUtc, () => TimeSpan.Zero);\n\n            // Validate: After syncing cash and waiting for settlement, portfolio state should be correct\n            Assert.AreEqual(portfolio.TotalMarginUsed, totalMarginUserAfterBuy);\n            Assert.AreEqual(portfolio.MarginRemaining, marginRemainingAfterBuy);\n            Assert.AreEqual(portfolio.UnsettledCash, 0m);\n\n            // Market SPY -10\n            var sellQuantity = -10;\n            portfolio.ProcessFills([new OrderEvent(new MarketOrder(symbol, sellQuantity, algorithm.Time), algorithm.Time, OrderFee.Zero)\n            { FillPrice = security.Price, FillQuantity = sellQuantity }]);\n\n            // Simulate brokerage immediately crediting the cash from the sell, before Lean's internal settlement\n            brokerage.IncreaseCashBalance(Math.Abs(sellQuantity) * security.Price);\n\n            // Move to just before the settlement time (T+1 - 1 minute)\n            timeUtc = algorithm.Time.Add(defaultSettlementTime.Subtract(Time.OneMinute)).ConvertToUtc(algorithm.TimeZone);\n            algorithm.SetDateTime(timeUtc);\n\n            // At this point, brokerage has credited the cash, but Lean still considers it unsettled\n            Assert.Greater(portfolio.UnsettledCash, 0m);\n\n            // Advance 1 minute to reach full settlement time (T+1)\n            timeUtc = algorithm.Time.Add(Time.OneMinute).ConvertToUtc(algorithm.TimeZone);\n            algorithm.SetDateTime(timeUtc);\n\n            if (algorithm.Time.ConvertToUtc(algorithm.TimeZone).TimeOfDay < performCashSyncTimeSpan)\n            {\n                // Lean clears the unsettled cash to available balance\n                portfolio.Securities[symbol].SettlementModel.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            }\n\n            brokerage.PerformCashSync(algorithm, timeUtc, () => TimeSpan.Zero);\n\n            Assert.AreEqual(0m, portfolio.UnsettledCash);\n\n            // Brokerage UnsettledCash + Lean UnsettledCash\n            Assert.AreEqual(portfolio.TotalPortfolioValue, initialCashBalance);\n            var orderRequestMarginRemaining = portfolio.TotalMarginUsed * 2 + portfolio.MarginRemaining;\n            Assert.AreEqual(portfolio.TotalPortfolioValue, orderRequestMarginRemaining);\n        }\n\n        [Test]\n        public void PerformCashSyncDoesNotThrowWithKnownOrUnknownCurrencies()\n        {\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            var dataManager = new DataManagerStub(algorithm, new MockDataFeed());\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            algorithm.AddCryptoEntry(\"BNFCRUSD\", Market.Binance);\n            algorithm.SetStartDate(2025, 03, 30);\n            algorithm.SetEndDate(2025, 04, 02);\n\n            // Set the initial cash for the custom stablecoin \"BNFCR\"\n            algorithm.SetCash(\"BNFCR\", 2000);\n            // Unknown currency without conversion\n            algorithm.SetCash(\"TEST\", 5000);\n            algorithm.SetBrokerageModel(BrokerageName.Binance, AccountType.Cash);\n            algorithm.AddSecurity(SecurityType.Crypto, \"BNFCRUSD\", Resolution.Minute, Market.Binance, false, 1, false);\n            algorithm.PostInitialize();\n\n            // Ensure the cash book creates required data feeds (e.g., conversion rates)\n            algorithm.Portfolio.CashBook.EnsureCurrencyDataFeeds(algorithm.Securities, algorithm.SubscriptionManager, algorithm.BrokerageModel.DefaultMarkets, SecurityChanges.None, dataManager.SecurityService);\n\n            // Assert conversion rate is set to 1 for known stablecoin\n            Assert.AreEqual(1, algorithm.Portfolio.CashBook[\"BNFCR\"].ConversionRate);\n\n            // Assert conversion rate is zero for unknown currency\n            Assert.AreEqual(0, algorithm.Portfolio.CashBook[\"TEST\"].ConversionRate);\n\n            using var brokerage = new TestBrokerage(algorithm);\n\n            // Should not throw even if some currencies have no conversion pairs\n            Assert.DoesNotThrow(() => brokerage.PerformCashSync(algorithm, algorithm.Time, () => TimeSpan.Zero));\n        }\n\n        [Test]\n        public void PerformCashSyncDoesNotAddZeroQuantityCurrenciesExceptAccountCurrency()\n        {\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.SetAccountCurrency(\"USD\");\n            algorithm.SetCash(10000);\n\n            using var brokerage = new TestBrokerage(algorithm);\n            var currentTime = new DateTime(2024, 1, 1, 12, 0, 0, DateTimeKind.Utc);\n            var syncPerformed = brokerage.PerformCashSync(algorithm, currentTime, () => TimeSpan.FromMinutes(5));\n\n            Assert.IsTrue(syncPerformed);\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"USD\"));\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"BNFCR\"));\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"TEST\"));\n            Assert.IsFalse(algorithm.Portfolio.CashBook.ContainsKey(\"EUR\"));\n        }\n\n        internal class TestBrokerage : BacktestingBrokerage\n        {\n            public TestBrokerage(IAlgorithm algorithm) : base(algorithm, \"Test\")\n            {\n            }\n\n            public override List<CashAmount> GetCashBalance()\n            {\n                return new List<CashAmount> { new CashAmount(0, Currencies.USD), new CashAmount(200, \"BNFCR\"), new CashAmount(300, \"TEST\"), new CashAmount(0, \"EUR\") };\n            }\n        }\n\n        class NullSynchronizer : ISynchronizer\n        {\n            private readonly IAlgorithm _algorithm;\n            private readonly Dividend _dividend;\n            private readonly Symbol _symbol;\n            private readonly TimeSliceFactory _timeSliceFactory;\n\n            public NullSynchronizer(IAlgorithm algorithm, Dividend dividend)\n            {\n                _algorithm = algorithm;\n                _dividend = dividend;\n                _symbol = dividend.Symbol;\n                _timeSliceFactory = new TimeSliceFactory(TimeZones.NewYork);\n            }\n\n            public IEnumerable<TimeSlice> StreamData(CancellationToken cancellationToken)\n            {\n                var dataFeedPacket = new DataFeedPacket(_algorithm.Securities[_symbol],\n                    _algorithm.SubscriptionManager.Subscriptions.First(s => s.Symbol == _symbol),\n                    new List<BaseData> { _dividend }, Ref.CreateReadOnly(() => false));\n\n                yield return _timeSliceFactory.Create(DateTime.UtcNow,\n                    new List<DataFeedPacket> { dataFeedPacket },\n                    SecurityChanges.None,\n                    new Dictionary<Universe, BaseDataCollection>()\n                );\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/SecurityProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n\nusing System;\nusing QuantConnect.Data;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Provides a test implementation of a security provider\n    /// </summary>\n    public class SecurityProvider : ISecurityProvider\n    {\n        private readonly OrderProvider _orderProvider;\n        private readonly BrokerageName _brokerageName;\n        private readonly Dictionary<Symbol, Security> _securities;\n\n        public SecurityProvider(Dictionary<Symbol, Security> securities, BrokerageName brokerageName, OrderProvider orderProvider)\n        {\n            _orderProvider = orderProvider;\n            _brokerageName = brokerageName;\n            _securities = securities;\n        }\n\n        public SecurityProvider(Dictionary<Symbol, Security> securities) : this(securities, BrokerageName.Default, null)\n        {\n        }\n\n        public SecurityProvider() : this(new Dictionary<Symbol, Security>())\n        {\n        }\n\n        public Security this[Symbol symbol]\n        {\n            get { return GetSecurity(symbol); }\n            set { _securities[symbol] = value; }\n        }\n\n        public Security GetSecurity(Symbol symbol)\n        {\n            Security holding;\n            _securities.TryGetValue(symbol, out holding);\n\n            return holding ?? CreateSecurity(symbol);\n        }\n\n        public bool TryGetValue(Symbol symbol, out Security security)\n        {\n            return _securities.TryGetValue(symbol, out security);\n        }\n\n        private Security CreateSecurity(Symbol symbol)\n        {\n            var symbolProperties = SymbolProperties.GetDefault(Currencies.USD);\n            var quoteCurrency = new Cash(Currencies.USD, 0, 1m);\n            try\n            {\n                var spdb = SymbolPropertiesDatabase.FromDataFolder();\n                symbolProperties = spdb.GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, Currencies.USD);\n                quoteCurrency = new Cash(symbolProperties.QuoteCurrency, 0, 1m);\n            }\n            catch (Exception ex)\n            {\n                // shouldn't happen\n                QuantConnect.Logging.Log.Error(ex);\n            }\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                quoteCurrency,\n                symbolProperties,\n                new CashBook(),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            try\n            {\n                if (_orderProvider != null)\n                {\n                    var brokerageModel = BrokerageModel.Create(_orderProvider, _brokerageName, AccountType.Margin);\n                    security.FeeModel = brokerageModel.GetFeeModel(security);\n                }\n            }\n            catch (Exception ex)\n            {\n                // shouldn't happen\n                QuantConnect.Logging.Log.Error(ex);\n            }\n\n            _securities[symbol] = security;\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/StopLimitOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class StopLimitOrderTestParameters : OrderTestParameters\n    {\n        private readonly decimal _highLimit;\n        private readonly decimal _lowLimit;\n\n        public StopLimitOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n            : base(symbol, properties, orderSubmissionData)\n        {\n            _highLimit = highLimit;\n            _lowLimit = lowLimit;\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new StopLimitOrder(Symbol, -Math.Abs(quantity), _lowLimit, _highLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new StopLimitOrder(Symbol, Math.Abs(quantity), _highLimit, _lowLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            var roundOffPlaces = GetSymbolProperties(order.Symbol).MinimumPriceVariation.GetDecimalPlaces();\n            var stop = (StopLimitOrder)order;\n            var previousStop = stop.StopPrice;\n            if (order.Quantity > 0)\n            {\n                // for stop buys we need to decrease the stop price\n                stop.StopPrice = Math.Min(stop.StopPrice, Math.Max(stop.StopPrice / 2, Math.Round(lastMarketPrice, roundOffPlaces, MidpointRounding.AwayFromZero)));\n            }\n            else\n            {\n                // for stop sells we need to increase the stop price\n                stop.StopPrice = Math.Max(stop.StopPrice, Math.Min(stop.StopPrice * 2, Math.Round(lastMarketPrice, roundOffPlaces, MidpointRounding.AwayFromZero)));\n            }\n            stop.LimitPrice = stop.StopPrice;\n            return stop.StopPrice != previousStop;\n        }\n\n        // default stop limit orders will only be submitted, not filled\n        public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        public override bool ExpectedCancellationResult => true;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.StopLimit}: {SecurityType}, {Symbol}\";\n        }\n    }\n\n    // to be used with brokerages which do not support UpdateOrder\n    public class NonUpdateableStopLimitOrderTestParameters : StopLimitOrderTestParameters\n    {\n        public NonUpdateableStopLimitOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null)\n            : base(symbol, highLimit, lowLimit, properties)\n        {\n        }\n\n        public override bool ModifyUntilFilled => false;\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/StopMarketOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class StopMarketOrderTestParameters : OrderTestParameters\n    {\n        private readonly decimal _highLimit;\n        private readonly decimal _lowLimit;\n\n        public StopMarketOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null)\n            : base(symbol, properties, orderSubmissionData)\n        {\n            _highLimit = highLimit;\n            _lowLimit = lowLimit;\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new StopMarketOrder(Symbol, -Math.Abs(quantity), _lowLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new StopMarketOrder(Symbol, Math.Abs(quantity), _highLimit, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            var stop = (StopMarketOrder)order;\n            var previousStop = stop.StopPrice;\n            if (order.Quantity > 0)\n            {\n                // for stop buys we need to decrease the stop price\n                stop.StopPrice = Math.Min(stop.StopPrice, Math.Max(stop.StopPrice / 2, lastMarketPrice));\n            }\n            else\n            {\n                // for stop sells we need to increase the stop price\n                stop.StopPrice = Math.Max(stop.StopPrice, Math.Min(stop.StopPrice * 2, lastMarketPrice));\n            }\n            return stop.StopPrice != previousStop;\n        }\n\n        // default stop market orders will only be submitted, not filled\n        public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        public override bool ExpectedCancellationResult => true;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.StopMarket}: {SecurityType}, {Symbol}\";\n        }\n    }\n\n    // to be used with brokerages which do not support UpdateOrder\n    public class NonUpdateableStopMarketOrderTestParameters : StopMarketOrderTestParameters\n    {\n        public NonUpdateableStopMarketOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, IOrderProperties properties = null)\n            : base(symbol, highLimit, lowLimit, properties)\n        {\n        }\n\n        public override bool ModifyUntilFilled => false;\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/SymbolPropertiesDatabaseSymbolMapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    [TestFixture]\n    public class SymbolPropertiesDatabaseSymbolMapperTests\n    {\n        [TestCaseSource(nameof(BrokerageSymbols))]\n        public void ReturnsCryptoSecurityType(string market, string brokerageSymbol, string leanSymbol)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            var symbol = mapper.GetLeanSymbol(brokerageSymbol, SecurityType.Crypto, market);\n            Assert.AreEqual(leanSymbol, symbol.Value);\n            Assert.AreEqual(market, symbol.ID.Market);\n        }\n\n        [TestCaseSource(nameof(BrokerageSymbols))]\n        public void ReturnsCorrectLeanSymbol(string market, string brokerageSymbol, string leanSymbol)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            var symbol = mapper.GetLeanSymbol(brokerageSymbol, SecurityType.Crypto, market);\n            Assert.AreEqual(leanSymbol, symbol.Value);\n            Assert.AreEqual(SecurityType.Crypto, symbol.ID.SecurityType);\n            Assert.AreEqual(market, symbol.ID.Market);\n        }\n\n        [TestCaseSource(nameof(CryptoSymbols))]\n        public void ReturnsCorrectBrokerageSymbol(Symbol symbol, string brokerageSymbol)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(symbol.ID.Market);\n\n            Assert.AreEqual(brokerageSymbol, mapper.GetBrokerageSymbol(symbol));\n        }\n\n        [TestCaseSource(nameof(CurrencyPairs))]\n        public void ThrowsOnCurrencyPairs(string market, string brokerageSymbol)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSecurityType(brokerageSymbol));\n        }\n\n        [TestCase(Market.Coinbase)]\n        [TestCase(Market.Bitfinex)]\n        [TestCase(Market.Binance)]\n        public void ThrowsOnNullOrEmptySymbols(string market)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            string ticker = null;\n            Assert.IsFalse(mapper.IsKnownBrokerageSymbol(ticker));\n            Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(ticker, SecurityType.Crypto, market));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSecurityType(ticker));\n\n            ticker = \"\";\n            Assert.IsFalse(mapper.IsKnownBrokerageSymbol(ticker));\n            Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(ticker, SecurityType.Crypto, market));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSecurityType(ticker));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(Symbol.Create(ticker, SecurityType.Crypto, market)));\n        }\n\n        [TestCaseSource(nameof(UnknownSymbols))]\n        public void ThrowsOnUnknownSymbols(string brokerageSymbol, SecurityType type, string market)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(brokerageSymbol, type, market));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(Symbol.Create(brokerageSymbol.Replace(\"-\", \"\"), type, market)));\n        }\n\n        [TestCaseSource(nameof(UnknownSecurityType))]\n        public void ThrowsOnUnknownSecurityType(string brokerageSymbol, SecurityType type, string market)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(brokerageSymbol, type, market));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(Symbol.Create(brokerageSymbol.Replace(\"-\", \"\"), type, market)));\n        }\n\n        [TestCaseSource(nameof(UnknownMarket))]\n        public void ThrowsOnUnknownMarket(string brokerageSymbol, SecurityType type, string market)\n        {\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n\n            Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(brokerageSymbol, type, market));\n            Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(Symbol.Create(brokerageSymbol.Replace(\"-\", \"\"), type, market)));\n        }\n\n        [TestCase(\"GetLeanSymbol\")]\n        [TestCase(\"GetBrokerageSymbol\")]\n        [TestCase(\"IsKnownLeanSymbol\")]\n        [TestCase(\"GetBrokerageSecurityType\")]\n        [TestCase(\"IsKnownBrokerageSymbol\")]\n        public void SymbolMapperRefreshesMappingsPeriodically(string methodName)\n        {\n            // Test symbol that is not in the SPDB\n            const string market = Market.Binance;\n            const string newSymbol = \"CUSTOMCRIPTOUSDT\";\n            const SecurityType securityType = SecurityType.Crypto;\n\n            var mapper = new SymbolPropertiesDatabaseSymbolMapper(market);\n            var testSymbol = Symbol.Create(newSymbol, securityType, market);\n\n            // Verify symbol doesn't exist initially using the appropriate method\n            switch (methodName)\n            {\n                case \"GetLeanSymbol\":\n                    Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(newSymbol, securityType, market));\n                    break;\n                case \"GetBrokerageSymbol\":\n                    Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(testSymbol));\n                    break;\n                case \"IsKnownLeanSymbol\":\n                    Assert.IsFalse(mapper.IsKnownLeanSymbol(testSymbol));\n                    break;\n                case \"GetBrokerageSecurityType\":\n                    Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSecurityType(newSymbol));\n                    break;\n                case \"IsKnownBrokerageSymbol\":\n                    Assert.IsFalse(mapper.IsKnownBrokerageSymbol(newSymbol));\n                    break;\n            }\n\n            // Add manually the new symbol to the SPDB\n            var path = Path.Combine(Globals.DataFolder, \"symbol-properties\", \"symbol-properties-database.csv\");\n            var newEntry = $\"{Environment.NewLine}binance,CUSTOMCRIPTOUSDT,crypto,CUSTOMCRIPTOUSDT,USDT,1,0.00000001,0.01,CUSTOMCRIPTOUSDT,0.01\";\n            File.AppendAllText(path, newEntry);\n\n            try\n            {\n                // Reset the SPDB\n                SymbolPropertiesDatabase.Reset();\n\n                // Simulate that 15 minutes have passed since the last reload\n                var lastReloadField = typeof(SymbolPropertiesDatabaseSymbolMapper).GetField(\"_lastReloadTime\", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);\n                lastReloadField.SetValue(mapper, DateTime.UtcNow.AddMinutes(-16));\n\n                // Now verify each method can find the symbol\n                switch (methodName)\n                {\n                    case \"GetLeanSymbol\":\n                        var symbol = mapper.GetLeanSymbol(newSymbol, securityType, market);\n                        Assert.IsNotNull(symbol);\n                        Assert.AreEqual(newSymbol, symbol.Value);\n                        Assert.AreEqual(securityType, symbol.SecurityType);\n                        Assert.AreEqual(market, symbol.ID.Market);\n                        break;\n                    case \"GetBrokerageSymbol\":\n                        Assert.AreEqual(newSymbol, mapper.GetBrokerageSymbol(testSymbol));\n                        break;\n                    case \"IsKnownLeanSymbol\":\n                        Assert.IsTrue(mapper.IsKnownLeanSymbol(testSymbol));\n                        break;\n                    case \"GetBrokerageSecurityType\":\n                        Assert.AreEqual(securityType, mapper.GetBrokerageSecurityType(newSymbol));\n                        break;\n                    case \"IsKnownBrokerageSymbol\":\n                        Assert.IsTrue(mapper.IsKnownBrokerageSymbol(newSymbol));\n                        break;\n                }\n            }\n            finally\n            {\n                // Clean up the SPDB\n                var lines = File.ReadAllLines(path).Where(l => !l.Contains(newSymbol)).ToArray();\n                File.WriteAllText(path, string.Join(Environment.NewLine, lines));\n                SymbolPropertiesDatabase.Reset();\n            }\n        }\n\n        private static TestCaseData[] BrokerageSymbols => new[]\n        {\n            new TestCaseData(Market.Coinbase, \"ETH-USD\", \"ETHUSD\"),\n            new TestCaseData(Market.Coinbase, \"ETH-BTC\", \"ETHBTC\"),\n            new TestCaseData(Market.Coinbase, \"BTC-USD\", \"BTCUSD\"),\n            new TestCaseData(Market.Coinbase, \"BTC-USDC\", \"BTCUSDC\"),\n            new TestCaseData(Market.Coinbase, \"ATOM-USD\", \"ATOMUSD\"),\n\n            new TestCaseData(Market.Bitfinex, \"tBTCUSD\", \"BTCUSD\"),\n            new TestCaseData(Market.Bitfinex, \"tBTCUST\", \"BTCUSDT\"),\n            new TestCaseData(Market.Bitfinex, \"tETHUSD\", \"ETHUSD\"),\n            new TestCaseData(Market.Bitfinex, \"tADAUST\", \"ADAUSDT\"),\n            new TestCaseData(Market.Bitfinex, \"tCOMP:USD\", \"COMPUSD\"),\n            new TestCaseData(Market.Bitfinex, \"tCOMP:UST\", \"COMPUSDT\"),\n\n            new TestCaseData(Market.Binance, \"ETHUSDT\", \"ETHUSDT\"),\n            new TestCaseData(Market.Binance, \"ETHBTC\", \"ETHBTC\"),\n            new TestCaseData(Market.Binance, \"BTCUSDT\", \"BTCUSDT\"),\n            new TestCaseData(Market.Binance, \"ATOMTUSD\", \"ATOMTUSD\"),\n            new TestCaseData(Market.Binance, \"ATOMUSDC\", \"ATOMUSDC\"),\n            new TestCaseData(Market.Binance, \"ATOMUSDT\", \"ATOMUSDT\")\n        };\n\n        private static TestCaseData[] CryptoSymbols => new[]\n        {\n            new TestCaseData(Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Coinbase), \"ETH-USD\"),\n            new TestCaseData(Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase), \"BTC-USD\"),\n            new TestCaseData(Symbol.Create(\"ETHBTC\", SecurityType.Crypto, Market.Coinbase), \"ETH-BTC\"),\n            new TestCaseData(Symbol.Create(\"BTCUSDC\", SecurityType.Crypto, Market.Coinbase), \"BTC-USDC\"),\n            new TestCaseData(Symbol.Create(\"ATOMUSD\", SecurityType.Crypto, Market.Coinbase), \"ATOM-USD\"),\n\n            new TestCaseData(Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Bitfinex), \"tBTCUSD\"),\n            new TestCaseData(Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Bitfinex), \"tBTCUST\"),\n            new TestCaseData(Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Bitfinex), \"tETHUSD\"),\n            new TestCaseData(Symbol.Create(\"ADAUSDT\", SecurityType.Crypto, Market.Bitfinex), \"tADAUST\"),\n            new TestCaseData(Symbol.Create(\"COMPUSD\", SecurityType.Crypto, Market.Bitfinex), \"tCOMP:USD\"),\n            new TestCaseData(Symbol.Create(\"COMPUSDT\", SecurityType.Crypto, Market.Bitfinex), \"tCOMP:UST\"),\n\n            new TestCaseData(Symbol.Create(\"ETHUSDT\", SecurityType.Crypto, Market.Binance), \"ETHUSDT\"),\n            new TestCaseData(Symbol.Create(\"ETHBTC\", SecurityType.Crypto, Market.Binance), \"ETHBTC\"),\n            new TestCaseData(Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Binance), \"BTCUSDT\"),\n            new TestCaseData(Symbol.Create(\"ATOMTUSD\", SecurityType.Crypto, Market.Binance), \"ATOMTUSD\"),\n            new TestCaseData(Symbol.Create(\"ATOMUSDC\", SecurityType.Crypto, Market.Binance), \"ATOMUSDC\"),\n            new TestCaseData(Symbol.Create(\"ATOMUSDT\", SecurityType.Crypto, Market.Binance), \"ATOMUSDT\")\n        };\n\n        private static TestCaseData[] CurrencyPairs => new[]\n        {\n            new TestCaseData(Market.Coinbase, \"\"),\n            new TestCaseData(Market.Coinbase, \"EURUSD\"),\n            new TestCaseData(Market.Coinbase, \"GBP-USD\"),\n            new TestCaseData(Market.Coinbase, \"USD-JPY\"),\n\n            new TestCaseData(Market.Bitfinex, \"\"),\n            new TestCaseData(Market.Bitfinex, \"EURUSD\"),\n            new TestCaseData(Market.Bitfinex, \"GBP-USD\"),\n            new TestCaseData(Market.Bitfinex, \"USD-JPY\"),\n\n            new TestCaseData(Market.Binance, \"\"),\n            new TestCaseData(Market.Binance, \"EURUSD\"),\n            new TestCaseData(Market.Binance, \"GBPUSD\"),\n            new TestCaseData(Market.Binance, \"USDJPY\")\n        };\n\n        private static TestCaseData[] UnknownSymbols => new[]\n        {\n            new TestCaseData(\"AAA-BBB\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"USD-BTC\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"EUR-USD\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"GBP-USD\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"USD-JPY\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"BTC-ETH\", SecurityType.Crypto, Market.Coinbase),\n            new TestCaseData(\"USDC-BTC\", SecurityType.Crypto, Market.Coinbase),\n\n            new TestCaseData(\"USD-BTC\", SecurityType.Crypto, Market.Bitfinex),\n            new TestCaseData(\"EUR-USD\", SecurityType.Crypto, Market.Bitfinex),\n            new TestCaseData(\"GBP-USD\", SecurityType.Crypto, Market.Bitfinex),\n            new TestCaseData(\"USD-JPY\", SecurityType.Crypto, Market.Bitfinex),\n            new TestCaseData(\"BTC-ETH\", SecurityType.Crypto, Market.Bitfinex),\n            new TestCaseData(\"USDC-BTC\", SecurityType.Crypto, Market.Bitfinex),\n\n            new TestCaseData(\"AAABBB\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"USDBTC\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"EURUSD\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"GBPUSD\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"USDJPY\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"BTCETH\", SecurityType.Crypto, Market.Binance),\n            new TestCaseData(\"BTCUSD\", SecurityType.Crypto, Market.Binance)\n        };\n\n        private static TestCaseData[] UnknownSecurityType => new[]\n        {\n            new TestCaseData(\"BTC-USD\", SecurityType.Forex, Market.Coinbase)\n        };\n\n        private static TestCaseData[] UnknownMarket => new[]\n        {\n            new TestCaseData(\"ETH-USD\", SecurityType.Crypto, Market.USA)\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/Tastytrade/TastytradeFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Brokerages.Tastytrade\n{\n    /// <summary>\n    /// Contains unit tests for the <see cref=\"TastytradeFeeModel\"/> to ensure correct fee calculations\n    /// for different security types such as equities, options, futures, and future options.\n    /// </summary>\n    [TestFixture]\n    public class TastytradeFeeModelTests\n    {\n        private TastytradeFeeModel _feeModel;\n\n        /// <summary>\n        /// Initializes the <see cref=\"TastytradeFeeModel\"/> instance once before any tests are run.\n        /// </summary>\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            _feeModel = new TastytradeFeeModel();\n        }\n\n        /// <summary>\n        /// Provides test cases for fee calculation across various symbols, order quantities,\n        /// and holding quantities.\n        /// </summary>\n        private static IEnumerable<TestCaseData> FeeTestParameters\n        {\n            get\n            {\n                var aapl = Symbols.AAPL;\n                yield return new(aapl, 1m, 0m, 0m);\n                yield return new(aapl, 10m, 0m, 0m);\n                var aaplOptionContract = Symbol.CreateOption(aapl, aapl.ID.Market, SecurityType.Option.DefaultOptionStyle(), OptionRight.Call, 200m, new DateTime(2025, 06, 20));\n                yield return new(aaplOptionContract, 10m, 0m, 10m);\n                yield return new(aaplOptionContract, 10m, 1m, 10m);\n                yield return new(aaplOptionContract, 1m, -1m, 0m);\n                yield return new(aaplOptionContract, 10m, -10m, 0m);\n                yield return new(aaplOptionContract, 11m, -10m, 0m);\n                var SP500EMini = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2025, 06, 20));\n                yield return new(SP500EMini, 1m, 0m, 1.25m);\n                yield return new(SP500EMini, 10m, 1m, 12.5m);\n                yield return new(SP500EMini, -10m, 1m, 12.5m);\n                var SP500EMini_OptionContract = Symbol.CreateOption(SP500EMini, SP500EMini.ID.Market, SecurityType.FutureOption.DefaultOptionStyle(), OptionRight.Put, 900m, new DateTime(2025, 09, 19));\n                yield return new(SP500EMini_OptionContract, 1m, 0m, 2.5m);\n                yield return new(SP500EMini_OptionContract, 2m, 0m, 5m);\n                yield return new(SP500EMini_OptionContract, 4m, 0m, 10m);\n                yield return new(SP500EMini_OptionContract, 4m, 0m, 10m);\n                yield return new(SP500EMini_OptionContract, 1m, -1m, 0m);\n                yield return new(SP500EMini_OptionContract, 10m, -10m, 0m);\n                yield return new(SP500EMini_OptionContract, 11m, -11m, 0m);\n                yield return new(SP500EMini_OptionContract, -10m, -10m, 25m);\n            }\n        }\n\n\n        [Test, TestCaseSource(nameof(FeeTestParameters))]\n        public void CalculateRightOrderFeeBasedOnSecurity(Symbol symbol, decimal orderQuantity, decimal symbolHoldingQuantity, decimal expectedFeeQuantity)\n        {\n            var parameters = GetOrderFeeParameters(symbol, orderQuantity, symbolHoldingQuantity);\n\n            var fee = _feeModel.GetOrderFee(parameters);\n\n            Assert.AreEqual(expectedFeeQuantity, fee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n        }\n\n        /// <summary>\n        /// Creates <see cref=\"OrderFeeParameters\"/> using a <see cref=\"MarketOrder\"/> and given\n        /// symbol and holding quantity.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol of the security being ordered.</param>\n        /// <param name=\"orderQuantity\">The order quantity.</param>\n        /// <param name=\"symbolHoldingQuantity\">The current holding quantity.</param>\n        /// <returns>A populated <see cref=\"OrderFeeParameters\"/> object.</returns>\n        private static OrderFeeParameters GetOrderFeeParameters(Symbol symbol, decimal orderQuantity, decimal symbolHoldingQuantity)\n        {\n            var security = new Security(symbol, null, new Cash(\"USD\", 0m, 1m), SymbolProperties.GetDefault(\"USD\"), null, null, new SecurityCache());\n            security.Holdings.SetHoldings(100, symbolHoldingQuantity);\n\n            var marketOrder = new MarketOrder(symbol, orderQuantity, DateTime.UtcNow);\n            return new OrderFeeParameters(security, marketOrder);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/TestHelpers.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    public class TestsHelpers\n    {\n        public static Security GetSecurity(decimal price = 1m, SecurityType securityType = SecurityType.Crypto, Resolution resolution = Resolution.Minute, string symbol = \"BTCUSD\", string market = Market.Coinbase, string quoteCurrency = \"USD\", bool marketAlwaysOpen = true)\n        {\n            var config = CreateConfig(symbol, market, securityType, resolution);\n            var marketHours = marketAlwaysOpen\n                ? SecurityExchangeHours.AlwaysOpen(TimeZones.Utc)\n                : MarketHoursDatabase.FromDataFolder().GetExchangeHours(config);\n\n            return new Security(\n                marketHours,\n                config,\n                new Cash(quoteCurrency, 1000, price),\n                #pragma warning disable CS0618\n                SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(market, config.Symbol, securityType, quoteCurrency),\n                #pragma warning restore CS0618\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private static SubscriptionDataConfig CreateConfig(string symbol, string market, SecurityType securityType = SecurityType.Crypto, Resolution resolution = Resolution.Minute)\n        {\n            Symbol actualSymbol;\n            switch (securityType)\n            {\n                case SecurityType.FutureOption:\n                    actualSymbol = Symbols.CreateFutureOptionSymbol(Symbols.CreateFutureSymbol(symbol, new DateTime(2020, 4, 28)), OptionRight.Call,\n                        1000, new DateTime(2020, 3, 26));\n                    break;\n\n                case SecurityType.Option:\n                case SecurityType.IndexOption:\n                    actualSymbol = Symbols.CreateOptionSymbol(symbol, OptionRight.Call, 1000, new DateTime(2020, 3, 26));\n                    break;\n\n                default:\n                    actualSymbol = Symbol.Create(symbol, securityType, market);\n                    break;\n            }\n\n            return new SubscriptionDataConfig(typeof(TradeBar), actualSymbol, resolution, TimeZones.Utc, TimeZones.Utc, false, true, false);\n        }\n\n        public static HistoryRequest GetHistoryRequest(Symbol symbol, DateTime startDateTime, DateTime endDateTime, Resolution resolution, TickType tickType, DateTimeZone dateTimeZone = null)\n        {\n            if (startDateTime > endDateTime)\n            {\n                throw new ArgumentException(\"The startDateTime is greater then endDateTime\");\n            }\n\n            if (dateTimeZone == null)\n            {\n                dateTimeZone = TimeZones.NewYork;\n            }\n\n            var dataType = LeanData.GetDataType(resolution, tickType);\n\n            return new HistoryRequest(\n                startDateTime,\n                endDateTime,\n                dataType,\n                symbol,\n                resolution,\n                SecurityExchangeHours.AlwaysOpen(dateTimeZone),\n                dateTimeZone,\n                null,\n                false,\n                false,\n                DataNormalizationMode.Raw,\n                tickType\n                );\n        }\n\n        public static IEnumerable<DateTimeZone> GetTimeZones()\n        {\n            yield return TimeZones.NewYork;\n            yield return TimeZones.EasternStandard;\n            yield return TimeZones.London;\n            yield return TimeZones.HongKong;\n            yield return TimeZones.Tokyo;\n            yield return TimeZones.Rome;\n            yield return TimeZones.Sydney;\n            yield return TimeZones.Vancouver;\n            yield return TimeZones.Toronto;\n            yield return TimeZones.Chicago;\n            yield return TimeZones.LosAngeles;\n            yield return TimeZones.Phoenix;\n            yield return TimeZones.Auckland;\n            yield return TimeZones.Moscow;\n            yield return TimeZones.Madrid;\n            yield return TimeZones.BuenosAires;\n            yield return TimeZones.Brisbane;\n            yield return TimeZones.SaoPaulo;\n            yield return TimeZones.Cairo;\n            yield return TimeZones.Johannesburg;\n            yield return TimeZones.Anchorage;\n            yield return TimeZones.Denver;\n            yield return TimeZones.Detroit;\n            yield return TimeZones.MexicoCity;\n            yield return TimeZones.Jerusalem;\n            yield return TimeZones.Shanghai;\n            yield return TimeZones.Melbourne;\n            yield return TimeZones.Amsterdam;\n            yield return TimeZones.Athens;\n            yield return TimeZones.Berlin;\n            yield return TimeZones.Bucharest;\n            yield return TimeZones.Dublin;\n            yield return TimeZones.Helsinki;\n            yield return TimeZones.Istanbul;\n            yield return TimeZones.Minsk;\n            yield return TimeZones.Paris;\n            yield return TimeZones.Zurich;\n            yield return TimeZones.Honolulu;\n            yield return TimeZones.Kolkata;\n        }\n\n        public static SecurityManager InitializeSecurity(SecurityType securityType, params (Symbol symbol, decimal averagePrice, decimal quantity)[] equityQuantity)\n        {\n            var algorithm = new AlgorithmStub();\n            foreach (var (symbol, averagePrice, quantity) in equityQuantity)\n            {\n                switch (securityType)\n                {\n                    case SecurityType.Equity:\n                        algorithm.AddEquity(symbol.Value).Holdings.SetHoldings(averagePrice, quantity);\n                        break;\n                    case SecurityType.Option:\n                        algorithm.AddOptionContract(symbol).Holdings.SetHoldings(averagePrice, quantity);\n                        break;\n                    default:\n                        throw new NotImplementedException($\"{nameof(TestsHelpers)}.{nameof(InitializeSecurity)}: uses not implemented {securityType} security type.\");\n                }\n            }\n\n            return algorithm.Securities;\n        }\n\n        public static Order CreateNewOrderByOrderType(OrderType orderType, Symbol symbol, decimal orderQuantity, GroupOrderManager groupOrderManager = null) => orderType switch\n        {\n            OrderType.Market => new MarketOrder(symbol, orderQuantity, new DateTime(default)),\n            OrderType.ComboMarket => new ComboMarketOrder(symbol, orderQuantity, new DateTime(default), groupOrderManager),\n            OrderType.ComboLimit => new ComboLimitOrder(symbol, orderQuantity, 80m, new DateTime(default), groupOrderManager),\n            _ => throw new NotImplementedException()\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/TradeStation/TradeStationBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Tests.Common.Brokerages;\n\nnamespace QuantConnect.Tests.Brokerages.TradeStation\n{\n    [TestFixture]\n    public class TradeStationBrokerageModelTests\n    {\n        private readonly TradeStationBrokerageModel _brokerageModel = new TradeStationBrokerageModel();\n\n        [TestCase(10, -15, -16, false)]\n        [TestCase(10, -15, -15, true)]\n        [TestCase(0, 1, 2, true)]\n        [TestCase(1, 1, 2, true)]\n        [TestCase(1, -1, -1, true)]\n        [TestCase(1, -2, -2, true)]\n        [TestCase(1, -2, -3, false)]\n        public void CanUpdateCrossZeroOrder(decimal holdingQuantity, decimal orderQuantity, decimal newOrderQuantity, bool isShouldUpdate)\n        {\n            var AAPL = Symbols.AAPL;\n            var marketOrder = TestsHelpers.CreateNewOrderByOrderType(OrderType.Market, AAPL, orderQuantity);\n            var security = TestsHelpers.InitializeSecurity(AAPL.SecurityType, (AAPL, 209m, holdingQuantity))[AAPL];\n            var updateRequest = new UpdateOrderRequest(new DateTime(default), 1, new UpdateOrderFields() { Quantity = newOrderQuantity });\n\n            var isPossibleUpdate = _brokerageModel.CanUpdateOrder(security, marketOrder, updateRequest, out var message);\n\n            Assert.That(isPossibleUpdate, Is.EqualTo(isShouldUpdate));\n        }\n\n        [TestCase(OrderType.ComboMarket, 1, 1, 2, 0, false)]\n        [TestCase(OrderType.ComboLimit, 1, 1, 2, 0, false)]\n        [TestCase(OrderType.ComboLimit, 1, 1, 1, 20, true)]\n        public void CanUpdateComboOrders(OrderType orderType, decimal holdingQuantity, decimal orderQuantity, decimal newOrderQuantity, decimal newLimitPrice, bool isShouldUpdate)\n        {\n            var AAPL = Symbols.AAPL;\n            var groupManager = new GroupOrderManager(1, 2, quantity: 8);\n\n            var order = TestsHelpers.CreateNewOrderByOrderType(orderType, AAPL, orderQuantity, groupManager);\n\n            var security = TestsHelpers.InitializeSecurity(AAPL.SecurityType, (AAPL, 209m, holdingQuantity))[AAPL];\n\n            var updateRequest = new UpdateOrderRequest(new DateTime(default), 1, new UpdateOrderFields() { Quantity = newOrderQuantity, LimitPrice = newLimitPrice });\n\n            var isPossibleUpdate = _brokerageModel.CanUpdateOrder(security, order, updateRequest, out var message);\n\n            Assert.That(isPossibleUpdate, Is.EqualTo(isShouldUpdate));\n        }\n\n        [TestCase(OrderType.ComboMarket, 10, -15, false)]\n        [TestCase(OrderType.ComboMarket, 0, 1, true)]\n        [TestCase(OrderType.ComboMarket, 1, 2, true)]\n        [TestCase(OrderType.ComboLimit, -1, -2, true)]\n        [TestCase(OrderType.ComboLimit, 1, -2, false)]\n        public void CanSubmitComboCrossZeroOrder(OrderType orderType, decimal holdingQuantity, decimal orderQuantity, bool isShouldSubmitOrder)\n        {\n            var AAPL = Symbols.AAPL;\n\n            var groupManager = new GroupOrderManager(1, 2, quantity: 8);\n\n            var order = TestsHelpers.CreateNewOrderByOrderType(orderType, AAPL, orderQuantity, groupManager);\n\n            var security = TestsHelpers.InitializeSecurity(AAPL.SecurityType, (AAPL, 209m, holdingQuantity))[AAPL];\n\n            var isPossibleUpdate = _brokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.That(isPossibleUpdate, Is.EqualTo(isShouldSubmitOrder));\n        }\n\n        [TestCase(SecurityType.Equity, OrderType.Market, false)]\n        [TestCase(SecurityType.Equity, OrderType.Limit, true)]\n        [TestCase(SecurityType.Option, OrderType.Limit, false)]\n        public void CanSubmitOrder_WhenOutsideRegularTradingHours(SecurityType securityType, OrderType orderType, bool isShouldSubmitOrder)\n        {\n            var symbol = Symbols.AAPL;\n            switch (securityType)\n            {\n                case SecurityType.Option:\n                    symbol = Symbol.CreateOption(symbol, Market.USA, OptionStyle.American, OptionRight.Call, 100m, new DateTime(2024, 05, 02));\n                    break;\n            }\n\n            var order = default(Order);\n            switch (orderType)\n            {\n                case OrderType.Market:\n                    order = new MarketOrder(symbol, 1, DateTime.UtcNow, properties: new TradeStationOrderProperties() { OutsideRegularTradingHours = true });\n                    break;\n                case OrderType.Limit:\n                    order = new LimitOrder(symbol, 1, 100m, DateTime.UtcNow, properties: new TradeStationOrderProperties() { OutsideRegularTradingHours = true });\n                    break;\n            }\n\n            var security = TestsHelpers.InitializeSecurity(securityType, (symbol, 209m, 1))[symbol];\n\n            var isPossibleUpdate = _brokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.That(isPossibleUpdate, Is.EqualTo(isShouldSubmitOrder));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Brokerages/TrailingStopOrderTestParameters.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Brokerages\n{\n    /// <summary>\n    /// Provides configuration parameters used to test <see cref=\"TrailingStopOrder\"/> behavior,\n    /// including price bounds, trailing values, and modification thresholds.\n    /// </summary>\n    public class TrailingStopOrderTestParameters : OrderTestParameters\n    {\n        private readonly decimal _highLimit;\n        private readonly decimal _lowLimit;\n\n        /// <summary>\n        /// Whether <see cref=\"_trailingAmount\"/> is a percentage (<c>true</c>) or absolute value (<c>false</c>).\n        /// </summary>\n        private readonly decimal _trailingAmount;\n\n        /// <summary>\n        /// Factor used to adjust the trailing stop during fill simulations (e.g., 0.001 = 0.1%, 1 = $1).\n        /// </summary>\n        private readonly bool _trailingAsPercentage;\n\n        /// <summary>\n        ///  The offset amount used when adjusting the trailing stop order during fill simulations.\n        /// Typically a small value such as <c>0.001m</c> (for 0.1%) or <c>1m</c> (for $1).\n        /// </summary>\n        private readonly decimal _trailingOffsetAmount;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"TrailingStopOrderTestParameters\"/> class.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol associated with the order under test.</param>\n        /// <param name=\"highLimit\">The upper price boundary for the simulated test environment.</param>\n        /// <param name=\"lowLimit\">The lower price boundary for the simulated test environment.</param>\n        /// <param name=\"trailingAmount\">The trailing stop amount, expressed as either a fixed offset or percentage.</param>\n        /// <param name=\"trailingAsPercentage\">If <c>true</c>, the <paramref name=\"trailingAmount\"/> is a percentage; otherwise, it’s an absolute price offset.</param>\n        /// <param name=\"properties\">Optional order properties used to customize the test order (such as time in force or brokerage-specific parameters).</param>\n        /// <param name=\"orderSubmissionData\">Optional submission data containing fill and price context at order creation time.</param>\n        /// <param name=\"trailingOffsetAmount\">\n        /// Optional offset amount applied when simulating trailing stop order modifications during tests.\n        /// Defaults to a typical small value such as <c>0.001m</c> (0.1%) or <c>1m</c> ($1), depending on <paramref name=\"trailingAsPercentage\"/>.\n        /// </param>\n        public TrailingStopOrderTestParameters(Symbol symbol, decimal highLimit, decimal lowLimit, decimal trailingAmount, bool trailingAsPercentage,\n            IOrderProperties properties = null, OrderSubmissionData orderSubmissionData = null, decimal? trailingOffsetAmount = null)\n            : base(symbol, properties, orderSubmissionData)\n        {\n            _highLimit = highLimit;\n            _lowLimit = lowLimit;\n            _trailingAmount = trailingAmount;\n            _trailingAsPercentage = trailingAsPercentage;\n            // trailingAsPercentage ? 0.001m (0.1%) or 1$\n            _trailingOffsetAmount = trailingOffsetAmount ?? (trailingAsPercentage ? 0.001m : 0.5m);\n        }\n\n        public override Order CreateShortOrder(decimal quantity)\n        {\n            return new TrailingStopOrder(Symbol, -Math.Abs(quantity), _lowLimit, _trailingAmount, _trailingAsPercentage, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override Order CreateLongOrder(decimal quantity)\n        {\n            return new TrailingStopOrder(Symbol, Math.Abs(quantity), _highLimit, _trailingAmount, _trailingAsPercentage, DateTime.UtcNow, properties: Properties)\n            {\n                Status = OrderStatus.New,\n                OrderSubmissionData = OrderSubmissionData,\n                PriceCurrency = GetSymbolProperties(Symbol).QuoteCurrency\n            };\n        }\n\n        public override bool ModifyOrderToFill(IBrokerage brokerage, Order order, decimal lastMarketPrice)\n        {\n            var trailingStopOrder = order as TrailingStopOrder;\n\n            if (trailingStopOrder.TrailingAmount == _trailingOffsetAmount)\n            {\n                Log.Trace($\"{nameof(TrailingStopOrderTestParameters)}.{nameof(ModifyOrderToFill)}: Trailing amount already equals modification factor for order {trailingStopOrder.Id}.\");\n                return false;\n            }\n\n            if (!TrailingStopOrder.TryUpdateStopPrice(lastMarketPrice,\n                trailingStopOrder.StopPrice,\n                _trailingOffsetAmount,\n                trailingStopOrder.TrailingAsPercentage,\n                trailingStopOrder.Direction,\n                out var updatedStopPrice))\n            {\n                Log.Error($\"Failed to compute updated stop price for order {trailingStopOrder.Id}. \" +\n                    $\"Inputs: LastMarketPrice={lastMarketPrice}, CurrentStopPrice={trailingStopOrder.StopPrice}, \" +\n                    $\"TrailingModificationFactor={_trailingOffsetAmount}, IsPercentage={trailingStopOrder.TrailingAsPercentage}, Direction={trailingStopOrder.Direction}.\");\n                return false;\n            }\n\n            var updateFields = new UpdateOrderFields() { StopPrice = updatedStopPrice, TrailingAmount = _trailingOffsetAmount };\n\n            ApplyUpdateOrderRequest(order, updateFields);\n\n            return true;\n        }\n\n        public override OrderStatus ExpectedStatus => OrderStatus.Submitted;\n\n        public override bool ExpectedCancellationResult => true;\n\n        public override string ToString()\n        {\n            return $\"{OrderType.TrailingStop}: {SecurityType}, {Symbol}\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/AlgorithmConfigurationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nusing NUnit.Framework;\n\nusing System;\nusing Newtonsoft.Json;\nusing QuantConnect.Packets;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class AlgorithmConfigurationTests\n    {\n        [TestCaseSource(nameof(AlgorithmConfigurationTestCases))]\n        public void CreatesConfiguration(string currency, BrokerageName brokerageName, AccountType accountType,\n            Dictionary<string, string> parameters)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetAccountCurrency(currency);\n            algorithm.SetBrokerageModel(brokerageName, accountType);\n            algorithm.SetParameters(parameters);\n\n\n            var algorithmConfiguration = AlgorithmConfiguration.Create(algorithm, null);\n\n            Assert.AreEqual(currency, algorithmConfiguration.AccountCurrency);\n            Assert.AreEqual(brokerageName, algorithmConfiguration.Brokerage);\n            Assert.AreEqual(accountType, algorithmConfiguration.AccountType);\n            CollectionAssert.AreEquivalent(parameters, algorithmConfiguration.Parameters);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void JsonRoundtrip(bool backwardsCompatible)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetName(\"Backtest name\");\n            algorithm.AddTag(\"tag1\");\n            algorithm.AddTag(\"tag2\");\n            algorithm.SetAccountCurrency(Currencies.GBP);\n            algorithm.SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);\n            algorithm.SetParameters(new Dictionary<string, string> { { \"a\", \"A\" }, { \"b\", \"B\" } });\n\n            var backtestNode = new BacktestNodePacket\n            {\n                OutOfSampleDays = 30,\n                OutOfSampleMaxEndDate = new DateTime(2023, 01, 01)\n            };\n            var algorithmConfiguration = AlgorithmConfiguration.Create(algorithm, backtestNode);\n\n            var settings = new JsonSerializerSettings()\n            {\n                ContractResolver = new DefaultContractResolver\n                {\n                    NamingStrategy = new CamelCaseNamingStrategy\n                    {\n                        ProcessDictionaryKeys = false,\n                        OverrideSpecifiedNames = true\n                    }\n                }\n            };\n            var serialized = JsonConvert.SerializeObject(algorithmConfiguration, settings);\n            if (backwardsCompatible)\n            {\n                serialized = $\"{{\\\"Name\\\":\\\"Backtest name\\\",\\\"Tags\\\":[\\\"tag1\\\",\\\"tag2\\\"],\\\"AccountCurrency\\\":\\\"GBP\\\",\\\"Brokerage\\\":32,\" +\n                $\"\\\"AccountType\\\":1,\\\"Parameters\\\":{{\\\"a\\\":\\\"A\\\",\\\"b\\\":\\\"B\\\"}},\\\"OutOfSampleMaxEndDate\\\":\\\"2023-01-01T00:00:00\\\",\" +\n                $\"\\\"OutOfSampleDays\\\":30,\\\"StartDate\\\":\\\"1998-01-01T00:00:00Z\\\",\\\"EndDate\\\":\\\"{algorithm.EndDate.ToString(DateFormat.ISOShort)}\\\",\\\"TradingDaysPerYear\\\":252}}\";\n            }\n            else\n            {\n                Assert.AreEqual($\"{{\\\"name\\\":\\\"Backtest name\\\",\\\"tags\\\":[\\\"tag1\\\",\\\"tag2\\\"],\\\"accountCurrency\\\":\\\"GBP\\\",\\\"brokerage\\\":32,\" +\n                $\"\\\"accountType\\\":1,\\\"parameters\\\":{{\\\"a\\\":\\\"A\\\",\\\"b\\\":\\\"B\\\"}},\\\"outOfSampleMaxEndDate\\\":\\\"2023-01-01T00:00:00Z\\\",\" +\n                $\"\\\"outOfSampleDays\\\":30,\\\"startDate\\\":\\\"1998-01-01T00:00:00Z\\\",\\\"endDate\\\":\\\"{algorithm.EndDate.ToString(DateFormat.ISOShort)}\\\",\\\"tradingDaysPerYear\\\":252}}\", serialized);\n            }\n\n            var deserialize = JsonConvert.DeserializeObject<AlgorithmConfiguration>(serialized);\n\n            Assert.AreEqual(algorithmConfiguration.Name, deserialize.Name);\n            Assert.AreEqual(algorithmConfiguration.Parameters, deserialize.Parameters);\n            Assert.AreEqual(algorithmConfiguration.AccountCurrency, deserialize.AccountCurrency);\n            Assert.AreEqual(algorithmConfiguration.AccountType, deserialize.AccountType);\n            Assert.AreEqual(algorithmConfiguration.Brokerage, deserialize.Brokerage);\n            var expected = new DateTime(algorithm.EndDate.Year, algorithm.EndDate.Month, algorithm.EndDate.Day, algorithm.EndDate.Hour, algorithm.EndDate.Minute, algorithm.EndDate.Second);\n            Assert.AreEqual(expected, deserialize.EndDate);\n            Assert.AreEqual(algorithmConfiguration.OutOfSampleDays, deserialize.OutOfSampleDays);\n            Assert.AreEqual(algorithmConfiguration.TradingDaysPerYear, deserialize.TradingDaysPerYear);\n            Assert.AreEqual(algorithmConfiguration.OutOfSampleMaxEndDate, deserialize.OutOfSampleMaxEndDate);\n            Assert.AreEqual(algorithmConfiguration.StartDate, deserialize.StartDate);\n            Assert.AreEqual(algorithmConfiguration.Tags, deserialize.Tags);\n        }\n\n        private static TestCaseData[] AlgorithmConfigurationTestCases => new[]\n        {\n            new TestCaseData(\"BTC\", BrokerageName.Binance, AccountType.Cash,\n                new Dictionary<string, string> { { \"param1\", \"param1 value\" }, { \"param2\", \"param2 value\" } }),\n            new TestCaseData(\"USDT\", BrokerageName.Coinbase, AccountType.Cash,\n                new Dictionary<string, string> { { \"a\", \"A\" }, { \"b\", \"B\" } }),\n            new TestCaseData(\"EUR\", BrokerageName.Bitfinex, AccountType.Margin,\n                new Dictionary<string, string> { { \"first\", \"1\" }, { \"second\", \"2\" }, { \"third\", \"3\" } }),\n            new TestCaseData(\"AUD\", BrokerageName.Axos, AccountType.Margin,\n                new Dictionary<string, string> { { \"ema-slow\", \"20\" }, { \"ema-fast\", \"10\" } })\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/BaseExtendedDictionaryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Common.Util;\nusing Python.Runtime;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class BaseExtendedDictionaryTests\n    {\n        [Test]\n        public void AddAndGetItemsWorksCorrectly()\n        {\n            var dict = new BaseExtendedDictionary<string, string>();\n\n            dict.Add(\"key1\", \"value1\");\n            dict[\"key2\"] = \"value2\";\n\n            Assert.AreEqual(\"value1\", dict[\"key1\"]);\n            Assert.AreEqual(\"value2\", dict[\"key2\"]);\n            Assert.AreEqual(2, dict.Count);\n        }\n\n        [Test]\n        public void ContainsKeyExistingKeyReturnsTrue()\n        {\n            var dict = new BaseExtendedDictionary<int, string>();\n            dict.Add(1, \"one\");\n\n            Assert.IsTrue(dict.ContainsKey(1));\n            Assert.IsFalse(dict.ContainsKey(2));\n        }\n\n        [Test]\n        public void TryGetValueExistingKeyReturnsTrueAndValue()\n        {\n            var dict = new BaseExtendedDictionary<string, decimal>();\n            dict[\"price\"] = 100.5m;\n\n            bool result = dict.TryGetValue(\"price\", out decimal value);\n\n            Assert.IsTrue(result);\n            Assert.AreEqual(100.5m, value);\n        }\n\n        [Test]\n        public void TryGetValueNonExistingKeyReturnsFalseAndDefault()\n        {\n            var dict = new BaseExtendedDictionary<string, decimal>();\n\n            bool result = dict.TryGetValue(\"nonexistent\", out decimal value);\n\n            Assert.IsFalse(result);\n            Assert.AreEqual(0, value);\n        }\n\n        [Test]\n        public void RemoveExistingKeyRemovesItem()\n        {\n            var dict = new BaseExtendedDictionary<string, int>();\n            dict.Add(\"a\", 1);\n            dict.Add(\"b\", 2);\n\n            bool removed = dict.Remove(\"a\");\n\n            Assert.IsTrue(removed);\n            Assert.AreEqual(1, dict.Count);\n            Assert.IsFalse(dict.ContainsKey(\"a\"));\n            Assert.IsTrue(dict.ContainsKey(\"b\"));\n        }\n\n        [Test]\n        public void ClearRemovesAllItems()\n        {\n            var dict = new BaseExtendedDictionary<string, int>();\n            dict.Add(\"a\", 1);\n            dict.Add(\"b\", 2);\n\n            dict.Clear();\n\n            Assert.AreEqual(0, dict.Count);\n            Assert.IsFalse(dict.ContainsKey(\"a\"));\n            Assert.IsFalse(dict.ContainsKey(\"b\"));\n        }\n\n        [Test]\n        public void GetMethodExistingKeyReturnsValue()\n        {\n            var dict = new BaseExtendedDictionary<string, string>();\n            dict[\"test\"] = \"success\";\n\n            var result = dict.get(\"test\");\n\n            Assert.AreEqual(\"success\", result);\n        }\n\n        [Test]\n        public void GetMethodNonExistingKeyReturnsDefault()\n        {\n            var dict = new BaseExtendedDictionary<string, int>();\n\n            var result = dict.get(\"nonexistent\");\n\n            Assert.AreEqual(0, result);\n        }\n\n        [Test]\n        public void KeysAndValuesPropertiesReturnCorrectCollections()\n        {\n            var dict = new BaseExtendedDictionary<int, string>();\n            dict[1] = \"one\";\n            dict[2] = \"two\";\n\n            var keys = dict.Keys.ToList();\n            var values = dict.Values.ToList();\n\n            Assert.AreEqual(2, keys.Count);\n            Assert.AreEqual(2, values.Count);\n            Assert.Contains(1, keys);\n            Assert.Contains(2, keys);\n            Assert.Contains(\"one\", values);\n            Assert.Contains(\"two\", values);\n        }\n\n        [Test]\n        public void ConstructorWithInitialDictionaryCopiesData()\n        {\n            var initialDict = new Dictionary<string, int>\n            {\n                {\"a\", 1},\n                {\"b\", 2}\n            };\n\n            var extendedDict = new BaseExtendedDictionary<string, int>(initialDict);\n\n            Assert.AreEqual(2, extendedDict.Count);\n            Assert.AreEqual(1, extendedDict[\"a\"]);\n            Assert.AreEqual(2, extendedDict[\"b\"]);\n        }\n\n        [Test]\n        public void ConstructorWithDataAndKeySelectorPopulatesDictionary()\n        {\n            var data = new List<string> { \"apple\", \"banana\" };\n\n            var dict = new BaseExtendedDictionary<string, string>(\n                data,\n                fruit => fruit.Substring(0, 1) // key is first letter\n            );\n\n            Assert.AreEqual(2, dict.Count);\n            Assert.AreEqual(\"apple\", dict[\"a\"]);\n            Assert.AreEqual(\"banana\", dict[\"b\"]);\n        }\n\n        [Test]\n        public void EnumerationWorksCorrectly()\n        {\n            var dict = new BaseExtendedDictionary<int, string>();\n            dict[1] = \"one\";\n            dict[2] = \"two\";\n\n            var items = new List<KeyValuePair<int, string>>();\n            foreach (var kvp in dict)\n            {\n                items.Add(kvp);\n            }\n\n            Assert.AreEqual(2, items.Count);\n            Assert.IsTrue(items.Any(kvp => kvp.Key == 1 && kvp.Value == \"one\"));\n            Assert.IsTrue(items.Any(kvp => kvp.Key == 2 && kvp.Value == \"two\"));\n        }\n\n        [Test]\n        public void CopyToCopiesItemsToArray()\n        {\n            var dict = new BaseExtendedDictionary<int, string>();\n            dict[1] = \"one\";\n            dict[2] = \"two\";\n\n            var array = new KeyValuePair<int, string>[2];\n            dict.CopyTo(array, 0);\n\n            Assert.AreEqual(2, array.Length);\n            Assert.IsTrue(array.Contains(new KeyValuePair<int, string>(1, \"one\")));\n            Assert.IsTrue(array.Contains(new KeyValuePair<int, string>(2, \"two\")));\n        }\n\n        [Test]\n        public void ReadOnlyExtendedDictionaryReturnsTrueForIsReadOnly()\n        {\n            var dict = new ReadOnlyExtendedDictionary<string, int>();\n            Assert.IsTrue(dict.IsReadOnly);\n        }\n\n        [Test]\n        public void ReadOnlyExtendedDictionaryThrowsInvalidOperationExceptionForIndexerSet()\n        {\n            var dict = new ReadOnlyExtendedDictionary<string, int>(new Dictionary<string, int> { { \"test\", 1 } });\n\n            Assert.Throws<InvalidOperationException>(() => dict[\"test\"] = 2);\n        }\n\n        [Test]\n        public void ReadOnlyExtendedDictionaryThrowsInvalidOperationExceptionForClear()\n        {\n            var dict = new ReadOnlyExtendedDictionary<string, int>();\n            Assert.Throws<InvalidOperationException>(() => dict.Clear());\n        }\n\n        [Test]\n        public void ReadOnlyExtendedDictionaryThrowsInvalidOperationExceptionForRemoveByKey()\n        {\n            var dict = new ReadOnlyExtendedDictionary<string, int>();\n            Assert.Throws<InvalidOperationException>(() => dict.Remove(\"anykey\"));\n        }\n\n        [Test]\n        public void ReadOnlyExtendedDictionaryThrowsInvalidOperationExceptionForAddByKeyValue()\n        {\n            var dict = new ReadOnlyExtendedDictionary<string, int>();\n            Assert.Throws<InvalidOperationException>(() => dict.Add(\"newkey\", 123));\n        }\n\n        [Test]\n        public void BaseExtendedDictionaryBehavesAsPythonDictionary()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(\"BaseExtendedDictionaryBehavesAsPythonDictionary\",\n                    @\"\ndef contains(dictionary, key):\n    return key in dictionary\n\ndef get(dictionary, key):\n    return dictionary.get(key)\n\ndef keys(dictionary):\n    return dictionary.keys()\n\ndef items(dictionary):\n    return list(dictionary.items())\n\ndef values(dictionary):\n    return dictionary.values()\n\ndef pop(dictionary, key):\n    return dictionary.pop(key)\n\ndef setdefault(dictionary, key, default_value):\n    return dictionary.setdefault(key, default_value)\n\ndef update(dictionary, other_dict):\n    dictionary.update(other_dict)\n\");\n\n            var dict = new BaseExtendedDictionary<string, int>\n            {\n                [\"a\"] = 1,\n                [\"b\"] = 2,\n                [\"c\"] = 3\n            };\n            using var pyDict = dict.ToPython();\n\n            // Test keys()\n            var expectedKeys = new[] { \"a\", \"b\", \"c\" };\n            var keys = module.InvokeMethod(\"keys\", pyDict).GetAndDispose<List<string>>();\n            CollectionAssert.AreEquivalent(expectedKeys, keys);\n\n            // Test values()\n            var expectedValues = new[] { 1, 2, 3 };\n            var values = module.InvokeMethod(\"values\", pyDict).GetAndDispose<List<int>>();\n            CollectionAssert.AreEquivalent(expectedValues, values);\n\n            // Test items() method\n            using var itemsResult = module.InvokeMethod(\"items\", pyDict);\n            Assert.IsNotNull(itemsResult);\n            var itemsLength = PythonEngine.Eval($\"len({itemsResult.Repr()})\").As<int>();\n            Assert.AreEqual(3, itemsLength);\n\n            // Test contains and get\n            foreach (var (key, value) in keys.Zip(values))\n            {\n                using var pyKey = key.ToPython();\n                Assert.IsTrue(module.InvokeMethod(\"contains\", pyDict, pyKey).As<bool>());\n                Assert.AreEqual(value, module.InvokeMethod(\"get\", pyDict, pyKey).As<int>());\n            }\n\n            // Test non-existing key\n            using var pyNonExistingKey = \"d\".ToPython();\n            Assert.IsFalse(module.InvokeMethod(\"contains\", pyDict, pyNonExistingKey).As<bool>());\n\n            // Test pop\n            using var pyExistingKey = keys[0].ToPython();\n            var popped = module.InvokeMethod(\"pop\", pyDict, pyExistingKey).As<int>();\n            Assert.AreEqual(1, popped);\n            Assert.IsFalse(module.InvokeMethod(\"contains\", pyDict, pyExistingKey).As<bool>());\n\n            // Test setdefault with existing key\n            using var pyExistingKey2 = keys[1].ToPython();\n            var setdefaultExisting = module.InvokeMethod(\"setdefault\", pyDict, pyExistingKey2, 999.ToPython()).As<int>();\n            Assert.AreEqual(2, setdefaultExisting); // Should return existing value\n\n            // Test setdefault with new key\n            using var pyNewKey = \"new\".ToPython();\n            using var pyDefaultValue = 100.ToPython();\n            var setdefaultNew = module.InvokeMethod(\"setdefault\", pyDict, pyNewKey, pyDefaultValue).As<int>();\n            Assert.AreEqual(100, setdefaultNew);\n            Assert.IsTrue(module.InvokeMethod(\"contains\", pyDict, pyNewKey).As<bool>());\n\n            // Test update\n            using var updateDict = new PyDict();\n            updateDict.SetItem(\"x\".ToPython(), 10.ToPython());\n            updateDict.SetItem(\"y\".ToPython(), 20.ToPython());\n            module.InvokeMethod(\"update\", pyDict, updateDict);\n\n            Assert.AreEqual(10, module.InvokeMethod(\"get\", pyDict, \"x\".ToPython()).As<int>());\n            Assert.AreEqual(20, module.InvokeMethod(\"get\", pyDict, \"y\".ToPython()).As<int>());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Benchmarks/SecurityBenchmarkTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Benchmarks\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class SecurityBenchmarkTests\n    {\n        [TestCase(1)]\n        [TestCase(10)]\n        public void EvaluatesInAccountCurrency(decimal conversionRate)\n        {\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true, true, false),\n                new Cash(Currencies.USD, 0, conversionRate),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            var price = 25;\n            security.SetMarketPrice(new Tick { Value = price });\n            var benchmark = new SecurityBenchmark(security);\n\n            Assert.AreEqual(price * conversionRate, benchmark.Evaluate(DateTime.Now));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/BinaryComparisonTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq.Expressions;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class BinaryComparisonTests\n    {\n        [Test]\n        [TestCase(ExpressionType.Equal, true, false)]\n        [TestCase(ExpressionType.NotEqual, false, true)]\n        [TestCase(ExpressionType.LessThan, false, true)]\n        [TestCase(ExpressionType.LessThanOrEqual, true, true)]\n        [TestCase(ExpressionType.GreaterThan, false, false)]\n        [TestCase(ExpressionType.GreaterThanOrEqual, true, false)]\n        public void EvaluatesComparison(ExpressionType type, bool expected1, bool expected2)\n        {\n            const int left1 = 1;\n            const int right1 = 1;\n            const int left2 = 2;\n            const int right2 = 3;\n\n            var comparison = BinaryComparison.FromExpressionType(type);\n\n            var actual1 = comparison.Evaluate(left1, right1);\n            Assert.AreEqual(expected1, actual1);\n\n            var actual2 = comparison.Evaluate(left2, right2);\n            Assert.AreEqual(expected2, actual2);\n        }\n\n        [Test]\n        [TestCase(ExpressionType.Equal, true, false)]\n        [TestCase(ExpressionType.NotEqual, false, true)]\n        [TestCase(ExpressionType.LessThan, false, false)]\n        [TestCase(ExpressionType.LessThanOrEqual, true, false)]\n        [TestCase(ExpressionType.GreaterThan, false, true)]\n        [TestCase(ExpressionType.GreaterThanOrEqual, true, true)]\n        public void EvaluatesFlippedOperandsComparison(ExpressionType type, bool expected1, bool expected2)\n        {\n            const int left1 = 1;\n            const int right1 = 1;\n            const int left2 = 2;\n            const int right2 = 3;\n\n            var comparison = BinaryComparison.FromExpressionType(type).FlipOperands();\n\n            var actual1 = comparison.Evaluate(left1, right1);\n            Assert.AreEqual(expected1, actual1);\n\n            var actual2 = comparison.Evaluate(left2, right2);\n            Assert.AreEqual(expected2, actual2);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/BrokerageNameTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class BrokerageNameTests\n    {\n        [Test]\n        public void BrokerageNameEnumsAreNumberedCorrectly()\n        {\n            Assert.AreEqual((int) BrokerageName.Default, 0);\n            Assert.AreEqual((int) BrokerageName.QuantConnectBrokerage, 0);\n            Assert.AreEqual((int) BrokerageName.InteractiveBrokersBrokerage, 1);\n            Assert.AreEqual((int) BrokerageName.TradierBrokerage, 2);\n            Assert.AreEqual((int) BrokerageName.OandaBrokerage, 3);\n            Assert.AreEqual((int) BrokerageName.FxcmBrokerage, 4);\n            Assert.AreEqual((int) BrokerageName.Bitfinex, 5);\n            Assert.AreEqual((int) BrokerageName.Coinbase, 32);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/AlpacaBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AlpacaBrokerageModelTests\n    {\n        private static IEnumerable<TestCaseData> OrderOusideRegularHoursTestCases\n        {\n            get\n            {\n                yield return new(OrderType.Market, TimeInForce.Day, false);\n                yield return new(OrderType.Market, TimeInForce.GoodTilCanceled, false);\n                yield return new(OrderType.Market, TimeInForce.GoodTilDate(DateTime.UtcNow.AddDays(7)), false);\n\n                yield return new(OrderType.StopMarket, TimeInForce.Day, false);\n                yield return new(OrderType.StopMarket, TimeInForce.GoodTilCanceled, false);\n                yield return new(OrderType.StopMarket, TimeInForce.GoodTilDate(DateTime.UtcNow.AddDays(7)), false);\n\n                yield return new(OrderType.StopLimit, TimeInForce.Day, false);\n                yield return new(OrderType.StopLimit, TimeInForce.GoodTilCanceled, false);\n                yield return new(OrderType.StopLimit, TimeInForce.GoodTilDate(DateTime.UtcNow.AddDays(7)), false);\n\n                yield return new(OrderType.Limit, TimeInForce.Day, true); // The only supported case\n                yield return new(OrderType.Limit, TimeInForce.GoodTilCanceled, false);\n                yield return new(OrderType.Limit, TimeInForce.GoodTilDate(DateTime.UtcNow.AddDays(7)), false);\n            }\n        }\n\n        [TestCaseSource(nameof(OrderOusideRegularHoursTestCases))]\n        public void CanSubmitOrderWhenOutsideRegularTradingHours(OrderType orderType, TimeInForce timeInForce, bool shouldSubmit)\n        {\n            var security = TestsHelpers.GetSecurity(symbol: \"AAPL\", securityType: SecurityType.Equity, market: Market.USA);\n            var symbol = security.Symbol;\n\n            var orderProperties = new AlpacaOrderProperties()\n            {\n                OutsideRegularTradingHours = true,\n                TimeInForce = timeInForce\n            };\n            Order order = orderType switch\n            {\n                OrderType.Market => new MarketOrder(symbol, 1, DateTime.UtcNow, properties: orderProperties),\n                OrderType.Limit => new LimitOrder(symbol, 1, 100m, DateTime.UtcNow, properties: orderProperties),\n                OrderType.StopMarket => new StopMarketOrder(symbol, 1, 100m, DateTime.UtcNow, properties: orderProperties),\n                OrderType.StopLimit => new StopLimitOrder(symbol, 1, 100m, 90m, DateTime.UtcNow, properties: orderProperties),\n                _ => throw new ArgumentException($\"Unsupported order type: {orderType}\"),\n            };\n\n            var brokerageModel = new AlpacaBrokerageModel();\n            var canSubmit = brokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.That(canSubmit, Is.EqualTo(shouldSubmit));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/BinanceBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Brokerages;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class BinanceBrokerageModelTests\n    {\n        private static readonly Symbol _btceur = Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Binance);\n\n        protected virtual BinanceBrokerageModel BinanceBrokerageModel => new();\n\n        [TestCase(0.01, true)]\n        [TestCase(0.000009, false)]\n        public void CanSubmitMarketOrder_OrderSizeIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            var order = new Mock<MarketOrder>();\n            order.Setup(mock => mock.Quantity).Returns(orderQuantity);\n\n            var security = GetSecurity();\n            security.Cache.AddData(new Tick\n            {\n                AskPrice = 50001,\n                BidPrice = 49999,\n                Time = DateTime.UtcNow,\n                Symbol = _btceur,\n                TickType = TickType.Quote,\n                AskSize = 1,\n                BidSize = 1\n            });\n\n            Assert.AreEqual(isValidOrderQuantity, BinanceBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                var price = order.Object.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderSize(security, order.Object.Quantity, price), message.Message);\n            }\n        }\n\n        [TestCase(0.002, 5500, true)]\n        [TestCase(0.003, 4500, true)]\n        [TestCase(0.0002, 4500, false)]\n        public void CanSubmitLimitOrder_OrderSizeIsLargeEnough(decimal orderQuantity, decimal limitPrice, bool isValidOrderQuantity)\n        {\n            var order = new Mock<LimitOrder>();\n            order.Setup(mock => mock.Quantity).Returns(orderQuantity);\n            order.Object.LimitPrice = limitPrice;\n\n            var security = GetSecurity();\n            Assert.AreEqual(isValidOrderQuantity, BinanceBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderSize(security, order.Object.Quantity, order.Object.LimitPrice), message.Message);\n            }\n        }\n\n        [TestCase(0.002, 5500, 5500, true)]\n        [TestCase(0.001, 4500, 5500, false)]\n        [TestCase(0.001, 5500, 4500, false)]\n        [TestCase(0.003, 4500, 5500, true)]\n        [TestCase(0.003, 5500, 4500, true)]\n        public void CanSubmitStopLimitOrder_OrderSizeIsLargeEnough(decimal orderQuantity, decimal stopPrice, decimal limitPrice, bool isValidOrderQuantity)\n        {\n            var order = new Mock<StopLimitOrder>();\n            order.Setup(mock => mock.Quantity).Returns(orderQuantity);\n            order.Object.StopPrice = stopPrice;\n            order.Object.LimitPrice = limitPrice;\n\n            var security = GetSecurity();\n            Assert.AreEqual(isValidOrderQuantity, BinanceBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderSize(security, order.Object.Quantity, Math.Min(order.Object.LimitPrice, order.Object.StopPrice)), message.Message);\n            }\n        }\n\n        [Test]\n        public void CannotSubmitMarketOrder_IfPriceNotInitialized()\n        {\n            var order = new Mock<MarketOrder>\n            {\n                Object =\n                {\n                    Quantity = 1\n                }\n            };\n\n            var security = GetSecurity();\n\n            Assert.AreEqual(false, BinanceBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.NotNull(message);\n        }\n\n        [TestCase(nameof(BinanceBrokerageModel), SecurityType.Crypto, false)]\n        [TestCase(nameof(BinanceUSBrokerageModel), SecurityType.Crypto, false)]\n        [TestCase(nameof(BinanceFuturesBrokerageModel), SecurityType.CryptoFuture, true)]\n        [TestCase(nameof(BinanceCoinFuturesBrokerageModel), SecurityType.CryptoFuture, true)]\n        public void CannotSubmitStopMarketOrder_Always(string binanceBrokerageMode, SecurityType securityType, bool isCanSubmit)\n        {\n            var binanceBrokerageModel = binanceBrokerageMode switch\n            {\n                \"BinanceBrokerageModel\" => new BinanceBrokerageModel(),\n                \"BinanceUSBrokerageModel\" => new BinanceUSBrokerageModel(),\n                \"BinanceFuturesBrokerageModel\" => new BinanceFuturesBrokerageModel(AccountType.Margin),\n                \"BinanceCoinFuturesBrokerageModel\" => new BinanceCoinFuturesBrokerageModel(AccountType.Margin),\n                _ => throw new ArgumentException($\"Invalid binanceBrokerageModel value: '{binanceBrokerageMode}'.\")\n            };\n\n            var order = new Mock<StopMarketOrder>\n            {\n                Object =\n                {\n                    StopPrice = 3_000\n                }\n            };\n            order.Setup(mock => mock.Quantity).Returns(1);\n\n\n            var ETHUSDT = Symbol.Create(\"ETHUSDT\", securityType, Market.Binance);\n\n            var security = TestsHelpers.GetSecurity(securityType: ETHUSDT.SecurityType, symbol: ETHUSDT.Value, market: ETHUSDT.ID.Market, quoteCurrency: \"USDT\");\n\n            Assert.AreEqual(isCanSubmit, binanceBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            if (isCanSubmit)\n            {\n                Assert.IsNull(message);\n            }\n            else\n            {\n                Assert.NotNull(message);\n            }\n        }\n\n        [Test]\n        public void Returns1m_IfCashAccount()\n        {\n            var security = GetSecurity();\n            Assert.AreEqual(1m, new BinanceBrokerageModel(AccountType.Cash).GetLeverage(security));\n        }\n\n        [Test]\n        public void ReturnsCashBuyinPowerModel_ForCashAccount()\n        {\n            var security = GetSecurity();\n            Assert.IsInstanceOf<CashBuyingPowerModel>(new BinanceBrokerageModel(AccountType.Cash).GetBuyingPowerModel(security));\n        }\n\n        [Test]\n        public void ReturnBinanceFeeModel()\n        {\n            var security = GetSecurity();\n            Assert.IsInstanceOf<BinanceFeeModel>(BinanceBrokerageModel.GetFeeModel(security));\n        }\n\n        [Test]\n        public virtual void CryptoMapped()\n        {\n            var defaultMarkets = BinanceBrokerageModel.DefaultMarkets;\n            Assert.AreEqual(Market.Binance, defaultMarkets[SecurityType.Crypto]);\n        }\n\n        [TestFixture]\n        public class Margin\n        {\n\n            private readonly Symbol _btceur = Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Binance);\n            private Security _security;\n            private BinanceBrokerageModel _binanceBrokerageModel = new(AccountType.Margin);\n\n            [SetUp]\n            public void Init()\n            {\n                _security = TestsHelpers.GetSecurity(symbol: _btceur.Value, market: _btceur.ID.Market, quoteCurrency: \"EUR\");\n            }\n\n            [Test]\n            public void ReturnsSecurityMarginModel_ForMarginAccount()\n            {\n                Assert.IsInstanceOf<SecurityMarginModel>(_binanceBrokerageModel.GetBuyingPowerModel(_security));\n            }\n\n            [Test]\n            public virtual void Returns3m_IfMarginAccount()\n            {\n                Assert.AreEqual(3m, _binanceBrokerageModel.GetLeverage(_security));\n            }\n        }\n\n        private static Security GetSecurity()\n        {\n            return TestsHelpers.GetSecurity(symbol: _btceur.Value, market: _btceur.ID.Market, quoteCurrency: \"EUR\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/BinanceUSBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class BinanceUSBrokerageModelTests : BinanceBrokerageModelTests\n    {\n        protected override BinanceBrokerageModel BinanceBrokerageModel => new BinanceUSBrokerageModel();\n\n        [Test]\n        public void ThrowsError_IfMarginAccount()\n        {\n            Assert.Throws<ArgumentException>(() => new BinanceUSBrokerageModel(AccountType.Margin));\n        }\n\n        [Test]\n        public override void CryptoMapped()\n        {\n            var defaultMarkets = BinanceBrokerageModel.DefaultMarkets;\n            Assert.AreEqual(Market.BinanceUS, defaultMarkets[SecurityType.Crypto]);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/BitfinexBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class BitfinexBrokerageModelTests\n    {\n        private readonly BitfinexBrokerageModel _bitfinexBrokerageModel = new BitfinexBrokerageModel();\n\n        protected Symbol Symbol => Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Bitfinex);\n        protected Crypto Security\n        {\n            get\n            {\n                return new Crypto(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new Cash(\"ETH\", 0, 0),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        Symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        false,\n                        false,\n                        false\n                    ),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                );\n            }\n        }\n\n        [Test]\n        public void GetCashBuyingPowerModelTest()\n        {\n            BitfinexBrokerageModel model = new BitfinexBrokerageModel(AccountType.Cash);\n            Assert.IsInstanceOf<CashBuyingPowerModel>(model.GetBuyingPowerModel(Security));\n            Assert.AreEqual(1, model.GetLeverage(Security));\n        }\n\n        [Test]\n        public void GetSecurityMarginModelTest()\n        {\n            BitfinexBrokerageModel model = new BitfinexBrokerageModel(AccountType.Margin);\n            Assert.IsInstanceOf<SecurityMarginModel>(model.GetBuyingPowerModel(Security));\n            Assert.AreEqual(3.3M, model.GetLeverage(Security));\n        }\n\n        [Test]\n        public void GetEquityLeverage_ThrowsArgumentException_Test()\n        {\n            var equity = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var model = new BitfinexBrokerageModel();\n            Assert.Throws<ArgumentException>(() => model.GetLeverage(equity));\n        }\n\n        [Test]\n        public void GetCustomDataLeverageTest()\n        {\n            var dummy = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    QuantConnect.Symbol.Create(\"DUMMY\", SecurityType.Base, Market.Bitfinex),\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var model = new BitfinexBrokerageModel();\n            Assert.AreEqual(1M, model.GetLeverage(dummy));\n        }\n\n        [Test]\n        public void SetLeverage_ThrowsInvalidOperationException_Test()\n        {\n            Assert.Throws<InvalidOperationException>(() => Security.SetLeverage(2));\n        }\n\n        [Test]\n        public void SetLeverage_ThrowsInvalidOperationException_BrokerageModelSecurityInitializer_Test()\n        {\n            var crypto = GetCrypto(Symbol);\n\n            var brokerageInitializer = new BrokerageModelSecurityInitializer(\n                new BitfinexBrokerageModel(AccountType.Cash),\n                SecuritySeeder.Null);\n\n            brokerageInitializer.Initialize(crypto);\n            Assert.Throws<InvalidOperationException>(() => crypto.SetLeverage(2));\n        }\n\n        [Test]\n        public void SetLeverage_DoesNotThrowInvalidOperationException_BrokerageModelSecurityInitializer_Test()\n        {\n            var crypto = GetCrypto(Symbol);\n\n            var brokerageInitializer = new BrokerageModelSecurityInitializer(\n                new BitfinexBrokerageModel(AccountType.Margin),\n                SecuritySeeder.Null);\n\n            brokerageInitializer.Initialize(crypto);\n            Assert.DoesNotThrow(() => crypto.SetLeverage(2));\n        }\n\n        private Crypto GetCrypto(Symbol symbol)\n        {\n            return new Crypto(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(symbol.Value.RemoveFromEnd(Currencies.USD), 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n        }\n\n        [TestCase(0.01, true)]\n        [TestCase(0.00003, false)]\n        public void CanSubmitOrder_WhenQuantityIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            BrokerageMessageEvent message;\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            Assert.AreEqual(isValidOrderQuantity, _bitfinexBrokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(market: Market.Bitfinex), order.Object, out message));\n        }\n\n        [TestCase(OrderType.Limit, true)]\n        [TestCase(OrderType.Market, true)]\n        [TestCase(OrderType.StopMarket, true)]\n        [TestCase(OrderType.StopLimit, true)]\n        [TestCase(OrderType.LimitIfTouched, false)]\n        [TestCase(OrderType.MarketOnOpen, false)]\n        [TestCase(OrderType.MarketOnClose, false)]\n        [TestCase(OrderType.OptionExercise, false)]\n        [TestCase(OrderType.ComboMarket, false)]\n        [TestCase(OrderType.ComboLimit, false)]\n        [TestCase(OrderType.ComboLegLimit, false)]\n        [TestCase(OrderType.TrailingStop, false)]\n        public void CanSubmitOrderValidatesSupportedAndUnsupportedOrderTypes(OrderType orderType, bool isSupported)\n        {\n            var security = TestsHelpers.GetSecurity(market: Market.Bitfinex);\n            var order = new Mock<Order>();\n            order.Setup(o => o.Type).Returns(orderType);\n            order.Setup(o => o.Quantity).Returns(0.01m);\n            var result = _bitfinexBrokerageModel.CanSubmitOrder(security, order.Object, out var message);\n\n            // Verify correct handling of each order type\n            Assert.AreEqual(isSupported, result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/BrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing Moq;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Benchmarks;\nusing QuantConnect.Data;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Data.Shortable;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture]\n    public class BrokerageModelTests\n    {\n        [TestCaseSource(nameof(GetBrokerageNameTestCases))]\n        public void GetsCorrectBrokerageNameFromBrokerageInstance(IBrokerageModel brokerage, BrokerageName brokerageName)\n        {\n            Assert.AreEqual(brokerageName, BrokerageModel.GetBrokerageName(brokerage));\n        }\n\n        [TestCaseSource(nameof(GetCustomBrokerageNameTestCases))]\n        public void GetsCorrectCustomBrokerageNameFromBrokerageInstance_CSharp(IBrokerageModel brokerage, BrokerageName brokerageName)\n        {\n            Assert.AreEqual(brokerageName, BrokerageModel.GetBrokerageName(brokerage));\n        }\n\n        [TestCaseSource(nameof(GetBrokerageNameTestCases))]\n        public void GetsCorrectCustomBrokerageNameFromBrokerageInstance_Python(IBrokerageModel brokerage, BrokerageName brokerageName)\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel({brokerage.GetType().Name}):\n    pass\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                Assert.AreEqual(brokerageName, BrokerageModel.GetBrokerageName(new BrokerageModelPythonWrapper(PyCustomBrokerageModel())));\n            }\n        }\n\n        [Test]\n        public void CustomPythonBrokerageCanSubmitOrderMethodFailsWhenNoTupleIsReturned()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def CanSubmitOrder(self, security: SecurityType, order: Order, message: BrokerageMessageEvent):\n        return True\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"\");\n                Assert.Throws<ArgumentException>(() => model.CanSubmitOrder(security, _order.Object, out message));\n            }\n        }\n\n        [Test]\n        public void CustomPythonBrokerageCanSubmitOrderMethodDoesNotFailWhenTupleIsReturned()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def CanSubmitOrder(self, security: SecurityType, order: Order, message: BrokerageMessageEvent):\n        message = None\n        return True, message\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"\");\n                var result = false;\n                Assert.DoesNotThrow(() => result = model.CanSubmitOrder(security, _order.Object, out message));\n                Assert.IsTrue(result);\n                Assert.IsNull(message);\n            }\n        }\n\n        [Test]\n        public void CustomPythonBrokerageCanUpdateOrderMethodFailsWhenNoTupleIsReturned()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def CanUpdateOrder(self, security: SecurityType, order: Order, request: UpdateOrderRequest, message: BrokerageMessageEvent):\n        return False\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var updateRequest = new UpdateOrderRequest(DateTime.Now, 1, new UpdateOrderFields());\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"\");\n                Assert.Throws<ArgumentException>(() => model.CanUpdateOrder(security, _order.Object, updateRequest, out message));\n            }\n        }\n\n        [Test]\n        public void CustomPythonBrokerageCanUpdateOrderMethodDoesNotFailWhenTupleReturned()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def CanUpdateOrder(self, security: SecurityType, order: Order, request: UpdateOrderRequest, message: BrokerageMessageEvent):\n        message = BrokerageMessageEvent(BrokerageMessageType.Information, \"\"\"\", \"\"Order can not be updated\"\")\n        return False, message\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var updateRequest = new UpdateOrderRequest(DateTime.Now, 1, new UpdateOrderFields());\n                var result = true;\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"\");\n                Assert.DoesNotThrow(() => result = model.CanUpdateOrder(security, _order.Object, updateRequest, out message));\n                Assert.IsFalse(result);\n                Assert.AreEqual(\"Order can not be updated\", message.Message);\n            }\n        }\n\n        [TestCaseSource(nameof(GetBrokerageNameTestCases))]\n        public void CustomPythonBrokerageCanSubmitOrderMethodDoesNotFailWhenIsNotOverriden(IBrokerageModel brokerage, BrokerageName brokerageName)\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel({brokerage.GetType().Name}):\n    pass\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"Initial Message\");\n                Assert.DoesNotThrow(() => model.CanSubmitOrder(security, _order.Object, out message));\n\n                if (message != null)\n                {\n                    Assert.AreNotEqual(\"Initial Message\", message.Message);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetBrokerageNameTestCases))]\n        public void CustomPythonBrokerageCanUpdateOrderMethodDoesNotFailWhenIsNotOverriden(IBrokerageModel brokerage, BrokerageName brokerageName)\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel({brokerage.GetType().Name}):\n    pass\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var updateRequest = new UpdateOrderRequest(DateTime.Now, 1, new UpdateOrderFields());\n                var message = new BrokerageMessageEvent(BrokerageMessageType.Information, \"\", \"Initial Message\");\n                Assert.DoesNotThrow(() => model.CanUpdateOrder(security, _order.Object, updateRequest, out message));\n\n                if (message != null)\n                {\n                    Assert.AreNotEqual(\"Initial Message\", message.Message);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetBrokerageBuyingPowerModel))]\n        public void GetsCorrectBuyingPowerModelForSecurityAndAccountType(IBrokerageModel brokerage, AccountType accountType, SecurityType securityType, Type type)\n        {\n            var security = securityType == SecurityType.Equity\n                ? GetSecurity(Symbols.SPY)\n                : GetSecurity(Symbols.EURUSD);\n\n            var buyingPowerModel = brokerage?.GetBuyingPowerModel(security);\n\n            Assert.AreEqual(buyingPowerModel.GetType(), type);\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomPythonFillModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomFillModel(ImmediateFillModel):\n    def __init__(self):\n        super().__init__()\n\n    def MarketFill(self, asset, order):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetFillModel(self, security):\n        return CustomFillModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var fillModel = model.GetFillModel(security);\n                Assert.AreEqual(typeof(FillModelPythonWrapper), fillModel.GetType());\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)fillModel).MarketFill(security, new Mock<MarketOrder>().Object));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCSharpFillModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetFillModel(self, security):\n        return ImmediateFillModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n\n                var security = GetSecurity(Symbols.SPY);\n                security.SetLocalTimeKeeper(new LocalTimeKeeper(DateTime.Now, DateTimeZone.Utc));\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var fillModel = model.GetFillModel(security);\n                Assert.AreEqual(typeof(ImmediateFillModel), fillModel.GetType());\n                var order = new Mock<MarketOrder>();\n                var subscriptionDataConfigProvider = new Mock<ISubscriptionDataConfigProvider>();\n                var securitiesForOrders = new Dictionary<Order, Security>() { { order.Object, security } };\n                var fillModelParameters = new FillModelParameters(security, order.Object, subscriptionDataConfigProvider.Object, TimeSpan.Zero, securitiesForOrders);\n                var result = fillModel.Fill(fillModelParameters);\n                foreach (var entry in result)\n                {\n                    Assert.AreEqual(OrderStatus.Filled, entry.Status);\n                }\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomBenchmark()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBenchmarkModel:\n    def Evaluate(self, time):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetBenchmark(self, securities):\n        return CustomBenchmarkModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var timeKeeper = new TimeKeeper(DateTime.Now);\n                var securityManager = new SecurityManager(timeKeeper);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var benchmarkModel = model.GetBenchmark(securityManager);\n                Assert.AreEqual(typeof(BenchmarkPythonWrapper), benchmarkModel.GetType());\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)benchmarkModel).Evaluate(DateTime.Now));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpBenchmark()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetBenchmark(self, securities):\n        return super().GetBenchmark(securities)\n                \").GetAttr(\"CustomBrokerageModel\");\n                var timeKeeper = new TimeKeeper(DateTime.Now);\n                var subscriptionManager = new SubscriptionManager(timeKeeper);\n                var dataManager = new DataManagerStub();\n                subscriptionManager.SetDataManager(dataManager);\n                var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n                var securityService = dataManager.SecurityService;\n                var securityManager = new SecurityManager(timeKeeper);\n                securityManager.SetSecurityService((SecurityService)securityService);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var benchmarkModel = model.GetBenchmark(securityManager);\n                Assert.AreEqual(typeof(SecurityBenchmark), benchmarkModel.GetType());\n                var result = ((dynamic)benchmarkModel).Evaluate(DateTime.Now);\n                Assert.AreEqual(0m, result);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomFeeModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomFeeModel:\n    def GetOrderFee(self, security, order):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetFeeModel(self, securities):\n        return CustomFeeModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var feeModel = model.GetFeeModel(security);\n                Assert.AreEqual(typeof(FeeModelPythonWrapper), feeModel.GetType());\n                var order = new Mock<Order>();\n                var orderParameters = new Mock<OrderFeeParameters>(security, order.Object);\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)feeModel).GetOrderFee(orderParameters.Object));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpFeeModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetFeeModel(self, securities):\n        return FeeModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var feeModel = model.GetFeeModel(security);\n                Assert.AreEqual(typeof(FeeModel), feeModel.GetType());\n                var order = new Mock<Order>();\n                var orderParameters = new Mock<OrderFeeParameters>(security, order.Object);\n                var result = ((FeeModel)feeModel).GetOrderFee(orderParameters.Object);\n                Assert.AreEqual(Currencies.USD, result.Value.Currency);\n                Assert.AreEqual(0m, result.Value.Amount);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomSettlementModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomSettlementModel:\n    def ApplyFunds(self, parameters):\n        raise ValueError(\"\"Pepe\"\")\n\n    def Scan(self, parameters):\n        raise ValueError(\"\"Pepe2\"\")\n\n    def GetUnsettledCash(self):\n        raise ValueError(\"\"Pepe3\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetSettlementModel(self, securities):\n        return CustomSettlementModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var settlementModel = model.GetSettlementModel(security);\n                Assert.AreEqual(typeof(SettlementModelPythonWrapper), settlementModel.GetType());\n                var algorithm = new AlgorithmStub();\n                algorithm.SetDateTime(DateTime.Now);\n                var portfolio = algorithm.Portfolio;\n                var appyFundsParameters = new ApplyFundsSettlementModelParameters(portfolio, security, DateTime.Now, new CashAmount(1000, Currencies.USD), null);\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)settlementModel).ApplyFunds(appyFundsParameters));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n                var scanParameters = new ScanSettlementModelParameters(portfolio, security, DateTime.UtcNow);\n                ex = Assert.Throws<PythonException>(() => ((dynamic)settlementModel).Scan(scanParameters));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe2\", ex.Message);\n                ex = Assert.Throws<PythonException>(() => ((dynamic)settlementModel).GetUnsettledCash());\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe3\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpSettlementModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetSettlementModel(self, security):\n        return ImmediateSettlementModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var settlementModel = model.GetSettlementModel(security);\n                Assert.AreEqual(typeof(ImmediateSettlementModel), settlementModel.GetType());\n                var algorithm = new AlgorithmStub();\n                algorithm.SetDateTime(DateTime.Now);\n                var portfolio = algorithm.Portfolio;\n                var appyFundsParameters = new ApplyFundsSettlementModelParameters(portfolio, security, DateTime.Now, new CashAmount(1000, Currencies.USD), null);\n                Assert.DoesNotThrow(() => ((dynamic)settlementModel).ApplyFunds(appyFundsParameters));\n                var scanParameters = new ScanSettlementModelParameters(portfolio, security, DateTime.UtcNow);\n                Assert.DoesNotThrow(() => ((dynamic)settlementModel).Scan(scanParameters));\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomSlippageModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomSlippageModel:\n    def GetSlippageApproximation(self, asset, order):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetSlippageModel(self, security):\n        return CustomSlippageModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var slippageModel = model.GetSlippageModel(security);\n                Assert.AreEqual(typeof(SlippageModelPythonWrapper), slippageModel.GetType());\n                var order = new Mock<Order>();\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)slippageModel).GetSlippageApproximation(security, order.Object));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpSlippageModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetSlippageModel(self, security):\n        return NullSlippageModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var slippageModel = model.GetSlippageModel(security);\n                Assert.AreEqual(typeof(NullSlippageModel), slippageModel.GetType());\n                var order = new Mock<Order>();\n                var result = ((dynamic)slippageModel).GetSlippageApproximation(security, order.Object);\n                Assert.AreEqual(0m, result);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomBuyingPowerModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBuyingPowerModel(BuyingPowerModel):\n    def GetLeverage(self, security):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetBuyingPowerModel(self, security):\n        return CustomBuyingPowerModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var buyingPowerModel = model.GetBuyingPowerModel(security);\n                Assert.AreEqual(typeof(BuyingPowerModelPythonWrapper), buyingPowerModel.GetType());\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)buyingPowerModel).GetLeverage(security));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpBuyingPowerModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetBuyingPowerModel(self, security):\n        return BuyingPowerModel(1)\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var buyingPowerModel = model.GetBuyingPowerModel(security);\n                Assert.AreEqual(typeof(BuyingPowerModel), buyingPowerModel.GetType());\n                var result = ((dynamic)buyingPowerModel).GetLeverage(security);\n                Assert.AreEqual(1, result);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomShortableProvider()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomShortableProvider:\n    def FeeRate(self, symbol, localTime):\n        raise ValueError(\"\"Pepe\"\")\n    def RebateRate(self, symbol, localTime):\n        raise ValueError(\"\"Pepe\"\")\n    def ShortableQuantity(self, symbol, localTime):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetShortableProvider(self, security):\n        return CustomShortableProvider()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var shortableProvider = model.GetShortableProvider(security);\n                Assert.AreEqual(typeof(ShortableProviderPythonWrapper), shortableProvider.GetType());\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)shortableProvider).ShortableQuantity(security.Symbol, DateTime.Now));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpShortableProvider()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetShortableProvider(self, security):\n        return NullShortableProvider()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var shortableProvider = model.GetShortableProvider(security);\n                Assert.AreEqual(typeof(NullShortableProvider), shortableProvider.GetType());\n                var result = ((dynamic)shortableProvider).ShortableQuantity(security.Symbol, DateTime.Now);\n                Assert.IsNull(result);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCustomMarginInterestRateModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomMarginInterestRateModel:\n    def ApplyMarginInterestRate(self, parameters):\n        raise ValueError(\"\"Pepe\"\")\n\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetMarginInterestRateModel(self, security):\n        return CustomMarginInterestRateModel()\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var marginInterestRateModel = model.GetMarginInterestRateModel(security);\n                Assert.AreEqual(typeof(MarginInterestRateModelPythonWrapper), marginInterestRateModel.GetType());\n                var parameters = new MarginInterestRateParameters(security, DateTime.Now);\n                var ex = Assert.Throws<PythonException>(() => ((dynamic)marginInterestRateModel).ApplyMarginInterestRate(parameters));\n                Assert.AreEqual(\"ValueError\", ex.Type.Name);\n                Assert.AreEqual(\"Pepe\", ex.Message);\n            }\n        }\n\n        [Test]\n        public void BrokerageModelPythonWrapperWorksWithCsharpMarginInterestRateModel()\n        {\n            using (Py.GIL())\n            {\n                dynamic PyCustomBrokerageModel = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\nclass CustomBrokerageModel(DefaultBrokerageModel):\n    def GetMarginInterestRateModel(self, security):\n        return MarginInterestRateModel.Null\n                \").GetAttr(\"CustomBrokerageModel\");\n                var security = GetSecurity(Symbols.SPY);\n                var model = new BrokerageModelPythonWrapper(PyCustomBrokerageModel());\n                var marginInterestRate = model.GetMarginInterestRateModel(security);\n                Assert.AreEqual(\"QuantConnect.Securities.MarginInterestRateModel+NullMarginInterestRateModel\", marginInterestRate.GetType().ToString());\n                var parameters = new MarginInterestRateParameters(security, DateTime.Now);\n                Assert.DoesNotThrow(() => ((IMarginInterestRateModel)marginInterestRate).ApplyMarginInterestRate(parameters));\n            }\n        }\n\n        [Test]\n        public void TradingTechnologiesBrokerageModelValidatesStopLimitOrders()\n        {\n            var model = new TradingTechnologiesBrokerageModel();\n            var symbol = Symbols.Future_CLF19_Jan2019;\n            var security = GetSecurity(symbol);\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, symbol, 4500m, 4500m));\n\n            var invalidStopLimit = new StopLimitOrder\n            {\n                Symbol = symbol,\n                Quantity = 1,\n                StopPrice = 4510m,\n                LimitPrice = 4505m\n            };\n\n            var canSubmit = model.CanSubmitOrder(security, invalidStopLimit, out var message);\n            Assert.IsFalse(canSubmit);\n            StringAssert.Contains(\"StopLimit Buy limit price must be greater than or equal to stop price\", message.Message);\n        }\n\n        [TestCase(BrokerageName.Alpaca, OrderType.MarketOnOpen, 10, -15, false)]\n        [TestCase(BrokerageName.Alpaca, OrderType.MarketOnOpen, 10, -10, true)]\n        [TestCase(BrokerageName.Alpaca, OrderType.MarketOnClose, 10, -15, false)]\n        [TestCase(BrokerageName.Alpaca, OrderType.MarketOnClose, 10, -10, true)]\n        [TestCase(BrokerageName.TradeStation, OrderType.MarketOnOpen, 10, -15, false)]\n        [TestCase(BrokerageName.TradeStation, OrderType.MarketOnOpen, 10, -10, true)]\n        [TestCase(BrokerageName.TradeStation, OrderType.MarketOnClose, 10, -15, false)]\n        [TestCase(BrokerageName.TradeStation, OrderType.MarketOnClose, 10, -10, true)]\n        [TestCase(BrokerageName.Tastytrade, OrderType.MarketOnOpen, 10, -15, false)]\n        [TestCase(BrokerageName.Tastytrade, OrderType.MarketOnOpen, 10, -10, false, Description = \"Not support MOO\")]\n        [TestCase(BrokerageName.Tastytrade, OrderType.MarketOnClose, 10, -15, false)]\n        [TestCase(BrokerageName.Tastytrade, OrderType.MarketOnClose, 10, -10, false, Description = \"doesn't support MOC\")]\n        [TestCase(BrokerageName.TradierBrokerage, OrderType.MarketOnOpen, 10, -15, false)]\n        [TestCase(BrokerageName.TradierBrokerage, OrderType.MarketOnOpen, 10, -10, false, Description = \"Not support MOO\")]\n        [TestCase(BrokerageName.TradierBrokerage, OrderType.MarketOnClose, 10, -15, false)]\n        [TestCase(BrokerageName.TradierBrokerage, OrderType.MarketOnClose, 10, -10, false, Description = \"Not support MOC\")]\n        public void BrokerageModelCanSubmitNotSupportCrossZeroOrderType(BrokerageName brokerageName, OrderType orderType, decimal holdingQuantity, decimal orderQuantity, bool isShouldSubmitOrder)\n        {\n            // Initialize: BrokerageModel\n            var brokerageModel = GetBrokerageModel(brokerageName);\n\n            // Initialize: Order\n            var AAPL = Symbols.AAPL;\n            Order order = orderType switch\n            {\n                OrderType.MarketOnOpen => new MarketOnOpenOrder(AAPL, orderQuantity, new(default)),\n                OrderType.MarketOnClose => new MarketOnCloseOrder(AAPL, orderQuantity, new(default)),\n                _ => throw new NotImplementedException()\n            };\n\n            // Initialize: Security\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(new DateTime(2025, 09, 16, 7, 0, 0).ConvertToUtc(algorithm.TimeZone));\n            algorithm.AddEquity(AAPL.Value).Holdings.SetHoldings(209m, holdingQuantity);\n            var security = algorithm.Securities[AAPL];\n\n            var isPossibleUpdate = brokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.That(isPossibleUpdate, Is.EqualTo(isShouldSubmitOrder));\n        }\n\n        private static IEnumerable<TestCaseData> MarketOnOpenOrderTimeExecutions\n        {\n            get\n            {\n                var ts = BrokerageName.TradeStation;\n                var alpaca = BrokerageName.Alpaca;\n                var ib = BrokerageName.InteractiveBrokersBrokerage;\n\n                foreach (var bn in new BrokerageName[3] { ts, alpaca, ib })\n                {\n                    yield return new TestCaseData(bn, Symbols.SPY, new DateTime(2025, 04, 30, 8, 0, 0), true);\n                    yield return new TestCaseData(bn, Symbols.SPY, new DateTime(2025, 04, 30, 12, 0, 0), false);\n                    yield return new TestCaseData(bn, Symbols.SPY, new DateTime(2025, 04, 30, 15, 30, 0), false);\n                    yield return new TestCaseData(bn, Symbols.SPY, new DateTime(2025, 04, 30, 6, 0, 0), true);\n                    yield return new TestCaseData(bn, Symbols.SPY, new DateTime(2025, 04, 30, 9, 27, 59), true);\n\n                    yield return new TestCaseData(bn, Symbols.Future_CLF19_Jan2019, new DateTime(2025, 04, 30, 9, 27, 59), false).SetDescription(\"The Brokerage doesn't support MOO for future\");\n                    yield return new TestCaseData(bn, Symbols.SBIN, new DateTime(2025, 04, 30, 9, 0, 0), true).SetDescription(\"Allow place order with different market\");\n                }\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 15, 59, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 15, 59, 0), false);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 16, 0, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 17, 0, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 17, 0, 0), false);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 17, 0, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 17, 59, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 17, 59, 0), false);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 17, 59, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 19, 0, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 19, 0, 0), true);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 19, 0, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 19, 1, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 19, 1, 0), true);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 19, 1, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 21, 0, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 21, 0, 0), true);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 21, 0, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 9, 28, 0), true);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 9, 28, 0), false);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 9, 28, 0), false);\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 04, 30, 5, 59, 0), false);\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 04, 30, 5, 59, 0), true);\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 04, 30, 5, 59, 0), true);\n\n                yield return new TestCaseData(ts, Symbols.SPY_C_192_Feb19_2016, new DateTime(2025, 04, 30, 9, 28, 0), true).SetDescription(\"The TS supports option\");\n                yield return new TestCaseData(alpaca, Symbols.SPY_C_192_Feb19_2016, new DateTime(2025, 04, 30, 9, 28, 0), false).SetDescription(\"The Alpaca doesn't support option\");\n                yield return new TestCaseData(ib, Symbols.SPY_C_192_Feb19_2016, new DateTime(2025, 04, 30, 5, 59, 0), true).SetDescription(\"The IB supports option\");\n\n                yield return new TestCaseData(ts, Symbols.SPY, new DateTime(2025, 09, 13, 12, 0, 0), true).SetDescription(\"2025 September Saturday\");\n                yield return new TestCaseData(alpaca, Symbols.SPY, new DateTime(2025, 09, 13, 12, 0, 0), true).SetDescription(\"2025 September Saturday\");\n                yield return new TestCaseData(ib, Symbols.SPY, new DateTime(2025, 09, 13, 12, 0, 0), true).SetDescription(\"2025 September Saturday\");\n            }\n        }\n\n        [TestCaseSource(nameof(MarketOnOpenOrderTimeExecutions))]\n        public void CanSubmitMarketOnOpen(BrokerageName brokerageName, Symbol symbol, DateTime algorithmDateTime, bool shouldSubmit)\n        {\n            var brokerageModel = GetBrokerageModel(brokerageName);\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetStartDate(algorithmDateTime.Date);\n\n            var security = algorithm.AddSecurity(symbol);\n            algorithm.SetFinishedWarmingUp();\n            // Set algorithm time to the given hour\n            algorithm.SetDateTime(algorithmDateTime.ConvertToUtc(security.Exchange.TimeZone));\n\n            security.Update([new Tick(algorithm.Time, symbol, string.Empty, string.Empty, 10m, 550m)], typeof(TradeBar));\n\n            var order = new MarketOnOpenOrder(security.Symbol, 1, DateTime.UtcNow);\n\n            var canSubmit = brokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.That(canSubmit, Is.EqualTo(shouldSubmit));\n        }\n\n        /// <summary>\n        /// Creates a brokerage model instance for the specified <see cref=\"BrokerageName\"/>.\n        /// </summary>\n        /// <param name=\"brokerageName\">The <see cref=\"BrokerageName\"/> identifying which brokerage model to create.</param>\n        /// <returns>An <see cref=\"IBrokerageModel\"/> corresponding to the given <paramref name=\"brokerageName\"/>.</returns>\n        private static IBrokerageModel GetBrokerageModel(BrokerageName brokerageName) => brokerageName switch\n        {\n            BrokerageName.Alpaca => new AlpacaBrokerageModel(),\n            BrokerageName.TradeStation => new TradeStationBrokerageModel(),\n            BrokerageName.Tastytrade => new TastytradeBrokerageModel(),\n            BrokerageName.TradierBrokerage => new TradierBrokerageModel(),\n            BrokerageName.InteractiveBrokersBrokerage => new InteractiveBrokersBrokerageModel(),\n            _ => throw new NotImplementedException($\"{nameof(BrokerageModelTests)}.{nameof(GetBrokerageModel)}: does not support brokerage '{brokerageName}'.\")\n        };\n\n        private static Security GetSecurity(Symbol symbol) =>\n        new(symbol,\n            SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n            new Cash(Currencies.USD, 0, 1),\n            SymbolProperties.GetDefault(Currencies.USD),\n            ErrorCurrencyConverter.Instance,\n            RegisteredSecurityDataTypesProvider.Null,\n        new SecurityCache());\n\n        private static Mock<MarketOrder> _order = new Mock<MarketOrder>\n        {\n            Object =\n                {\n                    Quantity = 100\n                }\n        };\n\n        private static TestCaseData[] GetBrokerageNameTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(new InteractiveBrokersBrokerageModel(), BrokerageName.InteractiveBrokersBrokerage),\n                new TestCaseData(new TradierBrokerageModel(), BrokerageName.TradierBrokerage),\n                new TestCaseData(new OandaBrokerageModel(), BrokerageName.OandaBrokerage),\n                new TestCaseData(new FxcmBrokerageModel(), BrokerageName.FxcmBrokerage),\n                new TestCaseData(new BitfinexBrokerageModel(), BrokerageName.Bitfinex),\n                new TestCaseData(new BinanceUSBrokerageModel(), BrokerageName.BinanceUS),\n                new TestCaseData(new BinanceBrokerageModel(), BrokerageName.Binance),\n                new TestCaseData(new CoinbaseBrokerageModel(), BrokerageName.Coinbase),\n                new TestCaseData(new AlphaStreamsBrokerageModel(), BrokerageName.AlphaStreams),\n                new TestCaseData(new ZerodhaBrokerageModel(), BrokerageName.Zerodha),\n                new TestCaseData(new AxosClearingBrokerageModel(), BrokerageName.Axos),\n                new TestCaseData(new TradingTechnologiesBrokerageModel(), BrokerageName.TradingTechnologies),\n                new TestCaseData(new SamcoBrokerageModel(), BrokerageName.Samco),\n                new TestCaseData(new KrakenBrokerageModel(), BrokerageName.Kraken),\n                new TestCaseData(new ExanteBrokerageModel(), BrokerageName.Exante),\n                new TestCaseData(new FTXUSBrokerageModel(), BrokerageName.FTXUS),\n                new TestCaseData(new FTXBrokerageModel(), BrokerageName.FTX),\n                new TestCaseData(new BybitBrokerageModel(), BrokerageName.Bybit),\n                new TestCaseData(new DefaultBrokerageModel(), BrokerageName.Default)\n            };\n        }\n\n        private class CustomInteractiveBrokersBrokerageModel : InteractiveBrokersBrokerageModel { }\n        private class CustomTradierBrokerageModel : TradierBrokerageModel { }\n        private class CustomOandaBrokerageModel : OandaBrokerageModel { }\n        private class CustomFxcmBrokerageModel : FxcmBrokerageModel { }\n        private class CustomBitfinexBrokerageModel : BitfinexBrokerageModel { }\n        private class CustomBinanceUSBrokerageModel : BinanceUSBrokerageModel { }\n        private class CustomBinanceBrokerageModel : BinanceBrokerageModel { }\n        private class CustomCoinbaseBrokerageModel : CoinbaseBrokerageModel { }\n        private class CustomAlphaStreamsBrokerageModel : AlphaStreamsBrokerageModel { }\n        private class CustomZerodhaBrokerageModel : ZerodhaBrokerageModel { }\n        private class CustomAxosBrokerageModel : AxosClearingBrokerageModel { }\n        private class CustomTradingTechnologiesBrokerageModel : TradingTechnologiesBrokerageModel { }\n        private class CustomSamcoBrokerageModel : SamcoBrokerageModel { }\n        private class CustomKrakenBrokerageModel : KrakenBrokerageModel { }\n        private class CustomExanteBrokerageModel : ExanteBrokerageModel { }\n        private class CustomFTXUSBrokerageModel : FTXUSBrokerageModel { }\n        private class CustomFTXBrokerageModel : FTXBrokerageModel { }\n        private class CustomBybitBrokerageModel : BybitBrokerageModel { }\n        private class CustomDefaultBrokerageModel : DefaultBrokerageModel { }\n\n        private static TestCaseData[] GetCustomBrokerageNameTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(new CustomInteractiveBrokersBrokerageModel(), BrokerageName.InteractiveBrokersBrokerage),\n                new TestCaseData(new CustomTradierBrokerageModel(), BrokerageName.TradierBrokerage),\n                new TestCaseData(new CustomOandaBrokerageModel(), BrokerageName.OandaBrokerage),\n                new TestCaseData(new CustomFxcmBrokerageModel(), BrokerageName.FxcmBrokerage),\n                new TestCaseData(new CustomBitfinexBrokerageModel(), BrokerageName.Bitfinex),\n                new TestCaseData(new CustomBinanceUSBrokerageModel(), BrokerageName.BinanceUS),\n                new TestCaseData(new CustomBinanceBrokerageModel(), BrokerageName.Binance),\n                new TestCaseData(new CustomCoinbaseBrokerageModel(), BrokerageName.Coinbase),\n                new TestCaseData(new CustomAlphaStreamsBrokerageModel(), BrokerageName.AlphaStreams),\n                new TestCaseData(new CustomZerodhaBrokerageModel(), BrokerageName.Zerodha),\n                new TestCaseData(new CustomAxosBrokerageModel(), BrokerageName.Axos),\n                new TestCaseData(new CustomTradingTechnologiesBrokerageModel(), BrokerageName.TradingTechnologies),\n                new TestCaseData(new CustomSamcoBrokerageModel(), BrokerageName.Samco),\n                new TestCaseData(new CustomKrakenBrokerageModel(), BrokerageName.Kraken),\n                new TestCaseData(new CustomExanteBrokerageModel(), BrokerageName.Exante),\n                new TestCaseData(new CustomFTXUSBrokerageModel(), BrokerageName.FTXUS),\n                new TestCaseData(new CustomFTXBrokerageModel(), BrokerageName.FTX),\n                new TestCaseData(new CustomBybitBrokerageModel(), BrokerageName.Bybit),\n                new TestCaseData(new CustomDefaultBrokerageModel(), BrokerageName.Default)\n            };\n        }\n\n        private static TestCaseData[] GetBrokerageBuyingPowerModel()\n        {\n            return new[]\n            {\n                new TestCaseData(new InteractiveBrokersBrokerageModel(AccountType.Cash), AccountType.Cash, SecurityType.Equity, typeof(SecurityMarginModel)),\n                new TestCaseData(new InteractiveBrokersBrokerageModel(AccountType.Margin), AccountType.Margin, SecurityType.Equity, typeof(SecurityMarginModel)),\n                new TestCaseData(new InteractiveBrokersBrokerageModel(AccountType.Cash), AccountType.Cash, SecurityType.Forex, typeof(CashBuyingPowerModel)),\n                new TestCaseData(new InteractiveBrokersBrokerageModel(AccountType.Margin), AccountType.Margin, SecurityType.Forex, typeof(SecurityMarginModel)),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/BybitBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Tests.Brokerages;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class BybitBrokerageModelTests\n    {\n        private static readonly Symbol BTCUSDT = Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Bybit);\n        private static readonly Symbol BTCUSDT_Future = Symbol.Create(\"BTCUSDT\", SecurityType.CryptoFuture, Market.Bybit);\n        private Security _crypto;\n        private Security _cryptoFuture;\n\n        protected virtual BybitBrokerageModel BybitBrokerageModel => new();\n\n        [SetUp]\n        public void Init()\n        {\n            _crypto = GetSecurity(BTCUSDT);\n            _cryptoFuture = GetSecurity(BTCUSDT_Future);\n        }\n\n        private static Security GetSecurity(Symbol symbol)\n        {\n            return TestsHelpers.GetSecurity(symbol: symbol.Value,\n                securityType: symbol.SecurityType,\n                market: symbol.ID.Market,\n                quoteCurrency: \"USDT\");\n        }\n\n        private static decimal GetMinOrderSize(Symbol symbol)\n        {\n            var crypto = GetSecurity(symbol);\n            return crypto.SymbolProperties.MinimumOrderSize ?? 0;\n        }\n\n        private static IEnumerable<TestCaseData> MarketOrderSizeTestCases\n        {\n            get\n            {\n                yield return new TestCaseData(0.01m, true);\n                yield return new TestCaseData(0.000001m, false);\n                yield return new TestCaseData(GetMinOrderSize(BTCUSDT), true);\n            }\n        }\n\n        [TestCaseSource(nameof(MarketOrderSizeTestCases))]\n        public void CanSubmitMarketOrder_OrderSizeIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            var order = new Mock<MarketOrder>();\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            _crypto.Cache.AddData(new Tick\n            {\n                AskPrice = 50001,\n                BidPrice = 49999,\n                Time = DateTime.UtcNow,\n                Symbol = BTCUSDT,\n                TickType = TickType.Quote,\n                AskSize = 1,\n                BidSize = 1\n            });\n\n            Assert.AreEqual(isValidOrderQuantity, BybitBrokerageModel.CanSubmitOrder(_crypto, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderQuantity(_crypto, order.Object.Quantity), message.Message);\n            }\n        }\n\n        private static IEnumerable<TestCaseData> LimitOrderSizeTestCases\n        {\n            get\n            {\n                yield return new TestCaseData(0.01m, 4500m, true);\n                yield return new TestCaseData(0.000001m, 4500m, false);\n                yield return new TestCaseData(GetMinOrderSize(BTCUSDT), 4500m, true);\n            }\n        }\n\n        [TestCaseSource(nameof(LimitOrderSizeTestCases))]\n        public void CanSubmitLimitOrder_OrderSizeIsLargeEnough(decimal orderQuantity, decimal limitPrice, bool isValidOrderQuantity)\n        {\n            var order = new Mock<LimitOrder>\n            {\n                Object =\n                {\n                    LimitPrice = limitPrice\n                }\n            };\n\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            Assert.AreEqual(isValidOrderQuantity, BybitBrokerageModel.CanSubmitOrder(_crypto, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderQuantity(_crypto, order.Object.Quantity), message.Message);\n            }\n        }\n\n        [TestCase(0.002, 5500, 5500, true)]\n        [TestCase(0.000001, 5500, 5500, false)]\n        [TestCase(0.002, 5500, 4500, true)]\n        [TestCase(0.003, 4500, 5500, true)]\n        [TestCase(0.003, 5500, 4500, true)]\n        public void CanSubmitStopLimitOrder_OrderSizeIsLargeEnough(decimal orderQuantity, decimal stopPrice, decimal limitPrice, bool isValidOrderQuantity)\n        {\n            var order = new Mock<StopLimitOrder>\n            {\n                Object =\n                {\n                    StopPrice = stopPrice,\n                    LimitPrice = limitPrice\n                }\n            };\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            Assert.AreEqual(isValidOrderQuantity, BybitBrokerageModel.CanSubmitOrder(_crypto, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderQuantity(_crypto, order.Object.Quantity), message.Message);\n            }\n        }\n\n        [Test]\n        public void CanSubmitMarketOrder_IfPriceNotInitialized()\n        {\n            var order = new Mock<MarketOrder>();\n            order.Setup(x => x.Quantity).Returns(1m);\n\n            var security = TestsHelpers.GetSecurity(symbol: BTCUSDT.Value, market: BTCUSDT.ID.Market, quoteCurrency: \"USDT\");\n\n            Assert.AreEqual(true, BybitBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.Null(message);\n        }\n\n        [TestCase(0.002, 5500,  true)]\n        [TestCase(0.000001, 5500,  false)]\n\n        [TestCase(0.002, 4500,  true)]\n        [TestCase(0.002, 5500,  true)]\n        [TestCase(0.003, 4500,  true)]\n        [TestCase(0.003, 5500,  true)]\n        public void CanSubmitStopMarketOrder_OrderSizeIsLargeEnough(decimal orderQuantity, decimal stopPrice, bool isValidOrderQuantity)\n        {\n            var order = new Mock<StopMarketOrder>\n            {\n                Object =\n                {\n                    StopPrice = stopPrice\n                }\n            };\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            var security = TestsHelpers.GetSecurity(symbol: BTCUSDT.Value, market: BTCUSDT.ID.Market, quoteCurrency: \"USDT\");\n\n            Assert.AreEqual(isValidOrderQuantity, BybitBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.AreEqual(isValidOrderQuantity, message == null);\n            if (!isValidOrderQuantity)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderQuantity(_crypto, order.Object.Quantity),message.Message);\n            }\n        }\n\n        [TestCase(SecurityType.Crypto, AccountType.Cash, ExpectedResult = 1)]\n        [TestCase(SecurityType.Crypto, AccountType.Margin, ExpectedResult = 10)]\n        [TestCase(SecurityType.CryptoFuture, AccountType.Cash, ExpectedResult = 1)]\n        [TestCase(SecurityType.CryptoFuture, AccountType.Margin, ExpectedResult = 10)]\n        public decimal ReturnsCorrectLeverage(SecurityType securityType, AccountType accountType)\n        {\n            var security = securityType == SecurityType.Crypto ? _crypto : _cryptoFuture;\n            return new BybitBrokerageModel(accountType).GetLeverage(security);\n        }\n\n        [TestCase(SecurityType.Crypto, AccountType.Cash, typeof(CashBuyingPowerModel))]\n        [TestCase(SecurityType.Crypto, AccountType.Margin, typeof(SecurityMarginModel))]\n        [TestCase(SecurityType.CryptoFuture, AccountType.Cash, typeof(CryptoFutureMarginModel))]\n        [TestCase(SecurityType.CryptoFuture, AccountType.Margin, typeof(CryptoFutureMarginModel))]\n        public void ReturnsCorrectBuyingPowerModel(SecurityType securityType, AccountType accountType, Type expectedMarginModelType)\n        {\n            var security = securityType == SecurityType.Crypto ? _crypto : _cryptoFuture;\n            Assert.IsInstanceOf(expectedMarginModelType, new BybitBrokerageModel(accountType).GetBuyingPowerModel(security));\n        }\n\n        [TestCase(SecurityType.Crypto, typeof(BybitFeeModel))]\n        [TestCase(SecurityType.CryptoFuture, typeof(BybitFuturesFeeModel))]\n        [TestCase(SecurityType.Base, typeof(ConstantFeeModel))]\n        public void ReturnCorrectFeeModel(SecurityType securityType, Type expectedFeeModelType)\n        {\n            var security = securityType switch\n            {\n                SecurityType.Crypto => _crypto,\n                SecurityType.CryptoFuture => _cryptoFuture,\n                _ => TestsHelpers.GetSecurity(symbol: \"BTCUSDT\", securityType: SecurityType.Base, market: Market.Bybit, quoteCurrency: \"USDT\")\n            };\n\n            Assert.IsInstanceOf(expectedFeeModelType, BybitBrokerageModel.GetFeeModel(security));\n        }\n\n        [Test]\n        public virtual void CryptoMapped()\n        {\n            var defaultMarkets = BybitBrokerageModel.DefaultMarkets;\n            Assert.AreEqual(Market.Bybit, defaultMarkets[SecurityType.Crypto]);\n            Assert.AreEqual(Market.Bybit, defaultMarkets[SecurityType.CryptoFuture]);\n        }\n\n        [TestCase(SecurityType.Crypto, false)]\n        [TestCase(SecurityType.CryptoFuture, true)]\n        public void CannotUpdateOrder_IfSecurityIsNotCryptoFuture(SecurityType securityType, bool canUpdate)\n        {\n            var order = new Mock<MarketOrder>\n            {\n                Object =\n                {\n                    Id = 1,\n                    Quantity = 1,\n                    Status = OrderStatus.Submitted\n                }\n            };\n\n            var updateRequest = new UpdateOrderRequest(DateTime.UtcNow, 1, new UpdateOrderFields { Quantity = 2 });\n\n            var security = securityType == SecurityType.Crypto ? _crypto : _cryptoFuture;\n            Assert.AreEqual(canUpdate, BybitBrokerageModel.CanUpdateOrder(security, order.Object, updateRequest, out var message));\n\n            if (!canUpdate)\n            {\n                Assert.AreEqual(message.Message, Messages.DefaultBrokerageModel.OrderUpdateNotSupported);\n            }\n        }\n\n        [TestCase(OrderStatus.New, true)]\n        [TestCase(OrderStatus.Submitted, true)]\n        [TestCase(OrderStatus.PartiallyFilled, true)]\n        [TestCase(OrderStatus.UpdateSubmitted, true)]\n        [TestCase(OrderStatus.Canceled, false)]\n        [TestCase(OrderStatus.Filled, false)]\n        [TestCase(OrderStatus.Invalid, false)]\n        [TestCase(OrderStatus.None, false)]\n        [TestCase(OrderStatus.CancelPending, false)]\n        public void CannotUpdateOrder_IfWrongOrderStatus(OrderStatus status, bool canUpdate)\n        {\n            var order = new LimitOrder(BTCUSDT, 1, 1000, DateTime.Now) { Status = status };\n            var request = new UpdateOrderRequest(DateTime.UtcNow, 1, new UpdateOrderFields());\n\n            Assert.AreEqual(canUpdate, BybitBrokerageModel.CanUpdateOrder(_cryptoFuture, order, request, out var message));\n            if (!canUpdate)\n            {\n                Assert.AreEqual(\"NotSupported\", message.Code);\n            }\n\n        }\n\n        [TestCase(0.1, true)]\n        [TestCase(0.000001, false)]\n        public void CanUpdateOrder_OrderSizeIsLargeEnough(decimal newOrderQuantity, bool isLargeEnough)\n        {\n            var order = new LimitOrder(BTCUSDT, 1, 1000, DateTime.Now) { Status = OrderStatus.New };\n            var request = new UpdateOrderRequest(DateTime.UtcNow, 1, new UpdateOrderFields { Quantity = newOrderQuantity });\n\n            Assert.AreEqual(isLargeEnough, BybitBrokerageModel.CanUpdateOrder(_cryptoFuture, order, request, out var message));\n            if (!isLargeEnough)\n            {\n                Assert.AreEqual(Messages.DefaultBrokerageModel.InvalidOrderQuantity(_cryptoFuture, request.Quantity.Value), message.Message);\n            }\n\n        }\n\n        [TestFixture]\n        public class Margin\n        {\n\n            private readonly Symbol _btcusdt = Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Bybit);\n            private Security _security;\n            private static BybitBrokerageModel BybitBrokerageModel => new(AccountType.Margin);\n\n            [SetUp]\n            public void Init()\n            {\n                _security = TestsHelpers.GetSecurity(symbol: _btcusdt.Value, market: _btcusdt.ID.Market, quoteCurrency: \"USDT\");\n            }\n\n            [Test]\n            public void ReturnsSecurityMarginModel_ForMarginAccount()\n            {\n                Assert.IsInstanceOf<SecurityMarginModel>(BybitBrokerageModel.GetBuyingPowerModel(_security));\n            }\n\n            [Test]\n            public virtual void Returns10m_IfMarginAccount()\n            {\n                Assert.AreEqual(10m, BybitBrokerageModel.GetLeverage(_security));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/CoinbaseBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Tests.Brokerages;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class CoinbaseBrokerageModelTests\n    {\n        private readonly CoinbaseBrokerageModel _coinbaseBrokerageModel = new CoinbaseBrokerageModel();\n\n        [Test]\n        public void GetLeverageTest()\n        {\n            Assert.AreEqual(1, _coinbaseBrokerageModel.GetLeverage(TestsHelpers.GetSecurity()));\n        }\n\n        [Test]\n        public void GetFeeModelTest()\n        {\n            Assert.IsInstanceOf<CoinbaseFeeModel>(_coinbaseBrokerageModel.GetFeeModel(TestsHelpers.GetSecurity()));\n        }\n\n        [Test]\n        public void GetBuyingPowerModelTest()\n        {\n            Assert.IsInstanceOf<CashBuyingPowerModel>(_coinbaseBrokerageModel.GetBuyingPowerModel(TestsHelpers.GetSecurity()));\n        }\n\n        [Test]\n        public void CanUpdateOrderTest()\n        {\n            BrokerageMessageEvent message;\n            Assert.AreEqual(false, _coinbaseBrokerageModel.CanUpdateOrder(TestsHelpers.GetSecurity(), Mock.Of<Order>(),\n                new UpdateOrderRequest(DateTime.UtcNow, 1, new UpdateOrderFields()), out message));\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void CanSubmitOrder_WhenBrokerageIdIsCorrect(bool isUpdate)\n        {\n            BrokerageMessageEvent message;\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(10.0m);\n\n            if (isUpdate)\n            {\n                order.Object.BrokerId = new List<string>() {\"abc123\"};\n            }\n\n            Assert.AreEqual(!isUpdate, _coinbaseBrokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(), order.Object, out message));\n        }\n\n        [TestCase(0.01, true)]\n        [TestCase(0.0000000015, false)]\n        public void CanSubmitOrder_WhenQuantityIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            BrokerageMessageEvent message;\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            Assert.AreEqual(isValidOrderQuantity, _coinbaseBrokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(market: Market.Coinbase), order.Object, out message));\n        }\n\n        [TestCase(SecurityType.Crypto, true)]\n        [TestCase(SecurityType.Option, false)]\n        [TestCase(SecurityType.Cfd, false)]\n        [TestCase(SecurityType.Forex, false)]\n        [TestCase(SecurityType.Future, false)]\n        [TestCase(SecurityType.Equity, false)]\n        public void CanOnlySubmitCryptoOrders(SecurityType securityType, bool isValidSecurityType)\n        {\n            BrokerageMessageEvent message;\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(10.0m);\n\n            Assert.AreEqual(isValidSecurityType, _coinbaseBrokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(1.0m, securityType), order.Object, out message));\n        }\n\n        [TestCase(OrderType.Market, 2019, 2, 1, 0, 0, 0, true)]\n        [TestCase(OrderType.Limit, 2019, 2, 1, 0, 0, 0, true)]\n        [TestCase(OrderType.MarketOnClose, 2019, 2, 1, 0, 0, 0, false)]\n        [TestCase(OrderType.MarketOnOpen, 2019, 2, 1, 0, 0, 0, false)]\n        [TestCase(OrderType.StopLimit, 2019, 2, 1, 0, 0, 0, true)]\n        [TestCase(OrderType.StopMarket, 2019, 2, 1, 0, 0, 0, true)]\n        [TestCase(OrderType.StopMarket, 2019, 3, 23, 0, 59, 59, true)]\n        [TestCase(OrderType.StopMarket, 2019, 3, 23, 1, 0, 0, false)]\n        public void CanSubmit_CertainOrderTypes(OrderType orderType, int year, int month, int day, int hour, int minute, int second, bool isValidOrderType)\n        {\n            var utcTime = new DateTime(year, month, day, hour, minute, second);\n\n            BrokerageMessageEvent message;\n            var security = TestsHelpers.GetSecurity();\n            var order = Order.CreateOrder(new SubmitOrderRequest(orderType, SecurityType.Crypto, security.Symbol, 10.0m, 1.0m, 10.0m, utcTime, \"Test Order\"));\n\n            Assert.AreEqual(isValidOrderType, _coinbaseBrokerageModel.CanSubmitOrder(security, order, out message));\n        }\n\n        [Test]\n        public void FeeModelReturnsCorrectOrderFeeForTakerMarketOrder()\n        {\n            var security = TestsHelpers.GetSecurity();\n            security.FeeModel = new CoinbaseFeeModel();\n            security.SetMarketPrice(new TradeBar { Symbol = security.Symbol, Close = 5000m });\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security,\n                new MarketOrder(security.Symbol, 1, DateTime.MinValue)));\n\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n        }\n\n        [Test]\n        public void FeeModelReturnsCorrectOrderFeeForMakerLimitOrdersTickResolution()\n        {\n            var security = TestsHelpers.GetSecurity(resolution: Resolution.Tick);\n            security.FeeModel = new CoinbaseFeeModel();\n            security.SetMarketPrice(new Tick { Symbol = security.Symbol, Value = 5000m });\n\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 4999.99m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(0, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            security.SetMarketPrice(new Tick { Symbol = security.Symbol, BidPrice = 5000m, AskPrice = 5000.01m, TickType = TickType.Quote });\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 5000m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(0, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, -1, 5000.01m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(0, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n        }\n\n        [Test]\n        public void FeeModelReturnsCorrectOrderFeeForTakerLimitOrdersTickResolution()\n        {\n            var security = TestsHelpers.GetSecurity(resolution: Resolution.Tick);\n            security.FeeModel = new CoinbaseFeeModel();\n            security.SetMarketPrice(new Tick { Symbol = security.Symbol, Value = 5000m });\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 5000.01m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            // marketable buy limit fill at 5000\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            security.SetMarketPrice(new Tick { Symbol = security.Symbol, BidPrice = 5000m, AskPrice = 5000.01m, TickType = TickType.Quote });\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 5000.01m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            // marketable buy limit fill at 5000.01\n            Assert.AreEqual(15.00003m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, -1, 5000m, DateTime.MinValue)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            // marketable sell limit fill at 5000\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n        }\n\n        [Test]\n        public void FeeModelReturnsCorrectOrderFeeForMakerLimitOrdersMinuteResolution()\n        {\n            var time = new DateTime(2018, 4, 10);\n            var security = TestsHelpers.GetSecurity();\n\n            security.FeeModel = new CoinbaseFeeModel();\n            security.SetMarketPrice(new TradeBar { Symbol = security.Symbol, Close = 5000m, EndTime = time.AddSeconds(75) });\n\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 4999.99m, time)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(0, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, -1, 5000.01m, time)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(0, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n        }\n\n        [Test]\n        public void FeeModelReturnsCorrectOrderFeeForTakerLimitOrdersMinuteResolution()\n        {\n            var time = new DateTime(2018, 4, 10);\n            var security = TestsHelpers.GetSecurity();\n\n            security.FeeModel = new CoinbaseFeeModel();\n            security.SetMarketPrice(new TradeBar { Symbol = security.Symbol, Close = 5000m, EndTime = time.AddMinutes(1) });\n\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 5000m, time)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, 1, 5050m, time)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new LimitOrder(security.Symbol, -1, 4950m, time)\n                {\n                    OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, security.Price)\n                }));\n\n            Assert.AreEqual(15m, orderFee.Value.Amount);\n            Assert.AreEqual(Currencies.USD, orderFee.Value.Currency);\n        }\n\n        [Test]\n        public void ThrowsWhenCalledWithMarginAccountType()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                new CoinbaseBrokerageModel(AccountType.Margin);\n            }, \"The Coinbase brokerage does not currently support Margin trading.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/DefaultBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fills;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing Fasterflect;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing System;\nusing QuantConnect.Tests.Engine.BrokerageTransactionHandlerTests;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Tests.Engine;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class DefaultBrokerageModelTests\n    {\n        private readonly DefaultBrokerageModel _defaultBrokerageModel = new DefaultBrokerageModel();\n\n        [Test]\n        public void CanSubmitOrder_WhenMarketOnOpenOrderForFutures()\n        {\n            var order = GetMarketOnOpenOrder();\n            var future = TestsHelpers.GetSecurity(securityType: SecurityType.Future, symbol: Futures.Indices.SP500EMini, market: Market.CME);\n            var futureOption = TestsHelpers.GetSecurity(securityType: SecurityType.FutureOption, symbol: Futures.Indices.SP500EMini, market: Market.CME);\n            Assert.IsFalse(_defaultBrokerageModel.CanSubmitOrder(future, order, out _));\n            Assert.IsFalse(_defaultBrokerageModel.CanSubmitOrder(futureOption, order, out _));\n        }\n\n        [TestCase(SecurityType.Base)]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Option)]\n        [TestCase(SecurityType.Forex)]\n        [TestCase(SecurityType.Cfd)]\n        [TestCase(SecurityType.Crypto)]\n        [TestCase(SecurityType.Index)]\n        [TestCase(SecurityType.IndexOption)]\n        public void CanSubmitOrder_WhenMarketOnOpenOrderForOtherSecurityTypes(SecurityType securityType)\n        {\n            var order = GetMarketOnOpenOrder();\n            var security = TestsHelpers.GetSecurity(securityType: securityType, market: Market.USA);\n            Assert.IsTrue(_defaultBrokerageModel.CanSubmitOrder(security, order, out _));\n        }\n\n        [TestCase(SecurityType.Base, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Equity, nameof(EquityFillModel))]\n        [TestCase(SecurityType.Option, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Forex, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Cfd, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Crypto, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Index, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.IndexOption, nameof(ImmediateFillModel))]\n        [TestCase(SecurityType.Future, nameof(FutureFillModel))]\n        [TestCase(SecurityType.FutureOption, nameof(FutureOptionFillModel))]\n        public void GetsCorrectFillModel(SecurityType securityType, string expectedFillModel)\n        {\n            var security = TestsHelpers.GetSecurity(securityType: securityType, market: Market.USA);\n            var fillModel = _defaultBrokerageModel.GetFillModel(security);\n            Assert.AreEqual(expectedFillModel, fillModel.GetType().Name);\n        }\n\n        [Test]\n        public void ApplySplitWorksAsExpected()\n        {\n            var orderTypes = new List<OrderType>()\n            {\n                OrderType.Limit,\n                OrderType.StopLimit,\n                OrderType.LimitIfTouched,\n                OrderType.TrailingStop\n            };\n\n            var algorithm = new BrokerageTransactionHandlerTests.TestAlgorithm\n            {\n                HistoryProvider = new BrokerageTransactionHandlerTests.EmptyHistoryProvider()\n            };\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            transactionHandler.Initialize(algorithm, backtestingBrokerage, new TestResultHandler(Console.WriteLine));\n\n            try\n            {\n                algorithm.Transactions.SetOrderProcessor(transactionHandler);\n                algorithm.AddEquity(\"IBM\");\n                var tickets = new List<OrderTicket>();\n                foreach (var type in orderTypes)\n                {\n                    SubmitOrderRequest orderRequest = null;\n                    switch (type)\n                    {\n                        case OrderType.Limit:\n                            orderRequest = new SubmitOrderRequest(OrderType.Limit, SecurityType.Equity, Symbols.IBM, 100, 0, limitPrice: 8, 0,\n                                DateTime.UtcNow, \"\");\n                            break;\n                        case OrderType.StopLimit:\n                            orderRequest = new SubmitOrderRequest(OrderType.StopLimit, SecurityType.Equity, Symbols.IBM, 100, stopPrice: 10, 0, 0,\n                                DateTime.UtcNow, \"\");\n                            break;\n                        case OrderType.LimitIfTouched:\n                            orderRequest = new SubmitOrderRequest(OrderType.LimitIfTouched, SecurityType.Equity, Symbols.IBM, 100, 0, limitPrice: 14,\n                                triggerPrice: 12, DateTime.UtcNow, \"\");\n                            break;\n                        case OrderType.TrailingStop:\n                            orderRequest = new SubmitOrderRequest(OrderType.TrailingStop, SecurityType.Equity, Symbols.IBM, 100, stopPrice: 10, 0, 0,\n                                trailingAmount: 0.5m, trailingAsPercentage: false, DateTime.UtcNow, \"\");\n                            break;\n                    }\n                    algorithm.Transactions.AddOrder(orderRequest);\n                    var ticket = new OrderTicket(algorithm.Transactions, orderRequest);\n                    tickets.Add(ticket);\n                }\n\n                var split = new Split(Symbols.IBM, DateTime.UtcNow, 1, 0.5m, SplitType.SplitOccurred);\n                _defaultBrokerageModel.ApplySplit(tickets, split);\n                transactionHandler.ProcessSynchronousEvents();\n                foreach (var order in algorithm.Transactions.GetOrders())\n                {\n                    Assert.AreEqual(200, order.Quantity);\n                    var orderType = order.Type;\n                    switch (orderType)\n                    {\n                        case OrderType.Limit:\n                            Assert.AreEqual(4, order.GetPropertyValue(\"LimitPrice\"));\n                            break;\n                        case OrderType.StopLimit:\n                            Assert.AreEqual(5, order.GetPropertyValue(\"StopPrice\"));\n                            break;\n                        case OrderType.LimitIfTouched:\n                            Assert.AreEqual(6, order.GetPropertyValue(\"TriggerPrice\"));\n                            Assert.AreEqual(7, order.GetPropertyValue(\"LimitPrice\"));\n                            break;\n                        case OrderType.TrailingStop:\n                            Assert.AreEqual(5, order.GetPropertyValue(\"StopPrice\"));\n                            Assert.AreEqual(0.25m, order.GetPropertyValue(\"TrailingAmount\"));\n                            break;\n                    }\n                }\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n\n        [Test]\n        public void AppliesSplitOnlyWhenTrailingStopOrderTrailingAmountIsNotPercentage([Values] bool trailingAsPercentage)\n        {\n            var algorithm = new BrokerageTransactionHandlerTests.TestAlgorithm\n            {\n                HistoryProvider = new BrokerageTransactionHandlerTests.EmptyHistoryProvider()\n            };\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            transactionHandler.Initialize(algorithm, backtestingBrokerage, new TestResultHandler(Console.WriteLine));\n\n            try\n            {\n                algorithm.Transactions.SetOrderProcessor(transactionHandler);\n                algorithm.AddEquity(\"IBM\");\n\n                var tickets = new List<OrderTicket>();\n                var orderTime = new DateTime(2023, 07, 21, 12, 0, 0);\n                var orderRequest = new SubmitOrderRequest(OrderType.TrailingStop, SecurityType.Equity, Symbols.IBM, 100, stopPrice: 10, 0, 0,\n                    trailingAmount: 0.1m, trailingAsPercentage, orderTime, \"\");\n                algorithm.Transactions.AddOrder(orderRequest);\n                var ticket = new OrderTicket(algorithm.Transactions, orderRequest);\n                tickets.Add(ticket);\n\n                var split = new Split(Symbols.IBM, orderTime, 1, 0.5m, SplitType.SplitOccurred);\n                _defaultBrokerageModel.ApplySplit(tickets, split);\n                transactionHandler.ProcessSynchronousEvents();\n\n                var order = algorithm.Transactions.GetOrders().Single();\n\n                Assert.AreEqual(5, order.GetPropertyValue(\"StopPrice\", Flags.Instance | Flags.Public));\n                Assert.AreEqual(trailingAsPercentage ? 0.1m : 0.05m, order.GetPropertyValue(\"TrailingAmount\"));\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n\n        private static Order GetMarketOnOpenOrder()\n        {\n            var order = new Mock<Order>();\n            order.Setup(o => o.Type).Returns(OrderType.MarketOnOpen);\n            return order.Object;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/ExanteBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ExanteBrokerageModelTests\n    {\n        private readonly ExanteBrokerageModel _exanteBrokerageModel = new();\n        private readonly Symbol _btcusd = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, \"empty\");\n        private Security _security;\n\n        [SetUp]\n        public void Init()\n        {\n            _security = TestsHelpers.GetSecurity(symbol: _btcusd.Value, market: _btcusd.ID.Market,\n                quoteCurrency: \"EUR\");\n        }\n\n        [Test]\n        public void CannotSubmitMarketOrder_IfPriceNotInitialized()\n        {\n            var order = new Mock<MarketOrder>\n            {\n                Object =\n                {\n                    Quantity = 1\n                }\n            };\n\n            var security =\n                TestsHelpers.GetSecurity(symbol: _btcusd.Value, market: _btcusd.ID.Market, quoteCurrency: \"EUR\");\n\n            Assert.False(_exanteBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.NotNull(message);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/FTXBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Tests.Brokerages;\nusing System;\nusing Order = QuantConnect.Orders.Order;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture]\n    public class FTXBrokerageModelTests\n    {\n        private FTXBrokerageModel _brokerageModel;\n        private Symbol _symbol;\n\n        [SetUp]\n        public void Init()\n        {\n            _brokerageModel = GetBrokerageModel();\n            _symbol = Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market);\n        }\n\n        protected Crypto Security =>\n            new(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(\"ETH\", 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    _symbol,\n                    Resolution.Minute,\n                    TimeZones.Utc,\n                    TimeZones.Utc,\n                    false,\n                    false,\n                    false\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n        protected virtual string Market => QuantConnect.Market.FTX;\n\n        [Test]\n        public void GetCashBuyingPowerModelTest()\n        {\n            var model = GetBrokerageModel(AccountType.Cash);\n            Assert.IsInstanceOf<CashBuyingPowerModel>(model.GetBuyingPowerModel(Security));\n            Assert.AreEqual(1, model.GetLeverage(Security));\n        }\n\n        [Test]\n        public void GetSecurityMarginModelTest()\n        {\n            var model = GetBrokerageModel(AccountType.Margin);\n            Assert.IsInstanceOf<SecurityMarginModel>(model.GetBuyingPowerModel(Security));\n            Assert.AreEqual(3M, model.GetLeverage(Security));\n        }\n\n        [Test]\n        public virtual void GetFeeModelTest()\n        {\n            Assert.IsInstanceOf<FTXFeeModel>(_brokerageModel.GetFeeModel(Security));\n        }\n\n        [TestCase(SecurityType.Crypto)]\n        public void ShouldReturnProperMarket(SecurityType securityType)\n        {\n            Assert.AreEqual(Market, _brokerageModel.DefaultMarkets[securityType]);\n        }\n\n        [TestCase(0.01, true)]\n        [TestCase(0.00005, false)]\n        public void CanSubmitOrder_WhenQuantityIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n\n            Assert.AreEqual(isValidOrderQuantity, _brokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(market: Market), order.Object, out _));\n        }\n\n        [Test]\n        public void CannotUpdateOrder()\n        {\n            var orderMock = new Mock<Order>();\n            var order = orderMock.Object;\n            order.Quantity = 0.01m;\n\n            var updateRequestMock = new Mock<UpdateOrderRequest>(DateTime.UtcNow, 1, new UpdateOrderFields());\n\n            Assert.False(_brokerageModel.CanUpdateOrder(\n                TestsHelpers.GetSecurity(),\n                order,\n                updateRequestMock.Object,\n                out var message));\n            Assert.NotNull(message);\n        }\n\n        [TestCase(-1, 100000)]\n        [TestCase(1, 10000)]\n        public void CannotSubmitStopMarketOrder(decimal quantity, decimal stopPrice)\n        {\n            var order = new Mock<StopMarketOrder>\n            {\n                Object =\n                {\n                    Quantity = quantity,\n                    StopPrice =  stopPrice\n                }\n            };\n            order.SetupGet(s => s.Type).Returns(OrderType.StopMarket);\n\n            CannotSubmitStopOrder_WhenPriceMissingMarketPrice(order.Object);\n        }\n\n        [TestCase(-1, 100000)]\n        [TestCase(1, 10000)]\n        public void CannotSubmitStopLimitOrder(decimal quantity, decimal stopPrice)\n        {\n            var order = new Mock<StopLimitOrder>\n            {\n                Object =\n                {\n                    Quantity = quantity,\n                    StopPrice =  stopPrice\n                }\n            };\n            order.SetupGet(s => s.Type).Returns(OrderType.StopLimit);\n\n\n            CannotSubmitStopOrder_WhenPriceMissingMarketPrice(order.Object);\n        }\n\n        private void CannotSubmitStopOrder_WhenPriceMissingMarketPrice(Order order)\n        {\n            var security = TestsHelpers.GetSecurity(symbol: _symbol.Value, market: _symbol.ID.Market, quoteCurrency: \"USD\");\n\n            security.Cache.AddData(new Tick\n            {\n                AskPrice = 50001,\n                BidPrice = 49999,\n                Time = DateTime.UtcNow,\n                Symbol = _symbol,\n                TickType = TickType.Quote,\n                AskSize = 1,\n                BidSize = 1\n            });\n\n            Assert.AreEqual(false, _brokerageModel.CanSubmitOrder(security, order, out var message));\n            Assert.NotNull(message);\n        }\n\n        [TestCase(OrderType.StopMarket)]\n        [TestCase(OrderType.StopLimit)]\n        public void CannotSubmitMarketOrder_IfPriceNotInitialized(OrderType orderType)\n        {\n            var order = new Mock<StopLimitOrder>\n            {\n                Object =\n                {\n                    Quantity = 1,\n                    StopPrice =  100\n                }\n            };\n            order.SetupGet(s => s.Type).Returns(orderType);\n\n            var security = TestsHelpers.GetSecurity(symbol: _symbol.Value, market: _symbol.ID.Market, quoteCurrency: \"USD\");\n\n            Assert.AreEqual(false, _brokerageModel.CanSubmitOrder(security, order.Object, out var message));\n            Assert.NotNull(message);\n        }\n\n        protected virtual FTXBrokerageModel GetBrokerageModel(AccountType accountType = AccountType.Margin) => new(accountType);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/FTXUSBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture]\n    public class FTXUSBrokerageModelTests : FTXBrokerageModelTests\n    {\n        protected override FTXBrokerageModel GetBrokerageModel(AccountType accountType = AccountType.Margin) => new FTXUSBrokerageModel(accountType);\n\n        protected override string Market => QuantConnect.Market.FTXUS;\n\n        [Test]\n        public override void GetFeeModelTest()\n        {\n            Assert.IsInstanceOf<FTXUSFeeModel>(GetBrokerageModel().GetFeeModel(Security));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/FxcmBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class FxcmBrokerageModelTests\n    {\n        private static Symbol _eurUsd = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM);\n        private SymbolPropertiesDatabase _symbolPropertiesDatabase;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n        }\n\n        [TestCaseSource(nameof(GetOrderTestData))]\n        public void ValidatesOrders(OrderType orderType, Symbol symbol, decimal quantity, decimal stopPrice, decimal limitPrice, bool isValid)\n        {\n            var security = CreateSecurity(symbol);\n            security.SetMarketPrice(new Tick { Value = symbol == _eurUsd ? 1m : 10000m });\n\n            var request = new SubmitOrderRequest(orderType, symbol.SecurityType, symbol, quantity, stopPrice, limitPrice, DateTime.UtcNow, \"\");\n            var order = Order.CreateOrder(request);\n\n            var model = new FxcmBrokerageModel();\n\n            BrokerageMessageEvent messageEvent;\n            Assert.AreEqual(isValid, model.CanSubmitOrder(security, order, out messageEvent));\n        }\n\n        private Security CreateSecurity(Symbol symbol)\n        {\n            var quoteCurrency = symbol.Value.Substring(symbol.Value.Length - 3);\n            var properties = _symbolPropertiesDatabase.GetSymbolProperties(\n                symbol.ID.Market,\n                symbol,\n                symbol.SecurityType,\n                quoteCurrency);\n\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(symbol.SecurityType == SecurityType.Equity ? properties.QuoteCurrency : quoteCurrency, 0, 1m),\n                properties,\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private static TestCaseData[] GetOrderTestData()\n        {\n            var de30EUR = Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.FXCM); ;\n            return new[]\n            {\n                // invalid security type\n                new TestCaseData(OrderType.Market, Symbols.SPY, 1m, 0m, 0m, false),\n                new TestCaseData(OrderType.Market, Symbols.BTCUSD, 1m, 0m, 0m, false),\n\n                // invalid order type\n                new TestCaseData(OrderType.MarketOnOpen, _eurUsd, 1m, 0m, 0m, false),\n                new TestCaseData(OrderType.MarketOnClose, _eurUsd, 1m, 0m, 0m, false),\n                new TestCaseData(OrderType.StopLimit, _eurUsd, 1m, 0m, 0m, false),\n\n                // invalid lot size\n                new TestCaseData(OrderType.Market, _eurUsd, 1m, 0m, 0m, false),\n                new TestCaseData(OrderType.Market, de30EUR, 0.5m, 0m, 0m, false),\n\n                // valid lot size\n                new TestCaseData(OrderType.Market, _eurUsd, 1000m, 0m, 0m, true),\n                new TestCaseData(OrderType.Market, de30EUR, 1m, 0m, 0m, true),\n\n                // invalid limit buy price\n                new TestCaseData(OrderType.Limit, _eurUsd, 1000m, 0m, 1.0001m, false),\n                new TestCaseData(OrderType.Limit, _eurUsd, 1000m, 0m, 0.4999m, false),\n                new TestCaseData(OrderType.Limit, de30EUR, 1m, 0m, 10000.1m, false),\n                new TestCaseData(OrderType.Limit, de30EUR, 1m, 0m, 4999m, false),\n\n                // valid limit buy price\n                new TestCaseData(OrderType.Limit, _eurUsd, 1000m, 0m, 1m, true),\n                new TestCaseData(OrderType.Limit, _eurUsd, 1000m, 0m, 0.5m, true),\n                new TestCaseData(OrderType.Limit, de30EUR, 1m, 0m, 10000m, true),\n                new TestCaseData(OrderType.Limit, de30EUR, 1m, 0m, 5000m, true),\n\n                // invalid limit sell price\n                new TestCaseData(OrderType.Limit, _eurUsd, -1000m, 0m, 0.9999m, false),\n                new TestCaseData(OrderType.Limit, _eurUsd, -1000m, 0m, 1.5001m, false),\n                new TestCaseData(OrderType.Limit, de30EUR, -1m, 0m, 9999.9m, false),\n                new TestCaseData(OrderType.Limit, de30EUR, -1m, 0m, 15000.1m, false),\n\n                // valid limit sell price\n                new TestCaseData(OrderType.Limit, _eurUsd, -1000m, 0m, 1m, true),\n                new TestCaseData(OrderType.Limit, _eurUsd, -1000m, 0m, 1.5m, true),\n                new TestCaseData(OrderType.Limit, de30EUR, -1m, 0m, 10000m, true),\n                new TestCaseData(OrderType.Limit, de30EUR, -1m, 0m, 15000m, true),\n\n                // invalid stop buy price\n                new TestCaseData(OrderType.StopMarket, _eurUsd, 1000m, 0.9999m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, _eurUsd, 1000m, 1.5001m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, de30EUR, 1m, 9999.9m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, de30EUR, 1m, 15000.1m, 0m, false),\n\n                // valid stop buy price\n                new TestCaseData(OrderType.StopMarket, _eurUsd, 1000m, 1m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, _eurUsd, 1000m, 1.5m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, de30EUR, 1m, 10000m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, de30EUR, 1m, 15000m, 0m, true),\n\n                // invalid stop sell price\n                new TestCaseData(OrderType.StopMarket, _eurUsd, -1000m, 1.0001m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, _eurUsd, -1000m, 0.4999m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, de30EUR, -1m, 10000.1m, 0m, false),\n                new TestCaseData(OrderType.StopMarket, de30EUR, -1m, 4999m, 0m, false),\n\n                // valid stop sell price\n                new TestCaseData(OrderType.StopMarket, _eurUsd, -1000m, 1m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, _eurUsd, -1000m, 0.5m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, de30EUR, -1m, 10000m, 0m, true),\n                new TestCaseData(OrderType.StopMarket, de30EUR, -1m, 5000m, 0m, true)\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/InteractiveBrokersBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing Moq;\nusing NUnit.Framework;\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Securities.Cfd;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class InteractiveBrokersBrokerageModelTests\n    {\n        private readonly InteractiveBrokersBrokerageModel _interactiveBrokersBrokerageModel = new InteractiveBrokersBrokerageModel();\n\n        [TestCaseSource(nameof(GetUnsupportedOptions))]\n        public void CannotSubmitOrder_IndexOptionExercise(Security security)\n        {\n            var order = new Mock<OptionExerciseOrder>();\n            order.Setup(x => x.Type).Returns(OrderType.OptionExercise);\n\n            var canSubmit = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order.Object, out var message);\n\n            Assert.IsFalse(canSubmit, message.Message);\n            Assert.AreEqual(BrokerageMessageType.Warning, message.Type);\n            Assert.AreEqual(\"NotSupported\", message.Code);\n            StringAssert.Contains(\"exercises for index and cash-settled options\", message.Message);\n        }\n\n        [TestCaseSource(nameof(GetForexOrderTestCases))]\n        public void CanSubmitOrder_ForexWithinAllowableOrderSize(Forex security, decimal quantity, bool shouldSubmit)\n        {\n            var order = new MarketOrder(security.Symbol, quantity, new DateTime(2023, 1, 20));\n\n            var canSubmit = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.AreEqual(shouldSubmit, canSubmit);\n\n            if (shouldSubmit)\n            {\n                Assert.IsNull(message);\n            }\n            else\n            {\n                Assert.AreEqual(BrokerageMessageType.Warning, message.Type);\n                Assert.AreEqual(\"OrderSizeLimit\", message.Code);\n                StringAssert.Contains(\"minimum and maximum limits for the allowable order size are\", message.Message);\n            }\n        }\n\n        [TestCase(\"SPY\", SecurityType.Option)]\n        [TestCase(\"SPX\", SecurityType.IndexOption)]\n        [TestCase(\"ES\", SecurityType.FutureOption)]\n        public void CannotSubmitMOCOrdersForOptions(string ticker, SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(securityType, ticker);\n            if (securityType == SecurityType.FutureOption)\n            {\n                var underlyingFuture = Symbol.CreateFuture(\n                QuantConnect.Securities.Futures.Indices.SP500EMini,\n                Market.CME,\n                new DateTime(2021, 3, 19));\n\n                var futureOption = Symbol.CreateOption(underlyingFuture,\n                    Market.CME,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    2550m,\n                    new DateTime(2021, 3, 19));\n\n                security = new QuantConnect.Securities.FutureOption.FutureOption(\n                    futureOption,\n                    MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.CME, futureOption, futureOption.SecurityType),\n                    new Cash(\"USD\", 100000m, 1m),\n                    new OptionSymbolProperties(string.Empty, \"USD\", 1m, 0.01m, 1m),\n                    new CashBook(),\n                    new RegisteredSecurityDataTypesProvider(),\n                    new SecurityCache(),\n                    null);\n            }\n\n            var order = new MarketOnCloseOrder(security.Symbol, 1, DateTime.UtcNow);\n            var result = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.IsFalse(result);\n            var expectedMessage = \"InteractiveBrokers does not support Market-on-Close orders for other security types different than Future and Equity.\";\n            Assert.AreEqual(expectedMessage, message.Message);\n        }\n\n        [TestCase(\"EURGBP\", SecurityType.Forex)]\n        public void CannotSubmitMOCOrdersForForexAndCfd(string ticker, SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(securityType, ticker);\n\n            var order = new MarketOnCloseOrder(security.Symbol, 1, DateTime.UtcNow);\n            var result = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.IsFalse(result);\n            var expectedMessage = \"InteractiveBrokers does not support Market-on-Close orders for other security types different than Future and Equity.\";\n            Assert.AreEqual(expectedMessage, message.Message);\n        }\n\n        [TestCase(\"EURGBP\", SecurityType.Forex)]\n        [TestCase(\"ES\", SecurityType.Future)]\n        public void CannotSubmitMOOOrdersForForexCfdAndFutureOrders(string ticker, SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(securityType, ticker);\n\n            var order = new MarketOnOpenOrder(security.Symbol, 1, DateTime.UtcNow);\n            var result = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.IsFalse(result);\n            var expectedMessage = $\"The broker does not support Market-on-Open orders for security type {security.Type}\";\n            Assert.AreEqual(expectedMessage, message.Message);\n        }\n\n        [TestCase(\"SPY\", SecurityType.Option)]\n        [TestCase(\"SPY\", SecurityType.Equity)]\n        [TestCase(\"DE10YBEUR\", SecurityType.Cfd)]\n        public void CanSubmitMOOOrdersForOptionAndEquity(string ticker, SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(securityType, ticker);\n\n            var order = new MarketOnOpenOrder(security.Symbol, 1, DateTime.UtcNow);\n            var result = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.IsTrue(result);\n        }\n\n        [TestCase(OrderType.ComboLegLimit, 2, true)]\n        [TestCase(OrderType.ComboLimit, 4, true)]\n        [TestCase(OrderType.ComboLegLimit, 4, false)]\n        public void CanSubmitComboOrdersWithExpectedLegValidation(OrderType orderType, int legCount, bool shouldSubmit)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(SecurityType.Option, \"SPY\");\n            var groupOrderManager = new GroupOrderManager(1, legCount, 1, 100m);\n\n            Order order = orderType switch\n            {\n                OrderType.ComboLimit => new ComboLimitOrder(security.Symbol, 1, 100m, DateTime.UtcNow, groupOrderManager),\n                OrderType.ComboLegLimit => new ComboLegLimitOrder(security.Symbol, 1, 100m, DateTime.UtcNow, groupOrderManager),\n                _ => throw new ArgumentOutOfRangeException(nameof(orderType), orderType, \"Unexpected combo order type\")\n            };\n\n            var canSubmit = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.AreEqual(shouldSubmit, canSubmit);\n\n            if (shouldSubmit)\n            {\n                Assert.IsNull(message);\n            }\n            else\n            {\n                Assert.AreEqual(BrokerageMessageType.Warning, message.Type);\n                Assert.AreEqual(\"NotSupported\", message.Code);\n                StringAssert.Contains(\"does not support four-leg ComboLegLimit orders\", message.Message);\n            }\n        }\n\n        [TestCase(\"ES\", SecurityType.Future)]\n        [TestCase(\"SPY\", SecurityType.Equity)]\n        [TestCase(\"DE10YBEUR\", SecurityType.Cfd)]\n        public void CanSubmitMOCOrdersForFutureAndEquity(string ticker, SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddSecurity(securityType, ticker);\n\n            var order = new MarketOnCloseOrder(security.Symbol, 1, DateTime.UtcNow);\n            var result = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n            Assert.IsTrue(result);\n        }\n\n        [TestCase(AccountType.Cash, 1)]\n        [TestCase(AccountType.Margin, 10)]\n        public void GetsCorrectLeverageForCfds(AccountType accounType, decimal expectedLeverage)\n        {\n            var brokerageModel = new InteractiveBrokersBrokerageModel(accounType);\n            var security = new Cfd(Symbols.DE10YBEUR,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(\"USD\", 0, 0),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            Assert.AreEqual(expectedLeverage, brokerageModel.GetLeverage(security));\n        }\n\n        [Test]\n        public void CanSubmitCfdOrder()\n        {\n            var security = new Cfd(Symbols.DE10YBEUR,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(\"USD\", 0, 0),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n            var order = new MarketOrder(security.Symbol, 1, new DateTime(2023, 1, 20));\n\n            var canSubmit = _interactiveBrokersBrokerageModel.CanSubmitOrder(security, order, out var message);\n\n            Assert.IsTrue(canSubmit);\n        }\n\n        private static List<Security> GetUnsupportedOptions()\n        {\n            // Index option\n            var spxSymbol = Symbol.Create(\"SPX\", SecurityType.IndexOption, Market.USA);\n            var spx = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new SubscriptionDataConfig(typeof(TradeBar), spxSymbol, Resolution.Minute, TimeZones.Utc, TimeZones.Utc, false, true, false),\n                new Cash(\"USD\", 1000, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            //Cash settled option\n            var vixSymbol = Symbol.Create(\"VIX\", SecurityType.Option, Market.USA);\n            var vix = new Option(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new SubscriptionDataConfig(typeof(TradeBar), vixSymbol, Resolution.Minute, TimeZones.Utc, TimeZones.Utc, false, true, false),\n                new Cash(\"USD\", 1000, 1),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null);\n            vix.ExerciseSettlement = SettlementType.Cash;\n\n            return new() {spx, vix};\n        }\n\n        private static TestCaseData[] GetForexOrderTestCases()\n        {\n            return new[]\n            {\n                Tuple.Create(\"USDCAD\", 25000m, 7000000m),\n                Tuple.Create(\"AUDUSD\", 25000m, 6000000m),\n                Tuple.Create(\"CADUSD\", 25000m, 6000000m),\n                Tuple.Create(\"CHFUSD\", 25000m, 6000000m),\n                Tuple.Create(\"CNHUSD\", 150000m, 40000000m),\n                Tuple.Create(\"CZKUSD\", 0m, 0m), // need market price in USD or EUR -- do later when we support\n                Tuple.Create(\"DKKUSD\", 150000m, 35000000m),\n                Tuple.Create(\"EURUSD\", 20000m, 6000000m),\n                Tuple.Create(\"GBPUSD\", 20000m, 5000000m),\n                Tuple.Create(\"HKDUSD\", 200000m, 50000000m),\n                Tuple.Create(\"HUFUSD\", 0m, 0m), // need market price in USD or EUR -- do later when we support\n                Tuple.Create(\"ILSUSD\", 0m, 0m), // need market price in USD or EUR -- do later when we support\n                Tuple.Create(\"KRWUSD\", 0m, 200000000m),\n                Tuple.Create(\"JPYUSD\", 2500000m, 550000000m),\n                Tuple.Create(\"MXNUSD\", 300000m, 70000000m),\n                Tuple.Create(\"NOKUSD\", 150000m, 35000000m),\n                Tuple.Create(\"NZDUSD\", 35000m, 8000000m),\n                Tuple.Create(\"PLNUSD\", 0m, 0m), // need market price in USD or EUR -- do later when we support\n                Tuple.Create(\"RUBUSD\", 750000m, 30000000m),\n                Tuple.Create(\"SEKUSD\", 175000m, 40000000m),\n                Tuple.Create(\"SGDUSD\", 35000m, 8000000m),\n                Tuple.Create(\"ZARUSD\", 350000m, 100000000m),\n                Tuple.Create(\"INRUSD\", 0m, 0m) // not in the limits dictionary, should always return false\n            }\n            .Select(x =>\n            {\n                var currencyPair = x.Item1;\n                Forex.DecomposeCurrencyPair(currencyPair, out var baseCurrency, out var quoteCurrency);\n                var forexSymbol = Symbol.Create(currencyPair, SecurityType.Forex, Market.USA);\n                var forex = new Forex(\n                    forexSymbol,\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    new Cash(quoteCurrency, 0, 0.7m),\n                    new Cash(baseCurrency, 0, 1),\n                    SymbolProperties.GetDefault(quoteCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new ForexCache());\n\n                var min = x.Item2;\n                var max = x.Item3;\n\n                if (min != 0m || max != 0)\n                {\n                    if (min == 0m)\n                    {\n                        return new[]\n                        {\n                            // buy\n                            new TestCaseData(forex, min, false),\n                            new TestCaseData(forex, max * 1.001m, false),\n                            new TestCaseData(forex, 0.001m, true),\n                            new TestCaseData(forex, max, true),\n                            new TestCaseData(forex, max / 2, true),\n                            // sell\n                            new TestCaseData(forex, -max * 1.001m, false),\n                            new TestCaseData(forex, -0.001m, true),\n                            new TestCaseData(forex, -max, true),\n                            new TestCaseData(forex, -max / 2, true)\n                        };\n                    }\n\n                    return new[]\n                    {\n                        // buy\n                        new TestCaseData(forex, min * 0.999m, false),\n                        new TestCaseData(forex, max * 1.001m, false),\n                        new TestCaseData(forex, min, true),\n                        new TestCaseData(forex, max, true),\n                        new TestCaseData(forex, (min + max) / 2, true),\n                        // sell\n                        new TestCaseData(forex, -min * 0.999m, false),\n                        new TestCaseData(forex, -max * 1.001m, false),\n                        new TestCaseData(forex, -min, true),\n                        new TestCaseData(forex, -max, true),\n                        new TestCaseData(forex, -(min + max) / 2, true)\n                    };\n                }\n\n                // min and max are 0, need market price in USD or EUR, we don't support yet\n                return new[] { new TestCaseData(forex, 100000m, false) };\n            })\n            .SelectMany(x => x)\n            .ToArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/InteractiveBrokersFixModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class InteractiveBrokersFixModelTests\n    {\n        [TestCase(OrderType.ComboLimit, SecurityType.FutureOption, SecurityType.Future, false)]\n        [TestCase(OrderType.ComboMarket, SecurityType.FutureOption, SecurityType.Future, false)]\n        [TestCase(OrderType.ComboLimit, SecurityType.Future, SecurityType.Future, true)]\n        [TestCase(OrderType.ComboLimit, SecurityType.FutureOption, SecurityType.FutureOption, true)]\n        [TestCase(OrderType.ComboMarket, SecurityType.Future, SecurityType.Future, true)]\n        [TestCase(OrderType.ComboMarket, SecurityType.FutureOption, SecurityType.FutureOption, true)]\n        [TestCase(OrderType.ComboLegLimit, SecurityType.FutureOption, SecurityType.Future, false)]\n        [TestCase(OrderType.ComboLegLimit, SecurityType.Future, SecurityType.Future, false)]\n        [TestCase(OrderType.ComboLegLimit, SecurityType.FutureOption, SecurityType.FutureOption, false)]\n        public void ComboOrderValidatesSecurityTypes(OrderType orderType, SecurityType securityType1, SecurityType securityType2, bool expected)\n        {\n            var model = new InteractiveBrokersFixModel();\n            var groupManager = new GroupOrderManager(1, 2, 2);\n\n            var leg1 = CreateSecurity(securityType1, 0);\n            var leg2 = CreateSecurity(securityType2, 1);\n\n            var order1 = new SubmitOrderRequest(orderType, securityType1, leg1.Symbol, 1, 1, 1, new DateTime(2025, 7, 10), \"\", groupOrderManager: groupManager);\n            order1.SetOrderId(1);\n            var leg1Order = Order.CreateOrder(order1);\n\n            var order2 = new SubmitOrderRequest(orderType, securityType2, leg2.Symbol, -1, 1, 1, new DateTime(2025, 7, 10), \"\", groupOrderManager: groupManager);\n            order2.SetOrderId(2);\n            var leg2Order = Order.CreateOrder(order2);\n\n            var canSubmit = model.CanSubmitOrder(leg1, leg1Order, out _) && model.CanSubmitOrder(leg2, leg2Order, out _);\n            Assert.AreEqual(expected, canSubmit);\n        }\n\n        private static Security CreateSecurity(SecurityType securityType, int type)\n        {\n            var futureSymbol = Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2025, 12, 19));\n            var symbol = securityType == SecurityType.FutureOption\n                ? Symbol.CreateOption(futureSymbol, Market.CME, OptionStyle.American,\n                    type == 0 ? OptionRight.Call : OptionRight.Put,\n                    type == 0 ? 6000m : 5900m, new DateTime(2025, 12, 19))\n                : futureSymbol;\n\n            return new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.Utc, TimeZones.Utc, false, true, false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/KrakenBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    class KrakenBrokerageModelTests\n    {\n        private readonly KrakenBrokerageModel _krakenBrokerageModel = new KrakenBrokerageModel();\n\n        [TestCase(0.01, true)]\n        [TestCase(0.00004, false)]\n        public void CanSubmitOrder_WhenQuantityIsLargeEnough(decimal orderQuantity, bool isValidOrderQuantity)\n        {\n            BrokerageMessageEvent message;\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(orderQuantity);\n            Assert.AreEqual(isValidOrderQuantity, _krakenBrokerageModel.CanSubmitOrder(TestsHelpers.GetSecurity(market: Market.Kraken), order.Object, out message));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/TastytradeBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Tests.Brokerages;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture]\n    public class TastytradeBrokerageModelTests\n    {\n        private readonly TastytradeBrokerageModel _brokerageModel = new();\n\n        [TestCase(OrderType.ComboLimit, -1, -2, true)]\n        [TestCase(OrderType.ComboLimit, 1, -2, false)]\n        [TestCase(OrderType.ComboMarket, 1, 1, false, Description = \"The API Tastytrade does not support ComboMarket.\")]\n        public void CanSubmitComboCrossZeroOrder(OrderType orderType, decimal holdingQuantity, decimal orderQuantity, bool isShouldSubmitOrder)\n        {\n            var AAPL = Symbols.AAPL;\n\n            var groupOrderManager = new GroupOrderManager(1, 2, quantity: 8);\n\n            var order = TestsHelpers.CreateNewOrderByOrderType(orderType, AAPL, orderQuantity, groupOrderManager);\n\n            var security = TestsHelpers.InitializeSecurity(AAPL.SecurityType, (AAPL, 209m, holdingQuantity))[AAPL];\n\n            var isPossibleSubmit = _brokerageModel.CanSubmitOrder(security, order, out _);\n\n            Assert.That(isPossibleSubmit, Is.EqualTo(isShouldSubmitOrder));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Brokerages/TradierBrokerageModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Data.Market;\nusing System;\nusing QuantConnect.Orders.TimeInForces;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Brokerages\n{\n    [TestFixture]\n    public class TradierBrokerageModelTests\n    {\n        private TradierBrokerageModel _tradierBrokerageModel = new TradierBrokerageModel();\n        private static Security _security = GetSecurity(new DateTime(2025, 05, 28, 10, 0, 0));\n\n        [SetUp]\n        public void Init()\n        {\n            _security.Holdings.SetHoldings(1, 100);\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsFalseWhenShortGTCOrder()\n        {\n            var order = GetOrder();\n            order.Setup(x => x.Quantity).Returns(-101);\n            Assert.IsFalse(_tradierBrokerageModel.CanSubmitOrder(_security, order.Object, out var message));\n            var expectedMessage = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"ShortOrderIsGtc\", \"You cannot place short stock orders with GTC, only day orders are allowed\");\n            Assert.AreEqual(expectedMessage.Message, message.Message);\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsFalseWhenSellShortOrderLastPriceBelow5()\n        {\n            var order = GetOrder();\n            order.Setup(x => x.Quantity).Returns(-101);\n            order.Object.Properties.TimeInForce = TimeInForce.Day;\n            Assert.IsFalse(_tradierBrokerageModel.CanSubmitOrder(_security, order.Object, out var message));\n            var expectedMessage = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"SellShortOrderLastPriceBelow5\", \"Sell Short order cannot be placed for stock priced below $5\");\n            Assert.AreEqual(expectedMessage.Message, message.Message);\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsFalseWhenTimeInForceIsGoodTilDate()\n        {\n            var order = GetOrder();\n            order.Setup(x => x.Quantity).Returns(101);\n            order.Object.Properties.TimeInForce = TimeInForce.GoodTilDate(new DateTime());\n            Assert.IsFalse(_tradierBrokerageModel.CanSubmitOrder(_security, order.Object, out var message));\n            var expectedMessage = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"NotSupported\", $\"This model only supports orders with the following time in force types: {typeof(DayTimeInForce)} and {typeof(GoodTilCanceledTimeInForce)}\");\n            Assert.AreEqual(expectedMessage.Message, message.Message);\n        }\n\n        [TestCase(0.5)]\n        [TestCase(10000001)]\n        public void CanSubmitOrderReturnsFalseWhenIncorrectOrderQuantity(decimal quantity)\n        {\n            var order = GetOrder();\n            order.Object.Properties.TimeInForce = TimeInForce.Day;\n            order.Setup(x => x.Quantity).Returns(quantity);\n            Assert.IsFalse(_tradierBrokerageModel.CanSubmitOrder(_security, order.Object, out var message));\n            var expectedMessage = new BrokerageMessageEvent(BrokerageMessageType.Warning, \"IncorrectOrderQuantity\", \"Quantity should be between 1 and 10,000,000\");\n            Assert.AreEqual(expectedMessage.Message, message.Message);\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsTrueQuantityIsValidAndNotGTC()\n        {\n            var order = GetOrder();\n            order.Setup(x => x.Quantity).Returns(-100);\n            order.Object.Properties.TimeInForce = TimeInForce.Day;\n            Assert.IsTrue(_tradierBrokerageModel.CanSubmitOrder(_security, order.Object, out var message));\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsTrueWhenQuantityIsValidAndNotGTCAndPriceAbove5()\n        {\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(-100);\n            order.Object.Properties.TimeInForce = TimeInForce.Day;\n            var security = GetSecurity(new DateTime(2025, 05, 28, 10, 0, 0));\n            security.SetMarketPrice(new Tick(security.LocalTime, security.Symbol, 100, 1000));\n            security.Holdings.SetHoldings(6, 100);\n            order.Object.Symbol = security.Symbol;\n            Assert.IsTrue(_tradierBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsTrueWhenQuantityIsValidIsMarketOrderAndPriceAbove5()\n        {\n            var order = new Mock<Order>();\n            order.Setup(x => x.Quantity).Returns(-100);\n            var security = GetSecurity(new DateTime(2025, 05, 28, 10, 0, 0));\n            security.SetMarketPrice(new Tick(security.LocalTime, security.Symbol, 100, 1000));\n            security.Holdings.SetHoldings(6, 100);\n            order.Object.Symbol = security.Symbol;\n            Assert.IsTrue(_tradierBrokerageModel.CanSubmitOrder(security, order.Object, out var message));\n        }\n\n        [Test]\n        public void CanSubmitOrderReturnsTrueForIndexOptions()\n        {\n            var symbol = Symbol.Create(\"SPX\", SecurityType.IndexOption, Market.USA);\n            var time = new DateTime(2025, 05, 28, 10, 0, 0);\n            var tz = TimeZones.NewYork;\n            var indexOption = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(\"\", Currencies.USD, 100, 0.01m, 1),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            var localTimeKeeper = new LocalTimeKeeper(time.ConvertToUtc(tz), tz);\n            indexOption.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n\n            var order = new LimitOrder(symbol, 1, 100m, time);\n\n            var result = _tradierBrokerageModel.CanSubmitOrder(indexOption, order, out var message);\n            Assert.IsTrue(result);\n            Assert.IsNull(message);\n        }\n\n        private static IEnumerable<TestCaseData> ExtendedHoursTestCases\n        {\n            get\n            {\n                var preMarketTime = new DateTime(2025, 05, 28, 8, 0, 0);\n                var postMarketTime = new DateTime(2025, 05, 28, 19, 0, 0);\n\n                foreach (var time in new[] { preMarketTime, postMarketTime })\n                {\n                    var equity = GetSecurity(time, marketAlwaysOpen: false);\n\n                    yield return new TestCaseData(time, equity, OrderType.Limit, true);\n                    yield return new TestCaseData(time, equity, OrderType.Market, false);\n                    yield return new TestCaseData(time, equity, OrderType.StopMarket, false);\n                    yield return new TestCaseData(time, equity, OrderType.StopLimit, false);\n\n                    var option = GetSecurity(time, securityType: SecurityType.Option, marketAlwaysOpen: false);\n\n                    yield return new TestCaseData(time, option, OrderType.Limit, false);\n                    yield return new TestCaseData(time, option, OrderType.Market, false);\n                    yield return new TestCaseData(time, option, OrderType.StopMarket, false);\n                    yield return new TestCaseData(time, option, OrderType.StopLimit, false);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(ExtendedHoursTestCases))]\n        public void CanSubmitOrderOnExtendedHours(DateTime time, Security security, OrderType orderType, bool expectedResult)\n        {\n            var orderProperties = new TradierOrderProperties { OutsideRegularTradingHours = true };\n            Order order = orderType switch\n            {\n                OrderType.Market => new MarketOrder(security.Symbol, 100, time, properties: orderProperties),\n                OrderType.Limit => new LimitOrder(security.Symbol, 100, 100, time, properties: orderProperties),\n                OrderType.StopMarket => new StopMarketOrder(security.Symbol, 100, 100, time, properties: orderProperties),\n                OrderType.StopLimit => new StopLimitOrder(security.Symbol, 100, 100, 100, time, properties: orderProperties),\n                _ => throw new ArgumentException($\"Unsupported order type: {orderType}\", nameof(orderType))\n            };\n\n            Assert.AreEqual(expectedResult, _tradierBrokerageModel.CanSubmitOrder(security, order, out var message));\n\n            if (!expectedResult)\n            {\n                Assert.AreEqual(BrokerageMessageType.Warning, message.Type);\n                Assert.AreEqual(\"ExtendedMarket\", message.Code);\n                Assert.IsTrue(message.Message.StartsWith(\"Tradier does not support explicitly placing out-of-regular-hours orders if not currently during the pre or post market session.\", StringComparison.InvariantCultureIgnoreCase));\n            }\n        }\n\n        private Mock<Order> GetOrder()\n        {\n            var order = new Mock<Order>();\n            order.Object.Symbol = _security.Symbol;\n            return order;\n        }\n\n        private static Security GetSecurity(DateTime time, SecurityType securityType = SecurityType.Equity, bool marketAlwaysOpen = true)\n        {\n            var security = TestsHelpers.GetSecurity(securityType: securityType, symbol: \"IBM\", market: Market.USA,\n                marketAlwaysOpen: marketAlwaysOpen);\n            var localTimeKeeper = new LocalTimeKeeper(time.ConvertToUtc(security.Exchange.TimeZone),\n                security.Exchange.TimeZone);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/CandlestickSeriesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class CandlestickSeriesTest\n    {\n        [TestCase(null, \"toolTip\")]\n        [TestCase(\"IndexName\", \"toolTip\")]\n        [TestCase(null, null)]\n        [TestCase(\"IndexName\", null)]\n        public void Clone(string indexName, string toolTip)\n        {\n            var series = new CandlestickSeries(\"A\", 8, \"TT\") { ZIndex = 98, Index = 8, IndexName = indexName, Tooltip = toolTip };\n            var result = (CandlestickSeries)series.Clone();\n\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.Tooltip, result.Tooltip);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Index, result.Index);\n            Assert.AreEqual(series.ZIndex, result.ZIndex);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ChartTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ChartTests\n    {\n        [Test]\n        public void AddingScatterPoint()\n        {\n            var chart = new Chart(\"ChartName\");\n            var series = new Series(\"Test1\", SeriesType.Scatter);\n            series.AddPoint(new DateTime(2023, 03, 03), 100);\n            chart.AddSeries(series);\n\n            var serialized = JsonConvert.SerializeObject(chart);\n            var result = JsonConvert.DeserializeObject<Chart>(serialized);\n\n            Assert.AreEqual(result.Name, chart.Name);\n            Assert.AreEqual(result.Symbol, chart.Symbol);\n            Assert.AreEqual(result.LegendDisabled, chart.LegendDisabled);\n            Assert.AreEqual(result.Series.Count, chart.Series.Count);\n            Assert.AreEqual(result.Series[\"Test1\"].Tooltip, chart.Series[\"Test1\"].Tooltip);\n            CollectionAssert.AreEqual(result.Series.Select(x => $\"{x.Key}:{string.Join(',', x.Value.Values)}\"),\n                chart.Series.OrderBy(x => x.Value.Values.Count).Select(x => $\"{x.Key}:{string.Join(',', x.Value.Values)}\"));\n        }\n\n        [TestCase(false, false, 0, \"Tooltip template\")]\n        [TestCase(false, true, 0, \"Tooltip template\")]\n        [TestCase(true, false, 0, \"Tooltip template\")]\n        [TestCase(true, true, 0, \"Tooltip template\")]\n        [TestCase(false, false, 1, \"Tooltip template\")]\n        [TestCase(false, true, 1, \"Tooltip template\")]\n        [TestCase(true, false, 1, \"Tooltip template\")]\n        [TestCase(true, true, 1, \"Tooltip template\")]\n        [TestCase(false, false, 0, null)]\n        [TestCase(false, true, 0, null)]\n        [TestCase(true, false, 0, null)]\n        [TestCase(true, true, 0, null)]\n        [TestCase(false, false, 1, null)]\n        [TestCase(false, true, 1, null)]\n        [TestCase(true, false, 1, null)]\n        [TestCase(true, true, 1, null)]\n        public void SerializeDeserializeReturnsSameSeriesValue(bool setSymbol, bool legendDisabled, int index, string toolTip)\n        {\n            var chart = new Chart(\"ChartName\") { LegendDisabled = legendDisabled, Symbol = setSymbol ? Symbols.IBM : null };\n            var series1 = new Series(\"Test1\") { Index = index, Tooltip = toolTip };\n            series1.AddPoint(new DateTime(2023, 03, 03), 100);\n            series1.AddPoint(new DateTime(2023, 04, 03), 200);\n            chart.AddSeries(series1);\n\n            var series2 = new Series(\"Test2\");\n            series2.AddPoint(new DateTime(2023, 05, 03), 100);\n            chart.AddSeries(series2);\n\n            var serialized = JsonConvert.SerializeObject(chart);\n            var result = JsonConvert.DeserializeObject<Chart>(serialized);\n\n            Assert.AreEqual(result.Name, chart.Name);\n            Assert.AreEqual(result.Symbol, chart.Symbol);\n            Assert.AreEqual(result.LegendDisabled, chart.LegendDisabled);\n            Assert.AreEqual(result.Series.Count, chart.Series.Count);\n            Assert.AreEqual(result.Series[\"Test1\"].Tooltip, chart.Series[\"Test1\"].Tooltip);\n            CollectionAssert.AreEqual(result.Series.Select(x => $\"{x.Key}:{string.Join(',', x.Value.Values)}\"),\n                chart.Series.OrderBy(x => x.Value.Values.Count).Select(x => $\"{x.Key}:{string.Join(',', x.Value.Values)}\"));\n        }\n\n        [TestCase(false, false)]\n        [TestCase(false, true)]\n        [TestCase(true, false)]\n        [TestCase(true, true)]\n        public void Clone(bool setSymbol, bool legendDisabled)\n        {\n            var chart = new Chart(\"ChartName\") { LegendDisabled = legendDisabled, Symbol = setSymbol ? Symbols.IBM : null };\n            var result = chart.Clone();\n\n            Assert.AreEqual(result.Name, chart.Name);\n            Assert.AreEqual(result.Symbol, chart.Symbol);\n            Assert.AreEqual(result.LegendDisabled, chart.LegendDisabled);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Commands/BaseCommandTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Commands;\nusing QuantConnect.Interfaces;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Commands\n{\n    [TestFixture]\n    public class BaseCommandTests\n    {\n        [Test]\n        public void GetsSymbolWhenSymbolIsPresent()\n        {\n            var command = new TestBaseCommand();\n            Assert.DoesNotThrow(() => command.PublicGetSymbol(null, SecurityType.Base, null, Symbols.AAPL));\n        }\n\n\n        [Test]\n        public void GetsSymbolWhenTickerSecurityMarketIsPresent()\n        {\n            var command = new TestBaseCommand();\n            Assert.DoesNotThrow(() => command.PublicGetSymbol(Symbols.AAPL.ID.Symbol, SecurityType.Equity, Market.USA));\n        }\n\n        [Test]\n        public void ReturnSymbolWhenOtherValuesArePresentToo()\n        {\n            var command = new TestBaseCommand();\n            var symbol = command.PublicGetSymbol(Symbols.GOOG.ID.Symbol, SecurityType.Equity, Market.USA, Symbols.AAPL);\n            Assert.AreEqual(Symbols.AAPL, symbol);\n        }\n\n        [Test]\n        public void GetsSymbolThrowsWhenTickerMissing()\n        {\n            var command = new TestBaseCommand();\n            Assert.Throws<ArgumentException>(() => \n                                    command.PublicGetSymbol(null, SecurityType.Equity, Market.USA));\n        }\n\n        [Test]\n        public void GetsSymbolThrowsWhenSecurityTypeMissing()\n        {\n            var command = new TestBaseCommand();\n            Assert.Throws<ArgumentException>(() => \n                                    command.PublicGetSymbol(Symbols.AAPL.ID.Symbol, SecurityType.Base, Market.USA));\n        }\n\n\n        [Test]\n        public void GetsSymbolThrowsWhenMarketMissing()\n        {\n            var command = new TestBaseCommand();\n            Assert.Throws<ArgumentException>(() => \n                                    command.PublicGetSymbol(Symbols.AAPL.ID.Symbol, SecurityType.Equity, null));\n        }\n\n\n        private class TestBaseCommand : BaseCommand\n        {\n            public Symbol PublicGetSymbol(string ticker, SecurityType securityType, string market, Symbol symbol = null)\n            {\n                return GetSymbol(ticker, securityType, market, symbol);\n            }\n\n            public override CommandResultPacket Run(IAlgorithm algorithm)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Commands/CallbackCommandTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Web;\nusing NUnit.Framework;\nusing Newtonsoft.Json;\nusing QuantConnect.Commands;\nusing QuantConnect.Statistics;\nusing QuantConnect.Configuration;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Lean.Engine.Server;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Commands\n{\n    [TestFixture]\n    public class CallbackCommandTests\n    {\n        [Test]\n        public void BaseTypedLink()\n        {\n            var algorithmStub = new AlgorithmStub\n            {\n                ProjectId = 19542033\n            };\n            algorithmStub.AddCommand<MyCommand>();\n            var commandInstance = new MyCommand\n            {\n                Quantity = 0.1m,\n                Target = \"BTCUSD\"\n            };\n            var link = algorithmStub.Link(commandInstance);\n\n            var parse = HttpUtility.ParseQueryString(link);\n            Assert.IsFalse(string.IsNullOrEmpty(link));\n        }\n\n        [Test]\n        public void ComplexTypedLink()\n        {\n            var algorithmStub = new AlgorithmStub\n            {\n                ProjectId = 19542033\n            };\n            algorithmStub.AddCommand<MyCommand2>();\n            var commandInstance = new MyCommand2\n            {\n                Parameters = new Dictionary<string, object> { { \"quantity\", 0.1 } },\n                Target = new[] { \"BTCUSD\", \"AAAA\" }\n            };\n            var link = algorithmStub.Link(commandInstance);\n\n            var parse = HttpUtility.ParseQueryString(link);\n            Assert.IsFalse(string.IsNullOrEmpty(link));\n        }\n\n        [Test]\n        public void UntypedLink()\n        {\n            var algorithmStub = new AlgorithmStub\n            {\n                ProjectId = 19542033\n            };\n            var link = algorithmStub.Link(new { quantity = -0.1, target = \"BTCUSD\" });\n\n            var parse = HttpUtility.ParseQueryString(link);\n            Assert.IsFalse(string.IsNullOrEmpty(link));\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void CommanCallback(Language language)\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(typeof(CallbackCommandRegressionAlgorithm).Name,\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"3\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0.212%\"},\n                    {\"Drawdown\", \"0.000%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0.003%\"},\n                    {\"Sharpe Ratio\", \"-5.552\"},\n                    {\"Sortino Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"66.765%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"-0.01\"},\n                    {\"Beta\", \"0.003\"},\n                    {\"Annual Standard Deviation\", \"0.001\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"-8.919\"},\n                    {\"Tracking Error\", \"0.222\"},\n                    {\"Treynor Ratio\", \"-1.292\"},\n                    {\"Total Fees\", \"$3.00\"},\n                    {\"Estimated Strategy Capacity\", \"$670000000.00\"},\n                    {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n                    {\"Portfolio Turnover\", \"0.06%\"}\n                },\n                language,\n                AlgorithmStatus.Completed);\n\n            Config.Set(\"lean-manager-type\", typeof(TestLocalLeanManager).Name);\n\n            var result = AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        internal class TestLocalLeanManager : LocalLeanManager\n        {\n            private bool _sentCommands;\n            public override void Update()\n            {\n                if (!_sentCommands && Algorithm.Time.TimeOfDay > TimeSpan.FromHours(9.50))\n                {\n                    _sentCommands = true;\n                    var commands = new List<Dictionary<string, object>>\n                    {\n                        new()\n                        {\n                            { \"$type\", \"\" },\n                            { \"id\", 1 },\n                            { \"Symbol\", \"SPY\" },\n                            { \"Parameters\", new Dictionary<string, decimal> { {  \"quantity\", 1 } } },\n                            { \"unused\", 99 }\n                        },\n                        new()\n                        {\n                            { \"$type\", \"VoidCommand\" },\n                            { \"id\", null },\n                            { \"Quantity\", 1 },\n                            { \"targettime\", Algorithm.Time },\n                            { \"target\", new [] { \"BAC\" } },\n                            { \"Parameters\", new Dictionary<string, string> { {  \"tag\", \"a tag\" }, { \"something\", \"else\" } } },\n                        },\n                        new()\n                        {\n                            { \"id\", \"2\" },\n                            { \"$type\", \"BoolCommand\" },\n                            { \"Result\", true },\n                            { \"unused\", new [] { 99 } }\n                        },\n                        new()\n                        {\n                            { \"$type\", \"BoolCommand\" },\n                            { \"Result\", null },\n                        }\n                    };\n\n                    for (var i = 1; i <= commands.Count; i++)\n                    {\n                        var command = commands[i - 1];\n                        command[\"id\"] = i;\n                        File.WriteAllText($\"command-{i}.json\", JsonConvert.SerializeObject(command));\n                    }\n                    base.Update();\n                }\n            }\n            public override void OnAlgorithmStart()\n            {\n                SetCommandHandler();\n            }\n        }\n\n        private class MyCommand2 : Command\n        {\n            public string[] Target { get; set; }\n            public Dictionary<string, object> Parameters;\n        }\n\n        private class MyCommand : Command\n        {\n            public string Target { get; set; }\n            public decimal Quantity;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Commands/FileCommandHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Commands;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace QuantConnect.Tests.Common.Commands\n{\n    [TestFixture]\n    public class FileCommandHandlerTests\n    {\n        // NOTE: command file name should follow the file pattern \"command*.json\"\n        private const string SingleCommandFilePath = \"command.json\";\n        private const string MultiCommandFilePath = \"commands.json\";\n\n        [Test]\n        public void ReadsSingleCommandFromFile()\n        {\n            if (File.Exists(SingleCommandFilePath)) File.Delete(SingleCommandFilePath);\n            using var queue = new TestFileCommandHandler();\n            Assert.IsEmpty(queue.GetCommandsPublic());\n            File.WriteAllText(SingleCommandFilePath, JsonConvert.SerializeObject(new LiquidateCommand\n            {\n                Ticker = \"aapl\",\n                SecurityType = SecurityType.Equity,\n                Market = Market.USA\n            }, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }));\n            Assert.IsInstanceOf(typeof(LiquidateCommand), queue.GetCommandsPublic().Single());\n        }\n\n        [Test]\n        public void ReadsMultipleCommandsFromFile()\n        {\n            if (File.Exists(MultiCommandFilePath)) File.Delete(MultiCommandFilePath);\n            using var queue = new TestFileCommandHandler();\n            Assert.IsEmpty(queue.GetCommandsPublic());\n            File.WriteAllText(MultiCommandFilePath, JsonConvert.SerializeObject(new List<ICommand>\n            {\n                new CancelOrderCommand\n                {\n                    OrderId = 2342\n                },\n                new SpecialCommand()\n            }, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }));\n            var list = queue.GetCommandsPublic().ToList();\n            Assert.IsInstanceOf(typeof(CancelOrderCommand), list[0]);\n            Assert.IsInstanceOf(typeof(SpecialCommand), list[1]);\n            Assert.IsEmpty(queue.GetCommandsPublic());\n        }\n\n        [Test]\n        public void ReadsFilesInOrder()\n        {\n            foreach (var file in FileCommandHandler.GetCommandFiles())\n            {\n                File.Delete(file.FullName);\n            }\n            using var queue = new TestFileCommandHandler();\n            Assert.IsEmpty(queue.GetCommandsPublic());\n            var baseName = SingleCommandFilePath.Split(\".\")[0];\n            var commands = new List<BaseCommand>()\n            {\n                new LiquidateCommand(), new SpecialCommand(), new AlgorithmStatusCommand()\n            };\n            var fileSerialNumber = 0;\n            foreach (var command in commands)\n            {\n                var fileName = $\"{baseName}-{++fileSerialNumber}.json\";\n                File.WriteAllText(fileName, JsonConvert.SerializeObject(command, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }));\n            }\n            var list = queue.GetCommandsPublic().ToList();\n            Assert.AreEqual(commands.Count, list.Count);\n            for (int i = 0; i < commands.Count; i++)\n            {\n                Assert.AreEqual(commands[i].GetType().FullName, list[i].GetType().FullName);\n            }\n            Assert.IsEmpty(queue.GetCommandsPublic());\n        }\n\n        private sealed class SpecialCommand : BaseCommand\n        {\n            public override CommandResultPacket Run(IAlgorithm algorithm)\n            {\n                return new CommandResultPacket(this, true);\n            }\n        }\n\n        private class TestFileCommandHandler : FileCommandHandler\n        {\n            public IEnumerable<ICommand> GetCommandsPublic() => base.GetCommands();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Commands/OrderCommandTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Commands;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Commands\n{\n    [TestFixture]\n    public class OrderCommandTests\n    {\n        [TestCase(true, true, true, 0)]\n        [TestCase(true, true, false, 0)]\n        [TestCase(true, false, true, 0)]\n        [TestCase(true, false, false, 0)]\n        [TestCase(false, true, true, 0)]\n        [TestCase(false, true, false, 0)]\n        [TestCase(false, false, true, 0)]\n        [TestCase(false, false, false, 0)]\n        [TestCase(true, true, true, 1)]\n        [TestCase(true, true, false, 1)]\n        [TestCase(true, false, true, 1)]\n        [TestCase(true, false, false, 1)]\n        [TestCase(false, true, false, 1)]\n        [TestCase(false, false, true, 1)]\n        [TestCase(false, false, false, 1)]\n        [TestCase(false, true, true, 1)]\n        public void RunOrderCommand(bool warminUp, bool hasData, bool securityAdded, int quantity)\n        {\n            var command = new OrderCommand\n            {\n                Symbol = Symbols.AAPL,\n                Quantity = quantity,\n                OrderType = OrderType.Market\n            };\n\n            var algorithm = new AlgorithmStub();\n            if (!warminUp)\n            {\n                algorithm.SetFinishedWarmingUp();\n            }\n            if (securityAdded)\n            {\n                var security = algorithm.AddEquity(\"AAPL\");\n                if (hasData)\n                {\n                    security.SetMarketPrice(new Tick { Value = 10 });\n                }\n            }\n\n            var response = command.Run(algorithm);\n            if (!warminUp && hasData && securityAdded && quantity > 0)\n            {\n                Assert.IsTrue(response.Success);\n            }\n            else\n            {\n                Assert.IsFalse(response.Success);\n            }\n        }\n\n        [Test]\n        public void OrderCommandUsesDefaultOrderProperties()\n        {\n            var command = new OrderCommand\n            {\n                Symbol = Symbols.AAPL,\n                Quantity = 10,\n                OrderType = OrderType.Market,\n            };\n\n            var algorithm = new AlgorithmStub();\n            algorithm.SetFinishedWarmingUp();\n            var security = algorithm.AddEquity(\"AAPL\");\n            security.SetMarketPrice(new Tick { Value = 100 });\n\n            var response = command.Run(algorithm);\n            Assert.IsTrue(response.Success);\n            var ticket = algorithm.Transactions.GetOrderTickets().FirstOrDefault();\n            Assert.NotNull(ticket);\n            var orderProperties = ticket.SubmitRequest.OrderProperties;\n            Assert.NotNull(orderProperties);\n            Assert.AreEqual(TimeInForce.GoodTilCanceled, orderProperties.TimeInForce);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/CurrenciesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.Forex;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class CurrenciesTests\n    {\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void GetCurrencySymbolHandlesNullOrEmpty(string currency)\n        {\n            Assert.AreEqual(\"\", Currencies.GetCurrencySymbol(currency));\n        }\n\n        [TestCase(SecurityType.Forex, Market.FXCM)]\n        [TestCase(SecurityType.Forex, Market.Oanda)]\n        public void HasCurrencySymbolForEachForexPair(SecurityType securityType, string market)\n        {\n            var symbols = SymbolPropertiesDatabase\n                .FromDataFolder()\n                .GetSymbolPropertiesList(market, securityType)\n                .Select(x => x.Key.Symbol);\n\n            foreach (var symbol in symbols)\n            {\n                string baseCurrency, quoteCurrency;\n                Forex.DecomposeCurrencyPair(symbol, out baseCurrency, out quoteCurrency);\n\n                Assert.IsTrue(!string.IsNullOrWhiteSpace(Currencies.GetCurrencySymbol(baseCurrency)), \"Missing currency symbol for: \" + baseCurrency);\n                Assert.IsTrue(!string.IsNullOrWhiteSpace(Currencies.GetCurrencySymbol(quoteCurrency)), \"Missing currency symbol for: \" + quoteCurrency);\n            }\n        }\n\n        [TestCase(SecurityType.Crypto, Market.Coinbase)]\n        [TestCase(SecurityType.Crypto, Market.Bitfinex)]\n        public void HasCurrencySymbolForEachCryptoPair(SecurityType securityType, string market)\n        {\n            var symbols = SymbolPropertiesDatabase\n                .FromDataFolder()\n                .GetSymbolPropertiesList(market, securityType)\n                .Select(x => Symbol.Create(x.Key.Symbol, securityType, market));\n\n            foreach (var symbol in symbols)\n            {\n                var symbolProperties = SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(market, symbol, securityType, Currencies.USD);\n\n                string baseCurrency, quoteCurrency;\n                Crypto.DecomposeCurrencyPair(symbol, symbolProperties, out baseCurrency, out quoteCurrency);\n\n                Assert.IsTrue(!string.IsNullOrWhiteSpace(Currencies.GetCurrencySymbol(baseCurrency)), \"Missing currency symbol for: \" + baseCurrency);\n                Assert.IsTrue(!string.IsNullOrWhiteSpace(Currencies.GetCurrencySymbol(quoteCurrency)), \"Missing currency symbol for: \" + quoteCurrency);\n            }\n        }\n\n        [TestCase(Currencies.USD)]\n        [TestCase(Currencies.EUR)]\n        [TestCase(\"BTC\")]\n        [TestCase(\"ADA\")]\n        public void ReturnsSymbolForCurrencyWithSymbol(string currency)\n        {\n            Assert.AreNotEqual(currency, Currencies.GetCurrencySymbol(currency));\n        }\n\n        [TestCase(\"ABC\")]\n        [TestCase(\"XYZ\")]\n        [TestCase(\"CUR\")]\n        public void ReturnsTickerForUnknownCurrency(string currency)\n        {\n            Assert.AreEqual(currency, Currencies.GetCurrencySymbol(currency));\n        }\n\n        [Test]\n        public void ParsesValuesWithCurrency(\n            [ValueSource(nameof(CurrencySymbols))] string currencySymbol,\n            [Values(\"10,000.1\", \"10000.1\", \"1.00001e4\")] string value)\n        {\n            decimal result = 0;\n            decimal result2;\n            string valueWithCurrency = currencySymbol + value;\n            Assert.DoesNotThrow(() => result = Currencies.Parse(valueWithCurrency));\n            Assert.IsTrue(Currencies.TryParse(valueWithCurrency, out result2));\n            Assert.AreEqual(10000.1m, result);\n            Assert.AreEqual(result, result2);\n        }\n\n        [Test]\n        public void CannotParseInvalidValuesWithCurrency(\n            [ValueSource(nameof(CurrencySymbols))] string currencySymbol,\n            [Values(\"10.000.1\", \"10.000,1\", \"1.00001A4\", \"\")] string value)\n        {\n            string valueWithCurrency = currencySymbol + value;\n            Assert.Throws<ArgumentException>(() => Currencies.Parse(valueWithCurrency));\n            Assert.IsFalse(Currencies.TryParse(valueWithCurrency, out _));\n        }\n\n        static IEnumerable<string> CurrencySymbols =>\n            // Currencies with known symbols\n            Currencies.CurrencySymbols.Values.Distinct()\n            // Currencies without known symbols\n            .Concat(new [] { \"BUSD\", \"BNT\", \"ARS\", \"VES\" });\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/AuxiliaryDataSerializationTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class AuxiliaryDataSerializationTests\n    {\n        private readonly JsonSerializerSettings _settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All };\n\n        [Test]\n        public void DeserializesSplitWarning()\n        {\n            var splitWarning = new Split(Symbols.AAPL, new DateTime(2014, 6, 9), 645.57m, 0.142857m, SplitType.Warning);\n\n            var json = JsonConvert.SerializeObject(splitWarning, _settings);\n            var deserialized = (Split)JsonConvert.DeserializeObject(json, _settings);\n\n            Assert.AreEqual(splitWarning.Symbol, deserialized.Symbol);\n            Assert.AreEqual(splitWarning.Time, deserialized.Time);\n            Assert.AreEqual(splitWarning.Type, deserialized.Type);\n            Assert.AreEqual(splitWarning.ReferencePrice, deserialized.ReferencePrice);\n            Assert.AreEqual(splitWarning.SplitFactor, deserialized.SplitFactor);\n        }\n\n        [Test]\n        public void DeserializesSplit()\n        {\n            var split = new Split(Symbols.AAPL, new DateTime(2014, 6, 9), 645.57m, 0.142857m, SplitType.SplitOccurred);\n\n            var json = JsonConvert.SerializeObject(split, _settings);\n            var deserialized = (Split)JsonConvert.DeserializeObject(json, _settings);\n\n            Assert.AreEqual(split.Symbol, deserialized.Symbol);\n            Assert.AreEqual(split.Time, deserialized.Time);\n            Assert.AreEqual(split.Type, deserialized.Type);\n            Assert.AreEqual(split.ReferencePrice, deserialized.ReferencePrice);\n            Assert.AreEqual(split.SplitFactor, deserialized.SplitFactor);\n        }\n\n        [Test]\n        public void DeserializesDividend()\n        {\n            var dividend = new Dividend(Symbols.AAPL, new DateTime(2014, 11, 6), 0.47m, 108.60m);\n\n            var json = JsonConvert.SerializeObject(dividend, _settings);\n            var deserialized = (Dividend)JsonConvert.DeserializeObject(json, _settings);\n\n            Assert.AreEqual(dividend.Symbol, deserialized.Symbol);\n            Assert.AreEqual(dividend.Time, deserialized.Time);\n            Assert.AreEqual(dividend.Distribution, deserialized.Distribution);\n        }\n\n        [Test]\n        public void DeserializesDelistingWarning()\n        {\n            var delistingWarning = new Delisting(Symbols.AAPL, new DateTime(2999, 12, 31), 100m, DelistingType.Warning);\n\n            var json = JsonConvert.SerializeObject(delistingWarning, _settings);\n            var deserialized = (Delisting)JsonConvert.DeserializeObject(json, _settings);\n\n            Assert.AreEqual(delistingWarning.Symbol, deserialized.Symbol);\n            Assert.AreEqual(delistingWarning.Time, deserialized.Time);\n            Assert.AreEqual(delistingWarning.Type, deserialized.Type);\n        }\n\n        [Test]\n        public void DeserializesDelisting()\n        {\n            var delisting = new Delisting(Symbols.AAPL, new DateTime(2999, 12, 31), 100m, DelistingType.Delisted);\n\n            var json = JsonConvert.SerializeObject(delisting, _settings);\n            var deserialized = (Delisting)JsonConvert.DeserializeObject(json, _settings);\n\n            Assert.AreEqual(delisting.Symbol, deserialized.Symbol);\n            Assert.AreEqual(delisting.Time, deserialized.Time);\n            Assert.AreEqual(delisting.Type, deserialized.Type);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/FactorFileRowTests.cs",
    "content": "﻿/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class FactorFileRowTests\n    {\n        [Test]\n        public void ToCsv()\n        {\n            var row = new CorporateFactorRow(new DateTime(2000, 01, 01), 1m, 2m, 123m);\n            var actual = row.GetFileFormat(\"source\");\n            var expected = \"20000101,1,2,123,source\";\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void AppliesDividendWithPreviousTradingDateEqualToRowDate()\n        {\n            var row = new CorporateFactorRow(new DateTime(2018, 08, 23), 1m, 2m, 123m);\n            var dividend = new Dividend(Symbols.SPY, row.Date.AddDays(1), 1m, 123m);\n            var updated = row.Apply(dividend, SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            Assert.AreEqual(\"20180823,0.9918699,2,123\", updated.GetFileFormat());\n        }\n\n        [Test]\n        public void AppliesSplitWithPreviousTradingDateEqualToRowDate()\n        {\n            var row = new CorporateFactorRow(new DateTime(2018, 08, 23), 1m, 2m, 123m);\n            var dividend = new Split(Symbols.SPY, row.Date.AddDays(1), 123m, 2m, SplitType.SplitOccurred);\n            var updated = row.Apply(dividend, SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            Assert.AreEqual(\"20180823,1,4,123\", updated.GetFileFormat());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/FactorFileTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class FactorFileTests\n    {\n        [Test]\n        public void ReadsFactorFileWithoutInfValues()\n        {\n            var PermTick = \"AAPL\";\n            var Market = \"usa\";\n            var _symbol = new Symbol(SecurityIdentifier.GenerateEquity(PermTick, Market), PermTick);\n\n            var factorFile = TestGlobals.FactorFileProvider.Get(_symbol) as CorporateFactorProvider;\n\n            Assert.AreEqual(41, factorFile.SortedFactorFileData.Count);\n\n            Assert.AreEqual(new DateTime(1998, 01, 01), factorFile.FactorFileMinimumDate.Value);\n        }\n\n        [Test]\n        public void ReadsFactorFileWithExponentialNotation()\n        {\n            // Source NEWL factor file at 2019-12-09\n            var lines = new[]\n            {\n                \"19980102,0.8116779,1e+07\",\n                \"20051108,0.8116779,1e+07\",\n                \"20060217,0.8416761,1e+07\",\n                \"20060516,0.8644420,1e+07\",\n                \"20060814,0.8747766,1e+07\",\n                \"20061115,0.8901232,1e+07\",\n                \"20070314,0.9082148,1e+07\",\n                \"20070522,0.9166239,1e+07\",\n                \"20070814,0.9306799,1e+07\",\n                \"20071120,0.9534326,1e+07\",\n                \"20080520,0.9830510,1e+07\",\n                \"20100802,1.0000000,1e+07\",\n                \"20131016,1.0000000,1.11111e+06\",\n                \"20131205,1.0000000,75188\",\n                \"20140305,1.0000000,25000\",\n                \"20140514,1.0000000,2500\",\n                \"20140714,1.0000000,50\",\n                \"20501231,1.0000000,1\"\n            };\n\n            var factorFile = PriceScalingExtensions.SafeRead(\"PermTick\", lines, SecurityType.Equity);\n\n            Assert.AreEqual(5, factorFile.Count());\n\n            Assert.IsNotNull(factorFile.FactorFileMinimumDate);\n            Assert.AreEqual(new DateTime(2013, 12, 04), factorFile.FactorFileMinimumDate.Value);\n        }\n\n        [Test]\n        public void ReadsFactorFileWithInfValues()\n        {\n            var lines = new[]\n            {\n                \"19980102,1.0000000,inf\",\n                \"20151211,1.0000000,inf\",\n                \"20160330,1.0000000,2500\",\n                \"20160915,1.0000000,80\",\n                \"20501231,1.0000000,1\"\n            };\n\n            DateTime? factorFileMinimumDate;\n            var factorFile = PriceScalingExtensions.SafeRead(\"PermTick\", lines, SecurityType.Equity);\n\n            Assert.AreEqual(3, factorFile.Count());\n\n            Assert.IsNotNull(factorFile.FactorFileMinimumDate);\n            Assert.AreEqual(new DateTime(2016, 3, 29), factorFile.FactorFileMinimumDate.Value);\n        }\n\n        [Test]\n        public void CorrectlyDeterminesTimePriceFactors()\n        {\n            var reference = DateTime.Today;\n\n            const string symbol = \"n/a\";\n            var file = GetTestFactorFile(symbol, reference);\n            // time price factors should be the price factor * split factor\n\n            Assert.AreEqual(1, file.GetPriceFactor(reference, DataNormalizationMode.Adjusted));\n            Assert.AreEqual(1, file.GetPriceFactor(reference.AddDays(-6), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.9, file.GetPriceFactor(reference.AddDays(-7), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.9, file.GetPriceFactor(reference.AddDays(-13), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8, file.GetPriceFactor(reference.AddDays(-14), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8, file.GetPriceFactor(reference.AddDays(-20), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8m * .5m, file.GetPriceFactor(reference.AddDays(-21), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8m * .5m, file.GetPriceFactor(reference.AddDays(-22), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8m * .5m, file.GetPriceFactor(reference.AddDays(-89), DataNormalizationMode.Adjusted));\n            Assert.AreEqual(.8m * .25m, file.GetPriceFactor(reference.AddDays(-91), DataNormalizationMode.Adjusted));\n        }\n\n        [Test]\n        public void HasDividendEventOnNextTradingDay()\n        {\n            var reference = DateTime.Today;\n\n            const string symbol = \"n/a\";\n            decimal priceFactorRatio;\n            decimal referencePrice;\n            var file = GetTestFactorFile(symbol, reference);\n\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference, out priceFactorRatio, out referencePrice));\n\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-6), out priceFactorRatio, out referencePrice));\n            Assert.IsTrue(file.HasDividendEventOnNextTradingDay(reference.AddDays(-7), out priceFactorRatio, out referencePrice));\n            Assert.AreEqual(.9m/1m, priceFactorRatio);\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-8), out priceFactorRatio, out referencePrice));\n\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-13), out priceFactorRatio, out referencePrice));\n            Assert.IsTrue(file.HasDividendEventOnNextTradingDay(reference.AddDays(-14), out priceFactorRatio, out referencePrice));\n            Assert.AreEqual(.8m / .9m, priceFactorRatio);\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-15), out priceFactorRatio, out referencePrice));\n\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-364), out priceFactorRatio, out referencePrice));\n            Assert.IsTrue(file.HasDividendEventOnNextTradingDay(reference.AddDays(-365), out priceFactorRatio, out referencePrice));\n            Assert.AreEqual(.7m / .8m, priceFactorRatio);\n            Assert.IsFalse(file.HasDividendEventOnNextTradingDay(reference.AddDays(-366), out priceFactorRatio, out referencePrice));\n\n            Assert.IsNull(file.FactorFileMinimumDate);\n        }\n\n        [Test]\n        public void HasSplitEventOnNextTradingDay()\n        {\n            var reference = DateTime.Today;\n\n            const string symbol = \"n/a\";\n            decimal splitFactor;\n            decimal referencePrice;\n            var file = GetTestFactorFile(symbol, reference);\n\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference, out splitFactor, out referencePrice));\n\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-20), out splitFactor, out referencePrice));\n            Assert.IsTrue(file.HasSplitEventOnNextTradingDay(reference.AddDays(-21), out splitFactor, out referencePrice));\n            Assert.AreEqual(.5, splitFactor);\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-22), out splitFactor, out referencePrice));\n\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-89), out splitFactor, out referencePrice));\n            Assert.IsTrue(file.HasSplitEventOnNextTradingDay(reference.AddDays(-90), out splitFactor, out referencePrice));\n            Assert.AreEqual(.5, splitFactor);\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-91), out splitFactor, out referencePrice));\n\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-364), out splitFactor, out referencePrice));\n            Assert.IsTrue(file.HasSplitEventOnNextTradingDay(reference.AddDays(-365), out splitFactor, out referencePrice));\n            Assert.AreEqual(.5, splitFactor);\n            Assert.IsFalse(file.HasSplitEventOnNextTradingDay(reference.AddDays(-366), out splitFactor, out referencePrice));\n\n            Assert.IsNull(file.FactorFileMinimumDate);\n        }\n\n        [Test]\n        public void GeneratesCorrectSplitsAndDividends()\n        {\n            var reference = new DateTime(2018, 01, 01);\n            var file = GetTestFactorFile(\"SPY\", reference);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n            var splitsAndDividends = file.GetSplitsAndDividends(Symbols.SPY, exchangeHours);\n\n            var dividend = (Dividend)splitsAndDividends.Single(d => d.Time == reference.AddDays(-6));\n            var distribution = Dividend.ComputeDistribution(100m, .9m / 1m, 2);\n            Assert.AreEqual(distribution, dividend.Distribution);\n\n            dividend = (Dividend) splitsAndDividends.Single(d => d.Time == reference.AddDays(-13));\n            distribution = Math.Round(Dividend.ComputeDistribution(100m, .8m / .9m, 2), 2);\n            Assert.AreEqual(distribution, dividend.Distribution);\n\n            var split = (Split) splitsAndDividends.Single(d => d.Time == reference.AddDays(-20));\n            var splitFactor = .5m;\n            Assert.AreEqual(splitFactor, split.SplitFactor);\n\n            split = (Split) splitsAndDividends.Single(d => d.Time == reference.AddDays(-89));\n            splitFactor = .5m;\n            Assert.AreEqual(splitFactor, split.SplitFactor);\n\n            dividend = splitsAndDividends.OfType<Dividend>().Single(d => d.Time == reference.AddDays(-363));\n            distribution = Dividend.ComputeDistribution(100m, .7m / .8m, 2);\n            Assert.AreEqual(distribution, dividend.Distribution);\n\n            split = splitsAndDividends.OfType<Split>().Single(d => d.Time == reference.AddDays(-363));\n            splitFactor = .5m;\n            Assert.AreEqual(splitFactor, split.SplitFactor);\n        }\n\n        [Test]\n        public void GetsSplitsAndDividends()\n        {\n            var factorFile = GetFactorFile_AAPL2018_05_11();\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n            var splitsAndDividends = factorFile.GetSplitsAndDividends(Symbols.AAPL, exchangeHours).ToList();\n            foreach (var sad in splitsAndDividends)\n            {\n                Log.Trace($\"{sad.Time.Date:yyyy-MM-dd}: {sad}\");\n            }\n            var splits = splitsAndDividends.OfType<Split>().ToList();\n            var dividends = splitsAndDividends.OfType<Dividend>().ToList();\n\n            var dividend = dividends.Single(d => d.Time == new DateTime(2018, 05, 11));\n            Assert.AreEqual(0.73m, dividend.Distribution.RoundToSignificantDigits(6));\n\n            var split = splits.Single(d => d.Time == new DateTime(2014, 06, 09));\n            Assert.AreEqual((1/7m).RoundToSignificantDigits(6), split.SplitFactor);\n        }\n\n        [Test]\n        public void AppliesDividend()\n        {\n            var factorFileBeforeDividend = GetFactorFile_AAPL2018_05_08();\n            var factorFileAfterDividend = GetFactorFile_AAPL2018_05_11();\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n\n            var dividend = new Dividend(Symbols.AAPL, new DateTime(2018, 05, 11), 0.73m, 190.03m);\n            var actual = factorFileBeforeDividend.Apply(new List<BaseData> {dividend}, exchangeHours);\n\n            Assert.AreEqual(factorFileAfterDividend.Count(), actual.Count());\n            Assert.True(actual.First().Date == new DateTime(1998, 01, 02),\n                $\"Factor file first row changed from 1998-01-02 to {actual.First().Date:yyyy-MM-dd} after applying new event\");\n\n\n            foreach (var item in factorFileAfterDividend.Reverse().Zip(actual.Reverse(), (a,e) => new{actual=a, expected=e}))\n            {\n                var expected = (CorporateFactorRow)item.expected;\n                var actualRow = (CorporateFactorRow)item.actual;\n                Log.Trace($\"expected: {item.expected} actual: {item.actual}  diff: {100* (1 - actualRow.PriceFactor/expected.PriceFactor):0.0000}%\");\n                Assert.AreEqual(item.expected.Date, item.actual.Date);\n                Assert.AreEqual(expected.ReferencePrice, actualRow.ReferencePrice);\n                Assert.AreEqual(expected.SplitFactor, actualRow.SplitFactor);\n\n                var delta = (double)expected.PriceFactor * 1e-5;\n                Assert.AreEqual((double)expected.PriceFactor, (double)actualRow.PriceFactor, delta);\n            }\n        }\n\n\n        [Test]\n        public void AppliesSplit()\n        {\n            var factorFileBeforeSplit = GetFactorFile_LODE20191127();\n            var factorFileAfterSplit = GetFactorFile_LODE20191129();\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n\n            var eventTime = new DateTime(2019, 11, 29);\n            var split = new Split(Symbols.LODE, eventTime, 0.06m, 5, SplitType.SplitOccurred);\n            var actual = factorFileBeforeSplit.Apply(new List<BaseData> { split }, exchangeHours);\n\n            Assert.AreEqual(factorFileAfterSplit.Count(), actual.Count());\n            Assert.True(actual.First().Date == new DateTime(1998, 01, 02),\n                $\"Factor file first row changed from 1998-01-02 to {actual.First().Date:yyyy-MM-dd} after applying new event\");\n            Assert.True(((CorporateFactorRow)actual.First()).SplitFactor == 25m, \"Factor File split factor is not computed correctly\");\n            foreach (var item in actual.Reverse().Zip(factorFileAfterSplit.Reverse(), (a, e) => new { actual = a, expected = e }))\n            {\n                var expected = (CorporateFactorRow)item.expected;\n                var actualRow = (CorporateFactorRow)item.actual;\n                Log.Trace($\"expected: {item.expected} actual: {item.actual}  diff: {100 * (1 - actualRow.PriceFactor / expected.PriceFactor):0.0000}%\");\n                Assert.AreEqual(item.expected.Date, item.actual.Date);\n                Assert.AreEqual(expected.ReferencePrice, actualRow.ReferencePrice);\n                Assert.AreEqual(expected.SplitFactor, actualRow.SplitFactor);\n\n                var delta = (double)expected.PriceFactor * 1e-5;\n                Assert.AreEqual((double)expected.PriceFactor, (double)actualRow.PriceFactor, delta);\n            }\n        }\n\n\n        [Test]\n        public void CanHandleRepeatedEventsCorrectly()\n        {\n            var factorFileBeforeSplit = GetFactorFile_LODE20191127();\n            var factorFileAfterSplit = GetFactorFile_LODE20191129();\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n\n            var eventTime = new DateTime(2019, 11, 29);\n            var split = new Split(Symbols.LODE, eventTime, 0.06m, 5, SplitType.SplitOccurred);\n            var events = new List<BaseData> { split, split, split };\n            var actual = factorFileBeforeSplit.Apply(events, exchangeHours);\n\n            Assert.AreEqual(factorFileAfterSplit.Count(), actual.Count());\n            Assert.True(actual.First().Date == new DateTime(1998, 01, 02),\n                $\"Factor file first row changed from 1998-01-02 to {actual.First().Date:yyyy-MM-dd} after applying new event\");\n            Assert.True(((CorporateFactorRow)actual.First()).SplitFactor == 25m, \"Factor File split factor is not computed correctly\");\n            foreach (var item in actual.Reverse().Zip(factorFileAfterSplit.Reverse(), (a, e) => new { actual = a, expected = e }))\n            {\n                var expectedRow = (CorporateFactorRow)item.expected;\n                var actualRow = (CorporateFactorRow)item.actual;\n                Log.Trace($\"expected: {item.expected} actual: {item.actual}  diff: {100 * (1 - actualRow.PriceFactor / expectedRow.PriceFactor):0.0000}%\");\n                Assert.AreEqual(item.expected.Date, item.actual.Date);\n                Assert.AreEqual(expectedRow.ReferencePrice, actualRow.ReferencePrice);\n                Assert.AreEqual(expectedRow.SplitFactor, actualRow.SplitFactor);\n\n                var delta = (double)expectedRow.PriceFactor * 1e-5;\n                Assert.AreEqual((double)expectedRow.PriceFactor, (double)actualRow.PriceFactor, delta);\n            }\n        }\n\n\n        [Test]\n        public void AppliesSplitAndDividendAtSameTime()\n        {\n            var reference = new DateTime(2018, 08, 01);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(QuantConnect.Market.USA, Symbols.SPY, SecurityType.Equity);\n            var expected = GetTestFactorFile(\"AAPL\", reference);\n\n            // remove the last entry that contains a split and dividend at the same time\n            var factorFile = new CorporateFactorProvider(\"AAPL\", expected.SortedFactorFileData.Where(kvp => kvp.Value.Single().PriceFactor >= .8m).Select(kvp => kvp.Value.Single()));\n            var actual = factorFile.Apply(new List<BaseData>\n            {\n                new Split(Symbols.AAPL, reference.AddDays(-364), 100m, 1 / 2m, SplitType.SplitOccurred),\n                new Dividend(Symbols.AAPL, reference.AddDays(-364), 12.5m, 100m)\n            }, exchangeHours);\n\n            foreach (var item in actual.Reverse().Zip(expected.Reverse(), (a, e) => new {actual = a, expected = e}))\n            {\n                var expectedRow = (CorporateFactorRow)item.expected;\n                var actualRow = (CorporateFactorRow)item.actual;\n                Log.Trace($\"expected: {item.expected} actual: {item.actual}  diff: {100 * (1 - actualRow.PriceFactor / expectedRow.PriceFactor):0.0000}%\");\n                Assert.AreEqual(item.expected.Date, item.actual.Date);\n                Assert.AreEqual(expectedRow.ReferencePrice, actualRow.ReferencePrice);\n                Assert.AreEqual(expectedRow.SplitFactor, actualRow.SplitFactor);\n\n                Assert.AreEqual(expectedRow.PriceFactor.RoundToSignificantDigits(4), actualRow.PriceFactor.RoundToSignificantDigits(4));\n            }\n        }\n\n        [Test]\n        public void ReadsOldFactorFileFormat()\n        {\n            var lines = new[]\n            {\n                \"19980102,1.0000000,0.5\",\n                \"20130828,1.0000000,0.5\",\n                \"20501231,1.0000000,1\"\n            };\n\n            var factorFile = PriceScalingExtensions.SafeRead(\"bno\", lines, SecurityType.Equity) as CorporateFactorProvider;\n\n            var firstRow = factorFile.SortedFactorFileData[new DateTime(1998, 01, 02)].Single();\n            Assert.AreEqual(1m, firstRow.PriceFactor);\n            Assert.AreEqual(0.5m, firstRow.SplitFactor);\n            Assert.AreEqual(0m, firstRow.ReferencePrice);\n\n            var secondRow = factorFile.SortedFactorFileData[new DateTime(2013, 08, 28)].Single();\n            Assert.AreEqual(1m, secondRow.PriceFactor);\n            Assert.AreEqual(0.5m, secondRow.SplitFactor);\n            Assert.AreEqual(0m, firstRow.ReferencePrice);\n\n            var thirdRow = factorFile.SortedFactorFileData[Time.EndOfTime].Single();\n            Assert.AreEqual(1m, thirdRow.PriceFactor);\n            Assert.AreEqual(1m, thirdRow.SplitFactor);\n            Assert.AreEqual(0m, firstRow.ReferencePrice);\n        }\n\n        [Test]\n        public void HandlesUnknownDataMappingModes()\n        {\n            var lines = new[]\n            {\n                \"{\\\"Date\\\":\\\"2010-01-28T00:00:00\\\",\\\"BackwardsRatioScale\\\":[1.1575],\\\"BackwardsPanamaCanalScale\\\":[7.06],\\\"ForwardPanamaCanalScale\\\":[0.0],\\\"DataMappingMode\\\":1}\",\n                \"{\\\"Date\\\":\\\"2010-02-25T00:00:00\\\",\\\"BackwardsRatioScale\\\":[1.1575],\\\"BackwardsPanamaCanalScale\\\":[7.06],\\\"ForwardPanamaCanalScale\\\":[0.0],\\\"DataMappingMode\\\":788}\"\n            };\n\n            var factorFile = PriceScalingExtensions.SafeRead(\"cl\", lines, SecurityType.Future) as MappingContractFactorProvider;\n            Assert.AreEqual(1, factorFile.Count());\n            Assert.AreEqual(DataMappingMode.FirstDayMonth, (factorFile.First() as MappingContractFactorRow).DataMappingMode);\n        }\n\n        [Test]\n        public void ResolvesCorrectMostRecentFactorChangeDate()\n        {\n            var lines = new[]\n            {\n                \"19980102,1.0000000,0.5\",\n                \"20130828,1.0000000,0.5\",\n                \"20501231,1.0000000,1\"\n            };\n\n            var factorFile = PriceScalingExtensions.SafeRead(\"bno\", lines, SecurityType.Equity) as CorporateFactorProvider;\n            Assert.AreEqual(new DateTime(2013, 08, 28), factorFile.MostRecentFactorChange);\n        }\n\n        [Test]\n        [TestCase(\"\")]\n        [TestCase(\"20501231,1.0000000,1\")]\n        public void EmptyFactorFileReturnsEmptyListForSplitsAndDividends(string contents)\n        {\n            var lines = contents.Split('\\n').Where(l => !string.IsNullOrWhiteSpace(l));\n\n            var factorFile = PriceScalingExtensions.SafeRead(\"bno\", lines, SecurityType.Equity) as CorporateFactorProvider;\n            Assert.IsEmpty(factorFile.GetSplitsAndDividends(Symbols.SPY, SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork)));\n        }\n\n        private static CorporateFactorProvider GetTestFactorFile(string symbol, DateTime reference)\n        {\n            var file = new CorporateFactorProvider(symbol, new List<CorporateFactorRow>\n            {\n                new CorporateFactorRow(reference, 1, 1),\n                new CorporateFactorRow(reference.AddDays(-7), .9m, 1, 100m),       // dividend\n                new CorporateFactorRow(reference.AddDays(-14), .8m, 1, 100m),      // dividend\n                new CorporateFactorRow(reference.AddDays(-21), .8m, .5m, 100m),    // split\n                new CorporateFactorRow(reference.AddDays(-90), .8m, .25m, 100m),   // split\n                new CorporateFactorRow(reference.AddDays(-365), .7m, .125m, 100m)  // split+dividend\n            });\n            return file;\n        }\n\n        private static CorporateFactorProvider GetFactorFile_LODE20191127()\n        {\n            const string factorFileContents = @\"\n19980102,1,5,8.5,qq\n20171109,1,5,0.12,qq\n20501231,1,1,0,qq\n\";\n            DateTime? factorFileMinimumDate;\n            using var reader = new StreamReader(factorFileContents.ToStream());\n            using var streamReaderEnumerable = new StreamReaderEnumerable(reader);\n            var enumerable = streamReaderEnumerable.Where(line => line.Length > 0);\n            var factorFileRows = CorporateFactorRow.Parse(enumerable, out factorFileMinimumDate);\n            return new CorporateFactorProvider(\"lode\", factorFileRows, factorFileMinimumDate);\n        }\n\n        private static CorporateFactorProvider GetFactorFile_LODE20191129()\n        {\n            const string factorFileContents = @\"\n19980102,1,25,8.5,qq\n20171109,1,25,0.12,qq\n20191127,1,5,0.06,qq\n20501231,1,1,0,qq\n\";\n            DateTime? factorFileMinimumDate;\n            using var reader = new StreamReader(factorFileContents.ToStream());\n            using var streamReaderEnumerable = new StreamReaderEnumerable(reader);\n            var enumerable = streamReaderEnumerable.Where(line => line.Length > 0);\n            var factorFileRows = CorporateFactorRow.Parse(enumerable, out factorFileMinimumDate);\n            return new CorporateFactorProvider(\"lode\", factorFileRows, factorFileMinimumDate);\n        }\n\n        private static CorporateFactorProvider GetFactorFile_AAPL2018_05_11()\n        {\n            const string factorFileContents = @\"\n19980102,0.8893653,0.0357143,16.25\n20000620,0.8893653,0.0357143,101\n20050225,0.8893653,0.0714286,88.97\n20120808,0.8893653,0.142857,619.85\n20121106,0.8931837,0.142857,582.85\n20130206,0.8972636,0.142857,457.285\n20130508,0.9024937,0.142857,463.71\n20130807,0.908469,0.142857,464.94\n20131105,0.9144679,0.142857,525.58\n20140205,0.9198056,0.142857,512.59\n20140507,0.9253111,0.142857,592.34\n20140606,0.9304792,0.142857,645.57\n20140806,0.9304792,1,94.96\n20141105,0.9351075,1,108.86\n20150204,0.9391624,1,119.55\n20150506,0.9428692,1,125.085\n20150805,0.9468052,1,115.4\n20151104,0.9510909,1,122.01\n20160203,0.9551617,1,96.34\n20160504,0.9603451,1,94.19\n20160803,0.9661922,1,105.8\n20161102,0.9714257,1,111.6\n20170208,0.9764128,1,132.04\n20170510,0.9806461,1,153.26\n20170809,0.9846939,1,161.1\n20171109,0.9885598,1,175.87\n20180208,0.9921138,1,155.16\n20180510,0.9961585,1,190.03\n20501231,1,1,0\n\";\n\n            DateTime? factorFileMinimumDate;\n            using var reader = new StreamReader(factorFileContents.ToStream());\n            using var streamReaderEnumerable = new StreamReaderEnumerable(reader);\n            var enumerable = streamReaderEnumerable.Where(line => line.Length > 0);\n            var factorFileRows = CorporateFactorRow.Parse(enumerable, out factorFileMinimumDate);\n            return new CorporateFactorProvider(\"aapl\", factorFileRows, factorFileMinimumDate);\n        }\n\n        // AAPL experiences a 0.73 dividend distribution on 2018.05.11\n        private static CorporateFactorProvider GetFactorFile_AAPL2018_05_08()\n        {\n            const string factorFileContents = @\"\n19980102,0.8927948,0.0357143,16.25\n20000620,0.8927948,0.0357143,101\n20050225,0.8927948,0.0714286,88.97\n20120808,0.8927948,0.142857,619.85\n20121106,0.8966279,0.142857,582.85\n20130206,0.9007235,0.142857,457.285\n20130508,0.9059737,0.142857,463.71\n20130807,0.9119721,0.142857,464.94\n20131105,0.9179942,0.142857,525.58\n20140205,0.9233525,0.142857,512.59\n20140507,0.9288793,0.142857,592.34\n20140606,0.9340673,0.142857,645.57\n20140806,0.9340673,1,94.96\n20141105,0.9387135,1,108.86\n20150204,0.942784,1,119.55\n20150506,0.9465051,1,125.085\n20150805,0.9504563,1,115.4\n20151104,0.9547586,1,122.01\n20160203,0.9588451,1,96.34\n20160504,0.9640485,1,94.19\n20160803,0.9699181,1,105.8\n20161102,0.9751718,1,111.6\n20170208,0.9801781,1,132.04\n20170510,0.9844278,1,153.26\n20170809,0.9884911,1,161.1\n20171109,0.992372,1,175.87\n20180208,0.9959397,1,155.16\n20501231,1,1,0\n\";\n\n            DateTime? factorFileMinimumDate;\n            using var reader = new StreamReader(factorFileContents.ToStream());\n            using var streamReaderEnumerable = new StreamReaderEnumerable(reader);\n            var enumerable = streamReaderEnumerable.Where(line => line.Length > 0);\n            var factorFileRows = CorporateFactorRow.Parse(enumerable, out factorFileMinimumDate);\n            return new CorporateFactorProvider(\"aapl\", factorFileRows, factorFileMinimumDate);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/LocalDiskFactorFileProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class LocalDiskFactorFileProviderTests\n    {\n        internal IFactorFileProvider FactorFileProvider;\n\n        [OneTimeSetUp]\n        public virtual void Setup()\n        {\n            FactorFileProvider = TestGlobals.FactorFileProvider;\n        }\n\n        [Test]\n        public void RetrievesFromDisk()\n        {\n            var factorFile = FactorFileProvider.Get(Symbols.SPY);\n            Assert.IsNotNull(factorFile);\n        }\n\n        [Test]\n        public void CachesValueAndReturnsSameReference()\n        {\n            var factorFile1 = FactorFileProvider.Get(Symbols.SPY);\n            var factorFile2 = FactorFileProvider.Get(Symbols.SPY);\n            Assert.IsTrue(ReferenceEquals(factorFile1, factorFile2));\n        }\n\n        [Test]\n        public void ReturnsNullForNotFound()\n        {\n            var factorFile = FactorFileProvider.Get(Symbol.Create(\"not-a-ticker\", SecurityType.Equity, QuantConnect.Market.USA)) as CorporateFactorProvider;\n            Assert.IsNotNull(factorFile);\n            Assert.IsEmpty(factorFile);\n        }\n\n        [Test, Ignore(\"This test is meant to be run manually\")]\n        public void FindsFactorFilesWithErrors()\n        {\n            var factorFileFolder = Path.Combine(Globals.DataFolder, \"equity\", QuantConnect.Market.USA, \"factor_files\");\n\n            foreach (var fileName in Directory.EnumerateFiles(factorFileFolder))\n            {\n                var ticker = Path.GetFileNameWithoutExtension(fileName).ToUpper(CultureInfo.InvariantCulture);\n                var symbol = Symbol.Create(ticker, SecurityType.Equity, QuantConnect.Market.USA);\n\n                try\n                {\n                    FactorFileProvider.Get(symbol);\n                }\n                catch (Exception exception)\n                {\n                    Console.WriteLine(ticker + \": \" + exception.Message);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/LocalDiskMapFileProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class LocalDiskMapFileProviderTests\n    {\n        [Test]\n        public void RetrievesFromDisk()\n        {\n            var provider = new LocalDiskMapFileProvider();\n            provider.Initialize(TestGlobals.DataProvider);\n            var mapFiles = provider.Get(AuxiliaryDataKey.EquityUsa);\n            Assert.IsNotEmpty(mapFiles);\n        }\n\n        [Test]\n        public void CachesValueAndReturnsSameReference()\n        {\n            var provider = new LocalDiskMapFileProvider();\n            provider.Initialize(TestGlobals.DataProvider);\n            var mapFiles1 = provider.Get(AuxiliaryDataKey.EquityUsa);\n            var mapFiles2 = provider.Get(AuxiliaryDataKey.EquityUsa);\n            Assert.IsTrue(ReferenceEquals(mapFiles1, mapFiles2));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/LocalZipFactorFileProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class LocalZipFactorFileProviderTests : LocalDiskFactorFileProviderTests\n    {\n        private string _zipFilePath;\n\n        [OneTimeSetUp]\n        public override void Setup()\n        {\n            // Take our repo included factor files and zip them up for these tests\n            var date = DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork).Date.AddDays(-1);\n            var path = Path.Combine(Globals.DataFolder, $\"equity/usa/factor_files/\");\n            var tmp = \"./tmp.zip\";\n\n            _zipFilePath = Path.Combine(Globals.DataFolder, $\"equity/usa/factor_files/factor_files_{date:yyyyMMdd}.zip\");\n\n            // Have to compress to tmp file or else it doesn't finish reading all the files in dir\n            QuantConnect.Compression.ZipDirectory(path, tmp);\n            File.Move(tmp, _zipFilePath, true);\n\n            FactorFileProvider = new LocalZipFactorFileProvider();\n            FactorFileProvider.Initialize(TestGlobals.MapFileProvider, TestGlobals.DataProvider);\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            if (File.Exists(_zipFilePath))\n            {\n                File.Delete(_zipFilePath);\n            }\n        }\n\n        [Test]\n        public void CacheIsCleared()\n        {\n            var fileProviderTest = new LocalZipFactorFileProviderTest();\n            using var dataProviderTest = new DefaultDataProviderTest();\n\n            fileProviderTest.Initialize(TestGlobals.MapFileProvider, dataProviderTest);\n            fileProviderTest.CacheCleared.Reset();\n\n            fileProviderTest.Get(Symbols.AAPL);\n            Assert.AreEqual(1, dataProviderTest.FetchCount);\n            Thread.Sleep(50);\n            fileProviderTest.Get(Symbols.AAPL);\n            Assert.AreEqual(1, dataProviderTest.FetchCount);\n\n            fileProviderTest.CacheCleared.WaitOne(TimeSpan.FromSeconds(2));\n\n            fileProviderTest.Get(Symbols.AAPL);\n            Assert.AreEqual(2, dataProviderTest.FetchCount);\n\n            fileProviderTest.Enabled = false;\n            dataProviderTest.DisposeSafely();\n        }\n\n        private class LocalZipFactorFileProviderTest : LocalZipFactorFileProvider\n        {\n            public bool Enabled = true;\n            public readonly ManualResetEvent CacheCleared = new (false);\n            protected override TimeSpan CacheRefreshPeriod => TimeSpan.FromMilliseconds(300);\n\n            protected override void StartExpirationTask()\n            {\n                if (Enabled)\n                {\n                    base.StartExpirationTask();\n                    CacheCleared.Set();\n                }\n            }\n        }\n\n        private class DefaultDataProviderTest : DefaultDataProvider\n        {\n            public int FetchCount { get; set; }\n\n            public override Stream Fetch(string key)\n            {\n                FetchCount++;\n                return base.Fetch(key);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/LocalZipMapFileProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class LocalZipMapFileProviderTests\n    {\n        private string _zipFilePath;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            // Take our repo included map files and zip them up for these tests\n            var date = DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork).Date.AddDays(-1);\n            var path = Path.Combine(Globals.DataFolder, $\"equity/usa/map_files/\");\n            var tmp = \"./tmp.zip\";\n\n            _zipFilePath = Path.Combine(Globals.DataFolder, $\"equity/usa/map_files/map_files_{date:yyyyMMdd}.zip\");\n\n            // Have to compress to tmp file or else it doesn't finish reading all the files in dir\n            QuantConnect.Compression.ZipDirectory(path, tmp);\n            File.Move(tmp, _zipFilePath, true);\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            if (File.Exists(_zipFilePath))\n            {\n                File.Delete(_zipFilePath);\n            }\n        }\n\n        [Test]\n        public void Retrieves()\n        {\n            var fileProviderTest = new LocalZipMapFileProviderTest();\n            using var dataProviderTest = new DefaultDataProviderTest();\n            fileProviderTest.Initialize(dataProviderTest);\n\n            var mapFileResolver = fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);\n\n            fileProviderTest.Enabled = false;\n            dataProviderTest.DisposeSafely();\n\n            Assert.IsNotEmpty(mapFileResolver);\n        }\n\n        [Test]\n        public void CacheIsCleared()\n        {\n            var fileProviderTest = new LocalZipMapFileProviderTest();\n            using var dataProviderTest = new DefaultDataProviderTest();\n            fileProviderTest.Initialize(dataProviderTest);\n            fileProviderTest.CacheCleared.Reset();\n\n            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);\n            Assert.AreEqual(1, dataProviderTest.FetchCount);\n            Thread.Sleep(50);\n            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);\n            Assert.AreEqual(1, dataProviderTest.FetchCount);\n\n            fileProviderTest.CacheCleared.WaitOne(TimeSpan.FromSeconds(2));\n            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);\n            Assert.AreEqual(2, dataProviderTest.FetchCount);\n\n            fileProviderTest.Enabled = false;\n            dataProviderTest.DisposeSafely();\n        }\n\n        private class LocalZipMapFileProviderTest : LocalZipMapFileProvider\n        {\n            public bool Enabled = true;\n            public readonly ManualResetEvent CacheCleared = new(false);\n            protected override TimeSpan CacheRefreshPeriod => TimeSpan.FromMilliseconds(300);\n\n            protected override void StartExpirationTask()\n            {\n                if (Enabled)\n                {\n                    base.StartExpirationTask();\n                    CacheCleared.Set();\n                }\n            }\n        }\n\n        private class DefaultDataProviderTest : DefaultDataProvider\n        {\n            public int FetchCount { get; set; }\n\n            public override Stream Fetch(string key)\n            {\n                FetchCount++;\n                return base.Fetch(key);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Auxiliary/MapFileTests.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Tests.Common.Data.Auxiliary\n{\n    [TestFixture]\n    public class MapFileTests\n    {\n        [Test]\n        public void HandlesUnknownMappingMode()\n        {\n            var fileName = \"testMapFile.csv\";\n            var lines = new string[]\n            {\n                \"20110221,cl uucg3i0a3zy9,NYMEX,1\",\n                \"20110418,cl uvvl4qhqe8xt,NYMEX,999\"\n            };\n            File.WriteAllLines(fileName, lines);\n\n            var result = MapFileRow.Read(fileName, QuantConnect.Market.NYMEX, SecurityType.Future, TestGlobals.DataProvider).ToList();\n            File.Delete(fileName);\n\n            Assert.AreEqual(1, result.Count);\n            Assert.AreEqual(new DateTime(2011,2,21), result[0].Date);\n        }\n\n        [Test]\n        public void RowThrowsForUnknownMappingMode()\n        {\n            Assert.Throws<ArgumentException>(() => MapFileRow.Parse(\"20110418,cl uvvl4qhqe8xt,NYMEX,999\", QuantConnect.Market.NYMEX, SecurityType.Future));\n        }\n\n        [Test]\n        public void ResolvesFirstTicker()\n        {\n            var mapFile = new MapFile(\"goog\", new List<MapFileRow>\n            {\n                new MapFileRow(new DateTime(2014, 03, 27), \"goocv\"),\n                new MapFileRow(new DateTime(2014, 04, 02), \"goocv\"),\n                new MapFileRow(new DateTime(2050, 12, 31), \"goog\")\n            });\n\n            Assert.AreEqual(\"GOOCV\", mapFile.FirstTicker);\n        }\n\n        [Test]\n        [TestCase(\"abc\", \"ABC\")]\n        [TestCase(\"abc.1\", \"ABC\")]\n        [TestCase(\"brk.a\", \"BRK.A\")]\n        [TestCase(\"brk.a.1\", \"BRK.A\")]\n        public void ResolvesFirstTickerFromPermtickIfEmptyMapFile(string permtick, string expectedFirstTicker)\n        {\n            var mapFile = new MapFile(permtick, new List<MapFileRow>());\n            Assert.AreEqual(expectedFirstTicker, mapFile.FirstTicker);\n        }\n\n        [Test]\n        public void ResolvesFirstDate()\n        {\n            var mapFile = new MapFile(\"goog\", new List<MapFileRow>\n            {\n                new MapFileRow(new DateTime(2014, 03, 27), \"goocv\"),\n                new MapFileRow(new DateTime(2014, 04, 02), \"goocv\"),\n                new MapFileRow(new DateTime(2050, 12, 31), \"goog\")\n            });\n\n            Assert.AreEqual(new DateTime(2014, 03, 27), mapFile.FirstDate);\n        }\n\n        [Test]\n        public void GenerateMapFileCSV()\n        {\n            var mapFile = new MapFile(\"enrn\", new List<MapFileRow>()\n            {\n                new MapFileRow(new DateTime(2001, 1, 1), \"enrn\"),\n                new MapFileRow(new DateTime(2001, 12, 2), \"enrnq\")\n            });\n\n            var csvData = new List<string>()\n            {\n                \"20010101,enrn\",\n                \"20011202,enrnq\"\n            };\n\n            Assert.True(mapFile.ToCsvLines().SequenceEqual(csvData));\n        }\n\n        [Test]\n        public void ParsesExchangeCorrectly()\n        {\n            var mapFile = new MapFile(\"goog\", new List<MapFileRow>\n            {\n                new MapFileRow(new DateTime(2014, 03, 27), \"goocv\", \"Q\"),\n                new MapFileRow(new DateTime(2014, 04, 02), \"goocv\", \"Q\"),\n                new MapFileRow(new DateTime(2050, 12, 31), \"goog\", \"Q\")\n            });\n\n            Assert.AreEqual(Exchange.NASDAQ, (Exchange) mapFile.Last().PrimaryExchange);\n        }\n\n        [TestCaseSource(nameof(ParsesRowWithExchangesCorrectlyCases))]\n        public void ParsesRowWithExchangesCorrectly(string mapFileRow, Exchange expectedExchange)\n        {\n            // Arrange\n            var rowParts = mapFileRow.Split(',');\n            var expectedMapFileRow = new MapFileRow(\n                DateTime.ParseExact(rowParts[0], DateFormat.EightCharacter, CultureInfo.InvariantCulture),\n                rowParts[1],\n                rowParts[2]);\n            // Act\n            var actualMapFileRow = MapFileRow.Parse(mapFileRow, QuantConnect.Market.USA, SecurityType.Equity);\n            // Assert\n            Assert.AreEqual(expectedExchange, actualMapFileRow.PrimaryExchange);\n            Assert.AreEqual(expectedMapFileRow, actualMapFileRow);\n        }\n\n        [Test]\n        public void ParsesRowWithoutExchangesCorrectly()\n        {\n            // Arrange\n            var mapFileRow = \"20010213,aapl\";\n            var rowParts = mapFileRow.Split(',');\n            var expectedMapFileRow = new MapFileRow(\n                DateTime.ParseExact(rowParts[0], DateFormat.EightCharacter, CultureInfo.InvariantCulture),\n                rowParts[1]);\n            // Act\n            var actualMapFileRow = MapFileRow.Parse(mapFileRow, QuantConnect.Market.USA, SecurityType.Equity);\n            // Assert\n            Assert.AreEqual(Exchange.UNKNOWN, actualMapFileRow.PrimaryExchange);\n            Assert.AreEqual(expectedMapFileRow, actualMapFileRow);\n        }\n\n        private static TestCaseData[] ParsesRowWithExchangesCorrectlyCases()\n        {\n            return new[]\n            {\n                new TestCaseData(\"20010213,aapl,Q\", Exchange.NASDAQ),\n                new TestCaseData(\"20010213,aapl,Z\", Exchange.BATS),\n                new TestCaseData(\"20010213,aapl,P\", Exchange.ARCA),\n                new TestCaseData(\"20010213,aapl,N\", Exchange.NYSE),\n                new TestCaseData(\"20010213,aapl,C\", Exchange.NSX),\n                new TestCaseData(\"20010213,aapl,D\", Exchange.FINRA),\n                new TestCaseData(\"20010213,aapl,I\", Exchange.ISE),\n                new TestCaseData(\"20010213,aapl,M\", Exchange.CSE),\n                new TestCaseData(\"20010213,aapl,W\", Exchange.CBOE),\n                new TestCaseData(\"20010213,aapl,A\", Exchange.AMEX),\n                new TestCaseData(\"20010213,aapl,J\", Exchange.EDGA),\n                new TestCaseData(\"20010213,aapl,K\", Exchange.EDGX),\n                new TestCaseData(\"20010213,aapl,B\", Exchange.NASDAQ_BX),\n                new TestCaseData(\"20010213,aapl,X\", Exchange.NASDAQ_PSX),\n                new TestCaseData(\"20010213,aapl,Y\", Exchange.BATS_Y),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/BaseConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public abstract class BaseConsolidatorTests\n    {\n        protected abstract IDataConsolidator CreateConsolidator();\n\n        protected virtual void AssertConsolidator(IDataConsolidator consolidator)\n        {\n            Assert.IsNull(consolidator.Consolidated);\n        }\n\n        protected virtual Func<IBaseData, IBaseData, bool> AssertConsolidatedValues => (first, second) =>\n        {\n            Assert.AreEqual(first.Value, second.Value);\n            Assert.AreEqual(first.Price, second.Price);\n            Assert.AreEqual(first.DataType, second.DataType);\n            Assert.AreEqual(first.Symbol, second.Symbol);\n            Assert.AreEqual(first.EndTime, second.EndTime);\n            return true;\n        };\n\n        protected virtual dynamic GetTestValues()\n        {\n            var time = new DateTime(2016, 1, 1);\n            return new List<IndicatorDataPoint>()\n            {\n                new IndicatorDataPoint(time, 1.38687m),\n                new IndicatorDataPoint(time.AddSeconds(1), 1.38687m),\n                new IndicatorDataPoint(time.AddSeconds(2), 1.38688m),\n                new IndicatorDataPoint(time.AddSeconds(3), 1.38687m),\n                new IndicatorDataPoint(time.AddSeconds(4), 1.38686m),\n                new IndicatorDataPoint(time.AddSeconds(5), 1.38685m),\n                new IndicatorDataPoint(time.AddSeconds(6), 1.38683m),\n                new IndicatorDataPoint(time.AddSeconds(7), 1.38682m),\n                new IndicatorDataPoint(time.AddSeconds(8), 1.38682m),\n                new IndicatorDataPoint(time.AddSeconds(9), 1.38684m),\n                new IndicatorDataPoint(time.AddSeconds(10), 1.38682m),\n                new IndicatorDataPoint(time.AddSeconds(11), 1.38680m),\n                new IndicatorDataPoint(time.AddSeconds(12), 1.38681m),\n                new IndicatorDataPoint(time.AddSeconds(13), 1.38686m),\n                new IndicatorDataPoint(time.AddSeconds(14), 1.38688m),\n            };\n        }\n\n        [Test]\n        public void ResetWorksAsExpected()\n        {\n            // Test Renko bar consistency amongst three consolidators starting at different times\n\n            var time = new DateTime(2016, 1, 1);\n            var testValues = GetTestValues();\n\n            var consolidatedBarsBefore = new List<IBaseData>();\n            var consolidator = CreateConsolidator();\n            foreach (var data in testValues)\n            {\n                consolidator.Update(data);\n                if (consolidator.Consolidated != null)\n                {\n                    consolidatedBarsBefore.Add(consolidator.Consolidated);\n                }\n            }\n\n            consolidator.Reset();\n            AssertConsolidator(consolidator);\n\n            var consolidatedBarsAfter = new List<IBaseData>();\n            foreach (var data in testValues)\n            {\n                consolidator.Update(data);\n                if (consolidator.Consolidated != null)\n                {\n                    consolidatedBarsAfter.Add(consolidator.Consolidated);\n                }\n            }\n\n            Assert.AreEqual(consolidatedBarsBefore.Count, consolidatedBarsAfter.Count);\n            consolidatedBarsBefore.Zip<IBaseData, IBaseData, bool>(consolidatedBarsAfter, AssertConsolidatedValues);\n            consolidator.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/BaseDataConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class BaseDataConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void AggregatesTickToNewTradeBarProperly()\n        {\n            TradeBar newTradeBar = null;\n            using var creator = new BaseDataConsolidator(4);\n            creator.DataConsolidated += (sender, tradeBar) =>\n            {\n                newTradeBar = tradeBar;\n            };\n            var reference = DateTime.Today;\n            var bar1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                Value = 5,\n                Quantity = 10\n            };\n            creator.Update(bar1);\n            Assert.IsNull(newTradeBar);\n\n            var bar2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                Value = 10,\n                Quantity = 20\n            };\n            creator.Update(bar2);\n            Assert.IsNull(newTradeBar);\n            var bar3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(2),\n                Value = 1,\n                Quantity = 10\n            };\n            creator.Update(bar3);\n            Assert.IsNull(newTradeBar);\n\n            var bar4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(3),\n                Value = 9,\n                Quantity = 20\n            };\n            creator.Update(bar4);\n            Assert.IsNotNull(newTradeBar);\n\n            Assert.AreEqual(Symbols.SPY, newTradeBar.Symbol);\n            Assert.AreEqual(bar1.Time, newTradeBar.Time);\n            Assert.AreEqual(bar1.Value, newTradeBar.Open);\n            Assert.AreEqual(bar2.Value, newTradeBar.High);\n            Assert.AreEqual(bar3.Value, newTradeBar.Low);\n            Assert.AreEqual(bar4.Value, newTradeBar.Close);\n            Assert.AreEqual(bar4.EndTime, newTradeBar.EndTime);\n\n            // base data can't aggregate volume\n            Assert.AreEqual(0, newTradeBar.Volume);\n        }\n\n        [Test]\n        public void DoesNotConsolidateDifferentSymbols()\n        {\n            using var consolidator = new BaseDataConsolidator(2);\n\n            var reference = DateTime.Today;\n\n            var tb1 = new Tick\n            {\n                Symbol = Symbols.AAPL,\n                Time = reference,\n                Value = 5,\n                Quantity = 10\n            };\n\n            var tb2 = new Tick\n            {\n                Symbol = Symbols.ZNGA,\n                Time = reference,\n                Value = 2,\n                Quantity = 5\n            };\n\n            consolidator.Update(tb1);\n\n            Exception ex = Assert.Throws<InvalidOperationException>(() => consolidator.Update(tb2));\n            Assert.IsTrue(ex.Message.Contains(\"is not the same\"));\n        }\n\n        [Test]\n        public void AggregatesTradeBarsProperly()\n        {\n            TradeBar newTradeBar = null;\n            using var creator = new TradeBarConsolidator(4);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                newTradeBar = args;\n            };\n\n            var time = DateTime.Today;\n            var period = TimeSpan.FromMinutes(1);\n            var bar1 = new TradeBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Open = 1,\n                High = 2,\n                Low = 0.75m,\n                Close = 1.25m,\n                Period = period\n            };\n            creator.Update(bar1);\n            Assert.IsNull(newTradeBar);\n\n            var bar2 = new TradeBar\n            {\n                Time = time + TimeSpan.FromMinutes(1),\n                Symbol = Symbols.SPY,\n                Open = 1.1m,\n                High = 2.2m,\n                Low = 0.9m,\n                Close = 2.1m,\n                Period = period\n            };\n            creator.Update(bar2);\n            Assert.IsNull(newTradeBar);\n\n            var bar3 = new TradeBar\n            {\n                Time = time + TimeSpan.FromMinutes(2),\n                Symbol = Symbols.SPY,\n                Open = 1,\n                High = 2,\n                Low = 0.1m,\n                Close = 1.75m,\n                Period = period\n            };\n            creator.Update(bar3);\n            Assert.IsNull(newTradeBar);\n\n            var bar4 = new TradeBar\n            {\n                Time = time + TimeSpan.FromMinutes(3),\n                Symbol = Symbols.SPY,\n                Open = 1,\n                High = 7,\n                Low = 0.5m,\n                Close = 4.4m,\n                Period = period\n            };\n            creator.Update(bar4);\n            Assert.IsNotNull(newTradeBar);\n            Assert.AreEqual(bar1.Symbol, newTradeBar.Symbol);\n            Assert.AreEqual(1, newTradeBar.Open);\n            Assert.AreEqual(7, newTradeBar.High);\n            Assert.AreEqual(0.1m, newTradeBar.Low);\n            Assert.AreEqual(4.4m, newTradeBar.Close);\n            Assert.AreEqual(newTradeBar.Close, newTradeBar.Value);\n            Assert.AreEqual(bar4.EndTime, newTradeBar.EndTime);\n            Assert.AreEqual(TimeSpan.FromMinutes(4), newTradeBar.Period);\n            \n            Assert.AreEqual(bar1.Volume + bar2.Volume + bar3.Volume + bar4.Volume, newTradeBar.Volume);\n\n        }\n\n\n        [Test]\n        public void AggregatesPeriodInCountModeWithHourlyData()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new BaseDataConsolidator(2);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddHours(1) });\n            Assert.IsNotNull(consolidated);\n\n            // The EndTime of the consolidated bar should match the EndTime of the last data point\n            Assert.AreEqual(reference.AddHours(1), consolidated.EndTime);\n            Assert.AreEqual(TimeSpan.FromHours(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddHours(2) });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddHours(3) });\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(reference.AddHours(3), consolidated.EndTime);\n            Assert.AreEqual(TimeSpan.FromHours(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddHours(4) });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddHours(5) });\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(reference.AddHours(5), consolidated.EndTime);\n            Assert.AreEqual(TimeSpan.FromHours(1), consolidated.Period);\n        }\n\n        [Test]\n        public void AggregatesPeriodInPeriodModeWithDailyData()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new BaseDataConsolidator(TimeSpan.FromDays(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddDays(1) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(2) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(3) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n        }\n\n        [Test]\n        public void AggregatesPeriodInPeriodModeWithDailyDataAndRoundedTime()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new BaseDataConsolidator(TimeSpan.FromDays(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference.AddSeconds(45) });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddDays(1).AddMinutes(1) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference, consolidated.Time);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(2).AddHours(1).AddMinutes(1).AddSeconds(1) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference.AddDays(1), consolidated.Time);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(3) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference.AddDays(2), consolidated.Time);\n        }\n\n        [Test]\n        public void ConsolidatesWithRegisterIndicator()\n        {\n            using var consolidator = new BaseDataConsolidator(TimeSpan.FromMinutes(5));\n            consolidator.DataConsolidated += OnFiveMinutes;\n\n            indicator = new SimpleMovingAverage(2);\n            RegisterIndicator(indicator, consolidator);\n\n            var time = DateTime.Today.AddHours(9);\n            for (var i = 1; i < 100; i++)\n            {\n                consolidator.Update(new Tick(time.AddMinutes(i - 1), Symbols.SPY, i, i, i));\n            }\n        }\n\n        private SimpleMovingAverage indicator;\n\n        private void OnFiveMinutes(object sender, TradeBar e)\n        {\n            if (!indicator.IsReady) return;\n\n            var previous = e.Value - e.Period.Minutes;\n            var actual = (e.Value +  previous) / indicator.Period;\n            Assert.AreEqual(indicator, actual);\n        }\n\n        /// <summary>\n        /// Simplified version of QCAlgorithm.RegisterIndicator\n        /// </summary>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"consolidator\">The consolidator to receive raw subscription data</param>\n        public void RegisterIndicator(IndicatorBase<IndicatorDataPoint> indicator, IDataConsolidator consolidator)\n        {\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                indicator.Update(consolidated.EndTime, consolidated.Value);\n            };\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new BaseDataConsolidator(4);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2015, 04, 13, 8, 31, 0);\n            return new List<TradeBar>()\n            {\n                new TradeBar(){ Time = time, Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10 },\n                new TradeBar(){ Time = time.AddMinutes(1), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12, Close = 5 },\n                new TradeBar(){ Time = time.AddMinutes(2), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10, Close = 7  },\n                new TradeBar(){ Time = time.AddMinutes(3), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 5, Close = 2  },\n                new TradeBar(){ Time = time.AddMinutes(4), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 15 , Close = 2 },\n                new TradeBar(){ Time = time.AddMinutes(5), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 20 , Close = 2 },\n                new TradeBar(){ Time = time.AddMinutes(6), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 18 , Close = 8 },\n                new TradeBar(){ Time = time.AddMinutes(7), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12 , Close = 4 },\n                new TradeBar(){ Time = time.AddMinutes(8), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 25 , Close = 5 },\n                new TradeBar(){ Time = time.AddMinutes(9), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 30 , Close = 4 },\n                new TradeBar(){ Time = time.AddMinutes(10), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 26 , Close = 7 },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/BaseDataTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class BaseDataTests\n    {\n        [Test]\n        public void IsSparseData_ReturnsTrue_WhenSecurityTypeIsBase()\n        {\n            var baseData = new DataType {Symbol = Symbol.Create(\"ticker\", SecurityType.Base, QuantConnect.Market.USA)};\n            Assert.IsTrue(baseData.IsSparseData());\n        }\n\n        [Test]\n        public void IsSparseData_ReturnsFalse_WhenSecurityTypeIsNotBase()\n        {\n            var securityTypes = Enum.GetValues(typeof(SecurityType))\n                .Cast<SecurityType>()\n                .Where(type => type != SecurityType.Base);\n\n            foreach (var securityType in securityTypes)\n            {\n                var baseData = new DataType();\n\n                try { baseData.Symbol = Symbol.Create(\"ticker\", securityType, QuantConnect.Market.USA); }\n                catch (NotImplementedException) { continue; }\n\n                Assert.IsFalse(baseData.IsSparseData(), securityType.ToString());\n            }\n        }\n\n        private class DataType : BaseData { }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/CalendarConsolidatorsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class CalendarConsolidatorsTests\n    {\n        private Dictionary<Language, dynamic> _dailyFuncDictionary;\n        private Dictionary<Language, dynamic> _weeklyFuncDictionary;\n        private Dictionary<Language, dynamic> _monthlyFuncDictionary;\n\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            _dailyFuncDictionary = new Dictionary<Language, dynamic> { { Language.CSharp, TimeSpan.FromDays(1) } };\n            _weeklyFuncDictionary = new Dictionary<Language, dynamic> { { Language.CSharp, Calendar.Weekly } };\n            _monthlyFuncDictionary = new Dictionary<Language, dynamic> { { Language.CSharp, Calendar.Monthly } };\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"PythonCalendar\",\n                    @\"\nfrom AlgorithmImports import *\noneday = timedelta(1)\n\ndef Weekly(dt):\n    value = 8 - dt.isoweekday()\n    if value == 8: value = 1   # Sunday\n    start = (dt + timedelta(value)).date() - timedelta(7)\n    return CalendarInfo(start, timedelta(7))\n\ndef Monthly(dt):\n    start = dt.replace(day=1).date()\n    end = dt.replace(day=28) + timedelta(4)\n    end = (end - timedelta(end.day-1)).date()\n    return CalendarInfo(start, end - start)\"\n                );\n\n                _dailyFuncDictionary[Language.Python] = module.GetAttr(\"oneday\");\n                _weeklyFuncDictionary[Language.Python] = module.GetAttr(\"Weekly\");\n                _monthlyFuncDictionary[Language.Python] = module.GetAttr(\"Monthly\");\n            }\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesTradeBarToCalendarTradeBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var bars = new List<TradeBar>\n            {\n                new TradeBar(reference.AddDays(1), Symbols.SPY, 9, 11, 8, 10, 100, Time.OneDay),\n                new TradeBar(reference.AddDays(3), Symbols.SPY, 10, 12, 8, 11, 100, Time.OneDay),\n                new TradeBar(reference.AddDays(5), Symbols.SPY, 11, 13, 9, 10, 100, Time.OneDay),\n                new TradeBar(reference.AddDays(7), Symbols.SPY, 11, 13, 9, 11, 100, Time.OneDay),\n                new TradeBar(reference.AddDays(14), Symbols.SPY, 11, 13, 9, 11, 100, Time.OneDay)\n            };\n\n            using var weeklyConsolidator = new TradeBarConsolidator(_weeklyFuncDictionary[language]);\n            weeklyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTradeBar(\n                    bars.Take(3),\n                    reference,\n                    reference.AddDays(7),\n                    Symbols.SPY,\n                    e);\n            };\n\n            using var monthlyConsolidator = new TradeBarConsolidator(_monthlyFuncDictionary[language]);\n            monthlyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTradeBar(\n                    bars.Take(4),\n                    new DateTime(reference.Year, reference.Month, 1),\n                    new DateTime(reference.Year, reference.Month + 1, 1),\n                    Symbols.SPY,\n                    e);\n            };\n\n            foreach (var bar in bars.Take(4))\n            {\n                weeklyConsolidator.Update(bar);\n            }\n\n            foreach (var bar in bars)\n            {\n                monthlyConsolidator.Update(bar);\n            }\n        }\n\n        private void AssertTradeBar(IEnumerable<TradeBar> tradeBars, DateTime openTime, DateTime closeTime, Symbol symbol, TradeBar consolidated)\n        {\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(tradeBars.First().Open, consolidated.Open);\n            Assert.AreEqual(tradeBars.Max(x => x.High), consolidated.High);\n            Assert.AreEqual(tradeBars.Min(x => x.Low), consolidated.Low);\n            Assert.AreEqual(tradeBars.Last().Close, consolidated.Close);\n            Assert.AreEqual(tradeBars.Sum(x => x.Volume), consolidated.Volume);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesQuoteBarToCalendarQuoteBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var bars = new List<QuoteBar>\n            {\n                new QuoteBar(reference.AddDays(1), Symbols.EURUSD, new Bar(9, 11, 8, 10), 10, new Bar(9, 11, 8, 10), 10, Time.OneDay),\n                new QuoteBar(reference.AddDays(3), Symbols.EURUSD, new Bar(10, 12, 8, 11), 10, new Bar(10, 12, 8, 11), 10, Time.OneDay),\n                new QuoteBar(reference.AddDays(5), Symbols.EURUSD, new Bar(11, 13, 9, 10), 10, new Bar(11, 13, 9, 10), 10, Time.OneDay),\n                new QuoteBar(reference.AddDays(7), Symbols.EURUSD, new Bar(11, 13, 9, 11), 10, new Bar(11, 13, 9, 11), 10, Time.OneDay),\n                new QuoteBar(reference.AddDays(14), Symbols.EURUSD, new Bar(11, 13, 9, 11), 10, new Bar(11, 13, 9, 11), 10, Time.OneDay)\n            };\n\n            using var weeklyConsolidator = new QuoteBarConsolidator(_weeklyFuncDictionary[language]);\n            weeklyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertQuoteBar(\n                    bars.Take(3),\n                    reference,\n                    reference.AddDays(7),\n                    Symbols.EURUSD,\n                    e);\n            };\n\n            using var monthlyConsolidator = new QuoteBarConsolidator(_monthlyFuncDictionary[language]);\n            monthlyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertQuoteBar(\n                    bars.Take(4),\n                    new DateTime(reference.Year, reference.Month, 1),\n                    new DateTime(reference.Year, reference.Month + 1, 1),\n                    Symbols.EURUSD,\n                    e);\n            };\n\n            foreach (var bar in bars.Take(4))\n            {\n                weeklyConsolidator.Update(bar);\n            }\n\n            foreach (var bar in bars.Take(5))\n            {\n                monthlyConsolidator.Update(bar);\n            }\n        }\n        private void AssertQuoteBar(IEnumerable<QuoteBar> quoteBars, DateTime openTime, DateTime closeTime, Symbol symbol, QuoteBar consolidated)\n        {\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(quoteBars.First().Open, consolidated.Open);\n            Assert.AreEqual(quoteBars.First().Bid.Open, consolidated.Bid.Open);\n            Assert.AreEqual(quoteBars.First().Ask.Open, consolidated.Ask.Open);\n            Assert.AreEqual(quoteBars.Max(x => x.High), consolidated.High);\n            Assert.AreEqual(quoteBars.Max(x => x.Bid.High), consolidated.Bid.High);\n            Assert.AreEqual(quoteBars.Max(x => x.Ask.High), consolidated.Ask.High);\n            Assert.AreEqual(quoteBars.Min(x => x.Low), consolidated.Low);\n            Assert.AreEqual(quoteBars.Min(x => x.Bid.Low), consolidated.Bid.Low);\n            Assert.AreEqual(quoteBars.Min(x => x.Ask.Low), consolidated.Ask.Low);\n            Assert.AreEqual(quoteBars.Last().Close, consolidated.Close);\n            Assert.AreEqual(quoteBars.Last().Bid.Close, consolidated.Bid.Close);\n            Assert.AreEqual(quoteBars.Last().Ask.Close, consolidated.Ask.Close);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesTickToCalendarTradeBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var ticks = new List<Tick>\n            {\n                new Tick(reference.AddDays(1), Symbols.SPY, 9, 11, 8){ TickType = TickType.Trade, Quantity = 10 },\n                new Tick(reference.AddDays(3), Symbols.SPY, 10, 12, 8){ TickType = TickType.Trade,  Quantity = 10 },\n                new Tick(reference.AddDays(5), Symbols.SPY, 11, 13, 9){ TickType = TickType.Trade,  Quantity = 10 },\n                new Tick(reference.AddDays(7), Symbols.SPY, 11, 13, 9){ TickType = TickType.Trade,  Quantity = 10 },\n                new Tick(reference.AddDays(14), Symbols.SPY, 11, 13, 9){ TickType = TickType.Trade,  Quantity = 10 }\n            };\n\n            using var weeklyConsolidator = new TickConsolidator(_weeklyFuncDictionary[language]);\n            weeklyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTickTradeBar(\n                    ticks.Take(3),\n                    reference,\n                    reference.AddDays(7),\n                    Symbols.SPY,\n                    e);\n            };\n\n            using var monthlyConsolidator = new TickConsolidator(_monthlyFuncDictionary[language]);\n            monthlyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTickTradeBar(\n                    ticks.Take(4),\n                    new DateTime(reference.Year, reference.Month, 1),\n                    new DateTime(reference.Year, reference.Month + 1, 1),\n                    Symbols.SPY,\n                    e);\n            };\n\n            foreach (var tick in ticks.Take(4))\n            {\n                weeklyConsolidator.Update(tick);\n            }\n\n            foreach (var tick in ticks)\n            {\n                monthlyConsolidator.Update(tick);\n            }\n        }\n\n        private void AssertTickTradeBar(IEnumerable<Tick> ticks, DateTime openTime, DateTime closeTime, Symbol symbol, TradeBar consolidated)\n        {\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(ticks.First().Value, consolidated.Open);\n            Assert.AreEqual(ticks.Max(x => x.Value), consolidated.High);\n            Assert.AreEqual(ticks.Min(x => x.Value), consolidated.Low);\n            Assert.AreEqual(ticks.Last().Value, consolidated.Close);\n            Assert.AreEqual(ticks.Sum(x => x.Quantity), consolidated.Volume);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesTickToCalendarQuoteBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var ticks = new List<Tick>\n            {\n                new Tick(reference.AddDays(1), Symbols.EURUSD, 9, 11, 8){ Quantity = 10 },\n                new Tick(reference.AddDays(3), Symbols.EURUSD, 10, 12, 8){ Quantity = 10 },\n                new Tick(reference.AddDays(5), Symbols.EURUSD, 11, 13, 9){ Quantity = 10 },\n                new Tick(reference.AddDays(7), Symbols.EURUSD, 11, 13, 9){ Quantity = 10 },\n                new Tick(reference.AddDays(14), Symbols.EURUSD, 11, 13, 9){ Quantity = 10 }\n            };\n\n            using var weeklyConsolidator = new TickQuoteBarConsolidator(_weeklyFuncDictionary[language]);\n            weeklyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTickQuoteBar(\n                    ticks.Take(3),\n                    reference,\n                    reference.AddDays(7),\n                    Symbols.EURUSD,\n                    e);\n            };\n\n            using var monthlyConsolidator = new TickQuoteBarConsolidator(_monthlyFuncDictionary[language]);\n            monthlyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTickQuoteBar(\n                    ticks.Take(4),\n                    new DateTime(reference.Year, reference.Month, 1),\n                    new DateTime(reference.Year, reference.Month + 1, 1),\n                    Symbols.EURUSD,\n                    e);\n            };\n\n            foreach (var tick in ticks.Take(4))\n            {\n                weeklyConsolidator.Update(tick);\n            }\n\n            foreach (var tick in ticks)\n            {\n                monthlyConsolidator.Update(tick);\n            }\n        }\n\n        private void AssertTickQuoteBar(IEnumerable<Tick> ticks, DateTime openTime, DateTime closeTime, Symbol symbol, QuoteBar consolidated)\n        {\n            Assert.IsNotNull(consolidated);        \n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(ticks.First().BidPrice, consolidated.Bid.Open);\n            Assert.AreEqual(ticks.First().AskPrice, consolidated.Ask.Open);\n            Assert.AreEqual(ticks.Max(x => x.BidPrice), consolidated.Bid.High);\n            Assert.AreEqual(ticks.Max(x => x.AskPrice), consolidated.Ask.High);\n            Assert.AreEqual(ticks.Min(x => x.BidPrice), consolidated.Bid.Low);\n            Assert.AreEqual(ticks.Min(x => x.AskPrice), consolidated.Ask.Low);\n            Assert.AreEqual(ticks.Last().BidPrice, consolidated.Bid.Close);\n            Assert.AreEqual(ticks.Last().AskPrice, consolidated.Ask.Close);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesBaseDataToCalendarTradeBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var ticks = new List<Tick>\n            {\n                new Tick(reference.AddDays(1), Symbols.SPY, 9, 11, 8){ Quantity = 10 },\n                new Tick(reference.AddDays(3), Symbols.SPY, 10, 12, 8){ Quantity = 10 },\n                new Tick(reference.AddDays(5), Symbols.SPY, 11, 13, 9){ Quantity = 10 },\n                new Tick(reference.AddDays(7), Symbols.SPY, 11, 13, 9){ Quantity = 10 },\n                new Tick(reference.AddDays(14), Symbols.SPY, 11, 13, 9){ Quantity = 10 }\n            };\n\n            using var weeklyConsolidator = new BaseDataConsolidator(_weeklyFuncDictionary[language]);\n            weeklyConsolidator.DataConsolidated += (s, e) => \n            {\n                AssertBaseTradeBar(\n                    ticks.Take(3),\n                    reference,\n                    reference.AddDays(7),\n                    Symbols.SPY,\n                    e);\n            };\n\n            using var monthlyConsolidator = new BaseDataConsolidator(_monthlyFuncDictionary[language]);\n            monthlyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertBaseTradeBar(\n                    ticks.Take(4),\n                    new DateTime(reference.Year, reference.Month, 1),\n                    new DateTime(reference.Year, reference.Month + 1, 1),\n                    Symbols.SPY,\n                    e);\n            };\n\n            foreach (var tick in ticks.Take(4))\n            {\n                weeklyConsolidator.Update(tick);\n            }\n\n            foreach (var tick in ticks)\n            {\n                monthlyConsolidator.Update(tick);\n            }\n        }\n\n\n        private void AssertBaseTradeBar(IEnumerable<Tick> ticks, DateTime openTime, DateTime closeTime, Symbol symbol, TradeBar consolidated)\n        {\n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(ticks.First().Value, consolidated.Open);\n            Assert.AreEqual(ticks.Max(x => x.Value), consolidated.High);\n            Assert.AreEqual(ticks.Min(x => x.Value), consolidated.Low);\n            Assert.AreEqual(ticks.Last().Value, consolidated.Close);\n            Assert.AreEqual(0, consolidated.Volume);\n        }\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AggregatesTradeBarToDailyTradeBarProperly(Language language)\n        {\n            // Monday\n            var reference = new DateTime(2019, 3, 18);\n            var bars = new List<TradeBar>\n            {\n                new TradeBar(reference.AddHours(6), Symbols.SPY, 9, 11, 8, 10, 100, Time.OneHour),\n                new TradeBar(reference.AddHours(12), Symbols.SPY, 10, 12, 8, 11, 100, Time.OneHour),\n                new TradeBar(reference.AddHours(18), Symbols.SPY, 11, 13, 9, 10, 100, Time.OneHour),\n                new TradeBar(reference.AddHours(21), Symbols.SPY, 11, 13, 9, 11, 100, Time.OneHour),\n                new TradeBar(reference.AddHours(25), Symbols.SPY, 11, 13, 9, 11, 100, Time.OneHour)\n            };\n\n            using var dailyConsolidator = new TradeBarConsolidator(_dailyFuncDictionary[language]);\n            dailyConsolidator.DataConsolidated += (s, e) =>\n            {\n                AssertTradeBar(\n                    bars.Take(4),\n                    reference,\n                    reference.AddDays(1),\n                    Symbols.SPY,\n                    e);\n            };\n\n            foreach (var bar in bars)\n            {\n                dailyConsolidator.Update(bar);\n            }\n        }\n\n        private void AssertDailyTradeBar(IEnumerable<TradeBar> tradeBars, DateTime openTime, DateTime closeTime, Symbol symbol, TradeBar consolidated)\n        {\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(openTime, consolidated.Time);\n            Assert.AreEqual(closeTime, consolidated.EndTime);\n            Assert.AreEqual(symbol, consolidated.Symbol);\n            Assert.AreEqual(tradeBars.First().Open, consolidated.Open);\n            Assert.AreEqual(tradeBars.Max(x => x.High), consolidated.High);\n            Assert.AreEqual(tradeBars.Min(x => x.Low), consolidated.Low);\n            Assert.AreEqual(tradeBars.Last().Close, consolidated.Close);\n            Assert.AreEqual(tradeBars.Sum(x => x.Volume), consolidated.Volume);\n        }\n\n\n        private SimpleMovingAverage indicator;\n\n        [Test]\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AllCalendarsConsolidatesWithRegisterIndicator(Language language)\n        {\n            CalendarConsolidatesWithRegisterIndicator(_weeklyFuncDictionary[language]);\n            CalendarConsolidatesWithRegisterIndicator(_monthlyFuncDictionary[language]);\n        }\n\n        [Test]\n        public void Weekly()\n        {\n            var quarterly = Calendar.Weekly;\n\n            var calendarInfo = quarterly(new DateTime(2020, 2, 20));\n\n            Assert.AreEqual(new DateTime(2020, 2, 17), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(7), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 11, 2));\n\n            Assert.AreEqual(new DateTime(2018, 10, 29), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(7), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 12, 31));\n\n            Assert.AreEqual(new DateTime(2018, 12, 31), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(7), calendarInfo.Period);\n        }\n\n        [Test]\n        public void Monthly()\n        {\n            var quarterly = Calendar.Monthly;\n\n            var calendarInfo = quarterly(new DateTime(2020, 5, 11));\n\n            Assert.AreEqual(new DateTime(2020, 5, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(31), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 11, 13));\n\n            Assert.AreEqual(new DateTime(2018, 11, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(30), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 12, 31));\n\n            Assert.AreEqual(new DateTime(2018, 12, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(31), calendarInfo.Period);\n        }\n\n        [Test]\n        public void Quarterly()\n        {\n            var quarterly = Calendar.Quarterly;\n\n            var calendarInfo = quarterly(new DateTime(2020, 5, 1));\n\n            Assert.AreEqual(new DateTime(2020, 4, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(91), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 11, 13));\n\n            Assert.AreEqual(new DateTime(2018, 10, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(92), calendarInfo.Period);\n\n            calendarInfo = quarterly(new DateTime(2018, 12, 31));\n\n            Assert.AreEqual(new DateTime(2018, 10, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(92), calendarInfo.Period);\n        }\n\n        [Test]\n        public void Yearly()\n        {\n            var quarterly = Calendar.Yearly;\n            var calendarInfo = quarterly(new DateTime(2020, 5, 1));\n\n            Assert.AreEqual(new DateTime(2020, 1, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(366), calendarInfo.Period);   // leap year\n\n            calendarInfo = quarterly(new DateTime(2021, 11, 1));\n\n            Assert.AreEqual(new DateTime(2021, 1, 1), calendarInfo.Start);\n            Assert.AreEqual(TimeSpan.FromDays(365), calendarInfo.Period);\n        }\n\n        private void CalendarConsolidatesWithRegisterIndicator(dynamic calendarType)\n        {\n            using var consolidator = new TradeBarConsolidator(calendarType);\n            consolidator.DataConsolidated += (s, e) =>\n            {\n                if (!indicator.IsReady) return;\n\n                var previous = e.Value - e.Period.Days;\n                var actual = (e.Value + previous) / indicator.Period;\n                Assert.AreEqual(indicator, actual);\n            };\n\n            indicator = new SimpleMovingAverage(2);\n            RegisterIndicator(indicator, consolidator);\n\n            var reference = new DateTime(2019, 4, 1);\n            for (var i = 1; i < 100; i++)\n            {\n                var bar = new TradeBar(reference.AddDays(i - 1), Symbols.SPY, i, i, i, i, 0);\n                consolidator.Update(bar);\n            }\n        }\n\n        /// <summary>\n        /// Simplified version of QCAlgorithm.RegisterIndicator\n        /// </summary>\n        /// <param name=\"indicator\">The indicator to receive data from the consolidator</param>\n        /// <param name=\"consolidator\">The consolidator to receive raw subscription data</param>\n        public void RegisterIndicator(IndicatorBase<IndicatorDataPoint> indicator, IDataConsolidator consolidator)\n        {\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                indicator.Update(consolidated.EndTime, consolidated.Value);\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/ChannelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class ChannelTests\n    {\n        private static TestCaseData[] Equality => new[]\n        {\n            new TestCaseData(new Channel(\"trade\", Symbols.SPY), Symbols.SPY, \"trade\"),\n            new TestCaseData(new Channel(\"quote\", Symbols.AAPL), Symbols.AAPL, \"quote\"),\n            new TestCaseData(new Channel(\"quote-trade\", Symbols.IBM), Symbols.IBM, \"quote-trade\")\n        };\n\n        [TestCaseSource(nameof(Equality))]\n        public void Equal(Channel expected, Symbol symbol, string channelName)\n        {\n            var actual = new Channel(channelName, symbol);\n            Assert.AreNotSame(expected, actual);\n            Assert.AreEqual(expected, actual);\n            Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode());\n        }\n\n        private static TestCaseData[] Inequality => new[]\n        {\n            new TestCaseData(new Channel(\"trade\", Symbols.SPY), Symbols.SPY, \"quote\"),\n            new TestCaseData(new Channel(\"trade\", Symbols.AAPL), Symbols.SPY, \"trade\"),\n            new TestCaseData(new Channel(\"quote-trade\", Symbols.IBM), Symbols.IBM, \"quote\"),\n            new TestCaseData(new Channel(\"quote-trade\", Symbols.MSFT), Symbols.MSFT, \"trade\")\n        };\n\n        [TestCaseSource(nameof(Inequality))]\n        public void NotEqual(Channel expected, Symbol symbol, string channelName)\n        {\n            var actual = new Channel(channelName, symbol);\n            Assert.AreNotSame(expected, actual);\n            Assert.AreNotEqual(expected, actual);\n            Assert.AreNotEqual(expected.GetHashCode(), actual.GetHashCode());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/ClassicRangeConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Consolidators;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing NUnit.Framework;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    public class ClassicRangeConsolidatorTests : RangeConsolidatorTests\n    {\n        protected override RangeConsolidator CreateRangeConsolidator(int range)\n        {\n            return new ClassicRangeConsolidator(range, x => x.Value, x => 10m);\n        }\n\n        /// <summary>\n        /// This test doesn't work for ClassicRangeConsolidator since this consolidator\n        /// doesn't create intermediate/phantom bars\n        /// </summary>\n        [TestCaseSource(nameof(PriceGapBehaviorIsTheExpectedOneTestCases))]\n        public override void PriceGapBehaviorIsTheExpectedOne(Symbol symbol, double minimumPriceVariation, double range)\n        {\n        }\n\n        [TestCaseSource(nameof(ConsolidatorCreatesExpectedBarsTestCases))]\n        public override void ConsolidatorCreatesExpectedBarsInDifferentScenarios(List<decimal> testValues, RangeBar[] expectedBars)\n        {\n            base.ConsolidatorCreatesExpectedBarsInDifferentScenarios(testValues, expectedBars);\n        }\n\n        private static object[] ConsolidatorCreatesExpectedBarsTestCases = new object[]\n        {\n            new object[] { new List<decimal>(){ 90m, 94.5m }, new RangeBar[] {\n                new RangeBar{ Open = 90m, Low = 90m, High = 91m, Close = 91m, Volume = 10m, EndTime = new DateTime(2016, 1, 2) }\n            }},\n            new object[] { new List<decimal>(){ 94m, 89.5m }, new RangeBar[] {\n                new RangeBar { Open = 94m, Low = 93m, High = 94m, Close = 93m, Volume = 10m, EndTime = new DateTime(2016, 1, 2) }\n            }},\n            new object[] { new List<decimal>{ 90m, 94.5m, 89.5m }, new RangeBar[] {\n                new RangeBar { Open = 90m, Low = 90m, High = 91m, Close = 91m, Volume = 10m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 94.5m, Low = 93.50m, High = 94.50m, Close = 93.50m, Volume = 10m, EndTime = new DateTime(2016, 1, 3)}\n            }},\n            new object[] { new List<decimal>{ 94.5m, 89.5m, 94.5m }, new RangeBar[] {\n                new RangeBar { Open = 95m, Low = 94m, High = 95m, Close = 94m, Volume = 10m, EndTime = new DateTime(2016, 1, 2)},\n                new RangeBar { Open = 89.50m, Low = 89.50m, High = 90.50m, Close = 90.50m, Volume = 10m , EndTime = new DateTime(2016, 1, 3)}\n            }},\n        };\n\n        protected override decimal[][] GetRangeConsolidatorExpectedValues()\n        {\n            return new decimal[][] {\n                    new decimal[]{ 90m, 90m, 91m, 91m, 10m },\n                    new decimal[]{ 94.5m, 93.5m, 94.5m, 93.5m, 20m},\n                    new decimal[]{ 89.5m, 89m, 90m, 90m, 20m},\n                    new decimal[]{ 90.5m, 90m, 91m, 91m, 20m},\n                    new decimal[]{ 91.5m, 90.5m, 91.5m, 90.5m, 10m},\n                    new decimal[]{ 90m, 90m, 91m, 91m, 20m},\n                };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/ClassicRenkoConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class ClassicRenkoConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void ClassicOutputTypeIsRenkoBar()\n        {\n            using var consolidator = new ClassicRenkoConsolidator(10, x => x.Value, x => 0);\n            Assert.AreEqual(typeof(RenkoBar), consolidator.OutputType);\n        }\n\n        [Test]\n        public void ClassicConsolidatesOnBrickHigh()\n        {\n            RenkoBar bar = null;\n            using var consolidator = new ClassicRenkoConsolidator(10, x => x.Value, x => 0);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var reference = DateTime.Today;\n            consolidator.Update(new IndicatorDataPoint(reference, 0m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddHours(1), 5m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddHours(2), 10m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(0m, bar.Open);\n            Assert.AreEqual(10m, bar.Close);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void ClassicConsolidatesOnBrickLow()\n        {\n            RenkoBar bar = null;\n            using var consolidator = new ClassicRenkoConsolidator(10, x => x.Value, x => 0);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var reference = DateTime.Today;\n            consolidator.Update(new IndicatorDataPoint(reference, 10m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddHours(1), 2m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddHours(2), 0m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(10m, bar.Open);\n            Assert.AreEqual(0m, bar.Close);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void ConsistentRenkos()\n        {\n            // Test Renko bar consistency amongst three consolidators starting at different times\n\n            var time = new DateTime(2016, 1, 1);\n            var testValues = new List<decimal>\n            {\n                1.38687m, 1.38688m, 1.38687m, 1.38686m, 1.38685m, 1.38683m,\n                1.38682m, 1.38682m, 1.38684m, 1.38682m, 1.38682m, 1.38680m,\n                1.38681m, 1.38686m, 1.38688m, 1.38688m, 1.38690m, 1.38690m,\n                1.38691m, 1.38692m, 1.38694m, 1.38695m, 1.38697m, 1.38697m,\n                1.38700m, 1.38699m, 1.38699m, 1.38699m, 1.38698m, 1.38699m,\n                1.38697m, 1.38698m, 1.38698m, 1.38697m, 1.38698m, 1.38698m,\n                1.38697m, 1.38697m, 1.38700m, 1.38702m, 1.38701m, 1.38699m,\n                1.38697m, 1.38698m, 1.38696m, 1.38698m, 1.38697m, 1.38695m,\n                1.38695m, 1.38696m, 1.38693m, 1.38692m, 1.38693m, 1.38693m,\n                1.38692m, 1.38693m, 1.38692m, 1.38690m, 1.38686m, 1.38685m,\n                1.38687m, 1.38686m, 1.38686m, 1.38686m, 1.38686m, 1.38685m,\n                1.38684m, 1.38678m, 1.38679m, 1.38680m, 1.38680m, 1.38681m,\n                1.38685m, 1.38685m, 1.38683m, 1.38682m, 1.38682m, 1.38683m,\n                1.38682m, 1.38683m, 1.38682m, 1.38681m, 1.38680m, 1.38681m,\n                1.38681m, 1.38681m, 1.38682m, 1.38680m, 1.38679m, 1.38678m,\n                1.38675m, 1.38678m, 1.38678m, 1.38678m, 1.38682m, 1.38681m,\n                1.38682m, 1.38680m, 1.38682m, 1.38683m, 1.38685m, 1.38683m,\n                1.38683m, 1.38684m, 1.38683m, 1.38683m, 1.38684m, 1.38685m,\n                1.38684m, 1.38683m, 1.38686m, 1.38685m, 1.38685m, 1.38684m,\n                1.38685m, 1.38682m, 1.38684m, 1.38683m, 1.38682m, 1.38683m,\n                1.38685m, 1.38685m, 1.38685m, 1.38683m, 1.38685m, 1.38684m,\n                1.38686m, 1.38693m, 1.38695m, 1.38693m, 1.38694m, 1.38693m,\n                1.38692m, 1.38693m, 1.38695m, 1.38697m, 1.38698m, 1.38695m,\n                1.38696m\n            };\n\n\n            var consolidator1 = new ClassicRenkoConsolidator(0.0001m);\n            var consolidator2 = new ClassicRenkoConsolidator(0.0001m);\n            var consolidator3 = new ClassicRenkoConsolidator(0.0001m);\n\n            // Update each of our consolidators starting at different indexes of test values\n            for (int i = 0; i < testValues.Count; i++)\n            {\n                var data = new IndicatorDataPoint(time.AddSeconds(i), testValues[i]);\n                consolidator1.Update(data);\n\n                if (i > 10)\n                {\n                    consolidator2.Update(data);\n                }\n\n                if (i > 20)\n                {\n                    consolidator3.Update(data);\n                }\n            }\n\n            // Assert that consolidator 2 and 3 price is the same as 1. Even though they started at different\n            // indexes they should be the same\n            var bar1 = consolidator1.Consolidated as RenkoBar;\n            var bar2 = consolidator2.Consolidated as RenkoBar;\n            var bar3 = consolidator3.Consolidated as RenkoBar;\n\n            Assert.AreEqual(bar1.Close, bar2.Close);\n            Assert.AreEqual(bar1.Close, bar3.Close);\n\n            consolidator1.Dispose();\n            consolidator2.Dispose();\n            consolidator3.Dispose();\n        }\n\n        [Test]\n        public void ClassicCyclesUpAndDown()\n        {\n            RenkoBar bar = null;\n            int rcount = 0;\n            using var consolidator = new ClassicRenkoConsolidator(1m, x => x.Value, x => 0);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                rcount++;\n                bar = consolidated;\n            };\n\n            var reference = DateTime.Today;\n\n            // opens at 0\n            consolidator.Update(new IndicatorDataPoint(reference, 0));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(1), .5m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(2), 1m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(0m, bar.Open);\n            Assert.AreEqual(1m, bar.Close);\n            Assert.AreEqual(0, bar.Volume);\n            Assert.AreEqual(1m, bar.High);\n            Assert.AreEqual(0m, bar.Low);\n            Assert.IsTrue(bar.IsClosed);\n            Assert.AreEqual(reference, bar.Start);\n            Assert.AreEqual(reference.AddSeconds(2), bar.EndTime);\n\n            bar = null;\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(3), 1.5m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(4), 1m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(5), .5m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(6), 0m));\n            Assert.IsNotNull(bar);\n\n            // ReSharper disable HeuristicUnreachableCode - ReSharper doesn't realiz this can be set via the event handler\n            Assert.AreEqual(1m, bar.Open);\n            Assert.AreEqual(0m, bar.Close);\n            Assert.AreEqual(0, bar.Volume);\n            Assert.AreEqual(1.5m, bar.High);\n            Assert.AreEqual(0m, bar.Low);\n            Assert.IsTrue(bar.IsClosed);\n            Assert.AreEqual(reference.AddSeconds(2), bar.Start);\n            Assert.AreEqual(reference.AddSeconds(6), bar.EndTime);\n\n            bar = null;\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(7), -0.5m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(8), -0.9999999m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(9), -0.01m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(10), 0.25m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(9), 0.75m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(10), 0.9999999m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(10), 0.25m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(9), -0.25m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new IndicatorDataPoint(reference.AddSeconds(10), -1m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(0m, bar.Open);\n            Assert.AreEqual(-1m, bar.Close);\n            Assert.AreEqual(0, bar.Volume);\n            Assert.AreEqual(0.9999999m, bar.High);\n            Assert.AreEqual(-1m, bar.Low);\n            Assert.IsTrue(bar.IsClosed);\n            Assert.AreEqual(reference.AddSeconds(6), bar.Start);\n            Assert.AreEqual(reference.AddSeconds(10), bar.EndTime);\n\n            // ReSharper restore HeuristicUnreachableCode\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void SelectorCanBeOptionalWhenVolumeSelectorIsPassed(Language language)\n        {\n            if (language == Language.CSharp)\n            {\n                Assert.DoesNotThrow(() =>\n                {\n                    using var consolidator = new ClassicRenkoConsolidator(10, null, x => x.Value);\n                });\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"test\", @\"\nfrom AlgorithmImports import *\n\ndef getConsolidator():\n    return ClassicRenkoConsolidator(10, None, lambda x: x.Value)\n\");\n                    Assert.DoesNotThrow(() =>\n                    {\n                        var consolidator = testModule.GetAttr(\"getConsolidator\").Invoke();\n                    });\n                }\n            }\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new ClassicRenkoConsolidator(0.0001m);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/ConsolidatorWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class ConsolidatorWrapperTests\n    {\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(100)]\n        public void InitialScanTime(int seconds)\n        {\n            var time = new DateTime(2024, 2, 16);\n            var timeKeeper = new TimeKeeper(time, TimeZones.NewYork);\n            var localtime = timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            var increment = TimeSpan.FromSeconds(seconds);\n            using var consolidator = new TestConsolidator();\n            using var wrapper = new ConsolidatorWrapper(consolidator, increment, timeKeeper, localtime);\n            wrapper.AdvanceScanTime();\n\n            Assert.AreEqual(time.Add(increment < Time.OneSecond ? Time.OneSecond : increment), wrapper.UtcScanTime);\n        }\n\n        [TestCase(2)]\n        [TestCase(100)]\n        public void ScanTimeAfterScanUtcTimeInPast(int seconds)\n        {\n            var time = new DateTime(2024, 2, 16);\n            var timeKeeper = new TimeKeeper(time, TimeZones.NewYork);\n            var localtime = timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            var increment = TimeSpan.FromSeconds(seconds);\n            using var consolidator = new TestConsolidator();\n            using var wrapper = new ConsolidatorWrapper(consolidator, increment, timeKeeper, localtime);\n            wrapper.AdvanceScanTime();\n\n            var expected = time.Add(increment < Time.OneSecond ? Time.OneSecond : increment);\n            Assert.AreEqual(expected, wrapper.UtcScanTime);\n\n            timeKeeper.SetUtcDateTime(time.Add(Time.OneSecond));\n            wrapper.Scan();\n            Assert.AreEqual(expected, wrapper.UtcScanTime);\n        }\n\n        [TestCase(2)]\n        [TestCase(100)]\n        public void ScanTimeAfterScanUtcTimeInFuture(int seconds)\n        {\n            var time = new DateTime(2024, 2, 16);\n            var timeKeeper = new TimeKeeper(time, TimeZones.NewYork);\n            var localtime = timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            var increment = TimeSpan.FromSeconds(seconds);\n            using var consolidator = new TestConsolidator();\n            using var wrapper = new ConsolidatorWrapper(consolidator, increment, timeKeeper, localtime);\n            wrapper.AdvanceScanTime();\n\n            var expected = time.Add(increment < Time.OneSecond ? Time.OneSecond : increment);\n            Assert.AreEqual(expected, wrapper.UtcScanTime);\n\n            timeKeeper.SetUtcDateTime(time.Add(Time.OneDay));\n\n            wrapper.Scan();\n            Assert.AreEqual(expected.Add(Time.OneDay), wrapper.UtcScanTime);\n        }\n\n        [TestCase(-1, true)]\n        [TestCase(0, true)]\n        [TestCase(1, true)]\n        [TestCase(2, true)]\n        [TestCase(3, true)]\n        [TestCase(24, true)]\n        [TestCase(-24, true)]\n        [TestCase(-1, false)]\n        [TestCase(0, false)]\n        [TestCase(1, false)]\n        [TestCase(2, false)]\n        [TestCase(3, false)]\n        [TestCase(24, false)]\n        [TestCase(-24, false)]\n        public void ScanTimeAfterConsolidationDayLightSavings(int hoursShift, bool savingsStart)\n        {\n            var tz = TimeZones.NewYork;\n            DateTime time;\n            if (savingsStart)\n            {\n                time = new DateTime(2024, 3, 10).AddHours(hoursShift).ConvertToUtc(tz);\n            }\n            else\n            {\n                time = new DateTime(2024, 11, 3).AddHours(hoursShift).ConvertToUtc(tz);\n            }\n            var timeKeeper = new TimeKeeper(time, tz);\n            var localtime = timeKeeper.GetLocalTimeKeeper(tz);\n            var increment = Time.OneHour;\n            using var consolidator = new TestConsolidator();\n            using var wrapper = new ConsolidatorWrapper(consolidator, increment, timeKeeper, localtime);\n            wrapper.AdvanceScanTime();\n\n            var expected = time.Add(Time.OneHour);\n            Assert.AreEqual(expected, wrapper.UtcScanTime);\n\n            consolidator.Consolidate(new TradeBar { Time = time.AddMinutes(100), Period = Time.OneDay });\n\n            Assert.AreEqual(consolidator.Consolidated.EndTime.ConvertToUtc(tz) + Time.OneDay, wrapper.UtcScanTime);\n        }\n\n        [TestCase(-1, true)]\n        [TestCase(0, true)]\n        [TestCase(1, true)]\n        [TestCase(2, true)]\n        [TestCase(3, true)]\n        [TestCase(24, true)]\n        [TestCase(-24, true)]\n        [TestCase(-1, false)]\n        [TestCase(0, false)]\n        [TestCase(1, false)]\n        [TestCase(2, false)]\n        [TestCase(3, false)]\n        [TestCase(24, false)]\n        [TestCase(-24, false)]\n        public void ScanTimeOnWorkingBarDayLightSavings(int hoursShift, bool savingsStart)\n        {\n            var tz = TimeZones.NewYork;\n            DateTime time;\n            if (savingsStart)\n            {\n                time = new DateTime(2024, 3, 10).AddHours(hoursShift).ConvertToUtc(tz);\n            }\n            else\n            {\n                time = new DateTime(2024, 11, 3).AddHours(hoursShift).ConvertToUtc(tz);\n            }\n            var timeKeeper = new TimeKeeper(time, tz);\n            var localtime = timeKeeper.GetLocalTimeKeeper(tz);\n            var increment = Time.OneHour;\n            using var consolidator = new TestConsolidator();\n            using var wrapper = new ConsolidatorWrapper(consolidator, increment, timeKeeper, localtime);\n            wrapper.AdvanceScanTime();\n\n            var expected = time.Add(Time.OneHour);\n            Assert.AreEqual(expected, wrapper.UtcScanTime);\n\n            timeKeeper.SetUtcDateTime(wrapper.UtcScanTime);\n\n            // set a working bars\n            consolidator.WorkingData = new TradeBar { Time = time.AddMinutes(100), Period = Time.OneDay };\n            wrapper.Scan();\n\n            // after the scan we adjust the expected end time to the working bar\n            Assert.AreEqual(consolidator.WorkingData.EndTime.ConvertToUtc(tz), wrapper.UtcScanTime);\n        }\n\n        [Test]\n        public void ConsolidatorScanPriorityComparerComparesByUtcScanDate()\n        {\n            const int id = 1;\n            var utcScanTime = new DateTime(2024, 12, 10, 0, 0, 0, DateTimeKind.Utc);\n\n            var priority1 = new ConsolidatorScanPriority(utcScanTime, id);\n            var priority2 = new ConsolidatorScanPriority(utcScanTime.AddSeconds(1), id + 1);\n            var priority3 = new ConsolidatorScanPriority(utcScanTime, id + 1);\n\n            Assert.AreEqual(-1, ConsolidatorScanPriority.Comparer.Compare(priority1, priority2));\n            Assert.AreEqual(1, ConsolidatorScanPriority.Comparer.Compare(priority2, priority1));\n            Assert.AreEqual(1, ConsolidatorScanPriority.Comparer.Compare(priority3, priority1));\n            Assert.AreEqual(-1, ConsolidatorScanPriority.Comparer.Compare(priority3, priority2));\n            Assert.AreEqual(0, ConsolidatorScanPriority.Comparer.Compare(priority1, priority1));\n        }\n\n        [Test]\n        public void ConsolidatorScanPriorityComparerComparesByIdIfUtcScanTimesAreEqual()\n        {\n            const int id = 1;\n            var utcScanTime = new DateTime(2024, 12, 10, 0, 0, 0, DateTimeKind.Utc);\n\n            var priority1 = new ConsolidatorScanPriority(utcScanTime, id);\n            var priority2 = new ConsolidatorScanPriority(utcScanTime, id + 1);\n\n            Assert.AreEqual(1, ConsolidatorScanPriority.Comparer.Compare(priority2, priority1));\n        }\n\n        [Test]\n        public void ConsolidatorScanPriorityComparerTreatsNullsRight()\n        {\n            const int id = 1;\n            var utcScanTime = new DateTime(2024, 12, 10, 0, 0, 0, DateTimeKind.Utc);\n            var priority1 = new ConsolidatorScanPriority(utcScanTime, id);\n\n            Assert.AreEqual(1, ConsolidatorScanPriority.Comparer.Compare(priority1, null));\n            Assert.AreEqual(-1, ConsolidatorScanPriority.Comparer.Compare(null, priority1));\n            Assert.AreEqual(0, ConsolidatorScanPriority.Comparer.Compare(null, null));\n        }\n\n        private class TestConsolidator : IDataConsolidator\n        {\n            public IBaseData Consolidated { get; set; }\n\n            public IBaseData WorkingData { get; set; }\n\n            public Type InputType => typeof(BaseData);\n\n            public Type OutputType => typeof(BaseData);\n\n            public event DataConsolidatedHandler DataConsolidated;\n\n            public void Dispose()\n            {\n            }\n\n            public void Scan(DateTime currentLocalTime)\n            {\n            }\n\n            public void Update(IBaseData data)\n            {\n            }\n\n            public void Consolidate(BaseData dataPoint)\n            {\n                Consolidated = dataPoint;\n                DataConsolidated?.Invoke(this, dataPoint);\n            }\n\n            public void Reset()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Custom/PythonCustomDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\n\nnamespace QuantConnect.Tests.Common.Data.Custom\n{\n    [TestFixture]\n    public class PythonCustomDataTests\n    {\n        [Test]\n        public void IsSparseDataDefaultValue()\n        {\n            dynamic instance;\n            using (Py.GIL())\n            {\n                PyObject test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def Pepe(self):\n        return 1\").GetAttr(\"Test\");\n                instance = test.CreateType().GetBaseDataInstance();\n                instance.Symbol = Symbol.CreateBase(typeof(decimal), Symbols.SPY, QuantConnect.Market.USA);\n            }\n\n            Assert.IsTrue(instance.IsSparseData());\n        }\n\n        [TestCase(\"True\", true)]\n        [TestCase(\"False\", false)]\n        public void OverridesIsSparseData(string value, bool booleanValue)\n        {\n            dynamic instance;\n            using (Py.GIL())\n            {\n                PyObject test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def IsSparseData(self):\n        return \" + $\"{value}\").GetAttr(\"Test\");\n                instance = test.CreateType().GetBaseDataInstance();\n            }\n\n            Assert.AreEqual(booleanValue, instance.IsSparseData());\n        }\n\n        [Test]\n        public void OverridesDefaultResolution()\n        {\n            dynamic instance;\n            using (Py.GIL())\n            {\n                PyObject test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def DefaultResolution(self):\n        return Resolution.Tick\").GetAttr(\"Test\");\n                instance = test.CreateType().GetBaseDataInstance();\n            }\n\n            Assert.AreEqual(Resolution.Tick, instance.DefaultResolution());\n        }\n\n        [Test]\n        public void OverridesSupportedResolutions()\n        {\n            dynamic instance;\n            using (Py.GIL())\n            {\n                PyObject test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def SupportedResolutions(self):\n        return [ Resolution.Tick, Resolution.Daily ]\").GetAttr(\"Test\");\n                instance = test.CreateType().GetBaseDataInstance();\n            }\n\n            var res = instance.SupportedResolutions();\n            Assert.AreEqual(new List<Resolution> { Resolution.Tick, Resolution.Daily }, res);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/DataQueueHandlerSubscriptionManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class DataQueueHandlerSubscriptionManagerTests\n    {\n        private DataQueueHandlerSubscriptionManager _subscriptionManager;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _subscriptionManager = new FakeDataQueuehandlerSubscriptionManager((t) => \"quote-trade\");\n        }\n\n        [Test]\n        public void SubscribeSingleSingleChannel()\n        {\n            _subscriptionManager.Subscribe(GetSubscriptionDataConfig<TradeBar>(Symbols.AAPL, Resolution.Minute));\n\n            Assert.NotZero(_subscriptionManager.GetSubscribedSymbols().Count());\n            Assert.Contains(Symbols.AAPL, _subscriptionManager.GetSubscribedSymbols().ToArray());\n        }\n\n        [Test]\n        public void SubscribeManySingleChannel()\n        {\n            for (int i = 0; i < 10; i++)\n            {\n                _subscriptionManager.Subscribe(GetSubscriptionDataConfig<TradeBar>(Symbols.AAPL, Resolution.Minute));\n                Assert.Contains(Symbols.AAPL, _subscriptionManager.GetSubscribedSymbols().ToList());\n                Assert.IsTrue(_subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n                Assert.IsTrue(_subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Trade));\n            }\n\n            for (int i = 9; i >= 0; i--)\n            {\n                _subscriptionManager.Unsubscribe(GetSubscriptionDataConfig<QuoteBar>(Symbols.AAPL, Resolution.Minute));\n\n                Assert.AreEqual(i > 0, _subscriptionManager.GetSubscribedSymbols().Count() == 1);\n                Assert.AreEqual(i > 0, _subscriptionManager.GetSubscribedSymbols().Contains(Symbols.AAPL));\n                Assert.AreEqual(i > 0, _subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n            }\n        }\n\n\n        [TestCase(typeof(TradeBar), TickType.Trade)]\n        [TestCase(typeof(QuoteBar), TickType.Quote)]\n        [TestCase(typeof(OpenInterest), TickType.OpenInterest)]\n        public void SubscribeSinglePerChannel(Type type, TickType tickType)\n        {\n            using var subscriptionManager = new FakeDataQueuehandlerSubscriptionManager((t) => t.ToString());\n\n            subscriptionManager.Subscribe(GetSubscriptionDataConfig(type, Symbols.AAPL, Resolution.Minute));\n\n            Assert.AreEqual(1, subscriptionManager.GetSubscribedSymbols().Count());\n            Assert.Contains(Symbols.AAPL, subscriptionManager.GetSubscribedSymbols().ToArray());\n\n            foreach (var value in Enum.GetValues(typeof(TickType)))\n            {\n                Assert.AreEqual(tickType == (TickType)value, subscriptionManager.IsSubscribed(Symbols.AAPL, (TickType)value));\n            }\n        }\n\n        [Test]\n        public void SubscribeManyPerChannel()\n        {\n            using var subscriptionManager = new FakeDataQueuehandlerSubscriptionManager((t) => t.ToString());\n\n            for (int i = 0; i < 5; i++)\n            {\n                subscriptionManager.Subscribe(GetSubscriptionDataConfig<TradeBar>(Symbols.AAPL, Resolution.Minute));\n            }\n\n            Assert.IsTrue(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Trade));\n            Assert.IsFalse(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n\n            subscriptionManager.Subscribe(GetSubscriptionDataConfig<QuoteBar>(Symbols.AAPL, Resolution.Minute));\n\n            Assert.IsTrue(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Trade));\n            Assert.IsTrue(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n\n            for (int i = 0; i < 5; i++)\n            {\n                subscriptionManager.Unsubscribe(GetSubscriptionDataConfig<TradeBar>(Symbols.AAPL, Resolution.Minute));\n            }\n\n            Assert.IsFalse(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Trade));\n            Assert.IsTrue(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n\n            subscriptionManager.Unsubscribe(GetSubscriptionDataConfig<QuoteBar>(Symbols.AAPL, Resolution.Minute));\n\n            Assert.IsFalse(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Trade));\n            Assert.IsFalse(subscriptionManager.IsSubscribed(Symbols.AAPL, TickType.Quote));\n        }\n\n        [TestCase(TickType.Trade, MarketDataType.TradeBar, 1)]\n        [TestCase(TickType.Trade, MarketDataType.QuoteBar, 0)]\n        [TestCase(TickType.Quote, MarketDataType.QuoteBar, 1)]\n        [TestCase(TickType.OpenInterest, MarketDataType.Tick, 1)]\n        [TestCase(TickType.OpenInterest, MarketDataType.TradeBar, 0)]\n        public void GetSubscribeSymbolsBySpecificTickType(TickType tickType, MarketDataType dataType, int expectedCount)\n        {\n            using var fakeDataQueueHandler = new FakeDataQueuehandlerSubscriptionManager((tickType) => tickType!.ToString());\n\n            switch (dataType)\n            {\n                case MarketDataType.TradeBar:\n                    fakeDataQueueHandler.Subscribe(GetSubscriptionDataConfig<TradeBar>(Symbols.AAPL, Resolution.Minute));\n                    break;\n                case MarketDataType.QuoteBar:\n                    fakeDataQueueHandler.Subscribe(GetSubscriptionDataConfig<QuoteBar>(Symbols.AAPL, Resolution.Minute));\n                    break;\n                case MarketDataType.Tick:\n                    fakeDataQueueHandler.Subscribe(GetSubscriptionDataConfig<OpenInterest>(Symbols.AAPL, Resolution.Minute));\n                    break;\n            }\n\n            var subscribeSymbols = fakeDataQueueHandler.GetSubscribedSymbols(tickType).ToList();\n\n            Assert.That(subscribeSymbols.Count, Is.EqualTo(expectedCount));\n        }\n\n        #region helper\n\n        private SubscriptionDataConfig GetSubscriptionDataConfig(Type T, Symbol symbol, Resolution resolution, TickType? tickType = null)\n        {\n            return new SubscriptionDataConfig(\n                T,\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false,\n                tickType: tickType);\n        }\n\n        protected SubscriptionDataConfig GetSubscriptionDataConfig<T>(Symbol symbol, Resolution resolution)\n        {\n            return new SubscriptionDataConfig(\n                typeof(T),\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/DividendYieldProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class DividendYieldProviderTests\n    {\n        // Without a price:\n        [TestCase(\"19700306\", null, 0.0)]           // Date in before the first date in file\n        [TestCase(\"20191107\", null, 0.0118177)]     // Dividend on this date\n        [TestCase(\"20191108\", null, 0.0118177)]     // Same dividend yield is fill-forwarded for every day until next dividend\n        [TestCase(\"20200205\", null, 0.0118177)]\n        [TestCase(\"20200206\", null, 0.0118177)]\n        [TestCase(\"20200207\", null, 0.0094708)]     // Dividend on this date\n        [TestCase(\"20200208\", null, 0.0094708)]\n        [TestCase(\"20210203\", null, 0.0067840)]\n        [TestCase(\"20210204\", null, 0.0067840)]\n        [TestCase(\"20210205\", null, 0.0059684)]     // Dividend on this date\n        [TestCase(\"20210208\", null, 0.0059684)]\n        [TestCase(\"20210209\", null, 0.0059684)]\n        [TestCase(\"20491231\", null, 0.0059684)]     // Date in far future, assuming same rate\n        // With price:\n        [TestCase(\"19700306\", 1.0, 0.0)]            // Date in before the first date in file\n        [TestCase(\"20191107\", 257.24, 0.0118177)]   // Dividend on this date\n        [TestCase(\"20191108\", 259.43, 0.0117179)]\n        [TestCase(\"20200205\", 318.85, 0.0095342)]\n        [TestCase(\"20200206\", 321.45, 0.0094571)]\n        [TestCase(\"20200207\", 325.21, 0.0094708)]   // Dividend on this date\n        [TestCase(\"20200210\", 320.03, 0.0096240)]\n        [TestCase(\"20210203\", 134.99, 0.0059819)]\n        [TestCase(\"20210204\", 133.94, 0.0060288)]\n        [TestCase(\"20210205\", 137.39, 0.0059684)]   // Dividend on this date\n        [TestCase(\"20210208\", 136.76, 0.0059959)]\n        [TestCase(\"20210209\", 136.91, 0.0059893)]   // Date in far future, assuming same rate\n        public void GetDividendYieldRate(string dateString, double? price, double expected)\n        {\n            var symbol = Symbols.AAPL;\n            var provider = new DividendYieldProvider(symbol);\n            var dateTime = Parse.DateTimeExact(dateString, \"yyyyMMdd\");\n            var result = price.HasValue\n                ? provider.GetDividendYield(dateTime, Convert.ToDecimal(price.Value))\n                : provider.GetDividendYield(dateTime);\n\n            Assert.AreEqual(expected, (double)result, 1e-7);\n        }\n\n        [TestCase(\"19700101\", 0.0)]   // Date before Time.Start\n        [TestCase(\"20200101\", 0.0)]\n        [TestCase(\"20500101\", 0.0)]   // Date in far future\n        public void GetDividendYieldWithoutFactorFile(string dateString, decimal expected)\n        {\n            var symbol = Symbols.EURUSD;\n            var provider = new DividendYieldProvider(symbol);\n            var dateTime = Parse.DateTimeExact(dateString, \"yyyyMMdd\");\n            var result = provider.GetDividendYield(dateTime);\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void CacheIsCleared()\n        {\n            var symbol = Symbols.AAPL;\n            using var fileProviderTest = new DividendYieldProviderTest(symbol);\n\n            fileProviderTest.GetDividendYield(new DateTime(2020, 1, 1));\n            var fetchCount = fileProviderTest.FetchCount;\n            Thread.Sleep(1);\n            fileProviderTest.GetDividendYield(new DateTime(2020, 1, 1));\n            Assert.AreEqual(fetchCount, fileProviderTest.FetchCount);\n\n            var counter = 0;\n            while (counter++ < 10)\n            {\n                fileProviderTest.GetDividendYield(new DateTime(2020, 1, 1));\n                if (fileProviderTest.FetchCount <= fetchCount)\n                {\n                    Thread.Sleep(250);\n                }\n                else\n                {\n                    break;\n                }\n            }\n            Assert.Less(counter, 10);\n        }\n\n        [Test]\n        public void AnotherSymbolCall()\n        {\n            using var fileProviderTest = new DividendYieldProviderTest(Symbol.Create(\"TEST_A\", SecurityType.Equity, QuantConnect.Market.USA));\n\n            var applYield = fileProviderTest.GetDividendYield(new DateTime(2020, 1, 1));\n            Assert.AreEqual(1, fileProviderTest.FetchCount);\n\n            using var fileProviderTest2 = new DividendYieldProviderTest(Symbol.Create(\"TEST_B\", SecurityType.Equity, QuantConnect.Market.USA));\n\n            var spyYield = fileProviderTest2.GetDividendYield(new DateTime(2020, 1, 1));\n            Assert.AreEqual(1, fileProviderTest2.FetchCount);\n        }\n\n        private class DividendYieldProviderTest : DividendYieldProvider, IDisposable\n        {\n            public int FetchCount { get; set; }\n\n            protected override TimeSpan CacheRefreshPeriod => TimeSpan.FromSeconds(1);\n\n            public DividendYieldProviderTest(Symbol symbol)\n                : base(symbol)\n            {\n            }\n\n            protected override List<BaseData> LoadCorporateEvents(Symbol symbol)\n            {\n                FetchCount++;\n                return base.LoadCorporateEvents(symbol);\n            }\n\n            public void Reset()\n            {\n                try\n                {\n                    // stop the refresh task\n                    var task = DividendYieldProvider._cacheClearTask;\n                    DividendYieldProvider._cacheClearTask = null;\n                    task.Dispose();\n                }\n                catch\n                {\n                }\n            }\n\n            public void Dispose()\n            {\n                Reset();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/DollarVolumeRenkoConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Common.Data.Consolidators;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class DollarVolumeRenkoConsolidatorTests : BaseConsolidatorTests\n    {\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new DollarVolumeRenkoConsolidator(10m);\n        }\n\n        [Test]\n        public void OutputTypeIsVolumeRenkoBar()\n        {\n            using var consolidator = new DollarVolumeRenkoConsolidator(10);\n            Assert.AreEqual(typeof(VolumeRenkoBar), consolidator.OutputType);\n        }\n\n        [Test]\n        public void ConsolidatesOnTickDollarVolumeReached()\n        {\n            VolumeRenkoBar bar = null;\n            using var consolidator = new DollarVolumeRenkoConsolidator(100m); // $100 bar size\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var startTime = new DateTime(2023, 1, 1);\n\n            // Price: $10, Quantity: 7 -> $70 dollar volume\n            consolidator.Update(new Tick(startTime, Symbols.AAPL, \"\", \"\", 7m, 10m));\n            Assert.IsNull(bar);\n\n            // Price: $3, Quantity: 20 -> $60 dollar volume (total $110)\n            consolidator.Update(new Tick(startTime.AddHours(1), Symbols.AAPL, \"\", \"\", 20m, 3m));\n            Assert.IsNotNull(bar);\n\n            // Verify bar properties\n            Assert.AreEqual(10m, bar.Open);\n            Assert.AreEqual(10m, bar.High);\n            Assert.AreEqual(3m, bar.Low);\n            Assert.AreEqual(3m, bar.Close);\n            Assert.AreEqual(100m, bar.Volume);\n            Assert.AreEqual(100m, bar.BrickSize);\n            Assert.AreEqual(Symbols.AAPL, bar.Symbol);\n            Assert.AreEqual(startTime, bar.Start);\n            Assert.AreEqual(startTime.AddHours(1), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void ConsolidatesOnTradeBarDollarVolumeReached()\n        {\n            VolumeRenkoBar bar = null;\n            using var consolidator = new DollarVolumeRenkoConsolidator(200m); // $200 bar size\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var startTime = new DateTime(2023, 1, 1);\n\n            // Close: $11   Volume: 10 -> Dollar volume: $100\n            consolidator.Update(new TradeBar(startTime, Symbols.AAPL, 10m, 12m, 9m, 11m, 10m, TimeSpan.FromHours(1)));\n            Assert.IsNull(bar);\n\n            // Close: $21   Volume: 6 -> Dollar volume: $126 (total $226)\n            consolidator.Update(new TradeBar(startTime.AddHours(1), Symbols.AAPL, 20m, 22m, 18m, 21m, 6m, TimeSpan.FromHours(1)));\n            Assert.IsNotNull(bar);\n\n            // Verify bar properties\n            Assert.AreEqual(10m, bar.Open);\n            Assert.AreEqual(22m, bar.High);\n            Assert.AreEqual(9m, bar.Low);\n            Assert.AreEqual(21m, bar.Close);\n            Assert.AreEqual(200m, bar.Volume);\n            Assert.AreEqual(200m, bar.BrickSize);\n            Assert.AreEqual(Symbols.AAPL, bar.Symbol);\n            Assert.AreEqual(startTime, bar.Start);\n            Assert.AreEqual(startTime.AddHours(2), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void HandlesMultipleConsolidations()\n        {\n            var consolidatedBars = new List<VolumeRenkoBar>();\n            using var consolidator = new DollarVolumeRenkoConsolidator(100m);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                consolidatedBars.Add(consolidated);\n            };\n\n            var startTime = new DateTime(2023, 1, 1);\n\n            // First bar: $50 + $60 = $110\n            consolidator.Update(new Tick(startTime, Symbols.AAPL, \"\", \"\", 10m, 5m));\n            consolidator.Update(new Tick(startTime.AddHours(1), Symbols.AAPL, \"\", \"\", 20m, 3m));\n\n            // Second bar: $80 + $30 = $110 (total $220)\n            consolidator.Update(new Tick(startTime.AddHours(2), Symbols.AAPL, \"\", \"\", 20m, 4m));\n            consolidator.Update(new Tick(startTime.AddHours(3), Symbols.AAPL, \"\", \"\", 20m, 1.5m));\n\n            Assert.AreEqual(2, consolidatedBars.Count);\n\n            // Verify first bar\n            Assert.AreEqual(5m, consolidatedBars[0].Open);\n            Assert.AreEqual(3m, consolidatedBars[0].Close);\n            Assert.AreEqual(100m, consolidatedBars[0].Volume);\n            Assert.IsTrue(consolidatedBars[0].IsClosed);\n\n            // Verify second bar\n            Assert.AreEqual(3m, consolidatedBars[1].Open);\n            Assert.AreEqual(1.5m, consolidatedBars[1].Close);\n            Assert.AreEqual(100m, consolidatedBars[1].Volume);\n            Assert.IsTrue(consolidatedBars[1].IsClosed);\n        }\n\n        [Test]\n        public void ThrowsOnNonTradeData()\n        {\n            using var consolidator = new DollarVolumeRenkoConsolidator(100m);\n            var startTime = new DateTime(2023, 1, 1);\n\n            Assert.Throws<ArgumentException>(() =>\n                consolidator.Update(new QuoteBar(\n                    startTime,\n                    Symbols.AAPL,\n                    new Bar(1m, 1m, 1m, 1m),\n                    1m,\n                    new Bar(1m, 1m, 1m, 1m),\n                    1m,\n                    TimeSpan.FromHours(1)\n                ))\n            );\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2023, 1, 1);\n            return new List<Tick>()\n            {\n                new Tick(time, Symbols.AAPL, \"\", \"\", 10m, 5m),   // $50\n                new Tick(time.AddSeconds(1), Symbols.AAPL, \"\", \"\", 12m, 4m),  // $48\n                new Tick(time.AddSeconds(2), Symbols.AAPL, \"\", \"\", 15m, 2m),  // $30\n                new Tick(time.AddSeconds(3), Symbols.AAPL, \"\", \"\", 14m, 3m),   // $42\n                new Tick(time.AddSeconds(4), Symbols.AAPL, \"\", \"\", 16m, 5m),  // $80\n                new Tick(time.AddSeconds(5), Symbols.AAPL, \"\", \"\", 18m, 3m),   // $54\n                new Tick(time.AddSeconds(6), Symbols.AAPL, \"\", \"\", 17m, 4m),  // $68\n                new Tick(time.AddSeconds(7), Symbols.AAPL, \"\", \"\", 19m, 2m),   // $38\n                new Tick(time.AddSeconds(8), Symbols.AAPL, \"\", \"\", 20m, 6m),  // $120\n                new Tick(time.AddSeconds(9), Symbols.AAPL, \"\", \"\", 22m, 3m),   // $66\n                new Tick(time.AddSeconds(10), Symbols.AAPL, \"\", \"\", 21m, 4m), // $84\n                new Tick(time.AddSeconds(11), Symbols.AAPL, \"\", \"\", 23m, 5m), // $115\n                new Tick(time.AddSeconds(12), Symbols.AAPL, \"\", \"\", 25m, 2m)   // $50\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/DynamicDataConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class DynamicDataConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void AggregatesTimeValuePairsWithOutVolumeProperly()\n        {\n            TradeBar newTradeBar = null;\n            using var consolidator = new DynamicDataConsolidator(4);\n            consolidator.DataConsolidated += (sender, tradeBar) =>\n            {\n                newTradeBar = tradeBar;\n            };\n            var reference = DateTime.Today;\n            var bar1 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                Value = 5\n            };\n            consolidator.Update(bar1);\n            Assert.IsNull(newTradeBar);\n\n            var bar2 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                Value = 10\n            };\n            consolidator.Update(bar2);\n            Assert.IsNull(newTradeBar);\n            var bar3 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(2),\n                Value = 1\n            };\n            consolidator.Update(bar3);\n            Assert.IsNull(newTradeBar);\n\n            var bar4 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(3),\n                Value = 9\n            };\n            consolidator.Update(bar4);\n            Assert.IsNotNull(newTradeBar);\n\n            Assert.AreEqual(Symbols.SPY, newTradeBar.Symbol);\n            Assert.AreEqual(bar1.Time, newTradeBar.Time);\n            Assert.AreEqual(bar1.Value, newTradeBar.Open);\n            Assert.AreEqual(bar2.Value, newTradeBar.High);\n            Assert.AreEqual(bar3.Value, newTradeBar.Low);\n            Assert.AreEqual(bar4.Value, newTradeBar.Close);\n            Assert.AreEqual(0, newTradeBar.Volume);\n            Assert.AreEqual(bar4.EndTime, newTradeBar.EndTime);\n        }\n\n        [Test]\n        public void AggregatesTimeValuePairsWithVolumeProperly()\n        {\n            TradeBar newTradeBar = null;\n            using var consolidator = new DynamicDataConsolidator(4);\n            consolidator.DataConsolidated += (sender, tradeBar) =>\n            {\n                newTradeBar = tradeBar;\n            };\n            var reference = DateTime.Today;\n            dynamic bar1 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                Value = 5,\n            };\n            bar1.Volume = 75L;\n\n            consolidator.Update(bar1);\n            Assert.IsNull(newTradeBar);\n\n            dynamic bar2 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                Value = 10\n            };\n            bar2.Volume = 100L;\n\n            consolidator.Update(bar2);\n            Assert.IsNull(newTradeBar);\n            dynamic bar3 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(2),\n                Value = 1\n            };\n            bar3.Volume = 115L;\n\n            consolidator.Update(bar3);\n            Assert.IsNull(newTradeBar);\n\n            dynamic bar4 = new CustomData\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(3),\n                Value = 9\n            };\n            bar4.Volume = 85L;\n\n            consolidator.Update(bar4);\n            Assert.IsNotNull(newTradeBar);\n\n            Assert.AreEqual(Symbols.SPY, newTradeBar.Symbol);\n            Assert.AreEqual(bar1.Time, newTradeBar.Time);\n            Assert.AreEqual(bar1.Value, newTradeBar.Open);\n            Assert.AreEqual(bar2.Value, newTradeBar.High);\n            Assert.AreEqual(bar3.Value, newTradeBar.Low);\n            Assert.AreEqual(bar4.Value, newTradeBar.Close);\n            Assert.AreEqual(bar1.Volume + bar2.Volume + bar3.Volume + bar4.Volume, newTradeBar.Volume);\n        }\n\n        [Test]\n        public void AggregatesTradeBarsWithVolumeProperly()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new DynamicDataConsolidator(3);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = DateTime.Today;\n            dynamic bar1 = new CustomData();\n            bar1.Symbol = Symbols.SPY;\n            bar1.Time = reference;\n            bar1.Open = 10;\n            bar1.High = 100m;\n            bar1.Low = 1m;\n            bar1.Close = 50m;\n            bar1.Volume = 75L;\n\n            dynamic bar2 = new CustomData();\n            bar2.Symbol = Symbols.SPY;\n            bar2.Time = reference.AddHours(1);\n            bar2.Open = 50m;\n            bar2.High = 123m;\n            bar2.Low = 35m;\n            bar2.Close = 75m;\n            bar2.Volume = 100L;\n\n            dynamic bar3 = new CustomData();\n            bar3.Symbol = Symbols.SPY;\n            bar3.Time = reference.AddHours(1);\n            bar3.Open = 75m;\n            bar3.High = 100m;\n            bar3.Low = 50m;\n            bar3.Close = 83m;\n            bar3.Volume = 125L;\n\n            consolidator.Update(bar1);\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(bar2);\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(bar3);\n\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(Symbols.SPY, consolidated.Symbol);\n            Assert.AreEqual(bar1.Open, consolidated.Open);\n            Assert.AreEqual(Math.Max(bar1.High, Math.Max(bar2.High, bar3.High)), consolidated.High);\n            Assert.AreEqual(Math.Min(bar1.Low, Math.Min(bar2.Low, bar3.Low)), consolidated.Low);\n            Assert.AreEqual(bar3.Close, consolidated.Close);\n            Assert.AreEqual(bar1.Volume + bar2.Volume + bar3.Volume, consolidated.Volume);\n        }\n\n        [Test]\n        public void AggregatesTradeBarsWithOutVolumeProperly()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new DynamicDataConsolidator(3);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = DateTime.Today;\n            dynamic bar1 = new CustomData();\n            bar1.Symbol = Symbols.SPY;\n            bar1.Time = reference;\n            bar1.Open = 10;\n            bar1.High = 100m;\n            bar1.Low = 1m;\n            bar1.Close = 50m;\n\n            dynamic bar2 = new CustomData();\n            bar2.Symbol = Symbols.SPY;\n            bar2.Time = reference.AddHours(1);\n            bar2.Open = 50m;\n            bar2.High = 123m;\n            bar2.Low = 35m;\n            bar2.Close = 75m;\n\n            dynamic bar3 = new CustomData();\n            bar3.Symbol = Symbols.SPY;\n            bar3.Time = reference.AddHours(1);\n            bar3.Open = 75m;\n            bar3.High = 100m;\n            bar3.Low = 50m;\n            bar3.Close = 83m;\n\n            consolidator.Update(bar1);\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(bar2);\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(bar3);\n\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(Symbols.SPY, consolidated.Symbol);\n            Assert.AreEqual(bar1.Open, consolidated.Open);\n            Assert.AreEqual(Math.Max(bar1.High, Math.Max(bar2.High, bar3.High)), consolidated.High);\n            Assert.AreEqual(Math.Min(bar1.Low, Math.Min(bar2.Low, bar3.Low)), consolidated.Low);\n            Assert.AreEqual(bar3.Close, consolidated.Close);\n            Assert.AreEqual(0, consolidated.Volume);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var reference = DateTime.Today;\n            dynamic bar1 = new CustomData();\n            bar1.Symbol = Symbols.SPY;\n            bar1.Time = reference;\n            bar1.Open = 10;\n            bar1.High = 100m;\n            bar1.Low = 1m;\n            bar1.Close = 50m;\n\n            dynamic bar2 = new CustomData();\n            bar2.Symbol = Symbols.SPY;\n            bar2.Time = reference.AddHours(1);\n            bar2.Open = 50m;\n            bar2.High = 123m;\n            bar2.Low = 35m;\n            bar2.Close = 75m;\n\n            dynamic bar3 = new CustomData();\n            bar3.Symbol = Symbols.SPY;\n            bar3.Time = reference.AddHours(2);\n            bar3.Open = 75m;\n            bar3.High = 100m;\n            bar3.Low = 50m;\n            bar3.Close = 83m;\n\n            return new List<CustomData>()\n            {\n                bar1,\n                bar2,\n                bar3,\n                bar1,\n                bar3,\n                bar2,\n                bar1,\n                bar1,\n                bar3,\n                bar1\n            };\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new DynamicDataConsolidator(3);\n        }\n\n        private class CustomData : DynamicData\n        {\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/DynamicDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class DynamicDataTests\n    {\n        [Test]\n        public void SupportsSnakeNameRetrival()\n        {\n            dynamic data = new DataType();\n            data.PropertyA = 1;\n\n            Assert.AreEqual(1, data.property_a);\n            Assert.AreEqual(data.PropertyA, data.property_a);\n        }\n\n        [Test]\n        public void StoresValues_Using_LowerCaseKeys()\n        {\n            dynamic data = new DataType();\n            data.Property = 1;\n\n            Assert.AreEqual(1, data.Property);\n            Assert.AreEqual(data.Property, data.property);\n        }\n\n        [Test]\n        public void StoresBaseDataValues_Using_BaseDataProperties()\n        {\n            var value = 1234.567890m;\n            var time = new DateTime(2000, 1, 2, 3, 4, 5, 6);\n            var symbol = Symbol.Create(\"ticker\", SecurityType.Base, QuantConnect.Market.USA, baseDataType: typeof(DataType));\n            dynamic data = new DataType();\n            data.Time = time;\n            data.Value = value;\n            data.Symbol = symbol;\n\n            BaseData baseData = data;\n            Assert.AreEqual(time, baseData.Time);\n            Assert.AreEqual(time, baseData.EndTime);\n            Assert.AreEqual(value, baseData.Value);\n            Assert.AreEqual(value, baseData.Price);\n            Assert.AreEqual(symbol, baseData.Symbol);\n\n            // let's access the properties through the dynamic handling\n            Assert.AreEqual(time, data.Time);\n            Assert.AreEqual(time, data.EndTime);\n            Assert.AreEqual(value, data.Value);\n            Assert.AreEqual(value, data.Price);\n            Assert.AreEqual(symbol, data.Symbol);\n        }\n\n        [Test]\n        public void AccessingPropertyThatDoesNotExist_ThrowsKeyNotFoundException()\n        {\n            dynamic data = new DataType();\n            Assert.Throws<KeyNotFoundException>(() =>\n            {\n                var _ = data.UndefinedPropertyName;\n            });\n        }\n\n        private class DataType : DynamicData\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/FakeDataQueuehandlerSubscriptionManager.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    public class FakeDataQueuehandlerSubscriptionManager : DataQueueHandlerSubscriptionManager\n    {\n        private Func<TickType, string> _getChannelName;\n\n        public FakeDataQueuehandlerSubscriptionManager(Func<TickType, string> getChannelName)\n        {\n            _getChannelName = getChannelName;\n        }\n\n        protected override bool Subscribe(IEnumerable<Symbol> symbols, TickType tickType) => true;\n\n        protected override bool Unsubscribe(IEnumerable<Symbol> symbols, TickType tickType) => true;\n\n        protected override string ChannelNameFromTickType(TickType tickType) => _getChannelName(tickType);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/BaseFundamentalDataProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    [TestFixture]\n    public class BaseFundamentalDataProviderTests\n    {\n        [Test]\n        public void NoValueNull()\n        {\n            Assert.IsTrue(BaseFundamentalDataProvider.IsNone(null));\n            Assert.IsTrue(BaseFundamentalDataProvider.IsNone(null, null));\n        }\n\n        [Test]\n        public void NoValueDouble()\n        {\n            var noValue = BaseFundamentalDataProvider.GetDefault<double>();\n\n            Assert.AreEqual(double.NaN, noValue);\n            Assert.IsTrue(BaseFundamentalDataProvider.IsNone(noValue));\n        }\n\n        [Test]\n        public void NoValueDecimal()\n        {\n            var noValue = BaseFundamentalDataProvider.GetDefault<decimal>();\n\n            Assert.AreEqual(0, noValue);\n            Assert.IsTrue(BaseFundamentalDataProvider.IsNone(noValue));\n        }\n\n        [Test]\n        public void DatetimeNoTz()\n        {\n            var noValue = BaseFundamentalDataProvider.GetDefault<DateTime>();\n\n            Assert.AreEqual(DateTime.MinValue, noValue);\n            Assert.AreEqual(DateTimeKind.Unspecified, noValue.Kind);\n            Assert.IsTrue(BaseFundamentalDataProvider.IsNone(noValue));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/FundamentalTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    [TestFixture]\n    public class FundamentalTests\n    {\n        [SetUp]\n        public void Setup()\n        {\n            FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProvider(), false);\n        }\n\n        [Test]\n        public void ComputesMarketCapCorrectly()\n        {\n            var fine = new QuantConnect.Data.Fundamental.Fundamental(new DateTime(2014, 04, 01), Symbols.AAPL);\n\n            Assert.AreEqual(541.74m, fine.Price);\n            Assert.AreEqual(469400291359, fine.MarketCap);\n        }\n\n        [Test]\n        public void ZeroMarketCapForDefaultObject()\n        {\n            var fine = new QuantConnect.Data.Fundamental.Fundamental();\n\n            Assert.AreEqual(0, fine.Price);\n            Assert.AreEqual(0, fine.MarketCap);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/FundamentalUniverseSelectionModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    [TestFixture]\n    public class FundamentalUniverseSelectionModelTests\n    {\n        [Test]\n        public void PythonAlgorithmUsingCSharpSelection()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"FundamentalUniverseSelectionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"3\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"-3.123%\"},\n                    {\"Drawdown\", \"0.100%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"-0.122%\"},\n                    {\"Sharpe Ratio\", \"-5.568\"},\n                    {\"Probabilistic Sharpe Ratio\", \"11.594%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"-0.022\"},\n                    {\"Beta\", \"0.048\"},\n                    {\"Annual Standard Deviation\", \"0.006\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"1.712\"},\n                    {\"Tracking Error\", \"0.093\"},\n                    {\"Treynor Ratio\", \"-0.636\"},\n                    {\"Total Fees\", \"$3.00\"},\n                    {\"Estimated Strategy Capacity\", \"$2300000000.00\"},\n                    {\"Lowest Capacity Asset\", \"IBM R735QTJ8XC9X\"},\n                    {\"Portfolio Turnover\", \"0.42%\"},\n                    {\"OrderListHash\", \"9bd2017fdcf8f503e86dfa3bf6e33520\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/MultiPeriodFieldTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    [TestFixture]\n    public class MultiPeriodFieldTests\n    {\n        private TestMultiPeriodField _field;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _field = new TestMultiPeriodField();\n            _field.ThreeMonths = 1;\n            _field.OneYear = 5;\n            _field.FiveYears = 2;\n        }\n\n        [Test]\n        public void ReturnsDefaultPeriod()\n        {\n            Assert.IsTrue(_field.HasValue);\n\n            Assert.AreEqual(5, (decimal)_field);\n            Assert.AreEqual(5, _field.Value);\n        }\n\n        [Test]\n        public void ReturnsRequestedPeriodWithDataAvailable()\n        {\n            Assert.IsTrue(_field.HasPeriodValue(\"3M\"));\n\n            Assert.AreEqual(1, _field.GetPeriodValue(\"3M\"));\n            Assert.AreEqual(1, _field.ThreeMonths);\n        }\n\n        [Test]\n        public void ReturnsRequestedPeriodWithNoData()\n        {\n            Assert.IsFalse(_field.HasPeriodValue(\"3Y\"));\n\n            Assert.AreEqual(MultiPeriodField.NoValue, _field.GetPeriodValue(\"3Y\"));\n            Assert.AreEqual(MultiPeriodField.NoValue, _field.ThreeYears);\n        }\n\n        [Test]\n        public void ReturnsCorrectPeriodNamesAndValues()\n        {\n            Assert.AreEqual(new[] { \"1Y\", \"3M\", \"5Y\" }, _field.GetPeriodNames());\n\n            Assert.AreEqual(new[] { \"1Y\", \"3M\", \"5Y\" }, _field.GetPeriodValues().Keys);\n\n            Assert.AreEqual(new[] { 5, 1, 2 }, _field.GetPeriodValues().Values);\n        }\n\n        [Test]\n        public void ReturnsFirstPeriodIfNoDefaultAvailable()\n        {\n            var field = new TestMultiPeriodField();\n            field.ThreeMonths = 1;\n            field.FiveYears = 2;\n\n            Assert.IsFalse(field.HasValue);\n\n            Assert.AreEqual(1, (decimal)field);\n            Assert.AreEqual(1, field.Value);\n        }\n\n        [Test]\n        public void EmptyStore()\n        {\n            using var field = new TestMultiPeriodField();\n            Assert.IsFalse(field.HasValue);\n            Assert.AreEqual(MultiPeriodField.NoValue, field.Value);\n            Assert.AreEqual(MultiPeriodField.NoValue, field.FiveYears);\n            Assert.AreEqual(MultiPeriodField.NoValue, field.OneYear);\n            Assert.AreEqual(Enumerable.Empty<string>(), field.GetPeriodNames());\n            Assert.AreEqual(MultiPeriodField.NoValue, field.GetPeriodValue(QuantConnect.Data.Fundamental.Period.OneYear));\n            Assert.AreEqual(MultiPeriodField.NoValue, field.GetPeriodValue(QuantConnect.Data.Fundamental.Period.TenYears));\n            Assert.AreEqual(0, field.GetPeriodValues().Count);\n            Assert.IsFalse(field.HasPeriodValue(QuantConnect.Data.Fundamental.Period.OneYear));\n            Assert.IsFalse(field.HasPeriodValue(QuantConnect.Data.Fundamental.Period.TenYears));\n        }\n\n        [Test]\n        public void EmptyStoreToString()\n        {\n            using var field = new TestMultiPeriodField();\n            Assert.AreEqual(\"\", field.ToString());\n        }\n\n        private class TestMultiPeriodField : MultiPeriodField\n        {\n            protected override string DefaultPeriod => \"OneYear\";\n\n            public double ThreeMonths { get; set; } = NoValue;\n            public double OneYear { get; set; } = NoValue;\n            public double ThreeYears { get; set; } = NoValue;\n            public double FiveYears { get; set; } = NoValue;\n            public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), OneYear);\n            public override double Value\n            {\n                get\n                {\n                    var defaultValue = OneYear;\n                    if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))\n                    {\n                        return defaultValue;\n                    }\n                    return base.Value;\n                }\n            }\n\n            public override double GetPeriodValue(string period)\n            {\n                switch(period)\n                {\n                    case QuantConnect.Data.Fundamental.Period.ThreeMonths:\n                        return ThreeMonths;\n                    case QuantConnect.Data.Fundamental.Period.OneYear:\n                        return OneYear;\n                    case QuantConnect.Data.Fundamental.Period.ThreeYears:\n                        return ThreeYears;\n                    case QuantConnect.Data.Fundamental.Period.FiveYears:\n                        return FiveYears;\n                    default:\n                        return NoValue;\n                }\n            }\n\n            public override IReadOnlyDictionary<string, double> GetPeriodValues()\n            {\n                var result = new Dictionary<string, double>();\n                foreach (var kvp in new[] { new Tuple<string, double>(\"1Y\", OneYear), new Tuple<string, double>(\"3M\", ThreeMonths), new Tuple<string, double>(\"3Y\", ThreeYears), new Tuple<string, double>(\"5Y\", FiveYears) })\n                {\n                    if (!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))\n                    {\n                        result[kvp.Item1] = kvp.Item2;\n                    }\n                }\n                return result;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/NullFundamentalDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    public class NullFundamentalDataProvider : IFundamentalDataProvider\n    {\n        public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name) => BaseFundamentalDataProvider.GetDefault<T>();\n        public void Initialize(IDataProvider dataProvider, bool liveMode)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Fundamental/TestFundamentalDataProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.Tests.Common.Data.Fundamental\n{\n    public class TestFundamentalDataProvider : IFundamentalDataProvider\n    {\n        private readonly CoarseFundamentalDataProvider _coarseFundamentalData = new();\n\n        private readonly Dictionary<string, double> _pERatio = new()\n        {\n            { \"AAPL R735QTJ8XC9X\", 13.012856d },\n            { \"IBM R735QTJ8XC9X\", 12.394244d },\n            { \"AIG R735QTJ8XC9X\", 8.185855d },\n        };\n\n        private readonly Dictionary<string, string> _industryTemplateCode = new()\n        {\n            { \"AAPL R735QTJ8XC9X\", \"N\" },\n            { \"IBM R735QTJ8XC9X\", \"N\" },\n            { \"GOOG T1AZ164W5VTX\", \"N\" },\n            { \"GOOCV VP83T1ZUHROL\", \"N\" },\n            { \"NB R735QTJ8XC9X\", \"B\" },\n            { \"AIG R735QTJ8XC9X\", \"I\" },\n        };\n\n        private readonly Dictionary<string, double> _equityPerShareGrowthOneYear = new()\n        {\n            { \"AAPL R735QTJ8XC9X\", 0.091652d },\n            { \"IBM R735QTJ8XC9X\", 0.280664d },\n            { \"GOOCV VP83T1ZUHROL\", 0.196226d },\n            { \"NB R735QTJ8XC9X\", 0.022944d },\n        };\n\n        private readonly Dictionary<string, long> _marketCap = new()\n        {\n            { \"AIG R735QTJ8XC9X\", 72866646492 },\n            { \"AAPL R735QTJ8XC9X\", 469400291359 },\n            { \"IBM R735QTJ8XC9X\", 192825068158 },\n            { \"GOOCV VP83T1ZUHROL\", 375779584963 },\n            { \"NB R735QTJ8XC9X\", 181116782342 },\n        };\n\n        private readonly Dictionary<string, long> _sharesOutstanding = new()\n        {\n            { \"SPY R735QTJ8XC9X\", 1331000000 },\n            { \"AAPL R735QTJ8XC9X\", 22337000000000 },\n        };\n\n        public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n        {\n            if (securityIdentifier == SecurityIdentifier.Empty)\n            {\n                return default;\n            }\n\n            var enumName = Enum.GetName(name);\n            switch (enumName)\n            {\n                case nameof(CoarseFundamental.Price):\n                case nameof(CoarseFundamental.Value):\n                case nameof(CoarseFundamental.Market):\n                case nameof(CoarseFundamental.Volume):\n                case nameof(CoarseFundamental.PriceFactor):\n                case nameof(CoarseFundamental.SplitFactor):\n                case nameof(CoarseFundamental.DollarVolume):\n                    return _coarseFundamentalData.Get<T>(time, securityIdentifier, name);\n                default:\n                    return Get(time, securityIdentifier, enumName);\n            }\n        }\n\n        private dynamic Get(DateTime time, SecurityIdentifier securityIdentifier, string name)\n        {\n            switch (name)\n            {\n                case nameof(CoarseFundamental.HasFundamentalData):\n                    return true;\n                case \"CompanyProfile_MarketCap\":\n                    if(_marketCap.TryGetValue(securityIdentifier.ToString(), out var marketCap))\n                    {\n                        return marketCap;\n                    }\n                    return 0L;\n                case \"CompanyProfile_HeadquarterCity\":\n                    if (securityIdentifier.Symbol == \"AAPL\")\n                    {\n                        return \"Cupertino\";\n                    }\n                    return string.Empty;\n                case \"CompanyProfile_SharesOutstanding\":\n                    if (_sharesOutstanding.TryGetValue(securityIdentifier.ToString(), out var sharesOutstanding))\n                    {\n                        return sharesOutstanding;\n                    }\n                    return 0L;\n                case \"CompanyReference_IndustryTemplateCode\":\n                    if(_industryTemplateCode.TryGetValue(securityIdentifier.ToString(), out var  industryTemplateCode))\n                    {\n                        return industryTemplateCode;\n                    }\n                    return string.Empty;\n                case \"EarningRatios_EquityPerShareGrowth_OneYear\":\n                    if(_equityPerShareGrowthOneYear.TryGetValue(securityIdentifier.ToString(), out var ePSG))\n                    {\n                        return ePSG;\n                    }\n                    return 0d;\n                case \"ValuationRatios_PERatio\":\n                    if (_pERatio.TryGetValue(securityIdentifier.ToString(), out var peRatio))\n                    {\n                        return peRatio;\n                    }\n                    return 0d;\n            }\n            return null;\n        }\n\n        public void Initialize(IDataProvider dataProvider, bool liveMode)\n        {\n            _coarseFundamentalData.Initialize(dataProvider, liveMode);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/IdentityDataConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class IdentityDataConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void ThrowsOnDataOfWrongType()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var identity = new IdentityDataConsolidator<Tick>();\n                identity.Update(new TradeBar());\n            });\n        }\n\n        [Test]\n        public void ReturnsTheSameObjectReference()\n        {\n            using var identity = new IdentityDataConsolidator<Tick>();\n\n            var tick = new Tick();\n\n            int count = 0;\n            identity.DataConsolidated += (sender, data) =>\n            {\n                Assert.IsTrue(ReferenceEquals(tick, data));\n                count++;\n            };\n\n            identity.Update(tick);\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void IgnoresNonTickDataWithSameTimestamps()\n        {\n            var reference = new DateTime(2015, 09, 23);\n            using var identity = new IdentityDataConsolidator<TradeBar>();\n\n            int count = 0;\n            identity.DataConsolidated += (sender, data) =>\n            {\n                count++;\n            };\n            \n            var tradeBar = new TradeBar{EndTime = reference};\n            identity.Update(tradeBar);\n\n            tradeBar = (TradeBar) tradeBar.Clone();\n            identity.Update(tradeBar);\n\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void AcceptsTickDataWithSameTimestamps()\n        {\n            var reference = new DateTime(2015, 09, 23);\n            using var identity = new IdentityDataConsolidator<Tick>();\n\n            int count = 0;\n            identity.DataConsolidated += (sender, data) =>\n            {\n                count++;\n            };\n\n            var tradeBar = new Tick { EndTime = reference };\n            identity.Update(tradeBar);\n\n            tradeBar = (Tick)tradeBar.Clone();\n            identity.Update(tradeBar);\n\n            Assert.AreEqual(2, count);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new IdentityDataConsolidator<IndicatorDataPoint>();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/InterestRateProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class InterestRateProviderTests\n    {\n        [Test]\n        public void Create()\n        {\n            const string csvLine = \"2020-01-01,2.5\";\n            const decimal expectedInterestRateValue = 0.025m;\n            var expectedInterestRateDate = new DateTime(2020, 1, 1);\n\n            if (!InterestRateProvider.TryParse(csvLine, out var date, out var interestRate))\n            {\n                Assert.Fail(\"Could not convert the line into interest rate data\");\n            }\n\n            Assert.AreEqual(expectedInterestRateDate, date);\n            Assert.AreEqual(expectedInterestRateValue, interestRate);\n        }\n\n        [TestCase(\"alternative/interest-rate/usa/interest-rate.csv\", true)]\n        [TestCase(\"non-existing.csv\", false)]\n        public void FromCsvFile(string dir, bool getResults)\n        {\n            var filePath = Path.Combine(Globals.DataFolder, dir);\n            var result = InterestRateProvider.FromCsvFile(filePath, out _);\n\n            if (getResults)\n            {\n                Assert.GreaterOrEqual(result.Count, 30);\n            }\n            else\n            {\n                Assert.IsEmpty(result);\n            }\n        }\n\n        [TestCase(\"19700306\", 0.0225)]   // Date in before the first date in file\n        [TestCase(\"20200306\", 0.0175)]\n        [TestCase(\"20200307\", 0.0175)]\n        [TestCase(\"20200308\", 0.0175)]\n        [TestCase(\"20200310\", 0.0175)]\n        [TestCase(\"20501231\", 0.055)]   // Date in far future\n        public void GetInterestRate(string dateString, decimal expected)\n        {\n            var provider = new InterestRateProvider();\n            var dateTime = Parse.DateTimeExact(dateString, \"yyyyMMdd\");\n            var result = provider.GetInterestRate(dateTime);\n\n            Assert.AreEqual(expected, result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Market/BarTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Market\n{\n    [TestFixture]\n    public class BarTests\n    {\n        [Test]\n        public void UpdatesProperly()\n        {\n            var bar = new Bar();\n            bar.Update(10);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n\n            bar.Update(20);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(20, bar.Close);\n\n            bar.Update(5);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(5, bar.Low);\n            Assert.AreEqual(5, bar.Close);\n\n            bar.Update(11);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(5, bar.Low);\n            Assert.AreEqual(11, bar.Close);\n        }\n\n        [Test]\n        public void DoesNotHandleAssetsWithZeroPrice()\n        {\n            var bar = new Bar();\n            bar.Update(10);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n\n            // no update performed\n            bar.Update(0);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n\n            bar.Update(-5);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(-5, bar.Close);\n            \n            bar.Update(5);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(5, bar.Close);\n            \n            bar.Update(50);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(50, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(50, bar.Close);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Data/Market/FuturesContractTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Market\n{\n    [TestFixture]\n    public class FuturesContractTests\n    {\n        [TestCase(true, true)]\n        [TestCase(true, false)]\n        [TestCase(false, true)]\n        [TestCase(false, false)]\n        public void QuoteBarNullBidAsk(bool hasBid, bool hasAsk)\n        {\n            var futureContract = new FuturesContract(Symbols.Future_CLF19_Jan2019);\n\n            Bar bid = hasBid ? new Bar(1, 1, 1, 1) : null;\n            Bar ask = hasAsk ? new Bar(2, 2, 2, 2) : null;\n            var quoteBar = new QuoteBar(new DateTime(2025, 12, 10), Symbols.Future_CLF19_Jan2019, bid, 10, ask, 20);\n            futureContract.Update(quoteBar);\n            Assert.AreEqual(hasBid ? bid.Close : 0, futureContract.BidPrice);\n            Assert.AreEqual(hasAsk ? ask.Close : 0, futureContract.AskPrice);\n            Assert.AreEqual(hasAsk ? 20 : 0, futureContract.AskSize);\n            Assert.AreEqual(hasBid ? 10 : 0, futureContract.BidSize);\n            Assert.AreEqual(0, futureContract.Volume);\n            Assert.AreEqual(0, futureContract.LastPrice);\n            Assert.AreEqual(0, futureContract.OpenInterest);\n        }\n\n        [Test]\n        public void QuoteTickUpdate()\n        {\n            var futureContract = new FuturesContract(Symbols.Future_CLF19_Jan2019);\n\n            var tick = new Tick(new DateTime(2025, 12, 10), Symbols.Future_CLF19_Jan2019, 1, 2, 3, 4);\n            futureContract.Update(tick);\n            Assert.AreEqual(1, futureContract.BidSize);\n            Assert.AreEqual(2, futureContract.BidPrice);\n            Assert.AreEqual(3, futureContract.AskSize);\n            Assert.AreEqual(4, futureContract.AskPrice);\n            Assert.AreEqual(0, futureContract.Volume);\n            Assert.AreEqual(0, futureContract.LastPrice);\n            Assert.AreEqual(0, futureContract.OpenInterest);\n        }\n\n        [Test]\n        public void TradeTickUpdate()\n        {\n            var futureContract = new FuturesContract(Symbols.Future_CLF19_Jan2019);\n\n            var tick = new Tick(new DateTime(2025, 12, 10), Symbols.Future_CLF19_Jan2019, string.Empty, Exchange.UNKNOWN, 1, 2);\n            futureContract.Update(tick);\n            Assert.AreEqual(1, futureContract.Volume);\n            Assert.AreEqual(2, futureContract.LastPrice);\n            Assert.AreEqual(0, futureContract.BidSize);\n            Assert.AreEqual(0, futureContract.BidPrice);\n            Assert.AreEqual(0, futureContract.AskSize);\n            Assert.AreEqual(0, futureContract.AskPrice);\n            Assert.AreEqual(0, futureContract.OpenInterest);\n        }\n\n        [Test]\n        public void TradeBarUpdate()\n        {\n            var futureContract = new FuturesContract(Symbols.Future_CLF19_Jan2019);\n\n            var tick = new TradeBar(new DateTime(2025, 12, 10), Symbols.Future_CLF19_Jan2019, 1, 2, 3, 4, 5);\n            futureContract.Update(tick);\n            Assert.AreEqual(5, futureContract.Volume);\n            Assert.AreEqual(4, futureContract.LastPrice);\n            Assert.AreEqual(0, futureContract.BidSize);\n            Assert.AreEqual(0, futureContract.BidPrice);\n            Assert.AreEqual(0, futureContract.AskSize);\n            Assert.AreEqual(0, futureContract.AskPrice);\n            Assert.AreEqual(0, futureContract.OpenInterest);\n        }\n\n        [Test]\n        public void OpenInterest()\n        {\n            var futureContract = new FuturesContract(Symbols.Future_CLF19_Jan2019);\n            var tick = new OpenInterest(new DateTime(2025, 12, 10), Symbols.Future_CLF19_Jan2019, 10);\n            futureContract.Update(tick);\n            Assert.AreEqual(10, futureContract.OpenInterest);\n            Assert.AreEqual(0, futureContract.Volume);\n            Assert.AreEqual(0, futureContract.LastPrice);\n            Assert.AreEqual(0, futureContract.BidSize);\n            Assert.AreEqual(0, futureContract.BidPrice);\n            Assert.AreEqual(0, futureContract.AskSize);\n            Assert.AreEqual(0, futureContract.AskPrice);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Market/QuoteBarTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Market\n{\n    [TestFixture]\n    public class QuoteBarTests\n    {\n        private QuoteBar _quoteBar;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _quoteBar = new QuoteBar();\n        }\n\n        [Test]\n        public void DoesntGenerateCorruptedPricesIfBidOrAskAreMissing()\n        {\n            var bar = new QuoteBar();\n            bar.UpdateAsk(10, 15);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n\n            bar = new QuoteBar();\n            bar.Ask = new Bar(11,11,11,11);\n            Assert.AreEqual(11, bar.Open);\n            Assert.AreEqual(11, bar.High);\n            Assert.AreEqual(11, bar.Low);\n            Assert.AreEqual(11, bar.Close);\n        }\n\n        [Test]\n        public void QuoteBarReader_CanParseMalformattedData_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            // Neither a quote or a trade\n            var line = \"14340000,1.10907,1.109075,1.108985,1.1090214400000,1.109005,1.109005,1.10884,1.10887\";\n            var date = DateTime.MaxValue;\n            var isLiveMode = false;\n\n            var quoteBar = new QuoteBar();\n            var parsedQuoteBar = (QuoteBar)quoteBar.Reader(config, line, date, isLiveMode);\n\n            Assert.AreEqual(parsedQuoteBar.Symbol, Symbols.SPY);\n\n            Assert.AreEqual(parsedQuoteBar.Ask.Open, 0);\n            Assert.AreEqual(parsedQuoteBar.Ask.High, 0);\n            Assert.AreEqual(parsedQuoteBar.Ask.Low, 0);\n            Assert.AreEqual(parsedQuoteBar.Ask.Close, 0);\n\n            Assert.AreEqual(parsedQuoteBar.Bid.Open, 0);\n            Assert.AreEqual(parsedQuoteBar.Bid.High, 0);\n            Assert.AreEqual(parsedQuoteBar.Bid.Low, 0);\n            Assert.AreEqual(parsedQuoteBar.Bid.Close, 0);\n        }\n\n        [Test]\n        public void QuoteBarReader_CanParseQuoteBar_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            // Neither a quote or a trade\n            var line = \"14340000,11090,11090,11089,11090,100,11090,11088,11088,11090,10000\";\n            var date = DateTime.MaxValue;\n            var isLiveMode = false;\n\n            var quoteBar = new QuoteBar();\n            var parsedQuoteBar = (QuoteBar)quoteBar.Reader(config, line, date, isLiveMode);\n\n            Assert.AreEqual(parsedQuoteBar.Symbol, Symbols.SPY);\n\n            Assert.AreEqual(parsedQuoteBar.Bid.Open, 1.1090);\n            Assert.AreEqual(parsedQuoteBar.Bid.High, 1.1090);\n            Assert.AreEqual(parsedQuoteBar.Bid.Low, 1.1089);\n            Assert.AreEqual(parsedQuoteBar.Bid.Close, 1.1090);\n\n            Assert.AreEqual(parsedQuoteBar.Ask.Open, 1.10900);\n            Assert.AreEqual(parsedQuoteBar.Ask.High, 1.1088);\n            Assert.AreEqual(parsedQuoteBar.Ask.Low, 1.1088);\n            Assert.AreEqual(parsedQuoteBar.Ask.Close, 1.1090);\n        }\n\n        [Test]\n        public void QuoteBar_CanParseEquity_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(QuoteBar), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            var line = \"14340000,10000,20000,30000,40000,0,50000,60000,70000,80000,1\";\n\n            var quoteBar = _quoteBar.ParseEquity(config, line, DateTime.MinValue);\n\n            Assert.AreEqual(quoteBar.Bid.Open, 1m);\n            Assert.AreEqual(quoteBar.Bid.High, 2m);\n            Assert.AreEqual(quoteBar.Bid.Low, 3m);\n            Assert.AreEqual(quoteBar.Bid.Close, 4m);\n            Assert.AreEqual(quoteBar.LastBidSize, 0m);\n\n            Assert.AreEqual(quoteBar.Ask.Open, 5m);\n            Assert.AreEqual(quoteBar.Ask.High, 6m);\n            Assert.AreEqual(quoteBar.Ask.Low, 7m);\n            Assert.AreEqual(quoteBar.Ask.Close, 8m);\n            Assert.AreEqual(quoteBar.LastAskSize, 1m);\n        }\n\n        [Test]\n        public void QuoteBar_CanParseForex_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(QuoteBar), Symbols.EURUSD, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            var line = \"14340000,1,2,3,4,0,5,6,7,8,1\";\n\n            var quoteBar = _quoteBar.ParseForex(config, line, DateTime.MinValue);\n\n            Assert.AreEqual(quoteBar.Bid.Open, 1m);\n            Assert.AreEqual(quoteBar.Bid.High, 2m);\n            Assert.AreEqual(quoteBar.Bid.Low, 3m);\n            Assert.AreEqual(quoteBar.Bid.Close, 4m);\n            Assert.AreEqual(quoteBar.LastBidSize, 0m);\n\n            Assert.AreEqual(quoteBar.Ask.Open, 5m);\n            Assert.AreEqual(quoteBar.Ask.High, 6m);\n            Assert.AreEqual(quoteBar.Ask.Low, 7m);\n            Assert.AreEqual(quoteBar.Ask.Close, 8m);\n            Assert.AreEqual(quoteBar.LastAskSize, 1m);\n        }\n\n        [Test]\n        public void QuoteBar_CanParseCfd_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(QuoteBar), Symbols.DE10YBEUR, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            var line = \"14340000,1,2,3,4,0,5,6,7,8,1\";\n\n            var quoteBar = _quoteBar.ParseCfd(config, line, DateTime.MinValue);\n\n            Assert.AreEqual(quoteBar.Bid.Open, 1m);\n            Assert.AreEqual(quoteBar.Bid.High, 2m);\n            Assert.AreEqual(quoteBar.Bid.Low, 3m);\n            Assert.AreEqual(quoteBar.Bid.Close, 4m);\n            Assert.AreEqual(quoteBar.LastBidSize, 0m);\n\n            Assert.AreEqual(quoteBar.Ask.Open, 5m);\n            Assert.AreEqual(quoteBar.Ask.High, 6m);\n            Assert.AreEqual(quoteBar.Ask.Low, 7m);\n            Assert.AreEqual(quoteBar.Ask.Close, 8m);\n            Assert.AreEqual(quoteBar.LastAskSize, 1m);\n        }\n\n        [Test]\n        public void QuoteBar_CanParseOption_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(QuoteBar), Symbols.SPY_C_192_Feb19_2016, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            var line = \"14340000,10000,20000,30000,40000,0,50000,60000,70000,80000,1\";\n\n            var quoteBar = _quoteBar.ParseOption(config, line, DateTime.MinValue);\n\n            Assert.AreEqual(quoteBar.Bid.Open, 1m);\n            Assert.AreEqual(quoteBar.Bid.High, 2m);\n            Assert.AreEqual(quoteBar.Bid.Low, 3m);\n            Assert.AreEqual(quoteBar.Bid.Close, 4m);\n            Assert.AreEqual(quoteBar.LastBidSize, 0m);\n\n            Assert.AreEqual(quoteBar.Ask.Open, 5m);\n            Assert.AreEqual(quoteBar.Ask.High, 6m);\n            Assert.AreEqual(quoteBar.Ask.Low, 7m);\n            Assert.AreEqual(quoteBar.Ask.Close, 8m);\n            Assert.AreEqual(quoteBar.LastAskSize, 1m);\n        }\n\n        [Test]\n        public void QuoteBar_CanParseFuture_Successfully()\n        {\n            var config = new SubscriptionDataConfig(typeof(QuoteBar), Symbols.Fut_SPY_Feb19_2016, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            var line = \"14340000,1,2,3,4,0,5,6,7,8,1\";\n\n            var quoteBar = _quoteBar.ParseFuture(config, line, DateTime.MinValue);\n\n            Assert.AreEqual(quoteBar.Bid.Open, 1m);\n            Assert.AreEqual(quoteBar.Bid.High, 2m);\n            Assert.AreEqual(quoteBar.Bid.Low, 3m);\n            Assert.AreEqual(quoteBar.Bid.Close, 4m);\n            Assert.AreEqual(quoteBar.LastBidSize, 0m);\n\n            Assert.AreEqual(quoteBar.Ask.Open, 5m);\n            Assert.AreEqual(quoteBar.Ask.High, 6m);\n            Assert.AreEqual(quoteBar.Ask.Low, 7m);\n            Assert.AreEqual(quoteBar.Ask.Close, 8m);\n            Assert.AreEqual(quoteBar.LastAskSize, 1m);\n        }\n\n        [Test]\n        public void QuoteBarParseScalesOptionsWithEquityUnderlying()\n        {\n            var factory = new QuoteBar();\n            var underlying = Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA);\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(QuoteBar),\n                optionSymbol,\n                Resolution.Minute,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Quote,\n                true,\n                DataNormalizationMode.Raw);\n\n            var quoteLine = \"40560000,10000,15000,10000,15000,90,10000,15000,10000,15000,100\";\n            using var stream = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(quoteLine)));\n\n            var quoteBarFromLine = (QuoteBar)factory.Reader(config, quoteLine, new DateTime(2020, 9, 22), false);\n            var quoteBarFromStream = (QuoteBar)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), quoteBarFromLine.EndTime);\n            Assert.AreEqual(optionSymbol, quoteBarFromLine.Symbol);\n            Assert.AreEqual(1m, quoteBarFromLine.Bid.Open);\n            Assert.AreEqual(1.5m, quoteBarFromLine.Bid.High);\n            Assert.AreEqual(1m, quoteBarFromLine.Bid.Low);\n            Assert.AreEqual(1.5m, quoteBarFromLine.Bid.Close);\n            Assert.AreEqual(90m, quoteBarFromLine.LastBidSize);\n            Assert.AreEqual(1m, quoteBarFromLine.Ask.Open);\n            Assert.AreEqual(1.5m, quoteBarFromLine.Ask.High);\n            Assert.AreEqual(1m, quoteBarFromLine.Ask.Low);\n            Assert.AreEqual(1.5m, quoteBarFromLine.Ask.Close);\n            Assert.AreEqual(100m, quoteBarFromLine.LastAskSize);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), quoteBarFromStream.EndTime);\n            Assert.AreEqual(optionSymbol, quoteBarFromStream.Symbol);\n            Assert.AreEqual(1m, quoteBarFromStream.Bid.Open);\n            Assert.AreEqual(1.5m, quoteBarFromStream.Bid.High);\n            Assert.AreEqual(1m, quoteBarFromStream.Bid.Low);\n            Assert.AreEqual(1.5m, quoteBarFromStream.Bid.Close);\n            Assert.AreEqual(90m, quoteBarFromStream.LastBidSize);\n            Assert.AreEqual(1m, quoteBarFromStream.Ask.Open);\n            Assert.AreEqual(1.5m, quoteBarFromStream.Ask.High);\n            Assert.AreEqual(1m, quoteBarFromStream.Ask.Low);\n            Assert.AreEqual(1.5m, quoteBarFromStream.Ask.Close);\n            Assert.AreEqual(100m, quoteBarFromStream.LastAskSize);\n        }\n\n        [Test]\n        public void QuoteBarParseDoesNotScaleOptionsWithNonEquityUnderlying()\n        {\n            var factory = new QuoteBar();\n            var underlying = Symbol.CreateFuture(\"ES\", QuantConnect.Market.CME, new DateTime(2021, 3, 19));\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(QuoteBar),\n                optionSymbol,\n                Resolution.Minute,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Quote,\n                true,\n                DataNormalizationMode.Raw);\n\n            var quoteLine = \"40560000,1.0,1.5,1.0,1.5,90.0,1.0,1.5,1.0,1.5,100.0\";\n            using var stream = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(quoteLine)));\n\n            var unscaledQuoteBarFromLine = (QuoteBar)factory.Reader(config, quoteLine, new DateTime(2020, 9, 22), false);\n            var unscaledQuoteBarFromStream = (QuoteBar)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), unscaledQuoteBarFromLine.EndTime);\n            Assert.AreEqual(optionSymbol, unscaledQuoteBarFromLine.Symbol);\n            Assert.AreEqual(1m, unscaledQuoteBarFromLine.Bid.Open);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromLine.Bid.High);\n            Assert.AreEqual(1m, unscaledQuoteBarFromLine.Bid.Low);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromLine.Bid.Close);\n            Assert.AreEqual(90m, unscaledQuoteBarFromLine.LastBidSize);\n            Assert.AreEqual(1m, unscaledQuoteBarFromLine.Ask.Open);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromLine.Ask.High);\n            Assert.AreEqual(1m, unscaledQuoteBarFromLine.Ask.Low);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromLine.Ask.Close);\n            Assert.AreEqual(100m, unscaledQuoteBarFromLine.LastAskSize);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), unscaledQuoteBarFromStream.EndTime);\n            Assert.AreEqual(optionSymbol, unscaledQuoteBarFromStream.Symbol);\n            Assert.AreEqual(1m, unscaledQuoteBarFromStream.Bid.Open);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromStream.Bid.High);\n            Assert.AreEqual(1m, unscaledQuoteBarFromStream.Bid.Low);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromStream.Bid.Close);\n            Assert.AreEqual(90m, unscaledQuoteBarFromStream.LastBidSize);\n            Assert.AreEqual(1m, unscaledQuoteBarFromStream.Ask.Open);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromStream.Ask.High);\n            Assert.AreEqual(1m, unscaledQuoteBarFromStream.Ask.Low);\n            Assert.AreEqual(1.5m, unscaledQuoteBarFromStream.Ask.Close);\n            Assert.AreEqual(100m, unscaledQuoteBarFromStream.LastAskSize);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Market/TickTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Market\n{\n    [TestFixture]\n    public class TickTests\n    {\n        [Test]\n        public void ConstructsFromLine()\n        {\n            const string line = \"15093000,1456300,100,P,T,0\";\n\n            var baseDate = new DateTime(2013, 10, 08);\n            var tick = new Tick(Symbols.SPY, line, baseDate);\n\n            var ms = (tick.Time - baseDate).TotalMilliseconds;\n            Assert.AreEqual(15093000, ms);\n            Assert.AreEqual(1456300, tick.LastPrice * 10000m);\n            Assert.AreEqual(100, tick.Quantity);\n            Assert.AreEqual(\"P\", tick.ExchangeCode);\n            Assert.AreEqual(\"ARCA\", tick.Exchange);\n            Assert.AreEqual(\"T\", tick.SaleCondition);\n            Assert.AreEqual(false, tick.Suspicious);\n        }\n\n        [TestCase(\"18000677.3,3669.12,0.0040077,3669.13,3.40618718\", \"18000677.3\", \"3669.12\", \"0.0040077\", \"3669.13\", \"3.40618718\")]\n        [TestCase(\"18000677.3111,3669.12,0.0040077,3669.13,3.40618718\", \"18000677.3111\", \"3669.12\", \"0.0040077\", \"3669.13\", \"3.40618718\")]\n        public void ConstructsFromLineWithDecimalTimestamp(string line, string milliseconds, string bidPrice,\n            string bidSize, string askPrice, string askSize)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(Tick), Symbols.BTCUSD, Resolution.Tick, TimeZones.Utc, TimeZones.Utc,\n                false, false, false, false, TickType.Quote);\n            var baseDate = new DateTime(2019, 1, 15);\n\n            var tick = new Tick(config, line, baseDate);\n\n            var ms = (tick.Time - baseDate).TotalMilliseconds;\n            Assert.AreEqual( decimal.Parse(milliseconds, CultureInfo.InvariantCulture), ms);\n            Assert.AreEqual(decimal.Parse(bidPrice, CultureInfo.InvariantCulture), tick.BidPrice);\n            Assert.AreEqual(decimal.Parse(bidSize, CultureInfo.InvariantCulture), tick.BidSize);\n            Assert.AreEqual(decimal.Parse(askPrice, CultureInfo.InvariantCulture), tick.AskPrice);\n            Assert.AreEqual(decimal.Parse(askSize, CultureInfo.InvariantCulture), tick.AskSize);\n        }\n\n        [Test]\n        public void ReadsFuturesTickFromLine()\n        {\n            const string line = \"86399572,52.62,5,usa,,0,False\";\n\n            var baseDate = new DateTime(2013, 10, 08);\n            var symbol = Symbol.CreateFuture(Futures.Energy.CrudeOilWTI, QuantConnect.Market.NYMEX, new DateTime(2017, 2, 28));\n            var config = new SubscriptionDataConfig(typeof(Tick), symbol, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            var tick = new Tick(config, line, baseDate);\n\n            var ms = (tick.Time - baseDate).TotalMilliseconds;\n            Assert.AreEqual(86399572, ms);\n            Assert.AreEqual(52.62, tick.LastPrice);\n            Assert.AreEqual(5, tick.Quantity);\n            Assert.AreEqual(\"\", tick.Exchange);\n            Assert.AreEqual(\"\", tick.SaleCondition);\n            Assert.AreEqual(false, tick.Suspicious);\n        }\n\n        [TestCase(SecurityType.Crypto, TickType.Trade, \"1234567,18000,0.0001,0\")]\n        [TestCase(SecurityType.Crypto, TickType.Quote, \"1234567,18000,10,18100,15,0\")]\n        [TestCase(SecurityType.CryptoFuture, TickType.Trade, \"1234567,18000,0.0001,0\")]\n        [TestCase(SecurityType.CryptoFuture, TickType.Quote, \"1234567,18000,10,18100,15,0\")]\n        public void ReadsCryptoAndCryptoFuturesTickFromLine(SecurityType securityType, TickType tickType, string line)\n        {\n            var baseDate = new DateTime(2013, 10, 08);\n            var symbol = Symbol.Create(\"BTCUSDT\", securityType, QuantConnect.Market.Binance);\n            var config = new SubscriptionDataConfig(typeof(Tick), symbol, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, false, false, false,\n                tickType: tickType);\n            var tick = new Tick(config, line, baseDate);\n\n            var ms = (tick.Time - baseDate).TotalMilliseconds;\n            Assert.AreEqual(1234567d, ms);\n            Assert.AreEqual(\"\", tick.Exchange);\n            Assert.AreEqual(\"\", tick.SaleCondition);\n            Assert.AreEqual(false, tick.Suspicious);\n\n            if (tickType == TickType.Trade)\n            {\n                Assert.AreEqual(18000m, tick.Value);\n                Assert.AreEqual(0.0001m, tick.Quantity);\n                Assert.AreEqual(\"\", tick.Exchange);\n                Assert.AreEqual(\"\", tick.SaleCondition);\n                Assert.AreEqual(false, tick.Suspicious);\n            }\n            else\n            {\n                Assert.AreEqual((18000m + 18100m) / 2m, tick.Value);\n                Assert.AreEqual(18000m, tick.BidPrice);\n                Assert.AreEqual(10m, tick.BidSize);\n                Assert.AreEqual(18100m, tick.AskPrice);\n                Assert.AreEqual(15m, tick.AskSize);\n            }\n        }\n\n        [TestCase(\"14400135,0,0,1680000,400,NASDAQ,00000001,0\", 0, 0, 168, 400)]\n        [TestCase(\"14400135,10000,10,0,0,NASDAQ,00000001,0\", 1, 10, 0, 0)]\n        [TestCase(\"14400135,10000,10,20000,20,NASDAQ,00000001,0\", 1, 10, 2, 20)]\n        public void EquityQuoteTick(string line, decimal bidPrice, decimal bidSize, decimal askPrice, decimal askSize)\n        {\n            var baseDate = new DateTime(2013, 10, 08);\n            var config = new SubscriptionDataConfig(typeof(Tick),\n                Symbols.SPY,\n                Resolution.Tick,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false,\n                false,\n                TickType.Quote);\n            var tick = new Tick(config, line, baseDate);\n\n            var expectedValue = (askPrice + bidPrice) / 2;\n            if (askPrice == 0 || bidPrice == 0)\n            {\n                expectedValue = askPrice + bidPrice;\n            }\n\n            var ms = (tick.Time - baseDate).TotalMilliseconds;\n            Assert.AreEqual(14400135, ms);\n            Assert.AreEqual(expectedValue, tick.Value);\n            Assert.AreEqual(expectedValue, tick.LastPrice);\n            Assert.AreEqual(0, tick.Quantity);\n            Assert.AreEqual(askPrice, tick.AskPrice);\n            Assert.AreEqual(askSize, tick.AskSize);\n            Assert.AreEqual(bidPrice, tick.BidPrice);\n            Assert.AreEqual(bidSize, tick.BidSize);\n            Assert.AreEqual(\"NASDAQ\", tick.Exchange);\n            Assert.AreEqual(\"00000001\", tick.SaleCondition);\n            Assert.IsFalse(tick.Suspicious);\n        }\n\n        [Test]\n        public void OptionWithUnderlyingEquityScaled()\n        {\n            var factory = new Tick();\n            var tickLine = \"40560000,10000,10,NYSE,00000001,0\";\n            var underlying = Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA);\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.USA,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(Tick),\n                optionSymbol,\n                Resolution.Tick,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                true,\n                DataNormalizationMode.Raw);\n\n            using var stream = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(tickLine)));\n\n            var tickFromLine = (Tick)factory.Reader(config, tickLine, new DateTime(2020, 9, 22), false);\n            var tickFromStream = (Tick)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 16, 0), tickFromLine.Time);\n            Assert.AreEqual(1m, tickFromLine.Price);\n            Assert.AreEqual(10, tickFromLine.Quantity);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 16, 0), tickFromStream.Time);\n            Assert.AreEqual(1m, tickFromStream.Price);\n            Assert.AreEqual(10, tickFromStream.Quantity);\n        }\n\n        [Test]\n        public void OptionWithUnderlyingFutureNotScaled()\n        {\n            var factory = new Tick();\n            var tickLine = \"40560000,10000,10,CME,00000001,0\";\n            var underlying = Symbol.CreateFuture(\"ES\", QuantConnect.Market.CME, new DateTime(2021, 3, 19));\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(Tick),\n                optionSymbol,\n                Resolution.Tick,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                true,\n                DataNormalizationMode.Raw);\n\n            using var stream = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(tickLine)));\n\n            var tickFromLine = (Tick)factory.Reader(config, tickLine, new DateTime(2020, 9, 22), false);\n            var tickFromStream = (Tick)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 16, 0), tickFromLine.Time);\n            Assert.AreEqual(10000m, tickFromLine.Price);\n            Assert.AreEqual(10, tickFromLine.Quantity);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 16, 0), tickFromStream.Time);\n            Assert.AreEqual(10000m, tickFromStream.Price);\n            Assert.AreEqual(10, tickFromStream.Quantity);\n        }\n\n        [Test]\n        public void ExchangeSetterHandlesNonExpectedEncoding()\n        {\n            const string line = \"15093000,1456300,100,P,T,0\";\n\n            var baseDate = new DateTime(2013, 10, 08);\n            var tick = new Tick(Symbols.SPY, line, baseDate);\n            Assert.DoesNotThrow(()=> tick.ExchangeCode = \"LL\");\n            Assert.AreEqual(Exchange.UNKNOWN, tick.Exchange.GetPrimaryExchange(), \"Failed at Exchange Property\");\n            Assert.AreEqual((string)Exchange.UNKNOWN, tick.ExchangeCode, \"Failed at ExchangeCode Property\");\n        }\n\n        [Test]\n        public void ExchangeSetterHandlesDefinedExchanges()\n        {\n            var baseDate = new DateTime(2013, 10, 08);\n            const string line = \"15093000,1456300,100,P,T,0\";\n\n            var exchanges = typeof(Exchange)\n                .GetProperties(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public)\n                .Where(p => p.PropertyType == typeof(Exchange))\n                .Select(propa => propa.GetValue(null))\n                .OfType<Exchange>()\n                .Where(exchange => exchange.Market == QuantConnect.Market.USA && exchange.SecurityTypes.Contains(SecurityType.Equity))\n                .ToList();\n\n            Assert.GreaterOrEqual(exchanges.Count, 20);\n\n            foreach (var exchange in exchanges)\n            {\n                {\n                    var tick = new Tick(Symbols.SPY, line, baseDate);\n                    Assert.DoesNotThrow(() => tick.ExchangeCode = exchange.Code);\n\n                    Assert.AreEqual(exchange.Name, tick.Exchange, $\"ExchangeCode: Failed at Exchange Property: {exchange}\");\n                    Assert.AreEqual(exchange.Code, tick.ExchangeCode, $\"ExchangeCode: Failed at ExchangeCode Property: {exchange}\");\n                }\n                {\n                    var tick = new Tick(Symbols.SPY, line, baseDate);\n                    Assert.DoesNotThrow(() => tick.Exchange = exchange);\n\n                    Assert.AreEqual(exchange.Name, tick.Exchange, $\"Exchange: Failed at Exchange Property: {exchange}\");\n                    Assert.AreEqual(exchange.Code, tick.ExchangeCode, $\"Exchange: Failed at ExchangeCode Property: {exchange}\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Market/TradeBarTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data.Market\n{\n    [TestFixture]\n    public class TradeBarTests\n    {\n        [Test]\n        public void UpdatesProperly()\n        {\n            var bar = new TradeBar();\n            bar.UpdateTrade(10, 10);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n            Assert.AreEqual(10, bar.Volume);\n\n            bar.UpdateTrade(20, 5);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(20, bar.Close);\n            Assert.AreEqual(15, bar.Volume);\n\n            bar.UpdateTrade(5, 50);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(5, bar.Low);\n            Assert.AreEqual(5, bar.Close);\n            Assert.AreEqual(65, bar.Volume);\n\n            bar.UpdateTrade(11, 100);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(20, bar.High);\n            Assert.AreEqual(5, bar.Low);\n            Assert.AreEqual(11, bar.Close);\n            Assert.AreEqual(165, bar.Volume);\n        }\n\n        [Test]\n        public void HandlesAssetWithValidZeroPrice()\n        {\n            var bar = new TradeBar();\n            bar.UpdateTrade(10, 10);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(10, bar.Low);\n            Assert.AreEqual(10, bar.Close);\n            Assert.AreEqual(10, bar.Volume);\n\n            bar.UpdateTrade(0, 100);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(0, bar.Low);\n            Assert.AreEqual(0, bar.Close);\n            Assert.AreEqual(110, bar.Volume);\n\n            bar.UpdateTrade(-5, 100);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(-5, bar.Close);\n            Assert.AreEqual(210, bar.Volume);\n\n            bar.UpdateTrade(5, 100);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(10, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(5, bar.Close);\n            Assert.AreEqual(310, bar.Volume);\n\n            bar.UpdateTrade(50, 100);\n            Assert.AreEqual(10, bar.Open);\n            Assert.AreEqual(50, bar.High);\n            Assert.AreEqual(-5, bar.Low);\n            Assert.AreEqual(50, bar.Close);\n            Assert.AreEqual(410, bar.Volume);\n        }\n\n        [Test]\n        public void TradeBarParseScalesOptionsWithEquityUnderlying()\n        {\n            var factory = new TradeBar();\n            var underlying = Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA);\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                optionSymbol,\n                Resolution.Minute,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                true,\n                DataNormalizationMode.Raw);\n\n            var tradeLine = \"40560000,10000,15000,10000,15000,90\";\n            using var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(tradeLine));\n            using var stream = new StreamReader(memoryStream);\n\n            var tradeBarFromLine = (TradeBar)factory.Reader(config, tradeLine, new DateTime(2020, 9, 22), false);\n            var tradeBarFromStream = (TradeBar)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), tradeBarFromLine.EndTime);\n            Assert.AreEqual(optionSymbol, tradeBarFromLine.Symbol);\n            Assert.AreEqual(1m, tradeBarFromLine.Open);\n            Assert.AreEqual(1.5m, tradeBarFromLine.High);\n            Assert.AreEqual(1m, tradeBarFromLine.Low);\n            Assert.AreEqual(1.5m, tradeBarFromLine.Close);\n            Assert.AreEqual(90m, tradeBarFromLine.Volume);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), tradeBarFromStream.EndTime);\n            Assert.AreEqual(optionSymbol, tradeBarFromStream.Symbol);\n            Assert.AreEqual(1m, tradeBarFromStream.Open);\n            Assert.AreEqual(1.5m, tradeBarFromStream.High);\n            Assert.AreEqual(1m, tradeBarFromStream.Low);\n            Assert.AreEqual(1.5m, tradeBarFromStream.Close);\n            Assert.AreEqual(90m, tradeBarFromStream.Volume);\n        }\n\n        [Test]\n        public void TradeBarParseDoesNotScaleOptionsWithNonEquityUnderlying()\n        {\n            var factory = new TradeBar();\n            var underlying = Symbol.CreateFuture(\"ES\", QuantConnect.Market.CME, new DateTime(2021, 3, 19));\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                QuantConnect.Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                SecurityIdentifier.DefaultDate);\n\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                optionSymbol,\n                Resolution.Minute,\n                TimeZones.Chicago,\n                TimeZones.Chicago,\n                true,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                true,\n                DataNormalizationMode.Raw);\n\n            var tradeLine = \"40560000,1.0,1.5,1.0,1.5,90.0\";\n            using var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(tradeLine));\n            using var stream = new StreamReader(memoryStream);\n\n            var unscaledTradeBarFromLine = (TradeBar)factory.Reader(config, tradeLine, new DateTime(2020, 9, 22), false);\n            var unscaledTradeBarFromStream = (TradeBar)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), unscaledTradeBarFromLine.EndTime);\n            Assert.AreEqual(optionSymbol, unscaledTradeBarFromLine.Symbol);\n            Assert.AreEqual(1m, unscaledTradeBarFromLine.Open);\n            Assert.AreEqual(1.5m, unscaledTradeBarFromLine.High);\n            Assert.AreEqual(1m, unscaledTradeBarFromLine.Low);\n            Assert.AreEqual(1.5m, unscaledTradeBarFromLine.Close);\n            Assert.AreEqual(90m, unscaledTradeBarFromLine.Volume);\n\n            Assert.AreEqual(new DateTime(2020, 9, 22, 11, 17, 0), unscaledTradeBarFromStream.EndTime);\n            Assert.AreEqual(optionSymbol, unscaledTradeBarFromStream.Symbol);\n            Assert.AreEqual(1m, unscaledTradeBarFromStream.Open);\n            Assert.AreEqual(1.5m, unscaledTradeBarFromStream.High);\n            Assert.AreEqual(1m, unscaledTradeBarFromStream.Low);\n            Assert.AreEqual(1.5m, unscaledTradeBarFromStream.Close);\n            Assert.AreEqual(90m, unscaledTradeBarFromStream.Volume);\n        }\n\n        [TestCase(Resolution.Minute, \"43140000,21.04,21.44,20.4,21.24,0\")]\n        [TestCase(Resolution.Hour, \"20200922 11:00,21.04,21.44,20.4,21.24,0\")]\n        [TestCase(Resolution.Daily, \"20200921 00:00,21.04,21.44,20.4,21.24,0\")]\n        public void TradeBarIndexLowResolutionParsing(Resolution resolution, string tradeLine)\n        {\n            var factory = new TradeBar();\n            var symbol = Symbols.CreateIndexSymbol(\"VIX\");\n            var entry = MarketHoursDatabase.FromDataFolder()\n                .GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                symbol,\n                resolution,\n                entry.DataTimeZone,\n                entry.ExchangeHours.TimeZone,\n                true,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                true,\n                DataNormalizationMode.Raw);\n\n            using var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(tradeLine));\n            using var stream = new StreamReader(memoryStream);\n\n            var fromLine = (TradeBar)factory.Reader(config, tradeLine, new DateTime(2020, 9, 22), false);\n            var fromStream = (TradeBar)factory.Reader(config, stream, new DateTime(2020, 9, 22), false);\n\n            var expectedEndTime = new DateTime(2020, 9, 22, 12, 0, 0);\n            if (resolution == Resolution.Daily)\n            {\n                expectedEndTime = new DateTime(2020, 9, 22, 0, 0, 0);\n            }\n            Assert.AreEqual(expectedEndTime, fromLine.EndTime);\n            Assert.AreEqual(symbol, fromLine.Symbol);\n            Assert.AreEqual(21.04m, fromLine.Open);\n            Assert.AreEqual(21.44m, fromLine.High);\n            Assert.AreEqual(20.4m, fromLine.Low);\n            Assert.AreEqual(21.24m, fromLine.Close);\n            Assert.AreEqual(0m, fromLine.Volume);\n\n            Assert.AreEqual(expectedEndTime, fromStream.EndTime);\n            Assert.AreEqual(symbol, fromLine.Symbol);\n            Assert.AreEqual(21.04m, fromLine.Open);\n            Assert.AreEqual(21.44m, fromLine.High);\n            Assert.AreEqual(20.4m, fromLine.Low);\n            Assert.AreEqual(21.24m, fromLine.Close);\n            Assert.AreEqual(0m, fromLine.Volume);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/MarketHourAwareConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2024 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Common;\nusing QuantConnect.Data.Consolidators;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class MarketHourAwareConsolidatorTests : BaseConsolidatorTests\n    {\n        [Test]\n        public void MarketAlwaysOpen()\n        {\n            var symbol = Symbols.BTCUSD;\n            using var consolidator = new MarketHourAwareConsolidator(true, Resolution.Daily, typeof(TradeBar), TickType.Trade, false);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2015, 04, 13, 5, 0, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 100 });\n\n            time = new DateTime(2015, 04, 13, 10, 0, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 1 });\n\n            Assert.IsNull(latestBar);\n\n            time = time.AddHours(2);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 2 });\n\n            Assert.IsNull(latestBar);\n\n            time = new DateTime(2015, 04, 13, 15, 15, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 3 });\n\n            Assert.IsNull(latestBar);\n\n            time = new DateTime(2015, 04, 14, 0, 0, 0);\n            consolidator.Scan(time);\n\n            // Assert that the bar emitted\n            Assert.IsNotNull(latestBar);\n            Assert.AreEqual(time, latestBar.EndTime);\n            Assert.AreEqual(time.AddDays(-1), latestBar.Time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.AreEqual(100, latestBar.High);\n            Assert.AreEqual(1, latestBar.Low);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void Daily(bool strictEndTime)\n        {\n            var symbol = strictEndTime ? Symbols.SPX : Symbols.SPY;\n            using var consolidator = new MarketHourAwareConsolidator(strictEndTime, Resolution.Daily, typeof(TradeBar), TickType.Trade, false);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2015, 04, 13, 5, 0, 0);\n            // this bar will be ignored because it's during market closed hours\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 100 });\n\n            time = new DateTime(2015, 04, 13, 10, 0, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 1 });\n\n            Assert.IsNull(latestBar);\n\n            time = time.AddHours(2);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 2 });\n\n            Assert.IsNull(latestBar);\n\n            time = new DateTime(2015, 04, 13, 15, 15, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 3 });\n\n            Assert.IsNull(latestBar);\n\n            time = strictEndTime ? time : new DateTime(2015, 04, 14, 0, 0, 0);\n            consolidator.Scan(time);\n\n            // Assert that the bar emitted\n            Assert.IsNotNull(latestBar);\n            Assert.AreEqual(strictEndTime ? new DateTime(2015, 04, 13, 15, 15, 0) : time, latestBar.EndTime);\n            Assert.AreEqual(strictEndTime ? new DateTime(2015, 04, 13, 8, 30, 0) : time.AddDays(-1), latestBar.Time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.AreEqual(3, latestBar.High);\n            Assert.AreEqual(1, latestBar.Low);\n        }\n\n        [Test]\n        public void BarIsSkippedWhenDataResolutionIsNotHourAndMarketIsClose()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = new MarketHourAwareConsolidator(true, Resolution.Daily, typeof(TradeBar), TickType.Trade, false);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2020, 05, 01, 09, 30, 0);\n            // this bar will be ignored because it's during market closed hours and the bar resolution is not Hour\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, Open = 1 });\n            Assert.IsNull(latestBar);\n            Assert.AreEqual(0, consolidatedBarsCount);\n        }\n\n        [Test]\n        public void DailyBarCanBeConsolidatedFromHourData()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = new MarketHourAwareConsolidator(true, Resolution.Daily, typeof(TradeBar), TickType.Trade, false);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2020, 05, 01, 09, 0, 0);\n            var hourBars = new List<TradeBar>()\n            {\n                new TradeBar() { Time = time, Period = Time.OneHour, Symbol = symbol, Open = 2 },\n                new TradeBar() { Time = time.AddHours(1), Period = Time.OneHour, Symbol = symbol, High = 200 },\n                new TradeBar() { Time = time.AddHours(2), Period = Time.OneHour, Symbol = symbol, Low = 0.02m },\n                new TradeBar() { Time = time.AddHours(3), Period = Time.OneHour, Symbol = symbol, Close = 20 },\n                new TradeBar() { Time = time.AddHours(4), Period = Time.OneHour, Symbol = symbol, Open = 3 },\n                new TradeBar() { Time = time.AddHours(5), Period = Time.OneHour, Symbol = symbol, High = 300 },\n                new TradeBar() { Time = time.AddHours(6), Period = Time.OneHour, Symbol = symbol, Low = 0.03m, Close = 30 },\n            };\n\n            foreach (var bar in hourBars)\n            {\n                consolidator.Update(bar);\n            }\n\n            consolidator.Scan(time.AddHours(7));\n\n            // Assert that the bar emitted\n            Assert.IsNotNull(latestBar);\n            Assert.AreEqual(time.AddHours(7), latestBar.EndTime);\n            Assert.AreEqual(time.AddMinutes(30), latestBar.Time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.AreEqual(2, latestBar.Open);\n            Assert.AreEqual(300, latestBar.High);\n            Assert.AreEqual(0.02, latestBar.Low);\n            Assert.AreEqual(30, latestBar.Close);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DailyExtendedMarketHours(bool strictEndTime)\n        {\n            var symbol = strictEndTime ? Symbols.SPX : Symbols.SPY;\n            using var consolidator = new MarketHourAwareConsolidatorTest(Resolution.Daily, typeof(TradeBar), TickType.Trade, true);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2015, 04, 13, 8, 31, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 10 });\n\n            time = new DateTime(2015, 04, 13, 10, 0, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 15 });\n\n            Assert.IsNull(latestBar);\n\n            if (!strictEndTime)\n            {\n                time = new DateTime(2015, 04, 13, 18, 15, 0);\n                consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = symbol, High = 20 });\n\n                Assert.IsNull(latestBar);\n            }\n\n            time = new DateTime(2015, 04, 13, 20, 0, 0);\n            consolidator.Scan(time);\n\n            // Assert that the bar emitted\n            Assert.IsNotNull(latestBar);\n            Assert.AreEqual(strictEndTime ? new DateTime(2015, 04, 13, 15, 15, 0) : time, latestBar.EndTime);\n            Assert.AreEqual(strictEndTime ? new DateTime(2015, 04, 13, 8, 30, 0) : new DateTime(2015, 04, 13, 4, 0, 0), latestBar.Time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.AreEqual(strictEndTime ? 15 : 20, latestBar.High);\n            Assert.AreEqual(10, latestBar.Low);\n        }\n\n        [Test]\n        public void MarketHoursRespected()\n        {\n            using var consolidator = new MarketHourAwareConsolidator(true, Resolution.Hour, typeof(TradeBar), TickType.Trade, false);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = (TradeBar)bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2015, 04, 13, 9, 0, 0);\n            // this bar will be ignored because it's during market closed hours\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 100 });\n\n            time = new DateTime(2015, 04, 13, 9, 31, 0);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 1 });\n\n            Assert.IsNull(latestBar);\n\n            time = time.AddMinutes(2);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 2 });\n\n            Assert.IsNull(latestBar);\n\n            time = time.AddMinutes(2);\n            consolidator.Update(new TradeBar() { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 3 });\n\n            Assert.IsNull(latestBar);\n\n            time = new DateTime(2015, 04, 13, 10, 0, 0);\n            consolidator.Scan(time);\n\n            // Assert that the bar emitted\n            Assert.IsNotNull(latestBar);\n            Assert.AreEqual(time, latestBar.EndTime);\n            Assert.AreEqual(new DateTime(2015, 04, 13, 9, 0, 0), latestBar.Time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.AreEqual(3, latestBar.High);\n            Assert.AreEqual(1, latestBar.Low);\n        }\n\n        [Test]\n        public void WorksWithDailyResolutionAndPreciseEndTimeFalse()\n        {\n            using var consolidator = new MarketHourAwareConsolidator(false, Resolution.Daily, typeof(TradeBar), TickType.Trade, false);\n\n            var time = new DateTime(2015, 04, 13, 0, 0, 0);\n            consolidator.Update(new TradeBar() { Time = time, Period = Time.OneDay, Symbol = Symbols.SPY, Open = 100, High = 100, Low = 100, Close = 100 });\n            Assert.IsNotNull(consolidator.WorkingData);\n            var workingData = (TradeBar)consolidator.WorkingData;\n            Assert.AreEqual(100, workingData.Open);\n            Assert.AreEqual(100, workingData.Low);\n            Assert.AreEqual(100, workingData.Close);\n            Assert.AreEqual(100, workingData.High);\n\n            // Trigger the consolidation\n            consolidator.Scan(time.AddDays(1));\n            Assert.IsNotNull(consolidator.Consolidated);\n\n            var consolidatedData = (TradeBar)consolidator.Consolidated;\n            Assert.AreEqual(100, consolidatedData.Open);\n            Assert.AreEqual(100, consolidatedData.Low);\n            Assert.AreEqual(100, consolidatedData.Close);\n            Assert.AreEqual(100, consolidatedData.High);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new MarketHourAwareConsolidator(true, Resolution.Hour, typeof(TradeBar), TickType.Trade, false);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2015, 04, 13, 8, 31, 0);\n            return new List<TradeBar>()\n            {\n                new TradeBar(){ Time = time, Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10 },\n                new TradeBar(){ Time = time.AddMinutes(1), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12 },\n                new TradeBar(){ Time = time.AddMinutes(2), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10 },\n                new TradeBar(){ Time = time.AddMinutes(3), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 5 },\n                new TradeBar(){ Time = time.AddMinutes(4), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 15 },\n                new TradeBar(){ Time = time.AddMinutes(5), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 20 },\n                new TradeBar(){ Time = time.AddMinutes(6), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 18 },\n                new TradeBar(){ Time = time.AddMinutes(7), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12 },\n                new TradeBar(){ Time = time.AddMinutes(8), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 25 },\n                new TradeBar(){ Time = time.AddMinutes(9), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 30 },\n                new TradeBar(){ Time = time.AddMinutes(10), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 26 },\n            };\n        }\n\n        private class MarketHourAwareConsolidatorTest : MarketHourAwareConsolidator\n        {\n            public MarketHourAwareConsolidatorTest(Resolution resolution, Type dataType, TickType tickType, bool extendedMarketHours)\n                : base(true, resolution, dataType, tickType, extendedMarketHours)\n            {\n            }\n\n            protected override bool UseStrictEndTime(Symbol symbol)\n            {\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/MockSubscriptionDataConfigProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    internal class MockSubscriptionDataConfigProvider : ISubscriptionDataConfigProvider\n    {\n        public List<SubscriptionDataConfig> SubscriptionDataConfigs\n            = new List<SubscriptionDataConfig>();\n        public MockSubscriptionDataConfigProvider(SubscriptionDataConfig config = null)\n        {\n            if (config != null)\n            {\n                SubscriptionDataConfigs.Add(config);\n            }\n        }\n        public List<SubscriptionDataConfig> GetSubscriptionDataConfigs(Symbol symbol, bool includeInternalConfigs = false)\n        {\n            return SubscriptionDataConfigs.Where(config => !config.IsInternalFeed || includeInternalConfigs).ToList();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/OpenInterestConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class OpenInterestConsolidatorTests : BaseConsolidatorTests\n    {\n        [TestCaseSource(nameof(HourAndDailyTestValues))]\n        public void HourAndDailyConsolidationKeepsTimeOfDay(TimeSpan period, List<(OpenInterest, bool)> data)\n        {\n            using var consolidator = new OpenInterestConsolidator(period);\n\n            var consolidatedOpenInterest = (OpenInterest)null;\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                Log.Debug($\"{consolidated.EndTime} - {consolidated}\");\n                consolidatedOpenInterest = consolidated;\n            };\n\n            var prevData = (OpenInterest)null;\n            foreach (var (openInterest, shouldConsolidate) in data)\n            {\n                consolidator.Update(openInterest);\n\n                if (shouldConsolidate)\n                {\n                    Assert.IsNotNull(consolidatedOpenInterest);\n                    Assert.AreEqual(prevData.Symbol, consolidatedOpenInterest.Symbol);\n                    Assert.AreEqual(prevData.Value, consolidatedOpenInterest.Value);\n                    Assert.AreEqual(prevData.EndTime, consolidatedOpenInterest.EndTime);\n                    consolidatedOpenInterest = null;\n                }\n                else\n                {\n                    Assert.IsNull(consolidatedOpenInterest);\n                }\n\n                prevData = openInterest;\n            }\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new OpenInterestConsolidator(TimeSpan.FromDays(1));\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2015, 04, 13, 8, 31, 0);\n            return new List<OpenInterest>()\n            {\n                new OpenInterest(){ Time = time, Symbol = Symbols.SPY, Value = 10 },\n                new OpenInterest(){ Time = time.AddMinutes(1), Symbol = Symbols.SPY, Value = 12 },\n                new OpenInterest(){ Time = time.AddMinutes(2), Symbol = Symbols.SPY, Value = 10 },\n                new OpenInterest(){ Time = time.AddMinutes(3), Symbol = Symbols.SPY, Value = 5 },\n                new OpenInterest(){ Time = time.AddMinutes(4), Symbol = Symbols.SPY, Value = 15 },\n                new OpenInterest(){ Time = time.AddMinutes(5), Symbol = Symbols.SPY, Value = 20 },\n                new OpenInterest(){ Time = time.AddMinutes(6), Symbol = Symbols.SPY, Value = 18 },\n                new OpenInterest(){ Time = time.AddMinutes(7), Symbol = Symbols.SPY, Value = 12 },\n                new OpenInterest(){ Time = time.AddMinutes(8), Symbol = Symbols.SPY, Value = 25 },\n                new OpenInterest(){ Time = time.AddMinutes(9), Symbol = Symbols.SPY, Value = 30 },\n                new OpenInterest(){ Time = time.AddMinutes(10), Symbol = Symbols.SPY, Value = 26 },\n            };\n        }\n\n        private static IEnumerable<TestCaseData> HourAndDailyTestValues()\n        {\n            var symbol = Symbols.SPY_C_192_Feb19_2016;\n            var time = new DateTime(2015, 04, 13, 6, 30, 0);\n            var period = Time.OneDay;\n\n            yield return new TestCaseData(\n                period,\n                new List<(OpenInterest, bool)>()\n                {\n                    (new OpenInterest(time, symbol, 10), false),\n                    (new OpenInterest(time.AddDays(1), symbol, 11), true),\n                    (new OpenInterest(time.AddDays(2), symbol, 12), true),\n                    (new OpenInterest(time.AddDays(3), symbol, 13), true),\n                    (new OpenInterest(time.AddDays(4), symbol, 14), true),\n                    (new OpenInterest(time.AddDays(5), symbol, 15), true),\n                });\n\n            yield return new TestCaseData(\n                period,\n                new List<(OpenInterest, bool)>()\n                {\n                    (new OpenInterest(time, symbol, 10), false),\n                    (new OpenInterest(time.AddDays(1), symbol, 11), true),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddDays(1).AddMinutes(1), symbol, 12), false),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddDays(1).AddMinutes(2), symbol, 13), false),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddDays(1).AddMinutes(3), symbol, 14), false),\n                    // Not the full period passed but different date, should consolidate\n                    (new OpenInterest(time.AddDays(2).AddHours(-1), symbol, 15), true),\n                    (new OpenInterest(time.AddDays(3).AddHours(-2), symbol, 16), true),\n                    (new OpenInterest(time.AddDays(4).AddHours(-3), symbol, 17), true),\n                    (new OpenInterest(time.AddDays(5).AddHours(-4), symbol, 18), true),\n                });\n\n            period = Time.OneHour;\n\n            yield return new TestCaseData(\n                period,\n                new List<(OpenInterest, bool)>()\n                {\n                    (new OpenInterest(time, symbol, 10), false),\n                    (new OpenInterest(time.AddHours(1), symbol, 11), true),\n                    (new OpenInterest(time.AddHours(2), symbol, 12), true),\n                    (new OpenInterest(time.AddHours(3), symbol, 13), true),\n                    (new OpenInterest(time.AddHours(4), symbol, 14), true),\n                    (new OpenInterest(time.AddHours(5), symbol, 15), true),\n                });\n\n            yield return new TestCaseData(\n                period,\n                new List<(OpenInterest, bool)>()\n                {\n                    (new OpenInterest(time.AddHours(0.5).AddMinutes(10), symbol, 10), false),\n                    (new OpenInterest(time.AddHours(2.5).AddMinutes(20), symbol, 11), true),\n                    (new OpenInterest(time.AddHours(4.5).AddMinutes(30), symbol, 12), true),\n                    (new OpenInterest(time.AddHours(6.5).AddMinutes(40), symbol, 13), true),\n                    (new OpenInterest(time.AddHours(8.5), symbol, 14), true),\n                    (new OpenInterest(time.AddHours(10.5).AddMinutes(50), symbol, 15), true),\n                });\n\n            yield return new TestCaseData(\n                period,\n                new List<(OpenInterest, bool)>()\n                {\n                    (new OpenInterest(time, symbol, 10), false),\n                    (new OpenInterest(time.AddHours(1), symbol, 11), true),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddHours(1).AddMinutes(5), symbol, 12), false),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddHours(1).AddMinutes(10), symbol, 13), false),\n                    // Same date, should not consolidate\n                    (new OpenInterest(time.AddHours(1).AddMinutes(15), symbol, 14), false),\n                    // Not the full period passed but different date, should consolidate\n                    (new OpenInterest(time.AddHours(2).AddMinutes(-5), symbol, 15), true),\n                    (new OpenInterest(time.AddHours(3).AddMinutes(-10), symbol, 16), true),\n                    (new OpenInterest(time.AddHours(4).AddMinutes(-15), symbol, 17), true),\n                    (new OpenInterest(time.AddHours(5).AddMinutes(-20), symbol, 18), true),\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/PeriodCountConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class PeriodCountConsolidatorTests\n    {\n        private static readonly object[] PeriodCases =\n        {\n            new [] { TimeSpan.FromDays(100), TimeSpan.FromDays(10) },\n            new [] { TimeSpan.FromDays(30), TimeSpan.FromDays(1) },     //GH Issue #4915\n            new [] { TimeSpan.FromDays(10), TimeSpan.FromDays(1) },\n            new [] { TimeSpan.FromDays(1), TimeSpan.FromHours(1) },\n            new [] { TimeSpan.FromHours(10), TimeSpan.FromHours(1) },\n            new [] { TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(1) },\n            new [] { TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(10) },\n            new [] { TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(0.1) }\n        };\n\n        [TestCaseSource(nameof(PeriodCases))]\n        public void ExpectedConsolidatedTradeBarsInPeriodMode(TimeSpan barSpan, TimeSpan updateSpan)\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new BaseDataConsolidator(barSpan);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                Assert.AreEqual(barSpan, bar.Period);              // The period matches our span\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            var dataTime = reference;\n\n            var nextBarTime = reference + barSpan;\n            var lastBarTime = reference;\n\n            // First data point\n            consolidator.Update(new Tick { Time = dataTime });\n            Assert.IsNull(consolidated);\n\n            for (var i = 0; i < 10; i++)\n            {\n                // Add data on the given interval until we expect a new bar\n                while (dataTime < nextBarTime)\n                {\n                    dataTime = dataTime.Add(updateSpan);\n                    consolidator.Update(new Tick { Time = dataTime });\n                }\n\n                // Our asserts\n                Assert.IsNotNull(consolidated);                                 // We have a bar\n                Assert.AreEqual(dataTime, consolidated.EndTime);    // New bar time should be dataTime\n                Assert.AreEqual(barSpan, consolidated.EndTime - lastBarTime);      // The difference between the bars is the span\n\n                nextBarTime = dataTime + barSpan;\n                lastBarTime = consolidated.EndTime;\n            }\n        }\n\n        [TestCaseSource(nameof(PeriodCases))]\n        public void ExpectedConsolidatedQuoteBarsInPeriodMode(TimeSpan barSpan, TimeSpan updateSpan)\n        {\n            QuoteBar consolidated = null;\n            using var consolidator = new QuoteBarConsolidator(barSpan);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                Assert.AreEqual(barSpan, bar.Period);                  // The period matches our span\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            var dataTime = reference;\n\n            var nextBarTime = reference + barSpan;\n            var lastBarTime = reference;\n\n            // First data point\n            consolidator.Update(new QuoteBar { Time = dataTime, Period = updateSpan });\n            Assert.IsNull(consolidated);\n\n            for (var i = 0; i < 10; i++)\n            {\n                // Add data on the given interval until we expect a new bar\n                while (dataTime < nextBarTime)\n                {\n                    dataTime = dataTime.Add(updateSpan);\n                    consolidator.Update(new QuoteBar { Time = dataTime, Period = updateSpan });\n                }\n\n                // Our asserts\n                Assert.IsNotNull(consolidated);                                 // We have a bar\n                Assert.AreEqual(dataTime, consolidated.EndTime);    // New bar time should be dataTime\n                Assert.AreEqual(barSpan, consolidated.EndTime - lastBarTime);      // The difference between the bars is the span\n\n                nextBarTime = dataTime + barSpan;\n                lastBarTime = consolidated.EndTime;\n            }\n        }\n\n        [Test]\n        public void ConsolidatorEmitsOffsetBarsCorrectly()\n        {\n            // This test is to cover an issue seen with the live data stack\n            // The consolidator would fail to emit every other bar because of a \n            // ms delay in data from a live stream\n            var period = TimeSpan.FromHours(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            var consolidatedBarsCount = 0;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidatedBarsCount++;\n            };\n\n            var random = new Random();\n            var time = new DateTime(2015, 04, 13);\n\n            // The bars time is accurate, covering the hour perfectly\n            // But the emit time is slightly offset (the timeslice that contains the bar)\n            // So add a random ms offset to the scan time\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneHour });\n            time = time.Add(period);\n            consolidator.Scan(time.AddMilliseconds(random.Next(800)));\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneHour });\n            time = time.Add(period);\n            consolidator.Scan(time.AddMilliseconds(random.Next(800)));\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneHour });\n            time = time.Add(period);\n            consolidator.Scan(time.AddMilliseconds(random.Next(800)));\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneHour });\n            time = time.Add(period);\n            consolidator.Scan(time.AddMilliseconds(random.Next(800)));\n\n            // We should expect to see 4 bars emitted from the consolidator\n            Assert.AreEqual(4, consolidatedBarsCount);\n        }\n\n        [Test]\n        public void ConsolidatorEmitsOldBarsUsingUpdate()\n        {\n            // This test is to ensure that no bars get swallowed by the consolidator\n            // even if it doesn't get the data on regular intervals.\n            // We will use the PushThrough method which calls update\n            var period = TimeSpan.FromHours(1);\n            using var consolidator = new TradeBarConsolidator(period);\n            TradeBar latestConsolidated = null;\n            var consolidatedBarsCount = 0;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestConsolidated = bar;\n                consolidatedBarsCount++;\n            };\n\n            // Set our starting time 04/13/2015 at 12:00AM\n            var time = new DateTime(2015, 04, 13);\n\n            // Update this consolidator with minute tradebars but one less than 60, which would trigger emit\n            PushBarsThrough(59, Time.OneMinute, consolidator, ref time);\n\n            // No bars should be emitted, lets assert the current time and count\n            Assert.IsTrue(time == new DateTime(2015, 04, 13, 0, 59, 0));\n            Assert.AreEqual(0, consolidatedBarsCount);\n\n            // Advance time way past (3 hours) the bar end time of 1AM\n            time += TimeSpan.FromHours(3); // Time = 3:59AM now\n\n            // Push one bar through at 3:59AM and check that we still get the 12AM - 1AM Bar emitted\n            PushBarsThrough(1, Time.OneMinute, consolidator, ref time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.IsTrue(latestConsolidated != null && latestConsolidated.Time == new DateTime(2015, 04, 13));\n\n            // Check the new working bar is 3AM to 4AM, This is because we pushed a bar in at 3:59AM\n            Assert.IsTrue(consolidator.WorkingBar.Time == new DateTime(2015, 04, 13, 3, 0, 0));\n        }\n\n        [Test]\n        public void ConsolidatorEmitsOldBarsUsingScan()\n        {\n            // This test is to ensure that no bars get swallowed by the consolidator\n            // even if it doesn't get the data on regular intervals.\n            // We will use Consolidators Scan method to emit bars\n            var period = TimeSpan.FromHours(1);\n            using var consolidator = new TradeBarConsolidator(period);\n            TradeBar latestConsolidated = null;\n            var consolidatedBarsCount = 0;\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestConsolidated = bar;\n                consolidatedBarsCount++;\n            };\n\n            var time = new DateTime(2015, 04, 13);\n\n            // Push through one bar at 12:00AM to create the consolidators working bar\n            PushBarsThrough(1, Time.OneMinute, consolidator, ref time);\n\n            // There should be no emit, lets assert the current time and count\n            Assert.IsTrue(time == new DateTime(2015, 04, 13, 0, 1, 0));\n            Assert.AreEqual(0, consolidatedBarsCount);\n\n            // Now advance time way past (3 Hours) the bar end time of 1AM\n            time += TimeSpan.FromHours(3); // Time = 3:59AM now\n\n            // Call scan with current time, it should emit the 12AM - 1AM Bar without any update\n            consolidator.Scan(time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n            Assert.IsTrue(latestConsolidated != null && latestConsolidated.Time == new DateTime(2015, 04, 13, 0, 0, 0));\n\n            // WorkingBar should be null, ready for whatever data comes through next\n            Assert.IsTrue(consolidator.WorkingBar == null);\n        }\n\n        [Test]\n        public void ConsolidatorEmitsRegularly()\n        {\n            // This test just pushes through 1000 bars\n            // and ensures that the emit time and count are correct\n            var period = TimeSpan.FromHours(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            var consolidatedBarsCount = 0;\n            var time = new DateTime(2015, 04, 13);\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                Assert.IsTrue(bar.EndTime == time);\n                consolidatedBarsCount++;\n            };\n\n            PushBarsThrough(1000, Time.OneHour, consolidator, ref time);\n\n            // Scan one last time so we can emit the 1000th bar\n            consolidator.Scan(time);\n            Assert.AreEqual(500, consolidatedBarsCount);\n        }\n\n        [TestCase(14)] // 2PM\n        [TestCase(15)] // 3PM\n        [TestCase(16)] // 4PM\n        public void BarsEmitOnTime(int hour)\n        {\n            // This test just pushes one full hourly bar into a consolidator\n            // and scans to see if it will emit immediately as expected\n\n            using var consolidator = new TradeBarConsolidator(Time.OneHour);\n            var consolidatedBarsCount = 0;\n            TradeBar latestBar = null;\n            var time = new DateTime(2015, 04, 13, hour, 0, 0);\n\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                latestBar = bar;\n                consolidatedBarsCount++;\n            };\n\n            // Update with one tradebar that ends at this time\n            // This is to simulate getting a data bar for the last period\n            consolidator.Update(new TradeBar { Time = time.Subtract(Time.OneMinute), Period = Time.OneMinute });\n\n            // Assert that the bar hasn't emitted\n            Assert.IsNull(latestBar);\n            Assert.AreEqual(0, consolidatedBarsCount);\n\n            // Scan afterwards (Like algorithmManager does)\n            consolidator.Scan(time);\n\n            // Assert that the bar emitted \n            Assert.IsNotNull(latestBar);\n            Assert.IsTrue(latestBar.EndTime == time);\n            Assert.AreEqual(1, consolidatedBarsCount);\n        }\n\n        [TestCase(typeof(BaseDataConsolidator))]\n        [TestCase(typeof(TradeBarConsolidator))]\n        [TestCase(typeof(QuoteBarConsolidator))]\n        [TestCase(typeof(TickConsolidator))]\n        [TestCase(typeof(TickQuoteBarConsolidator))]\n        [TestCase(typeof(OpenInterestConsolidator))]\n        [TestCase(typeof(DynamicDataConsolidator))]\n        public void ConsolidatorShouldConsolidateOnMaxCountAndUseLastEndTime(Type consolidatorType)\n        {\n            // Create a consolidator with maxCount = 2\n            var consolidator = (IDataConsolidator)Activator.CreateInstance(consolidatorType, 2);\n\n            IBaseData consolidated = null;\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                // Store the consolidated bar when the DataConsolidated event fires\n                consolidated = bar;\n            };\n\n            var startDate = new DateTime(2015, 04, 13, 10, 20, 0);\n            var expectedEndTime = startDate.AddMinutes(61);\n            var tickType =\n                consolidatorType == typeof(TickQuoteBarConsolidator) ? TickType.Quote :\n                consolidatorType == typeof(TickConsolidator) ? TickType.Trade :\n                TickType.OpenInterest;\n\n            var tradeBars = new List<TradeBar>\n            {\n                new TradeBar { Symbol = Symbols.SPY, DataType = MarketDataType.TradeBar, Time = startDate, EndTime = startDate.AddMinutes(1) },\n                new TradeBar { Symbol = Symbols.SPY, DataType = MarketDataType.TradeBar, Time = startDate.AddMinutes(1), EndTime = startDate.AddMinutes(2) },\n                new TradeBar { Symbol = Symbols.SPY, DataType = MarketDataType.TradeBar, Time = startDate.AddMinutes(2), EndTime = startDate.AddMinutes(3) },\n                new TradeBar { Symbol = Symbols.SPY, DataType = MarketDataType.TradeBar, Time = startDate.AddHours(1), EndTime = startDate.AddMinutes(61) },\n            };\n\n            var quoteBars = new List<QuoteBar>\n            {\n                new QuoteBar { Symbol = Symbols.SPY, DataType = MarketDataType.QuoteBar, Time = startDate, EndTime = startDate.AddMinutes(1) },\n                new QuoteBar { Symbol = Symbols.SPY, DataType = MarketDataType.QuoteBar, Time = startDate.AddMinutes(1), EndTime = startDate.AddMinutes(2) },\n                new QuoteBar { Symbol = Symbols.SPY, DataType = MarketDataType.QuoteBar, Time = startDate.AddMinutes(2), EndTime = startDate.AddMinutes(3) },\n                new QuoteBar { Symbol = Symbols.SPY, DataType = MarketDataType.QuoteBar, Time = startDate.AddHours(1), EndTime = startDate.AddMinutes(61) },\n            };\n\n            var ticks = new List<Tick>\n            {\n                new Tick { Symbol = Symbols.SPY, DataType = MarketDataType.Tick, TickType = tickType, Time = startDate, EndTime = startDate.AddMinutes(1) },\n                new Tick { Symbol = Symbols.SPY, DataType = MarketDataType.Tick, TickType = tickType, Time = startDate.AddMinutes(1), EndTime = startDate.AddMinutes(2) },\n                new Tick { Symbol = Symbols.SPY, DataType = MarketDataType.Tick, TickType = tickType, Time = startDate.AddMinutes(2), EndTime = startDate.AddMinutes(3) },\n                new Tick { Symbol = Symbols.SPY, DataType = MarketDataType.Tick, TickType = tickType, Time = startDate.AddHours(1), EndTime = startDate.AddMinutes(61) },\n            };\n\n            var customData = new List<CustomData>\n            {\n                new CustomData { Symbol = Symbols.SPY, Time = startDate, EndTime = startDate.AddMinutes(1) },\n                new CustomData { Symbol = Symbols.SPY, Time = startDate.AddMinutes(1), EndTime = startDate.AddMinutes(2) },\n                new CustomData { Symbol = Symbols.SPY, Time = startDate.AddMinutes(2), EndTime = startDate.AddMinutes(3) },\n                new CustomData { Symbol = Symbols.SPY, Time = startDate.AddHours(1), EndTime = startDate.AddMinutes(61) },\n            };\n\n            var dataMap = new Dictionary<Type, IEnumerable<BaseData>>\n            {\n                { typeof(TradeBarConsolidator), tradeBars },\n                { typeof(BaseDataConsolidator), tradeBars },\n                { typeof(QuoteBarConsolidator), quoteBars },\n                { typeof(TickQuoteBarConsolidator), ticks },\n                { typeof(OpenInterestConsolidator), ticks },\n                { typeof(TickConsolidator), ticks },\n                { typeof(DynamicDataConsolidator), customData }\n            };\n\n            if (dataMap.TryGetValue(consolidatorType, out var dataList))\n            {\n                // Feed the consolidator with the appropriate data\n                foreach (var data in dataList)\n                {\n                    consolidator.Update(data);\n                }\n            }\n\n            // Assert the consolidated bar is not null and its EndTime matches the last received bar's EndTime\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(Symbols.SPY, consolidated.Symbol);\n            Assert.AreEqual(expectedEndTime, consolidated.EndTime);\n        }\n\n        private static void PushBarsThrough(int barCount, TimeSpan period, TradeBarConsolidator consolidator, ref DateTime time)\n        {\n            TradeBar bar;\n\n            for (int i = 0; i < barCount; i++)\n            {\n                bar = new TradeBar { Time = time, Period = period };\n                consolidator.Update(bar);\n\n                // Advance time\n                time += period;\n            }\n        }\n\n        private class CustomData : DynamicData\n        {\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/QuoteBarConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class QuoteBarConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void ThrowsWhenPeriodIsSmallerThanDataPeriod()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(Time.OneHour);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = new DateTime(2022, 6, 6, 13, 30, 1);\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = TimeSpan.FromDays(1)\n            };\n            Assert.Throws<ArgumentException>(() => creator.Update(bar1));\n        }\n\n        [Test]\n        public void MultipleResolutionConsolidation()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(Time.OneDay);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = new DateTime(2022, 6, 6);\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = TimeSpan.FromDays(1)\n            };\n            creator.Update(bar1);\n            Assert.IsNull(quoteBar);\n            creator.Scan(bar1.EndTime);\n            Assert.IsNotNull(quoteBar);\n            quoteBar = null;\n\n            // now let's send in other resolution data\n            var previousBar = bar1;\n            for (int i = 0; i <= 24; i++)\n            {\n                previousBar = new QuoteBar\n                {\n                    Time = previousBar.EndTime,\n                    Symbol = Symbols.SPY,\n                    Bid = new Bar(1, 2, 0.75m, 1.25m),\n                    LastBidSize = 3,\n                    Ask = null,\n                    LastAskSize = 0,\n                    Value = 1,\n                    Period = TimeSpan.FromHours(1)\n                };\n                creator.Update(previousBar);\n\n                if (i < 24)\n                {\n                    Assert.IsNull(quoteBar, $\"{i} {previousBar.EndTime}\");\n                }\n                else\n                {\n                    Assert.IsNotNull(quoteBar, $\"{i} {previousBar.EndTime}\");\n                }\n            }\n        }\n\n        [Test]\n        public void GentlyHandlesPeriodAndDataAreSameResolution()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(Time.OneDay);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = new DateTime(2022, 6, 6, 13, 30, 1);\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = TimeSpan.FromDays(1)\n            };\n            creator.Update(bar1);\n            Assert.IsNull(quoteBar);\n            creator.Scan(bar1.EndTime);\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(bar1.Symbol, quoteBar.Symbol);\n            Assert.AreEqual(bar1.Ask, quoteBar.Ask);\n            Assert.AreEqual(bar1.Bid.Open, quoteBar.Bid.Open);\n            Assert.AreEqual(bar1.Bid.High, quoteBar.Bid.High);\n            Assert.AreEqual(bar1.Bid.Low, quoteBar.Bid.Low);\n            Assert.AreEqual(bar1.Bid.Close, quoteBar.Bid.Close);\n            Assert.AreEqual(bar1.LastBidSize, quoteBar.LastBidSize);\n            Assert.AreEqual(bar1.LastAskSize, quoteBar.LastAskSize);\n            Assert.AreEqual(bar1.Value, quoteBar.Value);\n            Assert.AreEqual(bar1.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(bar1.Time, quoteBar.Time);\n            Assert.AreEqual(bar1.Period, quoteBar.Period);\n        }\n\n        [Test]\n        public void AggregatesNewCountQuoteBarProperlyDaily()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(1);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = new DateTime(2022, 6, 6, 13, 30, 1);\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = TimeSpan.FromDays(1)\n            };\n            creator.Update(bar1);\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(bar1.Symbol, quoteBar.Symbol);\n            Assert.AreEqual(bar1.Ask, quoteBar.Ask);\n            Assert.AreEqual(bar1.Bid.Open, quoteBar.Bid.Open);\n            Assert.AreEqual(bar1.Bid.High, quoteBar.Bid.High);\n            Assert.AreEqual(bar1.Bid.Low, quoteBar.Bid.Low);\n            Assert.AreEqual(bar1.Bid.Close, quoteBar.Bid.Close);\n            Assert.AreEqual(bar1.LastBidSize, quoteBar.LastBidSize);\n            Assert.AreEqual(bar1.LastAskSize, quoteBar.LastAskSize);\n            Assert.AreEqual(bar1.Value, quoteBar.Value);\n            Assert.AreEqual(bar1.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(bar1.Time, quoteBar.Time);\n            Assert.AreEqual(bar1.Period, quoteBar.Period);\n        }\n\n        [Test]\n        public void AggregatesNewCountQuoteBarProperly()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(4);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = DateTime.Today;\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar1);\n            Assert.IsNull(quoteBar);\n\n            var bar2 = new QuoteBar\n            {\n                Time = bar1.EndTime,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1.1m, 2.2m, 0.9m, 2.1m),\n                LastBidSize = 3,\n                Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m),\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar2);\n            Assert.IsNull(quoteBar);\n\n            var bar3 = new QuoteBar\n            {\n                Time = bar2.EndTime,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.5m, 1.75m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar3);\n            Assert.IsNull(quoteBar);\n\n            var bar4 = new QuoteBar\n            {\n                Time = bar3.EndTime,\n                Symbol = Symbols.SPY,\n                Bid = null,\n                LastBidSize = 0,\n                Ask = new Bar(1, 7, 0.5m, 4.4m),\n                LastAskSize = 4,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar4);\n            Assert.IsNotNull(quoteBar);\n            Assert.AreEqual(bar1.Symbol, quoteBar.Symbol);\n            Assert.AreEqual(bar1.Bid.Open, quoteBar.Bid.Open);\n            Assert.AreEqual(bar2.Ask.Open, quoteBar.Ask.Open);\n            Assert.AreEqual(bar2.Bid.High, quoteBar.Bid.High);\n            Assert.AreEqual(bar4.Ask.High, quoteBar.Ask.High);\n            Assert.AreEqual(bar3.Bid.Low, quoteBar.Bid.Low);\n            Assert.AreEqual(bar4.Ask.Low, quoteBar.Ask.Low);\n            Assert.AreEqual(bar3.Bid.Close, quoteBar.Bid.Close);\n            Assert.AreEqual(bar4.Ask.Close, quoteBar.Ask.Close);\n            Assert.AreEqual(bar3.LastBidSize, quoteBar.LastBidSize);\n            Assert.AreEqual(bar4.LastAskSize, quoteBar.LastAskSize);\n            Assert.AreEqual(bar1.Value, quoteBar.Value);\n\n            Assert.AreEqual(bar1.Time, quoteBar.Time);\n            Assert.AreEqual(bar4.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(TimeSpan.FromMinutes(4), quoteBar.Period);\n        }\n\n        [Test]\n        public void AggregatesNewTimeSpanQuoteBarProperly()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(TimeSpan.FromMinutes(2));\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = DateTime.Today;\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar1);\n            Assert.IsNull(quoteBar);\n\n            var bar2 = new QuoteBar\n            {\n                Time = bar1.EndTime,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1.1m, 2.2m, 0.9m, 2.1m),\n                LastBidSize = 3,\n                Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m),\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar2);\n            Assert.IsNull(quoteBar);\n\n            // pushing another bar to force the fire\n            var bar3 = new QuoteBar\n            {\n                Time = bar2.EndTime,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.5m, 1.75m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = Time.OneMinute\n            };\n            creator.Update(bar3);\n\n\n            Assert.IsNotNull(quoteBar);\n\n            \n            Assert.AreEqual(bar1.Symbol, quoteBar.Symbol);\n            Assert.AreEqual(bar1.Time, quoteBar.Time);\n            Assert.AreEqual(bar2.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(TimeSpan.FromMinutes(2), quoteBar.Period);\n\n            // Bid\n            Assert.AreEqual(bar1.Bid.Open, quoteBar.Bid.Open);\n            Assert.AreEqual(bar2.Bid.Close, quoteBar.Bid.Close);\n            Assert.AreEqual(Math.Max(bar2.Bid.High, bar1.Bid.High), quoteBar.Bid.High);\n            Assert.AreEqual(Math.Min(bar2.Bid.Low, bar1.Bid.Low), quoteBar.Bid.Low);\n\n            // Ask\n            Assert.AreEqual(bar2.Ask.Open, quoteBar.Ask.Open);\n            Assert.AreEqual(bar2.Ask.Close, quoteBar.Ask.Close);\n            Assert.AreEqual(bar2.Ask.High, quoteBar.Ask.High);\n            Assert.AreEqual(bar2.Ask.Low, quoteBar.Ask.Low);\n            Assert.AreEqual(bar1.LastAskSize, quoteBar.LastAskSize);\n\n            Assert.AreEqual(1, quoteBar.Value);\n                        \n        }\n\n        [Test]\n        public void DoesNotConsolidateDifferentSymbols()\n        {\n            using var consolidator = new QuoteBarConsolidator(2);\n\n            var time = DateTime.Today;\n            var period = TimeSpan.FromMinutes(1);\n\n            var bar1 = new QuoteBar\n            {\n                Symbol = Symbols.AAPL,\n                Time = time,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = period\n            };\n\n            var bar2 = new QuoteBar\n            {\n                Symbol = Symbols.ZNGA,\n                Time = time,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = period\n            };\n\n            consolidator.Update(bar1);\n\n            Exception ex = Assert.Throws<InvalidOperationException>(() => consolidator.Update(bar2));\n            Assert.IsTrue(ex.Message.Contains(\"is not the same\", StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [Test]\n        public void LastCloseAndCurrentOpenPriceShouldBeSameConsolidatedOnTimeSpan()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new QuoteBarConsolidator(TimeSpan.FromMinutes(2));\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var time = DateTime.Today;\n            var period = TimeSpan.FromMinutes(1);\n            var bar1 = new QuoteBar\n            {\n                Time = time,\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.75m, 1.25m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = period\n            };\n            creator.Update(bar1);\n            Assert.IsNull(quoteBar);\n\n            var bar2 = new QuoteBar\n            {\n                Time = time + TimeSpan.FromMinutes(1),\n                Symbol = Symbols.SPY,\n                Bid = null,\n                LastBidSize = 0,\n                Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m),\n                LastAskSize = 10,\n                Value = 1,\n                Period = period\n            };\n            creator.Update(bar2);\n            Assert.IsNull(quoteBar);\n\n            // pushing another bar to force the fire\n            var bar3 = new QuoteBar\n            {\n                Time = time + TimeSpan.FromMinutes(2),\n                Symbol = Symbols.SPY,\n                Bid = new Bar(1, 2, 0.5m, 1.75m),\n                LastBidSize = 3,\n                Ask = null,\n                LastAskSize = 0,\n                Value = 1,\n                Period = period\n            };\n            creator.Update(bar3);\n            Assert.IsNotNull(quoteBar);\n\n            //force the consolidator to emit DataConsolidated\n            creator.Scan(time.AddMinutes(4));\n\n            Assert.AreEqual(bar1.Symbol, quoteBar.Symbol);\n            Assert.AreEqual(time + TimeSpan.FromMinutes(4), quoteBar.EndTime);\n            Assert.AreEqual(TimeSpan.FromMinutes(2), quoteBar.Period);\n\n            // Bid\n            Assert.AreEqual(quoteBar.Bid.Open, bar1.Bid.Close);\n            // Ask\n            Assert.AreEqual(quoteBar.Ask.Open, bar2.Ask.Close);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new QuoteBarConsolidator(2);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = DateTime.Today;\n            return new List<QuoteBar>()\n            {\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 0.5m, 1.75m), Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m), LastBidSize = 10, LastAskSize = 0 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(0, 4, 0.4m, 3.75m), Ask = new Bar(2.3m, 9.4m, 2.3m, 4.5m), LastBidSize = 5, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(2, 2, 0.9m, 1.45m), Ask = new Bar(2.7m, 8.4m, 3.6m, 3.6m), LastBidSize = 8, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(2, 6, 2.5m, 5.55m), Ask = new Bar(3.2m, 6.4m, 2.3m, 5.3m), LastBidSize = 9, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 1.5m, 0.34m), Ask = new Bar(3.6m, 9.4m, 3.7m, 3.8m), LastBidSize = 5, LastAskSize = 8 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 1.1m, 0.75m), Ask = new Bar(3.8m, 8.4m, 7.3m, 5.3m), LastBidSize = 9, LastAskSize = 5 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(3, 3, 2.2m, 1.12m), Ask = new Bar(4.5m, 7.2m, 7.1m, 6.1m), LastBidSize = 6, LastAskSize = 3 },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/RangeConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class RangeConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void RangeConsolidatorReturnsExpectedValues()\n        {\n            using var consolidator = CreateRangeConsolidator(100);\n            var testValues = new List<decimal>() { 90m, 94.5m, 94m, 89.5m, 89m, 90.5m, 90m, 91.5m, 90m, 90.5m, 92.5m };\n            #pragma warning disable CS0618\n            var returnedBars = UpdateConsolidator(consolidator, testValues, \"IBM\");\n            #pragma warning restore CS0618\n\n            var expectedValues = GetRangeConsolidatorExpectedValues();\n            RangeBar lastRangeBar = null;\n            for (int index = 0; index < returnedBars.Count; index++)\n            {\n                var open = expectedValues[index][0];\n                var low = expectedValues[index][1];\n                var high = expectedValues[index][2];\n                var close = expectedValues[index][3];\n                var volume = expectedValues[index][4];\n\n                // Check RangeBar's values\n                Assert.AreEqual(open, returnedBars[index].Open);\n                Assert.AreEqual(low, returnedBars[index].Low);\n                Assert.AreEqual(high, returnedBars[index].High);\n                Assert.AreEqual(close, returnedBars[index].Close);\n                Assert.AreEqual(volume, returnedBars[index].Volume);\n\n                // Check the size of each RangeBar\n                Assert.AreEqual(1, Math.Round(returnedBars[index].High - returnedBars[index].Low, 2));\n\n                // Check the Open value of the current bar is outside last bar Low-High interval\n                if (lastRangeBar != null)\n                {\n                    Assert.IsTrue(returnedBars[index].Open < lastRangeBar.Low || returnedBars[index].Open > lastRangeBar.High);\n                }\n\n                lastRangeBar = returnedBars[index];\n            }\n        }\n\n        [TestCaseSource(nameof(PriceGapBehaviorIsTheExpectedOneTestCases))]\n        public virtual void PriceGapBehaviorIsTheExpectedOne(Symbol symbol, double minimumPriceVariation, double range)\n        {\n            using var consolidator = CreateRangeConsolidator((int)range);\n            var testValues = new List<decimal>() { 90m, 94.5m, 94m, 89.5m, 89m, 90.5m, 90m, 91.5m, 90m, 90.5m, 92.5m };\n            var returnedBars = UpdateConsolidator(consolidator, testValues, symbol);\n            RangeBar lastRangeBar = null;\n            for (int index = 0; index < returnedBars.Count; index++)\n            {\n                // Check the gap between each bar is of the size of the minimum price variation\n                if (lastRangeBar != null)\n                {\n                    Assert.IsTrue(returnedBars[index].Open == (lastRangeBar.High + (decimal)minimumPriceVariation) || returnedBars[index].Open == (lastRangeBar.Low - (decimal)minimumPriceVariation));\n                }\n                lastRangeBar = returnedBars[index];\n            }\n        }\n\n        [TestCaseSource(nameof(ConsolidatorCreatesExpectedBarsTestCases))]\n        public virtual void ConsolidatorCreatesExpectedBarsInDifferentScenarios(List<decimal> testValues, RangeBar[] expectedBars)\n        {\n            using var consolidator = CreateRangeConsolidator(100);\n            var returnedBars = UpdateConsolidator(consolidator, testValues, Symbols.IBM);\n\n            Assert.IsNotEmpty(returnedBars);\n            for (int index = 0; index < returnedBars.Count; index++)\n            {\n                Assert.AreEqual(expectedBars[index].Open, returnedBars[index].Open);\n                Assert.AreEqual(expectedBars[index].Low, returnedBars[index].Low);\n                Assert.AreEqual(expectedBars[index].High, returnedBars[index].High);\n                Assert.AreEqual(expectedBars[index].Close, returnedBars[index].Close);\n                Assert.AreEqual(expectedBars[index].Volume, returnedBars[index].Volume);\n                Assert.AreEqual(expectedBars[index].EndTime, returnedBars[index].EndTime);\n            }\n        }\n\n        [TestCase(new double[] { 94, 94.1, 94.2, 94.3, 94.4, 94.5, 94.6, 94.7, 94.8, 94.9, 95, 95.1 }, new double[] { 94, 95, 94, 95, 110 })]\n        [TestCase(new double[] { 94, 93.9, 93.8, 93.7, 93.6, 93.5, 93.4, 93.3, 93.2, 93.1, 93, 92.9 }, new double[] { 94, 94, 93, 93, 110 })]\n        [TestCase(new double[] { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95.1 }, new double[] { 94, 95, 94, 95, 160 })]\n        [TestCase(new double[] { 94, 93.9, 94.1, 93.8, 94.2, 93.7, 94.3, 93.6, 94.4, 93.5, 94.5, 93.4 }, new double[] { 94, 94.5, 93.5, 93.5, 110 })]\n        public void ConsolidatorUpdatesTheVolumeOfTheBarsAsExpected(double[] testValues, double[] expectedBar)\n        {\n            using var consolidator = CreateRangeConsolidator(100);\n            var returnedBars = UpdateConsolidator(consolidator, new List<decimal>(testValues.Select(x => (decimal)x)), Symbols.IBM);\n\n            Assert.AreEqual(1, returnedBars.Count);\n            Assert.AreEqual(expectedBar[0], returnedBars[0].Open);\n            Assert.AreEqual(expectedBar[1], returnedBars[0].High);\n            Assert.AreEqual(expectedBar[2], returnedBars[0].Low);\n            Assert.AreEqual(expectedBar[3], returnedBars[0].Close);\n            Assert.AreEqual(expectedBar[4], returnedBars[0].Volume);\n        }\n\n        protected virtual RangeConsolidator CreateRangeConsolidator(int range)\n        {\n            return new RangeConsolidator(range, x => x.Value, x => 10m);\n        }\n\n        private List<RangeBar> UpdateConsolidator(RangeConsolidator rangeConsolidator, List<decimal> testValues, Symbol symbol)\n        {\n            var time = new DateTime(2016, 1, 1);\n            using var consolidator = rangeConsolidator;\n            var returnedBars = new List<RangeBar>();\n\n            consolidator.DataConsolidated += (sender, rangeBar) =>\n            {\n                returnedBars.Add(rangeBar);\n            };\n\n            for (int i = 0; i < testValues.Count; i++)\n            {\n                var data = new IndicatorDataPoint(symbol, time.AddDays(i), testValues[i]);\n                consolidator.Update(data);\n            }\n\n            return returnedBars;\n        }\n\n        private static object[] ConsolidatorCreatesExpectedBarsTestCases = new object[]\n        {\n            new object[] { new List<decimal>(){ 90m, 94.5m }, new RangeBar[] {\n                new RangeBar{ Open = 90m, Low = 90m, High = 91m, Close = 91m, Volume = 10m,  EndTime = new DateTime(2016, 1, 2)},\n                new RangeBar{ Open = 91.01m, Low = 91.01m, High = 92.01m, Close = 92.01m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar{ Open = 92.02m, Low = 92.02m, High = 93.02m, Close = 93.02m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar{ Open = 93.03m, Low = 93.03m, High = 94.03m, Close = 94.03m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n            }},\n            new object[] { new List<decimal>(){ 94m, 89.5m }, new RangeBar[] {\n                new RangeBar { Open = 94m, Low = 93m, High = 94m, Close = 93m, Volume = 10m, EndTime = new DateTime(2016, 1, 2)},\n                new RangeBar { Open = 92.99m, Low = 91.99m, High = 92.99m, Close = 91.99m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 91.98m, Low = 90.98m, High = 91.98m, Close = 90.98m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 90.97m, Low = 89.97m, High = 90.97m, Close = 89.97m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) }\n            }},\n            new object[] { new List<decimal>{ 90m, 94.5m, 89.5m }, new RangeBar[] {\n                new RangeBar { Open = 90m, Low = 90m, High = 91m, Close = 91m, Volume = 10m , EndTime = new DateTime(2016, 1, 2)},\n                new RangeBar { Open = 91.01m, Low = 91.01m, High = 92.01m, Close = 92.01m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 92.02m, Low = 92.02m, High = 93.02m, Close = 93.02m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 93.03m, Low = 93.03m, High = 94.03m, Close = 94.03m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 94.04m, Low = 93.50m, High = 94.50m, Close = 93.50m, Volume = 10m, EndTime = new DateTime(2016, 1, 3)},\n                new RangeBar { Open = 93.49m, Low = 92.49m, High = 93.49m, Close = 92.49m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) },\n                new RangeBar { Open = 92.48m, Low = 91.48m, High = 92.48m, Close = 91.48m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) },\n                new RangeBar { Open = 91.47m, Low = 90.47m, High = 91.47m, Close = 90.47m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) }\n            }},\n            new object[] { new List<decimal>{ 94.5m, 89.5m, 94.5m }, new RangeBar[] {\n                new RangeBar { Open = 95m, Low = 94m, High = 95m, Close = 94m, Volume = 10m, EndTime = new DateTime(2016, 1, 2)},\n                new RangeBar { Open = 93.99m, Low = 92.99m, High = 93.99m, Close = 92.99m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 92.98m, Low = 91.98m, High = 92.98m, Close = 91.98m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 91.97m, Low = 90.97m, High = 91.97m, Close = 90.97m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 90.96m, Low = 89.96m, High = 90.96m, Close = 89.96m, Volume = 0m, EndTime = new DateTime(2016, 1, 2) },\n                new RangeBar { Open = 89.95m, Low = 89.50m, High = 90.50m, Close = 90.50m, Volume = 10m, EndTime = new DateTime(2016, 1, 3)},\n                new RangeBar { Open = 90.51m, Low = 90.51m, High = 91.51m, Close = 91.51m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) },\n                new RangeBar { Open = 91.52m, Low = 91.52m, High = 92.52m, Close = 92.52m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) },\n                new RangeBar { Open = 92.53m, Low = 92.53m, High = 93.53m, Close = 93.53m, Volume = 0m, EndTime = new DateTime(2016, 1, 3) },\n            }},\n            new object[] {new List<decimal> { 94m, 93.9m, 94.1m, 93.8m, 94.2m, 93.7m, 94.3m, 93.6m, 94.4m, 93.5m, 94.5m, 93.4m },\n            new RangeBar[]{ new RangeBar { Open = 94m, High = 94.5m, Low = 93.5m, Close = 93.5m, Volume = 110, EndTime = new DateTime(2016, 1, 12) } }},\n            new object[] {new List<decimal> { 94m, 94m, 94m, 94m, 94m, 95.1m },\n            new RangeBar[]{ new RangeBar { Open = 94m, High = 95m, Low = 94m, Close = 95m, Volume = 50, EndTime = new DateTime(2016, 1, 6) } }}\n        };\n\n        protected static object[] PriceGapBehaviorIsTheExpectedOneTestCases = new object[]\n        {\n            new object[] { Symbols.XAUUSD, 0.001, 1000},\n            new object[] { Symbols.XAGUSD, 0.00001, 100000},\n            new object[] { Symbols.DE30EUR, 0.1, 10},\n            new object[] { Symbols.XAUJPY, 1, 1}\n        };\n\n        protected virtual decimal[][] GetRangeConsolidatorExpectedValues()\n        {\n            return new decimal[][] {\n                    new decimal[]{ 90m, 90m, 91m, 91m, 10m },\n                    new decimal[]{ 91.01m, 91.01m, 92.01m, 92.01m, 0m },\n                    new decimal[]{ 92.02m, 92.02m, 93.02m, 93.02m, 0m },\n                    new decimal[]{ 93.03m, 93.03m, 94.03m, 94.03m, 0m },\n                    new decimal[]{ 94.04m, 93.5m, 94.5m, 93.5m, 20m},\n                    new decimal[]{ 93.49m, 92.49m, 93.49m, 92.49m, 0m},\n                    new decimal[]{ 92.48m, 91.48m, 92.48m, 91.48m, 0m},\n                    new decimal[]{ 91.47m, 90.47m, 91.47m, 90.47m, 0m},\n                    new decimal[]{ 90.46m, 89.46m, 90.46m, 89.46m, 10m},\n                    new decimal[]{ 89.45m, 89m, 90m, 90m, 10m},\n                    new decimal[]{ 90.01m, 90m, 91m, 91m, 20m},\n                    new decimal[]{ 91.01m, 90.5m, 91.5m, 90.5m, 10m},\n                    new decimal[]{ 90.49m, 90m, 91m, 91m, 20m},\n                    new decimal[]{ 91.01m, 91.01m, 92.01m, 92.01m, 0m }\n                };\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new RangeConsolidator(100);\n        }\n\n        protected override void AssertConsolidator(IDataConsolidator consolidator)\n        {\n            base.AssertConsolidator(consolidator);\n            Assert.AreEqual(0, ((RangeConsolidator)consolidator).RangeSize);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var testValues = new List<decimal>() { 90m, 94.5m, 94m, 89.5m, 89m, 90.5m, 90m, 91.5m, 90m, 90.5m, 92.5m };\n            var time = new DateTime(2016, 1, 1);\n            return new List<IndicatorDataPoint>()\n            {\n                new IndicatorDataPoint(time, 90m),\n                new IndicatorDataPoint(time.AddSeconds(1), 94.5m),\n                new IndicatorDataPoint(time.AddSeconds(2), 94m),\n                new IndicatorDataPoint(time.AddSeconds(3), 89.5m),\n                new IndicatorDataPoint(time.AddSeconds(4), 89m),\n                new IndicatorDataPoint(time.AddSeconds(5), 90.5m),\n                new IndicatorDataPoint(time.AddSeconds(6), 90m),\n                new IndicatorDataPoint(time.AddSeconds(7), 91.5m),\n                new IndicatorDataPoint(time.AddSeconds(8), 90m),\n                new IndicatorDataPoint(time.AddSeconds(9), 90.5m),\n                new IndicatorDataPoint(time.AddSeconds(10), 92.5m),\n                new IndicatorDataPoint(time.AddSeconds(11), 94.5m),\n                new IndicatorDataPoint(time.AddSeconds(12), 94m),\n                new IndicatorDataPoint(time.AddSeconds(13), 89.5m),\n                new IndicatorDataPoint(time.AddSeconds(14), 89m),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/RenkoConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class RenkoConsolidatorTests: BaseConsolidatorTests\n    {\n        [TestCase(0)]\n        [TestCase(-1)]\n        public void WickedRenkoConsolidatorFailsWhenBarSizeIsZero(double barSize)\n        {\n            var message = Assert.Throws<ArgumentException>( () => new RenkoConsolidator((decimal)barSize));\n            Assert.AreEqual(\"Renko consolidator BarSize must be strictly greater than zero\", message.Message);\n        }\n\n        [Test]\n        public void WickedOutputTypeIsRenkoBar()\n        {\n            using var consolidator = new RenkoConsolidator(10.0m);\n\n            Assert.AreEqual(typeof(RenkoBar), consolidator.OutputType);\n        }\n\n        [Test]\n        public void WickedNoFallingRenko()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 9.1m));\n\n            Assert.AreEqual(renkos.Count, 0);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.0m);\n            Assert.AreEqual(openRenko.Low, 9.1m);\n            Assert.AreEqual(openRenko.Close, 9.1m);\n        }\n\n        [Test]\n        public void WickedNoRisingRenko()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 10.9m));\n\n            Assert.AreEqual(renkos.Count, 0);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.9m);\n            Assert.AreEqual(openRenko.Low, 10.0m);\n            Assert.AreEqual(openRenko.Close, 10.9m);\n        }\n\n        [Test]\n        public void WickedNoFallingRenkoKissLimit()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 9.0m));\n\n            Assert.AreEqual(renkos.Count, 0);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.0m);\n            Assert.AreEqual(openRenko.Low, 9.0m);\n            Assert.AreEqual(openRenko.Close, 9.0m);\n        }\n\n        [Test]\n        public void WickedNoRisingRenkoKissLimit()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 11.0m));\n\n            Assert.AreEqual(renkos.Count, 0);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 11.0m);\n            Assert.AreEqual(openRenko.Low, 10.0m);\n            Assert.AreEqual(openRenko.Close, 11.0m);\n        }\n\n        [Test]\n        public void WickedOneFallingRenko()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 8.9m));\n\n            Assert.AreEqual(renkos.Count, 1);\n\n            Assert.AreEqual(renkos[0].Open, 10.0m);\n            Assert.AreEqual(renkos[0].High, 10.0m);\n            Assert.AreEqual(renkos[0].Low, 9.0m);\n            Assert.AreEqual(renkos[0].Close, 9.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n            Assert.AreEqual(renkos[0].Start, tickOn1);\n            Assert.AreEqual(renkos[0].EndTime, tickOn2);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Start, tickOn2);\n            Assert.AreEqual(openRenko.EndTime, tickOn2);\n            Assert.AreEqual(openRenko.Open, 9.0m);\n            Assert.AreEqual(openRenko.High, 9.0m);\n            Assert.AreEqual(openRenko.Low, 8.9m);\n            Assert.AreEqual(openRenko.Close, 8.9m);\n        }\n\n        [Test]\n        public void WickedOneRisingRenko()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 10.1m));\n\n            Assert.AreEqual(renkos.Count, 1);\n\n            Assert.AreEqual(renkos[0].Open, 9.0m);\n            Assert.AreEqual(renkos[0].High, 10.0m);\n            Assert.AreEqual(renkos[0].Low, 9.0m);\n            Assert.AreEqual(renkos[0].Close, 10.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n            Assert.AreEqual(renkos[0].Start, tickOn1);\n            Assert.AreEqual(renkos[0].EndTime, tickOn2);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Start, tickOn2);\n            Assert.AreEqual(openRenko.EndTime, tickOn2);\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.1m);\n            Assert.AreEqual(openRenko.Low, 10.0m);\n            Assert.AreEqual(openRenko.Close, 10.1m);\n        }\n\n        [Test]\n        public void WickedTwoFallingThenOneRisingRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.9m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.1m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.2m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 7.8m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 7.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.2m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.1m));\n\n            Assert.AreEqual(renkos.Count, 3);\n\n            Assert.AreEqual(renkos[0].Open, 10.0m);\n            Assert.AreEqual(renkos[0].High, 10.5m);\n            Assert.AreEqual(renkos[0].Low, 9.0m);\n            Assert.AreEqual(renkos[0].Close, 9.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[1].Open, 9.0m);\n            Assert.AreEqual(renkos[1].High, 9.2m);\n            Assert.AreEqual(renkos[1].Low, 8.0m);\n            Assert.AreEqual(renkos[1].Close, 8.0m);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[1].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[2].Open, 9.0m);\n            Assert.AreEqual(renkos[2].High, 10.0m);\n            Assert.AreEqual(renkos[2].Low, 7.6m);\n            Assert.AreEqual(renkos[2].Close, 10.0m);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[2].Spread, 1.0m);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.1m);\n            Assert.AreEqual(openRenko.Low, 10.0m);\n            Assert.AreEqual(openRenko.Close, 10.1m);\n        }\n\n        [Test]\n        public void WickedTwoRisingThenOneFallingRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.1m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.7m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.3m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.3m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.4m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.9m));\n\n            Assert.AreEqual(renkos.Count, 3);\n\n            Assert.AreEqual(renkos[0].Open, 10.0m);\n            Assert.AreEqual(renkos[0].High, 11.0m);\n            Assert.AreEqual(renkos[0].Low, 9.6m);\n            Assert.AreEqual(renkos[0].Close, 11.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[1].Open, 11.0m);\n            Assert.AreEqual(renkos[1].High, 12.0m);\n            Assert.AreEqual(renkos[1].Low, 10.7m);\n            Assert.AreEqual(renkos[1].Close, 12.0m);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[1].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[2].Open, 11.0m);\n            Assert.AreEqual(renkos[2].High, 12.4m);\n            Assert.AreEqual(renkos[2].Low, 10.0m);\n            Assert.AreEqual(renkos[2].Close, 10.0m);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[2].Spread, 1.0m);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 10.0m);\n            Assert.AreEqual(openRenko.High, 10.0m);\n            Assert.AreEqual(openRenko.Low, 9.9m);\n            Assert.AreEqual(openRenko.Close, 9.9m);\n        }\n\n        [Test]\n        public void WickedThreeRisingGapRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 14.0m));\n\n            Assert.AreEqual(renkos.Count, 3);\n\n            Assert.AreEqual(renkos[0].Start, tickOn1);\n            Assert.AreEqual(renkos[0].EndTime, tickOn2);\n            Assert.AreEqual(renkos[0].Open, 10.0m);\n            Assert.AreEqual(renkos[0].High, 11.0m);\n            Assert.AreEqual(renkos[0].Low, 10.0m);\n            Assert.AreEqual(renkos[0].Close, 11.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[1].Start, tickOn2);\n            Assert.AreEqual(renkos[1].EndTime, tickOn2);\n            Assert.AreEqual(renkos[1].Open, 11.0m);\n            Assert.AreEqual(renkos[1].High, 12.0m);\n            Assert.AreEqual(renkos[1].Low, 11.0m);\n            Assert.AreEqual(renkos[1].Close, 12.0m);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[1].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[2].Start, tickOn2);\n            Assert.AreEqual(renkos[2].EndTime, tickOn2);\n            Assert.AreEqual(renkos[2].Open, 12.0m);\n            Assert.AreEqual(renkos[2].High, 13.0m);\n            Assert.AreEqual(renkos[2].Low, 12.0m);\n            Assert.AreEqual(renkos[2].Close, 13.0m);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[2].Spread, 1.0m);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Start, tickOn2);\n            Assert.AreEqual(openRenko.EndTime, tickOn2);\n            Assert.AreEqual(openRenko.Open, 13.0m);\n            Assert.AreEqual(openRenko.High, 14.0m);\n            Assert.AreEqual(openRenko.Low, 13.0m);\n            Assert.AreEqual(openRenko.Close, 14.0m);\n        }\n\n        [Test]\n        public void WickedThreeFallingGapRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 14.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn2, 10.0m));\n\n            Assert.AreEqual(renkos.Count, 3);\n\n            Assert.AreEqual(renkos[0].Start, tickOn1);\n            Assert.AreEqual(renkos[0].EndTime, tickOn2);\n            Assert.AreEqual(renkos[0].Open, 14.0m);\n            Assert.AreEqual(renkos[0].High, 14.0m);\n            Assert.AreEqual(renkos[0].Low, 13.0m);\n            Assert.AreEqual(renkos[0].Close, 13.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[1].Start, tickOn2);\n            Assert.AreEqual(renkos[1].EndTime, tickOn2);\n            Assert.AreEqual(renkos[1].Open, 13.0m);\n            Assert.AreEqual(renkos[1].High, 13.0m);\n            Assert.AreEqual(renkos[1].Low, 12.0m);\n            Assert.AreEqual(renkos[1].Close, 12.0m);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[1].Spread, 1.0);\n\n            Assert.AreEqual(renkos[2].Start, tickOn2);\n            Assert.AreEqual(renkos[2].EndTime, tickOn2);\n            Assert.AreEqual(renkos[2].Open, 12.0m);\n            Assert.AreEqual(renkos[2].High, 12.0m);\n            Assert.AreEqual(renkos[2].Low, 11.0m);\n            Assert.AreEqual(renkos[2].Close, 11.0m);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[2].Spread, 1.0m);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 11.0m);\n            Assert.AreEqual(openRenko.High, 11.0m);\n            Assert.AreEqual(openRenko.Low, 10.0m);\n            Assert.AreEqual(openRenko.Close, 10.0m);\n        }\n\n        [Test]\n        public void WickedTwoFallingThenThreeRisingGapRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.9m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.1m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.2m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 7.8m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 7.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 8.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.2m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.1m));\n\n            Assert.AreEqual(renkos.Count, 5);\n\n            Assert.AreEqual(renkos[0].Open, 10.0m);\n            Assert.AreEqual(renkos[0].High, 10.5m);\n            Assert.AreEqual(renkos[0].Low, 9.0m);\n            Assert.AreEqual(renkos[0].Close, 9.0m);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[0].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[1].Open, 9.0m);\n            Assert.AreEqual(renkos[1].High, 9.2m);\n            Assert.AreEqual(renkos[1].Low, 8.0m);\n            Assert.AreEqual(renkos[1].Close, 8.0m);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[1].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[2].Open, 9.0m);\n            Assert.AreEqual(renkos[2].High, 10.0m);\n            Assert.AreEqual(renkos[2].Low, 7.6m);\n            Assert.AreEqual(renkos[2].Close, 10.0m);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[2].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[3].Open, 10.0m);\n            Assert.AreEqual(renkos[3].High, 11.0m);\n            Assert.AreEqual(renkos[3].Low, 10.0m);\n            Assert.AreEqual(renkos[3].Close, 11.0m);\n            Assert.AreEqual(renkos[3].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[3].Spread, 1.0m);\n\n            Assert.AreEqual(renkos[4].Open, 11.0m);\n            Assert.AreEqual(renkos[4].High, 12.0m);\n            Assert.AreEqual(renkos[4].Low, 11.0m);\n            Assert.AreEqual(renkos[4].Close, 12.0m);\n            Assert.AreEqual(renkos[4].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[4].Spread, 1.0m);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 12.0m);\n            Assert.AreEqual(openRenko.High, 12.1m);\n            Assert.AreEqual(openRenko.Low, 12.0m);\n            Assert.AreEqual(openRenko.Close, 12.1m);\n        }\n\n        [Test]\n        public void WickedTwoRisingThenThreeFallingGapRenkos()\n        {\n            using var consolidator = new TestRenkoConsolidator(1.0m);\n\n            var renkos = new List<RenkoBar>();\n\n            consolidator.DataConsolidated += (sender, renko) =>\n                renkos.Add(renko);\n\n            var tickOn1 = new DateTime(2016, 1, 1, 17, 0, 0, 0);\n            var tickOn2 = new DateTime(2016, 1, 1, 17, 0, 0, 1);\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 9.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.1m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.0m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 10.7m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.6m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.3m));\n\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.3m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 12.4m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 11.5m));\n            consolidator.Update(new IndicatorDataPoint(tickOn1, 7.9m));\n\n            Assert.AreEqual(renkos.Count, 5);\n\n            Assert.AreEqual(renkos[0].Open, 10.0);\n            Assert.AreEqual(renkos[0].High, 11.0);\n            Assert.AreEqual(renkos[0].Low, 9.6);\n            Assert.AreEqual(renkos[0].Close, 11.0);\n            Assert.AreEqual(renkos[0].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[0].Spread, 1.0);\n\n            Assert.AreEqual(renkos[1].Open, 11.0);\n            Assert.AreEqual(renkos[1].High, 12.0);\n            Assert.AreEqual(renkos[1].Low, 10.7);\n            Assert.AreEqual(renkos[1].Close, 12.0);\n            Assert.AreEqual(renkos[1].Direction, BarDirection.Rising);\n            Assert.AreEqual(renkos[1].Spread, 1.0);\n\n            Assert.AreEqual(renkos[2].Open, 11.0);\n            Assert.AreEqual(renkos[2].High, 12.4);\n            Assert.AreEqual(renkos[2].Low, 10.0);\n            Assert.AreEqual(renkos[2].Close, 10.0);\n            Assert.AreEqual(renkos[2].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[2].Spread, 1.0);\n\n            Assert.AreEqual(renkos[3].Open, 10.0);\n            Assert.AreEqual(renkos[3].High, 10.0);\n            Assert.AreEqual(renkos[3].Low, 9.0);\n            Assert.AreEqual(renkos[3].Close, 9.0);\n            Assert.AreEqual(renkos[3].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[3].Spread, 1.0);\n\n            Assert.AreEqual(renkos[4].Open, 9.0);\n            Assert.AreEqual(renkos[4].High, 9.0);\n            Assert.AreEqual(renkos[4].Low, 8.0);\n            Assert.AreEqual(renkos[4].Close, 8.0);\n            Assert.AreEqual(renkos[4].Direction, BarDirection.Falling);\n            Assert.AreEqual(renkos[4].Spread, 1.0);\n\n            var openRenko = consolidator.OpenRenko();\n\n            Assert.AreEqual(openRenko.Open, 8.0);\n            Assert.AreEqual(openRenko.High, 8.0);\n            Assert.AreEqual(openRenko.Low, 7.9);\n            Assert.AreEqual(openRenko.Close, 7.9);\n        }\n\n        [TestCase(new double[] {1.38687, 1.38688, 1.38687, 1.38686, 1.38685, 1.38683,\n                1.38682, 1.38682, 1.38684, 1.38682, 1.38682, 1.38680,\n                1.38681, 1.38686, 1.38688, 1.38688, 1.38690, 1.38690,\n                1.38691, 1.38692, 1.38694, 1.38695, 1.38697, 1.38697,\n                1.38700, 1.38699, 1.38699, 1.38699, 1.38698, 1.38699,\n                1.38697, 1.38698, 1.38698, 1.38697, 1.38698, 1.38698,\n                1.38697, 1.38697, 1.38700, 1.38702, 1.38701, 1.38699,\n                1.38697, 1.38698, 1.38696, 1.38698, 1.38697, 1.38695,\n                1.38695, 1.38696, 1.38693, 1.38692, 1.38693, 1.38693,\n                1.38692, 1.38693, 1.38692, 1.38690, 1.38686, 1.38685,\n                1.38687, 1.38686, 1.38686, 1.38686, 1.38686, 1.38685,\n                1.38684, 1.38678, 1.38679, 1.38680, 1.38680, 1.38681,\n                1.38685, 1.38685, 1.38683, 1.38682, 1.38682, 1.38683,\n                1.38682, 1.38683, 1.38682, 1.38681, 1.38680, 1.38681,\n                1.38681, 1.38681, 1.38682, 1.38680, 1.38679, 1.38678,\n                1.38675, 1.38678, 1.38678, 1.38678, 1.38682, 1.38681,\n                1.38682, 1.38680, 1.38682, 1.38683, 1.38685, 1.38683,\n                1.38683, 1.38684, 1.38683, 1.38683, 1.38684, 1.38685,\n                1.38684, 1.38683, 1.38686, 1.38685, 1.38685, 1.38684,\n                1.38685, 1.38682, 1.38684, 1.38683, 1.38682, 1.38683,\n                1.38685, 1.38685, 1.38685, 1.38683, 1.38685, 1.38684,\n                1.38686, 1.38693, 1.38695, 1.38693, 1.38694, 1.38693,\n                1.38692, 1.38693, 1.38695, 1.38697, 1.38698, 1.38695,\n                1.38696}, 0.0001)]\n        [TestCase(new double[] {90.38687, 12.38688, 33.38687, 69.38686, 22.38685, 19.38683,\n                19.38682, 51.38682, 12.38684, 41.38682, 47.38682, 30.38680,\n                81.38681, 16.38686, 21.38688, 14.38688, 89.38690, 72.38690,\n                71.38691, 71.38692, 3.38694, 71.38695, 50.38697, 97.38697,\n                16.38700, 18.38699, 14.38699, 91.38699, 60.38698, 35.38699,\n                51.38697, 91.38698, 41.38698, 21.38697, 44.38698, 35.38698,\n                14.38697, 10.38697, 5.38700, 1.38702, 1.38701, 15.38699,\n                31.38697, 11.38698, 16.38696, 21.38698, 16.38697, 19.38695,\n                12.38695, 21.38696, 61.38693, 32.38692, 20.38693, 23.38693,\n                11.38692, 13.38693, 7.38692, 16.38690, 30.38686, 34.38685,\n                91.38687, 41.38686, 18.38686, 12.38686, 40.38686, 44.38685,\n                18.38684, 15.38678, 81.38679, 19.38680, 32.38680, 37.38681,\n                71.38685, 61.38685, 9.38683, 21.38682, 27.38682, 28.38683,\n                16.38682, 17.38683, 0.38682, 81.38681, 60.38680, 65.38681,\n                51.38681, 81.38681, 11.38682, 81.38680, 60.38679, 65.38678,\n                41.38675, 19.38678, 11.38678, 51.38678, 25.38682, 30.38681,\n                13.38682, 1.38680, 2.38682, 51.38683, 47.38685, 55.38683,\n                21.38683, 11.38684, 13.38683, 81.38683, 70.38684, 75.38685,\n                11.38684, 21.38683, 31.38686, 91.38685, 87.38685, 92.38684,\n                10.38685, 13.38682, 4.38684, 21.38683, 29.38682, 34.38683,\n                19.38685, 41.38685, 51.38685, 12.38683, 28.38685, 34.38684,\n                81.38686, 15.38693, 15.38695, 1.38693, 8.38694, 13.38693,\n                17.38692, 61.38693, 6.38695, 13.38697, 4.38698, 9.38695,\n                61.38696}, 5)]\n        public void ConsistentRenkos(double[] values, double barSize)\n        {\n            // Reproduce issue #5479\n            // Test Renko bar consistency amongst three consolidators starting at different times\n\n            var time = new DateTime(2016, 1, 1);\n            var testValues = new List<decimal> (values.Select(x => (decimal)x));\n\n\n            var consolidator1 = new RenkoConsolidator((decimal)barSize);\n            var consolidator2 = new RenkoConsolidator((decimal)barSize);\n            var consolidator3 = new RenkoConsolidator((decimal)barSize);\n\n            // Update each of our consolidators starting at different indexes of test values\n            for (int i = 0; i < testValues.Count; i++)\n            {\n                var data = new IndicatorDataPoint(time.AddSeconds(i), testValues[i]);\n                consolidator1.Update(data);\n\n                if (i > 10)\n                {\n                    consolidator2.Update(data);\n                }\n\n                if (i > 20)\n                {\n                    consolidator3.Update(data);\n                }\n            }\n\n            // Assert that consolidator 2 and 3 price is the same as 1. Even though they started at different\n            // indexes they should be the same\n            var bar1 = consolidator1.Consolidated as RenkoBar;\n            var bar2 = consolidator2.Consolidated as RenkoBar;\n            var bar3 = consolidator3.Consolidated as RenkoBar;\n\n            Assert.AreEqual(bar1.Close, bar2.Close);\n            Assert.AreEqual(bar1.Close, bar3.Close);\n\n            consolidator1.Dispose();\n            consolidator2.Dispose();\n            consolidator3.Dispose();\n        }\n\n        [TestCase(12.38684, 0.0001, 12.3868)]\n        [TestCase(12.38686, 0.0001, 12.3869)]\n        [TestCase(3.38694, 0.001, 3.387)]\n        [TestCase(3.38644, 0.001, 3.386)]\n        [TestCase(41.38698, 0.01, 41.39)]\n        [TestCase(41.38498, 0.01, 41.38)]\n        [TestCase(16.38696, 0.1, 16.4)]\n        [TestCase(16.32696, 0.1, 16.3)]\n        [TestCase(7.38692, 1, 7)]\n        [TestCase(7.78692, 1, 8)]\n        [TestCase(81.38679, 10, 80)]\n        [TestCase(88.38679, 10, 90)]\n        [TestCase(1247.38682, 100, 1200)]\n        [TestCase(1257.38682, 100, 1300)]\n        [TestCase(44500.2349, 1000, 45000)]\n        [TestCase(44300.2349, 1000, 44000)]\n        public void GetClosestMultipleWorksAsExpected(double price, double barSize, double expectedClosestMultiple)\n        {\n            Assert.AreEqual((decimal)expectedClosestMultiple, RenkoConsolidator.GetClosestMultiple((decimal)price, (decimal)barSize));\n        }\n\n        [TestCase(0)]\n        [TestCase(-1)]\n        public void GetClosestMultipleFailsWhenBarSizeIsLessThanZero(double barSize)\n        {\n            var message = Assert.Throws<ArgumentException>(() => RenkoConsolidator.GetClosestMultiple((decimal)34.78989, (decimal)barSize));\n            Assert.AreEqual(\"BarSize must be strictly greater than zero\", message.Message);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new TestRenkoConsolidator(1m);\n        }\n\n        protected override void AssertConsolidator(IDataConsolidator consolidator)\n        {\n            base.AssertConsolidator(consolidator);\n            var renkoConsolidator = consolidator as TestRenkoConsolidator;\n            var renkoBar = renkoConsolidator.OpenRenko();\n\n            Assert.AreEqual(0, renkoBar.Open);\n            Assert.AreEqual(0, renkoBar.Close);\n            Assert.AreEqual(0, renkoBar.High);\n            Assert.AreEqual(0, renkoBar.Low);\n            Assert.AreEqual(default(DateTime), renkoBar.Start);\n            Assert.AreEqual(default(DateTime), renkoBar.End);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2016, 3, 1);\n            return new List<IndicatorDataPoint>()\n            {\n                new IndicatorDataPoint(time, 10.0m),\n                new IndicatorDataPoint(time.AddSeconds(1), 9.6m),\n                new IndicatorDataPoint(time.AddSeconds(2), 10.5m),\n                new IndicatorDataPoint(time.AddSeconds(3), 11.1m),\n                new IndicatorDataPoint(time.AddSeconds(4), 11.0m),\n                new IndicatorDataPoint(time.AddSeconds(5), 10.7m),\n                new IndicatorDataPoint(time.AddSeconds(6), 11.6m),\n                new IndicatorDataPoint(time.AddSeconds(7), 12.3m),\n                new IndicatorDataPoint(time.AddSeconds(8), 12.3m),\n                new IndicatorDataPoint(time.AddSeconds(9), 12.4m),\n                new IndicatorDataPoint(time.AddSeconds(10), 11.5m),\n                new IndicatorDataPoint(time.AddSeconds(11), 7.9m),\n                new IndicatorDataPoint(time.AddSeconds(12), 7.9m)\n            };\n        }\n\n        private class TestRenkoConsolidator : RenkoConsolidator\n        {\n            public TestRenkoConsolidator(decimal barSize)\n                : base(barSize)\n            {\n            }\n\n            public RenkoBar OpenRenko()\n            {\n                return new RenkoBar(null, OpenOn, CloseOn, BarSize, OpenRate, HighRate, LowRate, CloseRate);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/SequentialConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class SequentialConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void SequentialConsolidatorsFiresAllEvents()\n        {\n            using var first = new IdentityDataConsolidator<IBaseData>();\n            using var second = new IdentityDataConsolidator<IBaseData>();\n            using var sequential = new SequentialConsolidator(first, second);\n\n            bool firstFired = false;\n            bool secondFired = false;\n            bool sequentialFired = false;\n\n            first.DataConsolidated += (sender, consolidated) =>\n            {\n                firstFired = true;\n            };\n\n            second.DataConsolidated += (sender, consolidated) =>\n            {\n                secondFired = true;\n            };\n\n            sequential.DataConsolidated += (sender, consolidated) =>\n            {\n                sequentialFired = true;\n            };\n\n            sequential.Update(new TradeBar());\n\n            Assert.IsTrue(firstFired);\n            Assert.IsTrue(secondFired);\n            Assert.IsTrue(sequentialFired);\n        }\n\n        [Test]\n        public void SequentialConsolidatorAcceptsSubTypesForSecondInputType()\n        {\n            using var first = new IdentityDataConsolidator<TradeBar>();\n            using var second = new IdentityDataConsolidator<IBaseData>();\n            using var sequential = new SequentialConsolidator(first, second);\n\n\n            bool firstFired = false;\n            bool secondFired = false;\n            bool sequentialFired = false;\n\n            first.DataConsolidated += (sender, consolidated) =>\n            {\n                firstFired = true;\n            };\n\n            second.DataConsolidated += (sender, consolidated) =>\n            {\n                secondFired = true;\n            };\n\n            sequential.DataConsolidated += (sender, consolidated) =>\n            {\n                sequentialFired = true;\n            };\n\n            sequential.Update(new TradeBar());\n\n            Assert.IsTrue(firstFired);\n            Assert.IsTrue(secondFired);\n            Assert.IsTrue(sequentialFired);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            var first = new IdentityDataConsolidator<IndicatorDataPoint>();\n            var second = new IdentityDataConsolidator<IndicatorDataPoint>();\n            return new SequentialConsolidator(first, second);\n        }\n\n        protected override void AssertConsolidator(IDataConsolidator consolidator)\n        {\n            base.AssertConsolidator(consolidator);\n            var sequentialConsolidator = consolidator as SequentialConsolidator;\n            Assert.IsNull(sequentialConsolidator.First.Consolidated);\n            Assert.IsNull(sequentialConsolidator.Second.Consolidated);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/SessionConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Common.Data.Consolidators;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class SessionConsolidatorTests\n    {\n        [Test]\n        public void CalculatesOHLCVRespectingMarketHours()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(TickType.Trade);\n\n            var date = new DateTime(2025, 8, 25);\n\n            var tradeBar1 = new TradeBar(date.AddHours(12), symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1));\n            var tradeBar2 = new TradeBar(date.AddHours(13), symbol, 101, 102, 100, 101.5m, 1100, TimeSpan.FromHours(1));\n            var tradeBar3 = new TradeBar(date.AddHours(14), symbol, 102, 103, 101, 102.5m, 1200, TimeSpan.FromHours(1));\n            consolidator.Update(tradeBar1);\n            consolidator.Update(tradeBar2);\n            consolidator.Update(tradeBar3);\n\n            var eventTime = new DateTime(2025, 8, 26, 0, 0, 0);\n            // This should fire the scan, because is the end of the day\n            consolidator.ValidateAndScan(eventTime);\n\n            Assert.IsNotNull(consolidator.Consolidated);\n            var consolidated = (SessionBar)consolidator.Consolidated;\n            Assert.AreEqual(100, consolidated.Open);\n            Assert.AreEqual(103, consolidated.High);\n            Assert.AreEqual(99, consolidated.Low);\n            Assert.AreEqual(102.5, consolidated.Close);\n            Assert.AreEqual(3300, consolidated.Volume);\n        }\n\n        [Test]\n        public void TracksOpenInterestFromOpenInterestTicks()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(TickType.Quote);\n\n            var date = new DateTime(2025, 8, 25);\n\n            var openInterest = new Tick(date.AddHours(12), symbol, 5);\n            var tick1 = new Tick(date.AddHours(12), symbol, 100, 101);\n            var tick2 = new Tick(date.AddHours(13), symbol, 101, 102);\n            var tick3 = new Tick(date.AddHours(14), symbol, 102, 103);\n\n            consolidator.Update(openInterest);\n            consolidator.Update(tick1);\n            consolidator.Update(tick2);\n            consolidator.Update(tick3);\n\n            var workingData = (SessionBar)consolidator.WorkingData;\n            Assert.AreEqual(5, workingData.OpenInterest);\n            Assert.AreEqual(0, workingData.Volume);\n            Assert.AreEqual(100.5, workingData.Open);\n            Assert.AreEqual(102.5, workingData.High);\n            Assert.AreEqual(100.5, workingData.Low);\n            Assert.AreEqual(102.5, workingData.Close);\n        }\n\n        [Test]\n        public void AccumulatesVolumeFromTradeBarsAndTradeTicksCorrectly()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(TickType.Quote);\n\n            var date = new DateTime(2025, 8, 25);\n\n            // QuoteBars will be processed normally\n            var quoteBar1 = new QuoteBar(date.AddHours(11), symbol, new Bar(100, 101, 100, 101), 0, new Bar(101, 102, 100, 101), 0);\n            var quoteBar2 = new QuoteBar(date.AddHours(12), symbol, new Bar(100, 101, 100, 101), 0, new Bar(101, 102, 100, 101), 0);\n            consolidator.Update(quoteBar1);\n            consolidator.Update(quoteBar2);\n\n            // We will handle the volume manually for trade bars and ticks(trade)\n\n            // We will take the volume (1000) from the trade bar\n            var tradeBar = new TradeBar(date.AddHours(13), symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1));\n            consolidator.Update(tradeBar);\n            // We will take the quantity (500) from the tick\n            var tick1 = new Tick(date.AddHours(14), symbol, \"\", \"\", 500, 5);\n            consolidator.Update(tick1);\n\n            var workingData = (SessionBar)consolidator.WorkingData;\n            Assert.AreEqual(1500, workingData.Volume);\n            Assert.AreEqual(100.5, workingData.Open);\n            Assert.AreEqual(101.5, workingData.High);\n            Assert.AreEqual(100, workingData.Low);\n            Assert.AreEqual(101, workingData.Close);\n        }\n\n        [Test]\n        public void AccumulatesVolumeCorrectlyAfterReset()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(TickType.Quote);\n\n            var date = new DateTime(2025, 8, 25, 0, 0, 0);\n\n            // Resolution = Hour, accumulates normally\n            var tradeBar1 = new TradeBar(date.AddHours(12), symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1));\n            var tradeBar2 = new TradeBar(date.AddHours(13), symbol, 101, 102, 100, 101.5m, 1100, TimeSpan.FromHours(1));\n            consolidator.Update(tradeBar1);\n            consolidator.Update(tradeBar2);\n\n            Assert.AreEqual(2100, ((SessionBar)consolidator.WorkingData).Volume);\n\n            consolidator.Reset();\n\n            tradeBar1 = new TradeBar(date.AddHours(12), symbol, 100, 101, 99, 100.5m, 2000, TimeSpan.FromMinutes(1));\n            tradeBar2 = new TradeBar(date.AddHours(12).AddMinutes(1), symbol, 101, 102, 100, 101.5m, 3000, TimeSpan.FromMinutes(1));\n\n            consolidator.Update(tradeBar1);\n            consolidator.Update(tradeBar2);\n\n            Assert.AreEqual(5000, ((SessionBar)consolidator.WorkingData).Volume);\n        }\n\n        [Test]\n        public void PreservesSymbolAfterConsolidation()\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(TickType.Trade);\n\n            var date = new DateTime(2025, 8, 25);\n            var tradeBar = new TradeBar(date.AddHours(12), symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1));\n            consolidator.Update(tradeBar);\n            Assert.AreEqual(symbol, consolidator.WorkingData.Symbol);\n\n            var eventTime = new DateTime(2025, 8, 26, 0, 0, 0);\n            // This should fire the scan, because is the end of the day\n            consolidator.ValidateAndScan(eventTime);\n            Assert.AreEqual(symbol, consolidator.Consolidated.Symbol);\n        }\n\n        [TestCase(TickType.Trade, Resolution.Tick, Resolution.Second)]\n        [TestCase(TickType.Trade, Resolution.Tick, Resolution.Minute)]\n        [TestCase(TickType.Trade, Resolution.Tick, Resolution.Hour)]\n        [TestCase(TickType.Trade, Resolution.Second, Resolution.Minute)]\n        [TestCase(TickType.Trade, Resolution.Second, Resolution.Hour)]\n        [TestCase(TickType.Trade, Resolution.Minute, Resolution.Hour)]\n        [TestCase(TickType.Quote, Resolution.Tick, Resolution.Second)]\n        [TestCase(TickType.Quote, Resolution.Tick, Resolution.Minute)]\n        [TestCase(TickType.Quote, Resolution.Tick, Resolution.Hour)]\n        [TestCase(TickType.Quote, Resolution.Second, Resolution.Minute)]\n        [TestCase(TickType.Quote, Resolution.Second, Resolution.Hour)]\n        [TestCase(TickType.Quote, Resolution.Minute, Resolution.Hour)]\n        public void IgnoresOverlappingHigherResolutionData(TickType tickType, Resolution firstResolution, Resolution secondResolution)\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(tickType);\n\n\n            var currentTime = new DateTime(2025, 8, 25, 11, 0, 0);\n\n            var dataDictionary = new Dictionary<(TickType, Resolution), BaseData>\n            {\n                { (TickType.Trade, Resolution.Tick), new Tick(currentTime, symbol, \"\", \"\", 600, 15) },\n                { (TickType.Quote, Resolution.Tick), new Tick(currentTime, symbol, 100, 101) },\n                { (TickType.Trade, Resolution.Second), new TradeBar(currentTime, symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromSeconds(1)) },\n                { (TickType.Quote, Resolution.Second), new QuoteBar(currentTime, symbol, new Bar(300, 301, 300, 301), 0, new Bar(300, 301, 300, 301), 0, TimeSpan.FromSeconds(1)) },\n                { (TickType.Trade, Resolution.Minute), new TradeBar(currentTime, symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromMinutes(1)) },\n                { (TickType.Quote, Resolution.Minute), new QuoteBar(currentTime, symbol, new Bar(300, 301, 300, 301), 0, new Bar(300, 301, 300, 301), 0, TimeSpan.FromMinutes(1)) },\n                { (TickType.Trade, Resolution.Hour), new TradeBar(currentTime, symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1)) },\n                { (TickType.Quote, Resolution.Hour), new QuoteBar(currentTime, symbol, new Bar(300, 301, 300, 301), 0, new Bar(300, 301, 300, 301), 0, TimeSpan.FromHours(1)) }\n            };\n\n            // First update with lower-resolution data (should be accepted)\n            var firstData = dataDictionary[(tickType, firstResolution)];\n            firstData.Time = currentTime.AddTicks(1);\n            consolidator.Update(firstData);\n\n            var workingData = (SessionBar)consolidator.WorkingData;\n            var currentTimeAfterFirstUpdate = workingData.Time;\n\n            // Second update with higher-resolution overlapping data (should be ignored)\n            var secondData = dataDictionary[(tickType, secondResolution)];\n            consolidator.Update(secondData);\n\n            workingData = (SessionBar)consolidator.WorkingData;\n            var currentTimeAfterSecondUpdate = workingData.Time;\n\n            // Verify that the higher-resolution update did not overwrite the current session state\n            Assert.AreEqual(currentTimeAfterFirstUpdate, currentTimeAfterSecondUpdate);\n        }\n\n        [TestCase(TickType.Trade, true)]\n        [TestCase(TickType.Trade, false)]\n        [TestCase(TickType.Quote, true)]\n        [TestCase(TickType.Quote, false)]\n        public void ConsolidateUsingBars(TickType tickType, bool isTick)\n        {\n            var symbol = Symbols.SPY;\n            using var consolidator = GetConsolidator(tickType);\n\n            var date = new DateTime(2025, 8, 25, 9, 0, 0);\n\n            var tradeBars = new List<TradeBar>\n            {\n                new TradeBar(date, symbol, 100, 101, 99, 100.5m, 1000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(1), symbol, 200, 201, 199, 200.5m, 2000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(2), symbol, 300, 301, 299, 300.5m, 3000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(3), symbol, 400, 401, 399, 400.5m, 4000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(4), symbol, 500, 501, 499, 500.5m, 5000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(5), symbol, 600, 601, 599, 600.5m, 6000, TimeSpan.FromHours(1)),\n                new TradeBar(date.AddHours(6), symbol, 700, 701, 699, 700.5m, 7000, TimeSpan.FromHours(1))\n            };\n\n            var tradeTicks = new List<Tick>\n            {\n                new Tick(date.AddHours(1), symbol, \"\", \"\", 600, 15),\n                new Tick(date.AddHours(2), symbol, \"\", \"\", 700, 25),\n                new Tick(date.AddHours(3), symbol, \"\", \"\", 800, 35),\n                new Tick(date.AddHours(4), symbol, \"\", \"\", 900, 45),\n                new Tick(date.AddHours(5), symbol, \"\", \"\", 1000, 55),\n                new Tick(date.AddHours(6), symbol, \"\", \"\", 1100, 65),\n                new Tick(date.AddHours(7), symbol, \"\", \"\", 1200, 75)\n            };\n\n            var quoteBars = new List<QuoteBar>\n            {\n                new QuoteBar(date, symbol, new Bar(100, 101, 100, 101), 0, new Bar(100, 101, 100, 101), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(1), symbol, new Bar(200, 201, 200, 201), 0, new Bar(200, 201, 200, 201), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(2), symbol, new Bar(300, 301, 300, 301), 0, new Bar(300, 301, 300, 301), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(3), symbol, new Bar(400, 401, 400, 401), 0, new Bar(400, 401, 400, 401), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(4), symbol, new Bar(500, 501, 500, 501), 0, new Bar(500, 501, 500, 501), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(5), symbol, new Bar(600, 601, 600, 601), 0, new Bar(600, 601, 600, 601), 0, TimeSpan.FromHours(1)),\n                new QuoteBar(date.AddHours(6), symbol, new Bar(700, 701, 700, 701), 0, new Bar(700, 701, 700, 701), 0, TimeSpan.FromHours(1))\n            };\n\n            var quoteTicks = new List<Tick>\n            {\n                new Tick(date.AddHours(1), symbol, 100, 101),\n                new Tick(date.AddHours(2), symbol, 200, 201),\n                new Tick(date.AddHours(3), symbol, 300, 301),\n                new Tick(date.AddHours(4), symbol, 400, 401),\n                new Tick(date.AddHours(5), symbol, 500, 501),\n                new Tick(date.AddHours(6), symbol, 600, 601),\n                new Tick(date.AddHours(7), symbol, 700, 701)\n            };\n\n            var dataToUpdate = tickType == TickType.Trade\n                ? (isTick ? tradeTicks.Cast<BaseData>() : tradeBars.Cast<BaseData>())\n                : (isTick ? quoteTicks.Cast<BaseData>() : quoteBars.Cast<BaseData>());\n\n            foreach (var data in dataToUpdate)\n            {\n                consolidator.Update(data);\n            }\n\n\n            var eventTime = new DateTime(2025, 8, 26, 0, 0, 0);\n            // This should fire the scan, because is the end of the day\n            consolidator.ValidateAndScan(eventTime);\n\n            Assert.IsNotNull(consolidator.Consolidated);\n            var consolidated = (SessionBar)consolidator.Consolidated;\n\n            var (expectedOpen, expectedHigh, expectedLow, expectedClose, expectedVolume) =\n                (tickType, isTick) switch\n                {\n                    (TickType.Trade, true) => (15m, 65m, 15m, 65m, 5100L),\n                    (TickType.Trade, false) => (100m, 701m, 99m, 700.5m, 28000L),\n                    (TickType.Quote, true) => (100.5m, 600.5m, 100.5m, 600.5m, 0L),\n                    (TickType.Quote, false) => (100m, 701m, 100m, 701m, 0L),\n                    _ => throw new NotImplementedException()\n                };\n\n            Assert.AreEqual(expectedOpen, consolidated.Open);\n            Assert.AreEqual(expectedHigh, consolidated.High);\n            Assert.AreEqual(expectedLow, consolidated.Low);\n            Assert.AreEqual(expectedClose, consolidated.Close);\n            Assert.AreEqual(expectedVolume, consolidated.Volume);\n        }\n\n        private static SessionConsolidator GetConsolidator(TickType tickType)\n        {\n            var symbol = Symbols.SPY;\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            return new SessionConsolidator(exchangeHours, tickType, symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/Shortable/ShortableProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Shortable;\n\nnamespace QuantConnect.Tests.Common.Data.Shortable\n{\n    [TestFixture]\n    public class ShortableProviderTests\n    {\n        private readonly Dictionary<string, Dictionary<Symbol, ShortableData>[]> _resultsByBrokerage = new();\n        private Symbol[] _symbols;\n        \n        [SetUp]\n        public void SetupConfig()\n        {\n            Config.Set(\"data-folder\", \"TestData\");\n            Globals.Reset();\n\n            _symbols = new[] { \"AAPL\", \"GOOG\", \"BAC\" }\n               .Select(x => new Symbol(SecurityIdentifier.GenerateEquity(x, QuantConnect.Market.USA, mappingResolveDate: new DateTime(2021, 1, 4)), x))\n               .ToArray();\n\n            _resultsByBrokerage[\"testinteractivebrokers\"] = new[]\n            {\n                new Dictionary<Symbol, ShortableData>\n                {\n                    { _symbols[0], new(2000, 0.0507m, 0.0025m) },\n                    { _symbols[1], new(5000, 0.0517m, 0.0035m) },\n                    { _symbols[2], new(null, 0, 0) } // we have no data for this symbol\n                },\n                new Dictionary<Symbol, ShortableData>\n                {\n                    { _symbols[0], new(4000, 0.0509m, 0.003m) },\n                    { _symbols[1], new(10000, 0.0519m, 0.004m) },\n                    { _symbols[2], new(null, 0, 0) } // we have no data for this symbol\n                }\n            };\n\n            _resultsByBrokerage[\"testbrokerage\"] = new[]\n{\n                new Dictionary<Symbol, ShortableData>\n                {\n                    { _symbols[0], new(2000, 0, 0) },\n                    { _symbols[1], new(5000, 0, 0) },\n                    { _symbols[2], new(null, 0, 0) } // we have no data for this symbol\n                },\n                new Dictionary<Symbol, ShortableData>\n                {\n                    { _symbols[0], new(4000, 0, 0) },\n                    { _symbols[1], new(10000, 0, 0) },\n                    { _symbols[2], new(null, 0, 0) } // we have no data for this symbol\n                }\n            };\n        }\n\n        [TearDown]\n        public void ResetConfig()\n        {\n            Config.Reset();\n            Globals.Reset();\n        }\n        \n        [TestCase(\"testbrokerage\")]\n        [TestCase(\"testinteractivebrokers\")]\n        public void LocalDiskShortableProviderGetsDataBySymbol(string brokerage)\n        {\n            var shortableProvider = new LocalDiskShortableProvider(brokerage);\n            var results = _resultsByBrokerage[brokerage];\n\n            var dates = new[]\n            {\n                new DateTime(2020, 12, 21),\n                new DateTime(2020, 12, 22)\n            };\n\n            foreach (var symbol in _symbols)\n            {\n                for (var i = 0; i < dates.Length; i++)\n                {\n                    var date = dates[i];\n                    var shortableQuantity = shortableProvider.ShortableQuantity(symbol, date);\n                    var rebateRate = shortableProvider.RebateRate(symbol, date);\n                    var feeRate = shortableProvider.FeeRate(symbol, date);\n\n                    Assert.AreEqual(results[i][symbol].ShortableQuantity, shortableQuantity);\n                    Assert.AreEqual(results[i][symbol].RebateRate, rebateRate);\n                    Assert.AreEqual(results[i][symbol].FeeRate, feeRate);\n                }\n            }\n        }\n\n        [TestCase(\"AAPL\", \"nobrokerage\")]\n        [TestCase(\"SPY\", \"testbrokerage\")]\n        public void LocalDiskShortableProviderDefaultsToNullForMissingData(string ticker, string brokerage)\n        {\n            var provider = new LocalDiskShortableProvider(brokerage);\n            var date = new DateTime(2020, 12, 21);\n            var symbol = new Symbol(SecurityIdentifier.GenerateEquity(ticker, QuantConnect.Market.USA, mappingResolveDate: date), ticker);\n\n            Assert.IsFalse(provider.ShortableQuantity(symbol, date).HasValue);\n            Assert.AreEqual(0, provider.RebateRate(symbol, date));\n            Assert.AreEqual(0, provider.FeeRate(symbol, date));\n        }\n\n        private record ShortableData(long? ShortableQuantity, decimal RebateRate, decimal FeeRate);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/SliceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class SliceTests\n    {\n        private readonly DateTime _dataTime = DateTime.UtcNow;\n\n        [Test]\n        public void AccessesByDataType()\n        {\n            var now = DateTime.UtcNow;\n            var tradeBar = new TradeBar { Symbol = Symbols.SPY, Time = now };\n            var unlinkedData = new UnlinkedData { Symbol = Symbols.SPY, Time = now };\n            var quoteBar = new QuoteBar { Symbol = Symbols.SPY, Time = now };\n            var tick = new Tick(now, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var openInterest = new OpenInterest(now, Symbols.SPY, 1);\n            var split = new Split(Symbols.SPY, now, 1, 1, SplitType.SplitOccurred);\n            var delisting = new Delisting(Symbols.SPY, now, 1, DelistingType.Delisted);\n            var marginInterest = new MarginInterestRate { Symbol = Symbols.SPY, Time = now, InterestRate = 0.08m };\n\n            var slice = new Slice(now, new BaseData[] { quoteBar, tradeBar, unlinkedData, tick, split, delisting, openInterest, marginInterest }, now);\n\n            Assert.AreEqual(slice.Get(typeof(TradeBar))[Symbols.SPY], tradeBar);\n            Assert.AreEqual(slice.Get(typeof(UnlinkedData))[Symbols.SPY], unlinkedData);\n            Assert.AreEqual(slice.Get(typeof(QuoteBar))[Symbols.SPY], quoteBar);\n            Assert.AreEqual(slice.Get(typeof(Tick))[Symbols.SPY], tick);\n            Assert.AreEqual(slice.Get(typeof(Split))[Symbols.SPY], split);\n            Assert.AreEqual(slice.Get(typeof(Delisting))[Symbols.SPY], delisting);\n            Assert.AreEqual(slice.Get(typeof(OpenInterest))[Symbols.SPY], openInterest);\n            Assert.AreEqual(slice.Get(typeof(MarginInterestRate))[Symbols.SPY], marginInterest);\n        }\n\n        [Test]\n        public void AccessesByDataTypeAndSymbol()\n        {\n            var now = DateTime.UtcNow;\n            var tradeBar = new TradeBar { Symbol = Symbols.SPY, Time = now };\n            var unlinkedData = new UnlinkedData { Symbol = Symbols.SPY, Time = now };\n            var quoteBar = new QuoteBar { Symbol = Symbols.SPY, Time = now };\n            var tick = new Tick(now, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var openInterest = new OpenInterest(now, Symbols.SPY, 1);\n            var split = new Split(Symbols.SPY, now, 1, 1, SplitType.SplitOccurred);\n            var delisting = new Delisting(Symbols.SPY, now, 1, DelistingType.Delisted);\n            var marginInterest = new MarginInterestRate { Symbol = Symbols.SPY, Time = now, InterestRate = 0.08m };\n\n            var slice = new Slice(now, new BaseData[] { quoteBar, tradeBar, unlinkedData, tick, split, delisting, openInterest, marginInterest }, now);\n\n            {\n                Assert.IsTrue(slice.TryGet<TradeBar>(Symbols.SPY, out var foundTradeBar));\n                Assert.AreEqual(foundTradeBar, tradeBar);\n                Assert.IsTrue(slice.TryGet<UnlinkedData>(Symbols.SPY, out var foundUnlinkedData));\n                Assert.AreEqual(foundUnlinkedData, unlinkedData);\n                Assert.IsTrue(slice.TryGet<QuoteBar>(Symbols.SPY, out var foundQuoteBar));\n                Assert.AreEqual(foundQuoteBar, quoteBar);\n                Assert.IsTrue(slice.TryGet<Tick>(Symbols.SPY, out var foundTick));\n                Assert.AreEqual(foundTick, tick);\n                Assert.IsTrue(slice.TryGet<Split>(Symbols.SPY, out var foundSplit));\n                Assert.AreEqual(foundSplit, split);\n                Assert.IsTrue(slice.TryGet<Delisting>(Symbols.SPY, out var foundDelisting));\n                Assert.AreEqual(foundDelisting, delisting);\n                Assert.IsTrue(slice.TryGet<OpenInterest>(Symbols.SPY, out var foundOpenInterest));\n                Assert.AreEqual(foundOpenInterest, openInterest);\n                Assert.IsTrue(slice.TryGet<MarginInterestRate>(Symbols.SPY, out var foundMarginInterest));\n                Assert.AreEqual(foundMarginInterest, marginInterest);\n\n                Assert.IsFalse(slice.TryGet<TradeBar>(Symbols.AAPL, out _));\n            }\n\n            {\n                Assert.IsTrue(slice.TryGet(typeof(TradeBar), Symbols.SPY, out var foundTradeBar));\n                Assert.AreEqual(foundTradeBar, tradeBar);\n                Assert.IsTrue(slice.TryGet(typeof(UnlinkedData), Symbols.SPY, out var foundUnlinkedData));\n                Assert.AreEqual(foundUnlinkedData, unlinkedData);\n                Assert.IsTrue(slice.TryGet(typeof(QuoteBar), Symbols.SPY, out var foundQuoteBar));\n                Assert.AreEqual(foundQuoteBar, quoteBar);\n                Assert.IsTrue(slice.TryGet(typeof(Tick), Symbols.SPY, out var foundTick));\n                Assert.AreEqual(foundTick, tick);\n                Assert.IsTrue(slice.TryGet(typeof(Split), Symbols.SPY, out var foundSplit));\n                Assert.AreEqual(foundSplit, split);\n                Assert.IsTrue(slice.TryGet(typeof(Delisting), Symbols.SPY, out var foundDelisting));\n                Assert.AreEqual(foundDelisting, delisting);\n                Assert.IsTrue(slice.TryGet(typeof(OpenInterest), Symbols.SPY, out var foundOpenInterest));\n                Assert.AreEqual(foundOpenInterest, openInterest);\n                Assert.IsTrue(slice.TryGet(typeof(MarginInterestRate), Symbols.SPY, out var foundMarginInterest));\n                Assert.AreEqual(foundMarginInterest, marginInterest);\n\n                Assert.IsFalse(slice.TryGet(typeof(TradeBar), Symbols.AAPL, out _));\n            }\n        }\n\n        [Test]\n        public void AccessesBaseBySymbol()\n        {\n            IndicatorDataPoint tick = new IndicatorDataPoint(Symbols.SPY, DateTime.Now, 1);\n            Slice slice = new Slice(DateTime.Now, new[] { tick }, DateTime.Now);\n\n            IndicatorDataPoint data = slice[tick.Symbol];\n\n            Assert.AreEqual(tick, data);\n        }\n\n        [Test]\n        public void AccessesTradeBarBySymbol()\n        {\n            TradeBar tradeBar = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            Slice slice = new Slice(DateTime.Now, new[] { tradeBar }, DateTime.Now);\n\n            TradeBar data = slice[tradeBar.Symbol];\n\n            Assert.AreEqual(tradeBar, data);\n        }\n\n        [Test]\n        public void EquitiesIgnoreQuoteBars()\n        {\n            var quoteBar = new QuoteBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var slice = new Slice(DateTime.Now, new[] { quoteBar }, DateTime.Now);\n\n            Assert.IsFalse(slice.HasData);\n            Assert.IsTrue(slice.ToList().Count == 0);\n            Assert.IsFalse(slice.ContainsKey(Symbols.SPY));\n            Assert.Throws<KeyNotFoundException>(() => { var data = slice[Symbols.SPY]; });\n            Assert.AreEqual(0, slice.Count);\n\n            var tickQuoteBar = new Tick { Symbol = Symbols.SPY, Time = DateTime.Now, TickType = TickType.Quote };\n            slice = new Slice(DateTime.Now, new[] { tickQuoteBar }, DateTime.Now);\n\n            Assert.IsFalse(slice.HasData);\n            Assert.IsTrue(slice.ToList().Count == 0);\n            Assert.IsFalse(slice.ContainsKey(Symbols.SPY));\n            Assert.Throws<KeyNotFoundException>(() => { var data = slice[Symbols.SPY]; });\n            Assert.AreEqual(0, slice.Count);\n        }\n\n        [Test]\n        public void AccessesTradeBarCollection()\n        {\n            TradeBar tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            TradeBar tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            Slice slice = new Slice(DateTime.Now, new[] { tradeBar1, tradeBar2 }, DateTime.Now);\n\n            TradeBars tradeBars = slice.Bars;\n            Assert.AreEqual(2, tradeBars.Count);\n        }\n\n        [Test]\n        public void AccessesTicksBySymbol()\n        {\n            Tick tick1 = new Tick { Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1m, Quantity = 2m };\n            Tick tick2 = new Tick { Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1.1m, Quantity = 2.1m };\n            Slice slice = new Slice(DateTime.Now, new[] { tick1, tick2 }, DateTime.Now);\n\n            List<Tick> data = slice[tick1.Symbol];\n            Assert.IsInstanceOf(typeof(List<Tick>), data);\n            Assert.AreEqual(2, data.Count);\n        }\n\n        [Test]\n        public void AccessesTicksCollection()\n        {\n            Tick tick1 = new Tick { Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1, Quantity = 2 };\n            Tick tick2 = new Tick { Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1.1m, Quantity = 2.1m };\n            Tick tick3 = new Tick { Time = DateTime.Now, Symbol = Symbols.AAPL, Value = 1, Quantity = 2 };\n            Tick tick4 = new Tick { Time = DateTime.Now, Symbol = Symbols.AAPL, Value = 1.1m, Quantity = 2.1m };\n            Slice slice = new Slice(DateTime.Now, new[] { tick1, tick2, tick3, tick4 }, DateTime.Now);\n\n            Ticks ticks = slice.Ticks;\n            Assert.AreEqual(2, ticks.Count);\n            Assert.AreEqual(2, ticks[Symbols.SPY].Count);\n            Assert.AreEqual(2, ticks[Symbols.AAPL].Count);\n        }\n\n        [Test]\n        public void DifferentCollectionsAreCorrectlyGeneratedSameSymbol()\n        {\n            var quoteBar = new QuoteBar(DateTime.Now, Symbols.SPY,\n                new Bar(3100, 3100, 3100, 3100), 0,\n                new Bar(3101, 3101, 3101, 3101), 0,\n                Time.OneMinute);\n            var tradeBar = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var slice = new Slice(DateTime.Now, new BaseData[] { quoteBar, tradeBar }, DateTime.Now);\n\n            Assert.AreEqual(1, slice.QuoteBars.Count);\n            Assert.AreEqual(1, slice.Bars.Count);\n\n            Assert.AreEqual(1, slice.Get<QuoteBar>().Count);\n            Assert.AreEqual(1, slice.Get<TradeBar>().Count);\n        }\n\n        [Test]\n        public void AccessesCustomGenericallyByTypeOtherTypesPresent()\n        {\n            var tradeBar = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var slice = new Slice(DateTime.Now, new BaseData[] { unlinkedDataSpy, tradeBar }, DateTime.Now);\n\n            var unlinkedData = slice.Get<UnlinkedData>();\n            Assert.AreEqual(1, unlinkedData.Count);\n        }\n\n        [Test]\n        public void AccessesCustomGenericallyByType()\n        {\n            var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n            var unlinkedData = slice.Get<UnlinkedData>();\n            Assert.AreEqual(2, unlinkedData.Count);\n        }\n\n        [Test]\n        public void AccessesTickGenericallyByType()\n        {\n            Tick TickSpy = new Tick { Symbol = Symbols.SPY, Time = DateTime.Now };\n            Tick TickAapl = new Tick { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            Slice slice = new Slice(DateTime.Now, new[] { TickSpy, TickAapl }, DateTime.Now);\n\n            DataDictionary<Tick> TickData = slice.Get<Tick>();\n            Assert.AreEqual(2, TickData.Count);\n        }\n\n        [Test]\n        public void AccessesTradeBarGenericallyByType()\n        {\n            TradeBar TradeBarSpy = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            TradeBar TradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            Slice slice = new Slice(DateTime.Now, new[] { TradeBarSpy, TradeBarAapl }, DateTime.Now);\n\n            DataDictionary<TradeBar> TradeBarData = slice.Get<TradeBar>();\n            Assert.AreEqual(2, TradeBarData.Count);\n        }\n\n        [Test]\n        public void AccessesGenericallyByTypeAndSymbol()\n        {\n            var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n            var unlinkedData = slice.Get<UnlinkedData>(Symbols.SPY);\n            Assert.AreEqual(unlinkedDataSpy, unlinkedData);\n        }\n\n        [Test]\n        public void MergeSlice()\n        {\n            var tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = _dataTime };\n            var tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = _dataTime, Open = 23 };\n            var quoteBar1 = new QuoteBar { Symbol = Symbols.SPY, Time = _dataTime };\n            var tick1 = new Tick(_dataTime, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var split1 = new Split(Symbols.SPY, _dataTime, 1, 1, SplitType.SplitOccurred);\n            var dividend1 = new Dividend(Symbols.SPY, _dataTime, 1, 1);\n            var delisting1 = new Delisting(Symbols.SPY, _dataTime, 1, DelistingType.Delisted);\n            var symbolChangedEvent1 = new SymbolChangedEvent(Symbols.SPY, _dataTime, \"SPY\", \"SP\");\n            var marginInterestRate1 = new MarginInterestRate { Time = _dataTime, Symbol = Symbols.SPY, InterestRate = 8 };\n            var slice1 = new Slice(_dataTime, new BaseData[] { tradeBar1, tradeBar2,\n                quoteBar1, tick1, split1, dividend1, delisting1, symbolChangedEvent1, marginInterestRate1\n            }, _dataTime);\n\n            var tradeBar3 = new TradeBar { Symbol = Symbols.AAPL, Time = _dataTime, Open = 24 };\n            var tradeBar4 = new TradeBar { Symbol = Symbols.SBIN, Time = _dataTime };\n            var tradeBar3_4 = new TradeBar { Symbol = Symbols.BTCEUR, Time = _dataTime };\n            var quoteBar2 = new QuoteBar { Symbol = Symbols.SBIN, Time = _dataTime };\n            var tick2 = new Tick(_dataTime, Symbols.SBIN, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var split2 = new Split(Symbols.SBIN, _dataTime, 1, 1, SplitType.SplitOccurred);\n            var dividend2 = new Dividend(Symbols.SBIN, _dataTime, 1, 1);\n            var delisting2 = new Delisting(Symbols.SBIN, _dataTime, 1, DelistingType.Delisted);\n            var symbolChangedEvent2 = new SymbolChangedEvent(Symbols.SBIN, _dataTime, \"SBIN\", \"BIN\");\n            var marginInterestRate2 = new MarginInterestRate { Time = _dataTime, Symbol = Symbols.SBIN, InterestRate = 18 };\n            var slice2 = new Slice(_dataTime, new BaseData[] { tradeBar3, tradeBar4, tradeBar3_4,\n                quoteBar2, tick2, split2, dividend2, delisting2, symbolChangedEvent2, marginInterestRate2\n            }, _dataTime);\n\n            slice1.MergeSlice(slice2);\n            Assert.AreEqual(4, slice1.Bars.Count);\n            Assert.AreEqual(2, slice1.QuoteBars.Count);\n            Assert.AreEqual(2, slice1.Ticks.Count);\n            Assert.AreEqual(2, slice1.Splits.Count);\n            Assert.AreEqual(2, slice1.Dividends.Count);\n            Assert.AreEqual(2, slice1.Delistings.Count);\n            Assert.AreEqual(2, slice1.SymbolChangedEvents.Count);\n            Assert.AreEqual(2, slice1.MarginInterestRates.Count);\n        }\n\n        [Test]\n        public void CheckMergeUpdatePrivateAttributes()\n        {\n            var tradeBar0 = new TradeBar { Symbol = Symbols.BTCUSD, Time = _dataTime };\n            var slice1 = new Slice(_dataTime, new BaseData[] { tradeBar0 }, _dataTime);\n            var tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = _dataTime };\n            var tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = _dataTime, Open = 23 };\n            var slice2 = new Slice(_dataTime, new BaseData[] { tradeBar1, tradeBar2 }, _dataTime);\n\n            slice1.MergeSlice(slice2);\n            // Check private _data is updated\n            Assert.AreEqual(3, slice1.Values.Count);\n\n            var tradeBar3 = new TradeBar { Symbol = Symbols.AAPL, Time = _dataTime, Open = 24 };\n            var tradeBar4 = new TradeBar { Symbol = Symbols.SBIN, Time = _dataTime };\n            var tradeBar3_4 = new TradeBar { Symbol = Symbols.BTCEUR, Time = _dataTime };\n            var slice3 = new Slice(_dataTime, new BaseData[] { tradeBar3, tradeBar4, tradeBar3_4 }, _dataTime);\n\n            slice1.MergeSlice(slice3);\n\n            // Should use first non Null value\n            var testTradeBar = (TradeBar)slice1.Values.Where(datum => datum.DataType == MarketDataType.TradeBar && datum.Symbol.Value == \"AAPL\").Single();\n            Assert.AreEqual(23, testTradeBar.Open);\n\n            // Check private _rawDataList is updated\n            Assert.AreEqual(5, slice1.Values.Count);\n        }\n\n        [Test]\n        public void MergeTicks()\n        {\n            var tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = _dataTime };\n            var tick1 = new Tick(_dataTime, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var slice1 = new Slice(_dataTime, new BaseData[] { tradeBar1, tick1 }, _dataTime);\n            //var Use List<tick>\n            var ticks = new Ticks { { Symbols.MSFT, new List<Tick> { tick1 } } };\n            var slice2 = new Slice(_dataTime, new List<BaseData>(), null, null, ticks, null, null, null, null, null, null, null, _dataTime);\n            slice1.MergeSlice(slice2);\n            Assert.AreEqual(2, slice1.Ticks.Count);\n\n            // Should merge only when different\n            var tick2 = new Tick(_dataTime, Symbols.MSFT, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var slice3 = new Slice(_dataTime, new BaseData[] { tradeBar1, tick2 }, _dataTime);\n            slice2.MergeSlice(slice3);\n            Assert.AreEqual(1, slice2.Ticks.Count);\n        }\n\n        [TestCase(null)]\n        [TestCase(\"\")]\n        public void AccessingTicksParsedSaleConditinoDoesNotThrow(string saleCondition)\n        {\n            var tick1 = new Tick(_dataTime, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            tick1.SaleCondition = saleCondition;\n            Assert.DoesNotThrow(() => tick1.ParsedSaleCondition.ToString());\n        }\n\n        [Test]\n        public void MergeOptionsAndFuturesChain()\n        {\n            // Merge optionChains and FutureChains\n            var optionChain1 = new OptionChains();\n            var optionChain2 = new OptionChains();\n            optionChain1.Add(Symbols.SPY, new OptionChain(Symbols.SPY, _dataTime));\n            optionChain2.Add(Symbols.AAPL, new OptionChain(Symbols.SPY, _dataTime));\n            var futuresChain1 = new FuturesChains();\n            var futuresChain2 = new FuturesChains();\n            futuresChain1.Add(Symbols.SPY, new FuturesChain(Symbols.SPY, _dataTime));\n            futuresChain2.Add(Symbols.AAPL, new FuturesChain(Symbols.SPY, _dataTime));\n            var slice4 = new Slice(_dataTime, new List<BaseData>(),\n                                new TradeBars(_dataTime), new QuoteBars(),\n                                new Ticks(), optionChain1,\n                                futuresChain1, new Splits(),\n                                new Dividends(_dataTime), new Delistings(),\n                                new SymbolChangedEvents(), new MarginInterestRates(), _dataTime);\n            var slice5 = new Slice(_dataTime, new List<BaseData>(),\n                new TradeBars(_dataTime), new QuoteBars(),\n                new Ticks(), optionChain2,\n                futuresChain2, new Splits(),\n                new Dividends(_dataTime), new Delistings(),\n                new SymbolChangedEvents(), new MarginInterestRates(), _dataTime);\n            slice4.MergeSlice(slice5);\n            Assert.AreEqual(2, slice4.OptionChains.Count);\n            Assert.AreEqual(2, slice4.FutureChains.Count);\n        }\n\n        [Test]\n        public void MergeCustomData()\n        {\n            var tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = _dataTime };\n            var tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = _dataTime, Open = 23 };\n            var custom1 = new FxcmVolume { DataType = MarketDataType.Base, Symbol = Symbols.MSFT };\n            var custom2 = new FxcmVolume { DataType = MarketDataType.Base, Symbol = Symbols.SBIN };\n            var custom3 = new FxcmVolume { DataType = MarketDataType.Base, Symbol = Symbols.MSFT };\n            var custom4 = new FxcmVolume { DataType = MarketDataType.Base, Symbol = Symbols.SBIN };\n            var slice6 = new Slice(_dataTime, new BaseData[] { custom1, custom2, custom3, tradeBar2 }, _dataTime);\n            var slice5 = new Slice(_dataTime, new BaseData[] { tradeBar1, custom4 }, _dataTime);\n            slice5.MergeSlice(slice6);\n            Assert.AreEqual(4, slice5.Values.Count);\n            Assert.AreEqual(2, slice5.Values.Where(x => x.DataType == MarketDataType.Base).Count());\n        }\n\n        [Test]\n        public void PythonGetCustomData()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    data = slice.Get(UnlinkedData)\n    return data\").GetAttr(\"Test\");\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n                var data = test(slice);\n                Assert.AreEqual(2, (int)data.Count);\n                Assert.AreEqual(10, (int)data[Symbols.SPY].Value);\n                Assert.AreEqual(11, (int)data[Symbols.AAPL].Value);\n            }\n        }\n\n        [Test]\n        public void PythonCustomDataPyObjectValue()\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    @\"\n\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def Reader(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.Symbol = config.Symbol\n        result.Value = 10\n        result[\"\"TimeTest\"\"] = datetime.strptime(\"\"2022-05-05\"\", \"\"%Y-%m-%d\"\")\n        return result\n\ndef Test(slice, symbol):\n    data = slice.Get(CustomDataTest)\n    return data[symbol][\"\"TimeTest\"\"]\");\n                var test = testModule.GetAttr(\"Test\");\n\n                var type = Extensions.CreateType(testModule.GetAttr(\"CustomDataTest\"));\n                var customDataTest = new PythonData(testModule.GetAttr(\"CustomDataTest\")());\n                var config = new SubscriptionDataConfig(type, Symbols.SPY, Resolution.Daily, DateTimeZone.Utc,\n                    DateTimeZone.Utc, false, false, false, isCustom: true);\n                var data1 = customDataTest.Reader(config, \"something\", DateTime.UtcNow, false);\n\n                var slice = new Slice(DateTime.UtcNow, new[] { data1 }, DateTime.UtcNow);\n\n                Assert.AreEqual(new DateTime(2022, 05, 05), (DateTime)test(slice, Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"reader\", \"get_source\", \"get\")]\n        [TestCase(\"Reader\", \"GetSource\", \"get\")]\n        [TestCase(\"reader\", \"get_source\", \"Get\")]\n        [TestCase(\"Reader\", \"GetSource\", \"Get\")]\n        public void PythonGetPythonCustomData(string reader, string getSource, string get)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\n\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def {reader}(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.Symbol = config.Symbol\n        result.Value = 10\n        return result\n    def {getSource}(config, date, isLiveMode):\n        return None\n\nclass CustomDataTest2(PythonData):\n    def {reader}(self, config, line, date, isLiveMode):\n        result = CustomDataTest2()\n        result.Symbol = config.Symbol\n        result.Value = 11\n        return result\n    def {getSource}(config, date, isLiveMode):\n        return None\n\ndef Test(slice):\n    data = slice.{get}(CustomDataTest)\n    return data\");\n                var test = testModule.GetAttr(\"Test\");\n\n                var type = Extensions.CreateType(testModule.GetAttr(\"CustomDataTest\"));\n                var customDataTest = new PythonData(testModule.GetAttr(\"CustomDataTest\")());\n                var config = new SubscriptionDataConfig(type, Symbols.SPY, Resolution.Daily, DateTimeZone.Utc,\n                    DateTimeZone.Utc, false, false, false, isCustom: true);\n                var data1 = customDataTest.Reader(config, \"something\", DateTime.UtcNow, false);\n\n                var customDataTest2 = new PythonData(testModule.GetAttr(\"CustomDataTest2\")());\n                var config2 = new SubscriptionDataConfig(config, Extensions.CreateType(testModule.GetAttr(\"CustomDataTest2\")));\n                var data2 = customDataTest2.Reader(config2, \"something2\", DateTime.UtcNow, false);\n\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.UtcNow, Value = 10 };\n                var slice = new Slice(DateTime.UtcNow, new[] { unlinkedDataSpy, data2, data1 }, DateTime.UtcNow);\n\n                var data = test(slice);\n                Assert.AreEqual(1, (int)data.Count);\n                Assert.AreEqual(10, (int)data[Symbols.SPY].Value);\n            }\n        }\n\n        [Test]\n        public void PythonEnumerationWorks()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    for dataPoint in slice:\n        return dataPoint\").GetAttr(\"Test\");\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new[] { unlinkedDataAapl }, DateTime.Now);\n\n                var data = test(slice) as PyObject;\n                var keyValuePair = data.As<KeyValuePair<Symbol, BaseData>>();\n                Assert.IsNotNull(keyValuePair);\n                Assert.AreEqual(11, keyValuePair.Value.Value);\n            }\n        }\n\n        [Test]\n        public void PythonGetBySymbolCustomData()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\ndef Test(slice):\n    data = slice.Get(UnlinkedData)\n    value = data[Symbols.AAPL].Value\n    if value != 11:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetAndSymbolCustomData()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\ndef Test(slice):\n    data = slice.Get(UnlinkedData, Symbols.AAPL)\n    value = data.Value\n    if value != 11:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetTradeBar()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    data = slice.Get(TradeBar)\n    return data\").GetAttr(\"Test\");\n                var TradeBarSpy = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 8 };\n                var TradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new BaseData[] { unlinkedDataSpy, TradeBarAapl, unlinkedDataAapl, TradeBarSpy }, DateTime.Now);\n\n                var data = test(slice);\n                Assert.AreEqual(2, (int)data.Count);\n                Assert.AreEqual(8, (int)data[Symbols.SPY].Value);\n                Assert.AreEqual(9, (int)data[Symbols.AAPL].Value);\n            }\n        }\n\n        [Test]\n        public void PythonGetBySymbolOpenInterest()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\ndef Test(slice):\n    data = slice.Get(OpenInterest)\n    value = data[Symbols.AAPL].Value\n    if value != 33:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var now = DateTime.UtcNow;\n                var TradeBarSpy = new TradeBar { Symbol = Symbols.SPY, Time = now, Value = 8 };\n                var TradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = now, Value = 9 };\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = now, Value = 11 };\n                var openInterest = new OpenInterest(now, Symbols.AAPL, 33);\n                var slice = new Slice(now, new BaseData[] { unlinkedDataSpy, TradeBarAapl, unlinkedDataAapl, TradeBarSpy, openInterest }, now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetBySymbolTradeBar()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\ndef Test(slice):\n    data = slice.Get(TradeBar)\n    value = data[Symbols.AAPL].Value\n    if value != 9:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var TradeBarSpy = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 8 };\n                var TradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new BaseData[] { unlinkedDataSpy, TradeBarAapl, unlinkedDataAapl, TradeBarSpy }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetAndSymbolTradeBar()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\ndef Test(slice):\n    data = slice.Get(TradeBar, Symbols.AAPL)\n    value = data.Value\n    if value != 9:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var TradeBarSpy = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 8 };\n                var TradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new BaseData[] { unlinkedDataSpy, TradeBarAapl, unlinkedDataAapl, TradeBarSpy }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetCustomData_Iterate_IndexedLinkedData()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\nfrom QuantConnect.Logging import *\n\ndef Test(slice):\n    data = slice.Get(IndexedLinkedData)\n    count = 0\n    for singleData in data:\n        Log.Trace(str(singleData))\n        count += 1\n    if count != 2:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var indexedLinkedDataSpy = new IndexedLinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var tradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n                var indexedLinkedDataAapl = new IndexedLinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new BaseData[] { indexedLinkedDataSpy, tradeBarAapl, indexedLinkedDataAapl }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetCustomData_Iterate_IndexedLinkedData_Empty()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Data.Custom.IconicTypes import *\n\ndef Test(slice):\n    data = slice.Get(IndexedLinkedData)\n    for singleData in data:\n        raise Exception('Unexpected iteration')\n    for singleData in data.Values:\n        raise Exception('Unexpected iteration')\n    data = slice.Get(IndexedLinkedData)\n    for singleData in data:\n        raise Exception('Unexpected iteration')\n    for singleData in data.Values:\n        raise Exception('Unexpected iteration')\").GetAttr(\"Test\");\n                var tradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n                var slice = new Slice(DateTime.Now, new List<BaseData> { tradeBarAapl }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void PythonGetCustomData_Iterate()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    data = slice.Get(UnlinkedData)\n    count = 0\n    for singleData in data:\n        count += 1\n    if count != 2:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n                var unlinkedDataSpy = new UnlinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n                var unlinkedDataAapl = new UnlinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n                var slice = new Slice(DateTime.Now, new[] { unlinkedDataSpy, unlinkedDataAapl }, DateTime.Now);\n\n                Assert.DoesNotThrow(() => test(slice));\n            }\n        }\n\n        [Test]\n        public void EnumeratorDoesNotThrowWithTicks()\n        {\n            var slice = new Slice(DateTime.Now, new[]\n            {\n                new Tick {Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1, Quantity = 2},\n                new Tick{Time = DateTime.Now, Symbol = Symbols.SPY, Value = 1.1m, Quantity = 2.1m},\n                new Tick{Time = DateTime.Now, Symbol = Symbols.AAPL, Value = 1, Quantity = 2},\n                new Tick{Time = DateTime.Now, Symbol = Symbols.AAPL, Value = 1.1m, Quantity = 2.1m}\n            }, DateTime.Now);\n\n            #pragma warning disable CA1829\n            Assert.AreEqual(4, slice.Count());\n            #pragma warning restore CA1829\n        }\n\n        [Test]\n        public void AccessesTradeBarAndQuoteBarForSameSymbol()\n        {\n            var tradeBar = new TradeBar(DateTime.Now, Symbols.BTCUSD,\n                3000, 3000, 3000, 3000, 100, Time.OneMinute);\n\n            var quoteBar = new QuoteBar(DateTime.Now, Symbols.BTCUSD,\n                    new Bar(3100, 3100, 3100, 3100), 0,\n                    new Bar(3101, 3101, 3101, 3101), 0,\n                    Time.OneMinute);\n\n            var tradeBars = new TradeBars { { Symbols.BTCUSD, tradeBar } };\n            var quoteBars = new QuoteBars { { Symbols.BTCUSD, quoteBar } };\n\n            var slice = new Slice(DateTime.Now, new List<BaseData>() { tradeBar, quoteBar }, tradeBars, quoteBars, null, null, null, null, null, null, null, null, DateTime.Now);\n\n            var tradeBarData = slice.Get<TradeBar>();\n            Assert.AreEqual(1, tradeBarData.Count);\n            Assert.AreEqual(3000, tradeBarData[Symbols.BTCUSD].Close);\n\n            var quoteBarData = slice.Get<QuoteBar>();\n            Assert.AreEqual(1, quoteBarData.Count);\n            Assert.AreEqual(3100, quoteBarData[Symbols.BTCUSD].Bid.Close);\n            Assert.AreEqual(3101, quoteBarData[Symbols.BTCUSD].Ask.Close);\n\n            slice = new Slice(DateTime.Now, new BaseData[] { tradeBar, quoteBar }, DateTime.Now);\n\n            tradeBarData = slice.Get<TradeBar>();\n            Assert.AreEqual(1, tradeBarData.Count);\n            Assert.AreEqual(3000, tradeBarData[Symbols.BTCUSD].Close);\n\n            quoteBarData = slice.Get<QuoteBar>();\n            Assert.AreEqual(1, quoteBarData.Count);\n            Assert.AreEqual(3100, quoteBarData[Symbols.BTCUSD].Bid.Close);\n            Assert.AreEqual(3101, quoteBarData[Symbols.BTCUSD].Ask.Close);\n        }\n\n        [Test]\n        public void PythonSlice_clear()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    slice.clear()\").GetAttr(\"Test\");\n\n                Assert.That(() => test(GetSlice()),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<InvalidOperationException>(),\n                    \"Slice is read-only: cannot clear the collection\");\n            }\n        }\n\n        [Test]\n        public void PythonSlice_popitem()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    slice.popitem()\").GetAttr(\"Test\");\n\n                Assert.That(() => test(GetSlice()),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<NotSupportedException>(),\n                    $\"Slice is read-only: cannot pop the value for {Symbols.SPY} from the collection\");\n            }\n        }\n\n        [Test]\n        public void PythonSlice_pop()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    slice.pop(symbol)\").GetAttr(\"Test\");\n\n                Assert.That(() => test(GetSlice(), Symbols.SPY),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<InvalidOperationException>(),\n                    $\"Slice is read-only: cannot pop the value for {Symbols.SPY} from the collection\");\n            }\n        }\n\n        [Test]\n        public void PythonSlice_pop_default()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol, default_value):\n    slice.pop(symbol, default_value)\").GetAttr(\"Test\");\n\n                Assert.That(() => test(GetSlice(), Symbols.SPY, null),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<InvalidOperationException>(),\n                    $\"Slice is read-only: cannot pop the value for {Symbols.SPY} from the collection\");\n            }\n        }\n\n        [Test]\n        public void PythonSlice_update_fails()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    item = { symbol: 1 }\n    slice.update(item)\").GetAttr(\"Test\");\n\n                Assert.That(() => test(GetSlice(), Symbols.SPY),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<InvalidOperationException>(),\n                    \"Slice is read-only: cannot update the collection\");\n            }\n        }\n\n        [Test]\n        public void PythonSlice_update_success()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol, bar):\n    item = { symbol: bar }\n    slice.Bars.update(item)\").GetAttr(\"Test\");\n\n                var expected = new TradeBar();\n                var pythonSlice = GetSlice();\n                Assert.DoesNotThrow(() => test(pythonSlice, Symbols.SPY, expected));\n                Assert.AreEqual(expected, pythonSlice.Bars[Symbols.SPY]);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_contains()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nAddReference(\"\"QuantConnect.Tests\"\")\nfrom QuantConnect.Tests.Common.Data import *\n\ndef Test(slice, symbol):\n    return symbol in slice\").GetAttr(\"Test\");\n\n                bool result = false;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                Assert.IsTrue(result);\n\n                result = false;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                Assert.IsTrue(result);\n            }\n        }\n\n        [Test, Ignore(\"Performance test\")]\n        public void PythonSlice_performance()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nAddReference(\"\"QuantConnect.Tests\"\")\nfrom QuantConnect.Tests.Common.Data import *\n\ndef Test(slice, symbol):\n    msg = '__contains__'\n\n    if 'SPY' in slice:\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = 'SPY' in slice\n    span1 = (datetime.now()-now).total_seconds()\n\n    if slice.ContainsKey('SPY'):\n        msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.ContainsKey('SPY')\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    msg += '\\n\\n__len__'\n\n    if len(slice) > 0:\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = len(slice)\n    span1 = (datetime.now()-now).total_seconds()\n\n    if slice.Count > 0:\n        msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.Count\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    msg += '\\n\\nkeys()'\n\n    if len(slice.keys()) > 0:\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.keys()\n    span1 = (datetime.now()-now).total_seconds()\n\n    if len(slice.Keys) > 0:\n        msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.Keys\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    msg += '\\n\\nvalues()'\n\n    if len(slice.values()) > 0:\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.values()\n    span1 = (datetime.now()-now).total_seconds()\n\n    if len(slice.Values) > 0:\n        msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.Values\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    msg += '\\n\\nget()'\n\n    if slice.get(symbol):\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.get(symbol)\n    span1 = (datetime.now()-now).total_seconds()\n\n    dummy = None\n    if slice.TryGetValue(symbol, dummy):\n        msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = slice.TryGetValue(symbol, dummy)\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    msg += '\\n\\nitems()'\n\n    if slice.items():\n        msg += ' Py'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = list(slice.items())\n    span1 = (datetime.now()-now).total_seconds()\n\n    msg += ' C#\\n'\n    now = datetime.now()\n    for i in range(0,1000000):\n        result = [x for x in slice]\n    span2 = (datetime.now()-now).total_seconds()\n\n    msg += f'Py: {span1}\\nC#: {span2}\\nRatio: {span1/span2}'\n\n    return msg\").GetAttr(\"Test\");\n\n                var message = string.Empty;\n                Assert.DoesNotThrow(() => message = test(GetSlice(), Symbols.SPY));\n\n                Assert.Ignore(message);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_len()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nAddReference(\"\"QuantConnect.Tests\"\")\nfrom QuantConnect.Tests.Common.Data import *\n\ndef Test(slice, symbol):\n    return len(slice)\").GetAttr(\"Test\");\n\n                var result = -1;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                Assert.AreEqual(2, result);\n\n                result = -1;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                Assert.AreEqual(2, result);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_copy()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    copy = slice.copy()\n    return ', '.join([f'{k}: {v.Value}' for k,v in copy.items()])\").GetAttr(\"Test\");\n\n                var result = string.Empty;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                Assert.AreEqual(\"AAPL R735QTJ8XC9X: 11.0, SPY R735QTJ8XC9X: 10.0\", result);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_items()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    return ', '.join([f'{k}: {v.Value}' for k,v in slice.items()])\").GetAttr(\"Test\");\n\n                var result = string.Empty;\n                Assert.DoesNotThrow(() => result = test(GetSlice()));\n                Assert.AreEqual(\"AAPL R735QTJ8XC9X: 11.0, SPY R735QTJ8XC9X: 10.0\", result);\n            }\n        }\n\n\n        [Test]\n        public void PythonSlice_keys()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    return slice.keys()\").GetAttr(\"Test\");\n\n                var slice = GetSlice();\n                var result = new List<Symbol>();\n                Assert.DoesNotThrow(() => result = test(slice));\n                foreach (var key in slice.Keys)\n                {\n                    Assert.IsTrue(result.Contains(key));\n                }\n            }\n        }\n\n        [Test]\n        public void PythonSlice_values()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice):\n    return slice.values()\").GetAttr(\"Test\");\n\n                var slice = GetSlice();\n                var result = new List<BaseData>();\n                Assert.DoesNotThrow(() => result = test(slice));\n                foreach (var value in slice.Values)\n                {\n                    Assert.IsTrue(result.Contains(value));\n                }\n            }\n        }\n\n        [Test]\n        public void PythonSlice_fromkeys()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, keys):\n    newDict = slice.fromkeys(keys)\n    return ', '.join([f'{k}: {v.Value}' for k,v in newDict.items()])\").GetAttr(\"Test\");\n\n                var result = string.Empty;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), new[] { Symbols.SPY }));\n                Assert.AreEqual(\"SPY R735QTJ8XC9X: 10.0\", result);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_fromkeys_default()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, keys, default_value):\n    newDict = slice.fromkeys(keys, default_value)\n    return ', '.join([f'{k}: {v.Value}' for k,v in newDict.items()])\").GetAttr(\"Test\");\n\n                var result = string.Empty;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), new[] { Symbols.EURUSD }, new Tick()));\n                Assert.AreEqual(\"EURUSD 8G: 0.0\", result);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_get_success()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    return slice.get(symbol)\").GetAttr(\"Test\");\n\n                var pythonSlice = GetSlice();\n                dynamic expected = pythonSlice[Symbols.SPY];\n                PyObject result = null;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                BaseData actual;\n                Assert.IsTrue(result.TryConvert(out actual));\n                Assert.AreEqual(expected.Symbol, actual.Symbol);\n                Assert.AreEqual(expected.Value, actual.Value);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_get_default()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol, default_value):\n    return slice.get(symbol, default_value)\").GetAttr(\"Test\");\n\n                var pythonSlice = GetSlice();\n                var expected = new QuoteBar { Symbol = Symbols.EURUSD, Time = DateTime.Now, Value = 9 };\n                PyObject result = null;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.EURUSD, expected));\n                BaseData actual;\n                Assert.IsTrue(result.TryConvert(out actual));\n                Assert.AreEqual(expected.Symbol, actual.Symbol);\n                Assert.AreEqual(expected.Value, actual.Value);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_get_NoneIfKeyNotFound()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    return slice.get(symbol)\").GetAttr(\"Test\");\n\n                Assert.IsNull(test(GetSlice(), Symbols.EURUSD));\n            }\n        }\n\n        [Test]\n        public void PythonSlice_setdefault_success()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    return slice.setdefault(symbol)\").GetAttr(\"Test\");\n\n                var pythonSlice = GetSlice();\n                dynamic expected = pythonSlice[Symbols.SPY];\n                PyObject result = null;\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY));\n                BaseData actual;\n                Assert.IsTrue(result.TryConvert(out actual));\n                Assert.AreEqual(expected.Symbol, actual.Symbol);\n                Assert.AreEqual(expected.Value, actual.Value);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_setdefault_default_success()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol, default_value):\n    return slice.setdefault(symbol, default_value)\").GetAttr(\"Test\");\n\n                var value = new Tick();\n                var pythonSlice = GetSlice();\n                dynamic expected = pythonSlice[Symbols.SPY];\n                PyObject result = null;\n\n                // Since SPY is found, no need to set the default. Therefore it does not throw.\n                Assert.DoesNotThrow(() => result = test(GetSlice(), Symbols.SPY, value));\n                BaseData actual;\n                Assert.IsTrue(result.TryConvert(out actual));\n                Assert.AreEqual(expected.Symbol, actual.Symbol);\n                Assert.AreEqual(expected.Value, actual.Value);\n            }\n        }\n\n        [Test]\n        public void PythonSlice_setdefault_keynotfound()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(slice, symbol):\n    return slice.setdefault(symbol)\").GetAttr(\"Test\");\n\n                var symbol = Symbols.EURUSD;\n                Assert.That(() => test(GetSlice(), symbol),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<KeyNotFoundException>(),\n                    $\"Slice is read-only: cannot set default value to  for {symbol}\");\n            }\n        }\n\n        [TestCaseSource(nameof(PushThroughWorksWithDifferentTypesTestCases))]\n        public void PushThroughWorksWithDifferentTypes(Slice slice, Type dataType, decimal expectedValue)\n        {\n            decimal valuePushed = default;\n\n            var action = new Action<IBaseData>(data => { valuePushed = data.Value; });\n\n            var slices = new List<Slice>(){ slice };\n\n            slices.PushThrough(action, dataType);\n            Assert.AreEqual(expectedValue, valuePushed);\n        }\n\n        private Slice GetSlice()\n        {\n            SymbolCache.Clear();\n            var indexedLinkedDataSpy = new IndexedLinkedData { Symbol = Symbols.SPY, Time = DateTime.Now, Value = 10 };\n            var tradeBarAapl = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 9 };\n            var indexedLinkedDataAapl = new IndexedLinkedData { Symbol = Symbols.AAPL, Time = DateTime.Now, Value = 11 };\n            return new Slice(DateTime.Now, new BaseData[] { indexedLinkedDataSpy, tradeBarAapl, indexedLinkedDataAapl }, DateTime.Now);\n        }\n\n        public static object[] PushThroughWorksWithDifferentTypesTestCases =\n        {\n            new object[] {new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars() { new QuoteBar() { Symbol = Symbols.IBM, Value = 100m } },\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), typeof(QuoteBar), 100m},\n            new object[] {new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars() { new TradeBar() { Symbol = Symbols.IBM, Value = 100m } },\n                    new QuoteBars(),\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), typeof(TradeBar), 100m},\n            new object[] {new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>(),\n                    new TradeBars(),\n                    new QuoteBars(),\n                    new Ticks() { { Symbols.IBM, new Tick() { Value = 100m } } },\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), typeof(Tick), 100m},\n            new object[] {new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>() { new TradeBar() { Symbol = Symbols.IBM, Value = 100m } },\n                    new TradeBars(),\n                    new QuoteBars(),\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), null, 100m},\n            new object[] {new Slice(\n                    new DateTime(2013, 10, 3),\n                    new List<BaseData>() { new CustomData() { Symbol = Symbols.IBM, Value = 100m } },\n                    new TradeBars(),\n                    new QuoteBars(),\n                    new Ticks(),\n                    new OptionChains(),\n                    new FuturesChains(),\n                    new Splits(),\n                    new Dividends(),\n                    new Delistings(),\n                    new SymbolChangedEvents(),\n                    new MarginInterestRates(),\n                    DateTime.UtcNow), typeof(CustomData), 100m}\n        };\n    }\n\n    public class PublicArrayTest\n    {\n        public int[] items { get; set; }\n\n        public PublicArrayTest()\n        {\n            items = new int[5] { 0, 1, 2, 3, 4 };\n        }\n    }\n\n    public class CustomData: BaseData\n    {\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/SubscriptionDataSourceTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class SubscriptionDataSourceTests\n    {\n        [Test]\n        public void ComparesEqualWithIdenticalSourceAndTransportMedium()\n        {\n            var one = new SubscriptionDataSource(\"source\", SubscriptionTransportMedium.LocalFile);\n            var two = new SubscriptionDataSource(\"source\", SubscriptionTransportMedium.LocalFile);\n            Assert.IsTrue(one == two);\n            Assert.IsTrue(one.Equals(two));\n        }\n\n        [Test]\n        public void ComparesNotEqualWithDifferentSource()\n        {\n            var one = new SubscriptionDataSource(\"source1\", SubscriptionTransportMedium.LocalFile);\n            var two = new SubscriptionDataSource(\"source2\", SubscriptionTransportMedium.LocalFile);\n            Assert.IsTrue(one != two);\n            Assert.IsTrue(!one.Equals(two));\n        }\n\n        [Test]\n        public void ComparesNotEqualWithDifferentTransportMedium()\n        {\n            var one = new SubscriptionDataSource(\"source\", SubscriptionTransportMedium.LocalFile);\n            var two = new SubscriptionDataSource(\"source\", SubscriptionTransportMedium.RemoteFile);\n            Assert.IsTrue(one != two);\n            Assert.IsTrue(!one.Equals(two));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/SubscriptionManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Logging;\nusing QuantConnect.Statistics;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class SubscriptionManagerTests\n    {\n        [TestCase(SecurityType.Forex, Resolution.Daily, 1, TickType.Quote)]\n        [TestCase(SecurityType.Forex, Resolution.Hour, 1, TickType.Quote)]\n        [TestCase(SecurityType.Cfd, Resolution.Daily, 1, TickType.Quote)]\n        [TestCase(SecurityType.Cfd, Resolution.Hour, 1, TickType.Quote)]\n        [TestCase(SecurityType.Crypto, Resolution.Daily, 2, TickType.Trade, TickType.Quote)]\n        [TestCase(SecurityType.Crypto, Resolution.Hour, 2, TickType.Trade, TickType.Quote)]\n        [TestCase(SecurityType.Equity, Resolution.Daily, 1, TickType.Trade)]\n        [TestCase(SecurityType.Equity, Resolution.Hour, 1, TickType.Trade)]\n        public void GetsSubscriptionDataTypesLowResolution(SecurityType securityType, Resolution resolution, int count, params TickType[] expectedTickTypes)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution);\n\n            Assert.AreEqual(count, types.Count);\n            for (var i = 0; i < expectedTickTypes.Length; i++)\n            {\n                Assert.IsTrue(types[i].Item2 == expectedTickTypes[i]);\n            }\n        }\n\n        [Test]\n        [TestCase(SecurityType.Base, Resolution.Minute, typeof(TradeBar), TickType.Trade)]\n        [TestCase(SecurityType.Base, Resolution.Tick, typeof(Tick), TickType.Trade)]\n        [TestCase(SecurityType.Forex, Resolution.Minute, typeof(QuoteBar), TickType.Quote)]\n        [TestCase(SecurityType.Forex, Resolution.Tick, typeof(Tick), TickType.Quote)]\n        [TestCase(SecurityType.Cfd, Resolution.Minute, typeof(QuoteBar), TickType.Quote)]\n        [TestCase(SecurityType.Cfd, Resolution.Tick, typeof(Tick), TickType.Quote)]\n        public void GetsSubscriptionDataTypesSingle(SecurityType securityType, Resolution resolution, Type expectedDataType, TickType expectedTickType)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution);\n\n            Assert.AreEqual(1, types.Count);\n            Assert.AreEqual(expectedDataType, types[0].Item1);\n            Assert.AreEqual(expectedTickType, types[0].Item2);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Future, Resolution.Minute, typeof(FutureUniverse), TickType.Quote)]\n        [TestCase(SecurityType.Future, Resolution.Tick, typeof(FutureUniverse), TickType.Quote)]\n        [TestCase(SecurityType.FutureOption, Resolution.Minute, typeof(OptionUniverse), TickType.Quote)]\n        [TestCase(SecurityType.FutureOption, Resolution.Tick, typeof(OptionUniverse), TickType.Quote)]\n        [TestCase(SecurityType.Option, Resolution.Minute, typeof(OptionUniverse), TickType.Quote)]\n        [TestCase(SecurityType.Option, Resolution.Tick, typeof(OptionUniverse), TickType.Quote)]\n        [TestCase(SecurityType.IndexOption, Resolution.Minute, typeof(OptionUniverse), TickType.Quote)]\n        [TestCase(SecurityType.IndexOption, Resolution.Tick, typeof(OptionUniverse), TickType.Quote)]\n        public void GetsSubscriptionDataTypesCanonical(SecurityType securityType, Resolution resolution, Type expectedDataType, TickType expectedTickType)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution, true);\n\n            Assert.AreEqual(1, types.Count);\n            Assert.AreEqual(expectedDataType, types[0].Item1);\n            Assert.AreEqual(expectedTickType, types[0].Item2);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Future, Resolution.Minute)]\n        [TestCase(SecurityType.Option, Resolution.Minute)]\n        public void GetsSubscriptionDataTypesFuturesOptionsMinute(SecurityType securityType, Resolution resolution)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution);\n\n            Assert.AreEqual(3, types.Count);\n            Assert.AreEqual(typeof(QuoteBar), types[0].Item1);\n            Assert.AreEqual(TickType.Quote, types[0].Item2);\n            Assert.AreEqual(typeof(TradeBar), types[1].Item1);\n            Assert.AreEqual(TickType.Trade, types[1].Item2);\n            Assert.AreEqual(typeof(OpenInterest), types[2].Item1);\n            Assert.AreEqual(TickType.OpenInterest, types[2].Item2);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Future, Resolution.Tick)]\n        [TestCase(SecurityType.Option, Resolution.Tick)]\n        public void GetsSubscriptionDataTypesFuturesOptionsTick(SecurityType securityType, Resolution resolution)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution);\n\n            Assert.AreEqual(3, types.Count);\n            Assert.AreEqual(typeof(Tick), types[0].Item1);\n            Assert.AreEqual(TickType.Quote, types[0].Item2);\n            Assert.AreEqual(typeof(Tick), types[1].Item1);\n            Assert.AreEqual(TickType.Trade, types[1].Item2);\n            Assert.AreEqual(typeof(Tick), types[2].Item1);\n            Assert.AreEqual(TickType.OpenInterest, types[2].Item2);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity, Resolution.Minute)]\n        [TestCase(SecurityType.Equity, Resolution.Second)]\n        [TestCase(SecurityType.Equity, Resolution.Tick)]\n        [TestCase(SecurityType.Crypto, Resolution.Minute)]\n        [TestCase(SecurityType.Crypto, Resolution.Second)]\n        [TestCase(SecurityType.Crypto, Resolution.Tick)]\n        public void GetsSubscriptionDataTypes(SecurityType securityType, Resolution resolution)\n        {\n            var types = GetSubscriptionDataTypes(securityType, resolution);\n\n            Assert.AreEqual(2, types.Count);\n\n            if (resolution == Resolution.Tick)\n            {\n                Assert.AreEqual(typeof(Tick), types[0].Item1);\n                Assert.AreEqual(typeof(Tick), types[1].Item1);\n            }\n            else\n            {\n                Assert.AreEqual(typeof(TradeBar), types[0].Item1);\n                Assert.AreEqual(typeof(QuoteBar), types[1].Item1);\n            }\n\n            Assert.AreEqual(TickType.Trade, types[0].Item2);\n            Assert.AreEqual(TickType.Quote, types[1].Item2);\n        }\n\n        [Test]\n        public void SubscriptionsMemberIsThreadSafe()\n        {\n            var subscriptionManager = new SubscriptionManager(NullTimeKeeper.Instance);\n            subscriptionManager.SetDataManager(new DataManagerStub());\n            var start = DateTime.UtcNow;\n            var end = start.AddSeconds(5);\n            var tickers = QuantConnect.Algorithm.CSharp.StressSymbols.StockSymbols.ToList();\n            var symbols = tickers.Select(ticker => Symbol.Create(ticker, SecurityType.Equity, QuantConnect.Market.USA)).ToList();\n\n            var readTask = new TaskFactory().StartNew(() =>\n            {\n                Log.Trace(\"Read task started\");\n                while (DateTime.UtcNow < end)\n                {\n                    subscriptionManager.Subscriptions.Select(x => x.Resolution).DefaultIfEmpty(Resolution.Minute).Min();\n                    Thread.Sleep(1);\n                }\n                Log.Trace(\"Read task ended\");\n            });\n\n            while (readTask.Status != TaskStatus.Running) Thread.Sleep(1);\n\n            var addTask = new TaskFactory().StartNew(() =>\n            {\n                Log.Trace(\"Add task started\");\n                foreach (var symbol in symbols)\n                {\n                    subscriptionManager.Add(symbol, Resolution.Minute, DateTimeZone.Utc, DateTimeZone.Utc, true, false);\n                }\n                Log.Trace(\"Add task ended\");\n            });\n\n            Task.WaitAll(addTask, readTask);\n        }\n\n        [Test]\n        public void ScanPastConsolidatorsIsThreadSafe()\n        {\n            var subscriptionManager = new SubscriptionManager(new TimeKeeper(DateTime.UtcNow));\n            var algorithm = new AlgorithmStub();\n            subscriptionManager.SetDataManager(new DataManagerStub());\n            var start = DateTime.UtcNow;\n            var end = start.AddSeconds(5);\n            var tickers = QuantConnect.Algorithm.CSharp.StressSymbols.StockSymbols.Take(100).ToList();\n            var symbols = tickers.Select(ticker => Symbol.Create(ticker, SecurityType.Equity, QuantConnect.Market.USA)).ToList();\n            var consolidators = new Queue<Tuple<Symbol, IDataConsolidator>>();\n            foreach (var symbol in symbols)\n            {\n                subscriptionManager.Add(symbol, Resolution.Minute, DateTimeZone.Utc, DateTimeZone.Utc, true, false);\n            }\n\n            var scanTask = Task.Factory.StartNew(() =>\n            {\n                Log.Debug(\"ScanPastConsolidators started\");\n                while (DateTime.UtcNow < end)\n                {\n                    subscriptionManager.ScanPastConsolidators(end.AddDays(1), algorithm);\n                }\n                Log.Debug(\"ScanPastConsolidators finished\");\n            });\n\n            var addTask = Task.Factory.StartNew(() =>\n            {\n                while (scanTask.Status == TaskStatus.Running)\n                {\n                    Log.Debug(\"AddConsolidators started\");\n                    foreach (var symbol in symbols)\n                    {\n                        var consolidator = new IdentityDataConsolidator<BaseData>();\n                        subscriptionManager.AddConsolidator(symbol, consolidator);\n                        consolidators.Enqueue(new Tuple<Symbol, IDataConsolidator>(symbol, consolidator));\n                    }\n                    Log.Debug(\"AddConsolidators finished\");\n                    Assert.AreEqual(100, consolidators.Count);\n                    Log.Debug(\"RemoveConsolidators started\");\n                    while (consolidators.TryDequeue(out var pair))\n                    {\n                        subscriptionManager.RemoveConsolidator(pair.Item1, pair.Item2);\n                    }\n                    Log.Debug(\"RemoveConsolidators finished\");\n                }\n            });\n\n            Task.WaitAll(scanTask, addTask);\n            Assert.AreEqual(100, subscriptionManager.Count);\n            Assert.AreEqual(0, consolidators.Count);\n        }\n\n        [Test]\n        public void GetsCustomSubscriptionDataTypes()\n        {\n            var subscriptionManager = new SubscriptionManager(NullTimeKeeper.Instance);\n            subscriptionManager.SetDataManager(new DataManagerStub());\n            subscriptionManager.AvailableDataTypes[SecurityType.Commodity] = new List<TickType> { TickType.OpenInterest, TickType.Quote, TickType.Trade };\n            var types = subscriptionManager.LookupSubscriptionConfigDataTypes(SecurityType.Commodity, Resolution.Daily, false);\n\n            Assert.AreEqual(3, types.Count);\n\n            Assert.AreEqual(typeof(OpenInterest), types[0].Item1);\n            Assert.AreEqual(typeof(QuoteBar), types[1].Item1);\n            Assert.AreEqual(typeof(TradeBar), types[2].Item1);\n\n            Assert.AreEqual(TickType.OpenInterest, types[0].Item2);\n            Assert.AreEqual(TickType.Quote, types[1].Item2);\n            Assert.AreEqual(TickType.Trade, types[2].Item2);\n        }\n\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Future, TickType.Trade, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, TickType.Quote, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, TickType.OpenInterest, typeof(RenkoBar), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Equity, TickType.Trade, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, TickType.Quote, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, TickType.OpenInterest, typeof(RenkoBar), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.Trade, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Cfd, TickType.Quote, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, TickType.OpenInterest, typeof(RenkoBar), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Forex, TickType.Trade, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Forex, TickType.Quote, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, TickType.OpenInterest, typeof(RenkoBar), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, TickType.OpenInterest, typeof(RenkoBar), typeof(Tick), false)]\n        public void ValidatesSubscriptionTickTypesForConsolidators(\n            SecurityType securityType,\n            TickType? subscriptionTickType,\n            Type consolidatorInputType,\n            Type consolidatorOutputType,\n            bool expected)\n        {\n            var subscription = new SubscriptionDataConfig(\n                typeof(Tick),\n                Symbol.Create(\"XYZ\", securityType, QuantConnect.Market.USA),\n                Resolution.Tick,\n                DateTimeZone.Utc,\n                DateTimeZone.Utc,\n                true,\n                false,\n                false,\n                false,\n                subscriptionTickType);\n            using var consolidator = new TestConsolidator(consolidatorInputType, consolidatorOutputType);\n            Assert.AreEqual(expected, SubscriptionManager.IsSubscriptionValidForConsolidator(subscription, consolidator));\n        }\n\n        [TestCase(TickType.Trade, TickType.Trade, true)]\n        [TestCase(TickType.Trade, TickType.Quote, false)]\n        [TestCase(TickType.Trade, TickType.OpenInterest, false)]\n\n        [TestCase(TickType.Quote, TickType.Quote, true)]\n        [TestCase(TickType.Quote, TickType.Trade, false)]\n        [TestCase(TickType.Quote, TickType.OpenInterest, false)]\n\n        [TestCase(TickType.OpenInterest, TickType.OpenInterest, true)]\n        [TestCase(TickType.OpenInterest, TickType.Quote, false)]\n        [TestCase(TickType.OpenInterest, TickType.Trade, false)]\n        public void ValidatesSubscriptionTickTypesForClassicRenkoConsolidators(TickType subscriptionTickType, TickType desiredTickType, bool expected)\n        {\n            var subscription = new SubscriptionDataConfig(\n                  typeof(Tick),\n                  Symbol.Create(\"XYZ\", SecurityType.Future, QuantConnect.Market.USA),\n                  Resolution.Tick,\n                  DateTimeZone.Utc,\n                  DateTimeZone.Utc,\n                  true,\n                  false,\n                  false,\n                  false,\n                  subscriptionTickType);\n            Func<IBaseData, decimal> selector = data =>\n            {\n                var tick = data as Tick;\n                return tick.Quantity * tick.Price;\n            };\n            using var consolidator = new ClassicRenkoConsolidator(2000m, selector);\n            Assert.AreEqual(expected, SubscriptionManager.IsSubscriptionValidForConsolidator(subscription, consolidator, desiredTickType));\n        }\n\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(IBaseData), TickType.Trade, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Future, typeof(OpenInterest), TickType.Trade, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(OpenInterest), TickType.Trade, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Trade, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(IBaseData), TickType.Quote, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Future, typeof(OpenInterest), TickType.Quote, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(OpenInterest), TickType.Quote, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, TickType.Trade, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.Quote, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.OpenInterest, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Future, typeof(IBaseData), TickType.OpenInterest, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Future, typeof(Tick), TickType.OpenInterest, null, typeof(IBaseData), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(IBaseData), TickType.Trade, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Equity, typeof(OpenInterest), TickType.Trade, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(OpenInterest), TickType.Trade, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Trade, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(IBaseData), TickType.Quote, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Equity, typeof(OpenInterest), TickType.Quote, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(OpenInterest), TickType.Quote, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, TickType.Trade, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.Quote, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.OpenInterest, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Equity, typeof(IBaseData), TickType.OpenInterest, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Equity, typeof(Tick), TickType.OpenInterest, null, typeof(IBaseData), typeof(Tick), false)]\n\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(IBaseData), TickType.Trade, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.Trade, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.Trade, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Trade, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(IBaseData), TickType.Quote, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.Quote, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.Quote, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, TickType.Trade, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.Quote, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(IBaseData), TickType.OpenInterest, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.OpenInterest, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(OpenInterest), TickType.OpenInterest, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Cfd, typeof(Tick), TickType.OpenInterest, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(IBaseData), TickType.Trade, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.Trade, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.Trade, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Trade, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(IBaseData), TickType.Quote, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.Quote, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.Quote, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, TickType.Trade, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.Quote, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(IBaseData), TickType.OpenInterest, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.OpenInterest, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(OpenInterest), TickType.OpenInterest, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Forex, typeof(Tick), TickType.OpenInterest, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(IBaseData), TickType.Trade, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.Trade, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.Trade, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Trade, TickType.Trade, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(QuoteBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(IBaseData), TickType.Quote, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(IBaseData), typeof(Tick), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.Quote, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.Quote, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, TickType.Trade, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.Quote, TickType.Quote, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(Tick), typeof(QuoteBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(IBaseData), TickType.OpenInterest, null, typeof(IBaseData), typeof(RenkoBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(IBaseData), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, null, typeof(RenkoBar), typeof(Tick), false)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.OpenInterest, null, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(OpenInterest), TickType.OpenInterest, TickType.Trade, typeof(OpenInterest), typeof(TradeBar), true)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, TickType.Trade, typeof(TradeBar), typeof(TradeBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, TickType.Quote, typeof(Tick), typeof(RenkoBar), false)]\n        [TestCase(SecurityType.Crypto, typeof(Tick), TickType.OpenInterest, TickType.OpenInterest, typeof(Tick), typeof(RenkoBar), true)]\n        public void GetsExpectedSubscriptionsGivenATickType(SecurityType securityType,\n            Type subscriptionType,\n            TickType? subscriptionTickType,\n            TickType? desiredTickType,\n            Type consolidatorInputType,\n            Type consolidatorOutputType,\n            bool expected)\n        {\n            var subscription = new SubscriptionDataConfig(\n                subscriptionType,\n                Symbol.Create(\"XYZ\", securityType, QuantConnect.Market.USA),\n                Resolution.Tick,\n                DateTimeZone.Utc,\n                DateTimeZone.Utc,\n                true,\n                false,\n                false,\n                false,\n                subscriptionTickType);\n            using var consolidator = new TestConsolidator(consolidatorInputType, consolidatorOutputType);\n            Assert.AreEqual(expected, SubscriptionManager.IsSubscriptionValidForConsolidator(subscription, consolidator, desiredTickType));\n        }\n\n        [Test]\n        public void CanAddAndRemoveCSharpConsolidatorFromPython()\n        {\n            // NOTE: we use the IdentityDataConsolidator here because it's a generic class, which reproduces the bug.\n            // pyConsolidator.TryConvert(out IDataConsolidator consolidator) will return false, because the python type name\n            // and the C# type name don't match for generic types (e.g. IdentityDataConsolidator[TradeBar] != IdentityDataConsolidator`1)\n\n            using var _ = Py.GIL();\n            var module = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef get_consolidator():\n    return IdentityDataConsolidator[TradeBar]()\n\");\n\n            var algorithm = new AlgorithmStub();\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var consolidator = module.GetAttr(\"get_consolidator\").Invoke();\n\n            algorithm.SubscriptionManager.AddConsolidator(symbol, consolidator);\n            Assert.AreEqual(1, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n\n            algorithm.SubscriptionManager.RemoveConsolidator(symbol, consolidator);\n            Assert.AreEqual(0, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n        }\n\n        [Test]\n        public void CanAddAndRemoveCSharpConsolidatorFromPythonWithWrapper()\n        {\n            using var _ = Py.GIL();\n            var module = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef get_consolidator():\n    return IdentityDataConsolidator[TradeBar]()\n\");\n\n            var algorithm = new AlgorithmStub();\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var pyConsolidator = module.GetAttr(\"get_consolidator\").Invoke();\n\n            algorithm.SubscriptionManager.AddConsolidator(Symbols.SPY, pyConsolidator);\n            Assert.AreEqual(1, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n\n            algorithm.SubscriptionManager.RemoveConsolidator(Symbols.SPY, pyConsolidator);\n            Assert.AreEqual(0, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n        }\n\n        [Test]\n        public void CanAddAndRemovePythonConsolidator()\n        {\n            using var _ = Py.GIL();\n            var module = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass CustomQuoteBarConsolidator(PythonConsolidator):\n\n    def __init__(self):\n\n        #IDataConsolidator required vars for all consolidators\n        self.consolidated = None\n        self.working_data = None\n        self.input_type = QuoteBar\n        self.output_type = QuoteBar\n\n    def update(self, data):\n        pass\n\n    def scan(self, time):\n        pass\n\ndef get_consolidator():\n    return CustomQuoteBarConsolidator()\n\");\n\n            var algorithm = new AlgorithmStub();\n            var symbol = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var pyConsolidator = module.GetAttr(\"get_consolidator\").Invoke();\n\n            algorithm.SubscriptionManager.AddConsolidator(Symbols.SPY, pyConsolidator);\n            Assert.AreEqual(1, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n\n            algorithm.SubscriptionManager.RemoveConsolidator(Symbols.SPY, pyConsolidator);\n            Assert.AreEqual(0, algorithm.SubscriptionManager.Subscriptions.Sum(x => x.Consolidators.Count));\n        }\n\n        [Test]\n        public void RunRemoveConsolidatorsRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"ManuallyRemovedConsolidatorsAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"-8.91\"},\n                    {\"Tracking Error\", \"0.223\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        private class TestConsolidator : IDataConsolidator\n        {\n#pragma warning disable 0067 // TestConsolidator never uses this event; just ignore the warning\n            public event DataConsolidatedHandler DataConsolidated;\n#pragma warning restore 0067\n\n            public IBaseData Consolidated { get; }\n            public IBaseData WorkingData { get; }\n            public Type InputType { get; }\n            public Type OutputType { get; }\n            public void Update(IBaseData data) { }\n            public void Scan(DateTime currentLocalTime) { }\n            public void Dispose() { }\n\n            public TestConsolidator(Type inputType, Type outputType)\n            {\n                InputType = inputType;\n                OutputType = outputType;\n            }\n\n            public TestConsolidator(Type inputType)\n            {\n                InputType = inputType;\n            }\n\n            public void Reset()\n            {\n            }\n        }\n\n        private static List<Tuple<Type, TickType>> GetSubscriptionDataTypes(SecurityType securityType, Resolution resolution, bool isCanonical = false)\n        {\n            var subscriptionManager = new SubscriptionManager(NullTimeKeeper.Instance);\n            subscriptionManager.SetDataManager(new DataManagerStub());\n            return subscriptionManager.LookupSubscriptionConfigDataTypes(securityType, resolution, isCanonical);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/TickConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class TickConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void AggregatesNewTradeBarsProperly()\n        {\n            TradeBar newTradeBar = null;\n            using var consolidator = new TickConsolidator(4);\n            consolidator.DataConsolidated += (sender, tradeBar) =>\n            {\n                newTradeBar = tradeBar;\n            };\n            var reference = DateTime.Today;\n            var bar1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                Value = 5,\n                Quantity = 10\n            };\n            consolidator.Update(bar1);\n            Assert.IsNull(newTradeBar);\n\n            var bar2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                Value = 10,\n                Quantity = 20\n            };\n            consolidator.Update(bar2);\n            Assert.IsNull(newTradeBar);\n            var bar3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(2),\n                Value = 1,\n                Quantity = 10\n            };\n            consolidator.Update(bar3);\n            Assert.IsNull(newTradeBar);\n\n            var bar4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(3),\n                Value = 9,\n                Quantity = 20\n            };\n            consolidator.Update(bar4);\n            Assert.IsNotNull(newTradeBar);\n\n            Assert.AreEqual(Symbols.SPY, newTradeBar.Symbol);\n            Assert.AreEqual(bar1.Time, newTradeBar.Time);\n            Assert.AreEqual(bar1.Value, newTradeBar.Open);\n            Assert.AreEqual(bar2.Value, newTradeBar.High);\n            Assert.AreEqual(bar3.Value, newTradeBar.Low);\n            Assert.AreEqual(bar4.Value, newTradeBar.Close);\n            Assert.AreEqual(bar4.EndTime, newTradeBar.EndTime);\n            Assert.AreEqual(bar1.Quantity + bar2.Quantity + bar3.Quantity + bar4.Quantity, newTradeBar.Volume);\n        }\n\n        [Test]\n        public void DoesNotConsolidateDifferentSymbols()\n        {\n            using var consolidator = new TickConsolidator(2);\n\n            var reference = DateTime.Today;\n\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.AAPL,\n                Time = reference,\n                BidPrice = 1000,\n                BidSize = 20,\n                TickType = TickType.Quote,\n            };\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.ZNGA,\n                Time = reference,\n                BidPrice = 20,\n                BidSize = 30,\n                TickType = TickType.Quote,\n            };\n\n            consolidator.Update(tick1);\n\n            Exception ex = Assert.Throws<InvalidOperationException>(() => consolidator.Update(tick2));\n            Assert.IsTrue(ex.Message.Contains(\"is not the same\"));\n        }\n\n        [Test]\n        public void AggregatesPeriodInCountModeWithDailyData()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TickConsolidator(2);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference});\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddMilliseconds(1)});\n            Assert.IsNotNull(consolidated);\n\n            // The EndTime of the consolidated bar should match the EndTime of the last data point\n            Assert.AreEqual(reference.AddMilliseconds(1), consolidated.EndTime);\n            Assert.AreEqual(TimeSpan.FromMilliseconds(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddMilliseconds(2)});\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddMilliseconds(3)});\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(reference.AddMilliseconds(3), consolidated.EndTime);\n            Assert.AreEqual(TimeSpan.FromMilliseconds(1), consolidated.Period);\n        }\n\n        [Test]\n        public void AggregatesPeriodInPeriodModeWithDailyData()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TickConsolidator(TimeSpan.FromDays(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference});\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddDays(1)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(2)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(3)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n        }\n\n        [Test]\n        public void AggregatesPeriodInPeriodModeWithDailyDataAndRoundedTime()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TickConsolidator(TimeSpan.FromDays(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new Tick { Time = reference.AddSeconds(5) });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new Tick { Time = reference.AddDays(1).AddSeconds(15) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference, consolidated.Time);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(2).AddMinutes(1) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference.AddDays(1), consolidated.Time);\n            consolidated = null;\n\n            consolidator.Update(new Tick { Time = reference.AddDays(3).AddMinutes(5) });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(TimeSpan.FromDays(1), consolidated.Period);\n            Assert.AreEqual(reference.AddDays(2), consolidated.Time);\n        }\n\n        [Test]\n        public void AggregatesNewTicksInPeriodWithRoundedTime()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TickConsolidator(TimeSpan.FromMinutes(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 06, 02);\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(3),\n                Value = 1.1000m\n            };\n            consolidator.Update(tick1);\n            Assert.IsNull(consolidated);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(10),\n                Value = 1.1005m\n            };\n            consolidator.Update(tick2);\n            Assert.IsNull(consolidated);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(61),\n                Value = 1.1010m\n            };\n            consolidator.Update(tick3);\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(consolidated.Time, reference);\n            Assert.AreEqual(consolidated.Open, tick1.Value);\n            Assert.AreEqual(consolidated.Close, tick2.Value);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(70),\n                Value = 1.1015m\n            };\n            consolidator.Update(tick4);\n            Assert.IsNotNull(consolidated);\n\n            var tick5 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(118),\n                Value = 1.1020m\n            };\n            consolidator.Update(tick5);\n            Assert.IsNotNull(consolidated);\n\n            var tick6 = new Tick\n            {\n                Symbol = Symbols.EURUSD,\n                Time = reference.AddSeconds(140),\n                Value = 1.1025m\n            };\n            consolidator.Update(tick6);\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(consolidated.Time, reference.AddSeconds(60));\n            Assert.AreEqual(consolidated.Open, tick3.Value);\n            Assert.AreEqual(consolidated.Close, tick5.Value);\n        }\n\n        [Test]\n        public void ProcessesTradeTicksOnly()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TickConsolidator(TimeSpan.FromMinutes(1));\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 06, 02);\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(3),\n                Value = 200m\n            };\n            consolidator.Update(tick1);\n            Assert.IsNull(consolidated);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(10),\n                Value = 20000m,\n                TickType = TickType.OpenInterest\n            };\n            consolidator.Update(tick2);\n            Assert.IsNull(consolidated);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(10),\n                Value = 10000m,\n                TickType = TickType.Quote\n            };\n            consolidator.Update(tick3);\n            Assert.IsNull(consolidated);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(61),\n                Value = 250m\n            };\n            consolidator.Update(tick4);\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(consolidated.Time, reference);\n            Assert.AreEqual(consolidated.Open, tick1.Value);\n            Assert.AreEqual(consolidated.Close, tick1.Value);\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new TickConsolidator(2);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = DateTime.Today;\n            return new List<Tick>()\n            {\n                new Tick(){Symbol = Symbols.SPY, Time = time, Value = 10 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(1), Value = 2 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(2), Value = 8 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(3), Value = 5 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(4), Value = 13 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(5), Value = 15 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(6), Value = 10 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(7), Value = 11 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(8), Value = 11 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(9), Value = 4 },\n                new Tick(){Symbol = Symbols.SPY, Time = time.AddSeconds(10), Value = 7 },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/TickQuoteBarConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class TickQuoteBarConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void AggregatesNewQuoteBarProperly()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new TickQuoteBarConsolidator(4);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n            var reference = DateTime.Today;\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                BidPrice = 10,\n                BidSize = 20,\n                TickType = TickType.Quote\n            };\n            creator.Update(tick1);\n            Assert.IsNull(quoteBar);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                AskPrice = 20,\n                AskSize = 10,\n                TickType = TickType.Quote\n            };\n\n            var badTick = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(1),\n                AskPrice = 25,\n                AskSize = 100,\n                BidPrice = -100,\n                BidSize = 2,\n                Value = 50,\n                Quantity = 1234,\n                TickType = TickType.Trade\n            };\n            creator.Update(badTick);\n            Assert.IsNull(quoteBar);\n            \n            creator.Update(tick2);\n            Assert.IsNull(quoteBar);\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(2),\n                BidPrice = 12,\n                BidSize = 50,\n                TickType = TickType.Quote\n            };\n            creator.Update(tick3);\n            Assert.IsNull(quoteBar);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddHours(3),\n                AskPrice = 17,\n                AskSize = 15,\n                TickType = TickType.Quote\n            };\n            creator.Update(tick4);\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(Symbols.SPY, quoteBar.Symbol);\n            Assert.AreEqual(tick1.Time, quoteBar.Time);\n            Assert.AreEqual(tick4.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Low);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.High);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Close);\n            Assert.AreEqual(tick3.BidSize, quoteBar.LastBidSize);\n\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Low);\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.High);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Close);\n            Assert.AreEqual(tick4.AskSize, quoteBar.LastAskSize);\n        }\n\n        [Test]\n        public void DoesNotConsolidateDifferentSymbols()\n        {\n            using var consolidator = new TickQuoteBarConsolidator(2);\n\n            var reference = DateTime.Today;\n\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.AAPL,\n                Time = reference,\n                BidPrice = 1000,\n                BidSize = 20,\n                TickType = TickType.Quote,\n            };\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.ZNGA,\n                Time = reference,\n                BidPrice = 20,\n                BidSize = 30,\n                TickType = TickType.Quote,\n            };\n\n            consolidator.Update(tick1);\n\n            Exception ex = Assert.Throws<InvalidOperationException>(() => consolidator.Update(tick2));\n            Assert.IsTrue(ex.Message.Contains(\"is not the same\"));\n        }\n\n        [Test]\n        public void LastCloseAndCurrentOpenPriceShouldBeSameConsolidatedOnCount()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new TickQuoteBarConsolidator(2);\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var reference = DateTime.Today;\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                TickType = TickType.Quote,\n                AskPrice = 0,\n                BidPrice = 24,\n\n            };\n            creator.Update(tick1);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                TickType = TickType.Quote,\n                AskPrice = 25,\n                BidPrice = 0,\n\n            };\n            creator.Update(tick2);\n\n            // bar 1 emitted\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open);\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Close);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Close);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(1),\n                TickType = TickType.Quote,\n                AskPrice = 36,\n                BidPrice = 35,\n            };\n            creator.Update(tick3);\n            creator.Update(tick3);\n\n            // bar 2 emitted\n            // ask is from tick 2\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open, \"Ask Open not equal to Previous Close\");\n            // bid is from tick 1\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open, \"Bid Open not equal to Previous Close\");\n            Assert.AreEqual(tick3.AskPrice, quoteBar.Ask.Close, \"Ask Close incorrect\");\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Close, \"Bid Close incorrect\");\n        }\n\n        [Test]\n        public void LastCloseAndCurrentOpenPriceShouldBeSameConsolidatedOnTimeSpan()\n        {\n            QuoteBar quoteBar = null;\n            using var creator = new TickQuoteBarConsolidator(TimeSpan.FromMinutes(1));\n            creator.DataConsolidated += (sender, args) =>\n            {\n                quoteBar = args;\n            };\n\n            var reference = DateTime.Today;\n\n            // timeframe 1 \n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                TickType = TickType.Quote,\n                AskPrice = 25,\n                BidPrice = 24,\n            };\n            creator.Update(tick1);\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(1),\n                TickType = TickType.Quote,\n                AskPrice = 26,\n                BidPrice = 0,\n            };\n            creator.Update(tick2);\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(1),\n                TickType = TickType.Quote,\n                AskPrice = 0,\n                BidPrice = 25,\n            };\n            creator.Update(tick3);\n\n            // timeframe 2 \n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddMinutes(1),\n                TickType = TickType.Quote,\n                AskPrice = 36,\n                BidPrice = 35,\n            };\n            creator.Update(tick4);\n\n            \n            //force the consolidator to emit DataConsolidated\n            creator.Scan(reference.AddMinutes(2));\n\n            // bid is from tick 2\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open, \"Ask Open not equal to Previous Close\");\n            // bid is from tick 3\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Open, \"Bid Open not equal to Previous Close\");\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Close, \"Ask Close incorrect\");\n            Assert.AreEqual(tick4.BidPrice, quoteBar.Bid.Close, \"Bid Close incorrect\");\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new TickQuoteBarConsolidator(2);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = DateTime.Today;\n            return new List<Tick>()\n            {\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time, Value = 10, AskPrice = 10, BidPrice = 5 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(1), Value = 2, AskPrice = 10, BidPrice = 7 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(2), Value = 8, AskPrice = 11, BidPrice = 9 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(3), Value = 5, AskPrice = 15, BidPrice = 6 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(4), Value = 13, AskPrice = 15, BidPrice = 7 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(5), Value = 15 , AskPrice = 13, BidPrice = 8 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(6), Value = 10 , AskPrice = 14, BidPrice = 7 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(7), Value = 11 , AskPrice = 13, BidPrice = 8 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(8), Value = 11 , AskPrice = 14, BidPrice = 6 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(9), Value = 4 , AskPrice = 14, BidPrice = 9 },\n                new Tick(){Symbol = Symbols.SPY, TickType = TickType.Quote, Time = time.AddSeconds(10), Value = 7 , AskPrice = 13, BidPrice = 5 },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/TradeBarConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class TradeBarConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void ZeroCountAlwaysFires()\n        {\n            // defining a TradeBarConsolidator with a zero max count should cause it to always fire identity\n\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(0);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNotNull(consolidated);\n        }\n\n        [Test]\n        public void OneCountAlwaysFires()\n        {\n            // defining a TradeBarConsolidator with a one max count should cause it to always fire identity\n\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(1);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNotNull(consolidated);\n        }\n\n        [Test]\n        public void TwoCountFiresEveryOther()\n        {\n            // defining a TradeBarConsolidator with a two max count should cause it to fire every other TradeBar\n\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(2);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNotNull(consolidated);\n\n            consolidated = null;\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar());\n            Assert.IsNotNull(consolidated);\n        }\n\n        [Test]\n        public void ZeroSpanAlwaysThrows()\n        {\n            // defining a TradeBarConsolidator with a zero period should cause it to always throw an exception\n\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(TimeSpan.Zero);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2014, 12, 01, 01, 01, 00);\n            Assert.Throws<ArgumentException>(() => consolidator.Update(new TradeBar { Time = reference, Period = Time.OneDay }));\n        }\n\n        [Test]\n        public void ConsolidatesOHLCV()\n        {\n            // verifies that the TradeBarConsolidator correctly consolidates OHLCV data into a new TradeBar instance\n\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(3);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var tb1 = new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Open = 10,\n                High = 100,\n                Low = 1,\n                Close = 50,\n                Volume = 75,\n                DataType = MarketDataType.TradeBar\n            };\n\n            var tb2 = new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Open = 50,\n                High = 123,\n                Low = 35,\n                Close = 75,\n                Volume = 100,\n                DataType = MarketDataType.TradeBar  \n            };\n\n            var tb3 = new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Open = 75,\n                High = 100,\n                Low = 50,\n                Close = 83,\n                Volume = 125,\n                DataType = MarketDataType.TradeBar\n            };\n\n            consolidator.Update(tb1);\n            consolidator.Update(tb2);\n            consolidator.Update(tb3);\n\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(Symbols.SPY, consolidated.Symbol);\n            Assert.AreEqual(10m, consolidated.Open);\n            Assert.AreEqual(123m, consolidated.High);\n            Assert.AreEqual(1m, consolidated.Low);\n            Assert.AreEqual(83m, consolidated.Close);\n            Assert.AreEqual(300L, consolidated.Volume);\n        }\n\n        [Test]\n        public void DoesNotConsolidateDifferentSymbols()\n        {\n            // verifies that the TradeBarConsolidator does not consolidate data with different symbols\n\n            using var consolidator = new TradeBarConsolidator(2);\n\n            var tb1 = new TradeBar\n            {\n                Symbol = Symbols.AAPL,\n                Open = 10,\n                High = 100,\n                Low = 1,\n                Close = 50,\n                Volume = 75,\n                DataType = MarketDataType.TradeBar\n            };\n\n            var tb2 = new TradeBar\n            {\n                Symbol = Symbols.ZNGA,\n                Open = 50,\n                High = 123,\n                Low = 35,\n                Close = 75,\n                Volume = 100,\n                DataType = MarketDataType.TradeBar\n            };\n\n            consolidator.Update(tb1);\n\n            Exception ex = Assert.Throws<InvalidOperationException>(() => consolidator.Update(tb2));\n            Assert.IsTrue(ex.Message.Contains(\"is not the same\", StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [Test]\n        public void ConsolidatedTimeIsFromBeginningOfBar()\n        {\n            // verifies that the consolidated bar uses the time from the beginning of the first bar\n            // in the period that covers the current bar\n\n            using var consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(2));\n\n            TradeBar consolidated = null;\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2014, 12, 1, 10, 00, 0);\n\n            //10:00 - start new\n            consolidator.Update(new TradeBar {Time = reference});\n            Assert.IsNull(consolidated);\n\n            //10:01 - aggregate\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(1)});\n            Assert.IsNull(consolidated);\n\n            //10:02 - fire & start new\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(2)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n            consolidated = null;\n\n            //10:03 - aggregate\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(3)});\n            Assert.IsNull(consolidated);\n\n            //10:05 - fire & start new\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(5)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference.AddMinutes(2), consolidated.Time);\n            consolidated = null;\n\n            //10:08 - fire & start new\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(8)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference.AddMinutes(4), consolidated.Time);\n            consolidated = null;\n\n            //10:08:01 - aggregate\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(8).AddSeconds(1)});\n            Assert.IsNull(consolidated);\n\n            //10:09 - aggregate\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(9)});\n            Assert.IsNull(consolidated);\n        }\n\n        [Test]\n        public void HandlesDataGapsInMixedMode()\n        {\n            // define a three minute consolidator on a one minute stream of data\n            using var consolidator = new TradeBarConsolidator(3, TimeSpan.FromMinutes(3));\n\n            TradeBar consolidated = null;\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2014, 12, 1, 10, 00, 0);\n\n            //10:00 - new\n            consolidator.Update(new TradeBar {Time = reference});\n            Assert.IsNull(consolidated);\n\n            //10:01 - aggregate\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(1)});\n            Assert.IsNull(consolidated);\n            \n            //10:02 - fire\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(2)});\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n\n            //10:03 - new\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(3)});\n            Assert.AreEqual(reference, consolidated.Time);\n\n            //10:06 - aggregate/fire\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(6)});\n            Assert.AreEqual(reference.AddMinutes(3), consolidated.Time);\n\n            //10:08 - new/fire -- will have timestamp from 10:08, instead of 10:06\n            consolidator.Update(new TradeBar {Time = reference.AddMinutes(8)});\n            Assert.AreEqual(reference.AddMinutes(8), consolidated.Time);\n        }\n\n        [Test]\n        public void HandlesGappingAcrossDays()\n        {\n            // this test requires inspection to verify we're getting clean bars on the correct times\n\n            using var consolidator = new TradeBarConsolidator(TimeSpan.FromHours(1));\n\n            TradeBar consolidated = null;\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            // from 1/1 9:30 to 1/2 12:00 by minute\n            var start = new DateTime(2014, 01, 01, 09, 30, 00, 00);\n            var end =   new DateTime(2014, 01, 02, 12, 00, 00, 00);\n            foreach (var bar in StreamTradeBars(start, end, TimeSpan.FromMinutes(1)))\n            {\n                consolidator.Update(bar);\n            }\n        }\n\n        /// <summary>\n        /// Testing the behaviors where, the bar range is closed on the left and open on \n        /// the right in time span mode: [T, T+TimeSpan).\n        /// For example, if time span is 1 minute, we have [10:00, 10:01): so data at \n        /// 10:01 is not included in the bar starting at 10:00.\n        /// </summary>\n        [Test]\n        public void ClosedLeftOpenRightInTimeSpanModeTest()\n        {\n            // define a three minute consolidator \n            int timeSpanUnits = 3;\n            using var consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(timeSpanUnits));\n\n            TradeBar consolidated = null;\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var refDateTime = new DateTime(2014, 12, 1, 10, 00, 0);\n\n            // loop for 3 times the timeSpanUnits + 1, so it would consolidate the bars 3 times\n            for (int i=0; i < 3*timeSpanUnits + 1 ; ++i) \n            {\n                consolidator.Update(new TradeBar { Time = refDateTime });\n\n                if (i < timeSpanUnits)  // before initial consolidation happens\n                {\n                    Assert.IsNull(consolidated);\n                }\n                else \n                {\n                    Assert.IsNotNull(consolidated);\n                    if (i % timeSpanUnits == 0) // i = 3, 6, 9\n                    {\n                        Assert.AreEqual(refDateTime.AddMinutes(-timeSpanUnits), consolidated.Time);\n                    }\n                }\n\n                refDateTime = refDateTime.AddMinutes(1);\n            }\n        }\n\n        [Test]\n        public void AggregatesPeriodInCountModeWithDailyData()\n        {\n            TradeBar consolidated = null;\n            var period = TimeSpan.FromDays(1);\n            using var consolidator = new TradeBarConsolidator(2);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new TradeBar { Time = reference, Period = period});\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(1), Period = period });\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(TimeSpan.FromDays(2), consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(2), Period = period });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(3), Period = period });\n            Assert.IsNotNull(consolidated);\n\n            Assert.AreEqual(TimeSpan.FromDays(2), consolidated.Period);\n        }\n\n        [Test]\n        public void AggregatesPeriodInPeriodModeWithDailyData()\n        {\n            TradeBar consolidated = null;\n            var period = TimeSpan.FromDays(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new TradeBar { Time = reference, Period = Time.OneDay});\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(1), Period = Time.OneDay });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(2), Period = Time.OneDay });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(period, consolidated.Period);\n            consolidated = null;\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(3), Period = Time.OneDay });\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = reference.AddDays(4), Period = Time.OneDay });\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(period, consolidated.Period);\n        }\n\n        [Test]\n        public void ThrowsWhenPeriodIsSmallerThanDataPeriod()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(Time.OneHour);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            Assert.Throws<ArgumentException>(() => consolidator.Update(new TradeBar { Time = reference, Period = Time.OneDay }));\n        }\n\n        [Test]\n        public void GentlyHandlesPeriodAndDataAreSameResolution()\n        {\n            TradeBar consolidated = null;\n            using var consolidator = new TradeBarConsolidator(Time.OneDay);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            var bar = new TradeBar { Time = reference, Period = Time.OneDay };\n            consolidator.Update(bar);\n\n            Assert.IsNull(consolidated);\n            consolidator.Scan(bar.EndTime);\n            Assert.IsNotNull(consolidated);\n\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n            Assert.AreEqual(Time.OneDay, consolidated.Period);\n        }\n\n        [Test]\n        public void FiresEventAfterTimePassesViaScan()\n        {\n            TradeBar consolidated = null;\n            var period = TimeSpan.FromDays(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13);\n            consolidator.Update(new TradeBar { Time = reference, Period = Time.OneDay });\n            Assert.IsNull(consolidated);\n\n            consolidator.Scan(reference + period);\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n        }\n\n        [Test]\n        public void ConsolidatedPeriodEqualsTimeBasedConsolidatorPeriod()\n        {\n            TradeBar consolidated = null;\n            var period = TimeSpan.FromMinutes(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13, 10, 20, 0);\n            var time = reference;\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneMinute });\n            time = reference.Add(period);\n            consolidator.Scan(time);\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n            Assert.AreEqual(period, consolidated.Period);\n        }\n\n        [Test]\n        public void FiresEventAfterTimePassesViaScanWithMultipleResolutions()\n        {\n            TradeBar consolidated = null;\n            var period = TimeSpan.FromMinutes(2);\n            using var consolidator = new TradeBarConsolidator(period);\n            consolidator.DataConsolidated += (sender, bar) =>\n            {\n                consolidated = bar;\n            };\n\n            var reference = new DateTime(2015, 04, 13, 10, 20, 0);\n            var time = reference; \n\n            for (int i = 0; i < 10; i++)\n            {\n                consolidator.Update(new TradeBar {Time = time, Period = Time.OneSecond});\n                time = time.AddSeconds(1);\n                consolidator.Scan(time);\n                Assert.IsNull(consolidated);\n            }\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneMinute });\n            time = reference.Add(period);\n            consolidator.Scan(time);\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference, consolidated.Time);\n            Assert.AreEqual(period, consolidated.Period);\n\n            consolidated = null;\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneSecond });\n            time = time.AddSeconds(1);\n            consolidator.Scan(time);\n            Assert.IsNull(consolidated);\n\n            time = time.AddSeconds(-1);\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneMinute });\n            time = time.AddMinutes(1);\n            consolidator.Scan(time);\n            Assert.IsNull(consolidated);\n\n            consolidator.Update(new TradeBar { Time = time, Period = Time.OneMinute });\n            time = time.AddMinutes(1);\n            consolidator.Scan(time);\n            Assert.IsNotNull(consolidated);\n            Assert.AreEqual(reference.AddMinutes(2), consolidated.Time);\n            Assert.AreEqual(period, consolidated.Period);\n        }\n\n        private readonly TimeSpan marketStop = new DateTime(2000, 1, 1, 12 + 4, 0, 0).TimeOfDay;\n        private readonly TimeSpan marketStart = new DateTime(2000, 1, 1, 9, 30, 0).TimeOfDay;\n        private IEnumerable<TradeBar> StreamTradeBars(DateTime start, DateTime end, TimeSpan resolution, bool skipAferMarketHours = true)\n        {\n            DateTime current = start;\n            while (current < end)\n            {\n                var timeOfDay = current.TimeOfDay;\n                if (skipAferMarketHours && (marketStart > timeOfDay || marketStop < timeOfDay))\n                {\n                    // set current to the next days market start\n                    current = current.Date.AddDays(1).Add(marketStart);\n                    continue;\n                }\n                \n                // either we don't care about after market hours or it's within regular market hours\n                yield return new TradeBar {Time = current};\n                current = current + resolution;\n            }\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new TradeBarConsolidator(2);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2015, 04, 13, 8, 31, 0);\n            return new List<TradeBar>()\n            {\n                new TradeBar(){ Time = time, Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10 },\n                new TradeBar(){ Time = time.AddMinutes(1), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12 },\n                new TradeBar(){ Time = time.AddMinutes(2), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 10 },\n                new TradeBar(){ Time = time.AddMinutes(3), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 5 },\n                new TradeBar(){ Time = time.AddMinutes(4), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 15 },\n                new TradeBar(){ Time = time.AddMinutes(5), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 20 },\n                new TradeBar(){ Time = time.AddMinutes(6), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 18 },\n                new TradeBar(){ Time = time.AddMinutes(7), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 12 },\n                new TradeBar(){ Time = time.AddMinutes(8), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 25 },\n                new TradeBar(){ Time = time.AddMinutes(9), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 30 },\n                new TradeBar(){ Time = time.AddMinutes(10), Period = Time.OneMinute, Symbol = Symbols.SPY, High = 26 },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/CoarseFundamentalTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class CoarseFundamentalTests\n    {\n        [Test, TestCaseSource(nameof(TestParameters))]\n        public void ParsesCoarseCsvLine(string line, bool hasFundamentalData, decimal price, decimal priceFactor, decimal splitFactor, decimal adjustedPrice)\n        {\n            var cf = (CoarseFundamental)CoarseFundamentalDataProvider.Read(line, DateTime.MinValue);\n\n            Assert.AreEqual(hasFundamentalData, cf.HasFundamentalData);\n            Assert.AreEqual(price, cf.Price);\n            Assert.AreEqual(priceFactor, cf.PriceFactor);\n            Assert.AreEqual(splitFactor, cf.SplitFactor);\n            Assert.AreEqual(adjustedPrice, cf.AdjustedPrice);\n        }\n\n        public static object[] TestParameters =\n        {\n            new object[] { \"AAPL R735QTJ8XC9X,AAPL,537.46,5483955,3490219402,True\", true, 537.46m, 1m, 1m, 537.46m },\n            new object[] { \"AAPL R735QTJ8XC9X,AAPL,645.57,7831583,5055835037,True,0.9304792,0.142857\", true, 645.57m, 0.9304792m, 0.142857m, 85.812693779220408m },\n            new object[] { \"AAPL R735QTJ8XC9X,AAPL,93.7,37807206,3542535202,True,0.9304792,1\", true, 93.7m, 0.9304792m, 1m, 87.18590104m },\n        };\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/ConstituentsUniverseDataTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class ConstituentsUniverseDataTests\n    {\n        private SubscriptionDataConfig _config;\n        private SecurityExchangeHours _exchangeHours;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.AAPL,\n                Resolution.Second,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                false);\n            _exchangeHours = MarketHoursDatabase.FromDataFolder()\n                 .GetEntry(Symbols.AAPL.ID.Market, Symbols.AAPL, Symbols.AAPL.ID.SecurityType).ExchangeHours;\n        }\n\n        [Test]\n        public void BacktestSourceForEachTradableDate()\n        {\n            var reader = new ConstituentsUniverseData();\n\n            var tradableDays = Time.EachTradeableDayInTimeZone(_exchangeHours,\n                new DateTime(2019, 06, 9), // sunday\n                new DateTime(2019, 06, 16),\n                _config.DataTimeZone,\n                _config.ExtendedMarketHours);\n\n            foreach (var tradableDay in tradableDays)\n            {\n                if (tradableDay.DayOfWeek == DayOfWeek.Saturday\n                    || tradableDay.DayOfWeek == DayOfWeek.Sunday)\n                {\n                    Assert.Fail($\"Unexpected tradable DayOfWeek {tradableDay.DayOfWeek}\");\n                }\n\n                var source = reader.GetSource(_config, tradableDay, false);\n                // Mon to Friday\n                Assert.IsTrue(source.Source.Contains($\"{tradableDay:yyyyMMdd}\"));\n            }\n        }\n\n        [Test]\n        public void BacktestDataTimeForEachTradableDate()\n        {\n            var reader = new ConstituentsUniverseData();\n\n            var tradableDays = Time.EachTradeableDayInTimeZone(_exchangeHours,\n                new DateTime(2019, 06, 9), // sunday\n                new DateTime(2019, 06, 16),\n                _config.DataTimeZone,\n                _config.ExtendedMarketHours);\n\n            foreach (var tradableDay in tradableDays)\n            {\n                var dataPoint = reader.Reader(_config, \"NONE,NONE 0\", tradableDay, false);\n                Assert.AreEqual(dataPoint.Time, tradableDay);\n                // emitted tomorrow\n                Assert.AreEqual(dataPoint.EndTime, tradableDay.AddDays(1));\n            }\n        }\n\n        [Test]\n        public void LiveSourceForCurrentDate()\n        {\n            var reader = new ConstituentsUniverseData();\n\n            var currentTime = DateTime.UtcNow;\n            var source = reader.GetSource(_config, currentTime, true);\n            // From Tue to Sat will find files from Mon to Friday\n            Assert.IsTrue(source.Source.Contains($\"{currentTime.AddDays(-1):yyyyMMdd}\"));\n        }\n\n        [Test]\n        public void LiveDataTimeForCurrentDate()\n        {\n            var reader = new ConstituentsUniverseData();\n\n            var currentTime = DateTime.UtcNow;\n\n            var dataPoint = reader.Reader(_config, \"NONE,NONE 0\", currentTime, true);\n            Assert.AreEqual(dataPoint.Time, currentTime.AddDays(-1));\n            // emitted right away\n            Assert.AreEqual(dataPoint.EndTime, currentTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/OptionUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OptionUniverseTests\n    {\n        private static string TestOptionUniverseFile = @\"\n#expiry,strike,right,open,high,low,close,volume,open_interest,implied_volatility,delta,gamma,vega,theta,rho\n,,,5488.47998046875,5523.64013671875,5451.1201171875,5460.47998046875,7199220000,,,,,,,\n20260618,5400,C,780.3000,853.9000,709.6000,767.7500,0,135,0.1637928,0.6382026,0.0002890,26.5721377,-0.5042690,55.5035521\n20261218,5400,C,893.1400,907.7100,893.1400,907.5400,37,1039,0.1701839,0.6420671,0.0002447,28.9774913,-0.4608812,67.5259867\n20271217,5400,C,1073.0000,1073.0000,1073.0000,1073.0000,0,889,0.1839256,0.6456981,0.0001858,32.6109403,-0.3963479,88.5870185\n20281215,5400,C,1248.0000,1248.0000,1248.0000,1248.0000,0,301,0.1934730,0.6472619,0.0001512,35.1083627,-0.3434647,106.9858230\n20291221,5400,C,1467.9000,1467.9000,1467.9000,1467.9000,0,9,0.2046702,0.6460372,0.0001254,36.9157598,-0.2993105,122.2236355\n20240719,5405,C,95.4500,95.4500,95.4500,95.4500,1,311,0.1006795,0.6960459,0.0026897,4.4991247,-1.4284818,2.0701880\n20240816,5405,C,161.4000,161.4000,161.4000,161.4000,0,380,0.1088739,0.6472976,0.0017128,7.3449930,-1.1139626,4.5112640\n20240920,5405,C,213.7000,213.7000,211.0000,211.0000,0,33,0.1149306,0.6316343,0.0012532,9.7567496,-0.9462173,7.4872272\n20241018,5405,C,254.0000,303.3500,218.2500,238.0500,0,0,0.1183992,0.6273390,0.0010556,11.2892617,-0.8673778,9.8420483\n20240719,5410,C,143.5900,143.5900,119.7100,119.7100,11,355,0.0995106,0.6842402,0.0027673,4.5750811,-1.4291241,2.0364155\n20240816,5410,C,151.2000,151.2000,151.2000,151.2000,0,68,0.1080883,0.6395066,0.0017388,7.4027436,-1.1113164,4.4598077\n20240920,5410,C,202.5000,202.5000,201.9800,201.9800,0,211,0.1142983,0.6258911,0.0012667,9.8073284,-0.9438102,7.4239078\n20241018,5410,C,256.4800,256.4800,255.9000,255.9000,0,91,0.1180060,0.6223570,0.0010637,11.3388534,-0.8661655,9.7694707\n20241115,5410,C,279.7500,279.7500,279.2300,279.2300,0,65,0.1268034,0.6170056,0.0008881,12.7072390,-0.8357895,11.9829003\n20240719,5415,C,123.1800,123.1800,98.0300,98.0300,5,307,0.0985516,0.6716430,0.0028403,4.6505424,-1.4312099,2.0001484\n20240816,5415,C,146.6900,146.6900,146.6900,146.6900,3,901,0.1073207,0.6315307,0.0017645,7.4585091,-1.1084001,4.4069495\n20240920,5415,C,194.1000,196.7000,194.1000,196.7000,0,63,0.1136398,0.6200837,0.0012804,9.8561442,-0.9410592,7.3597879\n20241018,5415,C,246.5000,295.7500,210.7500,230.9500,0,0,0.1172852,0.6175838,0.0010746,11.3844988,-0.8632046,9.7014393\n20240719,5420,C,119.7500,119.7500,94.0000,94.0000,31,453,0.0973479,0.6589639,0.0029188,4.7207612,-1.4288180,1.9636645\n20240816,5420,C,181.5800,181.5800,154.8300,154.8300,4,110,0.1065704,0.6233721,0.0017897,7.5120648,-1.1051922,4.3527055\n\".TrimStart();\n\n        private List<OptionUniverse> _optionUniverseFile;\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            var config = new SubscriptionDataConfig(typeof(OptionUniverse),\n                Symbol.CreateCanonicalOption(Symbols.SPX),\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var date = new DateTime(2024, 06, 28);\n\n            _optionUniverseFile = new List<OptionUniverse>();\n            var factory = new OptionUniverse();\n            using var stream = new MemoryStream(Encoding.UTF8.GetBytes(TestOptionUniverseFile));\n            using var reader = new StreamReader(stream);\n            while (!reader.EndOfStream)\n            {\n                var data = (OptionUniverse)factory.Reader(config, reader, date, false);\n                if (data == null) continue;\n                _optionUniverseFile.Add(data);\n            }\n        }\n\n        [Test]\n        public void RoundTripCsvConversion()\n        {\n            var stringBuilder = new StringBuilder();\n            stringBuilder.AppendLine(\"#\" + OptionUniverse.CsvHeader(SecurityType.Option));\n\n            foreach (var data in _optionUniverseFile)\n            {\n                string csv = null;\n                if (data.Symbol.SecurityType.IsOption())\n                {\n                    csv = OptionUniverse.ToCsv(data.Symbol, data.Open, data.High, data.Low, data.Close, data.Volume, data.OpenInterest,\n                        data.ImpliedVolatility, data.Greeks);\n                }\n                else\n                {\n                    csv = OptionUniverse.ToCsv(data.Symbol, data.Open, data.High, data.Low, data.Close, data.Volume, null, null, null);\n                }\n\n                stringBuilder.AppendLine(csv);\n            }\n\n            var csvString = stringBuilder.ToString();\n            Assert.AreEqual(TestOptionUniverseFile, csvString);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/ScheduledUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class ScheduledUniverseTests\n    {\n        private DateTimeZone _timezone;\n        private TimeKeeper _timekeeper;\n        private SecurityManager _securities;\n        private DateRules _dateRules;\n        private TimeRules _timeRules;\n\n        [SetUp]\n        public void Setup()\n        {\n            _timezone = TimeZones.NewYork;\n            _timekeeper = new TimeKeeper(new DateTime(2000, 1, 1), _timezone);\n            _securities = new SecurityManager(_timekeeper);\n\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            _dateRules = new DateRules(null, _securities, _timezone, mhdb);\n            _timeRules = new TimeRules(null, _securities, _timezone, mhdb);\n        }\n\n        [Test]\n        public void TimeTriggeredDoesNotReturnPastTimes()\n        {\n            // Schedule our universe for 12PM each day\n            using var universe = new ScheduledUniverse( \n                _dateRules.EveryDay(), _timeRules.At(12, 0),\n                (time =>\n                {\n                    return new List<Symbol>();\n                })\n            );\n\n            // For this test; start time will be 1/5/2000 wednesday at 3PM\n            // which is after 12PM, this case will ensure we don't have a 1/5 12pm event\n            var start = new DateTime(2000, 1, 5, 15, 0, 0);\n            var end = new DateTime(2000, 1, 10);\n\n            // Get our trigger times, these will be in UTC\n            var triggerTimesUtc = universe.GetTriggerTimes(start.ConvertToUtc(_timezone), end.ConvertToUtc(_timezone), MarketHoursDatabase.AlwaysOpen);\n\n            // Setup expectDate variables to assert behavior\n            // We expect the first day to be 1/6 12PM\n            var expectedDate = new DateTime(2000, 1, 6, 12, 0, 0);\n\n            foreach (var time in triggerTimesUtc)\n            {\n                // Convert our UTC time back to our timezone\n                var localTime = time.ConvertFromUtc(_timezone);\n\n                // Assert we aren't receiving dates prior to our start\n                Assert.IsTrue(localTime > start);\n\n                // Verify the date\n                Assert.AreEqual(expectedDate, localTime);\n                expectedDate = expectedDate.AddDays(1);\n            }\n        }\n\n        [Test]\n        public void TriggerTimesNone()\n        {\n            // Test to see what happens when we expect no trigger times.\n            // To do this we will create an everyday at 12pm rule, but ask for triggers times\n            // on a single day from 3pm-4pm, meaning we should get none.\n            var timezone = TimeZones.NewYork;\n            var start = new DateTime(2000, 1, 5, 15, 0, 0);\n            var end = new DateTime(2000, 1, 5, 16,0,0);\n\n            var dateRule = _dateRules.EveryDay();\n            var timeRule = _timeRules.At(12, 0);\n\n            using var universe = new ScheduledUniverse(dateRule, timeRule, time =>\n            {\n                return new List<Symbol>();\n            });\n\n            var triggerTimesUtc = universe.GetTriggerTimes(start.ConvertToUtc(timezone), end.ConvertToUtc(timezone),\n                MarketHoursDatabase.AlwaysOpen);\n\n            // Assert that its empty\n            Assert.IsTrue(!triggerTimesUtc.Any());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/SecurityChangesTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class SecurityChangesTests\n    {\n        [Test]\n        public void WillNotFilterCustomSecuritiesByDefault()\n        {\n            var security = new Security(Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            var customSecurity = new Security(Symbol.CreateBase(typeof(TradeBar), Symbols.SPY, QuantConnect.Market.USA),\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            var changes = CreateNonInternal(new List<Security> { security, customSecurity },\n                new List<Security> { security, customSecurity });\n\n            Assert.IsTrue(changes.AddedSecurities.Contains(customSecurity));\n            Assert.IsTrue(changes.AddedSecurities.Contains(security));\n\n            Assert.IsTrue(changes.RemovedSecurities.Contains(customSecurity));\n            Assert.IsTrue(changes.RemovedSecurities.Contains(security));\n        }\n\n        [Test]\n        public void FilterCustomSecuritiesIfDesired()\n        {\n            var security = new Security(Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            var customSecurity = new Security(Symbol.CreateBase(typeof(TradeBar), Symbols.SPY, QuantConnect.Market.USA),\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            var changes = CreateNonInternal(new List<Security> { security, customSecurity },\n                new List<Security> { security, customSecurity });\n\n            changes.FilterCustomSecurities = true;\n            foreach (var addedSecurity in changes.AddedSecurities)\n            {\n                Assert.AreNotEqual(SecurityType.Base, addedSecurity.Type);\n            }\n\n            foreach (var removedSecurity in changes.RemovedSecurities)\n            {\n                Assert.AreNotEqual(SecurityType.Base, removedSecurity.Type);\n            }\n        }\n\n        /// <summary>\n        /// Returns a new instance of <see cref=\"SecurityChanges\"/> with the specified securities marked as added\n        /// </summary>\n        /// <param name=\"securities\">The added securities</param>\n        /// <remarks>Useful for testing</remarks>\n        /// <returns>A new security changes instance with the specified securities marked as added</returns>\n        public static SecurityChanges AddedNonInternal(params Security[] securities)\n        {\n            if (securities == null || securities.Length == 0) return SecurityChanges.None;\n            return CreateNonInternal(securities, Enumerable.Empty<Security>());\n        }\n\n        /// <summary>\n        /// Returns a new instance of <see cref=\"SecurityChanges\"/> with the specified securities marked as removed\n        /// </summary>\n        /// <param name=\"securities\">The removed securities</param>\n        /// <remarks>Useful for testing</remarks>\n        /// <returns>A new security changes instance with the specified securities marked as removed</returns>\n        public static SecurityChanges RemovedNonInternal(params Security[] securities)\n        {\n            if (securities == null || securities.Length == 0) return SecurityChanges.None;\n            return CreateNonInternal(Enumerable.Empty<Security>(), securities);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityChanges\"/> class all none internal\n        /// </summary>\n        /// <param name=\"addedSecurities\">Added symbols list</param>\n        /// <param name=\"removedSecurities\">Removed symbols list</param>\n        /// <remarks>Useful for testing</remarks>\n        public static SecurityChanges CreateNonInternal(IEnumerable<Security> addedSecurities, IEnumerable<Security> removedSecurities)\n        {\n            return SecurityChanges.Create(addedSecurities.ToList(), removedSecurities.ToList(), new List<Security>(), new List<Security>());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/UniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class UniverseTests\n    {\n        private SubscriptionDataConfig _config;\n        private Security _security;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.AAPL,\n                Resolution.Second,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false,\n                false,\n                TickType.Trade,\n                false);\n            _security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                _config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n            _security.SetMarketPrice(new TradeBar(new DateTime(2022, 10, 10), _security.Symbol, 1, 1, 1, 1, 1));\n        }\n\n        [Test]\n        public void RoundsTimeWhenCheckingMinimumTimeInUniverse_Seconds()\n        {\n            using var universe = new TestUniverse(_config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromSeconds(30)));\n            var addedTime = new DateTime(2018, 1, 1);\n            universe.AddMember(addedTime, _security, false);\n\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddSeconds(29), _security));\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddSeconds(29.4), _security));\n\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddSeconds(29.5), _security));\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddSeconds(31), _security));\n        }\n\n        [Test]\n        public void RoundsTimeWhenCheckingMinimumTimeInUniverse_Minutes()\n        {\n            using var universe = new TestUniverse(_config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromMinutes(30)));\n            var addedTime = new DateTime(2018, 1, 1);\n            universe.AddMember(addedTime, _security, false);\n\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddMinutes(29), _security));\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddMinutes(29.4), _security));\n\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddMinutes(29.5), _security));\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddMinutes(31), _security));\n        }\n\n        [Test]\n        public void RoundsTimeWhenCheckingMinimumTimeInUniverse_Hour()\n        {\n            using var universe = new TestUniverse(_config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromHours(6)));\n            var addedTime = new DateTime(2018, 1, 1);\n            universe.AddMember(addedTime, _security, false);\n\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddHours(5), _security));\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddHours(5.1), _security));\n\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddHours(5.5), _security));\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddHours(6), _security));\n        }\n\n        [Test]\n        public void RoundsTimeWhenCheckingMinimumTimeInUniverse_Daily()\n        {\n            using var universe = new TestUniverse(_config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromDays(1)));\n            var addedTime = new DateTime(2018, 1, 1);\n            universe.AddMember(addedTime, _security, false);\n\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddHours(5), _security));\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddHours(12), _security));\n\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddHours(12.1), _security));\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddHours(28), _security));\n        }\n\n        [Test]\n        public void RoundsTimeWhenCheckingMinimumTimeInUniverse_SevenDays()\n        {\n            using var universe = new TestUniverse(_config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromDays(7)));\n            var addedTime = new DateTime(2018, 1, 1);\n            universe.AddMember(addedTime, _security, false);\n\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddDays(4), _security));\n            Assert.IsFalse(universe.CanRemoveMember(addedTime.AddDays(6.5), _security));\n\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddDays(6.51), _security));\n            Assert.IsTrue(universe.CanRemoveMember(addedTime.AddDays(8), _security));\n        }\n\n        private class TestUniverse : Universe\n        {\n            public TestUniverse(SubscriptionDataConfig config, UniverseSettings universeSettings)\n                : base(config)\n            {\n                UniverseSettings = universeSettings;\n            }\n            public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/UniverseSelection/UserDefinedUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Data.UniverseSelection\n{\n    [TestFixture]\n    public class UserDefinedUniverseTests\n    {\n        [Test]\n        public void ThreadSafety()\n        {\n            // allow the system to stabilize\n            Thread.Sleep(1000);\n            var results = AlgorithmRunner.RunLocalBacktest(nameof(TestUserDefinedUniverseAlgorithm),\n                new Dictionary<string, string> { { PerformanceMetrics.TotalOrders, \"1\" } },\n                Language.CSharp,\n                AlgorithmStatus.Completed,\n                algorithmLocation: \"QuantConnect.Tests.dll\");\n\n            Assert.GreaterOrEqual(TestUserDefinedUniverseAlgorithm.AdditionCount, 50, $\"We added {TestUserDefinedUniverseAlgorithm.AdditionCount} times\");\n        }\n    }\n\n    public class TestUserDefinedUniverseAlgorithm : BasicTemplateAlgorithm\n    {\n        public static long AdditionCount;\n\n        private Thread _thread;\n        private CancellationTokenSource _cancellationTokenSource = new();\n        private ManualResetEvent _threadStarted = new (false);\n        public override void Initialize()\n        {\n            SetStartDate(2013, 10, 07);\n            SetEndDate(2013, 10, 11);\n\n            Settings.SeedInitialPrices = false;\n\n#pragma warning disable CS0618\n            var spy = AddEquity(\"SPY\", Resolution.Minute, dataNormalizationMode: DataNormalizationMode.Raw).Symbol;\n\n            _thread = new Thread(() =>\n            {\n                _threadStarted.Set();\n                try\n                {\n                    while (!_cancellationTokenSource.IsCancellationRequested && AdditionCount < 250)\n                    {\n                        var currentCount = Interlocked.Increment(ref AdditionCount);\n                        var contract = QuantConnect.Symbol.CreateOption(spy, QuantConnect.Market.USA, OptionStyle.American, OptionRight.Call, currentCount, new DateTime(2022, 10, 10));\n                        AddOptionContract(contract);\n\n\n                        if (currentCount % 2 == 0)\n                        {\n                            RemoveSecurity(\"AAPL\");\n                        }\n                        else\n                        {\n                            AddEquity(\"AAPL\");\n#pragma warning restore CS0618\n                        }\n                        if (currentCount % 25 == 0)\n                        {\n                            Thread.Sleep(10);\n                        }\n                    }\n                }\n                catch (Exception ex)\n                {\n                    Error(ex);\n                    SetStatus(AlgorithmStatus.RuntimeError);\n                }\n            }) { IsBackground = true };\n        }\n\n        public override void OnData(Slice data)\n        {\n            if (!_threadStarted.WaitOne(0))\n            {\n                _thread.Start();\n                _threadStarted.WaitOne();\n            }\n            base.OnData(data);\n        }\n        public override void OnEndOfAlgorithm()\n        {\n            _thread.StopSafely(TimeSpan.FromSeconds(2), _cancellationTokenSource);\n            base.OnEndOfAlgorithm();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Data/VolumeRenkoConsolidatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class VolumeRenkoConsolidatorTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void OutputTypeIsVolumeRenkoBar()\n        {\n            using var consolidator = new VolumeRenkoConsolidator(10);\n            Assert.AreEqual(typeof(VolumeRenkoBar), consolidator.OutputType);\n        }\n\n        [Test]\n        public void ConsolidatesOnTickVolumeReached()\n        {\n            VolumeRenkoBar bar = null;\n            using var consolidator = new VolumeRenkoConsolidator(10);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var reference = new DateTime(2013, 10, 1);\n            consolidator.Update(new Tick(reference, Symbol.Empty, String.Empty, String.Empty, 2m, 1m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(1), Symbol.Empty, String.Empty, String.Empty, 3m, 2m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(2), Symbol.Empty, String.Empty, String.Empty, 3m, 3m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(3), Symbol.Empty, String.Empty, String.Empty, 2m, 2m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(1m, bar.Open);\n            Assert.AreEqual(3m, bar.High);\n            Assert.AreEqual(1m, bar.Low);\n            Assert.AreEqual(2m, bar.Close);\n            Assert.AreEqual(10m, bar.Volume);\n            Assert.AreEqual(10m, bar.BrickSize);\n            Assert.AreEqual(Symbol.Empty, bar.Symbol);\n            Assert.AreEqual(reference, bar.Start);\n            Assert.AreEqual(reference.AddHours(3), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void ConsolidatesOnTraderBarVolumeReached()\n        {\n            VolumeRenkoBar bar = null;\n            using var consolidator = new VolumeRenkoConsolidator(10);\n            consolidator.DataConsolidated += (sender, consolidated) => \n            {\n                bar = consolidated;\n            };\n\n            var reference = new DateTime(2013, 10, 1);\n            consolidator.Update(new TradeBar(reference, Symbol.Empty, 1m, 2m, 0.5m, 1.5m, 2m, new TimeSpan(1, 0, 0)));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new TradeBar(reference.AddHours(1), Symbol.Empty, 1.5m, 3m, 1m, 3m, 3m, new TimeSpan(1, 0, 0)));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new TradeBar(reference.AddHours(2), Symbol.Empty, 3m, 3m, 1m, 2m, 3m, new TimeSpan(1, 0, 0)));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new TradeBar(reference.AddHours(3), Symbol.Empty, 2m, 4m, 1.5m, 2.5m, 2m, new TimeSpan(1, 0, 0)));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(1m, bar.Open);\n            Assert.AreEqual(4m, bar.High);\n            Assert.AreEqual(0.5m, bar.Low);\n            Assert.AreEqual(2.5m, bar.Close);\n            Assert.AreEqual(10m, bar.Volume);\n            Assert.AreEqual(10m, bar.BrickSize);\n            Assert.AreEqual(Symbol.Empty, bar.Symbol);\n            Assert.AreEqual(reference, bar.Start);\n            Assert.AreEqual(reference.AddHours(4), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        [Test]\n        public void ConsolidatesOnQuoteBar()\n        {\n            using var consolidator = new VolumeRenkoConsolidator(10);\n\n            var reference = new DateTime(2013, 10, 1);\n            Assert.Throws<ArgumentException>(() => \n                consolidator.Update(new QuoteBar(reference, Symbol.Empty, new Bar(1m, 1m, 1m, 1m), 1m, new Bar(1m, 1m, 1m, 1m), 1m, TimeSpan.MinValue)));\n        }\n\n        [Test]\n        public void ConsistentRenkos()\n        {\n            // Test Renko bar consistency amongst three consolidators starting at different times\n\n            var time = new DateTime(2016, 1, 1);\n            var testValues = new List<decimal[]>\n            {\n                new decimal[]{5m, 5m}, new decimal[]{5m, 3m}, new decimal[]{5m, 7m}, new decimal[]{5m, 6m},\n                new decimal[]{5m, 5m}, new decimal[]{5m, 3m}, new decimal[]{5m, 7m}, new decimal[]{5m, 6m},\n                new decimal[]{5m, 5m}, new decimal[]{5m, 3m}, new decimal[]{5m, 7m}, new decimal[]{5m, 6m},\n                new decimal[]{5m, 5m}, new decimal[]{5m, 3m}, new decimal[]{5m, 7m}, new decimal[]{5m, 6m}\n            };\n\n            var consolidator1 = new VolumeRenkoConsolidator(20m);\n            var consolidator2 = new VolumeRenkoConsolidator(20m);\n            var consolidator3 = new VolumeRenkoConsolidator(20m);\n\n            // Update each of our consolidators starting at different indexes of test values\n            for (int i = 0; i < testValues.Count; i++)\n            {\n                var data = new Tick(time.AddSeconds(i), Symbol.Empty, String.Empty, String.Empty, testValues[i][0], testValues[i][1]);\n                consolidator1.Update(data);\n\n                if (i > 3)\n                {\n                    consolidator2.Update(data);\n                }\n\n                if (i > 7)\n                {\n                    consolidator3.Update(data);\n                }\n            }\n\n            // Assert that consolidator 2 and 3 price is the same as 1. Even though they started at different\n            // indexes they should be the same\n            var bar1 = consolidator1.Consolidated as VolumeRenkoBar;\n            var bar2 = consolidator2.Consolidated as VolumeRenkoBar;\n            var bar3 = consolidator3.Consolidated as VolumeRenkoBar;\n\n            Assert.AreEqual(bar1.Close, bar2.Close);\n            Assert.AreEqual(bar1.Close, bar3.Close);\n\n            consolidator1.Dispose();\n            consolidator2.Dispose();\n            consolidator3.Dispose();\n        }\n\n        [Test]\n        public void MultipleConsoldation()\n        {\n            VolumeRenkoBar bar = null;\n            using var consolidator = new VolumeRenkoConsolidator(10m);\n            consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                bar = consolidated;\n            };\n\n            var reference = new DateTime(2013, 10, 1);\n            consolidator.Update(new Tick(reference, Symbol.Empty, String.Empty, String.Empty, 2m, 1m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(1), Symbol.Empty, String.Empty, String.Empty, 3m, 2m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(2), Symbol.Empty, String.Empty, String.Empty, 3m, 3m));\n            Assert.IsNull(bar);\n\n            consolidator.Update(new Tick(reference.AddHours(3), Symbol.Empty, String.Empty, String.Empty, 2m, 2m));\n            Assert.IsNotNull(bar);\n\n            Assert.AreEqual(1m, bar.Open);\n            Assert.AreEqual(3m, bar.High);\n            Assert.AreEqual(1m, bar.Low);\n            Assert.AreEqual(2m, bar.Close);\n            Assert.AreEqual(10m, bar.Volume);\n            Assert.AreEqual(10m, bar.BrickSize);\n            Assert.AreEqual(Symbol.Empty, bar.Symbol);\n            Assert.AreEqual(reference, bar.Start);\n            Assert.AreEqual(reference.AddHours(3), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n\n            consolidator.Update(new Tick(reference.AddHours(4), Symbol.Empty, String.Empty, String.Empty, 4m, 1m));\n\n            consolidator.Update(new Tick(reference.AddHours(5), Symbol.Empty, String.Empty, String.Empty, 3m, 2m));\n\n            consolidator.Update(new Tick(reference.AddHours(6), Symbol.Empty, String.Empty, String.Empty, 4m, 3m));\n\n            Assert.AreEqual(2m, bar.Open);\n            Assert.AreEqual(3m, bar.High);\n            Assert.AreEqual(1m, bar.Low);\n            Assert.AreEqual(3m, bar.Close);\n            Assert.AreEqual(10m, bar.Volume);\n            Assert.AreEqual(10m, bar.BrickSize);\n            Assert.AreEqual(Symbol.Empty, bar.Symbol);\n            Assert.AreEqual(reference.AddHours(3), bar.Start);\n            Assert.AreEqual(reference.AddHours(6), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);    // bar is always closed since it is the consolidated bar instance\n\n            consolidator.Update(new Tick(reference.AddHours(7), Symbol.Empty, String.Empty, String.Empty, 5m, 10m));\n\n            // Not yet consolidated, so bar is not updated yet\n            Assert.AreEqual(2m, bar.Open);\n            Assert.AreEqual(3m, bar.High);\n            Assert.AreEqual(1m, bar.Low);\n            Assert.AreEqual(3m, bar.Close);\n            Assert.AreEqual(10m, bar.Volume);\n            Assert.AreEqual(10m, bar.BrickSize);\n            Assert.AreEqual(Symbol.Empty, bar.Symbol);\n            Assert.AreEqual(reference.AddHours(3), bar.Start);\n            Assert.AreEqual(reference.AddHours(6), bar.EndTime);\n            Assert.IsTrue(bar.IsClosed);\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = new DateTime(2016, 3, 1);\n            return new List<Tick>()\n            {\n                new Tick(time, Symbol.Empty, String.Empty, String.Empty, 5m, 5m),\n                new Tick(time.AddSeconds(1), Symbol.Empty, String.Empty, String.Empty, 5m, 3m),\n                new Tick(time.AddSeconds(2), Symbol.Empty, String.Empty, String.Empty, 5m, 7m),\n                new Tick(time.AddSeconds(3), Symbol.Empty, String.Empty, String.Empty, 5m, 6m),\n                new Tick(time.AddSeconds(4), Symbol.Empty, String.Empty, String.Empty, 5m, 5m),\n                new Tick(time.AddSeconds(5), Symbol.Empty, String.Empty, String.Empty, 5m, 3m),\n                new Tick(time.AddSeconds(6), Symbol.Empty, String.Empty, String.Empty, 5m, 7m),\n                new Tick(time.AddSeconds(7), Symbol.Empty, String.Empty, String.Empty, 5m, 6m),\n                new Tick(time.AddSeconds(8), Symbol.Empty, String.Empty, String.Empty, 5m, 5m),\n                new Tick(time.AddSeconds(9), Symbol.Empty, String.Empty, String.Empty, 5m, 6m),\n                new Tick(time.AddSeconds(10), Symbol.Empty, String.Empty, String.Empty, 5m, 7m),\n                new Tick(time.AddSeconds(11), Symbol.Empty, String.Empty, String.Empty, 5m, 8m),\n                new Tick(time.AddSeconds(12), Symbol.Empty, String.Empty, String.Empty, 5m, 9m)\n            };\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            return new VolumeRenkoConsolidator(10m);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/DataMonitorReportTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class DataMonitorReportTests\n    {\n        [Test]\n        public void TotalRequestsCountIsTheSumOfSucceededAndFailedRequests()\n        {\n            var report = new DataMonitorReport\n            {\n                SucceededDataRequestsCount = 6,\n                FailedDataRequestsCount = 3\n            };\n\n            Assert.AreEqual(9, report.TotalRequestsCount);\n        }\n\n        [Test]\n        public void TotalUniverseRequestsCountIsTheSumOfSucceededAndFailedUniverseRequests()\n        {\n            var report = new DataMonitorReport\n            {\n                SucceededUniverseDataRequestsCount = 6,\n                FailedUniverseDataRequestsCount = 3\n            };\n\n            Assert.AreEqual(9, report.TotalUniverseDataRequestsCount);\n        }\n\n        [Test]\n        public void FailedRequestsPercentageIsProperlyCalculatedAndRounded()\n        {\n            var report = new DataMonitorReport\n            {\n                SucceededDataRequestsCount = 6,\n                FailedDataRequestsCount = 3\n            };\n\n            Assert.AreEqual(33d, report.FailedDataRequestsPercentage);\n        }\n\n        [Test]\n        public void FailedUniverseRequestsPercentageIsProperlyCalculatedAndRounded()\n        {\n            var report = new DataMonitorReport\n            {\n                SucceededUniverseDataRequestsCount = 6,\n                FailedUniverseDataRequestsCount = 3\n            };\n\n            Assert.AreEqual(33d, report.FailedUniverseDataRequestsPercentage);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/DocumentationAttributeTest.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class DocumentationAttributeTest\n    {\n        [Test]\n        public void JsonRoundTrip()\n        {\n            var documentationAttribute = new DocumentationAttribute(\"Tag\", 1);\n            var serialized = JsonConvert.SerializeObject(documentationAttribute);\n\n            var result = JsonConvert.DeserializeObject<DocumentationAttribute>(serialized);\n\n            Assert.AreEqual(documentationAttribute.Tag, result.Tag);\n            Assert.AreEqual(documentationAttribute.Weight, result.Weight);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/ClrBubbledExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class ClrBubbledExceptionInterpreterTests\n    {\n        private string _pythonModuleName = \"Test_PythonExceptionInterpreter\";\n        private ClrBubbledException _dotnetException;\n        private PythonException _pythonException;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var module = Py.Import(_pythonModuleName);\n                dynamic algorithm = module.GetAttr(\"Test_PythonExceptionInterpreter\").Invoke();\n\n                try\n                {\n                    // self.MarketOrder(null, 1)\n                    algorithm.dotnet_error();\n                }\n                catch (ClrBubbledException e)\n                {\n                    _dotnetException = e;\n                }\n\n                try\n                {\n                    // x = 1 / 0\n                    algorithm.zero_division_error();\n                }\n                catch (PythonException e)\n                {\n                    _pythonException = e;\n                }\n\n                Assert.IsNotNull(_dotnetException);\n                Assert.IsNotNull(_pythonException);\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(PythonException), ExpectedResult = false)]\n        [TestCase(typeof(ClrBubbledException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueOnlyForClrBubbledExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new ClrBubbledExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), true)]\n        [TestCase(typeof(ClrBubbledException), false)]\n        public void InterpretThrowsForNonClrBubbledExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new ClrBubbledExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(ClrBubbledException));\n            var assembly = typeof(ClrBubbledExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n\n            Assert.True(exception.Message.Contains(\"Object reference not set to an instance of an object.\", StringComparison.InvariantCulture));\n            Assert.True(exception.Message.Contains(\"at dotnet_error\", StringComparison.InvariantCulture));\n            Assert.True(exception.Message.Contains(\"self.market_order(None\", StringComparison.InvariantCulture));\n            Assert.True(exception.Message.Contains($\"in {_pythonModuleName}.py: line \", StringComparison.InvariantCulture));\n        }\n\n        private Exception CreateExceptionFromType(Type type)\n        {\n            if (type == typeof(ClrBubbledException))\n            {\n                return _dotnetException;\n            }\n\n            return type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/DllNotFoundPythonExceptionInterpreterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class DllNotFoundPythonExceptionInterpreterTests\n    {\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(DllNotFoundException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueForOnlyDllNotFoundExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new DllNotFoundPythonExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(DllNotFoundException), false)]\n        public void InterpretThrowsForNonDllNotFoundExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new DllNotFoundPythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        private Exception CreateExceptionFromType(Type type)\n        {\n            if (type == typeof(DllNotFoundException))\n            {\n                return new DllNotFoundException(\"\\'python3.6\\'\");\n            }\n\n            return (Exception)Activator.CreateInstance(type);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Exceptions/FakeExceptionInterpreter.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Exceptions;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    /// <summary>\n    /// Provids a fake implementation that can be utilized in tests\n    /// </summary>\n    /// <remarks>\n    /// Keep it internal so it doesn't get picked up when loading all exception interpreters from assemblies\n    /// </remarks>\n    internal class FakeExceptionInterpreter : IExceptionInterpreter\n    {\n        private readonly int _order = 0;\n        private readonly Func<Exception, bool> _canInterpret;\n        private readonly Func<Exception, Exception> _interpret;\n\n        public int Order => _order;\n\n        public FakeExceptionInterpreter()\n        {\n            _canInterpret = e => true;\n\n            var count = 0;\n            _interpret = e =>\n            {\n                if (e == null)\n                {\n                    return null;\n                }\n                return new Exception($\"Projected {++count}: \" + e.Message, _interpret(e.InnerException));\n            };\n        }\n\n        public FakeExceptionInterpreter(Func<Exception, bool> canInterpret, Func<Exception, Exception> interpret, int order = 0)\n        {\n            _canInterpret = canInterpret;\n            _interpret = interpret;\n            _order = order;\n        }\n\n        public bool CanInterpret(Exception exception)\n        {\n            return _canInterpret(exception);\n        }\n\n        public Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            return _interpret(exception);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/InvalidTokenPythonExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class InvalidTokenPythonExceptionInterpreterTests\n    {\n        private PythonException _pythonException;\n\n        [SetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                try\n                {\n                    // importing a module with syntax error 'x = 01' will throw\n                    PyModule.FromString(Guid.NewGuid().ToString(), \"x = 01\");\n                }\n                catch (PythonException pythonException)\n                {\n                    _pythonException = pythonException;\n                }\n            }\n        }\n\n        [TestCase(typeof(Exception), false)]\n        [TestCase(typeof(KeyNotFoundException), false)]\n        [TestCase(typeof(DivideByZeroException), false)]\n        [TestCase(typeof(InvalidOperationException), false)]\n        [TestCase(typeof(PythonException), true)]\n        public void CanInterpretReturnsTrueForOnlyInvalidTokenPythonExceptionType(Type exceptionType, bool expectedResult)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            Assert.AreEqual(expectedResult, new InvalidTokenPythonExceptionInterpreter().CanInterpret(exception), $\"Unexpected response for: {exception}\");\n        }\n\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), false)]\n        public void InterpretThrowsForNonInvalidTokenPythonExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new InvalidTokenPythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(PythonException));\n            var assembly = typeof(PythonExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.True(exception.Message.Contains(\"x = 01\"));\n        }\n\n        private Exception CreateExceptionFromType(Type type) => type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/KeyErrorPythonExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class KeyErrorPythonExceptionInterpreterTests\n    {\n        private PythonException _pythonException;\n\n        [SetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var module = Py.Import(\"Test_PythonExceptionInterpreter\");\n                dynamic algorithm = module.GetAttr(\"Test_PythonExceptionInterpreter\").Invoke();\n\n                try\n                {\n                    // dict()['SPY']\n                    algorithm.key_error();\n                }\n                catch (PythonException pythonException)\n                {\n                    _pythonException = pythonException;\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(PythonException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueForOnlyKeyErrorPythonExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new KeyErrorPythonExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), false)]\n        public void InterpretThrowsForNonKeyErrorPythonExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new KeyErrorPythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(PythonException));\n            var assembly = typeof(PythonExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.True(exception.Message.Contains(\"dict()['SPY']\"));\n        }\n\n        private Exception CreateExceptionFromType(Type type) => type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/NoMethodMatchPythonExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class NoMethodMatchPythonExceptionInterpreterTests\n    {\n        private PythonException _pythonException;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var module = Py.Import(\"Test_PythonExceptionInterpreter\");\n                dynamic algorithm = module.GetAttr(\"Test_PythonExceptionInterpreter\").Invoke();\n\n                try\n                {\n                    // self.SetCash('SPY')\n                    algorithm.no_method_match();\n                }\n                catch (PythonException pythonException)\n                {\n                    _pythonException = pythonException;\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(PythonException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueForOnlyNoMethodMatchPythonExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new NoMethodMatchPythonExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), false)]\n        public void InterpretThrowsForNonNoMethodMatchPythonExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new NoMethodMatchPythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(PythonException));\n            var assembly = typeof(PythonExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.True(exception.Message.Contains(\"self.set_cash('SPY')\"));\n        }\n\n        private Exception CreateExceptionFromType(Type type) => type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/NullExceptionInterpreter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Exceptions;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    /// <summary>\n    /// Provides a null implementation of <see cref=\"IExceptionInterpreter\"/>\n    /// </summary>\n    public class NullExceptionInterpreter : IExceptionInterpreter\n    {\n        public static readonly IExceptionInterpreter Instance = new NullExceptionInterpreter();\n\n        public int Order => int.MaxValue;\n\n        private NullExceptionInterpreter()\n        {\n        }\n\n        public bool CanInterpret(Exception exception)\n        {\n            return false;\n        }\n\n        public Exception Interpret(Exception exception, IExceptionInterpreter innerInterpreter)\n        {\n            return exception;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Exceptions/PythonExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class PythonExceptionInterpreterTests\n    {\n        private PythonException _pythonException;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var module = Py.Import(\"Test_PythonExceptionInterpreter\");\n                dynamic algorithm = module.GetAttr(\"Test_PythonExceptionInterpreter\").Invoke();\n\n                try\n                {\n                    // x = 1 / 0\n                    algorithm.zero_division_error();\n                }\n                catch (PythonException pythonException)\n                {\n                    _pythonException = pythonException;\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(PythonException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueForOnlyPythonExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new PythonExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), false)]\n        public void InterpretThrowsForNonPythonExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new PythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(PythonException));\n            var assembly = typeof(PythonExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.True(exception.Message.Contains(\"x = 1 / 0\"));\n        }\n\n        private Exception CreateExceptionFromType(Type type) => type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/ScheduledEventExceptionInterpreterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Moq;\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing QuantConnect.Exceptions;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class ScheduledEventExceptionInterpreterTests\n    {\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(ScheduledEventException), ExpectedResult = true)]\n        public bool CanProjectReturnsTrueForOnlyScheduledEventExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new ScheduledEventExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(ScheduledEventException), false)]\n        public void ProjectThrowsForNonScheduledEventExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new ScheduledEventExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void ReformsMessageToIncludeScheduledEventName()\n        {\n            var id = Guid.NewGuid();\n            var name = id.ToStringInvariant(\"D\");\n            var message = id.ToStringInvariant(\"N\");\n            var exception = new ScheduledEventException(name, message, null);\n            var interpreted = new ScheduledEventExceptionInterpreter().Interpret(exception, NullExceptionInterpreter.Instance);\n\n            var expectedInterpretedMessage = $\"In Scheduled Event '{name}',\";\n            Assert.AreEqual(expectedInterpretedMessage, interpreted.Message);\n        }\n\n        [Test]\n        public void WrapsScheduledEventExceptionInnerException()\n        {\n            var inner = new Exception();\n            var exception = new ScheduledEventException(\"name\", \"message\", inner);\n            var interpreted = new ScheduledEventExceptionInterpreter().Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.AreEqual(inner, interpreted.InnerException);\n        }\n\n        [Test]\n        public void InvokesInnerExceptionProjectionOnInnerException()\n        {\n            var inner = new Exception(\"inner\");\n            var exception = new ScheduledEventException(\"name\", \"message\", inner);\n            var mockInnerInterpreter = new Mock<IExceptionInterpreter>();\n            mockInnerInterpreter.Setup(iep => iep.Interpret(inner, mockInnerInterpreter.Object))\n                .Returns(new Exception(\"Projected \" + inner.Message))\n                .Verifiable();\n\n            var interpreter = new ScheduledEventExceptionInterpreter();\n\n            interpreter.Interpret(exception, mockInnerInterpreter.Object);\n\n            mockInnerInterpreter.Verify(iep => iep.Interpret(inner, mockInnerInterpreter.Object), Times.Exactly(1));\n        }\n\n        private Exception CreateExceptionFromType(Type type)\n        {\n            if (type == typeof(ScheduledEventException))\n            {\n                var inner = new Exception(\"Sample inner message\");\n                return new ScheduledEventException(Guid.NewGuid().ToStringInvariant(null), \"Sample error message\", inner);\n            }\n\n            return (Exception)Activator.CreateInstance(type);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/StackExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Exceptions;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class StackExceptionInterpretersTests\n    {\n        [Test]\n        public void CreatesFromAssemblies()\n        {\n            var assembly = typeof(ClrBubbledExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            Assert.AreEqual(1, interpreter.Interpreters.Count(p => p.GetType() == typeof(ClrBubbledExceptionInterpreter)));\n        }\n\n        [Test]\n        public void CallsInterpretOnFirstProjectionThatCanInterpret()\n        {\n            var canInterpretCalled = new List<int>();\n            var interpretCalled = new List<int>();\n            var interpreters = new[]\n            {\n                new FakeExceptionInterpreter(e =>\n                {\n                    canInterpretCalled.Add(0);\n                    return false;\n                }, e =>\n                {\n                    interpretCalled.Add(0);\n                    return e;\n                },\n                order : 2),\n                new FakeExceptionInterpreter(e =>\n                {\n                    canInterpretCalled.Add(1);\n                    return true;\n                }, e =>\n                {\n                    interpretCalled.Add(1);\n                    return e;\n                },\n                order : 1),\n                new FakeExceptionInterpreter(e =>\n                {\n                    canInterpretCalled.Add(2);\n                    return false;\n                }, e =>\n                {\n                    interpretCalled.Add(2);\n                    return e;\n                },\n                order : 0)\n            };\n\n            var interpreter = new StackExceptionInterpreter(interpreters);\n            interpreter.Interpret(new Exception(), null);\n\n            // can interpret called for 3nd and 2rd entry\n            Assert.Contains(2, canInterpretCalled);\n            Assert.Contains(1, canInterpretCalled);\n            Assert.That(canInterpretCalled, Is.Not.Contains(0));\n\n            // interpret only called on second entry\n            Assert.That(interpretCalled, Is.Not.Contains(0));\n            Assert.Contains(1, interpretCalled);\n            Assert.That(interpretCalled, Is.Not.Contains(2));\n\n            // interpreter called 3rd before 2nd\n            Assert.Greater(canInterpretCalled.First(), canInterpretCalled.Last());\n        }\n\n        [Test]\n        public void RecursivelyProjectsInnerExceptions()\n        {\n            var inner = new Exception(\"inner\");\n            var middle = new Exception(\"middle\", inner);\n            var outter = new Exception(\"outter\", middle);\n            var interpreter = new StackExceptionInterpreter(new[]\n            {\n                new FakeExceptionInterpreter()\n            });\n\n            var interpreted = interpreter.Interpret(outter, null);\n            Assert.AreEqual(\"Projected 1: outter\", interpreted.Message);\n            Assert.AreEqual(\"Projected 2: middle\", interpreted.InnerException.Message);\n            Assert.AreEqual(\"Projected 3: inner\", interpreted.InnerException.InnerException.Message);\n        }\n\n        [Test]\n        public void GetsExceptionMessageHeaderAsAllInnersJoinedBySpace()\n        {\n            var inner = new Exception(\"inner\");\n            var middle = new Exception(\"middle\", inner);\n            var outter = new Exception(\"outter\", middle);\n            var message = new StackExceptionInterpreter(Enumerable.Empty<IExceptionInterpreter>()).GetExceptionMessageHeader(outter);\n\n            // header line w/ exception message and then the full detail on a new line\n            var expectedMessage = \"outter middle inner\";\n            Assert.AreEqual(expectedMessage, message);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/SystemExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Exceptions;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class SystemExceptionInterpreterTests\n    {\n        [Test]\n        public void InterpreterCorrectly()\n        {\n            var result = SystemExceptionInterpreter.TryGetLineAndFile(@\"   at QuantConnect.Algorithm.CSharp.BasicTemplateAlgorithm.Initialize() in D:\\QuantConnect\\MyLean\\Lean\\Algorithm.CSharp\\BasicTemplateAlgorithm.cs:line 50\n   at QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.<>c__DisplayClass27_0.<Setup>b__0() in D:\\QuantConnect\\MyLean\\Lean\\Engine\\Setup\\BacktestingSetupHandler.cs:line 186\n\", out var fileAndLine);\n\n            Assert.IsTrue(result);\n            Assert.AreEqual(\" in BasicTemplateAlgorithm.cs:line 50\", fileAndLine);\n        }\n\n        [Test]\n        public void CleanupStacktrace()\n        {\n            var interpreter = new SystemExceptionInterpreter();\n\n            var message = \"The ticker AAPL was not found in the SymbolCache. Use the Symbol object as key instead. Accessing the securities collection/slice object by string ticker is only available for\" +\n                \" securities added with the AddSecurity-family methods. For more details, please check out the documentation.\";\n            var stackTrace = \"   at QuantConnect.ExtendedDictionary`1.get_Item(String ticker) in D:\\\\QuantConnect\\\\MyLean\\\\Lean\\\\Common\\\\ExtendedDictionary.cs:line 121\\r\\n   at QuantConnect.Algorithm.CSh\" +\n                \"arp.BasicTemplateAlgorithm.OnData(Slice data) in D:\\\\QuantConnect\\\\MyLean\\\\Lean\\\\Algorithm.CSharp\\\\BasicTemplateAlgorithm.cs:line 58\\r\\n   at QuantConnect.Lean.Engine.AlgorithmManager.R\" +\n                \"un(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer synchronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ILeanManager leanMana\" +\n                \"ger, CancellationToken token) in D:\\\\QuantConnect\\\\MyLean\\\\Lean\\\\Engine\\\\AlgorithmManager.cs:line 525\";\n            var result = interpreter.Interpret(new TestException(message, stackTrace), null);\n\n            Assert.AreEqual(\"   at QuantConnect.ExtendedDictionary`1.get_Item(String ticker) in Common\\\\ExtendedDictionary.cs:line 121\\r\\n   at QuantConnect.Algorithm.CSharp.BasicTemplateAlgorithm.OnData(\" +\n                \"Slice data) in Algorithm.CSharp\\\\BasicTemplateAlgorithm.cs:line 58\\r\\n   at QuantConnect.Lean.Engine.AlgorithmManager.Run(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer sync\" +\n                \"hronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ILeanManager leanManager, CancellationToken token) in Engine\\\\AlgorithmManager.cs:line 525\", result.InnerException.StackTrace);\n        }\n\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void CleanupStackTraceHandles(string stackTrace)\n        {\n            var interpreter = new SystemExceptionInterpreter();\n            var result = interpreter.Interpret(new TestException(\"Message\", stackTrace), null);\n\n            Assert.IsNull(result.InnerException);\n        }\n\n        private class TestException : Exception\n        {\n            private readonly string _message;\n            private readonly string _stackTrace;\n\n            public override string Message => _message;\n            public override string StackTrace => _stackTrace;\n\n            public TestException(string message, string stackTrace)\n            {\n                _message = message;\n                _stackTrace = Log.ClearLeanPaths(stackTrace);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Exceptions/UnsupportedOperandPythonExceptionInterpreterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing Python.Runtime;\nusing QuantConnect.Exceptions;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Exceptions\n{\n    [TestFixture]\n    public class UnsupportedOperandPythonExceptionInterpreterTests\n    {\n        private PythonException _pythonException;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var module = Py.Import(\"Test_PythonExceptionInterpreter\");\n                dynamic algorithm = module.GetAttr(\"Test_PythonExceptionInterpreter\").Invoke();\n\n                try\n                {\n                    // x = None + \"Pepe Grillo\"\n                    algorithm.unsupported_operand();\n                }\n                catch (PythonException pythonException)\n                {\n                    _pythonException = pythonException;\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), ExpectedResult = false)]\n        [TestCase(typeof(KeyNotFoundException), ExpectedResult = false)]\n        [TestCase(typeof(DivideByZeroException), ExpectedResult = false)]\n        [TestCase(typeof(InvalidOperationException), ExpectedResult = false)]\n        [TestCase(typeof(PythonException), ExpectedResult = true)]\n        public bool CanInterpretReturnsTrueForOnlyUnsupportedOperandPythonExceptionType(Type exceptionType)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            return new UnsupportedOperandPythonExceptionInterpreter().CanInterpret(exception);\n        }\n\n        [Test]\n        [TestCase(typeof(Exception), true)]\n        [TestCase(typeof(KeyNotFoundException), true)]\n        [TestCase(typeof(DivideByZeroException), true)]\n        [TestCase(typeof(InvalidOperationException), true)]\n        [TestCase(typeof(PythonException), false)]\n        public void InterpretThrowsForNonUnsupportedOperandPythonExceptionTypes(Type exceptionType, bool expectThrow)\n        {\n            var exception = CreateExceptionFromType(exceptionType);\n            var interpreter = new UnsupportedOperandPythonExceptionInterpreter();\n            var constraint = expectThrow ? (IResolveConstraint)Throws.Exception : Throws.Nothing;\n            Assert.That(() => interpreter.Interpret(exception, NullExceptionInterpreter.Instance), constraint);\n        }\n\n        [Test]\n        public void VerifyMessageContainsStackTraceInformation()\n        {\n            var exception = CreateExceptionFromType(typeof(PythonException));\n            var assembly = typeof(PythonExceptionInterpreter).Assembly;\n            var interpreter = StackExceptionInterpreter.CreateFromAssemblies();\n            exception = interpreter.Interpret(exception, NullExceptionInterpreter.Instance);\n            Assert.True(exception.Message.Contains(\"x = None + \\\"Pepe Grillo\\\"\"));\n        }\n\n        private Exception CreateExceptionFromType(Type type) => type == typeof(PythonException) ? _pythonException : (Exception)Activator.CreateInstance(type);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ExchangeTest.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ExchangeTest\n    {\n        [TestCase(\"NASDAQ\", \"Q\")]\n        [TestCase(\"NASDAQ BX\", \"B\")]\n        [TestCase(\"NASDAQ PSX\", \"X\")]\n        [TestCase(\"BATS\", \"Z\")]\n        [TestCase(\"BATS Z\", \"Z\")]\n        [TestCase(\"BATS Y\", \"Y\")]\n        [TestCase(\"ARCA\", \"P\")]\n        [TestCase(\"NYSE\", \"N\")]\n        [TestCase(\"NSE\", \"C\")]\n        [TestCase(\"BSE\", \"BSE\")]\n        [TestCase(\"NSX\", \"C\")]\n        [TestCase(\"FINRA\", \"D\")]\n        [TestCase(\"ISE\", \"I\")]\n        [TestCase(\"CSE\", \"M\")]\n        [TestCase(\"CBOE\", \"W\")]\n        [TestCase(\"EDGA\", \"J\")]\n        [TestCase(\"EDGX\", \"K\")]\n        [TestCase(\"AMEX\", \"A\")]\n        [TestCase(\"UNKNOWN\", \"\")]\n        [TestCase(\"\", \"\")]\n        [TestCase(null, \"\")]\n        // option exchanges not found for default equity\n        [TestCase(\"ISE_GEMINI\", \"\")]\n        [TestCase(\"ISE_MERCURY\", \"\")]\n        [TestCase(\"OPRA\", \"\")]\n        public void ExchangeCorrectlyReturnedAsSingleLetter(string exchange, string expectedExchangeCode)\n        {\n            var primaryExchange = exchange.GetPrimaryExchange();\n            Assert.AreEqual(expectedExchangeCode, primaryExchange.Code);\n            Assert.AreEqual(primaryExchange, primaryExchange.Code.GetPrimaryExchange());\n        }\n\n        [TestCase(\"ISE_GEMINI\", \"H\", SecurityType.Option)]\n        [TestCase(\"ISE_MERCURY\", \"J\", SecurityType.Option)]\n        [TestCase(\"OPRA\", \"O\", SecurityType.Option)]\n        public void ExchangeCorrectlyReturnedAsSingleLetterSecurityType(string exchange, string expectedExchange, SecurityType securityType)\n        {\n            Assert.AreEqual(expectedExchange, exchange.GetPrimaryExchangeCodeGetPrimaryExchange(securityType));\n        }\n\n        [TestCaseSource(nameof(ExchangeCases))]\n        public void StringExchangeCorrectlyReturnedAsSingleLetter(Exchange expectedExchange, string exchange, string _, SecurityType securityType)\n        {\n            Assert.AreEqual(expectedExchange, exchange.GetPrimaryExchange(securityType));\n        }\n\n        [TestCaseSource(nameof(ExchangeCases))]\n        public void ExchangeAsString(Exchange exchange, string _,  string expectedExchange, SecurityType __)\n        {\n            Assert.AreEqual(expectedExchange, exchange.ToString());\n        }\n\n        [TestCaseSource(nameof(EqualityExchangeCases))]\n        public void Equality(bool expectedResult, Exchange left, Exchange right)\n        {\n            Assert.AreEqual(expectedResult, left == right);\n            if (left != null)\n            {\n                Assert.AreEqual(expectedResult, left.Equals(right));\n            }\n            if (left != null && right != null)\n            {\n                Assert.AreEqual(expectedResult, left.GetHashCode() == right.GetHashCode());\n            }\n        }\n\n        [Test]\n        public void RoundTripSerialization_unknown()\n        {\n            var serialized = JsonConvert.SerializeObject(Exchange.UNKNOWN);\n            var deserialized = JsonConvert.DeserializeObject<Exchange>(serialized);\n\n            Assert.AreEqual(Exchange.UNKNOWN, deserialized);\n        }\n\n        [Test]\n        public void RoundTripSerialization()\n        {\n            var serialized = JsonConvert.SerializeObject(Exchange.C2);\n            var deserialized = JsonConvert.DeserializeObject<Exchange>(serialized);\n\n            Assert.AreEqual(Exchange.C2, deserialized);\n        }\n\n        private static TestCaseData[] EqualityExchangeCases()\n        {\n            return new[]\n            {\n                new TestCaseData(true, Exchange.UNKNOWN, null),\n                new TestCaseData(true, null, Exchange.UNKNOWN),\n                new TestCaseData(true, null, null),\n                new TestCaseData(true, Exchange.NASDAQ, Exchange.NASDAQ),\n                new TestCaseData(true, Exchange.NYSE, Exchange.NYSE),\n\n                new TestCaseData(false, Exchange.UNKNOWN, Exchange.NYSE),\n                new TestCaseData(false, null, Exchange.NYSE),\n                new TestCaseData(false, Exchange.NSX, Exchange.NSE),\n                new TestCaseData(false, Exchange.NASDAQ_PSX, Exchange.NASDAQ),\n                new TestCaseData(false, Exchange.NASDAQ, Exchange.NASDAQ_BX),\n            };\n        }\n\n        private static TestCaseData[] ExchangeCases()\n        {\n            return new[]\n            {\n                new TestCaseData(Exchange.UNKNOWN, null, \"\", SecurityType.Base),\n                new TestCaseData(Exchange.NASDAQ, \"Q\", \"NASDAQ\", SecurityType.Equity),\n                new TestCaseData(Exchange.NASDAQ_BX, \"B\", \"NASDAQ_BX\", SecurityType.Equity),\n                new TestCaseData(Exchange.NASDAQ_PSX, \"X\", \"NASDAQ_PSX\", SecurityType.Equity),\n                new TestCaseData(Exchange.BATS, \"Z\", \"BATS\", SecurityType.Equity),\n                new TestCaseData(Exchange.BATS_Y, \"Y\", \"BATS_Y\", SecurityType.Equity),\n                new TestCaseData(Exchange.ARCA, \"P\", \"ARCA\", SecurityType.Equity),\n                new TestCaseData(Exchange.NYSE, \"N\", \"NYSE\", SecurityType.Equity),\n                new TestCaseData(Exchange.NSX, \"C\", \"NSE\", SecurityType.Equity),\n                new TestCaseData(Exchange.FINRA, \"D\", \"FINRA\", SecurityType.Equity),\n                new TestCaseData(Exchange.ISE, \"I\", \"ISE\", SecurityType.Equity),\n                new TestCaseData(Exchange.CSE, \"M\", \"CSE\", SecurityType.Equity),\n                new TestCaseData(Exchange.CBOE, \"W\", \"CBOE\", SecurityType.Equity),\n                new TestCaseData(Exchange.EDGA, \"J\", \"EDGA\", SecurityType.Equity),\n                new TestCaseData(Exchange.EDGX, \"K\", \"EDGX\", SecurityType.Equity),\n                new TestCaseData(Exchange.AMEX, \"A\", \"AMEX\", SecurityType.Equity),\n                new TestCaseData(Exchange.NSX, \"C\", \"NSE\", SecurityType.Equity),\n                new TestCaseData(Exchange.BSE, \"BSE\", \"BSE\", SecurityType.Equity),\n\n                new TestCaseData(Exchange.UNKNOWN, \"O\", \"\", SecurityType.Equity),\n                new TestCaseData(Exchange.UNKNOWN, \"H\", \"\", SecurityType.Equity),\n                new TestCaseData(Exchange.EDGA, \"J\", \"EDGA\", SecurityType.Equity),\n\n                new TestCaseData(Exchange.OPRA, \"O\", \"OPRA\", SecurityType.Option),\n                new TestCaseData(Exchange.ISE_GEMINI, \"H\", \"ISE_GEMINI\", SecurityType.Option),\n                new TestCaseData(Exchange.ISE_MERCURY, \"J\", \"ISE_MERCURY\", SecurityType.Option),\n\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ExpiryTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ExpiryTests\n    {\n        [Test]\n        public void ExpiryEndOfWeekTests()\n        {\n            var endOfWeekList = new List<DateTime>();\n\n            var current = new DateTime(2019, 1, 1);\n            var end = new DateTime(2020, 1, 1);\n            while (current < end)\n            {\n                var endOfWeek = Expiry.EndOfWeek(current);\n                endOfWeekList.Add(endOfWeek);\n                Assert.AreEqual(DayOfWeek.Monday, endOfWeek.DayOfWeek);\n                Assert.Greater(endOfWeek, current);\n                current = current.AddDays(1);\n            }\n\n            var actual = endOfWeekList.Distinct().Count();\n            Assert.AreEqual(53, actual);\n        }\n\n        [Test]\n        public void ExpiryEndOfMonthTests()\n        {\n            var endOfMonthList = new List<DateTime>();\n\n            var current = new DateTime(2019, 1, 1);\n            var end = new DateTime(2020, 1, 1);\n            while (current < end)\n            {\n                var endOfMonth = Expiry.EndOfMonth(current);\n                endOfMonthList.Add(endOfMonth);\n                Assert.AreEqual(1, endOfMonth.Day);\n                Assert.Greater(endOfMonth, current);\n                current = current.AddDays(1);\n            }\n\n            var actual = endOfMonthList.Distinct().Count();\n            Assert.AreEqual(12, actual);\n        }\n\n        [Test]\n        public void ExpiryEndOfQuarterTests()\n        {\n            var endOfQuarterList = new List<DateTime>();\n\n            var current = new DateTime(2019, 1, 1);\n            var end = new DateTime(2020, 1, 1);\n            while (current < end)\n            {\n                var endOfQuarter = Expiry.EndOfQuarter(current);\n                endOfQuarterList.Add(endOfQuarter);\n                Assert.AreEqual(1, endOfQuarter.Day);\n                Assert.AreEqual(1, endOfQuarter.Month % 3);\n                Assert.Greater(endOfQuarter, current);\n                current = current.AddDays(1);\n            }\n\n            var actual = endOfQuarterList.Distinct().Count();\n            Assert.AreEqual(4, actual);\n        }\n\n        [Test]\n        public void ExpiryEndOfYearTests()\n        {\n            var endOfYearList = new List<DateTime>();\n\n            var current = new DateTime(2019, 1, 1);\n            var end = new DateTime(2020, 1, 1);\n            while (current < end)\n            {\n                var endOfYear = Expiry.EndOfYear(current);\n                endOfYearList.Add(endOfYear);\n                Assert.AreEqual(1, endOfYear.Day);\n                Assert.AreEqual(end.Year, endOfYear.Year);\n                Assert.Greater(endOfYear, current);\n                current = current.AddDays(1);\n            }\n\n            var actual = endOfYearList.Distinct().Count();\n            Assert.AreEqual(1, actual);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ExtendedDictionaryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ExtendedDictionaryTests\n    {\n        [Test]\n        public void RunPythonDictionaryFeatureRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"PythonDictionaryFeatureRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"3\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"349.409%\"},\n                    {\"Drawdown\", \"2.600%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"1.940%\"},\n                    {\"Sharpe Ratio\", \"10.771\"},\n                    {\"Probabilistic Sharpe Ratio\", \"66.098%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0.571\"},\n                    {\"Beta\", \"1.247\"},\n                    {\"Annual Standard Deviation\", \"0.282\"},\n                    {\"Annual Variance\", \"0.079\"},\n                    {\"Information Ratio\", \"14.457\"},\n                    {\"Tracking Error\", \"0.073\"},\n                    {\"Treynor Ratio\", \"2.433\"},\n                    {\"Total Fees\", \"$0.00\"},\n                    {\"OrderListHash\", \"a91c50e19b6b9ee19007be4555029779\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                initialCash: 100000);\n        }\n\n        [Test]\n        public void ExtendedDictionaryBehavesAsPythonDictionary()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(\"ExtendedDictionaryBehavesAsPythonDictionary\",\n                    @\"\ndef contains(dictionary, key):\n    return key in dictionary\n\ndef get(dictionary, key):\n    return dictionary.get(key)\n\ndef keys(dictionary):\n    return dictionary.keys()\n\ndef values(dictionary):\n    return dictionary.values()\n\ndef pop(dictionary, key):\n    return dictionary.pop(key)\n\");\n\n            var dict = new TestDictionary<string, int>\n            {\n                [\"a\"] = 1,\n                [\"b\"] = 2,\n                [\"c\"] = 3\n            };\n            using var pyDict = dict.ToPython();\n\n            var expectedKeys = new[] { \"a\", \"b\", \"c\" };\n            var keys = module.InvokeMethod(\"keys\", pyDict).GetAndDispose<List<string>>();\n            CollectionAssert.AreEquivalent(expectedKeys, keys);\n\n            var expectedValues = new[] { 1, 2, 3 };\n            var values = module.InvokeMethod(\"values\", pyDict).GetAndDispose<List<int>>();\n            CollectionAssert.AreEquivalent(expectedValues, values);\n\n            foreach (var (key, value) in keys.Zip(values))\n            {\n                using var pyKey = key.ToPython();\n                Assert.IsTrue(module.InvokeMethod(\"contains\", pyDict, pyKey).As<bool>());\n                Assert.AreEqual(value, module.InvokeMethod(\"get\", pyDict, pyKey).As<int>());\n            }\n\n            using var pyNonExistingKey = \"d\".ToPython();\n            Assert.IsFalse(module.InvokeMethod(\"contains\", pyDict, pyNonExistingKey).As<bool>());\n            Assert.IsFalse(module.InvokeMethod(\"contains\", pyDict, PyObject.None).As<bool>());\n\n            using var pyExistingKey = keys[0].ToPython();\n            using var pyExistingValue = values[0].ToPython();\n            var popped = module.InvokeMethod(\"pop\", pyDict, pyExistingKey).As<int>();\n            Assert.AreEqual(1, popped);\n            Assert.IsFalse(module.InvokeMethod(\"contains\", pyDict, pyExistingKey).As<bool>());\n        }\n\n        [Test]\n        public void SymbolKeyCanBeIndexedWithStrings()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(\"SymbolKeyCanBeIndexedWithStrings\",\n                    @\"\ndef get(dictionary, key):\n    return dictionary[key]\n\ndef set(dictionary, key, value):\n    dictionary[key] = value\n\");\n\n            var symbol = Symbols.SPY;\n            using var pySymbol = symbol.ToPython();\n\n            SymbolCache.Set(symbol.Value, symbol);\n\n            var dict = new TestDictionary<Symbol, int>\n            {\n                [symbol] = 1,\n            };\n            using var pyDict = dict.ToPython();\n\n            var value = module.InvokeMethod(\"get\", pyDict, pySymbol).As<int>();\n            Assert.AreEqual(1, value);\n\n            using var pyStringSymbol = symbol.Value.ToPython();\n            value = module.InvokeMethod(\"get\", pyDict, pyStringSymbol).As<int>();\n            Assert.AreEqual(1, value);\n\n            using var pyNewValue = 2.ToPython();\n            module.InvokeMethod(\"set\", pyDict, pySymbol, pyNewValue);\n            value = module.InvokeMethod(\"get\", pyDict, pySymbol).As<int>();\n            Assert.AreEqual(2, value);\n            value = module.InvokeMethod(\"get\", pyDict, pyStringSymbol).As<int>();\n            Assert.AreEqual(2, value);\n\n            using var pyNewValue2 = 3.ToPython();\n            module.InvokeMethod(\"set\", pyDict, pyStringSymbol, pyNewValue2);\n            value = module.InvokeMethod(\"get\", pyDict, pySymbol).As<int>();\n            Assert.AreEqual(3, value);\n            value = module.InvokeMethod(\"get\", pyDict, pyStringSymbol).As<int>();\n            Assert.AreEqual(3, value);\n\n            using var pyNonExistingSymbol = Symbols.AAPL.ToPython();\n            using var pyStringNonExistingSymbol = Symbols.AAPL.Value.ToPython();\n\n            var exception = Assert.Throws<ClrBubbledException>(() => module.InvokeMethod(\"get\", pyDict, pyNonExistingSymbol));\n            Assert.IsInstanceOf<KeyNotFoundException>(exception.InnerException);\n\n            exception = Assert.Throws<ClrBubbledException>(() => module.InvokeMethod(\"get\", pyDict, pyStringNonExistingSymbol));\n            Assert.IsInstanceOf<KeyNotFoundException>(exception.InnerException);\n        }\n\n        private class TestDictionary<TKey, TValue> : ExtendedDictionary<TKey, TValue>\n        {\n            private readonly Dictionary<TKey, TValue> _data = new();\n\n            public override int Count => _data.Count;\n\n            public override bool IsReadOnly => false;\n\n            public override TValue this[TKey key]\n            {\n                get => _data[key];\n                set => _data[key] = value;\n            }\n\n            protected override IEnumerable<TKey> GetKeys => _data.Keys;\n\n            protected override IEnumerable<TValue> GetValues => _data.Values;\n\n            public override bool TryGetValue(TKey key, out TValue value)\n            {\n                return _data.TryGetValue(key, out value);\n            }\n\n            public override bool ContainsKey(TKey key)\n            {\n                return _data.ContainsKey(key);\n            }\n\n            public override bool Remove(TKey key)\n            {\n                return _data.Remove(key);\n            }\n\n            public override IEnumerable<KeyValuePair<TKey, TValue>> GetItems()\n            {\n                return _data;\n            }\n        }\n\n        private class TestSymbolDictionary : TestDictionary<Symbol, int>\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/HoldingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Newtonsoft.Json;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class HoldingTests\n    {\n        [TestCase(SecurityType.Future)]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Crypto)]\n        [TestCase(SecurityType.Forex)]\n        public void PriceRounding(SecurityType securityType)\n        {\n            var algo = new AlgorithmStub();\n            Security security = null;\n            if (securityType == SecurityType.Equity)\n            {\n                security = algo.AddEquity(\"SPY\");\n            }\n            else if (securityType == SecurityType.Crypto)\n            {\n                security = algo.AddCrypto(\"BNTBTC\");\n            }\n            else if (securityType == SecurityType.Forex)\n            {\n                security = algo.AddForex(\"EURUSD\");\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                security = algo.AddFuture(\"CL\");\n            }\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 10.0001m, 10.0001m));\n            security.Holdings.SetHoldings(10.0000000000m, 10);\n\n            var holding = new Holding(security);\n\n            Assert.AreEqual(10, holding.Quantity);\n\n            if (securityType == SecurityType.Equity || securityType == SecurityType.Future)\n            {\n                Assert.AreEqual(10.00m, holding.MarketPrice);\n                Assert.AreEqual(10.00m, holding.AveragePrice);\n            }\n            else if(securityType == SecurityType.Forex || securityType == SecurityType.Crypto)\n            {\n                Assert.AreEqual(10.0001m, holding.MarketPrice);\n                Assert.AreEqual(10.0000m, holding.AveragePrice);\n            }\n        }\n\n        [Test]\n        public void RoundTrip()\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddEquity(\"SPY\");\n            security.SetMarketPrice(new Tick(new DateTime(2022, 01, 04), security.Symbol, 10.0001m, 10.0001m));\n            security.Holdings.SetHoldings(10.1000000000m, 10);\n\n            var holding = new Holding(security);\n\n            var result = JsonConvert.SerializeObject(holding);\n\n            Assert.AreEqual(\"{\\\"a\\\":10.1,\\\"q\\\":10,\\\"p\\\":10,\\\"v\\\":100,\\\"u\\\":-2,\\\"up\\\":-1.98}\", result);\n\n            var deserialized = JsonConvert.DeserializeObject<Holding>(result);\n\n            Assert.AreEqual(deserialized.AveragePrice, holding.AveragePrice);\n            Assert.AreEqual(deserialized.Quantity, holding.Quantity);\n            Assert.AreEqual(deserialized.MarketPrice, holding.MarketPrice);\n            Assert.AreEqual(deserialized.MarketValue, holding.MarketValue);\n            Assert.AreEqual(deserialized.UnrealizedPnL, holding.UnrealizedPnL);\n            Assert.AreEqual(deserialized.UnrealizedPnLPercent, holding.UnrealizedPnLPercent);\n\n            Assert.AreEqual(\": 10 @ $10.1 - Market: $10\", deserialized.ToString());\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void BackwardsCompatible(bool upperCase)\n        {\n            string source;\n            if (upperCase)\n            {\n                source = \"{\\\"Symbol\\\":{\\\"value\\\":\\\"A\\\",\\\"id\\\":\\\"A RPTMYV3VC57P\\\",\\\"permtick\\\":\\\"A\\\"},\\\"Type\\\":1,\\\"CurrencySymbol\\\":\\\"$\\\",\\\"AveragePrice\\\":148.34,\\\"Quantity\\\":192.0,\" +\n                    \"\\\"MarketPrice\\\":145.21,\\\"ConversionRate\\\":1.0,\\\"MarketValue\\\":27880.3200,\\\"UnrealizedPnl\\\":-601.96,\\\"UnrealizedPnLPercent\\\":-2.11}\";\n            }\n            else\n            {\n                source = \"{\\\"symbol\\\":{\\\"value\\\":\\\"A\\\",\\\"id\\\":\\\"A RPTMYV3VC57P\\\",\\\"permtick\\\":\\\"A\\\"},\\\"type\\\":1,\\\"currencySymbol\\\":\\\"$\\\",\\\"averagePrice\\\":148.34,\\\"quantity\\\":192.0,\" +\n                    \"\\\"marketPrice\\\":145.21,\\\"conversionRate\\\":1.0,\\\"marketValue\\\":27880.3200,\\\"unrealizedPnl\\\":-601.96,\\\"unrealizedPnLPercent\\\":-2.11}\";\n            }\n            var deserialized = JsonConvert.DeserializeObject<Holding>(source);\n\n            Assert.IsNotNull(deserialized.Symbol);\n            Assert.AreEqual(\"A\", deserialized.Symbol.Value);\n            Assert.AreEqual(148.34, deserialized.AveragePrice);\n            Assert.AreEqual(192, deserialized.Quantity);\n            Assert.AreEqual(145.21, deserialized.MarketPrice);\n            Assert.AreEqual(27880, deserialized.MarketValue);\n            Assert.AreEqual(-601.96, deserialized.UnrealizedPnL);\n            Assert.AreEqual(-2.11, deserialized.UnrealizedPnLPercent);\n        }\n\n        [Test]\n        public void DefaultHoldings()\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddEquity(\"SPY\");\n            var holding = new Holding(security);\n\n            var result = JsonConvert.SerializeObject(new Dictionary<string, Holding> { { security.Symbol.ID.ToString(), holding } });\n\n            Assert.AreEqual(\"{\\\"SPY R735QTJ8XC9X\\\":{}}\", result);\n\n            var deserialized = JsonConvert.DeserializeObject<Dictionary<string, Holding>>(result);\n            Assert.AreEqual(0, deserialized[security.Symbol.ID.ToString()].AveragePrice);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/IsolatorLimitResultProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class IsolatorLimitResultProviderTests\n    {\n        private TimeMonitorTest _timeMonitor;\n        private AutoResetEvent _timeMonitorEvent;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _timeMonitor = new TimeMonitorTest(monitorIntervalMs:3);\n            _timeMonitorEvent = new AutoResetEvent(false);\n            _timeMonitor.TimeMonitorEvent = _timeMonitorEvent;\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            _timeMonitor.DisposeSafely();\n        }\n\n        [Test]\n        public void ConsumeRequestsAdditionalTimeAfterOneMinute()\n        {\n            using var minuteElapsed = new ManualResetEvent(false);\n            using var consumeStarted = new ManualResetEvent(false);\n\n            Action code = () =>\n            {\n                if (!minuteElapsed.WaitOne(10000))\n                {\n                    throw new TimeoutException(\"minuteElapsed\");\n                }\n            };\n            var provider = new FakeIsolatorLimitResultProvider();\n            var timeProvider = new ManualTimeProvider(new DateTime(2000, 01, 01));\n\n            var consumeCompleted = Task.Run(() =>\n            {\n                consumeStarted.Set();\n                provider.Consume(timeProvider, code, _timeMonitor);\n            });\n\n            if (!consumeStarted.WaitOne(50))\n            {\n                Assert.Fail(\"Consume should have started.\");\n            }\n\n            // Let's give the monitor time to register the initial time\n            _timeMonitorEvent.WaitOne();\n            timeProvider.Advance(TimeSpan.FromSeconds(45));\n\n            Assert.AreEqual(0, provider.Invocations.Count);\n\n            timeProvider.Advance(TimeSpan.FromSeconds(15));\n\n            _timeMonitorEvent.WaitOne();\n\n            minuteElapsed.Set();\n            if (!consumeCompleted.Wait(50))\n            {\n                Assert.Fail(\"Consume should have returned.\");\n            }\n\n            Assert.AreEqual(1, provider.Invocations.Count);\n            Assert.AreEqual(1, provider.Invocations[0]);\n\n            // give time to the monitor to register the time consumer ended\n            _timeMonitorEvent.WaitOne();\n            Assert.AreEqual(0, _timeMonitor.Count);\n        }\n\n        [Test]\n        public void ConsumeDoesNotRequestAdditionalTimeBeforeOneMinute()\n        {\n            var timeProvider = new ManualTimeProvider(new DateTime(2000, 01, 01));\n            var provider = new FakeIsolatorLimitResultProvider();\n\n            Action code = () =>\n            {\n                _timeMonitorEvent.WaitOne();\n                timeProvider.Advance(TimeSpan.FromMinutes(.99));\n                _timeMonitorEvent.WaitOne();\n            };\n            provider.Consume(timeProvider, code, _timeMonitor);\n\n            Assert.IsEmpty(provider.Invocations);\n\n            // give time to the monitor to register the time consumer ended\n            _timeMonitorEvent.WaitOne();\n            Assert.AreEqual(0, _timeMonitor.Count);\n        }\n\n        [Test]\n        public void ConsumesMultipleMinutes()\n        {\n            var timeProvider = new ManualTimeProvider(new DateTime(2000, 01, 01));\n            var provider = new FakeIsolatorLimitResultProvider();\n\n            Action code = () =>\n            {\n                // lets give the monitor time to register the initial time\n                _timeMonitorEvent.WaitOne();\n                for (int i = 0; i < 4; i++)\n                {\n                    timeProvider.AdvanceSeconds(45);\n                    // give the monitoring task time to request more time\n                    _timeMonitorEvent.WaitOne();\n                }\n            };\n\n            provider.Consume(timeProvider, code, _timeMonitor);\n\n            Assert.AreEqual(3, provider.Invocations.Count);\n            Assert.IsTrue(provider.Invocations.TrueForAll(invoc => invoc == 1));\n            // give time to the monitor to register the time consumer ended\n            _timeMonitorEvent.WaitOne();\n            Assert.AreEqual(0, _timeMonitor.Count);\n        }\n\n        private class FakeIsolatorLimitResultProvider : IIsolatorLimitResultProvider\n        {\n            private List<int> _ivocations = new List<int>();\n            public List<int> Invocations\n            {\n                get\n                {\n                    lock (_ivocations)\n                    {\n                        return _ivocations.ToList();\n                    }\n                }\n            }\n\n            public IsolatorLimitResult IsWithinLimit()\n            {\n                return new IsolatorLimitResult(TimeSpan.Zero, string.Empty);\n            }\n\n            public void RequestAdditionalTime(int minutes)\n            {\n                lock (_ivocations)\n                {\n                    _ivocations.Add(minutes);\n                }\n            }\n\n            public bool TryRequestAdditionalTime(int minutes)\n            {\n                lock (_ivocations)\n                {\n                    _ivocations.Add(minutes);\n                }\n                return true;\n            }\n        }\n\n        private class TimeMonitorTest: TimeMonitor\n        {\n            public AutoResetEvent TimeMonitorEvent;\n\n            public TimeMonitorTest(int monitorIntervalMs = 100) : base(monitorIntervalMs) { }\n\n            protected override void ProcessConsumer(TimeConsumer consumer)\n            {\n                base.ProcessConsumer(consumer);\n\n                TimeMonitorEvent.Set();\n            }\n            protected override void RemoveAll()\n            {\n                // Store the TimeConsumer objects to remove\n                var toRemove = TimeConsumers.Where(time => time.Finished).ToList();\n\n                base.RemoveAll();\n\n                // Check if there were elements removed\n                if (toRemove.Any())\n                {\n                    TimeMonitorEvent.Set();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/IsolatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class IsolatorTests\n    {\n        [Test]\n        public void WorksCorrectlyUsingWorker()\n        {\n            using (var worker = new TestWorkerThread())\n            {\n                var isolator = new Isolator();\n                var executed = false;\n                var result = isolator.ExecuteWithTimeLimit(\n                    TimeSpan.FromMilliseconds(100),\n                    () =>\n                    {\n                        executed = true;\n                    },\n                    5000,\n                    workerThread:worker\n                );\n                Assert.IsTrue(result);\n                Assert.IsTrue(executed);\n            }\n        }\n\n        [Test]\n        public void Cancellation()\n        {\n            var isolator = new Isolator();\n            var executed = false;\n            var ended = false;\n            var canceled = false;\n            var result = false;\n            isolator.CancellationTokenSource.CancelAfter(TimeSpan.FromMilliseconds(100));\n            try\n            {\n                result = isolator.ExecuteWithTimeLimit(\n                    TimeSpan.FromSeconds(5),\n                    () => {\n                        executed = true;\n                        Thread.Sleep(5000);\n                        ended = true;\n                    },\n                    5000,\n                    sleepIntervalMillis: 10\n                );\n            }\n            catch (OperationCanceledException)\n            {\n                canceled = true;\n            }\n            Assert.IsTrue(canceled);\n            Assert.IsFalse(result);\n            Assert.IsTrue(executed);\n            Assert.IsFalse(ended);\n        }\n\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        [TestCase(Language.CSharp, true)]\n        [TestCase(Language.CSharp, false)]\n        public void TimeOutWorkCorrectly(Language language, bool useWorker)\n        {\n            var worker = useWorker ? new TestWorkerThread() : null;\n            using (worker)\n            {\n                var isolator = new Isolator();\n                bool result = false;\n                try\n                {\n                    if (language == Language.CSharp)\n                    {\n                        result = isolator.ExecuteWithTimeLimit(\n                            TimeSpan.FromMilliseconds(100),\n                            () => Thread.Sleep(10000), // 10s sleep\n                            5000,\n                            workerThread: worker\n                        );\n                    }\n                    else\n                    {\n                        result = isolator.ExecuteWithTimeLimit(\n                            TimeSpan.FromMilliseconds(100),\n                            () =>\n                            {\n                                using (Py.GIL())\n                                {\n                                    // 10s sleep\n                                    PythonEngine.RunSimpleString(\"import time; time.sleep(10)\");\n                                }\n                            },\n                            5000,\n                            workerThread: worker\n                        );\n                    }\n\n                    Assert.Fail($\"Was expecting {nameof(TimeoutException)}\");\n                }\n                catch (TimeoutException)\n                {\n                    Assert.IsFalse(result);\n                }\n            }\n        }\n\n        private class TestWorkerThread : WorkerThread\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/MarketTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class MarketTests\n    {\n        [Test]\n        public void MapsAllMarketsInMarketClass()\n        {\n            var markets = typeof(Market).GetFields();\n            foreach (var field in markets)\n            {\n                var market = (string)field.GetValue(null);\n                var code = Market.Encode(market);\n                Assert.IsTrue(code.HasValue);\n\n                var decoded = Market.Decode(code.Value);\n                Assert.AreEqual(market, decoded);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Notifications/NotificationEmailTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Notifications;\n\nnamespace QuantConnect.Tests.Common.Notifications\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class NotificationEmailTests\n    {\n        [Test]\n        public void Constructor_SetsNullData_ToEmptyString()\n        {\n            // empty string used as default following NotificationManager.Email's default value for data\n            var email = new NotificationEmail(\"e@d.com\", \"subject\", \"message\", null);\n            Assert.AreEqual(string.Empty, email.Data);\n        }\n\n        [Test]\n        public void Constructor_SetsNullSubject_ToEmptyString()\n        {\n            // empty string used if subject is null\n            var email = new NotificationEmail(\"e@d.com\", null, \"message\", \"data\");\n            Assert.AreEqual(string.Empty, email.Subject);\n        }\n\n        [Test]\n        public void Constructor_SetsNullMessage_ToEmptyString()\n        {\n            // empty string used if message is null\n            var email = new NotificationEmail(\"e@d.com\", \"subject\", null, \"data\");\n            Assert.AreEqual(string.Empty, email.Message);\n        }\n\n        [Test]\n        [TestCase(\"js@contoso.中国\", true)]\n        [TestCase(\"j@proseware.com9\", true)]\n        [TestCase(\"js@proseware.com9\", true)]\n        [TestCase(\"j_9@[129.126.118.1]\", true)]\n        [TestCase(\"jones@ms1.proseware.com\", true)]\n        [TestCase(\"david.jones@proseware.com\", true)]\n        [TestCase(\"d.j@server1.proseware.com\", true)]\n        [TestCase(\"js#internal@proseware.com\", true)]\n        [TestCase(\"j.s@server1.proseware.com\", true)]\n        [TestCase(\"\\\"j\\\\\\\"s\\\\\\\"\\\"@proseware.com\", true)]\n\n        [TestCase(\"js*@proseware.com\", false)]\n        [TestCase(\"js@proseware..com\", false)]\n        [TestCase(\"j..s@proseware.com\", false)]\n        [TestCase(\"j.@server1.proseware.com\", false)]\n        public void Constructor_ThrowsArgumentException_WhenEmailAddressIsInvalid(string address, bool isValid)\n        {\n            // Test cases sourced via msdn:\n            // https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format\n\n            TestDelegate ctor = () => new NotificationEmail(\n                address,\n                string.Empty,\n                string.Empty,\n                string.Empty\n            );\n\n            if (isValid)\n            {\n                Assert.DoesNotThrow(ctor);\n            }\n            else\n            {\n                Assert.Throws<ArgumentException>(ctor);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Notifications/NotificationFtpTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Notifications;\nusing System;\nusing System.Text;\n\nnamespace QuantConnect.Tests.Common.Notifications\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class NotificationFtpTests\n    {\n        private byte[] _testContent = Encoding.ASCII.GetBytes(\"{}\");\n\n        [Test]\n        public void PortDefaultsTo21()\n        {\n            var notification = new NotificationFtp(\"qc.com\", \"username\", \"password\", \"path/to/file.json\", _testContent);\n            Assert.AreEqual(21, notification.Port);\n        }\n\n        [TestCase(null)]\n        [TestCase(\"\")]\n        public void ThrowsOnMissingPassword(string password)\n        {\n            Assert.Throws<ArgumentException>(() => new NotificationFtp(\"qc.com\", \"username\", password, \"path/to/file.json\", _testContent));\n        }\n\n        [TestCase(null)]\n        [TestCase(\"\")]\n        public void ThrowsOnMissingSSHKeys(string privateKey)\n        {\n            Assert.Throws<ArgumentException>(() => new NotificationFtp(\"qc.com\", \"username\", privateKey, \"\", \"path/to/file.json\", _testContent));\n        }\n\n        // Protocol as in a URI\n        [TestCase(@\"ftp://qc.com\")]\n        [TestCase(@\"sftp://qc.com\")]\n        // Trailing slashes\n        [TestCase(@\"qc.com/\")]\n        [TestCase(@\"qc.com//\")]\n        // Both\n        [TestCase(@\"ftp://qc.com//\")]\n        [TestCase(@\"sftp://qc.com//\")]\n        [TestCase(@\"qc.com\")]\n        public void NormalizesHostname(string hostname)\n        {\n            var notification = new NotificationFtp(hostname, \"username\", \"password\", \"path/to/file.json\", _testContent);\n            Assert.AreEqual(\"qc.com\", notification.Hostname);\n        }\n\n        [Test]\n        public void EncodesBytesFileContent()\n        {\n            var contentStr = @\"{\"\"someKey\"\": \"\"this is a sample json file\"\", \"\"anotherKey\"\": 123456}\";\n            var contentBytes = Encoding.ASCII.GetBytes(contentStr);\n            var notification = new NotificationFtp(\"qc.com\", \"username\", \"password\", \"path/to/file.json\", contentBytes);\n            AssertEncoding(contentStr, notification);\n        }\n\n        [Test]\n        public void EncodesStringFileContent()\n        {\n            var contentStr = @\"{\"\"someKey\"\": \"\"this is a sample json file\"\", \"\"anotherKey\"\": 123456}\";\n            var notification = new NotificationFtp(\"qc.com\", \"username\", \"password\", \"path/to/file.json\", contentStr);\n            AssertEncoding(contentStr, notification);\n        }\n\n        private static void AssertEncoding(string expectedContentStr, NotificationFtp notification)\n        {\n            var decodedBytes = Convert.FromBase64String(notification.FileContent);\n            var decodedStr = Encoding.ASCII.GetString(decodedBytes);\n\n            Assert.AreEqual(expectedContentStr, decodedStr);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Notifications/NotificationJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Text;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Notifications;\n\nnamespace QuantConnect.Tests.Common.Notifications\n{\n    [TestFixture]\n    public class NotificationJsonConverterTests\n    {\n        [TestCase(true)]\n        [TestCase(false)]\n        public void EmailRoundTrip(bool nullFields)\n        {\n            var expected = new NotificationEmail(\"p@p.com\", \"subjectP\", null, null);\n            if (!nullFields)\n            {\n                expected.Headers = new Dictionary<string, string> { { \"key\", \"value\" } };\n                expected.Data = \"dataContent\";\n            }\n\n            var serialized = JsonConvert.SerializeObject(expected);\n\n            var result = (NotificationEmail)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.Subject, result.Subject);\n            Assert.AreEqual(expected.Address, result.Address);\n            Assert.AreEqual(expected.Data, result.Data);\n            Assert.AreEqual(expected.Message, result.Message);\n            Assert.AreEqual(expected.Headers, result.Headers);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SmsRoundTrip(bool nullFields)\n        {\n            var expected = new NotificationSms(\"123\", nullFields ? null : \"ImATextMessage\");\n\n            var serialized = JsonConvert.SerializeObject(expected);\n\n            var result = (NotificationSms)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.PhoneNumber, result.PhoneNumber);\n            Assert.AreEqual(expected.Message, result.Message);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void WebRoundTrip(bool nullFields)\n        {\n            var expected = new NotificationWeb(\"qc.com\",\n                nullFields ? null : \"JijiData\",\n                nullFields ? null : new Dictionary<string, string> { { \"key\", \"value\" } });\n\n            var serialized = JsonConvert.SerializeObject(expected);\n\n            var result = (NotificationWeb)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.Address, result.Address);\n            Assert.AreEqual(expected.Data, result.Data);\n            Assert.AreEqual(expected.Headers, result.Headers);\n        }\n\n        [TestCase(true, true)]\n        [TestCase(true, false)]\n        [TestCase(false, true)]\n        [TestCase(false, false)]\n        public void TelegramRoundTrip(bool nullMessage, bool nullToken)\n        {\n            var expected = new NotificationTelegram(\"pepe\", nullMessage ? null : \"ImAMessage\", nullToken ? null : \"botToken\");\n\n            var serialized = JsonConvert.SerializeObject(expected);\n\n            var result = (NotificationTelegram)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.Id, result.Id);\n            Assert.AreEqual(expected.Message, result.Message);\n            Assert.AreEqual(expected.Token, result.Token);\n        }\n\n        [Test]\n        public void FtpWithPasswordRoundTrip([Values] bool secure, [Values] bool withPort)\n        {\n            var expected = new NotificationFtp(\n                \"qc.com\",\n                \"username\",\n                \"password\",\n                \"path/to/file.json\",\n                Encoding.ASCII.GetBytes(\"{}\"),\n                secure,\n                withPort ? 2121: null);\n\n            var serialized = JsonConvert.SerializeObject(expected);\n            var result = (NotificationFtp)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.Hostname, result.Hostname);\n            Assert.AreEqual(expected.Username, result.Username);\n            Assert.AreEqual(expected.Password, result.Password);\n            Assert.AreEqual(expected.FilePath, result.FilePath);\n            Assert.AreEqual(expected.FileContent, result.FileContent);\n            Assert.AreEqual(expected.Port, result.Port);\n            Assert.AreEqual(expected.Secure, result.Secure);\n            Assert.IsNull(result.PrivateKey);\n            Assert.IsNull(result.PrivateKeyPassphrase);\n        }\n\n        [Test]\n        public void FtpWithKeyRoundTrip([Values] bool withPort, [Values] bool withPassphrase)\n        {\n            var expected = new NotificationFtp(\n                \"qc.com\",\n                \"username\",\n                \"privatekey\",\n                withPassphrase ? \"passphrase\" : null,\n                \"path/to/file.json\",\n                Encoding.ASCII.GetBytes(\"{}\"),\n                withPort ? 2121 : null);\n\n            var serialized = JsonConvert.SerializeObject(expected);\n            var result = (NotificationFtp)JsonConvert.DeserializeObject<Notification>(serialized);\n\n            Assert.AreEqual(expected.Hostname, result.Hostname);\n            Assert.AreEqual(expected.Username, result.Username);\n            Assert.AreEqual(expected.PrivateKey, result.PrivateKey);\n            Assert.AreEqual(expected.FilePath, result.FilePath);\n            Assert.AreEqual(expected.FileContent, result.FileContent);\n            Assert.AreEqual(expected.Port, result.Port);\n            Assert.IsNull(result.Password);\n            Assert.IsTrue(result.Secure);\n\n            if (withPassphrase)\n            {\n                Assert.AreEqual(expected.PrivateKeyPassphrase, result.PrivateKeyPassphrase);\n            }\n            else\n            {\n                Assert.IsNull(result.PrivateKeyPassphrase);\n            }\n        }\n\n        [Test]\n        public void CaseInsensitive()\n        {\n            var serialized = @\"[{\n\t\t\t\"\"address\"\": \"\"p@p.com\"\",\n\t\t\t\"\"subject\"\": \"\"sdads\"\"\n\t\t}, {\n\t\t\t\"\"phoneNumber\"\": \"\"11111111111\"\"\n\t\t}, {\n\t\t\t\"\"headers\"\": {\n\t\t\t\t\"\"1\"\": \"\"2\"\"\n\t\t\t},\n\t\t\t\"\"address\"\": \"\"qc.com\"\"\n\t\t}, {\n\t\t\t\"\"address\"\": \"\"qc.com/1234\"\"\n\t\t},{\n\t\t\t\"\"host\"\": \"\"qc.com\"\",\n\t\t\t\"\"username\"\": \"\"username\"\",\n\t\t\t\"\"password\"\": \"\"password\"\",\n\t\t\t\"\"fileDestinationPath\"\": \"\"path/to/file.csv\"\",\n\t\t\t\"\"fileContent\"\": \"\"abcde\"\",\n\t\t\t\"\"secure\"\": \"\"true\"\",\n\t\t\t\"\"port\"\": 2222\n\t\t},{\n\t\t\t\"\"host\"\": \"\"qc.com\"\",\n\t\t\t\"\"username\"\": \"\"username\"\",\n\t\t\t\"\"password\"\": \"\"password\"\",\n\t\t\t\"\"fileDestinationPath\"\": \"\"path/to/file.csv\"\",\n\t\t\t\"\"filecontent\"\": \"\"abcde\"\",\n\t\t\t\"\"secure\"\": \"\"false\"\",\n\t\t\t\"\"port\"\": 2222\n\t\t},{\n\t\t\t\"\"host\"\": \"\"qc.com\"\",\n\t\t\t\"\"username\"\": \"\"username\"\",\n            \"\"privatekey\"\": \"\"privatekey\"\",\n            \"\"passphrase\"\": \"\"privatekeyPassphrase\"\",\n\t\t\t\"\"fileDestinationPath\"\": \"\"path/to/file.csv\"\",\n\t\t\t\"\"filecontent\"\": \"\"abcde\"\",\n\t\t\t\"\"secure\"\": \"\"false\"\",\n\t\t\t\"\"port\"\": 2222\n\t\t}]\";\n            var result = JsonConvert.DeserializeObject<List<Notification>>(serialized);\n\n            Assert.AreEqual(7, result.Count);\n\n            var email = result[0] as NotificationEmail;\n            Assert.AreEqual(\"sdads\", email.Subject);\n            Assert.AreEqual(\"p@p.com\", email.Address);\n\n            var sms = result[1] as NotificationSms;\n            Assert.AreEqual(\"11111111111\", sms.PhoneNumber);\n\n            var web = result[2] as NotificationWeb;\n            Assert.AreEqual(1, web.Headers.Count);\n            Assert.AreEqual(\"2\", web.Headers[\"1\"]);\n            Assert.AreEqual(\"qc.com\", web.Address);\n\n            var web2 = result[3] as NotificationWeb;\n            Assert.AreEqual(\"qc.com/1234\", web2.Address);\n\n            var ftp = result[4] as NotificationFtp;\n            Assert.AreEqual(\"qc.com\", ftp.Hostname);\n            Assert.AreEqual(\"username\", ftp.Username);\n            Assert.AreEqual(\"password\", ftp.Password);\n            Assert.AreEqual(\"path/to/file.csv\", ftp.FilePath);\n            Assert.AreEqual(\"abcde\", ftp.FileContent);\n            Assert.IsTrue(ftp.Secure);\n            Assert.AreEqual(2222, ftp.Port);\n            Assert.IsNull(ftp.PrivateKey);\n            Assert.IsNull(ftp.PrivateKeyPassphrase);\n\n            var ftp2 = result[5] as NotificationFtp;\n            Assert.AreEqual(\"qc.com\", ftp2.Hostname);\n            Assert.AreEqual(\"username\", ftp2.Username);\n            Assert.AreEqual(\"password\", ftp2.Password);\n            Assert.AreEqual(\"path/to/file.csv\", ftp2.FilePath);\n            Assert.AreEqual(\"abcde\", ftp2.FileContent);\n            Assert.IsFalse(ftp2.Secure);\n            Assert.AreEqual(2222, ftp2.Port);\n            Assert.IsNull(ftp.PrivateKey);\n            Assert.IsNull(ftp.PrivateKeyPassphrase);\n\n            var ftp3 = result[6] as NotificationFtp;\n            Assert.AreEqual(\"qc.com\", ftp3.Hostname);\n            Assert.AreEqual(\"username\", ftp3.Username);\n            Assert.AreEqual(\"privatekey\", ftp3.PrivateKey);\n            Assert.AreEqual(\"privatekeyPassphrase\", ftp3.PrivateKeyPassphrase);\n            Assert.AreEqual(\"path/to/file.csv\", ftp3.FilePath);\n            Assert.AreEqual(\"abcde\", ftp3.FileContent);\n            Assert.IsTrue(ftp3.Secure);\n            Assert.AreEqual(2222, ftp3.Port);\n            Assert.IsNull(ftp3.Password);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Notifications/NotificationManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Notifications;\n\nnamespace QuantConnect.Tests.Common.Notifications\n{\n    [TestFixture(true)]\n    [TestFixture(false)]\n    public class NotificationManagerTests\n    {\n        private readonly bool _liveMode;\n        private NotificationManager _notify;\n\n        public NotificationManagerTests(bool liveMode)\n        {\n            _liveMode = liveMode;\n        }\n\n        [SetUp]\n        public void Setup()\n        {\n            _notify = new NotificationManager(_liveMode);\n        }\n\n        [Test]\n        public void Email_AddsNotificationEmail_ToMessages_WhenLiveModeIsTrue()\n        {\n            Assert.AreEqual(_liveMode, _notify.Email(\"address@domain.com\", \"subject\", \"message\", \"data\"));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationEmail>(_notify.Messages.Single());\n            }\n        }\n\n        [Test]\n        public void Sms_AddsNotificationSms_ToMessages_WhenLiveModeIsTrue()\n        {\n            Assert.AreEqual(_liveMode, _notify.Sms(\"phone-number\", \"message\"));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationSms>(_notify.Messages.Single());\n            }\n        }\n\n        [Test]\n        public void Web_AddsNotificationWeb_ToMessages_WhenLiveModeIsTrue()\n        {\n            Assert.AreEqual(_liveMode, _notify.Web(\"address\", \"data\"));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationWeb>(_notify.Messages.Single());\n            }\n        }\n\n        [Test]\n        public void TelegramAddsNotificationToMessagesWhenLiveModeIsTrue()\n        {\n            Assert.AreEqual(_liveMode, _notify.Telegram(\"pepe\", \"ImAMessage\", \"botToken\"));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationTelegram>(_notify.Messages.Single());\n            }\n        }\n\n        [Test]\n        public void FtpAddsNotificationToMessagesWhenLiveModeIsTrue()\n        {\n            Assert.AreEqual(_liveMode, _notify.Ftp(\"qc.com\", \"username\", \"password\", \"path/to/file.json\", Encoding.ASCII.GetBytes(\"{}\")));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationFtp>(_notify.Messages.Single());\n            }\n        }\n\n        [Test]\n        public void FtpAddsNotificationToMessagesWhenLiveModeIsTrueFromStringContents()\n        {\n            Assert.AreEqual(_liveMode, _notify.Ftp(\"qc.com\", \"username\", \"password\", \"path/to/file.json\", \"{}\"));\n            Assert.AreEqual(_liveMode ? 1 : 0, _notify.Messages.Count);\n            if (_liveMode)\n            {\n                Assert.IsInstanceOf<NotificationFtp>(_notify.Messages.Single());\n            }\n        }\n\n        [TestCase(\"email\")]\n        [TestCase(\"web\")]\n        public void PythonOverloads(string notificationType)\n        {\n            using (Py.GIL())\n            {\n                dynamic function;\n                bool result;\n                var test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef email(notifier):\n    headers = {'header-key': 'header-value'}\n    return notifier.Email('me@email.com', 'subject', 'message', 'data', headers)\n    \ndef web(notifier):\n    headers = {'header-key': 'header-value'}\n    data = {'objectA':'valueA', 'objectB':{'PropertyA':10, 'PropertyB':'stringB'}}\n    return notifier.Web('api.quantconnect.com', data, headers)\");\n\n\n                switch (notificationType)\n                {\n                    case \"email\":\n                        function = test.GetAttr(\"email\");\n                        result = function(_notify);\n                        break;\n\n                    case \"web\":\n                        function = test.GetAttr(\"web\");\n                        result = function(_notify);\n                        break;\n\n                    default:\n                        throw new ArgumentException($\"Invalid method: {notificationType}\");\n                }\n\n                if (_liveMode)\n                {\n                    Assert.IsTrue(result);\n                }\n                else\n                {\n                    Assert.IsFalse(result);\n                }\n            }\n\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/NullTimeKeeper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Common\n{\n    internal class NullTimeKeeper : ITimeKeeper\n    {\n        public static ITimeKeeper Instance = new NullTimeKeeper();\n        public DateTime UtcTime => throw new NotImplementedException();\n\n        private NullTimeKeeper()\n        {\n        }\n\n        public void AddTimeZone(DateTimeZone timeZone)\n        {\n            throw new NotImplementedException();\n        }\n\n        public LocalTimeKeeper GetLocalTimeKeeper(DateTimeZone timeZone)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/OSTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System.IO;\nusing System.Reflection;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class OSTests\n    {\n        [Test]\n        public void GetServerStatistics()\n        {\n            Assert.DoesNotThrow(() => OS.GetServerStatistics());\n        }\n        \n        [Test]\n        public void GetDriveCorrectly()\n        {\n            var expectedDrive = Path.GetPathRoot(Assembly.GetAssembly(GetType()).Location);\n            var expectedDriveInfo = new DriveInfo(expectedDrive);\n            var totalSizeInMegaBytes = (int)(expectedDriveInfo.TotalSize / (1024 * 1024));\n            Assert.AreEqual(totalSizeInMegaBytes, OS.DriveTotalSpace);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/OrderTargetsByMarginImpactTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common\n{\n    public class OrderTargetsByMarginImpactTests\n    {\n        [TestCase(false)]\n        [TestCase(true)]\n        public void LessThanLotSizeIsIgnored_NoHoldings(bool targetIsDelta)\n        {\n            var algorithm = GetAlgorithm();\n            var collection = new[] {new PortfolioTarget(Symbols.AAPL, 0.9m)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n            Assert.AreEqual(0, result.Count);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void LessThanLotSizeIsIgnored_WithHoldings(bool targetIsDelta)\n        {\n            var algorithm = GetAlgorithm(holdings:1m);\n            var collection = new[] { new PortfolioTarget(Symbols.AAPL, 1.9m) };\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n\n            if (targetIsDelta)\n            {\n                Assert.AreEqual(1, result.Count);\n                Assert.AreEqual(1.9m, result[0].Quantity);\n            }\n            else\n            {\n                Assert.AreEqual(0, result.Count);\n            }\n        }\n\n        [Test]\n        public void SecurityWithNoDataIsIgnored()\n        {\n            var algorithm = GetAlgorithm();\n\n            // SPY won't have any data and should be ignored\n            algorithm.AddEquity(Symbols.SPY.Value);\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 5000m),\n                new PortfolioTarget(Symbols.AAPL, 1m)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm).ToList();\n            Assert.AreEqual(1, result.Count);\n            Assert.AreEqual(1m, result[0].Quantity);\n        }\n\n        [Test]\n        public void NoExistingHoldings()\n        {\n            var algorithm = GetAlgorithm();\n            var spy = algorithm.AddEquity(Symbols.SPY.Value);\n            Update(spy, 1);\n\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 5m),\n                new PortfolioTarget(Symbols.AAPL, 1m)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm).ToList();\n            Assert.AreEqual(2, result.Count);\n            // highest order value first\n            Assert.AreEqual(5m, result[0].Quantity);\n            Assert.AreEqual(1m, result[1].Quantity);\n        }\n\n        [TestCase(OrderDirection.Buy, false)]\n        [TestCase(OrderDirection.Sell, false)]\n        [TestCase(OrderDirection.Buy, true)]\n        [TestCase(OrderDirection.Sell, true)]\n        public void ReducingPosition(OrderDirection direction, bool targetIsDelta)\n        {\n            var algorithm = GetAlgorithm(direction == OrderDirection.Sell ? 2 : -2);\n            var spy = algorithm.AddEquity(Symbols.SPY.Value);\n            Update(spy, 1);\n\n            var target = direction == OrderDirection.Sell ? -1 : 1;\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 5m),\n                new PortfolioTarget(Symbols.AAPL, target)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n\n            Assert.AreEqual(2, result.Count);\n            // target reducing the position first\n            Assert.AreEqual(target, result[0].Quantity);\n            Assert.AreEqual(5m, result[1].Quantity);\n        }\n\n        [TestCase(OrderDirection.Buy, false)]\n        [TestCase(OrderDirection.Sell, false)]\n        [TestCase(OrderDirection.Buy, true)]\n        [TestCase(OrderDirection.Sell, true)]\n        public void ReducingPositionDeltaEffect(OrderDirection direction, bool targetIsDelta)\n        {\n            var algorithm = GetAlgorithm(direction == OrderDirection.Sell ? 2 : -2);\n            var spy = algorithm.AddEquity(Symbols.SPY.Value);\n            Update(spy, 1);\n\n            var target = direction == OrderDirection.Sell ? -2.5m : 2.5m;\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 5m),\n                new PortfolioTarget(Symbols.AAPL, target)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n\n            Assert.AreEqual(2, result.Count);\n\n            if (targetIsDelta)\n            {\n                // target reducing the position first\n                Assert.AreEqual(target, result[0].Quantity);\n                Assert.AreEqual(5m, result[1].Quantity);\n            }\n            else\n            {\n                Assert.AreEqual(5m, result[0].Quantity);\n                Assert.AreEqual(target, result[1].Quantity);\n            }\n        }\n\n        [TestCase(OrderDirection.Buy, false)]\n        [TestCase(OrderDirection.Sell, false)]\n        [TestCase(OrderDirection.Buy, true)]\n        [TestCase(OrderDirection.Sell, true)]\n        public void IncreasePosition(OrderDirection direction, bool targetIsDelta)\n        {\n            var value = direction == OrderDirection.Sell ? -1 : 1;\n            var algorithm = GetAlgorithm(value);\n            var spy = algorithm.AddEquity(Symbols.SPY.Value);\n            Update(spy, 1);\n\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 20m),\n                new PortfolioTarget(Symbols.AAPL, value * 21m)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n\n            Assert.AreEqual(2, result.Count);\n\n            if (targetIsDelta)\n            {\n                // AAPL is increasing the position by 21\n                Assert.AreEqual(Symbols.AAPL, result[0].Symbol);\n                Assert.AreEqual(Symbols.SPY, result[1].Symbol);\n            }\n            else\n            {\n                Assert.AreEqual(Symbols.SPY, result[0].Symbol);\n                // target with the least order value, AAPL is increasing the position by 11\n                Assert.AreEqual(Symbols.AAPL, result[1].Symbol);\n            }\n        }\n\n        [TestCase(OrderDirection.Buy, false)]\n        [TestCase(OrderDirection.Sell, false)]\n        [TestCase(OrderDirection.Buy, true)]\n        [TestCase(OrderDirection.Sell, true)]\n        public void RoundQuantityInOrderTargets(OrderDirection direction, bool targetIsDelta)\n        {\n            var value = direction == OrderDirection.Sell ? -1 : 1;\n            var algorithm = GetAlgorithm(value);\n            var spy = algorithm.AddEquity(Symbols.SPY.Value);\n            Update(spy, 1);\n\n            var collection = new[] {new PortfolioTarget(Symbols.SPY, 20m),\n                new PortfolioTarget(Symbols.AAPL, value * 20.1m)};\n\n            var result = collection.OrderTargetsByMarginImpact(algorithm, targetIsDelta).ToList();\n\n            Assert.AreEqual(2, result.Count);\n\n            // Since the order value is the same SPY comes first because of its the first in collection.\n            Assert.AreEqual(Symbols.SPY, result[0].Symbol);\n            Assert.AreEqual(Symbols.AAPL, result[1].Symbol);\n        }\n\n        private static void Update(Security security, decimal close)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n        }\n\n        private QCAlgorithm GetAlgorithm(decimal? holdings = null)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var aapl = algorithm.AddEquity(Symbols.AAPL.Value);\n            Update(aapl, 1);\n\n            if (holdings != null)\n            {\n                aapl.Holdings.SetHoldings(10, holdings.Value);\n            }\n            algorithm.SetFinishedWarmingUp();\n            return algorithm;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/CoinbaseOrderPropertiesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class CoinbaseOrderPropertiesTests\n    {\n        [Test]\n        public void GDAXOrderPropertiesCloneTypeCompatibility()\n        {\n            var gdaxOrderProperties = new GDAXOrderProperties();\n\n            var clone = gdaxOrderProperties.Clone();\n\n            Assert.IsInstanceOf<GDAXOrderProperties>(clone);\n            Assert.IsInstanceOf<CoinbaseOrderProperties>(clone);\n            Assert.IsInstanceOf<IOrderProperties>(clone);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/AlpacaFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class AlpacaFeeModelTests\n    {\n        private readonly IFeeModel _feeModel = new AlpacaFeeModel();\n\n        [Test]\n        public void ZeroFee()\n        {\n            var security = SecurityTests.GetSecurity();\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(0m, fee.Value.Amount);\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void CryptoTakerFee(OrderDirection orderDirection)\n        {\n            var btcusd = GetCryptoSecurity();\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    btcusd,\n                    new MarketOrder(btcusd.Symbol, orderDirection == OrderDirection.Sell ? -2 : 2, DateTime.UtcNow)\n                )\n            );\n\n            if (orderDirection == OrderDirection.Buy)\n            {\n                Assert.AreEqual(btcusd.BaseCurrency.Symbol, fee.Value.Currency);\n                Assert.AreEqual(0.005m, fee.Value.Amount);\n            }\n            else\n            {\n                Assert.AreEqual(btcusd.QuoteCurrency.Symbol, fee.Value.Currency);\n                Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n                Assert.AreEqual(200m, fee.Value.Amount);\n            }\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void CryptoMakerFee(OrderDirection orderDirection)\n        {\n            var btcusd = GetCryptoSecurity();\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    btcusd,\n                    new LimitOrder(btcusd.Symbol, orderDirection == OrderDirection.Sell ? -2 : 2, 50000, DateTime.UtcNow)\n                )\n            );\n\n            if (orderDirection == OrderDirection.Buy)\n            {\n                Assert.AreEqual(btcusd.BaseCurrency.Symbol, fee.Value.Currency);\n                Assert.AreEqual(0.003m, fee.Value.Amount);\n            }\n            else\n            {\n                Assert.AreEqual(btcusd.QuoteCurrency.Symbol, fee.Value.Currency);\n                Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n                Assert.AreEqual(120m, fee.Value.Amount);\n            }\n        }\n\n        private static Crypto GetCryptoSecurity()\n        {\n            var btcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 1),\n                new Cash(\"BTC\", 0, 40000),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Minute, TimeZones.Utc, TimeZones.Utc, true, false, false),\n                new SymbolProperties(\"BTCUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            btcusd.SetMarketPrice(new Tick(DateTime.UtcNow, btcusd.Symbol, 40000, 40000));\n            return btcusd;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/AlphaStreamsFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class AlphaStreamsFeeModelTests\n    {\n        [Test]\n        public void CalculateEquityMinimumFeeInUSD()\n        {\n            var feeModel = new AlphaStreamsFeeModel();\n            var security = SecurityTests.GetSecurity();\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(1m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void CalculateEquityFeeInUSD()\n        {\n            var feeModel = new AlphaStreamsFeeModel();\n            var security = SecurityTests.GetSecurity();\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1000, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(5m, fee.Value.Amount);\n        }\n\n        [TestCase(-1)]\n        [TestCase(1)]\n        public void CalculateOrderFeeForLongOrShortFutures(int quantity)\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Future(Symbols.Fut_SPY_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var parameters = new OrderFeeParameters(\n                security,\n                new MarketOrder(security.Symbol, quantity, DateTime.UtcNow)\n            );\n\n            var fee = feeModel.GetOrderFee(parameters);\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(Math.Abs(quantity) * 0.50m, fee.Value.Amount);\n        }\n\n        [TestCase(-1)]\n        [TestCase(1)]\n        public void CalculateOrderFeeForLongOrShortOptions(int quantity)\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Option(Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(\"USD\")),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var parameters = new OrderFeeParameters(\n                security,\n                new MarketOrder(security.Symbol, quantity, DateTime.UtcNow)\n            );\n\n            var fee = feeModel.GetOrderFee(parameters);\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(Math.Abs(quantity) * 0.50m, fee.Value.Amount);\n        }\n\n        [TestCase(-1)]\n        [TestCase(1)]\n        public void GetMinimumOrderFeeForLongOrShortOptions(int quantity)\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Option(Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(\"USD\")),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var parameters = new OrderFeeParameters(\n                security,\n                new MarketOrder(security.Symbol, quantity, DateTime.UtcNow)\n            );\n\n            var fee = feeModel.GetOrderFee(parameters);\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(Math.Abs(quantity) * 0.50m, fee.Value.Amount);\n        }\n\n        [TestCase(-1000)]\n        [TestCase(1000)]\n        public void CalculateOrderFeeForLongOrShortForex(int quantity)\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Forex(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 1),\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURUSD, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"EURUSD\", \"USD\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var parameters = new OrderFeeParameters(\n                security,\n                new MarketOrder(security.Symbol, quantity, DateTime.UtcNow)\n            );\n\n            var fee = feeModel.GetOrderFee(parameters);\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(0.000002m * security.Price * Math.Abs(quantity), fee.Value.Amount);\n        }\n\n        [TestCase(-1000000)]\n        [TestCase(1000000)]\n        public void CalculateOrderFeeForLongOrShortForexNonUsd(int quantity)\n        {\n            var conversionRate = 1.2m;\n            var tz = TimeZones.NewYork;\n            var security = new Forex(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"GBP\", 0, conversionRate),\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURGBP, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"EURGBP\", \"GBP\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, quantity, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(0.000002m * security.Price * Math.Abs(quantity) * conversionRate, fee.Value.Amount);\n        }\n\n        [Test]\n        public void CalculateReturnsFeeInQuotecurrencyInAccountCurrency()\n        {\n            Crypto btcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(Currencies.USD, 0, 1),\n                    new Cash(\"BTC\", 0, 0),\n                    new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false),\n                    new SymbolProperties(\"BTCUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                );\n            btcusd.SetMarketPrice(new Tick(DateTime.UtcNow, btcusd.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    btcusd,\n                    new MarketOrder(btcusd.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(0.2m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ReturnsFeeInQuoteCurrencyInOtherCurrency()\n        {\n            Crypto btceur = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(\"EUR\", 0, 10),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCEUR, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false),\n                new SymbolProperties(\"BTCEUR\", \"EUR\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            btceur.SetMarketPrice(new Tick(DateTime.UtcNow, btceur.Symbol, 100, 100));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    btceur,\n                    new MarketOrder(btceur.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(\"EUR\", fee.Value.Currency);\n            Assert.AreEqual(0.2m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void CalculateOrderFeeForCfd()\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Cfd(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(typeof(QuoteBar), Symbols.DE30EUR, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"DE30EUR\", \"EUR\", 1, 0.01m, 1m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 12000, 12000));\n\n            var feeModel = new AlphaStreamsFeeModel();\n\n            var fee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(0, fee.Value.Amount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BackwardsCompatibilityFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BackwardsCompatibilityFeeModelTests\n    {\n        private Security _security;\n        private static DateTime orderDateTime;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _security = SecurityTests.GetSecurity();\n            orderDateTime = new DateTime(2017, 2, 2, 13, 0, 0);\n            var reference = DateTime.Now;\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            _security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n        }\n\n        #region Python\n\n        [Test]\n        public void OldFeeModelModel_GetOrderFee_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFeeModel:\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.CalledGetOrderFee = False\\n\" +\n                    \"   def GetOrderFee(self, security, order):\\n\" +\n                    \"       self.CalledGetOrderFee = True\\n\" +\n                    \"       return 15\");\n\n                var customFeeModel = module.GetAttr(\"CustomFeeModel\").Invoke();\n                var wrapper = new FeeModelPythonWrapper(customFeeModel);\n\n                var result = wrapper.GetOrderFee(new OrderFeeParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime)\n                ));\n\n                bool called;\n                customFeeModel.GetAttr(\"CalledGetOrderFee\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(15, result.Value.Amount);\n                Assert.AreEqual(Currencies.USD, result.Value.Currency);\n            }\n        }\n\n        [Test]\n        public void NewFeeModelModel_GetOrderFee_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFeeModel(FeeModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.CalledGetOrderFee = False\\n\" +\n                    \"   def GetOrderFee(self, parameters):\\n\" +\n                    \"       self.CalledGetOrderFee = True\\n\" +\n                    \"       return OrderFee(CashAmount(15, \\\"USD\\\"))\");\n\n                var customFeeModel = module.GetAttr(\"CustomFeeModel\").Invoke();\n                var wrapper = new FeeModelPythonWrapper(customFeeModel);\n\n                var result = wrapper.GetOrderFee(new OrderFeeParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime)\n                ));\n\n                bool called;\n                customFeeModel.GetAttr(\"CalledGetOrderFee\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(15, result.Value.Amount);\n                Assert.AreEqual(Currencies.USD, result.Value.Currency);\n            }\n        }\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BinanceCoinFuturesFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nusing NUnit.Framework;\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities.CryptoFuture;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BinanceCoinFuturesFeeModelTests\n    {\n        [Test]\n        public void GetFeeModelTest()\n        {\n            var model = new BinanceCoinFuturesBrokerageModel(AccountType.Margin);\n            Assert.IsInstanceOf<BinanceCoinFuturesFeeModel>(model.GetFeeModel(Security));\n        }\n\n        private static void TestFeeModel(BinanceCoinFuturesFeeModel feeModel, OrderTestParameters parameters, bool shortOrder, decimal expectedFeeFactor)\n        {\n            var order = shortOrder ? parameters.CreateShortOrder(Quantity) : parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(expectedFeeFactor * Math.Abs(Quantity) * Security.SymbolProperties.ContractMultiplier / Security.Price, fee.Value.Amount);\n            Assert.AreEqual(Security.BaseCurrency.Symbol, fee.Value.Currency);\n        }\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel();\n            TestFeeModel(feeModel, parameters, true, BinanceCoinFuturesFeeModel.MakerTier1Fee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel();\n            TestFeeModel(feeModel, parameters, true, BinanceCoinFuturesFeeModel.TakerTier1Fee);\n        }\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel();\n            TestFeeModel(feeModel, parameters, false, BinanceCoinFuturesFeeModel.MakerTier1Fee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel();\n            TestFeeModel(feeModel, parameters, false, BinanceCoinFuturesFeeModel.TakerTier1Fee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnShortOrderCustomMakerFees(decimal makerFee, decimal takerFee, OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel(makerFee, takerFee);\n            TestFeeModel(feeModel, parameters, true, makerFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnShortOrderCustomTakerFees(decimal makerFee, decimal takerFee, OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel(makerFee, takerFee);\n            TestFeeModel(feeModel, parameters, true, takerFee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnLongOrderCustomMakerFees(decimal makerFee, decimal takerFee, OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel(makerFee, takerFee);\n            TestFeeModel(feeModel, parameters, false, makerFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnLongOrderCustomTakerFees(decimal makerFee, decimal takerFee, OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceCoinFuturesFeeModel(makerFee, takerFee);\n            TestFeeModel(feeModel, parameters, false, takerFee);\n        }\n\n        private static Symbol Symbol => Symbol.Create(\"ETHUSD\", SecurityType.CryptoFuture, Market.Binance);\n\n        private static CryptoFuture Security\n        {\n            get\n            {\n                var security = new CryptoFuture(\n                    Symbol,\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(\"USD\", 0, 1m),\n                    new Cash(\"ETH\", 0, 1m),\n                    SymbolProperties.GetDefault(\"USD\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n\n        private static OrderSubmissionData OrderSubmissionData => new(Security.BidPrice, Security.AskPrice, (Security.BidPrice + Security.AskPrice) / 2);\n\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n\n        private static decimal Quantity => 1m;\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BinanceOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new BinanceOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n\n        private static TestCaseData[] CustomMakerOrders => new[]\n        {\n            new TestCaseData(0.001m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(0.00008m, 0.00045m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(0.00005m, 0.0004m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n            new TestCaseData(0.00003m, 0.0003m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BinanceOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(0.0m, 0.00025m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] CustomTakerOrders => new[]\n        {\n            new TestCaseData(0.00008m, 0.00045m, new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(0.00005m, 0.0004m, new MarketOrderTestParameters(Symbol, new BinanceOrderProperties { PostOnly = true })),\n            new TestCaseData(0.0m, 0.00025m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BinanceFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BinanceFeeModelTests\n    {\n        [Test]\n        public static void GetFeeModelTest()\n        {\n            var model = new BinanceBrokerageModel();\n            Assert.IsInstanceOf<BinanceFeeModel>(model.GetFeeModel(Security));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel();\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BinanceFeeModel.MakerTier1Fee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel();\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BinanceFeeModel.TakerTier1Fee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel();\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BinanceFeeModel.MakerTier1Fee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel();\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BinanceFeeModel.TakerTier1Fee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnShortOrderCustomMakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel(mFee, tFee);\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                mFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnShortOrderCustomTakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel(mFee, tFee);\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                tFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnLongOrderCustomMakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel(mFee, tFee);\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                mFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnLongOrderCustomTakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BinanceFeeModel(mFee, tFee);\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                tFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        public void ReturnsSameFeesForStableCoinsWithoutPairs()\n        {\n            IFeeModel feeModel = new BinanceFeeModel();\n\n            var tz = TimeZones.NewYork;\n\n            // Use a StableCoin without pair in Binance\n            Security usdcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 10),\n                new Cash(\"USDC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbol.Create(\"USDCUSD\", SecurityType.Crypto, Market.Binance), Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"USDCUSD\", \"USD\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            usdcusd.SetMarketPrice(new Tick(DateTime.UtcNow, usdcusd.Symbol, 100, 100));\n\n            var time = new DateTime(2019, 2, 1);\n            var stableCoinFee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    usdcusd,\n                    new MarketOrder(usdcusd.Symbol, 1, time)\n                )\n            );\n\n            var normalPairFee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    Security,\n                    new MarketOrder(Security.Symbol, 1, time)\n                )\n            );\n\n            Assert.AreEqual(normalPairFee.Value.Amount, stableCoinFee.Value.Amount);\n        }\n\n        private static Symbol Symbol => Symbol.Create(\"ETHUSDT\", SecurityType.Crypto, Market.Binance);\n\n        private static Security Security\n        {\n            get\n            {\n                var security = new Security(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        Symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        false,\n                        false,\n                        false\n                    ),\n                    new Cash(\"USDT\", 0, 1m),\n                    SymbolProperties.GetDefault(\"USDT\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n\n        private static OrderSubmissionData OrderSubmissionData => new(Security.BidPrice, Security.AskPrice, (Security.BidPrice + Security.AskPrice) / 2);\n\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n\n        private static decimal Quantity => 1m;\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BinanceOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new BinanceOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n\n        private static TestCaseData[] CustomMakerOrders => new[]\n        {\n            new TestCaseData(0.001m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(0.0009m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(0.0008m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n            new TestCaseData(0.0007m, 0.0009m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BinanceOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(0.0006m, 0.0008m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BinanceOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] CustomTakerOrders => new[]\n        {\n            new TestCaseData(0.0007m, 0.0009m, new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(0.0006m, 0.0008m, new MarketOrderTestParameters(Symbol, new BinanceOrderProperties { PostOnly = true })),\n            new TestCaseData(0.0005m, 0.0006m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BinanceFuturesFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing NUnit.Framework;\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BinanceFuturesFeeModelTests\n    {\n        [Test]\n        public void GetFeeModelTest()\n        {\n            var model = new BinanceFuturesBrokerageModel(AccountType.Margin);\n            Assert.IsInstanceOf<BinanceFuturesFeeModel>(model.GetFeeModel(Securities[0]));\n        }\n\n        private static void TestFeeModel(BinanceFuturesFeeModel feeModel, OrderTestParameters parameters, bool shortOrder, decimal expectedFeeFactor)\n        {\n            var order = shortOrder ? parameters.CreateShortOrder(Quantity) : parameters.CreateLongOrder(Quantity);\n            var security = Securities.First(x => x.Symbol == order.Symbol);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(security, order));\n\n            var expectedFee = expectedFeeFactor * Math.Abs(Quantity) * security.SymbolProperties.ContractMultiplier * security.Price;\n            Assert.AreEqual(expectedFee, fee.Value.Amount);\n            Assert.AreEqual(security.QuoteCurrency.Symbol, fee.Value.Currency);\n        }\n\n        private static decimal GetExpectedFee(Symbol symbol, decimal usdtFee, decimal busdFee)\n        {\n            var security = Securities.First(x => x.Symbol == symbol);\n            return security.QuoteCurrency.Symbol == \"USDT\" ? usdtFee : busdFee;\n        }\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel();\n            var expectedMakerFee = GetExpectedFee(parameters.Symbol,\n                BinanceFuturesFeeModel.MakerTier1USDTFee, BinanceFuturesFeeModel.MakerTier1BUSDFee);\n\n            TestFeeModel(feeModel, parameters, true, expectedMakerFee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel();\n            var expectedTakerFee = GetExpectedFee(parameters.Symbol,\n                BinanceFuturesFeeModel.TakerTier1USDTFee, BinanceFuturesFeeModel.TakerTier1BUSDFee);\n\n            TestFeeModel(feeModel, parameters, true, expectedTakerFee);\n        }\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel();\n            var expectedMakerFee = GetExpectedFee(parameters.Symbol,\n                BinanceFuturesFeeModel.MakerTier1USDTFee, BinanceFuturesFeeModel.MakerTier1BUSDFee);\n\n            TestFeeModel(feeModel, parameters, false, expectedMakerFee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel();\n            var expectedTakerFee = GetExpectedFee(parameters.Symbol,\n                BinanceFuturesFeeModel.TakerTier1USDTFee, BinanceFuturesFeeModel.TakerTier1BUSDFee);\n\n            TestFeeModel(feeModel, parameters, false, expectedTakerFee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnShortOrderCustomMakerFees(decimal makerUsdtFee, decimal takerUsdtFee, decimal makerBusdFee, decimal takerBusdFee,\n            OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel(makerUsdtFee, takerUsdtFee, makerBusdFee, takerBusdFee);\n            var expectedMakerFee = GetExpectedFee(parameters.Symbol, makerUsdtFee, makerBusdFee);\n\n            TestFeeModel(feeModel, parameters, true, expectedMakerFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnShortOrderCustomTakerFees(decimal makerUsdtFee, decimal takerUsdtFee, decimal makerBusdFee, decimal takerBusdFee,\n            OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel(makerUsdtFee, takerUsdtFee, makerBusdFee, takerBusdFee);\n            var expectedTakerFee = GetExpectedFee(parameters.Symbol, takerUsdtFee, takerBusdFee);\n\n            TestFeeModel(feeModel, parameters, true, expectedTakerFee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnLongOrderCustomMakerFees(decimal makerUsdtFee, decimal takerUsdtFee, decimal makerBusdFee, decimal takerBusdFee,\n            OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel(makerUsdtFee, takerUsdtFee, makerBusdFee, takerBusdFee);\n            var expectedMakerFee = GetExpectedFee(parameters.Symbol, makerUsdtFee, makerBusdFee);\n\n            TestFeeModel(feeModel, parameters, false, expectedMakerFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnLongOrderCustomTakerFees(decimal makerUsdtFee, decimal takerUsdtFee, decimal makerBusdFee, decimal takerBusdFee,\n            OrderTestParameters parameters)\n        {\n            var feeModel = new BinanceFuturesFeeModel(makerUsdtFee, takerUsdtFee, makerBusdFee, takerBusdFee);\n            var expectedTakerFee = GetExpectedFee(parameters.Symbol, takerUsdtFee, takerBusdFee);\n\n            TestFeeModel(feeModel, parameters, false, expectedTakerFee);\n        }\n\n        private static readonly List<Symbol> Symbols = new List<Symbol>\n        {\n            Symbol.Create(\"ETHUSDT\", SecurityType.CryptoFuture, Market.Binance),\n            Symbol.Create(\"ETHBUSD\", SecurityType.CryptoFuture, Market.Binance)\n        };\n\n        private static readonly List<CryptoFuture> Securities = Symbols.Select(symbol =>\n        {\n            CurrencyPairUtil.DecomposeCurrencyPair(symbol, out var baseCurrency, out var quoteCurrency);\n            var security = new CryptoFuture(\n                symbol,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(quoteCurrency, 0, 1m),\n                new Cash(baseCurrency, 0, 1m),\n                SymbolProperties.GetDefault(quoteCurrency),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, symbol, LowPrice, HighPrice));\n\n            return security;\n        }).ToList();\n\n        private static readonly Dictionary<Symbol, OrderSubmissionData> OrderSubmissionData = Securities.ToDictionary(\n            security => security.Symbol,\n            security => new OrderSubmissionData(security.BidPrice, security.AskPrice, (security.BidPrice + security.AskPrice) / 2)\n        );\n\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n        private static decimal Quantity => 1m;\n\n        private static TestCaseData[] MakerOrders => Symbols\n            .Select(symbol => new[]\n            {\n                new TestCaseData(new LimitOrderTestParameters(symbol, HighPrice, LowPrice)),\n                new TestCaseData(new LimitOrderTestParameters(symbol, HighPrice, LowPrice, null, OrderSubmissionData[symbol])),\n                new TestCaseData(new LimitOrderTestParameters(symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n                new TestCaseData(new LimitOrderTestParameters(symbol, LowPrice, HighPrice,\n                    new BinanceOrderProperties() { PostOnly = true }, OrderSubmissionData[symbol])),\n                new TestCaseData(new LimitOrderTestParameters(symbol, HighPrice, LowPrice,\n                    new BinanceOrderProperties() { PostOnly = true }))\n            })\n            .SelectMany(x => x)\n            .ToArray();\n\n        private static TestCaseData[] TakerOrders => Symbols\n            .Select(symbol => new[]\n            {\n                new TestCaseData(new MarketOrderTestParameters(symbol)),\n                new TestCaseData(new MarketOrderTestParameters(symbol, new BinanceOrderProperties() { PostOnly = true })),\n                new TestCaseData(new LimitOrderTestParameters(symbol, LowPrice, HighPrice, null, OrderSubmissionData[symbol]))\n            })\n            .SelectMany(x => x)\n            .ToArray();\n\n        private static TestCaseData[] CustomMakerOrders => Symbols\n            .Select(symbol => new[]\n            {\n                new TestCaseData(0.0002m, 0.0004m, 0.00012m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, HighPrice, LowPrice)),\n                new TestCaseData(0.00016m, 0.0004m, 0.00012m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, HighPrice, LowPrice, null, OrderSubmissionData[symbol])),\n                new TestCaseData(0.00014m, 0.00035m, 0.00012m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, HighPrice, LowPrice, new BinanceOrderProperties())),\n                new TestCaseData(0.00012m, 0.00032m, 0.00012m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, LowPrice, HighPrice, new BinanceOrderProperties() { PostOnly = true },\n                        OrderSubmissionData[symbol])),\n                new TestCaseData(0.0001m, 0.0003m, 0.0001m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, HighPrice, LowPrice, new BinanceOrderProperties() { PostOnly = true }))\n            })\n            .SelectMany(x => x)\n            .ToArray();\n\n        private static TestCaseData[] CustomTakerOrders => Symbols\n            .Select(symbol => new[]\n            {\n                new TestCaseData(0.00016m, 0.0004m, 0.00012m, 0.0003m,\n                    new MarketOrderTestParameters(symbol)),\n                new TestCaseData(0.00014m, 0.00035m, 0.00012m, 0.0003m,\n                    new MarketOrderTestParameters(symbol, new BinanceOrderProperties { PostOnly = true })),\n                new TestCaseData(0.00012m, 0.00032m, 0.00012m, 0.0003m,\n                    new LimitOrderTestParameters(symbol, LowPrice, HighPrice, null, OrderSubmissionData[symbol]))\n            })\n            .SelectMany(x => x)\n            .ToArray();\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BitfinexFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    class BitfinexFeeModelTests\n    {\n        private Crypto _btcusd;\n        private Crypto _btceur;\n        private readonly IFeeModel _feeModel = new BitfinexFeeModel();\n\n        [SetUp]\n        public void Initialize()\n        {\n            var tz = TimeZones.NewYork;\n            _btcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _btcusd.SetMarketPrice(new Tick(DateTime.UtcNow, _btcusd.Symbol, 100, 100));\n\n            _btceur = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"EUR\", 0, 10),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCEUR, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCEUR\", \"EUR\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _btceur.SetMarketPrice(new Tick(DateTime.UtcNow, _btceur.Symbol, 100, 100));\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void ReturnsFeeInQuoteCurrencyInAccountCurrency(decimal quantity)\n        {\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btcusd,\n                    new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow)\n                )\n            );\n\n            if (quantity > 0)\n            {\n                Assert.AreEqual(\"BTC\", fee.Value.Currency);\n                // 1 (quantity) * 0.002 (taker fee)\n                Assert.AreEqual(0.002m, fee.Value.Amount);\n            }\n            else\n            {\n                Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n                // 100 (price) * 0.002 (taker fee)\n                Assert.AreEqual(0.2m, fee.Value.Amount);\n            }\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void ReturnsFeeInQuoteCurrencyInOtherCurrency(decimal quantity)\n        {\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btceur,\n                    new MarketOrder(_btceur.Symbol, quantity, DateTime.UtcNow)\n                )\n            );\n\n            if (quantity > 0)\n            {\n                Assert.AreEqual(\"BTC\", fee.Value.Currency);\n                // 1 (quantity) * 0.002 (taker fee)\n                Assert.AreEqual(0.002m, fee.Value.Amount);\n            }\n            else\n            {\n                Assert.AreEqual(\"EUR\", fee.Value.Currency);\n                // 100 (price) * 0.002 (taker fee)\n                Assert.AreEqual(0.2m, fee.Value.Amount);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BybitFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing System;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BybitFeeModelTests\n    {\n        protected IFeeModel FeeModel => new BybitFeeModel(); \n        \n        \n        [Test]\n        public static void GetFeeModelTest()\n        {\n            var model = new BybitBrokerageModel();\n            Assert.IsInstanceOf<BybitFeeModel>(model.GetFeeModel(Security));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n           var feeModel = FeeModel;\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BybitFeeModel.MakerNonVIPFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = FeeModel;\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BybitFeeModel.TakerNonVIPFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = FeeModel;\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BybitFeeModel.MakerNonVIPFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = FeeModel;\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                BybitFeeModel.TakerNonVIPFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnShortOrderCustomMakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BybitFeeModel(mFee, tFee);\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                mFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnShortOrderCustomTakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BybitFeeModel(mFee, tFee);\n\n            var order = parameters.CreateShortOrder(Quantity);\n            var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                tFee * price * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnLongOrderCustomMakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BybitFeeModel(mFee, tFee);\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                mFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnLongOrderCustomTakerFees(decimal mFee, decimal tFee, OrderTestParameters parameters)\n        {\n            IFeeModel feeModel = new BybitFeeModel(mFee, tFee);\n\n            var order = parameters.CreateLongOrder(Quantity);\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order));\n\n            Assert.AreEqual(\n                tFee * Math.Abs(Quantity),\n                fee.Value.Amount);\n            Assert.AreEqual(\"ETH\", fee.Value.Currency);\n        }\n\n        [Test]\n        public void ReturnsSameFeesForStableCoinsWithoutPairs()\n        {\n            IFeeModel feeModel = FeeModel;\n\n            var tz = TimeZones.NewYork;\n\n            // Use a StableCoin without pair in Binance\n            Security usdcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 10),\n                new Cash(\"USDC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbol.Create(\"USDCUSD\", SecurityType.Crypto, Market.Binance), Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"USDCUSD\", \"USD\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            usdcusd.SetMarketPrice(new Tick(DateTime.UtcNow, usdcusd.Symbol, 100, 100));\n\n            var time = new DateTime(2019, 2, 1);\n            var stableCoinFee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    usdcusd,\n                    new MarketOrder(usdcusd.Symbol, 1, time)\n                )\n            );\n\n            var normalPairFee = feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    Security,\n                    new MarketOrder(Security.Symbol, 1, time)\n                )\n            );\n\n            Assert.AreEqual(normalPairFee.Value.Amount, stableCoinFee.Value.Amount);\n        }\n\n        private static Symbol Symbol => Symbol.Create(\"ETHUSDT\", SecurityType.Crypto, Market.Bybit);\n\n        private static Security Security\n        {\n            get\n            {\n                var security = new Security(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        Symbol,\n                        Resolution.Minute,\n                        TimeZones.Utc,\n                        TimeZones.Utc,\n                        false,\n                        false,\n                        false\n                    ),\n                    new Cash(\"USDT\", 0, 1m),\n                    SymbolProperties.GetDefault(\"USDT\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n\n        private static OrderSubmissionData OrderSubmissionData => new(Security.BidPrice, Security.AskPrice, (Security.BidPrice + Security.AskPrice) / 2);\n\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n\n        private static decimal Quantity => 1m;\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BybitOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new BybitOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n\n        private static TestCaseData[] CustomMakerOrders => new[]\n        {\n            new TestCaseData(0.001m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(0.0009m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(0.0008m, 0.001m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties())),\n            new TestCaseData(0.0007m, 0.0009m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, new BybitOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(0.0006m, 0.0008m, new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] CustomTakerOrders => new[]\n        {\n            new TestCaseData(0.0007m, 0.0009m, new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(0.0006m, 0.0008m, new MarketOrderTestParameters(Symbol, new BybitOrderProperties { PostOnly = true })),\n            new TestCaseData(0.0005m, 0.0006m, new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/BybitFuturesFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing NUnit.Framework;\n\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class BybitFuturesFeeModelTests\n    {\n        [Test]\n        public void GetFeeModelTest()\n        {\n            var model = new BybitBrokerageModel(AccountType.Margin);\n            Assert.IsInstanceOf<BybitFuturesFeeModel>(model.GetFeeModel(security));\n        }\n\n        private static void TestFeeModel(\n            BybitFuturesFeeModel feeModel,\n            OrderTestParameters parameters,\n            bool shortOrder,\n            decimal expectedFeeFactor\n            )\n        {\n            var order = shortOrder ? parameters.CreateShortOrder(Quantity) : parameters.CreateLongOrder(Quantity);\n            var securit = security;\n            var fee = feeModel.GetOrderFee(new OrderFeeParameters(security, order));\n\n            var expectedFee = expectedFeeFactor * Math.Abs(Quantity) * security.SymbolProperties.ContractMultiplier *\n                security.Price;\n            Assert.AreEqual(expectedFee, fee.Value.Amount);\n            Assert.AreEqual(security.QuoteCurrency.Symbol, fee.Value.Currency);\n        }\n\n\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnShortOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BybitFuturesFeeModel();\n\n            TestFeeModel(feeModel, parameters, true, BybitFuturesFeeModel.MakerNonVIPFee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnShortOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BybitFuturesFeeModel();\n\n\n            TestFeeModel(feeModel, parameters, true, BybitFuturesFeeModel.TakerNonVIPFee);\n        }\n\n        [TestCaseSource(nameof(MakerOrders))]\n        public void ReturnLongOrderMakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BybitFuturesFeeModel();\n\n\n            TestFeeModel(feeModel, parameters, false, BybitFuturesFeeModel.MakerNonVIPFee);\n        }\n\n        [TestCaseSource(nameof(TakerOrders))]\n        public void ReturnLongOrderTakerFees(OrderTestParameters parameters)\n        {\n            var feeModel = new BybitFuturesFeeModel();\n\n            TestFeeModel(feeModel, parameters, false, BybitFuturesFeeModel.TakerNonVIPFee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnShortOrderCustomMakerFees(\n            decimal makerUsdtFee,\n            decimal takerUsdtFee,\n            OrderTestParameters parameters\n            )\n        {\n            var feeModel = new BybitFuturesFeeModel(makerUsdtFee, takerUsdtFee);\n\n            TestFeeModel(feeModel, parameters, true, makerUsdtFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnShortOrderCustomTakerFees(\n            decimal makerUsdtFee,\n            decimal takerUsdtFee,\n            OrderTestParameters parameters\n            )\n        {\n            var feeModel = new BybitFuturesFeeModel(makerUsdtFee, takerUsdtFee);\n\n            TestFeeModel(feeModel, parameters, true, takerUsdtFee);\n        }\n\n        [TestCaseSource(nameof(CustomMakerOrders))]\n        public void ReturnLongOrderCustomMakerFees(\n            decimal makerUsdtFee,\n            decimal takerUsdtFee,\n            OrderTestParameters parameters\n            )\n        {\n            var feeModel = new BybitFuturesFeeModel(makerUsdtFee, takerUsdtFee);\n\n\n            TestFeeModel(feeModel, parameters, false, makerUsdtFee);\n        }\n\n        [TestCaseSource(nameof(CustomTakerOrders))]\n        public void ReturnLongOrderCustomTakerFees(\n            decimal makerUsdtFee,\n            decimal takerUsdtFee,\n            OrderTestParameters parameters\n            )\n        {\n            var feeModel = new BybitFuturesFeeModel(makerUsdtFee, takerUsdtFee);\n\n            TestFeeModel(feeModel, parameters, false, takerUsdtFee);\n        }\n\n        private static readonly Symbol Symbol = Symbol.Create(\"ETHUSDT\", SecurityType.CryptoFuture, Market.Bybit);\n\n        private static CryptoFuture security\n        {\n            get\n            {\n                CurrencyPairUtil.DecomposeCurrencyPair(Symbol, out var baseCurrency, out var quoteCurrency);\n                var security = new CryptoFuture(\n                    Symbol,\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    new Cash(quoteCurrency, 0, 1m),\n                    new Cash(baseCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(quoteCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n                security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbol, LowPrice, HighPrice));\n\n                return security;\n            }\n        }\n\n        private static readonly OrderSubmissionData OrderSubmissionData = new OrderSubmissionData(security.BidPrice, security.AskPrice, (security.BidPrice + security.AskPrice) / 2);\n\n        private static decimal HighPrice => 1000m;\n        private static decimal LowPrice => 100m;\n        private static decimal Quantity => 1m;\n\n        private static TestCaseData[] MakerOrders => new[]\n        {\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null,\n                OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties())),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice,\n                new BybitOrderProperties() { PostOnly = true }, OrderSubmissionData)),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, HighPrice, LowPrice,\n                new BybitOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] TakerOrders => new[]\n        {\n            new TestCaseData(new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(new MarketOrderTestParameters(Symbol, new BybitOrderProperties() { PostOnly = true })),\n            new TestCaseData(new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null,\n                OrderSubmissionData))\n        };\n\n        private static TestCaseData[] CustomMakerOrders => new[]\n        {\n            new TestCaseData(0.0002m, 0.0004m,\n                new LimitOrderTestParameters(Symbol, HighPrice, LowPrice)),\n            new TestCaseData(0.00016m, 0.0004m,\n                new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, null, OrderSubmissionData)),\n            new TestCaseData(0.00014m, 0.00035m,\n                new LimitOrderTestParameters(Symbol, HighPrice, LowPrice, new BybitOrderProperties())),\n            new TestCaseData(0.00012m, 0.00032m,\n                new LimitOrderTestParameters(Symbol, LowPrice, HighPrice,\n                    new BybitOrderProperties() { PostOnly = true },\n                    OrderSubmissionData)),\n            new TestCaseData(0.0001m, 0.0003m,\n                new LimitOrderTestParameters(Symbol, HighPrice, LowPrice,\n                    new BybitOrderProperties() { PostOnly = true }))\n        };\n\n        private static TestCaseData[] CustomTakerOrders => new[]\n        {\n            new TestCaseData(0.00016m, 0.0004m,\n                new MarketOrderTestParameters(Symbol)),\n            new TestCaseData(0.00014m, 0.00035m,\n                new MarketOrderTestParameters(Symbol, new BybitOrderProperties { PostOnly = true })),\n            new TestCaseData(0.00012m, 0.00032m,\n                new LimitOrderTestParameters(Symbol, LowPrice, HighPrice, null, OrderSubmissionData))\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/CoinbaseFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    class CoinbaseFeeModelTests\n    {\n        private Crypto _btcusd;\n        private Crypto _btceur;\n        private Crypto _daiusdc;\n        private readonly IFeeModel _feeModel = new CoinbaseFeeModel();\n\n        [SetUp]\n        public void Initialize()\n        {\n            var tz = TimeZones.NewYork;\n            _btcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _btcusd.SetMarketPrice(new Tick(DateTime.UtcNow, _btcusd.Symbol, 100, 100));\n\n            _btceur = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"EUR\", 0, 10),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCEUR, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCEUR\", \"EUR\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _btceur.SetMarketPrice(new Tick(DateTime.UtcNow, _btceur.Symbol, 100, 100));\n\n            _daiusdc = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USDC\", 0, 10),\n                new Cash(\"DAI\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbol.Create(\"DAIUSDC\", SecurityType.Crypto, Market.Coinbase), Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"DAIUSDC\", \"USDC\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _daiusdc.SetMarketPrice(new Tick(DateTime.UtcNow, _daiusdc.Symbol, 100, 100));\n        }\n\n        [Test]\n        public void ReturnsFeeInQuoteCurrencyInAccountCurrency()\n        {\n            var time = new DateTime(2019, 2, 1);\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btcusd,\n                    new MarketOrder(_btcusd.Symbol, 1, time)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            // 100 (price) * 0.003 (taker fee)\n            Assert.AreEqual(0.3m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ReturnsFeeInQuoteCurrencyInOtherCurrency()\n        {\n            var time = new DateTime(2019, 2, 1);\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btceur,\n                    new MarketOrder(_btceur.Symbol, 1, time)\n                )\n            );\n\n            Assert.AreEqual(\"EUR\", fee.Value.Currency);\n            // 100 (price) * 0.003 (taker fee)\n            Assert.AreEqual(0.3m, fee.Value.Amount);\n        }\n\n        [TestCase(2019, 2, 1, 0.1)]\n        [TestCase(2023, 1, 3, 0.001)]\n        public void ReturnsExpectedFeeWithStableCoins(int year, int month, int day, decimal expectedStableFee)\n        {\n            var time = new DateTime(year, month, day);\n            var stablePairFee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _daiusdc,\n                    new MarketOrder(_daiusdc.Symbol, 1, time)\n                )\n            );\n\n            var normalPairFee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btcusd,\n                    new MarketOrder(_btcusd.Symbol, 1, time)\n                )\n            );\n\n            // 100 (price) * 0.001m or 0.00001m (taker stable fee)\n            Assert.AreEqual(expectedStableFee, stablePairFee.Value.Amount);\n            Assert.AreNotEqual(normalPairFee.Value.Amount, stablePairFee.Value.Amount);\n        }\n\n        [TestCase(2019, 2, 1, 0, 0, 0, 0.3)]\n        [TestCase(2019, 3, 23, 1, 29, 59, 0.3)]\n        [TestCase(2019, 3, 23, 1, 30, 0, 0.25)]\n        [TestCase(2019, 4, 1, 0, 0, 0, 0.25)]\n        [TestCase(2024, 1, 2, 0, 0, 0, 0.8)]\n        public void FeeChangesOverTime(int year, int month, int day, int hour, int minute, int second, decimal expectedFee)\n        {\n            var time = new DateTime(year, month, day, hour, minute, second);\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _btcusd,\n                    new MarketOrder(_btcusd.Symbol, 1, time)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            // 100 (price) * fee (taker fee)\n            Assert.AreEqual(expectedFee, fee.Value.Amount);\n        }\n\n        [TestCase(0.0035, 0.0055, false, 0.55)]\n        [TestCase(0.0035, 0.0055, true, 0.35)]\n        [TestCase(0.0025, 0.004, true, 0.25)]\n        public void CustomCoinbaseFeeModelPlusCoinbaseOrderProperty(decimal customMakerFee, decimal customTakerFee, bool postOnly, decimal expectedFee)\n        {\n            decimal orderAmount = -1m;\n            IFeeModel customFeeModel = new CoinbaseFeeModel(customMakerFee, customTakerFee);\n\n            var dateTime = new DateTime(2024, 1, 2, 0, 0, 0);\n            var orderProperty = new CoinbaseOrderProperties() { PostOnly = postOnly };\n\n            var fee = customFeeModel.GetOrderFee(new OrderFeeParameters(_btcusd, new LimitOrder(_btcusd.Symbol, orderAmount, 99, dateTime, \"fee\", orderProperty)\n            {\n                OrderSubmissionData = new OrderSubmissionData(_btcusd.BidPrice, _btcusd.AskPrice, _btcusd.Price)\n            }));\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            // (order.Direction == Buy ? AskPrice : BidPrice) * orderAmount * (maker)fee || (taker)fee\n            Assert.AreEqual(expectedFee, fee.Value.Amount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/FTXFeeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class FTXFeeTests\n    {\n        private Crypto _xrpusdt;\n        private Crypto _ethusd;\n        private IFeeModel _feeModel;\n\n        protected decimal TakerFee { get; set; }\n        protected decimal MakerFee { get; set; }\n\n        [SetUp]\n        public void Initialize()\n        {\n            _feeModel = GetFeeModel();\n            SetBrokerageFees();\n            var spdb = SymbolPropertiesDatabase.FromDataFolder();\n            var tz = TimeZones.Utc;\n            _xrpusdt = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USDT\", 0, 1),\n                new Cash(\"XRP\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbol.Create(\"XRPUSDT\", SecurityType.Crypto, Market.FTX), Resolution.Minute, tz, tz, true, false, false),\n                spdb.GetSymbolProperties(Market.FTX, Symbol.Create(\"XRPUSDT\", SecurityType.Crypto, Market.FTX), SecurityType.Crypto, \"USDT\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _xrpusdt.SetMarketPrice(new Tick(DateTime.UtcNow, _xrpusdt.Symbol, 100, 100));\n\n            _ethusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 10),\n                new Cash(\"ETH\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.FTX), Resolution.Minute, tz, tz, true, false, false),\n                spdb.GetSymbolProperties(Market.FTX, Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.FTX), SecurityType.Crypto, Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            _ethusd.SetMarketPrice(new Tick(DateTime.UtcNow, _ethusd.Symbol, 100, 100));\n        }\n\n        protected virtual void SetBrokerageFees()\n        {\n            MakerFee = 0.02m;\n            TakerFee = 0.07m;\n        }\n\n        [TestCase(-1)]\n        [TestCase(1)]\n        public void ReturnsTakerFeeInQuoteCurrency(decimal quantity)\n        {\n            //{\n            //    \"channel\": \"fills\",\n            //    \"type\": \"update\",\n            //    \"data\": {\n            //        \"id\": 4199228419,\n            //        \"market\": \"XRP/USDT\",\n            //        \"future\": null,\n            //        \"baseCurrency\": \"XRP\",\n            //        \"quoteCurrency\": \"USDT\",\n            //        \"type\": \"order\",\n            //        \"side\": \"sell\",\n            //        \"price\": 1.07225,\n            //        \"size\": 10,\n            //        \"orderId\": 85922585621,\n            //        \"time\": \"2021-10-07T19:25:45.411201+00:00\",\n            //        \"tradeId\": 2084391649,\n            //        \"feeRate\": 0.0007,\n            //        \"fee\": 0.00750575,\n            //        \"feeCurrency\": \"USDT\",\n            //        \"liquidity\": \"taker\"\n            //    }\n            //}\n\n            //{\n            //    \"channel\": \"fills\",\n            //    \"type\": \"update\",\n            //    \"data\": {\n            //        \"id\": 4199574804,\n            //        \"market\": \"XRP/USDT\",\n            //        \"future\": null,\n            //        \"baseCurrency\": \"XRP\",\n            //        \"quoteCurrency\": \"USDT\",\n            //        \"type\": \"order\",\n            //        \"side\": \"buy\",\n            //        \"price\": 1.075725,\n            //        \"size\": 1,\n            //        \"orderId\": 85928918834,\n            //        \"time\": \"2021-10-07T20:02:07.116972+00:00\",\n            //        \"tradeId\": 2084563562,\n            //        \"feeRate\": 0.0007,\n            //        \"fee\": 0.0007530075,\n            //        \"feeCurrency\": \"USDT\",\n            //        \"liquidity\": \"taker\"\n            //    }\n            //}\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _ethusd,\n                    new MarketOrder(_ethusd.Symbol, quantity, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(_ethusd.QuoteCurrency.Symbol, fee.Value.Currency);\n            // 100 (price) * 0.0007 (taker fee, in quote currency)\n            Assert.AreEqual(TakerFee, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ReturnsMakerFeeInQuoteCurrency()\n        {\n            //{\n            //    \"channel\": \"fills\",\n            //    \"type\": \"update\",\n            //    \"data\": {\n            //        \"id\": 4199162157,\n            //        \"market\": \"XRP/USDT\",\n            //        \"future\": null,\n            //        \"baseCurrency\": \"XRP\",\n            //        \"quoteCurrency\": \"USDT\",\n            //        \"type\": \"order\",\n            //        \"side\": \"sell\",\n            //        \"price\": 1.074,\n            //        \"size\": 1,\n            //        \"orderId\": 85920785762,\n            //        \"time\": \"2021-10-07T19:19:27.092534+00:00\",\n            //        \"tradeId\": 2084358777,\n            //        \"feeRate\": 0.0002,\n            //        \"fee\": 0.0002148,\n            //        \"feeCurrency\": \"USDT\",\n            //        \"liquidity\": \"maker\"\n            //    }\n            //}\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _ethusd,\n                    new LimitOrder(_ethusd.Symbol, -1, 100, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(_ethusd.QuoteCurrency.Symbol, fee.Value.Currency);\n            // 0.0002 (maker fee, in quote currency)\n            Assert.AreEqual(MakerFee, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ReturnsMakerFeeInBaseCurrency()\n        {\n            //{\n            //    \"channel\": \"fills\",\n            //    \"type\": \"update\",\n            //    \"data\": {\n            //        \"id\": 4199609111,\n            //        \"market\": \"XRP/USDT\",\n            //        \"future\": null,\n            //        \"baseCurrency\": \"XRP\",\n            //        \"quoteCurrency\": \"USDT\",\n            //        \"type\": \"order\",\n            //        \"side\": \"buy\",\n            //        \"price\": 1.077,\n            //        \"size\": 1,\n            //        \"orderId\": 85929414038,\n            //        \"time\": \"2021-10-07T20:05:40.241875+00:00\",\n            //        \"tradeId\": 2084580551,\n            //        \"feeRate\": 0.0002,\n            //        \"fee\": 0.0002,\n            //        \"feeCurrency\": \"XRP\",\n            //        \"liquidity\": \"maker\"\n            //    }\n            //}\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _ethusd,\n                    new LimitOrder(_ethusd.Symbol, 1, 100, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(_ethusd.BaseCurrency.Symbol, fee.Value.Currency);\n            // 0.0002 (maker fee, in base currency)\n            Assert.AreEqual(MakerFee / 100, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ReturnsFeeInQuoteCurrencyInNonAccountCurrency()\n        {\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _xrpusdt,\n                    new MarketOrder(_xrpusdt.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(\"USDT\", fee.Value.Currency);\n            // 100 (price) * 0.0007 (taker fee)\n            Assert.AreEqual(TakerFee, fee.Value.Amount);\n        }\n\n        protected virtual FTXFeeModel GetFeeModel() => new();\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/FTXUSFeeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders.Fees;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class FTXUSFeeTests : FTXFeeTests\n    {\n        protected override FTXFeeModel GetFeeModel() => new FTXUSFeeModel();\n\n        protected override void SetBrokerageFees()\n        {\n            TakerFee = 0.4m;\n            MakerFee = 0.1m;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/InteractiveBrokersFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class InteractiveBrokersFeeModelTests\n    {\n        private readonly IFeeModel _feeModel = new InteractiveBrokersFeeModel();\n\n        [Test]\n        public void USAEquityMinimumFeeInUSD()\n        {\n            var security = SecurityTests.GetSecurity();\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(1m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void USAEquityFeeInUSD()\n        {\n            var security = SecurityTests.GetSecurity();\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1000, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(5m, fee.Value.Amount);\n        }\n\n        [TestCaseSource(nameof(USAFuturesFeeTestCases))]\n        public void USAFutureFee(Symbol symbol, decimal expectedFee)\n        {\n            var tz = TimeZones.NewYork;\n            var future = new Future(symbol,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n            var security = (Security) (symbol.SecurityType == SecurityType.Future\n                ? future\n                : new FutureOption(symbol,\n                    SecurityExchangeHours.AlwaysOpen(tz),\n                    new Cash(\"USD\", 0, 0),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(\"USD\")),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache(),\n                    future));\n            var time = new DateTime(2022, 8, 18);\n            security.SetMarketPrice(new Tick(time, security.Symbol, 100, 100));\n            var fee = _feeModel.GetOrderFee(new OrderFeeParameters(security, new MarketOrder(security.Symbol, 1000, time)));\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(1000 * expectedFee, fee.Value.Amount);\n        }\n\n        [TestCase(\"USD\", 70000, 0.00002 * 70000)]\n        [TestCase(\"USD\", 100000, 0.00002 * 100000)]\n        [TestCase(\"USD\", 10000, 1)] // The calculated fee will be under 1, but the minimum fee is 1 USD\n        [TestCase(\"JPY\", 3000000, 0.00002 * 3000000)]\n        [TestCase(\"JPY\", 1000000, 40)]// The calculated fee will be under 40, but the minimum fee is 40 JPY\n        [TestCase(\"HKD\", 600000, 0.00002 * 600000)]\n        [TestCase(\"HKD\", 200000, 10)]// The calculated fee will be under 10, but the minimum fee is 10 HKD\n        public void CalculatesCFDFee(string quoteCurrency, decimal price, decimal expectedFee)\n        {\n            var security = new Cfd(Symbols.DE10YBEUR,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(quoteCurrency, 0, 0),\n                SymbolProperties.GetDefault(quoteCurrency),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n            security.QuoteCurrency.ConversionRate = 1;\n\n\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, price, price));\n\n            var order = new MarketOrder(security.Symbol, 1, DateTime.UtcNow);\n            var fee = _feeModel.GetOrderFee(new OrderFeeParameters(security, order));\n\n            Assert.AreEqual(quoteCurrency, fee.Value.Currency);\n            Assert.AreEqual(expectedFee, fee.Value.Amount);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void HongKongFutureFee(bool canonical)\n        {\n            var symbol = Symbols.CreateFutureSymbol(Futures.Indices.HangSeng, SecurityIdentifier.DefaultDate);\n            if (!canonical)\n            {\n                symbol = Symbols.CreateFutureSymbol(Futures.Indices.HangSeng,\n                    FuturesExpiryFunctions.FuturesExpiryFunction(symbol)(new DateTime(2021, 12, 1)));\n            }\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n            var properties = SymbolPropertiesDatabase.FromDataFolder()\n                .GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, null);\n            var security = new Future(symbol, entry.ExchangeHours,\n                new Cash(properties.QuoteCurrency, 0, 0),\n                properties,\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetMarketPrice(new Tick(new DateTime(2021, 12, 1), security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1000, new DateTime(2021, 12, 1))\n                )\n            );\n\n            Assert.AreEqual(Currencies.HKD, fee.Value.Currency);\n            Assert.AreEqual(1000 * 40m, fee.Value.Amount);\n        }\n\n        [TestCase(OrderType.ComboMarket, 0.01, 250)]\n        [TestCase(OrderType.ComboLimit, 0.01, 250)]\n        [TestCase(OrderType.ComboLegLimit, 0.01, 250)]\n        [TestCase(OrderType.Limit, 0.01, 250)]\n        [TestCase(OrderType.StopLimit, 0.01, 250)]\n        [TestCase(OrderType.LimitIfTouched, 0.01, 250)]\n        [TestCase(OrderType.StopMarket, 0.01, 250)]\n        [TestCase(OrderType.TrailingStop, 0.01, 250)]\n        [TestCase(OrderType.Market, 0.01, 250)]\n        [TestCase(OrderType.MarketOnClose, 0.01, 250)]\n        [TestCase(OrderType.MarketOnOpen, 0.01, 250)]\n        [TestCase(OrderType.ComboMarket, 0.2, 650)]\n        [TestCase(OrderType.ComboLimit, 0.2, 650)]\n        [TestCase(OrderType.ComboLegLimit, 0.2, 650)]\n        [TestCase(OrderType.Limit, 0.2, 650)]\n        [TestCase(OrderType.StopLimit, 0.2, 650)]\n        [TestCase(OrderType.LimitIfTouched, 0.2, 650)]\n        [TestCase(OrderType.StopMarket, 0.2, 650)]\n        [TestCase(OrderType.TrailingStop, 0.2, 650)]\n        [TestCase(OrderType.Market, 0.2, 650)]\n        [TestCase(OrderType.MarketOnClose, 0.2, 650)]\n        [TestCase(OrderType.MarketOnOpen, 0.2, 650)]\n        [TestCase(OrderType.ComboMarket, 0.07, 500)]\n        [TestCase(OrderType.ComboLimit, 0.07, 500)]\n        [TestCase(OrderType.ComboLegLimit, 0.07, 500)]\n        [TestCase(OrderType.Limit, 0.07, 500)]\n        [TestCase(OrderType.StopLimit, 0.07, 500)]\n        [TestCase(OrderType.LimitIfTouched, 0.07, 500)]\n        [TestCase(OrderType.StopMarket, 0.07, 500)]\n        [TestCase(OrderType.TrailingStop, 0.07, 500)]\n        [TestCase(OrderType.Market, 0.07, 500)]\n        [TestCase(OrderType.MarketOnClose, 0.07, 500)]\n        [TestCase(OrderType.MarketOnOpen, 0.07, 500)]\n        public void USAOptionFee(OrderType orderType, double price, double expectedFees)\n        {\n            var optionPrice = (decimal)price;\n            var tz = TimeZones.NewYork;\n            var security = new Option(Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(\"USD\")),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, optionPrice, 0));\n            var order = (new Mock<Order>()).Object;\n            var groupOrderManager = new GroupOrderManager(0, 2, 10);\n\n            switch (orderType)\n            {\n                case OrderType.ComboMarket:\n                    order = new ComboMarketOrder(security.Symbol, 1000, DateTime.UtcNow, groupOrderManager);\n                    break;\n                case OrderType.ComboLimit:\n                    order = new ComboLimitOrder(security.Symbol, 1000, optionPrice, DateTime.UtcNow, groupOrderManager);\n                    break;\n                case OrderType.ComboLegLimit:\n                    order = new ComboLegLimitOrder(security.Symbol, 1000, optionPrice, DateTime.UtcNow, groupOrderManager);\n                    break;\n                case OrderType.Limit:\n                    order = new LimitOrder(security.Symbol, 1000, optionPrice, DateTime.UtcNow);\n                    break;\n                case OrderType.StopLimit:\n                    order = new StopLimitOrder(security.Symbol, 1000, optionPrice, optionPrice, DateTime.UtcNow);\n                    break;\n                case OrderType.LimitIfTouched:\n                    order = new LimitIfTouchedOrder(security.Symbol, 1000, optionPrice, optionPrice, DateTime.UtcNow);\n                    break;\n                case OrderType.StopMarket:\n                    order = new StopMarketOrder(security.Symbol, 1000, optionPrice, DateTime.UtcNow);\n                    break;\n                case OrderType.TrailingStop:\n                    order = new TrailingStopOrder(security.Symbol, 1000, optionPrice, optionPrice, false, DateTime.UtcNow);\n                    break;\n                case OrderType.Market:\n                    order = new MarketOrder(security.Symbol, 1000, DateTime.UtcNow);\n                    break;\n                case OrderType.MarketOnClose:\n                    order = new MarketOnCloseOrder(security.Symbol, 1000, DateTime.UtcNow);\n                    break;\n                case OrderType.MarketOnOpen:\n                    order = new MarketOnOpenOrder(security.Symbol, 1000, DateTime.UtcNow);\n                    break;\n            }\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    order\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual((decimal)expectedFees, fee.Value.Amount);\n        }\n\n        [Test]\n        public void USAOptionMinimumFee()\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Option(Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"USD\", 0, 0),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(\"USD\")),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(1m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void ForexFee_NonUSD()\n        {\n            var tz = TimeZones.NewYork;\n            var security = new Forex(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(\"GBP\", 0, 0),\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURGBP, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"EURGBP\", \"GBP\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 100, 100));\n\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    security,\n                    new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                )\n            );\n\n            Assert.AreEqual(Currencies.USD, fee.Value.Currency);\n            Assert.AreEqual(2m, fee.Value.Amount);\n        }\n\n        [Test]\n        public void GetOrderFeeThrowsForUnsupportedSecurityType()\n        {\n            Assert.Throws<ArgumentException>(\n                () =>\n                {\n                    var tz = TimeZones.NewYork;\n                    var security = new Crypto(\n                        Symbols.BTCUSD,\n                        SecurityExchangeHours.AlwaysOpen(tz),\n                        new Cash(\"USD\", 0, 0),\n                        new Cash(\"BTC\", 0, 0),\n                        SymbolProperties.GetDefault(\"USD\"),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCache()\n                    );\n                    security.SetMarketPrice(new Tick(DateTime.UtcNow, security.Symbol, 12000, 12000));\n\n                    _feeModel.GetOrderFee(\n                        new OrderFeeParameters(\n                            security,\n                            new MarketOrder(security.Symbol, 1, DateTime.UtcNow)\n                        )\n                    );\n                });\n        }\n\n        private static TestCaseData[] USAFuturesFeeTestCases()\n        {\n            return new[]\n            {\n                // E-mini Futures\n                new { Symbol = Futures.Indices.Dow30EMini, Type = SecurityType.Future, ExpectedFee = 2.15m },\n                new { Symbol = Futures.Indices.Russell2000EMini, Type = SecurityType.Future, ExpectedFee = 2.15m },\n                new { Symbol = Futures.Indices.SP500EMini, Type = SecurityType.Future, ExpectedFee = 2.15m },\n                new { Symbol = Futures.Indices.NASDAQ100EMini, Type = SecurityType.Future, ExpectedFee = 2.15m },\n                // E-mini Future options\n                new { Symbol = Futures.Indices.Dow30EMini, Type = SecurityType.FutureOption, ExpectedFee = 1.42m },\n                new { Symbol = Futures.Indices.Russell2000EMini, Type = SecurityType.FutureOption, ExpectedFee = 1.42m },\n                new { Symbol = Futures.Indices.SP500EMini, Type = SecurityType.FutureOption, ExpectedFee = 1.42m },\n                new { Symbol = Futures.Indices.NASDAQ100EMini, Type = SecurityType.FutureOption, ExpectedFee = 1.42m },\n                // Micro E-mini Futures\n                new { Symbol = Futures.Indices.MicroDow30EMini, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Indices.MicroRussell2000EMini, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Indices.MicroSP500EMini, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Indices.MicroNASDAQ100EMini, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Financials.MicroY2TreasuryBond, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Financials.MicroY5TreasuryBond, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Financials.MicroY10TreasuryNote, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Financials.MicroY30TreasuryBond, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Metals.MicroGold, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Metals.MicroSilver, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                new { Symbol = Futures.Energy.MicroCrudeOilWTI, Type = SecurityType.Future, ExpectedFee = 0.57m },\n                // Micro E-mini Future options\n                new { Symbol = Futures.Indices.MicroDow30EMini, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Indices.MicroRussell2000EMini, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Indices.MicroSP500EMini, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Indices.MicroNASDAQ100EMini, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Financials.MicroY2TreasuryBond, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Financials.MicroY5TreasuryBond, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Financials.MicroY10TreasuryNote, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Financials.MicroY30TreasuryBond, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Metals.MicroGold, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Metals.MicroSilver, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                new { Symbol = Futures.Energy.MicroCrudeOilWTI, Type = SecurityType.FutureOption, ExpectedFee = 0.47m },\n                // Cryptocurrency futures\n                new { Symbol = Futures.Currencies.BTC, Type = SecurityType.Future, ExpectedFee = 11.02m },\n                new { Symbol = Futures.Currencies.ETH, Type = SecurityType.Future, ExpectedFee = 7.02m },\n                new { Symbol = Futures.Currencies.MicroBTC, Type = SecurityType.Future, ExpectedFee = 4.77m },\n                new { Symbol = Futures.Currencies.BTICMicroBTC, Type = SecurityType.Future, ExpectedFee = 4.77m },\n                new { Symbol = Futures.Currencies.MicroEther, Type = SecurityType.Future, ExpectedFee = 0.42m },\n                new { Symbol = Futures.Currencies.BTICMicroEther, Type = SecurityType.Future, ExpectedFee = 0.42m },\n                // Cryptocurrency future options\n                new { Symbol = Futures.Currencies.BTC, Type = SecurityType.FutureOption, ExpectedFee = 10.02m },\n                new { Symbol = Futures.Currencies.ETH, Type = SecurityType.FutureOption, ExpectedFee = 7.02m },\n                new { Symbol = Futures.Currencies.MicroBTC, Type = SecurityType.FutureOption, ExpectedFee = 3.77m },\n                new { Symbol = Futures.Currencies.BTICMicroBTC, Type = SecurityType.FutureOption, ExpectedFee = 3.77m },\n                new { Symbol = Futures.Currencies.MicroEther, Type = SecurityType.FutureOption, ExpectedFee = 0.32m },\n                new { Symbol = Futures.Currencies.BTICMicroEther, Type = SecurityType.FutureOption, ExpectedFee = 0.32m },\n                // E-mini FX (currencies) Futures\n                new { Symbol = Futures.Currencies.EuroFXEmini, Type = SecurityType.Future, ExpectedFee = 1.37m },\n                new { Symbol = Futures.Currencies.JapaneseYenEmini, Type = SecurityType.Future, ExpectedFee = 1.37m },\n                // Micro E-mini FX (currencies) Futures\n                new { Symbol = Futures.Currencies.MicroAUD, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroEUR, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroGBP, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroCADUSD, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroJPY, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroCHF, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroUSDJPY, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroINRUSD, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroCAD, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroUSDCHF, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                new { Symbol = Futures.Currencies.MicroUSDCNH, Type = SecurityType.Future, ExpectedFee = 0.41m },\n                // Other futures\n                new { Symbol = Futures.Metals.MicroGoldTAS, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Metals.MicroPalladium, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroGasoilZeroPointOnePercentBargesFOBARAPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroCoalAPIFivefobNewcastleArgusMcCloskey, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroSingaporeFuelOil380CSTPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.USD, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.CAD, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.EUR, Type = SecurityType.Future, ExpectedFee = 2.47m },\n                // Other future options\n                new { Symbol = Futures.Metals.MicroGoldTAS, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Metals.MicroPalladium, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroGasoilZeroPointOnePercentBargesFOBARAPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanThreePointFivePercentFuelOilCargoesFOBMedPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroCoalAPIFivefobNewcastleArgusMcCloskey, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroSingaporeFuelOil380CSTPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Energy.MicroSingaporeFOBMarineFuelZeroPointFivePercetPlatts, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.USD, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.CAD, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n                new { Symbol = Futures.Currencies.EUR, Type = SecurityType.FutureOption, ExpectedFee = 2.47m },\n            }.Select(x =>\n            {\n                var symbol = Symbols.CreateFutureSymbol(x.Symbol, SecurityIdentifier.DefaultDate);\n                if (x.Type == SecurityType.FutureOption)\n                {\n                    symbol = Symbols.CreateFutureOptionSymbol(symbol, OptionRight.Call, 0m, SecurityIdentifier.DefaultDate);\n                }\n\n                return new TestCaseData(symbol, x.ExpectedFee);\n            }).ToArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/OrderFeesTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    public class OrderFeesTests\n    {\n        [Test]\n        public void OrderFeeZeroCanBeConvertedToAccountCurrency()\n        {\n            var book = new CashBook();\n\n            var result = book.ConvertToAccountCurrency(OrderFee.Zero.Value);\n\n            Assert.AreEqual(0, result.Amount);\n            Assert.AreEqual(book.AccountCurrency, result.Currency);\n\n            var result2 = book.ConvertToAccountCurrency(OrderFee.Zero.Value.Amount,\n                OrderFee.Zero.Value.Currency);\n\n            Assert.AreEqual(0, result2);\n\n            var result3 = book.Convert(OrderFee.Zero.Value.Amount,\n                OrderFee.Zero.Value.Currency,\n                book.AccountCurrency);\n\n            Assert.AreEqual(0, result3);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fees/SamcoFeeModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Orders.Fees\n{\n    [TestFixture]\n    internal class SamcoFeeModelTests\n    {\n        private Equity _sbininr;\n        private readonly IFeeModel _feeModel = new SamcoFeeModel();\n\n        [SetUp]\n        public void Initialize()\n        {\n            var quoteCurrency = new Cash(Currencies.INR, 0, 1);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.India, Symbols.SBIN, SecurityType.Equity);\n            _sbininr = new Equity(\n                Symbols.SBIN,\n                exchangeHours,\n                quoteCurrency,\n                SymbolProperties.GetDefault(Currencies.INR),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            _sbininr.SetMarketPrice(new TradeBar(DateTime.Now, Symbols.SBIN, 100m, 100m, 100m, 100m, 1));\n        }\n\n        [Test]\n        public void ReturnsFeeInQuoteCurrencyInAccountCurrency()\n        {\n            var fee = _feeModel.GetOrderFee(\n                new OrderFeeParameters(\n                    _sbininr,\n                    new MarketOrder(_sbininr.Symbol, 1, DateTime.Now)\n                )\n            );\n\n            Assert.AreEqual(Currencies.INR, fee.Value.Currency);\n            Assert.AreEqual(0.02m, fee.Value.Amount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/BackwardsCompatibilityFillModelsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public class BackwardsCompatibilityFillModelsTests\n    {\n        private SubscriptionDataConfig _config;\n        private Security _security;\n        private static OrderEvent orderEvent;\n        private static DateTime orderDateTime;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _config = SecurityTests.CreateTradeBarConfig();\n            _security = SecurityTests.GetSecurity();\n            orderDateTime = new DateTime(2017, 2, 2, 13, 0, 0);\n            orderEvent = new OrderEvent(\n                99,\n                _security.Symbol,\n                orderDateTime,\n                OrderStatus.Submitted,\n                OrderDirection.Buy,\n                1,\n                1,\n                new OrderFee(new CashAmount(1, Currencies.USD))\n            );\n            var reference = DateTime.Now;\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            _security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n        }\n\n        #region InheritImmediateFillModel\n\n        [Test]\n        public void InheritImmediateFillModel_MarketFill()\n        {\n            var model = new TestFillModelInheritImmediateFillModel();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.MarketFillWasCalled);\n            Assert.AreEqual(OrderStatus.Filled, result.Status);\n        }\n\n        #endregion\n\n        #region OldFillInterfaceModelTests\n\n        [Test]\n        public void OldInterface_MarketFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.MarketFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        [Test]\n        public void OldInterface_StopMarketFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new StopMarketOrder(_security.Symbol, 1, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.StopMarketFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        [Test]\n        public void OldInterface_StopLimitFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new StopLimitOrder(_security.Symbol, 1, 1, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.StopLimitFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        [Test]\n        public void OldInterface_LimitFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new LimitOrder(_security.Symbol, 1, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.LimitFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        [Test]\n        public void OldInterface_MarketOnOpenFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOnOpenOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.MarketOnOpenFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        [Test]\n        public void OldInterface_MarketOnCloseFill()\n        {\n            var model = new TestFillModelInheritInterface();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOnCloseOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.MarketOnCloseFillWasCalled);\n            Assert.AreEqual(orderEvent, result);\n        }\n\n        #endregion\n\n        #region OldBaseFillModelTests\n\n        [Test]\n        public void OldBaseFillModel_DoesNotOverride_MarketFill()\n        {\n            var model = new TestFillModelInheritBaseClassDoesNotOverride();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.IsNotNull(result);\n            Assert.True(model.GetPricesWasCalled);\n            Assert.AreEqual(12345, result.FillPrice);\n        }\n\n        [Test]\n        public void OldBaseFillModel_MarketFill()\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.MarketFillWasCalled);\n            Assert.IsNotNull(result);\n            Assert.True(model.GetPricesWasCalled);\n            Assert.AreEqual(12345, result.FillPrice);\n        }\n\n        [Test]\n        public void OldBaseFillModel_StopMarketFill()\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new StopMarketOrder(_security.Symbol, 1, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.StopMarketFillWasCalled);\n            Assert.IsNotNull(result);\n            Assert.True(model.GetPricesWasCalled);\n            Assert.AreEqual(12345, result.FillPrice);\n        }\n\n        [Test]\n        public void OldBaseFillModel_StopLimitFill()\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new StopLimitOrder(_security.Symbol, 1, 12344, 12346, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.StopLimitFillWasCalled);\n            Assert.IsNotNull(result);\n            Assert.True(model.GetPricesWasCalled);\n            Assert.AreEqual(12345, result.FillPrice);\n        }\n\n        [Test]\n        public void OldBaseFillModel_LimitFill()\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var result = model.Fill(\n                new FillModelParameters(_security,\n                    new LimitOrder(_security.Symbol, 1, 12346, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null)).Single();\n\n            Assert.True(model.LimitFillWasCalled);\n            Assert.IsNotNull(result);\n            Assert.True(model.GetPricesWasCalled);\n            Assert.AreEqual(12345, result.FillPrice);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void OldBaseFillModel_MarketOnOpenFill(bool isMarketAlwaysOpen)\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var security = SecurityTests.GetSecurity(isMarketAlwaysOpen);\n            var reference = new DateTime(2022, 4, 5, 10, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new Tick(orderDateTime, security.Symbol, 88, 88) { TickType = TickType.Trade });\n\n            var args = new FillModelParameters(security, new MarketOnOpenOrder(security.Symbol, 1, orderDateTime),\n                new MockSubscriptionDataConfigProvider(_config), Time.OneHour, null);\n            if (isMarketAlwaysOpen)\n            {\n                Assert.Throws<InvalidOperationException>(() => model.Fill(args));\n            }\n            else\n            {\n                var result = model.Fill(args).Single();\n\n                Assert.True(model.MarketOnOpenFillWasCalled);\n                Assert.IsNotNull(result);\n                Assert.True(model.GetPricesWasCalled);\n                Assert.AreEqual(12345, result.FillPrice);\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void OldBaseFillModel_MarketOnCloseFill(bool isMarketAlwaysOpen)\n        {\n            var model = new TestFillModelInheritBaseClass();\n            var security = SecurityTests.GetSecurity(isMarketAlwaysOpen);\n            var reference = new DateTime(2022, 4, 5, 10, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var args = new FillModelParameters(security, new MarketOnCloseOrder(security.Symbol, 1, orderDateTime),\n                new MockSubscriptionDataConfigProvider(_config), Time.OneHour, null);\n            if (isMarketAlwaysOpen)\n            {\n                Assert.Throws<InvalidOperationException>(() => model.Fill(args));\n            }\n            else\n            {\n                var result = model.Fill(args).Single();\n\n                Assert.True(model.MarketOnCloseFillWasCalled);\n                Assert.IsNotNull(result);\n                Assert.True(model.GetPricesWasCalled);\n                Assert.AreEqual(12345, result.FillPrice);\n            }\n        }\n\n        #endregion\n\n        #region Python\n\n        [Test]\n        public void OldImmediateFillModelModel_MarketFill_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(ImmediateFillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.MarketFillWasCalled = False\\n\" +\n                    \"   def MarketFill(self, asset, order):\\n\" +\n                    \"       self.MarketFillWasCalled = True\\n\" +\n                    \"       return super().MarketFill(asset, order)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                        _security,\n                        new MarketOrder(_security.Symbol, 1, orderDateTime),\n                        new MockSubscriptionDataConfigProvider(_config),\n                        Time.OneHour,\n                        null\n                    )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"MarketFillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        [Test]\n        public void OldBaseFillModel_MarketFill_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(FillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.MarketFillWasCalled = False\\n\" +\n                    \"   def MarketFill(self, asset, order):\\n\" +\n                    \"       self.MarketFillWasCalled = True\\n\" +\n                    \"       return super().MarketFill(asset, order)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null\n                )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"MarketFillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        [Test]\n        public void NewFillContext_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(FillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.FillWasCalled = False\\n\" +\n                    \"   def Fill(self, parameters):\\n\" +\n                    \"       self.FillWasCalled = True\\n\" +\n                    \"       return super().Fill(parameters)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null\n                )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"FillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        [Test]\n        public void OldFillModel_NewFillContextAndMarketFill_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(FillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.FillWasCalled = False\\n\" +\n                    \"       self.MarketFillWasCalled = False\\n\" +\n                    \"   def Fill(self, parameters):\\n\" +\n                    \"       self.FillWasCalled = True\\n\" +\n                    \"       self.Parameters = parameters\\n\" +\n                    \"       return Fill(self.MarketFill(parameters.Security, parameters.Order))\\n\" +\n                    \"   def MarketFill(self, asset, order):\\n\" +\n                    \"       self.MarketFillWasCalled = True\\n\" +\n                    \"       return super().MarketFill(asset, order)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null\n                )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"FillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                customFillModel.GetAttr(\"MarketFillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        [Test]\n        public void OldFillModel_NewFillContextAndGetPrices_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(FillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.FillWasCalled = False\\n\" +\n                    \"       self.GetPricesWasCalled = False\\n\" +\n                    \"   def Fill(self, parameters):\\n\" +\n                    \"       self.FillWasCalled = True\\n\" +\n                    \"       self.Parameters = parameters\\n\" +\n                    \"       return Fill(super().MarketFill(parameters.Security, parameters.Order))\\n\" +\n                    \"   def GetPrices(self, asset, direction):\\n\" +\n                    \"       self.GetPricesWasCalled = True\\n\" +\n                    \"       return super().GetPrices(asset, direction)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null\n                )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"FillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                customFillModel.GetAttr(\"GetPricesWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        [Test]\n        public void OldImmediateFillModel_MarketFill_Py()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomFillModel(ImmediateFillModel):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.MarketFillWasCalled = False\\n\" +\n                    \"   def MarketFill(self, asset, order):\\n\" +\n                    \"       self.MarketFillWasCalled = True\\n\" +\n                    \"       return super().MarketFill(asset, order)\");\n\n                var customFillModel = module.GetAttr(\"CustomFillModel\").Invoke();\n                var wrapper = new FillModelPythonWrapper(customFillModel);\n\n                var result = wrapper.Fill(new FillModelParameters(\n                    _security,\n                    new MarketOrder(_security.Symbol, 1, orderDateTime),\n                    new MockSubscriptionDataConfigProvider(_config),\n                    Time.OneHour,\n                    null\n                )).Single();\n\n                bool called;\n                customFillModel.GetAttr(\"MarketFillWasCalled\").TryConvert(out called);\n                Assert.True(called);\n                Assert.IsNotNull(result);\n                Assert.AreEqual(OrderStatus.Filled, result.Status);\n            }\n        }\n\n        #endregion\n\n        private class TestFillModelInheritInterface : IFillModel\n        {\n            public bool MarketFillWasCalled;\n            public bool StopMarketFillWasCalled;\n            public bool StopLimitFillWasCalled;\n            public bool LimitFillWasCalled;\n            public bool MarketOnOpenFillWasCalled;\n            public bool MarketOnCloseFillWasCalled;\n\n            public OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                MarketFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n            {\n                StopMarketFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public OrderEvent StopLimitFill(Security asset, StopLimitOrder order)\n            {\n                StopLimitFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public OrderEvent LimitFill(Security asset, LimitOrder order)\n            {\n                LimitFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public OrderEvent MarketOnOpenFill(Security asset, MarketOnOpenOrder order)\n            {\n                MarketOnOpenFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public OrderEvent MarketOnCloseFill(Security asset, MarketOnCloseOrder order)\n            {\n                MarketOnCloseFillWasCalled = true;\n                return orderEvent;\n            }\n\n            public Fill Fill(FillModelParameters parameters)\n            {\n                var order = parameters.Order;\n                OrderEvent orderEvent;\n                switch (order.Type)\n                {\n                    case OrderType.Market:\n                        orderEvent =\n                            MarketFill(parameters.Security, parameters.Order as MarketOrder);\n                        break;\n                    case OrderType.Limit:\n                        orderEvent =\n                            LimitFill(parameters.Security, parameters.Order as LimitOrder);\n                        break;\n                    case OrderType.StopMarket:\n                        orderEvent =\n                            StopMarketFill(parameters.Security, parameters.Order as StopMarketOrder);\n                        break;\n                    case OrderType.StopLimit:\n                        orderEvent =\n                            StopLimitFill(parameters.Security, parameters.Order as StopLimitOrder);\n                        break;\n                    case OrderType.MarketOnOpen:\n                        orderEvent =\n                            MarketOnOpenFill(parameters.Security, parameters.Order as MarketOnOpenOrder);\n                        break;\n                    case OrderType.MarketOnClose:\n                        orderEvent =\n                            MarketOnCloseFill(parameters.Security, parameters.Order as MarketOnCloseOrder);\n                        break;\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n                return new Fill(orderEvent);\n            }\n        }\n\n        private class TestFillModelInheritBaseClass : FillModel\n        {\n            public bool MarketFillWasCalled;\n            public bool StopMarketFillWasCalled;\n            public bool StopLimitFillWasCalled;\n            public bool LimitIfTouchFillWasCalled;\n            public bool LimitFillWasCalled;\n            public bool MarketOnOpenFillWasCalled;\n            public bool MarketOnCloseFillWasCalled;\n            public bool GetPricesWasCalled;\n\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                MarketFillWasCalled = true;\n                return base.MarketFill(asset, order);\n            }\n\n            public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order)\n            {\n                StopMarketFillWasCalled = true;\n                return base.StopMarketFill(asset, order);\n            }\n\n            public override OrderEvent StopLimitFill(Security asset, StopLimitOrder order)\n            {\n                StopLimitFillWasCalled = true;\n                return base.StopLimitFill(asset, order);\n            }\n            public override OrderEvent LimitIfTouchedFill(Security asset, LimitIfTouchedOrder order)\n            {\n                LimitIfTouchFillWasCalled = true;\n                return base.LimitIfTouchedFill(asset, order);\n            }\n\n            public override OrderEvent LimitFill(Security asset, LimitOrder order)\n            {\n                LimitFillWasCalled = true;\n                return base.LimitFill(asset, order);\n            }\n\n            public override OrderEvent MarketOnOpenFill(Security asset, MarketOnOpenOrder order)\n            {\n                MarketOnOpenFillWasCalled = true;\n                return base.MarketOnOpenFill(asset, order);\n            }\n\n            public override OrderEvent MarketOnCloseFill(Security asset, MarketOnCloseOrder order)\n            {\n                MarketOnCloseFillWasCalled = true;\n                return base.MarketOnCloseFill(asset, order);\n            }\n\n            protected override Prices GetPrices(Security asset, OrderDirection direction)\n            {\n                GetPricesWasCalled = true;\n                return new Prices(orderDateTime, 12345, 12345, 12345, 12345, 12345);\n            }\n        }\n\n        private class TestFillModelInheritBaseClassDoesNotOverride : FillModel\n        {\n            public bool GetPricesWasCalled;\n\n            protected override Prices GetPrices(Security asset, OrderDirection direction)\n            {\n                GetPricesWasCalled = true;\n                // call base.GetPrices() just to test it show its possible\n                base.GetPrices(asset, direction);\n                return new Prices(orderDateTime, 12345, 12345, 12345, 12345, 12345);\n            }\n        }\n\n        private class TestFillModelInheritImmediateFillModel : ImmediateFillModel\n        {\n            public bool MarketFillWasCalled;\n\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                MarketFillWasCalled = true;\n                return base.MarketFill(asset, order);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/EquityFillModelTests.LimitFill.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public partial class EquityFillModelTests\n    {\n        [Test]\n        public void PerformsLimitFillBuy()\n        {\n            var model = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, 100, 101.5m, Noon);\n\n            var parameters = GetFillModelParameters(order);\n\n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 102m, 102m, 102m, 100));\n\n            var fill = model.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            equity.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 101m, 102.3m, 100));\n\n            fill = model.LimitFill(equity, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsLimitFillSell()\n        {\n            var model = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, -100, 101.5m, Noon);\n\n            var parameters = GetFillModelParameters(order);\n\n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 101m, 101m, 101m, 100));\n\n            var fill = model.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            equity.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 103m, 101m, 102.3m, 100));\n\n            fill = model.LimitFill(equity, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void PerformsLimitFillWithTickTradeData(decimal orderQuantity, decimal limitPrice)\n        {\n            var fillModel = new EquityFillModel();\n\n            var configTick = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(configTick);\n\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with this price\n            var tradeTick = new Tick { TickType = TickType.Trade, Time = time, Value = 291m };\n            equity.SetMarketPrice(tradeTick);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(configTick),\n                Time.OneHour,\n                null)).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // Create a series of price where the last value will not fill\n            // and the fill model need to use the minimum/maximum instead\n            var trades = new[] { 0m, -0.1m, 0m, 0.1m, 0m }\n                .Select(delta => new Tick \n                    { \n                        TickType = TickType.Trade,\n                        Time = time, \n                        Value = limitPrice - delta * Math.Sign(orderQuantity)\n                    })\n                .ToList();\n\n            equity.Update(trades, typeof(Tick));\n\n            fill = fillModel.LimitFill(equity, order);\n\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void LimitOrderDoesNotFillUsingQuoteBar(decimal orderQuantity, decimal limitPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n            \n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with these prices\n            var tradeBar = new TradeBar(time.AddMinutes(-10), Symbols.SPY, 291m, 291m, 291m, 291m, 12345);\n            equity.SetMarketPrice(tradeBar);\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            \n            var quoteBar = new QuoteBar(time, Symbols.SPY, \n                new Bar(290m, 292m, 289m, 291m), 12345,\n                new Bar(290m, 292m, 289m, 291m), 12345);\n            equity.SetMarketPrice(quoteBar);\n\n            fill = fillModel.LimitFill(equity, order);\n\n            // Limit orders don't fill with QuoteBar:\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void LimitOrderDoesNotFillUsingTickTypeQuote(decimal orderQuantity, decimal limitPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var configTick = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(configTick);\n\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with this price\n            var tradeTick = new Tick { TickType = TickType.Trade, Time = time, Value = 291m };\n            equity.SetMarketPrice(tradeTick);\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(configTick),\n                Time.OneHour,\n                null)).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var price = limitPrice - 0.1m * Math.Sign(orderQuantity);\n            var quoteTick = new Tick { TickType = TickType.Quote, Time = time, BidPrice = price, AskPrice = price };\n            equity.SetMarketPrice(quoteTick);\n            \n            fill = fillModel.LimitFill(equity, order);\n\n            // Limit orders don't fill with TickType.Quote:\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void LimitOrderFillsAtLimitPriceWithFavorableGap(decimal orderQuantity, decimal limitPrice)\n        {\n            // See https://github.com/QuantConnect/Lean/issues/963\n\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n\n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with these prices\n            equity.SetMarketPrice(new TradeBar(time.AddMinutes(-10), Symbols.SPY, 291m, 291m, 291m, 291m, 12345));\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var tradeBar = Math.Sign(orderQuantity) switch\n            { \n                1 => new TradeBar(time, Symbols.SPY, limitPrice + 1, limitPrice + 1, limitPrice - 2, limitPrice + 1, 12345),\n                -1 => new TradeBar(time, Symbols.SPY, limitPrice - 1, limitPrice + 2, limitPrice - 1, limitPrice - 1, 12345),\n            };\n\n            equity.SetMarketPrice(tradeBar);\n\n            fill = fillModel.LimitFill(equity, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void LimitOrderFillsAtOpenWithFavorableGap(decimal orderQuantity, decimal limitPrice)\n        {\n            // See https://github.com/QuantConnect/Lean/issues/7052\n\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n\n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with these prices\n            equity.SetMarketPrice(new TradeBar(time.AddMinutes(-10), Symbols.SPY, 291m, 291m, 291m, 291m, 12345));\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // The Gap TradeBar has all prices below/above the limit price\n            var open = limitPrice - Math.Sign(orderQuantity);\n            var gapTradeBar = Math.Sign(orderQuantity) switch\n            {\n                1 => new TradeBar(time, Symbols.SPY, open, limitPrice - 1, limitPrice - 2, limitPrice - 1, 12345),\n                -1 => new TradeBar(time, Symbols.SPY, open, limitPrice + 2, limitPrice + 1, limitPrice + 1, 12345),\n            };\n\n            equity.SetMarketPrice(gapTradeBar);\n\n            fill = fillModel.LimitFill(equity, order);\n\n            // This fills at the open since all prices are below/above the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreNotEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(open, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void LimitOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal limitPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new LimitOrder(Symbols.SPY, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n            var equity = parameters.Security;\n\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time.AddMinutes(-10), Symbols.SPY, 290m, 292m, 289m, 291m, 12345);\n            equity.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            equity.SetMarketPrice(fillForwardBar);\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, Symbols.SPY, 291m, 292m, 289m, 291m, 12345);\n            equity.SetMarketPrice(tradeBar);\n\n            fill = fillModel.LimitFill(equity, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/EquityFillModelTests.StopMarketFill.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public partial class EquityFillModelTests\n    {\n        [Test]\n        public void PerformsStopMarketFillBuy()\n        {\n            var model = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, 100, 101.5m, Noon);\n\n            var parameters = GetFillModelParameters(order);\n\n            var security = parameters.Security;\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 101m, 101m, 101m, 100));\n\n            var fill = model.Fill(parameters).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 102.5m, 101m, 102m, 100));\n\n            fill = model.StopMarketFill(security, order);\n\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.StopPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsStopMarketFillSell()\n        {\n            var model = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, -100, 101.5m, Noon);\n\n            var parameters = GetFillModelParameters(order);\n\n            var security = parameters.Security;\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 102m, 102m, 102m, 100));\n\n            var fill = model.Fill(parameters).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 102.5m, 101m, 101.5m, 100));\n\n            fill = model.StopMarketFill(security, order);\n\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.StopPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void PerformsStopMarketFillWithTickTradeData(decimal orderQuantity, decimal stopPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var configTick = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(configTick);\n\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with this price\n            var tradeTick = new Tick { TickType = TickType.Trade, Time = time, Value = 291m };\n            equity.SetMarketPrice(tradeTick);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(configTick),\n                Time.OneHour,\n                null)).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // Create a series of price where the last value will not fill\n            // and the fill model need to use the minimum/maximum instead\n            var trades = new[] { 0.1m, -0.1m, 0m, 0.1m, 0m }\n                .Select(delta => new Tick \n                    { \n                        TickType = TickType.Trade,\n                        Time = time, \n                        Value = stopPrice - delta * Math.Sign(orderQuantity)\n                    })\n                .ToList();\n\n            equity.Update(trades, typeof(Tick));\n\n            fill = fillModel.StopMarketFill(equity, order);\n\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            // Fill at the stop price because the equity price matches it\n            Assert.AreEqual(stopPrice, fill.FillPrice);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void StopMarketOrderDoesNotFillUsingQuoteBar(decimal orderQuantity, decimal stopPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n\n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with these prices\n            var tradeBar = new TradeBar(time.AddMinutes(-10), Symbols.SPY, 291m, 291m, 291m, 291m, 12345);\n            equity.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            \n            var quoteBar = new QuoteBar(time, Symbols.SPY, \n                new Bar(290m, 292m, 289m, 291m), 12345,\n                new Bar(290m, 292m, 289m, 291m), 12345);\n            equity.SetMarketPrice(quoteBar);\n\n            fill = fillModel.StopMarketFill(equity, order);\n\n            // Stop market orders don't fill with QuoteBar:\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void StopMarketOrderDoesNotFillUsingTickTypeQuote(decimal orderQuantity, decimal stopPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var configTick = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(configTick);\n\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with this price\n            var tradeTick = new Tick { TickType = TickType.Trade, Time = time, Value = 291m };\n            equity.SetMarketPrice(tradeTick);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(configTick),\n                Time.OneHour,\n                null)).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var price = stopPrice - 0.1m * Math.Sign(orderQuantity);\n            var quoteTick = new Tick { TickType = TickType.Quote, Time = time, BidPrice = price, AskPrice = price };\n            equity.SetMarketPrice(quoteTick);\n            \n            fill = fillModel.StopMarketFill(equity, order);\n\n            // Stop market orders don't fill with TickType.Quote:\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n        }\n\n        [TestCase(100, 290.50)]\n        [TestCase(-100, 291.50)]\n        public void StopMarketOrderFillsAtOpenWithUnfavourableGap(decimal orderQuantity, decimal stopPrice)\n        {\n            // See https://github.com/QuantConnect/Lean/issues/4545\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n            \n            var equity = parameters.Security;\n            equity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The order will not fill with these prices\n            equity.SetMarketPrice(new TradeBar(time.AddMinutes(-10), Symbols.SPY, 291m, 291m, 291m, 291m, 12345));\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            // Do not fill on stale data\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(2);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // The Gap TradeBar has all prices below/above the stop price \n            var gapTradeBar = Math.Sign(orderQuantity) switch\n            { \n                1 => new TradeBar(time, Symbols.SPY, stopPrice + 1, stopPrice + 2, stopPrice + 1, stopPrice + 1, 12345),\n                -1 => new TradeBar(time, Symbols.SPY, stopPrice - 1, stopPrice - 1, stopPrice - 2, stopPrice - 1, 12345),\n            };\n\n            equity.SetMarketPrice(gapTradeBar);\n\n            fill = fillModel.StopMarketFill(equity, order);\n\n            // Fills at the open\n            Assert.AreEqual(gapTradeBar.Open, fill.FillPrice);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n        \n        [TestCase(100, 291.50)]\n        [TestCase(-100, 290.50)]\n        public void StopMarketOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal stopPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var parameters = GetFillModelParameters(order);\n\n            var security = parameters.Security;\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time.AddMinutes(-10), Symbols.SPY, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fill = fillModel.Fill(parameters).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, Symbols.SPY, stopPrice - 0.01m * Math.Sign(orderQuantity), 292m, 289m, stopPrice, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.StopMarketFill(security, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(stopPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/EquityFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Tests.Common.Data;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Securities.Equity;\nusing System.Linq;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public partial class EquityFillModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n        private TimeKeeper TimeKeeper;\n\n        [SetUp]\n        public void Setup()\n        {\n            TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n        }\n\n        [TestCase(11, 11, 11, \"\")]\n        [TestCase(12, 11, 11, \"\")]\n        [TestCase(12, 10, 11, \"Warning: No quote information\")]\n        [TestCase(12, 10, 10, \"Warning: fill at stale price\")]\n        public void PerformsMarketFillBuy(int orderHour, int quoteBarHour, int tradeBarHour, string message)\n        {\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n            var equity = CreateEquity(configTradeBar);\n\n            var orderTime = new DateTime(2014, 6, 24, orderHour, 0, 0).ConvertToUtc(equity.Exchange.TimeZone);\n            var quoteBarTime = new DateTime(2014, 6, 24, quoteBarHour, 0, 0).AddMinutes(-1);\n            var tradeBarTime = new DateTime(2014, 6, 24, tradeBarHour, 0, 0).AddMinutes(-1);\n\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOrder(Symbols.SPY, 100, orderTime);\n\n            var parameters = new FillModelParameters(equity, order, configProvider, Time.OneHour, null);\n\n            // Sets price at time zero\n            equity.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            equity.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n\n            // IndicatorDataPoint is not market data\n            Assert.Throws<InvalidOperationException>(() => model.Fill(parameters),\n                $\"Cannot get ask price to perform fill for {equity.Symbol} because no market data subscription were found.\");\n\n            const decimal close = 101.234m;\n            var bidBar = new Bar(101.123m, 101.123m, 101.123m, 101.123m);\n            var askBar = new Bar(101.234m, 101.234m, 101.234m, close);\n            var tradeBar = new TradeBar(tradeBarTime, Symbols.SPY, 101.123m, 101.123m, 101.123m, close, 100);\n            equity.SetMarketPrice(new QuoteBar(quoteBarTime, Symbols.SPY, bidBar, 0, askBar, 0));\n            equity.SetMarketPrice(tradeBar);\n\n            var fill = model.Fill(parameters).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(close, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.IsTrue(fill.Message.StartsWith(message, StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [TestCase(11, 11, 11, \"\")]\n        [TestCase(12, 11, 11, \"\")]\n        [TestCase(12, 10, 11, \"Warning: No quote information\")]\n        [TestCase(12, 10, 10, \"Warning: fill at stale price\")]\n        public void PerformsMarketFillSell(int orderHour, int quoteBarHour, int tradeBarHour, string message)\n        {\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n            var equity = CreateEquity(configTradeBar);\n\n            var orderTime = new DateTime(2014, 6, 24, orderHour, 0, 0).ConvertToUtc(equity.Exchange.TimeZone);\n            var quoteBarTime = new DateTime(2014, 6, 24, quoteBarHour, 0, 0).AddMinutes(-1);\n            var tradeBarTime = new DateTime(2014, 6, 24, tradeBarHour, 0, 0).AddMinutes(-1);\n\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOrder(Symbols.SPY, -100, orderTime);\n\n            var parameters = new FillModelParameters(equity, order, configProvider, Time.OneHour, null);\n\n            // Sets price at time zero\n            equity.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            equity.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n\n            // IndicatorDataPoint is not market data\n            Assert.Throws<InvalidOperationException>(() => model.Fill(parameters),\n                $\"Cannot get bid price to perform fill for {equity.Symbol} because no market data subscription were found.\");\n\n            const decimal close = 101.123m;\n            var bidBar = new Bar(101.123m, 101.123m, 101.123m, close);\n            var askBar = new Bar(101.234m, 101.234m, 101.234m, 101.234m);\n            var tradeBar = new TradeBar(tradeBarTime, Symbols.SPY, 101.234m, 101.234m, 101.234m, close, 100);\n            equity.SetMarketPrice(new QuoteBar(quoteBarTime, Symbols.SPY, bidBar, 0, askBar, 0));\n            equity.SetMarketPrice(tradeBar);\n\n            var fill = model.Fill(parameters).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(close, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.IsTrue(fill.Message.StartsWith(message, StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [Test]\n        public void PerformsStopLimitFillBuy()\n        {\n            var model = new EquityFillModel();\n            var order = new StopLimitOrder(Symbols.SPY, 100, 101.5m, 101.75m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 100m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.66m));\n\n            fill = model.StopLimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.High, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsStopLimitFillSell()\n        {\n            var model = new EquityFillModel();\n            var order = new StopLimitOrder(Symbols.SPY, -100, 101.75m, 101.50m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.66m));\n\n            fill = model.StopLimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Low, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsLimitIfTouchedSell()\n        {\n            var model = new EquityFillModel();\n            var order = new LimitIfTouchedOrder(Symbols.SPY, -100, 101.5m, 105m, Noon);\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                configTradeBar,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            // Sets price at time zero\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 100m, 100m, 90m, 90m, 100));\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => trigger touched but not limit\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 102m, 102m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                new Bar(101m, 102m, 100m, 100m), 100, // Bid bar\n                new Bar(103m, 104m, 102m, 102m), 100) // Ask bar\n            );\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => limit reached, security bought\n            // |---> First, ensure that price data are not used to fill\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 100m, 100m, 99m, 99m, 100));\n            fill = model.LimitIfTouchedFill(security, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // |---> Lastly, ensure that quote data used to fill\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                    new Bar(105m, 105m, 105m, 105m), 100, // Bid bar\n                    new Bar(105m, 105m, 105m, 105m), 100) // Ask bar\n            );\n            fill = model.LimitIfTouchedFill(security, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsLimitIfTouchedBuy()\n        {\n            var model = new EquityFillModel();\n            var order = new LimitIfTouchedOrder(Symbols.SPY, 100, 101.5m, 100m, Noon);\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                configTradeBar,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            // Sets price at time zero\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 102m, 102m, 102m, 100));\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => trigger touched but not limit\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 101m, 100.5m, 101m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                new Bar(101m, 101m, 100.5m, 101m), 100, // Bid bar\n                new Bar(101m, 101m, 100.5m, 101m), 100) // Ask bar\n            );\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => limit reached, security bought\n            // |---> First, ensure that price data are not used to fill\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 100m, 100m, 99m, 99m, 100));\n            fill = model.LimitIfTouchedFill(security, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // |---> Lastly, ensure that quote data used to fill\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                    new Bar(100m, 100m, 100m, 100m), 100, // Bid bar\n                    new Bar(100m, 100m, 100m, 100m), 100) // Ask bar\n            );\n            fill = model.LimitIfTouchedFill(security, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnOpenUsingOpenPriceWithMinuteSubscription(int quantity)\n        {\n            var reference = new DateTime(2015, 06, 05, 9, 0, 0); // before market open\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY);\n            var equity = CreateEquity(configTradeBar);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnOpenOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1m, 2m, 0.5m, 1.33m, 100));\n\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market opens after 30min, so this is just before market open\n            time = reference.AddMinutes(29);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1.33m, 2.75m, 1.15m, 1.45m, 100));\n\n            fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal expected = 1.45m;\n            // market opens after 30min\n            time = reference.AddMinutes(30);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // Does not fill with quote data\n            equity.SetMarketPrice(new QuoteBar(time, Symbols.SPY,\n                new Bar(1.45m, 1.99m, 1.09m, 1.39m), 100,\n                new Bar(1.46m, 2.01m, 1.11m, 1.41m), 100));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // Fill with trade bar\n            equity.SetMarketPrice(new TradeBar(time, Symbols.SPY, expected, 2.0m, 1.1m, 1.40m, 100));\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnOpenUsingOpenPriceWithDailySubscription(int quantity)\n        {\n            Func<DateTime, decimal, TradeBar> getTradeBar = (t, o) => new TradeBar(t.RoundDown(Time.OneDay),\n                Symbols.SPY, o, 2m, 0.5m, 1.33m, 100, Time.OneDay);\n\n            var reference = new DateTime(2015, 06, 05, 12, 0, 0); // market is open\n            var config = CreateTradeBarConfig(Symbols.SPY, Resolution.Daily);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnOpenOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(getTradeBar(time, 2m));\n\n            // Will not fill because the order was placed before the bar is closed\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // It will not fill in the next morning because needs to wait for day to close\n            const decimal expected = 1m;\n            time = equity.Exchange.Hours.GetNextMarketOpen(time, false);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // Fill once the equity is updated with the day bar\n            equity.SetMarketPrice(getTradeBar(time, expected));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n        // Official open\n        [TestCase(-100, TradeConditionFlags.OfficialOpen)]\n        [TestCase(100, TradeConditionFlags.OfficialOpen)]\n        // Opening prints\n        [TestCase(-100, TradeConditionFlags.OpeningPrints)]\n        [TestCase(100, TradeConditionFlags.OpeningPrints)]\n        // Official open and regular\n        [TestCase(-100, TradeConditionFlags.OfficialOpen | TradeConditionFlags.Regular)]\n        [TestCase(100, TradeConditionFlags.OfficialOpen | TradeConditionFlags.Regular)]\n        // Opening prints and regular\n        [TestCase(-100, TradeConditionFlags.OpeningPrints | TradeConditionFlags.Regular)]\n        [TestCase(100, TradeConditionFlags.OpeningPrints | TradeConditionFlags.Regular)]\n        // Any other random combination of flags that include OfficialOpen\n        [TestCase(-100,\n            TradeConditionFlags.OfficialOpen | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100,\n            TradeConditionFlags.OfficialOpen | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        // Any other random combination of flags that include OpeningPrints\n        [TestCase(-100,\n            TradeConditionFlags.OpeningPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100,\n            TradeConditionFlags.OpeningPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        public void PerformsMarketOnOpenUsingOpenPriceWithTickSubscription(int quantity, long numericSaleCondition)\n        {\n            var reference = new DateTime(2015, 06, 05, 9, 0, 0); // before market open\n            var config = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnOpenOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var saleCondition = Convert.ToString(numericSaleCondition, 16);\n\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, 1m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market opens after 30min, so this is just before market open\n            time = reference.AddMinutes(29);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, 1m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal expected = 1m;\n            // market opens after 30min\n            time = reference.AddMinutes(30);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // The quote is received after the market is open, but the trade is not\n            equity.Update(new List<Tick>\n            {\n                new Tick(time.AddMinutes(-1), Symbols.SPY, saleCondition, \"P\", 100, expected),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // The trade is received after the market is open, but it is not have a official open flag\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, \"\", \"P\", 100, expected),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(\"No trade with the OfficialOpen or OpeningPrints flag within the 1-minute timeout.\", fill.Message);\n\n            // One quote and some trades with different conditions are received after the market is open,\n            // but there is trade prior to that with different price\n            equity.Update(new List<Tick>\n            {\n                new Tick(time.AddMinutes(-1), Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),   // Not Open\n                new Tick(time, Symbols.SPY, saleCondition, \"Q\", 100, 0.95m),            // Open but not primary exchange\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, expected),         // Fill with this tick\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.95m),   // Open but not primary exchange\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n\n        [TestCase(-100, 0.9)]\n        [TestCase(100, 1.1)]\n        public void PerformsMarketOnOpenUsingOpenPriceWithTickSubscriptionButNoSalesCondition(int quantity, decimal expected)\n        {\n            var reference = new DateTime(2015, 06, 05, 9, 0, 0); // before market open\n            var config = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnOpenOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // No Sales Condition\n            var saleCondition = \"\";\n\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, \"80000001\", \"P\", 100, 1m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal price = 1m;\n            // market opens after 30min. 1 minute after open to accept the last trade\n            time = reference.AddMinutes(32);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),   // Not Close\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, 0.95m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.95m),   // Open but not primary exchange\n                new Tick(time, Symbols.SPY, saleCondition, \"Q\", 100, price),         // Fill with this tick\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(price, fill.FillPrice);\n\n            // Test whether it fills on the bid/ask if there is no trade\n            equity.Cache.Reset();\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n            }, typeof(Tick));\n\n            fill = model.MarketOnOpenFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n            Assert.IsTrue(fill.Message.Contains(\"Fill with last Quote data.\", StringComparison.InvariantCulture));\n        }\n\n        [TestCase(Resolution.Minute, 3, 17, 0, 9, 29)]\n        [TestCase(Resolution.Minute, 4, 0, 0, 9, 29)]\n        [TestCase(Resolution.Minute, 4, 8, 0, 9, 29)]\n        [TestCase(Resolution.Minute, 4, 9, 30, 9, 29, true)]\n        [TestCase(Resolution.Minute, 4, 9, 30, 9, 31, true)]\n        [TestCase(Resolution.Hour, 3, 17, 0, 8, 29)]\n        [TestCase(Resolution.Hour, 4, 0, 0, 8, 0)]\n        [TestCase(Resolution.Hour, 4, 8, 0, 8, 0)]\n        [TestCase(Resolution.Hour, 4, 9, 30, 8, 0, true)]\n        [TestCase(Resolution.Hour, 4, 9, 30, 11, 0, true)]\n        [TestCase(Resolution.Daily, 3, 17, 0, 8, 0)]\n        [TestCase(Resolution.Daily, 4, 0, 0, 8, 0)]\n        [TestCase(Resolution.Daily, 4, 8, 0, 8, 0)]\n        [TestCase(Resolution.Daily, 4, 9, 30, 8, 0)]\n        public void PerformsMarketOnOpenUsingOpenPriceWithDifferentOrderSubmissionDateTime(Resolution resolution, int day, int hour, int minute, int ref_hour, int ref_minute, bool nextDay = false)\n        {\n            var period = resolution.ToTimeSpan();\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY, resolution);\n            var equity = CreateEquity(configTradeBar);\n            var model = (EquityFillModel)equity.FillModel;\n\n            var orderTime = new DateTime(2015, 6, day, hour, minute, 0).ConvertToUtc(TimeZones.NewYork);\n            var order = new MarketOnOpenOrder(Symbols.SPY, 100, orderTime);\n\n            var reference = new DateTime(2015, 6, 4, ref_hour, ref_minute, 0).RoundDown(period);\n\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1m, 2m, 0.5m, 1.33m, 100, period));\n\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n\n            const decimal expected = 1.45m;\n\n            var tradeBar = new TradeBar(reference.Add(period), Symbols.SPY, expected, 2.75m, 1.15m, 1.45m, 100, period);\n            equity.SetMarketPrice(tradeBar);\n            TimeKeeper.SetUtcDateTime(tradeBar.EndTime.ConvertToUtc(TimeZones.NewYork));\n\n            fill = model.MarketOnOpenFill(equity, order);\n\n            // Special case when the order exactly when the market opens.\n            // Should only fill on the next day\n            if (nextDay)\n            {\n                Assert.AreEqual(0, fill.FillQuantity);\n                return;\n            }\n\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnCloseUsingClosingPriceWithDailySubscription(int quantity)\n        {\n            Func<DateTime, decimal, TradeBar> getTradeBar = (t, c) => new TradeBar(t.RoundDown(Time.OneDay * 2),\n                Symbols.SPY, 1.33m, 2m, 0.5m, c, 100, Time.OneDay);\n\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var config = CreateTradeBarConfig(Symbols.SPY, Resolution.Daily);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnCloseOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(getTradeBar(time, 2m));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes after 60min, so this is just before market Close\n            time = reference.AddMinutes(59);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(getTradeBar(time, 1.45m));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes\n            const decimal expected = 1.40m;\n            time = reference.AddMinutes(60);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(getTradeBar(time, expected));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnCloseUsingClosingPriceWithMinuteTradeBarSubscription(int quantity)\n        {\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnCloseOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1m, 2m, 0.5m, 1.33m, 100, config.Increment));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes after 60min, so this is just before market Close\n            time = reference.AddMinutes(59);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1.33m, 2.75m, 1.15m, 1.45m, 100, config.Increment));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes\n            time = reference.AddMinutes(60);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1.45m, 2.0m, 1.1m, 1.40m, 100, config.Increment));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(equity.Close, fill.FillPrice);\n        }\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnCloseUsingClosingPriceWithMinuteQuoteBarSubscription(int quantity)\n        {\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var config = CreateQuoteBarConfig(Symbols.SPY);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnCloseOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new QuoteBar(time, Symbols.SPY,\n                new Bar(1.45m, 1.99m, 1.09m, 1.39m), 100,\n                new Bar(1.46m, 2.01m, 1.11m, 1.41m), 100, config.Increment));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes after 60min, so this is just before market Close\n            time = reference.AddMinutes(59);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new QuoteBar(time - config.Increment, Symbols.SPY,\n                new Bar(1.45m, 1.99m, 1.09m, 1.39m), 100,\n                new Bar(1.46m, 2.01m, 1.11m, 1.41m), 100, config.Increment));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal expected = 1.4m;\n\n            // market closes\n            time = reference.AddMinutes(60);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1.45m, 2.0m, 1.1m, 1.40m, 100, config.Increment));\n            equity.SetMarketPrice(new QuoteBar(time, Symbols.SPY,\n                new Bar(1.45m, 1.99m, 1.09m, expected), 100,\n                new Bar(1.46m, 2.01m, 1.11m, expected), 100, config.Increment));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n            Assert.IsTrue(fill.Message.StartsWith(\"Warning: No trade information available\", StringComparison.InvariantCulture));\n        }\n\n        // Official close\n        [TestCase(-100, true, TradeConditionFlags.OfficialClose)]\n        [TestCase(100, true, TradeConditionFlags.OfficialClose)]\n        [TestCase(-100, false, TradeConditionFlags.OfficialClose)]\n        [TestCase(100, false, TradeConditionFlags.OfficialClose)]\n        // Closing prints\n        [TestCase(-100, true, TradeConditionFlags.ClosingPrints)]\n        [TestCase(100, true, TradeConditionFlags.ClosingPrints)]\n        [TestCase(-100, false, TradeConditionFlags.ClosingPrints)]\n        [TestCase(100, false, TradeConditionFlags.ClosingPrints)]\n        // Official close and regular\n        [TestCase(-100, true, TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular)]\n        [TestCase(100, true, TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular)]\n        [TestCase(-100, false, TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular)]\n        [TestCase(100, false, TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular)]\n        // Closing prints and regular\n        [TestCase(-100, true, TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular)]\n        [TestCase(100, true, TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular)]\n        [TestCase(-100, false, TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular)]\n        [TestCase(100, false, TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular)]\n        // Any other random combination of flags that include OfficialClose\n        [TestCase(-100, true,\n            TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100, true,\n            TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(-100, false,\n            TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100, false,\n            TradeConditionFlags.OfficialClose | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        // Any other random combination of flags that include ClosingPrints\n        [TestCase(-100, true,\n            TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100, true,\n            TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(-100, false,\n            TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        [TestCase(100, false,\n            TradeConditionFlags.ClosingPrints | TradeConditionFlags.Regular | TradeConditionFlags.Cash | TradeConditionFlags.Cross |\n            TradeConditionFlags.DerivativelyPriced)]\n        public void PerformsMarketOnCloseUsingClosingPriceWithTickSubscription(int quantity, bool extendedHours, long numericSaleCondition)\n        {\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var config = CreateTickConfig(Symbols.SPY, extendedHours: extendedHours);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnCloseOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var saleCondition = Convert.ToString(numericSaleCondition, 16);\n\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, \"80000001\", \"P\", 100, 1m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes after 60min, so this is just before market Close\n            time = reference.AddMinutes(59);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                // It should fill with this tick based on sales condition but the market is still open\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, 1)\n            }, typeof(Tick));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal expected = 1m;\n            // market closes\n            time = reference.AddMinutes(60);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),\n                new Tick(time, Symbols.SPY, \"80000001\", \"Q\", 100, 0.95m),\n                new Tick(time, Symbols.SPY, \"80000001\", \"P\", 100, 0.98m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, expected),\n            }, typeof(Tick));\n\n            // If the subscriptions doesn't include extended hours, fills with the last tick\n            if (!extendedHours)\n            {\n                fill = model.MarketOnCloseFill(equity, order);\n                Assert.AreEqual(order.Quantity, fill.FillQuantity);\n                Assert.AreEqual(expected, fill.FillPrice);\n                Assert.AreEqual(\"No trade with the OfficialClose or ClosingPrints flag for data that does not include extended market hours. Fill with last Trade data.\", fill.Message);\n                return;\n            }\n\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),   // Not Close\n                new Tick(time, Symbols.SPY, saleCondition, \"Q\", 100, 0.95m),            // Close but not primary exchange\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, expected),         // Fill with this tick\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.95m),\n            }, typeof(Tick));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n        }\n\n        [TestCase(-100)]\n        [TestCase(100)]\n        public void PerformsMarketOnCloseUsingClosingPriceWithTickSubscriptionButNoSalesCondition(int quantity)\n        {\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var config = CreateTickConfig(Symbols.SPY);\n            var equity = CreateEquity(config);\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOnCloseOrder(Symbols.SPY, quantity, reference);\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            // No Sales Condition\n            var saleCondition = \"\";\n\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY, \"80000001\", \"P\", 100, 1m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m)\n            }, typeof(Tick));\n\n            var fill = model.Fill(new FillModelParameters(\n                equity,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            const decimal expected = 1m;\n            // market closes\n            time = reference.AddMinutes(60).AddMilliseconds(100);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),   // Not Close\n                new Tick(time, Symbols.SPY, saleCondition, \"Q\", 100, 0.95m),            // Close but not primary exchange\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, expected),         // Fill with this tick\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.95m),   // Open but not primary exchange\n            }, typeof(Tick));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(\"No trade with the OfficialClose or ClosingPrints flag within the 1-minute timeout.\", fill.Message);\n\n            // 2 minutes after the close\n            time = reference.AddMinutes(62);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            equity.Update(new List<Tick>\n            {\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.9m),   // Not Close\n                new Tick(time, Symbols.SPY, saleCondition, \"P\", 100, 0.95m),\n                new Tick(time, Symbols.SPY, 1m, 0.9m, 1.1m),\n                new Tick(time, Symbols.SPY,  \"80000001\", \"P\", 100, 0.95m),   // Open but not primary exchange\n                new Tick(time, Symbols.SPY, saleCondition, \"Q\", 100, expected),         // Fill with this tick\n            }, typeof(Tick));\n\n            fill = model.MarketOnCloseFill(equity, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(expected, fill.FillPrice);\n            Assert.IsTrue(fill.Message.Contains(\"Fill with last Trade data.\", StringComparison.InvariantCulture));\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void MarketOrderFillsAtBidAsk(OrderDirection direction)\n        {\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, \"fxcm\");\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            var quoteCash = new Cash(Currencies.USD, 1000, 1);\n            var symbolProperties = SymbolProperties.GetDefault(Currencies.USD);\n            var config = new SubscriptionDataConfig(typeof(Tick), symbol, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n            var security = new Forex(exchangeHours, quoteCash, new Cash(\"EUR\", 0, 0), config, symbolProperties, ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null);\n\n            var reference = DateTime.Now;\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var brokerageModel = new FxcmBrokerageModel();\n            var fillModel = brokerageModel.GetFillModel(security);\n\n            const decimal bidPrice = 1.13739m;\n            const decimal askPrice = 1.13746m;\n\n            security.SetMarketPrice(new Tick(DateTime.Now, symbol, bidPrice, askPrice));\n\n            var quantity = direction == OrderDirection.Buy ? 1 : -1;\n            var order = new MarketOrder(symbol, quantity, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            var expected = direction == OrderDirection.Buy ? askPrice : bidPrice;\n            Assert.AreEqual(expected, fill.FillPrice);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [Test]\n        public void EquityFillModelUsesPriceForTicksWhenBidAskSpreadsAreNotAvailable()\n        {\n            var noon = new DateTime(2014, 6, 24, 12, 0, 0);\n            var timeKeeper = new TimeKeeper(noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var config = new SubscriptionDataConfig(typeof(Tick), Symbols.SPY, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, noon, 101.123m));\n\n            // Add both a tradebar and a tick to the security cache\n            // This is the case when a tick is seeded with minute data in an algorithm\n            security.Cache.AddData(new TradeBar(DateTime.MinValue, symbol, 1.0m, 1.0m, 1.0m, 1.0m, 1.0m));\n            security.Cache.AddData(new Tick(config, \"42525000,1000000,100,A,@,0\", DateTime.MinValue));\n\n            var fillModel = new EquityFillModel();\n            var order = new MarketOrder(symbol, 1000, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // The fill model should use the tick.Price\n            Assert.AreEqual(fill.FillPrice, 100m);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [Test]\n        public void EquityFillModelDoesNotUseTicksWhenThereIsNoTickSubscription()\n        {\n            var noon = new DateTime(2014, 6, 24, 12, 0, 0);\n            var timeKeeper = new TimeKeeper(noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            // Minute subscription\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, noon, 101.123m));\n\n\n            // This is the case when a tick is seeded with minute data in an algorithm\n            security.Cache.AddData(new TradeBar(DateTime.MinValue, symbol, 1.0m, 1.0m, 1.0m, 1.0m, 1.0m));\n            security.Cache.AddData(new Tick(config, \"42525000,1000000,100,A,@,0\", DateTime.MinValue));\n\n            var fillModel = new EquityFillModel();\n            var order = new MarketOrder(symbol, 1000, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // The fill model should use the tick.Price\n            Assert.AreEqual(fill.FillPrice, 1.0m);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n\n        [TestCase(100, 291.50, 291.75)]\n        [TestCase(-100, 290.50, 290.25)]\n        public void StopLimitOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal stopPrice, decimal limitPrice)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fillModel = new EquityFillModel();\n            var order = new StopLimitOrder(symbol, orderQuantity, stopPrice, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.StopLimitFill(security, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [Test]\n        public void MarketOrderFillWithStalePriceHasWarningMessage()\n        {\n            var model = new EquityFillModel();\n            var order = new MarketOrder(Symbols.SPY, -100, Noon.ConvertToUtc(TimeZones.NewYork).AddMinutes(61));\n            var config = CreateTickConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new Tick(Noon, Symbols.SPY, 101.123m, 101.456m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.IsTrue(fill.Message.Contains(\"Warning: fill at stale price\"));\n        }\n\n        [TestCase(OrderDirection.Sell, 11)]\n        [TestCase(OrderDirection.Buy, 21)]\n        // uses the trade bar last close\n        [TestCase(OrderDirection.Hold, 291)]\n        public void PriceReturnsQuoteBarsIfPresent(OrderDirection orderDirection, decimal expected)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var configTradeBar = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                configQuoteBar,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            var quoteBar = new QuoteBar(time, symbol,\n                new Bar(10, 15, 5, 11),\n                100,\n                new Bar(20, 25, 15, 21),\n                100);\n            security.SetMarketPrice(quoteBar);\n\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var testFillModel = new TestFillModel();\n            testFillModel.SetParameters(new FillModelParameters(security,\n                null,\n                configProvider,\n                TimeSpan.FromDays(1),\n                null));\n\n            var result = testFillModel.GetPricesPublic(security, orderDirection);\n\n            Assert.AreEqual(expected, result.Close);\n        }\n\n        [TestCase(Resolution.Tick, false)]\n        [TestCase(Resolution.Second, false)]\n        [TestCase(Resolution.Minute, false)]\n        [TestCase(Resolution.Hour, false)]\n        [TestCase(Resolution.Daily, true)]\n        public void PerformFillOutsideRegularAndExtendedHours(Resolution resolution, bool shouldFill)\n        {\n            var config = CreateTradeBarConfig(Symbols.SPY, resolution: resolution);\n            var configProvider = new MockSubscriptionDataConfigProvider(config);\n            configProvider.SubscriptionDataConfigs.Add(config);\n            var equity = CreateEquity(config);\n\n            var baseTime = resolution == Resolution.Daily ? new DateTime(2014, 6, 25) : new DateTime(2014, 6, 24, 12, 0, 0);\n            var orderTime = baseTime.ConvertToUtc(equity.Exchange.TimeZone);\n            var resolutionTimeSpan = resolution.ToTimeSpan();\n            var tradeBarTime = baseTime.Subtract(resolutionTimeSpan);\n\n            var model = (EquityFillModel)equity.FillModel;\n            var order = new MarketOrder(Symbols.SPY, 100, orderTime);\n\n            var parameters = new FillModelParameters(equity, order, configProvider, Time.OneHour, null);\n\n            var timeKeeper = TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            // midnight, shouldn't be able to fill for resolutions < daily\n            timeKeeper.UpdateTime(new DateTime(2014, 6, 25).ConvertToUtc(TimeZones.NewYork));\n            equity.SetLocalTimeKeeper(timeKeeper);\n\n            const decimal close = 101.234m;\n            equity.SetMarketPrice(new TradeBar(tradeBarTime, Symbols.SPY, 101.123m, 101.123m, 101.123m, close, 100, resolutionTimeSpan));\n\n            var fill = model.Fill(parameters).Single();\n\n            if (shouldFill)\n            {\n                Assert.AreEqual(OrderStatus.Filled, fill.Status);\n                Assert.AreEqual(order.Quantity, fill.FillQuantity);\n                Assert.AreEqual(close, fill.FillPrice);\n            }\n            else\n            {\n                Assert.AreNotEqual(OrderStatus.Filled, fill.Status);\n                Assert.AreNotEqual(OrderStatus.PartiallyFilled, fill.Status);\n                Assert.AreEqual(0, fill.FillQuantity);\n                Assert.AreEqual(0, fill.FillPrice);\n            }\n        }\n\n        [TestCase(Resolution.Second)]\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Hour)]\n        public void EquityFillModelFillsMOCAtOrAfterMarketCloseTime(Resolution resolution)\n        {\n            var model = new EquityFillModel();\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var timeOffset = resolution.ToTimeSpan();\n\n            var desiredTime = new DateTime(2025, 7, 8, 16, 0, 0);\n            // Submit MOC order an hour before close\n            var order = new MarketOnCloseOrder(Symbols.SPY, -100, desiredTime.AddMinutes(-60));\n            // Set LocalTime to slightly after market close\n            var localTime = desiredTime + timeOffset - TimeSpan.FromTicks(1);\n            var utcTime = localTime.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(utcTime, new[] { TimeZones.NewYork });\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            // Seed last regular bar\n            security.SetMarketPrice(new TradeBar(desiredTime - timeOffset, Symbols.SPY, 101.123m, 101.123m, 101.123m, 100, 100, timeOffset));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        private Equity CreateEquity(SubscriptionDataConfig config)\n        {\n            var equity = new Equity(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                Exchange.ARCA\n            );\n            equity.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            return equity;\n        }\n\n        private SubscriptionDataConfig CreateTickConfig(Symbol symbol, bool extendedHours = true)\n        {\n            return new SubscriptionDataConfig(typeof(Tick), symbol, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, true, extendedHours, false);\n        }\n\n        private SubscriptionDataConfig CreateQuoteBarConfig(Symbol symbol, Resolution resolution = Resolution.Minute, bool extendedHours = true)\n        {\n            return new SubscriptionDataConfig(typeof(QuoteBar), symbol, resolution, TimeZones.NewYork, TimeZones.NewYork, true, extendedHours, false);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol, Resolution resolution = Resolution.Minute, bool extendedHours = true)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, resolution, TimeZones.NewYork, TimeZones.NewYork, true, extendedHours, false);\n        }\n\n        private FillModelParameters GetFillModelParameters(Order order)\n        {\n            var configTradeBar = CreateTradeBarConfig(order.Symbol);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n            var security = CreateEquity(configTradeBar);\n\n            return new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null);\n        }\n\n        private class TestFillModel : EquityFillModel\n        {\n            public void SetParameters(FillModelParameters parameters)\n            {\n                Parameters = parameters;\n            }\n\n            public Prices GetPricesPublic(Security asset, OrderDirection direction)\n            {\n                return base.GetPrices(asset, direction);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/FutureFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public class FutureFillModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n\n        private static TimeKeeper TimeKeeper;\n\n        [SetUp]\n        public void Setup()\n        {\n            TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n        }\n\n        [Test]\n        public void PerformsMarketFill([Values] bool isInternal,\n            [Values] bool extendedMarketHours,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection)\n        {\n            var model = new FutureFillModel();\n            var quantity = orderDirection == OrderDirection.Buy ? 100 : -100;\n            var time = extendedMarketHours ? Noon.AddHours(-12) : Noon; // Midgnight (extended hours) or Noon (regular hours)\n            var order = new MarketOrder(Symbols.ES_Future_Chain, quantity, time);\n            var config = CreateTradeBarConfig(Symbols.ES_Future_Chain, isInternal, extendedMarketHours);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.ES_Future_Chain, time, 101.123m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Price, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsStopMarketFill(\n            [Values] bool extendedMarketHours,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection)\n        {\n            var symbol = Symbols.ES_Future_Chain;\n            var model = new FutureFillModel();\n            var quantity = orderDirection == OrderDirection.Buy ? 100 : -100;\n            var marketPrice = orderDirection == OrderDirection.Buy ? 102m : 101m;\n\n            var time = Noon.AddHours(-12);\n\n            var order = new StopMarketOrder(symbol, quantity, 101.124m, time);\n            var config = CreateTradeBarConfig(symbol, extendedMarketHours: extendedMarketHours);\n            var security = GetSecurity(config);\n            TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork).UpdateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(symbol, time, marketPrice));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(config);\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(order.Quantity, fill.FillQuantity);\n                Assert.AreEqual(security.Price, fill.FillPrice);\n                Assert.AreEqual(OrderStatus.Filled, fill.Status);\n                Assert.IsTrue(exchangeHours.IsOpen(fill.UtcTime, extendedMarketHours));\n            }\n            else\n            {\n                Assert.AreEqual(0m, fill.FillQuantity);\n                Assert.AreEqual(0m, fill.FillPrice);\n                Assert.AreNotEqual(OrderStatus.Filled, fill.Status);\n                Assert.AreNotEqual(OrderStatus.PartiallyFilled, fill.Status);\n                Assert.IsFalse(exchangeHours.IsOpen(fill.UtcTime, extendedMarketHours));\n            }\n\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol, bool isInternal = false, bool extendedMarketHours = true)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, extendedMarketHours, isInternal);\n        }\n\n        private Security GetSecurity(SubscriptionDataConfig config)\n        {\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(config.Symbol.ID.Market, config.Symbol, config.SecurityType);\n            var security = new Security(\n                entry.ExchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/FutureOptionFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public class FutureOptionFillModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n\n        private static TimeKeeper TimeKeeper;\n\n        [SetUp]\n        public void Setup()\n        {\n            TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n        }\n\n        [Test]\n        public void PerformsMarketFill([Values] bool isInternal,\n            [Values] bool extendedMarketHours,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection)\n        {\n            var model = new FutureFillModel();\n            var quantity = orderDirection == OrderDirection.Buy ? 100 : -100;\n            var time = extendedMarketHours ? Noon.AddHours(-12) : Noon; // Midgnight (extended hours) or Noon (regular hours)\n            var symbol = Symbols.CreateFutureOptionSymbol(Symbols.CreateFutureSymbol(\"ES\", new DateTime(2020, 4, 28)), OptionRight.Call,\n                1000, new DateTime(2020, 3, 26));\n            var order = new MarketOrder(symbol, quantity, time);\n            var config = CreateTradeBarConfig(symbol, isInternal, extendedMarketHours);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(symbol, time, 101.123m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Price, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol, bool isInternal = false, bool extendedMarketHours = true)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, extendedMarketHours, isInternal);\n        }\n\n        private Security GetSecurity(SubscriptionDataConfig config)\n        {\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(config.Symbol.ID.Market, config.Symbol, config.SecurityType);\n            var security = new Security(\n                entry.ExchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/ImmediateFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public class ImmediateFillModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n        private static TimeKeeper TimeKeeper;\n\n        [SetUp]\n        public void Setup()\n        {\n            TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsMarketFillBuy(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new MarketOrder(Symbols.SPY, 100, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Price, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsMarketFillSell(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new MarketOrder(Symbols.SPY, -100, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Price, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true, true)]\n        [TestCase(false, true)]\n        [TestCase(true, false)]\n        [TestCase(false, false)]\n        public void LimitFillExtendedMarketHours(bool isInternal, bool extendedMarketHours)\n        {\n            var model = new ImmediateFillModel();\n            // 6 AM NewYork time, pre market\n            var currentTimeNY = new DateTime(2022, 7, 19, 6, 0, 0);\n            var order = new LimitOrder(Symbols.SPY, 100, 101.5m, currentTimeNY);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal, extendedMarketHours);\n            var security = GetSecurity(config);\n            TimeKeeper.SetUtcDateTime(currentTimeNY.ConvertToUtc(TimeZones.NewYork));\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, currentTimeNY, 102m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new TradeBar(currentTimeNY, Symbols.SPY, 102m, 103m, 101m, 102.3m, 100));\n\n            fill = model.LimitFill(security, order);\n\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(order.Quantity, fill.FillQuantity);\n                Assert.AreEqual(Math.Min(order.LimitPrice, security.High), fill.FillPrice);\n                Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            }\n            else\n            {\n                Assert.AreEqual(0, fill.FillQuantity);\n                Assert.AreEqual(0, fill.FillPrice);\n                Assert.AreEqual(OrderStatus.None, fill.Status);\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsLimitFillBuy(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new LimitOrder(Symbols.SPY, 100, 101.5m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 101m, 102.3m, 100));\n\n            fill = model.LimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(Math.Min(order.LimitPrice, security.High), fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsLimitFillSell(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new LimitOrder(Symbols.SPY, -100, 101.5m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 101m, 102.3m, 100));\n\n            fill = model.LimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(Math.Max(order.LimitPrice, security.Low), fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsStopLimitFillBuy(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new StopLimitOrder(Symbols.SPY, 100, 101.5m, 101.75m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 100m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.66m));\n\n            fill = model.StopLimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.High, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsStopLimitFillSell(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new StopLimitOrder(Symbols.SPY, -100, 101.75m, 101.50m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.66m));\n\n            fill = model.StopLimitFill(security, order);\n\n            // this fills worst case scenario, so it's at the limit price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Low, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsStopMarketFillBuy(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, 100, 101.5m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102.5m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // this fills worst case scenario, so it's min of asset/stop price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(Math.Max(security.Price, order.StopPrice), fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsStopMarketFillSell(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new StopMarketOrder(Symbols.SPY, -100, 101.5m, Noon);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 102m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // this fills worst case scenario, so it's min of asset/stop price\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(Math.Min(security.Price, order.StopPrice), fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [Test]\n        public void PerformsTrailingStopImmediateFillBuy([Values] bool isInternal, [Values] bool trailingAsPercentage)\n        {\n            var model = new ImmediateFillModel();\n            // Assume market price is $100:\n            var order = trailingAsPercentage\n                // a trailing amount of 5%, stop price $105\n                ? new TrailingStopOrder(Symbols.SPY, 100, 105m, 0.05m, true, Noon)\n                // a trailing amount of $10 set the stop price to $110\n                : new TrailingStopOrder(Symbols.SPY, 100, 110m, 10m, false, Noon);\n\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // Security price rises above stop price immediately\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, trailingAsPercentage ? 100m * (1 + 0.05m) : 100m + 10m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertFilled(fill, order.Quantity, Math.Max(security.Price, order.StopPrice));\n        }\n\n        [Test]\n        public void PerformsTrailingStopFillBuy([Values] bool isInternal, [Values] bool trailingAsPercentage)\n        {\n            var model = new ImmediateFillModel();\n            // Assume market price is $100:\n            var order = trailingAsPercentage\n                // a trailing amount of 5%, stop price $105\n                ? new TrailingStopOrder(Symbols.SPY, 100, 105m, 0.05m, true, Noon)\n                // a trailing amount of $10 set the stop price to $110\n                : new TrailingStopOrder(Symbols.SPY, 100, 110m, 10m, false, Noon);\n\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var initialTrailingStopPrice = order.StopPrice;\n            var prevMarketPrice = 100m;\n            // Market price hasn't moved\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, prevMarketPrice));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            // Simulate a rising security price, but not enough to trigger the stop\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon,\n                trailingAsPercentage ? prevMarketPrice * (1 + 0.025m) : prevMarketPrice + 5m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            prevMarketPrice = security.Price;\n            // Simulate a falling security price, but still above the lowest market price\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon,\n                trailingAsPercentage ? prevMarketPrice * (1 + 0.0125m) : prevMarketPrice - 2.5m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            // Simulate a falling security price, which triggers a stop price update\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon,\n                trailingAsPercentage ? prevMarketPrice * (1 - 0.05m) : prevMarketPrice - 10m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have been updated to:\n            //  --> (market price + trailing amount) if trailing amount is not a percentage\n            //  --> (market price * (1 + trailing amount)) if trailing amount is a percentage\n            Assert.AreNotEqual(initialTrailingStopPrice, order.StopPrice);\n            var expectedUpdatedStopPrice = trailingAsPercentage ? security.Price * (1 + 0.05m) : security.Price + 10m;\n            Assert.AreEqual(expectedUpdatedStopPrice, order.StopPrice);\n\n            // Simulate a rising security price, enough to trigger the stop\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon,\n                trailingAsPercentage ? order.StopPrice * (1 + 0.05m) : order.StopPrice + 10m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // Stop price should have not been updated\n            Assert.AreEqual(expectedUpdatedStopPrice, order.StopPrice);\n\n            AssertFilled(fill, order.Quantity, Math.Max(security.Price, order.StopPrice));\n        }\n\n        [Test]\n        public void PerformsTrailingStopImmediateFillSell([Values] bool isInternal, [Values] bool trailingAsPercentage)\n        {\n            var model = new ImmediateFillModel();\n            // Assume market price is $100, with a trailing amount of $10 set the stop price to $90\n            var order = trailingAsPercentage\n                ? new TrailingStopOrder(Symbols.SPY, 100, 95m, 0.05m, true, Noon)\n                : new TrailingStopOrder(Symbols.SPY, 100, 90m, 10m, false, Noon);\n\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // Security price falls below stop price immediately\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, trailingAsPercentage ? 100m * (1 - 0.05m) : 100m - 10m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertFilled(fill, order.Quantity, Math.Min(security.Price, order.StopPrice));\n        }\n\n        [Test]\n        public void PerformsTrailingStopFillSell([Values] bool isInternal, [Values] bool trailingAsPercentage)\n        {\n            var model = new ImmediateFillModel();\n            var prevMarketPrice = 100m;\n            // Initial market price $100, trailing amount of $10 set the stop price to $90\n            var order = trailingAsPercentage\n                ? new TrailingStopOrder(Symbols.SPY, -100, 90m, 0.1m, true, Noon)\n                : new TrailingStopOrder(Symbols.SPY, -100, 90m, 10m, false, Noon);\n\n            var initialTrailingStopPrice = order.StopPrice;\n\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // Market price hasn't moved\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, prevMarketPrice));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            // Simulate a falling security price, but not enough to trigger the stop\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 95m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            prevMarketPrice = security.Price;\n            // Simulate a rising security price, but still above the lowest market price\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 97.5m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have not been updated\n            Assert.AreEqual(initialTrailingStopPrice, order.StopPrice);\n\n            prevMarketPrice = security.Price;\n            // Simulate a rising security price, which triggers a stop price update\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 105m));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            // Stop price should have been updated to:\n            //  --> (market price - trailing amount) if trailing amount is not a percentage\n            //  --> (market price * (1 - trailing amount)) if trailing amount is a percentage\n            Assert.AreNotEqual(initialTrailingStopPrice, order.StopPrice);\n            var expectedUpdatedStopPrice = trailingAsPercentage ? 105m * (1 - 0.1m) : 105m - 10m;\n            Assert.AreEqual(expectedUpdatedStopPrice, order.StopPrice);\n\n            prevMarketPrice = security.Price;\n            var sopTriggerMarketPrice = trailingAsPercentage ? prevMarketPrice * (1 - 0.1m) : prevMarketPrice - 10m;\n            // Simulate a falling security price, enough to trigger the stop\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, sopTriggerMarketPrice));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // Stop price should have not been updated\n            Assert.AreEqual(expectedUpdatedStopPrice, order.StopPrice);\n\n            AssertFilled(fill, order.Quantity, Math.Min(security.Price, order.StopPrice));\n        }\n\n        [TestCase(100, 291.50, false)]\n        [TestCase(-100, 290.50, false)]\n        [TestCase(100, 291.50, true)]\n        [TestCase(-100, 290.50, true)]\n        public void TrailingStopOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal stopPrice, bool isInternal)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n\n            var symbol = Symbols.SPY;\n            var config = CreateTradeBarConfig(symbol, isInternal);\n            var security = GetSecurity(config);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            // The new prices are enough to trigger the stop for the orders\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fillModel = new ImmediateFillModel();\n            var order = new TrailingStopOrder(symbol, orderQuantity, stopPrice, 0.1m, true, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertUnfilled(fill);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            AssertFilled(fill, orderQuantity, orderQuantity < 0 ? Math.Min(security.Price, stopPrice) : Math.Max(security.Price, stopPrice));\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsLimitIfTouchedFillBuy(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new LimitIfTouchedOrder(Symbols.SPY, 100, 101.5m, 100m, Noon);\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            var security = GetSecurity(configTradeBar);\n            // Sets price at time zero\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 102m, 102m, 102m, 100));\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => trigger touched but not limit\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 101m, 101m, 100.5m, 101m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                new Bar(101m, 101m, 100.5m, 101m), 100, // Bid bar\n                new Bar(101m, 101m, 100.5m, 101m), 100) // Ask bar\n            );\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => limit reached, holdings sold\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 100m, 100m, 99m, 99m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                    new Bar(100m, 100m, 99m, 99m), 100, // Bid bar\n                    new Bar(100m, 100m, 99m, 99m), 100) // Ask bar\n            );\n\n\n            fill = model.LimitIfTouchedFill(security, order);\n\n            // this fills worst case scenario\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsLimitIfTouchedFillSell(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new LimitIfTouchedOrder(Symbols.SPY, -100, 101.5m, 105m, Noon);\n            var configTradeBar = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            var security = GetSecurity(configTradeBar);\n\n            // Sets price at time zero\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 100m, 100m, 90m, 90m, 100));\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => trigger touched but not limit\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 102m, 102m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                new Bar(101m, 102m, 100m, 100m), 100, // Bid bar\n                new Bar(103m, 104m, 102m, 102m), 100) // Ask bar\n            );\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                configProvider,\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            // Time jump => limit reached, holdings sold\n            security.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 103m, 108m, 103m, 105m, 100));\n            security.SetMarketPrice(new QuoteBar(Noon, Symbols.SPY,\n                    new Bar(103m, 106m, 103m, 105m), 100, // Bid bar\n                    new Bar(103m, 108m, 103m, 105m), 100) // Ask bar\n            );\n\n\n            fill = model.LimitIfTouchedFill(security, order);\n\n            // this fills worst case scenario\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(order.LimitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsMarketOnOpenUsingOpenPrice(bool isInternal)\n        {\n            var reference = new DateTime(2015, 06, 05, 9, 0, 0); // before market open\n            var model = new ImmediateFillModel();\n            var order = new MarketOnOpenOrder(Symbols.SPY, 100, reference);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1m, 2m, 0.5m, 1.33m, 100));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market opens after 30min, so this is just before market open\n            time = reference.AddMinutes(29);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1.33m, 2.75m, 1.15m, 1.45m, 100));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market opens after 30min\n            time = reference.AddMinutes(30);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time, Symbols.SPY, 1.45m, 2.0m, 1.1m, 1.40m, 100));\n\n            fill = model.MarketOnOpenFill(security, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Open, fill.FillPrice);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void PerformsMarketOnCloseUsingClosingPrice(bool isInternal)\n        {\n            var reference = new DateTime(2015, 06, 05, 15, 0, 0); // before market close\n            var model = new ImmediateFillModel();\n            var order = new MarketOnCloseOrder(Symbols.SPY, 100, reference);\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            var time = reference;\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1m, 2m, 0.5m, 1.33m, 100, config.Increment));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes after 60min, so this is just before market Close\n            time = reference.AddMinutes(59);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1.33m, 2.75m, 1.15m, 1.45m, 100, config.Increment));\n\n            fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n            Assert.AreEqual(0, fill.FillQuantity);\n\n            // market closes\n            time = reference.AddMinutes(60);\n            TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n            security.SetMarketPrice(new TradeBar(time - config.Increment, Symbols.SPY, 1.45m, 2.0m, 1.1m, 1.40m, 100, config.Increment));\n\n            fill = model.MarketOnCloseFill(security, order);\n            Assert.AreEqual(order.Quantity, fill.FillQuantity);\n            Assert.AreEqual(security.Close, fill.FillPrice);\n        }\n\n        [TestCase(OrderDirection.Buy, true)]\n        [TestCase(OrderDirection.Sell, true)]\n        [TestCase(OrderDirection.Buy, false)]\n        [TestCase(OrderDirection.Sell, false)]\n        public void MarketOrderFillsAtBidAsk(OrderDirection direction, bool isInternal)\n        {\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, \"fxcm\");\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            var quoteCash = new Cash(Currencies.USD, 1000, 1);\n            var symbolProperties = SymbolProperties.GetDefault(Currencies.USD);\n            var config = new SubscriptionDataConfig(typeof(Tick), symbol, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = new Forex(exchangeHours, quoteCash, new Cash(\"EUR\", 0, 0), config, symbolProperties, ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null);\n\n            var reference = DateTime.Now;\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var brokerageModel = new FxcmBrokerageModel();\n            var fillModel = brokerageModel.GetFillModel(security);\n\n            const decimal bidPrice = 1.13739m;\n            const decimal askPrice = 1.13746m;\n\n            security.SetMarketPrice(new Tick(DateTime.Now, symbol, bidPrice, askPrice));\n\n            var quantity = direction == OrderDirection.Buy ? 1 : -1;\n            var order = new MarketOrder(symbol, quantity, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            var expected = direction == OrderDirection.Buy ? askPrice : bidPrice;\n            Assert.AreEqual(expected, fill.FillPrice);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ImmediateFillModelUsesPriceForTicksWhenBidAskSpreadsAreNotAvailable(bool isInternal)\n        {\n            var noon = new DateTime(2014, 6, 24, 12, 0, 0);\n            var timeKeeper = new TimeKeeper(noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var config = new SubscriptionDataConfig(typeof(Tick), Symbols.SPY, Resolution.Tick, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, noon, 101.123m));\n\n            // Add both a tradebar and a tick to the security cache\n            // This is the case when a tick is seeded with minute data in an algorithm\n            security.Cache.AddData(new TradeBar(DateTime.MinValue, symbol, 1.0m, 1.0m, 1.0m, 1.0m, 1.0m));\n            security.Cache.AddData(new Tick(config, \"42525000,1000000,100,A,@,0\", DateTime.MinValue));\n\n            var fillModel = new ImmediateFillModel();\n            var order = new MarketOrder(symbol, 1000, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // The fill model should use the tick.Price\n            Assert.AreEqual(fill.FillPrice, 100m);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ImmediateFillModelDoesNotUseTicksWhenThereIsNoTickSubscription(bool isInternal)\n        {\n            var noon = new DateTime(2014, 6, 24, 12, 0, 0);\n            var timeKeeper = new TimeKeeper(noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            // Minute subscription\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, noon, 101.123m));\n\n\n            // This is the case when a tick is seeded with minute data in an algorithm\n            security.Cache.AddData(new TradeBar(DateTime.MinValue, symbol, 1.0m, 1.0m, 1.0m, 1.0m, 1.0m));\n            security.Cache.AddData(new Tick(config, \"42525000,1000000,100,A,@,0\", DateTime.MinValue));\n\n            var fillModel = new ImmediateFillModel();\n            var order = new MarketOrder(symbol, 1000, DateTime.Now);\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            // The fill model should use the tick.Price\n            Assert.AreEqual(fill.FillPrice, 1.0m);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(100, 290.50, true)]\n        [TestCase(-100, 291.50, true)]\n        [TestCase(100, 290.50, false)]\n        [TestCase(-100, 291.50, false)]\n        public void LimitOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal limitPrice, bool isInternal)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fillModel = new ImmediateFillModel();\n            var order = new LimitOrder(symbol, orderQuantity, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.LimitFill(security, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(100, 291.50, false)]\n        [TestCase(-100, 290.50, false)]\n        [TestCase(100, 291.50, true)]\n        [TestCase(-100, 290.50, true)]\n        public void StopMarketOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal stopPrice, bool isInternal)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fillModel = new ImmediateFillModel();\n            var order = new StopMarketOrder(symbol, orderQuantity, stopPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.StopMarketFill(security, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(stopPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(100, 291.50, 291.75, true)]\n        [TestCase(-100, 290.50, 290.25, true)]\n        [TestCase(100, 291.50, 291.75, false)]\n        [TestCase(-100, 290.50, 290.25, false)]\n        public void StopLimitOrderDoesNotFillUsingDataBeforeSubmitTime(decimal orderQuantity, decimal stopPrice, decimal limitPrice, bool isInternal)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            var fillForwardBar = (TradeBar)tradeBar.Clone(true);\n            security.SetMarketPrice(fillForwardBar);\n\n            var fillModel = new ImmediateFillModel();\n            var order = new StopLimitOrder(symbol, orderQuantity, stopPrice, limitPrice, time.ConvertToUtc(TimeZones.NewYork));\n\n            var fill = fillModel.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n\n            time += TimeSpan.FromMinutes(1);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n\n            tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            fill = fillModel.StopLimitFill(security, order);\n\n            Assert.AreEqual(orderQuantity, fill.FillQuantity);\n            Assert.AreEqual(limitPrice, fill.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(0, fill.OrderFee.Value.Amount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void MarketOrderFillWithStalePriceHasWarningMessage(bool isInternal)\n        {\n            var model = new ImmediateFillModel();\n            var order = new MarketOrder(Symbols.SPY, -100, Noon.ConvertToUtc(TimeZones.NewYork).AddMinutes(61));\n            var config = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var security = GetSecurity(config);\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.IsTrue(fill.Message.Contains(\"Warning: fill at stale price\"));\n        }\n\n        [TestCase(OrderDirection.Sell, 11, true)]\n        [TestCase(OrderDirection.Buy, 21, true)]\n        // uses the trade bar last close\n        [TestCase(OrderDirection.Hold, 291, true)]\n        [TestCase(OrderDirection.Sell, 11, false)]\n        [TestCase(OrderDirection.Buy, 21, false)]\n        // uses the trade bar last close\n        [TestCase(OrderDirection.Hold, 291, false)]\n        public void PriceReturnsQuoteBarsIfPresent(OrderDirection orderDirection, decimal expected, bool isInternal)\n        {\n            var time = new DateTime(2018, 9, 24, 9, 30, 0);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var configTradeBar = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, isInternal);\n            var configQuoteBar = new SubscriptionDataConfig(configTradeBar, typeof(QuoteBar));\n            var security = GetSecurity(configQuoteBar);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var tradeBar = new TradeBar(time, symbol, 290m, 292m, 289m, 291m, 12345);\n            security.SetMarketPrice(tradeBar);\n\n            var quoteBar = new QuoteBar(time, symbol,\n                new Bar(10, 15, 5, 11),\n                100,\n                new Bar(20, 25, 15, 21),\n                100);\n            security.SetMarketPrice(quoteBar);\n\n            var configProvider = new MockSubscriptionDataConfigProvider(configQuoteBar);\n            configProvider.SubscriptionDataConfigs.Add(configTradeBar);\n\n            var testFillModel = new TestFillModel();\n            testFillModel.SetParameters(new FillModelParameters(security,\n                null,\n                configProvider,\n                TimeSpan.FromDays(1),\n                null));\n\n            var result = testFillModel.GetPricesPublic(security, orderDirection);\n\n            Assert.AreEqual(expected, result.Close);\n        }\n\n        [Test]\n        public void PerformsComboMarketFill(\n            [Values] bool isInternal,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection)\n        {\n            var model = new ImmediateFillModel();\n            var groupOrderManager = new GroupOrderManager(0, 2, orderDirection == OrderDirection.Buy ? 10 : -10);\n            var spyOrder = new ComboMarketOrder(\n                Symbols.SPY,\n                10m.GetOrderLegGroupQuantity(groupOrderManager),\n                Noon,\n                groupOrderManager)\n            { Id = 1 };\n            var aaplOrder = new ComboMarketOrder(\n                Symbols.AAPL,\n                5m.GetOrderLegGroupQuantity(groupOrderManager),\n                Noon,\n                groupOrderManager)\n            { Id = 2 };\n\n            groupOrderManager.OrderIds.Add(spyOrder.Id);\n            groupOrderManager.OrderIds.Add(aaplOrder.Id);\n\n            var spyConfig = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var aaplConfig = CreateTradeBarConfig(Symbols.AAPL, isInternal);\n            var spy = GetSecurity(spyConfig);\n            var aapl = GetSecurity(aaplConfig);\n            spy.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            spy.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n            aapl.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            aapl.SetMarketPrice(new IndicatorDataPoint(Symbols.AAPL, Noon, 55.456m));\n\n            Assert.AreEqual(orderDirection, groupOrderManager.Direction);\n\n            var securitiesForOrders = new Dictionary<Order, Security>\n            {\n                { spyOrder, spy },\n                { aaplOrder, aapl }\n            };\n\n            var fill = model.Fill(new FillModelParameters(\n                spy,\n                spyOrder,\n                new MockSubscriptionDataConfigProvider(spyConfig),\n                Time.OneHour,\n                securitiesForOrders));\n\n            Assert.AreEqual(2, fill.Count());\n\n            var spyFillEvent = fill.First();\n\n            Assert.AreEqual(spyOrder.Quantity, spyFillEvent.FillQuantity);\n            Assert.AreEqual(spy.Price, spyFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, spyFillEvent.Status);\n\n            var aaplFillEvent = fill.Last();\n\n            Assert.AreEqual(aaplOrder.Quantity, aaplFillEvent.FillQuantity);\n            Assert.AreEqual(aapl.Price, aaplFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, aaplFillEvent.Status);\n        }\n\n        [Test]\n        public void PerformsComboLimitFill(\n            [Values] bool isInternal,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection,\n            [Values] bool debit)\n        {\n            var spyConfig = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var aaplConfig = CreateTradeBarConfig(Symbols.AAPL, isInternal);\n            var spy = GetSecurity(spyConfig);\n            var aapl = GetSecurity(aaplConfig);\n            spy.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            spy.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 301m, 302m, 299m, 300m, 10));\n            aapl.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            aapl.SetMarketPrice(new TradeBar(Noon, Symbols.AAPL, 101m, 102m, 99m, 100m, 25));\n\n            var groupOrderManager = new GroupOrderManager(0, 2, orderDirection == OrderDirection.Buy ? 10 : -10, 0m);\n            Assert.AreEqual(orderDirection, groupOrderManager.Direction);\n\n            var spyLegOrder = new ComboLimitOrder(\n                Symbols.SPY,\n                -100m.GetOrderLegGroupQuantity(groupOrderManager),\n                0m,\n                Noon,\n                groupOrderManager);\n            var aaplLegOrder = new ComboLimitOrder(\n                Symbols.AAPL,\n                100m.GetOrderLegGroupQuantity(groupOrderManager),\n                0m,\n                Noon,\n                groupOrderManager);\n            var legsOrders = new List<ComboLimitOrder>() { spyLegOrder, aaplLegOrder };\n            for (var i = 0; i < legsOrders.Count; i++)\n            {\n                legsOrders[i].Id = i + 1;\n                if (debit)\n                {\n                    legsOrders[i].Quantity *= -1;\n                }\n\n                groupOrderManager.OrderIds.Add(legsOrders[i].Id);\n            }\n\n            var securitiesForOrders = new Dictionary<Order, Security>\n            {\n                { spyLegOrder, spy },\n                { aaplLegOrder, aapl }\n            };\n\n            var getLegsPrice = (Func<Security, decimal> priceSelector) =>\n                priceSelector(spy) * spyLegOrder.Quantity.GetOrderLegRatio(groupOrderManager) / 100 +\n                priceSelector(aapl) * aaplLegOrder.Quantity.GetOrderLegRatio(groupOrderManager) / 100;\n\n            // set limit prices that won't fill.\n            // combo limit orders fill based on the total price that will be paid/received for the legs\n            if (orderDirection == OrderDirection.Buy)\n            {\n                // limit price lower than legs price\n                var price = getLegsPrice((security) => security.Low);\n                var multiplier = price > 0 ? 0.999m : 1.001m;\n                groupOrderManager.LimitPrice = price * multiplier;\n            }\n            else\n            {\n                // limit price higher than legs price\n                var price = getLegsPrice((security) => security.High);\n                var multiplier = price > 0 ? 1.001m : 0.999m;\n                groupOrderManager.LimitPrice = price * multiplier;\n            }\n\n            var model = new ImmediateFillModel();\n\n            var fill = model.Fill(new FillModelParameters(spy,\n                spyLegOrder,\n                new MockSubscriptionDataConfigProvider(spyConfig),\n                Time.OneHour,\n                securitiesForOrders));\n            // won't fill with the given limit price\n            Assert.IsEmpty(fill);\n\n            // set limit prices that will fill\n            if (orderDirection == OrderDirection.Buy)\n            {\n                var price = getLegsPrice((security) => security.Low);\n                var multiplier = price > 0 ? 1.001m : 0.999m;\n                groupOrderManager.LimitPrice = price * multiplier;\n            }\n            else\n            {\n                var price = getLegsPrice((security) => security.High);\n                var multiplier = price > 0 ? 0.999m : 1.001m;\n                groupOrderManager.LimitPrice = price * multiplier;\n            }\n\n            fill = model.Fill(new FillModelParameters(spy,\n                spyLegOrder,\n                new MockSubscriptionDataConfigProvider(spyConfig),\n                Time.OneHour,\n                securitiesForOrders));\n            Assert.AreEqual(legsOrders.Count, fill.Count());\n\n            var spyFillEvent = fill.First();\n\n            Assert.AreEqual(spyLegOrder.Quantity, spyFillEvent.FillQuantity);\n            var expectedSpyFillPrice = orderDirection == OrderDirection.Buy ? spy.Low : spy.High;\n            Assert.AreEqual(expectedSpyFillPrice, spyFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, spyFillEvent.Status);\n\n            var aaplFillEvent = fill.Last();\n\n            Assert.AreEqual(aaplLegOrder.Quantity, aaplFillEvent.FillQuantity);\n            var expectedAaplFillPrice = orderDirection == OrderDirection.Buy ? aapl.Low : aapl.High;\n            Assert.AreEqual(expectedAaplFillPrice, aaplFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, aaplFillEvent.Status);\n        }\n\n        [Test]\n        public void PerformsComboLegLimitFill(\n            [Values] bool isInternal,\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection)\n        {\n            var model = new ImmediateFillModel();\n            var multiplier = orderDirection == OrderDirection.Buy ? 1 : -1;\n            var groupOrderManager = new GroupOrderManager(0, 2, multiplier * 10, 1m);\n\n            var spyLimitPrice = orderDirection == OrderDirection.Buy ? 101.1m : 102m;\n            var spyOrder = new ComboLegLimitOrder(\n                Symbols.SPY,\n                10m.GetOrderLegGroupQuantity(groupOrderManager),\n                spyLimitPrice,\n                Noon,\n                groupOrderManager)\n            { Id = 1 };\n            var aaplLimitPrice = orderDirection == OrderDirection.Buy ? 252.5m : 251.1m;\n            var aaplOrder = new ComboLegLimitOrder(\n                Symbols.AAPL,\n                multiplier * 5m.GetOrderLegGroupQuantity(groupOrderManager),\n                aaplLimitPrice,\n                Noon,\n                groupOrderManager)\n            { Id = 2 };\n\n            groupOrderManager.OrderIds.Add(spyOrder.Id);\n            groupOrderManager.OrderIds.Add(aaplOrder.Id);\n\n            Assert.AreEqual(orderDirection, groupOrderManager.Direction);\n\n            var spyConfig = CreateTradeBarConfig(Symbols.SPY, isInternal);\n            var aaplConfig = CreateTradeBarConfig(Symbols.AAPL, isInternal);\n            var spy = GetSecurity(spyConfig);\n            var aapl = GetSecurity(aaplConfig);\n            spy.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            spy.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, Noon, 101.123m));\n            aapl.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            aapl.SetMarketPrice(new IndicatorDataPoint(Symbols.AAPL, Noon, 252.456m));\n\n            var securitiesForOrders = new Dictionary<Order, Security>\n            {\n                { spyOrder, spy },\n                { aaplOrder, aapl }\n            };\n\n            var fill = model.Fill(new FillModelParameters(\n                spy,\n                spyOrder,\n                new MockSubscriptionDataConfigProvider(spyConfig),\n                Time.OneHour,\n                securitiesForOrders));\n\n            // Won't fill, the limit price condition is not met\n            Assert.IsEmpty(fill);\n\n            spy.SetMarketPrice(new TradeBar(Noon, Symbols.SPY, 102m, 103m, 101m, 102.3m, 100));\n            aapl.SetMarketPrice(new TradeBar(Noon, Symbols.AAPL, 252m, 253m, 251m, 252.3m, 250));\n\n            fill = model.Fill(new FillModelParameters(\n                spy,\n                spyOrder,\n                new MockSubscriptionDataConfigProvider(spyConfig),\n                Time.OneHour,\n                securitiesForOrders));\n\n            Assert.AreEqual(2, fill.Count());\n\n            var spyFillEvent = fill.First();\n\n            Assert.AreEqual(spyOrder.Quantity, spyFillEvent.FillQuantity);\n            var expectedSpyFillPrice = orderDirection == OrderDirection.Buy\n                ? Math.Min(spyOrder.LimitPrice, spy.High)\n                : Math.Max(spyOrder.LimitPrice, spy.Low);\n            Assert.AreEqual(expectedSpyFillPrice, spyFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, spyFillEvent.Status);\n\n            var aaplFillEvent = fill.Last();\n\n            Assert.AreEqual(aaplOrder.Quantity, aaplFillEvent.FillQuantity);\n            var expectedAaplFillPrice = orderDirection == OrderDirection.Buy\n                ? Math.Min(aaplOrder.LimitPrice, aapl.High)\n                : Math.Max(aaplOrder.LimitPrice, aapl.Low);\n            Assert.AreEqual(expectedAaplFillPrice, aaplFillEvent.FillPrice);\n            Assert.AreEqual(OrderStatus.Filled, aaplFillEvent.Status);\n        }\n\n        [TestCase(Resolution.Tick, false)]\n        [TestCase(Resolution.Second, false)]\n        [TestCase(Resolution.Minute, false)]\n        [TestCase(Resolution.Hour, false)]\n        [TestCase(Resolution.Daily, true)]\n        public void PerformFillOutsideRegularAndExtendedHours(Resolution resolution, bool shouldFill)\n        {\n            var config = CreateTradeBarConfig(Symbols.SPY, resolution: resolution);\n            var configProvider = new MockSubscriptionDataConfigProvider(config);\n            configProvider.SubscriptionDataConfigs.Add(config);\n            var security = GetSecurity(config);\n            security.SetFillModel(new ImmediateFillModel());\n\n            var baseTime = resolution == Resolution.Daily ? new DateTime(2014, 6, 25) : new DateTime(2014, 6, 24, 12, 0, 0);\n            var orderTime = baseTime.ConvertToUtc(security.Exchange.TimeZone);\n            var resolutionTimeSpan = resolution.ToTimeSpan();\n            var tradeBarTime = baseTime.Subtract(resolutionTimeSpan);\n\n            var model = (ImmediateFillModel)security.FillModel;\n            var order = new MarketOrder(Symbols.SPY, 100, orderTime);\n\n            var parameters = new FillModelParameters(security, order, configProvider, Time.OneHour, null);\n\n            var timeKeeper = TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            // midnight, shouldn't be able to fill for resolutions < daily\n            timeKeeper.UpdateTime(new DateTime(2014, 6, 25).ConvertToUtc(TimeZones.NewYork));\n            security.SetLocalTimeKeeper(timeKeeper);\n\n            const decimal close = 101.234m;\n            security.SetMarketPrice(new TradeBar(tradeBarTime, Symbols.SPY, 101.123m, 101.123m, 101.123m, close, 100, resolutionTimeSpan));\n\n            var fill = model.Fill(parameters).Single();\n\n            if (shouldFill)\n            {\n                Assert.AreEqual(OrderStatus.Filled, fill.Status);\n                Assert.AreEqual(order.Quantity, fill.FillQuantity);\n                Assert.AreEqual(close, fill.FillPrice);\n            }\n            else\n            {\n                Assert.AreNotEqual(OrderStatus.Filled, fill.Status);\n                Assert.AreNotEqual(OrderStatus.PartiallyFilled, fill.Status);\n                Assert.AreEqual(0, fill.FillQuantity);\n                Assert.AreEqual(0, fill.FillPrice);\n            }\n        }\n\n        [Test]\n        public void ImmediateFillModelFillsMOCAtOrAfterMarketCloseTime()\n        {\n            var model = new ImmediateFillModel();\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(config.Symbol.ID.Market, config.Symbol, config.SecurityType);\n            var security = new Security(\n                entry.ExchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var timeOffset = TimeSpan.FromSeconds(1);\n            var time = new DateTime(2025, 7, 8, 16, 0, 0);\n            // Set LocalTime to slightly after market close\n            var localTime = time + timeOffset - TimeSpan.FromTicks(1);\n            // Submit MOC order an hour before close\n            var order = new MarketOnCloseOrder(Symbols.SPY, -100, time.AddMinutes(-60));\n            var utcTime = localTime.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(utcTime, new[] { TimeZones.NewYork });\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            // Seed last regular bar\n            security.SetMarketPrice(new TradeBar(time - timeOffset, Symbols.SPY, 101.123m, 101.123m, 101.123m, 100, 100, timeOffset));\n\n            var fill = model.Fill(new FillModelParameters(\n                security,\n                order,\n                new MockSubscriptionDataConfigProvider(config),\n                Time.OneHour,\n                null)).Single();\n\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n        }\n\n        private static void AssertUnfilled(OrderEvent fill)\n        {\n            Assert.AreEqual(OrderStatus.None, fill.Status);\n            Assert.AreEqual(0, fill.FillQuantity);\n            Assert.AreEqual(0, fill.FillPrice);\n        }\n\n        private static void AssertFilled(OrderEvent fill, decimal expectedFillQuantity, decimal expectedFillPrice)\n        {\n            Assert.AreEqual(OrderStatus.Filled, fill.Status);\n            Assert.AreEqual(expectedFillQuantity, fill.FillQuantity);\n            Assert.AreEqual(expectedFillPrice, fill.FillPrice);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol, bool isInternal = false, bool extendedMarketHours = true,\n            Resolution resolution = Resolution.Minute)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, resolution, TimeZones.NewYork, TimeZones.NewYork, true, extendedMarketHours, isInternal);\n        }\n\n        private Security GetSecurity(SubscriptionDataConfig config)\n        {\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(config.Symbol.ID.Market, config.Symbol, config.SecurityType);\n            var security = new Security(\n                entry.ExchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            return security;\n        }\n\n        private class TestFillModel : FillModel\n        {\n            public void SetParameters(FillModelParameters parameters)\n            {\n                Parameters = parameters;\n            }\n\n            public Prices GetPricesPublic(Security asset, OrderDirection direction)\n            {\n                return base.GetPrices(asset, direction);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/LatestPriceFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture]\n    public class LatestPriceFillModelTests\n    {\n        private Symbol _symbol;\n        private QuoteBar _quote;\n        private TradeBar _trade;\n        private TestableLatestFillModel _fillModel;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            var time = new DateTime(2017, 1, 3, 0, 0, 0);\n            var nextTime = time.AddSeconds(1);\n            _symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase);\n\n            _quote = new QuoteBar(time, _symbol, new Bar(1, 1, 1, 1), 1, new Bar(2, 2, 2, 2), 2);\n            _trade = new TradeBar(nextTime, _symbol, 3, 3, 3, 3, 3);\n\n            _fillModel = new TestableLatestFillModel();\n        }\n\n        [Test]\n        public void LatestPriceFillModel_UsesLatestPrice()\n        {\n            var cryptoSecurity = CreateCrypto();\n            cryptoSecurity.Cache.AddData(_quote);\n            cryptoSecurity.Cache.AddData(_trade);\n\n            var price = _fillModel.GetPrices(cryptoSecurity, OrderDirection.Sell);\n\n            // Latest price comes from the TradeBar and its prices are $3\n            Assert.AreEqual(3, price.Open);\n            Assert.AreEqual(3, price.High);\n            Assert.AreEqual(3, price.Low);\n            Assert.AreEqual(3, price.Close);\n            Assert.AreEqual(3, price.Current);\n        }\n\n        [Test]\n        public void LatestPriceFillModel_NullTradeBar()\n        {\n            var cryptoSecurity = CreateCrypto();\n            cryptoSecurity.Cache.AddData(_quote);\n\n            var price = _fillModel.GetPrices(cryptoSecurity, OrderDirection.Sell);\n\n            // Bid prices are $1\n            Assert.AreEqual(1, price.Open);\n            Assert.AreEqual(1, price.High);\n            Assert.AreEqual(1, price.Low);\n            Assert.AreEqual(1, price.Close);\n            Assert.AreEqual(1, price.Current);\n        }\n\n        [Test]\n        public void LatestPriceFillModel_NullQuoteBar()\n        {\n            var cryptoSecurity = CreateCrypto();\n            cryptoSecurity.Cache.AddData(_trade);\n\n            var price = _fillModel.GetPrices(cryptoSecurity, OrderDirection.Sell);\n\n            // TradeBar prices are $3\n            Assert.AreEqual(3, price.Open);\n            Assert.AreEqual(3, price.High);\n            Assert.AreEqual(3, price.Low);\n            Assert.AreEqual(3, price.Close);\n            Assert.AreEqual(3, price.Current);\n        }\n\n        [Test]\n        public void LatestPriceFillModel_NoData()\n        {\n            var cryptoSecurity = CreateCrypto();\n\n            var price = _fillModel.GetPrices(cryptoSecurity, OrderDirection.Sell);\n\n            // Prices are not set: $0\n            Assert.AreEqual(0, price.Open);\n            Assert.AreEqual(0, price.High);\n            Assert.AreEqual(0, price.Low);\n            Assert.AreEqual(0, price.Close);\n            Assert.AreEqual(0, price.Current);\n        }\n\n        private Security CreateCrypto()\n        {\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    _symbol,\n                    Resolution.Second,\n                    TimeZones.Utc,\n                    TimeZones.Utc,\n                    true,\n                    true,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        internal class TestableLatestFillModel : LatestPriceFillModel\n        {\n            public TestableLatestFillModel()\n            {\n                // NOTE. GetPrices will no be called before SubscriptionDataConfigProvider is set by the system\n                Parameters = new FillModelParameters(null, null, new MockSubscriptionDataConfigProvider(), Time.OneHour, null);\n            }\n            public new Prices GetPrices(Security asset, OrderDirection direction)\n            {\n                return base.GetPrices(asset, direction);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Fills/PartialMarketFillModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine;\n\nnamespace QuantConnect.Tests.Common.Orders.Fills\n{\n    [TestFixture, Ignore(\"TODO: fix me\")]\n    public class PartialMarketFillModelTests\n    {\n        private static BacktestingTransactionHandler _transactionHandler;\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler?.Exit();\n        }\n\n        [Test]\n        public void CreatesSpecificNumberOfFills()\n        {\n            Security security;\n            MarketOrder order;\n            OrderTicket ticket;\n            PartialMarketFillModel model;\n            BasicTemplateAlgorithm algorithm;\n            var referenceTimeUtc = InitializeTest(out algorithm, out security, out model, out order, out ticket);\n\n            algorithm.SetDateTime(referenceTimeUtc.AddSeconds(1));\n\n            var fill1 = model.MarketFill(security, order);\n            ticket.AddOrderEvent(fill1);\n            Assert.AreEqual(order.Quantity / 2, fill1.FillQuantity);\n            Assert.AreEqual(OrderStatus.PartiallyFilled, fill1.Status);\n\n            algorithm.SetDateTime(referenceTimeUtc.AddSeconds(2));\n\n            var fill2 = model.MarketFill(security, order);\n            ticket.AddOrderEvent(fill2);\n            Assert.AreEqual(order.Quantity / 2, fill2.FillQuantity);\n            Assert.AreEqual(OrderStatus.Filled, fill2.Status);\n        }\n\n        [Test]\n        public void RequiresAdvancingTime()\n        {\n            Security security;\n            MarketOrder order;\n            OrderTicket ticket;\n            PartialMarketFillModel model;\n            BasicTemplateAlgorithm algorithm;\n            var referenceTimeUtc = InitializeTest(out algorithm, out security, out model, out order, out ticket);\n\n            var fill1 = model.MarketFill(security, order);\n            ticket.AddOrderEvent(fill1);\n            Assert.AreEqual(order.Quantity / 2, fill1.FillQuantity);\n            Assert.AreEqual(OrderStatus.PartiallyFilled, fill1.Status);\n\n            var fill2 = model.MarketFill(security, order);\n            ticket.AddOrderEvent(fill2);\n            Assert.AreEqual(0, fill2.FillQuantity);\n            Assert.AreEqual(OrderStatus.None, fill2.Status);\n\n            algorithm.SetDateTime(referenceTimeUtc.AddSeconds(1));\n\n            var fill3 = model.MarketFill(security, order);\n            ticket.AddOrderEvent(fill3);\n            Assert.AreEqual(order.Quantity / 2, fill3.FillQuantity);\n            Assert.AreEqual(OrderStatus.Filled, fill3.Status);\n        }\n\n        private static DateTime InitializeTest(out BasicTemplateAlgorithm algorithm, out Security security, out PartialMarketFillModel model, out MarketOrder order, out OrderTicket ticket)\n        {\n            var referenceTimeNY = new DateTime(2015, 12, 21, 13, 0, 0);\n            var referenceTimeUtc = referenceTimeNY.ConvertToUtc(TimeZones.NewYork);\n            algorithm = new BasicTemplateAlgorithm();\n            algorithm.SetDateTime(referenceTimeUtc);\n\n            _transactionHandler = new BacktestingTransactionHandler();\n            # pragma warning disable CA2000\n            var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            #pragma warning restore CA2000\n            _transactionHandler.Initialize(algorithm, backtestingBrokerage, new TestResultHandler(Console.WriteLine));\n\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            model = new PartialMarketFillModel(algorithm.Transactions, 2);\n\n            algorithm.Securities.Add(security);\n            algorithm.Securities[Symbols.SPY].FillModel = model;\n            security.SetMarketPrice(new Tick { Symbol = Symbols.SPY, Value = 100 });\n            algorithm.SetFinishedWarmingUp();\n\n            order = new MarketOrder(Symbols.SPY, 100, referenceTimeUtc) { Id = 1 };\n\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, algorithm.UtcTime, null);\n            ticket = algorithm.Transactions.ProcessRequest(request);\n            return referenceTimeUtc;\n        }\n\n        // Provides a test implementation that forces partial market order fills\n\n\n        /// <summary>\n        /// Provides an implementation of <see cref=\"IFillModel\"/> that creates a specific\n        /// number of partial fills for marke orders only. All other order types reuse the\n        /// <see cref=\"ImmediateFillModel\"/> behavior. This model will emit one partial fill\n        /// per time step.\n        /// NOTE: If the desired number of fills is very large, then a few more fills may be issued\n        /// due to rounding errors. This model does not hold internal state regarding orders/previous\n        /// fills.\n        /// </summary>\n        public class PartialMarketFillModel : ImmediateFillModel\n        {\n            private readonly decimal _percent;\n            private readonly IOrderProvider _orderProvider;\n\n            /// <summary>\n            /// Initializes a new instance of the <see cref=\"PartialMarketFillModel\"/> class\n            /// </summary>\n            /// <code>\n            /// // split market orders into two fills\n            /// Securities[\"SPY\"].FillModel = new PartialMarketFillModel(Transactions, 2);\n            /// </code>\n            /// <param name=\"orderProvider\">The order provider used for getting order tickets</param>\n            /// <param name=\"numberOfFills\"></param>\n            public PartialMarketFillModel(IOrderProvider orderProvider, int numberOfFills = 1)\n            {\n                _orderProvider = orderProvider;\n                _percent = 1m / numberOfFills;\n            }\n\n            /// <summary>\n            /// Performs partial market fills once per time step\n            /// </summary>\n            /// <param name=\"asset\">The security being ordered</param>\n            /// <param name=\"order\">The order</param>\n            /// <returns>The order fill</returns>\n            public override OrderEvent MarketFill(Security asset, MarketOrder order)\n            {\n                var currentUtcTime = asset.LocalTime.ConvertToUtc(asset.Exchange.TimeZone);\n\n                var ticket = _orderProvider.GetOrderTickets(x => x.OrderId == order.Id).FirstOrDefault();\n                if (ticket == null)\n                {\n                    // if we can't find the ticket issue empty fills\n                    return new OrderEvent(order, currentUtcTime, OrderFee.Zero);\n                }\n\n                // make sure some time has passed\n                var lastOrderEvent = ticket.OrderEvents.LastOrDefault();\n                var increment = TimeSpan.FromTicks(Math.Max(asset.Resolution.ToTimeSpan().Ticks, 1));\n                if (lastOrderEvent != null && currentUtcTime - lastOrderEvent.UtcTime < increment)\n                {\n                    // wait a minute between fills\n                    return new OrderEvent(order, currentUtcTime, OrderFee.Zero);\n                }\n\n                var remaining = (int)(ticket.Quantity - ticket.QuantityFilled);\n                var fill = base.MarketFill(asset, order);\n                var filledThisTime = Math.Min(remaining, (int)(_percent * order.Quantity));\n                fill.FillQuantity = filledThisTime;\n\n                // only mark it as filled if there is zero quantity remaining\n                fill.Status = remaining == filledThisTime\n                    ? OrderStatus.Filled\n                    : OrderStatus.PartiallyFilled;\n\n                return fill;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/GroupOrderExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2025 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class GroupOrderExtensionsTests\n    {\n        private static IEnumerable<TestCaseData> GroupQuantityTestCases\n        {\n            get\n            {\n                yield return new TestCaseData(CreateLegs(1), OrderDirection.Buy, 1).SetDescription(\"If brokerage returns already calculated quantity\");\n                yield return new TestCaseData(CreateLegs(-1), OrderDirection.Sell, -1).SetDescription(\"If brokerage returns already calculated quantity\");\n                yield return new TestCaseData(CreateLegs(1, -1), OrderDirection.Buy, 1).SetDescription(\"Bull Call Spread\");\n                yield return new TestCaseData(CreateLegs(-1, 1), OrderDirection.Sell, -1).SetDescription(\"Bear Call Spread\");\n                yield return new TestCaseData(CreateLegs(1, -2, 1), OrderDirection.Buy, 1).SetDescription(\"Bull Butterfly\");\n                yield return new TestCaseData(CreateLegs(-1, 2, -1), OrderDirection.Sell, -1).SetDescription(\"Bear Butterfly\");\n                yield return new TestCaseData(CreateLegs(1, 1), OrderDirection.Buy, 1).SetDescription(\"Bull Strangle\");\n                yield return new TestCaseData(CreateLegs(-1, -1), OrderDirection.Sell, -1).SetDescription(\"Bear Strangle\");\n                yield return new TestCaseData(CreateLegs(10, -20, 10), OrderDirection.Buy, 10);\n                yield return new TestCaseData(CreateLegs(-10, 20, -10), OrderDirection.Sell, -10);\n            }\n        }\n\n        [Test, TestCaseSource(nameof(GroupQuantityTestCases))]\n        public void GetGroupQuantityByEachLegQuantityShouldReturnExpectedGCD(Leg[] legs, OrderDirection direction, int expected)\n        {\n            var legQuantities = legs.Select(x => Convert.ToDecimal(x.Quantity));\n            var result = GroupOrderExtensions.GetGroupQuantityByEachLegQuantity(legQuantities, direction);\n            Assert.AreEqual(Convert.ToDecimal(expected), result);\n        }\n\n        private static Leg[] CreateLegs(params int[] quantities) => [.. quantities.Select(q => Leg.Create(null, q))];\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/OrderEventTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Serialization;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class OrderEventTests\n    {\n        [Test]\n        public void JsonIgnores()\n        {\n            var order = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.UtcNow);\n            var json = JsonConvert.SerializeObject(new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero),\n                new OrderEventJsonConverter(\"id\"));\n\n            Assert.IsFalse(json.Contains(\"Message\", StringComparison.InvariantCulture));\n            Assert.IsFalse(json.Contains(\"LimitPrice\", StringComparison.InvariantCulture));\n            Assert.IsFalse(json.Contains(\"StopPrice\", StringComparison.InvariantCulture));\n            Assert.IsFalse(json.Contains(value: \"IsInTheMoney\", StringComparison.InvariantCulture));\n\n            json = JsonConvert.SerializeObject(new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero, \"This is a message\")\n            {\n                LimitPrice = 1,\n                StopPrice = 2,\n                IsInTheMoney = true\n            });\n\n            Assert.IsTrue(json.Contains(\"Message\", StringComparison.InvariantCulture));\n            Assert.IsTrue(json.Contains(\"This is a message\", StringComparison.InvariantCulture));\n            Assert.IsTrue(json.Contains(\"LimitPrice\", StringComparison.InvariantCulture));\n            Assert.IsTrue(json.Contains(\"StopPrice\", StringComparison.InvariantCulture));\n            Assert.IsTrue(json.Contains(value: \"IsInTheMoney\", StringComparison.InvariantCulture));\n        }\n\n        [Test]\n        public void RoundTripSerialization([Values] bool isInTheMoney)\n        {\n            var order = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.UtcNow);\n            var orderEvent = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n            {\n                Message = \"Pepe\",\n                Status = OrderStatus.PartiallyFilled,\n                StopPrice = 1,\n                LimitPrice = 2,\n                FillPrice = 11,\n                FillQuantity = 12,\n                FillPriceCurrency = \"USD\",\n                Id = 55,\n                Quantity = 16,\n                IsInTheMoney = isInTheMoney\n            };\n\n            var converter = new OrderEventJsonConverter(\"id\");\n            var serializeObject = JsonConvert.SerializeObject(orderEvent, converter);\n\n            // OrderFee zero uses null currency and should be ignored when serializing\n            Assert.IsFalse(serializeObject.Contains(Currencies.NullCurrency, StringComparison.InvariantCulture));\n            Assert.IsFalse(serializeObject.Contains(\"order-fee-amount\", StringComparison.InvariantCulture));\n            Assert.IsFalse(serializeObject.Contains(\"order-fee-currency\", StringComparison.InvariantCulture));\n            Assert.AreEqual(isInTheMoney, serializeObject.Contains(\"isInTheMoney\", StringComparison.InvariantCulture));\n\n            var deserializeObject = JsonConvert.DeserializeObject<OrderEvent>(serializeObject, converter);\n\n            Assert.AreEqual(orderEvent.Symbol, deserializeObject.Symbol);\n            Assert.AreEqual(orderEvent.StopPrice, deserializeObject.StopPrice);\n            // there is a small loss of precision because we use double\n            Assert.AreEqual(orderEvent.UtcTime.Ticks, deserializeObject.UtcTime.Ticks, 200);\n            Assert.AreEqual(orderEvent.OrderId, deserializeObject.OrderId);\n            Assert.AreEqual(orderEvent.AbsoluteFillQuantity, deserializeObject.AbsoluteFillQuantity);\n            Assert.AreEqual(orderEvent.Direction, deserializeObject.Direction);\n            Assert.AreEqual(orderEvent.FillPrice, deserializeObject.FillPrice);\n            Assert.AreEqual(orderEvent.FillPriceCurrency, deserializeObject.FillPriceCurrency);\n            Assert.AreEqual(orderEvent.FillQuantity, deserializeObject.FillQuantity);\n            Assert.AreEqual(orderEvent.Id, deserializeObject.Id);\n            Assert.AreEqual(orderEvent.IsAssignment, deserializeObject.IsAssignment);\n            Assert.AreEqual(orderEvent.LimitPrice, deserializeObject.LimitPrice);\n            Assert.AreEqual(orderEvent.Message, deserializeObject.Message);\n            Assert.AreEqual(orderEvent.Quantity, deserializeObject.Quantity);\n            Assert.AreEqual(orderEvent.Status, deserializeObject.Status);\n            Assert.AreEqual(orderEvent.OrderFee.Value.Amount, deserializeObject.OrderFee.Value.Amount);\n            Assert.AreEqual(orderEvent.OrderFee.Value.Currency, deserializeObject.OrderFee.Value.Currency);\n            Assert.AreEqual(orderEvent.IsInTheMoney, deserializeObject.IsInTheMoney);\n        }\n\n        [Test]\n        public void NonNullOrderFee()\n        {\n            var order = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.UtcNow);\n            var orderEvent = new OrderEvent(order, DateTime.UtcNow, new OrderFee(new CashAmount(88, Currencies.USD)));\n\n            var converter = new OrderEventJsonConverter(\"id\");\n            var serializeObject = JsonConvert.SerializeObject(orderEvent, converter);\n            var deserializeObject = JsonConvert.DeserializeObject<OrderEvent>(serializeObject, converter);\n\n            Assert.IsFalse(serializeObject.Contains(\"order-fee-amount\", StringComparison.InvariantCulture));\n            Assert.IsFalse(serializeObject.Contains(\"order-fee-currency\", StringComparison.InvariantCulture));\n\n            Assert.IsTrue(serializeObject.Contains(\"orderFeeAmount\", StringComparison.InvariantCulture));\n            Assert.IsTrue(serializeObject.Contains(\"orderFeeCurrency\", StringComparison.InvariantCulture));\n\n            Assert.AreEqual(orderEvent.OrderFee.Value.Amount, deserializeObject.OrderFee.Value.Amount);\n            Assert.AreEqual(orderEvent.OrderFee.Value.Currency, deserializeObject.OrderFee.Value.Currency);\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ToString_AppendsIsAssignment_ForOptionSymbols(bool isAssignment)\n        {\n            var fill = new OrderEvent(1, Symbols.SPY_C_192_Feb19_2016, DateTime.Today, OrderStatus.New, OrderDirection.Buy, 1, 2, OrderFee.Zero, \"message\")\n            {\n                IsAssignment = isAssignment\n            };\n            StringAssert.EndsWith($\"IsAssignment: {isAssignment}\", fill.ToString());\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Cfd)]\n        [TestCase(SecurityType.Forex)]\n        [TestCase(SecurityType.Crypto)]\n        [TestCase(SecurityType.Future)]\n        public void ToString_DoesNotIncludeIsAssignment_ForNonOptionsSymbols(SecurityType type)\n        {\n            var symbol = Symbols.GetBySecurityType(type);\n            var fill = new OrderEvent(1, symbol, DateTime.Today, OrderStatus.New, OrderDirection.Buy, 1, 2, OrderFee.Zero, \"message\");\n            StringAssert.DoesNotContain(\"IsAssignment\", fill.ToString());\n        }\n\n        [Test]\n        public void BackwardsCompatibleDeserialization()\n        {\n            var serializeObject = \"{\\\"id\\\":\\\"id-0-0\\\",\\\"algorithm-id\\\":\\\"id\\\",\\\"order-id\\\":0,\\\"order-event-id\\\":0,\\\"symbol\\\":\\\"BTCUSD 2XR\\\",\\\"time\\\":1711565119.684036,\\\"status\\\":\\\"none\\\",\" +\n                \"\\\"order-fee-amount\\\":88.0,\\\"order-fee-currency\\\":\\\"USD\\\",\\\"fill-price\\\":0.0,\\\"fill-price-currency\\\":\\\"\\\",\\\"fill-quantity\\\":0.0,\\\"direction\\\":\\\"buy\\\",\\\"is-assignment\\\":false,\" +\n                \"\\\"quantity\\\":0.0}\";\n\n            var order = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.UtcNow);\n            var orderEvent = new OrderEvent(order, DateTime.UtcNow, new OrderFee(new CashAmount(88, Currencies.USD)));\n\n            var converter = new OrderEventJsonConverter(\"id\");\n            var deserializeObject = JsonConvert.DeserializeObject<OrderEvent>(serializeObject, converter);\n\n            // has the old version\n            Assert.IsTrue(serializeObject.Contains(\"order-fee-amount\", StringComparison.InvariantCulture));\n            Assert.IsTrue(serializeObject.Contains(\"order-fee-currency\", StringComparison.InvariantCulture));\n            Assert.IsFalse(serializeObject.Contains(\"orderFeeAmount\", StringComparison.InvariantCulture));\n            Assert.IsFalse(serializeObject.Contains(\"orderFeeCurrency\", StringComparison.InvariantCulture));\n\n            Assert.AreEqual(orderEvent.OrderFee.Value.Amount, deserializeObject.OrderFee.Value.Amount);\n            Assert.AreEqual(orderEvent.OrderFee.Value.Currency, deserializeObject.OrderFee.Value.Currency);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/OrderJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.TimeInForces;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class OrderJsonConverterTests\n    {\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesMarketOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new MarketOrder(Symbols.Lookup(key), 100, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesComboMarketOrder(Symbols.SymbolsKey key)\n        {\n            var groupOrderManager = new GroupOrderManager(1, 2, 10);\n            groupOrderManager.OrderIds.Add(12345);\n            groupOrderManager.OrderIds.Add(12346);\n\n            var expected = new ComboMarketOrder(Symbols.Lookup(key), 100, new DateTime(2015, 11, 23, 17, 15, 37), groupOrderManager, \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123457,\n                BrokerId = new List<string> { \"727\", \"54970\" }\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesComboLimitOrder(Symbols.SymbolsKey key)\n        {\n            var groupOrderManager = new GroupOrderManager(1, 2, 10);\n            groupOrderManager.OrderIds.Add(12345);\n            groupOrderManager.OrderIds.Add(12346);\n            groupOrderManager.LimitPrice = 201.1m;\n\n            var expected = new ComboLimitOrder(Symbols.Lookup(key), 100, 210.1m, new DateTime(2015, 11, 23, 17, 15, 37), groupOrderManager, \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123457,\n                BrokerId = new List<string> { \"727\", \"54970\" }\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesComboLegLimitOrder(Symbols.SymbolsKey key)\n        {\n            var groupOrderManager = new GroupOrderManager(1, 2, 10);\n            groupOrderManager.OrderIds.Add(12345);\n            groupOrderManager.OrderIds.Add(12346);\n\n            var expected = new ComboLegLimitOrder(Symbols.Lookup(key), 100, 210.1m, new DateTime(2015, 11, 23, 17, 15, 37), groupOrderManager, \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123457,\n                BrokerId = new List<string> { \"727\", \"54970\" }\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesMarketOnOpenOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new MarketOnOpenOrder(Symbols.Lookup(key), 100, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesMarketOnCloseOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new MarketOnCloseOrder(Symbols.Lookup(key), 100, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            TestOrderType(expected);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesLimitOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new LimitOrder(Symbols.Lookup(key), 100, 210.10m, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            var actual = TestOrderType(expected);\n\n            Assert.AreEqual(expected.LimitPrice, actual.LimitPrice);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesStopMarketOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new StopMarketOrder(Symbols.Lookup(key), 100, 210.10m, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            var actual = TestOrderType(expected);\n\n            Assert.AreEqual(expected.StopPrice, actual.StopPrice);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesTrailingStopOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new TrailingStopOrder(Symbols.Lookup(key), 100, 210.10m, 0.1m, true, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> { \"727\", \"54970\" }\n            };\n\n            var actual = TestOrderType(expected);\n\n            Assert.AreEqual(expected.StopPrice, actual.StopPrice);\n            Assert.AreEqual(expected.TrailingAmount, actual.TrailingAmount);\n            Assert.AreEqual(expected.TrailingAsPercentage, actual.TrailingAsPercentage);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesStopLimitOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new StopLimitOrder(Symbols.Lookup(key), 100, 210.10m, 200.23m, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            var actual = TestOrderType(expected);\n\n            Assert.AreEqual(expected.StopPrice, actual.StopPrice);\n            Assert.AreEqual(expected.LimitPrice, actual.LimitPrice);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY)]\n        [TestCase(Symbols.SymbolsKey.EURUSD)]\n        [TestCase(Symbols.SymbolsKey.BTCUSD)]\n        public void DeserializesLimitIfTouchedOrder(Symbols.SymbolsKey key)\n        {\n            var expected = new LimitIfTouchedOrder(Symbols.Lookup(key), 100, 210.10m, 200.23m, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                Price = 209.03m,\n                ContingentId = 123456,\n                BrokerId = new List<string> {\"727\", \"54970\"}\n            };\n\n            var actual = TestOrderType(expected);\n\n            Assert.AreEqual(expected.TriggerPrice, actual.TriggerPrice);\n            Assert.AreEqual(expected.LimitPrice, actual.LimitPrice);\n        }\n\n        [Test]\n        public void DeserializesOptionExpireOrder()\n        {\n            var expected = new OptionExerciseOrder(Symbols.SPY_P_192_Feb19_2016, 100, new DateTime(2015, 11, 23, 17, 15, 37), \"now\")\n            {\n                Id = 12345,\n                ContingentId = 123456,\n                BrokerId = new List<string> { \"727\", \"54970\" }\n            };\n\n            // Note: Order price equals strike price found in Symbol object\n            // Price = Symbol.ID.StrikePrice\n\n            TestOrderType(expected);\n        }\n\n        [Test]\n        public void DeserializesNullLastFillTimeAndLastUpdateTime()\n        {\n            const string json = @\"{\n    'Type': 4,\n    'Id': 1,\n    'ContingentId': 0,\n    'BrokerId': [\n        '1'\n    ],\n    'Symbol': {\n        'Value': 'SPY',\n        'ID': 'SPY R735QTJ8XC9X',\n        'Permtick': 'SPY'\n    },\n    'Price': 321.66,\n    'PriceCurrency': 'USD',\n    'Time': '2019-12-24T14:31:00Z',\n    'CreatedTime': '2019-12-24T14:31:00Z',\n    'LastUpdateTime': '2019-12-25T14:31:00Z',\n    'LastFillTime': null,\n    'Quantity': 1.0,\n    'Status': 3,\n    'TimeInForce': {},\n    'Tag': '',\n    'Properties': {\n        'TimeInForce': {}\n    },\n    'SecurityType': 1,\n    'Direction': 0,\n    'AbsoluteQuantity': 1.0,\n    'Value': 321.66,\n    'OrderSubmissionData': {\n        'BidPrice': 321.4700,\n        'AskPrice': 321.4700,\n        'LastPrice': 321.4700\n    },\n    'IsMarketable': false\n}\";\n\n            const string json2 = @\"{\n    'Type': 4,\n    'Id': 1,\n    'ContingentId': 0,\n    'BrokerId': [\n        '1'\n    ],\n    'Symbol': {\n        'Value': 'SPY',\n        'ID': 'SPY R735QTJ8XC9X',\n        'Permtick': 'SPY'\n    },\n    'Price': 321.66,\n    'PriceCurrency': 'USD',\n    'Time': '2019-12-24T14:31:00Z',\n    'CreatedTime': '2019-12-24T14:31:00Z',\n    'LastUpdateTime': null,\n    'LastFillTime': '2019-12-26T14:31:00Z',\n    'Quantity': 1.0,\n    'Status': 3,\n    'TimeInForce': {},\n    'Tag': '',\n    'Properties': {\n        'TimeInForce': {}\n    },\n    'SecurityType': 1,\n    'Direction': 0,\n    'AbsoluteQuantity': 1.0,\n    'Value': 321.66,\n    'OrderSubmissionData': {\n        'BidPrice': 321.4700,\n        'AskPrice': 321.4700,\n        'LastPrice': 321.4700\n    },\n    'IsMarketable': false\n}\";\n\n            var time = DateTime.SpecifyKind(new DateTime(2019, 12, 24, 14, 31, 0), DateTimeKind.Utc);\n            var fillTime = DateTime.SpecifyKind(new DateTime(2019, 12, 26, 14, 31, 0), DateTimeKind.Utc);\n            var updateTime = DateTime.SpecifyKind(new DateTime(2019, 12, 25, 14, 31, 0), DateTimeKind.Utc);\n\n            var expected1 = new MarketOnOpenOrder(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 1m, time)\n            {\n                Id = 1,\n                ContingentId = 0,\n                BrokerId = new List<string> { \"1\" },\n                Price = 321.66m,\n                PriceCurrency = \"USD\",\n                LastFillTime = null,\n                LastUpdateTime = updateTime,\n                Status = OrderStatus.Filled,\n                OrderSubmissionData = new OrderSubmissionData(321.47m, 321.47m, 321.47m),\n            };\n\n            var expected2 = new MarketOnOpenOrder(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 1m, time)\n            {\n                Id = 1,\n                ContingentId = 0,\n                BrokerId = new List<string> { \"1\" },\n                Price = 321.66m,\n                PriceCurrency = \"USD\",\n                LastFillTime = updateTime,\n                LastUpdateTime = null,\n                Status = OrderStatus.Filled,\n                OrderSubmissionData = new OrderSubmissionData(321.47m, 321.47m, 321.47m),\n            };\n\n\n            var actual1 = (MarketOnOpenOrder)DeserializeOrder<MarketOnOpenOrder>(json);\n            var actual2 = (MarketOnOpenOrder)DeserializeOrder<MarketOnOpenOrder>(json2);\n\n            TestOrderType(expected1);\n            TestOrderType(expected2);\n            TestOrderType(actual1);\n            TestOrderType(actual2);\n        }\n\n        [Test]\n        public void DeserializesStringStatusAndNullTime()\n        {\n            const string stringStatusJson = @\"{\n    'Type': 4,\n    'Id': 1,\n    'ContingentId': 0,\n    'BrokerId': [\n        '1'\n    ],\n    'Symbol': {\n        'Value': 'SPY',\n        'ID': 'SPY R735QTJ8XC9X',\n        'Permtick': 'SPY'\n    },\n    'Price': 321.66,\n    'PriceCurrency': 'USD',\n    'Time': '2019-12-24T14:31:00Z',\n    'CreatedTime': '2019-12-24T14:31:00Z',\n    'LastUpdateTime': '2019-12-25T14:31:00Z',\n    'LastFillTime': '2019-12-26T14:31:00Z',\n    'Quantity': 1.0,\n    'Status': 'filled',\n    'TimeInForce': {},\n    'Tag': '',\n    'Properties': {\n        'TimeInForce': {}\n    },\n    'SecurityType': 1,\n    'Direction': 0,\n    'AbsoluteQuantity': 1.0,\n    'Value': 321.66,\n    'OrderSubmissionData': {\n        'BidPrice': 321.4700,\n        'AskPrice': 321.4700,\n        'LastPrice': 321.4700\n    },\n    'IsMarketable': false\n}\";\n\n            const string nullTimeJson = @\"{\n    'Type': 4,\n    'Id': 1,\n    'ContingentId': 0,\n    'BrokerId': [\n        '1'\n    ],\n    'Symbol': {\n        'Value': 'SPY',\n        'ID': 'SPY R735QTJ8XC9X',\n        'Permtick': 'SPY'\n    },\n    'Price': 321.66,\n    'PriceCurrency': 'USD',\n    'Time': null,\n    'CreatedTime': '2019-12-24T14:31:00Z',\n    'LastUpdateTime': '2019-12-25T14:31:00Z',\n    'LastFillTime': '2019-12-26T14:31:00Z',\n    'Quantity': 1.0,\n    'Status': 3,\n    'TimeInForce': {},\n    'Tag': '',\n    'Properties': {\n        'TimeInForce': {}\n    },\n    'SecurityType': 1,\n    'Direction': 0,\n    'AbsoluteQuantity': 1.0,\n    'Value': 321.66,\n    'OrderSubmissionData': {\n        'BidPrice': 321.4700,\n        'AskPrice': 321.4700,\n        'LastPrice': 321.4700\n    },\n    'IsMarketable': false\n}\";\n\n            var time = DateTime.SpecifyKind(new DateTime(2019, 12, 24, 14, 31, 0), DateTimeKind.Utc);\n            var fillTime = DateTime.SpecifyKind(new DateTime(2019, 12, 26, 14, 31, 0), DateTimeKind.Utc);\n            var updateTime = DateTime.SpecifyKind(new DateTime(2019, 12, 25, 14, 31, 0), DateTimeKind.Utc);\n\n            var expected1 = new MarketOnOpenOrder(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 1m, time)\n            {\n                Id = 1,\n                ContingentId = 0,\n                BrokerId = new List<string> { \"1\" },\n                Price = 321.66m,\n                PriceCurrency = \"USD\",\n                LastFillTime = fillTime,\n                LastUpdateTime = updateTime,\n                Status = OrderStatus.Filled,\n                OrderSubmissionData = new OrderSubmissionData(321.47m, 321.47m, 321.47m),\n            };\n\n            var expected2 = new MarketOnOpenOrder(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 1m, time)\n            {\n                Id = 1,\n                ContingentId = 0,\n                BrokerId = new List<string> { \"1\" },\n                Price = 321.66m,\n                PriceCurrency = \"USD\",\n                LastFillTime = fillTime,\n                LastUpdateTime = updateTime,\n                Status = OrderStatus.Filled,\n                OrderSubmissionData = new OrderSubmissionData(321.47m, 321.47m, 321.47m),\n            };\n\n\n            var actual1 = (MarketOnOpenOrder)DeserializeOrder<MarketOnOpenOrder>(stringStatusJson);\n            var actual2 = (MarketOnOpenOrder)DeserializeOrder<MarketOnOpenOrder>(nullTimeJson);\n\n            TestOrderType(expected1);\n            TestOrderType(expected2);\n            TestOrderType(actual1);\n            TestOrderType(actual2);\n        }\n\n        [TestCase(\"Day\")]\n        [TestCase(\"GoodTilCanceled\")]\n        [TestCase(\"GoodTilDate\")]\n        public void RoundTripUsingJsonConverter(string  timeInForceStr)\n        {\n            TimeInForce timeInForce = null;\n            switch (timeInForceStr)\n            {\n                case \"Day\":\n                    timeInForce = TimeInForce.Day;\n                    break;\n                case \"GoodTilCanceled\":\n                    timeInForce = TimeInForce.GoodTilCanceled;\n                    break;\n                case \"GoodTilDate\":\n                    timeInForce = TimeInForce.GoodTilDate(DateTime.UtcNow);\n                    break;\n            }\n            var expected = new MarketOnOpenOrder(Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA), 1m, DateTime.UtcNow)\n            {\n                Id = 1,\n                ContingentId = 0,\n                BrokerId = new List<string> { \"1\" },\n                Price = 321.66m,\n                PriceCurrency = \"USD\",\n                LastFillTime = DateTime.UtcNow,\n                LastUpdateTime = DateTime.UtcNow,\n                CanceledTime = DateTime.UtcNow,\n                Status = OrderStatus.Filled,\n                OrderSubmissionData = new OrderSubmissionData(321.47m, 321.48m, 321.49m),\n                Properties = { TimeInForce = timeInForce },\n                PriceAdjustmentMode = DataNormalizationMode.Adjusted\n            };\n\n            var converter = new OrderJsonConverter();\n            var serialized = JsonConvert.SerializeObject(expected, converter);\n            var actual = JsonConvert.DeserializeObject<Order>(serialized, converter);\n\n            CollectionAssert.AreEqual(expected.BrokerId, actual.BrokerId);\n            Assert.AreEqual(expected.ContingentId, actual.ContingentId);\n            Assert.AreEqual(expected.Direction, actual.Direction);\n            Assert.AreEqual(expected.TimeInForce.GetType(), actual.TimeInForce.GetType());\n            Assert.AreEqual(expected.Id, actual.Id);\n            Assert.AreEqual(expected.Price, actual.Price);\n            Assert.AreEqual(expected.PriceCurrency, actual.PriceCurrency);\n            Assert.AreEqual(expected.SecurityType, actual.SecurityType);\n            Assert.AreEqual(expected.Status, actual.Status);\n            Assert.AreEqual(expected.Symbol, actual.Symbol);\n            Assert.AreEqual(expected.Tag, actual.Tag);\n            Assert.AreEqual(expected.Time, actual.Time);\n            Assert.AreEqual(expected.CreatedTime, actual.CreatedTime);\n            Assert.AreEqual(expected.LastFillTime, actual.LastFillTime);\n            Assert.AreEqual(expected.LastUpdateTime, actual.LastUpdateTime);\n            Assert.AreEqual(expected.CanceledTime, actual.CanceledTime);\n            Assert.AreEqual(expected.Type, actual.Type);\n            Assert.AreEqual(expected.Value, actual.Value);\n            Assert.AreEqual(expected.Quantity, actual.Quantity);\n            Assert.AreEqual(expected.TimeInForce.GetType(), actual.TimeInForce.GetType());\n            Assert.AreEqual(expected.Symbol.ID.Market, actual.Symbol.ID.Market);\n            Assert.AreEqual(expected.OrderSubmissionData.AskPrice, actual.OrderSubmissionData.AskPrice);\n            Assert.AreEqual(expected.OrderSubmissionData.BidPrice, actual.OrderSubmissionData.BidPrice);\n            Assert.AreEqual(expected.OrderSubmissionData.LastPrice, actual.OrderSubmissionData.LastPrice);\n            Assert.AreEqual(expected.PriceAdjustmentMode, actual.PriceAdjustmentMode);\n        }\n\n        [Test]\n        public void DeserializesOldSymbol()\n        {\n            const string json = @\"{'Type':0,\n'Value':99986.827413672,\n'Id':1,\n'ContingentId':0,\n'BrokerId':[1],\n'Symbol':{'Value':'SPY',\n'Permtick':'SPY'},\n'Price':100.086914328,\n'Time':'2010-03-04T14:31:00Z',\n'Quantity':999,\n'Status':3,\n'TimeInForce':0,\n'Tag':'',\n'SecurityType':1,\n'Direction':0,\n'AbsoluteQuantity':999}\";\n\n\n            var order = DeserializeOrder<MarketOrder>(json);\n            var actual = order.Symbol;\n\n            Assert.AreEqual(Symbols.SPY, actual);\n            Assert.AreEqual(Market.USA, actual.ID.Market);\n        }\n\n        [Test]\n        public void WorksWithJsonConvert()\n        {\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = {new OrderJsonConverter()}\n            };\n\n            const string json = @\"{'Type':0,\n'Value':99986.827413672,\n'Id':1,\n'ContingentId':0,\n'BrokerId':[1],\n'Symbol':{'Value':'SPY',\n'Permtick':'SPY'},\n'Price':100.086914328,\n'Time':'2010-03-04T14:31:00Z',\n'Quantity':999,\n'Status':3,\n'TimeInForce':1,\n'Tag':'',\n'SecurityType':1,\n'Direction':0,\n'AbsoluteQuantity':999}\";\n\n            var order = JsonConvert.DeserializeObject<Order>(json);\n            Assert.IsInstanceOf<MarketOrder>(order);\n            Assert.AreEqual(Market.USA, order.Symbol.ID.Market);\n            Assert.IsTrue(order.TimeInForce is DayTimeInForce);\n        }\n\n        [Test]\n        public void DeserializesOldDurationProperty()\n        {\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = { new OrderJsonConverter() }\n            };\n\n            // The Duration property has been renamed to TimeInForce,\n            // we still want to deserialize old JSON files containing Duration.\n            const string json = @\"{'Type':0,\n'Value':99986.827413672,\n'Id':1,\n'ContingentId':0,\n'BrokerId':[1],\n'Symbol':{'Value':'SPY',\n'Permtick':'SPY'},\n'Price':100.086914328,\n'Time':'2010-03-04T14:31:00Z',\n'Quantity':999,\n'Status':3,\n'Duration':1,\n'Tag':'',\n'SecurityType':1,\n'Direction':0,\n'AbsoluteQuantity':999}\";\n\n            var order = JsonConvert.DeserializeObject<Order>(json);\n            Assert.IsInstanceOf<MarketOrder>(order);\n            Assert.AreEqual(Market.USA, order.Symbol.ID.Market);\n            Assert.IsTrue(order.TimeInForce is DayTimeInForce);\n        }\n\n        [Test]\n        public void DeserializesOldDurationValueProperty()\n        {\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = { new OrderJsonConverter() }\n            };\n\n            // The DurationValue property has been moved to GoodTilDateTimeInforce.Expiry,\n            // we still want to deserialize old JSON files containing Duration.\n            const string json = @\"{'Type':0,\n'Value':99986.827413672,\n'Id':1,\n'ContingentId':0,\n'BrokerId':[1],\n'Symbol':{'Value':'SPY',\n'Permtick':'SPY'},\n'Price':100.086914328,\n'Time':'2010-03-04T14:31:00Z',\n'Quantity':999,\n'Status':3,\n'Duration':2,\n'DurationValue':'2010-04-04T14:31:00Z',\n'Tag':'',\n'SecurityType':1,\n'Direction':0,\n'AbsoluteQuantity':999}\";\n\n            var order = JsonConvert.DeserializeObject<Order>(json);\n            Assert.IsInstanceOf<MarketOrder>(order);\n            Assert.AreEqual(Market.USA, order.Symbol.ID.Market);\n            Assert.IsTrue(order.TimeInForce is GoodTilDateTimeInForce);\n\n            var timeInForce = (GoodTilDateTimeInForce)order.TimeInForce;\n            Assert.AreEqual(new DateTime(2010, 4, 4, 14, 31, 0), timeInForce.Expiry);\n        }\n\n        [Test]\n        public void DeserializesDecimalizedQuantity()\n        {\n            var expected = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today);\n            TestOrderType(expected);\n        }\n\n        [Test]\n        public void DeserializesOrderGoodTilCanceledTimeInForce()\n        {\n            var orderProperties = new OrderProperties { TimeInForce = TimeInForce.GoodTilCanceled };\n            var expected = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today, \"\", orderProperties);\n            TestOrderType(expected);\n        }\n\n        [Test]\n        public void DeserializesOrderDayTimeInForce()\n        {\n            var orderProperties = new OrderProperties { TimeInForce = TimeInForce.Day };\n            var expected = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today, \"\", orderProperties);\n            TestOrderType(expected);\n        }\n\n        [Test]\n        public void DeserializesOrderGoodTilDateTimeInForce()\n        {\n            var expiry = new DateTime(2018, 5, 26);\n            var orderProperties = new OrderProperties { TimeInForce = TimeInForce.GoodTilDate(expiry) };\n            var expected = new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today, \"\", orderProperties);\n            TestOrderType(expected);\n\n            var json = JsonConvert.SerializeObject(expected);\n            var actual = DeserializeOrder<MarketOrder>(json);\n\n            var gtd = (GoodTilDateTimeInForce)actual.Properties.TimeInForce;\n            Assert.AreEqual(expiry, gtd.Expiry);\n        }\n\n        [Test]\n        public void JsonIgnores()\n        {\n            var json = JsonConvert.SerializeObject(new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today));\n\n            Assert.IsFalse(json.Contains(\"Tag\"));\n            Assert.IsFalse(json.Contains(\"AbsoluteQuantity\"));\n\n            json = JsonConvert.SerializeObject(new MarketOrder(Symbols.BTCUSD, 0.123m, DateTime.Today, \"This is a Tag\"));\n\n            Assert.IsTrue(json.Contains(\"Tag\"));\n            Assert.IsTrue(json.Contains(\"This is a Tag\"));\n        }\n\n        [Test]\n        public void TimeInForceInProperties()\n        {\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = { new OrderJsonConverter() }\n            };\n\n            const string json = @\"{'Type':0,\n'Value':99986.827413672,\n'Id':1,\n'ContingentId':0,\n'BrokerId':[1],\n'Symbol':{'Value':'SPY',\n'Permtick':'SPY'},\n'Price':100.086914328,\n'Time':'2010-03-04T14:31:00Z',\n'Quantity':999,\n'Status':3,\n'Properties': {\n    'TimeInForce': 1\n},\n'Tag':'',\n'SecurityType':1,\n'Direction':0,\n'AbsoluteQuantity':999}\";\n\n            var order = JsonConvert.DeserializeObject<Order>(json);\n            Assert.IsInstanceOf<MarketOrder>(order);\n            Assert.AreEqual(Market.USA, order.Symbol.ID.Market);\n            Assert.IsTrue(order.TimeInForce is DayTimeInForce);\n        }\n\n        private static T TestOrderType<T>(T expected)\n            where T : Order\n        {\n            var json = JsonConvert.SerializeObject(expected);\n\n            var actual = DeserializeOrder<T>(json);\n\n            Assert.IsInstanceOf<T>(actual);\n            Assert.AreEqual(expected.AbsoluteQuantity, actual.AbsoluteQuantity);\n            CollectionAssert.AreEqual(expected.BrokerId, actual.BrokerId);\n            Assert.AreEqual(expected.ContingentId, actual.ContingentId);\n            Assert.AreEqual(expected.Direction, actual.Direction);\n            Assert.AreEqual(expected.TimeInForce.GetType(), actual.TimeInForce.GetType());\n            Assert.AreEqual(expected.Id, actual.Id);\n            Assert.AreEqual(expected.Price, actual.Price);\n            Assert.AreEqual(expected.SecurityType, actual.SecurityType);\n            Assert.AreEqual(expected.Status, actual.Status);\n            Assert.AreEqual(expected.Symbol, actual.Symbol);\n            Assert.AreEqual(expected.Tag, actual.Tag);\n            Assert.AreEqual(expected.Time, actual.Time);\n            Assert.AreEqual(expected.LastFillTime, actual.LastFillTime);\n            Assert.AreEqual(expected.LastUpdateTime, actual.LastUpdateTime);\n            Assert.AreEqual(expected.Type, actual.Type);\n            Assert.AreEqual(expected.Value, actual.Value);\n            Assert.AreEqual(expected.Quantity, actual.Quantity);\n            Assert.AreEqual(expected.Symbol.ID.Market, actual.Symbol.ID.Market);\n\n            TestGroupOrderManager(expected.GroupOrderManager, actual.GroupOrderManager);\n\n            return (T) actual;\n        }\n\n        private static void TestGroupOrderManager(GroupOrderManager expected, GroupOrderManager actual)\n        {\n            if (expected == null)\n            {\n                Assert.IsNull(actual);\n                return;\n            }\n\n            Assert.IsNotNull(actual);\n            Assert.AreEqual(expected.Id, actual.Id);\n            Assert.AreEqual(expected.Quantity, actual.Quantity);\n            Assert.AreEqual(expected.Count, actual.Count);\n            Assert.AreEqual(expected.LimitPrice, actual.LimitPrice);\n            Assert.AreEqual(expected.Direction, actual.Direction);\n            CollectionAssert.AreEqual(expected.OrderIds, actual.OrderIds);\n        }\n\n        private static Order DeserializeOrder<T>(string json) where T : Order\n        {\n            var converter = new OrderJsonConverter();\n            using var reader = new JsonTextReader(new StringReader(json));\n            var jsonSerializer = new JsonSerializer();\n            jsonSerializer.Converters.Add(converter);\n            var actual = jsonSerializer.Deserialize<Order>(reader);\n            return actual;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/OrderSizingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Algorithm;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class OrderSizingTests\n    {\n        [TestCase(0.98, 0)]\n        [TestCase(-0.98, 0)]\n        [TestCase(0.9999999, 1)]\n        [TestCase(-0.9999999, -1)]\n        public void AdjustByLotSize(decimal quantity, decimal expected)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddEquity(Symbols.SPY.Value);\n\n            var result = OrderSizing.AdjustByLotSize(security, quantity);\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void GetOrderSizeForPercentVolume()\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddFutureContract(Symbols.Future_CLF19_Jan2019);\n            security.SetMarketPrice(new TradeBar { Value = 250, Volume = 10});\n\n            var result = OrderSizing.GetOrderSizeForPercentVolume(security, 0.5m, 100);\n            Assert.AreEqual(5, result);\n        }\n\n        [TestCase(100000, 100, 0)]\n        [TestCase(1000000, 100, 4)]\n        [TestCase(1000000, 1, 1)]\n        [TestCase(1000000, -1, -1)]\n        public void GetOrderSizeForMaximumValue(decimal maximumOrderValue, decimal target, decimal expected)\n        {\n            var algo = new AlgorithmStub();\n            var security = algo.AddFutureContract(Symbols.Future_CLF19_Jan2019);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n\n            var result = OrderSizing.GetOrderSizeForMaximumValue(security, maximumOrderValue, target);\n\n            var expectedCalculated = maximumOrderValue / (security.Price * security.SymbolProperties.ContractMultiplier);\n            expectedCalculated -= expectedCalculated % security.SymbolProperties.LotSize;\n\n            Assert.AreEqual(Math.Min(expectedCalculated, Math.Abs(target)) * Math.Sign(target), result);\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(2, 1, -1)]\n        [TestCase(-2, -1, 1)]\n        [TestCase(1, 1, 0)]\n        [TestCase(0, 1, 1)]\n        [TestCase(1, 2, 1)]\n        [TestCase(-1, 2, 3)]\n        [TestCase(1, -1, -2)]\n        [TestCase(-1, -2, -1)]\n        [TestCase(0, -1, -1)]\n        [TestCase(-1, -1, 0)]\n        public void GetUnorderedQuantityHoldingsNoOrders(decimal holdings, decimal target, decimal expected)\n        {\n            var algo = new AlgorithmStub();\n            algo.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var security = algo.AddFutureContract(Symbols.Future_CLF19_Jan2019);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n            security.Holdings.SetHoldings(250, holdings);\n\n            var result = OrderSizing.GetUnorderedQuantity(algo,\n                new PortfolioTarget(Symbols.Future_CLF19_Jan2019, target));\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(-1, -2, -1, -3, 0)]\n        [TestCase(-1, -3, -1, -3, 1)]\n        [TestCase(-1, -2, -1, -4, -1)]\n        [TestCase(1, 2, 1, 3, 0)]\n        [TestCase(1, 3, 1, 3, -1)]\n        [TestCase(1, 2, 1, 4, 1)]\n        [TestCase(2, 2, 1, 10, 6)]\n        [TestCase(2, 2, 1, -10, -14)]\n        public void GetUnorderedQuantityHoldingsOpenOrders(decimal existingHoldings, decimal orderQuantity,\n            decimal filledQuantity, decimal target, decimal expected)\n        {\n            var algo = new AlgorithmStub();\n\n            var security = algo.AddFutureContract(Symbols.Future_CLF19_Jan2019);\n            security.SetMarketPrice(new TradeBar { Value = 250 });\n            security.Holdings.SetHoldings(250, existingHoldings);\n\n            var orderProcessor = new BrokerageTransactionHandler();\n            using var brokerage = new NullBrokerage();\n            orderProcessor.Initialize(algo, brokerage, new BacktestingResultHandler());\n            \n            try\n            {\n                algo.Transactions.SetOrderProcessor(orderProcessor);\n\n                var orderRequest = new SubmitOrderRequest(\n                        OrderType.Market,\n                        SecurityType.Future,\n                        Symbols.Future_CLF19_Jan2019,\n                        orderQuantity,\n                        250,\n                        250,\n                        new DateTime(2020, 1, 1),\n                        \"Pepe\"\n                    );\n                orderRequest.SetOrderId(1);\n                var order = Order.CreateOrder(orderRequest);\n                orderProcessor.AddOpenOrder(order, algo);\n\n                brokerage.OnOrderEvent(new OrderEvent(1,\n                    Symbols.Future_CLF19_Jan2019,\n                    new DateTime(2020, 1, 1),\n                    OrderStatus.PartiallyFilled,\n                    filledQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell,\n                    250,\n                    filledQuantity,\n                    OrderFee.Zero));\n\n                var result = OrderSizing.GetUnorderedQuantity(algo,\n                    new PortfolioTarget(Symbols.Future_CLF19_Jan2019, target));\n\n                Assert.AreEqual(expected, result);\n            }\n            finally\n            {\n                orderProcessor.Exit();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/OrderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Cfd;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class OrderTests\n    {\n        [Test, TestCaseSource(nameof(GetValueTestParameters))]\n        public void GetValueTest(ValueTestParameters parameters)\n        {\n            // By default the price for option exercise orders is 0, so we need to set it to the strike price\n            if (parameters.Order.Type == OrderType.OptionExercise)\n            {\n                parameters.Order.Price = parameters.Order.Symbol.ID.StrikePrice;\n            }\n\n            var value = parameters.Order.GetValue(parameters.Security);\n            Assert.AreEqual(parameters.ExpectedValue, value);\n        }\n\n        [TestCase(OrderDirection.Sell, 300, 0.1, true, 270)]\n        [TestCase(OrderDirection.Sell, 300, 30, false, 270)]\n        [TestCase(OrderDirection.Buy, 300, 0.1, true, 330)]\n        [TestCase(OrderDirection.Buy, 300, 30, false, 330)]\n        public void TrailingStopOrder_CalculatesStopPrice(OrderDirection direction, decimal marketPrice, decimal trailingAmount,\n            bool trailingAsPercentage, decimal expectedStopPrice)\n        {\n            var stopPrice = TrailingStopOrder.CalculateStopPrice(marketPrice, trailingAmount, trailingAsPercentage, direction);\n            Assert.AreEqual(expectedStopPrice, stopPrice);\n        }\n\n        [TestCase(OrderDirection.Sell, 269, 300, 0.1, true, 270)]\n        [TestCase(OrderDirection.Sell, 270, 300, 0.1, true, null)]\n        [TestCase(OrderDirection.Sell, 269, 300, 30, false, 270)]\n        [TestCase(OrderDirection.Sell, 270, 300, 30, false, null)]\n        [TestCase(OrderDirection.Buy, 331, 300, 0.1, true, 330)]\n        [TestCase(OrderDirection.Buy, 330, 300, 0.1, true, null)]\n        [TestCase(OrderDirection.Buy, 331, 300, 30, false, 330)]\n        [TestCase(OrderDirection.Buy, 330, 300, 30, false, null)]\n        public void TrailingStopOrder_UpdatesStopPriceIfNecessary(OrderDirection direction, decimal currentStopPrice, decimal marketPrice,\n            decimal trailingAmount, bool trailingAsPercentage, decimal? expectedStopPrice)\n        {\n            var updated = TrailingStopOrder.TryUpdateStopPrice(marketPrice, currentStopPrice, trailingAmount, trailingAsPercentage, direction,\n                out var updatedStopPrice);\n\n            if (expectedStopPrice.HasValue)\n            {\n                Assert.IsTrue(updated);\n                Assert.AreEqual(expectedStopPrice.Value, updatedStopPrice);\n            }\n            else\n            {\n                Assert.IsFalse(updated);\n            }\n        }\n\n        private static TestCaseData[] GetValueTestParameters()\n        {\n            const decimal delta = 1m;\n            const decimal price = 1.2345m;\n            const int quantity = 100;\n            const decimal pricePlusDelta = price + delta;\n            const decimal priceMinusDelta = price - delta;\n            var tz = TimeZones.NewYork;\n\n            var time = new DateTime(2016, 2, 4, 16, 0, 0).ConvertToUtc(tz);\n\n            var equity = new Equity(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            equity.SetMarketPrice(new Tick {Value = price});\n\n            var gbpCash = new Cash(\"GBP\", 0, 1.46m);\n            var properties = SymbolProperties.GetDefault(gbpCash.Symbol);\n            var forex = new Forex(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                gbpCash,\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURGBP, Resolution.Minute, tz, tz, true, false, false),\n                properties,\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            forex.SetMarketPrice(new Tick {Value= price});\n\n            var eurCash = new Cash(\"EUR\", 0, 1.12m);\n            properties = new SymbolProperties(\"Euro-Bund\", eurCash.Symbol, 10, 0.1m, 1, string.Empty);\n            var cfd = new Cfd(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                eurCash,\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.DE10YBEUR, Resolution.Minute, tz, tz, true, false, false),\n                properties,\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            cfd.SetMarketPrice(new Tick { Value = price });\n            var multiplierTimesConversionRate = properties.ContractMultiplier*eurCash.ConversionRate;\n\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY_P_192_Feb19_2016,\n                    Resolution.Minute,\n                    tz,\n                    tz,\n                    true,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            option.SetMarketPrice(new Tick { Value = price });\n\n            return new List<ValueTestParameters>\n            {\n                // equity orders\n                new ValueTestParameters(\"EquityLongMarketOrder\", equity, new MarketOrder(Symbols.SPY, quantity, time), quantity*price),\n                new ValueTestParameters(\"EquityShortMarketOrder\", equity, new MarketOrder(Symbols.SPY, -quantity, time), -quantity*price),\n                new ValueTestParameters(\"EquityLongLimitOrder\", equity, new LimitOrder(Symbols.SPY, quantity, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"EquityShortLimit Order\", equity, new LimitOrder(Symbols.SPY, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"EquityLongStopLimitOrder\", equity, new StopLimitOrder(Symbols.SPY, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"EquityShortStopLimitOrder\", equity, new StopLimitOrder(Symbols.SPY, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"EquityLongStopMarketOrder\", equity, new StopMarketOrder(Symbols.SPY, quantity, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"EquityLongStopMarketOrder\", equity, new StopMarketOrder(Symbols.SPY, quantity, pricePlusDelta, time), quantity*price),\n                new ValueTestParameters(\"EquityShortStopMarketOrder\", equity, new StopMarketOrder(Symbols.SPY, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"EquityShortStopMarketOrder\", equity, new StopMarketOrder(Symbols.SPY, -quantity, priceMinusDelta, time), -quantity*price),\n                new ValueTestParameters(\"EquityLongTrailingStopOrderPriceMinusDelta\", equity, new TrailingStopOrder(Symbols.SPY, quantity, priceMinusDelta, 0.1m, true, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"EquityLongTrailingStopOrderPricePlusDelta\", equity, new TrailingStopOrder(Symbols.SPY, quantity, pricePlusDelta, 0.1m, true, time), quantity*price),\n                new ValueTestParameters(\"EquityShortTrailingStopOrderPricePlusDelta\", equity, new TrailingStopOrder(Symbols.SPY, -quantity, pricePlusDelta, 0.1m, true, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"EquityShortTrailingStopOrderPriceMinusDelta\", equity, new TrailingStopOrder(Symbols.SPY, -quantity, priceMinusDelta, 0.1m, true, time), -quantity*price),\n                new ValueTestParameters(\"EquityLongLimitIfTouchedOrder\", equity, new LimitIfTouchedOrder(Symbols.SPY, quantity, 1.5m*pricePlusDelta, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"EquityShortLimitIfTouchedOrder\", equity, new LimitIfTouchedOrder(Symbols.SPY, -quantity, .5m*priceMinusDelta, pricePlusDelta, time), -quantity*pricePlusDelta),\n\n                // forex orders\n                new ValueTestParameters(\"ForexLongMarketOrder\", forex, new MarketOrder(Symbols.EURGBP, quantity, time), quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortMarketOrder\", forex, new MarketOrder(Symbols.EURGBP, -quantity, time), -quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongLimitOrder\", forex, new LimitOrder(Symbols.EURGBP, quantity, priceMinusDelta, time), quantity*priceMinusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortLimit Order\", forex, new LimitOrder(Symbols.EURGBP, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongStopLimitOrder\", forex, new StopLimitOrder(Symbols.EURGBP, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortStopLimitOrder\", forex, new StopLimitOrder(Symbols.EURGBP, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time), -quantity*pricePlusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongStopMarketOrder\", forex, new StopMarketOrder(Symbols.EURGBP, quantity, priceMinusDelta, time), quantity*priceMinusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongStopMarketOrder\", forex, new StopMarketOrder(Symbols.EURGBP, quantity, pricePlusDelta, time), quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortStopMarketOrder\", forex, new StopMarketOrder(Symbols.EURGBP, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortStopMarketOrder\", forex, new StopMarketOrder(Symbols.EURGBP, -quantity, priceMinusDelta, time), -quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongTrailingStopOrderPriceMinusDelta\", forex, new TrailingStopOrder(Symbols.EURGBP, quantity, priceMinusDelta, 0.1m, true, time), quantity*priceMinusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongTrailingStopOrderPricePlusDelta\", forex, new TrailingStopOrder(Symbols.EURGBP, quantity, pricePlusDelta, 0.1m, true, time), quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortTrailingStopOrderPricePlusDelta\", forex, new TrailingStopOrder(Symbols.EURGBP, -quantity, pricePlusDelta, 0.1m, true, time), -quantity*pricePlusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortTrailingStopOrderPriceMinusDelta\", forex, new TrailingStopOrder(Symbols.EURGBP, -quantity, priceMinusDelta, 0.1m, true, time), -quantity*price*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexLongLimitIfTouchedOrder\", forex, new LimitIfTouchedOrder(Symbols.EURGBP, quantity,1.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta*forex.QuoteCurrency.ConversionRate),\n                new ValueTestParameters(\"ForexShortLimitIfTouchedOrder\", forex, new LimitIfTouchedOrder(Symbols.EURGBP, -quantity, .5m*pricePlusDelta, pricePlusDelta, time), -quantity*pricePlusDelta*forex.QuoteCurrency.ConversionRate),\n\n                // cfd orders\n                new ValueTestParameters(\"CfdLongMarketOrder\", cfd, new MarketOrder(Symbols.DE10YBEUR, quantity, time), quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortMarketOrder\", cfd, new MarketOrder(Symbols.DE10YBEUR, -quantity, time), -quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongLimitOrder\", cfd, new LimitOrder(Symbols.DE10YBEUR, quantity, priceMinusDelta, time), quantity*priceMinusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortLimit Order\", cfd, new LimitOrder(Symbols.DE10YBEUR, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongStopLimitOrder\", cfd, new StopLimitOrder(Symbols.DE10YBEUR, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortStopLimitOrder\", cfd, new StopLimitOrder(Symbols.DE10YBEUR, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time), -quantity*pricePlusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongStopMarketOrder\", cfd, new StopMarketOrder(Symbols.DE10YBEUR, quantity, priceMinusDelta, time), quantity*priceMinusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongStopMarketOrder\", cfd, new StopMarketOrder(Symbols.DE10YBEUR, quantity, pricePlusDelta, time), quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortStopMarketOrder\", cfd, new StopMarketOrder(Symbols.DE10YBEUR, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortStopMarketOrder\", cfd, new StopMarketOrder(Symbols.DE10YBEUR, -quantity, priceMinusDelta, time), -quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongTrailingStopOrderPriceMinusDelta\", cfd, new TrailingStopOrder(Symbols.DE10YBEUR, quantity, priceMinusDelta, 0.1m, true, time), quantity*priceMinusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongTrailingStopOrderPricePlusDelta\", cfd, new TrailingStopOrder(Symbols.DE10YBEUR, quantity, pricePlusDelta, 0.1m, true, time), quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortTrailingStopOrderPricePlusDelta\", cfd, new TrailingStopOrder(Symbols.DE10YBEUR, -quantity, pricePlusDelta, 0.1m, true, time), -quantity*pricePlusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortTrailingStopOrderPriceMinusDelta\", cfd, new TrailingStopOrder(Symbols.DE10YBEUR, -quantity, priceMinusDelta, 0.1m, true, time), -quantity*price*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdShortLimitIfTouchedOrder\", cfd, new LimitIfTouchedOrder(Symbols.DE10YBEUR, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time), -quantity*pricePlusDelta*multiplierTimesConversionRate),\n                new ValueTestParameters(\"CfdLongLimitIfTouchedOrder\", cfd, new LimitIfTouchedOrder(Symbols.DE10YBEUR, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta*multiplierTimesConversionRate),\n\n\n                // equity/index option orders\n                new ValueTestParameters(\"OptionLongMarketOrder\", option, new MarketOrder(Symbols.SPY_P_192_Feb19_2016, quantity, time), quantity*price),\n                new ValueTestParameters(\"OptionShortMarketOrder\", option, new MarketOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, time), -quantity*price),\n                new ValueTestParameters(\"OptionLongLimitOrder\", option, new LimitOrder(Symbols.SPY_P_192_Feb19_2016, quantity, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"OptionShortLimit Order\", option, new LimitOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"OptionLongStopLimitOrder\", option, new StopLimitOrder(Symbols.SPY_P_192_Feb19_2016, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"OptionShortStopLimitOrder\", option, new StopLimitOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time),  -quantity*pricePlusDelta),\n                new ValueTestParameters(\"OptionLongStopMarketOrder\", option, new StopMarketOrder(Symbols.SPY_P_192_Feb19_2016, quantity, priceMinusDelta, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"OptionLongStopMarketOrder\", option, new StopMarketOrder(Symbols.SPY_P_192_Feb19_2016, quantity, pricePlusDelta, time), quantity*price),\n                new ValueTestParameters(\"OptionShortStopMarketOrder\", option, new StopMarketOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, pricePlusDelta, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"OptionShortStopMarketOrder\", option, new StopMarketOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, priceMinusDelta, time), -quantity*price),\n                new ValueTestParameters(\"OptionLongTrailingStopOrdePriceMinusDeltar\", option, new TrailingStopOrder(Symbols.SPY_P_192_Feb19_2016, quantity, priceMinusDelta, 0.1m, true, time), quantity*priceMinusDelta),\n                new ValueTestParameters(\"OptionLongTrailingStopOrderPricePlusDelta\", option, new TrailingStopOrder(Symbols.SPY_P_192_Feb19_2016, quantity, pricePlusDelta, 0.1m, true, time), quantity*price),\n                new ValueTestParameters(\"OptionShortTrailingStopOrderPricePlusDelta\", option, new TrailingStopOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, pricePlusDelta, 0.1m, true, time), -quantity*pricePlusDelta),\n                new ValueTestParameters(\"OptionShortTrailingStopOrderPriceMinusDelta\", option, new TrailingStopOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, priceMinusDelta, 0.1m, true, time), -quantity*price),\n                new ValueTestParameters(\"OptionShortLimitIfTouchedOrder\", option, new LimitIfTouchedOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, 1.5m*pricePlusDelta, pricePlusDelta, time),  -quantity*pricePlusDelta),\n                new ValueTestParameters(\"OptionLongLimitIfTouchedOrder\", option, new LimitIfTouchedOrder(Symbols.SPY_P_192_Feb19_2016, quantity,.5m*priceMinusDelta, priceMinusDelta, time), quantity*priceMinusDelta),\n\n                new ValueTestParameters(\"OptionExerciseOrderPut\", option, new OptionExerciseOrder(Symbols.SPY_P_192_Feb19_2016, quantity, time), quantity*option.Symbol.ID.StrikePrice),\n                new ValueTestParameters(\"OptionAssignmentOrderPut\", option, new OptionExerciseOrder(Symbols.SPY_P_192_Feb19_2016, -quantity, time), -quantity*option.Symbol.ID.StrikePrice),\n                new ValueTestParameters(\"OptionExerciseOrderCall\", option, new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, quantity, time), quantity*option.Symbol.ID.StrikePrice),\n                new ValueTestParameters(\"OptionAssignmentOrderCall\", option, new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, -quantity, time), -quantity*option.Symbol.ID.StrikePrice),\n\n\n            }.Select(x => new TestCaseData(x).SetName(x.Name)).ToArray();\n        }\n\n        public class ValueTestParameters\n        {\n            public string Name { get; init; }\n            public Security Security { get; init; }\n            public Order Order { get; init; }\n            public decimal ExpectedValue { get; init; }\n\n            public ValueTestParameters(string name, Security security, Order order, decimal expectedValue)\n            {\n                Name = name;\n                Security = security;\n                Order = order;\n                ExpectedValue = expectedValue;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/OrderTicketTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class OrderTicketTests\n    {\n        private DateTime _requestTime = new DateTime(2022, 08, 25, 15, 0, 0);\n\n        [Test]\n        public void TestInvalidUpdateOrderId()\n        {\n            var updateFields = new UpdateOrderFields { Quantity = 99, Tag = \"Pepe\", StopPrice = 77 , LimitPrice = 55 };\n            var updateRequest = new UpdateOrderRequest(_requestTime, 11, updateFields);\n            var ticket = OrderTicket.InvalidUpdateOrderId(null, updateRequest);\n            Assert.AreEqual(11, ticket.OrderId);\n            Assert.AreEqual(0, ticket.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.Tag);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.AreEqual(1, ticket.UpdateRequests.Count);\n            Assert.AreEqual(OrderRequestStatus.Error, ticket.UpdateRequests[0].Status);\n            Assert.AreEqual(OrderResponseErrorCode.UnableToFindOrder, ticket.UpdateRequests[0].Response.ErrorCode);\n            Assert.AreEqual(11, ticket.UpdateRequests[0].OrderId);\n            Assert.AreEqual(99, ticket.UpdateRequests[0].Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.UpdateRequests[0].Tag);\n            Assert.AreEqual(77, ticket.UpdateRequests[0].StopPrice);\n            Assert.AreEqual(55, ticket.UpdateRequests[0].LimitPrice);\n        }\n        [Test]\n        public void TestInvalidCancelOrderId()\n        {\n            var cancelRequest = new CancelOrderRequest(_requestTime, 11, \"Pepe\");\n            var ticket = OrderTicket.InvalidCancelOrderId(null, cancelRequest);\n            Assert.AreEqual(11, ticket.OrderId);\n            Assert.AreEqual(0, ticket.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.Tag);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.AreEqual(cancelRequest, ticket.CancelRequest);\n            Assert.AreEqual(OrderRequestStatus.Error, ticket.CancelRequest.Status);\n            Assert.AreEqual(OrderResponseErrorCode.UnableToFindOrder, ticket.CancelRequest.Response.ErrorCode);\n            Assert.AreEqual(11, ticket.CancelRequest.OrderId);\n            Assert.AreEqual(\"Pepe\", ticket.CancelRequest.Tag);\n        }\n        [Test]\n        public void TestInvalidSubmitRequest()\n        {\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, SecurityType.Equity, Symbols.AAPL, 1000, 0, 1.11m, _requestTime, \"Pepe\");\n            var order = Order.CreateOrder(orderRequest);\n            orderRequest.SetOrderId(orderRequest.OrderId);\n            var orderResponse = OrderResponse.InvalidStatus(orderRequest, order);\n            var ticket = OrderTicket.InvalidSubmitRequest(null, orderRequest, orderResponse);\n            Assert.AreEqual(orderRequest.OrderId, ticket.OrderId);\n            Assert.AreEqual(1000, ticket.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.Tag);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.AreEqual(OrderType.Limit, ticket.OrderType);\n            Assert.AreEqual(SecurityType.Equity, ticket.SecurityType);\n            Assert.AreEqual(Symbols.AAPL, ticket.Symbol);\n            Assert.AreEqual(orderRequest, ticket.SubmitRequest);\n            Assert.AreEqual(OrderRequestStatus.Error, ticket.SubmitRequest.Status);\n            Assert.AreEqual(orderRequest.OrderId, ticket.SubmitRequest.OrderId);\n            Assert.AreEqual(1000, ticket.SubmitRequest.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.SubmitRequest.Tag);\n        }\n        [Test]\n        public void TestInvalidWarmingUp()\n        {\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, SecurityType.Equity, Symbols.AAPL, 1000, 0, 1.11m, _requestTime, \"Pepe\");\n            orderRequest.SetOrderId(orderRequest.OrderId);\n            var algorithmSub = new AlgorithmStub();\n            var ticket = algorithmSub.SubmitOrderRequest(orderRequest);\n            Assert.AreEqual(orderRequest.OrderId, ticket.OrderId);\n            Assert.AreEqual(1000, ticket.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.Tag);\n            Assert.AreEqual(OrderStatus.Invalid, ticket.Status);\n            Assert.AreEqual(OrderType.Limit, ticket.OrderType);\n            Assert.AreEqual(SecurityType.Equity, ticket.SecurityType);\n            Assert.AreEqual(Symbols.AAPL, ticket.Symbol);\n            Assert.AreEqual(orderRequest, ticket.SubmitRequest);\n            Assert.AreEqual(OrderRequestStatus.Error, ticket.SubmitRequest.Status);\n            Assert.AreEqual(orderRequest.OrderId, ticket.SubmitRequest.OrderId);\n            Assert.AreEqual(1000, ticket.SubmitRequest.Quantity);\n            Assert.AreEqual(\"Pepe\", ticket.SubmitRequest.Tag);\n            Assert.AreEqual(\"This operation is not allowed in Initialize or during warm up: OrderRequest.Submit. Please move this code to the OnWarmupFinished() method.\", ticket.SubmitRequest.Response.ErrorMessage);\n        }\n\n        [TestCase(8, 0, true, Description = \"8 AM - valid submission\")]\n        [TestCase(12, 0, false, Description = \"12 PM - invalid submission\")]\n        [TestCase(15, 30, false, Description = \"3:30 PM - invalid submission\")]\n        [TestCase(15, 59, false, Description = \"15:59 PM - invalid submission\")]\n        [TestCase(17, 0, true, Description = \"5 PM - valid submission\")]\n        [TestCase(21, 0, true, Description = \"9 PM - valid submission\")]\n        public void MarketOnOpenOrderSubmissionRespectsAllowedTimeRange(int hourOfDay, int minuteOfDay, bool shouldBeValid)\n        {\n            var symbol = Symbols.SPY;\n            var algorithm = new AlgorithmStub();\n            algorithm.SetStartDate(2025, 04, 30);\n\n            var security = algorithm.AddSecurity(symbol.ID.SecurityType, symbol.ID.Symbol);\n            algorithm.SetFinishedWarmingUp();\n            security.Update([new Tick(algorithm.Time, symbol, string.Empty, string.Empty, 10m, 550m)], typeof(TradeBar));\n\n            // Set algorithm time to the given hour\n            var targetTime = algorithm.Time.Date.AddHours(hourOfDay).AddMinutes(minuteOfDay);\n            algorithm.SetDateTime(targetTime.ConvertToUtc(algorithm.TimeZone));\n\n            var order = new MarketOnOpenOrder(security.Symbol, 1, DateTime.UtcNow);\n\n            var request = algorithm.SubmitOrderRequest(new SubmitOrderRequest(\n                order.Type,\n                security.Type,\n                security.Symbol,\n                order.Quantity,\n                0m,\n                0m,\n                order.Time,\n                string.Empty));\n\n            if (shouldBeValid)\n            {\n                Assert.AreEqual(OrderStatus.New, request.Status, $\"Expected order at {hourOfDay}:00 to be valid.\");\n                Assert.AreEqual(1, request.OrderId);\n            }\n            else\n            {\n                Assert.AreEqual(OrderStatus.Invalid, request.Status, $\"Expected order at {hourOfDay}:00 to be invalid.\");\n                Assert.AreEqual(-10, request.OrderId);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/ReadOrdersResponseJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing System;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class ReadOrdersResponseJsonConverterTests\n    {\n        private JsonSerializerSettings _jsonSettings = new() { Converters = { new ReadOrdersResponseJsonConverter()} };\n\n        [TestCaseSource(nameof(DeserializeOrdersTests))]\n        public void DeserializesCamelAndCapitalCaseOrders(string json, OrderType expectedType, string id, SecurityType securityType)\n        {\n            var apiOrderResponse = JsonConvert.DeserializeObject<ApiOrderResponse>(json, _jsonSettings);\n            var order = apiOrderResponse.Order;\n            var actualType = order.Type;\n            Assert.AreEqual(expectedType, actualType);\n\n            switch (actualType)\n            {\n                case OrderType.Market:\n                    Assert.IsTrue(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.Limit:\n                    Assert.AreEqual(139.240078869942m, (order as LimitOrder).LimitPrice);\n                    Assert.IsTrue(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.StopMarket:\n                    Assert.AreEqual(138.232948134345, (order as StopMarketOrder).StopPrice);\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.StopLimit:\n                    Assert.AreEqual(139.240078869942m, (order as StopLimitOrder).LimitPrice);\n                    Assert.AreEqual(138.232948134345, (order as StopLimitOrder).StopPrice);\n                    Assert.AreEqual(false, (order as StopLimitOrder).StopTriggered);\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.MarketOnOpen:\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.MarketOnClose:\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.OptionExercise:\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.LimitIfTouched:\n                    Assert.AreEqual(139.240078869942m, (order as LimitIfTouchedOrder).LimitPrice);\n                    Assert.AreEqual(138.26, (order as LimitIfTouchedOrder).TriggerPrice);\n                    Assert.AreEqual(false, (order as LimitIfTouchedOrder).TriggerTouched);\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.ComboMarket:\n                    Assert.IsTrue(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.ComboLimit:\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.ComboLegLimit:\n                    Assert.AreEqual(139.240078869942m, (order as ComboLegLimitOrder).LimitPrice);\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n                case OrderType.TrailingStop:\n                    Assert.AreEqual(138.232948134345m, (order as TrailingStopOrder).StopPrice);\n                    Assert.IsFalse(order.IsMarketable, \"Failed in Order.IsMarketable\");\n                    break;\n            }\n\n            Assert.AreEqual(1, order.Id, \"Failed in Order.Id\");\n            Assert.AreEqual(0, order.ContingentId, \"Failed in Order.ContingentId\");\n            Assert.AreEqual(new List<string>() { \"1\" }, order.BrokerId, \"Failed in Order.BrokerId\");\n            Assert.AreEqual(id, order.Symbol.ID.ToString(), \"Failed in Order.ID.Symbol\");\n            Assert.AreEqual(Market.USA, order.Symbol.ID.Market, \"Failed in Order.Symbol.ID.Market\");\n            Assert.AreEqual(138.513986945m, order.Price, \"Failed in Order.Price\");\n            Assert.AreEqual(\"USD\", order.PriceCurrency, \"Failed in Order.PriceCurrency\");\n            Assert.AreEqual(new DateTime(2013, 10, 7, 13, 31, 00), order.Time.RoundDown(TimeSpan.FromSeconds(1)), \"Failed in Order.Time\");\n            Assert.AreEqual(new DateTime(2013, 10, 7, 13, 31, 00), order.CreatedTime.RoundDown(TimeSpan.FromSeconds(1)));\n            Assert.AreEqual(new DateTime(2013, 10, 7, 13, 31, 00), order.LastFillTime?.RoundDown(TimeSpan.FromSeconds(1)));\n            Assert.AreEqual(10, order.Quantity, \"Failed in Order.Quantity\");\n            Assert.AreEqual(OrderStatus.Submitted, order.Status, \"Failed in Order.Status\");\n            Assert.AreEqual(TimeInForce.GoodTilCanceled.ToString(), order.Properties.TimeInForce.ToString(), \"Failed in Order.Properties.TimeInForce\");\n            Assert.AreEqual(securityType, order.SecurityType, \"Failed in Order.SecurityType\");\n            Assert.AreEqual(OrderDirection.Buy, order.Direction, \"Failed in Order.Direction\");\n            Assert.AreEqual(1385.139869450m, order.Value, \"Failed in Order.Value\");\n            Assert.AreEqual(138.505714984m, order.OrderSubmissionData.BidPrice, \"Failed in Order.OrderSubmissionData.BidPrice\");\n            Assert.AreEqual(138.513986945m, order.OrderSubmissionData.AskPrice, \"Failed in Order.OrderSubmissionData.AskPrice\");\n            Assert.AreEqual(138.505714984m, order.OrderSubmissionData.LastPrice, \"Failed in Order.OrderSubmissionData.LastPrice\");\n            Assert.AreEqual(DataNormalizationMode.Adjusted, order.PriceAdjustmentMode, \"Failed in Order.PriceAdjustmentMode\");\n        }\n\n        [TestCaseSource(nameof(SerializeOrdersTests))]\n        public void SerializesCamelAndCapitalCaseOrders(string json)\n        {\n            var order = JsonConvert.DeserializeObject<ApiOrderResponse>(json, _jsonSettings);\n\n            var serializedOrder = JsonConvert.SerializeObject(order, _jsonSettings);\n            var jsonFormat = json.Replace(\"\\r\\n            \", \"\").Replace(\": \", \":\").Replace(\"    \", \"\").Replace(\"\\r\\n\", \"\").Replace(\"\\t\", \"\").Replace(\"\\n\", \"\");\n            if (order.Order.Type == OrderType.ComboMarket || order.Order.Type == OrderType.ComboLimit || order.Order.Type == OrderType.ComboLegLimit)\n            {\n                jsonFormat = Regex.Replace(jsonFormat, @\"\\\"\"value\\\"\":\\\"\"(.*?)\\\"\",\", \"\");\n                jsonFormat = Regex.Replace(jsonFormat, @\"\\\"\"permtick\\\"\":\\\"\"(.*?)\\\"\",\", \"\");\n                serializedOrder = Regex.Replace(serializedOrder, @\"\\\"\"value\\\"\":\\\"\"(.*?)\\\"\",\", \"\");\n                serializedOrder = Regex.Replace(serializedOrder, @\"\\\"\"permtick\\\"\":\\\"\"(.*?)\\\"\",\", \"\");\n            }\n            Assert.AreEqual(jsonFormat, serializedOrder);\n            Assert.AreEqual(jsonFormat.GetHashCode(), serializedOrder.GetHashCode());\n        }\n\n        private const string _camelCaseMarketOrder = @\"{\n            \"\"type\"\": 0,\n            \"\"id\"\": 1,\n            \"\"contingentId\"\": 0,\n            \"\"brokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"symbol\"\": {\n                \"\"value\"\": \"\"SPY\"\",\n                \"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n                \"\"permtick\"\": \"\"SPY\"\"\n            },\n            \"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": true,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n                    \"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-1-1\"\",\n                    \"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n                    \"\"orderId\"\": 1,\n                    \"\"orderEventId\"\": 1,\n                    \"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n                    \"\"symbolValue\"\": \"\"SPY\"\",\n                    \"\"symbolPermtick\"\": \"\"SPY\"\",\n                    \"\"time\"\": 1381152660.0,\n                    \"\"status\"\": \"\"submitted\"\",\n                    \"\"fillPrice\"\": 0.0,\n                    \"\"fillPriceCurrency\"\": \"\"USD\"\",\n                    \"\"fillQuantity\"\": 0.0,\n                    \"\"direction\"\": \"\"buy\"\",\n                    \"\"message\"\": null,\n                    \"\"isAssignment\"\": false,\n                    \"\"quantity\"\": 10.0\n                }\n            ]\n        }\";\n\n        private const string _camelCaseLimitOrder = @\"{\n\t\t\t\"\"limitPrice\"\": 139.240078869942,\n\t\t\t\"\"type\"\": 1,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": true,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-4-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 4,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381161600.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"sell\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": -10.0,\n\t\t\t\t\t\"\"limitPrice\"\": 139.290078869942\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseStopMarket = @\"{\n\t\t\t\"\"stopPrice\"\": 138.232948134345,\n\t\t\t\"\"type\"\": 2,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-8-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 8,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381176000.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"sell\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": -10.0,\n\t\t\t\t\t\"\"stopPrice\"\": 138.142948134345\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseStopLimitOrder = @\"{\n\t\t\t\"\"stopPrice\"\": 138.232948134345,\n\t\t\t\"\"stopTriggered\"\": false,\n\t\t\t\"\"limitPrice\"\": 139.240078869942,\n\t\t\t\"\"type\"\": 3,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-10-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 10,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381248060.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"sell\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": -10.0,\n\t\t\t\t\t\"\"stopPrice\"\": 137.367302895297,\n\t\t\t\t\t\"\"limitPrice\"\": 137.534807703\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseMarketOnOpen = @\"{\n\t\t\t\"\"type\"\": 4,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-11-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 11,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381255200.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"buy\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": 50.0\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseMarketOnClose = @\"{\n\t\t\t\"\"type\"\": 5,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-12-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 12,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381334400.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"buy\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": 104.0\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseOptionExercise = @\"{\n            \"\"type\"\": 6,\n            \"\"id\"\": 1,\n            \"\"contingentId\"\": 0,\n            \"\"brokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"symbol\"\": {\n                \"\"value\"\": \"\"AAPL  140613P00660000\"\",\n                \"\"id\"\": \"\"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\"\",\n                \"\"permtick\"\": \"\"AAPL  140613P00660000\"\",\n                \"\"underlying\"\": {\n                    \"\"value\"\": \"\"AAPL\"\",\n                    \"\"id\"\": \"\"AAPL R735QTJ8XC9X\"\",\n                    \"\"permtick\"\": \"\"AAPL\"\"\n                }\n            },\n            \"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 2,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"015fbee84f01918498775c6c3a08dd39-3-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"015fbee84f01918498775c6c3a08dd39\"\",\n\t\t\t\t\t\"\"orderId\"\": 3,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"AAPL  140613P00660000\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"AAPL\"\",\n\t\t\t\t\t\"\"time\"\": 1402061460.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"sell\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": -20.0\n\t\t\t\t}\n            ]\n        }\";\n\n        private const string _camelCaseLimitIfTouched = @\"{\n\t\t\t\"\"type\"\": 7,\n\t\t\t\"\"triggerPrice\"\": 138.26,\n\t\t\t\"\"limitPrice\"\": 139.240078869942,\n\t\t\t\"\"triggerTouched\"\": false,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"4c4c10b22ca562d9419c869abd23bfaf-1-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"4c4c10b22ca562d9419c869abd23bfaf\"\",\n\t\t\t\t\t\"\"orderId\"\": 1,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381152660.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"buy\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": 10.0,\n\t\t\t\t\t\"\"limitPrice\"\": 137.505714984\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _camelCaseComboMarket = @\"{\n            \"\"type\"\": 8,\n            \"\"quantity\"\": 10.0,\n            \"\"id\"\": 1,\n            \"\"contingentId\"\": 0,\n            \"\"brokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"symbol\"\": {\n                \"\"value\"\": \"\"GOOG  160115C00745000\"\",\n                \"\"id\"\": \"\"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"\",\n                \"\"permtick\"\": \"\"GOOG  160115C00745000\"\",\n                \"\"underlying\"\": {\n                    \"\"value\"\": \"\"GOOG\"\",\n                    \"\"id\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n                    \"\"permtick\"\": \"\"GOOG\"\"\n                }\n            },\n            \"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 2,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": true,\n            \"\"groupOrderManager\"\": {\n                \"\"id\"\": 1,\n                \"\"quantity\"\": 10.0,\n                \"\"count\"\": 3,\n                \"\"limitPrice\"\": 0.0,\n                \"\"orderIds\"\": [\n                    1,\n                    2,\n                    3\n                ],\n                \"\"direction\"\": 0\n            },\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n                    \"\"id\"\": \"\"c628892c0f508fd780013e01383f1c4e-3-1\"\",\n                    \"\"algorithmId\"\": \"\"c628892c0f508fd780013e01383f1c4e\"\",\n                    \"\"orderId\"\": 3,\n                    \"\"orderEventId\"\": 1,\n                    \"\"symbol\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n                    \"\"symbolValue\"\": \"\"GOOG  160115C00750000\"\",\n                    \"\"symbolPermtick\"\": \"\"GOOCV\"\",\n                    \"\"time\"\": 1450967460.0,\n                    \"\"status\"\": \"\"submitted\"\",\n                    \"\"fillPrice\"\": 0.0,\n                    \"\"fillPriceCurrency\"\": \"\"USD\"\",\n                    \"\"fillQuantity\"\": 0.0,\n                    \"\"direction\"\": \"\"buy\"\",\n                    \"\"message\"\": null,\n                    \"\"isAssignment\"\": false,\n                    \"\"quantity\"\": 10.0\n                }\n            ]\n        }\";\n\n        private const string _camelCaseComboLimit = @\"{\n            \"\"type\"\": 9,\n            \"\"quantity\"\": 10.0,\n            \"\"id\"\": 1,\n            \"\"contingentId\"\": 0,\n            \"\"brokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"symbol\"\": {\n                \"\"value\"\": \"\"GOOG  160115C00745000\"\",\n                \"\"id\"\": \"\"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"\",\n                \"\"permtick\"\": \"\"GOOG  160115C00745000\"\",\n                \"\"underlying\"\": {\n                    \"\"value\"\": \"\"GOOG\"\",\n                    \"\"id\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n                    \"\"permtick\"\": \"\"GOOG\"\"\n                }\n            },\n            \"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 2,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"groupOrderManager\"\": {\n                \"\"id\"\": 1,\n                \"\"quantity\"\": 10.0,\n                \"\"count\"\": 3,\n                \"\"limitPrice\"\": 1.9,\n                \"\"orderIds\"\": [\n                    1,\n                    2,\n                    3\n                ],\n                \"\"direction\"\": 0\n            },\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n                    \"\"id\"\": \"\"02162a310244a08034bcbcd571f5aec9-1-1\"\",\n                    \"\"algorithmId\"\": \"\"02162a310244a08034bcbcd571f5aec9\"\",\n                    \"\"orderId\"\": 1,\n                    \"\"orderEventId\"\": 1,\n                    \"\"symbol\"\": \"\"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"\",\n                    \"\"symbolValue\"\": \"\"GOOG  160115C00745000\"\",\n                    \"\"symbolPermtick\"\": \"\"GOOCV\"\",\n                    \"\"time\"\": 1450967460.0,\n                    \"\"status\"\": \"\"submitted\"\",\n                    \"\"fillPrice\"\": 0.0,\n                    \"\"fillPriceCurrency\"\": \"\"USD\"\",\n                    \"\"fillQuantity\"\": 0.0,\n                    \"\"direction\"\": \"\"buy\"\",\n                    \"\"message\"\": null,\n                    \"\"isAssignment\"\": false,\n                    \"\"quantity\"\": 100.0\n                }\n            ]\n        }\";\n\n        private const string _camelCaseComboLegLimit = @\"{\n            \"\"type\"\": 10,\n            \"\"limitPrice\"\": 139.240078869942,\n            \"\"quantity\"\": 10.0,\n            \"\"id\"\": 1,\n            \"\"contingentId\"\": 0,\n            \"\"brokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"symbol\"\": {\n                \"\"value\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"id\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n                \"\"permtick\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"underlying\"\": {\n                    \"\"value\"\": \"\"GOOG\"\",\n                    \"\"id\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n                    \"\"permtick\"\": \"\"GOOG\"\"\n                }\n            },\n            \"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 2,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"groupOrderManager\"\": {\n                \"\"id\"\": 1,\n                \"\"quantity\"\": 10.0,\n                \"\"count\"\": 3,\n                \"\"limitPrice\"\": 0.0,\n                \"\"orderIds\"\": [\n                    1,\n                    2,\n                    3\n                ],\n                \"\"direction\"\": 0\n            },\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n                    \"\"id\"\": \"\"a19c5b42ef28e3db679bb6fd59c14984-3-1\"\",\n                    \"\"algorithmId\"\": \"\"a19c5b42ef28e3db679bb6fd59c14984\"\",\n                    \"\"orderId\"\": 3,\n                    \"\"orderEventId\"\": 1,\n                    \"\"symbol\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n                    \"\"symbolValue\"\": \"\"GOOG  160115C00750000\"\",\n                    \"\"symbolPermtick\"\": \"\"GOOCV\"\",\n                    \"\"time\"\": 1450967460.0,\n                    \"\"status\"\": \"\"submitted\"\",\n                    \"\"fillPrice\"\": 0.0,\n                    \"\"fillPriceCurrency\"\": \"\"USD\"\",\n                    \"\"fillQuantity\"\": 0.0,\n                    \"\"direction\"\": \"\"buy\"\",\n                    \"\"message\"\": null,\n                    \"\"isAssignment\"\": false,\n                    \"\"quantity\"\": 10.0,\n                    \"\"limitPrice\"\": 28.0\n                }\n            ]\n        }\";\n\n        private const string _camelCaseTrailingStop = @\"{\n\t\t\t\"\"trailingAmount\"\": 0.0019,\n\t\t\t\"\"trailingAsPercentage\"\": true,\n\t\t\t\"\"type\"\": 11,\n\t\t\t\"\"stopPrice\"\": 138.232948134345,\n\t\t\t\"\"id\"\": 1,\n\t\t\t\"\"contingentId\"\": 0,\n\t\t\t\"\"brokerId\"\": [\n\t\t\t\t\"\"1\"\"\n\t\t\t],\n\t\t\t\"\"symbol\"\": {\n\t\t\t\t\"\"value\"\": \"\"SPY\"\",\n\t\t\t\t\"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"SPY\"\"\n\t\t\t},\n\t\t\t\"\"price\"\": 138.513986945,\n            \"\"priceCurrency\"\": \"\"USD\"\",\n            \"\"time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"createdTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"lastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"quantity\"\": 10.0,\n            \"\"status\"\": 1,\n            \"\"tag\"\": \"\"\"\",\n            \"\"properties\"\": {\n                \"\"timeInForce\"\": {}\n            },\n            \"\"securityType\"\": 1,\n            \"\"direction\"\": 0,\n            \"\"value\"\": 1385.139869450,\n            \"\"orderSubmissionData\"\": {\n                \"\"bidPrice\"\": 138.505714984,\n                \"\"askPrice\"\": 138.513986945,\n                \"\"lastPrice\"\": 138.505714984\n            },\n            \"\"isMarketable\"\": false,\n            \"\"priceAdjustmentMode\"\": 1,\n            \"\"events\"\": [\n                {\n\t\t\t\t\t\"\"id\"\": \"\"3b2259c444e04c9124784bb491bf016f-6-1\"\",\n\t\t\t\t\t\"\"algorithmId\"\": \"\"3b2259c444e04c9124784bb491bf016f\"\",\n\t\t\t\t\t\"\"orderId\"\": 6,\n\t\t\t\t\t\"\"orderEventId\"\": 1,\n\t\t\t\t\t\"\"symbol\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"symbolValue\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"symbolPermtick\"\": \"\"SPY\"\",\n\t\t\t\t\t\"\"time\"\": 1381161600.0,\n\t\t\t\t\t\"\"status\"\": \"\"submitted\"\",\n\t\t\t\t\t\"\"fillPrice\"\": 0.0,\n\t\t\t\t\t\"\"fillPriceCurrency\"\": \"\"USD\"\",\n\t\t\t\t\t\"\"fillQuantity\"\": 0.0,\n\t\t\t\t\t\"\"direction\"\": \"\"sell\"\",\n\t\t\t\t\t\"\"message\"\": null,\n\t\t\t\t\t\"\"isAssignment\"\": false,\n\t\t\t\t\t\"\"quantity\"\": -10.0,\n\t\t\t\t\t\"\"stopPrice\"\": 138.803050622145\n\t\t\t\t}\n            ]\n\t\t}\";\n\n        private const string _capitalCaseMarketOrder = @\"{\n            \"\"Type\"\": 0,\n            \"\"Id\"\": 1,\n            \"\"ContingentId\"\": 0,\n            \"\"BrokerId\"\": [\n                \"\"1\"\"\n            ],\n            \"\"Symbol\"\": {\n                \"\"Value\"\": \"\"SPY\"\",\n                \"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n                \"\"Permtick\"\": \"\"SPY\"\"\n            },\n            \"\"Price\"\": 138.513986945,\n            \"\"PriceCurrency\"\": \"\"USD\"\",\n            \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n            \"\"Quantity\"\": 10.0,\n            \"\"Status\"\": 1,\n            \"\"Tag\"\": \"\"\"\",\n            \"\"Properties\"\": {\n                \"\"TimeInForce\"\": {}\n            },\n            \"\"SecurityType\"\": 1,\n            \"\"Direction\"\": 0,\n            \"\"Value\"\": 1385.139869450,\n            \"\"OrderSubmissionData\"\": {\n                \"\"BidPrice\"\": 138.505714984,\n                \"\"AskPrice\"\": 138.513986945,\n                \"\"LastPrice\"\": 138.505714984\n            },\n            \"\"IsMarketable\"\": true,\n            \"\"PriceAdjustmentMode\"\": 1,\n            \"\"events\"\": []\n        }\";\n\n        private const string _capitalCaseLimitOrder = @\"{\n\t\"\"LimitPrice\"\": 139.240078869942,\n\t\"\"Type\"\": 1,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": true,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseStopMarket = @\"{\n\t\"\"StopPrice\"\": 138.232948134345,\n\t\"\"Type\"\": 2,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseStopLimitOrder = @\"{\n\t\"\"StopPrice\"\": 138.232948134345,\n\t\"\"StopTriggered\"\": false,\n\t\"\"LimitPrice\"\": 139.240078869942,\n\t\"\"Type\"\": 3,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseMarketOnOpen = @\"{\n\t\"\"Type\"\": 4,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseMarketOnClose = @\"{\n\t\"\"Type\"\": 5,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseOptionExercise = @\"{\n    \"\"Type\"\": 6,\n    \"\"Id\"\": 1,\n    \"\"ContingentId\"\": 0,\n    \"\"BrokerId\"\": [\n        \"\"1\"\"\n    ],\n    \"\"Symbol\"\": {\n        \"\"Value\"\": \"\"AAPL  140613P00660000\"\",\n        \"\"ID\"\": \"\"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\"\",\n        \"\"Permtick\"\": \"\"AAPL  140613P00660000\"\",\n        \"\"Underlying\"\": {\n            \"\"Value\"\": \"\"AAPL\"\",\n            \"\"ID\"\": \"\"AAPL R735QTJ8XC9X\"\",\n            \"\"Permtick\"\": \"\"AAPL\"\"\n        }\n    },\n    \"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 2,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseLimitIfTouched = @\"{\n\t\"\"Type\"\": 7,\n\t\"\"triggerPrice\"\": 138.26,\n\t\"\"LimitPrice\"\": 139.240078869942,\n\t\"\"TriggerTouched\"\": false,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseComboMarket = @\"{\n    \"\"Type\"\": 8,\n    \"\"Quantity\"\": 10.0,\n    \"\"Id\"\": 1,\n    \"\"ContingentId\"\": 0,\n    \"\"BrokerId\"\": [\n        \"\"1\"\"\n    ],\n    \"\"Symbol\"\": {\n        \"\"Value\"\": \"\"GOOG  160115C00745000\"\",\n        \"\"ID\"\": \"\"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"\",\n        \"\"Permtick\"\": \"\"GOOG  160115C00745000\"\",\n        \"\"Underlying\"\": {\n            \"\"Value\"\": \"\"GOOG\"\",\n            \"\"ID\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n            \"\"Permtick\"\": \"\"GOOG\"\"\n        }\n    },\n    \"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 2,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": true,\n    \"\"GroupOrderManager\"\": {\n        \"\"Id\"\": 1,\n        \"\"Quantity\"\": 10.0,\n        \"\"Count\"\": 3,\n        \"\"LimitPrice\"\": 0.0,\n        \"\"OrderIds\"\": [\n            1,\n            2,\n            3\n        ],\n        \"\"Direction\"\": 0\n    },\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseComboLimit = @\"{\n    \"\"Type\"\": 9,\n    \"\"Quantity\"\": 10.0,\n    \"\"Id\"\": 1,\n    \"\"ContingentId\"\": 0,\n    \"\"BrokerId\"\": [\n        \"\"1\"\"\n    ],\n    \"\"Symbol\"\": {\n        \"\"Value\"\": \"\"GOOG  160115C00745000\"\",\n        \"\"ID\"\": \"\"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\"\",\n        \"\"Permtick\"\": \"\"GOOG  160115C00745000\"\",\n        \"\"Underlying\"\": {\n            \"\"Value\"\": \"\"GOOG\"\",\n            \"\"ID\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n            \"\"Permtick\"\": \"\"GOOG\"\"\n        }\n    },\n    \"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 2,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"GroupOrderManager\"\": {\n        \"\"Id\"\": 1,\n        \"\"Quantity\"\": 10.0,\n        \"\"Count\"\": 3,\n        \"\"LimitPrice\"\": 1.9,\n        \"\"OrderIds\"\": [\n            1,\n            2,\n            3\n        ],\n        \"\"Direction\"\": 0\n    },\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseComboLegLimit = @\"{\n    \"\"Type\"\": 10,\n    \"\"LimitPrice\"\": 139.240078869942,\n    \"\"Quantity\"\": 10.0,\n    \"\"Id\"\": 1,\n    \"\"ContingentId\"\": 0,\n    \"\"BrokerId\"\": [\n        \"\"1\"\"\n    ],\n    \"\"Symbol\"\": {\n        \"\"Value\"\": \"\"GOOG  160115C00750000\"\",\n        \"\"ID\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n        \"\"Permtick\"\": \"\"GOOG  160115C00750000\"\",\n        \"\"Underlying\"\": {\n            \"\"Value\"\": \"\"GOOG\"\",\n            \"\"ID\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n            \"\"Permtick\"\": \"\"GOOG\"\"\n        }\n    },\n    \"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 2,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"GroupOrderManager\"\": {\n        \"\"Id\"\": 1,\n        \"\"Quantity\"\": 10.0,\n        \"\"Count\"\": 3,\n        \"\"LimitPrice\"\": 0.0,\n        \"\"OrderIds\"\": [\n            1,\n            2,\n            3\n        ],\n        \"\"Direction\"\": 0\n    },\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        private const string _capitalCaseTrailingStop = @\"{\n\t\"\"TrailingAmount\"\": 0.0019,\n\t\"\"TrailingAsPercentage\"\": true,\n\t\"\"Type\"\": 11,\n\t\"\"StopPrice\"\": 138.232948134345,\n\t\"\"Id\"\": 1,\n\t\"\"ContingentId\"\": 0,\n\t\"\"BrokerId\"\": [\n\t\t\"\"1\"\"\n\t],\n\t\"\"Symbol\"\": {\n\t\t\"\"Value\"\": \"\"SPY\"\",\n\t\t\"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n\t\t\"\"Permtick\"\": \"\"SPY\"\"\n\t},\n\t\"\"Price\"\": 138.513986945,\n    \"\"PriceCurrency\"\": \"\"USD\"\",\n    \"\"Time\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"CreatedTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"LastFillTime\"\": \"\"2013-10-07T13:31:00Z\"\",\n    \"\"Quantity\"\": 10.0,\n    \"\"Status\"\": 1,\n    \"\"Tag\"\": \"\"\"\",\n    \"\"Properties\"\": {\n        \"\"TimeInForce\"\": {}\n    },\n    \"\"SecurityType\"\": 1,\n    \"\"Direction\"\": 0,\n    \"\"Value\"\": 1385.139869450,\n    \"\"OrderSubmissionData\"\": {\n        \"\"BidPrice\"\": 138.505714984,\n        \"\"AskPrice\"\": 138.513986945,\n        \"\"LastPrice\"\": 138.505714984\n    },\n    \"\"IsMarketable\"\": false,\n    \"\"PriceAdjustmentMode\"\": 1,\n    \"\"Events\"\": []\n}\";\n\n        public static object[] DeserializeOrdersTests =\n        {\n            new object[] { _camelCaseMarketOrder, OrderType.Market, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseLimitOrder, OrderType.Limit, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseStopMarket, OrderType.StopMarket, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseStopLimitOrder, OrderType.StopLimit, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseMarketOnOpen, OrderType.MarketOnOpen, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseMarketOnClose, OrderType.MarketOnClose, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseOptionExercise, OrderType.OptionExercise, \"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\", SecurityType.Option },\n            new object[] { _camelCaseLimitIfTouched, OrderType.LimitIfTouched, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _camelCaseComboMarket, OrderType.ComboMarket, \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _camelCaseComboLimit, OrderType.ComboLimit, \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _camelCaseComboLegLimit, OrderType.ComboLegLimit, \"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _camelCaseTrailingStop, OrderType.TrailingStop, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseMarketOrder, OrderType.Market, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseLimitOrder, OrderType.Limit, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseStopMarket, OrderType.StopMarket, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseStopLimitOrder, OrderType.StopLimit, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseMarketOnOpen, OrderType.MarketOnOpen, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseMarketOnClose, OrderType.MarketOnClose, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseOptionExercise, OrderType.OptionExercise, \"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\", SecurityType.Option },\n            new object[] { _capitalCaseLimitIfTouched, OrderType.LimitIfTouched, \"SPY R735QTJ8XC9X\", SecurityType.Equity },\n            new object[] { _capitalCaseComboMarket, OrderType.ComboMarket, \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _capitalCaseComboLimit, OrderType.ComboLimit, \"GOOCV W78ZERHAT67A|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _capitalCaseComboLegLimit, OrderType.ComboLegLimit, \"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\", SecurityType.Option },\n            new object[] { _capitalCaseTrailingStop, OrderType.TrailingStop, \"SPY R735QTJ8XC9X\", SecurityType.Equity }\n        };\n\n        public static object[] SerializeOrdersTests =\n        {\n            new object[] { _camelCaseMarketOrder },\n            new object[] { _camelCaseLimitOrder },\n            new object[] { _camelCaseStopMarket },\n            new object[] { _camelCaseStopLimitOrder },\n            new object[] { _camelCaseMarketOnOpen },\n            new object[] { _camelCaseMarketOnClose },\n            new object[] { _camelCaseOptionExercise },\n            new object[] { _camelCaseLimitIfTouched },\n            new object[] { _camelCaseComboMarket },\n            new object[] { _camelCaseComboLimit },\n            new object[] { _camelCaseComboLegLimit },\n            new object[] { _camelCaseTrailingStop },\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Slippage/MarketImpactSlippageModelTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Orders.Slippage\n{\n    [TestFixture]\n    public class MarketImpactSlippageModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private MarketImpactSlippageModel _slippageModel;\n        private List<Security> _securities;\n\n        [SetUp]\n        public void Initialize()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(null, null,\n                TestGlobals.DataProvider, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider,\n                null, true, new DataPermissionManager(), _algorithm.ObjectStore, _algorithm.Settings));\n            _algorithm.SetHistoryProvider(historyProvider);\n\n            FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProvider(), false);\n\n            var optionContract = Symbol.CreateOption(Symbols.AAPL, Market.USA,\n                OptionStyle.American, OptionRight.Call, 100, new DateTime(2016, 1, 15));\n\n            _algorithm.SetDateTime(new DateTime(2015, 6, 10, 15, 0, 0));\n\n            _securities = new List<Security>\n            {\n                _algorithm.AddEquity(\"SPY\", Resolution.Daily),                      // liquid stock\n                _algorithm.AddEquity(\"AIG\", Resolution.Daily),                      // illquid stock\n                _algorithm.AddCrypto(\"BTCUSD\", Resolution.Daily, Market.Coinbase),      // crypto\n                _algorithm.AddOptionContract(optionContract, Resolution.Minute)     // equity options\n            };\n            foreach (var security in _securities)\n            {\n                security.SetMarketPrice(new TradeBar(_algorithm.Time, security.Symbol, 100m, 100m, 100m, 100m, 1));\n            }\n\n            _algorithm.Settings.AutomaticIndicatorWarmUp = true;\n\n            _slippageModel = new MarketImpactSlippageModel(_algorithm);\n        }\n\n        // Test on buy & sell orders\n        [TestCase(InsightDirection.Up)]\n        [TestCase(InsightDirection.Down)]\n        public void SizeSlippageComparisonTests(InsightDirection direction)\n        {\n            // Test on all liquid/illquid stocks/other asset classes\n            foreach (var asset in _securities)\n            {\n                // A significantly large difference that noise cannot affect the result\n                var smallBuyOrder = new MarketOrder(asset.Symbol, 10 * (int)direction, new DateTime(2015, 6, 10, 14, 00, 0));\n                var largeBuyOrder = new MarketOrder(asset.Symbol, 10000000000 * (int)direction, new DateTime(2015, 6, 10, 14, 00, 0));\n\n                var smallBuySlippage = _slippageModel.GetSlippageApproximation(asset, smallBuyOrder);\n                var largeBuySlippage = _slippageModel.GetSlippageApproximation(asset, largeBuyOrder);\n\n                // We expect small size order has less slippage than large size order on the same asset\n                Assert.Less(smallBuySlippage, largeBuySlippage);\n            }\n        }\n\n        // Order quantity large enough to create significant market impact\n        // Test for buy & sell orders\n        [TestCase(100000)]\n        [TestCase(-100000)]\n        public void VolatileSlippageComparisonTests(decimal orderQuantity)\n        {\n            var highVolAsset = _securities[0];\n            var lowVolAsset = _securities[1];\n\n            var highVolOrder = new MarketOrder(highVolAsset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n            var lowVolOrder = new MarketOrder(lowVolAsset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n\n            var highVolSlippage = _slippageModel.GetSlippageApproximation(highVolAsset, highVolOrder);\n            var lowVolSlippage = _slippageModel.GetSlippageApproximation(lowVolAsset, lowVolOrder);\n\n            // We expect same size order on volatile asset has greater slippage than less volatile asset\n            Assert.Greater(highVolSlippage, lowVolSlippage);\n        }\n\n        // Test on buy & sell orders\n        [TestCase(10000)]\n        [TestCase(-10000)]\n        [TestCase(10000000)]\n        [TestCase(-10000000)]\n        public void TimeSlippageComparisonTests(decimal orderQuantity)\n        {\n            // set up another slippage model with much longer execution time\n            var slowSlippageModel = new MarketImpactSlippageModel(_algorithm, latency: 10);\n\n            // Test on all liquid/illquid stocks/other asset classes\n            foreach (var asset in _securities)\n            {\n                var order = new MarketOrder(asset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n                var fastFilledSlippage = _slippageModel.GetSlippageApproximation(asset, order);\n                var slowFilledSlippage = slowSlippageModel.GetSlippageApproximation(asset, order);\n\n                // We expect same size order on same asset has less slippage if filled slower since the market can digest slowly\n                Assert.Less(slowFilledSlippage, fastFilledSlippage);\n            }\n        }\n\n        // To test whether the slippage matches our expectation\n        [TestCase(100, 0, 0.0)]\n        [TestCase(100, 1, 0.0808)]\n        [TestCase(1, 2, 15.5061)]\n        [TestCase(1, 3, 38.7598)]\n        [TestCase(-100, 0, 0.0)]\n        [TestCase(-100, 1, 0.0808)]\n        [TestCase(-1, 2, 15.5061)]\n        [TestCase(-1, 3, 38.7598)]\n        [TestCase(10000, 0, 0.5075)]\n        [TestCase(10000, 1, 3.8421)]\n        [TestCase(100, 2, 100.0)]\n        [TestCase(100, 3, 100.0)]\n        [TestCase(-10000, 0, 0.5075)]\n        [TestCase(-10000, 1, 3.8421)]\n        [TestCase(-100, 2, 100.0)]\n        [TestCase(-100, 3, 100.0)]\n        public void SlippageExpectationTests(decimal orderQuantity, int index, double expected)\n        {\n            var asset = _securities[index];\n            \n            var order = new MarketOrder(asset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n            var slippage = _slippageModel.GetSlippageApproximation(asset, order);\n\n            Assert.AreEqual(expected, (double)slippage, 0.005d);\n        }\n\n        // Test on buy & sell orders\n        [TestCase(1)]\n        [TestCase(-1)]\n        [TestCase(1000)]\n        [TestCase(-1000)]\n        [TestCase(1000000)]\n        [TestCase(-1000000)]\n        public void NonNegativeSlippageTests(decimal orderQuantity)\n        {\n            // Test on all liquid/illquid stocks/other asset classes\n            foreach (var asset in _securities)\n            {\n                var order = new MarketOrder(asset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n                var slippage = _slippageModel.GetSlippageApproximation(asset, order);\n\n                Assert.GreaterOrEqual(slippage, 0m);\n            }\n        }\n\n        // Large order size to hit the threshold\n        // Test on buy & sell orders\n        [TestCase(10000)]\n        [TestCase(-10000)]\n        [TestCase(1000000000)]\n        [TestCase(-1000000000)]\n        public void MaxSlippageValueTests(decimal orderQuantity)\n        {\n            // Test on all liquid/illquid stocks/other asset classes\n            foreach (var asset in _securities)\n            {\n                var order = new MarketOrder(asset.Symbol, orderQuantity, new DateTime(2015, 6, 10, 14, 00, 0));\n                var slippage = _slippageModel.GetSlippageApproximation(asset, order);\n\n                // Slippage is at max the asset's price, no limit on negative slippage\n                Assert.LessOrEqual(slippage, asset.Price);\n            }\n        }\n\n        [Test]\n        public void CfdExceptionTests()\n        {\n            var cfd = _algorithm.AddCfd(\"XAUUSD\", Resolution.Daily, Market.Oanda);\n            var cfdOrder = new MarketOrder(cfd.Symbol, 10, new DateTime(2013, 10, 10, 14, 00, 0));\n\n            Assert.Throws<Exception>(() => _slippageModel.GetSlippageApproximation(cfd, cfdOrder));\n        }\n\n        [Test]\n        public void ForexExceptionTests()\n        {\n            var forex = _algorithm.AddForex(\"EURUSD\", Resolution.Daily, Market.Oanda);\n            var forexOrder = new MarketOrder(forex.Symbol, 10, new DateTime(2013, 10, 10, 14, 00, 0));\n\n            Assert.Throws<Exception>(() => _slippageModel.GetSlippageApproximation(forex, forexOrder));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/Slippage/SlippageModelsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Orders.Slippage\n{\n    [TestFixture]\n    public class SlippageModelsTests\n    {\n        private Order _equityBuyOrder;\n        private Equity _equity;\n        private Order _forexBuyOrder;\n        private Forex _forex;\n\n        [SetUp]\n        public void Initialize()\n        {\n            _equity = new Equity(\n                Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            _equity.SetMarketPrice(new TradeBar(DateTime.Now, Symbols.SPY, 100m, 100m, 100m, 100m, 1));\n\n            _equityBuyOrder = new MarketOrder(Symbols.SPY, 1, DateTime.Now);\n\n\n            _forex = new Forex(\n                Symbols.EURUSD,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(\"EUR\", 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            _forex.SetMarketPrice(new TradeBar(DateTime.Now, Symbols.EURUSD, 100m, 100m, 100m, 100m, 0));\n\n            _forexBuyOrder = new MarketOrder(Symbols.EURUSD, 1000, DateTime.Now);\n        }\n\n        [Test]\n        public void ConstantSlippageModelTests()\n        {\n            var slippagePercent = 1m;\n            var model = new ConstantSlippageModel(slippagePercent);\n\n            var expected = _equity.Price * slippagePercent;\n            var actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VolumeShareSlippageModelInitializationTests()\n        {\n            // These are low volume tests, since the order quantity and the volume are the same\n\n            // These are the default values for the VolumeShareSlippageModel\n            var priceImpact = 0.1m;\n            var volumeLimit = 0.025m;\n            var model = new VolumeShareSlippageModel();\n\n            var expected = _equity.Price * priceImpact * volumeLimit * volumeLimit;\n            var actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n\n            // Double the values\n            priceImpact *= 2;\n            volumeLimit *= 2;\n            model = new VolumeShareSlippageModel(volumeLimit, priceImpact);\n\n            expected = _equity.Price * priceImpact * volumeLimit * volumeLimit;\n            actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n\n            // Half the values\n            priceImpact /= 4;\n            volumeLimit /= 4;\n            model = new VolumeShareSlippageModel(volumeLimit, priceImpact);\n\n            expected = _equity.Price * priceImpact * volumeLimit * volumeLimit;\n            actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VolumeShareSlippageModel_HighVolumeTest()\n        {\n            // These are the default values for the VolumeShareSlippageModel\n            var priceImpact = 0.1m;\n            var volumeLimit = 0.025m;\n            var model = new VolumeShareSlippageModel();\n\n            // High volume: volume > volumeLimit x order.Quantity\n            var volume = 100;\n            var volumeShare = _equityBuyOrder.Quantity / (decimal)volume;\n            Assert.Greater(volume, volumeLimit * _equityBuyOrder.Quantity);\n            _equity.SetMarketPrice(new TradeBar(DateTime.Now, Symbols.SPY, 100m, 100m, 100m, 100m, volume));\n\n            var expected = _equity.Price * priceImpact * volumeShare * volumeShare;\n            var actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VolumeShareSlippageModel_ForexTest()\n        {\n            var model = new VolumeShareSlippageModel();\n\n            // Since FX/CFD often have zero volume, the model returns zero slippage\n            var expected = 0;\n            var actual = model.GetSlippageApproximation(_forex, _forexBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void AlphaStreamsSlippageModel_EquityTest()\n        {\n            decimal slippagePercent = 0.0001m;\n\n            var model = new AlphaStreamsSlippageModel();\n\n            var expected = _equity.Price * slippagePercent;\n            var actual = model.GetSlippageApproximation(_equity, _equityBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void AlphaStreamsSlippageModel_ForexTest()\n        {\n            var model = new AlphaStreamsSlippageModel();\n\n            var expected = 0;\n            var actual = model.GetSlippageApproximation(_forex, _forexBuyOrder);\n            Assert.AreEqual(expected, actual);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/TerminalLinkOrderPropertiesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Common.Orders\n{\n    [TestFixture]\n    public class TerminalLinkOrderPropertiesTests\n    {\n        [Test]\n        public void SeamlesslySetsStrategyInPython()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getOrderProperties() -> TerminalLinkOrderProperties:\n    strategyFields = [\n        TerminalLinkOrderProperties.StrategyField(\"\"09:30:00\"\"),\n        TerminalLinkOrderProperties.StrategyField(\"\"10:30:00\"\"),\n        TerminalLinkOrderProperties.StrategyField(),\n        TerminalLinkOrderProperties.StrategyField()\n    ]\n\n    properties = TerminalLinkOrderProperties()\n    properties.Strategy = TerminalLinkOrderProperties.StrategyParameters(\"\"VWAP\"\", strategyFields)\n\n    return properties\n\");\n\n                dynamic getOrderProperties = module.GetAttr(\"getOrderProperties\");\n                var orderProperties = (TerminalLinkOrderProperties)getOrderProperties();\n\n                Assert.IsNotNull(orderProperties);\n                Assert.AreEqual(\"VWAP\", orderProperties.Strategy.Name);\n                Assert.AreEqual(4, orderProperties.Strategy.Fields.Count);\n\n                Assert.IsTrue(orderProperties.Strategy.Fields[0].HasValue);\n                Assert.AreEqual(\"09:30:00\", orderProperties.Strategy.Fields[0].Value);\n\n                Assert.IsTrue(orderProperties.Strategy.Fields[1].HasValue);\n                Assert.AreEqual(\"10:30:00\", orderProperties.Strategy.Fields[1].Value);\n\n                Assert.IsFalse(orderProperties.Strategy.Fields[2].HasValue);\n                Assert.IsNull(orderProperties.Strategy.Fields[2].Value);\n\n                Assert.IsFalse(orderProperties.Strategy.Fields[3].HasValue);\n                Assert.IsNull(orderProperties.Strategy.Fields[3].Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/TimeInForces/TimeInForceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.TimeInForces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common.Orders.TimeInForces\n{\n    [TestFixture]\n    public class TimeInForceTests\n    {\n        [Test]\n        public void GtcTimeInForceOrderDoesNotExpire()\n        {\n            var security = new Equity(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            var timeInForce = new GoodTilCanceledTimeInForce();\n            var order = new LimitOrder(Symbols.SPY, 10, 100, DateTime.UtcNow);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, DateTime.UtcNow, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, DateTime.UtcNow, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void DayTimeInForceEquityOrderExpiresAtMarketClose()\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Equity(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.Day;\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.SPY, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void DayTimeInForceForexOrderBefore5PMExpiresAt5PM()\n        {\n            // set time to 10:00:00 AM (NY time)\n            var utcTime = new DateTime(2018, 4, 25, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Forex(\n                SecurityExchangeHoursTests.CreateForexSecurityExchangeHours(),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(\"EUR\", 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.EURUSD,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.Day;\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.EURUSD, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // set time to 4:59:59 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 5:00:00 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void DayTimeInForceForexOrderAfter5PMExpiresAt5PMNextDay()\n        {\n            // set time to 6:00:00 PM (NY time)\n            var utcTime = new DateTime(2018, 4, 25, 18, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Forex(\n                SecurityExchangeHoursTests.CreateForexSecurityExchangeHours(),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(Currencies.EUR, 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.EURUSD,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.Day;\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.EURUSD, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // set time to midnight (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 4:59:59 PM next day (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(23).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 5:00:00 PM next day (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(23));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        private static Security[] CryptoSecurities => new Security[]\n        {\n            new Crypto(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(\"BTC\", 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.BTCUSD,\n                    Resolution.Minute,\n                    TimeZones.Utc,\n                    TimeZones.Utc,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            ),\n            new CryptoFuture(\n                Symbol.Create(\"BTCUSDT\", SecurityType.CryptoFuture, Market.Binance),\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(\"USDT\", 0, 1m),\n                new Cash(\"BTC\", 0, 0),\n                SymbolProperties.GetDefault(\"USDT\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            )\n        };\n\n        [TestCaseSource(nameof(CryptoSecurities))]\n        public void DayTimeInForceCryptoOrderExpiresAtMidnightUtc(Security security)\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0);\n\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.Utc);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.Day;\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(security.Symbol, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void GtdTimeInForceEquityOrderExpiresAtMarketCloseOnExpiryDate()\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Equity(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 5, 1));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.SPY, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // April 27th before market close\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // April 27th at market close\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st at 10 AM\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st before market close\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(6).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st at market close\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(6));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void GtdTimeInForceForexOrderBeforeExpiresAt5PMOnExpiryDate()\n        {\n            // set time to 10:00:00 AM (NY time)\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Forex(\n                SecurityExchangeHoursTests.CreateForexSecurityExchangeHours(),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(Currencies.EUR, 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.EURUSD,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 5, 1));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.EURUSD, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // April 27th 4:59:59 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // April 27th 5:00:00 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st at 10 AM\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st 4:59:59 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(7).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st 5:00:00 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(7));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [TestCaseSource(nameof(CryptoSecurities))]\n        public void GtdTimeInForceCryptoOrderExpiresAtMidnightUtcAfterExpiryDate(Security security)\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0);\n\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.Utc);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 5, 1));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(security.Symbol, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // April 27th before midnight\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // April 28th at midnight\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st at 10 AM\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 1st before midnight\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(14).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // May 2nd at midnight\n            localTimeKeeper.UpdateTime(utcTime.AddDays(4).AddHours(14));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void GtdSameDayTimeInForceEquityOrderExpiresAtMarketClose()\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Equity(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 4, 27));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.SPY, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void GtdSameDayTimeInForceForexOrderBefore5PMExpiresAt5PM()\n        {\n            // set time to 10:00:00 AM (NY time)\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Forex(\n                SecurityExchangeHoursTests.CreateForexSecurityExchangeHours(),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(Currencies.EUR, 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.EURUSD,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 4, 27));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.EURUSD, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // set time to 4:59:59 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 5:00:00 PM (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(7));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [Test]\n        public void GtdSameDayTimeInForceForexOrderAfter5PMExpiresAt5PMNextDay()\n        {\n            // set time to 6:00:00 PM (NY time)\n            var utcTime = new DateTime(2018, 4, 27, 18, 0, 0).ConvertToUtc(TimeZones.NewYork);\n\n            var security = new Forex(\n                SecurityExchangeHoursTests.CreateForexSecurityExchangeHours(),\n                new Cash(Currencies.USD, 0, 1m),\n                new Cash(Currencies.EUR, 0, 0),\n                new SubscriptionDataConfig(\n                    typeof(QuoteBar),\n                    Symbols.EURUSD,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.NewYork);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 4, 27));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(Symbols.EURUSD, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            // set time to midnight (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(6));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 4:59:59 PM next day (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(23).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            // set time to 5:00:00 PM next day (NY time)\n            localTimeKeeper.UpdateTime(utcTime.AddHours(23));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n\n        [TestCaseSource(nameof(CryptoSecurities))]\n        public void GtdSameDayTimeInForceCryptoOrderExpiresAtMidnightUtc(Security security)\n        {\n            var utcTime = new DateTime(2018, 4, 27, 10, 0, 0);\n\n            var localTimeKeeper = new LocalTimeKeeper(utcTime, TimeZones.Utc);\n            security.SetLocalTimeKeeper(localTimeKeeper);\n\n            var timeInForce = TimeInForce.GoodTilDate(new DateTime(2018, 4, 27));\n            var orderProperties = new OrderProperties { TimeInForce = timeInForce };\n            var order = new LimitOrder(security.Symbol, 10, 100, utcTime, \"\", orderProperties);\n\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            var fill1 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.PartiallyFilled, OrderDirection.Buy, order.LimitPrice, 3, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n\n            var fill2 = new OrderEvent(order.Id, order.Symbol, utcTime, OrderStatus.Filled, OrderDirection.Buy, order.LimitPrice, 7, OrderFee.Zero);\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14).AddSeconds(-1));\n            Assert.IsFalse(timeInForce.IsOrderExpired(security, order));\n\n            localTimeKeeper.UpdateTime(utcTime.AddHours(14));\n            Assert.IsTrue(timeInForce.IsOrderExpired(security, order));\n\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill1));\n            Assert.IsTrue(timeInForce.IsFillValid(security, order, fill2));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Orders/dYdXOrderPropertiesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2023 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing NUnit.Framework;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Common.Orders;\n\n[TestFixture]\npublic class dYdXOrderPropertiesTests\n{\n    [Test]\n    public void PostOnlyPropertyCanBeSetAndRetrieved()\n    {\n        var properties = new dYdXOrderProperties();\n\n        properties.PostOnly = true;\n        Assert.IsTrue(properties.PostOnly);\n\n        properties.PostOnly = false;\n        Assert.IsFalse(properties.PostOnly);\n    }\n\n    [Test]\n    public void IOCPropertyCanBeSetAndRetrieved()\n    {\n        var properties = new dYdXOrderProperties();\n\n        properties.IOC = true;\n        Assert.IsTrue(properties.IOC);\n\n        properties.IOC = false;\n        Assert.IsFalse(properties.IOC);\n    }\n\n    [Test]\n    public void DefaultValuesAreCorrect()\n    {\n        var properties = new dYdXOrderProperties();\n\n        Assert.IsFalse(properties.PostOnly);\n        Assert.IsFalse(properties.IOC);\n    }\n\n    [Test]\n    public void ThrowsIfSetIOCWhenPostOnlyAlreadySet()\n    {\n        var properties = new dYdXOrderProperties();\n\n        Assert.Throws<System.InvalidOperationException>(() =>\n        {\n            properties.PostOnly = true;\n            properties.IOC = true;\n        });\n    }\n\n    [Test]\n    public void ThrowsIfSetPostOnlyWhenIOCAlreadySet()\n    {\n        var properties = new dYdXOrderProperties();\n\n        Assert.Throws<System.InvalidOperationException>(() =>\n        {\n            properties.IOC = true;\n            properties.PostOnly = true;\n        });\n    }\n\n    [Test]\n    public void WhenPostOnlyIsTrueIOCRemainsFalse()\n    {\n        var properties = new dYdXOrderProperties();\n\n        properties.PostOnly = true;\n        Assert.IsTrue(properties.PostOnly);\n        Assert.IsFalse(properties.IOC);\n    }\n\n    [Test]\n    public void WhenIOCIsTruePostOnlyRemainsFalse()\n    {\n        var properties = new dYdXOrderProperties();\n\n        properties.IOC = true;\n        Assert.IsTrue(properties.IOC);\n        Assert.IsFalse(properties.PostOnly);\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Packets/BacktestNodePacketTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Packets\n{\n    [TestFixture]\n    public class BacktestNodePacketTests\n    {\n        [SetUp]\n        public void SetUp()\n        {\n            Log.DebuggingEnabled = false;\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            // clear the config\n            Config.Reset();\n        }\n\n        [Test]\n        public void JobDatesAreRespected()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(BasicTemplateDailyAlgorithm),\n                new Dictionary<string, string> {\n                    { PerformanceMetrics.TotalOrders, \"1\" },\n                    {\"Average Win\", \"0%\"},\n                    { \"Average Loss\", \"0%\"},\n                    { \"Compounding Annual Return\", \"14.421%\"},\n                    { \"Drawdown\", \"32.900%\"},\n                    { \"Expectancy\", \"0\"},\n                    { \"Net Profit\", \"30.857%\"},\n                    { \"Sharpe Ratio\", \"0.492\"},\n                    { \"Loss Rate\", \"0%\"},\n                    { \"Win Rate\", \"0%\"},\n                    { \"Profit-Loss Ratio\", \"0\"},\n                    { \"Alpha\", \"-0.012\"},\n                    { \"Beta\", \"1.012\"},\n                    { \"Annual Standard Deviation\", \"0.263\"},\n                    { \"Annual Variance\", \"0.069\"},\n                    { \"Information Ratio\", \"-0.42\"},\n                    { \"Tracking Error\", \"0.025\"},\n                    { \"Treynor Ratio\", \"0.128\"},\n                    { \"Total Fees\", \"$7.10\"} },\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                startDate: new DateTime(2008, 10, 10),\n                endDate: new DateTime(2010, 10, 10));\n        }\n\n        [Test]\n        public void JobDatesAreRespectedByAddUniverseAtInitialize()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(CoarseFundamentalTop3Algorithm),\n                new Dictionary<string, string> {\n                    { PerformanceMetrics.TotalOrders, \"5\" },\n                    {\"Average Win\", \"0%\"},\n                    { \"Average Loss\", \"0%\"},\n                    { \"Compounding Annual Return\", \"-88.910%\"},\n                    { \"Drawdown\", \"1.800%\"},\n                    { \"Expectancy\", \"0\"},\n                    { \"Net Profit\", \"-1.791%\"},\n                    { \"Sharpe Ratio\", \"-4.495\"},\n                    { \"Loss Rate\", \"0%\"},\n                    { \"Win Rate\", \"0%\"},\n                    { \"Profit-Loss Ratio\", \"0\"},\n                    { \"Alpha\", \"-0.522\"},\n                    { \"Beta\", \"1.48\"},\n                    { \"Annual Standard Deviation\", \"0.201\"},\n                    { \"Annual Variance\", \"0.04\"},\n                    { \"Information Ratio\", \"-9.904\"},\n                    { \"Tracking Error\", \"0.065\"},\n                    { \"Treynor Ratio\", \"-0.611\"},\n                    { \"Total Fees\", \"$3.00\"} },\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                startDate: new DateTime(2014, 03, 24),\n                endDate: new DateTime(2014, 03, 26));\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void RoundTripNullJobDates()\n        {\n            var job = new BacktestNodePacket(1, 2, \"3\", null, 9m, $\"{nameof(BacktestNodePacketTests)}.Pepe\");\n\n            var serialized = JsonConvert.SerializeObject(job);\n            var job2 = JsonConvert.DeserializeObject<BacktestNodePacket>(serialized);\n\n            Assert.AreEqual(job.BacktestId, job2.BacktestId);\n            Assert.AreEqual(job.Name, job2.Name);\n            Assert.IsNull(job.PeriodFinish);\n            Assert.IsNull(job.PeriodStart);\n            Assert.AreEqual(job.PeriodFinish, job2.PeriodFinish);\n            Assert.AreEqual(job.PeriodStart, job2.PeriodStart);\n            Assert.AreEqual(job.ProjectId, job2.ProjectId);\n            Assert.AreEqual(job.SessionId, job2.SessionId);\n            Assert.AreEqual(job.Language, job2.Language);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void RoundTripWithJobDates()\n        {\n            var job = new BacktestNodePacket(1, 2, \"3\", null, 9m, $\"{nameof(BacktestNodePacketTests)}.Pepe\");\n            job.PeriodStart = new DateTime(2019, 1, 1);\n            job.PeriodFinish = new DateTime(2020, 1, 1);\n\n            var serialized = JsonConvert.SerializeObject(job);\n            var job2 = JsonConvert.DeserializeObject<BacktestNodePacket>(serialized);\n\n            Assert.AreEqual(job.PeriodStart, job2.PeriodStart);\n            Assert.AreEqual(job.PeriodFinish, job2.PeriodFinish);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void RoundTripWithInitialCashAmount()\n        {\n            var job = new BacktestNodePacket(1, 2, \"3\", null, 9m, $\"{nameof(BacktestNodePacketTests)}.Pepe\");\n            Assert.AreEqual(9m, job.CashAmount.Value.Amount);\n            Assert.AreEqual(Currencies.USD, job.CashAmount.Value.Currency);\n\n            var serialized = JsonConvert.SerializeObject(job);\n            var job2 = JsonConvert.DeserializeObject<BacktestNodePacket>(serialized);\n            Assert.AreEqual(job.CashAmount, job2.CashAmount);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void RoundTripWithNullInitialCashAmount()\n        {\n            var job = new BacktestNodePacket(1, 2, \"3\", null, $\"{nameof(BacktestNodePacketTests)}.Pepe\");\n            Assert.IsNull(job.CashAmount);\n\n            var serialized = JsonConvert.SerializeObject(job);\n            var job2 = JsonConvert.DeserializeObject<BacktestNodePacket>(serialized);\n            Assert.AreEqual(job.CashAmount, job2.CashAmount);\n        }\n\n        [Test]\n        public void InitialCashAmountIsRespected()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(BasicTemplateDailyAlgorithm),\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"1\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"424.497%\"},\n                    {\"Drawdown\", \"0.800%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"4.487%\"},\n                    {\"Sharpe Ratio\", \"17.306\"},\n                    {\"Probabilistic Sharpe Ratio\", \"96.835%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"-0.249\"},\n                    {\"Beta\", \"1.015\"},\n                    {\"Annual Standard Deviation\", \"0.141\"},\n                    {\"Annual Variance\", \"0.02\"},\n                    {\"Information Ratio\", \"-18.937\"},\n                    {\"Tracking Error\", \"0.011\"},\n                    {\"Treynor Ratio\", \"2.403\"},\n                    {\"Total Fees\", \"$34.86\"} // 10x times more than original BasicTemplateDailyAlgorithm\n                },\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                initialCash: 1000000); // 1M vs 100K that is set in BasicTemplateDailyAlgorithm (10x)\n        }\n\n        [Test]\n        public void ClearsOtherCashAmounts()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(TestInitialCashAmountAlgorithm),\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"1\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"338.765%\"},\n                    {\"Drawdown\", \"0.800%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"4.487%\"},\n                    {\"Sharpe Ratio\", \"15.085\"},\n                    {\"Probabilistic Sharpe Ratio\", \"97.122%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"-0.194\"},\n                    {\"Beta\", \"1.013\"},\n                    {\"Annual Standard Deviation\", \"0.135\"},\n                    {\"Annual Variance\", \"0.018\"},\n                    {\"Information Ratio\", \"-15.836\"},\n                    {\"Tracking Error\", \"0.01\"},\n                    {\"Treynor Ratio\", \"2.013\"},\n                    {\"Total Fees\", \"$34.86\"} // 10x times more than original BasicTemplateDailyAlgorithm\n                },\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                initialCash: 1000000, // 1M vs 100K that is set in BasicTemplateDailyAlgorithm (10x)\n                setupHandler: \"TestInitialCashAmountSetupHandler\");\n\n            Assert.AreEqual(0, TestInitialCashAmountSetupHandler.TestAlgorithm.Portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(Currencies.USD, TestInitialCashAmountSetupHandler.TestAlgorithm.AccountCurrency);\n        }\n\n        public class TestInitialCashAmountAlgorithm : BasicTemplateDailyAlgorithm\n        {\n            public override void Initialize()\n            {\n                SetAccountCurrency(\"EUR\");\n                base.Initialize();\n                SetCash(\"EUR\", 1000000);\n            }\n        }\n\n        public class TestInitialCashAmountSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            public static TestInitialCashAmountAlgorithm TestAlgorithm { get; set; }\n\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = TestAlgorithm = new TestInitialCashAmountAlgorithm();\n                return Algorithm;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Packets/ControlsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Tests.Common.Packets\n{\n    public class ControlsTests\n    {\n        [Test]\n        public void StoragePermissionsJsonRoundTrip([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            var control = new Controls { StorageAccess = permissions };\n            var json = JsonConvert.SerializeObject(control);\n            var result = JsonConvert.DeserializeObject<Controls>(json);\n\n            Assert.AreEqual(permissions.Read, result.StorageAccess.Read);\n            Assert.AreEqual(permissions.Write, result.StorageAccess.Write);\n            Assert.AreEqual(permissions.Delete, result.StorageAccess.Delete);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Packets/LiveNodePacketTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Notifications;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Tests.Common.Packets\n{\n    [TestFixture]\n    public class LiveNodePacketTests\n    {\n        [Test]\n        public void NotificationRoundTrip()\n        {\n            var expectedEmail = new NotificationEmail(\"pipi@google.com\", \"crypto\", null,\n                null, new Dictionary<string, string> {{\"header-key\", \"header-value\"}});\n            var packet = new LiveNodePacket\n            {\n                NotificationTargets = new List<Notification>\n                {\n                    expectedEmail,\n                    new NotificationSms(\"123\", null),\n                    new NotificationWeb(\"www.pupu.com\", headers: new Dictionary<string, string> {{\"header-key\", \"header-value\"}})\n                }\n            };\n\n            var serialized = JsonConvert.SerializeObject(packet);\n\n            var instance = JsonConvert.DeserializeObject<LiveNodePacket>(serialized);\n\n            var email = instance.NotificationTargets[0] as NotificationEmail;\n            Assert.IsNotNull(email);\n            Assert.AreEqual(expectedEmail.Address, email.Address);\n            Assert.AreEqual(expectedEmail.Subject, email.Subject);\n            Assert.AreEqual(expectedEmail.Message, email.Message);\n            Assert.AreEqual(expectedEmail.Data, email.Data);\n            Assert.AreEqual(expectedEmail.Headers, email.Headers);\n\n            var sms = instance.NotificationTargets[1] as NotificationSms;\n            Assert.IsNotNull(sms);\n            Assert.AreEqual(\"123\", sms.PhoneNumber);\n            Assert.AreEqual(null, sms.Message);\n\n            var web = instance.NotificationTargets[2] as NotificationWeb;\n            Assert.IsNotNull(web);\n            Assert.AreEqual(\"www.pupu.com\", web.Address);\n            Assert.AreEqual(null, web.Data);\n            Assert.AreEqual((packet.NotificationTargets[2] as NotificationWeb).Headers, web.Headers);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Parameters/ParameterAttributeTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing NUnit.Framework;\nusing QuantConnect.Parameters;\n\nnamespace QuantConnect.Tests.Common.Parameters\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ParameterAttributeTests\n    {\n        [Test]\n        public void SetsParameterIntValues()\n        {\n            var instance = new Instance<int>();\n            var parameters = new Dictionary<string, string>\n            {\n                {\"PublicField\", \"1\"},\n                {\"PublicProperty\", \"1\"},\n                {\"ProtectedField\", \"1\"},\n                {\"ProtectedProperty\", \"1\"},\n                {\"InternalField\", \"1\"},\n                {\"InternalProperty\", \"1\"},\n                {\"PrivateField\", \"1\"},\n                {\"PrivateProperty\", \"1\"},\n            };\n\n            ParameterAttribute.ApplyAttributes(parameters, instance);\n\n            instance.AssertValues(1);\n        }\n\n        [TestCase(\"1\")]\n        [TestCase(\"1.0\")]\n        public void SetsParameterDoubleValues(string actual)\n        {\n            var instance = new Instance<double>();\n            var parameters = new Dictionary<string, string>\n            {\n                {\"PublicField\", actual},\n                {\"PublicProperty\", actual},\n                {\"ProtectedField\", actual},\n                {\"ProtectedProperty\", actual},\n                {\"InternalField\", actual},\n                {\"InternalProperty\", actual},\n                {\"PrivateField\", actual},\n                {\"PrivateProperty\", actual},\n            };\n\n            ParameterAttribute.ApplyAttributes(parameters, instance);\n\n            instance.AssertValues(1);\n        }\n\n        [TestCase(\"1\")]\n        [TestCase(\"1.0\")]\n        public void SetsParameterDecimalValues(string actual)\n        {\n            var instance = new Instance<decimal>();\n            var parameters = new Dictionary<string, string>\n            {\n                {\"PublicField\", actual},\n                {\"PublicProperty\", actual},\n                {\"ProtectedField\", actual},\n                {\"ProtectedProperty\", actual},\n                {\"InternalField\", actual},\n                {\"InternalProperty\", actual},\n                {\"PrivateField\", actual},\n                {\"PrivateProperty\", actual},\n            };\n\n            ParameterAttribute.ApplyAttributes(parameters, instance);\n\n            instance.AssertValues(1);\n        }\n\n        [Test]\n        public void FindsParameters()\n        {\n            var assembly = Assembly.GetExecutingAssembly();\n            var parameters = ParameterAttribute.GetParametersFromAssembly(assembly);\n            foreach (var field in typeof(Instance<int>).GetFields(ParameterAttribute.BindingFlags).Where(x => !x.Name.Contains(\">k__\")))\n            {\n                Assert.IsTrue(parameters.ContainsKey(field.Name), \"Failed on Field: \" + field.Name);\n            }\n            foreach (var property in typeof(Instance<int>).GetProperties(ParameterAttribute.BindingFlags))\n            {\n                Assert.IsTrue(parameters.ContainsKey(property.Name), \"Failed on Property: \" + property.Name);\n            }\n        }\n\n        [Test]\n        public void FindsParametersUsingReflection()\n        {\n            var assembly = Assembly.GetExecutingAssembly();\n            var parameters = ParameterAttribute.GetParametersFromAssembly(assembly);\n            foreach (var field in typeof(Instance<int>).GetFields(ParameterAttribute.BindingFlags).Where(x => !x.Name.Contains(\">k__\")))\n            {\n                Assert.IsTrue(parameters.ContainsKey(field.Name), \"Failed on Field: \" + field.Name);\n            }\n            foreach (var property in typeof(Instance<int>).GetProperties(ParameterAttribute.BindingFlags))\n            {\n                Assert.IsTrue(parameters.ContainsKey(property.Name), \"Failed on Property: \" + property.Name);\n            }\n        }\n\n        class Instance<T>\n        {\n            [Parameter]\n            public T PublicField = default(T);\n            [Parameter]\n            public T PublicProperty { get; set; }\n            [Parameter]\n            protected T ProtectedField = default(T);\n            [Parameter]\n            protected T ProtectedProperty { get; set; }\n            [Parameter]\n            internal T InternalField = default(T);\n            [Parameter]\n            internal T InternalProperty { get; set; }\n            [Parameter]\n            private T PrivateField = default(T);\n            [Parameter]\n            private T PrivateProperty { get; set; }\n\n            public void AssertValues(T expected)\n            {\n\n                Assert.AreEqual(expected, PublicField);\n                Assert.AreEqual(expected, PublicProperty);\n                Assert.AreEqual(expected, ProtectedField);\n                Assert.AreEqual(expected, ProtectedProperty);\n                Assert.AreEqual(expected, InternalField);\n                Assert.AreEqual(expected, InternalProperty);\n                Assert.AreEqual(expected, PrivateField);\n                Assert.AreEqual(expected, PrivateProperty);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ParseTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ParseTests\n    {\n        [Test]\n        public void DoubleIsTheSameAs_DoubleDotParse_WithInvariantCulture()\n        {\n            var str = \"1,123.45608\";\n            var expected = double.Parse(str, CultureInfo.InvariantCulture);\n            var actual = Parse.Double(str);\n            Assert.IsInstanceOf<double>(actual);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DecimalIsTheSameAs_DecimalDotParse_WithInvariantCulture()\n        {\n            var str = \"1,123.45608\";\n            var expected = decimal.Parse(str, CultureInfo.InvariantCulture);\n            var actual = Parse.Decimal(str);\n            Assert.IsInstanceOf<decimal>(actual);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DecimalSupports_NumberStyles()\n        {\n            var str = \"1e-3\";\n            var expected = 0.001m;\n            var actual = Parse.Decimal(str, NumberStyles.AllowExponent);\n            Assert.IsInstanceOf<decimal>(expected);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void LongIsTheSameAs_LongDotParse_WithInvariantCulture()\n        {\n            var str = \"1123\";\n            var expected = long.Parse(str, CultureInfo.InvariantCulture);\n            var actual = Parse.Long(str);\n            Assert.IsInstanceOf<long>(actual);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void IntIsTheSameAs_IntDotParse_WithInvariantCulture()\n        {\n            var str = \"1123\";\n            var expected = int.Parse(str, CultureInfo.InvariantCulture);\n            var actual = Parse.Int(str);\n            Assert.IsInstanceOf<int>(actual);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DateTimeIsTheSameAs_DateTimeDotParse_WithInvariantCulture()\n        {\n            var str = \"7/29/2019\";\n            var expected = DateTime.Parse(str, CultureInfo.InvariantCulture);\n            var actual = Parse.DateTime(str);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DateTimeWithFormat_IsTheSameAs_DateTimeDotParse_WithFormatAndInvariantCulture()\n        {\n            var str = \"07+29+2019\";\n            var format = \"MM+dd+2019\";\n            var expected = DateTime.ParseExact(str, format, CultureInfo.InvariantCulture);\n            var actual = Parse.DateTimeExact(str, format);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DateTimeExact_IsTheSameAs_DateTimeDotParseExact_WithFormatAndInvariantCulture()\n        {\n            var str = \"07/29-2019Q14.22\";\n            var format = \"MM/dd-yyyyQHH.mm\";\n            var expected = DateTime.ParseExact(str, format, CultureInfo.InvariantCulture);\n            var actual = Parse.DateTimeExact(str, format);\n            Assert.AreEqual(expected, actual);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/ProtobufSerializationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing ProtoBuf;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ProtobufSerializationTests\n    {\n        private static readonly Dictionary<Type, BaseData> _iconicInstances = new Dictionary<Type, BaseData>\n        {\n            { typeof(IndexedLinkedData), new IndexedLinkedData { Count = 1024 } },\n            { typeof(IndexedLinkedData2), new IndexedLinkedData2 { Count = 2048 } },\n            { typeof(LinkedData), new LinkedData { Count = 4096 } },\n            { typeof(UnlinkedData), new UnlinkedData { Ticker = \"ABCDEF\" } },\n            { typeof(UnlinkedDataTradeBar), new UnlinkedDataTradeBar\n                {\n                    Open = 10m,\n                    High = 11m,\n                    Low = 9m,\n                    Close = 10.99m,\n                    Volume = 9999m\n                }\n            }\n        };\n        \n        [TestCase(typeof(IndexedLinkedData), true)]\n        [TestCase(typeof(IndexedLinkedData2), true)]\n        [TestCase(typeof(LinkedData), true)]\n        [TestCase(typeof(UnlinkedData), false)]\n        [TestCase(typeof(UnlinkedDataTradeBar), false)]\n        public void SerializeRoundTripIconicDataTypes(Type baseDataType, bool hasUnderlyingSymbol)\n        {\n            var item = CreateNewInstance(baseDataType, hasUnderlyingSymbol);\n            var serialized = item.ProtobufSerialize(new Guid());\n            \n            using (var stream = new MemoryStream(serialized))\n            {\n                var deserialized = Serializer.Deserialize<IEnumerable<BaseData>>(stream).Single();\n                AssertAreEqual(item, deserialized);\n            }\n        }\n        \n        [Test]\n        public void SymbolRoundTrip()\n        {\n            var symbol = Symbols.AAPL;\n\n            using (var stream = new MemoryStream())\n            {\n                Serializer.Serialize(stream, symbol);\n\n                stream.Position = 0;\n\n                var result = Serializer.Deserialize<Symbol>(stream);\n\n                Assert.AreEqual(symbol, result);\n                Assert.AreEqual(symbol.GetHashCode(), result.GetHashCode());\n            }\n        }\n\n        [TestCase(10)]\n        [TestCase(100)]\n        [TestCase(1000)]\n        public void TickListSerializationRoundTrip(int tickCount)\n        {\n            var time = DateTime.UtcNow;\n            var ticks = new List<Tick>();\n            for (int i = 0; i < tickCount; i++)\n            {\n                var tick = new Tick\n                {\n                    Symbol = Symbols.AAPL,\n                    AskPrice = i,\n                    AskSize = i,\n                    Time = time + TimeSpan.FromMilliseconds(i),\n                    Quantity = i,\n                    DataType = MarketDataType.Tick,\n                    Exchange = \"NASDAQ\",\n                    SaleCondition = \"VerySold\",\n                    TickType = TickType.Quote,\n                    Value = i,\n                    BidPrice = i,\n                    BidSize = i\n                };\n                ticks.Add(tick);\n            }\n\n            var stopwatch = new Stopwatch();\n            stopwatch.Start();\n            var serializedTick = ticks.ProtobufSerialize(new Guid());\n            stopwatch.Stop();\n\n            Log.Trace($\"Took {stopwatch.ElapsedMilliseconds}ms. TickCount : {tickCount}.\");\n\n            // verify its correct\n            using (var stream = new MemoryStream(serializedTick))\n            {\n                var results = Serializer.Deserialize<List<Tick>>(stream);\n\n                Assert.AreEqual(tickCount, results.Count);\n\n                for (int i = 0; i < tickCount; i++)\n                {\n                    var result = results[i];\n                    Assert.AreEqual(i, result.AskPrice);\n                    Assert.AreEqual(i, result.AskSize);\n                    Assert.AreEqual(time + TimeSpan.FromMilliseconds(i), result.Time);\n                    Assert.AreEqual(i, result.Quantity);\n                    Assert.AreEqual(MarketDataType.Tick, result.DataType);\n                    Assert.AreEqual(\"NASDAQ\", result.Exchange);\n                    Assert.AreEqual(\"VerySold\", result.SaleCondition);\n                    Assert.AreEqual(TickType.Quote, result.TickType);\n                    Assert.AreEqual(time + TimeSpan.FromMilliseconds(i), result.EndTime);\n                    Assert.AreEqual(i, result.Value);\n                    Assert.AreEqual(i, result.BidPrice);\n                    Assert.AreEqual(i, result.BidSize);\n                    Assert.IsNull(result.Symbol);\n                }\n            }\n        }\n\n        [Test]\n        public void OpenInterestSerializationRoundTrip()\n        {\n            var openInterest = new OpenInterest(DateTime.UtcNow, Symbols.AAPL, 10);\n\n            var serializedTick = openInterest.ProtobufSerialize(new Guid());\n\n            // verify its correct\n            using (var stream = new MemoryStream(serializedTick))\n            {\n                var result = (Tick)Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.IsNull(result.Symbol);\n                Assert.AreEqual(openInterest.Time, result.Time);\n                Assert.AreEqual(openInterest.EndTime, result.EndTime);\n                Assert.AreEqual(openInterest.Value, result.Value);\n            }\n        }\n\n        [Test]\n        public void TickSerializationRoundTrip()\n        {\n            var tick = new Tick\n            {\n                Symbol = Symbols.AAPL,\n                AskPrice = 10,\n                AskSize = 10,\n                Time = DateTime.UtcNow,\n                Quantity = 10,\n                DataType = MarketDataType.Tick,\n                Exchange = \"NASDAQ\",\n                SaleCondition = \"VerySold\",\n                TickType = TickType.Quote,\n                EndTime = DateTime.UtcNow,\n                Value = 10,\n                BidPrice = 100,\n                BidSize = 100\n            };\n\n            var serializedTick = tick.ProtobufSerialize(new Guid());\n\n            // verify its correct\n            using (var stream = new MemoryStream(serializedTick))\n            {\n                var result = (Tick) Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.AreEqual(tick.AskPrice, result.AskPrice);\n                Assert.AreEqual(tick.AskSize, result.AskSize);\n                Assert.AreEqual(tick.Time, result.Time);\n                Assert.AreEqual(tick.Quantity, result.Quantity);\n                Assert.AreEqual(tick.DataType, result.DataType);\n                Assert.AreEqual(\"NASDAQ\", result.Exchange);\n                Assert.AreEqual(tick.SaleCondition, result.SaleCondition);\n                Assert.AreEqual(tick.TickType, result.TickType);\n                Assert.AreEqual(tick.EndTime, result.EndTime);\n                Assert.AreEqual(tick.Value, result.Value);\n                Assert.AreEqual(tick.BidPrice, result.BidPrice);\n                Assert.AreEqual(tick.BidSize, result.BidSize);\n            }\n        }\n\n        [Test]\n        public void TradeBarSerializationRoundTrip()\n        {\n            var tradeBar = new TradeBar\n            {\n                Symbol = Symbols.AAPL,\n                Volume = 10,\n                Time = DateTime.UtcNow,\n                EndTime = DateTime.UtcNow,\n                Value = 10,\n                Close = 10,\n                High = 100,\n                Low = 100,\n                Open = 100,\n                Period = TimeSpan.FromMinutes(1)\n            };\n\n            var serializedTradeBar = tradeBar.ProtobufSerialize(new Guid());\n            using (var stream = new MemoryStream(serializedTradeBar))\n            {\n                // verify its correct\n                var result = (TradeBar) Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.AreEqual(tradeBar.Time, result.Time);\n                Assert.AreEqual(tradeBar.DataType, result.DataType);\n                Assert.AreEqual(tradeBar.EndTime, result.EndTime);\n                Assert.AreEqual(tradeBar.Value, result.Value);\n                Assert.AreEqual(tradeBar.Volume, result.Volume);\n                Assert.AreEqual(tradeBar.Close, result.Close);\n                Assert.AreEqual(tradeBar.High, result.High);\n                Assert.AreEqual(tradeBar.Low, result.Low);\n                Assert.AreEqual(tradeBar.Open, result.Open);\n                Assert.AreEqual(tradeBar.Period, result.Period);\n            }\n        }\n\n        [Test]\n        public void QuoteBarSerializationRoundTrip()\n        {\n            var quoteBar = new QuoteBar\n            {\n                Symbol = Symbols.AAPL,\n                Time = DateTime.UtcNow,\n                EndTime = DateTime.UtcNow,\n                Value = 10,\n                LastAskSize = 10,\n                LastBidSize = 100,\n                Ask = new Bar(1, 2, 3, 4),\n                Bid = new Bar(11, 22, 33, 44),\n                Period = TimeSpan.FromMinutes(1)\n            };\n\n            var serializedQuoteBar = quoteBar.ProtobufSerialize(new Guid());\n            using (var stream = new MemoryStream(serializedQuoteBar))\n            {\n                // verify its correct\n                var result = (QuoteBar)Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.AreEqual(quoteBar.Time, result.Time);\n                Assert.AreEqual(quoteBar.DataType, result.DataType);\n                Assert.AreEqual(quoteBar.EndTime, result.EndTime);\n                Assert.AreEqual(quoteBar.Value, result.Value);\n                Assert.AreEqual(quoteBar.Close, result.Close);\n                Assert.AreEqual(quoteBar.High, result.High);\n                Assert.AreEqual(quoteBar.Low, result.Low);\n                Assert.AreEqual(quoteBar.Open, result.Open);\n                Assert.AreEqual(quoteBar.Period, result.Period);\n\n                Assert.AreEqual(quoteBar.Ask.Close, result.Ask.Close);\n                Assert.AreEqual(quoteBar.Ask.High, result.Ask.High);\n                Assert.AreEqual(quoteBar.Ask.Low, result.Ask.Low);\n                Assert.AreEqual(quoteBar.Ask.Open, result.Ask.Open);\n\n                Assert.AreEqual(quoteBar.Bid.Close, result.Bid.Close);\n                Assert.AreEqual(quoteBar.Bid.High, result.Bid.High);\n                Assert.AreEqual(quoteBar.Bid.Low, result.Bid.Low);\n                Assert.AreEqual(quoteBar.Bid.Open, result.Bid.Open);\n            }\n        }\n\n        [Test]\n        public void DividendRoundTrip()\n        {\n            var dividend = new Dividend\n            {\n                DataType = MarketDataType.Auxiliary,\n                Distribution = 0.5m,\n                ReferencePrice = decimal.MaxValue - 10000m,\n\n                Symbol = Symbols.AAPL,\n                Time = DateTime.UtcNow,\n                Value = 0.5m\n            };\n\n            var serializedDividend = dividend.ProtobufSerialize(new Guid());\n            using (var stream = new MemoryStream(serializedDividend))\n            {\n                var result = (Dividend)Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.AreEqual(dividend.DataType, result.DataType);\n                Assert.AreEqual(dividend.Distribution, result.Distribution);\n                Assert.AreEqual(dividend.ReferencePrice, result.ReferencePrice);\n                Assert.AreEqual(dividend.Time, result.Time);\n                Assert.AreEqual(dividend.EndTime, result.EndTime);\n                Assert.AreEqual(dividend.Value, result.Value);\n            }\n        }\n\n        [Test]\n        public void SplitRoundTrip()\n        {\n            var split = new Split(Symbols.AAPL, DateTime.UtcNow, decimal.MaxValue, decimal.MinValue, SplitType.SplitOccurred);\n\n            var serializedSplit = split.ProtobufSerialize(new Guid());\n            using (var stream = new MemoryStream(serializedSplit))\n            {\n                var result = (Split)Serializer.Deserialize<IEnumerable<BaseData>>(stream).First();\n\n                Assert.AreEqual(split.Type, result.Type);\n                Assert.AreEqual(split.DataType, result.DataType);\n                Assert.AreEqual(split.SplitFactor, result.SplitFactor);\n                Assert.AreEqual(split.ReferencePrice, result.ReferencePrice);\n                Assert.AreEqual(split.Time, result.Time);\n                Assert.AreEqual(split.EndTime, result.EndTime);\n                Assert.AreEqual(split.Value, result.Value);\n            }\n        }\n\n        [Test, Ignore(\"Performance test\")]\n        public void SpeedTest()\n        {\n            var symbols = new List<Symbol>\n            {\n                Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.Oanda),\n                Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase),\n                Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Bitfinex),\n                Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM),\n                Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda),\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 1, DateTime.UtcNow),\n                Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, DateTime.UtcNow)\n            };\n\n            var now = DateTime.UtcNow;\n            var ticks = new List<Tick>();\n            for (var i = 0; i < 10000; i++)\n            {\n                foreach (var symbol in symbols)\n                {\n                    ticks.Add(new Tick\n                    {\n                        Symbol = symbol,\n                        AskPrice = i * 10,\n                        AskSize = i * 10,\n                        Time = now,\n                        Quantity = 10,\n                        DataType = MarketDataType.Tick,\n                        Exchange = \"Pinocho\",\n                        SaleCondition = \"VerySold\",\n                        TickType = TickType.Quote,\n                        EndTime = now,\n                        Value = i * 10,\n                        BidPrice = i * 100,\n                        BidSize = i * 100\n                    });\n                }\n            }\n\n            var guid = new Guid();\n            {\n                // warmup\n                var serialized = ticks.ProtobufSerialize(guid);\n                using (var stream = new MemoryStream(serialized))\n                {\n                    // verify its correct\n                    var result = Serializer.Deserialize<List<Tick>>(stream);\n                }\n\n                var start = DateTime.UtcNow;\n                for (var i = 0; i < 10; i++)\n                {\n                    serialized = ticks.ProtobufSerialize(guid);\n                }\n                var end = DateTime.UtcNow;\n                Log.Trace($\"PROTO BUF TOOK {end - start}\");\n            }\n\n            {\n                // warmup\n                var serialized = JsonConvert.SerializeObject(ticks);\n\n                var start = DateTime.UtcNow;\n                for (var i = 0; i < 10; i++)\n                {\n                    serialized = JsonConvert.SerializeObject(ticks);\n                }\n                var end = DateTime.UtcNow;\n\n                Log.Trace($\"JSON TOOK {end - start}\");\n            }\n        }\n\n        private static BaseData CreateNewInstance(Type baseDataType, bool hasUnderlyingSymbol)\n        {\n            var instance = _iconicInstances[baseDataType];\n            \n            instance.Symbol = hasUnderlyingSymbol\n                ? Symbol.CreateBase(baseDataType, Symbols.AAPL, QuantConnect.Market.USA)\n                : Symbol.Create(\"ABCDEF\", SecurityType.Base, Market.USA, baseDataType: baseDataType);\n            \n            instance.Time = new DateTime(2021, 6, 5);\n            \n            return instance;\n        }\n\n        private void AssertAreEqual(object expected, object result)\n        {\n            foreach (var propertyInfo in expected.GetType().GetProperties())\n            {\n                if (propertyInfo.CustomAttributes.Any(data => data.AttributeType == typeof(ProtoMemberAttribute)))\n                {\n                    var expectedValue = propertyInfo.GetValue(expected);\n                    var resultValue = propertyInfo.GetValue(result);\n                    if (expectedValue is IList)\n                    {\n                        var expectedValueList = (IList) expectedValue;\n                        var resultValueList = (IList) resultValue;\n                        for (var i = 0; i < expectedValueList.Count; i++)\n                        {\n                            AssertAreEqual(expectedValueList[i], resultValueList[i]);\n                        }\n                    }\n                    else if (expectedValue is IDictionary)\n                    {\n                        var expectedValueDictionary = (IDictionary) expectedValue;\n                        var resultValueDictionary = (IDictionary) resultValue;\n                        foreach (dynamic kvp in expectedValueDictionary)\n                        {\n                            AssertAreEqual(kvp.Key, resultValueDictionary.Contains(kvp.Key));\n                            AssertAreEqual(kvp.Value, resultValueDictionary[kvp.Key]);\n                        }\n                    }\n                    else\n                    {\n                        if (expectedValue is OrderEvent || expectedValue is OrderFee)\n                        {\n                            AssertAreEqual(expectedValue, resultValue);\n                        }\n                        else\n                        {\n                            Assert.AreEqual(expectedValue, resultValue);\n                        }\n                    }\n                }\n            }\n            foreach (var fieldInfo in expected.GetType().GetFields())\n            {\n                if (fieldInfo.CustomAttributes.Any(data => data.AttributeType == typeof(ProtoMemberAttribute)))\n                {\n                    Assert.AreEqual(fieldInfo.GetValue(expected), fieldInfo.GetValue(result));\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Python/PythonInitializerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\n\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Tests.Common.Python\n{\n    [TestFixture]\n    public class PythonInitializerTests\n    {\n        [Test]\n        public void AlgorithmLocationIsAlwaysBeforeOtherPaths()\n        {\n            PythonInitializer.Initialize();\n            PythonInitializer.ResetAlgorithmLocationPath();\n\n            var testDirectory = Directory.CreateDirectory(\"TestDir\").FullName.Replace('\\\\', '/');\n            var algorithmDirectory = Directory.CreateDirectory(\"AlgoDir\").FullName.Replace('\\\\', '/');\n\n            PythonInitializer.AddAlgorithmLocationPath(algorithmDirectory);\n            PythonInitializer.AddPythonPaths(new string[] { testDirectory });\n            \n            var paths = GetPythonPaths().ToList();\n\n            Directory.Delete(\"TestDir\", true);\n            Directory.Delete(\"AlgoDir\", true);\n\n            var algorithmDirectoryIndex = paths.IndexOf(algorithmDirectory);\n            var testDirectoryIndex = paths.IndexOf(testDirectory);\n\n            Assert.AreNotEqual(-1, algorithmDirectoryIndex, string.Join(\", \", paths));\n            Assert.Less(algorithmDirectoryIndex, testDirectoryIndex);\n        }\n\n        private static IEnumerable<string> GetPythonPaths()\n        {\n            using (Py.GIL())\n            {\n                using dynamic sys = Py.Import(\"sys\");\n                using var locals = new PyDict();\n                locals.SetItem(\"sys\", sys);\n\n                // Filter out any already paths that already exist on our current PythonPath\n                using var pythonCurrentPath = PythonEngine.Eval(\"sys.path\", locals: locals);\n\n                return pythonCurrentPath.As<List<string>>();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/ScatterChartPointTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class ScatterChartPointTests\n    {\n        [Test]\n        public void JsonRoundTrip()\n        {\n            var chart = new Chart(Symbols.SPY.Value);\n            var series = new Series(\"SeriesName\", SeriesType.Scatter);\n            var point = new ScatterChartPoint() { y = 99, Time = new DateTime(2024, 01, 01), Tooltip = \"Filled @ 88 tooltip test\" };\n            series.AddPoint(point);\n            chart.AddSeries(series);\n\n            var serialized = JsonConvert.SerializeObject(chart);\n            var deserialized = JsonConvert.DeserializeObject<Chart>(serialized);\n\n            Assert.AreEqual(1, deserialized.Series.Count);\n            var deserializedSeries = deserialized.Series[series.Name];\n\n            Assert.AreEqual(1, deserializedSeries.Values.Count);\n\n            var assetPlotSeriesPoint = deserializedSeries.Values[0] as ScatterChartPoint;\n\n            Assert.AreEqual(point.Time, assetPlotSeriesPoint.Time);\n            Assert.AreEqual(point.Y, assetPlotSeriesPoint.Y);\n            Assert.AreEqual(point.Tooltip, assetPlotSeriesPoint.Tooltip);\n        }\n\n        [Test]\n        public void Clone()\n        {\n            var point = new ScatterChartPoint() { y = 99, Time = new DateTime(2024, 01, 01), Tooltip = \"Filled @ 88 tooltip test\" };\n            var clone = (ScatterChartPoint)point.Clone();\n\n            Assert.AreEqual(point.Time, clone.Time);\n            Assert.AreEqual(point.Y, clone.Y);\n            Assert.AreEqual(point.Tooltip, clone.Tooltip);\n        }\n\n        [TestCase(\"[890370000,1.0]\", 1, null)]\n        [TestCase(\"{ \\\"x\\\": 890370000, \\\"y\\\": 1.0}\", 1, null)]\n        [TestCase(\"{ \\\"x\\\": 890370000, \\\"y\\\": null}\", null, null)]\n        [TestCase(\"{ \\\"x\\\": 890370000, \\\"y\\\": null, \\\"tooltip\\\": \\\"a Test\\\"}\", null, \"a Test\")]\n        public void Deserialize(string serialized, decimal? expected, string toolTip)\n        {\n            var deserialized = JsonConvert.DeserializeObject<ScatterChartPoint>(serialized);\n\n            var time = new DateTime(1998, 3, 20, 5, 0, 0);\n            Assert.AreEqual(time, deserialized.Time);\n            Assert.AreEqual(890370000, deserialized.X);\n            Assert.AreEqual(expected, deserialized.Y);\n            Assert.AreEqual(toolTip, deserialized.Tooltip);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Scheduling/DateRulesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Scheduling\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class DateRulesTests\n    {\n        private static DateTime _utcNow = new DateTime(2021, 07, 27, 1, 10, 10, 500);\n\n        [Test]\n        public void EveryDayDateRuleEmitsEveryDay()\n        {\n            var rules = GetDateRules();\n            var rule = rules.EveryDay();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            DateTime previous = DateTime.MinValue;\n            foreach (var date in dates)\n            {\n                count++;\n                if (previous != DateTime.MinValue)\n                {\n                    Assert.AreEqual(Time.OneDay, date - previous);\n                }\n                previous = date;\n            }\n            // leap year\n            Assert.AreEqual(366, count);\n        }\n\n        [Test]\n        public void EverySymbolDayRuleEmitsOnTradeableDates()\n        {\n            var rules = GetDateRules();\n            var rule = rules.EveryDay(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n            }\n\n            Assert.AreEqual(252, count);\n        }\n\n        [Test]\n        public void StartOfMonthNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(1, date.Day);\n            }\n\n            Assert.AreEqual(12, count);\n        }\n\n        [Test]\n        public void StartOfMonthNoSymbolMidMonthStart()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart();\n            var dates = rule.GetDates(new DateTime(2000, 01, 04), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(1, date.Day);\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [Test]\n        public void StartOfMonthNoSymbolWithOffset()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(5);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(new DateTime(2000, count, 6), date);\n                Assert.AreEqual(6, date.Day);\n            }\n            Assert.AreEqual(12, count);\n        }\n\n        [TestCase(2, false)]       // Before 11th\n        [TestCase(4, false)]\n        [TestCase(8, false)]\n        [TestCase(12, true)]      // After 11th\n        [TestCase(16, true)]\n        [TestCase(20, true)]\n        public void StartOfMonthSameMonthSchedule(int startingDateDay, bool expectNone)\n        {\n            // Reproduces issue #5678, Assert that even though start is not first of month,\n            // we still schedule for that month.\n            var startingDate = new DateTime(2000, 12, startingDateDay);\n            var endingDate = new DateTime(2000, 12, 31);\n\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(10); // 12/11/2000\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(expectNone, dates.IsNullOrEmpty());\n\n            if (!expectNone)\n            {\n                Assert.AreEqual(new DateTime(2000, 12, 11), dates.First());\n            }\n        }\n\n        [Test]\n        public void StartOfMonthWithSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.IsTrue(date.Day <= 3);\n                Log.Trace(date.Day.ToString(CultureInfo.InvariantCulture));\n            }\n\n            Assert.AreEqual(12, count);\n        }\n\n        [Test]\n        public void StartOfMonthWithSymbolMidMonthStart()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 04), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.IsTrue(date.Day <= 3);\n                Log.Trace(date.Day.ToString(CultureInfo.InvariantCulture));\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 10, 8, 8, 10, 8, 8 }, 5)]\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 20, 17, 17, 19, 17, 19 }, 12)] // Contains holiday 1/17\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 31, 29, 31, 28, 31, 30 }, 25)] // Always last trading day of the month (25 > than trading days)\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 6, 6, 6, 6, 6, 6 }, 5)]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 7, 7, 7, 7, 7, 7 }, 5)]\n        public void StartOfMonthWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays, int offset)\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(Symbols.Lookup(symbolKey), offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 6, 30)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new {date, expectedDay});\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [Test]\n        public void EndOfMonthNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(DateTime.DaysInMonth(date.Year, date.Month), date.Day);\n            }\n\n            Assert.AreEqual(12, count);\n        }\n\n        [Test]\n        public void EndOfMonthNoSymbolWithOffset()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd(5);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(DateTime.DaysInMonth(date.Year, date.Month) - 5, date.Day);\n            }\n            Assert.AreEqual(12, count);\n        }\n\n        [TestCase(5, true)]       // Before 21th\n        [TestCase(10, true)]\n        [TestCase(15, true)]\n        [TestCase(21, false)]      // After 21th\n        [TestCase(25, false)]\n        [TestCase(30, false)]\n        public void EndOfMonthSameMonthSchedule(int endingDateDay, bool expectNone)\n        {\n            // Related to issue #5678, Assert that even though end date is not end of month,\n            // we still schedule for that month.\n            var startingDate = new DateTime(2000, 12, 1);\n            var endingDate = new DateTime(2000, 12, endingDateDay);\n\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd(10); // 12/21/2000\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(expectNone, dates.IsNullOrEmpty());\n\n            if (!expectNone)\n            {\n                Assert.AreEqual(new DateTime(2000, 12, 21), dates.First());\n            }\n        }\n\n        [Test]\n        public void EndOfMonthWithSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.IsTrue(date.Day >= 28);\n                Log.Trace(date + \" \" + date.DayOfWeek);\n            }\n\n            Assert.AreEqual(12, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 24, 22, 24, 20, 23, 23 }, 5)] // This case contains two Holidays 4/21 & 5/29\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 12, 10, 15, 11, 12, 14 }, 12)] // Contains holiday 1/17\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 3, 1, 1, 3, 1, 1 }, 25)] // Always first trading day of the month (25 > than trading days)\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 26, 24, 26, 25, 26, 25 }, 5)]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 25, 23, 26, 24, 25, 25 }, 5)]\n        public void EndOfMonthWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays, int offset)\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd(Symbols.Lookup(symbolKey), offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 6, 30)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [Test]\n        public void StartOfYearNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(1, date.Day);\n                Assert.AreEqual(1, date.Month);\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [Test]\n        public void StartOfYearNoSymbolMidYearStart()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart();\n            var dates = rule.GetDates(new DateTime(2000, 06, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(2000, date.Year);\n                Assert.AreEqual(1, date.Month);\n                Assert.AreEqual(1, date.Day);\n            }\n\n            Assert.AreEqual(10, count);\n        }\n\n        [Test]\n        public void StartOfYearNoSymbolWithOffset()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart(5);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(1, date.Month);\n                Assert.AreEqual(6, date.Day);\n            }\n            Assert.AreEqual(11, count);\n        }\n\n        [TestCase(2)]       // Before 11th\n        [TestCase(4)]\n        [TestCase(8)]\n        [TestCase(12)]      // After 11th\n        [TestCase(16)]\n        [TestCase(20)]\n        public void StartOfYearSameYearSchedule(int startingDateDay)\n        {\n            var startingDate = new DateTime(2000, 1, startingDateDay);\n            var endingDate = new DateTime(2000, 12, 31);\n\n            var rules = GetDateRules();\n            var rule = rules.YearStart(10); // 11/1/2000\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(startingDateDay > 11, dates.IsNullOrEmpty());\n\n            if (startingDateDay <= 11)\n            {\n                Assert.AreEqual(new DateTime(2000, 1, 11), dates.Single());\n            }\n        }\n\n        [Test]\n        public void StartOfYearWithSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.IsTrue(date.Day <= 4);\n                Log.Debug(date.Day.ToString(CultureInfo.InvariantCulture));\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [Test]\n        public void StartOfYearWithSymbolMidYearStart()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 06, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(2000, date.Year);\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.AreEqual(1, date.Month);\n                Assert.IsTrue(date.Day <= 4);\n                Log.Debug(date.Day.ToString(CultureInfo.InvariantCulture));\n            }\n\n            Assert.AreEqual(10, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 10, 9, 9, 9, 9}, 5)]\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 20, 19, 18, 21, 21}, 12)] // Contains holiday 1/17\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 29, 31, 31, 31, 31}, 348)] // Always last trading day of the year\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 6, 6, 6, 6, 6}, 5)]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 7, 7, 7, 7, 7}, 5)]\n        public void StartOfYearWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays, int offset)\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart(Symbols.Lookup(symbolKey), offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2004, 12, 31)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [Test]\n        public void EndOfYearNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearEnd();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(12, date.Month);\n                Assert.AreEqual(DateTime.DaysInMonth(date.Year, date.Month), date.Day);\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [Test]\n        public void EndOfYearNoSymbolWithOffset()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearEnd(5);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(12, date.Month);\n                Assert.AreEqual(DateTime.DaysInMonth(date.Year, date.Month) - 5, date.Day);\n            }\n            Assert.AreEqual(11, count);\n        }\n\n        [TestCase(5)]       // Before 21th\n        [TestCase(10)]\n        [TestCase(15)]\n        [TestCase(21)]      // After 21th\n        [TestCase(25)]\n        [TestCase(30)]\n        public void EndOfYearSameMonthSchedule(int endingDateDay)\n        {\n            var startingDate = new DateTime(2000, 1, 1);\n            var endingDate = new DateTime(2000, 12, endingDateDay);\n\n            var rules = GetDateRules();\n            var rule = rules.YearEnd(10); // 12/21/2000\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(endingDateDay < 21, dates.IsNullOrEmpty());\n\n            if (endingDateDay >= 21)\n            {\n                Assert.AreEqual(new DateTime(2000, 12, 21), dates.Single());\n            }\n        }\n\n        [Test]\n        public void EndOfYearWithSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearEnd(Symbols.SPY);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2010, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreNotEqual(DayOfWeek.Saturday, date.DayOfWeek);\n                Assert.AreNotEqual(DayOfWeek.Sunday, date.DayOfWeek);\n                Assert.AreEqual(12, date.Month);\n                Assert.IsTrue(date.Day >= 28);\n                Log.Debug(date + \" \" + date.DayOfWeek);\n            }\n\n            Assert.AreEqual(11, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 21, 21, 23, 23, 23 }, 5)] // This case contains two Holidays 12/25 & 12/29\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 12, 12, 12, 12, 14 }, 12)] // Contains holiday 1/25\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 1, 3, 3, 3, 3 }, 19)] // Always first trading day of the month (25 > than trading days)\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 26, 26, 26, 26, 26 }, 5)]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 25, 25, 25, 25, 26 }, 5)]\n        public void EndOfYearWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays, int offset)\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearEnd(Symbols.Lookup(symbolKey), offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2004, 12, 31)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [Test]\n        public void StartOfWeekNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekStart();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(DayOfWeek.Monday, date.DayOfWeek);\n            }\n\n            Assert.AreEqual(52, count);\n        }\n\n        [TestCase(0, DayOfWeek.Monday)]\n        [TestCase(1, DayOfWeek.Tuesday)]\n        [TestCase (2, DayOfWeek.Wednesday)]\n        [TestCase(3, DayOfWeek.Thursday)]\n        [TestCase(4, DayOfWeek.Friday)]\n        [TestCase(5, DayOfWeek.Saturday)]\n        [TestCase(6, DayOfWeek.Sunday)]\n        public void StartOfWeekNoSymbolWithOffset(int offset, DayOfWeek expectedDayOfWeek)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekStart(offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(expectedDayOfWeek, date.DayOfWeek);\n            }\n\n            // There are 53 saturday and sundays in 2000, otherwise we expect only 52\n            int expected = expectedDayOfWeek == DayOfWeek.Saturday || expectedDayOfWeek == DayOfWeek.Sunday ? 53 : 52;\n            Assert.AreEqual(expected, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 3, 10, 18, 24, 31 })]\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 2, 9, 16, 23, 30 })]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 2, 9, 16, 23, 30 })]\n        [TestCase(Symbols.SymbolsKey.Fut_SPY_Feb19_2016, new int[] { 2, 9, 16, 23, 30 })]\n        public void StartOfWeekWithSymbol(Symbols.SymbolsKey symbolKey, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekStart(Symbols.Lookup(symbolKey));\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 1, 31)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [TestCase(false, new int[] { 3, 10, 18, 24, 31 })]\n        [TestCase(true, new int[] { 2, 9, 16, 23, 30 })]\n        public void StartOfWeekWithSymbolUsingExtendedMarketHoursParameter(bool extendedMarketHours, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekStart(Symbols.Lookup(Symbols.SymbolsKey.Fut_SPY_Feb19_2016), extendedMarketHours: extendedMarketHours);\n\n            AssertDateRule(rule, new DateTime(2000, 01, 01), new DateTime(2000, 1, 31), expectedDays);\n        }\n\n        [TestCase(false, new int[] { 3, 3, 3, 2, 2 })]\n        [TestCase(true, new int[] { 3, 1, 3, 2, 2 })]\n        public void StartOfYearWithSymbolUsingExtendedMarketHoursParameter(bool extendedMarketHours, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearStart(Symbols.Lookup(Symbols.SymbolsKey.Fut_SPY_Feb19_2016), extendedMarketHours: extendedMarketHours);\n\n            AssertDateRule(rule, new DateTime(2005, 01, 01), new DateTime(2009, 1, 31), expectedDays);\n        }\n\n        [TestCase(false, new int[] { 30, 29, 31, 31, 31})]\n        [TestCase(true, new int[] { 30, 31, 31, 31, 31 })]\n        public void EndOfYearWithSymbolUsingExtendedMarketHoursParameter(bool extendedMarketHours, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.YearEnd(Symbols.Lookup(Symbols.SymbolsKey.Fut_SPY_Feb19_2016), extendedMarketHours: extendedMarketHours);\n\n            AssertDateRule(rule, new DateTime(2005, 01, 01), new DateTime(2010, 1, 1), expectedDays);\n        }\n\n        [TestCase(false, new int[] { 1, 1, 2, 1, 1 })]\n        [TestCase(true, new int[] { 1, 1, 1, 1, 1 })]\n        public void StartOfMonthWithSymbolUsingExtendedMarketHoursParameter(bool extendedMarketHours, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthStart(Symbols.Lookup(Symbols.SymbolsKey.Fut_SPY_Feb19_2016), extendedMarketHours: extendedMarketHours);\n\n            AssertDateRule(rule, new DateTime(2000, 08, 01), new DateTime(2000, 12, 31), expectedDays);\n        }\n\n        [TestCase(false, new int[] { 31, 29, 31, 30, 29 })]\n        [TestCase(true, new int[] { 31, 29, 31, 30, 31 })]\n        public void EndOfMonthWithSymbolUsingExtendedMarketHoursParameter(bool extendedMarketHours, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.MonthEnd(Symbols.Lookup(Symbols.SymbolsKey.Fut_SPY_Feb19_2016), extendedMarketHours: extendedMarketHours);\n\n            AssertDateRule(rule, new DateTime(2000, 08, 01), new DateTime(2000, 12, 31), expectedDays);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 5, 12, 20, 26 })] // Set contains holiday on 1/17\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 4, 11, 18, 25 })]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 4, 11, 18, 25 })]\n        public void StartOfWeekWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekStart(Symbols.Lookup(symbolKey), 2);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 1, 31)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [TestCase(3, false)]    // Start before the 6th\n        [TestCase(4, false)]    \n        [TestCase(5, false)]\n        [TestCase(6, false)]\n        [TestCase(7, true)]     // Start after the 6th\n        [TestCase(8, true)]\n        [TestCase(9, true)]\n        public void StartOfWeekSameWeekSchedule(int startingDateDay, bool expectNone)\n        {\n            // Related to issue #5678, Assert that even though starting date may not be\n            // not monday we still schedule for that week.\n\n            // For this test and the EndOfWeek counterpart we will use the week of\n            // 1/3/2000 Monday to 1/9/2000 Sunday; with our variable date applied.\n            var startingDate = new DateTime(2000, 1, startingDateDay);\n            var endingDate = new DateTime(2000, 1, 9);\n\n            var rules = GetDateRules();\n            var rule = rules.WeekStart(3); // 1/6/2000\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(expectNone, dates.IsNullOrEmpty());\n\n            if (!expectNone)\n            {\n                Assert.AreEqual(new DateTime(2000, 1, 6), dates.First());\n            }\n        }\n\n        [TestCase(5)] // Monday + 5 = Saturday\n        [TestCase(6)] // Monday + 6 = Sunday\n        public void StartOfWeekWithSymbolOffsetToNonTradableDay(int offset)\n        {\n            var rules = GetDateRules();\n\n            // We expect it to throw because Spy does not trade on the weekends\n            Assert.Throws<ArgumentOutOfRangeException>(() => rules.WeekStart(Symbols.SPY, offset));\n        }\n\n        [Test]\n        public void EndOfWeekNoSymbol()\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekEnd();\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(DayOfWeek.Friday, date.DayOfWeek);\n            }\n\n            Assert.AreEqual(52, count);\n        }\n\n        [TestCase(0, DayOfWeek.Friday)]\n        [TestCase(1, DayOfWeek.Thursday)]\n        [TestCase(2, DayOfWeek.Wednesday)]\n        [TestCase(3, DayOfWeek.Tuesday)]\n        [TestCase(4, DayOfWeek.Monday)]\n        [TestCase(5, DayOfWeek.Sunday)]\n        [TestCase(6, DayOfWeek.Saturday)]\n        public void EndOfWeekNoSymbolWithOffset(int offset, DayOfWeek expectedDayOfWeek)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekEnd(offset);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 12, 31));\n\n            int count = 0;\n            foreach (var date in dates)\n            {\n                count++;\n                Assert.AreEqual(expectedDayOfWeek, date.DayOfWeek);\n            }\n\n            Assert.AreEqual(52, count);\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 7, 14, 21, 28 })]\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 1, 8, 15, 22, 29 })]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 7, 14, 21, 28 })]\n        [TestCase(Symbols.SymbolsKey.Fut_SPY_Feb19_2016, new int[] { 7, 14, 21, 28 })]\n        public void EndOfWeekWithSymbol(Symbols.SymbolsKey symbolKey, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekEnd(Symbols.Lookup(symbolKey));\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 1, 31)).ToList();\n\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [TestCase(Symbols.SymbolsKey.SPY, new[] { 5, 12, 19, 26 })]\n        [TestCase(Symbols.SymbolsKey.BTCUSD, new[] { 6, 13, 20, 27 })]\n        [TestCase(Symbols.SymbolsKey.EURUSD, new[] { 5, 12, 19, 26 })]\n        public void EndOfWeekWithSymbolWithOffset(Symbols.SymbolsKey symbolKey, int[] expectedDays)\n        {\n            var rules = GetDateRules();\n            var rule = rules.WeekEnd(Symbols.Lookup(symbolKey), 2);\n            var dates = rule.GetDates(new DateTime(2000, 01, 01), new DateTime(2000, 1, 31)).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        [TestCase(3, true)]     // End before the 6th\n        [TestCase(4, true)]\n        [TestCase(5, true)]\n        [TestCase(6, false)]    // End after the 6th\n        [TestCase(7, false)]     \n        [TestCase(8, false)]\n        [TestCase(9, false)]\n        public void EndOfWeekSameWeekSchedule(int endDateDay, bool expectNone)\n        {\n            // Related to issue #5678, Assert that even though starting date may not be\n            // not monday we still schedule for that week.\n\n            // For this test and the EndOfWeek counterpart we will use the week of\n            // 1/3/2000 Monday to 1/9/2000 Sunday; with our variable date applied.\n            var startingDate = new DateTime(2000, 1, 3);\n            var endingDate = new DateTime(2000, 1, endDateDay);\n\n            var rules = GetDateRules();\n            var rule = rules.WeekEnd(1); // 1/6/2000 (For weekEnd, Friday is the base day)\n            var dates = rule.GetDates(startingDate, endingDate);\n\n            Assert.AreEqual(expectNone, dates.IsNullOrEmpty());\n\n            if (!expectNone)\n            {\n                Assert.AreEqual(new DateTime(2000, 1, 6), dates.First());\n            }\n        }\n\n        [TestCase(5)] // Friday - 5 = Sunday\n        [TestCase(6)] // Friday - 6 = Saturday\n        public void EndOfWeekWithSymbolOffsetToNonTradableDay(int offset)\n        {\n            var rules = GetDateRules();\n\n            // We expect it to throw because Spy does not trade on the weekends\n            Assert.Throws<ArgumentOutOfRangeException>(() => rules.WeekEnd(Symbols.SPY, offset));\n        }\n\n        [Test]\n        public void DateRulesExpectedNames()\n        {\n            var rules = GetDateRules();\n            IDateRule rule;\n\n            // WeekEnd Rules\n            rule = rules.WeekEnd();\n            Assert.AreEqual(\"WeekEnd\", rule.Name);\n\n            rule = rules.WeekEnd(1);\n            Assert.AreEqual(\"WeekEnd-1\", rule.Name);\n\n            rule = rules.WeekEnd(Symbols.SPY);\n            Assert.AreEqual(\"SPY: WeekEnd\", rule.Name);\n\n            rule = rules.WeekEnd(Symbols.SPY, 2);\n            Assert.AreEqual(\"SPY: WeekEnd-2\", rule.Name);\n\n            // WeekStart rules\n            rule = rules.WeekStart();\n            Assert.AreEqual(\"WeekStart\", rule.Name);\n\n            rule = rules.WeekStart(1);\n            Assert.AreEqual(\"WeekStart+1\", rule.Name);\n\n            rule = rules.WeekStart(Symbols.SPY);\n            Assert.AreEqual(\"SPY: WeekStart\", rule.Name);\n\n            rule = rules.WeekStart(Symbols.SPY, 3);\n            Assert.AreEqual(\"SPY: WeekStart+3\", rule.Name);\n        }\n\n        [Test]\n        public void SetTimeZone()\n        {\n            var rules = GetDateRules();\n            var nowNewYork = rules.Today.GetDates(_utcNow, _utcNow).Single();\n\n            rules.SetDefaultTimeZone(TimeZones.Utc);\n\n            var nowUtc = rules.Today.GetDates(_utcNow, _utcNow).Single();\n\n            Assert.AreEqual(_utcNow.Date, nowUtc);\n            Assert.AreEqual(nowUtc.Date, nowNewYork.AddDays(1));\n        }\n\n        [Test]\n        public void SetFuncDateRuleInPythonWorksAsExpected()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\ndef CustomDateRule(start, end):\n    return [start + (end - start)/2]\n\");\n                dynamic pythonCustomDateRule = pythonModule.GetAttr(\"CustomDateRule\");\n                var funcDateRule = new FuncDateRule(\"PythonFuncDateRule\", pythonCustomDateRule);\n                Assert.AreEqual(\"PythonFuncDateRule\", funcDateRule.Name);\n                Assert.AreEqual(new DateTime(2023, 1, 16, 12, 0, 0), funcDateRule.GetDates(new DateTime(2023, 1, 1), new DateTime(2023, 2, 1)).First());\n            }\n        }\n\n        [Test]\n        public void SetFuncDateRuleInPythonWorksAsExpectedWithCSharpFunc()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\ndef GetFuncDateRule(csharpFunc):\n    return FuncDateRule(\"\"CSharp\"\", csharpFunc)\n\");\n                dynamic getFuncDateRule = pythonModule.GetAttr(\"GetFuncDateRule\");\n                Func<DateTime, DateTime, IEnumerable<DateTime>> csharpFunc = (start, end) => { return new List<DateTime>() { new DateTime(2001, 3, 18) }; };\n                var funcDateRule = getFuncDateRule(csharpFunc);\n                Assert.AreEqual(\"CSharp\", (funcDateRule.Name as PyObject).GetAndDispose<string>());\n                Assert.AreEqual(new DateTime(2001, 3, 18),\n                    (funcDateRule.GetDates(new DateTime(2023, 1, 1), new DateTime(2023, 2, 1)) as PyObject).GetAndDispose<List<DateTime>>().First());\n            }\n        }\n\n        [Test]\n        public void SetFuncDateRuleInPythonFailsWhenDateRuleIsInvalid()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\nwrongCustomDateRule = 1\n\");\n                dynamic pythonCustomDateRule = pythonModule.GetAttr(\"wrongCustomDateRule\");\n                Assert.Throws<ArgumentException>(() => new FuncDateRule(\"PythonFuncDateRule\", pythonCustomDateRule));\n            }\n        }\n\n        [Test]\n        public void DateRuleDoesNotConflictWithTimeRuleDueToExtendedMarketHours()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(new DateTime(2024, 02, 10));\n            var es = algorithm.AddFuture(\"ES\").Symbol;\n\n            var scheduledEvent = algorithm.Schedule.On(algorithm.Schedule.DateRules.WeekStart(es, extendedMarketHours: false),\n                algorithm.Schedule.TimeRules.AfterMarketOpen(es),\n                () => { });\n            Assert.AreEqual(new DateTime(2024, 02, 12, 14, 30, 0), scheduledEvent.NextEventUtcTime);\n        }\n\n        private static void AssertDateRule(IDateRule rule, DateTime start, DateTime end, int[] expectedDays)\n        {\n            var dates = rule.GetDates(start, end).ToList();\n\n            // Assert we have as many dates as expected\n            Assert.AreEqual(expectedDays.Length, dates.Count);\n\n            // Verify the days match up\n            var datesAndExpectedDays = dates.Zip(expectedDays, (date, expectedDay) => new { date, expectedDay });\n            foreach (var pair in datesAndExpectedDays)\n            {\n                Assert.AreEqual(pair.expectedDay, pair.date.Day);\n            }\n        }\n\n        private static DateRules GetDateRules()\n        {\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var timeKeeper = new TimeKeeper(_utcNow, new List<DateTimeZone>());\n            var manager = new SecurityManager(timeKeeper);\n\n            // Add SPY for Equity testing\n            var securityExchangeHours = mhdb.GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            manager.Add(\n                Symbols.SPY,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            // Add BTC for Crypto testing\n            securityExchangeHours = mhdb.GetExchangeHours(Market.Bitfinex, Symbols.BTCUSD, SecurityType.Crypto);\n            config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            manager.Add(\n                Symbols.BTCUSD,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            // Add EURUSD for Forex testing\n            securityExchangeHours = mhdb.GetExchangeHours(Market.FXCM, Symbols.EURUSD, SecurityType.Forex);\n            config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURUSD, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            manager.Add(\n                Symbols.EURUSD,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            // Add Fut_SPY_Feb19_2016 for testing\n            securityExchangeHours = mhdb.GetExchangeHours(Market.CME, Symbols.Fut_SPY_Feb19_2016, SecurityType.Future);\n            config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.Fut_SPY_Feb19_2016, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            manager.Add(\n                Symbols.Fut_SPY_Feb19_2016,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var rules = new DateRules(null, manager, TimeZones.NewYork, mhdb);\n            return rules;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Scheduling/ScheduleManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Tests.Common.Scheduling\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ScheduleManagerTests\n    {\n        [Test]\n        public void DuplicateScheduledEventsAreBothFired()\n        {\n            var algorithm = new QCAlgorithm();\n\n            var handler = new BacktestingRealTimeHandler();\n            var timeLimitManager = new AlgorithmTimeLimitManager(TokenBucket.Null, TimeSpan.MaxValue);\n            handler.Setup(algorithm, new AlgorithmNodePacket(PacketType.BacktestNode), null, null, timeLimitManager);\n\n            algorithm.Schedule.SetEventSchedule(handler);\n\n            var time = new DateTime(2018, 1, 1);\n            algorithm.SetDateTime(time);\n\n            var count1 = 0;\n            var count2 = 0;\n            algorithm.Schedule.On(algorithm.Schedule.DateRules.EveryDay(), algorithm.Schedule.TimeRules.Every(TimeSpan.FromHours(1)), () => { count1++; });\n            algorithm.Schedule.On(algorithm.Schedule.DateRules.EveryDay(), algorithm.Schedule.TimeRules.Every(TimeSpan.FromHours(1)), () => { count2++; });\n\n            const int timeSteps = 12;\n\n            for (var i = 0; i < timeSteps; i++)\n            {\n                handler.SetTime(time);\n                time = time.AddHours(1);\n            }\n\n            handler.Exit();\n            Assert.AreEqual(timeSteps, count1);\n            Assert.AreEqual(timeSteps, count2);\n        }\n\n        [Test]\n        public void TriggersWeeklyScheduledEventsEachWeekBacktesting()\n        {\n            var algorithm = new AlgorithmStub();\n\n            var handler = new BacktestingRealTimeHandler();\n            var time = new DateTime(2024, 02, 10);\n            handler.SetTime(time);\n            var timeLimitManager = new AlgorithmTimeLimitManager(TokenBucket.Null, TimeSpan.FromMinutes(20));\n            handler.Setup(algorithm, new AlgorithmNodePacket(PacketType.BacktestNode), null, null, timeLimitManager);\n\n            algorithm.Schedule.SetEventSchedule(handler);\n\n            algorithm.SetDateTime(time);\n\n            var spy = algorithm.AddEquity(\"SPY\").Symbol;\n\n            var eventTriggerTimes = new List<DateTime>();\n            var scheduledEvent = algorithm.Schedule.On(algorithm.Schedule.DateRules.WeekStart(spy),\n                algorithm.Schedule.TimeRules.BeforeMarketClose(spy, 3),\n                () =>\n                {\n                    eventTriggerTimes.Add(time);\n                });\n\n            while (time.Month < 4)\n            {\n                handler.SetTime(time);\n                time = time.AddMinutes(1);\n            }\n\n            handler.Exit();\n\n            var expectedEventTriggerTimes = new List<DateTime>()\n            {\n                new DateTime(2024, 02, 12, 20, 57, 0),\n                new DateTime(2024, 02, 20, 20, 57, 0),  // Monday is 19th but it's a holiday\n                new DateTime(2024, 02, 26, 20, 57, 0),\n                new DateTime(2024, 03, 04, 20, 57, 0),\n                // Daylight saving adjustment\n                new DateTime(2024, 03, 11, 19, 57, 0),\n                new DateTime(2024, 03, 18, 19, 57, 0),\n                new DateTime(2024, 03, 25, 19, 57, 0),\n            };\n            CollectionAssert.AreEqual(expectedEventTriggerTimes, eventTriggerTimes);\n        }\n\n        [Test]\n        public void TriggersWeeklyScheduledEventsEachWeekLive()\n        {\n            var time = new DateTime(2024, 02, 10);\n            SetUp(time, out var algorithm, out var handler, out var spy);\n            var eventTriggerTimes = new List<DateTime>();\n            var scheduledEvent = algorithm.Schedule.On(algorithm.Schedule.DateRules.WeekStart(spy),\n                algorithm.Schedule.TimeRules.BeforeMarketClose(spy, 60),\n                () =>\n                {\n                    eventTriggerTimes.Add(handler.ManualTimeProvider.GetUtcNow());\n                });\n\n            algorithm.SetFinishedWarmingUp();\n\n            using var finished = new ManualResetEventSlim(false);\n\n            // Schedule a task to advance time\n            var timeStep = TimeSpan.FromMinutes(60);\n            algorithm.Schedule.On(algorithm.Schedule.DateRules.EveryDay(),\n                algorithm.Schedule.TimeRules.Every(timeStep),\n                () =>\n                {\n                    handler.ManualTimeProvider.Advance(timeStep);\n                    var now = handler.ManualTimeProvider.GetUtcNow();\n                    if (now.Month >= 4)\n                    {\n                        finished.Set();\n                    }\n                });\n\n            // Start\n            handler.SetTime(time);\n\n            finished.Wait(TimeSpan.FromSeconds(15));\n\n            handler.Exit();\n\n            var expectedEventTriggerTimes = new List<DateTime>()\n            {\n                new DateTime(2024, 02, 12, 20, 0, 0),\n                new DateTime(2024, 02, 20, 20, 0, 0),   // Monday is 19th but it's a holiday\n                new DateTime(2024, 02, 26, 20, 0, 0),\n                new DateTime(2024, 03, 04, 20, 0, 0),\n                // Daylight saving adjustment\n                new DateTime(2024, 03, 11, 19, 0, 0),\n                new DateTime(2024, 03, 18, 19, 0, 0),\n                new DateTime(2024, 03, 25, 19, 0, 0),\n            };\n            CollectionAssert.AreEqual(expectedEventTriggerTimes, eventTriggerTimes);\n        }\n\n        [Test]\n        public void DatesReturnedAreNormalized()\n        {\n            var time = new DateTime(2024, 02, 10);\n            SetUp(time, out var algorithm, out var handler, out var spy);\n            var eventTriggerTimes = new List<DateTime>();\n            using var finished = new ManualResetEventSlim(false);\n\n            // Schedule a task to advance time\n            var timeStep = TimeSpan.FromMinutes(1);\n            var wasCalled = false;\n            Func<DateTime, DateTime, IEnumerable<DateTime>> func = (date1, date2) =>\n            {\n                Assert.AreEqual(DateTimeKind.Unspecified, date1.Kind);\n                Assert.AreEqual(DateTimeKind.Unspecified, date2.Kind);\n                wasCalled = true;\n                return new List<DateTime> { date1, date2 };\n            };\n\n            algorithm.Schedule.On(new FuncDateRule(\"Test\", func),\n                algorithm.Schedule.TimeRules.Every(timeStep),\n                () =>\n                {\n                    handler.ManualTimeProvider.Advance(timeStep);\n                    var now = handler.ManualTimeProvider.GetUtcNow();\n                    finished.Set();\n                });\n\n            // Start\n            handler.SetTime(time);\n\n            finished.Wait(TimeSpan.FromSeconds(15));\n\n            handler.Exit();\n            Assert.IsTrue(wasCalled);\n        }\n\n        private void SetUp(DateTime time, out QCAlgorithm algorithm, out TestableLiveTradingRealTimeHandler handler, out Symbol spy)\n        {\n            algorithm = new AlgorithmStub();\n\n            handler = new TestableLiveTradingRealTimeHandler();\n\n            handler.ManualTimeProvider.SetCurrentTime(time);\n            var timeLimitManager = new AlgorithmTimeLimitManager(TokenBucket.Null, TimeSpan.FromMinutes(20));\n            handler.Setup(algorithm, new LiveNodePacket(), null, null, timeLimitManager);\n\n            algorithm.Schedule.SetEventSchedule(handler);\n\n            algorithm.SetDateTime(time);\n\n            spy = algorithm.AddEquity(\"SPY\").Symbol;\n        }\n\n        private class TestableLiveTradingRealTimeHandler : LiveTradingRealTimeHandler\n        {\n            public ManualTimeProvider ManualTimeProvider = new ManualTimeProvider();\n\n            protected override ITimeProvider TimeProvider => ManualTimeProvider;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Scheduling/ScheduledEventTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Scheduling\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ScheduledEventTests\n    {\n        [Test]\n        public void FiresEventOnTime()\n        {\n            var fired = false;\n            var time = new DateTime(2015, 08, 11, 10, 30, 0);\n            using var sevent = new ScheduledEvent(\"test\", time, (n, t) => fired = true);\n            sevent.Scan(time);\n            Assert.IsTrue(fired);\n        }\n\n        [Test]\n        public void NextEventTimeIsMaxValueWhenNoEvents()\n        {\n            using var sevent = new ScheduledEvent(\"test\", new DateTime[0], (n, t) => { });\n            Assert.AreEqual(DateTime.MaxValue, sevent.NextEventUtcTime);\n        }\n\n        [Test]\n        public void NextEventTimeIsMaxValueWhenNoMoreEvents()\n        {\n            var time = new DateTime(2015, 08, 11, 10, 30, 0);\n            using var sevent = new ScheduledEvent(\"test\", time, (n, t) => { });\n            sevent.Scan(time);\n            Assert.AreEqual(DateTime.MaxValue, sevent.NextEventUtcTime);\n        }\n\n        [Test]\n        public void FiresSkippedEventsInSameCallToScan()\n        {\n            var count = 0;\n            var time = new DateTime(2015, 08, 11, 10, 30, 0);\n            using var sevent = new ScheduledEvent(\"test\", new[] { time.AddSeconds(-2), time.AddSeconds(-1), time}, (n, t) => count++);\n            sevent.Scan(time);\n            Assert.AreEqual(3, count);\n        }\n\n        [Test]\n        public void SkipsEventsUntilTime()\n        {\n            var count = 0;\n            var time = new DateTime(2015, 08, 11, 10, 30, 0);\n            using var sevent = new ScheduledEvent(\"test\", new[] { time.AddSeconds(-2), time.AddSeconds(-1), time }, (n, t) => count++);\n            // skips all preceding events, not including the specified time\n            sevent.SkipEventsUntil(time);\n            Assert.AreEqual(time, sevent.NextEventUtcTime);\n            Assert.AreEqual(0, count);\n        }\n\n        [Test]\n        public void SkipEventsUntilDoesNotSkipFirstEventEqualToRequestedTime()\n        {\n            var count = 0;\n            var time = new DateTime(2015, 08, 11, 10, 30, 0);\n            var eventTimes = new[] {time, time.AddSeconds(1)};\n            using var sevent = new ScheduledEvent(\"test\", eventTimes, (n, t) => count++);\n            // skips all preceding events, not including the specified time\n            sevent.SkipEventsUntil(time);\n            Assert.AreEqual(time, sevent.NextEventUtcTime);\n            Assert.AreEqual(0, count);\n        }\n\n        [Test]\n        public void FiresEventWhenTimeEquals()\n        {\n            var triggered = false;\n            using var se = new ScheduledEvent(\"test\", new DateTime(2015, 08, 07), (name, triggerTime) =>\n            {\n                triggered = true;\n            })\n            { IsLoggingEnabled = true };\n\n            se.Scan(new DateTime(2015, 08, 06));\n            Assert.IsFalse(triggered);\n\n            se.Scan(new DateTime(2015, 08, 07));\n            Assert.IsTrue(triggered);\n        }\n\n        [Test]\n        public void FiresEventWhenTimePasses()\n        {\n            var triggered = false;\n            using var se = new ScheduledEvent(\"test\", new DateTime(2015, 08, 07), (name, triggerTime) =>\n            {\n                triggered = true;\n            })\n            { IsLoggingEnabled = true };\n\n            se.Scan(new DateTime(2015, 08, 06));\n            Assert.IsFalse(triggered);\n\n            se.Scan(new DateTime(2015, 08, 08));\n            Assert.IsTrue(triggered);\n        }\n\n        [Test]\n        public void SchedulesNextEvent()\n        {\n            var first = new DateTime(2015, 08, 07);\n            var second = new DateTime(2015, 08, 08);\n            var dates = new[] { first, second }.ToHashSet();\n            using var se = new ScheduledEvent(\"test\", dates.ToList(), (name, triggerTime) =>\n            {\n                dates.Remove(triggerTime);\n            });\n\n            se.Scan(first);\n            Assert.IsFalse(dates.Contains(first));\n\n            se.Scan(second);\n            Assert.IsFalse(dates.Contains(second));\n        }\n\n        [Test]\n        public void DoesNothingAfterEventsEnd()\n        {\n            var triggered = false;\n            var first = new DateTime(2015, 08, 07);\n            using var se = new ScheduledEvent(\"test\", first, (name, triggerTime) =>\n            {\n                triggered = true;\n            });\n\n            se.Scan(first);\n            Assert.IsTrue(triggered);\n\n            triggered = false;\n            se.Scan(first.AddYears(100));\n            Assert.IsFalse(triggered);\n        }\n\n        [Test]\n        public void ScheduledEventsWithSameNameAreDifferent()\n        {\n            var first = DateTime.UtcNow;\n            using var se1 = new ScheduledEvent(\"test\", first);\n            using var se2 = new ScheduledEvent(\"test\", first);\n\n            Assert.AreEqual(se1.Name, se2.Name);\n            Assert.AreNotEqual(se1, se2);\n        }\n\n        [Test]\n        public void CompareToItselfReturnsTrue()\n        {\n            var time = DateTime.UtcNow;\n            using var se1 = new ScheduledEvent(\"test\", time);\n            var se2 = se1;\n\n            Assert.IsTrue(Equals(se1, se2));\n            Assert.AreEqual(se1, se2);\n        }\n\n        [Test]\n        public void CompareToNullReturnsFalse()\n        {\n            var time = DateTime.UtcNow;\n            using var se = new ScheduledEvent(\"test\", time);\n\n            Assert.IsFalse(Equals(se, null));\n            Assert.AreNotEqual(se, null);\n        }\n\n        [Test]\n        public void ToStringTest()\n        {\n            var name = \"PepeGrillo\";\n            using var se = new ScheduledEvent(name, DateTime.UtcNow);\n\n            Assert.IsNotNull(se);\n            Assert.AreEqual(name, se.ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Scheduling/TimeRulesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Scheduling\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class TimeRulesTests\n    {\n        private static DateTime _utcNow = new DateTime(2021, 07, 27, 1, 10, 10, 500);\n\n        [Test]\n        public void AtSpecificTimeFromUtc()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.At(TimeSpan.FromHours(12));\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 01) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(12), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void AtSpecificTimeFromNonUtc()\n        {\n            var rules = GetTimeRules(TimeZones.NewYork);\n            var rule = rules.At(TimeSpan.FromHours(12));\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 01) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(12 + 5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void RegularMarketOpenNoDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(Symbols.SPY);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(9.5 + 5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void RegularMarketOpenWithDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(Symbols.SPY, 30);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(9.5 + 5 + .5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void ExtendedMarketOpenNoDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(Symbols.SPY, 0, true);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(4 + 5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void RegularMarketOpenNoDeltaForContinuousSchedules()\n        {\n            var rules = GetFutureTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(Symbols.ES_Future_Chain, 0);\n            var times = rule.CreateUtcEventTimes(new[] {\n                new DateTime(2022, 01, 03),\n                new DateTime(2022, 01, 04),\n                new DateTime(2022, 01, 05),\n                new DateTime(2022, 01, 06),\n                new DateTime(2022, 01, 07),\n                new DateTime(2022, 01, 10)\n            });\n\n            var expectedMarketOpenDates = new[] {\n                new DateTime(2022, 01, 03, 14, 30, 0),\n                new DateTime(2022, 01, 04, 14, 30, 0),\n                new DateTime(2022, 01, 05, 14, 30, 0),\n                new DateTime(2022, 01, 06, 14, 30, 0),\n                new DateTime(2022, 01, 07, 14, 30, 0),\n                new DateTime(2022, 01, 10, 14, 30, 0)\n            };\n            int count = 0;\n            foreach (var time in times)\n            {\n                Assert.AreEqual(expectedMarketOpenDates[count], time);\n                count++;\n            }\n            Assert.AreEqual(6, count);\n        }\n\n        [Test]\n        public void ExtendedMarketOpenNoDeltaForContinuousSchedules()\n        {\n            var rules = GetFutureTimeRules(TimeZones.Utc, true);\n            var rule = rules.AfterMarketOpen(Symbols.ES_Future_Chain, 0, true);\n            var times = rule.CreateUtcEventTimes(new[] {\n                new DateTime(2022, 01, 01),\n                new DateTime(2022, 01, 02),\n                new DateTime(2022, 01, 03),\n                new DateTime(2022, 01, 04),\n                new DateTime(2022, 01, 05),\n                new DateTime(2022, 01, 06),\n                new DateTime(2022, 01, 07),\n                new DateTime(2022, 01, 08),\n                new DateTime(2022, 01, 09)\n            });\n\n            var expectedMarketOpenDates = new[] {\n                new DateTime(2022, 01, 02, 23, 0, 0), // sunday 6pm\n                // market is open for the whole day, so goes from midnight to midnight\n                new DateTime(2022, 01, 03, 5, 0, 0),\n                new DateTime(2022, 01, 04, 5, 0, 0),\n                new DateTime(2022, 01, 05, 5, 0, 0),\n                new DateTime(2022, 01, 06, 5, 0, 0),\n                new DateTime(2022, 01, 07, 5, 0, 0),\n                new DateTime(2022, 01, 09, 23, 0, 0) // sunday 6pm\n            };\n            int count = 0;\n            foreach (var time in times)\n            {\n                Assert.AreEqual(expectedMarketOpenDates[count], time);\n                count++;\n            }\n            Assert.AreEqual(7, count);\n        }\n\n        [TestCase(true, 9 - 0.5)]\n        [TestCase(false, 14.5 - 0.5)]\n        public void BeforeMarketOpenWithDelta(bool extendedMarketHours, double expectedHour)\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketOpen(Symbols.SPY, 30, extendedMarketHours);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n            var type = extendedMarketHours ? \"ExtendedMarketOpen\" : \"MarketOpen\";\n            Assert.AreEqual($\"{Symbols.SPY}: 30 min before {type}\", rule.Name);\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(expectedHour), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void ExtendedMarketCloseNoDeltaForContinuousSchedules()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(Symbols.SPY, 0, true);\n            var times = rule.CreateUtcEventTimes(new[] {\n                new DateTime(2022, 01, 01),\n                new DateTime(2022, 01, 02),\n                new DateTime(2022, 01, 03),\n                new DateTime(2022, 01, 04),\n                new DateTime(2022, 01, 05),\n                new DateTime(2022, 01, 06),\n                new DateTime(2022, 01, 07),\n                new DateTime(2022, 01, 08),\n                new DateTime(2022, 01, 09)\n            });\n\n            var expectedMarketOpenDates = new[] {\n                new DateTime(2022, 01, 04, 01, 00, 00),\n                new DateTime(2022, 01, 05, 01, 00, 00),\n                new DateTime(2022, 01, 06, 01, 00, 00),\n                new DateTime(2022, 01, 07, 01, 00, 00),\n                new DateTime(2022, 01, 08, 01, 00, 00)\n            };\n            int count = 0;\n            foreach (var time in times)\n            {\n                Assert.AreEqual(expectedMarketOpenDates[count], time);\n                count++;\n            }\n            Assert.AreEqual(5, count);\n        }\n\n        [Test]\n        public void ExtendedMarketOpenWithDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(Symbols.SPY, 30, true);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(4 + 5 + .5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void MultipleMarketOpen(bool extendedMarketHours)\n        {\n            var symbol = Symbols.CreateFutureSymbol(\"HSI\", new DateTime(2025, 01, 27));\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketOpen(symbol, extendedMarketOpen: extendedMarketHours);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 04) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                if (extendedMarketHours)\n                {\n                    Assert.AreEqual(TimeSpan.FromHours(24 - 8), time.TimeOfDay);\n                }\n                else\n                {\n                    Assert.AreEqual(TimeSpan.FromHours(9.25 - 8), time.TimeOfDay);\n                }\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void MultipleMarketClosure(bool extendedMarketHours)\n        {\n            var symbol = Symbols.CreateFutureSymbol(\"HSI\", new DateTime(2025, 01, 27));\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(symbol, extendedMarketClose: extendedMarketHours);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                if (extendedMarketHours)\n                {\n                    Assert.AreEqual(TimeSpan.FromHours(24 - 8), time.TimeOfDay);\n                }\n                else\n                {\n                    Assert.AreEqual(TimeSpan.FromHours(16.5 - 8), time.TimeOfDay);\n                }\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void RegularMarketCloseNoDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(Symbols.SPY);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(16 + 5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void RegularMarketCloseWithDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(Symbols.SPY, 30);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(16 + 5 - .5), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void ExtendedMarketCloseNoDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(Symbols.SPY, 0, true);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours((20 + 5) % 24), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [Test]\n        public void ExtendedMarketCloseWithDelta()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.BeforeMarketClose(Symbols.SPY, 30, true);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours((20 + 5 - .5) % 24), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [TestCase(true, (21 + 4 + .5) % 24)]\n        [TestCase(false, (21 + .5) % 24)]\n        public void AfterMarketCloseWithDelta(bool extendedMarketHours, double expectedHour)\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var rule = rules.AfterMarketClose(Symbols.SPY, 30, extendedMarketHours);\n            var times = rule.CreateUtcEventTimes(new[] { new DateTime(2000, 01, 03) });\n            var type = extendedMarketHours ? \"ExtendedMarketClose\" : \"MarketClose\";\n            Assert.AreEqual($\"{Symbols.SPY}: 30 min after {type}\", rule.Name);\n\n            int count = 0;\n            foreach (var time in times)\n            {\n                count++;\n                Assert.AreEqual(TimeSpan.FromHours(expectedHour), time.TimeOfDay);\n            }\n            Assert.AreEqual(1, count);\n        }\n\n        [TestCase(0)]\n        [TestCase(-1)]\n        public void EveryValidatesTimeSpan(int timeSpanMinutes)\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            Assert.Throws<ArgumentException>(() => rules.Every(TimeSpan.FromMinutes(timeSpanMinutes)));\n        }\n\n        [Test]\n        public void Every()\n        {\n            var rules = GetTimeRules(TimeZones.Utc);\n            var every = rules.Every(TimeSpan.FromMilliseconds(500));\n            var previous = new DateTime(2019, 6, 28);\n            var dateTimes = every.CreateUtcEventTimes(new[] { previous });\n            foreach (var dateTime in dateTimes)\n            {\n                if (previous != dateTime)\n                {\n                    Assert.Fail(\"Unexpected Every DateTime\");\n                }\n                previous = previous.AddMilliseconds(500);\n            }\n        }\n\n        [Test]\n        public void SetTimeZone()\n        {\n            var rules = GetTimeRules(TimeZones.NewYork);\n            var nowNewYork = rules.Now.CreateUtcEventTimes(new [] { _utcNow.Date }).Single();\n\n            rules.SetDefaultTimeZone(TimeZones.Utc);\n\n            var nowUtc = rules.Now.CreateUtcEventTimes(new [] { _utcNow.Date }).Single();\n\n            Assert.AreEqual(_utcNow, nowUtc);\n            Assert.AreEqual(nowUtc, nowNewYork);\n        }\n\n        [Test]\n        public void SetFuncTimeRuleInPythonWorksAsExpected()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\ndef CustomTimeRule(dates):\n    return [dates[0] + timedelta(days=1)]\n\");\n                dynamic pythonCustomTimeRule = pythonModule.GetAttr(\"CustomTimeRule\");\n                var funcTimeRule = new FuncTimeRule(\"PythonFuncTimeRule\", pythonCustomTimeRule);\n                Assert.AreEqual(\"PythonFuncTimeRule\", funcTimeRule.Name);\n                Assert.AreEqual(new DateTime(2023, 1, 2, 0, 0, 0), funcTimeRule.CreateUtcEventTimes(new List<DateTime>() { new DateTime(2023, 1, 1) }).First());\n            }\n        }\n\n        [Test]\n        public void SetFuncTimeRuleInPythonWorksAsExpectedWithCSharpFunc()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\ndef GetFuncTimeRule(csharpFunc):\n    return FuncTimeRule(\"\"CSharp\"\", csharpFunc)\n\");\n                dynamic getFuncTimeRule = pythonModule.GetAttr(\"GetFuncTimeRule\");\n                Func<IEnumerable<DateTime>, IEnumerable<DateTime>> csharpFunc = (dates) => { return new List<DateTime>() { new DateTime(2001, 3, 18) }; };\n                var funcTimeRule = getFuncTimeRule(csharpFunc);\n                Assert.AreEqual(\"CSharp\", (funcTimeRule.Name as PyObject).GetAndDispose<string>());\n                Assert.AreEqual(new DateTime(2001, 3, 18),\n                    (funcTimeRule.CreateUtcEventTimes(new List<DateTime>() { new DateTime(2023, 1, 1) }) as PyObject).GetAndDispose<List<DateTime>>().First());\n            }\n        }\n\n        [Test]\n        public void SetFuncTimeRuleInPythonFailsWhenInvalidTimeRule()\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\nwrongCustomTimeRule = \"\"hello\"\"\n\");\n                dynamic pythonCustomTimeRule = pythonModule.GetAttr(\"wrongCustomTimeRule\");\n                Assert.Throws<ArgumentException>(() => new FuncTimeRule(\"PythonFuncTimeRule\", pythonCustomTimeRule));\n            }\n        }\n\n        private static TimeRules GetTimeRules(DateTimeZone dateTimeZone)\n        {\n            var timeKeeper = new TimeKeeper(_utcNow, new List<DateTimeZone>());\n            var manager = new SecurityManager(timeKeeper);\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var marketHourDbEntry = mhdb.GetEntry(Market.USA, (string)null, SecurityType.Equity);\n            var securityExchangeHours = marketHourDbEntry.ExchangeHours;\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Daily, marketHourDbEntry.DataTimeZone, securityExchangeHours.TimeZone, true, false, false);\n            manager.Add(\n                Symbols.SPY,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var rules = new TimeRules(null, manager, dateTimeZone, mhdb);\n            return rules;\n        }\n\n        private static TimeRules GetFutureTimeRules(DateTimeZone dateTimeZone, bool extendedMarket = false)\n        {\n            var timeKeeper = new TimeKeeper(_utcNow, new List<DateTimeZone>());\n            var manager = new SecurityManager(timeKeeper);\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var marketHourDbEntry = mhdb.GetEntry(Market.CME, \"ES\", SecurityType.Future);\n            var securityExchangeHours = marketHourDbEntry.ExchangeHours;\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.ES_Future_Chain, Resolution.Daily, marketHourDbEntry.DataTimeZone,\n                securityExchangeHours.TimeZone, true, extendedMarket, false);\n            manager.Add(\n                Symbols.ES_Future_Chain,\n                new Security(\n                    securityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var rules = new TimeRules(null, manager, dateTimeZone, mhdb);\n            return rules;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/AccountCurrencyImmediateSettlementModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class AccountCurrencyImmediateSettlementModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n\n        [Test]\n        public void FundsAreSettledImmediately()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(Noon);\n            var portfolio = algorithm.Portfolio;\n            var security = algorithm.AddSecurity(Symbols.SPY);\n            var model = new AccountCurrencyImmediateSettlementModel();\n\n            portfolio.SetCash(1000);\n            Assert.AreEqual(1000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            var timeUtc = Noon.ConvertToUtc(TimeZones.NewYork);\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n\n            Assert.AreEqual(2000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(-500, Currencies.USD), null));\n\n            Assert.AreEqual(1500, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n\n            Assert.AreEqual(2500, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n\n        [Test]\n        public void FundsAreSettledInAccountCurrency()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetDateTime(Noon);\n            var portfolio = algorithm.Portfolio;\n            var security = algorithm.AddSecurity(Symbols.DE30EUR);\n            var model = new AccountCurrencyImmediateSettlementModel();\n            portfolio.SetCash(1000);\n            portfolio.SetCash(\"EUR\", 0, 1.1m);\n\n            Assert.AreEqual(1000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            var timeUtc = Noon.ConvertToUtc(TimeZones.NewYork);\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.EUR), null));\n\n            // 1000 + 1000 * 1.1 = 2100\n            Assert.AreEqual(2100, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(-500, Currencies.EUR), null));\n\n            // 2100 - 500 * 1.1 = 1550\n            Assert.AreEqual(1550, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.EUR), null));\n\n            // 1550 + 1000 * 1.1 = 2650\n            Assert.AreEqual(2650, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/BaseVolatilityModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\n\nusing NUnit.Framework;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Volatility;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class BaseVolatilityModelTests\n    {\n        [Test]\n        public void GetHistoryRequirementsWorks(\n            [ValueSource(nameof(GetDataNormalizationModes))] DataNormalizationMode dataNormalizationMode,\n            [Values] bool passResolution)\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Minute,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                false,\n                false,\n                dataNormalizationMode: dataNormalizationMode);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new BaseVolatilityModel();\n            model.SetSubscriptionDataConfigProvider(new MockSubscriptionDataConfigProvider(config));\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow, passResolution ? config.Resolution : null, periods).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(config.IsCustomData, result.IsCustomData);\n            Assert.AreEqual(config.FillDataForward, result.FillForwardResolution != null);\n            Assert.AreEqual(config.ExtendedMarketHours, result.IncludeExtendedMarketHours);\n            // Max resolution is used if no resolution is passed\n            Assert.AreEqual(passResolution ? config.Resolution : Resolution.Daily, result.Resolution);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorksForTwoDifferentSubscriptions(\n            [ValueSource(nameof(GetDataNormalizationModes))] DataNormalizationMode dataNormalizationMode,\n            [Values] bool passResolution)\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Minute,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                false,\n                false,\n                dataNormalizationMode: dataNormalizationMode);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new BaseVolatilityModel();\n            var mock = new MockSubscriptionDataConfigProvider(config);\n            mock.SubscriptionDataConfigs.Add(\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Second,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false,\n                    true,\n                dataNormalizationMode: dataNormalizationMode));\n            model.SetSubscriptionDataConfigProvider(mock);\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow, passResolution ? config.Resolution : null, periods).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(true, result.IsCustomData);\n            Assert.AreEqual(true, result.FillForwardResolution != null);\n            Assert.AreEqual(true, result.IncludeExtendedMarketHours); ;\n            // Max resolution is used if no resolution is passed\n            Assert.AreEqual(passResolution ? config.Resolution : Resolution.Daily, result.Resolution);\n        }\n\n        private static DataNormalizationMode[] GetDataNormalizationModes => (DataNormalizationMode[])Enum.GetValues(typeof(DataNormalizationMode));\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/BrokerageModelSecurityInitializerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class BrokerageModelSecurityInitializerTests\n    {\n        private QCAlgorithm _algo;\n        private BrokerageModelSecurityInitializer _brokerageInitializer;\n        private Security _tradeBarSecurity;\n        private readonly SubscriptionDataConfig _tradeBarConfig = new SubscriptionDataConfig(typeof(TradeBar),\n                                                                                     Symbols.SPY,\n                                                                                     Resolution.Second,\n                                                                                     TimeZones.NewYork,\n                                                                                     TimeZones.NewYork,\n                                                                                     false,\n                                                                                     false,\n                                                                                     false,\n                                                                                     false,\n                                                                                     TickType.Trade,\n                                                                                     false);\n\n        private Security _quoteBarSecurity;\n        private readonly SubscriptionDataConfig _quoteBarConfig = new SubscriptionDataConfig(typeof(QuoteBar),\n                                                                                     Symbols.EURUSD,\n                                                                                     Resolution.Second,\n                                                                                     DateTimeZone.ForOffset(Offset.FromHours(-5)),\n                                                                                     DateTimeZone.ForOffset(Offset.FromHours(-5)),\n                                                                                     false,\n                                                                                     false,\n                                                                                     false,\n                                                                                     false,\n                                                                                     TickType.Quote,\n                                                                                     false);\n\n        [SetUp]\n        public void Setup()\n        {\n            _algo =  new QCAlgorithm();\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n\n            historyProvider.Initialize(\n                new HistoryProviderInitializeParameters(\n                    null,\n                    null,\n                    TestGlobals.DataProvider,\n                    TestGlobals.DataCacheProvider,\n                    TestGlobals.MapFileProvider,\n                    TestGlobals.FactorFileProvider,\n                    null,\n                    true,\n                    new DataPermissionManager(),\n                    _algo.ObjectStore,\n                    _algo.Settings\n                )\n            );\n\n            _algo.HistoryProvider = historyProvider;\n            _algo.SubscriptionManager.SetDataManager(new DataManagerStub(_algo));\n            _tradeBarSecurity = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                _tradeBarConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            _quoteBarSecurity = new Security(\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.ForOffset(Offset.FromHours(-5))),\n                _quoteBarConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            _brokerageInitializer = new BrokerageModelSecurityInitializer(new DefaultBrokerageModel(),\n                                                                          new FuncSecuritySeeder(_algo.GetLastKnownPrice));\n        }\n\n        [Test]\n        public void BrokerageModelSecurityInitializer_CanSetLeverageForBacktesting_Successfully()\n        {\n            Assert.AreEqual(_tradeBarSecurity.Leverage, 1.0);\n\n            _brokerageInitializer.Initialize(_tradeBarSecurity);\n\n            Assert.AreEqual(_tradeBarSecurity.Leverage, 2.0);\n        }\n\n        [Test]\n        public void BrokerageModelSecurityInitializer_CanSetPrice_ForTradeBar()\n        {\n            // Arrange\n            var dateForWhichDataExist = new DateTime(2013, 10, 10, 12, 0, 0);\n            _algo.SetDateTime(dateForWhichDataExist);\n\n            // Act\n            _brokerageInitializer.Initialize(_tradeBarSecurity);\n\n            // Assert\n            Assert.IsFalse(_tradeBarSecurity.Price == 0);\n        }\n\n        [Test]\n        public void BrokerageModelSecurityInitializer_CanSetPrice_ForQuoteBar()\n        {\n            // Arrange\n            var dateForWhichDataExist = new DateTime(2014, 5, 6, 12, 0, 0);\n            _algo.SetDateTime(dateForWhichDataExist);\n\n            // Act\n            _brokerageInitializer.Initialize(_quoteBarSecurity);\n\n            // Assert\n            Assert.IsFalse(_quoteBarSecurity.Price == 0);\n        }\n\n        [Test]\n        public void BrokerageModelSecurityInitializer_CannotSetPrice_ForNonExistentHistory()\n        {\n            // Arrange\n            var dateForWhichDataDoesNotExist = new DateTime(2050, 10, 10, 12, 0, 0);\n            _algo.SetDateTime(dateForWhichDataDoesNotExist);\n\n            // Act\n            _brokerageInitializer.Initialize(_tradeBarSecurity);\n\n            // Assert\n            Assert.IsTrue(_tradeBarSecurity.Price == 0);\n        }\n\n        [Test]\n        public void BrokerageModelSecurityInitializer_SetLeverageForBuyingPowerModel_Successfully()\n        {\n            var brokerageModel = new DefaultBrokerageModel(AccountType.Cash);\n            var localBrokerageInitializer = new BrokerageModelSecurityInitializer(brokerageModel,\n                new FuncSecuritySeeder(_algo.GetLastKnownPrice));\n            Assert.AreEqual(1.0, _tradeBarSecurity.Leverage);\n            localBrokerageInitializer.Initialize(_tradeBarSecurity);\n            Assert.AreEqual(1.0, _tradeBarSecurity.Leverage);\n            Assert.AreEqual(1.0, _tradeBarSecurity.BuyingPowerModel.GetLeverage(_tradeBarSecurity));\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/BuyingPowerModelComparator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing NUnit.Framework;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IBuyingPowerModel\"/> that verifies consistency with\n    /// the <see cref=\"SecurityPositionGroupBuyingPowerModel\"/>\n    /// </summary>\n    public class BuyingPowerModelComparator : IBuyingPowerModel\n    {\n        public SecurityPortfolioManager Portfolio { get; }\n        public IBuyingPowerModel SecurityModel { get; }\n        public IPositionGroupBuyingPowerModel PositionGroupModel { get; }\n\n        private bool reentry;\n\n        public BuyingPowerModelComparator(\n            IBuyingPowerModel securityModel,\n            IPositionGroupBuyingPowerModel positionGroupModel,\n            SecurityPortfolioManager portfolio = null,\n            ITimeKeeper timeKeeper = null,\n            IOrderProcessor orderProcessor = null\n            )\n        {\n            Portfolio = portfolio;\n            SecurityModel = securityModel;\n            PositionGroupModel = positionGroupModel;\n\n            if (portfolio == null)\n            {\n                var securities = new SecurityManager(timeKeeper ?? new TimeKeeper(DateTime.UtcNow));\n                Portfolio = new SecurityPortfolioManager(securities, new SecurityTransactionManager(null, securities), new AlgorithmSettings());\n            }\n            if (orderProcessor != null)\n            {\n                Portfolio.Transactions.SetOrderProcessor(orderProcessor);\n            }\n        }\n\n        public decimal GetLeverage(Security security)\n        {\n            return SecurityModel.GetLeverage(security);\n        }\n\n        public void SetLeverage(Security security, decimal leverage)\n        {\n            SecurityModel.SetLeverage(security, leverage);\n        }\n\n        public MaintenanceMargin GetMaintenanceMargin(MaintenanceMarginParameters parameters)\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetMaintenanceMargin(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n            var actual = PositionGroupModel.GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(\n                Portfolio, new PositionGroup(PositionGroupModel, parameters.Quantity, new Position(parameters.Security, parameters.Quantity))\n            ));\n\n            Assert.AreEqual(expected.Value, actual.Value,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaintenanceMargin)}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public InitialMargin GetInitialMarginRequirement(InitialMarginParameters parameters)\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetInitialMarginRequirement(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n            var actual = PositionGroupModel.GetInitialMarginRequirement(new PositionGroupInitialMarginParameters(\n                Portfolio, new PositionGroup(PositionGroupModel, parameters.Quantity, new Position(parameters.Security, parameters.Quantity))\n            ));\n\n            Assert.AreEqual(expected.Value, actual.Value,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetInitialMarginRequirement)}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public InitialMargin GetInitialMarginRequiredForOrder(InitialMarginRequiredForOrderParameters parameters)\n        {\n            reentry = true;\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetInitialMarginRequiredForOrder(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            var actual = PositionGroupModel.GetInitialMarginRequiredForOrder(new PositionGroupInitialMarginForOrderParameters(\n                Portfolio, new PositionGroup(PositionGroupModel, parameters.Order.Quantity, new Position(parameters.Security, parameters.Order.Quantity)), parameters.Order\n            ));\n\n            Assert.AreEqual(expected.Value, actual.Value,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetInitialMarginRequiredForOrder)}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(\n            HasSufficientBuyingPowerForOrderParameters parameters\n            )\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.HasSufficientBuyingPowerForOrder(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n            var position = new Position(parameters.Security, parameters.Order.Quantity);\n            var actual = PositionGroupModel.HasSufficientBuyingPowerForOrder(\n                new HasSufficientPositionGroupBuyingPowerForOrderParameters(\n                    Portfolio,\n                    new PositionGroup(PositionGroupModel, position.GetGroupQuantity(), position),\n                    new List<Order> { parameters.Order }\n                )\n            );\n\n            Assert.AreEqual(expected.IsSufficient, actual.IsSufficient,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(HasSufficientBuyingPowerForOrder)}: \" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            Assert.AreEqual(expected.Reason, actual.Reason,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(HasSufficientBuyingPowerForOrder)}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower(\n            GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters\n            )\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetMaximumOrderQuantityForTargetBuyingPower(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n            var security = parameters.Security;\n            var positionGroup = Portfolio.Positions[new PositionGroupKey(PositionGroupModel, security)];\n            var actual = PositionGroupModel.GetMaximumLotsForTargetBuyingPower(\n                new GetMaximumLotsForTargetBuyingPowerParameters(\n                    parameters.Portfolio,\n                    positionGroup,\n                    parameters.TargetBuyingPower,\n                    parameters.MinimumOrderMarginPortfolioPercentage,\n                    parameters.SilenceNonErrorReasons\n                )\n            );\n\n            var lotSize = security.SymbolProperties.LotSize;\n            Assert.AreEqual(expected.IsError, actual.IsError,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForTargetBuyingPower)}: \" +\n                $\"ExpectedQuantity: {expected.Quantity} ActualQuantity: {actual.NumberOfLots * lotSize} {Environment.NewLine}\" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            // we're not comparing group quantities, which is the number of position lots, but rather the implied\n            // position quantities resulting from having that many lots.\n            var resizedPositionGroup = positionGroup.WithQuantity(\n                Math.Sign(positionGroup.Quantity) == -1 ? -actual.NumberOfLots : actual.NumberOfLots, Portfolio.Positions);\n            var position = resizedPositionGroup.GetPosition(security.Symbol);\n\n            var bpmOrder = new MarketOrder(security.Symbol, expected.Quantity, parameters.Portfolio.Securities.UtcTime);\n            var pgbpmOrder = new MarketOrder(security.Symbol, position.Quantity, parameters.Portfolio.Securities.UtcTime);\n\n            var bpmOrderValue = bpmOrder.GetValue(security);\n            var pgbpmOrderValue = pgbpmOrder.GetValue(security);\n\n            var bpmOrderFees = security.FeeModel.GetOrderFee(new OrderFeeParameters(security, bpmOrder)).Value.Amount;\n            var pgbpmOrderFees = security.FeeModel.GetOrderFee(new OrderFeeParameters(security, pgbpmOrder)).Value.Amount;\n\n            var bpmMarginRequired = bpmOrderValue + bpmOrderFees;\n            var pgbpmMarginRequired = pgbpmOrderValue + pgbpmOrderFees;\n\n            Assert.AreEqual(expected.Quantity, position.Quantity,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForTargetBuyingPower)}: \" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            Assert.AreEqual(expected.Reason, actual.Reason,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForTargetBuyingPower)}: \" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower(\n            GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters\n            )\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetMaximumOrderQuantityForDeltaBuyingPower(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n            var security = parameters.Security;\n            var positionGroup = Portfolio.Positions[new PositionGroupKey(PositionGroupModel, security)];\n            var actual = PositionGroupModel.GetMaximumLotsForDeltaBuyingPower(\n                new GetMaximumLotsForDeltaBuyingPowerParameters(\n                    parameters.Portfolio,\n                    positionGroup,\n                    parameters.DeltaBuyingPower,\n                    parameters.MinimumOrderMarginPortfolioPercentage,\n                    parameters.SilenceNonErrorReasons\n                )\n            );\n\n            var lotSize = security.SymbolProperties.LotSize;\n            Assert.AreEqual(expected.IsError, actual.IsError,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForDeltaBuyingPower)}: \" +\n                $\"ExpectedQuantity: {expected.Quantity} ActualQuantity: {actual.NumberOfLots * lotSize} {Environment.NewLine}\" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            // we're not comparing group quantities, which is the number of position lots, but rather the implied\n            // position quantities resulting from having that many lots.\n            var resizedPositionGroup = positionGroup.WithQuantity(\n                Math.Sign(positionGroup.Quantity) == -1 ? -actual.NumberOfLots : actual.NumberOfLots, Portfolio.Positions);\n            var position = resizedPositionGroup.GetPosition(security.Symbol);\n\n            var bpmOrder = new MarketOrder(security.Symbol, expected.Quantity, parameters.Portfolio.Securities.UtcTime);\n            var pgbpmOrder = new MarketOrder(security.Symbol, position.Quantity, parameters.Portfolio.Securities.UtcTime);\n\n            var bpmMarginRequired = security.BuyingPowerModel.GetInitialMarginRequirement(security, bpmOrder.Quantity);\n            var pgbpmMarginRequired = PositionGroupModel.GetInitialMarginRequiredForOrder(Portfolio, resizedPositionGroup, pgbpmOrder);\n\n            var availableBuyingPower = security.BuyingPowerModel.GetBuyingPower(parameters.Portfolio, security, bpmOrder.Direction);\n\n            Assert.AreEqual(expected.Quantity, position.Quantity,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForDeltaBuyingPower)}: \" +\n                $\"ExpectedReason: {expected.Reason}{Environment.NewLine}\" +\n                $\"ActualReason: {actual.Reason}\"\n            );\n\n            Assert.AreEqual(expected.Reason, actual.Reason,\n                $\"{PositionGroupModel.GetType().Name}:{nameof(GetMaximumOrderQuantityForDeltaBuyingPower)}\"\n            );\n\n            reentry = false;\n            return expected;\n        }\n\n        public ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters)\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetReservedBuyingPowerForPosition(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = true;\n\n            reentry = false;\n            return expected;\n        }\n\n        public BuyingPower GetBuyingPower(BuyingPowerParameters parameters)\n        {\n            EnsureSecurityExists(parameters.Security);\n            var expected = SecurityModel.GetBuyingPower(parameters);\n            if (reentry)\n            {\n                return expected;\n            }\n\n            reentry = false;\n            return expected;\n        }\n\n        private void EnsureSecurityExists(Security security)\n        {\n            if (!Portfolio.Securities.ContainsKey(security.Symbol))\n            {\n                var timeKeeper = (LocalTimeKeeper) typeof(Security).GetField(\"_localTimeKeeper\", BindingFlags.NonPublic|BindingFlags.Instance).GetValue(security);\n                Portfolio.Securities[security.Symbol] = security;\n                security.SetLocalTimeKeeper(timeKeeper);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/BuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class BuyingPowerModelTests\n    {\n        private BuyingPowerModel _model;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _model = new BuyingPowerModel();\n        }\n\n\n        // Current Order Margin \n        [TestCase(-40, 25, -900, 1, 4)]   \t    // -1000\n        [TestCase(-36, 25, -880, 1, 1)]  \t    // -900\n        [TestCase(-35, 25, -900, 1, -1)]   \t    // -875\n        [TestCase(-34, 25, -880, 1, -1)]       \t// -850\n        [TestCase(48, 25, 1050, 1, -6)]    \t   \t// 1200\n        [TestCase(49, 25, 1212, 1, -1)]   \t    // 1225\n        [TestCase(44, 25, 1200, 1, 4)]    \t    // 1100\n        [TestCase(45, 25, 1250, 1, 5)]    \t    // 1125\n        [TestCase(80, 25, -1250, 1, -130)]      // 2000\n        [TestCase(45.5, 25, 1240, 0.5, 4)]   \t// 1125\n        [TestCase(45.75, 25, 1285, 0.25, 5.5)]\t// 1125\n        [TestCase(-40, 25, 1500, 1, 100)]       // -1000\n        [TestCase(-40.5, 12.5, 1505, .5, 160.5)]// -506.25\n        [TestCase(-40.5, 12.5, 1508, .5, 161)]\t// -506.25\n        public void OrderCalculation(decimal currentHoldings, decimal perUnitMargin, decimal targetMargin, decimal lotSize, decimal expectedOrderSize)\n        {\n            var spy = SetupSecurity(currentHoldings, lotSize, perUnitMargin);\n\n            var currentHoldingsMargin = _model.GetInitialMarginRequirement(spy, spy.Holdings.Quantity);\n\n            // Determine the order size to get us to our target margin\n            var orderSize = _model.GetAmountToOrder(spy, targetMargin, perUnitMargin, out _);\n            Assert.AreEqual(expectedOrderSize, orderSize);\n\n            // Determine the final margin and assert we have met our target condition\n            var resultMargin = currentHoldingsMargin + (orderSize * perUnitMargin);\n            Assert.IsTrue(Math.Abs(resultMargin) <= Math.Abs(targetMargin));\n        }\n\n\n        // Current Order Margin \n        [TestCase(-40, 25, -900, 1, -36)]   \t    // -1000\n        [TestCase(-36, 25, -880, 1, -35)]  \t    // -900\n        [TestCase(-35, 25, -900, 1, -36)]   \t    // -875\n        [TestCase(-34, 25, -880, 1, -35)]       // -850\n        [TestCase(48, 25, 1050, 1, 42)]    \t    // 1200\n        [TestCase(49, 25, 1212, 1, 48)]   \t    // 1225\n        [TestCase(44, 25, 1200, 1, 48)]    \t    // 1100\n        [TestCase(45, 25, 1250, 1, 50)]    \t    // 1125\n        [TestCase(80, 25, -1250, 1, -50)]       // 2000\n        [TestCase(45.5, 25, 1240, 0.5, 49.5)]   // 1125\n        [TestCase(45.75, 25, 1285, 0.25, 51.25)]// 1125\n        [TestCase(-40, 25, 1500, 1, 60)]        // -1000\n        [TestCase(-40.5, 12.5, 1505, .5, 120)]  // -506.25\n        [TestCase(-40.5, 12.5, 1508, .5, 120.5)]// -506.25\n\n        public void OrderAdjustmentCalculation(decimal currentOrderSize, decimal perUnitMargin, decimal targetMargin, decimal lotSize, decimal expectedOrderSize)\n        {\n            var spy = SetupSecurity(currentOrderSize, lotSize, perUnitMargin);\n\n            var currentHoldingsMargin = _model.GetInitialMarginRequirement(spy, spy.Holdings.Quantity);\n\n            // Determine the adjustment to get us to our target margin and apply it\n            // Use our GetAmountToOrder for determining adjustment to reach the end goal\n            var orderAdjustment =\n                _model.GetAmountToOrder(spy, targetMargin, perUnitMargin, out _);\n\n            // Apply the change in margin\n            var resultMargin = currentHoldingsMargin + (orderAdjustment * perUnitMargin);\n\n            // Assert after our adjustment we have met our target condition\n            Assert.IsTrue(Math.Abs(resultMargin) <= Math.Abs(targetMargin));\n\n            // Verify our adjustment meets our expected order size\n            var adjustOrderSize = currentOrderSize + orderAdjustment;\n            Assert.AreEqual(expectedOrderSize, adjustOrderSize);\n        }\n\n        /// <summary>\n        /// Helper method for tests, sets up an equity security with our properties\n        /// </summary>\n        /// <returns>Equity with the given setup values</returns>\n        private static Security SetupSecurity(decimal currentHoldings, decimal lotSize, decimal perUnitMargin)\n        {\n            var spy = new QuantConnect.Securities.Equity.Equity(Symbols.SPY, SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc), new Cash(\"$\", 0, 1),\n                new SymbolProperties(null, \"$\", 1, 0.01m, lotSize, null, 0), null, null, new SecurityCache());\n\n            spy.Holdings.SetHoldings(perUnitMargin, currentHoldings);\n            spy.SetLeverage(1);\n\n            spy.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = spy.Symbol,\n                Open = perUnitMargin,\n                High = perUnitMargin,\n                Low = perUnitMargin,\n                Close = perUnitMargin\n            });\n\n            return spy;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CashAmountTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class CashAmountTests\n    {\n        [Test]\n        public void InitializesProperlyUsingAccountCurrency()\n        {\n            var cashAmount = new CashAmount(1000m, Currencies.USD);\n\n            Assert.AreEqual(1000m, cashAmount.Amount);\n            Assert.AreEqual(Currencies.USD, cashAmount.Currency);\n        }\n\n        [Test]\n        public void InitializesProperlyUsingNonAccountCurrency()\n        {\n            var cashAmount = new CashAmount(1000m, \"EUR\");\n\n            Assert.AreEqual(1000m, cashAmount.Amount);\n            Assert.AreEqual(\"EUR\", cashAmount.Currency);\n        }\n\n        [Test]\n        public void EqualityOperator()\n        {\n            var cashAmount = new CashAmount(1000m, \"EUR\");\n            var cashAmount2 = new CashAmount(1000m, \"EUR\");\n            var uglyDuckling = new CashAmount(10m, \"EUR\");\n            var uglyDuckling2 = new CashAmount(10m, \"USD\");\n            var zeroCashAmount = new CashAmount(0, \"USD\");\n\n            Assert.IsTrue(cashAmount2 == cashAmount);\n            Assert.IsFalse(uglyDuckling == cashAmount);\n            Assert.IsFalse(uglyDuckling == cashAmount2);\n            Assert.IsFalse(uglyDuckling2 == cashAmount2);\n            Assert.IsFalse(uglyDuckling2 == cashAmount);\n            Assert.IsFalse(uglyDuckling2 == uglyDuckling);\n            Assert.IsFalse(uglyDuckling2 == default(CashAmount));\n            Assert.IsFalse(zeroCashAmount == default(CashAmount));\n        }\n\n        [Test]\n        public void NotEqualOperator()\n        {\n            var cashAmount = new CashAmount(1000m, \"EUR\");\n            var cashAmount2 = new CashAmount(1000m, \"EUR\");\n            var uglyDuckling = new CashAmount(10m, \"EUR\");\n            var uglyDuckling2 = new CashAmount(10m, \"USD\");\n            var zeroCashAmount = new CashAmount(0, \"USD\");\n\n            Assert.IsFalse(cashAmount2 != cashAmount);\n            Assert.IsTrue(uglyDuckling != cashAmount);\n            Assert.IsTrue(uglyDuckling != cashAmount2);\n            Assert.IsTrue(uglyDuckling2 != cashAmount2);\n            Assert.IsTrue(uglyDuckling2 != cashAmount);\n            Assert.IsTrue(uglyDuckling2 != uglyDuckling);\n            Assert.IsTrue(uglyDuckling2 != default(CashAmount));\n            Assert.IsTrue(zeroCashAmount != default(CashAmount));\n        }\n\n        [Test]\n        public void EqualsOperator()\n        {\n            var cashAmount = new CashAmount(1000m, \"EUR\");\n            var cashAmount2 = new CashAmount(1000m, \"EUR\");\n            var uglyDuckling = new CashAmount(10m, \"EUR\");\n            var uglyDuckling2 = new CashAmount(10m, \"USD\");\n            var zeroCashAmount = new CashAmount(0, \"USD\");\n\n            Assert.IsTrue(cashAmount2.Equals(cashAmount));\n            Assert.IsFalse(uglyDuckling.Equals(cashAmount));\n            Assert.IsFalse(uglyDuckling.Equals(cashAmount2));\n            Assert.IsFalse(uglyDuckling2.Equals(cashAmount2));\n            Assert.IsFalse(uglyDuckling2.Equals(cashAmount));\n            Assert.IsFalse(uglyDuckling2.Equals(uglyDuckling));\n            Assert.IsFalse(uglyDuckling2.Equals(default(CashAmount)));\n            Assert.IsFalse(zeroCashAmount.Equals(default(CashAmount)));\n        }\n\n        [Test]\n        public void DefaultCashAmount()\n        {\n            var cashAmount = default(CashAmount);\n\n            Assert.IsNotNull(cashAmount);\n            Assert.AreEqual(0, cashAmount.Amount);\n            Assert.AreEqual(null, cashAmount.Currency);\n        }\n\n        [Test]\n        public void RoundTripSerialization()\n        {\n            var cashAmount = new CashAmount(1000m, \"EUR\");\n\n            var serialized = JsonConvert.SerializeObject(cashAmount);\n            var deserialize = JsonConvert.DeserializeObject<CashAmount>(serialized);\n\n            Assert.AreEqual(cashAmount, deserialize);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CashBookTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class CashBookTests\n    {\n        [Test]\n        public void JsonRoundTrip()\n        {\n            var cashBook = new CashBook { AccountCurrency = Currencies.EUR };\n            cashBook.Add(Currencies.USD, 10, 1.2m);\n            cashBook.Add(Currencies.EUR, 10, 1m);\n\n            var expected = new LiveResult { CashBook = cashBook };\n\n            var serialized = JsonConvert.SerializeObject(expected);\n            var result = JsonConvert.DeserializeObject<LiveResult>(serialized);\n\n            Assert.AreEqual(expected.AccountCurrency, result.AccountCurrency);\n            Assert.AreEqual(expected.AccountCurrencySymbol, result.AccountCurrencySymbol);\n            Assert.AreEqual(expected.Cash.Count, result.Cash.Count);\n            Assert.AreEqual(expected.Cash[Currencies.USD].Amount, result.Cash[Currencies.USD].Amount);\n            Assert.AreEqual(expected.Cash[Currencies.USD].ConversionRate, result.Cash[Currencies.USD].ConversionRate);\n            Assert.AreEqual(expected.Cash[Currencies.EUR].Amount, result.Cash[Currencies.EUR].Amount);\n            Assert.AreEqual(expected.Cash[Currencies.EUR].ConversionRate, result.Cash[Currencies.EUR].ConversionRate);\n        }\n\n        [Test]\n        public void InitializesWithAccountCurrencyAdded()\n        {\n            var book = new CashBook();\n            Assert.AreEqual(1, book.Count);\n            var cash = book.Single().Value;\n            Assert.AreEqual(Currencies.USD, cash.Symbol);\n            Assert.AreEqual(0, cash.Amount);\n            Assert.AreEqual(1m, cash.ConversionRate);\n        }\n\n        [Test]\n        public void ComputesValueInAccountCurrency()\n        {\n            var book = new CashBook();\n            book[Currencies.USD].SetAmount(1000);\n            book.Add(\"JPY\", 1000, 1/100m);\n            book.Add(\"GBP\", 1000, 2m);\n\n            decimal expected = book[Currencies.USD].ValueInAccountCurrency + book[\"JPY\"].ValueInAccountCurrency + book[\"GBP\"].ValueInAccountCurrency;\n            Assert.AreEqual(expected, book.TotalValueInAccountCurrency);\n        }\n\n        [Test]\n        public void ConvertsProperly()\n        {\n            var book = new CashBook();\n            book.Add(\"EUR\", 0, 1.10m);\n            book.Add(\"GBP\", 0, 0.71m);\n\n            var expected = 1549.2957746478873239436619718m;\n            var actual = book.Convert(1000, \"EUR\", \"GBP\");\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void ConvertsToAccountCurrencyProperly()\n        {\n            var book = new CashBook();\n            book.Add(\"EUR\", 0, 1.10m);\n\n            var expected = 1100m;\n            var actual = book.ConvertToAccountCurrency(1000, \"EUR\");\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void ConvertsToEurFromAccountCurrencyProperly()\n        {\n            var book = new CashBook();\n            book.Add(\"EUR\", 0, 1.20m);\n\n            var expected = 1000m;\n            var actual = book.Convert(1200, book.AccountCurrency, \"EUR\");\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void ConvertsToJpyFromAccountCurrencyProperly()\n        {\n            var book = new CashBook();\n            book.Add(\"JPY\", 0, 1/100m);\n\n            var expected = 100000m;\n            var actual = book.Convert(1000, book.AccountCurrency, \"JPY\");\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void WontAddNullCurrencyCash()\n        {\n            var book = new CashBook {{Currencies.NullCurrency, 1, 1}};\n            Assert.AreEqual(1, book.Count);\n            var cash = book.Single().Value;\n            Assert.AreEqual(Currencies.USD, cash.Symbol);\n\n            book.Add(Currencies.NullCurrency, 1, 1);\n            Assert.AreEqual(1, book.Count);\n            cash = book.Single().Value;\n            Assert.AreEqual(Currencies.USD, cash.Symbol);\n\n            book.Add(Currencies.NullCurrency,\n                new Cash(Currencies.NullCurrency, 1, 1));\n            Assert.AreEqual(1, book.Count);\n            cash = book.Single().Value;\n            Assert.AreEqual(Currencies.USD, cash.Symbol);\n\n            book[Currencies.NullCurrency] =\n                new Cash(Currencies.NullCurrency, 1, 1);\n            Assert.AreEqual(1, book.Count);\n            cash = book.Single().Value;\n            Assert.AreEqual(Currencies.USD, cash.Symbol);\n        }\n\n        [Test]\n        public void WillThrowIfGetNullCurrency()\n        {\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                var symbol = new CashBook()[Currencies.NullCurrency].Symbol;\n            });\n        }\n\n        [Test]\n        public void UpdatedAddedCalledOnlyForNewSymbols()\n        {\n            var cashBook = new CashBook();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Add(cash.Symbol, cash);\n            cashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    called = true;\n                }\n            };\n            cashBook.Add(cash.Symbol, cash);\n\n            Assert.IsFalse(called);\n        }\n\n        [Test]\n        public void UpdateEventCalledForAddMethod()\n        {\n            var cashBook = new CashBook();\n            // we remove default USD cash\n            cashBook.Clear();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    called = true;\n                }\n            };\n            cashBook.Add(cash.Symbol, cash);\n\n            Assert.IsTrue(called);\n        }\n\n        [Test]\n        public void UpdateEventCalledForAdd()\n        {\n            var cashBook = new CashBook();\n            // we remove default USD cash\n            cashBook.Clear();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    called = true;\n                }\n            };\n\n            cashBook[cash.Symbol] = cash;\n\n            Assert.IsTrue(called);\n        }\n\n        [Test]\n        public void UpdateEventCalledForRemove()\n        {\n            var cashBook = new CashBook();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Add(cash.Symbol, cash);\n            cashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Removed)\n                {\n                    called = true;\n                }\n            };\n\n            cashBook.Remove(Currencies.USD);\n\n            Assert.IsTrue(called);\n        }\n\n        [Test]\n        public void UpdateEventNotCalledForCashUpdatesAfterRemoved()\n        {\n            var cashBook = new CashBook();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Add(cash.Symbol, cash);\n            cashBook.Remove(Currencies.USD);\n            cashBook.Updated += (sender, args) =>\n            {\n                called = true;\n            };\n            cash.Update();\n\n            Assert.IsFalse(called);\n        }\n\n        [Test]\n        public void UpdateEventCalledForAddExistingValueCalledOnce()\n        {\n            var cashBook = new CashBook();\n            var called = 0;\n            var calledUpdated = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Add(cash.Symbol, cash);\n            cashBook.Updated += (sender, args) =>\n            {\n                called++;\n                calledUpdated = args.UpdateType == CashBookUpdateType.Updated;\n            };\n\n            cashBook.Add(cash.Symbol, new Cash(Currencies.USD, 1, 2));\n\n            Assert.AreEqual(1, called);\n            Assert.IsTrue(calledUpdated);\n        }\n\n        [Test]\n        public void UpdateEventCalledForClear()\n        {\n            var cashBook = new CashBook();\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cashBook.Add(cash.Symbol, cash);\n            cashBook.Updated += (sender, args) =>\n            {\n                called = args.UpdateType == CashBookUpdateType.Removed;\n            };\n\n            cashBook.Clear();\n\n            Assert.IsTrue(called);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CashBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Tests.Engine;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class CashBuyingPowerModelTests\n    {\n        private Crypto _btcusd;\n        private Crypto _btceur;\n        private Crypto _ethusd;\n        private Crypto _ethbtc;\n        private SecurityPortfolioManager _portfolio;\n        private BacktestingTransactionHandler _transactionHandler;\n        private BacktestingBrokerage _brokerage;\n        private IBuyingPowerModel _buyingPowerModel;\n        private QCAlgorithm _algorithm;\n        private LocalTimeKeeper _timeKeeper;\n        private ITimeKeeper _globalTimeKeeper;\n        private IResultHandler _resultHandler;\n\n        [SetUp]\n        public void Initialize()\n        {\n            _algorithm = new QCAlgorithm();\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _portfolio = _algorithm.Portfolio;\n            _portfolio.CashBook.Add(\"EUR\", 0, 1.20m);\n            _portfolio.CashBook.Add(\"BTC\", 0, 15000m);\n            _portfolio.CashBook.Add(\"ETH\", 0, 1000m);\n\n            _algorithm.SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);\n\n            _transactionHandler = new BacktestingTransactionHandler();\n            _brokerage = new BacktestingBrokerage(_algorithm);\n            _resultHandler = new TestResultHandler();\n            _transactionHandler.Initialize(_algorithm, _brokerage, _resultHandler);\n\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var tz = TimeZones.NewYork;\n            _btcusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                _portfolio.CashBook[Currencies.USD],\n                _portfolio.CashBook[\"BTC\"],\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCUSD, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            _ethusd = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                _portfolio.CashBook[Currencies.USD],\n                _portfolio.CashBook[\"ETH\"],\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.ETHUSD, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"ETHUSD\", Currencies.USD, 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            _btceur = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                _portfolio.CashBook[\"EUR\"],\n                _portfolio.CashBook[\"BTC\"],\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.BTCEUR, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"BTCEUR\", \"EUR\", 1, 0.01m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            _ethbtc = new Crypto(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                _portfolio.CashBook[\"BTC\"],\n                _portfolio.CashBook[\"ETH\"],\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.ETHBTC, Resolution.Minute, tz, tz, true, false, false),\n                new SymbolProperties(\"ETHBTC\", \"BTC\", 1, 0.00001m, 0.00000001m, string.Empty),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            _globalTimeKeeper = new TimeKeeper(new DateTime(2019, 11, 7));\n            _timeKeeper = _globalTimeKeeper.GetLocalTimeKeeper(tz);\n            _buyingPowerModel = new BuyingPowerModelComparator(\n                new CashBuyingPowerModel(),\n                new SecurityPositionGroupBuyingPowerModel(),\n                _portfolio,\n                _globalTimeKeeper\n            );\n\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _ethusd.SetLocalTimeKeeper(_timeKeeper);\n            _btceur.SetLocalTimeKeeper(_timeKeeper);\n            _ethbtc.SetLocalTimeKeeper(_timeKeeper);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler.Exit();\n            _resultHandler.Exit();\n        }\n\n        [Test]\n        public void InitializesCorrectly()\n        {\n            Assert.AreEqual(1m, _buyingPowerModel.GetLeverage(_btcusd));\n            Assert.AreEqual(0m, _buyingPowerModel.GetReservedBuyingPowerForPosition(_btcusd));\n        }\n\n        [Test]\n        public void SetLeverageDoesNotUpdateLeverage()\n        {\n            Assert.Throws<InvalidOperationException>(() => _buyingPowerModel.SetLeverage(_btcusd, 50m));\n        }\n\n        [Test]\n        public void LimitBuyBtcWithUsdRequiresUsdInPortfolio()\n        {\n            _portfolio.SetCash(20000);\n\n            // Available cash = 20000 USD, can buy 2 BTC at 10000\n            var order = new LimitOrder(_btcusd.Symbol, 2m, 10000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // Available cash = 20000 USD, cannot buy 2.1 BTC at 10000, need 21000\n            order = new LimitOrder(_btcusd.Symbol, 2.1m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // Available cash = 20000 USD, cannot buy 2 BTC at 11000, need 22000\n            order = new LimitOrder(_btcusd.Symbol, 2m, 11000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void LimitBuyBtcWithEurRequiresEurInPortfolio()\n        {\n            _portfolio.SetCash(\"EUR\", 20000m, 1.20m);\n\n            // Available cash = 20000 EUR, can buy 2 BTC at 10000\n            var order = new LimitOrder(_btceur.Symbol, 2m, 10000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n\n            // Available cash = 20000 EUR, cannot buy 2.1 BTC at 10000, need 21000\n            order = new LimitOrder(_btceur.Symbol, 2.1m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n\n            // Available cash = 20000 EUR, cannot buy 2 BTC at 11000, need 22000\n            order = new LimitOrder(_btceur.Symbol, 2m, 11000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n        }\n\n        [Test]\n        public void LimitSellOrderRequiresBaseCurrencyInPortfolio()\n        {\n            _portfolio.SetCash(0);\n            _portfolio.CashBook[\"BTC\"].SetAmount(0.5m);\n\n            // 0.5 BTC in portfolio, can sell 0.5 BTC at any price\n            var order = new LimitOrder(_btcusd.Symbol, -0.5m, 10000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 0.5 BTC in portfolio, cannot sell 0.6 BTC at any price\n            order = new LimitOrder(_btcusd.Symbol, -0.6m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void LimitBuyOrderChecksOpenOrders()\n        {\n            _portfolio.SetCash(5000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _ethusd = _algorithm.AddCrypto(\"ETHUSD\");\n            _ethusd.SetMarketPrice(new Tick { Value = 1000m });\n            _algorithm.SetFinishedWarmingUp();\n\n            // BTCUSD buy order decreases available USD (5000 - 1500 = 3500 USD)\n            SubmitLimitOrder(_btcusd.Symbol, 0.1m, 15000m);\n\n            // ETHUSD buy order decreases available USD (3500 - 3000 = 500 USD)\n            SubmitLimitOrder(_ethusd.Symbol, 3m, 1000m);\n\n            // 500 USD available, can buy 0.048 BTC at 10000\n            var order = new LimitOrder(_btcusd.Symbol, 0.048m, 10000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 500 USD available, cannot buy 0.06 BTC at 10000\n            order = new LimitOrder(_btcusd.Symbol, 0.06m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void LimitSellOrderChecksOpenOrders()\n        {\n            _portfolio.SetCash(5000);\n            _portfolio.CashBook[\"BTC\"].SetAmount(1m);\n            _portfolio.CashBook[\"ETH\"].SetAmount(3m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _ethusd = _algorithm.AddCrypto(\"ETHUSD\");\n            _ethusd.SetMarketPrice(new Tick { Value = 1000m });\n\n            _ethbtc = _algorithm.AddCrypto(\"ETHBTC\");\n            _ethbtc.SetMarketPrice(new Tick { Value = 0.1m });\n            _algorithm.SetFinishedWarmingUp();\n\n            // BTCUSD sell limit order decreases available BTC (1 - 0.1 = 0.9 BTC)\n            SubmitLimitOrder(_btcusd.Symbol, -0.1m, 15000m);\n\n            // ETHUSD sell limit order decreases available ETH (3 - 1 = 2 ETH)\n            SubmitLimitOrder(_ethusd.Symbol, -1m, 1000m);\n\n            // ETHBTC buy limit order decreases available BTC (0.9 - 0.1 = 0.8 BTC)\n            SubmitLimitOrder(_ethbtc.Symbol, 1m, 0.1m);\n\n            // BTCUSD sell stop order decreases available BTC (0.8 - 0.1 = 0.7 BTC)\n            SubmitStopMarketOrder(_btcusd.Symbol, -0.1m, 5000m);\n\n            // 0.7 BTC available, can sell 0.7 BTC at any price\n            var order = new LimitOrder(_btcusd.Symbol, -0.7m, 10000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 0.7 BTC available, cannot sell 0.8 BTC at any price\n            order = new LimitOrder(_btcusd.Symbol, -0.8m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 2 ETH available, can sell 2 ETH at any price\n            order = new LimitOrder(_ethusd.Symbol, -2m, 1200m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _ethusd, order).IsSufficient);\n\n            // 2 ETH available, cannot sell 2.1 ETH at any price\n            order = new LimitOrder(_ethusd.Symbol, -2.1m, 2000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _ethusd, order).IsSufficient);\n\n            // 0.7 BTC available, can sell stop 0.7 BTC at any price\n            var stopOrder = new StopMarketOrder(_btcusd.Symbol, -0.7m, 5000m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, stopOrder).IsSufficient);\n\n            // 0.7 BTC available, cannot sell stop 0.8 BTC at any price\n            stopOrder = new StopMarketOrder(_btcusd.Symbol, -0.8m, 5000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, stopOrder).IsSufficient);\n        }\n\n        [Test]\n        public void MarketBuyBtcWithUsdRequiresUsdInPortfolioPlusFees()\n        {\n            _portfolio.SetCash(20000);\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m });\n\n            // Available cash = 20000 USD, cannot buy 2 BTC at 10000 (fees are excluded)\n            var order = new MarketOrder(_btcusd.Symbol, 2m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // Maximum we can market buy with 20000 USD is 1.98412698 BTC\n            Assert.AreEqual(1.98412698m, _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1, 0).Quantity);\n\n            _btcusd.SetMarketPrice(new Tick { Value = 9900m });\n\n            // Available cash = 20000 USD, can buy 2 BTC at 9900 (plus fees)\n            order = new MarketOrder(_btcusd.Symbol, 2m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketBuyBtcWithEurRequiresEurInPortfolioPlusFees()\n        {\n            _portfolio.SetCash(\"EUR\", 20000m, 1.20m);\n            _btceur.SetLocalTimeKeeper(_timeKeeper);\n            _btceur.SetMarketPrice(new Tick { Value = 10000m });\n\n            // Available cash = 20000 EUR, cannot buy 2 BTC at 10000 (fees are excluded)\n            var order = new MarketOrder(_btceur.Symbol, 2m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n\n            // Maximum we can market buy with 20000 EUR is 1.98412698 BTC\n            var targetValue = 20000m * _portfolio.CashBook[\"EUR\"].ConversionRate / _portfolio.TotalPortfolioValue;\n            Assert.AreEqual(1.98412698m, _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btceur, targetValue, 0).Quantity);\n\n            _btceur.SetMarketPrice(new Tick { Value = 9900m });\n\n            // Available cash = 20000 EUR, can buy 2 BTC at 9900 (plus fees)\n            order = new MarketOrder(_btceur.Symbol, 2m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketSellOrderRequiresBaseCurrencyInPortfolioPlusFees()\n        {\n            _portfolio.SetCash(0);\n\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m });\n            _portfolio.SetCash(\"BTC\", 0.5m, 10000m);\n\n            // 0.5 BTC in portfolio, can sell 0.5 BTC\n            var order = new MarketOrder(_btcusd.Symbol, -0.5m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 0.5 BTC in portfolio, cannot sell 0.51 BTC\n            order = new MarketOrder(_btcusd.Symbol, -0.51m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // Maximum we can market sell with 0.5 BTC is 0.5 BTC\n            Assert.AreEqual(-0.5m, _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 0, 0).Quantity);\n        }\n\n        [Test]\n        public void MarketBuyOrderChecksOpenOrders()\n        {\n            _portfolio.SetCash(5000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _ethusd = _algorithm.AddCrypto(\"ETHUSD\");\n            _ethusd.SetMarketPrice(new Tick { Value = 1000m });\n            _algorithm.SetFinishedWarmingUp();\n\n            // BTCUSD buy order decreases available USD (5000 - 1500 = 3500 USD)\n            SubmitLimitOrder(_btcusd.Symbol, 0.1m, 15000m);\n\n            // ETHUSD buy order decreases available USD (3500 - 3000 = 500 USD)\n            SubmitLimitOrder(_ethusd.Symbol, 3m, 1000m);\n\n            // Maximum we can market buy with 500 USD is 0.03306878 BTC\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 500 / _portfolio.TotalPortfolioValue, 0).Quantity;\n            Assert.AreEqual(0.03306878m, quantity);\n\n            // 500 USD available, can buy `quantity` BTC at 15000\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 500 USD available, cannot buy `quantity` + _btcusd.SymbolProperties.LotSize BTC at 15000\n            order = new MarketOrder(_btcusd.Symbol, quantity + _btcusd.SymbolProperties.LotSize, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketSellOrderChecksOpenOrders()\n        {\n            _portfolio.SetCash(5000);\n            _portfolio.CashBook[\"BTC\"].SetAmount(1m);\n            _portfolio.CashBook[\"ETH\"].SetAmount(3m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _ethusd = _algorithm.AddCrypto(\"ETHUSD\");\n            _ethusd.SetMarketPrice(new Tick { Value = 1000m });\n\n            _ethbtc = _algorithm.AddCrypto(\"ETHBTC\");\n            _ethbtc.SetMarketPrice(new Tick { Value = 0.1m });\n            _algorithm.SetFinishedWarmingUp();\n\n            // BTCUSD sell order decreases available BTC (1 - 0.1 = 0.9 BTC)\n            SubmitLimitOrder(_btcusd.Symbol, -0.1m, 15000m);\n\n            // ETHBTC buy order decreases available BTC (0.9 - 0.1 = 0.8 BTC)\n            SubmitLimitOrder(_ethbtc.Symbol, 1m, 0.1m);\n\n            // Maximum we can market sell with 0.8 BTC is -0.79365079 BTC (for a target position of 0.2 BTC)\n            // target value = (1 - 0.8) * price\n            Assert.AreEqual(-0.79365079m, _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 0.2m * 15000 / _portfolio.TotalPortfolioValue, 0).Quantity);\n\n            // 0.8 BTC available, can sell 0.80 BTC at market\n            var order = new MarketOrder(_btcusd.Symbol, -0.80m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 0.8 BTC available, cannot sell 0.81 BTC at market\n            order = new MarketOrder(_btcusd.Symbol, -0.81m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void LimitBuyOrderIncludesFees()\n        {\n            _portfolio.SetCash(20000);\n            _btcusd.FeeModel = new ConstantFeeModel(50);\n\n            // Available cash = 20000, cannot buy 2 BTC at 10000 because of order fee\n            var order = new LimitOrder(_btcusd.Symbol, 2m, 10000m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // deposit another 50 USD\n            _portfolio.CashBook[Currencies.USD].AddAmount(50);\n\n            // now the order is allowed\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void CalculatesMaximumOrderQuantityCorrectly()\n        {\n            _portfolio.SetCash(10000);\n            _portfolio.SetCash(\"EUR\", 10000m, 1.20m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _ethusd = _algorithm.AddCrypto(\"ETHUSD\");\n            _ethusd.SetLocalTimeKeeper(_timeKeeper);\n            _ethusd.SetMarketPrice(new Tick { Value = 1000m });\n\n            _ethbtc = _algorithm.AddCrypto(\"ETHBTC\");\n            _ethbtc.SetLocalTimeKeeper(_timeKeeper);\n            _ethbtc.SetMarketPrice(new Tick { Value = 0.1m });\n\n            _btceur = _algorithm.AddCrypto(\"BTCEUR\");\n            _btceur.SetLocalTimeKeeper(_timeKeeper);\n            _btceur.SetMarketPrice(new Tick { Value = 12000m });\n            _algorithm.SetFinishedWarmingUp();\n\n            // 0.66137566 * 15000 + fees + price buffer <= 10000 USD\n            var targetValue = 10000 / _portfolio.TotalPortfolioValue;\n\n            var getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, targetValue, 0).Quantity;\n            Assert.AreEqual(0.66137566m, getMaximumOrderQuantityForTargetValueResult);\n\n            var order = new MarketOrder(_btcusd.Symbol, getMaximumOrderQuantityForTargetValueResult, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            // 9.92063492 * 1000 + fees <= 10000 USD\n            getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _ethusd, targetValue, 0).Quantity;\n            Assert.AreEqual(9.92063492m, getMaximumOrderQuantityForTargetValueResult);\n\n            order = new MarketOrder(_ethusd.Symbol, getMaximumOrderQuantityForTargetValueResult, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _ethusd, order).IsSufficient);\n\n            // no BTC in portfolio, but GetMaximumOrderQuantityForTargetBuyingPower does not care\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _ethbtc, 1, 0).Quantity;\n            Assert.AreNotEqual(0m, quantity);\n            // HasSufficientBuyingPowerForOrder does check margin requirements\n            order = new MarketOrder(_ethbtc.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _ethbtc, order).IsSufficient);\n\n            // 0.82671957 * 12000 + fees <= 10000 EUR\n            targetValue = 10000m * _portfolio.CashBook[\"EUR\"].ConversionRate / _portfolio.TotalPortfolioValue;\n            getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btceur, targetValue, 0).Quantity;\n            Assert.AreEqual(0.82671957m, getMaximumOrderQuantityForTargetValueResult);\n\n            order = new MarketOrder(_btceur.Symbol, getMaximumOrderQuantityForTargetValueResult, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n        }\n\n        [Test]\n        public void CalculatesMaximumOrderQuantityCorrectlySmallerTarget()\n        {\n            _portfolio.SetCash(10000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _algorithm.SetFinishedWarmingUp();\n\n            var getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 0.1m, 0);\n            // Quantity * 15000m + fees + price buffer <= 1000 USD Target\n            Assert.AreEqual(0.06613756m, getMaximumOrderQuantityForTargetValueResult.Quantity);\n\n            var order = new MarketOrder(_btcusd.Symbol, getMaximumOrderQuantityForTargetValueResult.Quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void CalculatesMaximumOrderQuantityCorrectlyBiggerTarget()\n        {\n            _portfolio.SetCash(10000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _algorithm.SetFinishedWarmingUp();\n\n            var getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 10m, 0);\n            // Quantity * 15000m + fees + price buffer <= 100000 USD Target\n            Assert.AreEqual(6.61375661m, getMaximumOrderQuantityForTargetValueResult.Quantity);\n\n            var order = new MarketOrder(_btcusd.Symbol, getMaximumOrderQuantityForTargetValueResult.Quantity, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void CalculatesMaximumOrderQuantityCorrectlyForAlmostNoCashRemaining()\n        {\n            _portfolio.SetCash(0.00000000001m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _algorithm.SetFinishedWarmingUp();\n\n            var getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 10000 / _portfolio.TotalPortfolioValue, 0);\n            // We don't have enough cash, but GetMaximumOrderQuantityForTargetValue does not care about this :)\n            Assert.AreEqual(0.66137566m, getMaximumOrderQuantityForTargetValueResult.Quantity);\n\n            var order = new MarketOrder(_btcusd.Symbol, getMaximumOrderQuantityForTargetValueResult.Quantity, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void CalculatesMaximumOrderQuantityCorrectlyForNoOrderFee()\n        {\n            _portfolio.SetCash(100000m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _algorithm.Securities[_btcusd.Symbol].SetFeeModel(new ConstantFeeModel(0));\n\n            _btcusd.SetMarketPrice(new Tick { Value = 15000m });\n\n            _algorithm.SetFinishedWarmingUp();\n            var getMaximumOrderQuantityForTargetValueResult = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 0.1m, 0);\n            // Quantity * 15000m + fees (0) + price buffer <= 10000 USD Target\n            Assert.AreEqual(0.66666666m, getMaximumOrderQuantityForTargetValueResult.Quantity);\n\n            var order = new MarketOrder(_btcusd.Symbol, getMaximumOrderQuantityForTargetValueResult.Quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketBuyOrderChecksExistingHoldings()\n        {\n            _portfolio.SetCash(8000);\n            _portfolio.CashBook.Add(\"BTC\", 0.2m, 10000m);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m });\n            _algorithm.SetFinishedWarmingUp();\n\n            Assert.AreEqual(10000m, _portfolio.TotalPortfolioValue);\n\n            // Maximum we can market buy for (10000-2000) = 8000 USD is 0.79365079 BTC\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 10000m / _portfolio.TotalPortfolioValue, 0).Quantity;\n            Assert.AreEqual(0.79365079m, quantity);\n\n            // the maximum order quantity can be executed\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketBuyBtcWithEurCalculatesBuyingPowerProperlyWithExistingHoldings()\n        {\n            _portfolio.SetCash(\"EUR\", 20000m, 1.20m);\n            _portfolio.CashBook.Add(\"BTC\", 1m, 12000m);\n            _btceur.SetLocalTimeKeeper(_timeKeeper);\n            _btceur.SetMarketPrice(new Tick { Value = 10000m });\n            // Maximum we can market buy with 20000 EUR is 1.98412698 BTC\n            // target value = 30000 EUR = 20000 EUR in cash + 10000 EUR in BTC\n            var targetValue = 30000m * _portfolio.CashBook[\"EUR\"].ConversionRate / _portfolio.TotalPortfolioValue;\n            Assert.AreEqual(1.98412698m, _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btceur, targetValue, 0).Quantity);\n\n            // Available cash = 20000 EUR, can buy 1.98 BTC at 10000 (plus fees)\n            var order = new MarketOrder(_btceur.Symbol, 1.98m, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n\n            // Available cash = 20000 EUR, cannot buy 2 BTC at 10000 (plus fees)\n            order = new MarketOrder(_btceur.Symbol, 2m, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btceur, order).IsSufficient);\n        }\n\n        [Test]\n        public void MarketBuyOrderUsesAskPriceIfAvailable()\n        {\n            _portfolio.SetCash(10000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            Assert.AreEqual(10000m, _portfolio.TotalPortfolioValue);\n\n            // Maximum we can market buy at ask price with 10000 USD is 0.98712785 BTC\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1m, 0).Quantity;\n            Assert.AreEqual(0.98712785m, quantity);\n\n            // the maximum order quantity can be executed\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void ZeroTargetWithZeroHoldingsIsNotAnError()\n        {\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n\n            var result = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_algorithm.Portfolio, _btcusd, 0, 0);\n\n            var order = new MarketOrder(_btcusd.Symbol, result.Quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            Assert.AreEqual(0, result.Quantity);\n            Assert.AreEqual(string.Empty, result.Reason);\n            Assert.AreEqual(false, result.IsError);\n        }\n\n        [Test]\n        public void ZeroTargetWithNonZeroHoldingsReturnsNegativeOfQuantity()\n        {\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _portfolio.CashBook.Add(\"BTC\", 1m, 12000m);\n\n            var result = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_algorithm.Portfolio, _btcusd, 0, 0);\n\n            var order = new MarketOrder(_btcusd.Symbol, result.Quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n\n            Assert.AreEqual(-1, result.Quantity);\n            Assert.AreEqual(string.Empty, result.Reason);\n            Assert.AreEqual(false, result.IsError);\n        }\n\n        [Test]\n        public void NonAccountCurrencyFees()\n        {\n            _portfolio.SetCash(10000);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n            _btcusd.FeeModel = new NonAccountCurrencyCustomFeeModel();\n            Assert.AreEqual(10000m, _portfolio.TotalPortfolioValue);\n\n            // 0.24875621 * 100050 (ask price) + 0.5 (fee) * 15000 (conversion rate, because its BTC) = 9999.9999105\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1m, 0).Quantity;\n            Assert.AreEqual(0.24875621m, quantity);\n\n            // the maximum order quantity can be executed\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void NonAccountCurrency_NoQuoteCurrencyCash()\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(10000);\n            Assert.AreEqual(10000m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            _algorithm.Portfolio.CashBook[Currencies.USD].ConversionRate = 0.88m;\n\n            // we don't have any USD ! cash model shouldn't let us trade\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1m, 0).Quantity;\n            Assert.AreNotEqual(0m, quantity);\n\n            // HasSufficientBuyingPowerForOrder does check margin requirements\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            var result = _buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order);\n            Assert.IsFalse(result.IsSufficient);\n            Assert.IsTrue(result.Reason.Contains(\"only a total value of 0 USD is available.\"));\n        }\n\n        [TestCase(\"EUR\")]\n        [TestCase(\"ARG\")]\n        public void ZeroNonAccountCurrency_GetMaximumOrderQuantityForTargetValue(string accountCurrency)\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(accountCurrency);\n            _algorithm.Portfolio.SetCash(0);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(8800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            // Maximum we can market buy at ask price with 10000 USD is 0.98712785 BTC => Account currency should not matter\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1m, 0).Quantity;\n            Assert.AreEqual(0.98712785m, quantity);\n\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            var fee = _btcusd.FeeModel.GetOrderFee(new OrderFeeParameters(_btcusd, order));\n            var feeAsAccountCurrency = _algorithm.Portfolio.CashBook.ConvertToAccountCurrency(fee.Value);\n            var expectedQuantity = (8800 - feeAsAccountCurrency.Amount) / (_btcusd.AskPrice * 0.88m);\n            expectedQuantity -= expectedQuantity % _btcusd.SymbolProperties.LotSize;\n            Assert.AreEqual(expectedQuantity, quantity);\n\n            // the maximum order quantity can be executed\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [Test]\n        public void ZeroNonAccountCurrency_GetBuyingPower()\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(0);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(8800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            var quantity = _buyingPowerModel.GetBuyingPower(new BuyingPowerParameters(_portfolio, _btcusd, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(1m, quantity);\n        }\n\n        [Test]\n        public void ZeroNonAccountCurrency_GetReservedBuyingPowerForPosition()\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(0);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(8800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n            _btcusd.Holdings.SetHoldings(_btcusd.Price, 100);\n\n            var res = _buyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(_btcusd));\n\n            // Always returns 0. Since we're purchasing currencies outright, the position doesn't consume buying power\n            Assert.AreEqual(0m, res.AbsoluteUsedBuyingPower);\n        }\n\n        [Test]\n        public void NonAccountCurrency_GetBuyingPower()\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(10000);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(18800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            var quantity = _buyingPowerModel.GetBuyingPower(new BuyingPowerParameters(_portfolio, _btcusd, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(1m, quantity);\n        }\n\n        [Test]\n        public void NonAccountCurrency_ZeroQuoteCurrency_GetBuyingPower()\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(10000);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            Assert.AreEqual(10000, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            var quantity = _buyingPowerModel.GetBuyingPower(new BuyingPowerParameters(_portfolio, _btcusd, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(0m, quantity);\n        }\n\n        [TestCase(\"EUR\")]\n        [TestCase(\"ARG\")]\n        public void NonZeroNonAccountCurrency_UnReachableTarget(string accountCurrency)\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            _algorithm.Portfolio.SetCash(10000);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(18800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            // Maximum we can market buy at ask price with 10000 USD + (10000 EUR / 0.88 rate) is 2.10886404 BTC\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, 1m, 0).Quantity;\n            Assert.AreEqual(2.10886404m, quantity);\n\n            // the maximum order quantity can be executed\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsFalse(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        [TestCase(\"EUR\")]\n        [TestCase(\"ARG\")]\n        public void NonZeroNonAccountCurrency_ReachableTarget(string accountCurrency)\n        {\n            _algorithm.Portfolio.CashBook.Clear();\n            _algorithm.Portfolio.SetAccountCurrency(accountCurrency);\n            _algorithm.Portfolio.SetCash(10000);\n            _algorithm.Portfolio.SetCash(Currencies.USD, 10000, 0.88m);\n            Assert.AreEqual(18800m, _portfolio.TotalPortfolioValue);\n\n            _btcusd = _algorithm.AddCrypto(\"BTCUSD\");\n            _btcusd.SetLocalTimeKeeper(_timeKeeper);\n            _btcusd.SetMarketPrice(new Tick { Value = 10000m, BidPrice = 9950, AskPrice = 10050, TickType = TickType.Quote });\n            _algorithm.SetFinishedWarmingUp();\n\n            // only use the USD for determining the target\n            var reachableTarget = 8800m / 18800m;\n            // Maximum we can market buy at ask price with 10000 USD is 0.98712785 BTC => Account currency should not matter\n            var quantity = _buyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(_portfolio, _btcusd, reachableTarget, 0).Quantity;\n            Assert.AreEqual(0.98712785m, quantity);\n\n            // the maximum order quantity can be executed\n            var order = new MarketOrder(_btcusd.Symbol, quantity, DateTime.UtcNow);\n            Assert.IsTrue(_buyingPowerModel.HasSufficientBuyingPowerForOrder(_portfolio, _btcusd, order).IsSufficient);\n        }\n\n        private void SubmitLimitOrder(Symbol symbol, decimal quantity, decimal limitPrice)\n        {\n            using (var resetEvent = new ManualResetEvent(false))\n            {\n                EventHandler<List<OrderEvent>> handler = (s, e) => { resetEvent.Set(); };\n\n                _brokerage.OrdersStatusChanged += handler;\n\n                _algorithm.LimitOrder(symbol, quantity, limitPrice);\n\n                if (!resetEvent.WaitOne(5000))\n                {\n                    throw new TimeoutException(\"SubmitLimitOrder\");\n                }\n\n                _brokerage.OrdersStatusChanged -= handler;\n            }\n        }\n\n        private void SubmitStopMarketOrder(Symbol symbol, decimal quantity, decimal stopPrice)\n        {\n            using (var resetEvent = new ManualResetEvent(false))\n            {\n                EventHandler<List<OrderEvent>> handler = (s, e) => { resetEvent.Set(); };\n\n                _brokerage.OrdersStatusChanged += handler;\n\n                _algorithm.StopMarketOrder(symbol, quantity, stopPrice);\n\n                if (!resetEvent.WaitOne(5000))\n                {\n                    throw new TimeoutException(\"SubmitStopMarketOrder\");\n                }\n\n                _brokerage.OrdersStatusChanged -= handler;\n            }\n        }\n\n        internal class NonAccountCurrencyCustomFeeModel : FeeModel\n        {\n            public string FeeCurrency = \"BTC\";\n            public decimal FeeAmount = 0.5m;\n\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                return new OrderFee(new CashAmount(FeeAmount, FeeCurrency));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CashTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CurrencyConversion;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class CashTests\n    {\n        private static readonly DateTimeZone TimeZone = TimeZones.NewYork;\n        private static readonly SecurityExchangeHours SecurityExchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZone);\n        private static readonly IReadOnlyDictionary<SecurityType, string> MarketMap = DefaultBrokerageModel.DefaultMarketMap;\n\n        [Test]\n        public void ConstructorCapitalizedSymbol()\n        {\n            var cash = new Cash(\"low\", 0, 0);\n            Assert.AreEqual(\"LOW\", cash.Symbol);\n        }\n\n        [TestCase(null)]\n        [TestCase(\"\")]\n        public void ConstructorThrowsOnEmptySymbol(string currency)\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var cash = new Cash(currency, 0, 0);\n            }, \"Cash symbols cannot be null or empty.\");\n        }\n\n        [Test]\n        [TestCase(\"too long\")]\n        [TestCase(\"s\")]\n        public void ConstructorOnCustomSymbolLength(string currency)\n        {\n            var cash = new Cash(currency, 0, 0);\n            Assert.AreEqual(currency.ToUpper(CultureInfo.InvariantCulture), cash.Symbol);\n        }\n\n        [Test]\n        public void ConstructorSetsProperties()\n        {\n            const string symbol = \"JPY\";\n            const int quantity = 1;\n            const decimal conversionRate = 1.2m;\n            var cash = new Cash(symbol, quantity, conversionRate);\n            Assert.AreEqual(symbol, cash.Symbol);\n            Assert.AreEqual(quantity, cash.Amount);\n            Assert.AreEqual(conversionRate, cash.ConversionRate);\n        }\n\n        [Test]\n        public void ComputesValueInBaseCurrency()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            Assert.AreEqual(quantity * conversionRate, cash.ValueInAccountCurrency);\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedAddsSubscription()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var abcConfig = subscriptions.Add(Symbols.SPY, Resolution.Minute, TimeZone, TimeZone);\n            var securities = new SecurityManager(TimeKeeper);\n\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    abcConfig,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    cashBook,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()));\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n\n            Assert.AreEqual(1, subscriptions.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.USDJPY, includeInternalConfigs:true).Count);\n            Assert.AreEqual(1, securities.Values.Count(x => x.Symbol == Symbols.USDJPY));\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedChecksSecurityChangesForSecurity()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var abcConfig = subscriptions.Add(Symbols.SPY, Resolution.Minute, TimeZone, TimeZone);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    abcConfig,\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var usdjpy = new Security(Symbols.USDJPY, SecurityExchangeHours, new Cash(\"JPY\", 0, 0), SymbolProperties.GetDefault(\"JPY\"), ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null, new SecurityCache());\n            var changes = SecurityChangesTests.CreateNonInternal(new[] { usdjpy }, Enumerable.Empty<Security>());\n            var addedSecurities = cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, changes, dataManager.SecurityService, cashBook.AccountCurrency);\n\n            // the security exists in SecurityChanges so it is NOT added to the security manager or subscriptions\n            // this security will be added by the algorithm manager\n            Assert.True(addedSecurities == null || addedSecurities.Count == 0);\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedsAddsSubscriptionAtMinimumResolution()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            const Resolution minimumResolution = Resolution.Second;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(Symbols.SPY, Resolution.Minute, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities.Add(\n                Symbols.EURUSD,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(Symbols.EURUSD, minimumResolution, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n            Assert.AreEqual(minimumResolution, subscriptions.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.USDJPY, includeInternalConfigs: true).Single().Resolution);\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedMarksIsCurrencyDataFeedForNewSubscriptions()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                Symbols.EURUSD,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(Symbols.EURUSD, Resolution.Minute, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n            var config = subscriptions.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.USDJPY, includeInternalConfigs: true).Single();\n            Assert.IsTrue(config.IsInternalFeed);\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedDoesNotMarkIsCurrencyDataFeedForExistantSubscriptions()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                Symbols.USDJPY,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(Symbols.USDJPY, Resolution.Minute, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n            var config = subscriptions.Subscriptions.Single(x => x.Symbol == Symbols.USDJPY);\n            Assert.IsFalse(config.IsInternalFeed);\n        }\n\n        [TestCase(\"USD\", \"GBP\", \"JPY\", \"GBPUSD\", \"USDJPY\", SecurityType.Forex, Market.FXCM),\n         TestCase(\"EUR\", \"GBP\", \"JPY\", \"EURGBP\", \"EURJPY\", SecurityType.Forex, Market.FXCM),\n         TestCase(\"AUD\", \"GBP\", \"USD\", \"GBPAUD\", \"AUDUSD\", SecurityType.Forex, Market.FXCM),\n         TestCase(\"AUD\", \"JPY\", \"EUR\", \"AUDJPY\", \"EURAUD\", SecurityType.Forex, Market.FXCM),\n         TestCase(\"CHF\", \"JPY\", \"EUR\", \"CHFJPY\", \"EURCHF\", SecurityType.Forex, Market.FXCM),\n         TestCase(\"SGD\", \"JPY\", \"EUR\", \"SGDJPY\", \"EURSGD\", SecurityType.Forex, Market.Oanda),\n         TestCase(\"BTC\", \"USD\", \"EUR\", \"BTCUSD\", \"BTCEUR\", SecurityType.Crypto, Market.Bitfinex),\n         TestCase(\"EUR\", \"BTC\", \"ETH\", \"BTCEUR\", \"ETHEUR\", SecurityType.Crypto, Market.Bitfinex),\n         TestCase(\"USD\", \"BTC\", \"ETH\", \"BTCUSD\", \"ETHUSD\", SecurityType.Crypto, Market.Bitfinex),\n         TestCase(\"ETH\", \"USD\", \"BTC\", \"ETHUSD\", \"ETHBTC\", SecurityType.Crypto, Market.Bitfinex),\n         TestCase(\"LTC\", \"USD\", \"BTC\", \"LTCUSD\", \"LTCBTC\", SecurityType.Crypto, Market.Bitfinex),\n         TestCase(\"ETH\", \"BTC\", \"EOS\", \"ETHBTC\", \"EOSETH\", SecurityType.Crypto, Market.Bitfinex)]\n        public void NonUsdAccountCurrencyCurrencyDataFeedsGetAdded(string accountCurrency,\n            string quoteCurrency,\n            string baseCurrency,\n            string quoteCurrencySymbol,\n            string baseCurrencySymbol,\n            SecurityType securityType,\n            string market)\n        {\n            var quoteCash = new Cash(quoteCurrency, 100, 1);\n            var baseCash = new Cash(baseCurrency, 100, 1);\n            var cashBook = new CashBook {{quoteCurrency, quoteCash},\n                { baseCurrency, baseCash}};\n\n            var symbol = Symbol.Create(baseCurrency + quoteCurrency,\n                securityType,\n                market);\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper)\n            {\n                {\n                    symbol, new Security(\n                        SecurityExchangeHours,\n                        subscriptions.Add(symbol, Resolution.Minute, TimeZone, TimeZone),\n                        new Cash(cashBook.AccountCurrency, 0, 1m),\n                        SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCache()\n                    )\n                }\n            };\n\n            var configs1 = quoteCash.EnsureCurrencyDataFeed(securities,\n                subscriptions,\n                MarketMap,\n                SecurityChanges.None,\n                dataManager.SecurityService,\n                accountCurrency);\n            Assert.AreEqual(1, configs1.Count);\n\n            var config1 = configs1[0];\n            Assert.IsNotNull(config1);\n            Assert.AreEqual(quoteCurrencySymbol, config1.Symbol.Value);\n\n            var configs2 = baseCash.EnsureCurrencyDataFeed(securities,\n                subscriptions,\n                MarketMap,\n                SecurityChanges.None,\n                dataManager.SecurityService,\n                accountCurrency);\n            Assert.AreEqual(1, configs2.Count);\n\n            var config2 = configs2[0];\n            Assert.IsNotNull(config2);\n            Assert.AreEqual(baseCurrencySymbol, config2.Symbol.Value);\n        }\n\n        public void EnsureInternalCurrencyDataFeedsForNonUsdQuoteCurrencyGetAdded()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cashJPY = new Cash(\"JPY\", quantity, conversionRate);\n            var cashGBP = new Cash(\"GBP\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cashJPY);\n            cashBook.Add(\"GBP\", cashGBP);\n\n            var symbol = Symbol.Create(\"GBPJPY\", SecurityType.Forex, Market.FXCM);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                symbol,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(symbol, Resolution.Minute, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            cashJPY.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n            var config1 = subscriptions.Subscriptions.Single(x => x.Symbol == Symbols.USDJPY);\n            Assert.IsTrue(config1.IsInternalFeed);\n\n            cashGBP.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n            var config2 = subscriptions.Subscriptions.Single(x => x.Symbol == Symbols.GBPUSD);\n            Assert.IsTrue(config2.IsInternalFeed);\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedsForNonUsdQuoteCurrencyDoNotGetAddedToSymbolCache()\n        {\n            SymbolCache.Clear();\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cashJPY = new Cash(\"JPY\", quantity, conversionRate);\n            var cashGBP = new Cash(\"GBP\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cashJPY);\n            cashBook.Add(\"GBP\", cashGBP);\n\n            var symbol = Symbol.Create(\"GBPJPY\", SecurityType.Forex, Market.FXCM);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            securities.Add(\n                symbol,\n                new Security(\n                    SecurityExchangeHours,\n                    subscriptions.Add(symbol, Resolution.Minute, TimeZone, TimeZone),\n                    new Cash(cashBook.AccountCurrency, 0, 1m),\n                    SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n\n            Assert.IsNotNull(\n                cashGBP.EnsureCurrencyDataFeed(\n                    securities,\n                    subscriptions,\n                    MarketMap,\n                    SecurityChanges.None,\n                    dataManager.SecurityService,\n                    cashBook.AccountCurrency));\n            Assert.IsNotNull(\n                cashJPY.EnsureCurrencyDataFeed(securities,\n                    subscriptions,\n                    MarketMap,\n                    SecurityChanges.None,\n                    dataManager.SecurityService,\n                    cashBook.AccountCurrency));\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"USDJPY\", out symbol));\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"GBPUSD\", out symbol));\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedForCryptoCurrency()\n        {\n            var book = new CashBook\n            {\n                {Currencies.USD, new Cash(Currencies.USD, 100, 1) },\n                {\"BTC\", new Cash(\"BTC\", 100, 6000) },\n                {\"LTC\", new Cash(\"LTC\", 100, 55) },\n                {\"ETH\", new Cash(\"ETH\", 100, 290) },\n                {\"EUR\", new Cash(\"EUR\", 100, 1.2m) },\n                {\"JPY\", new Cash(\"JPY\", 100, 0.0088m) },\n                {\"XAG\", new Cash(\"XAG\", 100, 1275) },\n                {\"XAU\", new Cash(\"XAU\", 100, 17) }\n            };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n\n            book.EnsureCurrencyDataFeeds(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService);\n\n            var symbols = dataManager.SubscriptionManagerSubscriptions.Select(sdc => sdc.Symbol).ToHashSet();\n\n            Assert.IsTrue(symbols.Contains(Symbols.BTCUSD));\n            Assert.IsTrue(symbols.Contains(Symbols.LTCUSD));\n            Assert.IsTrue(symbols.Contains(Symbols.ETHUSD));\n            Assert.IsTrue(symbols.Contains(Symbols.EURUSD));\n            Assert.IsTrue(symbols.Contains(Symbols.XAGUSD));\n            Assert.IsTrue(symbols.Contains(Symbols.XAUUSD));\n\n            foreach (var subscription in subscriptions.Subscriptions)\n            {\n                Assert.AreEqual(\n                    subscription.Symbol.SecurityType == SecurityType.Crypto ? TickType.Trade : TickType.Quote,\n                    subscription.TickType);\n            }\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedForCryptoCurrency_CryptoFuturesFirst_When_dYdX()\n        {\n            var book = new CashBook\n            {\n                {Currencies.USD, new Cash(Currencies.USD, 100, 1) },\n                {\"BTC\", new Cash(\"BTC\", 100, 6000) },\n                {\"ETH\", new Cash(\"ETH\", 100, 290) }\n            };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n\n            var marketMapWithdYdX = MarketMap.ToDictionary();\n            marketMapWithdYdX[SecurityType.CryptoFuture] = Market.DYDX;\n\n            book.EnsureCurrencyDataFeeds(securities, subscriptions, marketMapWithdYdX, SecurityChanges.None, dataManager.SecurityService);\n\n            var symbols = dataManager.SubscriptionManagerSubscriptions.Select(sdc => sdc.Symbol).ToHashSet();\n\n            Assert.IsTrue(symbols.Contains(Symbol.Create(\"BTCUSD\", SecurityType.CryptoFuture, Market.DYDX)));\n            Assert.IsTrue(symbols.Contains(Symbol.Create(\"ETHUSD\", SecurityType.CryptoFuture, Market.DYDX)));\n\n            foreach (var subscription in subscriptions.Subscriptions)\n            {\n                Assert.AreEqual(subscription.Symbol.SecurityType, SecurityType.CryptoFuture);\n            }\n        }\n\n        [Test]\n        public void UpdateModifiesConversionRateAsInvertedValue()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"JPY\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"JPY\", cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            var security = new Security(\n                SecurityExchangeHours,\n                subscriptions.Add(Symbols.USDJPY, Resolution.Minute, TimeZone, TimeZone),\n                new Cash(cashBook.AccountCurrency, 0, 1m),\n                SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            securities.Add(Symbols.USDJPY, security);\n\n            // we need to get subscription index\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n\n            var last = 120m;\n            security.SetMarketPrice(new Tick(DateTime.Now, Symbols.USDJPY, last, 119.95m, 120.05m));\n            cash.Update();\n\n            // jpy is inverted, so compare on the inverse\n            Assert.AreEqual(1 / last, cash.ConversionRate);\n        }\n\n        [Test]\n        public void UpdateModifiesConversionRate()\n        {\n            const int quantity = 100;\n            const decimal conversionRate = 1 / 100m;\n            var cash = new Cash(\"GBP\", quantity, conversionRate);\n            var cashBook = new CashBook();\n            cashBook.Add(\"GBP\", cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            var security = new Security(\n                SecurityExchangeHours,\n                subscriptions.Add(Symbols.GBPUSD, Resolution.Minute, TimeZone, TimeZone),\n                new Cash(cashBook.AccountCurrency, 0, 1m),\n                SymbolProperties.GetDefault(cashBook.AccountCurrency),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            securities.Add(Symbols.GBPUSD, security);\n\n            // we need to get subscription index\n            cash.EnsureCurrencyDataFeed(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n\n            var last = 1.5m;\n            security.SetMarketPrice(new Tick(DateTime.Now, Symbols.GBPUSD, last, last * 1.009m, last * 0.009m));\n            cash.Update();\n\n            // jpy is inverted, so compare on the inverse\n            Assert.AreEqual(last, cash.ConversionRate);\n        }\n\n        [TestCase(\"USD\", \"$\")]\n        [TestCase(\"EUR\", \"€\")]\n        [TestCase(\"GBP\", \"₤\")]\n        [TestCase(\"BTC\", \"₿\")]\n        public void CashHasCorrectCurrencySymbol(string symbol, string currencySymbol)\n        {\n            var cash = new Cash(symbol, 1, 1);\n            Assert.AreEqual(currencySymbol, cash.CurrencySymbol);\n        }\n\n        [Test]\n        public void UpdateEventCalledForSetAmountMethod()\n        {\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cash.Updated += (sender, args) =>\n            {\n                called = true;\n            };\n            cash.SetAmount(10m);\n            Assert.IsTrue(called);\n        }\n\n        [Test]\n        public void UpdateEventCalledForAddAmountMethod()\n        {\n            var called = false;\n            var cash = new Cash(Currencies.USD, 1, 1);\n            cash.Updated += (sender, args) =>\n            {\n                called = true;\n            };\n            cash.AddAmount(10m);\n            Assert.IsTrue(called);\n        }\n\n        [Test]\n        public void CashBookWithUsdCanBeSerializedAfterEnsureCurrencyDataFeed()\n        {\n            var book = new CashBook\n            {\n                {Currencies.USD, new Cash(Currencies.USD, 100, 1) },\n                {\"EUR\", new Cash(\"EUR\", 100, 1.2m) }\n            };\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n\n            book.EnsureCurrencyDataFeeds(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService);\n\n            Assert.DoesNotThrow(() => JsonConvert.SerializeObject(book, Formatting.Indented));\n        }\n\n        [Test]\n        public void EnsureCurrencyDataFeedDoesNothingWithUnsupportedCurrency()\n        {\n            var book = new CashBook\n            {\n                {Currencies.USD, new Cash(Currencies.USD, 100, 1) },\n                {\"ILS\", new Cash(\"ILS\", 0, 0.3m) }\n            };\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n\n            var added = book.EnsureCurrencyDataFeeds(securities, subscriptions, MarketMap, SecurityChanges.None, dataManager.SecurityService);\n            Assert.IsEmpty(added);\n        }\n\n        [TestCaseSource(nameof(cryptoBrokerageStableCoinCases))]\n        public void CryptoStableCoinMappingIsCorrect(IBrokerageModel brokerageModel, string accountCurrency, string stableCoin, bool shouldThrow, Symbol[] expectedConversionSymbols)\n        {\n            var cashBook = new CashBook() {AccountCurrency = accountCurrency};\n            var cash = new Cash(stableCoin, 10m, 0);\n            cashBook.Add(cash.Symbol, cash);\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n\n            // Verify the behavior throws or doesn't throw depending on the case\n            if (shouldThrow)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    cash.EnsureCurrencyDataFeed(securities, subscriptions, brokerageModel.DefaultMarkets, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n                });\n            }\n            else\n            {\n                Assert.DoesNotThrow(() =>\n                {\n                    cash.EnsureCurrencyDataFeed(securities, subscriptions, brokerageModel.DefaultMarkets, SecurityChanges.None, dataManager.SecurityService, cashBook.AccountCurrency);\n                });\n            }\n\n            // Verify the conversion symbol is correct\n            if (expectedConversionSymbols == null)\n            {\n                Assert.IsInstanceOf(typeof(ConstantCurrencyConversion), cash.CurrencyConversion);\n                Assert.AreEqual(accountCurrency, cash.CurrencyConversion.SourceCurrency);\n                Assert.AreEqual(stableCoin, cash.CurrencyConversion.DestinationCurrency);\n                Assert.AreEqual(1m, cash.ConversionRate);\n                CollectionAssert.IsEmpty(cash.CurrencyConversion.ConversionRateSecurities);\n            }\n            else\n            {\n                Assert.IsInstanceOf(typeof(SecurityCurrencyConversion), cash.CurrencyConversion);\n                var actualConversionSymbols = cash.CurrencyConversion\n                    .ConversionRateSecurities\n                    .Select(x => x.Symbol)\n                    .ToArray();\n\n                Assert.AreEqual(expectedConversionSymbols, actualConversionSymbols);\n            }\n        }\n\n        private static TimeKeeper TimeKeeper\n        {\n            get { return new TimeKeeper(DateTime.Now, new[] { TimeZone }); }\n        }\n\n        // Crypto brokerage model stable coin and account currency cases\n        // The last var is expectedConversionSymbol, and is null when we expect there\n        // not to be an (indirect) conversion for our tests output\n        private static object[] cryptoBrokerageStableCoinCases =\n        {\n            // *** Bitfinex ***\n            // Trades USDC, EURS, USDT y XCHF\n            // USDC Cases\n            new object[] { new BitfinexBrokerageModel(), Currencies.USD, \"USDC\", false, new[] { Symbol.Create(\"USDCUSD\", SecurityType.Crypto, Market.Bitfinex) } },\n            new object[] { new BitfinexBrokerageModel(), Currencies.EUR, \"USDC\", false, new[] { Symbol.Create(\"USDCUSD\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda) } }, // No USDCEUR, but indirect conversion exists\n            new object[] { new BitfinexBrokerageModel(), Currencies.GBP, \"USDC\", false, new[] { Symbol.Create(\"USDCUSD\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"GBPUSD\", SecurityType.Forex, Market.Oanda) } }, // No USDCGBP, but indirect conversion exists\n\n            // EURS Cases\n            new object[] { new BitfinexBrokerageModel(), Currencies.USD, \"EURS\", false, new[] { Symbol.Create(\"EURSUSD\", SecurityType.Crypto, Market.Bitfinex) } },\n            new object[] { new BitfinexBrokerageModel(), Currencies.EUR, \"EURS\", false, null }, // No EURSEUR, but does not throw! Conversion 1-1\n            new object[] { new BitfinexBrokerageModel(), Currencies.GBP, \"EURS\", false, new[] { Symbol.Create(\"EURSUSD\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"GBPUSD\", SecurityType.Forex, Market.Oanda) } }, // No EURSGBP, but indirect conversion exists\n\n            // USDT (Tether) Cases\n            new object[] { new BitfinexBrokerageModel(), Currencies.CNH, \"USDT\", false, new[] { Symbol.Create(\"USDTCNHT\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"CNHCNHT\", SecurityType.Crypto, Market.Bitfinex) } }, // No USDTCNH, but indirect conversion exists\n            new object[] { new BitfinexBrokerageModel(), Currencies.USD, \"USDT\", false, new[] { Symbol.Create(\"USDTUSD\", SecurityType.Crypto, Market.Bitfinex) } },\n            new object[] { new BitfinexBrokerageModel(), Currencies.EUR, \"USDT\", false, new[] { Symbol.Create(\"EURUSDT\", SecurityType.Crypto, Market.Bitfinex) } },\n            new object[] { new BitfinexBrokerageModel(), Currencies.GBP, \"USDT\", false, new[] { Symbol.Create(\"GBPUSDT\", SecurityType.Crypto, Market.Bitfinex) } },\n\n            // XCHF Cases\n            new object[] { new BitfinexBrokerageModel(), \"CHF\", \"XCHF\", false, null }, // No XCHFCHF, but does not throw! Conversion 1-1\n            new object[] { new BitfinexBrokerageModel(), Currencies.EUR, \"XCHF\", false, new[] { Symbol.Create(\"BTCXCHF\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Bitfinex) } }, // No XCHFEUR, but indirect conversion exists\n            new object[] { new BitfinexBrokerageModel(), Currencies.GBP, \"XCHF\", false, new[] { Symbol.Create(\"BTCXCHF\", SecurityType.Crypto, Market.Bitfinex), Symbol.Create(\"BTCGBP\", SecurityType.Crypto, Market.Bitfinex) } }, // No XCHFGBP, but indirect conversion exists\n\n            // *** Coinbase ***\n            // Trades USDC and USDT* (*Not yet trading live, but expected soon)\n            // USDC Cases\n            new object[] { new CoinbaseBrokerageModel(), Currencies.USD, \"USDC\", false, null }, // No USDCUSD, but does not throw! Conversion 1-1\n            new object[] { new CoinbaseBrokerageModel(), Currencies.EUR, \"USDC\", false, new[] { Symbol.Create(\"USDCEUR\", SecurityType.Crypto, Market.Coinbase) } },\n            new object[] { new CoinbaseBrokerageModel(), Currencies.GBP, \"USDC\", false, new[] { Symbol.Create(\"USDCGBP\", SecurityType.Crypto, Market.Coinbase) } },\n\n            // *** Binance ***\n            // USDC Cases\n            new object[] { new BinanceBrokerageModel(), \"USDT\", \"BNFCR\", false, null },\n            new object[] { new BinanceBrokerageModel(), \"USDC\", \"BNFCR\", false, null },\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"BNFCR\", false, null },\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"USDC\", false, null }, // No USDCUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), Currencies.EUR, \"USDC\", false, new[] { Symbol.Create(\"EURUSDC\", SecurityType.Crypto, Market.Binance) } },\n            new object[] { new BinanceBrokerageModel(), Currencies.GBP, \"USDC\", false, new[] { Symbol.Create(\"ADAUSDC\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"ADAGBP\", SecurityType.Crypto, Market.Binance) } }, // No USDCGBP, but indirect conversion exists\n\n            // USDT Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"USDT\", false, null }, // No USDTUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), \"VIA\", \"USDT\", false, new[] { Symbol.Create(\"BNBUSDT\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"VIABNB\", SecurityType.Crypto, Market.Binance) } }, // No USDTVIA, but indirect conversion exists\n\n            // USDP Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"USDP\", false, null }, // No USDPUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), \"VAI\", \"USDP\", false, new[] { Symbol.Create(\"BTCUSDP\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCVAI\", SecurityType.Crypto, Market.Binance) } }, // No USDPVAI, but indirect conversion exists\n\n            // BUSD Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"BUSD\", false, null }, // No BUSDUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), Currencies.EUR, \"BUSD\", false, new[] { Symbol.Create(\"EURBUSD\", SecurityType.Crypto, Market.Binance) } },\n            new object[] { new BinanceBrokerageModel(), Currencies.GBP, \"BUSD\", false, new[] { Symbol.Create(\"GBPBUSD\", SecurityType.Crypto, Market.Binance) } },\n\n            // UST Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"UST\", false, null }, // No USTUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), \"VAI\", \"UST\", false, new[] { Symbol.Create(\"BTCUST\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCVAI\", SecurityType.Crypto, Market.Binance) } }, // No USTVAI, but indirect conversion exists\n\n            // TUSD Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"TUSD\", false, null }, // No TUSDUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), \"VAI\", \"TUSD\", false, new[] { Symbol.Create(\"BTCTUSD\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCVAI\", SecurityType.Crypto, Market.Binance) } }, // No TUSDVAI, but indirect conversion exists\n\n            // DAI Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"DAI\", false, null }, // No DAIUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), Currencies.EUR, \"DAI\", false, new[] { Symbol.Create(\"BNBDAI\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BNBEUR\", SecurityType.Crypto, Market.Binance) } }, // No DAIEUR, but indirect conversion exists\n            new object[] { new BinanceBrokerageModel(), Currencies.GBP, \"DAI\", false, new[] { Symbol.Create(\"BNBDAI\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BNBGBP\", SecurityType.Crypto, Market.Binance) } }, // No DAIGBP, but indirect conversion exists\n\n            // USDS Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"SUSD\", false, null }, // No SUSDUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), Currencies.EUR, \"SUSD\", false, new[] { Symbol.Create(\"SUSDBTC\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Binance) } }, // No SUSDEUR, but indirect conversion exists\n            new object[] { new BinanceBrokerageModel(), Currencies.GBP, \"SUSD\", false, new[] { Symbol.Create(\"SUSDBTC\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCGBP\", SecurityType.Crypto, Market.Binance) } }, // No SUSDGBP, but indirect conversion exists\n\n            // IDRT Cases\n            new object[] { new BinanceBrokerageModel(), \"IDR\", \"IDRT\", false, null }, // No IDRTIDR, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), Currencies.EUR, \"IDRT\", false, new[] { Symbol.Create(\"BNBIDRT\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BNBEUR\", SecurityType.Crypto, Market.Binance) } }, // No IDRTEUR, but indirect conversion exists\n            new object[] { new BinanceBrokerageModel(), Currencies.GBP, \"IDRT\", false, new[] { Symbol.Create(\"BNBIDRT\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BNBGBP\", SecurityType.Crypto, Market.Binance) } }, // No IDRTGBP, but indirect conversion exists\n\n            new object[] { new OandaBrokerageModel(), Currencies.EUR, \"INR\", false, new[] { Symbol.Create(\"USDINR\", SecurityType.Forex, Market.Oanda), Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda) } }, // No INREUR, but indirect conversion exists\n\n            // FDUSD Cases\n            new object[] { new BinanceBrokerageModel(), Currencies.USD, \"FDUSD\", false, null }, // No FDUSDUSD, but does not throw! Conversion 1-1\n            new object[] { new BinanceBrokerageModel(), \"VAI\", \"FDUSD\", false, new[] { Symbol.Create(\"BTCFDUSD\", SecurityType.Crypto, Market.Binance), Symbol.Create(\"BTCVAI\", SecurityType.Crypto, Market.Binance) } }, // No FDUSDVAI, but indirect conversion exists\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Cfd/CfdTests.cs",
    "content": "﻿﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities.Cfd\n{\n    [TestFixture]\n    public class CfdTests\n    {\n        [Test]\n        public void ConstructorExtractsQuoteCurrency()\n        {\n            var symbol = Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.Oanda);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.Utc, TimeZones.NewYork, true, true, true);\n            var symbolProperties = new SymbolProperties(\"Dax German index\", \"EUR\", 1, 1, 1, string.Empty);\n            var cfd = new QuantConnect.Securities.Cfd.Cfd(SecurityExchangeHours.AlwaysOpen(config.DataTimeZone), new Cash(\"EUR\", 0, 0), config, symbolProperties, ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null);\n            Assert.AreEqual(\"EUR\", cfd.QuoteCurrency.Symbol);\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CryptoFuture/BybitCryptoFutureMarginModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities.CryptoFuture\n{\n    [TestFixture]\n    public class BybitCryptoFutureMarginModelTests\n    {\n        [TestCase(\"BTCUSDT\", 0.5, 10, 1600)]        // Bybit value: 1580\n        [TestCase(\"BTCUSDT\", -0.5, 10, 1600)]\n        [TestCase(\"BTCUSDT\", 0.5, 25, 650)]         // Bybit value: 640\n        [TestCase(\"BTCUSDT\", -0.5, 25, 650)]\n        [TestCase(\"BTCUSD\", 15000, 10, 0.05)]       // Bybit value: 0.0477\n        [TestCase(\"BTCUSD\", -15000, 10, 0.05)]\n        [TestCase(\"BTCUSD\", 15000, 25, 0.02)]       // Bybit value: 0.0192\n        [TestCase(\"BTCUSD\", -15000, 25, 0.02)]\n        public void BybitInitialMarginRequirement(string ticker, decimal quantity, decimal leverage, decimal expectedMargin)\n        {\n            var algo = GetAlgorithm();\n            var cryptoFuture = algo.AddCryptoFuture(ticker);\n            cryptoFuture.SetLeverage(leverage);\n            SetPrice(cryptoFuture, 31300);\n\n            var parameters = new InitialMarginParameters(cryptoFuture, quantity);\n            var result = cryptoFuture.BuyingPowerModel.GetInitialMarginRequirement(parameters);\n\n            if (cryptoFuture.IsCryptoCoinFuture())\n            {\n                // Convert to USD\n                expectedMargin *= cryptoFuture.Price;\n            }\n\n            Assert.AreEqual((double)expectedMargin, (double)result.Value, (double)(0.05m * expectedMargin));\n        }\n\n        private static QCAlgorithm GetAlgorithm()\n        {\n            var algo = new AlgorithmStub();\n            algo.SetBrokerageModel(BrokerageName.Bybit, AccountType.Margin);\n            algo.SetFinishedWarmingUp();\n            return algo;\n        }\n\n        private static void SetPrice(Security security, decimal price)\n        {\n            var cryptoFuture = (QuantConnect.Securities.CryptoFuture.CryptoFuture) security;\n            cryptoFuture.BaseCurrency.ConversionRate = price;\n            cryptoFuture.QuoteCurrency.ConversionRate = 1;\n\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = new DateTime(2022, 12, 22),\n                Symbol = security.Symbol,\n                Open = price,\n                High = price,\n                Low = price,\n                Close = price\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CryptoFuture/CryptoFutureMarginModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CryptoFuture;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities.CryptoFuture\n{\n    [TestFixture]\n    public class CryptoFutureMarginModelTests\n    {\n        [TestCase(\"BTCUSD\")]\n        [TestCase(\"BTCUSDT\")]\n        public void DefaultMarginModelType(string ticker)\n        {\n            var algo = GetAlgorithm();\n            var cryptoFuture = algo.AddCryptoFuture(ticker);\n\n            Assert.AreEqual(typeof(CryptoFutureMarginModel), cryptoFuture.BuyingPowerModel.GetType());\n        }\n\n        [TestCase(\"BTCUSD\", 10)]\n        [TestCase(\"BTCUSDT\", 10)]\n        [TestCase(\"BTCUSD\", -10)]\n        [TestCase(\"BTCUSDT\", -10)]\n        public void InitialMarginRequirement(string ticker, decimal quantity)\n        {\n            var algo = GetAlgorithm();\n            var cryptoFuture = algo.AddCryptoFuture(ticker);\n            SetPrice(cryptoFuture, 16000);\n\n            var parameters = new InitialMarginParameters(cryptoFuture, quantity);\n            var result = cryptoFuture.BuyingPowerModel.GetInitialMarginRequirement(parameters);\n\n            decimal marginRequirement;\n            if (ticker == \"BTCUSD\")\n            {\n                // ((quantity * contract mutiplier * price) / leverage) * conversion rate (BTC -> USD)\n                marginRequirement = ((parameters.Quantity * 100m * cryptoFuture.Price) / 25m ) *  1 / cryptoFuture.Price;\n            }\n            else\n            {\n                // ((quantity * contract mutiplier * price) / leverage) * conversion rate (USDT ~= USD)\n                marginRequirement = ((parameters.Quantity * 1m * cryptoFuture.Price) / 25m) * 1;\n            }\n\n            Assert.AreEqual(Math.Abs(marginRequirement), result.Value);\n        }\n\n        private static QCAlgorithm GetAlgorithm()\n        {\n            // Initialize algorithm\n            var algo = new AlgorithmStub();\n            algo.SetFinishedWarmingUp();\n            return algo;\n        }\n\n        private static void SetPrice(Security security, decimal price)\n        {\n            var cryptoFuture = (QuantConnect.Securities.CryptoFuture.CryptoFuture) security;\n            cryptoFuture.BaseCurrency.ConversionRate = price;\n            cryptoFuture.QuoteCurrency.ConversionRate = 1;\n\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = new DateTime(2022, 12, 22),\n                Symbol = security.Symbol,\n                Open = price,\n                High = price,\n                Low = price,\n                Close = price\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Cryptos/CryptoTests.cs",
    "content": "using NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Securities.Cryptos\n{\n    [TestFixture]\n    public class CryptoTests\n    {\n        private static TimeKeeper TimeKeeper\n        {\n            get { return new TimeKeeper(DateTime.Now, new[] { TimeZones.NewYork }); }\n        }\n\n        [Test]\n        [TestCase(\"BTCUSD\", \"USD\")]\n        [TestCase(\"BTCEUR\", \"EUR\")]\n        [TestCase(\"ETHBTC\", \"BTC\")]\n        [TestCase(\"ETHUSDT\", \"USDT\")]\n        public void ConstructorParseBaseCurrencyBySymbolProps(string ticker, string quote)\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            if (portfolio.CashBook.ContainsKey(quote))\n            {\n                portfolio.CashBook[quote].SetAmount(1000);\n            }\n            else\n            {\n                portfolio.CashBook.Add(quote, 0, 1000);\n            }\n            var cash = portfolio.CashBook[quote];\n            var symbol = Symbol.Create(ticker, SecurityType.Crypto, Market.Coinbase);\n\n            var crypto = new Crypto(\n                symbol,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                new Cash(ticker.StartsWith(\"BTC\", StringComparison.InvariantCultureIgnoreCase) ? \"BTC\" : \"ETH\", 0, 0),\n                SymbolProperties.GetDefault(quote),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            Assert.AreEqual(symbol.Value.RemoveFromEnd(quote), crypto.BaseCurrency.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/CurrencyConversion/SecurityCurrencyConversionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.CurrencyConversion;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities.CurrencyConversion\n{\n    [TestFixture]\n    public class SecurityCurrencyConversionTests\n    {\n        [Test]\n        public void LinearSearchFindsOneLegConversions()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.EURUSD };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub();\n            subscriptions.SetDataManager(dataManager);\n\n            var createdSecurities = new List<Security>();\n            var makeNewSecurity = new Func<Symbol, Security>(symbol =>\n            {\n                var security = CreateSecurity(symbol);\n                createdSecurities.Add(security);\n                return security;\n            });\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                makeNewSecurity);\n\n            var securities = currencyConversion.ConversionRateSecurities.ToList();\n            Assert.AreEqual(1, securities.Count);\n            Assert.AreEqual(createdSecurities, securities);\n            Assert.AreEqual(Symbols.EURUSD, securities[0].Symbol);\n        }\n\n        [Test]\n        public void LinearSearchFindsTwoLegConversions()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.BTCUSD, Symbols.EURUSD };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub();\n            subscriptions.SetDataManager(dataManager);\n\n            var createdSecurities = new List<Security>();\n            var makeNewSecurity = new Func<Symbol, Security>(symbol =>\n            {\n                var security = CreateSecurity(symbol);\n                createdSecurities.Add(security);\n                return security;\n            });\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"BTC\",\n                \"EUR\",\n                existingSecurities,\n                potentialSymbols,\n                makeNewSecurity);\n\n            var securities = currencyConversion.ConversionRateSecurities.ToList();\n            Assert.AreEqual(2, securities.Count);\n            Assert.AreEqual(createdSecurities, securities);\n            Assert.AreEqual(Symbols.BTCUSD, securities[0].Symbol);\n            Assert.AreEqual(Symbols.EURUSD, securities[1].Symbol);\n        }\n\n        [Test]\n        public void LinearSearchPrefersExistingSecuritiesOverNewOnesOneLeg()\n        {\n            var existingSecurities = new List<Security> { CreateSecurity(Symbols.EURUSD) };\n            var potentialSymbols = new List<Symbol> { Symbols.EURUSD };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub();\n            subscriptions.SetDataManager(dataManager);\n\n            var createdSecurities = new List<Security>();\n            var makeNewSecurity = new Func<Symbol, Security>(symbol =>\n            {\n                var security = CreateSecurity(symbol);\n                createdSecurities.Add(security);\n                return security;\n            });\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                makeNewSecurity);\n\n            var securities = currencyConversion.ConversionRateSecurities.ToList();\n            Assert.AreEqual(1, securities.Count);\n            Assert.AreEqual(0, createdSecurities.Count);\n            Assert.AreEqual(existingSecurities, securities);\n        }\n\n        [Test]\n        public void LinearSearchPrefersExistingSecuritiesOverNewOnesTwoLeg()\n        {\n            var existingSecurities = new List<Security> { CreateSecurity(Symbols.BTCUSD) };\n            var potentialSymbols = new List<Symbol> { Symbols.BTCUSD, Symbols.EURUSD };\n\n            var subscriptions = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub();\n            subscriptions.SetDataManager(dataManager);\n\n            var createdSecurities = new List<Security>();\n            var makeNewSecurity = new Func<Symbol, Security>(symbol =>\n            {\n                var security = CreateSecurity(symbol);\n                createdSecurities.Add(security);\n                return security;\n            });\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"BTC\",\n                \"EUR\",\n                existingSecurities,\n                potentialSymbols,\n                makeNewSecurity);\n\n            var securities = currencyConversion.ConversionRateSecurities.ToList();\n            Assert.AreEqual(2, securities.Count);\n            Assert.AreEqual(existingSecurities[0], securities[0]);\n            Assert.AreEqual(createdSecurities[0], securities[1]);\n            Assert.AreEqual(Symbols.EURUSD, securities[1].Symbol);\n        }\n\n        [Test]\n        public void LinearSearchThrowsWhenNoConversionPossible()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.EURGBP };\n\n            Assert.Throws<ArgumentException>(() => SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                CreateSecurity));\n        }\n\n        [TestCaseSource(nameof(oneLegCases))]\n        public void UpdateCalculatesNewConversionRateOneLeg(\n            string sourceCurrency,\n            string destinationCurrency,\n            Symbol symbol,\n            decimal expectedRate)\n        {\n            var existingSecurities = new List<Security> { CreateSecurity(symbol) };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                sourceCurrency,\n                destinationCurrency,\n                existingSecurities,\n                new List<Symbol>(0),\n                CreateSecurity);\n\n            existingSecurities[0].SetMarketPrice(new Tick { Value = 10m });\n\n            currencyConversion.Update();\n            Assert.AreEqual(expectedRate, currencyConversion.ConversionRate);\n        }\n\n        [TestCaseSource(nameof(twoLegCases))]\n        public void UpdateCalculatesNewConversionRateTwoLeg(\n            string sourceCurrency,\n            string destinationCurrency,\n            Symbol symbol1,\n            Symbol symbol2,\n            decimal expectedRate)\n        {\n            var existingSecurities = new List<Security>\n            {\n                CreateSecurity(symbol1),\n                CreateSecurity(symbol2)\n            };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                sourceCurrency,\n                destinationCurrency,\n                existingSecurities,\n                new List<Symbol>(0),\n                CreateSecurity);\n\n            existingSecurities[0].SetMarketPrice(new Tick { Value = 15m });\n            existingSecurities[1].SetMarketPrice(new Tick { Value = 25m });\n\n            currencyConversion.Update();\n            Assert.AreEqual(expectedRate, currencyConversion.ConversionRate);\n        }\n\n        [Test]\n        public void UpdateReturnsZeroWhenNoData()\n        {\n            var existingSecurities = new List<Security> { CreateSecurity(Symbols.BTCUSD) };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"BTC\",\n                \"USD\",\n                existingSecurities,\n                new List<Symbol>(0),\n                CreateSecurity);\n\n            currencyConversion.Update();\n            Assert.AreEqual(0m, currencyConversion.ConversionRate);\n        }\n\n        [Test]\n        public void UpdateReturnsZeroWhenNoDataForOneOfTwoSymbols()\n        {\n            var existingSecurities = new List<Security>\n            {\n                CreateSecurity(Symbols.ETHBTC),\n                CreateSecurity(Symbols.BTCUSD)\n            };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"ETH\",\n                \"USD\",\n                existingSecurities,\n                new List<Symbol>(0),\n                CreateSecurity);\n\n            existingSecurities[0].SetMarketPrice(new Tick { Value = 15m });\n\n            currencyConversion.Update();\n            Assert.AreEqual(0m, currencyConversion.ConversionRate);\n        }\n\n        [Test]\n        public void ConversionRateReturnsLatestConversionRate()\n        {\n            var existingSecurities = new List<Security> { CreateSecurity(Symbols.BTCUSD) };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"BTC\",\n                \"USD\",\n                existingSecurities,\n                new List<Symbol>(0),\n                CreateSecurity);\n\n            Assert.AreEqual(0m, currencyConversion.ConversionRate);\n\n            existingSecurities[0].SetMarketPrice(new Tick { Value = 10m });\n            currencyConversion.Update();\n            Assert.AreEqual(10m, currencyConversion.ConversionRate);\n\n            existingSecurities[0].SetMarketPrice(new Tick { Value = 20m });\n            currencyConversion.Update();\n            Assert.AreEqual(20m, currencyConversion.ConversionRate);\n        }\n\n        [Test]\n        public void ConversionRateZeroAtStart()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.EURUSD };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                CreateSecurity);\n\n            Assert.AreEqual(0, currencyConversion.ConversionRate);\n        }\n\n        [Test]\n        public void SourceCurrencyReturnsCorrectValue()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.EURUSD };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                CreateSecurity);\n\n            Assert.AreEqual(\"EUR\", currencyConversion.SourceCurrency);\n        }\n\n        [Test]\n        public void DestinationCurrencyReturnsCorrectValue()\n        {\n            var existingSecurities = new List<Security>(0);\n            var potentialSymbols = new List<Symbol> { Symbols.EURUSD };\n\n            var currencyConversion = SecurityCurrencyConversion.LinearSearch(\n                \"EUR\",\n                \"USD\",\n                existingSecurities,\n                potentialSymbols,\n                CreateSecurity);\n\n            Assert.AreEqual(\"USD\", currencyConversion.DestinationCurrency);\n        }\n\n        private static Security CreateSecurity(Symbol symbol)\n        {\n            var timezone = TimeZones.NewYork;\n\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                symbol,\n                Resolution.Hour,\n                timezone,\n                timezone,\n                true,\n                false,\n                false);\n\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(timezone),\n                config,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        /// <summary>\n        /// One leg Update() test cases.\n        /// sourceCurrency, destinationCurrency, symbol, expectedRate\n        /// expectedRate is the expected rate when the value of symbol is set to 10\n        /// </summary>\n        private static object[] oneLegCases =\n        {\n            // Not inverted\n            new object[] { \"BTC\", \"USD\", Symbols.BTCUSD, 10m },\n\n            // Inverted\n            new object[] { \"USD\", \"BTC\", Symbols.BTCUSD, 0.1m }\n        };\n\n        /// <summary>\n        /// Two leg Update() test cases:\n        /// sourceCurrency, destinationCurrency, symbol1, symbol2, expectedRate\n        /// expectedRate is the expected rate when the value of symbol1 is set to 15 and the value of symbol2 to 25\n        /// </summary>\n        private static object[] twoLegCases =\n        {\n            // Not inverted\n            new object[] { \"ETH\", \"USD\", Symbols.ETHBTC, Symbols.BTCUSD, 15m * 25m },\n\n            // First pair inverted\n            new object[] { \"USD\", \"BTC\", Symbols.ETHUSD, Symbols.ETHBTC, (1m / 15m) * 25m },\n\n            // Second pair inverted\n            new object[] { \"ETH\", \"BTC\", Symbols.ETHUSD, Symbols.BTCUSD, 15m * (1m / 25m) },\n\n            // Both pairs inverted\n            new object[] { \"USD\", \"ETH\", Symbols.BTCUSD, Symbols.ETHBTC, (1m / 15m) * (1m / 25m) }\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/DelayedSettlementModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class DelayedSettlementModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2015, 11, 2, 12, 0, 0);\n        private static readonly TimeKeeper TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n\n        [Test]\n        public void SellOnMondaySettleOnThursday()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            // settlement at T+3, 8:00 AM\n            var model = new DelayedSettlementModel(3, TimeSpan.FromHours(8));\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            portfolio.SetCash(3000);\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            // Sell on Monday\n            var timeUtc = Noon.ConvertToUtc(TimeZones.NewYork);\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Tuesday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Wednesday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Thursday at 7:55 AM, still unsettled\n            timeUtc = timeUtc.AddDays(1).AddHours(-4).AddMinutes(-5);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Thursday at 8 AM, now settled\n            timeUtc = timeUtc.AddMinutes(5);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(4000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n\n        [Test]\n        public void SellOnThursdaySettleOnTuesday()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            // settlement at T+3, 8:00 AM\n            var model = new DelayedSettlementModel(3, TimeSpan.FromHours(8));\n            var config = CreateTradeBarConfig(Symbols.SPY);\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            portfolio.SetCash(3000);\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            // Sell on Thursday\n            var timeUtc = Noon.AddDays(3).ConvertToUtc(TimeZones.NewYork);\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Friday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Saturday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Sunday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Monday, still unsettled\n            timeUtc = timeUtc.AddDays(1);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Tuesday at 7:55 AM, still unsettled\n            timeUtc = timeUtc.AddDays(1).AddHours(-4).AddMinutes(-5);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(3000, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Tuesday at 8 AM, now settled\n            timeUtc = timeUtc.AddMinutes(5);\n            model.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(4000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/DynamicSecurityDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class DynamicSecurityDataTests\n    {\n        private SecurityCache _cache;\n        private RegisteredSecurityDataTypesProvider _dataTypesProvider;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _cache = new SecurityCache();\n            _dataTypesProvider = new RegisteredSecurityDataTypesProvider();\n            _dataTypesProvider.RegisterType(typeof(TradeBar));\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _cache.Reset();\n        }\n\n        [Test]\n        public void StoreData_UsesTypeName_AsKey()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            }, typeof(TradeBar));\n\n            Assert.IsTrue(data.HasProperty(typeof(TradeBar).Name));\n\n            var arr = (IReadOnlyList<TradeBar>)data.GetProperty(typeof(TradeBar).Name);\n            Assert.AreEqual(1, arr.Count);\n            Assert.AreEqual(15, arr[0].Close);\n        }\n\n        [Test]\n        public void Get_UsesTypeName_AsKey_And_ReturnsLastItem()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar> {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 2, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 3, 10000)\n            }, typeof(TradeBar));\n\n            var item = data.Get<TradeBar>();\n            Assert.AreEqual(3, item.Close);\n        }\n\n        [Test]\n        public void GetAll_UsesTypeName_AsKey()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar> {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 2, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 3, 10000)\n            }, typeof(TradeBar));\n\n            var arr = data.GetAll<TradeBar>();\n            Assert.AreEqual(3, arr.Count);\n            Assert.AreEqual(1, arr[0].Close);\n        }\n\n        [Test]\n        public void AccessesDataDynamically()\n        {\n            var securityData = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar> {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 2, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 3, 10000)\n            }, typeof(TradeBar));\n\n            dynamic dynamicSecurityData = securityData;\n            var tradeBars = dynamicSecurityData.TradeBar;\n            Assert.IsInstanceOf<IReadOnlyList<TradeBar>>(tradeBars);\n        }\n\n        [Test]\n        public void DataCanNotBeSetDynamically()\n        {\n            var securityData = new DynamicSecurityData(_dataTypesProvider, _cache);\n            var data = new List<TradeBar> {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000)\n            };\n\n            dynamic dynamicSecurityData = securityData;\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                dynamicSecurityData.TradeBar = data;\n            });\n        }\n\n        [Test]\n        public void AccessingPropertyThatDoesNotExists_ThrowsKeyNotFoundException_WhenNotIncludedInRegisteredTypes()\n        {\n            var registeredTypes = new RegisteredSecurityDataTypesProvider();\n            dynamic securityData = new DynamicSecurityData(registeredTypes, _cache);\n\n            Assert.Throws<KeyNotFoundException>(() =>\n            {\n                var _ = securityData.NotFoundProperty;\n            });\n        }\n\n        [Test]\n        public void AccessPropertyThatDoesNotExists_ReturnsEmptyList_WhenTypeIsIncludedInRegisteredTypes()\n        {\n            var registeredTypes = new RegisteredSecurityDataTypesProvider();\n            registeredTypes.RegisterType(typeof(TradeBar));\n            dynamic securityData = new DynamicSecurityData(registeredTypes, _cache);\n\n            var tradeBars = securityData.TradeBar;\n            Assert.IsInstanceOf<List<TradeBar>>(tradeBars);\n            Assert.IsEmpty(tradeBars);\n        }\n\n        [Test]\n        public void Py_StoreData_GetProperty()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000)\n            }, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.GetProperty(\"\"TradeBar\"\")\n    if len(data) != 1:\n        raise Exception('Unexpected length')\n    if data[0].Close != 1:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(data));\n            }\n        }\n\n        [Test]\n        public void Py_StoreData_HasProperty()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000)\n            }, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.HasProperty(\"\"TradeBar\"\")\n    if not data:\n        raise Exception('Unexpected HasProperty result')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(data));\n            }\n        }\n\n        [Test]\n        public void Py_StoreData_Get_UsesTypeName()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000)\n            }, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.Get(TradeBar)\n    if data.Close != 1:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(data));\n            }\n        }\n\n        [Test]\n        public void Py_StoreData_GetAll_UsesTypeName()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000)\n            }, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.GetAll(TradeBar)\n    if len(data) != 1:\n        raise Exception('Unexpected length')\n    if data[0].Close != 1:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(data));\n            }\n        }\n\n        [Test]\n        public void Py_Get_UsesTypeName_AsKey_And_ReturnsLastItem()\n        {\n            var data = new DynamicSecurityData(_dataTypesProvider, _cache);\n            _cache.StoreData(new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 1, 10000),\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 3, 10000)\n            }, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.Get(TradeBar)\n    if data.Close != 3:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(data));\n            }\n        }\n\n        [Test]\n        public void Py_GetAll_TradeBar()\n        {\n            var securityData = new DynamicSecurityData(_dataTypesProvider, _cache);\n            var data = new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            };\n            _cache.StoreData(data, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.GetAll(TradeBar)\n    if data[0].Low != 5:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(securityData));\n            }\n        }\n\n        [Test]\n        public void Py_Get_TradeBar()\n        {\n            var securityData = new DynamicSecurityData(_dataTypesProvider, _cache);\n            var data = new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            };\n            _cache.StoreData(data, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.Get(TradeBar)\n    if data.Low != 5:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(securityData));\n            }\n        }\n\n        [Test]\n        public void Py_Get_TradeBarArray()\n        {\n            var securityData = new DynamicSecurityData(_dataTypesProvider, _cache);\n            var data = new[]\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            };\n            _cache.StoreData(data, typeof(TradeBar));\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.Get(TradeBar)\n    if data.Low != 5:\n        raise Exception('Unexpected value')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(securityData));\n            }\n        }\n\n        [Test]\n        public void Py_GetTypeThatDoesNotExists_ThrowsKeyNotFoundException_WhenNotIncludedInRegisteredTypes()\n        {\n            var registeredTypes = new RegisteredSecurityDataTypesProvider();\n            dynamic securityData = new DynamicSecurityData(registeredTypes, _cache);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.Get(TradeBar)\").GetAttr(\"Test\");\n\n                Assert.That(() => test(securityData),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<KeyNotFoundException>());\n            }\n        }\n\n        [Test]\n        public void Py_AccessPropertyThatDoesNotExists_ReturnsEmptyList_WhenTypeIsIncludedInRegisteredTypes()\n        {\n            var registeredTypes = new RegisteredSecurityDataTypesProvider();\n            registeredTypes.RegisterType(typeof(TradeBar));\n            dynamic securityData = new DynamicSecurityData(registeredTypes, _cache);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef Test(dynamicData):\n    data = dynamicData.GetAll(TradeBar)\n    if data is None:\n        raise Exception('Unexpected None value')\n    if len(data) != 0:\n        raise Exception('Unexpected length')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(securityData));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/ErrorCurrencyConverterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class ErrorCurrencyConverterTests\n    {\n        [Test]\n        public void AlwaysThrowsInvalidOperationException()\n        {\n            Assert.Throws<InvalidOperationException>(() => ErrorCurrencyConverter.Instance.ConvertToAccountCurrency(default(CashAmount)));\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Securities/FakeOrderProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    /// <summary>\n    /// Provides a fake implementation of <see cref=\"IOrderProcessor\"/> for tests\n    /// </summary>\n    public class FakeOrderProcessor : IOrderProcessor\n    {\n        private readonly ConcurrentDictionary<int, Order> _orders = new ConcurrentDictionary<int, Order>();\n        private readonly ConcurrentDictionary<int, OrderTicket> _tickets = new ConcurrentDictionary<int, OrderTicket>();\n        public ConcurrentDictionary<int, OrderRequest> ProcessedOrdersRequests { get; init; } = new ConcurrentDictionary<int, OrderRequest>();\n\n        public SecurityTransactionManager TransactionManager { get; set; }\n        public void AddOrder(Order order)\n        {\n            _orders[order.Id] = order;\n        }\n\n        public void AddTicket(OrderTicket ticket)\n        {\n            _tickets[ticket.OrderId] = ticket;\n        }\n        public int OrdersCount { get; private set; }\n        public Order GetOrderById(int orderId)\n        {\n            Order order;\n            _orders.TryGetValue(orderId, out order);\n            return order;\n        }\n\n        public List<Order> GetOrdersByBrokerageId(string brokerageId)\n        {\n            return _orders.Values.Where(x => x.BrokerId.Contains(brokerageId)).ToList();\n        }\n\n        public IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _tickets.Values.Where(filter ?? (x => true));\n        }\n\n        public IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null)\n        {\n            return _tickets.Values.Where(x => x.Status.IsOpen() && (filter == null || filter(x)));\n        }\n\n        public OrderTicket GetOrderTicket(int orderId)\n        {\n            OrderTicket ticket;\n            _tickets.TryGetValue(orderId, out ticket);\n            return ticket;\n        }\n\n        public IEnumerable<Order> GetOrders(Func<Order, bool> filter = null)\n        {\n            return _orders.Values.Where(filter ?? (x => true));\n        }\n\n        public List<Order> GetOpenOrders(Func<Order, bool> filter = null)\n        {\n            return _orders.Values.Where(x => x.Status.IsOpen() && (filter == null || filter(x))).ToList();\n        }\n\n        public OrderTicket Process(OrderRequest request)\n        {\n            OrderTicket ticket;\n            ProcessedOrdersRequests.TryAdd(request.OrderId, request);\n            switch (request.OrderRequestType)\n            {\n                case OrderRequestType.Submit:\n                    ticket = new OrderTicket(TransactionManager, (SubmitOrderRequest) request);\n                    AddTicket(ticket);\n                    return ticket;\n                case OrderRequestType.Cancel:\n                    ticket = GetOrderTicket(request.OrderId);\n                    ticket.TrySetCancelRequest((CancelOrderRequest)request);\n                    return ticket;\n                default:\n                    throw new NotImplementedException();\n            }\n        }\n\n        public void Clear()\n        {\n            _orders.Clear();\n            _tickets.Clear();\n            ProcessedOrdersRequests.Clear();\n        }\n\n        public ProjectedHoldings GetProjectedHoldings(Security security)\n        {\n            var openOrderQuantity = GetOpenOrderTickets(x => x.Symbol == security.Symbol)\n                .Aggregate(0m, (d, t) => d + t.QuantityRemaining);\n            return new ProjectedHoldings(security.Holdings.Quantity, openOrderQuantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Forex/ForexHoldingTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Forex;\n\nnamespace QuantConnect.Tests.Common.Securities.Forex\n{\n    [TestFixture]\n    public class ForexHoldingTests\n    {\n        [TestCase(\"EURUSD\", 1, 0.00001, 1000, 1.23456, 50, 10000)]\n        [TestCase(\"USDJPY\", 0.9, 0.001, 1000, 100.30, -40, 10000)]\n        [TestCase(\"EURGBP\", 1.1, 0.00001, 1000, 0.89012, 100, 10000)]\n        public void TotalProfitIsCorrectlyEstimated(string ticker, decimal conversionRate,\n                                                    decimal minimumPriceVariation,\n                                                    int lotSize, decimal entryPrice, decimal pips, int entryQuantity)\n        {\n            // Arrange\n            var timeKeeper = new TimeKeeper(DateTime.Now, TimeZones.NewYork);\n\n            var symbol = Symbol.Create(ticker, SecurityType.Forex, Market.FXCM);\n            var pairQuoteCurrency = symbol.Value.Substring(startIndex: 3);\n            var quoteCash = new Cash(pairQuoteCurrency,\n                amount: 100000,\n                conversionRate: conversionRate);\n            var baseCash = new Cash(symbol.Value.Substring(0, 3), 0, 0);\n            var subscription = new SubscriptionDataConfig(typeof(QuoteBar), symbol, Resolution.Daily,\n                                                          TimeZones.NewYork, TimeZones.NewYork, fillForward: true,\n                                                          extendedHours: true, isInternalFeed: true);\n\n            var pair = new QuantConnect.Securities.Forex.Forex(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                quoteCash,\n                baseCash,\n                subscription,\n                new SymbolProperties(\n                    \"\",\n                    pairQuoteCurrency,\n                    1,\n                    minimumPriceVariation,\n                    lotSize,\n                    string.Empty\n                ),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            pair.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            pair.SetFeeModel(new ConstantFeeModel(decimal.Zero));\n            var forexHolding = new ForexHolding(pair, new IdentityCurrencyConverter(Currencies.USD));\n            // Act\n            forexHolding.SetHoldings(entryPrice, entryQuantity);\n            var priceVariation = pips * 10 * minimumPriceVariation;\n            forexHolding.UpdateMarketPrice(entryPrice + priceVariation);\n            pair.SetMarketPrice(new Tick(DateTime.Now, pair.Symbol, forexHolding.Price, forexHolding.Price));\n            var actualPips = forexHolding.TotalCloseProfitPips();\n            // Assert\n            Assert.AreEqual(pips, actualPips);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Forex/ForexTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities.Forex\n{\n    [TestFixture]\n    public class ForexTests\n    {\n        [Test]\n        public void DecomposeThrowsOnSymbolTooShort()\n        {\n            string symbol = \"12345\";\n            Assert.AreEqual(5, symbol.Length);\n            string basec, quotec;\n            Assert.Throws<ArgumentException>(() =>\n            {\n                QuantConnect.Securities.Forex.Forex.DecomposeCurrencyPair(symbol, out basec, out quotec);\n            }, \"Currency pairs must be exactly 6 characters\");\n        }\n\n        [Test]\n        public void DecomposeThrowsOnSymbolTooLong()\n        {\n            string symbol = \"1234567\";\n            Assert.AreEqual(7, symbol.Length);\n            string basec, quotec;\n            Assert.Throws<ArgumentException>(() =>\n            {\n                QuantConnect.Securities.Forex.Forex.DecomposeCurrencyPair(symbol, out basec, out quotec);\n            }, \"Currency pairs must be exactly 6 characters\");\n        }\n\n        [Test]\n        public void DecomposeThrowsOnNullSymbol()\n        {\n            string symbol = null;\n            string basec, quotec;\n            Assert.Throws<ArgumentException>(() =>\n            {\n                QuantConnect.Securities.Forex.Forex.DecomposeCurrencyPair(symbol, out basec, out quotec);\n            }, \"Currency pairs must be exactly 6 characters\");\n        }\n\n        [Test]\n        public void ConstructorDecomposesBaseAndQuoteCurrencies()\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.EURUSD, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            var forex = new QuantConnect.Securities.Forex.Forex(SecurityExchangeHours.AlwaysOpen(config.DataTimeZone), new Cash(Currencies.USD, 0, 0), new Cash(Currencies.EUR, 0, 0), config, SymbolProperties.GetDefault(Currencies.USD), ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null);\n            Assert.AreEqual(\"EUR\", forex.BaseCurrency.Symbol);\n            Assert.AreEqual(Currencies.USD, forex.QuoteCurrency.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/FutureFilterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class FutureFilterTests\n    {\n        [Test]\n        public void FiltersExpiryRange()\n        {\n            var time = new DateTime(2016, 02, 26);\n\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe\n                    .Expiration(TimeSpan.FromDays(3), TimeSpan.FromDays(7));\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(0)), // 0\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(1)), // 1\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(2)), // 2\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(3)), // 3\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(4)), // 4\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(5)), // 5\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(6)), // 6\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(7)), // 7\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(8)), // 8\n                Symbol.CreateFuture(\"SPY\", Market.CME, time.AddDays(9)), // 9\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, time)).Select(x => x.Symbol).ToList();\n            Assert.AreEqual(5, filtered.Count);\n            Assert.AreEqual(symbols[3], filtered[0]);\n            Assert.AreEqual(symbols[4], filtered[1]);\n            Assert.AreEqual(symbols[5], filtered[2]);\n            Assert.AreEqual(symbols[6], filtered[3]);\n            Assert.AreEqual(symbols[7], filtered[4]);\n        }\n\n        [TestCase(false, 6)]\n        [TestCase(true, 2)]\n        public void FutureContractFiltering(bool standardsOnly, int expectedCount)\n        {\n            var time = new DateTime(2016, 02, 17, 13, 0, 0);\n\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe =>\n                standardsOnly ? universe.StandardsOnly() : universe;\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(0)), // Standard\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(1)),\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(2)),\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(8)),\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(16)),\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(28)), // Standard\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, time)).Select(x => x.Symbol).ToList();\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n\n            if (standardsOnly)\n            {\n                // When StandardsOnly, only Standards should be returned\n                Assert.AreEqual(symbols[0], filtered[0]);\n                Assert.AreEqual(symbols[5], filtered[1]);\n            }\n            else\n            {\n                // By default both Standards and Weeklys are returned\n                for (int i = 0; i < 6; i++)\n                {\n                    Assert.AreEqual(symbols[i], filtered[i]);\n                }\n            }\n        }\n\n        [Test]\n        public void WeeklysFilterDoesNotFilterStandardContractWithExpiryMonthPriorOrAfterContractMonth()\n        {\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe;\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"CL\", Market.NYMEX, new DateTime(2020, 11, 20)),\n                Symbol.CreateFuture(\"DC\", Market.CME, new DateTime(2021, 2, 2)),\n                Symbol.CreateFuture(\"HO\", Market.NYMEX, new DateTime(2020, 12, 31)),\n                Symbol.CreateFuture(\"DY\", Market.CME, new DateTime(2021, 2, 2)),\n                Symbol.CreateFuture(\"YO\", Market.NYMEX, new DateTime(2021, 4, 30)),\n                Symbol.CreateFuture(\"NG\", Market.NYMEX, new DateTime(2020, 11, 25))\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var standardContracts = filter.Filter(new FutureFilterUniverse(data, new DateTime(2020, 1, 1))).Select(x => x.Symbol).ToList();\n            Assert.AreEqual(6, standardContracts.Count);\n            Assert.AreEqual(symbols[0], standardContracts[0]);\n            Assert.AreEqual(symbols[1], standardContracts[1]);\n            Assert.AreEqual(symbols[2], standardContracts[2]);\n            Assert.AreEqual(symbols[3], standardContracts[3]);\n            Assert.AreEqual(symbols[4], standardContracts[4]);\n            Assert.AreEqual(symbols[5], standardContracts[5]);\n        }\n\n        [Test]\n        public void FilterAllowBothTypes()\n        {\n            var time = new DateTime(2016, 02, 17, 13, 0, 0);\n\n            // Include Weeklys to get both types of contracts through\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe.IncludeWeeklys();\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(0)), // 0 Standard!!\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(1)), // 1\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(2)), // 2\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(8)), // 8\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(16)), // 16\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(28)), // 28 Standard!!\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, time)).Select(x => x.Symbol).ToList();\n            Assert.AreEqual(6, filtered.Count);\n            Assert.AreEqual(symbols, filtered);\n        }\n\n        [Test]\n        public void FilterOutStandards()\n        {\n            var time = new DateTime(2016, 02, 17, 13, 0, 0);\n\n            // Weeklys only to drop standard contracts\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe.WeeklysOnly();\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(0)), // 0 Standard!!\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(1)), // 1\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(2)), // 2\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(8)), // 8\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(16)), // 16\n                Symbol.CreateFuture(\"VX\", Market.CFE, time.AddDays(28)), // 28 Standard!!\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, time)).Select(x => x.Symbol).ToList();\n            Assert.AreEqual(4, filtered.Count);\n            Assert.AreEqual(symbols[1], filtered[0]);\n            Assert.AreEqual(symbols[2], filtered[1]);\n            Assert.AreEqual(symbols[3], filtered[2]);\n            Assert.AreEqual(symbols[4], filtered[3]);\n        }\n\n        [Test]\n        public void FiltersFrontMonth()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16);\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe.FrontMonth();\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 0\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 1\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 2\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 3\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2),  // 4\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2), // 5\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry3), // 6\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry3), // 7\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 8\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 9\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, new DateTime(2016, 02, 26))).ToList();\n            Assert.AreEqual(4, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersBackMonth()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16);\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe.BackMonth();\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 0\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 1\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 2\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 3\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2),  // 4\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2), // 5\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2), // 6\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry3), // 7\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 8\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 9\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, new DateTime(2016, 02, 26))).ToList();\n            Assert.AreEqual(3, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersExpirationCycles()\n        {\n            var expiry1 = new DateTime(2016, 1, 02);\n            var expiry2 = new DateTime(2016, 3, 09);\n            var expiry3 = new DateTime(2016, 8, 16);\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe.ExpirationCycle(FutureExpirationCycles.March);\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 0\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 1\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 2\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry1),  // 3\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2),  // 4\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2), // 5\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry2), // 6\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry3), // 7\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 8\n                Symbol.CreateFuture(\"SPY\", Market.USA, expiry4), // 9\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            var filtered = filter.Filter(new FutureFilterUniverse(data, new DateTime(2016, 02, 26))).ToList();\n            Assert.AreEqual(5, filtered.Count);\n        }\n\n        [Test]\n        public void FilterTypeDoesNotBreakOnMissingExpiryFunction()\n        {\n            var time = new DateTime(2016, 02, 17, 13, 0, 0);\n            var underlying = new Tick { Value = 10m, Time = time };\n\n            // By Default only includes standards\n            Func<FutureFilterUniverse, FutureFilterUniverse> universeFunc = universe => universe;\n\n            Func<IDerivativeSecurityFilterUniverse<FutureUniverse>, IDerivativeSecurityFilterUniverse<FutureUniverse>> func =\n                universe => universeFunc(universe as FutureFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<FutureUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateFuture(\"VX\", Market.USA, time.AddDays(0)), // There is no Expiry function for VX on Market.USA\n            };\n            var data = symbols.Select(x => new FutureUniverse() { Symbol = x });\n\n            // Since this is a unidentifiable symbol for our expiry functions it will return true and be passed through\n            var filtered = filter.Filter(new FutureFilterUniverse(data, time)).Select(x => x.Symbol).ToList();\n            Assert.AreEqual(1, filtered.Count);\n            Assert.AreEqual(symbols[0], filtered[0]);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/FutureMarginBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class FutureMarginBuyingPowerModelTests\n    {\n        // Test class to enable calling protected methods\n        private FutureMarginModel _futureMarginModel;\n\n        [Test]\n        public void TestMarginForSymbolWithOneLinerHistory()\n        {\n            const decimal price = 1.2345m;\n            var time = new DateTime(2016, 1, 1);\n            var expDate = new DateTime(2017, 1, 1);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Softs.Coffee;\n            var symbol = Symbol.CreateFuture(ticker, Market.ICE, expDate);\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            futureSecurity.BuyingPowerModel = new FutureMarginModel(security: futureSecurity);\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, 1);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(tz));\n            futureSecurity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(tz));\n\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement, buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n        }\n\n        [Test]\n        public void TestMarginForSymbolWithNoHistory()\n        {\n            const decimal price = 1.2345m;\n            var time = new DateTime(2016, 1, 1);\n            var expDate = new DateTime(2017, 1, 1);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history at all\n            var ticker = \"NOT-A-SYMBOL\";\n            var symbol = Symbol.CreateFuture(ticker, Market.USA, expDate);\n\n            var futureSecurity = new Future(SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null);\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, 1);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(tz));\n            futureSecurity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(tz));\n\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel, timeKeeper: timeKeeper);\n            Assert.AreEqual(0m, buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n        }\n\n        [Test]\n        public void TestMarginForSymbolWithHistory()\n        {\n            const decimal price = 1.2345m;\n            var time = new DateTime(2013, 1, 1);\n            var expDate = new DateTime(2017, 1, 1);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have history\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var symbol = Symbol.CreateFuture(ticker, Market.CME, expDate);\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, 1);\n            futureSecurity.BuyingPowerModel = new FutureMarginModel(security: futureSecurity);\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(tz));\n            futureSecurity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(tz));\n\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel, timeKeeper: timeKeeper);\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement,\n                buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n\n            // now we move forward to exact date when margin req changed\n            time = new DateTime(2014, 06, 13);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(tz));\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement, buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n\n            // now we fly beyond the last line of the history file (currently) to see how margin model resolves future dates\n            time = new DateTime(2016, 06, 04);\n            timeKeeper.SetUtcDateTime(time.ConvertToUtc(tz));\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement, buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n        }\n\n        [TestCase(1)]\n        [TestCase(10)]\n        [TestCase(-1)]\n        [TestCase(-10)]\n        public void GetMaintenanceMargin(decimal quantity)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n\n            const decimal price = 1.2345m;\n            var time = new DateTime(2013, 1, 1);\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, quantity);\n\n            var res = buyingPowerModel.GetMaintenanceMargin(futureSecurity);\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement * futureSecurity.Holdings.AbsoluteQuantity, res);\n\n            // We increase the quantity * 2, maintenance margin should DOUBLE\n            futureSecurity.Holdings.SetHoldings(1.5m, quantity * 2);\n            res = buyingPowerModel.GetMaintenanceMargin(futureSecurity);\n            Assert.AreEqual(_futureMarginModel.MaintenanceOvernightMarginRequirement * futureSecurity.Holdings.AbsoluteQuantity, res);\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void GetInitialMarginRequirement(decimal quantity)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n\n            const decimal price = 1.2345m;\n            var time = new DateTime(2013, 1, 1);\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, quantity);\n\n            var initialMargin = buyingPowerModel.GetInitialMarginRequirement(futureSecurity, futureSecurity.Holdings.Quantity);\n            var overnightMargin = Math.Abs(buyingPowerModel.GetMaintenanceMargin(futureSecurity));\n\n            // initial margin is greater than the maintenance margin\n            Assert.Greater(Math.Abs(initialMargin), overnightMargin);\n        }\n\n        [TestCase(10)]\n        [TestCase(-10)]\n        public void GetInitialMarginRequiredForOrder(decimal quantity)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n\n            const decimal price = 1.2345m;\n            var time = new DateTime(2013, 1, 1);\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.SetMarketPrice(new Tick { Value = price, Time = time });\n            futureSecurity.Holdings.SetHoldings(1.5m, quantity);\n\n            var initialMargin = buyingPowerModel.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(algorithm.Portfolio.CashBook,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantity, algorithm.UtcTime))).Value;\n\n            var initialMarginExpected = buyingPowerModel.GetInitialMarginRequirement(futureSecurity, quantity);\n\n            Assert.AreEqual(initialMarginExpected\n                            + 24.70m * Math.Sign(quantity), // fees -> 10 quantity * 2.47\n                initialMargin);\n        }\n\n        [TestCase(100)]\n        [TestCase(-100)]\n        public void MarginUsedForPositionWhenPriceDrops(decimal quantity)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.Holdings.SetHoldings(20, quantity);\n            Update(futureSecurity, 20, algorithm);\n\n            var marginForPosition = buyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(futureSecurity)).AbsoluteUsedBuyingPower;\n\n            // Drop 40% price from $20 to $12\n            Update(futureSecurity, 12, algorithm);\n\n            var marginForPositionAfter = buyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(futureSecurity)).AbsoluteUsedBuyingPower;\n\n            Assert.AreEqual(marginForPosition, marginForPositionAfter);\n        }\n\n        [TestCase(100)]\n        [TestCase(-100)]\n        public void MarginUsedForPositionWhenPriceIncreases(decimal quantity)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var buyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.Holdings.SetHoldings(20, quantity);\n            Update(futureSecurity, 20, algorithm);\n\n            var marginForPosition = buyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(futureSecurity)).AbsoluteUsedBuyingPower;\n\n            // Increase from $20 to $40\n            Update(futureSecurity, 40, algorithm);\n\n            var marginForPositionAfter = buyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(futureSecurity)).AbsoluteUsedBuyingPower;\n\n            Assert.AreEqual(marginForPosition, marginForPositionAfter);\n        }\n\n        [Test]\n        public void PortfolioStatusForPositionWhenPriceDrops()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            futureSecurity.BuyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.Holdings.SetHoldings(20, 100);\n            Update(futureSecurity, 20, algorithm);\n\n            var marginUsed = algorithm.Portfolio.TotalMarginUsed;\n            Assert.IsTrue(marginUsed > 0);\n            Assert.IsTrue(algorithm.Portfolio.TotalPortfolioValue > 0);\n            Assert.IsTrue(algorithm.Portfolio.MarginRemaining > 0);\n\n            // Drop 40% price from $20 to $12\n            Update(futureSecurity, 12, algorithm);\n\n            var expected = (12 - 20) * 100 * futureSecurity.SymbolProperties.ContractMultiplier - 2.47m * 100;\n            Assert.AreEqual(futureSecurity.Holdings.UnrealizedProfit, expected);\n\n            // we have a massive loss because of futures leverage\n            Assert.IsTrue(algorithm.Portfolio.TotalPortfolioValue < 0);\n            Assert.IsTrue(algorithm.Portfolio.MarginRemaining < 0);\n\n            // margin used didn't change because for futures it relies on the maintenance margin\n            Assert.AreEqual(marginUsed, algorithm.Portfolio.TotalMarginUsed);\n        }\n\n        [Test]\n        public void PortfolioStatusPositionWhenPriceIncreases()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            futureSecurity.BuyingPowerModel = GetModel(futureSecurity, out _futureMarginModel);\n            futureSecurity.Holdings.SetHoldings(20, 100);\n            Update(futureSecurity, 20, algorithm);\n\n            var marginUsed = algorithm.Portfolio.TotalMarginUsed;\n            Assert.IsTrue(marginUsed > 0);\n            Assert.IsTrue(algorithm.Portfolio.TotalPortfolioValue > 0);\n            Assert.IsTrue(algorithm.Portfolio.MarginRemaining > 0);\n\n            // Increase from $20 to $40\n            Update(futureSecurity, 40, algorithm);\n\n            var expected = (40 - 20) * 100 * futureSecurity.SymbolProperties.ContractMultiplier - 2.47m * 100;\n            Assert.AreEqual(futureSecurity.Holdings.UnrealizedProfit, expected);\n\n            // we have a massive win because of futures leverage\n            Assert.IsTrue(algorithm.Portfolio.TotalPortfolioValue > 0);\n            Assert.IsTrue(algorithm.Portfolio.MarginRemaining > 0);\n\n            // margin used didn't change because for futures it relies on the maintenance margin\n            Assert.AreEqual(marginUsed, algorithm.Portfolio.TotalMarginUsed);\n        }\n\n        [Test]\n        public void GetLeverage()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            Update(futureSecurity, 100, algorithm);\n            var leverage = futureSecurity.BuyingPowerModel.GetLeverage(futureSecurity);\n\n            Assert.AreEqual(1, leverage);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        public void SetLeverageThrowsException(int leverage)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n\n            Assert.Throws<InvalidOperationException>(() => futureSecurity.BuyingPowerModel.SetLeverage(futureSecurity, leverage));\n        }\n\n        [Test]\n        public void MarginRequirementsChangeWithDate()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var model = futureSecurity.BuyingPowerModel as FutureMarginModel;\n\n            Update(futureSecurity, 100, algorithm, new DateTime(2001, 01, 07));\n            var initial = model.InitialOvernightMarginRequirement;\n            var maintenance = model.MaintenanceOvernightMarginRequirement;\n            Assert.AreEqual(810, initial);\n            Assert.AreEqual(600, maintenance);\n\n            // date previous to margin change\n            Update(futureSecurity, 100, algorithm, new DateTime(2001, 12, 10));\n            Assert.AreEqual(810, initial);\n            Assert.AreEqual(600, maintenance);\n\n            // new margins!\n            Update(futureSecurity, 100, algorithm, new DateTime(2001, 12, 11));\n            Assert.AreEqual(945, model.InitialOvernightMarginRequirement);\n            Assert.AreEqual(700, model.MaintenanceOvernightMarginRequirement);\n        }\n\n        [TestCase(-1.1)]\n        [TestCase(1.1)]\n        public void GetMaximumOrderQuantityForTargetBuyingPower_ThrowsForInvalidTarget(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n\n            Assert.Throws<InvalidOperationException>(() => futureSecurity.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(\n                new GetMaximumOrderQuantityForTargetBuyingPowerParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    target,\n                    0)));\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(-1)]\n        [TestCase(-0.5)]\n        public void GetMaximumOrderQuantityForTargetBuyingPower_NoHoldings(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            Update(futureSecurity, 100, algorithm);\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n\n            // set closed market for simpler math\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n\n            var expected = (algorithm.Portfolio.TotalPortfolioValue * Math.Abs(target)) / _futureMarginModel.InitialOvernightMarginRequirement - 1 * Math.Abs(target); // -1 fees\n            expected -= expected % futureSecurity.SymbolProperties.LotSize;\n\n            Assert.AreEqual(expected * Math.Sign(target), quantity);\n\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, expected, DateTime.UtcNow))).IsSufficient);\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void HasSufficientBuyingPowerForOrderInvalidTargets(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            // set closed market for simpler math\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n            Update(futureSecurity, 100, algorithm);\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            var result = model.HasSufficientBuyingPowerForOrder(new HasSufficientBuyingPowerForOrderParameters(\n                    algorithm.Portfolio,\n                    futureSecurity,\n                    // we get the maximum target value 1/-1 and add a lot size it shouldn't be a valid order\n                    new MarketOrder(futureSecurity.Symbol, quantity + futureSecurity.SymbolProperties.LotSize * Math.Sign(quantity), DateTime.UtcNow)));\n\n            Assert.IsFalse(result.IsSufficient);\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void GetMaximumOrderQuantityForTargetBuyingPower_TwoStep(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            futureSecurity.BuyingPowerModel = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n            // set closed market for simpler math\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n            Update(futureSecurity, 100, algorithm);\n            var expectedFinalQuantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target / 2);\n            futureSecurity.Holdings.SetHoldings(100, quantity);\n            algorithm.Portfolio.InvalidateTotalPortfolioValue();\n\n            var quantity2 = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity2);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(futureSecurity.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantity2, DateTime.UtcNow))).IsSufficient);\n\n            // two step operation is the same as 1 step\n            Assert.AreEqual(expectedFinalQuantity, quantity + quantity2);\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(-1)]\n        [TestCase(-0.5)]\n        public void GetMaximumOrderQuantityForTargetBuyingPower_WithHoldingsSameDirection(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            // set closed market for simpler math\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n            futureSecurity.Holdings.SetHoldings(100, 10 * Math.Sign(target));\n            Update(futureSecurity, 100, algorithm);\n\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n\n            var expected = (algorithm.Portfolio.TotalPortfolioValue * Math.Abs(target) - Math.Abs(model.GetInitialMarginRequirement(futureSecurity, futureSecurity.Holdings.Quantity)))\n                           / _futureMarginModel.InitialOvernightMarginRequirement - 1 * Math.Abs(target); // -1 fees\n            expected -= expected % futureSecurity.SymbolProperties.LotSize;\n            Log.Trace($\"Expected {expected}\");\n\n            Assert.AreEqual(expected * Math.Sign(target), quantity);\n\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, expected * Math.Sign(target), DateTime.UtcNow))).IsSufficient);\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(-1)]\n        [TestCase(-0.5)]\n        public void GetMaximumOrderQuantityForTargetBuyingPower_WithHoldingsInverseDirection(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            // set closed market for simpler math\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n            futureSecurity.Holdings.SetHoldings(100, 10 * -1 * Math.Sign(target));\n            Update(futureSecurity, 100, algorithm);\n\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n            futureSecurity.BuyingPowerModel = _futureMarginModel;\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n\n            var expected = (algorithm.Portfolio.TotalPortfolioValue * Math.Abs(target) + Math.Abs(model.GetInitialMarginRequirement(futureSecurity, futureSecurity.Holdings.Quantity)))\n                           / _futureMarginModel.InitialOvernightMarginRequirement - 1 * Math.Abs(target); // -1 fees\n            expected -= expected % futureSecurity.SymbolProperties.LotSize;\n            Log.Trace($\"Expected {expected}\");\n\n            Assert.AreEqual(expected * Math.Sign(target), quantity);\n\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, expected * Math.Sign(target), DateTime.UtcNow))).IsSufficient);\n        }\n\n        [TestCase(1)]\n        [TestCase(0.5)]\n        [TestCase(-1)]\n        [TestCase(-0.5)]\n        public void IntradayVersusOvernightMargins(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker);\n            var lotSize = futureSecurity.SymbolProperties.LotSize;\n            Update(futureSecurity, 100, algorithm);\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n            // Close market\n            var localTimeKeeper = new LocalTimeKeeper(new DateTime(2020, 2, 1), TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n\n            var quantityClosedMarket = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n            Assert.AreEqual(quantityClosedMarket.DiscretelyRoundBy(lotSize), quantityClosedMarket,\n                \"Calculated order quantity was not whole number multiple of the lot size\"\n            );\n            var request = GetOrderRequest(futureSecurity.Symbol, quantityClosedMarket);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantityClosedMarket, DateTime.UtcNow))).IsSufficient);\n\n            var initialOvernight = _futureMarginModel.InitialOvernightMarginRequirement;\n            var maintenanceOvernight = _futureMarginModel.MaintenanceOvernightMarginRequirement;\n\n            // Open market\n            localTimeKeeper.UpdateTime(new DateTime(2020, 2, 3));\n\n            var fourtyPercentQuantity = (quantityClosedMarket * 0.4m).DiscretelyRoundBy(lotSize);\n            futureSecurity.Holdings.SetHoldings(100, fourtyPercentQuantity);\n\n            var halfQuantity = (quantityClosedMarket / 2).DiscretelyRoundBy(lotSize);\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, halfQuantity, DateTime.UtcNow))).IsSufficient);\n\n            Assert.Greater(initialOvernight, _futureMarginModel.InitialIntradayMarginRequirement);\n            Assert.Greater(maintenanceOvernight, _futureMarginModel.MaintenanceIntradayMarginRequirement);\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void ClosingSoonIntradayClosedMarketMargins(decimal target)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var orderProcessor = new FakeOrderProcessor();\n            algorithm.Transactions.SetOrderProcessor(orderProcessor);\n\n            var ticker = QuantConnect.Securities.Futures.Financials.EuroDollar;\n            var futureSecurity = algorithm.AddFuture(ticker, extendedMarketHours: true);\n            Update(futureSecurity, 100, algorithm);\n            var localTime = new DateTime(2020, 2, 3);\n            var utcTime = localTime.ConvertToUtc(futureSecurity.Exchange.TimeZone);\n            var timeKeeper = new TimeKeeper(utcTime, futureSecurity.Exchange.TimeZone);\n            var model = GetModel(futureSecurity, out _futureMarginModel, algorithm.Portfolio);\n            // this is important\n            _futureMarginModel.EnableIntradayMargins = true;\n\n            // Open market at 10am\n            var localTimeKeeper = timeKeeper.GetLocalTimeKeeper(TimeZones.Utc);\n            futureSecurity.Exchange.SetLocalDateTimeFrontierProvider(localTimeKeeper);\n            localTimeKeeper.UpdateTime(localTime.AddHours(10));\n\n            var quantity = algorithm.CalculateOrderQuantity(futureSecurity.Symbol, target);\n            var request = GetOrderRequest(futureSecurity.Symbol, quantity);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(algorithm.Transactions, request));\n\n            Assert.IsTrue(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantity, DateTime.UtcNow))).IsSufficient);\n\n            // Closing soon market\n            localTimeKeeper.UpdateTime(new DateTime(2020, 2, 3, 15,50, 0));\n\n            Assert.IsFalse(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantity, DateTime.UtcNow))).IsSufficient);\n            Assert.IsTrue(futureSecurity.Exchange.ExchangeOpen);\n            Assert.IsTrue(futureSecurity.Exchange.ClosingSoon);\n\n            // Close market\n            localTimeKeeper.UpdateTime(new DateTime(2020, 2, 1));\n            Assert.IsFalse(futureSecurity.Exchange.ExchangeOpen);\n\n            Assert.IsFalse(model.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algorithm.Portfolio,\n                    futureSecurity,\n                    new MarketOrder(futureSecurity.Symbol, quantity, DateTime.UtcNow))).IsSufficient);\n        }\n\n        [TestCase(Market.CME)]\n        [TestCase(Market.ICE)]\n        [TestCase(Market.CBOT)]\n        [TestCase(Market.CFE)]\n        [TestCase(Market.COMEX)]\n        [TestCase(Market.NYMEX)]\n        [TestCase(Market.Globex)]\n        public void FutureMarginModel_MarginEntriesValid(string market)\n        {\n            var marginsDirectory = new DirectoryInfo(Path.Combine(Globals.DataFolder, \"future\", market, \"margins\"));\n            var minimumDate = new DateTime(1990, 1, 1);\n\n            if (!marginsDirectory.Exists)\n            {\n                return;\n            }\n            foreach (var marginFile in marginsDirectory.GetFiles(\"*.csv\", SearchOption.TopDirectoryOnly))\n            {\n                var lineNumber = 0;\n                var errorMessageTemplate = $\"Error encountered in file {marginFile.Name} on line \";\n                var csv = File.ReadLines(marginFile.FullName).Where(x => !x.StartsWithInvariant(\"#\") && !string.IsNullOrWhiteSpace(x)).Skip(1).Select(x =>\n                {\n                    lineNumber++;\n\n                    var data = x.Split(',');\n\n                    if (data.Length < 3)\n                    {\n                        var errorMessage = errorMessageTemplate + lineNumber.ToStringInvariant();\n                        Assert.Fail(errorMessage);\n                    }\n\n                    DateTime date;\n                    decimal initial;\n                    decimal maintenance;\n\n                    var dateValid = Parse.TryParseExact(data[0], DateFormat.EightCharacter, DateTimeStyles.None, out date);\n                    var initialValid = Parse.TryParse(data[1], NumberStyles.Any, out initial);\n                    var maintenanceValid = Parse.TryParse(data[2], NumberStyles.Any, out maintenance);\n\n                    if (!dateValid || !initialValid || !maintenanceValid)\n                    {\n                        var errorMessage = errorMessageTemplate + lineNumber.ToStringInvariant();\n                        Assert.Fail(errorMessage);\n                    }\n\n                    return new Tuple<DateTime, decimal, decimal>(date, initial, maintenance);\n                });\n\n                lineNumber = 0;\n                foreach (var line in csv)\n                {\n                    lineNumber++;\n                    var dateInvalid = $\"Date is less than 1998-01-01 in {marginFile.Name} on line {lineNumber}\";\n                    var initialInvalid = $\"Initial is <= 0 in {marginFile.Name} on line {lineNumber}\";\n                    var maintenanceInvalid = $\"Maintenance is <= 0 in {marginFile.Name} on line {lineNumber}\";\n\n                    Assert.GreaterOrEqual(line.Item1, minimumDate, dateInvalid);\n                    Assert.Greater(line.Item2, 0m, initialInvalid);\n                    Assert.Greater(line.Item3, 0m, maintenanceInvalid);\n                }\n            }\n        }\n\n        [TestCase(Market.CME)]\n        [TestCase(Market.ICE)]\n        [TestCase(Market.CBOT)]\n        [TestCase(Market.CFE)]\n        [TestCase(Market.COMEX)]\n        [TestCase(Market.NYMEX)]\n        [TestCase(Market.Globex)]\n        public void FutureMarginModel_MarginEntriesHaveIncrementingDates(string market)\n        {\n            var marginsDirectory = new DirectoryInfo(Path.Combine(Globals.DataFolder, \"future\", market, \"margins\"));\n\n            if (!marginsDirectory.Exists)\n            {\n                return;\n            }\n            foreach (var marginFile in marginsDirectory.GetFiles(\"*.csv\", SearchOption.TopDirectoryOnly))\n            {\n                var csv = File.ReadLines(marginFile.FullName).Where(x => !x.StartsWithInvariant(\"#\") && !string.IsNullOrWhiteSpace(x)).Skip(1).Select(x =>\n                {\n                    var data = x.Split(',');\n                    DateTime date;\n                    Parse.TryParseExact(data[0], DateFormat.EightCharacter, DateTimeStyles.None, out date);\n                    var initial = Parse.Decimal(data[1]);\n                    var maintenance = Parse.Decimal(data[2]);\n\n                    return new Tuple<DateTime, decimal, decimal>(date, initial, maintenance);\n                });\n\n                var previous = DateTime.MinValue;\n\n                foreach (var line in csv)\n                {\n                    Assert.Greater(line.Item1, previous, marginFile.Name);\n                    previous = line.Item1;\n                }\n            }\n        }\n\n        [TestCase(Market.CME)]\n        [TestCase(Market.ICE)]\n        [TestCase(Market.CBOT)]\n        [TestCase(Market.CFE)]\n        [TestCase(Market.COMEX)]\n        //[TestCase(Market.NYMEX)] NYMEX contracts can have volatile margin requirements, since some are tied to a percentage of the contract's value.\n        [TestCase(Market.Globex)]\n        public void FutureMarginModel_MarginEntriesAreContinuous(string market)\n        {\n            var marginsDirectory = new DirectoryInfo(Path.Combine(Globals.DataFolder, \"future\", market, \"margins\"));\n            if (!marginsDirectory.Exists)\n            {\n                return;\n            }\n            var exclusions = new Dictionary<string, int>\n            {\n                { \"6E.csv\", 1 },\n                { \"6S.csv\", 2 },\n                { \"A8K.csv\", 1 },\n                { \"AJY.csv\", 1 },\n                { \"ANL.csv\", 2 },\n                { \"AUP.csv\", 46 },\n                { \"CB.csv\", 20 },\n                { \"CSC.csv\", 30 },\n                { \"DC.csv\", 50 },\n                { \"DY.csv\", 30 },\n                { \"EH.csv\", 1 },\n                { \"EVC.csv\", 1 },\n                { \"EWG.csv\", 1 },\n                { \"EWN.csv\", 2 },\n                { \"FRC.csv\", 1 },\n                { \"GDK.csv\", 30 },\n                { \"GE.csv\", 20 },\n                { \"GF.csv\", 2 },\n                { \"GNF.csv\", 10 },\n                { \"HO.csv\", 1 },\n                { \"ME.csv\", 1 },\n                { \"MSF.csv\", 1 },\n                { \"NKN.csv\", 2 },\n                { \"PL.csv\", 1 },\n                { \"RB.csv\", 1 },\n                { \"ZC.csv\", 2 },\n                { \"ZM.csv\", 1 },\n                { \"ZW.csv\", 2 }\n            };\n\n            var lines = new List<string>();\n            foreach (var marginFile in marginsDirectory.GetFiles(\"*.csv\", SearchOption.TopDirectoryOnly))\n            {\n                var greaterMessage = $\"A jump less than -80% was encountered in {marginFile.Name}\";\n                var lessMessage = $\"A jump greater than +80% was encountered in {marginFile.Name}\";\n                var maxExclusions = exclusions.ContainsKey(marginFile.Name) ? exclusions[marginFile.Name] : 0;\n\n                var csv = File.ReadLines(marginFile.FullName).Where(x => !x.StartsWithInvariant(\"#\") && !string.IsNullOrWhiteSpace(x)).Skip(1).Select(x =>\n                {\n                    var data = x.Split(',');\n                    DateTime date;\n                    Parse.TryParseExact(data[0], DateFormat.EightCharacter, DateTimeStyles.None, out date);\n                    var initial = Parse.Decimal(data[1]);\n                    var maintenance = Parse.Decimal(data[2]);\n\n                    return new Tuple<DateTime, decimal, decimal>(date, initial, maintenance);\n                }).ToList();\n\n                var errorsEncountered = 0;\n                for (var i = 1; i < csv.Count; i++)\n                {\n                    var previous = csv[i - 1].Item2;\n                    var current = csv[i].Item2;\n                    var percentChange = (current - previous) / previous;\n                    var lessThan = percentChange < -0.8m;\n                    var greaterThan = percentChange > 0.8m;\n\n                    if (lessThan || greaterThan)\n                    {\n                        errorsEncountered++;\n                        if (errorsEncountered > maxExclusions)\n                        {\n                            Assert.Fail(lessThan ? lessMessage : greaterMessage);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Market.CME)]\n        [TestCase(Market.ICE)]\n        [TestCase(Market.CBOT)]\n        [TestCase(Market.CFE)]\n        [TestCase(Market.COMEX)]\n        [TestCase(Market.NYMEX)]\n        [TestCase(Market.Globex)]\n        public void FutureMarginModel_InitialMarginGreaterThanMaintenance(string market)\n        {\n            var marginsDirectory = new DirectoryInfo(Path.Combine(Globals.DataFolder, \"future\", market, \"margins\"));\n\n            if (!marginsDirectory.Exists)\n            {\n                return;\n            }\n            foreach (var marginFile in marginsDirectory.GetFiles(\"*.csv\", SearchOption.TopDirectoryOnly))\n            {\n                var errorMessage = $\"Initial value greater than maintenance value in {marginFile.Name}\";\n                var csv = File.ReadLines(marginFile.FullName).Where(x => !x.StartsWithInvariant(\"#\") && !string.IsNullOrWhiteSpace(x)).Skip(1).Select(x =>\n                {\n                    var data = x.Split(',');\n                    DateTime date;\n                    Parse.TryParseExact(data[0], DateFormat.EightCharacter, DateTimeStyles.None, out date);\n                    var initial = Parse.Decimal(data[1]);\n                    var maintenance = Parse.Decimal(data[2]);\n\n                    return new Tuple<DateTime, decimal, decimal>(date, initial, maintenance);\n                });\n\n                // Having an initial margin equal to the maintenance is a valid case.\n                // Using '>' and not '>=' here is intentional.\n                Assert.IsFalse(csv.Where(x => x.Item3 > x.Item2).Any(), errorMessage);\n            }\n        }\n\n        private static void Update(Security security, decimal close, QCAlgorithm algorithm, DateTime? time = null)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = time ?? new DateTime(2020, 5, 1),\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n            algorithm.Portfolio.InvalidateTotalPortfolioValue();\n        }\n\n        private static SubmitOrderRequest GetOrderRequest(Symbol symbol, decimal quantity)\n        {\n            return new SubmitOrderRequest(OrderType.Market,\n                SecurityType.Future,\n                symbol,\n                quantity,\n                1,\n                1,\n                DateTime.UtcNow,\n                \"\");\n        }\n\n        private static IBuyingPowerModel GetModel(\n            Security security,\n            out FutureMarginModel futureMarginModel,\n            SecurityPortfolioManager portfolio = null,\n            TimeKeeper timeKeeper = null\n            )\n        {\n            futureMarginModel = security.BuyingPowerModel as FutureMarginModel;\n            return new BuyingPowerModelComparator(futureMarginModel,\n                new SecurityPositionGroupBuyingPowerModel(), portfolio, timeKeeper\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/FutureOption/FuturesOptionsExpiryFunctionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\n\nnamespace QuantConnect.Tests.Common.Securities.FutureOption\n{\n    [TestFixture]\n    public class FuturesOptionsExpiryFunctionsTests\n    {\n        [TestCase(\"ES\", Market.CME, 0)]\n        [TestCase(\"ZB\", Market.CBOT, 1)]\n        [TestCase(\"ZN\", Market.CBOT, 1)]\n        [TestCase(\"CL\", Market.NYMEX, 1)]\n        [TestCase(\"GC\", Market.COMEX, 1)] // No mapping is done for this Symbol as expected, although rules exist.\n        public void FutureContractMonthDelta(string futureTicker, string market, int expectedDelta)\n        {\n            var contractMonth = new DateTime(2020, 12, 1);\n\n            var future = Symbol.Create(futureTicker, SecurityType.Future, market);\n            var option = Symbol.CreateOption(\n                future,\n                market,\n                default(OptionStyle),\n                default(OptionRight),\n                default(decimal),\n                SecurityIdentifier.DefaultDate);\n\n            var futureOptionExpiry = FuturesOptionsExpiryFunctions.FuturesOptionExpiry(option, contractMonth);\n            Assert.AreEqual(expectedDelta, contractMonth.Month - futureOptionExpiry.Month);\n        }\n\n        [TestCaseSource(nameof(ExpiryTestCases))]\n        public void ExpiryFunctionsReturnExpectedResults(string futureTicker, string market, DateTime expected)\n        {\n            var future = Symbol.Create(futureTicker, SecurityType.Future, market);\n            var futureOption = Symbol.CreateCanonicalOption(future);\n\n            var december = new DateTime(2020, 12, 1);\n            var actual = FuturesOptionsExpiryFunctions.FuturesOptionExpiry(futureOption, december);\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [TestCase(\"ZM\", Market.CBOT, \"202601\", \"20251226\", \"20260114\")]\n        [TestCase(\"ZM\", Market.CBOT, \"202512\", \"20251121\", \"20251212\")]\n        [TestCase(\"ZM\", Market.CBOT, \"202511\", \"20251024\", \"20251212\")]\n        [TestCase(\"ZL\", Market.CBOT, \"202601\", \"20251226\", \"20260114\")]\n        [TestCase(\"ZL\", Market.CBOT, \"202512\", \"20251121\", \"20251212\")]\n        [TestCase(\"ZL\", Market.CBOT, \"202511\", \"20251024\", \"20251212\")]\n        [TestCase(\"TN\", Market.CBOT, \"202601\", \"20251226\", \"20260320\")]\n        [TestCase(\"TN\", Market.CBOT, \"202512\", \"20251121\", \"20251219\")]\n        [TestCase(\"TN\", Market.CBOT, \"202511\", \"20251024\", \"20251219\")]\n        [TestCase(\"UB\", Market.CBOT, \"202601\", \"20251226\", \"20260320\")]\n        [TestCase(\"UB\", Market.CBOT, \"202512\", \"20251121\", \"20251219\")]\n        [TestCase(\"UB\", Market.CBOT, \"202511\", \"20251024\", \"20251219\")]\n        [TestCase(\"ZO\", Market.CBOT, \"202603\", \"20260220\", \"20260313\")]\n        [TestCase(\"ZO\", Market.CBOT, \"202512\", \"20251121\", \"20251212\")]\n        [TestCase(\"ZO\", Market.CBOT, \"202511\", \"20251024\", \"20251212\")]\n        [TestCase(\"KE\", Market.CBOT, \"202512\", \"20251121\", \"20251212\")]\n        [TestCase(\"KE\", Market.CBOT, \"202511\", \"20251024\", \"20251212\")]\n        [TestCase(\"KE\", Market.CBOT, \"202601\", \"20251226\", \"20260313\")]\n        [TestCase(\"ZF\", Market.CBOT, \"202512\", \"20251121\", \"20251231\")]\n        [TestCase(\"ZF\", Market.CBOT, \"202511\", \"20251024\", \"20251231\")]\n        [TestCase(\"ZF\", Market.CBOT, \"202601\", \"20251226\", \"20260331\")]\n        [TestCase(\"LE\", Market.CME, \"202612\", \"20261204\", \"20261231\")]\n        [TestCase(\"LE\", Market.CME, \"202702\", \"20270205\", \"20270226\")]\n        [TestCase(\"LE\", Market.CME, \"202510\", \"20251003\", \"20251031\")]\n        [TestCase(\"LE\", Market.CME, \"202511\", \"20251107\", \"20251231\")]\n        [TestCase(\"HE\", Market.CME, \"202512\", \"20251212\", \"20251212\")]\n        [TestCase(\"HE\", Market.CME, \"202511\", \"20251114\", \"20251212\")]\n        [TestCase(\"HE\", Market.CME, \"202510\", \"20251014\", \"20251014\")]\n        [TestCase(\"LBR\", Market.CME, \"202510\", \"20250930\", \"20251114\")]\n        [TestCase(\"LBR\", Market.CME, \"202511\", \"20251031\", \"20251114\")]\n        [TestCase(\"LBR\", Market.CME, \"202603\", \"20260227\", \"20260313\")]\n        [TestCase(\"LBS\", Market.CME, \"202510\", \"20250930\", \"20251114\")]\n        [TestCase(\"LBS\", Market.CME, \"202511\", \"20251031\", \"20251114\")]\n        [TestCase(\"LBS\", Market.CME, \"202603\", \"20260227\", \"20260313\")]\n        [TestCase(\"NQ\", Market.CME, \"202512\", \"20251219\", \"20251219\")]\n        [TestCase(\"NQ\", Market.CME, \"202603\", \"20260320\", \"20260320\")]\n        [TestCase(\"EMD\", Market.CME, \"202512\", \"20251219\", \"20251219\")]\n        [TestCase(\"EMD\", Market.CME, \"202603\", \"20260320\", \"20260320\")]\n        [TestCase(\"ES\", Market.CME, \"202512\", \"20251219\", \"20251219\")]\n        [TestCase(\"ES\", Market.CME, \"202603\", \"20260320\", \"20260320\")]\n        [TestCase(\"ES\", Market.CME, \"201601\", \"20160115\", \"20160318\")]\n        [TestCase(\"YM\", Market.CBOT, \"202512\", \"20251219\", \"20251219\")]\n        [TestCase(\"YM\", Market.CBOT, \"202603\", \"20260320\", \"20260320\")]\n        [TestCase(\"6N\", Market.CME, \"202511\", \"20251107\", \"20251215\")]\n        [TestCase(\"6N\", Market.CME, \"202512\", \"20251205\", \"20251215\")]\n        [TestCase(\"6N\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6N\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6N\", Market.CME, \"202602\", \"20260206\", \"20260316\")]\n        [TestCase(\"6N\", Market.CME, \"202604\", \"20260403\", \"20260615\")]\n        [TestCase(\"6B\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6B\", Market.CME, \"202602\", \"20260206\", \"20260316\")]\n        [TestCase(\"6B\", Market.CME, \"202603\", \"20260306\", \"20260316\")]\n        [TestCase(\"6C\", Market.CME, \"202601\", \"20260109\", \"20260317\")]\n        [TestCase(\"6C\", Market.CME, \"202602\", \"20260206\", \"20260317\")]\n        [TestCase(\"6C\", Market.CME, \"202603\", \"20260306\", \"20260317\")]\n        [TestCase(\"6J\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6J\", Market.CME, \"202602\", \"20260206\", \"20260316\")]\n        [TestCase(\"6J\", Market.CME, \"202603\", \"20260306\", \"20260316\")]\n        [TestCase(\"6S\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6S\", Market.CME, \"202602\", \"20260206\", \"20260316\")]\n        [TestCase(\"6S\", Market.CME, \"202603\", \"20260306\", \"20260316\")]\n        [TestCase(\"6E\", Market.CME, \"202601\", \"20260109\", \"20260316\")]\n        [TestCase(\"6E\", Market.CME, \"202602\", \"20260206\", \"20260316\")]\n        [TestCase(\"6E\", Market.CME, \"202603\", \"20260306\", \"20260316\")]\n        [TestCase(\"6M\", Market.CME, \"202604\", \"20260403\", \"20260615\")]\n        [TestCase(\"6M\", Market.CME, \"202605\", \"20260508\", \"20260615\")]\n        [TestCase(\"6M\", Market.CME, \"202606\", \"20260605\", \"20260615\")]\n        [TestCase(\"6A\", Market.CME, \"202601\", \"20260109\", \"20260316\", Description = \"Quarterly contract : Mar\")]\n        [TestCase(\"6A\", Market.CME, \"202602\", \"20260206\", \"20260316\", Description = \"Quarterly contract : Mar\")]\n        [TestCase(\"6A\", Market.CME, \"202603\", \"20260306\", \"20260316\", Description = \"Quarterly contract : Mar\")]\n        [TestCase(\"6A\", Market.CME, \"202604\", \"20260403\", \"20260615\", Description = \"Quarterly contract : Jun\")]\n        [TestCase(\"6A\", Market.CME, \"202605\", \"20260508\", \"20260615\", Description = \"Quarterly contract : Jun\")]\n        [TestCase(\"6A\", Market.CME, \"202606\", \"20260605\", \"20260615\", Description = \"Quarterly contract : Jun\")]\n        public void FutureAndOptionMapping(string futureTicker, string market, string fopContractMonthYear, string expectedFop, string expectedFuture)\n        {\n            var contractMonth = DateTime.ParseExact(fopContractMonthYear, DateFormat.YearMonth, CultureInfo.InvariantCulture);\n\n            var fopExpiry = Time.ParseDate(expectedFop);\n            var referenceDate = new DateTime(fopExpiry.Year, fopExpiry.Month, 1);\n            var canonicalFuture = Symbol.Create(futureTicker, SecurityType.Future, market);\n            var canonicalFutureOption = Symbol.CreateOption(\n                canonicalFuture,\n                market,\n                default,\n                default,\n                default,\n                SecurityIdentifier.DefaultDate);\n            var futureOptionExpiry = FuturesOptionsExpiryFunctions.FuturesOptionExpiry(canonicalFutureOption, contractMonth);\n            Assert.AreEqual(fopExpiry, futureOptionExpiry.Date);\n\n            var underlyingFuture = FuturesOptionsUnderlyingMapper.GetUnderlyingFutureFromFutureOption(canonicalFutureOption.ID.Symbol, market, futureOptionExpiry, referenceDate);\n\n            Assert.AreEqual(Time.ParseDate(expectedFuture), underlyingFuture.ID.Date.Date);\n        }\n\n        [Test]\n        public void ExpiryFunctionsReturnExpectedResultWhenExpiryIsAHoliday()\n        {\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var entry = mhdb.GetEntry(Market.CME, \"6A\", SecurityType.Future);\n            var holidays = entry.ExchangeHours.Holidays;\n            holidays.Add(new DateTime(2025, 07, 04));\n            var exchangeHours = new SecurityExchangeHours(entry.ExchangeHours.TimeZone,\n                holidays,\n                entry.ExchangeHours.MarketHours.ToDictionary(),\n                entry.ExchangeHours.EarlyCloses,\n                entry.ExchangeHours.LateOpens);\n            mhdb.SetEntry(Market.CME, \"6A\", SecurityType.Future, exchangeHours, entry.DataTimeZone);\n\n            var future = Symbol.Create(\"6A\", SecurityType.Future, Market.CME);\n            var futureOption = Symbol.CreateCanonicalOption(future);\n\n            var july = new DateTime(2025, 07, 1);\n            var actual = FuturesOptionsExpiryFunctions.FuturesOptionExpiry(futureOption, july);\n\n            // The second Friday before the third Wednesday of July is the 4th of July, which is a holiday\n            var expected = new DateTime(2025, 07, 03, 9, 0, 0);\n            Assert.AreEqual(expected, actual);\n        }\n\n        private static object[] ExpiryTestCases =\n        {\n            new TestCaseData(\"CL\", Market.NYMEX, new DateTime(2020, 11, 17)),\n            new TestCaseData(\"ZB\", Market.CBOT, new DateTime(2020, 11, 20)),\n            new TestCaseData(\"ZN\", Market.CBOT, new DateTime(2020, 11, 20)),\n            new TestCaseData(\"GC\", Market.COMEX, new DateTime(2020, 11, 24, 12, 30, 0)),\n            new TestCaseData(\"6A\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n            new TestCaseData(\"6B\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n            new TestCaseData(\"6C\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n            new TestCaseData(\"6E\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n            new TestCaseData(\"6J\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n            new TestCaseData(\"6S\", Market.CME, new DateTime(2020, 12, 04, 09, 0, 0)),\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/FutureOption/FuturesOptionsUnderlyingMapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.FutureOption;\n\nnamespace QuantConnect.Tests.Common.Securities.FutureOption\n{\n    public class FuturesOptionsUnderlyingMapperTests\n    {\n        [TestCase(\"ES\", Market.CME, 2021, 3, 19, 2021, 3, 19, false)]\n        [TestCase(\"NQ\", Market.CME, 2021, 3, 19, 2021, 3, 19, false)]\n        [TestCase(\"CL\", Market.NYMEX, 2021, 1, 14, 2021, 1, 20, false)]\n        [TestCase(\"RB\", Market.NYMEX, 2021, 1, 29, 2021, 1, 29, false)]\n        [TestCase(\"HO\", Market.NYMEX, 2021, 1, 29, 2021, 1, 29, false)]\n        [TestCase(\"NG\", Market.NYMEX, 2021, 1, 26, 2021, 1, 27, false)]\n        [TestCase(\"HG\", Market.COMEX, 2021, 2, 23, 2021, 3, 29, false)]\n        [TestCase(\"SI\", Market.COMEX, 2021, 2, 23, 2021, 3, 29, false)]\n        [TestCase(\"GC\", Market.COMEX, 2021, 1, 26, 2021, 2, 24, false)]\n        [TestCase(\"ZC\", Market.CBOT, 2021, 2, 19, 2021, 3, 12, false)]\n        [TestCase(\"ZN\", Market.CBOT, 2021, 2, 19, 2021, 3, 22, false)]\n        [TestCase(\"ZS\", Market.CBOT, 2021, 2, 19, 2021, 3, 12, false)]\n        [TestCase(\"ZW\", Market.CBOT, 2021, 2, 19, 2021, 3, 12, false)]\n        [TestCase(\"6A\", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]\n        [TestCase(\"6A\", Market.CME, 2021, 10, 05, 2021, 12, 13, false)]\n        [TestCase(\"6A\", Market.CME, 2021, 11, 05, 2021, 12, 13, false)]\n        [TestCase(\"6A\", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]\n        [TestCase(\"6N\", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]\n        [TestCase(\"6B\", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]\n        [TestCase(\"6B\", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]\n        [TestCase(\"6B\", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]\n        [TestCase(\"6C\", Market.CME, 2021, 01, 09, 2021, 03, 16, false)]\n        [TestCase(\"6C\", Market.CME, 2021, 09, 05, 2021, 09, 14, false)]\n        [TestCase(\"6C\", Market.CME, 2021, 12, 05, 2021, 12, 14, false)]\n        [TestCase(\"6E\", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]\n        [TestCase(\"6E\", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]\n        [TestCase(\"6E\", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]\n        [TestCase(\"6M\", Market.CME, 2021, 04, 03, 2021, 06, 14, false)]\n        [TestCase(\"6J\", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]\n        [TestCase(\"6J\", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]\n        [TestCase(\"6J\", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]\n        [TestCase(\"6S\", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]\n        [TestCase(\"6S\", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]\n        [TestCase(\"6S\", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]\n        [TestCase(\"ZC\", Market.CBOT, 2031, 12, 26, 2031, 12, 26, true)]\n        [TestCase(\"ZS\", Market.CBOT, 2034, 12, 22, 2034, 12, 22, true)]\n        [TestCase(\"ZW\", Market.CBOT, 2036, 12, 26, 2036, 12, 26, true)]\n        public void GetUnderlyingSymbolFromFutureOption(string futureTicker, string market,\n            int fopContractYear, int fopContractMonth, int fopContractDay,\n            int expectedFutureYear, int expectedFutureMonth, int expectedFutureDay,\n            bool nullExpected)\n        {\n            var optionTicker = FuturesOptionsSymbolMappings.Map(futureTicker);\n            var expectedFuture = Symbol.CreateFuture(futureTicker, market, new DateTime(expectedFutureYear, expectedFutureMonth, expectedFutureDay));\n            var futuresOptionsExpiration = new DateTime(fopContractYear, fopContractMonth, fopContractDay);\n\n            var actualFuture = FuturesOptionsUnderlyingMapper.GetUnderlyingFutureFromFutureOption(optionTicker, market, futuresOptionsExpiration, new DateTime(2021, 1, 1));\n\n            if (nullExpected)\n            {\n                // There were no futures that appeared on the or subsequent contract months from the future option.\n                Assert.IsNull(actualFuture);\n            }\n            else\n            {\n                Assert.AreEqual(expectedFuture, actualFuture, $\"Expected {expectedFuture.ID.Date} but got {actualFuture.ID.Date}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/FutureOptionMarginBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class FutureOptionMarginBuyingPowerModelTests\n    {\n        [Test]\n        public void MarginWithNoFutureOptionHoldings()\n        {\n            const decimal price = 2300m;\n            var time = new DateTime(2020, 10, 14);\n            var expDate = new DateTime(2021, 3, 19);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n            var future = Symbol.CreateFuture(ticker, Market.CME, expDate);\n            var symbol = Symbol.CreateOption(future, Market.CME, OptionStyle.American, OptionRight.Call, 2550m, new DateTime(2021, 3, 19));\n\n            var optionSecurity = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = price, Time = time });\n            optionSecurity.Underlying.Holdings.SetHoldings(1.5m, 1);\n\n            var futureBuyingPowerModel = new FutureMarginModel(security: optionSecurity.Underlying);\n            var futureOptionBuyingPowerModel = new FuturesOptionsMarginModel(futureOption: optionSecurity);\n\n            // we don't hold FOPs!\n            Assert.AreEqual(0m, futureOptionBuyingPowerModel.GetMaintenanceMargin(optionSecurity));\n            Assert.AreNotEqual(0m, futureBuyingPowerModel.GetMaintenanceMargin(optionSecurity.Underlying));\n\n            Assert.AreNotEqual(0m, futureOptionBuyingPowerModel.GetInitialMarginRequirement(optionSecurity, 10));\n        }\n\n        [Test]\n        public void MarginWithFutureAndFutureOptionHoldings()\n        {\n            const decimal price = 2300m;\n            var time = new DateTime(2020, 10, 14);\n            var expDate = new DateTime(2021, 3, 19);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n            var future = Symbol.CreateFuture(ticker, Market.CME, expDate);\n            var symbol = Symbol.CreateOption(future, Market.CME, OptionStyle.American, OptionRight.Call, 2550m,\n                new DateTime(2021, 3, 19));\n\n            var optionSecurity = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick {Value = price, Time = time});\n            optionSecurity.Holdings.SetHoldings(1.5m, 1);\n            optionSecurity.Underlying.Holdings.SetHoldings(1.5m, 1);\n\n            var futureOptionBuyingPowerModel = new FuturesOptionsMarginModel(futureOption: optionSecurity);\n\n            Assert.AreNotEqual(0m, futureOptionBuyingPowerModel.GetMaintenanceMargin(optionSecurity));\n        }\n\n        [Test]\n        public void MarginWithFutureOptionHoldings()\n        {\n            const decimal price = 2300m;\n            var time = new DateTime(2020, 10, 14);\n            var expDate = new DateTime(2021, 3, 19);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n            var future = Symbol.CreateFuture(ticker, Market.CME, expDate);\n            var symbol = Symbol.CreateOption(future, Market.CME, OptionStyle.American, OptionRight.Call, 2550m,\n                new DateTime(2021, 3, 19));\n\n            var optionSecurity = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = price, Time = time });\n            optionSecurity.Holdings.SetHoldings(1.5m, 1);\n\n            var futureBuyingPowerModel = new FutureMarginModel(security: optionSecurity.Underlying);\n            var futureOptionBuyingPowerModel = new FuturesOptionsMarginModel(futureOption: optionSecurity);\n\n            Assert.AreNotEqual(0m, futureOptionBuyingPowerModel.GetMaintenanceMargin(optionSecurity));\n            Assert.AreEqual(0, futureBuyingPowerModel.GetMaintenanceMargin(optionSecurity.Underlying));\n        }\n\n        [Test]\n        public void OptionExerciseWhenFullyInvested()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetFinishedWarmingUp();\n            var backtestingTransactionHandler = new BacktestingTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algorithm);\n            algorithm.Transactions.SetOrderProcessor(backtestingTransactionHandler);\n            backtestingTransactionHandler.Initialize(algorithm, brokerage, new TestResultHandler());\n\n            try\n            {\n                const decimal price = 2600m;\n                var time = new DateTime(2020, 10, 14);\n                var expDate = new DateTime(2021, 3, 19);\n\n                // For this symbol we dont have any history, but only one date and margins line\n                var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n                var future = Symbol.CreateFuture(ticker, Market.CME, expDate);\n                var symbol = Symbol.CreateOption(future, Market.CME, OptionStyle.American, OptionRight.Call, 2550m,\n                    new DateTime(2021, 3, 19));\n\n                var optionSecurity = algorithm.AddOptionContract(symbol);\n                optionSecurity.Underlying = algorithm.AddFutureContract(future);\n\n                optionSecurity.Underlying.SetMarketPrice(new Tick { Value = price, Time = time });\n                optionSecurity.SetMarketPrice(new Tick { Value = 150, Time = time });\n                optionSecurity.Holdings.SetHoldings(1.5m, 10);\n\n                algorithm.SetDateTime(time.AddHours(14)); // 10am\n                var ticket = algorithm.ExerciseOption(optionSecurity.Symbol, 10, true);\n                // Process orders\n                backtestingTransactionHandler.ProcessSynchronousEvents();\n                Assert.AreEqual(OrderStatus.Filled, ticket.Status);\n            }\n            finally\n            {\n                backtestingTransactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void MarginRequirementsAreSetCorrectly()\n        {\n            var expDate = new DateTime(2021, 3, 19);\n            var tz = TimeZones.NewYork;\n\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n            var future = Symbol.CreateFuture(ticker, Market.CME, expDate);\n            var symbol = Symbol.CreateOption(future, Market.CME, OptionStyle.American, OptionRight.Call, 2550m,\n                new DateTime(2021, 3, 19));\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var optionSecurity = new QuantConnect.Securities.FutureOption.FutureOption(symbol,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                futureSecurity\n            );\n\n            var futureMarginModel = new FuturesOptionsMarginModel(futureOption: optionSecurity);\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = 1500, Time = new DateTime(2001, 01, 07) });\n\n            var initialIntradayMarginRequirement = futureMarginModel.InitialIntradayMarginRequirement;\n            var maintenanceIntradayMarginRequirement = futureMarginModel.MaintenanceIntradayMarginRequirement;\n\n            var initialOvernightMarginRequirement = futureMarginModel.MaintenanceOvernightMarginRequirement;\n            var maintenanceOvernightMarginRequirement = futureMarginModel.InitialOvernightMarginRequirement;\n\n            Assert.AreNotEqual(0, initialIntradayMarginRequirement);\n            Assert.AreNotEqual(0, maintenanceIntradayMarginRequirement);\n            Assert.AreNotEqual(0, initialOvernightMarginRequirement);\n            Assert.AreNotEqual(0, maintenanceOvernightMarginRequirement);\n        }\n\n        // Long Call initial\n        [TestCase(10, 70000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(23.5, 69000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(30.5, 68000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(55, 50000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(66, 30000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(72, 17000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(87, 3700, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(108.5, 1000, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(125, 570, OptionRight.Call, PositionSide.Long, 59375)]\n        [TestCase(1000, 0, OptionRight.Call, PositionSide.Long, 59375)]\n\n        // Long Call maintenance\n        [TestCase(10, 56000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(23.5, 55000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(30.5, 54000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(55, 40000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(66, 24000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(72, 14000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(87, 3600, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(108.5, 1000, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(125, 540, OptionRight.Call, PositionSide.Long, 47500)]\n        [TestCase(1000, 0, OptionRight.Call, PositionSide.Long, 47500)]\n\n        // Short Call initial\n        [TestCase(10, 59400, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(23.5, 59680, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(30.5, 59750, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(55, 56712, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(66, 48134, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(72, 43492, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(87, 28960, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(108.5, 11373, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(125, 3900, OptionRight.Call, PositionSide.Short, 59375)]\n        [TestCase(1000, 0, OptionRight.Call, PositionSide.Short, 59375)]\n\n        // Long Put initial\n        [TestCase(10, 45, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(18, 171, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(26.5, 537, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(37.5, 1920, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(47.5, 6653, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(69.5, 48637, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(83, 59201, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(108, 60000, OptionRight.Put, PositionSide.Long, 59375)]\n        [TestCase(152, 59475, OptionRight.Put, PositionSide.Long, 59375)]\n\n        // Long Put maintenance\n        [TestCase(10, 45, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(18, 171, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(26.5, 537, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(37.5, 1920, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(47.5, 6653, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(69.5, 38910, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(83, 47361, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(108, 48000, OptionRight.Put, PositionSide.Long, 47500)]\n        [TestCase(152, 47580, OptionRight.Put, PositionSide.Long, 47500)]\n\n        // Short Put initial\n        [TestCase(10, 23729, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(18, 33859, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(26.5, 40000, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(37.5, 52714, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(47.5, 58414, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(69.5, 72647, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(83, 73160, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(108, 71782, OptionRight.Put, PositionSide.Short, 59375)]\n        [TestCase(152, 70637, OptionRight.Put, PositionSide.Short, 59375)]\n        public void MarginRequirementCrudeOil(decimal strike, double expected, OptionRight optionRight, PositionSide positionSide, decimal underlyingRequirement)\n        {\n            var tz = TimeZones.NewYork;\n            var expDate = new DateTime(2021, 3, 19);\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Energy.CrudeOilWTI;\n            var future = Symbol.CreateFuture(ticker, Market.NYMEX, expDate);\n            var symbol = Symbol.CreateOption(future, Market.NYMEX, OptionStyle.American, optionRight, strike,\n                new DateTime(2021, 3, 19));\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var optionSecurity = new QuantConnect.Securities.FutureOption.FutureOption(symbol,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                futureSecurity\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = 60, Time = new DateTime(2001, 01, 07) });\n            var marginRequirement = FuturesOptionsMarginModel.GetMarginRequirement(optionSecurity, underlyingRequirement, positionSide);\n\n            Log.Debug($\"Side {positionSide}. Right {optionRight}. Strike {strike}. Margin: {marginRequirement}\");\n            Assert.AreEqual(expected, marginRequirement, (double)underlyingRequirement * 0.30d);\n        }\n\n        // Long Call initial\n        [TestCase(1300, 154000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(1755, 97000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(1805, 84000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(1900, 55000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(2040, 24000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(2100, 16000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(2295, 5000, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(3000, 740, OptionRight.Call, PositionSide.Long, 112729)]\n        [TestCase(4000, 180, OptionRight.Call, PositionSide.Long, 112729)]\n        public void MarginRequirementGold(decimal strike, double expected, OptionRight optionRight, PositionSide positionSide, decimal underlyingRequirement)\n        {\n            var tz = TimeZones.NewYork;\n            var expDate = new DateTime(2021, 3, 19);\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Metals.Gold;\n            var future = Symbol.CreateFuture(ticker, Market.COMEX, expDate);\n            var symbol = Symbol.CreateOption(future, Market.COMEX, OptionStyle.American, optionRight, strike,\n                new DateTime(2021, 3, 19));\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var optionSecurity = new QuantConnect.Securities.FutureOption.FutureOption(symbol,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                futureSecurity\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = 1887, Time = new DateTime(2001, 01, 07) });\n            var marginRequirement = FuturesOptionsMarginModel.GetMarginRequirement(optionSecurity, underlyingRequirement, positionSide);\n\n            Log.Debug($\"Side {positionSide}. Right {optionRight}. Strike {strike}. Margin: {marginRequirement}\");\n            Assert.AreEqual(expected, marginRequirement, (double)underlyingRequirement * 0.30d);\n        }\n\n        // Long Call initial\n        [TestCase(2200, 16456, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(3200, 15582, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(3500, 14775, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(3570, 14310, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(4190, 7128, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(4370, 4089, OptionRight.Call, PositionSide.Long, 15632)]\n        [TestCase(4900, 233, OptionRight.Call, PositionSide.Long, 15632)]\n\n        // Short Call initial\n        [TestCase(2200, 17069, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(3200, 16716, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(3500, 16409, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(3570, 16222, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(4190, 14429, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(4370, 13003, OptionRight.Call, PositionSide.Short, 15632)]\n        [TestCase(4900, 6528, OptionRight.Call, PositionSide.Short, 15632)]\n        public void MarginRequirementEs(decimal strike, double expected, OptionRight optionRight, PositionSide positionSide, decimal underlyingRequirement)\n        {\n            var tz = TimeZones.NewYork;\n            var expDate = new DateTime(2021, 3, 19);\n            // For this symbol we dont have any history, but only one date and margins line\n            var ticker = QuantConnect.Securities.Futures.Indices.SP500EMini;\n            var future = Symbol.CreateFuture(ticker, Market.Globex, expDate);\n            var symbol = Symbol.CreateOption(future, Market.Globex, OptionStyle.American, optionRight, strike,\n                new DateTime(2021, 3, 19));\n\n            var futureSecurity = new Future(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), future, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var optionSecurity = new QuantConnect.Securities.FutureOption.FutureOption(symbol,\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                futureSecurity\n            );\n            optionSecurity.Underlying.SetMarketPrice(new Tick { Value = 4172, Time = new DateTime(2001, 01, 07) });\n            var marginRequirement = FuturesOptionsMarginModel.GetMarginRequirement(optionSecurity, underlyingRequirement, positionSide);\n\n            Log.Debug($\"Side {positionSide}. Right {optionRight}. Strike {strike}. Margin: {marginRequirement}\");\n            Assert.AreEqual(expected, marginRequirement, (double)underlyingRequirement * 0.30d);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Futures/FutureSettlementModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Tests.Common.Securities.Futures\n{\n    [TestFixture]\n    public class FutureSettlementModelTests\n    {\n        private static readonly DateTime Noon = new(2014, 6, 24, 12, 0, 0);\n        private static readonly TimeKeeper TimeKeeper = new(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n\n        private Future _future;\n        private LocalTimeKeeper _timeKeeper;\n        private FutureSettlementModel _model;\n        private FutureHolding _futureHoldings;\n        private SecurityPortfolioManager _portfolio;\n\n        [SetUp]\n        public void Setup()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            _portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            _model = new FutureSettlementModel();\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(Symbols.Fut_SPY_Feb19_2016.ID.Market, Symbols.Fut_SPY_Feb19_2016, SecurityType.Future);\n            _future = new Future(Symbols.Fut_SPY_Feb19_2016,\n                entry.ExchangeHours,\n                _portfolio.CashBook[Currencies.USD],\n                SymbolProperties.GetDefault(Currencies.USD),\n                _portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new FutureCache());\n            _future.FeeModel = new ConstantFeeModel(0);\n            _future.SettlementModel = _model;\n            _futureHoldings = (FutureHolding)_future.Holdings;\n            securities.Add(_future);\n            _timeKeeper = new LocalTimeKeeper(Noon, entry.ExchangeHours.TimeZone);\n            _future.SetLocalTimeKeeper(_timeKeeper);\n        }\n\n        [TestCase(1400, 10, 1300, 1200)]\n        [TestCase(1400, -10, 1300, 1200)]\n        [TestCase(1300, 10, 1400, 1500)]\n        [TestCase(1300, -10, 1400, 1500)]\n        [TestCase(1400, 10, 1300, 1500)]\n        [TestCase(1400, -10, 1300, 1500)]\n        [TestCase(1300, 10, 1400, 1200)]\n        [TestCase(1300, -10, 1400, 1200)]\n        public void DailySettlement(decimal averagePrice, decimal quantity, decimal futurePriceStep1, decimal futurePriceStep2)\n        {\n            _future.Holdings.SetHoldings(averagePrice, quantity);\n            SetPrice(_future, futurePriceStep1);\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            var expectedTpv = _portfolio.TotalPortfolioValue;\n            var startCash = _portfolio.CashBook[Currencies.USD].Amount;\n            Assert.AreEqual(0, _futureHoldings.SettledProfit);\n\n            // advance time\n            _timeKeeper.UpdateTime(_timeKeeper.LocalTime.AddDays(1));\n            _model.Scan(new ScanSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(_portfolio.TotalPortfolioValue, expectedTpv);\n            var expectedCash = startCash + _future.Holdings.UnrealizedProfit;\n            Assert.AreEqual(expectedCash, _portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreEqual(_future.Holdings.UnrealizedProfit, _futureHoldings.SettledProfit);\n            Assert.AreEqual(0, _futureHoldings.UnsettledProfit);\n\n            // we call it again, nothing should change\n            SetPrice(_future, futurePriceStep2);\n            _portfolio.InvalidateTotalPortfolioValue();\n            _model.Scan(new ScanSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime));\n\n            // price movement does affect TPV not cash\n            expectedTpv = expectedTpv + (futurePriceStep2 - futurePriceStep1) * quantity;\n            Assert.AreEqual(expectedTpv, _portfolio.TotalPortfolioValue);\n            Assert.AreEqual(expectedCash, _portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreNotEqual(0, _futureHoldings.UnsettledProfit);\n\n            // advance time\n            _timeKeeper.UpdateTime(_timeKeeper.LocalTime.AddDays(1));\n            _model.Scan(new ScanSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(expectedTpv, _portfolio.TotalPortfolioValue);\n            Assert.AreEqual(startCash + _future.Holdings.UnrealizedProfit, _portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreEqual(_future.Holdings.UnrealizedProfit, _futureHoldings.SettledProfit);\n            Assert.AreEqual(0, _futureHoldings.UnsettledProfit);\n        }\n\n        [TestCase(1400, 10, 1300, 0)]\n        [TestCase(1400, -10, 1300, 0)]\n        [TestCase(1300, 10, 1400, 0)]\n        [TestCase(1300, -10, 1400, 0)]\n        [TestCase(1400, 10, 1300, 1)]\n        [TestCase(1400, -10, 1300, 1)]\n        [TestCase(1300, 10, 1400, 1)]\n        [TestCase(1300, -10, 1400, 1)]\n        [TestCase(1400, 10, 1300, -1)]\n        [TestCase(1400, -10, 1300, -1)]\n        [TestCase(1300, 10, 1400, -1)]\n        [TestCase(1300, -10, 1400, -1)]\n        [TestCase(1400, 10, 1300, -20)]\n        [TestCase(1300, 10, 1400, -20)]\n        [TestCase(1400, -10, 1300, 20)]\n        [TestCase(1300, -10, 1400, 20)]\n        public void HoldingsQuantityChange(decimal averagePrice, decimal quantity, decimal futurePrice, decimal newQuantity)\n        {\n            _future.Holdings.SetHoldings(averagePrice, quantity);\n            SetPrice(_future, futurePrice);\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            var expectedTpv = _portfolio.TotalPortfolioValue;\n            var startCash = _portfolio.CashBook[Currencies.USD].Amount;\n            // advance time\n            _timeKeeper.UpdateTime(_timeKeeper.LocalTime.AddDays(1));\n            _model.Scan(new ScanSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            var expectedSettledCash = _future.Holdings.UnrealizedProfit;\n            var expectedCash = startCash + expectedSettledCash;\n            Assert.AreEqual(_portfolio.TotalPortfolioValue, expectedTpv);\n            Assert.AreEqual(expectedCash, _portfolio.CashBook[Currencies.USD].Amount);\n\n            // we change the holdings quantity\n            var fillPrice = futurePrice * 0.9m;\n            var fillQuantity = -(quantity - newQuantity);\n            var absoluteQuantityClosed = Math.Min(Math.Abs(fillQuantity), _future.Holdings.AbsoluteQuantity);\n            var closedQuantity = Math.Sign(-fillQuantity) * absoluteQuantityClosed;\n\n            // let's get the profit/loss if we closed our position, which we will sum later on since it already has the right profit/loss sign\n            Assert.AreEqual(Math.Sign(closedQuantity), Math.Sign(quantity));\n            var funds = new CashAmount(_future.Holdings.TotalCloseProfit(includeFees: false, exitPrice: fillPrice, _future.Holdings.AveragePrice, closedQuantity), Currencies.USD);\n            var fill = new OrderEvent(1, _future.Symbol, _timeKeeper.LocalTime, OrderStatus.Filled, Extensions.GetOrderDirection(fillQuantity), fillPrice, fillQuantity, OrderFee.Zero);\n            _future.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime.ConvertToUtc(_timeKeeper.TimeZone), funds, fill));\n\n            // if we change side the cash adjustment will go to 0, until we scan again\n            var settledProfit = 0m;\n            expectedCash = startCash + funds.Amount;\n            if (Math.Sign(newQuantity) == Math.Sign(quantity))\n            {\n                // if we increase the position the cash adjustment will remain the same, until we scan again\n                if (newQuantity < 0 && newQuantity < quantity)\n                {\n                    settledProfit = expectedSettledCash;\n                }\n                else if (newQuantity > 0 && newQuantity > quantity)\n                {\n                    settledProfit = expectedSettledCash;\n                }\n                else\n                {\n                    // we reduced the position\n                    settledProfit = expectedSettledCash * (newQuantity / quantity);\n                    expectedCash = startCash + funds.Amount + settledProfit;\n                }\n            }\n\n            var futureHoldings = (FutureHolding)_future.Holdings;\n            Assert.AreEqual(settledProfit, futureHoldings.SettledProfit);\n            Assert.AreEqual(expectedCash, _portfolio.CashBook[Currencies.USD].Amount);\n        }\n\n        [TestCase(10, 10, -10, -10)]\n        [TestCase(10, 10, -5, -15)]\n        [TestCase(5, 15, -5, -15)]\n        public void DifferentAveragePrice(decimal fillQuantityA, decimal fillQuantityB, decimal fillQuantityC, decimal fillQuantityD)\n        {\n            var startTpv = _portfolio.TotalPortfolioValue;\n            var startCash = _portfolio.CashBook[Currencies.USD].Amount;\n\n            var initialAveragePrice = 1400;\n            var futureSettlementPrice = 1450;\n            var secondAveragePrice = initialAveragePrice * 1.5m;\n\n            var exitFillPrice = futureSettlementPrice * 0.9m;\n\n            SetPrice(_future, futureSettlementPrice);\n            _future.PortfolioModel.ProcessFill(_portfolio, _future, new OrderEvent(1, _future.Symbol, _timeKeeper.LocalTime, OrderStatus.Filled, Extensions.GetOrderDirection(fillQuantityA), initialAveragePrice, fillQuantityA, OrderFee.Zero));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            var profit = _future.Holdings.TotalCloseProfit(includeFees: false, exitPrice: _future.Price, _future.Holdings.AveragePrice, _future.Holdings.Quantity);\n            Assert.AreEqual(0, _futureHoldings.SettledProfit);\n            Assert.AreEqual(profit, _futureHoldings.UnsettledProfit);\n\n            // advance time\n            _timeKeeper.UpdateTime(_timeKeeper.LocalTime.AddDays(1));\n            _model.Scan(new ScanSettlementModelParameters(_portfolio, _future, _timeKeeper.LocalTime));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(profit, _futureHoldings.SettledProfit);\n            Assert.AreEqual(0, _futureHoldings.UnsettledProfit);\n\n            // we double our position with a different average price, after we scan\n            _future.PortfolioModel.ProcessFill(_portfolio, _future, new OrderEvent(2, _future.Symbol, _timeKeeper.LocalTime, OrderStatus.Filled, Extensions.GetOrderDirection(fillQuantityB), secondAveragePrice, fillQuantityB, OrderFee.Zero));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            // let's get the profit/loss if we closed our position, which we will sum later on since it already has the right profit/loss sign\n            var averagePrice = _futureHoldings.AveragePrice;\n            _future.PortfolioModel.ProcessFill(_portfolio, _future, new OrderEvent(3, _future.Symbol, _timeKeeper.LocalTime, OrderStatus.Filled, Extensions.GetOrderDirection(fillQuantityC), exitFillPrice, fillQuantityC, OrderFee.Zero));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            // settled profit was reset because we closed the position\n            var currentlyStettledProfit = profit * ((fillQuantityA + fillQuantityC) / fillQuantityA);\n            Assert.AreEqual(currentlyStettledProfit, _futureHoldings.SettledProfit);\n            var closeProfit = new CashAmount(_future.Holdings.TotalCloseProfit(includeFees: false, exitPrice: exitFillPrice, entryPrice: averagePrice, -fillQuantityC), Currencies.USD);\n            Assert.AreEqual(startCash + closeProfit.Amount + currentlyStettledProfit, _portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreEqual(startTpv + closeProfit.Amount + _futureHoldings.UnsettledProfit + currentlyStettledProfit, _portfolio.TotalPortfolioValue);\n            Assert.AreEqual(_futureHoldings.UnsettledProfit + currentlyStettledProfit, _future.Holdings.TotalCloseProfit(includeFees: false, exitPrice: _future.Price, averagePrice, _future.Holdings.Quantity));\n\n            // finally let's close the entire position\n            averagePrice = _futureHoldings.AveragePrice;\n            _future.PortfolioModel.ProcessFill(_portfolio, _future, new OrderEvent(4, _future.Symbol, _timeKeeper.LocalTime, OrderStatus.Filled, Extensions.GetOrderDirection(fillQuantityD), exitFillPrice, fillQuantityD, OrderFee.Zero));\n            _portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(0, _futureHoldings.SettledProfit);\n            Assert.AreEqual(0, _futureHoldings.UnsettledProfit);\n            var closeProfit2 = new CashAmount(_future.Holdings.TotalCloseProfit(includeFees: false, exitPrice: exitFillPrice, averagePrice, -fillQuantityD), Currencies.USD);\n            Assert.AreEqual(startCash + closeProfit.Amount + closeProfit2.Amount, _portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreEqual(startTpv + closeProfit.Amount + closeProfit2.Amount, _portfolio.TotalPortfolioValue);\n        }\n\n        private static void SetPrice(Security security, decimal price)\n        {\n            security.SetMarketPrice(new Tick(Noon, security.Symbol, string.Empty, Exchange.UNKNOWN, quantity: 1, price));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Futures/FuturesExpiryFunctionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Future;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml;\nusing System.Xml.Serialization;\nusing System.IO;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities.Futures\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class FuturesExpiryFunctionsTests\n    {\n        private IDictionary<String, List<Dates>> _data = new Dictionary<String, List<Dates>>();\n        private const string Zero = \"00:00:00\";\n        private const string ElevenAmHongKongTime = \"03:00:00\";\n        private const string ElevenOclockMoscowTime = \"08:00:00\";\n        private const string TenSixteen = \"10:16:00\";\n        private const string ElevenOclock = \"11:00:00\";\n        private const string NineFifteenCentralTime = \"14:15:00\";\n        private const string NineSixteenCentralTime = \"14:16:00\";\n        private const string TwelvePMCentralTime = \"17:00:00\";\n        private const string TwelveFivePMCentralTime = \"17:05:00\";\n        private const string TwelveTenCentralTime = \"17:10:00\";\n        private const string OneThirtyPMCentralTime = \"18:30:00\";\n        private const string OneFortyPMCentralTime = \"18:40:00\";\n        private const string TwoPMCentralTime = \"19:00:00\";\n        private const string ThreePMCentralTime = \"20:00:00\";\n        private const string NineThirtyEasternTime = \"13:30:00\";\n        private const string FiveOClockPMEasternTime = \"21:00:00\";\n        private const string EightOClockChicagoTime = \"13:00:00\";\n        private const string TwelveOclock = \"12:00:00\";\n        private const string TwelveOne = \"12:01:00\";\n        private const string FourPMLondonTime = \"15:00:00\";\n        private const string OneTwentyFivePM = \"13:25:00\";\n        private const string OneThirtyPM = \"13:30:00\";\n        private const string TwoThirtyPM = \"14:30:00\";\n        private const string OneFortyFivePM = \"13:45:00\";\n        private const string ThreeThirtyPM = \"15:30:00\";\n        private const string FourFifteenPM = \"16:15:00\";\n        private readonly SymbolPropertiesDatabase _symbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n\n        [OneTimeSetUp]\n        public void Init()\n        {\n            var path = Path.Combine(\"TestData\", \"FuturesExpiryFunctionsTestData.xml\");\n            using (var reader = XmlReader.Create(path))\n            {\n                var serializer = new XmlSerializer(typeof(Item[]));\n                _data = ((Item[])serializer.Deserialize(reader)).ToDictionary(i=>i.Symbol,i=>i.SymbolDates);\n            }\n        }\n\n        // last day and previous are holidays\n        [TestCase(\"20250101\", \"20250127\")]\n        // normal case\n        [TestCase(\"20250201\", \"20250227\")]\n        [TestCase(\"20250301\", \"20250328\")]\n        [TestCase(\"20250401\", \"20250429\")]\n        [TestCase(\"20250501\", \"20250529\")]\n        [TestCase(\"20250601\", \"20250627\")]\n        [TestCase(\"20250701\", \"20250730\")]\n        [TestCase(\"20250801\", \"20250828\")]\n        [TestCase(\"20250901\", \"20250929\")]\n        [TestCase(\"20251001\", \"20251030\")]\n        [TestCase(\"20251101\", \"20251127\")]\n        [TestCase(\"20251201\", \"20251230\")]\n        public void HSIFutures(string input, string expectedStr)\n        {\n            var date = Time.ParseDate(input);\n            var expected = Time.ParseDate(expectedStr);\n\n            var canonical = Symbol.Create(\"HSI\", SecurityType.Future, Market.HKFE);\n            var expiration = FuturesExpiryFunctions.FuturesExpiryDictionary[canonical];\n            var result = expiration(date);\n            Assert.AreEqual(expected, result.Date);\n        }\n\n        [Test]\n        public void MCLFutures()\n        {\n            var canonical = Symbol.Create(\"MCL\", SecurityType.Future, Market.NYMEX);\n            var expiration = FuturesExpiryFunctions.FuturesExpiryDictionary[canonical];\n\n            // 1/25 is Saturday and 1/20 is a holiday\n            Assert.AreEqual(new DateTime(2025, 1, 17, 0, 0, 0), expiration(new DateTime(2025, 2, 1)));\n            // Whole weekend in between\n            Assert.AreEqual(new DateTime(2025, 2, 19, 0, 0, 0), expiration(new DateTime(2025, 3, 1)));\n            // Normal case\n            Assert.AreEqual(new DateTime(2025, 4, 21, 0, 0, 0), expiration(new DateTime(2025, 5, 1)));\n        }\n\n        [Test]\n        public void FuturesExpiryFunction_MissingSymbol_ShouldThrowArgumentException()\n        {\n            const string badSymbol = \"AAAAA\";\n            Assert.Throws<ArgumentException>(() => { FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(badSymbol)); },\n                                             $\"Expiry function not implemented for {badSymbol} in FuturesExpiryFunctions.FuturesExpiryDictionary\");\n        }\n\n        [Test]\n        public void FuturesExpiryFunctions_AllFutures_ShouldHaveExpiryFunction()\n        {\n            var missingFutures = new List<string>();\n\n            var futuresSymbols = typeof(QuantConnect.Securities.Futures).GetNestedTypes()\n                                                                        .SelectMany(x => x.GetFields())\n                                                                        .Select(x => x.GetValue(null)) // null for obj in GetValue indicates static field\n                                                                        .Cast<string>();\n\n            foreach (var futuresSymbol in futuresSymbols)\n            {\n                try\n                {\n                    FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(futuresSymbol));\n                }\n                catch (ArgumentException)\n                {\n                    missingFutures.Add(futuresSymbol);\n                }\n            }\n\n            Assert.IsEmpty(missingFutures,\n                           $\"The following symbols do not have an expiry function defined in FuturesExpiryFunction.FuturesExpiryDictionary: {string.Join(\", \", missingFutures)}\");\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Grains.BlackSeaCornFinanciallySettledPlatts)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.SRWWheat)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.Wheat)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.HRWWheat)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.Corn)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.Soybeans)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.SoybeanMeal)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.SoybeanOil)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.Oats)]\n        [TestCase(QuantConnect.Securities.Futures.Grains.BlackSeaWheatFinanciallySettledPlatts)]\n        public void GrainsExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade;\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Currencies.USD, TenSixteen)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.GBP, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.CAD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.JPY, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.CHF, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.EUR, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.AUD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.NZD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.RUB, ElevenOclockMoscowTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.BRL, NineFifteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.MXN, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.ZAR, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.AUDCAD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.AUDJPY, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.AUDNZD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.BTC, FourPMLondonTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.ETH, FourPMLondonTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.CADJPY, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.StandardSizeUSDOffshoreRMBCNH, ElevenAmHongKongTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.EuroFXEmini, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.EURAUD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.EURCAD, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.EURSEK, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.JapaneseYenEmini, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.MicroEUR, NineSixteenCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.MicroBTC, FourPMLondonTime)]\n        [TestCase(QuantConnect.Securities.Futures.Currencies.MicroEther, FourPMLondonTime)]\n        public void CurrenciesExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Energy.PropaneNonLDHMontBelvieu, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ArgusPropaneFarEastIndexBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MiniEuropeanThreePointPercentFiveFuelOilBargesPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MiniSingaporeFuelOil180CstPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GulfCoastULSDPlattsUpDownBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GulfCoastJetPlattsUpDownBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.PropaneNonLDHMontBelvieuOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EuropeanPropaneCIFARAArgusBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.PremiumUnleadedGasoline10ppmFOBMEDPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ArgusPropaneFarEastIndex, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GasolineEurobobOxyNWEBargesArgusCrackSpreadBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuNaturalGasolineOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuNormalButaneOPISBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ConwayPropaneOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuLDHPropaneOPISBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ArgusPropaneFarEastIndexVsEuropeanPropaneCIFARAArgus, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ArgusPropaneSaudiAramco, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GroupThreeULSDPlattsVsNYHarborULSD, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GroupThreeSuboctaneGasolinePlattsVsRBOB, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.SingaporeFuelOil180cstPlattsBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.SingaporeFuelOil380cstPlattsBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuEthaneOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuNormalButaneOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.BrentCrudeOilVsDubaiCrudeOilPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ArgusLLSvsWTIArgusTradeMonth, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.SingaporeGasoilPlattsVsLowSulphurGasoilFutures, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.LosAngelesCARBOBGasolineOPISvsRBOBGasoline, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.LosAngelesJetOPISvsNYHarborULSD, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.LosAngelesCARBDieselOPISvsNYHarborULSD, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EuropeanNaphthaPlattsBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EuropeanPropaneCIFARAArgus, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuNaturalGasolineOPISBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.RBOBGasolineCrackSpread, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GulfCoastHSFOPlattsBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MarsArgusVsWTITradeMonth, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MarsArgusVsWTIFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EthanolT2FOBRdamIncludingDutyPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MontBelvieuLDHPropaneOPIS, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GasolineEurobobOxyNWEBargesArgus, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.WTIBrentFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mt, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GasolineEurobobOxyNWEBargesArgusBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.BrentLastDayFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.CrudeOilWTI, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GulfCoastCBOBGasolineA2PlattsVsRBOBGasoline, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.WTIFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ChicagoEthanolPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.SingaporeMogas92UnleadedPlattsBrentCrackSpread, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.DubaiCrudeOilPlattsFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.JapanCnFNaphthaPlattsBALMO, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.Ethanol, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EuropeanNaphthaPlattsCrackSpread, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EastWestGasolineSpreadPlattsArgus, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallons, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.FreightRouteTC14Baltic, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlatts, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.WTIHoustonCrudeOil, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.NaturalGasHenryHubLastDayFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.HeatingOil, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.NaturalGasHenryHubPenultimateFinancial, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.WTIHoustonArgusVsWTITradeMonth, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.Gasoline, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.NaturalGas, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.BrentCrude, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.LowSulfurGasoil, TwelveOclock)]\n        [TestCase(QuantConnect.Securities.Futures.Energy.MicroCrudeOilWTI, Zero)]\n        public void EnergyExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [Test]\n        public void BankHolidaysAreRespected()\n        {\n            //Arrange\n            var futureSymbol = GetFutureSymbol(\"6E\", new DateTime(2025, 2, 1));\n            var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(\"6E\"));\n            // Expiry date is the second business day immediately preceding the third Wednesday of the contract month(usually Monday).\n            // The third wednesday is the 19th so the expiry date should be monday 17th, but that day is a bank holiday\n            // so the real expiry date is the 14th\n            var expiryDate = func(futureSymbol.ID.Date);\n\n            //Assert\n            Assert.AreEqual(new DateTime(2025, 2, 14), expiryDate.Date);\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Indices.NASDAQ100EMini, \"20260302\", \"20260320\")]\n        [TestCase(QuantConnect.Securities.Futures.Indices.NASDAQ100EMini, \"20260602\", \"20260618\")]\n        public void ExpirationUsesHolidays(string symbol, string dateStr, string expectedDate)\n        {\n            var date = Time.ParseDate(dateStr);\n            var expected = Time.ParseDate(expectedDate);\n\n            var futureSymbol = GetFutureSymbol(symbol, date);\n            var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n            var actual = func(futureSymbol.ID.Date);\n            Assert.AreEqual(expected, actual.Date, $\"Failed for symbol: {symbol}. Date {dateStr}\");\n        }\n\n        // 25th is a sunday\n        [TestCase(QuantConnect.Securities.Futures.Energy.MicroCrudeOilWTI, \"20221001\", \"20220919\")]\n        [TestCase(QuantConnect.Securities.Futures.Energy.CrudeOilWTI, \"20221001\", \"20220920\")]\n        // 25th is a tuesday\n        [TestCase(QuantConnect.Securities.Futures.Energy.MicroCrudeOilWTI, \"20221101\", \"20221019\")]\n        [TestCase(QuantConnect.Securities.Futures.Energy.CrudeOilWTI, \"20221101\", \"20221020\")]\n        // 25th is a friday but includes thanks giving\n        [TestCase(QuantConnect.Securities.Futures.Energy.MicroCrudeOilWTI, \"20221201\", \"20221118\")]\n        [TestCase(QuantConnect.Securities.Futures.Energy.CrudeOilWTI, \"20221201\", \"20221121\")]\n        public void MicroCrudeOilExpiration(string symbol, string dateStr, string expectedDate)\n        {\n            var date = Time.ParseDate(dateStr);\n            var expected = Time.ParseDate(expectedDate);\n\n            var futureSymbol = GetFutureSymbol(symbol, date);\n            var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n            var actual = func(futureSymbol.ID.Date);\n\n            Assert.AreEqual(expected, actual, $\"Failed for symbol: {symbol}. Date {dateStr}\");\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Financials.EuroDollar, ElevenOclock)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.Y30TreasuryBond, TwelveOne)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.Y10TreasuryNote, TwelveOne)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.Y5TreasuryNote, TwelveOne)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.Y2TreasuryNote, TwelveOne)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.FiveYearUSDMACSwap, TwoPMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.UltraUSTreasuryBond, TwelveOne)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.UltraTenYearUSTreasuryNote, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Financials.MicroY10TreasuryNote, Zero)]\n        public void FinancialsExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Indices.BloombergCommodityIndex, OneThirtyPMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.NASDAQ100BiotechnologyEMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.FTSEEmergingEmini, ThreePMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.SP400MidCapEmini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.SPGSCICommodity, OneFortyPMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.USDDenominatedIbovespa, ThreePMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.SP500EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.NASDAQ100EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.Dow30EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.Russell2000EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.Nikkei225Dollar, FiveOClockPMEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.VIX, EightOClockChicagoTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.Nikkei225Yen, TwoThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCITaiwanIndex, OneFortyFivePM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.Nifty50, ThreeThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.BankNifty, ThreeThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.BseSensex, ThreeThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MicroSP500EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MicroDow30EMini, NineThirtyEasternTime)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIEuropeNTR, FourFifteenPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIJapanNTR, FourFifteenPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIUsaIndex, FourFifteenPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIEmergingMarketsAsiaNTR, FourFifteenPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIEmergingMarketsIndex, FourFifteenPM)]\n        [TestCase(QuantConnect.Securities.Futures.Indices.MSCIEafeIndex, FourFifteenPM)]\n        public void IndicesExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Meats.LiveCattle, TwelveOclock)]\n        [TestCase(QuantConnect.Securities.Futures.Meats.LeanHogs, TwelveOclock)]\n        [TestCase(QuantConnect.Securities.Futures.Meats.FeederCattle, Zero)]\n        public void MeatsExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Forestry.Lumber, TwelveFivePMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Forestry.RandomLengthLumber, TwelveFivePMCentralTime)]\n        public void LumberPulpExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Metals.Gold, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Silver, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Platinum, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Palladium, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.AluminumMWUSTransactionPremiumPlatts25MT, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.AluminiumEuropeanPremiumDutyPaidMetalBulletin, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Copper, TwelvePMCentralTime)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.USMidwestDomesticHotRolledCoilSteelCRUIndex, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.MicroGold, Zero)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.MiniNYGold, OneThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.MiniNYSilver, OneTwentyFivePM)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Gold100Oz, OneThirtyPM)]\n        [TestCase(QuantConnect.Securities.Futures.Metals.Silver5000Oz, OneTwentyFivePM)]\n        public void MetalsExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol, string dayTime)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade + Parse.TimeSpan(dayTime);\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        [TestCase(QuantConnect.Securities.Futures.Softs.Cotton2)]\n        [TestCase(QuantConnect.Securities.Futures.Softs.OrangeJuice)]\n        [TestCase(QuantConnect.Securities.Futures.Softs.Coffee)]\n        [TestCase(QuantConnect.Securities.Futures.Softs.Sugar11)]\n        [TestCase(QuantConnect.Securities.Futures.Softs.Sugar11CME)]\n        [TestCase(QuantConnect.Securities.Futures.Softs.Cocoa)]\n        public void SoftsExpiryDateFunction_WithDifferentDates_ShouldFollowContract(string symbol)\n        {\n            Assert.IsTrue(_data.ContainsKey(symbol), \"Symbol \" + symbol + \" not present in Test Data\");\n            foreach (var date in _data[symbol])\n            {\n                //Arrange\n                var futureSymbol = GetFutureSymbol(symbol, date.ContractMonth);\n                var func = FuturesExpiryFunctions.FuturesExpiryFunction(GetFutureSymbol(symbol));\n\n                //Act\n                var actual = func(futureSymbol.ID.Date);\n                var expected = date.LastTrade;\n\n                //Assert\n                Assert.AreEqual(expected, actual, \"Failed for symbol: \" + symbol);\n            }\n        }\n\n        /// <summary>\n        /// Dates for Termination Conditions of futures\n        /// </summary>\n        public class Dates\n        {\n            public DateTime ContractMonth { get; set; }\n            public DateTime LastTrade { get; set; }\n            public Dates() { }\n            public Dates(DateTime c, DateTime l)\n            {\n                ContractMonth = c;\n                LastTrade = l;\n            }\n        }\n\n        /// <summary>\n        /// Class to convert Array into Dictionary using XmlSerializer\n        /// </summary>\n        public class Item\n        {\n            [XmlAttribute]\n            public String Symbol { get; set; }\n            public List<Dates> SymbolDates { get; set; }\n        }\n\n        private Symbol GetFutureSymbol(string symbol, DateTime? date =null)\n        {\n            string market;\n            if (!_symbolPropertiesDatabase.TryGetMarket(symbol, SecurityType.Future, out market))\n            {\n                market = DefaultBrokerageModel.DefaultMarketMap[SecurityType.Future];\n            }\n\n            if (date.HasValue)\n            {\n                return Symbol.CreateFuture(symbol, market, date.Value);\n            }\n            return Symbol.Create(symbol, SecurityType.Future, market);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Futures/FuturesExpiryUtilityFunctionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Securities.Futures\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class FuturesExpiryUtilityFunctionsTests\n    {\n        private HashSet<DateTime> _holidays = FuturesExpiryUtilityFunctions.GetExpirationHolidays(Market.CME, null);\n\n        [TestCase(\"08/05/2017 00:00:01\", 4, \"12/05/2017 00:00:01\")]\n        [TestCase(\"10/05/2017 00:00:01\", 5, \"17/05/2017 00:00:01\")]\n        [TestCase(\"24/12/2017 00:00:01\", 3, \"28/12/2017 00:00:01\")]\n        public void AddBusinessDays_WithPositiveInput_ShouldReturnNthSucceedingBusinessDay(string time, int n, string actual)\n        {\n            //Arrange\n            var inputTime = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n            var actualDate = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedDate = FuturesExpiryUtilityFunctions.AddBusinessDays(inputTime, n, _holidays);\n\n            //Assert\n            Assert.AreEqual(actualDate, calculatedDate);\n        }\n\n        [TestCase(\"11/05/2017 00:00:01\", -2, \"09/05/2017 00:00:01\")]\n        [TestCase(\"15/05/2017 00:00:01\", -3, \"10/05/2017 00:00:01\")]\n        [TestCase(\"26/12/2017 00:00:01\", -5, \"18/12/2017 00:00:01\")]\n        public void AddBusinessDays_WithNegativeInput_ShouldReturnNthPrecedingBusinessDay(string time, int n, string actual)\n        {\n            //Arrange\n            var inputTime = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n            var actualDate = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedDate = FuturesExpiryUtilityFunctions.AddBusinessDays(inputTime, n, _holidays);\n\n            //Assert\n            Assert.AreEqual(actualDate, calculatedDate);\n        }\n\n        [TestCase(\"08/05/2017 00:00:01\", 4, \"15/05/2017 00:00:01\", \"12/05/2017 00:00:01\")]\n        [TestCase(\"08/05/2017 00:00:01\", 5, \"22/05/2017 00:00:01\", \"15/05/2017 00:00:01\", \"16/05/2017 00:00:01\", \"17/05/2017 00:00:01\", \"18/05/2017 00:00:01\", \"19/05/2017 00:00:01\")]\n        [TestCase(\"24/12/2017 00:00:01\", 3, \"27/12/2017 00:00:01\")]\n        public void AddBusinessDays_WithPositiveInput_ShouldReturnNthSucceedingBusinessDay_ExcludingCustomHolidays(string time, int n, string actual, params string[] holidays)\n        {\n            //Arrange\n            var inputTime = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n            var actualDate = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedDate = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                inputTime,\n                n,\n                holidays.Select(x => Parse.DateTimeExact(x, \"dd/MM/yyyy HH:mm:ss\").Date).ToHashSet());\n\n            //Assert\n            Assert.AreEqual(actualDate, calculatedDate);\n        }\n\n        [TestCase(\"11/05/2017 00:00:01\", -1, \"09/05/2017 00:00:01\", \"10/05/2017 00:00:01\")]\n        [TestCase(\"15/05/2017 00:00:01\", -1, \"10/05/2017 00:00:01\", \"11/05/2017 00:00:01\", \"12/05/2017 00:00:01\")]\n        [TestCase(\"26/12/2017 00:00:01\", -1, \"18/12/2017 00:00:01\", \"25/12/2017 00:00:01\", \"22/12/2017 00:00:01\", \"21/12/2017 00:00:01\", \"20/12/2017 00:00:01\", \"19/12/2017 00:00:01\")]\n        public void AddBusinessDays_WithNegativeInput_ShouldReturnNthPrecedingBusinessDay_ExcludingCustomHolidays(string time, int n, string actual, params string[] holidays)\n        {\n            //Arrange\n            var inputTime = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n            var actualDate = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedDate = FuturesExpiryUtilityFunctions.AddBusinessDays(\n                inputTime,\n                n,\n                holidays.Select(x => Parse.DateTimeExact(x, \"dd/MM/yyyy HH:mm:ss\").Date).ToHashSet());\n\n            //Assert\n            Assert.AreEqual(actualDate, calculatedDate);\n        }\n\n        [TestCase(\"01/03/2016 00:00:01\", 5, \"24/03/2016 00:00:00\")]\n        [TestCase(\"01/02/2014 00:00:01\", 3, \"26/02/2014 00:00:00\")]\n        [TestCase(\"05/07/2017 00:00:01\", 7, \"21/07/2017 00:00:00\")]\n        public void NthLastBusinessDay_WithInputsLessThanDaysInMonth_ShouldReturnNthLastBusinessDay(string time, int numberOfDays, string actual)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n            var actualDate = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedDate = FuturesExpiryUtilityFunctions.NthLastBusinessDay(inputDate, numberOfDays, _holidays);\n\n            //Assert\n            Assert.AreEqual(actualDate, calculatedDate);\n        }\n\n        [TestCase(\"01/03/2016 00:00:00\", 45)]\n        [TestCase(\"05/02/2017 00:00:00\", 30)]\n        public void NthLastBusinessDay_WithInputsMoreThanDaysInMonth_ShouldThrowException(string time, int numberOfDays)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            Assert.Throws<ArgumentOutOfRangeException>(() =>\n            {\n                FuturesExpiryUtilityFunctions.NthLastBusinessDay(inputDate, numberOfDays, _holidays);\n            });\n        }\n\n        [TestCase(\"01/01/2016 00:00:01\", 1, \"01/04/2016 00:00:00\")]\n        [TestCase(\"02/01/2019 00:00:01\", 1, \"02/01/2019 00:00:00\")]\n        [TestCase(\"01/01/2019 00:00:01\", 1, \"01/02/2019 00:00:00\")]\n        [TestCase(\"06/01/2019 00:00:01\", 1, \"06/03/2019 00:00:00\")]\n        [TestCase(\"07/01/2019 00:00:01\", 5, \"07/05/2019 00:00:00\")]\n        public void NthBusinessDay_ShouldReturnAccurateBusinessDay(string testDate, int nthBusinessDay, string actualDate)\n        {\n            var inputDate = Parse.DateTimeExact(testDate, \"MM/dd/yyyy HH:mm:ss\");\n            var expectedResult = Parse.DateTimeExact(actualDate, \"MM/dd/yyyy HH:mm:ss\");\n\n            var actual = FuturesExpiryUtilityFunctions.NthBusinessDay(inputDate, nthBusinessDay, _holidays);\n\n            Assert.AreEqual(expectedResult, actual);\n        }\n\n        [TestCase(\"01/01/2016 00:00:01\", 1, \"01/05/2016 00:00:00\", \"01/01/2016 00:00:01\", \"01/04/2016 00:00:01\")]\n        [TestCase(\"02/01/2019 00:00:01\", 12, \"02/20/2019 00:00:00\", \"02/18/2019 00:00:01\", \"02/19/2019 00:00:01\")]\n        [TestCase(\"01/01/2019 00:00:01\", 1, \"01/07/2019 00:00:00\", \"01/01/2019 00:00:01\", \"01/02/2019 00:00:01\", \"01/03/2019 00:00:01\", \"01/04/2019 00:00:01\")]\n        public void NthBusinessDay_ShouldReturnAccurateBusinessDay_WithHolidays(string testDate, int nthBusinessDay, string actualDate, params string[] holidayDates)\n        {\n            var inputDate = Parse.DateTimeExact(testDate, \"MM/dd/yyyy HH:mm:ss\");\n            var expectedResult = Parse.DateTimeExact(actualDate, \"MM/dd/yyyy HH:mm:ss\");\n            var holidays = holidayDates.Select(x => Parse.DateTimeExact(x, \"MM/dd/yyyy HH:mm:ss\"));\n\n            var actual = FuturesExpiryUtilityFunctions.NthBusinessDay(inputDate, nthBusinessDay, holidayList: holidays);\n\n            Assert.AreEqual(expectedResult, actual);\n        }\n\n        [TestCase(\"01/2015\", \"16/01/2015 00:00:00\")]\n        [TestCase(\"06/2016\", \"17/06/2016 00:00:00\")]\n        [TestCase(\"12/2018\", \"21/12/2018 00:00:00\")]\n        public void ThirdFriday_WithNormalMonth_ShouldReturnThirdFriday(string time, string actual)\n        {\n            //Arrange\n            var inputMonth = Parse.DateTimeExact(time, \"MM/yyyy\");\n            var actualFriday = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedFriday = FuturesExpiryUtilityFunctions.ThirdFriday(inputMonth);\n\n            //Assert\n            Assert.AreEqual(calculatedFriday, actualFriday);\n        }\n\n        [TestCase(\"04/2017\", \"19/04/2017 00:00:00\")]\n        [TestCase(\"02/2015\", \"18/02/2015 00:00:00\")]\n        [TestCase(\"01/2003\", \"15/01/2003 00:00:00\")]\n        public void ThirdWednesday_WithNormalMonth_ShouldReturnThirdWednesday(string time, string actual)\n        {\n            //Arrange\n            var inputMonth = Parse.DateTimeExact(time, \"MM/yyyy\");\n            var actualFriday = Parse.DateTimeExact(actual, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedFriday = FuturesExpiryUtilityFunctions.ThirdWednesday(inputMonth);\n\n            //Assert\n            Assert.AreEqual(calculatedFriday, actualFriday);\n        }\n\n        [TestCase(\"07/05/2017 00:00:01\")]\n        [TestCase(\"01/01/1998 00:00:01\")]\n        [TestCase(\"25/03/2005 00:00:01\")]\n        public void NotHoliday_ForAHoliday_ShouldReturnFalse(string time)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedValue = FuturesExpiryUtilityFunctions.NotHoliday(inputDate, _holidays);\n\n            //Assert\n            Assert.AreEqual(calculatedValue, false);\n        }\n\n        [TestCase(\"08/05/2017 00:00:01\")]\n        [TestCase(\"05/04/2007 00:00:01\")]\n        [TestCase(\"27/05/2003 00:00:01\")]\n        public void NotHoliday_ForABusinessDay_ShouldReturnTrue(string time)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(time, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedValue = FuturesExpiryUtilityFunctions.NotHoliday(inputDate, _holidays);\n\n            //Assert\n            Assert.AreEqual(calculatedValue, true);\n        }\n\n        [TestCase(\"09/04/2017 00:00:01\")]\n        [TestCase(\"02/04/2003 00:00:01\")]\n        [TestCase(\"02/03/2002 00:00:01\")]\n        public void NotPrecededByHoliday_WithNonThursdayWeekday_ShouldThrowException(string day)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(day, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            Assert.Throws<ArgumentException>(() =>\n            {\n                FuturesExpiryUtilityFunctions.NotPrecededByHoliday(inputDate, _holidays);\n            });\n        }\n\n        [TestCase(\"13/04/2017 00:00:01\")]\n        [TestCase(\"14/02/2002 00:00:01\")]\n        public void NotPrecededByHoliday_ForThursdayWithNoHolidayInFourPrecedingDays_ShouldReturnTrue(string day)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(day, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedOutput = FuturesExpiryUtilityFunctions.NotPrecededByHoliday(inputDate, _holidays);\n\n            //Assert\n            Assert.AreEqual(calculatedOutput, true);\n        }\n\n        [TestCase(\"31/03/2016 00:00:01\")]\n        [TestCase(\"30/05/2002 00:00:01\")]\n        public void NotPrecededByHoliday_ForThursdayWithHolidayInFourPrecedingDays_ShouldReturnFalse(string day)\n        {\n            //Arrange\n            var inputDate = Parse.DateTimeExact(day, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            var calculatedOutput = FuturesExpiryUtilityFunctions.NotPrecededByHoliday(inputDate, _holidays);\n\n            //Assert\n            Assert.AreEqual(calculatedOutput, false);\n        }\n\n        [TestCase(\"17/06/2020 00:00:01\", DayOfWeek.Friday, 1, \"05/06/2020 00:00:00\")]\n        [TestCase(\"30/08/2017 00:00:01\", DayOfWeek.Monday, 2, \"14/08/2017 00:00:00\")]\n        public void Nth_WeekDay_ShouldReturnCorrectDate(string contractDate, DayOfWeek dayOfWeek, int n, string expectedOutput)\n        {\n            // Arrange\n            var inputDate = Parse.DateTimeExact(contractDate, \"dd/MM/yyyy HH:mm:ss\");\n            var calculated = FuturesExpiryUtilityFunctions.NthWeekday(inputDate, n, dayOfWeek);\n            var expected = Parse.DateTimeExact(expectedOutput, \"dd/MM/yyyy HH:mm:ss\");\n\n            Assert.AreEqual(expected, calculated);\n        }\n\n        [TestCase(\"17/06/2020 00:00:01\", DayOfWeek.Friday, -2)]\n        [TestCase(\"30/08/2017 00:00:01\", DayOfWeek.Monday, 7)]\n        public void Nth_WeekDay_ShouldHandShouldThrowException(string contractDate, DayOfWeek dayOfWeek, int n)\n        {\n            // Arrange\n            var inputDate = Parse.DateTimeExact(contractDate, \"dd/MM/yyyy HH:mm:ss\");\n\n            //Act\n            Assert.Throws<ArgumentOutOfRangeException>(() =>\n            {\n                FuturesExpiryUtilityFunctions.NthWeekday(inputDate, n, dayOfWeek);\n            });\n        }\n\n        [TestCase(\"06/01/2015 00:00:01\", DayOfWeek.Friday, \"30/01/2015 00:00:00\")]\n        [TestCase(\"06/07/2015 00:00:01\", DayOfWeek.Thursday, \"30/07/2015 00:00:00\")]\n        [TestCase(\"06/05/2016 00:00:01\", DayOfWeek.Wednesday, \"25/05/2016 00:00:00\")]\n        [TestCase(\"06/01/2016 00:00:01\", DayOfWeek.Friday, \"29/01/2016 00:00:00\")]\n        [TestCase(\"06/07/2016 00:00:01\", DayOfWeek.Thursday, \"28/07/2016 00:00:00\")]\n        [TestCase(\"06/05/2017 00:00:01\", DayOfWeek.Wednesday, \"31/05/2017 00:00:00\")]\n        public void Last_WeekDay_ShouldReturnCorrectDate(string contractDate, DayOfWeek dayOfWeek, string expectedOutput)\n        {\n            // Arrange\n            var inputDate = Parse.DateTimeExact(contractDate, \"dd/MM/yyyy HH:mm:ss\");\n            var calculated = FuturesExpiryUtilityFunctions.LastWeekday(inputDate, dayOfWeek);\n            var expected = Parse.DateTimeExact(expectedOutput, \"dd/MM/yyyy HH:mm:ss\");\n\n            Assert.AreEqual(expected, calculated);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Futures/FuturesListingsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Tests.Common.Securities.Futures\n{\n    [TestFixture]\n    public class FuturesListingsTests\n    {\n        [TestCaseSource(nameof(ListedContractsCME_2021_01_11))]\n        public void ListedContractsMatchesCME(string ticker, string market, DateTime[] expectedListedExpiries)\n        {\n            // Test was created on 2021-01-11, we're using CME's data here to validate the test, hence the fixed date.\n            var contractsListed = FuturesListings.ListedContracts(ticker, new DateTime(2021, 1, 11));\n            var contractsMissing = new HashSet<Symbol>();\n\n            foreach (var expectedExpiry in expectedListedExpiries)\n            {\n                var expectedFuture = Symbol.CreateFuture(ticker, market, expectedExpiry);\n                if (!contractsListed.Contains(expectedFuture))\n                {\n                    contractsMissing.Add(expectedFuture);\n                }\n            }\n\n            var missingContractsMessage = $\"The following contracts are missing from the listed contracts: {string.Join(\"\\n\", contractsMissing.Select(s => \"  \" + s.Value + \" \" + s.ID.Date.ToStringInvariant(\"yyyy-MM-dd\")))}\";\n\n            Assert.AreEqual(0, contractsMissing.Count, missingContractsMessage);\n            Assert.AreEqual(expectedListedExpiries.Length, contractsListed.Count, $\"The length of expected listed contracts does not match the returned contract count.\");\n        }\n\n        public static TestCaseData[] ListedContractsCME_2021_01_11()\n        {\n            return new TestCaseData[]\n            {\n                new TestCaseData(\n                    \"ZB\",\n                    Market.CBOT,\n                    new[]\n                    {\n                        new DateTime(2021, 3, 22),\n                        new DateTime(2021, 6, 21),\n                        new DateTime(2021, 9, 21),\n                    }\n                ),\n                new TestCaseData(\n                    \"ZC\",\n                    Market.CBOT,\n                    new[]\n                    {\n                        new DateTime(2021, 3, 12),\n                        new DateTime(2021, 5, 14),\n                        new DateTime(2021, 7, 14),\n                        new DateTime(2021, 9, 14),\n                        new DateTime(2021, 12, 14),\n                        new DateTime(2022, 3, 14),\n                        new DateTime(2022, 5, 13),\n                        new DateTime(2022, 7, 14),\n                        new DateTime(2022, 9, 14),\n                        new DateTime(2022, 12, 14),\n                        new DateTime(2023, 3, 14),\n                        new DateTime(2023, 5, 12),\n                        new DateTime(2023, 7, 14),\n                        new DateTime(2023, 9, 14),\n                        new DateTime(2023, 12, 14),\n                        new DateTime(2024, 7, 12),\n                        new DateTime(2024, 12, 13),\n                    }\n                ),\n                new TestCaseData(\n                    \"ZS\",\n                    Market.CBOT,\n                    new[]\n                    {\n                        new DateTime(2021, 1, 14),\n                        new DateTime(2021, 3, 12),\n                        new DateTime(2021, 5, 14),\n                        new DateTime(2021, 7, 14),\n                        new DateTime(2021, 8, 13),\n                        new DateTime(2021, 9, 14),\n                        new DateTime(2021, 11, 12),\n                        new DateTime(2022, 1, 14),\n                        new DateTime(2022, 3, 14),\n                        new DateTime(2022, 5, 13),\n                        new DateTime(2022, 7, 14),\n                        new DateTime(2022, 8, 12),\n                        new DateTime(2022, 9, 14),\n                        new DateTime(2022, 11, 14),\n                        new DateTime(2023, 1, 13),\n                        new DateTime(2023, 3, 14),\n                        new DateTime(2023, 5, 12),\n                        new DateTime(2023, 7, 14),\n                        new DateTime(2023, 8, 14),\n                        new DateTime(2023, 9, 14),\n                        new DateTime(2023, 11, 14),\n                        new DateTime(2024, 7, 12),\n                        new DateTime(2024, 11, 14)\n                    }\n                ),\n                new TestCaseData(\n                    \"ZT\",\n                    Market.CBOT,\n                    new[]\n                    {\n                        new DateTime(2021, 3, 31),\n                        new DateTime(2021, 6, 30),\n                        new DateTime(2021, 9, 30)\n                    }\n                ),\n                new TestCaseData(\n                    \"ZW\",\n                    Market.CBOT,\n                    new[]\n                    {\n                        new DateTime(2021, 3, 12),\n                        new DateTime(2021, 5, 14),\n                        new DateTime(2021, 7, 14),\n                        new DateTime(2021, 9, 14),\n                        new DateTime(2021, 12, 14),\n                        new DateTime(2022, 3, 14),\n                        new DateTime(2022, 5, 13),\n                        new DateTime(2022, 7, 14),\n                        new DateTime(2022, 9, 14),\n                        new DateTime(2022, 12, 14),\n                        new DateTime(2023, 3, 14),\n                        new DateTime(2023, 5, 12),\n                        new DateTime(2023, 7, 14)\n                    }\n                ),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/IdentityCurrencyConverterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class IdentityCurrencyConverterTests\n    {\n        [Test]\n        public void ThrowsArgumentExceptionOnCashAmountNotInAccountCurrency()\n        {\n            var converter = new IdentityCurrencyConverter(Currencies.USD);\n            var cashAmount = new CashAmount(1m, \"EUR\");\n            Assert.Throws<ArgumentException>(() => converter.ConvertToAccountCurrency(cashAmount));\n        }\n\n        [Test]\n        public void ConvertsAccountCurrencyAsIdentity()\n        {\n            var converter = new IdentityCurrencyConverter(\"ABC\");\n            var cashAmount = new CashAmount(1m, \"ABC\");\n            Assert.AreEqual(cashAmount, converter.ConvertToAccountCurrency(cashAmount));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/ImmediateSettlementModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class ImmediateSettlementModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2014, 6, 24, 12, 0, 0);\n        private static readonly TimeKeeper TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n\n        [Test]\n        public void FundsAreSettledImmediately()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            var model = new ImmediateSettlementModel();\n            var config = CreateTradeBarConfig();\n            var security = new Security(\n                SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours(),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            portfolio.SetCash(1000);\n            Assert.AreEqual(1000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            var timeUtc = Noon.ConvertToUtc(TimeZones.NewYork);\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n\n            Assert.AreEqual(2000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(-500, Currencies.USD), null));\n\n            Assert.AreEqual(1500, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            model.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, timeUtc, new CashAmount(1000, Currencies.USD), null));\n\n            Assert.AreEqual(2500, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig()\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Index/IndexTests.cs",
    "content": "﻿﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities.Index\n{\n    [TestFixture]\n    public class IndexTests\n    {\n        [Test]\n        public void ConstructorExtractsQuoteCurrency()\n        {\n            var symbol = Symbol.Create(\"SPX\", SecurityType.Index, Market.USA);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.Utc, TimeZones.NewYork, true, true, true);\n            var symbolProperties = new SymbolProperties(\"S&P 500 index\", \"USD\", 1, 1, 1, string.Empty);\n            var index = new QuantConnect.Securities.Index.Index(SecurityExchangeHours.AlwaysOpen(config.DataTimeZone), new Cash(\"USD\", 0, 0), config, symbolProperties, ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null);\n            Assert.AreEqual(\"USD\", index.QuoteCurrency.Symbol);\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/IndexOption/IndexOptionSymbolTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities.IndexOption;\n\nnamespace QuantConnect.Tests.Common.Securities.IndexOption\n{\n    [TestFixture]\n    public class IndexOptionSymbolTests\n    {\n        [TestCase(1, false, \"SPXW\")]\n        [TestCase(20, true, \"SPXW\")]\n\n        [TestCase(1, false, \"NQX\")]\n        [TestCase(20, true, \"NQX\")]\n\n        [TestCase(1, true, \"VIX\")]\n        [TestCase(20, true, \"VIX\")]\n        public void IsStandard(int expirationDate, bool isStandard, string optionTicker)\n        {\n            var symbol = Symbol.Create(IndexOptionSymbol.MapToUnderlying(optionTicker), SecurityType.Index, Market.USA);\n            var option = Symbol.CreateOption(symbol, optionTicker, Market.USA, OptionStyle.European,\n                OptionRight.Call, 3700, new DateTime(2023, 1, expirationDate));\n\n            Assert.AreEqual(isStandard, IndexOptionSymbol.IsStandard(option));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/IndicatorVolatilityModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class IndicatorVolatilityModelTests\n    {\n        [Test]\n        public void UpdatesAfterCorrectPeriodElapses()\n        {\n            const int periods = 3;\n            var model = new IndicatorVolatilityModel(\n                new StandardDeviation(periods),\n                (s, d, i) => i.Update(d)\n            );\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n\n            var security = GetSecurity(reference, model);\n            for (var i = 0; i < periods; i++)\n            {\n                security.SetMarketPrice(new IndicatorDataPoint(reference.AddMinutes(i + 1), i + 1));\n            }\n\n            var expected = Math.Sqrt(2.0 / 3);\n            Assert.AreEqual(expected, model.Volatility);\n        }\n\n        [Test]\n        public void DoesntUpdateOnZeroPrice()\n        {\n            const int periods = 3;\n            var model = new IndicatorVolatilityModel(\n                new StandardDeviation(periods),\n                (s, d, i) =>\n                {\n                    if (s.Price > 0)\n                        i.Update(d);\n                }\n            );\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n\n            var security = GetSecurity(reference, model);\n            for (var i = 0; i < periods; i++)\n            {\n                security.SetMarketPrice(new IndicatorDataPoint(reference.AddMinutes(i + 1), i + 1));\n            }\n\n            var expected = Math.Sqrt(2.0 / 3);\n            Assert.AreEqual(expected, model.Volatility);\n\n            // update should not be applied as price is 0 since this condition is defined by indicatorUpdate\n            security.SetMarketPrice(new IndicatorDataPoint(reference.AddMinutes(3), 0m));\n            Assert.AreEqual(expected, model.Volatility);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorks()\n        {\n            const int periods = 3;\n            var model = new IndicatorVolatilityModel(\n                new StandardDeviation(periods),\n                (s, d, i) => i.Update(d)\n            );\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n\n            var security = GetSecurity(reference, model);\n\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow);\n            Assert.AreEqual(Enumerable.Empty<HistoryRequest>(), result);\n        }\n\n        private static Security GetSecurity(DateTime reference, IVolatilityModel model)\n        {\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            security.VolatilityModel = model;\n\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/LocalMarketHoursTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Globalization;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class LocalMarketHoursTests\n    {\n        private static readonly TimeSpan USEquityPreOpen = new TimeSpan(4, 0, 0);\n        private static readonly TimeSpan USEquityOpen = new TimeSpan(9, 30, 0);\n        private static readonly TimeSpan USEquityClose = new TimeSpan(16, 0, 0);\n        private static readonly TimeSpan USEquityPostClose = new TimeSpan(20, 0, 0);\n\n        [Test]\n        public void StartIsOpen()\n        {\n            var marketHours = GetUsEquityWeekDayMarketHours();\n\n            // EDT is +4 or +5 depending on time of year, in june it's +4, so this is 530 edt\n            Assert.IsTrue(marketHours.IsOpen(USEquityOpen, false));\n        }\n\n        [Test]\n        public void EndIsClosed()\n        {\n            var marketHours = GetUsEquityWeekDayMarketHours();\n\n            // EDT is +4 or +5 depending on time of year, in june it's +4, so this is 530 edt\n            Assert.IsFalse(marketHours.IsOpen(USEquityClose, false));\n        }\n\n        [Test]\n        public void IsOpenRangeAnyOverlap()\n        {\n            var marketHours = GetUsEquityWeekDayMarketHours();\n\n            // EDT is +4 or +5 depending on time of year, in june it's +4, so this is 530 edt\n            var startTime = new TimeSpan(9, 00, 0);\n            var endTime = new TimeSpan(10, 00, 0);\n            Assert.IsTrue(marketHours.IsOpen(startTime, endTime, false));\n        }\n\n        [Test]\n        public void MarketDurationDoesNotIncludePreOrPostMarket()\n        {\n            var marketHours = GetUsEquityWeekDayMarketHours();\n            Assert.AreEqual(TimeSpan.FromHours(6.5), marketHours.MarketDuration);\n        }\n\n        [TestCase(\"1.00:00:00\", null, false)]\n        [TestCase(null, \"00:00:00\", false)]\n\n        [TestCase(\"1.00:00:00\", \"00:00:00\", true)]\n        [TestCase(\"0.10:00:00\", \"10:00:00\", false)]\n        [TestCase(\"0.18:00:00\", \"00:00:00\", false)]\n        [TestCase(\"1.00:00:00\", \"00:01:00\", false)]\n        [TestCase(\"1.00:00:00\", \"10:00:00\", false)]\n        public void IsContinuousMarketOpenTests(string previousSegmentEndStr, string nextSegmentStartStr, bool expected)\n        {\n            TimeSpan? previousSegmentEnd = null;\n            TimeSpan? nextSegmentStart = null;\n            if (previousSegmentEndStr != null)\n            {\n                previousSegmentEnd = TimeSpan.ParseExact(previousSegmentEndStr, \"d\\\\.hh\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture);\n            }\n            if (nextSegmentStartStr != null)\n            {\n                nextSegmentStart = TimeSpan.ParseExact(nextSegmentStartStr, \"hh\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture);\n            }\n\n            Assert.AreEqual(expected, LocalMarketHours.IsContinuousMarketOpen(previousSegmentEnd, nextSegmentStart));\n        }\n\n        [TestCaseSource(nameof(GetMarketOpenTestCases))]\n        public void GetsCorrectMarketOpen(TimeSpan referenceTime, bool extendedMarket, TimeSpan prevDayLastSegmentEnd, TimeSpan? expectedMarketOpen)\n        {\n            var marketHours = GetFutureWeekDayMarketHours();\n\n            Assert.AreEqual(expectedMarketOpen, marketHours.GetMarketOpen(referenceTime, extendedMarket, prevDayLastSegmentEnd));\n        }\n\n        [TestCaseSource(nameof(GetMarketCloseTestCases))]\n        public void GetsCorrectMarketClose(TimeSpan referenceTime, bool extendedMarket, TimeSpan nextDayFirstSegmentStart, TimeSpan? expectedMarketClose)\n        {\n            var marketHours = GetFutureWeekDayMarketHours();\n\n            Assert.AreEqual(expectedMarketClose, marketHours.GetMarketClose(referenceTime, extendedMarket, nextDayFirstSegmentStart));\n        }\n\n        private static LocalMarketHours GetUsEquityWeekDayMarketHours()\n        {\n            return new LocalMarketHours(DayOfWeek.Friday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n        }\n\n        private static LocalMarketHours GetFutureWeekDayMarketHours()\n        {\n            return new LocalMarketHours(DayOfWeek.Monday, new MarketHoursSegment[]\n            {\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 0, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(1, 0, 0, 0))\n            });\n        }\n\n        private static TestCaseData[] GetMarketOpenTestCases()\n        {\n            return new[]\n            {\n                // Prev day last segment continues to current day\n                new TestCaseData(new TimeSpan(0, 0, 0), false, new TimeSpan(1, 0, 0, 0), new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), false, new TimeSpan(1, 0, 0, 0), new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, new TimeSpan(1, 0, 0, 0), null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, new TimeSpan(1, 0, 0, 0), null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, new TimeSpan(1, 0, 0, 0), null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, new TimeSpan(1, 0, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), true, new TimeSpan(1, 0, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, new TimeSpan(1, 0, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, new TimeSpan(1, 0, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, new TimeSpan(1, 0, 0, 0), new TimeSpan(17, 0, 0)),\n                // // Prev day last segment ends before end of prev day\n                new TestCaseData(new TimeSpan(0, 0, 0), false, new TimeSpan(17, 0, 0), new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), false, new TimeSpan(17, 0, 0), new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, new TimeSpan(17, 0, 0), null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, new TimeSpan(17, 0, 0), null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, new TimeSpan(17, 0, 0), null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, new TimeSpan(17, 0, 0), new TimeSpan(0, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), true, new TimeSpan(17, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, new TimeSpan(17, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, new TimeSpan(17, 0, 0), new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, new TimeSpan(17, 0, 0), new TimeSpan(17, 0, 0)),\n                // // No prev day last segment\n                new TestCaseData(new TimeSpan(0, 0, 0), false, null, new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), false, null, new TimeSpan(8, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, null, new TimeSpan(0, 0, 0)),\n                new TestCaseData(new TimeSpan(8, 0, 0), true, null, new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, null, new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, null, new TimeSpan(17, 0, 0)),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, null, new TimeSpan(17, 0, 0)),\n            };\n        }\n\n        private static TestCaseData[] GetMarketCloseTestCases()\n        {\n            return new[]\n            {\n                // Next day's first segment continues from current day's last segment (see GetFutureWeekDayMarketHours, the last segment ends\n                // with 1.00:00:00, so starting next day at 00:00:00, it means the segments are continouous)\n                new TestCaseData(new TimeSpan(0, 0, 0), false, new TimeSpan(0, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), false, new TimeSpan(0, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(20, 0, 0), false, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, new TimeSpan(0, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), true, new TimeSpan(0, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, new TimeSpan(0, 0, 0), null),\n                new TestCaseData(new TimeSpan(20, 0, 0), true, new TimeSpan(0, 0, 0), null),\n                // Next day's first segment starts after midnight\n                new TestCaseData(new TimeSpan(0, 0, 0), false, new TimeSpan(18, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), false, new TimeSpan(18, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, new TimeSpan(18, 0, 0), null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, new TimeSpan(18, 0, 0), null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, new TimeSpan(18, 0, 0), null),\n                new TestCaseData(new TimeSpan(20, 0, 0), false, new TimeSpan(18, 0, 0), null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0)),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0)),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0)),\n                new TestCaseData(new TimeSpan(20, 0, 0), true, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0)),\n                // No next day's first segment\n                new TestCaseData(new TimeSpan(0, 0, 0), false, null, new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), false, null, new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(17, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(18, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(20, 0, 0), false, null, null),\n                new TestCaseData(new TimeSpan(0, 0, 0), true, null, new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(12, 0, 0), true, null, new TimeSpan(16, 0, 0)),\n                new TestCaseData(new TimeSpan(16, 0, 0), true, null, null),\n                new TestCaseData(new TimeSpan(17, 0, 0), true, null, null),\n                new TestCaseData(new TimeSpan(18, 0, 0), true, null, null),\n                new TestCaseData(new TimeSpan(20, 0, 0), true, null, null),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/MarginCallModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class MarginCallModelTests\n    {\n        // Test class to enable calling protected methods\n        public class TestSecurityMarginModel : SecurityMarginModel\n        {\n            public TestSecurityMarginModel(decimal leverage) : base(leverage) {}\n\n            public new decimal GetInitialMarginRequiredForOrder(\n                InitialMarginRequiredForOrderParameters parameters)\n            {\n                return base.GetInitialMarginRequiredForOrder(parameters).Value;\n            }\n\n            public new decimal GetMarginRemaining(SecurityPortfolioManager portfolio, Security security, OrderDirection direction)\n            {\n                return base.GetMarginRemaining(portfolio, security, direction);\n            }\n        }\n\n        [Test]\n        public void InitializationTest()\n        {\n            const decimal actual = 2;\n            var security = GetSecurity(Symbols.AAPL);\n            security.BuyingPowerModel = new SecurityMarginModel(actual);\n            var expected = security.Leverage;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void SetAndGetLeverageTest()\n        {\n            var security = GetSecurity(Symbols.AAPL);\n            security.BuyingPowerModel = new SecurityMarginModel(2);\n\n            const decimal actual = 50;\n            security.SetLeverage(actual);\n            var expected = security.Leverage;\n\n            Assert.AreEqual(expected, actual);\n\n            expected = security.BuyingPowerModel.GetLeverage(security);\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void GetInitialMarginRequiredForOrderTest()\n        {\n            var security = GetSecurity(Symbols.AAPL);\n            var buyingPowerModel = new TestSecurityMarginModel(2);\n            security.BuyingPowerModel = buyingPowerModel;\n            var order = new MarketOrder(security.Symbol, 100, DateTime.Now);\n            var actual = buyingPowerModel.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order));\n\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void GetMaintenanceMarginTest()\n        {\n            const int quantity = 1000;\n            const decimal leverage = 2;\n            var expected = quantity / leverage;\n\n            var security = GetSecurity(Symbols.AAPL);\n            security.BuyingPowerModel = new SecurityMarginModel(leverage);\n            security.Holdings.SetHoldings(1m, quantity);\n            // current value is used to determine reserved buying power\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = 1,\n                High = 1,\n                Low = 1,\n                Close = 1\n            });\n            var actual = security.BuyingPowerModel.GetReservedBuyingPowerForPosition(security);\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void GetMarginRemainingTests()\n        {\n            const int quantity = 1000;\n            const decimal leverage = 2;\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, cash:1000);\n\n            var security = GetSecurity(Symbols.AAPL);\n            var buyingPowerModel = new TestSecurityMarginModel(leverage);\n            security.BuyingPowerModel = buyingPowerModel;\n            portfolio.Securities.Add(security);\n\n            // we buy $1000 worth of shares\n            security.Holdings.SetHoldings(1m, quantity);\n            portfolio.SetCash(0);\n\n            // current value is used to determine reserved buying power\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = 1,\n                High = 1,\n                Low = 1,\n                Close = 1\n            });\n            var actual1 = buyingPowerModel.GetMarginRemaining(portfolio, security, OrderDirection.Buy);\n            Assert.AreEqual(quantity / leverage, actual1);\n\n            var actual2 = buyingPowerModel.GetMarginRemaining(portfolio, security, OrderDirection.Sell);\n            Assert.AreEqual(quantity + quantity / leverage, actual2);\n\n            security.Holdings.SetHoldings(1m, -quantity);\n            var actual3 = buyingPowerModel.GetMarginRemaining(portfolio, security, OrderDirection.Sell);\n            Assert.AreEqual(quantity / leverage, actual3);\n\n            var actual4 = buyingPowerModel.GetMarginRemaining(portfolio, security, OrderDirection.Buy);\n            Assert.AreEqual(quantity + quantity / leverage, actual4);\n        }\n\n        /// <summary>\n        /// Test GenerateMarginCallOrder with SecurityPortfolioManager.ScanForMarginCall\n        /// to comprehensively test margin call dynamics\n        /// </summary>\n        [Test]\n        public void GenerateMarginCallOrderTests()\n        {\n            const int quantity = 1000;\n            const decimal leverage = 1m;\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, quantity);\n            portfolio.MarginCallModel = new DefaultMarginCallModel(portfolio, null);\n\n            var security = GetSecurity(Symbols.AAPL);\n            portfolio.Securities.Add(security);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new Tick(time, Symbols.AAPL, buyPrice, buyPrice));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) {Price = buyPrice};\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n                { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled};\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            Assert.AreEqual(portfolio.Cash, fill.FillPrice*fill.FillQuantity);\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity, portfolio.TotalPortfolioValue);\n\n            // we shouldn't be able to place a trader\n            var newOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) {Price = buyPrice};\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // now the stock doubles, so we should have margin remaining\n            time = time.AddDays(1);\n            const decimal highPrice = buyPrice * 2;\n            security.SetMarketPrice(new Tick(time, Symbols.AAPL, highPrice, highPrice));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            // leverage is 1 we shouldn't have more margin remaining\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity * 2, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity * 2, portfolio.TotalPortfolioValue);\n\n            // we shouldn't be able to place a trader\n            var anotherOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = highPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, anotherOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // now the stock plummets, leverage is 1 we shouldn't have more margin remaining\n            time = time.AddDays(1);\n            const decimal lowPrice = buyPrice/2;\n            security.SetMarketPrice(new Tick(time, Symbols.AAPL, lowPrice, lowPrice));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity/2m, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity/2m, portfolio.TotalPortfolioValue);\n\n            // this would not cause a margin call due to leverage = 1\n            bool issueMarginCallWarning;\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsFalse(issueMarginCallWarning);\n            Assert.AreEqual(0, marginCallOrders.Count);\n\n            // now change the leverage to test margin call warning and margin call logic\n            security.SetLeverage(leverage * 2);\n            // simulate a loan - when we fill using leverage it will set a negative cash amount\n            portfolio.CashBook[Currencies.USD].SetAmount(-250);\n\n            // Stock price increase by minimum variation\n            const decimal newPrice = lowPrice + 0.01m;\n            security.SetMarketPrice(new Tick(time, Symbols.AAPL, newPrice, newPrice));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            // this would not cause a margin call, only a margin call warning\n            marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsTrue(issueMarginCallWarning);\n            Assert.AreEqual(0, marginCallOrders.Count);\n\n            // Price drops again to previous low, margin call orders will be issued\n            security.SetMarketPrice(new Tick(time, Symbols.AAPL, lowPrice, lowPrice));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n                { FillPrice = buyPrice, FillQuantity = quantity };\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(-250, portfolio.TotalPortfolioValue);\n\n            marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsTrue(issueMarginCallWarning);\n            Assert.AreEqual(1, marginCallOrders.Count);\n        }\n\n        [Test]\n        public void GenerateMarginCallOrdersForPositionGroup()\n        {\n            const int cash = 22000;\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, cash);\n            portfolio.MarginCallModel = new DefaultMarginCallModel(portfolio, null, 0m);\n\n            var underlying = GetSecurity(Symbols.SPY);\n            var callOption = GetOption(Symbols.SPY_C_192_Feb19_2016);\n            var putOption = GetOption(Symbols.SPY_P_192_Feb19_2016);\n            callOption.Underlying = underlying;\n            putOption.Underlying = underlying;\n\n            portfolio.Securities.Add(underlying);\n            portfolio.Securities.Add(callOption);\n            portfolio.Securities.Add(putOption);\n\n            var time = DateTime.Now;\n            const decimal underlyingPrice = 100m;\n            const decimal callOptionPrice = 1m;\n            const decimal putOptionPrice = 1m;\n            underlying.SetMarketPrice(new Tick(time, underlying.Symbol, underlyingPrice, underlyingPrice));\n            callOption.SetMarketPrice(new Tick(time, callOption.Symbol, callOptionPrice, callOptionPrice));\n            putOption.SetMarketPrice(new Tick(time, putOption.Symbol, putOptionPrice, putOptionPrice));\n\n            var groupOrderManager = new GroupOrderManager(1, 2, -10);\n            var callOptionOrder = new ComboMarketOrder(callOption.Symbol, -10, time, groupOrderManager) { Price = callOptionPrice };\n            var putOptionOrder = new ComboMarketOrder(putOption.Symbol, -10, time, groupOrderManager) { Price = putOptionPrice };\n\n            var callOptionOrderFill = new OrderEvent(callOptionOrder, DateTime.UtcNow, OrderFee.Zero)\n            {\n                FillPrice = callOptionOrder.Price,\n                FillQuantity = callOptionOrder.Quantity,\n                Status = OrderStatus.Filled\n            };\n            var putOptionOrderFill = new OrderEvent(putOptionOrder, DateTime.UtcNow, OrderFee.Zero)\n            {\n                FillPrice = putOptionOrder.Price,\n                FillQuantity = putOptionOrder.Quantity,\n                Status = OrderStatus.Filled\n            };\n\n            orderProcessor.AddOrder(callOptionOrder);\n            orderProcessor.AddOrder(putOptionOrder);\n\n            var callOptionRequest = new SubmitOrderRequest(\n                OrderType.ComboMarket,\n                callOption.Type,\n                callOption.Symbol,\n                callOptionOrder.Quantity,\n                0,\n                0,\n                callOptionOrder.Time,\n                \"\",\n                groupOrderManager: groupOrderManager);\n            var putOptionRequest = new SubmitOrderRequest(\n                OrderType.ComboMarket,\n                putOption.Type,\n                putOption.Symbol,\n                putOptionOrder.Quantity,\n                0,\n                0,\n                putOptionOrder.Time,\n                \"\",\n                groupOrderManager: groupOrderManager);\n\n            callOptionRequest.SetOrderId(1);\n            putOptionRequest.SetOrderId(2);\n\n            groupOrderManager.OrderIds.Add(1);\n            groupOrderManager.OrderIds.Add(2);\n\n            callOptionOrderFill.Ticket = new OrderTicket(null, callOptionRequest);\n            orderProcessor.AddTicket(callOptionOrderFill.Ticket);\n            putOptionOrderFill.Ticket = new OrderTicket(null, putOptionRequest);\n            orderProcessor.AddTicket(putOptionOrderFill.Ticket);\n\n            portfolio.ProcessFills(new List<OrderEvent> { callOptionOrderFill, putOptionOrderFill });\n\n            // Simulate options price increase so the remaining margin goes below zero\n            callOption.SetMarketPrice(new Tick(time.AddMinutes(1), callOption.Symbol, callOptionPrice * 1.2m, callOptionPrice * 1.2m));\n            putOption.SetMarketPrice(new Tick(time.AddMinutes(1), putOption.Symbol, putOptionPrice * 1.2m, putOptionPrice * 1.2m));\n\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out var issueMarginCallWarning);\n            Assert.IsTrue(issueMarginCallWarning);\n            Assert.AreEqual(2, marginCallOrders.Count);\n        }\n\n        private SecurityPortfolioManager GetPortfolio(IOrderProcessor orderProcessor, int cash)\n        {\n            var securities = new SecurityManager(new TimeKeeper(DateTime.Now, new[] { TimeZones.NewYork }));\n            var transactions = new SecurityTransactionManager(null, securities);\n            transactions.SetOrderProcessor(orderProcessor);\n\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(cash);\n\n            return portfolio;\n        }\n\n        private Security GetSecurity(Symbol symbol)\n        {\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private Option GetOption(Symbol symbol)\n        {\n            return new Option(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    true\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(\"\", Currencies.USD, 100, 0.01m, 1),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/MarketHoursDatabaseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class MarketHoursDatabaseTests\n    {\n        [SetUp]\n        public void Setup()\n        {\n            MarketHoursDatabase.Reset();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            MarketHoursDatabase.Reset();\n        }\n\n        [Test]\n        public void InitializesFromFile()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            Assert.AreEqual(3, exchangeHours.ExchangeHoursListing.Count);\n        }\n\n        [Test]\n        public void RetrievesExchangeHoursWithAndWithoutSymbol()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var hours = exchangeHours.GetExchangeHours(Market.USA, Symbols.SPY, SecurityType.Equity);\n            Assert.IsNotNull(hours);\n\n            Assert.AreEqual(hours, exchangeHours.GetExchangeHours(Market.USA, null, SecurityType.Equity));\n        }\n\n        [Test]\n        public void CorrectlyReadsClosedAllDayHours()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var hours = exchangeHours.GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            Assert.IsNotNull(hours);\n\n            Assert.IsTrue(hours.MarketHours[DayOfWeek.Saturday].IsClosedAllDay);\n        }\n\n        [Test]\n        public void CorrectlyReadsOpenAllDayHours()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var hours = exchangeHours.GetExchangeHours(Market.FXCM, null, SecurityType.Forex);\n            Assert.IsNotNull(hours);\n\n            Assert.IsTrue(hours.MarketHours[DayOfWeek.Monday].IsOpenAllDay);\n        }\n\n        [Test]\n        public void InitializesFromDataFolder()\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            Assert.AreNotEqual(0, provider.ExchangeHoursListing.Count);\n        }\n\n        [Test]\n        public void CorrectlyReadsUsEquityMarketHours()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var equityHours = exchangeHours.GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            foreach (var day in equityHours.MarketHours.Keys)\n            {\n                var marketHours = equityHours.MarketHours[day];\n                if (day == DayOfWeek.Saturday || day == DayOfWeek.Sunday)\n                {\n                    Assert.IsTrue(marketHours.IsClosedAllDay);\n                    continue;\n                }\n                Assert.AreEqual(new TimeSpan(4, 0, 0), marketHours.GetMarketOpen(TimeSpan.Zero, true));\n                Assert.AreEqual(new TimeSpan(9, 30, 0), marketHours.GetMarketOpen(TimeSpan.Zero, false));\n                Assert.AreEqual(new TimeSpan(16, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, false));\n                Assert.AreEqual(new TimeSpan(20, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, true));\n            }\n        }\n\n        [Test]\n        public void CorrectlyReadsUsEquityEarlyCloses()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var equityHours = exchangeHours.GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            Assert.AreNotEqual(0, equityHours.EarlyCloses.Count);\n\n            var date = new DateTime(2016, 11, 25);\n            var earlyCloseTime = new TimeSpan(13, 0, 0);\n            Assert.AreEqual(earlyCloseTime, equityHours.EarlyCloses[date]);\n        }\n\n        [TestCase(\"AUP\", Market.COMEX, true)]\n        [TestCase(\"AA6\", Market.NYMEX, true)]\n        [TestCase(\"6A\", Market.CME, false)]\n        [TestCase(\"30Y\", Market.CBOT, false)]\n        [TestCase(\"HE\", Market.CME, true)]\n        [TestCase(\"AW\", Market.CBOT, true)]\n        [TestCase(\"HE\", Market.CME, true)]\n        [TestCase(\"AW\", Market.CBOT, true)]\n        [TestCase(\"LE\", Market.CME, true)]\n        [TestCase(\"BCF\", Market.CBOT, true)]\n        [TestCase(\"GD\", Market.CME, true)]\n        [TestCase(\"BWF\", Market.CBOT, true)]\n        [TestCase(\"CSC\", Market.CME, true)]\n        [TestCase(\"GNF\", Market.CME, true)]\n        [TestCase(\"GDK\", Market.CME, true)]\n        public void CorrectlyReadsCMEGroupFutureHolidayGoodFridaySchedule(string futureTicker, string market, bool isHoliday)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var ticker = OptionSymbol.MapToUnderlying(futureTicker, SecurityType.Future);\n            var future = Symbol.Create(ticker, SecurityType.Future, market);\n\n            var futureEntry = provider.GetEntry(market, ticker, future.SecurityType);\n            var holidays = futureEntry.ExchangeHours.Holidays;\n            var holidayDate = DateTime.Parse(\"4/7/2023\", CultureInfo.InvariantCulture);\n            Assert.AreEqual(isHoliday, holidays.Contains(holidayDate));\n        }\n\n        [TestCase(\"2YY\", Market.CBOT, \"4/7/2023\", true)]\n        [TestCase(\"TN\", Market.CBOT, \"4/7/2023\", true)]\n        [TestCase(\"6A\", Market.CME, \"4/7/2023\", true)]\n        [TestCase(\"6Z\", Market.CME, \"4/7/2023\", true)]\n        [TestCase(\"M6A\", Market.CME, \"4/7/2023\", true)]\n        [TestCase(\"MCD\", Market.CME, \"4/7/2023\", true)]\n        [TestCase(\"AW\", Market.CBOT, \"4/6/2023\", false)]\n        [TestCase(\"BCF\", Market.CBOT, \"4/6/2023\", false)]\n        [TestCase(\"BWF\", Market.CBOT, \"4/6/2023\", false)]\n        [TestCase(\"ZC\", Market.CBOT, \"4/6/2023\", false)]\n        [TestCase(\"DC\", Market.CME, \"4/7/2023\", false)]\n        [TestCase(\"DY\", Market.CME, \"4/7/2023\", false)]\n        [TestCase(\"GNF\", Market.CME, \"4/6/2023\", true)]\n        [TestCase(\"GDK\", Market.CME, \"4/6/2023\", true)]\n        public void CorrectlyReadsCMEGroupFutureEarlyCloses(string futureTicker, string market, string date, bool isEarlyClose)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var ticker = OptionSymbol.MapToUnderlying(futureTicker, SecurityType.Future);\n            var future = Symbol.Create(ticker, SecurityType.Future, market);\n\n            var futureEntry = provider.GetEntry(market, ticker, future.SecurityType);\n            var earlyCloses = futureEntry.ExchangeHours.EarlyCloses;\n            var earlyCloseDate = DateTime.Parse(date, CultureInfo.InvariantCulture);\n            Assert.AreEqual(isEarlyClose, earlyCloses.Keys.Contains(earlyCloseDate));\n            if (isEarlyClose)\n            {\n                var holidays = futureEntry.ExchangeHours.Holidays;\n                Assert.IsFalse(holidays.Contains(earlyCloseDate));\n            }\n        }\n\n        [TestCase(\"BIO\", Market.CME, true)]\n        [TestCase(\"5YY\", Market.CBOT, true)]\n        [TestCase(\"6E\", Market.CME, true)]\n        [TestCase(\"BTC\", Market.CME, true)]\n        [TestCase(\"A8O\", Market.NYMEX, true)]\n        [TestCase(\"PAM\", Market.NYMEX, true)]\n        [TestCase(\"ZC\", Market.CBOT, false)]\n        [TestCase(\"LBR\", Market.CME, false)]\n        [TestCase(\"HE\", Market.CME, false)]\n        [TestCase(\"DY\", Market.CME, false)]\n        [TestCase(\"YO\", Market.NYMEX, true)]\n        public void CorrectlyReadsCMEGroupFutureBankHolidays(string futureTicker, string market, bool isBankHoliday)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var future = Symbol.Create(futureTicker, SecurityType.Future, market);\n\n            var futureEntry = provider.GetEntry(market, future, future.SecurityType);\n            var bankHolidays = futureEntry.ExchangeHours.BankHolidays;\n            var bankHoliday = new DateTime(2025, 11, 27);\n            Assert.AreEqual(isBankHoliday, bankHolidays.Contains(bankHoliday));\n            Assert.AreEqual(isBankHoliday, futureEntry.ExchangeHours.IsDateOpen(bankHoliday, extendedMarketHours: true));\n        }\n\n        [TestCase(\"2YY\", Market.CBOT, true)]\n        [TestCase(\"TN\", Market.CBOT, true)]\n        [TestCase(\"6A\", Market.CME, true)]\n        [TestCase(\"6Z\", Market.CME, true)]\n        [TestCase(\"M6A\", Market.CME, true)]\n        [TestCase(\"MCD\", Market.CME, true)]\n        [TestCase(\"AW\", Market.CBOT, false)]\n        [TestCase(\"BCF\", Market.CBOT, false)]\n        [TestCase(\"BWF\", Market.CBOT, false)]\n        [TestCase(\"ZC\", Market.CBOT, false)]\n        [TestCase(\"DC\", Market.CME, false)]\n        [TestCase(\"DY\", Market.CME, false)]\n        [TestCase(\"GNF\", Market.CME, false)]\n        [TestCase(\"GDK\", Market.CME, false)]\n        public void CheckJustEarlyClosesOrJustHolidaysForCMEGroupFuturesOnGoodFriday(string futureTicker, string market, bool isEarlyClose)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var ticker = OptionSymbol.MapToUnderlying(futureTicker, SecurityType.Future);\n            var future = Symbol.Create(ticker, SecurityType.Future, market);\n\n            var futureEntry = provider.GetEntry(market, ticker, future.SecurityType);\n            var earlyCloses = futureEntry.ExchangeHours.EarlyCloses;\n            var holidays = futureEntry.ExchangeHours.Holidays;\n\n            var goodFriday = DateTime.Parse(\"4/7/2023\", CultureInfo.InvariantCulture);\n\n            Assert.AreEqual(isEarlyClose, earlyCloses.Keys.Contains(goodFriday));\n            Assert.AreEqual(!isEarlyClose, holidays.Contains(goodFriday));\n        }\n\n        [TestCase(\"ES\", Market.CME)]\n        [TestCase(\"30Y\", Market.CBOT)]\n        [TestCase(\"M6B\", Market.CME)]\n        [TestCase(\"BTC\", Market.CME)]\n        [TestCase(\"ABT\", Market.NYMEX)]\n        [TestCase(\"AUP\", Market.COMEX)]\n        public void EarlyClosesResumesAgainIfLateOpen(string futureTicker, string market)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var ticker = OptionSymbol.MapToUnderlying(futureTicker, SecurityType.Future);\n            var future = Symbol.Create(ticker, SecurityType.Future, market);\n\n            var futureEntry = provider.GetEntry(market, ticker, future.SecurityType);\n            var earlyCloseDate = DateTime.Parse(\"9/4/2023\", CultureInfo.InvariantCulture);\n            var earlyCloseHour = futureEntry.ExchangeHours.EarlyCloses[earlyCloseDate];\n            var lateOpenHour = futureEntry.ExchangeHours.LateOpens[earlyCloseDate];\n\n            Assert.AreEqual(earlyCloseHour, futureEntry.ExchangeHours.GetMarketHours(earlyCloseDate).GetMarketClose(new TimeSpan(0, 0, 0), true));\n            Assert.AreEqual(lateOpenHour, futureEntry.ExchangeHours.GetMarketHours(earlyCloseDate).GetMarketOpen(earlyCloseHour, true));\n        }\n\n        [Test]\n        public void CorrectlyReadFxcmForexMarketHours()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var exchangeHours = GetMarketHoursDatabase(file);\n\n            var equityHours = exchangeHours.GetExchangeHours(Market.FXCM, null, SecurityType.Forex);\n            foreach (var day in equityHours.MarketHours.Keys)\n            {\n                var marketHours = equityHours.MarketHours[day];\n                if (day == DayOfWeek.Saturday)\n                {\n                    Assert.IsTrue(marketHours.IsClosedAllDay);\n                }\n                else if (day != DayOfWeek.Sunday && day != DayOfWeek.Friday)\n                {\n                    Assert.IsTrue(marketHours.IsOpenAllDay);\n                }\n                else if (day == DayOfWeek.Sunday)\n                {\n                    Assert.AreEqual(new TimeSpan(17, 0, 0), marketHours.GetMarketOpen(TimeSpan.Zero, true));\n                    Assert.AreEqual(new TimeSpan(17, 0, 0), marketHours.GetMarketOpen(TimeSpan.Zero, false));\n                    Assert.AreEqual(new TimeSpan(24, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, false));\n                    Assert.AreEqual(new TimeSpan(24, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, true));\n                }\n                else\n                {\n                    Assert.AreEqual(new TimeSpan(0, 0, 0), marketHours.GetMarketOpen(TimeSpan.Zero, true));\n                    Assert.AreEqual(new TimeSpan(0, 0, 0), marketHours.GetMarketOpen(TimeSpan.Zero, false));\n                    Assert.AreEqual(new TimeSpan(17, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, false));\n                    Assert.AreEqual(new TimeSpan(17, 0, 0), marketHours.GetMarketClose(TimeSpan.Zero, true));\n                }\n            }\n        }\n\n        [Test]\n        public void ReadsUsEquityDataTimeZone()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var marketHoursDatabase = GetMarketHoursDatabase(file);\n\n            Assert.AreEqual(TimeZones.NewYork, marketHoursDatabase.GetDataTimeZone(Market.USA, null, SecurityType.Equity));\n        }\n\n        [Test]\n        public void AllMarketsAreAlwaysOpenWhenForceExchangeAlwaysOpenIsTrue()\n        {\n            var originalConfigValue = Config.Get(\"force-exchange-always-open\");\n            // Force all exchanges to be treated as always open, regardless of their actual hours\n            Config.Set(\"force-exchange-always-open\", \"true\");\n\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var marketHoursDatabase = GetMarketHoursDatabase(file);\n\n            foreach (var entry in marketHoursDatabase.ExchangeHoursListing)\n            {\n                var key = entry.Key;\n                var exchangeHours = marketHoursDatabase.GetExchangeHours(key.Market, key.Symbol, key.SecurityType);\n\n                // Assert that the market is considered always open under this configuration\n                Assert.IsTrue(exchangeHours.IsMarketAlwaysOpen);\n            }\n\n            // Restore original config value after test\n            Config.Set(\"force-exchange-always-open\", originalConfigValue);\n        }\n\n        [Test]\n        public void ReadsFxcmForexDataTimeZone()\n        {\n            string file = Path.Combine(\"TestData\", \"SampleMarketHoursDatabase.json\");\n            var marketHoursDatabase = GetMarketHoursDatabase(file);\n\n            Assert.AreEqual(TimeZones.EasternStandard, marketHoursDatabase.GetDataTimeZone(Market.FXCM, null, SecurityType.Forex));\n        }\n\n        [TestCase(\"SPX\", SecurityType.Index, Market.USA)]\n        [TestCase(\"SPXW\", SecurityType.Index, Market.USA)]\n        [TestCase(\"AAPL\", SecurityType.Equity, Market.USA)]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA)]\n\n        [TestCase(\"GC\", SecurityType.Future, Market.COMEX)]\n        [TestCase(\"SI\", SecurityType.Future, Market.COMEX)]\n        [TestCase(\"HG\", SecurityType.Future, Market.COMEX)]\n        [TestCase(\"ES\", SecurityType.Future, Market.CME)]\n        [TestCase(\"NQ\", SecurityType.Future, Market.CME)]\n        [TestCase(\"CL\", SecurityType.Future, Market.NYMEX)]\n        [TestCase(\"NG\", SecurityType.Future, Market.NYMEX)]\n        [TestCase(\"ZB\", SecurityType.Future, Market.CBOT)]\n        [TestCase(\"ZC\", SecurityType.Future, Market.CBOT)]\n        [TestCase(\"ZS\", SecurityType.Future, Market.CBOT)]\n        [TestCase(\"ZT\", SecurityType.Future, Market.CBOT)]\n        [TestCase(\"ZW\", SecurityType.Future, Market.CBOT)]\n        public void MissingOptionsEntriesResolveToUnderlyingMarketHours(string optionTicker, SecurityType securityType, string market)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var underlyingTIcker = OptionSymbol.MapToUnderlying(optionTicker, securityType);\n            var underlying = Symbol.Create(underlyingTIcker, securityType, market);\n            var option = Symbol.CreateOption(\n                underlying,\n                market,\n                default,\n                default,\n                default,\n                SecurityIdentifier.DefaultDate);\n\n            var underlyingEntry = provider.GetEntry(market, underlying, underlying.SecurityType);\n            var optionEntry = provider.GetEntry(market, option, option.SecurityType);\n\n            if (securityType == SecurityType.Future)\n            {\n                Assert.AreEqual(underlyingEntry, optionEntry);\n            }\n            else\n            {\n                Assert.AreEqual(underlyingEntry.ExchangeHours.Holidays, optionEntry.ExchangeHours.Holidays);\n                Assert.AreEqual(underlyingEntry.ExchangeHours.LateOpens, optionEntry.ExchangeHours.LateOpens);\n                Assert.AreEqual(underlyingEntry.ExchangeHours.EarlyCloses, optionEntry.ExchangeHours.EarlyCloses);\n            }\n        }\n\n        [TestCase(\"SPX\")]\n        [TestCase(\"NDX\")]\n        [TestCase(\"VIX\")]\n        public void USIndexOptionsResolveToUnderlyingEarlyCloses(string optionTicker)\n        {\n            var provider = MarketHoursDatabase.FromDataFolder();\n            var underlyingTicker = OptionSymbol.MapToUnderlying(optionTicker, SecurityType.Index);\n            var underlying = Symbol.Create(underlyingTicker, SecurityType.Index, Market.USA);\n            var option = Symbol.CreateOption(\n                underlying,\n                Market.USA,\n                default,\n                default,\n                default,\n                SecurityIdentifier.DefaultDate);\n\n            var underlyingEntry = provider.GetEntry(Market.USA, underlying, underlying.SecurityType);\n            var optionEntry = provider.GetEntry(Market.USA, option, option.SecurityType);\n            Assert.AreEqual(underlyingEntry.ExchangeHours.EarlyCloses, optionEntry.ExchangeHours.EarlyCloses);\n        }\n\n        [TestCase(\"GC\", Market.COMEX, \"OG\")]\n        [TestCase(\"SI\", Market.COMEX, \"SO\")]\n        [TestCase(\"HG\", Market.COMEX, \"HXE\")]\n        [TestCase(\"ES\", Market.CME, \"ES\")]\n        [TestCase(\"NQ\", Market.CME, \"NQ\")]\n        [TestCase(\"CL\", Market.NYMEX, \"LO\")]\n        [TestCase(\"NG\", Market.NYMEX, \"ON\")]\n        [TestCase(\"ZB\", Market.CBOT, \"OZB\")]\n        [TestCase(\"ZC\", Market.CBOT, \"OZC\")]\n        [TestCase(\"ZS\", Market.CBOT, \"OZS\")]\n        [TestCase(\"ZT\", Market.CBOT, \"OZT\")]\n        [TestCase(\"ZW\", Market.CBOT, \"OZW\")]\n        public void FuturesOptionsGetDatabaseSymbolKey(string ticker, string market, string expected)\n        {\n            var future = Symbol.Create(ticker, SecurityType.Future, market);\n            var option = Symbol.CreateOption(\n                future,\n                market,\n                default(OptionStyle),\n                default(OptionRight),\n                default(decimal),\n                SecurityIdentifier.DefaultDate);\n\n            Assert.AreEqual(expected, MarketHoursDatabase.GetDatabaseSymbolKey(option));\n        }\n\n        [Test]\n        public void CustomEntriesStoredAndFetched()\n        {\n            var database = MarketHoursDatabase.FromDataFolder();\n            var ticker = \"BTC\";\n            var hours = SecurityExchangeHours.AlwaysOpen(TimeZones.Berlin);\n            var entry = database.SetEntry(Market.USA, ticker, SecurityType.Base, hours);\n\n            // Assert our hours match the result\n            Assert.AreEqual(hours, entry.ExchangeHours);\n\n            // Fetch the entry to ensure we can access it with the ticker\n            var fetchedEntry = database.GetEntry(Market.USA, ticker, SecurityType.Base);\n            Assert.AreSame(entry, fetchedEntry);\n        }\n\n        [TestCase(\"UWU\", SecurityType.Base)]\n        [TestCase(\"SPX\", SecurityType.Index)]\n        public void CustomEntriesAreNotLostWhenReset(string ticker, SecurityType securityType)\n        {\n            var database = MarketHoursDatabase.FromDataFolder();\n            var hours = SecurityExchangeHours.AlwaysOpen(TimeZones.Chicago);\n            var entry = database.SetEntry(Market.USA, ticker, securityType, hours);\n\n            MarketHoursDatabase.Entry returnedEntry;\n            Assert.IsTrue(database.TryGetEntry(Market.USA, ticker, securityType, out returnedEntry));\n            Assert.AreEqual(returnedEntry, entry);\n            Assert.DoesNotThrow(() => database.UpdateDataFolderDatabase());\n            Assert.IsTrue(database.TryGetEntry(Market.USA, ticker, securityType, out returnedEntry));\n            Assert.AreEqual(returnedEntry, entry);\n        }\n\n        [Test]\n        public void VerifyMarketHoursDataIntegrityForAllSymbols()\n        {\n            // Load the market hours database\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            // Test all specific entries in parallel\n            Parallel.ForEach(marketHoursDatabase.ExchangeHoursListing, entry =>\n            {\n                var securityType = entry.Key.SecurityType;\n                var ticker = entry.Key.Symbol;\n                Assert.IsFalse(string.IsNullOrEmpty(ticker), $\"Ticker is null or empty\");\n                var market = entry.Key.Market;\n\n                // Create symbol\n                Symbol symbol;\n                if (ticker.Contains(\"[*]\") || ticker == \"*\")\n                {\n                    symbol = Symbol.Create(\"TEST_SYMBOL\", securityType, market);\n                }\n                else\n                {\n                    symbol = Symbol.Create(ticker, securityType, market);\n                }\n\n                TestMarketHoursForSymbol(marketHoursDatabase, market, symbol, securityType);\n            });\n        }\n\n        private static void TestMarketHoursForSymbol(MarketHoursDatabase marketHoursDatabase, string market, Symbol symbol, SecurityType securityType)\n        {\n            // Define date range (1998-01-01 to today, checking daily)\n            var startDate = new DateTime(1998, 1, 1);\n            var endDate = DateTime.Now;\n\n            var exchangeHours = marketHoursDatabase.GetExchangeHours(market, symbol, securityType);\n\n            // Check every day\n            for (var date = startDate; date <= endDate; date = date.AddDays(1))\n            {\n                // Get market hours for this date\n                var marketHours = exchangeHours.GetMarketHours(date);\n\n                // Ensure market hours exist for the date\n                Assert.IsNotNull(exchangeHours, \"Exchange hours should not be null.\");\n\n                var segments = marketHours.Segments;\n                for (int i = 1; i < segments.Count; i++)\n                {\n                    // Ensure segments do not overlap\n                    Assert.LessOrEqual(segments[i - 1].End, segments[i].Start,\n                        $\"Segments overlap for {symbol} on {date:yyyy-MM-dd} between {segments[i - 1]} and {segments[i]}\");\n                }\n\n                bool hasEarlyClose = exchangeHours.EarlyCloses.TryGetValue(date, out var earlyCloseTime);\n                bool hasLateOpen = exchangeHours.LateOpens.TryGetValue(date, out var lateOpenTime);\n                if (hasEarlyClose && hasLateOpen && segments.Count > 0)\n                {\n                    // Ensure LateOpen time is not after market close, but only when there is an EarlyClose\n                    Assert.LessOrEqual(lateOpenTime, segments[^1].End,\n                        $\"Late open time {lateOpenTime} is after market close {segments[^1].End} for {symbol} on {date:yyyy-MM-dd}\");\n                }\n\n                if (exchangeHours.Holidays.Contains(date))\n                {\n                    // Ensure market is fully closed on holidays\n                    Assert.IsTrue(marketHours.IsClosedAllDay,\n                        $\"Market should be fully closed on holiday {date:yyyy-MM-dd} for {symbol}\");\n                }\n            }\n        }\n\n        private static MarketHoursDatabase GetMarketHoursDatabase(string file)\n        {\n            return MarketHoursDatabase.FromFile(file);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/OptionFilterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Index;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class OptionFilterTests\n    {\n\n        [TestCaseSource(nameof(FiltersStrikeRangeTests))]\n        public void FiltersStrikeRange(decimal underlyingPrice, Symbol[] symbols, int filteredNumber)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Strikes(-2, 3)\n                                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n\n            var underlyingScaleFactor = SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(Market.USA, symbols.First(), symbols.First().SecurityType, \"USD\").StrikeMultiplier;\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying, underlyingScaleFactor);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(filteredNumber, filtered.Count);\n            Assert.AreEqual(symbols[3], filtered[0].Symbol);\n            Assert.AreEqual(symbols[4], filtered[1].Symbol);\n            Assert.AreEqual(symbols[5], filtered[2].Symbol);\n            Assert.AreEqual(symbols[6], filtered[3].Symbol);\n            Assert.AreEqual(symbols[7], filtered[4].Symbol);\n            if (underlyingPrice == 10)\n            {\n                Assert.AreEqual(symbols[8], filtered[5].Symbol);\n            }\n        }\n\n        [Test]\n        [TestCase(7.5)]\n        [TestCase(8)]\n        public void FiltersStrikeRangeWithVaryingDistance(decimal underlyingPrice)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Strikes(-2, 2)\n                                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(underlyingPrice == 8 ? 5 : 4, filtered.Count);\n            Assert.AreEqual(symbols[1], filtered[0].Symbol);\n            Assert.AreEqual(symbols[2], filtered[1].Symbol);\n            Assert.AreEqual(symbols[3], filtered[2].Symbol);\n            Assert.AreEqual(symbols[4], filtered[3].Symbol);\n            if (underlyingPrice == 8)\n            {\n                Assert.AreEqual(symbols[5], filtered[4].Symbol);\n            }\n        }\n\n        [Test]\n        [TestCase(14)]\n        [TestCase(15)]\n        public void FiltersStrikeRangeWithNegativeMaxStrike(decimal underlyingPrice)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                .Strikes(-3, -1)\n                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(3, filtered.Count);\n            Assert.AreEqual(symbols[5], filtered[0].Symbol);\n            Assert.AreEqual(symbols[6], filtered[1].Symbol);\n            Assert.AreEqual(symbols[7], filtered[2].Symbol);\n        }\n\n        [Test]\n        [TestCase(14)]\n        [TestCase(15)]\n        public void FiltersStrikeRangeWithNegativeMaxStrikeOutOfRange(decimal underlyingPrice)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                .Strikes(-3, -1)\n                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 1\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(0, filtered.Count);\n        }\n\n        [Test]\n        [TestCase(5)]\n        [TestCase(6)]\n        public void FiltersStrikeRangeWithPositiveMinStrike(decimal underlyingPrice)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                .Strikes(1, 3)\n                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(3, filtered.Count);\n            Assert.AreEqual(symbols[2], filtered[0].Symbol);\n            Assert.AreEqual(symbols[3], filtered[1].Symbol);\n            Assert.AreEqual(symbols[4], filtered[2].Symbol);\n        }\n\n        [Test]\n        [TestCase(20)]\n        [TestCase(21)]\n        public void FiltersStrikeRangeWithPositiveMinStrikeOutOfRange(decimal underlyingPrice)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                .Strikes(1, 3)\n                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 1\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(0, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersStrikeRangeWhenEmpty()\n        {\n            var underlying = new Tick { Value = 7.5m, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                .Strikes(-2, 2)\n                .Expiration(TimeSpan.Zero, TimeSpan.MaxValue);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new Symbol[] { };\n\n            var underlyingSymbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var canonical = Symbol.CreateCanonicalOption(underlyingSymbol);\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(0, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersExpiryRange()\n        {\n            var time = new DateTime(2016, 02, 26);\n            var underlying = new Tick { Value = 10m, Time = time };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                    .Strikes(-10, 10)\n                    .Expiration(TimeSpan.FromDays(3), TimeSpan.FromDays(7));\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(0)), // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(1)), // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(2)), // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(3)), // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(4)), // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(5)), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(6)), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(7)), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(8)), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, time.AddDays(9)), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(5, filtered.Count);\n            Assert.AreEqual(symbols[3], filtered[0].Symbol);\n            Assert.AreEqual(symbols[4], filtered[1].Symbol);\n            Assert.AreEqual(symbols[5], filtered[2].Symbol);\n            Assert.AreEqual(symbols[6], filtered[3].Symbol);\n            Assert.AreEqual(symbols[7], filtered[4].Symbol);\n        }\n\n        [Test]\n        public void FiltersExpiryRangeAfterNonTradableDay()\n        {\n            var time = new DateTime(2023, 12, 30); // Saturday\n            var underlying = new TradeBar { Value = 10m, Time = time.AddDays(-1), EndTime = time };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.Expiration(0, 5);\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = Enumerable.Range(3, 10)\n                .SelectMany(i =>\n                    Enumerable.Range(1, 3).Select(j => Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10 * j, time.AddDays(i))))\n                .ToArray();\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n\n            // Expiry range is 0 to 5 days, so 6 days times 3 strikes per day\n            var expectedSelections = 6 * 3;\n            Assert.AreEqual(expectedSelections, filtered.Count);\n            for (int i = 0; i < expectedSelections; i++)\n            {\n                Assert.AreEqual(symbols[i], filtered[i].Symbol);\n            }\n        }\n\n        [Test]\n        public void FiltersOutWeeklys()\n        {\n            var expiry1 = new DateTime(2017, 01, 04);\n            var expiry2 = new DateTime(2017, 01, 06);\n            var expiry3 = new DateTime(2017, 01, 11);\n            var expiry4 = new DateTime(2017, 01, 13);\n            var expiry5 = new DateTime(2017, 01, 18);\n            var expiry6 = new DateTime(2017, 01, 20); // standard\n            var expiry7 = new DateTime(2017, 01, 25);\n            var expiry8 = new DateTime(2017, 01, 27);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 12, 29) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.StandardsOnly();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry2),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry3),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry4),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry5),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry6), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry6), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry6), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry7), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry8), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filtered = filter.Filter(new OptionFilterUniverse(option, data, underlying)).ToList();\n            Assert.AreEqual(3, filtered.Count);\n            Assert.AreEqual(symbols[5], filtered[0].Symbol);\n            Assert.AreEqual(symbols[6], filtered[1].Symbol);\n            Assert.AreEqual(symbols[7], filtered[2].Symbol);\n        }\n\n        [Test]\n        public void FiltersOutWeeklysIfFridayHoliday()\n        {\n            var expiry1 = new DateTime(2017, 01, 04);\n            var expiry2 = new DateTime(2017, 01, 06);\n            var expiry3 = new DateTime(2017, 01, 11);\n            var expiry4 = new DateTime(2017, 01, 13);\n            var expiry5 = new DateTime(2017, 01, 18);\n            var expiry6 = new DateTime(2017, 01, 19); // standard monthly contract expiration. Friday -holiday\n            var expiry7 = new DateTime(2017, 01, 25);\n            var expiry8 = new DateTime(2017, 01, 27);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 12, 29) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.StandardsOnly();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry2),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry3),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry4),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry5),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry6), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry6), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry6), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry7), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry8), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filtered = filter.Filter(new OptionFilterUniverse(option, data, underlying)).ToList();\n            Assert.AreEqual(3, filtered.Count);\n            Assert.AreEqual(symbols[5], filtered[0].Symbol);\n            Assert.AreEqual(symbols[6], filtered[1].Symbol);\n            Assert.AreEqual(symbols[7], filtered[2].Symbol);\n        }\n\n        [Test]\n        public void FiltersOutStandardContracts()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16); // standard\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.WeeklysOnly();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry1),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry1),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry1),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry2),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry2), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry3), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry3), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry4), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry4), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filtered = filter.Filter(new OptionFilterUniverse(option, data, underlying)).ToList();\n            Assert.AreEqual(8, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersOutNothingAfterFilteringByType()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16); // standard\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.IncludeWeeklys();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse).ApplyTypesFilter();\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry1),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry1),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry1),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry2),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry2), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry3), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry3), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry4), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry4), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(10, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersFrontMonth()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16); // standard\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.IncludeWeeklys().FrontMonth();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry1),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry1),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry1),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry2),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry2), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry3), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry3), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry4), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry4), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filtered = filter.Filter(new OptionFilterUniverse(option, data, underlying)).ToList();\n            Assert.AreEqual(4, filtered.Count);\n        }\n\n        [Test]\n        public void FiltersBackMonth()\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16); // standard\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 02, 26) };\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe.IncludeWeeklys().BackMonth();\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry1),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry1),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry1),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry2),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry2), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry2), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry3), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry4), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry4), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(3, filtered.Count);\n        }\n\n        [TestCase(\"[data.symbol for data in universe][:5]\")]\n        [TestCase(\"lambda contracts_data: [data.symbol for data in contracts_data][:5]\")]\n        public void SetsContractsPython(string code)\n        {\n            var expiry1 = new DateTime(2016, 12, 02);\n            var expiry2 = new DateTime(2016, 12, 09);\n            var expiry3 = new DateTime(2016, 12, 16); // standard\n            var expiry4 = new DateTime(2016, 12, 23);\n\n            var underlying = new Tick { Value = 10m, Time = new DateTime(2016, 02, 26) };\n\n            using var _ = Py.GIL();\n            var module = PyModule.FromString(\"SetsContractsPython\",\n                        @$\"\nfrom AlgorithmImports import *\n\ndef set_filter(universe: OptionFilterUniverse) -> OptionFilterUniverse:\n    return universe.Contracts({code})\n        \");\n            var setFilter = module.GetAttr(\"set_filter\");\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe =>\n            {\n                using var _ = Py.GIL();\n                using var pyUniverse = universe.ToPython();\n                return setFilter.Invoke(pyUniverse).GetAndDispose<OptionFilterUniverse>();\n            };\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = new[]\n            {\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry1),  // 0\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry1),  // 1\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry1),  // 2\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry1),  // 3\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry2),  // 4\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry2), // 5\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry2), // 6\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry3), // 7\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry4), // 8\n                Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry4), // 9\n            };\n\n            var canonical = symbols[0].Canonical;\n            var option = CreateOptionSecurity(canonical);\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(option, data, underlying);\n            var filtered = filter.Filter(filterUniverse).ToList();\n            Assert.AreEqual(5, filtered.Count);\n        }\n\n        static Symbol[] CreateOptions(string ticker, string targetOption = null)\n        {\n            var expiry = new DateTime(2016, 03, 04);\n            if (string.IsNullOrEmpty(targetOption))\n            {\n                return new[] {\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry),  // 0\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry),  // 1\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry),  // 2\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry),  // 3\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry),  // 4\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry), // 5\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry), // 6\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry), // 7\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 8\n                    Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 9\n                };\n            }\n            else\n            {\n                var indexSymbol = Symbol.Create(ticker, SecurityType.Index, Market.USA);\n                return new[] {\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry),  // 0\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 5, expiry),  // 1\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 7, expiry),  // 2\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 8, expiry),  // 3\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 9, expiry),  // 4\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 10, expiry), // 5\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 11, expiry), // 6\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 12, expiry), // 7\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 15, expiry), // 8\n                    Symbol.CreateOption(indexSymbol, targetOption, Market.USA, OptionStyle.American, OptionRight.Put, 20, expiry), // 9\n                };\n            }\n        }\n\n        public static object[] FiltersStrikeRangeTests =\n        {\n            new object[] {9.5m, CreateOptions(\"SPY\", null), 5},\n            new object[] {10m, CreateOptions(\"SPY\", null), 6},\n            new object[] {45.5m, CreateOptions(\"NDX\", \"NQX\"), 5},\n            new object[] {50m, CreateOptions(\"NDX\", \"NQX\"), 6}\n        };\n\n        private static Option CreateOptionSecurity(Symbol canonical)\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar), canonical, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n\n            if (canonical.SecurityType == SecurityType.Option)\n            {\n                return new Option(\n                    MarketHoursDatabase.FromDataFolder().GetExchangeHours(config),\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null);\n            }\n\n            var indexConfig = new SubscriptionDataConfig(typeof(TradeBar), canonical.Underlying, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            var index = new QuantConnect.Securities.Index.Index(\n                MarketHoursDatabase.FromDataFolder().GetExchangeHours(indexConfig),\n                new Cash(Currencies.USD, 0, 1m),\n                indexConfig,\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null);\n\n            return new QuantConnect.Securities.IndexOption.IndexOption(\n                canonical,\n                MarketHoursDatabase.FromDataFolder().GetExchangeHours(config),\n                new Cash(Currencies.USD, 0, 1m),\n                new QuantConnect.Securities.IndexOption.IndexOptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                index);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/OptionMarginBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Castle.Core.Internal;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.IndexOption;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    // The tests have been verified using the CBOE Margin Calculator\n    // http://www.cboe.com/trading-tools/calculators/margin-calculator\n\n    [TestFixture]\n    public class OptionMarginBuyingPowerModelTests\n    {\n        // Test class to enable calling protected methods\n\n        [Test]\n        public void OptionMarginBuyingPowerModelInitializationTests()\n        {\n            var option = CreateOption(Symbols.SPY_P_192_Feb19_2016);\n            var buyingPowerModel = new OptionMarginModel();\n\n            // we test that options dont have leverage (100%) and it cannot be changed\n            Assert.AreEqual(1m, buyingPowerModel.GetLeverage(option));\n            Assert.Throws<InvalidOperationException>(() => buyingPowerModel.SetLeverage(option, 10m));\n            Assert.AreEqual(1m, buyingPowerModel.GetLeverage(option));\n        }\n\n        [Test]\n        public void TestLongCallsPuts()\n        {\n            const decimal price = 1.2345m;\n            const decimal underlyingPrice = 200m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPut = CreateOption(Symbols.SPY_P_192_Feb19_2016);\n            optionPut.SetMarketPrice(new Tick { Value = price });\n            optionPut.Underlying = equity;\n            optionPut.Holdings.SetHoldings(1m, 2);\n\n            var optionCall = CreateOption(Symbols.SPY_C_192_Feb19_2016);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n            optionCall.Underlying = equity;\n            optionCall.Holdings.SetHoldings(1.5m, 2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // we expect long positions to be 100% charged.\n            Assert.AreEqual(optionPut.Holdings.AbsoluteHoldingsValue, buyingPowerModel.GetInitialMarginRequirement(optionPut, optionPut.Holdings.Quantity));\n            Assert.AreEqual(optionCall.Holdings.AbsoluteHoldingsValue, buyingPowerModel.GetInitialMarginRequirement(optionCall, optionCall.Holdings.Quantity));\n\n            // long option position have zero maintenance margin requirement\n            Assert.AreEqual(0m, buyingPowerModel.GetMaintenanceMargin(optionPut));\n            Assert.AreEqual(0m, buyingPowerModel.GetMaintenanceMargin(optionCall));\n        }\n\n        [Test]\n        public void TestShortCallsITM()\n        {\n            const decimal price = 14m;\n            const decimal underlyingPrice = 196m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionCall = CreateOption(Symbols.SPY_C_192_Feb19_2016);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n            optionCall.Underlying = equity;\n            optionCall.Holdings.SetHoldings(price, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // they do not include premium since the user gets paid for the premium up front.\n            // Margin = quantity * contract multiplier * [option price + MAX(A, B)]\n            //      A = 20% * underlying price - OTM amount = 0.2 * 196 - 0 = 39.2\n            //      B = 10% * underlying price = 0.1 * 196 = 19.6\n            // Margin = 2 * 100 * (14 + MAX(39.2, 19.6)) = 10640\n            Assert.AreEqual(10640m, buyingPowerModel.GetMaintenanceMargin(optionCall));\n        }\n\n        [Test]\n        public void TestShortCallsOTM()\n        {\n            const decimal price = 14m;\n            const decimal underlyingPrice = 180m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionCall = CreateOption(Symbols.SPY_C_192_Feb19_2016);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n            optionCall.Underlying = equity;\n            optionCall.Holdings.SetHoldings(price, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (14 + 0.2 * 180 - (192 - 180)) = 7600\n            Assert.AreEqual(7600, (double)buyingPowerModel.GetMaintenanceMargin(optionCall), 0.01);\n        }\n\n        [Test]\n        public void TestShortPutsITM()\n        {\n            const decimal price = 14m;\n            const decimal underlyingPrice = 182m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPut = CreateOption(Symbols.SPY_P_192_Feb19_2016);\n            optionPut.SetMarketPrice(new Tick { Value = price });\n            optionPut.Underlying = equity;\n            optionPut.Holdings.SetHoldings(price, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (14 + 0.2 * 182) = 10080\n            Assert.AreEqual(10080m, buyingPowerModel.GetMaintenanceMargin(optionPut));\n        }\n\n        [Test]\n        public void TestShortPutsOTM()\n        {\n            const decimal price = 14m;\n            const decimal underlyingPrice = 196m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPut = CreateOption(Symbols.SPY_P_192_Feb19_2016);\n            optionPut.SetMarketPrice(new Tick { Value = price });\n            optionPut.Underlying = equity;\n            optionPut.Holdings.SetHoldings(price, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (14 + 0.2 * 196 - (196 - 192)) = 9840\n            Assert.AreEqual(9840, (double)buyingPowerModel.GetMaintenanceMargin(optionPut), 0.01);\n        }\n\n        [Test]\n        public void TestShortPutFarITM()\n        {\n            const decimal price = 0.18m;\n            const decimal underlyingPrice = 200m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPut = CreateOption(equity, OptionRight.Put, 207m);\n            optionPut.SetMarketPrice(new Tick { Value = price });\n            optionPut.Holdings.SetHoldings(price, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (0.18 + 0.2 * 200) = 8036\n            Assert.AreEqual(8036, (double)buyingPowerModel.GetMaintenanceMargin(optionPut), 0.01);\n        }\n\n        [Test]\n        public void TestShortPutMovingFarITM()\n        {\n            const decimal optionPriceStart = 4.68m;\n            const decimal underlyingPriceStart = 192m;\n            const decimal optionPriceEnd = 0.18m;\n            const decimal underlyingPriceEnd = 200m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPriceStart });\n\n            var optionPut = CreateOption(equity, OptionRight.Put, 207m);\n            optionPut.SetMarketPrice(new Tick { Value = optionPriceStart });\n            optionPut.Holdings.SetHoldings(optionPriceStart, -2);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (4.68 + 0.2 * 192) = 8616\n            Assert.AreEqual(8616, (double)buyingPowerModel.GetMaintenanceMargin(optionPut), 0.01);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPriceEnd });\n            optionPut.SetMarketPrice(new Tick { Value = optionPriceEnd });\n\n            // short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (4.68 + 0.2 * 200) = 8936\n            Assert.AreEqual(8936, (double)buyingPowerModel.GetMaintenanceMargin(optionPut), 0.01);\n        }\n\n        // ITM\n        [TestCase(OptionRight.Call, 300, 115.75, 415, 19800)] // IB: 19837\n        // OTM\n        [TestCase(OptionRight.Put, 300, 0.45, 415, 3000)] // IB: 3044\n        // ITM\n        [TestCase(OptionRight.Call, 390, 27.5, 415, 11000)] // IB: 11022\n        // OTM\n        [TestCase(OptionRight.Put, 390, 1.85, 415, 6000)] // IB: 6042\n        // OTM\n        [TestCase(OptionRight.Call, 430, 0.85, 415, 6800)] // IB: 6803\n        // ITM\n        [TestCase(OptionRight.Put, 430, 16.80, 415, 9900)] // IB: 9929\n        public void ShortOptionsMargin(OptionRight optionRight, decimal strikePrice, decimal optionPrice, decimal underlyingPrice,\n            double expectedUnitMargin)\n        {\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var option = CreateOption(equity, optionRight, strikePrice);\n            option.SetMarketPrice(new Tick { Value = optionPrice });\n            option.Holdings.SetHoldings(optionPrice, -1);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            Assert.AreEqual(expectedUnitMargin, (double)buyingPowerModel.GetMaintenanceMargin(option), delta: 0.05 * expectedUnitMargin);\n            Assert.AreEqual(10 * expectedUnitMargin,\n                (double)buyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(option, -10)).Value,\n                delta: 0.05 * 10 * expectedUnitMargin);\n        }\n\n        // ITM\n        [TestCase(OptionRight.Call, 3800, 750, 4550, 143000)] // IB: 143275\n        [TestCase(OptionRight.Put, 3800, 0.05, 4550, 38000)] // IB: 38000\n        // OTM\n        [TestCase(OptionRight.Call, 5000, 0.05, 4550, 45500)] // IB: 45537\n        [TestCase(OptionRight.Put, 5000, 445, 4550, 112800)] // IB: 112876\n        public void ShortIndexOptionsMargin(OptionRight optionRight, decimal strikePrice, decimal optionPrice, decimal underlyingPrice,\n            double expectedUnitMargin)\n        {\n            var index = CreateIndex();\n            index.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var indexOption = CreateOption(index, optionRight, strikePrice);\n            indexOption.SetMarketPrice(new Tick { Value = optionPrice });\n            indexOption.Holdings.SetHoldings(optionPrice, -1);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            Assert.AreEqual(expectedUnitMargin, (double)buyingPowerModel.GetMaintenanceMargin(indexOption), delta: 0.05 * expectedUnitMargin);\n            Assert.AreEqual(10 * expectedUnitMargin,\n                (double)buyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(indexOption, -10)).Value,\n                delta: 0.05 * 10 * expectedUnitMargin);\n        }\n\n        [TestCase(0)]\n        [TestCase(10000)]\n        public void NonAccountCurrency_GetBuyingPower(decimal nonAccountCurrencyCash)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            algorithm.Portfolio.SetCash(Currencies.USD, nonAccountCurrencyCash, 0.88m);\n\n            var option = algorithm.AddOption(\"SPY\");\n\n            var buyingPowerModel = new OptionMarginModel();\n            var quantity = buyingPowerModel.GetBuyingPower(new BuyingPowerParameters(\n                algorithm.Portfolio, option, OrderDirection.Buy));\n\n            Assert.AreEqual(10000m + algorithm.Portfolio.CashBook[Currencies.USD].ValueInAccountCurrency,\n                quantity.Value);\n        }\n\n        // For -1.5% target (15k), we can short -2 contracts for 478 margin requirement per unit\n        [TestCase(0, -2, -.015)] // Open Short (0 + -2 = -2)\n        [TestCase(-1, -1, -.015)] // Short to Shorter (-1 + -1 = -2)\n        [TestCase(-2, 0, -.015)] // No action\n        [TestCase(2, -4, -.015)] // Long To Short (2 + -4 = -2)\n\n        // -40% Target (~-400k), we can short -58 contracts for 478 margin requirement per unit\n        [TestCase(0, -58, -0.40)] // Open Short (0 + -58 = -58)\n        [TestCase(-2, -56, -0.40)] // Short to Shorter (-2 + -56 = -58)\n        [TestCase(2, -60, -0.40)] // Long To Short (2 + -60 = -58)\n\n        // 40% Target (~400k), we can buy 836 contracts\n        [TestCase(0, 836, 0.40)] // Open Long (0 + 836 = 836)\n        [TestCase(-2, 838, 0.40)] // Short to Long (-2 + 838 = 836)\n        [TestCase(2, 834, 0.40)] // Long To Longer (2 + 834 = 836)\n\n        // ~0.04% Target (~400). This is below the needed margin for one unit. We end up at 0 holdings for all cases.\n        [TestCase(0, 0, 0.0004)] // Open Long (0 + 0 = 0)\n        [TestCase(-2, 2, 0.0004)] // Short to Long (-2 + 2 = 0)\n        [TestCase(2, -2, 0.0004)] // Long To Longer (2 + -2 = 0)\n        public void CallOTM_MarginRequirement(int startingHoldings, int expectedOrderSize, decimal targetPercentage)\n        {\n            // Initialize algorithm\n            var algorithm = new QCAlgorithm();\n            algorithm.SetFinishedWarmingUp();\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n\n            algorithm.SetCash(1000000);\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var optionSymbol = Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 411m, DateTime.UtcNow);\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            option.Holdings.SetHoldings(4.74m, startingHoldings);\n            Assert.GreaterOrEqual(algorithm.Portfolio.MarginRemaining, 0);\n            option.FeeModel = new ConstantFeeModel(0);\n            option.SetLeverage(1);\n\n            // Update option data\n            UpdatePrice(option, 4.78m);\n\n            // Update the underlying data\n            UpdatePrice(option.Underlying, 395.51m);\n\n            var model = new OptionMarginModel();\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, option, targetPercentage, 0);\n            Assert.AreEqual(expectedOrderSize, result.Quantity);\n\n            var initialPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;\n            var initialMarginUsed = algorithm.Portfolio.TotalMarginUsed;\n            option.Holdings.SetHoldings(4.74m, result.Quantity + startingHoldings);\n\n            if (option.Holdings.Invested)\n            {\n                Assert.LessOrEqual(Math.Abs(initialMarginUsed - algorithm.Portfolio.TotalMarginUsed), initialPortfolioValue * Math.Abs(targetPercentage));\n            }\n        }\n\n        [TestCase(0)]\n        [TestCase(-10)]\n        public void GetsMaintenanceMarginForAPotentialShortPositionWithoutInitialHoldings(decimal initialHoldings)\n        {\n            // Computing the maintenance margin for a potential position is useful because it will be used to check whether there is\n            // enough available buying power to open said new position.\n\n            const decimal price = 1.6m;\n            const decimal underlyingPrice = 410m;\n\n            var equity = CreateEquity();\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionCall = CreateOption(equity, OptionRight.Call, 408m);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n            optionCall.Holdings.SetHoldings(price, initialHoldings);\n\n            var buyingPowerModel = new OptionMarginModel();\n\n            if (initialHoldings == 0)\n            {\n                // No holdings for the option, so no maintenance margin expected\n                Assert.AreEqual(0m, buyingPowerModel.GetMaintenanceMargin(optionCall));\n            }\n            else\n            {\n                // Margin = 10 * 100 * (1.6 + 0.2 * 410) = 83600\n                Assert.AreEqual(83600m, buyingPowerModel.GetMaintenanceMargin(optionCall));\n            }\n\n            // Short option positions are very expensive in terms of margin.\n            // Margin = 2 * 100 * (1.6 + 0.2 * 410) = 16720\n            Assert.AreEqual(16720m, buyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForQuantityAtCurrentPrice(optionCall, -2)).Value);\n        }\n\n        // OTM\n        [TestCase(1, 3500, 140)] // IB: 0 (GetInitialMarginRequirement() returns the value with the premium)\n        [TestCase(-1, 3500, -52340)] // IB: 40781\n        // ITM\n        [TestCase(1, 3450, 140)] // IB: 0 (GetInitialMarginRequirement() returns the value with the premium)\n        [TestCase(-1, 3450, -37340)] // IB: 36081\n        public void GetInitialMarginRequiredForOrderWithIndexOption(decimal quantity, decimal strikePrice, decimal expectedInitialMargin)\n        {\n            var price = 1.40m;\n            var underlyingPrice = 17400m;\n\n            var indexSymbol = Symbol.Create(\"NDX\", SecurityType.Index, Market.USA);\n            var index = CreateIndex(indexSymbol);\n            index.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPut = CreateOption(index, OptionRight.Put, strikePrice, \"NQX\");\n            optionPut.SetMarketPrice(new Tick { Value = price });\n            var buyingPowerModel = new OptionMarginModel();\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var initialMargin = buyingPowerModel.GetInitialMarginRequirement(optionPut, quantity);\n\n            Assert.AreEqual((double)expectedInitialMargin, (double)initialMargin, delta: 0.01);\n        }\n\n        private static void UpdatePrice(Security security, decimal close)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = DateTime.Now,\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n        }\n\n        private static QuantConnect.Securities.Equity.Equity CreateEquity()\n        {\n            var tz = TimeZones.NewYork;\n            return new QuantConnect.Securities.Equity.Equity(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n        }\n\n        private static Option CreateOption(Security underlying, OptionRight optionRight, decimal strikePrice, string targetOption = null)\n        {\n            var tz = TimeZones.NewYork;\n            var optionSymbol = targetOption.IsNullOrEmpty() ? Symbol.CreateOption(underlying.Symbol, Market.USA, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2015, 02, 27)) : Symbol.CreateOption(underlying.Symbol, targetOption, Market.USA, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2015, 02, 27));\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), optionSymbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(Market.USA, optionSymbol, optionSymbol.SecurityType, \"USD\")),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            option.Underlying = underlying;\n\n            return option;\n        }\n\n        private static Option CreateOption(Symbol symbol)\n        {\n            var tz = TimeZones.NewYork;\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(\"\", Currencies.USD, 100, 0.01m, 1),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            return option;\n        }\n\n        private static QuantConnect.Securities.Index.Index CreateIndex(Symbol symbol = null)\n        {\n            var tz = TimeZones.NewYork;\n            return new QuantConnect.Securities.Index.Index(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new Cash(Currencies.USD, 0, 1m),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol ?? Symbols.SPX, Resolution.Minute, tz, tz, true, false, false),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/OptionPriceModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QLNet;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing Cash = QuantConnect.Securities.Cash;\nusing Option = QuantConnect.Securities.Option.Option;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class OptionPriceModelTests\n    {\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            OptionPriceModels.DefaultPriceModelProvider = QLOptionPriceModelProvider.Instance;\n        }\n\n        [Test]\n        public void PutCallParityTest()\n        {\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            const decimal riskFreeRate = 0.01m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Call);\n            var SPY_P_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Put);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contractCall = GetOptionContract(SPY_C_192_Feb19_2016E, spy, evaluationDate);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = 17m });  // dummy non-zero price\n            // setting up European style put option\n            var contractPut = GetOptionContract(SPY_P_192_Feb19_2016E, spy, evaluationDate);\n            var optionPut = GetOption(SPY_P_192_Feb19_2016E, equity, tz);\n            optionPut.SetMarketPrice(new Tick { Value = 7m });  // dummy non-zero price\n\n            // running evaluation\n            var priceModel = OptionPriceModels.BlackScholes();\n            var resultsCall = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contractCall));\n            var resultsPut = priceModel.Evaluate(new OptionPriceModelParameters(optionPut, null, contractPut));\n            var callPrice = resultsCall.TheoreticalPrice;\n            var putPrice = resultsPut.TheoreticalPrice;\n\n            // Put-call parity equation\n            var rightPart = putPrice + underlyingPrice; // no yield\n            var leftPart = callPrice + contractCall.Strike * (decimal)Math.Exp((double)-riskFreeRate);\n\n            Assert.AreEqual((double)leftPart, (double)rightPart, (double)rightPart * 0.001);\n        }\n\n        [Test]\n        public void ExpirationDate()\n        {\n            const decimal price = 20.00m;\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            var tz = TimeZones.NewYork;\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Call);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contract = GetOptionContract(SPY_C_192_Feb19_2016E, spy, DateTime.MinValue);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n\n            // running evaluation\n            var priceModel = OptionPriceModels.BlackScholes();\n\n            OptionPriceModelResult results;\n            foreach (var date in new[] { optionCall.Expiry.AddDays(-1), optionCall.Expiry })\n            {\n                contract.Time = date;\n                results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n                Assert.AreNotEqual(0, results.TheoreticalPrice);\n                Assert.AreNotEqual(0, results.Greeks.Gamma);\n                Assert.AreNotEqual(0, results.Greeks.Vega);\n                Assert.AreNotEqual(0, results.Greeks.Delta);\n                Assert.AreNotEqual(0, results.Greeks.Lambda);\n                Assert.AreNotEqual(0, results.Greeks.Theta);\n            }\n\n            // and post expiration they are 0\n            contract.Time = optionCall.Expiry.AddDays(1);\n            results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n            Assert.AreEqual(0, results.TheoreticalPrice);\n            Assert.AreEqual(0, results.Greeks.Gamma);\n            Assert.AreEqual(0, results.Greeks.Vega);\n            Assert.AreEqual(0, results.Greeks.Delta);\n            Assert.AreEqual(0, results.Greeks.Lambda);\n            Assert.AreEqual(0, results.Greeks.Theta);\n        }\n\n        [Test]\n        public void ChangesWithEvaluationDate()\n        {\n            const decimal price = 20.00m;\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            var tz = TimeZones.NewYork;\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Call);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contract = GetOptionContract(SPY_C_192_Feb19_2016E, spy, DateTime.MinValue);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n\n            // running evaluation\n            var priceModel = OptionPriceModels.BlackScholes();\n\n            contract.Time = new DateTime(2015, 02, 19);\n            var results1 = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n            // we need to get the greeks else they will calculated bellow after we change the static evaluation date\n            var gamma = results1.Greeks.Gamma;\n            var delta = results1.Greeks.Delta;\n            var vega = results1.Greeks.Delta;\n            var lambda = results1.Greeks.Lambda;\n            var theta = results1.Greeks.Theta;\n\n            contract.Time = new DateTime(2015, 12, 4);\n            var results2 = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n            Assert.AreNotEqual(results1.TheoreticalPrice, results2.TheoreticalPrice);\n\n            Assert.AreNotEqual(gamma, results2.Greeks.Gamma);\n            Assert.AreNotEqual(vega, results2.Greeks.Vega);\n            Assert.AreNotEqual(delta, results2.Greeks.Delta);\n            Assert.AreNotEqual(lambda, results2.Greeks.Lambda);\n            Assert.AreNotEqual(theta, results2.Greeks.Theta);\n        }\n\n        [Test]\n        public void BlackScholesPortfolioTest()\n        {\n            const decimal price = 20.00m;\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            const decimal riskFreeRate = 0.01m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Call);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contract = GetOptionContract(SPY_C_192_Feb19_2016E, spy, evaluationDate);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n\n            // running evaluation\n            var priceModel = OptionPriceModels.BlackScholes();\n            var results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n            var impliedVol = results.ImpliedVolatility;\n            var greeks = results.Greeks;\n\n            // BS equation\n            var rightPart = greeks.Theta + riskFreeRate * underlyingPrice * greeks.Delta + 0.5m * impliedVol * impliedVol * underlyingPrice * underlyingPrice * greeks.Gamma;\n            var leftPart = riskFreeRate * price;\n\n            Assert.AreEqual((double)leftPart, (double)rightPart, 0.0001);\n        }\n\n        [Test]\n        public void BaroneAdesiWhaleyPortfolioTest()\n        {\n            const decimal price = 30.00m;\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.25m;\n            const decimal riskFreeRate = 0.01m;\n            var tz = TimeZones.NewYork;\n            var spy = Symbols.SPY;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.American, OptionRight.Call);\n            var option = CreateOption(SPY_C_192_Feb19_2016E);\n\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            var contract = new OptionContract(option) { Time = evaluationDate };\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n\n            var priceModel = OptionPriceModels.QuantLib.BaroneAdesiWhaley();\n            var results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n            var callPrice = results.TheoreticalPrice;\n            var impliedVolatility = results.ImpliedVolatility;\n            var greeks = results.Greeks;\n\n            Assert.Greater(price, callPrice);\n            Assert.Greater(impliedVolatility, underlyingVol);\n\n            var rightPart = greeks.Theta + riskFreeRate * underlyingPrice * greeks.Delta + 0.5m * impliedVolatility * impliedVolatility * underlyingPrice * underlyingPrice * greeks.Gamma;\n            var leftPart = riskFreeRate * price;\n            Assert.AreEqual((double)leftPart, (double)rightPart, 0.0001);\n        }\n\n        [Test]\n        public void EvaluationDateWorksInPortfolioTest()\n        {\n            const decimal price = 30.00m;\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.25m;\n            var tz = TimeZones.NewYork;\n            var spy = Symbols.SPY;\n            var evaluationDate1 = new DateTime(2015, 2, 19);\n            var evaluationDate2 = new DateTime(2015, 2, 20);\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.American, OptionRight.Call);\n\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            var contract = GetOptionContract(SPY_C_192_Feb19_2016E, spy, evaluationDate1);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = price });\n\n            var priceModel = OptionPriceModels.QuantLib.BaroneAdesiWhaley();\n            var results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n            var callPrice1 = results.TheoreticalPrice;\n\n            contract.Time = evaluationDate2;\n            results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contract));\n\n            var callPrice2 = results.TheoreticalPrice;\n            Assert.Greater(callPrice1, callPrice2);\n        }\n\n        [TestCase(\"BaroneAdesiWhaleyApproximationEngine\")]\n        [TestCase(\"QLNet.BaroneAdesiWhaleyApproximationEngine\")]\n        public void CreatesOptionPriceModelByName(string priceEngineName)\n        {\n            IOptionPriceModel priceModel = null;\n            Assert.DoesNotThrow(() =>\n            {\n                priceModel = OptionPriceModels.QuantLib.Create(priceEngineName, 0.01m);\n            });\n\n            Assert.NotNull(priceModel);\n            Assert.IsInstanceOf<QLOptionPriceModel>(priceModel);\n        }\n\n        [Test]\n        public void GreekApproximationTest()\n        {\n            const decimal price = 20.00m;\n            const decimal underlyingPrice = 190m;\n            const decimal underlyingVol = 0.15m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2016, 1, 19);\n            var spy = Symbols.SPY;\n\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            var contract = GetOptionContract(Symbols.SPY_P_192_Feb19_2016, spy, evaluationDate);\n\n            var optionPut = GetOption(Symbols.SPY_P_192_Feb19_2016, equity, tz);\n            optionPut.SetMarketPrice(new Tick { Value = price });\n\n            var priceModel = (QLOptionPriceModel)OptionPriceModels.QuantLib.CrankNicolsonFD();\n            priceModel.EnableGreekApproximation = false;\n\n            var results = priceModel.Evaluate(optionPut, null, contract);\n            var greeks = results.Greeks;\n\n            Assert.AreEqual(greeks.Theta, 0);\n            Assert.AreEqual(greeks.Rho, 0);\n            Assert.AreEqual(greeks.Vega, 0);\n\n            priceModel = (QLOptionPriceModel)OptionPriceModels.QuantLib.CrankNicolsonFD();\n            priceModel.EnableGreekApproximation = true;\n\n            results = priceModel.Evaluate(optionPut, null, contract);\n            greeks = results.Greeks;\n\n            Assert.LessOrEqual(greeks.Theta, 0);\n            Assert.AreNotEqual(greeks.Rho, 0);\n            Assert.Greater(greeks.Vega, 0);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void HasBeenWarmedUp(bool warmUp)\n        {\n            var volatilityModel = new Mock<IQLUnderlyingVolatilityEstimator>();\n            volatilityModel.SetupGet(s => s.IsReady).Returns(warmUp);\n            var priceModel = new QLOptionPriceModel(\n                process => new IntegralEngine(process),\n                volatilityModel.Object,\n                null,\n                null);\n\n            Assert.AreEqual(warmUp, priceModel.VolatilityEstimatorWarmedUp);\n        }\n\n        [Test]\n        public void ReturnsNoneIfNotWarmedUp()\n        {\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Call);\n            var SPY_P_192_Feb19_2016E = GetOptionSymbol(spy, OptionStyle.European, OptionRight.Put);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contractCall = GetOptionContract(SPY_C_192_Feb19_2016E, spy, evaluationDate);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n\n            // setting up European style put option\n            var contractPut = GetOptionContract(SPY_P_192_Feb19_2016E, spy, evaluationDate);\n            var optionPut = GetOption(SPY_P_192_Feb19_2016E, equity, tz);\n\n            // running evaluation\n            var volatilityModel = new Mock<IQLUnderlyingVolatilityEstimator>();\n            volatilityModel.SetupGet(s => s.IsReady).Returns(false);\n            var priceModel = new QLOptionPriceModel(process => new AnalyticEuropeanEngine(process),\n                volatilityModel.Object,\n                null,\n                null);\n            var resultsCall = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contractCall));\n            var resultsPut = priceModel.Evaluate(new OptionPriceModelParameters(optionPut, null, contractPut));\n\n            Assert.AreEqual(OptionPriceModelResult.None, resultsCall);\n            Assert.AreEqual(OptionPriceModelResult.None, resultsCall);\n        }\n\n        [TestCase(\"BlackScholes\", OptionStyle.American, true)]\n        [TestCase(\"BlackScholes\", OptionStyle.European, false)]\n        [TestCase(\"Integral\", OptionStyle.American, true)]\n        [TestCase(\"Integral\", OptionStyle.European, false)]\n        [TestCase(\"BaroneAdesiWhaley\", OptionStyle.American, false)]\n        [TestCase(\"BaroneAdesiWhaley\", OptionStyle.European, true)]\n        [TestCase(\"BjerksundStensland\", OptionStyle.American, false)]\n        [TestCase(\"BjerksundStensland\", OptionStyle.European, true)]\n        public void ThrowsIfOptionStyleIsNotSupportedByQLPricingModel(string qlModelName, OptionStyle optionStyle, bool shouldThrow)\n        {\n            const decimal underlyingPrice = 200m;\n            const decimal underlyingVol = 0.15m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var spy = Symbols.SPY;\n            var SPY_C_192_Feb19_2016E = GetOptionSymbol(spy, optionStyle, OptionRight.Call);\n            var SPY_P_192_Feb19_2016E = GetOptionSymbol(spy, optionStyle, OptionRight.Put);\n\n            // setting up underlying\n            var equity = GetEquity(spy, underlyingPrice, underlyingVol, tz);\n\n            // setting up European style call option\n            var contractCall = GetOptionContract(SPY_C_192_Feb19_2016E, spy, evaluationDate);\n            var optionCall = GetOption(SPY_C_192_Feb19_2016E, equity, tz);\n            optionCall.SetMarketPrice(new Tick { Value = 17m });  // dummy non-zero price\n\n            // setting up European style put option\n            var contractPut = GetOptionContract(SPY_P_192_Feb19_2016E, spy, evaluationDate);\n            var optionPut = GetOption(SPY_P_192_Feb19_2016E, equity, tz);\n            optionPut.SetMarketPrice(new Tick { Value = 7m });  // dummy non-zero price\n\n            // running evaluation\n            var priceModel = (IOptionPriceModel)typeof(OptionPriceModels.QuantLib).GetMethod(qlModelName).Invoke(null, new object[] { });\n            TestDelegate call = () => priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contractCall));\n            TestDelegate put = () => priceModel.Evaluate(new OptionPriceModelParameters(optionPut, null, contractPut));\n\n            if (shouldThrow)\n            {\n                Assert.Throws<ArgumentException>(call);\n                Assert.Throws<ArgumentException>(put);\n            }\n            else\n            {\n                Assert.DoesNotThrow(call);\n                Assert.DoesNotThrow(put);\n\n                var results = priceModel.Evaluate(new OptionPriceModelParameters(optionCall, null, contractCall));\n                var greeks = results.Greeks;\n\n                Assert.That(greeks.Delta, Is.InRange(0, 1m));\n                Assert.Less(greeks.Theta, 0);\n                Assert.Greater(greeks.Rho, 0m);\n                Assert.Greater(greeks.Vega, 0m);\n\n                results = priceModel.Evaluate(new OptionPriceModelParameters(optionPut, null, contractPut));\n                greeks = results.Greeks;\n\n                Assert.That(greeks.Delta, Is.InRange(-1m, 0));\n                Assert.Less(greeks.Theta, 0);\n                Assert.Less(greeks.Rho, 0m);\n                Assert.Greater(greeks.Vega, 0m);\n            }\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.01d, 0.03d, 0.01d, 0.03d, 78d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.01d, 0.03d, 0.01d, 0.03d, 78d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.01d, 0.03d, 0.01d, 0.03d, 77d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.01d, 0.03d, 0.01d, 0.03d, 508d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 0.33d, 724d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 0.33d, 724d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 0.33d, 723d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 0.33d, 731d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 0.33d, 731d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 0.33d, 723d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 0.33d, 724d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.21d, 724d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 0.33d, 724d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.12d, 0.01d, 0.33d, 4882d)]\n        public void MatchesIBGreeksNearATMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811C00450000\" : \"SPX230811C04500000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.03d, 0.05d, 0.01d, 0.02d, 48d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.03d, 0.05d, 0.01d, 0.02d, 49d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.03d, 0.05d, 0.01d, 0.02d, 48d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.03d, 0.05d, 0.01d, 0.02d, 48d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.03d, 0.05d, 0.01d, 0.02d, 49d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.03d, 0.05d, 0.01d, 0.02d, 49d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.03d, 0.05d, 0.01d, 0.02d, 48d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.03d, 0.05d, 0.01d, 0.02d, 48d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.03d, 0.05d, 0.01d, 0.02d, 49d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.03d, 0.05d, 0.01d, 0.02d, 165d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.03d, 0.01d, 0.22d, 450d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.03d, 0.01d, 0.22d, 450d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.03d, 0.01d, 0.22d, 450d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.03d, 0.01d, 0.22d, 455d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.03d, 0.01d, 0.22d, 455d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.03d, 0.01d, 0.22d, 451d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.03d, 0.01d, 0.22d, 450d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.03d, 0.01d, 0.14d, 453d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.03d, 0.01d, 0.22d, 453d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.06d, 0.01d, 0.22d, 1555d)]\n        public void MatchesIBGreeksFarATMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901C00450000\" : \"SPX230901C04500000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.02d, 0.02d, 0.01d, 0.03d, 64d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.02d, 0.08d, 0.05d, 0.03d, 447d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.02d, 0.02d, 0.01d, 0.03d, 64d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.02d, 0.02d, 0.01d, 0.03d, 64d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.02d, 0.02d, 0.01d, 0.03d, 65d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.02d, 0.02d, 0.01d, 0.03d, 65d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.02d, 0.02d, 0.01d, 0.03d, 64d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.02d, 0.02d, 0.01d, 0.03d, 64d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.02d, 0.08d, 0.05d, 0.03d, 447d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.02d, 0.02d, 0.01d, 0.03d, 447d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 0.33d, 641d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 0.33d, 641d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 0.33d, 641d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 0.33d, 649d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 0.33d, 649d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 0.33d, 641d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 0.33d, 641d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.13d, 642d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 0.33d, 642d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.12d, 0.01d, 0.33d, 4622d)]\n        public void MatchesIBGreeksNearATMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811P00450000\" : \"SPX230811P04500000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.02d, 0.05d, 0.02d, 0.02d, 129d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.02d, 0.03d, 0.01d, 0.02d, 35d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.02d, 0.05d, 0.02d, 0.02d, 129d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.02d, 0.03d, 0.01d, 0.02d, 129d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.02d, 0.01d, 0.22d, 356d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.02d, 0.01d, 0.22d, 356d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.02d, 0.01d, 0.22d, 356d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.02d, 0.01d, 0.22d, 360d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.02d, 0.01d, 0.22d, 360d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.02d, 0.01d, 0.22d, 357d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.02d, 0.01d, 0.22d, 356d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.02d, 0.01d, 0.17d, 358d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.02d, 0.01d, 0.22d, 359d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.06d, 0.01d, 0.22d, 1335d)]\n        public void MatchesIBGreeksFarATMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901P00450000\" : \"SPX230901P04500000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.05d, 0.05d, 0.01d, 0.22d, 56d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.05d, 0.05d, 0.01d, 0.06d, 57d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.05d, 0.05d, 0.01d, 0.22d, 56d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.05d, 0.05d, 0.01d, 0.22d, 56d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.05d, 0.05d, 0.01d, 0.22d, 57d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.05d, 0.05d, 0.01d, 0.22d, 57d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.05d, 0.05d, 0.01d, 0.22d, 56d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.05d, 0.05d, 0.01d, 0.22d, 56d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.05d, 0.05d, 0.01d, 0.06d, 57d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.05d, 0.05d, 0.01d, 0.22d, 916d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.02d, 0.02d, 0.01d, 2.21d, 331d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.02d, 0.02d, 0.01d, 2.21d, 330d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.02d, 0.02d, 0.01d, 2.21d, 330d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.02d, 0.02d, 0.01d, 2.21d, 337d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.02d, 0.02d, 0.01d, 2.21d, 337d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.02d, 0.02d, 0.01d, 2.21d, 330d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.02d, 0.02d, 0.01d, 2.21d, 330d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.02d, 0.02d, 0.01d, 0.19d, 333d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.02d, 0.02d, 0.01d, 2.21d, 333d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.02d, 0.34d, 0.01d, 2.21d, 7981d)]\n        public void MatchesIBGreeksNearITMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811C00430000\" : \"SPX230811C04300000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.04d, 0.07d, 0.01d, 0.09d, 50d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.04d, 0.07d, 0.01d, 0.23d, 49d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.04d, 0.07d, 0.01d, 0.23d, 50d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.04d, 0.07d, 0.01d, 0.09d, 50d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.04d, 0.07d, 0.01d, 0.23d, 226d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.02d, 0.04d, 0.01d, 2.25d, 406d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.02d, 0.04d, 0.01d, 2.25d, 406d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.02d, 0.04d, 0.01d, 2.25d, 406d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.02d, 0.04d, 0.01d, 2.25d, 411d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.02d, 0.04d, 0.01d, 2.25d, 411d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.02d, 0.04d, 0.01d, 2.25d, 406d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.02d, 0.04d, 0.01d, 2.25d, 406d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.02d, 0.04d, 0.01d, 0.51d, 409d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.02d, 0.04d, 0.01d, 2.25d, 409d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.02d, 0.24d, 0.01d, 2.25d, 2029d)]\n        public void MatchesIBGreeksFarITMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901C00430000\" : \"SPX230901C04300000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.13d, 1.00d, 0.01d, 0.24d, 5.92d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.13d, 0.39d, 0.01d, 0.24d, 526d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.13d, 0.01d, 0.01d, 0.24d, 5.93d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.13d, 1.05d, 0.01d, 0.24d, 5.93d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.13d, 1.00d, 0.01d, 0.24d, 6.49d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.13d, 1.00d, 0.01d, 0.24d, 6.49d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.13d, 0.01d, 0.01d, 0.24d, 5.93d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.13d, 1.05d, 0.01d, 0.24d, 5.93d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.13d, 0.39d, 0.01d, 0.24d, 526d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.13d, 1.00d, 0.01d, 0.24d, 526d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.14d, 1.00d, 0.01d, 0.37d, 0.71d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.14d, 0.03d, 0.01d, 0.37d, 47d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.14d, 1.04d, 0.01d, 0.37d, 0.71d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.14d, 1.00d, 0.01d, 0.37d, 0.71d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.14d, 1.00d, 0.01d, 0.37d, 0.71d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.14d, 0.03d, 0.01d, 0.37d, 47d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.14d, 1.04d, 0.01d, 0.37d, 0.71d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.14d, 0.03d, 0.01d, 0.37d, 47d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.14d, 0.03d, 0.01d, 0.37d, 47d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.14d, 0.03d, 0.01d, 0.37d, 47d)]\n        public void MatchesIBGreeksNearITMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811P00470000\" : \"SPX230811P04700000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.11d, 1.00d, 0.02d, 0.37d, 4.66d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.11d, 0.31d, 0.02d, 0.37d, 90d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.11d, 0.02d, 0.02d, 0.37d, 4.70d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.11d, 1.05d, 0.02d, 0.37d, 4.68d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.11d, 1.00d, 0.01d, 0.37d, 4.89d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.11d, 1.00d, 0.01d, 0.37d, 4.89d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.11d, 0.02d, 0.05d, 0.37d, 4.71d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.11d, 1.05d, 0.02d, 0.37d, 4.65d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.11d, 0.31d, 0.02d, 0.37d, 90d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.11d, 1.00d, 0.01d, 0.37d, 90d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.11d, 0.90d, 0.01d, 2.47d, 0.21d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.11d, 0.12d, 0.01d, 2.47d, 47d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.11d, 0.94d, 0.01d, 2.47d, 0.21d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.11d, 0.90d, 0.01d, 2.47d, 0.21d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.11d, 0.90d, 0.01d, 2.47d, 0.21d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.11d, 0.12d, 0.01d, 2.47d, 47d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.11d, 0.94d, 0.01d, 2.47d, 0.21d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.11d, 0.12d, 0.01d, 2.47d, 47d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.11d, 0.12d, 0.01d, 2.47d, 47d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.11d, 0.12d, 0.01d, 2.47d, 47d)]\n        public void MatchesIBGreeksFarITMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901P00470000\" : \"SPX230901P04700000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 0.24d, 5.84d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.01d, 0.01d, 0.01d, 0.01d, 6.02d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 0.24d, 5.85d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 0.24d, 5.85d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 0.24d, 6.14d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 0.24d, 6.14d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 0.24d, 5.82d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 0.24d, 5.85d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.01d, 0.01d, 0.01d, 0.01d, 6.02d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 0.24d, 488d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 2.42d, 53d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 2.42d, 53d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 2.42d, 53d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 2.42d, 55d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 2.42d, 55d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 2.42d, 53d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 2.42d, 53d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.01d, 54d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 2.42d, 55d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.38d, 0.01d, 2.42d, 4459d)]\n        public void MatchesIBGreeksNearOTMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811C00470000\" : \"SPX230811C04700000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.01d, 0.01d, 0.01d, 0.24d, 17d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 0.24d, 123d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 2.54d, 164d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 2.54d, 164d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 2.54d, 164d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 2.54d, 167d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 2.54d, 167d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 2.54d, 164d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 2.54d, 166d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.02d, 166d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 2.54d, 166d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.28d, 0.01d, 2.54d, 1173d)]\n        public void MatchesIBGreeksFarOTMCall(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901C00470000\" : \"SPX230901C04700000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Call, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.02d, 0.01d, 0.01d, 0.21d, 19d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.02d, 0.33d, 0.01d, 0.21d, 678d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.02d, 0.01d, 0.01d, 0.21d, 19d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.02d, 0.01d, 0.01d, 0.21d, 19d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.02d, 0.01d, 0.01d, 0.21d, 20d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.02d, 0.01d, 0.01d, 0.21d, 20d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.02d, 0.01d, 0.01d, 0.21d, 19d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.02d, 0.01d, 0.01d, 0.21d, 19d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.02d, 0.33d, 0.01d, 0.21d, 678d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.02d, 0.01d, 0.01d, 0.21d, 678d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 2.14d, 183d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 2.14d, 183d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 2.14d, 183d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 2.14d, 189d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 2.14d, 189d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 2.14d, 183d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 2.14d, 183d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.03d, 186d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 2.14d, 185d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.33d, 0.01d, 2.14d, 6957d)]\n        public void MatchesIBGreeksNearOTMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230811P00430000\" : \"SPX230811P04300000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 8, 11));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        /// This test aim to comapre the maximum greek calculation error between models (2dp)\n        /// as well as a benchmark of each model to monitor future changes\n        [TestCase(OptionStyle.American, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BaroneAdesiWhaley\", 0.01d, 0.23d, 0.01d, 0.21d, 169d)]\n        [TestCase(OptionStyle.American, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 0.21d, 29d)]\n        [TestCase(OptionStyle.American, \"BjerksundStensland\", 0.01d, 0.23d, 0.01d, 0.21d, 169d)]\n        [TestCase(OptionStyle.American, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 0.21d, 169d)]\n        [TestCase(OptionStyle.European, \"AdditiveEquiprobabilities\", 0.01d, 0.01d, 0.01d, 2.18d, 276d)]\n        [TestCase(OptionStyle.European, \"BinomialCoxRossRubinstein\", 0.01d, 0.01d, 0.01d, 2.18d, 276d)]\n        [TestCase(OptionStyle.European, \"BinomialJarrowRudd\", 0.01d, 0.01d, 0.01d, 2.18d, 276d)]\n        [TestCase(OptionStyle.European, \"BinomialJoshi\", 0.01d, 0.01d, 0.01d, 2.18d, 280d)]\n        [TestCase(OptionStyle.European, \"BinomialLeisenReimer\", 0.01d, 0.01d, 0.01d, 2.18d, 280d)]\n        [TestCase(OptionStyle.European, \"BinomialTian\", 0.01d, 0.01d, 0.01d, 2.18d, 275d)]\n        [TestCase(OptionStyle.European, \"BinomialTrigeorgis\", 0.01d, 0.01d, 0.01d, 2.18d, 276d)]\n        [TestCase(OptionStyle.European, \"BlackScholes\", 0.01d, 0.01d, 0.01d, 0.08d, 278d)]\n        [TestCase(OptionStyle.European, \"CrankNicolsonFD\", 0.01d, 0.01d, 0.01d, 2.18d, 278d)]\n        [TestCase(OptionStyle.European, \"Integral\", 0.01d, 0.23d, 0.01d, 2.18d, 1727d)]\n        public void MatchesIBGreeksFarOTMPut(OptionStyle style, string qlModelName, double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var filename = style == OptionStyle.American ? \"SPY230901P00430000\" : \"SPX230901P04300000\";\n            var symbol = Symbols.SPY;       // dummy\n            var strike = Parse.Decimal(filename[10..]) / 1000m;\n            var optionSymbol = GetOptionSymbol(symbol, style, OptionRight.Put, strike, new DateTime(2023, 9, 1));\n\n            MatchesIBGreeksTest(symbol, optionSymbol, filename, qlModelName, errorIV, errorDelta, errorGamma, errorVega, errorTheta);\n        }\n\n        private void MatchesIBGreeksTest(Symbol symbol, Symbol optionSymbol, string filename, string qlModelName,\n                                         double errorIV, double errorDelta, double errorGamma, double errorVega, double errorTheta)\n        {\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2023, 8, 4);\n\n            // setting up underlying\n            var equity = GetEquity(symbol, 450m, 0.15m, tz);       // dummy non-zero values\n\n            // setting up option\n            var contract = GetOptionContract(optionSymbol, symbol, evaluationDate);\n            var option = GetOption(optionSymbol, equity, tz);\n            var priceModel = (IOptionPriceModel)typeof(OptionPriceModels.QuantLib).GetMethod(qlModelName).Invoke(null, new object[] { });\n\n            // Get test data\n            var data = File.ReadAllLines($\"TestData/greeks/{filename}.csv\")\n                .Skip(1)                                            // skip header row\n                .Where(x => !string.IsNullOrWhiteSpace(x))\n                .Select(x => x.Split(','));\n\n            // running evaluation: iterate per slice\n            foreach (var datum in data)\n            {\n                equity.SetMarketPrice(new Tick { Value = Parse.Decimal(datum[7]) });\n                option.SetMarketPrice(new Tick { Value = Parse.Decimal(datum[1]) });\n                var results = priceModel.Evaluate(new OptionPriceModelParameters(option, null, contract));\n\n                // Check the option Greeks are valid\n                var greeks = results.Greeks;\n\n                // Expect minor error due to interest rate, bid/ask price and dividend yield used in IB\n                // And approximation error using Black Calculator if the original pricing model fails\n                Assert.AreEqual((double)results.ImpliedVolatility, Parse.Double(datum[2]), errorIV);\n                Assert.AreEqual((double)greeks.Delta, Parse.Double(datum[3]), errorDelta);\n                Assert.AreEqual((double)greeks.Gamma, Parse.Double(datum[4]), errorGamma);\n                Assert.AreEqual((double)greeks.Vega, Parse.Double(datum[5]), errorVega);\n                Assert.AreEqual((double)greeks.Theta, Parse.Double(datum[6]), errorTheta);\n            }\n        }\n\n        [TestCase(OptionRight.Call, 200, 24.76, 0.3003)]         // ATM\n        [TestCase(OptionRight.Call, 250, 12.33, 0.3430)]         // deep OTM\n        [TestCase(OptionRight.Call, 150, 57.24, 0.3323)]         // deep ITM\n        [TestCase(OptionRight.Put, 200, 22.02, 0.2907)]          // ATM\n        [TestCase(OptionRight.Put, 180, 15.50, 0.3312)]          // deep ITM\n        [TestCase(OptionRight.Put, 220, 36.59, 0.3225)]          // deep OTM\n        public void ImpliedVolatilityEstimator(OptionRight optionRight, decimal strike, double price, double ibImpliedVol)\n        {\n            const double underlyingPrice = 200d;\n            var evaluationDate = new DateTime(2015, 2, 19);\n            var spy = Symbols.SPY;\n            var optionSymbol = GetOptionSymbol(spy, OptionStyle.American, optionRight, strike);\n\n            // setting up\n            var contract = GetOptionContract(optionSymbol, spy, evaluationDate);\n            var payoff = new PlainVanillaPayoff(contract.Right == OptionRight.Call ? QLNet.Option.Type.Call : QLNet.Option.Type.Put, (double)contract.Strike);\n            var forwardPrice = underlyingPrice / 0.99d;\n            BlackCalculator black = null;\n\n            // running evaluation with 0% dividend yield and 1% interest rate\n            var initialGuess = Math.Sqrt(2 * Math.PI) * price / underlyingPrice;\n            var priceModel = new TestOptionPriceModel();\n            var impliedVolEstimate = priceModel.TestImpliedVolEstimator(price, initialGuess, 1, 0.99d, forwardPrice, payoff, out black);\n\n            // Expect minor error due to interest rate and dividend yield used in IB\n            Assert.AreEqual(impliedVolEstimate, ibImpliedVol, 0.001);\n        }\n\n        [Test]\n        public void PriceModelEvaluateSpeedTest()\n        {\n            const decimal underlyingPrice = 3820.08m;\n            const decimal underlyingVol = 0.2m;\n            var tz = TimeZones.NewYork;\n            var evaluationDate = new DateTime(2021, 1, 14);\n            var spx = Symbols.SPX;\n            var optionSymbol = Symbol.CreateOption(spx.Value, spx.ID.Market, OptionStyle.European, OptionRight.Put, 4200,\n                new DateTime(2021, 1, 15));\n\n            // setting up\n            var equity = GetEquity(spx, underlyingPrice, underlyingVol, tz);\n            var contract = GetOptionContract(optionSymbol, spx, evaluationDate);\n            var option = GetOption(optionSymbol, equity, tz);\n            option.SetMarketPrice(new Tick { Value = 379.45m });\n\n            // running evaluation\n            var priceModel = OptionPriceModels.BlackScholes();\n\n            var results = priceModel.Evaluate(new OptionPriceModelParameters(option, null, contract));\n            var greeks = results.Greeks;\n            Assert.IsNotNull(results.ImpliedVolatility);\n            Assert.IsNotNull(greeks.Delta);\n            Assert.IsNotNull(greeks.Gamma);\n            Assert.IsNotNull(greeks.Theta);\n            Assert.IsNotNull(greeks.Vega);\n            Assert.IsNotNull(greeks.Rho);\n\n            Thread.Sleep(500);\n\n            var stopWatch = new Stopwatch();\n            stopWatch.Start();\n            for (var i = 0; i < 1000; i++)\n            {\n                results = priceModel.Evaluate(new OptionPriceModelParameters(option, null, contract));\n                greeks = results.Greeks;\n\n                // Expect minor error due to interest rate and dividend yield used in IB\n                Assert.IsNotNull(results.ImpliedVolatility);\n                Assert.IsNotNull(greeks.Delta);\n                Assert.IsNotNull(greeks.Gamma);\n                Assert.IsNotNull(greeks.Theta);\n                Assert.IsNotNull(greeks.Vega);\n                Assert.IsNotNull(greeks.Rho);\n            }\n            stopWatch.Stop();\n            Assert.Less(stopWatch.ElapsedMilliseconds, 2200);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OptionPriceModelResultOverloadsAreConsistent(Language language)\n        {\n            var impliedVol = 0.25m;\n            var funcImpliedVol = new Func<decimal>(() => impliedVol);\n            var funcGreeks = new Func<Greeks>(() => new ModeledGreeks(() => 0.01m, () => 0.02m, () => 0.03m, () => 0.04m, () => 0.05m, () => 0.06m));\n            OptionPriceModelResult optionPriceModelResult = null;\n            if (language == Language.CSharp)\n            {\n                optionPriceModelResult = new OptionPriceModelResult(0.01m, funcImpliedVol, funcGreeks);\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    optionPriceModelResult = new OptionPriceModelResult(0.01m, funcImpliedVol.ToPython(), funcGreeks.ToPython());\n                }\n            }\n\n            Assert.AreEqual(0.25m, optionPriceModelResult.ImpliedVolatility);\n            Assert.AreEqual(0.01m, optionPriceModelResult.Greeks.Delta);\n            Assert.AreEqual(0.02m, optionPriceModelResult.Greeks.Gamma);\n            Assert.AreEqual(0.03m, optionPriceModelResult.Greeks.Vega);\n            Assert.AreEqual(0.04m, optionPriceModelResult.Greeks.Theta);\n            Assert.AreEqual(0.05m, optionPriceModelResult.Greeks.Rho);\n            Assert.AreEqual(0.06m, optionPriceModelResult.Greeks.Lambda);\n        }\n\n        private static Symbol GetOptionSymbol(Symbol underlying, OptionStyle optionStyle, OptionRight optionRight, decimal strike = 192m, DateTime? expiry = null)\n        {\n            if (expiry == null)\n            {\n                expiry = new DateTime(2016, 02, 19);\n            }\n            return Symbol.CreateOption(underlying.Value, Market.USA, optionStyle, optionRight, strike, (DateTime)expiry);\n        }\n\n        private static Option CreateOption(Symbol symbol)\n        {\n            return new Option(\n                        SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                        new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true),\n                        new Cash(Currencies.USD, 0, 1m),\n                        new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null\n                    )\n            { ExerciseSettlement = SettlementType.Cash };\n        }\n\n        public static Equity GetEquity(Symbol symbol, decimal underlyingPrice, decimal underlyingVol, NodaTime.DateTimeZone tz)\n        {\n            var equity = new Equity(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            if (underlyingPrice > 0)\n            {\n                equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n            }\n            equity.VolatilityModel = new DummyVolatilityModel(underlyingVol);\n\n            return equity;\n        }\n\n        public static OptionContract GetOptionContract(Symbol symbol, Symbol underlying, DateTime evaluationDate)\n        {\n            var option = CreateOption(symbol);\n            return new OptionContract(option) { Time = evaluationDate };\n        }\n\n        public static Option GetOption(Symbol symbol, Equity underlying, NodaTime.DateTimeZone tz)\n        {\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            option.Underlying = underlying;\n\n            return option;\n        }\n\n        /// <summary>\n        /// Dummy implementation of volatility model (for tests only)\n        /// </summary>\n        class DummyVolatilityModel : IVolatilityModel\n        {\n            private decimal _volatility;\n\n            public DummyVolatilityModel(decimal volatility)\n            {\n                _volatility = volatility;\n            }\n            public decimal Volatility\n            {\n                get\n                {\n                    return _volatility;\n                }\n            }\n\n            public IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime date)\n            {\n                return Enumerable.Empty<HistoryRequest>();\n            }\n\n            public void Update(Security security, BaseData data)\n            {\n            }\n        }\n\n        class TestOptionPriceModel : QLOptionPriceModel\n        {\n            public TestOptionPriceModel()\n                : base(process => new BinomialVanillaEngine<CoxRossRubinstein>(process, 100), null, null, null)\n            {\n            }\n\n            public double TestImpliedVolEstimator(double price, double initialGuess, double timeTillExpiry, double riskFreeDiscount,\n                                                  double forwardPrice, PlainVanillaPayoff payoff, out BlackCalculator black)\n            {\n                return base.ImpliedVolatilityEstimation(price, initialGuess, timeTillExpiry, riskFreeDiscount, forwardPrice, payoff, out black);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/OptionStrategyFilterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class OptionStrategyFilterTests\n    {\n        private static Dictionary<int, DateTime> _expiries = new Dictionary<int, DateTime>\n        {\n            { 1, new DateTime(2016, 3, 10) },\n            { 2, new DateTime(2016, 5, 10) },\n            { 3, new DateTime(2017, 5, 10) }\n        };\n\n        [TestCase(100, 0, 100, 10, false)]\n        [TestCase(100, -5, 95, 10, false)]\n        [TestCase(100, 5, 105, 10, false)]\n        [TestCase(100, 10.05, 110, 10, false)]\n        [TestCase(105.5, 0, 105, 10, false)]\n        [TestCase(100, 0, 100, 40, true)]\n        public void FiltersSingleCall(decimal underlyingPrice, decimal strikeFromAtm, decimal expectedStrike, int minDaysTillExpiry,\n            bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .NakedCall(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(1, filtered.Count);\n            Assert.AreEqual(OptionRight.Call, filtered[0].ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, filtered[0].ID.Date);\n            Assert.AreEqual(expectedStrike, filtered[0].ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, 100, 10, false)]\n        [TestCase(100, -5, 95, 10, false)]\n        [TestCase(100, 5, 105, 10, false)]\n        [TestCase(100, 10.05, 110, 10, false)]\n        [TestCase(105.5, 0, 105, 10, false)]\n        [TestCase(100, 0, 100, 40, true)]\n        public void FiltersSinglePut(decimal underlyingPrice, decimal strikeFromAtm, decimal expectedStrike, int minDaysTillExpiry = 10,\n            bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .NakedPut(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(1, filtered.Count);\n            Assert.AreEqual(OptionRight.Put, filtered[0].ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, filtered[0].ID.Date);\n            Assert.AreEqual(expectedStrike, filtered[0].ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, null)]    // equal strikes\n        [TestCase(100, -5, null)]   // low strikes > high strike\n        [TestCase(100, 0, 0)]       // equal strikes\n        [TestCase(110, -5, -5)]     // equal strikes\n        [TestCase(100, -5, 5)]      // low strikes > high strike\n        public void FailsCallSpread(decimal underlyingPrice, decimal higherStrikeFromAtm, decimal? lowerStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallSpread(10, higherStrikeFromAtm, lowerStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 2, 95, 105, 10, false)]\n        [TestCase(100, 10, 2, 90, 110, 10, false)]\n        [TestCase(100, 10.5, 2, 90, 110, 10, false)]\n        [TestCase(105.5, 5, 2, 100, 110, 10, false)]\n        [TestCase(1000, 10, 0, 0, 0, 10, false)]            // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, 5, 2, 85, 90, 10, false)]\n        [TestCase(100, 5, 2, 95, 105, 40, true)]\n        public void FiltersCallSpread(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal lowerExpectedStrike,\n            decimal higherExpectedStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallSpread(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.OrderBy(x => x.ID.StrikePrice);\n            var lowerStrikeCall = orderedCalls.First();\n            var higherStrikeCall = orderedCalls.Last();\n\n            Assert.AreEqual(OptionRight.Call, lowerStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikeCall.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, higherStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikeCall.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikeCall.ID.StrikePrice);\n            Assert.Greater(higherStrikeCall.ID.StrikePrice, lowerStrikeCall.ID.StrikePrice);\n        }\n\n        [TestCase(100, -5, 5, 2, 95, 105, 10, false)]\n        [TestCase(100, -5, 10, 2, 95, 110, 10, false)]\n        [TestCase(100, -10.5, 5.6, 2, 90, 105, 10, false)]\n        [TestCase(105.5, -4.9, 5.1, 2, 100, 110, 10, false)]\n        [TestCase(1000, -10, 10, 0, 0, 0, 10, false)]       // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, -5, 5, 2, 85, 90, 10, false)]\n        [TestCase(100, -5, 5, 2, 95, 105, 40, true)]\n        public void FiltersCallSpread(decimal underlyingPrice, decimal lowerStrikeFromAtm, decimal higherStrikeFromAtm, int expectedCount,\n            decimal lowerExpectedStrike, decimal higherExpectedStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallSpread(minDaysTillExpiry, higherStrikeFromAtm, lowerStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.OrderBy(x => x.ID.StrikePrice);\n            var lowerStrikeCall = orderedCalls.First();\n            var higherStrikeCall = orderedCalls.Last();\n\n            Assert.AreEqual(OptionRight.Call, lowerStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikeCall.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, higherStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikeCall.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikeCall.ID.StrikePrice);\n            Assert.Greater(higherStrikeCall.ID.StrikePrice, lowerStrikeCall.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, null)]    // equal strikes\n        [TestCase(100, -5, null)]   // low strikes > high strike\n        [TestCase(100, 0, 0)]       // equal strikes\n        [TestCase(110, -5, -5)]     // equal strikes\n        [TestCase(100, -5, 5)]      // low strikes > high strike\n        public void FailsPutSpread(decimal underlyingPrice, decimal higherStrikeFromAtm, decimal? lowerStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutSpread(10, higherStrikeFromAtm, lowerStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 2, 95, 105, 10, false)]\n        [TestCase(100, 10, 2, 90, 110, 10, false)]\n        [TestCase(100, 10.5, 2, 90, 110, 10, false)]\n        [TestCase(105.5, 5, 2, 100, 110, 10, false)]\n        [TestCase(1000, 10, 0, 0, 0, 10, false)]            // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, 5, 2, 85, 90, 10, false)]\n        [TestCase(100, 5, 2, 95, 105, 40, true)]\n        public void FiltersPutSpread(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal lowerExpectedStrike,\n            decimal higherExpectedStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutSpread(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedPuts = filtered.OrderBy(x => x.ID.StrikePrice);\n            var lowerStrikePut = orderedPuts.First();\n            var higherStrikePut = orderedPuts.Last();\n\n            Assert.AreEqual(OptionRight.Put, lowerStrikePut.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikePut.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikePut.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Put, higherStrikePut.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikePut.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikePut.ID.StrikePrice);\n            Assert.Greater(higherStrikePut.ID.StrikePrice, lowerStrikePut.ID.StrikePrice);\n        }\n\n        [TestCase(100, -5, 5, 2, 95, 105, 10, false)]\n        [TestCase(100, -5, 10, 2, 95, 110, 10, false)]\n        [TestCase(100, -10.5, 5.6, 2, 90, 105, 10, false)]\n        [TestCase(105.5, -4.9, 5.1, 2, 100, 110, 10, false)]\n        [TestCase(1000, -10, 10, 0, 0, 0, 10, false)]       // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, -5, 5, 2, 85, 90, 10, false)]\n        [TestCase(100, -5, 5, 2, 95, 105, 40, true)]\n        public void FiltersPutSpread(decimal underlyingPrice, decimal lowerStrikeFromAtm, decimal higherStrikeFromAtm, int expectedCount,\n            decimal lowerExpectedStrike, decimal higherExpectedStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutSpread(minDaysTillExpiry, higherStrikeFromAtm, lowerStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedPuts = filtered.OrderBy(x => x.ID.StrikePrice);\n            var lowerStrikePut = orderedPuts.First();\n            var higherStrikePut = orderedPuts.Last();\n\n            Assert.AreEqual(OptionRight.Put, lowerStrikePut.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikePut.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikePut.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Put, higherStrikePut.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikePut.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikePut.ID.StrikePrice);\n            Assert.Greater(higherStrikePut.ID.StrikePrice, lowerStrikePut.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, 10, 10)]      // equal expiry\n        [TestCase(105, -5, 50, 10)]     // near expiry > far expiry\n        [TestCase(105, -5, -10, -5)]    // negative\n        [TestCase(105, -5, 0, -5)]      // negative\n        public void FailsCallCalendarSpread(decimal underlyingPrice, decimal strikeFromAtm, int nearExpiry, int farExpiry)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallCalendarSpread(strikeFromAtm, nearExpiry, farExpiry);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        // Expected expiry: (1) 2016/3/4, (2) 2016/5/4, (3) 2017/5/4\n        [TestCase(100, 0, 10, 40, 1, 2, 2)]\n        [TestCase(100, 10, 10, 40, 1, 2, 2)]\n        [TestCase(100, 0, 10, 350, 1, 3, 2)]\n        [TestCase(100, 0, 40, 350, 2, 3, 2)]\n        [TestCase(105, 0, 40, 41, 2, 3, 2)]         // only select later contracts for far expiry\n        [TestCase(105, 0, 500, 1000, 0, 0, 0)]      // select none if no further contracts available\n        public void FiltersCallCalendarSpread(decimal underlyingPrice, decimal strikeFromAtm, int nearExpiry, int farExpiry, int expectedNearExpiryCase,\n            int expectedFarExpiryCase, int expectedCount)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallCalendarSpread(strikeFromAtm, nearExpiry, farExpiry);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.OrderBy(x => x.ID.Date);\n            var nearCall = orderedCalls.First();\n            var farCall = orderedCalls.Last();\n\n            Assert.AreEqual(OptionRight.Call, nearCall.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedNearExpiryCase], nearCall.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, nearCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, farCall.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedFarExpiryCase], farCall.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, farCall.ID.StrikePrice);\n            Assert.Greater(farCall.ID.Date, nearCall.ID.Date);\n        }\n\n        [TestCase(100, 0, 10, 10)]      // equal expiry\n        [TestCase(105, -5, 50, 10)]     // near expiry > far expiry\n        [TestCase(105, -5, -10, -5)]    // negative\n        [TestCase(105, -5, 0, -5)]      // negative\n        public void FailsPutCalendarSpread(decimal underlyingPrice, decimal strikeFromAtm, int nearExpiry, int farExpiry)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutCalendarSpread(strikeFromAtm, nearExpiry, farExpiry);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        // Expected expiry: (1) 2016/3/4, (2) 2016/5/4, (3) 2017/5/4\n        [TestCase(100, 0, 10, 40, 1, 2, 2)]\n        [TestCase(100, 10, 10, 40, 1, 2, 2)]\n        [TestCase(100, 0, 10, 350, 1, 3, 2)]\n        [TestCase(100, 0, 40, 350, 2, 3, 2)]\n        [TestCase(105, 0, 40, 41, 2, 3, 2)]         // only select later contracts for far expiry\n        [TestCase(105, 0, 500, 1000, 0, 0, 0)]      // select none if no further contracts available\n        public void FiltersPutCalendarSpread(decimal underlyingPrice, decimal strikeFromAtm, int nearExpiry, int farExpiry, int expectedNearExpiryCase,\n            int expectedFarExpiryCase, int expectedCount)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutCalendarSpread(strikeFromAtm, nearExpiry, farExpiry);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedPuts = filtered.OrderBy(x => x.ID.Date);\n            var nearPut = orderedPuts.First();\n            var farPut = orderedPuts.Last();\n\n            Assert.AreEqual(OptionRight.Put, nearPut.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedNearExpiryCase], nearPut.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, nearPut.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Put, farPut.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedFarExpiryCase], farPut.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, farPut.ID.StrikePrice);\n            Assert.Greater(farPut.ID.Date, nearPut.ID.Date);\n        }\n\n        [TestCase(100, 0, -5)]      // 0 call\n        [TestCase(100, 5, 0)]       // 0 put\n        [TestCase(100, -1, -5)]     // negative call\n        [TestCase(100, 5, 1)]       // positive put\n        [TestCase(100, -5, 5)]      // negative call & positive put\n        public void FailsStrangle(decimal underlyingPrice, decimal callStrikeFromAtm, decimal putStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Strangle(10, callStrikeFromAtm, putStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, -5, 2, 105, 95, 10, false)]\n        [TestCase(100, 10, -5, 2, 110, 95, 10, false)]\n        [TestCase(100, 10.5, -11.2, 2, 110, 90, 10, false)]\n        [TestCase(105.5, 5, -5, 2, 110, 100, 10, false)]\n        [TestCase(1000, 5, -5, 0, 0, 0, 10, false)]             // extreme strike causing no OTM contract\n        [TestCase(1, 5, -5, 0, 0, 0, 10, false)]                // extreme strike causing no OTM contract\n        [TestCase(100, 5, -5, 2, 105, 95, 40, true)]\n        public void FiltersStrangle(decimal underlyingPrice, decimal callStrikeFromAtm, decimal putStrikeFromAtm, int expectedCount,\n            decimal expectedCallStrike, decimal expectedPutStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Strangle(minDaysTillExpiry, callStrikeFromAtm, putStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var call = filtered.Single(x => x.ID.OptionRight == OptionRight.Call);\n            var put = filtered.Single(x => x.ID.OptionRight == OptionRight.Put);\n\n            Assert.AreEqual(expectedExpiry, call.ID.Date);\n            Assert.AreEqual(expectedCallStrike, call.ID.StrikePrice);\n            Assert.Greater(call.ID.StrikePrice, underlyingPrice);\n\n            Assert.AreEqual(expectedExpiry, put.ID.Date);\n            Assert.AreEqual(expectedPutStrike, put.ID.StrikePrice);\n            Assert.Greater(call.ID.StrikePrice, put.ID.StrikePrice);\n            Assert.Greater(underlyingPrice, put.ID.StrikePrice);\n        }\n\n        [TestCase(100, 100, 10, false)]\n        [TestCase(105, 105, 10, false)]\n        [TestCase(101.20, 100, 10, false)]\n        [TestCase(100, 100, 40, true)]\n        public void FiltersStraddle(decimal underlyingPrice, decimal expectedStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Straddle(minDaysTillExpiry);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(2, filtered.Count);\n\n            var call = filtered.Single(x => x.ID.OptionRight == OptionRight.Call);\n            var put = filtered.Single(x => x.ID.OptionRight == OptionRight.Put);\n\n            Assert.AreEqual(expectedExpiry, call.ID.Date);\n            Assert.AreEqual(expectedStrike, call.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, put.ID.Date);\n            Assert.AreEqual(expectedStrike, put.ID.StrikePrice);\n        }\n\n        [TestCase(100, -1, 10)]     // put > call\n        [TestCase(100, 5, 5)]       // put = call\n        public void FailsProtectiveCollar(decimal underlyingPrice, decimal callStrikeFromAtm, decimal putStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Strangle(10, callStrikeFromAtm, putStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, -5, 2, 105, 95, 10, false)]\n        [TestCase(100, -1, -5, 2, 100, 95, 10, false)]\n        [TestCase(100, 10, 5, 2, 110, 105, 10, false)]\n        [TestCase(105.5, 5.2, -5.3, 2, 110, 100, 10, false)]\n        [TestCase(1000, 5, -5, 0, 0, 0, 10, false)]             // extreme strike -> put strike = call strike\n        [TestCase(1, 5, -5, 0, 0, 0, 10, false)]                // extreme strike -> put strike = call strike\n        [TestCase(100, 5, -5, 2, 105, 95, 40, true)]\n        public void FiltersProtectiveCollar(decimal underlyingPrice, decimal callStrikeFromAtm, decimal putStrikeFromAtm, int expectedCount,\n            decimal expectedCallStrike, decimal expectedPutStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .ProtectiveCollar(minDaysTillExpiry, callStrikeFromAtm, putStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var call = filtered.Single(x => x.ID.OptionRight == OptionRight.Call);\n            var put = filtered.Single(x => x.ID.OptionRight == OptionRight.Put);\n\n            Assert.AreEqual(expectedExpiry, call.ID.Date);\n            Assert.AreEqual(expectedCallStrike, call.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, put.ID.Date);\n            Assert.AreEqual(expectedPutStrike, put.ID.StrikePrice);\n            Assert.Greater(call.ID.StrikePrice, put.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, 100, 10, false)]\n        [TestCase(100, -5, 95, 10, false)]\n        [TestCase(100, 5, 105, 10, false)]\n        [TestCase(105.5, 5.2, 110, 10, false)]\n        [TestCase(100, 0, 100, 40, true)]\n        public void FiltersConversion(decimal underlyingPrice, decimal strikeFromAtm, decimal expectedStrike,\n            int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .Conversion(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(2, filtered.Count);\n\n            var call = filtered.Single(x => x.ID.OptionRight == OptionRight.Call);\n            var put = filtered.Single(x => x.ID.OptionRight == OptionRight.Put);\n\n            Assert.AreEqual(expectedExpiry, call.ID.Date);\n            Assert.AreEqual(expectedStrike, call.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, put.ID.Date);\n            Assert.AreEqual(expectedStrike, put.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0)]          // zero strike distance from ATM\n        [TestCase(105, -5)]         // negative strike distance from ATM\n        public void FailsCallButterfly(decimal underlyingPrice, decimal strikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallButterfly(10, strikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 3, 95, 100, 105, 10, false)]\n        [TestCase(105, 10, 3, 95, 105, 115, 10, false)]\n        [TestCase(99.5, 5.25, 3, 95, 100, 105, 10, false)]\n        [TestCase(1000, 5, 0, 0, 0, 0, 10, false)]              // extreme strike -> no match OTM\n        [TestCase(1, 5, 0, 0, 0, 0, 10, false)]                 // extreme strike -> no match ITM\n        [TestCase(100, 5, 3, 95, 100, 105, 40, true)]\n        public void FiltersCallButterfly(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal expectedItmStrike,\n            decimal expectedAtmStrike, decimal expectedOtmStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallButterfly(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            filtered = filtered.OrderBy(x => x.ID.StrikePrice).ToList();\n            var itm = filtered[0];\n            var atm = filtered[1];\n            var otm = filtered[2];\n\n            Assert.AreEqual(expectedExpiry, itm.ID.Date);\n            Assert.AreEqual(OptionRight.Call, itm.ID.OptionRight);\n            Assert.AreEqual(expectedItmStrike, itm.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, atm.ID.Date);\n            Assert.AreEqual(OptionRight.Call, atm.ID.OptionRight);\n            Assert.AreEqual(expectedAtmStrike, atm.ID.StrikePrice);\n            Assert.Greater(atm.ID.StrikePrice, itm.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, otm.ID.Date);\n            Assert.AreEqual(OptionRight.Call, otm.ID.OptionRight);\n            Assert.AreEqual(expectedOtmStrike, otm.ID.StrikePrice);\n            Assert.Greater(otm.ID.StrikePrice, atm.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0)]          // zero strike distance from ATM\n        [TestCase(105, -5)]         // negative strike distance from ATM\n        public void FailsPutButterfly(decimal underlyingPrice, decimal strikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutButterfly(10, strikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 3, 95, 100, 105, 10, false)]\n        [TestCase(105, 10, 3, 95, 105, 115, 10, false)]\n        [TestCase(99.5, 5.25, 3, 95, 100, 105, 10, false)]\n        [TestCase(1000, 5, 0, 0, 0, 0, 10, false)]              // extreme strike -> no match ITM\n        [TestCase(1, 5, 0, 0, 0, 0, 10, false)]                 // extreme strike -> no match OTM\n        [TestCase(100, 5, 3, 95, 100, 105, 40, true)]\n        public void FiltersPutButterfly(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal expectedOtmStrike,\n            decimal expectedAtmStrike, decimal expectedItmStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutButterfly(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            filtered = filtered.OrderByDescending(x => x.ID.StrikePrice).ToList();\n            var itm = filtered[0];\n            var atm = filtered[1];\n            var otm = filtered[2];\n\n            Assert.AreEqual(expectedExpiry, itm.ID.Date);\n            Assert.AreEqual(OptionRight.Put, itm.ID.OptionRight);\n            Assert.AreEqual(expectedItmStrike, itm.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, atm.ID.Date);\n            Assert.AreEqual(OptionRight.Put, atm.ID.OptionRight);\n            Assert.AreEqual(expectedAtmStrike, atm.ID.StrikePrice);\n            Assert.Greater(itm.ID.StrikePrice, atm.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, otm.ID.Date);\n            Assert.AreEqual(OptionRight.Put, otm.ID.OptionRight);\n            Assert.AreEqual(expectedOtmStrike, otm.ID.StrikePrice);\n            Assert.Greater(atm.ID.StrikePrice, otm.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0)]          // zero strike distance from ATM\n        [TestCase(105, -5)]         // negative strike distance from ATM\n        public void FailsIronButterfly(decimal underlyingPrice, decimal strikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .IronButterfly(10, strikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 4, 95, 100, 105, 10, false)]\n        [TestCase(105, 10, 4, 95, 105, 115, 10, false)]\n        [TestCase(99.5, 5.25, 4, 95, 100, 105, 10, false)]\n        [TestCase(100, 1, 4, 95, 100, 105, 10, false)]\n        [TestCase(1000, 5, 0, 0, 0, 0, 10, false)]              // extreme strike\n        [TestCase(1, 5, 0, 0, 0, 0, 10, false)]                 // extreme strike\n        [TestCase(100, 5, 4, 95, 100, 105, 40, true)]\n        public void FiltersIronButterfly(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal expectedLowerStrike,\n            decimal expectedAtmStrike, decimal expectedHigherStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .IronButterfly(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var filteredCall = filtered.Where(x => x.ID.OptionRight == OptionRight.Call)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var atmCall = filteredCall[0];\n            var otmCall = filteredCall[1];\n\n            Assert.AreEqual(expectedExpiry, atmCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, atmCall.ID.OptionRight);\n            Assert.AreEqual(expectedAtmStrike, atmCall.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, otmCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, otmCall.ID.OptionRight);\n            Assert.AreEqual(expectedHigherStrike, otmCall.ID.StrikePrice);\n            Assert.Greater(otmCall.ID.StrikePrice, atmCall.ID.StrikePrice);\n\n            var filteredPut = filtered.Where(x => x.ID.OptionRight == OptionRight.Put)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var otmPut = filteredPut[0];\n            var atmPut = filteredPut[1];\n\n            Assert.AreEqual(expectedExpiry, otmPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, otmPut.ID.OptionRight);\n            Assert.AreEqual(expectedLowerStrike, otmPut.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, atmPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, atmPut.ID.OptionRight);\n            Assert.AreEqual(expectedAtmStrike, atmPut.ID.StrikePrice);\n            Assert.Greater(atmPut.ID.StrikePrice, otmPut.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0, 5)]           // zero strike distance from ATM\n        [TestCase(105, -5, 5)]          // negative strike distance from ATM\n        [TestCase(100, 1, -10)]         // negative strike distance from ATM\n        [TestCase(105, 1, 0)]           // zero strike distance from ATM\n        [TestCase(105, 5, 5)]           // far strike distance = near strike\n        [TestCase(105, 10, 5)]          // far strike distance < near strike\n        public void FailsIronCondor(decimal underlyingPrice, decimal nearStrikeFromAtm, decimal farStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .IronCondor(10, nearStrikeFromAtm, farStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 10, 4, 90, 95, 105, 110, 10, false)]\n        [TestCase(105, 5, 10, 4, 95, 100, 110, 115, 10, false)]\n        [TestCase(99.5, 5.25, 10.1, 4, 90, 95, 105, 110, 10, false)]\n        [TestCase(100, 5, 6, 4, 90, 95, 105, 110, 10, false)]\n        [TestCase(100, 1, 6, 4, 90, 95, 105, 110, 10, false)]\n        [TestCase(1000, 5, 10, 0, 0, 0, 0, 0, 10, false)]              // extreme strike\n        [TestCase(1, 5, 10, 0, 0, 0, 0, 0, 10, false)]                 // extreme strike\n        [TestCase(100, 5, 10, 4, 90, 95, 105, 110, 40, true)]\n        public void FiltersIronCondor(decimal underlyingPrice, decimal nearStrikeFromAtm, decimal farStrikeFromAtm, int expectedCount, decimal expectedFarPutStrike,\n            decimal expectedNearPutStrike, decimal expectedNearCallStrike, decimal expectedFarCallStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .IronCondor(minDaysTillExpiry, nearStrikeFromAtm, farStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var filteredCall = filtered.Where(x => x.ID.OptionRight == OptionRight.Call)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var nearCall = filteredCall[0];\n            var farCall = filteredCall[1];\n\n            Assert.AreEqual(expectedExpiry, nearCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, nearCall.ID.OptionRight);\n            Assert.AreEqual(expectedNearCallStrike, nearCall.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, farCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, farCall.ID.OptionRight);\n            Assert.AreEqual(expectedFarCallStrike, farCall.ID.StrikePrice);\n            Assert.Greater(farCall.ID.StrikePrice, nearCall.ID.StrikePrice);\n\n            var filteredPut = filtered.Where(x => x.ID.OptionRight == OptionRight.Put)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var farPut = filteredPut[0];\n            var nearPut = filteredPut[1];\n\n            Assert.AreEqual(expectedExpiry, farPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, farPut.ID.OptionRight);\n            Assert.AreEqual(expectedFarPutStrike, farPut.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, nearPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, nearPut.ID.OptionRight);\n            Assert.AreEqual(expectedNearPutStrike, nearPut.ID.StrikePrice);\n            Assert.Greater(nearPut.ID.StrikePrice, farPut.ID.StrikePrice);\n        }\n\n        [TestCase(100, 0)]           // zero strike distance from ATM\n        [TestCase(105, -5)]          // negative strike distance from ATM\n        public void FailsBoxSpread(decimal underlyingPrice, decimal strikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .BoxSpread(10, strikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, 5, 4, 95, 105, 10, false)]\n        [TestCase(105, 10, 4, 95, 115, 10, false)]\n        [TestCase(99.5, 5.25, 4, 95, 105, 10, false)]\n        [TestCase(100, 1, 4, 95, 105, 10, false)]\n        [TestCase(1000, 5, 0, 0, 0, 10, false)]                 // extreme strike\n        [TestCase(1, 5, 0, 0, 0, 10, false)]                    // extreme strike\n        [TestCase(100, 5, 4, 95, 105, 40, true)]\n        public void FiltersBoxSpread(decimal underlyingPrice, decimal strikeFromAtm, int expectedCount, decimal expectedLowerStrike,\n            decimal expectedHigherStrike, int minDaysTillExpiry, bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .BoxSpread(minDaysTillExpiry, strikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var filteredCall = filtered.Where(x => x.ID.OptionRight == OptionRight.Call)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var itmCall = filteredCall[0];\n            var otmCall = filteredCall[1];\n\n            Assert.AreEqual(expectedExpiry, itmCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, itmCall.ID.OptionRight);\n            Assert.AreEqual(expectedLowerStrike, itmCall.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, otmCall.ID.Date);\n            Assert.AreEqual(OptionRight.Call, otmCall.ID.OptionRight);\n            Assert.AreEqual(expectedHigherStrike, otmCall.ID.StrikePrice);\n            Assert.Greater(otmCall.ID.StrikePrice, itmCall.ID.StrikePrice);\n\n            var filteredPut = filtered.Where(x => x.ID.OptionRight == OptionRight.Put)\n                .OrderBy(x => x.ID.StrikePrice).ToList();\n            var otmPut = filteredPut[0];\n            var itmPut = filteredPut[1];\n\n            Assert.AreEqual(expectedExpiry, otmPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, otmPut.ID.OptionRight);\n            Assert.AreEqual(expectedLowerStrike, otmPut.ID.StrikePrice);\n            Assert.AreEqual(itmCall.ID.StrikePrice, otmPut.ID.StrikePrice);\n\n            Assert.AreEqual(expectedExpiry, itmPut.ID.Date);\n            Assert.AreEqual(OptionRight.Put, itmPut.ID.OptionRight);\n            Assert.AreEqual(expectedHigherStrike, itmPut.ID.StrikePrice);\n            Assert.Greater(itmPut.ID.StrikePrice, otmPut.ID.StrikePrice);\n            Assert.AreEqual(otmCall.ID.StrikePrice, itmPut.ID.StrikePrice);\n        }\n\n        [TestCase(-1, 10)]           // near expiry < 0 day\n        [TestCase(10, 10)]          // near expiry = far expiry\n        [TestCase(100, 10)]          // near expiry > far expiry\n        public void FailsJellyRoll(int nearDaysTillExpiry, int farDaysTillExpiry)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe =>\n                universe.JellyRoll(0, nearDaysTillExpiry, farDaysTillExpiry);\n\n            FailsFiltering(100, universeFunc);\n        }\n\n        // Expected expiry: (1) 2016/3/4, (2) 2016/5/4, (3) 2017/5/4\n        [TestCase(100, 0, 10, 40, 1, 2, 4)]\n        [TestCase(100, 10, 10, 40, 1, 2, 4)]\n        [TestCase(105, 0, 10, 40, 1, 2, 4)]\n        [TestCase(100, 0, 10, 350, 1, 3, 4)]\n        [TestCase(100, 0, 40, 350, 2, 3, 4)]\n        [TestCase(100, 0, 40, 41, 2, 3, 4)]         // only select later contracts for far expiry\n        [TestCase(100, 0, 500, 1000, 0, 0, 0)]      // select none if no further contracts available\n        public void FiltersJellyRoll(decimal underlyingPrice, decimal strikeFromAtm, int nearExpiry, int farExpiry, int expectedNearExpiryCase,\n            int expectedFarExpiryCase, int expectedCount)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .JellyRoll(strikeFromAtm, nearExpiry, farExpiry);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.Where(x => x.ID.OptionRight == OptionRight.Call).OrderBy(x => x.ID.Date);\n            var nearCall = orderedCalls.First();\n            var farCall = orderedCalls.Last();\n            var orderedPuts = filtered.Where(x => x.ID.OptionRight == OptionRight.Put).OrderBy(x => x.ID.Date);\n            var nearPut = orderedPuts.First();\n            var farPut = orderedPuts.Last();\n\n            Assert.AreEqual(OptionRight.Call, nearCall.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedNearExpiryCase], nearCall.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, nearCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, farCall.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedFarExpiryCase], farCall.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, farCall.ID.StrikePrice);\n            Assert.Greater(farCall.ID.Date, nearCall.ID.Date);\n\n            Assert.AreEqual(OptionRight.Put, nearPut.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedNearExpiryCase], nearPut.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, nearPut.ID.StrikePrice);\n            Assert.AreEqual(nearCall.ID.Date, nearPut.ID.Date);\n\n            Assert.AreEqual(OptionRight.Put, farPut.ID.OptionRight);\n            Assert.AreEqual(_expiries[expectedFarExpiryCase], farPut.ID.Date);\n            Assert.AreEqual(underlyingPrice + strikeFromAtm, farPut.ID.StrikePrice);\n            Assert.Greater(farPut.ID.Date, nearPut.ID.Date);\n            Assert.AreEqual(farCall.ID.Date, farPut.ID.Date);\n        }\n\n        [TestCase(100, 10, 10, 1)]          // equal strikes\n        [TestCase(100, 30, 10, 10)]         // equal strikes\n        [TestCase(100, 10, 30, 5)]          // middle strike > high strike\n        [TestCase(100, 100, 5, 30)]         // low strike > middle strike\n        public void FailsCallLadder(decimal underlyingPrice, decimal higherStrikeFromAtm, decimal MiddleStrikeFromAtm, decimal lowerStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallLadder(10, higherStrikeFromAtm, MiddleStrikeFromAtm, lowerStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, -5, 0, 5, 3, 95, 100, 105, 10, false)]\n        [TestCase(100, -5, 5, 10, 3, 95, 105, 110, 10, false)]\n        [TestCase(100, -10.5, 0.1, 5.6, 3, 90, 100, 105, 10, false)]\n        [TestCase(105.5, -4.9, 5.1, 10.3, 3, 100, 110, 115, 10, false)]\n        [TestCase(1000, -10, 0, 10, 0, 0, 0, 0, 10, false)]       // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, -5, 0, 5, 3, 85, 90, 95, 10, false)]\n        [TestCase(100, -5, 0, 5, 3, 95, 100, 105, 40, true)]\n        public void FiltersCallLadder(decimal underlyingPrice, decimal lowerStrikeFromAtm, decimal MiddleStrikeFromAtm, decimal higherStrikeFromAtm,\n            int expectedCount, decimal lowerExpectedStrike, decimal middeleExpectedStrike, decimal higherExpectedStrike, int minDaysTillExpiry,\n            bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .CallLadder(minDaysTillExpiry, higherStrikeFromAtm, MiddleStrikeFromAtm, lowerStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.OrderBy(x => x.ID.StrikePrice).ToList();\n            var lowerStrikeCall = orderedCalls[0];\n            var middleStrikeCall = orderedCalls[1];\n            var higherStrikeCall = orderedCalls[2];\n\n            Assert.AreEqual(OptionRight.Call, lowerStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikeCall.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, middleStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, middleStrikeCall.ID.Date);\n            Assert.AreEqual(middeleExpectedStrike, middleStrikeCall.ID.StrikePrice);\n            Assert.Greater(middleStrikeCall.ID.StrikePrice, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Call, higherStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikeCall.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikeCall.ID.StrikePrice);\n            Assert.Greater(higherStrikeCall.ID.StrikePrice, middleStrikeCall.ID.StrikePrice);\n        }\n\n        [TestCase(100, 10, 10, 1)]          // equal strikes\n        [TestCase(100, 30, 10, 10)]         // equal strikes\n        [TestCase(100, 10, 30, 5)]          // middle strike > high strike\n        [TestCase(100, 100, 5, 30)]         // low strike > middle strike\n        public void FailsPutLadder(decimal underlyingPrice, decimal higherStrikeFromAtm, decimal MiddleStrikeFromAtm, decimal lowerStrikeFromAtm)\n        {\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutLadder(10, higherStrikeFromAtm, MiddleStrikeFromAtm, lowerStrikeFromAtm);\n\n            FailsFiltering(underlyingPrice, universeFunc);\n        }\n\n        [TestCase(100, -5, 0, 5, 3, 95, 100, 105, 10, false)]\n        [TestCase(100, -5, 5, 10, 3, 95, 105, 110, 10, false)]\n        [TestCase(100, -10.5, 0.1, 5.6, 3, 90, 100, 105, 10, false)]\n        [TestCase(105.5, -4.9, 5.1, 10.3, 3, 100, 110, 115, 10, false)]\n        [TestCase(1000, -10, 0, 10, 0, 0, 0, 0, 10, false)]       // extreme strike will have no matching pair, returning no contract\n        [TestCase(1, -5, 0, 5, 3, 85, 90, 95, 10, false)]\n        [TestCase(100, -5, 0, 5, 3, 95, 100, 105, 40, true)]\n        public void FiltersPutLadder(decimal underlyingPrice, decimal lowerStrikeFromAtm, decimal MiddleStrikeFromAtm, decimal higherStrikeFromAtm,\n            int expectedCount, decimal lowerExpectedStrike, decimal middeleExpectedStrike, decimal higherExpectedStrike, int minDaysTillExpiry,\n            bool far = false)\n        {\n            var expectedExpiry = far ? new DateTime(2016, 5, 10) : new DateTime(2016, 3, 10);\n\n            Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc = universe => universe\n                                .PutLadder(minDaysTillExpiry, higherStrikeFromAtm, MiddleStrikeFromAtm, lowerStrikeFromAtm);\n            var filtered = Filtering(underlyingPrice, universeFunc);\n\n            Assert.AreEqual(expectedCount, filtered.Count);\n            if (expectedCount == 0)\n            {\n                return;\n            }\n\n            var orderedCalls = filtered.OrderBy(x => x.ID.StrikePrice).ToList();\n            var lowerStrikeCall = orderedCalls[0];\n            var middleStrikeCall = orderedCalls[1];\n            var higherStrikeCall = orderedCalls[2];\n\n            Assert.AreEqual(OptionRight.Put, lowerStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, lowerStrikeCall.ID.Date);\n            Assert.AreEqual(lowerExpectedStrike, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Put, middleStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, middleStrikeCall.ID.Date);\n            Assert.AreEqual(middeleExpectedStrike, middleStrikeCall.ID.StrikePrice);\n            Assert.Greater(middleStrikeCall.ID.StrikePrice, lowerStrikeCall.ID.StrikePrice);\n\n            Assert.AreEqual(OptionRight.Put, higherStrikeCall.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, higherStrikeCall.ID.Date);\n            Assert.AreEqual(higherExpectedStrike, higherStrikeCall.ID.StrikePrice);\n            Assert.Greater(higherStrikeCall.ID.StrikePrice, middleStrikeCall.ID.StrikePrice);\n        }\n\n        private List<Symbol> Filtering(decimal underlyingPrice, Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc)\n        {\n            return BaseFiltering(underlyingPrice, universeFunc, false);\n        }\n\n        private void FailsFiltering(decimal underlyingPrice, Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc)\n        {\n            BaseFiltering(underlyingPrice, universeFunc, true);\n        }\n\n        private List<Symbol> BaseFiltering(decimal underlyingPrice, Func<OptionFilterUniverse, OptionFilterUniverse> universeFunc, bool fails)\n        {\n            var underlying = new Tick { Value = underlyingPrice, Time = new DateTime(2016, 02, 26) };\n\n            Func<IDerivativeSecurityFilterUniverse<OptionUniverse>, IDerivativeSecurityFilterUniverse<OptionUniverse>> func =\n                universe => universeFunc(universe as OptionFilterUniverse);\n\n            var filter = new FuncSecurityDerivativeFilter<OptionUniverse>(func);\n            var symbols = CreateOptionUniverse();\n\n            var data = symbols.Select(x => new OptionUniverse() { Symbol = x });\n            var filterUniverse = new OptionFilterUniverse(null, data, underlying);\n            filterUniverse.Refresh(filterUniverse.Data, underlying, underlying.EndTime);\n\n            if (fails)\n            {\n                Assert.Throws<ArgumentException>(() => filter.Filter(filterUniverse));\n                return null;\n            }\n            return filter.Filter(filterUniverse).Select(x => x.Symbol).ToList();\n        }\n\n        static Symbol[] CreateOptionUniverse()\n        {\n            var ticker = \"SPY\";\n            var expiry = new DateTime(2016, 3, 10);\n            var farExpiry = new DateTime(2016, 5, 10);\n            var veryFarExpiry = new DateTime(2017, 5, 10);\n\n            return new[] {\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 85, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 90, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 95, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 100, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 105, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 110, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 115, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 85, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 90, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 95, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 100, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 105, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 110, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 115, expiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 85, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 90, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 95, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 100, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 105, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 110, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 115, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 85, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 90, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 95, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 100, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 105, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 110, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 115, farExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 85, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 90, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 95, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 100, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 105, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 110, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Put, 115, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 85, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 90, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 95, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 100, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 105, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 110, veryFarExpiry),\n                Symbol.CreateOption(ticker, Market.USA, OptionStyle.American, OptionRight.Call, 115, veryFarExpiry),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/OptionStrategyPositionGroupBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\n\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class OptionStrategyPositionGroupBuyingPowerModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private SecurityPortfolioManager _portfolio;\n        private QuantConnect.Securities.Equity.Equity _equity;\n        private Option _callOption;\n        private Option _putOption;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new AlgorithmStub();\n            _algorithm.SetCash(1000000);\n            _algorithm.SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n            _portfolio = _algorithm.Portfolio;\n\n            _equity = _algorithm.AddEquity(\"SPY\");\n\n            var strike = 200m;\n            var expiry = new DateTime(2016, 1, 15);\n\n            var callOptionSymbol = Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, strike, expiry);\n            _callOption = _algorithm.AddOptionContract(callOptionSymbol);\n\n            var putOptionSymbol = Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, strike, expiry);\n            _putOption = _algorithm.AddOptionContract(putOptionSymbol);\n        }\n\n        /// <summary>\n        /// All these test cases are based on the assumption that the initial cash is 1,000,000.\n        ///\n        /// The formula used for the order quantity is:\n        ///     - Staying in the same position side: (cash - initial quantity * unit initial margin) / (unit initial margin + premium)\n        ///     - Reversing the position side: (cash + initial quantity * unit initial margin) / (unit initial margin + premium)\n        /// </summary>\n        // option strategy definition, initial quantity, order quantity, expected result\n        private static readonly TestCaseData[] HasSufficientBuyingPowerForOrderTestCases = new[]\n        {\n            // Initial margin requirement|premium for NakedCall with quantities 1 and -1 are 19400|0 and 0|11200 respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 0, (1000000 - 0 * 19400) / (19400 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 0, (1000000 - 0 * 19400) / (19400 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 0, -(1000000 + 0 * 0) / (0 + 11200), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 0, -(1000000 + 0 * 0) / (0 + 11200) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 20, (1000000 - 20 * 19400) / (19400 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 20, (1000000 - 20 * 19400) / (19400 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 20, -(1000000 + 20 * 0) / (0 + 11200), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 20, -(1000000 + 20 * 0) / (0 + 11200) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -20, (1000000 + 20 * 19400) / (19400 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -20, (1000000 + 20 * 19400) / (19400 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -20, -(1000000 - 20 * 0) / (0 + 11200), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -20, -(1000000 - 20 * 0) / (0 + 11200) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for NakedPut with quantities 1 and -1 are 3002|0 and 0|2 respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 0, (1000000 - 0 * 3002) / (3002 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 0, (1000000 - 0 * 3002) / (3002 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 0, -(1000000 + 0 * 0) / (0 + 2), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 0, -(1000000 + 0 * 0) / (0 + 2) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 20, (1000000 - 20 * 3002) / (3002 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 20, (1000000 - 20 * 3002) / (3002 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 20, -(1000000 + 20 * 0) / (0 + 2), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 20, -(1000000 + 20 * 0) / (0 + 2) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -20, (1000000 + 20 * 3002) / (3002 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -20, (1000000 + 20 * 3002) / (3002 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -20, -(1000000 - 20 * 0) / (0 + 2), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -20, -(1000000 - 20 * 0) / (0 + 2) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for CoveredCall with quantities 1 and -1 are 19210|0 and 10250|11200 respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 0, (1000000 - 0 * 19210) / (19210 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 0, (1000000 - 0 * 19210) / (19210 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 0, -(1000000 + 0 * 10250) / (10250 + 11200), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 0, -(1000000 + 0 * 10250) / (10250 + 11200) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 20, (1000000 - 20 * 19210) / (19210 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 20, (1000000 - 20 * 19210) / (19210 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 20, -(1000000 + 20 * 10250) / (10250 + 11200), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 20, -(1000000 + 20 * 10250) / (10250 + 11200) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -20, (1000000 + 20 * 19210) / (19210 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -20, (1000000 + 20 * 19210) / (19210 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -20, -(1000000 - 20 * 10250) / (10250 + 11200), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -20, -(1000000 - 20 * 10250) / (10250 + 11200) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ProtectiveCall with quantities 1 and -1 are 10250|11200 and 19210|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 0, (1000000 - 0 * 10250) / (10250 + 11200), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 0, (1000000 - 0 * 10250) / (10250 + 11200) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 0, -(1000000 + 0 * 19210) / (19210 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 0, -(1000000 + 0 * 19210) / (19210 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 20, (1000000 - 20 * 10250) / (10250 + 11200), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 20, (1000000 - 20 * 10250) / (10250 + 11200) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 20, -(1000000 + 20 * 19210) / (19210 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 20, -(1000000 + 20 * 19210) / (19210 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -20, (1000000 + 20 * 10250) / (10250 + 11200), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -20, (1000000 + 20 * 10250) / (10250 + 11200) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -20, -(1000000 - 20 * 19210) / (19210 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -20, -(1000000 - 20 * 19210) / (19210 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for CoveredPut with quantities 1 and -1 are 10250|0 and 10250|2 respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 0, (1000000 - 0 * 10250) / (10250 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 0, (1000000 - 0 * 10250) / (10250 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 0, -(1000000 - 0 * 10250) / (10250 + 2), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 0, -(1000000 - 0 * 10250) / (10250 + 2) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 20, (1000000 - 20 * 10250) / (10250 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 20, (1000000 - 20 * 10250) / (10250 + 0) + 1, false), // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 20, -(1000000 + 20 * 10250) / (10250 + 2), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 20, -(1000000 + 20 * 10250) / (10250 + 2) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -20, (1000000 + 20 * 10250) / (10250 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -20, (1000000 + 20 * 10250) / (10250 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -20, -(1000000 - 20 * 10250) / (10250 + 2), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -20, -(1000000 - 20 * 10250) / (10250 + 2) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ProtectivePut with quantities 1 and -1 are 10250|2 and 10250|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 0, (1000000 - 0 * 10250) / (10250 + 2), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 0, (1000000 - 0 * 10250) / (10250 + 2) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 0, -(1000000 + 0 * 10250) / (10250 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 0, -(1000000 + 0 * 10250) / (10250 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 20, (1000000 - 20 * 10250) / (10250 + 2), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 20, (1000000 - 20 * 10250) / (10250 + 2) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 20, -(1000000 + 20 * 10250) / (10250 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 20, -(1000000 + 20 * 10250) / (10250 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -20, (1000000 + 20 * 10250) / (10250 + 2), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -20, (1000000 + 20 * 10250) / (10250 + 2) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -20, -(1000000 - 20 * 10250) / (10250 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -20, -(1000000 - 20 * 10250) / (10250 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ProtectiveCollar with quantities 1 and -1 are 26231|0 and 26231|1 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 0, (1000000 - 0 * 26231) / (26231 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 0, (1000000 - 0 * 26231) / (26231 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 0, -(1000000 + 0 * 26231) / (26231 + 1), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 0, -(1000000 + 0 * 26231) / (26231 + 1) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 20, (1000000 - 20 * 26231) / (26231 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 20, (1000000 - 20 * 26231) / (26231 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 20, -(1000000 + 20 * 26231) / (26231 + 1), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 20, -(1000000 + 20 * 26231) / (26231 + 1) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -20, (1000000 + 20 * 26231) / (26231 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -20, (1000000 + 20 * 26231) / (26231 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -20, -(1000000 - 20 * 26231) / (26231 + 1), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -20, -(1000000 - 20 * 26231) / (26231 + 1) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for Conversion with quantities 1 and -1 are 26295|0 and 26231|146 respectively\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 0, (1000000 - 0 * 26295) / (26295 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 0, (1000000 - 0 * 26295) / (26295 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 0, -(1000000 + 0 * 26231) / (26231 + 146), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 0, -(1000000 + 0 * 26231) / (26231 + 146) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 20, (1000000 - 20 * 26295) / (26295 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 20, (1000000 - 20 * 26295) / (26295 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 20, -(1000000 + 20 * 26231) / (26231 + 146), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 20, -(1000000 + 20 * 26231) / (26231 + 146) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -20, (1000000 + 20 * 26295) / (26295 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -20, (1000000 + 20 * 26295) / (26295 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -20, -(1000000 - 20 * 26231) / (26231 + 146), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -20, -(1000000 - 20 * 26231) / (26231 + 146) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ReverseConversion with quantities 1 and -1 are 26231|146 and 26295|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 0, (1000000 - 0 * 26231) / (26231 + 146), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 0, (1000000 - 0 * 26231) / (26231 + 146) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 0, -(1000000 + 0 * 26295) / (26295 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 0, -(1000000 + 0 * 26295) / (26295 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 20, (1000000 - 20 * 26231) / (26231 + 146), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 20, (1000000 - 20 * 26231) / (26231 + 146) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 20, -(1000000 + 20 * 26295) / (26295 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 20, -(1000000 + 20 * 26295) / (26295 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -20, (1000000 + 20 * 26231) / (26231 + 146), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -20, (1000000 + 20 * 26231) / (26231 + 146) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -20, -(1000000 - 20 * 26295) / (26295 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -20, -(1000000 - 20 * 26295) / (26295 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BearCallSpread with quantities 1 and -1 are 1000|0 and 0|1200 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 0, -(1000000 + 0 * 0) / (0 + 1200), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 0, -(1000000 + 0 * 0) / (0 + 1200) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 20, -(1000000 + 20 * 0) / (0 + 1200), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 20, -(1000000 + 20 * 0) / (0 + 1200) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -20, -(1000000 - 20 * 0) / (0 + 1200), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -20, -(1000000 - 20 * 0) / (0 + 1200) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BearPutSpread with quantities 1 and -1 are 0|1 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 0, (1000000 - 0 * 0) / (0 + 1), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 0, (1000000 - 0 * 0) / (0 + 1) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 20, (1000000 - 20 * 0) / (0 + 1), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 20, (1000000 - 20 * 0) / (0 + 1) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -20, (1000000 + 20 * 0) / (0 + 1), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -20, (1000000 + 20 * 0) / (0 + 1) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BullCallSpread with quantities 1 and -1 are 0|1200 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 0, (1000000 - 0 * 0) / (0 + 1200), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 0, (1000000 - 0 * 0) / (0 + 1200) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 20, (1000000 - 20 * 0) / (0 + 1200), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 20, (1000000 - 20 * 0) / (0 + 1200) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -20, (1000000 + 20 * 0) / (0 + 1200), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -20, (1000000 + 20 * 0) / (0 + 1200) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BullPutSpread with quantities 1 and -1 are 1000|0 and 0|1 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 0, -(1000000 + 0 * 0) / (0 + 1), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 0, -(1000000 + 0 * 0) / (0 + 1) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 20, -(1000000 + 20 * 0) / (0 + 1), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 20, -(1000000 + 20 * 0) / (0 + 1) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -20, -(1000000 - 20 * 0) / (0 + 1), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -20, -(1000000 - 20 * 0) / (0 + 1) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for Straddle with quantities 1 and -1 are 0|11202 and 19402|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 0, (1000000 - 0 * 0) / (0 + 11202), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 0, (1000000 - 0 * 0) / (0 + 11202) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 0, -(1000000 + 0 * 19402) / (19402 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 0, -(1000000 + 0 * 19402) / (19402 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 20, (1000000 - 20 * 0) / (0 + 11202), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 20, (1000000 - 20 * 0) / (0 + 11202) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 20, -(1000000 + 20 * 19402) / (19402 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 20, -(1000000 + 20 * 19402) / (19402 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -20, (1000000 + 20 * 0) / (0 + 11202), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -20, (1000000 + 20 * 0) / (0 + 11202) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -20, -(1000000 - 20 * 19402) / (19402 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -20, -(1000000 - 20 * 19402) / (19402 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortStraddle with quantities 1 and -1 are 19402|0 and 0|11202 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 0, (1000000 - 0 * 19402) / (19402 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 0, (1000000 - 0 * 19402) / (19402 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 0, -(1000000 + 0 * 0) / (0 + 11202), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 0, -(1000000 + 0 * 0) / (0 + 11202) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 20, (1000000 - 20 * 19402) / (19402 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 20, (1000000 - 20 * 19402) / (19402 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 20, -(1000000 + 20 * 0) / (0 + 11202), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 20, -(1000000 + 20 * 0) / (0 + 11202) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -20, (1000000 + 20 * 19402) / (19402 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -20, (1000000 + 20 * 19402) / (19402 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -20, -(1000000 - 20 * 0) / (0 + 11202), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -20, -(1000000 - 20 * 0) / (0 + 11202) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for Strangle with quantities 1 and -1 are 0|10002 and 18202|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 0, (1000000 - 0 * 0) / (0 + 10002), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 0, (1000000 - 0 * 0) / (0 + 10002) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 0, -(1000000 + 0 * 18202) / (18202 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 0, -(1000000 + 0 * 18202) / (18202 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 20, (1000000 - 20 * 0) / (0 + 10002), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 20, (1000000 - 20 * 0) / (0 + 10002) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 20, -(1000000 + 20 * 18202) / (18202 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 20, -(1000000 + 20 * 18202) / (18202 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -20, (1000000 + 20 * 0) / (0 + 10002), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -20, (1000000 + 20 * 0) / (0 + 10002) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -20, -(1000000 - 20 * 18202) / (18202 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -20, -(1000000 - 20 * 18202) / (18202 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortStrangle with quantities 1 and -1 are 18202|0 and 0|10002 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 0, (1000000 - 0 * 18202) / (18202 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 0, (1000000 - 0 * 18202) / (18202 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 0, -(1000000 + 0 * 0) / (0 + 10002), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 0, -(1000000 + 0 * 0) / (0 + 10002) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 20, (1000000 - 20 * 18202) / (18202 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 20, (1000000 - 20 * 18202) / (18202 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 20, -(1000000 + 20 * 0) / (0 + 10002), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 20, -(1000000 + 20 * 0) / (0 + 10002) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -20, (1000000 + 20 * 18202) / (18202 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -20, (1000000 + 20 * 18202) / (18202 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -20, -(1000000 - 20 * 0) / (0 + 10002), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -20, -(1000000 - 20 * 0) / (0 + 10002) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ButterflyCall with quantities 1 and -1 are 0|400 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 0, (1000000 - 0 * 0) / (0 + 400), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 0, (1000000 - 0 * 0) / (0 + 400) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 20, (1000000 - 20 * 0) / (0 + 400), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 20, (1000000 - 20 * 0) / (0 + 400) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -20, (1000000 + 20 * 0) / (0 + 400), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -20, (1000000 + 20 * 0) / (0 + 400) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortButterflyCall with quantities 1 and -1 are 1000|0 and 0|400 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 0, -(1000000 + 0 * 0) / (0 + 400), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 0, -(1000000 + 0 * 0) / (0 + 400) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 20, -(1000000 + 20 * 0) / (0 + 400), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 20, -(1000000 + 20 * 0) / (0 + 400) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -20, -(1000000 - 20 * 0) / (0 + 400), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -20, -(1000000 - 20 * 0) / (0 + 400) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ButterflyPut with quantities 1 and -1 are 0|1 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 0, (1000000 - 0 * 0) / (0 + 1), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 0, (1000000 - 0 * 0) / (0 + 1) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 20, (1000000 - 20 * 0) / (0 + 1), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 20, (1000000 - 20 * 0) / (0 + 1) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -20, (1000000 + 20 * 0) / (0 + 1), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -20, (1000000 + 20 * 0) / (0 + 1) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortButterflyPut with quantities 1 and -1 are 1000|0 and 0|1 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 0, -(1000000 + 0 * 0) / (0 + 1), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 0, -(1000000 + 0 * 0) / (0 + 1) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 20, -(1000000 + 20 * 0) / (0 + 1), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 20, -(1000000 + 20 * 0) / (0 + 1) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -20, -(1000000 - 20 * 0) / (0 + 1), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -20, -(1000000 - 20 * 0) / (0 + 1) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for CallCalendarSpread with quantities 1 and -1 are 0|200 and 19400|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 0, (1000000 - 0 * 0) / (0 + 200), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 0, (1000000 - 0 * 0) / (0 + 200) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 0, -(1000000 + 0 * 19400) / (19400 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 0, -(1000000 + 0 * 19400) / (19400 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 20, (1000000 - 20 * 0) / (0 + 200), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 20, (1000000 - 20 * 0) / (0 + 200) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 20, -(1000000 + 20 * 19400) / (19400 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 20, -(1000000 + 20 * 19400) / (19400 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -20, (1000000 + 20 * 0) / (0 + 200), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -20, (1000000 + 20 * 0) / (0 + 200) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -20, -(1000000 - 20 * 19400) / (19400 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -20, -(1000000 - 20 * 19400) / (19400 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortCallCalendarSpread with quantities 1 and -1 are 19400|0 and 0|200 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 0, (1000000 - 0 * 19400) / (19400 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 0, (1000000 - 0 * 19400) / (19400 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 0, -(1000000 + 0 * 0) / (0 + 200), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 0, -(1000000 + 0 * 0) / (0 + 200) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 20, (1000000 - 20 * 19400) / (19400 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 20, (1000000 - 20 * 19400) / (19400 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 20, -(1000000 + 20 * 0) / (0 + 200), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 20, -(1000000 + 20 * 0) / (0 + 200) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -20, (1000000 + 20 * 19400) / (19400 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -20, (1000000 + 20 * 19400) / (19400 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -20, -(1000000 - 20 * 0) / (0 + 200), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -20, -(1000000 - 20 * 0) / (0 + 200) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for PutCalendarSpread with quantities 1 and -1 are 0|1 and 3002|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 0, (1000000 - 0 * 0) / (0 + 1), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 0, (1000000 - 0 * 0) / (0 + 1) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 0, -(1000000 + 0 * 3002) / (3002 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 0, -(1000000 + 0 * 3002) / (3002 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 20, (1000000 - 20 * 0) / (0 + 1), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 20, (1000000 - 20 * 0) / (0 + 1) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 20, -(1000000 + 20 * 3002) / (3002 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 20, -(1000000 + 20 * 3002) / (3002 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -20, (1000000 + 20 * 0) / (0 + 1), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -20, (1000000 + 20 * 0) / (0 + 1) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -20, -(1000000 - 20 * 3002) / (3002 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -20, -(1000000 - 20 * 3002) / (3002 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortPutCalendarSpread with quantities 1 and -1 are 3002|0 and 0|1 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 0, (1000000 - 0 * 3002) / (3002 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 0, (1000000 - 0 * 3002) / (3002 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 0, -(1000000 + 0 * 0) / (0 + 1), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 0, -(1000000 + 0 * 0) / (0 + 1) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 20, (1000000 - 20 * 3002) / (3002 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 20, (1000000 - 20 * 3002) / (3002 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 20, -(1000000 + 20 * 0) / (0 + 1), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 20, -(1000000 + 20 * 0) / (0 + 1) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -20, (1000000 + 20 * 3002) / (3002 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -20, (1000000 + 20 * 3002) / (3002 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -20, -(1000000 - 20 * 0) / (0 + 1), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -20, -(1000000 - 20 * 0) / (0 + 1) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for IronButterfly with quantities 1 and -1 are 1000|0 and 0|801 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 0, -(1000000 + 0 * 0) / (0 + 801), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 0, -(1000000 + 0 * 0) / (0 + 801) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 20, -(1000000 + 20 * 0) / (0 + 801), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 20, -(1000000 + 20 * 0) / (0 + 801) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -20, -(1000000 - 20 * 0) / (0 + 801), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -20, -(1000000 - 20 * 0) / (0 + 801) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortIronButterfly with quantities 1 and -1 are 0|801 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 0, (1000000 - 0 * 0) / (0 + 801), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 0, (1000000 - 0 * 0) / (0 + 801) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 20, (1000000 - 20 * 0) / (0 + 801), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 20, (1000000 - 20 * 0) / (0 + 801) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -20, (1000000 + 20 * 0) / (0 + 801), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -20, (1000000 + 20 * 0) / (0 + 801) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for IronCondor with quantities 1 and -1 are 1000|0 and 0|1001 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 0, (1000000 - 0 * 1000) / (1000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 0, (1000000 - 0 * 1000) / (1000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 0, -(1000000 + 0 * 0) / (0 + 1001), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 0, -(1000000 + 0 * 0) / (0 + 1001) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 20, (1000000 - 20 * 1000) / (1000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 20, (1000000 - 20 * 1000) / (1000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 20, -(1000000 + 20 * 0) / (0 + 1001), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 20, -(1000000 + 20 * 0) / (0 + 1001) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -20, (1000000 + 20 * 1000) / (1000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -20, (1000000 + 20 * 1000) / (1000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -20, -(1000000 - 20 * 0) / (0 + 1001), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -20, -(1000000 - 20 * 0) / (0 + 1001) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortIronCondor with quantities 1 and -1 are 0|1001 and 1000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 0, (1000000 - 0 * 0) / (0 + 1001), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 0, (1000000 - 0 * 0) / (0 + 1001) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 0, -(1000000 + 0 * 1000) / (1000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 0, -(1000000 + 0 * 1000) / (1000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 20, (1000000 - 20 * 0) / (0 + 1001), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 20, (1000000 - 20 * 0) / (0 + 1001) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 20, -(1000000 + 20 * 1000) / (1000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 20, -(1000000 + 20 * 1000) / (1000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -20, (1000000 + 20 * 0) / (0 + 1001), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -20, (1000000 + 20 * 0) / (0 + 1001) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -20, -(1000000 - 20 * 1000) / (1000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -20, -(1000000 - 20 * 1000) / (1000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BoxSpread with quantities 1 and -1 are 0|2003 and 2000|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 0, (1000000 - 0 * 0) / (0 + 2003), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 0, (1000000 - 0 * 0) / (0 + 2003) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 0, -(1000000 + 0 * 2000) / (2000 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 0, -(1000000 + 0 * 2000) / (2000 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 20, (1000000 - 20 * 0) / (0 + 2003), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 20, (1000000 - 20 * 0) / (0 + 2003) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 20, -(1000000 + 20 * 2000) / (2000 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 20, -(1000000 + 20 * 2000) / (2000 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -20, (1000000 + 20 * 0) / (0 + 2003), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -20, (1000000 + 20 * 0) / (0 + 2003) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -20, -(1000000 - 20 * 2000) / (2000 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -20, -(1000000 - 20 * 2000) / (2000 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortBoxSpread with quantities 1 and -1 are 2000|0 and 0|2003 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 0, (1000000 - 0 * 2000) / (2000 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 0, (1000000 - 0 * 2000) / (2000 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 0, -(1000000 + 0 * 0) / (0 + 2003), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 0, -(1000000 + 0 * 0) / (0 + 2003) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 20, (1000000 - 20 * 2000) / (2000 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 20, (1000000 - 20 * 2000) / (2000 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 20, -(1000000 + 20 * 0) / (0 + 2003), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 20, -(1000000 + 20 * 0) / (0 + 2003) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -20, (1000000 + 20 * 2000) / (2000 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -20, (1000000 + 20 * 2000) / (2000 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -20, -(1000000 - 20 * 0) / (0 + 2003), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -20, -(1000000 - 20 * 0) / (0 + 2003) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for JellyRoll with quantities 1 and -1 are 11448|84 and 11537|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 0, (1000000 - 0 * 11448) / (11448 + 84), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 0, (1000000 - 0 * 11448) / (11448 + 84) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 0, -(1000000 + 0 * 11537) / (11537 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 0, -(1000000 + 0 * 11537) / (11537 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 20, (1000000 - 20 * 11448) / (11448 + 84), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 20, (1000000 - 20 * 11448) / (11448 + 84) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 20, -(1000000 + 20 * 11537) / (11537 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 20, -(1000000 + 20 * 11537) / (11537 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -20, (1000000 + 20 * 11448) / (11448 + 84), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -20, (1000000 + 20 * 11448) / (11448 + 84) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -20, -(1000000 - 20 * 11537) / (11537 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -20, -(1000000 - 20 * 11537) / (11537 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for ShortJellyRoll with quantities 1 and -1 are 11537|0 and 11448|84 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 0, (1000000 - 0 * 11537) / (11537 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 0, (1000000 - 0 * 11537) / (11537 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 0, -(1000000 + 0 * 11448) / (11448 + 84), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 0, -(1000000 + 0 * 11448) / (11448 + 84) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 20, (1000000 - 20 * 11537) / (11537 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 20, (1000000 - 20 * 11537) / (11537 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 20, -(1000000 + 20 * 11448) / (11448 + 84), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 20, -(1000000 + 20 * 11448) / (11448 + 84) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -20, (1000000 + 20 * 11537) / (11537 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -20, (1000000 + 20 * 11537) / (11537 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -20, -(1000000 - 20 * 11448) / (11448 + 84), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -20, -(1000000 - 20 * 11448) / (11448 + 84) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BearCallLadder with quantities 1 and -1 are 400|0 and 10407|252 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 0, (1000000 - 0 * 400) / (400 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 0, (1000000 - 0 * 400) / (400 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 0, -(1000000 + 0 * 10407) / (10407 + 252), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 0, -(1000000 + 0 * 10407) / (10407 + 252) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 20, (1000000 - 20 * 400) / (400 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 20, (1000000 - 20 * 400) / (400 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 20, -(1000000 + 20 * 10407) / (10407 + 252), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 20, -(1000000 + 20 * 10407) / (10407 + 252) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -20, (1000000 + 20 * 400) / (400 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -20, (1000000 + 20 * 400) / (400 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -20, -(1000000 - 20 * 10407) / (10407 + 252), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -20, -(1000000 - 20 * 10407) / (10407 + 252) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BearPutLadder with quantities 1 and -1 are 10533|346 and 400|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 0, (1000000 - 0 * 10533) / (10533 + 346), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 0, (1000000 - 0 * 10533) / (10533 + 346) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 0, -(1000000 + 0 * 400) / (400 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 0, -(1000000 + 0 * 400) / (400 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 20, (1000000 - 20 * 10533) / (10533 + 346), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 20, (1000000 - 20 * 10533) / (10533 + 346) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 20, -(1000000 + 20 * 400) / (400 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 20, -(1000000 + 20 * 400) / (400 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -20, (1000000 + 20 * 10533) / (10533 + 346), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -20, (1000000 + 20 * 10533) / (10533 + 346) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -20, -(1000000 - 20 * 400) / (400 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -20, -(1000000 - 20 * 400) / (400 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BullCallLadder with quantities 1 and -1 are 10407|252 and 400|0 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 0, (1000000 - 0 * 10407) / (10407 + 252), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 0, (1000000 - 0 * 10407) / (10407 + 252) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 0, -(1000000 + 0 * 400) / (400 + 0), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 0, -(1000000 + 0 * 400) / (400 + 0) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 20, (1000000 - 20 * 10407) / (10407 + 252), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 20, (1000000 - 20 * 10407) / (10407 + 252) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 20, -(1000000 + 20 * 400) / (400 + 0), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 20, -(1000000 + 20 * 400) / (400 + 0) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -20, (1000000 + 20 * 10407) / (10407 + 252), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -20, (1000000 + 20 * 10407) / (10407 + 252) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -20, -(1000000 - 20 * 400) / (400 + 0), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -20, -(1000000 - 20 * 400) / (400 + 0) - 1, false),  // -20 to max short + 1\n            // Initial margin requirement|premium for BullPutLadder with quantities 1 and -1 are 400|0 and 10533|346 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 0, (1000000 - 0 * 400) / (400 + 0), true), // 0 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 0, (1000000 - 0 * 400) / (400 + 0) + 1, false), // 0 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 0, -(1000000 + 0 * 10533) / (10533 + 346), true), // 0 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 0, -(1000000 + 0 * 10533) / (10533 + 346) - 1, false),    // 0 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 20, (1000000 - 20 * 400) / (400 + 0), true),    // 20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 20, (1000000 - 20 * 400) / (400 + 0) + 1, false),    // 20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 20, -20, true), // 20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 20, -(1000000 + 20 * 10533) / (10533 + 346), true), // 20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 20, -(1000000 + 20 * 10533) / (10533 + 346) - 1, false),  // 20 to max short + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -20, (1000000 + 20 * 400) / (400 + 0), true),   // -20 to max long\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -20, (1000000 + 20 * 400) / (400 + 0) + 1, false),   // -20 to max long + 1\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -20, 20, true), // -20 to 0\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -20, -(1000000 - 20 * 10533) / (10533 + 346), true),    // -20 to max short\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -20, -(1000000 - 20 * 10533) / (10533 + 346) - 1, false),  // -20 to max short + 1\n        };\n\n        [TestCaseSource(nameof(HasSufficientBuyingPowerForOrderTestCases))]\n        public void HasSufficientBuyingPowerForOrder(OptionStrategyDefinition optionStrategy, int initialPositionQuantity, int orderQuantity,\n            bool expectedResult)\n        {\n            _algorithm.SetCash(1000000);\n\n            var initialPositionGroup = SetUpOptionStrategy(optionStrategy, initialPositionQuantity);\n\n            var orders = GetPositionGroupOrders(initialPositionGroup, initialPositionQuantity != 0 ? initialPositionQuantity : 1, orderQuantity);\n            Assert.IsTrue(_portfolio.Positions.TryCreatePositionGroup(orders, out var ordersPositionGroup));\n\n            var result = initialPositionGroup.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                new HasSufficientPositionGroupBuyingPowerForOrderParameters(_portfolio, ordersPositionGroup, orders));\n\n            Assert.AreEqual(expectedResult, result.IsSufficient, result.Reason);\n        }\n\n        [Test]\n        public void HasSufficientBuyingPowerForReducingStrategyOrder()\n        {\n            const decimal price = 1m;\n            const decimal underlyingPrice = 200m;\n\n            _equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n            _callOption.SetMarketPrice(new Tick { Value = price });\n            _putOption.SetMarketPrice(new Tick { Value = price });\n\n            var initialHoldingsQuantity = -10;\n            _callOption.Holdings.SetHoldings(1.5m, initialHoldingsQuantity);\n            _putOption.Holdings.SetHoldings(1m, initialHoldingsQuantity);\n\n            _algorithm.SetCash(_portfolio.TotalMarginUsed * 0.95m);\n\n            var quantity = -initialHoldingsQuantity / 2;\n            var orders = GetStrategyOrders(quantity);\n\n            Assert.IsTrue(_portfolio.Positions.TryCreatePositionGroup(orders, out var positionGroup));\n\n            var hasSufficientBuyingPowerResult = positionGroup.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                new HasSufficientPositionGroupBuyingPowerForOrderParameters(_portfolio, positionGroup, orders));\n\n            Assert.IsTrue(hasSufficientBuyingPowerResult.IsSufficient);\n        }\n\n        // Increasing short position\n        [TestCase(-10, -11)]\n        // Decreasing short position\n        [TestCase(-10, -9)]\n        // Liquidating\n        [TestCase(-10, 0)]\n        public void PositionGroupOrderQuantityCalculationForDeltaBuyingPowerFromShortPosition(int initialHoldingsQuantity, int finalPositionQuantity)\n        {\n            _algorithm.SetCash(100000);\n            // Just making sure we start from a short position\n            var absQuantity = Math.Abs(initialHoldingsQuantity);\n            initialHoldingsQuantity = -absQuantity;\n\n            SetUpOptionStrategy(initialHoldingsQuantity);\n            var positionGroup = _portfolio.Positions.Groups.Single();\n\n            var expectedQuantity = initialHoldingsQuantity - finalPositionQuantity;\n            var usedMargin = _portfolio.TotalMarginUsed;\n            var marginPerNakedShortUnit = usedMargin / absQuantity;\n\n            var deltaBuyingPower = expectedQuantity * marginPerNakedShortUnit;\n            // Add a small buffer to avoid precision errors that occur when converting the delta buying power request into a target one\n            deltaBuyingPower *= finalPositionQuantity < initialHoldingsQuantity ? 1.001m : 0.999m;\n\n            ComputeAndAssertQuantityForDeltaBuyingPower(positionGroup, expectedQuantity, deltaBuyingPower);\n        }\n\n        // Increasing position\n        [TestCase(10, 11)]\n        // Decreasing position\n        [TestCase(10, 9)]\n        // Liquidating\n        [TestCase(10, 0)]\n        public void PositionGroupOrderQuantityCalculationForDeltaBuyingPowerFromLongPosition(int initialHoldingsQuantity, int finalPositionQuantity)\n        {\n            _algorithm.SetCash(100000);\n            // Just making sure we start from a long position\n            initialHoldingsQuantity = Math.Abs(initialHoldingsQuantity);\n\n            var positionGroup = SetUpOptionStrategy(OptionStrategyDefinitions.CoveredCall, initialHoldingsQuantity);\n\n            var expectedQuantity = finalPositionQuantity - initialHoldingsQuantity;\n            var usedMargin = _portfolio.TotalMarginUsed;\n            var marginPerLongUnit = Math.Abs(positionGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, positionGroup) / initialHoldingsQuantity);\n\n            var shortUnitGroup = positionGroup.WithQuantity(-1, _portfolio.Positions);\n            var marginPerNakedShortUnit = Math.Abs(shortUnitGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, shortUnitGroup));\n\n            var deltaBuyingPower = finalPositionQuantity >= 0\n                //Going even longer / Going \"less\" long/ Liquidating\n                ? expectedQuantity * marginPerLongUnit\n                // Going short from long\n                : -usedMargin + Math.Abs(finalPositionQuantity) * marginPerNakedShortUnit;\n\n            var initialMarginRequirement = positionGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, positionGroup);\n            var maintenanceMargin = positionGroup.BuyingPowerModel.GetMaintenanceMargin(_portfolio, positionGroup);\n            // Adjust the delta buying power:\n            // GetMaximumLotsForDeltaBuyingPower will add the delta buying power to the maintenance margin and used that as a target margin,\n            // but then GetMaximumLotsForTargetBuyingPower will work with initial margin requirement so we make sure the resulting quantity\n            // can be ordered. In order to match this, we need to adjust the delta buying power by the difference between the initial margin\n            // requirement  and maintenance margin.\n            deltaBuyingPower += initialMarginRequirement - maintenanceMargin;\n\n            ComputeAndAssertQuantityForDeltaBuyingPower(positionGroup, expectedQuantity, deltaBuyingPower);\n        }\n\n        [TestCase(-10, 1, +1)]\n        [TestCase(-10, 1, -1)]\n        [TestCase(-10, 0.5, +1)]\n        [TestCase(-10, 0.5, -1)]\n        [TestCase(-10, 2, +1)]\n        [TestCase(-10, 2, -1)]\n        [TestCase(10, 1, +1)]\n        [TestCase(10, 1, -1)]\n        [TestCase(10, 0.5, +1)]\n        [TestCase(10, 0.5, -1)]\n        [TestCase(10, 2, +1)]\n        [TestCase(10, 2, -1)]\n        public void OrderQuantityCalculation(int initialHoldingsQuantity, decimal targetMarginPercent, int targetMarginDirection)\n        {\n            // The targetMarginDirection whether we want to go in the same direction as the holdings:\n            //   +1: short will go shorter and long will go longer\n            //   -1: short will go towards long and vice-versa\n\n            var positionGroup = SetUpOptionStrategy(OptionStrategyDefinitions.CoveredCall, initialHoldingsQuantity);\n            var currentUsedMargin = Math.Abs(positionGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, positionGroup));\n\n            var longUnitGroup = positionGroup.CreateUnitGroup(_portfolio.Positions);\n            var longUnitMargin = Math.Abs(longUnitGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, longUnitGroup));\n\n            var expectedQuantity = 0m;\n            var finalPositionQuantity = 0m;\n            var targetFinalMargin = 0m;\n            // Going to the opposite side\n            if (targetMarginPercent > 1 && targetMarginDirection == -1)\n            {\n                var shortUnitGroup = positionGroup.WithQuantity(-1, _portfolio.Positions);\n                var shortUnitMargin = Math.Abs(shortUnitGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, shortUnitGroup));\n                finalPositionQuantity = Math.Floor(-currentUsedMargin / shortUnitMargin);\n                expectedQuantity = -Math.Abs(initialHoldingsQuantity) + finalPositionQuantity;\n\n                targetFinalMargin = finalPositionQuantity * shortUnitMargin;\n            }\n            else\n            {\n                expectedQuantity = Math.Abs(initialHoldingsQuantity * targetMarginPercent) * Math.Sign(targetMarginDirection);\n                finalPositionQuantity = initialHoldingsQuantity + Math.Sign(initialHoldingsQuantity) * expectedQuantity;\n\n                targetFinalMargin = Math.Abs(finalPositionQuantity * longUnitMargin);\n            }\n\n            var quantity = (positionGroup.BuyingPowerModel as OptionStrategyPositionGroupBuyingPowerModel).GetPositionGroupOrderQuantity(_portfolio,\n                positionGroup, currentUsedMargin, targetFinalMargin, longUnitGroup, longUnitMargin, out _);\n\n            // Liquidating\n            if (targetFinalMargin == 0)\n            {\n                // Should always be negative when liquidating (or reducing)\n                Assert.AreEqual(-Math.Abs(initialHoldingsQuantity), quantity);\n            }\n            // Reducing the position\n            else if (targetFinalMargin < currentUsedMargin)\n            {\n                Assert.Less(quantity, 0);\n            }\n            // Increasing the position\n            else\n            {\n                Assert.Greater(quantity, 0);\n            }\n\n            Assert.AreEqual(expectedQuantity, quantity);\n        }\n\n        /// <summary>\n        /// Test cases for the <see cref=\"OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement\"/> method.\n        ///\n        /// TODO: We should come back and revisit these test cases to make sure they are correct.\n        /// The approximate values from IB for the prices used in the test are in the comments.\n        /// For instance, see the test case for the CoveredCall strategy. The margin values do not match IB's values.\n        ///\n        /// Test cases marked as explicit will fail if ran, they have an approximate expected value based on IB's margin requirements.\n        /// </summary>\n        private static readonly TestCaseData[] InitialMarginRequirementsTestCases = new[]\n        {\n            // OptionStrategyDefinition, initialHoldingsQuantity, expectedInitialMarginRequirement\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 1, 21200m),                       // IB:  21200\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -1, 0m),                          // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 1, 3000m),                         // IB:  3000\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -1, 0m),                           // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 1, 19000m),                     // IB:  19325\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -1, 12000m),                    // IB:  12338.58\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 1, 12000m),                  // IB:  inverted covered call\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -1, 19000m),                 // IB:  covered call\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 1, 12000m),                      // IB:  12331.38\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -1, 10000m),                     // IB:  10276.15\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 1, 10000m),                   // IB:  inverted covered put\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -1, 12000m),                  // IB:  covered put\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 1, 26231m),                // IB:  26231\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -1, 26231m),               // IB:  same as long\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 1, 26295m),                      // IB:  26295\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -1, 26230m),                     // IB:  reverse conversion\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 1, 26231m),               // IB:  26231\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -1, 26295m),              // IB:  conversion\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 1, 1000m),                   // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -1, 0m),                     // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 1, 0m),                       // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -1, 1000m),                   // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -1, 1000m),                  // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 1, 1000m),                    // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 1, 0m),                            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -1, 20000m),                       // IB:  20624\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 1, 20000m),                   // IB:  20624\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 1, 0m),                            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -1, 21000m),                       // IB:  20752\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 1, 21000m),                   // IB:  20752\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 1, 0m),                       // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -1, 1000m),                   // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 1, 1000m),               // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -1, 0m),                 // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 1, 0m),                        // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -1, 1000m),                    // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 1, 1000m),                // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -1, 20000m),             // IB:  20537\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 1, 20000m),         // IB:  20537\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -1, 0m),            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 1, 0m),                   // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -1, 3000m),               // IB:  3121\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 1, 3000m),           // IB:  3121\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -1, 0m),             // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 1, 1000m),                    // IB:  1010    note: 1% commission\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -1, 0m),                      // IB:  short iron butterfly\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -1, 1000m),              // IB:  iron butterfly\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 1, 1000m),                       // IB:  1001\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -1, 0m),                         // IB:  short iron condor\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 1, 0m),                     // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -1, 1000m),                 // IB:  iron condor\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 1, 0m),                           // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -1, 2000m),                       // IB:  short box spread\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 1, 2000m),                   // IB:  2000\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -1, 0m),                     // IB:  box spread\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 1, 11447.5m),                     // IB:  11459\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -1, 11537.2m),                    // IB:  short jelly roll\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 1, 11537.2m),                // IB:  11589\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -1, 11447.5m),               // IB:  jelly roll\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 1, 400m),                    // IB:  400\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -1, 10407.04m),              // IB:  BullCallLadder\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 1, 10407.04m),               // IB:  10407.04\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -1, 400m),                   // IB:  BearCallLadder\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 1, 10532.56m),                // IB:  10532.56\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -1, 400m),                    // IB:  BullPutLadder\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 1, 400m),                     // IB:  400\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -1, 10532.56m),               // IB:  BearPutLadder\n        };\n\n        [TestCaseSource(nameof(InitialMarginRequirementsTestCases))]\n        public void GetsInitialMarginRequirement(OptionStrategyDefinition optionStrategyDefinition, int quantity,\n            decimal expectedInitialMarginRequirement)\n        {\n            var positionGroup = SetUpOptionStrategy(optionStrategyDefinition, quantity);\n\n            var initialMarginRequirement = (OptionInitialMargin)positionGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                new PositionGroupInitialMarginParameters(_portfolio, positionGroup));\n\n            Assert.AreEqual((double)expectedInitialMarginRequirement, (double)initialMarginRequirement.ValueWithoutPremium,\n                (double)(0.2m * expectedInitialMarginRequirement));\n        }\n\n        private static readonly TestCaseData[] CoveredCallInitialMarginRequirementsTestCases = new[]\n        {\n            // OptionStrategyDefinition, initialHoldingsQuantity, expectedInitialMarginRequirement, option strike\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 2, 53700m, 200),                     // IB: 53,714\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 2, 38000m, 300),                     // IB: 38,756\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 2, 23000m, 400),                     // IB: 23,752\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 2, 21000m, 500),                     // IB: 20,939\n        };\n\n        [TestCaseSource(nameof(CoveredCallInitialMarginRequirementsTestCases))]\n        public void CoveredCallInitialMarginRequirement(OptionStrategyDefinition optionStrategyDefinition, int quantity,\n            decimal expectedInitialMarginRequirement, int strike)\n        {\n            var positionGroup = SetUpOptionStrategy(optionStrategyDefinition, quantity, strike);\n\n            var initialMarginRequirement = positionGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                new PositionGroupInitialMarginParameters(_portfolio, positionGroup));\n\n            Assert.AreEqual((double)expectedInitialMarginRequirement, (double)initialMarginRequirement.Value, (double)(0.2m * expectedInitialMarginRequirement));\n        }\n\n        /// <summary>\n        /// Test cases for the <see cref=\"OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin\"/> method.\n        ///\n        /// TODO: We should come back and revisit these test cases to make sure they are correct.\n        /// The approximate values from IB for the prices used in the test are in the comments.\n        /// For instance, see the test case for the CoveredCall strategy. The margin values do not match IB's values.\n        ///\n        /// Test cases marked as explicit will fail if ran, they have an approximate expected value based on IB's margin requirements.\n        /// </summary>\n        private static readonly TestCaseData[] MaintenanceMarginTestCases = new[]\n        {\n            // OptionStrategyDefinition, initialHoldingsQuantity, expectedMaintenanceMargin\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 1, 21200m),                       // IB:  21200\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -1, 0m),                          // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 1, 3000m),                         // IB:  3000\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -1, 0m),                           // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 1, 19000m),                     // IB:  19325\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -1, 3000m),                     // IB:  3000\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 1, 3000m),                   // IB:  inverted covered call\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -1, 19000m),                 // IB:  covered call\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 1, 10250m),                      // IB:  12000m\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -1, 10000m),                     // IB:  10276\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 1, 10000m),                   // IB:  inverted covered Put\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -1, 10250m),                  // IB:  covered Put\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 1, 6202m),                 // IB:  6202\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -1, 6202m),                // IB:  same as long\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 1, 5303m),                       // IB:  5303\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -1, 5240m),                      // IB:  reverse conversion\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 1, 5240m),                // IB:  5240\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -1, 5303m),               // IB:  conversion\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 1, 1000m),                   // IB:  10000\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -1, 0m),                     // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 1, 0m),                       // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -1, 1000m),                   // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -1, 1000m),                  // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 1, 1000m),                    // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 1, 0m),                            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -1, 20000m),                       // IB:  20624\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 1, 20000m),                   // IB:  20624\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 1, 0m),                            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -1, 21000m),                       // IB:  20752\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 1, 21000m),                   // IB:  20752\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -1, 0m),                      // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 1, 0m),                       // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -1, 1000m),                   // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 1, 1000m),               // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -1, 0m),                 // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 1, 0m),                        // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -1, 1000m),                    // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 1, 1000m),                // IB:  1000\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -1, 20000m),             // IB:  20537\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 1, 20000m),         // IB:  20537\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -1, 0m),            // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 1, 0m),                   // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -1, 3000m),               // IB:  3121\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 1, 3000m),           // IB:  3121\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -1, 0m),             // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 1, 1000m),                    // IB:  1010    note: 1% commission\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -1, 0m),                      // IB:  short iron butterfly\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 1, 0m),                  // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -1, 1000m),              // IB:  iron butterfly\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 1, 1000m),                       // IB:  1017.62\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -1, 0m),                         // IB:  short iron condor\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 1, 0m),                     // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -1, 1000m),                 // IB:  iron condor\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 1, 0m),                           // IB:  0\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -1, 2000m),                       // IB:  short box spread\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 1, 2000m),                   // IB:  2000\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -1, 0m),                     // IB:  box spread\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 1, 11447.5m),                     // IB:  11459\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -1, 11537.2m),                    // IB:  short jelly roll\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 1, 11537.2m),                // IB:  11589\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -1, 11447.5m),               // IB:  jelly roll\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 1, 400m),                    // IB:  400\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -1, 10407.04m),              // IB:  BullCallLadder\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 1, 10407.04m),               // IB:  10407.04\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -1, 400m),                   // IB:  BearCallLadder\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 1, 10532.56m),                // IB:  10532.56\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -1, 400m),                    // IB:  BullPutLadder\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 1, 400m),                     // IB:  400\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -1, 10532.56m),               // IB:  BearPutLadder\n        };\n\n        [TestCaseSource(nameof(MaintenanceMarginTestCases))]\n        public void GetsMaintenanceMargin(OptionStrategyDefinition optionStrategyDefinition, int quantity, decimal expectedMaintenanceMargin)\n        {\n            var positionGroup = SetUpOptionStrategy(optionStrategyDefinition, quantity);\n\n            var maintenanceMargin = positionGroup.BuyingPowerModel.GetMaintenanceMargin(\n                new PositionGroupMaintenanceMarginParameters(_portfolio, positionGroup));\n\n            Assert.AreEqual((double)expectedMaintenanceMargin, (double)maintenanceMargin.Value, (double)(0.2m * expectedMaintenanceMargin));\n        }\n\n        /// <remarks>\n        /// TODO: Revisit the explicit test cases when we can take into account premium for strategies with zero margin.\n        /// </remarks>\n        // option strategy definition, initial position quantity, final position quantity\n        private static readonly TestCaseData[] OrderQuantityForDeltaBuyingPowerTestCases = new[]\n        {\n            // Initial margin requirement (including premium) for NakedCall with quantity 10 and -10 is 194000 and 112000 respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, 194000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -194000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -194000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -194000m - 112000m, -20),    // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 112000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -112000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -112000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -112000m - 194000m, -20),   // Going from -10 to 10\n            // Initial margin requirement (including premium) for NakedPut with quantity 10 and -10 is 30020 and 20 respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, 30020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -30020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -30020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -30020m - 20m, -20),    // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 20m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -20m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -20m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -20m - 30020m, -20),   // Going from -10 to 10\n            // Initial margin requirement (including premium) for CoveredCall with quantity 10 and -10 is 192100 and 214500 respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 192100m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -192100m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -192100m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -192100m - 214500m, -20),    // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 214500m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -214500m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -214500m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -214500m - 192100m, -20),   // Going from -10 to 10\n            // Initial margin requirement (including premium) for ProtectiveCall with quantity 10 and -10 is 214500 and 192100 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, 214500m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -214500m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -214500m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -214500m - 192100m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 192100m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -192100m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -192100m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -192100m - 214500m, -20),\n            // Initial margin requirement (including premium) for CoveredPut with quantity 10 and -10 is 102500 and 102520 respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 102500m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -102500m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -102500m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -102500m - 102520m, -20),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 102520m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -102520m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -102520m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -102520m - 102500m, -20),\n            // Initial margin requirement (including premium) for ProtectivePut with quantity 10 and -10 is 102520 and 102500 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 102520m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -102520m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -102520m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -102520m - 102500m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 102500m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -102500m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -102500m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -102500m - 102520m, -20),\n            // Initial margin requirement (including premium) for ProtectiveCollar with quantity 10 and -10 is 262310 and 262318 respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 262310m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -262310m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -262310m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -262310m - 262318m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 262318m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, -262318m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, -262318m - 262310m, -20),\n            // Initial margin requirement (including premium) for Conversion with quantity 10 and -10 is 262945 and 263778 respectively\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 262945m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -262945m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -262945m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -262945m - 263778m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 263778m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -263778m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -263778m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -263778m - 262945m, -20),\n            // Initial margin requirement (including premium) for ReverseConversion with quantity 10 and -10 is 263768 and 262915 respectively\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 263768m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -263768m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -263768m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -263768m - 262915m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 262915m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -262915m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -262915m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -262915m - 263768m, -20),\n            // Initial margin requirement (including premium) for BearCallSpread with quantity 10 and -10 is 10000 and 12000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -10000m - 12000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 12000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -12000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -12000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -12000m - 10000m, -20),\n            // Initial margin requirement (including premium) for BearPutSpread with quantity 10 and -10 is 10 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -10000m - 10m, -20),\n            // Initial margin requirement (including premium) for BullCallSpread with quantity 10 and -10 is 12000 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 12000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -12000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -12000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -12000m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -10000m - 12000m, -20),\n            // Initial margin requirement (including premium) for BullPutSpread with quantity 10 and -10 is 10000 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10000m - 10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -10m - 10000m, -20),\n            // Initial margin requirement (including premium) for Straddle with quantity 10 and -10 is 112020 and 194020 respectively\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 112020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -112020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -112020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -112020m - 194020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 194020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -194020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -194020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -194020m - 112020m, -20),\n            // Initial margin requirement (including premium) for ShortStraddle with quantity 10 and -10 is 194020 and 112020 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, 194020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -194020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -194020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -194020m - 112020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 112020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -112020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -112020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -112020m - 194020m, -20),\n            // Initial margin requirement (including premium) for Strangle with quantity 10 and -10 is 100020 and 182020 respectively\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 100020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -100020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -100020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -100020m - 182020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 182020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -182020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -182020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -182020m - 100020m, -20),\n            // Initial margin requirement (including premium) for ShortStrangle with quantity 10 and -10 is 182020 and 100020 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 182020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -182020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -182020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -182020m - 100020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 100020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -100020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -100020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -100020m - 182020m, -20),\n            // Initial margin requirement (including premium) for ButterflyCall with quantity 10 and -10 is 4000 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -4000m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -10000m - 4000m, -20),\n            // Initial margin requirement (including premium) for ShortButterflyCall with quantity 10 and -10 is 10000 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -10000m - 4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -4000m - 10000m, -20),\n            // Initial margin requirement (including premium) for ButterflyPut with quantity 10 and -10 is 10 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -10000m - 10m, -20),\n            // Initial margin requirement (including premium) for ShortButterflyPut with quantity 10 and -10 is 10000 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10000m - 10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -10m - 10000m, -20),\n            // Initial margin requirement (including premium) for CallCalendarSpread with quantity 10 and -10 is 2000 and 194000 respectively\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 2000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -2000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -2000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -2000m - 194000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 194000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -194000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -194000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -194000m - 2000m, -20),\n            // Initial margin requirement (including premium) for ShortCallCalendarSpread with quantity 10 and -10 is 194000 and 2000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 194000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -194000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -194000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -194000m - 2000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 2000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -2000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -2000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -2000m - 194000m, -20),\n            // Initial margin requirement (including premium) for PutCalendarSpread with quantity 10 and -10 is 10 and 30020 respectively\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -10m - 30020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 30020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -30020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -30020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -30020m - 10m, -20),\n            // Initial margin requirement (including premium) for ShortPutCalendarSpread with quantity 10 and -10 is 30020 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 30020m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -30020m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -30020m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -30020m - 10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 10m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -10m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -10m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -10m - 30020m, -20),\n            // Initial margin requirement (including premium) for IronButterfly with quantity 10 and -10 is 10000 and 8010 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -10000m - 8010m, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 8010m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -8010m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -8010m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -8010m - 10000m, -20),\n            // Initial margin requirement (including premium) for ShortIronButterfly with quantity 10 and -10 is 8010 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 8010m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -8010m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -8010m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -8010m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -10000m - 8010m, -20),\n            // Initial margin requirement (including premium) for IronCondor with quantity 10 and -10 is 10000 and 10010 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10000m - 10010m, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 10010m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -10010m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -10010m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -10010m - 10000m, -20),\n            // Initial margin requirement (including premium) for ShortIronCondor with quantity 10 and -10 is 10010 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 10010m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10010m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10010m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10010m - 10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 10000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -10000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -10000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -10000m - 10010m, -20),\n            // Initial margin requirement (including premium) for BoxSpread with quantity 10 and -10 is 20030 and 20000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 20030m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20030m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20030m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20030m - 20000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 20000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -20000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -20000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -20000m - 20030m, -20),\n            // Initial margin requirement (including premium) for ShortBoxSpread with quantity 10 and -10 is 20000 and 20030 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 20000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20000m - 20030m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 20030m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -20030m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -20030m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -20030m - 20000m, -20),\n            // Initial margin requirement (including premium) for JellyRoll with quantity 10 and -10 is 115319 and 115372 respectively\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 115319m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -115319m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -115319m, -10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -115319m - 115372m, -20),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 115372m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -115372m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -115372m, -10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -115372m - 115319m, -20),\n            // Initial margin requirement (including premium) for ShortJellyRoll with quantity 10 and -10 is 115372 and 115319 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 115372m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -115372m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -115372m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -115372m - 115319m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 115319m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -115319m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -115319m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -115319m - 115372m, -20),\n            // Initial margin requirement (including premium) for BearCallLadder with quantity 10 and -10 is 4000 and 106590.4 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -4000m - 106590.4m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 106590.4m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -106590.4m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -106590.4m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -106590.4m - 4000m, -20),\n            // Initial margin requirement (including premium) for BearPutLadder with quantity 10 and -10 is 108789.6 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 108789.6m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -108789.6m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -108789.6m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -108789.6m - 4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -4000m - 108789.6m, -20),\n            // Initial margin requirement (including premium) for BullCallLadder with quantity 10 and -10 is 106590.4 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 106590.4m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -106590.4m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -106590.4m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -106590.4m - 4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -4000m - 106590.4m, -20),\n            // Initial margin requirement (including premium) for BullPutLadder with quantity 10 and -10 is 4000 and 108789.6 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 4000m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -4000m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -4000m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -4000m - 108789.6m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 108789.6m / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -108789.6m / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -108789.6m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -108789.6m - 4000m, -20),\n        };\n\n        [TestCaseSource(nameof(OrderQuantityForDeltaBuyingPowerTestCases))]\n        public void PositionGroupOrderQuantityCalculationForDeltaBuyingPower(OptionStrategyDefinition optionStrategyDefinition,\n            int initialPositionQuantity, decimal deltaBuyingPower, int expectedQuantity)\n        {\n            var positionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity);\n\n            var initialMarginRequirement = positionGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, positionGroup);\n            var maintenanceMargin = positionGroup.BuyingPowerModel.GetMaintenanceMargin(_portfolio, positionGroup);\n            // Adjust the delta buying power:\n            // GetMaximumLotsForDeltaBuyingPower will add the delta buying power to the maintenance margin and used that as a target margin,\n            // but then GetMaximumLotsForTargetBuyingPower will work with initial margin requirement so we make sure the resulting quantity\n            // can be ordered. In order to match this, we need to adjust the delta buying power by the difference between the initial margin\n            // requirement  and maintenance margin.\n            deltaBuyingPower += initialMarginRequirement - maintenanceMargin;\n\n            if (expectedQuantity != -Math.Abs(initialPositionQuantity)) // Not liquidating\n            {\n                // Add a small buffer to avoid rounding errors\n                var usedMargin = _portfolio.TotalMarginUsed;\n                deltaBuyingPower *= deltaBuyingPower > 0 || Math.Abs(deltaBuyingPower) > usedMargin ? 1.00001m : 0.99999m;\n            }\n\n            var result = positionGroup.BuyingPowerModel.GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(\n                _portfolio, positionGroup, deltaBuyingPower, minimumOrderMarginPortfolioPercentage: 0));\n\n            Assert.IsFalse(result.IsError);\n            Assert.AreEqual(expectedQuantity, result.NumberOfLots);\n\n            // Expected quantity is 0 for test cases where no buying power is used,\n            // it should return 0 regardless of the delta, with the proper message\n            if (expectedQuantity == 0)\n            {\n                Assert.AreEqual(Messages.PositionGroupBuyingPowerModel.DeltaCannotBeApplied, result.Reason);\n            }\n        }\n        private static TestCaseData[] OrderQuantityForDeltaBuyingPowerWithCustomPositionGroupParameterTestCases()\n        {\n            return OrderQuantityForDeltaBuyingPowerTestCases\n                .SelectMany(testCaseData =>\n                {\n                    var testCases = new List<TestCaseData>(2);\n                    foreach (var referencePositionSideSign in new[] { +1, -1 })\n                    {\n                        var args = testCaseData.OriginalArguments.ToList();\n                        args.Add(referencePositionSideSign);\n                        var data = new TestCaseData(args.ToArray());\n\n                        if (testCaseData.RunState == NUnit.Framework.Interfaces.RunState.Explicit)\n                        {\n                            data.Explicit();\n                        }\n\n                        testCases.Add(data);\n                    }\n\n                    return testCases;\n                })\n                .ToArray();\n        }\n\n        /// <summary>\n        /// Tests <see cref=\"OptionStrategyPositionGroupBuyingPowerModel.GetMaximumLotsForDeltaBuyingPower\"/> with reference position group in\n        /// same and opposite side of the existing position group.\n        ///\n        /// The reference position group is not necessarily in the same side as the position group in the portfolio, it could be the inverted.\n        /// So the consumer needs the result relative to that position group instead of the one being held.\n        /// </summary>\n        [TestCaseSource(nameof(OrderQuantityForDeltaBuyingPowerWithCustomPositionGroupParameterTestCases))]\n        public void PositionGroupOrderQuantityCalculationForDeltaBuyingPowerWithCustomPositionGroupParameter(\n            OptionStrategyDefinition optionStrategyDefinition, int initialPositionQuantity, decimal deltaBuyingPower, int expectedQuantity,\n            int referencePositionSideSign)\n        {\n            var currentPositionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity);\n\n            var initialMarginRequirement = currentPositionGroup.BuyingPowerModel.GetInitialMarginRequirement(_portfolio, currentPositionGroup);\n            var maintenanceMargin = currentPositionGroup.BuyingPowerModel.GetMaintenanceMargin(_portfolio, currentPositionGroup);\n            // Adjust the delta buying power:\n            // GetMaximumLotsForDeltaBuyingPower will add the delta buying power to the maintenance margin and used that as a target margin,\n            // but then GetMaximumLotsForTargetBuyingPower will work with initial margin requirement so we make sure the resulting quantity\n            // can be ordered. In order to match this, we need to adjust the delta buying power by the difference between the initial margin\n            // requirement  and maintenance margin.\n            deltaBuyingPower += initialMarginRequirement - maintenanceMargin;\n\n            if (expectedQuantity != -Math.Abs(initialPositionQuantity)) // Not liquidating\n            {\n                // Add a small buffer to avoid rounding errors\n                var usedMargin = _portfolio.TotalMarginUsed;\n                deltaBuyingPower *= deltaBuyingPower > 0 || Math.Abs(deltaBuyingPower) > usedMargin ? 1.00001m : 0.99999m;\n            }\n\n            // Using a reference position with in the same position side as the one in the portfolio\n            var referencePositionGroup = new PositionGroup(currentPositionGroup.BuyingPowerModel, 1,\n                currentPositionGroup.Select(position => new Position(position.Symbol,\n                    referencePositionSideSign * Math.Sign(position.Quantity) * position.UnitQuantity, position.UnitQuantity)).ToArray());\n\n            var result = currentPositionGroup.BuyingPowerModel.GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(\n                _portfolio, referencePositionGroup, referencePositionSideSign * deltaBuyingPower, minimumOrderMarginPortfolioPercentage: 0));\n\n            Assert.IsFalse(result.IsError);\n            Assert.AreEqual(referencePositionSideSign * expectedQuantity, result.NumberOfLots);\n\n            // Expected quantity is 0 for test cases where no buying power is used,\n            // it should return 0 regardless of the delta, with the proper message\n            if (expectedQuantity == 0)\n            {\n                Assert.AreEqual(Messages.PositionGroupBuyingPowerModel.DeltaCannotBeApplied, result.Reason);\n            }\n        }\n\n        /// <remarks>\n        /// TODO: Revisit the explicit test cases when we can take into account premium for strategies with zero margin.\n        /// </remarks>\n        // option strategy definition, initial position quantity, target buying power percent, expected quantity\n        private static readonly TestCaseData[] OrderQuantityForTargetBuyingPowerTestCases = new[]\n        {\n            // Initial margin requirement (including premium) for NakedCall with quantity 10 and -10 is 194000m and 112000m respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, 194000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, 194000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -112000m, -20),  // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 112000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 112000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -194000m, -20),    // Going from -10 to 10\n            // Initial margin requirement (including premium) for NakedPut with quantity 10 and -10 is 30020m and 20m respectively\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, 30020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, 30020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -20m, -20),  // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 20m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 20m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -30020m, -20),    // Going from -10 to 10\n            // Initial margin requirement (including premium) for CoveredCall with quantity 10 and -10 is 192100m and 214500m respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 192100m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 192100m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -214500m, -20),  // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 214500m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 214500m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -192100m, -20),    // Going from -10 to 10\n            // Initial margin requirement (including premium) for ProtectiveCall with quantity 10 and -10 is 214500m and 192100m respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, 214500m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, 214500m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -192100m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 192100m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 192100m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -214500m, -20),\n            // Initial margin requirement (including premium) for CoveredPut with quantity 10 and -10 is 102500m and 102520m respectively\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 102500m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 102500m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -102520m, -20),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 102520m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 102520m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -102500m, -20),\n            // Initial margin requirement (including premium) for ProtectivePut with quantity 10 and -10 is 102520m and 102500m respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 102520m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 102520m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -102500m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 102500m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 102500m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -102520m, -20),\n            // Initial margin requirement (including premium) for ProtectiveCollar with quantity 10 and -10 is 262310m and 262318m respectively\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 262310m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 262310m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -262318m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 262318m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 262318m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, -262310m, -20),\n            // Initial margin requirement (including premium) for Conversion with quantity 10 and -10 is 262945m and 263778m respectively\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 262945m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 262945m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -263778m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 263778m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 263778m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -262945m, -20),\n            // Initial margin requirement (including premium) for ReverseConversion with quantity 10 and -10 is 263768m and 262915m respectively\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 263768m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 263768m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -262915m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 262915m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 262915m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -263768m, -20),\n            // Initial margin requirement (including premium) for BearCallSpread with quantity 10 and -10 is 10000 and 12000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -12000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 12000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 12000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for BearPutSpread with quantity 10 and -10 is 10 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -10m, -20),\n            // Initial margin requirement (including premium) for BullCallSpread with quantity 10 and -10 is 12000 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 12000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 12000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -12000m, -20),\n            // Initial margin requirement (including premium) for BullPutSpread with quantity 10 and -10 is 10000 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for Straddle with quantity 10 and -10 is 112020 and 194020 respectively\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 112020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 112020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -194020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 194020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 194020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -112020m, -20),\n            // Initial margin requirement (including premium) for ShortStraddle with quantity 10 and -10 is 194020 and 112020 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, 194020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, 194020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -112020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 112020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 112020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -194020m, -20),\n            // Initial margin requirement (including premium) for Strangle with quantity 10 and -10 is 100020 and 182020 respectively\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 100020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 100020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -182020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 182020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 182020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -100020m, -20),\n            // Initial margin requirement (including premium) for ShortStrangle with quantity 10 and -10 is 182020 and 100020 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 182020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 182020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -100020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 100020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 100020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -182020m, -20),\n            // Initial margin requirement (including premium) for ButterflyCall with quantity 10 and -10 is 4000 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -4000m, -20),\n            // Initial margin requirement (including premium) for ShortButterflyCall with quantity 10 and -10 is 10000 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for ButterflyPut with quantity 10 and -10 is 10 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -10m, -20),\n            // Initial margin requirement (including premium) for ShortButterflyPut with quantity 10 and -10 is 10000 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for CallCalendarSpread with quantity 10 and -10 is 2000 and 194000 respectively\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 2000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 2000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -194000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 194000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 194000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -2000m, -20),\n            // Initial margin requirement (including premium) for ShortCallCalendarSpread with quantity 10 and -10 is 194000 and 2000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 194000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 194000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -2000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 2000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 2000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -194000m, -20),\n            // Initial margin requirement (including premium) for PutCalendarSpread with quantity 10 and -10 is 10 and 30020 respectively\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -30020m, -20),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 30020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 30020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -10m, -20),\n            // Initial margin requirement (including premium) for ShortPutCalendarSpread with quantity 10 and -10 is 30020 and 10 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 30020m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 30020m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -10m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 10m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 10m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -30020m, -20),\n            // Initial margin requirement (including premium) for IronButterfly with quantity 10 and -10 is 10000 and 8010 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -8010m, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 8010m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 8010m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for ShortIronButterfly with quantity 10 and -10 is 8010 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 8010m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 8010m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -8010m, -20),\n            // Initial margin requirement (including premium) for IronCondor with quantity 10 and -10 is 10000 and 10010 respectively\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10010m, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 10010m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 10010m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -10000m, -20),\n            // Initial margin requirement (including premium) for ShortIronCondor with quantity 10 and -10 is 10010 and 10000 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 10010m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 10010m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 10000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 10000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -10010m, -20),\n            // Initial margin requirement (including premium) for BoxSpread with quantity 10 and -10 is 20030 and 20000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 20030m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 20030m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 20000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 20000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -20030m, -20),\n            // Initial margin requirement (including premium) for ShortBoxSpread with quantity 10 and -10 is 20000 and 20030 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 20000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 20000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20030m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 20030m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 20030m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -20000m, -20),\n            // Initial margin requirement (including premium) for JellyRoll with quantity 10 and -10 is 115319 and 115372 respectively\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 115319m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 115319m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -115372m, -20),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 115372m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 115372m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -115319m, -20),\n            // Initial margin requirement (including premium) for ShortJellyRoll with quantity 10 and -10 is 115319 and 115372 respectively\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 115372m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 115372m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -115319m, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 115319m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 115319m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -115372m, -20),\n            // Initial margin requirement (including premium) for BearCallLadder with quantity 10 and -10 is 4000 and 106590.4 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -106590.4m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 106590.4m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 106590.4m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -4000m, -20),\n            // Initial margin requirement (including premium) for BearPutLadder with quantity 10 and -10 is 108789.6 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 108789.6m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 108789.6m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -108789.6m, -20),\n            // Initial margin requirement (including premium) for BullCallLadder with quantity 10 and -10 is 4000 and 106590.4 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 106590.4m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 106590.4m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -4000m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -106590.4m, -20),\n            // Initial margin requirement (including premium) for BullPutLadder with quantity 10 and -10 is 108789.6 and 4000 respectively\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 4000m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 4000m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -108789.6m, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 108789.6m * 11 / 10, +1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 108789.6m * 9 / 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 0m, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -4000m, -20),\n        };\n\n        [TestCaseSource(nameof(OrderQuantityForTargetBuyingPowerTestCases))]\n        public void PositionGroupOrderQuantityCalculationForTargetBuyingPower(OptionStrategyDefinition optionStrategyDefinition,\n            int initialPositionQuantity, decimal targetBuyingPower, int expectedQuantity)\n        {\n            var positionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity);\n\n            targetBuyingPower *= 1.0001m; // Add a small buffer to avoid rounding errors\n            var targetBuyingPowerPercent = targetBuyingPower / _portfolio.TotalPortfolioValue;\n\n            var quantity = positionGroup.BuyingPowerModel.GetMaximumLotsForTargetBuyingPower(new GetMaximumLotsForTargetBuyingPowerParameters(\n                _portfolio, positionGroup, targetBuyingPowerPercent, minimumOrderMarginPortfolioPercentage: 0)).NumberOfLots;\n\n            Assert.AreEqual(expectedQuantity, quantity);\n        }\n\n        private static TestCaseData[] OrderQuantityForTargetBuyingPowerWithCustomPositionGroupParameterTestCases()\n        {\n            return OrderQuantityForTargetBuyingPowerTestCases\n                .SelectMany(testCaseData =>\n                {\n                    var testCases = new List<TestCaseData>(2);\n                    foreach (var referencePositionSideSign in new[] { +1, -1 })\n                    {\n                        var args = testCaseData.OriginalArguments.ToList();\n                        args.Add(referencePositionSideSign);\n                        var data = new TestCaseData(args.ToArray());\n\n                        if (testCaseData.RunState == NUnit.Framework.Interfaces.RunState.Explicit)\n                        {\n                            data.Explicit();\n                        }\n\n                        testCases.Add(data);\n                    }\n\n                    return testCases;\n                })\n                .ToArray();\n        }\n\n        /// <summary>\n        /// Tests <see cref=\"OptionStrategyPositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower\"/> with reference position group in\n        /// same and opposite side of the existing position group.\n        ///\n        /// The reference position group is not necessarily in the same side as the position group in the portfolio, it could be the inverted.\n        /// So the consumer needs the result relative to that position group instead of the one being held.\n        /// </summary>\n        [TestCaseSource(nameof(OrderQuantityForTargetBuyingPowerWithCustomPositionGroupParameterTestCases))]\n        public void PositionGroupOrderQuantityCalculationForTargetBuyingPowerWithCustomPositionGroupParameter(\n            OptionStrategyDefinition optionStrategyDefinition, int initialPositionQuantity, decimal targetBuyingPower, int expectedQuantity,\n            int referenceGroupSideSign)\n        {\n            var currentPositionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity);\n\n            targetBuyingPower *= 1.0001m; // Add a small buffer to avoid rounding errors\n            var targetBuyingPowerPercent = targetBuyingPower / _portfolio.TotalPortfolioValue;\n\n            var referencePositionGroup = new PositionGroup(currentPositionGroup.BuyingPowerModel, 1,\n                currentPositionGroup.Select(position => new Position(position.Symbol,\n                    referenceGroupSideSign * Math.Sign(position.Quantity) * position.UnitQuantity, position.UnitQuantity)).ToArray());\n\n            var quantity = currentPositionGroup.BuyingPowerModel.GetMaximumLotsForTargetBuyingPower(new GetMaximumLotsForTargetBuyingPowerParameters(\n                _portfolio, referencePositionGroup, referenceGroupSideSign * targetBuyingPowerPercent,\n                minimumOrderMarginPortfolioPercentage: 0)).NumberOfLots;\n            Assert.AreEqual(referenceGroupSideSign * expectedQuantity, quantity);\n        }\n\n        /// <summary>\n        /// Starting from the \"initial position quantity\", we want to get to a new position with \"initial position quantity\" + \"order quantity\".\n        ///\n        /// These test cases assume a starting margin/cash of 1M.\n        /// The expected buying power test case parameter is left explicitly calculated as a constant in order to make it clearer.\n        /// </summary>\n        private static readonly TestCaseData[] PositionGroupBuyingPowerTestCases = new[]\n        {\n            // Going from 10 to 11.\n            // Expected buying power for going longer:\n            // (1000000 initial cash - 185000 used margin) margin remaining\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 1, 1000000m - 185000m),\n            // Going from 10 to 9.\n            // Expected buying power for reducing, closing or going short:\n            // (1000000 initial cash - 185000 used margin) margin remaining + 185000 used margin + 192100 initial margin requirement\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -1, (1000000m - 185000m) + 185000m + 192100m),\n            // Going from 10 to 0.\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -10, (1000000m - 185000m) + 185000m + 192100m),\n            // Going from 10 to -10.\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -20, (1000000m - 185000m) + 185000m + 192100m),\n            // Expected buying power for going shorter:\n            // (1000000 initial cash - 30000 used margin) margin remaining\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -1, 1000000m - 30000m),\n            // Expected buying power for reducing, closing or going long:\n            // (1000000 initial cash - 30000 used margin) margin remaining + 30000 used margin + 102500 initial margin requirement\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 1, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 10, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 20, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, +1, 1000000m - 30000m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -1, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -10, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -20, (1000000m - 30000m) + 30000m + 214500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -1, 1000000m - 185000m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 1, (1000000m - 185000m) + 185000m + 192100m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 10, (1000000m - 185000m) + 185000m + 192100m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 20, (1000000m - 185000m) + 185000m + 192100m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 1, 1000000m - 102500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -1, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -10, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -20, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -1, 1000000m - 102500m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 1, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 10, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 20, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 1, 1000000m - 102500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -1, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -10, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -20, (1000000m - 102500m) + 102500m + 102520m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -1, 1000000m - 102500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 1, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 10, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 20, (1000000m - 102500m) + 102500m + 102500m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 1, 1000000m - 62020m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -1, (1000000m - 62020m) + 62020m + 262318m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -10, (1000000m - 62020m) + 62020m + 262318m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -20, (1000000m - 62020m) + 62020m + 262318m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, -1, 1000000m - 62020m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 1, (1000000m - 62020m) + 62020m + 262310m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 10, (1000000m - 62020m) + 62020m + 262310m),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 20, (1000000m - 62020m) + 62020m + 262310m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 1, 1000000m - 53030m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -1, (1000000m - 53030m) + 53030m + 262945m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -10, (1000000m - 53030m) + 53030m + 262945m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -20, (1000000m - 53030m) + 53030m + 262945m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -1, 1000000m - 52400m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 1, (1000000m - 52400m) + 52400m + 263778m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 10, (1000000m - 52400m) + 52400m + 263778m),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 20, (1000000m - 52400m) + 52400m + 263778m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 1, 1000000m - 52400m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -1, (1000000m - 52400m) + 52400m + 263768m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -10, (1000000m - 52400m) + 52400m + 263768m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -20, (1000000m - 52400m) + 52400m + 263768m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -1, 1000000m - 53010m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 1, (1000000m - 53010m) + 53010m + 262915m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 10, (1000000m - 53010m) + 53010m + 262915m),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 20, (1000000m - 53010m) + 53010m + 262915m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, +1, 1000000m - 194000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -1, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -10, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -20, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 1, (1000000m - 0m) + 0m + 112000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 10, (1000000m - 0m) + 0m + 112000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 20, (1000000m - 0m) + 0m + 112000m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, +1, 1000000m - 30020m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -1, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -10, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -20, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 1, (1000000m - 0m) + 0m + 20m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 10, (1000000m - 0m) + 0m + 20m),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 20, (1000000m - 0m) + 0m + 20m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 1, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 10, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 20, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -1, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -10, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -20, (1000000m - 0) + 0 + 12000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -1, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -10, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -20, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -1, 1000000m - 194020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 1, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 10, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 20, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, +1, 1000000m - 194020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -1, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -10, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -20, (1000000m - 194020m) + 194020m + 194020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 1, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 10, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 20, (1000000m - 0m) + 0m + 112020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -1, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -10, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -20, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -1, 1000000m - 182020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 1, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 10, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 20, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 1, 1000000m - 182020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -1, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -10, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -20, (1000000m - 182020m) + 182020m + 182020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 1, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 10, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 20, (1000000m - 0m) + 0m + 100020m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -1, (1000000m - 0m) + 0m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -10, (1000000m - 0m) + 0m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -20, (1000000m - 0m) + 0m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 1, (1000000m - 0) + 0 + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 10, (1000000m - 0) + 0 + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 20, (1000000m - 0) + 0 + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -1, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -10, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -20, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -1, 1000000m - 194000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 1, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 10, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 20, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 1, 1000000m - 194000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -1, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -10, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -20, (1000000m - 194000m) + 194000m + 194000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 1, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 10, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 20, (1000000m - 0) + 0 + 2000m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -1, 1000000m - 30020m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 1, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 10, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 20, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 1, 1000000m - 30020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -1, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -10, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -20, (1000000m - 30020m) + 30020m + 30020m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 1, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 10, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 20, (1000000m - 0) + 0 + 10m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 1, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 10, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 20, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -1, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -10, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -20, (1000000m - 0) + 0 + 8010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 1, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 10, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 20, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -1, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -20, (1000000m - 0) + 0 + 10010m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -1, 1000000m - 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 1, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 10, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 20, (1000000m - 10000m) + 10000m + 10000m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 1, 1000000m - 0m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -1, (1000000m - 0m) + 0m + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -10, (1000000m - 0m) + 0m + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20, (1000000m - 0m) + 0m + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -1, 1000000m - 20000m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 1, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 10, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 20, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 1, 1000000m - 20000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -1, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -10, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20, (1000000m - 20000m) + 20000m + 20000m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -1, 1000000m - 0),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 1, (1000000m - 0) + 0 + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 10, (1000000m - 0) + 0 + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 20, (1000000m - 0) + 0 + 20030m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 1, 1000000m - 114475m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -1, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -10, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -20, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -1, 1000000m - 115372m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 1, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 10, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 20, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 1, 1000000m - 115372m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -1, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -10, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -20, (1000000m - 115372m) + 115372m + 115372m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -1, 1000000m - 114475m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 1, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 10, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 20, (1000000m - 115319m) + 115319m + 115319m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 1, 1000000m - 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -1, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -10, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -20, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -1, 1000000m - 104070.4m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 1, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 10, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 20, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 1, 1000000m - 105325.6m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -1, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -10, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -20, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -1, 1000000m - 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 1, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 10, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 20, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 1, 1000000m - 104070.4m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -1, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -10, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -20, (1000000m - 106590.4m) + 106590.4m + 106590.4m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -1, 1000000m - 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 1, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 10, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 20, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 1, 1000000m - 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -1, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -10, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -20, (1000000m - 4000m) + 4000m + 4000m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -1, 1000000m - 105325.6m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 1, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 10, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 20, (1000000m - 108789.6m) + 108789.6m + 108789.6m),\n        };\n\n        [TestCaseSource(nameof(PositionGroupBuyingPowerTestCases))]\n        public void BuyingPowerForPositionGroupCalculation(OptionStrategyDefinition optionStrategyDefinition, int initialPositionQuantity,\n            int orderQuantity, decimal expectedBuyingPower)\n        {\n            var initialPositionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity, updateCashbook: true);\n            var orderPositionGroup = initialPositionGroup.WithQuantity(Math.Abs(orderQuantity), _portfolio.Positions);\n\n            var orderDirection = Math.Sign(initialPositionQuantity) == Math.Sign(orderQuantity) ? OrderDirection.Buy : OrderDirection.Sell;\n            var buyingPower = initialPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, orderPositionGroup, orderDirection));\n\n            Assert.That(buyingPower.Value, Is.EqualTo(expectedBuyingPower).Within(1e-18));\n        }\n\n        [Test]\n        public void BuyingPowerForStrategyStartingFromOptionPositionInSameDirection()\n        {\n            // 1. Sell a call option\n            // 2. Get the available buying power for the long call\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Sell a call option\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, -1);\n\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n\n            var finalPositionGroup = new PositionGroup(new OptionStrategyPositionGroupBuyingPowerModel(\n                OptionStrategies.BearCallSpread(spyMay19_300Call.Symbol.Canonical, spyMay19_300Call.StrikePrice, spyMay19_350Call.StrikePrice,\n                    expiration)),\n                1,\n                initialPositionGroup.Positions.Single(),\n                new Position(spyMay19_350Call.Symbol, 1, 1));\n\n            // 2. Get the available buying power for the long call\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(_portfolio.MarginRemaining, buyingPower);\n        }\n\n        [Test]\n        public void BuyingPowerForStrategyStartingFromOptionPositionInOppositeDirection()\n        {\n            // 1. Buy 10 call options\n            // 2. Get the available buying power for the resulting \"what-if\" position group after buying 5 bear call spreads\n            //    with the short call in the holdings as the long leg (reducing the existing position)\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Buy 10 call options\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, 10);\n\n            // Buying 4 bear call with spyMay19_300Call as the short leg and spyMay19_350Call as the long leg,\n            // would leave us with 6 spyMay19_300Call and 4 spyMay19_350Call, so the resolved position group will be a long call\n            // (for spyMay19_350Call)\n            var finalPositionGroup = new PositionGroup(new OptionStrategyPositionGroupBuyingPowerModel(\n                OptionStrategies.NakedCall(spyMay19_350Call.Symbol.Canonical, spyMay19_350Call.StrikePrice, expiration)),\n                6,\n                new Position(spyMay19_350Call.Symbol, 6, 1));\n\n            // 2. Get the available buying power\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            var expectedBuyingPower = _portfolio.MarginRemaining\n                + initialPositionGroup.BuyingPowerModel.GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(_portfolio, initialPositionGroup));\n            Assert.AreEqual(expectedBuyingPower, buyingPower);\n        }\n\n        [Test]\n        [Explicit]\n        public void BuyingPowerForStrategyStartingFromOptionPositionInOppositeDirectionAndLiquidating()\n        {\n            // 1. Buy 10 call options\n            // 2. Get the available buying power for the resulting \"what-if\" position group after buying 5 bear call spreads\n            //    with the short call in the holdings as the long leg (reducing the existing position)\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Buy 10 call options\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, 10);\n\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n\n            // Buying 12 bear call with spyMay19_300Call as the short leg and spyMay19_350Call as the long leg,\n            // would leave us with -2 spyMay19_300Call (since holdings is 10) and 12 spyMay19_350Call,\n            // so the resolved position group will be a bear call with quantity -2\n            var quantity = 10 - 12;\n            var finalPositionGroup = initialPositionGroup.WithQuantity(quantity, _portfolio.Positions);\n\n            // 2. Get the available buying power\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            var expectedBuyingPower = _portfolio.MarginRemaining\n                + initialPositionGroup.BuyingPowerModel.GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(_portfolio, initialPositionGroup));\n            Assert.AreEqual(expectedBuyingPower, buyingPower);\n        }\n\n        [Test]\n        public void BuyingPowerForOptionStartingFromStrategyWithALegInSameDirection()\n        {\n            // 1. Buy 10 bear call spreads\n            // 2. Get the available buying power for increasing one of the legs\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Buy 10 bear call spreads\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, -10);\n            spyMay19_350Call.Holdings.SetHoldings(spyMay19_350Call.Price, +10);\n\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n            Assert.AreEqual(OptionStrategyDefinitions.BearCallSpread.Name, initialPositionGroup.BuyingPowerModel.ToString());\n\n            // 2. Get the available buying power for increasing one of the legs.\n            // The resulting position group will be the same as the initial one\n            // since we are only increasing the short leg but that won't affect the group\n            var finalPositionGroup = initialPositionGroup;\n\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(_portfolio.MarginRemaining, buyingPower);\n        }\n\n        [Test]\n        [Explicit]\n        public void BuyingPowerForOptionStartingFromStrategyWithALegInTheOppositeDirection()\n        {\n            // 1. Buy 10 bear call spreads\n            // 2. Get the available buying power for reducing one of the legs\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Buy 10 bear call spreads\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, -10);\n            spyMay19_350Call.Holdings.SetHoldings(spyMay19_350Call.Price, +10);\n\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n            Assert.AreEqual(OptionStrategyDefinitions.BearCallSpread.Name, initialPositionGroup.BuyingPowerModel.ToString());\n\n            // 2. Get the available buying power for reducing one of the legs\n            // If we want to reduce the short leg, by 5, the whole bear call will be reduced to 5 and the options separated into two groups\n            var quantity = -10 + 5;\n            var finalPositionGroup = initialPositionGroup.WithQuantity(quantity, _portfolio.Positions);\n\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            var expectedBuyingPower = _portfolio.MarginRemaining\n                + initialPositionGroup.BuyingPowerModel.GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(_portfolio, initialPositionGroup));\n            Assert.AreEqual(expectedBuyingPower, buyingPower);\n        }\n\n        [Test]\n        [Explicit]\n        public void BuyingPowerForOptionStartingFromStrategyWithALegInTheOppositeDirectionAndLiquidating()\n        {\n            // 1. Buy 10 bear call spreads\n            // 2. Get the available buying power for reducing one of the legs\n\n            var expiration = new DateTime(2023, 05, 19);\n            var spy = _algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick { Value = 400m });\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, expiration));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay19_350Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 350, expiration));\n            spyMay19_350Call.SetMarketPrice(new Tick { Value = 100m });\n\n            // 1. Buy 10 bear call spreads\n            spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, -10);\n            spyMay19_350Call.Holdings.SetHoldings(spyMay19_350Call.Price, +10);\n\n            var initialPositionGroup = _portfolio.Positions.Groups.Single();\n            Assert.AreEqual(OptionStrategyDefinitions.BearCallSpread.Name, initialPositionGroup.BuyingPowerModel.ToString());\n\n            // 2. Get the available buying power for reducing one of the legs\n            // If we want to order 20 of the short call (buy 20 of the call),\n            // the whole bear call group will be eliminated and the options separated into two groups.\n            // The resulting group for the order will be a naked call\n            var quantity = -10 + 20;\n            var finalPositionGroup = new PositionGroup(new OptionStrategyPositionGroupBuyingPowerModel(\n                OptionStrategies.NakedCall(spyMay19_300Call.Symbol.Canonical, spyMay19_300Call.StrikePrice, expiration)),\n                quantity,\n                new Position(spyMay19_300Call.Symbol, quantity, 1));\n\n            var buyingPower = finalPositionGroup.BuyingPowerModel.GetPositionGroupBuyingPower(new PositionGroupBuyingPowerParameters(\n                _portfolio, finalPositionGroup, OrderDirection.Buy)).Value;\n\n            var expectedBuyingPower = _portfolio.MarginRemaining\n                + initialPositionGroup.BuyingPowerModel.GetMaintenanceMargin(new PositionGroupMaintenanceMarginParameters(_portfolio, initialPositionGroup));\n            Assert.AreEqual(expectedBuyingPower, buyingPower);\n        }\n\n        private static readonly TestCaseData[] ReservedBuyingPowerImpactTestCases = new[]\n        {\n            // option strategy definition, initial position quantity, new position quantity\n            // Starting from the \"initial position quantity\", we want to get the buying power available for an order that would get us to\n            // the \"new position quantity\" (if we don't take into account the initial position).\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, 1), // Going from 10 to 11\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -1), // Going from 10 to 9\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -10), // Going from 10 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, 10, -20), // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.NakedCall, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, 1), // Going from 10 to 11\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -1), // Going from 10 to 9\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -10), // Going from 10 to 0\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, 10, -20), // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.NakedPut, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, 1), // Going from 10 to 11\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -1), // Going from 10 to 9\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -10), // Going from 10 to 0\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, 10, -20), // Going from 10 to -10\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredCall, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCall, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.CoveredPut, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectivePut, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ProtectiveCollar, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.Conversion, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ReverseConversion, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.Straddle, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStraddle, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.Strangle, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortStrangle, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyCall, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyCall, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ButterflyPut, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortButterflyPut, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.CallCalendarSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortCallCalendarSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.PutCalendarSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortPutCalendarSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.IronButterfly, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronButterfly, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.IronCondor, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortIronCondor, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BoxSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortBoxSpread, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.JellyRoll, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.ShortJellyRoll, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BearCallLadder, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BearPutLadder, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BullCallLadder, -10, 20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, 10, -20),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, -1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 1),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 10),\n            new TestCaseData(OptionStrategyDefinitions.BullPutLadder, -10, 20),\n        };\n\n        [TestCaseSource(nameof(ReservedBuyingPowerImpactTestCases))]\n        public void ReservedBuyingPowerImpactCalculation(OptionStrategyDefinition optionStrategyDefinition, int initialPositionQuantity,\n            int newGroupQuantity)\n        {\n            var initialMargin = _portfolio.MarginRemaining;\n            var initialPositionGroup = SetUpOptionStrategy(optionStrategyDefinition, initialPositionQuantity);\n\n            var finalQuantity = initialPositionQuantity + newGroupQuantity;\n            var sign = Math.Sign(finalQuantity) == Math.Sign(initialPositionQuantity) ? 1 : -1;\n            var finalPositionGroup = finalQuantity != 0\n                ? initialPositionGroup.WithQuantity(sign * Math.Abs(finalQuantity), _portfolio.Positions)\n                : PositionGroup.Empty(null);\n\n            var orders = GetPositionGroupOrders(initialPositionGroup, initialPositionQuantity, newGroupQuantity);\n            var buyingPowerImpact = initialPositionGroup.BuyingPowerModel.GetReservedBuyingPowerImpact(new ReservedBuyingPowerImpactParameters(_portfolio,\n                finalPositionGroup, orders));\n\n            var usedMargin = initialPositionGroup.BuyingPowerModel.GetReservedBuyingPowerForPositionGroup(\n                new ReservedBuyingPowerForPositionGroupParameters(_portfolio, initialPositionGroup)).AbsoluteUsedBuyingPower;\n\n            foreach (var contemplatedChangePosition in buyingPowerImpact.ContemplatedChanges)\n            {\n                var position = finalPositionGroup.SingleOrDefault(p => contemplatedChangePosition.Symbol == p.Symbol);\n                Assert.IsNotNull(position);\n                Assert.AreEqual(position.Quantity, contemplatedChangePosition.Quantity);\n            }\n\n            var expectedContemplatedInitialMarginRequirement = finalQuantity != 0\n                ? ((OptionInitialMargin)finalPositionGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                    new PositionGroupInitialMarginParameters(_portfolio, finalPositionGroup))).ValueWithoutPremium\n                : 0m;\n            var ordersPositions = orders.Select(o => o.CreatePositions(_portfolio.Securities)).SelectMany(p => p);\n            var orderGroup = _portfolio.Positions.ResolvePositionGroups(new PositionCollection(ordersPositions)).Single();\n            var orderGroupInitialMargin = (OptionInitialMargin)orderGroup.BuyingPowerModel.GetInitialMarginRequirement(\n                new PositionGroupInitialMarginParameters(_portfolio, orderGroup));\n            // Use Value-ValueWithoutPremium difference instead of Premium because when premium is negative,\n            // it is not added to initial margin requirements since it is credited to the account\n            expectedContemplatedInitialMarginRequirement += orderGroupInitialMargin.Value - orderGroupInitialMargin.ValueWithoutPremium;\n\n            var expectedDelta = expectedContemplatedInitialMarginRequirement - usedMargin;\n            Assert.That(buyingPowerImpact.Delta, Is.EqualTo(expectedDelta).Within(1e-18));\n            Assert.That(buyingPowerImpact.Current, Is.EqualTo(usedMargin).Within(1e-18));\n            Assert.That(buyingPowerImpact.Contemplated, Is.EqualTo(expectedContemplatedInitialMarginRequirement).Within(1e-18));\n        }\n\n        private List<Order> GetStrategyOrders(decimal quantity)\n        {\n            var groupOrderManager = new GroupOrderManager(1, 2, quantity);\n            return new List<Order>()\n            {\n                Order.CreateOrder(new SubmitOrderRequest(\n                    OrderType.ComboMarket,\n                    _callOption.Type,\n                    _callOption.Symbol,\n                    1m.GetOrderLegGroupQuantity(groupOrderManager),\n                    0,\n                    0,\n                    _algorithm.Time,\n                    \"\",\n                    groupOrderManager: groupOrderManager)),\n                Order.CreateOrder(new SubmitOrderRequest(\n                    OrderType.ComboMarket,\n                    _putOption.Type,\n                    _putOption.Symbol,\n                    1m.GetOrderLegGroupQuantity(groupOrderManager),\n                    0,\n                    0,\n                    _algorithm.Time,\n                    \"\",\n                    groupOrderManager: groupOrderManager))\n            };\n        }\n\n        private void SetUpOptionStrategy(int initialHoldingsQuantity)\n        {\n            const decimal price = 1.5m;\n            const decimal underlyingPrice = 300m;\n\n            _equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n            _callOption.SetMarketPrice(new Tick { Value = price });\n            _putOption.SetMarketPrice(new Tick { Value = price });\n\n            _callOption.Holdings.SetHoldings(1m, initialHoldingsQuantity);\n            _putOption.Holdings.SetHoldings(1m, initialHoldingsQuantity);\n\n            Assert.AreEqual(1, _portfolio.Positions.Groups.Count);\n\n            var positionGroup = _portfolio.Positions.Groups.First();\n            Assert.AreEqual(initialHoldingsQuantity < 0 ? OptionStrategyDefinitions.ShortStraddle.Name : OptionStrategyDefinitions.Straddle.Name,\n                positionGroup.BuyingPowerModel.ToString());\n\n            var callOptionPosition = positionGroup.Positions.Single(x => x.Symbol == _callOption.Symbol);\n            Assert.AreEqual(initialHoldingsQuantity, callOptionPosition.Quantity);\n\n            var putOptionPosition = positionGroup.Positions.Single(x => x.Symbol == _putOption.Symbol);\n            Assert.AreEqual(initialHoldingsQuantity, putOptionPosition.Quantity);\n        }\n\n        private void ComputeAndAssertQuantityForDeltaBuyingPower(IPositionGroup positionGroup, decimal expectedQuantity, decimal deltaBuyingPower)\n        {\n            var quantity = positionGroup.BuyingPowerModel.GetMaximumLotsForDeltaBuyingPower(new GetMaximumLotsForDeltaBuyingPowerParameters(\n                _portfolio, positionGroup, deltaBuyingPower, minimumOrderMarginPortfolioPercentage: 0)).NumberOfLots;\n\n            Assert.AreEqual(expectedQuantity, quantity);\n        }\n\n        private List<Order> GetPositionGroupOrders(IPositionGroup positionGroup, decimal initialPositionGroupQuantity, decimal quantity)\n        {\n            var groupOrderManager = new GroupOrderManager(1, positionGroup.Count, quantity);\n            return positionGroup.Positions.Select(position => Order.CreateOrder(new SubmitOrderRequest(\n                OrderType.ComboMarket,\n                position.Symbol.SecurityType,\n                position.Symbol,\n                (position.Quantity / initialPositionGroupQuantity).GetOrderLegGroupQuantity(groupOrderManager),\n                0,\n                0,\n                _algorithm.Time,\n                \"\",\n                groupOrderManager: groupOrderManager))).ToList();\n        }\n\n        private IPositionGroup SetUpOptionStrategy(OptionStrategyDefinition optionStrategyDefinition, int initialHoldingsQuantity, int? strike = null,\n            bool updateCashbook = true)\n        {\n            if (initialHoldingsQuantity == 0)\n            {\n                var group = SetUpOptionStrategy(optionStrategyDefinition, 1, updateCashbook: false);\n                foreach (var position in group.Positions)\n                {\n                    var security = _algorithm.Securities[position.Symbol];\n                    security.Holdings.SetHoldings(0, 0);\n                }\n                Assert.AreEqual(0, _portfolio.Positions.Groups.Count);\n\n                return group;\n            }\n\n            var may172023 = new DateTime(2023, 05, 17);\n            var may192023 = new DateTime(2023, 05, 19);\n\n            var spyMay19_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, may192023));\n            spyMay19_300Call.SetMarketPrice(new Tick { Value = 112m });\n            var spyMay19_310Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 310, may192023));\n            spyMay19_310Call.SetMarketPrice(new Tick { Value = 100m });\n            var spyMay19_320Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 320, may192023));\n            spyMay19_320Call.SetMarketPrice(new Tick { Value = 92m });\n            var spyMay19_330Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 330, may192023));\n            spyMay19_330Call.SetMarketPrice(new Tick { Value = 82m });\n\n            var spyMay17_200Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 200, may172023));\n            spyMay17_200Call.SetMarketPrice(new Tick { Value = 220m });\n            var spyMay17_400Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 400, may172023));\n            spyMay17_400Call.SetMarketPrice(new Tick { Value = 28m });\n            var spyMay17_300Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, may172023));\n            spyMay17_300Call.SetMarketPrice(new Tick { Value = 110m });\n            var spyMay17_500Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 500, may172023));\n            spyMay17_500Call.SetMarketPrice(new Tick { Value = 0.04m });\n\n            var spyMay19_300Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 300, may192023));\n            spyMay19_300Put.SetMarketPrice(new Tick { Value = 0.02m });\n            var spyMay19_310Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 310, may192023));\n            spyMay19_310Put.SetMarketPrice(new Tick { Value = 0.03m });\n            var spyMay19_320Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 320, may192023));\n            spyMay19_320Put.SetMarketPrice(new Tick { Value = 0.05m });\n            var spyMay17_300Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 300, may172023));\n            spyMay17_300Put.SetMarketPrice(new Tick { Value = 0.01m });\n\n            var jun212024 = new DateTime(2024, 06, 21);\n\n            var spyJun21_534Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 534, jun212024));\n            spyJun21_534Call.SetMarketPrice(new Tick { Value = 0.01m });\n            var spyJun21_524Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 524, jun212024));\n            spyJun21_524Call.SetMarketPrice(new Tick { Value = 2.29m });\n            var spyJun21_542Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 542, jun212024));\n            spyJun21_542Call.SetMarketPrice(new Tick { Value = 3.047m });\n            var spyJun21_546Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 546, jun212024));\n            spyJun21_546Call.SetMarketPrice(new Tick { Value = 2.53m });\n            var spyJun21_550Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 550, jun212024));\n            spyJun21_550Call.SetMarketPrice(new Tick { Value = 0.01m });\n            var spyJun21_554Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 554, jun212024));\n            spyJun21_554Call.SetMarketPrice(new Tick { Value = 1e-25m });\n\n            var spyJun21_524Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 524, jun212024));\n            spyJun21_524Put.SetMarketPrice(new Tick { Value = 0.827m });\n            var spyJun21_514Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 514, jun212024));\n            spyJun21_514Put.SetMarketPrice(new Tick { Value = 0.018m });\n            var spyJun21_542Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 542, jun212024));\n            spyJun21_542Put.SetMarketPrice(new Tick { Value = 2.994m });\n\n            var jul192024 = new DateTime(2024, 07, 19);\n\n            var spyJul19_542Call = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 542, jul192024));\n            spyJul19_542Call.SetMarketPrice(new Tick { Value = 6.972m });\n\n            var spyJul19_542Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 542, jul192024));\n            spyJul19_542Put.SetMarketPrice(new Tick { Value = 6.075m });\n            var spyJun21_544Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 544, jun212024));\n            spyJun21_544Put.SetMarketPrice(new Tick { Value = 1e-25m });\n            var spyJun21_548Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 548, jun212024));\n            spyJun21_548Put.SetMarketPrice(new Tick { Value = 0.02m });\n            var spyJun21_552Put = _algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Put, 552, jun212024));\n            spyJun21_552Put.SetMarketPrice(new Tick { Value = 3.484m });\n\n            _equity.SetMarketPrice(new Tick { Value = 410m });\n            _equity.SetLeverage(4);\n\n            var expectedPositionGroupBPMStrategy = optionStrategyDefinition.Name;\n\n            if (optionStrategyDefinition.Name == OptionStrategyDefinitions.NakedCall.Name)\n            {\n                var optionContract = spyMay19_300Call;\n                optionContract.Holdings.SetHoldings(optionContract.Price, -initialHoldingsQuantity);\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.NakedPut.Name)\n            {\n                var optionContract = spyMay19_300Put;\n                optionContract.Holdings.SetHoldings(optionContract.Price, -initialHoldingsQuantity);\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.CoveredCall.Name)\n            {\n                _equity.Holdings.SetHoldings(_equity.Price, initialHoldingsQuantity * _callOption.ContractMultiplier);\n\n                var optionContract = spyMay19_300Call;\n                if (strike.HasValue)\n                {\n                    switch (strike.Value)\n                    {\n                        case 200:\n                            optionContract = spyMay17_200Call;\n                            break;\n                        case 300:\n                            optionContract = spyMay17_300Call;\n                            break;\n                        case 400:\n                            optionContract = spyMay17_400Call;\n                            break;\n                        case 500:\n                            optionContract = spyMay17_500Call;\n                            break;\n                    }\n                }\n\n                optionContract.Holdings.SetHoldings(optionContract.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ProtectiveCall.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ProtectiveCall.Name)\n            {\n                _equity.Holdings.SetHoldings(_equity.Price, -initialHoldingsQuantity * _callOption.ContractMultiplier);\n                spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.CoveredCall.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.CoveredPut.Name)\n            {\n                _equity.Holdings.SetHoldings(_equity.Price, -initialHoldingsQuantity * _putOption.ContractMultiplier);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ProtectivePut.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ProtectivePut.Name)\n            {\n                _equity.Holdings.SetHoldings(_equity.Price, initialHoldingsQuantity * _putOption.ContractMultiplier);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.CoveredPut.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ProtectiveCollar.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 524.62m });\n                _equity.SetLeverage(2);\n\n                _equity.Holdings.SetHoldings(_equity.Price, initialHoldingsQuantity * _putOption.ContractMultiplier);\n                spyJun21_534Call.Holdings.SetHoldings(spyJun21_534Call.Price, -initialHoldingsQuantity);\n                spyJun21_514Put.Holdings.SetHoldings(spyJun21_514Put.Price, initialHoldingsQuantity);\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.Conversion.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 524.63m });\n                _equity.SetLeverage(2);\n\n                _equity.Holdings.SetHoldings(_equity.Price, initialHoldingsQuantity * _putOption.ContractMultiplier);\n                spyJun21_524Call.Holdings.SetHoldings(spyJun21_524Call.Price, -initialHoldingsQuantity);\n                spyJun21_524Put.Holdings.SetHoldings(spyJun21_524Put.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ReverseConversion.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ReverseConversion.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 524.61m });\n                _equity.SetLeverage(2);\n\n                _equity.Holdings.SetHoldings(_equity.Price, -initialHoldingsQuantity * _putOption.ContractMultiplier);\n                spyJun21_524Call.Holdings.SetHoldings(spyJun21_524Call.Price, initialHoldingsQuantity);\n                spyJun21_524Put.Holdings.SetHoldings(spyJun21_524Put.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.Conversion.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BearCallSpread.Name)\n            {\n                var shortCallOption = spyMay19_300Call;\n                var longCallOption = spyMay19_310Call;\n\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BullCallSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BearPutSpread.Name)\n            {\n                var longPutOption = spyMay19_310Put;\n                var shortPutOption = spyMay19_300Put;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BullPutSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BullCallSpread.Name)\n            {\n                var shortCallOption = spyMay19_310Call;\n                var longCallOption = spyMay19_300Call;\n\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BearCallSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BullPutSpread.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay19_310Put;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BearPutSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.Straddle.Name)\n            {\n                spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, initialHoldingsQuantity);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortStraddle.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortStraddle.Name)\n            {\n                spyMay19_300Call.Holdings.SetHoldings(spyMay19_300Call.Price, -initialHoldingsQuantity);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.Straddle.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.Strangle.Name)\n            {\n                spyMay19_310Call.Holdings.SetHoldings(spyMay19_310Call.Price, initialHoldingsQuantity);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortStrangle.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortStrangle.Name)\n            {\n                spyMay19_310Call.Holdings.SetHoldings(spyMay19_310Call.Price, -initialHoldingsQuantity);\n                spyMay19_300Put.Holdings.SetHoldings(spyMay19_300Put.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.Strangle.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ButterflyCall.Name)\n            {\n                var lowerStrikeCallOption = spyMay19_300Call;\n                var middleStrikeCallOption = spyMay19_310Call;\n                var upperStrikeCallOption = spyMay19_320Call;\n\n                lowerStrikeCallOption.Holdings.SetHoldings(lowerStrikeCallOption.Price, initialHoldingsQuantity);\n                middleStrikeCallOption.Holdings.SetHoldings(middleStrikeCallOption.Price, -2 * initialHoldingsQuantity);\n                upperStrikeCallOption.Holdings.SetHoldings(upperStrikeCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortButterflyCall.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortButterflyCall.Name)\n            {\n                var lowerStrikeCallOption = spyMay19_300Call;\n                var middleStrikeCallOption = spyMay19_310Call;\n                var upperStrikeCallOption = spyMay19_320Call;\n\n                lowerStrikeCallOption.Holdings.SetHoldings(lowerStrikeCallOption.Price, -initialHoldingsQuantity);\n                middleStrikeCallOption.Holdings.SetHoldings(middleStrikeCallOption.Price, 2 * initialHoldingsQuantity);\n                upperStrikeCallOption.Holdings.SetHoldings(middleStrikeCallOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ButterflyCall.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ButterflyPut.Name)\n            {\n                var lowerStrikePutOption = spyMay19_300Put;\n                var middleStrikePutOption = spyMay19_310Put;\n                var upperStrikePutOption = spyMay19_320Put;\n\n                lowerStrikePutOption.Holdings.SetHoldings(lowerStrikePutOption.Price, initialHoldingsQuantity);\n                middleStrikePutOption.Holdings.SetHoldings(middleStrikePutOption.Price, -2 * initialHoldingsQuantity);\n                upperStrikePutOption.Holdings.SetHoldings(upperStrikePutOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortButterflyPut.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortButterflyPut.Name)\n            {\n                var lowerStrikePutOption = spyMay19_300Put;\n                var middleStrikePutOption = spyMay19_310Put;\n                var upperStrikePutOption = spyMay19_320Put;\n\n                lowerStrikePutOption.Holdings.SetHoldings(lowerStrikePutOption.Price, -initialHoldingsQuantity);\n                middleStrikePutOption.Holdings.SetHoldings(middleStrikePutOption.Price, 2 * initialHoldingsQuantity);\n                upperStrikePutOption.Holdings.SetHoldings(upperStrikePutOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ButterflyPut.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.CallCalendarSpread.Name)\n            {\n                var longCallOption = spyMay19_300Call;\n                var shortCallOption = spyMay17_300Call;\n\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortCallCalendarSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortCallCalendarSpread.Name)\n            {\n                var longCallOption = spyMay19_300Call;\n                var shortCallOption = spyMay17_300Call;\n\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.CallCalendarSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.PutCalendarSpread.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay17_300Put;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortPutCalendarSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortPutCalendarSpread.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay17_300Put;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, -initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.PutCalendarSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.IronButterfly.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay19_310Put;\n                var shortCallOption = spyMay19_310Call;\n                var longCallOption = spyMay19_320Call;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortIronButterfly.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortIronButterfly.Name)\n            {\n                var shortPutOption = spyMay19_300Put;\n                var longPutOption = spyMay19_310Put;\n                var longCallOption = spyMay19_310Call;\n                var shortCallOption = spyMay19_320Call;\n\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.IronButterfly.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.IronCondor.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay19_310Put;\n                var shortCallOption = spyMay19_320Call;\n                var longCallOption = spyMay19_330Call;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortIronCondor.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortIronCondor.Name)\n            {\n                var shortPutOption = spyMay19_300Put;\n                var longPutOption = spyMay19_310Put;\n                var longCallOption = spyMay19_320Call;\n                var shortCallOption = spyMay19_330Call;\n\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.IronCondor.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BoxSpread.Name)\n            {\n                var longPutOption = spyMay19_320Put;\n                var shortPutOption = spyMay19_300Put;\n                var shortCallOption = spyMay19_320Call;\n                var longCallOption = spyMay19_300Call;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortBoxSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortBoxSpread.Name)\n            {\n                var longPutOption = spyMay19_300Put;\n                var shortPutOption = spyMay19_320Put;\n                var shortCallOption = spyMay19_300Call;\n                var longCallOption = spyMay19_320Call;\n\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BoxSpread.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.JellyRoll.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 542m });\n\n                var shortCallOption = spyJun21_542Call;\n                var longPutOption = spyJun21_542Put;\n                var longCallOption = spyJul19_542Call;\n                var shortPutOption = spyJul19_542Put;\n\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.ShortJellyRoll.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.ShortJellyRoll.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 542m });\n\n                var longCallOption = spyJun21_542Call;\n                var shortPutOption = spyJun21_542Put;\n                var shortCallOption = spyJul19_542Call;\n                var longPutOption = spyJul19_542Put;\n\n                longCallOption.Holdings.SetHoldings(longCallOption.Price, initialHoldingsQuantity);\n                shortPutOption.Holdings.SetHoldings(shortPutOption.Price, -initialHoldingsQuantity);\n                shortCallOption.Holdings.SetHoldings(shortCallOption.Price, -initialHoldingsQuantity);\n                longPutOption.Holdings.SetHoldings(longPutOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.JellyRoll.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BearCallLadder.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 548.392m });\n                \n                var lowStrikeOption = spyJun21_546Call;\n                var middleStrikeOption = spyJun21_550Call;\n                var highStrikeOption = spyJun21_554Call;\n\n                lowStrikeOption.Holdings.SetHoldings(lowStrikeOption.Price, -initialHoldingsQuantity);\n                middleStrikeOption.Holdings.SetHoldings(middleStrikeOption.Price, initialHoldingsQuantity);\n                highStrikeOption.Holdings.SetHoldings(highStrikeOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BullCallLadder.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BearPutLadder.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 548.343m });\n                \n                var lowStrikeOption = spyJun21_544Put;\n                var middleStrikeOption = spyJun21_548Put;\n                var highStrikeOption = spyJun21_552Put;\n\n                lowStrikeOption.Holdings.SetHoldings(lowStrikeOption.Price, -initialHoldingsQuantity);\n                middleStrikeOption.Holdings.SetHoldings(middleStrikeOption.Price, -initialHoldingsQuantity);\n                highStrikeOption.Holdings.SetHoldings(highStrikeOption.Price, initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BullPutLadder.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BullCallLadder.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 548.392m });\n                \n                var lowStrikeOption = spyJun21_546Call;\n                var middleStrikeOption = spyJun21_550Call;\n                var highStrikeOption = spyJun21_554Call;\n\n                lowStrikeOption.Holdings.SetHoldings(lowStrikeOption.Price, initialHoldingsQuantity);\n                middleStrikeOption.Holdings.SetHoldings(middleStrikeOption.Price, -initialHoldingsQuantity);\n                highStrikeOption.Holdings.SetHoldings(highStrikeOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BearCallLadder.Name;\n                }\n            }\n            else if (optionStrategyDefinition.Name == OptionStrategyDefinitions.BullPutLadder.Name)\n            {\n                _equity.SetMarketPrice(new Tick { Value = 548.343m });\n                \n                var lowStrikeOption = spyJun21_544Put;\n                var middleStrikeOption = spyJun21_548Put;\n                var highStrikeOption = spyJun21_552Put;\n\n                lowStrikeOption.Holdings.SetHoldings(lowStrikeOption.Price, initialHoldingsQuantity);\n                middleStrikeOption.Holdings.SetHoldings(middleStrikeOption.Price, initialHoldingsQuantity);\n                highStrikeOption.Holdings.SetHoldings(highStrikeOption.Price, -initialHoldingsQuantity);\n\n                if (initialHoldingsQuantity < 0)\n                {\n                    expectedPositionGroupBPMStrategy = OptionStrategyDefinitions.BearPutLadder.Name;\n                }\n            }\n\n            var positionGroup = _portfolio.Positions.Groups.Single();\n            Assert.AreEqual(expectedPositionGroupBPMStrategy, positionGroup.BuyingPowerModel.ToString());\n\n            if (updateCashbook)\n            {\n                // Update the cashbook after setting up the holdings for the strategy.\n                // We would need to wire too many things up in order to emulate the engine and update the cashbook automatically.\n                foreach (var position in positionGroup)\n                {\n                    _portfolio.CashBook.Single().Value.AddAmount(-_portfolio.Securities[position.Symbol].Holdings.HoldingsValue);\n                }\n            }\n\n            return positionGroup;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/FedRateQLRiskFreeRateEstimatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common.Data\n{\n    [TestFixture]\n    public class FedRateQLRiskFreeRateEstimatorTests\n    {\n        [TestCase(\"20200306\", 0.0175)]      // Friday\n        [TestCase(\"20200307\", 0.0175)]      // Saturday, use Friday's value\n        [TestCase(\"20200308\", 0.0175)]      // Sunday, use Friday's value\n        [TestCase(\"20200310\", 0.0175)]      // Tuesday\n        public void Estimate(string dateString, decimal rate)\n        {\n            var spx = Symbols.SPX;\n            var tz = TimeZones.NewYork;\n            var optionSymbol = Symbol.CreateOption(spx.Value, spx.ID.Market, OptionStyle.European, OptionRight.Put, 4200,\n                new DateTime(2021, 1, 15));\n            var evaluationDate = Parse.DateTimeExact(dateString, \"yyyyMMdd\");\n\n            // setting up\n            var equity = OptionPriceModelTests.GetEquity(spx, 100m, 0.25m, tz);\n            var option = OptionPriceModelTests.GetOption(optionSymbol, equity, tz);\n            var tick = new Tick { Time = evaluationDate, Value = 10m };\n\n            // get the risk free rate\n            var estimator = new FedRateQLRiskFreeRateEstimator();\n            var result = estimator.Estimate(option,\n                new Slice(evaluationDate, new List<BaseData> { tick }, evaluationDate),\n                new OptionContract(option));\n\n            Assert.AreEqual(rate, result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionChainProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OptionChainProviderTests\n    {\n        private BacktestingOptionChainProvider _backtestingOptionChainProvider;\n        private LiveOptionChainProvider _liveOptionChainProvider;\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            _backtestingOptionChainProvider = new BacktestingOptionChainProvider();\n            _backtestingOptionChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n\n            _liveOptionChainProvider = new LiveOptionChainProvider();\n            _liveOptionChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n        }\n\n        [Test]\n        public void UsesMultipleResolutionsFutureOption()\n        {\n            // we don't have minute data for this date\n            var date = new DateTime(2020, 01, 7);\n            var future = Symbol.CreateFuture(QuantConnect.Securities.Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 6, 19));\n            var optionChain = _backtestingOptionChainProvider.GetOptionContractList(future, date).OrderBy(s => s.ID.StrikePrice).ToList();\n\n            Assert.IsTrue(optionChain.All(x => x.SecurityType == SecurityType.FutureOption));\n            Assert.IsTrue(optionChain.All(x => x.ID.Symbol == \"ES\"));\n            Assert.IsTrue(optionChain.All(x => x.Underlying == future));\n            Assert.IsTrue(optionChain.All(x => x.ID.Date.Date >= date));\n            Assert.AreEqual(107, optionChain.Count);\n            Assert.AreEqual(2900m, optionChain.First().ID.StrikePrice);\n            Assert.AreEqual(3500, optionChain.Last().ID.StrikePrice);\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderUsesPreviousTradableDateChain()\n        {\n            // the 7th is a saturday should fetch fridays data instead\n            var date = new DateTime(2014, 6, 7);\n            Assert.AreEqual(DayOfWeek.Saturday, date.DayOfWeek);\n\n            var twxOptionChain = _backtestingOptionChainProvider.GetOptionContractList(Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA), date)\n                .ToList();\n\n            Assert.AreEqual(184, twxOptionChain.Count);\n            Assert.AreEqual(23m, twxOptionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n            Assert.AreEqual(105m, twxOptionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderLoadsEquityOptionChain()\n        {\n            var twxOptionChain = _backtestingOptionChainProvider.GetOptionContractList(Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA), new DateTime(2014, 6, 5))\n                .ToList();\n\n            Assert.AreEqual(184, twxOptionChain.Count);\n            Assert.AreEqual(23m, twxOptionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n            Assert.AreEqual(105m, twxOptionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderLoadsFutureOptionChain()\n        {\n            var esOptionChain = _backtestingOptionChainProvider.GetOptionContractList(\n                Symbol.CreateFuture(\n                    QuantConnect.Securities.Futures.Indices.SP500EMini,\n                    Market.CME,\n                    new DateTime(2020, 6, 19)),\n                new DateTime(2020, 1, 5))\n                .ToList();\n\n            Assert.AreEqual(107, esOptionChain.Count);\n            Assert.AreEqual(2900m, esOptionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n            Assert.AreEqual(3500m, esOptionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderIndexOption()\n        {\n            var spxOption = Symbol.CreateCanonicalOption(Symbols.SPX);\n            foreach (var option in new [] { Symbols.SPX, spxOption })\n            {\n                var optionChain = _backtestingOptionChainProvider.GetOptionContractList(option, new DateTime(2021, 01, 04)).ToList();\n\n                Assert.AreEqual(6, optionChain.Count);\n                Assert.AreEqual(3200, optionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n                Assert.AreEqual(4250, optionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n\n                foreach (var optionSymbol in optionChain)\n                {\n                    Assert.AreEqual(\"SPX\", optionSymbol.ID.Symbol);\n                    Assert.AreEqual(\"SPX\", optionSymbol.Underlying.ID.Symbol);\n                }\n            }\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderWeeklyIndexOption()\n        {\n            var spxWeeklyOption = Symbol.CreateCanonicalOption(Symbols.SPX, \"SPXW\", null, null);\n            foreach (var option in new[] { spxWeeklyOption })\n            {\n                var optionChain = _backtestingOptionChainProvider.GetOptionContractList(option, new DateTime(2021, 01, 04)).ToList();\n\n                Assert.AreEqual(12, optionChain.Count);\n                Assert.AreEqual(3700, optionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n                Assert.AreEqual(3800, optionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n\n                foreach (var optionSymbol in optionChain)\n                {\n                    Assert.AreEqual(\"SPXW\", optionSymbol.ID.Symbol);\n                    Assert.AreEqual(\"SPX\", optionSymbol.Underlying.ID.Symbol);\n                }\n            }\n        }\n\n        [Test]\n        public void BacktestingOptionChainProviderResolvesSymbolMapping()\n        {\n            var ticker = \"GOOCV\"; // Old ticker, should resolve and fetch GOOG\n            var underlyingSymbol = QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            var alias = \"?\" + underlyingSymbol.Value;\n            var optionSymbol = Symbol.CreateOption(\n                underlyingSymbol,\n                underlyingSymbol.ID.Market,\n                Symbol.GetOptionTypeFromUnderlying(underlyingSymbol).DefaultOptionStyle(),\n                default(OptionRight),\n                0,\n                SecurityIdentifier.DefaultDate,\n                alias);\n\n            var googOptionChain = _backtestingOptionChainProvider.GetOptionContractList(optionSymbol.Underlying, new DateTime(2015, 12, 23))\n                .ToList();\n\n            Assert.AreEqual(118, googOptionChain.Count);\n            Assert.AreEqual(600m, googOptionChain.OrderBy(s => s.ID.StrikePrice).First().ID.StrikePrice);\n            Assert.AreEqual(800m, googOptionChain.OrderBy(s => s.ID.StrikePrice).Last().ID.StrikePrice);\n        }\n\n        [Test]\n        public void CachingProviderCachesSymbolsByDate()\n        {\n            var provider = new CachingOptionChainProvider(new DelayedOptionChainProvider(1000));\n\n            var stopwatch = Stopwatch.StartNew();\n            var symbols = provider.GetOptionContractList(Symbol.Empty, new DateTime(2017, 7, 28));\n            stopwatch.Stop();\n\n            Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1000);\n            Assert.AreEqual(2, symbols.Count());\n\n            stopwatch.Restart();\n            symbols = provider.GetOptionContractList(Symbol.Empty, new DateTime(2017, 7, 28));\n            stopwatch.Stop();\n\n            Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, 10);\n            Assert.AreEqual(2, symbols.Count());\n\n            stopwatch.Restart();\n            symbols = provider.GetOptionContractList(Symbol.Empty, new DateTime(2017, 7, 29));\n            stopwatch.Stop();\n\n            Assert.GreaterOrEqual(stopwatch.ElapsedMilliseconds, 1000);\n            Assert.AreEqual(2, symbols.Count());\n        }\n\n        [Test]\n        public void LiveOptionChainProviderReturnsData()\n        {\n            var spxOption = Symbol.CreateCanonicalOption(Symbols.SPX);\n            var spxwOption = Symbol.CreateCanonicalOption(Symbols.SPX, \"SPXW\", null, null);\n\n            foreach (var symbol in new[] { Symbols.SPY, Symbols.AAPL, Symbols.MSFT, Symbols.SPX, spxOption, spxwOption })\n            {\n                var result = _liveOptionChainProvider.GetOptionContractList(symbol, DateTime.Today).ToList();\n                var countCall = result.Count(x => x.ID.OptionRight == OptionRight.Call);\n                var countPut = result.Count(x => x.ID.OptionRight == OptionRight.Put);\n\n                Assert.Greater(countCall, 0);\n                Assert.Greater(countPut, 0);\n\n                var expectedOptionTicker = symbol.ID.Symbol;\n                var expectedUnderlyingTicker = symbol.ID.Symbol;\n                if (symbol.ID.Symbol == \"SPXW\")\n                {\n                    expectedUnderlyingTicker = \"SPX\";\n                }\n                foreach (var optionSymbol in result)\n                {\n                    Assert.AreEqual(expectedOptionTicker, optionSymbol.ID.Symbol);\n                    Assert.AreEqual(expectedUnderlyingTicker, optionSymbol.Underlying.ID.Symbol);\n                }\n            }\n        }\n\n        [Test]\n        public void LiveOptionChainProviderReturnsNoDataForInvalidSymbol()\n        {\n            var symbol = Symbol.Create(\"ABCDEF123\", SecurityType.Equity, Market.USA);\n\n            var result = _liveOptionChainProvider.GetOptionContractList(symbol, DateTime.Today);\n\n            Assert.IsFalse(result.Any());\n        }\n\n        [Test]\n        [Category(\"TravisExclude\")] // For now this test is excluded from the Travis build because of frequent forbidden 403 HTTP response from CME API\n        public void LiveOptionChainProviderReturnsFutureOptionData()\n        {\n            var now = DateTime.Now;\n            var december = new DateTime(now.Year, 12, 1);\n            var canonicalFuture = Symbol.Create(\"ES\", SecurityType.Future, Market.CME);\n            var expiry = FuturesExpiryFunctions.FuturesExpiryFunction(canonicalFuture)(december);\n\n            // When the current year's december contract expires, the test starts failing.\n            // This will happen around the last 10 days of December, but will start working\n            // once we've crossed into the new year.\n            // Let's try the next listed contract, which is in March of the next year if this is the case.\n            if (now >= expiry)\n            {\n                expiry = now.AddMonths(-now.Month).AddYears(1).AddMonths(3);\n            }\n\n            var underlyingFuture = Symbol.CreateFuture(\"ES\", Market.CME, expiry);\n            var result = _liveOptionChainProvider.GetOptionContractList(underlyingFuture, now).ToList();\n\n            Assert.AreNotEqual(0, result.Count);\n\n            foreach (var symbol in result)\n            {\n                Assert.IsTrue(symbol.HasUnderlying);\n                Assert.AreEqual(Market.CME, symbol.ID.Market);\n                Assert.AreEqual(OptionStyle.American, symbol.ID.OptionStyle);\n                Assert.GreaterOrEqual(symbol.ID.StrikePrice, 100m);\n                Assert.Less(symbol.ID.StrikePrice, 30000m);\n            }\n        }\n\n        [Test]\n        public void LiveOptionChainProviderReturnsNoDataForOldFuture()\n        {\n            var now = DateTime.Now;\n            var december = now.AddMonths(-now.Month).AddYears(-1);\n            var underlyingFuture = Symbol.CreateFuture(\"ES\", Market.CME, december);\n\n            var result = _liveOptionChainProvider.GetOptionContractList(underlyingFuture, december);\n\n            Assert.AreEqual(0, result.Count());\n        }\n\n        [TestCase(OptionRight.Call, 1650, 2020, 3, 26)]\n        [TestCase(OptionRight.Put, 1540, 2020, 3, 26)]\n        [TestCase(OptionRight.Call, 1600, 2020, 2, 25)]\n        [TestCase(OptionRight.Put, 1545, 2020, 2, 25)]\n        public void BacktestingOptionChainProviderReturnsMultipleContractsForZipFileContainingMultipleContracts(\n            OptionRight right,\n            int strike,\n            int year,\n            int month,\n            int day)\n        {\n            var underlying = Symbol.CreateFuture(\"GC\", Market.COMEX, new DateTime(2020, 4, 28));\n            var expiry = new DateTime(year, month, day);\n            var expectedOption = Symbol.CreateOption(\n                underlying,\n                Market.COMEX,\n                OptionStyle.American,\n                right,\n                strike,\n                expiry);\n\n            var contracts = _backtestingOptionChainProvider.GetOptionContractList(underlying, new DateTime(2020, 1, 5))\n                .ToHashSet();\n\n            Assert.IsTrue(\n                contracts.Contains(expectedOption),\n                $\"Failed to find contract {expectedOption} in: [{string.Join(\", \", contracts.Select(s => s.ToString()))}\");\n        }\n    }\n\n    internal class DelayedOptionChainProvider : IOptionChainProvider\n    {\n        private readonly int _delayMilliseconds;\n\n        public DelayedOptionChainProvider(int delayMilliseconds)\n        {\n            _delayMilliseconds = delayMilliseconds;\n        }\n\n        public IEnumerable<Symbol> GetOptionContractList(Symbol symbol, DateTime date)\n        {\n            Thread.Sleep(_delayMilliseconds);\n\n            return new[] { Symbols.SPY_C_192_Feb19_2016, Symbols.SPY_P_192_Feb19_2016 };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionChainsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture]\n    public class OptionChainsTests\n    {\n        private Symbol _spyEquity;\n        private Symbol _spyOptionCanonical;\n        private Symbol _spxIndex;\n        private Symbol _spxOptionCanonical;\n        private Symbol _esFuture;\n        private Symbol _esFutureOptionCanonical;\n\n        [SetUp]\n        public void SetUp()\n        {\n            // Equity\n            _spyEquity = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            _spyOptionCanonical = Symbol.CreateCanonicalOption(_spyEquity);\n\n            // Index  \n            _spxIndex = Symbol.Create(\"SPX\", SecurityType.Index, Market.USA);\n            _spxOptionCanonical = Symbol.CreateCanonicalOption(_spxIndex);\n\n            // Future\n            _esFuture = Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2024, 3, 19));\n            _esFutureOptionCanonical = Symbol.CreateCanonicalOption(_esFuture);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity, true)]\n        [TestCase(SecurityType.Equity, false)]\n        [TestCase(SecurityType.Index, true)]\n        [TestCase(SecurityType.Index, false)]\n        [TestCase(SecurityType.Future, true)]\n        [TestCase(SecurityType.Future, false)]\n        public void OptionChainCanBeAccessedByCanonicalOrUnderlying(SecurityType securityType, bool setByCanonical)\n        {\n            var chains = new OptionChains();\n\n            // Get the symbols based on security type\n            var (underlyingSymbol, canonicalSymbol) = GetSymbolsForSecurityType(securityType);\n            var expectedChain = new OptionChain(canonicalSymbol, new DateTime(2024, 1, 1));\n\n            // Set using either canonical or underlying\n            var setSymbol = setByCanonical ? canonicalSymbol : underlyingSymbol;\n            chains[setSymbol] = expectedChain;\n\n            // Should be accessible by BOTH symbols regardless of which one was used to set\n            // Test access by canonical\n            var chainByCanonical = chains[canonicalSymbol];\n            Assert.AreEqual(expectedChain, chainByCanonical);\n            Assert.IsTrue(chains.TryGetValue(canonicalSymbol, out var chainByTryGetCanonical));\n            Assert.AreEqual(expectedChain, chainByTryGetCanonical);\n\n            // Test access by underlying\n            var chainByUnderlying = chains[underlyingSymbol];\n            Assert.AreEqual(expectedChain, chainByUnderlying);\n            Assert.IsTrue(chains.TryGetValue(underlyingSymbol, out var chainByTryGetUnderlying));\n            Assert.AreEqual(expectedChain, chainByTryGetUnderlying);\n        }\n\n        [Test]\n        public void ContainsKeyWorksWithUnderlyingOrCanonical()\n        {\n            var chains = new OptionChains();\n            var (underlyingSymbol, canonicalSymbol) = GetSymbolsForSecurityType(SecurityType.Equity);\n            var expectedChain = new OptionChain(canonicalSymbol, new DateTime(2024, 1, 1));\n            chains[canonicalSymbol] = expectedChain;\n\n            // Should be accessible by BOTH regardless of which was used to add\n            Assert.IsTrue(chains.ContainsKey(underlyingSymbol));\n            Assert.IsTrue(chains.ContainsKey(canonicalSymbol));\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void AddWorksWithUnderlyingOrCanonical(bool useCanonical)\n        {\n            var chains = new OptionChains();\n            var expectedChain = new OptionChain(_spyOptionCanonical, new DateTime(2024, 1, 1));\n\n            var addSymbol = useCanonical ? _spyOptionCanonical : _spyEquity;\n            chains.Add(addSymbol, expectedChain);\n\n            // Should be accessible by BOTH regardless of which was used to add\n            Assert.AreEqual(expectedChain, chains[_spyOptionCanonical]);\n            Assert.AreEqual(expectedChain, chains[_spyEquity]);\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void RemoveWorksWithUnderlyingOrCanonical(bool useCanonical)\n        {\n            var chains = new OptionChains();\n            var expectedChain = new OptionChain(_spyOptionCanonical, new DateTime(2024, 1, 1));\n            chains[_spyOptionCanonical] = expectedChain;\n\n            var removeSymbol = useCanonical ? _spyOptionCanonical : _spyEquity;\n            var result = chains.Remove(removeSymbol);\n\n            Assert.IsTrue(result);\n            Assert.IsFalse(chains.ContainsKey(_spyOptionCanonical));\n            Assert.IsFalse(chains.ContainsKey(_spyEquity));\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ContainsWorksWithUnderlyingOrCanonicalKeyValuePair(bool useCanonical)\n        {\n            var chains = new OptionChains();\n            var expectedChain = new OptionChain(_spyOptionCanonical, new DateTime(2024, 1, 1));\n            chains[_spyOptionCanonical] = expectedChain;\n\n            var containsSymbol = useCanonical ? _spyOptionCanonical : _spyEquity;\n            var result = chains.Contains(new KeyValuePair<Symbol, OptionChain>(containsSymbol, expectedChain));\n\n            Assert.IsTrue(result);\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void RemoveWorksWithUnderlyingOrCanonicalKeyValuePair(bool useCanonical)\n        {\n            var chains = new OptionChains();\n            var expectedChain = new OptionChain(_spyOptionCanonical, new DateTime(2024, 1, 1));\n            chains[_spyOptionCanonical] = expectedChain;\n\n            var removeSymbol = useCanonical ? _spyOptionCanonical : _spyEquity;\n            var result = chains.Remove(new KeyValuePair<Symbol, OptionChain>(removeSymbol, expectedChain));\n\n            Assert.IsTrue(result);\n            Assert.IsFalse(chains.ContainsKey(_spyOptionCanonical));\n            Assert.IsFalse(chains.ContainsKey(_spyEquity));\n        }\n\n        private (Symbol underlying, Symbol canonical) GetSymbolsForSecurityType(SecurityType securityType)\n        {\n            return securityType switch\n            {\n                SecurityType.Equity => (_spyEquity, _spyOptionCanonical),\n                SecurityType.Index => (_spxIndex, _spxOptionCanonical),\n                SecurityType.Future => (_esFuture, _esFutureOptionCanonical),\n                _ => throw new ArgumentException($\"Unsupported security type: {securityType}\")\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionFilterUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OptionFilterUniverseTests\n    {\n        private static string TestOptionUniverseFile = @\"\n#expiry,strike,right,open,high,low,close,volume,open_interest,implied_volatility,delta,gamma,vega,theta,rho\n,,,5488.47998046875,5523.64013671875,5451.1201171875,5460.47998046875,7199220000,,,,,,,\n20260618,5400,C,780.3000,853.9000,709.6000,767.7500,0,135,0.1637928,0.6382026,0.0002890,26.5721377,-0.5042690,55.5035521\n20261218,5400,C,893.1400,907.7100,893.1400,907.5400,37,1039,0.1701839,0.6420671,0.0002447,28.9774913,-0.4608812,67.5259867\n20271217,5400,C,1073.0000,1073.0000,1073.0000,1073.0000,0,889,0.1839256,0.6456981,0.0001858,32.6109403,-0.3963479,88.5870185\n20281215,5400,C,1248.0000,1248.0000,1248.0000,1248.0000,0,301,0.1934730,0.6472619,0.0001512,35.1083627,-0.3434647,106.9858230\n20291221,5400,C,1467.9000,1467.9000,1467.9000,1467.9000,0,9,0.2046702,0.6460372,0.0001254,36.9157598,-0.2993105,122.2236355\n20240719,5405,C,95.4500,95.4500,95.4500,95.4500,1,311,0.1006795,0.6960459,0.0026897,4.4991247,-1.4284818,2.0701880\n20240816,5405,C,161.4000,161.4000,161.4000,161.4000,0,380,0.1088739,0.6472976,0.0017128,7.3449930,-1.1139626,4.5112640\n20240920,5405,C,213.7000,213.7000,211.0000,211.0000,0,33,0.1149306,0.6316343,0.0012532,9.7567496,-0.9462173,7.4872272\n20241018,5405,C,254.0000,303.3500,218.2500,238.0500,0,,0.1183992,0.6273390,0.0010556,11.2892617,-0.8673778,9.8420483\n20240719,5410,C,143.5900,143.5900,119.7100,119.7100,11,355,0.0995106,0.6842402,0.0027673,4.5750811,-1.4291241,2.0364155\n20240816,5410,C,151.2000,151.2000,151.2000,151.2000,0,68,0.1080883,0.6395066,0.0017388,7.4027436,-1.1113164,4.4598077\n20240920,5410,C,202.5000,202.5000,201.9800,201.9800,0,211,0.1142983,0.6258911,0.0012667,9.8073284,-0.9438102,7.4239078\n20241018,5410,C,256.4800,256.4800,255.9000,255.9000,0,91,0.1180060,0.6223570,0.0010637,11.3388534,-0.8661655,9.7694707\n20241115,5410,C,279.7500,279.7500,279.2300,279.2300,0,65,0.1268034,0.6170056,0.0008881,12.7072390,-0.8357895,11.9829003\n20240719,5415,C,123.1800,123.1800,98.0300,98.0300,5,307,0.0985516,0.6716430,0.0028403,4.6505424,-1.4312099,2.0001484\n20240816,5415,C,146.6900,146.6900,146.6900,146.6900,3,901,0.1073207,0.6315307,0.0017645,7.4585091,-1.1084001,4.4069495\n20240920,5415,C,194.1000,196.7000,194.1000,196.7000,0,63,0.1136398,0.6200837,0.0012804,9.8561442,-0.9410592,7.3597879\n20241018,5415,C,246.5000,295.7500,210.7500,230.9500,0,,0.1172852,0.6175838,0.0010746,11.3844988,-0.8632046,9.7014393\n20240719,5420,C,119.7500,119.7500,94.0000,94.0000,31,453,0.0973479,0.6589639,0.0029188,4.7207612,-1.4288180,1.9636645\n20240816,5420,C,181.5800,181.5800,154.8300,154.8300,4,110,0.1065704,0.6233721,0.0017897,7.5120648,-1.1051922,4.3527055\n\".Trim();\n\n        private BaseData _underlying;\n        private List<OptionUniverse> _testOptionsData;\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            var config = new SubscriptionDataConfig(typeof(OptionUniverse),\n                Symbol.CreateCanonicalOption(Symbols.SPX),\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var date = new DateTime(2024, 06, 28);\n\n            _testOptionsData = new List<OptionUniverse>();\n            var factory = new OptionUniverse();\n            using var stream = new MemoryStream(Encoding.UTF8.GetBytes(TestOptionUniverseFile));\n            using var reader = new StreamReader(stream);\n            while (!reader.EndOfStream)\n            {\n                var data = (OptionUniverse)factory.Reader(config, reader, date, false);\n                if (data != null)\n                {\n                    if (data.Symbol.HasUnderlying)\n                    {\n                        _testOptionsData.Add(data);\n                    }\n                    else\n                    {\n                        _underlying = data;\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void FiltersContractsByImpliedVolatility()\n        {\n            var minIV = 0.10m;\n            var maxIV = 0.12m;\n            var expectedContracts = 11;\n\n            // Set up\n            var universe = new OptionFilterUniverse(GetOption(), _testOptionsData, _underlying);\n            universe.Refresh(_testOptionsData, _underlying, _underlying.EndTime);\n\n            // Filter\n            universe.ImpliedVolatility(minIV, maxIV);\n\n            // Assert\n            Assert.That(universe.AllSymbols.Count(), Is.EqualTo(expectedContracts));\n            Assert.That(universe.AllSymbols, Has.All.Matches<Symbol>(contract =>\n            {\n                var data = GetContractData(contract);\n                return data.ImpliedVolatility >= minIV && data.ImpliedVolatility <= maxIV;\n            }));\n        }\n\n        [Test]\n        public void FiltersContractsByOpenInterest()\n        {\n            var minOpenInterest = 500;\n            var maxOpenInterest = 1000;\n            var expectedContracts = 2;\n\n            // Set up\n            var universe = new OptionFilterUniverse(GetOption(), _testOptionsData, _underlying);\n            universe.Refresh(_testOptionsData, _underlying, _underlying.EndTime);\n\n            // Filter\n            universe.OpenInterest(minOpenInterest, maxOpenInterest);\n\n            // Assert\n            Assert.That(universe.AllSymbols.Count(), Is.EqualTo(expectedContracts));\n            Assert.That(universe.AllSymbols, Has.All.Matches<Symbol>(contract =>\n            {\n                var data = GetContractData(contract);\n                return data.OpenInterest >= minOpenInterest && data.OpenInterest <= maxOpenInterest;\n            }));\n        }\n\n        [TestCase(\"Delta\", 0.63, 0.64, 4)]\n        [TestCase(\"Gamma\", 0.0008, 0.0011, 4)]\n        [TestCase(\"Vega\", 7.5, 11.3, 5)]\n        [TestCase(\"Theta\", -401.50, -182.50, 8)]\n        [TestCase(\"Rho\", 4, 10, 10)]\n        public void FiltersContractsByIndividualGreek(string greekName, decimal greekMinValue, decimal greekMaxValue, int expectedContracts)\n        {\n            // Set up\n            var universe = new OptionFilterUniverse(GetOption(), _testOptionsData, _underlying);\n            universe.Refresh(_testOptionsData, _underlying, _underlying.EndTime);\n\n            // Filter\n            var greekFilterMethod = universe.GetType().GetMethod(greekName);\n            greekFilterMethod.Invoke(universe, new object[] { greekMinValue, greekMaxValue });\n\n            // Assert\n            Assert.That(universe.AllSymbols.Count(), Is.EqualTo(expectedContracts));\n            Assert.That(universe.AllSymbols, Has.All.Matches<Symbol>(contract =>\n            {\n                var greeks = GetGreeks(contract);\n                var greek = (decimal)greeks.GetType().GetProperty(greekName).GetValue(greeks);\n                return greek >= greekMinValue && greek <= greekMaxValue;\n            }));\n        }\n\n        [Test]\n        public void FiltersContractsByMultipleGreeks()\n        {\n            var deltaMin = 0.62m;\n            var deltaMax = 0.68m;\n            var gammaMin = 0.00024m;\n            var gammaMax = 0.0028m;\n            var thetaMin = -511m;\n            var thetaMax = -146m;\n            var expectedContracts = 11;\n\n            // Set up\n            var universe = new OptionFilterUniverse(GetOption(), _testOptionsData, _underlying);\n            universe.Refresh(_testOptionsData, _underlying, _underlying.EndTime);\n\n            // Filter\n            universe.Delta(deltaMin, deltaMax).Gamma(gammaMin, gammaMax).Theta(thetaMin, thetaMax);\n\n            // Assert\n            Assert.That(universe.AllSymbols.Count(), Is.EqualTo(expectedContracts));\n            Assert.That(universe.AllSymbols, Has.All.Matches<Symbol>(contract =>\n            {\n                var greeks = GetGreeks(contract);\n                return greeks.Delta >= deltaMin && greeks.Delta <= deltaMax &&\n                       greeks.Gamma >= gammaMin && greeks.Gamma <= gammaMax &&\n                       greeks.Theta >= thetaMin && greeks.Theta <= thetaMax;\n            }));\n        }\n\n        [Test]\n        public void OptionUnivereDataFiltersAreNotSupportedForFutureOptions()\n        {\n            // Set up\n            var symbol = Symbols.CreateFutureOptionSymbol(Symbols.ES_Future_Chain, OptionRight.Call,\n                1000m, new DateTime(2024, 12, 27));\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute,\n                    TimeZones.NewYork, TimeZones.NewYork, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            var universe = new OptionFilterUniverse(option, _testOptionsData, _underlying);\n\n            // Filter and assert\n            Assert.Multiple(() =>\n            {\n                Assert.Throws<InvalidOperationException>(() => universe.ImpliedVolatility(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.IV(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.OpenInterest(0, 1));\n                Assert.Throws<InvalidOperationException>(() => universe.OI(0, 1));\n                Assert.Throws<InvalidOperationException>(() => universe.Delta(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.D(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.Gamma(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.G(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.Vega(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.V(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.Theta(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.T(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.Rho(0m, 1m));\n                Assert.Throws<InvalidOperationException>(() => universe.R(0m, 1m));\n            });\n        }\n\n        private static Option GetOption(Symbol symbol = null)\n        {\n            symbol ??= Symbols.SPY_C_192_Feb19_2016;\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute,\n                    TimeZones.NewYork, TimeZones.NewYork, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            return option;\n        }\n\n        private OptionUniverse GetContractData(Symbol contract)\n        {\n            return _testOptionsData.Single(x => x.Symbol == contract);\n        }\n\n        private Greeks GetGreeks(Symbol contract)\n        {\n            return GetContractData(contract).Greeks;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionPortfolioModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture]\n    public class OptionPortfolioModelTests\n    {\n        private IResultHandler _resultHandler;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _resultHandler = new TestResultHandler(Console.WriteLine);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _resultHandler.Exit();\n        }\n\n        [Test]\n        public void OptionExercise_NonAccountCurrency()\n        {\n            var algorithm = new QCAlgorithm();\n            var securities = new SecurityManager(new TimeKeeper(DateTime.Now, TimeZones.NewYork));\n            var transactions = new SecurityTransactionManager(null, securities);\n            var transactionHandler = new BacktestingTransactionHandler();\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n\n            var EUR = new Cash(\"EUR\", 100*192, 10);\n            portfolio.CashBook.Add(\"EUR\", EUR);\n            portfolio.SetCash(\"USD\", 0, 1);\n            algorithm.Securities = securities;\n            using var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            transactionHandler.Initialize(algorithm, backtestingBrokerage, _resultHandler);\n\n            try\n            {\n                transactions.SetOrderProcessor(transactionHandler);\n\n                securities.Add(\n                    Symbols.SPY,\n                    new Security(\n                        SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                        CreateTradeBarConfig(Symbols.SPY),\n                        EUR,\n                        SymbolProperties.GetDefault(EUR.Symbol),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCache()\n                    )\n                );\n                securities.Add(\n                    Symbols.SPY_C_192_Feb19_2016,\n                    new Option(\n                        SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                        CreateTradeBarConfig(Symbols.SPY_C_192_Feb19_2016),\n                        EUR,\n                        new OptionSymbolProperties(new SymbolProperties(\"EUR\", \"EUR\", 100, 0.01m, 1, string.Empty)),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null\n                    )\n                );\n                securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 1);\n                securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 200 });\n\n                transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -1, 0, 0, securities.UtcTime, \"\"));\n                var option = (Option)securities[Symbols.SPY_C_192_Feb19_2016];\n                var order = (OptionExerciseOrder)transactions.GetOrders(x => true).First();\n                option.Underlying = securities[Symbols.SPY];\n\n                var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n                Assert.AreEqual(2, fills.Count);\n                Assert.IsFalse(fills[0].IsAssignment);\n\n                StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n                Assert.AreEqual(\"Option Exercise\", fills[1].Message);\n\n                foreach (var fill in fills)\n                {\n                    fill.Ticket = order.ToOrderTicket(transactions);\n                    portfolio.ProcessFills(new List<OrderEvent> { fill });\n                }\n\n                // now we have long position in SPY with average price equal to strike\n                var newUnderlyingHoldings = securities[Symbols.SPY].Holdings;\n                // we added 100*192 EUR (strike price) at beginning, all consumed by exercise\n                Assert.AreEqual(0, EUR.Amount);\n                Assert.AreEqual(0, portfolio.CashBook[\"USD\"].Amount);\n                Assert.AreEqual(100, newUnderlyingHoldings.Quantity);\n                Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n                // and long call option position has disappeared\n                Assert.AreEqual(0, securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        private static SubscriptionDataConfig CreateTradeBarConfig(Symbol symbol)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionSecurityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture]\n    public class OptionSecurityTests\n    {\n        [Test]\n        public void FutureOptionSecurityUsesFutureOptionMarginModel()\n        {\n            var underlyingFuture = Symbol.CreateFuture(\n                QuantConnect.Securities.Futures.Indices.SP500EMini,\n                Market.CME,\n                new DateTime(2021, 3, 19));\n\n            var futureOption = Symbol.CreateOption(underlyingFuture,\n                Market.CME,\n                OptionStyle.American,\n                OptionRight.Call,\n                2550m,\n                new DateTime(2021, 3, 19));\n\n            var futureOptionSecurity = new QuantConnect.Securities.FutureOption.FutureOption(\n                futureOption,\n                MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.CME, futureOption, futureOption.SecurityType),\n                new Cash(\"USD\", 100000m, 1m),\n                new OptionSymbolProperties(string.Empty, \"USD\", 1m, 0.01m, 1m),\n                new CashBook(),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache(),\n                null);\n\n            Assert.IsTrue(futureOptionSecurity.BuyingPowerModel is FuturesOptionsMarginModel);\n        }\n\n        [Test]\n        public void EquityOptionSecurityUsesOptionMarginModel()\n        {\n            var underlyingEquity = Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n            var equityOption = Symbol.CreateOption(underlyingEquity,\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                42.5m,\n                new DateTime(2014, 6, 21));\n\n            var equityOptionSecurity = new Option(\n                equityOption,\n                MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, equityOption, equityOption.SecurityType),\n                new Cash(\"USD\", 100000m, 1m),\n                new OptionSymbolProperties(string.Empty, \"USD\", 100m, 0.0001m, 1m),\n                new CashBook(),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache(),\n                null);\n\n            Assert.IsTrue(equityOptionSecurity.BuyingPowerModel is OptionMarginModel);\n        }\n\n        [Test]\n        public void AlgorithmSendsOneTimeWarningAboutOptionModelsConsistency(\n            [Values(nameof(OptionModelsConsistencyRegressionAlgorithm), nameof(IndexOptionModelsConsistencyRegressionAlgorithm))] string algorithmName,\n            [Values(Language.CSharp, Language.Python)] Language language)\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\n                algorithmName,\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0\"},\n                    {\"Tracking Error\", \"0\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"},\n                    {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n                },\n                language,\n                AlgorithmStatus.Completed);\n\n            var result = AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                returnLogs: true);\n\n            Assert.IsTrue(result.Logs.Any(message => message.Contains(\"Warning: Security \") &&\n                message.EndsWith(\"To avoid this, consider using a security initializer to set the right models to each security type according to your algorithm's requirements.\")));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionStrategiesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\n\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture]\n    public class OptionStrategiesTests\n    {\n        [Test]\n        public void BuildsCoveredCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.CoveredCall(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.CoveredCall.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(-1, optionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsProtectiveCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ProtectiveCall(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ProtectiveCall.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(1, optionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(-100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsCoveredPutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.CoveredPut(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.CoveredPut.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Put, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(-1, optionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(-100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsProtectivePutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ProtectivePut(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ProtectivePut.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Put, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(1, optionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsProtectiveCollarStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var callStrike = 350m;\n            var putStrike = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ProtectiveCollar(canonicalOptionSymbol, callStrike, putStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ProtectiveCollar.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callOptionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, callOptionLeg.Right);\n            Assert.AreEqual(callStrike, callOptionLeg.Strike);\n            Assert.AreEqual(expiration, callOptionLeg.Expiration);\n            Assert.AreEqual(-1, callOptionLeg.Quantity);\n\n            var putOptionLeg = strategy.OptionLegs[1];\n            Assert.AreEqual(OptionRight.Put, putOptionLeg.Right);\n            Assert.AreEqual(putStrike, putOptionLeg.Strike);\n            Assert.AreEqual(expiration, putOptionLeg.Expiration);\n            Assert.AreEqual(1, putOptionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsConversionStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.Conversion(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.Conversion.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callOptionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, callOptionLeg.Right);\n            Assert.AreEqual(strike, callOptionLeg.Strike);\n            Assert.AreEqual(expiration, callOptionLeg.Expiration);\n            Assert.AreEqual(-1, callOptionLeg.Quantity);\n\n            var putOptionLeg = strategy.OptionLegs[1];\n            Assert.AreEqual(OptionRight.Put, putOptionLeg.Right);\n            Assert.AreEqual(strike, putOptionLeg.Strike);\n            Assert.AreEqual(expiration, putOptionLeg.Expiration);\n            Assert.AreEqual(1, putOptionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsReverseConversionStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ReverseConversion(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ReverseConversion.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callOptionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, callOptionLeg.Right);\n            Assert.AreEqual(strike, callOptionLeg.Strike);\n            Assert.AreEqual(expiration, callOptionLeg.Expiration);\n            Assert.AreEqual(1, callOptionLeg.Quantity);\n\n            var putOptionLeg = strategy.OptionLegs[1];\n            Assert.AreEqual(OptionRight.Put, putOptionLeg.Right);\n            Assert.AreEqual(strike, putOptionLeg.Strike);\n            Assert.AreEqual(expiration, putOptionLeg.Expiration);\n            Assert.AreEqual(-1, putOptionLeg.Quantity);\n\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            var underlyingLeg = strategy.UnderlyingLegs[0];\n            Assert.AreEqual(underlying, underlyingLeg.Symbol);\n            Assert.AreEqual(-100, underlyingLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsNakedCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.NakedCall(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.NakedCall.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Call, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(-1, optionLeg.Quantity);\n\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n        }\n\n        [Test]\n        public void BuildsStraddleStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.Straddle(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.Straddle.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Call);\n            Assert.AreEqual(strike, callLeg.Strike);\n            Assert.AreEqual(expiration, callLeg.Expiration);\n            Assert.AreEqual(1, callLeg.Quantity);\n\n            var putLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Put);\n            Assert.AreEqual(strike, putLeg.Strike);\n            Assert.AreEqual(expiration, putLeg.Expiration);\n            Assert.AreEqual(1, putLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortStraddleStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortStraddle(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortStraddle.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Call);\n            Assert.AreEqual(strike, callLeg.Strike);\n            Assert.AreEqual(expiration, callLeg.Expiration);\n            Assert.AreEqual(-1, callLeg.Quantity);\n\n            var putLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Put);\n            Assert.AreEqual(strike, putLeg.Strike);\n            Assert.AreEqual(expiration, putLeg.Expiration);\n            Assert.AreEqual(-1, putLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingStrangleStrategyWithInvalidStrikePrices()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var expiration = new DateTime(2023, 08, 18);\n\n            // Same strikes\n            var callStrike = 350m;\n            var putStrike = 350m;\n            Assert.Throws<ArgumentException>(() => OptionStrategies.Strangle(canonicalOptionSymbol, callStrike, putStrike, expiration));\n\n            // Call strike < put strike\n            callStrike = 340m;\n            putStrike = 350m;\n            Assert.Throws<ArgumentException>(() => OptionStrategies.Strangle(canonicalOptionSymbol, callStrike, putStrike, expiration));\n        }\n\n        [Test]\n        public void BuildsStrangleStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var callStrike = 350m;\n            var putStrike = 340m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.Strangle(canonicalOptionSymbol, callStrike, putStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.Strangle.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Call);\n            Assert.AreEqual(callStrike, callLeg.Strike);\n            Assert.AreEqual(expiration, callLeg.Expiration);\n            Assert.AreEqual(1, callLeg.Quantity);\n\n            var putLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Put);\n            Assert.AreEqual(putStrike, putLeg.Strike);\n            Assert.AreEqual(expiration, putLeg.Expiration);\n            Assert.AreEqual(1, putLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortStrangleStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var callStrike = 350m;\n            var putStrike = 340m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortStrangle(canonicalOptionSymbol, callStrike, putStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortStrangle.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n\n            var callLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Call);\n            Assert.AreEqual(callStrike, callLeg.Strike);\n            Assert.AreEqual(expiration, callLeg.Expiration);\n            Assert.AreEqual(-1, callLeg.Quantity);\n\n            var putLeg = strategy.OptionLegs.Single(leg => leg.Right == OptionRight.Put);\n            Assert.AreEqual(putStrike, putLeg.Strike);\n            Assert.AreEqual(expiration, putLeg.Expiration);\n            Assert.AreEqual(-1, putLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsNakedPutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.NakedPut(canonicalOptionSymbol, strike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.NakedPut.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            var optionLeg = strategy.OptionLegs[0];\n            Assert.AreEqual(OptionRight.Put, optionLeg.Right);\n            Assert.AreEqual(strike, optionLeg.Strike);\n            Assert.AreEqual(expiration, optionLeg.Expiration);\n            Assert.AreEqual(-1, optionLeg.Quantity);\n\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n        }\n\n        [Test]\n        public void FailsBuildingButterflyCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n\n            // Unordered strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, lowerStrike, middleStrike, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, lowerStrike, higherStrike, middleStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, middleStrike, lowerStrike, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, middleStrike, higherStrike, lowerStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, higherStrike, lowerStrike, middleStrike, expiration));\n\n            // Uneven inter-strike distances\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, lowerStrike, middleStrike + 1, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyCall(canonicalOptionSymbol, lowerStrike, middleStrike - 1, higherStrike, expiration));\n        }\n\n        [Test]\n        public void BuildsButterflyCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ButterflyCall(canonicalOptionSymbol, higherStrike, middleStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ButterflyCall.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var higherStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == higherStrike);\n            Assert.AreEqual(OptionRight.Call, higherStrikeLeg.Right);\n            Assert.AreEqual(expiration, higherStrikeLeg.Expiration);\n            Assert.AreEqual(1, higherStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == middleStrike);\n            Assert.AreEqual(OptionRight.Call, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(-2, middleStrikeLeg.Quantity);\n\n            var lowerStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == lowerStrike);\n            Assert.AreEqual(OptionRight.Call, lowerStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowerStrikeLeg.Expiration);\n            Assert.AreEqual(1, lowerStrikeLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortButterflyCallStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortButterflyCall(canonicalOptionSymbol, higherStrike, middleStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortButterflyCall.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var higherStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == higherStrike);\n            Assert.AreEqual(OptionRight.Call, higherStrikeLeg.Right);\n            Assert.AreEqual(expiration, higherStrikeLeg.Expiration);\n            Assert.AreEqual(-1, higherStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == middleStrike);\n            Assert.AreEqual(OptionRight.Call, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(2, middleStrikeLeg.Quantity);\n\n            var lowerStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == lowerStrike);\n            Assert.AreEqual(OptionRight.Call, lowerStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowerStrikeLeg.Expiration);\n            Assert.AreEqual(-1, lowerStrikeLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingButterflyPutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n\n            // Unordered strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, lowerStrike, middleStrike, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, lowerStrike, higherStrike, middleStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, middleStrike, lowerStrike, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, middleStrike, higherStrike, lowerStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, higherStrike, lowerStrike, middleStrike, expiration));\n\n            // Uneven inter-strike distances\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, lowerStrike, middleStrike + 1, higherStrike, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ButterflyPut(canonicalOptionSymbol, lowerStrike, middleStrike - 1, higherStrike, expiration));\n        }\n\n        [Test]\n        public void BuildsButterflyPutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ButterflyPut(canonicalOptionSymbol, higherStrike, middleStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ButterflyPut.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var higherStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == higherStrike);\n            Assert.AreEqual(OptionRight.Put, higherStrikeLeg.Right);\n            Assert.AreEqual(expiration, higherStrikeLeg.Expiration);\n            Assert.AreEqual(1, higherStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == middleStrike);\n            Assert.AreEqual(OptionRight.Put, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(-2, middleStrikeLeg.Quantity);\n\n            var lowerStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == lowerStrike);\n            Assert.AreEqual(OptionRight.Put, lowerStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowerStrikeLeg.Expiration);\n            Assert.AreEqual(1, lowerStrikeLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortButterflyPutStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 350m;\n            var lowerStrike = 300m;\n            var middleStrike = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortButterflyPut(canonicalOptionSymbol, higherStrike, middleStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortButterflyPut.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var higherStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == higherStrike);\n            Assert.AreEqual(OptionRight.Put, higherStrikeLeg.Right);\n            Assert.AreEqual(expiration, higherStrikeLeg.Expiration);\n            Assert.AreEqual(-1, higherStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == middleStrike);\n            Assert.AreEqual(OptionRight.Put, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(2, middleStrikeLeg.Quantity);\n\n            var lowerStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == lowerStrike);\n            Assert.AreEqual(OptionRight.Put, lowerStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowerStrikeLeg.Expiration);\n            Assert.AreEqual(-1, lowerStrikeLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingCallCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            // Invalid expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, DateTime.MinValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, DateTime.MaxValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, DateTime.MinValue));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, DateTime.MaxValue));\n\n            // Switched expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, farExpiration, nearExpiration));\n\n            // Same expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, nearExpiration));\n\n        }\n\n        [Test]\n        public void BuildsCallCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.CallCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.CallCalendarSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == nearExpiration);\n            Assert.AreEqual(OptionRight.Call, nearExpirationLeg.Right);\n            Assert.AreEqual(nearExpiration, nearExpirationLeg.Expiration);\n            Assert.AreEqual(-1, nearExpirationLeg.Quantity);\n\n            var farExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == farExpiration);\n            Assert.AreEqual(OptionRight.Call, farExpirationLeg.Right);\n            Assert.AreEqual(farExpiration, farExpirationLeg.Expiration);\n            Assert.AreEqual(1, farExpirationLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortCallCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.ShortCallCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortCallCalendarSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == nearExpiration);\n            Assert.AreEqual(OptionRight.Call, nearExpirationLeg.Right);\n            Assert.AreEqual(nearExpiration, nearExpirationLeg.Expiration);\n            Assert.AreEqual(1, nearExpirationLeg.Quantity);\n\n            var farExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == farExpiration);\n            Assert.AreEqual(OptionRight.Call, farExpirationLeg.Right);\n            Assert.AreEqual(farExpiration, farExpirationLeg.Expiration);\n            Assert.AreEqual(-1, farExpirationLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingPutCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            // Invalid expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, DateTime.MinValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, DateTime.MaxValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, DateTime.MinValue));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, DateTime.MaxValue));\n\n            // Switched expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, farExpiration, nearExpiration));\n\n            // Same expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, nearExpiration));\n\n        }\n\n        [Test]\n        public void BuildsPutCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.PutCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.PutCalendarSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == nearExpiration);\n            Assert.AreEqual(OptionRight.Put, nearExpirationLeg.Right);\n            Assert.AreEqual(nearExpiration, nearExpirationLeg.Expiration);\n            Assert.AreEqual(-1, nearExpirationLeg.Quantity);\n\n            var farExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == farExpiration);\n            Assert.AreEqual(OptionRight.Put, farExpirationLeg.Right);\n            Assert.AreEqual(farExpiration, farExpirationLeg.Expiration);\n            Assert.AreEqual(1, farExpirationLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortPutCalendarSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.ShortPutCalendarSpread(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortPutCalendarSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == nearExpiration);\n            Assert.AreEqual(OptionRight.Put, nearExpirationLeg.Right);\n            Assert.AreEqual(nearExpiration, nearExpirationLeg.Expiration);\n            Assert.AreEqual(1, nearExpirationLeg.Quantity);\n\n            var farExpirationLeg = strategy.OptionLegs.Single(x => x.Expiration == farExpiration);\n            Assert.AreEqual(OptionRight.Put, farExpirationLeg.Right);\n            Assert.AreEqual(farExpiration, farExpirationLeg.Expiration);\n            Assert.AreEqual(-1, farExpirationLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingIronButterflyStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 326m;\n            var strike4 = 350m;\n\n            // Unordered and non-equal interval strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike1, strike4, strike2, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike2, strike1, strike4, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike2, strike4, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike4, strike1, strike2, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike4, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronButterfly(canonicalOptionSymbol, strike1, strike3, strike4, expiration));\n        }\n\n        [Test]\n        public void BuildsIronButterflyStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.IronButterfly(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.IronButterfly.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, longPutLeg.Right);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(+1, longPutLeg.Quantity);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike2 && x.Right == OptionRight.Put);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike2 && x.Right == OptionRight.Call);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, longCallLeg.Right);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(+1, longCallLeg.Quantity);\n        }\n\n\n        [Test]\n        public void BuildsShortIronButterflyStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortIronButterfly(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortIronButterfly.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, shortPutLeg.Right);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike2 && x.Right == OptionRight.Put);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(1, longPutLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike2 && x.Right == OptionRight.Call);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(1, longCallLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, shortCallLeg.Right);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n        }\n        [Test]\n        public void FailsBuildingIronCondorStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var strike4 = 375m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronCondor(canonicalOptionSymbol, strike4, strike3, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronCondor(canonicalOptionSymbol, strike1, strike1, strike3, strike4, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronCondor(canonicalOptionSymbol, strike2, strike1, strike3, strike4, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronCondor(canonicalOptionSymbol, strike1, strike3, strike2, strike4, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.IronCondor(canonicalOptionSymbol, strike1, strike2, strike4, strike3, expiration));\n        }\n\n        [Test]\n        public void BuildsIronCondorStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var strike4 = 375m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.IronCondor(canonicalOptionSymbol, strike1, strike2, strike3, strike4, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.IronCondor.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, longPutLeg.Right);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(1, longPutLeg.Quantity);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, shortPutLeg.Right);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, shortCallLeg.Right);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike4);\n            Assert.AreEqual(OptionRight.Call, longCallLeg.Right);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(1, longCallLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortIronCondorStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var strike4 = 375m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortIronCondor(canonicalOptionSymbol, strike1, strike2, strike3, strike4, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortIronCondor.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, shortPutLeg.Right);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, longPutLeg.Right);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(+1, longPutLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, longCallLeg.Right);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(+1, longCallLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Strike == strike4);\n            Assert.AreEqual(OptionRight.Call, shortCallLeg.Right);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingBoxSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 300m;\n            var strike2 = 325m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BoxSpread(canonicalOptionSymbol, strike1, strike2, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BoxSpread(canonicalOptionSymbol, strike1, strike1, expiration));\n        }\n\n        [Test]\n        public void BuildsBoxSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 320m;\n            var lowerStrike = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.BoxSpread(canonicalOptionSymbol, higherStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.BoxSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Put && x.Strike == higherStrike);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(1, longPutLeg.Quantity);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Put && x.Strike == lowerStrike);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Call && x.Strike == higherStrike);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Call && x.Strike == lowerStrike);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(1, longCallLeg.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortBoxSpreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var higherStrike = 320m;\n            var lowerStrike = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortBoxSpread(canonicalOptionSymbol, higherStrike, lowerStrike, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortBoxSpread.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var longPutLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Put && x.Strike == lowerStrike);\n            Assert.AreEqual(expiration, longPutLeg.Expiration);\n            Assert.AreEqual(1, longPutLeg.Quantity);\n\n            var shortPutLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Put && x.Strike == higherStrike);\n            Assert.AreEqual(expiration, shortPutLeg.Expiration);\n            Assert.AreEqual(-1, shortPutLeg.Quantity);\n\n            var shortCallLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Call && x.Strike == lowerStrike);\n            Assert.AreEqual(expiration, shortCallLeg.Expiration);\n            Assert.AreEqual(-1, shortCallLeg.Quantity);\n\n            var longCallLeg = strategy.OptionLegs.Single(x => x.Right == OptionRight.Call && x.Strike == higherStrike);\n            Assert.AreEqual(expiration, longCallLeg.Expiration);\n            Assert.AreEqual(1, longCallLeg.Quantity);\n        }\n\n        [Test]\n        public void FailsBuildingJellyRollStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            // Invalid expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, DateTime.MinValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, DateTime.MaxValue, farExpiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, nearExpiration, DateTime.MinValue));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, nearExpiration, DateTime.MaxValue));\n\n            // Switched expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, farExpiration, nearExpiration));\n\n            // Same expiration dates\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, nearExpiration, nearExpiration));\n        }\n\n        [Test]\n        public void BuildsJellyRollStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.JellyRoll(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.JellyRoll.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationCall = strategy.OptionLegs.Single(x => \n                x.Expiration == nearExpiration && x.Right == OptionRight.Call);\n            Assert.AreEqual(strike, nearExpirationCall.Strike);\n            Assert.AreEqual(-1, nearExpirationCall.Quantity);\n\n            var farExpirationCall = strategy.OptionLegs.Single(x =>\n                x.Expiration == farExpiration && x.Right == OptionRight.Call);\n            Assert.AreEqual(strike, farExpirationCall.Strike);\n            Assert.AreEqual(+1, farExpirationCall.Quantity);\n\n            var nearExpirationPut = strategy.OptionLegs.Single(x =>\n                x.Expiration == nearExpiration && x.Right == OptionRight.Put);\n            Assert.AreEqual(strike, nearExpirationPut.Strike);\n            Assert.AreEqual(+1, nearExpirationPut.Quantity);\n\n            var farExpirationPut = strategy.OptionLegs.Single(x =>\n                x.Expiration == farExpiration && x.Right == OptionRight.Put);\n            Assert.AreEqual(strike, farExpirationPut.Strike);\n            Assert.AreEqual(-1, farExpirationPut.Quantity);\n        }\n\n        [Test]\n        public void BuildsShortJellyRollStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike = 350m;\n            var nearExpiration = new DateTime(2023, 08, 18);\n            var farExpiration = new DateTime(2023, 09, 18);\n\n            var strategy = OptionStrategies.ShortJellyRoll(canonicalOptionSymbol, strike, nearExpiration, farExpiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.ShortJellyRoll.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(4, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var nearExpirationCall = strategy.OptionLegs.Single(x =>\n                x.Expiration == nearExpiration && x.Right == OptionRight.Call);\n            Assert.AreEqual(strike, nearExpirationCall.Strike);\n            Assert.AreEqual(+1, nearExpirationCall.Quantity);\n\n            var farExpirationCall = strategy.OptionLegs.Single(x =>\n                x.Expiration == farExpiration && x.Right == OptionRight.Call);\n            Assert.AreEqual(strike, farExpirationCall.Strike);\n            Assert.AreEqual(-1, farExpirationCall.Quantity);\n\n            var nearExpirationPut = strategy.OptionLegs.Single(x =>\n                x.Expiration == nearExpiration && x.Right == OptionRight.Put);\n            Assert.AreEqual(strike, nearExpirationPut.Strike);\n            Assert.AreEqual(-1, nearExpirationPut.Quantity);\n\n            var farExpirationPut = strategy.OptionLegs.Single(x =>\n                x.Expiration == farExpiration && x.Right == OptionRight.Put);\n            Assert.AreEqual(strike, farExpirationPut.Strike);\n            Assert.AreEqual(+1, farExpirationPut.Quantity);\n        }\n        \n        [Test]\n        public void FailsBuildingBearCallLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearCallLadder(canonicalOptionSymbol, strike3, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearCallLadder(canonicalOptionSymbol, strike1, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearCallLadder(canonicalOptionSymbol, strike2, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearCallLadder(canonicalOptionSymbol, strike1, strike3, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsBearCallLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.BearCallLadder(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.BearCallLadder.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Call, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(-1, lowStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Call, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(1, middleStrikeLeg.Quantity);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(1, highStrikeLeg.Quantity);\n        }\n        \n        [Test]\n        public void FailsBuildingBearPutLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 350m;\n            var strike2 = 325m;\n            var strike3 = 300m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearPutLadder(canonicalOptionSymbol, strike3, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearPutLadder(canonicalOptionSymbol, strike1, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearPutLadder(canonicalOptionSymbol, strike2, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BearPutLadder(canonicalOptionSymbol, strike1, strike3, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsBearPutLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 350m;\n            var strike2 = 325m;\n            var strike3 = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.BearPutLadder(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.BearPutLadder.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(1, highStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(-1, middleStrikeLeg.Quantity);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Put, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(-1, lowStrikeLeg.Quantity);\n        }\n        \n        [Test]\n        public void FailsBuildingBullCallLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullCallLadder(canonicalOptionSymbol, strike3, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullCallLadder(canonicalOptionSymbol, strike1, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullCallLadder(canonicalOptionSymbol, strike2, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullCallLadder(canonicalOptionSymbol, strike1, strike3, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsBullCallLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var strike3 = 350m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.BullCallLadder(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.BullCallLadder.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Call, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(1, lowStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Call, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(-1, middleStrikeLeg.Quantity);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Call, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(-1, highStrikeLeg.Quantity);\n        }\n        \n        [Test]\n        public void FailsBuildingBullPutLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strike1 = 350m;\n            var strike2 = 325m;\n            var strike3 = 300m;\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullPutLadder(canonicalOptionSymbol, strike3, strike2, strike1, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullPutLadder(canonicalOptionSymbol, strike1, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullPutLadder(canonicalOptionSymbol, strike2, strike1, strike3, expiration));\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.BullPutLadder(canonicalOptionSymbol, strike1, strike3, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsBullPutLadderStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 350m;\n            var strike2 = 325m;\n            var strike3 = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.BullPutLadder(canonicalOptionSymbol, strike1, strike2, strike3, expiration);\n\n            Assert.AreEqual(OptionStrategyDefinitions.BullPutLadder.Name, strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(3, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(-1, highStrikeLeg.Quantity);\n\n            var middleStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, middleStrikeLeg.Right);\n            Assert.AreEqual(expiration, middleStrikeLeg.Expiration);\n            Assert.AreEqual(1, middleStrikeLeg.Quantity);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike3);\n            Assert.AreEqual(OptionRight.Put, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(1, lowStrikeLeg.Quantity);\n        }\n\n        [TestCase(325, 300)]\n        [TestCase(300, 300)]\n        public void FailsBuildingCallBackspreadStrategy(decimal strike1, decimal strike2)\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.CallBackspread(canonicalOptionSymbol, strike1, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildCallBackspreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.CallBackspread(canonicalOptionSymbol, strike1, strike2, expiration);\n\n            Assert.AreEqual(\"Call Backspread\", strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Call, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(-1, lowStrikeLeg.Quantity);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Call, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(2, highStrikeLeg.Quantity);\n        }\n\n        [TestCase(325, 350)]\n        [TestCase(300, 300)]\n        public void FailsBuildingPutBackspreadStrategy(decimal strike1, decimal strike2)\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.PutBackspread(canonicalOptionSymbol, strike1, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsPutBackspreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 350m;\n            var strike2 = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.PutBackspread(canonicalOptionSymbol, strike1, strike2, expiration);\n\n            Assert.AreEqual(\"Put Backspread\", strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(-1, highStrikeLeg.Quantity);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(2, lowStrikeLeg.Quantity);\n        }\n\n        [TestCase(325, 300)]\n        [TestCase(300, 300)]\n        public void FailsBuildingShortCallBackspreadStrategy(decimal strike1, decimal strike2)\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ShortCallBackspread(canonicalOptionSymbol, strike1, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsShortCallBackspreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 300m;\n            var strike2 = 325m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortCallBackspread(canonicalOptionSymbol, strike1, strike2, expiration);\n\n            Assert.AreEqual(\"Short Call Backspread\", strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Call, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(1, lowStrikeLeg.Quantity);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Call, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(-2, highStrikeLeg.Quantity);\n        }\n\n        [TestCase(325, 350)]\n        [TestCase(300, 300)]\n        public void FailsBuildingShortPutBackspreadStrategy(decimal strike1, decimal strike2)\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var expiration = new DateTime(2023, 08, 18);\n\n            // Unordered and repeated strikes\n            Assert.Throws<ArgumentException>(\n                () => OptionStrategies.ShortPutBackspread(canonicalOptionSymbol, strike1, strike2, expiration));\n        }\n\n        [Test]\n        public void BuildsShortPutBackspreadStrategy()\n        {\n            var canonicalOptionSymbol = Symbols.SPY_Option_Chain;\n            var underlying = Symbols.SPY;\n            var strike1 = 350m;\n            var strike2 = 300m;\n            var expiration = new DateTime(2023, 08, 18);\n\n            var strategy = OptionStrategies.ShortPutBackspread(canonicalOptionSymbol, strike1, strike2, expiration);\n\n            Assert.AreEqual(\"Short Put Backspread\", strategy.Name);\n            Assert.AreEqual(underlying, strategy.Underlying);\n            Assert.AreEqual(canonicalOptionSymbol, strategy.CanonicalOption);\n\n            Assert.AreEqual(2, strategy.OptionLegs.Count);\n            Assert.AreEqual(0, strategy.UnderlyingLegs.Count);\n\n            var highStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike1);\n            Assert.AreEqual(OptionRight.Put, highStrikeLeg.Right);\n            Assert.AreEqual(expiration, highStrikeLeg.Expiration);\n            Assert.AreEqual(1, highStrikeLeg.Quantity);\n\n            var lowStrikeLeg = strategy.OptionLegs.Single(x => x.Strike == strike2);\n            Assert.AreEqual(OptionRight.Put, lowStrikeLeg.Right);\n            Assert.AreEqual(expiration, lowStrikeLeg.Expiration);\n            Assert.AreEqual(-2, lowStrikeLeg.Quantity);\n        }\n\n        private static IEnumerable<TestCaseData> GetSymbolsTestCases\n        {\n            get\n            {\n                // Equity option\n                var spyCanonicalOptionSymbol = Symbols.SPY_Option_Chain;\n                var spyContract = Symbol.CreateOption(Symbols.SPY, spyCanonicalOptionSymbol.ID.Market, \n                    spyCanonicalOptionSymbol.ID.OptionStyle, OptionRight.Call, 300m, new DateTime(2023, 08, 18));\n                yield return new TestCaseData(spyCanonicalOptionSymbol, spyContract);\n\n                // Index options\n                var spxCanonicalOptionSymbol = Symbol.CreateCanonicalOption(Symbols.SPX);\n                var spxContract = Symbol.CreateOption(Symbols.SPX, spxCanonicalOptionSymbol.ID.Market, \n                    spxCanonicalOptionSymbol.ID.OptionStyle, OptionRight.Put, 4000m, new DateTime(2023, 08, 18));\n                yield return new TestCaseData(spxCanonicalOptionSymbol, spxContract);\n\n                // Index weekly option\n                var spxwCanonicalOptionSymbol = Symbol.CreateCanonicalOption(Symbols.SPX, targetOption: \"SPXW\");\n                var spxwContract = Symbol.CreateOption(Symbols.SPX, \"SPXW\", spxwCanonicalOptionSymbol.ID.Market,\n                    spxwCanonicalOptionSymbol.ID.OptionStyle, OptionRight.Call, 4000m, new DateTime(2023, 08, 18));\n                yield return new TestCaseData(spxwCanonicalOptionSymbol, spxwContract);\n\n                // Future option\n                var esFutureContractSymbol = Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2023, 09, 15));\n                var esCanonicalOptionSymbol = Symbol.CreateCanonicalOption(esFutureContractSymbol);\n                var esOptionContract = Symbol.CreateOption(esFutureContractSymbol, esFutureContractSymbol.ID.Market,\n                    OptionStyle.American, OptionRight.Put, 4000m, new DateTime(2023, 08, 18));\n                yield return new TestCaseData(esCanonicalOptionSymbol, esOptionContract);\n            }\n        }\n\n        [TestCaseSource(nameof(GetSymbolsTestCases))]\n        public void SetsOptionLegsSymbols(Symbol canonicalSymbol, Symbol contractSymbol)\n        {\n            var strategy = new OptionStrategy(\"Test Strategy\", canonicalSymbol, new List<OptionStrategy.OptionLegData>\n            {\n                new OptionStrategy.OptionLegData\n                {\n                    Right = contractSymbol.ID.OptionRight,\n                    Strike = contractSymbol.ID.StrikePrice,\n                    Expiration = contractSymbol.ID.Date\n                }\n            });\n            var leg = strategy.OptionLegs.Single();\n            Assert.AreEqual(contractSymbol, leg.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/OptionSymbolTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options\n{\n    [TestFixture]\n    public class OptionSymbolTests\n    {\n        [Test]\n        public void IsOptionContractExpiredReturnsFalseForNonOptionSymbol()\n        {\n            Assert.IsFalse(OptionSymbol.IsOptionContractExpired(Symbols.SPY, DateTime.UtcNow));\n        }\n\n        [Test]\n        public void IsOptionContractExpiredReturnsTrueIfExpiredContract()\n        {\n            var symbol = Symbol.CreateOption(\n                \"BHP\",\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                55m,\n                new DateTime(2019, 9, 20));\n\n            Assert.IsTrue(OptionSymbol.IsOptionContractExpired(symbol, DateTime.UtcNow));\n        }\n\n        [Test]\n        public void IsOptionContractExpiredReturnsFalseIfActiveContract()\n        {\n            var symbol = Symbol.CreateOption(\n                \"BHP\",\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                55m,\n                new DateTime(2019, 9, 20));\n\n            Assert.IsFalse(OptionSymbol.IsOptionContractExpired(symbol, new DateTime(2019, 1, 1)));\n        }\n\n        [Test]\n        public void IsOptionContractExpiredReturnsFalseIfTimeOfDayDiffer()\n        {\n            var symbol = Symbol.CreateOption(\n                \"BHP\",\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                55m,\n                new DateTime(2022, 03, 11));\n\n            Assert.IsFalse(OptionSymbol.IsOptionContractExpired(symbol, new DateTime(2022, 03, 11)));\n        }\n\n        private static IEnumerable<TestCaseData> ExpirationDateTimeTestCases()\n        {\n            var equityOption = Symbols.SPY_C_192_Feb19_2016;\n            yield return new TestCaseData(equityOption, new DateTime(2016, 02, 19, 16, 0, 0));\n\n            // Expires on a Saturday, so the expiration date time should be the Friday before\n            equityOption = Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2016, 02, 20));\n            yield return new TestCaseData(equityOption, new DateTime(2016, 02, 19, 16, 0, 0));\n\n            var pmSettledIndexOption = Symbol.CreateOption(Symbols.SPX, \"SPXW\", Market.USA, OptionStyle.European,\n                OptionRight.Call, 200m, new DateTime(2016, 02, 12));\n            yield return new TestCaseData(pmSettledIndexOption, new DateTime(2016, 02, 12, 15, 15, 0));\n\n            var amSettledIndexOption = Symbol.CreateOption(Symbols.SPX, \"SPX\", Market.USA, OptionStyle.European,\n                OptionRight.Call, 200m, new DateTime(2016, 02, 18));\n            yield return new TestCaseData(amSettledIndexOption, new DateTime(2016, 02, 18, 8, 30, 0));\n        }\n\n        [TestCaseSource(nameof(ExpirationDateTimeTestCases))]\n        public void CalculatesSettlementDateTime(Symbol symbol, DateTime expectedSettlementDateTime)\n        {\n            var settlementDateTime = OptionSymbol.GetSettlementDateTime(symbol);\n            Assert.AreEqual(expectedSettlementDateTime, settlementDateTime);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/Option.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    /// <summary>\n    /// Provides array-indexer calling conventions for easily creating option contract symbols.\n    /// I suspect I'll update this later to fulfill the original vision of being a full option\n    /// chain, where indexing is successively applied, such as Puts[100m] would return a dictionary\n    /// keyed by expiration of all puts@100. To pull a specific one, Puts[100m][expiration] or Puts[100m][1]\n    /// using the weeks notation used in the indexers in this class.\n    /// </summary>\n    public static class Option\n    {\n        public static readonly Symbol Underlying = Symbols.SPY;\n        public static readonly DateTime ReferenceDate = new DateTime(2020, 10, 16);\n\n        public const decimal ContractMultiplier = 100m;\n        public static Factory Contract { get; } = new Factory();\n        public static FactoryRight Put { get; } = new FactoryRight(OptionRight.Put);\n        public static FactoryRight Call { get; } = new FactoryRight(OptionRight.Call);\n\n        public class Factory\n        {\n            public Symbol this[Symbol underlying, OptionRight right, decimal strike, DateTime expiration]\n                => Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, right, strike, expiration);\n\n            public Symbol this[OptionRight right, decimal strike, DateTime expiration]\n                => Symbol.CreateOption(Underlying, Market.USA, OptionStyle.American, right, strike, expiration);\n\n            public Symbol this[Symbol underlying, OptionRight right, decimal strike, int weeks = 0]\n                => Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, right, strike, ReferenceDate.AddDays(7 * weeks));\n\n            public Symbol this[OptionRight right, decimal strike, int weeks = 0]\n                => Symbol.CreateOption(Underlying, Market.USA, OptionStyle.American, right, strike, ReferenceDate.AddDays(7 * weeks));\n        }\n\n        public class FactoryRight\n        {\n            private readonly OptionRight right;\n\n            public FactoryRight(OptionRight right)\n            {\n                this.right = right;\n            }\n\n            public Symbol this[Symbol underlying, decimal strike, DateTime expiration]\n                => Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, right, strike, expiration);\n\n            public Symbol this[decimal strike, DateTime expiration]\n                => Symbol.CreateOption(Symbols.SPY, Market.USA, OptionStyle.American, right, strike, expiration);\n\n            public Symbol this[Symbol underlying, decimal strike, int weeks = 0]\n                => Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, right, strike, ReferenceDate.AddDays(7 * weeks));\n\n            public Symbol this[decimal strike, int weeks = 0]\n                => Symbol.CreateOption(Symbols.SPY, Market.USA, OptionStyle.American, right, strike, ReferenceDate.AddDays(7 * weeks));\n        }\n\n        public static Symbol WithStrike(this Symbol symbol, decimal strike)\n        {\n            return Symbol.CreateOption(symbol.Underlying, symbol.ID.Market, symbol.ID.OptionStyle, symbol.ID.OptionRight, strike, symbol.ID.Date);\n        }\n\n        public static Symbol WithExpiration(this Symbol symbol, DateTime expiration)\n        {\n            return Symbol.CreateOption(symbol.Underlying, symbol.ID.Market, symbol.ID.OptionStyle, symbol.ID.OptionRight, symbol.ID.StrikePrice, expiration);\n        }\n\n        public static Symbol WithRight(this Symbol symbol, OptionRight right)\n        {\n            return Symbol.CreateOption(symbol.Underlying, symbol.ID.Market, symbol.ID.OptionStyle, right, symbol.ID.StrikePrice, symbol.ID.Date);\n        }\n\n        public static Symbol WithUnderlying(this Symbol symbol, Symbol underlying)\n        {\n            return Symbol.CreateOption(underlying, symbol.ID.Market, symbol.ID.OptionStyle, symbol.ID.OptionRight, symbol.ID.StrikePrice, symbol.ID.Date);\n        }\n\n        public static OptionPosition Position(Symbol symbol, int quantity = +1)\n        {\n            return new OptionPosition(symbol, quantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionPositionCollectionTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Util;\nusing static QuantConnect.BinaryComparison;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionPositionCollectionTests\n    {\n        private const int UnderlyingLots = 10;\n        private const int ContractMultiplier = 100;\n        private static readonly DateTime Reference = new DateTime(2020, 10, 16);\n\n        private SecurityHolding[] _holdings;\n        private OptionPositionCollection _positions;\n\n        [SetUp]\n        public void Setup()\n        {\n            _holdings = new[]\n            {\n                CreateHolding(1),\n                CreateHolding(2),\n                CreateHolding(3),\n                CreateHolding(4),\n                CreateHolding(Symbols.SPY, ContractMultiplier * UnderlyingLots)\n            };\n\n            _positions = OptionPositionCollection.Create(Symbols.SPY, ContractMultiplier, _holdings);\n        }\n\n        [Test]\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(10)]\n        public void IsEmpty_ReturnsTrue_WhenCountIsZero(int count)\n        {\n            var positions = OptionPositionCollection.Empty;\n            for (int i = 0; i < count; i++)\n            {\n                var position = new OptionPosition(Call[100 + i], 1 + i);\n                positions = positions.Add(position);\n            }\n\n            Assert.AreEqual(count, positions.Count);\n            Assert.AreEqual(count == 0, positions.IsEmpty);\n        }\n\n        [Test]\n        public void Create_InitializesNewInstance_FromSecurityHoldings()\n        {\n            Assert.AreEqual(5, _positions.Count);\n            Assert.AreEqual(2, _positions.UniquePuts);\n            Assert.AreEqual(2, _positions.UniqueCalls);\n            Assert.AreEqual(3, _positions.UniqueExpirations);\n            Assert.AreEqual(UnderlyingLots, _positions.UnderlyingQuantity);\n        }\n\n        [Test]\n        public void Slice_FiltersByRight()\n        {\n            var puts = _positions.Slice(OptionRight.Put);\n            Assert.AreEqual(3, puts.Count);\n            Assert.AreEqual(0, puts.UniqueCalls);\n            Assert.AreEqual(2, puts.UniquePuts);\n            Assert.AreEqual(2, puts.UniqueExpirations);\n            Assert.AreEqual(UnderlyingLots, puts.UnderlyingQuantity);\n\n            var calls = _positions.Slice(OptionRight.Call);\n            Assert.AreEqual(3, calls.Count);\n            Assert.AreEqual(0, calls.UniquePuts);\n            Assert.AreEqual(2, calls.UniqueCalls);\n            Assert.AreEqual(2, calls.UniqueExpirations);\n            Assert.AreEqual(UnderlyingLots, puts.UnderlyingQuantity);\n        }\n\n        [Test]\n        public void Slice_FiltersByPositionSide()\n        {\n            var positions = OptionPositionCollection.Empty.AddRange(\n                new OptionPosition(Call[100], +1),\n                new OptionPosition(Call[105], -1),\n                new OptionPosition( Put[110], +1),\n                new OptionPosition( Put[115], -1)\n            );\n            var shorts = positions.Slice(PositionSide.Short);\n            var expected = positions.Where(p => p.Side == PositionSide.Short).ToHashSet();\n            foreach (var position in shorts)\n            {\n                Assert.IsTrue(expected.Remove(position));\n            }\n            Assert.IsEmpty(expected);\n\n            var longs = positions.Slice(PositionSide.Long);\n            expected = positions.Where(p => p.Side == PositionSide.Long).ToHashSet();\n            foreach (var position in longs)\n            {\n                Assert.IsTrue(expected.Remove(position));\n            }\n            Assert.IsEmpty(expected);\n        }\n\n        [Test]\n        [TestCase(ExpressionType.Equal, 2)]\n        [TestCase(ExpressionType.NotEqual, 2)]\n        [TestCase(ExpressionType.LessThan, 2)]\n        [TestCase(ExpressionType.LessThanOrEqual, 2)]\n        [TestCase(ExpressionType.GreaterThan, 2)]\n        [TestCase(ExpressionType.GreaterThanOrEqual, 2)]\n        public void Slice_FiltersByStrikePrice(ExpressionType type, decimal reference)\n        {\n            var comparison = FromExpressionType(type);\n            var actual = _positions.Slice(comparison, reference);\n            Assert.AreEqual(UnderlyingLots, actual.UnderlyingQuantity);\n\n            var strikes = _positions.Where(p => p.Symbol.HasUnderlying).ToList(p => p.Strike);\n            var expected = comparison.Filter(strikes, reference);\n\n            var positions = actual.ToList();\n            Assert.AreEqual(expected.Count + 1, positions.Count);\n            foreach (var strike in expected)\n            {\n                Assert.IsTrue(positions.Any(\n                    p => p.Symbol.HasUnderlying && p.Strike == strike\n                ));\n            }\n\n            actual = _positions.Slice(comparison, reference, false);\n            Assert.AreEqual(0, actual.UnderlyingQuantity);\n            Assert.AreEqual(expected.Count, actual.Count);\n        }\n\n        [Test]\n        [TestCase(ExpressionType.Equal, 2)]\n        [TestCase(ExpressionType.NotEqual, 2)]\n        [TestCase(ExpressionType.LessThan, 2)]\n        [TestCase(ExpressionType.LessThanOrEqual, 2)]\n        [TestCase(ExpressionType.GreaterThan, 2)]\n        [TestCase(ExpressionType.GreaterThanOrEqual, 2)]\n        public void Slice_FiltersByExpiration(ExpressionType type, int reference)\n        {\n            var expiration = Reference.AddDays((reference - 1) * 7);\n            var comparison = FromExpressionType(type);\n            var actual = _positions.Slice(comparison, expiration);\n            Assert.AreEqual(UnderlyingLots, actual.UnderlyingQuantity);\n\n            var expirations = _positions.Where(p => p.Symbol.HasUnderlying).ToList(p => p.Expiration);\n            var expected = comparison.Filter(expirations, expiration);\n\n            var positions = actual.ToList();\n            Assert.AreEqual(expected.Count + 1, positions.Count);\n            foreach (var exp in expected)\n            {\n                Assert.AreEqual(expected.Count(e => e == exp), positions.Count(\n                    p => p.Symbol.HasUnderlying && p.Expiration == exp)\n                );\n            }\n\n            actual = _positions.Slice(comparison, expiration, false);\n            Assert.AreEqual(0, actual.UnderlyingQuantity);\n            Assert.AreEqual(expected.Count, actual.Count);\n        }\n\n        private decimal _previousStrike;\n        private OptionRight _previousRight;\n\n        private static readonly CircularQueue<DateTime> Expirations = new CircularQueue<DateTime>(\n            Reference, Reference.AddDays(7), Reference.AddDays(14)\n        );\n\n        private SecurityHolding CreateHolding(int quantity)\n            => CreateHolding(Symbol.CreateOption(Symbols.SPY, Market.USA, OptionStyle.American, _previousRight.Invert(), _previousStrike + 1, Expirations.Dequeue()), quantity);\n\n        private SecurityHolding CreateHolding(Symbol symbol, int quantity)\n        {\n            if (symbol.SecurityType == SecurityType.Option)\n            {\n                _previousRight = symbol.ID.OptionRight;\n                _previousStrike = symbol.ID.StrikePrice;\n            }\n\n            var properties = SymbolProperties.GetDefault(\"USD\");\n            var cash = new Cash(\"USD\", 0m, 1m);\n            var security = new Security(symbol, null, cash, properties, null, null, new SecurityCache());\n            var holding = new SecurityHolding(security, new IdentityCurrencyConverter(\"USD\"));\n            holding.SetHoldings(2, quantity);\n            return holding;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionPositionTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionPositionTests\n    {\n        [Test]\n        [TestCase(OptionRight.Put)]\n        [TestCase(OptionRight.Call)]\n        public void Initializes_OptionRight(OptionRight right)\n        {\n            // grab a random symbol and make it the correct right\n            var symbol = Call[100].WithRight(right);\n            var position = new OptionPosition(symbol, 1);\n            Assert.AreEqual(right, position.Right);\n        }\n\n        [Test]\n        [TestCase(PositionSide.Long)]\n        [TestCase(PositionSide.None)]\n        [TestCase(PositionSide.Short)]\n        public void Initializes_OptionRight(PositionSide side)\n        {\n            // grab a random symbol and make it the correct right\n            var quantity = (int) side;\n            var position = new OptionPosition(Call[100], quantity);\n            Assert.AreEqual(side, position.Side);\n        }\n\n        [Test]\n        public void AdditionOperator_AddsQuantity_WhenSymbolsMatch()\n        {\n            var left = new OptionPosition(Symbols.SPY, 42);\n            var right = new OptionPosition(Symbols.SPY, 1);\n            var sum = left + right;\n            Assert.AreEqual(Symbols.SPY, sum.Symbol);\n            Assert.AreEqual(43, sum.Quantity);\n        }\n\n        [Test]\n        public void AdditionOperator_ThrowsInvalidOperationException_WhenSymbolsDoNotMatch()\n        {\n            OptionPosition sum;\n            var left = new OptionPosition(Symbols.SPY, 42);\n            var right = new OptionPosition(Symbols.SPY_P_192_Feb19_2016, 1);\n            Assert.Throws<InvalidOperationException>(\n                () => sum = left + right\n            );\n        }\n\n        [Test]\n        public void AdditionOperator_DoesNotThrow_WhenOneSideEqualsDefault()\n        {\n            var value = new OptionPosition(Symbols.SPY, 42);\n            var defaultValue = default(OptionPosition);\n            var valueFirst = value + defaultValue;\n            var defaultFirst = defaultValue + value;\n\n            Assert.AreEqual(value, valueFirst);\n            Assert.AreEqual(value, defaultFirst);\n        }\n\n        [Test]\n        public void SubtractionOperator_SubtractsQuantity_WhenSymbolsMatch()\n        {\n            var left = new OptionPosition(Symbols.SPY, 42);\n            var right = new OptionPosition(Symbols.SPY, 1);\n            var sum = left - right;\n            Assert.AreEqual(Symbols.SPY, sum.Symbol);\n            Assert.AreEqual(41, sum.Quantity);\n        }\n\n        [Test]\n        public void SubtractionOperator_ThrowsInvalidOperationException_WhenSymbolsDoNotMatch()\n        {\n            OptionPosition difference;\n            var left = new OptionPosition(Symbols.SPY, 42);\n            var right = new OptionPosition(Symbols.SPY_P_192_Feb19_2016, 1);\n            Assert.Throws<InvalidOperationException>(\n                () => difference = left - right\n            );\n        }\n\n        [Test]\n        public void SubtractionOperator_DoesNotThrow_WhenOneSideEqualsDefault()\n        {\n            var value = new OptionPosition(Symbols.SPY, 42);\n            var defaultValue = default(OptionPosition);\n            var valueFirst = value - defaultValue;\n            var defaultFirst = defaultValue - value;\n\n            Assert.AreEqual(value, valueFirst);\n            Assert.AreEqual(value.Negate(), defaultFirst);\n        }\n\n        [Test]\n        public void Negate_ReturnsOptionPosition_WithSameSymbolAndNegativeQuantity()\n        {\n            var position = new OptionPosition(Symbols.SPY, 42);\n            var negated = position.Negate();\n            Assert.AreEqual(position.Symbol, negated.Symbol);\n            Assert.AreEqual(-position.Quantity, negated.Quantity);\n        }\n\n        [Test]\n        public void MultiplyOperator_ScalesQuantity()\n        {\n            const int factor = 2;\n            var position = new OptionPosition(Symbols.SPY, 42);\n            var positionFirst = position * factor;\n            Assert.AreEqual(position.Symbol, positionFirst.Symbol);\n            Assert.AreEqual(factor * 42, positionFirst.Quantity);\n\n            var factorFirst = factor * position;\n            Assert.AreEqual(positionFirst, factorFirst);\n        }\n\n        [Test]\n        public void Equality_IsDefinedUsing_SymbolAndQuantity()\n        {\n            var left = new OptionPosition(Symbols.SPY, 42);\n            var right = new OptionPosition(Symbols.SPY, 42);\n            Assert.AreEqual(left, right);\n            Assert.IsTrue(left == right);\n\n            right = right.Negate();\n            Assert.AreNotEqual(left, right);\n            Assert.IsTrue(left != right);\n        }\n\n        [Test]\n        public void Empty_CreatesOptionPosition_WithZeroQuantity()\n        {\n            var none = OptionPosition.Empty(Symbols.SPY);\n            Assert.AreEqual(0, none.Quantity);\n            Assert.AreEqual(Symbols.SPY, none.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionStrategyDefinitionMatchTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionStrategyDefinitionMatchTests\n    {\n        [Test]\n        public void CreatesOptionStrategy_WithMinimumMultiplier_FromLegMatches()\n        {\n            // OptionStrategyDefinitions.BearCallSpread\n            // 0: -1 Call\n            // 1: +1 Call w/ Strike <= leg[0].Strike\n\n            // these positions support matching index0 3 times and index1 2 times and the multiplier\n            // for the definition match should be 2, despite leg0 having multiplier=3\n            var positions = OptionPositionCollection.Empty.AddRange(\n                new OptionPosition(Call[100], -3),\n                new OptionPosition(Call[110], +2)\n            );\n\n            var match = OptionStrategyDefinitions.BearCallSpread.Match(positions).Single();\n            Assert.AreEqual(3, match.Legs[0].Multiplier);\n            Assert.AreEqual(2, match.Legs[1].Multiplier);\n            Assert.AreEqual(2, match.Multiplier);\n\n            var strategy = match.CreateStrategy();\n            Assert.AreEqual(-2, strategy.OptionLegs[0].Quantity);\n            Assert.AreEqual(+2, strategy.OptionLegs[1].Quantity);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionStrategyDefinitionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing static QuantConnect.Securities.Option.StrategyMatcher.OptionPositionCollection;\nusing static QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyDefinitions;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionStrategyDefinitionTests\n    {\n        [Test]\n        [TestCaseSource(nameof(TestCases))]\n        public void Run(TestCase test)\n        {\n            var result = test.Definition.Match(test.Positions).ToList();\n            foreach (var match in result)\n            {\n                Log.Trace(string.Join(\";\", match.Legs.Select(leg => String(leg.Position))));\n            }\n\n            test.AssertMatch(result);\n        }\n\n        [Test]\n        public void CoveredCall_MatchesMultipleTimes_ForEachUniqueShortCallContract()\n        {\n            // CoveredCall\n            // 0: +1 underlying lot\n            // 1: -1 Call\n            // so we should match\n            // (4U, -4C100)\n            // (3U, -3C110)\n            // (5U, -5C120)\n            // (9U, -9C130)\n            // (20U, -20C140)\n            // OptionStrategyDefinition.Match produces ALL possible matches\n            var positions = Empty.AddRange(Position(Underlying, +20),\n                Position(Call[100], -4), Position(Put[105], -4),\n                Position(Call[105], +4), Position(Put[110], +4),\n                Position(Call[110], -3), Position(Put[115], -3),\n                Position(Call[115], +3), Position(Put[120], +3),\n                Position(Call[120], -5), Position(Put[125], -5),\n                Position(Call[125], +5), Position(Put[130], +5),\n                Position(Call[130], -9), Position(Put[135], -9),\n                Position(Call[140], -21), Position(Put[145], -21)\n            );\n\n            // force lower strikes to be evaluated first to provide determinism for this test\n            var options = OptionStrategyMatcherOptions.ForDefinitions(CoveredCall)\n                .WithPositionEnumerator(new FunctionalOptionPositionCollectionEnumerator(\n                    pos => pos.OrderBy(p => p.IsUnderlying ? 0 : p.Strike)\n                ));\n\n            var matches = CoveredCall.Match(options, positions).ToList();\n            Assert.AreEqual(5, matches.Count);\n            Assert.AreEqual(1, matches.Count(m => m.Multiplier == 4));\n            Assert.AreEqual(1, matches.Count(m => m.Multiplier == 3));\n            Assert.AreEqual(1, matches.Count(m => m.Multiplier == 5));\n            Assert.AreEqual(1, matches.Count(m => m.Multiplier == 9));\n            Assert.AreEqual(1, matches.Count(m => m.Multiplier == 20));\n        }\n\n        [Test]\n        public void DoubleCountPositionsMatchingSamePositionMultipleTimesInDifferentMatches()\n        {\n            // this test aims to verify that we can match the same definition multiple times if positions allows\n            // 1: -C110 +C105\n            // 0: -C110 +C100\n            // 2: -C115 +C105\n            // 3: -C115 +C100\n            var positions = Empty.AddRange(\n                Position(Call[100], -1),\n                Position(Call[105], -1),\n                Position(Call[110]),\n                Position(Call[115])\n            );\n\n            var matches = BearCallSpread.Match(positions).ToList();\n            Assert.AreEqual(4, matches.Count);\n            Assert.AreEqual(1, matches.Count(m => m.Legs[1].Position.Strike == 110 && m.Legs[0].Position.Strike == 105));\n            Assert.AreEqual(1, matches.Count(m => m.Legs[1].Position.Strike == 110 && m.Legs[0].Position.Strike == 100));\n            Assert.AreEqual(1, matches.Count(m => m.Legs[1].Position.Strike == 115 && m.Legs[0].Position.Strike == 105));\n            Assert.AreEqual(1, matches.Count(m => m.Legs[1].Position.Strike == 115 && m.Legs[0].Position.Strike == 100));\n        }\n\n        [Test]\n        public void ResultingPositionsAreCorrectNoUnderlying()\n        {\n            var positions = Empty.AddRange(\n                Position(Call[100], 10),\n                Position(Call[110], -20),\n                Position(Call[120], 10)\n            );\n\n            var matches = ButterflyCall.Match(positions).ToList();\n            Assert.AreEqual(1, matches.Count);\n            Assert.AreEqual(3, matches[0].Legs.Count);\n            Assert.AreEqual(1, matches[0].Legs.Count(m => m.Position.Strike == 100 && m.Position.Quantity == 10));\n            Assert.AreEqual(1, matches[0].Legs.Count(m => m.Position.Strike == 110 && m.Position.Quantity == -20));\n            Assert.AreEqual(1, matches[0].Legs.Count(m => m.Position.Strike == 120 && m.Position.Quantity == 10));\n\n            // Now let add some extra option contracts which shouldn't match since they aren't enough\n            positions = positions.Add(Position(Call[100], 5));\n            positions = positions.Add(Position(Call[110], -5));\n\n            matches = ButterflyCall.Match(positions).ToList();\n\n            Assert.AreEqual(1, matches.Count);\n            Assert.AreEqual(3, matches[0].Legs.Count);\n\n            // assert the strategy size respects the matching multiplier\n            var strategy = matches[0].CreateStrategy();\n            Assert.AreEqual(1, strategy.OptionLegs.Count(m => m.Strike == 100 && m.Quantity == 10));\n            Assert.AreEqual(1, strategy.OptionLegs.Count(m => m.Strike == 110 && m.Quantity == -20));\n            Assert.AreEqual(1, strategy.OptionLegs.Count(m => m.Strike == 120 && m.Quantity == 10));\n\n            // assert the remaining positions are the expected ones\n            positions = matches[0].RemoveFrom(positions);\n            Assert.AreEqual(2, positions.Count);\n            Assert.AreEqual(1, positions.Count(m => m.Strike == 100 && m.Quantity == 5));\n            Assert.AreEqual(1, positions.Count(m => m.Strike == 110 && m.Quantity == -5));\n        }\n\n        [Test]\n        public void ResultingPositionsAreCorrectWithUnderlying()\n        {\n            var positions = Empty.AddRange(\n                Position(Call[100], -5),\n                // should match 4 covered calls\n                new OptionPosition(Underlying, 4)\n            );\n\n            var matches = CoveredCall.Match(positions).ToList();\n            Assert.AreEqual(1, matches.Count);\n            // underlying isn't included yet\n            Assert.AreEqual(1, matches[0].Legs.Count);\n            Assert.AreEqual(1, matches[0].Legs.Count(m => m.Position.Strike == 100 && m.Position.Quantity == -5));\n\n            var strategy = matches[0].CreateStrategy();\n            Assert.AreEqual(1, strategy.OptionLegs.Count);\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count);\n            Assert.AreEqual(1, strategy.OptionLegs.Count(m => m.Strike == 100 && m.Quantity == -4));\n            Assert.AreEqual(1, strategy.UnderlyingLegs.Count(m => m.Quantity == 4));\n\n            // assert the remaining positions are the expected ones\n            positions = matches[0].RemoveFrom(positions);\n            Assert.AreEqual(1, positions.Count);\n            Assert.AreEqual(1, positions.Count(m => !m.IsUnderlying && m.Strike == 100 && m.Quantity == -1));\n        }\n\n        private static string String(OptionPosition position)\n        {\n            var sign = position.Quantity > 0 ? \"+\" : \"\";\n\n            var s = position.Symbol;\n            var symbol = s.HasUnderlying\n                ? $\"{s.Underlying.Value}:{s.ID.OptionRight}@{s.ID.StrikePrice}:{s.ID.Date:MM-dd}\"\n                : s.Value;\n\n            return $\"{sign}{position.Quantity} {symbol}\";\n        }\n\n        public static TestCaseData[] TestCases\n        {\n            get\n            {\n                return new[]\n                {\n                    TestCase.ExactPosition(CoveredCall, Position(Call[100], -1), new OptionPosition(Underlying, +100) ),\n                    TestCase.ExactPosition(CoveredPut, Position(Put[100], -1), new OptionPosition(Underlying, -100) ),\n\n                    TestCase.ExactPosition(BearCallSpread, Position(Call[110], +1), Position(Call[100], -1)),\n                    TestCase.ExactPosition(BearCallSpread, Position(Call[100], -1), Position(Call[110], +1)),\n                    TestCase.ExactPosition(BearPutSpread,  Position( Put[110], +1), Position( Put[100], -1)),\n                    TestCase.ExactPosition(BearPutSpread,  Position( Put[100], -1), Position( Put[110], +1)),\n                    TestCase.ExactPosition(BullCallSpread, Position(Call[110], -1), Position(Call[100], +1)),\n                    TestCase.ExactPosition(BullCallSpread, Position(Call[100], +1), Position(Call[110], -1)),\n                    TestCase.ExactPosition(BullPutSpread,  Position( Put[110], -1), Position( Put[100], +1)),\n                    TestCase.ExactPosition(BullPutSpread,  Position( Put[100], +1), Position( Put[110], -1)),\n                    TestCase.ExactPosition(Straddle,       Position(Call[100], +1), Position( Put[100], +1)),\n                    TestCase.ExactPosition(Straddle,       Position( Put[100], +1), Position(Call[100], +1)),\n                    TestCase.ExactPosition(ButterflyCall,  Position(Call[100], +1), Position(Call[105], -2), Position(Call[110], +1)),\n                    TestCase.ExactPosition(ButterflyCall,  Position(Call[105], -2), Position(Call[100], +1), Position(Call[110], +1)),\n                    TestCase.ExactPosition(ButterflyCall,  Position(Call[110], +1), Position(Call[105], -2), Position(Call[100], +1)),\n                    TestCase.ExactPosition(ShortButterflyCall,  Position(Call[110], -1), Position(Call[105], +2), Position(Call[100], -1)),\n                    TestCase.ExactPosition(ButterflyPut,   Position( Put[100], +1), Position( Put[105], -2), Position( Put[110], +1)),\n                    TestCase.ExactPosition(ButterflyPut,   Position( Put[105], -2), Position( Put[100], +1), Position( Put[110], +1)),\n                    TestCase.ExactPosition(ButterflyPut,   Position( Put[110], +1), Position( Put[105], -2), Position( Put[100], +1)),\n                    TestCase.ExactPosition(ShortButterflyPut,   Position( Put[110], -1), Position( Put[105], +2), Position( Put[100], -1)),\n\n                    TestCase.ExactPosition(CallCalendarSpread, Position(Call[100, 1], +1), Position(Call[100, 0], -1)),\n                    TestCase.ExactPosition(CallCalendarSpread, Position(Call[100, 0], -1), Position(Call[100, 1], +1)),\n                    TestCase.ExactPosition(PutCalendarSpread,  Position( Put[100, 1], +1), Position( Put[100, 0], -1)),\n                    TestCase.ExactPosition(PutCalendarSpread,  Position( Put[100, 0], -1), Position( Put[100, 1], +1)),\n\n                    TestCase.ExactPosition(IronCondor,  Position( Put[100, 0], +1), Position(Put[105, 0], -1), Position(Call[110, 0], -1), Position(Call[120, 0], +1))\n\n                }.Select(x => new TestCaseData(x).SetName(x.Name)).ToArray();\n            }\n        }\n\n        // aim for perfect match, extra quantity in position, extra symbol position, no match/missing leg\n        public class TestCase\n        {\n            public string Name { get; }\n            public OptionStrategyDefinition Definition { get; }\n            public OptionPositionCollection Positions { get; }\n            public IReadOnlyList<OptionPosition> Extra { get; }\n            public IReadOnlyList<OptionPosition> Missing { get; }\n            public IReadOnlyDictionary<string, int> ExpectedMatches { get; }\n            public OptionStrategyMatcher CreateMatcher()\n                => new OptionStrategyMatcher(new OptionStrategyMatcherOptions(\n                    new[] {Definition}, new List<int> {100, 100, 100, 100}\n                ));\n\n            private readonly string _methodName;\n\n            private TestCase(\n                string methodName,\n                OptionStrategyDefinition definition,\n                IReadOnlyList<OptionPosition> positions,\n                IReadOnlyList<OptionPosition> extra,\n                IReadOnlyList<OptionPosition> missing\n                )\n            {\n                _methodName = methodName;\n\n                Extra = extra;\n                Missing = missing;\n                Definition = definition;\n                Positions = FromPositions(positions);\n                var suffix = positions.Select(p =>\n                {\n                    var quantity = p.Quantity.ToString(CultureInfo.InvariantCulture);\n                    if (p.Quantity > 0)\n                    {\n                        quantity = $\"+{quantity}\";\n                    }\n\n                    if (p.IsUnderlying)\n                    {\n                        return $\"{quantity}{p.Symbol.Value}\";\n                    }\n\n                    return $\"{quantity}{p.Right.ToString()[0]}@{p.Strike}\";\n                });\n                Name = $\"{definition.Name}:{methodName}({string.Join(\", \", suffix)})\";\n\n                //int count;\n                //if (NameCounts.TryGetValue(Name, out count))\n                //{\n                //    // test runner doesn't like duplicate names -- ensure uniqueness by counting instances of names\n                //    count++;\n                //}\n\n                //NameCounts[Name] = count;\n                //Name = $\"{Name} ({count})\";\n                ExpectedMatches = new Dictionary<string, int>\n                {\n                    {nameof(ExactPosition),   1},\n                    {nameof(ExtraQuantity),   1},\n                    {nameof(ExtraPosition),   1},\n                    {nameof(MissingPosition), 0}\n                };\n            }\n\n            public void AssertMatch(List<OptionStrategyDefinitionMatch> matches)\n            {\n                switch (_methodName)\n                {\n                    case nameof(ExactPosition):\n                        Assert.AreEqual(ExpectedMatches[_methodName], matches.Count);\n                        Assert.AreEqual(Definition, matches[0].Definition);\n                        break;\n\n                    case nameof(ExtraQuantity):\n                        Assert.AreEqual(ExpectedMatches[_methodName], matches.Count);\n                        Assert.AreEqual(Definition, matches[0].Definition);\n                        break;\n\n                    case nameof(ExtraPosition):\n                        Assert.AreEqual(ExpectedMatches[_methodName], matches.Count);\n                        Assert.AreEqual(Definition, matches[0].Definition);\n                        break;\n\n                    case nameof(MissingPosition):\n                        Assert.AreEqual(0, matches.Count);\n                        break;\n\n                    default:\n                        Assert.Fail(\"Failed to perform assertion.\");\n                        break;\n                }\n            }\n\n            public override string ToString()\n            {\n                return Name;\n            }\n\n            public static TestCase ExactPosition(OptionStrategyDefinition definition, params OptionPosition[] positions)\n            {\n                return new TestCase(nameof(ExactPosition), definition, positions, Array.Empty<OptionPosition>(), Array.Empty<OptionPosition>());\n            }\n\n            public static TestCase ExtraQuantity(OptionStrategyDefinition definition, params OptionPosition[] positions)\n            {\n                // add 1 to the first position\n                var extra = positions[0].WithQuantity(1);\n                var pos = positions.Select((p, i) => i == 0 ? p + extra : p).ToList();\n                return new TestCase(nameof(ExtraQuantity), definition, pos, new[] {extra}, Array.Empty<OptionPosition>());\n            }\n\n            public static TestCase ExtraPosition(OptionStrategyDefinition definition, params OptionPosition[] positions)\n            {\n                // add a random position w/ the same underlying\n                var maxStrike = positions.Where(p => p.Symbol.HasUnderlying).Max(p => p.Strike);\n                var extra = new OptionPosition(positions[0].Symbol.WithStrike(maxStrike + 5m), 1);\n                var pos = positions.Concat(new[] {extra}).ToList();\n                return new TestCase(nameof(ExtraPosition), definition, pos, new[] {extra}, Array.Empty<OptionPosition>());\n            }\n\n            public static TestCase MissingPosition(OptionStrategyDefinition definition, OptionPosition missing, params OptionPosition[] positions)\n            {\n                return new TestCase(nameof(MissingPosition), definition, positions, Array.Empty<OptionPosition>(), new []{missing});\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionStrategyLegDefinitionMatchTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Option.StrategyMatcher;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionStrategyLegDefinitionMatchTests\n    {\n        [Test]\n        public void CreatesOptionOptionStrategyLegData()\n        {\n            var match = new OptionStrategyLegDefinitionMatch(3, Option.Position(Option.Call[100], 3));\n            var leg = match.CreateOptionStrategyLeg(3);\n            Assert.IsInstanceOf<OptionStrategy.OptionLegData>(leg);\n            Assert.AreEqual(3, leg.Quantity);\n            Assert.IsNull(leg.OrderPrice);\n        }\n\n        [Test]\n        public void CreatesUnderlyingOptionStrategyLegData()\n        {\n            var match = new OptionStrategyLegDefinitionMatch(3, Option.Position(Option.Underlying, 3));\n            var leg = match.CreateOptionStrategyLeg(3);\n            Assert.IsInstanceOf<OptionStrategy.UnderlyingLegData>(leg);\n            Assert.AreEqual(3, leg.Quantity);\n            Assert.IsNull(leg.OrderPrice);\n        }\n\n        [Test]\n        public void CreateOptionStrategyLeg_RespectsProvidedMultiplier()\n        {\n            // multiplier of 2 w/ position quantity of 4 means leg definition quantity is +2\n            // so we request a multiplier of 1 and except +2 leg quantity\n            var match = new OptionStrategyLegDefinitionMatch(2, Option.Position(Option.Underlying, 4));\n            var leg = match.CreateOptionStrategyLeg(1);\n            Assert.IsInstanceOf<OptionStrategy.UnderlyingLegData>(leg);\n            Assert.AreEqual(2, leg.Quantity);\n            Assert.IsNull(leg.OrderPrice);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionStrategyLegPredicateTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionStrategyLegPredicateTests\n    {\n        public const decimal DefaultLegStrike = 100m;\n        public const decimal DefaultPositionStrike = 95m;\n\n        private static readonly OptionPositionCollection Positions\n            = OptionPositionCollection.Create(Symbols.SPY, ContractMultiplier, Enumerable.Empty<SecurityHolding>())\n                .Add(new OptionPosition(Symbols.SPY, 1000))\n                .Add(new OptionPosition(Put[95m], 1))\n                .Add(new OptionPosition(Put[95m, 1], 1))\n                .Add(new OptionPosition(Put[95m, 2], 1))\n                .Add(new OptionPosition(Call[95m], 1))\n                .Add(new OptionPosition(Call[95m, 1], 1))\n                .Add(new OptionPosition(Call[95m, 2], 1))\n                .Add(new OptionPosition(Put[100m], 1))\n                .Add(new OptionPosition(Put[100m, 1], 1))\n                .Add(new OptionPosition(Put[100m, 2], 1))\n                .Add(new OptionPosition(Call[100m], 1))\n                .Add(new OptionPosition(Call[100m, 1], 1))\n                .Add(new OptionPosition(Call[100m, 2], 1))\n                .Add(new OptionPosition(Put[105m], 1))\n                .Add(new OptionPosition(Put[105m, 1], 1))\n                .Add(new OptionPosition(Put[105m, 2], 1))\n                .Add(new OptionPosition(Call[105m], 1))\n                .Add(new OptionPosition(Call[105m, 1], 1))\n                .Add(new OptionPosition(Call[105m, 2], 1));\n\n        [Test]\n        public void CreatesStrikePredicate()\n        {\n            var predicate = OptionStrategyLegPredicate.Create(\n                (legs, p) => p.Strike < legs[0].Strike\n            );\n\n            var position = new OptionPosition(Put[95m], 1);\n            var positiveSet = new List<OptionPosition> { new OptionPosition(Put[100m], 1) };\n            Assert.IsTrue(predicate.Matches(positiveSet, position));\n\n            var negativeSet = new List<OptionPosition> { new OptionPosition(Put[90m], 1) };\n            Assert.IsFalse(predicate.Matches(negativeSet, position));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(TestCases))]\n        public void CreatesAndEvaluatesPredicateAccordingToProvidedExpression(TestCase testCase)\n        {\n            // creates expected reference value provider w/ correct target\n            var referenceValue = testCase.CreateReferenceValue();\n            Assert.AreEqual(testCase.Target, referenceValue.Target);\n\n            // reference value provider resolves expected reference value\n            var expectedReferenceValue = testCase.ReferenceValueProvider(testCase.Legs);\n            var actualReferenceValue = referenceValue.Resolve(testCase.Legs);\n            Assert.AreEqual(expectedReferenceValue, actualReferenceValue);\n\n            // creates predicate and matches as expected\n            var predicate = testCase.CreatePredicate();\n            var testCaseMatch = predicate.Matches(testCase.Legs, testCase.Position);\n            Assert.AreEqual(testCase.Match, testCaseMatch,\n                $\"Predicate: {predicate}{Environment.NewLine}\" +\n                $\"Position: {testCase.Position}{Environment.NewLine}\" +\n                $\"Legs: {string.Join(Environment.NewLine, testCase.Legs)}\"\n            );\n\n            // filters positions collection as expected\n            var filtered = predicate.Filter(testCase.Legs, Positions, false);\n\n            // verify items NOT in the filtered set fail the predicate\n            // verify items IN the filtered set pass the predicate\n            foreach (var position in Positions)\n            {\n                // if it's in the filtered set then it better match the predicate, and vice-versa\n                Assert.AreEqual(\n                    filtered.HasPosition(position.Symbol),\n                    predicate.Matches(testCase.Legs, position)\n                );\n            }\n        }\n\n        [Test]\n        public void CreatesOptionRightPredicate()\n        {\n            var definition = OptionStrategyDefinition.Create(\"CallsOnly\", OptionStrategyDefinition.CallLeg(1));\n            var onlyLeg = definition.Legs.Single();\n            // put/call isn't phrased as a predicate since every one has it, also due to complexities w/ enums in expressions\n            Assert.IsEmpty(onlyLeg);\n            var filtered = onlyLeg.Filter(Array.Empty<OptionPosition>(), Positions, false);\n            Assert.IsTrue(filtered.All(p => p.Right == OptionRight.Call));\n        }\n\n        public static IEnumerable<TestCase> TestCases\n        {\n            get\n            {\n                // many of these cases are logically the same, just with the binary comparison operator flipped\n                // this is done to verify that the underlying infrastructure is agnostic to where the positions/legs\n                // parameter expressions appear in the comparison expression.\n                return new[]\n                    {\n                        new TestCase((legs, position) => position.Strike < legs[0].Strike)\n                            .WithTarget(PredicateTargetValue.Strike, legs => legs[0].Strike)\n                            .ExpectMatch(),\n\n                        new TestCase((legs, position) => position.Strike > legs[0].Strike)\n                            .WithTarget(PredicateTargetValue.Strike, legs => legs[0].Strike)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => legs[0].Strike > position.Strike)\n                            .WithTarget(PredicateTargetValue.Strike, legs => legs[0].Strike)\n                            .ExpectMatch(),\n\n                        new TestCase((legs, position) => legs[0].Strike < position.Strike)\n                            .WithTarget(PredicateTargetValue.Strike, legs => legs[0].Strike)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => position.Expiration < legs[0].Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => position.Expiration > legs[0].Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => legs[0].Expiration > position.Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => legs[0].Expiration < position.Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectNoMatch(),\n\n                        new TestCase((legs, position) => position.Expiration == legs[0].Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectMatch(),\n\n                        new TestCase((legs, position) => position.Expiration == legs[0].Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectMatch(),\n\n                        new TestCase((legs, position) => legs[0].Expiration == position.Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectMatch(),\n\n                        new TestCase((legs, position) => legs[0].Expiration == position.Expiration)\n                            .WithTarget(PredicateTargetValue.Expiration, legs => legs[0].Expiration)\n                            .ExpectMatch(),\n                    }\n                    .Select(x => x.WithDefaults());\n            }\n        }\n\n\n        public class TestCase\n        {\n            public bool Match { get; private set; }\n            public string Name { get; private set; }\n            public List<OptionPosition> Legs { get; }\n            public OptionPosition Position { get; private set; }\n            public PredicateTargetValue Target { get; private set; }\n            public Func<List<OptionPosition>, OptionPosition, bool> Predicate { get; }\n            public Func<List<OptionPosition>, object> ReferenceValueProvider { get; private set; }\n            public Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>> Expression { get; }\n            public ParameterExpression LegsExpression => Expression.Parameters[0];\n            public ParameterExpression PositionExpression => Expression.Parameters[1];\n            public Expression BinaryComparisonExpression => Expression.Body;\n\n            private readonly Lazy<OptionStrategyLegPredicate> _predicate;\n\n            public IOptionStrategyLegPredicateReferenceValue CreateReferenceValue()\n                => _predicate.Value.GetReferenceValue();\n\n            public OptionStrategyLegPredicate CreatePredicate()\n                => _predicate.Value;\n\n            public TestCase(Expression<Func<IReadOnlyList<OptionPosition>, OptionPosition, bool>> expression)\n            {\n                Expression = expression;\n                Name = expression.ToString();\n                Predicate = expression.Compile();\n                Legs = new List<OptionPosition>();\n                _predicate = new Lazy<OptionStrategyLegPredicate>(\n                    () => OptionStrategyLegPredicate.Create(Expression)\n                );\n            }\n\n            public TestCase WithTarget(\n                PredicateTargetValue target,\n                Func<List<OptionPosition>, object> referenceValueProvider\n                )\n            {\n                Target = target;\n                ReferenceValueProvider = referenceValueProvider;\n                return this;\n            }\n\n            public TestCase WithName(string name)\n            {\n                Name = name;\n                return this;\n            }\n\n            public TestCase AddLeg(Symbol symbol, int quantity)\n            {\n                Legs.Add(new OptionPosition(symbol, quantity));\n                return this;\n            }\n\n            public TestCase WithPosition(Symbol symbol, int quantity)\n            {\n                if (Position != default(OptionPosition))\n                {\n                    throw new InvalidOperationException($\"Position has already been initialized: {Position}\");\n                }\n\n                Position = new OptionPosition(symbol, quantity);\n                return this;\n            }\n\n            public TestCase ExpectMatch()\n            {\n                Match = true;\n                return this;\n            }\n\n            public TestCase ExpectNoMatch()\n            {\n                Match = false;\n                return this;\n            }\n\n            public TestCase WithDefaults()\n            {\n                if (Legs.Count == 0)\n                {\n                    AddLeg(Put[DefaultLegStrike], 1);\n                }\n\n                if (Position == default(OptionPosition))\n                {\n                    WithPosition(Put[DefaultPositionStrike], 1);\n                }\n\n                return this;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Options/StrategyMatcher/OptionStrategyMatcherTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing static QuantConnect.Tests.Common.Securities.Options.StrategyMatcher.Option;\nusing static QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyDefinitions;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Common.Securities.Options.StrategyMatcher\n{\n    [TestFixture]\n    public class OptionStrategyMatcherTests\n    {\n        [Test]\n        [TestCaseSource(typeof(OptionStrategyDefinitionTests), nameof(OptionStrategyDefinitionTests.TestCases))]\n        public void RunSingleDefinition(OptionStrategyDefinitionTests.TestCase test)\n        {\n            var matcher = test.CreateMatcher();\n            var match = matcher.MatchOnce(test.Positions);\n            Assert.AreEqual(1, match.Strategies.Count);\n        }\n\n        [Test]\n        public void DoesNotDoubleCountPositions()\n        {\n            // this test aims to verify that match solutions do not reference the same position in multiple matches\n            // this behavior is different than the OptionStrategyDefinition.Match, which by design produces all possible\n            // matches which permits the same position to appear in different matches, allowing the matcher to pick matches\n\n            // this test aims to verify that we can match the same definition multiple times if positions allows\n            // 0: -C110 +C105\n            // 1: -C115 +C100\n            var positions = OptionPositionCollection.Empty.AddRange(\n                Position(Call[100], -1),\n                Position(Call[105], -1),\n                Position(Call[110]),\n                Position(Call[115])\n            );\n\n            var matcher = new OptionStrategyMatcher(OptionStrategyMatcherOptions.ForDefinitions(BearCallSpread));\n            var matches = matcher.MatchOnce(positions);\n            Assert.AreEqual(2, matches.Strategies.Count);\n        }\n\n        [Test]\n        public void MatchesAgainstFullPositionCollection()\n        {\n            // sort definitions by leg count so that we match more complex definitions first\n            var options = OptionStrategyMatcherOptions.ForDefinitions(OptionStrategyDefinitions.AllDefinitions\n                .OrderByDescending(definition => definition.LegCount)\n            );\n            var matcher = new OptionStrategyMatcher(options);\n            var positions = OptionPositionCollection.Empty.AddRange(Option.Position(Option.Underlying, +20),\n                Option.Position(Option.Call[100, -4]), Option.Position(Option.Put[105, -4]),\n                Option.Position(Option.Call[105, +4]), Option.Position(Option.Put[110, +4]),\n                Option.Position(Option.Call[110, -3]), Option.Position(Option.Put[115, -3]),\n                Option.Position(Option.Call[115, +3]), Option.Position(Option.Put[120, +3]),\n                Option.Position(Option.Call[120, -5]), Option.Position(Option.Put[125, -5]),\n                Option.Position(Option.Call[124, +5]), Option.Position(Option.Put[130, +5])\n            );\n\n            var match = matcher.MatchOnce(positions);\n            foreach (var strategy in match.Strategies)\n            {\n                Log.Trace($\"{strategy.Name}\");\n                foreach (var leg in strategy.OptionLegs)\n                {\n                    // steal OptionPosition's ToString() implementation\n                    Console.Write($\"\\t{new OptionPosition(leg.Symbol, leg.Quantity)}\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/PatternDayTradingMarginBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class PatternDayTradingMarginBuyingPowerModelTests\n    {\n        private static readonly DateTime Noon = new DateTime(2016, 02, 16, 12, 0, 0);\n        private static readonly DateTime Midnight = new DateTime(2016, 02, 16, 0, 0, 0);\n        private static readonly DateTime NoonWeekend = new DateTime(2016, 02, 14, 12, 0, 0);\n        private static readonly DateTime NoonHoliday = new DateTime(2016, 02, 15, 12, 0, 0);\n        private static readonly TimeKeeper TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork);\n\n        private BuyingPowerModelComparator GetModel(decimal closed = 2m, decimal open = 4m)\n        {\n            return new BuyingPowerModelComparator(\n                new PatternDayTradingMarginModel(closed, open),\n                new SecurityPositionGroupBuyingPowerModel(),\n                timeKeeper: TimeKeeper\n            );\n        }\n\n        [Test]\n        public void InitializationTests()\n        {\n            // No parameters initialization, used default PDT 4x leverage open market and 2x leverage otherwise\n            var model = GetModel();\n            var leverage = model.GetLeverage(CreateSecurity(model.SecurityModel, Noon));\n\n            Assert.AreEqual(4.0m, leverage);\n\n            model = GetModel(2m, 5m);\n            leverage = model.GetLeverage(CreateSecurity(model.SecurityModel, Noon));\n\n            Assert.AreEqual(5.0m, leverage);\n        }\n\n        [Test]\n        public void SetLeverageTest()\n        {\n            var model = GetModel();\n\n            // Open market\n            var security = CreateSecurity(model.SecurityModel, Noon);\n\n            security.BuyingPowerModel = GetModel();\n\n            model.SetLeverage(security, 10m);\n            Assert.AreNotEqual(10m, model.GetLeverage(security));\n\n            // Closed market\n            security = CreateSecurity(model.SecurityModel, Midnight);\n\n            model.SetLeverage(security, 10m);\n            Assert.AreNotEqual(10m, model.GetLeverage(security));\n\n            security.Holdings.SetHoldings(100m, 100);\n        }\n\n        [Test]\n        public void VerifyOpenMarketLeverage()\n        {\n            // Market is Open on Tuesday, Feb, 16th 2016 at Noon\n            // SPY @ $100 * 100 Shares / Leverage (4) = 2500\n            var leverage = 4m;\n            var expected = 100 * 100m / leverage;\n\n            var model = GetModel();\n            var security = CreateSecurity(model.SecurityModel, Noon);\n            var order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n        }\n\n        [Test]\n        public void VerifyOpenMarketLeverageAltVersion()\n        {\n            // Market is Open on Tuesday, Feb, 16th 2016 at Noon\n            // SPY @ $100 * 100 Shares / Leverage (5) = 2000\n            var leverage = 5m;\n            var expected = 100 * 100m / leverage;\n\n            var model = GetModel(2m, leverage);\n            var security = CreateSecurity(model.SecurityModel, Noon);\n            var order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n        }\n\n        [Test]\n        public void VerifyClosedMarketLeverage()\n        {\n            // SPY @ $100 * 100 Shares / Leverage (2) = 5000\n            var leverage = 2m;\n            var expected = 100 * 100m / leverage;\n\n            var model = GetModel();\n\n            // Market is Closed on Tuesday, Feb, 16th 2016 at Midnight\n            var security = CreateSecurity(model.SecurityModel, Midnight);\n            var order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n\n            // Market is Closed on Monday, Feb, 15th 2016 at Noon (US President Day)\n            security = CreateSecurity(model.SecurityModel, NoonHoliday);\n            order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n\n            // Market is Closed on Sunday, Feb, 14th 2016 at Noon\n            security = CreateSecurity(model.SecurityModel, NoonWeekend);\n            order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n        }\n\n        [Test]\n        public void VerifyClosedMarketLeverageAltVersion()\n        {\n            // SPY @ $100 * 100 Shares / Leverage (3) = 3333.33\n            var leverage = 3m;\n            var expected = 100 * 100m / leverage;\n\n            var model = GetModel(leverage, 4m);\n\n            // Market is Closed on Tuesday, Feb, 16th 2016 at Midnight\n            var security = CreateSecurity(model.SecurityModel, Midnight);\n            var order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n\n            // Market is Closed on Monday, Feb, 15th 2016 at Noon (US President Day)\n            security = CreateSecurity(model.SecurityModel, NoonHoliday);\n            order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n\n            // Market is Closed on Sunday, Feb, 14th 2016 at Noon\n            security = CreateSecurity(model.SecurityModel, NoonWeekend);\n            order = new MarketOrder(security.Symbol, 100, security.LocalTime);\n\n            Assert.AreEqual((double)leverage, (double)model.GetLeverage(security), 1e-3);\n            Assert.AreEqual((double)expected, (double)model.GetInitialMarginRequiredForOrder(\n                new InitialMarginRequiredForOrderParameters(new IdentityCurrencyConverter(Currencies.USD), security, order)).Value, 1e-3);\n        }\n\n        [Test]\n        public void VerifyClosingSoonMarketLeverage()\n        {\n            var closedLeverage = 2m;\n            var openLeverage = 5m;\n\n            var model = GetModel(closedLeverage, openLeverage);\n\n            // Market is Closed on Tuesday, Feb, 16th 2016 at 16\n            var security = CreateSecurity(model.SecurityModel, new DateTime(2016, 2, 16, 15, 49, 0));\n            Assert.AreEqual(openLeverage, model.GetLeverage(security));\n            Assert.IsFalse(security.Exchange.ClosingSoon);\n\n            var localTimeKeeper = TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            localTimeKeeper.UpdateTime(new DateTime(2016, 2, 16, 15, 50, 0).ConvertToUtc(TimeZones.NewYork));\n            Assert.AreEqual(closedLeverage, model.GetLeverage(security));\n            Assert.IsTrue(security.Exchange.ClosingSoon);\n            Assert.IsTrue(security.Exchange.ExchangeOpen);\n\n            localTimeKeeper.UpdateTime(new DateTime(2016, 2, 16, 16, 0, 0).ConvertToUtc(TimeZones.NewYork));\n            Assert.IsFalse(security.Exchange.ExchangeOpen);\n        }\n\n        [Test]\n        public void VerifyMaintenaceMargin()\n        {\n            var model = GetModel();\n\n            // Open Market\n            var security = CreateSecurity(model.SecurityModel, Noon);\n            security.Holdings.SetHoldings(100m, 100);\n\n            Assert.AreEqual((double)100 * 100 / 4, (double)model.GetMaintenanceMargin(security), 1e-3);\n\n            // Closed Market\n            security = CreateSecurity(model.SecurityModel, Midnight);\n            security.Holdings.SetHoldings(100m, 100);\n\n            Assert.AreEqual((double)100 * 100 / 2, (double)model.GetMaintenanceMargin(security), 1e-3);\n        }\n\n        [Test]\n        public void VerifyMarginCallOrderLongOpenMarket()\n        {\n            var securityPrice = 100m;\n            var quantity = 300;\n\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, quantity, Noon);\n            var model = GetModel();\n\n            // Open Market\n            var security = CreateSecurity(model.SecurityModel, Noon);\n            security.BuyingPowerModel = model;\n            security.Holdings.SetHoldings(securityPrice, quantity);\n            portfolio.Securities.Add(security);\n            portfolio.CashBook[\"USD\"].AddAmount(-25000);\n            portfolio.InvalidateTotalPortfolioValue();\n            var netLiquidationValue = portfolio.TotalPortfolioValue;\n            var totalMargin = portfolio.TotalMarginUsed;\n            portfolio.MarginCallModel = new TestDefaultMarginCallModel(portfolio, new OrderProperties());\n\n            var expected = -(int)(Math.Round((totalMargin - netLiquidationValue) / securityPrice, MidpointRounding.AwayFromZero) * 4m);\n            var actual = (portfolio.MarginCallModel as TestDefaultMarginCallModel).GenerateMarginCallOrders(\n                new MarginCallOrdersParameters(portfolio.Positions.Groups.Single(), netLiquidationValue, totalMargin)).Single().Quantity;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VerifyMarginCallOrderLongClosedMarket()\n        {\n            var securityPrice = 100m;\n            var quantity = 300;\n\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, quantity, Midnight);\n            var model = GetModel();\n\n            // Open Market\n            var security = CreateSecurity(model.SecurityModel, Midnight);\n            security.BuyingPowerModel = model;\n            security.Holdings.SetHoldings(securityPrice, quantity);\n            portfolio.Securities.Add(security);\n            portfolio.CashBook[\"USD\"].AddAmount(-25000);\n            portfolio.InvalidateTotalPortfolioValue();\n            var netLiquidationValue = portfolio.TotalPortfolioValue;\n            var totalMargin = portfolio.TotalMarginUsed;\n            portfolio.MarginCallModel = new TestDefaultMarginCallModel(portfolio, new OrderProperties());\n\n            var expected = -(int)(Math.Round((totalMargin - netLiquidationValue) / securityPrice, MidpointRounding.AwayFromZero) * 2m);\n            var actual = (portfolio.MarginCallModel as TestDefaultMarginCallModel).GenerateMarginCallOrders(\n                new MarginCallOrdersParameters(portfolio.Positions.Groups.Single(), netLiquidationValue, totalMargin)).Single().Quantity;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VerifyMarginCallOrderShortOpenMarket()\n        {\n            var securityPrice = 100m;\n            var quantity = -300;\n\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, quantity, Noon);\n            var model = GetModel();\n\n            // Open Market\n            var security = CreateSecurity(model.SecurityModel, Noon);\n            security.BuyingPowerModel = model;\n            security.Holdings.SetHoldings(securityPrice, quantity);\n            portfolio.Securities.Add(security);\n            portfolio.CashBook[\"USD\"].AddAmount(35000);\n            portfolio.InvalidateTotalPortfolioValue();\n            var netLiquidationValue = portfolio.TotalPortfolioValue;\n            var totalMargin = portfolio.TotalMarginUsed;\n\n            var expected = (int)(Math.Round((totalMargin - netLiquidationValue) / securityPrice, MidpointRounding.AwayFromZero) * 4m);\n            var actual = (portfolio.MarginCallModel as TestDefaultMarginCallModel).GenerateMarginCallOrders(\n                new MarginCallOrdersParameters(portfolio.Positions.Groups.Single(), netLiquidationValue, totalMargin)).Single().Quantity;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void VerifyMarginCallOrderShortClosedMarket()\n        {\n            var securityPrice = 100m;\n            var quantity = -300;\n\n            var orderProcessor = new FakeOrderProcessor();\n            var portfolio = GetPortfolio(orderProcessor, quantity, Midnight);\n            var model = GetModel();\n\n            // Open Market\n            var security = CreateSecurity(model.SecurityModel, Midnight);\n            security.BuyingPowerModel = model;\n            security.Holdings.SetHoldings(securityPrice, quantity);\n            portfolio.Securities.Add(security);\n            portfolio.CashBook[\"USD\"].AddAmount(35000);\n            portfolio.InvalidateTotalPortfolioValue();\n            var netLiquidationValue = portfolio.TotalPortfolioValue;\n            var totalMargin = portfolio.TotalMarginUsed;\n\n            var expected = (int)(Math.Round((totalMargin - netLiquidationValue) / securityPrice, MidpointRounding.AwayFromZero) * 2m);\n            var actual = (portfolio.MarginCallModel as TestDefaultMarginCallModel).GenerateMarginCallOrders(\n                new MarginCallOrdersParameters(portfolio.Positions.Groups.Single(), netLiquidationValue, totalMargin)).Single().Quantity;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        private SecurityPortfolioManager GetPortfolio(IOrderProcessor orderProcessor, int quantity, DateTime time)\n        {\n            var securities = new SecurityManager(new TimeKeeper(time.ConvertToUtc(TimeZones.NewYork), TimeZones.NewYork));\n            var transactions = new SecurityTransactionManager(null, securities);\n            transactions.SetOrderProcessor(orderProcessor);\n\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(quantity);\n            portfolio.MarginCallModel = new TestDefaultMarginCallModel(portfolio, new OrderProperties());\n\n            return portfolio;\n        }\n\n        private static Security CreateSecurity(IBuyingPowerModel buyingPowerModel, DateTime newLocalTime)\n        {\n            var security = new Security(\n                CreateUsEquitySecurityExchangeHours(),\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            TimeKeeper.SetUtcDateTime(newLocalTime.ConvertToUtc(security.Exchange.TimeZone));\n            security.BuyingPowerModel = buyingPowerModel;\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetMarketPrice(new IndicatorDataPoint(Symbols.SPY, newLocalTime, 100m));\n            security.FeeModel = new ConstantFeeModel(0);\n            return security;\n        }\n\n        private static SecurityExchangeHours CreateUsEquitySecurityExchangeHours()\n        {\n            var sunday = LocalMarketHours.ClosedAllDay(DayOfWeek.Sunday);\n            var monday = new LocalMarketHours(DayOfWeek.Monday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var tuesday = new LocalMarketHours(DayOfWeek.Tuesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var wednesday = new LocalMarketHours(DayOfWeek.Wednesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var thursday = new LocalMarketHours(DayOfWeek.Thursday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var friday = new LocalMarketHours(DayOfWeek.Friday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan>();\n            var lateOpens = new Dictionary<DateTime, TimeSpan>();\n            var holidays = MarketHoursDatabase.FromDataFolder()\n                        .GetEntry(Market.USA, (string)null, SecurityType.Equity)\n                        .ExchangeHours\n                        .Holidays;\n            return new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n        }\n\n        private static SubscriptionDataConfig CreateTradeBarConfig()\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork,\n                TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Positions/PositionGroupCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Positions;\n\nnamespace QuantConnect.Tests.Common.Securities.Positions\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class PositionGroupCollectionTests\n    {\n        [Test]\n        public void CombineWith()\n        {\n            var collection = PositionGroupCollection.Empty;\n            var positions = new IPosition[] { new Position(Symbols.SPY, 10, 1) };\n            var group = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions), positions[0].Quantity, positions);\n            var result = collection.CombineWith(new PositionGroupCollection(new []{ group }));\n\n            Assert.AreEqual(1, result.Count);\n            Assert.IsTrue(result.IsOnlyDefaultGroups);\n            Assert.IsTrue(result.Contains(group.Key));\n\n            IReadOnlyCollection<IPositionGroup> resultingGroups;\n            Assert.IsTrue(result.TryGetGroups(Symbols.SPY, out resultingGroups));\n            Assert.AreEqual(1, resultingGroups.Count);\n            Assert.AreEqual(10, resultingGroups.Single().Positions.Single().Quantity);\n        }\n\n        [Test]\n        public void CombineWith_Empty()\n        {\n            var collection = PositionGroupCollection.Empty;\n            var newCollection = collection.CombineWith(PositionGroupCollection.Empty);\n\n            Assert.AreEqual(0, newCollection.Count);\n        }\n\n        [Test]\n        public void AddTwice()\n        {\n            var collection = PositionGroupCollection.Empty;\n\n            var positions = new IPosition[] {new Position(Symbols.SPY, 10, 1)};\n            var group = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions), positions[0].Quantity, positions);\n            var newCollection = collection.Add(group);\n            var result = newCollection.Add(group);\n\n            Assert.AreEqual(1, result.Count);\n            Assert.IsTrue(result.IsOnlyDefaultGroups);\n            Assert.IsTrue(result.Contains(group.Key));\n\n            IReadOnlyCollection<IPositionGroup> resultingGroups;\n            Assert.IsTrue(result.TryGetGroups(Symbols.SPY, out resultingGroups));\n            Assert.AreEqual(1, resultingGroups.Count);\n            Assert.AreEqual(10, resultingGroups.Single().Positions.Single().Quantity);\n        }\n\n        [Test]\n        public void AddDifferentQuantity()\n        {\n            var collection = PositionGroupCollection.Empty;\n\n            var positions = new IPosition[] { new Position(Symbols.SPY, 10, 1) };\n            var group = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions), positions[0].Quantity, positions);\n            var newCollection = collection.Add(group);\n\n            var positions2 = new IPosition[] { new Position(Symbols.SPY, 20, 1) };\n            var group2 = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions2), positions2[0].Quantity, positions2);\n            var result = newCollection.Add(group2);\n\n            Assert.AreEqual(1, result.Count);\n            Assert.IsTrue(result.IsOnlyDefaultGroups);\n            Assert.IsTrue(result.Contains(group.Key));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/Positions/PositionGroupTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities.Positions\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class PositionGroupTests\n    {\n        [TestCase(new[] { 10, 55 }, new[] { 1, 5 })]\n        [TestCase(new[] { 10, -20, 4 }, new[] { 1, 2, 1 })]\n        [TestCase(new[] { 10, -20, 4 }, new[] { 1, 2, 4 })]\n#if !DEBUG\n        [Ignore(\"Not on debug mode\")]\n#endif\n        public void PositionGroupCreationThrowsOnInvalidRatio(int[] positionsQuantities, int[] positionsUnitQuantities)\n        {\n            var symbols = GetSymbols(positionsQuantities.Length);\n\n            Assert.Throws<ArgumentException>(\n                () => new PositionGroup(\n                    new OptionStrategyPositionGroupBuyingPowerModel(null),\n                    positionsQuantities.GreatestCommonDivisor(),\n                    positionsUnitQuantities\n                        .Select((positionUnitQuantity, i) => new Position(symbols[i], positionsQuantities[i], positionUnitQuantity))\n                        .ToArray()));\n        }\n\n        [TestCase(10, new[] { 1, 5 }, new[] { 10 * 1, 10 * 5 }, new[] { 1, 5 })]\n        [TestCase(-10, new[] { 1, 5 }, new[] { -10 * 1, -10 * 5 }, new[] { 1, 5 })]\n        [TestCase(10, new[] { -1, 5 }, new[] { 10 * -1, 10 * 5 }, new[] { 1, 5 })]\n        [TestCase(-10, new[] { -1, 5 }, new[] { -10 * -1, -10 * 5 }, new[] { 1, 5 })]\n        public void PositionGroupCreation(int groupQuantity, int[] positionsUnitQuantities, int[] expectedPositionsQuantities,\n            int[] expectedPositionsUnitQuantities)\n        {\n            var symbols = GetSymbols(positionsUnitQuantities.Length);\n            var group = CreatePositionGroup(groupQuantity, symbols, positionsUnitQuantities);\n            var expectedPositions = symbols\n                .Select((symbol, i) => new Position(symbol, expectedPositionsQuantities[i], expectedPositionsUnitQuantities[i]))\n                .Cast<IPosition>()\n                .ToList();\n\n            AssertPositionGroup(group, groupQuantity, expectedPositions);\n        }\n\n        [TestCase(10, new[] { 1, 5 }, 5, new[] { 1, 5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, 0, new[] { 1, 5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, -5, new[] { 1, 5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, 15, new[] { 1, 5 }, false)]\n        [TestCase(-10, new[] { 1, 5 }, -5, new[] { 1, 5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, 0, new[] { 1, 5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, 5, new[] { 1, 5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, -15, new[] { 1, 5 }, false)]\n        [TestCase(10, new[] { 1, 5 }, -5, new[] { -1, -5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, 0, new[] { -1, -5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, 5, new[] { -1, -5 }, true)]\n        [TestCase(10, new[] { 1, 5 }, -15, new[] { -1, -5 }, false)]\n        [TestCase(-10, new[] { 1, 5 }, 5, new[] { -1, -5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, 0, new[] { -1, -5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, -5, new[] { -1, -5 }, true)]\n        [TestCase(-10, new[] { 1, 5 }, 15, new[] { -1, -5 }, false)]\n        [TestCase(10, new[] { 1, 5 }, 5, new[] { -1, 5 }, false)]\n        [TestCase(10, new[] { 1, 5 }, -5, new[] { -1, 5 }, false)]\n        [TestCase(10, new[] { 1, 5 }, 15, new[] { -1, 5 }, false)]\n        [TestCase(-10, new[] { 1, 5 }, 5, new[] { -1, 5 }, false)]\n        [TestCase(-10, new[] { 1, 5 }, -5, new[] { -1, 5 }, false)]\n        [TestCase(-10, new[] { 1, 5 }, 15, new[] { -1, 5 }, false)]\n        [TestCase(10, new[] { -1, 5 }, 5, new[] { -1, 5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, 0, new[] { -1, 5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, -5, new[] { -1, 5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, 15, new[] { -1, 5 }, false)]\n        [TestCase(-10, new[] { -1, 5 }, -5, new[] { -1, 5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, 0, new[] { -1, 5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, 5, new[] { -1, 5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, -15, new[] { -1, 5 }, false)]\n        [TestCase(10, new[] { -1, 5 }, -5, new[] { 1, -5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, 0, new[] { 1, -5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, 5, new[] { 1, -5 }, true)]\n        [TestCase(10, new[] { -1, 5 }, -15, new[] { 1, -5 }, false)]\n        [TestCase(-10, new[] { -1, 5 }, 5, new[] { 1, -5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, 0, new[] { 1, -5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, -5, new[] { 1, -5 }, true)]\n        [TestCase(-10, new[] { -1, 5 }, 15, new[] { 1, -5 }, false)]\n        public void PositionGroupClosesAnother(int initialGroupQuantity, int[] initialGroupPositionsUnitQuantities,\n            int finalGroupQuantity, int[] finalGroupPositionsUnitQuantities, bool expectedResult)\n        {\n            Assert.AreEqual(initialGroupPositionsUnitQuantities.Length, finalGroupPositionsUnitQuantities.Length);\n\n            var symbols = GetSymbols(initialGroupPositionsUnitQuantities.Length);\n            var initialGroup = CreatePositionGroup(initialGroupQuantity, symbols, initialGroupPositionsUnitQuantities);\n            var finalGroup = CreatePositionGroup(finalGroupQuantity, symbols, finalGroupPositionsUnitQuantities);\n\n            Assert.AreEqual(expectedResult, finalGroup.Closes(initialGroup));\n        }\n\n        private static List<Symbol> GetSymbols(int count)\n        {\n            var baseExpiry = new DateTime(2023, 05, 19);\n            return Enumerable.Range(0, count).Select(i => Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, baseExpiry.AddMonths(i))).ToList();\n        }\n\n        private static IPositionGroup CreatePositionGroup(int quantity, List<Symbol> symbols, int[] positionsUnitQuantities)\n        {\n            Assert.IsNotEmpty(positionsUnitQuantities);\n            Assert.AreEqual(positionsUnitQuantities.Length, symbols.Count);\n\n            return new PositionGroup(\n                new OptionStrategyPositionGroupBuyingPowerModel(null),\n                quantity,\n                positionsUnitQuantities\n                    .Select((positionUnitQuantity, i) => new Position(symbols[i], quantity * positionUnitQuantity, Math.Abs(positionUnitQuantity)))\n                    .ToArray());\n        }\n\n        /// <summary>\n        /// Asserts that the specified group has the expected quantity and positions\n        /// </summary>\n        private static void AssertPositionGroup(IPositionGroup group, int expectedQuantity, List<IPosition> expectedPositions)\n        {\n            var expectedAbsQuantity = Math.Abs(expectedQuantity);\n            Assert.AreEqual(expectedAbsQuantity, Math.Abs(group.Quantity));\n            Assert.AreEqual(expectedPositions.Count, group.Count);\n\n            foreach (var expectedPosition in expectedPositions)\n            {\n                var position = group.GetPosition(expectedPosition.Symbol);\n                Assert.AreEqual(expectedPosition.Quantity, position.Quantity);\n                Assert.AreEqual(expectedPosition.UnitQuantity, position.UnitQuantity);\n\n                // The position group quantity should be a ratio shared by all positions\n                Assert.AreEqual(expectedAbsQuantity, Math.Abs(position.Quantity) / position.UnitQuantity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/PriceVariationModelsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities.Equity\n{\n    [TestFixture]\n    public class PriceVariationModelsTests\n    {\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, DataNormalizationMode.Adjusted)]\n        [TestCase(\"SPY\", SecurityType.Equity, Market.USA, DataNormalizationMode.SplitAdjusted)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, DataNormalizationMode.Adjusted)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM, DataNormalizationMode.SplitAdjusted)]\n        [TestCase(\"ZO\", SecurityType.Future, Market.CBOT, DataNormalizationMode.Adjusted)]\n        public void CheckSecurityMinimumPriceVariation(string ticker, SecurityType securityType, string market, DataNormalizationMode mode)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var security = GetSecurity(symbol, mode);\n            var expected = security.SymbolProperties.MinimumPriceVariation;\n            var adjutedEquity = mode == DataNormalizationMode.Adjusted && securityType == SecurityType.Equity;\n\n            security.SetMarketPrice(new IndicatorDataPoint(symbol, DateTime.Now, 10m));\n            var actual = security.PriceVariationModel.GetMinimumPriceVariation(\n                new GetMinimumPriceVariationParameters(security, security.Price));\n            Assert.AreEqual(adjutedEquity ? 0 : expected, actual);\n\n            security.SetMarketPrice(new IndicatorDataPoint(symbol, DateTime.Now, 1m));\n            actual = security.PriceVariationModel.GetMinimumPriceVariation(\n                new GetMinimumPriceVariationParameters(security, security.Price));\n            Assert.AreEqual(adjutedEquity ? 0 : expected, actual);\n\n            // Special case, if stock price less than $1, minimum price variation is $0.0001\n            if (securityType == SecurityType.Equity) expected = 0.0001m;\n\n            security.SetMarketPrice(new IndicatorDataPoint(symbol, DateTime.Now, .99m));\n            actual = security.PriceVariationModel.GetMinimumPriceVariation(\n                new GetMinimumPriceVariationParameters(security, security.Price));\n            Assert.AreEqual(adjutedEquity ? 0 : expected, actual);\n        }\n\n        [TestCase(\"ZO\", SecurityType.Future, Market.CBOT, DataNormalizationMode.Adjusted, new float[] { 3.7025f, 3.72f, 3.6875f, 3.6425f, 3.5225f, 3.5125f, 3.47f, 3.46f, 3.445f, 3.4625f, 3.435f, 3.3575f })]\n        public void CheckMinimumPriceVariationWithData(string ticker, SecurityType securityType, string market, DataNormalizationMode mode, float[] data)\n        {\n            var symbol = Symbol.Create(ticker, securityType, market);\n            var security = GetSecurity(symbol, mode);\n            var minimumPriceVariation = (float)security.SymbolProperties.MinimumPriceVariation;\n\n            var lastPrice = data[0];\n            for(var index = 1; index< data.Length; index++)\n            {\n                Assert.IsTrue(Math.Round(Math.Abs(data[index] - lastPrice) % minimumPriceVariation) == 0);\n                lastPrice = data[index];\n            }\n        }\n\n        [TestCase(0.9, 1.123456789, 0.01)]\n        [TestCase(0.9, 0.987654321, 0.0001)]\n        [TestCase(0.9, 0.999999999, 0.0001)]\n        [TestCase(0.9, 1, 0.01)]\n        [TestCase(0.9, 1.000000001, 0.01)]\n        [TestCase(1.1, 1.123456789, 0.01)]\n        [TestCase(1.1, 0.987654321, 0.0001)]\n        [TestCase(1.1, 0.999999999, 0.0001)]\n        [TestCase(1.1, 1, 0.01)]\n        [TestCase(1.1, 1.000000001, 0.01)]\n        public void MinimumPriceVariationChangesWithOrderPrice(decimal securityPrice, decimal orderPrice, decimal expected)\n        {\n            var symbol = Symbol.Create(\"YGTY\", SecurityType.Equity, Market.USA);\n            var security = GetSecurity(symbol, DataNormalizationMode.Raw);\n\n            security.SetMarketPrice(new Tick { Value = securityPrice });\n\n            var actual = security.PriceVariationModel.GetMinimumPriceVariation(\n                new GetMinimumPriceVariationParameters(security, orderPrice));\n            Assert.AreEqual(expected, actual);\n        }\n\n        private Security GetSecurity(Symbol symbol, DataNormalizationMode mode)\n        {\n            var symbolProperties = SymbolPropertiesDatabase.FromDataFolder()\n                .GetSymbolProperties(symbol.ID.Market, symbol, symbol.ID.SecurityType, Currencies.USD);\n\n            Security security;\n            if (symbol.ID.SecurityType == SecurityType.Equity)\n            {\n                security = new QuantConnect.Securities.Equity.Equity(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        true,\n                        true,\n                        false\n                    ),\n                    new Cash(Currencies.USD, 0, 1m),\n                    symbolProperties,\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                );\n            }\n            else\n            {\n                security = new QuantConnect.Securities.Forex.Forex(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new Cash(Currencies.EUR, 0, 1m),\n                    new SubscriptionDataConfig(\n                        typeof(TradeBar),\n                        symbol,\n                        Resolution.Minute,\n                        TimeZones.NewYork,\n                        TimeZones.NewYork,\n                        true,\n                        true,\n                        false\n                    ),\n                    symbolProperties,\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                );\n            }\n\n            var TimeKeeper = new TimeKeeper(DateTime.Now.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n            security.SetLocalTimeKeeper(TimeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n            security.SetDataNormalizationMode(mode);\n\n            return security;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/ProcessVolatilityHistoryRequirementsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Volatility;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    class ProcessVolatilityHistoryRequirementsTests\n    {\n        [Test]\n        public void Works()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.HistoryProvider = new TestHistoryProvider();\n            var security = algorithm.AddEquity(Symbols.SPY.Value);\n            var model = new TestVolatilityModel();\n            security.VolatilityModel = model;\n\n            AlgorithmManager.ProcessVolatilityHistoryRequirements(algorithm, false);\n\n            Assert.AreEqual(1, model.dataUpdate.Count);\n            Assert.AreEqual(Symbols.SPY, model.dataUpdate.First().Symbol);\n            Assert.AreEqual(4, model.dataUpdate.First().Price);\n        }\n    }\n\n    internal class TestVolatilityModel : BaseVolatilityModel\n    {\n        public List<BaseData> dataUpdate = new List<BaseData>();\n        public override decimal Volatility { get; }\n        public override void Update(Security security, BaseData data)\n        {\n            dataUpdate.Add(data);\n        }\n\n        public override IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime utcTime)\n        {\n            var configuration = SubscriptionDataConfigProvider.GetSubscriptionDataConfigs(security.Symbol).First();\n\n            return new[]\n            {\n                new HistoryRequest(\n                    utcTime,\n                    utcTime,\n                    typeof(TradeBar),\n                    configuration.Symbol,\n                    configuration.Resolution,\n                    security.Exchange.Hours,\n                    configuration.DataTimeZone,\n                    configuration.Resolution,\n                    configuration.ExtendedMarketHours,\n                    configuration.IsCustomData,\n                    configuration.DataNormalizationMode,\n                    LeanData.GetCommonTickTypeForCommonDataTypes(typeof(TradeBar), security.Type)\n                )\n            };\n        }\n    }\n\n    internal class TestHistoryProvider : HistoryProviderBase\n    {\n        public override int DataPointCount { get; }\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            var request = requests.First();\n            return new List<Slice>{ new Slice(DateTime.UtcNow,\n                new List<BaseData> {new TradeBar(DateTime.MinValue, request.Symbol, 1, 2, 3, 4, 5) }, DateTime.UtcNow)};\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/RelativeStandardDeviationVolatilityModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class RelativeStandardDeviationVolatilityModelTests\n    {\n        [Test]\n        public void UpdatesAfterCorrectPeriodElapses()\n        {\n            const int periods = 3;\n            var periodSpan = Time.OneMinute;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof (TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new RelativeStandardDeviationVolatilityModel(periodSpan, periods);\n            security.VolatilityModel = model;\n\n            var first = new IndicatorDataPoint(reference, 1);\n            security.SetMarketPrice(first);\n\n            Assert.AreEqual(0m, model.Volatility);\n\n            const decimal value = 0.471404520791032M; // std of 1,2 is ~0.707 over a mean of 1.5\n            var second = new IndicatorDataPoint(reference.AddMinutes(1), 2);\n            security.SetMarketPrice(second);\n            Assert.AreEqual(value, model.Volatility);\n\n            // update should not be applied since not enough time has passed\n            var third = new IndicatorDataPoint(reference.AddMinutes(1.01), 1000);\n            security.SetMarketPrice(third);\n            Assert.AreEqual(value, model.Volatility);\n\n            var fourth = new IndicatorDataPoint(reference.AddMinutes(2), 3m);\n            security.SetMarketPrice(fourth);\n            Assert.AreEqual(0.5m, model.Volatility);\n        }\n\n        [Test]\n        public void DoesntUpdateOnZeroPrice()\n        {\n            const int periods = 3;\n            var periodSpan = Time.OneMinute;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new RelativeStandardDeviationVolatilityModel(periodSpan, periods);\n            security.VolatilityModel = model;\n\n            var first = new IndicatorDataPoint(reference, 1);\n            security.SetMarketPrice(first);\n\n            Assert.AreEqual(0m, model.Volatility);\n\n            const decimal value = 0.471404520791032M; // std of 1,2 is ~0.707 over a mean of 1.5\n            var second = new IndicatorDataPoint(reference.AddMinutes(1), 2);\n            security.SetMarketPrice(second);\n            Assert.AreEqual(value, model.Volatility);\n\n            var third = new IndicatorDataPoint(reference.AddMinutes(2), 3m);\n            security.SetMarketPrice(third);\n            Assert.AreEqual(0.5m, model.Volatility);\n\n            // update should not be applied as price is 0\n            var forth = new IndicatorDataPoint(reference.AddMinutes(3), 0m);\n            security.SetMarketPrice(forth);\n            Assert.AreEqual(0.5m, model.Volatility);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorks()\n        {\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new RelativeStandardDeviationVolatilityModel(TimeSpan.FromDays(2), 4);\n            model.SetSubscriptionDataConfigProvider(new MockSubscriptionDataConfigProvider(config));\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(config.IsCustomData, result.IsCustomData);\n            Assert.AreEqual(config.FillDataForward, result.FillForwardResolution != null);\n            Assert.AreEqual(config.ExtendedMarketHours, result.IncludeExtendedMarketHours);\n            Assert.AreEqual(Resolution.Minute, result.Resolution);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorksForTwoDifferentSubscriptions()\n        {\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new RelativeStandardDeviationVolatilityModel(TimeSpan.FromDays(2), 4);\n            var mock = new MockSubscriptionDataConfigProvider(config);\n            mock.SubscriptionDataConfigs.Add(\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Second,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false,\n                    true));\n            model.SetSubscriptionDataConfigProvider(mock);\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(Resolution.Second, result.Resolution);\n            Assert.AreEqual(true, result.IsCustomData);\n            Assert.AreEqual(true, result.FillForwardResolution != null);\n            Assert.AreEqual(true, result.IncludeExtendedMarketHours);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityCacheProviderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityCacheProviderTests : ISecurityProvider\n    {\n        private SecurityCacheProvider _cacheProvider;\n        private Dictionary<Symbol, Security> _securities;\n        \n        [SetUp]\n        public void Setup()\n        {\n            _securities = new Dictionary<Symbol, Security>();\n            _cacheProvider = new SecurityCacheProvider(this);\n        }\n\n        [Test]\n        public void InitialStateCase()\n        {\n            var cache = _cacheProvider.GetSecurityCache(Symbols.SPY);\n            Assert.IsNotNull(cache);\n        }\n\n        [Test]\n        public void ExistingCustom()\n        {\n            // add custom data\n            var baseSymbol = Symbol.CreateBase(typeof(UnlinkedData), Symbols.SPY, Market.USA);\n            var baseCache = _cacheProvider.GetSecurityCache(baseSymbol);\n            var baseSecurity = new Security(\n                baseSymbol,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(\"USA\", 0m, 1m), \n                SymbolProperties.GetDefault(\"USA\"),\n                new IdentityCurrencyConverter(\"USA\"), \n                RegisteredSecurityDataTypesProvider.Null,\n                baseCache);\n            _securities.Add(baseSymbol, baseSecurity);\n            // add some data to its cache\n            var dataToStore = new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            };\n            baseCache.StoreData(dataToStore, typeof(TradeBar));\n\n            // add the underlying of the custom data\n            var underlyingCache = _cacheProvider.GetSecurityCache(Symbols.SPY);\n\n            IReadOnlyList<BaseData> data;\n            // we expect it to have the data for the custom data cache\n            Assert.IsTrue(underlyingCache.TryGetValue(typeof(TradeBar), out data));\n            Assert.AreEqual(dataToStore, data);\n\n            // we add some data to the custom cache\n            var newData = new List<UnlinkedData> {new UnlinkedData()};\n            baseCache.StoreData(newData, typeof(UnlinkedData));\n\n            // the data should also be in the underlying cache\n            Assert.AreEqual(newData, underlyingCache.GetAll<UnlinkedData>());\n        }\n\n        [Test]\n        public void ExistingUnderlying()\n        {\n            // add underlying\n            var underlyingCache = _cacheProvider.GetSecurityCache(Symbols.SPY);\n            var underlyingSecurity = new Security(\n                Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(\"USA\", 0m, 1m),\n                SymbolProperties.GetDefault(\"USA\"),\n                new IdentityCurrencyConverter(\"USA\"),\n                RegisteredSecurityDataTypesProvider.Null,\n                underlyingCache);\n            _securities.Add(Symbols.SPY, underlyingSecurity);\n\n            // add base using underlying\n            var baseSymbol = Symbol.CreateBase(typeof(UnlinkedData), Symbols.SPY, Market.USA);\n            var baseCache = _cacheProvider.GetSecurityCache(baseSymbol);\n\n            // we store data in the underlying cache and expect it to be available through the base cache too\n            var dataToStore = new List<TradeBar> {\n                new TradeBar(DateTime.UtcNow, Symbols.SPY, 10m, 20m, 5m, 15m, 10000)\n            };\n            underlyingCache.StoreData(dataToStore, typeof(TradeBar));\n\n            IReadOnlyList<BaseData> data;\n            Assert.IsTrue(baseCache.TryGetValue(typeof(TradeBar), out data));\n            Assert.AreEqual(dataToStore, data);\n\n            // we store data in the base cache and expect it to be available through the underlying cache too\n            var newData = new List<UnlinkedData> { new UnlinkedData() };\n            baseCache.StoreData(newData, typeof(UnlinkedData));\n\n            // the data should also be in the underlying cache\n            Assert.AreEqual(newData, underlyingCache.GetAll<UnlinkedData>());\n        }\n\n        public Security GetSecurity(Symbol symbol)\n        {\n            if (_securities.ContainsKey(symbol))\n            {\n                return _securities[symbol];\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityCacheTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class SecurityCacheTests\n    {\n        private static readonly DateTime ReferenceTime = new DateTime(2000, 01, 01);\n\n        private readonly Random _rng = new Random(Seed: 123);\n\n        [SetUp]\n        public void Setup()\n        {\n            FundamentalService.Initialize(TestGlobals.DataProvider, new NullFundamentalDataProvider(), false);\n        }\n\n        [TestCase(MarketDataType.TradeBar, 10, true)]\n        [TestCase(MarketDataType.TradeBar, 10, false)]\n        [TestCase(MarketDataType.QuoteBar, 10, true)]\n        [TestCase(MarketDataType.QuoteBar, 10, false)]\n        [TestCase(MarketDataType.Tick, 10, true)]\n        [TestCase(MarketDataType.Tick, 10, false)]\n        public void AlwaysReturnTheLastData(MarketDataType marketDataType, int quantity, bool sameTime)\n        {\n            // Arrange\n            var securityCache = new SecurityCache();\n            var quotes = GenerateData(marketDataType, quantity, sameTime);\n            // Act\n            foreach (var quoteBar in quotes)\n            {\n                quoteBar.Symbol = Symbols.SPY;\n                securityCache.AddData(quoteBar);\n            }\n\n            var lastData = securityCache.GetData();\n            if (marketDataType == MarketDataType.QuoteBar)\n            {\n                Assert.IsNull(lastData);\n            }\n            else\n            {\n                Assert.True(lastData.Equals(quotes.Last()));\n            }\n        }\n\n        [Test]\n        public void GivenSameTimeStampForTradeBarAndQuoteQuotebarPrioritizeQuoteBar()\n        {\n            // Arrange\n            var securityCache = new SecurityCache();\n            var time = DateTime.Now;\n            var quotes = GenerateData(MarketDataType.QuoteBar, 5, false, time);\n            var trades = GenerateData(MarketDataType.TradeBar, 5, false, time);\n            var data = quotes.Concat(trades);\n            data = data.OrderBy(d => d.EndTime);\n            // Act\n            foreach (var baseData in data)\n            {\n                securityCache.AddData(baseData);\n            }\n            // Assert\n            Assert.True(securityCache.GetData().Equals(quotes.Last()));\n            Assert.True(securityCache.GetData<TradeBar>().Equals(trades.Last()));\n        }\n\n        [Test]\n        public void UseLatestTradebarIfThereIsntAvailableQuotebar()\n        {\n            // Arrange\n            var securityCache = new SecurityCache();\n            var time = DateTime.Now;\n            var quotes = GenerateData(MarketDataType.QuoteBar, 5, false, time);\n            foreach (var baseData in quotes)\n            {\n                securityCache.AddData(baseData);\n            }\n            // Add one last tradebar with a later timestamp\n            var laterTrade = GenerateData(MarketDataType.TradeBar, 1, true, quotes.Last().Time.AddSeconds(1)).First();\n            // Act\n            securityCache.AddData(laterTrade);\n            // Assert\n            Assert.True(securityCache.GetData().Equals(laterTrade));\n            Assert.True(securityCache.GetData<QuoteBar>().Equals(quotes.Last()));\n        }\n\n        [Test]\n        public void AddData_SecurityCacheHasTradeAndQuoteTick()\n        {\n            // Arrange\n            var securityCache = new SecurityCache();\n            var time = DateTime.Now;\n\n            var quote = new Tick(time, Symbol.Empty, 100, 102) { TickType = TickType.Quote };\n            securityCache.AddData(quote);\n\n            var trade = new Tick(time, Symbol.Empty, 100, 100, 102) {TickType = TickType.Trade};\n            securityCache.AddData(trade);\n\n            var openInterest = new OpenInterest(time, Symbol.Empty, 1000);\n            securityCache.AddData(openInterest);\n\n            // Assert\n            Assert.True(securityCache.GetData().Equals(trade));\n            Assert.True(securityCache.GetData<Tick>().Equals(trade));\n\n            Assert.True(securityCache.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Quote).Equals(quote));\n            Assert.True(securityCache.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Trade).Equals(trade));\n        }\n\n        [Test]\n        public void StoreData_SecurityCacheHasTradeAndQuoteTick()\n        {\n            // Arrange\n            var securityCache = new SecurityCache();\n            var time = DateTime.Now;\n\n            var quote = new Tick(time, Symbol.Empty, 100, 102) { TickType = TickType.Quote };\n            securityCache.StoreData(new[] {quote}, typeof(Tick));\n\n            var trade = new Tick(time.AddMilliseconds(1), Symbol.Empty, 100, 100, 102) { TickType = TickType.Trade };\n            securityCache.StoreData(new[] { trade }, typeof(Tick));\n\n            // Adding OpenInterest as Tick or OpenInterest should not matter\n            var openInterest = new OpenInterest(time, Symbol.Empty, 1000);\n            securityCache.StoreData(new[] { openInterest }, typeof(Tick));           // Add as Tick\n            securityCache.StoreData(new[] { openInterest }, typeof(OpenInterest));   // Add as OI\n\n            // Assert\n            Assert.IsTrue(securityCache.HasData(typeof(Tick)));\n            Assert.True(securityCache.GetData<Tick>().Equals(trade));\n            Assert.True(securityCache.GetData<OpenInterest>().Equals(openInterest));\n\n            Assert.True(securityCache.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Quote).Equals(quote));\n            Assert.True(securityCache.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Trade).Equals(trade));\n        }\n\n        [Test]\n        public void StoreData_TargetToModify_SecurityCacheHasTradeAndQuoteTick()\n        {\n            // Arrange\n            var sourceToShare = new SecurityCache();\n            var time = DateTime.Now;\n\n            var quote = new Tick(time, Symbol.Empty, 100, 102) { TickType = TickType.Quote };\n            sourceToShare.StoreData(new[] { quote }, typeof(Tick));\n\n            var trade = new Tick(time, Symbol.Empty, 100, 100, 102) { TickType = TickType.Trade };\n            sourceToShare.StoreData(new[] { trade }, typeof(Tick));\n\n            // Adding OpenInterest as Tick or OpenInterest should not matter\n            var openInterest = new OpenInterest(time, Symbol.Empty, 1000);\n            sourceToShare.StoreData(new[] { openInterest }, typeof(Tick));           // Add as Tick\n            sourceToShare.StoreData(new[] { openInterest }, typeof(OpenInterest));   // Add as OI\n\n            var targetToModify = new SecurityCache();\n            SecurityCache.ShareTypeCacheInstance(sourceToShare, targetToModify);\n\n            // Assert\n            Assert.IsTrue(targetToModify.HasData(typeof(Tick)));\n            Assert.True(targetToModify.GetData<Tick>().Equals(trade));\n            Assert.True(targetToModify.GetData<OpenInterest>().Equals(openInterest));\n\n            Assert.True(targetToModify.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Quote).Equals(quote));\n            Assert.True(targetToModify.GetAll<Tick>().LastOrDefault(x => x.TickType == TickType.Trade).Equals(trade));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void ResetTests(SecurityCache cache, SecuritySeedData seedType)\n        {\n            switch (seedType)\n            {\n                case SecuritySeedData.None:\n                case SecuritySeedData.OpenInterest:\n                case SecuritySeedData.OpenInterestTick:\n                    break;\n                case SecuritySeedData.QuoteTick:\n                    Assert.IsNotNull(cache.GetData());\n                    Assert.Greater(cache.GetAll<Tick>().Count(x => x.TickType == TickType.Quote), 0);\n                    cache.Reset();\n                    Assert.IsFalse(cache.HasData(typeof(Tick)));\n                    Assert.AreEqual(cache.GetAll<Tick>().Count(x => x.TickType == TickType.Quote), 0);\n                    break;\n                case SecuritySeedData.TradeTick:\n                    Assert.IsNotNull(cache.GetData());\n                    Assert.Greater(cache.GetAll<Tick>().Count(x => x.TickType == TickType.Trade), 0);\n                    cache.Reset();\n                    Assert.IsFalse(cache.HasData(typeof(Tick)));\n                    Assert.AreEqual(cache.GetAll<Tick>().Count(x => x.TickType == TickType.Trade), 0);\n                    break;\n                case SecuritySeedData.Fundamentals:\n                    Assert.IsNotNull(cache.GetData());\n                    Assert.IsNotNull(cache.GetData<Fundamental>());\n                    cache.Reset();\n                    Assert.IsFalse(cache.HasData(typeof(Fundamental)));\n                    break;\n                default:\n                    Assert.IsNotNull(cache.GetData());\n                    cache.Reset();\n                    break;\n            }\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsOpenInterestValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            var map = new Dictionary<string, string> {{\"OpenInterest\", \"Value\"}};\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.OpenInterest, new OpenInterest\n            {\n                Value = 101,\n                EndTime = ReferenceTime\n            }, map);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsOpenInterestTickValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            var map = new Dictionary<string, string> { { \"OpenInterest\", \"Value\" } };\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.OpenInterestTick, new Tick\n            {\n                Value = 101,\n                TickType = TickType.OpenInterest,\n                EndTime = ReferenceTime\n            }, map);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsQuoteTickValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.QuoteTick, new Tick\n            {\n                AskPrice = 101,\n                AskSize = 102,\n                BidPrice = 103,\n                BidSize = 104,\n                TickType = TickType.Quote,\n                EndTime = ReferenceTime\n            });\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsTradeTickValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            var map = new Dictionary<string, string> {{\"Volume\", \"Quantity\"}};\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.TradeTick, new Tick\n            {\n                Value = 101,\n                Quantity = 102,\n                TickType = TickType.Trade,\n                EndTime = ReferenceTime\n            }, map);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsTradeBarValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.TradeBar, new TradeBar\n            {\n                Open = 101,\n                High = 102,\n                Low = 103,\n                Close = 104,\n                Volume = 105,\n                EndTime = ReferenceTime,\n                Symbol = Symbols.SPY\n            });\n        }\n\n        [Test]\n        public void AddDataEquity_OHLC_IgnoresQuoteBar()\n        {\n            var securityCache = new SecurityCache();\n            var quoteBar = new QuoteBar\n            {\n                Bid = new Bar(101, 102, 103, 104),\n                Ask = new Bar(105, 106, 107, 108),\n                LastAskSize = 109,\n                LastBidSize = 110,\n                EndTime = ReferenceTime,\n                Symbol = Symbols.SPY\n            };\n            securityCache.AddData(quoteBar);\n\n            var last = securityCache.GetData();\n            Assert.IsNull(last);\n\n            Assert.AreEqual(0, securityCache.High);\n            Assert.AreEqual(0, securityCache.Close);\n            Assert.AreEqual(0, securityCache.Low);\n            Assert.AreEqual(0, securityCache.Open);\n            Assert.AreEqual(0, securityCache.Volume);\n\n            var actualQuoteBar = securityCache.GetData<QuoteBar>();\n            Assert.IsNotNull(actualQuoteBar);\n            Assert.AreEqual(108, securityCache.AskPrice);\n            Assert.AreEqual(109, securityCache.AskSize);\n            Assert.AreEqual(104, securityCache.BidPrice);\n            Assert.AreEqual(110, securityCache.BidSize);\n\n            var tradeBar = new TradeBar\n            {\n                Open = 101,\n                High = 102,\n                Low = 103,\n                Close = 104,\n                Volume = 105,\n                EndTime = ReferenceTime,\n                Symbol = Symbols.SPY\n            };\n            securityCache.AddData(tradeBar);\n\n            last = securityCache.GetData();\n            Assert.IsNotNull(last);\n\n            var actualTradeBar = securityCache.GetData<TradeBar>();\n            Assert.IsNotNull(actualTradeBar);\n            Assert.AreEqual(102, securityCache.High);\n            Assert.AreEqual(104, securityCache.Close);\n            Assert.AreEqual(103, securityCache.Low);\n            Assert.AreEqual(101, securityCache.Open);\n            Assert.AreEqual(105, securityCache.Volume);\n\n            // quote bar data should still be the same\n            Assert.AreEqual(108, securityCache.AskPrice);\n            Assert.AreEqual(109, securityCache.AskSize);\n            Assert.AreEqual(104, securityCache.BidPrice);\n            Assert.AreEqual(110, securityCache.BidSize);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataWithSameEndTime_SetsQuoteBarValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            var map = new Dictionary<string, string>\n            {\n                {\"Price\", \"Close\"},\n                {\"BidPrice\", \"Bid.Close\"},\n                {\"BidSize\", \"LastBidSize\"},\n                {\"AskPrice\", \"Ask.Close\"},\n                {\"AskSize\", \"LastAskSize\"}\n            };\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.QuoteBar, new QuoteBar\n            {\n                Bid = new Bar(101, 102, 103, 104),\n                Ask = new Bar(105, 106, 107, 108),\n                LastAskSize = 109,\n                LastBidSize = 110,\n                EndTime = ReferenceTime\n            }, map);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(GetSecurityCacheInitialStates))]\n        public void AddDataFundamentals_DoesNotChangeCacheValues(SecurityCache cache, SecuritySeedData seedType)\n        {\n            var map = new Dictionary<string, string>();\n            AddDataAndAssertChanges(cache, seedType, SecuritySeedData.Fundamentals, new Fundamental(ReferenceTime, Symbols.AAPL)\n            {\n                Value = 111,\n                EndTime = ReferenceTime\n            }, map);\n        }\n\n        [Test]\n        public void TickTypeDependencyTests()\n        {\n            // Arrange\n            var time = DateTime.Now;\n            var price = 100m;\n            var bidPrice = 99m;\n            var askPrice = 101m;\n            var volume = 1m;\n\n            var tick = new Tick(time, Symbols.AAPL, price, bidPrice, askPrice) { Quantity = volume }; ;\n\n            var securityCache = new SecurityCache();\n            securityCache.AddData(tick);\n            Assert.AreEqual(securityCache.Price, price);\n            Assert.AreEqual(securityCache.BidPrice, bidPrice);\n            Assert.AreEqual(securityCache.AskPrice, askPrice);\n            Assert.AreEqual(securityCache.Volume, 0m);\n\n            tick.TickType = TickType.Trade;\n            securityCache = new SecurityCache();\n            securityCache.AddData(tick);\n            Assert.AreEqual(securityCache.Price, price);\n            Assert.AreEqual(securityCache.BidPrice, 0m);\n            Assert.AreEqual(securityCache.AskPrice, 0m);\n            Assert.AreEqual(securityCache.Volume, volume);\n        }\n\n        [Test]\n        public void GetAllData_ReturnsListOfData()\n        {\n            var cache = new SecurityCache();\n            cache.StoreData(new []\n            {\n                new CustomDataBitcoinAlgorithm.Bitcoin{Ask = 1m},\n                new CustomDataBitcoinAlgorithm.Bitcoin{Ask = 2m}\n            }, typeof(CustomDataBitcoinAlgorithm.Bitcoin));\n\n            var data = cache.GetAll<CustomDataBitcoinAlgorithm.Bitcoin>().ToList();\n            Assert.AreEqual(2, data.Count);\n            Assert.AreEqual(1m, data[0].Ask);\n            Assert.AreEqual(2m, data[1].Ask);\n        }\n\n        [Test]\n        public void GetAllData_ReturnsListOfDataOnTargetCache()\n        {\n            var cache = new SecurityCache();\n            cache.StoreData(new[]\n            {\n                new CustomDataBitcoinAlgorithm.Bitcoin{Ask = 1m},\n                new CustomDataBitcoinAlgorithm.Bitcoin{Ask = 2m}\n            }, typeof(CustomDataBitcoinAlgorithm.Bitcoin));\n\n            var targetToModify = new SecurityCache();\n            SecurityCache.ShareTypeCacheInstance(cache, targetToModify);\n\n            var data = targetToModify.GetAll<CustomDataBitcoinAlgorithm.Bitcoin>().ToList();\n            Assert.AreEqual(2, data.Count);\n            Assert.AreEqual(1m, data[0].Ask);\n            Assert.AreEqual(2m, data[1].Ask);\n        }\n\n        [Test]\n        public void SecurityCacheGetDataWorksCorrectly()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"TestSecurityCacheGetData\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\nclass MyCustomDataType(PythonData):\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, Resolution.MINUTE, config.TickType)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        data = line.split(',')\n        result = MyCustomDataType()\n\ndef get_security_cache_quote():\n    securityCache = SecurityCache()\n    quoteBar = QuoteBar()\n    securityCache.add_data(quoteBar)\n    return securityCache.get_data(QuoteBar)\n\ndef get_security_cache_trade():\n    securityCache = SecurityCache()\n    tradeBar = TradeBar()\n    securityCache.add_data(tradeBar)\n    return securityCache.get_data(TradeBar)\n\ndef get_security_cache_margin_interest_rate():\n    securityCache = SecurityCache()\n    marginInterestRate = MarginInterestRate()\n    securityCache.add_data(marginInterestRate)\n    return securityCache.get_data(MarginInterestRate)\n\ndef get_security_cache_custom_data_type():\n    securityCache = SecurityCache()\n    customData = PythonData(MyCustomDataType())\n    securityCache.add_data(customData)\n    return securityCache.get_data(MyCustomDataType)\n\");\n\n                // Test if the GetData method correctly handles QuoteBar type\n                var quoteType = testModule.GetAttr(\"get_security_cache_quote\").Invoke();\n                Assert.IsFalse(quoteType.IsNone());\n                Assert.DoesNotThrow(() => quoteType.As<QuoteBar>());\n\n                // Test if the GetData method correctly handles TradeBar type\n                var tradeType = testModule.GetAttr(\"get_security_cache_trade\").Invoke();\n                Assert.IsFalse(tradeType.IsNone());\n                Assert.DoesNotThrow(() => tradeType.As<TradeBar>());\n\n                // Test if the GetData method correctly handles MarginInterestRate type\n                var marginInterestType = testModule.GetAttr(\"get_security_cache_margin_interest_rate\").Invoke();\n                Assert.IsFalse(marginInterestType.IsNone());\n                Assert.DoesNotThrow(() => marginInterestType.As<MarginInterestRate>());\n\n                // Test if the GetData method correctly handles custom data type (PythonData)\n                var customDataType = testModule.GetAttr(\"get_security_cache_custom_data_type\").Invoke();\n                Assert.IsFalse(customDataType.IsNone());\n                Assert.DoesNotThrow(() => customDataType.As<PythonData>());\n            }\n        }\n\n        private void AddDataAndAssertChanges(SecurityCache cache, SecuritySeedData seedType, SecuritySeedData dataType, BaseData data, Dictionary<string, string> cacheToBaseDataPropertyMap = null)\n        {\n            var before = JObject.FromObject(cache);\n            var dataSnapshot = JObject.FromObject(data);\n\n            cache.AddData(data);\n            var after = JObject.FromObject(cache);\n\n            var updatedCacheProperties = GetPropertiesBy(dataType);\n            if (seedType == SecuritySeedData.QuoteBar && (dataType  == SecuritySeedData.QuoteBar || dataType == SecuritySeedData.TradeBar))\n            {\n                // these properties aren't updated when previous data is quote bar at same time as a new IBar\n                updatedCacheProperties = updatedCacheProperties.Where(p =>\n                    p != \"Open\" &&\n                    p != \"High\" &&\n                    p != \"Low\" &&\n                    p != \"Close\" &&\n                    p != \"Price\"\n                ).ToArray();\n            }\n\n            foreach (var property in before.Properties())\n            {\n                string dataPropertyName = null;\n                if (updatedCacheProperties.Contains(property.Name))\n                {\n                    if (cacheToBaseDataPropertyMap?.TryGetValue(property.Name, out dataPropertyName) == true)\n                    {\n                        // avoiding failures due to decimal <> long in JToken.DeepEquals\n                        var e = dataSnapshot.SelectToken(dataPropertyName).ToString();\n                        var a = after.SelectToken(property.Name).ToString();\n                        Assert.AreEqual(e, a, $\"{property.Name}: Expected {e}. Actual {a}\");\n                    }\n                    else\n                    {\n                        dataSnapshot.IsEqualTo(after, property.Name);\n                    }\n                }\n                else\n                {\n                    before.IsEqualTo(after, property.Name);\n                }\n            }\n        }\n\n        public enum SecuritySeedData\n        {\n            None,\n            TradeTick,\n            QuoteTick,\n            OpenInterestTick,\n            OpenInterest,\n            TradeBar,\n            QuoteBar,\n            Fundamentals\n        }\n\n        public string[] GetPropertiesBy(SecuritySeedData type)\n        {\n            switch (type)\n            {\n                case SecuritySeedData.None:\n                    return new string[0];\n\n                case SecuritySeedData.OpenInterest:\n                    return new[] { \"OpenInterest\" };\n\n                case SecuritySeedData.OpenInterestTick:\n                    return new[] { \"OpenInterest\" };\n\n                case SecuritySeedData.TradeTick:\n                    return new[] {\"Price\", \"Volume\"};\n\n                case SecuritySeedData.QuoteTick:\n                    return new[] {\"AskPrice\", \"AskSize\", \"BidPrice\", \"BidSize\"};\n\n                case SecuritySeedData.TradeBar:\n                    return new[] {\"Price\", \"Volume\", \"Open\", \"High\", \"Low\", \"Close\"};\n\n                case SecuritySeedData.QuoteBar:\n                    return new[] { \"Price\", \"Open\", \"High\", \"Low\", \"Close\", \"AskPrice\", \"AskSize\", \"BidPrice\", \"BidSize\" };\n\n                case SecuritySeedData.Fundamentals:\n                    // fundamentals data does not modify security cache properties\n                    return new string[0];\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(type), type, null);\n            }\n        }\n\n        private static TestCaseData[] GetSecurityCacheInitialStates()\n        {\n            var defaultInstance = new SecurityCache();\n\n            var tradeTick = new SecurityCache();\n            tradeTick.AddData(new Tick\n            {\n                Value = 5,\n                Quantity = 6,\n                EndTime = ReferenceTime,\n                TickType = TickType.Trade\n            });\n\n            var quoteTick = new SecurityCache();\n            quoteTick.AddData(new Tick\n            {\n                AskPrice = 1,\n                AskSize = 2,\n                BidPrice = 3,\n                BidSize = 4,\n                EndTime = ReferenceTime,\n                TickType = TickType.Quote\n            });\n\n            var openInterestTick = new SecurityCache();\n            openInterestTick.AddData(new Tick\n            {\n                Value = 24,\n                EndTime = ReferenceTime,\n                TickType = TickType.OpenInterest\n            });\n\n            var openInterest = new SecurityCache();\n            openInterest.AddData(new OpenInterest\n            {\n                Value = 23,\n                EndTime = ReferenceTime,\n            });\n\n            var tradeBar = new SecurityCache();\n            tradeBar.AddData(new TradeBar\n            {\n                Open = 7,\n                High = 8,\n                Low = 9,\n                Close = 10,\n                Volume = 11,\n                EndTime = ReferenceTime\n            });\n\n            var quoteBar = new SecurityCache();\n            quoteBar.AddData(new QuoteBar\n            {\n                Ask = new Bar(12, 13, 14, 15),\n                Bid = new Bar(16, 17, 18, 19),\n                LastAskSize = 20,\n                LastBidSize = 21,\n                Value = 22,\n                EndTime = ReferenceTime\n            });\n\n            var fundamentals = new SecurityCache();\n            fundamentals.AddData(new Fundamental(ReferenceTime, Symbols.AAPL)\n            {\n                Value = 23\n            });\n\n            return new[]\n            {\n                new TestCaseData(defaultInstance, SecuritySeedData.None).SetName(\"Default Instance\"),\n                new TestCaseData(tradeTick, SecuritySeedData.TradeTick).SetName(\"Seeded w/ Trade Tick\"),\n                new TestCaseData(quoteTick, SecuritySeedData.QuoteTick).SetName(\"Seeded w/ Quote Tick\"),\n                new TestCaseData(openInterestTick, SecuritySeedData.OpenInterestTick).SetName(\"Seeded w/ OpenInterest Tick\"),\n                new TestCaseData(openInterest, SecuritySeedData.OpenInterest).SetName(\"Seeded w/ OpenInterest\"),\n                new TestCaseData(tradeBar, SecuritySeedData.TradeBar).SetName(\"Seeded w/ TradeBar\"),\n                new TestCaseData(quoteBar, SecuritySeedData.QuoteBar).SetName(\"Seeded w/ QuoteBar\"),\n                new TestCaseData(fundamentals, SecuritySeedData.Fundamentals).SetName(\"Seeded w/ Fundamentals\")\n            };\n        }\n\n        private IReadOnlyCollection<BaseData> GenerateData(MarketDataType type, int quantity, bool sameTime, DateTime? firstTimeStamp = null)\n        {\n            var time = firstTimeStamp ?? DateTime.Now;\n            var outputTradeBars = new List<BaseData>();\n            for (var i = 0; i < quantity; i++)\n            {\n                var rnd = _rng.Next(minValue: 50, maxValue: 150);\n                var ask = new Bar { Close = 1m * rnd, High = 1.2m * rnd, Low = 0.9m * rnd, Open = 1.1m * rnd };\n                var bid = new Bar { Close = 0.9m * rnd, High = 1.1m * rnd, Low = 0.8m * rnd, Open = 1m * rnd };\n                BaseData data = new TradeBar();\n                switch (type)\n                {\n                    case MarketDataType.TradeBar:\n                        data = new TradeBar\n                        {\n                            Close = (ask.Close + bid.Close) / 2,\n                            Open = (ask.Open + bid.Open) / 2,\n                            High = (ask.High + bid.High) / 2,\n                            Low = (ask.Low + bid.Low) / 2,\n                            Volume = 1,\n                            DataType = type\n                        };\n                        break;\n                    case MarketDataType.Tick:\n                        data = new Tick\n                        {\n                            AskPrice = ask.Close,\n                            BidPrice = bid.Close,\n                            AskSize = 1,\n                            BidSize = 1\n                        };\n                        break;\n                    case MarketDataType.QuoteBar:\n                        data = new QuoteBar\n                        {\n                            Ask = ask,\n                            Bid = bid,\n                            LastAskSize = 1,\n                            LastBidSize = 1,\n                            DataType = type,\n                            Value = (ask.Close + bid.Close) / 2\n                        };\n                        break;\n                    case MarketDataType.Auxiliary:\n                    case MarketDataType.OptionChain:\n                    case MarketDataType.FuturesChain:\n                    case MarketDataType.Base:\n                        throw new NotImplementedException(\"Cases not tested yet\");\n                }\n                data.Time = time;\n                data.EndTime = time.AddSeconds(value: 1);\n                time = sameTime ? time : time.AddSeconds(value: 1);\n                outputTradeBars.Add(data);\n            }\n            return outputTradeBars;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityDatabaseKeyTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityDatabaseKeyTests\n    {\n        [Test]\n        public void ConstructorWithNoWildcards()\n        {\n            var key = new SecurityDatabaseKey(Market.USA, \"SPY\", SecurityType.Equity);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(Market.USA, key.Market);\n            Assert.AreEqual(\"SPY\", key.Symbol);\n        }\n\n        [Test]\n        public void ConstructorWithNullSymbolConvertsToWildcard()\n        {\n            var key = new SecurityDatabaseKey(Market.USA, null, SecurityType.Equity);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(Market.USA, key.Market);\n            Assert.AreEqual(\"[*]\", key.Symbol);\n        }\n\n        [Test]\n        public void ConstructorWithEmptySymbolConvertsToWildcard()\n        {\n            var key = new SecurityDatabaseKey(Market.USA, string.Empty, SecurityType.Equity);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(Market.USA, key.Market);\n            Assert.AreEqual(\"[*]\", key.Symbol);\n        }\n\n        [Test]\n        public void ConstructorWithNullMarketConvertsToWildcard()\n        {\n            var key = new SecurityDatabaseKey(null, \"SPY\", SecurityType.Equity);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(\"[*]\", key.Market);\n            Assert.AreEqual(\"SPY\", key.Symbol);\n        }\n\n        [Test]\n        public void ConstructorWithEmptyMarketConvertsToWildcard()\n        {\n            var key = new SecurityDatabaseKey(string.Empty, \"SPY\", SecurityType.Equity);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(\"[*]\", key.Market);\n            Assert.AreEqual(\"SPY\", key.Symbol);\n        }\n\n        [Test]\n        public void ParsesKeyProperly()\n        {\n            const string input = \"Equity-usa-SPY\";\n            var key = SecurityDatabaseKey.Parse(input);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(Market.USA, key.Market);\n            Assert.AreEqual(\"SPY\", key.Symbol);\n        }\n\n        [Test]\n        public void ParsesWildcardSymbol()\n        {\n            const string input = \"Equity-usa-[*]\";\n            var key = SecurityDatabaseKey.Parse(input);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(Market.USA, key.Market);\n            Assert.AreEqual(\"[*]\", key.Symbol);\n        }\n\n        [Test]\n        public void ParsesWildcardMarket()\n        {\n            const string input = \"Equity-[*]-SPY\";\n            var key = SecurityDatabaseKey.Parse(input);\n            Assert.AreEqual(SecurityType.Equity, key.SecurityType);\n            Assert.AreEqual(\"[*]\", key.Market);\n            Assert.AreEqual(\"SPY\", key.Symbol);\n        }\n\n        [Test]\n        public void EqualityMembersAreCaseInsensitive()\n        {\n            var key = new SecurityDatabaseKey(\"uSa\", \"SPY\", SecurityType.Equity);\n            var key2 = new SecurityDatabaseKey(\"UsA\", \"spy\", SecurityType.Equity);\n\n            Assert.AreEqual(key, key2);\n            Assert.AreEqual(key.GetHashCode(), key2.GetHashCode());\n        }\n\n        [Test]\n        public void ThrowsOnWildcardSecurityType()\n        {\n            const string input = \"[*]-usa-SPY\";\n            Assert.Throws<FormatException>(() =>\n            {\n                SecurityDatabaseKey.Parse(input);\n            }, \"as a SecurityType\");\n        }\n\n        [Test]\n        public void ThrowsOnInvalidFormat()\n        {\n            const string input = \"Equity-[*]\";\n            Assert.Throws<FormatException>(() =>\n            {\n                SecurityDatabaseKey.Parse(input);\n            }, \"expected format\");\n        }\n\n        [TestCase(\"Index-usa-SPX\")]\n        [TestCase(\"IndexOption-usa-SPX\")]\n        public void DoesNotThrowOnUnknownSecurityType(string key)\n        {\n            Assert.DoesNotThrow(() => SecurityDatabaseKey.Parse(key));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityDefinitionSymbolResolverTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityDefinitionSymbolResolverTests\n    {\n        private DirectoryInfo _testingDataDirectory;\n        private SecurityDefinitionSymbolResolver _instance;\n        private static readonly Dictionary<string, string> _tickerToSecurityIdentifier = new Dictionary<string, string>\n        {\n            {\"AAPL\", \"AAPL R735QTJ8XC9X\"},\n            {\"GOOG\", \"GOOCV VP83T1ZUHROL\"},\n            {\"GOOCV\", \"GOOCV VP83T1ZUHROL\"},\n            {\"QQQ\", \"QQQ RIWIV7K5Z9LX\"},\n            {\"QQQQ\", \"QQQ RIWIV7K5Z9LX\"}\n        };\n\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            _testingDataDirectory = Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), \"testing_data\"));\n            var symbolPropertiesDirectory = Directory.CreateDirectory(Path.Combine(_testingDataDirectory.FullName, \"symbol-properties\"));\n            var securityDatabaseFilePath = Path.Combine(symbolPropertiesDirectory.FullName, \"security-database.csv\");\n\n            SecurityDefinitionSymbolResolver.Reset();\n            _instance = SecurityDefinitionSymbolResolver.GetInstance(TestGlobals.DataProvider, securityDatabaseFilePath);\n\n            var securityDatabaseLines = string.Join(\"\\n\",\n                \"AAPL R735QTJ8XC9X,03783310,BBG000B9XRY4,2046251,US0378331005,320193\",\n                \"GOOG T1AZ164W5VTX,38259P50,BBG000BHSKN9,B020QX2,US38259P5089,\",\n                \"GOOCV VP83T1ZUHROL,38259P70,BBG002W96FT9,BKM4JZ7,US38259P7069,\",\n                \"QQQ RIWIV7K5Z9LX,73935A10,BBG000BSWKH7,BDQYP67,US46090E1038,\");\n            File.WriteAllText(securityDatabaseFilePath,securityDatabaseLines);\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            SecurityDefinitionSymbolResolver.Reset();\n            _testingDataDirectory.Delete(true);\n        }\n\n        [Test]\n        public void NoExistingSecurityDefinitions()\n        {\n            var date = DateTime.UtcNow;\n            // SPY\n            Assert.IsNull(_instance.ISIN(\"US78462F1030\", date));\n            Assert.IsNull(_instance.CUSIP(\"78462F103\", date));\n            Assert.IsNull(_instance.CompositeFIGI(\"BBG001S72SM3\", date));\n            Assert.IsNull(_instance.SEDOL(\"BDDXTY3\", date));\n            Assert.IsEmpty(_instance.CIK(-9999, date));\n        }\n\n        [Test]\n        public void ResolveCIK()\n        {\n            var aaplCik = 320193;\n            var date = DateTime.UtcNow;\n            // AAPL\n            var aapl = _instance.CIK(aaplCik, date);\n            Assert.IsNotNull(aapl[0]);\n            Assert.AreEqual(Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA), aapl[0]);\n\n            var cik = _instance.CIK(aapl[0]);\n            Assert.AreEqual(aaplCik, cik);\n        }\n\n        [TestCase(\"03783310\", 2021, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"03783310\", 2002, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"03783310\", 1995, 1, 1, \"AAPL\", Market.USA)]\n        [TestCase(\"38259P70\", 2021, 9, 9, \"GOOG\", Market.USA)]\n        [TestCase(\"38259P70\", 2014, 4, 3, \"GOOG\", Market.USA)]\n        [TestCase(\"38259P70\", 2014, 4, 2, \"GOOCV\", Market.USA)]\n        [TestCase(\"38259P70\", 2014, 3, 10, \"GOOCV\", Market.USA)]\n        [TestCase(\"38259p70\", 2014, 3, 28, \"GOOCV\", Market.USA)]\n        [TestCase(\"38259P70\", 2014, 3, 27, \"GOOCV\", Market.USA)]\n        [TestCase(\"73935a10\", 2021, 9, 9, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2012, 12, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2011, 3, 23, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2011, 3, 22, \"QQQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2011, 3, 21, \"QQQQ\", Market.USA)]\n        [TestCase(\"73935a10\", 2005, 1, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2004, 12, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 2004, 11, 30, \"QQQ\", Market.USA)]\n        [TestCase(\"73935a10\", 2004, 11, 29, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 1999, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 1999, 3, 11, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 1999, 3, 10, \"QQQ\", Market.USA)]\n        [TestCase(\"73935A10\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"ABCDEF99\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(null, 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"1\", 2021, 9, 9, null, Market.USA)]\n        public void ResolvesCUSIP(string cusip, int year, int month, int day, string expectedTicker, string expectedMarket)\n        {\n            var tradingDate = new DateTime(year, month, day);\n            var expectedSid = expectedTicker == null\n                ? null\n                : _tickerToSecurityIdentifier[expectedTicker];\n\n            var symbol = _instance.CUSIP(cusip, tradingDate);\n\n            AssertSymbol(symbol, expectedTicker, expectedSid, expectedMarket);\n\n            AssertSymbolIdentifier(symbol, _instance.CUSIP(symbol), cusip);\n        }\n\n        [TestCaseSource(nameof(SymbolToCUSIPTestCases))]\n        public void ResolvesSymbolToCUSIP(Symbol symbol, string expectedCusip)\n        {\n            var cusip = _instance.CUSIP(symbol);\n            Assert.AreEqual(expectedCusip, cusip);\n        }\n\n        [TestCase(\"BBG000B9XRY4\", 2021, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"BBG000B9XRY4\", 2002, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"BBG000B9XRY4\", 1995, 1, 1, \"AAPL\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2021, 9, 9, \"GOOG\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2014, 4, 3, \"GOOG\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2014, 4, 2, \"GOOCV\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2014, 3, 10, \"GOOCV\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2014, 3, 28, \"GOOCV\", Market.USA)]\n        [TestCase(\"BBG002W96FT9\", 2014, 3, 27, \"GOOCV\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2021, 9, 9, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2012, 12, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2011, 3, 23, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2011, 3, 22, \"QQQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2011, 3, 21, \"QQQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2005, 1, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2004, 12, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2004, 11, 30, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 2004, 11, 29, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 1999, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 1999, 3, 11, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 1999, 3, 10, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSWKH7\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"ABCDEF99\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(null, 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"1\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"bbg000BSWKH7\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"BBG000BSwKH7\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        public void ResolvesCompositeFIGI(string compositeFigi, int year, int month, int day, string expectedTicker, string expectedMarket)\n        {\n            var tradingDate = new DateTime(year, month, day);\n            var expectedSid = expectedTicker == null\n                ? null\n                : _tickerToSecurityIdentifier[expectedTicker];\n\n            var symbol = _instance.CompositeFIGI(compositeFigi, tradingDate);\n\n            AssertSymbol(symbol, expectedTicker, expectedSid, expectedMarket);\n\n            AssertSymbolIdentifier(symbol, _instance.CompositeFIGI(symbol), compositeFigi);\n        }\n\n        [TestCaseSource(nameof(SymbolToCompositeFIGITestCases))]\n        public void ResolvesSymbolToCompositeFIGI(Symbol symbol, string expectedCompositeFigi)\n        {\n            var compositeFigi = _instance.CompositeFIGI(symbol);\n            Assert.AreEqual(expectedCompositeFigi, compositeFigi);\n        }\n\n        [TestCase(\"2046251\", 2021, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"2046251\", 2002, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"2046251\", 1995, 1, 1, \"AAPL\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2021, 9, 9, \"GOOG\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2014, 4, 3, \"GOOG\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2014, 4, 2, \"GOOCV\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2014, 3, 10, \"GOOCV\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2014, 3, 28, \"GOOCV\", Market.USA)]\n        [TestCase(\"BKM4JZ7\", 2014, 3, 27, \"GOOCV\", Market.USA)]\n        [TestCase(\"BDQYp67\", 2021, 9, 9, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2012, 12, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2011, 3, 23, \"QQQ\", Market.USA)]\n        [TestCase(\"BDqYP67\", 2011, 3, 22, \"QQQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2011, 3, 21, \"QQQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2005, 1, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2004, 12, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"bDQYP67\", 2004, 11, 30, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 2004, 11, 29, \"QQQ\", Market.USA)]\n        [TestCase(\"bdqyp67\", 1999, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 1999, 3, 11, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 1999, 3, 10, \"QQQ\", Market.USA)]\n        [TestCase(\"BDQYP67\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"ABCDEF99\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(null, 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"1\", 2021, 9, 9, null, Market.USA)]\n        public void ResolvesSEDOL(string sedol, int year, int month, int day, string expectedTicker, string expectedMarket)\n        {\n            var tradingDate = new DateTime(year, month, day);\n            var expectedSid = expectedTicker == null\n                ? null\n                : _tickerToSecurityIdentifier[expectedTicker];\n\n            var symbol = _instance.SEDOL(sedol, tradingDate);\n\n            AssertSymbol(symbol, expectedTicker, expectedSid, expectedMarket);\n\n            AssertSymbolIdentifier(symbol, _instance.SEDOL(symbol), sedol);\n        }\n\n        [TestCaseSource(nameof(SymbolToSEDOLTestCases))]\n        public void ResolvesSymbolToSEDOL(Symbol symbol, string expectedSedol)\n        {\n            var sedol = _instance.SEDOL(symbol);\n            Assert.AreEqual(expectedSedol, sedol);\n        }\n\n        [TestCase(\"US0378331005\", 2021, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"US0378331005\", 2002, 9, 9, \"AAPL\", Market.USA)]\n        [TestCase(\"US0378331005\", 1995, 1, 1, \"AAPL\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2021, 9, 9, \"GOOG\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2014, 4, 3, \"GOOG\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2014, 4, 2, \"GOOCV\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2014, 3, 10, \"GOOCV\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2014, 3, 28, \"GOOCV\", Market.USA)]\n        [TestCase(\"US38259P7069\", 2014, 3, 27, \"GOOCV\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2021, 9, 9, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2012, 12, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2011, 3, 23, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2011, 3, 22, \"QQQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2011, 3, 21, \"QQQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2005, 1, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2004, 12, 1, \"QQQQ\", Market.USA)]\n        [TestCase(\"us46090E1038\", 2004, 11, 30, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 2004, 11, 29, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 1999, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090e1038\", 1999, 3, 11, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 1999, 3, 10, \"QQQ\", Market.USA)]\n        [TestCase(\"US46090E1038\", 1998, 5, 21, \"QQQ\", Market.USA)]\n        [TestCase(\"\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"ABCDEF99\", 2021, 9, 9, null, Market.USA)]\n        [TestCase(null, 2021, 9, 9, null, Market.USA)]\n        [TestCase(\"1\", 2021, 9, 9, null, Market.USA)]\n        public void ResolvesISIN(string isin, int year, int month, int day, string expectedTicker, string expectedMarket)\n        {\n            var tradingDate = new DateTime(year, month, day);\n            var expectedSid = expectedTicker == null\n                ? null\n                : _tickerToSecurityIdentifier[expectedTicker];\n\n            var symbol = _instance.ISIN(isin, tradingDate);\n\n            AssertSymbol(symbol, expectedTicker, expectedSid, expectedMarket);\n\n            AssertSymbolIdentifier(symbol, _instance.ISIN(symbol), isin);\n        }\n\n        [TestCaseSource(nameof(SymbolToISINTestCases))]\n        public void ResolvesSymbolToISIN(Symbol symbol, string expectedIsin)\n        {\n            var isin = _instance.ISIN(symbol);\n            Assert.AreEqual(expectedIsin, isin);\n        }\n\n        private static void AssertSymbol(Symbol actual, string expectedTicker, string expectedSid, string expectedMarket)\n        {\n            Assert.AreEqual(expectedTicker, actual?.Value);\n            Assert.AreEqual(expectedSid, actual?.ID.ToString());\n            Assert.AreEqual(expectedMarket, actual?.ID.Market ?? expectedMarket);\n        }\n\n        private static void AssertSymbolIdentifier(Symbol symbol, string reconvertedIdentifier, string expectedIdentifier)\n        {\n            var expected = symbol != null ? expectedIdentifier.ToUpperInvariant() : null;\n            Assert.AreEqual(expected, reconvertedIdentifier);\n        }\n\n        private static TestCaseData[] SymbolToCUSIPTestCases => new[]\n        {\n            new TestCaseData(Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA), \"03783310\"),\n            new TestCaseData(Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA), \"38259P70\"),\n            new TestCaseData(Symbol.Create(\"GOOCV\", SecurityType.Equity, Market.USA), \"38259P70\"),\n            new TestCaseData(Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), \"73935A10\"),\n            new TestCaseData(Symbol.Create(\"QQQQ\", SecurityType.Equity, Market.USA), \"73935A10\"),\n            new TestCaseData(Symbol.Create(\"ABCD\", SecurityType.Equity, Market.USA), null),\n            new TestCaseData(null, null)\n        };\n\n        private static TestCaseData[] SymbolToCompositeFIGITestCases => new[]\n        {\n            new TestCaseData(Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA), \"BBG000B9XRY4\"),\n            new TestCaseData(Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA), \"BBG002W96FT9\"),\n            new TestCaseData(Symbol.Create(\"GOOCV\", SecurityType.Equity, Market.USA), \"BBG002W96FT9\"),\n            new TestCaseData(Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), \"BBG000BSWKH7\"),\n            new TestCaseData(Symbol.Create(\"QQQQ\", SecurityType.Equity, Market.USA), \"BBG000BSWKH7\"),\n            new TestCaseData(Symbol.Create(\"ABCD\", SecurityType.Equity, Market.USA), null),\n            new TestCaseData(null, null)\n        };\n\n        private static TestCaseData[] SymbolToSEDOLTestCases => new[]\n        {\n            new TestCaseData(Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA), \"2046251\"),\n            new TestCaseData(Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA), \"BKM4JZ7\"),\n            new TestCaseData(Symbol.Create(\"GOOCV\", SecurityType.Equity, Market.USA), \"BKM4JZ7\"),\n            new TestCaseData(Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), \"BDQYP67\"),\n            new TestCaseData(Symbol.Create(\"QQQQ\", SecurityType.Equity, Market.USA), \"BDQYP67\"),\n            new TestCaseData(Symbol.Create(\"ABCD\", SecurityType.Equity, Market.USA), null),\n            new TestCaseData(null, null)\n        };\n\n        private static TestCaseData[] SymbolToISINTestCases => new[]\n        {\n            new TestCaseData(Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA), \"US0378331005\"),\n            new TestCaseData(Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA), \"US38259P7069\"),\n            new TestCaseData(Symbol.Create(\"GOOCV\", SecurityType.Equity, Market.USA), \"US38259P7069\"),\n            new TestCaseData(Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), \"US46090E1038\"),\n            new TestCaseData(Symbol.Create(\"QQQQ\", SecurityType.Equity, Market.USA), \"US46090E1038\"),\n            new TestCaseData(Symbol.Create(\"ABCD\", SecurityType.Equity, Market.USA), null),\n            new TestCaseData(null, null)\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityDefinitionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityDefinitionTests\n    {\n        [TestCase(\"AAPL R735QTJ8XC9X,03783310,BBG000B9XRY4,2046251,US0378331005,320193\", \"03783310\", \"BBG000B9XRY4\", \"2046251\", \"US0378331005\", 320193)]\n        [TestCase(\"GOOG T1AZ164W5VTX,38259P50,BBG000BHSKN9,B020QX2,US38259P5089,\", \"38259P50\", \"BBG000BHSKN9\", \"B020QX2\", \"US38259P5089\", null)]\n        [TestCase(\"MXA R735QTJ8XC9X,,BBG000BFDB59,,US6040621095,\", null, \"BBG000BFDB59\", null, \"US6040621095\", null)]\n        [TestCase(\"MXA R735QTJ8XC9X,60406210,,,US6040621095,\", \"60406210\", null, null, \"US6040621095\", null)]\n        [TestCase(\"MXA R735QTJ8XC9X,60406210,BBG000BFDB59,,US6040621095,\", \"60406210\", \"BBG000BFDB59\", null, \"US6040621095\", null)]\n        [TestCase(\"MXA R735QTJ8XC9X,60406210,BBG000BFDB59,,,\", \"60406210\", \"BBG000BFDB59\", null, null, null)]\n        \n        public void ParsesCSV(string line, string cusipExpected, string figiExpected, string sedolExpected, string isinExpected, int? cikExpected)\n        {\n            var securityDefinition = SecurityDefinition.FromCsvLine(line);\n            \n            Assert.AreEqual(cusipExpected, securityDefinition.CUSIP);\n            Assert.AreEqual(figiExpected, securityDefinition.CompositeFIGI);\n            Assert.AreEqual(sedolExpected, securityDefinition.SEDOL);\n            Assert.AreEqual(isinExpected, securityDefinition.ISIN);\n            Assert.AreEqual(cikExpected, securityDefinition.CIK);\n        }\n\n        [TestCase(\"MXA ABCDEFGHIJKL,60406210,BBG000BFDB59,,US6040621095\")]\n        [TestCase(\"60406210,BBG000BFDB59,,US6040621095\")]\n        [TestCase(\"MXA R735QTJ8XC9X,60406210,BBG000BFDB59,\")]\n        [TestCase(\"MXA R735QTJ8XC9X\")]\n        [TestCase(\"\")]\n        public void DoesNotParseCSV(string line)\n        {\n            try\n            {\n                var lines = SecurityDefinition.FromCsvLine(line);\n                Assert.Fail($\"Successfully read line when expecting failure: {line}\");\n            }\n            catch\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityExchangeHoursTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing DayOfWeek = System.DayOfWeek;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityExchangeHoursTests\n    {\n        private static Lazy<HashSet<DateTime>> _mhdbUSHolidays = new Lazy<HashSet<DateTime>>(() => MarketHoursDatabase.FromDataFolder().GetEntry(Market.USA, (string)null, SecurityType.Equity).ExchangeHours.Holidays);\n\n        public void IsAlwaysOpen()\n        {\n            var cryptoMarketHourDbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(Market.Coinbase, (string)null, SecurityType.Crypto);\n            var cryptoExchangeHours = cryptoMarketHourDbEntry.ExchangeHours;\n\n            var futureExchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            Assert.IsTrue(cryptoExchangeHours.IsMarketAlwaysOpen);\n            Assert.IsFalse(futureExchangeHours.IsMarketAlwaysOpen);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void LastMarketCloseOfDay(bool extendedMarketHours)\n        {\n            var marketHourDbEntry = MarketHoursDatabase.FromDataFolder()\n                .GetEntry(Market.HKFE, QuantConnect.Securities.Futures.Indices.HangSeng, SecurityType.Future);\n            var exchangeHours = marketHourDbEntry.ExchangeHours;\n\n            var date = new DateTime(2025, 1, 7);\n\n            var expectedFirstMarketClose = new DateTime(2025, 1, 7, 12, 0, 0);\n            var expectedLastMarketClose = new DateTime(2025, 1, 7, 16, 30, 0);\n            if (extendedMarketHours)\n            {\n                expectedFirstMarketClose = new DateTime(2025, 1, 7, 3, 0, 0);\n                expectedLastMarketClose = new DateTime(2025, 1, 8);\n            }\n\n            var nextMarketClose = exchangeHours.GetNextMarketClose(date, extendedMarketHours);\n            Assert.AreEqual(expectedFirstMarketClose, nextMarketClose);\n\n            if (extendedMarketHours)\n            {\n                Assert.AreEqual(new DateTime(2025, 1, 7, 12, 0, 0), exchangeHours.GetNextMarketClose(nextMarketClose, extendedMarketHours));\n            }\n            else\n            {\n                Assert.AreEqual(new DateTime(2025, 1, 7, 16, 30, 0), exchangeHours.GetNextMarketClose(nextMarketClose, extendedMarketHours));\n            }\n\n            var lastMarketClose = exchangeHours.GetLastDailyMarketClose(date, extendedMarketHours);\n            Assert.AreEqual(expectedLastMarketClose, lastMarketClose);\n        }\n\n        [Test]\n        public void StartIsOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var date = new DateTime(2015, 6, 21);\n            var marketOpen = exchangeHours.MarketHours[DayOfWeek.Sunday].GetMarketOpen(TimeSpan.Zero, false);\n            Assert.IsTrue(marketOpen.HasValue);\n            var time = (date + marketOpen.Value).AddTicks(-1);\n            Assert.IsFalse(exchangeHours.IsOpen(time, false));\n\n            time = time + TimeSpan.FromTicks(1);\n            Assert.IsTrue(exchangeHours.IsOpen(time, false));\n        }\n\n        [Test]\n        public void EndIsClosed()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var date = new DateTime(2015, 6, 19);\n            var localMarketHours = exchangeHours.MarketHours[DayOfWeek.Friday];\n            var marketClose = localMarketHours.GetMarketClose(TimeSpan.Zero, false);\n            Assert.IsTrue(marketClose.HasValue);\n            var time = (date + marketClose.Value).AddTicks(-1);\n            Assert.IsTrue(exchangeHours.IsOpen(time, false));\n\n            time = time + TimeSpan.FromTicks(1);\n            Assert.IsFalse(exchangeHours.IsOpen(time, false));\n        }\n\n        [Test]\n        public void IntervalOverlappingStartIsOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var date = new DateTime(2015, 6, 21);\n            var marketOpen = exchangeHours.MarketHours[DayOfWeek.Sunday].GetMarketOpen(TimeSpan.Zero, false);\n            Assert.IsTrue(marketOpen.HasValue);\n            var startTime = (date + marketOpen.Value).AddMinutes(-1);\n\n            Assert.IsFalse(exchangeHours.IsOpen(startTime, startTime.AddMinutes(1), false));\n\n            // now the end is 1 tick after open, should return true\n            startTime = startTime + TimeSpan.FromTicks(1);\n            Assert.IsTrue(exchangeHours.IsOpen(startTime, startTime.AddMinutes(1), false));\n        }\n\n        [Test]\n        public void IntervalOverlappingEndIsOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var date = new DateTime(2015, 6, 19);\n            var marketClose = exchangeHours.MarketHours[DayOfWeek.Friday].GetMarketClose(TimeSpan.Zero, false);\n            Assert.IsTrue(marketClose.HasValue);\n            var startTime = (date + marketClose.Value).AddMinutes(-1);\n\n            Assert.IsTrue(exchangeHours.IsOpen(startTime, startTime.AddMinutes(1), false));\n\n            // now the start is on the close, returns false\n            startTime = startTime.AddMinutes(1);\n            Assert.IsFalse(exchangeHours.IsOpen(startTime, startTime.AddMinutes(1), false));\n        }\n\n        [Test]\n        public void MultiDayInterval()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var date = new DateTime(2015, 6, 19);\n            var marketClose = exchangeHours.MarketHours[DayOfWeek.Friday].GetMarketClose(TimeSpan.Zero, false);\n            Assert.IsTrue(marketClose.HasValue);\n            var startTime = date + marketClose.Value;\n\n            Assert.IsFalse(exchangeHours.IsOpen(startTime, startTime.AddDays(2), false));\n\n            // if we back up one tick it means the bar started at the last moment before market close, this should be included\n            Assert.IsTrue(exchangeHours.IsOpen(startTime.AddTicks(-1), startTime.AddDays(2).AddTicks(-1), false));\n\n            // if we advance one tick, it means the bar closed in the first moment after market open\n            Assert.IsTrue(exchangeHours.IsOpen(startTime.AddTicks(1), startTime.AddDays(2).AddTicks(1), false));\n        }\n\n        [Test]\n        public void MarketIsOpenBeforeEarlyClose()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var localDateTime = new DateTime(2016, 11, 25, 12, 0, 0);\n            Assert.IsTrue(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketIsNotOpenAfterEarlyClose()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var localDateTime = new DateTime(2016, 11, 25, 14, 0, 0);\n            Assert.IsFalse(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketIsNotOpenForIntervalAfterEarlyClose()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startLocalDateTime = new DateTime(2016, 11, 25, 13, 0, 0);\n            var endLocalDateTime = new DateTime(2016, 11, 25, 13, 30, 0);\n            Assert.IsFalse(exchangeHours.IsOpen(startLocalDateTime, endLocalDateTime, false));\n        }\n\n        [Test]\n        public void GetMarketHoursWithLateOpen()\n        {\n            var exchangeHours = CreateSecurityExchangeHoursWithMultipleOpeningHours();\n\n            var startTime = new DateTime(2018, 12, 10);\n            // From 2:00am, the next close would normally be 3:00am.\n            // Because there is a late open at 4am.\n            var marketHoursSegments = exchangeHours.GetMarketHours(startTime).Segments;\n            var expectedMarketHoursSegments = new List<MarketHoursSegment>() {\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(17, 0, 0), new TimeSpan(17, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(18, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(19, 0, 0), TimeSpan.FromTicks(Time.OneDay.Ticks - 1))\n            };\n\n            for (int i = 0; i <= marketHoursSegments.Count - 1; i++)\n            {\n                var marketHoursSegment = marketHoursSegments.ElementAt(i);\n                var expectedMarketHoursSegment = expectedMarketHoursSegments.ElementAt(i);\n\n                Assert.AreEqual(expectedMarketHoursSegment.Start, marketHoursSegment.Start);\n                Assert.AreEqual(expectedMarketHoursSegment.End, marketHoursSegment.End);\n                Assert.AreEqual(expectedMarketHoursSegment.State, marketHoursSegment.State);\n            }\n        }\n\n        [Test]\n        public void GetMarketHoursWithEarlyClose()\n        {\n            var exchangeHours = CreateSecurityExchangeHoursWithMultipleOpeningHours();\n\n            var startTime = new DateTime(2018, 12, 31);\n            var marketHoursSegment = exchangeHours.GetMarketHours(startTime).Segments.FirstOrDefault();\n            var expectedMarketHoursSegment = new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(3, 0, 0), new TimeSpan(3, 30, 0));\n            Assert.AreEqual(expectedMarketHoursSegment.Start, marketHoursSegment.Start);\n            Assert.AreEqual(expectedMarketHoursSegment.End, marketHoursSegment.End);\n            Assert.AreEqual(expectedMarketHoursSegment.State, marketHoursSegment.State);\n        }\n\n        [Test]\n        public void GetMarketHoursWithEarlyCloseAndLateOpen()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2016, 11, 25);\n            var marketHoursSegment = exchangeHours.GetMarketHours(startTime).Segments.FirstOrDefault();\n            var expectedMarketHoursSegment = new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(10, 0, 0), new TimeSpan(13, 0, 0));\n            Assert.AreEqual(expectedMarketHoursSegment.Start, marketHoursSegment.Start);\n            Assert.AreEqual(expectedMarketHoursSegment.End, marketHoursSegment.End);\n            Assert.AreEqual(expectedMarketHoursSegment.State, marketHoursSegment.State);\n\n        }\n\n        [Test]\n        public void GetNextMarketOpenIsNonInclusiveOfStartTime()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2015, 6, 30, 9, 30, 0);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(startTime.AddDays(1), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenWorksOnHoliday()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2016, 9, 5, 8, 0, 0);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2016, 9, 6, 9, 30, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenWorksOverWeekends()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2015, 6, 26, 9, 30, 1);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2015, 6, 29, 9, 30, 0), nextMarketOpen);\n        }\n\n        // The purpose of define explicitly the exchange market hours for futures,\n        // which is pretty similar to exchange market hours for ES, was to consider\n        // the case when the market opens at 00 hours on Sunday but the input date\n        // was the Saturday. In that case when GetNextMarketOpen() processed the Sunday\n        // it should behave as an inclusive  method because for Sunday at 00 it should\n        // return Sunday at 00\n        [Test]\n        public void GetNextMarketOpenForContinuousSchedulesOverWeekends()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            var startTime = new DateTime(2022, 1, 1);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2022, 1, 2), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenForContinuousSchedules()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            var startTime = new DateTime(2022, 1, 3);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2022, 1, 3, 16, 30, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenForContinuousSchedulesIsNotInclusiveOfStartTime()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            var startTime = new DateTime(2022, 1, 2);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2022, 1, 3, 16, 30, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketCloseForContinuousSchedulesOverWeekends()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            var startTime = new DateTime(2022, 1, 1);\n            var nextMarketOpen = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2022, 1, 3, 16, 15, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenForEarlyCloses()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            // Thanksgiving day\n            var startTime = new DateTime(2013, 11, 28);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2013, 11, 29), nextMarketOpen);\n        }\n\n        [TestCaseSource(nameof(GetNextMarketOpenTestCases))]\n        public void GetNextMarketOpen(DateTime startTime, DateTime expectedNextMarketOpen, bool extendedMarket)\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHoursWithExtendedHours();\n\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, extendedMarket);\n            Assert.AreEqual(expectedNextMarketOpen, nextMarketOpen);\n        }\n\n        [Test]\n        public void GetLastMarketOpenForContinuousSchedules()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours();\n\n            var startTime = new DateTime(2022, 03, 18, 5, 0, 0);\n            var nextMarketOpen = exchangeHours.GetPreviousMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2022, 03, 17, 18, 0, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetLastMarketOpenWithExtendedMarket()\n        {\n            var marketHourDbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(Market.USA, (string)null, SecurityType.Equity);\n            var exchangeHours = marketHourDbEntry.ExchangeHours;\n\n            var startTime = new DateTime(2022, 03, 18, 9, 29, 0);\n            var nextMarketOpen = exchangeHours.GetPreviousMarketOpen(startTime, true);\n            Assert.AreEqual(new DateTime(2022, 03, 18, 4, 0, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketCloseIsNonInclusiveOfStartTime()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2015, 6, 30, 16, 0, 0);\n            var nextMarketOpen = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(startTime.AddDays(1), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketCloseWorksOnHoliday()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2016, 9, 5, 10, 0, 0);\n            var nextMarketClose = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2016, 9, 6, 16, 0, 0), nextMarketClose);\n        }\n\n        [Test]\n        public void GetNextMarketCloseWorksOverWeekends()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2015, 6, 26, 16, 0, 1);\n            var nextMarketClose = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2015, 6, 29, 16, 0, 0), nextMarketClose);\n        }\n\n        [Test]\n        public void GetNextMarketCloseWorksBeforeEarlyClose()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2016, 11, 25, 10, 0, 0);\n            var nextMarketClose = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2016, 11, 25, 13, 0, 0), nextMarketClose);\n        }\n\n        [Test]\n        public void GetNextMarketCloseWorksAfterEarlyClose()\n        {\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n\n            var startTime = new DateTime(2016, 11, 25, 14, 0, 0);\n            var nextMarketClose = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2016, 11, 28, 16, 0, 0), nextMarketClose);\n        }\n\n        [Test]\n        public void GetNextMarketCloseWorksAfterLateOpen()\n        {\n            var exchangeHours = CreateSecurityExchangeHoursWithMultipleOpeningHours();\n\n            var startTime = new DateTime(2018, 12, 10, 2, 0, 1);\n            // From 2:00am, the next close would normally be 3:00am.\n            // Because there is a late open at 4am, the next close is the close of the session after that open.\n            var nextMarketOpen = exchangeHours.GetNextMarketClose(startTime, false);\n            Assert.AreEqual(new DateTime(2018, 12, 10, 17, 30, 0), nextMarketOpen);\n        }\n\n        [TestCaseSource(nameof(GetNextMarketCloseTestCases))]\n        public void GetNextMarketClose(DateTime startTime, DateTime expectedNextMarketClose, bool extendedMarket)\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHoursWithExtendedHours();\n\n            var nextMarketClose = exchangeHours.GetNextMarketClose(startTime, extendedMarket);\n            Assert.AreEqual(expectedNextMarketClose, nextMarketClose);\n        }\n\n        [Test]\n        public void MarketIsNotOpenBeforeLateOpenIfNotEarlyClose()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var localDateTime = new DateTime(2019, 1, 1, 16, 59, 59);\n            Assert.IsFalse(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketIsOpenBeforeLateOpenIfEarlyClose()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours(true);\n\n            var localDateTime = new DateTime(2013, 11, 29, 10, 0, 0);\n            Assert.IsTrue(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketIsOpenAfterEarlyCloseIfLateOpen()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours(true);\n\n            var localDateTime = new DateTime(2013, 11, 29, 16, 45, 0);\n            Assert.IsTrue(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketResumesAfterEarlyCloseIfLateOpen()\n        {\n            var exchangeHours = CreateUsFutureSecurityExchangeHours(true);\n            var localDateTime = new DateTime(2013, 11, 28, 0, 0, 0);\n            var nextDay = new DateTime(2013, 11, 29, 0, 0, 0);\n            var earlyClose = new TimeSpan(10, 30, 0);\n            var lateOpen = new TimeSpan(19, 0, 0);\n\n            var minutes = 0;\n            while (localDateTime < nextDay)\n            {\n                if (localDateTime.TimeOfDay < earlyClose || lateOpen < localDateTime.TimeOfDay)\n                {\n                    Assert.IsTrue(exchangeHours.IsOpen(localDateTime, false));\n                }\n                else\n                {\n                    Assert.IsFalse(exchangeHours.IsOpen(localDateTime, false));\n                }\n\n                minutes++;\n                localDateTime = localDateTime.AddMinutes(minutes);\n            }\n        }\n\n        [Test]\n        public void MarketIsOpenAfterLateOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var localDateTime = new DateTime(2019, 1, 1, 17, 0, 1);\n            Assert.IsTrue(exchangeHours.IsOpen(localDateTime, false));\n        }\n\n        [Test]\n        public void MarketIsNotOpenForIntervalBeforeLateOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var startLocalDateTime = new DateTime(2019, 1, 1, 16, 30, 0);\n            var endLocalDateTime = new DateTime(2019, 1, 1, 17, 0, 0);\n            Assert.IsFalse(exchangeHours.IsOpen(startLocalDateTime, endLocalDateTime, false));\n        }\n\n        [Test]\n        public void GetNextMarketOpenWorksBeforeLateOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var startTime = new DateTime(2019, 1, 1, 16, 59, 59); // Friday\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2019, 1, 1, 17, 0, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenWorksAfterLateOpen()\n        {\n            var exchangeHours = CreateForexSecurityExchangeHours();\n\n            var startTime = new DateTime(2019, 1, 1, 17, 0, 1);\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2019, 1, 6, 17, 0, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void GetNextMarketOpenWorksAfterEarlyClose()\n        {\n            var exchangeHours = CreateSecurityExchangeHoursWithMultipleOpeningHours();\n\n            var startTime = new DateTime(2018, 12, 31, 17, 0, 1);\n            // From 5:00pm, the next open would normally be 6:00pm.\n            // Because there is an early close at 5pm, the next open is the open of the session on the following day (+ a late open).\n            var nextMarketOpen = exchangeHours.GetNextMarketOpen(startTime, false);\n            Assert.AreEqual(new DateTime(2019, 1, 1, 02, 0, 0), nextMarketOpen);\n        }\n\n        [Test]\n        public void Benchmark()\n        {\n            var forex = CreateForexSecurityExchangeHours();\n\n            var reference = new DateTime(1991, 06, 20);\n            forex.IsOpen(reference, false);\n            forex.IsOpen(reference, reference.AddDays(1), false);\n\n            const int length = 1000 * 1000 * 1;\n\n            var stopwatch = Stopwatch.StartNew();\n            for (int i = 0; i < length; i++)\n            {\n                forex.IsOpen(reference.AddMinutes(1), false);\n            }\n            stopwatch.Stop();\n\n            Log.Trace(\"forex1: \" + stopwatch.Elapsed);\n        }\n\n        [Test]\n        public void RegularMarketDurationIsFromMostCommonLocalMarketHours()\n        {\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, Enumerable.Empty<DateTime>(),\n                new Dictionary<DayOfWeek, LocalMarketHours>\n                {\n                    // fake market hours schedule with random durations, the most common of which is 5 hours and 2 hours, it will pick the larger\n                    {DayOfWeek.Sunday, new LocalMarketHours(DayOfWeek.Sunday, TimeSpan.FromHours(4), TimeSpan.FromHours(6))},           //2hr\n                    {DayOfWeek.Monday, new LocalMarketHours(DayOfWeek.Monday, TimeSpan.FromHours(13), TimeSpan.FromHours(15))},         //2hr\n                    {DayOfWeek.Tuesday, new LocalMarketHours(DayOfWeek.Tuesday, TimeSpan.FromHours(5), TimeSpan.FromHours(10))},        //5hr\n                    {DayOfWeek.Wednesday, new LocalMarketHours(DayOfWeek.Wednesday, TimeSpan.FromHours(5), TimeSpan.FromHours(10))},    //5hr\n                    {DayOfWeek.Thursday, new LocalMarketHours(DayOfWeek.Thursday, TimeSpan.FromHours(1), TimeSpan.FromHours(23))},      //22hr\n                    {DayOfWeek.Friday, new LocalMarketHours(DayOfWeek.Friday, TimeSpan.FromHours(0), TimeSpan.FromHours(23))},          //23hr\n                    {DayOfWeek.Saturday, new LocalMarketHours(DayOfWeek.Saturday, TimeSpan.FromHours(3), TimeSpan.FromHours(23))},      //20hr\n                }, new Dictionary<DateTime, TimeSpan>(), new Dictionary<DateTime, TimeSpan>());\n\n            Assert.AreEqual(TimeSpan.FromHours(5), exchangeHours.RegularMarketDuration);\n        }\n\n        [TestCaseSource(nameof(GetTestCases))]\n        public void GetMarketHoursWorksCorrectly(DateTime earlyClose, DateTime lateOpen, LocalMarketHours expected)\n        {\n            var testDate = new DateTime(2020, 7, 3); // Friday\n            var exchangeHours = CreateCustomFutureExchangeHours(earlyClose, lateOpen);\n            var actual = exchangeHours.GetMarketHours(testDate);\n\n            // Extracts the time segments for detailed comparison\n            var actualSegments = actual.Segments;\n            var expectedSegments = expected.Segments;\n\n            // Must have the same number of segments\n            Assert.AreEqual(expectedSegments.Count, actualSegments.Count);\n\n            // 1. Market State (PreMarket/Market/PostMarket/Closed)\n            // 2. Start Time (Validates late open adjustments)\n            // 3. End Time (Validates early close adjustments)\n            for (int i = 0; i < expectedSegments.Count; i++)\n            {\n                Assert.AreEqual(expectedSegments[i].State, actualSegments[i].State, $\"Segment {i} state mismatch\");\n                Assert.AreEqual(expectedSegments[i].Start, actualSegments[i].Start, $\"Segment {i} start time mismatch\");\n                Assert.AreEqual(expectedSegments[i].End, actualSegments[i].End, $\"Segment {i} end time mismatch\");\n            }\n        }\n\n        private static TestCaseData[] GetTestCases()\n        {\n            return new[]\n            {\n                // 1. Regular hours (no early close, no late open)\n                new TestCaseData(\n                    new DateTime(), // No early close\n                    new DateTime(), // No late open\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)))\n                ),\n\n                // 2. Early close only scenarios\n                // 2.1 Early close during regular market hours\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 12, 0, 0), // Early close at noon\n                    new DateTime(),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(12, 0, 0)))\n                ),\n                // 2.2 Early close before market opens (should remove market segment)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 7, 0, 0), // Early close before open\n                    new DateTime(),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(7, 0, 0)))\n                ),\n                // 2.3 Early close after market closes (should have no effect)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 17, 0, 0), // Early close after regular close\n                    new DateTime(),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)))\n                ),\n\n                // 3. Late open only scenarios\n                // 3.1 Late open during regular market hours (should adjust market open)\n                new TestCaseData(\n                    new DateTime(),\n                    new DateTime(2020, 7, 3, 10, 0, 0), // Late open at 10am\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(10, 0, 0), new TimeSpan(16, 0, 0)))\n                ),\n                // 3.2 Late open before market opens (should delay premarket start)\n                new TestCaseData(\n                    new DateTime(),\n                    new DateTime(2020, 7, 3, 7, 0, 0), // Late open before market\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(7, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)))\n                ),\n                // 3.3 Late open after market close (regular hours)\n                new TestCaseData(\n                    new DateTime(),\n                    new DateTime(2020, 7, 3, 17, 0, 0), // Late open at 17\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)))\n                ),\n\n                // 4. Both early close and late open scenarios\n                // 4.1 Open <= Earlyclose <= Close and EarlyClose < LateOpen (market closes then reopens)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 12, 0, 0), // Close at noon\n                    new DateTime(2020, 7, 3, 13, 0, 0), // Reopen at 1pm\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(12, 0, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(13, 0, 0), new TimeSpan(16, 0, 0)))\n                ),\n                // 4.2 Open <= Earlyclose <= Close and EarlyClose > LateOpen (only one market segment should exist)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 15, 0, 0), // Close at 3pm\n                    new DateTime(2020, 7, 3, 14, 0, 0), // Late open at 2pm\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(14, 0, 0), new TimeSpan(15, 0, 0)))\n                ),\n                // 4.3 Earlyclose <= Open and EarlyClose < LateOpen <= Close\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 7, 0, 0),\n                    new DateTime(2020, 7, 3, 14, 0, 0),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(7, 0, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(14, 0, 0), new TimeSpan(16, 0, 0)))\n                ),\n                // 4.4 LateOpen < Earlyclose <= Open\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 7, 0, 0),\n                    new DateTime(2020, 7, 3, 6, 0, 0),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(6, 0, 0), new TimeSpan(7, 0, 0)))\n                ),\n\n                // 5. Edge cases\n                // 5.1 Early close exactly at market open (no market segment)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 8, 30, 0),\n                    new DateTime(),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)))\n                ),\n                // 5.2 Late open exactly at market close (market segment has zero duration)\n                new TestCaseData(\n                    new DateTime(),\n                    new DateTime(2020, 7, 3, 16, 0, 0),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 0, 0), new TimeSpan(16, 0, 0)))\n                ),\n                // 5.3 Early close and late open at the same time (split into two segments with zero-duration overlap)\n                new TestCaseData(\n                    new DateTime(2020, 7, 3, 13, 0, 0),\n                    new DateTime(2020, 7, 3, 13, 0, 0),\n                    new LocalMarketHours(DayOfWeek.Friday,\n                        new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(13, 0, 0)),\n                        new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(13, 0, 0), new TimeSpan(13, 0, 0)))\n                ),\n            };\n        }\n\n        private static SecurityExchangeHours CreateCustomFutureExchangeHours(DateTime earlyClose, DateTime lateOpen)\n        {\n            var sunday = new LocalMarketHours(\n                DayOfWeek.Sunday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0)) // 1.00:00:00 = 25 horas\n            );\n\n            var monday = new LocalMarketHours(\n                DayOfWeek.Monday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var tuesday = new LocalMarketHours(\n                DayOfWeek.Tuesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var wednesday = new LocalMarketHours(\n                DayOfWeek.Wednesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var thursday = new LocalMarketHours(\n                DayOfWeek.Thursday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var friday = new LocalMarketHours(\n                DayOfWeek.Friday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0))\n            );\n\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan>\n            {\n                { earlyClose.Date, earlyClose.TimeOfDay }\n            };\n\n            var lateOpens = new Dictionary<DateTime, TimeSpan>\n            {\n                { lateOpen.Date, lateOpen.TimeOfDay }\n            };\n\n            var holidays = new List<DateTime>\n            {\n                new DateTime(2025, 4, 18)\n            };\n\n            var exchangeHours = new SecurityExchangeHours(\n                TimeZones.Chicago,\n                holidays,\n                new[]\n                {\n                    sunday,\n                    monday,\n                    tuesday,\n                    wednesday,\n                    thursday,\n                    friday,\n                    saturday\n                }.ToDictionary(x => x.DayOfWeek),\n                earlyCloses,\n                lateOpens\n            );\n\n            return exchangeHours;\n        }\n\n        public static SecurityExchangeHours CreateForexSecurityExchangeHours()\n        {\n            var sunday = new LocalMarketHours(DayOfWeek.Sunday, new TimeSpan(17, 0, 0), TimeSpan.FromTicks(Time.OneDay.Ticks - 1));\n            var monday = LocalMarketHours.OpenAllDay(DayOfWeek.Monday);\n            var tuesday = LocalMarketHours.OpenAllDay(DayOfWeek.Tuesday);\n            var wednesday = LocalMarketHours.OpenAllDay(DayOfWeek.Wednesday);\n            var thursday = LocalMarketHours.OpenAllDay(DayOfWeek.Thursday);\n            var friday = new LocalMarketHours(DayOfWeek.Friday, TimeSpan.Zero, new TimeSpan(17, 0, 0));\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var holidays = _mhdbUSHolidays.Value;\n\n            holidays.Remove(new DateTime(2019, 1, 1));  // not a forex holiday\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2018, 12, 31), new TimeSpan(17, 0, 0) } };\n            var lateOpens = new Dictionary<DateTime, TimeSpan> { { new DateTime(2019, 1, 1), new TimeSpan(17, 0, 0) } };\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday//, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return exchangeHours;\n        }\n\n        public static SecurityExchangeHours CreateSecurityExchangeHoursWithMultipleOpeningHours()\n        {\n            var sunday = LocalMarketHours.OpenAllDay(DayOfWeek.Sunday);\n            var monday = new LocalMarketHours(\n                DayOfWeek.Monday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(3, 0, 0), new TimeSpan(3, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(17, 0, 0), new TimeSpan(17, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(18, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(19, 0, 0), TimeSpan.FromTicks(Time.OneDay.Ticks - 1))\n            );\n            var tuesday = LocalMarketHours.OpenAllDay(DayOfWeek.Tuesday);\n            var wednesday = LocalMarketHours.OpenAllDay(DayOfWeek.Wednesday);\n            var thursday = LocalMarketHours.OpenAllDay(DayOfWeek.Thursday);\n            var friday = LocalMarketHours.OpenAllDay(DayOfWeek.Friday);\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var holidays = new List<DateTime>();\n            var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2018, 12, 31), new TimeSpan(17, 0, 0) } };\n            var lateOpens = new Dictionary<DateTime, TimeSpan> { {new DateTime(2019, 01, 01), new TimeSpan(2, 0, 0)},\n                { new DateTime(2018, 12, 10), new TimeSpan(4, 0, 0) } };\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday//, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return exchangeHours;\n        }\n\n        public static SecurityExchangeHours CreateUsEquitySecurityExchangeHours()\n        {\n            var sunday = LocalMarketHours.ClosedAllDay(DayOfWeek.Sunday);\n            var monday = new LocalMarketHours(DayOfWeek.Monday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var tuesday = new LocalMarketHours(DayOfWeek.Tuesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var wednesday = new LocalMarketHours(DayOfWeek.Wednesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var thursday = new LocalMarketHours(DayOfWeek.Thursday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var friday = new LocalMarketHours(DayOfWeek.Friday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2016, 11, 25), new TimeSpan(13, 0, 0) } };\n            var lateOpens = new Dictionary<DateTime, TimeSpan>() { { new DateTime(2016, 11, 25), new TimeSpan(10, 0, 0) } };\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, _mhdbUSHolidays.Value, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return exchangeHours;\n        }\n\n        public static SecurityExchangeHours CreateUsFutureSecurityExchangeHours(bool addLateOpens = false)\n        {\n            var sunday = LocalMarketHours.OpenAllDay(DayOfWeek.Sunday);\n            var monday = new LocalMarketHours(\n                DayOfWeek.Monday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(0, 0, 0), new TimeSpan(16, 15, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 30, 0), new TimeSpan(17, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(24, 0, 0))\n            );\n            var tuesday = new LocalMarketHours(\n                DayOfWeek.Tuesday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(0, 0, 0), new TimeSpan(16, 15, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 30, 0), new TimeSpan(17, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(24, 0, 0))\n            );\n            var wednesday = new LocalMarketHours(\n                DayOfWeek.Wednesday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(0, 0, 0), new TimeSpan(16, 15, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 30, 0), new TimeSpan(17, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(24, 0, 0))\n            );\n            var thursday = new LocalMarketHours(\n                DayOfWeek.Thursday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(0, 0, 0), new TimeSpan(16, 15, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 30, 0), new TimeSpan(17, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(18, 0, 0), new TimeSpan(24, 0, 0))\n            );\n            var friday = new LocalMarketHours(\n                DayOfWeek.Friday,\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(0, 0, 0), new TimeSpan(16, 15, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(16, 30, 0), new TimeSpan(17, 0, 0))\n            );\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2013, 11, 28), new TimeSpan(10, 30, 0) },\n                { new DateTime(2013, 11, 29), new TimeSpan(12, 15, 0)} };\n            Dictionary<DateTime, TimeSpan> lateOpens = null;\n            if (addLateOpens)\n            {\n                lateOpens = new Dictionary<DateTime, TimeSpan> { { new DateTime(2013, 11, 28), new TimeSpan(19, 00, 0) }, { new DateTime(2013, 11, 29), new TimeSpan(16, 40, 0) } };\n            }\n            else\n            {\n                lateOpens = new Dictionary<DateTime, TimeSpan>();\n            }\n\n            var holidays = _mhdbUSHolidays.Value.Select(x => x.Date).Where(x => !earlyCloses.ContainsKey(x)).ToList();\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return exchangeHours;\n        }\n\n        public static SecurityExchangeHours CreateUsFutureSecurityExchangeHoursWithExtendedHours()\n        {\n            var sunday = new LocalMarketHours(\n                DayOfWeek.Sunday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0))\n            );\n            var monday = new LocalMarketHours(\n                DayOfWeek.Monday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0))\n            );\n            var tuesday = new LocalMarketHours(\n                DayOfWeek.Tuesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0))\n            );\n            var wednesday = new LocalMarketHours(\n                DayOfWeek.Wednesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0))\n            );\n            var thursday = new LocalMarketHours(\n                DayOfWeek.Thursday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(18, 0, 0), new TimeSpan(1, 0, 0, 0))\n            );\n            var friday = new LocalMarketHours(\n                DayOfWeek.Friday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(9, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0))\n            );\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2013, 11, 28), new TimeSpan(10, 30, 0) },\n                { new DateTime(2013, 11, 29), new TimeSpan(12, 15, 0)} };\n            var lateOpens = new Dictionary<DateTime, TimeSpan>();\n            var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, _mhdbUSHolidays.Value, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return exchangeHours;\n        }\n\n        private static TestCaseData[] GetNextMarketOpenTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(new DateTime(2022, 1, 1), new DateTime(2022, 1, 3, 9, 30, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 3, 8, 0, 0), new DateTime(2022, 1, 3, 9, 30, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 2, 18, 0, 0), new DateTime(2022, 1, 3, 18, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 3, 12, 0, 0), new DateTime(2022, 1, 3, 18, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 3, 16, 0, 0), new DateTime(2022, 1, 3, 18, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 1), new DateTime(2022, 1, 2, 18, 0, 0), true)\n            };\n        }\n\n        private static TestCaseData[] GetNextMarketCloseTestCases()\n        {\n            return new[]\n            {\n                new TestCaseData(new DateTime(2022, 1, 1), new DateTime(2022, 1, 3, 16, 0, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 2), new DateTime(2022, 1, 3, 16, 0, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 3), new DateTime(2022, 1, 3, 16, 0, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 3, 10, 0, 0), new DateTime(2022, 1, 3, 16, 0, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 3, 18, 0, 0), new DateTime(2022, 1, 4, 16, 0, 0), false),\n                new TestCaseData(new DateTime(2022, 1, 1), new DateTime(2022, 1, 3, 16, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 2), new DateTime(2022, 1, 3, 16, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 2, 18, 0, 0), new DateTime(2022, 1, 3, 16, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 3), new DateTime(2022, 1, 3, 16, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 3, 10, 0, 0), new DateTime(2022, 1, 3, 16, 0, 0), true),\n                new TestCaseData(new DateTime(2022, 1, 3, 18, 0, 0), new DateTime(2022, 1, 4, 16, 0, 0), true),\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityHoldingTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityHoldingTests\n    {\n        [Test]\n        public void ComputesUnrealizedProfit()\n        {\n            var security = GetSecurity<QuantConnect.Securities.Equity.Equity>(Symbols.SPY, Resolution.Daily);\n            var holding = new SecurityHolding(security, new IdentityCurrencyConverter(Currencies.USD));\n\n            var last = 100m;\n            var bid = 99m;\n            var ask = 101m;\n            var orderFee = 1m;\n\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, last, bid, ask));\n\n            // Long scenario: expected unrealized profit take the bid price\n            var quantity = 100m;\n            var expected = (bid - last) * quantity - orderFee;\n            holding.SetHoldings(last, quantity);\n            Assert.AreEqual(expected, holding.UnrealizedProfit);\n\n            // Short scenario: expected unrealized profit take the ask price\n            quantity = -100m;\n            expected = (ask - last) * quantity - orderFee;\n            holding.SetHoldings(last, quantity);\n            Assert.AreEqual(expected, holding.UnrealizedProfit);\n        }\n\n        [Test]\n        public void Raises_QuantityChanged_WhenSetHoldingsCalled()\n        {\n            var arguments = new List<SecurityHoldingQuantityChangedEventArgs>();\n            var security = GetSecurity<QuantConnect.Securities.Equity.Equity>(Symbols.SPY, Resolution.Daily);\n            security.Holdings.QuantityChanged += (sender, args) => arguments.Add(args);\n\n            // invoke int overload\n            var firstPrice = 100m;\n            int firstQuantity = 100;\n            security.Holdings.SetHoldings(firstPrice, firstQuantity);\n\n            // invoke decimal overload\n            var secondPrice = 101m;\n            var secondQuantity = 200m;\n            security.Holdings.SetHoldings(secondPrice, secondQuantity);\n\n            Assert.AreEqual(2, arguments.Count);\n\n            var first = arguments.First();\n            Assert.AreEqual(security, first.Security);\n            Assert.AreEqual(0, first.PreviousQuantity);\n            Assert.AreEqual(0, first.PreviousAveragePrice);\n\n            var second = arguments.Last();\n            Assert.AreEqual(security, second.Security);\n            Assert.AreEqual(firstQuantity, second.PreviousQuantity);\n            Assert.AreEqual(firstPrice, second.PreviousAveragePrice);\n        }\n\n        private Security GetSecurity<T>(Symbol symbol, Resolution resolution)\n        {\n            var subscriptionDataConfig = new SubscriptionDataConfig(\n                typeof(T),\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var reference = DateTime.Now;\n            var referenceUtc = reference.ConvertToUtc(subscriptionDataConfig.DataTimeZone);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(subscriptionDataConfig.DataTimeZone));\n\n            return security;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Securities/SecurityIdentifierTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Custom.AlphaStreams;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Custom.Intrinio;\nusing QuantConnect.Data.Custom;\nusing QuantConnect.Data.Custom.Tiingo;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityIdentifierTests\n    {\n        private static SecurityIdentifier SPY\n        {\n            get { return SecurityIdentifier.GenerateEquity(new DateTime(1998, 01, 02), \"SPY\", Market.USA); }\n        }\n\n        // this is really not european style, but I'd prefer to test a value of 1 vs a value of 0\n        private readonly SecurityIdentifier SPY_Put_19550 = SecurityIdentifier.GenerateOption(new DateTime(2015, 09, 18), SPY, Market.USA, 195.50m, OptionRight.Put, OptionStyle.European);\n        // this is euro-dollar futures contract (for tests)\n        private readonly SecurityIdentifier ED_Dec_2020 = SecurityIdentifier.GenerateFuture(new DateTime(2020, 12, 15), \"ED\", Market.USA);\n\n        [TestCase(\"SPY\", \"SPY\", \"20230403\")]\n        [TestCase(\"GOOG\", \"GOOG\", \"20140403\")]\n        [TestCase(\"GOOG\", \"GOOCV\", \"20140402\")]\n        public void Ticker(string symbol, string expectedTicker, string date)\n        {\n            var equity = Symbol.Create(symbol, SecurityType.Equity, Market.USA);\n            var ticker = SecurityIdentifier.Ticker(equity, Time.ParseDate(date));\n\n            Assert.AreEqual(expectedTicker, ticker);\n        }\n\n        [Test]\n        public void GenerateEquityProperlyResolvesFirstDate()\n        {\n            var spy = SecurityIdentifier.GenerateEquity(\"SPY\", Market.USA);\n            Assert.AreEqual(new DateTime(1998, 01, 02), spy.Date);\n        }\n\n        [Test]\n        public void GenerateFailsOnInvalidDate()\n        {\n            Assert.Throws<ArgumentOutOfRangeException>(() =>\n                SecurityIdentifier.GenerateEquity(Time.BeginningOfTime.AddDays(-1), \"SPY\", Market.USA));\n        }\n\n        [Test]\n        public void GeneratesIdentifiersDeterministically()\n        {\n            var sid1 = SPY;\n            var sid2 = SPY;\n            Assert.AreEqual(sid1, sid2);\n            Log.Trace(sid1.ToString());\n        }\n\n        [Test]\n        public void GeneratesOptionSecurityIdentifier()\n        {\n            var spyPut = SPY_Put_19550;\n\n            // verify various values\n            Assert.AreEqual(OptionRight.Put, spyPut.OptionRight); // put\n            Assert.AreEqual(new DateTime(2015, 09, 18), spyPut.Date); // oa date 2015.09.18\n            Assert.AreEqual(OptionStyle.European, spyPut.OptionStyle); // option style\n            Assert.AreEqual(195.5m, spyPut.StrikePrice); // strike/scale\n            Assert.AreEqual(Market.USA, spyPut.Market); // market\n            Assert.AreEqual(SecurityType.Option, spyPut.SecurityType); // security type\n            Assert.AreEqual(\"SPY\", spyPut.Symbol); // SPY in base36\n            Assert.IsTrue(spyPut.HasUnderlying);\n            Assert.AreEqual(SPY, spyPut.Underlying);\n\n            Log.Trace(SPY_Put_19550.ToString());\n        }\n\n        [Test]\n        public void GeneratesEquitySecurityIdentifier()\n        {\n            var sid1 = SecurityIdentifier.GenerateEquity(new DateTime(1998, 01, 02), \"SPY\", Market.USA);\n\n            // verify various values\n            Assert.AreEqual(new DateTime(1998, 01, 02), sid1.Date);\n            Assert.AreEqual(Market.USA, sid1.Market);\n            Assert.AreEqual(SecurityType.Equity, sid1.SecurityType);\n            Assert.AreEqual(\"SPY\", sid1.Symbol);\n\n            Log.Trace(sid1.ToString());\n        }\n\n        [Test]\n        public void GeneratesForexSecurityIdentifier()\n        {\n            var eurusd = SecurityIdentifier.GenerateForex(\"EURUSD\", Market.FXCM);\n\n            // verify various values\n            Assert.Throws<InvalidOperationException>(() => { var x = eurusd.Date; });\n            Assert.AreEqual(Market.FXCM, eurusd.Market);\n            Assert.AreEqual(SecurityType.Forex, eurusd.SecurityType);\n            Assert.AreEqual(\"EURUSD\", eurusd.Symbol);\n\n            Log.Trace(eurusd.ToString());\n        }\n\n        [Test]\n        public void FuturesSecurityIdReturnsProperties()\n        {\n            // verify various values\n            Assert.AreEqual(new DateTime(2020, 12, 15), ED_Dec_2020.Date);\n            Assert.AreEqual(Market.USA, ED_Dec_2020.Market);\n            Assert.AreEqual(SecurityType.Future, ED_Dec_2020.SecurityType);\n            Assert.AreEqual(\"ED\", ED_Dec_2020.Symbol);\n\n            Log.Trace(ED_Dec_2020.ToString());\n        }\n\n        [Test]\n        public void Generates12Character()\n        {\n            var sid1 = SecurityIdentifier.GenerateBase(null, \"123456789012\", Market.USA);\n            Assert.AreEqual(\"123456789012\", sid1.Symbol);\n            Log.Trace(sid1.ToString());\n        }\n\n        [Test]\n        public void ParsedToStringEqualsValue()\n        {\n            var value = SPY_Put_19550.ToString();\n            Log.Trace(value);\n            var sid2 = SecurityIdentifier.Parse(value);\n            Assert.AreEqual(SPY_Put_19550, sid2);\n        }\n\n        [Test]\n        public void ToStringPipeDelimitsUnderlying()\n        {\n            var actual = SPY_Put_19550.ToString();\n            var parts = actual.Split('|');\n            var option = SecurityIdentifier.Parse(parts[0]);\n            // verify various values\n            Assert.AreEqual(OptionRight.Put, option.OptionRight); // put\n            Assert.AreEqual(new DateTime(2015, 09, 18), option.Date); // oa date 2015.09.18\n            Assert.AreEqual(OptionStyle.European, option.OptionStyle); // option style\n            Assert.AreEqual(195.5m, option.StrikePrice); // strike/scale\n            Assert.AreEqual(Market.USA, option.Market); // market\n            Assert.AreEqual(SecurityType.Option, option.SecurityType); // security type\n            Assert.AreEqual(\"SPY\", option.Symbol); // SPY in base36\n            Assert.IsFalse(option.HasUnderlying);\n            Assert.Throws<InvalidOperationException>(() => { var x = option.Underlying; });\n            var equity = SecurityIdentifier.Parse(parts[1]);\n            Assert.AreEqual(SPY, equity);\n        }\n\n        [Test]\n        public void ReturnsCorrectMarket()\n        {\n            Assert.AreEqual(Market.USA, SPY.Market);\n        }\n\n        [Test]\n        public void ReturnsCorrectMarketWhenNotFound()\n        {\n            var sid = new SecurityIdentifier(\"some-symbol\", 0357960000000009901);\n            Assert.AreEqual(\"99\", sid.Market);\n        }\n\n        [Test]\n        public void InvalidSecurityType()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var sid = new SecurityIdentifier(\"some-symbol\", 0357960000000009915);\n            }, $\"The provided properties do not match with a valid {nameof(SecurityType)}\");\n        }\n\n        [TestCaseSource(nameof(ValidSecurityTypes))]\n        public void ValidSecurityType(ulong properties)\n        {\n            Assert.DoesNotThrow(() =>\n            {\n                var sid = new SecurityIdentifier(\"some-symbol\", properties);\n            });\n        }\n\n        [Test]\n        public void ReturnsCorrectOptionRight()\n        {\n            Assert.AreEqual(OptionRight.Put, SPY_Put_19550.OptionRight);\n        }\n\n        [Test]\n        public void OptionRightThrowsOnNonOptionSecurityType()\n        {\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                var OptionRight = SPY.OptionRight;\n            }, \"OptionRight is only defined for SecurityType.Option\");\n        }\n\n        [Test]\n        public void ReturnsCorrectSecurityType()\n        {\n            Assert.AreEqual(SecurityType.Equity, SPY.SecurityType);\n            Assert.AreEqual(SecurityType.Option, SPY_Put_19550.SecurityType);\n        }\n\n        [Test]\n        public void ReturnsCorrectSymbol()\n        {\n            Assert.AreEqual(\"SPY\", SPY.Symbol);\n        }\n\n        [Test]\n        public void ReturnsCorrectStrikePrice()\n        {\n            Assert.AreEqual(195.50m, SPY_Put_19550.StrikePrice);\n        }\n\n        [Test]\n        public void ReturnsCorrectDate()\n        {\n            Assert.AreEqual(new DateTime(1998, 01, 02), SPY.Date);\n            Assert.AreEqual(new DateTime(2015, 09, 18), SPY_Put_19550.Date);\n        }\n\n        [Test]\n        public void ReturnsCorrectOptionStyle()\n        {\n            Assert.AreEqual(OptionStyle.European, SPY_Put_19550.OptionStyle);\n        }\n\n        [Test]\n        public void OptionStyleThrowsOnNonOptionSecurityType()\n        {\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                var optionStyle = SPY.OptionStyle;\n            }, \"OptionStyle is only defined for SecurityType.Option\");\n        }\n\n        [Test]\n        public void EmptyUsesEmptySymbol()\n        {\n            Assert.AreEqual(string.Empty, SecurityIdentifier.Empty.Symbol);\n        }\n\n        [Test]\n        public void PreviousEmptyFormatStillSupported()\n        {\n            Assert.AreEqual(SecurityIdentifier.Empty, SecurityIdentifier.Parse(\" \"));\n        }\n\n        [Test]\n        public void RoundTripEmptyParse()\n        {\n            Assert.AreEqual(SecurityIdentifier.Empty, SecurityIdentifier.Parse(SecurityIdentifier.Empty.ToString()));\n        }\n\n        [Test]\n        public void RoundTripNoneParse()\n        {\n            Assert.AreEqual(SecurityIdentifier.None, SecurityIdentifier.Parse(SecurityIdentifier.None.ToString()));\n        }\n\n        [Test]\n        public void UsedAsDictionaryKey()\n        {\n            var hash = new HashSet<SecurityIdentifier>();\n            Assert.IsTrue(hash.Add(SPY));\n            Assert.IsFalse(hash.Add(SPY));\n        }\n\n        [Test]\n        public void SerializesToSimpleString()\n        {\n            var sid = SPY;\n            var str = sid.ToString();\n            var serialized = JsonConvert.SerializeObject(sid);\n            Assert.AreEqual(\"\\\"\" + str + \"\\\"\", serialized);\n        }\n\n        [Test]\n        public void DeserializesFromSimpleString()\n        {\n            var sid = SPY;\n            var str = \"\\\"\" + sid + \"\\\"\";\n            var deserialized = JsonConvert.DeserializeObject<SecurityIdentifier>(str);\n            Assert.AreEqual(sid, deserialized);\n        }\n\n        [Test]\n        public void DeserializesFromSimpleStringWithinContainerClass()\n        {\n            var sid = new Container{sid =SPY};\n            var str =\n@\"\n{\n    'sid': '\" + SPY + @\"'\n}\";\n            var deserialized = JsonConvert.DeserializeObject<Container>(str);\n            Assert.AreEqual(sid.sid, deserialized.sid);\n        }\n\n        [Test]\n        public void ParsesFromStringCorrectly()\n        {\n            const string value = \"SPY R735QTJ8XC9X\";\n            SecurityIdentifier sid;\n            Assert.IsTrue(SecurityIdentifier.TryParse(value, out sid));\n            Assert.AreEqual(sid.ToString(), value);\n        }\n\n        [TestCase(\"SPY WhatEver\")]\n        [TestCase(\"Sharpe ratio\")]\n        public void TryParseFailsInvalidProperties(string value)\n        {\n            Assert.IsFalse(SecurityIdentifier.TryParse(value, out var _));\n            // On the second call, we test the cache to increase speed and remove redundant logging\n            Assert.IsFalse(SecurityIdentifier.TryParse(value, out var _));\n        }\n\n        [Test, Category(\"TravisExclude\")]\n        public void ParsesFromStringFastEnough()\n        {\n            const string value = \"SPY R735QTJ8XC9X\";\n\n            var stopwatch = Stopwatch.StartNew();\n            for (var i = 0; i < 1000000; i++)\n            {\n                SecurityIdentifier sid;\n                SecurityIdentifier.TryParse(value, out sid);\n            }\n            stopwatch.Stop();\n            Log.Trace(\"Elapsed: \" + stopwatch.Elapsed);\n\n            Assert.Less(stopwatch.Elapsed, TimeSpan.FromSeconds(2));\n        }\n\n        [Test]\n        public void SupportsSpecialCharactersInSymbol()\n        {\n            const string symbol = \"~!@#$%^&*()_+¼»`ÆÜCⁿª▓G\";\n            var sid = new SecurityIdentifier(symbol, 0);\n            Assert.AreEqual(sid.Symbol, symbol);\n        }\n\n        [Theory, TestCase(\"|\"), TestCase(\" \")]\n        public void ThrowsOnInvalidSymbolCharacters(string input)\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                new SecurityIdentifier(input, 0);\n            }, \"must not contain the characters\");\n        }\n\n        [Test]\n        public void GenerateEquityWithTickerUsingMapFile()\n        {\n            var expectedFirstDate = new DateTime(1998, 1, 2);\n            var sid = SecurityIdentifier.GenerateEquity(\"TWX\", Market.USA, mapSymbol: true, mapFileProvider: TestGlobals.MapFileProvider);\n\n            Assert.AreEqual(sid.Date, expectedFirstDate);\n            Assert.AreEqual(sid.Symbol, \"AOL\");\n        }\n\n        [Test]\n        public void GenerateBaseDataWithTickerUsingMapFile()\n        {\n            var expectedFirstDate = new DateTime(1998, 1, 2);\n            var sid = SecurityIdentifier.GenerateBase(null, \"TWX\", Market.USA, mapSymbol: true);\n\n            Assert.AreEqual(sid.Date, expectedFirstDate);\n            Assert.AreEqual(sid.Symbol, \"AOL\");\n        }\n\n        [Test]\n        public void GenerateBase_SymbolAppendsDptTypeName_WhenBaseDataTypeIsNotNull()\n        {\n            var symbol = \"BTC\";\n            var expected = \"BTC.Bitcoin\";\n            var baseDataType = typeof(LiveTradingFeaturesAlgorithm.Bitcoin);\n            var sid = SecurityIdentifier.GenerateBase(baseDataType, symbol, Market.USA);\n            Assert.AreEqual(expected, sid.Symbol);\n        }\n\n        [Test]\n        public void GenerateBase_UsesProvidedSymbol_WhenBaseDataTypeIsNull()\n        {\n            var symbol = \"BTC\";\n            var expected = \"BTC\";\n            var baseDataType = (Type) null;\n            var sid = SecurityIdentifier.GenerateBase(baseDataType, symbol, Market.USA);\n            Assert.AreEqual(expected, sid.Symbol);\n        }\n\n        [Test]\n        public void DecimalStrikePriceRoundTrip()\n        {\n            var future = Symbol.CreateFuture(\n                \"CL\",\n                Market.NYMEX,\n                new DateTime(2020, 5, 20));\n\n            var option = Symbol.CreateOption(\n                future,\n                Market.NYMEX,\n                OptionStyle.American,\n                OptionRight.Call,\n                0.006425m,\n                new DateTime(2020, 4, 16));\n\n            Assert.AreEqual(0.006425m, option.ID.StrikePrice);\n\n            var newSid = SecurityIdentifier.Parse(option.ID.ToString());\n            Assert.AreEqual(0.006425m, newSid.StrikePrice);\n\n            var option2 = Symbol.CreateOption(\n                future,\n                Market.NYMEX,\n                OptionStyle.American,\n                OptionRight.Call,\n                0.0064m,\n                new DateTime(2020, 4, 16));\n\n            Assert.AreNotEqual(option2, option);\n        }\n\n        [Test]\n        public void NegativeStrikePriceRoundTrip()\n        {\n            var future = Symbol.CreateFuture(\n                \"CL\",\n                Market.NYMEX,\n                new DateTime(2020, 5, 20));\n\n            var option = Symbol.CreateOption(\n                future,\n                Market.NYMEX,\n                OptionStyle.American,\n                OptionRight.Call,\n                -50,\n                new DateTime(2020, 4, 16));\n\n            Assert.AreEqual(-50, option.ID.StrikePrice);\n\n            // Forces the reconstruction of the strike price to ensure that it's been properly parsed.\n            var newSid = SecurityIdentifier.Parse(option.ID.ToString());\n            Assert.AreEqual(-50, newSid.StrikePrice);\n        }\n\n        [TestCase(OptionStyle.American, OptionRight.Call, \"AAPL XEOLB4YAUINA|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.American, OptionRight.Put, \"AAPL 31DSLGKXI4C12|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.European, OptionRight.Call, \"AAPL XEOOUQW0NLD2|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.European, OptionRight.Put, \"AAPL 31DSP06V7XEQU|AAPL R735QTJ8XC9X\")]\n        public void SymbolHashForOptionsBackwardsCompatibilityWholeNumber(OptionStyle style, OptionRight right, string expected)\n        {\n            var equity = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var option = Symbol.CreateOption(\n                equity,\n                Market.USA,\n                style,\n                right,\n                100m,\n                new DateTime(2020, 5, 21));\n\n            Assert.AreEqual(expected, option.ID.ToString());\n            Assert.AreEqual(100m, option.ID.StrikePrice);\n        }\n\n        [TestCase(OptionStyle.American, OptionRight.Call, \"AAPL XEOLB4YALY06|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.American, OptionRight.Put, \"AAPL 31DSLGKXHVRDY|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.European, OptionRight.Call, \"AAPL XEOOUQW0F0PY|AAPL R735QTJ8XC9X\")]\n        [TestCase(OptionStyle.European, OptionRight.Put, \"AAPL 31DSP06V7OU3Q|AAPL R735QTJ8XC9X\")]\n        public void SymbolHashForOptionsBackwardsCompatibilityFractionalNumber(OptionStyle style, OptionRight right, string expected)\n        {\n            var equity = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var option = Symbol.CreateOption(\n                equity,\n                Market.USA,\n                style,\n                right,\n                0.01m, // strike decimal precision is limited to 4 decimal places only\n                new DateTime(2020, 5, 21));\n\n            Assert.AreEqual(expected, option.ID.ToString());\n            Assert.AreEqual(0.01m, option.ID.StrikePrice);\n        }\n\n        [Test]\n        public void SymbolHashForOptionsBackwardsCompatibilityLargeFractionalNumberDoesNotThrow()\n        {\n            Assert.DoesNotThrow(() =>\n            {\n                var equity = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n                var option = Symbol.CreateOption(\n                    equity,\n                    Market.USA,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    3600.75m, // strike decimal precision is limited to 4 decimal places only\n                    new DateTime(2020, 5, 21));\n            });\n        }\n\n        [TestCase(\"-475711\")]\n        [TestCase(\"475711\")]\n        [TestCase(\"47.5711\")]\n        [TestCase(\"-47.5711\")]\n        public void NumberStrikePriceApproachesBoundsWithoutOverflowingSid(string strikeStr)\n        {\n            var strike = decimal.Parse(strikeStr, CultureInfo.InvariantCulture);\n            var equity = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var option = Symbol.CreateOption(\n                equity,\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                strike,\n                new DateTime(2020, 5, 21));\n\n            // The SID specification states that the total width for the properties value\n            // is at most 20 digits long. If we overflowed the SID, the strike price can and will\n            // eat from other slots, corrupting the data. If we have no overflow, the SID will\n            // be constructed properly without corrupting any data, even as we approach the bounds.\n            // We will assert that all properties contained within the _properties field are valid and not corrupted\n            var sid = SecurityIdentifier.Parse(option.ID.ToString());\n\n            Assert.AreEqual(new DateTime(2020, 5, 21), sid.Date);\n            Assert.AreEqual(strike, sid.StrikePrice);\n            Assert.AreEqual(OptionRight.Call, sid.OptionRight);\n            Assert.AreEqual(OptionStyle.American, sid.OptionStyle);\n            Assert.AreEqual(Market.USA, sid.Market);\n            Assert.AreEqual(SecurityType.Option, sid.SecurityType);\n\n            Assert.AreEqual(option.ID.Date,sid.Date);\n            Assert.AreEqual(option.ID.StrikePrice, sid.StrikePrice);\n            Assert.AreEqual(option.ID.OptionRight, sid.OptionRight);\n            Assert.AreEqual(option.ID.OptionStyle, sid.OptionStyle);\n            Assert.AreEqual(option.ID.Market, sid.Market);\n            Assert.AreEqual(option.ID.SecurityType, sid.SecurityType);\n        }\n\n        [TestCase(475712.0)]\n        [TestCase(47.5712)]\n        [TestCase(999999.0)]\n        [TestCase(-475712.0)]\n        [TestCase(-47.5712)]\n        [TestCase(-999999)]\n        public void HighPrecisionNumberThrows(double strike)\n        {\n            var equity = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            Assert.Throws<ArgumentException>(() =>\n            {\n                Symbol.CreateOption(\n                    equity,\n                    Market.USA,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    (decimal)strike, // strike decimal precision is limited to 4 decimal places only\n                    new DateTime(2020, 5, 21));\n            });\n        }\n\n        [Test, Ignore(\"Requires complete option data to validate chain\")]\n        public void ValidateAAPLOptionChainSecurityIdentifiers()\n        {\n            var chainProvider = new BacktestingOptionChainProvider();\n            chainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n            var aapl = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var chains = new HashSet<Symbol>();\n            var expectedChains = File.ReadAllLines(\"TestData/aapl_chain.csv\")\n                .Where(x => !string.IsNullOrWhiteSpace(x))\n                .ToDictionary(x => x, _ => false);\n\n            Assert.AreNotEqual(0, expectedChains.Count);\n\n            var start = new DateTime(2020, 1, 1);\n            var end = new DateTime(2020, 7, 1);\n\n            foreach (var date in Time.EachDay(start, end))\n            {\n                if (MarketHoursDatabase.FromDataFolder()\n                        .GetEntry(Market.USA, (string)null, SecurityType.Equity)\n                        .ExchangeHours\n                        .Holidays.Contains(date) || date.DayOfWeek == DayOfWeek.Saturday || date.DayOfWeek == DayOfWeek.Sunday)\n                {\n                    continue;\n                }\n\n                foreach (var symbol in chainProvider.GetOptionContractList(aapl, date))\n                {\n                    chains.Add(symbol);\n                }\n            }\n\n            var fails = new HashSet<Symbol>();\n            foreach (var chain in chains)\n            {\n                if (expectedChains.ContainsKey(chain.ID.ToString()))\n                {\n                    expectedChains[chain.ID.ToString()] = true;\n                    continue;\n                }\n\n                fails.Add(chain);\n            }\n\n            Assert.AreEqual(0, fails.Count, $\"The following option Symbols were not found in the expected chain:    \\n{string.Join(\"\\n\", fails.Select(x => x.ID.ToString()))}\");\n            Assert.IsTrue(expectedChains.All(kvp => kvp.Value), $\"The following option Symbols were not loaded:    \\n{string.Join(\"\\n\", expectedChains.Where(kvp => !kvp.Value).Select(x => x.Key))}\");\n        }\n\n        [Test]\n        public void SortsAccordingToStringRepresentation()\n        {\n            var sids = Symbols.All.ToList(s => s.ID);\n            var expected = sids\n                .Select(sid => new {symbol = sid, str = sid.ToString()})\n                .OrderBy(item => item.str)\n                .ToList(item => item.symbol);\n\n            sids.Sort();\n\n            CollectionAssert.AreEqual(expected, sids);\n        }\n\n        [TestCaseSource(nameof(ReturnsExpectedCustomDataTypeTestCases))]\n        public void ReturnsExpectedCustomDataType(string symbol, Type expectedDataType)\n        {\n            SecurityIdentifier.GenerateBaseSymbol(expectedDataType, symbol.Split(\".\")[0]);\n            var result = SecurityIdentifier.TryGetCustomDataTypeInstance(symbol, out var obtainedDataType);\n\n            Assert.AreEqual(expectedDataType, obtainedDataType);\n        }\n\n        public static object[] ReturnsExpectedCustomDataTypeTestCases =\n        {\n            new object[] {\"BTC.Bitcoin\", typeof(CustomDataBitcoinAlgorithm.Bitcoin)},\n            new object[] {\"AAPL.FundamentalUniverse\", typeof(FundamentalUniverse)},\n            new object[] {\"AAPL.PlaceHolder\", typeof(PlaceHolder)},\n            new object[] {\"AAPL.LinkedData\", typeof(LinkedData)},\n            new object[] {\"AAPL.UnlinkedData\", typeof(UnlinkedData)},\n            new object[] {\"AAPL.UnlinkedDataTradeBar\", typeof(UnlinkedDataTradeBar)},\n            new object[] {\"AAPL.IndexedLinkedData\", typeof(IndexedLinkedData)},\n            new object[] {\"AAPL.IndexedLinkedData2\", typeof(IndexedLinkedData2)},\n            new object[] {\"AAPL.IntrinioEconomicDataSources\", typeof(IntrinioEconomicDataSources)},\n            new object[] {\"AAPL.IntrinioEconomicData\", typeof(IntrinioEconomicData)},\n            new object[] {\"AAPL.FxcmVolume\", typeof(FxcmVolume)},\n            new object[] {\"AAPL.Tiingo\", typeof(Tiingo)},\n            new object[] {\"AAPL.TiingoDailyData\", typeof(TiingoDailyData)},\n            new object[] {\"AAPL.TiingoPrice\", typeof(TiingoPrice)},\n        };\n\n        class Container\n        {\n            public SecurityIdentifier sid;\n        }\n        private static List<TestCaseData> ValidSecurityTypes =>\n            (from object value in Enum.GetValues(typeof(SecurityType)) select new TestCaseData((ulong)(0357960000000009900 + (int)value))).ToList();\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityManagerTests\n    {\n        private SubscriptionManager _subscriptionManager;\n\n        [SetUp]\n        public void Setup()\n        {\n            SymbolCache.Clear();\n\n            var timeKeeper = new TimeKeeper(new DateTime(2015, 12, 07));\n            _subscriptionManager = new SubscriptionManager(NullTimeKeeper.Instance);\n            _subscriptionManager.SetDataManager(new DataManagerStub(timeKeeper));\n        }\n\n        [Test]\n        public void NotifiesWhenSecurityAdded()\n        {\n            var timeKeeper = new TimeKeeper(new DateTime(2015, 12, 07));\n            var manager = new SecurityManager(timeKeeper);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.NewItems.OfType<object>().Single() != security)\n                {\n                    Assert.Fail(\"Expected args.NewItems to have exactly one element equal to security\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Add);\n                    Assert.Pass();\n                }\n            };\n\n            manager.Add(security.Symbol, security);\n        }\n\n        [Test]\n        public void NotifiesWhenSecurityAddedViaIndexer()\n        {\n            var timeKeeper = new TimeKeeper(new DateTime(2015, 12, 07));\n            var manager = new SecurityManager(timeKeeper);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.NewItems.OfType<object>().Single() != security)\n                {\n                    Assert.Fail(\"Expected args.NewItems to have exactly one element equal to security\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Add);\n                    Assert.Pass();\n                }\n            };\n\n            manager[security.Symbol] = security;\n        }\n\n        [Test]\n        public void NotifiesWhenSecurityRemoved()\n        {\n            var timeKeeper = new TimeKeeper(new DateTime(2015, 12, 07));\n            var manager = new SecurityManager(timeKeeper);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            manager.Add(security.Symbol, security);\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.OldItems.OfType<object>().Single() != security)\n                {\n                    Assert.Fail(\"Expected args.NewItems to have exactly one element equal to security\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Remove);\n                    Assert.Pass();\n                }\n            };\n\n            manager.Remove(security.Symbol);\n        }\n\n\n        [Test]\n        public void Option_SubscriptionDataConfigList_CanOnlyHave_RawDataNormalization()\n        {\n            var option = new Symbol(SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, Symbols.SPY.ID, Market.USA, 0, default(OptionRight), default(OptionStyle)), \"?SPY\");\n\n            var subscriptionDataConfigList = new SubscriptionDataConfigList(option);\n\n            Assert.DoesNotThrow(() => { subscriptionDataConfigList.SetDataNormalizationMode(DataNormalizationMode.Raw); });\n\n            Assert.Throws(typeof(ArgumentException), () => { subscriptionDataConfigList.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { subscriptionDataConfigList.SetDataNormalizationMode(DataNormalizationMode.SplitAdjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { subscriptionDataConfigList.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { subscriptionDataConfigList.SetDataNormalizationMode(DataNormalizationMode.TotalReturn); });\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig()\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityMarginModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Orders;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing Option = QuantConnect.Securities.Option.Option;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityMarginModelTests\n    {\n        private static Symbol _symbol;\n        private static FakeOrderProcessor _fakeOrderProcessor;\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(50)]\n        public void MarginRemainingForLeverage(decimal leverage)\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.SetCash(1000);\n\n            var spy = InitAndGetSecurity(algorithm, 0);\n            spy.Holdings.SetHoldings(25, 100);\n            spy.SetLeverage(leverage);\n\n            var spyMarginAvailable = spy.Holdings.HoldingsValue - spy.Holdings.HoldingsValue * (1 / leverage);\n\n            var marginRemaining = algorithm.Portfolio.MarginRemaining;\n            Assert.AreEqual(1000 + spyMarginAvailable, marginRemaining);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(50)]\n        public void MarginUsedForPositionWhenPriceDrops(decimal leverage)\n        {\n            var algorithm = GetAlgorithm();\n\n            // (1000 * 20) = 20k\n            // Initial and maintenance margin = (1000 * 20) / leverage = X\n            var spy = InitAndGetSecurity(algorithm, 0);\n            spy.Holdings.SetHoldings(20, 1000);\n            spy.SetLeverage(leverage);\n\n            // Drop 40% price from $20 to $12\n            // 1000 * 12 = 12k\n            Update(spy, 12);\n\n            var marginForPosition = spy.BuyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(spy)).AbsoluteUsedBuyingPower;\n            Assert.AreEqual(1000 * 12 / leverage, marginForPosition);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(50)]\n        public void MarginUsedForPositionWhenPriceIncreases(decimal leverage)\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.SetCash(1000);\n\n            // (1000 * 20) = 20k\n            // Initial and maintenance margin = (1000 * 20) / leverage = X\n            var spy = InitAndGetSecurity(algorithm, 0);\n            spy.Holdings.SetHoldings(25, 1000);\n            spy.SetLeverage(leverage);\n\n            // Increase from $20 to $40\n            // 1000 * 40 = 400000\n            Update(spy, 40);\n\n            var marginForPosition = spy.BuyingPowerModel.GetReservedBuyingPowerForPosition(\n                new ReservedBuyingPowerForPositionParameters(spy)).AbsoluteUsedBuyingPower;\n            Assert.AreEqual(1000 * 40 / leverage, marginForPosition);\n        }\n\n        [Test]\n        public void ZeroTargetWithZeroHoldingsIsNotAnError()\n        {\n            var algorithm = GetAlgorithm();\n            var security = InitAndGetSecurity(algorithm, 0);\n\n            var model = new SecurityMarginModel();\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, security, 0, 0);\n\n            Assert.AreEqual(0, result.Quantity);\n            Assert.IsTrue(result.Reason.IsNullOrEmpty());\n            Assert.IsFalse(result.IsError);\n        }\n\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void ReturnsMinimumOrderValueReason(decimal holdings)\n        {\n            var algorithm = GetAlgorithm();\n            var security = InitAndGetSecurity(algorithm, 0);\n            var model = new SecurityMarginModel();\n            security.Holdings.SetHoldings(security.Price, holdings);\n            var currentSignedUsedMargin = model.GetInitialMarginRequirement(security, security.Holdings.Quantity);\n            var totalPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;\n            var sign = Math.Sign(security.Holdings.Quantity) == 0 ? 1 : Math.Sign(security.Holdings.Quantity);\n            // we increase it slightly, should not trigger a new order because it's increasing final margin usage, rounds down\n            var newTarget = currentSignedUsedMargin / (totalPortfolioValue) + 0.00001m * sign;\n\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, security, newTarget, 0);\n            Assert.AreEqual(0m, result.Quantity);\n            Assert.IsFalse(result.IsError);\n            Assert.IsTrue(result.Reason.Contains(\"The order quantity is less than the lot size of\", StringComparison.InvariantCultureIgnoreCase));\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void ReducesPositionWhenMarginAboveTargetWhenNegativeFreeMargin(decimal holdings)\n        {\n            var algorithm = GetAlgorithm();\n            var security = InitAndGetSecurity(algorithm, 0);\n            var model = new SecurityMarginModel();\n            security.Holdings.SetHoldings(security.Price, holdings);\n\n            var security2 = InitAndGetSecurity(algorithm, 0, symbol: \"AAPL\");\n            // eat up all our TPV\n            security2.Holdings.SetHoldings(security.Price, (algorithm.Portfolio.TotalPortfolioValue / security.Price) * 2);\n\n            var currentSignedUsedMargin = model.GetInitialMarginRequirement(security, security.Holdings.Quantity);\n            var totalPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;\n            var sign = Math.Sign(security.Holdings.Quantity) == 0 ? 1 : Math.Sign(security.Holdings.Quantity);\n            // we inverse the sign here so that new target is less than current, we expect a reduction\n            var newTarget = currentSignedUsedMargin / (totalPortfolioValue) + 0.00001m * sign * -1;\n\n            Assert.IsTrue(0 > algorithm.Portfolio.MarginRemaining);\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, security, newTarget, 0);\n            // Reproduces GH issue #5763 a small Reduction in the target should reduce the position\n            Assert.AreEqual(1m * sign * -1, result.Quantity);\n            Assert.IsFalse(result.IsError);\n        }\n\n        [TestCase(1, 0)]\n        [TestCase(-1, 0)]\n        [TestCase(1, 0.001d)]\n        [TestCase(-1, 0.001d)]\n        public void ReducesPositionWhenMarginAboveTargetBasedOnSetting(decimal holdings, decimal minimumOrderMarginPortfolioPercentage)\n        {\n            var algorithm = GetAlgorithm();\n            var security = InitAndGetSecurity(algorithm, 0);\n            var model = new SecurityMarginModel();\n            security.Holdings.SetHoldings(security.Price, holdings);\n\n            var currentSignedUsedMargin = model.GetInitialMarginRequirement(security, security.Holdings.Quantity);\n            var totalPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;\n            var sign = Math.Sign(security.Holdings.Quantity) == 0 ? 1 : Math.Sign(security.Holdings.Quantity);\n            // we inverse the sign here so that new target is less than current, we expect a reduction\n            var newTarget = currentSignedUsedMargin / (totalPortfolioValue) + 0.00001m * sign * -1;\n\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, security, newTarget, minimumOrderMarginPortfolioPercentage);\n\n            if (minimumOrderMarginPortfolioPercentage == 0)\n            {\n                // Reproduces GH issue #5763 a small Reduction in the target should reduce the position\n                Assert.AreEqual(1m * sign * -1, result.Quantity);\n                Assert.IsFalse(result.IsError);\n            }\n            else\n            {\n                Assert.AreEqual(0, result.Quantity);\n                Assert.IsFalse(result.IsError);\n            }\n        }\n\n        [Test]\n        public void ZeroTargetWithNonZeroHoldingsReturnsNegativeOfQuantity()\n        {\n            var algorithm = GetAlgorithm();\n            var security = InitAndGetSecurity(algorithm, 0);\n            security.Holdings.SetHoldings(200, 10);\n\n            var model = new SecurityMarginModel();\n            var result = model.GetMaximumOrderQuantityForTargetBuyingPower(algorithm.Portfolio, security, 0, 0);\n\n            Assert.AreEqual(-10, result.Quantity);\n            Assert.IsTrue(result.Reason.IsNullOrEmpty());\n            Assert.IsFalse(result.IsError);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullLong()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            // (100000 * 2 * 0.9975 setHoldingsBuffer) / 25 - fee ~=7979m\n            Assert.AreEqual(7979m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullLong_NonAccountCurrency_ZeroQuoteCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            // We don't have quote currency - we will get a \"loan\"\n            algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            // (10000 * 2 * 0.9975 setHoldingsBuffer) / 25 * 0.88 conversion rate - 5 USD fee * 0.88 conversion rate ~=906m\n            Assert.AreEqual(906m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [TestCase(\"Long\")]\n        [TestCase(\"Short\")]\n        public void GetReservedBuyingPowerForPosition_NonAccountCurrency_ZeroQuoteCurrency(string position)\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n            security.Holdings.SetHoldings(security.Price,\n                (position == \"Long\" ? 1 : -1) * 100);\n\n            var actual = security.BuyingPowerModel.GetReservedBuyingPowerForPosition(new ReservedBuyingPowerForPositionParameters(security));\n            // 100quantity * 25price * 0.88rate * 0.5 MaintenanceMarginRequirement = 1100\n            Assert.AreEqual(1100, actual.AbsoluteUsedBuyingPower);\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullLong_NonAccountCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            // We have 1000 USD too\n            algorithm.Portfolio.SetCash(Currencies.USD, 1000, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            // ((10000 + 1000 USD * 0.88 rate) * 2 * 0.9975 setHoldingsBuffer) / 25 * 0.88 rate - 5 USD fee * 0.88 rate ~=986m\n            Assert.AreEqual(986m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [Test]\n        public void SetHoldings_Long_TooBigOfATarget()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security) + 0.1m);\n            // (100000 * 2.1* 0.9975 setHoldingsBuffer) / 25 - fee ~=8378m\n            Assert.AreEqual(8378m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_Long_TooBigOfATarget_NonAccountCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            // We don't have quote currency - we will get a \"loan\"\n            algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security) + 0.1m);\n            // (10000 * 2.1 * 0.9975 setHoldingsBuffer) / 25 * 0.88 conversion rate - 5 USD fee * 0.88 conversion rate ~=951m\n            Assert.AreEqual(951m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullShort()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security));\n            // (100000 * 2 * 0.9975 setHoldingsBuffer) / 25 - fee~=-7979m\n            Assert.AreEqual(-7979m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullShort_NonAccountCurrency_ZeroQuoteCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security));\n            // (10000 * - 2 * 0.9975 setHoldingsBuffer) / 25 * 0.88 conversion rate - 5 USD fee * 0.88 conversion rate ~=906m\n            Assert.AreEqual(-906m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullShort_NonAccountCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            algorithm.Portfolio.SetCash(Currencies.USD, 1000, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security));\n            // ((10000 + 1000 * 0.88)* - 2 * 0.9975 setHoldingsBuffer) / 25 * 0.88 conversion rate - 5 USD fee * 0.88 conversion rate ~=986m\n            Assert.AreEqual(-986m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [Test]\n        public void SetHoldings_Short_TooBigOfATarget()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security) - 0.1m);\n            // (100000 * - 2.1m * 0.9975 setHoldingsBuffer) / 25 - fee~=-8378m\n            Assert.AreEqual(-8378m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_Short_TooBigOfATarget_NonAccountCurrency()\n        {\n            var algorithm = GetAlgorithm();\n            algorithm.Portfolio.CashBook.Clear();\n            algorithm.Portfolio.SetAccountCurrency(\"EUR\");\n            algorithm.Portfolio.SetCash(10000);\n            algorithm.Portfolio.SetCash(Currencies.USD, 0, 0.88m);\n            var security = InitAndGetSecurity(algorithm, 5);\n\n            algorithm.Settings.FreePortfolioValue =\n                algorithm.Portfolio.TotalPortfolioValue * algorithm.Settings.FreePortfolioValuePercentage;\n\n            var actual = algorithm.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security) - 0.1m);\n            // (10000 * - 2.1 * 0.9975 setHoldingsBuffer) / 25 * 0.88 conversion rate - 5 USD fee * 0.88 conversion rate ~=951m\n            Assert.AreEqual(-951m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algorithm));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullLong_NoFee()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            // (100000 * 2 * 0.9975 setHoldingsBuffer) / 25 =7980m\n            Assert.AreEqual(7980m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_Long_TooBigOfATarget_NoFee()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security) + 0.1m);\n            // (100000 * 2.1m* 0.9975 setHoldingsBuffer) / 25 = 8379m\n            Assert.AreEqual(8379m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_ZeroToFullShort_NoFee()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security));\n            var order = new MarketOrder(_symbol, actual, DateTime.UtcNow);\n            // (100000 * 2 * 0.9975 setHoldingsBuffer) / 25 = -7980m\n            Assert.AreEqual(-7980m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void SetHoldings_Short_TooBigOfATarget_NoFee()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * security.BuyingPowerModel.GetLeverage(security) - 0.1m);\n            // (100000 * -2.1 * 0.9975 setHoldingsBuffer) / 25 =  -8379m\n            Assert.AreEqual(-8379m, actual);\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual, security, algo));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentDefault_Equity()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var model = security.BuyingPowerModel;\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 2 * 0.9975) / 25 - 1 order due to fees\n            Assert.AreEqual(7979m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.AreEqual(algo.Portfolio.Cash, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForCashAccount_Equity()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(1, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 1 * 0.95 * 0.9975) / 25 - 1 order due to fees\n            Assert.AreEqual(3790m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual * 1.0025m, security, algo));\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual * 1.0025m + security.SymbolProperties.LotSize + 9, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForMarginAccount_Equity()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(2, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 2 * 0.95 * 0.9975) / 25 - 1 order due to fees\n            Assert.AreEqual(7580m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual * 1.0025m, security, algo));\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual * 1.0025m + security.SymbolProperties.LotSize + 9, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentCashAccountWithLongHoldings_Equity()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(1, requiredFreeBuyingPowerPercent);\n            security.Holdings.SetHoldings(25, 2000);\n            security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(algo.Portfolio, security, DateTime.UtcNow.AddDays(-10), new CashAmount(-2000 * 25, Currencies.USD), null));\n\n            // Margin remaining 50k + used 50k + initial margin 50k - 5k free buying power percent (5% of 100k)\n            Assert.AreEqual(145000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Sell));\n            // Margin remaining 50k - 5k free buying power percent (5% of 100k)\n            Assert.AreEqual(45000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * model.GetLeverage(security));\n            // ((100k - 5) * -1 * 0.95 * 0.9975 - (50k holdings)) / 25 - 1 order due to fees\n            Assert.AreEqual(-5790m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual * 1.0025m, security, algo));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentMarginAccountWithLongHoldings_Equity()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(2, requiredFreeBuyingPowerPercent);\n            security.Holdings.SetHoldings(25, 2000);\n            security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(algo.Portfolio, security, DateTime.UtcNow.AddDays(-10), new CashAmount(-2000 * 25, Currencies.USD), null));\n\n            // Margin remaining 75k + used 25k + initial margin 25k - 5k free buying power percent (5% of 100k)\n            Assert.AreEqual(120000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Sell));\n            // Margin remaining 75k - 5k free buying power percent\n            Assert.AreEqual(70000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n\n            var actual = algo.CalculateOrderQuantity(_symbol, -1m * model.GetLeverage(security));\n            // ((100k - 5) * -2 * 0.95 * 0.9975 - (50k holdings)) / 25 - 1 order due to fees\n            Assert.AreEqual(-9580m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual * 1.0025m, security, algo));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentMarginAccountWithShortHoldings_Equity()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Equity);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(2, requiredFreeBuyingPowerPercent);\n            security.Holdings.SetHoldings(25, -2000);\n            security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(algo.Portfolio, security, DateTime.UtcNow.AddDays(-10), new CashAmount(2000 * 25, Currencies.USD), null));\n\n            // Margin remaining 75k + used 25k + initial margin 25k - 5k free buying power percent (5% of 100k)\n            Assert.AreEqual(120000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n            // Margin remaining 75k - 5k free buying power percent\n            Assert.AreEqual(70000, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Sell));\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // ((100k - 5) * 2 * 0.95 * 0.9975 - (-50k holdings)) / 25 - 1 order due to fees\n            Assert.AreEqual(9580m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.IsFalse(HasSufficientBuyingPowerForOrder(actual * 1.0025m, security, algo));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentDefault_Option()\n        {\n            const decimal price = 25m;\n            const decimal underlyingPrice = 25m;\n\n            var tz = TimeZones.NewYork;\n            var equity = new QuantConnect.Securities.Equity.Equity(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var optionPutSymbol = Symbol.CreateOption(Symbols.SPY, Market.USA, OptionStyle.American, OptionRight.Put, 207m, new DateTime(2015, 02, 27));\n            var security = new Option(\n                SecurityExchangeHours.AlwaysOpen(tz),\n                new SubscriptionDataConfig(typeof(TradeBar), optionPutSymbol, Resolution.Minute, tz, tz, true, false, false),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(\"\", Currencies.USD, 100, 0.01m, 1),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            security.SetMarketPrice(new Tick { Value = price });\n            security.Underlying = equity;\n\n            var algo = GetAlgorithm();\n            security.SetLocalTimeKeeper(algo.TimeKeeper.GetLocalTimeKeeper(tz));\n            var actual = security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(\n                new GetMaximumOrderQuantityForTargetBuyingPowerParameters(algo.Portfolio, security, 1, 0)).Quantity;\n\n            // (100000 * 1) / (25 * 100 contract multiplier) - 1 order due to fees\n            Assert.AreEqual(39m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.AreEqual(algo.Portfolio.Cash, security.BuyingPowerModel.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForCashAccount_Option()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Option);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(1, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 1 * 0.95) / (25 * 100 contract multiplier) - 1 order due to fees\n            Assert.AreEqual(37m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForMarginAccount_Option()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Option);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(2, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 2 * 0.95) / (25 * 100 contract multiplier) - 1 order due to fees\n            Assert.AreEqual(75m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentDefault_Future()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Future, \"ES\", time: new DateTime(2020, 1, 27));\n            var model = security.BuyingPowerModel;\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // (100000 * 1 * 0.9975 ) / 6600 - 1 order due to fees\n            Assert.AreEqual(13m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            Assert.AreEqual(algo.Portfolio.Cash, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForCashAccount_Future()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Future);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(1, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // ((100000 - 5) * 1 * 0.95 * 0.9975 / (25 * 50)\n            Assert.AreEqual(75m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [Test]\n        public void FreeBuyingPowerPercentAppliesForMarginAccount_Future()\n        {\n            var algo = GetAlgorithm();\n            algo.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);\n            var security = InitAndGetSecurity(algo, 5, SecurityType.Future);\n            var requiredFreeBuyingPowerPercent = 0.05m;\n            var model = security.BuyingPowerModel = new SecurityMarginModel(2, requiredFreeBuyingPowerPercent);\n\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * model.GetLeverage(security));\n            // ((100000 - 5) * 2 * 0.95 * 0.9975 / (25 * 50)\n            Assert.AreEqual(151m, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n            var expectedBuyingPower = algo.Portfolio.Cash * (1 - requiredFreeBuyingPowerPercent);\n            Assert.AreEqual(expectedBuyingPower, model.GetBuyingPower(algo.Portfolio, security, OrderDirection.Buy));\n        }\n\n        [TestCase(0)]\n        [TestCase(10000)]\n        public void NonAccountCurrency_GetBuyingPower(decimal nonAccountCurrencyCash)\n        {\n            var algo = GetAlgorithm();\n            algo.Portfolio.CashBook.Clear();\n            algo.Portfolio.SetAccountCurrency(\"EUR\");\n            algo.Portfolio.SetCash(10000);\n            algo.Portfolio.SetCash(Currencies.USD, nonAccountCurrencyCash, 0.88m);\n            var security = InitAndGetSecurity(algo, 0);\n            Assert.AreEqual(10000m + algo.Portfolio.CashBook[Currencies.USD].ValueInAccountCurrency,\n                algo.Portfolio.TotalPortfolioValue);\n\n            var quantity = security.BuyingPowerModel.GetBuyingPower(\n                new BuyingPowerParameters(algo.Portfolio, security, OrderDirection.Buy)).Value;\n\n            Assert.AreEqual(10000m + algo.Portfolio.CashBook[Currencies.USD].ValueInAccountCurrency,\n                quantity);\n        }\n\n        [Test]\n        public void NonAccountCurrencyFees()\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n            algo.SetCash(\"EUR\", 0, 100);\n            security.FeeModel = new NonAccountCurrencyCustomFeeModel();\n\n            // ((100000 - 100 * 100) * 2 * 0.9975 / (25)\n            var actual = algo.CalculateOrderQuantity(_symbol, 1m * security.BuyingPowerModel.GetLeverage(security));\n            Assert.AreEqual(7182m, actual);\n            // ((100000 - 100 * 100) * 2 / (25)\n            var quantity = security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(\n                algo.Portfolio, security, 1m, 0).Quantity;\n            Assert.AreEqual(7200m, quantity);\n\n            // the maximum order quantity can be executed\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(quantity, security, algo)); ;\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void GetMaximumOrderQuantityForTargetDeltaBuyingPower_NoHoldings(int side)\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n\n            // we use our entire buying power\n            var buyingPower = algo.Portfolio.MarginRemaining * side;\n            var actual = security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(\n                new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(algo.Portfolio,\n                    security,\n                    buyingPower,\n                    0)).Quantity;\n\n            // (100000 * 2 ) / 25 =8k - 1 fees\n            Assert.AreEqual(7999 * side, actual);\n        }\n\n        [TestCase(100, 510, false)]\n        [TestCase(-100, 510, false)]\n        [TestCase(-100, 50000, true)]\n        [TestCase(100, -510, false)]\n        [TestCase(-100, -510, false)]\n        [TestCase(100, -50000, true)]\n        public void GetMaximumOrderQuantityForTargetDeltaBuyingPower_WithHoldings(decimal quantity, decimal buyingPowerDelta, bool invertsSide)\n        {\n            // TPV = 100k\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 0);\n\n            // SPY @ $25 * Quantity Shares = Holdings\n            // Quantity = 100 -> 2500; TPV = 102500\n            // Quantity = -100 -> -2500; TPV = 97500\n            security.Holdings.SetHoldings(security.Price, quantity);\n\n            // Used Buying Power = Holdings / Leverage\n            // Target BP = Used BP + buyingPowerDelta\n            // Target Holdings = Target BP / Unit\n            // Max Order For Delta BP = Target Holdings - Current Holdings\n\n            // EX. -100 Quantity, 510 BP Delta.\n            // Used BP = -2500 / 2 = -1250\n            // Target BP = -1250 + 510 = -740\n            // Target Holdings = -740 / 12.5 = -59.2 -> ~-59\n            // Max Order = -59 - (-100)  = 41\n            var actual = security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(\n                new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(algo.Portfolio,\n                    security,\n                    buyingPowerDelta,\n                    0)).Quantity;\n\n            // Calculate expected using logic above\n            var targetBuyingPower = ((quantity * (security.Price / security.Leverage)) + buyingPowerDelta);\n            var targetHoldings = (targetBuyingPower / (security.Price / security.Leverage));\n            targetHoldings -= (targetHoldings % security.SymbolProperties.LotSize);\n\n            var expectedQuantity = targetHoldings - quantity;\n\n\n            Assert.AreEqual(expectedQuantity, actual);\n            Assert.IsTrue(HasSufficientBuyingPowerForOrder(actual, security, algo));\n\n            if (invertsSide)\n            {\n                Assert.AreNotEqual(Math.Sign(quantity), Math.Sign(actual));\n            }\n        }\n\n        [TestCase(true, 1, 1)]\n        [TestCase(true, 1, -1)]\n        [TestCase(true, -1, -1)]\n        [TestCase(true, -1, 1)]\n        // reducing the position to target 0 is valid\n        [TestCase(false, 0, -1)]\n        [TestCase(false, 0, 1)]\n        public void NegativeMarginRemaining(bool isError, int target, int side)\n        {\n            var algo = GetAlgorithm();\n            var security = InitAndGetSecurity(algo, 5);\n            security.Holdings.SetHoldings(security.Price, 1000 * side);\n            algo.Portfolio.CashBook.Add(algo.AccountCurrency, -100000, 1);\n            var fakeOrderProcessor = new FakeOrderProcessor();\n            algo.Transactions.SetOrderProcessor(fakeOrderProcessor);\n\n            Assert.IsTrue(algo.Portfolio.MarginRemaining < 0);\n\n            var quantity = security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(\n                new GetMaximumOrderQuantityForTargetBuyingPowerParameters(algo.Portfolio,\n                    security,\n                    target * side,\n                    0)).Quantity;\n            if (!isError)\n            {\n                Assert.AreEqual(1000 * side * -1, quantity);\n            }\n            else\n            {\n                // even if we don't have margin 'GetMaximumOrderQuantityForTargetBuyingPower' doesn't care\n                Assert.AreNotEqual(0, quantity);\n            }\n\n            var order = new MarketOrder(security.Symbol, quantity, new DateTime(2020, 1, 1));\n            fakeOrderProcessor.AddTicket(order.ToOrderTicket(algo.Transactions));\n            var actual = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(\n                new HasSufficientBuyingPowerForOrderParameters(algo.Portfolio,\n                    security,\n                    order));\n            Assert.AreEqual(!isError, actual.IsSufficient);\n        }\n\n        private static QCAlgorithm GetAlgorithm()\n        {\n            SymbolCache.Clear();\n            // Initialize algorithm\n            var algo = new QCAlgorithm();\n            algo.SetFinishedWarmingUp();\n            _fakeOrderProcessor = new FakeOrderProcessor();\n            algo.Transactions.SetOrderProcessor(_fakeOrderProcessor);\n            return algo;\n        }\n\n        private static Security InitAndGetSecurity(QCAlgorithm algo, decimal fee, SecurityType securityType = SecurityType.Equity, string symbol = \"SPY\", DateTime? time = null)\n        {\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            Security security;\n            if (securityType == SecurityType.Equity)\n            {\n                security = algo.AddEquity(symbol);\n                _symbol = security.Symbol;\n            }\n            else if (securityType == SecurityType.Option)\n            {\n                security = algo.AddOption(symbol);\n                _symbol = security.Symbol;\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                security = algo.AddFuture(symbol == \"SPY\" ? \"ES\" : symbol);\n                _symbol = security.Symbol;\n            }\n            else\n            {\n                throw new Exception(\"SecurityType not implemented\");\n            }\n\n            security.FeeModel = new ConstantFeeModel(fee);\n            Update(security, 25, time);\n            return security;\n        }\n\n        private static void Update(Security security, decimal close, DateTime? time = null)\n        {\n            security.SetMarketPrice(new TradeBar\n            {\n                Time = time ?? DateTime.Now,\n                Symbol = security.Symbol,\n                Open = close,\n                High = close,\n                Low = close,\n                Close = close\n            });\n        }\n\n        private bool HasSufficientBuyingPowerForOrder(decimal orderQuantity, Security security, IAlgorithm algo)\n        {\n            var order = new MarketOrder(security.Symbol, orderQuantity, DateTime.UtcNow);\n            _fakeOrderProcessor.AddTicket(order.ToOrderTicket(algo.Transactions));\n            var hashSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(algo.Portfolio,\n                security, new MarketOrder(security.Symbol, orderQuantity, DateTime.UtcNow));\n            return hashSufficientBuyingPower.IsSufficient;\n        }\n\n        internal class NonAccountCurrencyCustomFeeModel : FeeModel\n        {\n            public string FeeCurrency = \"EUR\";\n            public decimal FeeAmount = 100m;\n\n            public override OrderFee GetOrderFee(OrderFeeParameters parameters)\n            {\n                return new OrderFee(new CashAmount(FeeAmount, FeeCurrency));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityPortfolioManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Tests.Engine;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Securities.CurrencyConversion;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityPortfolioManagerTests\n    {\n        private static readonly SecurityExchangeHours SecurityExchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n        private static readonly Symbol CASH = new Symbol(SecurityIdentifier.GenerateBase(null, \"CASH\", Market.USA), \"CASH\");\n        private static readonly Symbol MCHJWB = new Symbol(SecurityIdentifier.GenerateForex(\"MCHJWB\", Market.FXCM), \"MCHJWB\");\n        private static readonly Symbol MCHUSD = new Symbol(SecurityIdentifier.GenerateForex(\"MCHUSD\", Market.FXCM), \"MCHUSD\");\n        private static readonly Symbol USDJWB = new Symbol(SecurityIdentifier.GenerateForex(\"USDJWB\", Market.FXCM), \"USDJWB\");\n        private static readonly Symbol JWBUSD = new Symbol(SecurityIdentifier.GenerateForex(\"JWBUSD\", Market.FXCM), \"JWBUSD\");\n\n        private static readonly Dictionary<string, Symbol> SymbolMap = new Dictionary<string, Symbol>\n        {\n            {\"CASH\", CASH},\n            {\"MCHJWB\", MCHJWB},\n            {\"MCHUSD\", MCHUSD},\n            {\"USDJWB\", USDJWB},\n            {\"JWBUSD\", JWBUSD},\n        };\n\n        private QCAlgorithm _algorithm;\n        private SecurityManager _securities;\n        private SecurityTransactionManager _transactions;\n        private BacktestingTransactionHandler _transactionHandler;\n        private SecurityPortfolioManager _portfolio;\n        private BacktestingBrokerage _backtestingBrokerage;\n        private IResultHandler _resultHandler;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _resultHandler = new TestResultHandler(Console.WriteLine);\n\n            _algorithm = new QCAlgorithm();\n            _securities = new SecurityManager(TimeKeeper);\n            _transactions = new SecurityTransactionManager(null, _securities);\n            _transactionHandler = new BacktestingTransactionHandler();\n            _portfolio = new SecurityPortfolioManager(_securities, _transactions, new AlgorithmSettings());\n\n            _algorithm.Securities = _securities;\n            _backtestingBrokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, _backtestingBrokerage, _resultHandler);\n            _transactions.SetOrderProcessor(_transactionHandler);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler.Exit();\n            _resultHandler.Exit();\n            _backtestingBrokerage.Dispose();\n        }\n\n        [Test]\n        public void TestCashFills()\n        {\n            // this test asserts the portfolio behaves according to the Test_Cash algo, see TestData\\CashTestingStrategy.csv\n            // also \"https://www.dropbox.com/s/oiliumoyqqj1ovl/2013-cash.csv?dl=1\"\n\n            const string fillsFile = \"TestData/test_cash_fills.xml\";\n            const string equityFile = \"TestData/test_cash_equity.xml\";\n\n            var fills = XDocument.Load(fillsFile).Descendants(\"OrderEvent\").Select(x => new OrderEvent(\n                x.Get<int>(\"OrderId\"),\n                SymbolMap[x.Get<string>(\"Symbol\")],\n                DateTime.MinValue,\n                x.Get<OrderStatus>(\"Status\"),\n                x.Get<int>(\"FillQuantity\") < 0 ? OrderDirection.Sell\n              : x.Get<int>(\"FillQuantity\") > 0 ? OrderDirection.Buy\n                                               : OrderDirection.Hold,\n                x.Get<decimal>(\"FillPrice\"),\n                x.Get<int>(\"FillQuantity\"),\n                OrderFee.Zero)\n                ).ToList();\n\n            var equity = XDocument.Load(equityFile).Descendants(\"decimal\")\n                .Select(x => Parse.Decimal(x.Value))\n                .ToList();\n\n            Assert.AreEqual(fills.Count + 1, equity.Count);\n\n            // we're going to process fills and very our equity after each fill\n            var subscriptions = new SubscriptionManager(TimeKeeper);\n            subscriptions.SetDataManager(new DataManagerStub(TimeKeeper));\n            var securities = new SecurityManager(TimeKeeper);\n            MarketHoursDatabase.FromDataFolder().SetEntryAlwaysOpen(CASH.ID.Market, CASH.Value, CASH.SecurityType, TimeZones.NewYork);\n            var security = new Security(\n                SecurityExchangeHours,\n                subscriptions.Add(CASH, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLeverage(10m);\n            securities.Add(CASH, security);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(equity[0]);\n\n            for (int i = 0; i < fills.Count; i++)\n            {\n                // before processing the fill we must deduct the cost\n                var fill = fills[i];\n                var time = DateTime.Today.AddDays(i);\n                TimeKeeper.SetUtcDateTime(time.ConvertToUtc(TimeZones.NewYork));\n                // the value of 'CASH' increments for each fill, the original test algo did this monthly\n                // the time doesn't really matter though\n                security.SetMarketPrice(new IndicatorDataPoint(CASH, time, i + 1));\n\n                portfolio.ProcessFills(new List<OrderEvent> { fill });\n                Assert.AreEqual(equity[i + 1], portfolio.TotalPortfolioValue, \"Failed on \" + i);\n            }\n        }\n\n        [Test]\n        public void ForexCashFills()\n        {\n            // this test asserts the portfolio behaves according to the Test_Cash algo, but for a Forex security,\n            // see TestData\\CashTestingStrategy.csv; also \"https://www.dropbox.com/s/oiliumoyqqj1ovl/2013-cash.csv?dl=1\"\n\n            const string fillsFile = \"TestData/test_forex_fills.xml\";\n            const string equityFile = \"TestData/test_forex_equity.xml\";\n            const string mchQuantityFile = \"TestData/test_forex_fills_mch_quantity.xml\";\n            const string jwbQuantityFile = \"TestData/test_forex_fills_jwb_quantity.xml\";\n\n            var fills = XDocument.Load(fillsFile).Descendants(\"OrderEvent\").Select(x => new OrderEvent(\n                x.Get<int>(\"OrderId\"),\n                SymbolMap[x.Get<string>(\"Symbol\")],\n                DateTime.MinValue,\n                x.Get<OrderStatus>(\"Status\"),\n                x.Get<int>(\"FillQuantity\") < 0 ? OrderDirection.Sell\n              : x.Get<int>(\"FillQuantity\") > 0 ? OrderDirection.Buy\n                                               : OrderDirection.Hold,\n                x.Get<decimal>(\"FillPrice\"),\n                x.Get<int>(\"FillQuantity\"),\n                OrderFee.Zero)\n                ).ToList();\n\n            var equity = XDocument.Load(equityFile).Descendants(\"decimal\")\n                .Select(x => Parse.Decimal(x.Value))\n                .ToList();\n\n            var mchQuantity = XDocument.Load(mchQuantityFile).Descendants(\"decimal\")\n                .Select(x => Parse.Decimal(x.Value))\n                .ToList();\n\n            var jwbQuantity = XDocument.Load(jwbQuantityFile).Descendants(\"decimal\")\n                .Select(x => Parse.Decimal(x.Value))\n                .ToList();\n\n            Assert.AreEqual(fills.Count + 1, equity.Count);\n\n            // we're going to process fills and very our equity after each fill\n            var subscriptions = new SubscriptionManager(TimeKeeper);\n            var dataManager = new DataManagerStub(TimeKeeper);\n            subscriptions.SetDataManager(dataManager);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(equity[0]);\n            portfolio.CashBook.Add(\"MCH\", mchQuantity[0], 0);\n            portfolio.CashBook.Add(\"JWB\", jwbQuantity[0], 0);\n\n            var jwbCash = portfolio.CashBook[\"JWB\"];\n            var mchCash = portfolio.CashBook[\"MCH\"];\n            var usdCash = portfolio.CashBook[Currencies.USD];\n\n            var mchJwbSecurity = new QuantConnect.Securities.Forex.Forex(\n                SecurityExchangeHours,\n                jwbCash,\n                mchCash,\n                subscriptions.Add(MCHJWB, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork),\n                SymbolProperties.GetDefault(jwbCash.Symbol),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            mchJwbSecurity.SetLeverage(10m);\n            var mchUsdSecurity = new QuantConnect.Securities.Forex.Forex(\n                SecurityExchangeHours,\n                usdCash,\n                mchCash,\n                subscriptions.Add(MCHUSD, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork),\n                SymbolProperties.GetDefault(usdCash.Symbol),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            mchUsdSecurity.SetLeverage(10m);\n            var usdJwbSecurity = new QuantConnect.Securities.Forex.Forex(\n                SecurityExchangeHours,\n                mchCash,\n                usdCash,\n                subscriptions.Add(USDJWB, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork),\n                SymbolProperties.GetDefault(mchCash.Symbol),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n            usdJwbSecurity.SetLeverage(10m);\n\n            // no fee model\n            mchJwbSecurity.FeeModel = new ConstantFeeModel(0);\n            mchUsdSecurity.FeeModel = new ConstantFeeModel(0);\n            usdJwbSecurity.FeeModel = new ConstantFeeModel(0);\n\n            securities.Add(mchJwbSecurity);\n            securities.Add(usdJwbSecurity);\n            securities.Add(mchUsdSecurity);\n\n            var algorithm = new QCAlgorithm();\n            algorithm.Securities = securities;\n            var securityService = new SecurityService(portfolio.CashBook, MarketHoursDatabase.FromDataFolder(), SymbolPropertiesDatabase.FromDataFolder(), dataManager.Algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(portfolio), algorithm: algorithm);\n            portfolio.CashBook.EnsureCurrencyDataFeeds(securities, subscriptions, DefaultBrokerageModel.DefaultMarketMap, SecurityChanges.None, securityService);\n\n            for (int i = 0; i < fills.Count; i++)\n            {\n                // before processing the fill we must deduct the cost\n                var fill = fills[i];\n                var time = DateTime.Today.AddDays(i);\n\n                // the value of 'MCJWB' increments for each fill, the original test algo did this monthly\n                // the time doesn't really matter though\n                decimal mchJwb = i + 1;\n                decimal mchUsd = (i + 1) / (i + 2m);\n                decimal usdJwb = i + 2;\n                Assert.AreEqual((double)mchJwb, (double)(mchUsd * usdJwb), 1e-10);\n                //Console.WriteLine(\"Step: \" + i + \" -- MCHJWB: \" + mchJwb);\n\n                var updateData = new Dictionary<Security, BaseData>\n                {\n                    {mchJwbSecurity, new IndicatorDataPoint(MCHJWB, time, mchJwb)},\n                    {mchUsdSecurity, new IndicatorDataPoint(MCHUSD, time, mchUsd)},\n                    {usdJwbSecurity, new IndicatorDataPoint(JWBUSD, time, usdJwb)}\n                };\n\n                foreach (var kvp in updateData)\n                {\n                    kvp.Key.SetMarketPrice(kvp.Value);\n                }\n\n                jwbCash.Update();\n                usdCash.Update();\n                mchCash.Update();\n\n                portfolio.ProcessFills(new List<OrderEvent> { fill });\n                //Console.WriteLine(\"-----------------------\");\n                //Console.WriteLine(fill);\n\n                //Console.WriteLine(\"Post step: \" + i);\n                //foreach (var cash in portfolio.CashBook)\n                //{\n                //    Console.WriteLine(cash.Value);\n                //}\n                //Console.WriteLine(\"CashValue: \" + portfolio.CashBook.TotalValueInAccountCurrency);\n\n                Console.WriteLine(i + 1 + \"   \" + portfolio.TotalPortfolioValue.ToStringInvariant(\"C\"));\n                //Assert.AreEqual((double) equity[i + 1], (double)portfolio.TotalPortfolioValue, 2e-2);\n                Assert.AreEqual((double)mchQuantity[i + 1], (double)portfolio.CashBook[\"MCH\"].Amount);\n                Assert.AreEqual((double)jwbQuantity[i + 1], (double)portfolio.CashBook[\"JWB\"].Amount);\n\n                //Console.WriteLine();\n                //Console.WriteLine();\n            }\n        }\n\n        [Test]\n        public void ComputeMarginProperlyAsSecurityPriceFluctuates()\n        {\n            const decimal leverage = 1m;\n            const int quantity = (int)(1000 * leverage);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(quantity);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, buyPrice, buyPrice, buyPrice, buyPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero) { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            Assert.AreEqual(portfolio.CashBook[Currencies.USD].Amount, fill.FillPrice * fill.FillQuantity);\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity, portfolio.TotalPortfolioValue);\n\n            // we shouldn't be able to place a trader\n            var newOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = buyPrice };\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // now the stock doubles, leverage is 1 we shouldn't have more margin remaining\n\n            time = time.AddDays(1);\n            const decimal highPrice = buyPrice * 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, highPrice, highPrice, highPrice, highPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity * 2, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity * 2, portfolio.TotalPortfolioValue);\n\n            // we shouldn't be able to place a trader\n            var anotherOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = highPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, anotherOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // now the stock plummets, leverage is 1 we shouldn't have margin remaining\n            time = time.AddDays(1);\n            const decimal lowPrice = buyPrice / 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, lowPrice, lowPrice, lowPrice, lowPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity / 2m, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity / 2m, portfolio.TotalPortfolioValue);\n\n            // this would not cause a margin call due to leverage = 1\n            bool issueMarginCallWarning;\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsFalse(issueMarginCallWarning);\n            Assert.AreEqual(0, marginCallOrders.Count);\n        }\n\n        [Test]\n        public void MarginWarningLeverage2()\n        {\n            var freeCash = 101;\n            const decimal leverage = 2m;\n            const int quantity = (int)(1000 * leverage);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(quantity / leverage + freeCash);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, buyPrice, buyPrice, buyPrice, buyPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero) { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0 + freeCash, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity / leverage, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity / leverage + freeCash, portfolio.TotalPortfolioValue);\n\n            // now the stock loses 10%\n            time = time.AddDays(1);\n            const decimal lowPrice = buyPrice * 0.9m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, lowPrice, lowPrice, lowPrice, lowPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(1, portfolio.MarginRemaining);\n            Assert.AreEqual((quantity * 0.9m) / leverage, portfolio.TotalMarginUsed);\n            Assert.AreEqual(901, portfolio.TotalPortfolioValue);\n\n            // this will cause a margin call warning, we still have $1 of margin available\n            bool issueMarginCallWarning;\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsTrue(issueMarginCallWarning);\n            Assert.AreEqual(0, marginCallOrders.Count);\n        }\n\n        [Test]\n        public void ComputeMarginProperlyAsSecurityPriceFluctuates_Leverage2()\n        {\n            const decimal leverage = 2m;\n            const int quantity = (int)(1000 * leverage);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(quantity / leverage);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, buyPrice, buyPrice, buyPrice, buyPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero) { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(quantity / leverage, portfolio.TotalMarginUsed);\n            Assert.AreEqual(quantity / leverage, portfolio.TotalPortfolioValue);\n\n            // we shouldn't be able to place a trader\n            var newOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = buyPrice };\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // now the stock doubles\n            time = time.AddDays(1);\n            const decimal highPrice = buyPrice * 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, highPrice, highPrice, highPrice, highPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            // we have free margin now\n            Assert.AreEqual(quantity / leverage, portfolio.MarginRemaining);\n            // we are using a bit more margin too\n            Assert.AreEqual(quantity, portfolio.TotalMarginUsed);\n            // duplication increases our TPV by 'quantity'\n            Assert.AreEqual(quantity * 1.5, portfolio.TotalPortfolioValue);\n\n            // we should be able to place a trader\n            var anotherOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = highPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, anotherOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            // now the stock plummets\n            time = time.AddDays(1);\n            const decimal lowPrice = buyPrice / 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, lowPrice, lowPrice, lowPrice, lowPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            Assert.AreEqual(-quantity / (leverage * 2), portfolio.MarginRemaining);\n            Assert.AreEqual(quantity / (leverage * 2), portfolio.TotalMarginUsed);\n            Assert.AreEqual(0, portfolio.TotalPortfolioValue);\n\n            // this will cause a margin call\n            bool issueMarginCallWarning;\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n            Assert.IsTrue(issueMarginCallWarning);\n            Assert.AreNotEqual(0, marginCallOrders.Count);\n            Assert.AreEqual(-security.Holdings.Quantity, marginCallOrders[0].Quantity);\n            Assert.GreaterOrEqual(-portfolio.MarginRemaining, security.Price * marginCallOrders[0].Quantity);\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void InvertPositionLeverage2(OrderDirection direction)\n        {\n            const decimal leverage = 2m;\n            var invertedDirectionFactor = direction == OrderDirection.Buy ? -1 : 1;\n            var directionFactor = direction == OrderDirection.Buy ? 1 : -1;\n            var quantity = (int)(1000 * leverage * directionFactor);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(1000);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.FeeModel = new ConstantFeeModel(0);\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, buyPrice, buyPrice, buyPrice, buyPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero) { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.MarginRemaining);\n            Assert.AreEqual(Math.Abs(quantity / leverage), portfolio.TotalMarginUsed);\n            Assert.AreEqual(Math.Abs(quantity / leverage), portfolio.TotalPortfolioValue);\n\n            var anotherOrder = new MarketOrder(Symbols.AAPL, 2 * Math.Abs(quantity) * invertedDirectionFactor, time.AddSeconds(1)) { Price = 1 };\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, anotherOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void MarginComputesProperlyWithMultipleSecurities()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(1000);\n            portfolio.CashBook.Add(\"EUR\", 1000, 1.1m);\n            portfolio.CashBook.Add(\"GBP\", -1000, 2.0m);\n\n            var eurCash = portfolio.CashBook[\"EUR\"];\n            var gbpCash = portfolio.CashBook[\"GBP\"];\n            var usdCash = portfolio.CashBook[Currencies.USD];\n\n            var time = DateTime.Now;\n            var config1 = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config1,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[Symbols.AAPL].SetLeverage(2m);\n            securities[Symbols.AAPL].Holdings.SetHoldings(100, 100);\n            securities[Symbols.AAPL].SetMarketPrice(new TradeBar { Time = time, Value = 100 });\n\n            var config2 = CreateTradeBarDataConfig(SecurityType.Forex, Symbols.EURUSD);\n            securities.Add(\n                new QuantConnect.Securities.Forex.Forex(\n                    SecurityExchangeHours,\n                    usdCash,\n                    eurCash,\n                    config2,\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            securities[Symbols.EURUSD].SetLeverage(100m);\n            securities[Symbols.EURUSD].Holdings.SetHoldings(1.1m, 1000);\n            securities[Symbols.EURUSD].SetMarketPrice(new TradeBar { Time = time, Value = 1.1m });\n\n            var config3 = CreateTradeBarDataConfig(SecurityType.Forex, Symbols.EURGBP);\n            securities.Add(\n                new QuantConnect.Securities.Forex.Forex(\n                    SecurityExchangeHours,\n                    gbpCash,\n                    eurCash,\n                    config3,\n                    SymbolProperties.GetDefault(gbpCash.Symbol),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            securities[Symbols.EURGBP].SetLeverage(100m);\n            securities[Symbols.EURGBP].Holdings.SetHoldings(1m, 1000);\n            securities[Symbols.EURGBP].SetMarketPrice(new TradeBar { Time = time, Value = 1m });\n\n            var acceptedOrder = new MarketOrder(Symbols.AAPL, 101, DateTime.Now) { Price = 100 };\n            orderProcessor.AddOrder(acceptedOrder);\n            var request = new SubmitOrderRequest(OrderType.Market, acceptedOrder.SecurityType, acceptedOrder.Symbol, acceptedOrder.Quantity, 0, 0, acceptedOrder.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            var security = securities[Symbols.AAPL];\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, acceptedOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            var rejectedOrder = new MarketOrder(Symbols.AAPL, 102, DateTime.Now) { Price = 100 };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, rejectedOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void BuyingSellingFuturesDoesntAddToCash()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.Fut_SPY_Feb19_2016,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Future, Symbols.Fut_SPY_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fillBuy = new OrderEvent(1, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 100, 100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(100, securities[Symbols.Fut_SPY_Feb19_2016].Holdings.Quantity);\n\n            var fillSell = new OrderEvent(2, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 100, -100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(0, securities[Symbols.Fut_SPY_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void BuyingSellingFuturesAddsToCashOnClose()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.Fut_SPY_Feb19_2016,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Future, Symbols.Fut_SPY_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new SymbolProperties(\"\", Currencies.USD, 50, 0.01m, 1, string.Empty),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fillBuy = new OrderEvent(1, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 100, 100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(100, securities[Symbols.Fut_SPY_Feb19_2016].Holdings.Quantity);\n\n            var fillSell = new OrderEvent(2, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 99, -100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            Assert.AreEqual(-100 * 50, portfolio.Cash);\n            Assert.AreEqual(0, securities[Symbols.Fut_SPY_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void BuyingSellingFuturesAddsCorrectSales()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.Fut_SPY_Feb19_2016,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Future, Symbols.Fut_SPY_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new SymbolProperties(\"\", Currencies.USD, 50, 0.01m, 1, string.Empty),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fillBuy = new OrderEvent(1, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 100, 100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            var security = securities[Symbols.Fut_SPY_Feb19_2016];\n            Assert.AreEqual(100 * 100 * security.SymbolProperties.ContractMultiplier, security.Holdings.TotalSaleVolume);\n\n            var fillSell = new OrderEvent(2, Symbols.Fut_SPY_Feb19_2016, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 100, -100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            Assert.AreEqual(2 * 100 * 100 * security.SymbolProperties.ContractMultiplier, security.Holdings.TotalSaleVolume);\n        }\n\n        [Test]\n        public void BuyingSellingCfdDoesntAddToCash()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n            portfolio.SetCash(\"EUR\", 0, 1.10m);\n\n            securities.Add(\n                Symbols.DE30EUR,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Cfd, Symbols.DE30EUR),\n                    portfolio.CashBook[\"EUR\"],\n                    SymbolProperties.GetDefault(\"EUR\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fillBuy = new OrderEvent(1, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 10000, 5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(5, securities[Symbols.DE30EUR].Holdings.Quantity);\n\n            var fillSell = new OrderEvent(2, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 10000, -5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(0, securities[Symbols.DE30EUR].Holdings.Quantity);\n        }\n\n        [Test]\n        public void BuyingSellingCfdAddsToCashOnClose()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n            portfolio.SetCash(\"EUR\", 0, 1.10m);\n\n            securities.Add(\n                Symbols.DE30EUR,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Cfd, Symbols.DE30EUR),\n                    portfolio.CashBook[\"EUR\"],\n                    SymbolProperties.GetDefault(\"EUR\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[Symbols.DE30EUR].SettlementModel = new AccountCurrencyImmediateSettlementModel();\n\n            var fillBuy = new OrderEvent(1, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 10000, 5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            Assert.AreEqual(0, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0, portfolio.CashBook[\"USD\"].Amount);\n            Assert.AreEqual(0, portfolio.Cash);\n            Assert.AreEqual(5, securities[Symbols.DE30EUR].Holdings.Quantity);\n\n            var fillSell = new OrderEvent(2, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 10100, -5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            // PNL = (10100 - 10000) * 5 * 1.10 = 550 USD\n            Assert.AreEqual(0, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(550, portfolio.CashBook[\"USD\"].Amount);\n            Assert.AreEqual(550, portfolio.Cash);\n            Assert.AreEqual(0, securities[Symbols.DE30EUR].Holdings.Quantity);\n        }\n\n        [Test]\n        public void BuyingSellingCfdAddsCorrectSales()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n            portfolio.SetCash(\"EUR\", 0, 1.10m);\n\n            securities.Add(\n                Symbols.DE30EUR,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Cfd, Symbols.DE30EUR),\n                    portfolio.CashBook[\"EUR\"],\n                    SymbolProperties.GetDefault(\"EUR\"),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fillBuy = new OrderEvent(1, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 10000, 5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillBuy });\n\n            // 10000 price * 5 quantity * 1.10 exchange rate = 55000 USD\n            Assert.AreEqual(55000, securities[Symbols.DE30EUR].Holdings.TotalSaleVolume);\n\n            var fillSell = new OrderEvent(2, Symbols.DE30EUR, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 10000, -5, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fillSell });\n\n            // 2 * 10000 price * 5 quantity * 1.10 exchange rate = 110000 USD\n            Assert.AreEqual(110000, securities[Symbols.DE30EUR].Holdings.TotalSaleVolume);\n        }\n\n        [Test]\n        public void SellingShortFromZeroAddsToCash()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.AAPL,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            var fill = new OrderEvent(1, Symbols.AAPL, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 100, -100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(100 * 100, portfolio.Cash);\n            Assert.AreEqual(-100, securities[Symbols.AAPL].Holdings.Quantity);\n        }\n\n        [Test]\n        public void SellingShortFromLongAddsToCash()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.AAPL,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[Symbols.AAPL].Holdings.SetHoldings(100, 100);\n\n            var fill = new OrderEvent(1, Symbols.AAPL, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 100, -100, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(100 * 100, portfolio.Cash);\n            Assert.AreEqual(0, securities[Symbols.AAPL].Holdings.Quantity);\n        }\n\n        [Test]\n        public void SellingShortFromShortAddsToCash()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(0);\n\n            securities.Add(\n                Symbols.AAPL,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[Symbols.AAPL].Holdings.SetHoldings(100, -100);\n\n            var fill = new OrderEvent(1, Symbols.AAPL, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Sell, 100, -100, OrderFee.Zero);\n            Assert.AreEqual(-100, securities[Symbols.AAPL].Holdings.Quantity);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(100 * 100, portfolio.Cash);\n            Assert.AreEqual(-200, securities[Symbols.AAPL].Holdings.Quantity);\n        }\n\n        [Test]\n        public void ForexFillUpdatesCashCorrectly()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(1000);\n            var eurCash = portfolio.CashBook.Add(\"EUR\", 0, 1.1000m);\n\n            securities.Add(\n                Symbols.EURUSD,\n                new QuantConnect.Securities.Forex.Forex(\n                    SecurityExchangeHours,\n                    portfolio.CashBook[Currencies.USD],\n                    eurCash,\n                    CreateTradeBarDataConfig(SecurityType.Forex, Symbols.EURUSD),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            var security = securities[Symbols.EURUSD];\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.AreEqual(1000, portfolio.Cash);\n\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new MarketOrder(Symbols.EURUSD, 100, DateTime.MinValue)));\n            var fill = new OrderEvent(1, Symbols.EURUSD, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 1.1000m, 100, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n            Assert.AreEqual(100, security.Holdings.Quantity);\n            Assert.AreEqual(998, portfolio.Cash);\n            Assert.AreEqual(100, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(888, portfolio.CashBook[Currencies.USD].Amount);\n        }\n\n        [Test]\n        public void CryptoFillUpdatesCashCorrectly()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(10000);\n            var btcCash = portfolio.CashBook.Add(\"BTC\", 0, 4000.01m);\n\n            securities.Add(\n                Symbols.BTCUSD,\n                new QuantConnect.Securities.Crypto.Crypto(\n                    SecurityExchangeHours,\n                    portfolio.CashBook[Currencies.USD],\n                    btcCash,\n                    CreateTradeBarDataConfig(\n                        SecurityType.Crypto,\n                        Symbols.BTCUSD\n                    ),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            var security = securities[Symbols.BTCUSD];\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.AreEqual(10000, portfolio.Cash);\n\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new MarketOrder(Symbols.BTCUSD, 2, DateTime.MinValue)));\n            var fill = new OrderEvent(1, Symbols.BTCUSD, DateTime.MinValue, OrderStatus.Filled, OrderDirection.Buy, 4000.01m, 2, OrderFee.Zero);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n            Assert.AreEqual(2, security.Holdings.Quantity);\n            Assert.AreEqual(10000, portfolio.Cash);\n            Assert.AreEqual(2, portfolio.CashBook[\"BTC\"].Amount);\n            Assert.AreEqual(1999.98, portfolio.CashBook[Currencies.USD].Amount);\n        }\n\n        [Test]\n        public void EquitySellAppliesSettlementCorrectly()\n        {\n            var securityExchangeHours = SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours();\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.SetCash(1000);\n            securities.Add(\n                Symbols.AAPL,\n                new QuantConnect.Securities.Equity.Equity(\n                    securityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SettlementModel = new DelayedSettlementModel(3, TimeSpan.FromHours(8));\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.AreEqual(1000, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            // Buy on Monday\n            var timeUtc = new DateTime(2015, 10, 26, 15, 30, 0);\n            var orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new MarketOrder(Symbols.AAPL, 10, timeUtc)));\n            var fill = new OrderEvent(1, Symbols.AAPL, timeUtc, OrderStatus.Filled, OrderDirection.Buy, 100, 10, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n            Assert.AreEqual(10, security.Holdings.Quantity); Assert.AreEqual(-1, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n\n            // Sell on Tuesday, cash unsettled\n            timeUtc = timeUtc.AddDays(1);\n            orderFee = security.FeeModel.GetOrderFee(new OrderFeeParameters(\n                security, new MarketOrder(Symbols.AAPL, 10, timeUtc)));\n            fill = new OrderEvent(2, Symbols.AAPL, timeUtc, OrderStatus.Filled, OrderDirection.Sell, 100, -10, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.AreEqual(-2, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Thursday, still cash unsettled\n            timeUtc = timeUtc.AddDays(2);\n            security.SettlementModel.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(-2, portfolio.Cash);\n            Assert.AreEqual(1000, portfolio.UnsettledCash);\n\n            // Friday at open, cash settled\n            var marketOpen = securityExchangeHours.MarketHours[timeUtc.DayOfWeek].GetMarketOpen(TimeSpan.Zero, false);\n            Assert.IsTrue(marketOpen.HasValue);\n            timeUtc = timeUtc.AddDays(1).Date.Add(marketOpen.Value).ConvertToUtc(securityExchangeHours.TimeZone);\n            security.SettlementModel.Scan(new ScanSettlementModelParameters(portfolio, security, timeUtc));\n            Assert.AreEqual(998, portfolio.Cash);\n            Assert.AreEqual(0, portfolio.UnsettledCash);\n        }\n\n        [Test]\n        public void ComputeMarginProperlyLongSellZeroShort()\n        {\n            const decimal leverage = 2m;\n            const int amount = 1000;\n            const int quantity = (int)(amount * leverage);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(amount);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal buyPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, buyPrice, buyPrice, buyPrice, buyPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, quantity, time) { Price = buyPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n            { FillPrice = buyPrice, FillQuantity = quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            // we shouldn't be able to place a new buy order\n            var newOrder = new MarketOrder(Symbols.AAPL, 1, time.AddSeconds(1)) { Price = buyPrice };\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // we should be able to place sell to zero\n            newOrder = new MarketOrder(Symbols.AAPL, -quantity, time.AddSeconds(1)) { Price = buyPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            // now the stock plummets, so we should have negative margin remaining\n            time = time.AddDays(1);\n            const decimal lowPrice = buyPrice / 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, lowPrice, lowPrice, lowPrice, lowPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            // we still should be able to place sell to zero\n            newOrder = new MarketOrder(Symbols.AAPL, -quantity, time.AddSeconds(1)) { Price = lowPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            // we shouldn't be able to place sell to short\n            newOrder = new MarketOrder(Symbols.AAPL, -quantity - 1, time.AddSeconds(1)) { Price = lowPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void ComputeMarginProperlyShortCoverZeroLong()\n        {\n            const decimal leverage = 2m;\n            const int amount = 1000;\n            const int quantity = (int)(amount * leverage);\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            transactions.SetOrderProcessor(orderProcessor);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            portfolio.CashBook[Currencies.USD].SetAmount(amount);\n\n            var config = CreateTradeBarDataConfig(SecurityType.Equity, Symbols.AAPL);\n            securities.Add(\n                new Security(\n                    SecurityExchangeHours,\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            var security = securities[Symbols.AAPL];\n            security.SetLeverage(leverage);\n\n            var time = DateTime.Now;\n            const decimal sellPrice = 1m;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, sellPrice, sellPrice, sellPrice, sellPrice, 1));\n\n            var order = new MarketOrder(Symbols.AAPL, -quantity, time) { Price = sellPrice };\n            var fill = new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n            { FillPrice = sellPrice, FillQuantity = -quantity, Status = OrderStatus.Filled };\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            // we shouldn't be able to place a new short order\n            var newOrder = new MarketOrder(Symbols.AAPL, -1, time.AddSeconds(1)) { Price = sellPrice };\n            var hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            // we should be able to place cover to zero\n            newOrder = new MarketOrder(Symbols.AAPL, quantity, time.AddSeconds(1)) { Price = sellPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            // now the stock doubles, so we should have negative margin remaining\n            time = time.AddDays(1);\n            const decimal highPrice = sellPrice * 2;\n            security.SetMarketPrice(new TradeBar(time, Symbols.AAPL, highPrice, highPrice, highPrice, highPrice, 1));\n            portfolio.InvalidateTotalPortfolioValue();\n\n            // we still shouldn be able to place cover to zero\n            newOrder = new MarketOrder(Symbols.AAPL, quantity, time.AddSeconds(1)) { Price = highPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n\n            // we shouldn't be able to place cover to long\n            newOrder = new MarketOrder(Symbols.AAPL, quantity + 1, time.AddSeconds(1)) { Price = highPrice };\n            hasSufficientBuyingPower = security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, security, newOrder).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void FullExerciseCallAddsUnderlyingPositionReducesCash()\n        {\n            // Adding cash: strike price times number of shares\n            _portfolio.SetCash(192 * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 1);\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 200 });\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n            Assert.AreEqual(\"Option Exercise\", fills[1].Message);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and long call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void ExerciseOTMCallDoesntChangeAnything()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 100);\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 20 });\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            StringAssert.Contains(\"OTM\", fills[0].Message);\n            Assert.IsFalse(fills[0].IsInTheMoney);\n            Assert.AreEqual(0, fills[0].FillPrice);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(0, newUnderlyingHoldings.AveragePrice);\n\n            // and long call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void CashSettledExerciseOTMPutDoesntChangeAnything()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, 100);\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 2000 });\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            StringAssert.Contains(\"OTM\", fills[0].Message);\n            Assert.IsFalse(fills[0].IsInTheMoney);\n            Assert.AreEqual(0, fills[0].FillPrice);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(0, newUnderlyingHoldings.AveragePrice);\n\n            // and long call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void FullExercisePutAddsUnderlyingPositionAddsCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, 1);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n            Assert.AreEqual(\"Option Exercise\", fills[1].Message);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // now we have short position in SPY with average price equal to strike\n            // and cash amount equal to strike price times number of shares\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(192 * 100, _portfolio.Cash);\n            Assert.AreEqual(-100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and long put option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void PartialExerciseCallAddsUnderlyingPositionReducesCash()\n        {\n            // Adding cash: strike price times number of shares\n            _portfolio.SetCash(192 * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 2);\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 200 });\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings / 2, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n            Assert.AreEqual(\"Option Exercise\", fills[1].Message);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and call option position still has some value\n            Assert.AreEqual(1, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalCallAssignmentAddsUnderlyingPositionAddsCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, -1);\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 200 });\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n            Assert.AreEqual(\"Option Assignment\", fills[1].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            // now we have short position in SPY with average price equal to strike\n            // and cash amount equal to strike price times number of shares\n\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(192 * 100, _portfolio.Cash);\n            Assert.AreEqual(-100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and short call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalPutAssignmentAddsUnderlyingPositionReducesCash()\n        {\n            // Adding cash: strike price times number of shares\n            _portfolio.SetCash(192 * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, -1);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n            Assert.AreEqual(\"Option Assignment\", fills[1].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and short put option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalPartialPutAssignmentAddsUnderlyingPositionReduces()\n        {\n            // Adding cash: strike price times number of shares\n            _portfolio.SetCash(192 * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, -2);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings / 2, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(2, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n            Assert.AreEqual(\"Option Assignment\", fills[1].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            // now we have long position in SPY with average price equal to strike\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(100, newUnderlyingHoldings.Quantity);\n            Assert.AreEqual(192.0, newUnderlyingHoldings.AveragePrice);\n\n            // and short put option position still exists in the portfolio\n            Assert.AreEqual(-1, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void FullExerciseCashSettledCallAddsCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 1);\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // (underlying price - strike price) times number of shares\n            Assert.AreEqual((195 - 192) * 100, _portfolio.Cash);\n            Assert.AreEqual(_portfolio.TotalNetProfit, option.Holdings.NetProfit);\n            // we paid 100\n            Assert.AreEqual(_portfolio.Cash - 100, option.Holdings.NetProfit);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and long call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void FullExerciseOTMCashSettledCallAddsNoCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 190 });\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 100);\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            StringAssert.Contains(\"OTM\", fills[0].Message);\n            Assert.IsFalse(fills[0].IsInTheMoney);\n            Assert.AreEqual(0, fills[0].FillPrice);\n            Assert.AreEqual(0, fills[0].FillPrice);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // no cash comes to the account because our contract was OTM\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n            Assert.AreEqual(_portfolio.TotalNetProfit, option.Holdings.NetProfit);\n            Assert.AreEqual(-10000, option.Holdings.NetProfit);\n\n            // and long call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void FullExerciseCashSettledPutAddsCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 189 });\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, 1);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // (strike price - underlying price) times number of shares\n            Assert.AreEqual((192 - 189) * 100, _portfolio.Cash);\n            Assert.AreEqual(_portfolio.TotalNetProfit, option.Holdings.NetProfit);\n            // we paid 100 => 1 price, 1 quantity, 100x multiplier\n            Assert.AreEqual(_portfolio.Cash - 100, option.Holdings.NetProfit);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and long put option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void ComputeMarginProperlyOnOptionExercise()\n        {\n            var algorithm = new QCAlgorithm();\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n\n            var time = DateTime.Now;\n            algorithm.Securities = securities;\n            transactions.SetOrderProcessor(orderProcessor);\n\n            portfolio.SetCash(1000);\n\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n            securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 10);\n\n            var option = (Option)securities[Symbols.SPY_C_192_Feb19_2016];\n            option.Underlying = securities[Symbols.SPY];\n\n            var holdings = securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            var order = new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, -holdings, time.AddSeconds(1));\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            var hasSufficientBuyingPower = option.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, option, order).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = securities.UtcTime, Symbol = Symbols.SPY, Close = 150 });\n\n            order = new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, -holdings, time.AddSeconds(1));\n            orderProcessor.AddOrder(order);\n            request = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            hasSufficientBuyingPower = option.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, option, order).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void ComputeMarginProperlyOnOptionAssignment()\n        {\n            var algorithm = new QCAlgorithm();\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var orderProcessor = new OrderProcessor();\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n\n            var time = DateTime.Now;\n            algorithm.Securities = securities;\n            transactions.SetOrderProcessor(orderProcessor);\n\n            portfolio.SetCash(1000);\n\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n            securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, -10);\n\n            var option = (Option)securities[Symbols.SPY_C_192_Feb19_2016];\n            option.Underlying = securities[Symbols.SPY];\n\n            var holdings = securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            var order = new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, -holdings, time.AddSeconds(1));\n            orderProcessor.AddOrder(order);\n            var request = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            var hasSufficientBuyingPower = option.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, option, order).IsSufficient;\n            Assert.IsFalse(hasSufficientBuyingPower);\n\n            securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = securities.UtcTime, Symbol = Symbols.SPY, Close = 150 });\n\n            order = new OptionExerciseOrder(Symbols.SPY_C_192_Feb19_2016, -holdings, time.AddSeconds(1));\n            orderProcessor.AddOrder(order);\n            request = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, order.Quantity, 0, 0, order.Time, null);\n            request.SetOrderId(0);\n            orderProcessor.AddTicket(new OrderTicket(null, request));\n            hasSufficientBuyingPower = option.BuyingPowerModel.HasSufficientBuyingPowerForOrder(portfolio, option, order).IsSufficient;\n            Assert.IsTrue(hasSufficientBuyingPower);\n        }\n\n        [Test]\n        public void PartialExerciseCashSettledCallAddsSomeCash()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, 2);\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings / 2, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Automatic Exercise\", fills[0].Message);\n            Assert.IsTrue(fills[0].IsInTheMoney);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            // (underlying price - strike price) times number of shares\n            Assert.AreEqual((195 - 192) * 100, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and call option position still has some value\n            Assert.AreEqual(1, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalCashSettledCallAssignmentReducesCash()\n        {\n            // (underlying price - strike price) times number of shares\n            _portfolio.SetCash((195 - 192) * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, -1);\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and short call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalCashSettledOTMCallAssignmentDoesntChangeAnything()\n        {\n            _portfolio.SetCash(0);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 10 });\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, -100);\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_C_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsFalse(fills[0].IsAssignment);\n            StringAssert.Contains(\"OTM\", fills[0].Message);\n            Assert.IsFalse(fills[0].IsInTheMoney);\n            Assert.AreEqual(0, fills[0].FillPrice);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned! nothing changed...\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and short call option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalCashSettledPutAssignmentReducesCash()\n        {\n            // (strike price - underlying price) times number of shares\n            _portfolio.SetCash((192 - 189) * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 189 });\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, -1);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and short put option position has disappeared\n            Assert.AreEqual(0, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [Test]\n        public void InternalPartialCashSettledPutAssignmentReducesSomeCash()\n        {\n            // (strike price - underlying price) times number of shares\n            _portfolio.SetCash((192 - 189) * 100);\n\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            _securities.Add(\n                Symbols.SPY_P_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_P_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_P_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n            _securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = _securities.UtcTime, Symbol = Symbols.SPY, Close = 189 });\n            _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.SetHoldings(1, -2);\n\n            var holdings = _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity;\n            _transactions.AddOrder(new SubmitOrderRequest(OrderType.OptionExercise, SecurityType.Option, Symbols.SPY_P_192_Feb19_2016, -holdings / 2, 0, 0, _securities.UtcTime, \"\"));\n            var option = (Option)_securities[Symbols.SPY_P_192_Feb19_2016];\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            Assert.AreEqual(1, fills.Count);\n            Assert.IsTrue(fills[0].IsAssignment);\n            Assert.AreEqual(order.Quantity, fills[0].FillQuantity);\n            StringAssert.Contains(\"Assigned\", fills[0].Message);\n\n            // we are simulating assignment by calling a method for this\n            var portfolioModel = (OptionPortfolioModel)option.PortfolioModel;\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                portfolioModel.ProcessFill(_portfolio, option, fill);\n            }\n\n            // we just got assigned!\n            var newUnderlyingHoldings = _securities[Symbols.SPY].Holdings;\n            Assert.AreEqual(0, _portfolio.Cash);\n            Assert.AreEqual(0, _securities[Symbols.SPY].Holdings.Quantity);\n\n            // and short put option position still exists in the portfolio\n            Assert.AreEqual(-1, _securities[Symbols.SPY_P_192_Feb19_2016].Holdings.Quantity);\n        }\n\n        [TestCase(DataNormalizationMode.Adjusted)]\n        [TestCase(DataNormalizationMode.Raw)]\n        [TestCase(DataNormalizationMode.SplitAdjusted)]\n        [TestCase(DataNormalizationMode.TotalReturn)]\n        public void AlwaysAppliesSplitInLiveMode(DataNormalizationMode mode)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.UniverseSettings.DataNormalizationMode = mode;\n            algorithm.SetLiveMode(true);\n            var initialCash = algorithm.Portfolio.CashBook.TotalValueInAccountCurrency;\n\n            var spy = algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick(new DateTime(2000, 01, 01), Symbols.SPY, 100m, 99m, 101m) { TickType = TickType.Trade });\n            spy.Holdings.SetHoldings(100m, 100);\n\n            var split = new Split(Symbols.SPY, new DateTime(2000, 01, 01), 100, 0.5m, SplitType.SplitOccurred);\n            algorithm.Portfolio.ApplySplit(split,\n                spy,\n                algorithm.LiveMode,\n                algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy.Symbol)\n                    .DataNormalizationMode());\n\n            // confirm the split was properly applied to our holdings, no left over cash from split\n            Assert.AreEqual(50m, spy.Price);\n            Assert.AreEqual(200, spy.Holdings.Quantity);\n            Assert.AreEqual(initialCash, algorithm.Portfolio.CashBook.TotalValueInAccountCurrency);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SplitPartialSharesHandling(bool hasData)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetLiveMode(true);\n            var initialCash = algorithm.Portfolio.CashBook.TotalValueInAccountCurrency;\n\n            var spy = algorithm.AddEquity(\"SPY\");\n            if (hasData)\n            {\n                spy.SetMarketPrice(new Tick(new DateTime(2000, 01, 01), Symbols.SPY, 100m, 99m, 101m) { TickType = TickType.Trade });\n            }\n            spy.Holdings.SetHoldings(100m, 100);\n\n            var split = new Split(Symbols.SPY, new DateTime(2000, 01, 01), 100, 0.49999m, SplitType.SplitOccurred);\n            var newAvgPrice = spy.Holdings.AveragePrice * split.SplitFactor;\n            var newQuantity = spy.Holdings.Quantity / split.SplitFactor;\n            var leftOver = newQuantity - (int)newQuantity;\n\n            algorithm.Portfolio.ApplySplit(split,\n                spy,\n                algorithm.LiveMode,\n                algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy.Symbol)\n                    .DataNormalizationMode());\n\n            // confirm the split was properly applied to our holdings, no left over cash from split\n            Assert.AreEqual(newAvgPrice, spy.Holdings.AveragePrice);\n            Assert.AreEqual((int)newQuantity, spy.Holdings.Quantity);\n\n            var cashDifference = leftOver * split.Price * split.SplitFactor;\n            Assert.AreEqual(initialCash + cashDifference, algorithm.Portfolio.CashBook.TotalValueInAccountCurrency);\n        }\n\n        [Test]\n        public void HoldingsPriceIsUpdatedOnSplit()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var spy = algorithm.AddEquity(\"SPY\", dataNormalizationMode: DataNormalizationMode.Raw);\n            // Update with both a trade and quote bar\n            spy.SetMarketPrice(new TradeBar(new DateTime(2000, 01, 01), Symbols.SPY, 100m, 100m, 100m, 100m, 100m, Time.OneMinute));\n            spy.SetMarketPrice(new QuoteBar(new DateTime(2000, 01, 01), Symbols.SPY, new Bar(100m, 100m, 100m, 100m), 100m, new Bar(100m, 100m, 100m, 100m), 100m, Time.OneMinute));\n            spy.Holdings.SetHoldings(100m, 100);\n\n            var split = new Split(Symbols.SPY, new DateTime(2000, 01, 01), 100, 0.5m, SplitType.SplitOccurred);\n\n            algorithm.Portfolio.ApplySplit(split,\n                spy,\n                algorithm.LiveMode,\n                algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy.Symbol)\n                    .DataNormalizationMode());\n\n            // confirm the split was properly applied to our holdings\n            Assert.AreEqual(50m, spy.Holdings.AveragePrice);\n            Assert.AreEqual(200, spy.Holdings.Quantity);\n\n            // Market price should have also been updated\n            Assert.AreEqual(50m, spy.Holdings.Price);\n        }\n\n        [TestCase(DataNormalizationMode.Adjusted)]\n        [TestCase(DataNormalizationMode.Raw)]\n        [TestCase(DataNormalizationMode.SplitAdjusted)]\n        [TestCase(DataNormalizationMode.TotalReturn)]\n        public void NeverAppliesDividendInLiveMode(DataNormalizationMode mode)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.UniverseSettings.DataNormalizationMode = mode;\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetLiveMode(true);\n            var initialCash = algorithm.Portfolio.CashBook.TotalValueInAccountCurrency;\n\n            var spy = algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick(new DateTime(2000, 01, 01), Symbols.SPY, 100m, 99m, 101m));\n            spy.Holdings.SetHoldings(100m, 100);\n\n            var dividend = new Dividend(Symbols.SPY, new DateTime(2000, 01, 01), 100, 0.5m);\n            algorithm.Portfolio.ApplyDividend(dividend,\n                algorithm.LiveMode,\n                algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy.Symbol)\n                    .DataNormalizationMode());\n\n            // confirm no changes were made\n            Assert.AreEqual(100m, spy.Price);\n            Assert.AreEqual(100, spy.Holdings.Quantity);\n            Assert.AreEqual(initialCash, algorithm.Portfolio.CashBook.TotalValueInAccountCurrency);\n        }\n\n        [TestCase(DataNormalizationMode.Adjusted, 200, 0)]\n        [TestCase(DataNormalizationMode.Raw, 100, 100)]\n        [TestCase(DataNormalizationMode.SplitAdjusted, 100, 100)]\n        [TestCase(DataNormalizationMode.TotalReturn, 200, 0)]\n        public void NormalizationModeDoesNotChangeNetProfit(DataNormalizationMode mode, decimal profitLoss, decimal dividendPayment)\n        {\n            const decimal fee = 1;\n            const decimal quantity = 100;\n            var algorithm = new QCAlgorithm();\n            algorithm.UniverseSettings.DataNormalizationMode = mode;\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var spy = algorithm.AddEquity(\"SPY\");\n            spy.SetMarketPrice(new Tick(new DateTime(2000, 01, 01), Symbols.SPY, 100m, 99m, 101m));\n            spy.Holdings.SetHoldings(100m, quantity);\n            spy.Holdings.AddNewFee(fee);\n            spy.Holdings.AddNewProfit(profitLoss);\n\n            var distribution = dividendPayment / quantity;\n\n            var dividend = new Dividend(Symbols.SPY, new DateTime(2000, 01, 01), distribution, 0.5m);\n            algorithm.Portfolio.ApplyDividend(dividend,\n                algorithm.LiveMode,\n                algorithm.SubscriptionManager.SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy.Symbol)\n                    .DataNormalizationMode());\n\n            // TotalProfit is the sum of profit loss and dividend\n            Assert.AreEqual(profitLoss + dividendPayment, algorithm.Portfolio.TotalProfit);\n            // TotalNetProfit is the sum of profit loss and dividend minus fees\n            Assert.AreEqual(profitLoss + dividendPayment - fee, algorithm.Portfolio.TotalNetProfit);\n        }\n\n        [TestCase()]\n        [TestCase(200000)]\n        public void SetAccountCurrency(decimal? startingCash = null)\n        {\n            var algorithm = new QCAlgorithm();\n\n            Assert.AreEqual(Currencies.USD, algorithm.AccountCurrency);\n            Assert.AreEqual(Currencies.USD, algorithm.Portfolio.CashBook.AccountCurrency);\n            var expectedAmount = algorithm.Portfolio.CashBook[Currencies.USD].Amount;\n\n            if (startingCash == null)\n            {\n                algorithm.SetAccountCurrency(\"btc\");\n            }\n            else\n            {\n                algorithm.SetAccountCurrency(\"btc\", (decimal)startingCash);\n                expectedAmount = (decimal)startingCash;\n            }\n\n            Assert.AreEqual(\"BTC\", algorithm.AccountCurrency);\n            Assert.AreEqual(\"BTC\", algorithm.Portfolio.CashBook.AccountCurrency);\n            Assert.AreEqual(expectedAmount, algorithm.Portfolio.CashBook[\"BTC\"].Amount);\n        }\n\n        [Test]\n        public void CanNotChangeAccountCurrencyAfterAddingASecurity()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetDateTime(TimeKeeper.UtcTime);\n\n            algorithm.Securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            Assert.Throws<InvalidOperationException>(() => algorithm.Portfolio.SetAccountCurrency(Currencies.USD));\n        }\n\n        [TestCase(\"SetCash(decimal cash)\")]\n        [TestCase(\"SetCash(string symbol, ...)\")]\n        public void CanNotChangeAccountCurrencyAfterSettingCash(string overload)\n        {\n            var algorithm = new QCAlgorithm();\n            if (overload == \"SetCash(decimal cash)\")\n            {\n                algorithm.Portfolio.SetCash(10);\n            }\n            else\n            {\n                algorithm.Portfolio.SetCash(Currencies.USD, 1, 1);\n            }\n            Assert.Throws<InvalidOperationException>(() => algorithm.Portfolio.SetAccountCurrency(Currencies.USD));\n        }\n\n        [Test]\n        public void AddsEmptyUnsettledCashInstancesAsNewCashInstancesAreAddedToTheCashBook()\n        {\n            var algorithm = new QCAlgorithm();\n            var additions = 0;\n            algorithm.Portfolio.UnsettledCashBook.Updated += (sender, args) =>\n            {\n                if (args.UpdateType == CashBookUpdateType.Added)\n                {\n                    additions++;\n                }\n            };\n\n            algorithm.SetCash(Currencies.EUR, 1000, 1.08m);\n            algorithm.SetCash(\"AUD\", 1000, 0.7m);\n\n            // expected only 2 additions, USD is the account currency so it its supposed to already be there\n            Assert.AreEqual(2, additions);\n            Assert.AreEqual(3, algorithm.Portfolio.UnsettledCashBook.Count);\n\n            Assert.IsTrue(algorithm.Portfolio.UnsettledCashBook.ContainsKey(Currencies.USD));\n            Assert.IsTrue(algorithm.Portfolio.UnsettledCashBook.ContainsKey(Currencies.EUR));\n            Assert.IsTrue(algorithm.Portfolio.UnsettledCashBook.ContainsKey(\"AUD\"));\n\n            // When added, the amount should be 0\n            Assert.IsTrue(algorithm.Portfolio.UnsettledCashBook\n                .Where(kvp => kvp.Key != Currencies.USD)\n                .All(kvp => kvp.Value.Amount == 0));\n        }\n\n        [Test]\n        public void UpdatesUnsettledCashCurrencyConversionAsItIsUpdatedForSettledCash()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SetCash(Currencies.EUR, 1000, 1.08m);\n            algorithm.SetCash(\"AUD\", 1000, 0.7m);\n\n            var unsettledCashBook = algorithm.Portfolio.UnsettledCashBook;\n            var currencyConversionUpdates = 0;\n            foreach (var unsettledCash in unsettledCashBook.Values)\n            {\n                unsettledCash.CurrencyConversionUpdated += (sender, args) =>\n                {\n                    currencyConversionUpdates++;\n                };\n            }\n\n            var cashBook = algorithm.Portfolio.CashBook;\n            var settledEurCash = cashBook[\"EUR\"];\n            var settledAudCash = cashBook[\"AUD\"];\n            var unsettledEurCash = unsettledCashBook[\"EUR\"];\n            var unsettledAudCash = unsettledCashBook[\"AUD\"];\n\n            settledEurCash.CurrencyConversion = new TestCurrencyConversion(cashBook.AccountCurrency, \"EUR\", 1.08m);\n            Assert.AreEqual(1, currencyConversionUpdates);\n            settledAudCash.CurrencyConversion = new TestCurrencyConversion(cashBook.AccountCurrency, \"AUD\", 0.7m);\n            Assert.AreEqual(2, currencyConversionUpdates);\n\n\n            var prevEurConversionRate = unsettledEurCash.ConversionRate;\n            var prevAudConversionRate = unsettledAudCash.ConversionRate;\n\n            foreach (var cash in cashBook.Values)\n            {\n                cash.Update();\n            }\n\n            Assert.AreEqual(prevEurConversionRate * 1.01m, settledEurCash.ConversionRate);\n            Assert.AreEqual(prevAudConversionRate * 1.01m, settledAudCash.ConversionRate);\n            Assert.AreEqual(settledEurCash.ConversionRate, unsettledEurCash.ConversionRate);\n            Assert.AreEqual(settledAudCash.ConversionRate, unsettledAudCash.ConversionRate);\n        }\n\n        private static TestCaseData[] MarginRemainingTestCases => new[]\n            {\n                new TestCaseData(SecurityType.Equity, 0, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Equity, 0, OrderDirection.Sell),\n                new TestCaseData(SecurityType.Equity, +100, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Equity, +100, OrderDirection.Sell),\n                new TestCaseData(SecurityType.Equity, -100, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Equity, -100, OrderDirection.Sell),\n                new TestCaseData(SecurityType.Option, 0, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Option, 0, OrderDirection.Sell),\n                new TestCaseData(SecurityType.Option, +10, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Option, +10, OrderDirection.Sell).Explicit(),\n                new TestCaseData(SecurityType.Option, -10, OrderDirection.Buy),\n                new TestCaseData(SecurityType.Option, -10, OrderDirection.Sell),\n                new TestCaseData(SecurityType.FutureOption, 0, OrderDirection.Buy),\n                new TestCaseData(SecurityType.FutureOption, 0, OrderDirection.Sell),\n                new TestCaseData(SecurityType.FutureOption, +10, OrderDirection.Buy),\n                new TestCaseData(SecurityType.FutureOption, +10, OrderDirection.Sell),\n                new TestCaseData(SecurityType.FutureOption, -10, OrderDirection.Buy),\n                new TestCaseData(SecurityType.FutureOption, -10, OrderDirection.Sell),\n            };\n\n        [TestCaseSource(nameof(MarginRemainingTestCases))]\n        public void GetsMarginRemainingForSecurity(SecurityType securityType, int initialHoldingsQuantity,\n            OrderDirection direction)\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SetSecurityInitializer(security => security.FeeModel = new ConstantFeeModel(0));\n            algorithm.SetCash(1000000);\n\n            Security security = null;\n            switch (securityType)\n            {\n                case SecurityType.Equity:\n                    security = algorithm.AddEquity(\"SPY\");\n                    break;\n                case SecurityType.Option:\n                    security = algorithm.AddOptionContract(Symbols.CreateOptionSymbol(\"SPY\", OptionRight.Call, 300, new DateTime(2023, 05, 19)));\n                    break;\n                case SecurityType.FutureOption:\n                    var underlying = algorithm.AddFuture(\"ES\");\n                    security = algorithm.AddFutureOptionContract(Symbols.CreateFutureOptionSymbol(underlying.Symbol,\n                        OptionRight.Call, 300, new DateTime(2023, 05, 19)));\n                    break;\n                default:\n                    Assert.Fail(\"Invalid security type.\");\n                    break;\n            }\n\n            security.SetMarketPrice(new Tick { Value = 100m });\n            security.Holdings.SetHoldings(security.Price, initialHoldingsQuantity);\n\n            var goingInSameDirection = security.Holdings.IsLong && direction == OrderDirection.Buy\n                || security.Holdings.IsShort && direction == OrderDirection.Sell;\n\n            var marginRemaining = algorithm.Portfolio.GetMarginRemaining(security.Symbol, direction);\n\n            if (goingInSameDirection)\n            {\n                Assert.AreEqual(algorithm.Portfolio.MarginRemaining, marginRemaining);\n            }\n            else\n            {\n                var expectedMarginRemaining = algorithm.Portfolio.MarginRemaining\n                    + security.BuyingPowerModel.GetMaintenanceMargin(MaintenanceMarginParameters.ForCurrentHoldings(security))\n                    + Math.Abs(security.BuyingPowerModel.GetInitialMarginRequirement(new InitialMarginParameters(security, security.Holdings.Quantity)));\n                Assert.AreEqual(expectedMarginRemaining, marginRemaining);\n            }\n        }\n\n        [Test]\n        public void CashSettledAssignmentWithProfitOrLossShowsCorrectTag()\n        {\n            _portfolio.SetCash(0);\n\n            // Add underlying SPY\n            _securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n\n            // Add a call option that will be ITM to force assignment\n            _securities.Add(\n                Symbols.SPY_C_192_Feb19_2016,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY_C_192_Feb19_2016),\n                    new Cash(Currencies.USD, 0, 1m),\n                    GetOptionSymbolProperties(Symbols.SPY_C_192_Feb19_2016),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n\n            // SHORT position\n            _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.SetHoldings(1, -2);\n\n            // Underlying > Strike (192)\n            _securities[Symbols.SPY].SetMarketPrice(new Tick { Value = 200 });\n\n            var option = (Option)_securities[Symbols.SPY_C_192_Feb19_2016];\n            option.Underlying = _securities[Symbols.SPY];\n            option.ExerciseSettlement = SettlementType.Cash;\n\n            var holdings = _securities[Symbols.SPY_C_192_Feb19_2016].Holdings.Quantity;\n\n            _transactions.AddOrder(new SubmitOrderRequest(\n                OrderType.OptionExercise,\n                SecurityType.Option,\n                Symbols.SPY_C_192_Feb19_2016,\n                -holdings,\n                0, 0,\n                _securities.UtcTime,\n                \"\"));\n\n            var order = (OptionExerciseOrder)_transactions.GetOrders(x => true).First();\n\n            var fills = option.OptionExerciseModel.OptionExercise(option, order).ToList();\n\n            var assignmentFill = fills.FirstOrDefault(f => f.IsAssignment);\n            Assert.IsNotNull(assignmentFill);\n\n            foreach (var fill in fills)\n            {\n                fill.Ticket = order.ToOrderTicket(_transactions);\n                _portfolio.ProcessFills(new List<OrderEvent> { fill });\n            }\n\n            Assert.AreEqual(\"Assigned. Underlying: 200. Loss: -1400\", assignmentFill.Message);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarDataConfig(SecurityType type, Symbol symbol)\n        {\n            if (type == SecurityType.Equity)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Forex)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Future)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Crypto)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Cfd)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            throw new NotImplementedException(type.ToString());\n        }\n\n        private static OptionSymbolProperties GetOptionSymbolProperties(Symbol symbol)\n        {\n            return new OptionSymbolProperties(SymbolPropertiesDatabase.FromDataFolder().GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, Currencies.USD));\n        }\n\n        private static TimeKeeper TimeKeeper\n        {\n            get { return new TimeKeeper(DateTime.Now, new[] { TimeZones.NewYork }); }\n        }\n\n        class OrderProcessor : IOrderProcessor\n        {\n            private readonly ConcurrentDictionary<int, Order> _orders = new ConcurrentDictionary<int, Order>();\n            private readonly ConcurrentDictionary<int, OrderTicket> _tickets = new ConcurrentDictionary<int, OrderTicket>();\n            public void AddOrder(Order order)\n            {\n                _orders[order.Id] = order;\n            }\n\n            public void AddTicket(OrderTicket ticket)\n            {\n                _tickets[ticket.OrderId] = ticket;\n            }\n            public int OrdersCount { get; private set; }\n            public Order GetOrderById(int orderId)\n            {\n                Order order;\n                _orders.TryGetValue(orderId, out order);\n                return order;\n            }\n\n            public List<Order> GetOrdersByBrokerageId(string brokerageId)\n            {\n                return _orders.Values.Where(o => o.BrokerId.Contains(brokerageId)).Select(o => o.Clone()).ToList();\n            }\n\n            public IEnumerable<OrderTicket> GetOrderTickets(Func<OrderTicket, bool> filter = null)\n            {\n                return _tickets.Values.Where(filter ?? (x => true));\n            }\n\n            public IEnumerable<OrderTicket> GetOpenOrderTickets(Func<OrderTicket, bool> filter = null)\n            {\n                return _tickets.Values.Where(x => x.Status.IsOpen() && (filter == null || filter(x)));\n            }\n\n            public OrderTicket GetOrderTicket(int orderId)\n            {\n                OrderTicket ticket;\n                _tickets.TryGetValue(orderId, out ticket);\n                return ticket;\n            }\n\n            public IEnumerable<Order> GetOrders(Func<Order, bool> filter = null)\n            {\n                return _orders.Values.Where(filter ?? (x => true));\n            }\n\n            public List<Order> GetOpenOrders(Func<Order, bool> filter = null)\n            {\n                return _orders.Values.Where(x => x.Status.IsOpen() && (filter == null || filter(x))).ToList();\n            }\n\n            public OrderTicket Process(OrderRequest request)\n            {\n                throw new NotImplementedException();\n            }\n\n            public ProjectedHoldings GetProjectedHoldings(Security security)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        class TestCurrencyConversion : ICurrencyConversion\n        {\n            public event EventHandler<decimal> ConversionRateUpdated;\n\n            public string SourceCurrency { get; }\n\n            public string DestinationCurrency { get; }\n\n            public decimal ConversionRate { get; set; }\n\n            public IEnumerable<Security> ConversionRateSecurities { get; } = Enumerable.Empty<Security>();\n\n            public TestCurrencyConversion(string sourceCurrency, string destinationCurrency, decimal conversionRate)\n            {\n                SourceCurrency = sourceCurrency;\n                DestinationCurrency = destinationCurrency;\n                ConversionRate = conversionRate;\n            }\n\n            public void Update()\n            {\n                ConversionRate *= 1.01m;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityPortfolioModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Crypto;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityPortfolioModelTests\n    {\n        [Test]\n        public void LastTradeProfit_FlatToLong()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            var fillPrice = 100m;\n            var fillQuantity = 100;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // zero since we're from flat\n            Assert.AreEqual(0, security.Holdings.LastTradeProfit);\n        }\n\n        [Test]\n        public void LastTradeProfit_FlatToShort()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            var fillPrice = 100m;\n            var fillQuantity = -100;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // zero since we're from flat\n            Assert.AreEqual(0, security.Holdings.LastTradeProfit);\n        }\n\n        [Test]\n        public void LastTradeProfit_LongToLonger()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            security.Holdings.SetHoldings(50m, 100);\n\n            var fillPrice = 100m;\n            var fillQuantity = 100;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // zero since we're from flat\n            Assert.AreEqual(0, security.Holdings.LastTradeProfit);\n        }\n\n        [Test]\n        public void LastTradeProfit_LongToFlat()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            security.Holdings.SetHoldings(50m, 100);\n\n            var fillPrice = 100m;\n            var fillQuantity = -security.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // bought @50 and sold @100 = (-50*100)+(100*100 - 1) = 4999\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(5000m, security.Holdings.LastTradeProfit);\n        }\n\n        [Test]\n        public void LastTradeProfit_LongToShort()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            security.Holdings.SetHoldings(50m, 100);\n\n            var fillPrice = 100m;\n            var fillQuantity = -2*security.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // we can only take 'profit' on the closing part of the position, so we closed 100\n            // shares and opened a new for the second 100, so ony the frst 100 go into the calculation\n            // bought @50 and sold @100 = (-50*100)+(100*100 - 1) = 4999\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(5000m, security.Holdings.LastTradeProfit);\n        }\n\n        [Test]\n        public void LastTradeProfit_ShortToShorter()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            security.Holdings.SetHoldings(50m, -100);\n\n            var fillPrice = 100m;\n            var fillQuantity = -100;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            Assert.AreEqual(0, security.Holdings.LastTradeProfit);\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void LastTradeProfit_ShortToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio, accountCurrency);\n\n            security.Holdings.SetHoldings(50m, -100);\n\n            var fillPrice = 100m;\n            var fillQuantity = -security.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // sold @50 and bought @100 = (50*100)+(-100*100 - 1) = -5001\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(-5000m, security.Holdings.LastTradeProfit);\n        }\n\n        public void LastTradeProfit_ShortToLong()\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            var security = InitializeTest(reference, out portfolio);\n\n            security.Holdings.SetHoldings(50m, -100);\n\n            var fillPrice = 100m;\n            var fillQuantity = -2*security.Holdings.Quantity; // flip from -100 to +100\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, security.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // we can only take 'profit' on the closing part of the position, so we closed 100\n            // shares and opened a new for the second 100, so ony the frst 100 go into the calculation\n            // sold @50 and bought @100 = (50*100)+(-100*100 - 1) = -5001\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(-5000m, security.Holdings.LastTradeProfit);\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyEquity_LongToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var equity = new Security(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            equity.Holdings.SetHoldings(50m, 100);\n            portfolio.Securities.Add(equity);\n\n            var fillPrice = 100m;\n            var fillQuantity = -equity.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, equity.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, equity.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            // bought @50 and sold @100 = (-50*100)+(100*100) = 50000 * 10 (conversion rate to account currency)\n            Assert.AreEqual(50000m, equity.Holdings.LastTradeProfit);\n            // sold @100 = (100*100) = 10000 - 1 fee\n            Assert.AreEqual(9999, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0m, equity.Holdings.AveragePrice);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteQuantity);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteHoldingsCost);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteHoldingsValue);\n            Assert.AreEqual(0m, equity.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyEquity_ShortToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var equity = new Security(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            equity.Holdings.SetHoldings(50m, -100);\n            portfolio.Securities.Add(equity);\n\n            var fillPrice = 100m;\n            var fillQuantity = -equity.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, equity.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, equity.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            // sold @50 and bought @100 = (-50*100)+(100*100) = -50000 * 10 (conversion rate to account currency)\n            Assert.AreEqual(-50000m, equity.Holdings.LastTradeProfit);\n            // bought @100 = (-100*100) = -10000 - 1 fee\n            Assert.AreEqual(-10001, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0m, equity.Holdings.AveragePrice);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteQuantity);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteHoldingsCost);\n            Assert.AreEqual(0m, equity.Holdings.AbsoluteHoldingsValue);\n            Assert.AreEqual(0m, equity.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyEquity_FlatToShort(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var equity = new Security(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            portfolio.Securities.Add(equity);\n\n            var fillPrice = 100m;\n            var fillQuantity = -100;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, equity.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, equity.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            Assert.AreEqual(-10, equity.Holdings.NetProfit); // fees\n            Assert.AreEqual(0m, equity.Holdings.LastTradeProfit);\n            // sold @100 = (100*100) = 10000 - 1 fee\n            Assert.AreEqual(9999, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(100m, equity.Holdings.AveragePrice);\n            Assert.AreEqual(100m, equity.Holdings.AbsoluteQuantity);\n\n            equity.SetMarketPrice(new Tick(DateTime.UtcNow, equity.Symbol, 90, 90));\n\n            // -100 quantity * 100 average price * 10 rate = 100000m\n            Assert.AreEqual(100000m, equity.Holdings.AbsoluteHoldingsCost);\n            // -100 quantity * 90 current price * 10 rate = 90000m\n            Assert.AreEqual(90000m, equity.Holdings.AbsoluteHoldingsValue);\n            // (90 average price - 100 current price) * -100 quantity * 10 rate - 1 fee = 9999m\n            Assert.AreEqual(9999m, equity.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyEquity_FlatToLong(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var equity = new Security(\n                Symbols.AAPL,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            portfolio.Securities.Add(equity);\n\n            var fillPrice = 100m;\n            var fillQuantity = 100;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, equity.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, equity.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            Assert.AreEqual(-10, equity.Holdings.NetProfit); // fees\n            Assert.AreEqual(0m, equity.Holdings.LastTradeProfit);\n            // bought @100 = -(100*100) = -10000 - 1 fee\n            Assert.AreEqual(-10001, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(100m, equity.Holdings.AveragePrice);\n            Assert.AreEqual(100m, equity.Holdings.AbsoluteQuantity);\n\n            equity.SetMarketPrice(new Tick(DateTime.UtcNow, equity.Symbol, 110, 110));\n\n            // 100 quantity * 100 average price * 10 rate = 100000m\n            Assert.AreEqual(100000m, equity.Holdings.AbsoluteHoldingsCost);\n            // 100 quantity * 110 current price * 10 rate = 110000m\n            Assert.AreEqual(110000m, equity.Holdings.AbsoluteHoldingsValue);\n            // (110 current price - 100 average price) * 100 quantity * 10 rate - 1 fee = 9999m\n            Assert.AreEqual(9999m, equity.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyFuture_LongToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var future = new Future(\n                Symbols.Fut_SPY_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            future.Holdings.SetHoldings(50m, 100);\n            portfolio.Securities.Add(future);\n\n            var fillPrice = 100m;\n            var fillQuantity = -future.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, future.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, future.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            // bought @50 and sold @100 = (-50*100)+(100*100) = 50000 * 10 (conversion rate to account currency)\n            Assert.AreEqual(50000m, future.Holdings.LastTradeProfit);\n            Assert.AreEqual(49990m, future.Holdings.NetProfit); // LastTradeProfit - fees\n            // bought @50 and sold @100 = (-50*100)+(100*100) = 5000 - 1 fee\n            Assert.AreEqual(4999, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0m, future.Holdings.AveragePrice);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteQuantity);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteHoldingsCost);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteHoldingsValue);\n            Assert.AreEqual(0m, future.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyFuture_ShortToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 0, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var future = new Future(\n                Symbols.Fut_SPY_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            future.Holdings.SetHoldings(50m, -100);\n            portfolio.Securities.Add(future);\n\n            var fillPrice = 100m;\n            var fillQuantity = -future.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, future.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, future.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            // sold @50 and bought @100 = (50*100)+(-100*100) = -50000 * 10 (conversion rate to account currency)\n            Assert.AreEqual(-50000m, future.Holdings.LastTradeProfit);\n            Assert.AreEqual(-50010m, future.Holdings.NetProfit); // LastTradeProfit - fees\n            // sold @50 and bought @100  = (50*100)+(-100*100) = -5000 - 1 fee\n            Assert.AreEqual(-5001, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0m, future.Holdings.AveragePrice);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteQuantity);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteHoldingsCost);\n            Assert.AreEqual(0m, future.Holdings.AbsoluteHoldingsValue);\n            Assert.AreEqual(0m, future.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyFuture_FlatToLong(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 1, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var future = new Future(\n                Symbols.Fut_SPY_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            portfolio.Securities.Add(future);\n\n            var fillPrice = 100m;\n            var fillQuantity = 100;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, future.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, future.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            Assert.AreEqual(0m, future.Holdings.LastTradeProfit);\n            Assert.AreEqual(100m, future.Holdings.Quantity);\n            Assert.AreEqual(100m, future.Holdings.AveragePrice);\n            // had 1 EUR - 1 fee\n            Assert.AreEqual(0, portfolio.CashBook[\"EUR\"].Amount);\n\n            // 100 quantity * 100 average price * 10 rate = 100000m\n            Assert.AreEqual(100000m, future.Holdings.AbsoluteHoldingsCost);\n\n            future.SetMarketPrice(new Tick(DateTime.UtcNow, future.Symbol, 110, 110));\n\n            // 100 quantity * 110 current price * 10 rate = 110000m\n            Assert.AreEqual(110000m, future.Holdings.AbsoluteHoldingsValue);\n            // (110 current price - 100 average price) * 100 quantity * 10 rate - 2.15 fee * 100 quantity = 9785m\n            Assert.AreEqual(9785m, future.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyFuture_FlatToShort(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = new Cash(\"EUR\", 1, 10);\n            portfolio.CashBook.Add(\"EUR\", cash);\n            var future = new Future(\n                Symbols.Fut_SPY_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            portfolio.Securities.Add(future);\n\n            var fillPrice = 100m;\n            var fillQuantity = -100;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, future.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, future.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            Assert.AreEqual(0m, future.Holdings.LastTradeProfit);\n            Assert.AreEqual(-100m, future.Holdings.Quantity);\n            Assert.AreEqual(100m, future.Holdings.AveragePrice);\n            // had 1 EUR - 1 fee\n            Assert.AreEqual(0, portfolio.CashBook[\"EUR\"].Amount);\n\n            // 100 quantity * 100 average price * 10 rate = 100000m\n            Assert.AreEqual(100000m, future.Holdings.AbsoluteHoldingsCost);\n\n            future.SetMarketPrice(new Tick(DateTime.UtcNow, future.Symbol, 110, 110));\n\n            // 100 quantity * 110 current price * 10 rate = 110000m\n            Assert.AreEqual(110000m, future.Holdings.AbsoluteHoldingsValue);\n            // (110 current price - 100 average price) * - 100 quantity * 10 rate - 2.15 fee * 100 quantity = -10215m\n            Assert.AreEqual(-10215m, future.Holdings.TotalCloseProfit());\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyCrypto_LongToFlat(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = portfolio.CashBook.Add(\"EUR\", 0, 10);\n            var btcCash = portfolio.CashBook.Add(\"BTC\", 0, 1000);\n            var crypto = new Crypto(\n                Symbols.BTCEUR,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                btcCash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            crypto.Holdings.SetHoldings(50m, 100);\n            portfolio.Securities.Add(crypto);\n\n            var fillPrice = 100m;\n            var fillQuantity = -crypto.Holdings.Quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, crypto.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, crypto.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            // bought @50 and sold @100 = (-50*100)+(100*100) = 50000 * 10 (conversion rate to account currency)\n            Assert.AreEqual(50000m, crypto.Holdings.LastTradeProfit);\n            // sold @100 * 100 = 10000 - 1 fee\n            Assert.AreEqual(9999, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(0m, crypto.Holdings.AveragePrice);\n            Assert.AreEqual(0m, crypto.Holdings.AbsoluteQuantity);\n        }\n\n        [TestCase(\"USD\")]\n        [TestCase(\"ARG\")]\n        public void NonAccountCurrencyCrypto_FlatToLong(string accountCurrency)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            SecurityPortfolioManager portfolio;\n            InitializeTest(reference, out portfolio, accountCurrency);\n\n            var cash = portfolio.CashBook.Add(\"EUR\", 0, 10);\n            var btcCash = portfolio.CashBook.Add(\"BTC\", 0, 1000);\n            var crypto = new Crypto(\n                Symbols.BTCEUR,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                cash,\n                btcCash,\n                SymbolProperties.GetDefault(\"EUR\"),\n                portfolio.CashBook,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            portfolio.Securities.Add(crypto);\n\n            var fillPrice = 100m;\n            var fillQuantity = 100;\n            var orderFee = new OrderFee(new CashAmount(1m, \"EUR\"));\n            var orderDirection = fillQuantity > 0 ? OrderDirection.Buy : OrderDirection.Sell;\n            var fill = new OrderEvent(1, crypto.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            portfolio.ProcessFills(new List<OrderEvent> {fill});\n\n            // current implementation doesn't back out fees.\n            Assert.AreEqual(10, crypto.Holdings.TotalFees); // 1 * 10 (conversion rate to account currency)\n            Assert.AreEqual(0m, crypto.Holdings.LastTradeProfit);\n            Assert.AreEqual(100m, crypto.Holdings.Quantity);\n            Assert.AreEqual(100m, crypto.Holdings.AveragePrice);\n            // had 0 EUR - 1 fee\n            Assert.AreEqual(-10001, portfolio.CashBook[\"EUR\"].Amount);\n            Assert.AreEqual(100, portfolio.CashBook[\"BTC\"].Amount);\n        }\n\n        [Test]\n        public void ITMOptionExerciseWinLossCount(\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection,\n            [Values] bool win)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            var option = InitializeTestWithOption(reference, out var portfolio);\n            var underlying = option.Underlying;\n\n            option.SetMarketPrice(new Tick { Value = 100m });\n\n            var underlyingPrice = 0m;\n            if (win)\n            {\n                underlyingPrice = orderDirection == OrderDirection.Buy ? 300m : 290m;\n            }\n            else\n            {\n                underlyingPrice = orderDirection == OrderDirection.Buy ? 290m : 300m;\n            }\n            underlying.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var orderProcessor = new FakeOrderProcessor();\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            var request = new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, quantity, 0, 0, reference, \"\");\n            var order = Order.CreateOrder(request);\n            order.Id = 1;\n            orderProcessor.AddOrder(order);\n            portfolio.Transactions.SetOrderProcessor(orderProcessor);\n\n            var fillPrice = 100m;\n            var fillQuantity = quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee) { Ticket = new OrderTicket(portfolio.Transactions, request) };\n            fill.IsInTheMoney = true;\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(0, portfolio.Transactions.LossCount);\n\n            // Now close the option position simulating an assignment on expiration\n            fillPrice = 0;\n            fillQuantity *= -1;\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, fillQuantity, 0, 0,\n                reference, \"\"));\n            fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, closingOrderDirection, fillPrice, fillQuantity, orderFee)\n            {\n                IsInTheMoney = true,\n                Ticket = ticket,\n            };\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(win ? 1 : 0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(win ? 0 : 1, portfolio.Transactions.LossCount);\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void OTMOptionExerciseWinLossCount(OrderDirection orderDirection)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            var option = InitializeTestWithOption(reference, out var portfolio);\n            var underlying = option.Underlying;\n\n            option.SetMarketPrice(new Tick { Value = 100m });\n            underlying.SetMarketPrice(new Tick { Value = 150m });\n\n            var orderProcessor = new FakeOrderProcessor();\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            var request = new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, quantity, 0, 0, reference, \"\");\n            var order = Order.CreateOrder(request);\n            order.Id = 1;\n            orderProcessor.AddOrder(order);\n            portfolio.Transactions.SetOrderProcessor(orderProcessor);\n\n            var fillPrice = 100m;\n            var fillQuantity = quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee);\n            fill.IsInTheMoney = true;\n            fill.Ticket = new OrderTicket(portfolio.Transactions, request);\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(0, portfolio.Transactions.LossCount);\n\n            // Now close the option position simulating an assignment on expiration\n            fillPrice = 0;\n            fillQuantity *= -1;\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, fillQuantity, 0, 0,\n                reference, \"\"));\n            fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, closingOrderDirection, fillPrice, fillQuantity, orderFee)\n            {\n                IsInTheMoney = true,\n                Ticket = ticket,\n            };\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            var expectedWin = orderDirection == OrderDirection.Buy ? false : true;\n            Assert.AreEqual(expectedWin ? 1 : 0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(expectedWin ? 0 : 1, portfolio.Transactions.LossCount);\n        }\n\n        [Test]\n        public void OptionPositionCloseWithoutExerciseWinLossCount(\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection,\n            [Values] bool win)\n        {\n            var reference = new DateTime(2016, 02, 16, 11, 53, 30);\n            var option = InitializeTestWithOption(reference, out var portfolio);\n            var underlying = option.Underlying;\n\n            var initialOptionPrice = 100m;\n            option.SetMarketPrice(new Tick { Value = initialOptionPrice });\n            underlying.SetMarketPrice(new Tick { Value = 300m });\n\n            var orderProcessor = new FakeOrderProcessor();\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            var request = new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, quantity, 0, 0, reference, \"\");\n            var order = Order.CreateOrder(request);\n            order.Id = 1;\n            orderProcessor.AddOrder(order);\n            portfolio.Transactions.SetOrderProcessor(orderProcessor);\n\n            var fillPrice = 100m;\n            var fillQuantity = quantity;\n            var orderFee = new OrderFee(new CashAmount(1m, Currencies.USD));\n            var fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, orderDirection, fillPrice, fillQuantity, orderFee) { Ticket = new OrderTicket(portfolio.Transactions, request) };\n            fill.IsInTheMoney = true;\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(0, portfolio.Transactions.LossCount);\n\n            // Before closing, update option market price\n            var finalOptionPrice = 0m;\n            if (win)\n            {\n                finalOptionPrice = orderDirection == OrderDirection.Buy ? 150m : 50m;\n            }\n            else\n            {\n                finalOptionPrice = orderDirection == OrderDirection.Buy ? 50m : 150m;\n            }\n            option.SetMarketPrice(new Tick { Value = finalOptionPrice });\n\n            // Now close the option position simulating an assignment on expiration\n            fillPrice = finalOptionPrice;\n            fillQuantity *= -1;\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, fillQuantity, 0, 0,\n                reference, \"\"));\n            fill = new OrderEvent(1, option.Symbol, reference, OrderStatus.Filled, closingOrderDirection, fillPrice, fillQuantity, orderFee)\n            {\n                IsInTheMoney = true,\n                Ticket = ticket,\n            };\n            portfolio.ProcessFills(new List<OrderEvent> { fill });\n\n            Assert.AreEqual(win ? 1 : 0, portfolio.Transactions.WinCount);\n            Assert.AreEqual(win ? 0 : 1, portfolio.Transactions.LossCount);\n        }\n\n        private Security InitializeTest(DateTime reference,\n            out SecurityPortfolioManager portfolio,\n            string accountCurrency = \"USD\")\n        {\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetMarketPrice(new Tick { Value = 100 });\n            var timeKeeper = new TimeKeeper(reference);\n            var securityManager = new SecurityManager(timeKeeper);\n            securityManager.Add(security);\n            var transactionManager = new SecurityTransactionManager(null, securityManager);\n            portfolio = new SecurityPortfolioManager(securityManager, transactionManager, new AlgorithmSettings());\n            portfolio.SetCash(accountCurrency, 100 * 1000m, 1m);\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.AreEqual(100*1000m, portfolio.CashBook[accountCurrency].Amount);\n\n            portfolio.SetCash(security.QuoteCurrency.Symbol, 0, 1m);\n            return security;\n        }\n\n        private Option InitializeTestWithOption(DateTime reference,\n            out SecurityPortfolioManager portfolio,\n            string accountCurrency = \"USD\")\n        {\n            var underlying = InitializeTest(reference, out portfolio, accountCurrency);\n            var option = new Option(\n                Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                underlying\n            );\n\n            portfolio.Securities.Add(option);\n\n            return option;\n        }\n\n        private static SubscriptionDataConfig CreateTradeBarConfig()\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityPositionGroupBuyingPowerModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NodaTime;\nusing NUnit.Framework;\n\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Positions;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityPositionGroupBuyingPowerModelTests\n    {\n        private QCAlgorithm _algorithm;\n        private SecurityPortfolioManager _portfolio;\n        private Security _security;\n\n        [SetUp]\n        public void Setup()\n        {\n            _algorithm = new AlgorithmStub();\n            _algorithm.SetCash(100000);\n            _portfolio = _algorithm.Portfolio;\n\n            _security = new(\n                Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(Currencies.USD, 1, 1),\n                // Only for testing with a lot size different than 1\n                new SymbolProperties(string.Empty, Currencies.USD, 1, 0.01m, 0.01m, string.Empty),\n                new IdentityCurrencyConverter(Currencies.USD),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache());\n            _security.SetMarketPrice(new Tick { Value = 200m });\n\n            _algorithm.Securities.Add(_security);\n\n        }\n\n        [Test]\n        public void GetsTheCorrectMaximumNumberOfLotsForTargetBuyingPower([Values(0.2, 0.75, 1)] decimal targetBuyingPower)\n        {\n            var buyingPowerModel = new SecurityPositionGroupBuyingPowerModel();\n            var positionGroup = new PositionGroup(\n                buyingPowerModel,\n                -10,\n                new Position(_security.Symbol, -10, 1)\n            );\n\n            var maxQuantityParameters = new GetMaximumOrderQuantityForTargetBuyingPowerParameters(_portfolio, _security, targetBuyingPower, 0);\n            var maxQuantityResult = _security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(maxQuantityParameters);\n\n            Assert.IsFalse(maxQuantityResult.IsError);\n            Assert.AreNotEqual(maxQuantityResult.Quantity, 0);\n\n            var maxLotsParameters = new GetMaximumLotsForTargetBuyingPowerParameters(_portfolio, positionGroup, targetBuyingPower, 0);\n            var maxLotsResult = buyingPowerModel.GetMaximumLotsForTargetBuyingPower(maxLotsParameters);\n\n            Assert.IsFalse(maxLotsResult.IsError);\n            Assert.AreEqual(maxQuantityResult.Quantity, maxLotsResult.NumberOfLots * _security.SymbolProperties.LotSize);\n        }\n\n        [Test]\n        public void GetsTheCorrectMaximumNumberOfLotsForDeltaBuyingPower([Values(0.2, 0.75, 1)] decimal targetBuyingPower)\n        {\n            var buyingPowerModel = new SecurityPositionGroupBuyingPowerModel();\n            var positionGroup = new PositionGroup(\n                buyingPowerModel,\n                -10,\n                new Position(_security.Symbol, -10, 1)\n            );\n\n            var deltaBuyingPower = _portfolio.TotalPortfolioValue * targetBuyingPower;\n\n            var maxQuantityParameters = new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(_portfolio, _security, deltaBuyingPower, 0);\n            var maxQuantityResult = _security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(maxQuantityParameters);\n\n            Assert.IsFalse(maxQuantityResult.IsError);\n            Assert.AreNotEqual(maxQuantityResult.Quantity, 0);\n\n            var maxLotsarameters = new GetMaximumLotsForDeltaBuyingPowerParameters(_portfolio, positionGroup, deltaBuyingPower, 0);\n            var maxLotsForDeltaResult = buyingPowerModel.GetMaximumLotsForDeltaBuyingPower(maxLotsarameters);\n\n            Assert.IsFalse(maxLotsForDeltaResult.IsError);\n            Assert.AreEqual(maxQuantityResult.Quantity, maxLotsForDeltaResult.NumberOfLots * _security.SymbolProperties.LotSize);\n        }\n\n        [Test]\n        public void GetTheSameQuantityAndLotsForTargetAndDeltaBuyingPower([Values(0.2, 0.5, 0.75, 1)] decimal targetBuyingPower)\n        {\n            var buyingPowerModel = new SecurityPositionGroupBuyingPowerModel();\n            var positionGroup = new PositionGroup(\n                buyingPowerModel,\n                -10,\n                new Position(_security.Symbol, -10, 1)\n            );\n\n            // maximum quantity and lots for target buying power\n            var maxQuantityForTargetParameters = new GetMaximumOrderQuantityForTargetBuyingPowerParameters(_portfolio, _security, targetBuyingPower, 0);\n            var maxQuantityForTargetResult = _security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(maxQuantityForTargetParameters);\n\n            var maxLotsForTargetParameters = new GetMaximumLotsForTargetBuyingPowerParameters(_portfolio, positionGroup, targetBuyingPower, 0);\n            var maxLotsForTargetResult = buyingPowerModel.GetMaximumLotsForTargetBuyingPower(maxLotsForTargetParameters);\n\n            // maximum quantity and lots for delta buying power\n            var deltaBuyingPower = _portfolio.TotalPortfolioValue * targetBuyingPower;\n\n            var maxQuantityForDeltaParameters = new GetMaximumOrderQuantityForDeltaBuyingPowerParameters(_portfolio, _security, deltaBuyingPower, 0);\n            var maxQuantityForDeltaResult = _security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(maxQuantityForDeltaParameters);\n\n            var maxLotsForDeltaParameters = new GetMaximumLotsForDeltaBuyingPowerParameters(_portfolio, positionGroup, deltaBuyingPower, 0);\n            var maxLotsForDeltaResult = buyingPowerModel.GetMaximumLotsForDeltaBuyingPower(maxLotsForDeltaParameters);\n\n            // maximum quantity should be the same, since the expected delta buying power is the same as the target buying power used\n            Assert.IsFalse(maxQuantityForTargetResult.IsError);\n            Assert.IsFalse(maxLotsForTargetResult.IsError);\n            Assert.IsFalse(maxQuantityForDeltaResult.IsError);\n            Assert.IsFalse(maxLotsForDeltaResult.IsError);\n            Assert.AreNotEqual(maxQuantityForTargetResult.Quantity, 0);\n            Assert.AreNotEqual(maxLotsForTargetResult.NumberOfLots, 0);\n            Assert.AreEqual(maxQuantityForTargetResult.Quantity, maxQuantityForDeltaResult.Quantity);\n            Assert.AreEqual(maxLotsForTargetResult.NumberOfLots, maxLotsForDeltaResult.NumberOfLots);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityServiceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    public class SecurityServiceTests : ISecurityInitializerProvider\n    {\n        private ISecurityService _securityService;\n        private SubscriptionManager _subscriptionManager;\n        private MarketHoursDatabase _marketHoursDatabase;\n        public ISecurityInitializer SecurityInitializer => QuantConnect.Securities.SecurityInitializer.Null;\n\n        [SetUp]\n        public void Setup()\n        {\n            SymbolCache.Clear();\n            _subscriptionManager = new SubscriptionManager(NullTimeKeeper.Instance);\n            var dataManager = new DataManagerStub();\n            _subscriptionManager.SetDataManager(dataManager);\n            _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            _securityService = dataManager.SecurityService;\n        }\n\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.FXCM)]\n        [TestCase(\"EURUSD\", SecurityType.Forex, Market.Oanda)]\n        [TestCase(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase)]\n        public void CanCreate_ForexOrCrypto_WithCorrectSubscriptions(string ticker, SecurityType type, string market)\n        {\n            var symbol = Symbol.Create(ticker, type, market);\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(QuoteBar), symbol, Resolution.Second, false, false, false);\n            var actual = _securityService.CreateSecurity(symbol, configs, 1.0m, false);\n\n            Assert.AreEqual(actual.Subscriptions.Count(), 1);\n            Assert.AreEqual(actual.Subscriptions.First().Type, typeof(QuoteBar));\n            Assert.AreEqual(actual.Subscriptions.First().TickType, TickType.Quote);\n        }\n\n        [Test]\n        public void CanCreate_CanonicalOption_WithCorrectSubscriptions()\n        {\n            var optionSymbol = Symbol.Create(\"GOOG\", SecurityType.Option, Market.USA);\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(OptionUniverse), optionSymbol, Resolution.Minute, false, false, false);\n            var option = _securityService.CreateSecurity(optionSymbol, configs, 1.0m, false);\n\n            Assert.AreEqual(option.Subscriptions.Count(), 1);\n            Assert.AreEqual(option.Subscriptions.First().Type, typeof(OptionUniverse));\n            Assert.AreEqual(option.Subscriptions.First().TickType, TickType.Quote);\n        }\n\n\n        [Test]\n        public void CanCreate_Equity_WithCorrectSubscriptions()\n        {\n            var equitySymbol = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(TradeBar), equitySymbol, Resolution.Second, false, false, false);\n            var equity = _securityService.CreateSecurity(equitySymbol, configs, 1.0m, false);\n\n            Assert.AreEqual(equity.Subscriptions.Count(), 1);\n            Assert.AreEqual(equity.Subscriptions.First().Type, typeof(TradeBar));\n            Assert.AreEqual(equity.Subscriptions.First().TickType, TickType.Trade);\n        }\n\n        [Test]\n        public void CanCreate_Cfd_WithCorrectSubscriptions()\n        {\n            var symbol = Symbol.Create(\"abc\", SecurityType.Cfd, Market.USA);\n            _marketHoursDatabase.SetEntryAlwaysOpen(Market.USA, \"abc\", SecurityType.Cfd, TimeZones.NewYork);\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(QuoteBar), symbol, Resolution.Second, false, false, false);\n            var cfd = _securityService.CreateSecurity(symbol, configs, 1.0m, false);\n\n            Assert.AreEqual(cfd.Subscriptions.Count(), 1);\n            Assert.AreEqual(cfd.Subscriptions.First().Type, typeof(QuoteBar));\n            Assert.AreEqual(cfd.Subscriptions.First().TickType, TickType.Quote);\n        }\n\n        [Test]\n        public void CanCreate_CustomSecurities_WithCorrectSubscriptions()\n        {\n            var symbol = new Symbol(SecurityIdentifier.GenerateBase(null, \"BTC\", Market.USA), \"BTC\");\n            _marketHoursDatabase.SetEntryAlwaysOpen(Market.USA, \"BTC\", SecurityType.Base, TimeZones.NewYork);\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(LiveTradingFeaturesAlgorithm.Bitcoin), symbol, Resolution.Second, false, false, false);\n            var security = _securityService.CreateSecurity(symbol, configs, 1.0m, false);\n\n            Assert.AreEqual(security.Subscriptions.Count(), 1);\n            Assert.AreEqual(security.Subscriptions.First().Type, typeof(LiveTradingFeaturesAlgorithm.Bitcoin));\n            Assert.AreEqual(security.Subscriptions.First().TickType, TickType.Trade);\n        }\n\n        [Test]\n        public void ThrowOnCreateCryptoNotDescribedInCSV()\n        {\n            var symbol = Symbol.Create(\"ABCDEFG\", SecurityType.Crypto, Market.Coinbase);\n\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(QuoteBar), symbol, Resolution.Minute, false, false, false);\n                var actual = _securityService.CreateSecurity(symbol, configs, 1.0m, false);\n            }, \"Symbol can't be found in the Symbol Properties Database\");\n        }\n\n        [Test]\n        public void CanCreate_ConcreteOptions_WithCorrectSubscriptions()\n        {\n            var optionSymbol = Symbol.CreateOption(Symbols.SPY, Market.USA, OptionStyle.European, OptionRight.Put, 195.50m,\n                new DateTime(2015, 09, 18));\n\n            var subscriptionTypes = new List<Tuple<Type, TickType>>\n            {\n                new Tuple<Type, TickType>(typeof(TradeBar), TickType.Trade),\n                new Tuple<Type, TickType>(typeof(QuoteBar), TickType.Quote),\n                new Tuple<Type, TickType>(typeof(OpenInterest), TickType.OpenInterest)\n            };\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(optionSymbol, Resolution.Minute, false, false, false, false, false, subscriptionTypes);\n            var security = _securityService.CreateSecurity(optionSymbol, configs, 1.0m, false);\n\n            Assert.IsFalse(optionSymbol.IsCanonical());\n\n            Assert.AreEqual(security.Subscriptions.Count(), 3);\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.OpenInterest && x.Type == typeof(OpenInterest)));\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.Quote && x.Type == typeof(QuoteBar)));\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.Trade && x.Type == typeof(TradeBar)));\n        }\n\n        [Test]\n        public void CanCreate_ConcreteFutures_WithCorrectSubscriptions()\n        {\n            var identifier = SecurityIdentifier.GenerateFuture(new DateTime(2020, 12, 15), \"ED\", Market.CME);\n            var symbol = new Symbol(identifier, \"ED\", Symbol.Empty);\n\n            var subscriptionTypes = new List<Tuple<Type, TickType>>\n            {\n                new Tuple<Type, TickType>(typeof(TradeBar), TickType.Trade),\n                new Tuple<Type, TickType>(typeof(QuoteBar), TickType.Quote),\n                new Tuple<Type, TickType>(typeof(OpenInterest), TickType.OpenInterest)\n            };\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(symbol, Resolution.Second, false, false, false, false, false, subscriptionTypes);\n            var security = _securityService.CreateSecurity(symbol, configs, 1.0m, false);\n\n            Assert.IsFalse(symbol.IsCanonical());\n\n            Assert.AreEqual(security.Subscriptions.Count(), 3);\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.OpenInterest && x.Type == typeof(OpenInterest)));\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.Quote && x.Type == typeof(QuoteBar)));\n            Assert.IsTrue(security.Subscriptions.Any(x => x.TickType == TickType.Trade && x.Type == typeof(TradeBar)));\n        }\n\n        [TestCase(\"BTGUSDT\", SecurityType.CryptoFuture, Market.Binance)]\n        [TestCase(\"USDTEUR\", SecurityType.Forex, Market.Oanda)]\n        public void CannotCreateSecurityWhenBaseCurrencyNotFound(string ticker, SecurityType securityType, string market)\n        {\n            var symbol = QuantConnect.Symbol.Create(ticker, securityType, market);\n            var subscriptionTypes = new List<Tuple<Type, TickType>>\n            {\n                new Tuple<Type, TickType>(typeof(TradeBar), TickType.Trade),\n                new Tuple<Type, TickType>(typeof(QuoteBar), TickType.Quote),\n                new Tuple<Type, TickType>(typeof(OpenInterest), TickType.OpenInterest)\n            };\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(symbol, Resolution.Second, false, false, false, false, false, subscriptionTypes);\n            Assert.Throws<ArgumentException>(() => _securityService.CreateSecurity(symbol, configs, 1.0m, false));\n        }\n\n        [Test]\n        public void CreatesEquityOptionWithContractMultiplierEqualsToContractUnitOfTrade()\n        {\n            var underlying = Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n            var equityOption = Symbol.CreateOption(\n                underlying,\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                320m,\n                new DateTime(2020, 12, 18));\n\n            var subscriptionTypes = new List<Tuple<Type, TickType>>\n            {\n                new Tuple<Type, TickType>(typeof(TradeBar), TickType.Trade),\n                new Tuple<Type, TickType>(typeof(QuoteBar), TickType.Quote),\n                new Tuple<Type, TickType>(typeof(OpenInterest), TickType.OpenInterest)\n            };\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(equityOption, Resolution.Minute, true, false, false, false, false, subscriptionTypes);\n            var equityOptionSecurity = (QuantConnect.Securities.Option.Option)_securityService.CreateSecurity(equityOption, configs, 1.0m);\n\n            Assert.AreEqual(100, equityOptionSecurity.ContractMultiplier);\n            Assert.AreEqual(100, equityOptionSecurity.ContractUnitOfTrade);\n        }\n\n        [Test]\n        public void CreatesFutureOptionWithContractMultiplierEqualsToFutureContractMultiplier()\n        {\n            var underlying = Symbol.CreateFuture(\n                QuantConnect.Securities.Futures.Indices.SP500EMini,\n                Market.CME,\n                new DateTime(2020, 12, 18));\n\n            var futureOption = Symbol.CreateOption(\n                underlying,\n                Market.CME,\n                OptionStyle.American,\n                OptionRight.Call,\n                3250m,\n                new DateTime(2020, 12, 18));\n\n            var subscriptionTypes = new List<Tuple<Type, TickType>>\n            {\n                new Tuple<Type, TickType>(typeof(TradeBar), TickType.Trade),\n                new Tuple<Type, TickType>(typeof(QuoteBar), TickType.Quote),\n                new Tuple<Type, TickType>(typeof(OpenInterest), TickType.OpenInterest)\n            };\n\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(futureOption, Resolution.Minute, true, false, false, false, false, subscriptionTypes);\n            var futureOptionSecurity = (QuantConnect.Securities.Option.Option)_securityService.CreateSecurity(futureOption, configs, 1.0m);\n\n            Assert.AreEqual(50, futureOptionSecurity.ContractMultiplier);\n            Assert.AreEqual(1, futureOptionSecurity.ContractUnitOfTrade);\n        }\n\n        [Test]\n        public void AddPrimaryExchangeToSecurityObject()\n        {\n            // Arrange\n            var equitySymbol = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var mockedPrimaryExchangeProvider = new Mock<IPrimaryExchangeProvider>();\n            mockedPrimaryExchangeProvider.Setup(pep => pep.GetPrimaryExchange(equitySymbol.ID)).Returns(Exchange.NASDAQ);\n\n            var algorithm = new AlgorithmStub();\n            var securityService = new SecurityService(algorithm.Portfolio.CashBook,\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                algorithm,\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCacheProvider(algorithm.Portfolio),\n                mockedPrimaryExchangeProvider.Object,\n                algorithm: algorithm);\n            var configs = _subscriptionManager.SubscriptionDataConfigService.Add(typeof(TradeBar), equitySymbol, Resolution.Second, false, false, false);\n\n            // Act\n            var equity = securityService.CreateSecurity(equitySymbol, configs, 1.0m, false);\n\n            // Assert\n            Assert.AreEqual(equity.Subscriptions.Count(), 1);\n            Assert.AreEqual(equity.Subscriptions.First().Type, typeof(TradeBar));\n            Assert.AreEqual(equity.Subscriptions.First().TickType, TickType.Trade);\n            Assert.AreEqual(((QuantConnect.Securities.Equity.Equity)equity).PrimaryExchange, Exchange.NASDAQ);\n        }\n\n        [Test]\n        public void CreateSecurityDoesNotThrowWithNullAlgorithm()\n        {\n            var startDate = new DateTime(2024, 1, 1);\n            var securityManager = new SecurityManager(new TimeKeeper(startDate, new[] { TimeZones.Utc }));\n\n            var securityService = new SecurityService(\n                new CashBook(),\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                new SecurityInitializerProvider(new FuncSecurityInitializer(security => { })),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(\n                    new SecurityPortfolioManager(securityManager,\n                        new SecurityTransactionManager(null, securityManager),\n                        new AlgorithmSettings())),\n                new MapFilePrimaryExchangeProvider(\n                    Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(\n                        Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"))),\n                algorithm: null\n            );\n\n            securityManager.SetSecurityService(securityService);\n\n            Assert.DoesNotThrow(() =>\n            {\n                var symbol = Symbol.Create(\"TEST\", SecurityType.Equity, Market.USA);\n                var security = securityManager.CreateSecurity(symbol, new List<SubscriptionDataConfig>(), underlying: null);\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Slippage;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Indicators;\nusing Microsoft.CSharp.RuntimeBinder;\nusing Python.Runtime;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityTests\n    {\n        [Test]\n        public void SimplePropertiesTests()\n        {\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            var config = CreateTradeBarConfig();\n            var security = new Security(\n                exchangeHours,\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            Assert.AreEqual(config, security.Subscriptions.Single());\n            Assert.AreEqual(config.Symbol, security.Symbol);\n            Assert.AreEqual(config.SecurityType, security.Type);\n            Assert.AreEqual(config.Resolution, security.Resolution);\n            Assert.AreEqual(config.FillDataForward, security.IsFillDataForward);\n            Assert.AreEqual(exchangeHours, security.Exchange.Hours);\n        }\n\n        [Test]\n        public void ConstructorTests()\n        {\n            var security = GetSecurity();\n\n            Assert.IsNotNull(security.Exchange);\n            Assert.IsInstanceOf<SecurityExchange>(security.Exchange);\n            Assert.IsNotNull(security.Cache);\n            Assert.IsInstanceOf<SecurityCache>(security.Cache);\n            Assert.IsNotNull(security.PortfolioModel);\n            Assert.IsInstanceOf<SecurityPortfolioModel>(security.PortfolioModel);\n            Assert.IsNotNull(security.FillModel);\n            Assert.IsInstanceOf<ImmediateFillModel>(security.FillModel);\n            Assert.IsNotNull(security.PortfolioModel);\n            Assert.IsInstanceOf<InteractiveBrokersFeeModel>(security.FeeModel);\n            Assert.IsNotNull(security.SlippageModel);\n            Assert.IsInstanceOf<NullSlippageModel>(security.SlippageModel);\n            Assert.IsNotNull(security.SettlementModel);\n            Assert.IsInstanceOf<ImmediateSettlementModel>(security.SettlementModel);\n            Assert.IsNotNull(security.BuyingPowerModel);\n            Assert.IsInstanceOf<SecurityMarginModel>(security.BuyingPowerModel);\n            Assert.IsNotNull(security.DataFilter);\n            Assert.IsInstanceOf<SecurityDataFilter>(security.DataFilter);\n        }\n\n        [Test]\n        public void HoldingsTests()\n        {\n            var security = GetSecurity();\n\n            // Long 100 stocks test\n            security.Holdings.SetHoldings(100m, 100);\n\n            Assert.AreEqual(100m, security.Holdings.AveragePrice);\n            Assert.AreEqual(100, security.Holdings.Quantity);\n            Assert.IsTrue(security.HoldStock);\n            Assert.IsTrue(security.Invested);\n            Assert.IsTrue(security.Holdings.IsLong);\n            Assert.IsFalse(security.Holdings.IsShort);\n\n            // Short 100 stocks test\n            security.Holdings.SetHoldings(100m, -100);\n\n            Assert.AreEqual(100m, security.Holdings.AveragePrice);\n            Assert.AreEqual(-100, security.Holdings.Quantity);\n            Assert.IsTrue(security.HoldStock);\n            Assert.IsTrue(security.Invested);\n            Assert.IsFalse(security.Holdings.IsLong);\n            Assert.IsTrue(security.Holdings.IsShort);\n\n            // Flat test\n            security.Holdings.SetHoldings(100m, 0);\n\n            Assert.AreEqual(100m, security.Holdings.AveragePrice);\n            Assert.AreEqual(0, security.Holdings.Quantity);\n            Assert.IsFalse(security.HoldStock);\n            Assert.IsFalse(security.Invested);\n            Assert.IsFalse(security.Holdings.IsLong);\n            Assert.IsFalse(security.Holdings.IsShort);\n        }\n\n        [TestCase(1)]\n        [TestCase(-1)]\n        public void QuantityBelowLotSizeNotInvested(int side)\n        {\n            var security = GetSecurity();\n            var belowMinimumLotSize = security.SymbolProperties.LotSize - 0.001m;\n            security.Holdings.SetHoldings(100m, belowMinimumLotSize * side);\n\n            Assert.AreEqual(100m, security.Holdings.AveragePrice);\n            Assert.AreEqual(belowMinimumLotSize * side, security.Holdings.Quantity);\n            Assert.IsFalse(security.HoldStock);\n            Assert.IsFalse(security.Invested);\n            Assert.IsFalse(security.Holdings.Invested);\n            Assert.IsFalse(security.Holdings.HoldStock);\n\n            security.Holdings.SetHoldings(100m, security.SymbolProperties.LotSize * side);\n            Assert.AreEqual(security.SymbolProperties.LotSize * side, security.Holdings.Quantity);\n            Assert.IsTrue(security.HoldStock);\n            Assert.IsTrue(security.Invested);\n            Assert.IsTrue(security.Holdings.HoldStock);\n            Assert.IsTrue(security.Holdings.Invested);\n        }\n\n        [Test]\n        public void UpdatingSecurityPriceTests()\n        {\n            var security = GetSecurity();\n\n            // Update securuty price with a TradeBar\n            security.SetMarketPrice(new TradeBar(DateTime.Now, Symbols.SPY, 101m, 103m, 100m, 102m, 100000));\n\n            Assert.AreEqual(101m, security.Open);\n            Assert.AreEqual(103m, security.High);\n            Assert.AreEqual(100m, security.Low);\n            Assert.AreEqual(102m, security.Close);\n            Assert.AreEqual(100000, security.Volume);\n\n            // High/Close property is only modified by IBar instances\n            security.SetMarketPrice(new Tick(DateTime.Now, Symbols.SPY, 104m, 104m, 104m));\n            Assert.AreEqual(103m, security.High);\n            Assert.AreEqual(102m, security.Close);\n            Assert.AreEqual(104m, security.Price);\n\n            // Low/Close property is only modified by IBar instances\n            security.SetMarketPrice(new Tick(DateTime.Now, Symbols.SPY, 99m, 99m, 99m));\n            Assert.AreEqual(100m, security.Low);\n            Assert.AreEqual(102m, security.Close);\n            Assert.AreEqual(99m, security.Price);\n        }\n\n        [Test]\n        public void SetLeverageTest()\n        {\n            var security = GetSecurity();\n\n            security.SetLeverage(4m);\n            Assert.AreEqual(4m,security.Leverage);\n\n            security.SetLeverage(5m);\n            Assert.AreEqual(5m, security.Leverage);\n\n            Assert.That(() => security.SetLeverage(0.1m),\n                Throws.TypeOf<ArgumentException>().With.Message.EqualTo(\"Leverage must be greater than or equal to 1.\"));\n        }\n\n        [Test]\n        public void DefaultDataNormalizationModeForOptionsIsRaw()\n        {\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY_P_192_Feb19_2016,\n                    Resolution.Minute,\n                    DateTimeZone.Utc,\n                    DateTimeZone.Utc,\n                    true,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            Assert.AreEqual(option.DataNormalizationMode, DataNormalizationMode.Raw);\n        }\n\n        [Test]\n        public void SetDataNormalizationForOptions()\n        {\n            var option = new Option(\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY_P_192_Feb19_2016,\n                    Resolution.Minute,\n                    DateTimeZone.Utc,\n                    DateTimeZone.Utc,\n                    true,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            Assert.DoesNotThrow(() => { option.SetDataNormalizationMode(DataNormalizationMode.Raw); });\n\n            Assert.Throws(typeof(ArgumentException), () => { option.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { option.SetDataNormalizationMode(DataNormalizationMode.SplitAdjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { option.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.Throws(typeof(ArgumentException), () => { option.SetDataNormalizationMode(DataNormalizationMode.TotalReturn); });\n        }\n\n        [Test]\n        public void SetDataNormalizationForEquities()\n        {\n            var equity = new QuantConnect.Securities.Equity.Equity(\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    DateTimeZone.Utc,\n                    DateTimeZone.Utc,\n                    true,\n                    false,\n                    false\n                ),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null\n            );\n\n            Assert.DoesNotThrow(() => { equity.SetDataNormalizationMode(DataNormalizationMode.Raw); });\n            Assert.DoesNotThrow(() => { equity.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.DoesNotThrow(() => { equity.SetDataNormalizationMode(DataNormalizationMode.SplitAdjusted); });\n            Assert.DoesNotThrow(() => { equity.SetDataNormalizationMode(DataNormalizationMode.Adjusted); });\n            Assert.DoesNotThrow(() => { equity.SetDataNormalizationMode(DataNormalizationMode.TotalReturn); });\n        }\n\n        [Test]\n        public void TickQuantityUpdatedInSecurityCache()\n        {\n            var tick1 = new Tick();\n            tick1.Update(1, 1, 1, 10, 1, 1);\n\n            var tick2 = new Tick();\n            tick2.Update(1, 1, 1, 20, 1, 1);\n\n            var securityCache = new SecurityCache();\n\n            Assert.AreEqual(0, securityCache.Volume);\n\n            securityCache.AddData(tick1);\n\n            Assert.AreEqual(10, securityCache.Volume);\n\n            securityCache.AddData(tick2);\n\n            Assert.AreEqual(20, securityCache.Volume);\n        }\n\n        [Test]\n        public void InvokingCacheStoreData_UpdatesSecurityData_ByTypeName()\n        {\n            var security = GetSecurity();\n            var tradeBars = new List<TradeBar>\n            {\n                new TradeBar(DateTime.UtcNow, security.Symbol, 10m, 20m, 5m, 15m, 10000)\n            };\n\n            security.Cache.StoreData(tradeBars, typeof(TradeBar));\n\n            TradeBar fromSecurityData = security.Data.GetAll<TradeBar>()[0];\n            Assert.AreEqual(tradeBars[0].Time, fromSecurityData.Time);\n            Assert.AreEqual(tradeBars[0].Symbol, fromSecurityData.Symbol);\n            Assert.AreEqual(tradeBars[0].Open, fromSecurityData.Open);\n            Assert.AreEqual(tradeBars[0].High, fromSecurityData.High);\n            Assert.AreEqual(tradeBars[0].Low, fromSecurityData.Low);\n            Assert.AreEqual(tradeBars[0].Close, fromSecurityData.Close);\n            Assert.AreEqual(tradeBars[0].Volume, fromSecurityData.Volume);\n\n            // using dynamic accessor\n            var fromDynamicSecurityData = security.Data.TradeBar[0];\n            Assert.AreEqual(tradeBars[0].Time, fromDynamicSecurityData.Time);\n            Assert.AreEqual(tradeBars[0].Symbol, fromDynamicSecurityData.Symbol);\n            Assert.AreEqual(tradeBars[0].Open, fromDynamicSecurityData.Open);\n            Assert.AreEqual(tradeBars[0].High, fromDynamicSecurityData.High);\n            Assert.AreEqual(tradeBars[0].Low, fromDynamicSecurityData.Low);\n            Assert.AreEqual(tradeBars[0].Close, fromDynamicSecurityData.Close);\n            Assert.AreEqual(tradeBars[0].Volume, fromDynamicSecurityData.Volume);\n        }\n\n        private static TestCaseData[] IsMarketOpenWithMarketDataTestCases => new[]\n        {\n            // Without extended market hours\n            new TestCaseData(new TimeSpan(3, 59, 59), false, false),\n            new TestCaseData(new TimeSpan(4, 0, 0), false, false),\n            new TestCaseData(new TimeSpan(9, 29, 59), false, false),\n            new TestCaseData(new TimeSpan(9, 30, 0), false, true),\n            new TestCaseData(new TimeSpan(15, 59, 59), false, true),\n            new TestCaseData(new TimeSpan(16, 0, 0), false, false),\n            new TestCaseData(new TimeSpan(19, 59, 59), false, false),\n            new TestCaseData(new TimeSpan(20, 0, 0), false, false),\n            new TestCaseData(new TimeSpan(21, 0, 0), false, false),\n            // With extended market hours\n            new TestCaseData(new TimeSpan(3, 59, 59), true, false),\n            new TestCaseData(new TimeSpan(4, 0, 0), true, true),\n            new TestCaseData(new TimeSpan(9, 29, 59), true, true),\n            new TestCaseData(new TimeSpan(9, 30, 0), true, true),\n            new TestCaseData(new TimeSpan(15, 59, 59), true, true),\n            new TestCaseData(new TimeSpan(16, 0, 0), true, true),\n            new TestCaseData(new TimeSpan(19, 59, 59), true, true),\n            new TestCaseData(new TimeSpan(20, 0, 0), true, false),\n            new TestCaseData(new TimeSpan(21, 0, 0), true, false),\n        };\n\n        [TestCaseSource(nameof(IsMarketOpenWithMarketDataTestCases))]\n        public void IsMarketOpenIsAccurate(TimeSpan time, bool extendedMarketHours, bool expected)\n        {\n            var security = GetSecurity(isMarketAlwaysOpen: false);\n\n            var dateTime = new DateTime(2023, 6, 26) + time;\n            var timeKeeper = new LocalTimeKeeper(dateTime.ConvertToUtc(security.Exchange.TimeZone), security.Exchange.TimeZone);\n            security.SetLocalTimeKeeper(timeKeeper);\n\n            Assert.AreEqual(expected, security.IsMarketOpen(extendedMarketHours));\n        }\n\n        #region Custom properties tests\n\n        [Test]\n        public void SetsAndGetsDynamicCustomPropertiesUsingCacheInterface()\n        {\n            var security = GetSecurity();\n            security.Cache.Properties.Add(\"Bool\", true);\n            security.Cache.Properties.Add(\"Integer\", 1);\n            security.Cache.Properties.Add(\"Double\", 2.0);\n            security.Cache.Properties.Add(\"Decimal\", 3.0m);\n            security.Cache.Properties.Add(\"String\", \"4\");\n            security.Cache.Properties.Add(\"DateTime\", DateTime.UtcNow);\n            security.Cache.Properties.Add(\"EMA\", new ExponentialMovingAverage(10));\n\n            Assert.AreEqual(7, security.Cache.Properties.Count);\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"Bool\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"Integer\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"Double\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"Decimal\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"String\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"DateTime\"));\n            Assert.IsTrue(security.Cache.Properties.ContainsKey(\"EMA\"));\n\n            Assert.IsFalse(security.Cache.Properties.ContainsKey(\"NotAProperty\"));\n        }\n\n        [Test]\n        public void SetsAndGetsDynamicCustomPropertiesUsingDynamicInterface()\n        {\n            var security = GetSecurity();\n            dynamic dynamicSecurity = security;\n            dynamicSecurity.Bool = true;\n            dynamicSecurity.Integer = 1;\n            dynamicSecurity.Double = 2.0;\n            dynamicSecurity.Decimal = 3.0m;\n            dynamicSecurity.String = \"string\";\n            dynamicSecurity.DateTime = new DateTime(2023, 06, 20);\n            dynamicSecurity.EMA = new ExponentialMovingAverage(10);\n\n            Assert.AreEqual(true, dynamicSecurity.Bool);\n            Assert.AreEqual(1, dynamicSecurity.Integer);\n            Assert.AreEqual(2.0, dynamicSecurity.Double);\n            Assert.AreEqual(3.0m, dynamicSecurity.Decimal);\n            Assert.AreEqual(\"string\", dynamicSecurity.String);\n            Assert.AreEqual(new DateTime(2023, 06, 20), dynamicSecurity.DateTime);\n            Assert.AreEqual(new ExponentialMovingAverage(10), dynamicSecurity.EMA);\n\n            Assert.Throws<RuntimeBinderException>(() => { var notAProperty = dynamicSecurity.NotAProperty; });\n        }\n\n        [Test]\n        public void SetCustomProperty()\n        {\n            var security = GetSecurity();\n            security.Set(\"Bool\", true);\n            Assert.AreEqual(true, security.TryGet<bool>(\"Bool\", out var boolValue));\n            Assert.AreEqual(true, boolValue);\n        }\n\n        [Test]\n        public void SetsAndGetsDynamicCustomPropertiesUsingGenericInterface()\n        {\n            var security = GetSecurity();\n            security.Add(\"Bool\", true);\n            security.Add(\"Integer\", 1);\n            security.Add(\"Double\", 2.0);\n            security.Add(\"Decimal\", 3.0m);\n            security.Add(\"String\", \"string\");\n            security.Add(\"DateTime\", new DateTime(2023, 06, 20));\n            security.Add(\"EMA\", new ExponentialMovingAverage(10));\n\n            Assert.AreEqual(true, security.TryGet<bool>(\"Bool\", out var boolValue));\n            Assert.AreEqual(true, boolValue);\n            Assert.AreEqual(true, security.Get<bool>(\"Bool\"));\n\n            Assert.AreEqual(true, security.TryGet<int>(\"Integer\", out var intValue));\n            Assert.AreEqual(1, intValue);\n            Assert.AreEqual(1, security.Get<int>(\"Integer\"));\n\n            Assert.AreEqual(true, security.TryGet<double>(\"Double\", out var doubleValue));\n            Assert.AreEqual(2.0, doubleValue);\n            Assert.AreEqual(2.0, security.Get<double>(\"Double\"));\n\n            Assert.AreEqual(true, security.TryGet<decimal>(\"Decimal\", out var decimalValue));\n            Assert.AreEqual(3.0m, decimalValue);\n            Assert.AreEqual(3.0m, security.Get<decimal>(\"Decimal\"));\n\n            Assert.AreEqual(true, security.TryGet<string>(\"String\", out var stringValue));\n            Assert.AreEqual(\"string\", stringValue);\n            Assert.AreEqual(\"string\", security.Get<string>(\"String\"));\n\n            Assert.AreEqual(true, security.TryGet<DateTime>(\"DateTime\", out var dateTimeValue));\n            Assert.AreEqual(new DateTime(2023, 06, 20), dateTimeValue);\n            Assert.AreEqual(new DateTime(2023, 06, 20), security.Get<DateTime>(\"DateTime\"));\n\n            Assert.AreEqual(true, security.TryGet<ExponentialMovingAverage>(\"EMA\", out var emaValue));\n            Assert.AreEqual(new ExponentialMovingAverage(10), emaValue);\n            Assert.AreEqual(new ExponentialMovingAverage(10), security.Get<ExponentialMovingAverage>(\"EMA\"));\n\n            Assert.AreEqual(false, security.TryGet<bool>(\"NotAProperty\", out _));\n            Assert.Throws<KeyNotFoundException>(() => security.Get<bool>(\"NotAProperty\"));\n\n            Assert.Throws<InvalidCastException>(() => security.TryGet<SimpleMovingAverage>(\"EMA\", out _));\n            Assert.Throws<InvalidCastException>(() => security.Get<SimpleMovingAverage>(\"EMA\"));\n        }\n\n        [Test]\n        public void SetsAndGetsDynamicCustomPropertiesUsingIndexer()\n        {\n            var security = GetSecurity();\n            security[\"Bool\"] = true;\n            security[\"Integer\"] = 1;\n            security[\"Double\"] = 2.0;\n            security[\"Decimal\"] = 3.0m;\n            security[\"String\"] = \"string\";\n            security[\"DateTime\"] = new DateTime(2023, 06, 20);\n            security[\"EMA\"] = new ExponentialMovingAverage(10);\n\n            Assert.AreEqual(true, security[\"Bool\"]);\n            Assert.AreEqual(1, security[\"Integer\"]);\n            Assert.AreEqual(2.0, security[\"Double\"]);\n            Assert.AreEqual(3.0m, security[\"Decimal\"]);\n            Assert.AreEqual(\"string\", security[\"String\"]);\n            Assert.AreEqual(new DateTime(2023, 06, 20), security[\"DateTime\"]);\n            Assert.AreEqual(new ExponentialMovingAverage(10), security[\"EMA\"]);\n\n            Assert.Throws<KeyNotFoundException>(() => { var notAProperty = security[\"NotAProperty\"]; });\n        }\n\n        [Test]\n        public void RemovesCustomProperties()\n        {\n            var security = GetSecurity();\n            security.Add(\"Bool\", true);\n            security.Add(\"DateTime\", new DateTime(2023, 06, 20));\n\n            Assert.IsTrue(security.Remove(\"Bool\"));\n            Assert.IsFalse(security.TryGet<bool>(\"Bool\", out _));\n            Assert.IsFalse(security.Remove(\"Bool\"));\n\n            Assert.IsTrue(security.Remove(\"DateTime\", out DateTime dateTime));\n            Assert.AreEqual(new DateTime(2023, 06, 20), dateTime);\n            Assert.IsFalse(security.TryGet<DateTime>(\"DateTime\", out _));\n            Assert.IsFalse(security.Remove<DateTime>(\"DateTime\", out _));\n        }\n\n        [Test]\n        public void ClearsCustomProperties()\n        {\n            var security = GetSecurity();\n            security.Add(\"Decimal\", 3.0m);\n            security.Add(\"DateTime\", new DateTime(2023, 06, 20));\n\n            Assert.AreEqual(2, security.Cache.Properties.Count);\n\n            security.Clear();\n            Assert.AreEqual(0, security.Cache.Properties.Count);\n            Assert.IsFalse(security.TryGet<decimal>(\"Decimal\", out _));\n            Assert.IsFalse(security.TryGet<DateTime>(\"DateTime\", out _));\n\n        }\n\n        [Test]\n        public void OverwritesCustomProperties()\n        {\n            var security = GetSecurity();\n            dynamic dynamicSecurity = security;\n\n            dynamicSecurity.DateTime = new DateTime(2023, 06, 20);\n            Assert.AreEqual(new DateTime(2023, 06, 20), dynamicSecurity.DateTime);\n\n            dynamicSecurity.DateTime = new DateTime(2024, 06, 20);\n            Assert.AreEqual(new DateTime(2024, 06, 20), dynamicSecurity.DateTime);\n        }\n\n        [Test]\n        public void InvokesCustomPropertyMethod()\n        {\n            var security = GetSecurity();\n            dynamic dynamicSecurity = security;\n\n            dynamicSecurity.MakeEma = new Func<int, decimal, ExponentialMovingAverage>(\n                (period, smoothingFactor) => new ExponentialMovingAverage(period, smoothingFactor));\n\n            Assert.AreEqual(new ExponentialMovingAverage(10, 0.5m), dynamicSecurity.MakeEma(10, 0.5m));\n        }\n\n        [Test]\n        public void KeepsPythonClassDerivedFromCSharpClassObjectReference()\n        {\n            var expectedCSharpPropertyValue = \"C# property\";\n            var expectedPythonPropertyValue = \"Python property\";\n\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests.Common.Securities import SecurityTests\n\nclass PythonTestClass(SecurityTests.CSharpTestClass):\n    def __init__(self):\n        super().__init__()\n\ndef SetSecurityDynamicProperty(security: Security) -> None:\n    obj = PythonTestClass()\n    obj.CSharpProperty = '{expectedCSharpPropertyValue}'\n    obj.PythonProperty = '{expectedPythonPropertyValue}'\n    security.PythonClassObject = obj\n\ndef AssertPythonClassObjectType(security: Security) -> None:\n    if type(security.PythonClassObject) != PythonTestClass:\n        raise Exception('PythonClassObject is not of type PythonTestClass')\n\ndef AccessCSharpProperty(security: Security) -> str:\n    return security.PythonClassObject.CSharpProperty\n\ndef AccessPythonProperty(security: Security) -> str:\n    return security.PythonClassObject.PythonProperty\n        \");\n\n                var security = GetSecurity();\n                dynamic dynamicSecurity = security;\n\n                dynamic SetSecurityDynamicProperty = testModule.GetAttr(\"SetSecurityDynamicProperty\");\n                SetSecurityDynamicProperty(security);\n\n                dynamic AssertPythonClassObjectType = testModule.GetAttr(\"AssertPythonClassObjectType\");\n                Assert.DoesNotThrow(() => AssertPythonClassObjectType(security));\n\n                // Access the C# class property\n                dynamic AccessCSharpProperty = testModule.GetAttr(\"AccessCSharpProperty\");\n                Assert.AreEqual(expectedCSharpPropertyValue, AccessCSharpProperty(security).As<string>());\n                Assert.AreEqual(expectedCSharpPropertyValue, dynamicSecurity.PythonClassObject.CSharpProperty.As<string>());\n\n                // Access the Python class property\n                dynamic AccessPythonProperty = testModule.GetAttr(\"AccessPythonProperty\");\n                Assert.AreEqual(expectedPythonPropertyValue, AccessPythonProperty(security).As<string>());\n                Assert.AreEqual(expectedPythonPropertyValue, dynamicSecurity.PythonClassObject.PythonProperty.As<string>());\n            }\n        }\n\n        [Test]\n        public void RunSecurityDynamicPropertyPythonObjectReferenceRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"SecurityDynamicPropertyPythonClassAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0\"},\n                    {\"Tracking Error\", \"0\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"},\n                    {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        #endregion\n\n        internal static Security GetSecurity(bool isMarketAlwaysOpen = true)\n        {\n            SecurityExchangeHours securityExchangeHours;\n            if (isMarketAlwaysOpen)\n            {\n                securityExchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            }\n            else\n            {\n                var marketHourDbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(Market.USA, \"SPY\", SecurityType.Equity);\n                securityExchangeHours = marketHourDbEntry.ExchangeHours;\n            }\n\n            RegisteredSecurityDataTypesProvider.Null.RegisterType(typeof(TradeBar));\n\n            return new Security(\n                securityExchangeHours,\n                CreateTradeBarConfig(),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        internal static SubscriptionDataConfig CreateTradeBarConfig(Resolution resolution = Resolution.Minute)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, resolution, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n\n        public class CSharpTestClass\n        {\n            public string CSharpProperty { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SecurityTransactionManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Tests.Engine;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Lean.Engine.Results;\nusing Python.Runtime;\nusing System.Threading;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SecurityTransactionManagerTests\n    {\n        private IResultHandler _resultHandler;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _resultHandler = new TestResultHandler(Console.WriteLine);\n        }\n\n        [Test]\n        public void WorksProperlyWithPyObjects()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spySecurity = algorithm.AddEquity(\"SPY\");\n            var ibmSecurity = algorithm.AddEquity(\"IBM\");\n            algorithm.SetTimeZone(TimeZones.NewYork);\n            spySecurity.SetMarketPrice(new Tick { Value = 270m });\n            ibmSecurity.SetMarketPrice(new Tick { Value = 270m });\n            algorithm.SetFinishedWarmingUp();\n\n            var transactionHandler = new BrokerageTransactionHandler();\n\n            using var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            transactionHandler.Initialize(algorithm, backtestingBrokerage, _resultHandler);\n            algorithm.Transactions.SetOrderProcessor(transactionHandler);\n\n            var spy = spySecurity.Symbol;\n            var ibm = ibmSecurity.Symbol;\n\n            // this order should timeout (no fills received within 5 seconds)\n            algorithm.SetHoldings(spy, 0.5m);\n            algorithm.SetHoldings(ibm, 0.5m);     \n\n            Func<Order, bool> basicOrderFilter = x => true;\n            Func<OrderTicket, bool> basicOrderTicketFilter = x => true;\n            using (Py.GIL())\n            {\n                var orders = algorithm.Transactions.GetOrders(basicOrderFilter.ToPython());\n                var orderTickets = algorithm.Transactions.GetOrderTickets(basicOrderTicketFilter.ToPython());\n                var openOrders = algorithm.Transactions.GetOpenOrders(basicOrderFilter.ToPython());\n                var openOrderTickets = algorithm.Transactions.GetOpenOrderTickets(basicOrderTicketFilter.ToPython());\n                var openOrdersRemaining = algorithm.Transactions.GetOpenOrdersRemainingQuantity(basicOrderTicketFilter.ToPython());\n\n                Assert.AreEqual(2, orders.Count());\n                Assert.AreEqual(2, orderTickets.Count());\n                Assert.AreEqual(2, openOrders.Count);\n                Assert.AreEqual(2, openOrderTickets.Count());\n                Assert.AreEqual(368, openOrdersRemaining);\n\n                var ibmOpenOrders = algorithm.Transactions.GetOpenOrders(ibm.ToPython()).Count;\n                var ibmOpenOrderTickets = algorithm.Transactions.GetOpenOrderTickets(ibm.ToPython()).Count();\n                var ibmOpenOrdersRemainingQuantity = algorithm.Transactions.GetOpenOrdersRemainingQuantity(ibm.ToPython());\n                var spyOpenOrders = algorithm.Transactions.GetOpenOrders(spy.ToPython()).Count;\n                var spyOpenOrderTickets = algorithm.Transactions.GetOpenOrderTickets(spy.ToPython()).Count();\n                var spyOpenOrdersRemainingQuantity = algorithm.Transactions.GetOpenOrdersRemainingQuantity(spy.ToPython());\n\n                Assert.AreEqual(1, ibmOpenOrders);\n                Assert.AreEqual(1, ibmOpenOrderTickets);\n                Assert.AreEqual(184, ibmOpenOrdersRemainingQuantity);\n\n                Assert.AreEqual(1, spyOpenOrders);\n                Assert.AreEqual(1, spyOpenOrderTickets);\n                Assert.AreEqual(184, spyOpenOrdersRemainingQuantity);\n\n                var defaultOrders = algorithm.Transactions.GetOrders();\n                var defaultOrderTickets = algorithm.Transactions.GetOrderTickets();\n                var defaultOpenOrders = algorithm.Transactions.GetOpenOrders();\n                var defaultOpenOrderTickets = algorithm.Transactions.GetOpenOrderTickets();\n                var defaultOpenOrdersRemaining = algorithm.Transactions.GetOpenOrdersRemainingQuantity();\n\n                Assert.AreEqual(2, defaultOrders.Count());\n                Assert.AreEqual(2, defaultOrderTickets.Count());\n                Assert.AreEqual(2, defaultOpenOrders.Count);\n                Assert.AreEqual(2, defaultOpenOrderTickets.Count());\n                Assert.AreEqual(368, defaultOpenOrdersRemaining);\n            }\n\n            transactionHandler.Exit();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/StandardDeviationOfReturnsVolatilityModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class StandardDeviationOfReturnsVolatilityModelTests\n    {\n        [Test]\n        public void UpdatesAfterCorrectDailyPeriodElapses()\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods);\n            security.VolatilityModel = model;\n\n            var first = new IndicatorDataPoint(reference, 1);\n            security.SetMarketPrice(first);\n\n            Assert.AreEqual(0m, model.Volatility);\n\n            var second = new IndicatorDataPoint(reference.AddDays(1), 2);\n            security.SetMarketPrice(second);\n            Assert.AreEqual(0, model.Volatility);\n\n            // update should not be applied since not enough time has passed\n            var third = new IndicatorDataPoint(reference.AddDays(1.01), 1000);\n            security.SetMarketPrice(third);\n            Assert.AreEqual(0, model.Volatility);\n\n            var fourth = new IndicatorDataPoint(reference.AddDays(2), 3);\n            security.SetMarketPrice(fourth);\n            Assert.AreEqual(5.6124, (double)model.Volatility, 0.0001);\n        }\n\n        [Test]\n        public void DoesntUpdateOnZeroPrice()\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods);\n            security.VolatilityModel = model;\n\n            var first = new IndicatorDataPoint(reference, 1);\n            security.SetMarketPrice(first);\n\n            Assert.AreEqual(0m, model.Volatility);\n\n            var second = new IndicatorDataPoint(reference.AddDays(1), 2);\n            security.SetMarketPrice(second);\n            Assert.AreEqual(0, model.Volatility);\n\n            // update should not be applied since not enough time has passed\n            var third = new IndicatorDataPoint(reference.AddDays(1.01), 1000);\n            security.SetMarketPrice(third);\n            Assert.AreEqual(0, model.Volatility);\n\n            var fourth = new IndicatorDataPoint(reference.AddDays(2), 3);\n            security.SetMarketPrice(fourth);\n            Assert.AreEqual(5.6124, (double)model.Volatility, 0.0001);\n\n            // update should not be applied as price is 0\n            var fifth = new IndicatorDataPoint(reference.AddDays(3), 0m);\n            security.SetMarketPrice(fifth);\n            Assert.AreEqual(5.6124, (double)model.Volatility, 0.0001);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorks()\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods);\n            model.SetSubscriptionDataConfigProvider(new MockSubscriptionDataConfigProvider(config));\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(config.IsCustomData, result.IsCustomData);\n            Assert.AreEqual(config.FillDataForward, result.FillForwardResolution != null);\n            Assert.AreEqual(config.ExtendedMarketHours, result.IncludeExtendedMarketHours);\n            // the StandardDeviationOfReturnsVolatilityModel always uses daily\n            Assert.AreEqual(Resolution.Daily, result.Resolution);\n        }\n\n        [Test]\n        public void GetHistoryRequirementsWorksForTwoDifferentSubscriptions()\n        {\n            const int periods = 3;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods);\n            var mock = new MockSubscriptionDataConfigProvider(config);\n            mock.SubscriptionDataConfigs.Add(\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Second,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false,\n                    true));\n            model.SetSubscriptionDataConfigProvider(mock);\n            var result = model.GetHistoryRequirements(security, DateTime.UtcNow).First();\n\n            Assert.AreEqual(config.DataNormalizationMode, result.DataNormalizationMode);\n            Assert.AreEqual(config.Symbol, result.Symbol);\n            Assert.AreEqual(config.DataTimeZone, result.DataTimeZone);\n            Assert.AreEqual(true, result.IsCustomData);\n            Assert.AreEqual(true, result.FillForwardResolution != null);\n            Assert.AreEqual(true, result.IncludeExtendedMarketHours);\n            // the StandardDeviationOfReturnsVolatilityModel always uses daily\n            Assert.AreEqual(Resolution.Daily, result.Resolution);\n        }\n\n        [Test]\n        public void UpdatesOnCustomConfigurationParametersOneMinute()\n        {\n            const int periods = 5;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, false, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods, Resolution.Minute, TimeSpan.FromMinutes(1));\n\n            for (var i = 0; i < 5; i++)\n            {\n                if (i < 3)\n                {\n                    Assert.AreEqual(0, model.Volatility);\n                }\n                else\n                {\n                    Assert.AreNotEqual(0, model.Volatility);\n                }\n\n                model.Update(security, new TradeBar\n                {\n                    Open = 11 + (i - 1),\n                    High = 11 + i,\n                    Low = 9 - i,\n                    Close = 11 + i,\n                    Symbol = security.Symbol,\n                    Time = reference.AddMinutes(i)\n                });\n            }\n\n            Assert.AreNotEqual(0, model.Volatility);\n        }\n\n        [Test]\n        public void MinuteResolutionSelectedForFuturesOptions()\n        {\n            const int periods = 5;\n            var reference = new DateTime(2016, 04, 06, 12, 0, 0);\n            var referenceUtc = reference.ConvertToUtc(TimeZones.Chicago);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            var underlyingSymbol = Symbol.Create(\"ES\", SecurityType.Future, Market.CME);\n            var futureOption = Symbol.CreateOption(\n                underlyingSymbol,\n                Market.CME,\n                OptionStyle.American,\n                OptionRight.Call,\n                0,\n                SecurityIdentifier.DefaultDate);\n\n            var underlyingConfig = new SubscriptionDataConfig(typeof(TradeBar), underlyingSymbol, Resolution.Minute, TimeZones.Chicago, TimeZones.Chicago, true, false, false);\n            var futureOptionConfig = new SubscriptionDataConfig(typeof(TradeBar), futureOption, Resolution.Minute, TimeZones.Chicago, TimeZones.Chicago, true, false, false);\n\n            var underlyingSecurity = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Chicago),\n                underlyingConfig,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            var futureOptionSecurity = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Chicago),\n                futureOptionConfig,\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            underlyingSecurity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.Chicago));\n            futureOptionSecurity.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.Chicago));\n\n            var mock = new MockSubscriptionDataConfigProvider();\n            mock.SubscriptionDataConfigs.Add(underlyingConfig);\n            mock.SubscriptionDataConfigs.Add(futureOptionConfig);\n            var model = new StandardDeviationOfReturnsVolatilityModel(periods, Resolution.Minute, TimeSpan.FromMinutes(1));\n            model.SetSubscriptionDataConfigProvider(mock);\n\n            var futureHistoryRequirements = model.GetHistoryRequirements(underlyingSecurity, referenceUtc);\n            var optionHistoryRequirements = model.GetHistoryRequirements(futureOptionSecurity, referenceUtc);\n\n            Assert.IsTrue(futureHistoryRequirements.All(x => x.Resolution == Resolution.Minute));\n            Assert.IsTrue(optionHistoryRequirements.All(x => x.Resolution == Resolution.Minute));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SubscriptionDataConfigTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SubscriptionDataConfigTests\n    {\n        [Test]\n        public void UsesValueEqualsSemantics()\n        {\n            var config1 = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, TickType.Trade, false);\n            var config2 = new SubscriptionDataConfig(config1);\n            Assert.AreEqual(config1, config2);\n        }\n\n        [Test]\n        public void UsedAsDictionaryKey()\n        {\n            var set = new HashSet<SubscriptionDataConfig>();\n            var config1 = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, TickType.Trade, false);\n            Assert.IsTrue(set.Add(config1));\n            var config2 = new SubscriptionDataConfig(config1);\n            Assert.IsFalse(set.Add(config2));\n        }\n\n        [Test]\n        public void CanRemoveConsolidatorWhileEnumeratingList()\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, TickType.Trade, false);\n            var consolidator1 = new TradeBarConsolidator(1);\n            var consolidator2 = new TradeBarConsolidator(2);\n            config.Consolidators.Add(consolidator1);\n            config.Consolidators.Add(consolidator2);\n            foreach (var consolidator in config.Consolidators)\n            {\n                Assert.DoesNotThrow(() => config.Consolidators.Remove(consolidator));\n            }\n        }\n\n        [TestCase(1, 0, DataMappingMode.OpenInterest, DataMappingMode.OpenInterest)]\n        [TestCase(0, 0, DataMappingMode.OpenInterest, DataMappingMode.FirstDayMonth)]\n        public void NotEqualsMappingAndOffset(int offsetA, int offsetB, DataMappingMode mappingModeA, DataMappingMode mappingModeB)\n        {\n            var configA = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork,\n                TimeZones.NewYork, false, false, false, dataMappingMode: mappingModeA, contractDepthOffset: (uint)offsetA);\n            var configB = new SubscriptionDataConfig(configA, dataMappingMode: mappingModeB, contractDepthOffset: (uint)offsetB);\n\n            Assert.AreNotEqual(configA, configB);\n            Assert.AreNotEqual(configA.GetHashCode(), configB.GetHashCode());\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void EqualityMapped(bool mapped)\n        {\n            var configA = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork,\n                TimeZones.NewYork, false, false, false);\n            var configB = new SubscriptionDataConfig(configA, mappedConfig: mapped);\n\n            if (mapped)\n            {\n                Assert.AreNotEqual(configA, configB);\n                Assert.AreNotEqual(configA.GetHashCode(), configB.GetHashCode());\n            }\n            else\n            {\n                Assert.AreEqual(configA, configB);\n                Assert.AreEqual(configA.GetHashCode(), configB.GetHashCode());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/SymbolPropertiesDatabaseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Text;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class SymbolPropertiesDatabaseTests\n    {\n        [Test]\n        public void LoadsLotSize()\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            var symbol = Symbol.Create(\"EURGBP\", SecurityType.Forex, Market.FXCM);\n            var symbolProperties = db.GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, \"GBP\");\n\n            Assert.AreEqual(symbolProperties.LotSize, 1000);\n        }\n\n        [Test]\n        public void LoadsQuoteCurrency()\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            var symbol = Symbol.Create(\"EURGBP\", SecurityType.Forex, Market.FXCM);\n            var symbolProperties = db.GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, \"GBP\");\n\n            Assert.AreEqual(symbolProperties.QuoteCurrency, \"GBP\");\n        }\n\n        [Test]\n        public void LoadsMinimumOrderSize()\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n\n            var bitfinexSymbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Bitfinex);\n            var bitfinexSymbolProperties = db.GetSymbolProperties(bitfinexSymbol.ID.Market, bitfinexSymbol, bitfinexSymbol.SecurityType, \"USD\");\n\n            var binanceSymbol = Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Binance);\n            var binanceSymbolProperties = db.GetSymbolProperties(binanceSymbol.ID.Market, binanceSymbol, binanceSymbol.SecurityType, \"EUR\");\n\n            var coinbaseSymbol = Symbol.Create(\"BTCGBP\", SecurityType.Crypto, Market.Coinbase);\n            var coinbaseSymbolProperties = db.GetSymbolProperties(coinbaseSymbol.ID.Market, coinbaseSymbol, coinbaseSymbol.SecurityType, \"GBP\");\n\n            var krakenSymbol = Symbol.Create(\"BTCCAD\", SecurityType.Crypto, Market.Kraken);\n            var krakenSymbolProperties = db.GetSymbolProperties(krakenSymbol.ID.Market, krakenSymbol, krakenSymbol.SecurityType, \"CAD\");\n\n            Assert.AreEqual(bitfinexSymbolProperties.MinimumOrderSize, 0.00004m);\n            Assert.AreEqual(binanceSymbolProperties.MinimumOrderSize, 5m); // in quote currency, MIN_NOTIONAL\n            Assert.AreEqual(coinbaseSymbolProperties.MinimumOrderSize, 0.00000001m);\n            Assert.AreEqual(krakenSymbolProperties.MinimumOrderSize, 0.00005m);\n        }\n\n        [TestCase(\"KE\", Market.CBOT, 100)]\n        [TestCase(\"ZC\", Market.CBOT, 100)]\n        [TestCase(\"ZL\", Market.CBOT, 100)]\n        [TestCase(\"ZO\", Market.CBOT, 100)]\n        [TestCase(\"ZS\", Market.CBOT, 100)]\n        [TestCase(\"ZW\", Market.CBOT, 100)]\n\n        [TestCase(\"GF\", Market.CME, 100)]\n        [TestCase(\"HE\", Market.CME, 100)]\n        [TestCase(\"LE\", Market.CME, 100)]\n        public void LoadsPriceMagnifier(string ticker, string market, int expectedPriceMagnifier)\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            var symbol = Symbol.Create(ticker, SecurityType.Future, market);\n\n            var symbolProperties = db.GetSymbolProperties(symbol.ID.Market, symbol, symbol.SecurityType, \"USD\");\n            Assert.AreEqual(expectedPriceMagnifier, symbolProperties.PriceMagnifier);\n\n            var futureOption = Symbol.CreateOption(symbol, symbol.ID.Market, OptionStyle.American,\n                OptionRight.Call, 1, new DateTime(2021, 10, 14));\n            var symbolPropertiesFop = db.GetSymbolProperties(futureOption.ID.Market, futureOption, futureOption.SecurityType, \"USD\");\n            Assert.AreEqual(expectedPriceMagnifier, symbolPropertiesFop.PriceMagnifier);\n        }\n\n        [Test]\n        public void LoadsDefaultLotSize()\n        {\n            var defaultSymbolProperties = SymbolProperties.GetDefault(Currencies.USD);\n\n            Assert.AreEqual(defaultSymbolProperties.LotSize, 1);\n        }\n\n        [TestCase(Market.FXCM, SecurityType.Forex)]\n        [TestCase(Market.Oanda, SecurityType.Forex)]\n        [TestCase(Market.Coinbase, SecurityType.Crypto)]\n        [TestCase(Market.Bitfinex, SecurityType.Crypto)]\n        public void BaseCurrencyIsNotEqualToQuoteCurrency(string market, SecurityType securityType)\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n\n            var spList = db.GetSymbolPropertiesList(market, securityType).ToList();\n            Assert.IsNotEmpty(spList);\n\n            foreach (var kvp in spList)\n            {\n                var quoteCurrency = kvp.Value.QuoteCurrency;\n                var baseCurrency = kvp.Key.Symbol.Substring(0, kvp.Key.Symbol.Length - quoteCurrency.Length);\n\n                Assert.AreNotEqual(baseCurrency, quoteCurrency);\n            }\n        }\n\n        [Test]\n        public void CustomEntriesStoredAndFetched()\n        {\n            var database = SymbolPropertiesDatabase.FromDataFolder();\n            var ticker = \"BTC\";\n            var properties = SymbolProperties.GetDefault(\"USD\");\n\n            // Set the entry\n            Assert.IsTrue(database.SetEntry(Market.USA, ticker, SecurityType.Base, properties));\n\n            // Fetch the entry to ensure we can access it with the ticker\n            #pragma warning disable CS0618\n            var fetchedProperties = database.GetSymbolProperties(Market.USA, ticker, SecurityType.Base, \"USD\");\n            #pragma warning restore CS0618\n            Assert.AreSame(properties, fetchedProperties);\n        }\n\n        [Test]\n        public void CustomEntriesAreKeptAfterARefresh()\n        {\n            var database = SymbolPropertiesDatabase.FromDataFolder();\n            var ticker = \"BTC\";\n            var properties = SymbolProperties.GetDefault(\"USD\");\n\n            // Set the entry\n            Assert.IsTrue(database.SetEntry(Market.USA, ticker, SecurityType.Base, properties));\n\n            // Fetch the custom entry to ensure we can access it with the ticker\n            var symbol = Symbol.Create(ticker, SecurityType.Base, Market.USA);\n            var fetchedProperties = database.GetSymbolProperties(Market.USA, symbol, SecurityType.Base, \"USD\");\n            Assert.AreSame(properties, fetchedProperties);\n\n            // Refresh the database\n            database.UpdateDataFolderDatabase();\n\n            // Fetch the custom entry again to make sure it was not overridden\n            fetchedProperties = database.GetSymbolProperties(Market.USA, symbol, SecurityType.Base, \"USD\");\n            Assert.AreSame(properties, fetchedProperties);\n        }\n\n        [Test]\n        public void CanQueryMarketAfterRefresh()\n        {\n            var database = SymbolPropertiesDatabase.FromDataFolder();\n\n            // Get market\n            var result = database.TryGetMarket(\"AU200AUD\", SecurityType.Cfd, out var market);\n            Assert.IsTrue(result);\n            Assert.AreEqual(Market.FXCM, market);\n\n            // Change the data folder so another symbol properties file is used\n            var originalDataFolder = Config.Get(\"data-folder\");\n            Config.Set(\"data-folder\", \"./TestData\");\n            Globals.Reset();\n\n            // Refresh the database\n            database.UpdateDataFolderDatabase();\n\n            // Get market again\n            result = database.TryGetMarket(\"AU200AUD\", SecurityType.Cfd, out market);\n            Assert.IsTrue(result);\n            Assert.AreEqual(Market.Oanda, market);\n\n            // Restore the original data folder\n            Config.Set(\"data-folder\", originalDataFolder);\n            Globals.Reset();\n        }\n\n        [TestCase(Market.FXCM, SecurityType.Cfd)]\n        [TestCase(Market.Oanda, SecurityType.Cfd)]\n        [TestCase(Market.CFE, SecurityType.Future)]\n        [TestCase(Market.CBOT, SecurityType.Future)]\n        [TestCase(Market.CME, SecurityType.Future)]\n        [TestCase(Market.COMEX, SecurityType.Future)]\n        [TestCase(Market.ICE, SecurityType.Future)]\n        [TestCase(Market.NYMEX, SecurityType.Future)]\n        [TestCase(Market.SGX, SecurityType.Future)]\n        [TestCase(Market.HKFE, SecurityType.Future)]\n        public void GetSymbolPropertiesListIsNotEmpty(string market, SecurityType securityType)\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n\n            var spList = db.GetSymbolPropertiesList(market, securityType).ToList();\n\n            Assert.IsNotEmpty(spList);\n        }\n\n        [TestCase(Market.USA, SecurityType.Equity)]\n        [TestCase(Market.USA, SecurityType.Option)]\n        public void GetSymbolPropertiesListHasOneRow(string market, SecurityType securityType)\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n\n            var spList = db.GetSymbolPropertiesList(market, securityType).ToList();\n\n            Assert.AreEqual(1, spList.Count);\n            Assert.IsTrue(spList[0].Key.Symbol.Contains('*', StringComparison.InvariantCulture));\n        }\n\n        #region Coinbase brokerage\n\n        [Test, Explicit]\n        public void FetchSymbolPropertiesFromCoinbase()\n        {\n            const string urlCurrencies = \"https://api.pro.coinbase.com/currencies\";\n            const string urlProducts = \"https://api.pro.coinbase.com/products\";\n\n            var sb = new StringBuilder();\n\n            using (var wc = new WebClient())\n            {\n                var jsonCurrencies = wc.DownloadString(urlCurrencies);\n                var rowsCurrencies = JsonConvert.DeserializeObject<List<CoinbaseCurrency>>(jsonCurrencies);\n                var currencyDescriptions = rowsCurrencies.ToDictionary(x => x.Id, x => x.Name);\n\n                var jsonProducts = wc.DownloadString(urlProducts);\n\n                var rowsProducts = JsonConvert.DeserializeObject<List<CoinbaseProduct>>(jsonProducts);\n                foreach (var row in rowsProducts.OrderBy(x => x.Id))\n                {\n                    string baseDescription, quoteDescription;\n                    if (!currencyDescriptions.TryGetValue(row.BaseCurrency, out baseDescription))\n                    {\n                        baseDescription = row.BaseCurrency;\n                    }\n                    if (!currencyDescriptions.TryGetValue(row.QuoteCurrency, out quoteDescription))\n                    {\n                        quoteDescription = row.QuoteCurrency;\n                    }\n\n                    sb.AppendLine(\"coinbase,\" +\n                                  $\"{row.BaseCurrency}{row.QuoteCurrency},\" +\n                                  \"crypto,\" +\n                                  $\"{baseDescription}-{quoteDescription},\" +\n                                  $\"{row.QuoteCurrency},\" +\n                                  \"1,\" +\n                                  $\"{row.QuoteIncrement.NormalizeToStr()},\" +\n                                  $\"{row.BaseIncrement.NormalizeToStr()},\" +\n                                  $\"{row.Id}\");\n                }\n            }\n\n            Log.Trace(sb.ToString());\n        }\n\n        private class CoinbaseCurrency\n        {\n            [JsonProperty(\"id\")]\n            public string Id { get; set; }\n\n            [JsonProperty(\"name\")]\n            public string Name { get; set; }\n\n            [JsonProperty(\"min_size\")]\n            public decimal MinSize { get; set; }\n        }\n\n        private class CoinbaseProduct\n        {\n            [JsonProperty(\"id\")]\n            public string Id { get; set; }\n\n            [JsonProperty(\"base_currency\")]\n            public string BaseCurrency { get; set; }\n\n            [JsonProperty(\"quote_currency\")]\n            public string QuoteCurrency { get; set; }\n\n            [JsonProperty(\"base_min_size\")]\n            public decimal BaseMinSize { get; set; }\n\n            [JsonProperty(\"base_max_size\")]\n            public decimal BaseMaxSize { get; set; }\n\n            [JsonProperty(\"quote_increment\")]\n            public decimal QuoteIncrement { get; set; }\n\n            [JsonProperty(\"base_increment\")]\n            public decimal BaseIncrement { get; set; }\n\n            [JsonProperty(\"display_name\")]\n            public string DisplayName { get; set; }\n\n            [JsonProperty(\"min_market_funds\")]\n            public decimal MinMarketFunds { get; set; }\n\n            [JsonProperty(\"max_market_funds\")]\n            public decimal MaxMarketFunds { get; set; }\n\n            [JsonProperty(\"margin_enabled\")]\n            public bool MarginEnabled { get; set; }\n\n            [JsonProperty(\"post_only\")]\n            public bool PostOnly { get; set; }\n\n            [JsonProperty(\"limit_only\")]\n            public bool LimitOnly { get; set; }\n\n            [JsonProperty(\"cancel_only\")]\n            public bool CancelOnly { get; set; }\n\n            [JsonProperty(\"trading_disabled\")]\n            public bool TradingDisabled { get; set; }\n\n            [JsonProperty(\"status\")]\n            public string Status { get; set; }\n\n            [JsonProperty(\"status_message\")]\n            public string StatusMessage { get; set; }\n        }\n\n        #endregion\n\n        #region Bitfinex brokerage\n\n        [Test, Explicit]\n        public void FetchSymbolPropertiesFromBitfinex()\n        {\n            const string urlExchangePairs = \"https://api-pub.bitfinex.com/v2/conf/pub:list:pair:exchange\";\n            const string urlMarginPairs = \"https://api-pub.bitfinex.com/v2/conf/pub:list:pair:margin\";\n            const string urlCurrencyMap = \"https://api-pub.bitfinex.com/v2/conf/pub:map:currency:sym\";\n            const string urlCurrencyLabels = \"https://api-pub.bitfinex.com/v2/conf/pub:map:currency:label\";\n            const string urlSymbolDetails = \"https://api.bitfinex.com/v1/symbols_details\";\n\n            var sb = new StringBuilder();\n\n            using (var wc = new WebClient())\n            {\n                var jsonExchangePairs = wc.DownloadString(urlExchangePairs);\n                var exchangePairs = JsonConvert.DeserializeObject<List<List<string>>>(jsonExchangePairs)[0];\n\n                var jsonMarginPairs = wc.DownloadString(urlMarginPairs);\n                var marginPairs = JsonConvert.DeserializeObject<List<List<string>>>(jsonMarginPairs)[0];\n\n                var jsonCurrencyMap = wc.DownloadString(urlCurrencyMap);\n                var rowsCurrencyMap = JsonConvert.DeserializeObject<List<List<List<string>>>>(jsonCurrencyMap)[0];\n                var currencyMap = rowsCurrencyMap\n                    .ToDictionary(row => row[0], row => row[1].ToUpperInvariant());\n\n                var jsonCurrencyLabels = wc.DownloadString(urlCurrencyLabels);\n                var rowsCurrencyLabels = JsonConvert.DeserializeObject<List<List<List<string>>>>(jsonCurrencyLabels)[0];\n                var currencyLabels = rowsCurrencyLabels\n                    .ToDictionary(row => row[0], row => row[1]);\n\n                var jsonSymbolDetails = wc.DownloadString(urlSymbolDetails);\n                var symbolDetails = JsonConvert.DeserializeObject<List<BitfinexSymbolDetails>>(jsonSymbolDetails);\n                var minimumPriceIncrements = symbolDetails\n                    .ToDictionary(x => x.Pair.ToUpperInvariant(), x => (decimal)Math.Pow(10, -x.PricePrecision));\n\n                foreach (var pair in exchangePairs.Union(marginPairs).OrderBy(x => x))\n                {\n                    string baseCurrency, quoteCurrency;\n                    if (pair.Contains(':', StringComparison.InvariantCulture))\n                    {\n                        var parts = pair.Split(':');\n                        baseCurrency = parts[0];\n                        quoteCurrency = parts[1];\n                    }\n                    else if (pair.Length == 6)\n                    {\n                        baseCurrency = pair.Substring(0, 3);\n                        quoteCurrency = pair.Substring(3);\n                    }\n                    else\n                    {\n                        // should never happen\n                        Log.Trace($\"Skipping pair with unknown format: {pair}\");\n                        continue;\n                    }\n\n                    string baseDescription, quoteDescription;\n                    if (!currencyLabels.TryGetValue(baseCurrency, out baseDescription))\n                    {\n                        Log.Trace($\"Base currency description not found: {baseCurrency}\");\n                        baseDescription = baseCurrency;\n                    }\n                    if (!currencyLabels.TryGetValue(quoteCurrency, out quoteDescription))\n                    {\n                        Log.Trace($\"Quote currency description not found: {quoteCurrency}\");\n                        quoteDescription = quoteCurrency;\n                    }\n\n                    var description = baseDescription + \"-\" + quoteDescription;\n\n                    string newBaseCurrency, newQuoteCurrency;\n                    if (currencyMap.TryGetValue(baseCurrency, out newBaseCurrency))\n                    {\n                        baseCurrency = newBaseCurrency;\n                    }\n                    if (currencyMap.TryGetValue(quoteCurrency, out newQuoteCurrency))\n                    {\n                        quoteCurrency = newQuoteCurrency;\n                    }\n\n                    // skip test symbols\n                    if (quoteCurrency.StartsWith(\"TEST\"))\n                    {\n                        continue;\n                    }\n\n                    var leanTicker = $\"{baseCurrency}{quoteCurrency}\";\n\n                    decimal minimumPriceIncrement;\n                    if (!minimumPriceIncrements.TryGetValue(pair, out minimumPriceIncrement))\n                    {\n                        minimumPriceIncrement = 0.00001m;\n                    }\n\n                    const decimal lotSize = 0.00000001m;\n\n                    sb.AppendLine(\"bitfinex,\" +\n                                  $\"{leanTicker},\" +\n                                  \"crypto,\" +\n                                  $\"{description},\" +\n                                  $\"{quoteCurrency},\" +\n                                  \"1,\" +\n                                  $\"{minimumPriceIncrement.NormalizeToStr()},\" +\n                                  $\"{lotSize.NormalizeToStr()},\" +\n                                  $\"t{pair}\");\n                }\n            }\n\n            Log.Trace(sb.ToString());\n        }\n\n        private class BitfinexSymbolDetails\n        {\n            [JsonProperty(\"pair\")]\n            public string Pair { get; set; }\n\n            [JsonProperty(\"price_precision\")]\n            public int PricePrecision { get; set; }\n\n            [JsonProperty(\"initial_margin\")]\n            public decimal InitialMargin { get; set; }\n\n            [JsonProperty(\"minimum_margin\")]\n            public decimal MinimumMargin { get; set; }\n\n            [JsonProperty(\"maximum_order_size\")]\n            public decimal MaximumOrderSize { get; set; }\n\n            [JsonProperty(\"minimum_order_size\")]\n            public decimal MinimumOrderSize { get; set; }\n\n            [JsonProperty(\"expiration\")]\n            public string Expiration { get; set; }\n        }\n\n        #endregion\n\n        [TestCase(\"ES\", Market.CME, 50, 0.25)]\n        [TestCase(\"ZB\", Market.CBOT, 1000, 0.015625)]\n        [TestCase(\"ZW\", Market.CBOT, 5000, 0.00125)]\n        [TestCase(\"SI\", Market.COMEX, 5000, 0.001)]\n        public void ReadsFuturesOptionsEntries(string ticker, string market, int expectedMultiplier, double expectedMinimumPriceFluctuation)\n        {\n            var future = Symbol.CreateFuture(ticker, market, SecurityIdentifier.DefaultDate);\n            var option = Symbol.CreateOption(\n                future,\n                market,\n                default(OptionStyle),\n                default(OptionRight),\n                default(decimal),\n                SecurityIdentifier.DefaultDate);\n\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            var results = db.GetSymbolProperties(market, option, SecurityType.FutureOption, \"USD\");\n\n            Assert.AreEqual((decimal)expectedMultiplier, results.ContractMultiplier);\n            Assert.AreEqual((decimal)expectedMinimumPriceFluctuation, results.MinimumPriceVariation);\n        }\n\n        [TestCase(\"index\")]\n        [TestCase(\"indexoption\")]\n        [TestCase(\"bond\")]\n        [TestCase(\"swap\")]\n        public void HandlesUnknownSecurityType(string securityType)\n        {\n            var line = string.Join(\",\",\n                \"usa\",\n                \"ABCXYZ\",\n                securityType,\n                \"Example Asset\",\n                \"USD\",\n                \"100\",\n                \"0.01\",\n                \"1\");\n\n            SecurityDatabaseKey key;\n            Assert.DoesNotThrow(() => TestingSymbolPropertiesDatabase.TestFromCsvLine(line, out key));\n        }\n\n        [Test]\n        public void HandlesEmptyOrderSizePriceMagnifierCorrectly()\n        {\n            var line = string.Join(\",\",\n                \"usa\",\n                \"ABC\",\n                \"equity\",\n                \"Example Asset\",\n                \"USD\",\n                \"100\",\n                \"0.01\",\n                \"1\",\n                \"\",\n                \"\");\n\n            var result = TestingSymbolPropertiesDatabase.TestFromCsvLine(line, out _);\n\n            Assert.IsNull(result.MinimumOrderSize);\n            Assert.AreEqual(1, result.PriceMagnifier);\n        }\n\n        private class TestingSymbolPropertiesDatabase : SymbolPropertiesDatabase\n        {\n            public TestingSymbolPropertiesDatabase(string file)\n                : base(file)\n            {\n            }\n\n            public static SymbolProperties TestFromCsvLine(string line, out SecurityDatabaseKey key)\n            {\n                return FromCsvLine(line, out key);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/TestAccountCurrencyProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    internal class TestAccountCurrencyProvider : IAccountCurrencyProvider\n    {\n        public string AccountCurrency { get; }\n\n        public TestAccountCurrencyProvider() : this(Currencies.USD) { }\n\n        public TestAccountCurrencyProvider(string accountCurrency)\n        {\n            AccountCurrency = accountCurrency;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/TestDefaultMarginCallModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    internal class TestDefaultMarginCallModel : DefaultMarginCallModel\n    {\n        public TestDefaultMarginCallModel(SecurityPortfolioManager portfolio, IOrderProperties defaultOrderProperties)\n            : base(portfolio, defaultOrderProperties)\n        {\n        }\n\n        public new IEnumerable<SubmitOrderRequest> GenerateMarginCallOrders(MarginCallOrdersParameters parameters)\n        {\n            return base.GenerateMarginCallOrders(parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/TradingCalendarTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n\n    [TestFixture]\n    public class TradingCalendarTests\n    {\n        private static readonly SecurityExchangeHours SecurityExchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n        [Test]\n        public void TestBasicFeaturesWithOptionsFutures()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            securities.Add(\n                Symbols.SPY,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Equity, Symbols.SPY),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[Symbols.SPY].SetMarketPrice(new TradeBar { Time = securities.UtcTime, Symbol = Symbols.SPY, Close = 195 });\n\n            var option1 = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 192m, new DateTime(2016, 02, 16));\n            securities.Add(\n                option1,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Option, option1),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n\n            var option2 = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 193m, new DateTime(2016, 03, 19));\n            securities.Add(\n                option2,\n                new Option(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Option, option2),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n\n            var future1= Symbol.CreateFuture(QuantConnect.Securities.Futures.Indices.SP500EMini, Market.CME, new DateTime(2016, 02, 16));\n            securities.Add(\n                future1,\n                new Future(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Future, future1),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n\n            var future2 = Symbol.CreateFuture(QuantConnect.Securities.Futures.Indices.SP500EMini, Market.CME, new DateTime(2016, 02, 19));\n            securities.Add(\n                future2,\n                new Future(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(SecurityType.Future, future2),\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null\n                )\n            );\n\n            var cal = new TradingCalendar(securities, marketHoursDatabase);\n\n            var optionDays = cal.GetDaysByType(TradingDayType.OptionExpiration, new DateTime(2016, 02, 16), new DateTime(2016, 03, 19)).Count();\n            Assert.AreEqual(2, optionDays);\n\n            var futureDays = cal.GetDaysByType(TradingDayType.OptionExpiration, new DateTime(2016, 02, 16), new DateTime(2016, 03, 19)).Count();\n            Assert.AreEqual(2, futureDays);\n\n            var days = cal.GetTradingDays(new DateTime(2016, 02, 16), new DateTime(2016, 03, 19));\n\n            var optionAndfutureDays = days.Where(x => x.FutureExpirations.Any() || x.OptionExpirations.Any()).Count();\n            Assert.AreEqual(3, optionAndfutureDays);\n\n            // why? because option1 and future1 expire in one day 2016-02-16. Lets have a look.\n            var day = cal.GetTradingDay(new DateTime(2016, 02, 16));\n            Assert.AreEqual(1, day.OptionExpirations.Count());\n            Assert.AreEqual(1, day.FutureExpirations.Count());\n\n            var businessDays = days.Where(x => x.BusinessDay).Count();\n            Assert.AreEqual(24, businessDays);\n\n            var weekends = days.Where(x => x.Weekend).Count();\n            Assert.AreEqual(9, weekends);\n\n            Assert.AreEqual(24 + 9, (new DateTime(2016, 03, 19) - new DateTime(2016, 02, 16)).TotalDays + 1 /*inclusive*/);\n        }\n\n        [Test]\n        public void ReversedDateRequestThrows()\n        {\n            var securities = new SecurityManager(TimeKeeper);\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var calendar = new TradingCalendar(securities, marketHoursDatabase);\n\n            Assert.Throws<ArgumentException>(() =>\n                calendar.GetTradingDays(new DateTime(2010, 2, 28), new DateTime(2010, 2, 10)).ToList());\n        }\n\n        private SubscriptionDataConfig CreateTradeBarDataConfig(SecurityType type, Symbol symbol)\n        {\n            if (type == SecurityType.Equity)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Forex)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Option)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Future)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            throw new NotImplementedException(type.ToString());\n        }\n\n        private static TimeKeeper TimeKeeper\n        {\n            get { return new TimeKeeper(DateTime.Now, new[] { TimeZones.NewYork }); }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Securities/UniverseManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Securities\n{\n    [TestFixture]\n    public class UniverseManagerTests\n    {\n        [Test]\n        public void NotifiesWhenSecurityAdded()\n        {\n            var manager = new UniverseManager();\n\n            var universe = new FuncUniverse(CreateTradeBarConfig(), new UniverseSettings(Resolution.Minute, 2, true, false, TimeSpan.Zero),\n                data => data.Select(x => x.Symbol)\n                );\n\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.Value != universe)\n                {\n                    Assert.Fail(\"Expected args.NewItems to have exactly one element equal to universe\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Add);\n                    Assert.Pass();\n                }\n            };\n\n            manager.Add(universe.Configuration.Symbol, universe);\n        }\n\n        [Test]\n        public void NotifiesWhenSecurityAddedViaIndexer()\n        {\n            var manager = new UniverseManager();\n\n            var universe = new FuncUniverse(CreateTradeBarConfig(), new UniverseSettings(Resolution.Minute, 2, true, false, TimeSpan.Zero), \n                data => data.Select(x => x.Symbol)\n                );\n\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.Value != universe)\n                {\n                    Assert.Fail(\"Expected args.NewItems to have exactly one element equal to universe\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Add);\n                    Assert.Pass();\n                }\n            };\n\n            manager[universe.Configuration.Symbol] = universe;\n        }\n\n        [Test]\n        public void NotifiesWhenSecurityRemoved()\n        {\n            var manager = new UniverseManager();\n\n            var universe = new FuncUniverse(CreateTradeBarConfig(), new UniverseSettings(Resolution.Minute, 2, true, false, TimeSpan.Zero), \n                data => data.Select(x => x.Symbol)\n                );\n\n            manager.Add(universe.Configuration.Symbol, universe);\n            manager.CollectionChanged += (sender, args) =>\n            {\n                if (args.Value != universe)\n                {\n                    Assert.Fail(\"Expected args.OldItems to have exactly one element equal to universe\");\n                }\n                else\n                {\n                    Assert.IsTrue(args.Action == NotifyCollectionChangedAction.Remove);\n                    Assert.Pass();\n                }\n            };\n\n            manager.Remove(universe.Configuration.Symbol);\n        }\n\n        private SubscriptionDataConfig CreateTradeBarConfig()\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SeriesSamplerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SeriesSamplerTests\n    {\n        private readonly DateTime _reference = new(2023, 2, 2);\n\n        [TestCase(0, true)]\n        [TestCase(1, true)]\n        [TestCase(2, true)]\n        [TestCase(3, true)]\n        [TestCase(0, false)]\n        [TestCase(1, false)]\n        [TestCase(2, false)]\n        [TestCase(3, false)]\n        public void ReturnsIdentityFutureOrPastCandlestick(int dataPoints, bool futureOrPast)\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            for (var i = 0; i < dataPoints; i++)\n            {\n                series.AddPoint(new Candlestick(_reference.AddDays(futureOrPast ? (i + 1000) : i), 1, 1, 1, 1));\n            }\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n            var sampled = sampler.Sample(series, _reference.AddDays(10), _reference.AddDays(11));\n\n            // empty\n            Assert.AreEqual(0, sampled.Values.Count);\n        }\n\n        [TestCase(0, true)]\n        [TestCase(1, true)]\n        [TestCase(2, true)]\n        [TestCase(3, true)]\n        [TestCase(0, false)]\n        [TestCase(1, false)]\n        [TestCase(2, false)]\n        [TestCase(3, false)]\n        public void ReturnsIdentityFutureOrPastPoints(int dataPoints, bool futureOrPast)\n        {\n            var series = new Series { Name = \"name\" };\n            for (var i = 0; i < dataPoints; i++)\n            {\n                series.AddPoint(new ChartPoint(_reference.AddDays(futureOrPast ? (i + 1000) : i), 1));\n            }\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n            var sampled = sampler.Sample(series, _reference.AddDays(10), _reference.AddDays(11));\n\n            // empty\n            Assert.AreEqual(0, sampled.Values.Count);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ReturnsIdentityOnSinglePoint(bool isNullValue)\n        {\n            var series = new Series {Name = \"name\"};\n            series.AddPoint(new ChartPoint(_reference, isNullValue ? null: 1));\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n\n            var sampled = sampler.Sample(series, _reference.AddSeconds(-1), _reference.AddSeconds(1));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(1, sampled.Values.Count);\n            Assert.AreEqual(seriesValues[0].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[0].y, sampledValues[0].y);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesNullFirstValue(bool subSample)\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(new ChartPoint(_reference, null));\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(_reference.AddDays(2), 3m);\n            series.AddPoint(_reference.AddDays(3), 4m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1.5)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(3));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[0].y);\n\n            Assert.AreEqual((seriesValues[1].x + seriesValues[2].x) / 2, sampledValues[1].x);\n            Assert.AreEqual((seriesValues[1].y + seriesValues[2].y) / 2, sampledValues[1].y);\n\n            Assert.AreEqual(seriesValues[3].x, sampledValues[2].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[2].y);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamples(bool subSample)\n        {\n            var series = new Series {Name = \"name\"};\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(_reference.AddDays(2), 3m);\n            series.AddPoint(_reference.AddDays(3), 4m);\n            series.AddPoint(new ChartPoint(_reference.AddDays(4), null));\n            series.AddPoint(_reference.AddDays(5), 5m);\n            series.AddPoint(_reference.AddDays(6), 6m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1.5)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(6));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(5, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[0].y, sampledValues[0].y);\n\n            Assert.AreEqual((seriesValues[1].x + seriesValues[2].x)/2, sampledValues[1].x);\n            Assert.AreEqual((seriesValues[1].y + seriesValues[2].y)/2, sampledValues[1].y);\n\n            Assert.AreEqual(seriesValues[3].x, sampledValues[2].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[2].y);\n\n            Assert.AreEqual((seriesValues[4].x + seriesValues[5].x) / 2, sampledValues[3].x);\n            Assert.AreEqual(seriesValues[5].y, sampledValues[3].y);\n\n            Assert.AreEqual(seriesValues[6].x, sampledValues[4].x);\n            Assert.AreEqual(seriesValues[6].y, sampledValues[4].y);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesWithTimeJump(bool subSample)\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(_reference.AddDays(2), 3m);\n            series.AddPoint(_reference.AddDays(3), 4m);\n            series.AddPoint(new ChartPoint(_reference.AddDays(4), null));\n            // time jump\n            series.AddPoint(_reference.AddDays(20), 5m);\n            series.AddPoint(_reference.AddDays(21), 6m);\n\n            var span = TimeSpan.FromDays(1.5);\n            var sampler = new SeriesSampler(span) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(24));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(subSample ? 15 : 5, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[0].y, sampledValues[0].y);\n\n            Assert.AreEqual((seriesValues[1].x + seriesValues[2].x) / 2, sampledValues[1].x);\n            Assert.AreEqual((seriesValues[1].y + seriesValues[2].y) / 2, sampledValues[1].y);\n\n            Assert.AreEqual(seriesValues[3].x, sampledValues[2].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[2].y);\n\n            var expectedTime = seriesValues[3].x;\n            for (var i = 3; i < 13; i++)\n            {\n                expectedTime += (long)span.TotalSeconds;\n\n                if (subSample)\n                {\n                    Assert.AreEqual(expectedTime, sampledValues[i].x);\n                    // all nulls\n                    Assert.AreEqual(null, sampledValues[i].y);\n                }\n            }\n\n            var expectedIndex = subSample ? 13 : 3;\n\n            Assert.AreEqual(expectedTime + (long)span.TotalSeconds, sampledValues[expectedIndex].x);\n            Assert.AreEqual(seriesValues[5].y, sampledValues[expectedIndex].y);\n\n            expectedIndex++;\n            Assert.AreEqual(seriesValues[6].x, sampledValues[expectedIndex].x);\n            Assert.AreEqual(seriesValues[6].y, sampledValues[expectedIndex].y);\n        }\n\n        [Test]\n        public void SubSamples()\n        {\n            var series = new Series {Name = \"name\"};\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(new ChartPoint(_reference.AddDays(2), null));\n            series.AddPoint(_reference.AddDays(3), 4m);\n            series.AddPoint(_reference.AddDays(4), 5m);\n            series.AddPoint(_reference.AddDays(5), 6m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(0.5));\n\n            var sampled = sampler.Sample(series, _reference.AddDays(1), _reference.AddDays(3));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(5, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[1].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[0].y);\n\n            Assert.AreEqual((seriesValues[1].x + seriesValues[2].x) / 2, sampledValues[1].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[1].y);\n            Assert.AreEqual(seriesValues[2].x, sampledValues[2].x);\n            Assert.AreEqual(null, sampledValues[2].y);\n\n            Assert.AreEqual((seriesValues[3].x + seriesValues[2].x) / 2, sampledValues[3].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[3].y);\n            Assert.AreEqual(seriesValues[3].x, sampledValues[4].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[4].y);\n        }\n\n        [Test]\n        public void SubSamplesDisabled()\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(new ChartPoint(_reference.AddDays(2), null));\n            // even if the data doesn't fit exactly the expected bar span we expect it to pass through\n            series.AddPoint(_reference.AddDays(2.8), 4m);\n            series.AddPoint(_reference.AddDays(4), 5m);\n            series.AddPoint(_reference.AddDays(5), 6m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(0.5)) { SubSample = false };\n\n            var sampled = sampler.Sample(series, _reference.AddDays(1), _reference.AddDays(3));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[1].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[0].y);\n\n            Assert.AreEqual(seriesValues[2].x, sampledValues[1].x);\n            Assert.AreEqual(seriesValues[2].y, sampledValues[1].y);\n\n            Assert.AreEqual(seriesValues[3].x, sampledValues[2].x);\n            Assert.AreEqual(seriesValues[3].y, sampledValues[2].y);\n        }\n\n        [Test]\n        public void SubSamplesWithTimeJump()\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(new ChartPoint(_reference.AddDays(2), null));\n            series.AddPoint(_reference.AddDays(10), 4m);\n            series.AddPoint(_reference.AddDays(11), 5m);\n            series.AddPoint(_reference.AddDays(12), 6m);\n\n            var span = TimeSpan.FromDays(0.5);\n            var sampler = new SeriesSampler(span);\n\n            var sampled = sampler.Sample(series, _reference.AddDays(1), _reference.AddDays(12));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(23, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[1].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[0].y);\n\n            var expectedTime = seriesValues[1].x;\n            expectedTime += (long)span.TotalSeconds;\n\n            Assert.AreEqual(expectedTime, sampledValues[1].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[1].y);\n\n            for (var i = 2; i < 17; i++)\n            {\n                expectedTime += (long)span.TotalSeconds;\n\n                Assert.AreEqual(expectedTime, sampledValues[i].x);\n                Assert.AreEqual(null, sampledValues[i].y);\n            }\n\n            Assert.AreEqual(seriesValues[4].x, sampledValues[20].x);\n            Assert.AreEqual(seriesValues[4].y, sampledValues[20].y);\n\n            Assert.AreEqual(seriesValues[4].x + (long)span.TotalSeconds, sampledValues[21].x);\n            Assert.AreEqual((seriesValues[4].y + seriesValues[5].y) / 2, sampledValues[21].y);\n\n            Assert.AreEqual(seriesValues[5].x, sampledValues[22].x);\n            Assert.AreEqual(seriesValues[5].y, sampledValues[22].y);\n        }\n\n        [Test]\n        public void DoesNotSampleBeforeStart()\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(_reference, 1m);\n            series.AddPoint(_reference.AddDays(1), 2m);\n            series.AddPoint(_reference.AddDays(2), 3m);\n            series.AddPoint(_reference.AddDays(3), 4m);\n            series.AddPoint(_reference.AddDays(4), 5m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n\n            var sampled = sampler.Sample(series, _reference.AddDays(-1), _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<ChartPoint>().ToList();\n            var sampledValues = sampled.Values.Cast<ChartPoint>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].x, sampledValues[0].x);\n            Assert.AreEqual(seriesValues[0].y, sampledValues[0].y);\n\n            Assert.AreEqual(seriesValues[1].x, sampledValues[1].x);\n            Assert.AreEqual(seriesValues[1].y, sampledValues[1].y);\n\n            Assert.AreEqual(seriesValues[2].x, sampledValues[2].x);\n            Assert.AreEqual(seriesValues[2].y, sampledValues[2].y);\n        }\n\n        [Test]\n        public void HandlesDuplicateTimes()\n        {\n            var series = new Series();\n            series.Values.Add(new ChartPoint(_reference, 1m));\n            series.Values.Add(new ChartPoint(_reference, 2m));\n            series.Values.Add(new ChartPoint(_reference.AddDays(1), 3m));\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(1));\n\n            // sampler will only produce one value at the time\n            // it was also respect the latest value\n\n            Assert.AreEqual(2, sampled.Values.Count);\n            foreach (var pair in series.Values.Skip(1).Cast<ChartPoint>().Zip(sampled.Values.Cast<ChartPoint>(), Tuple.Create))\n            {\n                Assert.AreEqual(pair.Item1.x, pair.Item2.x);\n                Assert.AreEqual(pair.Item1.y, pair.Item2.y);\n            }\n        }\n\n        [Test]\n        public void DoesNotSampleScatterPlots()\n        {\n            var scatter = new Series(\"scatter\", SeriesType.Scatter, 0, \"$\");\n            scatter.AddPoint(_reference, 1m);\n            scatter.AddPoint(_reference, 3m);\n            scatter.AddPoint(_reference.AddSeconds(1), 1.5m);\n            scatter.AddPoint(_reference.AddSeconds(0.5), 1.5m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromMilliseconds(1));\n            var sampled = sampler.Sample(scatter, _reference, _reference.AddDays(1));\n            foreach (var pair in scatter.Values.Cast<ChartPoint>().Zip(sampled.Values.Cast<ChartPoint>(), Tuple.Create))\n            {\n                Assert.AreEqual(pair.Item1.x, pair.Item2.x);\n                Assert.AreEqual(pair.Item1.y, pair.Item2.y);\n            }\n        }\n\n        [Test]\n        public void SubSampleTreemapPlots()\n        {\n            var treeMap = new Series(\"Treemap\", SeriesType.Treemap, 0, \"$\");\n            treeMap.AddPoint(_reference, 1m);\n            treeMap.AddPoint(_reference.AddSeconds(0.5), 1.5m);\n            treeMap.AddPoint(_reference.AddMinutes(1), 2m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromMilliseconds(1));\n            var sampled = sampler.Sample(treeMap, _reference, _reference.AddDays(1));\n\n            Assert.AreEqual(1000 * 60 + 1, sampled.Values.Count);\n            foreach (var newValues in sampled.Values.Cast<ChartPoint>())\n            {\n                var expected = (ChartPoint)treeMap.Values[0];\n                if (newValues.Time >= treeMap.Values[1].Time)\n                {\n                    expected = (ChartPoint)treeMap.Values[1];\n                }\n                if (newValues.Time >= treeMap.Values[2].Time)\n                {\n                    expected = (ChartPoint)treeMap.Values[2];\n                }\n                Assert.AreEqual(expected.y, newValues.y);\n            }\n        }\n\n        [Test]\n        public void DownSampleTreemapPlots()\n        {\n            var treeMap = new Series(\"Treemap\", SeriesType.Treemap, 0, \"$\");\n            treeMap.AddPoint(_reference, 1m);\n            treeMap.AddPoint(_reference, 3m);\n            treeMap.AddPoint(_reference.AddSeconds(0.5), 1.5m);\n            treeMap.AddPoint(_reference.AddSeconds(1), 1.5m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n            var sampled = sampler.Sample(treeMap, _reference, _reference.AddDays(1));\n\n            // the last value\n            Assert.AreEqual(1, sampled.Values.Count);\n            Assert.AreEqual(_reference, sampled.Values[0].Time);\n            Assert.AreEqual(((ChartPoint)treeMap.Values.Last()).Y, ((ChartPoint)sampled.Values[0]).Y);\n        }\n\n        [Test]\n        public void EmitsEmptySeriesWithSinglePointOutsideOfStartStop()\n        {\n            var series = new Series { Name = \"name\" };\n            series.AddPoint(_reference.AddSeconds(-1), 1m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n\n            var sampled = sampler.Sample(series, _reference, _reference);\n            Assert.AreEqual(0, sampled.Values.Count);\n        }\n\n        [Test]\n        public void ReturnsIdentityOnSinglePointCandlestickSeries()\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n\n            var sampled = sampler.Sample(series, _reference.AddSeconds(-1), _reference.AddSeconds(1));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(1, sampledValues.Count);\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            Assert.AreEqual(seriesValues[0].Open, sampledValues[0].Open);\n            Assert.AreEqual(seriesValues[0].High, sampledValues[0].High);\n            Assert.AreEqual(seriesValues[0].Low, sampledValues[0].Low);\n            Assert.AreEqual(seriesValues[0].Close, sampledValues[0].Close);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DoesNotSampleCandlestickSeriesBeforeStart(bool subSample)\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n            series.AddPoint(_reference.AddDays(4), 2m, 3m, 2m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference.AddDays(-1), _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            for (var i = 0; i < sampledValues.Count; i++)\n            {\n                Assert.AreEqual(seriesValues[i].Time, sampledValues[i].Time);\n                AssertCandlesticksValuesAreEqual(seriesValues[i], sampledValues[i]);\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesCandlestickSeriesWithStopSameAsLastPoint(bool subSample)\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 1.5 day intervals\n            //      Original series: |---------|---------|---------|\n            //      Sampled series:  |--------------|--------------|\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1.5)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(3));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(1.5), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(Math.Max(seriesValues[1].High.Value, seriesValues[2].High.Value), sampledValues[1].High);\n            Assert.AreEqual(Math.Min(seriesValues[1].Low.Value, seriesValues[2].Low.Value), sampledValues[1].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[2], TimeSpan.FromDays(1), sampledValues[1].LongTime), sampledValues[1].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2 * 1.5), sampledValues[2].Time);\n            Assert.AreEqual(seriesValues[3].Open, sampledValues[2].Open);\n            Assert.AreEqual(seriesValues[3].High, sampledValues[2].High);\n            Assert.AreEqual(seriesValues[3].Low, sampledValues[2].Low);\n            Assert.AreEqual(seriesValues[3].Close, sampledValues[2].Close);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesCandlestickSeriesWithStopAfterLastPoint(bool subSample)\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 1.5 day intervals\n            //      Original series: |---------|---------|---------|---------|\n            //      Sampled series:  |--------------|--------------|--------------\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n            series.AddPoint(_reference.AddDays(4), 2m, 3m, 2m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1.5)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(4));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(1.5), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(Math.Max(seriesValues[1].High.Value, seriesValues[2].High.Value), sampledValues[1].High);\n            Assert.AreEqual(Math.Min(seriesValues[1].Low.Value, seriesValues[2].Low.Value), sampledValues[1].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[2], TimeSpan.FromDays(1), sampledValues[1].LongTime), sampledValues[1].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2 * 1.5), sampledValues[2].Time);\n            Assert.AreEqual(seriesValues[3].Open, sampledValues[2].Open);\n            Assert.AreEqual(seriesValues[3].High, sampledValues[2].High);\n            Assert.AreEqual(seriesValues[3].Low, sampledValues[2].Low);\n            Assert.AreEqual(seriesValues[3].Close, sampledValues[2].Close);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesCandlestickSeriesWithResamplePeriodSpanningMultipleCandlesticks(bool subSample)\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 2.5 day intervals\n            //      Original series: |---------|---------|---------|---------|---------|---------|---------|\n            //      Sampled series:  |------------------------|------------------------|-----------------------\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n            series.AddPoint(_reference.AddDays(4), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(5), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(6), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(7), 2m, 3m, 2m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(2.5)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(5));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2.5), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(new[] { seriesValues[1].High, seriesValues[2].High, seriesValues[3].High }.Max(), sampledValues[1].High);\n            Assert.AreEqual(new[] { seriesValues[1].Low, seriesValues[2].Low, seriesValues[3].Low }.Min(), sampledValues[1].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[1], seriesValues[3], TimeSpan.FromDays(1), sampledValues[1].LongTime), (double)sampledValues[1].Close, delta: 1e-3);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2 * 2.5), sampledValues[2].Time);\n            Assert.AreEqual(seriesValues[4].Open, sampledValues[2].Open);\n            Assert.AreEqual(Math.Max(seriesValues[4].High.Value, seriesValues[5].High.Value), sampledValues[2].High);\n            Assert.AreEqual(Math.Min(seriesValues[4].Low.Value, seriesValues[5].Low.Value), sampledValues[2].Low);\n            Assert.AreEqual(seriesValues[5].Close, sampledValues[2].Close);\n        }\n\n        private static decimal InterpolateClose(Candlestick prev, Candlestick next, TimeSpan candleSpan, long time)\n        {\n            var prevOpenUnitTime = Time.DateTimeToUnixTimeStamp(prev.Time - candleSpan).SafeDecimalCast();\n            return (next.Close.Value - prev.Open.Value) * (time - prevOpenUnitTime) / (next.LongTime - prevOpenUnitTime) + prev.Open.Value;\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DownSamplesCandlestickSeriesWithStopBeforeLastPoint(bool subSample)\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 1.25 day intervals\n            //      Original series: |-----------|-----------|-----------|-----------|\n            //      Sampled series:  |--------------|--------------|--------------|\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n            series.AddPoint(_reference.AddDays(4), 2m, 3m, 2m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1.25)) { SubSample = subSample };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(4));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(4, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(1.25), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(Math.Max(seriesValues[1].High.Value, seriesValues[2].High.Value), sampledValues[1].High);\n            Assert.AreEqual(Math.Min(seriesValues[1].Low.Value, seriesValues[2].Low.Value), sampledValues[1].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[2], TimeSpan.FromDays(1), sampledValues[1].LongTime), sampledValues[1].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2 * 1.25), sampledValues[2].Time);\n            Assert.AreEqual(seriesValues[3].Open, sampledValues[2].Open);\n            Assert.AreEqual(seriesValues[3].High, sampledValues[2].High);\n            Assert.AreEqual(1.5m, sampledValues[2].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[3], seriesValues[3], TimeSpan.FromDays(1), sampledValues[2].LongTime), sampledValues[2].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(3 * 1.25), sampledValues[3].Time);\n            Assert.AreEqual(seriesValues[4].Open, sampledValues[3].Open);\n            Assert.AreEqual(2.75m, sampledValues[3].High);\n            Assert.AreEqual(seriesValues[4].Low, sampledValues[3].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[4], seriesValues[4], TimeSpan.FromDays(1), sampledValues[3].LongTime), sampledValues[3].Close);\n        }\n\n        [Test]\n        public void SubSamplesCandlestickSeries()\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(_reference.AddDays(3), 2m, 2m, 1m, 1m);\n            series.AddPoint(_reference.AddDays(4), 2m, 3m, 2m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(1));\n\n            var sampled = sampler.Sample(series, _reference.AddDays(1), _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(2, sampled.Values.Count);\n\n            for (var i = 0; i < sampledValues.Count; i++)\n            {\n                Assert.AreEqual(seriesValues[i + 1].Time, sampledValues[i].Time);\n                AssertCandlesticksValuesAreEqual(seriesValues[i + 1], sampledValues[i]);\n            }\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithHigherSamplingResolution()\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 0.25 day intervals\n            //      Original series: |-------------------|-------------------|\n            //      Sampled series:  |----|----|----|----|----|----|----|----|\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(0.25));\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(9, sampled.Values.Count);\n\n            // First half:\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(0.25), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(2.25, sampledValues[1].High);\n            Assert.AreEqual(seriesValues[1].Low, sampledValues[1].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[1].LongTime), sampledValues[1].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(2 * 0.25), sampledValues[2].Time);\n            Assert.AreEqual(sampledValues[1].Close, sampledValues[2].Open);\n            Assert.AreEqual(2.5, sampledValues[2].High);\n            Assert.AreEqual(2.25, sampledValues[2].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[2].LongTime), sampledValues[2].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(3 * 0.25), sampledValues[3].Time);\n            Assert.AreEqual(sampledValues[2].Close, sampledValues[3].Open);\n            Assert.AreEqual(2.75, sampledValues[3].High);\n            Assert.AreEqual(2.5, sampledValues[3].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[3].LongTime), sampledValues[3].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(4 * 0.25), sampledValues[4].Time);\n            Assert.AreEqual(sampledValues[3].Close, sampledValues[4].Open);\n            Assert.AreEqual(seriesValues[1].High, sampledValues[4].High);\n            Assert.AreEqual(2.75, sampledValues[4].Low);\n            Assert.AreEqual(seriesValues[1].Close, sampledValues[4].Close);\n\n            // Second half:\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(5 * 0.25), sampledValues[5].Time);\n            Assert.AreEqual(seriesValues[2].Open, sampledValues[5].Open);\n            Assert.AreEqual(seriesValues[2].High, sampledValues[5].High);\n            Assert.AreEqual(3.75, sampledValues[5].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[5].LongTime), sampledValues[5].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(6 * 0.25), sampledValues[6].Time);\n            Assert.AreEqual(sampledValues[5].Close, sampledValues[6].Open);\n            Assert.AreEqual(3.75m, sampledValues[6].High);\n            Assert.AreEqual(3.5m, sampledValues[6].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[6].LongTime), sampledValues[6].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(7 * 0.25), sampledValues[7].Time);\n            Assert.AreEqual(sampledValues[6].Close, sampledValues[7].Open);\n            Assert.AreEqual(3.5m, sampledValues[7].High);\n            Assert.AreEqual(3.25m, sampledValues[7].Low);\n            Assert.AreEqual(InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[7].LongTime), sampledValues[7].Close);\n\n            Assert.AreEqual(seriesValues[0].Time.AddDays(8 * 0.25), sampledValues[8].Time);\n            Assert.AreEqual(sampledValues[7].Close, sampledValues[8].Open);\n            Assert.AreEqual(3.25m, sampledValues[8].High);\n            Assert.AreEqual(seriesValues[2].Low, sampledValues[8].Low);\n            Assert.AreEqual(seriesValues[2].Close, sampledValues[8].Close);\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithHigherSamplingResolutionDisabled()\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 0.25 day intervals\n            //      Original series: |-------------------|-------------------|\n            //      Sampled series:  |-------------------|-------------------|\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            // even if the data doesn't fit exactly the expected bar span we expect it to pass through\n            series.AddPoint(_reference.AddDays(1.6), 4m, 4m, 3m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromDays(0.25)) { SubSample = false };\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(3, sampled.Values.Count);\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[1].Time, sampledValues[1].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[1], sampledValues[1]);\n\n            Assert.AreEqual(seriesValues[2].Time, sampledValues[2].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[2], sampledValues[2]);\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithLowerSamplingResolutionNullValues()\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(new Candlestick(_reference.AddDays(3), null, null, null, null));\n            // Time jump\n            series.AddPoint(_reference.AddDays(11), 5m, 5m, 5m, 5m);\n\n            var barSpan = TimeSpan.FromDays(1.5);\n            var sampler = new SeriesSampler(barSpan);\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(12));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(8, sampled.Values.Count);\n\n            var expectedTime = series.Values[3].Time;\n            for (var i = 2; i < 7; i++)\n            {\n                Assert.AreEqual(expectedTime, sampledValues[i].Time);\n                Assert.AreEqual(null, sampledValues[i].Open);\n                Assert.AreEqual(null, sampledValues[i].High);\n                Assert.AreEqual(null, sampledValues[i].Low);\n                Assert.AreEqual(null, sampledValues[i].Close);\n                expectedTime += barSpan;\n            }\n\n            Assert.AreEqual(expectedTime, sampledValues[7].Time);\n            Assert.AreEqual(seriesValues[4].Open, sampledValues[7].Open);\n            Assert.AreEqual(seriesValues[4].High, sampledValues[7].High);\n            Assert.AreEqual(seriesValues[4].Low, sampledValues[7].Low);\n            Assert.AreEqual(seriesValues[4].Close, sampledValues[7].Close);\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithHigherSamplingResolutionNullValues()\n        {\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n            series.AddPoint(new Candlestick(_reference.AddDays(3), null, null, null, null));\n            // Time jump\n            series.AddPoint(_reference.AddDays(10), 5m, 5m, 5m, 5m);\n\n            var barSpan = TimeSpan.FromDays(0.5);\n            var sampler = new SeriesSampler(barSpan);\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(10));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(21, sampled.Values.Count);\n\n            var expectedTime = series.Values[2].Time;\n            for (var i = 5; i < 19; i++)\n            {\n                expectedTime += barSpan;\n                Assert.AreEqual(expectedTime, sampledValues[i].Time);\n                Assert.AreEqual(null, sampledValues[i].Open);\n                Assert.AreEqual(null, sampledValues[i].High);\n                Assert.AreEqual(null, sampledValues[i].Low);\n                Assert.AreEqual(null, sampledValues[i].Close);\n            }\n\n            expectedTime += barSpan;\n            Assert.AreEqual(expectedTime, sampledValues[19].Time);\n            Assert.AreEqual(seriesValues[4].Open, sampledValues[19].Open);\n            Assert.AreEqual(seriesValues[4].High, sampledValues[19].High);\n            Assert.AreEqual(seriesValues[4].Low, sampledValues[19].Low);\n            Assert.AreEqual(seriesValues[4].Close, sampledValues[19].Close);\n\n            expectedTime += barSpan;\n            Assert.AreEqual(expectedTime, sampledValues[20].Time);\n            Assert.AreEqual(seriesValues[4].Open, sampledValues[20].Open);\n            Assert.AreEqual(seriesValues[4].High, sampledValues[20].High);\n            Assert.AreEqual(seriesValues[4].Low, sampledValues[20].Low);\n            Assert.AreEqual(seriesValues[4].Close, sampledValues[20].Close);\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithHigherUnevenSamplingResolutionAndStopAfterLastPoint()\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 10 hours intervals\n            //      Original series: |-------------------|-------------------|\n            //      Sampled series:  |--------|--------|--------|--------|--------\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromHours(10));\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddDays(2));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(5, sampled.Values.Count);\n\n            // First half:\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(1 * 10), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(2.416667m, sampledValues[1].High);\n            Assert.AreEqual(seriesValues[1].Low, sampledValues[1].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[1].LongTime), (double)sampledValues[1].Close, delta: 1e-3);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(2 * 10), sampledValues[2].Time);\n            Assert.AreEqual(sampledValues[1].Close, sampledValues[2].Open);\n            Assert.AreEqual(2.833333m, sampledValues[2].High);\n            Assert.AreEqual(2.416667m, sampledValues[2].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[2].LongTime), (double)sampledValues[2].Close, delta: 1e-3);\n\n            // Second half:\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(3 * 10), sampledValues[3].Time);\n            Assert.AreEqual(seriesValues[2].Open, sampledValues[3].Open);\n            Assert.AreEqual(seriesValues[2].High, sampledValues[3].High);\n            Assert.AreEqual(3.75m, sampledValues[3].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[3].LongTime), (double)sampledValues[3].Close, delta: 1e-3);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(4 * 10), sampledValues[4].Time);\n            Assert.AreEqual(sampledValues[3].Close, sampledValues[4].Open);\n            Assert.AreEqual(3.75m, sampledValues[4].High);\n            Assert.AreEqual(3.333333m, sampledValues[4].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[4].LongTime), (double)sampledValues[4].Close, delta: 1e-3);\n        }\n\n        [Test]\n        public void SamplesCandlestickSeriesWithHigherUnevenSamplingResolutionAndStopBeforeLastPoint()\n        {\n            // Original series is sampled at 1 day intervals\n            // Sampled series is sampled at 10 hours intervals\n            //      Original series: |-------------------|-------------------|\n            //      Sampled series:  |--------|--------|--------|--------|\n\n            var series = new CandlestickSeries { Name = \"name\" };\n            series.AddPoint(_reference, 1m, 2m, 1m, 2m);\n            series.AddPoint(_reference.AddDays(1), 2m, 3m, 2m, 3m);\n            series.AddPoint(_reference.AddDays(2), 4m, 4m, 3m, 3m);\n\n            var sampler = new SeriesSampler(TimeSpan.FromHours(10));\n\n            var sampled = sampler.Sample(series, _reference, _reference.AddHours(40));\n\n            var seriesValues = series.Values.Cast<Candlestick>().ToList();\n            var sampledValues = sampled.Values.Cast<Candlestick>().ToList();\n\n            Assert.AreEqual(5, sampled.Values.Count);\n\n            Assert.AreEqual(5, sampled.Values.Count);\n\n            // First half:\n\n            Assert.AreEqual(seriesValues[0].Time, sampledValues[0].Time);\n            AssertCandlesticksValuesAreEqual(seriesValues[0], sampledValues[0]);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(1 * 10), sampledValues[1].Time);\n            Assert.AreEqual(seriesValues[1].Open, sampledValues[1].Open);\n            Assert.AreEqual(2.416667m, sampledValues[1].High);\n            Assert.AreEqual(seriesValues[1].Low, sampledValues[1].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[1].LongTime), (double)sampledValues[1].Close, delta: 1e-3);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(2 * 10), sampledValues[2].Time);\n            Assert.AreEqual(sampledValues[1].Close, sampledValues[2].Open);\n            Assert.AreEqual(2.833333m, sampledValues[2].High);\n            Assert.AreEqual(2.416667m, sampledValues[2].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[1], seriesValues[1], TimeSpan.FromDays(1), sampledValues[2].LongTime), (double)sampledValues[2].Close, delta: 1e-3);\n\n            // Second half:\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(3 * 10), sampledValues[3].Time);\n            Assert.AreEqual(seriesValues[2].Open, sampledValues[3].Open);\n            Assert.AreEqual(seriesValues[2].High, sampledValues[3].High);\n            Assert.AreEqual(3.75m, sampledValues[3].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[3].LongTime), (double)sampledValues[3].Close, delta: 1e-3);\n\n            Assert.AreEqual(seriesValues[0].Time.AddHours(4 * 10), sampledValues[4].Time);\n            Assert.AreEqual(sampledValues[3].Close, sampledValues[4].Open);\n            Assert.AreEqual(3.75m, sampledValues[4].High);\n            Assert.AreEqual(3.333333m, sampledValues[4].Low);\n            Assert.AreEqual((double)InterpolateClose(seriesValues[2], seriesValues[2], TimeSpan.FromDays(1), sampledValues[4].LongTime), (double)sampledValues[4].Close, delta: 1e-3);\n        }\n\n        private static void AssertCandlesticksValuesAreEqual(Candlestick first, Candlestick second)\n        {\n            Assert.AreEqual(first.Open, second.Open);\n            Assert.AreEqual(first.High, second.High);\n            Assert.AreEqual(first.Low, second.Low);\n            Assert.AreEqual(first.Close, second.Close);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SeriesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing System.Drawing;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SeriesTests\n    {\n        [Test]\n        public void RespectsMostRecentTimeOnDuplicatePoints()\n        {\n            var series = new Series();\n            series.AddPoint(new DateTime(2023, 2, 2), 1m);\n            series.AddPoint(new DateTime(2023, 2, 2), 2m);\n            Assert.AreEqual(1, series.Values.Count);\n            Assert.AreEqual(2m, series.GetValues<ChartPoint>().Single().y);\n        }\n\n        [TestCase(null, \"toolTip\")]\n        [TestCase(\"IndexName\", \"toolTip\")]\n        [TestCase(null, null)]\n        [TestCase(\"IndexName\", null)]\n        public void Clone(string indexName, string toolTip)\n        {\n            var series = new Series(\"A\", SeriesType.Line, \"TT\", Color.AliceBlue, ScatterMarkerSymbol.Circle) { ZIndex = 98, Index = 8, IndexName = indexName, Tooltip = toolTip };\n            var result = (Series)series.Clone();\n\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.Tooltip, result.Tooltip);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n            Assert.AreEqual(series.Index, result.Index);\n            Assert.AreEqual(series.ZIndex, result.ZIndex);\n            Assert.AreEqual(series.IndexName, result.IndexName);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/AnnualPerformanceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.Linq;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing System;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Lean.Engine.Setup;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class AnnualPerformanceTests\n    {\n        private List<TradeBar> _spy = new List<TradeBar>();\n\n        /// <summary>\n        /// Instance of QC Algorithm. \n        /// Use to get <see cref=\"Interfaces.IAlgorithmSettings.TradingDaysPerYear\"/> for clear calculation in <seealso cref=\"QuantConnect.Statistics.Statistics.AnnualPerformance\"/>\n        /// </summary>\n        private QCAlgorithm _algorithm;\n\n        [SetUp]\n        public void GetSPY()\n        {\n            _algorithm = new QCAlgorithm();\n            BaseSetupHandler.SetBrokerageTradingDayPerYear(_algorithm);\n\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var path = LeanData.GenerateZipFilePath(Globals.DataFolder, symbol, new DateTime(2020, 3, 1), Resolution.Daily, TickType.Trade);\n            var config = new QuantConnect.Data.SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            foreach (var line in QuantConnect.Compression.ReadLines(path))\n            {\n                var bar = TradeBar.ParseEquity(config, line, DateTime.Now.Date);\n                _spy.Add(bar);\n            }\n        }\n\n        [TearDown]\n        public void Delete()\n        {\n            _spy.Clear();\n        }\n\n        [Test]\n        public void TotalMarketPerformance()\n        {\n            var performance = new List<double>();\n\n            for (var i = 1; i < _spy.Count; i++)\n            {\n                performance.Add((double)((_spy[i].Close / _spy[i - 1].Close) - 1));\n            }\n\n            var result = QuantConnect.Statistics.Statistics.AnnualPerformance(performance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.082859685889996371, result);\n        }\n\n        [Test]\n        public void BearMarketPerformance()\n        {\n            var performance = new List<double>();\n            var start = new DateTime(2008, 5, 1);\n            var end = new DateTime(2009, 1, 1);\n            for (var i = 1; i < _spy.Count; i++)\n            {\n                if ((_spy[i].EndTime < start) || (_spy[i].EndTime > end))\n                {\n                    continue;\n                }\n                performance.Add((double)((_spy[i].Close / _spy[i - 1].Close) - 1));\n            }\n\n            var result = QuantConnect.Statistics.Statistics.AnnualPerformance(performance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(-0.41546561808009674, result);\n        }\n\n        [Test]\n        public void BullMarketPerformance()\n        {\n            var performance = new List<double>();\n            var start = new DateTime(2017, 1, 1);\n            var end = new DateTime(2018, 1, 1);\n            for (var i = 1; i < _spy.Count; i++)\n            {\n                if ((_spy[i].EndTime < start) || (_spy[i].EndTime > end))\n                {\n                    continue;\n                }\n                performance.Add((double)((_spy[i].Close / _spy[i - 1].Close) - 1));\n            }\n\n            var result = QuantConnect.Statistics.Statistics.AnnualPerformance(performance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.19741738320179447, result);\n        }\n\n        [Test]\n        public void FullYearPerformance()\n        {\n            // Ensure mean is 1\n            var performance = Enumerable.Repeat(0.5, 176).ToList();\n            performance.AddRange(Enumerable.Repeat(1.5, 176).ToList());\n\n            var result = QuantConnect.Statistics.Statistics.AnnualPerformance(performance, 4);\n\n            Assert.AreEqual(15.0, result);\n        }\n\n        [Test]\n        public void AllZeros()\n        {\n            var performance = Enumerable.Repeat(0.0, 252).ToList();\n\n            var result = QuantConnect.Statistics.Statistics.AnnualPerformance(performance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.0, result);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Statistics/DrawdownRecoveryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    internal class DrawdownRecoveryTests\n    {\n        [Test, TestCaseSource(nameof(TestCases))]\n        public void DrawdownMetricsMaximumRecoveryTimeTests(List<decimal> data, decimal expectedRecoveryTime)\n        {\n            var startDate = new DateTime(2025, 1, 1);\n            var equity = new SortedDictionary<DateTime, decimal>();\n\n            for (int i = 0; i < data.Count; i++)\n            {\n                var value = data[i];\n                equity[startDate.AddDays(i)] = value;\n            }\n\n            var result = QuantConnect.Statistics.Statistics.CalculateDrawdownMetrics(equity).DrawdownRecovery;\n            Assert.AreEqual(expectedRecoveryTime, result);\n        }\n\n        private static IEnumerable<TestCaseData> TestCases()\n        {\n            yield return new TestCaseData(new List<decimal> { 100, 90, 100 }, 2m).SetName(\"RecoveryAfterOneDip2Days\");\n            yield return new TestCaseData(new List<decimal> { 100, 90, 95, 100 }, 3m).SetName(\"RecoveryAfterPartialThenFull3Days\");\n\n            yield return new TestCaseData(new List<decimal> { 100, 90, 100, 90, 100 }, 2m).SetName(\"RecoveryFromTwoEqualDips2DaysEach\");\n            yield return new TestCaseData(new List<decimal> { 100, 90, 100, 90, 80, 100 }, 3m).SetName(\"TakesLongestRecoveryAmongMultipleDrawdowns\");\n            yield return new TestCaseData(new List<decimal> { 100, 90, 95, 90, 100 }, 4m).SetName(\"RecoveryFromNestedDrawdowns4Days\");\n\n            yield return new TestCaseData(new List<decimal> { 100, 90, 80, 70 }, 0m).SetName(\"NoRecoveryContinuousDecline\");\n            yield return new TestCaseData(new List<decimal> { 100, 90, 95, 90 }, 0m).SetName(\"NoRecoveryPartialButNoNewHigh\");\n\n            yield return new TestCaseData(new List<decimal> { 50, 100, 98, 99, 100 }, 3m).SetName(\"RecoveryFromSecondaryPeak3Days\");\n            yield return new TestCaseData(new List<decimal> { 100, 100, 100 }, 0m).SetName(\"NoDrawdownFlatLine\");\n            yield return new TestCaseData(new List<decimal> { 100 }, 0m).SetName(\"NoDrawdownSingleValue\");\n            yield return new TestCaseData(new List<decimal>(), 0m).SetName(\"NoDrawdownEmptyList\");\n\n            yield return new TestCaseData(new List<decimal> { 100, 98, 100, 101, 100, 99 }, 2m).SetName(\"RecoveryBeforeNewHigh2Days\");\n            yield return new TestCaseData(new List<decimal> { 100, 97, 99, 97, 100 }, 4m).SetName(\"RecoveryWithMultipleDips4Days\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/PortfolioStatisticsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Statistics;\nusing QuantConnect.Tests.Indicators;\nusing static Microsoft.FSharp.Core.ByRefKinds;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    class PortfolioStatisticsTests\n    {\n        private const decimal TradeFee = 2;\n        private readonly DateTime _startTime = new DateTime(2015, 08, 06, 15, 30, 0);\n\n        /// <summary>\n        /// TradingDaysPerYear: Use like backward compatibility\n        /// </summary>\n        /// <remarks><see cref=\"Interfaces.IAlgorithmSettings.TradingDaysPerYear\"></remarks>\n        protected const int _tradingDaysPerYear = 252;\n\n        [Test]\n        public void ITMOptionAssignment([Values] bool win)\n        {\n            var statistics = GetPortfolioStatistics(win, _tradingDaysPerYear, new List<double> { 0, 0 }, new List<double> { 0, 0 });\n\n            if (win)\n            {\n                Assert.AreEqual(1m, statistics.WinRate);\n                Assert.AreEqual(0m, statistics.LossRate);\n            }\n            else\n            {\n                Assert.AreEqual(0.5m, statistics.WinRate);\n                Assert.AreEqual(0.5m, statistics.LossRate);\n            }\n\n            Assert.AreEqual(0.1173913043478260869565217391m, statistics.AverageWinRate);\n            Assert.AreEqual(-0.08m, statistics.AverageLossRate);\n            Assert.AreEqual(1.4673913043478260869565217388m, statistics.ProfitLossRatio);\n        }\n\n\n        public static IEnumerable<TestCaseData> StatisticsCases\n        {\n            get\n            {\n                yield return new TestCaseData(202, 0.00589787137120101M, 0.0767976000354244M, -3.0952570635188M, 0.167632655086644M, 0.252197874915608M);\n                yield return new TestCaseData(252, 0.00735774052248839M, 0.0857772727620108M, -3.3486737318423M, 0.187233350684845M, 0.257146306116665M);\n                yield return new TestCaseData(365, 0.0106570448043979M, 0.103232963748978M, -3.75507953923657M, 0.225335372429895M, 0.264390639112978M);\n            }\n        }\n\n        [TestCaseSource(nameof(StatisticsCases))]\n        public void ITMOptionAssignmentWithDifferentTradingDaysPerYearValue(\n            int tradingDaysPerYear, decimal expectedAnnualVariance, decimal expectedAnnualStandardDeviation,\n            decimal expectedSharpeRatio, decimal expectedTrackingError, decimal expectedProbabilisticSharpeRatio)\n        {\n            var listPerformance = new List<double> { -0.009025132, 0.003653969, 0, 0 };\n            var listBenchmark = new List<double> { -0.011587791300935783, 0.00054375782787618543, 0.022165997700413956, 0.006263266301918822 };\n\n            var statistics = GetPortfolioStatistics(true, tradingDaysPerYear, listPerformance, listBenchmark);\n\n            Assert.AreEqual(expectedAnnualVariance, statistics.AnnualVariance);\n            Assert.AreEqual(expectedAnnualStandardDeviation, statistics.AnnualStandardDeviation);\n            Assert.AreEqual(expectedSharpeRatio, statistics.SharpeRatio);\n            Assert.AreEqual(expectedTrackingError, statistics.TrackingError);\n            Assert.AreEqual(expectedProbabilisticSharpeRatio, statistics.ProbabilisticSharpeRatio);\n        }\n\n        [Test]\n        public void VaRMatchesExternalData()\n        {\n            var externalFileName = \"spy_valueatrisk.csv\";\n            var data = TestHelper.GetCsvFileStream(externalFileName);\n            var listPerformance = new List<double>();\n\n            var iteration = 0;\n            foreach (var row in data)\n            {\n                if (iteration == 0)\n                {\n                    iteration++;\n                    continue;\n                }\n\n                Parse.TryParse(row[\"returns\"], NumberStyles.Float, out double returns);\n                listPerformance.Add(returns);\n\n                Parse.TryParse(row[\"VaR_99\"], NumberStyles.Float, out decimal expected99);\n                Parse.TryParse(row[\"VaR_95\"], NumberStyles.Float, out decimal expected95);\n\n                var statistics = GetPortfolioStatistics(\n                    true,\n                    _tradingDaysPerYear,\n                    listPerformance,\n                    new List<double> { 0, 0 });\n\n                Assert.AreEqual(Math.Round(expected99, 3), statistics.ValueAtRisk99);\n                Assert.AreEqual(Math.Round(expected95, 3), statistics.ValueAtRisk95);\n            }\n        }\n\n        [Test]\n        public void VaRIsZeroIfLessThan2Samples()\n        {\n            var listPerformance = new List<double> { 0.006196177273682046 };\n\n            var statistics = GetPortfolioStatistics(\n                    true,\n                    _tradingDaysPerYear,\n                    listPerformance,\n                    new List<double> { 0, 0 });\n\n            Assert.Zero(statistics.ValueAtRisk99);\n            Assert.Zero(statistics.ValueAtRisk95);\n        }\n\n        [Test]\n        public void PortfolioStatisticsDoesNotFailWhenAnnualPerformanceIsLarge()\n        {\n            var profitLoss = new SortedDictionary<DateTime, decimal>();\n            var equity = new SortedDictionary<DateTime, decimal>();\n            var portfolioTurnover = new SortedDictionary<DateTime, decimal>();\n            var listPerformance = new List<double>() { 0.6281421, 2.3815, -0.620932, 0.2795571 };\n            var listBenchmark = new List<double>() { -0.0015610669230773247, -0.024440492469623223, 0.008600225248460628, -0.020019532547249266 };\n            var startingCapital = 100000;\n            var riskFreeInterestRateModel = new InterestRateProvider();\n            var tradingDaysPerYear = 252;\n\n            Assert.DoesNotThrow(() => new PortfolioStatistics(profitLoss, equity, portfolioTurnover, listPerformance, listBenchmark, startingCapital, riskFreeInterestRateModel, tradingDaysPerYear));\n        }\n\n        /// <summary>\n        /// Initialize and return Portfolio Statistics depends on input data\n        /// </summary>\n        /// <param name=\"win\">create profitable trade or not</param>\n        /// <param name=\"tradingDaysPerYear\">amount days per year for brokerage (e.g. crypto exchange use 365 days)</param>\n        /// <param name=\"listPerformance\">The list of algorithm performance values</param>\n        /// <param name=\"listBenchmark\">The list of benchmark values</param>\n        /// <returns>The <see cref=\"PortfolioStatistics\"/> class represents a set of statistics calculated from equity and benchmark samples</returns>\n        private PortfolioStatistics GetPortfolioStatistics(bool win, int tradingDaysPerYear, List<double> listPerformance, List<double> listBenchmark)\n        {\n            var trades = CreateITMOptionAssignment(win);\n            var profitLoss = new SortedDictionary<DateTime, decimal>(trades.ToDictionary(x => x.ExitTime, x => x.ProfitLoss));\n            var winCount = trades.Count(x => x.IsWin);\n            var lossCount = trades.Count - winCount;\n            return new PortfolioStatistics(profitLoss, new SortedDictionary<DateTime, decimal>(),\n                new SortedDictionary<DateTime, decimal>(), listPerformance, listBenchmark, 100000,\n                new InterestRateProvider(), tradingDaysPerYear, winCount, lossCount);\n        }\n\n        private List<Trade> CreateITMOptionAssignment(bool win)\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols = [Symbols.SPY_C_192_Feb19_2016],\n                    EntryTime = time,\n                    EntryPrice = 80m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 10,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 0m,\n                    ProfitLoss = -8000m,\n                    TotalFees = TradeFee,\n                    MAE = -8000m,\n                    MFE = 0,\n                    IsWin = win\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.SPY],\n                    EntryTime = time.AddMinutes(20),\n                    EntryPrice = 192m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(30),\n                    ExitPrice = 300m,\n                    ProfitLoss = 10800m,\n                    TotalFees = TradeFee,\n                    MAE = 0,\n                    MFE = 10800m,\n                    IsWin = true\n                },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/ProbabilisticSharpeRatioTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class ProbabilisticSharpeRatioTests\n    {\n        [Test]\n        public void SameAsBenchmark()\n        {\n            var performance = new List<double> { 0.01, 0.02, 0.01, 0, 0, 3 };\n            var benchmark = new List<double> { 0.01, 0.02, 0.01, 0, 0, 3 };\n\n            var benchmarkSharpeRatio = QuantConnect.Statistics.Statistics.ObservedSharpeRatio(benchmark);\n\n            var result = QuantConnect.Statistics.Statistics.ProbabilisticSharpeRatio(performance,\n                benchmarkSharpeRatio);\n\n            // they zero each other out\n            Assert.AreEqual(0.5d, result, 0.001);\n        }\n\n        [Test]\n        public void BeatBenchmark()\n        {\n            var performance = new List<double> { 0.01, 0.02, 0.01, 0, 0,3 };\n            var benchmark = new List<double> { 0, 0, 0, -0.1, 0, 0.01, 0 };\n\n            var benchmarkSharpeRatio = QuantConnect.Statistics.Statistics.ObservedSharpeRatio(benchmark);\n\n            var result = QuantConnect.Statistics.Statistics.ProbabilisticSharpeRatio(performance,\n                benchmarkSharpeRatio);\n\n            Assert.AreEqual(1d, result, 0.001);\n        }\n\n        [Test]\n        public void LoseAgainstBenchmark()\n        {\n            var benchmark = new List<double> { 0.01, 0.02, 0.01, 0, 0, 3 };\n            var performance = new List<double> { 0, 0, 0, -0.1, 0, 0.01, 0 };\n\n            var benchmarkSharpeRatio = QuantConnect.Statistics.Statistics.ObservedSharpeRatio(benchmark);\n\n            var result = QuantConnect.Statistics.Statistics.ProbabilisticSharpeRatio(performance,\n                benchmarkSharpeRatio);\n\n            Assert.AreEqual(0d, result, 0.001);\n        }\n\n        [Test]\n        public void ZeroValues()\n        {\n            var benchmark = new List<double> { 0, 0, 0 };\n            var performance = new List<double> { 0, 0, 0 };\n\n            var benchmarkSharpeRatio = QuantConnect.Statistics.Statistics.ObservedSharpeRatio(benchmark);\n\n            var result = QuantConnect.Statistics.Statistics.ProbabilisticSharpeRatio(performance,\n                benchmarkSharpeRatio);\n\n            Assert.AreEqual(0d, result, 0.001);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/StatisticsBuilderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class StatisticsBuilderTests\n    {\n        /// <summary>\n        /// TradingDaysPerYear: Use like backward compatibility\n        /// </summary>\n        /// <remarks><see cref=\"Interfaces.IAlgorithmSettings.TradingDaysPerYear\"></remarks>\n        protected const int _tradingDaysPerYear = 252;\n\n        [Test]\n        public void MisalignedValues_ShouldThrow_DuringGeneration()\n        {\n            var testBenchmarkPoints = new List<ChartPoint>\n            {\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 1, 16, 0, 0), DateTimeKind.Utc), 100),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 2, 16, 0, 0), DateTimeKind.Utc), 102),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 3, 16, 0, 0), DateTimeKind.Utc), 110),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 4, 16, 0, 0), DateTimeKind.Utc), 110),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 5, 16, 0, 0), DateTimeKind.Utc), 120),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 6, 16, 0, 0), DateTimeKind.Utc), 130),\n            };\n\n            var testEquityPoints = new List<ChartPoint>\n            {\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2018, 12, 31, 16, 0, 0), DateTimeKind.Utc), 100000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 1, 16, 0, 0), DateTimeKind.Utc), 100000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 2, 16, 0, 0), DateTimeKind.Utc), 102000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 3, 16, 0, 0), DateTimeKind.Utc), 110000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 4, 16, 0, 0), DateTimeKind.Utc), 110000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 5, 16, 0, 0), DateTimeKind.Utc), 120000),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 6, 16, 0, 0), DateTimeKind.Utc), 130000),\n            };\n\n            var misalignedTestPerformancePoints = new List<ChartPoint>\n            {\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2018, 12, 31), DateTimeKind.Utc), 1000m * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 1, 16, 0, 0), DateTimeKind.Utc), 0.25m * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 2, 16, 0, 0), DateTimeKind.Utc), 0.02m * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 3, 16, 0, 0), DateTimeKind.Utc), 0.0784313725490196m * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 4, 16, 0, 0), DateTimeKind.Utc), 0 * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 5, 16, 0, 0), DateTimeKind.Utc), 0.090909090909090m * 100m),\n                new ChartPoint(DateTime.SpecifyKind(new DateTime(2019, 1, 6, 16, 0, 0), DateTimeKind.Utc), 0.083333333333333m * 100m)\n            };\n\n            Assert.Throws<ArgumentException>(() =>\n            {\n                StatisticsBuilder.Generate(\n                    new List<Trade>(),\n                    new SortedDictionary<DateTime, decimal>(),\n                    testEquityPoints.Cast<ISeriesPoint>().ToList(),\n                    misalignedTestPerformancePoints.Cast<ISeriesPoint>().ToList(),\n                    testBenchmarkPoints.Cast<ISeriesPoint>().ToList(),\n                    new List<ISeriesPoint>(),\n                    100000m,\n                    0m,\n                    1,\n                    null,\n                    \"$\",\n                    new QuantConnect.Securities.SecurityTransactionManager(\n                        null,\n                        new QuantConnect.Securities.SecurityManager(new TimeKeeper(DateTime.UtcNow))),\n                    new InterestRateProvider(),\n                    _tradingDaysPerYear);\n            }, \"Misaligned values provided, but we still generate statistics\");\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tests/Common/Statistics/TrackingErrorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Lean.Engine.Setup;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class TrackingErrorTests\n    {\n        private List<TradeBar> _spy = new List<TradeBar>();\n        private List<TradeBar> _aapl = new List<TradeBar>();\n        private List<double> _spyPerformance = new List<double>();\n        private List<double> _aaplPerformance = new List<double>();\n\n        /// <summary>\n        /// Instance of QC Algorithm. \n        /// Use to get <see cref=\"Interfaces.IAlgorithmSettings.TradingDaysPerYear\"/> for clear calculation in <seealso cref=\"QuantConnect.Statistics.Statistics.AnnualPerformance\"/>\n        /// </summary>\n        private QCAlgorithm _algorithm;\n\n        [OneTimeSetUp]\n        public void GetData()\n        {\n            _algorithm = new QCAlgorithm();\n            BaseSetupHandler.SetBrokerageTradingDayPerYear(_algorithm);\n\n            var spy = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var spyPath = LeanData.GenerateZipFilePath(Globals.DataFolder, spy, new DateTime(2020, 3, 1), Resolution.Daily, TickType.Trade);\n            var spyConfig = new QuantConnect.Data.SubscriptionDataConfig(typeof(TradeBar), spy, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            var endDate = new DateTime(2020, 3, 8);\n\n            foreach (var line in QuantConnect.Compression.ReadLines(spyPath))\n            {\n                var bar = TradeBar.ParseEquity(spyConfig, line, DateTime.Now.Date);\n                if (bar.EndTime < endDate)\n                {\n                    _spy.Add(bar);\n                }\n            }\n\n            for (var i = 1; i < _spy.Count; i++)\n            {\n                _spyPerformance.Add((double)((_spy[i].Close / _spy[i - 1].Close) - 1));\n            }\n\n            var aapl = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var aaplPath = LeanData.GenerateZipFilePath(Globals.DataFolder, aapl, new DateTime(2020, 3, 1), Resolution.Daily, TickType.Trade);\n            var aaplConfig = new QuantConnect.Data.SubscriptionDataConfig(typeof(TradeBar), aapl, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n\n            foreach (var line in QuantConnect.Compression.ReadLines(aaplPath))\n            {\n                var bar = TradeBar.ParseEquity(aaplConfig, line, DateTime.Now.Date);\n                if (bar.EndTime < endDate)\n                {\n                    _aapl.Add(bar);\n                }\n            }\n\n            for (var i = 1; i < _aapl.Count; i++)\n            {\n                _aaplPerformance.Add((double)((_aapl[i].Close / _aapl[i - 1].Close) - 1));\n            }\n        }\n\n        [OneTimeTearDown]\n        public void Delete()\n        {\n            _spy.Clear();\n            _aapl.Clear();\n            _spyPerformance.Clear();\n            _aaplPerformance.Clear();\n        }\n\n        [Test]\n        public void OneYearPerformance()\n        {\n            var result = QuantConnect.Statistics.Statistics.TrackingError(_aaplPerformance.Take(252).ToList(), _spyPerformance.Take(252).ToList(), _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.52780899407691173, result);\n        }\n\n        [Test]\n        public void TotalPerformance()\n        {\n            // This might seem arbitrary, but there's 1 missing date vs. AAPL for SPY data, and it happens to be at line 5555 for date 2020-01-31\n            var result = QuantConnect.Statistics.Statistics.TrackingError(_aaplPerformance.Take(5555).ToList(), _spyPerformance.Take(5555).ToList(), _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.43074391577621751d, result, 0.00001);\n        }\n\n        [Test]\n        public void IdenticalPerformance()\n        {\n            var random = new Random();\n\n            var benchmarkPerformance = Enumerable.Repeat(random.NextDouble(), 252).ToList();\n            var algoPerformance = benchmarkPerformance.Select(element => element).ToList();\n\n            var result = QuantConnect.Statistics.Statistics.TrackingError(algoPerformance, benchmarkPerformance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.0, result);\n        }\n\n        [Test]\n        public void DifferentPerformance()\n        {\n            var benchmarkPerformance = new List<double>();\n            var algoPerformance = new List<double>();\n\n            // Gives us two sequences whose difference is always -175\n            // This sequence will have variance 0\n            var baseReturn = -176;\n            for (var i = 1; i <= 252; i++)\n            {\n                benchmarkPerformance.Add(baseReturn + 1);\n                algoPerformance.Add((baseReturn * 2) + 2);\n            }\n\n            var result = QuantConnect.Statistics.Statistics.TrackingError(algoPerformance, benchmarkPerformance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.0, result);\n        }\n\n        [Test]\n        public void AllZeros()\n        {\n            var benchmarkPerformance = Enumerable.Repeat(0.0, 252).ToList();\n            var algoPerformance = Enumerable.Repeat(0.0, 252).ToList();\n\n            var result = QuantConnect.Statistics.Statistics.TrackingError(algoPerformance, benchmarkPerformance, _algorithm.Settings.TradingDaysPerYear.Value);\n\n            Assert.AreEqual(0.0, result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/TradeBuilderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class TradeBuilderTests\n    {\n        private readonly OrderFee _orderFee = new OrderFee(new CashAmount(1, Currencies.USD));\n        private const decimal ConversionRate = 1;\n        private readonly DateTime _startTime = new DateTime(2015, 08, 06, 15, 30, 0);\n        private SecurityManager _securityManager;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _securityManager = new SecurityManager(new TimeKeeper(_startTime));\n        }\n\n        [Test]\n        public void AllInAllOutLong(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Sell 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(Symbols.SPY, trade.Symbol);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade.EntryPrice);\n            Assert.AreEqual(TradeDirection.Long, trade.Direction);\n            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n            Assert.AreEqual(10, trade.ProfitLoss);\n            Assert.AreEqual(2, trade.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-5, trade.MAE);\n                Assert.AreEqual(20m, trade.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [Test]\n        public void AllInAllOutShort(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Buy 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(Symbols.SPY, trade.Symbol);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade.EntryPrice);\n            Assert.AreEqual(TradeDirection.Short, trade.Direction);\n            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n            Assert.AreEqual(-10, trade.ProfitLoss);\n            Assert.AreEqual(2, trade.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-20, trade.MAE);\n                Assert.AreEqual(5, trade.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [Test]\n        public void ScaleInAllOutLong(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Buy 1k, Sell 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 2k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                var trade1 = builder.ClosedTrades[matchingMethod == FillMatchingMethod.FIFO ? 0 : 1];\n\n                Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                Assert.AreEqual(time, trade1.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade1.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                Assert.AreEqual(10, trade1.ProfitLoss);\n                Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 2 : 1, trade1.TotalFees);\n                Assert.AreEqual(-15, trade1.MAE);\n                Assert.AreEqual(20, trade1.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 3 }, trade1.OrderIds);\n\n                var trade2 = builder.ClosedTrades[matchingMethod == FillMatchingMethod.FIFO ? 1 : 0];\n\n                Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade2.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                Assert.AreEqual(20, trade2.ProfitLoss);\n                Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 1 : 2, trade2.TotalFees);\n                Assert.AreEqual(-5, trade2.MAE);\n                Assert.AreEqual(30, trade2.MFE);\n\n                CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade2.OrderIds);\n            }\n            else\n            {\n                Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                var trade = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                Assert.AreEqual(time, trade.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.075m, split), trade.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                Assert.AreEqual(30, trade.ProfitLoss);\n                Assert.AreEqual(3, trade.TotalFees);\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, trade.OrderIds);\n            }\n        }\n\n        [Test]\n        public void ScaleInAllOutShort(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Sell 1k, Buy 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                var trade1 = builder.ClosedTrades[matchingMethod == FillMatchingMethod.FIFO ? 0 : 1];\n\n                Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                Assert.AreEqual(time, trade1.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade1.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                Assert.AreEqual(-10, trade1.ProfitLoss);\n                Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 2 : 1, trade1.TotalFees);\n                Assert.AreEqual(-20, trade1.MAE);\n                Assert.AreEqual(15, trade1.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 3 }, trade1.OrderIds);\n\n                var trade2 = builder.ClosedTrades[matchingMethod == FillMatchingMethod.FIFO ? 1 : 0];\n\n                Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade2.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                Assert.AreEqual(-20, trade2.ProfitLoss);\n                Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 1 : 2, trade2.TotalFees);\n                Assert.AreEqual(-30, trade2.MAE);\n                Assert.AreEqual(5, trade2.MFE);\n                CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade2.OrderIds);\n            }\n            else\n            {\n                Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                var trade = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                Assert.AreEqual(time, trade.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.075m, split), trade.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                Assert.AreEqual(-30, trade.ProfitLoss);\n                Assert.AreEqual(3, trade.TotalFees);\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, trade.OrderIds);\n            }\n        }\n\n        [Test]\n        public void AllInScaleOutLong(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 2k, Sell 1k, Sell 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: 2000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            if (groupingMethod == FillGroupingMethod.FlatToFlat)\n            {\n                Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                var trade = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                Assert.AreEqual(time, trade.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.085m, split), trade.ExitPrice);\n                Assert.AreEqual(30, trade.ProfitLoss);\n                Assert.AreEqual(3, trade.TotalFees);\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, trade.OrderIds);\n            }\n            else\n            {\n                Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                // This first trade was closed before the split\n                var trade1 = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                Assert.AreEqual(time, trade1.EntryTime);\n                Assert.AreEqual(1.07m, trade1.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                Assert.AreEqual(1000, trade1.Quantity);\n                Assert.AreEqual(time.AddMinutes(10), trade1.ExitTime);\n                Assert.AreEqual(1.08m, trade1.ExitPrice);\n                Assert.AreEqual(10, trade1.ProfitLoss);\n                Assert.AreEqual(2, trade1.TotalFees);\n                if (groupingMethod == FillGroupingMethod.FillToFill)\n                {\n                    Assert.AreEqual(0, trade1.MAE);\n                    Assert.AreEqual(10, trade1.MFE);\n                }\n                else\n                {\n                    Assert.AreEqual(0, trade1.MAE);\n                    Assert.AreEqual(0, trade1.MFE);\n                }\n                CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade1.OrderIds);\n\n                var trade2 = builder.ClosedTrades[1];\n\n                Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                Assert.AreEqual(time, trade2.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade2.EntryPrice);\n                Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                Assert.AreEqual(20, trade2.ProfitLoss);\n                Assert.AreEqual(1, trade2.TotalFees);\n                if (groupingMethod == FillGroupingMethod.FillToFill)\n                {\n                    Assert.AreEqual(-5, trade2.MAE);\n                    Assert.AreEqual(30, trade2.MFE);\n                }\n                else\n                {\n                    Assert.AreEqual(0, trade2.MAE);\n                    Assert.AreEqual(0, trade2.MFE);\n                }\n                CollectionAssert.AreEquivalent(groupingMethod == FillGroupingMethod.FlatToReduced ? [1, 3] : new[] { 1, 3 }, trade2.OrderIds);\n            }\n        }\n\n        [Test]\n        public void AllInScaleOutShort(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 2k, Buy 1k, Buy 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 2k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -2000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            if (groupingMethod == FillGroupingMethod.FlatToFlat)\n            {\n                Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                var trade = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                Assert.AreEqual(time, trade.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.085m, split), trade.ExitPrice);\n                Assert.AreEqual(-30, trade.ProfitLoss);\n                Assert.AreEqual(3, trade.TotalFees);\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n                CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, trade.OrderIds);\n            }\n            else\n            {\n                Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                // This first trade was closed before the split\n                var trade1 = builder.ClosedTrades[0];\n\n                Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                Assert.AreEqual(time, trade1.EntryTime);\n                Assert.AreEqual(1.07m, trade1.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                Assert.AreEqual(1000, trade1.Quantity);\n                Assert.AreEqual(time.AddMinutes(10), trade1.ExitTime);\n                Assert.AreEqual(1.08m, trade1.ExitPrice);\n                Assert.AreEqual(-10, trade1.ProfitLoss);\n                Assert.AreEqual(2, trade1.TotalFees);\n                if (groupingMethod == FillGroupingMethod.FillToFill)\n                {\n                    Assert.AreEqual(-10, trade1.MAE);\n                    Assert.AreEqual(0, trade1.MFE);\n                }\n                else\n                {\n                    Assert.AreEqual(0, trade1.MAE);\n                    Assert.AreEqual(0, trade1.MFE);\n                }\n                CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade1.OrderIds);\n\n                var trade2 = builder.ClosedTrades[1];\n\n                Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                Assert.AreEqual(time, trade2.EntryTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade2.EntryPrice);\n                Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                Assert.AreEqual(-20, trade2.ProfitLoss);\n                Assert.AreEqual(1, trade2.TotalFees);\n                if (groupingMethod == FillGroupingMethod.FillToFill)\n                {\n                    Assert.AreEqual(-30, trade2.MAE);\n                    Assert.AreEqual(5, trade2.MFE);\n                }\n                else\n                {\n                    Assert.AreEqual(0, trade2.MAE);\n                    Assert.AreEqual(0, trade2.MFE);\n                }\n                CollectionAssert.AreEquivalent(new[] { 1, 3 }, trade2.OrderIds);\n            }\n        }\n\n        [Test]\n        public void ReversalLongToShort(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Sell 2k, Buy 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 2k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -2000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n            // This first trade was closed before the split\n            var trade1 = builder.ClosedTrades[0];\n\n            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n            Assert.AreEqual(time, trade1.EntryTime);\n            Assert.AreEqual(1.07m, trade1.EntryPrice);\n            Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n            Assert.AreEqual(1000, trade1.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade1.ExitTime);\n            Assert.AreEqual(1.08m, trade1.ExitPrice);\n            Assert.AreEqual(10, trade1.ProfitLoss);\n            Assert.AreEqual(2, trade1.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(0, trade1.MAE);\n                Assert.AreEqual(10, trade1.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade1.MAE);\n                Assert.AreEqual(0, trade1.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade1.OrderIds);\n\n            var trade2 = builder.ClosedTrades[1];\n\n            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n            Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n            Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n            Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n            Assert.AreEqual(-10, trade2.ProfitLoss);\n            Assert.AreEqual(1, trade2.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-20, trade2.MAE);\n                Assert.AreEqual(15, trade2.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade2.MAE);\n                Assert.AreEqual(0, trade2.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade2.OrderIds);\n        }\n\n        [Test]\n        public void ReversalShortToLong(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Buy 2k, Sell 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 2000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n            // This first trade was closed before the split\n            var trade1 = builder.ClosedTrades[0];\n\n            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n            Assert.AreEqual(time, trade1.EntryTime);\n            Assert.AreEqual(1.07m, trade1.EntryPrice);\n            Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n            Assert.AreEqual(1000, trade1.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade1.ExitTime);\n            Assert.AreEqual(1.08m, trade1.ExitPrice);\n            Assert.AreEqual(-10, trade1.ProfitLoss);\n            Assert.AreEqual(2, trade1.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-10, trade1.MAE);\n                Assert.AreEqual(0, trade1.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade1.MAE);\n                Assert.AreEqual(0, trade1.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade1.OrderIds);\n\n            var trade2 = builder.ClosedTrades[1];\n\n            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n            Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n            Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n            Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n            Assert.AreEqual(10, trade2.ProfitLoss);\n            Assert.AreEqual(1, trade2.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-15, trade2.MAE);\n                Assert.AreEqual(20, trade2.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade2.MAE);\n                Assert.AreEqual(0, trade2.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade2.OrderIds);\n        }\n\n        [Test]\n        public void ScaleInScaleOut1Long(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Buy 1k, Sell 1k, Buy 1k, Sell 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 2k\n            builder.ProcessFill(\n                new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10),\n                            trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -5 : -15, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 30 : 20, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time.AddMinutes(30),\n                            trade2.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(10, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(-15, trade2.MAE);\n                        Assert.AreEqual(20, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 5] : new[] { 4, 5 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(30) : time,\n                            trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 20, trade3.ProfitLoss);\n                        Assert.AreEqual(1, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -15 : -5, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 30, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [4, 5] : new[] { 1, 5 }, trade3.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.Less(\n                            Math.Abs(AdjustPriceToSplit(1.0766666666666666666666666667m, split) - trade.EntryPrice),\n                            1e-27m);\n                        Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(3000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                        Assert.AreEqual(40, trade.ProfitLoss);\n                        Assert.AreEqual(5, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10),\n                            trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 10, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 1] : new[] { 3, 2 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time,\n                            trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.075m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 30, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4, 5] : new[] { 1, 4, 5 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut1Short(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Sell 1k, Buy 1k, Sell 1k, Buy 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10),\n                            trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -30 : -20, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 5 : 15, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time.AddMinutes(30), trade2.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(-10, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(-20, trade2.MAE);\n                        Assert.AreEqual(15, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 5] : new[] { 4, 5 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(30) : time, trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -20, trade3.ProfitLoss);\n                        Assert.AreEqual(1, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -30, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 15 : 5, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [4, 5] : new[] { 1, 5 }, trade3.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.Less(\n                            Math.Abs(AdjustPriceToSplit(1.0766666666666666666666666667m, split) - trade.EntryPrice),\n                            1e-27m);\n                        Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(3000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                        Assert.AreEqual(-40, trade.ProfitLoss);\n                        Assert.AreEqual(5, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -10, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.075m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -30, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4, 5] : new[] { 1, 4, 5 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut2Long(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Buy 2k, Sell 1k, Buy 1k, Sell 3k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy, fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 2k\n            builder.ProcessFill(new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy, fillPrice: 1.08m, fillQuantity: 2000, orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell, fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Buy, fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 3k\n            builder.ProcessFill(new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Sell, fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-3000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        if (matchingMethod == FillMatchingMethod.FIFO)\n                        {\n                            Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                            var trade1 = builder.ClosedTrades[0];\n\n                            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                            Assert.AreEqual(time, trade1.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade1.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                            Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                            Assert.AreEqual(20, trade1.ProfitLoss);\n                            Assert.AreEqual(2, trade1.TotalFees);\n                            Assert.AreEqual(-5, trade1.MAE);\n                            Assert.AreEqual(30, trade1.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 1, 3 }, trade1.OrderIds);\n\n                            var trade2 = builder.ClosedTrades[1];\n\n                            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                            Assert.AreEqual(20, trade2.ProfitLoss);\n                            Assert.AreEqual(2, trade2.TotalFees);\n                            Assert.AreEqual(-30, trade2.MAE);\n                            Assert.AreEqual(40, trade2.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 5 }, trade2.OrderIds);\n\n                            var trade3 = builder.ClosedTrades[2];\n\n                            Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                            Assert.AreEqual(time.AddMinutes(30), trade3.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade3.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade3.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                            Assert.AreEqual(10, trade3.ProfitLoss);\n                            Assert.AreEqual(1, trade3.TotalFees);\n                            Assert.AreEqual(-15, trade3.MAE);\n                            Assert.AreEqual(20, trade3.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 4, 5 }, trade3.OrderIds);\n                        }\n                        else\n                        {\n                            Assert.AreEqual(4, builder.ClosedTrades.Count);\n\n                            var trade1 = builder.ClosedTrades[0];\n\n                            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade1.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade1.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                            Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                            Assert.AreEqual(10, trade1.ProfitLoss);\n                            Assert.AreEqual(2, trade1.TotalFees);\n                            Assert.AreEqual(-15, trade1.MAE);\n                            Assert.AreEqual(20, trade1.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade1.OrderIds);\n\n                            var trade2 = builder.ClosedTrades[1];\n\n                            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                            Assert.AreEqual(time.AddMinutes(30), trade2.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                            Assert.AreEqual(10, trade2.ProfitLoss);\n                            Assert.AreEqual(2, trade2.TotalFees);\n                            Assert.AreEqual(-15, trade2.MAE);\n                            Assert.AreEqual(20, trade2.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 4, 5 }, trade2.OrderIds);\n\n                            var trade3 = builder.ClosedTrades[2];\n\n                            Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade3.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade3.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade3.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                            Assert.AreEqual(10, trade3.ProfitLoss);\n                            Assert.AreEqual(0, trade3.TotalFees);\n                            Assert.AreEqual(-15, trade3.MAE);\n                            Assert.AreEqual(20, trade3.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 5 }, trade3.OrderIds);\n\n                            var trade4 = builder.ClosedTrades[3];\n\n                            Assert.AreEqual(Symbols.SPY, trade4.Symbol);\n                            Assert.AreEqual(time, trade4.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade4.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Long, trade4.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade4.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade4.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade4.ExitPrice);\n                            Assert.AreEqual(20, trade4.ProfitLoss);\n                            Assert.AreEqual(1, trade4.TotalFees);\n                            Assert.AreEqual(-5, trade4.MAE);\n                            Assert.AreEqual(30, trade4.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 1, 5 }, trade4.OrderIds);\n                        }\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.0775m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(4000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                        Assert.AreEqual(50, trade.ProfitLoss);\n                        Assert.AreEqual(5, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 10, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        if (matchingMethod == FillMatchingMethod.FIFO)\n                        {\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        }\n                        else\n                        {\n                            Assert.Less(\n                                Math.Abs(AdjustPriceToSplit(1.0766666666666666666666666667m, split) - trade2.EntryPrice),\n                                1e-27m);\n                        }\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(3000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 30 : 40, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4, 5] : new[] { 1, 2, 4, 5 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut2Short(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Sell 2k, Buy 1k, Sell 1k, Buy 3k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 2k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -2000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 3k\n            builder.ProcessFill(\n                new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(3000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        if (matchingMethod == FillMatchingMethod.FIFO)\n                        {\n                            Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                            var trade1 = builder.ClosedTrades[0];\n\n                            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                            Assert.AreEqual(time, trade1.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade1.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                            Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                            Assert.AreEqual(-20, trade1.ProfitLoss);\n                            Assert.AreEqual(2, trade1.TotalFees);\n                            Assert.AreEqual(-30, trade1.MAE);\n                            Assert.AreEqual(5, trade1.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 1, 3 }, trade1.OrderIds);\n\n                            var trade2 = builder.ClosedTrades[1];\n\n                            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                            Assert.AreEqual(-20, trade2.ProfitLoss);\n                            Assert.AreEqual(2, trade2.TotalFees);\n                            Assert.AreEqual(-40, trade2.MAE);\n                            Assert.AreEqual(30, trade2.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 5 }, trade2.OrderIds);\n\n                            var trade3 = builder.ClosedTrades[2];\n\n                            Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                            Assert.AreEqual(time.AddMinutes(30), trade3.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade3.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade3.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                            Assert.AreEqual(-10, trade3.ProfitLoss);\n                            Assert.AreEqual(1, trade3.TotalFees);\n                            Assert.AreEqual(-20, trade3.MAE);\n                            Assert.AreEqual(15, trade3.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 4, 5 }, trade3.OrderIds);\n                        }\n                        else\n                        {\n                            Assert.AreEqual(4, builder.ClosedTrades.Count);\n\n                            var trade1 = builder.ClosedTrades[0];\n\n                            Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade1.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade1.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                            Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                            Assert.AreEqual(-10, trade1.ProfitLoss);\n                            Assert.AreEqual(2, trade1.TotalFees);\n                            Assert.AreEqual(-20, trade1.MAE);\n                            Assert.AreEqual(15, trade1.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 3 }, trade1.OrderIds);\n\n                            var trade2 = builder.ClosedTrades[1];\n\n                            Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                            Assert.AreEqual(time.AddMinutes(30), trade2.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                            Assert.AreEqual(-10, trade2.ProfitLoss);\n                            Assert.AreEqual(2, trade2.TotalFees);\n                            Assert.AreEqual(-20, trade2.MAE);\n                            Assert.AreEqual(15, trade2.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 4, 5 }, trade2.OrderIds);\n\n                            var trade3 = builder.ClosedTrades[2];\n\n                            Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                            Assert.AreEqual(time.AddMinutes(10), trade3.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade3.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade3.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade3.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                            Assert.AreEqual(-10, trade3.ProfitLoss);\n                            Assert.AreEqual(0, trade3.TotalFees);\n                            Assert.AreEqual(-20, trade3.MAE);\n                            Assert.AreEqual(15, trade3.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 2, 5 }, trade3.OrderIds);\n\n                            var trade4 = builder.ClosedTrades[3];\n\n                            Assert.AreEqual(Symbols.SPY, trade4.Symbol);\n                            Assert.AreEqual(time, trade4.EntryTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.07m, split), trade4.EntryPrice);\n                            Assert.AreEqual(TradeDirection.Short, trade4.Direction);\n                            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade4.Quantity);\n                            Assert.AreEqual(time.AddMinutes(40), trade4.ExitTime);\n                            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade4.ExitPrice);\n                            Assert.AreEqual(-20, trade4.ProfitLoss);\n                            Assert.AreEqual(1, trade4.TotalFees);\n                            Assert.AreEqual(-30, trade4.MAE);\n                            Assert.AreEqual(5, trade4.MFE);\n                            CollectionAssert.AreEquivalent(new[] { 1, 5 }, trade4.OrderIds);\n                        }\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.0775m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(4000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n                        Assert.AreEqual(-50, trade.ProfitLoss);\n                        Assert.AreEqual(5, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -10, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 1] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        if (matchingMethod == FillMatchingMethod.FIFO)\n                        {\n                            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        }\n                        else\n                        {\n                            Assert.Less(\n                                Math.Abs(AdjustPriceToSplit(1.0766666666666666666666666667m, split) - trade2.EntryPrice),\n                                1e-27m);\n                        }\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(3000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(40), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -30 : -40, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4, 5] : new[] { 1, 2, 4, 5 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut3Long(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Buy 1k, Buy 1k, Sell 2k, Buy 1k, Sell 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy, fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy, fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy, fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 2k\n            builder.ProcessFill(new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Sell, fillPrice: AdjustPriceToSplit(1.10m, split), fillQuantity: AdjustQuantityToSplit(-2000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 1k\n            builder.ProcessFill(new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Buy, fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(1000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 2k\n            builder.ProcessFill(new OrderEvent(6, Symbols.SPY, time.AddMinutes(50), OrderStatus.Filled, OrderDirection.Sell, fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-2000, split), orderFee: _orderFee), ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(4, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(20), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.09m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 30 : 10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -5 : -25, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 30 : 10, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 4] : new[] { 3, 4 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade2.ExitPrice);\n                        Assert.AreEqual(20, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(-15, trade2.MAE);\n                        Assert.AreEqual(20, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 2, 4 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(20) : time.AddMinutes(40), trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.09m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 0 : 10, trade3.ProfitLoss);\n                        Assert.AreEqual(2, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -25 : -15, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 20, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 6] : new[] { 5, 6 }, trade3.OrderIds);\n\n                        var trade4 = builder.ClosedTrades[3];\n\n                        Assert.AreEqual(Symbols.SPY, trade4.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(40) : time, trade4.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade4.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade4.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade4.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade4.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade4.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 20, trade4.ProfitLoss);\n                        Assert.AreEqual(1, trade4.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -15 : -5, trade4.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 30, trade4.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [5, 6] : new[] { 1, 6 }, trade4.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(4000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.095m, split), trade.ExitPrice);\n                        Assert.AreEqual(60, trade.ProfitLoss);\n                        Assert.AreEqual(6, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5, 6 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.075m, split)\n                                : AdjustPriceToSplit(1.085m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 50 : 30, trade1.ProfitLoss);\n                        Assert.AreEqual(4, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 2, 4] : new[] { 2, 3, 4 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(20) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.085m, split)\n                                : AdjustPriceToSplit(1.075m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 30, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 5, 6] : new[] { 1, 5, 6 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut3Short(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Sell 1k, Sell 1k, Buy 2k, Sell 1k, Buy 2k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.10m, split), fillQuantity: AdjustQuantityToSplit(2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(5, Symbols.SPY, time.AddMinutes(40), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.08m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 2k\n            builder.ProcessFill(\n                new OrderEvent(6, Symbols.SPY, time.AddMinutes(50), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(2000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(4, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(20), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.09m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -30 : -10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -30 : -10, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 5 : 25, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 4] : new[] { 3, 4 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(time.AddMinutes(10), trade2.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade2.ExitPrice);\n                        Assert.AreEqual(-20, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(-20, trade2.MAE);\n                        Assert.AreEqual(15, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 2, 4 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(20) : time.AddMinutes(40), trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.09m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 0 : -10, trade3.ProfitLoss);\n                        Assert.AreEqual(2, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -20, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 25 : 15, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 6] : new[] { 5, 6 }, trade3.OrderIds);\n\n                        var trade4 = builder.ClosedTrades[3];\n\n                        Assert.AreEqual(Symbols.SPY, trade4.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(40) : time, trade4.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade4.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade4.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade4.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade4.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade4.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -20, trade4.ProfitLoss);\n                        Assert.AreEqual(1, trade4.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -30, trade4.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 15 : 5, trade4.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [5, 6] : new[] { 1, 6 }, trade4.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(4000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.095m, split), trade.ExitPrice);\n                        Assert.AreEqual(-60, trade.ProfitLoss);\n                        Assert.AreEqual(6, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4, 5, 6 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.075m, split)\n                                : AdjustPriceToSplit(1.085m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -50 : -30, trade1.ProfitLoss);\n                        Assert.AreEqual(4, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 2, 4] : new[] { 2, 3, 4 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(20) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.085m, split)\n                                : AdjustPriceToSplit(1.075m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(50), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -30, trade2.ProfitLoss);\n                        Assert.AreEqual(2, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [3, 5, 6] : new[] { 1, 5, 6 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut4Long(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Buy 1k, Buy 1k, Sell 1.5k, Sell 0.5k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1.5k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1500, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Sell 0.5k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.10m, split), fillQuantity: AdjustQuantityToSplit(-500, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 20 : 10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -5 : -15, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 30 : 20, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 5 : 10, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -7.5 : -2.5, trade2.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 15, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 3] : new[] { 1, 3 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 15, trade3.ProfitLoss);\n                        Assert.AreEqual(1, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -7.5 : -2.5, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 15, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 1, 4 }, trade3.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.075m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.0925m, split), trade.ExitPrice);\n                        Assert.AreEqual(35, trade.ProfitLoss);\n                        Assert.AreEqual(4, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.Less(\n                            Math.Abs(AdjustPriceToSplit(matchingMethod == FillMatchingMethod.FIFO ? 1.0733333333333333333333333333m : 1.0766666666666666666666666667m, split) - trade1.EntryPrice),\n                            1e-27m);\n                        Assert.AreEqual(TradeDirection.Long, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1500, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 25 : 20, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 2, 3] : new[] { 1, 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Long, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 10 : 15, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 1, 4 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void ScaleInScaleOut4Short(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            // Sell 1k, Sell 1k, Buy 1.5k, Buy 0.5k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.07m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: -1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.065m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Buy 1.5k\n            builder.ProcessFill(\n                new OrderEvent(3, Symbols.SPY, time.AddMinutes(20), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(1500, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            // Buy 0.5k\n            builder.ProcessFill(\n                new OrderEvent(4, Symbols.SPY, time.AddMinutes(30), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.10m, split), fillQuantity: AdjustQuantityToSplit(500, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            switch (groupingMethod)\n            {\n                case FillGroupingMethod.FillToFill:\n                    {\n                        Assert.AreEqual(3, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.07m, split)\n                                : AdjustPriceToSplit(1.08m, split),\n                            trade1.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -20 : -10, trade1.ProfitLoss);\n                        Assert.AreEqual(2, trade1.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -30 : -20, trade1.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 5 : 15, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 3] : new[] { 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -5 : -10, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -15, trade2.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 7.5 : 2.5, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 3] : new[] { 1, 3 }, trade2.OrderIds);\n\n                        var trade3 = builder.ClosedTrades[2];\n\n                        Assert.AreEqual(Symbols.SPY, trade3.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade3.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade3.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade3.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade3.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade3.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade3.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -15, trade3.ProfitLoss);\n                        Assert.AreEqual(1, trade3.TotalFees);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -15, trade3.MAE);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? 7.5 : 2.5, trade3.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 1, 4 }, trade3.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToFlat:\n                    {\n                        Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n                        var trade = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade.Symbol);\n                        Assert.AreEqual(time, trade.EntryTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.075m, split), trade.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(2000, split), trade.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.0925m, split), trade.ExitPrice);\n                        Assert.AreEqual(-35, trade.ProfitLoss);\n                        Assert.AreEqual(4, trade.TotalFees);\n                        Assert.AreEqual(0, trade.MAE);\n                        Assert.AreEqual(0, trade.MFE);\n                        CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4 }, trade.OrderIds);\n                    }\n                    break;\n\n                case FillGroupingMethod.FlatToReduced:\n                    {\n                        Assert.AreEqual(2, builder.ClosedTrades.Count);\n\n                        var trade1 = builder.ClosedTrades[0];\n\n                        Assert.AreEqual(Symbols.SPY, trade1.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time : time.AddMinutes(10), trade1.EntryTime);\n                        Assert.Less(\n                            Math.Abs(AdjustPriceToSplit(matchingMethod == FillMatchingMethod.FIFO ? 1.0733333333333333333333333333m : 1.0766666666666666666666666667m, split) - trade1.EntryPrice),\n                            1e-27m);\n                        Assert.AreEqual(TradeDirection.Short, trade1.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(1500, split), trade1.Quantity);\n                        Assert.AreEqual(time.AddMinutes(20), trade1.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade1.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -25 : -20, trade1.ProfitLoss);\n                        Assert.AreEqual(3, trade1.TotalFees);\n                        Assert.AreEqual(0, trade1.MAE);\n                        Assert.AreEqual(0, trade1.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [1, 2, 3] : new[] { 1, 2, 3 }, trade1.OrderIds);\n\n                        var trade2 = builder.ClosedTrades[1];\n\n                        Assert.AreEqual(Symbols.SPY, trade2.Symbol);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? time.AddMinutes(10) : time, trade2.EntryTime);\n                        Assert.AreEqual(\n                            matchingMethod == FillMatchingMethod.FIFO\n                                ? AdjustPriceToSplit(1.08m, split)\n                                : AdjustPriceToSplit(1.07m, split),\n                            trade2.EntryPrice);\n                        Assert.AreEqual(TradeDirection.Short, trade2.Direction);\n                        Assert.AreEqual(AdjustQuantityToSplit(500, split), trade2.Quantity);\n                        Assert.AreEqual(time.AddMinutes(30), trade2.ExitTime);\n                        Assert.AreEqual(AdjustPriceToSplit(1.10m, split), trade2.ExitPrice);\n                        Assert.AreEqual(matchingMethod == FillMatchingMethod.FIFO ? -10 : -15, trade2.ProfitLoss);\n                        Assert.AreEqual(1, trade2.TotalFees);\n                        Assert.AreEqual(0, trade2.MAE);\n                        Assert.AreEqual(0, trade2.MFE);\n                        CollectionAssert.AreEquivalent(matchingMethod == FillMatchingMethod.FIFO ? [2, 4] : new[] { 1, 4 }, trade2.OrderIds);\n                    }\n                    break;\n            }\n        }\n\n        [Test]\n        public void AllInAllOutLongWithMultiplier(\n            [Values] FillGroupingMethod groupingMethod,\n            [Values] FillMatchingMethod matchingMethod,\n            // 0 for no split\n            [Values(0, 0.5, 0.333)] double splitFactor)\n        {\n            var multiplier = 10;\n\n            // Buy 1k, Sell 1k\n\n            var builder = new TradeBuilder(groupingMethod, matchingMethod);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            // Buy 1k\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, OrderDirection.Buy,\n                    fillPrice: 1.08m, fillQuantity: 1000, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount, multiplier);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            builder.SetMarketPrice(Symbols.SPY, 1.075m);\n            builder.SetMarketPrice(Symbols.SPY, 1.10m);\n\n            Split split = null;\n            if (splitFactor != 0)\n            {\n                // apply a 2:1 split\n                split = new Split(Symbols.SPY, time.AddMinutes(5), 1.10m, (decimal)splitFactor, SplitType.SplitOccurred);\n                builder.ApplySplit(split, false, DataNormalizationMode.Raw);\n            }\n\n            // Sell 1k\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, OrderDirection.Sell,\n                    fillPrice: AdjustPriceToSplit(1.09m, split), fillQuantity: AdjustQuantityToSplit(-1000, split), orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount, multiplier);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(Symbols.SPY, trade.Symbol);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.08m, split), trade.EntryPrice);\n            Assert.AreEqual(TradeDirection.Long, trade.Direction);\n            Assert.AreEqual(AdjustQuantityToSplit(1000, split), trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(AdjustPriceToSplit(1.09m, split), trade.ExitPrice);\n            Assert.AreEqual(10 * multiplier, trade.ProfitLoss);\n            Assert.AreEqual(2, trade.TotalFees);\n            if (groupingMethod == FillGroupingMethod.FillToFill)\n            {\n                Assert.AreEqual(-5 * multiplier, trade.MAE);\n                Assert.AreEqual(20m * multiplier, trade.MFE);\n            }\n            else\n            {\n                Assert.AreEqual(0, trade.MAE);\n                Assert.AreEqual(0, trade.MFE);\n            }\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [Test]\n        public void ITMOptionAssignment(\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection,\n            [Values] bool win)\n        {\n            var time = _startTime;\n            var option = GetOption();\n            var underlying = option.Underlying;\n\n            option.SetMarketPrice(new Tick { Value = 100m });\n\n            var underlyingPrice = 0m;\n            if (win)\n            {\n                underlyingPrice = orderDirection == OrderDirection.Buy ? 300m : 290m;\n            }\n            else\n            {\n                underlyingPrice = orderDirection == OrderDirection.Buy ? 290m : 300m;\n            }\n            underlying.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            var builder = new TradeBuilder(FillGroupingMethod.FillToFill, FillMatchingMethod.FIFO);\n            builder.SetSecurityManager(_securityManager);\n\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            builder.ProcessFill(\n                new OrderEvent(1, option.Symbol, time, OrderStatus.Filled, orderDirection, 100m, quantity, _orderFee) { IsInTheMoney = true },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsTrue(builder.HasOpenPosition(option.Symbol));\n\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, -quantity, 0, 0, time, \"\"));\n            builder.ProcessFill(\n                new OrderEvent(2, option.Symbol, time.AddMinutes(10), OrderStatus.Filled, closingOrderDirection, 0m, -quantity, _orderFee)\n                {\n                    IsInTheMoney = true,\n                    Ticket = ticket\n                },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsFalse(builder.HasOpenPosition(option.Symbol));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(option.Symbol, trade.Symbol);\n            Assert.AreEqual(win, trade.IsWin);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(100m, trade.EntryPrice);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? TradeDirection.Long : TradeDirection.Short, trade.Direction);\n            Assert.AreEqual(10, trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(0, trade.ExitPrice);\n            Assert.AreEqual(Math.Sign(quantity) * -100000m, trade.ProfitLoss);\n            Assert.AreEqual(2m, trade.TotalFees);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? -100000m : 0m, trade.MAE);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? 0m : 100000m, trade.MFE);\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [TestCase(OrderDirection.Buy)]\n        [TestCase(OrderDirection.Sell)]\n        public void OTMOptionAssignment(OrderDirection orderDirection)\n        {\n            var time = _startTime;\n            var option = GetOption();\n            var underlying = option.Underlying;\n\n            option.SetMarketPrice(new Tick { Value = 100m });\n            underlying.SetMarketPrice(new Tick { Value = 150 });\n\n            var builder = new TradeBuilder(FillGroupingMethod.FillToFill, FillMatchingMethod.FIFO);\n            builder.SetSecurityManager(_securityManager);\n\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            builder.ProcessFill(\n                new OrderEvent(1, option.Symbol, time, OrderStatus.Filled, orderDirection, 100m, quantity, _orderFee) { IsInTheMoney = true },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsTrue(builder.HasOpenPosition(option.Symbol));\n\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, -quantity, 0, 0, time, \"\"));\n            builder.ProcessFill(\n                new OrderEvent(2, option.Symbol, time.AddMinutes(10), OrderStatus.Filled, closingOrderDirection, 0m, -quantity, _orderFee)\n                {\n                    IsInTheMoney = true,\n                    Ticket = ticket\n                },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsFalse(builder.HasOpenPosition(option.Symbol));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(option.Symbol, trade.Symbol);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? false : true, trade.IsWin);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(100m, trade.EntryPrice);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? TradeDirection.Long : TradeDirection.Short, trade.Direction);\n            Assert.AreEqual(10, trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(0, trade.ExitPrice);\n            Assert.AreEqual(Math.Sign(quantity) * -100000m, trade.ProfitLoss);\n            Assert.AreEqual(2m, trade.TotalFees);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? -100000m : 0m, trade.MAE);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? 0m : 100000m, trade.MFE);\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [Test]\n        public void OptionPositionCloseWithoutExercise(\n            [Values(OrderDirection.Buy, OrderDirection.Sell)] OrderDirection orderDirection,\n            [Values] bool win)\n        {\n            var time = _startTime;\n            var option = GetOption();\n            var underlying = option.Underlying;\n\n            underlying.SetMarketPrice(new Tick { Value = 300m });\n\n            var builder = new TradeBuilder(FillGroupingMethod.FillToFill, FillMatchingMethod.FIFO);\n            builder.SetSecurityManager(_securityManager);\n\n            var initialOptionPrice = 100m;\n            option.SetMarketPrice(new Tick { Value = initialOptionPrice });\n\n            var quantity = orderDirection == OrderDirection.Buy ? 10 : -10;\n            builder.ProcessFill(\n                new OrderEvent(1, option.Symbol, time, OrderStatus.Filled, orderDirection, 100m, quantity, _orderFee) { IsInTheMoney = true },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsTrue(builder.HasOpenPosition(option.Symbol));\n\n            // Before closing, update option market price\n            var finalOptionPrice = 0m;\n            if (win)\n            {\n                finalOptionPrice = orderDirection == OrderDirection.Buy ? 150m : 50m;\n            }\n            else\n            {\n                finalOptionPrice = orderDirection == OrderDirection.Buy ? 50m : 150m;\n            }\n            option.SetMarketPrice(new Tick { Value = finalOptionPrice });\n\n            var closingOrderDirection = orderDirection == OrderDirection.Buy ? OrderDirection.Sell : OrderDirection.Buy;\n            var ticket = new OrderTicket(null, new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, -quantity, 0, 0, time, \"\"));\n            builder.ProcessFill(\n                new OrderEvent(2, option.Symbol, time.AddMinutes(10), OrderStatus.Filled, closingOrderDirection, finalOptionPrice, -quantity, _orderFee)\n                {\n                    IsInTheMoney = true,\n                    Ticket = ticket,\n                },\n                ConversionRate,\n                _orderFee.Value.Amount,\n                100m);\n\n            Assert.IsFalse(builder.HasOpenPosition(option.Symbol));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            var expectedProfitLoss = (finalOptionPrice - initialOptionPrice) * quantity * 100m;\n\n            Assert.AreEqual(option.Symbol, trade.Symbol);\n            Assert.AreEqual(win, trade.IsWin);\n            Assert.AreEqual(time, trade.EntryTime);\n            Assert.AreEqual(initialOptionPrice, trade.EntryPrice);\n            Assert.AreEqual(orderDirection == OrderDirection.Buy ? TradeDirection.Long : TradeDirection.Short, trade.Direction);\n            Assert.AreEqual(10, trade.Quantity);\n            Assert.AreEqual(time.AddMinutes(10), trade.ExitTime);\n            Assert.AreEqual(finalOptionPrice, trade.ExitPrice);\n            Assert.AreEqual(expectedProfitLoss, trade.ProfitLoss);\n            CollectionAssert.AreEquivalent(new[] { 1, 2 }, trade.OrderIds);\n        }\n\n        [TestCaseSource(nameof(DrawdownTestCases))]\n        public void DrawdownCalculation(PositionSide entrySide, decimal[] prices, decimal expectedDrawdown)\n        {\n            if (prices.Length < 2)\n            {\n                Assert.Fail(\"At least two prices are required to perform the test.\");\n            }\n\n            // Buy 1k, Sell 1k (entrySide == Long) or Sell 1k, Buy 1k (entrySide == Short)\n\n            var builder = new TradeBuilder(FillGroupingMethod.FillToFill, FillMatchingMethod.FIFO);\n            builder.SetSecurityManager(_securityManager);\n            var time = _startTime;\n\n            var quantity = (entrySide == PositionSide.Long ? 1 : -1) * 1000m;\n\n            // Open position\n            builder.ProcessFill(\n                new OrderEvent(1, Symbols.SPY, time, OrderStatus.Filled, entrySide == PositionSide.Long ? OrderDirection.Buy : OrderDirection.Sell,\n                    fillPrice: prices[0], fillQuantity: quantity, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsTrue(builder.HasOpenPosition(Symbols.SPY));\n\n            for (int i = 1; i < prices.Length - 1; i++)\n            {\n                builder.SetMarketPrice(Symbols.SPY, prices[i]);\n            }\n\n            // Close position\n            builder.ProcessFill(\n                new OrderEvent(2, Symbols.SPY, time.AddMinutes(10), OrderStatus.Filled, entrySide == PositionSide.Long ? OrderDirection.Sell : OrderDirection.Buy,\n                    fillPrice: prices[^1], fillQuantity: -quantity, orderFee: _orderFee),\n                ConversionRate, _orderFee.Value.Amount);\n\n            Assert.IsFalse(builder.HasOpenPosition(Symbols.SPY));\n\n            Assert.AreEqual(1, builder.ClosedTrades.Count);\n\n            var trade = builder.ClosedTrades[0];\n\n            Assert.AreEqual(expectedDrawdown * Math.Abs(quantity), trade.EndTradeDrawdown);\n        }\n\n        private static IEnumerable<TestCaseData> DrawdownTestCases\n        {\n            get\n            {\n\n                // Long trades\n                // -------------------------------\n\n                // Price 100 -> 120 -> 110\n                //        /\\\n                //       /  \\\n                //      /    ----\n                //     /  \n                // ----\n                // We expect a drawdown of 10 (from 120 to 110)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 120m, 110m }, 10m).SetName($\"DrawdownLongTrade_SingleDrawdown\");\n\n                // Price 100 -> 140 -> 120 -> 130 -> 110\n                //            /\\  \n                //           /  \\  \n                //          /    \\  /\\\n                //         /      \\/  \\\n                //        /            \\\n                //       /              \\\n                //      /                ----\n                //     /\n                // ----\n                // We expect a drawdown of 30 (from 140 to 110)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 140m, 120m, 130m, 110m }, 30m).SetName($\"DrawdownLongTrade_MultipleDrawdownsOnSingleHighestPrice\");\n\n                // Price 100 -> 120 -> 110 -> 120 -> 140 -> 115\n                //                /\\\n                //               /  \\\n                //              /    \\\n                //             /      \\\n                //        /\\  /        \\\n                //       /  \\/          \\\n                //      /                \\\n                //     /                  ----\n                // ----\n                // We expect a drawdown of 25 (from 140 to 115)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 120m, 110m, 120m, 140m, 115m }, 25m).SetName($\"DrawdownLongTrade_HighestDrawdownOnNewHighestPrice\");\n\n                // Price 100 -> 120 -> 110 -> 120 -> 130 -> 125\n                //              /\\\n                //             /  ----\n                //        /\\  /\n                //       /  \\/\n                //      /\n                //     /\n                // ----\n                // We expect a drawdown of 10 (from 120 to 110)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 120m, 110m, 120m, 130m, 125m }, 10m).SetName($\"DrawdownLongTrade_LowerDrawdownOnNewHighestPrice\");\n\n                // Price 100 -> 80 -> 110\n                //               ----\n                //              /\n                // ----        /\n                //     \\      /\n                //      \\    /\n                //       \\  /\n                //        \\/\n                // We expect a drawdown of 20 (from 100 to 80)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 80m, 110m }, 20m).SetName($\"DrawdownLongTrade_PriceGoesBelowEntryPrice\");\n\n                // Price 100 -> 90 -> 130 -> 110\n                //               /\\\n                //              /  \\\n                //             /    \\\n                //            /      \\\n                //           /        ----\n                //          /\n                // ----    /\n                //     \\  /\n                //      \\/\n                // We expect a drawdown of 20 (from 130 to 110 which is higher than the first one from 100 to 90)\n                yield return new TestCaseData(PositionSide.Long, new[] { 100m, 90m, 130m, 110m }, 20m).SetName($\"DrawdownLongTrade_HigherDrawdownAfterPriceGoesBelowEntryPrice\");\n\n                // Short trades\n                // -------------------------------\n\n                // Price 100 -> 80 -> 90\n                // ----\n                //     \\\n                //      \\    ----\n                //       \\  /\n                //        \\/\n                // We expect a drawdown of 10 (from 80 to 90)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 80m, 90m }, 10m).SetName($\"DrawdownShortTrade_SingleDrawdown\");\n\n                // Price 100 -> 60 -> 80 -> 70 -> 90\n                // ----\n                //     \\\n                //      \\                ----\n                //       \\              /\n                //        \\            /\n                //         \\      /\\  /\n                //          \\    /  \\/\n                //           \\  /\n                //            \\/\n                // We expect a drawdown of 30 (from 60 to 90)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 60m, 80m, 70m, 90m }, 30m).SetName($\"DrawdownShortTrade_MultipleDrawdownsOnSingleLowestPrice\");\n\n                // Price 100 -> 80 -> 90 -> 80 -> 60 -> 85\n                // ----\n                //     \\              ----\n                //      \\            /\n                //       \\  /\\      /\n                //        \\/  \\    /\n                //             \\  /\n                //              \\/\n                // We expect a drawdown of 25 (from 60 to 85)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 80m, 90m, 80m, 60m, 85m }, 25m).SetName($\"DrawdownShortTrade_HighestDrawdownOnNewLowestPrice\");\n\n                // Price 100 -> 80 -> 90 -> 80 -> 70 -> 75\n                // ----\n                //     \\\n                //      \\\n                //       \\  /\\\n                //        \\/  \\    \n                //             \\  ----\n                //              \\/\n\n                // We expect a drawdown of 10 (from 80 to 90)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 80m, 90m, 80m, 70m, 75m }, 10m).SetName($\"DrawdownShortTrade_LowerDrawdownOnNewLowestPrice\");\n\n                // Price 100 -> 120 -> 90\n                //        /\\\n                //       /  \\\n                //      /    \\\n                //     /      \\\n                // ----        \\\n                //              \\\n                //               \\\n                //                ----\n                // We expect a drawdown of 20 (from 100 to 120)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 120m, 90m }, 20m).SetName($\"DrawdownShortTrade_PriceGoesAboveEntryPrice\");\n\n                // Price 100 -> 110 -> 70 -> 90\n                //      /\\\n                //     /  \\\n                // ----    \\\n                //          \\\n                //           \\        ----\n                //            \\      /\n                //             \\    /\n                //              \\  /\n                //               \\/\n                // We expect a drawdown of 20 (from 70 to 90 which is higher than the first one from 100 to 110)\n                yield return new TestCaseData(PositionSide.Short, new[] { 100m, 110m, 70m, 90m }, 20m).SetName($\"DrawdownShortTrade_HigherDrawdownAfterPriceGoesAboveEntryPrice\");\n            }\n        }\n\n        private Option GetOption()\n        {\n            var underlying = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            var option = new Option(\n                Symbols.SPY_C_192_Feb19_2016,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                new OptionSymbolProperties(\"\", Currencies.USD, 100, 0.01m, 1),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache(),\n                underlying\n            );\n\n            _securityManager.Add(underlying);\n            _securityManager.Add(option);\n\n            return option;\n        }\n\n        private static decimal AdjustQuantityToSplit(decimal quantity, Split split)\n        {\n            return split == null ? quantity : quantity / split.SplitFactor;\n        }\n\n        private static decimal AdjustPriceToSplit(decimal price, Split split)\n        {\n            return split == null ? price : price * split.SplitFactor;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/TradeStatisticsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    class TradeStatisticsTests\n    {\n        private const decimal TradeFee = 2;\n        private readonly DateTime _startTime = new DateTime(2015, 08, 06, 15, 30, 0);\n\n        [Test]\n        public void NoTrades()\n        {\n            var statistics = new TradeStatistics(new List<Trade>());\n\n            Assert.AreEqual(null, statistics.StartDateTime);\n            Assert.AreEqual(null, statistics.EndDateTime);\n            Assert.AreEqual(0, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(0, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(0, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(0, statistics.TotalProfitLoss);\n            Assert.AreEqual(0, statistics.TotalProfit);\n            Assert.AreEqual(0, statistics.TotalLoss);\n            Assert.AreEqual(0, statistics.LargestProfit);\n            Assert.AreEqual(0, statistics.LargestLoss);\n            Assert.AreEqual(0, statistics.AverageProfitLoss);\n            Assert.AreEqual(0, statistics.AverageProfit);\n            Assert.AreEqual(0, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.Zero, statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.Zero, statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.Zero, statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(0, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(0, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0, statistics.ProfitLossRatio);\n            Assert.AreEqual(0, statistics.WinLossRatio);\n            Assert.AreEqual(0, statistics.WinRate);\n            Assert.AreEqual(0, statistics.LossRate);\n            Assert.AreEqual(0, statistics.AverageMAE);\n            Assert.AreEqual(0, statistics.AverageMFE);\n            Assert.AreEqual(0, statistics.LargestMAE);\n            Assert.AreEqual(0, statistics.LargestMFE);\n            Assert.AreEqual(0, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(0, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(0, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(0, statistics.ProfitFactor);\n            Assert.AreEqual(0, statistics.SharpeRatio);\n            Assert.AreEqual(0, statistics.SortinoRatio);\n            Assert.AreEqual(0, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(0, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(0, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.Zero, statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(0, statistics.TotalFees);\n        }\n\n        [Test]\n        public void ThreeWinners()\n        {\n            var statistics = new TradeStatistics(CreateThreeWinners());\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(40), statistics.EndDateTime);\n            Assert.AreEqual(3, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(3, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(0, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(50, statistics.TotalProfitLoss);\n            Assert.AreEqual(50, statistics.TotalProfit);\n            Assert.AreEqual(0, statistics.TotalLoss);\n            Assert.AreEqual(20, statistics.LargestProfit);\n            Assert.AreEqual(0, statistics.LargestLoss);\n            Assert.AreEqual(16.666666666666666666666666667m, statistics.AverageProfitLoss);\n            Assert.AreEqual(16.666666666666666666666666667m, statistics.AverageProfit);\n            Assert.AreEqual(0, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.Zero, statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(3, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(0, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0, statistics.ProfitLossRatio);\n            Assert.AreEqual(10, statistics.WinLossRatio);\n            Assert.AreEqual(1, statistics.WinRate);\n            Assert.AreEqual(0, statistics.LossRate);\n            Assert.AreEqual(-16.666666666666666666666666667m, statistics.AverageMAE);\n            Assert.AreEqual(33.333333333333333333333333333m, statistics.AverageMFE);\n            Assert.AreEqual(-30, statistics.LargestMAE);\n            Assert.AreEqual(40, statistics.LargestMFE);\n            Assert.AreEqual(0, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-70, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(5.77350269189626m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(10, statistics.ProfitFactor);\n            Assert.AreEqual(2.8867513459481276450914878051m, statistics.SharpeRatio);\n            Assert.AreEqual(0, statistics.SortinoRatio);\n            Assert.AreEqual(10, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(20, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-16.666666666666666666666666666m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.Zero, statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(6, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateThreeWinners()\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time,\n                    EntryPrice = 1.07m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 20,\n                    TotalFees = TradeFee,\n                    MAE = -5,\n                    MFE = 30,\n                    EndTradeDrawdown = 10\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(10),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 2000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 20,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 40,\n                    EndTradeDrawdown = 20\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(30),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 10,\n                    TotalFees = TradeFee,\n                    MAE = -15,\n                    MFE = 30,\n                    EndTradeDrawdown = 20\n                }\n            };\n        }\n\n        [Test]\n        public void ThreeLosers()\n        {\n            var statistics = new TradeStatistics(CreateThreeLosers());\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(40), statistics.EndDateTime);\n            Assert.AreEqual(3, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(0, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(3, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(-50, statistics.TotalProfitLoss);\n            Assert.AreEqual(0, statistics.TotalProfit);\n            Assert.AreEqual(-50, statistics.TotalLoss);\n            Assert.AreEqual(0, statistics.LargestProfit);\n            Assert.AreEqual(-20, statistics.LargestLoss);\n            Assert.AreEqual(-16.666666666666666666666666667m, statistics.AverageProfitLoss);\n            Assert.AreEqual(0, statistics.AverageProfit);\n            Assert.AreEqual(-16.666666666666666666666666667m, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.Zero, statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(0, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(3, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0, statistics.ProfitLossRatio);\n            Assert.AreEqual(0, statistics.WinLossRatio);\n            Assert.AreEqual(0, statistics.WinRate);\n            Assert.AreEqual(1, statistics.LossRate);\n            Assert.AreEqual(-33.333333333333333333333333333m, statistics.AverageMAE);\n            Assert.AreEqual(16.666666666666666666666666667m, statistics.AverageMFE);\n            Assert.AreEqual(-40, statistics.LargestMAE);\n            Assert.AreEqual(30, statistics.LargestMFE);\n            Assert.AreEqual(-50, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-80, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(5.77350269189626m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(5.77350269189626m, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(0, statistics.ProfitFactor);\n            Assert.AreEqual(-2.8867513459481276450914878051m, statistics.SharpeRatio);\n            Assert.AreEqual(-2.8867513459481276450914878051m, statistics.SortinoRatio);\n            Assert.AreEqual(-1, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(50, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-33.333333333333333333333333334m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.Zero, statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(6, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateThreeLosers()\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time,\n                    EntryPrice = 1.07m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 5,\n                    EndTradeDrawdown = 25\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(10),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 2000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -40,\n                    MFE = 30,\n                    EndTradeDrawdown = 50\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(30),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -10,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 15,\n                    EndTradeDrawdown = 25\n                }\n            };\n        }\n\n        [Test]\n        public void TwoLosersOneWinner()\n        {\n            var statistics = new TradeStatistics(CreateTwoLosersOneWinner());\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(40), statistics.EndDateTime);\n            Assert.AreEqual(3, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(1, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(2, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(-30, statistics.TotalProfitLoss);\n            Assert.AreEqual(10, statistics.TotalProfit);\n            Assert.AreEqual(-40, statistics.TotalLoss);\n            Assert.AreEqual(10, statistics.LargestProfit);\n            Assert.AreEqual(-20, statistics.LargestLoss);\n            Assert.AreEqual(-10, statistics.AverageProfitLoss);\n            Assert.AreEqual(10, statistics.AverageProfit);\n            Assert.AreEqual(-20, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromSeconds(800), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(10), statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(15), statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(1, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(2, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0.5m, statistics.ProfitLossRatio);\n            Assert.AreEqual(0.5m, statistics.WinLossRatio);\n            Assert.AreEqual(0.3333333333333333333333333333m, statistics.WinRate);\n            Assert.AreEqual(0.6666666666666666666666666667m, statistics.LossRate);\n            Assert.AreEqual(-28.333333333333333333333333333333m, statistics.AverageMAE);\n            Assert.AreEqual(21.666666666666666666666666666667m, statistics.AverageMFE);\n            Assert.AreEqual(-40, statistics.LargestMAE);\n            Assert.AreEqual(30, statistics.LargestMFE);\n            Assert.AreEqual(-40, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-70, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(17.3205080756888m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(0.25m, statistics.ProfitFactor);\n            Assert.AreEqual(-0.5773502691896248623516308943m, statistics.SharpeRatio);\n            Assert.AreEqual(0, statistics.SortinoRatio);\n            Assert.AreEqual(-0.75m, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(50, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-31.666666666666666666666666666667m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.Zero, statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(6, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateTwoLosersOneWinner()\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time,\n                    EntryPrice = 1.07m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 5,\n                    EndTradeDrawdown = 30\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(10),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 2000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -40,\n                    MFE = 30,\n                    EndTradeDrawdown = 50\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(30),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 10,\n                    TotalFees = TradeFee,\n                    MAE = -15,\n                    MFE = 30,\n                    EndTradeDrawdown = 20\n                }\n            };\n        }\n\n        [Test]\n        public void OneWinnerTwoLosers()\n        {\n            var statistics = new TradeStatistics(CreateOneWinnerTwoLosers());\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(40), statistics.EndDateTime);\n            Assert.AreEqual(3, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(1, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(2, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(-30, statistics.TotalProfitLoss);\n            Assert.AreEqual(10, statistics.TotalProfit);\n            Assert.AreEqual(-40, statistics.TotalLoss);\n            Assert.AreEqual(10, statistics.LargestProfit);\n            Assert.AreEqual(-20, statistics.LargestLoss);\n            Assert.AreEqual(-10, statistics.AverageProfitLoss);\n            Assert.AreEqual(10, statistics.AverageProfit);\n            Assert.AreEqual(-20, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromSeconds(800), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(10), statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(15), statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(1, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(2, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0.5m, statistics.ProfitLossRatio);\n            Assert.AreEqual(0.5m, statistics.WinLossRatio);\n            Assert.AreEqual(0.3333333333333333333333333333m, statistics.WinRate);\n            Assert.AreEqual(0.6666666666666666666666666667m, statistics.LossRate);\n            Assert.AreEqual(-28.333333333333333333333333333333m, statistics.AverageMAE);\n            Assert.AreEqual(21.666666666666666666666666666667m, statistics.AverageMFE);\n            Assert.AreEqual(-40, statistics.LargestMAE);\n            Assert.AreEqual(30, statistics.LargestMFE);\n            Assert.AreEqual(-40, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-80, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(17.3205080756888m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(0.25m, statistics.ProfitFactor);\n            Assert.AreEqual(-0.5773502691896248623516308943m, statistics.SharpeRatio);\n            Assert.AreEqual(0, statistics.SortinoRatio);\n            Assert.AreEqual(-0.75m, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(50, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-31.666666666666666666666666666667m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.Zero, statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(6, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateOneWinnerTwoLosers()\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time,\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(10),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 10,\n                    TotalFees = TradeFee,\n                    MAE = -15,\n                    MFE = 30,\n                    EndTradeDrawdown = 20\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(20),\n                    EntryPrice = 1.07m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 5,\n                    EndTradeDrawdown = 25\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(30),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 2000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -40,\n                    MFE = 30,\n                    EndTradeDrawdown = 50\n                }\n            };\n        }\n\n        [Test]\n        public void OneLoserTwoWinners()\n        {\n            var statistics = new TradeStatistics(CreateOneLoserTwoWinners());\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(40), statistics.EndDateTime);\n            Assert.AreEqual(3, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(2, statistics.NumberOfWinningTrades);\n            Assert.AreEqual(1, statistics.NumberOfLosingTrades);\n            Assert.AreEqual(10, statistics.TotalProfitLoss);\n            Assert.AreEqual(30, statistics.TotalProfit);\n            Assert.AreEqual(-20, statistics.TotalLoss);\n            Assert.AreEqual(20, statistics.LargestProfit);\n            Assert.AreEqual(-20, statistics.LargestLoss);\n            Assert.AreEqual(3.3333333333333333333333333333m, statistics.AverageProfitLoss);\n            Assert.AreEqual(15, statistics.AverageProfit);\n            Assert.AreEqual(-20, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromSeconds(800), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(10), statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(2, statistics.MaxConsecutiveWinningTrades);\n            Assert.AreEqual(1, statistics.MaxConsecutiveLosingTrades);\n            Assert.AreEqual(0.75m, statistics.ProfitLossRatio);\n            Assert.AreEqual(2, statistics.WinLossRatio);\n            Assert.AreEqual(0.6666666666666666666666666667m, statistics.WinRate);\n            Assert.AreEqual(0.3333333333333333333333333333m, statistics.LossRate);\n            Assert.AreEqual(-28.333333333333333333333333333333m, statistics.AverageMAE);\n            Assert.AreEqual(21.666666666666666666666666666667m, statistics.AverageMFE);\n            Assert.AreEqual(-40, statistics.LargestMAE);\n            Assert.AreEqual(30, statistics.LargestMFE);\n            Assert.AreEqual(-20, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-70, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(20.8166599946613m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(1.5m, statistics.ProfitFactor);\n            Assert.AreEqual(0.1601281538050873438895842626m, statistics.SharpeRatio);\n            Assert.AreEqual(0, statistics.SortinoRatio);\n            Assert.AreEqual(0.5m, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(25, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-18.333333333333333333333333334m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.FromMinutes(40), statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(6, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateOneLoserTwoWinners()\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time,\n                    EntryPrice = 1.07m,\n                    Direction = TradeDirection.Short,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = -20,\n                    TotalFees = TradeFee,\n                    MAE = -30,\n                    MFE = 5,\n                    EndTradeDrawdown = 25\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(10),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 2000,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 20,\n                    TotalFees = TradeFee,\n                    MAE = -40,\n                    MFE = 30,\n                    EndTradeDrawdown = 10\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.EURUSD],\n                    EntryTime = time.AddMinutes(30),\n                    EntryPrice = 1.08m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(40),\n                    ExitPrice = 1.09m,\n                    ProfitLoss = 10,\n                    TotalFees = TradeFee,\n                    MAE = -15,\n                    MFE = 30,\n                    EndTradeDrawdown = 20\n                }\n            };\n        }\n\n        [Test]\n        public void ITMOptionAssignment([Values] bool win)\n        {\n            var statistics = new TradeStatistics(CreateITMOptionAssignment(win));\n\n            if (win)\n            {\n                Assert.AreEqual(2, statistics.NumberOfWinningTrades);\n                Assert.AreEqual(0, statistics.NumberOfLosingTrades);\n                Assert.AreEqual(2, statistics.MaxConsecutiveWinningTrades);\n                Assert.AreEqual(0, statistics.MaxConsecutiveLosingTrades);\n                Assert.AreEqual(10, statistics.WinLossRatio);\n                Assert.AreEqual(1m, statistics.WinRate);\n                Assert.AreEqual(0m, statistics.LossRate);\n            }\n            else\n            {\n                Assert.AreEqual(1, statistics.NumberOfWinningTrades);\n                Assert.AreEqual(1, statistics.NumberOfLosingTrades);\n                Assert.AreEqual(1, statistics.MaxConsecutiveWinningTrades);\n                Assert.AreEqual(1, statistics.MaxConsecutiveLosingTrades);\n                Assert.AreEqual(1m, statistics.WinLossRatio);\n                Assert.AreEqual(0.5m, statistics.WinRate);\n                Assert.AreEqual(0.5m, statistics.LossRate);\n            }\n\n            Assert.AreEqual(_startTime, statistics.StartDateTime);\n            Assert.AreEqual(_startTime.AddMinutes(30), statistics.EndDateTime);\n            Assert.AreEqual(2, statistics.TotalNumberOfTrades);\n            Assert.AreEqual(28000m, statistics.TotalProfitLoss);\n            Assert.AreEqual(108000m, statistics.TotalProfit);\n            Assert.AreEqual(-80000m, statistics.TotalLoss);\n            Assert.AreEqual(108000m, statistics.LargestProfit);\n            Assert.AreEqual(-80000m, statistics.LargestLoss);\n            Assert.AreEqual(14000m, statistics.AverageProfitLoss);\n            Assert.AreEqual(108000m, statistics.AverageProfit);\n            Assert.AreEqual(-80000m, statistics.AverageLoss);\n            Assert.AreEqual(TimeSpan.FromMinutes(15), statistics.AverageTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(10), statistics.AverageWinningTradeDuration);\n            Assert.AreEqual(TimeSpan.FromMinutes(20), statistics.AverageLosingTradeDuration);\n            Assert.AreEqual(1.35m, statistics.ProfitLossRatio);\n            Assert.AreEqual(-40000m, statistics.AverageMAE);\n            Assert.AreEqual(54000m, statistics.AverageMFE);\n            Assert.AreEqual(-80000, statistics.LargestMAE);\n            Assert.AreEqual(108000, statistics.LargestMFE);\n            Assert.AreEqual(-80000, statistics.MaximumClosedTradeDrawdown);\n            Assert.AreEqual(-108000, statistics.MaximumIntraTradeDrawdown);\n            Assert.AreEqual(132936.074863071m, statistics.ProfitLossStandardDeviation);\n            Assert.AreEqual(0m, statistics.ProfitLossDownsideDeviation);\n            Assert.AreEqual(1.35m, statistics.ProfitFactor);\n            Assert.AreEqual(0.1053137759214006433027413265m, statistics.SharpeRatio);\n            Assert.AreEqual(0m, statistics.SortinoRatio);\n            Assert.AreEqual(0.35m, statistics.ProfitToMaxDrawdownRatio);\n            Assert.AreEqual(80000, statistics.MaximumEndTradeDrawdown);\n            Assert.AreEqual(-40000m, statistics.AverageEndTradeDrawdown);\n            Assert.AreEqual(TimeSpan.FromMinutes(30), statistics.MaximumDrawdownDuration);\n            Assert.AreEqual(4, statistics.TotalFees);\n        }\n\n        private IEnumerable<Trade> CreateITMOptionAssignment(bool win)\n        {\n            var time = _startTime;\n\n            return new List<Trade>\n            {\n                new Trade\n                {\n                    Symbols = [Symbols.SPY_C_192_Feb19_2016],\n                    EntryTime = time,\n                    EntryPrice = 80m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 10,\n                    ExitTime = time.AddMinutes(20),\n                    ExitPrice = 0m,\n                    ProfitLoss = -80000m,\n                    TotalFees = TradeFee,\n                    MAE = -80000m,\n                    MFE = 0,\n                    EndTradeDrawdown = 80000m,\n                    IsWin = win,\n                },\n                new Trade\n                {\n                    Symbols =[Symbols.SPY],\n                    EntryTime = time.AddMinutes(20),\n                    EntryPrice = 192m,\n                    Direction = TradeDirection.Long,\n                    Quantity = 1000,\n                    ExitTime = time.AddMinutes(30),\n                    ExitPrice = 300m,\n                    ProfitLoss = 108000m,\n                    TotalFees = TradeFee,\n                    MAE = 0,\n                    MFE = 108000m,\n                    EndTradeDrawdown = 0m,\n                    IsWin = true,\n                },\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Statistics/TradeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Statistics;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Statistics\n{\n    [TestFixture]\n    public class TradeTests\n    {\n        [Test]\n        public void JsonSerializationRoundTrip()\n        {\n            var trade = MakeTrade();\n\n            var json = JsonConvert.SerializeObject(trade);\n            var deserializedTrade = JsonConvert.DeserializeObject<Trade>(json);\n            CollectionAssert.AreEqual(trade.Symbols, deserializedTrade.Symbols);\n            Assert.AreEqual(trade.EntryTime, deserializedTrade.EntryTime);\n            Assert.AreEqual(trade.EntryPrice, deserializedTrade.EntryPrice);\n            Assert.AreEqual(trade.Direction, deserializedTrade.Direction);\n            Assert.AreEqual(trade.Quantity, deserializedTrade.Quantity);\n            Assert.AreEqual(trade.ExitTime, deserializedTrade.ExitTime);\n            Assert.AreEqual(trade.ExitPrice, deserializedTrade.ExitPrice);\n            Assert.AreEqual(trade.ProfitLoss, deserializedTrade.ProfitLoss);\n            Assert.AreEqual(trade.TotalFees, deserializedTrade.TotalFees);\n            Assert.AreEqual(trade.MAE, deserializedTrade.MAE);\n            Assert.AreEqual(trade.MFE, deserializedTrade.MFE);\n\n            // For backwards compatibility, also verify Symbol property is set correctly\n            Assert.IsNotNull(trade.Symbol);\n            Assert.AreEqual(trade.Symbols[0], trade.Symbol);\n            Assert.AreEqual(trade.Symbol, deserializedTrade.Symbol);\n        }\n\n        [Test]\n        public void DeprecatedSymbolIsNotSerialized()\n        {\n            var trade = MakeTrade();\n            var jsonStr = JsonConvert.SerializeObject(trade);\n            var json = JObject.Parse(jsonStr);\n            Assert.IsFalse(json.ContainsKey(\"Symbol\"));\n        }\n\n        [Test]\n        public void CanDeserializeOldFormatWithSymbol()\n        {\n            var jsonTrade = @\"\n{\n  \"\"Symbol\"\": {\n    \"\"value\"\": \"\"EURUSD\"\",\n    \"\"id\"\": \"\"EURUSD 8G\"\",\n    \"\"permtick\"\": \"\"EURUSD\"\"\n  },\n  \"\"EntryTime\"\": \"\"2023-01-02T12:31:45\"\",\n  \"\"EntryPrice\"\": 1.07,\n  \"\"Direction\"\": 0,\n  \"\"Quantity\"\": 1000.0,\n  \"\"ExitTime\"\": \"\"2023-01-02T12:51:45\"\",\n  \"\"ExitPrice\"\": 1.09,\n  \"\"ProfitLoss\"\": 20.0,\n  \"\"TotalFees\"\": 2.5,\n  \"\"MAE\"\": -5.0,\n  \"\"MFE\"\": 30.0,\n  \"\"Duration\"\": \"\"00:20:00\"\",\n  \"\"EndTradeDrawdown\"\": -10.0,\n  \"\"IsWin\"\": false,\n  \"\"OrderIds\"\": []\n}\";\n            var deserializedTrade = JsonConvert.DeserializeObject<Trade>(jsonTrade);\n            Assert.IsNotNull(deserializedTrade);\n            CollectionAssert.AreEqual(new[] { Symbols.EURUSD }, deserializedTrade.Symbols);\n            Assert.AreEqual(new DateTime(2023, 1, 2, 12, 31, 45), deserializedTrade.EntryTime);\n            Assert.AreEqual(1.07m, deserializedTrade.EntryPrice);\n            Assert.AreEqual(TradeDirection.Long, deserializedTrade.Direction);\n            Assert.AreEqual(1000m, deserializedTrade.Quantity);\n            Assert.AreEqual(new DateTime(2023, 1, 2, 12, 51, 45), deserializedTrade.ExitTime);\n            Assert.AreEqual(1.09m, deserializedTrade.ExitPrice);\n            Assert.AreEqual(20m, deserializedTrade.ProfitLoss);\n            Assert.AreEqual(2.5m, deserializedTrade.TotalFees);\n            Assert.AreEqual(-5m, deserializedTrade.MAE);\n            Assert.AreEqual(30m, deserializedTrade.MFE);\n            // For backwards compatibility, also verify Symbol property is set correctly\n            Assert.IsNotNull(deserializedTrade.Symbol);\n            Assert.AreEqual(deserializedTrade.Symbols[0], deserializedTrade.Symbol);\n        }\n\n        private static Trade MakeTrade()\n        {\n            var entryTime = new DateTime(2023, 1, 2, 12, 31, 45);\n            var exitTime = entryTime.AddMinutes(20);\n            var trade = new Trade\n            {\n                Symbols = [Symbols.EURUSD],\n                EntryTime = entryTime,\n                EntryPrice = 1.07m,\n                Direction = TradeDirection.Long,\n                Quantity = 1000,\n                ExitTime = exitTime,\n                ExitPrice = 1.09m,\n                ProfitLoss = 20,\n                TotalFees = 2.5m,\n                MAE = -5,\n                MFE = 30\n            };\n            return trade;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Storage/LocalObjectStoreTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Storage;\nusing QuantConnect.Research;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.Storage;\nusing Python.Runtime;\n\nnamespace QuantConnect.Tests.Common.Storage\n{\n    [TestFixture]\n    public class LocalObjectStoreTests\n    {\n        private static readonly string TestStorageRoot = $\"{Directory.GetCurrentDirectory()}/{nameof(LocalObjectStoreTests)}\";\n        private static readonly string StorageRootConfigurationValue = LocalObjectStore.DefaultObjectStore;\n\n        private ObjectStore _store;\n        private ILogHandler _logHandler;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            LocalObjectStore.DefaultObjectStore = TestStorageRoot;\n#pragma warning disable CA2000\n            _store = new ObjectStore(new TestLocalObjectStore());\n#pragma warning restore CA2000\n            _store.Initialize(0, 0, \"\", new Controls() { StorageLimit = 5 * 1024 * 1024, StorageFileCount = 100 }, AlgorithmMode.Backtesting);\n\n            // Store initial Log Handler\n            _logHandler = Log.LogHandler;\n        }\n\n        [OneTimeTearDown]\n        public void Cleanup()\n        {\n            _store.DisposeSafely();\n            LocalObjectStore.DefaultObjectStore = StorageRootConfigurationValue;\n            try\n            {\n                Directory.Delete(TestStorageRoot, true);\n            }\n            catch\n            {\n            }\n\n            // Restore initial Log Handler\n            Log.LogHandler = _logHandler;\n        }\n\n        [Test]\n        public void DoesNotYieldTwiceSameFile()\n        {\n            using var store = new ObjectStore(new TestLocalObjectStore());\n            store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n            store.SaveBytes(\"DoesNotYieldTwiceSameFile\", [1, 1]);\n\n            var enumerator = store.GetEnumerator();\n            Assert.IsTrue(enumerator.MoveNext());\n\n            Assert.IsFalse(enumerator.MoveNext());\n            store.Delete(\"DoesNotYieldTwiceSameFile\");\n        }\n\n        [Test]\n        public void DisposeDoesNotHang()\n        {\n            var store = new ObjectStore(new TestLocalObjectStore());\n            store.Initialize(0, 0, \"\", new Controls(), AlgorithmMode.Backtesting);\n            Assert.IsTrue(store.SaveBytes(\"DisposeDoesNotHang\", [1, 1]));\n\n            using var testEvent = new AutoResetEvent(false);\n            _ = Task.Factory.StartNew(() =>\n            {\n                var enumerator = store.GetEnumerator();\n                Assert.IsTrue(enumerator.MoveNext());\n                testEvent.Set();\n                Thread.Sleep(Time.OneSecond);\n            }, TaskCreationOptions.LongRunning);\n            testEvent.WaitOne();\n\n            store.Delete(\"DisposeDoesNotHang\");\n            _ = Task.Factory.StartNew(() =>\n            {\n                store.Dispose();\n                testEvent.Set();\n            }, TaskCreationOptions.LongRunning);\n            Assert.IsTrue(testEvent.WaitOne(TimeSpan.FromSeconds(5)));\n        }\n\n        [Test]\n        public void ExistingFilesLoadedCorretly()\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                var dir = Path.Combine(TestStorageRoot, \"location-pepe\", \"test\");\n                Directory.CreateDirectory(dir);\n\n                var filename = \"Jose\";\n                var filename2 = \"rootFile\";\n                File.WriteAllText(Path.Combine(dir, filename), \"pinocho the movie\");\n                File.WriteAllText(Path.Combine(TestStorageRoot, filename2), \"jiji\");\n\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n\n                var storeContent = store.ToList();\n\n                Assert.IsTrue(storeContent.All(kvp => kvp.Value != null));\n\n                Assert.AreEqual(2, storeContent.Count);\n                Assert.AreEqual(\"location-pepe/test/Jose\", storeContent.Single(s => s.Key.Contains(\"location\")).Key.Replace('\\\\', '/'));\n                Assert.AreEqual(\"rootFile\", storeContent.Single(s => s.Key.Contains(\"rootFile\")).Key);\n\n                Assert.IsTrue(File.Exists(store.GetFilePath(\"location-pepe/test/Jose\")));\n                Assert.IsTrue(File.Exists(store.GetFilePath(\"rootFile\")));\n\n                Assert.IsTrue(store.Delete(\"location-pepe/test/Jose\"));\n                Assert.IsTrue(store.Delete(\"rootFile\"));\n            }\n        }\n\n        [Test]\n        public void GetFilePathPermissions([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!read || !write)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.GetFilePath(\"Jose\"));\n            }\n            else\n            {\n                Assert.DoesNotThrow(() => store.GetFilePath(\"Jose\"));\n            }\n        }\n\n        [Test]\n        public void ReadBytesPermissions([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!read)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.ReadBytes(\"Jose\"));\n            }\n            else\n            {\n                Assert.Throws<KeyNotFoundException>(() => store.ReadBytes(\"Jose\"));\n            }\n        }\n\n        [Test]\n        public void SaveBytesPermissions([Values] bool read, [Values] bool write)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = true\n            };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!write)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.SaveBytes(\"Jose\", new byte[] { 0 }));\n            }\n            else\n            {\n                Assert.IsTrue(store.SaveBytes(\"Jose\", new byte[] { 0 }));\n                Assert.IsTrue(store.Delete(\"Jose\"));\n            }\n        }\n\n        [Test]\n        public void DeletePermissions([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!delete)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.Delete(\"Jose\"));\n            }\n            else\n            {\n                Assert.IsFalse(store.Delete(\"Jose\"));\n            }\n        }\n\n        [TestCase(\"../prefix/\")]\n        [TestCase(\"..\\\\prefix/\")]\n        public void InvalidCustomPathsStore(string path)\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.AreEqual(0, store.Count());\n\n                Assert.Throws<ArgumentException>(() => store.SaveString($\"{path}ILove\", \"Pizza\"));\n            }\n        }\n\n        [Test]\n        public void ValidPaths()\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n\n                store.SaveString(\"jose-something/pepe/ILove\", \"Pizza\");\n                Assert.AreEqual(1, store.Count());\n                Assert.AreEqual(1, Directory.EnumerateFiles(Path.Combine(TestStorageRoot, \"jose-something\", \"pepe\")).Count());\n\n                store.Delete(\"jose-something/pepe/ILove\");\n                Assert.AreEqual(0, store.Count());\n                Assert.AreEqual(0, Directory.EnumerateFiles(TestStorageRoot, \"*\", SearchOption.AllDirectories).Count());\n            }\n        }\n\n        [TestCase(\"prefix/\")]\n        [TestCase(\"/prefix/\")]\n        [TestCase(\"/prefix\")]\n        [TestCase(\"prefix\")]\n        [TestCase(\"\")]\n        [TestCase(null)]\n        [TestCase(\"a/prefix/\")]\n        [TestCase(\"a/super/prefix/\")]\n        [TestCase(\"/a/super/prefix/\")]\n        [TestCase(\"/a/super/prefix\")]\n        [TestCase(\"./a/su-p_er\\\\pr##efi$x\")]\n        [TestCase(\"./a/super/prefix\")]\n        [TestCase(\"./a/su-p_er\\\\pr x=\")]\n        public void CustomPrefixStore(string prefix)\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.AreEqual(0, store.Count());\n\n                var key = \"ILove\";\n                if (prefix != null)\n                {\n                    key = Path.Combine(prefix, key);\n                }\n                store.SaveString(key, \"Pizza\");\n                Assert.AreEqual(1, store.Count());\n                Assert.AreEqual(1, Directory.EnumerateFiles(TestStorageRoot, \"*\", SearchOption.AllDirectories).Count());\n\n                var data = store.Read(key);\n                Assert.AreEqual(\"Pizza\", data);\n\n                var path = store.GetFilePath(key);\n\n                Assert.IsTrue(File.Exists(path));\n                Assert.IsTrue(store.Delete(key));\n                Assert.IsFalse(File.Exists(path));\n            }\n        }\n\n        [TestCase(2)]\n        [TestCase(1)]\n        [TestCase(0)]\n        public void KeysBehavior(int useCase)\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                var key = \"ILove\";\n                store.SaveString(key, \"Pizza\");\n                var path = store.GetFilePath(key);\n\n                if (useCase == 0)\n                {\n                    // delete\n                    Assert.IsTrue(store.Delete(key));\n                    Assert.IsFalse(File.Exists(path));\n                    Assert.AreEqual(0, store.Keys.Count);\n                }\n                else if (useCase == 1)\n                {\n                    // read\n                    Assert.AreEqual(key, store.Keys.Single());\n                }\n                else if (useCase == 2)\n                {\n                    // new file\n                    File.WriteAllText(Path.Combine(Path.GetDirectoryName(path), \"some other-file\"), \"Pepe\");\n\n                    Assert.AreEqual(2, store.Keys.Count);\n                    Assert.AreEqual(1, store.Keys.Count(k => k == key));\n                    Assert.AreEqual(1, store.Keys.Count(k => k == \"some other-file\"));\n\n                    Assert.IsTrue(store.Delete(\"some other-file\"));\n                }\n\n                // clean up\n                if (File.Exists(path))\n                {\n                    File.Delete(path);\n                }\n            }\n        }\n\n        [TestCase(5)]\n        [TestCase(4)]\n        [TestCase(3)]\n        [TestCase(2)]\n        [TestCase(1)]\n        [TestCase(0)]\n        public void AfterClearState(int useCase)\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                var key = \"ILove\";\n                store.SaveString(key, \"Pizza\");\n                var path = store.GetFilePath(key);\n                // CLEAR the state\n                store.Clear();\n\n                if (useCase == 0)\n                {\n                    // delete\n                    Assert.IsTrue(store.Delete(key));\n                    Assert.IsFalse(File.Exists(path));\n                }\n                else if (useCase == 1)\n                {\n                    // read\n                    Assert.AreEqual(\"Pizza\", store.ReadString(key));\n                }\n                else if (useCase == 2)\n                {\n                    // enumeration\n                    Assert.AreEqual(\"Pizza\", store.Single().Value);\n                }\n                else if (useCase == 3)\n                {\n                    // keys\n                    Assert.AreEqual(key, store.Keys.Single());\n                }\n                else if (useCase == 4)\n                {\n                    // get file path\n                    Assert.AreEqual(path, store.GetFilePath(key));\n                }\n                else if (useCase == 5)\n                {\n                    // new file\n                    File.WriteAllText(Path.Combine(Path.GetDirectoryName(path), \"some other-file\"), \"Pepe\");\n\n                    // read new file\n                    Assert.AreEqual(\"Pepe\", store.ReadString(\"some other-file\"));\n                    Assert.IsTrue(store.Delete(\"some other-file\"));\n                }\n\n                // clean up\n                if (File.Exists(path))\n                {\n                    File.Delete(path);\n                }\n            }\n        }\n\n        [Test]\n        public void GetFilePathAndDelete()\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var key = \"ILove\";\n                store.SaveString(key, \"Pizza\");\n                var path = store.GetFilePath(key);\n\n                Assert.IsTrue(File.Exists(path));\n                store.Delete(key);\n\n                Assert.IsFalse(File.Exists(path));\n            }\n        }\n\n        [Test]\n        public void SaveAndDelete()\n        {\n            string path;\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = 1 }, new TestFileHandler());\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n                var key = \"ILove\";\n                path = store.GetFilePath(key);\n                store.SaveBytes(key, new byte[] { 1 });\n                Thread.Sleep(2000);\n                store.Delete(key);\n\n                Assert.IsTrue(store.PersistDataCalled, \"PersistData() was never called!\");\n            }\n            Assert.IsFalse(File.Exists(path));\n        }\n\n        [Test]\n        public void ContainsKeyPermissions([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!read)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.ContainsKey(\"Jose\"));\n            }\n            else\n            {\n                Assert.IsFalse(store.ContainsKey(\"Jose\"));\n            }\n        }\n\n        [Test]\n        public void InitializationPermissions([Values] bool read, [Values] bool write, [Values] bool delete)\n        {\n            var permissions = new QuantConnect.Packets.StoragePermissions()\n            {\n                Read = read,\n                Write = write,\n                Delete = delete\n            };\n            using var store = new TestLocalObjectStore();\n            var dir = Path.Combine(TestStorageRoot);\n            Directory.CreateDirectory(dir);\n\n            //Determine filename for key \"Jose\" using Base64\n            var filename = \"Jose\";\n            File.WriteAllText(Path.Combine(dir, filename), \"Pepe\");\n\n            store.Initialize(0, 0, \"\", new Controls { StorageAccess = permissions });\n\n            if (!read)\n            {\n                Assert.Throws<InvalidOperationException>(() => store.ContainsKey(filename));\n            }\n            else\n            {\n                Assert.IsTrue(store.ContainsKey(filename));\n            }\n\n            Directory.Delete(dir, true);\n        }\n\n        [Test]\n        public void PersistCalledSynchronously()\n        {\n            using var store = new TestLocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls\n            {\n                PersistenceIntervalSeconds = -1\n            });\n\n            store.SaveBytes(\"Pepe\", new byte[] { 1 });\n            Assert.AreEqual(1, store.ReadBytes(\"Pepe\").Single());\n            Assert.IsTrue(store.PersistDataCalled);\n\n            store.PersistDataCalled = false;\n\n            store.Delete(\"Pepe\");\n            Assert.IsFalse(File.Exists(Path.Combine(TestStorageRoot, \"Pepe\")));\n            Assert.IsFalse(store.ContainsKey(\"Pepe\"));\n\n            store.DisposeSafely();\n        }\n\n        [Test]\n        public void ThrowsKeyNotFoundException_WhenObjectStoreDoesNotContainKey()\n        {\n            var error = Assert.Throws<KeyNotFoundException>(\n                () => _store.ReadBytes(\"missing.missing\")\n            );\n\n            Assert.IsTrue(error.Message.Contains(\"Please use ObjectStore.ContainsKey(key)\"));\n        }\n\n        [TestCase(\"my_key\", \"./LocalObjectStoreTests/my_key\")]\n        [TestCase(\"test/123\", \"./LocalObjectStoreTests/test/123\")]\n        [TestCase(\"**abc**\", null)]\n        [TestCase(\"<random>\", null)]\n        [TestCase(\"|\", null)]\n        public void GetFilePathReturnsFileName(string key, string expectedRelativePath)\n        {\n            if (expectedRelativePath == null)\n            {\n                Assert.Throws<ArgumentException>(() => _store.GetFilePath(key));\n            }\n            else\n            {\n                var expectedPath = Path.GetFullPath(expectedRelativePath).Replace(\"\\\\\", \"/\");\n                Assert.AreEqual(expectedPath, _store.GetFilePath(key).Replace(\"\\\\\", \"/\"));\n            }\n        }\n\n        [Test]\n        public void SavesAndLoadsText()\n        {\n            const string expectedText = \"12;26\";\n\n            Assert.IsTrue(_store.SaveString(\"my_settings_text\", expectedText));\n\n            var actualText = _store.Read(\"my_settings_text\");\n\n            Assert.AreEqual(expectedText, actualText);\n        }\n\n        [Test]\n        public void SizeLimitIsRespected()\n        {\n            {\n                var validData = new byte[1024 * 1024 * 4];\n                Assert.IsTrue(_store.SaveBytes(\"my_settings_text\", validData));\n            }\n            {\n                var invalidData = new byte[1024 * 1024 * 6];\n                Assert.IsFalse(_store.SaveBytes(\"my_settings_text\", invalidData));\n            }\n            _store.Delete(\"my_settings_text\");\n        }\n\n        [Test]\n        public void SavesAndLoadsJson()\n        {\n            var expected = new TestSettings { EmaFastPeriod = 12, EmaSlowPeriod = 26 };\n\n            Assert.IsTrue(_store.SaveJson(\"my_settings_json\", expected));\n\n            var actual = _store.ReadJson<TestSettings>(\"my_settings_json\");\n\n            Assert.AreEqual(expected.EmaFastPeriod, actual.EmaFastPeriod);\n            Assert.AreEqual(expected.EmaSlowPeriod, actual.EmaSlowPeriod);\n        }\n\n        [Test]\n        public void SavesAndLoadsXml()\n        {\n            var expected = new TestSettings { EmaFastPeriod = 12, EmaSlowPeriod = 26 };\n\n            Assert.IsTrue(_store.SaveXml(\"my_settings_xml\", expected));\n\n            var actual = _store.ReadXml<TestSettings>(\"my_settings_xml\");\n\n            Assert.AreEqual(expected.EmaFastPeriod, actual.EmaFastPeriod);\n            Assert.AreEqual(expected.EmaSlowPeriod, actual.EmaSlowPeriod);\n        }\n\n        [Test]\n        public void ThrowsIfKeyIsNull()\n        {\n            Assert.Throws<ArgumentNullException>(() => _store.ContainsKey(null));\n            Assert.Throws<ArgumentNullException>(() => _store.ReadBytes(null));\n            Assert.Throws<ArgumentNullException>(() => _store.SaveBytes(null, null));\n            Assert.Throws<ArgumentNullException>(() => _store.Delete(null));\n            Assert.Throws<ArgumentNullException>(() => _store.GetFilePath(null));\n        }\n\n        [Test]\n        public void DisposeDoesNotRemovesEmptyStorageFolder()\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls());\n\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n            }\n\n            Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n        }\n\n        [Test]\n        public void DisposeDoesNotErrorWhenStorageFolderAlreadyDeleted()\n        {\n            var testHandler = new QueueLogHandler();\n            Log.LogHandler = testHandler;\n\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls());\n\n                Directory.Delete(\"./LocalObjectStoreTests/\", true);\n            }\n\n            Assert.IsFalse(testHandler.Logs.Any(message =>\n                message.Message.Contains(\"Error deleting storage directory.\")));\n        }\n\n        [Test]\n        public void DisposeDoesNotDeleteStoreFiles()\n        {\n            string path;\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 });\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var validData = new byte[1024 * 1024 * 4];\n                var saved = store.SaveBytes(\"a.txt\", validData);\n                Assert.IsTrue(saved);\n\n                path = store.GetFilePath(\"a.txt\");\n                Assert.IsTrue(File.Exists(path));\n            }\n\n            // Check that it still exists\n            Assert.IsTrue(File.Exists(path));\n        }\n\n        [Test]\n        public void QuantBookObjectStoreBehavior()\n        {\n            // Test for issue #4811, on loop store objects would duplicate\n            for (int i = 0; i < 3; i++)\n            {\n                // Create a QuantBook and save some data\n                var qb = new QuantBook();\n                qb.ObjectStore.Save(\"a.txt\", \"1010101010101010101010\");\n                Assert.IsTrue(qb.ObjectStore.ContainsKey(\"a.txt\"));\n\n                // Assert the store has only a.txt\n                var store = qb.ObjectStore.GetEnumerator().AsEnumerable().ToList();\n                Assert.AreEqual(1, store.Count);\n                // 0 being the project id, default prefix\n                Assert.AreEqual(Path.Combine(\"a.txt\"), store[0].Key);\n\n                // Get the file path and verify it exists\n                var path = qb.ObjectStore.GetFilePath(\"a.txt\");\n                Assert.IsTrue(File.Exists(path));\n\n                Assert.IsTrue(qb.ObjectStore.Delete(\"a.txt\"));\n                Assert.IsFalse(File.Exists(path));\n            }\n        }\n\n        [Test]\n        public void OversizedObject()\n        {\n            // Create a big byte array\n            var bytesToWrite = new byte[7000000];\n\n            // Attempt to save it to local store with 5MB cap\n            Assert.IsFalse(_store.SaveBytes(\"test\", bytesToWrite));\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void TooManyObjects(bool usingObjectStore)\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { StorageLimit = 5 * 1024 * 1024, StorageFileCount = 100 });\n                // Write 100 Files first, should not throw\n                var start = store.Count();\n                for (var i = start; i < 100; i++)\n                {\n                    if (usingObjectStore)\n                    {\n                        Assert.IsTrue(store.SaveBytes($\"{i}\", new byte[1]));\n                    }\n                    else\n                    {\n                        File.WriteAllBytes(Path.Combine(TestStorageRoot, $\"{i}\"), new byte[1]);\n                    }\n                }\n\n                // Write 1 more; should throw\n                Assert.IsFalse(store.SaveBytes(\"breaker\", new byte[1]));\n\n                // cleaup\n                for (var i = start; i < 100; i++)\n                {\n                    Assert.IsTrue(store.Delete($\"{i}\"));\n                }\n            }\n        }\n\n        [Test]\n        public void WriteFromExternalMethodAndSaveFromSource()\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var key = \"Test\";\n                var content = \"Example text\";\n\n                var path = store.GetFilePath(key);\n\n                DummyMachineLearning(path, content);\n                store.Save(key);\n\n                var storeContent = store.Read(key);\n                Assert.AreEqual(content, storeContent);\n            }\n        }\n\n        [TestCase(\"/test/\", \"test\")]\n        [TestCase(\"test\\\\\", \"test\")]\n        [TestCase(\"test\", \"LocalObjectStoreTests\")]\n        [TestCase(\"abc/12 3/test\", \"12 3\")]\n        [TestCase(\"abc\\\\1 23\\\\test\", \"1 23\")]\n        [TestCase(\"/abc\\\\1 23\\\\test\", \"1 23\")]\n        [TestCase(\"\\\\abc\\\\1 23\\\\test\", \"1 23\")]\n        public void GetFilePathMethodWorksProperly(string key, string expectedParentName)\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var path = store.GetFilePath(key);\n                // paths are always under the object store root path\n                Assert.IsTrue(path.Contains(\"LocalObjectStoreTests\", StringComparison.InvariantCultureIgnoreCase));\n                Assert.IsFalse(File.Exists(path));\n                Assert.IsNull(store.Read(key));\n                // the parent of the path requested will be created\n                var parent = Directory.GetParent(path);\n                Assert.AreEqual(expectedParentName, parent.Name);\n                Assert.IsTrue(parent.Exists);\n            }\n        }\n\n        [Test]\n        public void TrySaveKeyWithNotFileAssociated()\n        {\n#pragma warning disable CA2000\n            using (var store = new ObjectStore(new TestLocalObjectStore()))\n            {\n#pragma warning restore CA2000\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 }, AlgorithmMode.Backtesting);\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var key = \"test\";\n                Assert.Throws<ArgumentException>(() => store.Save(key));\n            }\n        }\n\n        [TestCase(1)]\n        [TestCase(0)]\n        public void NewUnregisteredFileIsAvailable(int useCase)\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 });\n\n                // create 'Jose' file in the object store After initialize\n                var joseFile = Path.Combine(TestStorageRoot, \"JoseNew2\");\n                File.WriteAllText(joseFile, \"Pepe\");\n\n                if (useCase == 0)\n                {\n                    Assert.IsTrue(store.ContainsKey(\"JoseNew2\"));\n                }\n                else if (useCase == 1)\n                {\n                    Assert.IsNotNull(store.ReadBytes(\"JoseNew2\"));\n                }\n\n                // clean up\n                File.Delete(joseFile);\n            }\n        }\n\n        [Test]\n        public void NewUnregisteredFileIsNotDeleted()\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 });\n\n                // create 'Jose' file in the object store After initialize\n                var joseFile = Path.Combine(TestStorageRoot, \"JoseNew\");\n                File.WriteAllText(joseFile, \"Pepe\");\n\n                store.SaveBytes(\"a.txt\", new byte[1024 * 4]);\n                Assert.IsTrue(store.ContainsKey(\"a.txt\"));\n\n                Assert.IsTrue(File.Exists(joseFile));\n\n                // clean up\n                store.Delete(\"a.txt\");\n                File.Delete(joseFile);\n            }\n        }\n\n        [Test]\n        public void NewUnregisteredFileCanBeDeleted()\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls() { PersistenceIntervalSeconds = -1 });\n\n                // create 'Jose' file in the object store After initialize\n                var joseFile = Path.Combine(TestStorageRoot, \"JoseNew77\");\n                File.WriteAllText(joseFile, \"Pepe\");\n\n                Assert.IsTrue(File.Exists(joseFile));\n\n                Assert.IsTrue(store.Delete(\"JoseNew77\"));\n\n                Assert.IsFalse(File.Exists(joseFile));\n            }\n        }\n\n        [Test]\n        public void DeletedObjectIsNotReloaded()\n        {\n            using (var store = new TestLocalObjectStore())\n            {\n                store.Initialize(0, 0, \"\", new Controls());\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n\n                var validData = new byte[1024 * 4];\n                store.SaveBytes(\"a.txt\", validData);\n                Assert.IsTrue(store.ContainsKey(\"a.txt\"));\n\n                store.SaveBytes(\"b.txt\", validData);\n                Assert.IsTrue(store.ContainsKey(\"b.txt\"));\n\n                // Assert the store has our two objects\n                var storedObj = store.GetEnumerator().AsEnumerable().ToList();\n                Assert.IsTrue(storedObj.Count == 2);\n\n                // Delete a.txt and close this store down\n                store.Delete(\"a.txt\");\n                Assert.IsFalse(store.ContainsKey(\"a.txt\"));\n            }\n\n            using (var store = new TestLocalObjectStore())\n            {\n                // Check that the dir still exists, it had files so it shouldn't have deleted\n                Assert.IsTrue(Directory.Exists(\"./LocalObjectStoreTests\"));\n                store.Initialize(0, 0, \"\", new Controls());\n\n                // Check our files; a should be gone, b should be there\n                Assert.IsFalse(store.ContainsKey(\"a.txt\"));\n                Assert.IsTrue(store.ContainsKey(\"b.txt\"));\n            }\n        }\n\n        [Test]\n        public void StoragePropertiesAreAccessible()\n        {\n            var controls = new Controls { StorageLimit = 536870912, StorageFileCount = 500 };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(1, 2, \"token\", controls);\n\n            Assert.AreEqual(536870912, store.MaxSize);\n            Assert.AreEqual(500, store.MaxFiles);\n        }\n\n        [Test]\n        public void StoragePropertiesUseDefaultsFromControls()\n        {\n            using var store = new TestLocalObjectStore();\n            store.Initialize(1, 2, \"token\", new Controls());\n\n            Assert.AreEqual(10737418240, store.MaxSize);\n            Assert.AreEqual(10000, store.MaxFiles);\n        }\n\n        [TestCase(1, false)]\n        [TestCase(2, true)]\n        public void SavingFilesRespectsStorageFileCountLimit(int filesToAdd, bool expectedLimitReached)\n        {\n            var controls = new Controls { StorageFileCount = 2, StorageLimit = long.MaxValue };\n            using var store = new TestLocalObjectStore();\n            store.Initialize(1, 2, \"token\", controls);\n\n            for (int i = 0; i < filesToAdd; i++)\n            {\n                store.SaveBytes($\"/file{i}.txt\", new byte[] { 1 });\n            }\n\n            Assert.AreEqual(expectedLimitReached, store.Count() == controls.StorageFileCount);\n\n            // Delete all files\n            for (int i = 0; i < filesToAdd; i++)\n            {\n                store.Delete($\"/file{i}.txt\");\n            }\n        }\n\n        [Test]\n        public void ObjectStoreDelegatesToImplementation()\n        {\n            using var localStore = new TestLocalObjectStore();\n            localStore.Initialize(1, 2, \"token\", new Controls());\n            using var objectStore = new ObjectStore(localStore);\n\n            Assert.AreEqual(localStore.MaxSize, objectStore.MaxSize);\n            Assert.AreEqual(localStore.MaxFiles, objectStore.MaxFiles);\n            Assert.AreEqual(localStore.Count(), objectStore.Count());\n            Assert.AreEqual(localStore.Count() == localStore.MaxFiles, objectStore.Count() == objectStore.MaxFiles);\n        }\n\n        [Test]\n        public void ResearchModeThrowsExceptionAndCapturesErrorWhenObjectStoreLimitIsReached()\n        {\n            var testObjectStore = new LocalObjectStore();\n            testObjectStore.Initialize(1, 1, \"test\", new Controls\n            {\n                StorageFileCount = 2,\n                StorageLimit = 100,\n                PersistenceIntervalSeconds = -1,\n                StorageAccess = new QuantConnect.Packets.StoragePermissions\n                {\n                    Read = true,\n                    Write = true,\n                    Delete = true\n                }\n            }, AlgorithmMode.Research);\n            using (Py.GIL())\n            {\n\n\n                var testModule = PyModule.FromString(\"PythonCustomDataHistoryCanBeFetchedUsingCSharpApi\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef clean_data():\n    qb = QuantBook()\n    for i in range(3):\n        qb.object_store.delete(f'file_{i}.txt')\n\ndef add_data(object_store):\n    qb = QuantBook()\n    qb.SetObjectStore(object_store)\n    \n    max_files = qb.object_store.max_files\n    for i in range(max_files):\n        result = qb.object_store.save(f'file_{i}.txt', f'data_{i}')\n\n    result = qb.object_store.save(f'file_{max_files}.txt', 'should_fail')\n    return result\n\");\n\n                dynamic result = testModule.GetAttr(\"add_data\");\n                var exception = Assert.Catch<Exception>(() => result(testObjectStore));\n                Assert.That(exception.Message, Does.Contain(\"ObjectStore limit\"));\n\n                // Reset\n                testModule.GetAttr(\"clean_data\").Invoke();\n                testObjectStore.Dispose();\n            }\n        }\n\n        private static void DummyMachineLearning(string outputFile, string content)\n        {\n            try\n            {\n                var sw = new StreamWriter(outputFile);\n                sw.Write(content);\n                sw.Close();\n            }\n            catch (Exception e)\n            {\n                throw e;\n            }\n        }\n\n        public class TestSettings\n        {\n            public int EmaFastPeriod { get; set; }\n            public int EmaSlowPeriod { get; set; }\n        }\n\n        private class TestLocalObjectStore : LocalObjectStore\n        {\n            public bool PersistDataCalled { get; set; }\n\n            public override void Initialize(int userId, int projectId, string userToken, Controls controls, AlgorithmMode algorithmMode = AlgorithmMode.Backtesting)\n            {\n                base.Initialize(userId, projectId, userToken, controls, algorithmMode);\n            }\n\n            public void Initialize(int userId, int projectId, string userToken, Controls controls, FileHandler fileHandler)\n            {\n                FileHandler = fileHandler;\n                base.Initialize(userId, projectId, userToken, controls, AlgorithmMode.Backtesting);\n            }\n            protected override bool PersistData()\n            {\n                PersistDataCalled = true;\n                return base.PersistData();\n            }\n            protected override string StorageRoot() => TestStorageRoot;\n        }\n\n        public class TestFileHandler : FileHandler\n        {\n            public override void WriteAllBytes(string path, byte[] data)\n            {\n                // The thread sleeps for 1 second in order to align with the\n                // other thread that will try to delete this file (see SaveAndDelete()\n                // unit test)\n                Thread.Sleep(1000);\n                base.WriteAllBytes(path, data);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/StringExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class StringExtensionsTests\n    {\n        [Test]\n        [TestCase(typeof(string), \"123\", typeof(long), 123L)]\n        [TestCase(typeof(string), \"123\", typeof(int), 123)]\n        [TestCase(typeof(string), \"123\", typeof(decimal), 123)]\n        [TestCase(typeof(long), \"123\", typeof(decimal), 123)]\n        [TestCase(typeof(string), null, typeof(decimal), 0)]\n        public void ConvertInvariant(Type sourceType, string sourceString, Type conversionType, object expected)\n        {\n            // we can't put a decimal in the attribute, so this ensure the runtime types are correct\n            expected = Convert.ChangeType(expected, conversionType, CultureInfo.InvariantCulture);\n            Assert.IsInstanceOf(conversionType, expected);\n\n            var source = Convert.ChangeType(sourceString, sourceType, CultureInfo.InvariantCulture);\n            if (sourceString == null)\n            {\n                Assert.IsNull(source);\n            }\n            else\n            {\n                Assert.IsInstanceOf(sourceType, source);\n            }\n\n            var converted = ((IConvertible)source).ConvertInvariant(conversionType);\n            Assert.AreEqual(expected, converted);\n            Assert.IsInstanceOf(conversionType, converted);\n        }\n\n        [Test]\n        public void ConvertInvariant_ThrowsFormatException_WhenConvertingEmptyString()\n        {\n            const string input = \"\";\n            Assert.Throws<FormatException>(\n                () => input.ConvertInvariant<decimal>()\n            );\n        }\n\n        [Test]\n        public void ConvertInvariantString()\n        {\n            var source = 123L;\n            const string expected = \"123\";\n            var actual = source.ConvertInvariant<string>();\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void Convertible_ToStringInvariant_Equals_ToStringInvariantCulture()\n        {\n            IConvertible convertible = 1;\n            var formatted = convertible.ToStringInvariant();\n            Assert.AreEqual(convertible.ToString(CultureInfo.InvariantCulture), formatted);\n        }\n\n        [Test]\n        public void Formattable_ToStringInvariant_DoesNotRequire_FormatParameter()\n        {\n            var format = (string) null;\n            IFormattable formattable = 1;\n            var formatted = formattable.ToStringInvariant(format);\n            Assert.AreEqual(formattable.ToString(format, CultureInfo.InvariantCulture), formatted);\n        }\n\n        [Test]\n        [TestCase(TypeCode.DateTime, \"07/28/2019\", \"yyyy-MM-dd\")]\n        public void Formattable_ToStringInvariant_UsesProvided_FormatParameter(\n            TypeCode typeCode,\n            string value,\n            string format\n            )\n        {\n            var formattable = (IFormattable) Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture);\n            var formatted = formattable.ToStringInvariant(format);\n            var expected = formattable.ToString(format, CultureInfo.InvariantCulture);\n            Assert.AreEqual(expected, formatted, $\"Failed on type code: {typeCode}\");\n        }\n\n        [Test]\n        public void Formattable_ToStringInvariant_RespectsFieldWidth_InFormatParameter()\n        {\n            // BEHAVIOR CHANGE --\n            var value = 5.678m;\n            var format = \"-20:P2\";\n            var sameBehavior = $\"{value,-20:P2}\";\n            var expected = string.Format(CultureInfo.InvariantCulture, \"{0,-20:P2}\", value);\n\n            // the usage of the InvariantCulture add a space between the number of the percent sign\n            //Assert.AreEqual(\"567.80%            \", sameBehavior); // this passes in windows but failed in travis\n            Assert.AreEqual(\"567.80 %            \", expected);\n\n            var actual = value.ToStringInvariant(format);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void StartsWithInvariant_IsTheSameAs_StartsWith_WithInvariantCulture_DefaultingToCaseSensitive()\n        {\n            var str = \"aBcD\";\n            var beginning = \"aB\";\n            Assert.IsTrue(str.StartsWithInvariant(beginning));\n\n            beginning = \"AB\";\n            Assert.IsFalse(str.StartsWithInvariant(beginning));\n            Assert.IsTrue(str.StartsWithInvariant(beginning, ignoreCase: true));\n        }\n\n        [Test]\n        public void EndsWithInvariant_IsTheSameAs_EndsWith_WithInvariantCulture_DefaultingToCaseSensitive()\n        {\n            var str = \"aBcD\";\n            var ending = \"cD\";\n            Assert.IsTrue(str.EndsWithInvariant(ending));\n\n            ending = \"CD\";\n            Assert.IsFalse(str.EndsWithInvariant(ending));\n            Assert.IsTrue(str.EndsWithInvariant(ending, ignoreCase: true));\n        }\n\n        [Test]\n        public void ToIso8601Invariant_IsTheSameAs_ToString_O_WithInvariantCulture()\n        {\n            var date = DateTime.UtcNow;\n            var expected = date.ToString(\"O\", CultureInfo.InvariantCulture);\n            var actual = date.ToIso8601Invariant();\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void IndexOfInvariant_IsTheSameAs_IndexOf_WithStringComparisonInvariantCulture(bool ignoreCase)\n        {\n            var comparison = ignoreCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture;\n            var str = \"abcdefg\";\n            var substring1 = \"de\";\n            var expected1 = str.IndexOf(substring1, comparison);\n            var actual1 = str.IndexOfInvariant(substring1, ignoreCase);\n            Assert.AreEqual(expected1, actual1);\n\n            var substring2 = \"dE\";\n            var expected2 = str.IndexOf(substring2, comparison);\n            var actual2 = str.IndexOfInvariant(substring2, ignoreCase);\n            Assert.AreEqual(expected2, actual2);\n        }\n\n        [Test]\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void IfNotNullOrEmpty_ReturnsSpecifiedDefaultValue_WhenNullOrEmpty(string str)\n        {\n            int defaultValue = 42;\n            var actual = str.IfNotNullOrEmpty(defaultValue, int.Parse);\n            Assert.AreEqual(defaultValue, actual);\n        }\n\n        [Test]\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void IfNotNullOrEmpty_ReturnsDefaultValue_WhenNullOrEmpty(string str)\n        {\n            var actual = str.IfNotNullOrEmpty(int.Parse);\n            Assert.AreEqual(default(int), actual);\n        }\n\n        [Test]\n        public void IfNotNullOrEmpty_ReturnsResultOfFunc_WhenNotEmpty()\n        {\n            var actual = \"42\".IfNotNullOrEmpty(int.Parse);\n            Assert.AreEqual(42, actual);\n        }\n\n        [Test]\n        public void IfNotNullOrEmpty_ReturnsResultOfFunc_WhenNotEmptyAndDefaultValueSpecified()\n        {\n            var defaultValue = -42;\n            var actual = \"42\".IfNotNullOrEmpty(defaultValue, int.Parse);\n            Assert.AreEqual(42, actual);\n        }\n\n        [Test]\n        [TestCase(null, 0, 9)]\n        [TestCase(\"Test Data\", 0, 9)]\n        [TestCase(\"Test Data\", 0, 5)]\n        [TestCase(\"Test Data\", 5, 4)]\n        [TestCase(\"Test Data\", 8, 0)]\n        public void SafeSubstring_ReturnsProperSubstring(string sourceString, int startIndex,  int length)\n        {\n            Assert.AreEqual(sourceString?.Substring(startIndex, length), sourceString.SafeSubstring(startIndex, length));\n        }\n\n        [Test]\n        [TestCase(null, 0, 9, null)]\n        [TestCase(\"Test Data\", 0, 15, \"Test Data\")]\n        [TestCase(\"Test Data\", 5, 15, \"Data\")]\n        [TestCase(\"Test Data\", 9, 15, \"\")]\n        public void SafeSubstring_ReturnsSubstring_WhenSubstringThrowException(string sourceString, int startIndex, int length, string expected)\n        {\n            if (sourceString != null)\n            {\n                Assert.Throws<ArgumentOutOfRangeException>(() =>\n                {\n                    sourceString.Substring(startIndex, length);\n                });\n            }\n            Assert.AreEqual(expected, sourceString.SafeSubstring(startIndex, length));\n        }\n\n        [TestCase(\"test input\")]\n        [TestCase(\"[ asdd[ \\\" 12344 :::}\")]\n        public void EncodeDecode64String(string input)\n        {\n            var encoded = input.EncodeBase64();\n            var decoded = encoded.DecodeBase64();\n\n            Assert.AreEqual(input, decoded);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SymbolCacheTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing Bitcoin = QuantConnect.Algorithm.CSharp.LiveTradingFeaturesAlgorithm.Bitcoin;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SymbolCacheTests\n    {\n        [SetUp]\n        public void Setup()\n        {\n            // always start fresh\n            SymbolCache.Clear();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            // clean up any lingering mess\n            SymbolCache.Clear();\n        }\n\n        [Test]\n        public void HandlesRoundTripAccessSymbolToTicker()\n        {\n            var ticker = \"ticker\";\n            SymbolCache.Set(ticker, Symbols.EURUSD);\n            var actual = SymbolCache.GetSymbol(ticker);\n            Assert.AreEqual(Symbols.EURUSD, actual);\n        }\n\n        [Test]\n        public void HandlesRoundTripAccessTickerToSymbol()\n        {\n            var expected = \"ticker\";\n            expected = Symbols.EURUSD.Value;\n            SymbolCache.Set(expected, Symbols.EURUSD);\n            var actual = SymbolCache.GetTicker(Symbols.EURUSD);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Base)]\n        [TestCase(SecurityType.Cfd)]\n        //[TestCase(SecurityType.Commodity)]\n        [TestCase(SecurityType.Crypto)]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Forex)]\n        [TestCase(SecurityType.Future)]\n        [TestCase(SecurityType.Option)]\n        public void GetSymbol_ReturnsSymbolMappedByTicker_WhenExactlyOneMatch(SecurityType securityType)\n        {\n            var ticker = \"ticker\";\n            var symbol = Symbol.Create(ticker, securityType, Market.USA);\n            SymbolCache.Set(ticker, symbol);\n            Assert.AreEqual(symbol, SymbolCache.GetSymbol(ticker));\n        }\n\n        [Test]\n        public void GetSymbol_ThrowsInvalidOperationException_WhenNoMatches()\n        {\n            Assert.Throws<InvalidOperationException>(\n                // make random string guaranteed to not exist\n                () => SymbolCache.GetSymbol(Guid.NewGuid().ToString())\n            );\n        }\n\n        [Test]\n        public void GetSymbol_ThrowsInvalidOperation_WhenTooManyCustomDataSymbolMatches()\n        {\n            // SID.GenerateBase uses <ticker>.<base-data-type-name> as the alias for custom data types\n            var ticker = \"ticker\";\n\n            var symbol1 = Symbol.Create(ticker, SecurityType.Base, Market.USA, baseDataType: typeof(UnlinkedData));\n            SymbolCache.Set(symbol1.ID.Symbol, symbol1);\n\n            var symbol2 = Symbol.Create(ticker, SecurityType.Base, Market.USA, baseDataType: typeof(UnlinkedDataTradeBar));\n            SymbolCache.Set(symbol2.ID.Symbol, symbol2);\n\n            Assert.Throws<InvalidOperationException>(\n                () => SymbolCache.GetSymbol(ticker)\n            );\n        }\n\n        [Test]\n        public void TryGetSymbol()\n        {\n            SymbolCache.Set(\"EURUSD\", Symbols.EURUSD);\n\n            Symbol actual;\n            Assert.IsTrue(SymbolCache.TryGetSymbol(\"EURUSD\", out actual));\n            Assert.AreEqual(Symbols.EURUSD, actual);\n\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"EURUSD1\", out actual));\n            Assert.AreEqual(default(Symbol), actual);\n        }\n\n        [Test]\n        public void TryGetTicker()\n        {\n            SymbolCache.Set(\"EURUSD\", Symbols.EURUSD);\n\n            string ticker;\n            Assert.IsTrue(SymbolCache.TryGetTicker(Symbols.EURUSD, out ticker));\n            Assert.AreEqual(Symbols.EURUSD.Value, ticker);\n\n            var symbol = new Symbol(SecurityIdentifier.GenerateForex(\"NOT-A-FOREX-PAIR\", Market.FXCM), \"EURGBP\");\n            Assert.IsFalse(SymbolCache.TryGetTicker(symbol, out ticker));\n            Assert.AreEqual(default(string), ticker);\n        }\n\n        [Test]\n        public void TryGetSymbolFromSidString()\n        {\n            var sid = Symbols.EURUSD.ID.ToString();\n            var symbol = SymbolCache.GetSymbol(sid);\n            Assert.AreEqual(Symbols.EURUSD, symbol);\n        }\n\n        [Test]\n        public void TryGetTickerFromUncachedSymbol()\n        {\n            var symbol = Symbol.Create(\"My-Ticker\", SecurityType.Equity, Market.USA);\n            var ticker = SymbolCache.GetTicker(symbol);\n            Assert.AreEqual(symbol.ID.ToString(), ticker);\n        }\n\n        [Test]\n        public void TryGetSymbol_FromTicker_WithConflictingSymbolWithCustomDataSuffix()\n        {\n            var ticker = \"My-Ticker\";\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            SymbolCache.Set(ticker, symbol);\n\n            var customTicker = $\"{ticker}.CustomDataTypeName\";\n            var customSymbol = Symbol.Create(customTicker, SecurityType.Base, Market.USA, baseDataType: typeof(Bitcoin));\n            SymbolCache.Set(customTicker, customSymbol);\n\n            Symbol fetchedSymbol;\n            Assert.IsTrue(SymbolCache.TryGetSymbol(ticker, out fetchedSymbol));\n            Assert.AreEqual(symbol, fetchedSymbol);\n\n            Symbol fetchedCustomSymbol;\n            Assert.IsTrue(SymbolCache.TryGetSymbol(customTicker, out fetchedCustomSymbol));\n            Assert.AreEqual(customSymbol, fetchedCustomSymbol);\n        }\n\n        [Test]\n        public void TryGetSymbol_FromTicker_CacheMissDoesNotStick()\n        {\n            var ticker = \"My-Ticker\";\n            Assert.IsFalse(SymbolCache.TryGetSymbol(ticker, out var _));\n\n            var customTicker = $\"{ticker}.CustomDataTypeName\";\n            var customSymbol = Symbol.Create(customTicker, SecurityType.Base, Market.USA, baseDataType: typeof(Bitcoin));\n            SymbolCache.Set(customTicker, customSymbol);\n\n            Assert.IsTrue(SymbolCache.TryGetSymbol(ticker, out var fetchedSymbol));\n            Assert.AreEqual(customSymbol, fetchedSymbol);\n\n            Assert.IsTrue(SymbolCache.TryGetSymbol(customTicker, out var fetchedCustomSymbol));\n            Assert.AreEqual(customSymbol, fetchedCustomSymbol);\n\n            // now we set symbol\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            SymbolCache.Set(ticker, symbol);\n            Assert.IsTrue(SymbolCache.TryGetSymbol(ticker, out var equitySymbol));\n            Assert.AreEqual(symbol, equitySymbol);\n\n            Assert.IsTrue(SymbolCache.TryGetSymbol(customTicker, out fetchedCustomSymbol));\n            Assert.AreEqual(customSymbol, fetchedCustomSymbol);\n        }\n\n        [Test]\n        public void TryGetSymbol_FromTicker_WithoutCustomDataSuffix()\n        {\n            var ticker = \"My-Ticker\";\n            var symbol = Symbol.Create(ticker, SecurityType.Base, Market.USA, baseDataType: typeof(Bitcoin));\n\n            // alias is the SID's symbol of the form: <symbol>.<type>\n            var alias = symbol.ID.Symbol;\n            SymbolCache.Set(alias, symbol);\n\n            Symbol fetchedSymbol;\n            Assert.IsTrue(SymbolCache.TryGetSymbol(ticker, out fetchedSymbol));\n            Assert.AreEqual(symbol, fetchedSymbol);\n        }\n\n        [Test]\n        public void TryRemoveSymbolRemovesSymbolMappings()\n        {\n            string ticker;\n            Symbol symbol;\n            SymbolCache.Set(\"SPY\", Symbols.SPY);\n            Assert.IsTrue(SymbolCache.TryRemove(Symbols.SPY));\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"SPY\", out symbol));\n            Assert.IsFalse(SymbolCache.TryGetTicker(Symbols.SPY, out ticker));\n        }\n\n        [Test]\n        public void TryRemoveTickerRemovesSymbolMappings()\n        {\n            string ticker;\n            Symbol symbol;\n            SymbolCache.Set(\"SPY\", Symbols.SPY);\n            Assert.IsTrue(SymbolCache.TryRemove(\"SPY\"));\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"SPY\", out symbol));\n            Assert.IsFalse(SymbolCache.TryGetTicker(Symbols.SPY, out ticker));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SymbolJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SymbolJsonConverterTests\n    {\n        private JsonSerializerSettings Settings = new JsonSerializerSettings\n        {\n            TypeNameHandling = TypeNameHandling.All\n        };\n\n        [Test]\n        public void SurvivesRoundtripSerialization()\n        {\n            var sid = SecurityIdentifier.GenerateEquity(\"SPY\", Market.USA);\n            var expected = new Symbol(sid, \"value\");\n            var json = JsonConvert.SerializeObject(expected, Settings);\n            var actual = JsonConvert.DeserializeObject<Symbol>(json, Settings);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void SurvivesRoundtripSerializationOption()\n        {\n            var expected = Symbol.CreateOption(\"XLRE\", Market.USA, OptionStyle.American, OptionRight.Call, 21m, new DateTime(2016, 08, 19));\n\n            var json = JsonConvert.SerializeObject(expected, Settings);\n            var actual = JsonConvert.DeserializeObject<Symbol>(json, Settings);\n            Assert.AreEqual(expected, actual);\n\n            Assert.AreEqual(expected.ID, actual.ID);\n            Assert.AreEqual(expected.Value, actual.Value);\n            Assert.AreEqual(expected.ID.Date, actual.ID.Date);\n            Assert.AreEqual(expected.ID.StrikePrice, actual.ID.StrikePrice);\n            Assert.AreEqual(expected.ID.OptionRight, actual.ID.OptionRight);\n            Assert.AreEqual(expected.ID.OptionStyle, actual.ID.OptionStyle);\n\n            Assert.AreEqual(expected.Underlying.ID, actual.Underlying.ID);\n            Assert.AreEqual(expected.Underlying.Value, actual.Underlying.Value);\n        }\n\n        [Test]\n        public void SurvivesRoundtripSerializationCanonicalOption()\n        {\n            var expected = Symbol.Create(\"SPY\", SecurityType.Option, Market.USA);\n\n            var json = JsonConvert.SerializeObject(expected, Settings);\n            var actual = JsonConvert.DeserializeObject<Symbol>(json, Settings);\n            Assert.AreEqual(expected, actual);\n\n            Assert.AreEqual(SecurityIdentifier.DefaultDate, actual.ID.Date);\n            Assert.AreEqual(0m, actual.ID.StrikePrice);\n            Assert.AreEqual(default(OptionRight), actual.ID.OptionRight);\n            Assert.AreEqual(default(OptionStyle), actual.ID.OptionStyle);\n            Assert.AreNotEqual(default(Symbol), actual.Underlying);\n        }\n\n        [Test]\n        public void SurvivesRoundtripSerializationWithTypeNameHandling()\n        {\n            var sid = SecurityIdentifier.GenerateEquity(\"SPY\", Market.USA);\n            var expected = new Symbol(sid, \"value\");\n            var json = JsonConvert.SerializeObject(expected, Settings);\n            var actual = JsonConvert.DeserializeObject<Symbol>(json);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void HandlesListTicks()\n        {\n            const string json = @\"{'$type':'System.Collections.Generic.List`1[[QuantConnect.Data.BaseData, QuantConnect.Common]], mscorlib',\n'$values':[{'$type':'QuantConnect.Data.Market.Tick, QuantConnect.Common',\n'TickType':0,'Quantity':1,'Exchange':'',\n'SaleCondition':'',\n'Suspicious':false,'BidPrice':0.72722,'AskPrice':0.7278,'BidSize':0,'AskSize':0,'LastPrice':0.72722,'DataType':2,'IsFillForward':false,'Time':'2015-09-18T16:52:37.379',\n'EndTime':'2015-09-18T16:52:37.379',\n'Symbol':{'$type':'QuantConnect.Symbol, QuantConnect.Common',\n'Value':'EURGBP',\n'ID':'EURGBP 5O'},'Value':0.72722,'Price':0.72722}]}\";\n\n            var expected = new Symbol(SecurityIdentifier.GenerateForex(\"EURGBP\", Market.FXCM), \"EURGBP\");\n            var settings = Settings;\n            var actual = JsonConvert.DeserializeObject<List<BaseData>>(json, settings);\n            Assert.AreEqual(expected, actual[0].Symbol);\n        }\n\n        [Test]\n        public void HandlesListTicksWithDifferentSymbols()\n        {\n            // the first serialized Tick object has a Symbol of EURGBP and the second has EURUSD, but the output\n            const string json =\n                \"{'$type':'System.Collections.Generic.List`1[[QuantConnect.Data.BaseData, QuantConnect.Common]], mscorlib','$values':[\" +\n\n                    \"{'$type':'QuantConnect.Data.Market.Tick, QuantConnect.Common',\" +\n                    \"'TickType':0,'Quantity':1,'Exchange':'','SaleCondition':'','Suspicious':false,\" +\n                    \"'BidPrice':1.11895,'AskPrice':1.11898,'LastPrice':1.11895,'DataType':2,'IsFillForward':false,\" +\n                    \"'Time':'2015-09-22T01:26:44.676','EndTime':'2015-09-22T01:26:44.676',\" +\n                    \"'Symbol':{'$type':'QuantConnect.Symbol, QuantConnect.Common','Value':'EURUSD', 'ID': 'EURUSD 5O'},\" +\n                    \"'Value':1.11895,'Price':1.11895},\" +\n\n                    \"{'$type':'QuantConnect.Data.Market.Tick, QuantConnect.Common',\" +\n                    \"'TickType':0,'Quantity':1,'Exchange':'','SaleCondition':'','Suspicious':false,\" +\n                    \"'BidPrice':0.72157,'AskPrice':0.72162,'LastPrice':0.72157,'DataType':2,'IsFillForward':false,\" +\n                    \"'Time':'2015-09-22T01:26:44.675','EndTime':'2015-09-22T01:26:44.675',\" +\n                    \"'Symbol':{'$type':'QuantConnect.Symbol, QuantConnect.Common','Value':'EURGBP', 'ID': 'EURGBP 5O'},\" +\n                    \"'Value':0.72157,'Price':0.72157},\" +\n\n                    \"]}\";\n\n            var actual = JsonConvert.DeserializeObject<List<BaseData>>(json, Settings);\n            Assert.IsFalse(actual.All(x => x.Symbol == new Symbol(SecurityIdentifier.GenerateForex(\"EURUSD\", Market.FXCM), \"EURUSD\")));\n        }\n\n        [TestCaseSource(nameof(TestSymbols))]\n        public void CamelCaseSymbolIsDeserializedCorrectly(string json, string value, string id, SecurityType securityType, Symbol underlying)\n        {\n            var deserializedSymbol = JsonConvert.DeserializeObject<Symbol>(json, Settings);\n            Assert.AreEqual(value, deserializedSymbol.Value);\n            Assert.AreEqual(id, deserializedSymbol.ID.ToString());\n            Assert.AreEqual(securityType, deserializedSymbol.SecurityType);\n            Assert.AreEqual(underlying, deserializedSymbol.Underlying);\n        }\n\n        [Test]\n        public void TickRoundTrip()\n        {\n            var tick = new Tick\n            {\n                Symbol = Symbols.EURGBP,\n                AskPrice = 1,\n                Time = DateTime.Now,\n                Exchange = \"\",\n                Value = 2,\n                EndTime = DateTime.Now,\n                Quantity = 1,\n                BidPrice = 2,\n                SaleCondition = \"\"\n            };\n            var json = JsonConvert.SerializeObject(tick, Settings);\n            var actual = JsonConvert.DeserializeObject<Tick>(json, Settings);\n            Assert.AreEqual(tick.Symbol, actual.Symbol);\n\n            json = JsonConvert.SerializeObject(tick, Settings);\n            actual = JsonConvert.DeserializeObject<Tick>(json);\n            Assert.AreEqual(tick.Symbol, actual.Symbol);\n        }\n\n        [Test]\n        public void BackwardsCompatibleJson()\n        {\n            var symbol = new Symbol(SecurityIdentifier.GenerateForex(\"a\", Market.FXCM), \"a\");\n            var json = JsonConvert.SerializeObject(symbol, new JsonSerializerSettings { Formatting = Formatting.Indented, TypeNameHandling = TypeNameHandling.All });\n            var oldSymbol = JsonConvert.DeserializeObject<OldSymbol>(json);\n            Assert.AreEqual(\"A\", oldSymbol.Value);\n            Assert.AreEqual(\"A\", oldSymbol.Permtick);\n        }\n\n        [TestCase(\"{\\\"value\\\":\\\"Fb    210618c00322500\\\",\\\"type\\\":\\\"2\\\"}\", SecurityType.Option, \"FB\", \"FB\", OptionRight.Call, OptionStyle.American, 2021)]\n        [TestCase(\"{\\\"value\\\":\\\"aapl  210618C00129000\\\",\\\"type\\\":\\\"2\\\"}\", SecurityType.Option, \"AAPL\", \"AAPL\", OptionRight.Call, OptionStyle.American, 2021)]\n\n        [TestCase(\"{\\\"value\\\":\\\"OGV1 C2040\\\",\\\"type\\\":\\\"8\\\"}\", SecurityType.FutureOption, \"GC\", \"OG\", OptionRight.Call, OptionStyle.American, 2021)]\n        [TestCase(\"{\\\"value\\\":\\\"ESZ30 C3505\\\",\\\"type\\\":\\\"8\\\"}\", SecurityType.FutureOption, \"ES\", \"ES\", OptionRight.Call, OptionStyle.American, 2030)]\n        [TestCase(\"{\\\"value\\\":\\\"SPXW  210618C04165000\\\",\\\"type\\\":\\\"10\\\"}\", SecurityType.IndexOption, \"SPX\", \"SPXW\", OptionRight.Call, OptionStyle.American, 2021)]\n        public void OptionUserFriendlyDeserialization(string jsonValue, SecurityType type, string underlying, string option, OptionRight optionRight, OptionStyle optionStyle, int expirationYear)\n        {\n            var symbol = JsonConvert.DeserializeObject<Symbol>(jsonValue);\n\n            Assert.IsNotNull(symbol);\n            Assert.AreEqual(type, symbol.SecurityType);\n            Assert.AreEqual(option, symbol.ID.Symbol);\n            Assert.AreEqual(underlying, symbol.ID.Underlying.Symbol);\n            Assert.AreEqual(optionRight, symbol.ID.OptionRight);\n            Assert.AreEqual(optionStyle, symbol.ID.OptionStyle);\n            Assert.AreEqual(expirationYear, symbol.ID.Date.Year);\n        }\n\n        [TestCase(\"{\\\"value\\\":\\\"GCV1\\\",\\\"type\\\":\\\"5\\\"}\", SecurityType.Future, \"GC\", 10, Market.COMEX)]\n        [TestCase(\"{\\\"value\\\":\\\"ESZ1\\\",\\\"type\\\":\\\"5\\\"}\", SecurityType.Future, \"ES\", 12, Market.CME)]\n        public void FutureUserFriendlyDeserialization(string jsonValue, SecurityType type, string symbolId, int month, string market)\n        {\n            var symbol = JsonConvert.DeserializeObject<Symbol>(jsonValue);\n\n            Assert.IsNotNull(symbol);\n            Assert.AreEqual(type, symbol.SecurityType);\n            Assert.AreEqual(symbolId, symbol.ID.Symbol);\n            Assert.AreEqual(month, symbol.ID.Date.Month);\n            Assert.AreEqual(market, symbol.ID.Market);\n        }\n\n        [TestCase(\"{\\\"value\\\":\\\"fb\\\",\\\"type\\\":\\\"1\\\"}\", SecurityType.Equity, \"FB\", Market.USA)]\n        [TestCase(\"{\\\"value\\\":\\\"AAPL\\\",\\\"type\\\":\\\"1\\\"}\", SecurityType.Equity, \"AAPL\", Market.USA)]\n\n        [TestCase(\"{\\\"value\\\":\\\"BTCUSD\\\",\\\"type\\\":\\\"7\\\",\\\"market\\\":\\\"coinbase\\\"}\", SecurityType.Crypto, \"BTCUSD\", Market.Coinbase)]\n        [TestCase(\"{\\\"value\\\":\\\"BTCUSD\\\",\\\"type\\\":\\\"7\\\",\\\"market\\\":\\\"binance\\\"}\", SecurityType.Crypto, \"BTCUSD\", Market.Binance)]\n\n        [TestCase(\"{\\\"value\\\":\\\"xauusd\\\",\\\"type\\\":\\\"6\\\",\\\"market\\\":\\\"oanda\\\"}\", SecurityType.Cfd, \"XAUUSD\", Market.Oanda)]\n\n        [TestCase(\"{\\\"value\\\":\\\"eurusd\\\",\\\"type\\\":\\\"4\\\",\\\"market\\\":\\\"oanda\\\"}\", SecurityType.Forex, \"EURUSD\", Market.Oanda)]\n        public void UserFriendlyDeserialization(string jsonValue, SecurityType type, string symbolTicker, string market)\n        {\n            var symbol = JsonConvert.DeserializeObject<Symbol>(jsonValue);\n\n            Assert.IsNotNull(symbol);\n            Assert.AreEqual(type, symbol.SecurityType);\n            Assert.AreEqual(symbolTicker, symbol.ID.Symbol);\n            Assert.AreEqual(market, symbol.ID.Market);\n        }\n\n        public static object[] TestSymbols =\n        {\n            new object[] { @\"{\n\t\t\t\t\"\"value\"\": \"\"AAPL  140613P00660000\"\",\n\t\t\t\t\"\"id\"\": \"\"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\"\",\n\t\t\t\t\"\"permtick\"\": \"\"AAPL  140613P00660000\"\",\n\t\t\t\t\"\"underlying\"\": {\n\t\t\t\t\t\"\"value\"\": \"\"AAPL\"\",\n\t\t\t\t\t\"\"id\"\": \"\"AAPL R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"permtick\"\": \"\"AAPL\"\"\n\t\t\t\t}\n\t\t\t}\", \"AAPL  140613P00660000\", \"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\", SecurityType.Option, Symbols.AAPL },\n            new object[] { @\"{\n                \"\"value\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"id\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n                \"\"permtick\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"underlying\"\": {\n                    \"\"value\"\": \"\"GOOG\"\",\n                    \"\"id\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n                    \"\"permtick\"\": \"\"GOOG\"\"\n                }\n            }\", \"GOOG  160115C00750000\", \"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\", SecurityType.Option, Symbols.GOOG },\n            new object[] { @\"{\n                \"\"value\"\": \"\"SPY\"\",\n                \"\"id\"\": \"\"SPY R735QTJ8XC9X\"\",\n                \"\"permtick\"\": \"\"SPY\"\"\n            }\", \"SPY\", \"SPY R735QTJ8XC9X\", SecurityType.Equity, null },\n            new object[] { @\"{\n\t\t\t\t\"\"Value\"\": \"\"AAPL  140613P00660000\"\",\n\t\t\t\t\"\"ID\"\": \"\"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\"\",\n\t\t\t\t\"\"Permtick\"\": \"\"AAPL  140613P00660000\"\",\n\t\t\t\t\"\"Underlying\"\": {\n\t\t\t\t\t\"\"value\"\": \"\"AAPL\"\",\n\t\t\t\t\t\"\"id\"\": \"\"AAPL R735QTJ8XC9X\"\",\n\t\t\t\t\t\"\"permtick\"\": \"\"AAPL\"\"\n\t\t\t\t}\n\t\t\t}\", \"AAPL  140613P00660000\", \"AAPL 2ZQGWTST4Z8NA|AAPL R735QTJ8XC9X\", SecurityType.Option, Symbols.AAPL },\n            new object[] { @\"{\n                \"\"Value\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"ID\"\": \"\"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\"\",\n                \"\"Permtick\"\": \"\"GOOG  160115C00750000\"\",\n                \"\"Underlying\"\": {\n                    \"\"value\"\": \"\"GOOG\"\",\n                    \"\"id\"\": \"\"GOOCV VP83T1ZUHROL\"\",\n                    \"\"permtick\"\": \"\"GOOG\"\"\n                }\n            }\", \"GOOG  160115C00750000\", \"GOOCV W78ZEOEHV29Y|GOOCV VP83T1ZUHROL\", SecurityType.Option, Symbols.GOOG },\n            new object[] { @\"{\n                \"\"Value\"\": \"\"SPY\"\",\n                \"\"ID\"\": \"\"SPY R735QTJ8XC9X\"\",\n                \"\"Permtick\"\": \"\"SPY\"\"\n            }\", \"SPY\", \"SPY R735QTJ8XC9X\", SecurityType.Equity, null }\n        };\n\n        class OldSymbol\n        {\n            public string Value { get; set; }\n            public string Permtick { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SymbolRepresentationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing Python.Runtime;\nusing System.Globalization;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SymbolRepresentationTests\n    {\n        [Test]\n        public void OptionSymbolAliasMatchesOSI()\n        {\n            const string expected = @\"MSFT  060318C00047500\";\n            var result = SymbolRepresentation.GenerateOptionTickerOSI(\"MSFT\", OptionRight.Call, 47.50m, new DateTime(2006, 03, 18));\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(\"SPXW  230111C02400000\", SecurityType.IndexOption, OptionStyle.European, \"SPXW\", \"SPX\", \"SPX\", 2400.00, \"2023-01-11\")]\n        [TestCase(\"SPY   230111C02400000\", SecurityType.Option, OptionStyle.American, \"SPY\", \"SPY\", \"SPY\", 2400.00, \"2023-01-11\")]\n        [TestCase(\"GOOG  160318C00320000\", SecurityType.Option, OptionStyle.American, \"GOOCV\", \"GOOCV\", \"GOOG\", 320.00, \"2016-03-18\")]\n        [TestCase(\"AAPL240614C00100000\", SecurityType.Option, OptionStyle.American, \"AAPL\", \"AAPL\", \"AAPL\", 100.00, \"2024-06-14\")]\n        [TestCase(\"MSFT240614C00150000\", SecurityType.Option, OptionStyle.American, \"MSFT\", \"MSFT\", \"MSFT\", 150.00, \"2024-06-14\")]\n        [TestCase(\"AMZN  220630C01000000\", SecurityType.Option, OptionStyle.American, \"AMZN\", \"AMZN\", \"AMZN\", 1000.00, \"2022-06-30\")]\n        [TestCase(\"NFLX  230122P00250000\", SecurityType.Option, OptionStyle.American, \"NFLX\", \"NFLX\", \"NFLX\", 250.00, \"2023-01-22\")]\n        [TestCase(\"TSLA  240815C00775000\", SecurityType.Option, OptionStyle.American, \"TSLA\", \"TSLA\", \"TSLA\", 775.00, \"2024-08-15\")]\n        [TestCase(\"V     231211P00220000\", SecurityType.Option, OptionStyle.American, \"V\", \"V\", \"V\", 220.00, \"2023-12-11\")]\n        [TestCase(\"JPM   240501C00130750\", SecurityType.Option, OptionStyle.American, \"JPM\", \"JPM\", \"JPM\", 130.75, \"2024-05-01\")]\n        [TestCase(\"IBM   250212P00145000\", SecurityType.Option, OptionStyle.American, \"IBM\", \"IBM\", \"IBM\", 145.00, \"2025-02-12\")]\n        [TestCase(\"DIS   230630C00075000\", SecurityType.Option, OptionStyle.American, \"DIS\", \"DIS\", \"DIS\", 75.00, \"2023-06-30\")]\n        [TestCase(\"ORCL  231030C00065000\", SecurityType.Option, OptionStyle.American, \"ORCL\", \"ORCL\", \"ORCL\", 65.00, \"2023-10-30\")]\n        [TestCase(\"CSCO  230501P00045000\", SecurityType.Option, OptionStyle.American, \"CSCO\", \"CSCO\", \"CSCO\", 45.00, \"2023-05-01\")]\n        [TestCase(\"DAX   250715C01000000\", SecurityType.IndexOption, OptionStyle.European, \"DAX\", \"DAX\", \"DAX\", 1000.00, \"2025-07-15\")]\n        [TestCase(\"FTSE  230122C00750000\", SecurityType.IndexOption, OptionStyle.European, \"FTSE\", \"FTSE\", \"FTSE\", 750.00, \"2023-01-22\")]\n        [TestCase(\"ES20H20  200320P03290000\", SecurityType.FutureOption, OptionStyle.American, \"ES20H20\", \"ES\", \"ES20H20\", 3290.00, \"2020-03-20\")]\n        public void ParseOptionTickerOSI(string optionStr, SecurityType securityType, OptionStyle optionStyle,\n            string expectedTargetOptionTicker, string expectedUnderlyingTicker, string expectedUnderlyingMappedTicker,\n            decimal expectedStrikePrice, string expectedDate)\n        {\n            var result = SymbolRepresentation.ParseOptionTickerOSI(optionStr, securityType, optionStyle, Market.USA);\n\n            Assert.AreEqual(expectedTargetOptionTicker, result.ID.Symbol);\n            Assert.AreEqual(optionStr, result.Value);\n            Assert.AreEqual(expectedUnderlyingTicker, result.Underlying.ID.Symbol);\n            Assert.AreEqual(expectedUnderlyingMappedTicker, result.Underlying.Value);\n            Assert.AreEqual(securityType, result.ID.SecurityType);\n            Assert.AreEqual(optionStyle, result.ID.OptionStyle);\n            Assert.AreEqual(expectedStrikePrice, result.ID.StrikePrice);\n            Assert.AreEqual(DateTime.ParseExact(expectedDate, \"yyyy-MM-dd\", CultureInfo.InvariantCulture), result.ID.Date);\n        }\n\n        [Test]\n        public void OptionSymbolAliasAddsPaddingSpaceForSixOrMoreCharacterSymbols()\n        {\n            const string expected = @\"ABCDEF 060318C00047500\";\n            var symbol = SymbolRepresentation.GenerateOptionTickerOSI(\"ABCDEF\", OptionRight.Call, 47.50m, new DateTime(2006, 03, 18));\n            Assert.AreEqual(expected, symbol);\n        }\n\n        [TestCase(\"SPXW\", OptionRight.Call, 2400.00, \"230111\", \"SPXW230111C02400000\")]\n        [TestCase(\"SPY\", OptionRight.Put, 250.00, \"230615\", \"SPY230615P00250000\")]\n        [TestCase(\"AAPL\", OptionRight.Call, 100.00, \"240614\", \"AAPL240614C00100000\")]\n        [TestCase(\"MSFT\", OptionRight.Put, 150.00, \"240614\", \"MSFT240614P00150000\")]\n        [TestCase(\"GOOG\", OptionRight.Call, 2000.00, \"211231\", \"GOOG211231C02000000\")]\n        [TestCase(\"AMZN\", OptionRight.Put, 3500.50, \"250101\", \"AMZN250101P03500500\")]\n        [TestCase(\"NFLX\", OptionRight.Call, 500.25, \"221201\", \"NFLX221201C00500250\")]\n        [TestCase(\"TSLA\", OptionRight.Put, 725.00, \"241231\", \"TSLA241231P00725000\")]\n        [TestCase(\"V\", OptionRight.Call, 220.00, \"230420\", \"V230420C00220000\")]\n        [TestCase(\"JPM\", OptionRight.Put, 130.75, \"230710\", \"JPM230710P00130750\")]\n        [TestCase(\"IBM\", OptionRight.Call, 145.00, \"250212\", \"IBM250212C00145000\")]\n        [TestCase(\"BABA\", OptionRight.Put, 88.88, \"240508\", \"BABA240508P00088880\")]\n        public void GenerateOptionTickerOSICompact_ValidInputs(string underlying, OptionRight right, decimal strikePrice, string date, string expected)\n        {\n            DateTime expiration = DateTime.ParseExact(date, \"yyMMdd\", System.Globalization.CultureInfo.InvariantCulture);\n            string result = SymbolRepresentation.GenerateOptionTickerOSICompact(underlying, right, strikePrice, expiration);\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void ParseFuturesTickers()\n        {\n            // ticker contains two digits year of expiration, no day expiration\n            var result = SymbolRepresentation.ParseFutureTicker(\"EX20\");\n            Assert.AreEqual(result.Underlying, \"E\");\n            Assert.AreEqual(result.ExpirationDay, 1);\n            Assert.AreEqual(result.ExpirationYearShort, 20);\n            Assert.AreEqual(result.ExpirationMonth, 11); // November\n\n            // ticker contains one digit year of expiration, no day expiration\n            result = SymbolRepresentation.ParseFutureTicker(\"ABCZ1\");\n            Assert.AreEqual(result.Underlying, \"ABC\");\n            Assert.AreEqual(result.ExpirationDay, 1);\n            Assert.AreEqual(result.ExpirationYearShort, 1);\n            Assert.AreEqual(result.ExpirationMonth, 12); // December\n\n            // ticker contains two digits year of expiration, with day expiration\n            result = SymbolRepresentation.ParseFutureTicker(\"ED01X20\");\n            Assert.AreEqual(result.Underlying, \"ED\");\n            Assert.AreEqual(result.ExpirationDay, 1);\n            Assert.AreEqual(result.ExpirationYearShort, 20);\n            Assert.AreEqual(result.ExpirationMonth, 11); // November\n\n            // ticker contains one digit year of expiration, with day expiration\n            result = SymbolRepresentation.ParseFutureTicker(\"ABC11Z1\");\n            Assert.AreEqual(result.Underlying, \"ABC\");\n            Assert.AreEqual(result.ExpirationDay, 11);\n            Assert.AreEqual(result.ExpirationYearShort, 1);\n            Assert.AreEqual(result.ExpirationMonth, 12); // December\n        }\n\n        [Test]\n        public void GenerateFuturesTickers()\n        {\n            const string ticker = @\"ED\";\n            var result = SymbolRepresentation.GenerateFutureTicker(ticker, new DateTime(2016, 12, 12));\n\n            // ticker contains two digits year of expiration\n            Assert.AreEqual(result, \"ED12Z16\");\n\n            // ticker contains one digit year of expiration\n            result = SymbolRepresentation.GenerateFutureTicker(ticker, new DateTime(2016, 12, 12), false);\n            Assert.AreEqual(result, \"ED12Z6\");\n        }\n\n        [Test]\n        public void GenerateFuturesTickersBackAndForth()\n        {\n            const string expected = @\"ED01Z16\";\n            var result = SymbolRepresentation.ParseFutureTicker(expected);\n            var ticker = SymbolRepresentation.GenerateFutureTicker(result.Underlying, new DateTime(2000 + result.ExpirationYearShort, result.ExpirationMonth, result.ExpirationDay));\n\n            Assert.AreEqual(expected, ticker);\n        }\n\n        [Test]\n        public void ParseInvalidFuturesTickers()\n        {\n            var result = SymbolRepresentation.ParseFutureTicker(\"invalid\");\n            Assert.AreEqual(result, null);\n        }\n\n        [Test]\n        public void GenerateOptionTickerWithIndexOptionReturnsCorrectTicker()\n        {\n            // Expected ticker for the option contract\n            var expected = \"SPXW2104A3800\";\n\n            var underlying = Symbols.SPX;\n\n            // Create the option contract (IndexOption) with specific parameters\n            var option = Symbol.CreateOption(\n                underlying,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                3800m,\n                new DateTime(2021, 1, 04));\n\n            var result = SymbolRepresentation.GenerateOptionTicker(option);\n\n            // Assert that the result matches the expected ticker\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(Futures.Energy.ArgusLLSvsWTIArgusTradeMonth, 2017, 1, 29, \"AE529G7\", false)] // Previous month\n        [TestCase(Futures.Energy.ArgusPropaneSaudiAramco, 2017, 1, 29, \"A9N29G7\", false)] // Previous month\n        [TestCase(Futures.Energy.BrentCrude, 2017, 1, 29, \"B29H7\", false)] // Second prior month\n        [TestCase(Futures.Energy.BrentLastDayFinancial, 2017, 1, 29, \"BZ29H7\", false)] // Second prior month\n        [TestCase(Futures.Energy.CrudeOilWTI, 2017, 11, 20, \"CL20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.Gasoline, 2017, 11, 20, \"RB20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.HeatingOil, 2017, 11, 20, \"HO20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.MarsArgusVsWTITradeMonth, 2017, 11, 20, \"AYV20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGas, 2017, 11, 20, \"NG20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGasHenryHubLastDayFinancial, 2017, 11, 20, \"HH20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGasHenryHubPenultimateFinancial, 2017, 11, 20, \"HP20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.WTIHoustonArgusVsWTITradeMonth, 2017, 11, 20, \"HTT20Z17\", true)] // Prior month\n        [TestCase(Futures.Energy.WTIHoustonCrudeOil, 2017, 11, 20, \"HCL20Z17\", true)] // Prior month\n        [TestCase(Futures.Softs.Sugar11, 2017, 11, 20, \"SB20Z17\", true)] // Prior month\n        [TestCase(Futures.Softs.Sugar11CME, 2017, 11, 20, \"YO20Z17\", true)] // Prior month\n        public void GenerateFutureTickerExpiringInPreviousMonth(string underlying, int year, int month, int day, string ticker, bool doubleDigitsYear)\n        {\n            // CL Dec17 expires in Nov17\n            var result = SymbolRepresentation.GenerateFutureTicker(underlying, new DateTime(year, month, day), doubleDigitsYear);\n\n            Assert.AreEqual(ticker, result);\n        }\n\n        [TestCase(Futures.Energy.ArgusLLSvsWTIArgusTradeMonth, 2016, 12, 29, \"AE529F7\", false, true)] // Previous month\n        [TestCase(Futures.Energy.ArgusPropaneSaudiAramco, 2016, 12, 29, \"A9N29F7\", false, true)] // Previous month\n        [TestCase(Futures.Energy.BrentCrude, 2016, 11, 29, \"B29F7\", false, true)] // Second prior month\n        [TestCase(Futures.Energy.BrentCrude, 2016, 12, 29, \"B29G7\", false, true)] // Second prior month\n        [TestCase(Futures.Energy.BrentLastDayFinancial, 2016, 11, 29, \"BZ29F7\", false, true)] // Second prior month\n        [TestCase(Futures.Energy.BrentLastDayFinancial, 2016, 12, 29, \"BZ29G7\", false, true)] // Second prior month\n        [TestCase(Futures.Energy.CrudeOilWTI, 2016, 12, 20, \"CL20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.Gasoline, 2016, 12, 20, \"RB20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.HeatingOil, 2016, 12, 20, \"HO20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.MarsArgusVsWTITradeMonth, 2016, 12, 20, \"AYV20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGas, 2016, 12, 20, \"NG20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGasHenryHubLastDayFinancial, 2016, 12, 20, \"HH20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.NaturalGasHenryHubPenultimateFinancial, 2016, 12, 20, \"HP20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.WTIHoustonArgusVsWTITradeMonth, 2016, 12, 20, \"HTT20F17\", true, true)] // Prior month\n        [TestCase(Futures.Energy.WTIHoustonCrudeOil, 2016, 12, 20, \"HCL20F17\", true, true)] // Prior month\n        [TestCase(Futures.Softs.Sugar11, 2016, 12, 20, \"SB20F17\", true, true)] // Prior month\n        [TestCase(Futures.Softs.Sugar11CME, 2016, 12, 20, \"YO20F17\", true, true)] // Prior month\n        [TestCase(Futures.Softs.Sugar11CME, 2016, 12, 20, \"YOF17\", true, false)] // Prior month\n        [TestCase(Futures.Softs.Sugar11CME, 2016, 12, 20, \"YOF7\", false, false)] // Prior month\n        [TestCase(Futures.Indices.SP500EMini, 2010, 3, 1, \"ESH0\", false, false)]\n        public void GenerateFutureTickerExpiringInPreviousMonthOverYearBoundary(string underlying, int year, int month, int day, string ticker, bool doubleDigitsYear, bool includeExpirationDate)\n        {\n            // CL Dec17 expires in Nov17\n            var result = SymbolRepresentation.GenerateFutureTicker(underlying, new DateTime(year, month, day), doubleDigitsYear, includeExpirationDate);\n\n            Assert.AreEqual(ticker, result);\n        }\n\n        [TestCase(\"ABC\", 2017, 12, 20, \"ABC20Z17\", true)] // Generic contract (i.e. expires current month\n        public void GenerateFutureTickerExpiringInCurrentMonth(string underlying, int year, int month, int day, string ticker, bool doubleDigitsYear)\n        {\n            // CL Dec17 expires in Nov17\n            var result = SymbolRepresentation.GenerateFutureTicker(underlying, new DateTime(year, month, day), doubleDigitsYear);\n\n            Assert.AreEqual(ticker, result);\n        }\n\n        [TestCase(\"CLU0\", 2008, \"2010-08-20\")]\n        [TestCase(\"CLU1\", 2008, \"2011-08-22\")]\n        [TestCase(\"CLU2\", 2008, \"2012-08-21\")]\n        [TestCase(\"CLU8\", 2008, \"2008-08-20\")]\n        [TestCase(\"CLU9\", 2008, \"2009-08-20\")]\n        public void GenerateFutureSymbolFromTickerKnownYearSingleDigit(string ticker, int futureYear, DateTime expectedExpiration)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker, futureYear);\n            Assert.AreEqual(expectedExpiration, result.ID.Date.Date);\n        }\n\n        [TestCase(\"CLU20\", 2020, \"2020-08-20\")]\n        [TestCase(\"CLU21\", 2020, \"2021-08-20\")]\n        [TestCase(\"CLU22\", 2020, \"2022-08-22\")]\n        [TestCase(\"CLU28\", 2020, \"2028-08-22\")]\n        [TestCase(\"CLU29\", 2020, \"2029-08-21\")]\n        public void GenerateFutureSymbolFromTickerUnknownYearSingleDigit(string ticker, int futureYear, DateTime expectedExpiration)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker, futureYear);\n            Assert.AreEqual(expectedExpiration, result.ID.Date.Date);\n        }\n\n        [TestCase(\"CLU20\", \"2020-08-20\")]\n        [TestCase(\"CLU21\", \"2021-08-20\")]\n        [TestCase(\"CLU22\", \"2022-08-22\")]\n        [TestCase(\"CLU28\", \"2028-08-22\")]\n        [TestCase(\"CLU29\", \"2029-08-21\")]\n        public void GenerateFutureSymbolFromTickerUnknownYearSingleDigit(string ticker, DateTime expectedExpiration)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker);\n            Assert.AreEqual(expectedExpiration, result.ID.Date.Date);\n        }\n\n        [TestCase(\"CLU0\", \"2030-08-20\")]\n        [TestCase(\"CLU1\", \"2031-08-20\")]\n        [TestCase(\"CLU2\", \"2032-08-20\")]\n        [TestCase(\"CLU8\", \"2028-08-22\")]\n        [TestCase(\"CLU9\", \"2029-08-21\")]\n        public void GenerateFutureSymbolFromTickerUnknownYearDoubleDigit(string ticker, DateTime expectedExpiration)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker);\n            Assert.AreEqual(expectedExpiration, result.ID.Date.Date);\n        }\n\n        [TestCase(\"NQZ23\")]\n        public void GenerateFutureSymbolFromTickerUnknownYear(string ticker)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker);\n            // When the future year is not provided, we have an ambiguous case (1923 or 2023) and default 2000\n            Assert.AreEqual(new DateTime(2023, 12, 15), result.ID.Date.Date);\n        }\n\n        [TestCase(\"NQZ99\")]\n        public void GenerateFutureSymbolFromTickerExpiringBefore2000(string ticker)\n        {\n            var result = SymbolRepresentation.ParseFutureSymbol(ticker, 1999);\n            Assert.AreEqual(new DateTime(1999, 12, 17), result.ID.Date.Date);\n        }\n\n        [TestCase(\"PROPANE_NON_LDH_MONT_BELVIEU\", QuantConnect.Securities.Futures.Energy.PropaneNonLDHMontBelvieu)]\n        [TestCase(\"ARGUS_PROPANE_FAR_EAST_INDEX_BALMO\", QuantConnect.Securities.Futures.Energy.ArgusPropaneFarEastIndexBALMO)]\n        [TestCase(\"GASOLINE\", QuantConnect.Securities.Futures.Energy.Gasoline)]\n        [TestCase(\"NATURAL_GAS\", QuantConnect.Securities.Futures.Energy.NaturalGas)]\n        public void FutureEnergySymbolsWorkInPythonWithPEP8(string FutureEnergyName, string expectedFutureEnergyValue)\n        {\n            using (Py.GIL())\n            {\n                var pythonModule = PyModule.FromString(\"testModule\", @$\"\nfrom AlgorithmImports import *\n\ndef return_futures_energy():\n    return Futures.Energy.{FutureEnergyName};\n\");\n                dynamic pythonFunction = pythonModule.GetAttr(\"return_futures_energy\");\n                var futureEnergyValue = pythonFunction();\n                Assert.AreEqual(expectedFutureEnergyValue, (futureEnergyValue as PyObject).GetAndDispose<string>());\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/SymbolTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Collections.Generic;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class SymbolTests\n    {\n        [Theory]\n        [TestCaseSource(nameof(GetSymbolCreateTestCaseData))]\n        public void SymbolCreate(string ticker, SecurityType securityType, string market, Symbol expected)\n        {\n            Assert.AreEqual(Symbol.Create(ticker, securityType, market), expected);\n        }\n\n        private static TestCaseData[] GetSymbolCreateTestCaseData()\n        {\n            return new []\n            {\n                new TestCaseData(\"SPY\", SecurityType.Equity, Market.USA, new Symbol(SecurityIdentifier.GenerateEquity(\"SPY\", Market.USA), \"SPY\")),\n                new TestCaseData(\"EURUSD\", SecurityType.Forex, Market.FXCM, new Symbol(SecurityIdentifier.GenerateForex(\"EURUSD\", Market.FXCM), \"EURUSD\")),\n                new TestCaseData(\"SPY\", SecurityType.Option, Market.USA, new Symbol(SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, Symbols.SPY.ID, Market.USA, 0, default(OptionRight), default(OptionStyle)), \"?SPY\"))\n            };\n        }\n\n        [Test]\n        public void SymbolCreateBaseWithUnderlyingEquity()\n        {\n            var type = typeof(BaseData);\n            var equitySymbol = Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n            var symbol = Symbol.CreateBase(type, equitySymbol, Market.USA);\n            var symbolIDSymbol = symbol.ID.Symbol.Split(new[] { \".BaseData\" }, StringSplitOptions.None).First();\n\n            Assert.IsTrue(symbol.SecurityType == SecurityType.Base);\n            Assert.IsTrue(symbol.HasUnderlying);\n\n            Assert.AreEqual(symbol.Underlying, equitySymbol);\n\n            Assert.AreEqual(symbol.ID.Date, new DateTime(1998, 1, 2));\n            Assert.AreEqual(\"AOL\", symbolIDSymbol);\n\n            Assert.AreEqual(symbol.Underlying.ID.Symbol, symbolIDSymbol);\n            Assert.AreEqual(symbol.Underlying.ID.Date, symbol.ID.Date);\n\n            Assert.AreEqual(symbol.Underlying.Value, equitySymbol.Value);\n            Assert.AreEqual(symbol.Underlying.Value, symbol.Value);\n        }\n\n        [Test]\n        public void SymbolCreateBaseWithUnderlyingOption()\n        {\n            var type = typeof(BaseData);\n            var optionSymbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 100, new DateTime(2050, 12, 31));\n            var symbol = Symbol.CreateBase(type, optionSymbol, Market.USA);\n            var symbolIDSymbol = symbol.ID.Symbol.Split(new[] { \".BaseData\" }, StringSplitOptions.None).First();\n\n            Assert.IsTrue(symbol.SecurityType == SecurityType.Base);\n            Assert.IsTrue(symbol.HasUnderlying);\n\n            Assert.AreEqual(symbol.Underlying, optionSymbol);\n\n            Assert.IsTrue(symbol.Underlying.HasUnderlying);\n            Assert.AreEqual(symbol.Underlying.Underlying.SecurityType, SecurityType.Equity);\n\n            Assert.AreEqual(new DateTime(2050, 12, 31), symbol.ID.Date);\n            Assert.AreEqual(\"AOL\", symbolIDSymbol);\n\n            Assert.AreEqual(symbol.Underlying.ID.Symbol, symbolIDSymbol);\n            Assert.AreEqual(symbol.Underlying.ID.Date, symbol.ID.Date);\n            Assert.AreEqual(symbol.Underlying.Value, symbol.Value);\n\n            Assert.AreEqual(symbol.Underlying.Underlying.ID.Symbol, symbolIDSymbol);\n            Assert.AreNotEqual(symbol.Underlying.Underlying.ID.Date, symbol.ID.Date);\n            Assert.IsTrue(symbol.Value.StartsWith(symbol.Underlying.Underlying.Value));\n\n            Assert.AreEqual(symbol.Underlying.Underlying.ID.Symbol, symbol.Underlying.ID.Symbol);\n            Assert.AreNotEqual(symbol.Underlying.Underlying.ID.Date, symbol.Underlying.ID.Date);\n            Assert.IsTrue(symbol.Underlying.Value.StartsWith(symbol.Underlying.Underlying.Value));\n        }\n\n        [Test]\n        public void SymbolCreateWithOptionSecurityTypeCreatesCanonicalOptionSymbol()\n        {\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Option, Market.USA);\n            var sid = symbol.ID;\n            Assert.AreEqual(SecurityIdentifier.DefaultDate, sid.Date);\n            Assert.AreEqual(0m, sid.StrikePrice);\n            Assert.AreEqual(default(OptionRight), sid.OptionRight);\n            Assert.AreEqual(default(OptionStyle), sid.OptionStyle);\n        }\n\n        [Test]\n        public void CanonicalOptionSymbolAliasHasQuestionMark()\n        {\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Option, Market.USA);\n            Assert.AreEqual(\"?SPY\", symbol.Value);\n        }\n\n        [Test]\n        public void UsesSidForDictionaryKey()\n        {\n            var sid = SecurityIdentifier.GenerateEquity(\"SPY\", Market.USA);\n            var dictionary = new Dictionary<Symbol, int>\n            {\n                {new Symbol(sid, \"value\"), 1}\n            };\n\n            var key = new Symbol(sid, \"other value\");\n            Assert.IsTrue(dictionary.ContainsKey(key));\n        }\n\n        [Test]\n        public void CreatesOptionWithUnderlying()\n        {\n            var option = Symbol.CreateOption(\"XLRE\", Market.USA, OptionStyle.American, OptionRight.Call, 21m, new DateTime(2016, 08, 19));\n\n            Assert.AreEqual(option.ID.Date, new DateTime(2016, 08, 19));\n            Assert.AreEqual(option.ID.StrikePrice, 21m);\n            Assert.AreEqual(option.ID.OptionRight, OptionRight.Call);\n            Assert.AreEqual(option.ID.OptionStyle, OptionStyle.American);\n            Assert.AreEqual(option.Underlying.ID.Symbol, \"XLRE\");\n\n        }\n\n        [Test]\n        public void CompareToItselfReturnsZero()\n        {\n            var sym = new Symbol(SecurityIdentifier.GenerateForex(\"sym\", Market.FXCM), \"sym\");\n            Assert.AreEqual(0, sym.CompareTo(sym));\n        }\n\n        [Test]\n        public void ComparesTheSameAsStringCompare()\n        {\n            var a = new Symbol(SecurityIdentifier.GenerateForex(\"a\", Market.FXCM), \"a\");\n            var z = new Symbol(SecurityIdentifier.GenerateForex(\"z\", Market.FXCM), \"z\");\n\n            Assert.AreEqual(string.Compare(\"a\", \"z\", StringComparison.Ordinal), a.CompareTo(z));\n            Assert.AreEqual(string.Compare(\"z\", \"a\", StringComparison.Ordinal), z.CompareTo(a));\n        }\n\n        [Test]\n        public void ComparesTheSameAsStringCompareAndIgnoresCase()\n        {\n            var a = new Symbol(SecurityIdentifier.GenerateForex(\"a\", Market.FXCM), \"a\");\n            var z = new Symbol(SecurityIdentifier.GenerateForex(\"z\", Market.FXCM), \"z\");\n\n            Assert.AreEqual(string.Compare(\"a\", \"Z\", StringComparison.OrdinalIgnoreCase), a.CompareTo(z));\n            Assert.AreEqual(string.Compare(\"z\", \"A\", StringComparison.OrdinalIgnoreCase), z.CompareTo(a));\n        }\n\n        [Test]\n        public void ComparesAgainstStringWithoutException()\n        {\n            var a = new Symbol(SecurityIdentifier.GenerateForex(\"a\", Market.FXCM), \"a\");\n            Assert.AreEqual(0, a.CompareTo(\"a\"));\n        }\n\n        [Test]\n        public void ComparesAgainstStringIgnoringCase()\n        {\n            var a = new Symbol(SecurityIdentifier.GenerateForex(\"a\", Market.FXCM), \"a\");\n            Assert.AreEqual(0, a.CompareTo(\"A\"));\n        }\n\n        [Test]\n        public void EqualsAgainstNullOrEmpty()\n        {\n            var validSymbol = Symbols.SPY;\n            var emptySymbol = Symbol.Empty;\n            var emptySymbolInstance = new Symbol(SecurityIdentifier.Empty, string.Empty);\n            Symbol nullSymbol = null;\n\n            Assert.IsTrue(emptySymbol.Equals(nullSymbol));\n            Assert.IsTrue(Symbol.Empty.Equals(nullSymbol));\n            Assert.IsTrue(emptySymbolInstance.Equals(nullSymbol));\n\n            Assert.IsTrue(emptySymbol.Equals(emptySymbol));\n            Assert.IsTrue(Symbol.Empty.Equals(emptySymbol));\n            Assert.IsTrue(emptySymbolInstance.Equals(emptySymbol));\n\n            Assert.IsFalse(validSymbol.Equals(nullSymbol));\n            Assert.IsFalse(validSymbol.Equals(emptySymbol));\n            Assert.IsFalse(validSymbol.Equals(emptySymbolInstance));\n            Assert.IsFalse(Symbol.Empty.Equals(validSymbol));\n        }\n\n        [Test]\n        public void ComparesAgainstNullOrEmpty()\n        {\n            var validSymbol = Symbols.SPY;\n            var emptySymbol = Symbol.Empty;\n            Symbol nullSymbol = null;\n\n            Assert.IsTrue(nullSymbol == emptySymbol);\n            Assert.IsFalse(nullSymbol != emptySymbol);\n\n            Assert.IsTrue(emptySymbol == nullSymbol);\n            Assert.IsFalse(emptySymbol != nullSymbol);\n\n            Assert.IsTrue(validSymbol != null);\n            Assert.IsTrue(emptySymbol == null);\n            Assert.IsTrue(nullSymbol == null);\n\n            Assert.IsFalse(validSymbol == null);\n            Assert.IsFalse(emptySymbol != null);\n            Assert.IsFalse(nullSymbol != null);\n\n            Assert.IsTrue(validSymbol != Symbol.Empty);\n            Assert.IsTrue(emptySymbol == Symbol.Empty);\n            Assert.IsTrue(nullSymbol == Symbol.Empty);\n\n            Assert.IsFalse(validSymbol == Symbol.Empty);\n            Assert.IsFalse(emptySymbol != Symbol.Empty);\n            Assert.IsFalse(nullSymbol != Symbol.Empty);\n\n            Assert.IsTrue(null != validSymbol);\n            Assert.IsTrue(null == emptySymbol);\n            Assert.IsTrue(null == nullSymbol);\n\n            Assert.IsFalse(null == validSymbol);\n            Assert.IsFalse(null != emptySymbol);\n            Assert.IsFalse(null != nullSymbol);\n\n            Assert.IsTrue(Symbol.Empty != validSymbol);\n            Assert.IsTrue(Symbol.Empty == emptySymbol);\n            Assert.IsTrue(Symbol.Empty == nullSymbol);\n\n            Assert.IsFalse(Symbol.Empty == validSymbol);\n            Assert.IsFalse(Symbol.Empty != emptySymbol);\n            Assert.IsFalse(Symbol.Empty != nullSymbol);\n        }\n\n        [Test]\n        public void ImplicitOperatorsAreInverseFunctions()\n        {\n#pragma warning disable 0618 // This test requires implicit operators\n            var eurusd = new Symbol(SecurityIdentifier.GenerateForex(\"EURUSD\", Market.FXCM), \"EURUSD\");\n            string stringEurusd = eurusd;\n            Symbol symbolEurusd = stringEurusd;\n            Assert.AreEqual(eurusd, symbolEurusd);\n#pragma warning restore 0618\n        }\n\n        [Test]\n        public void ImplicitOperatorsReturnSIDOnFailure()\n        {\n#pragma warning disable 0618 // This test requires implicit operators\n            // this doesn't exist in the symbol cache\n            var eurusd = new Symbol(SecurityIdentifier.GenerateForex(\"NOT-A-SECURITY\", Market.FXCM), \"EURUSD\");\n            string stringEurusd = eurusd;\n            Assert.AreEqual(eurusd.ID.ToString(), stringEurusd);\n\n            Assert.Throws<ArgumentException>(() =>\n            {\n                Symbol symbol = \"this will not resolve to a proper Symbol instance\";\n            });\n\n            Symbol notASymbol = \"NotASymbol\";\n            Assert.AreNotEqual(Symbol.Empty, notASymbol);\n            Assert.IsTrue(notASymbol.ToString().Contains(\"NotASymbol\"));\n#pragma warning restore 0618\n        }\n\n        [Test]\n        public void ImplicitFromStringChecksSymbolCache()\n        {\n#pragma warning disable 0618 // This test requires implicit operators\n            SymbolCache.Set(\"EURUSD\", Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM));\n            string ticker = \"EURUSD\";\n            Symbol actual = ticker;\n            var expected = SymbolCache.GetSymbol(ticker);\n            Assert.AreEqual(expected, actual);\n            SymbolCache.Clear();\n#pragma warning restore 0618\n        }\n\n        [Test]\n        public void ImplicitFromStringParsesSid()\n        {\n#pragma warning disable 0618 // This test requires implicit operators\n            SymbolCache.Set(\"EURUSD\", Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM));\n            var expected = SymbolCache.GetSymbol(\"EURUSD\");\n            string sid = expected.ID.ToString();\n            Symbol actual = sid;\n            Assert.AreEqual(expected, actual);\n            SymbolCache.Clear();\n#pragma warning restore 0618\n        }\n\n        [Test]\n        public void ImplicitFromWithinStringLiftsSecondArgument()\n        {\n#pragma warning disable 0618 // This test requires implicit operators\n            SymbolCache.Clear();\n            SymbolCache.Set(\"EURUSD\", Symbols.EURUSD);\n            var expected = SymbolCache.GetSymbol(\"EURUSD\");\n            string stringValue = expected;\n            string notFound = \"EURGBP 8G\";\n            var expectedNotFoundSymbol = Symbols.EURGBP;\n            string sid = expected.ID.ToString();\n            Symbol actual = sid;\n            if (!(expected == stringValue))\n            {\n                Assert.Fail(\"Failed expected == string\");\n            }\n            else if (!(stringValue == expected))\n            {\n                Assert.Fail(\"Failed string == expected\");\n            }\n            else if (expected != stringValue)\n            {\n                Assert.Fail(\"Failed expected != string\");\n            }\n            else if (stringValue != expected)\n            {\n                Assert.Fail(\"Failed string != expected\");\n            }\n\n            Symbol notFoundSymbol = notFound;\n            Assert.AreEqual(expectedNotFoundSymbol, notFoundSymbol);\n            SymbolCache.Clear();\n#pragma warning restore 0618\n        }\n\n\n        [Test]\n        public void TestIfWeDetectCorrectlyWeekliesAndStandardOptionsBeforeFeb2015()\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2012, 09, 22));\n            var weeklySymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2012, 09, 07));\n\n            Assert.True(OptionSymbol.IsStandard(symbol));\n            Assert.False(OptionSymbol.IsStandard(weeklySymbol));\n\n            Assert.AreEqual(new DateTime(2012, 09, 21)/*Friday*/, OptionSymbol.GetLastDayOfTrading(symbol));\n            Assert.AreEqual(new DateTime(2012, 09, 07)/*Friday*/, OptionSymbol.GetLastDayOfTrading(weeklySymbol));\n        }\n\n        [Test]\n        public void TestIfWeDetectCorrectlyWeekliesAndStandardOptionsAfterFeb2015()\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2016, 02, 19));\n            var weeklySymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2016, 02, 05));\n\n            Assert.True(OptionSymbol.IsStandard(symbol));\n            Assert.False(OptionSymbol.IsStandard(weeklySymbol));\n\n            Assert.AreEqual(new DateTime(2016, 02, 19)/*Friday*/, OptionSymbol.GetLastDayOfTrading(symbol));\n            Assert.AreEqual(new DateTime(2016, 02, 05)/*Friday*/, OptionSymbol.GetLastDayOfTrading(weeklySymbol));\n        }\n\n        [Test]\n        public void TestIfWeDetectCorrectlyWeeklies()\n        {\n            var weeklySymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2020, 04, 10));\n            var monthlysymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, new DateTime(2020, 04, 17));\n\n            Assert.True(OptionSymbol.IsWeekly(weeklySymbol));\n            Assert.False(OptionSymbol.IsWeekly(monthlysymbol));\n\n            Assert.AreEqual(new DateTime(2020, 04, 17)/*Friday*/, OptionSymbol.GetLastDayOfTrading(monthlysymbol));\n            //Good Friday on 10th so should be 9th\n            Assert.AreEqual(new DateTime(2020, 04, 09)/*Thursday*/, OptionSymbol.GetLastDayOfTrading(weeklySymbol));\n        }\n\n        [Test]\n        public void HasUnderlyingSymbolReturnsTrueWhenSpecifyingCorrectUnderlying()\n        {\n            Assert.IsTrue(Symbols.SPY_C_192_Feb19_2016.HasUnderlyingSymbol(Symbols.SPY));\n        }\n\n        [Test]\n        public void HasUnderlyingSymbolReturnsFalsWhenSpecifyingIncorrectUnderlying()\n        {\n            Assert.IsFalse(Symbols.SPY_C_192_Feb19_2016.HasUnderlyingSymbol(Symbols.AAPL));\n        }\n\n        [Test]\n        public void TestIfFridayLastTradingDayIsHolidaysThenMoveToPreviousThursday()\n        {\n            var saturdayAfterGoodFriday = new DateTime(2014, 04, 19);\n            var thursdayBeforeGoodFriday = saturdayAfterGoodFriday.AddDays(-2);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 200, saturdayAfterGoodFriday);\n            Assert.AreEqual(thursdayBeforeGoodFriday, OptionSymbol.GetLastDayOfTrading(symbol));\n        }\n\n        [TestCase(\"ES\", \"ES\")]\n        [TestCase(\"GC\", \"OG\")]\n        [TestCase(\"ZT\", \"OZT\")]\n        public void FutureOptionsWithDifferentUnderlyingGlobexTickersAreMapped(string futureTicker, string expectedFutureOptionTicker)\n        {\n            var future = Symbol.CreateFuture(futureTicker, Market.CME, DateTime.UtcNow.Date);\n            var canonicalFutureOption = Symbol.CreateOption(\n                future,\n                Market.CME,\n                default(OptionStyle),\n                default(OptionRight),\n                default(decimal),\n                SecurityIdentifier.DefaultDate);\n\n            var nonCanonicalFutureOption = Symbol.CreateOption(\n                future,\n                Market.CME,\n                default(OptionStyle),\n                default(OptionRight),\n                default(decimal),\n                new DateTime(2020, 12, 18));\n\n            Assert.AreEqual(canonicalFutureOption.Underlying.ID.Symbol, futureTicker);\n            Assert.AreEqual(canonicalFutureOption.ID.Symbol, expectedFutureOptionTicker);\n            Assert.IsTrue(canonicalFutureOption.Value.StartsWith(\"?\" + expectedFutureOptionTicker));\n\n            Assert.AreEqual(nonCanonicalFutureOption.Underlying.ID.Symbol, futureTicker);\n            Assert.AreEqual(nonCanonicalFutureOption.ID.Symbol, expectedFutureOptionTicker);\n            Assert.IsTrue(nonCanonicalFutureOption.Value.StartsWith(expectedFutureOptionTicker));\n        }\n\n        [Test]\n        public void SymbolWithSidContainingUnderlyingCreatedWithoutNullUnderlying()\n        {\n            var future = Symbol.CreateFuture(\"ES\", Market.CME, new DateTime(2020, 6, 19));\n            var optionSid = SecurityIdentifier.GenerateOption(\n                future.ID.Date,\n                future.ID,\n                future.ID.Market,\n                3500m,\n                OptionRight.Call,\n                OptionStyle.American);\n\n            var option = new Symbol(optionSid, \"ES\");\n            Assert.IsNotNull(option.Underlying);\n            Assert.AreEqual(future, option.Underlying);\n        }\n\n        [TestCase(\"CL XKJAZ588SI4H\", \"CL\", \"CL21F21\")] // Future\n        [TestCase(\"CL JL\", \"CL\", \"/CL\")] // Canonical Future\n        [TestCase(\"ES 1S4 | ES XLDTU1KH5XC1\", \"CL\", \"?ES21F21\")] // Future Option Canonical\n        [TestCase(\"ES XKGCMV4QK9VO | ES XLDTU1KH5XC1\", \"ES\", \"ES21F21  201218C00000000\")] // Future Option\n        [TestCase(\"SPY 2U | SPY R735QTJ8XC9X\", \"SPY\", \"?SPY\")] // Option Canonical\n        [TestCase(\"GOOCV 305RBQ2BZBZT2 | GOOCV VP83T1ZUHROL\", \"GOOCV\", \"GOOCV 151224P00007500\")] // Option\n        [TestCase(\"SPY R735QTJ8XC9X\", \"SPY\", \"SPY\")] // Equity\n        [TestCase(\"EURGBP 8G\", \"EURGBP\", \"EURGBP\")] // Forex\n        [TestCase(\"BTCUSD XJ\", \"BTCUSD\", \"BTCUSD\")] // Crypto\n        public void SymbolAlias(string identifier, string ticker, string expectedValue)\n        {\n            var symbol = new Symbol(SecurityIdentifier.Parse(identifier), ticker);\n            Assert.AreEqual(expectedValue, symbol.Value);\n        }\n\n        [TestCase(\"CL XKJAZ588SI4H\", \"CL\", \"CL21F21\")] // Future\n        [TestCase(\"CL JL\", \"CL\", \"/CL\")] // Canonical Future\n        [TestCase(\"ES 1S4 | ES XLDTU1KH5XC1\", \"ES\", \"?ES21F21\")] // Future Option Canonical\n        [TestCase(\"ES XKGCMV4QK9VO | ES XLDTU1KH5XC1\", \"ES\", \"ES21F21  201218C00000000\")] // Future Option\n        [TestCase(\"SPY 2U | SPY R735QTJ8XC9X\", \"SPY\", \"?SPY\")] // Option Canonical\n        [TestCase(\"GOOCV 305RBQ2BZBZT2 | GOOCV VP83T1ZUHROL\", \"GOOCV\", \"GOOCV 151224P00750000\")] // Option\n        [TestCase(\"SPY R735QTJ8XC9X\", \"SPY\", null)] // Equity\n        [TestCase(\"EURGBP 8G\", \"EURGBP\", null)] // Forex\n        [TestCase(\"BTCUSD XJ\", \"BTCUSD\", null)] // Crypto\n        public void SymbolCanonical(string identifier, string ticker, string expectedValue)\n        {\n            var symbol = new Symbol(SecurityIdentifier.Parse(identifier), ticker);\n            if (expectedValue != null)\n            {\n                var result = symbol.Canonical;\n\n                Assert.IsNotNull(result);\n                Assert.AreSame(result, symbol.Canonical);\n                Assert.IsTrue(result.IsCanonical());\n                Assert.IsTrue(result.Value.Contains(ticker));\n                Assert.AreEqual(symbol.SecurityType, result.SecurityType);\n                Assert.AreEqual(symbol.ID.Market, result.ID.Market);\n            }\n            else\n            {\n                Assert.Throws<InvalidOperationException>(() =>\n                {\n                    var canonical = symbol.Canonical;\n                });\n            }\n        }\n\n \n        [TestCase(\"SPY\", \"SPY\", \"SPY 2T\")]\n        [TestCase(\"NWSA\", \"FOXA\", \"NWSA 2T\")]\n        [TestCase(\"NWSA\", \"FOXA\", \"NWSA 2S|NWSA 2T\")]\n        [TestCase(\"QQQQ\", \"QQQ\", \"QQQQ 2S|QQQQ 31|QQQQ 2T\")]\n        public void SymbolAndUnderlyingSymbolsMapped(string ticker, string mappedTicker, string sid)\n        {\n            var symbol = new Symbol(SecurityIdentifier.Parse(sid), ticker);\n            var symbolChain = symbol;\n\n            do\n            {\n                Assert.AreEqual(symbolChain.Value, ticker);\n                symbolChain = symbolChain.Underlying;\n            }\n            while (symbolChain != null);\n\n            symbol = symbol.UpdateMappedSymbol(mappedTicker);\n            symbolChain = symbol;\n\n            do\n            {\n                Console.WriteLine(symbolChain.ToString() + \"; Value: \" + symbolChain.Value);\n                if (symbolChain.SecurityType == SecurityType.Base || symbolChain.RequiresMapping())\n                {\n                    Assert.AreEqual(mappedTicker, symbolChain.Value);\n                }\n                else \n                {\n                    Assert.AreNotEqual(mappedTicker, symbolChain.Value);   \n                }\n                symbolChain = symbolChain.Underlying;\n            }\n            while (symbolChain != null);\n        }\n\n        [Test]\n        public void SymbolReferenceNotMappedOnUpdate()\n        {\n            var symbol = Symbol.Create(\"NWSA\", SecurityType.Equity, Market.USA);\n            var customSymbol = Symbol.CreateBase(typeof(BaseData), symbol, Market.USA);\n\n            var mappedSymbol = customSymbol.UpdateMappedSymbol(\"FOXA\");\n            \n            Assert.AreNotEqual(customSymbol.Value, mappedSymbol.Value);\n            Assert.AreNotEqual(customSymbol.Underlying.Value, mappedSymbol.Underlying.Value);\n            Assert.AreNotEqual(symbol.Value, mappedSymbol.Underlying.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/TimeKeeperTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class TimeKeeperTests\n    {\n        [Test]\n        public void ConstructsLocalTimeKeepers()\n        {\n            var reference = new DateTime(2000, 01, 01);\n            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });\n            Assert.IsNotNull(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n        }\n\n        [Test]\n        public void TimeKeeperReportsUpdatedLocalTimes()\n        {\n            var reference = new DateTime(2000, 01, 01);\n            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });\n            var localTime = timeKeeper.GetTimeIn(TimeZones.NewYork);\n\n            timeKeeper.SetUtcDateTime(reference.AddDays(1));\n\n            Assert.AreEqual(localTime.AddDays(1), timeKeeper.GetTimeIn(TimeZones.NewYork));\n\n            timeKeeper.SetUtcDateTime(reference.AddDays(2));\n\n            Assert.AreEqual(localTime.AddDays(2), timeKeeper.GetTimeIn(TimeZones.NewYork));\n        }\n\n        [Test]\n        public void LocalTimeKeepersGetTimeUpdates()\n        {\n            var reference = new DateTime(2000, 01, 01);\n            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });\n            var localTimeKeeper = timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n            var localTime = localTimeKeeper.LocalTime;\n\n            timeKeeper.SetUtcDateTime(reference.AddDays(1));\n\n            Assert.AreEqual(localTime.AddDays(1), localTimeKeeper.LocalTime);\n\n            timeKeeper.SetUtcDateTime(reference.AddDays(2));\n\n            Assert.AreEqual(localTime.AddDays(2), localTimeKeeper.LocalTime);\n        }\n\n        [Test]\n        public void AddingDuplicateTimeZoneDoesntAdd()\n        {\n            var reference = new DateTime(2000, 01, 01);\n            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });\n            var localTimeKeeper = timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork);\n\n            timeKeeper.AddTimeZone(TimeZones.NewYork);\n\n            Assert.AreEqual(localTimeKeeper, timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/TimeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class TimeTests\n    {\n        [TestCase(\"20230605 08:00\", \"04:00\")]\n        [TestCase(\"20230605 15:00\", \"21:00\")]\n        public void AuxiliaryDataDueTime(string utcNow, string expectedDueTime)\n        {\n            var result = Time.GetNextLiveAuxiliaryDataDueTime(Time.ParseDate(utcNow));\n            var expected  = TimeSpan.ParseExact(expectedDueTime, \"hh\\\\:mm\", CultureInfo.InvariantCulture);\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test]\n        public void UnixTimeStampSecondsToDateTimeHasSubMillisecondPrecision()\n        {\n            const double stamp = 1520711961.00055;\n            var expected = new DateTime(2018, 3, 10, 19, 59, 21, 0).AddTicks(5500);\n            var time = Time.UnixTimeStampToDateTime(stamp);\n            Assert.AreEqual(expected, time);\n        }\n\n        [Test]\n        public void UnixTimeStampMillisecondsToDateTimeHasSubMillisecondPrecision()\n        {\n            const decimal stamp = 1520711961000.55m;\n            var expected = new DateTime(2018, 3, 10, 19, 59, 21, 0).AddTicks(5500);\n            var time = Time.UnixMillisecondTimeStampToDateTime(stamp);\n            Assert.AreEqual(expected, time);\n        }\n\n\n        [Test]\n        public void UnixTimeStampSecondsToDateTimeSubMillisecondPrecision()\n        {\n            const decimal stamp = 1520711961.00055m;\n            var expected = new DateTime(2018, 3, 10, 19, 59, 21, 0).AddTicks(5500);\n            var time = Time.UnixTimeStampToDateTime(stamp);\n            Assert.AreEqual(expected, time);\n        }\n\n        [Test]\n        public void UnixTimeStampSecondsToDateTime()\n        {\n            const long stamp = 1520711961000;\n            var expected = new DateTime(2018, 3, 10, 19, 59, 21, 0);\n            var time = Time.UnixMillisecondTimeStampToDateTime(stamp);\n            Assert.AreEqual(expected, time);\n        }\n\n        [Test]\n        public void GetStartTimeForTradeBarsRoundsDown()\n        {\n            // 2015.09.01 @ noon\n            var end = new DateTime(2015, 09, 01, 12, 0, 1);\n            var barSize = TimeSpan.FromMinutes(1);\n            var hours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n            var start = Time.GetStartTimeForTradeBars(hours, end, barSize, 1, false, TimeZones.NewYork);\n            // round down and back up a single bar\n            Assert.AreEqual(end.RoundDown(barSize).Subtract(barSize), start);\n        }\n\n        [Test]\n        public void GetStartTimeForTradeBarsHandlesOverNight()\n        {\n            // 2015.09.01 @ noon\n            var end = new DateTime(2015, 09, 01, 12, 0, 0);\n            var barSize = TimeSpan.FromHours(1);\n            var hours = SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours();\n            var start = Time.GetStartTimeForTradeBars(hours, end, barSize, 7, false, hours.TimeZone);\n            // from noon, back up to 9am (3 hours) then skip night, so from 4pm, back up to noon, 4 more hours\n            Assert.AreEqual(end.AddDays(-1), start);\n        }\n\n        [Test]\n        public void GetStartTimeForTradeBarsHandlesWeekends()\n        {\n            // 2015.09.01 @ noon\n            var end = new DateTime(2015, 09, 01, 12, 0, 0);\n            var expectedStart = new DateTime(2015, 08, 21);\n            var barSize = TimeSpan.FromDays(1);\n            var hours = SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours();\n            var start = Time.GetStartTimeForTradeBars(hours, end, barSize, 7, false, hours.TimeZone);\n            // from noon, back up to 9am (3 hours) then skip night, so from 4pm, back up to noon, 4 more hours\n            Assert.AreEqual(expectedStart, start);\n        }\n\n        [Test, TestCaseSource(nameof(ForexHistoryDates))]\n        public void GetStartTimeForForexTradeBars(DateTime end, DateTime expectedStart, DateTimeZone dataTimeZone)\n        {\n            var barSize = TimeSpan.FromDays(1);\n            var hours = SecurityExchangeHoursTests.CreateForexSecurityExchangeHours();\n            var start = Time.GetStartTimeForTradeBars(hours, end, barSize, 1, false, dataTimeZone);\n            Assert.AreEqual(expectedStart, start);\n        }\n\n        [Test, TestCaseSource(nameof(EquityHistoryDates))]\n        public void GetStartTimeForEquityTradeBars(DateTime end, DateTime expectedStart, DateTimeZone dataTimeZone)\n        {\n            var barSize = TimeSpan.FromMinutes(1);\n            var hours = SecurityExchangeHoursTests.CreateUsEquitySecurityExchangeHours();\n            var start = Time.GetStartTimeForTradeBars(hours, end, barSize, 10, false, dataTimeZone);\n            Assert.AreEqual(expectedStart, start);\n        }\n\n        private static IEnumerable<TestCaseData> GetStartTimeFromNonTradableDateTestCases()\n        {\n            foreach (var date in new[]\n                    {\n                        // Labor day\n                        new DateTime(2025, 09, 01),\n                        // Saturday\n                        new DateTime(2025, 08, 30),\n                        // Sunday\n                        new DateTime(2025, 08, 31)\n                    })\n            {\n                foreach (var timeOfDay in new[] { 0, 12, 17 })\n                {\n                    foreach (var useStrictDailyEndTimes in new[] { true, false })\n                    {\n                        yield return new TestCaseData(date.AddHours(timeOfDay), useStrictDailyEndTimes);\n                    }\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetStartTimeFromNonTradableDateTestCases))]\n        public void GetStartTimeFromNonTradableDate(DateTime dateTime, bool useStrictDailyEndTimes)\n        {\n            var symbol = Symbols.SPY;\n            var mhdbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(Market.USA, symbol, SecurityType.Equity);\n            var hours = mhdbEntry.ExchangeHours;\n            Assert.IsFalse(hours.IsDateOpen(dateTime.Date));\n\n            var barSize = Time.OneDay;\n            var periods = 10;\n            var expectedStart = new DateTime(2025, 08, 18);\n\n            var start = Time.GetStartTimeForTradeBars(hours, dateTime, barSize, periods, false, mhdbEntry.DataTimeZone, useStrictDailyEndTimes);\n            Assert.AreEqual(expectedStart, start);\n        }\n\n        [Test]\n        public void EachTradeableDayInTimeZoneIsSameForEqualTimeZones()\n        {\n            var start = new DateTime(2010, 01, 01);\n            var end = new DateTime(2016, 02, 12);\n            var entry = MarketHoursDatabase.FromDataFolder().ExchangeHoursListing.First().Value;\n            var expected = Time.EachTradeableDay(entry.ExchangeHours, start, end);\n            var actual = Time.EachTradeableDayInTimeZone(entry.ExchangeHours, start, end, entry.ExchangeHours.TimeZone, true);\n            CollectionAssert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void EachTradeableDayInTimeZoneWithOffsetPlus12()\n        {\n            var start = new DateTime(2016, 2, 11);\n            var end = new DateTime(2016, 2, 12);\n            var equityExchange = SecurityExchangeHours.AlwaysOpen(DateTimeZone.ForOffset(Offset.FromHours(-5)));\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(7));\n\n            // given this arrangement we should still start on the same date and end a day late\n            var expected = new[] { start, end, end.AddDays(1) };\n            var actual = Time.EachTradeableDayInTimeZone(equityExchange, start, end, dataTimeZone, true);\n            CollectionAssert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void EachTradeableDayInTimeZoneWithOffsetMinus12()\n        {\n            var start = new DateTime(2016, 2, 11);\n            var end = new DateTime(2016, 2, 12);\n            var exchange = SecurityExchangeHours.AlwaysOpen(DateTimeZone.ForOffset(Offset.FromHours(5)));\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-7));\n\n            // given this arrangement we should still start a day early but still end on the same date\n            var expected = new[] { start.AddDays(-1), start, end };\n            var actual = Time.EachTradeableDayInTimeZone(exchange, start, end, dataTimeZone, true);\n            CollectionAssert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void EachTradeableDayInTimeZoneWithOffset25()\n        {\n            var start = new DateTime(2016, 2, 11);\n            var end = new DateTime(2016, 2, 12);\n            var exchange = SecurityExchangeHours.AlwaysOpen(DateTimeZone.ForOffset(Offset.FromHours(12)));\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-13));\n\n            // given this arrangement we should still start a day early but still end on the same date\n            var expected = new[] { start.AddDays(-2), start.AddDays(-1), start };\n            var actual = Time.EachTradeableDayInTimeZone(exchange, start, end, dataTimeZone, true);\n            CollectionAssert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void MultipliesTimeSpans()\n        {\n            var interval = TimeSpan.FromSeconds(1);\n            var expected = TimeSpan.FromSeconds(5);\n            var actual = interval.Multiply(5d);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        [TestCase(2, 7, 3)]\n        [TestCase(2, 4, 2)]\n        [TestCase(6, 7, 1)]\n        public void GetNumberOfTradeBarsForIntervalUsingDailyStepSize(int startDay, int endDay, int expected)\n        {\n            var start = new DateTime(2018, 08, startDay);\n            var end = new DateTime(2018, 08, endDay);\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n            var actual = Time.GetNumberOfTradeBarsInInterval(exchangeHours, start, end, Time.OneDay);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        [TestCase(2, 7, 21)]\n        [TestCase(2, 4, 14)]\n        [TestCase(6, 7, 07)]\n        public void GetNumberOfTradeBarsForIntervalUsingHourlyStepSize(int startDay, int endDay, int expected)\n        {\n            var start = new DateTime(2018, 08, startDay);\n            var end = new DateTime(2018, 08, endDay);\n            var exchangeHours = CreateUsEquitySecurityExchangeHours();\n            var actual = Time.GetNumberOfTradeBarsInInterval(exchangeHours, start, end, Time.OneHour);\n            Assert.AreEqual(expected, actual);\n        }\n\n\n        private static readonly TimeSpan USEquityPreOpen = new TimeSpan(4, 0, 0);\n        private static readonly TimeSpan USEquityOpen = new TimeSpan(9, 30, 0);\n        private static readonly TimeSpan USEquityClose = new TimeSpan(16, 0, 0);\n        private static readonly TimeSpan USEquityPostClose = new TimeSpan(20, 0, 0);\n        private static SecurityExchangeHours CreateUsEquitySecurityExchangeHours()\n        {\n            var sunday = LocalMarketHours.ClosedAllDay(DayOfWeek.Sunday);\n            var monday = new LocalMarketHours(DayOfWeek.Monday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n            var tuesday = new LocalMarketHours(DayOfWeek.Tuesday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n            var wednesday = new LocalMarketHours(DayOfWeek.Wednesday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n            var thursday = new LocalMarketHours(DayOfWeek.Thursday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n            var friday = new LocalMarketHours(DayOfWeek.Friday, USEquityPreOpen, USEquityOpen, USEquityClose, USEquityPostClose);\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan>();\n            var lateOpens = new Dictionary<DateTime, TimeSpan>();\n            var holidays = MarketHoursDatabase.FromDataFolder()\n                        .GetEntry(Market.USA, (string)null, SecurityType.Equity)\n                        .ExchangeHours\n                        .Holidays;\n            return new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n            {\n                sunday, monday, tuesday, wednesday, thursday, friday, saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n        }\n\n        [Test]\n        [TestCase(\"190120\", 2019, 1, 20)]\n        [TestCase(\"20190120\", 2019, 1, 20)]\n        [TestCase(\"20190120 00:00\", 2019, 1, 20)]\n        [TestCase(\"2019-01-20T00:00:00.000Z\", 2019, 1, 20)]\n        [TestCase(\"1/20/2019 00:00:00 AM\", 2019, 1, 20)]\n        [TestCase(\"1/20/19 00:00 AM\", 2019, 1, 20)]\n        [TestCase(\"1/20/19\", 2019, 1, 20)]\n        public void ParseDate(string parseDate, int year, int month, int day)\n        {\n            Assert.AreEqual(new DateTime(year, month, day), Time.ParseDate(parseDate));\n        }\n\n        [Test]\n        [TestCase(\"20190120 02:30\", 2019, 1, 20, 2, 30)]\n        [TestCase(\"1/20/2019 2:30:00 AM\", 2019, 1, 20, 2, 30)]\n        [TestCase(\"1/20/2019 2:30:00 PM\", 2019, 1, 20, 14, 30)]\n        [TestCase(\"1/20/19 2:30 PM\", 2019, 1, 20, 14, 30)]\n        [TestCase(\"2019-01-20T02:30:00.000Z\", 2019, 1, 20, 2, 30)]\n        public void ParseDateAndTime(string parseDate, int year, int month, int day, int hour, int minute)\n        {\n            Assert.AreEqual(new DateTime(year, month, day, hour, minute, 0), Time.ParseDate(parseDate));\n        }\n\n        [Test]\n        [TestCase(\"19981231-23:59:59\", 1998, 12, 31, 23, 59, 59)]\n        [TestCase(\"19990101-00:00:00\", 1999, 01, 01, 00, 00, 00)]\n        [TestCase(\"20210121-21:32:18\", 2021, 01, 21, 21, 32, 18)]\n        public void ParseFIXUtcTimestamp(string parseDate, int year, int month, int day, int hour, int minute, int second)\n        {\n            var expected = new DateTime(year, month, day, hour, minute, second);\n            Assert.AreEqual(\n                expected,\n                Parse.DateTimeExact(parseDate, DateFormat.FIX));\n\n            Assert.AreEqual(\n                expected,\n                Time.ParseFIXUtcTimestamp(parseDate));\n        }\n\n        [Test]\n        [TestCase(\"19981231-23:59:59.000\", 1998, 12, 31, 23, 59, 59, 0)]\n        [TestCase(\"19990101-00:00:00.000\", 1999, 01, 01, 00, 00, 00, 0)]\n        [TestCase(\"20210121-21:32:18.610\", 2021, 01, 21, 21, 32, 18, 610)]\n        public void ParseFIXUtcTimestampWithMillisecond(string parseDate, int year, int month, int day, int hour, int minute, int second, int millisecond)\n        {\n            var expected = new DateTime(year, month, day, hour, minute, second, millisecond);\n            Assert.AreEqual(\n                expected,\n                Parse.DateTimeExact(parseDate, DateFormat.FIXWithMillisecond));\n\n            Assert.AreEqual(\n                expected,\n                Time.ParseFIXUtcTimestamp(parseDate));\n        }\n\n        private static IEnumerable<TestCaseData> ForexHistoryDates => new List<TestCaseData>\n        {\n            new TestCaseData(new DateTime(2018, 04, 02, 1, 0, 0), new DateTime(2018, 04, 01, 01, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(-5))),\n            new TestCaseData(new DateTime(2018, 04, 02, 0, 0, 0), new DateTime(2018, 03, 29, 01, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(-5))),\n            new TestCaseData(new DateTime(2018, 04, 04, 0, 0, 0), new DateTime(2018, 04, 02, 01, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(-5))),\n            new TestCaseData(new DateTime(2018, 04, 02, 1, 0, 0), new DateTime(2018, 03, 29, 15, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(5))),\n            new TestCaseData(new DateTime(2018, 04, 02, 0, 0, 0), new DateTime(2018, 03, 29, 15, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(5))),\n            new TestCaseData(new DateTime(2018, 04, 04, 0, 0, 0), new DateTime(2018, 04, 02, 15, 0, 0), DateTimeZone.ForOffset(Offset.FromHours(5))),\n            new TestCaseData(new DateTime(2018, 04, 02, 1, 0, 0), new DateTime(2018, 03, 31, 20, 0, 0), DateTimeZone.Utc),\n            new TestCaseData(new DateTime(2018, 04, 02, 0, 0, 0), new DateTime(2018, 03, 31, 20, 0, 0), DateTimeZone.Utc),\n            new TestCaseData(new DateTime(2018, 04, 04, 0, 0, 0), new DateTime(2018, 04, 02, 20, 0, 0), DateTimeZone.Utc)\n        };\n\n        private static IEnumerable<TestCaseData> EquityHistoryDates => new List<TestCaseData>\n        {\n            new TestCaseData(new DateTime(2013, 10, 08, 17, 0, 0), new DateTime(2013, 10, 08, 15, 50, 0), DateTimeZone.Utc),\n            new TestCaseData(new DateTime(2013, 10, 08, 13, 0, 0), new DateTime(2013, 10, 08, 12, 50, 0), DateTimeZone.Utc),\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/TimeZoneOffsetProviderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class TimeZoneOffsetProviderTests\n    {\n        [Test]\n        public void ReturnsCurrentOffset()\n        {\n            var utcDate = new DateTime(2015, 07, 07);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, utcDate, utcDate.AddDays(1));\n            var currentOffset = offsetProvider.GetOffsetTicks(utcDate);\n            Assert.AreEqual(-TimeSpan.FromHours(4).TotalHours, TimeSpan.FromTicks(currentOffset).TotalHours);\n        }\n\n        [Test]\n        public void ReturnsCorrectOffsetBeforeDST()\n        {\n            // one tick before DST goes into affect\n            var utcDate = new DateTime(2015, 03, 08, 2, 0, 0).AddHours(5).AddTicks(-1);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, utcDate, utcDate.AddDays(1));\n            var currentOffset = offsetProvider.GetOffsetTicks(utcDate);\n            Assert.AreEqual(-TimeSpan.FromHours(5).TotalHours, TimeSpan.FromTicks(currentOffset).TotalHours);\n        }\n\n        [Test]\n        public void ReturnsCorrectOffsetAfterDST()\n        {\n            // the exact instant DST goes into affect\n            var utcDate = new DateTime(2015, 03, 08, 2, 0, 0).AddHours(5);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, utcDate, utcDate.AddDays(1));\n            var currentOffset = offsetProvider.GetOffsetTicks(utcDate);\n            Assert.AreEqual(-TimeSpan.FromHours(4).TotalHours, TimeSpan.FromTicks(currentOffset).TotalHours);\n        }\n\n        [Test]\n        public void ConvertFromUtcAfterDST()\n        {\n            // the exact instant DST goes into affect\n            var tzDate = new DateTime(2015, 03, 08, 2, 0, 0);\n            var utcDate = tzDate.AddHours(5);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, utcDate, utcDate.AddDays(1));\n            var result = offsetProvider.ConvertFromUtc(utcDate);\n\n            // We add an hour due to the effect of DST\n            Assert.AreEqual(tzDate + TimeSpan.FromHours(1), result);\n        }\n\n        [Test]\n        public void ConvertToUtcAfterDST()\n        {\n            // the exact instant DST goes into affect\n            var tzDate = new DateTime(2015, 03, 08, 2, 0, 0);\n            var utcDate = tzDate.AddHours(5);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, utcDate, utcDate.AddDays(1));\n            var result = offsetProvider.ConvertToUtc(tzDate);\n\n            // We substract an hour due to the effect of DST\n            Assert.AreEqual(utcDate - TimeSpan.FromHours(1), result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/TimeZonesTest.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class TimeZonesTest\n    {\n        [Test]\n        public void TimeZonesLoadFromTzdb()\n        {\n            // verifies each of the fields in the TimeZones class can be retrieved.\n            foreach (var field in typeof(TimeZones).GetFields())\n            {\n                var value = field.GetValue(null);\n                Assert.IsNotNull(value);\n                Assert.IsInstanceOf(typeof (DateTimeZone), value);\n                Log.Trace(((DateTimeZone)value).Id);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/BaseDataExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class BaseDataExtensionsTests\n    {\n        private SubscriptionDataConfig _config;\n        const decimal _factor = 0.5m;\n\n        [SetUp]\n        public void Setup()\n        {\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n\n            _config.DataNormalizationMode = DataNormalizationMode.Adjusted;\n            _config.PriceScaleFactor = _factor;\n        }\n\n        [Test]\n        public void AdjustTradeBar()\n        {\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400,\n                Volume = 10000\n            };\n\n            var adjustedTb = tb.Clone(tb.IsFillForward).Normalize(_factor, DataNormalizationMode.Adjusted, 0);\n\n            Assert.AreEqual(tb.Open * _factor, (adjustedTb as TradeBar).Open);\n            Assert.AreEqual(tb.High * _factor, (adjustedTb as TradeBar).High);\n            Assert.AreEqual(tb.Low * _factor, (adjustedTb as TradeBar).Low);\n            Assert.AreEqual(tb.Close * _factor, (adjustedTb as TradeBar).Close);\n            Assert.AreEqual(tb.Volume / _factor, (adjustedTb as TradeBar).Volume);\n        }\n\n        [Test]\n        public void AdjustTick()\n        {\n            var tick = new Tick\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Symbol = Symbols.SPY,\n                Value = 100,\n                Quantity = 10\n            };\n\n            var adjustedTick = tick.Clone(tick.IsFillForward).Normalize(_factor, DataNormalizationMode.Adjusted, 0);\n\n            Assert.AreEqual(tick.Value * _factor, (adjustedTick as Tick).Value);\n            Assert.AreEqual(tick.Quantity / _factor, (adjustedTick as Tick).Quantity);\n        }\n\n        [Test]\n        public void AdjustQuoteTick()\n        {\n            var tick = new Tick\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Symbol = Symbols.SPY,\n                TickType = TickType.Quote,\n                AskPrice = 100,\n                BidPrice = 99,\n                AskSize = 100,\n                BidSize = 10\n            };\n\n            var adjustedTick = tick.Clone(tick.IsFillForward).Normalize(_factor, DataNormalizationMode.Adjusted, 0);\n\n            Assert.AreEqual(tick.AskPrice * _factor, (adjustedTick as Tick).AskPrice);\n            Assert.AreEqual(tick.BidPrice * _factor, (adjustedTick as Tick).BidPrice);\n            Assert.AreEqual(tick.AskSize / _factor, (adjustedTick as Tick).AskSize);\n            Assert.AreEqual(tick.BidSize / _factor, (adjustedTick as Tick).BidSize);\n        }\n\n        [Test]\n        public void AdjustQuoteBar()\n        {\n            var qb = new QuoteBar(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                new Bar(10, 10, 10, 10),\n                100,\n                new Bar(10, 10, 10, 10),\n                100);\n\n            var adjustedQb = qb.Clone(qb.IsFillForward).Normalize(_factor, DataNormalizationMode.Adjusted, 0);\n\n            Assert.AreEqual(qb.Value, qb.Close);\n\n            // bid\n            Assert.AreEqual(qb.Bid.Open * _factor, (adjustedQb as QuoteBar).Bid.Open);\n            Assert.AreEqual(qb.Bid.Close * _factor, (adjustedQb as QuoteBar).Bid.Close);\n            Assert.AreEqual(qb.Bid.High * _factor, (adjustedQb as QuoteBar).Bid.High);\n            Assert.AreEqual(qb.Bid.Low * _factor, (adjustedQb as QuoteBar).Bid.Low);\n            Assert.AreEqual(qb.LastBidSize / _factor, (adjustedQb as QuoteBar).LastBidSize);\n            // ask\n            Assert.AreEqual(qb.Ask.Open * _factor, (adjustedQb as QuoteBar).Ask.Open);\n            Assert.AreEqual(qb.Ask.Close * _factor, (adjustedQb as QuoteBar).Ask.Close);\n            Assert.AreEqual(qb.Ask.High * _factor, (adjustedQb as QuoteBar).Ask.High);\n            Assert.AreEqual(qb.Ask.Low * _factor, (adjustedQb as QuoteBar).Ask.Low);\n            Assert.AreEqual(qb.LastAskSize / _factor, (adjustedQb as QuoteBar).LastAskSize);\n        }\n\n        [Test]\n        public void AdjustTradeBarUsingConfig()\n        {\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400,\n                Volume = 1000\n            };\n\n            var adjustedTb = tb.Clone(tb.IsFillForward).Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);\n\n            Assert.AreEqual(tb.Open * _factor, (adjustedTb as TradeBar).Open);\n            Assert.AreEqual(tb.High * _factor, (adjustedTb as TradeBar).High);\n            Assert.AreEqual(tb.Low * _factor, (adjustedTb as TradeBar).Low);\n            Assert.AreEqual(tb.Close * _factor, (adjustedTb as TradeBar).Close);\n            Assert.AreEqual(tb.Volume / _factor, (adjustedTb as TradeBar).Volume);\n        }\n\n        [Test]\n        public void AdjustTickUsingConfig()\n        {\n            var tick = new Tick\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Symbol = Symbols.SPY,\n                Value = 100,\n                Quantity = 10\n            };\n\n            var adjustedTick = tick.Clone(tick.IsFillForward).Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);\n\n            Assert.AreEqual(tick.Value * _factor, (adjustedTick as Tick).Value);\n            Assert.AreEqual(tick.Quantity / _factor, (adjustedTick as Tick).Quantity);\n        }\n\n        [Test]\n        public void AdjustQuoteTickUsingConfig()\n        {\n            var tick = new Tick\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Symbol = Symbols.SPY,\n                TickType = TickType.Quote,\n                AskPrice = 100,\n                BidPrice = 99,\n                AskSize = 100,\n                BidSize = 10\n            };\n\n            var adjustedTick = tick.Clone(tick.IsFillForward).Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);\n\n            Assert.AreEqual(tick.AskPrice * _factor, (adjustedTick as Tick).AskPrice);\n            Assert.AreEqual(tick.BidPrice * _factor, (adjustedTick as Tick).BidPrice);\n            Assert.AreEqual(tick.AskSize / _factor, (adjustedTick as Tick).AskSize);\n            Assert.AreEqual(tick.BidSize / _factor, (adjustedTick as Tick).BidSize);\n        }\n\n        [Test]\n        public void AdjustQuoteBarUsingConfig()\n        {\n            var qb = new QuoteBar(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                new Bar(10, 10, 10, 10),\n                100,\n                new Bar(10, 10, 10, 10),\n                100);\n\n            var adjustedQb = qb.Clone(qb.IsFillForward).Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);\n\n            Assert.AreEqual(qb.Value, qb.Close);\n\n            // bid\n            Assert.AreEqual(qb.Bid.Open * _factor, (adjustedQb as QuoteBar).Bid.Open);\n            Assert.AreEqual(qb.Bid.Close * _factor, (adjustedQb as QuoteBar).Bid.Close);\n            Assert.AreEqual(qb.Bid.High * _factor, (adjustedQb as QuoteBar).Bid.High);\n            Assert.AreEqual(qb.Bid.Low * _factor, (adjustedQb as QuoteBar).Bid.Low);\n            Assert.AreEqual(qb.LastBidSize / _factor, (adjustedQb as QuoteBar).LastBidSize);\n            // ask\n            Assert.AreEqual(qb.Ask.Open * _factor, (adjustedQb as QuoteBar).Ask.Open);\n            Assert.AreEqual(qb.Ask.Close * _factor, (adjustedQb as QuoteBar).Ask.Close);\n            Assert.AreEqual(qb.Ask.High * _factor, (adjustedQb as QuoteBar).Ask.High);\n            Assert.AreEqual(qb.Ask.Low * _factor, (adjustedQb as QuoteBar).Ask.Low);\n            Assert.AreEqual(qb.LastAskSize / _factor, (adjustedQb as QuoteBar).LastAskSize);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/BusyBlockingCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class BusyBlockingCollectionTests\n    {\n        [Test]\n        public void IsNotBusyWithZeroItemsWaiting()\n        {\n            using var collection = new BusyBlockingCollection<int>();\n            Assert.IsTrue(collection.WaitHandle.WaitOne(0));\n        }\n\n        [Test]\n        public void IsBusyWithItemsWaiting()\n        {\n            using var collection = new BusyBlockingCollection<int>();\n            collection.Add(1);\n            Assert.IsFalse(collection.WaitHandle.WaitOne(0));\n        }\n\n        [Test]\n        public void GetConsumingEnumerableReturnsItemsInOrder()\n        {\n            using var collection = new BusyBlockingCollection<int>();\n            collection.Add(1);\n            collection.Add(2);\n            collection.Add(3);\n            collection.CompleteAdding();\n            CollectionAssert.AreEquivalent(new[]{1,2,3}, collection.GetConsumingEnumerable());\n        }\n\n        [Test]\n        public void WaitForProcessingCompletedDuringGetConsumingEnumerable()\n        {\n            using var collection = new BusyBlockingCollection<int>();\n            collection.Add(1);\n            collection.Add(2);\n            collection.Add(3);\n            collection.CompleteAdding();\n            Assert.IsFalse(collection.WaitHandle.WaitOne(0));\n            foreach (var item in collection.GetConsumingEnumerable())\n            {\n                Assert.IsFalse(collection.WaitHandle.WaitOne(0));\n            }\n            Assert.IsTrue(collection.WaitHandle.WaitOne(0));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/CandlestickJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class CandlestickJsonConverterTests\n    {\n        [Test]\n        public void SerializeDeserializeReturnsSameValue()\n        {\n            var dateTime = new DateTime(2023, 08, 01, 12, 11, 10);\n            var candlestick = new Candlestick(dateTime, 100, 110, 80, 90);\n\n            var serializedCandlestick = JsonConvert.SerializeObject(candlestick);\n            var result = (Candlestick)JsonConvert.DeserializeObject(serializedCandlestick, typeof(Candlestick));\n\n            Assert.AreEqual(candlestick.Time, result.Time);\n            Assert.AreEqual(candlestick.Open, result.Open);\n            Assert.AreEqual(candlestick.High, result.High);\n            Assert.AreEqual(candlestick.Low, result.Low);\n            Assert.AreEqual(candlestick.Close, result.Close);\n        }\n\n        [Test]\n        public void BackwardsCompatility()\n        {\n            var dateTime = new DateTime(2023, 08, 01, 12, 11, 10);\n            var chartPoint = new ChartPoint(dateTime, 100);\n\n            var serializedChartPoint = JsonConvert.SerializeObject(chartPoint);\n            var result = (Candlestick)JsonConvert.DeserializeObject(serializedChartPoint, typeof(Candlestick));\n\n            Assert.AreEqual(chartPoint.Time, result.Time);\n            Assert.AreEqual(chartPoint.y, result.Open);\n            Assert.AreEqual(chartPoint.y, result.High);\n            Assert.AreEqual(chartPoint.y, result.Low);\n            Assert.AreEqual(chartPoint.y, result.Close);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ColorJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Drawing;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ColorJsonConverterTests\n    {\n        [Test]\n        public void ConvertsKnownColorToJson()\n        {\n            var container = new ColorContainer { Color = Color.Blue };\n            var json = JsonConvert.SerializeObject(container);\n            Assert.AreEqual(\"{\\\"Color\\\":\\\"#0000FF\\\"}\", json);\n        }\n        [Test]\n        public void ConvertsEmptyColorToJson()\n        {\n            var container = new ColorContainer { Color = Color.Empty };\n            var json = JsonConvert.SerializeObject(container);\n            Assert.AreEqual(\"{\\\"Color\\\":\\\"\\\"}\", json);\n        }\n\n        [Test]\n        public void ConvertJsonToColorTest()\n        {\n            const string jsonValue = \"{ 'Color': '#FFFFFF' }\";\n            var converted = JsonConvert.DeserializeObject<ColorContainer>(jsonValue).Color;\n            Assert.AreEqual(Color.White.ToArgb(), converted.ToArgb());\n        }\n\n        struct ColorContainer\n        {\n            [JsonConverter(typeof(ColorJsonConverter))]\n            public Color Color;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Util/ComparisonOperatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ComparisonOperatorTests\n    {\n        private static TestCaseData[] Equal => new[]\n        {\n            new TestCaseData(1, 1),\n            new TestCaseData(1.0, 1.0),\n            new TestCaseData(1.0m, 1.0m)\n        };\n\n        private static TestCaseData[] Greater => new[]\n        {\n            new TestCaseData(2, 1),\n            new TestCaseData(2.0, 1.5),\n            new TestCaseData(2.0m, 1.1m)\n        };\n\n        [Test, TestCaseSource(nameof(Equal))]\n        public void ShouldBeEqual(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.Equals, arg1, arg2));\n            Assert.IsTrue(ComparisonOperatorTypes.Equals.Compare(arg1, arg2));\n        }\n\n        [Test, TestCaseSource(nameof(Greater))]\n        public void ShouldBeNotEqual(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.NotEqual, arg1, arg2));\n            Assert.IsTrue(ComparisonOperatorTypes.NotEqual.Compare(arg1, arg2));\n        }\n\n        [Test, TestCaseSource(nameof(Greater))]\n        public void ShouldBeGreater(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.Greater, arg1, arg2));\n            Assert.IsTrue(ComparisonOperatorTypes.Greater.Compare(arg1, arg2));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(Greater))]\n        [TestCaseSource(nameof(Equal))]\n        public void ShouldBeGreaterOrEqual(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.GreaterOrEqual, arg1, arg2));\n            Assert.IsTrue(ComparisonOperatorTypes.GreaterOrEqual.Compare(arg1, arg2));\n        }\n\n        [Test, TestCaseSource(nameof(Greater))]\n        public void ShouldBLess(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.Less, arg2, arg1));\n            Assert.IsTrue(ComparisonOperatorTypes.Less.Compare(arg2, arg1));\n        }\n\n        [Test]\n        [TestCaseSource(nameof(Greater))]\n        [TestCaseSource(nameof(Equal))]\n        public void ShouldBeLessOrEqual(IComparable arg1, IComparable arg2)\n        {\n            Assert.IsTrue(ComparisonOperator.Compare(ComparisonOperatorTypes.LessOrEqual, arg2, arg1));\n            Assert.IsTrue(ComparisonOperatorTypes.LessOrEqual.Compare(arg2, arg1));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ComposerTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.ComponentModel.Composition;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ComposerTests\n    {\n        [Test]\n        public void GetExportedValueByTypeName()\n        {\n            var instance = Composer.Instance.GetExportedValueByTypeName<IExport2>(\"Export6\");\n            Assert.AreEqual(typeof(Export6), instance.GetType());\n\n            var instance2 = Composer.Instance.GetExportedValueByTypeName<IExport2>(\"Export7\");\n            Assert.AreEqual(typeof(Export7), instance2.GetType());\n\n            var instance3 = Composer.Instance.GetExportedValueByTypeName<IExport2>(\"Export8\", forceTypeNameOnExisting: false);\n            Assert.AreNotEqual(typeof(Export8), instance3.GetType());\n        }\n\n        [Test]\n        public void ComposesTypes()\n        {\n            var instances = Composer.Instance.GetExportedValues<IExport>().ToList();\n            Assert.AreEqual(5, instances.Count);\n            Assert.AreEqual(1, instances.Count(x => x.GetType() == typeof (Export1)));\n            Assert.AreEqual(1, instances.Count(x => x.GetType() == typeof (Export2)));\n            Assert.AreEqual(1, instances.Count(x => x.GetType() == typeof (Export3)));\n            Assert.AreEqual(1, instances.Count(x => x.GetType() == typeof (Export4)));\n            Assert.AreEqual(1, instances.Count(x => x.GetType() == typeof(Export5)));\n        }\n\n        [Test]\n        public void GetsInstanceUsingPredicate()\n        {\n            var instance = Composer.Instance.Single<IExport>(x => x.Id == 3);\n            Assert.IsNotNull(instance);\n            Assert.IsInstanceOf(typeof (Export3), instance);\n        }\n\n        [Test]\n        public void ResetsReturnsSameInstances()\n        {\n            var composer = Composer.Instance;\n            var export1 = composer.Single<IExport>(x => x.Id == 3);\n            Assert.IsNotNull(export1);\n            composer.Reset();\n            var export2 = composer.Single<IExport>(x => x.Id == 3);\n            Assert.AreEqual(export1, export2);\n        }\n\n        [Test]\n        public void GetsMultipleInterfacesInstance()\n        {\n            var instance1 = Composer.Instance.Single<IOneMoreExport>(x => x.Export == 5);\n            Assert.IsNotNull(instance1);\n            Assert.IsInstanceOf(typeof(Export5), instance1);\n\n            var instance2 = Composer.Instance.Single<IExport>(x => x.Id == 5);\n            Assert.IsNotNull(instance2);\n            Assert.IsInstanceOf(typeof(Export5), instance2);\n\n            Assert.AreEqual(instance1, instance2);\n        }\n\n        [InheritedExport(typeof(IExport))]\n        interface IExport\n        {\n            int Id { get; }\n        }\n\n        [InheritedExport(typeof(IOneMoreExport))]\n        interface IOneMoreExport\n        {\n            decimal Export { get; }\n        }\n\n        class Export1 : IExport\n        {\n            public int Id { get { return 1; } }\n        }\n        class Export2 : IExport\n        {\n            public int Id { get { return 2; } }\n        }\n        class Export3 : IExport\n        {\n            public int Id { get { return 3; } }\n        }\n        class Export4 : IExport\n        {\n            public int Id { get { return 4; } }\n        }\n\n        class Export5 : IExport, IOneMoreExport\n        {\n            public decimal Export { get { return 5; } }\n\n            public int Id { get { return 5; } }\n        }\n\n\n        [InheritedExport(typeof(IExport2))]\n        interface IExport2\n        {\n            int Id { get; }\n        }\n        class Export6 : IExport2\n        {\n            public int Id { get { return 6; } }\n        }\n        class Export7 : IExport2\n        {\n            public int Id { get { return 7; } }\n        }\n        class Export8 : IExport2\n        {\n            public int Id { get { return 8; } }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ConcurrentSetTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ConcurrentSetTests\n    {\n        [Test]\n        public void UnionWith_Matches_HashSet()\n        {\n            var set = new ConcurrentSet<int> { 1, 2, 3, 4 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.UnionWith(other); return s; });\n        }\n\n        [Test]\n        public void IntersectWith_Matches_HashSet()\n        {\n            var set = new ConcurrentSet<int> { 1, 2, 3, 4 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IntersectWith(other); return s; });\n        }\n\n        [Test]\n        public void ExceptWith_Matches_HashSet()\n        {\n            var set = new ConcurrentSet<int> { 1, 2, 3, 4 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.ExceptWith(other); return s; });\n        }\n\n        [Test]\n        public void SymmetricExceptWith_Matches_HashSet()\n        {\n            var set = new ConcurrentSet<int> { 1, 2, 3, 4 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.SymmetricExceptWith(other); return s; });\n        }\n\n        [Test]\n        public void IsSubsetOf_Matches_HashSet_True_NonStrict()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsSubsetOf_Matches_HashSet_True_Strict()\n        {\n            var set = new ConcurrentSet<int> { 4, 5 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsSubsetOf_Matches_HashSet_False()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6, 7 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsSupersetOf_Matches_HashSet_True_NonStrict()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsSupersetOf_Matches_HashSet_True_Strict()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6, 7 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsSupersetOf_Matches_HashSet_False()\n        {\n            var set = new ConcurrentSet<int> { 4, 5 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsProperSupersetOf_Matches_HashSet_True()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6, 7 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsProperSupersetOf_Matches_HashSet_False()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsProperSubsetOf_Matches_HashSet_True()\n        {\n            var set = new ConcurrentSet<int> { 4, 5 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void IsProperSubsetOf_Matches_HashSet_False()\n        {\n            var set = new ConcurrentSet<int> { 4, 5, 6 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void Overlaps_Matches_HashSet_True()\n        {\n            var set = new ConcurrentSet<int> { 4, 5 };\n            var other = new HashSet<int> { 4, 5, 6 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void Overlaps_Matches_HashSet_False()\n        {\n            var set = new ConcurrentSet<int> { 4, 5 };\n            var other = new HashSet<int> { 6, 7 };\n\n            CompareWithHashSet(set, s => { s.IsSubsetOf(other); return s; });\n        }\n\n        [Test]\n        public void KeepsInsertionOrder_UnionWith()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n            var other = new HashSet<int> { 6, 7, 1, 3 };\n\n            set.UnionWith(other);\n            CollectionAssert.AreEqual(set, new[] { 0, 4, 2, 5, 6, 7, 1, 3 });\n        }\n\n        [Test]\n        public void KeepsInsertionOrder_Add()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n\n            set.Add(-1);\n            set.Add(11);\n            CollectionAssert.AreEqual(set, new[] { 0, 4, 2, 5, -1, 11 });\n        }\n\n        [Test]\n        public void IgnoresDuplicates()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n\n            set.Add(-1);\n            set.Add(-1);\n            set.Add(-1);\n            CollectionAssert.AreEqual(set, new[] { 0, 4, 2, 5, -1 });\n        }\n\n        [Test]\n        public void RemoveItem()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n\n            set.Remove(4);\n            set.Remove(4);\n            CollectionAssert.AreEqual(set, new[] { 0, 2, 5 });\n        }\n\n        [Test]\n        public void ClearCollection()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n\n            set.Clear();\n            CollectionAssert.AreEqual(set, new int[] { });\n        }\n\n        [Test]\n        public void KeepsInsertionOrder_Remove()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5 };\n\n            set.Remove(2);\n            CollectionAssert.AreEqual(set, new[] { 0, 4, 5 });\n        }\n\n        [Test]\n        public void KeepsInsertionOrder()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5, 6, 7, 1, 3 };\n\n            CollectionAssert.AreEqual(set, new[] { 0, 4, 2, 5, 6, 7, 1, 3 });\n        }\n\n        [Test]\n        public void EnumerableIsThreadSafe()\n        {\n            var set = new ConcurrentSet<int> { 0, 4, 2, 5, 6, 7, 1, 3 };\n\n            foreach (var value in set)\n            {\n                set.Remove(value);\n            }\n        }\n\n        [Test]\n        public void ConsolidatorsEnumeratedInOrder()\n        {\n            var set = new ConcurrentSet<IDataConsolidator>();\n            for (var i = 0; i < 500; i++)\n            {\n                set.Add(new TestConsolidator(i));\n            }\n\n            var j = 0;\n            foreach (var value in set)\n            {\n                Assert.AreEqual(j, (value as TestConsolidator).Id);\n                j++;\n            }\n        }\n\n        private void CompareWithHashSet<T>(ConcurrentSet<T> set, Func<ISet<T>, ISet<T>> func)\n        {\n            var asHashSet = set.ToHashSet();\n            var expected = func(asHashSet);\n            var actual = func(set);\n            CollectionAssert.AreEquivalent(expected, actual);\n        }\n\n        private class TestConsolidator : PeriodCountConsolidatorBase<QuoteBar, QuoteBar>\n        {\n            public int Id { get; }\n\n            public TestConsolidator(int maxCount) : base(maxCount)\n            {\n                Id = maxCount;\n            }\n\n            public override void Reset()\n            {\n            }\n\n            protected override void AggregateBar(ref QuoteBar workingBar, QuoteBar data)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/CurrencyPairUtilTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing static QuantConnect.Util.CurrencyPairUtil;\n\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class CurrencyPairUtilTests\n    {\n        [TestCaseSource(nameof(decomposeSuccessCases))]\n        public void DecomposeDecomposesAllCurrencyPairTypes(\n            Symbol symbol,\n            string expectedBaseCurrency,\n            string expectedQuoteCurrency)\n        {\n            string actualBaseCurrency;\n            string actualQuoteCurrency;\n\n            CurrencyPairUtil.DecomposeCurrencyPair(symbol, out actualBaseCurrency, out actualQuoteCurrency);\n\n            Assert.AreEqual(expectedBaseCurrency, actualBaseCurrency);\n            Assert.AreEqual(expectedQuoteCurrency, actualQuoteCurrency);\n        }\n\n        [TestCaseSource(nameof(decomposeThrowCases))]\n        public void DecomposeThrowsOnNonCurrencyPair(Symbol symbol)\n        {\n            string baseCurrency, quoteCurrency;\n\n            Assert.Throws<ArgumentException>(\n                () => CurrencyPairUtil.DecomposeCurrencyPair(symbol, out baseCurrency, out quoteCurrency));\n        }\n\n        [TestCaseSource(nameof(isDecomposableCases))]\n        public void IsDecomposableWorksCorrectly(Symbol symbol, bool expectedResult)\n        {\n            Assert.AreEqual(expectedResult, CurrencyPairUtil.IsDecomposable(symbol));\n        }\n\n        [TestCase(\"CHNTUSD\", \"CHN\", \"TUSD\", Match.NoMatch)]\n        [TestCase(\"CHNTUSD\", \"CHNT\", \"USD\", Match.ExactMatch)]\n        [TestCase(\"CHNTUSD\", \"USD\", \"CHNT\", Match.InverseMatch)]\n        public void CurrencyPairMatchComparisonLogic(string symbolValue, string baseCurrency, string quoteCurrency, Match expectedResult)\n        {\n            var symbol = Symbol.Create(symbolValue, SecurityType.Crypto, Market.Bitfinex);\n            var result = CurrencyPairUtil.ComparePair(symbol, baseCurrency, quoteCurrency);\n            Assert.AreEqual(expectedResult, result);\n        }\n\n        [Test]\n        public void CurrencyPairDualForex()\n        {\n            var currencyPair = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM);\n\n            Assert.AreEqual(\"USD\", currencyPair.CurrencyPairDual(\"EUR\"));\n            Assert.AreEqual(\"EUR\", currencyPair.CurrencyPairDual(\"USD\"));\n            Assert.AreEqual(\"USD\", CurrencyPairUtil.CurrencyPairDual(\"EUR\", \"USD\", \"EUR\"));\n            Assert.AreEqual(\"EUR\", CurrencyPairUtil.CurrencyPairDual(\"EUR\", \"USD\", \"USD\"));\n        }\n\n        [Test]\n        public void CurrencyPairDualCfd()\n        {\n            var currencyPair = Symbol.Create(\"XAGUSD\", SecurityType.Cfd, Market.Oanda);\n\n            Assert.AreEqual(\"XAG\", currencyPair.CurrencyPairDual(\"USD\"));\n            Assert.AreEqual(\"USD\", currencyPair.CurrencyPairDual(\"XAG\"));\n            Assert.AreEqual(\"XAG\", CurrencyPairUtil.CurrencyPairDual(\"XAG\", \"USD\", \"USD\"));\n            Assert.AreEqual(\"USD\", CurrencyPairUtil.CurrencyPairDual(\"XAG\", \"USD\", \"XAG\"));\n        }\n\n        [Test]\n        public void CurrencyPairDualCrypto()\n        {\n            var currencyPair = Symbol.Create(\"ETHBTC\", SecurityType.Crypto, Market.Bitfinex);\n\n            Assert.AreEqual(\"BTC\", currencyPair.CurrencyPairDual(\"ETH\"));\n            Assert.AreEqual(\"ETH\", currencyPair.CurrencyPairDual(\"BTC\"));\n            Assert.AreEqual(\"BTC\", CurrencyPairUtil.CurrencyPairDual(\"ETH\", \"BTC\", \"ETH\"));\n            Assert.AreEqual(\"ETH\", CurrencyPairUtil.CurrencyPairDual(\"ETH\", \"BTC\", \"BTC\"));\n        }\n\n        [Test]\n        public void CurrencyPairDualReturnsNullOnWrongKnownSymbol()\n        {\n            var currencyPair = Symbol.Create(\"ETHBTC\", SecurityType.Crypto, Market.Bitfinex);\n\n            Assert.AreEqual(null, currencyPair.CurrencyPairDual(\"ZRX\"));\n            Assert.AreEqual(null, CurrencyPairUtil.CurrencyPairDual(\"ETH\", \"BTC\", \"ZRX\"));\n        }\n\n        [Test]\n        public void ComparePairWorksCorrectly()\n        {\n            var ethusd = Symbol.Create(\"ETHUSD\", SecurityType.Crypto, Market.Bitfinex);\n            var eurusd = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM);\n\n            Assert.AreEqual(CurrencyPairUtil.Match.ExactMatch, ethusd.ComparePair(\"ETH\", \"USD\"));\n            Assert.AreEqual(CurrencyPairUtil.Match.InverseMatch, eurusd.ComparePair(\"USD\", \"EUR\"));\n            Assert.AreEqual(CurrencyPairUtil.Match.NoMatch, ethusd.ComparePair(\"BTC\", \"USD\"));\n        }\n\n        [Test]\n        public void ComparePairWorksCorrectlyStableCoinsExactMatch()\n        {\n            var btcusdt = Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Binance);\n            var btcxchf = Symbol.Create(\"BTCXCHF\", SecurityType.Crypto, Market.Bitfinex);\n\n            Assert.AreEqual(CurrencyPairUtil.Match.ExactMatch, btcusdt.ComparePair(\"BTC\", \"USD\"));\n            Assert.AreEqual(CurrencyPairUtil.Match.ExactMatch, btcxchf.ComparePair(\"BTC\", \"CHF\"));\n        }\n\n        [Test]\n        public void ComparePairWorksCorrectlyStableCoinsInverseMatch()\n        {\n            var btcusdt = Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Binance);\n            var btcxchf = Symbol.Create(\"BTCXCHF\", SecurityType.Crypto, Market.Bitfinex);\n\n            Assert.AreEqual(CurrencyPairUtil.Match.InverseMatch, btcusdt.ComparePair(\"USD\", \"BTC\"));\n            Assert.AreEqual(CurrencyPairUtil.Match.InverseMatch, btcxchf.ComparePair(\"CHF\", \"BTC\"));\n        }\n\n        [Test]\n        public void ComparePairWorksCorrectlyStableCoinsNoMatch()\n        {\n            var btceur = Symbol.Create(\"BTCEUR\", SecurityType.Crypto, Market.Binance);\n            var btcidr = Symbol.Create(\"BTCIDR\", SecurityType.Crypto, Market.Binance);\n\n            Assert.AreEqual(CurrencyPairUtil.Match.NoMatch, btceur.ComparePair(\"BTC\", \"USD\"));\n            Assert.AreEqual(CurrencyPairUtil.Match.NoMatch, btcidr.ComparePair(\"BTC\", \"EUR\"));\n        }\n\n        [Test]\n        public void ComparePairWorksCorrectlyWithDoubleStableCoinMatch()\n        {\n            var idrusd = Symbol.Create(\"IDRUSD\", SecurityType.Crypto, Market.Binance);\n\n            Assert.AreEqual(CurrencyPairUtil.Match.ExactMatch, idrusd.ComparePair(\"IDRT\", \"USDT\"));\n        }\n\n        /// <summary>\n        /// DecomposeCurrencyPair test cases with successful results:\n        /// symbol, expectedBaseCurrency, expectedQuoteCurrency\n        /// </summary>\n        private static object[][] decomposeSuccessCases =\n        {\n            new object[] { Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM), \"EUR\", \"USD\" },\n            new object[] { Symbol.Create(\"NZDSGD\", SecurityType.Forex, Market.Oanda), \"NZD\", \"SGD\" },\n            new object[] { Symbol.Create(\"XAGUSD\", SecurityType.Cfd, Market.FXCM), \"XAG\", \"USD\" },\n            new object[] { Symbol.Create(\"US30USD\", SecurityType.Cfd, Market.Oanda), \"US30\", \"USD\" },\n            new object[] { Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Bitfinex), \"BTC\", \"USD\" },\n            new object[] { Symbol.Create(\"BTCUSDT\", SecurityType.Crypto, Market.Binance), \"BTC\", \"USDT\" }\n        };\n\n        /// <summary>\n        /// DecomposeCurrencyPair test cases where method should throw:\n        /// symbol\n        /// </summary>\n        private static object[][] decomposeThrowCases =\n        {\n            new object[] { null },\n            new object[] { Symbol.Empty },\n            new object[] { Symbols.SPY },\n            new object[] { Symbols.SPY_C_192_Feb19_2016 },\n            new object[] { Symbols.Fut_SPY_Feb19_2016 }\n        };\n\n        /// <summary>\n        /// IsDecomposable test cases:\n        /// symbol, expectedResult\n        /// </summary>\n        private static object[][] isDecomposableCases =\n        {\n            // Forex, CFD and crypto are usually decomposable\n            new object[] { Symbols.EURUSD, true },\n            new object[] { Symbols.XAGUSD, true },\n            new object[] { Symbols.BTCUSD, true },\n\n            // CFD, but ticker doesn't end with quote currency, so no way to extract base currency\n            new object[] { Symbol.Create(\"AU200AUD\", SecurityType.Cfd, Market.FXCM), false },\n\n            // Obviously not decomposable\n            new object[] { null, false },\n            new object[] { Symbol.Empty, false },\n\n            // Other security types, also not decomposable\n            new object[] { Symbols.SPY, false },\n            new object[] { Symbols.SPY_C_192_Feb19_2016, false },\n            new object[] { Symbols.Fut_SPY_Feb19_2016, false }\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/DataDownloaderGetParameterExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing System.Globalization;\nusing Microsoft.CodeAnalysis;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class DataDownloaderGetParameterExtensionsTests\n    {\n        private MarketHoursDatabase _marketHoursDatabase;\n        private IMapFileProvider _mapFileProvider;\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            _mapFileProvider = TestGlobals.MapFileProvider;\n            _marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n        }\n\n        [TestCase(\"../../../Data/equity/usa/hour/spwr.zip\", 2, \"SPWR\", \"2005/11/17-2008/09/29,2011/11/17-2024/03/07\")]\n        [TestCase(\"../../../Data/equity/usa/hour/meta.zip\", 1, \"META\", \"1899/12/30-2024/03/07\", Description = \"Not presented in mapped files\")]\n        [TestCase(\"../../../Data/equity/usa/hour/fb.zip\", 2, \"FB\", \"1999/09/29-2003/03/28,2012/05/18-2024/03/07\")]\n        [TestCase(\"../../../Data/equity/usa/hour/goog.zip\", 2, \"GOOG\", \"2004/08/19-2014/04/02,2014/04/03-2024/03/07\")]\n        [TestCase(\"../../../Data/equity/usa/daily/goog.zip\", 2, \"GOOG\", \"2004/08/19-2014/04/02,2014/04/03-2024/03/07\")]\n        [TestCase(\"../../../Data/equity/usa/daily/spwr.zip\", 2, \"SPWR\", \"2005/11/17-2008/09/29,2011/11/17-2024/03/07\")]\n        [TestCase(\"../../../Data/equity/usa/minute/spwr/20140401_trade.zip\", 1, \"SPWR\", \"2014/04/01-2014/04/01\")]\n        [TestCase(\"../../../Data/equity/usa/minute/spwra/20100401_trade.zip\", 1, \"SPWRA\", \"2010/04/01-2010/04/01\")]\n        [TestCase(\"../../../Data/equity/usa/minute/fb/20000401_trade.zip\", 1, \"FB\", \"2000/04/01-2000/04/02\")]\n        [TestCase(\"../../../Data/equity/usa/minute/fb/20200401_trade.zip\", 1, \"FB\", \"2020/04/01-2000/04/02\")]\n        [TestCase(\"../../../Data/equity/usa/minute/xyz/20000401_trade.zip\", 1, \"XYZ\", null)]\n        [TestCase(\"../../../Data/cfd/oanda/daily/xauusd.zip\", 1, \"XAUUSD\", null)]\n        [TestCase(\"../../../Data/option/usa/hour/goog_2014_quote_american.zip\", 2, \"GOOG\", \"2014/01/01-2014/04/02,2014/04/03-2015/01/01\")]\n        [TestCase(\"../../../Data/option/usa/daily/goog_2014_quote_american.zip\", 2, \"GOOG\", \"2014/01/01-2014/04/02,2014/04/03-2015/01/01\")]\n        [TestCase(\"../../../Data/indexoption/usa/hour/spx_2014_quote_american.zip\", 1, \"SPX\", \"2014/01/01-2015/01/01\")]\n        [TestCase(\"../../../Data/indexoption/usa/daily/spx_2014_quote_american.zip\", 1, \"SPX\", \"2014/01/01-2015/01/01\")]\n        [TestCase(\"../../../Data/crypto/binance/hour/btcusdt_trade.zip\", 1, \"BTCUSDT\", null)]\n        [TestCase(\"../../../Data/cryptofuture/binance/hour/btcusdt_trade.zip\", 1, \"BTCUSDT\", null)]\n        [TestCase(\"../../../Data/futureoption/comex/minute/og/202004/20200105_quote_american.zip\", 1, \"GC28J20\", \"2020/01/05-2020/01/06\")]\n        [TestCase(\"../../../Data/option/usa/minute/goog/20151223_trade_american\", 1, \"GOOG\", \"2015/12/23-2015/12/24\")]\n        [TestCase(\"../../../Data/future/cme/minute/es/20131008_quote.zip\", 1, \"/ES\", \"2013/10/08-2013/10/09\")]\n        public void GetDataDownloaderParam(string pathToFile, int expectedDownloadDataAmount, string expectedTicker, string expectedDateTimeRanges)\n        {\n            _ = LeanData.TryParsePath(pathToFile, out var symbol, out var parsedDate, out var resolution, out var tickType, out _);\n\n            var startDateTimeUtc = default(DateTime);\n            var endDateTimeUtc = new DateTime(2024, 3, 7);\n\n            if (parsedDate != default)\n            {\n                startDateTimeUtc = parsedDate;\n\n                if (resolution > Resolution.Minute &&\n                    (symbol.SecurityType == SecurityType.Option || symbol.SecurityType == SecurityType.IndexOption))\n                {\n                    endDateTimeUtc = startDateTimeUtc.AddYears(1);\n                }\n                else\n                {\n                    endDateTimeUtc = parsedDate.AddDays(1);\n                }\n            }\n            else\n            {\n                try\n                {\n                    startDateTimeUtc = symbol.ID.Date;\n                }\n                catch (InvalidOperationException)\n                {\n                    startDateTimeUtc = new DateTime(1999, 1, 1);\n                }\n            }\n\n            MarketHoursDatabase.Entry entry = _marketHoursDatabase.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            var getParams = new DataDownloaderGetParameters(symbol, resolution, startDateTimeUtc, endDateTimeUtc, tickType);\n\n            var downloaderDataParameters = getParams.GetDataDownloaderParameterForAllMappedSymbols(_mapFileProvider, entry.ExchangeHours.TimeZone).OrderBy(d => d.StartUtc).ToList();\n\n            Assert.That(downloaderDataParameters.Count, Is.EqualTo(expectedDownloadDataAmount));\n\n            var dateRanges = expectedDateTimeRanges?.Split(',').Select(x => x.Split('-'))\n                .ToList(x => (StartDateTime: DateTime.Parse(x[0], CultureInfo.InvariantCulture), EndDateTime: DateTime.Parse(x[1], CultureInfo.InvariantCulture)));\n\n            for (var i = 0; i < downloaderDataParameters.Count; i++)\n            {\n                var downloaderParameter = downloaderDataParameters[i];\n\n                var rightTicker = downloaderParameter.Symbol.HasUnderlying ? downloaderParameter.Symbol.Underlying.Value : downloaderParameter.Symbol.Value;\n                Assert.That(rightTicker, Is.EqualTo(expectedTicker));\n\n                Assert.That(downloaderParameter.Symbol.SecurityType, Is.EqualTo(symbol.SecurityType));\n\n                if (dateRanges != null)\n                {\n                    Assert.That(downloaderParameter.StartUtc.Date, Is.EqualTo(dateRanges[i].StartDateTime.Date));\n                    Assert.That(downloaderParameter.EndUtc.Date, Is.GreaterThanOrEqualTo(dateRanges[i].EndDateTime.Date));\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/DateTimeJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class DateTimeJsonConverterTests\n    {\n        [Test]\n        public void Write()\n        {\n            var instance = new MultiDateTimeFormatClassTest { Value = new DateTime(2025, 08, 08, 10, 30, 0) };\n            var result = JsonConvert.SerializeObject(instance);\n            Assert.AreEqual(\"{\\\"Value\\\":\\\"2025-08-08T10:30:00Z\\\"}\", result);\n        }\n\n        [Test]\n        public void WriteNullable()\n        {\n            var instance = new NullableDateTimeFormatClassTest { Value = null };\n            var result = JsonConvert.SerializeObject(instance);\n            Assert.AreEqual(\"{\\\"Value\\\":null}\", result);\n        }\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08 10:30:00\\\"}\", false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00Z\\\"}\", false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00.000Z\\\"}\", false)]\n        [TestCase(\"{ \\\"value\\\": \\\"20250808-10:30:00\\\"}\", false)]\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025/08/08 10:30:00.000\\\"}\", true)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08 10:30:00.000\\\"}\", true)]\n        public void MultipleFormats(string strObject, bool throws)\n        {\n            if (throws)\n            {\n                Assert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<SingleDateTimeFormatClassTest>(strObject));\n                return;\n            }\n            var result = JsonConvert.DeserializeObject<MultiDateTimeFormatClassTest>(strObject);\n\n            Assert.AreEqual(new DateTime(2025, 08, 08, 10, 30, 0), result.Value);\n        }\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08 10:30:00\\\"}\", false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00\\\"}\", false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00Z\\\"}\", false)]\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025/08/08 10:30:00\\\"}\", true)]\n        public void SingleFormat(string strObject, bool throws)\n        {\n            if (throws)\n            {\n                Assert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<SingleDateTimeFormatClassTest>(strObject));\n                return;\n            }\n            var result = JsonConvert.DeserializeObject<SingleDateTimeFormatClassTest>(strObject);\n\n            Assert.AreEqual(new DateTime(2025, 08, 08, 10, 30, 0), result.Value);\n        }\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00\\\"}\", false, false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08T10:30:00Z\\\"}\", false, false)]\n        [TestCase(\"{ \\\"value\\\": null}\", false, true)]\n        [TestCase(\"{ }\", false, true)]\n\n        [TestCase(\"{ \\\"value\\\": \\\"2025/08/08 10:30:00\\\"}\", true, false)]\n        [TestCase(\"{ \\\"value\\\": \\\"2025-08-08 10:30:00\\\"}\", true, false)]\n        public void NullFormat(string strObject, bool throws, bool expectNull)\n        {\n            if (throws)\n            {\n                Assert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<NullableDateTimeFormatClassTest>(strObject));\n                return;\n            }\n            var result = JsonConvert.DeserializeObject<NullableDateTimeFormatClassTest>(strObject);\n            if (expectNull)\n            {\n                Assert.AreEqual(null, result.Value);\n                return;\n            }\n\n            Assert.AreEqual(new DateTime(2025, 08, 08, 10, 30, 0), result.Value);\n        }\n\n        [TestCase(\"\\\"2025-08-08T10:30:00Z\\\"\", false)]\n        [TestCase(\"\\\"2025-08-08 10:30:00\\\"\", false)]\n        [TestCase(\"\", true)]\n        [TestCase(\"\\\"\\\"\", true)]\n        public void ManualConversion(string strObject, bool expectNull)\n        {\n            var converter = new DateTimeJsonConverter(DateFormat.ISOShort, DateFormat.UI);\n            var result = JsonConvert.DeserializeObject<DateTime?>(strObject, converter);\n            if (expectNull)\n            {\n                Assert.AreEqual(null, result);\n                return;\n            }\n            Assert.AreEqual(new DateTime(2025, 08, 08, 10, 30, 0), result.Value);\n        }\n\n        internal class MultiDateTimeFormatClassTest\n        {\n            [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort, DateFormat.UI, DateFormat.FIX)]\n            public DateTime Value { get; set; }\n        }\n        internal class SingleDateTimeFormatClassTest\n        {\n            [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.UI)]\n            public DateTime Value { get; set; }\n        }\n        internal class NullableDateTimeFormatClassTest\n        {\n            [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.ISOShort)]\n            public DateTime? Value { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/DecimalJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util;\n\npublic class DecimalJsonConverterTests\n{\n    private static readonly JsonSerializerSettings settings = new JsonSerializerSettings\n    {\n        Converters = new List<JsonConverter>\n        {\n            new DecimalJsonConverter()\n        }\n    };\n\n    [TestCase(\"1\", 1, true)]\n    [TestCase(\"0\", 0, true)]\n    [TestCase(\"-1\", -1, true)]\n    [TestCase(\"1.333\", 1.333, true)]\n    [TestCase(\"1.333\", 1.333, false)]\n    [TestCase(\"9e-8\", 0.00000009, true)]\n    [TestCase(\"1.3117285e+06\", 1311728.5, true)]\n    [TestCase(\"9e-8\", 0.00000009, false)]\n    [TestCase(\"1.3117285e+06\", 1311728.5, false)]\n    public void DecimalStringConverterTests(string value, decimal expected, bool quote = true)\n    {\n        var jsonString = TestObject<decimal>.CreateJsonObject(value, quote);\n        var obj = JsonConvert.DeserializeObject<TestObject<decimal>>(jsonString, settings);\n\n        Assert.AreEqual(expected, obj.Value);\n    }\n\n    [TestCase(\"1\", 1, true)]\n    [TestCase(\"0\", 0, true)]\n    [TestCase(\"-1\", -1, true)]\n    [TestCase(\"1.333\", 1.333, true)]\n    [TestCase(\"1.333\", 1.333, false)]\n    [TestCase(\"9e-8\", 0.00000009, true)]\n    [TestCase(\"1.3117285e+06\", 1311728.5, true)]\n    [TestCase(\"9e-8\", 0.00000009, false)]\n    [TestCase(\"1.3117285e+06\", 1311728.5, false)]\n    public void NullableDecimalStringConverterTests(string value, decimal expected, bool quote = true)\n    {\n        var jsonString = TestObject<decimal?>.CreateJsonObject(value, quote);\n        var obj = JsonConvert.DeserializeObject<TestObject<decimal?>>(jsonString, settings);\n\n        Assert.AreEqual(expected, obj.Value);\n    }\n\n    [Test]\n    public void ThrowsConversionError()\n    {\n        var jsonString = \"\"\"\n                             {\"value\": \"qwerty\"}\n                         \"\"\";\n\n        Assert.Throws<FormatException>(() =>\n            JsonConvert.DeserializeObject<TestObject<decimal>>(jsonString, settings));\n    }\n\n    [Test]\n    public void NullableDecimalHandlesNull()\n    {\n        var jsonString = \"\"\"\n                             {\"value\": null}\n                         \"\"\";\n        var obj = JsonConvert.DeserializeObject<TestObject<decimal?>>(jsonString, settings);\n\n        Assert.IsNull(obj.Value);\n    }\n\n    [Test]\n    public void NonNullableDecimalThrowsOnNull()\n    {\n        var jsonString = \"\"\"\n                             {\"value\": null}\n                         \"\"\";\n\n        Assert.Throws<JsonSerializationException>(() =>\n            JsonConvert.DeserializeObject<TestObject<decimal>>(jsonString, settings));\n    }\n\n    [Test]\n    public void SerializesDecimalAsString()\n    {\n        var obj = new TestObject<decimal> { Value = 1.333m };\n        var json = JsonConvert.SerializeObject(obj, settings);\n        var jsonOrigin = JsonConvert.SerializeObject(obj);\n\n        Assert.AreEqual(jsonOrigin, json);\n    }\n\n    [Test]\n    public void SerializesNullableDecimalAsStringFallbackToOriginBehavior()\n    {\n        var obj = new TestObject<decimal?> { Value = 1.333m };\n        var json = JsonConvert.SerializeObject(obj, settings);\n        var jsonOrigin = JsonConvert.SerializeObject(obj);\n\n        Assert.AreEqual(jsonOrigin, json);\n    }\n\n    [Test]\n    public void SerializesNullableDecimalNullAsNull()\n    {\n        var obj = new TestObject<decimal?> { Value = null };\n        var json = JsonConvert.SerializeObject(obj, settings);\n        var jsonOrigin = JsonConvert.SerializeObject(obj);\n\n        Assert.AreEqual(jsonOrigin, json);\n    }\n\n    private class TestObject<T>\n    {\n        public T Value { get; set; }\n\n        public static string CreateJsonObject(string value, bool quote = false)\n        {\n            if (quote)\n            {\n                value = $\"\\\"{value}\\\"\";\n            }\n\n            return $$\"\"\"\n                         {\"value\": {{value}}}\n                     \"\"\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/DisposableExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class DisposableExtensionsTests\n    {\n        #pragma warning disable CA2000\n        [Test]\n        public void ReturnsFalseForNullDisposable()\n        {\n            IDisposable disposable = null;\n            var result = disposable.DisposeSafely();\n            Assert.IsFalse(result);\n        }\n\n        [Test]\n        public void ReturnsTrueOnSuccessfulDisposal()\n        {\n            var disposable = new Disposable();\n            var result = disposable.DisposeSafely();\n            Assert.IsTrue(result);\n            Assert.IsTrue(disposable.DisposeWasCalled);\n        }\n\n        [Test]\n        public void InvokesErrorHandlerOnExceptionDuringDispose()\n        {\n            var errorHandlerWasInvoked = false;\n            var disposable = new Disposable(throwException: true);\n            var result = disposable.DisposeSafely(error => errorHandlerWasInvoked = true);\n            Assert.IsFalse(result);\n            Assert.IsTrue(errorHandlerWasInvoked);\n            Assert.IsTrue(disposable.DisposeWasCalled);\n        }\n\n        [Test]\n        public void SwallowsObjectDisposedException()\n        {\n            var errorHandlerWasInvoked = false;\n            var disposable = new Disposable();\n            disposable.Dispose();\n            Assert.IsTrue(disposable.DisposeWasCalled);\n\n            var result = disposable.DisposeSafely(error => errorHandlerWasInvoked = true);\n            Assert.IsTrue(result);\n            Assert.IsFalse(errorHandlerWasInvoked);\n        }\n\n        private sealed class Disposable : IDisposable\n        {\n            private readonly bool _throwException;\n            public bool DisposeWasCalled { get; private set; }\n\n            public Disposable(bool throwException = false)\n            {\n                _throwException = throwException;\n            }\n\n            public void Dispose()\n            {\n                if (DisposeWasCalled)\n                {\n                    throw new ObjectDisposedException(GetType().FullName);\n                }\n\n                DisposeWasCalled = true;\n\n                if (_throwException)\n                {\n                    throw new RegressionTestException();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ExpressionBuilderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq.Expressions;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ExpressionBuilderTests\n    {\n        [Test]\n        public void MakesPropertyOrFieldSelectorThatWorks()\n        {\n            const string DayOfYear = \"DayOfYear\";\n            Expression<Func<DateTime, int>> expected = x => x.DayOfYear;\n\n            var actual = ExpressionBuilder.MakePropertyOrFieldSelector<DateTime, int>(DayOfYear);\n\n            DateTime now = DateTime.UtcNow;\n\n            Assert.AreEqual(expected.Compile().Invoke(now), actual.Compile().Invoke(now));\n        }\n        [Test]\n        public void NonGenericMakesPropertyOrFieldSelectorThatWorks()\n        {\n            const string DayOfYear = \"DayOfYear\";\n            Expression<Func<DateTime, int>> expected = x => x.DayOfYear;\n\n            var actual = ExpressionBuilder.MakePropertyOrFieldSelector(typeof (DateTime), DayOfYear) as Expression<Func<DateTime, int>>; \n            Assert.IsNotNull(actual);\n\n            DateTime now = DateTime.UtcNow;\n            Assert.AreEqual(expected.Compile().Invoke(now), actual.Compile().Invoke(now));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Moq;\nusing Moq.Protected;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Algorithm.Framework.Alphas;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Indicators;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Packets;\nusing QuantConnect.Python;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ExtensionsTests\n    {\n        [TestCase(\"00000001\", TradeConditionFlags.Regular)]\n        [TestCase(\"20000021\", TradeConditionFlags.Regular, TradeConditionFlags.IntermarketSweep, TradeConditionFlags.TradeThroughExempt)]\n        public void GetEnumValuesInValue(string saleCondition, params TradeConditionFlags[] expected)\n        {\n            var parsed = uint.Parse(saleCondition, NumberStyles.HexNumber, CultureInfo.InvariantCulture);\n            var enums = Extensions.GetFlags<TradeConditionFlags>(parsed).ToArray();\n            Assert.AreEqual(expected, enums);\n        }\n\n        [TestCase(\"tt\", \"\", \"tt\")]\n        [TestCase(\"tt\", \"t\", \"t\")]\n        [TestCase(\"tt\", \"tt\", \"\")]\n        [TestCase(\"tt\", \"asda\", \"tt\")]\n        [TestCase(\"tt\", \"1\", \"tt\")]\n        public void RemoveFromEnd(string input, string removal, string expected)\n        {\n            Assert.AreEqual(expected, input.RemoveFromEnd(removal));\n        }\n\n        [TestCase(\"A test\", 1)]\n        [TestCase(\"[\\\"A test\\\"]\", 1)]\n        [TestCase(\"[\\\"A test\\\", \\\"something else\\\"]\", 2)]\n        public void DeserializeList(string input, int count)\n        {\n            var result = input.DeserializeList();\n            Assert.AreEqual(count, result.Count);\n            Assert.AreEqual(\"A test\", result[0]);\n            if (count == 2)\n            {\n                Assert.AreEqual(\"something else\", result[1]);\n            }\n        }\n\n        private class DeserializeListObject { public int Property { get; set; } }\n        [TestCase(\"{ \\\"property\\\": 10}\", 1)]\n        [TestCase(\"[{ \\\"property\\\": 10}]\", 1)]\n        [TestCase(\"[{ \\\"property\\\": 10}, { \\\"property\\\": 20 }]\", 2)]\n        public void DeserializeObjectList(string input, int count)\n        {\n            var result = input.DeserializeList<DeserializeListObject>();\n            Assert.AreEqual(count, result.Count);\n            Assert.AreEqual(10, result[0].Property);\n            if (count == 2)\n            {\n                Assert.AreEqual(20, result[1].Property);\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ConvertPythonSymbolEnumerableSingle(bool useSymbol)\n        {\n            using (Py.GIL())\n            {\n                PyObject source = null;\n                if (useSymbol)\n                {\n                    source = Symbols.SPY.ToPython();\n                }\n                else\n                {\n                    SymbolCache.Set(\"SPY\", Symbols.SPY);\n                    source = \"SPY\".ToPython();\n                }\n                var enumerable = source.ConvertToSymbolEnumerable();\n                for (var i = 0; i < 2; i++)\n                {\n                    var symbols = enumerable.ToList();\n                    Assert.AreEqual(1, symbols.Count);\n                    Assert.AreEqual(Symbols.SPY, symbols[0]);\n                }\n                source.Dispose();\n            }\n        }\n\n        [TestCase(\"pylist\")]\n        [TestCase(\"pyiterable\")]\n        [TestCase(\"csharp\")]\n        public void ConvertPythonSymbolEnumerablePyList(string testCase)\n        {\n            using (Py.GIL())\n            {\n                PyObject source = null;\n                if (testCase == \"csharp\")\n                {\n                    source = (new[] { Symbols.SPY, Symbols.AAPL }).ToPython();\n                }\n                else if (testCase == \"pylist\")\n                {\n                    source = new PyList((new[] { Symbols.SPY.ToPython(), Symbols.AAPL.ToPython() }));\n                }\n                else\n                {\n                    source = new PyIterable((new[] { Symbols.SPY, Symbols.AAPL }).ToPython());\n                }\n                var enumerable = source.ConvertToSymbolEnumerable();\n                for (var i = 0; i < 2; i++)\n                {\n                    var symbols = enumerable.ToList();\n                    Assert.AreEqual(2, symbols.Count);\n                    Assert.AreEqual(Symbols.SPY, symbols[0]);\n                    Assert.AreEqual(Symbols.AAPL, symbols[1]);\n                }\n                source.Dispose();\n            }\n        }\n\n        [Test]\n        public void ConvertPythonSymbolEnumerableCSharp()\n        {\n            using (Py.GIL())\n            {\n                using var source = (new[] { Symbols.SPY, Symbols.AAPL }).ToPython();\n                var enumerable = source.ConvertToSymbolEnumerable();\n                for (var i = 0; i < 2; i++)\n                {\n                    var symbols = enumerable.ToList();\n                    Assert.AreEqual(2, symbols.Count);\n                    Assert.AreEqual(Symbols.SPY, symbols[0]);\n                    Assert.AreEqual(Symbols.AAPL, symbols[1]);\n                }\n            }\n        }\n\n        [Test]\n        public void NonExistingEmptyDirectory()\n        {\n            var nonexistingDirectory = $\"NonExistingEmptyDirectory-{new Guid()}\";\n            Assert.IsTrue(nonexistingDirectory.IsDirectoryEmpty());\n        }\n\n        [Test]\n        public void EmptyDirectory()\n        {\n            var directory = $\"EmptyDirectory-{new Guid()}\";\n            Directory.CreateDirectory(directory);\n            Assert.IsTrue(directory.IsDirectoryEmpty());\n\n            Directory.Delete(directory, true);\n        }\n\n        [Test]\n        public void DirectoryWithFile()\n        {\n            var directory = $\"DirectoryWithFile-{new Guid()}\";\n            Directory.CreateDirectory(directory);\n            File.WriteAllText(Path.Combine(directory, \"test\"), \"test\");\n\n            Assert.IsFalse(directory.IsDirectoryEmpty());\n\n            Directory.Delete(directory, true);\n        }\n\n        [Test]\n        public void DirectoryWithDirectory()\n        {\n            var directory = $\"DirectoryWithDirectory-{new Guid()}\";\n            Directory.CreateDirectory(directory);\n            Directory.CreateDirectory(Path.Combine(directory, \"test\"));\n\n            Assert.IsFalse(directory.IsDirectoryEmpty());\n\n            Directory.Delete(directory, true);\n        }\n\n        [Test]\n        public void EmptyDirectoryCached()\n        {\n            var directory = $\"EmptyDirectoryCached-{new Guid()}\";\n            Directory.CreateDirectory(directory);\n\n            Assert.IsTrue(directory.IsDirectoryEmpty());\n\n            File.WriteAllText(Path.Combine(directory, \"test\"), \"test\");\n\n            Assert.IsTrue(directory.IsDirectoryEmpty());\n\n            Directory.Delete(directory, true);\n        }\n\n        [Test]\n        public void ToMD5()\n        {\n            var result = \"pinochopinochopino   \".ToMD5();\n            Assert.AreEqual(\"261db8a511d4c433fe58f8b9870fc88e\", result);\n        }\n\n        [Test]\n        public void ToSha256()\n        {\n            var result = \"pinochopinochopino   \".ToSHA256();\n            Assert.AreEqual(\"327a5a3b33aef00daf26e414542e12bf4205adb716475fa22e53a178e5d8baca\", result);\n        }\n\n        [TestCase(\"1000\", 0)]\n        [TestCase(\"0\", 0)]\n        [TestCase(\"1\", 0)]\n        [TestCase(\"1.0\", 1)]\n        [TestCase(\"0.01\", 2)]\n        [TestCase(\"0.001\", 3)]\n        [TestCase(\"0.0001\", 4)]\n        [TestCase(\"0.00001\", 5)]\n        [TestCase(\"0.000001\", 6)]\n        public void GetDecimalPlaces(string decimalInput, int expectedResult)\n        {\n            var value = decimal.Parse(decimalInput, NumberStyles.Any, CultureInfo.InvariantCulture);\n            Assert.AreEqual(expectedResult, value.GetDecimalPlaces());\n        }\n\n        [TestCase(0, 10, 110)]\n        [TestCase(900, 10, 110)]\n        [TestCase(500, 10, 10)]\n\n        [TestCase(0, 100, 100)]\n        [TestCase(100, 100, 100)]\n        [TestCase(500, 100, 100)]\n        [TestCase(990, 100, 200)]\n        [TestCase(900, 100, 200)]\n\n        [TestCase(0, 1000, 1500)]\n        [TestCase(100, 1000, 1000)]\n        [TestCase(500, 1000, 1000)]\n        [TestCase(990, 1000, 1500)]\n\n        [TestCase(0, 10000, 10500)]\n        [TestCase(100, 10000, 10000)]\n        [TestCase(500, 10000, 10000)]\n        [TestCase(990, 10000, 10500)]\n        public void UnevenSecondWaitTime(int nowMilliseconds, int waitInterval, int expectedWaitInterval)\n        {\n            var nowUtc = new DateTime(2022, 04, 1);\n            nowUtc = nowUtc.AddMilliseconds(nowMilliseconds);\n\n            Assert.AreEqual(expectedWaitInterval, nowUtc.GetSecondUnevenWait(waitInterval));\n        }\n\n        [TestCase(SecurityType.Cfd, \"20501231\", false)]\n        [TestCase(SecurityType.Equity, \"20501231\", false)]\n        [TestCase(SecurityType.Base, \"20501231\", false)]\n        [TestCase(SecurityType.Forex, \"20501231\", false)]\n        [TestCase(SecurityType.Crypto, \"20501231\", false)]\n        [TestCase(SecurityType.Index, \"20501231\", false)]\n\n        [TestCase(SecurityType.Option, null, false)]\n        [TestCase(SecurityType.Future, null, false)]\n        [TestCase(SecurityType.FutureOption, null, false)]\n        [TestCase(SecurityType.IndexOption, null, false)]\n\n        [TestCase(SecurityType.Option, \"20501231\", true)]\n        [TestCase(SecurityType.Future, \"20501231\", true)]\n        [TestCase(SecurityType.FutureOption, \"20501231\", true)]\n        [TestCase(SecurityType.IndexOption, \"20501231\", true)]\n        public void GetDelistingDate(SecurityType securityType, string expectedExpiration, bool isChain)\n        {\n            Symbol symbol = null;\n\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                    symbol = Symbol.CreateBase(typeof(IndexedBaseData), Symbols.AAPL, Market.USA);\n                    break;\n                case SecurityType.Equity:\n                    symbol = Symbols.AAPL;\n                    break;\n                case SecurityType.Option:\n                    symbol = Symbols.SPY_C_192_Feb19_2016;\n                    if (isChain)\n                    {\n                        symbol = symbol.Canonical;\n                    }\n                    else\n                    {\n                        expectedExpiration = symbol.ID.Date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    }\n                    break;\n                case SecurityType.Forex:\n                    symbol = Symbols.EURUSD;\n                    break;\n                case SecurityType.Future:\n                    symbol = Symbols.Fut_SPY_Feb19_2016;\n                    if (isChain)\n                    {\n                        symbol = symbol.Canonical;\n                    }\n                    else\n                    {\n                        expectedExpiration = symbol.ID.Date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    }\n                    break;\n                case SecurityType.Cfd:\n                    symbol = Symbols.DE30EUR;\n                    break;\n                case SecurityType.Crypto:\n                    symbol = Symbols.BTCEUR;\n                    break;\n                case SecurityType.FutureOption:\n                    symbol = Symbols.CreateFutureOptionSymbol(Symbols.Fut_SPY_Feb19_2016, OptionRight.Call, 10, new DateTime(2022, 05, 01));\n                    if (isChain)\n                    {\n                        symbol = symbol.Canonical;\n                    }\n                    else\n                    {\n                        expectedExpiration = symbol.ID.Date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    }\n                    break;\n                case SecurityType.Index:\n                    symbol = Symbols.SPX;\n                    break;\n                case SecurityType.IndexOption:\n                    symbol = Symbol.CreateOption(Symbols.SPX, Symbols.SPX.ID.Market, OptionStyle.European, OptionRight.Call, 1, new DateTime(2022, 05, 02));\n                    if (isChain)\n                    {\n                        symbol = symbol.Canonical;\n                    }\n                    else\n                    {\n                        expectedExpiration = symbol.ID.Date.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n                    }\n                    break;\n                default:\n                    break;\n            }\n            var mapFile = TestGlobals.MapFileProvider.Get(AuxiliaryDataKey.Create(symbol)).ResolveMapFile(symbol);\n            Assert.AreEqual(Time.ParseDate(expectedExpiration), symbol.GetDelistingDate(mapFile));\n        }\n\n        [TestCase(\"20220101\", false, true, Resolution.Daily)]\n        [TestCase(\"20220101\", false, false, Resolution.Daily)]\n        [TestCase(\"20220103 09:31\", true, false, Resolution.Minute)]\n        [TestCase(\"20220103 07:31\", false, false, Resolution.Minute)]\n        [TestCase(\"20220103 07:31\", false, false, Resolution.Daily)]\n        [TestCase(\"20220103 07:31\", true, true, Resolution.Daily)]\n        [TestCase(\"20220103 08:31\", true, true, Resolution.Daily)]\n        public void IsMarketOpenSecurity(string exchangeTime, bool expectedResult, bool extendedMarketHours, Resolution resolution)\n        {\n            var security = CreateSecurity(Symbols.SPY);\n            var utcTime = Time.ParseDate(exchangeTime).ConvertToUtc(security.Exchange.TimeZone);\n            security.SetLocalTimeKeeper(new LocalTimeKeeper(utcTime, security.Exchange.TimeZone));\n\n            Assert.AreEqual(expectedResult, security.IsMarketOpen(extendedMarketHours));\n        }\n\n        [TestCase(\"20220101\", false, true)]\n        [TestCase(\"20220101\", false, false)]\n        [TestCase(\"20220103 09:31\", true, false)]\n        [TestCase(\"20220103 07:31\", false, false)]\n        [TestCase(\"20220103 08:31\", true, true)]\n        public void IsMarketOpenSymbol(string nyTime, bool expectedResult, bool extendedMarketHours)\n        {\n            var utcTime = Time.ParseDate(nyTime).ConvertToUtc(TimeZones.NewYork);\n            Assert.AreEqual(expectedResult, Symbols.SPY.IsMarketOpen(utcTime, extendedMarketHours));\n        }\n\n        [TestCase(\"CL XTN6UA1G9QKH\")]\n        [TestCase(\"ES VU1EHIDJYLMP\")]\n        [TestCase(\"ES VRJST036ZY0X\")]\n        [TestCase(\"GE YYBCLAZG1NGH\")]\n        [TestCase(\"GE YTC58AEQ4C8X\")]\n        [TestCase(\"BTC XTU2YXLMT1XD\")]\n        [TestCase(\"UB XUIP59QUPVS5\")]\n        [TestCase(\"NQ XUERCWA6EWAP\")]\n        [TestCase(\"PL XVJ4OQA3JSN5\")]\n        public void AdjustSymbolByOffsetTest(string future)\n        {\n            var sid = SecurityIdentifier.Parse(future);\n            var symbol = new Symbol(sid, sid.Symbol);\n\n            Assert.AreEqual(symbol.ID.Date, symbol.AdjustSymbolByOffset(0).ID.Date);\n\n            var nextExpiration = symbol.AdjustSymbolByOffset(1);\n            Assert.Greater(nextExpiration.ID.Date, symbol.ID.Date);\n\n            var nextNextExpiration = symbol.AdjustSymbolByOffset(2);\n            Assert.Greater(nextNextExpiration.ID.Date, nextExpiration.ID.Date);\n        }\n\n        [TestCase(\"MDTUSD XJ\")]\n        [TestCase(\"BTCEUR XJ\")]\n        [TestCase(\"BTCUSDC XJ\")]\n        [TestCase(\"BTCUSDT XJ\")]\n        public void GDAXMarketNameCompatibilityWithCoinbase(string gdaxTicker)\n        {\n            var sid = SecurityIdentifier.Parse(gdaxTicker);\n\n            Assert.AreEqual(Market.Coinbase, sid.Market);\n        }\n\n        [TestCase(\"A\", \"a\")]\n        [TestCase(\"\", \"\")]\n        [TestCase(null, null)]\n        [TestCase(\"Buy\", \"buy\")]\n        [TestCase(\"BuyTheDip\", \"buyTheDip\")]\n        public void ToCamelCase(string toConvert, string expected)\n        {\n            Assert.AreEqual(expected, toConvert.ToCamelCase());\n        }\n\n        [Test]\n        public void BatchAlphaResultPacket()\n        {\n            var btcusd = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase);\n            var insights = new List<Insight>\n            {\n                new Insight(DateTime.UtcNow, btcusd, Time.OneMillisecond, InsightType.Price, InsightDirection.Up, 1, 2, \"sourceModel1\"),\n                new Insight(DateTime.UtcNow, btcusd, Time.OneSecond, InsightType.Price, InsightDirection.Down, 1, 2, \"sourceModel1\")\n            };\n            var orderEvents = new List<OrderEvent>\n            {\n                new OrderEvent(1, btcusd, DateTime.UtcNow, OrderStatus.Submitted, OrderDirection.Buy, 0, 0, OrderFee.Zero, message: \"OrderEvent1\"),\n                new OrderEvent(1, btcusd, DateTime.UtcNow, OrderStatus.Filled, OrderDirection.Buy, 1, 1000, OrderFee.Zero, message: \"OrderEvent2\")\n            };\n            var orders = new List<Order> { new MarketOrder(btcusd, 1000, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 1 } };\n\n            var packet1 = new AlphaResultPacket(\"1\", 1, insights: insights);\n            var packet2 = new AlphaResultPacket(\"1\", 1, orders: orders);\n            var packet3 = new AlphaResultPacket(\"1\", 1, orderEvents: orderEvents);\n\n            var result = new List<AlphaResultPacket> { packet1, packet2, packet3 }.Batch();\n\n            Assert.AreEqual(2, result.Insights.Count);\n            Assert.AreEqual(2, result.OrderEvents.Count);\n            Assert.AreEqual(1, result.Orders.Count);\n\n            Assert.IsTrue(result.Insights.SequenceEqual(insights));\n            Assert.IsTrue(result.OrderEvents.SequenceEqual(orderEvents));\n            Assert.IsTrue(result.Orders.SequenceEqual(orders));\n\n            Assert.IsNull(new List<AlphaResultPacket>().Batch());\n        }\n\n        [Test]\n        public void BatchAlphaResultPacketDuplicateOrder()\n        {\n            var btcusd = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase);\n            var orders = new List<Order>\n            {\n                new MarketOrder(btcusd, 1000, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 1 },\n                new MarketOrder(btcusd, 100, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 2 },\n                new MarketOrder(btcusd, 2000, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 1 },\n                new MarketOrder(btcusd, 10, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 3 },\n                new MarketOrder(btcusd, 3000, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 1 }\n            };\n            var orders2 = new List<Order>\n            {\n                new MarketOrder(btcusd, 200, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 2 },\n                new MarketOrder(btcusd, 20, DateTime.UtcNow, \"ExpensiveOrder\") { Id = 3 }\n            };\n\n            var packet1 = new AlphaResultPacket(\"1\", 1, orders: orders);\n            var packet2 = new AlphaResultPacket(\"1\", 1, orders: orders2);\n\n            var result = new List<AlphaResultPacket> { packet1, packet2 }.Batch();\n\n            // we expect just 1 order instance per order id\n            Assert.AreEqual(3, result.Orders.Count);\n            Assert.IsTrue(result.Orders.Any(order => order.Id == 1 && order.Quantity == 3000));\n            Assert.IsTrue(result.Orders.Any(order => order.Id == 2 && order.Quantity == 200));\n            Assert.IsTrue(result.Orders.Any(order => order.Id == 3 && order.Quantity == 20));\n\n            var expected = new List<Order> { orders[4], orders2[0], orders2[1] };\n            Assert.IsTrue(result.Orders.SequenceEqual(expected));\n        }\n\n        [Test]\n        public void SeriesIsNotEmpty()\n        {\n            var series = new Series(\"SadSeries\")\n            { Values = new List<ISeriesPoint> { new ChartPoint(1, 1) } };\n\n            Assert.IsFalse(series.IsEmpty());\n        }\n\n        [Test]\n        public void SeriesIsEmpty()\n        {\n            Assert.IsTrue((new Series(\"Cat\")).IsEmpty());\n        }\n\n        [Test]\n        public void ChartIsEmpty()\n        {\n            Assert.IsTrue((new Chart(\"HappyChart\")).IsEmpty());\n        }\n\n        [Test]\n        public void ChartIsEmptyWithEmptySeries()\n        {\n            Assert.IsTrue((new Chart(\"HappyChart\")\n            { Series = new Dictionary<string, BaseSeries> { { \"SadSeries\", new Series(\"SadSeries\") } } }).IsEmpty());\n        }\n\n        [Test]\n        public void ChartIsNotEmptyWithNonEmptySeries()\n        {\n            var series = new Series(\"SadSeries\")\n            { Values = new List<ISeriesPoint> { new ChartPoint(1, 1) } };\n\n            Assert.IsFalse((new Chart(\"HappyChart\")\n            { Series = new Dictionary<string, BaseSeries> { { \"SadSeries\", series } } }).IsEmpty());\n        }\n\n        [Test]\n        public void IsSubclassOfGenericWorksWorksForNonGenericType()\n        {\n            Assert.IsTrue(typeof(Derived2).IsSubclassOfGeneric(typeof(Derived1)));\n        }\n\n        [Test]\n        public void IsSubclassOfGenericWorksForGenericTypeWithParameter()\n        {\n            Assert.IsTrue(typeof(Derived1).IsSubclassOfGeneric(typeof(Super<int>)));\n            Assert.IsFalse(typeof(Derived1).IsSubclassOfGeneric(typeof(Super<bool>)));\n        }\n\n        [Test]\n        public void IsSubclassOfGenericWorksForGenericTypeDefinitions()\n        {\n            Assert.IsTrue(typeof(Derived1).IsSubclassOfGeneric(typeof(Super<>)));\n            Assert.IsTrue(typeof(Derived2).IsSubclassOfGeneric(typeof(Super<>)));\n        }\n\n        [Test]\n        public void DateTimeRoundDownFullDayDoesntRoundDownByDay()\n        {\n            var date = new DateTime(2000, 01, 01);\n            var rounded = date.RoundDown(TimeSpan.FromDays(1));\n            Assert.AreEqual(date, rounded);\n        }\n\n        [Test]\n        public void GetBetterTypeNameHandlesRecursiveGenericTypes()\n        {\n            var type = typeof(Dictionary<List<int>, Dictionary<int, string>>);\n            const string expected = \"Dictionary<List<Int32>, Dictionary<Int32, String>>\";\n            var actual = type.GetBetterTypeName();\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void ExchangeRoundDownSkipsWeekends()\n        {\n            var time = new DateTime(2015, 05, 02, 18, 01, 00);\n            var expected = new DateTime(2015, 05, 01);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.FXCM, null, SecurityType.Forex);\n            var exchangeRounded = time.ExchangeRoundDown(Time.OneDay, hours, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownHandlesMarketOpenTime()\n        {\n            var time = new DateTime(2016, 1, 25, 9, 31, 0);\n            var expected = time.Date;\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            var exchangeRounded = time.ExchangeRoundDown(Time.OneDay, hours, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ConvertToSkipsDiscontinuitiesBecauseOfDaylightSavingsStart_AddingOneHour()\n        {\n            var expected = new DateTime(2014, 3, 9, 3, 0, 0);\n            var time = new DateTime(2014, 3, 9, 2, 0, 0).ConvertTo(TimeZones.NewYork, TimeZones.NewYork);\n            var time2 = new DateTime(2014, 3, 9, 2, 0, 1).ConvertTo(TimeZones.NewYork, TimeZones.NewYork);\n            Assert.AreEqual(expected, time);\n            Assert.AreEqual(expected, time2);\n        }\n\n        [Test]\n        public void ConvertToIgnoreDaylightSavingsEnd_SubtractingOneHour()\n        {\n            var time1Expected = new DateTime(2014, 11, 2, 1, 59, 59);\n            var time2Expected = new DateTime(2014, 11, 2, 2, 0, 0);\n            var time3Expected = new DateTime(2014, 11, 2, 2, 0, 1);\n            var time1 = time1Expected.ConvertTo(TimeZones.NewYork, TimeZones.NewYork);\n            var time2 = time2Expected.ConvertTo(TimeZones.NewYork, TimeZones.NewYork);\n            var time3 = time3Expected.ConvertTo(TimeZones.NewYork, TimeZones.NewYork);\n\n            Assert.AreEqual(time1Expected, time1);\n            Assert.AreEqual(time2Expected, time2);\n            Assert.AreEqual(time3Expected, time3);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneSkipsWeekends()\n        {\n            // moment before EST market open in UTC (time + one day)\n            var time = new DateTime(2017, 10, 01, 9, 29, 59).ConvertToUtc(TimeZones.NewYork);\n            var expected = new DateTime(2017, 09, 29).ConvertFromUtc(TimeZones.NewYork);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, null, SecurityType.Equity);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneDay, hours, TimeZones.Utc, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        // This unit test reproduces a fixed infinite loop situation, due to a daylight saving time change, in ExchangeRoundDownInTimeZone, GH issue 2368.\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_AddingOneHour_UTC()\n        {\n            var time = new DateTime(2014, 3, 9, 16, 0, 1);\n            var expected = new DateTime(2014, 3, 7, 16, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.Utc, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        // This unit test reproduces a fixed infinite loop situation, due to a daylight saving time change, in ExchangeRoundDownInTimeZone, GH issue 2368.\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_UTC()\n        {\n            var time = new DateTime(2014, 11, 2, 2, 0, 1);\n            var expected = new DateTime(2014, 10, 31, 16, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.Utc, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_AddingOneHour_ExtendedHours_UTC()\n        {\n            var time = new DateTime(2014, 3, 9, 2, 0, 1);\n            var expected = new DateTime(2014, 3, 9, 2, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Coinbase, null, SecurityType.Crypto);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.Utc, true);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_ExtendedHours_UTC()\n        {\n            var time = new DateTime(2014, 11, 2, 2, 0, 1);\n            var expected = new DateTime(2014, 11, 2, 2, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Coinbase, null, SecurityType.Crypto);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.Utc, true);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        // We assert the behavior of noda time convert to utc around daylight saving start and end\n        // Even though start and end un exchange TZ are 1.01:00:00 long (1 day & 1 hour) in utc it's always 1 day\n        public void ConvertToUtcAndDayLightSavings()\n        {\n            {\n                // day light savings starts\n                var start = new DateTime(2011, 3, 12, 19, 0, 0);\n                var end = new DateTime(2011, 3, 13, 20, 0, 0);\n\n                var utcStart = start.ConvertToUtc(TimeZones.NewYork);\n                var utcEnd = end.ConvertToUtc(TimeZones.NewYork);\n                Assert.AreEqual(Time.OneDay, utcEnd - utcStart);\n            }\n            {\n                // day light savings ends\n                var start = new DateTime(2011, 11, 5, 20, 0, 0);\n                var end = new DateTime(2011, 11, 6, 19, 0, 0);\n\n                var utcStart = start.ConvertToUtc(TimeZones.NewYork);\n                var utcEnd = end.ConvertToUtc(TimeZones.NewYork);\n                Assert.AreEqual(Time.OneDay, utcEnd - utcStart);\n            }\n        }\n\n        [Test]\n        // this unit test reproduces a fixed infinite loop situation, due to a daylight saving time change, GH issue 3707.\n        public void RoundDownInTimeZoneAroundDaylightTimeChanges()\n        {\n            // sydney time advanced Sunday, 6 October 2019, 02:00:00 clocks were turned forward 1 hour to\n            // Sunday, 6 October 2019, 03:00:00 local daylight time instead.\n            var timeAt = new DateTime(2019, 10, 6, 10, 0, 0);\n            var expected = new DateTime(2019, 10, 5, 10, 0, 0);\n\n            var exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneDay, TimeZones.Sydney, TimeZones.Utc);\n            // even though there is an entire 'roundingInterval' unit (1 day) between 'timeAt' and 'expected' round down\n            // is affected by daylight savings and rounds down the timeAt\n            Assert.AreEqual(expected, exchangeRoundedAt);\n\n            timeAt = new DateTime(2019, 10, 7, 10, 0, 0);\n            expected = new DateTime(2019, 10, 6, 11, 0, 0);\n\n            exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneDay, TimeZones.Sydney, TimeZones.Utc);\n            Assert.AreEqual(expected, exchangeRoundedAt);\n        }\n\n        [Test]\n        public void RoundDownInTimeZoneReturnsCorrectValuesAroundDaylightTimeChanges_AddingOneHour_UTC()\n        {\n            var timeAt = new DateTime(2014, 3, 9, 2, 0, 0);\n            var timeAfter = new DateTime(2014, 3, 9, 2, 0, 1);\n            var timeBefore = new DateTime(2014, 3, 9, 1, 59, 59);\n            var timeAfterDaylightTimeChanges = new DateTime(2014, 3, 9, 3, 0, 0);\n\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n\n            var exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedAfter = timeAfter.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedBefore = timeBefore.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedAfterDaylightTimeChanges = timeAfterDaylightTimeChanges.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n\n            var expected = new DateTime(2014, 3, 9, 3, 0, 0);\n            Assert.AreEqual(expected, exchangeRoundedAt);\n            Assert.AreEqual(expected, exchangeRoundedAfter);\n            Assert.AreEqual(timeBefore, exchangeRoundedBefore);\n            Assert.AreEqual(expected, exchangeRoundedAfterDaylightTimeChanges);\n        }\n\n        [Test]\n        public void RoundDownInTimeZoneReturnsCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_UTC()\n        {\n            var timeAt = new DateTime(2014, 11, 2, 2, 0, 0);\n            var timeAfter = new DateTime(2014, 11, 2, 2, 0, 1);\n            var timeBefore = new DateTime(2014, 11, 2, 1, 59, 59);\n            var timeAfterDaylightTimeChanges = new DateTime(2014, 11, 2, 3, 0, 0);\n\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n\n            var exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedAfter = timeAfter.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedBefore = timeBefore.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n            var exchangeRoundedAfterDaylightTimeChanges = timeAfterDaylightTimeChanges.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.Utc);\n\n            Assert.AreEqual(timeAt, exchangeRoundedAt);\n            Assert.AreEqual(timeAfter, exchangeRoundedAfter);\n            Assert.AreEqual(timeBefore, exchangeRoundedBefore);\n            Assert.AreEqual(timeAfterDaylightTimeChanges, exchangeRoundedAfterDaylightTimeChanges);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_AddingOneHour_NewYork()\n        {\n            var time = new DateTime(2014, 3, 9, 16, 0, 1);\n            var expected = new DateTime(2014, 3, 7, 16, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.NewYork, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_NewYork()\n        {\n            var time = new DateTime(2014, 11, 2, 2, 0, 1);\n            var expected = new DateTime(2014, 10, 31, 16, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.NewYork, false);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_AddingOneHour_ExtendedHours_NewYork()\n        {\n            var time = new DateTime(2014, 3, 9, 2, 0, 1);\n            var expected = new DateTime(2014, 3, 9, 2, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Coinbase, null, SecurityType.Crypto);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.NewYork, true);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void ExchangeRoundDownInTimeZoneCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_ExtendedHours_NewYork()\n        {\n            var time = new DateTime(2014, 11, 2, 2, 0, 1);\n            var expected = new DateTime(2014, 11, 2, 2, 0, 0);\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Coinbase, null, SecurityType.Crypto);\n            var exchangeRounded = time.ExchangeRoundDownInTimeZone(Time.OneHour, hours, TimeZones.NewYork, true);\n            Assert.AreEqual(expected, exchangeRounded);\n        }\n\n        [Test]\n        public void RoundDownInTimeZoneReturnsCorrectValuesAroundDaylightTimeChanges_AddingOneHour_NewYork()\n        {\n            var timeAt = new DateTime(2014, 3, 9, 2, 0, 0);\n            var timeAfter = new DateTime(2014, 3, 9, 2, 0, 1);\n            var timeBefore = new DateTime(2014, 3, 9, 1, 59, 59);\n            var timeAfterDaylightTimeChanges = new DateTime(2014, 3, 9, 3, 0, 0);\n\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n\n            var exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedAfter = timeAfter.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedBefore = timeBefore.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedAfterDaylightTimeChanges = timeAfterDaylightTimeChanges.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n\n            var expected = new DateTime(2014, 3, 9, 3, 0, 0);\n            Assert.AreEqual(expected, exchangeRoundedAt);\n            Assert.AreEqual(expected, exchangeRoundedAfter);\n            Assert.AreEqual(timeBefore, exchangeRoundedBefore);\n            Assert.AreEqual(expected, exchangeRoundedAfterDaylightTimeChanges);\n        }\n\n        [Test]\n        public void RoundDownInTimeZoneReturnsCorrectValuesAroundDaylightTimeChanges_SubtractingOneHour_NewYork()\n        {\n            var timeAt = new DateTime(2014, 11, 2, 2, 0, 0);\n            var timeAfter = new DateTime(2014, 11, 2, 2, 0, 1);\n            var timeBefore = new DateTime(2014, 11, 2, 1, 59, 59);\n            var timeAfterDaylightTimeChanges = new DateTime(2014, 11, 2, 3, 0, 0);\n\n            var hours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex);\n\n            var exchangeRoundedAt = timeAt.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedAfter = timeAfter.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedBefore = timeBefore.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n            var exchangeRoundedAfterDaylightTimeChanges = timeAfterDaylightTimeChanges.RoundDownInTimeZone(Time.OneSecond, hours.TimeZone, TimeZones.NewYork);\n\n            Assert.AreEqual(timeAt, exchangeRoundedAt);\n            Assert.AreEqual(timeAfter, exchangeRoundedAfter);\n            Assert.AreEqual(timeBefore, exchangeRoundedBefore);\n            Assert.AreEqual(timeAfterDaylightTimeChanges, exchangeRoundedAfterDaylightTimeChanges);\n        }\n\n        [Test]\n        public void ConvertsInt32FromString()\n        {\n            const string input = \"12345678\";\n            var value = input.ToInt32();\n            Assert.AreEqual(12345678, value);\n        }\n\n        [Test]\n        public void ConvertsInt32FromStringWithDecimalTruncation()\n        {\n            const string input = \"12345678.9\";\n            var value = input.ToInt32();\n            Assert.AreEqual(12345678, value);\n        }\n\n        [Test]\n        public void ConvertsInt64FromString()\n        {\n            const string input = \"12345678900\";\n            var value = input.ToInt64();\n            Assert.AreEqual(12345678900, value);\n        }\n\n        [Test]\n        public void ConvertsInt64FromStringWithDecimalTruncation()\n        {\n            const string input = \"12345678900.12\";\n            var value = input.ToInt64();\n            Assert.AreEqual(12345678900, value);\n        }\n\n        [Test]\n        public void ToCsvDataParsesCorrectly()\n        {\n            var csv = \"\\\"hello\\\",\\\"world\\\"\".ToCsvData();\n            Assert.AreEqual(2, csv.Count);\n            Assert.AreEqual(\"\\\"hello\\\"\", csv[0]);\n            Assert.AreEqual(\"\\\"world\\\"\", csv[1]);\n\n            var csv2 = \"1,2,3,4\".ToCsvData();\n            Assert.AreEqual(4, csv2.Count);\n            Assert.AreEqual(\"1\", csv2[0]);\n            Assert.AreEqual(\"2\", csv2[1]);\n            Assert.AreEqual(\"3\", csv2[2]);\n            Assert.AreEqual(\"4\", csv2[3]);\n        }\n\n        [Test]\n        public void ToCsvDataParsesEmptyFinalValue()\n        {\n            var line = \"\\\"hello\\\",world,\";\n            var csv = line.ToCsvData();\n\n            Assert.AreEqual(3, csv.Count);\n            Assert.AreEqual(\"\\\"hello\\\"\", csv[0]);\n            Assert.AreEqual(\"hello\", csv[0].Trim('\"'));\n            Assert.AreEqual(\"world\", csv[1]);\n            Assert.AreEqual(string.Empty, csv[2]);\n        }\n\n        [Test]\n        public void ToCsvDataParsesEmptyValue()\n        {\n            Assert.AreEqual(string.Empty, string.Empty.ToCsvData()[0]);\n        }\n\n        [Test]\n        public void ConvertsDecimalFromString()\n        {\n            const string input = \"123.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(123.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsDecimalFromStringWithExtraWhiteSpace()\n        {\n            const string input = \" 123.45678 \";\n            var value = input.ToDecimal();\n            Assert.AreEqual(123.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsDecimalFromIntStringWithExtraWhiteSpace()\n        {\n            const string input = \" 12345678 \";\n            var value = input.ToDecimal();\n            Assert.AreEqual(12345678m, value);\n        }\n\n        [Test]\n        public void ConvertsZeroDecimalFromString()\n        {\n            const string input = \"0.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(0.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsOneNumberDecimalFromString()\n        {\n            const string input = \"1.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(1.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsZeroDecimalValueFromString()\n        {\n            const string input = \"0\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(0m, value);\n        }\n\n        [Test]\n        public void ConvertsEmptyDecimalValueFromString()\n        {\n            const string input = \"\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(0m, value);\n        }\n\n        [Test]\n        public void ConvertsNegativeDecimalFromString()\n        {\n            const string input = \"-123.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-123.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsNegativeDecimalFromStringWithExtraWhiteSpace()\n        {\n            const string input = \" -123.45678 \";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-123.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsNegativeDecimalFromIntStringWithExtraWhiteSpace()\n        {\n            const string input = \" -12345678 \";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-12345678m, value);\n        }\n\n        [Test]\n        public void ConvertsNegativeZeroDecimalFromString()\n        {\n            const string input = \"-0.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-0.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsNegavtiveOneNumberDecimalFromString()\n        {\n            const string input = \"-1.45678\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-1.45678m, value);\n        }\n\n        [Test]\n        public void ConvertsNegativeZeroDecimalValueFromString()\n        {\n            const string input = \"-0\";\n            var value = input.ToDecimal();\n            Assert.AreEqual(-0m, value);\n        }\n\n        [TestCase(\"1.23%\", 0.0123d)]\n        [TestCase(\"-1.23%\", -0.0123d)]\n        [TestCase(\"31.2300%\", 0.3123d)]\n        [TestCase(\"20%\", 0.2d)]\n        [TestCase(\"-20%\", -0.2d)]\n        [TestCase(\"220%\", 2.2d)]\n        public void ConvertsPercent(string input, double expected)\n        {\n            Assert.AreEqual(new decimal(expected), input.ToNormalizedDecimal());\n        }\n\n        [Test]\n        public void ConvertsTimeSpanFromString()\n        {\n            const string input = \"16:00\";\n            var timespan = input.ConvertTo<TimeSpan>();\n            Assert.AreEqual(TimeSpan.FromHours(16), timespan);\n        }\n\n        [Test]\n        public void ConvertsDictionaryFromString()\n        {\n            var expected = new Dictionary<string, int> { { \"a\", 1 }, { \"b\", 2 } };\n            var input = JsonConvert.SerializeObject(expected);\n            var actual = input.ConvertTo<Dictionary<string, int>>();\n            CollectionAssert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void DictionaryAddsItemToExistsList()\n        {\n            const int key = 0;\n            var list = new List<int> { 1, 2 };\n            var dictionary = new Dictionary<int, List<int>> { { key, list } };\n            Extensions.Add(dictionary, key, 3);\n            Assert.AreEqual(3, list.Count);\n            Assert.AreEqual(3, list[2]);\n        }\n\n        [Test]\n        public void DictionaryAddCreatesNewList()\n        {\n            const int key = 0;\n            var dictionary = new Dictionary<int, List<int>>();\n            Extensions.Add(dictionary, key, 1);\n            Assert.IsTrue(dictionary.ContainsKey(key));\n            var list = dictionary[key];\n            Assert.AreEqual(1, list.Count);\n            Assert.AreEqual(1, list[0]);\n        }\n\n        [Test]\n        public void SafeDecimalCasts()\n        {\n            var input = 2d;\n            var output = input.SafeDecimalCast();\n            Assert.AreEqual(2m, output);\n        }\n\n        [Test]\n        public void SafeDecimalCastRespectsUpperBound()\n        {\n            var input = (double)decimal.MaxValue;\n            var output = input.SafeDecimalCast();\n            Assert.AreEqual(decimal.MaxValue, output);\n        }\n\n        [Test]\n        public void SafeDecimalCastRespectsLowerBound()\n        {\n            var input = (double)decimal.MinValue;\n            var output = input.SafeDecimalCast();\n            Assert.AreEqual(decimal.MinValue, output);\n        }\n\n        [TestCase(Language.CSharp, double.NaN)]\n        [TestCase(Language.Python, double.NaN)]\n        [TestCase(Language.CSharp, double.NegativeInfinity)]\n        [TestCase(Language.Python, double.NegativeInfinity)]\n        [TestCase(Language.CSharp, double.PositiveInfinity)]\n        [TestCase(Language.Python, double.PositiveInfinity)]\n        public void SafeDecimalCastThrowsArgumentException(Language language, double number)\n        {\n            if (language == Language.CSharp)\n            {\n                Assert.Throws<ArgumentException>(() => number.SafeDecimalCast());\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                var pyNumber = number.ToPython();\n                var csNumber = pyNumber.As<double>();\n                Assert.Throws<ArgumentException>(() => csNumber.SafeDecimalCast());\n            }\n        }\n\n        [Test]\n        [TestCase(1.200, \"1.2\")]\n        [TestCase(1200, \"1200\")]\n        [TestCase(123.456, \"123.456\")]\n        public void NormalizeDecimalReturnsNoTrailingZeros(decimal input, string expectedOutput)\n        {\n            var output = input.Normalize();\n            Assert.AreEqual(expectedOutput, output.ToStringInvariant());\n        }\n\n        [TestCase(0.072842, \"0.072842\")]\n        [TestCase(7.5819999, \"7.58\")]\n        [TestCase(54.1119999, \"54.1\")]\n        [TestCase(1152280.01234568423, \"1152280\")]\n        public void SmartRoundingShort(decimal input, string expectedOutput)\n        {\n            var output = input.SmartRoundingShort().ToStringInvariant();\n            Assert.AreEqual(expectedOutput, output);\n        }\n\n        [Test]\n        [TestCase(0.072842, 3, \"0.0728\")]\n        [TestCase(0.0019999, 2, \"0.0020\")]\n        [TestCase(0.01234568423, 6, \"0.0123457\")]\n        public void RoundToSignificantDigits(decimal input, int digits, string expectedOutput)\n        {\n            var output = input.RoundToSignificantDigits(digits).ToStringInvariant();\n            Assert.AreEqual(expectedOutput, output);\n        }\n\n        [Test]\n        public void RoundsDownInTimeZone()\n        {\n            var dataTimeZone = TimeZones.Utc;\n            var exchangeTimeZone = TimeZones.EasternStandard;\n            var time = new DateTime(2000, 01, 01).ConvertTo(dataTimeZone, exchangeTimeZone);\n            var roundedTime = time.RoundDownInTimeZone(Time.OneDay, exchangeTimeZone, dataTimeZone);\n            Assert.AreEqual(time, roundedTime);\n        }\n\n        [Test]\n        public void GetStringBetweenCharsTests()\n        {\n            const string expected = \"python3.6\";\n\n            // Different characters cases\n            var input = \"[ python3.6 ]\";\n            var actual = input.GetStringBetweenChars('[', ']');\n            Assert.AreEqual(expected, actual);\n\n            input = \"[ python3.6 ] [ python2.7 ]\";\n            actual = input.GetStringBetweenChars('[', ']');\n            Assert.AreEqual(expected, actual);\n\n            input = \"[ python2.7 [ python3.6 ] ]\";\n            actual = input.GetStringBetweenChars('[', ']');\n            Assert.AreEqual(expected, actual);\n\n            // Same character cases\n            input = \"\\'python3.6\\'\";\n            actual = input.GetStringBetweenChars('\\'', '\\'');\n            Assert.AreEqual(expected, actual);\n\n            input = \"\\' python3.6 \\' \\' python2.7 \\'\";\n            actual = input.GetStringBetweenChars('\\'', '\\'');\n            Assert.AreEqual(expected, actual);\n\n            // In this case, it is not equal\n            input = \"\\' python2.7 \\' python3.6 \\' \\'\";\n            actual = input.GetStringBetweenChars('\\'', '\\'');\n            Assert.AreNotEqual(expected, actual);\n        }\n\n        [Test]\n        public void PyObjectTryConvertQuoteBar()\n        {\n            // Wrap a QuoteBar around a PyObject and convert it back\n            var value = ConvertToPyObject(new QuoteBar());\n\n            QuoteBar quoteBar;\n            var canConvert = value.TryConvert(out quoteBar);\n            Assert.IsTrue(canConvert);\n            Assert.IsNotNull(quoteBar);\n            Assert.IsAssignableFrom<QuoteBar>(quoteBar);\n        }\n\n        [Test]\n        public void PyObjectTryConvertSMA()\n        {\n            // Wrap a SimpleMovingAverage around a PyObject and convert it back\n            var value = ConvertToPyObject(new SimpleMovingAverage(14));\n\n            IndicatorBase<IndicatorDataPoint> indicatorBaseDataPoint;\n            var canConvert = value.TryConvert(out indicatorBaseDataPoint);\n            Assert.IsTrue(canConvert);\n            Assert.IsNotNull(indicatorBaseDataPoint);\n            Assert.IsAssignableFrom<SimpleMovingAverage>(indicatorBaseDataPoint);\n        }\n\n        [Test]\n        public void PyObjectTryConvertATR()\n        {\n            // Wrap a AverageTrueRange around a PyObject and convert it back\n            var value = ConvertToPyObject(new AverageTrueRange(14, MovingAverageType.Simple));\n\n            IndicatorBase<IBaseDataBar> indicatorBaseDataBar;\n            var canConvert = value.TryConvert(out indicatorBaseDataBar);\n            Assert.IsTrue(canConvert);\n            Assert.IsNotNull(indicatorBaseDataBar);\n            Assert.IsAssignableFrom<AverageTrueRange>(indicatorBaseDataBar);\n        }\n\n        [Test]\n        public void PyObjectTryConvertAD()\n        {\n            // Wrap a AccumulationDistribution around a PyObject and convert it back\n            var value = ConvertToPyObject(new AccumulationDistribution(\"AD\"));\n\n            IndicatorBase<TradeBar> indicatorBaseTradeBar;\n            var canConvert = value.TryConvert(out indicatorBaseTradeBar);\n            Assert.IsTrue(canConvert);\n            Assert.IsNotNull(indicatorBaseTradeBar);\n            Assert.IsAssignableFrom<AccumulationDistribution>(indicatorBaseTradeBar);\n        }\n\n        [Test]\n        public void PyObjectTryConvertCustomCSharpData()\n        {\n            // Wrap a custom C# data around a PyObject and convert it back\n            var value = ConvertToPyObject(new CustomData());\n\n            BaseData baseData;\n            var canConvert = value.TryConvert(out baseData);\n            Assert.IsTrue(canConvert);\n            Assert.IsNotNull(baseData);\n            Assert.IsAssignableFrom<CustomData>(baseData);\n        }\n\n        [Test]\n        public void PyObjectTryConvertPythonClass()\n        {\n            PyObject value;\n            using (Py.GIL())\n            {\n                // Try to convert a python class which inherits from a C# object\n                value = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def __init__(self):\n        return 0;\").GetAttr(\"Test\");\n            }\n\n            Type type;\n            bool canConvert = value.TryConvert(out type, true);\n            Assert.IsTrue(canConvert);\n        }\n\n        [Test]\n        public void PyObjectTryConvertSymbolArray()\n        {\n            using (Py.GIL())\n            {\n                // Wrap a Symbol Array around a PyObject and convert it back\n                using PyObject value = new PyList(new[] { Symbols.SPY.ToPython(), Symbols.AAPL.ToPython() });\n\n\n                Symbol[] symbols;\n                var canConvert = value.TryConvert(out symbols);\n                Assert.IsTrue(canConvert);\n                Assert.IsNotNull(symbols);\n                Assert.IsAssignableFrom<Symbol[]>(symbols);\n            }\n        }\n\n        [Test]\n        public void PyObjectTryConvertFailCSharp()\n        {\n            // Try to convert a AccumulationDistribution as a QuoteBar\n            var value = ConvertToPyObject(new AccumulationDistribution(\"AD\"));\n\n            QuoteBar quoteBar;\n            bool canConvert = value.TryConvert(out quoteBar);\n            Assert.IsFalse(canConvert);\n            Assert.IsNull(quoteBar);\n        }\n\n        [Test]\n        public void PyObjectTryConvertFailPython()\n        {\n            using (Py.GIL())\n            {\n                // Try to convert a python object as a IndicatorBase<TradeBar>\n                using var locals = new PyDict();\n                PythonEngine.Exec(\"class A:\\n    pass\", null, locals);\n                var value = locals.GetItem(\"A\").Invoke();\n\n                IndicatorBase<TradeBar> indicatorBaseTradeBar;\n                bool canConvert = value.TryConvert(out indicatorBaseTradeBar);\n                Assert.IsFalse(canConvert);\n                Assert.IsNull(indicatorBaseTradeBar);\n            }\n        }\n\n        [Test]\n        public void PyObjectTryConvertFailPythonClass()\n        {\n            PyObject value;\n            using (Py.GIL())\n            {\n                // Try to convert a python class which inherits from a C# object\n                value = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test(PythonData):\n    def __init__(self):\n        return 0;\").GetAttr(\"Test\");\n            }\n\n            Type type;\n            bool canConvert = value.TryConvert(out type);\n            Assert.IsFalse(canConvert);\n        }\n\n        [Test]\n        [TestCase(\"coarseSelector = lambda coarse: [ x.Symbol for x in coarse if x.Price % 2 == 0 ]\")]\n        [TestCase(\"def coarseSelector(coarse): return [ x.Symbol for x in coarse if x.Price % 2 == 0 ]\")]\n        public void PyObjectTryConvertToFunc(string code)\n        {\n            Func<IEnumerable<CoarseFundamental>, Symbol[]> coarseSelector;\n\n            using (Py.GIL())\n            {\n                using var locals = new PyDict();\n                PythonEngine.Exec(code, null, locals);\n                var pyObject = locals.GetItem(\"coarseSelector\");\n                pyObject.TryAs(out coarseSelector);\n            }\n\n            var coarse = Enumerable\n                .Range(0, 9)\n                .Select(x => new CoarseFundamental { Symbol = Symbol.Create(x.ToStringInvariant(), SecurityType.Equity, Market.USA), Value = x });\n\n            var symbols = coarseSelector(coarse);\n\n            Assert.AreEqual(5, symbols.Length);\n            foreach (var symbol in symbols)\n            {\n                var price = symbol.Value.ConvertInvariant<int>();\n                Assert.AreEqual(0, price % 2);\n            }\n        }\n\n        [Test]\n        public void PyObjectTryConvertToAction1()\n        {\n            Action<int> action;\n\n            using (Py.GIL())\n            {\n                using var locals = new PyDict();\n                PythonEngine.Exec(\"def raise_number(a): raise ValueError(a)\", null, locals);\n                var pyObject = locals.GetItem(\"raise_number\");\n                pyObject.TryAs(out action);\n            }\n\n            try\n            {\n                action(2);\n                Assert.Fail();\n            }\n            catch (PythonException e)\n            {\n                Assert.AreEqual($\"{2}\", e.Message);\n            }\n        }\n\n        [Test]\n        public void CSharpSelectorFunctionIsNotConverted()\n        {\n            using (Py.GIL())\n            {\n                var tradebarSelectorPyObject = Field.Volume.ToPython();\n                var quotebatSelectorPyObject = Field.BidClose.ToPython();\n                var tradebarResult = tradebarSelectorPyObject.TryAs<Func<IBaseData, decimal>>(out var tradebarCSharpSelector);\n                var quotebarResult = quotebatSelectorPyObject.TryAs<Func<IBaseData, decimal>>(out var quotebarCSharpSelector);\n                Assert.IsTrue(tradebarResult);\n                Assert.IsTrue(quotebarResult);\n                Assert.IsTrue(ReferenceEquals(Field.Volume, tradebarCSharpSelector));\n                Assert.IsTrue(ReferenceEquals(Field.BidClose, quotebarCSharpSelector));\n            }\n        }\n\n        [Test]\n        public void PyObjectTryConvertToAction2()\n        {\n            Action<int, decimal> action;\n\n            using (Py.GIL())\n            {\n                using var locals = new PyDict();\n                PythonEngine.Exec(\"def raise_number(a, b): raise ValueError(a * b)\", null, locals);\n                var pyObject = locals.GetItem(\"raise_number\");\n                pyObject.TryAs(out action);\n            }\n\n            try\n            {\n                action(2, 3m);\n                Assert.Fail();\n            }\n            catch (PythonException e)\n            {\n                Assert.AreEqual(\"6.0\", e.Message);\n            }\n        }\n\n        [Test]\n        public void PyObjectTryConvertToNonDelegateFail()\n        {\n            int action;\n\n            using (Py.GIL())\n            {\n                using var locals = new PyDict();\n                PythonEngine.Exec(\"def raise_number(a, b): raise ValueError(a * b)\", null, locals);\n                var pyObject = locals.GetItem(\"raise_number\");\n                Assert.IsFalse(pyObject.TryAs(out action));\n            }\n        }\n\n        [Test]\n        public void PyObjectStringConvertToSymbolEnumerable()\n        {\n            SymbolCache.Clear();\n            SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            IEnumerable<Symbol> symbols;\n            using (Py.GIL())\n            {\n                using var pyString = new PyString(\"SPY\");\n                symbols = pyString.ConvertToSymbolEnumerable();\n                Assert.AreEqual(Symbols.SPY, symbols.Single());\n            }\n        }\n\n        [Test]\n        public void PyObjectStringListConvertToSymbolEnumerable()\n        {\n            SymbolCache.Clear();\n            SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            IEnumerable<Symbol> symbols;\n            using (Py.GIL())\n            {\n                using var pyList = new PyList(new[] { \"SPY\".ToPython() });\n                symbols = pyList.ConvertToSymbolEnumerable();\n                Assert.AreEqual(Symbols.SPY, symbols.Single());\n            }\n        }\n\n        [Test]\n        public void PyObjectSymbolConvertToSymbolEnumerable()\n        {\n            IEnumerable<Symbol> symbols;\n            using (Py.GIL())\n            {\n                symbols = Symbols.SPY.ToPython().ConvertToSymbolEnumerable();\n            }\n\n            Assert.AreEqual(Symbols.SPY, symbols.Single());\n        }\n\n        [Test]\n        public void PyObjectSymbolListConvertToSymbolEnumerable()\n        {\n            IEnumerable<Symbol> symbols;\n            using (Py.GIL())\n            {\n                using var pyList = new PyList(new[] { Symbols.SPY.ToPython() });\n                symbols = pyList.ConvertToSymbolEnumerable();\n                Assert.AreEqual(Symbols.SPY, symbols.Single());\n            }\n        }\n\n        [Test]\n        public void PyObjectNonSymbolObjectConvertToSymbolEnumerable()\n        {\n            using (Py.GIL())\n            {\n                Assert.Throws<ArgumentException>(() => new PyInt(1).ConvertToSymbolEnumerable().ToList());\n            }\n        }\n\n        [Test]\n        public void PyObjectDictionaryConvertToDictionary_Success()\n        {\n            using (Py.GIL())\n            {\n                var actualDictionary = PyModule.FromString(\n                    \"PyObjectDictionaryConvertToDictionary_Success\",\n                    @\"\nfrom datetime import datetime as dt\nactualDictionary = dict()\nactualDictionary.update({'SPY': dt(2019,10,3)})\nactualDictionary.update({'QQQ': dt(2019,10,4)})\nactualDictionary.update({'IBM': dt(2019,10,5)})\n\"\n                ).GetAttr(\"actualDictionary\").ConvertToDictionary<string, DateTime>();\n\n                Assert.AreEqual(3, actualDictionary.Count);\n                var expectedDictionary = new Dictionary<string, DateTime>\n                {\n                    {\"SPY\", new DateTime(2019,10,3) },\n                    {\"QQQ\", new DateTime(2019,10,4) },\n                    {\"IBM\", new DateTime(2019,10,5) },\n                };\n\n                foreach (var kvp in expectedDictionary)\n                {\n                    Assert.IsTrue(actualDictionary.ContainsKey(kvp.Key));\n                    var actual = actualDictionary[kvp.Key];\n                    Assert.AreEqual(kvp.Value, actual);\n                }\n            }\n        }\n\n        [Test]\n        public void PyObjectDictionaryConvertToDictionary_FailNotDictionary()\n        {\n            using (Py.GIL())\n            {\n                var pyObject = PyModule.FromString(\n                    \"PyObjectDictionaryConvertToDictionary_FailNotDictionary\",\n                    \"actualDictionary = list()\"\n                ).GetAttr(\"actualDictionary\");\n\n                Assert.Throws<ArgumentException>(() => pyObject.ConvertToDictionary<string, DateTime>());\n            }\n        }\n\n        [Test]\n        public void PyObjectDictionaryConvertToDictionary_FailWrongItemType()\n        {\n            using (Py.GIL())\n            {\n                var pyObject = PyModule.FromString(\n                    \"PyObjectDictionaryConvertToDictionary_FailWrongItemType\",\n                    @\"\nactualDictionary = dict()\nactualDictionary.update({'SPY': 3})\nactualDictionary.update({'QQQ': 4})\nactualDictionary.update({'IBM': 5})\n\"\n                ).GetAttr(\"actualDictionary\");\n\n                Assert.Throws<ArgumentException>(() => pyObject.ConvertToDictionary<string, DateTime>());\n            }\n        }\n\n        public class TestGenericClass<T>\n        {\n            public T Value { get; set; }\n        }\n\n        public static TestGenericClass<int> GetGenericClassObject()\n        {\n            return new TestGenericClass<int>();\n        }\n\n        [Test]\n        public void PyObjectConvertFromGenericCSharpType()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"PyObjectConvertFromGenericCSharpType\",\n                    @\"\nfrom QuantConnect.Tests.Common.Util import ExtensionsTests\n\ndef GetGenericClassObject():\n    return ExtensionsTests.GetGenericClassObject()\n\");\n\n                var genericObject = module.GetAttr(\"GetGenericClassObject\").Invoke();\n                var result = genericObject.TryConvert<TestGenericClass<int>>(out var _);\n                Assert.IsTrue(result);\n            }\n        }\n\n        [Test]\n        public void PyObjectConvertPythonTypeDerivedFromCSharpType([Values] bool allowPythonDerivative)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"PyObjectConvertPythonTypeDerivedFromCSharpType\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass TestPythonDerivedClass(PythonData):\n    pass\n\");\n\n                var obj = module.GetAttr(\"TestPythonDerivedClass\").Invoke();\n                var result = obj.TryConvert<PythonData>(out var _, allowPythonDerivative);\n\n                Assert.AreEqual(allowPythonDerivative, result);\n            }\n        }\n\n        [Test]\n        public void BatchByDoesNotDropItems()\n        {\n            var list = new List<int> { 1, 2, 3, 4, 5 };\n            var by2 = list.BatchBy(2).ToList();\n            Assert.AreEqual(3, by2.Count);\n            Assert.AreEqual(2, by2[0].Count);\n            Assert.AreEqual(2, by2[1].Count);\n            Assert.AreEqual(1, by2[2].Count);\n            CollectionAssert.AreEqual(list, by2.SelectMany(x => x));\n        }\n\n        [Test]\n        public void ToOrderTicketCreatesCorrectTicket()\n        {\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, SecurityType.Equity, Symbols.USDJPY, 1000, 0, 1.11m, DateTime.Now, \"Pepe\");\n            var order = Order.CreateOrder(orderRequest);\n            order.Status = OrderStatus.Submitted;\n            order.Id = 11;\n            var orderTicket = order.ToOrderTicket(null);\n            Assert.AreEqual(order.Id, orderTicket.OrderId);\n            Assert.AreEqual(order.Quantity, orderTicket.Quantity);\n            Assert.AreEqual(order.Status, orderTicket.Status);\n            Assert.AreEqual(order.Type, orderTicket.OrderType);\n            Assert.AreEqual(order.Symbol, orderTicket.Symbol);\n            Assert.AreEqual(order.Tag, orderTicket.Tag);\n            Assert.AreEqual(order.Time, orderTicket.Time);\n            Assert.AreEqual(order.SecurityType, orderTicket.SecurityType);\n        }\n\n        [TestCase(4000, \"4K\")]\n        [TestCase(4103, \"4.1K\")]\n        [TestCase(40000, \"40K\")]\n        [TestCase(45321, \"45.3K\")]\n        [TestCase(654321, \"654K\")]\n        [TestCase(600031, \"600K\")]\n        [TestCase(1304303, \"1.3M\")]\n        [TestCase(2600000, \"2.6M\")]\n        [TestCase(26000000, \"26M\")]\n        [TestCase(260000000, \"260M\")]\n        [TestCase(2600000000, \"2.6B\")]\n        [TestCase(26000000000, \"26B\")]\n        public void ToFinancialFigures(double number, string expected)\n        {\n            var value = ((decimal)number).ToFinancialFigures();\n            Assert.AreEqual(expected, value);\n        }\n\n        [Test]\n        public void DecimalTruncateTo3DecimalPlaces()\n        {\n            var value = 10.999999m;\n            Assert.AreEqual(10.999m, value.TruncateTo3DecimalPlaces());\n        }\n\n        [Test]\n        public void DecimalTruncateTo3DecimalPlacesDoesNotThrowException()\n        {\n            var value = decimal.MaxValue;\n            Assert.DoesNotThrow(() => value.TruncateTo3DecimalPlaces());\n\n            value = decimal.MinValue;\n            Assert.DoesNotThrow(() => value.TruncateTo3DecimalPlaces());\n\n            value = decimal.MaxValue - 1;\n            Assert.DoesNotThrow(() => value.TruncateTo3DecimalPlaces());\n\n            value = decimal.MinValue + 1;\n            Assert.DoesNotThrow(() => value.TruncateTo3DecimalPlaces());\n        }\n\n        [Test]\n        public void DecimalAllowExponentTests()\n        {\n            const string strWithExponent = \"5e-5\";\n            Assert.AreEqual(strWithExponent.ToDecimalAllowExponent(), 0.00005);\n            Assert.AreNotEqual(strWithExponent.ToDecimal(), 0.00005);\n            Assert.AreEqual(strWithExponent.ToDecimal(), 10275);\n        }\n\n        [Test]\n        public void DateRulesToFunc()\n        {\n            var mhdb = MarketHoursDatabase.FromDataFolder();\n            var dateRules = new DateRules(null, new SecurityManager(\n                new TimeKeeper(new DateTime(2015, 1, 1), DateTimeZone.Utc)), DateTimeZone.Utc, mhdb);\n            var first = new DateTime(2015, 1, 10);\n            var second = new DateTime(2015, 1, 30);\n            var dateRule = dateRules.On(first, second);\n            var func = dateRule.ToFunc();\n\n            Assert.AreEqual(first, func(new DateTime(2015, 1, 1)));\n            Assert.AreEqual(first, func(new DateTime(2015, 1, 5)));\n            Assert.AreEqual(second, func(first));\n            Assert.AreEqual(Time.EndOfTime, func(second));\n            Assert.AreEqual(Time.EndOfTime, func(second));\n        }\n\n        [Test]\n        [TestCase(OptionRight.Call, true, OrderDirection.Sell)]\n        [TestCase(OptionRight.Call, false, OrderDirection.Buy)]\n        [TestCase(OptionRight.Put, true, OrderDirection.Buy)]\n        [TestCase(OptionRight.Put, false, OrderDirection.Sell)]\n        public void GetsExerciseDirection(OptionRight right, bool isShort, OrderDirection expected)\n        {\n            var actual = right.GetExerciseDirection(isShort);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void AppliesScalingToEquityTickQuotes()\n        {\n            // This test ensures that all Ticks with TickType == TickType.Quote have adjusted BidPrice and AskPrice.\n            // Relevant issue: https://github.com/QuantConnect/Lean/issues/4788\n\n            var algo = new QCAlgorithm();\n            var dataFeed = new NullDataFeed();\n\n            algo.SubscriptionManager.SetDataManager(new DataManager(\n                dataFeed,\n                new UniverseSelection(\n                    algo,\n                    new SecurityService(\n                        new CashBook(),\n                        MarketHoursDatabase.FromDataFolder(),\n                        SymbolPropertiesDatabase.FromDataFolder(),\n                        algo,\n                        null,\n                        null,\n                        algorithm: algo),\n                    new DataPermissionManager(),\n                    TestGlobals.DataProvider\n                ),\n                algo,\n                new TimeKeeper(DateTime.UtcNow),\n                MarketHoursDatabase.FromDataFolder(),\n                false,\n                null,\n                new DataPermissionManager()\n            ));\n\n            algo.HistoryProvider = new SubscriptionDataReaderHistoryProvider();\n            algo.HistoryProvider.Initialize(\n                new HistoryProviderInitializeParameters(\n                    null,\n                    null,\n                    null,\n                    TestGlobals.DataCacheProvider,\n                    TestGlobals.MapFileProvider,\n                    TestGlobals.FactorFileProvider,\n                    (_) => { },\n                    false,\n                    new DataPermissionManager(),\n                    algo.ObjectStore,\n                    algo.Settings));\n\n            algo.SetStartDate(DateTime.UtcNow.AddDays(-1));\n\n            var history = algo.History(new[] { Symbols.IBM }, new DateTime(2013, 10, 7), new DateTime(2013, 10, 8), Resolution.Tick).ToList();\n            Assert.AreEqual(57460, history.Count);\n\n            foreach (var slice in history)\n            {\n                if (!slice.Ticks.ContainsKey(Symbols.IBM))\n                {\n                    continue;\n                }\n\n                foreach (var tick in slice.Ticks[Symbols.IBM])\n                {\n                    if (tick.BidPrice != 0)\n                    {\n                        Assert.LessOrEqual(Math.Abs(tick.Value - tick.BidPrice), 0.05);\n                    }\n                    if (tick.AskPrice != 0)\n                    {\n                        Assert.LessOrEqual(Math.Abs(tick.Value - tick.AskPrice), 0.05);\n                    }\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(PositionSide.Long, OrderDirection.Buy)]\n        [TestCase(PositionSide.Short, OrderDirection.Sell)]\n        [TestCase(PositionSide.None, OrderDirection.Hold)]\n        public void ToOrderDirection(PositionSide side, OrderDirection expected)\n        {\n            Assert.AreEqual(expected, side.ToOrderDirection());\n        }\n\n        [Test]\n        [TestCase(OrderDirection.Buy, PositionSide.Long, false)]\n        [TestCase(OrderDirection.Buy, PositionSide.Short, true)]\n        [TestCase(OrderDirection.Buy, PositionSide.None, false)]\n        [TestCase(OrderDirection.Sell, PositionSide.Long, true)]\n        [TestCase(OrderDirection.Sell, PositionSide.Short, false)]\n        [TestCase(OrderDirection.Sell, PositionSide.None, false)]\n        [TestCase(OrderDirection.Hold, PositionSide.Long, false)]\n        [TestCase(OrderDirection.Hold, PositionSide.Short, false)]\n        [TestCase(OrderDirection.Hold, PositionSide.None, false)]\n        public void Closes(OrderDirection direction, PositionSide side, bool expected)\n        {\n            Assert.AreEqual(expected, direction.Closes(side));\n        }\n\n        [Test]\n        public void ListEquals()\n        {\n            var left = new[] { 1, 2, 3 };\n            var right = new[] { 1, 2, 3 };\n            Assert.IsTrue(left.ListEquals(right));\n\n            right[2] = 4;\n            Assert.IsFalse(left.ListEquals(right));\n        }\n\n        [Test]\n        public void GetListHashCode()\n        {\n            var ints1 = new[] { 1, 2, 3 };\n            var ints2 = new[] { 1, 3, 2 };\n            var longs = new[] { 1L, 2L, 3L };\n            var decimals = new[] { 1m, 2m, 3m };\n\n            // ordering dependent\n            Assert.AreNotEqual(ints1.GetListHashCode(), ints2.GetListHashCode());\n\n            Assert.AreEqual(ints1.GetListHashCode(), decimals.GetListHashCode());\n\n            // known type collision - long has same hash code as int within the int range\n            // we could take a hash of typeof(T) but this would require ListEquals to enforce exact types\n            // and we would prefer to allow typeof(T)'s GetHashCode and Equals to make this determination.\n            Assert.AreEqual(ints1.GetListHashCode(), longs.GetListHashCode());\n\n            // deterministic\n            Assert.AreEqual(ints1.GetListHashCode(), new[] { 1, 2, 3 }.GetListHashCode());\n        }\n\n        [Test]\n        [TestCase(\"0.999\", \"0.0001\", \"0.999\")]\n        [TestCase(\"0.999\", \"0.001\", \"0.999\")]\n        [TestCase(\"0.999\", \"0.01\", \"1.000\")]\n        [TestCase(\"0.999\", \"0.1\", \"1.000\")]\n        [TestCase(\"0.999\", \"1\", \"1.000\")]\n        [TestCase(\"0.999\", \"2\", \"0\")]\n        [TestCase(\"1.0\", \"0.15\", \"1.05\")]\n        [TestCase(\"1.05\", \"0.15\", \"1.05\")]\n        [TestCase(\"0.975\", \"0.15\", \"1.05\")]\n        [TestCase(\"-0.975\", \"0.15\", \"-1.05\")]\n        [TestCase(\"-1.0\", \"0.15\", \"-1.05\")]\n        [TestCase(\"-1.05\", \"0.15\", \"-1.05\")]\n        public void DiscretelyRoundBy(string valueString, string quantaString, string expectedString)\n        {\n            var value = decimal.Parse(valueString, CultureInfo.InvariantCulture);\n            var quanta = decimal.Parse(quantaString, CultureInfo.InvariantCulture);\n            var expected = decimal.Parse(expectedString, CultureInfo.InvariantCulture);\n            var actual = value.DiscretelyRoundBy(quanta);\n            Assert.AreEqual(expected, actual);\n        }\n\n        [TestCase(new int[] { 1, 2 }, 1)]\n        [TestCase(new int[] { -1, 10 }, 1)]\n        [TestCase(new int[] { 2, -5 }, 1)]\n        [TestCase(new int[] { 1, 2, 3 }, 1)]\n        [TestCase(new int[] { 200, -11, 7 }, 1)]\n        [TestCase(new int[] { 10, 20 }, 10)]\n        [TestCase(new int[] { -10, 100 }, 10)]\n        [TestCase(new int[] { 20, -50 }, 10)]\n        [TestCase(new int[] { 10, 20, 30 }, 10)]\n        [TestCase(new int[] { 1000, -55, 35 }, 5)]\n        [TestCase(new int[] { 24, 148, 36, 48, 52, 364 }, 4)]\n        [TestCase(new int[] { 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 }, 1)]\n        public void GreatestCommonDivisorTests(int[] values, int expectedResult)\n        {\n            Assert.AreEqual(expectedResult, values.GreatestCommonDivisor());\n        }\n\n        [Test]\n        public void ConvertsPythonUniverseSelectionSymbolIDDelegateToSymbolDelegate()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"ConvertsPythonUniverseSelectionSymbolIDDelegateToSymbolDelegate\",\n                    @\"\ndef select_symbol(fundamental):\n    return [str(x.Symbol.ID) for x in fundamental]\n\"\n                );\n                var selectSymbolPythonMethod = module.GetAttr(\"select_symbol\");\n                Assert.IsTrue(selectSymbolPythonMethod.TryAs(out Func<IEnumerable<Fundamental>, object> selectSymbols));\n                Assert.IsNotNull(selectSymbols);\n\n                var selectSymbolsUniverseDelegate = selectSymbols.ConvertToUniverseSelectionSymbolDelegate();\n\n                var reference = new DateTime(2024, 2, 1);\n                var fundamentals = new List<Fundamental>()\n                {\n                    new Fundamental(reference, Symbols.SPY),\n                    new Fundamental(reference, Symbols.AAPL),\n                    new Fundamental(reference, Symbols.IBM),\n                    new Fundamental(reference, Symbols.GOOG)\n                };\n\n                List<Symbol> symbols = null;\n                Assert.DoesNotThrow(() => symbols = selectSymbolsUniverseDelegate(fundamentals).ToList());\n                CollectionAssert.IsNotEmpty(symbols);\n                Assert.That(symbols, Is.All.Matches<Symbol>(x => fundamentals.Any(fund => fund.Symbol == x)));\n            }\n        }\n\n        [TestCaseSource(nameof(DivideCases))]\n        public void SafeDivisionWorksAsExpectedWithEdgeCases(decimal numerator, decimal denominator)\n        {\n            Assert.DoesNotThrow(() => numerator.SafeDivision(denominator));\n        }\n\n        [TestCase(\"GOOGL\", \"2004/08/19\", \"2024/03/01\", 2, \"GOOG,GOOGL\")] // IPO: August 19, 2004\n        [TestCase(\"GOOGL\", \"2010/02/01\", \"2012/03/01\", 1, \"GOOG\")]\n        [TestCase(\"GOOGL\", \"2014/04/02\", \"2024/03/01\", 2, \"GOOG,GOOGL\")] // The restructuring: \"GOOG\" to \"GOOGL\"\n        [TestCase(\"GOOGL\", \"2014/02/01\", \"2024/03/01\", 2, \"GOOG,GOOGL\")]\n        [TestCase(\"GOOGL\", \"2020/02/01\", \"2024/03/01\", 1, \"GOOGL\")]\n        [TestCase(\"GOOGL\", \"2023/02/01\", \"2024/03/01\", 1, \"GOOGL\")]\n        [TestCase(\"GOOG\", \"2020/02/01\", \"2024/03/01\", 1, \"GOOG\")]\n        [TestCase(\"AAPL\", \"2008/02/01\", \"2024/03/01\", 1, \"AAPL\")]\n        [TestCase(\"AAPL\", \"2008/02/01\", \"2024/03/01\", 1, \"AAPL\")]\n        [TestCase(\"GOOG\", \"2014/04/03\", \"2024/03/01\", 1, \"GOOG\")] // The restructuring: April 2, 2014 \"GOOCV\" to \"GOOG\"\n        [TestCase(\"GOOG\", \"2013/04/03\", \"2014/04/01\", 1, \"GOOCV\")]\n        [TestCase(\"GOOG\", \"2013/04/03\", \"2024/03/01\", 2, \"GOOCV,GOOG\")]\n        [TestCase(\"GOOG\", \"2015/04/03\", \"2024/03/01\", 1, \"GOOG\")]\n        [TestCase(\"GOOCV\", \"2010/01/01\", \"2024/03/01\", 2, \"GOOCV,GOOG\")]\n        [TestCase(\"GOOG\", \"2014/01/01\", \"2024/03/01\", 2, \"GOOCV,GOOG\")]\n        [TestCase(\"SPWR\", \"2005/11/17\", \"2024/03/01\", 3, \"SPWR,SPWRA,SPWR\")] // IPO: November 17, 2005\n        [TestCase(\"SPWR\", \"2023/11/16\", \"2024/03/01\", 1, \"SPWR\")]\n        [TestCase(\"NFLX\", \"2023/11/16\", \"2024/03/01\", 0, null, Description = \"The Symbol is not mapped\")]\n        public void GetHistoricalSymbolNamesByDateRequest(string ticker, DateTime startDateTime, DateTime endDateTime, int expectedAmount, string expectedTickers)\n        {\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n            var request = TestsHelpers.GetHistoryRequest(symbol, startDateTime, endDateTime, Resolution.Daily, TickType.Trade);\n\n            var tickers = TestGlobals.MapFileProvider.RetrieveSymbolHistoricalDefinitionsInDateRange(symbol, request.StartTimeUtc, request.EndTimeUtc).ToList();\n\n            Assert.That(tickers.Count, Is.EqualTo(expectedAmount));\n\n            if (tickers.Count != 0)\n            {\n                Assert.That(tickers.First().StartDateTimeLocal, Is.EqualTo(startDateTime));\n                Assert.That(tickers.Last().EndDateTimeLocal, Is.EqualTo(endDateTime));\n\n                if (expectedTickers != null)\n                {\n                    foreach (var (actualTicker, expectedTicker) in tickers.Zip(expectedTickers.Split(','), (t, et) => (t.Ticker, et)))\n                    {\n                        Assert.That(actualTicker, Is.EqualTo(expectedTicker));\n                    }\n                }\n            }\n        }\n\n        [TestCase(Futures.Indices.SP500EMini, \"2023/11/16\", 1)]\n        [TestCase(Futures.Metals.Gold, \"2023/11/16\", 0, Description = \"The startDateTime is not mapped\")]\n        public void GetHistoricalFutureSymbolNamesByDateRequest(string ticker, DateTime expiryTickerDate, int expectedAmount)\n        {\n            var futureSymbol = Symbols.CreateFutureSymbol(ticker, expiryTickerDate);\n\n            var tickers =\n                TestGlobals.MapFileProvider.RetrieveSymbolHistoricalDefinitionsInDateRange(futureSymbol, new DateTime(2023, 11, 5), expiryTickerDate).ToList();\n\n            Assert.That(tickers.Count, Is.EqualTo(expectedAmount));\n        }\n\n        [TestCaseSource(nameof(GetPythonPropertyOfACustomIndicatorWorksTestCases))]\n        public void GetPythonPropertyOfACustomIndicatorWorks(string stringModule, string propertyName, bool implementsProperty, bool expectedPropertyValue)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(), stringModule);\n                var indicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                .Invoke(\"custom\".ToPython(), 10.ToPython());\n\n                Assert.AreEqual(implementsProperty, indicator.GetPythonBoolPropertyWithChecks(propertyName) != null);\n                if (implementsProperty)\n                {\n                    var property = indicator.GetPythonBoolPropertyWithChecks(propertyName);\n                    var value = BasePythonWrapper<IIndicator>.PythonRuntimeChecker.ConvertAndDispose<bool>(property, propertyName, isMethod: false);\n                    Assert.AreEqual(expectedPropertyValue, value);\n                }\n            }\n        }\n\n        [Test]\n        public void TryGetFromCsv_EmptyCsv_ReturnsNull()\n        {\n            var csvLine = \"\";\n            var index = 0;\n\n            Assert.IsFalse(csvLine.TryGetFromCsv(index, out var result));\n            Assert.IsTrue(result.IsEmpty);\n        }\n\n        [Test]\n        public void TryGetFromCsv_SingleValue_ReturnsValue()\n        {\n            var csvLine = \"value\";\n            var index = 0;\n\n            Assert.IsTrue(csvLine.TryGetFromCsv(index, out var result));\n            Assert.AreEqual(\"value\", result.ToString());\n        }\n\n        [TestCase(\"value1,value2,value3\", 0, \"value1\")]\n        [TestCase(\"value1,value2,value3\", 1, \"value2\")]\n        [TestCase(\"value1,value2,value3\", 2, \"value3\")]\n        [TestCase(\"value1,value2,value3,\", 0, \"value1\")]\n        [TestCase(\"value1,value2,value3,\", 1, \"value2\")]\n        [TestCase(\"value1,value2,value3,\", 2, \"value3\")]\n        [TestCase(\"value1,value2,value3,\", 3, \"\")]\n        public void TryGetFromCsv_MultipleValues_ReturnsCorrectValue(string csvLine, int index, string expectedValue)\n        {\n            Assert.IsTrue(csvLine.TryGetFromCsv(index, out var result));\n            Assert.AreEqual(expectedValue, result.ToString());\n        }\n\n        [TestCase(-1)]\n        [TestCase(3)]\n        public void TryGetFromCsv_InvalidIndex_ReturnsNull(int index)\n        {\n            var csvLine = \"value1,value2,value3\";\n            Assert.IsFalse(csvLine.TryGetFromCsv(index, out var result));\n            Assert.IsTrue(result.IsEmpty);\n        }\n\n        [TestCase(0)]\n        [TestCase(-1)]\n        [TestCase(3)]\n        public void TryGetDecimalFromCsv_InvalidTypeOrIndex_ReturnsZero(int index)\n        {\n            var csvLine = \"value1,value2,value3\";\n            Assert.IsFalse(csvLine.TryGetDecimalFromCsv(index, out var result));\n            Assert.AreEqual(0, result);\n        }\n\n        [TestCase(0, 2.0)]\n        [TestCase(1, 1.234)]\n        public void TryGetDecimalFromCsv_ReturnsDecimalValue(int index, decimal expectedValue)\n        {\n            var csvLine = \"2,1.234\";\n            Assert.IsTrue(csvLine.TryGetDecimalFromCsv(index, out var result));\n            Assert.AreEqual(expectedValue, result);\n        }\n\n        [Test]\n        public void GetsEnumStringInPython([Values] bool useIntValue)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"GetsEnumStringInPython\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef get_enum_string(value):\n    return Extensions.get_enum_string(value, Resolution)\n\"\n                );\n\n                using var getEnumString = module.GetAttr(\"get_enum_string\");\n                var enumValue = Resolution.Minute;\n                using var pyEnumValue = useIntValue ? Convert.ToInt64(enumValue).ToPython() : enumValue.ToPython();\n                var enumString = getEnumString.Invoke(pyEnumValue).As<string>();\n\n                Assert.AreEqual(nameof(Resolution.Minute), enumString);\n            }\n        }\n\n        private class TestDto\n        {\n            public string Name { get; set; }\n            public DateTime Date { get; set; }\n            public decimal Amount { get; set; }\n        }\n\n        [Test]\n        public void JsonStreamSerializationRoundTrip()\n        {\n            var original = new TestDto()\n            {\n                Name = \"Test\",\n                Date = new DateTime(2024, 1, 1),\n                Amount = 123.45m\n            };\n\n            using var stream = new MemoryStream();\n            original.SerializeJsonToStream(stream);\n\n            stream.Seek(0, SeekOrigin.Begin);\n            var deserialized = stream.DeserializeJson<TestDto>();\n\n            Assert.AreEqual(original.Name, deserialized.Name);\n            Assert.AreEqual(original.Date, deserialized.Date);\n            Assert.AreEqual(original.Amount, deserialized.Amount);\n        }\n\n        [Test]\n        public void JsonStringSerializationRoundTrip()\n        {\n            var original = new TestDto()\n            {\n                Name = \"Test\",\n                Date = new DateTime(2024, 1, 1),\n                Amount = 123.45m\n            };\n\n            var jsonString = original.SerializeJsonToString();\n            var deserialized = jsonString.DeserializeJson<TestDto>();\n\n            Assert.AreEqual(original.Name, deserialized.Name);\n            Assert.AreEqual(original.Date, deserialized.Date);\n            Assert.AreEqual(original.Amount, deserialized.Amount);\n        }\n\n        [Test]\n        public void TryDownloadDataDeserializesToCorrectType()\n        {\n            var json = \"{\\\"Open\\\": 10.5, \\\"High\\\": 12.0, \\\"Low\\\": 9.5, \\\"Close\\\": 11.0}\";\n            using var client = MockClient(json, HttpStatusCode.OK);\n\n            bool success = client.TryDownloadData<Bar>(\"http://test.com\", out var bar, out _);\n\n            Assert.IsTrue(success);\n            Assert.AreEqual(10.5m, bar.Open);\n            Assert.AreEqual(12.0m, bar.High);\n            Assert.AreEqual(9.5m, bar.Low);\n            Assert.AreEqual(11.0m, bar.Close);\n        }\n\n        [TestCase(\"{\\\"Sucess\\\": true}\")]\n        [TestCase(\"Plain text response\")]\n        public void TryDownloadDataReturnsRawResponseWhenTypeIsString(string json)\n        {\n            using var client = MockClient(json, HttpStatusCode.OK);\n\n            bool success1 = client.TryDownloadData<string>(\"http://test.com\", out var result1, out _);\n            bool success2 = client.TryDownloadData(\"http://test.com\", out var result2, out _);\n\n            Assert.IsTrue(success1 && success2);\n            Assert.AreEqual(json, result1);\n            Assert.AreEqual(json, result2);\n        }\n\n        [Test]\n        public void TryDownloadDataHandlesNetworkError()\n        {\n            var handlerMock = new Mock<HttpMessageHandler>();\n            handlerMock\n               .Protected()\n               .Setup<Task<HttpResponseMessage>>(\n                  \"SendAsync\",\n                  ItExpr.IsAny<HttpRequestMessage>(),\n                  ItExpr.IsAny<CancellationToken>())\n               .ThrowsAsync(new HttpRequestException(\"Network connection failed!\"));\n\n            using var client = new HttpClient(handlerMock.Object);\n\n            bool success = client.TryDownloadData<Bar>(\"http://test.com\", out var result, out var statusCode);\n\n            Assert.IsFalse(success);\n            Assert.IsNull(result);\n            Assert.IsNull(statusCode);\n        }\n\n        private static HttpClient MockClient(string content, HttpStatusCode code)\n        {\n            var handlerMock = new Mock<HttpMessageHandler>();\n\n            handlerMock\n               .Protected()\n               .Setup<Task<HttpResponseMessage>>(\n                  \"SendAsync\",\n                  ItExpr.IsAny<HttpRequestMessage>(),\n                  ItExpr.IsAny<CancellationToken>())\n               .Returns(() => Task.FromResult(new HttpResponseMessage\n               {\n                   StatusCode = code,\n                   Content = new StringContent(content),\n               }));\n\n            return new HttpClient(handlerMock.Object);\n        }\n\n        private static TestCaseData[] MirrorOptionTestCases\n        {\n            get\n            {\n                var spy = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n                var spx = Symbol.Create(\"SPX\", SecurityType.Index, Market.USA);\n\n                var strike = 100m;\n                var expiry = new DateTime(2021, 1, 1);\n\n                var spyCall = Symbol.CreateOption(spy, Market.USA, OptionStyle.American, OptionRight.Call, strike, expiry);\n                var spyPut = Symbol.CreateOption(spy, Market.USA, OptionStyle.American, OptionRight.Put, strike, expiry);\n\n                var spxCall = Symbol.CreateOption(spx, Market.USA, OptionStyle.European, OptionRight.Call, strike, expiry);\n                var spxPut = Symbol.CreateOption(spx, Market.USA, OptionStyle.European, OptionRight.Put, strike, expiry);\n\n                var spxwCall = Symbol.CreateOption(spx, \"SPXW\", Market.USA, OptionStyle.European, OptionRight.Call, strike, expiry);\n                var spxwPut = Symbol.CreateOption(spx, \"SPXW\", Market.USA, OptionStyle.European, OptionRight.Put, strike, expiry);\n\n                return new[]\n                {\n                    new TestCaseData(spyCall).Returns(spyPut),\n                    new TestCaseData(spyPut).Returns(spyCall),\n\n                    new TestCaseData(spxCall).Returns(spxPut),\n                    new TestCaseData(spxPut).Returns(spxCall),\n\n                    new TestCaseData(spxwCall).Returns(spxwPut),\n                    new TestCaseData(spxwPut).Returns(spxwCall),\n                };\n            }\n        }\n\n        [TestCaseSource(nameof(MirrorOptionTestCases))]\n        public Symbol GetsCorrectMirrorOption(Symbol optionSymbol)\n        {\n            return optionSymbol.GetMirrorOptionSymbol();\n        }\n\n        private PyObject ConvertToPyObject(object value)\n        {\n            using (Py.GIL())\n            {\n                return value.ToPython();\n            }\n        }\n\n        private class Super<T>\n        {\n        }\n\n        private class Derived1 : Super<int>\n        {\n        }\n\n        private class Derived2 : Derived1\n        {\n        }\n\n        private static Security CreateSecurity(Symbol symbol)\n        {\n            var entry = MarketHoursDatabase.FromDataFolder()\n                .GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            return new Security(symbol,\n                entry.ExchangeHours,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private static object[] DivideCases =\n        {\n            new decimal[] { 100000000000000000000m, 0.000000000001m },\n            new decimal[] { -100000000000000000000m, 0.000000000001m },\n            new decimal[] { 1, 0 },\n            new decimal[] { 0.0000000000000001m, 10000000000000000000000000000m },\n            new decimal[] { -0.000000000000001m, 10000000000000000000000000000m },\n        };\n\n        private static object[] GetPythonPropertyOfACustomIndicatorWorksTestCases =\n        {\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    def custom_property(self):\n        return True\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", false, true},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    def custom_property(self):\n        return False\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", false, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\",false, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    @property\n    def custom_property(self):\n        return True\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", true, true},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    @property\n    def custom_property(self):\n        return False\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", true, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n        self.custom_property = False\n\n    @property\n    def custom_property(self):\n        return self._custom_property\n\n    @custom_property.setter\n    def custom_property(self, value):\n        self._custom_property = value\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", true, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n        self.custom_property = True\n\n    @property\n    def custom_property(self):\n        return self._custom_property\n\n    @custom_property.setter\n    def custom_property(self, value):\n        self._custom_property = value\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"custom_property\", true, true},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n        self.is_ready = True\n\n    @property\n    def is_ready(self):\n        return self._is_ready\n\n    @is_ready.setter\n    def is_ready(self, value):\n        self._is_ready = value\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", true, true},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n        self.is_ready = False\n\n    @property\n    def is_ready(self):\n        return self._is_ready\n\n    @is_ready.setter\n    def is_ready(self, value):\n        self._is_ready = value\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", true, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    @property\n    def is_ready(self):\n        return False\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", true, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    @property\n    def is_ready(self):\n        return True\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", true, true},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    def is_ready(self):\n        return False\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", false, false},\n            new object[] { $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.name = name\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def update(self, input):\n        return True\n\", \"is_ready\", false, false},\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/FileExtensionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class FileExtensionTests\n    {\n        [TestCaseSource(nameof(ToNormalizedPathReturnsNormalizedPathTestCases))]\n        [Platform(\"Win\", Reason = \"The paths in these testcases are only forbidden in Windows OS\")]\n        public void ToNormalizedPathReturnsNormalizedPath(string inputName, string expectedName)\n        {\n            Assert.AreEqual(expectedName, FileExtension.ToNormalizedPath(inputName));\n        }\n\n        [TestCaseSource(nameof(ToNormalizedPathReturnsTheSamePathTestCases))]\n        [Platform(\"Win\", Reason = \"The paths in these testcases are only forbidden in Windows OS\")]\n        public void ToNormalizedPathReturnsTheSamePath(string inputName)\n        {\n            Assert.AreEqual(inputName, FileExtension.ToNormalizedPath(inputName));\n        }\n\n        [TestCaseSource(nameof(FromValidReturnsOriginalPathTestCases))]\n        [Platform(\"Win\", Reason = \"The paths in these testcases are only forbidden in Windows OS\")]\n        public void FromValidReturnsOriginalName(string inputName, string expectedName)\n        {\n            Assert.AreEqual(expectedName, FileExtension.FromNormalizedPath(inputName));\n        }\n\n        [TestCaseSource(nameof(ToNormalizedPathAndFromNormalizedPathReturnTheSameNameWhenOSIsNotWindowsTestCases))]\n        [Platform(Exclude = \"Win\")]\n        public void ToNormalizedPathAndFromNormalizedPathReturnsTheSameNameWhenOSIsNotWindows(string inputName)\n        {\n            Assert.AreEqual(inputName, FileExtension.ToNormalizedPath(inputName));\n            Assert.AreEqual(inputName, FileExtension.FromNormalizedPath(inputName));\n        }\n\n        public static object[] ToNormalizedPathReturnsNormalizedPathTestCases =\n        {\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AUX\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"AUX\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\NUL\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"NUL\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\PRN\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"PRN\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\CON\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"CON\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM0\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM0\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM1\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM1\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM2\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM2\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM3\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM3\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM4\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM4\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM5\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM5\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM6\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM6\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM7\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM7\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM8\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM8\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM9\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM9\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT0\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT0\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT1\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT1\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT2\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT2\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT3\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT3\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT4\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT4\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT5\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT5\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT6\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT6\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT7\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT7\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT8\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT8\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT9\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT9\"},\n            new object[] {\"data/equity/usa/map_files/AUX\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"AUX\"},\n            new object[] {\"data/equity/usa/map_files/NUL\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"NUL\"},\n            new object[] {\"data/equity/usa/map_files/PRN\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"PRN\"},\n            new object[] {\"data/equity/usa/map_files/CON\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"CON\"},\n            new object[] {\"data/equity/usa/map_files/COM0\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM0\"},\n            new object[] {\"data/equity/usa/map_files/COM1\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM1\"},\n            new object[] {\"data/equity/usa/map_files/COM2\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM2\"},\n            new object[] {\"data/equity/usa/map_files/COM3\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM3\"},\n            new object[] {\"data/equity/usa/map_files/COM4\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM4\"},\n            new object[] {\"data/equity/usa/map_files/COM5\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM5\"},\n            new object[] {\"data/equity/usa/map_files/COM6\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM6\"},\n            new object[] {\"data/equity/usa/map_files/COM7\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM7\"},\n            new object[] {\"data/equity/usa/map_files/COM8\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM8\"},\n            new object[] {\"data/equity/usa/map_files/COM9\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM9\"},\n            new object[] {\"data/equity/usa/map_files/LPT0\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT0\"},\n            new object[] {\"data/equity/usa/map_files/LPT1\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT1\"},\n            new object[] {\"data/equity/usa/map_files/LPT2\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT2\"},\n            new object[] {\"data/equity/usa/map_files/LPT3\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT3\"},\n            new object[] {\"data/equity/usa/map_files/LPT4\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT4\"},\n            new object[] {\"data/equity/usa/map_files/LPT5\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT5\"},\n            new object[] {\"data/equity/usa/map_files/LPT6\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT6\"},\n            new object[] {\"data/equity/usa/map_files/LPT7\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT7\"},\n            new object[] {\"data/equity/usa/map_files/LPT8\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT8\"},\n            new object[] {\"data/equity/usa/map_files/LPT9\", \"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT9\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM0.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM1.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM2.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM3.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM4.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM5.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM6.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM7.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM8.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM9.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT0.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT1.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT2.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT3.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT4.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT5.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT6.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT7.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT8.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT9.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AUX.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"AUX.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\NUL.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"NUL.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\PRN.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"PRN.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\CON.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"CON.csv\"},\n            new object[] {\"AUX.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"AUX.csv\"},\n            new object[] {\"NUL.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"NUL.csv\"},\n            new object[] {\"PRN.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"PRN.csv\"},\n            new object[] {\"CON.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"CON.csv\"},\n            new object[] {\"COM0.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM0.csv\"},\n            new object[] {\"COM1.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM1.csv\"},\n            new object[] {\"COM2.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM2.csv\"},\n            new object[] {\"COM3.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM3.csv\"},\n            new object[] {\"COM4.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM4.csv\"},\n            new object[] {\"COM5.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM5.csv\"},\n            new object[] {\"COM6.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM6.csv\"},\n            new object[] {\"COM7.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM7.csv\"},\n            new object[] {\"COM8.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM8.csv\"},\n            new object[] {\"COM9.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"COM9.csv\"},\n            new object[] {\"LPT0.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT0.csv\"},\n            new object[] {\"LPT1.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT1.csv\"},\n            new object[] {\"LPT2.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT2.csv\"},\n            new object[] {\"LPT3.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT3.csv\"},\n            new object[] {\"LPT4.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT4.csv\"},\n            new object[] {\"LPT5.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT5.csv\"},\n            new object[] {\"LPT6.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT6.csv\"},\n            new object[] {\"LPT7.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT7.csv\"},\n            new object[] {\"LPT8.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT8.csv\"},\n            new object[] {\"LPT9.csv\", \"\"+ FileExtension.ReservedWordsPrefix +\"LPT9.csv\"},\n            new object[] {\"AUX.tar.gz\", \"\"+ FileExtension.ReservedWordsPrefix +\"AUX.tar.gz\"},\n            new object[] {\"NUL.tar.gz\", \"\"+ FileExtension.ReservedWordsPrefix +\"NUL.tar.gz\"},\n            new object[] {\"PRN.tar.gz\", \"\"+ FileExtension.ReservedWordsPrefix +\"PRN.tar.gz\"},\n            new object[] {\"CON.tar.gz\", \"\"+ FileExtension.ReservedWordsPrefix +\"CON.tar.gz\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\con\\\\20150903_trade.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"con\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\nul\\\\20150903_trade.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"nul\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\prn\\\\20150903_trade.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"prn\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\aux\\\\20150903_trade.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"aux\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\con\\\\con.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"con\\\\\"+ FileExtension.ReservedWordsPrefix +\"con.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\nul\\\\nul.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"nul\\\\\"+ FileExtension.ReservedWordsPrefix +\"nul.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\prn\\\\prn.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"prn\\\\\"+ FileExtension.ReservedWordsPrefix +\"prn.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\aux\\\\aux.zip\", \"equity\\\\usa\\\\minute\\\\\"+ FileExtension.ReservedWordsPrefix +\"aux\\\\\"+ FileExtension.ReservedWordsPrefix +\"aux.zip\" }\n        };\n\n        public static object[] ToNormalizedPathReturnsTheSamePathTestCases =\n        {\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AAUX.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\ANUL.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\APRN.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\ACON.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AUXA.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\NULA.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\PRNA.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\CONA.csv\"},\n            new object[] {\"AAUX.csv\"},\n            new object[] {\"ANUL.csv\"},\n            new object[] {\"APRN.csv\"},\n            new object[] {\"ACON.csv\"},\n            new object[] {\"AUXA.csv\"},\n            new object[] {\"NULA.csv\"},\n            new object[] {\"PRNA.csv\"},\n            new object[] {\"CONA.csv\"},\n            new object[] {\"data/equity/usa/map_files/AAUX.csv\"},\n            new object[] {\"data/equity/usa/map_files/ANUL.csv\"},\n            new object[] {\"data/equity/usa/map_files/APRN.csv\"},\n            new object[] {\"data/equity/usa/map_files/ACON.csv\"},\n            new object[] {\"data/equity/usa/map_files/AUXA.csv\"},\n            new object[] {\"data/equity/usa/map_files/NULA.csv\"},\n            new object[] {\"data/equity/usa/map_files/PRNA.csv\"},\n            new object[] {\"data/equity/usa/map_files/CONA.csv\"}\n        };\n\n        public static object[] FromValidReturnsOriginalPathTestCases =\n        {\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM0.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM1.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM2.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM3.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM4.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM5.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM6.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM7.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM8.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"COM9.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\COM9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT0.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT1.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT2.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT3.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT4.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT5.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT6.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT7.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT8.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"LPT9.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\LPT9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"AUX.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\AUX.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"NUL.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\NUL.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"PRN.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\PRN.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\\"+ FileExtension.ReservedWordsPrefix +\"CON.csv\", \"data\\\\equity\\\\usa\\\\map_files\\\\CON.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM0.csv\", \"data/equity/usa/map_files/COM0.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM1.csv\", \"data/equity/usa/map_files/COM1.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM2.csv\", \"data/equity/usa/map_files/COM2.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM3.csv\", \"data/equity/usa/map_files/COM3.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM4.csv\", \"data/equity/usa/map_files/COM4.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM5.csv\", \"data/equity/usa/map_files/COM5.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM6.csv\", \"data/equity/usa/map_files/COM6.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM7.csv\", \"data/equity/usa/map_files/COM7.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM8.csv\", \"data/equity/usa/map_files/COM8.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"COM9.csv\", \"data/equity/usa/map_files/COM9.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT0.csv\", \"data/equity/usa/map_files/LPT0.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT1.csv\", \"data/equity/usa/map_files/LPT1.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT2.csv\", \"data/equity/usa/map_files/LPT2.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT3.csv\", \"data/equity/usa/map_files/LPT3.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT4.csv\", \"data/equity/usa/map_files/LPT4.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT5.csv\", \"data/equity/usa/map_files/LPT5.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT6.csv\", \"data/equity/usa/map_files/LPT6.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT7.csv\", \"data/equity/usa/map_files/LPT7.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT8.csv\", \"data/equity/usa/map_files/LPT8.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"LPT9.csv\", \"data/equity/usa/map_files/LPT9.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"AUX.csv\", \"data/equity/usa/map_files/AUX.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"NUL.csv\", \"data/equity/usa/map_files/NUL.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"PRN.csv\", \"data/equity/usa/map_files/PRN.csv\"},\n            new object[] {\"data/equity/usa/map_files/\"+ FileExtension.ReservedWordsPrefix +\"CON.csv\", \"data/equity/usa/map_files/CON.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"AUX.csv\", \"AUX.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"NUL.csv\", \"NUL.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"PRN.csv\", \"PRN.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"CON.csv\", \"CON.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM0.csv\", \"COM0.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM1.csv\", \"COM1.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM2.csv\", \"COM2.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM3.csv\", \"COM3.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM4.csv\", \"COM4.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM5.csv\", \"COM5.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM6.csv\", \"COM6.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM7.csv\", \"COM7.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM8.csv\", \"COM8.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"COM9.csv\", \"COM9.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT0.csv\", \"LPT0.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT1.csv\", \"LPT1.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT2.csv\", \"LPT2.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT3.csv\", \"LPT3.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT4.csv\", \"LPT4.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT5.csv\", \"LPT5.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT6.csv\", \"LPT6.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT7.csv\", \"LPT7.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT8.csv\", \"LPT8.csv\"},\n            new object[] {\"\"+ FileExtension.ReservedWordsPrefix +\"LPT9.csv\", \"LPT9.csv\"},\n        };\n\n        public static object[] ToNormalizedPathAndFromNormalizedPathReturnTheSameNameWhenOSIsNotWindowsTestCases =\n        {\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AUX\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\NUL\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\PRN\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\CON\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM0\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM1\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM2\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM3\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM4\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM5\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM6\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM7\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM8\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM9\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT0\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT1\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT2\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT3\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT4\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT5\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT6\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT7\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT8\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT9\"},\n            new object[] {\"data/equity/usa/map_files/AUX\"},\n            new object[] {\"data/equity/usa/map_files/NUL\"},\n            new object[] {\"data/equity/usa/map_files/PRN\"},\n            new object[] {\"data/equity/usa/map_files/CON\"},\n            new object[] {\"data/equity/usa/map_files/COM0\"},\n            new object[] {\"data/equity/usa/map_files/COM1\"},\n            new object[] {\"data/equity/usa/map_files/COM2\"},\n            new object[] {\"data/equity/usa/map_files/COM3\"},\n            new object[] {\"data/equity/usa/map_files/COM4\"},\n            new object[] {\"data/equity/usa/map_files/COM5\"},\n            new object[] {\"data/equity/usa/map_files/COM6\"},\n            new object[] {\"data/equity/usa/map_files/COM7\"},\n            new object[] {\"data/equity/usa/map_files/COM8\"},\n            new object[] {\"data/equity/usa/map_files/COM9\"},\n            new object[] {\"data/equity/usa/map_files/LPT0\"},\n            new object[] {\"data/equity/usa/map_files/LPT1\"},\n            new object[] {\"data/equity/usa/map_files/LPT2\"},\n            new object[] {\"data/equity/usa/map_files/LPT3\"},\n            new object[] {\"data/equity/usa/map_files/LPT4\"},\n            new object[] {\"data/equity/usa/map_files/LPT5\"},\n            new object[] {\"data/equity/usa/map_files/LPT6\"},\n            new object[] {\"data/equity/usa/map_files/LPT7\"},\n            new object[] {\"data/equity/usa/map_files/LPT8\"},\n            new object[] {\"data/equity/usa/map_files/LPT9\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\COM9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT0.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT1.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT2.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT3.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT4.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT5.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT6.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT7.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT8.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\LPT9.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\AUX.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\NUL.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\PRN.csv\"},\n            new object[] {\"data\\\\equity\\\\usa\\\\map_files\\\\CON.csv\"},\n            new object[] {\"AUX.csv\"},\n            new object[] {\"NUL.csv\"},\n            new object[] {\"PRN.csv\"},\n            new object[] {\"CON.csv\"},\n            new object[] {\"COM0.csv\"},\n            new object[] {\"COM1.csv\"},\n            new object[] {\"COM2.csv\"},\n            new object[] {\"COM3.csv\"},\n            new object[] {\"COM4.csv\"},\n            new object[] {\"COM5.csv\"},\n            new object[] {\"COM6.csv\"},\n            new object[] {\"COM7.csv\"},\n            new object[] {\"COM8.csv\"},\n            new object[] {\"COM9.csv\"},\n            new object[] {\"LPT0.csv\"},\n            new object[] {\"LPT1.csv\"},\n            new object[] {\"LPT2.csv\"},\n            new object[] {\"LPT3.csv\"},\n            new object[] {\"LPT4.csv\"},\n            new object[] {\"LPT5.csv\"},\n            new object[] {\"LPT6.csv\"},\n            new object[] {\"LPT7.csv\"},\n            new object[] {\"LPT8.csv\"},\n            new object[] {\"LPT9.csv\"},\n            new object[] {\"AUX.tar.gz\"},\n            new object[] {\"NUL.tar.gz\"},\n            new object[] {\"PRN.tar.gz\"},\n            new object[] {\"CON.tar.gz\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\con\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\nul\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\prn\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\aux\\\\20150903_trade.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\con\\\\con.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\nul\\\\nul.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\prn\\\\prn.zip\"},\n            new object[] {\"equity\\\\usa\\\\minute\\\\aux\\\\aux.zip\"}\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/FuncTextWriterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class FuncTextWriterTests\n    {\n        [SetUp]\n        public void Setup()\n        {\n            // clear any existing output\n            #pragma warning disable CA2000\n            var standardOut = new StreamWriter(Console.OpenStandardError()) { AutoFlush = true };\n            #pragma warning restore CA2000\n            Console.SetError(standardOut);\n            Console.SetOut(standardOut);\n        }\n        \n        [Test]\n        public void RedirectsWriteAndWriteLine()\n        {\n            var messages = new List<string>();\n            Action<string> redirector = s => messages.Add(s);\n            using var writer = new FuncTextWriter(redirector);\n\n            writer.Write(\"message\");\n            Assert.AreEqual(1, messages.Count);\n            Assert.AreEqual(\"message\", messages[0]);\n\n            writer.WriteLine(\"message2\");\n            Assert.AreEqual(2, messages.Count);\n            Assert.AreEqual(\"message2\", messages[1]);\n        }\n\n        [Test]\n        public void RedirectsConsoleOutAndError()\n        {\n            var messages = new List<string>();\n            Action<string> redirector = s => messages.Add(s);\n            using var writer = new FuncTextWriter(redirector);\n\n            Console.SetOut(writer);\n            Console.SetError(writer);\n\n            Console.WriteLine(\"message\");\n            Assert.AreEqual(1, messages.Count);\n            Assert.AreEqual(\"message\", messages[0]);\n\n            Console.Error.WriteLine(\"message2\");\n            Assert.AreEqual(2, messages.Count);\n            Assert.AreEqual(\"message2\", messages[1]);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/HistoryExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Brokerages;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class HistoryExtensionsTests\n    {\n        [TestCase(\"GOOGL\", \"2010/01/01\", \"2014/02/04\", 1, \"GOOG\", Description = \"[GOOG: 2004/08/19 - 2014/04/02][GOOGL: 2014/04/03 - ...)\")]\n        [TestCase(\"GOOGL\", \"2004/08/19\", \"2014/04/02\", 1, \"GOOG\", Description = \"[GOOG: 2004/08/19 - 2014/04/02][GOOGL: 2014/04/03 - ...)\")]\n        [TestCase(\"GOOGL\", \"2000/01/01\", \"2002/02/04\", 1, \"GOOG\", Description = \"Before founded date [GOOG: 2004/08/19 - ...\")]\n        [TestCase(\"GOOGL\", \"2010/01/01\", \"2015/02/16\", 2, \"GOOG,GOOGL\")]\n        [TestCase(\"GOOGL\", \"2020/01/01\", \"2024/01/01\", 1, \"GOOGL\")]\n        [TestCase(\"GOOG\", \"2013/04/03\", \"2023/01/01\", 2, \"GOOCV,GOOG\")]\n        [TestCase(\"SPWR\", \"2007/11/17\", \"2023/01/01\", 3, \"SPWR,SPWRA,SPWR\", Description = \"[SPWR: 2005/11/17 - 2008/09/29][SPWRA: 2008/09/30 - 2011/11/16][SPWR: 2011/11/17 - ...)\")]\n        [TestCase(\"SPWR\", \"2005/11/17\", \"2011/11/16\", 2, \"SPWR,SPWRA\")]\n        [TestCase(\"SPWR\", \"2011/11/17\", \"2023/01/01\", 1, \"SPWR\")]\n        [TestCase(\"AAPL\", \"2008/02/01\", \"2024/03/01\", 1, \"AAPL\")]\n        [TestCase(\"NFLX\", \"2022/02/01\", \"2024/03/01\", 1, \"NFLX\", Description = \"The Symbol is not presented in map files\")]\n        public void GetSplitHistoricalRequestWithTheSameSymbolButDifferentTicker(string ticker, DateTime startDateTime, DateTime endDateTime, int expectedAmount, string expectedTickers)\n        {\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n            var historyRequest = TestsHelpers.GetHistoryRequest(symbol, startDateTime, endDateTime, Resolution.Daily, TickType.Trade);\n\n            var historyRequests = historyRequest.SplitHistoryRequestWithUpdatedMappedSymbol(TestGlobals.MapFileProvider).ToList();\n\n            Assert.IsNotNull(historyRequests);\n            Assert.IsNotEmpty(historyRequests);\n            Assert.That(historyRequests.Count, Is.EqualTo(expectedAmount));\n\n            if (expectedAmount >= 2)\n            {\n                var (firstHistoryRequest, secondHistoryRequest) = (historyRequests[0], historyRequests[1]);\n\n                Assert.IsTrue(firstHistoryRequest.Symbol.Value != secondHistoryRequest.Symbol.Value);\n\n                Assert.That(startDateTime, Is.EqualTo(firstHistoryRequest.StartTimeUtc));\n                Assert.That(startDateTime, Is.Not.EqualTo(secondHistoryRequest.StartTimeUtc));\n\n                Assert.That(firstHistoryRequest.EndTimeLocal, Is.EqualTo(secondHistoryRequest.StartTimeLocal));\n                Assert.That(firstHistoryRequest.EndTimeUtc, Is.EqualTo(secondHistoryRequest.StartTimeUtc));\n\n                Assert.That(endDateTime, Is.Not.EqualTo(firstHistoryRequest.EndTimeUtc));\n                Assert.That(endDateTime, Is.EqualTo(historyRequests[expectedAmount - 1].EndTimeUtc));\n\n                Assert.That(firstHistoryRequest.StartTimeUtc, Is.Not.EqualTo(secondHistoryRequest.StartTimeUtc));\n                Assert.That(firstHistoryRequest.EndTimeUtc, Is.Not.EqualTo(secondHistoryRequest.EndTimeUtc));\n                Assert.That(firstHistoryRequest.StartTimeLocal, Is.Not.EqualTo(secondHistoryRequest.StartTimeLocal));\n                Assert.That(firstHistoryRequest.EndTimeLocal, Is.Not.EqualTo(secondHistoryRequest.EndTimeLocal));\n            }\n\n            if (expectedTickers != null)\n            {\n                foreach (var (actualTicker, expectedTicker) in historyRequests.Zip(expectedTickers.Split(','), (t, et) => (t.Symbol.Value, et)))\n                {\n                    Assert.That(actualTicker, Is.EqualTo(expectedTicker));\n                }\n            }\n        }\n\n        [TestCase(Futures.Metals.Gold, 1)]\n        [TestCase(Futures.Indices.SP500EMini, 1)]\n        public void GetSplitHistoricalRequestFutureSymbol(string ticker, int expectedAmount)\n        {\n            var futureSymbol = Symbols.CreateFutureSymbol(ticker, new DateTime(2024, 3, 29));\n\n            var historyRequest = TestsHelpers.GetHistoryRequest(futureSymbol, new DateTime(2024, 3, 4), new DateTime(2024, 3, 5), Resolution.Daily, TickType.Trade);\n\n            var historyRequests = historyRequest.SplitHistoryRequestWithUpdatedMappedSymbol(TestGlobals.MapFileProvider).ToList();\n\n            Assert.IsNotNull(historyRequests);\n            Assert.IsNotEmpty(historyRequests);\n            Assert.That(historyRequests.Count, Is.EqualTo(expectedAmount));\n        }\n\n        [TestCase(\"GOOGL\", \"2010/01/01\", \"2014/02/04\")]\n        [TestCase(\"GOOGL\", \"2000/01/01\", \"2002/02/04\")]\n        [TestCase(\"GOOGL\", \"2010/01/01\", \"2015/02/16\")]\n        [TestCase(\"GOOGL\", \"2020/01/01\", \"2024/01/01\")]\n        [TestCase(\"GOOG\", \"2013/04/03\", \"2023/01/01\")]\n        [TestCase(\"SPWR\", \"2007/11/17\", \"2023/01/01\")]\n        [TestCase(\"SPWR\", \"2011/11/17\", \"2023/01/01\")]\n        [TestCase(\"AAPL\", \"2008/02/01\", \"2024/03/01\")]\n        [TestCase(\"NFLX\", \"2022/02/01\", \"2024/03/01\")]\n        [TestCase(\"SPWR\", \"2005/11/17\", \"2011/11/16\", Description = \"[SPWR: 2005/11/17 - 2008/09/29][SPWRA: 2008/09/30 - 2011/11/16][SPWR: 2011/11/17 - ...)\")]\n        [TestCase(\"SPWR\", \"2005/11/17\", \"2008/09/29\")]\n        [TestCase(\"SPWR\", \"2008/09/30\", \"2011/11/16\")]\n        [TestCase(\"SPWR\", \"2008/09/29\", \"2011/11/16\")]\n        [TestCase(\"SPWR\", \"2008/09/28\", \"2011/11/18\")]\n        [TestCase(\"SPWR\", \"2008/09/29\", \"2011/11/17\")]\n        [TestCase(\"SPWR\", \"2011/11/17\", \"2022/11/16\")]\n        public void GetSplitHistoricalRequestAndValidateEndDateInDifferentTimeZones(\n            string ticker,\n            DateTime userRequestedStartDateTime,\n            DateTime userRequestedEndDateTime\n            )\n        {\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n            foreach (var timeZone in TestsHelpers.GetTimeZones())\n            {\n                var historyRequest = TestsHelpers.GetHistoryRequest(symbol, userRequestedStartDateTime, userRequestedEndDateTime, Resolution.Daily, TickType.Trade, timeZone);\n\n                var historyRequests = historyRequest.SplitHistoryRequestWithUpdatedMappedSymbol(TestGlobals.MapFileProvider).ToList();\n\n                // Ensure that the user-requested end date time matches the end time of the last history request.\n                Assert.That(userRequestedEndDateTime, Is.EqualTo(historyRequests.Last().EndTimeUtc));\n                Assert.That(userRequestedEndDateTime.ConvertFromUtc(timeZone), Is.EqualTo(historyRequests.Last().EndTimeLocal));\n\n                Assert.That(userRequestedStartDateTime, Is.EqualTo(historyRequests.First().StartTimeUtc));\n                Assert.That(userRequestedStartDateTime.ConvertFromUtc(timeZone), Is.EqualTo(historyRequests.First().StartTimeLocal));\n\n                // Ensure that the end time of the previous history request matches the start time of the next one.\n                for (int i = 0; i < historyRequests.Count - 1; i++)\n                {\n                    Assert.That(historyRequests[i].EndTimeLocal, Is.EqualTo(historyRequests[i + 1].StartTimeLocal));\n                    Assert.That(historyRequests[i].EndTimeUtc, Is.EqualTo(historyRequests[i + 1].StartTimeUtc));\n                }\n            }\n        }\n\n        [TestCase(\"GOOGL\", \"2010/01/01\", \"2015/02/16\", \"2010/01/01-2014/04/03,2014/04/03-2015/02/16\", Description = \"[GOOG:2004/08/19 - 2014/04/02][GOOGL: 2014/04/03 - ...)\")]\n        [TestCase(\"GOOG\", \"2013/04/03\", \"2023/01/01\", \"2013/04/03-2014/04/03,2014/04/03-2023/01/01\")]\n        [TestCase(\"SPWR\", \"2007/11/17\", \"2023/01/01\", \"2007/11/17-2008/09/30,2008/09/30-2011/11/17,2011/11/17-2023/01/01\", Description = \"[SPWR: 2005/11/17 - 2008/09/29][SPWRA: 2008/09/30 - 2011/11/16][SPWR: 2011/11/17 - ...)\")]\n        [TestCase(\"SPWR\", \"2005/11/17\", \"2011/11/16\", \"2005/11/17-2008/09/30,2008/09/30-2011/11/16\")]\n        public void GetSplitHistoricalRequestReturnExpectedDateTimeRanges(\n            string ticker, DateTime startDateTime, DateTime endDateTime, string expectedDateTimeRanges)\n        {\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n\n            var dateRanges = expectedDateTimeRanges?.Split(',').Select(x => x.Split('-'))\n                .ToList(x => (startDateTime: DateTime.Parse(x[0],CultureInfo.InvariantCulture), endDateTime: DateTime.Parse(x[1],CultureInfo.InvariantCulture)));\n\n            foreach (var timeZone in TestsHelpers.GetTimeZones())\n            {\n                var historyRequest = TestsHelpers.GetHistoryRequest(symbol, startDateTime, endDateTime, Resolution.Daily, TickType.Trade, timeZone);\n\n                var historyRequests = historyRequest.SplitHistoryRequestWithUpdatedMappedSymbol(TestGlobals.MapFileProvider).ToList();\n\n                if (historyRequests.Count == 2)\n                {\n                    Assert.That(historyRequests[0].StartTimeUtc, Is.EqualTo(dateRanges[0].startDateTime));\n                    Assert.That(historyRequests[0].EndTimeUtc, Is.EqualTo(dateRanges[0].endDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[1].StartTimeUtc, Is.EqualTo(dateRanges[1].startDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[1].EndTimeUtc, Is.EqualTo(dateRanges[1].endDateTime)); \n                }\n\n                if (historyRequests.Count == 3)\n                {\n                    Assert.That(historyRequests[0].StartTimeUtc, Is.EqualTo(dateRanges[0].startDateTime));\n                    Assert.That(historyRequests[0].EndTimeUtc, Is.EqualTo(dateRanges[0].endDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[1].StartTimeUtc, Is.EqualTo(dateRanges[1].startDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[1].EndTimeUtc, Is.EqualTo(dateRanges[1].endDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[2].StartTimeUtc, Is.EqualTo(dateRanges[2].startDateTime.ConvertToUtc(timeZone)));\n                    Assert.That(historyRequests[2].EndTimeUtc, Is.EqualTo(dateRanges[2].endDateTime));\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/JsonRoundingConverterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Statistics;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class JsonRoundingConverterTests\n    {\n        [Test]\n        public void MinMaxValueDeserializesSuccessfuly()\n        {\n            var portfolioStatistics = new PortfolioStatistics\n            {\n                AverageWinRate = decimal.MaxValue,\n                AverageLossRate = decimal.MinValue,\n                CompoundingAnnualReturn = decimal.MaxValue\n            };\n\n            var serializedValue = JsonConvert.SerializeObject(portfolioStatistics);\n            var deserializedValue = JsonConvert.DeserializeObject<PortfolioStatistics>(serializedValue);\n\n            Assert.AreEqual(portfolioStatistics.AverageWinRate, deserializedValue.AverageWinRate);\n            Assert.AreEqual(portfolioStatistics.AverageLossRate, deserializedValue.AverageLossRate);\n            Assert.AreEqual(portfolioStatistics.CompoundingAnnualReturn, deserializedValue.CompoundingAnnualReturn);\n\n            Assert.AreEqual(portfolioStatistics.AnnualStandardDeviation, deserializedValue.AnnualStandardDeviation);\n            Assert.AreEqual(portfolioStatistics.Expectancy, deserializedValue.Expectancy);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/KeyStringSynchronizerTests.cs",
    "content": "\n/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Util;\nusing System.Threading.Tasks;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class KeyStringSynchronizerTests\n    {\n        [Test]\n        public void ReEntrancy()\n        {\n            var synchronizer = new KeyStringSynchronizer();\n\n            var counter = 0;\n            using var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(5));\n            var task = new Task(() =>\n            {\n                var key = \"someKey\";\n                synchronizer.Execute(key, singleExecution: true, () =>\n                {\n                    synchronizer.Execute(key, singleExecution: true, () =>\n                    {\n                        counter++;\n                    });\n                });\n                cancellationToken.Cancel();\n            });\n            task.Start();\n\n            cancellationToken.Token.WaitHandle.WaitOne();\n\n            Assert.AreEqual(1, counter);\n        }\n\n        [Test]\n        public void ExecuteOnce()\n        {\n            var synchronizer = new KeyStringSynchronizer();\n\n            var counter = 0;\n            var endedCount = 0;\n            var taskCount = 10;\n            using var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(5));\n            for (var i = 0; i < taskCount; i++)\n            {\n                var task = new Task(() =>\n                {\n                    synchronizer.Execute(new string(\"someKey\"), singleExecution: true, () =>\n                    {\n                        Thread.Sleep(4000);\n                        counter++;\n                    });\n\n                    if (Interlocked.Increment(ref endedCount) == taskCount)\n                    {\n                        // the end\n                        cancellationToken.Cancel();\n                    }\n                });\n                task.Start();\n            }\n\n            cancellationToken.Token.WaitHandle.WaitOne();\n\n            Assert.AreEqual(1, counter);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ExecuteMultipleTimes(bool shouldThorw)\n        {\n            var synchronizer = new KeyStringSynchronizer();\n\n            var counter = 0;\n            var endedCount = 0;\n            var taskCount = 10;\n            using var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(5));\n            for (var i = 0; i < taskCount; i++)\n            {\n                var task = new Task(() =>\n                {\n                    var exceptionCount = 0;\n                    for (var i = 0; i < 5; i++)\n                    {\n                        try\n                        {\n                            synchronizer.Execute(\"someKey\", singleExecution: false, () =>\n                            {\n                                counter++;\n                                if (shouldThorw)\n                                {\n                                    throw new Exception(\"This shouldn't matter\");\n                                }\n                            });\n                        }\n                        catch (Exception)\n                        {\n                            exceptionCount++;\n                        }\n                    }\n\n                    Assert.AreEqual(shouldThorw ? 5 : 0, exceptionCount);\n\n                    if (Interlocked.Increment(ref endedCount) == taskCount)\n                    {\n                        // the end\n                        cancellationToken.Cancel();\n                    }\n                });\n                task.Start();\n            }\n\n            cancellationToken.Token.WaitHandle.WaitOne();\n\n            Assert.AreEqual(50, counter);\n        }\n\n        [Test]\n        public void ExecuteFunc()\n        {\n            var synchronizer = new KeyStringSynchronizer();\n\n            var counter = 0;\n            var endedCount = 0;\n            var taskCount = 10;\n            using var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(5));\n            for (var i = 0; i < taskCount; i++)\n            {\n                var task = new Task(() =>\n                {\n                    var result = 0;\n                    for (int i = 0; i < 5; i++)\n                    {\n                        var newResult = synchronizer.Execute(\"someKey\", () =>\n                        {\n                            return ++counter;\n                        });\n\n                        Assert.Greater(newResult, result);\n                        result = newResult;\n                    }\n\n                    if (Interlocked.Increment(ref endedCount) == taskCount)\n                    {\n                        // the end\n                        cancellationToken.Cancel();\n                    }\n                });\n                task.Start();\n            }\n\n            cancellationToken.Token.WaitHandle.WaitOne();\n\n            Assert.AreEqual(50, counter);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/LeanDataPathComponentsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class LeanDataPathComponentsTests\n    {\n        public sealed class Arguments\n        {\n            public Symbol Symbol { get; set; }\n            public DateTime Date { get; set; }\n            public Resolution Resolution { get; set; }\n            public TickType TickType { get; set; }\n            public string Market { get; set; }\n\n            public Arguments(Symbol symbol, DateTime date, Resolution resolution, string market, TickType tickType)\n            {\n                Symbol = symbol;\n                Date = date;\n                Resolution = resolution;\n                TickType = tickType;\n                Market = market;\n                if (symbol.ID.SecurityType != SecurityType.Option && (resolution == Resolution.Hour || resolution == Resolution.Daily))\n                {\n                    // for the time being this is true, eventually I'm sure we'd like to support hourly/daily quote data in other security types\n                    TickType = TickType.Trade;\n                }\n            }\n        }\n\n        private static TestCaseData[] GetTestCases()\n        {\n            var referenceDate = new DateTime(2016, 11, 1);\n\n            var tickTypes = Enum.GetValues(typeof(TickType)).Cast<TickType>();\n            var resolutions = Enum.GetValues(typeof (Resolution)).Cast<Resolution>();\n            var securityTypes = Enum.GetValues(typeof (SecurityType)).Cast<SecurityType>();\n            var markets = typeof (Market).GetFields().Where(f => f.IsLiteral && !f.IsInitOnly)\n                .Select(f => (string) f.GetValue(null));\n\n            var results = (\n                from securityType in securityTypes\n                where securityType != SecurityType.Commodity\n                from market in markets\n                from resolution in resolutions\n                from tickType in tickTypes\n                let date = resolution == Resolution.Hour || resolution == Resolution.Daily ? DateTime.MinValue : referenceDate\n                let name = Invariant($\"{securityType}-{market}-{resolution}-{tickType}\").ToLowerInvariant()\n                where TryInvoke(() => Symbol.Create(name, securityType, market))\n                let symbol = securityType != SecurityType.Option\n                    ? Symbol.Create(name, securityType, market)\n                    : Symbol.CreateOption(name, market, OptionStyle.American, default, 0, SecurityIdentifier.DefaultDate)\n                select new TestCaseData(new Arguments(symbol, date, resolution, market, tickType))\n                                .SetName(name)\n                ).ToArray();\n\n            return results;\n        }\n\n        [Test, TestCaseSource(nameof(GetTestCases))]\n        public void DecomposesAccordingToLeanDataFileGeneration(Arguments args)\n        {\n            var sourceString = LeanData.GenerateRelativeZipFilePath(args.Symbol, args.Date, args.Resolution, args.TickType);\n            var decomposed = LeanDataPathComponents.Parse(sourceString);\n\n            var expectedFileName = LeanData.GenerateZipFileName(args.Symbol, args.Date, args.Resolution, args.TickType);\n\n            Assert.AreEqual(args.Symbol, decomposed.Symbol);\n            Assert.AreEqual(args.Date, decomposed.Date);\n            Assert.AreEqual(expectedFileName, decomposed.Filename);\n            Assert.AreEqual(args.Symbol.ID.SecurityType, decomposed.SecurityType);\n            Assert.AreEqual(args.Symbol.ID.Market, decomposed.Market);\n            Assert.AreEqual(args.TickType, decomposed.TickType);\n            Assert.AreEqual(args.Market, decomposed.Market);\n        }\n\n        private static bool TryInvoke(Action action)\n        {\n            try\n            {\n                action();\n                return true;\n            }\n            catch\n            {\n                return false;\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/LeanDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing Bitcoin = QuantConnect.Algorithm.CSharp.LiveTradingFeaturesAlgorithm.Bitcoin;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class LeanDataTests\n    {\n        private static DateTime _aggregationTime = new DateTime(2020, 1, 5, 12, 0, 0);\n\n        [SetUp]\n        public void SetUp()\n        {\n            SymbolCache.Clear();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            SymbolCache.Clear();\n        }\n\n        [TestCase(\"0.00:04:00\", \"0.09:30:00\", \"20251013 09:29:01\", \"20251013 09:26:00\")]\n        [TestCase(\"0.00:04:00\", \"0.09:30:00\", \"20251013 09:30:01\", \"20251013 09:30:00\")]\n        [TestCase(\"0.00:04:00\", \"0.09:30:00\", \"20251013 09:35:00\", \"20251013 09:34:00\")]\n        [TestCase(\"0.00:05:00\", \"0.09:00:00\", \"20251013 09:35:00\", \"20251013 09:35:00\")]\n\n        [TestCase(\"0.02:00:00\", \"0.09:30:00\", \"20251013 11:30:01\", \"20251013 11:30:00\")]\n        [TestCase(\"0.02:00:00\", \"0.09:30:00\", \"20251013 09:30:01\", \"20251013 09:30:00\")]\n        [TestCase(\"0.02:00:00\", \"0.09:30:00\", \"20251013 08:30:01\", \"20251013 07:30:00\")]\n\n        [TestCase(\"10.00:00:00\", \"0.00:00:00\", \"20251013 11:30:01\", \"20251011 00:00:00\")]\n        [TestCase(\"10.00:00:00\", \"0.00:00:00\", \"20251007 11:30:01\", \"20251001 00:00:00\")]\n        public void ConsolidatorStarTime(string periodStr, string startTimeStr, string timeStr, string expected)\n        {\n            var result = LeanData.GetConsolidatorStartTime(\n                TimeSpan.ParseExact(periodStr, \"d\\\\.hh\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture),\n                TimeSpan.ParseExact(startTimeStr, \"d\\\\.hh\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture),\n                DateTime.ParseExact(timeStr, \"yyyyMMdd HH\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture));\n\n            Assert.AreEqual(DateTime.ParseExact(expected, \"yyyyMMdd HH\\\\:mm\\\\:ss\", CultureInfo.InvariantCulture), result);\n        }\n\n        [TestCase(16, false, \"20240506 09:30\", \"06:30\", false)]\n        [TestCase(10, false, \"20240506 09:30\", \"06:30\", false)]\n        [TestCase(10, true, \"20240506 04:00\", \"16:00\", false)]\n        [TestCase(5, true, \"20240506 04:00\", \"16:00\", false)]\n        [TestCase(19, true, \"20240506 04:00\", \"16:00\", false)]\n\n        [TestCase(16, false, \"20240506 09:15\", \"07:15\", true)]\n        [TestCase(10, false, \"20240506 09:15\", \"07:15\", true)]\n        [TestCase(10, true, \"20240506 08:45\", \"15:15\", true)]\n        [TestCase(9, true, \"20240506 08:45\", \"15:15\", true)]\n        [TestCase(19, true, \"20240506 08:45\", \"15:15\", true)]\n        public void DailyCalendarInfo(int hours, bool extendedMarketHours, string startTime, string timeSpan, bool multipleMarketClosureSymbol)\n        {\n            Symbol symbol;\n            if (multipleMarketClosureSymbol)\n            {\n                symbol = Symbols.CreateFutureSymbol(\"HSI\", new DateTime(2025, 01, 27));\n            }\n            else\n            {\n                symbol = Symbols.SPY;\n            }\n            var targetTime = new DateTime(2024, 5, 6).AddHours(hours);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n            var result = LeanData.GetDailyCalendar(targetTime, exchangeHours, extendedMarketHours);\n\n            var expected = new CalendarInfo(DateTime.ParseExact(startTime, DateFormat.TwelveCharacter, CultureInfo.InvariantCulture),\n                TimeSpan.Parse(timeSpan, CultureInfo.InvariantCulture));\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(true, \"20131219 00:00\", \"1.00:00\")]\n        [TestCase(false, \"20131219 09:30\", \"07:30\")]\n        public void DailyCalendarInfoFuture(bool extendedMarketHours, string startTime, string timeSpan)\n        {\n            var symbol = Symbols.Future_ESZ18_Dec2018;\n            var targetTime = new DateTime(2013, 12, 19, 18, 0, 0);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n            var result = LeanData.GetDailyCalendar(targetTime, exchangeHours, extendedMarketHours);\n\n            var expected = new CalendarInfo(DateTime.ParseExact(startTime, DateFormat.TwelveCharacter, CultureInfo.InvariantCulture),\n                TimeSpan.Parse(timeSpan, CultureInfo.InvariantCulture));\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(1, \"20240506 16:00\", false)] // market closed\n        [TestCase(5, \"20240506 16:00\", false)] // pre market\n        [TestCase(10, \"20240506 16:00\", false)] // market hours\n        [TestCase(16, \"20240507 16:00\", false)] // at the close\n        [TestCase(18, \"20240507 16:00\", false)] // post market hours\n        [TestCase(20, \"20240507 16:00\", false)] // market closed\n\n        [TestCase(1, \"20240506 16:30\", true)] // market closed\n        [TestCase(9, \"20240506 16:30\", true)] // pre market\n        [TestCase(10, \"20240506 16:30\", true)] // market hours\n        [TestCase(12, \"20240506 16:30\", true)] // pre market\n        [TestCase(14, \"20240506 16:30\", true)] // market hours\n        [TestCase(18, \"20240507 16:30\", true)] // post market hours\n        [TestCase(20, \"20240507 16:30\", true)] // post market hours\n        public void GetNextDailyEndTime(int hours, string expectedTime, bool multipleMarketClosureSymbol)\n        {\n            Symbol symbol;\n            if (multipleMarketClosureSymbol)\n            {\n                symbol = Symbols.CreateFutureSymbol(\"HSI\", new DateTime(2025, 01, 27));\n            }\n            else\n            {\n                symbol = Symbols.SPY;\n            }\n            var targetTime = new DateTime(2024, 5, 6).AddHours(hours);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.ID.SecurityType);\n            var result = LeanData.GetNextDailyEndTime(symbol, targetTime, exchangeHours);\n\n            var expected = DateTime.ParseExact(expectedTime, DateFormat.TwelveCharacter, CultureInfo.InvariantCulture);\n\n            Assert.AreEqual(expected, result);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataTestParameters))]\n        public void GenerateZipFileName(LeanDataTestParameters parameters)\n        {\n            var zip = LeanData.GenerateZipFileName(parameters.Symbol, parameters.Date, parameters.Resolution, parameters.TickType);\n            Assert.AreEqual(parameters.ExpectedZipFileName, zip);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataTestParameters))]\n        public void GenerateZipEntryName(LeanDataTestParameters parameters)\n        {\n            var entry = LeanData.GenerateZipEntryName(parameters.Symbol, parameters.Date, parameters.Resolution, parameters.TickType);\n            Assert.AreEqual(parameters.ExpectedZipEntryName, entry);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataTestParameters))]\n        public void GenerateRelativeZipFilePath(LeanDataTestParameters parameters)\n        {\n            var relativePath = LeanData.GenerateRelativeZipFilePath(parameters.Symbol, parameters.Date, parameters.Resolution, parameters.TickType);\n            Assert.AreEqual(parameters.ExpectedRelativeZipFilePath, relativePath);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataTestParameters))]\n        public void GenerateZipFilePath(LeanDataTestParameters parameters)\n        {\n            var path = LeanData.GenerateZipFilePath(Globals.DataFolder, parameters.Symbol, parameters.Date, parameters.Resolution, parameters.TickType);\n            Assert.AreEqual(parameters.ExpectedZipFilePath, path);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataLineTestParameters))]\n        public void GenerateLine(LeanDataLineTestParameters parameters)\n        {\n            var line = LeanData.GenerateLine(parameters.Data, parameters.SecurityType, parameters.Resolution);\n            Assert.AreEqual(parameters.ExpectedLine, line);\n\n            if (parameters.Config.Type == typeof(QuoteBar))\n            {\n                Assert.AreEqual(line.Split(',').Length, 11);\n            }\n\n            if (parameters.Config.Type == typeof(TradeBar))\n            {\n                Assert.AreEqual(line.Split(',').Length, 6);\n            }\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataLineTestParameters))]\n        public void ParsesGeneratedLines(LeanDataLineTestParameters parameters)\n        {\n            // ignore time zone issues here, we'll just say everything is UTC, so no conversions are performed\n            var factory = (BaseData) Activator.CreateInstance(parameters.Data.GetType());\n            var parsed = factory.Reader(parameters.Config, parameters.ExpectedLine, parameters.Data.Time.Date, false);\n\n            Assert.IsInstanceOf(parameters.Config.Type, parsed);\n            Assert.AreEqual(parameters.Data.Time, parsed.Time);\n            Assert.AreEqual(parameters.Data.EndTime, parsed.EndTime);\n            Assert.AreEqual(parameters.Data.Symbol, parsed.Symbol);\n            Assert.AreEqual(parameters.Data.Value, parsed.Value);\n            if (parsed is Tick)\n            {\n                var expected = (Tick) parameters.Data;\n                var actual = (Tick) parsed;\n                Assert.AreEqual(expected.Quantity, actual.Quantity);\n                Assert.AreEqual(expected.BidPrice, actual.BidPrice);\n                Assert.AreEqual(expected.AskPrice, actual.AskPrice);\n                Assert.AreEqual(expected.BidSize, actual.BidSize);\n                Assert.AreEqual(expected.AskSize, actual.AskSize);\n                Assert.AreEqual(expected.Exchange, actual.Exchange);\n                Assert.AreEqual(expected.SaleCondition, actual.SaleCondition);\n                Assert.AreEqual(expected.Suspicious, actual.Suspicious);\n            }\n            else if (parsed is TradeBar)\n            {\n                var expected = (TradeBar) parameters.Data;\n                var actual = (TradeBar) parsed;\n                AssertBarsAreEqual(expected, actual);\n                Assert.AreEqual(expected.Volume, actual.Volume);\n            }\n            else if (parsed is QuoteBar)\n            {\n                var expected = (QuoteBar) parameters.Data;\n                var actual = (QuoteBar) parsed;\n                AssertBarsAreEqual(expected.Bid, actual.Bid);\n                AssertBarsAreEqual(expected.Ask, actual.Ask);\n                Assert.AreEqual(expected.LastBidSize, actual.LastBidSize);\n                Assert.AreEqual(expected.LastAskSize, actual.LastAskSize);\n            }\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataLineTestParameters))]\n        public void GetSourceMatchesGenerateZipFilePath(LeanDataLineTestParameters parameters)\n        {\n            var source = parameters.Data.GetSource(parameters.Config, parameters.Data.Time.Date, false);\n            var normalizedSourcePath = new FileInfo(source.Source).FullName;\n            var zipFilePath = LeanData.GenerateZipFilePath(Globals.DataFolder, parameters.Data.Symbol, parameters.Data.Time.Date, parameters.Resolution, parameters.TickType);\n            var normalizeZipFilePath = new FileInfo(zipFilePath).FullName;\n            var indexOfHash = normalizedSourcePath.LastIndexOf(\"#\", StringComparison.Ordinal);\n            if (indexOfHash > 0)\n            {\n                normalizedSourcePath = normalizedSourcePath.Substring(0, indexOfHash);\n            }\n            Assert.AreEqual(normalizeZipFilePath, normalizedSourcePath);\n        }\n\n        [Test, TestCaseSource(nameof(GetLeanDataTestParameters))]\n        public void GetSource(LeanDataTestParameters parameters)\n        {\n            var factory = (BaseData)Activator.CreateInstance(parameters.BaseDataType);\n            var source = factory.GetSource(parameters.Config, parameters.Date, false);\n            var expected = parameters.ExpectedZipFilePath;\n            if (parameters.SecurityType is SecurityType.Option or SecurityType.Future or SecurityType.FutureOption)\n            {\n                expected += \"#\" + parameters.ExpectedZipEntryName;\n            }\n            Assert.AreEqual(expected, source.Source);\n        }\n\n        [Test]\n        public void GetDataType_ReturnsCorrectType()\n        {\n            var tickType = typeof(Tick);\n            var openInterestType = typeof(OpenInterest);\n            var quoteBarType = typeof(QuoteBar);\n            var tradeBarType = typeof(TradeBar);\n\n            Assert.AreEqual(LeanData.GetDataType(Resolution.Tick, TickType.OpenInterest), tickType);\n            Assert.AreNotEqual(LeanData.GetDataType(Resolution.Daily, TickType.OpenInterest), tickType);\n\n            Assert.AreEqual(LeanData.GetDataType(Resolution.Second, TickType.OpenInterest), openInterestType);\n            Assert.AreNotEqual(LeanData.GetDataType(Resolution.Tick, TickType.OpenInterest), openInterestType);\n\n            Assert.AreEqual(LeanData.GetDataType(Resolution.Minute, TickType.Quote), quoteBarType);\n            Assert.AreNotEqual(LeanData.GetDataType(Resolution.Second, TickType.Trade), quoteBarType);\n\n            Assert.AreEqual(LeanData.GetDataType(Resolution.Hour, TickType.Trade), tradeBarType);\n            Assert.AreNotEqual(LeanData.GetDataType(Resolution.Tick, TickType.OpenInterest), tradeBarType);\n        }\n\n        [Test]\n        public void LeanData_CanDetermineTheCorrectCommonDataTypes()\n        {\n            Assert.IsTrue(LeanData.IsCommonLeanDataType(typeof(OpenInterest)));\n            Assert.IsTrue(LeanData.IsCommonLeanDataType(typeof(TradeBar)));\n            Assert.IsTrue(LeanData.IsCommonLeanDataType(typeof(QuoteBar)));\n            Assert.IsTrue(LeanData.IsCommonLeanDataType(typeof(Tick)));\n            Assert.IsFalse(LeanData.IsCommonLeanDataType(typeof(Bitcoin)));\n        }\n\n        [Test]\n        public void LeanData_GetCommonTickTypeForCommonDataTypes_ReturnsCorrectDataForTickResolution()\n        {\n            Assert.AreEqual(LeanData.GetCommonTickTypeForCommonDataTypes(typeof(Tick), SecurityType.Cfd), TickType.Quote);\n            Assert.AreEqual(LeanData.GetCommonTickTypeForCommonDataTypes(typeof(Tick), SecurityType.Forex), TickType.Quote);\n        }\n\n        [TestCase(\"forex/fxcm/eurusd/20160101_quote.zip\", true, SecurityType.Forex, Market.FXCM)]\n        [TestCase(\"Data/f/fxcm/eurusd/20160101_quote.zip\", false, SecurityType.Base, \"\")]\n        [TestCase(\"ooooooooooooooooooooooooooooooooooooooooooooooooooooooo\", false, SecurityType.Base, \"\")]\n        [TestCase(\"\", false, SecurityType.Base, \"\")]\n        [TestCase(null, false, SecurityType.Base, \"\")]\n\n        [TestCase(\"Data/option/u sa/minute/aapl/20140606_trade_american.zip\", true, SecurityType.Option, \"\")]\n        [TestCase(\"../Data/equity/usa/daily/aapl.zip\", true, SecurityType.Equity, \"usa\")]\n        [TestCase(\"Data/cfd/oanda/minute/bcousd/20160101_trade.zip\", true, SecurityType.Cfd, \"oanda\")]\n        [TestCase(\"Data\\\\alternative\\\\estimize\\\\consensus\\\\aapl.csv\", true, SecurityType.Base, \"\")]\n        [TestCase(\"../../../Data/option/usa/minute/spy/20200922_quote_american.zip\", true, SecurityType.Option, \"usa\")]\n        [TestCase(\"../../../Data/futureoption/comex/minute/og/20200428/20200105_quote_american.zip\", true, SecurityType.FutureOption, \"comex\")]\n        public void TryParseSecurityType(string path, bool result, SecurityType expectedSecurityType, string market)\n        {\n            Assert.AreEqual(result, LeanData.TryParseSecurityType(path, out var securityType, out var parsedMarket));\n            Assert.AreEqual(expectedSecurityType, securityType);\n            Assert.AreEqual(market, parsedMarket);\n        }\n\n        [TestCase(\"Data/equity/usa/universes/etf/spy/20200102.csv\", SecurityType.Base, Market.USA, Resolution.Daily, \"SPY.ETFConstituentUniverse\", \"2020/1/2\", true)]\n        [TestCase(\"Data/equity/usa/universes/daily/qctest/20131007.csv\", SecurityType.Base, Market.USA, Resolution.Daily, \"qctest\", \"2013/10/07\", false)]\n        [TestCase(\"Data/option/usa/universes/aapl/20241112.csv\", SecurityType.Option, Market.USA, Resolution.Daily, \"AAPL\", \"2024/11/12\", false)]\n        [TestCase(\"Data/indexoption/usa/universes/spx/20250110.csv\", SecurityType.IndexOption, Market.USA, Resolution.Daily, \"SPX\", \"2025/1/10\", false)]\n        [TestCase(\"Data/future/cme/universes/es/20111230.csv\", SecurityType.Future, Market.CME, Resolution.Daily, \"ES\", \"2011/12/30\", false)]\n        [TestCase(\"Data/futureoption/cme/universes/es/202003/20111230.csv\", SecurityType.FutureOption, Market.CME, Resolution.Daily, \"ES\", \"2011/12/30\", false)]\n        public void UniversesDataPath(string path, SecurityType expectedSecurityType, string expectedMarket, Resolution expectedResolution, string expectedIDSymbol, DateTime expectedDate, bool isCustomDataType)\n        {\n            Assert.IsTrue(LeanData.TryParsePath(path, out var symbol, out var date, out var resolution));\n\n            Assert.AreEqual(expectedSecurityType, symbol.SecurityType);\n            Assert.AreEqual(expectedMarket, symbol.ID.Market);\n            Assert.AreEqual(expectedResolution, resolution);\n            Assert.AreEqual(expectedIDSymbol, symbol.ID.Symbol);\n            Assert.AreEqual(expectedDate, date);\n\n            var hasCustomDataType = SecurityIdentifier.TryGetCustomDataType(symbol.ID.Symbol, out var dataType);\n            if (isCustomDataType)\n            {\n                Assert.IsTrue(hasCustomDataType);\n                Assert.AreEqual(typeof(ETFConstituentUniverse).Name, dataType);\n            }\n            else\n            {\n                Assert.IsFalse(hasCustomDataType);\n            }\n        }\n\n        [Test]\n        public void IncorrectPaths_CannotBeParsed()\n        {\n            DateTime date;\n            Symbol symbol;\n            Resolution resolution;\n\n            var invalidPath = \"forex/fxcm/eurusd/20160101_quote.zip\";\n            Assert.IsFalse(LeanData.TryParsePath(invalidPath, out symbol, out date, out resolution));\n\n            var nonExistantPath = \"Data/f/fxcm/eurusd/20160101_quote.zip\";\n            Assert.IsFalse(LeanData.TryParsePath(nonExistantPath, out symbol, out date, out resolution));\n\n            var notAPath = \"ooooooooooooooooooooooooooooooooooooooooooooooooooooooo\";\n            Assert.IsFalse(LeanData.TryParsePath(notAPath, out symbol, out date, out resolution));\n\n            var  emptyPath = \"\";\n            Assert.IsFalse(LeanData.TryParsePath(emptyPath, out symbol, out date, out resolution));\n\n            string nullPath = null;\n            Assert.IsFalse(LeanData.TryParsePath(nullPath, out symbol, out date, out resolution));\n\n            var optionsTradePath = \"Data/option/u sa/minute/aapl/20140606_trade_american.zip\";\n            Assert.IsFalse(LeanData.TryParsePath(optionsTradePath, out symbol, out date, out resolution));\n        }\n\n        [Test]\n        public void CorrectPaths_CanBeParsedCorrectly()\n        {\n            DateTime date;\n            Symbol symbol;\n            Resolution resolution;\n\n            var customPath = \"a/very/custom/path/forex/oanda/tick/eurusd/20170104_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(customPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Forex);\n            Assert.AreEqual(symbol.ID.Market, Market.Oanda);\n            Assert.AreEqual(resolution, Resolution.Tick);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"eurusd\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2017-01-04\").Date);\n\n            var mixedPathSeperators = @\"Data//forex/fxcm\\/minute//eurusd\\\\20160101_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(mixedPathSeperators, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Forex);\n            Assert.AreEqual(symbol.ID.Market, Market.FXCM);\n            Assert.AreEqual(resolution, Resolution.Minute);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"eurusd\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2016-01-01\").Date);\n\n            var longRelativePath = \"../../../../../../../../../Data/forex/fxcm/hour/gbpusd.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(longRelativePath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Forex);\n            Assert.AreEqual(symbol.ID.Market, Market.FXCM);\n            Assert.AreEqual(resolution, Resolution.Hour);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"gbpusd\");\n            Assert.AreEqual(date.Date, DateTime.MinValue);\n\n            var shortRelativePath = \"Data/forex/fxcm/minute/eurusd/20160102_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(shortRelativePath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Forex);\n            Assert.AreEqual(symbol.ID.Market, Market.FXCM);\n            Assert.AreEqual(resolution, Resolution.Minute);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"eurusd\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2016-01-02\").Date);\n\n            var dailyEquitiesPath = \"Data/equity/usa/daily/aapl.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(dailyEquitiesPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Equity);\n            Assert.AreEqual(symbol.ID.Market, Market.USA);\n            Assert.AreEqual(resolution, Resolution.Daily);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"aapl\");\n            Assert.AreEqual(date.Date, DateTime.MinValue);\n\n            var minuteEquitiesPath = \"Data/equity/usa/minute/googl/20070103_trade.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(minuteEquitiesPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Equity);\n            Assert.AreEqual(symbol.ID.Market, Market.USA);\n            Assert.AreEqual(resolution, Resolution.Minute);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"goog\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2007-01-03\").Date);\n\n            var cfdPath = \"Data/cfd/oanda/minute/bcousd/20160101_trade.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(cfdPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Cfd);\n            Assert.AreEqual(symbol.ID.Market, Market.Oanda);\n            Assert.AreEqual(resolution, Resolution.Minute);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"bcousd\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2016-01-01\").Date);\n        }\n\n        [TestCase(\"Data\\\\indexoption\\\\usa\\\\minute\\\\spx\\\\20210104_quote_european.zip\", \"SPX\", \"SPX\")]\n        [TestCase(\"Data\\\\indexoption\\\\usa\\\\minute\\\\spxw\\\\20210104_quote_european.zip\", \"SPXW\", \"SPX\")]\n        [TestCase(\"Data\\\\futureoption\\\\comex\\\\minute\\\\og\\\\20210428\\\\20210104_quote_american.zip\", \"OG\", \"GC\")]\n        public void MappedTickersCorreclty(string path, string expectedSymbol, string expectedUnderlying)\n        {\n            Assert.IsTrue(LeanData.TryParsePath(path, out var symbol, out var date, out var resolution));\n\n            Assert.AreEqual(Resolution.Minute, resolution);\n            Assert.AreEqual(expectedSymbol, symbol.ID.Symbol);\n            Assert.AreEqual(expectedUnderlying, symbol.ID.Underlying.Symbol);\n            Assert.AreEqual(new DateTime(2021, 01, 04), date);\n        }\n\n        [TestCase(\"Data\\\\indexoption\\\\usa\\\\hour\\\\spx_2021_quote_european\", \"SPX\", SecurityType.IndexOption, Resolution.Hour, 2021)]\n        [TestCase(\"Data\\\\indexoption\\\\usa\\\\daily\\\\spx_2014_quote_european\", \"SPX\", SecurityType.IndexOption, Resolution.Daily, 2014)]\n        [TestCase(\"Data\\\\option\\\\usa\\\\hour\\\\aapl_2021_quote_american.zip\", \"AAPL\", SecurityType.Option, Resolution.Hour, 2021)]\n        [TestCase(\"Data\\\\option\\\\usa\\\\daily\\\\aapl_2014_quote_american.zip\", \"AAPL\", SecurityType.Option, Resolution.Daily, 2014)]\n        public void ParsesHourAndDailyOptionsPathCorrectly(string path, string expectedSymbol, SecurityType expectedSecurityType,\n            Resolution expectedResolution, int expectedYear)\n        {\n            Assert.IsTrue(LeanData.TryParsePath(path, out var symbol, out var date, out var resolution));\n\n            Assert.AreEqual(expectedSecurityType, symbol.SecurityType);\n            Assert.AreEqual(expectedResolution, resolution);\n            Assert.AreEqual(expectedSymbol, symbol.ID.Symbol);\n            Assert.AreEqual(new DateTime(expectedYear, 01, 01), date);\n        }\n\n        [TestCase(\"Data\\\\alternative\\\\estimize\\\\consensus\\\\aapl.csv\", \"aapl\", null)]\n        [TestCase(\"Data\\\\alternative\\\\psychsignal\\\\aapl\\\\20161007.zip\", \"aapl\", \"2016-10-07\")]\n        [TestCase(\"Data\\\\alternative\\\\sec\\\\aapl\\\\20161007_8K.zip\", \"aapl\", \"2016-10-07\")]\n        [TestCase(\"Data\\\\alternative\\\\smartinsider\\\\intentions\\\\aapl.tsv\", \"aapl\", null)]\n        [TestCase(\"Data\\\\alternative\\\\trading-economics\\\\calendar\\\\fdtr\\\\20161007.zip\", \"fdtr\", \"2016-10-07\")]\n        [TestCase(\"Data\\\\alternative\\\\ustreasury\\\\yieldcurverates.zip\", \"yieldcurverates\", null)]\n        public void AlternativePaths_CanBeParsedCorrectly(string path, string expectedSymbol, string expectedDate)\n        {\n            DateTime date;\n            Symbol symbol;\n            Resolution resolution;\n\n            Assert.IsTrue(LeanData.TryParsePath(path, out symbol, out date, out resolution));\n            Assert.AreEqual(SecurityType.Base, symbol.SecurityType);\n            Assert.AreEqual(Market.USA, symbol.ID.Market);\n            Assert.AreEqual(Resolution.Daily, resolution);\n            Assert.AreEqual(expectedSymbol, symbol.ID.Symbol.ToLowerInvariant());\n            Assert.AreEqual(expectedDate == null ? default(DateTime) : Parse.DateTime(expectedDate).Date, date);\n        }\n\n        [Test]\n        public void CryptoPaths_CanBeParsedCorrectly()\n        {\n            DateTime date;\n            Symbol symbol;\n            Resolution resolution;\n\n            var cryptoPath = \"Data\\\\crypto\\\\coinbase\\\\daily\\\\btcusd_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(cryptoPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Crypto);\n            Assert.AreEqual(symbol.ID.Market, Market.Coinbase);\n            Assert.AreEqual(resolution, Resolution.Daily);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"btcusd\");\n\n            cryptoPath = \"Data\\\\crypto\\\\coinbase\\\\hour\\\\btcusd_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(cryptoPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Crypto);\n            Assert.AreEqual(symbol.ID.Market, Market.Coinbase);\n            Assert.AreEqual(resolution, Resolution.Hour);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"btcusd\");\n\n            cryptoPath = \"Data\\\\crypto\\\\coinbase\\\\minute\\\\btcusd\\\\20161007_quote.zip\";\n            Assert.IsTrue(LeanData.TryParsePath(cryptoPath, out symbol, out date, out resolution));\n            Assert.AreEqual(symbol.SecurityType, SecurityType.Crypto);\n            Assert.AreEqual(symbol.ID.Market, Market.Coinbase);\n            Assert.AreEqual(resolution, Resolution.Minute);\n            Assert.AreEqual(symbol.ID.Symbol.ToLowerInvariant(), \"btcusd\");\n            Assert.AreEqual(date.Date, Parse.DateTime(\"2016-10-07\").Date);\n        }\n\n        [TestCase(\"equity/usa/minute/goog/20130102_quote.zip\", \"GOOG\", null, \"2004/08/19\")]\n        [TestCase(\"equity/usa/minute/goog/20100102_quote.zip\", \"GOOG\", null, \"2004/08/19\")]\n        [TestCase(\"equity/usa/minute/goog/20150102_quote.zip\", \"GOOG\", \"GOOCV\", \"2014/03/27\")]\n        [TestCase(\"equity/usa/minute/spwr/20071223_trade.zip\", \"SPWR\", null, \"2005/11/17\")]\n        [TestCase(\"equity/usa/minute/spwra/20101223_trade.zip\", \"SPWRA\", \"SPWR\", \"2005/11/17\")]\n        [TestCase(\"equity/usa/minute/spwr/20141223_trade.zip\", \"SPWR\", \"SPWR\", \"2005/11/17\")]\n        [TestCase(\"option/usa/minute/goog/20151223_openinterest_american.zip\", \"GOOG\", \"GOOCV\", \"2014/03/27\")]\n        public void TryParseMapsShouldReturnCorrectSymbol(string path, string expectedTicker, string expectedUnderlyingTicker, DateTime expectedDate)\n        {\n            Assert.IsTrue(LeanData.TryParsePath(path, out var parsedSymbol, out _, out _));\n\n            var symbol = parsedSymbol.HasUnderlying ? parsedSymbol.Underlying : parsedSymbol;\n            Assert.That(symbol.Value, Is.EqualTo(expectedTicker));\n            Assert.That(symbol.ID.Date, Is.EqualTo(expectedDate));\n            Assert.That(symbol.ID.Symbol, Is.EqualTo(expectedUnderlyingTicker ?? expectedTicker));\n        }\n\n        [TestCase(SecurityType.Base, \"alteRNative\")]\n        [TestCase(SecurityType.Equity, \"Equity\")]\n        [TestCase(SecurityType.Cfd, \"Cfd\")]\n        [TestCase(SecurityType.Commodity, \"Commodity\")]\n        [TestCase(SecurityType.Crypto, \"Crypto\")]\n        [TestCase(SecurityType.Forex, \"Forex\")]\n        [TestCase(SecurityType.Future, \"Future\")]\n        [TestCase(SecurityType.Option, \"Option\")]\n        [TestCase(SecurityType.FutureOption, \"FutureOption\")]\n        public void ParsesDataSecurityType(SecurityType type, string path)\n        {\n            Assert.AreEqual(type, LeanData.ParseDataSecurityType(path));\n        }\n\n        [Test]\n        public void SecurityTypeAsDataPath()\n        {\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"alternative\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"equity\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"base\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"option\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"cfd\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"crypto\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"future\"));\n            Assert.IsTrue(LeanData.SecurityTypeAsDataPath.Contains(\"forex\"));\n        }\n\n        [Test]\n        public void OptionZipFilePathWithUnderlyingEquity()\n        {\n            var underlying = Symbol.Create(\"SPY\", SecurityType.Equity, QuantConnect.Market.USA);\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                new DateTime(2020, 12, 31));\n\n            var optionZipFilePath = LeanData.GenerateZipFilePath(Globals.DataFolder, optionSymbol, new DateTime(2020, 9, 22), Resolution.Minute, TickType.Quote)\n                .Replace(Path.DirectorySeparatorChar, '/');\n            var optionEntryFilePath = LeanData.GenerateZipEntryName(optionSymbol, new DateTime(2020, 9, 22), Resolution.Minute, TickType.Quote);\n\n            Assert.AreEqual(\"../../../Data/option/usa/minute/spy/20200922_quote_american.zip\", optionZipFilePath);\n            Assert.AreEqual(\"20200922_spy_minute_quote_american_put_42000000_20201231.csv\", optionEntryFilePath);\n        }\n\n        [TestCase(\"ES\", \"ES\")]\n        [TestCase(\"DC\", \"DC\")]\n        [TestCase(\"GC\", \"OG\")]\n        [TestCase(\"ZT\", \"OZT\")]\n        public void OptionZipFilePathWithUnderlyingFuture(string futureOptionTicker, string expectedFutureOptionTicker)\n        {\n            var underlying = Symbol.CreateFuture(futureOptionTicker, Market.CME, new DateTime(2021, 3, 19));\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                Market.CME,\n                OptionStyle.American,\n                OptionRight.Put,\n                4200m,\n                new DateTime(2021, 3, 18));\n\n            var optionZipFilePath = LeanData.GenerateZipFilePath(Globals.DataFolder, optionSymbol, new DateTime(2020, 9, 22), Resolution.Minute, TickType.Quote)\n                .Replace(Path.DirectorySeparatorChar, '/');\n            var optionEntryFilePath = LeanData.GenerateZipEntryName(optionSymbol, new DateTime(2020, 9, 22), Resolution.Minute, TickType.Quote);\n\n            Assert.AreEqual($\"../../../Data/futureoption/cme/minute/{expectedFutureOptionTicker.ToLowerInvariant()}/{underlying.ID.Date:yyyyMM}/20200922_quote_american.zip\", optionZipFilePath);\n            Assert.AreEqual($\"20200922_{expectedFutureOptionTicker.ToLowerInvariant()}_minute_quote_american_put_42000000_{optionSymbol.ID.Date:yyyyMMdd}.csv\", optionEntryFilePath);\n        }\n\n        [TestCase(OptionRight.Call, 1650, 2020, 3, 26)]\n        [TestCase(OptionRight.Call, 1540, 2020, 3, 26)]\n        [TestCase(OptionRight.Call, 1600, 2020, 2, 25)]\n        [TestCase(OptionRight.Call, 1545, 2020, 2, 25)]\n        public void FutureOptionSingleZipFileContainingMultipleFuturesOptionsContracts(OptionRight right, int strike, int year, int month, int day)\n        {\n            var underlying = Symbol.CreateFuture(\"GC\", Market.COMEX, new DateTime(2020, 4, 28));\n            var expiry = new DateTime(year, month, day);\n            var optionSymbol = Symbol.CreateOption(\n                underlying,\n                Market.COMEX,\n                OptionStyle.American,\n                right,\n                (decimal)strike,\n                expiry);\n\n            var optionZipFilePath = LeanData.GenerateZipFilePath(Globals.DataFolder, optionSymbol, new DateTime(2020, 1, 5), Resolution.Minute, TickType.Quote)\n                .Replace(Path.DirectorySeparatorChar, '/');\n            var optionEntryFilePath = LeanData.GenerateZipEntryName(optionSymbol, new DateTime(2020, 1, 5), Resolution.Minute, TickType.Quote);\n\n            Assert.AreEqual(\"../../../Data/futureoption/comex/minute/og/202004/20200105_quote_american.zip\", optionZipFilePath);\n            Assert.AreEqual($\"20200105_og_minute_quote_american_{right.ToLower()}_{strike}0000_{expiry:yyyyMMdd}.csv\", optionEntryFilePath);\n        }\n\n        [Test, TestCaseSource(nameof(AggregateTradeBarsTestData))]\n        public void AggregateTradeBarsTest(TimeSpan resolution, TradeBar expectedFirstTradeBar)\n        {\n            var symbol = Symbols.AAPL;\n            var initialBars = new[]\n            {\n                new TradeBar {Time = _aggregationTime, Open = 10, High = 15, Low = 8, Close = 11, Volume = 50, Period = TimeSpan.FromSeconds(1), Symbol = symbol},\n                new TradeBar {Time = _aggregationTime.Add(TimeSpan.FromSeconds(15)), Open = 13, High = 14, Low = 7, Close = 9, Volume = 150, Period = TimeSpan.FromSeconds(1), Symbol = symbol},\n                new TradeBar {Time = _aggregationTime.Add(TimeSpan.FromMinutes(15)), Open = 11, High = 25, Low = 10, Close = 21, Volume = 90, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n                new TradeBar {Time = _aggregationTime.Add(TimeSpan.FromHours(6)), Open = 17, High = 19, Low = 12, Close = 11, Volume = 20, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n            };\n\n            var aggregated = LeanData.AggregateTradeBars(initialBars, symbol, resolution).ToList();\n\n            Assert.True(aggregated.All(i => i.Period == resolution));\n            Assert.True(aggregated.All(i => i.Symbol == symbol));\n\n            var firstBar = aggregated.First();\n\n            AssertBarsAreEqual(expectedFirstTradeBar, firstBar);\n            Assert.AreEqual(expectedFirstTradeBar.Volume, firstBar.Volume);\n            Assert.AreEqual(expectedFirstTradeBar.Time, firstBar.Time);\n            Assert.AreEqual(expectedFirstTradeBar.EndTime, firstBar.EndTime);\n        }\n\n        [Test, TestCaseSource(nameof(AggregateTradeBarsTestData))]\n        public void AggregateTradeBarTicksTest(TimeSpan resolution, TradeBar expectedFirstTradeBar)\n        {\n            var symbol = Symbols.AAPL;\n            var initialTicks = new[]\n            {\n                new Tick(_aggregationTime, symbol, string.Empty, string.Empty, 50, 10),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(1)), symbol, string.Empty, string.Empty, 60, 7),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(10)), symbol, string.Empty, string.Empty, 89, 15),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(11)), symbol, string.Empty, string.Empty, 1, 9),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(61)), symbol, string.Empty, string.Empty, 9, 21),\n                new Tick(_aggregationTime.Add(TimeSpan.FromMinutes(2)), symbol, string.Empty, string.Empty, 80, 25),\n                new Tick(_aggregationTime.Add(TimeSpan.FromMinutes(20)), symbol, string.Empty, string.Empty, 1, 21),\n                new Tick(_aggregationTime.Add(TimeSpan.FromHours(1)), symbol, string.Empty, string.Empty, 20, 11),\n            };\n\n            var aggregated = LeanData.AggregateTicksToTradeBars(initialTicks, symbol, resolution).ToList();\n\n            Assert.True(aggregated.All(i => i.Period == resolution));\n            Assert.True(aggregated.All(i => i.Symbol == symbol));\n\n            var firstBar = aggregated.First();\n\n            AssertBarsAreEqual(expectedFirstTradeBar, firstBar);\n            Assert.AreEqual(expectedFirstTradeBar.Volume, firstBar.Volume);\n            Assert.AreEqual(expectedFirstTradeBar.Time, firstBar.Time);\n            Assert.AreEqual(expectedFirstTradeBar.EndTime, firstBar.EndTime);\n        }\n\n        [Test, TestCaseSource(nameof(AggregateQuoteBarsTestData))]\n        public void AggregateQuoteBarsTest(TimeSpan resolution, QuoteBar expectedFirstBar)\n        {\n            var symbol = Symbols.AAPL;\n            var initialBars = new[]\n            {\n                new QuoteBar {Time = _aggregationTime, Ask = new Bar {Open = 10, High = 15, Low = 8, Close = 11}, Bid = {Open = 7, High = 14, Low = 5, Close = 10}, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n                new QuoteBar {Time = _aggregationTime.Add(TimeSpan.FromSeconds(15)), Ask = new Bar {Open = 13, High = 14, Low = 7, Close = 9}, Bid = {Open = 10, High = 11, Low = 4, Close = 5}, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n                new QuoteBar {Time = _aggregationTime.Add(TimeSpan.FromMinutes(15)), Ask = new Bar {Open = 11, High = 25, Low = 10, Close = 21}, Bid = {Open = 10, High = 22, Low = 9, Close = 20}, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n                new QuoteBar {Time = _aggregationTime.Add(TimeSpan.FromHours(6)), Ask = new Bar {Open = 17, High = 19, Low = 12, Close = 11}, Bid = {Open = 16, High = 17, Low = 10, Close = 10}, Period = TimeSpan.FromMinutes(1), Symbol = symbol},\n            };\n\n            var aggregated = LeanData.AggregateQuoteBars(initialBars, symbol, resolution).ToList();\n\n            Assert.True(aggregated.All(i => i.Period == resolution));\n            Assert.True(aggregated.All(i => i.Symbol == symbol));\n\n            var firstBar = aggregated.First();\n\n            AssertBarsAreEqual(expectedFirstBar.Ask, firstBar.Ask);\n            AssertBarsAreEqual(expectedFirstBar.Bid, firstBar.Bid);\n            Assert.AreEqual(expectedFirstBar.LastBidSize, firstBar.LastBidSize);\n            Assert.AreEqual(expectedFirstBar.LastAskSize, firstBar.LastAskSize);\n            Assert.AreEqual(expectedFirstBar.Time, firstBar.Time);\n            Assert.AreEqual(expectedFirstBar.EndTime, firstBar.EndTime);\n        }\n\n        [Test, TestCaseSource(nameof(AggregateTickTestData))]\n        public void AggregateTicksTest(TimeSpan resolution, QuoteBar expectedFirstBar)\n        {\n            var symbol = Symbols.AAPL;\n            var initialTicks = new[]\n            {\n                new Tick(_aggregationTime, symbol, string.Empty, string.Empty, 10, 11, 12, 13),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(1)), symbol, string.Empty, string.Empty, 14, 15, 16, 17),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(10)), symbol, string.Empty, string.Empty, 18, 19, 20, 21),\n                new Tick(_aggregationTime.Add(TimeSpan.FromSeconds(61)), symbol, string.Empty, string.Empty, 22, 23, 24, 25),\n            };\n\n            var aggregated = LeanData.AggregateTicks(initialTicks, symbol, resolution).ToList();\n\n            Assert.True(aggregated.All(i => i.Period == resolution));\n            Assert.True(aggregated.All(i => i.Symbol == symbol));\n\n            var firstBar = aggregated.First();\n\n            AssertBarsAreEqual(expectedFirstBar.Ask, firstBar.Ask);\n            AssertBarsAreEqual(expectedFirstBar.Bid, firstBar.Bid);\n            Assert.AreEqual(expectedFirstBar.LastBidSize, firstBar.LastBidSize);\n            Assert.AreEqual(expectedFirstBar.LastAskSize, firstBar.LastAskSize);\n            Assert.AreEqual(expectedFirstBar.Time, firstBar.Time);\n            Assert.AreEqual(expectedFirstBar.EndTime, firstBar.EndTime);\n        }\n\n        [Test]\n        public void AggregateFlushesData()\n        {\n            var symbol = Symbols.AAPL;\n            var period = Resolution.Daily.ToTimeSpan();\n            var initialTicks = new[] { new Tick(_aggregationTime, symbol, string.Empty, string.Empty, 10, 380) };\n\n            var expectedBar = new TradeBar\n            {\n                Open = 380,\n                Close = 380,\n                High = 380,\n                Low = 380,\n                Volume = 10,\n                Time = _aggregationTime.Date,\n                Symbol = Symbols.AAPL,\n                Period = period\n            };\n            var aggregated = LeanData.AggregateTicksToTradeBars(initialTicks, symbol, period).ToList();\n\n            // should aggregate even for a single point\n            Assert.AreEqual(1, aggregated.Count);\n            Assert.True(aggregated.All(i => i.Period == period));\n            Assert.True(aggregated.All(i => i.Symbol == symbol));\n\n            var firstBar = aggregated.Single();\n\n            AssertBarsAreEqual(expectedBar, firstBar);\n            Assert.AreEqual(expectedBar.Volume, firstBar.Volume);\n            Assert.AreEqual(expectedBar.Time, firstBar.Time);\n            Assert.AreEqual(expectedBar.EndTime, firstBar.EndTime);\n        }\n\n        [Test]\n        public void AggregateEmpty()\n        {\n            var aggregated = LeanData.AggregateTicksToTradeBars(new List<Tick>(), Symbols.AAPL, Resolution.Daily.ToTimeSpan()).ToList();\n\n            Assert.AreEqual(0, aggregated.Count);\n        }\n\n        private static void AssertBarsAreEqual(IBar expected, IBar actual)\n        {\n            if (expected == null && actual == null)\n            {\n                return;\n            }\n            if (expected == null && actual != null)\n            {\n                Assert.Fail(\"Expected null bar\");\n            }\n            Assert.AreEqual(expected.Open, actual.Open);\n            Assert.AreEqual(expected.High, actual.High);\n            Assert.AreEqual(expected.Low, actual.Low);\n            Assert.AreEqual(expected.Close, actual.Close);\n        }\n\n        private static TestCaseData[] GetLeanDataTestParameters()\n        {\n            var date = new DateTime(2016, 02, 17);\n            var dateFutures = new DateTime(2018, 12, 10);\n\n            return new List<LeanDataTestParameters>\n            {\n                // equity\n                new LeanDataTestParameters(Symbols.SPY, date, Resolution.Tick, TickType.Trade, \"20160217_trade.zip\", \"20160217_spy_Trade_Tick.csv\", \"equity/usa/tick/spy\"),\n                new LeanDataTestParameters(Symbols.SPY, date, Resolution.Second, TickType.Trade, \"20160217_trade.zip\", \"20160217_spy_second_trade.csv\", \"equity/usa/second/spy\"),\n                new LeanDataTestParameters(Symbols.SPY, date, Resolution.Minute, TickType.Trade, \"20160217_trade.zip\", \"20160217_spy_minute_trade.csv\", \"equity/usa/minute/spy\"),\n                new LeanDataTestParameters(Symbols.SPY, date, Resolution.Hour, TickType.Trade, \"spy.zip\", \"spy.csv\", \"equity/usa/hour\"),\n                new LeanDataTestParameters(Symbols.SPY, date, Resolution.Daily, TickType.Trade, \"spy.zip\", \"spy.csv\", \"equity/usa/daily\"),\n\n                // equity option trades\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Tick, TickType.Trade, \"20160217_trade_american.zip\", \"20160217_spy_tick_trade_american_put_1920000_20160219.csv\", \"option/usa/tick/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Tick, TickType.Quote, \"20160217_quote_american.zip\", \"20160217_spy_tick_quote_american_put_1920000_20160219.csv\", \"option/usa/tick/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Second, TickType.Trade, \"20160217_trade_american.zip\", \"20160217_spy_second_trade_american_put_1920000_20160219.csv\", \"option/usa/second/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Second, TickType.Quote, \"20160217_quote_american.zip\", \"20160217_spy_second_quote_american_put_1920000_20160219.csv\", \"option/usa/second/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Minute, TickType.Trade, \"20160217_trade_american.zip\", \"20160217_spy_minute_trade_american_put_1920000_20160219.csv\", \"option/usa/minute/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Minute, TickType.Quote, \"20160217_quote_american.zip\", \"20160217_spy_minute_quote_american_put_1920000_20160219.csv\", \"option/usa/minute/spy\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Hour, TickType.Trade, \"spy_2016_trade_american.zip\", \"spy_trade_american_put_1920000_20160219.csv\", \"option/usa/hour\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Hour, TickType.Quote, \"spy_2016_quote_american.zip\", \"spy_quote_american_put_1920000_20160219.csv\", \"option/usa/hour\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Daily, TickType.Trade, \"spy_2016_trade_american.zip\", \"spy_trade_american_put_1920000_20160219.csv\", \"option/usa/daily\"),\n                new LeanDataTestParameters(Symbols.SPY_P_192_Feb19_2016, date, Resolution.Daily, TickType.Quote, \"spy_2016_quote_american.zip\", \"spy_quote_american_put_1920000_20160219.csv\", \"option/usa/daily\"),\n                \n                // future option\n                new LeanDataTestParameters(Symbol.CreateOption(Symbol.CreateFuture(Futures.Grains.SoybeanOil, Market.CBOT, new(2025, 12, 12)), Market.CBOT, SecurityType.FutureOption.DefaultOptionStyle(), OptionRight.Call, 0.45m, new(2025, 10, 24)), date, Resolution.Minute, TickType.Trade, \"20160217_trade_american.zip\", \"20160217_ozl_minute_trade_american_call_4500_20251024.csv\", \"futureoption/cbot/minute/ozl/202512\"),\n                new LeanDataTestParameters(Symbol.CreateOption(Symbol.CreateFuture(Futures.Currencies.JPY, Market.CME, new(2025, 12, 15)), Market.CME, SecurityType.FutureOption.DefaultOptionStyle(), OptionRight.Call, 0.006475m, new(2025, 12, 05)), date, Resolution.Minute, TickType.Quote, \"20160217_quote_american.zip\", \"20160217_jpu_minute_quote_american_call_64.75_20251205.csv\", \"futureoption/cme/minute/jpu/202512\"),\n\n                // forex\n                new LeanDataTestParameters(Symbols.EURUSD, date, Resolution.Tick, TickType.Quote, \"20160217_quote.zip\", \"20160217_eurusd_tick_quote.csv\", \"forex/oanda/tick/eurusd\"),\n                new LeanDataTestParameters(Symbols.EURUSD, date, Resolution.Second, TickType.Quote, \"20160217_quote.zip\", \"20160217_eurusd_second_quote.csv\", \"forex/oanda/second/eurusd\"),\n                new LeanDataTestParameters(Symbols.EURUSD, date, Resolution.Minute, TickType.Quote, \"20160217_quote.zip\", \"20160217_eurusd_minute_quote.csv\", \"forex/oanda/minute/eurusd\"),\n                new LeanDataTestParameters(Symbols.EURUSD, date, Resolution.Hour, TickType.Quote, \"eurusd.zip\", \"eurusd.csv\", \"forex/oanda/hour\"),\n                new LeanDataTestParameters(Symbols.EURUSD, date, Resolution.Daily, TickType.Quote, \"eurusd.zip\", \"eurusd.csv\", \"forex/oanda/daily\"),\n\n                // cfd\n                new LeanDataTestParameters(Symbols.DE10YBEUR, date, Resolution.Tick, TickType.Quote, \"20160217_quote.zip\", \"20160217_de10ybeur_tick_quote.csv\", \"cfd/oanda/tick/de10ybeur\"),\n                new LeanDataTestParameters(Symbols.DE10YBEUR, date, Resolution.Second, TickType.Quote, \"20160217_quote.zip\", \"20160217_de10ybeur_second_quote.csv\", \"cfd/oanda/second/de10ybeur\"),\n                new LeanDataTestParameters(Symbols.DE10YBEUR, date, Resolution.Minute, TickType.Quote, \"20160217_quote.zip\", \"20160217_de10ybeur_minute_quote.csv\", \"cfd/oanda/minute/de10ybeur\"),\n                new LeanDataTestParameters(Symbols.DE10YBEUR, date, Resolution.Hour, TickType.Quote, \"de10ybeur.zip\", \"de10ybeur.csv\", \"cfd/oanda/hour\"),\n                new LeanDataTestParameters(Symbols.DE10YBEUR, date, Resolution.Daily, TickType.Quote, \"de10ybeur.zip\", \"de10ybeur.csv\", \"cfd/oanda/daily\"),\n\n                // Crypto - trades\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Tick, TickType.Trade, \"20160217_trade.zip\", \"20160217_btcusd_tick_trade.csv\", \"crypto/coinbase/tick/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Second, TickType.Trade, \"20160217_trade.zip\", \"20160217_btcusd_second_trade.csv\", \"crypto/coinbase/second/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Minute, TickType.Trade, \"20160217_trade.zip\", \"20160217_btcusd_minute_trade.csv\", \"crypto/coinbase/minute/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Hour, TickType.Trade, \"btcusd_trade.zip\", \"btcusd.csv\", \"crypto/coinbase/hour\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Daily, TickType.Trade, \"btcusd_trade.zip\", \"btcusd.csv\", \"crypto/coinbase/daily\"),\n\n                // Crypto - quotes\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Tick, TickType.Quote, \"20160217_quote.zip\", \"20160217_btcusd_tick_quote.csv\", \"crypto/coinbase/tick/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Second, TickType.Quote, \"20160217_quote.zip\", \"20160217_btcusd_second_quote.csv\", \"crypto/coinbase/second/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Minute, TickType.Quote, \"20160217_quote.zip\", \"20160217_btcusd_minute_quote.csv\", \"crypto/coinbase/minute/btcusd\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Hour, TickType.Quote, \"btcusd_quote.zip\", \"btcusd.csv\", \"crypto/coinbase/hour\"),\n                new LeanDataTestParameters(Symbols.BTCUSD, date, Resolution.Daily, TickType.Quote, \"btcusd_quote.zip\", \"btcusd.csv\", \"crypto/coinbase/daily\"),\n\n                // Futures (expiration month == contract month) - trades\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Tick, TickType.Trade, \"20181210_trade.zip\", \"20181210_es_tick_trade_201812.csv\", \"future/cme/tick/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Second, TickType.Trade, \"20181210_trade.zip\", \"20181210_es_second_trade_201812.csv\", \"future/cme/second/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Minute, TickType.Trade, \"20181210_trade.zip\", \"20181210_es_minute_trade_201812.csv\", \"future/cme/minute/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Hour, TickType.Trade, \"es_trade.zip\", \"es_trade_201812.csv\", \"future/cme/hour\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Daily, TickType.Trade, \"es_trade.zip\", \"es_trade_201812.csv\", \"future/cme/daily\"),\n\n                // Futures (expiration month == contract month) - quotes\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Tick, TickType.Quote, \"20181210_quote.zip\", \"20181210_es_tick_quote_201812.csv\", \"future/cme/tick/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Second, TickType.Quote, \"20181210_quote.zip\", \"20181210_es_second_quote_201812.csv\", \"future/cme/second/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Minute, TickType.Quote, \"20181210_quote.zip\", \"20181210_es_minute_quote_201812.csv\", \"future/cme/minute/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Hour, TickType.Quote, \"es_quote.zip\", \"es_quote_201812.csv\", \"future/cme/hour\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Daily, TickType.Quote, \"es_quote.zip\", \"es_quote_201812.csv\", \"future/cme/daily\"),\n\n                // Futures (expiration month == contract month) - OpenInterest\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Tick, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_es_tick_openinterest_201812.csv\", \"future/cme/tick/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Second, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_es_second_openinterest_201812.csv\", \"future/cme/second/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Minute, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_es_minute_openinterest_201812.csv\", \"future/cme/minute/es\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Hour, TickType.OpenInterest, \"es_openinterest.zip\", \"es_openinterest_201812.csv\", \"future/cme/hour\"),\n                new LeanDataTestParameters(Symbols.Future_ESZ18_Dec2018, dateFutures, Resolution.Daily, TickType.OpenInterest, \"es_openinterest.zip\", \"es_openinterest_201812.csv\", \"future/cme/daily\"),\n\n                // Futures (expiration month < contract month) - trades\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Tick, TickType.Trade, \"20181210_trade.zip\", \"20181210_cl_tick_trade_201901.csv\", \"future/nymex/tick/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Second, TickType.Trade, \"20181210_trade.zip\", \"20181210_cl_second_trade_201901.csv\", \"future/nymex/second/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Minute, TickType.Trade, \"20181210_trade.zip\", \"20181210_cl_minute_trade_201901.csv\", \"future/nymex/minute/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Hour, TickType.Trade, \"cl_trade.zip\", \"cl_trade_201901.csv\", \"future/nymex/hour\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Daily, TickType.Trade, \"cl_trade.zip\", \"cl_trade_201901.csv\", \"future/nymex/daily\"),\n\n                // Futures (expiration month < contract month) - quotes\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Tick, TickType.Quote, \"20181210_quote.zip\", \"20181210_cl_tick_quote_201901.csv\", \"future/nymex/tick/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Second, TickType.Quote, \"20181210_quote.zip\", \"20181210_cl_second_quote_201901.csv\", \"future/nymex/second/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Minute, TickType.Quote, \"20181210_quote.zip\", \"20181210_cl_minute_quote_201901.csv\", \"future/nymex/minute/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Hour, TickType.Quote, \"cl_quote.zip\", \"cl_quote_201901.csv\", \"future/nymex/hour\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Daily, TickType.Quote, \"cl_quote.zip\", \"cl_quote_201901.csv\", \"future/nymex/daily\"),\n\n                // Futures (expiration month < contract month) - open interest\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Tick, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_cl_tick_openinterest_201901.csv\", \"future/nymex/tick/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Second, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_cl_second_openinterest_201901.csv\", \"future/nymex/second/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Minute, TickType.OpenInterest, \"20181210_openinterest.zip\", \"20181210_cl_minute_openinterest_201901.csv\", \"future/nymex/minute/cl\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Hour, TickType.OpenInterest, \"cl_openinterest.zip\", \"cl_openinterest_201901.csv\", \"future/nymex/hour\"),\n                new LeanDataTestParameters(Symbols.Future_CLF19_Jan2019, dateFutures, Resolution.Daily, TickType.OpenInterest, \"cl_openinterest.zip\", \"cl_openinterest_201901.csv\", \"future/nymex/daily\"),\n\n            }.Select(x => new TestCaseData(x).SetName(x.Name)).ToArray();\n        }\n\n        private static TestCaseData[] GetLeanDataLineTestParameters()\n        {\n            var time = new DateTime(2016, 02, 18, 9, 30, 0);\n            return new List<LeanDataLineTestParameters>\n            {\n                //equity\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.SPY, Value = 1, Quantity = 2, TickType = TickType.Trade, Exchange = Exchange.BATS_Y, SaleCondition = \"SC\", Suspicious = true}, SecurityType.Equity, Resolution.Tick,\n                    \"34200000,10000,2,Y,SC,1\"),\n                new LeanDataLineTestParameters(new TradeBar(time, Symbols.SPY, 1, 2, 3, 4, 5, TimeSpan.FromMinutes(1)), SecurityType.Equity, Resolution.Minute,\n                    \"34200000,10000,20000,30000,40000,5\"),\n                new LeanDataLineTestParameters(new TradeBar(time.Date, Symbols.SPY, 1, 2, 3, 4, 5, TimeSpan.FromDays(1)), SecurityType.Equity, Resolution.Daily,\n                    \"20160218 00:00,10000,20000,30000,40000,5\"),\n\n                // options\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.SPY_P_192_Feb19_2016, null, 0, new Bar(6, 7, 8, 9), 10, TimeSpan.FromMinutes(1)) {Bid = null}, SecurityType.Option, Resolution.Minute,\n                    \"34200000,,,,,0,60000,70000,80000,90000,10\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.SPY_P_192_Feb19_2016, new Bar(1, 2, 3, 4), 5, null, 0, TimeSpan.FromDays(1)) {Ask = null}, SecurityType.Option, Resolution.Daily,\n                    \"20160218 00:00,10000,20000,30000,40000,5,,,,,0\"),\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.SPY_P_192_Feb19_2016, new Bar(1, 2, 3, 4), 5, new Bar(6, 7, 8, 9), 10, TimeSpan.FromMinutes(1)), SecurityType.Option, Resolution.Minute,\n                    \"34200000,10000,20000,30000,40000,5,60000,70000,80000,90000,10\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.SPY_P_192_Feb19_2016, new Bar(1, 2, 3, 4), 5, new Bar(6, 7, 8, 9), 10, TimeSpan.FromDays(1)), SecurityType.Option, Resolution.Daily,\n                    \"20160218 00:00,10000,20000,30000,40000,5,60000,70000,80000,90000,10\"),\n                new LeanDataLineTestParameters(new Tick(time, Symbols.SPY_P_192_Feb19_2016, 0, 1, 3) {Value = 2m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = Exchange.C2, Suspicious = true}, SecurityType.Option, Resolution.Tick,\n                    \"34200000,10000,2,30000,4,W,1\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.SPY_P_192_Feb19_2016, Value = 1, Quantity = 2,TickType = TickType.Trade, Exchange = Exchange.C2, SaleCondition = \"SC\", Suspicious = true}, SecurityType.Option, Resolution.Tick,\n                    \"34200000,10000,2,W,SC,1\"),\n                new LeanDataLineTestParameters(new TradeBar(time, Symbols.SPY_P_192_Feb19_2016, 1, 2, 3, 4, 5, TimeSpan.FromMinutes(1)), SecurityType.Option, Resolution.Minute,\n                    \"34200000,10000,20000,30000,40000,5\"),\n                new LeanDataLineTestParameters(new TradeBar(time.Date, Symbols.SPY_P_192_Feb19_2016, 1, 2, 3, 4, 5, TimeSpan.FromDays(1)), SecurityType.Option, Resolution.Daily,\n                    \"20160218 00:00,10000,20000,30000,40000,5\"),\n\n                // forex\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.EURUSD, BidPrice = 1, Value =1.5m, AskPrice = 2, TickType = TickType.Quote}, SecurityType.Forex, Resolution.Tick,\n                    \"34200000,1,2\"),\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.EURUSD, new Bar(1, 2, 3, 4), 0, new Bar(1, 2, 3, 4), 0, TimeSpan.FromMinutes(1)), SecurityType.Forex, Resolution.Minute, \"34200000,1,2,3,4,0,1,2,3,4,0\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.EURUSD, new Bar(1, 2, 3, 4), 0, new Bar(1, 2, 3, 4), 0, TimeSpan.FromDays(1)), SecurityType.Forex, Resolution.Daily,\n                    \"20160218 00:00,1,2,3,4,0,1,2,3,4,0\"),\n\n                // cfd\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.DE10YBEUR, BidPrice = 1, Value = 1.5m, AskPrice = 2, TickType = TickType.Quote}, SecurityType.Cfd, Resolution.Tick,\n                    \"34200000,1,2\"),\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.DE10YBEUR, new Bar(1, 2, 3, 4), 0, new Bar(1, 2, 3, 4), 0, TimeSpan.FromMinutes(1)), SecurityType.Cfd, Resolution.Minute,\n                    \"34200000,1,2,3,4,0,1,2,3,4,0\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.DE10YBEUR, new Bar(1, 2, 3, 4), 0, new Bar(1, 2, 3, 4), 0, TimeSpan.FromDays(1)), SecurityType.Cfd, Resolution.Daily,\n                    \"20160218 00:00,1,2,3,4,0,1,2,3,4,0\"),\n\n                // crypto - trades\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.BTCUSD, null, 0, new Bar(6, 7, 8, 9), 10, TimeSpan.FromMinutes(1)) {Bid = null}, SecurityType.Crypto, Resolution.Minute,\n                    \"34200000,,,,,0,6,7,8,9,10\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.BTCUSD, new Bar(1, 2, 3, 4), 5, null, 0, TimeSpan.FromDays(1)) {Ask = null}, SecurityType.Crypto, Resolution.Daily,\n                    \"20160218 00:00,1,2,3,4,5,,,,,0\"),\n                new LeanDataLineTestParameters(new QuoteBar(time, Symbols.BTCUSD, new Bar(1, 2, 3, 4), 5, new Bar(6, 7, 8, 9), 10, TimeSpan.FromMinutes(1)), SecurityType.Crypto, Resolution.Minute,\n                    \"34200000,1,2,3,4,5,6,7,8,9,10\"),\n                new LeanDataLineTestParameters(new QuoteBar(time.Date, Symbols.BTCUSD, new Bar(1, 2, 3, 4), 5, new Bar(6, 7, 8, 9), 10, TimeSpan.FromDays(1)), SecurityType.Crypto, Resolution.Daily,\n                    \"20160218 00:00,1,2,3,4,5,6,7,8,9,10\"),\n                new LeanDataLineTestParameters(new Tick(time, Symbols.BTCUSD, 0, 1, 3) {Value = 2m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = \"coinbase\", Suspicious = false}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1,2,3,4,0\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, Value = 1, Quantity = 2,TickType = TickType.Trade, Exchange = \"coinbase\", Suspicious = false}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1,2,0\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, Value = 1, Quantity = 2,TickType = TickType.Trade, Exchange = \"coinbase\", Suspicious = true}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1,2,1\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = 1m, AskPrice = 3m, Value = 2m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = \"coinbase\", Suspicious = true}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1,2,3,4,1\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = 1.25m, AskPrice = 1.50m, Value = 1.375m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = \"coinbase\", Suspicious = true}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1.25,2,1.5,4,1\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = 1.25m, AskPrice = 1.50m, Value = 1.375m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = \"coinbase\", Suspicious = false}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1.25,2,1.5,4,0\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = 1.25m, AskPrice = 1.50m, Value = 1.375m, TickType = TickType.Quote, BidSize = 2, AskSize = 4, Exchange = \"coinbase\", Suspicious = false}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,1.25,2,1.5,4,0\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = -1m, AskPrice = -1m, Value = -1m, TickType = TickType.Quote, BidSize = 0, AskSize = 0, Exchange = \"coinbase\", Suspicious = false}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,-1,0,-1,0,0\"),\n                new LeanDataLineTestParameters(new Tick {Time = time, Symbol = Symbols.BTCUSD, BidPrice = -1m, AskPrice = -1m, Value = -1m, TickType = TickType.Quote, BidSize = 0, AskSize = 0, Exchange = \"coinbase\", Suspicious = true}, SecurityType.Crypto, Resolution.Tick,\n                    \"34200000,-1,0,-1,0,1\"),\n                new LeanDataLineTestParameters(new TradeBar(time, Symbols.BTCUSD, 1, 2, 3, 4, 5, TimeSpan.FromMinutes(1)), SecurityType.Crypto, Resolution.Minute,\n                    \"34200000,1,2,3,4,5\"),\n                new LeanDataLineTestParameters(new TradeBar(time.Date, Symbols.BTCUSD, 1, 2, 3, 4, 5, TimeSpan.FromDays(1)), SecurityType.Crypto, Resolution.Daily,\n                    \"20160218 00:00,1,2,3,4,5\"),\n\n            }.Select(x => new TestCaseData(x).SetName(x.Name)).ToArray();\n        }\n\n        private static TestCaseData[] AggregateTradeBarsTestData\n        {\n            get\n            {\n                return new[]\n                {\n                    new TestCaseData(TimeSpan.FromMinutes(1), new TradeBar {Open = 10, Close = 9, High = 15, Low = 7, Volume = 200, Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromMinutes(1)}),\n                    new TestCaseData(TimeSpan.FromHours(1), new TradeBar {Open = 10, Close = 21, High = 25, Low = 7, Volume = 290, Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromHours(1)}),\n                    new TestCaseData(TimeSpan.FromDays(1), new TradeBar {Open = 10, Close = 11, High = 25, Low = 7, Volume = 310, Time = _aggregationTime.Date, Symbol = Symbols.AAPL, Period = TimeSpan.FromDays(1)}),\n                };\n            }\n        }\n\n        private static TestCaseData[] AggregateQuoteBarsTestData\n        {\n            get\n            {\n                return new[]\n                {\n                    new TestCaseData(TimeSpan.FromMinutes(1), new QuoteBar {Ask = new Bar {Open = 10, High = 15, Low = 7, Close = 9}, Bid = {Open = 7, High = 14, Low = 4, Close = 5},\n                        Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromMinutes(1)}),\n                    new TestCaseData(TimeSpan.FromHours(1), new QuoteBar {Ask = new Bar {Open = 10, High = 25, Low = 7, Close = 21}, Bid = {Open = 7, High = 22, Low = 4, Close = 20},\n                        Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromHours(1)}),\n                    new TestCaseData(TimeSpan.FromDays(1), new QuoteBar {Ask = new Bar {Open = 10, High = 25, Low = 7, Close = 11}, Bid = {Open = 7, High = 22, Low = 4, Close = 10},\n                        Time = _aggregationTime.Date, Symbol = Symbols.AAPL, Period = TimeSpan.FromDays(1)}),\n                };\n            }\n        }\n\n        private static TestCaseData[] AggregateTickTestData\n        {\n            get\n            {\n                return new[]\n                {\n                    new TestCaseData(TimeSpan.FromSeconds(1), new QuoteBar {Ask = new Bar {Open = 13, High = 13, Low = 13, Close = 13}, Bid = {Open = 11, High = 11, Low = 11, Close = 11},\n                        LastBidSize = 10, LastAskSize = 12, Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromSeconds(1)}),\n                    new TestCaseData(TimeSpan.FromMinutes(1), new QuoteBar {Ask = new Bar {Open = 13, High = 21, Low = 13, Close = 21}, Bid = {Open = 11, High = 19, Low = 11, Close = 19},\n                        LastBidSize = 18, LastAskSize = 20, Time = _aggregationTime, Symbol = Symbols.AAPL, Period = TimeSpan.FromMinutes(1)}),\n                };\n            }\n        }\n\n        public class LeanDataTestParameters\n        {\n            public string Name { get; init; }\n            public Symbol Symbol { get; init; }\n            public DateTime Date { get; init; }\n            public Resolution Resolution { get; init; }\n            public TickType TickType { get; init; }\n            public Type BaseDataType { get; init; }\n            public SubscriptionDataConfig Config { get; init; }\n            public string ExpectedZipFileName { get; init; }\n            public string ExpectedZipEntryName { get; init; }\n            public string ExpectedRelativeZipFilePath { get; init; }\n            public string ExpectedZipFilePath { get; init; }\n            public SecurityType SecurityType { get { return Symbol.ID.SecurityType; } }\n\n            public LeanDataTestParameters(Symbol symbol, DateTime date, Resolution resolution, TickType tickType, string expectedZipFileName, string expectedZipEntryName, string expectedRelativeZipFileDirectory = \"\")\n            {\n                Symbol = symbol;\n                Date = date;\n                Resolution = resolution;\n                TickType = tickType;\n                ExpectedZipFileName = expectedZipFileName;\n                ExpectedZipEntryName = expectedZipEntryName;\n                ExpectedRelativeZipFilePath = Path.Combine(expectedRelativeZipFileDirectory, expectedZipFileName).Replace(\"/\", Path.DirectorySeparatorChar.ToStringInvariant());\n                ExpectedZipFilePath = Path.Combine(Globals.DataFolder, ExpectedRelativeZipFilePath);\n\n                Name = SecurityType + \"_\" + resolution + \"_\" + symbol.Value + \"_\" + tickType;\n\n                BaseDataType = resolution == Resolution.Tick ? typeof(Tick) : typeof(TradeBar);\n                if (symbol.ID.SecurityType == SecurityType.Option && resolution != Resolution.Tick)\n                {\n                    BaseDataType = typeof(QuoteBar);\n                }\n                Config = new SubscriptionDataConfig(BaseDataType, symbol, resolution, TimeZones.NewYork, TimeZones.NewYork, true, false, false, false, tickType);\n            }\n        }\n\n        public class LeanDataLineTestParameters\n        {\n            public string Name { get; init; }\n            public BaseData Data { get; init; }\n            public SecurityType SecurityType { get; init; }\n            public Resolution Resolution { get; init; }\n            public string ExpectedLine { get; init; }\n            public SubscriptionDataConfig Config { get; init; }\n            public TickType TickType { get; init; }\n\n            public LeanDataLineTestParameters(BaseData data, SecurityType securityType, Resolution resolution, string expectedLine)\n            {\n                Data = data;\n                SecurityType = securityType;\n                Resolution = resolution;\n                ExpectedLine = expectedLine;\n                if (data is Tick)\n                {\n                    var tick = (Tick) data;\n                    TickType = tick.TickType;\n                }\n                else if (data is TradeBar)\n                {\n                    TickType = TickType.Trade;\n                }\n                else if (data is QuoteBar)\n                {\n                    TickType = TickType.Quote;\n                }\n                else\n                {\n                    throw new NotImplementedException();\n                }\n\n                // override for forex/cfd\n                if (data.Symbol.ID.SecurityType == SecurityType.Forex || data.Symbol.ID.SecurityType == SecurityType.Cfd)\n                {\n                    TickType = TickType.Quote;\n                }\n\n                Config = new SubscriptionDataConfig(Data.GetType(), Data.Symbol, Resolution, TimeZones.Utc, TimeZones.Utc, false, true, false, false, TickType);\n\n                Name = SecurityType + \"_\" + data.GetType().Name;\n\n                if (data.GetType() != typeof (Tick) || Resolution != Resolution.Tick)\n                {\n                    Name += \"_\" + Resolution;\n                }\n\n                if (data is Tick)\n                {\n                    Name += \"_\" + ((Tick) data).TickType;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/LinqExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing static QuantConnect.StringExtensions;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class LinqExtensionsTests\n    {\n        [Test]\n        public void ToArray_PerformsProjection()\n        {\n            var enumerable = Enumerable.Range(0, 10);\n            var array = enumerable.ToArray(i => Invariant($\"{i}\"));\n            CollectionAssert.AreEqual(enumerable.Select(i => Invariant($\"{i}\")).ToArray(), array);\n        }\n\n        [Test]\n        public void ToImmutableArray_PerformsProjection()\n        {\n            var enumerable = Enumerable.Range(0, 10);\n            var array = enumerable.ToImmutableArray(i => Invariant($\"{i}\"));\n            CollectionAssert.AreEqual(enumerable.Select(i => Invariant($\"{i}\")).ToArray(), array);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ListComparerTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ListComparerTests\n    {\n        [Test]\n        public void DateTimeEquals()\n        {\n            var comparer = new ListComparer<DateTime>();\n            var list1 = new List<DateTime> { new DateTime(2019) };\n            var list2 = new List<DateTime> { new DateTime(2019) };\n\n            Assert.IsTrue(comparer.Equals(list1, list2));\n            Assert.AreEqual(comparer.GetHashCode(list2), comparer.GetHashCode(list1));\n        }\n\n        [Test]\n        public void DateTimeDifferent()\n        {\n            var comparer = new ListComparer<DateTime>();\n            var list1 = new List<DateTime> { new DateTime(2019) };\n            var list2 = new List<DateTime> { new DateTime(2017) };\n\n            Assert.IsFalse(comparer.Equals(list1, list2));\n            Assert.AreNotEqual(comparer.GetHashCode(list2), comparer.GetHashCode(list1));\n        }\n\n        [Test]\n        public void EmptyLists()\n        {\n            var comparer = new ListComparer<DateTime>();\n            var list1 = new List<DateTime>();\n            var list2 = new List<DateTime>();\n\n            Assert.IsTrue(comparer.Equals(list1, list2));\n            Assert.AreEqual(comparer.GetHashCode(list2), comparer.GetHashCode(list1));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/MarketHoursDatabaseJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class MarketHoursDatabaseJsonConverterTests\n    {\n        [Test]\n        public void HandlesRoundTrip()\n        {\n            var database = MarketHoursDatabase.FromDataFolder();\n            var result = JsonConvert.SerializeObject(database, Formatting.Indented);\n            var deserializedDatabase = JsonConvert.DeserializeObject<MarketHoursDatabase>(result);\n\n            var originalListing = database.ExchangeHoursListing.ToDictionary();\n            foreach (var kvp in deserializedDatabase.ExchangeHoursListing)\n            {\n                var original = originalListing[kvp.Key];\n                Assert.AreEqual(original.DataTimeZone, kvp.Value.DataTimeZone);\n                CollectionAssert.AreEqual(original.ExchangeHours.Holidays, kvp.Value.ExchangeHours.Holidays);\n                CollectionAssert.AreEqual(original.ExchangeHours.EarlyCloses, kvp.Value.ExchangeHours.EarlyCloses);\n                CollectionAssert.AreEqual(original.ExchangeHours.LateOpens, kvp.Value.ExchangeHours.LateOpens);\n\n                foreach (var value in Enum.GetValues(typeof(DayOfWeek)))\n                {\n                    var day = (DayOfWeek) value;\n                    var o = original.ExchangeHours.MarketHours[day];\n                    var d = kvp.Value.ExchangeHours.MarketHours[day];\n                    foreach (var pair in o.Segments.Zip(d.Segments, Tuple.Create))\n                    {\n                        Assert.AreEqual(pair.Item1.State, pair.Item2.State);\n                        Assert.AreEqual(pair.Item1.Start, pair.Item2.Start);\n                        Assert.AreEqual(pair.Item1.End, pair.Item2.End);\n                    }\n                }\n            }\n        }\n\n        public static void TestOverriddenEarlyClosesAndLateOpens(IReadOnlyDictionary<DateTime, TimeSpan> commonDateTimes,\n            IReadOnlyDictionary<DateTime, TimeSpan> specificDateTimes,\n            JObject jsonDatabase,\n            string testKey,\n            string specificEntryKey)\n        {\n            var datesWereOverriden = false;\n\n            foreach (var date in commonDateTimes.Keys)\n            {\n                // All early open or late close dates in the common entry should have been added to the specific entry.\n                // e.g. Index-usa-[*] early closes and late opens should have been added to Index-usa-VIX\n                Assert.IsTrue(specificDateTimes.ContainsKey(date));\n\n                // If common entry and specific entry have different times for the same date, the specific entry should\n                // have the correct time.\n                if (commonDateTimes[date] != specificDateTimes[date])\n                {\n                    var dateStr = date.ToStringInvariant(\"MM/dd/yyyy\");\n                    var timeStr = jsonDatabase[\"entries\"][specificEntryKey][testKey][dateStr].Value<string>();\n                    var time = TimeSpan.Parse(timeStr, CultureInfo.InvariantCulture);\n                    Assert.AreEqual(time, specificDateTimes[date]);\n\n                    datesWereOverriden = true;\n                }\n            }\n\n            Assert.IsTrue(datesWereOverriden);\n        }\n\n        [Test]\n        public void HandlesOverridingLateOpens()\n        {\n            var jsonDatabase = JObject.Parse(SampleMHDBWithOverriddenEarlyOpens);\n            var database = jsonDatabase.ToObject<MarketHoursDatabase>();\n\n            var googEntry = database.GetEntry(Market.USA, \"GOOG\", SecurityType.Equity);\n            var equityCommonEntry = database.GetEntry(Market.USA, \"\", SecurityType.Equity);\n\n            TestOverriddenEarlyClosesAndLateOpens(equityCommonEntry.ExchangeHours.LateOpens,\n                googEntry.ExchangeHours.LateOpens,\n                jsonDatabase,\n                \"lateOpens\",\n                \"Equity-usa-GOOG\");\n        }\n\n        [Test]\n        public void HandlesOverridingEarlyCloses()\n        {\n            var jsonDatabase = JObject.Parse(SampleMHDBWithOverriddenEarlyOpens);\n            var database = jsonDatabase.ToObject<MarketHoursDatabase>();\n\n            var googEntry = database.GetEntry(Market.USA, \"GOOG\", SecurityType.Equity);\n            var equityCommonEntry = database.GetEntry(Market.USA, \"\", SecurityType.Equity);\n\n            TestOverriddenEarlyClosesAndLateOpens(equityCommonEntry.ExchangeHours.EarlyCloses,\n                googEntry.ExchangeHours.EarlyCloses,\n                jsonDatabase,\n                \"earlyCloses\",\n                \"Equity-usa-GOOG\");\n        }\n\n        /// <summary>\n        /// Equity-usa-GOOG is more specific than Equity-usa-[*].\n        /// The early closes for GOOG should override the early closes for the common entry ([*]).\n        /// </summary>\n        public static string SampleMHDBWithOverriddenEarlyOpens => @\"\n{\n  \"\"entries\"\": {\n    \"\"Equity-usa-[*]\"\": {\n      \"\"dataTimeZone\"\": \"\"America/New_York\"\",\n      \"\"exchangeTimeZone\"\": \"\"America/New_York\"\",\n      \"\"sunday\"\": [],\n      \"\"monday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"tuesday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"wednesday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"thursday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"friday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"saturday\"\": [],\n      \"\"holidays\"\": [],\n      \"\"earlyCloses\"\": {\n        \"\"11/25/2015\"\": \"\"13:00:00\"\",\n        \"\"11/25/2016\"\": \"\"13:00:00\"\",\n        \"\"11/25/2017\"\": \"\"13:00:00\"\",\n        \"\"11/25/2018\"\": \"\"13:00:00\"\"\n      },\n      \"\"lateOpens\"\": {\n        \"\"11/25/2015\"\": \"\"11:00:00\"\",\n        \"\"11/25/2016\"\": \"\"11:00:00\"\",\n        \"\"11/25/2017\"\": \"\"11:00:00\"\",\n        \"\"11/25/2018\"\": \"\"11:00:00\"\"\n      }\n    },\n    \"\"Equity-usa-GOOG\"\": {\n      \"\"dataTimeZone\"\": \"\"America/New_York\"\",\n      \"\"exchangeTimeZone\"\": \"\"America/New_York\"\",\n      \"\"sunday\"\": [],\n      \"\"monday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"tuesday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"wednesday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"thursday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"friday\"\": [\n        { \"\"start\"\": \"\"04:00:00\"\", \"\"end\"\": \"\"09:30:00\"\", \"\"state\"\": \"\"premarket\"\" },\n        { \"\"start\"\": \"\"09:30:00\"\", \"\"end\"\": \"\"16:00:00\"\", \"\"state\"\": \"\"market\"\" },\n        { \"\"start\"\": \"\"16:00:00\"\", \"\"end\"\": \"\"20:00:00\"\", \"\"state\"\": \"\"postmarket\"\" }\n      ],\n      \"\"saturday\"\": [],\n      \"\"holidays\"\": [],\n      \"\"earlyCloses\"\": {\n        \"\"11/25/2017\"\": \"\"13:30:00\"\",\n        \"\"11/25/2018\"\": \"\"13:30:00\"\",\n        \"\"11/25/2019\"\": \"\"13:30:00\"\"\n      },\n      \"\"lateOpens\"\": {\n        \"\"11/25/2017\"\": \"\"11:30:00\"\",\n        \"\"11/25/2018\"\": \"\"11:30:00\"\",\n        \"\"11/25/2019\"\": \"\"11:30:00\"\"\n      }\n    }\n  }\n}\n\";\n\n        [Test, Ignore(\"This is provided to make it easier to convert your own market-hours-database.csv to the new format\")]\n        public void ConvertMarketHoursDatabaseCsvToJson()\n        {\n            var directory = Path.Combine(Globals.DataFolder, \"market-hours\");\n            var input = Path.Combine(directory, \"market-hours-database.csv\");\n            var output = Path.Combine(directory, Path.GetFileNameWithoutExtension(input) + \".json\");\n            var allHolidays = Directory.EnumerateFiles(Path.Combine(Globals.DataFolder, \"market-hours\"), \"holidays-*.csv\").Select(x =>\n            {\n                var dates = new HashSet<DateTime>();\n                var market = Path.GetFileNameWithoutExtension(x).Replace(\"holidays-\", string.Empty);\n                foreach (var line in File.ReadAllLines(x).Skip(1).Where(l => !l.StartsWith(\"#\")))\n                {\n                    var csv = line.ToCsv();\n                    dates.Add(new DateTime(\n                        Parse.Int(csv[0]),\n                        Parse.Int(csv[1]),\n                        Parse.Int(csv[2])\n                    ));\n                }\n                return new KeyValuePair<string, IEnumerable<DateTime>>(market, dates);\n            }).ToDictionary();\n            var database = FromCsvFile(input, allHolidays);\n            File.WriteAllText(output, JsonConvert.SerializeObject(database, Formatting.Indented));\n        }\n\n        #region These methods represent the old way of reading MarketHoursDatabase from csv and are left here to allow users to convert\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"MarketHoursDatabase\"/> class by reading the specified csv file\n        /// </summary>\n        /// <param name=\"file\">The csv file to be read</param>\n        /// <param name=\"holidaysByMarket\">The holidays for each market in the file, if no holiday is present then none is used</param>\n        /// <returns>A new instance of the <see cref=\"MarketHoursDatabase\"/> class representing the data in the specified file</returns>\n        public static MarketHoursDatabase FromCsvFile(string file, IReadOnlyDictionary<string, IEnumerable<DateTime>> holidaysByMarket)\n        {\n            var exchangeHours = new Dictionary<SecurityDatabaseKey, MarketHoursDatabase.Entry>();\n\n            if (!File.Exists(file))\n            {\n                throw new FileNotFoundException(\"Unable to locate market hours file: \" + file);\n            }\n\n            // skip the first header line, also skip #'s as these are comment lines\n            foreach (var line in File.ReadLines(file).Where(x => !x.StartsWith(\"#\")).Skip(1))\n            {\n                SecurityDatabaseKey key;\n                var hours = FromCsvLine(line, holidaysByMarket, out key);\n                if (exchangeHours.ContainsKey(key))\n                {\n                    throw new Exception($\"Encountered duplicate key while processing file: {file}. Key: {key}\");\n                }\n\n                exchangeHours[key] = hours;\n            }\n\n            return new MarketHoursDatabase(exchangeHours);\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"SecurityExchangeHours\"/> from the specified csv line and holiday set\n        /// </summary>\n        /// <param name=\"line\">The csv line to be parsed</param>\n        /// <param name=\"holidaysByMarket\">The holidays this exchange isn't open for trading by market</param>\n        /// <param name=\"key\">The key used to uniquely identify these market hours</param>\n        /// <returns>A new <see cref=\"SecurityExchangeHours\"/> for the specified csv line and holidays</returns>\n        private static MarketHoursDatabase.Entry FromCsvLine(string line,\n            IReadOnlyDictionary<string, IEnumerable<DateTime>> holidaysByMarket,\n            out SecurityDatabaseKey key)\n        {\n            var csv = line.Split(',');\n            var marketHours = new List<LocalMarketHours>(7);\n\n            // timezones can be specified using Tzdb names (America/New_York) or they can\n            // be specified using offsets, UTC-5\n\n            var dataTimeZone = ParseTimeZone(csv[0]);\n            var exchangeTimeZone = ParseTimeZone(csv[1]);\n\n            //var market = csv[2];\n            //var symbol = csv[3];\n            //var type = csv[4];\n            var symbol = string.IsNullOrEmpty(csv[3]) ? null : csv[3];\n            key = new SecurityDatabaseKey(csv[2], symbol, (SecurityType)Enum.Parse(typeof(SecurityType), csv[4], true));\n\n            int csvLength = csv.Length;\n            for (int i = 1; i < 8; i++) // 7 days, so < 8\n            {\n                // the 4 here is because 4 times per day, ex_open,open,close,ex_close\n                if (4*i + 4 > csvLength - 1)\n                {\n                    break;\n                }\n                var hours = ReadCsvHours(csv, 4*i + 1, (DayOfWeek) (i - 1));\n                marketHours.Add(hours);\n            }\n\n            IEnumerable<DateTime> holidays;\n            if (!holidaysByMarket.TryGetValue(key.Market, out holidays))\n            {\n                holidays = Enumerable.Empty<DateTime>();\n            }\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan>();\n            var lateOpens = new Dictionary<DateTime, TimeSpan>();\n            var exchangeHours = new SecurityExchangeHours(exchangeTimeZone, holidays, marketHours.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n            return new MarketHoursDatabase.Entry(dataTimeZone, exchangeHours);\n        }\n\n        private static DateTimeZone ParseTimeZone(string tz)\n        {\n            // handle UTC directly\n            if (tz == \"UTC\") return TimeZones.Utc;\n            // if it doesn't start with UTC then it's a name, like America/New_York\n            if (!tz.StartsWith(\"UTC\")) return DateTimeZoneProviders.Tzdb[tz];\n\n            // it must be a UTC offset, parse the offset as hours\n\n            // define the time zone as a constant offset time zone in the form: 'UTC-3.5' or 'UTC+10'\n            var millisecondsOffset = (int) TimeSpan.FromHours(\n                Parse.Double(tz.Replace(\"UTC\", string.Empty))\n            ).TotalMilliseconds;\n\n            return DateTimeZone.ForOffset(Offset.FromMilliseconds(millisecondsOffset));\n        }\n\n        private static LocalMarketHours ReadCsvHours(string[] csv, int startIndex, DayOfWeek dayOfWeek)\n        {\n            var ex_open = csv[startIndex];\n            if (ex_open == \"-\")\n            {\n                return LocalMarketHours.ClosedAllDay(dayOfWeek);\n            }\n            if (ex_open == \"+\")\n            {\n                return LocalMarketHours.OpenAllDay(dayOfWeek);\n            }\n\n            var open = csv[startIndex + 1];\n            var close = csv[startIndex + 2];\n            var ex_close = csv[startIndex + 3];\n\n            var ex_open_time = ParseHoursToTimeSpan(ex_open);\n            var open_time = ParseHoursToTimeSpan(open);\n            var close_time = ParseHoursToTimeSpan(close);\n            var ex_close_time = ParseHoursToTimeSpan(ex_close);\n\n            if (ex_open_time == TimeSpan.Zero\n                && open_time == TimeSpan.Zero\n                && close_time == TimeSpan.Zero\n                && ex_close_time == TimeSpan.Zero)\n            {\n                return LocalMarketHours.ClosedAllDay(dayOfWeek);\n            }\n\n            return new LocalMarketHours(dayOfWeek, ex_open_time, open_time, close_time, ex_close_time);\n        }\n\n        private static TimeSpan ParseHoursToTimeSpan(string ex_open)\n        {\n            return TimeSpan.FromHours(Parse.Double(ex_open));\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/MemoizingEnumerableTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class MemoizingEnumerableTests\n    {\n        [Test]\n        public void EnumeratesList()\n        {\n            var list = new List<int> {1, 2, 3, 4, 5};\n            var memoized = new MemoizingEnumerable<int>(list);\n            CollectionAssert.AreEqual(list, memoized);\n        }\n\n        [Test]\n        public void ChainedMemoizingEnumerables()\n        {\n            var list = new int [] { 1, 2, 3, 4, 5 };\n            var memoized = new MemoizingEnumerable<int>(list);\n            var memoized2 = new MemoizingEnumerable<int>(memoized);\n            var memoized3 = new MemoizingEnumerable<int>(memoized2);\n            CollectionAssert.AreEqual(list, memoized3);\n        }\n\n        [Test]\n        public void EnumeratesOnce()\n        {\n            int i = 0;\n            var enumerable = Enumerable.Range(0, 10).Select(x => i++);\n            var memoized = new MemoizingEnumerable<int>(enumerable);\n            // enumerating memoized twice shouldn't matter\n            CollectionAssert.AreEqual(memoized.ToList(), memoized.ToList());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ObjectActivatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ObjectActivatorTests\n    {\n        [Test]\n        public void IsFasterThanRawReflection()\n        {\n            int count = 100000;\n            var data = new TradeBar(DateTime.Now, Symbols.SPY, 1m, 2m, 3m, 4m, 5);\n            var stopwatch = Stopwatch.StartNew();\n            for (int i = 0; i < count; i++)\n            {\n                var clone = Clone(data);\n            }\n            stopwatch.Stop();\n            var elapsed1 = stopwatch.Elapsed;\n            Log.Trace(elapsed1.TotalMilliseconds.ToStringInvariant());\n\n            stopwatch.Reset();\n            stopwatch.Start();\n            for (int i = 0; i < count; i++)\n            {\n                var clone = ObjectActivator.Clone(data);\n            }\n            stopwatch.Stop();\n            var elapsed2 = stopwatch.Elapsed;\n            Log.Trace(elapsed2.TotalMilliseconds.ToStringInvariant());\n            Assert.Less(elapsed2, elapsed1);\n        }\n\n        [Test]\n        public void ClonesBaseDataDerivedTypes()\n        {\n            BaseData data = new IndicatorDataPoint(Symbols.SPY, DateTime.Now, 1m);\n            BaseData clone = ObjectActivator.Clone(data) as BaseData;\n            Assert.IsNotNull(clone);\n            Assert.IsInstanceOf(data.GetType(), clone);\n            Assert.AreEqual(data.Symbol, clone.Symbol);\n            Assert.AreEqual(data.Time, clone.Time);\n            Assert.AreEqual(data.Value, clone.Value);\n\n            data = new TradeBar(DateTime.Now, Symbols.SPY, 1m, 2m, 3m, 4m, 5);\n            var bar = ObjectActivator.Clone(data) as TradeBar;\n            Assert.IsNotNull(clone);\n            Assert.IsInstanceOf(data.GetType(), bar);\n            Assert.AreEqual(data.Symbol, bar.Symbol);\n            Assert.AreEqual(data.Time, bar.Time);\n            Assert.AreEqual(data.Value, bar.Value);\n            Assert.AreEqual(((TradeBar) data).Open, bar.Open);\n            Assert.AreEqual(((TradeBar) data).High, bar.High);\n            Assert.AreEqual(((TradeBar) data).Low, bar.Low);\n            Assert.AreEqual(((TradeBar) data).Close, bar.Close);\n            Assert.AreEqual(data.Price, bar.Price);\n        }\n\n        #region this was an original implementation which we'll compare against\n\n        public static object Clone(object instanceToClone)\n        {\n            if (instanceToClone == null)\n            {\n                return null;\n            }\n\n            var type = instanceToClone.GetType();\n            var factory = ObjectActivator.GetActivator(type);\n            var fields = GetFieldInfosIncludingBaseClasses(type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);\n\n            var instance = factory.Invoke(new object[0]);\n            foreach (var field in fields)\n            {\n                field.SetValue(instance, field.GetValue(instanceToClone));\n            }\n\n            return instance;\n        }\n\n        /// <summary>\n        /// Private fields in base classes aren't found in normal reflection, so we need to recurse on base types\n        /// </summary>\n        private static IEnumerable<FieldInfo> GetFieldInfosIncludingBaseClasses(Type type, BindingFlags bindingFlags)\n        {\n            FieldInfo[] fieldInfos = type.GetFields(bindingFlags);\n\n            // If this class doesn't have a base, don't waste any time\n            if (type.BaseType == typeof (object))\n            {\n                return fieldInfos;\n            }\n\n            // Otherwise, collect all types up to the furthest base class\n            var currentType = type;\n            var fieldComparer = new FieldInfoComparer();\n            var fieldInfoList = new HashSet<FieldInfo>(fieldInfos, fieldComparer);\n            while (currentType != typeof (object) && currentType != null)\n            {\n                fieldInfos = currentType.GetFields(bindingFlags);\n                fieldInfoList.UnionWith(fieldInfos);\n                currentType = currentType.BaseType;\n            }\n            return fieldInfoList;\n        }\n\n        private class FieldInfoComparer : IEqualityComparer<FieldInfo>\n        {\n            public bool Equals(FieldInfo x, FieldInfo y)\n            {\n                return x.DeclaringType == y.DeclaringType && x.Name == y.Name;\n            }\n\n            public int GetHashCode(FieldInfo obj)\n            {\n                return obj.Name.GetHashCode() ^ obj.DeclaringType.GetHashCode();\n            }\n        }\n\n        #endregion\n\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ObjectToListJsonConverterTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class SingleValueListConverterTests\n    {\n        private const string Data = \"some data\";\n\n        private static readonly WellFormedContainer WellFormedInstance = new WellFormedContainer\n        {\n            ComplexTypes = new List<ComplexType>\n            {\n                new ComplexType\n                {\n                    ID = 1,\n                    Data = Data\n                }\n            }\n        };\n\n        private static readonly PoorlyFormedContainer PoorlyFormedInstance = new PoorlyFormedContainer\n        {\n            ComplexTypes = new ComplexType\n            {\n                ID = 1,\n                Data = Data\n            }\n        };\n\n        private readonly static string ListJson = JsonConvert.SerializeObject(WellFormedInstance);\n        private readonly static string ObjectJson = JsonConvert.SerializeObject(PoorlyFormedInstance);\n\n        [Test]\n        public void DeserializesList()\n        {\n            var converted = JsonConvert.DeserializeObject(ListJson, typeof(WellFormedContainer));\n            Assert.IsInstanceOf<WellFormedContainer>(converted);\n            var instance = (WellFormedContainer)converted;\n            Assert.AreEqual(1, instance.ComplexTypes.Count);\n            Assert.AreEqual(1, instance.ComplexTypes[0].ID);\n            Assert.AreEqual(Data, instance.ComplexTypes[0].Data);\n        }\n\n        [Test]\n        public void DeserializesSingleValue()\n        {\n            var converted = JsonConvert.DeserializeObject(ObjectJson, typeof(WellFormedContainer));\n            Assert.IsInstanceOf<WellFormedContainer>(converted);\n            var instance = (WellFormedContainer)converted;\n            Assert.AreEqual(1, instance.ComplexTypes.Count);\n            Assert.AreEqual(1, instance.ComplexTypes[0].ID);\n            Assert.AreEqual(Data, instance.ComplexTypes[0].Data);\n        }\n\n        [Test]\n        public void SerializesListWithOneValue()\n        {\n            var serialized = JsonConvert.SerializeObject(WellFormedInstance);\n            Assert.AreEqual(ListJson, serialized);\n        }\n\n        class WellFormedContainer\n        {\n            [JsonConverter(typeof(SingleValueListConverter<ComplexType>))]\n            public List<ComplexType> ComplexTypes;\n        }\n\n        class PoorlyFormedContainer\n        {\n            public ComplexType ComplexTypes;\n        }\n\n        class ComplexType\n        {\n            public int ID;\n            public string Data;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/PythonUtilTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class PythonUtilTests\n    {\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ToActionFailure(bool typeAnnotations)\n        {\n            using (Py.GIL())\n            {\n                var action = PyModule.FromString(\"ToAction\", @\"\nfrom AlgorithmImports import *\n\ndef Test1():\n    pass\ndef Test2() -> None:\n    pass\n\");\n                var testMethod = action.GetAttr(typeAnnotations ? \"Test2\" : \"Test1\");\n                var result = PythonUtil.ToAction<SecurityType>(testMethod);\n                Assert.IsNull(result);\n            }\n        }\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ToActionSuccess(bool typeAnnotations)\n        {\n            using (Py.GIL())\n            {\n                var action = PyModule.FromString(\"ToAction\", @\"\nfrom AlgorithmImports import *\n\ndef Test1(securityType):\n    if securityType != SecurityType.Equity:\n        raise ValueError('Unexpected SecurityType!')\n\ndef Test2(securityType: SecurityType) -> None:\n    if securityType != SecurityType.Equity:\n        raise ValueError('Unexpected SecurityType!')\n\");\n                var testMethod = action.GetAttr(typeAnnotations ? \"Test2\" : \"Test1\");\n                var result = PythonUtil.ToAction<SecurityType>(testMethod);\n\n                Assert.IsNotNull(action);\n                Assert.DoesNotThrow(() => result(SecurityType.Equity));\n            }\n        }\n\n        [Test]\n        public void ConvertToSymbolsTest()\n        {\n            var expected = new List<Symbol>\n            {\n                Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"BAC\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA)\n            };\n\n            using (Py.GIL())\n            {\n                // Test Python String\n                using var pyString = new PyString(\"AIG\");\n                var test1 = PythonUtil.ConvertToSymbols(pyString);\n                Assert.IsTrue(typeof(List<Symbol>) == test1.GetType());\n                Assert.AreEqual(expected.FirstOrDefault(), test1.FirstOrDefault());\n\n                // Test Python List of Strings\n                var list = (new List<string> { \"AIG\", \"BAC\", \"IBM\", \"GOOG\" }).ToPyList();\n                var test2 = PythonUtil.ConvertToSymbols(list);\n                Assert.IsTrue(typeof(List<Symbol>) == test2.GetType());\n                Assert.IsTrue(test2.SequenceEqual(expected));\n\n                // Test Python Symbol\n                var test3 = PythonUtil.ConvertToSymbols(expected.FirstOrDefault().ToPython());\n                Assert.IsTrue(typeof(List<Symbol>) == test3.GetType());\n                Assert.AreEqual(expected.FirstOrDefault(), test3.FirstOrDefault());\n\n                // Test Python List of Symbols\n                var test4 = PythonUtil.ConvertToSymbols(expected.ToPyList());\n                Assert.IsTrue(typeof(List<Symbol>) == test4.GetType());\n                Assert.IsTrue(test4.SequenceEqual(expected));\n            }\n        }\n\n        [TestCase(\"SyntaxError : invalid syntax (BasicTemplateAlgorithm.py, line 33)\", \"SyntaxError : invalid syntax (BasicTemplateAlgorithm.py, line 32)\", 1)]\n        [TestCase(\"SyntaxError : invalid syntax (BasicTemplateAlgorithm.py, line 1)\", \"SyntaxError : invalid syntax (BasicTemplateAlgorithm.py, line 32)\", -31)]\n        [TestCase(\"NameError : name 's' is not defined\", \"NameError : name 's' is not defined\", -31)]\n        public void ParsesPythonExceptionMessage(string expected, string original, int shift)\n        {\n            var originalShiftValue = PythonUtil.ExceptionLineShift;\n            PythonUtil.ExceptionLineShift = shift;\n            var result = PythonUtil.PythonExceptionMessageParser(original);\n\n            PythonUtil.ExceptionLineShift = originalShiftValue;\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(@\"\n  at Initialize\n    s\n===\n in BasicTemplateAlgorithm.py: line 20\n\",\n            @\"  File \"\"D:/QuantConnect/MyLean/Lean/Algorithm.Python\\BasicTemplateAlgorithm.py\"\", line 30, in Initialize\n    s\n===\n   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.InvokeMethod(String name, PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)\n   at CallSite.Target(Closure , CallSite , Object )\n   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0](CallSite site, T0 arg0)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.Initialize() in D:\\QuantConnect\\MyLean\\Lean\\AlgorithmFactory\\Python\\Wrappers\\AlgorithmPythonWrapper.cs:line 528\n   at QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.<>c__DisplayClass27_0.<Setup>b__0() in D:\\QuantConnect\\MyLean\\Lean\\Engine\\Setup\\BacktestingSetupHandler.cs:line 186\",\n            -10)]\n        [TestCase(@\"\n  at Initialize\n    self.SetEndDate(201, 1)\n===\n in BasicTemplateAlgorithm.py: line 40\n\",\n            @\"  File \"\"D:/QuantConnect/MyLean/Lean/Algorithm.Python\\BasicTemplateAlgorithm.py\"\", line 30, in Initialize\n    self.SetEndDate(201, 1)\n===\n   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.InvokeMethod(String name, PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)\n   at CallSite.Target(Closure , CallSite , Object )\n   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0](CallSite site, T0 arg0)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.Initialize() in D:\\QuantConnect\\MyLean\\Lean\\AlgorithmFactory\\Python\\Wrappers\\AlgorithmPythonWrapper.cs:line 528\n   at QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.<>c__DisplayClass27_0.<Setup>b__0() in D:\\QuantConnect\\MyLean\\Lean\\Engine\\Setup\\BacktestingSetupHandler.cs:line 186\",\n            10)]\n        [TestCase(@\"\n  at <module>\n    class BasicTemplateAlgorithm(QCAlgorithm):\n in BasicTemplateAlgorithm.py: line 23\n\",\n            @\"  File \"\"D:/QuantConnect/MyLean/Lean/Algorithm.Python\\BasicTemplateAlgorithm.py\"\", line 23, in <module>\n    class BasicTemplateAlgorithm(QCAlgorithm):\n   at Python.Runtime.PythonException.ThrowLastAsClrException()\n   at Python.Runtime.NewReferenceExtensions.BorrowOrThrow(NewReference& reference)\n   at Python.Runtime.PyModule.Import(String name)\n   at Python.Runtime.Py.Import(String name)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper..ctor(String moduleName) in D:\\QuantConnect\\MyLean\\Lean\\AlgorithmFactory\\Python\\Wrappers\\AlgorithmPythonWrapper.cs:line 74\",\n            0)]\n        [TestCase(@\"\n  at wrapped_function\n    raise KeyError(f\"\"No key found for either mapped or original key. Mapped Key: {mKey}; Original Key: {oKey}\"\")\n in PandasMapper.py: line 76\n  at HistoryCall\n    history.loc['QQQ']   # <--- raises Key Error\n in TestAlgorithm.py: line 27\n  at OnData\n    self.HistoryCall()\n in TestAlgorithm.py: line 23\n\",\n            @\"  File \"\"/home/user/QuantConnect/Lean/Launcher/bin/Debug/PandasMapper.py\"\", line 76, in wrapped_function\n    raise KeyError(f\"\"No key found for either mapped or original key. Mapped Key: {mKey}; Original Key: {oKey}\"\")\n  File \"\"/home/user/QuantConnect/Lean/Algorithm.Python/TestAlgorithm.py\"\", line 27, in HistoryCall\n    history.loc['QQQ']   # <--- raises Key Error\n  File \"\"/home/user/QuantConnect/Lean/Algorithm.Python/TestAlgorithm.py\"\", line 23, in OnData\n    self.HistoryCall()\n   at Python.Runtime.PythonException.ThrowLastAsClrException()\n   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.TryInvoke(InvokeBinder binder, Object[] args, Object& result)\n   at CallSite.Target(Closure , CallSite , Object , PythonSlice )\n   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in /home/user/QuantConnect/Lean/AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs:line 587\n   at QuantConnect.Lean.Engine.AlgorithmManager.Run(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer synchronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ILeanManager leanManager, IAlphaHandler alphas, CancellationToken token) in /home/user/QuantConnect/Lean/Engine/AlgorithmManager.cs:line 523\",\n            0)]\n        [TestCase(@\"\n  at OnData\n    raise ValueError(\"\"\"\"ASD\"\"\"\")\n in BasicTemplateAlgorithm.py: line 43\n\",\n            @\"  File \"\"D:\\QuantConnect/MyLean/Lean/Algorithm.Python\\BasicTemplateAlgorithm.py\"\", line 43, in OnData\n    raise ValueError(\"\"\"\"ASD\"\"\"\")\n   at Python.Runtime.PythonException.ThrowLastAsClrException() in D:\\QuantConnect\\MyLean\\pythonnet\\src\\runtime\\PythonException.cs:line 52\n   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw) in D:\\QuantConnect\\MyLean\\pythonnet\\src\\runtime\\PythonTypes\\PyObject.cs:line 837\n   at Python.Runtime.PyObject.TryInvoke(InvokeBinder binder, Object[] args, Object& result) in D:\\QuantConnect\\MyLean\\pythonnet\\src\\runtime\\PythonTypes\\PyObject.cs:line 1320\n   at CallSite.Target(Closure , CallSite , Object , PythonSlice )\n   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in D:\\QuantConnect\\MyLean\\Lean\\AlgorithmFactory\\Python\\Wrappers\\AlgorithmPythonWrapper.cs:line 693\n   at QuantConnect.Lean.Engine.AlgorithmManager.Run(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer synchronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ILeanManager leanManager, CancellationToken token) in D:\\QuantConnect\\MyLean\\Lean\\Engine\\AlgorithmManager.cs:line 526\",\n            0)]\n        [TestCase(@\"\n  at on_data\n    self.set_holdings(\"\"SPY\"\", 1 / None)\n                             ~~^~~~~~\n in BasicTemplateAlgorithm.py: line 46\n\",\n            @\" File \"\"C:\\Users/user/QuantConnect/Lean/Algorithm.Python\\BasicTemplateAlgorithm.py\"\", line 46, in on_data\n    self.set_holdings(\"\"SPY\"\", 1 / None)\n                             ~~^~~~~~\n   at Python.Runtime.PythonException.ThrowLastAsClrException()\n   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw)\n   at Python.Runtime.PyObject.TryInvoke(InvokeBinder binder, Object[] args, Object& result)\n   at CallSite.Target(Closure , CallSite , Object , Slice )\n   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)\n   at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in C:\\Users\\user\\QuantConnect\\Lean\\AlgorithmFactory\\Python\\Wrappers\\AlgorithmPythonWrapper.cs:line 759\n   at QuantConnect.Lean.Engine.AlgorithmManager.Run(AlgorithmNodePacket job, IAlgorithm algorithm, ISynchronizer synchronizer, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ILeanManager leanManager, CancellationToken token) in C:\\Users\\user\\QuantConnect\\Lean\\Engine\\AlgorithmManager.cs:line 524\",\n            0)]\n        public void ParsesPythonExceptionStackTrace(string expected, string original, int shift)\n        {\n            var originalShiftValue = PythonUtil.ExceptionLineShift;\n            PythonUtil.ExceptionLineShift = shift;\n            var result = PythonUtil.PythonExceptionStackParser(original);\n\n            PythonUtil.ExceptionLineShift = originalShiftValue;\n            Assert.AreEqual(expected, result);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void BothInheritedAndNonInheritedClassesWork(bool inherited)\n        {\n            using (Py.GIL())\n            {\n                string pythonCode = @\"\nfrom AlgorithmImports import *\n\nclass PurePythonBuyingPowerModel:\n    def GetMaximumOrderQuantityForTargetBuyingPower(self, parameters):\n        return GetMaximumOrderQuantityResult(100)\n    \n    def GetMaximumOrderQuantityForDeltaBuyingPower(self, parameters):\n        return GetMaximumOrderQuantityResult(200)\n    \n    def HasSufficientBuyingPowerForOrder(self, parameters):\n        return HasSufficientBuyingPowerForOrderResult(True)\n    \n    def GetReservedBuyingPowerForPosition(self, parameters):\n        return ReservedBuyingPowerForPosition(0)\n    \n    def GetLeverage(self, security):\n        return 1.0\n    \n    def GetBuyingPower(self, parameters):\n        return BuyingPower(1000)\n    \n    def SetLeverage(self, security, leverage):\n        pass\n    \n    def GetMaintenanceMargin(self, parameters):\n        return None\n    \n    def GetInitialMarginRequirement(self, parameters):\n        return None\n    \n    def GetInitialMarginRequiredForOrder(self, parameters):\n        return None\n\nclass InheritedBuyingPowerModel(SecurityMarginModel):\n    def GetMaximumOrderQuantityForTargetBuyingPower(self, parameters):\n        return GetMaximumOrderQuantityResult(200)\n\";\n                var module = PyModule.FromString(\"TestModels\", pythonCode);\n                PyObject pyObject = null;\n                if (inherited)\n                {\n                    pyObject = module.GetAttr(\"InheritedBuyingPowerModel\").Invoke();\n                }\n                else\n                {\n                    pyObject = module.GetAttr(\"PurePythonBuyingPowerModel\").Invoke();\n                }\n\n                var result = PythonUtil.CreateInstanceOrWrapper<IBuyingPowerModel>(\n                    pyObject,\n                    py => new BuyingPowerModelPythonWrapper(py)\n                );\n\n                Assert.IsNotNull(result);\n                Assert.IsInstanceOf<BuyingPowerModelPythonWrapper>(result);\n            }\n        }\n\n        [Test]\n        public void MissingRequiredMethodThrowsException()\n        {\n            using (Py.GIL())\n            {\n                string pythonCode = @\"\nclass IncompleteBuyingPowerModel:\n    def GetMaximumOrderQuantityForTargetBuyingPower(self, parameters):\n        return GetMaximumOrderQuantityResult(100)\n    \n    def HasSufficientBuyingPowerForOrder(self, parameters):\n        return HasSufficientBuyingPowerForOrderResult(True)\n\";\n                var module = PyModule.FromString(\"TestModels\", pythonCode);\n                var purePython = module.GetAttr(\"IncompleteBuyingPowerModel\").Invoke();\n\n                Assert.Throws<NotImplementedException>(() =>\n                    PythonUtil.CreateInstanceOrWrapper<IBuyingPowerModel>(purePython, py => new BuyingPowerModelPythonWrapper(py)));\n            }\n        }\n\n        [Test]\n        public void PureCSharpClassReturnsDirectInstanceWithoutWrapper()\n        {\n            using (Py.GIL())\n            {\n                // Create pure C# instance\n                var csharpObject = new BuyingPowerModel();\n                var pyObject = csharpObject.ToPython();\n\n                // Should return the same C# instance, not a wrapper\n                var result = PythonUtil.CreateInstanceOrWrapper<IBuyingPowerModel>(\n                    pyObject,\n                    py => new BuyingPowerModelPythonWrapper(py)\n                );\n\n                Assert.IsNotNull(result);\n                Assert.AreSame(csharpObject, result);\n                Assert.IsNotInstanceOf<BuyingPowerModelPythonWrapper>(result);\n                Assert.IsInstanceOf<BuyingPowerModel>(result);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/RateGateTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing System.Diagnostics;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class RateGateTests\n    {\n        [TestCase(5)]\n        [TestCase(10)]\n        public void RateGateWithTimeout(int count)\n        {\n            var rate = TimeSpan.FromMilliseconds(500);\n            using var gate  = new RateGate(1, rate);\n            var timer = Stopwatch.StartNew();\n\n            for (var i = 0; i <= count; i++)\n            {\n                Assert.IsTrue(gate.WaitToProceed(TimeSpan.FromSeconds(5)));\n            }\n\n            timer.Stop();\n\n            var elapsed = timer.Elapsed;\n            var expectedDelay = rate * count;\n            var lowerBound = expectedDelay - expectedDelay * 0.30;\n            var upperBound = expectedDelay + expectedDelay * 0.30;\n\n            Assert.GreaterOrEqual(elapsed, lowerBound, $\"RateGate was early: {lowerBound - elapsed}\");\n            Assert.LessOrEqual(elapsed, upperBound, $\"RateGate was late: {elapsed - upperBound}\");\n        }\n\n        [Test]\n        public void RateGate_ShouldSkipBecauseOfTimeout()\n        {\n            using var gate = new RateGate(1, TimeSpan.FromSeconds(5));\n            var timer = Stopwatch.StartNew();\n\n            Assert.IsTrue(gate.WaitToProceed(-1));\n            Assert.IsFalse(gate.WaitToProceed(0));\n            Assert.IsTrue(gate.IsRateLimited);\n\n            timer.Stop();\n\n            Assert.LessOrEqual(timer.Elapsed, TimeSpan.FromSeconds(5));\n            timer.Restart();\n            Assert.IsTrue(gate.WaitToProceed(-1));\n            timer.Stop();\n\n            Assert.LessOrEqual(timer.Elapsed, TimeSpan.FromSeconds(10));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/RateLimit/FixedIntervalRefillStrategyTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Tests.Common.Util.RateLimit\n{\n    [TestFixture]\n    public class FixedIntervalRefillStrategyTests\n    {\n        [Test]\n        public void DoesNotRefillUntilIntervalHasElapsed()\n        {\n            var time = new DateTime(2000, 01, 01);\n            var timeProvider = new ManualTimeProvider(time);\n\n            const int refillAmount = 1;\n            var refillInterval = TimeSpan.FromMinutes(1);\n            var strategy = new FixedIntervalRefillStrategy(timeProvider, refillAmount, refillInterval);\n\n            var refill = strategy.Refill();\n            Assert.AreEqual(0, refill);\n\n            timeProvider.Advance(refillInterval.Subtract(TimeSpan.FromTicks(1)));\n            refill = strategy.Refill();\n            Assert.AreEqual(0, refill);\n\n            timeProvider.Advance(TimeSpan.FromTicks(1));\n            refill = strategy.Refill();\n            Assert.AreEqual(refillAmount, refill);\n        }\n\n        [Test]\n        public void ComputesRefillsBasedOnNumberOfPassedIntervals()\n        {\n            var time = new DateTime(2000, 01, 01);\n            var timeProvider = new ManualTimeProvider(time);\n\n            const int refillAmount = 1;\n            var refillInterval = TimeSpan.FromMinutes(1);\n            var strategy = new FixedIntervalRefillStrategy(timeProvider, refillAmount, refillInterval);\n\n            var intervals = 3.5;\n            var advance = TimeSpan.FromTicks((long) (refillInterval.Ticks * intervals));\n            timeProvider.Advance(advance);\n\n            var refill = strategy.Refill();\n            var expected = (int) intervals * refillAmount;\n            Assert.AreEqual(expected, refill);\n\n            timeProvider.Advance(advance);\n            refill = strategy.Refill();\n            expected = (int) (intervals * 2) * refillAmount - expected;\n            Assert.AreEqual(expected, refill);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Common/Util/RateLimit/LeakyBucketTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Tests.Common.Util.RateLimit\n{\n    [TestFixture]\n    public class LeakyBucketTests\n    {\n        [Test]\n        public void BucketIsInitializedWithAvailableEqualToCapacity()\n        {\n            var bucket = new LeakyBucket(10, 1, Time.OneSecond);\n            Assert.AreEqual(10, bucket.AvailableTokens);\n        }\n\n        [Test]\n        public void ConsumeBlocksUntilTokensAreAvailable()\n        {\n            var time = new DateTime(2000, 01, 01);\n            var timeProvider = new ManualTimeProvider(time);\n\n            const int refillAmount = 1;\n            var refillInterval = TimeSpan.FromMinutes(1);\n            var refillStrategy = new FixedIntervalRefillStrategy(timeProvider, refillAmount, refillInterval);\n\n            // using spin wait strategy to ensure we update AvailableTokens as quickly as possible\n            var sleepStrategy = new BusyWaitSleepStrategy();\n\n            const int capacity = 10;\n            var bucket = new LeakyBucket(capacity, sleepStrategy, refillStrategy, timeProvider);\n\n            // first remove half the capacity\n            bucket.Consume(capacity/2);\n\n            // we've consumed half of the available tokens\n            Assert.AreEqual(capacity/2, bucket.AvailableTokens);\n\n            using var taskStarted = new ManualResetEvent(false);\n            using var bucketConsumeCompleted = new ManualResetEvent(false);\n            Task.Run(() =>\n            {\n                taskStarted.Set();\n\n                // this will block until time advances\n                bucket.Consume(capacity);\n                bucketConsumeCompleted.Set();\n            });\n\n            taskStarted.WaitOne();\n\n            // each loop we'll advance one refill increment and when the loop finishes\n            // the bucket's consume operation will succeed\n            var initialAmount = bucket.AvailableTokens;\n\n            for (int i = 0; i < 5; i++)\n            {\n                timeProvider.Advance(refillInterval);\n\n                // on the last loop, the bucket will consume all ten\n                if (i != 4)\n                {\n                    var count = 0;\n                    while (++count < 100 && (initialAmount + (1 + i) * refillAmount) != bucket.AvailableTokens)\n                    {\n                        Thread.Sleep(1);\n                    }\n\n                    // each time we advance the number of available tokens will increment by the refill amount\n                    Assert.AreEqual(initialAmount + (1 + i) * refillAmount, bucket.AvailableTokens,\n                        $\"CurrentTime: {timeProvider.GetUtcNow():O}: Iteration: {i}\"\n                    );\n                }\n            }\n\n            // now that we've advanced, bucket consumption should have completed\n            // we provide for a small timeout to support non-multi-threaded machines\n            Assert.IsTrue(bucketConsumeCompleted.WaitOne(1000), \"Timeout waiting for consumer\");\n            Assert.AreEqual(0, bucket.AvailableTokens, $\"There are still available tokens {bucket.AvailableTokens}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ReaderWriterLockSlimExtensionsTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ReaderWriterLockSlimExtensionsTests\n    {\n        [Test]\n        public void EntersReadLock()\n        {\n            var slim = new ReaderWriterLockSlim();\n\n            var token = slim.Read();\n\n            Assert.IsTrue(slim.IsReadLockHeld);\n            slim.ExitReadLock();\n\n            slim.Dispose();\n        }\n        [Test]\n        public void ExitsReadLock()\n        {\n            var slim = new ReaderWriterLockSlim();\n\n            var token = slim.Read();\n            token.Dispose();\n            Assert.IsFalse(slim.IsReadLockHeld);\n\n            slim.Dispose();\n        }\n\n        [Test]\n        public void EntersWriteLock()\n        {\n            var slim = new ReaderWriterLockSlim();\n\n            var token = slim.Write();\n            Assert.IsTrue(slim.IsWriteLockHeld);\n            slim.ExitWriteLock();\n\n            slim.Dispose();\n        }\n        [Test]\n        public void ExitsWriteLock()\n        {\n            var slim = new ReaderWriterLockSlim();\n\n            var token = slim.Read();\n            token.Dispose();\n            Assert.IsFalse(slim.IsReadLockHeld);\n\n            slim.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/SeriesJsonConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Drawing;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class SeriesJsonConverterTests\n    {\n        [TestCase(null, null, \"Tooltip template\")]\n        [TestCase(87, null, \"Tooltip template\")]\n        [TestCase(null, \"Index Name\", \"Tooltip template\")]\n        [TestCase(87, \"Index Name\", \"Tooltip template\")]\n        [TestCase(null,null, null)]\n        [TestCase(87, null, null)]\n        [TestCase(null, \"Index Name\", null)]\n        [TestCase(87, \"Index Name\", null)]\n        public void SerializeDeserializeReturnsSameSeriesValue(int? zIndex, string indexName, string toolTip)\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var series = new Series(\"Pepito Grillo\", SeriesType.Bar, \"%\", Color.Blue, ScatterMarkerSymbol.Diamond) { ZIndex = zIndex, Index = 6, IndexName = indexName, Tooltip = toolTip };\n            series.AddPoint(date, 1);\n            series.AddPoint(date.AddSeconds(1), 2);\n\n            var serializedSeries = JsonConvert.SerializeObject(series);\n            var result = (Series) JsonConvert.DeserializeObject(serializedSeries, typeof(Series));\n\n            Assert.AreEqual(series.Values.Count, result.Values.Count);\n            var values = series.GetValues<ChartPoint>().ToList();\n            var resultValues = result.GetValues<ChartPoint>().ToList();\n            for (var i = 0; i < values.Count; i++)\n            {\n                Assert.AreEqual(values[i].x, resultValues[i].x);\n                Assert.AreEqual(values[i].y, resultValues[i].y);\n            }\n            Assert.AreEqual(series.Tooltip, result.Tooltip);\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n            Assert.AreEqual(series.ZIndex, result.ZIndex);\n            Assert.AreEqual(series.Index, result.Index);\n            Assert.AreEqual(series.IndexName, result.IndexName);\n        }\n\n        [Test]\n        public void SerializedPieSeriesWillOnlyHaveOneValue()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var date2 = date.AddSeconds(1);\n            var series = new Series(\"Pepito Grillo\", SeriesType.Pie, \"$\", Color.Empty, ScatterMarkerSymbol.Diamond);\n            series.AddPoint(date, 1);\n            series.AddPoint(date2, 2);\n\n            var serializedSeries = JsonConvert.SerializeObject(series);\n            var result = (Series)JsonConvert.DeserializeObject(serializedSeries, typeof(Series));\n\n            var expectedX = Convert.ToInt64(Time.DateTimeToUnixTimeStamp(date2)); // expect last dateTime (date2)\n            Assert.AreEqual(1, result.Values.Count); // expect only one value\n            Assert.AreEqual(expectedX, ((ChartPoint)result.Values[0]).x);\n            Assert.AreEqual(3, ((ChartPoint)result.Values[0]).y); // expect sum of values (1 + 2)\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n        }\n\n        [TestCase(null, null, \"Tooltip template\")]\n        [TestCase(87, null, \"Tooltip template\")]\n        [TestCase(null, \"Index Name\", \"Tooltip template\")]\n        [TestCase(87, \"Index Name\", \"Tooltip template\")]\n        [TestCase(null, null, null)]\n        [TestCase(87, null, null)]\n        [TestCase(null, \"Index Name\", null)]\n        [TestCase(87, \"Index Name\", null)]\n        public void SerializeDeserializeReturnsSameCandlestickSeriesValue(int? zIndex, string indexName, string toolTip)\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var series = new CandlestickSeries(\"Pepito Grillo\") { ZIndex = zIndex, IndexName = indexName, Index = 7, Tooltip = toolTip };\n            series.AddPoint(date, 100, 110, 80, 90);\n            series.AddPoint(date.AddSeconds(1), 105, 115, 85, 95);\n\n            var serializedSeries = JsonConvert.SerializeObject(series);\n            var result = (CandlestickSeries)JsonConvert.DeserializeObject(serializedSeries, typeof(CandlestickSeries));\n\n            Assert.AreEqual(series.Values.Count, result.Values.Count);\n            var values = series.GetValues<Candlestick>().ToList();\n            var resultValues = result.GetValues<Candlestick>().ToList();\n            for (var i = 0; i < values.Count; i++)\n            {\n                Assert.AreEqual(values[i].Time, resultValues[i].Time);\n                Assert.AreEqual(values[i].Open, resultValues[i].Open);\n                Assert.AreEqual(values[i].High, resultValues[i].High);\n                Assert.AreEqual(values[i].Low, resultValues[i].Low);\n                Assert.AreEqual(values[i].Close, resultValues[i].Close);\n            }\n            Assert.AreEqual(series.Tooltip, result.Tooltip);\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.ZIndex, result.ZIndex);\n            Assert.AreEqual(series.Index, result.Index);\n            Assert.AreEqual(series.IndexName, result.IndexName);\n        }\n\n        [Test]\n        public void DeserializeChartPointObject()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var date2 = date.AddSeconds(1);\n            var series = new Series(\"Pepito Grillo\", SeriesType.Bar, \"$\", Color.Empty, ScatterMarkerSymbol.Diamond);\n            series.AddPoint(date, 1);\n            series.AddPoint(new ChartPoint(date2, null));\n\n            var result = (Series)JsonConvert.DeserializeObject(\"{\\\"Name\\\":\\\"Pepito Grillo\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":3,\" +\n                \"\\\"Values\\\":[ {\\\"x\\\":2524611661,\\\"y\\\":1.0},{\\\"x\\\":2524611662,\\\"y\\\":null}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"diamond\\\"}\", typeof(Series));\n\n            Assert.AreEqual(2, result.Values.Count);\n            Assert.AreEqual(date, ((ChartPoint)result.Values[0]).Time);\n            Assert.AreEqual(1, ((ChartPoint)result.Values[0]).y);\n            Assert.AreEqual(date2, ((ChartPoint)result.Values[1]).Time);\n            Assert.AreEqual(null, ((ChartPoint)result.Values[1]).y);\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n        }\n\n        [Test]\n        public void DeserializeUpperCaseChartPoint()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var date2 = date.AddSeconds(1);\n            var series = new Series(\"Pepito Grillo\", SeriesType.Bar, \"$\", Color.Empty, ScatterMarkerSymbol.Diamond);\n            series.AddPoint(date, 1);\n            series.AddPoint(new ChartPoint(date2, null));\n\n            var result = (Series)JsonConvert.DeserializeObject(\"{\\\"Name\\\":\\\"Pepito Grillo\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":3,\" +\n                \"\\\"Values\\\":[[2524611661,1.0],[2524611662,null]],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"diamond\\\"}\", typeof(Series));\n\n            Assert.AreEqual(2, result.Values.Count);\n            Assert.AreEqual(date, ((ChartPoint)result.Values[0]).Time);\n            Assert.AreEqual(1, ((ChartPoint)result.Values[0]).y);\n            Assert.AreEqual(date2, ((ChartPoint)result.Values[1]).Time);\n            Assert.AreEqual(null, ((ChartPoint)result.Values[1]).y);\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n        }\n\n        [Test]\n        public void NullChartPointValue()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var date2 = date.AddSeconds(1);\n            var series = new Series(\"Pepito Grillo\", SeriesType.Bar, \"$\", Color.Empty, ScatterMarkerSymbol.Diamond);\n            series.AddPoint(date, 1);\n            series.AddPoint(new ChartPoint(date2, null));\n\n            var serializedSeries = JsonConvert.SerializeObject(series);\n            var result = (Series)JsonConvert.DeserializeObject(serializedSeries, typeof(Series));\n\n            Assert.AreEqual(\"{\\\"name\\\":\\\"Pepito Grillo\\\",\\\"unit\\\":\\\"$\\\",\\\"index\\\":0,\\\"seriesType\\\":3,\" +\n                \"\\\"values\\\":[[2524611661,1.0],[2524611662,null]],\\\"color\\\":\\\"\\\",\\\"scatterMarkerSymbol\\\":\\\"diamond\\\"}\", serializedSeries);\n            Assert.AreEqual(2, result.Values.Count);\n            Assert.AreEqual(date, ((ChartPoint)result.Values[0]).Time);\n            Assert.AreEqual(1, ((ChartPoint)result.Values[0]).y);\n            Assert.AreEqual(date2, ((ChartPoint)result.Values[1]).Time);\n            Assert.AreEqual(null, ((ChartPoint)result.Values[1]).y);\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n            Assert.AreEqual(series.Color.ToArgb(), result.Color.ToArgb());\n            Assert.AreEqual(series.ScatterMarkerSymbol, result.ScatterMarkerSymbol);\n        }\n\n        [Test]\n        public void DeserializeUpperCaseCandleStick()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var series = new CandlestickSeries(\"Pepito Grillo\");\n            series.AddPoint(date, 100, 110, 80, 90);\n            series.AddPoint(new Candlestick(date.AddSeconds(1), null, null, null, null));\n\n            var result = (CandlestickSeries)JsonConvert.DeserializeObject(\"{\\\"Name\\\":\\\"Pepito Grillo\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":2,\" +\n                \"\\\"Values\\\":[[2524611661,100.0,110.0,80.0,90.0],[2524611662,null,null,null,null]]}\", typeof(CandlestickSeries));\n\n            Assert.AreEqual(series.Values.Count, result.Values.Count);\n            var values = series.GetValues<Candlestick>().ToList();\n            var resultValues = result.GetValues<Candlestick>().ToList();\n            for (var i = 0; i < values.Count; i++)\n            {\n                Assert.AreEqual(values[i].Time, resultValues[i].Time);\n                Assert.AreEqual(values[i].Open, resultValues[i].Open);\n                Assert.AreEqual(values[i].High, resultValues[i].High);\n                Assert.AreEqual(values[i].Low, resultValues[i].Low);\n                Assert.AreEqual(values[i].Close, resultValues[i].Close);\n            }\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n        }\n\n        [Test]\n        public void NullCandleStickValue()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var series = new CandlestickSeries(\"Pepito Grillo\");\n            series.AddPoint(date, 100, 110, 80, 90);\n            series.AddPoint(new Candlestick(date.AddSeconds(1), null, null, null, null));\n\n            var serializedSeries = JsonConvert.SerializeObject(series);\n            var result = (CandlestickSeries)JsonConvert.DeserializeObject(serializedSeries, typeof(CandlestickSeries));\n\n            Assert.AreEqual(\"{\\\"name\\\":\\\"Pepito Grillo\\\",\\\"unit\\\":\\\"$\\\",\\\"index\\\":0,\\\"seriesType\\\":2,\\\"values\\\":[[2524611661,100.0,110.0,80.0,90.0],[2524611662,null,null,null,null]]}\", serializedSeries);\n            Assert.AreEqual(series.Values.Count, result.Values.Count);\n            var values = series.GetValues<Candlestick>().ToList();\n            var resultValues = result.GetValues<Candlestick>().ToList();\n            for (var i = 0; i < values.Count; i++)\n            {\n                Assert.AreEqual(values[i].Time, resultValues[i].Time);\n                Assert.AreEqual(values[i].Open, resultValues[i].Open);\n                Assert.AreEqual(values[i].High, resultValues[i].High);\n                Assert.AreEqual(values[i].Low, resultValues[i].Low);\n                Assert.AreEqual(values[i].Close, resultValues[i].Close);\n            }\n            Assert.AreEqual(series.Name, result.Name);\n            Assert.AreEqual(series.Unit, result.Unit);\n            Assert.AreEqual(series.SeriesType, result.SeriesType);\n        }\n\n        [Test]\n        public void HandlesAnyBaseSeries()\n        {\n            var date = new DateTime(2050, 1, 1, 1, 1, 1);\n            var testSeries = new TestSeries();\n            testSeries.AddPoint(new TestPoint { Time = date, Property = \"Pepe\" });\n\n            var serializedSeries = JsonConvert.SerializeObject(testSeries);\n\n            Assert.AreEqual(\"{\\\"name\\\":null,\\\"unit\\\":\\\"$\\\",\\\"index\\\":0,\\\"seriesType\\\":0,\\\"values\\\":[{\\\"time\\\":\\\"2050-01-01T01:01:01\\\",\\\"property\\\":\\\"Pepe\\\"}]}\", serializedSeries);\n        }\n\n        private class TestSeries : BaseSeries\n        {\n            public override BaseSeries Clone(bool empty = false)\n            {\n                var series = new TestSeries();\n                if (!empty)\n                {\n                    series.Values = CloneValues();\n                }\n                return series;\n            }\n\n            public override ISeriesPoint ConsolidateChartPoints()\n            {\n                throw new NotImplementedException();\n            }\n            public override void AddPoint(DateTime time, List<decimal> values)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private class TestPoint : ISeriesPoint\n        {\n            [JsonProperty(\"time\")]\n            public DateTime Time { get; set; }\n            [JsonProperty(\"property\")]\n            public string Property { get; set;}\n\n            public ISeriesPoint Clone()\n            {\n                return new TestPoint { Property = Property, Time = Time };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/StreamReaderEnumerableTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class StreamReaderEnumerableTests\n    {\n        [Test]\n        public void EnumeratesLines()\n        {\n            var lines = Enumerable.Range(0, 10).Select(i => $\"line {i}\").ToArray();\n            var content = string.Join(Environment.NewLine, lines);\n            using (var streamReader = new StreamReader(new MemoryStream(Encoding.Default.GetBytes(content))))\n            {\n                using var enumerable = new StreamReaderEnumerable(streamReader);\n                var actualLines = enumerable.ToList();\n                CollectionAssert.AreEqual(lines, actualLines);\n            }\n        }\n\n        [Test]\n        public void DisposesWhenEnumerationIsCompleted()\n        {\n            var disposable = new TestDisposable();\n            using var memoryStream = new TestMemoryStream(Encoding.Default.GetBytes(\"line1\\r\\nline2\\r\\nline3\"));\n            using var streamReader = new TestStreamReader(memoryStream);\n            using var enumerable = new StreamReaderEnumerable(streamReader, disposable);\n\n            // complete enumeration\n            var lines = enumerable.ToList();\n\n            Assert.IsTrue(streamReader.DisposeCalled);\n            Assert.IsTrue(streamReader.DisposeCalledDisposingValue);\n\n            Assert.IsTrue(memoryStream.DisposeCalled);\n            Assert.IsTrue(memoryStream.DisposeCalledDisposingValue);\n\n            Assert.IsTrue(disposable.DisposeCalled);\n        }\n\n        class TestMemoryStream : MemoryStream\n        {\n            public bool DisposeCalled { get; private set; }\n            public bool DisposeCalledDisposingValue { get; private set; }\n            public TestMemoryStream(byte[] bytes) : base(bytes) { }\n            protected override void Dispose(bool disposing)\n            {\n                base.Dispose(disposing);\n                DisposeCalled = true;\n                DisposeCalledDisposingValue = disposing;\n            }\n        }\n\n        class TestStreamReader : StreamReader\n        {\n            public bool DisposeCalled { get; private set; }\n            public bool DisposeCalledDisposingValue { get; private set; }\n            public TestStreamReader(Stream stream) : base(stream) { }\n            protected override void Dispose(bool disposing)\n            {\n                base.Dispose(disposing);\n                DisposeCalled = true;\n                DisposeCalledDisposingValue = disposing;\n            }\n        }\n\n        class TestDisposable : IDisposable\n        {\n            public bool DisposeCalled { get; private set; }\n            public void Dispose() { DisposeCalled = true; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/StreamReaderExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class StreamReaderExtensionsTests\n    {\n        [TestCase(\"\\r\\n\", \"\")]\n        [TestCase(\"\\n\", \"\")]\n        [TestCase(\"\\r\", \"\")]\n        [TestCase(\",\", \"\")]\n        [TestCase(\"-16\", \"-16\")]\n        [TestCase(\"16.2,\", \"16.2\")]\n        [TestCase(\"16.2\", \"16.2\")]\n        public void GetSimpleString(string input, string result)\n        {\n            var stream = input.ToStream();\n\n            using var smartStream = new StreamReader(stream);\n            var value = smartStream.GetString();\n\n            Assert.AreEqual(result, value);\n        }\n\n        [TestCase(\"He Llo\\r\\nHe Llo2\\r\\n\", \"He Llo\", \"He Llo2\")]\n        [TestCase(\"\\nTT\\n\", \"\", \"TT\")]\n        [TestCase(\"\\rpl op\\r\", \"\", \"pl op\")]\n        [TestCase(\",He Llo,\", \"\", \"He Llo\")]\n        [TestCase(\"-16\\rPe pe\", \"-16\", \"Pe pe\")]\n        [TestCase(\"16.2,,\", \"16.2\", \"\")]\n        [TestCase(\"16.2,8\", \"16.2\", \"8\")]\n        public void GetString(string input, string result, string result2)\n        {\n            var stream = input.ToStream();\n\n            using var smartStream = new StreamReader(stream);\n            Assert.AreEqual(result, smartStream.GetString());\n            Assert.AreEqual(result2, smartStream.GetString());\n        }\n\n        [TestCase(\"8,16.2,a\", new[] { '8', '1', '6', '.', '2', 'a' })]\n        [TestCase(\",,a,\\n\\r\\n, c\\r\\nd\\n,,\", new[] { '\\0', '\\0', 'a', '\\0', '\\0', '\\0', ' ', 'c', 'd', '\\0', '\\0', '\\0' })]\n        [TestCase(\"\\rp\\rnl\\r\\n op\\r\", new[] { '\\0', 'p', 'n', 'l', ' ', 'o', 'p', '\\0' })]\n        [TestCase(\",\\n\\r\\n\\r\\r\", new[] { '\\0', '\\0', '\\0', '\\0', '\\0', '\\0' })]\n        public void GetChar(string input, char[] results)\n        {\n            using var stream = input.ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            foreach (var result in results)\n            {\n                var value = smartStream.GetChar();\n                Assert.AreEqual(result, value);\n            }\n\n            Assert.AreEqual((char)0, smartStream.GetChar());\n        }\n\n        [Test]\n        public void GetDecimal()\n        {\n            var stream = \"16.2\".ToStream();\n\n            using var smartStream = new StreamReader(stream);\n            bool pastLineEnd;\n            var value = smartStream.GetDecimal(out pastLineEnd);\n\n            Assert.IsTrue(pastLineEnd);\n            Assert.AreEqual(16.2, value);\n        }\n\n        [Test]\n        public void GetNegativeDecimal()\n        {\n            var stream = \"-16.2,-88\".ToStream();\n\n            using var smartStream = new StreamReader(stream);\n\n            bool pastLineEnd;\n            Assert.AreEqual(-16.2, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(-88, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n        }\n\n        [Test]\n        public void GetMultipleDecimals()\n        {\n            var stream = \"16.2,0,12.2111111111,\".ToStream();\n            bool pastLineEnd;\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(16.2, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(0, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(12.2111111111, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n\n        }\n\n        [Test]\n        public void GetMultipleDecimalsWithCarriageReturn()\n        {\n            bool pastLineEnd;\n            var stream = \"16.2,0\\r12.2111111111\".ToStream();\n\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(16.2, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(0, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n            Assert.AreEqual(12.2111111111, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n        }\n\n        [Test]\n        public void GetMultipleDecimalsWithLineFeed()\n        {\n            bool pastLineEnd;\n            var stream = \"16.2,0\\n12.2111111111\".ToStream();\n\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(16.2, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(0, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n            Assert.AreEqual(12.2111111111, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n        }\n\n        [Test]\n        public void GetMultipleDecimalsWithCarriageReturnAndLineFeed()\n        {\n            bool pastLineEnd;\n            var stream = \"16.2,0\\r\\n12.2111111111\".ToStream();\n\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(16.2, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsFalse(pastLineEnd);\n            Assert.AreEqual(0, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n            Assert.AreEqual(12.2111111111, smartStream.GetDecimal(out pastLineEnd));\n            Assert.IsTrue(pastLineEnd);\n        }\n\n        [Test]\n        public void GetDecimalEmptyString()\n        {\n            var stream = \"\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(0, smartStream.GetDecimal());\n\n            stream = \",\".ToStream();\n            using var secondSmartStream = new StreamReader(stream);\n\n            Assert.AreEqual(0, secondSmartStream.GetDecimal());\n        }\n\n        [Test]\n        public void GetDateTime()\n        {\n            var stream = \"20190102 02:13\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n        }\n\n        [Test]\n        public void GetMultipleDateTime()\n        {\n            var stream = \"20190102 02:13,20190203 05:13\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(new DateTime(2019, 2, 3, 5, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n        }\n\n        [Test]\n        public void GetMultipleDateTimeWithCarriageReturn()\n        {\n            var stream = \"20190102 02:13\\r20190203 05:13\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(new DateTime(2019, 2, 3, 5, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n        }\n\n        [Test]\n        public void GetMultipleDateTimeWithLineFeed()\n        {\n            var stream = \"20190102 02:13\\n20190203 05:13\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(new DateTime(2019, 2, 3, 5, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n        }\n\n        [Test]\n        public void GetMultipleDateTimeWithCarriageReturnAndLineFeed()\n        {\n            var stream = \"20190102 02:13\\r\\n20190203 05:13\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(new DateTime(2019, 2, 3, 5, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n        }\n\n        [Test]\n        public void GetDecimalsAndDateTimes()\n        {\n            var stream = $\"20190102 02:13,0,19{Environment.NewLine}20190203 05:13,15,1000{Environment.NewLine}\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(new DateTime(2019, 1, 2, 2, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(0, smartStream.GetDecimal());\n            Assert.AreEqual(19, smartStream.GetDecimal());\n\n            Assert.AreEqual(new DateTime(2019, 2, 3, 5, 13, 0),\n                smartStream.GetDateTime(DateFormat.TwelveCharacter));\n            Assert.AreEqual(15, smartStream.GetDecimal());\n            Assert.AreEqual(1000, smartStream.GetDecimal());\n        }\n\n        [Test]\n        public void GetInt()\n        {\n            var stream = $\"20190,0,19{Environment.NewLine}201900{Environment.NewLine}\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(20190, smartStream.GetInt32());\n            Assert.AreEqual(0, smartStream.GetInt32());\n            Assert.AreEqual(19, smartStream.GetInt32());\n            Assert.AreEqual(201900, smartStream.GetInt32());\n        }\n\n        [Test]\n        public void GetNegativeInt()\n        {\n            var stream = $\"-20190,0,-19{Environment.NewLine}-201900{Environment.NewLine}\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(-20190, smartStream.GetInt32());\n            Assert.AreEqual(0, smartStream.GetInt32());\n            Assert.AreEqual(-19, smartStream.GetInt32());\n            Assert.AreEqual(-201900, smartStream.GetInt32());\n        }\n\n        [Test]\n        public void GetIntWithCarriageReturnAndLineFeed()\n        {\n            var stream = \"20190,0,19\\r\\n201900\\r\\n\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(20190, smartStream.GetInt32());\n            Assert.AreEqual(0, smartStream.GetInt32());\n            Assert.AreEqual(19, smartStream.GetInt32());\n            Assert.AreEqual(201900, smartStream.GetInt32());\n        }\n\n        [Test]\n        public void GetIntWithCarriageReturn()\n        {\n            var stream = \"20190,0,19\\r201900\\r\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(20190, smartStream.GetInt32());\n            Assert.AreEqual(0, smartStream.GetInt32());\n            Assert.AreEqual(19, smartStream.GetInt32());\n            Assert.AreEqual(201900, smartStream.GetInt32());\n        }\n\n        [Test]\n        public void GetIntWithLineFeed()\n        {\n            var stream = \"20190,0,19\\n201900\\n\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(20190, smartStream.GetInt32());\n            Assert.AreEqual(0, smartStream.GetInt32());\n            Assert.AreEqual(19, smartStream.GetInt32());\n            Assert.AreEqual(201900, smartStream.GetInt32());\n        }\n\n        [Test]\n        public void GetInt64()\n        {\n            var stream = $\"1588291200426000,0,1588291202486000{Environment.NewLine}1588291205550000{Environment.NewLine}\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(1588291200426000, smartStream.GetInt64());\n            Assert.AreEqual(0L, smartStream.GetInt64());\n            Assert.AreEqual(1588291202486000, smartStream.GetInt64());\n            Assert.AreEqual(1588291205550000, smartStream.GetInt64());\n        }\n\n        [Test]\n        public void GetNegativeInt64()\n        {\n            var stream = $\"-1588291200426000,0,-1588291202486000{Environment.NewLine}-1588291205550000{Environment.NewLine}\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(-1588291200426000, smartStream.GetInt64());\n            Assert.AreEqual(0L, smartStream.GetInt64());\n            Assert.AreEqual(-1588291202486000, smartStream.GetInt64());\n            Assert.AreEqual(-1588291205550000, smartStream.GetInt64());\n        }\n\n        [Test]\n        public void GetInt64WithCarriageReturnAndLineFeed()\n        {\n            var stream = \"1588291200426000,0,1588291202486000\\r\\n1588291205550000\\r\\n\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(1588291200426000, smartStream.GetInt64());\n            Assert.AreEqual(0L, smartStream.GetInt64());\n            Assert.AreEqual(1588291202486000, smartStream.GetInt64());\n            Assert.AreEqual(1588291205550000, smartStream.GetInt64());\n        }\n\n        [Test]\n        public void GetInt64WithLineFeed()\n        {\n            var stream = \"1588291200426000,0,1588291202486000\\n1588291205550000\\n\".ToStream();\n            using var smartStream = new StreamReader(stream);\n\n            Assert.AreEqual(1588291200426000, smartStream.GetInt64());\n            Assert.AreEqual(0L, smartStream.GetInt64());\n            Assert.AreEqual(1588291202486000, smartStream.GetInt64());\n            Assert.AreEqual(1588291205550000, smartStream.GetInt64());\n        }\n\n        [Parallelizable(ParallelScope.None)]\n        [TestCase(typeof(TradeBar), typeof(TradeBarTest), TickType.Trade)]\n        [TestCase(typeof(QuoteBar), typeof(QuoteBarTest), TickType.Quote)]\n        public void Performance(Type streamReaderType, Type readLineReaderType, TickType tickType)\n        {\n            var streamReaderMilliSeconds = 0L;\n            var streamReaderCount = 0;\n            var getLineReaderMilliSeconds = 0L;\n            var getLineReaderCount = 0;\n            var stopWatch = new Stopwatch();\n            {\n                var config = new SubscriptionDataConfig(\n                    streamReaderType,\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    true,\n                    false,\n                    tickType: tickType\n                );\n                using var zipCache = new ZipDataCacheProvider(TestGlobals.DataProvider);\n                var date = new DateTime(2013, 10, 07);\n                var reader = new TextSubscriptionDataSourceReader(\n                    zipCache,\n                    config,\n                    date,\n                    false,\n                    null);\n                var source = streamReaderType.GetBaseDataInstance().GetSource(config, date, false);\n                // warmup\n                streamReaderCount = reader.Read(source).Count();\n                streamReaderCount = 0;\n\n                // start test\n                stopWatch.Start();\n                for (int i = 0; i < 300; i++)\n                {\n                    streamReaderCount += reader.Read(source).Count();\n                }\n                stopWatch.Stop();\n                streamReaderMilliSeconds = stopWatch.ElapsedMilliseconds;\n                zipCache.DisposeSafely();\n            }\n\n            {\n                var config = new SubscriptionDataConfig(\n                    readLineReaderType,\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    true,\n                    false,\n                    tickType: tickType\n                );\n                using var zipCache = new ZipDataCacheProvider(TestGlobals.DataProvider);\n                var date = new DateTime(2013, 10, 07);\n                var reader = new TextSubscriptionDataSourceReader(\n                    zipCache,\n                    config,\n                    date,\n                    false,\n                    null);\n                var source = readLineReaderType.GetBaseDataInstance().GetSource(config, date, false);\n                // warmup\n                getLineReaderCount = reader.Read(source).Count();\n                getLineReaderCount = 0;\n\n                // start test\n                stopWatch.Start();\n                for (int i = 0; i < 300; i++)\n                {\n                    getLineReaderCount += reader.Read(source).Count();\n                }\n                stopWatch.Stop();\n                getLineReaderMilliSeconds = stopWatch.ElapsedMilliseconds;\n            }\n            Log.Trace($\"StreamReader: {streamReaderMilliSeconds}ms. Count {streamReaderCount}\");\n            Log.Trace($\"GetLine Reader: {getLineReaderMilliSeconds}ms. Count {getLineReaderCount}\");\n\n            // its 50% faster but lets leave some room to avoid noise\n            Assert.IsTrue((streamReaderMilliSeconds * 1.5d) < getLineReaderMilliSeconds);\n            Assert.AreEqual(getLineReaderCount, streamReaderCount);\n        }\n\n        /// <summary>\n        /// Since this class does not implement <see cref=\"BaseData.Reader(SubscriptionDataConfig,StreamReader,DateTime,bool)\"/>\n        /// directly it will fallback to get line reader\n        /// </summary>\n        private class TradeBarTest : TradeBar\n        {\n        }\n\n        /// <summary>\n        /// Since this class does not implement <see cref=\"BaseData.Reader(SubscriptionDataConfig,StreamReader,DateTime,bool)\"/>\n        /// directly it will fallback to get line reader\n        /// </summary>\n        private class QuoteBarTest : QuoteBar\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/ValidateTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class ValidateTests\n    {\n        [Test]\n        [TestCase(\"js@contoso.中国\", true)]\n        [TestCase(\"j@proseware.com9\", true)]\n        [TestCase(\"js@proseware.com9\", true)]\n        [TestCase(\"j_9@[129.126.118.1]\", true)]\n        [TestCase(\"jones@ms1.proseware.com\", true)]\n        [TestCase(\"david.jones@proseware.com\", true)]\n        [TestCase(\"d.j@server1.proseware.com\", true)]\n        [TestCase(\"js#internal@proseware.com\", true)]\n        [TestCase(\"j.s@server1.proseware.com\", true)]\n        [TestCase(@\"\"\"j\\\"\"s\\\"\"\"\"@proseware.com\", true)]\n        [TestCase(null, true)]\n\n        [TestCase(\"\", false)]\n        [TestCase(\"js*@proseware.com\", false)]\n        [TestCase(\"js@proseware..com\", false)]\n        [TestCase(\"j..s@proseware.com\", false)]\n        [TestCase(\"j.@server1.proseware.com\", false)]\n        public void EmailAddress(string emailAddress, bool isValid)\n        {\n            Assert.AreEqual(isValid, Validate.EmailAddress(emailAddress));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Common/Util/WhoCalledMeTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Runtime.CompilerServices;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Common.Util\n{\n    [TestFixture]\n    public class WhoCalledMeTests\n    {\n        [Test]\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        public void GetMethodNameTest()\n        {\n            string expected = \"WhoCalledMeTests.GetMethodNameTest\";\n            string actual = WhoCalledMe.GetMethodName(0);\n            Assert.AreEqual(expected, actual);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Compression/CompressionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing Ionic.Zip;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Compression\n{\n    [TestFixture]\n    public class CompressionTests\n    {\n        [Test]\n        public void ReadLinesCountMatchesLineCount()\n        {\n            const string file = \"../../../Data/equity/usa/minute/spy/20131008_trade.zip\";\n\n            const int expected = 828;\n            int actual = QuantConnect.Compression.ReadLines(file).Count;\n\n            Assert.AreEqual(expected, actual);\n        }\n\n        [Test]\n        public void ZipsStream()\n        {\n            const string zipName = \"stream_entry.zip\";\n            File.Delete(zipName);\n            const string fileContents = \"this is the contents of a file!\";\n            using var memoryStream = new MemoryStream();\n            var array = Encoding.UTF8.GetBytes(fileContents);\n            memoryStream.Write(array);\n            memoryStream.Position = 0;\n\n            QuantConnect.Compression.ZipStreamsAsync(zipName, [new (\"entry\", memoryStream)]).Wait();\n\n            using var file = File.OpenRead(zipName);\n            using var streamReader = QuantConnect.Compression.UnzipStreamToStreamReader(file);\n            var contents = streamReader.ReadToEnd();\n            Assert.AreEqual(fileContents, contents);\n        }\n\n        [Test]\n        public void ZipBytes()\n        {\n            const string fileContents = \"this is the contents of a file!\";\n            var fileBytes = Encoding.ASCII.GetBytes(fileContents); // using asci because UnzipData uses 1byte=1char\n            var zippedBytes = QuantConnect.Compression.ZipBytes(fileBytes, \"entry\");\n            File.WriteAllBytes(\"entry.zip\", zippedBytes);\n\n            using var file = File.OpenRead(\"entry.zip\");\n            using (var streamReader = QuantConnect.Compression.UnzipStreamToStreamReader(file))\n            {\n                var contents = streamReader.ReadToEnd();\n                Assert.AreEqual(fileContents, contents);\n            }\n        }\n\n        [Test]\n        public void ZipBytesReturnsByteArrayWithCorrectLength()\n        {\n            const string file = \"../../../Data/equity/usa/tick/spy/20131007_trade.zip\";\n            var fileBytes = File.ReadAllBytes(file);\n            var zippedBytes = QuantConnect.Compression.ZipBytes(fileBytes, \"entry\");\n\n            Assert.AreEqual(OS.IsWindows ? 905693 : 906121, zippedBytes.Length);\n        }\n\n        [Test]\n        public void ExtractsZipEntryByName()\n        {\n            var zip = Path.Combine(\"TestData\", \"multizip.zip\");\n            ZipFile zipFile;\n            using (var entryStream = QuantConnect.Compression.Unzip(zip, \"multizip/two.txt\", out zipFile))\n            using (zipFile)\n            {\n                var text = entryStream.ReadToEnd();\n                Assert.AreEqual(\"2\", text);\n            }\n        }\n\n        [Test]\n        public void ReadsZipEntryFileNames()\n        {\n            var zipFileName = Path.Combine(\"TestData\", \"20151224_quote_american.zip\");\n            var entryFileNames = QuantConnect.Compression.GetZipEntryFileNames(zipFileName).ToList();\n\n            var expectedFileNames = new[]\n            {\n                \"20151224_xlre_tick_quote_american_call_210000_20160819.csv\",\n                \"20151224_xlre_tick_quote_american_call_220000_20160819.csv\",\n                \"20151224_xlre_tick_quote_american_put_370000_20160819.csv\"\n            };\n\n            Assert.AreEqual(expectedFileNames.Length, entryFileNames.Count);\n\n            for (var i = 0; i < entryFileNames.Count; i++)\n            {\n                Assert.AreEqual(expectedFileNames[i], entryFileNames[i]);\n            }\n        }\n\n        [Test]\n        public void UnzipByteArray()\n        {\n            var name = nameof(UnzipByteArray);\n            var root = new DirectoryInfo(name);\n            var testPath = Path.Combine(root.FullName, \"test.txt\");\n            var test2Path = Path.Combine(Path.Combine(root.FullName, \"sub\"), \"test2.txt\");\n            var zipFile = $\"./{name}.zip\";\n            var files = new List<string>();\n            try\n            {\n                root.Create();\n                File.WriteAllText(testPath, \"string contents\");\n                var sub = root.CreateSubdirectory(\"sub\");\n                File.WriteAllText(test2Path, \"string contents 2\");\n                QuantConnect.Compression.ZipDirectory(root.FullName, zipFile);\n                Directory.Delete(root.FullName, true);\n\n                var data = File.ReadAllBytes(zipFile);\n                files = QuantConnect.Compression.UnzipToFolder(data,  Directory.GetCurrentDirectory());\n\n                Assert.AreEqual(2, files.Count);\n                Assert.IsTrue(File.Exists(testPath));\n                Assert.IsTrue(File.Exists(test2Path));\n            }\n            finally\n            {\n                File.Delete(zipFile);\n                files.ForEach(File.Delete);\n            }\n        }\n\n        [Test]\n        public void UnzipToFolderDoesNotStripSubDirectories()\n        {\n            var name = nameof(UnzipToFolderDoesNotStripSubDirectories);\n            var root = new DirectoryInfo(name);\n            var testPath = Path.Combine(root.FullName, \"test.txt\");\n            var test2Path = Path.Combine(Path.Combine(root.FullName, \"sub\"), \"test2.txt\");\n            var zipFile = $\"./{name}.zip\";\n            var files = new List<string>();\n            try\n            {\n                root.Create();\n                File.WriteAllText(testPath, \"string contents\");\n                var sub = root.CreateSubdirectory(\"sub\");\n                File.WriteAllText(test2Path, \"string contents 2\");\n                QuantConnect.Compression.ZipDirectory(root.FullName, zipFile);\n                Directory.Delete(root.FullName, true);\n                files = QuantConnect.Compression.UnzipToFolder(zipFile);\n\n                Assert.AreEqual(2, files.Count);\n                Assert.IsTrue(File.Exists(testPath));\n                Assert.IsTrue(File.Exists(test2Path));\n            }\n            finally\n            {\n                File.Delete(zipFile);\n                files.ForEach(File.Delete);\n            }\n        }\n\n        [Test]\n        public void UnzipToFolderUsesCorrectOutputFolder()\n        {\n            var name = nameof(UnzipToFolderUsesCorrectOutputFolder);\n            var root = new DirectoryInfo(name);\n            var testPath = Path.Combine(root.FullName, \"test.txt\");\n            var test2Path = Path.Combine(Path.Combine(root.FullName, \"sub\"), \"test2.txt\");\n            var zipFile = $\"./jo\\\\se/{name}.zip\";\n            var files = new List<string>();\n            try\n            {\n                Directory.CreateDirectory(\"./jo\\\\se\");\n                root.Create();\n                File.WriteAllText(testPath, \"string contents\");\n                var sub = root.CreateSubdirectory(\"sub\");\n                File.WriteAllText(test2Path, \"string contents 2\");\n                QuantConnect.Compression.ZipDirectory(root.FullName, zipFile);\n                Directory.Delete(root.FullName, true);\n                files = QuantConnect.Compression.UnzipToFolder(zipFile);\n\n                Assert.IsTrue(File.Exists(Path.Combine(root.Parent.FullName, \"jo\\\\se\", name, \"test.txt\")));\n                Assert.IsTrue(File.Exists(Path.Combine(root.Parent.FullName, \"jo\\\\se\", name, \"sub\", \"test2.txt\")));\n            }\n            finally\n            {\n                File.Delete(zipFile);\n                files.ForEach(File.Delete);\n            }\n        }\n\n        [Test]\n        public void ZipUnzipDataToFile()\n        {\n            var data = new Dictionary<string, string>\n            {\n                {\"Ł\", \"The key is unicode\"},\n                {\"2\", \"something\"}\n            };\n\n            var fileName = Guid.NewGuid().ToString();\n            var compressed = QuantConnect.Compression.ZipData(fileName, data);\n\n            Assert.IsTrue(compressed);\n\n            using var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);\n            var result = QuantConnect.Compression.UnzipDataAsync(fileStream).Result;\n\n            CollectionAssert.AreEqual(data.OrderBy(kv => kv.Key).ToList(), result.OrderBy(kv => kv.Key).ToList());\n        }\n\n        [Test]\n        public void UnzipDataSupportsEncoding()\n        {\n            var data = new Dictionary<string, string>\n            {\n                {\"Ł\", \"The key is unicode\"}\n            };\n\n            var encoding = Encoding.UTF8;\n            var bytes = encoding.GetBytes(JsonConvert.SerializeObject(data));\n            var compressed = QuantConnect.Compression.ZipBytes(bytes, \"entry.json\");\n            var decompressed = QuantConnect.Compression.UnzipData(compressed, encoding);\n            var redata = JsonConvert.DeserializeObject<Dictionary<string, string>>(\n                decompressed.Single().Value\n            );\n\n            var expected = data.Single();\n            var actual = redata.Single();\n            Assert.AreEqual(expected.Key, actual.Key);\n            Assert.AreEqual(expected.Value, actual.Value);\n        }\n\n        [Test]\n        public void UnzipDataStream()\n        {\n            var data = new Dictionary<string, string>\n            {\n                {\"Ł\", \"The key is unicode\"}\n            };\n\n            var encoding = Encoding.UTF8;\n            var bytes = encoding.GetBytes(JsonConvert.SerializeObject(data));\n            var compressed = QuantConnect.Compression.ZipBytes(bytes, \"entry.json\");\n\n            using var stream = new MemoryStream(compressed);\n            var decompressed = QuantConnect.Compression.UnzipDataAsync(stream, encoding).Result;\n            var redata = JsonConvert.DeserializeObject<Dictionary<string, string>>(\n                decompressed.Single().Value\n            );\n\n            var expected = data.Single();\n            var actual = redata.Single();\n            Assert.AreEqual(expected.Key, actual.Key);\n            Assert.AreEqual(expected.Value, actual.Value);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ZipCreateAppendData(bool overrideEntry)\n        {\n            var name = $\"PepeGrillo{overrideEntry}.zip\";\n            if (File.Exists(name))\n            {\n                File.Delete(name);\n            }\n            QuantConnect.Compression.Zip(\"Pinocho\", name, \"cow\");\n\n            Assert.AreEqual(overrideEntry, QuantConnect.Compression.ZipCreateAppendData(name, \"cow\", \"jiji\", overrideEntry));\n\n            var result = QuantConnect.Compression.Unzip(name).ToList();\n            Assert.AreEqual(1, result.Count);\n\n            var kvp = result.Single();\n            Assert.AreEqual(\"cow\", kvp.Key);\n\n            var data = kvp.Value.ToList();\n            Assert.AreEqual(1, data.Count);\n            Assert.AreEqual((overrideEntry ? \"jiji\" : \"Pinocho\"), data[0]);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Compression/ZipStreamWriterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Compression\n{\n    [TestFixture]\n    public class ZipStreamWriterTests\n    {\n        #pragma warning disable CA2000\n        [Test]\n        public void Create()\n        {\n            var fileName = Guid.NewGuid().ToString();\n            var file = new ZipStreamWriter(fileName, \"pepe\");\n            file.WriteLine(\"grillo\");\n            file.WriteLine(\"the\");\n            file.WriteLine(\"best\");\n            file.DisposeSafely();\n\n            var lines = QuantConnect.Compression.ReadLines(fileName).ToList();\n\n            Assert.AreEqual(3, lines.Count);\n            Assert.AreEqual(\"grillo\", lines[0]);\n            Assert.AreEqual(\"the\", lines[1]);\n            Assert.AreEqual(\"best\", lines[2]);\n            File.Delete(fileName);\n        }\n\n        [Test]\n        public void Update()\n        {\n            var fileName = Guid.NewGuid().ToString();\n            var file = new ZipStreamWriter(fileName, \"pepe\");\n            file.WriteLine(\"grillo\");\n            file.DisposeSafely();\n\n            var fileBis = new ZipStreamWriter(fileName, \"pepe\");\n            fileBis.WriteLine(\"the\");\n            fileBis.WriteLine(\"best\");\n            fileBis.DisposeSafely();\n\n            var lines = QuantConnect.Compression.ReadLines(fileName).ToList();\n\n            Assert.AreEqual(3, lines.Count);\n            Assert.AreEqual(\"grillo\", lines[0]);\n            Assert.AreEqual(\"the\", lines[1]);\n            Assert.AreEqual(\"best\", lines[2]);\n            File.Delete(fileName);\n        }\n\n        [Test]\n        public void MultipleEntries()\n        {\n            var fileName = Guid.NewGuid().ToString();\n            var file = new ZipStreamWriter(fileName, \"pepe\");\n            file.WriteLine(\"grillo\");\n            file.DisposeSafely();\n\n            var fileBis = new ZipStreamWriter(fileName, \"pepeBis\");\n            fileBis.WriteLine(\"the\");\n            fileBis.WriteLine(\"best\");\n            fileBis.DisposeSafely();\n\n            var lines = QuantConnect.Compression.Unzip(fileName).ToList();\n\n            Assert.AreEqual(2, lines.Count);\n\n            Assert.AreEqual(\"pepe\", lines[0].Key);\n            Assert.AreEqual(\"pepeBis\", lines[1].Key);\n\n            var entry1 = lines[0].Value.ToList();\n            Assert.AreEqual(1, entry1.Count);\n            Assert.AreEqual(\"grillo\", entry1[0]);\n\n            var entry2 = lines[1].Value.ToList();\n            Assert.AreEqual(2, entry2.Count);\n            Assert.AreEqual(\"the\", entry2[0]);\n            Assert.AreEqual(\"best\", entry2[1]);\n\n            File.Delete(fileName);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Configuration/ApplicationParserTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing McMaster.Extensions.CommandLineUtils;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Tests.Configuration\n{\n    [TestFixture]\n    public class ApplicationParserTests\n    {\n        private static readonly List<CommandLineOption> Options = new List<CommandLineOption>\n            {\n                new CommandLineOption(\"config\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"algorithm-id\", CommandOptionType.SingleValue),\n\n                // limits on number of symbols to allow\n                new CommandLineOption(\"symbol-minute-limit\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"symbol-second-limit\", CommandOptionType.SingleValue),\n                new CommandLineOption(\"symbol-tick-limit\", CommandOptionType.SingleValue),\n\n                new CommandLineOption(\"debugging\", CommandOptionType.SingleValue),\n\n                // if one uses true in following token, market hours will remain open all hours and all days.\n                // if one uses false will make lean operate only during regular market hours.\n                new CommandLineOption(\"force-exchange-always-open\", CommandOptionType.NoValue),\n\n                // parameters to set in the algorithm (the below are just samples)\n                new CommandLineOption(\"parameters\", CommandOptionType.MultipleValue)\n            };\n\n        [Test]\n        public void ReturnProperNumberOfArgs()\n        {\n            var args = $\"--algorithm-id value --debugging true --symbol-tick-limit 100 --parameters \\\"ema-slow\\\":1,\\\"ema-fast\\\":\\\"10\\\"\";\n\n            var options = ApplicationParser.Parse(\n                \"Test AppName\",\n                \"Test Description\",\n                \"Test Help Text\",\n                args.Split(new[] { \" \" }, StringSplitOptions.None),\n                Options);\n\n            Assert.AreEqual(Regex.Matches(args, \"--\").Count, options.Count);\n        }\n\n        [Test]\n        public void ThrowIfNoValueCommandOptionProvided()\n        {\n            var args = $\"--force-exchange-always-open false\";\n\n            Assert.Throws<UnrecognizedCommandParsingException>(\n                () =>\n                {\n                    var options = ApplicationParser.Parse(\n                        \"Test AppName\",\n                        \"Test Description\",\n                        \"Test Help Text\",\n                        args.Split(new[] { \" \" }, StringSplitOptions.None),\n                        Options);\n                }\n            );\n        }\n\n        [Test]\n        public void PaserNoValueArg()\n        {\n            var args = new[] { \"--force-exchange-always-open\" };\n\n            var options = ApplicationParser.Parse(\n                \"Test AppName\",\n                \"Test Description\",\n                \"Test Help Text\",\n                args,\n                Options);\n\n            Assert.AreEqual(1, options.Count);\n            foreach (var option in options)\n            {\n                Assert.IsInstanceOf<bool>(option.Value);\n                Assert.IsTrue((bool) option.Value);\n            }\n        }\n\n        [TestCase(\"algorithm-id\", \"\\\"AlgorithmId\\\"\")]\n        [TestCase(\"debugging\", \"false\")]\n        [TestCase(\"debugging\", \"\\\"true\\\"\")]\n        [TestCase(\"symbol-second-limit\", \"100\")]\n        [TestCase(\"symbol-second-limit\", \"\\\"100\\\"\")]\n        [TestCase(\"symbol-second-limit\", \"100.0\")]\n        [TestCase(\"symbol-second-limit\", \"\\\"100.0\\\"\")]\n        public void ParseSingleValueArgs(string command, object value)\n        {\n            var args = $\"--{command} {value}\";\n\n            var options = ApplicationParser.Parse(\n                \"Test AppName\",\n                \"Test Description\",\n                \"Test Help Text\",\n                args.Split(new[] { \" \" }, StringSplitOptions.None),\n                Options);\n\n            Assert.AreEqual(1, options.Count);\n            foreach (var option in options)\n            {\n                Assert.IsInstanceOf<string>(option.Value);\n                Assert.AreEqual(value, option.Value);\n            }\n        }\n\n        [Test]\n        public void ParseMultiValueArgs()\n        {\n            var args = $\"--parameters \\\"ema-slow\\\":1,\\\"ema-fast\\\":\\\"10\\\",\\\"line-slow\\\":20.0,\\\"line-fast\\\":\\\"100.0\\\"\";\n\n            var options = ApplicationParser.Parse(\n                \"Test AppName\",\n                \"Test Description\",\n                \"Test Help Text\",\n                args.Split(new[] { \" \" }, StringSplitOptions.None),\n                Options);\n\n            Assert.AreEqual(1, options.Count);\n            Assert.IsTrue(options.ContainsKey(\"parameters\"));\n\n            var parameters = options[\"parameters\"] as Dictionary<string, string>;\n            Assert.IsNotNull(parameters);\n            Assert.AreEqual(4, parameters.Keys.Count);\n            foreach (var parameter in parameters)\n            {\n                Assert.IsInstanceOf<string>(parameter.Value);\n            }\n        }\n\n        [TestCase(\"algorithmId\", true, 100, 100.5, 1, 100.5)]\n        [TestCase(\"algorithmId\", \"true\", \"100\", \"100.5\", \"1\", \"100.5\")]\n        public void MergeWithArguments(string str, object bValue, object iValue, object dValue, object iParamValue, object dParamValue)\n        {\n            var args = $\"--algorithm-id {str} --debugging {bValue} --symbol-tick-limit {iValue} --symbol-second-limit {Convert.ToString(dValue, CultureInfo.InvariantCulture)} --parameters ema-slow:{iParamValue},ema-fast:{Convert.ToString(dParamValue, CultureInfo.InvariantCulture)}\";\n\n            var options = ApplicationParser.Parse(\n                \"Test AppName\",\n                \"Test Description\",\n                \"Test Help Text\",\n                args.Split(new[] { \" \" }, StringSplitOptions.None),\n                Options);\n\n            Config.MergeCommandLineArgumentsWithConfiguration(options);\n\n            Assert.AreEqual(\"algorithmId\", Config.Get(\"algorithm-id\"));\n            Assert.AreEqual(true, Config.GetBool(\"debugging\"));\n            Assert.AreEqual(100, Config.GetInt(\"symbol-tick-limit\"));\n            Assert.AreEqual(100.5, Config.GetDouble(\"symbol-second-limit\"));\n\n            var parameters = new Dictionary<string, string>();\n\n            var parametersConfigString = Config.Get(\"parameters\");\n            if (!string.IsNullOrEmpty(parametersConfigString))\n            {\n                parameters = JsonConvert.DeserializeObject<Dictionary<string, string>>(parametersConfigString);\n            }\n\n            Assert.Contains(\"ema-slow\", parameters.Keys);\n            Assert.AreEqual(1, parameters[\"ema-slow\"].ConvertTo<int>());\n            Assert.Contains(\"ema-fast\", parameters.Keys);\n            Assert.AreEqual(100.5, parameters[\"ema-fast\"].ConvertTo<double>());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Configuration/ConfigTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing static System.FormattableString;\n\nnamespace QuantConnect.Tests.Configuration\n{\n    [TestFixture]\n    public class ConfigTests\n    {\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            Config.Reset();\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            Config.Reset();\n        }\n\n        [Test]\n        public void SetRespectsEnvironment()\n        {\n            bool betaMode = Config.GetBool(\"beta-mode\");\n            var env = Config.Get(\"environment\");\n            Config.Set(env + \".beta-mode\", betaMode ? \"false\" : \"true\");\n\n\n            bool betaMode2 = Config.GetBool(\"beta-mode\");\n            Assert.AreNotEqual(betaMode, betaMode2);\n        }\n\n        [Test]\n        public void ChangeConfigurationFileNameWrites()\n        {\n            // we need to load the current config, since it's lazy we get the current env to load it up\n            var env = Config.GetEnvironment();\n            var tempFile = Path.GetTempFileName();\n            Config.SetConfigurationFile(tempFile);\n            Config.Write();\n            Assert.True(File.Exists(tempFile));\n            Assert.True(File.ReadAllText(tempFile).Length > 0);\n            File.Delete(tempFile);\n\n            var defaultFile = \"config.json\";\n            Config.SetConfigurationFile(defaultFile);\n            Assert.True(File.Exists(defaultFile));\n            Assert.True(File.ReadAllText(defaultFile).Length > 0);\n        }\n\n        [Test]\n        public void FlattenTest()\n        {\n            // read in and rewrite the environment based on the settings\n            const string overrideEnvironment = \"live-paper.beta\";\n\n            var config = JObject.Parse(\n@\"{\n   'some-setting': 'false',                 \n    environments: {\n        'live-paper': {\n            'some-setting': 'true',\n            'environments': {\n                'beta': {\n                    'some-setting2': 'true'\n                }\n            }\n        }\n    }\n}\");\n\n            var configCopy = config.DeepClone();\n\n            var clone = Config.Flatten(config, overrideEnvironment);\n\n            // remove environments\n            Assert.IsNull(clone.Property(\"environment\"));\n            Assert.IsNull(clone.Property(\"environments\"));\n\n            // properly applied environment\n            Assert.AreEqual(\"true\", clone.Property(\"some-setting\").Value.ToString());\n            Assert.AreEqual(\"true\", clone.Property(\"some-setting2\").Value.ToString());\n\n            Assert.AreEqual(configCopy, config);\n        }\n\n        [Test]\n        public void GetValueHandlesDateTime()\n        {\n            GetValueHandles(new DateTime(2015, 1, 2, 3, 4, 5));\n        }\n\n        [Test]\n        public void GetValueHandlesTimeSpan()\n        {\n            GetValueHandles(new TimeSpan(1, 2, 3, 4, 5));\n        }\n\n        private static readonly TestCaseData[] DecimalValue =\n        {\n            new TestCaseData(100m)\n        };\n\n        private static readonly TestCaseData[] DecimalWithExpectedValue =\n        {\n            new TestCaseData(100m, (int)100)\n        };\n\n        [TestCase(\"value\")]\n        [TestCase(\"true\")]\n        [TestCase(true)]\n        [TestCase(\"1\")]\n        [TestCase(1)]\n        [TestCase(\"1.0\")]\n        [TestCase(1d)]\n        [Test, TestCaseSource(nameof(DecimalValue))]\n        public void GetString(object value)\n        {\n            Config.MergeCommandLineArgumentsWithConfiguration(new Dictionary<string, object>() { { \"temp-value\", value } });\n\n            var actual = Config.Get(\"temp-value\");\n            Assert.AreEqual(typeof(string), actual.GetType());\n        }\n\n        [TestCase(\"true\", true)]\n        [TestCase(true, true)]\n        [TestCase(\"false\", false)]\n        [TestCase(false, false)]\n        public void GetBool(object value, bool expected)\n        {\n            Config.MergeCommandLineArgumentsWithConfiguration(new Dictionary<string, object>() { { \"temp-value\", value } });\n\n            Assert.AreEqual(expected, Config.GetBool(\"temp-value\"));\n        }\n\n        [TestCase(\"1\", 1)]\n        [TestCase(1, 1)]\n        [TestCase(2d, 2)]\n        [Test, TestCaseSource(nameof(DecimalWithExpectedValue))]\n        public void GetInt(object value, object expected)\n        {\n            Config.MergeCommandLineArgumentsWithConfiguration(new Dictionary<string, object>() { { \"temp-value\", value } });\n\n            Assert.AreEqual(expected, Config.GetInt(\"temp-value\"));\n        }\n\n        [TestCase(\"100.0\", 100)]\n        [TestCase(50d, 50)]\n        [Test, TestCaseSource(nameof(DecimalWithExpectedValue))]\n        public void GetDouble(object value, double expected)\n        {\n            Config.MergeCommandLineArgumentsWithConfiguration(new Dictionary<string, object>() { { \"temp-value\", value } });\n\n            Assert.AreEqual(expected, Config.GetDouble(\"temp-value\"));\n        }\n\n        private void GetValueHandles<T>(T value)\n        {\n            var configValue = Invariant($\"{value}\");\n            Config.Set(\"temp-value\", configValue);\n            var actual = Config.GetValue<T>(\"temp-value\");\n            Assert.AreEqual(value, actual);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/DownloaderDataProvider/DataDownloadConfigTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models;\n\nnamespace QuantConnect.Tests.DownloaderDataProvider\n{\n    [TestFixture]\n    public class DataDownloadConfigTests\n    {\n        [TestCase(null, \"BTCUSDT\", SecurityType.Crypto, \"coinbase\", false)]\n        [TestCase(null, \"BTCUSDT\", SecurityType.Crypto, \"coinbase\", true)]\n        [TestCase(\"\", \"ETHUSDT\", SecurityType.Crypto, \"coinbase\", false)]\n        [TestCase(\"\", \"ETHUSDT\", SecurityType.Crypto, \"coinbase\", true)]\n        [TestCase(null, \"AAPL\", SecurityType.Equity, \"usa\", false)]\n        [TestCase(null, \"AAPL\", SecurityType.Equity, \"usa\", true)]\n        [TestCase(\"\", \"AAPL\", SecurityType.Equity, \"usa\", false)]\n        [TestCase(\"\", \"AAPL\", SecurityType.Equity, \"usa\", true)]\n        [TestCase(\"USA\", \"AAPL\", SecurityType.Equity, \"usa\")]\n        [TestCase(\"ICE\", \"AAPL\", SecurityType.Equity, \"ice\")]\n        public void ValidateMarketArguments(string market, string ticker, SecurityType securityType, string expectedMarket, bool skipConfigMarket = false)\n        {\n            Config.Set(\"data-type\", \"Trade\");\n            Config.Set(\"resolution\", \"Daily\");\n            Config.Set(\"security-type\", $\"{securityType}\");\n            Config.Set(\"tickers\", $\"{{\\\"{ticker}\\\": \\\"\\\"}}\");\n            Config.Set(\"start-date\", \"20240101\");\n            Config.Set(\"end-date\", \"20240202\");\n\n            if (!skipConfigMarket)\n            {\n                Config.Set(\"market\", market);\n            }\n\n            var dataDownloadConfig = new DataDownloadConfig();\n\n            Assert.That(dataDownloadConfig.MarketName, Is.EqualTo(expectedMarket));\n\n            Config.Reset();\n        }\n\n        [TestCase(Market.CME, Securities.Futures.Indices.SP500EMini + \"H6\", SecurityType.Future, false, 0, \"2026/03/20\")]\n        [TestCase(Market.CME, Securities.Futures.Indices.SP500EMini, SecurityType.Future, true, 0, \"2026/03/20\")]\n        [TestCase(Market.CME, \"E\", SecurityType.Future, true, 0, \"2026/03/20\")]\n        [TestCase(Market.USA, \"AAPL\", SecurityType.Option, true, 0, \"2026/03/20\")]\n        [TestCase(Market.USA, \"AAPL260213C00262500\", SecurityType.Option, false, 262.5, \"2026/02/13\")]\n        [TestCase(Market.USA, \"AAPL  260213C00262500\", SecurityType.Option, false, 262.5, \"2026/02/13\")]\n        [TestCase(Market.USA, \"SPXW260213C06050000\", SecurityType.IndexOption, false, 6050, \"2026/02/13\")]\n        [TestCase(Market.USA, \"SPXW  260213C06050000\", SecurityType.IndexOption, false, 6050, \"2026/02/13\")]\n        [TestCase(Market.CME, \"ESH6 C7000\", SecurityType.FutureOption, false, 7000, \"2026/03/20\")]\n        [TestCase(Market.COMEX, \"OGJ6 C4985\", SecurityType.FutureOption, false, 4985, \"2026/03/26\")]\n        [TestCase(Market.CME, \"GFH6 C368.5\", SecurityType.FutureOption, false, 368.5, \"2026/03/26\")]\n        public void ShouldParseSymbolContractAndDownload(string expectedMarket, string ticker, SecurityType securityType, bool expectedIsCanonical, decimal expectedStrike, DateTime expectedExpiry)\n        {\n            Config.Set(\"data-type\", \"Trade\");\n            Config.Set(\"resolution\", \"Daily\");\n            Config.Set(\"security-type\", $\"{securityType}\");\n            Config.Set(\"tickers\", $\"{{\\\"{ticker}\\\": \\\"\\\"}}\");\n            Config.Set(\"start-date\", \"20260201\");\n            Config.Set(\"end-date\", \"20260213\");\n            Config.Set(\"market\", expectedMarket);\n\n            var dataDownloadConfig = new DataDownloadConfig();\n\n            Assert.IsNotEmpty(dataDownloadConfig.Symbols);\n            Assert.AreEqual(1, dataDownloadConfig.Symbols.Count);\n\n            var symbol = dataDownloadConfig.Symbols.First();\n            Assert.IsNotNull(symbol);\n            Assert.AreEqual(expectedIsCanonical, symbol.IsCanonical());\n            Assert.AreEqual(symbol.ID.Market, expectedMarket);\n\n            if (!symbol.IsCanonical())\n            {\n                Assert.AreEqual(expectedExpiry, symbol.ID.Date.Date);\n            }\n\n            if (securityType.IsOption())\n            {\n                Assert.AreEqual(expectedStrike, symbol.ID.StrikePrice);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/DownloaderDataProvider/DownloadHelperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.DownloaderDataProvider.Launcher;\nusing QuantConnect.DownloaderDataProvider.Launcher.Models;\n\nnamespace QuantConnect.Tests.DownloaderDataProvider\n{\n    [TestFixture]\n    public class DownloadHelperTests\n    {\n        private IDataCacheProvider _cacheProvider;\n\n        [OneTimeSetUp]\n        public void OneTimeSetUp()\n        {\n            _cacheProvider = new DiskDataCacheProvider();\n        }\n\n        [OneTimeTearDown]\n        public void OneTimeTearDown()\n        {\n            if (_cacheProvider != null)\n            {\n                _cacheProvider.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Temporary data download directory\n        /// </summary>\n        private readonly string _dataDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n\n        [TestCase(TickType.Trade, Resolution.Daily)]\n        public void RunDownload(TickType tickType, Resolution resolution)\n        {\n            var startDate = new DateTime(2024, 01, 01);\n            var tradeDate = new DateTime(2024, 01, 10);\n            var endDate = new DateTime(2024, 02, 02);\n            var symbol = Symbol.CreateCanonicalOption(Symbols.AAPL);\n\n            var downloadDataConfig = new DataDownloadConfig(tickType, SecurityType.Option, resolution, startDate, endDate, Market.USA, new List<Symbol>() { symbol });\n\n            var optionContracts = GenerateOptionContracts(Symbols.AAPL, 100, new DateTime(2024, 03, 16), expiryAddDay: 30);\n            var generateOptionContactFileName = optionContracts.ToList(contract => LeanData.GenerateZipEntryName(contract, contract.ID.Date, resolution, tickType));\n\n            Assert.That(optionContracts.Distinct().Count(), Is.EqualTo(optionContracts.Count));\n\n            var mockBaseDate = GenerateTradeBarByEachSymbol(optionContracts, tradeDate);\n\n            var downloader = new DataDownloaderTest(mockBaseDate);\n\n            Program.RunDownload(downloader, downloadDataConfig, _dataDirectory, _cacheProvider);\n\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, symbol, startDate, resolution, tickType);\n            var fileNames = _cacheProvider.GetZipEntries(filePath);\n            var unZipData = QuantConnect.Compression.Unzip(filePath).ToDictionary(x => x.Key, x => x.Value.ToList());\n\n            Assert.AreEqual(fileNames.Count, unZipData.Count);\n            Assert.AreEqual(fileNames.Count, optionContracts.Count);\n\n            foreach (var dataInZip in unZipData)\n            {\n                Assert.IsTrue(generateOptionContactFileName.Contains(dataInZip.Key));\n                Assert.Greater(dataInZip.Value.Count, 0);\n                Assert.IsTrue(dataInZip.Value.All(row => row.Length > 0));\n            }\n        }\n\n        private static IEnumerable<BaseData> GenerateTradeBarByEachSymbol(IEnumerable<Symbol> symbols, DateTime tradeDateTime)\n        {\n            var multiplier = 100;\n            foreach (var option in symbols)\n            {\n                yield return new TradeBar(tradeDateTime, option, multiplier, multiplier, multiplier, multiplier, multiplier);\n                multiplier *= 2;\n            }\n        }\n\n        private static List<Symbol> GenerateOptionContracts(Symbol underlying, decimal strikePrice, DateTime expiryDate, int strikeMultiplier = 2, int expiryAddDay = 1, int count = 2)\n        {\n            var contracts = new List<Symbol>();\n            for (int i = 0; i < count; i++)\n            {\n                contracts.Add(Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, OptionRight.Put, strikePrice, expiryDate));\n                expiryDate = expiryDate.AddDays(expiryAddDay);\n                strikePrice *= strikeMultiplier;\n            }\n            return contracts;\n        }\n\n        private class DataDownloaderTest : IDataDownloader\n        {\n            public IEnumerable<BaseData> Data { get; }\n\n            public DataDownloaderTest(IEnumerable<BaseData> data)\n            {\n                Data = data;\n            }\n\n            public IEnumerable<BaseData> Get(DataDownloaderGetParameters dataDownloaderGetParameters)\n            {\n                return Data.Select(x => x);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/AlgorithmLogTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture]\n    public class AlgorithmLogTests\n    {\n        [TestCase(typeof(TestAlgorithmWithErrorLogOnInit))]\n        [TestCase(typeof(TestAlgorithmWithDebugLogOnInit))]\n        [TestCase(typeof(TestAlgorithmWithLogOnInit))]\n        public void AlgorithmCompletesWhenCallingErroLogOnInit(Type algorithmType)\n        {\n            var parameters = new RegressionTests.AlgorithmStatisticsTestParameters(\"QuantConnect.Tests.Engine.AlgorithmLogTests+\" + algorithmType.Name,\n                Activator.CreateInstance<BasicTemplateDailyAlgorithm>().ExpectedStatistics,\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameters.Algorithm,\n                parameters.Statistics,\n                parameters.Language,\n                parameters.ExpectedFinalStatus,\n                algorithmLocation: \"QuantConnect.Tests.dll\");\n        }\n\n        public class TestAlgorithmWithErrorLogOnInit : BasicTemplateDailyAlgorithm\n        {\n            public override void Initialize()\n            {\n                base.Initialize();\n                Error(\"Error in Initialize\");\n            }\n        }\n\n        public class TestAlgorithmWithDebugLogOnInit : BasicTemplateDailyAlgorithm\n        {\n            public override void Initialize()\n            {\n                base.Initialize();\n                Debug(\"Error in Initialize\");\n            }\n        }\n\n        public class TestAlgorithmWithLogOnInit : BasicTemplateDailyAlgorithm\n        {\n            public override void Initialize()\n            {\n                base.Initialize();\n                Log(\"Error in Initialize\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/AlgorithmManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Server;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Statistics;\nusing Log = QuantConnect.Logging.Log;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture]\n    public class AlgorithmManagerTests\n    {\n        [TestCase(AlgorithmStatus.Deleted)]\n        [TestCase(AlgorithmStatus.Stopped)]\n        [TestCase(AlgorithmStatus.Liquidated)]\n        [TestCase(AlgorithmStatus.RuntimeError)]\n        public void MonitorsAlgorithmState(AlgorithmStatus algorithmStatus)\n        {\n            AlgorithmManagerAlgorithmStatusTest.Loops = 0;\n            AlgorithmManagerAlgorithmStatusTest.AlgorithmStatus = algorithmStatus;\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"QuantConnect.Tests.Engine.AlgorithmManagerTests+AlgorithmManagerAlgorithmStatusTest\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0\"},\n                    {\"Tracking Error\", \"0\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"}\n                },\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                algorithmLocation: \"QuantConnect.Tests.dll\");\n\n            Assert.AreEqual(1, AlgorithmManagerAlgorithmStatusTest.Loops);\n        }\n\n        [Test, Explicit(\"TravisExclude\")]\n        public void TestAlgorithmManagerSpeed()\n        {\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            var algorithmManager = new AlgorithmManager(false);\n            var job = new BacktestNodePacket(1, 2, \"3\", null, 9m, $\"{nameof(AlgorithmManagerTests)}.{nameof(TestAlgorithmManagerSpeed)}\");\n            var feed = new MockDataFeed();\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(feed,\n                new UniverseSelection(\n                    algorithm,\n                    new SecurityService(algorithm.Portfolio.CashBook,\n                        marketHoursDatabase,\n                        symbolPropertiesDataBase,\n                        algorithm,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCacheProvider(algorithm.Portfolio),\n                        algorithm: algorithm), dataPermissionManager,\n                    TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            var transactions = new BacktestingTransactionHandler();\n            var results = new BacktestingResultHandler();\n            var realtime = new BacktestingRealTimeHandler();\n            using var leanManager = new NullLeanManager();\n            var nullSynchronizer = new NullSynchronizer(algorithm);\n\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n\n            using var messaging = new QuantConnect.Messaging.Messaging();\n            using var api = new Api.Api();\n            results.Initialize(new (job, messaging, api, transactions, null));\n            results.SetAlgorithm(algorithm, algorithm.Portfolio.TotalPortfolioValue);\n            using var backtestingBrokerage = new BacktestingBrokerage(algorithm);\n            transactions.Initialize(algorithm, backtestingBrokerage, results);\n            feed.Initialize(algorithm, job, results, null, null, null, dataManager, null, null);\n\n            Log.Trace(\"Starting algorithm manager loop to process \" + nullSynchronizer.Count + \" time slices\");\n            var sw = Stopwatch.StartNew();\n            using var tokenSource = new CancellationTokenSource();\n            algorithmManager.Run(job, algorithm, nullSynchronizer, transactions, results, realtime, leanManager, tokenSource, new());\n            sw.Stop();\n\n            realtime.Exit();\n            results.Exit();\n            transactions.Exit();\n            var thousands = nullSynchronizer.Count / 1000d;\n            var seconds = sw.Elapsed.TotalSeconds;\n            Log.Trace(\"COUNT: \" + nullSynchronizer.Count + \"  KPS: \" + thousands/seconds);\n        }\n\n        public class NullLeanManager : ILeanManager\n        {\n            public void Dispose()\n            {\n            }\n\n            public void Initialize(LeanEngineSystemHandlers systemHandlers,\n                LeanEngineAlgorithmHandlers algorithmHandlers,\n                AlgorithmNodePacket job,\n                AlgorithmManager algorithmManager)\n            {\n            }\n\n            public void SetAlgorithm(IAlgorithm algorithm)\n            {\n            }\n\n            public void Update()\n            {\n            }\n\n            public void OnAlgorithmStart()\n            {\n            }\n\n            public void OnAlgorithmEnd()\n            {\n            }\n\n            public void OnSecuritiesChanged(SecurityChanges changes)\n            {\n            }\n        }\n\n        class NullResultHandler : IResultHandler\n        {\n            public ConcurrentQueue<Packet> Messages { get; set; }\n            public bool IsActive { get; }\n\n            public void OnSecuritiesChanged(SecurityChanges changes)\n            {\n            }\n\n            public void DebugMessage(string message)\n            {\n            }\n\n            public void SystemDebugMessage(string message)\n            {\n            }\n\n            public void SecurityType(List<SecurityType> types)\n            {\n            }\n\n            public void LogMessage(string message)\n            {\n            }\n\n            public void ErrorMessage(string error, string stacktrace = \"\")\n            {\n            }\n\n            public void RuntimeError(string message, string stacktrace = \"\")\n            {\n            }\n\n            public void BrokerageMessage(BrokerageMessageEvent brokerageMessageEvent)\n            {\n            }\n\n            public void Sample(DateTime time)\n            {\n            }\n\n            public void SetAlgorithm(IAlgorithm algorithm, decimal startingPortfolioValue)\n            {\n            }\n\n            public void SendStatusUpdate(AlgorithmStatus status, string message = \"\")\n            {\n            }\n\n            public void RuntimeStatistic(string key, string value)\n            {\n            }\n\n            public void OrderEvent(OrderEvent newEvent)\n            {\n            }\n\n            public void Exit()\n            {\n            }\n\n            public void ProcessSynchronousEvents(bool forceProcess = false)\n            {\n            }\n\n            public void SaveResults(string name, Result result)\n            {\n            }\n\n            public void SetDataManager(IDataFeedSubscriptionManager dataManager)\n            {\n            }\n\n            public StatisticsResults StatisticsResults()\n            {\n                return new StatisticsResults();\n            }\n\n            public void SetSummaryStatistic(string name, string value)\n            {\n            }\n\n            public void AlgorithmTagsUpdated(HashSet<string> tags)\n            {\n            }\n\n            public void AlgorithmNameUpdated(string name)\n            {\n            }\n\n            public void Initialize(ResultHandlerInitializeParameters parameters)\n            {\n            }\n        }\n\n        class NullRealTimeHandler : IRealTimeHandler\n        {\n            public void Add(ScheduledEvent scheduledEvent)\n            {\n            }\n\n            public void Remove(ScheduledEvent scheduledEvent)\n            {\n            }\n\n            public bool IsActive { get; }\n            public void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api, IIsolatorLimitResultProvider isolatorLimitProvider)\n            {\n            }\n\n            public void Run()\n            {\n            }\n\n            public void SetTime(DateTime time)\n            {\n            }\n\n            public void ScanPastEvents(DateTime time)\n            {\n            }\n\n            public void Exit()\n            {\n            }\n\n            public void OnSecuritiesChanged(SecurityChanges changes)\n            {\n            }\n        }\n\n        class NullSynchronizer : ISynchronizer\n        {\n            private DateTime _frontierUtc;\n            private readonly DateTime _endTimeUtc;\n            private readonly List<BaseData> _data = new List<BaseData>();\n            private readonly List<UpdateData<SubscriptionDataConfig>> _consolidatorUpdateData = new List<UpdateData<SubscriptionDataConfig>>();\n            private readonly List<TimeSlice> _timeSlices = new List<TimeSlice>();\n            private readonly TimeSpan _frontierStepSize = TimeSpan.FromSeconds(1);\n            private readonly List<UpdateData<ISecurityPrice>> _securitiesUpdateData = new List<UpdateData<ISecurityPrice>>();\n            public int Count => _timeSlices.Count;\n\n            public NullSynchronizer(IAlgorithm algorithm)\n            {\n                _frontierUtc = algorithm.StartDate.ConvertToUtc(algorithm.TimeZone);\n                _endTimeUtc = algorithm.EndDate.ConvertToUtc(algorithm.TimeZone);\n                foreach (var kvp in algorithm.Securities)\n                {\n                    var security = kvp.Value;\n                    var tick = new Tick\n                    {\n                        Symbol = security.Symbol,\n                        EndTime = _frontierUtc.ConvertFromUtc(security.Exchange.TimeZone)\n                    };\n                    _data.Add(tick);\n                    _securitiesUpdateData.Add(new UpdateData<ISecurityPrice>(security, typeof(Tick), new BaseData[] { tick }, false));\n                    _consolidatorUpdateData.Add(new UpdateData<SubscriptionDataConfig>(security.Subscriptions.First(), typeof(Tick), new BaseData[] { tick }, false));\n                }\n\n                _timeSlices.AddRange(GenerateTimeSlices().Take(int.MaxValue / 1000));\n            }\n\n            public IEnumerable<TimeSlice> StreamData(CancellationToken cancellationToken)\n            {\n                return _timeSlices;\n            }\n\n            private IEnumerable<TimeSlice> GenerateTimeSlices()\n            {\n                var bars = new TradeBars();\n                var quotes = new QuoteBars();\n                var ticks = new Ticks();\n                var options = new OptionChains();\n                var futures = new FuturesChains();\n                var splits = new Splits();\n                var dividends = new Dividends();\n                var delistings = new Delistings();\n                var symbolChanges = new SymbolChangedEvents();\n                var marginInterestRates = new MarginInterestRates();\n                var dataFeedPackets = new List<DataFeedPacket>();\n                var customData = new List<UpdateData<ISecurityPrice>>();\n                var changes = SecurityChanges.None;\n                do\n                {\n                    var slice = new Slice(default(DateTime), _data, bars, quotes, ticks, options, futures, splits, dividends, delistings, symbolChanges, marginInterestRates, default(DateTime));\n                    var timeSlice = new TimeSlice(_frontierUtc, _data.Count, slice, dataFeedPackets, _securitiesUpdateData, _consolidatorUpdateData, customData, changes, new Dictionary<Universe, BaseDataCollection>());\n                    yield return timeSlice;\n                    _frontierUtc += _frontierStepSize;\n                }\n                while (_frontierUtc <= _endTimeUtc);\n            }\n        }\n\n        public class AlgorithmManagerAlgorithmStatusTest : BasicTemplateDailyAlgorithm\n        {\n            public static int Loops { get; set; }\n            public static AlgorithmStatus AlgorithmStatus { get; set; }\n\n            public AlgorithmManagerAlgorithmStatusTest() : base()\n            {\n            }\n            public override void OnData(Slice data)\n            {\n                ++Loops;\n                SetStatus(AlgorithmStatus);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/AlgorithmTimeLimitManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Util.RateLimit;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture]\n    public class AlgorithmTimeLimitManagerTests\n    {\n        [OneTimeSetUp]\n        public void TearUp()\n        {\n            // clear the config\n            Config.Reset();\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            // clear the config\n            Config.Reset();\n        }\n\n        [Test]\n        public void StopsAlgorithm()\n        {\n            Config.Set(\"algorithm-manager-time-loop-maximum\", \"0.05\");\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(TrainingInitializeRegressionAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                AlgorithmStatus.RuntimeError);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        [Test]\n        public void RaceCondition()\n        {\n            var timeManager = new AlgorithmTimeLimitManager(TokenBucket.Null, TimeSpan.FromMinutes(1));\n\n            const int loops = 1000000;\n            var task = Task.Factory.StartNew(() =>\n            {\n                var count = 0;\n                while (count++ < loops)\n                {\n                    var result = timeManager.IsWithinLimit();\n                    Assert.IsTrue(result.IsWithinCustomLimits, result.ErrorMessage);\n                }\n            });\n            var task2 = Task.Factory.StartNew(() =>\n            {\n                var count = 0;\n                while (count++ < loops)\n                {\n                    timeManager.StartNewTimeStep();\n                }\n            });\n\n            Task.WaitAll(task, task2);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/BrokerageTransactionHandlerTests/BacktestingTransactionHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Brokerages.Paper;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.BrokerageTransactionHandlerTests\n{\n    [TestFixture]\n    public class BacktestingTransactionHandlerTests\n    {\n        private const string Ticker = \"EURUSD\";\n        private BrokerageTransactionHandlerTests.TestAlgorithm _algorithm;\n\n        [SetUp]\n        public void Initialize()\n        {\n            _algorithm = new BrokerageTransactionHandlerTests.TestAlgorithm\n            {\n                HistoryProvider = new BrokerageTransactionHandlerTests.EmptyHistoryProvider()\n            };\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _algorithm.SetBrokerageModel(BrokerageName.FxcmBrokerage);\n            _algorithm.SetCash(100000);\n            _algorithm.AddSecurity(SecurityType.Forex, Ticker);\n            _algorithm.SetFinishedWarmingUp();\n            TestPartialFilledModel.FilledOrders = new Dictionary<int, Order>();\n        }\n\n        [Test]\n        public void InvalidOrderRequestWontSetTicketAsProcessed()\n        {\n            //Initializes the transaction handler\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var backtestingBrokerage = new BacktestingBrokerage(_algorithm);\n            transactionHandler.Initialize(_algorithm, backtestingBrokerage, new BacktestingResultHandler());\n\n            try\n            {\n                // Creates the order\n                var security = _algorithm.Securities[Ticker];\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 600, 0, 0, 0, DateTime.Now, \"\");\n\n                // Mock the the order processor\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n                _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n                var ticket = transactionHandler.AddOrder(orderRequest);\n\n                var ticket2 = transactionHandler.AddOrder(orderRequest);\n\n                // 600 after round off becomes 0 -> order is not placed\n                Assert.IsTrue(orderRequest.Response.IsProcessed);\n                Assert.IsTrue(orderRequest.Response.IsError);\n                Assert.IsTrue(orderRequest.Response.ErrorMessage\n                    .Contains(\"Cannot process submit request because order with id {0} already exists\"));\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void SendingNewOrderFromOnOrderEvent()\n        {\n            //Initializes the transaction handler\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                // Creates a market order\n                var security = _algorithm.Securities[Ticker];\n                var price = 1.12m;\n                security.SetMarketPrice(new Tick(DateTime.UtcNow.AddDays(-1), security.Symbol, price, price, price));\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 0, 0, DateTime.UtcNow, \"\");\n                var orderRequest2 = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -1000, 0, 0, 0, DateTime.UtcNow, \"\");\n                orderRequest.SetOrderId(1);\n                orderRequest2.SetOrderId(2);\n\n                // Mock the the order processor\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 1))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 2))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest2));\n                _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n                var orderEventCalls = 0;\n                brokerage.OrdersStatusChanged += (sender, orderEvents) =>\n                {\n                    orderEventCalls++;\n                    var orderEvent = orderEvents[0];\n                    switch (orderEventCalls)\n                    {\n                        case 1:\n                            Assert.AreEqual(1, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Submitted, orderEvent.Status);\n\n                            // we send a new order request\n                            var ticket2 = transactionHandler.Process(orderRequest2);\n                            break;\n                        case 2:\n                            Assert.AreEqual(2, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Submitted, orderEvent.Status);\n                            break;\n                        case 3:\n                            Assert.AreEqual(1, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Filled, orderEvent.Status);\n                            break;\n                        case 4:\n                            Assert.AreEqual(2, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Filled, orderEvent.Status);\n                            break;\n                    }\n                    Log.Trace($\"{orderEvent}\");\n                };\n\n                var ticket = transactionHandler.Process(orderRequest);\n\n                Assert.IsTrue(orderRequest.Response.IsProcessed);\n                Assert.IsTrue(orderRequest.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest.Status);\n                Assert.IsTrue(orderRequest2.Response.IsProcessed);\n                Assert.IsTrue(orderRequest2.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest2.Status);\n\n                var order1 = transactionHandler.GetOrderById(1);\n                Assert.AreEqual(OrderStatus.Filled, order1.Status);\n                var order2 = transactionHandler.GetOrderById(2);\n                Assert.AreEqual(OrderStatus.Filled, order2.Status);\n\n                // 2 submitted and 2 filled\n                Assert.AreEqual(4, orderEventCalls);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void SendingNewOrderFromPartiallyFilledOnOrderEvent()\n        {\n            //Initializes the transaction handler\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                // Creates a market order\n                var security = _algorithm.Securities[Ticker];\n                security.FillModel = new TestPartialFilledModel();\n\n                var price = 1.12m;\n                security.SetMarketPrice(new Tick(DateTime.UtcNow.AddDays(-1), security.Symbol, price, price, price));\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 2000, 0, 0, 9, DateTime.UtcNow, \"\");\n                var orderRequest2 = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -2000, 0, 0, 9, DateTime.UtcNow, \"\");\n                orderRequest.SetOrderId(1);\n                orderRequest2.SetOrderId(2);\n\n                // Mock the the order processor\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 1))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 2))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest2));\n                _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n                var orderEventCalls = 0;\n                brokerage.OrdersStatusChanged += (sender, orderEvents) =>\n                {\n                    orderEventCalls++;\n                    var orderEvent = orderEvents[0];\n                    switch (orderEventCalls)\n                    {\n                        case 1:\n                            Assert.AreEqual(1, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Submitted, orderEvent.Status);\n\n                            // we send a new order request\n                            var ticket2 = transactionHandler.Process(orderRequest2);\n                            break;\n                        case 2:\n                            Assert.AreEqual(2, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Submitted, orderEvent.Status);\n                            break;\n                        case 3:\n                            Assert.AreEqual(1, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.PartiallyFilled, orderEvent.Status);\n                            break;\n                        case 4:\n                            Assert.AreEqual(2, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.PartiallyFilled, orderEvent.Status);\n                            break;\n                        case 5:\n                            Assert.AreEqual(1, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Filled, orderEvent.Status);\n                            break;\n                        case 6:\n                            Assert.AreEqual(2, orderEvent.OrderId);\n                            Assert.AreEqual(OrderStatus.Filled, orderEvent.Status);\n                            break;\n                    }\n                    Log.Trace($\"{orderEvent}\");\n                };\n\n                var ticket = transactionHandler.Process(orderRequest);\n\n                Assert.IsTrue(orderRequest.Response.IsProcessed);\n                Assert.IsTrue(orderRequest.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest.Status);\n                Assert.IsTrue(orderRequest2.Response.IsProcessed);\n                Assert.IsTrue(orderRequest2.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest2.Status);\n\n                var order1 = transactionHandler.GetOrderById(1);\n                Assert.AreEqual(OrderStatus.Filled, order1.Status);\n                var order2 = transactionHandler.GetOrderById(2);\n                Assert.AreEqual(OrderStatus.Filled, order2.Status);\n\n                // 2 submitted and 2 PartiallyFilled and 2 Filled\n                Assert.AreEqual(6, orderEventCalls);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void ProcessesOrdersInLivePaperTrading()\n        {\n            //Initializes the transaction handler\n            var transactionHandler = new BacktestingTransactionHandler();\n            using var brokerage = new PaperBrokerage(_algorithm, null);\n            _algorithm.SetLiveMode(true);\n            transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                // Creates a market order\n                var security = _algorithm.Securities[Ticker];\n                var price = 1.12m;\n                security.SetMarketPrice(new Tick(DateTime.UtcNow.AddDays(-1), security.Symbol, price, price, price));\n                var reference = new DateTime(2025, 07, 03, 10, 0, 0);\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 0, 0, reference, \"\");\n                var orderRequest2 = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -1000, 0, 0, 0, reference.AddSeconds(1), \"\");\n                orderRequest.SetOrderId(1);\n                orderRequest2.SetOrderId(2);\n\n                // Mock the the order processor\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 1))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.Is<int>(i => i == 2))).Returns(new OrderTicket(_algorithm.Transactions, orderRequest2));\n                _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n                var allOrderEvents = new List<OrderEvent>();\n                using var eventsReceived = new AutoResetEvent(false);\n\n                brokerage.OrdersStatusChanged += (sender, orderEvents) =>\n                {\n                    var orderEvent = orderEvents[0];\n                    lock (allOrderEvents)\n                    {\n                        allOrderEvents.Add(orderEvent);\n                        if (allOrderEvents.Count == 4)\n                        {\n                            eventsReceived.Set();\n                        }\n                    }\n\n                    // Let's place another order before this one is filled\n                    if (orderEvent.OrderId == 1 && orderEvent.Status == OrderStatus.Submitted)\n                    {\n                        var ticket2 = transactionHandler.Process(orderRequest2);\n                    }\n\n                    Log.Debug($\"{orderEvent}\");\n                };\n\n                var ticket = transactionHandler.Process(orderRequest);\n\n                if (!eventsReceived.WaitOne(10000))\n                {\n                    Assert.Fail($\"Did not receive all order events, received {allOrderEvents.Count} order events: {string.Join(\", \", allOrderEvents)}\");\n                }\n\n                Assert.IsTrue(orderRequest.Response.IsProcessed);\n                Assert.IsTrue(orderRequest.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest.Status);\n\n                Assert.IsTrue(orderRequest2.Response.IsProcessed);\n                Assert.IsTrue(orderRequest2.Response.IsSuccess);\n                Assert.AreEqual(OrderRequestStatus.Processed, orderRequest2.Status);\n\n                var order1 = transactionHandler.GetOrderById(1);\n                Assert.AreEqual(OrderStatus.Filled, order1.Status);\n\n                var order2 = transactionHandler.GetOrderById(2);\n                Assert.AreEqual(OrderStatus.Filled, order2.Status);\n\n                // 2 submitted and 2 filled\n                Assert.AreEqual(4, allOrderEvents.Count);\n\n                var firstOrderSubmittedEvent = allOrderEvents.FirstOrDefault(x => x.OrderId == 1 && x.Status == OrderStatus.Submitted);\n                Assert.IsNotNull(firstOrderSubmittedEvent);\n                var firstOrderFilledEvent = allOrderEvents.FirstOrDefault(x => x.OrderId == 1 && x.Status == OrderStatus.Filled);\n                Assert.IsNotNull(firstOrderFilledEvent);\n\n                var secondOrderSubmittedEvent = allOrderEvents.FirstOrDefault(x => x.OrderId == 2 && x.Status == OrderStatus.Submitted);\n                Assert.IsNotNull(secondOrderSubmittedEvent);\n                var secondOrderFilledEvent = allOrderEvents.FirstOrDefault(x => x.OrderId == 2 && x.Status == OrderStatus.Filled);\n                Assert.IsNotNull(secondOrderFilledEvent);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void ProcessesOrdersConcurrentlyInLivePaperTrading()\n        {\n            _algorithm.SetLiveMode(true);\n            using var brokerage = new PaperBrokerage(_algorithm, null);\n\n            const int expectedOrdersCount = 20;\n            using var finishedEvent = new ManualResetEventSlim(false);\n            var transactionHandler = new TestablePaperBrokerageTransactionHandler(expectedOrdersCount, finishedEvent);\n            transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n            \n            try\n            {\n                _algorithm.Transactions.SetOrderProcessor(transactionHandler);\n\n                var security = (Security)_algorithm.AddEquity(\"SPY\");\n                _algorithm.SetFinishedWarmingUp();\n\n                // Set up security\n                var reference = new DateTime(2025, 07, 03, 10, 0, 0);\n                security.SetMarketPrice(new Tick(reference, security.Symbol, 300, 300));\n\n                // Creates the order\n                var orderRequests = Enumerable.Range(0, expectedOrdersCount)\n                    .Select(_ => new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 0, 0, reference, \"\"))\n                    .ToList();\n\n                // Act\n                for (var i = 0; i < orderRequests.Count; i++)\n                {\n                    var orderRequest = orderRequests[i];\n                    orderRequest.SetOrderId(i + 1);\n                    transactionHandler.Process(orderRequest);\n                }\n\n                // Wait for all orders to be processed\n                Assert.IsTrue(finishedEvent.Wait(10000));\n                Assert.Greater(transactionHandler.ProcessingThreadNames.Count, 1);\n                CollectionAssert.AreEquivalent(orderRequests.Select(x => x.ToString()), transactionHandler.ProcessedRequests.Select(x => x.ToString()));\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        private class TestablePaperBrokerageTransactionHandler : BacktestingTransactionHandler\n        {\n            private readonly int _expectedOrdersCount;\n            private readonly ManualResetEventSlim _finishedEvent;\n            private int _currentOrdersCount;\n\n            public HashSet<string> ProcessingThreadNames = new();\n\n            public ConcurrentBag<OrderRequest> ProcessedRequests = new();\n\n            public TestablePaperBrokerageTransactionHandler(int expectedOrdersCount, ManualResetEventSlim finishedEvent)\n            {\n                _expectedOrdersCount = expectedOrdersCount;\n                _finishedEvent = finishedEvent;\n            }\n\n            public override void HandleOrderRequest(OrderRequest request)\n            {\n                base.HandleOrderRequest(request);\n\n                // Capture the thread name for debugging purposes\n                lock (ProcessingThreadNames)\n                {\n                    ProcessingThreadNames.Add(Thread.CurrentThread.Name ?? Environment.CurrentManagedThreadId.ToStringInvariant());\n                }\n\n                ProcessedRequests.Add(request);\n\n                if (Interlocked.Increment(ref _currentOrdersCount) >= _expectedOrdersCount)\n                {\n                    // Signal that we have processed the expected number of orders\n                    _finishedEvent.Set();\n                }\n            }\n        }\n\n        internal class TestPartialFilledModel : IFillModel\n        {\n            public static Dictionary<int, Order> FilledOrders;\n\n            public Fill Fill(FillModelParameters parameters)\n            {\n                var order = parameters.Order;\n                var status = OrderStatus.PartiallyFilled;\n                if (FilledOrders.ContainsKey(order.Id))\n                {\n                    status = OrderStatus.Filled;\n                }\n                FilledOrders[order.Id] = order;\n                return new Fill(new OrderEvent(order, DateTime.UtcNow, OrderFee.Zero)\n                {\n                    FillPrice = parameters.Security.Price,\n                    FillQuantity = order.Quantity / 2,\n                    Status = status\n                });\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/BrokerageTransactionHandlerTests/BrokerageTransactionHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Tests.Engine.Setup;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Tests.Engine.BrokerageTransactionHandlerTests\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class BrokerageTransactionHandlerTests\n    {\n        private const string Ticker = \"EURUSD\";\n        private MethodInfo _handleOptionNotification;\n        private TestAlgorithm _algorithm;\n        private Symbol _symbol;\n        private TestBrokerageTransactionHandler _transactionHandler;\n\n        [SetUp]\n        public void Initialize()\n        {\n            _algorithm = new TestAlgorithm { HistoryProvider = new EmptyHistoryProvider() };\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _algorithm.SetBrokerageModel(BrokerageName.FxcmBrokerage);\n            _algorithm.SetCash(100000);\n            _symbol = _algorithm.AddSecurity(SecurityType.Forex, Ticker).Symbol;\n            _algorithm.SetFinishedWarmingUp();\n\n            _handleOptionNotification = typeof(BrokerageTransactionHandler).GetMethod(\"HandleOptionNotification\", BindingFlags.NonPublic | BindingFlags.Instance);\n            Assert.IsNotNull(_handleOptionNotification);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler?.Exit();\n        }\n\n        private static SubmitOrderRequest MakeOrderRequest(Security security, OrderType orderType, DateTime date)\n        {\n            var groupOrderManager = new GroupOrderManager(1, 1, 100, orderType == OrderType.ComboLimit ? 100 : 0);\n\n            return orderType switch\n            {\n                OrderType.Market => new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1, 0, 0, date, \"\"),\n                OrderType.Limit => new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1, 0, 290, date, \"\"),\n                OrderType.StopMarket => new SubmitOrderRequest(OrderType.StopMarket, security.Type, security.Symbol, 1, 305, 0, date, \"\"),\n                OrderType.StopLimit => new SubmitOrderRequest(OrderType.StopLimit, security.Type, security.Symbol, 1, 305, 295, date, \"\"),\n                OrderType.MarketOnOpen => new SubmitOrderRequest(OrderType.MarketOnOpen, security.Type, security.Symbol, 1, 0, 0, date, \"\"),\n                OrderType.MarketOnClose => new SubmitOrderRequest(OrderType.MarketOnClose, security.Type, security.Symbol, 1, 0, 0, date, \"\"),\n                OrderType.LimitIfTouched => new SubmitOrderRequest(OrderType.LimitIfTouched, security.Type, security.Symbol, 1, 0, 300, 305, date, \"\"),\n                OrderType.OptionExercise => new SubmitOrderRequest(OrderType.OptionExercise, security.Type, security.Symbol, 1, 0, 0, date, \"\"),\n                OrderType.ComboMarket => new SubmitOrderRequest(OrderType.ComboMarket, security.Type, security.Symbol, 1, 0, 0, date, \"\", groupOrderManager: groupOrderManager),\n                OrderType.ComboLimit => new SubmitOrderRequest(OrderType.ComboLimit, security.Type, security.Symbol, 1, 295, 0, date, \"\", groupOrderManager: groupOrderManager),\n                OrderType.ComboLegLimit => new SubmitOrderRequest(OrderType.ComboLegLimit, security.Type, security.Symbol, 1, 295, 0, date, \"\", groupOrderManager: groupOrderManager),\n                OrderType.TrailingStop => new SubmitOrderRequest(OrderType.TrailingStop, security.Type, security.Symbol, 1, 305, 0, 305, date, \"\"),\n                _ => throw new ArgumentOutOfRangeException(nameof(orderType), orderType, null)\n            };\n        }\n\n        [TestCase(\"1\", 3)]\n        public void RetrieveComboOrdersWithTheSameBrokerageIdEvenIfOneOfThemIsFilled(string brokerageOrderId, int expectedComboOrdersCount)\n        {\n            var symbol = Symbols.AAPL;\n            _algorithm.AddSecurity(symbol);\n            _algorithm.Securities[symbol].SetMarketPrice(new Tick(DateTime.UtcNow.AddDays(-1), symbol, 220m, 220m, 220m));\n\n            var transactionHandler = new BrokerageTransactionHandler();\n            using var brokerage = new TestingBrokerage();\n            transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                var groupOrderManager = new GroupOrderManager(1, 3, 10);\n\n                var comboOrders = new List<ComboMarketOrder>\n                {\n                    new ComboMarketOrder(symbol, 10m, DateTime.UtcNow, groupOrderManager) { Status = OrderStatus.Submitted },\n                    new ComboMarketOrder(symbol, -10m, DateTime.UtcNow, groupOrderManager) { Status = OrderStatus.PartiallyFilled },\n                    new ComboMarketOrder(symbol, 10m, DateTime.UtcNow, groupOrderManager) { Status = OrderStatus.Filled }\n                };\n\n                foreach (var comboOrder in comboOrders)\n                {\n                    comboOrder.BrokerId.Add(brokerageOrderId);\n                    transactionHandler.AddOpenOrder(comboOrder, _algorithm);\n                }\n\n                var openOrders = transactionHandler.GetOrdersByBrokerageId(brokerageOrderId);\n\n                Assert.IsNotEmpty(openOrders);\n                Assert.That(openOrders.Count, Is.EqualTo(expectedComboOrdersCount));\n                Assert.True(openOrders.Any(o => o.Status == OrderStatus.Submitted));\n                Assert.True(openOrders.Any(o => o.Status == OrderStatus.PartiallyFilled));\n                Assert.True(openOrders.Any(o => o.Status == OrderStatus.Filled));\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void OrderTagIsSetToTheDefaultOne([Values] OrderType orderType)\n        {\n            var reference = new DateTime(2024, 01, 25, 10, 0, 0);\n\n            // Initialize the algorithm\n            var algorithm = new TestAlgorithm { HistoryProvider = new EmptyHistoryProvider() };\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetCash(100000);\n            var security = (Security)algorithm.AddEquity(\"SPY\");\n            algorithm.SetFinishedWarmingUp();\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algorithm);\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n\n            // Set up security\n            security.SetMarketPrice(new Tick(reference, security.Symbol, 300, 300));\n            if (orderType == OrderType.OptionExercise)\n            {\n                algorithm.AddOption(security.Symbol);\n                security = algorithm.AddOptionContract(Symbol.CreateOption(security.Symbol, Market.USA, OptionStyle.American, OptionRight.Call,\n                    300, reference.AddDays(4).Date));\n                security.SetMarketPrice(new Tick(reference, security.Symbol, 10, 10));\n            }\n\n            // Creates the order\n            var orderRequest = MakeOrderRequest(security, orderType, reference);\n\n            // Mock the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(algorithm.Transactions, orderRequest));\n            algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket.Status);\n\n            // Assert the order tag is set to the default one\n            var order = _transactionHandler.GetOpenOrders().Single();\n            Assert.AreEqual(orderType, order.Type);\n            Assert.AreEqual(order.GetDefaultTag(), order.Tag);\n        }\n\n        [Test]\n        public void OrderQuantityIsFlooredToNearestMultipleOfLotSizeWhenLongOrderIsRounded()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            // 1600 after round off becomes 1000\n            Assert.AreEqual(1000, orderTicket.Quantity);\n        }\n\n        [Test]\n        public void BrokerageOrderIdChanged()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var testBrokerage = new TestBroker(_algorithm, true);\n            _transactionHandler.Initialize(_algorithm, testBrokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            var originalBrokerageOrderId = _transactionHandler.GetOrderById(orderTicket.OrderId).BrokerId;\n            var orderIdChanged = new BrokerageOrderIdChangedEvent { OrderId = orderTicket.OrderId, BrokerId = new List<string> { \"asd\" } };\n            testBrokerage.OnOrderIdChangedEventPublic(orderIdChanged);\n\n            var newBrokerageOrderId = _transactionHandler.GetOrderById(orderTicket.OrderId).BrokerId;\n            Assert.AreNotEqual(originalBrokerageOrderId, newBrokerageOrderId);\n            Assert.AreEqual(1, newBrokerageOrderId.Count);\n            Assert.AreEqual(\"asd\", newBrokerageOrderId[0]);\n        }\n\n        [Test]\n        public void OrderQuantityIsCeiledToNearestMultipleOfLotSizeWhenShortOrderIsRounded()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -1600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            // -1600 after round off becomes -1000\n            Assert.AreEqual(-1000, orderTicket.Quantity);\n        }\n\n        [Test]\n        public void OrderIsNotPlacedWhenOrderIsLowerThanLotSize()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // 600 after round off becomes 0 -> order is not placed\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsError);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Invalid);\n        }\n\n        [Test]\n        public void GetOpenOrderTicketsDoesWorksCorrectly()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            var newTicket = _transactionHandler.GetOpenOrderTickets(ticket => ticket.Symbol == security.Symbol).Single();\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            Assert.AreEqual(newTicket, orderTicket);\n\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsFalse(orderRequest.Response.IsError);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n\n            var processedTicket = _transactionHandler.GetOpenOrderTickets(ticket => ticket.Symbol == security.Symbol).ToList();\n            Assert.IsNotEmpty(processedTicket);\n        }\n\n        [Test]\n        public void GetOpenOrderTicketsDoesNotReturnInvalidatedOrder()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            var newTicket = _transactionHandler.GetOpenOrderTickets(ticket => ticket.Symbol == security.Symbol).Single();\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            Assert.AreEqual(newTicket, orderTicket);\n\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // 600 after round off becomes 0 -> order is not placed\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsError);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Invalid);\n\n            var processedTicket = _transactionHandler.GetOpenOrderTickets(ticket => ticket.Symbol == security.Symbol).ToList();\n            Assert.IsEmpty(processedTicket);\n        }\n\n        [TestCase(\"NDX\", \"1.14\", \"1.15\")]\n        [TestCase(\"NDX\", \"1.16\", \"1.15\")]\n        [TestCase(\"NDX\", \"4.14\", \"4.10\")]\n        [TestCase(\"NDX\", \"4.16\", \"4.20\")]\n        [TestCase(\"VIX\", \"1.14\", \"1.14\")]\n        [TestCase(\"VIX\", \"1.16\", \"1.16\")]\n        [TestCase(\"VIX\", \"4.14\", \"4.15\")]\n        [TestCase(\"VIX\", \"4.18\", \"4.20\")]\n        [TestCase(\"VIXW\", \"1.14\", \"1.14\")]\n        [TestCase(\"VIXW\", \"1.16\", \"1.16\")]\n        [TestCase(\"VIXW\", \"4.14\", \"4.14\")]\n        [TestCase(\"VIXW\", \"4.16\", \"4.16\")]\n        public void DynamicIndexOptionPriceRoundeding(string indexOption, string orderPriceStr, string expectedPriceStr)\n        {\n            var orderPrice = decimal.Parse(orderPriceStr, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture);\n            var expectedPrice = decimal.Parse(expectedPriceStr, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture);\n\n            //Initializes the transaction handler\n            _algorithm.SetBrokerageModel(new DefaultBrokerageModel());\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.AddIndexOption(indexOption);\n            var price = 1.12129m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 10, orderPrice, orderPrice, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            Assert.AreEqual(10, orderTicket.Quantity);\n            // 1.16 after round becomes 1.10\n            Assert.AreEqual(expectedPrice, orderTicket.Get(OrderField.LimitPrice));\n        }\n\n        [Test]\n        public void LimitOrderPriceIsRounded()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12129m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1600, 1.12121212m, 1.12121212m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            // 1600 after round off becomes 1000\n            Assert.AreEqual(1000, orderTicket.Quantity);\n            // 1.12121212 after round becomes 1.12121\n            Assert.AreEqual(1.12121m, orderTicket.Get(OrderField.LimitPrice));\n        }\n\n        [Test]\n        public void StopMarketOrderPriceIsRounded()\n        {\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12129m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.StopMarket, security.Type, security.Symbol, 1600, 1.12131212m, 1.12131212m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            // 1600 after round off becomes 1000\n            Assert.AreEqual(1000, orderTicket.Quantity);\n            // 1.12131212 after round becomes 1.12131\n            Assert.AreEqual(1.12131m, orderTicket.Get(OrderField.StopPrice));\n        }\n\n        [Test]\n        public void TrailingStopOrderPriceIsRounded([Values] bool trailingAsPercentage)\n        {\n            //Initialize the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Create the order\n            _algorithm.SetBrokerageModel(new DefaultBrokerageModel());\n            var security = _algorithm.AddEquity(\"SPY\");\n            security.PriceVariationModel = new EquityPriceVariationModel();\n            var price = 330.12129m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.TrailingStop, security.Type, security.Symbol, 100, stopPrice: 300.12121212m, 0, 0,\n                trailingAmount: 20.12121212m, trailingAsPercentage, DateTime.Now, \"\");\n\n            // Mock the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.New);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            // 300.12121212 after round becomes 300.12\n            Assert.AreEqual(300.12m, orderTicket.Get(OrderField.StopPrice));\n            // If trailing amount is not a price, it's not rounded\n            Assert.AreEqual(trailingAsPercentage ? 20.12121212m : 20.12, orderTicket.Get(OrderField.TrailingAmount));\n        }\n\n        // 331.12121212m after round becomes 331.12m, the smallest price variation is 0.01 - index. For index options it is 0.1\n        [TestCase(OrderType.ComboLimit, 300.12121212, 0, 0, 300.12, 300.12)]\n        [TestCase(OrderType.ComboLegLimit, 0, 1.12121212, 300.13131313, 1.12, 300.1)]\n        [TestCase(OrderType.ComboLegLimit, 0, 1.12121212, 300.15151515, 1.12, 300.2)]\n        public void ComboLimitOrderPriceIsRounded(OrderType orderType, decimal groupOrderLimitPrice, decimal leg1LimitPrice, decimal leg2LimitPrice,\n            decimal expectedLeg1LimitPrice, decimal expectedLeg2LimitPrice)\n        {\n            var algorithm = new TestAlgorithm { HistoryProvider = new EmptyHistoryProvider() };\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetBrokerageModel(BrokerageName.Default);\n            algorithm.SetCash(1000000);\n            var symbol1 = algorithm.AddIndex(\"SPX\").Symbol;\n            var symbol2 = Symbol.CreateOption(symbol1, Market.USA, OptionStyle.European, OptionRight.Put, 300m, new DateTime(2024, 05, 16));\n            algorithm.AddIndexOptionContract(symbol2);\n            algorithm.SetFinishedWarmingUp();\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algorithm);\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n\n            var expectedGroupOrderLimitPrice = 0m;\n            if (orderType == OrderType.ComboLimit)\n            {\n                // legs have the same global limit price\n                leg1LimitPrice = groupOrderLimitPrice;\n                leg2LimitPrice = groupOrderLimitPrice;\n                expectedGroupOrderLimitPrice = expectedLeg2LimitPrice = expectedLeg1LimitPrice;\n            }\n            else if (orderType == OrderType.ComboLegLimit)\n            {\n                // Each leg has its own limit price\n                groupOrderLimitPrice = 0m;\n                expectedGroupOrderLimitPrice = 0m;\n            }\n\n            // Creates the orders\n            var dateTime = new DateTime(2024, 05, 14, 12, 0, 0);\n            var groupOrderManager = new GroupOrderManager(1, 2, 10, groupOrderLimitPrice);\n\n            var security1 = algorithm.Securities[symbol1];\n            var price1 = 1.12129m;\n            security1.SetMarketPrice(new Tick(dateTime, security1.Symbol, price1, price1, price1));\n            var orderRequest1 = new SubmitOrderRequest(orderType, security1.Type, security1.Symbol, 20, leg1LimitPrice, leg1LimitPrice,\n                dateTime, \"\", groupOrderManager: groupOrderManager);\n\n            var security2 = algorithm.Securities[symbol2];\n            var price2 = 330.12129m;\n            security2.SetMarketPrice(new Tick(dateTime, security2.Symbol, price2, price2, price2));\n            var orderRequest2 = new SubmitOrderRequest(orderType, security2.Type, security2.Symbol, 10, leg2LimitPrice, leg2LimitPrice,\n                dateTime, \"\", groupOrderManager: groupOrderManager);\n\n            orderRequest1.SetOrderId(1);\n            orderRequest2.SetOrderId(2);\n            groupOrderManager.OrderIds.Add(1);\n            groupOrderManager.OrderIds.Add(2);\n\n            // Mock the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(1)).Returns(new OrderTicket(algorithm.Transactions, orderRequest1));\n            orderProcessorMock.Setup(m => m.GetOrderTicket(2)).Returns(new OrderTicket(algorithm.Transactions, orderRequest2));\n            algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket1 = _transactionHandler.Process(orderRequest1);\n            Assert.AreEqual(OrderStatus.New, orderTicket1.Status);\n            _transactionHandler.HandleOrderRequest(orderRequest1);\n\n            var orderTicket2 = _transactionHandler.Process(orderRequest2);\n            Assert.AreEqual(OrderStatus.New, orderTicket2.Status);\n            _transactionHandler.HandleOrderRequest(orderRequest2);\n\n            // Assert\n            Assert.IsTrue(orderRequest1.Response.IsProcessed);\n            Assert.IsTrue(orderRequest1.Response.IsSuccess);\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket1.Status);\n            Assert.AreEqual(expectedLeg1LimitPrice, orderTicket1.Get(OrderField.LimitPrice));\n\n            Assert.IsTrue(orderRequest2.Response.IsProcessed);\n            Assert.IsTrue(orderRequest2.Response.IsSuccess);\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket2.Status);\n            Assert.AreEqual(expectedLeg2LimitPrice, orderTicket2.Get(OrderField.LimitPrice));\n\n            Assert.AreEqual(expectedGroupOrderLimitPrice, groupOrderManager.LimitPrice);\n        }\n\n        [Test]\n        public void OrderCancellationTransitionsThroughCancelPendingStatus()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n\n            // Cancel the order\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            _transactionHandler.Process(cancelRequest);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.IsTrue(cancelRequest.Status == OrderRequestStatus.Processing);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.CancelPending);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.IsTrue(cancelRequest.Status == OrderRequestStatus.Processed);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Canceled);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n\n            // Check CancelPending was sent\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 3);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Canceled), 1);\n        }\n\n        [TestCase(0.9, 1.123456789, 1.12)]\n        [TestCase(0.9, 0.987654321, 0.9877)]\n        [TestCase(0.9, 0.999999999, 1)]\n        [TestCase(0.9, 1, 1)]\n        [TestCase(0.9, 1.000000001, 1)]\n        [TestCase(1.1, 1.123456789, 1.12)]\n        [TestCase(1.1, 0.987654321, 0.9877)]\n        [TestCase(1.1, 0.999999999, 1)]\n        [TestCase(1.1, 1, 1)]\n        [TestCase(1.1, 1.000000001, 1)]\n        public void RoundsEquityLimitOrderPricesCorrectly(decimal securityPrice, decimal orderPrice, decimal expected)\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetLiveMode(true);\n\n            var security = algo.AddEquity(\"YGTY\");\n            security.SetMarketPrice(new Tick { Value = securityPrice });\n\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            var brokerage = new Mock<IBrokerage>();\n            _transactionHandler.Initialize(algo, brokerage.Object, null);\n\n            var order = new LimitOrder(security.Symbol, 1000, orderPrice, DateTime.UtcNow);\n            _transactionHandler.RoundOrderPrices(order, security);\n\n            Assert.AreEqual(expected, order.LimitPrice);\n        }\n\n        [Test]\n        public void RoundOff_Long_Fractional_Orders()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetBrokerageModel(BrokerageName.Default);\n            algo.SetCash(100000);\n\n            // Sets the Security\n\n            var security = algo.AddSecurity(SecurityType.Crypto, \"BTCUSD\", Resolution.Hour, Market.Coinbase, false, 1m, true);\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algo);\n            _transactionHandler.Initialize(algo, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 123.123456789m, 0, 0, DateTime.Now, \"\");\n            var order = Order.CreateOrder(orderRequest);\n            var actual = _transactionHandler.RoundOffOrder(order, security);\n\n            Assert.AreEqual(123.12345678m, actual);\n        }\n\n        [Test]\n        public void PriceRoundingWarningLogsOnlyOnceWithMultipleOrders()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetBrokerageModel(BrokerageName.Default);\n\n            var security = algo.AddSecurity(SecurityType.Equity, \"SPY\", Resolution.Minute, Market.USA, false, 1m, false);\n            security.PriceVariationModel = new TestPriceVariationModel(0.01m);\n\n            var transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algo);\n            transactionHandler.Initialize(algo, brokerage, new BacktestingResultHandler());\n            var hasLoggedField = typeof(BrokerageTransactionHandler).GetField(\"_hasLoggedPriceRoundingWarning\", BindingFlags.NonPublic | BindingFlags.Instance);\n            var hasLogged = (bool)hasLoggedField.GetValue(transactionHandler);\n\n            Assert.IsFalse(hasLogged);\n\n            var date = new DateTime(2013, 10, 7, 9, 35, 0);\n            var orders = new[]\n            {\n                new LimitOrder(security.Symbol, 1000, 123.252m, date),\n                new LimitOrder(security.Symbol, 1000, 234.259m, date.AddDays(1)),\n                new LimitOrder(security.Symbol, 1000, 345.225m, date.AddDays(2)),\n                new LimitOrder(security.Symbol, 1000, 456.235m, date.AddDays(3))\n            };\n\n            for (int i = 0; i < orders.Length; i++)\n            {\n                transactionHandler.RoundOrderPrices(orders[i], security);\n                hasLogged = (bool)hasLoggedField.GetValue(transactionHandler);\n                Assert.IsTrue(hasLogged);\n            }\n        }\n\n        [Test]\n        public void RoundOff_Short_Fractional_Orders()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetBrokerageModel(BrokerageName.Default);\n            algo.SetCash(100000);\n\n            // Sets the Security\n\n            var security = algo.AddSecurity(SecurityType.Crypto, \"BTCUSD\", Resolution.Hour, Market.Coinbase, false, 1m, true);\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algo);\n            _transactionHandler.Initialize(algo, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -123.123456789m, 0, 0, DateTime.Now, \"\");\n            var order = Order.CreateOrder(orderRequest);\n            var actual = _transactionHandler.RoundOffOrder(order, security);\n\n            Assert.AreEqual(-123.12345678m, actual);\n        }\n\n        [Test]\n        public void RoundOff_LessThanLotSize_Fractional_Orders()\n        {\n            var algo = new QCAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetBrokerageModel(BrokerageName.Default);\n            algo.SetCash(100000);\n\n            // Sets the Security\n\n            var security = algo.AddSecurity(SecurityType.Crypto, \"BTCUSD\", Resolution.Hour, Market.Coinbase, false, 1m, true);\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(algo);\n            _transactionHandler.Initialize(algo, brokerage, new BacktestingResultHandler());\n\n            // Creates the order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 0.000000009m, 0, 0, DateTime.Now, \"\");\n            var order = Order.CreateOrder(orderRequest);\n            var actual = _transactionHandler.RoundOffOrder(order, security);\n\n            Assert.AreEqual(0, actual);\n        }\n\n        [Test]\n        public void InvalidUpdateOrderRequestShouldNotInvalidateCanceledOrder()\n        {\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new NoSubmitTestBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Submitted });\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket.Status);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields() { Quantity = 10000 });\n            var updateTicket = _transactionHandler.Process(updateRequest);\n            _transactionHandler.HandleOrderRequest(updateRequest);\n            Assert.AreEqual(OrderRequestStatus.Processed, updateRequest.Status);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n\n            // Canceled!\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Canceled });\n\n            Assert.AreEqual(OrderStatus.Canceled, orderTicket.Status);\n\n            // update failed!\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Invalid });\n\n            // nothing should change\n            Assert.AreEqual(OrderStatus.Canceled, orderTicket.Status);\n        }\n\n        [Test]\n        public void InvalidUpdateOrderRequestShouldNotInvalidateFilledOrder()\n        {\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new NoSubmitTestBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Submitted });\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket.Status);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields() { Quantity = 10000 });\n            var updateTicket = _transactionHandler.Process(updateRequest);\n            _transactionHandler.HandleOrderRequest(updateRequest);\n            Assert.AreEqual(OrderRequestStatus.Processed, updateRequest.Status);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n\n            // filled!\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Filled, FillQuantity = 1000, FillPrice = price });\n\n            Assert.AreEqual(1000, security.Holdings.Quantity);\n            Assert.AreEqual(price, security.Holdings.AveragePrice);\n            Assert.AreEqual(OrderStatus.Filled, orderTicket.Status);\n\n            // update failed!\n            brokerage.PublishOrderEvent(new OrderEvent(_algorithm.Transactions.GetOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Invalid });\n\n            // nothing should change\n            Assert.AreEqual(1000, security.Holdings.Quantity);\n            Assert.AreEqual(price, security.Holdings.AveragePrice);\n            Assert.AreEqual(OrderStatus.Filled, orderTicket.Status);\n        }\n\n        [Test]\n        public void InvalidUpdateOrderRequestShouldNotInvalidateOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n            _algorithm.SetBrokerageModel(new TestBrokerageModel());\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields());\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            _transactionHandler.HandleOrderRequest(updateRequest);\n            Assert.IsFalse(updateRequest.Response.ErrorMessage.IsNullOrEmpty());\n            Assert.IsTrue(updateRequest.Response.IsError);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Message.Contains(\"unable to update order\")), 1);\n            Assert.IsTrue(_algorithm.OrderEvents.TrueForAll(orderEvent => orderEvent.Status == OrderStatus.Submitted));\n        }\n\n        [Test]\n        public void UpdateOrderRequestShouldWork()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields());\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n            Assert.AreEqual(OrderStatus.Submitted, orderTicket.Status);\n\n            _transactionHandler.HandleOrderRequest(updateRequest);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n            Assert.AreEqual(OrderStatus.UpdateSubmitted, orderTicket.Status);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.IsTrue(_algorithm.OrderEvents[0].Status == OrderStatus.Submitted);\n            Assert.IsTrue(_algorithm.OrderEvents[1].Status == OrderStatus.UpdateSubmitted);\n        }\n\n        [Test]\n        public void UpdatePartiallyFilledOrderRequestShouldWork()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using (var broker = new BacktestingBrokerage(_algorithm))\n            {\n                _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n                // Creates a limit order\n                var security = _algorithm.Securities[_symbol];\n                var originalFillModel = security.FillModel;\n                security.SetFillModel(new PartialFillModel(_algorithm, 0.5m));\n                var price = 1.12m;\n                security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0,\n                    1.11m, DateTime.Now, \"\");\n\n                // Mock the the order processor\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>()))\n                    .Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n                _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n                // Submit and process a limit order\n                var orderTicket = _transactionHandler.Process(orderRequest);\n                _transactionHandler.HandleOrderRequest(orderRequest);\n                Assert.IsTrue(orderRequest.Response.IsProcessed);\n                Assert.IsTrue(orderRequest.Response.IsSuccess);\n                Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n                broker.Scan();\n                Assert.AreEqual(orderTicket.Status, OrderStatus.PartiallyFilled);\n\n                var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields());\n                _transactionHandler.Process(updateRequest);\n                Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing);\n                Assert.IsTrue(updateRequest.Response.IsSuccess);\n                Assert.AreEqual(OrderStatus.PartiallyFilled, orderTicket.Status);\n\n                _transactionHandler.HandleOrderRequest(updateRequest);\n                Assert.IsTrue(updateRequest.Response.IsSuccess);\n                Assert.AreEqual(OrderStatus.UpdateSubmitted, orderTicket.Status);\n\n                Assert.AreEqual(_algorithm.OrderEvents.Count, 3);\n                Assert.IsTrue(_algorithm.OrderEvents[0].Status == OrderStatus.Submitted);\n                Assert.IsTrue(_algorithm.OrderEvents[1].Status == OrderStatus.PartiallyFilled);\n                Assert.IsTrue(_algorithm.OrderEvents[2].Status == OrderStatus.UpdateSubmitted);\n                security.SetFillModel(originalFillModel);\n            }\n        }\n\n        [Test]\n        public void UpdateOrderRequestShouldFailForInvalidOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var orderTicket = _algorithm.MarketOrder(security.Symbol, 1);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Invalid);\n\n            orderTicket.UpdateQuantity(10);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Invalid);\n        }\n\n        [Test]\n        public void CancelOrderRequestShouldFailForInvalidOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var orderTicket = _algorithm.MarketOrder(security.Symbol, 1);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Invalid);\n\n            orderTicket.Cancel();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Invalid);\n        }\n\n        [Test]\n        public void UpdateOrderRequestShouldFailForFilledOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields() { Quantity = 100 });\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(updateRequest.Response.IsError);\n            Assert.AreEqual(updateRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void TagUpdateOrderRequestShouldSucceedForFilledOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields() { Tag = \"New tag\" });\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(updateRequest.Response.IsSuccess);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void UpdateOrderRequestShouldFailForNewOrderStatus()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new NoSubmitTestBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields());\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(updateRequest.Response.IsError);\n            Assert.AreEqual(updateRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidNewOrderStatus);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 0);\n        }\n\n        [Test]\n        public void CancelOrderRequestShouldFailForNewOrderStatus()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new NoSubmitTestBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(cancelRequest.Response.IsError);\n            Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidNewOrderStatus);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 0);\n        }\n\n        [Test]\n        public void CancelOrderTicket()\n        {\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new NoSubmitTestBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            // will fail because order status is new\n            var response = orderTicket.Cancel();\n            Assert.IsTrue(response.IsProcessed);\n            Assert.IsTrue(response.IsError);\n            Assert.AreEqual(response.ErrorCode, OrderResponseErrorCode.InvalidNewOrderStatus);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 0);\n\n            var submitted = new OrderEvent(_algorithm.Transactions.GetOpenOrders().Single(), _algorithm.UtcTime, OrderFee.Zero)\n            { Status = OrderStatus.Submitted };\n            brokerage.PublishOrderEvent(submitted);\n\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var response2 = orderTicket.Cancel();\n            Assert.IsTrue(response2.IsProcessed);\n            Assert.IsFalse(response2.IsError);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n        }\n\n        [Test]\n        public void CancelOrderRequestShouldFailForFilledOrder()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(cancelRequest.Response.IsError);\n            Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void SyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectly()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new TestBroker(_algorithm, false);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsTrue(cancelRequest.Response.IsError);\n            Assert.IsTrue(cancelRequest.Response.ErrorMessage.Contains(\"Brokerage failed to cancel order\"));\n\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 2);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n        }\n\n        [Test]\n        public void AsyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectly()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new TestBroker(_algorithm, true);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processed);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsFalse(cancelRequest.Response.IsError);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 3);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void AsyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectlyWithIntermediateUpdate()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new TestBroker(_algorithm, true);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsTrue(cancelRequest.Response.IsError);\n            Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 3);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void SyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectlyWithIntermediateUpdate()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new TestBroker(_algorithm, false);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            _transactionHandler.Process(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 1);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing);\n            Assert.IsTrue(cancelRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending);\n\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.AreEqual(_transactionHandler.CancelPendingOrdersSize, 0);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n            Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(cancelRequest.Response.IsProcessed);\n            Assert.IsTrue(cancelRequest.Response.IsError);\n            Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus);\n\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 3);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1);\n        }\n\n        [Test]\n        public void UpdateOrderRequestShouldFailForInvalidOrderId()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            var updateRequest = new UpdateOrderRequest(DateTime.Now, -10, new UpdateOrderFields());\n            _transactionHandler.Process(updateRequest);\n            Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Error);\n            Assert.IsTrue(updateRequest.Response.IsError);\n\n            Assert.IsTrue(_algorithm.OrderEvents.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void GetOpenOrdersWorksForSubmittedFilledStatus()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            Assert.AreEqual(_transactionHandler.GetOpenOrders().Count, 0);\n\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted);\n            var openOrders = _transactionHandler.GetOpenOrders();\n            Assert.AreEqual(openOrders.Count, 1);\n            Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId);\n            broker.Scan();\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Filled);\n            Assert.AreEqual(_transactionHandler.GetOpenOrders().Count, 0);\n        }\n\n        [Test]\n        public void GetOpenOrdersWorksForCancelPendingCanceledStatus()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Creates a limit order\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            Assert.AreEqual(_transactionHandler.GetOpenOrders().Count, 0);\n            // Submit and process a limit order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n            var openOrders = _transactionHandler.GetOpenOrders();\n            Assert.AreEqual(openOrders.Count, 1);\n            Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId);\n\n            // Cancel the order\n            var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, \"\");\n            _transactionHandler.Process(cancelRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.CancelPending);\n            openOrders = _transactionHandler.GetOpenOrders();\n            Assert.AreEqual(openOrders.Count, 1);\n            Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId);\n\n            _transactionHandler.HandleOrderRequest(cancelRequest);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Canceled);\n            Assert.AreEqual(_transactionHandler.GetOpenOrders().Count, 0);\n        }\n\n        [Test]\n        public void ProcessSynchronousEventsShouldPerformCashSyncOnce()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestBrokerage();\n\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n            _algorithm.SetLiveMode(true);\n\n            var lastSyncDateBefore = _transactionHandler.GetLastSyncDate();\n\n            // Advance current time UTC so cash sync is performed\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddDays(2);\n\n            _transactionHandler.ProcessSynchronousEvents();\n            var lastSyncDateAfter = _transactionHandler.GetLastSyncDate();\n\n            Assert.AreNotEqual(lastSyncDateAfter, lastSyncDateBefore);\n\n            _transactionHandler.ProcessSynchronousEvents();\n            var lastSyncDateAfterAgain = _transactionHandler.GetLastSyncDate();\n            Assert.AreEqual(lastSyncDateAfter, lastSyncDateAfterAgain);\n\n            Assert.AreEqual(1, brokerage.GetCashBalanceCallCount);\n        }\n\n        [Test]\n        public void OrderFillShouldTriggerRePerformingCashSync()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestBrokerage();\n\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n            _algorithm.SetLiveMode(true);\n\n            var lastSyncDateBefore = _transactionHandler.GetLastSyncDate();\n\n            // Advance current time UTC so cash sync is performed\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddDays(2);\n\n            // update last fill time\n            _transactionHandler.TestTimeSinceLastFill = TimeSpan.FromSeconds(15);\n\n            _transactionHandler.ProcessSynchronousEvents();\n            var lastSyncDateAfter = _transactionHandler.GetLastSyncDate();\n\n            // cash sync happened\n            Assert.AreNotEqual(lastSyncDateAfter, lastSyncDateBefore);\n\n            var count = 0;\n            while (!brokerage.ShouldPerformCashSync(_transactionHandler.TestCurrentTimeUtc))\n            {\n                count++;\n                if (count > 40)\n                {\n                    Assert.Fail(\"Timeout waiting for ShouldPerformCashSync\");\n                }\n                // delayed task should take ~10 seconds to set the perform cash sync flag up, due to TimeSinceLastFill\n                Thread.Sleep(1000);\n            }\n            _transactionHandler.ProcessSynchronousEvents();\n\n            Assert.AreEqual(2, brokerage.GetCashBalanceCallCount);\n        }\n\n        [Test]\n        public void ProcessSynchronousEventsShouldPerformCashSyncOnlyAtExpectedTime()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestBrokerage();\n\n            // This is 2 am New York\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(1, 1, 1, 7, 0, 0);\n\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n            _algorithm.SetLiveMode(true);\n\n            var lastSyncDateBefore = _transactionHandler.GetLastSyncDate();\n\n            // Advance current time UTC\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddDays(2);\n\n            _transactionHandler.ProcessSynchronousEvents();\n            var lastSyncDateAfter = _transactionHandler.GetLastSyncDate();\n\n            Assert.AreEqual(lastSyncDateAfter, lastSyncDateBefore);\n\n            Assert.AreEqual(0, brokerage.GetCashBalanceCallCount);\n        }\n\n        [Test]\n        public void EmptyCashBalanceIsValid()\n        {\n            var mock = new Mock<TestBrokerage>\n            {\n                CallBase = true\n            };\n            var cashBalance = mock.Setup(m => m.GetCashBalance()).Returns(new List<CashAmount>());\n            mock.Setup(m => m.IsConnected).Returns(true);\n            mock.Setup(m => m.ShouldPerformCashSync(It.IsAny<DateTime>())).Returns(true);\n\n            var brokerage = mock.Object;\n            Assert.IsTrue(brokerage.IsConnected);\n\n            var algorithm = new QCAlgorithm();\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(algorithm.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDataBase, algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(algorithm.Portfolio), algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            algorithm.SetLiveMode(true);\n            algorithm.SetFinishedWarmingUp();\n\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            var resultHandler = new TestResultHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, resultHandler);\n\n            // Advance current time UTC so cash sync is performed\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddDays(2);\n\n            _transactionHandler.ProcessSynchronousEvents();\n\n            resultHandler.Exit();\n\n            mock.VerifyAll();\n        }\n\n        [Test]\n        public void DoesNotLoopEndlesslyIfGetCashBalanceAlwaysThrows()\n        {\n            // simulate connect failure\n            var ib = new Mock<IBrokerage>();\n            ib.Setup(m => m.GetCashBalance()).Callback(() => { throw new Exception(\"Connection error in CashBalance\"); });\n            ib.Setup(m => m.IsConnected).Returns(false);\n            ib.Setup(m => m.ShouldPerformCashSync(It.IsAny<DateTime>())).Returns(true);\n            ib.Setup(m => m.PerformCashSync(It.IsAny<IAlgorithm>(), It.IsAny<DateTime>(), It.IsAny<Func<TimeSpan>>()))\n                .Returns(\n                    () =>\n                    {\n                        try\n                        {\n                            ib.Object.GetCashBalance();\n                        }\n                        catch (Exception)\n                        {\n                            return false;\n                        }\n                        return true;\n                    });\n\n            var brokerage = ib.Object;\n            Assert.IsFalse(brokerage.IsConnected);\n\n            var algorithm = new QCAlgorithm();\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(algorithm.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDataBase, algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(algorithm.Portfolio), algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            algorithm.SetLiveMode(true);\n            algorithm.SetFinishedWarmingUp();\n\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            var resultHandler = new TestResultHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, resultHandler);\n\n            // Advance current time UTC so cash sync is performed\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddDays(2);\n\n            try\n            {\n                while (true)\n                {\n                    _transactionHandler.ProcessSynchronousEvents();\n\n                    Assert.IsFalse(brokerage.IsConnected);\n\n                    Thread.Sleep(1000);\n                }\n            }\n            catch (Exception exception)\n            {\n                // expect exception from ProcessSynchronousEvents when max attempts reached\n                Assert.That(exception.Message.Contains(\"maximum number of attempts\"));\n            }\n\n            resultHandler.Exit();\n        }\n\n        [Test]\n        public void AddOrderWaitsForOrderToBeProcessed()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var security = algorithm.AddSecurity(SecurityType.Equity, \"SPY\");\n            security.SetMarketPrice(new Tick { Value = 150 });\n            algorithm.SetFinishedWarmingUp();\n\n            var transactionHandler = new BrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            // lets wait until the transactionHandler starts running\n            Thread.Sleep(250);\n\n            try\n            {\n                algorithm.Transactions.SetOrderProcessor(transactionHandler);\n\n                var ticket = algorithm.LimitOrder(security.Symbol, 1, 100);\n\n                var openOrders = algorithm.Transactions.GetOpenOrders();\n\n                transactionHandler.Exit();\n\n                Assert.AreEqual(1, openOrders.Count);\n                Assert.IsTrue(ticket.HasOrder);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test, Parallelizable(ParallelScope.None)]\n        public void IncrementalOrderId()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(TestIncrementalOrderIdAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: \"TestIncrementalOrderIdSetupHandler\");\n\n            Assert.AreEqual(12, TestIncrementalOrderIdAlgorithm.OrderEventIds.Count);\n        }\n\n        [Test]\n        public void InvalidOrderEventDueToNonShortableAsset()\n        {\n            // Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new TestBroker(_algorithm, false);\n            _algorithm.SetBrokerageModel(new TestShortableBrokerageModel());\n            _transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler());\n\n            var security = _algorithm.Securities[_symbol];\n            var price = 1.12m;\n            security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price));\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -1000, 0, 1.11m, DateTime.UtcNow, \"\");\n\n            // Mock the the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.Invalid);\n            Assert.AreEqual(_algorithm.OrderEvents.Count, 1);\n            Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Invalid), 1);\n        }\n\n        // Short Call --> OTM (expired worthless)\n        [TestCase(-1, OptionRight.Call, 455, 100, 450, 1, 0, 100, \"OTM\")]\n        // Short Put --> OTM (expired worthless)\n        [TestCase(-1, OptionRight.Put, 455, 100, 460, 1, 0, 100, \"OTM\")]\n        // Long Call --> OTM (expired worthless)\n        [TestCase(1, OptionRight.Call, 455, 100, 450, 1, 0, 100, \"OTM\")]\n        // Long Put --> OTM (expired worthless)\n        [TestCase(1, OptionRight.Put, 455, 100, 460, 1, 0, 100, \"OTM\")]\n        // Short Call --> ITM (assigned)\n        [TestCase(-1, OptionRight.Call, 450, 100, 455, 2, 0, 0, null)]\n        // Short Put --> ITM (assigned)\n        [TestCase(-1, OptionRight.Put, 455, 100, 450, 2, 0, 200, null)]\n        // Long Call --> ITM (auto-exercised)\n        [TestCase(1, OptionRight.Call, 450, 100, 455, 2, 0, 200, \"Automatic Exercise\")]\n        // Long Put --> ITM (auto-exercised)\n        [TestCase(1, OptionRight.Put, 455, 100, 450, 2, 0, 0, \"Automatic Exercise\")]\n        public void OptionExpirationEmitsOrderEvents(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOrderEvents,\n            int expectedOptionPosition,\n            int expectedUnderlyingPosition,\n            string expectedMessage\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 9 PM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 9, 1, 0, 0);\n\n            var parameters = new object[] { new OptionNotificationEventArgs(optionSymbol, 0) };\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n\n            var tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n\n            var ticket = tickets.First();\n            Assert.IsTrue(ticket.HasOrder);\n\n            Assert.AreEqual(expectedOrderEvents, ticket.OrderEvents.Count);\n            if (expectedMessage != null)\n            {\n                Assert.AreEqual(1, ticket.OrderEvents.Count(x => x.Message.Contains(expectedMessage, StringComparison.InvariantCulture)));\n            }\n\n            Assert.AreEqual(expectedUnderlyingPosition, algorithm.Portfolio[equity.Symbol].Quantity);\n            Assert.AreEqual(expectedOptionPosition, algorithm.Portfolio[optionSymbol].Quantity);\n\n            // let's push the same event again\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n            _transactionHandler.Exit();\n\n            // we should not see any new orders or events come through\n            tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n        }\n\n        // Long Call --> ITM (exercised early - full)\n        [TestCase(1, OptionRight.Call, 450, 100, 455, 2, 0, 200, \"Automatic Exercise\")]\n        // Long Put --> ITM (exercised early - full)\n        [TestCase(1, OptionRight.Put, 455, 100, 450, 2, 0, 0, \"Automatic Exercise\")]\n        // Long Call --> ITM (exercised early - partial)\n        [TestCase(3, OptionRight.Call, 450, 100, 455, 2, 1, 300, \"Automatic Exercise\")]\n        // Long Put --> ITM (exercised early - partial)\n        [TestCase(3, OptionRight.Put, 455, 300, 450, 2, 1, 100, \"Automatic Exercise\")]\n        public void EarlyExerciseEmitsOrderEvents(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOrderEvents,\n            int expectedOptionPosition,\n            int expectedUnderlyingPosition,\n            string expectedMessage\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 10 AM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 8, 14, 0, 0);\n\n            // Creates an exercise order\n            var exerciseQuantity = initialOptionPosition - expectedOptionPosition;\n            var orderRequest = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, -exerciseQuantity, 0, 0, _transactionHandler.TestCurrentTimeUtc, \"\");\n\n            // Submit and process the exercise order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            var parameters = new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) };\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n\n            var tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n\n            var ticket = tickets.First();\n            Assert.IsTrue(ticket.HasOrder);\n\n            Assert.AreEqual(expectedOrderEvents, ticket.OrderEvents.Count);\n            Assert.AreEqual(1, ticket.OrderEvents.Count(x => x.Message.Contains(expectedMessage, StringComparison.InvariantCulture)));\n\n            Assert.AreEqual(expectedUnderlyingPosition, algorithm.Portfolio[equity.Symbol].Quantity);\n            Assert.AreEqual(expectedOptionPosition, algorithm.Portfolio[optionSymbol].Quantity);\n\n            // let's push the same event again\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n            _transactionHandler.Exit();\n\n            // we should not see any new orders or events come through\n            tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n        }\n\n        // Long Call --> ITM (exercised early - full)\n        [TestCase(1, OptionRight.Call, 450, 100, 455, 1, 0, \"Automatic Exercise\")]\n        // Long Put --> ITM (exercised early - full)\n        [TestCase(1, OptionRight.Put, 455, 100, 450, 1, 0, \"Automatic Exercise\")]\n        // Long Call --> ITM (exercised early - partial)\n        [TestCase(3, OptionRight.Call, 450, 100, 455, 1, 1, \"Automatic Exercise\")]\n        // Long Put --> ITM (exercised early - partial)\n        [TestCase(3, OptionRight.Put, 455, 300, 450, 1, 1, \"Automatic Exercise\")]\n        public void EarlyExerciseDoesNotEmitsOrderEvents(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOrderEvents,\n            int expectedOptionPosition,\n            string expectedMessage\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 10 AM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 8, 14, 0, 0);\n\n            // Creates an exercise order\n            var exerciseQuantity = initialOptionPosition - expectedOptionPosition;\n            var orderRequest = new SubmitOrderRequest(OrderType.OptionExercise, option.Type, option.Symbol, -exerciseQuantity, 0, 0, _transactionHandler.TestCurrentTimeUtc, \"\");\n\n            // Submit and process the exercise order\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.AreEqual(orderTicket.Status, OrderStatus.New);\n\n            // Fill the exercise order\n            brokerage.PublishOrderEvent(new OrderEvent(orderTicket.OrderId, option.Symbol, _transactionHandler.TestCurrentTimeUtc,\n                OrderStatus.Filled, OrderDirection.Sell, 0, orderRequest.Quantity, OrderFee.Zero));\n            Assert.IsTrue(orderTicket.Status.IsClosed());\n\n            var tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n\n            _handleOptionNotification.Invoke(_transactionHandler, new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) });\n\n            // assert nothing happens!\n            tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n        }\n\n        // Short Call --> ITM (assigned early - full)\n        [TestCase(-1, OptionRight.Call, 450, 100, 455, 2, 0, 0)]\n        // Short Put --> ITM (assigned early - full)\n        [TestCase(-1, OptionRight.Put, 455, 100, 450, 2, 0, 200)]\n        // Short Call --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Call, 450, 300, 455, 2, -1, 100)]\n        // Short Put --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Put, 455, 100, 450, 2, -1, 300)]\n        public void EarlyAssignmentEmitsOrderEvents(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOrderEvents,\n            int expectedOptionPosition,\n            int expectedUnderlyingPosition\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 10 AM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 8, 14, 0, 0);\n\n            var parameters = new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) };\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n\n            var tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n\n            var ticket = tickets.First();\n            Assert.IsTrue(ticket.HasOrder);\n\n            Assert.AreEqual(expectedOrderEvents, ticket.OrderEvents.Count);\n\n            Assert.AreEqual(expectedUnderlyingPosition, algorithm.Portfolio[equity.Symbol].Quantity);\n            Assert.AreEqual(expectedOptionPosition, algorithm.Portfolio[optionSymbol].Quantity);\n\n            // let's push the same event again\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n            _transactionHandler.Exit();\n\n            // we should not see any new orders or events come through\n            tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(1, tickets.Count);\n        }\n\n        // Short Call --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Call, 450, 100, 455, 2, 0, 0)]\n        // Short Put --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Put, 455, 100, 450, 2, 0, 200)]\n        // Short Call --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Call, 450, 300, 455, 2, -1, 200)]\n        // Short Put --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Put, 455, 100, 450, 2, -1, 200)]\n        public void EarlyAssignmentEmitsOrderEventsEvenIfOldBuyOrderPresent(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOrderEvents,\n            int expectedOptionPosition,\n            int expectedUnderlyingPosition\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 10 AM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 8, 14, 0, 0);\n\n            // Creates a market order\n            var orderTime = _transactionHandler.TestCurrentTimeUtc.AddMinutes(-10);\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, 1, 0, 0, orderTime, \"\");\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            Assert.AreEqual(1, algorithm.Transactions.GetOrderTickets().Count());\n\n            // Fill the order, 1 second later, but ~10 minutes away form current time\n            brokerage.PublishOrderEvent(new OrderEvent(orderTicket.OrderId, option.Symbol, orderTime.AddSeconds(1),\n                OrderStatus.Filled, OrderDirection.Buy, 10, orderRequest.Quantity, OrderFee.Zero));\n\n            Assert.IsTrue(orderTicket.Status.IsClosed());\n            Assert.AreEqual(1, algorithm.Transactions.GetOrderTickets().Count());\n\n            var parameters = new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) };\n            _handleOptionNotification.Invoke(_transactionHandler, parameters);\n\n            var tickets = algorithm.Transactions.GetOrderTickets().ToList();\n            Assert.AreEqual(2, tickets.Count);\n\n            var ticket = tickets[0];\n            Assert.IsTrue(ticket.HasOrder);\n\n            Assert.AreEqual(expectedOrderEvents, ticket.OrderEvents.Count);\n\n            Assert.AreEqual(expectedUnderlyingPosition, algorithm.Portfolio[equity.Symbol].Quantity);\n            Assert.AreEqual(expectedOptionPosition, algorithm.Portfolio[optionSymbol].Quantity);\n        }\n\n        // Short Call --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Call, 450, 100, 455, 0, OrderDirection.Buy)]\n        // Short Put --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Put, 455, 100, 450, 0, OrderDirection.Buy)]\n        // Short Call --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Call, 450, 300, 455, -1, OrderDirection.Buy)]\n        // Short Put --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Put, 455, 100, 450, -1, OrderDirection.Buy)]\n\n        // Short Call --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Call, 450, 100, 455, 0, OrderDirection.Sell)]\n        // Short Put --> ITM (assigned early - full)\n        [TestCase(-2, OptionRight.Put, 455, 100, 450, 0, OrderDirection.Sell)]\n        // Short Call --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Call, 450, 300, 455, -1, OrderDirection.Sell)]\n        // Short Put --> ITM (assigned early - partial)\n        [TestCase(-3, OptionRight.Put, 455, 100, 450, -1, OrderDirection.Sell)]\n        public void EarlyAssignmentDoesNotEmitsOrderEventsInLive(\n            int initialOptionPosition,\n            OptionRight optionRight,\n            decimal strikePrice,\n            int initialUnderlyingPosition,\n            decimal underlyingPrice,\n            int expectedOptionPosition,\n            OrderDirection orderDirection\n            )\n        {\n            var algorithm = new TestAlgorithm();\n            var equity = algorithm.AddEquity(\"SPY\");\n            var optionSymbol = Symbol.CreateOption(equity.Symbol, equity.Symbol.ID.Market, OptionStyle.American, optionRight, strikePrice,\n                new DateTime(2021, 9, 8));\n            var option = algorithm.AddOptionContract(optionSymbol);\n\n            algorithm.Portfolio[equity.Symbol].SetHoldings(underlyingPrice, initialUnderlyingPosition);\n            algorithm.Portfolio[option.Symbol].SetHoldings(0.01m, initialOptionPosition);\n\n            equity.SetMarketPrice(new Tick { Value = underlyingPrice });\n\n            using var brokerage = new NoSubmitTestBrokerage(algorithm);\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n            algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // 10 AM ET\n            _transactionHandler.TestCurrentTimeUtc = new DateTime(2021, 9, 8, 14, 0, 0);\n\n            // Creates a market order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, option.Type, option.Symbol, orderDirection == OrderDirection.Buy ? 1 : -1, 0, 0, _transactionHandler.TestCurrentTimeUtc, \"\");\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            Assert.AreEqual(1, algorithm.Transactions.GetOrderTickets().Count());\n\n            _handleOptionNotification.Invoke(_transactionHandler, new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) });\n\n            // we expect no difference because there is an open market order!\n            Assert.AreEqual(1, algorithm.Transactions.GetOrderTickets().Count());\n\n            // Fill the order\n            brokerage.PublishOrderEvent(new OrderEvent(orderTicket.OrderId, option.Symbol, _transactionHandler.TestCurrentTimeUtc,\n                OrderStatus.Filled, orderDirection, 10, orderRequest.Quantity, OrderFee.Zero));\n            Assert.IsTrue(orderTicket.Status.IsClosed());\n\n            _handleOptionNotification.Invoke(_transactionHandler, new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) });\n\n            // we expect no difference because there is a closed market order!\n            Assert.AreEqual(1, algorithm.Transactions.GetOrderTickets().Count());\n\n            // Timeout the order effect\n            _transactionHandler.TestCurrentTimeUtc = _transactionHandler.TestCurrentTimeUtc.AddMinutes(1);\n\n            _handleOptionNotification.Invoke(_transactionHandler, new object[] { new OptionNotificationEventArgs(optionSymbol, expectedOptionPosition) });\n\n            // we expect difference because market order is old!\n            Assert.AreEqual(2, algorithm.Transactions.GetOrderTickets().Count());\n        }\n\n        private static TestCaseData[] PriceAdjustmentModeTestCases => Enum.GetValues(typeof(DataNormalizationMode))\n            .Cast<DataNormalizationMode>()\n            .SelectMany(x => new[] { new TestCaseData(x, false), new TestCaseData(x, true) })\n            .ToArray();\n\n        [TestCaseSource(nameof(PriceAdjustmentModeTestCases))]\n        public void OrderPriceAdjustmentModeIsSetAfterPlacingOrder(DataNormalizationMode dataNormalizationMode, bool liveMode)\n        {\n            _algorithm.SetLiveMode(liveMode);\n\n            //Initializes the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new BacktestingBrokerage(_algorithm);\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Add the security\n            var security = _algorithm.AddSecurity(SecurityType.Forex, \"CADUSD\", dataNormalizationMode: dataNormalizationMode);\n            var securityNormalizationMode = _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(security.Symbol)[0]\n                .DataNormalizationMode;\n\n            Assert.AreEqual(dataNormalizationMode, securityNormalizationMode);\n\n            // Creates the order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1600, 0, 0, DateTime.Now, \"\");\n\n            // Mock the order processor\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest));\n            _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            // Act\n            var orderTicket = _transactionHandler.Process(orderRequest);\n            Assert.AreEqual(OrderStatus.New, orderTicket.Status);\n            _transactionHandler.HandleOrderRequest(orderRequest);\n\n            // Assert\n            Assert.IsTrue(orderRequest.Response.IsProcessed);\n            Assert.IsTrue(orderRequest.Response.IsSuccess);\n            Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n\n            var expectedNormalizationMode = liveMode ? DataNormalizationMode.Raw : dataNormalizationMode;\n            Assert.AreEqual(expectedNormalizationMode, _transactionHandler.GetOrderById(orderTicket.OrderId).PriceAdjustmentMode);\n        }\n\n        [TestCaseSource(nameof(PriceAdjustmentModeTestCases))]\n        public void OrderPriceAdjustmentModeIsSetWhenAddingOpenOrder(DataNormalizationMode dataNormalizationMode, bool liveMode)\n        {\n            _algorithm.SetLiveMode(liveMode);\n\n            // The engine might fetch brokerage open orders before even initializing the transaction handler,\n            // so let's not initialize it here to simulate that scenario\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestingBrokerage();\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            // Add the security\n            var security = _algorithm.AddSecurity(SecurityType.Forex, \"CADUSD\", dataNormalizationMode: dataNormalizationMode);\n            var securityNormalizationMode = _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                .GetSubscriptionDataConfigs(security.Symbol)[0]\n                .DataNormalizationMode;\n\n            Assert.AreEqual(dataNormalizationMode, securityNormalizationMode);\n\n            // Creates the order\n            var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1600, 0, 0, DateTime.Now, \"\");\n            var order = Order.CreateOrder(orderRequest);\n\n            // Act\n            _transactionHandler.AddOpenOrder(order, _algorithm);\n\n            // Assert\n            Assert.Greater(order.Id, 0);\n\n            var expectedNormalizationMode = liveMode ? DataNormalizationMode.Raw : dataNormalizationMode;\n            Assert.AreEqual(expectedNormalizationMode, _transactionHandler.GetOrderById(order.Id).PriceAdjustmentMode);\n        }\n\n        private static TestCaseData[] BrokerageSideOrdersTestCases => new[]\n        {\n            new TestCaseData(OrderType.Limit, false),\n            new TestCaseData(OrderType.StopMarket, false),\n            new TestCaseData(OrderType.StopLimit, false),\n            new TestCaseData(OrderType.MarketOnOpen, false),\n            new TestCaseData(OrderType.MarketOnClose, false),\n            new TestCaseData(OrderType.LimitIfTouched, false),\n            new TestCaseData(OrderType.ComboMarket, false),\n            new TestCaseData(OrderType.ComboLimit, false),\n            new TestCaseData(OrderType.ComboLegLimit, false),\n            new TestCaseData(OrderType.TrailingStop, false),\n            // Only market orders are supported for this test\n            new TestCaseData(OrderType.Market, true),\n        };\n\n        private static Order GetOrder(OrderType type, Symbol symbol)\n        {\n            switch (type)\n            {\n                case OrderType.Market:\n                    return new MarketOrder(symbol, 100, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.Limit:\n                    return new LimitOrder(symbol, 100, 100m, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.StopMarket:\n                    return new StopMarketOrder(symbol, 100, 100m, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.StopLimit:\n                    return new StopLimitOrder(symbol, 100, 100m, 100m, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.MarketOnOpen:\n                    return new MarketOnOpenOrder(symbol, 100, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.MarketOnClose:\n                    return new MarketOnCloseOrder(symbol, 100, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.LimitIfTouched:\n                    return new LimitIfTouchedOrder(symbol, 100, 100m, 100m, new DateTime(2024, 01, 19, 12, 0, 0));\n                case OrderType.ComboMarket:\n                    return new ComboMarketOrder(symbol, 100, new DateTime(2024, 01, 19, 12, 0, 0), new GroupOrderManager(1, 1, 10));\n                case OrderType.ComboLimit:\n                    return new ComboLimitOrder(symbol, 100, 100m, new DateTime(2024, 01, 19, 12, 0, 0), new GroupOrderManager(1, 1, 10, 100));\n                case OrderType.ComboLegLimit:\n                    return new ComboLegLimitOrder(symbol, 100, 100m, new DateTime(2024, 01, 19, 12, 0, 0), new GroupOrderManager(1, 1, 10));\n                case OrderType.TrailingStop:\n                    return new TrailingStopOrder(symbol, 100, 100m, 100m, false, new DateTime(2024, 01, 19, 12, 0, 0));\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(type), type, null);\n            }\n        }\n\n        [TestCaseSource(nameof(BrokerageSideOrdersTestCases))]\n        public void NewBrokerageOrdersAreFiltered(OrderType orderType, bool accepted)\n        {\n            //Initialize the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestingBrokerage();\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            _algorithm.SetBrokerageModel(new DefaultBrokerageModel());\n            var brokerageMessageHandler = new TestBrokerageMessageHandler();\n            _algorithm.SetBrokerageMessageHandler(brokerageMessageHandler);\n\n            var symbol = _algorithm.AddEquity(\"SPY\").Symbol;\n\n            var order = GetOrder(orderType, symbol);\n            Assert.AreEqual(orderType, order.Type);\n            brokerage.OnNewBrokerageOrder(new NewBrokerageOrderNotificationEventArgs(order));\n            Assert.AreEqual(accepted, brokerageMessageHandler.LastHandleOrderResult);\n            Assert.AreEqual(accepted ? 1 : 0, _transactionHandler.OrdersCount);\n        }\n\n        [Test]\n        public void UnrequestedSecuritiesAreAddedForNewBrokerageSideOrders()\n        {\n            //Initialize the transaction handler\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new TestingBrokerage();\n            _transactionHandler.Initialize(_algorithm, brokerage, new BacktestingResultHandler());\n\n            _algorithm.SetBrokerageModel(new DefaultBrokerageModel());\n            var brokerageMessageHandler = new TestBrokerageMessageHandler();\n            _algorithm.SetBrokerageMessageHandler(brokerageMessageHandler);\n\n            var symbol = Symbols.SPY;\n            Assert.IsFalse(_algorithm.Securities.ContainsKey(symbol));\n\n            var order = GetOrder(OrderType.Market, symbol);\n            brokerage.OnNewBrokerageOrder(new NewBrokerageOrderNotificationEventArgs(order));\n            Assert.IsTrue(brokerageMessageHandler.LastHandleOrderResult);\n            Assert.AreEqual(1, _transactionHandler.OrdersCount);\n\n            Assert.IsTrue(_algorithm.Securities.TryGetValue(symbol, out var security));\n            Assert.AreEqual(symbol, security.Symbol);\n        }\n\n        [Test]\n        public void ProcessesOrdersConcurrently()\n        {\n            var algorithm = new TestAlgorithm();\n            using var brokerage = new TestingConcurrentBrokerage();\n\n            const int expectedOrdersCount = 10;\n            using var finishedEvent = new ManualResetEventSlim(false);\n            var transactionHandler = new TestableConcurrentBrokerageTransactionHandler(expectedOrdersCount, finishedEvent);\n            transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                algorithm.Transactions.SetOrderProcessor(transactionHandler);\n\n                var security = (Security)algorithm.AddEquity(\"SPY\");\n                algorithm.SetFinishedWarmingUp();\n\n                // Set up security\n                var reference = new DateTime(2025, 07, 03, 10, 0, 0);\n                security.SetMarketPrice(new Tick(reference, security.Symbol, 300, 300));\n\n                // Creates the order\n                var orderRequests = Enumerable.Range(0, expectedOrdersCount).Select(_ => MakeOrderRequest(security, OrderType.Market, reference)).ToList();\n\n                // Act\n                for (var i = 0; i < orderRequests.Count; i++)\n                {\n                    var orderRequest = orderRequests[i];\n                    orderRequest.SetOrderId(i + 1);\n                    transactionHandler.Process(orderRequest);\n                }\n\n                // Wait for all orders to be processed\n                Assert.IsTrue(finishedEvent.Wait(10000));\n                Assert.Greater(transactionHandler.ProcessingThreadNames.Count, 1);\n                CollectionAssert.AreEquivalent(orderRequests.Select(x => x.ToString()), transactionHandler.ProcessedRequests.Select(x => x.ToString()));\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [Test]\n        public void ProcessesComboRequestsOnSameThreadWhenConcurrencyIsEnabled()\n        {\n            var algorithm = new TestAlgorithm();\n            using var brokerage = new TestingConcurrentBrokerage();\n\n            const int expectedOrdersCount = 2;\n            using var finishedEvent = new ManualResetEventSlim(false);\n            var transactionHandler = new TestableConcurrentBrokerageTransactionHandler(expectedOrdersCount, finishedEvent);\n            transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n\n            try\n            {\n                algorithm.Transactions.SetOrderProcessor(transactionHandler);\n                algorithm.SetCash(100000);\n                algorithm.SetFinishedWarmingUp();\n\n                var security1 = (Security)algorithm.AddEquity(\"SPY\");\n                var security2 = (Security)algorithm.AddEquity(\"AAPL\");\n\n                var reference = new DateTime(2025, 07, 03, 10, 0, 0);\n                security1.SetMarketPrice(new Tick(reference, security1.Symbol, 500, 500));\n                security2.SetMarketPrice(new Tick(reference, security2.Symbol, 200, 200));\n\n                var groupOrderManager = new GroupOrderManager(1, 2, -1, 1m);\n                var orderRequest1 = new SubmitOrderRequest(OrderType.ComboLimit, security1.Type, security1.Symbol, -1, 1m, 0, reference, \"\",\n                    groupOrderManager: groupOrderManager);\n                var orderRequest2 = new SubmitOrderRequest(OrderType.ComboLimit, security2.Type, security2.Symbol, 1, 1m, 0, reference, \"\",\n                    groupOrderManager: groupOrderManager);\n\n                orderRequest1.SetOrderId(1);\n                orderRequest2.SetOrderId(2);\n\n                transactionHandler.Process(orderRequest1);\n                transactionHandler.Process(orderRequest2);\n\n                Assert.IsTrue(finishedEvent.Wait(10000));\n\n                Assert.IsTrue(transactionHandler.RequestProcessingThreads.TryGetValue(orderRequest1.OrderId, out var order1Thread));\n                Assert.IsTrue(transactionHandler.RequestProcessingThreads.TryGetValue(orderRequest2.OrderId, out var order2Thread));\n                Assert.AreEqual(order1Thread, order2Thread);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n            }\n        }\n\n        [TestCase(\"OnAccountChanged\")]\n        [TestCase(\"OnOptionNotification\")]\n        [TestCase(\"OnNewBrokerageOrderNotification\")]\n        [TestCase(\"OnOrderIdChanged\")]\n        [TestCase(\"OnOrderUpdated\")]\n        public void BrokerageTransactionHandlerDoesNotProcessEventsWhenAlgorithmIsStopped(string eventName)\n        {\n            var referenceDateTime = new DateTime(2024, 01, 25, 10, 0, 0);\n\n            // Initialize the algorithm\n            var algorithm = new TestAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetBrokerageMessageHandler(new TestBrokerageMessageHandler());\n\n            // Initialize the transaction handler and brokerage\n            _transactionHandler = new TestBrokerageTransactionHandler();\n            using var brokerage = new EventEmittingBrokerage(algorithm);\n            _transactionHandler.Initialize(algorithm, brokerage, new BacktestingResultHandler());\n\n            // Set up option security and add a submitted order\n            algorithm.AddOption(\"SPY\");\n            var option = algorithm.AddOptionContract(Symbol.CreateOption(\n                \"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 300, referenceDateTime.AddDays(4).Date\n            ));\n            var orderRequest = new OptionExerciseOrder(option.Symbol, 1, referenceDateTime)\n            {\n                Id = 1,\n                BrokerId = new List<string> { \"1\" }\n            };\n            _transactionHandler.AddOpenOrder(orderRequest, algorithm);\n            // Order status should be Submitted\n            Assert.AreEqual(OrderStatus.Submitted, _transactionHandler.GetOrdersByBrokerageId(1)[0].Status);\n\n            // Stop the algorithm\n            algorithm.Status = AlgorithmStatus.Stopped;\n\n            // The brokerage should ignore the following events because the algorithm is not running\n            switch (eventName)\n            {\n                case \"OnAccountChanged\":\n                    brokerage.CreateAccountChangedEvent(new AccountEvent(\"USD\", 100));\n                    // Cash balance should remain unchanged\n                    Assert.AreEqual(algorithm.Portfolio.Cash, 100000);\n                    break;\n\n                case \"OnOptionNotification\":\n                    brokerage.CreateOptionNotificationEvent(new OptionNotificationEventArgs(option.Symbol, 5));\n                    // Order status should still be Submitted\n                    Assert.AreEqual(OrderStatus.Submitted, _transactionHandler.GetOrdersByBrokerageId(1)[0].Status);\n                    break;\n\n                case \"OnNewBrokerageOrderNotification\":\n                    var order = new MarketOrder(option.Symbol, 100, new DateTime(2024, 01, 19, 12, 0, 0))\n                    {\n                        Id = 2,\n                        BrokerId = new List<string> { \"1\" }\n                    };\n                    brokerage.CreateNewBrokerageOrderNotificationEvent(new NewBrokerageOrderNotificationEventArgs(order));\n                    // No new orders should have been added\n                    Assert.AreEqual(1, _transactionHandler.GetOrdersByBrokerageId(1).Count);\n                    break;\n\n                case \"OnOrderIdChanged\":\n                    brokerage.CreateOrderIdChangedEvent(new BrokerageOrderIdChangedEvent\n                    {\n                        OrderId = 1,\n                        BrokerId = new List<string> { \"2\" }\n                    });\n                    // No order should exist under the new broker ID\n                    Assert.AreEqual(0, _transactionHandler.GetOrdersByBrokerageId(2).Count);\n                    // Original broker ID should remain unchanged\n                    Assert.AreEqual(\"1\", _transactionHandler.GetOrdersByBrokerageId(1)[0].BrokerId[0]);\n                    break;\n\n                case \"OnOrderUpdated\":\n                    var stopLimitOrder = new StopLimitOrder(option.Symbol, 100, 100, 100, referenceDateTime)\n                    {\n                        Id = 2,\n                        BrokerId = new List<string> { \"1\" },\n                        StopTriggered = false\n                    };\n                    _transactionHandler.AddOpenOrder(stopLimitOrder, algorithm);\n                    brokerage.CreateOrderUpdatedEvent(new OrderUpdateEvent { OrderId = 2, StopTriggered = true });\n                    var updatedStopLimitOrder = (StopLimitOrder)_transactionHandler\n                        .GetOrdersByBrokerageId(1)\n                        .First(e => e.Id == 2);\n                    // StopTriggered flag should remain false\n                    Assert.IsFalse(updatedStopLimitOrder.StopTriggered);\n                    break;\n            }\n        }\n\n        internal class TestIncrementalOrderIdAlgorithm : OrderTicketDemoAlgorithm\n        {\n            public static readonly Dictionary<int, int> OrderEventIds = new Dictionary<int, int>();\n\n            public override void OnOrderEvent(OrderEvent orderEvent)\n            {\n                if (!OrderEventIds.ContainsKey(orderEvent.OrderId))\n                {\n                    OrderEventIds[orderEvent.OrderId] = orderEvent.Id;\n                    if (orderEvent.Id != 1)\n                    {\n                        throw new Exception(\"Expected first order event to have id 1\");\n                    }\n                }\n                else\n                {\n                    var previous = OrderEventIds[orderEvent.OrderId];\n                    if (orderEvent.Id != (previous + 1))\n                    {\n                        throw new Exception(\"Expected incremental order event ids\");\n                    }\n\n                    OrderEventIds[orderEvent.OrderId] = orderEvent.Id;\n                }\n            }\n        }\n\n        internal class TestIncrementalOrderIdSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                return Algorithm = new TestIncrementalOrderIdAlgorithm();\n            }\n        }\n\n        internal class EmptyHistoryProvider : HistoryProviderBase\n        {\n            public override int DataPointCount => 0;\n\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n            }\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                return Enumerable.Empty<Slice>();\n            }\n        }\n\n        internal class TestBrokerageModel : DefaultBrokerageModel\n        {\n            public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)\n            {\n                message = new BrokerageMessageEvent(0, 0, \"\");\n                return false;\n            }\n        }\n\n        internal class TestAlgorithm : QCAlgorithm\n        {\n            public List<OrderEvent> OrderEvents = new List<OrderEvent>();\n            public TestAlgorithm()\n            {\n                SubscriptionManager.SetDataManager(new DataManagerStub(this));\n                SetFinishedWarmingUp();\n            }\n            public override void OnOrderEvent(OrderEvent orderEvent)\n            {\n                OrderEvents.Add(orderEvent);\n            }\n        }\n\n        // Implemented through an underlying BactestingBrokerage instead of directly inheriting from it for easy implementation\n        // and for tests that require simulating using a live brokerage, not derived from BacktestingBrokerage.\n        internal class NoSubmitTestBrokerage : Brokerage\n        {\n            private BacktestingBrokerage _underlyingBrokerage;\n\n            public override bool IsConnected => _underlyingBrokerage.IsConnected;\n\n            public NoSubmitTestBrokerage(IAlgorithm algorithm) : base(\"NoSubmitTestBrokerage\")\n            {\n                _underlyingBrokerage = new BacktestingBrokerage(algorithm);\n            }\n            public override bool PlaceOrder(Order order)\n            {\n                return true;\n            }\n            public override bool UpdateOrder(Order order)\n            {\n                return true;\n            }\n            public void PublishOrderEvent(OrderEvent orderEvent)\n            {\n                OnOrderEvent(orderEvent);\n            }\n\n            public override bool CancelOrder(Order order)\n            {\n                return _underlyingBrokerage.CancelOrder(order);\n            }\n\n            public override void Connect()\n            {\n                _underlyingBrokerage.Connect();\n            }\n\n            public override void Disconnect()\n            {\n                _underlyingBrokerage.Disconnect();\n            }\n\n            public override List<Order> GetOpenOrders()\n            {\n                return _underlyingBrokerage.GetOpenOrders();\n            }\n\n            public override List<Holding> GetAccountHoldings()\n            {\n                return _underlyingBrokerage.GetAccountHoldings();\n            }\n\n            public override List<CashAmount> GetCashBalance()\n            {\n                return _underlyingBrokerage.GetCashBalance();\n            }\n        }\n\n        internal class TestBroker : BacktestingBrokerage\n        {\n            private readonly bool _cancelOrderResult;\n            public TestBroker(IAlgorithm algorithm, bool cancelOrderResult) : base(algorithm)\n            {\n                _cancelOrderResult = cancelOrderResult;\n            }\n            public override bool CancelOrder(Order order)\n            {\n                return _cancelOrderResult;\n            }\n            public void OnOrderIdChangedEventPublic(BrokerageOrderIdChangedEvent e)\n            {\n                base.OnOrderIdChangedEvent(e);\n            }\n        }\n\n        public class TestBrokerageTransactionHandler : BrokerageTransactionHandler\n        {\n            private IBrokerageCashSynchronizer _brokerage;\n\n            public int CancelPendingOrdersSize => _cancelPendingOrders.GetCancelPendingOrdersSize;\n\n            public TimeSpan TestTimeSinceLastFill { get; set; } = TimeSpan.FromDays(1);\n            public DateTime TestCurrentTimeUtc { get; set; } = new DateTime(13, 1, 13, 13, 13, 13);\n\n            // modifying current time so cash sync is triggered\n            protected override DateTime CurrentTimeUtc => TestCurrentTimeUtc;\n\n            protected override TimeSpan TimeSinceLastFill => TestTimeSinceLastFill;\n\n            public override void Initialize(IAlgorithm algorithm, IBrokerage brokerage, IResultHandler resultHandler)\n            {\n                _brokerage = brokerage;\n\n                base.Initialize(algorithm, brokerage, resultHandler);\n            }\n\n            public DateTime GetLastSyncDate()\n            {\n                return _brokerage.LastSyncDateTimeUtc.ConvertFromUtc(TimeZones.NewYork);\n            }\n\n            protected override void InitializeTransactionThread()\n            {\n                _orderRequestQueues = new() { new BusyCollection<OrderRequest>() };\n            }\n\n            public new void RoundOrderPrices(Order order, Security security)\n            {\n                base.RoundOrderPrices(order, security);\n            }\n        }\n\n        private class TestPriceVariationModel : IPriceVariationModel\n        {\n            private readonly decimal _increment;\n\n            public TestPriceVariationModel(decimal increment)\n            {\n                _increment = increment;\n            }\n\n            public decimal GetMinimumPriceVariation(GetMinimumPriceVariationParameters parameters)\n            {\n                return _increment;\n            }\n        }\n\n        private class TestNonShortableProvider : IShortableProvider\n        {\n            public Dictionary<Symbol, long> AllShortableSymbols(DateTime localTime)\n            {\n                return new Dictionary<Symbol, long>();\n            }\n\n            public decimal FeeRate(Symbol symbol, DateTime localTime)\n            {\n                return 0;\n            }\n\n            public decimal RebateRate(Symbol symbol, DateTime localTime)\n            {\n                return 0;\n            }\n\n            public long? ShortableQuantity(Symbol symbol, DateTime localTime)\n            {\n                return 0;\n            }\n        }\n\n        private class TestShortableBrokerageModel : DefaultBrokerageModel\n        {\n            public override IShortableProvider GetShortableProvider(Security security)\n            {\n                return new TestNonShortableProvider();\n            }\n        }\n\n        private class TestBrokerageMessageHandler : IBrokerageMessageHandler\n        {\n            public bool LastHandleOrderResult { get; private set; }\n\n            public void HandleMessage(BrokerageMessageEvent messageEvent)\n            {\n            }\n\n            public bool HandleOrder(NewBrokerageOrderNotificationEventArgs eventArgs)\n            {\n                // For testing purposes, only market orders are handled\n                return LastHandleOrderResult = eventArgs.Order.Type == OrderType.Market;\n\n            }\n        }\n\n        private class TestingBrokerage : TestBrokerage\n        {\n            public void OnNewBrokerageOrder(NewBrokerageOrderNotificationEventArgs e)\n            {\n                OnNewBrokerageOrderNotification(e);\n            }\n        }\n\n        private class TestingConcurrentBrokerage : TestingBrokerage\n        {\n            public override bool ConcurrencyEnabled => true;\n        }\n\n        private class TestableConcurrentBrokerageTransactionHandler : BrokerageTransactionHandler\n        {\n            private readonly int _expectedOrdersCount;\n            private readonly ManualResetEventSlim _finishedEvent;\n            private int _currentOrdersCount;\n\n            public HashSet<string> ProcessingThreadNames = new();\n\n            public ConcurrentBag<OrderRequest> ProcessedRequests = new();\n\n            public ConcurrentDictionary<int, string> RequestProcessingThreads = new();\n\n            public TestableConcurrentBrokerageTransactionHandler(int expectedOrdersCount, ManualResetEventSlim finishedEvent)\n            {\n                _expectedOrdersCount = expectedOrdersCount;\n                _finishedEvent = finishedEvent;\n            }\n\n            public override void HandleOrderRequest(OrderRequest request)\n            {\n                base.HandleOrderRequest(request);\n\n                // Capture the thread name for debugging purposes\n                var threadName = Thread.CurrentThread.Name ?? Environment.CurrentManagedThreadId.ToString();\n                lock (ProcessingThreadNames)\n                {\n                    ProcessingThreadNames.Add(threadName);\n                }\n                RequestProcessingThreads[request.OrderId] = threadName;\n\n                ProcessedRequests.Add(request);\n\n                if (Interlocked.Increment(ref _currentOrdersCount) >= _expectedOrdersCount)\n                {\n                    // Signal that we have processed the expected number of orders\n                    _finishedEvent.Set();\n                }\n            }\n        }\n\n        internal class EventEmittingBrokerage : Brokerage\n        {\n            private BacktestingBrokerage _underlyingBrokerage;\n\n            public override bool IsConnected => _underlyingBrokerage.IsConnected;\n            public override bool AccountInstantlyUpdated => true;\n\n            public EventEmittingBrokerage(IAlgorithm algorithm) : base(\"NoSubmitTestBrokerage\")\n            {\n                _underlyingBrokerage = new BacktestingBrokerage(algorithm);\n            }\n            public override bool PlaceOrder(Order order)\n            {\n                return true;\n            }\n            public override bool UpdateOrder(Order order)\n            {\n                return true;\n            }\n\n            // Events\n            public void CreateOrderEvent(OrderEvent orderEvent)\n            {\n                OnOrderEvent(orderEvent);\n            }\n\n            public void CreateAccountChangedEvent(AccountEvent accountEvent)\n            {\n                OnAccountChanged(accountEvent);\n            }\n\n            public void CreateOptionPositionAssignedEvent(OrderEvent orderEvent)\n            {\n                OnOptionPositionAssigned(orderEvent);\n            }\n\n            public void CreateOptionNotificationEvent(OptionNotificationEventArgs optionNotificationEventArgs)\n            {\n                OnOptionNotification(optionNotificationEventArgs);\n            }\n\n            public void CreateNewBrokerageOrderNotificationEvent(NewBrokerageOrderNotificationEventArgs newBrokerageOrderNotificationEventArgs)\n            {\n                OnNewBrokerageOrderNotification(newBrokerageOrderNotificationEventArgs);\n            }\n\n            public void CreateDelistingNotificationEvent(DelistingNotificationEventArgs delistingNotificationEventArgs)\n            {\n                OnDelistingNotification(delistingNotificationEventArgs);\n            }\n\n            public void CreateOrderIdChangedEvent(BrokerageOrderIdChangedEvent brokerageOrderIdChangedEvent)\n            {\n                OnOrderIdChangedEvent(brokerageOrderIdChangedEvent);\n            }\n\n            public void CreateOrderUpdatedEvent(OrderUpdateEvent orderEvent)\n            {\n                OnOrderUpdated(orderEvent);\n            }\n\n            public override bool CancelOrder(Order order)\n            {\n                return _underlyingBrokerage.CancelOrder(order);\n            }\n\n            public override void Connect()\n            {\n                _underlyingBrokerage.Connect();\n            }\n\n            public override void Disconnect()\n            {\n                _underlyingBrokerage.Disconnect();\n            }\n\n            public override List<Order> GetOpenOrders()\n            {\n                return _underlyingBrokerage.GetOpenOrders();\n            }\n\n            public override List<Holding> GetAccountHoldings()\n            {\n                return _underlyingBrokerage.GetAccountHoldings();\n            }\n\n            public override List<CashAmount> GetCashBalance()\n            {\n                return _underlyingBrokerage.GetCashBalance();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/CustomBrokerageMessageHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Python;\nusing QuantConnect.Statistics;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture]\n    public class CustomBrokerageMessageHandlerTests\n    {\n        [Test]\n        public void PythonCustomBrokerageMessageHandlerCallsBase()\n        {\n            using (Py.GIL())\n            {\n                dynamic CustomBrokerageMessageHandler = PyModule.FromString(\"testModule\",\n                    @$\"\nfrom AlgorithmImports import *\n\nclass CustomBrokerageMessageHandler(DefaultBrokerageMessageHandler):\n    def __init__(self, algorithm):\n        super().__init__(algorithm)\n        self._algorithm = algorithm\n\n    def handle_order(self, event_args):\n        order = event_args.order\n        if order.tag is None or not order.tag.isdigit():\n            raise Exception(\"\"Expected all new brokerage-side orders to have a valid tag\"\")\n\n        # We will only process orders with even tags\n        return int(order.tag) % 2 == 0\n                \").GetAttr(\"CustomBrokerageMessageHandler\");\n\n                var algorithm = new AlgorithmStub();\n                var model = new BrokerageMessageHandlerPythonWrapper(CustomBrokerageMessageHandler(algorithm));\n                Assert.DoesNotThrow(() => model.HandleMessage(new BrokerageMessageEvent(BrokerageMessageType.Warning, 1, \"Event!\")));\n            }\n        }\n\n        [Test]\n        public void RunPartialCustomBrokerageMessageHandlerRegressionAlgorithm([Values(Language.Python)] Language language)\n        {\n            // We expect only half of the orders to be processed\n            var expectedOrdersCount = (CustomBacktestingBrokerage.MaxOrderCount / 2) + 1;\n\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, expectedOrdersCount.ToStringInvariant()},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"-11.597%\"},\n                    {\"Drawdown\", \"0.200%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"-0.157%\"},\n                    {\"Sharpe Ratio\", \"-5.199\"},\n                    {\"Sortino Ratio\", \"-6.546\"},\n                    {\"Probabilistic Sharpe Ratio\", \"24.692%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0.058\"},\n                    {\"Beta\", \"-0.07\"},\n                    {\"Annual Standard Deviation\", \"0.016\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"-8.635\"},\n                    {\"Tracking Error\", \"0.238\"},\n                    {\"Treynor Ratio\", \"1.157\"},\n                    {\"Total Fees\", \"$49.00\"},\n                    {\"Estimated Strategy Capacity\", \"$26000000.00\"},\n                    {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n                    {\"Portfolio Turnover\", \"1.42%\"}\n                },\n                language,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: nameof(CustomBacktestingSetupHandler));\n        }\n\n        [Test]\n        public void RunCustomBrokerageMessageHandlerRegressionAlgorithm([Values(Language.CSharp, Language.Python)] Language language)\n        {\n            // We expect only half of the orders to be processed\n            var expectedOrdersCount = (CustomBacktestingBrokerage.MaxOrderCount / 2) + 1;\n\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"CustomBrokerageSideOrderHandlingRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, expectedOrdersCount.ToStringInvariant()},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"-11.597%\"},\n                    {\"Drawdown\", \"0.200%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"-0.157%\"},\n                    {\"Sharpe Ratio\", \"-5.199\"},\n                    {\"Sortino Ratio\", \"-6.546\"},\n                    {\"Probabilistic Sharpe Ratio\", \"24.692%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0.058\"},\n                    {\"Beta\", \"-0.07\"},\n                    {\"Annual Standard Deviation\", \"0.016\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"-8.635\"},\n                    {\"Tracking Error\", \"0.238\"},\n                    {\"Treynor Ratio\", \"1.157\"},\n                    {\"Total Fees\", \"$49.00\"},\n                    {\"Estimated Strategy Capacity\", \"$26000000.00\"},\n                    {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n                    {\"Portfolio Turnover\", \"1.42%\"}\n                },\n                language,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: nameof(CustomBacktestingSetupHandler));\n        }\n\n        public class CustomBacktestingBrokerage : BacktestingBrokerage\n        {\n            public static readonly int MaxOrderCount = 100;\n\n            private OrderDirection _direction = OrderDirection.Buy;\n\n            private int _orderCount;\n\n            public CustomBacktestingBrokerage(IAlgorithm algorithm) : base(algorithm)\n            {\n            }\n\n            public override void Scan()\n            {\n                if (_orderCount <= MaxOrderCount)\n                {\n                    var quantity = 0m;\n                    // Only orders with even numbers in the tags will be processed\n                    if (_orderCount % 2 == 0)\n                    {\n                        quantity = _direction == OrderDirection.Buy ? 1 : -1;\n                        // Switch direction\n                        _direction = OrderDirection.Sell;\n                    }\n\n                    var marketOrder = new MarketOrder(Symbols.SPY, quantity, Algorithm.UtcTime, tag: _orderCount.ToStringInvariant());\n                    marketOrder.Status = OrderStatus.New;\n                    OnNewBrokerageOrderNotification(new NewBrokerageOrderNotificationEventArgs(marketOrder));\n                    _orderCount++;\n                }\n\n                base.Scan();\n            }\n        }\n\n        public class CustomBacktestingSetupHandler : BacktestingSetupHandler\n        {\n            public override IBrokerage CreateBrokerage(AlgorithmNodePacket algorithmNodePacket, IAlgorithm uninitializedAlgorithm, out IBrokerageFactory factory)\n            {\n                factory = new BacktestingBrokerageFactory();\n                var brokerage = new CustomBacktestingBrokerage(uninitializedAlgorithm);\n                brokerage.NewBrokerageOrderNotification += (sender, e) =>\n                {\n                    if (uninitializedAlgorithm.BrokerageMessageHandler.HandleOrder(e) &&\n                        uninitializedAlgorithm.GetOrAddUnrequestedSecurity(e.Order.Symbol, out _))\n                    {\n                        brokerage.PlaceOrder(e.Order);\n                    }\n                };\n\n                return brokerage;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataCacheProviders/DataCacheProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Engine.DataCacheProviders\n{\n    /// <summary>\n    /// Abstract class the provides common test cases for all DataCacheProviders\n    /// </summary>\n    public abstract class DataCacheProviderTests\n    {\n        protected IDataCacheProvider DataCacheProvider { get; set; }\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            DataCacheProvider = CreateDataCacheProvider();\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            DataCacheProvider.Dispose();\n        }\n\n        public abstract IDataCacheProvider CreateDataCacheProvider();\n\n        [TestCase(\"../../../Data/equity/usa/minute/aapl/20140606_trade.zip\")]\n        [TestCase(\"../../../Data/equity/usa/daily/aapl.zip#aapl.csv\")]\n        [TestCase(\"../../../Data/equity/usa/daily/aapl.zip\")]\n        public void CanFetchDataThatExists(string dataPath)\n        {\n            using(var stream = DataCacheProvider.Fetch(dataPath))\n            using (var reader = new StreamReader(stream))\n            {\n                Assert.IsFalse(string.IsNullOrEmpty(reader.ReadLine()));\n            }\n        }\n\n        [Test]\n        public void CannotFetchDataThatDoesNotExist()\n        {\n            var stream = DataCacheProvider.Fetch(\"../../../Data/equity/usa/minute/aapl/19980606_trade.zip\");\n\n            Assert.IsNull(stream);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataCacheProviders/DiskDataCacheProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing ICSharpCode.SharpZipLib.Zip;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataCacheProviders\n{\n    [TestFixture]\n    public class DiskDataCacheProviderTests : DataCacheProviderTests\n    {\n        public override IDataCacheProvider CreateDataCacheProvider()\n        {\n            return new DiskDataCacheProvider();\n        }\n\n        [Test]\n        public void WriteTest()\n        {\n            var entryName = \"testEntry.csv\";\n            var filePath = Path.GetTempFileName().Replace(\".tmp\", \".zip\", StringComparison.InvariantCulture);\n            var key = filePath + \"#\" + entryName;\n\n            var random = new Random();\n            var data = new byte[10];\n            random.NextBytes(data);\n\n            // Write this data to our entry in the temp zip\n            DataCacheProvider.Store(key, data);\n\n            // Verify it exists\n            Assert.IsTrue(File.Exists(filePath));\n\n            // Open the file are verify we have the expected results\n            using var zip = new ZipFile(filePath);\n            Assert.AreEqual(1, zip.Count);\n            Assert.IsNotNull(zip.GetEntry(entryName));\n        }\n\n        [Test]\n        public void OverrideEntry()\n        {\n            var entryName = \"testEntry.csv\";\n            var filePath = Path.GetTempFileName().Replace(\".tmp\", \".zip\", StringComparison.InvariantCulture);\n            var key = filePath + \"#\" + entryName;\n\n            var random = new Random();\n            var data = new byte[10];\n            random.NextBytes(data);\n\n            // Write this data to our entry in the temp zip\n            DataCacheProvider.Store(key, data);\n\n            // Verify it exists\n            Assert.IsTrue(File.Exists(filePath));\n\n            random = new Random();\n            data = new byte[10];\n            random.NextBytes(data);\n\n            // Write this data to our entry in the temp zip\n            DataCacheProvider.Store(key, data);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataCacheProviders/SingleEntryDataCacheProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataCacheProviders\n{\n    [TestFixture]\n    public class SingleEntryDataCacheProviderTests : DataCacheProviderTests\n    {\n        public override IDataCacheProvider CreateDataCacheProvider()\n        {\n            return new SingleEntryDataCacheProvider(TestGlobals.DataProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataCacheProviders/ZipDataCacheProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing Path = System.IO.Path;\nusing System.Threading.Tasks;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataCacheProviders\n{\n    [TestFixture]\n    public class ZipDataCacheProviderTests : DataCacheProviderTests\n    {\n        private readonly string _tempZipFileEntry = Path.GetTempFileName().Replace(\".tmp\", \".zip\", StringComparison.InvariantCulture) + \"#testEntry.csv\";\n        private readonly Random _random = new Random();\n\n        public override IDataCacheProvider CreateDataCacheProvider()\n        {\n            return new ZipDataCacheProvider(TestGlobals.DataProvider);\n        }\n\n        [Test]\n        public void MultiThreadReadWriteTest()\n        {\n            var dataCacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider, cacheTimer: 0.1);\n\n            Parallel.For(0, 100, (i) =>\n            {\n                var data = new byte[300];\n                _random.NextBytes(data);\n\n                ReadAndWrite(dataCacheProvider, data);\n            });\n\n            dataCacheProvider.Dispose();\n        }\n\n        [Test]\n        public void StoreFailsCorruptedFile()\n        {\n            var dataCacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider, cacheTimer: 0.1);\n\n            var tempZipFileEntry = Path.GetTempFileName().Replace(\".tmp\", \".zip\", StringComparison.InvariantCulture);\n\n            var data = new byte[300];\n            _random.NextBytes(data);\n\n            File.WriteAllText(tempZipFileEntry, \"corrupted zip\");\n\n            Assert.Throws<InvalidOperationException>(() => dataCacheProvider.Store(tempZipFileEntry + \"#testEntry.csv\", data));\n            dataCacheProvider.Dispose();\n        }\n\n        private void ReadAndWrite(IDataCacheProvider dataCacheProvider, byte[] data)\n        {\n            dataCacheProvider.Fetch(_tempZipFileEntry);\n            dataCacheProvider.Store(_tempZipFileEntry, data);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/AggregationManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing DateTime = System.DateTime;\nusing Tick = QuantConnect.Data.Market.Tick;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class AggregationManagerTests\n    {\n        [Test]\n        public void PassesTicksStraightThrough()\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var config = GetSubscriptionDataConfig<Tick>(Symbols.SPY, Resolution.Tick);\n\n            var count = 0;\n            aggregator.Add(config, (s, e) => { count++; });\n\n            aggregator.Update(new Tick(reference.AddSeconds(1), Symbols.SPY, 30, 30) { TickType = TickType.Trade });\n            aggregator.Update(new Tick(reference.AddSeconds(2), Symbols.SPY, 20, 20) { TickType = TickType.Trade });\n\n            Assert.AreEqual(count, 2);\n\n            aggregator.Update(new Tick(reference.AddSeconds(3), Symbols.AAPL, 200, 200) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 2);\n\n            aggregator.Remove(config);\n            aggregator.Update(new Tick(reference.AddSeconds(4), Symbols.SPY, 20, 20) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 2);\n        }\n\n        [Test]\n        public void BadTicksIgnored()\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var config = GetSubscriptionDataConfig<Tick>(Symbols.SPY, Resolution.Tick);\n\n            var count = 0;\n            aggregator.Add(config, (s, e) => { count++; });\n\n            aggregator.Update(new Tick(reference.AddSeconds(1), Symbols.AAPL, 200, 200));\n            Assert.AreEqual(count, 0);\n        }\n\n        [Test]\n        public void TickTypeRespected()\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var config = GetSubscriptionDataConfig<Tick>(Symbols.SPY, Resolution.Tick);\n\n            var count = 0;\n            aggregator.Add(config, (s, e) => { count++; });\n\n            aggregator.Update(new Tick(reference.AddSeconds(3), Symbols.SPY, 200, 200) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 1);\n\n            aggregator.Update(new Tick(reference.AddSeconds(4), Symbols.SPY, 20, 20) { TickType = TickType.Quote });\n            Assert.AreEqual(count, 1);\n        }\n\n        [Test]\n        public void UnknownSubscriptionIgnored()\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var config = GetSubscriptionDataConfig<Tick>(Symbols.SPY, Resolution.Tick);\n\n            var count = 0;\n\n            aggregator.Update(new Tick(reference.AddSeconds(1), Symbols.SPY, 30, 30) { TickType = TickType.Trade });\n            aggregator.Update(new Tick(reference.AddSeconds(2), Symbols.SPY, 20, 20) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 0);\n\n            aggregator.Add(config, (s, e) => { count++; });\n\n            aggregator.Update(new Tick(reference.AddSeconds(3), Symbols.SPY, 200, 200) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 1);\n\n            aggregator.Remove(config);\n            aggregator.Update(new Tick(reference.AddSeconds(4), Symbols.SPY, 20, 20) { TickType = TickType.Trade });\n            Assert.AreEqual(count, 1);\n        }\n\n        [TestCase(100, 1, typeof(TradeBar), Resolution.Minute)]\n        [TestCase(120, 2, typeof(TradeBar), Resolution.Minute)]\n        [TestCase(121, 2, typeof(TradeBar), Resolution.Minute)]\n        [TestCase(100, 1, typeof(QuoteBar), Resolution.Minute)]\n        [TestCase(120, 2, typeof(QuoteBar), Resolution.Minute)]\n        [TestCase(121, 2, typeof(QuoteBar), Resolution.Minute)]\n        [TestCase(100, 99, typeof(TradeBar), Resolution.Second)]\n        [TestCase(121, 120, typeof(QuoteBar), Resolution.Second)]\n        [TestCase(3599, 0, typeof(QuoteBar), Resolution.Hour)]\n        [TestCase(3599, 0, typeof(TradeBar), Resolution.Hour)]\n        [TestCase(3600, 1, typeof(QuoteBar), Resolution.Hour)]\n        [TestCase(3600, 1, typeof(TradeBar), Resolution.Hour)]\n        [TestCase(3601, 1, typeof(QuoteBar), Resolution.Hour)]\n        [TestCase(3601, 1, typeof(TradeBar), Resolution.Hour)]\n        public void CanHandleMultipleSubscriptions(int secondsToAdd, int expectedBars, Type dataType, Resolution resolution)\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var symbols = new[] { Symbols.SPY, Symbols.AAPL, Symbols.USDJPY, Symbols.EURUSD };\n            var enumerators = new Queue<IEnumerator<BaseData>>();\n\n            foreach (var symbol in symbols)\n            {\n                enumerators.Enqueue(aggregator.Add(GetSubscriptionDataConfig(dataType, symbol, resolution), (s, e) => { }));\n            }\n\n            for (var i = 1; i <= secondsToAdd; i++)\n            {\n                foreach (var symbol in symbols)\n                {\n                    aggregator.Update(new Tick(reference.AddSeconds(i), symbol, 20 + i, 20 + i) { TickType = dataType == typeof(TradeBar) ? TickType.Trade : TickType.Quote });\n                }\n            }\n\n            foreach (var enumerator in enumerators)\n            {\n                for (int i = 0; i < expectedBars; i++)\n                {\n                    enumerator.MoveNext();\n                    Assert.IsNotNull(enumerator.Current);\n                }\n\n                enumerator.MoveNext();\n                Assert.IsNull(enumerator.Current);\n            }\n        }\n\n        [TestCase(typeof(TradeBar), TickType.Trade, Resolution.Second)]\n        [TestCase(typeof(QuoteBar), TickType.Quote, Resolution.Second)]\n        [TestCase(typeof(Tick), TickType.Trade, Resolution.Tick)]\n        [TestCase(typeof(Tick), TickType.Quote, Resolution.Tick)]\n        public void CanHandleBars(Type type, TickType tickType, Resolution resolution)\n        {\n            using var aggregator = GetDataAggregator();\n            var reference = DateTime.Today;\n            var total = 0;\n            var enumerator = aggregator.Add(GetSubscriptionDataConfig(type, Symbols.EURUSD, resolution, tickType), (s, e) => { });\n\n            for (int i = 0; i < 100; i++)\n            {\n                aggregator.Update(new Tick(reference.AddSeconds(i), Symbols.EURUSD, 20 + i, 20 + i) { TickType = tickType });\n            }\n            Thread.Sleep(250);\n\n            enumerator.MoveNext();\n            while (enumerator.Current != null)\n            {\n                Assert.IsTrue(enumerator.Current.GetType() == type);\n                var tick = enumerator.Current as Tick;\n                if (tick != null)\n                {\n                    Assert.IsTrue(tick.TickType == tickType);\n                }\n                total++;\n                enumerator.MoveNext();\n            }\n\n            if (resolution == Resolution.Second)\n            {\n                Assert.AreEqual(99, total);\n            }\n            else\n            {\n                Assert.AreEqual(100, total);\n            }\n        }\n\n        [Test]\n        public void SubscribeMultipleDataTypes()\n        {\n            var reference = DateTime.Today;\n            var timeProvider = new ManualTimeProvider(reference);\n            using var aggregator = GetDataAggregator(timeProvider);\n            var symbol = Symbols.AAPL;\n\n            var configs = new[] {\n                GetSubscriptionDataConfig<TradeBar>(symbol, Resolution.Minute),\n                GetSubscriptionDataConfig<QuoteBar>(symbol, Resolution.Minute),\n                GetSubscriptionDataConfig<Tick>(symbol, Resolution.Tick, TickType.Trade),\n                GetSubscriptionDataConfig<Tick>(symbol, Resolution.Tick, TickType.Quote),\n                GetSubscriptionDataConfig<Dividend>(symbol, Resolution.Tick),\n                GetSubscriptionDataConfig<Split>(symbol, Resolution.Tick)\n            };\n\n            var enumerators = new Queue<IEnumerator<BaseData>>();\n            Array.ForEach(configs, (c) => enumerators.Enqueue(aggregator.Add(c, (s, e) => { })));\n\n            var expectedBars = new[] { 2, 2, 100, 100, 1, 1 };\n            for (int i = 1; i <= 100; i++)\n            {\n                aggregator.Update(new Tick(reference.AddSeconds(i), symbol, 20 + i, 20 + i)\n                {\n                    TickType = TickType.Trade\n                });\n                aggregator.Update(new Tick(reference.AddSeconds(i), symbol, 20 + i, 20 + i)\n                {\n                    TickType = TickType.Quote\n                });\n            }\n\n            aggregator.Update(new Dividend(symbol, reference.AddSeconds(1), 0.47m, 108.60m));\n\n            aggregator.Update(new Split(symbol, reference.AddSeconds(1), 645.57m, 0.142857m, SplitType.SplitOccurred));\n\n            timeProvider.SetCurrentTime(reference.AddMinutes(2));\n\n            var dividendCount = 0;\n            var splitCount = 0;\n            var j = 0;\n            foreach (var enumerator in enumerators)\n            {\n                for (int i = 0; i < expectedBars[j]; i++)\n                {\n                    enumerator.MoveNext();\n                    Assert.IsNotNull(enumerator.Current);\n\n                    if (enumerator.Current is Dividend)\n                    {\n                        dividendCount++;\n                    }\n                    if (enumerator.Current is Split)\n                    {\n                        splitCount++;\n                    }\n                }\n\n                enumerator.MoveNext();\n                Assert.IsNull(enumerator.Current);\n                j++;\n            }\n\n            Assert.AreEqual(1, dividendCount);\n            Assert.AreEqual(1, splitCount);\n        }\n\n        private IDataAggregator GetDataAggregator()\n        {\n            return GetDataAggregator(new ManualTimeProvider(DateTime.Today));\n        }\n\n        private IDataAggregator GetDataAggregator(ITimeProvider timeProvider)\n        {\n            return new TestAggregationManager(timeProvider);\n        }\n\n        private SubscriptionDataConfig GetSubscriptionDataConfig<T>(Symbol symbol, Resolution resolution, TickType? tickType = null)\n        {\n            return GetSubscriptionDataConfig(typeof(T), symbol, resolution, tickType);\n        }\n\n        private SubscriptionDataConfig GetSubscriptionDataConfig(Type T, Symbol symbol, Resolution resolution, TickType? tickType = null)\n        {\n            return new SubscriptionDataConfig(\n                T,\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false,\n                tickType: tickType);\n        }\n\n        private class TestAggregationManager : AggregationManager\n        {\n            public TestAggregationManager(ITimeProvider timeProvider)\n            {\n                TimeProvider = timeProvider;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/AlgorithmStub.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing QuantConnect.Python;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    /// <summary>\n    /// This type allows tests to easily create an algorithm that is mostly initialized in one line\n    /// </summary>\n    public class AlgorithmStub : QCAlgorithm\n    {\n        public List<SecurityChanges> SecurityChangesRecord { get; set; } = new List<SecurityChanges>();\n        public DataManager DataManager { get; set; }\n        public IDataFeed DataFeed { get; set; }\n\n        /// <summary>\n        /// Lanzy PandasConverter only if used\n        /// </summary>\n        public override PandasConverter PandasConverter\n        {\n            get\n            {\n                if(base.PandasConverter == null)\n                {\n                    SetPandasConverter();\n                }\n                return base.PandasConverter;\n            }\n        }\n\n        public AlgorithmStub(bool createDataManager = true)\n        {\n            if (createDataManager)\n            {\n                var dataManagerStub = new DataManagerStub(this);\n                DataManager = dataManagerStub;\n                DataFeed = dataManagerStub.DataFeed;\n                SubscriptionManager.SetDataManager(DataManager);\n            }\n            var orderProcessor = new FakeOrderProcessor();\n            orderProcessor.TransactionManager = Transactions;\n            Transactions.SetOrderProcessor(orderProcessor);\n        }\n\n        public AlgorithmStub(IDataFeed dataFeed)\n        {\n            DataFeed = dataFeed;\n            DataManager = new DataManagerStub(dataFeed, this);\n            SubscriptionManager.SetDataManager(DataManager);\n            Transactions.SetOrderProcessor(new FakeOrderProcessor());\n        }\n\n        public void AddSecurities(Resolution resolution = Resolution.Second, List<string> equities = null, List<string> forex = null, List<string> crypto = null)\n        {\n            foreach (var ticker in equities ?? new List<string>())\n            {\n                AddSecurity(SecurityType.Equity, ticker, resolution);\n                var symbol = SymbolCache.GetSymbol(ticker);\n                Securities[symbol].Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            }\n            foreach (var ticker in forex ?? new List<string>())\n            {\n                AddSecurity(SecurityType.Forex, ticker, resolution);\n            }\n            foreach (var ticker in crypto ?? new List<string>())\n            {\n                AddSecurity(SecurityType.Crypto, ticker, resolution);\n                var symbol = SymbolCache.GetSymbol(ticker);\n                Securities[symbol].Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.Utc));\n            }\n        }\n\n        public void AddCryptoEntry(string ticker, string market)\n        {\n            var symbolProperties = SymbolPropertiesDatabase.GetSymbolProperties(market, null, SecurityType.Crypto, Currencies.USD);\n            SymbolPropertiesDatabase.SetEntry(market, ticker, SecurityType.Crypto, symbolProperties);\n        }\n\n        public override void OnSecuritiesChanged(SecurityChanges changes)\n        {\n            SecurityChangesRecord.Add(changes);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Auxiliary/MapFileResolverTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing NUnit.Framework;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Auxiliary\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class MapFileResolverTests\n    {\n        private readonly MapFileResolver _resolver = CreateMapFileResolver();\n\n        [Test]\n        public void ChecksFirstDate()\n        {\n            var mapFileProvider = TestGlobals.MapFileProvider;\n            var mapFileResolver = mapFileProvider.Get(AuxiliaryDataKey.EquityUsa);\n            // QQQ started trading on 19990310\n            var mapFile = mapFileResolver.ResolveMapFile(\"QQQ\", new DateTime(1999, 3, 9));\n            Assert.IsTrue(mapFile.IsNullOrEmpty());\n\n            var mapFile2 = mapFileResolver.ResolveMapFile(\"QQQ\", new DateTime(2015, 3, 10));\n            Assert.IsFalse(mapFile2.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void ResolvesCorrectlyReUsedTicker()\n        {\n            var mapFileProvider = TestGlobals.MapFileProvider;\n            var mapFileResolver = mapFileProvider.Get(AuxiliaryDataKey.EquityUsa);\n\n            // FB.1 started trading on 19990929 and ended on 20030328\n            var mapFile = mapFileResolver.ResolveMapFile(\"FB\", new DateTime(1999, 9, 28));\n            Assert.IsTrue(mapFile.IsNullOrEmpty());\n\n            mapFile = mapFileResolver.ResolveMapFile(\"FB\", new DateTime(1999, 9, 29));\n            Assert.IsFalse(mapFile.IsNullOrEmpty());\n\n            // FB started trading on 20120518\n            mapFile = mapFileResolver.ResolveMapFile(\"FB\", new DateTime(2012, 5, 17));\n            Assert.IsTrue(mapFile.IsNullOrEmpty());\n\n            mapFile = mapFileResolver.ResolveMapFile(\"FB\", new DateTime(2015, 5, 18));\n            Assert.IsFalse(mapFile.IsNullOrEmpty());\n        }\n\n        [Test]\n        public void InitializationSpeedTest()\n        {\n            var mapFileProvider = TestGlobals.MapFileProvider;\n            var sw = Stopwatch.StartNew();\n            var mapFileresolver = mapFileProvider.Get(AuxiliaryDataKey.EquityUsa);\n            sw.Stop();\n            Log.Trace($\"elapsed: {sw.Elapsed.TotalSeconds} seconds\");\n        }\n\n        [Test]\n        public void ResolvesStraightMapping()\n        {\n            var spyMapFile = _resolver.ResolveMapFile(\"SPY\", new DateTime(2015, 08, 23));\n            Assert.IsNotNull(spyMapFile);\n            Assert.AreEqual(\"SPY\", spyMapFile.GetMappedSymbol(new DateTime(2015, 08, 23)));\n        }\n\n        [Test]\n        public void MapFileReturnDefaultValueCorrectly()\n        {\n            var spyMapFile = _resolver.ResolveMapFile(\"PEPE\", new DateTime(2015, 08, 23));\n            Assert.IsNotNull(spyMapFile);\n            Assert.AreEqual(\"Pepito\", spyMapFile.GetMappedSymbol(new DateTime(2015, 08, 23), \"Pepito\"));\n        }\n\n        [Test]\n        public void ResolvesMapFilesOnNonSpecifiedDates()\n        {\n            var mapFile = _resolver.ResolveMapFile(\"GOOG\", new DateTime(2014, 04, 01));\n            Assert.AreEqual(\"GOOGL\", mapFile.Permtick);\n\n            mapFile = _resolver.ResolveMapFile(\"GOOG\", new DateTime(2014, 04, 03));\n            Assert.AreEqual(\"GOOG\", mapFile.Permtick);\n        }\n\n        [Test]\n        public void ResolvesOldSymbolRemapped()\n        {\n            // on 2014.04.02 a symbol GOOG traded its last day, the following day it would trade under GOOGL\n            var april2 = new DateTime(2014, 04, 02);\n            var googMapFile = _resolver.ResolveMapFile(\"GOOG\", april2);\n            Assert.IsNotNull(googMapFile);\n            Assert.AreEqual(\"GOOG\", googMapFile.GetMappedSymbol(april2));\n            Assert.AreEqual(\"GOOGL\", googMapFile.GetMappedSymbol(april2.AddDays(1)));\n        }\n\n        [Test]\n        public void ResolvesExactMapping()\n        {\n            var oih1 = _resolver.ResolveMapFile(\"OIH.1\", new DateTime(2011, 12, 20));\n            Assert.IsNotNull(oih1);\n            Assert.AreEqual(\"OIH\", oih1.GetMappedSymbol(new DateTime(2010, 02, 06)));\n            Assert.AreEqual(\"OIH\", oih1.GetMappedSymbol(new DateTime(2010, 02, 07)));\n            Assert.AreEqual(\"OIH\", oih1.GetMappedSymbol(new DateTime(2011, 12, 20)));\n            Assert.AreEqual(string.Empty, oih1.GetMappedSymbol(new DateTime(2011, 12, 21)));\n        }\n\n        [Test]\n        public void ResolvesRemappedSymbolWithBothMapFiles()\n        {\n            var date = new DateTime(2012, 06, 28);\n            var mapFile = _resolver.ResolveMapFile(\"SPXL\", date);\n            Assert.IsNotNull(mapFile);\n            Assert.AreEqual(\"BGU\", mapFile.GetMappedSymbol(date));\n            Assert.AreEqual(\"SPXL\", mapFile.GetMappedSymbol(date.AddDays(1)));\n        }\n\n        [Test]\n        public void ResolvesRemappedAndDelistedSymbol()\n        {\n            var date = new DateTime(2018, 7, 23);\n            var mapFile = _resolver.ResolveMapFile(\"TWX\", date);\n            Assert.IsNotNull(mapFile);\n            Assert.AreEqual(\"AOL\", mapFile.GetMappedSymbol(new DateTime(2000, 1, 1)));\n            Assert.AreEqual(\"TWX\", mapFile.GetMappedSymbol(new DateTime(2014, 1, 1)));\n        }\n\n        [Test]\n        public void ContinuousFuturesMappingMode()\n        {\n            var date = new DateTime(2018, 7, 23);\n            var mapFile = _resolver.ResolveMapFile(\"NG\", date);\n            Assert.IsNotNull(mapFile);\n            Assert.AreEqual(\"NG UNT495KXTOLD\", mapFile.GetMappedSymbol(new DateTime(2010, 6, 15), dataMappingMode: DataMappingMode.LastTradingDay));\n            Assert.AreEqual(\"NG UOMNNYK04BEP\", mapFile.GetMappedSymbol(new DateTime(2010, 6, 15), dataMappingMode: DataMappingMode.FirstDayMonth));\n            Assert.AreEqual(\"NG UMWMI2IDASAP\", mapFile.GetMappedSymbol(new DateTime(2010, 6, 15), dataMappingMode: DataMappingMode.OpenInterest));\n        }\n\n        private static MapFileResolver CreateMapFileResolver()\n        {\n            return new MapFileResolver(new List<MapFile>\n            {\n                // remapped\n                new MapFile(\"goog\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2014, 03, 27), \"goocv\"),\n                    new MapFileRow(new DateTime(2014, 04, 02), \"goocv\"),\n                    new MapFileRow(new DateTime(2050, 12, 31), \"goog\")\n                }),\n                new MapFile(\"googl\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2004, 08, 19), \"goog\"),\n                    new MapFileRow(new DateTime(2014, 04, 02), \"goog\"),\n                    new MapFileRow(new DateTime(2050, 12, 31), \"googl\")\n                }),\n                // remapped (with both map files)\n                new MapFile(\"bgu\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2008, 11, 05), \"bgu\"),\n                    new MapFileRow(new DateTime(2012, 06, 28), \"bgu\")\n                }),\n                new MapFile(\"spxl\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2008, 11, 05), \"bgu\"),\n                    new MapFileRow(new DateTime(2012, 06, 28), \"bgu\"),\n                    new MapFileRow(new DateTime(2050, 12, 31), \"spxl\")\n                }),\n                // straight mapping\n                new MapFile(\"spy\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(1998, 01, 02), \"spy\"),\n                    new MapFileRow(new DateTime(2050, 12, 31), \"spy\")\n                }),\n                // new share class overtakes old share class same symbol\n                new MapFile(\"oih.1\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2010, 02, 07), \"oih\"),\n                    new MapFileRow(new DateTime(2011, 12, 20), \"oih\")\n                }),\n                new MapFile(\"oih\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2011, 12, 21), \"oih\"),\n                    new MapFileRow(new DateTime(2050, 12, 31), \"oih\")\n                }),\n                // remapped + delisted\n                new MapFile(\"twx.1\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(1998, 1, 2), \"twx\"),\n                    new MapFileRow(new DateTime(2001, 1, 11), \"twx\")\n                }),\n                new MapFile(\"twx\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(1998, 1, 2), \"aol\"),\n                    new MapFileRow(new DateTime(2003, 10, 15), \"aol\"),\n                    new MapFileRow(new DateTime(2018, 6, 15), \"twx\")\n                }),\n                new MapFile(\"ng\", new List<MapFileRow>\n                {\n                    new MapFileRow(new DateTime(2010, 6, 15), \"ng unt495kxtold\", Exchange.NYMEX, DataMappingMode.LastTradingDay),\n                    new MapFileRow(new DateTime(2010, 6, 15), \"ng uomnnyk04bep\", Exchange.NYMEX, DataMappingMode.FirstDayMonth),\n                    new MapFileRow(new DateTime(2010, 6, 15), \"ng umwmi2idasap\", Exchange.NYMEX, DataMappingMode.OpenInterest),\n                }),\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/BacktestingFutureChainProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class BacktestingFutureChainProviderTests\n    {\n        private ILogHandler _logHandler;\n        private BacktestingFutureChainProvider _provider;\n\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            // Store initial Log Handler\n            _logHandler = Log.LogHandler;\n            _provider = new BacktestingFutureChainProvider();\n            _provider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            // Restore intial Log Handler\n            Log.LogHandler = _logHandler;\n        }\n\n        [TestCase(\"20131011\")]\n        // saturday, will fetch previous tradable date instead\n        [TestCase(\"20131012\")]\n        public void CorrectlyDeterminesContractList(string date)\n        {\n            var dateTime = Time.ParseDate(date);\n            var symbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, dateTime.AddDays(10));\n            var result = _provider.GetFutureContractList(symbol, dateTime);\n\n            Assert.IsNotEmpty(result);\n        }\n\n        [TestCase(\"20201007\", 2)]\n        [TestCase(\"20131007\", 5)]\n        public void UsesMultipleResolutions(string strDate, int expectedCount)\n        {\n            // we don't have minute data for this date\n            var date = Time.ParseDate(strDate);\n\n            var symbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, date);\n            var futureChain = _provider.GetFutureContractList(symbol, date).ToList();\n\n            Assert.IsTrue(futureChain.All(x => x.ID.Date.Date >= date));\n            Assert.IsTrue(futureChain.All(x => x.SecurityType == SecurityType.Future));\n            Assert.IsTrue(futureChain.All(x => x.ID.Symbol == Futures.Indices.SP500EMini));\n            Assert.AreEqual(expectedCount, futureChain.Count);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/BaseDataCollectionAggregatorReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class BaseDataCollectionAggregatorReaderTests\n    {\n        [TestCase(Resolution.Daily, 1, true, true)]\n        [TestCase( Resolution.Hour, 1, true, true)]\n        [TestCase(Resolution.Daily, 5849, false, true)]\n        [TestCase(Resolution.Hour, 40832, false, true)]\n        [TestCase(Resolution.Daily, 1, true, false)]\n        [TestCase(Resolution.Hour, 1, true, false)]\n        [TestCase(Resolution.Daily, 5849, false, false)]\n        [TestCase(Resolution.Hour, 40832, false, false)]\n        public void AggregatesDataPerTime(Resolution resolution, int expectedCount, bool singleDate, bool isDataEphemeral)\n        {\n            var reader = Initialize(false, resolution, isDataEphemeral, out var dataSource);\n            TestBaseDataCollection.SingleDate = singleDate;\n\n            var result = reader.Read(dataSource).ToList();\n\n            Assert.AreEqual(expectedCount, result.Count);\n            Assert.IsTrue(result.All(data => data is TestBaseDataCollection));\n\n            if (expectedCount == 1)\n            {\n                var collection = result[0] as TestBaseDataCollection;\n                Assert.IsNotNull(collection);\n                Assert.GreaterOrEqual(collection.Data.Count, 5000);\n                Assert.AreEqual(expectedCount, collection.Data.DistinctBy(data => data.Time).Count());\n                Assert.IsTrue(collection.Data.All(x => x.Symbol == Symbols.AAPL));\n            }\n        }\n\n        private static ISubscriptionDataSourceReader Initialize(bool liveMode, Resolution resolution, bool isDataEphemeral,  out SubscriptionDataSource source)\n        {\n            using var cache = new ZipDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            var config = new SubscriptionDataConfig(typeof(TestBaseDataCollection),\n                Symbols.SPY,\n                resolution,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false);\n            var date = DateTime.MinValue;\n            var path = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, resolution, TickType.Trade);\n            source = new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile);\n            return new BaseDataCollectionAggregatorReader(cache, config, date, liveMode, null);\n        }\n\n        private class TestBaseDataCollection : BaseDataCollection\n        {\n            public static volatile bool SingleDate;\n            private static readonly TradeBar _factory = new TradeBar();\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var dataPoint = _factory.Reader(config, line, date, isLiveMode);\n                if (SingleDate)\n                {\n                    // single day\n                    dataPoint.Time = date;\n                }\n                // universe data collections can return data with a symbol different than the one in the configuration\n                dataPoint.Symbol = Symbols.AAPL;\n                return dataPoint;\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return _factory.GetSource(config, date, isLiveMode);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/BaseDataExchangeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class BaseDataExchangeTests\n    {\n        // This is a default timeout for all tests to wait if something went wrong\n        const int DefaultTimeout = 30000;\n        private CancellationTokenSource _cancellationTokenSource;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _cancellationTokenSource = new CancellationTokenSource();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _cancellationTokenSource.Cancel();\n            _cancellationTokenSource.DisposeSafely();\n        }\n\n        [Test]\n        public void EndsQueueConsumption()\n        {\n            var enqueable = new EnqueueableEnumerator<BaseData>();\n            var exchange = new BaseDataExchange(\"test\");\n\n            using var cancellationToken = new CancellationTokenSource();\n            Task.Run(() =>\n            {\n                while (!cancellationToken.IsCancellationRequested)\n                {\n                    Thread.Sleep(10);\n                    enqueable.Enqueue(new Tick {Symbol = Symbols.SPY, Time = DateTime.UtcNow});\n                }\n            });\n\n            BaseData last = null;\n            using var lastUpdated = new AutoResetEvent(false);\n            exchange.AddEnumerator(Symbols.SPY, enqueable, handleData: spy =>\n            {\n                last = spy;\n                lastUpdated.Set();\n            });\n\n            using var finishedRunning = new AutoResetEvent(false);\n            Task.Run(() => { exchange.Start(); finishedRunning.Set(); } );\n\n            try\n            {\n                Assert.IsTrue(lastUpdated.WaitOne(DefaultTimeout));\n            }\n            finally\n            {\n                exchange.Stop();\n                cancellationToken.Cancel();\n            }           \n\n            Assert.IsTrue(finishedRunning.WaitOne(DefaultTimeout));\n\n            var endTime = DateTime.UtcNow;\n            Assert.IsNotNull(last);\n            Assert.IsTrue(last.Time <= endTime);\n            enqueable.Dispose();\n        }\n\n        [Test]\n        public void DefaultErrorHandlerDoesNotStopQueueConsumption()\n        {\n            var enqueable = new EnqueueableEnumerator<BaseData>();\n            var exchange = new BaseDataExchange(\"test\");\n\n            using var cancellationToken = new CancellationTokenSource();\n            Task.Run(() =>\n            {\n                while (!cancellationToken.IsCancellationRequested)\n                {\n                    Thread.Sleep(10);\n                    enqueable.Enqueue(new Tick { Symbol = Symbols.SPY, Time = DateTime.UtcNow });\n                }\n            });\n\n            var first = true;\n            BaseData last = null;\n            using var lastUpdated = new AutoResetEvent(false);\n            exchange.AddEnumerator(Symbols.SPY, enqueable, handleData: spy =>\n            {\n                if (first)\n                {\n                    first = false;\n                    throw new RegressionTestException(\"This exception should be swalloed by the exchange!\");\n                }\n                last = spy;\n                lastUpdated.Set();\n            });\n\n            Task.Run(() => exchange.Start());\n\n            try\n            {\n                Assert.IsTrue(lastUpdated.WaitOne(DefaultTimeout));\n            }\n            finally\n            {\n                exchange.Stop();\n                cancellationToken.Cancel();\n                enqueable.Dispose();\n            }\n        }\n\n        [Test]\n        public void SetErrorHandlerExitsOnTrueReturn()\n        {\n            var enqueable = new EnqueueableEnumerator<BaseData>();\n            var exchange = new BaseDataExchange(\"test\");\n\n            using var cancellationToken = new CancellationTokenSource();\n            Task.Factory.StartNew(() =>\n            {\n                while (!cancellationToken.IsCancellationRequested)\n                {\n                    Thread.Sleep(10);\n                    enqueable.Enqueue(new Tick { Symbol = Symbols.SPY, Time = DateTime.UtcNow });\n                }\n            });\n\n            var first = true;\n            using var errorCaught = new AutoResetEvent(true);\n            BaseData last = null;\n\n            exchange.SetErrorHandler(error =>\n            {\n                errorCaught.Set();\n                return true;\n            });\n\n            exchange.AddEnumerator(Symbols.SPY, enqueable, handleData: spy =>\n            {\n                if (first)\n                {\n                    first = false;\n                    throw new RegressionTestException();\n                }\n                last = spy;\n            });\n\n            Task.Run(() => exchange.Start());\n\n            try\n            {\n                Assert.IsTrue(errorCaught.WaitOne(DefaultTimeout));\n                Assert.IsNull(last);\n            }\n            finally\n            {\n                exchange.Stop();\n                enqueable.Dispose();\n                cancellationToken.Cancel();\n            }\n        }\n\n        [Test]\n        public void RespectsShouldMoveNext()\n        {\n            var exchange = new BaseDataExchange(\"test\");\n            exchange.SetErrorHandler(exception => true);\n            exchange.AddEnumerator(Symbol.Empty, new List<BaseData> {new Tick()}.GetEnumerator(), () => false);\n\n            using var isFaultedEvent = new ManualResetEvent(false);\n            using var isCompletedEvent = new ManualResetEvent(false);\n            Task.Run(() => exchange.Start()).ContinueWith(task =>\n            {\n                if (task.IsFaulted) isFaultedEvent.Set();\n                isCompletedEvent.Set();\n            });\n\n            try\n            {\n                isCompletedEvent.WaitOne();\n                Assert.IsFalse(isFaultedEvent.WaitOne(0));\n            }\n            finally\n            {\n                exchange.Stop();\n            }\n        }\n\n        [Test]\n        public void FiresOnEnumeratorFinishedEvents()\n        {\n            var exchange = new BaseDataExchange(\"test\");\n            IEnumerator<BaseData> enumerator = new List<BaseData>().GetEnumerator();\n\n            using var isCompletedEvent = new ManualResetEvent(false);\n            exchange.AddEnumerator(Symbol.Empty, enumerator, () => true, handler => isCompletedEvent.Set());\n            Task.Run(() => exchange.Start());\n\n            isCompletedEvent.WaitOne();\n            exchange.Stop();\n        }\n\n        [Test]\n        public void RemovesBySymbol()\n        {\n            var exchange = new BaseDataExchange(\"test\");\n            var enumerator = new List<BaseData> {new Tick {Symbol = Symbols.SPY}}.GetEnumerator();\n            exchange.AddEnumerator(Symbols.SPY, enumerator);\n            var removed = exchange.RemoveEnumerator(Symbols.AAPL);\n            Assert.IsNull(removed);\n            removed = exchange.RemoveEnumerator(Symbols.SPY);\n            Assert.AreEqual(Symbols.SPY, removed.Symbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/CollectionSubscriptionDataSourceReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.Tiingo;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class CollectionSubscriptionDataSourceReaderTests\n    {\n        [Test]\n        public void HandlesInitializationErrors()\n        {\n            var date = new DateTime(2018, 7, 7);\n            var config = new SubscriptionDataConfig(typeof(TiingoPrice), Symbols.AAPL, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false, true);\n            var reader = new CollectionSubscriptionDataSourceReader(null, config, date, false, null);\n            var source = new TiingoPrice().GetSource(config, date, false);\n\n            // should not throw with an empty or invalid Tiingo API token\n            Assert.DoesNotThrow(() =>\n            {\n                var list = reader.Read(source).ToList();\n                Assert.AreEqual(0, list.Count);\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/CompositeTimeProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class CompositeTimeProviderTests\n    {\n        [Test]\n        public void NoProviderGiven()\n        {\n            var compositeTimeProvider = new CompositeTimeProvider(Enumerable.Empty<ITimeProvider>());\n\n            var utcNow = DateTime.UtcNow;\n\n            Assert.LessOrEqual(utcNow, compositeTimeProvider.GetUtcNow());\n        }\n\n        [Test]\n        public void SmallestTime()\n        {\n            var time = new DateTime(1999, 1, 1);\n\n            var timeProvider1 = new ManualTimeProvider();\n            timeProvider1.SetCurrentTimeUtc(time.AddYears(1));\n            var timeProvider2 = new ManualTimeProvider();\n            timeProvider2.SetCurrentTimeUtc(time);\n            var timeProvider3 = new ManualTimeProvider();\n            timeProvider3.SetCurrentTimeUtc(time.AddYears(2));\n\n            var compositeTimeProvider = new CompositeTimeProvider(new[] { timeProvider1 , timeProvider2, timeProvider3 });\n\n            Assert.LessOrEqual(time, compositeTimeProvider.GetUtcNow());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/CustomLiveDataFeedTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Transport;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\nusing QuantConnect.Lean.Engine.Storage;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class CustomLiveDataFeedTests\n    {\n        private LiveSynchronizer _synchronizer;\n        private IDataFeed _feed;\n\n        [TearDown]\n        public void TearDown()\n        {\n            _feed.Exit();\n            _synchronizer.DisposeSafely();\n        }\n\n        [Test]\n        public void EmitsDailyCustomFutureDataOverWeekends()\n        {\n            using var api = new Api.Api();\n            RemoteFileSubscriptionStreamReader.SetDownloadProvider(api);\n            var tickers = new[] { \"CHRIS/CME_ES1\", \"CHRIS/CME_ES2\" };\n            var startDate = new DateTime(2018, 4, 1);\n            var endDate = new DateTime(2018, 4, 20);\n\n            // delete temp files\n            foreach (var ticker in tickers)\n            {\n                var fileName = TestableCustomFuture.GetLocalFileName(ticker, \"test\");\n                File.Delete(fileName);\n            }\n\n            var algorithm = new QCAlgorithm();\n            CreateDataFeed(algorithm.Settings);\n            var dataManager = new DataManagerStub(algorithm, _feed);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            var symbols = tickers.Select(ticker => algorithm.AddData<TestableCustomFuture>(ticker, Resolution.Daily).Symbol).ToList();\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(startDate);\n\n            var dataPointsEmitted = 0;\n            RunLiveDataFeed(algorithm, startDate, symbols, timeProvider, dataManager);\n\n            using var cancellationTokenSource = new CancellationTokenSource();\n            var lastFileWriteDate = DateTime.MinValue;\n\n            // create a timer to advance time much faster than realtime and to simulate live Quandl data file updates\n            var timerInterval = TimeSpan.FromMilliseconds(20);\n            var timer = Ref.Create<Timer>(null);\n            timer.Value = new Timer(state =>\n            {\n                try\n                {\n                    var currentTime = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n\n                    if (currentTime.Date > endDate.Date)\n                    {\n                        Log.Trace($\"Total data points emitted: {dataPointsEmitted.ToStringInvariant()}\");\n\n                        _feed.Exit();\n                        cancellationTokenSource.Cancel();\n                        return;\n                    }\n\n                    if (currentTime.Date > lastFileWriteDate.Date)\n                    {\n                        foreach (var ticker in tickers)\n                        {\n                            var source = TestableCustomFuture.GetLocalFileName(ticker, \"csv\");\n\n                            // write new local file including only rows up to current date\n                            var outputFileName = TestableCustomFuture.GetLocalFileName(ticker, \"test\");\n\n                            var sb = new StringBuilder();\n                            {\n                                using (var reader = new StreamReader(source))\n                                {\n                                    var firstLine = true;\n                                    string line;\n                                    while ((line = reader.ReadLine()) != null)\n                                    {\n                                        if (firstLine)\n                                        {\n                                            sb.AppendLine(line);\n                                            firstLine = false;\n                                            continue;\n                                        }\n\n                                        var csv = line.Split(',');\n                                        var time = Parse.DateTimeExact(csv[0], \"yyyy-MM-dd\");\n                                        if (time.Date >= currentTime.Date)\n                                            break;\n\n                                        sb.AppendLine(line);\n                                    }\n                                }\n                            }\n\n                            if (currentTime.Date.DayOfWeek != DayOfWeek.Saturday && currentTime.Date.DayOfWeek != DayOfWeek.Sunday)\n                            {\n                                var fileContent = sb.ToString();\n                                try\n                                {\n                                    File.WriteAllText(outputFileName, fileContent);\n                                }\n                                catch (IOException)\n                                {\n                                    Log.Error(\"IOException: will sleep 200ms and retry once more\");\n                                    // lets sleep 200ms and retry once more, consumer could be reading the file\n                                    // this exception happens in travis intermittently, GH issue 3273\n                                    Thread.Sleep(200);\n                                    File.WriteAllText(outputFileName, fileContent);\n                                }\n\n                                Log.Trace($\"Time:{currentTime} - Ticker:{ticker} - Files written:{++_countFilesWritten}\");\n                            }\n                        }\n\n                        lastFileWriteDate = currentTime;\n                    }\n\n                    // 30 minutes is the check interval for daily remote files, so we choose a smaller one to advance time\n                    timeProvider.Advance(TimeSpan.FromMinutes(20));\n\n                    //Log.Trace($\"Time advanced to: {timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork)}\");\n\n                    // restart the timer\n                    timer.Value.Change(timerInterval.Milliseconds, Timeout.Infinite);\n\n                }\n                catch (Exception exception)\n                {\n                    Log.Error(exception);\n                    _feed.Exit();\n                    cancellationTokenSource.Cancel();\n                }\n            }, null, timerInterval.Milliseconds, Timeout.Infinite);\n\n            try\n            {\n                foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n                {\n                    foreach (var dataPoint in timeSlice.Slice.Values)\n                    {\n                        Log.Trace($\"Data point emitted at {timeSlice.Slice.Time.ToStringInvariant()}: \" +\n                            $\"{dataPoint.Symbol.Value} {dataPoint.Value.ToStringInvariant()} \" +\n                            $\"{dataPoint.EndTime.ToStringInvariant()}\"\n                        );\n\n                        dataPointsEmitted++;\n                    }\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Trace($\"Error: {exception}\");\n            }\n\n            timer.Value.Dispose();\n            dataManager.RemoveAllSubscriptions();\n            Assert.AreEqual(14 * tickers.Length, dataPointsEmitted);\n        }\n\n\n        [Test]\n        public void RemoteDataDoesNotIncreaseNumberOfSlices()\n        {\n            using var api = new Api.Api();\n            RemoteFileSubscriptionStreamReader.SetDownloadProvider(api);\n\n            var startDate = new DateTime(2017, 4, 2);\n            var endDate = new DateTime(2017, 4, 23);\n            var algorithm = new QCAlgorithm();\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(startDate);\n            var dataQueueHandler = new FuncDataQueueHandler(fdqh =>\n            {\n                var time = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n                var tick = new Tick(time, Symbols.SPY, 1.3m, 1.2m, 1.3m)\n                {\n                    TickType = TickType.Trade\n                };\n                var tick2 = new Tick(time, Symbols.AAPL, 1.3m, 1.2m, 1.3m)\n                {\n                    TickType = TickType.Trade\n                };\n                return new[] { tick, tick2 };\n            }, timeProvider, algorithm.Settings);\n            CreateDataFeed(algorithm.Settings, dataQueueHandler);\n            var dataManager = new DataManagerStub(algorithm, _feed);\n\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            var symbols = new List<Symbol>\n            {\n                algorithm.AddData<TestableRemoteCustomData>(\"FB\", Resolution.Daily).Symbol,\n                algorithm.AddData<TestableRemoteCustomData>(\"IBM\", Resolution.Daily).Symbol,\n                algorithm.AddEquity(\"SPY\", Resolution.Daily).Symbol,\n                algorithm.AddEquity(\"AAPL\", Resolution.Daily).Symbol\n            };\n\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            var dataPointsEmitted = 0;\n            var slicesEmitted = 0;\n\n            RunLiveDataFeed(algorithm, startDate, symbols, timeProvider, dataManager);\n            Thread.Sleep(5000); // Give remote sources a handicap, so the data is available in time\n\n            // create a timer to advance time much faster than realtime and to simulate live Quandl data file updates\n            var timerInterval = TimeSpan.FromMilliseconds(100);\n            var timer = Ref.Create<Timer>(null);\n            timer.Value = new Timer(state =>\n            {\n                // stop the timer to prevent reentrancy\n                timer.Value.Change(Timeout.Infinite, Timeout.Infinite);\n\n                var currentTime = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n\n                if (currentTime.Date > endDate.Date)\n                {\n                    _feed.Exit();\n                    cancellationTokenSource.Cancel();\n                    return;\n                }\n\n                timeProvider.Advance(TimeSpan.FromHours(3));\n\n                // restart the timer\n                timer.Value.Change(timerInterval, timerInterval);\n\n            }, null, TimeSpan.FromSeconds(2), timerInterval);\n\n            try\n            {\n                foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n                {\n                    if (timeSlice.Slice.HasData)\n                    {\n                        slicesEmitted++;\n                        dataPointsEmitted += timeSlice.Slice.Values.Count;\n\n                        if (timeSlice.Time.ConvertFromUtc(TimeZones.NewYork).Hour == 0)\n                        {\n                            Assert.IsTrue(timeSlice.Slice.Values.Any(x => x.Symbol == symbols[0]), $\"Slice doesn't contain {symbols[0]}\");\n                            Assert.IsTrue(timeSlice.Slice.Values.Any(x => x.Symbol == symbols[1]), $\"Slice doesn't contain {symbols[1]}\");\n                        }\n                        else\n                        {\n                            Assert.IsTrue(timeSlice.Slice.Values.Any(x => x.Symbol == symbols[2]), $\"Slice doesn't contain {symbols[2]}\");\n                            Assert.IsTrue(timeSlice.Slice.Values.Any(x => x.Symbol == symbols[3]), $\"Slice doesn't contain {symbols[3]}\");\n                        }\n                    }\n                }\n            }\n            catch (Exception exception)\n            {\n                Log.Trace($\"Error: {exception}\");\n            }\n\n            timer.Value.Dispose();\n            dataManager.RemoveAllSubscriptions();\n            dataQueueHandler.DisposeSafely();\n            // custom data arrives midnight, daily data 4pm\n            Assert.AreEqual(14 * 2, slicesEmitted);\n            Assert.AreEqual(14 * symbols.Count, dataPointsEmitted);\n        }\n\n        [Test]\n        public void LiveDataFeedSourcesDataFromObjectStoreSort()\n        {\n            var dataPointsEmitted = 0;\n            var slicesEmitted = 0;\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            var mockCustomData = new string[]\n            {\n                \"2017-04-28,173.82\",\n                \"2017-04-27,173.52\",\n                \"2017-04-26,174.73\",\n                \"2017-04-25,173.47\",\n                \"2017-04-24,172.08\",\n                \"2017-04-21,172.53\",\n                \"2017-04-20,170.65\",\n                \"2017-04-19,171.04\",\n                \"2017-04-18,169.92\",\n                \"2017-04-17,169.75\",\n                \"2017-04-13,170.79\",\n                \"2017-04-12,161.76\",\n                \"2017-04-11,161.32\",\n                \"2017-04-10,162.05\",\n                \"2017-04-07,161.29\",\n                \"2017-04-06,161.78\",\n                \"2017-04-05,160.53\",\n                \"2017-04-04,160.29\",\n                \"2017-04-03,160.53\"\n            };\n\n            var objectText = string.Join(\"\\n\", mockCustomData);\n\n            var (dataManager, timer, _) = RunLiveDataFeedWithObjectStore(\n                new DateTime(2017, 4, 2),\n                new DateTime(2017, 4, 28),\n                cancellationTokenSource, \"CustomData/CustomIBM\", objectText,\n                (algorithm) => algorithm.AddData<CustomDataSort>(\"IBM\", Resolution.Daily).Symbol);\n\n            var baseData = new List<BaseData>();\n\n            foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (timeSlice.Slice.HasData)\n                {\n                    foreach (var customData in timeSlice.CustomData)\n                    {\n                        foreach (var data in customData.Data)\n                        {\n                            baseData.Add(data);\n                        }\n                    }\n\n                    slicesEmitted++;\n                    dataPointsEmitted += timeSlice.Slice.Values.Count;\n                }\n            }\n\n            timer.Dispose();\n            dataManager.RemoveAllSubscriptions();\n            Assert.AreEqual(mockCustomData.Length, slicesEmitted);\n            Assert.AreEqual(slicesEmitted, dataPointsEmitted);\n\n            for (int i = 0; i < baseData.Count - 1; i++)\n            {\n                if (baseData[i].EndTime > baseData[i + 1].EndTime)\n                {\n                    Assert.Fail($\"Order failure: {baseData[i].EndTime} > {baseData[i + 1].EndTime} at index {i}.\");\n                }\n            }\n        }\n\n        [Test]\n        public void LiveDataFeedSourcesDataFromObjectStore()\n        {\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            var dataPointsEmitted = 0;\n            var slicesEmitted = 0;\n\n            var mockCustomData = new string[]\n            {\n                \"2017-04-03,173.82\",\n                \"2017-04-04,173.52\",\n                \"2017-04-05,174.72\",\n                \"2017-04-06,173.47\",\n                \"2017-04-07,172.08\",\n                \"2017-04-10,172.53\",\n                \"2017-04-11,170.65\",\n                \"2017-04-12,171.04\",\n                \"2017-04-13,169.92\",\n                \"2017-04-17,169.75\",\n                \"2017-04-18,170.79\",\n                \"2017-04-19,161.76\",\n                \"2017-04-20,161.32\",\n                \"2017-04-21,162.05\",\n                \"2017-04-24,161.29\",\n                \"2017-04-25,161.78\",\n                \"2017-04-26,160.53\",\n                \"2017-04-27,160.29\",\n                \"2017-04-28,160.5\"\n            };\n\n            var objectText = string.Join(\"\\n\", mockCustomData);\n\n            var (dataManager, timer, symbol) = RunLiveDataFeedWithObjectStore(new DateTime(2017, 4, 2), new DateTime(2017, 4, 23), cancellationTokenSource, \"CustomData/CustomIBM\", objectText,\n                algorithm => algorithm.AddData<TestableObjectStoreCustomData>(\"IBM\", Resolution.Daily).Symbol);\n\n            foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (timeSlice.Slice.HasData)\n                {\n                    slicesEmitted++;\n                    dataPointsEmitted += timeSlice.Slice.Values.Count;\n                    Assert.AreEqual(symbol, timeSlice.Slice.Values.Single().Symbol, $\"Slice doesn't contain {symbol}\");\n                }\n            }\n\n            timer.Dispose();\n            dataManager.RemoveAllSubscriptions();\n            Assert.AreEqual(14, slicesEmitted);\n            Assert.AreEqual(slicesEmitted, dataPointsEmitted);\n        }\n\n        /// <summary>\n        /// Runs the live data feed with an object store, simulating real-time updates from stored data.\n        /// This method initializes the data feed, sets up a manual time provider, and stores data in the object store.\n        /// </summary>\n        /// <param name=\"startDate\">The start date for the live data feed.</param>\n        /// <param name=\"endDate\">The end date for the live data feed.</param>\n        /// <param name=\"cancellationTokenSource\">A cancellation token to stop the live feed once the end date is reached.</param>\n        /// <param name=\"objectPath\">The object store path where data is saved.</param>\n        /// <param name=\"objectText\">The content (data) to be saved in the object store at the specified path.</param>\n        /// <param name=\"AddData\">A function that adds data to the algorithm and returns a symbol representing the data.</param>\n        /// <returns>\n        /// A tuple containing:\n        /// <list type=\"bullet\">\n        ///     <item><description><see cref=\"DataManagerStub\"/> - The data manager handling data subscriptions for the algorithm.</description></item>\n        ///     <item><description><see cref=\"Timer\"/> - The timer used to advance time and simulate live updates.</description></item>\n        ///     <item><description><see cref=\"Symbol\"/> - The symbol of the added data in the algorithm.</description></item>\n        /// </list>\n        /// </returns>\n        private (DataManagerStub, Timer, Symbol) RunLiveDataFeedWithObjectStore(DateTime startDate, DateTime endDate, CancellationTokenSource cancellationTokenSource,\n            string objectPath, string objectText, Func<QCAlgorithm, Symbol> AddData)\n        {\n            using var api = new Api.Api();\n            RemoteFileSubscriptionStreamReader.SetDownloadProvider(api);\n\n            var algorithm = new QCAlgorithm();\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(startDate);\n\n            CreateDataFeed(algorithm.Settings);\n            var dataManager = new DataManagerStub(algorithm, _feed);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            using var store = new LocalObjectStore();\n            store.Initialize(0, 0, \"\", new Controls(), AlgorithmMode.Backtesting);\n            algorithm.SetObjectStore(store);\n            algorithm.ObjectStore.Save(objectPath, objectText);\n\n            var symbol = AddData(algorithm);\n\n            RunLiveDataFeed(algorithm, startDate, new[] { symbol }, timeProvider, dataManager);\n\n            // create a timer to advance time much faster than realtime and to simulate live Quandl data file updates\n            var timerInterval = TimeSpan.FromMilliseconds(10);\n            var timer = Ref.Create<Timer>(null);\n            timer.Value = new Timer(state =>\n            {\n                // stop the timer to prevent reentrancy\n                timer.Value.Change(Timeout.Infinite, Timeout.Infinite);\n\n                var currentTime = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n\n                if (currentTime.Date > endDate.Date)\n                {\n                    _feed.Exit();\n                    cancellationTokenSource.Cancel();\n                    return;\n                }\n\n                timeProvider.Advance(TimeSpan.FromHours(3));\n\n                // restart the timer\n                timer.Value.Change(timerInterval, timerInterval);\n\n            }, null, TimeSpan.FromMilliseconds(500), timerInterval);\n\n            return (dataManager, timer.Value, symbol);\n        }\n\n        private void CreateDataFeed(IAlgorithmSettings settings,\n            FuncDataQueueHandler funcDataQueueHandler = null)\n        {\n            _feed = new TestableLiveTradingDataFeed(settings, funcDataQueueHandler ?? new FuncDataQueueHandler(x => Enumerable.Empty<BaseData>(), RealTimeProvider.Instance, new AlgorithmSettings()));\n        }\n\n        private void RunLiveDataFeed(\n            IAlgorithm algorithm,\n            DateTime startDate,\n            IEnumerable<Symbol> symbols,\n            ITimeProvider timeProvider,\n            DataManager dataManager)\n        {\n            _synchronizer = new TestableLiveSynchronizer(timeProvider);\n            _synchronizer.Initialize(algorithm, dataManager, new());\n\n            _feed.Initialize(algorithm, new LiveNodePacket(), new BacktestingResultHandler(),\n                TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider, dataManager, _synchronizer, new DataChannelProvider());\n\n            foreach (var symbol in symbols)\n            {\n                var config = algorithm.Securities[symbol].SubscriptionDataConfig;\n                var request = new SubscriptionRequest(false, null, algorithm.Securities[symbol], config, startDate, Time.EndOfTime);\n                dataManager.AddSubscription(request);\n            }\n        }\n\n        private static int _countFilesWritten;\n\n        public class TestableCustomFuture : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                // use local file instead of remote file\n                var source = GetLocalFileName(config.Symbol.Value, \"test\");\n\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile);\n            }\n\n            public static string GetLocalFileName(string ticker, string fileExtension)\n            {\n                return $\"./TestData/custom_future_{ticker.Replace(\"/\", \"_\").ToLowerInvariant()}.{fileExtension}\";\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(',');\n\n                var data = new TestableCustomFuture\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture),\n                    Value = csv[6].ToDecimal()\n                };\n\n                return data;\n            }\n        }\n\n        public class TestableRemoteCustomData : BaseData\n        {\n            public override DateTime EndTime\n            {\n                get { return Time + Period; }\n                set { Time = value - Period; }\n            }\n\n            /// <summary>\n            /// Gets a time span of one day\n            /// </summary>\n            public TimeSpan Period\n            {\n                get { return QuantConnect.Time.OneDay; }\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = $\"https://www.dl.dropboxusercontent.com/s/1w6x1kfrlvx3d2v/CustomIBM.csv?dl=0\";\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var csv = line.Split(',');\n\n                var data = new TestableRemoteCustomData\n                {\n                    Symbol = config.Symbol,\n                    Time = DateTime.ParseExact(csv[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture),\n                    Value = csv[1].ToDecimal()\n                };\n\n                return data;\n            }\n        }\n\n        public class TestableObjectStoreCustomData : TestableRemoteCustomData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"CustomData/CustomIBM\", SubscriptionTransportMedium.ObjectStore, FileFormat.Csv);\n            }\n        }\n\n        private class CustomDataSort : TestableRemoteCustomData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"CustomData/CustomIBM\", SubscriptionTransportMedium.ObjectStore, FileFormat.Csv) { Sort = true };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/CustomMockedFileBaseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    /// <summary>\n    /// Custom data type that uses a remote file download\n    /// </summary>\n    public class CustomMockedFileBaseData : BaseData\n    {\n        private int _incrementsToAdd;\n        public static DateTime StartDate;\n\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            var start = StartDate.AddTicks(config.Increment.Ticks * _incrementsToAdd++).ConvertFromUtc(config.DataTimeZone);\n            return new CustomMockedFileBaseData\n            {\n                Symbol = config.Symbol,\n                Time = start,\n                EndTime = start.Add(config.Increment),\n                Value = 10\n            };\n        }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            // using an already existing file, the file it self and its contents don't really matter. The reader will mock the values\n            return new SubscriptionDataSource(\"./TestData/spy_with_ichimoku.csv\", SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataDownloader/CanonicalDataDownloaderDecoratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2026 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds.DataDownloader;\nusing System;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.DataDownloader\n{\n    [TestFixture]\n    public class CanonicalDataDownloaderDecoratorTests\n    {\n        [TestCase(\"2026/03/20\", \"2025/03/01\", \"2025/12/31\", \"2025/03/01\", \"2025/12/31\")]\n        [TestCase(\"2026/03/20\", \"2025/03/01\", \"2026/03/25\", \"2025/03/01\", \"2026/03/21\")]\n        [TestCase(\"2026/03/20\", \"2020/01/01\", \"2026/03/25\", \"2024/03/20\", \"2026/03/21\")]\n        [TestCase(\"2022/02/28\", \"2018/01/01\", \"2020/12/31\", \"2020/02/28\", \"2020/12/31\")]\n        [TestCase(\"2022/02/28\", \"2018/01/01\", \"2019/01/01\", default, default)]\n        [TestCase(\"2022/02/28\", \"2022/01/01\", \"2019/01/01\", default, default)]\n        [TestCase(\"2022/02/28\", \"2022/03/01\", \"2022/03/02\", default, default)]\n        [TestCase(\"2022/02/28\", \"2022/02/01 9:30\", \"2022/02/10 16:00\", \"2022/02/01 9:30\", \"2022/02/10 16:00\")]\n        [TestCase(\"2022/02/28\", \"2022/02/01 9:30\", \"2022/02/01 9:30\", \"2022/02/01 9:30\", \"2022/02/01 9:30\")]\n        [TestCase(\"2022/02/28\", \"2018/02/01 9:30\", \"2022/03/01 9:30\", \"2020/02/28\", \"2022/03/01\")]\n        [TestCase(\"2022/02/28\", \"2018/02/01 9:30\", \"2018/03/01 9:30\", default, default)]\n        [TestCase(\"2022/02/28\", \"1997/12/31\", \"2026/02/20\", \"2020/02/28\", \"2022/03/01\")]\n        public void ShouldReceiveAdjustedDateFutureContract(DateTime expiry, DateTime startUtc, DateTime endUtc, DateTime expectedStart, DateTime expectedEnd)\n        {\n            var future = Symbol.CreateFuture(Securities.Futures.Indices.SP500EMini, Market.CME, expiry);\n\n            CanonicalDataDownloaderDecorator.TryAdjustDateRangeForContract(future, startUtc, endUtc, out var start, out var end);\n\n            Assert.AreEqual(expectedStart, start);\n            Assert.AreEqual(expectedEnd, end);\n        }\n\n        [TestCase(\"2026/02/20\", \"2025/03/01\", \"2025/12/31\", \"2025/03/01\", \"2025/12/31\")]\n        [TestCase(\"2026/02/20\", \"2025/02/18\", \"2026/03/25\", \"2025/02/20\", \"2026/02/21\")]\n        [TestCase(\"2026/02/20\", \"2020/01/01\", \"2026/03/25\", \"2025/02/20\", \"2026/02/21\")]\n        [TestCase(\"2026/02/20\", \"1997/12/31\", \"2026/02/20\", \"2025/02/20\", \"2026/02/21\")]\n        [TestCase(\"2020/02/20\", \"2020/01/01\", \"2021/03/25\", \"2020/01/01\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2019/01/01\", \"2021/03/25\", \"2019/02/20\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2018/01/01\", \"2020/02/25\", \"2019/02/20\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2019/08/10\", \"2020/02/20\", \"2019/08/10\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2018/01/01\", \"2018/02/01\", default, default)]\n        [TestCase(\"2020/02/20\", \"2021/01/01\", \"2022/02/01\", default, default)]\n        [TestCase(\"2020/02/20\", \"2020/01/01 9:30\", \"2020/02/20 16:00\", \"2020/01/01 9:30\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2019/01/01 9:30\", \"2020/02/20 16:00\", \"2019/02/20\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2019/01/01 9:30\", \"2019/02/01 9:30\", default, default)]\n        [TestCase(\"2020/02/20\", \"2019/02/20 9:30\", \"2020/02/20\", \"2019/02/20 9:30\", \"2020/02/21\")]\n        [TestCase(\"2020/02/20\", \"2020/02/20 9:30\", \"2020/02/21\", default, default)]\n        public void ShouldReceiveAdjustedDateOptionContract(DateTime expiry, DateTime startUtc, DateTime endUtc, DateTime expectedStart, DateTime expectedEnd)\n        {\n            var aapl = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var option = Symbol.CreateOption(aapl, aapl.ID.Market, aapl.SecurityType.DefaultOptionStyle(), OptionRight.Call, 260m, expiry);\n\n            CanonicalDataDownloaderDecorator.TryAdjustDateRangeForContract(option, startUtc, endUtc, out var start, out var end);\n\n            Assert.AreEqual(expectedStart, start);\n            Assert.AreEqual(expectedEnd, end);\n        }\n\n        [Test]\n        public void ShouldNotAdjustNonOptionOrFutureContract()\n        {\n            var aapl = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n            var res = CanonicalDataDownloaderDecorator.TryAdjustDateRangeForContract(aapl, new DateTime(2025, 03, 01), new DateTime(2025, 12, 31), out var start, out var end);\n            Assert.IsFalse(res);\n            Assert.AreEqual(default(DateTime), start);\n            Assert.AreEqual(default(DateTime), end);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataDownloader/DataDownloaderSelectorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.DataDownloader;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.DataDownloader\n{\n    [TestFixture]\n    public class DataDownloaderSelectorTests\n    {\n        private readonly IMapFileProvider _mapFileProvider = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(\"LocalDiskMapFileProvider\");\n\n        [Test]\n        public void GetDataDownloaderReturnsBaseDownloaderForNonLeanType()\n        {\n            var baseDownloader = new TestDataDownloader();\n            using var selector = new DataDownloaderSelector(baseDownloader, _mapFileProvider, new TestDataProvider());\n\n            var actualBaseDownloader = selector.GetDataDownloader(typeof(object));\n\n            Assert.AreSame(baseDownloader, actualBaseDownloader);\n\n            var actualCanonicalDownloader = selector.GetDataDownloader(typeof(TradeBar));\n\n            Assert.AreEqual(typeof(CanonicalDataDownloaderDecorator), actualCanonicalDownloader.GetType());\n        }\n\n        private class TestDataDownloader : IDataDownloader\n        {\n            public IEnumerable<BaseData> Get(DataDownloaderGetParameters dataDownloaderGetParameters)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private class TestDataProvider : IDataProvider\n        {\n            public event EventHandler<DataProviderNewDataRequestEventArgs> NewDataRequest;\n\n            public Stream Fetch(string key)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataManagerStub.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    internal class DataManagerStub : DataManager\n    {\n        public ISecurityService SecurityService { get; }\n        public IAlgorithm Algorithm { get; }\n        public IDataFeed DataFeed { get; }\n\n        public DataManagerStub()\n            : this(new QCAlgorithm())\n        {\n\n        }\n\n        public DataManagerStub(ITimeKeeper timeKeeper)\n            : this(new QCAlgorithm(), timeKeeper)\n        {\n\n        }\n\n        public DataManagerStub(IAlgorithm algorithm, IDataFeed dataFeed, bool liveMode = false)\n            : this(dataFeed, algorithm, new TimeKeeper(DateTime.UtcNow, TimeZones.NewYork), liveMode)\n        {\n\n        }\n\n        public DataManagerStub(IAlgorithm algorithm)\n            : this(new NullDataFeed(), algorithm, new TimeKeeper(DateTime.UtcNow, TimeZones.NewYork))\n        {\n\n        }\n\n        public DataManagerStub(IDataFeed dataFeed, IAlgorithm algorithm)\n            : this(dataFeed, algorithm, new TimeKeeper(DateTime.UtcNow, TimeZones.NewYork))\n        {\n\n        }\n\n        public DataManagerStub(IAlgorithm algorithm, ITimeKeeper timeKeeper)\n            : this(new NullDataFeed(), algorithm, timeKeeper)\n        {\n\n        }\n\n        public DataManagerStub(IDataFeed dataFeed, IAlgorithm algorithm, ITimeKeeper timeKeeper, bool liveMode = false)\n            : this(dataFeed, algorithm, timeKeeper, MarketHoursDatabase.FromDataFolder(), SymbolPropertiesDatabase.FromDataFolder(), liveMode)\n        {\n\n        }\n\n        public DataManagerStub(IDataFeed dataFeed, IAlgorithm algorithm, ITimeKeeper timeKeeper, MarketHoursDatabase marketHoursDatabase, SymbolPropertiesDatabase symbolPropertiesDatabase, bool liveMode = false)\n            : this(dataFeed, algorithm, timeKeeper, marketHoursDatabase,\n                new SecurityService(algorithm.Portfolio.CashBook,\n                    marketHoursDatabase,\n                    symbolPropertiesDatabase,\n                    algorithm,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCacheProvider(algorithm.Portfolio),\n                    algorithm: algorithm),\n                liveMode)\n        {\n        }\n\n        public DataManagerStub(IDataFeed dataFeed, IAlgorithm algorithm, ITimeKeeper timeKeeper, MarketHoursDatabase marketHoursDatabase, SecurityService securityService, bool liveMode = false)\n            : this(dataFeed,\n                algorithm,\n                timeKeeper,\n                marketHoursDatabase,\n                securityService,\n                new DataPermissionManager(),\n                liveMode)\n        {\n        }\n\n        public DataManagerStub(IDataFeed dataFeed, IAlgorithm algorithm, ITimeKeeper timeKeeper, MarketHoursDatabase marketHoursDatabase, SecurityService securityService, DataPermissionManager dataPermissionManager, bool liveMode = false)\n            : base(dataFeed,\n                new UniverseSelection(algorithm, securityService, dataPermissionManager, TestGlobals.DataProvider),\n                algorithm,\n                timeKeeper,\n                marketHoursDatabase,\n                liveMode,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager)\n        {\n            SecurityService = securityService;\n            algorithm.Securities.SetSecurityService(securityService);\n            Algorithm = algorithm;\n            DataFeed = dataFeed;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing NUnit.Framework;\nusing NUnit.Framework.Internal;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class DataManagerTests\n    {\n        private QCAlgorithm _algorithm;\n        private SecurityService _securityService;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _algorithm = new AlgorithmStub();\n            _securityService = new SecurityService(_algorithm.Portfolio.CashBook,\n                MarketHoursDatabase.AlwaysOpen,\n                SymbolPropertiesDatabase.FromDataFolder(),\n                _algorithm,\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCacheProvider(_algorithm.Portfolio),\n                algorithm: _algorithm);\n        }\n\n        [Test]\n        public void ReturnsExistingConfig()\n        {\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(new NullDataFeed(),\n                new UniverseSelection(_algorithm,\n                    _securityService,\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                _algorithm,\n                _algorithm.TimeKeeper,\n                MarketHoursDatabase.AlwaysOpen,\n                false,\n                new RegisteredSecurityDataTypesProvider(),\n                dataPermissionManager);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false);\n\n            var sameConfig = dataManager.SubscriptionManagerGetOrAdd(config);\n            Assert.IsTrue(ReferenceEquals(sameConfig, config));\n            Assert.AreEqual(1, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            var otherInstance = new SubscriptionDataConfig(config.Type,\n                config.Symbol,\n                config.Resolution,\n                config.DataTimeZone,\n                config.ExchangeTimeZone,\n                config.FillDataForward,\n                config.ExtendedMarketHours,\n                config.IsInternalFeed);\n\n            sameConfig = dataManager.SubscriptionManagerGetOrAdd(otherInstance);\n            Assert.IsTrue(ReferenceEquals(sameConfig, config));\n            Assert.AreEqual(1, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            dataManager.RemoveAllSubscriptions();\n        }\n\n        [Test]\n        public void RemovesExistingConfig()\n        {\n            var dataPermissionManager = new DataPermissionManager();\n            var dataFeed = new TestDataFeed();\n            var dataManager = new DataManager(dataFeed,\n                new UniverseSelection(_algorithm,\n                    _securityService,\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                _algorithm,\n                _algorithm.TimeKeeper,\n                MarketHoursDatabase.AlwaysOpen,\n                false,\n                new RegisteredSecurityDataTypesProvider(),\n                dataPermissionManager);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false);\n\n            Assert.IsTrue(ReferenceEquals(dataManager.SubscriptionManagerGetOrAdd(config), config));\n            Assert.AreEqual(1, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            // we didn't add any subscription yet\n            Assert.IsFalse(dataManager.RemoveSubscription(config));\n\n            var request = new SubscriptionRequest(false,\n                null,\n                new Security(Symbols.SPY,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 1, 1),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    new IdentityCurrencyConverter(Currencies.USD),\n                    new RegisteredSecurityDataTypesProvider(),\n                    new SecurityCache()),\n                config,\n                new DateTime(2019, 1, 1),\n                new DateTime(2019, 1, 1));\n\n            using var enquableEnumerator = new EnqueueableEnumerator<SubscriptionData>();\n            dataFeed.Subscription = new Subscription(request,\n                enquableEnumerator,\n                null);\n\n            Assert.IsTrue(dataManager.AddSubscription(request));\n            Assert.IsTrue(dataManager.RemoveSubscription(config));\n            Assert.AreEqual(0, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            dataManager.RemoveAllSubscriptions();\n        }\n\n        [Test]\n        // reproduces GH issue 3877\n        public void ConfigurationForAddedSubscriptionIsAlwaysPresent()\n        {\n            var dataPermissionManager = new DataPermissionManager();\n            var dataFeed = new TestDataFeed();\n            var dataManager = new DataManager(dataFeed,\n                new UniverseSelection(_algorithm,\n                    _securityService,\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                _algorithm,\n                _algorithm.TimeKeeper,\n                MarketHoursDatabase.AlwaysOpen,\n                false,\n                new RegisteredSecurityDataTypesProvider(),\n                dataPermissionManager);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false);\n\n            // Universe A: adds the config\n            dataManager.SubscriptionManagerGetOrAdd(config);\n\n            var request = new SubscriptionRequest(false,\n                null,\n                new Security(Symbols.SPY,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 1, 1),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    new IdentityCurrencyConverter(Currencies.USD),\n                    new RegisteredSecurityDataTypesProvider(),\n                    new SecurityCache()),\n                config,\n                new DateTime(2019, 1, 1),\n                new DateTime(2019, 1, 1));\n\n            using var enquableEnumerator = new EnqueueableEnumerator<SubscriptionData>();\n            dataFeed.Subscription = new Subscription(request,\n                enquableEnumerator,\n                null);\n\n            // Universe A: adds the subscription\n            dataManager.AddSubscription(request);\n\n            // Universe B: adds the config\n            dataManager.SubscriptionManagerGetOrAdd(config);\n\n            // Universe A: removes the subscription\n            Assert.IsTrue(dataManager.RemoveSubscription(config));\n            Assert.AreEqual(0, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            // Universe B: adds the subscription\n            Assert.IsTrue(dataManager.AddSubscription(request));\n\n            // the config should be present\n            Assert.AreEqual(1, dataManager.GetSubscriptionDataConfigs(config.Symbol).Count);\n\n            dataManager.RemoveAllSubscriptions();\n        }\n\n        [Test]\n        public void ScaledRawNormalizationModeIsNotAllowed()\n        {\n            var dataPermissionManager = new DataPermissionManager();\n            var dataFeed = new TestDataFeed();\n            var dataManager = new DataManager(dataFeed,\n                new UniverseSelection(_algorithm,\n                    _securityService,\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                _algorithm,\n                _algorithm.TimeKeeper,\n                MarketHoursDatabase.AlwaysOpen,\n                false,\n                new RegisteredSecurityDataTypesProvider(),\n                dataPermissionManager);\n\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                false,\n                false,\n                false,\n                dataNormalizationMode: DataNormalizationMode.ScaledRaw);\n\n            using var universe = new TestUniverse(\n                config,\n                new UniverseSettings(Resolution.Daily, 1, false, false, TimeSpan.FromDays(365)));\n            var security = new Equity(\n                config.Symbol,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 1, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                new RegisteredSecurityDataTypesProvider(),\n                new SecurityCache());\n\n            var subscriptionRequest = new SubscriptionRequest(\n                false,\n                universe,\n                security,\n                config,\n                new DateTime(2014, 10, 10),\n                new DateTime(2015, 10, 10));\n\n            var exception = Assert.Throws<InvalidOperationException>(() =>\n            {\n                dataManager.AddSubscription(subscriptionRequest);\n            });\n            Assert.That(exception.Message, Does.Contain(nameof(DataNormalizationMode.ScaledRaw)));\n        }\n\n        private class TestDataFeed : IDataFeed\n        {\n            public Subscription Subscription { get; set; }\n\n            public bool IsActive { get; }\n\n            public void Initialize(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler,\n                IMapFileProvider mapFileProvider, IFactorFileProvider factorFileProvider, IDataProvider dataProvider,\n                IDataFeedSubscriptionManager subscriptionManager, IDataFeedTimeProvider dataFeedTimeProvider,\n                IDataChannelProvider channelProvider)\n            {\n            }\n\n            public Subscription CreateSubscription(SubscriptionRequest request)\n            {\n                return Subscription;\n            }\n\n            public void RemoveSubscription(Subscription subscription)\n            {\n            }\n\n            public void Exit()\n            {\n            }\n        }\n\n        private class TestUniverse : Universe\n        {\n            public TestUniverse(SubscriptionDataConfig config, UniverseSettings universeSettings)\n                : base(config)\n            {\n                UniverseSettings = universeSettings;\n            }\n            public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataPermissionManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class DataPermissionManagerTests\n    {\n        [SetUp]\n        public void SetUp()\n        {\n            Config.Set(\"data-permission-manager\", \"TestDataPermissionManager\");\n            TestInvalidConfigurationAlgorithm.Count = 0;\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            Config.Reset();\n        }\n\n        [Test]\n        public void InvalidConfigurationAddSecurity()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(BasicTemplateDailyAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                // will throw on initialization\n                AlgorithmStatus.Running);\n\n            var result = AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n\n            // algorithm was never set\n            Assert.IsEmpty(result.AlgorithmManager.AlgorithmId);\n        }\n\n        [Test]\n        public void InvalidConfigurationHistoryRequest()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(TestInvalidConfigurationAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                // will throw on initialization\n                AlgorithmStatus.Running);\n\n            var result = AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: \"TestInvalidConfigurationSetupHandler\");\n\n            // algorithm was never set\n            Assert.IsEmpty(result.AlgorithmManager.AlgorithmId);\n            // let's assert initialize was called by the history call failed\n            Assert.AreEqual(1, TestInvalidConfigurationAlgorithm.Count);\n        }\n\n        public class TestDataPermissionManager : DataPermissionManager\n        {\n            public override void AssertConfiguration(SubscriptionDataConfig subscriptionDataConfig, DateTime startTimeLocal, DateTime endTimeLocal)\n            {\n                throw new InvalidOperationException(\"Invalid configuration\");\n            }\n        }\n\n        public class TestInvalidConfigurationAlgorithm : BasicTemplateDailyAlgorithm\n        {\n            public static int Count;\n            public override void Initialize()\n            {\n                Count++;\n                #pragma warning disable CS0618\n                History(\"SPY\", 1, Resolution.Tick).ToList();\n                #pragma warning restore CS0618\n                Count++;\n            }\n        }\n        \n        public class TestInvalidConfigurationSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = new TestInvalidConfigurationAlgorithm();\n                return Algorithm;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DataQueueHandlerManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Packets;\nusing QuantConnect.Queues;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class DataQueueHandlerManagerTests\n    {\n        [TestCase(\"BacktestingBrokerage\")]\n        public void GetFactoryFromDataQueueHandler(string dataQueueHandler)\n        {\n            var factory = JobQueue.GetFactoryFromDataQueueHandler(dataQueueHandler);\n            Assert.NotNull(factory);\n        }\n\n        [Test]\n        public void SetJob()\n        {\n            //Array IDQH\n            var dataHandlers = Newtonsoft.Json.JsonConvert.SerializeObject(new[] { \"FakeDataQueue\" });\n            var jobWithArrayIDQH = new LiveNodePacket\n            {\n                DataQueueHandler = dataHandlers\n            };\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(jobWithArrayIDQH);\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void SubscribeReturnsNull()\n        {\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            var enumerator = compositeDataQueueHandler.Subscribe(GetConfig(), (_, _) => {});\n            Assert.Null(enumerator);\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void SubscribeReturnsNotNull()\n        {\n            var dataHandlers = Newtonsoft.Json.JsonConvert.SerializeObject(new[] { \"FakeDataQueue\" });\n            var job = new LiveNodePacket\n            {\n                DataQueueHandler = dataHandlers\n            };\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(job);\n            var enumerator = compositeDataQueueHandler.Subscribe(GetConfig(), (_, _) => {});\n            Assert.NotNull(enumerator);\n            compositeDataQueueHandler.Dispose();\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void Unsubscribe()\n        {\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.Unsubscribe(GetConfig());\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void IsNotUniverseProvider()\n        {\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            Assert.IsFalse(compositeDataQueueHandler.HasUniverseProvider);\n            Assert.Throws<NotSupportedException>(() => compositeDataQueueHandler.LookupSymbols(Symbols.ES_Future_Chain, false));\n            Assert.Throws<NotSupportedException>(() => compositeDataQueueHandler.CanPerformSelection());\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void DoubleSubscribe()\n        {\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(new LiveNodePacket { DataQueueHandler = \"[ \\\"TestDataHandler\\\" ]\" });\n\n            var dataConfig = GetConfig();\n            var enumerator = compositeDataQueueHandler.Subscribe(dataConfig, (_, _) => {});\n\n            Assert.DoesNotThrow(() => compositeDataQueueHandler.Subscribe(dataConfig, (_, _) => { }));\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void SingleSubscribe()\n        {\n            TestDataHandler.UnsubscribeCounter = 0;\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(new LiveNodePacket { DataQueueHandler = \"[ \\\"TestDataHandler\\\" ]\" });\n\n            var dataConfig = GetConfig();\n            var enumerator = compositeDataQueueHandler.Subscribe(dataConfig, (_, _) => {});\n\n            compositeDataQueueHandler.Unsubscribe(dataConfig);\n            compositeDataQueueHandler.Unsubscribe(dataConfig);\n            compositeDataQueueHandler.Unsubscribe(dataConfig);\n\n            Assert.AreEqual(1, TestDataHandler.UnsubscribeCounter);\n\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void MappedConfig(bool canonicalUnsubscribeFirst)\n        {\n            TestDataHandler.UnsubscribeCounter = 0;\n            TestDataHandler.SubscribeCounter = 0;\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(new LiveNodePacket { DataQueueHandler = \"[ \\\"TestDataHandler\\\" ]\" });\n\n            var canonicalSymbol = Symbols.ES_Future_Chain.UpdateMappedSymbol(Symbols.Future_ESZ18_Dec2018.ID.ToString());\n            var canonicalConfig = GetConfig(canonicalSymbol);\n            var contractConfig = GetConfig(Symbols.Future_ESZ18_Dec2018);\n\n            var enumerator = new LiveSubscriptionEnumerator(canonicalConfig, compositeDataQueueHandler, (_, _) => {}, (_) => false);\n            var enumerator2 = new LiveSubscriptionEnumerator(contractConfig, compositeDataQueueHandler, (_, _) => {}, (_) => false);\n\n            var firstUnsubscribe = canonicalUnsubscribeFirst ? canonicalConfig : contractConfig;\n            var secondUnsubscribe = canonicalUnsubscribeFirst ? contractConfig : canonicalConfig;\n\n            Assert.AreEqual(2, TestDataHandler.SubscribeCounter);\n\n            compositeDataQueueHandler.UnsubscribeWithMapping(firstUnsubscribe);\n            Assert.AreEqual(1, TestDataHandler.UnsubscribeCounter);\n\n            compositeDataQueueHandler.UnsubscribeWithMapping(secondUnsubscribe);\n            Assert.AreEqual(2, TestDataHandler.UnsubscribeCounter);\n\n            enumerator.Dispose();\n            enumerator2.Dispose();\n            compositeDataQueueHandler.Dispose();\n        }\n\n        [Test]\n        public void HandleExplodingDataQueueHandler()\n        {\n            using var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            // first exploding\n            compositeDataQueueHandler.SetJob(new LiveNodePacket { DataQueueHandler = \"[ \\\"ExplodingDataHandler\\\", \\\"TestDataHandler\\\" ]\" });\n            IEnumerator<BaseData> enumerator = null;\n            Assert.DoesNotThrow(() =>\n            {\n                enumerator = compositeDataQueueHandler.Subscribe(GetConfig(), (_, _) => { });\n            });\n            Assert.IsNotNull(enumerator);\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void ExplodingDataQueueHandler()\n        {\n            using var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(new LiveNodePacket { DataQueueHandler = \"[ \\\"ExplodingDataHandler\\\" ]\" });\n            Assert.Throws<Exception>(() =>\n            {\n                using var enumerator = compositeDataQueueHandler.Subscribe(GetConfig(), (_, _) => { });\n            });\n        }\n\n        [Test]\n        public void HandlesCustomData()\n        {\n            var customSymbol = Symbol.CreateBase(typeof(AlgorithmSettings), Symbols.SPY);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), customSymbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork,\n                false, false, false, false, TickType.Trade, false);\n            var dataHandlers = Newtonsoft.Json.JsonConvert.SerializeObject(new[] { \"FakeDataQueue\" });\n            var job = new LiveNodePacket\n            {\n                DataQueueHandler = dataHandlers\n            };\n            var compositeDataQueueHandler = new DataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.SetJob(job);\n            var enumerator = compositeDataQueueHandler.Subscribe(config, (_, _) => { });\n            Assert.NotNull(enumerator);\n            compositeDataQueueHandler.Dispose();\n            enumerator.Dispose();\n        }\n\n        private static SubscriptionDataConfig GetConfig(Symbol symbol = null)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol ?? Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork,\n                false, false, false, false, TickType.Trade, false);\n        }\n\n\n        private class TestDataHandler : IDataQueueHandler\n        {\n            public static int SubscribeCounter { get; set; }\n\n            public static int UnsubscribeCounter { get; set; }\n            public void Dispose()\n            {\n            }\n\n            public virtual IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n            {\n                SubscribeCounter++;\n                return Enumerable.Empty<BaseData>().GetEnumerator();\n            }\n\n            public void Unsubscribe(SubscriptionDataConfig dataConfig)\n            {\n                UnsubscribeCounter++;\n            }\n\n            public void SetJob(LiveNodePacket job)\n            {\n            }\n\n            public bool IsConnected { get; }\n        }\n\n        private class ExplodingDataHandler : TestDataHandler\n        {\n            public override IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n            {\n                throw new Exception(\"ExplodingDataHandler exception!\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DateChangeTimeKeeperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class DateChangeTimeKeeperTests\n    {\n        private static DateTime _start = new DateTime(2024, 10, 01);\n        private static DateTime _end = new DateTime(2024, 10, 11);\n\n        private static TestCaseData[] TimeZonesTestCases => new TestCaseData[]\n        {\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(-1))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(-2))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(-3))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(-4))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(1))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(2))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(3))),\n            new(TimeZones.Utc, DateTimeZone.ForOffset(Offset.FromHours(4))),\n            new(TimeZones.Utc, TimeZones.Utc),\n            new(TimeZones.NewYork, TimeZones.NewYork),\n            new(TimeZones.HongKong, TimeZones.HongKong),\n        };\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void EmitsFirstExchangeDateEvent(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            using var timeKeeper = GetTimeKeeper(dataTimeZone, exchangeTimeZone, true, null, out var tradableDates, out var config, out var exchangeHours);\n\n            var emittedExchangeDates = new List<DateTime>();\n            void HandleNewTradableDate(object sender, DateTime date)\n            {\n                emittedExchangeDates.Add(date);\n            }\n\n            timeKeeper.NewExchangeDate += HandleNewTradableDate;\n\n            var firstDataDate = tradableDates[0];\n            var firstDataDateInExchangeTimeZone = firstDataDate.ConvertTo(dataTimeZone, exchangeTimeZone);\n            var firstExchangeDateIsBeforeFirstDataDate = firstDataDateInExchangeTimeZone < firstDataDate;\n\n            try\n            {\n                Assert.IsTrue(timeKeeper.TryAdvanceUntilNextDataDate());\n                Assert.AreEqual(1, emittedExchangeDates.Count);\n\n                if (firstExchangeDateIsBeforeFirstDataDate)\n                {\n                    // The first exchange date is the day before the first data date when the exchange is behind the data\n                    var expectedFirstExchangeDate = firstDataDate.AddDays(-1);\n                    Assert.AreEqual(expectedFirstExchangeDate, emittedExchangeDates[0]);\n                    Assert.AreEqual(expectedFirstExchangeDate.ConvertTo(exchangeTimeZone, dataTimeZone), timeKeeper.DataTime);\n                }\n                else\n                {\n                    // If exchange is ahead of the data, even though technically at the first data date the exchange date hasn't changed,\n                    // we emit the first one so that first daily actions are performed (mappings, delistings, etc).\n                    Assert.AreEqual(firstDataDate, emittedExchangeDates[0]);\n                    Assert.AreEqual(firstDataDate, timeKeeper.DataTime);\n                }\n            }\n            finally\n            {\n                timeKeeper.NewExchangeDate -= HandleNewTradableDate;\n            }\n        }\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void ExchangeDatesAreEmittedByAdvancingToNextDataDate(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            using var timeKeeper = GetTimeKeeper(dataTimeZone, exchangeTimeZone, false, null, out var tradableDates, out var config, out var exchangeHours);\n\n            var exchangeDateEmitted = false;\n            var emittedExchangeDates = new List<DateTime>();\n            void HandleNewTradableDate(object sender, DateTime date)\n            {\n                emittedExchangeDates.Add(date);\n                exchangeDateEmitted = true;\n            }\n\n            timeKeeper.NewExchangeDate += HandleNewTradableDate;\n\n            var expectedExchangeDates = new List<DateTime>()\n            {\n                new(2024, 10, 1),\n                new(2024, 10, 2),\n                new(2024, 10, 3),\n                new(2024, 10, 4),\n                new(2024, 10, 7),\n                new(2024, 10, 8),\n                new(2024, 10, 9),\n                new(2024, 10, 10),\n                new(2024, 10, 11),\n            };\n\n            var firstDataDate = tradableDates[0];\n            var firstDataDateInExchangeTimeZone = firstDataDate.ConvertTo(dataTimeZone, exchangeTimeZone);\n            var exchangeIsBehindData = firstDataDateInExchangeTimeZone < firstDataDate;\n            if (exchangeIsBehindData)\n            {\n                expectedExchangeDates.Insert(0, new(2024, 9, 30));\n                expectedExchangeDates.RemoveAt(expectedExchangeDates.Count - 1);\n            }\n\n            try\n            {\n                // Flush first date:\n                Assert.IsTrue(timeKeeper.TryAdvanceUntilNextDataDate());\n                Assert.IsTrue(exchangeDateEmitted);\n\n                for (var i = 1; i < tradableDates.Count; i++)\n                {\n                    exchangeDateEmitted = false;\n                    Assert.IsTrue(timeKeeper.TryAdvanceUntilNextDataDate());\n\n                    if (timeKeeper.DataTime == timeKeeper.ExchangeTime)\n                    {\n                        Assert.AreEqual(tradableDates[i], timeKeeper.DataTime);\n                        Assert.AreEqual(tradableDates[i], timeKeeper.ExchangeTime);\n                        Assert.IsTrue(exchangeDateEmitted);\n                        Assert.AreEqual(tradableDates[i], emittedExchangeDates[^1]);\n                    }\n                    else\n                    {\n                        if (exchangeIsBehindData)\n                        {\n                            Assert.IsFalse(exchangeDateEmitted);\n                            Assert.AreEqual(tradableDates[i - 1], timeKeeper.DataTime);\n                        }\n                        else\n                        {\n                            Assert.IsTrue(exchangeDateEmitted);\n                            Assert.AreEqual(emittedExchangeDates[^1], timeKeeper.ExchangeTime);\n                        }\n\n                        // Move again to the next data date or next exchange date\n                        exchangeDateEmitted = false;\n                        Assert.IsTrue(timeKeeper.TryAdvanceUntilNextDataDate());\n\n                        if (exchangeIsBehindData)\n                        {\n                            Assert.IsTrue(exchangeDateEmitted);\n                            Assert.AreEqual(emittedExchangeDates[^1], timeKeeper.ExchangeTime);\n                        }\n                        else\n                        {\n                            Assert.IsFalse(exchangeDateEmitted);\n                            Assert.AreEqual(tradableDates[i], timeKeeper.DataTime);\n                        }\n                    }\n                }\n\n                CollectionAssert.AreEqual(expectedExchangeDates, emittedExchangeDates);\n            }\n            finally\n            {\n                timeKeeper.NewExchangeDate -= HandleNewTradableDate;\n            }\n        }\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void ExchangeDatesAreEmittedByAdvancingToNextGivenExchangeTime(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            using var timeKeeper = GetTimeKeeper(dataTimeZone, exchangeTimeZone, false, null, out var tradableDates, out var config, out var exchangeHours);\n\n            var exchangeDateEmitted = false;\n            var emittedExchangeDates = new List<DateTime>();\n            void HandleNewTradableDate(object sender, DateTime date)\n            {\n                emittedExchangeDates.Add(date);\n                exchangeDateEmitted = true;\n            }\n\n            timeKeeper.NewExchangeDate += HandleNewTradableDate;\n\n            var expectedExchangeDates = new List<DateTime>()\n            {\n                new(2024, 10, 1),\n                new(2024, 10, 2),\n                new(2024, 10, 3),\n                new(2024, 10, 4),\n                new(2024, 10, 7),\n                new(2024, 10, 8),\n                new(2024, 10, 9),\n                new(2024, 10, 10),\n                new(2024, 10, 11),\n            };\n\n            var firstDataDate = tradableDates[0];\n            var firstDataDateInExchangeTimeZone = firstDataDate.ConvertTo(dataTimeZone, exchangeTimeZone);\n            var exchangeIsBehindData = firstDataDateInExchangeTimeZone < firstDataDate;\n            if (exchangeIsBehindData)\n            {\n                expectedExchangeDates.Insert(0, new(2024, 9, 30));\n                expectedExchangeDates.RemoveAt(expectedExchangeDates.Count - 1);\n            }\n\n            try\n            {\n                // Flush first date:\n                Assert.IsTrue(timeKeeper.TryAdvanceUntilNextDataDate());\n                Assert.IsTrue(exchangeDateEmitted);\n\n                // Using multiple step sizes to simulate data coming in with gaps\n                var steps = new Queue<TimeSpan>();\n                steps.Enqueue(TimeSpan.FromMinutes(1));\n                steps.Enqueue(TimeSpan.FromMinutes(5));\n                steps.Enqueue(TimeSpan.FromMinutes(30));\n                steps.Enqueue(TimeSpan.FromHours(1));\n\n                while (emittedExchangeDates.Count != expectedExchangeDates.Count)\n                {\n                    exchangeDateEmitted = false;\n                    var currentExchangeTime = timeKeeper.ExchangeTime;\n                    var step = steps.Dequeue();\n                    steps.Enqueue(step);\n                    var nextExchangeTime = currentExchangeTime + step;\n                    timeKeeper.AdvanceTowardsExchangeTime(nextExchangeTime);\n\n                    if (nextExchangeTime.Date != currentExchangeTime.Date &&\n                        exchangeHours.IsDateOpen(nextExchangeTime.Date, config.ExtendedMarketHours))\n                    {\n                        Assert.IsTrue(exchangeDateEmitted);\n                        Assert.AreEqual(emittedExchangeDates[^1], nextExchangeTime.Date);\n                        Assert.AreEqual(timeKeeper.ExchangeTime, nextExchangeTime.Date);\n                    }\n                    else\n                    {\n                        Assert.IsFalse(exchangeDateEmitted);\n                        Assert.AreEqual(timeKeeper.ExchangeTime, nextExchangeTime);\n                    }\n                }\n\n                CollectionAssert.AreEqual(expectedExchangeDates, emittedExchangeDates);\n            }\n            finally\n            {\n                timeKeeper.NewExchangeDate -= HandleNewTradableDate;\n            }\n        }\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void DoesNotAdvancePastDelistingDateWhenAdvancingToNextDataDate(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            var delistingDate = _start.AddDays(7);\n            using var timeKeeper = GetTimeKeeper(dataTimeZone, exchangeTimeZone, false, delistingDate, out var _, out var _, out var _);\n\n            while (timeKeeper.TryAdvanceUntilNextDataDate())\n            {\n                Assert.LessOrEqual(timeKeeper.ExchangeTime.Date, delistingDate.AddDays(1));\n            }\n        }\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void ThrowsIfNotInitialized(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            using var timeKeeper = GetTimeKeeper(dataTimeZone, exchangeTimeZone, false, null, out var _, out var _, out var _);\n\n            Assert.Throws<InvalidOperationException>(() => timeKeeper.AdvanceTowardsExchangeTime(timeKeeper.ExchangeTime.AddHours(1)));\n        }\n\n        [TestCaseSource(nameof(TimeZonesTestCases))]\n        public void FinishesRightAwayIfThereAreNoTradableDates(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            using var timeKeeper = GetNoDatesTimeKeeper(dataTimeZone, exchangeTimeZone);\n\n            Assert.IsFalse(timeKeeper.TryAdvanceUntilNextDataDate());\n        }\n\n        private static DateChangeTimeKeeper GetTimeKeeper(DateTimeZone dataTimeZone,\n            DateTimeZone exchangeTimeZone,\n            bool exchangeAlwaysOpen,\n            DateTime? delistingDate,\n            out List<DateTime> tradableDates,\n            out SubscriptionDataConfig config,\n            out SecurityExchangeHours exchangeHours)\n        {\n            var symbol = Symbols.SPY;\n            exchangeHours = GetMarketHours(symbol, exchangeTimeZone, exchangeAlwaysOpen);\n            config = new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                Resolution.Minute,\n                dataTimeZone,\n                exchangeTimeZone,\n                false,\n                true,\n                false);\n\n            tradableDates = Time.EachTradeableDayInTimeZone(exchangeHours,\n                _start,\n                _end,\n                config.DataTimeZone,\n                config.ExtendedMarketHours).ToList();\n            return new DateChangeTimeKeeper(tradableDates, config, exchangeHours, delistingDate ?? symbol.GetDelistingDate());\n        }\n\n        private static DateChangeTimeKeeper GetNoDatesTimeKeeper(DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone)\n        {\n            var symbol = Symbols.SPY;\n            var exchangeHours = GetMarketHours(symbol, exchangeTimeZone, true);\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                Resolution.Minute,\n                dataTimeZone,\n                exchangeTimeZone,\n                false,\n                true,\n                false);\n\n            var tradableDates = Enumerable.Empty<DateTime>().ToList();\n            return new DateChangeTimeKeeper(tradableDates, config, exchangeHours, symbol.GetDelistingDate());\n        }\n\n        private static SecurityExchangeHours GetMarketHours(Symbol symbol, DateTimeZone exchangeTimeZone, bool alwaysOpen)\n        {\n            SecurityExchangeHours exchangeHours;\n            if (alwaysOpen)\n            {\n                exchangeHours = SecurityExchangeHours.AlwaysOpen(exchangeTimeZone);\n            }\n            else\n            {\n                var databaseExchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n                exchangeHours = new SecurityExchangeHours(exchangeTimeZone,\n                    databaseExchangeHours.Holidays,\n                    databaseExchangeHours.MarketHours.ToDictionary(),\n                    databaseExchangeHours.EarlyCloses,\n                    databaseExchangeHours.LateOpens);\n            }\n\n            return exchangeHours;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/DownloaderDataProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Logging;\nusing System.Threading.Tasks;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing DataFeed = QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.Custom.IconicTypes;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class DownloaderDataProviderTests\n    {\n        [Test]\n        public void ConcurrentDownloadsSameFile()\n        {\n            Log.DebuggingEnabled = true;\n            var downloader = new DataDownloaderTest();\n            using var dataProvider = new DataFeed.DownloaderDataProvider(downloader);\n\n            var date = new DateTime(2000, 3, 17);\n            var dataSymbol = Symbol.Create(\"TEST\", SecurityType.Equity, Market.USA);\n            var actualPath = LeanData.GenerateZipFilePath(Globals.DataFolder, dataSymbol, date, Resolution.Daily, TickType.Trade);\n\n            // the symbol of the data is the same\n            for (var i = 0; i < 10; i++)\n            {\n                downloader.Data.Add(new TradeBar(date.AddDays(i), dataSymbol, i, i, i, i, i));\n            }\n            File.Delete(actualPath);\n\n            var failures = 0L;\n            using var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(10));\n\n            // here we request symbols which is different than the data the downloader will return & we need to store, simulating mapping behavior\n            // the data will always use 'dataSymbol' and the same output path\n            var endedCount = 0;\n            var taskCount = 5;\n            for (var i = 0; i < taskCount; i++)\n            {\n                var myLockId = i;\n                var task = new Task(() =>\n                {\n                    try\n                    {\n                        var count = 0;\n                        while (count++ < 10)\n                        {\n                            var requestSymbol = Symbol.Create($\"TEST{count + Math.Pow(10, myLockId)}\", SecurityType.Equity, Market.USA);\n                            var path = LeanData.GenerateZipFilePath(Globals.DataFolder, requestSymbol, date, Resolution.Daily, TickType.Trade);\n                            // we will get null back because the data is stored to another path, the 'dataSymbol' path which is read bellow\n                            Assert.IsNull(dataProvider.Fetch(path));\n                        }\n                    }\n                    catch (Exception exception)\n                    {\n                        Interlocked.Increment(ref failures);\n                        Log.Error(exception);\n                        cancellationToken.Cancel();\n                    }\n\n                    if(Interlocked.Increment(ref endedCount) == taskCount)\n                    {\n                        // the end\n                        cancellationToken.Cancel();\n                    }\n                }, cancellationToken.Token);\n                task.Start();\n            }\n\n            cancellationToken.Token.WaitHandle.WaitOne();\n\n            Assert.AreEqual(0, Interlocked.Read(ref failures));\n            lock (downloader.DataDownloaderGetParameters)\n            {\n                Assert.AreEqual(downloader.DataDownloaderGetParameters.Count, 50);\n            }\n\n            var data = QuantConnect.Compression.Unzip(actualPath).Single();\n\n            // the data was merged\n            Assert.AreEqual(66, data.Value.Count);\n        }\n\n        [Test]\n        public void CustomDataRequest()\n        {\n            var downloader = new DataDownloaderTest();\n            using var dataProvider = new DataFeed.DownloaderDataProvider(downloader);\n\n            var customData = Symbol.CreateBase(typeof(LinkedData), Symbols.SPY, Market.USA);\n            var date = new DateTime(2023, 3, 17);\n            var path = LeanData.GenerateZipFilePath(Globals.DataFolder + \"fake\", customData, date, Resolution.Minute, TickType.Trade);\n            Assert.IsNull(dataProvider.Fetch(path));\n\n            Assert.AreEqual(0, downloader.DataDownloaderGetParameters.Count);\n        }\n\n        [TestCase(Resolution.Daily, SecurityType.Equity)]\n        [TestCase(Resolution.Hour, SecurityType.Equity)]\n        [TestCase(Resolution.Minute, SecurityType.Equity)]\n        [TestCase(Resolution.Second, SecurityType.Equity)]\n        [TestCase(Resolution.Tick, SecurityType.Equity)]\n        [TestCase(Resolution.Daily, SecurityType.Option)]\n        [TestCase(Resolution.Hour, SecurityType.Option)]\n        [TestCase(Resolution.Minute, SecurityType.Option)]\n        [TestCase(Resolution.Second, SecurityType.Option)]\n        [TestCase(Resolution.Tick, SecurityType.Option)]\n        [TestCase(Resolution.Daily, SecurityType.IndexOption)]\n        [TestCase(Resolution.Hour, SecurityType.IndexOption)]\n        [TestCase(Resolution.Minute, SecurityType.IndexOption)]\n        [TestCase(Resolution.Second, SecurityType.IndexOption)]\n        [TestCase(Resolution.Tick, SecurityType.IndexOption)]\n        [TestCase(Resolution.Daily, SecurityType.Crypto)]\n        [TestCase(Resolution.Hour, SecurityType.Crypto)]\n        [TestCase(Resolution.Minute, SecurityType.Crypto)]\n        [TestCase(Resolution.Second, SecurityType.Crypto)]\n        [TestCase(Resolution.Tick, SecurityType.Crypto)]\n        [TestCase(Resolution.Daily, SecurityType.Future)]\n        [TestCase(Resolution.Hour, SecurityType.Future)]\n        [TestCase(Resolution.Minute, SecurityType.Future)]\n        [TestCase(Resolution.Second, SecurityType.Future)]\n        [TestCase(Resolution.Tick, SecurityType.Future)]\n        [TestCase(Resolution.Daily, SecurityType.FutureOption)]\n        [TestCase(Resolution.Hour, SecurityType.FutureOption)]\n        [TestCase(Resolution.Minute, SecurityType.FutureOption)]\n        [TestCase(Resolution.Second, SecurityType.FutureOption)]\n        [TestCase(Resolution.Tick, SecurityType.FutureOption)]\n        public void CorrectArguments(Resolution resolution, SecurityType securityType)\n        {\n            var downloader = new DataDownloaderTest();\n            using var dataProvider = new DataFeed.DownloaderDataProvider(downloader);\n\n            Symbol symbol = null;\n            Symbol expectedSymbol = null;\n            var expectedLowResolutionStart = new DateTime(1998, 1, 2);\n            var expectedLowResolutionEndUtc = DateTime.UtcNow.Date.AddDays(-1);\n            if (securityType == SecurityType.Equity)\n            {\n                symbol = expectedSymbol = Symbols.AAPL;\n            }\n            else if (securityType == SecurityType.Option)\n            {\n                symbol = Symbols.SPY_C_192_Feb19_2016;\n                expectedSymbol = symbol.Canonical;\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                symbol = Symbol.CreateOption(Symbols.SPX, Symbols.SPX.ID.Market, OptionStyle.European, OptionRight.Call, 38000m, new DateTime(2021, 01, 15));\n                expectedSymbol = symbol.Canonical;\n            }\n            else if (securityType == SecurityType.Crypto)\n            {\n                expectedLowResolutionStart = new DateTime(2009, 1, 1);\n                symbol = expectedSymbol = Symbols.BTCUSD;\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                symbol = Symbols.Future_CLF19_Jan2019;\n                expectedSymbol = symbol.Canonical;\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                symbol = Symbols.CreateFutureOptionSymbol(Symbols.Future_CLF19_Jan2019, OptionRight.Call, 10, new DateTime(2019, 1, 21));\n                expectedSymbol = symbol.Canonical;\n            }\n\n            var date = new DateTime(2023, 3, 17);\n            var timezone = MarketHoursDatabase.FromDataFolder().GetDataTimeZone(symbol.ID.Market, symbol, symbol.SecurityType);\n\n            // For options and index option in hour or daily resolution, the whole year is downloaded\n            if (resolution > Resolution.Minute && (securityType == SecurityType.Option || securityType == SecurityType.IndexOption))\n            {\n                var expectedStartUtc = new DateTime(date.Year, 1, 1);\n                expectedLowResolutionStart = expectedStartUtc.ConvertFromUtc(timezone);\n                expectedLowResolutionEndUtc = expectedStartUtc.AddYears(1);\n            }\n\n            var path = LeanData.GenerateZipFilePath(Globals.DataFolder + \"fake\", symbol, date, resolution, TickType.Trade);\n            Assert.IsNull(dataProvider.Fetch(path));\n\n            var arguments = downloader.DataDownloaderGetParameters.Single();\n\n            Assert.AreEqual(expectedSymbol, arguments.Symbol);\n            Assert.AreEqual(resolution, arguments.Resolution);\n            if (resolution < Resolution.Hour)\n            {\n                // 1 day\n                Assert.AreEqual(date.ConvertToUtc(timezone), arguments.StartUtc);\n                Assert.AreEqual(date.AddDays(1).ConvertToUtc(timezone), arguments.EndUtc);\n            }\n            else\n            {\n                // the whole history\n                Assert.AreEqual(expectedLowResolutionStart.ConvertToUtc(timezone), arguments.StartUtc);\n                Assert.AreEqual(expectedLowResolutionEndUtc, arguments.EndUtc);\n            }\n        }\n\n        private class DataDownloaderTest : IDataDownloader\n        {\n            public List<BaseData> Data { get; } = new();\n            public List<DataDownloaderGetParameters > DataDownloaderGetParameters { get; } = new ();\n            public IEnumerable<BaseData> Get(DataDownloaderGetParameters dataDownloaderGetParameters)\n            {\n                lock(DataDownloaderGetParameters)\n                {\n                    DataDownloaderGetParameters.Add(dataDownloaderGetParameters);\n\n                    if (dataDownloaderGetParameters.Symbol.ID.Symbol.StartsWith(\"TEST\", StringComparison.InvariantCultureIgnoreCase))\n                    {\n                        // let's create some more data based on the symbol, so we can assert it's merged\n                        var id = int.Parse(dataDownloaderGetParameters.Symbol.ID.Symbol.RemoveFromStart(\"TEST\"));\n                        return Data.Select(bar =>\n                        {\n                            var result = bar.Clone();\n                            result.Time = bar.Time.AddDays(id);\n                            result.EndTime = bar.EndTime.AddDays(id);\n                            return result;\n                        });\n                    }\n\n                    return Data;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/AuxiliaryDataEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class AuxiliaryDataEnumeratorTests\n    {\n        private SubscriptionDataConfig _config;\n        private TestTradableDayNotifier _tradableDayNotifier;\n        private Delisting _delistingEvent;\n\n        [SetUp]\n        public void Setup()\n        {\n            _config = SecurityTests.CreateTradeBarConfig();\n            _tradableDayNotifier = new TestTradableDayNotifier();\n            _tradableDayNotifier.Symbol = _config.Symbol;\n            _delistingEvent = new Delisting(_config.Symbol, new DateTime(2009, 1, 1), 1, DelistingType.Delisted);\n        }\n\n        [Test]\n        public void IsSetToNullIfNoDataAlwaysReturnsTrue()\n        {\n            var eventProvider = new TestableEventProvider();\n            var enumerator = new AuxiliaryDataEnumerator(\n                _config,\n                null,\n                null,\n                new ITradableDateEventProvider[] { eventProvider },\n                _tradableDayNotifier,\n                DateTime.UtcNow\n            );\n\n            eventProvider.Data.Enqueue(_delistingEvent);\n            _tradableDayNotifier.TriggerEvent();\n\n            Assert.Null(enumerator.Current);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.NotNull(enumerator.Current);\n            Assert.AreEqual(_delistingEvent, enumerator.Current);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.Null(enumerator.Current);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.Null(enumerator.Current);\n\n            enumerator.Dispose();\n        }\n    }\n\n    class TestableEventProvider : ITradableDateEventProvider\n    {\n        public readonly Queue<BaseData> Data = new Queue<BaseData>();\n\n        public IEnumerable<BaseData> GetEvents(NewTradableDateEventArgs eventArgs)\n        {\n            yield return Data.Dequeue();\n        }\n\n        public void Initialize(SubscriptionDataConfig config, IFactorFileProvider factorFileProvider, IMapFileProvider mapFileProvider, DateTime startTime)\n        {\n        }\n    }\n\n    class TestTradableDayNotifier : ITradableDatesNotifier\n    {\n        public event EventHandler<NewTradableDateEventArgs> NewTradableDate;\n        public DateTime TradableDate { get; set; }\n        public BaseData LastBaseData { get; set; }\n        public Symbol Symbol { get; set; }\n\n        public void TriggerEvent()\n        {\n            NewTradableDate?.Invoke(this, new NewTradableDateEventArgs(TradableDate, LastBaseData, Symbol, null));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/BaseDataCollectionAggregatorEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class BaseDataCollectionAggregatorEnumeratorTests\n    {\n        [Test]\n        public void AggregatesUntilNull()\n        {\n            var time = new DateTime(2015, 10, 20);\n            var underlying = Enumerable.Range(0, 5).Select(x => new Tick { Time = time }).ToList();\n            underlying.AddRange(new Tick[] { null, null, null });\n\n            var aggregator = new BaseDataCollectionAggregatorEnumerator(underlying.GetEnumerator(), Symbols.SPY);\n\n            Assert.IsTrue(aggregator.MoveNext());\n            Assert.IsNotNull(aggregator.Current);\n            Assert.AreEqual(5, aggregator.Current.Data.Count);\n\n            aggregator.Dispose();\n        }\n        [Test]\n        public void AggregatesUntilTimeChange()\n        {\n            var time = new DateTime(2015, 10, 20);\n            var underlying = Enumerable.Range(0, 5).Select(x => new Tick { Time = time }).ToList();\n            underlying.AddRange(Enumerable.Range(0, 5).Select(x => new Tick {Time = time.AddSeconds(1)}));\n\n            var aggregator = new BaseDataCollectionAggregatorEnumerator(underlying.GetEnumerator(), Symbols.SPY);\n\n            Assert.IsTrue(aggregator.MoveNext());\n            Assert.IsNotNull(aggregator.Current);\n            Assert.AreEqual(5, aggregator.Current.Data.Count);\n\n            aggregator.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/ConcatEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Collections;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class ConcatEnumeratorTests\n    {\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SkipsBasedOnEndTime(bool skipsBasedOnEndTime)\n        {\n            var time = new DateTime(2020, 1, 1);\n            var enumerator1 = new List<BaseData> { new Tick(time, Symbols.SPY, 10, 10) }.GetEnumerator();\n            var enumerator2 = new List<BaseData>\n            {\n                new Tick(time.AddSeconds(-1), Symbols.SPY, 20, 20), //should be skipped because end time is before previous tick\n                new Tick(time.AddSeconds(1), Symbols.SPY, 30 , 30)\n            }.GetEnumerator();\n\n            var concat = new ConcatEnumerator(skipsBasedOnEndTime, enumerator1, enumerator2);\n\n            Assert.IsTrue(concat.MoveNext());\n            Assert.AreEqual(10, (concat.Current as Tick).AskPrice);\n\n            if (!skipsBasedOnEndTime)\n            {\n                Assert.IsTrue(concat.MoveNext());\n                Assert.AreEqual(20, (concat.Current as Tick).AskPrice);\n            }\n\n            Assert.IsTrue(concat.MoveNext());\n            Assert.AreEqual(30, (concat.Current as Tick).AskPrice);\n\n            Assert.IsFalse(concat.MoveNext());\n            Assert.IsNull(concat.Current);\n\n            concat.Dispose();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void EmptyNullEnumerators(bool skipsBasedOnEndTime)\n        {\n            var time = new DateTime(2020, 1, 1);\n            // empty enumerators\n            var enumerator1 = new List<BaseData>().GetEnumerator();\n            var enumerator2 = new List<BaseData>().GetEnumerator();\n\n            var enumerator3 = new List<BaseData>\n            {\n                new Tick(time, Symbols.SPY, 10, 10),\n                new Tick(time.AddSeconds(-1), Symbols.SPY, 20, 20),\n                new Tick(time.AddSeconds(1), Symbols.SPY, 30 , 30)\n            }.GetEnumerator();\n\n            var concat = new ConcatEnumerator(skipsBasedOnEndTime, enumerator1, null, enumerator2, enumerator3);\n\n            Assert.IsTrue(concat.MoveNext());\n            Assert.AreEqual(10, (concat.Current as Tick).AskPrice);\n\n            Assert.IsTrue(concat.MoveNext());\n            Assert.AreEqual(20, (concat.Current as Tick).AskPrice);\n\n            Assert.IsTrue(concat.MoveNext());\n            Assert.AreEqual(30, (concat.Current as Tick).AskPrice);\n\n            Assert.IsFalse(concat.MoveNext());\n            Assert.IsNull(concat.Current);\n\n            concat.Dispose();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void DropsEnumeratorsReturningNullAndTrue(bool skipsBasedOnEndTime)\n        {\n            var enumerator1 = new TestEnumerator();\n            var enumerator2 = new TestEnumerator();\n\n            var concat = new ConcatEnumerator(skipsBasedOnEndTime, enumerator1, null, enumerator2);\n\n            Assert.IsTrue(concat.MoveNext());\n\n            Assert.IsNull(concat.Current);\n            Assert.IsTrue(enumerator1.Disposed);\n            Assert.IsFalse(enumerator2.Disposed);\n            Assert.AreEqual(1, enumerator2.MoveNextCount);\n\n            Assert.IsTrue(concat.MoveNext());\n\n            // we assert it just keeps the last enumerator and drops the rest\n            Assert.IsTrue(enumerator1.Disposed);\n            Assert.IsFalse(enumerator2.Disposed);\n            Assert.IsNull(concat.Current);\n            Assert.AreEqual(2, enumerator2.MoveNextCount);\n\n            concat.Dispose();\n        }\n\n        private class TestEnumerator : IEnumerator<BaseData>\n        {\n            public bool Disposed { get; private set; }\n            public int MoveNextCount { get; private set; }\n            public BaseData Current => null;\n\n            object IEnumerator.Current => null;\n\n            public void Dispose()\n            {\n                Disposed = true;\n            }\n\n            public bool MoveNext()\n            {\n                MoveNextCount++;\n                return true;\n            }\n\n            public void Reset()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/DelistingEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class DelistingEnumeratorTests\n    {\n        private SubscriptionDataConfig _config;\n\n        [SetUp]\n        public void SetUp()\n        {\n            var symbol = Symbol.CreateFuture(\"ASD\", Market.USA, new DateTime(2018, 01, 01));\n\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n        }\n\n        [Test]\n        public void EmitsBothEventsIfDateIsPastDelisted()\n        {\n            var eventProvider = new DelistingEventProvider();\n            eventProvider.Initialize(_config,\n                null,\n                null,\n                DateTime.UtcNow);\n\n            var enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    DateTime.UtcNow,\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Warning, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(_config.Symbol.ID.Date, (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Delisted, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(_config.Symbol.ID.Date.AddDays(1), (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsFalse(enumerator.MoveNext());\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EmitsWarningAsOffDelistingDate()\n        {\n            var eventProvider = new DelistingEventProvider();\n            eventProvider.Initialize(_config,\n                null,\n                null,\n                DateTime.UtcNow);\n\n            // should NOT emit\n            var enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    _config.Symbol.ID.Date.Subtract(TimeSpan.FromMinutes(1)),\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n\n            Assert.IsFalse(enumerator.MoveNext());\n\n            // should emit\n            enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    _config.Symbol.ID.Date,\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Warning, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(_config.Symbol.ID.Date, (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsFalse(enumerator.MoveNext());\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EmitsDelistedAfterDelistingDate()\n        {\n            var eventProvider = new DelistingEventProvider();\n            eventProvider.Initialize(_config,\n                null,\n                null,\n                DateTime.UtcNow);\n\n            // should emit warning\n            var enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    _config.Symbol.ID.Date,\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(DelistingType.Warning, (enumerator.Current as Delisting).Type);\n\n            // should NOT emit if not AFTER delisting date\n            enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    _config.Symbol.ID.Date,\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n            Assert.IsFalse(enumerator.MoveNext());\n\n            // should emit AFTER delisting date\n            enumerator = eventProvider.GetEvents(\n                new NewTradableDateEventArgs(\n                    _config.Symbol.ID.Date.AddMinutes(1),\n                    new Tick(DateTime.UtcNow, _config.Symbol, 10, 5),\n                    _config.Symbol,\n                    null\n                )\n            ).GetEnumerator();\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Delisted, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(_config.Symbol.ID.Date.AddDays(1), (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsFalse(enumerator.MoveNext());\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EmitsDelistedWarningOnNonTradableDay()\n        {\n            // Unit test to simulate and reproduce #5545\n\n            // Give us two tradable days before and after expiration\n            var tradableDays = new List<DateTime> { new DateTime(2021, 01, 01), new DateTime(2021, 01, 04) };\n\n            // Set expiration as 1/2/21 a Saturday, not included in our tradble days\n            var expiration = new DateTime(2021, 01, 02);\n            var symbol = Symbol.CreateFuture(\"ASD\", Market.USA, expiration);\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            \n            var eventProvider = new DelistingEventProvider();\n            eventProvider.Initialize(config,\n                null,\n                null,\n                DateTime.UtcNow);\n\n            var tradableDateEvents = tradableDays.Select(day => new NewTradableDateEventArgs(\n                day,\n                new Tick(day, config.Symbol, 10, 5),\n                config.Symbol,\n                null\n            )).GetEnumerator();\n\n            // Pass in the day before expiration should be nothing\n            tradableDateEvents.MoveNext();\n            var enumerator = eventProvider.GetEvents(tradableDateEvents.Current).GetEnumerator();\n            Assert.IsFalse(enumerator.MoveNext());\n\n            // Pass in the following monday, should be both but warning first and still scheduled for saturday\n            tradableDateEvents.MoveNext();\n            enumerator = eventProvider.GetEvents(tradableDateEvents.Current).GetEnumerator();\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Warning, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(config.Symbol.ID.Date, (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current as Delisting);\n            Assert.AreEqual(MarketDataType.Auxiliary, enumerator.Current.DataType);\n            Assert.AreEqual(DelistingType.Delisted, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(config.Symbol.ID.Date.AddDays(1), (enumerator.Current as Delisting).Time.Date);\n            Assert.AreEqual(7.5, (enumerator.Current as Delisting).Price);\n\n            Assert.IsFalse(enumerator.MoveNext());\n\n            tradableDateEvents.Dispose();\n            enumerator.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/DividendEventProviderTests.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class DividendEventProviderTests\n    {\n        // From https://www.nasdaq.com/market-activity/stocks/aapl/dividend-history\n        [TestCase(\"20121106\", 2.65)]\n        [TestCase(\"20130206\", 2.65)]\n        [TestCase(\"20130508\", 3.05)]\n        [TestCase(\"20130807\", 3.05)]\n        [TestCase(\"20131105\", 3.05)]\n        [TestCase(\"20140205\", 3.05)]\n        [TestCase(\"20140507\", 3.29)]\n        [TestCase(\"20140806\", 0.47)]\n        [TestCase(\"20141105\", 0.47)]\n        [TestCase(\"20150204\", 0.47)]\n        [TestCase(\"20150506\", 0.52)]\n        [TestCase(\"20150805\", 0.52)]\n        [TestCase(\"20151104\", 0.52)]\n        [TestCase(\"20160203\", 0.52)]\n        [TestCase(\"20160504\", 0.57)]\n        [TestCase(\"20160803\", 0.57)]\n        [TestCase(\"20161102\", 0.57)]\n        [TestCase(\"20170208\", 0.57)]\n        [TestCase(\"20170510\", 0.63)]\n        [TestCase(\"20170809\", 0.63)]\n        [TestCase(\"20171109\", 0.63)]\n        [TestCase(\"20180208\", 0.63)]\n        [TestCase(\"20180510\", 0.73)]\n        public void DividendsDistribution(string exDividendDateStr, decimal expectedDistribution)\n        {\n            var dividendProvider = new DividendEventProvider();\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.AAPL, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork,\n                false, false, false);\n\n            var start = new DateTime(1998, 01, 02);\n            dividendProvider.Initialize(config, TestGlobals.FactorFileProvider, TestGlobals.MapFileProvider, start);\n\n            var exDividendDate = DateTime.ParseExact(exDividendDateStr, DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n\n            var events = dividendProvider\n                .GetEvents(new NewTradableDateEventArgs(exDividendDate, null, Symbols.AAPL, null))\n                .ToList();\n            // ex dividend date does not emit anything\n            Assert.AreEqual(0, events.Count);\n\n            events = dividendProvider\n                .GetEvents(new NewTradableDateEventArgs(exDividendDate.AddDays(1), null, Symbols.AAPL, null))\n                .ToList();\n\n            Assert.AreEqual(1, events.Count);\n            var dividend = events[0] as Dividend;\n            Assert.IsNotNull(dividend);\n\n            Assert.AreEqual(expectedDistribution, dividend.Distribution);\n        }\n\n        [Test]\n        public void ThrowsWhenEmptyReferencePrice()\n        {\n            var dividendProvider = new DividendEventProvider();\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.AAPL, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork,\n                false, false, false);\n            var start = new DateTime(1998, 01, 02);\n            var row1 = new DateTime(2000, 01, 02);\n            var row2 = new DateTime(2001, 01, 02);\n            var row3 = new DateTime(2002, 01, 02);\n\n            var factorFileProvider = new TestFactorFileProvider\n            {\n                FactorFile = new CorporateFactorProvider(\"AAPL\", new []\n                {\n                    new CorporateFactorRow(row1, 0.693m, 1),\n                    new CorporateFactorRow(row2, 0.77m, 1),\n                    new CorporateFactorRow(row3, 0.85555m, 1)\n                }, start)\n            };\n\n            dividendProvider.Initialize(config, factorFileProvider, TestGlobals.MapFileProvider, start);\n\n            foreach (var row in factorFileProvider.FactorFile.Take(1))\n            {\n                var lastRawPrice = 100;\n                var events = dividendProvider\n                    .GetEvents(new NewTradableDateEventArgs(row.Date, null, Symbols.AAPL, lastRawPrice))\n                    .ToList();\n                // ex dividend date does not emit anything\n                Assert.AreEqual(0, events.Count);\n\n                Assert.Throws<InvalidOperationException>(() =>\n                {\n                    dividendProvider\n                        .GetEvents(new NewTradableDateEventArgs(row.Date.AddDays(1), null, Symbols.AAPL, lastRawPrice))\n                        .ToList();\n                });\n            }\n        }\n\n        private class TestFactorFileProvider : IFactorFileProvider\n        {\n            public CorporateFactorProvider FactorFile { get; set; }\n            public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider)\n            {\n            }\n\n            public IFactorProvider Get(Symbol symbol)\n            {\n                return FactorFile;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/EnqueableEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class EnqueableEnumeratorTests\n    {\n        [Test]\n        public void PassesTicksStraightThrough()\n        {\n            var enumerator = new EnqueueableEnumerator<Tick>();\n\n            // add some ticks\n            var currentTime = new DateTime(2015, 10, 08);\n\n            // returns true even if no data present until stop is called\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick1 = new Tick(currentTime, Symbols.SPY, 199.55m, 199, 200) {Quantity = 10};\n            enumerator.Enqueue(tick1);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(tick1, enumerator.Current);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick2 = new Tick(currentTime, Symbols.SPY, 199.56m, 199.21m, 200.02m) {Quantity = 5};\n            enumerator.Enqueue(tick2);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(tick2, enumerator.Current);\n\n            enumerator.Stop();\n\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void RecordsInternalQueueCount()\n        {\n            var enumerator = new EnqueueableEnumerator<Tick>();\n\n            var currentTime = new DateTime(2015, 12, 01);\n            var tick = new Tick(currentTime, Symbols.SPY, 100, 101);\n            enumerator.Enqueue(tick);\n            Assert.AreEqual(1, enumerator.Count);\n\n            tick = new Tick(currentTime, Symbols.SPY, 100, 101);\n            enumerator.Enqueue(tick);\n            Assert.AreEqual(2, enumerator.Count);\n\n            enumerator.MoveNext();\n            Assert.AreEqual(1, enumerator.Count);\n\n            enumerator.MoveNext();\n            Assert.AreEqual(0, enumerator.Count);\n\n            enumerator.Dispose();\n        }\n\n        [Test, Category(\"TravisExclude\")]\n        public void MoveNextBlocks()\n        {\n            using var finished = new ManualResetEvent(false);\n            var enumerator = new EnqueueableEnumerator<Tick>(true);\n\n            // producer\n            int count = 0;\n            Task.Run(() =>\n            {\n                while (!finished.WaitOne(TimeSpan.FromMilliseconds(50)))\n                {\n                    enumerator.Enqueue(new Tick(DateTime.Now, Symbols.SPY, 100, 101));\n                    count++;\n\n                    // 5 data points is plenty\n                    if (count > 5)\n                    {\n                        finished.Set();\n                        enumerator.Stop();\n                    }\n                }\n            });\n\n            // consumer\n            int dequeuedCount = 0;\n            bool encounteredError = false;\n            using var consumerTaskFinished = new ManualResetEvent(false);\n            Task.Run(() =>\n            {\n                while (enumerator.MoveNext())\n                {\n                    dequeuedCount++;\n                    if (enumerator.Current == null)\n                    {\n                        encounteredError = true;\n                    }\n                }\n                consumerTaskFinished.Set();\n            });\n\n            finished.WaitOne(Timeout.Infinite);\n            consumerTaskFinished.WaitOne(Timeout.Infinite);\n\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsFalse(encounteredError);\n            Assert.AreEqual(count, dequeuedCount);\n\n            enumerator.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/Factories/BaseDataCollectionSubscriptionEnumeratorFactoryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators.Factories\n{\n    [TestFixture]\n    public class BaseDataCollectionSubscriptionEnumeratorFactoryTests\n    {\n        // This test reports higher memory usage when ran with Travis, so we exclude it for now\n        [Test, Category(\"TravisExclude\")]\n        public void DoesNotLeakMemory()\n        {\n            var symbolFactory = new FundamentalUniverse();\n            var symbol = symbolFactory.UniverseSymbol();\n            var config = new SubscriptionDataConfig(typeof(FundamentalUniverse), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, TickType.Trade, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var universeSettings = new UniverseSettings(Resolution.Daily, 2m, true, false, TimeSpan.FromDays(1));\n            var securityInitializer = new BrokerageModelSecurityInitializer(new DefaultBrokerageModel(), SecuritySeeder.Null);\n            using var universe = new CoarseFundamentalUniverse(universeSettings, x => new List<Symbol>{ Symbols.AAPL });\n\n            var factory = new BaseDataCollectionSubscriptionEnumeratorFactory(null);\n\n            GC.Collect();\n            var ramUsageBeforeLoop = OS.TotalPhysicalMemoryUsed;\n\n            var date = new DateTime(2014, 3, 25);\n\n            const int iterations = 1000;\n            for (var i = 0; i < iterations; i++)\n            {\n                var request = new SubscriptionRequest(true, universe, security, config, date, date);\n                using (var enumerator = factory.CreateEnumerator(request, TestGlobals.DataProvider))\n                {\n                    enumerator.MoveNext();\n                }\n            }\n\n            GC.Collect();\n            var ramUsageAfterLoop = OS.TotalPhysicalMemoryUsed;\n\n            Log.Trace($\"RAM usage - before: {ramUsageBeforeLoop} MB, after: {ramUsageAfterLoop} MB\");\n\n            Assert.IsTrue(ramUsageAfterLoop - ramUsageBeforeLoop < 10);\n        }\n\n        [Test]\n        public void ReturnsExpectedTimestamps()\n        {\n            var symbolFactory = new FundamentalUniverse();\n            var symbol = symbolFactory.UniverseSymbol();\n            var config = new SubscriptionDataConfig(typeof(FundamentalUniverse), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, TickType.Trade, false);\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var universeSettings = new UniverseSettings(Resolution.Daily, 2m, true, false, TimeSpan.FromDays(1));\n            var securityInitializer = new BrokerageModelSecurityInitializer(new DefaultBrokerageModel(), SecuritySeeder.Null);\n            using var universe = new CoarseFundamentalUniverse(universeSettings, x => new List<Symbol> { Symbols.AAPL });\n\n            var factory = new BaseDataCollectionSubscriptionEnumeratorFactory(null);\n\n            var dateStart = new DateTime(2014, 3, 26);\n            var dateEnd = new DateTime(2014, 3, 27);\n            var days = (dateEnd - dateStart).Days + 1;\n\n            var request = new SubscriptionRequest(true, universe, security, config, dateStart, dateEnd);\n\n            using (var enumerator = factory.CreateEnumerator(request, TestGlobals.DataProvider))\n            {\n                for (var i = 0; i < days; i++)\n                {\n                    Assert.IsTrue(enumerator.MoveNext());\n\n                    var current = enumerator.Current as BaseDataCollection;\n                    Assert.IsNotNull(current);\n                    Assert.AreEqual(dateStart.AddDays(i), current.Time);\n                    Assert.AreEqual(dateStart.AddDays(i), current.EndTime);\n                    Assert.AreEqual(dateStart.AddDays(i - 1), current.Data[0].Time);\n                    Assert.AreEqual(dateStart.AddDays(i), current.Data[0].EndTime);\n                }\n\n                Assert.IsFalse(enumerator.MoveNext());\n                Assert.IsNotNull(enumerator.Current);\n            }\n        }\n    }\n}\n;\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/Factories/LiveCustomDataSubscriptionEnumeratorFactoryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators.Factories\n{\n    [TestFixture]\n    public class LiveCustomDataSubscriptionEnumeratorFactoryTests\n    {\n        [TestFixture]\n        public class WhenCreatingEnumeratorForRestData\n        {\n            private readonly DateTime _referenceLocal = new DateTime(2017, 10, 12);\n            private readonly DateTime _referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            private ManualTimeProvider _timeProvider;\n            private IEnumerator<BaseData> _enumerator;\n            private Mock<ISubscriptionDataSourceReader> _dataSourceReader;\n\n            [SetUp]\n            public void Given()\n            {\n                _timeProvider = new ManualTimeProvider(_referenceUtc);\n\n                _dataSourceReader = new Mock<ISubscriptionDataSourceReader>();\n                _dataSourceReader.Setup(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                        sds.Source == \"rest.source\" &&\n                        sds.TransportMedium == SubscriptionTransportMedium.Rest &&\n                        sds.Format == FileFormat.Csv))\n                    )\n                    .Returns(Enumerable.Range(0, 100)\n                        .Select(i => new RestData\n                        {\n                            EndTime = _referenceLocal.AddSeconds(i)\n                        }))\n                        .Verifiable();\n\n                var config = new SubscriptionDataConfig(typeof(RestData), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n                var request = GetSubscriptionRequest(config, _referenceUtc.AddSeconds(-1), _referenceUtc.AddDays(1));\n\n                var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _dataSourceReader.Object);\n                _enumerator = factory.CreateEnumerator(request, null);\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                _enumerator?.DisposeSafely();\n            }\n\n            [Test]\n            public void YieldsDataEachSecondAsTimePasses()\n            {\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal, _enumerator.Current.EndTime);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                _timeProvider.AdvanceSeconds(1);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddSeconds(1), _enumerator.Current.EndTime);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                VerifyGetSourceInvocationCount(_dataSourceReader, 1, \"rest.source\", SubscriptionTransportMedium.Rest, FileFormat.Csv);\n            }\n        }\n\n        [TestFixture]\n        public class WhenCreatingEnumeratorForRestCollectionData\n        {\n            private const int DataPerTimeStep = 3;\n            private readonly DateTime _referenceLocal = new DateTime(2017, 10, 12);\n            private readonly DateTime _referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            private ManualTimeProvider _timeProvider;\n            private IEnumerator<BaseData> _enumerator;\n            private Mock<ISubscriptionDataSourceReader> _dataSourceReader;\n\n            [SetUp]\n            public void Given()\n            {\n                _timeProvider = new ManualTimeProvider(_referenceUtc);\n\n                _dataSourceReader = new Mock<ISubscriptionDataSourceReader>();\n                _dataSourceReader.Setup(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                        sds.Source == \"rest.collection.source\" &&\n                        sds.TransportMedium == SubscriptionTransportMedium.Rest &&\n                        sds.Format == FileFormat.UnfoldingCollection))\n                    )\n                    .Returns(Enumerable.Range(0, 100)\n                        .Select(i => new BaseDataCollection(_referenceLocal.AddSeconds(i), Symbols.SPY, Enumerable.Range(0, DataPerTimeStep)\n                            .Select(_ => new RestCollectionData {EndTime = _referenceLocal.AddSeconds(i)})))\n                    )\n                    .Verifiable();\n\n                var config = new SubscriptionDataConfig(typeof(RestCollectionData), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n                var request = GetSubscriptionRequest(config, _referenceUtc.AddSeconds(-4), _referenceUtc.AddDays(1));\n\n                var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _dataSourceReader.Object);\n                _enumerator = factory.CreateEnumerator(request, null);\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                _enumerator?.DisposeSafely();\n            }\n\n            [Test]\n            public void YieldsGroupOfDataEachSecond()\n            {\n                for (int i = 0; i < DataPerTimeStep; i++)\n                {\n                    Assert.IsTrue(_enumerator.MoveNext());\n                    Assert.IsNotNull(_enumerator.Current, $\"Index {i} is null.\");\n                    Assert.AreEqual(_referenceLocal, _enumerator.Current.EndTime);\n                }\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                _timeProvider.AdvanceSeconds(1);\n\n                for (int i = 0; i < DataPerTimeStep; i++)\n                {\n                    Assert.IsTrue(_enumerator.MoveNext());\n                    Assert.IsNotNull(_enumerator.Current);\n                    Assert.AreEqual(_referenceLocal.AddSeconds(1), _enumerator.Current.EndTime);\n                }\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                VerifyGetSourceInvocationCount(_dataSourceReader, 1, \"rest.collection.source\", SubscriptionTransportMedium.Rest, FileFormat.UnfoldingCollection);\n            }\n        }\n\n        [TestFixture]\n        public class WhenCreatingEnumeratorForRemoteCollectionData\n        {\n            private const int DataPerTimeStep = 3;\n            private readonly DateTime _referenceLocal = new DateTime(2017, 10, 12);\n            private readonly DateTime _referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            private ManualTimeProvider _timeProvider;\n            private IEnumerator<BaseData> _enumerator;\n\n            [SetUp]\n            public void Given()\n            {\n                _timeProvider = new ManualTimeProvider(_referenceUtc);\n                var dataSourceReader = new TestISubscriptionDataSourceReader\n                {\n                    TimeProvider = _timeProvider\n                };\n\n                var config = new SubscriptionDataConfig(typeof(RemoteCollectionData), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n                var request = GetSubscriptionRequest(config, _referenceUtc.AddSeconds(-4), _referenceUtc.AddDays(1));\n\n                var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, dataSourceReader);\n                _enumerator = factory.CreateEnumerator(request, null);\n            }\n\n            private class TestISubscriptionDataSourceReader : ISubscriptionDataSourceReader\n            {\n                public ManualTimeProvider TimeProvider;\n                public event EventHandler<InvalidSourceEventArgs> InvalidSource;\n\n                public IEnumerable<BaseData> Read(SubscriptionDataSource source)\n                {\n                    var currentLocalTime = TimeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n                    var data = Enumerable.Range(0, DataPerTimeStep).Select(_ => new RemoteCollectionData { EndTime = currentLocalTime });\n\n                    // let's add some old data which should be ignored\n                    data = data.Concat(Enumerable.Range(0, DataPerTimeStep).Select(_ => new RemoteCollectionData { EndTime = currentLocalTime.AddSeconds(-1) }));\n                    return new BaseDataCollection(currentLocalTime, Symbols.SPY, data);\n                }\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                _enumerator?.DisposeSafely();\n            }\n\n            [Test]\n            public void YieldsGroupOfDataEachSecond()\n            {\n                for (int i = 0; i < DataPerTimeStep; i++)\n                {\n                    Assert.IsTrue(_enumerator.MoveNext());\n                    Assert.IsNotNull(_enumerator.Current, $\"Index {i} is null.\");\n                    Assert.AreEqual(_referenceLocal, _enumerator.Current.EndTime);\n                }\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n\n                _timeProvider.AdvanceSeconds(1);\n\n                for (int i = 0; i < DataPerTimeStep; i++)\n                {\n                    Assert.IsTrue(_enumerator.MoveNext());\n                    Assert.IsNotNull(_enumerator.Current);\n                    Assert.AreEqual(_referenceLocal.AddSeconds(1), _enumerator.Current.EndTime);\n                }\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n            }\n        }\n\n        [TestFixture]\n        public class WhenCreatingEnumeratorForSecondRemoteFileData\n        {\n            private readonly DateTime _referenceLocal = new DateTime(2017, 10, 12);\n            private readonly DateTime _referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            private ManualTimeProvider _timeProvider;\n            private IEnumerator<BaseData> _enumerator;\n            private Mock<ISubscriptionDataSourceReader> _dataSourceReader;\n\n            [SetUp]\n            public void Given()\n            {\n                _timeProvider = new ManualTimeProvider(_referenceUtc);\n\n                _dataSourceReader = new Mock<ISubscriptionDataSourceReader>();\n                _dataSourceReader.Setup(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                        sds.Source == \"remote.file.source\" &&\n                        sds.TransportMedium == SubscriptionTransportMedium.RemoteFile &&\n                        sds.Format == FileFormat.Csv))\n                    )\n                    .Returns(Enumerable.Range(0, 100)\n                        .Select(i => new RemoteFileData\n                        {\n                            // include past data\n                            EndTime = _referenceLocal.AddSeconds(i - 95)\n                        }))\n                    .Verifiable();\n\n                var config = new SubscriptionDataConfig(typeof(RemoteFileData), Symbols.SPY, Resolution.Second, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n                var request = GetSubscriptionRequest(config, _referenceUtc.AddSeconds(-6), _referenceUtc.AddDays(1));\n\n                var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _dataSourceReader.Object);\n                _enumerator = factory.CreateEnumerator(request, null);\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                _enumerator?.DisposeSafely();\n            }\n\n            [Test]\n            public void YieldsDataEachSecondAsTimePasses()\n            {\n                // most recent 5 seconds of data\n                for (int i = 5; i > 0; i--)\n                {\n                    Assert.IsTrue(_enumerator.MoveNext());\n                    Assert.IsNotNull(_enumerator.Current);\n                    Assert.AreEqual(_referenceLocal.AddSeconds(-i), _enumerator.Current.EndTime);\n                }\n\n                // first data point\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal, _enumerator.Current.EndTime);\n\n                _timeProvider.AdvanceSeconds(1);\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddSeconds(1), _enumerator.Current.EndTime);\n\n                VerifyGetSourceInvocationCount(_dataSourceReader, 1, \"remote.file.source\", SubscriptionTransportMedium.RemoteFile, FileFormat.Csv);\n            }\n        }\n\n        [TestFixture]\n        public class WhenCreatingEnumeratorForDailyRemoteFileData\n        {\n            private int _dataPointsAfterReference = 1;\n            private readonly DateTime _referenceLocal = new DateTime(2017, 10, 12);\n            private readonly DateTime _referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            private ManualTimeProvider _timeProvider;\n            private IEnumerator<BaseData> _enumerator;\n            private Mock<ISubscriptionDataSourceReader> _dataSourceReader;\n\n            [SetUp]\n            public void Given()\n            {\n                _timeProvider = new ManualTimeProvider(_referenceUtc);\n\n                _dataSourceReader = new Mock<ISubscriptionDataSourceReader>();\n                _dataSourceReader.Setup(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                        sds.Source == \"remote.file.source\" &&\n                        sds.TransportMedium == SubscriptionTransportMedium.RemoteFile &&\n                        sds.Format == FileFormat.Csv))\n                    )\n                    .Returns(() => Enumerable.Range(0, 100)\n                        .Select(i => new RemoteFileData\n                        {\n                            // include past data\n                            EndTime = _referenceLocal.Add(TimeSpan.FromDays(i - (100 - _dataPointsAfterReference - 1)))\n                        }))\n                    .Verifiable();\n\n                var config = new SubscriptionDataConfig(typeof(RemoteFileData), Symbols.SPY, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n                var request = GetSubscriptionRequest(config, _referenceUtc.AddDays(-2), _referenceUtc.AddDays(1));\n\n                var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(_timeProvider, _dataSourceReader.Object);\n                _enumerator = factory.CreateEnumerator(request, null);\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                _enumerator?.DisposeSafely();\n            }\n\n            [Test]\n            public void YieldsDataEachDayAsTimePasses()\n            {\n                // previous point is exactly one resolution step behind, so it emits\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddDays(-1), _enumerator.Current.EndTime);\n                VerifyGetSourceInvocation(1);\n\n                // yields the data for the current time\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal, _enumerator.Current.EndTime);\n                VerifyGetSourceInvocation(0);\n\n                _timeProvider.Advance(Time.OneDay);\n\n                // now we can yield the next data point as it has passed frontier time\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddDays(1), _enumerator.Current.EndTime);\n                VerifyGetSourceInvocation(0);\n\n                // this call exhaused the enumerator stack and yields a null result\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(0);\n\n                // this call refrshes the enumerator stack but finds no data ahead of the frontier\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(1);\n\n                _timeProvider.Advance(TimeSpan.FromMinutes(30));\n\n                // time advances 30 minutes so we'll try to refresh again\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(1);\n\n                _timeProvider.Advance(Time.OneDay);\n\n                // now to the next day, we'll try again and get data\n                _dataPointsAfterReference++;\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddDays(2), _enumerator.Current.EndTime);\n                VerifyGetSourceInvocation(1);\n\n                _timeProvider.Advance(TimeSpan.FromHours(1));\n\n                // out of data\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(0);\n\n                _timeProvider.Advance(TimeSpan.FromHours(1));\n\n                // time advanced so we'll try to refresh the souce again, but exhaust the stack because no data\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(1);\n\n                // move forward to next whole day, midnight\n                _timeProvider.Advance(Time.OneDay.Subtract(TimeSpan.FromHours(2.5)));\n\n                // the day elapsed but there's still no data available\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(1);\n\n                // this is rate limited by the 30 minute guard for daily data\n                _timeProvider.Advance(TimeSpan.FromMinutes(29));\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(0);\n\n                // another 30 minutes elapsed and now there's data available\n                _dataPointsAfterReference++;\n                _timeProvider.Advance(TimeSpan.FromMinutes(1));\n\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNotNull(_enumerator.Current);\n                Assert.AreEqual(_referenceLocal.AddDays(3), _enumerator.Current.EndTime);\n                VerifyGetSourceInvocation(1);\n\n                // exhausted the stack\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(0);\n\n                // rate limited\n                Assert.IsTrue(_enumerator.MoveNext());\n                Assert.IsNull(_enumerator.Current);\n                VerifyGetSourceInvocation(0);\n            }\n\n            private int _runningCount;\n            private void VerifyGetSourceInvocation(int count)\n            {\n                _runningCount += count;\n                VerifyGetSourceInvocationCount(_dataSourceReader, _runningCount, \"remote.file.source\", SubscriptionTransportMedium.RemoteFile, FileFormat.Csv);\n            }\n        }\n\n        [TestCase(10)]\n        [TestCase(60)]\n        [TestCase(0)]\n        public void AllowsSpecifyingIntervalCheck(int intervalCheck)\n        {\n            var referenceLocal = new DateTime(2017, 10, 12);\n            var referenceUtc = new DateTime(2017, 10, 12).ConvertToUtc(TimeZones.NewYork);\n\n            var timeProvider = new ManualTimeProvider(referenceUtc);\n\n            var callCount = 0;\n            var dataSourceReader = new Mock<ISubscriptionDataSourceReader>();\n            dataSourceReader.Setup(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                    sds.Source == \"local.file.source\" &&\n                    sds.TransportMedium == SubscriptionTransportMedium.LocalFile &&\n                    sds.Format == FileFormat.Csv))\n                )\n                .Returns(() => new []{ new LocalFileData { EndTime = referenceLocal.AddSeconds(++callCount) } })\n                .Verifiable();\n\n            var config = new SubscriptionDataConfig(typeof(LocalFileData), Symbols.SPY, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            var request = GetSubscriptionRequest(config, referenceUtc.AddSeconds(-1), referenceUtc.AddDays(1));\n\n            var intervalCalls = intervalCheck == 0 ? (TimeSpan?) null : TimeSpan.FromMinutes(intervalCheck);\n\n            var factory = new TestableLiveCustomDataSubscriptionEnumeratorFactory(timeProvider, dataSourceReader.Object, intervalCalls);\n            var enumerator = factory.CreateEnumerator(request, null);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n            Assert.AreEqual(referenceLocal.AddSeconds(callCount), enumerator.Current.EndTime);\n\n            VerifyGetSourceInvocationCount(dataSourceReader, 1, \"local.file.source\", SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n\n            // time didn't pass so should refresh\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            VerifyGetSourceInvocationCount(dataSourceReader, 1, \"local.file.source\", SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n\n            var expectedInterval = intervalCalls ?? TimeSpan.FromMinutes(30);\n\n            timeProvider.Advance(expectedInterval.Add(-TimeSpan.FromSeconds(2)));\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            VerifyGetSourceInvocationCount(dataSourceReader, 1, \"local.file.source\", SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n\n            timeProvider.Advance(TimeSpan.FromSeconds(2));\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n            Assert.AreEqual(referenceLocal.AddSeconds(callCount), enumerator.Current.EndTime);\n            VerifyGetSourceInvocationCount(dataSourceReader, 2, \"local.file.source\", SubscriptionTransportMedium.LocalFile, FileFormat.Csv);\n        }\n\n        private static void VerifyGetSourceInvocationCount(Mock<ISubscriptionDataSourceReader> dataSourceReader, int count, string source, SubscriptionTransportMedium medium, FileFormat fileFormat)\n        {\n            dataSourceReader.Verify(dsr => dsr.Read(It.Is<SubscriptionDataSource>(sds =>\n                sds.Source == source && sds.TransportMedium == medium && sds.Format == fileFormat)), Times.Exactly(count));\n        }\n\n        private static SubscriptionRequest GetSubscriptionRequest(SubscriptionDataConfig config, DateTime startTime, DateTime endTime)\n        {\n            var quoteCurrency = new Cash(Currencies.USD, 0, 1);\n            var exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, Symbols.SPY, SecurityType.Equity);\n            var security = new Equity(\n                Symbols.SPY,\n                exchangeHours,\n                quoteCurrency,\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            return new SubscriptionRequest(false, null, security, config, startTime, endTime);\n        }\n\n\n        class RestData : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"rest.source\", SubscriptionTransportMedium.Rest);\n            }\n        }\n\n        class RemoteCollectionData : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"remote.collection.source\", SubscriptionTransportMedium.RemoteFile, FileFormat.UnfoldingCollection);\n            }\n        }\n\n        class RestCollectionData : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"rest.collection.source\", SubscriptionTransportMedium.Rest, FileFormat.UnfoldingCollection);\n            }\n        }\n\n        class RemoteFileData : BaseData\n        {\n            public override DateTime EndTime\n            {\n                get { return Time + QuantConnect.Time.OneDay; }\n                set { Time = value - QuantConnect.Time.OneDay; }\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"remote.file.source\", SubscriptionTransportMedium.RemoteFile);\n            }\n        }\n\n        class LocalFileData : BaseData\n        {\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"local.file.source\", SubscriptionTransportMedium.LocalFile);\n            }\n        }\n\n        class TestableLiveCustomDataSubscriptionEnumeratorFactory : LiveCustomDataSubscriptionEnumeratorFactory\n        {\n            private readonly ISubscriptionDataSourceReader _dataSourceReader;\n\n            public TestableLiveCustomDataSubscriptionEnumeratorFactory(ITimeProvider timeProvider, ISubscriptionDataSourceReader dataSourceReader, TimeSpan? minimumIntervalCheck = null)\n                : base(timeProvider, null, minimumIntervalCheck: minimumIntervalCheck)\n            {\n                _dataSourceReader = dataSourceReader;\n            }\n\n            protected override ISubscriptionDataSourceReader GetSubscriptionDataSourceReader(SubscriptionDataSource source,\n                IDataCacheProvider dataCacheProvider,\n                SubscriptionDataConfig config,\n                DateTime date,\n                BaseData baseData,\n                IDataProvider dataProvider)\n            {\n                return _dataSourceReader;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/FastForwardEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class FastForwardEnumeratorTests\n    {\n        [Test]\n        public void FastForwardsOldData()\n        {\n            var start = new DateTime(2015, 10, 10, 13, 0, 0);\n            var data = new List<Tick>\n            {\n                new Tick {Time = start.AddMinutes(-1)},\n                new Tick {Time = start.AddSeconds(-1)},\n                new Tick {Time = start.AddSeconds(0)},\n                new Tick {Time = start.AddSeconds(1)},\n            };\n\n            var timeProvider = new ManualTimeProvider(start, TimeZones.Utc);\n            var fastForward = new FastForwardEnumerator(data.GetEnumerator(), timeProvider, TimeZones.Utc, TimeSpan.FromSeconds(0.5));\n\n            Assert.IsTrue(fastForward.MoveNext());\n            Assert.AreEqual(start, fastForward.Current.Time);\n            fastForward.Dispose();\n        }\n        [Test]\n        public void FastForwardsOldDataAllowsEquals()\n        {\n            var start = new DateTime(2015, 10, 10, 13, 0, 0);\n            var data = new List<Tick>\n            {\n                new Tick {Time = start.AddMinutes(-1)},\n                new Tick {Time = start.AddSeconds(-1)},\n                new Tick {Time = start.AddSeconds(0)},\n                new Tick {Time = start.AddSeconds(1)},\n            };\n\n            var timeProvider = new ManualTimeProvider(start, TimeZones.Utc);\n            var fastForward = new FastForwardEnumerator(data.GetEnumerator(), timeProvider, TimeZones.Utc, TimeSpan.FromSeconds(1));\n\n            Assert.IsTrue(fastForward.MoveNext());\n            Assert.AreEqual(start.AddSeconds(-1), fastForward.Current.Time);\n            fastForward.Dispose();\n        }\n        [Test]\n        public void FiltersOutPastData()\n        {\n            var start = new DateTime(2015, 10, 10, 13, 0, 0);\n            var data = new List<Tick>\n            {\n                new Tick {Time = start.AddMinutes(-1)},\n                new Tick {Time = start.AddSeconds(-1)},\n                new Tick {Time = start.AddSeconds(1)},\n                new Tick {Time = start.AddSeconds(0)},\n                new Tick {Time = start.AddSeconds(2)}\n            };\n\n            var timeProvider = new ManualTimeProvider(start, TimeZones.Utc);\n            var fastForward = new FastForwardEnumerator(data.GetEnumerator(), timeProvider, TimeZones.Utc, TimeSpan.FromSeconds(0.5));\n\n            Assert.IsTrue(fastForward.MoveNext());\n            Assert.AreEqual(start.AddSeconds(1), fastForward.Current.Time);\n\n            Assert.IsTrue(fastForward.MoveNext());\n            Assert.AreEqual(start.AddSeconds(2), fastForward.Current.Time);\n            fastForward.Dispose();\n        }\n\n        [Test]\n        public void CurrentIsNullWhenEnumeratorReturnsFalse()\n        {\n            var start = new DateTime(2015, 10, 10, 13, 0, 0);\n            var data = new List<Tick>\n            {\n                new Tick {Time = start.AddSeconds(0)}\n            };\n\n            var timeProvider = new ManualTimeProvider(start, TimeZones.Utc);\n            var fastForward = new FastForwardEnumerator(data.GetEnumerator(), timeProvider, TimeZones.Utc, TimeSpan.FromSeconds(0.5));\n\n            Assert.IsTrue(fastForward.MoveNext());\n            Assert.IsNotNull(fastForward.Current);\n\n            Assert.IsFalse(fastForward.MoveNext());\n            Assert.IsNull(fastForward.Current);\n            fastForward.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/FillForwardEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Forex;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class FillForwardEnumeratorTests\n    {\n        [Test]\n        public void FillForwardsUntilSubscriptionEnd()\n        {\n            var dataResolution = Time.OneHour;\n            var fillForwardResolution = Time.OneHour;\n\n            var time = new DateTime(2017, 7, 20, 0, 0, 0);\n            var subscriptionEndTime = time.AddDays(1);\n\n            var enumerator = new List<BaseData>\n            {\n                new TradeBar { Time = time, Value = 1, Period = dataResolution, Volume = 100},\n                new TradeBar { Time = time.AddDays(5), Value = 1, Period = dataResolution, Volume = 100},\n            }.GetEnumerator();\n\n            var exchange = new EquityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(fillForwardResolution), false, time, subscriptionEndTime, dataResolution, exchange.TimeZone, false);\n\n            var dataCount = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                dataCount++;\n                Assert.IsFalse(fillForwardEnumerator.Current.EndTime > subscriptionEndTime);\n            }\n            Assert.AreEqual(24, dataCount);\n        }\n\n        [Test]\n        public void DelistingEvents()\n        {\n            var dataResolution = Time.OneMinute;\n            var fillForwardResolution = Time.OneMinute;\n\n            var time = new DateTime(2017, 7, 20, 0, 0, 0);\n\n            var enumerator = new List<BaseData>\n            {\n                new Delisting(Symbols.SPY, time, 100, DelistingType.Warning),\n                new Delisting(Symbols.SPY, time.AddDays(1), 100, DelistingType.Delisted),\n                new TradeBar { Time = time.AddDays(2), Value = 1, Period = dataResolution, Volume = 100},\n            }.GetEnumerator();\n\n            var exchange = new OptionExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(fillForwardResolution), false, time, time.AddDays(10), dataResolution, exchange.TimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(DelistingType.Warning, ((Delisting)fillForwardEnumerator.Current).Type);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(DelistingType.Delisted, ((Delisting)fillForwardEnumerator.Current).Type);\n\n            // even if there's more data emitted in the base enumerator we've passed the delisting date!\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        // reproduces GH issue 4392 causing fill forward bars not to advance\n        // the nature of the bug was rounding down in exchange tz versus data timezone\n        public void GetReferenceDateIntervals_RoundDown(bool strictEndTimes)\n        {\n            var dataResolution = Time.OneDay;\n            var fillForwardResolution = Time.OneMinute;\n\n            var previous = new DateTime(2017, 7, 20, 20, 0, 0);\n            var next = new DateTime(2017, 7, 22, 20, 0, 0);\n            var enumerator = new List<BaseData>\n            {\n                new TradeBar { Time = previous, Value = 1, Period = dataResolution, Volume = 100},\n                new TradeBar { Time = next, Value = 2, Period = dataResolution, Volume = 100}\n            }.GetEnumerator();\n\n            var dataTimeZone = TimeZones.Utc;\n            var exchange = new ForexExchange();\n            // to reproduce this bug it's important for data tz to be UTC and exchange tz NewYork.\n            Assert.AreEqual(TimeZones.NewYork, exchange.TimeZone);\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(fillForwardResolution), isExtendedMarketHours, next.Date, next.AddDays(1), dataResolution, dataTimeZone, strictEndTimes);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(previous, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.AreEqual(100, (fillForwardEnumerator.Current as TradeBar).Volume);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            // Time should advance!\n            // Time should be 10:01am to 5:01pm, on Sundays the market opens at 5pm, so the market duration is 7 hours\n            var expectedTime = strictEndTimes ? new DateTime(2017, 7, 23, 10, 1, 0) : new DateTime(2017, 7, 22, 17, 1, 0);\n            Assert.AreEqual(expectedTime, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(new DateTime(2017, 7, 23, 17, 1, 0), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.AreEqual(0, (fillForwardEnumerator.Current as TradeBar).Volume);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardMidDay()\n        {\n            var dataResolution = Time.OneMinute;\n\n            var reference = new DateTime(2015, 6, 25, 9, 30, 0);\n            var data = Enumerable.Range(0, 2).Select(x => new TradeBar\n            {\n                Time = reference.AddMinutes(x * 2),\n                Value = x,\n                Period = dataResolution,\n                Volume = (x + 1) * 100\n            }).ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardResolution = TimeSpan.FromMinutes(1);\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(fillForwardResolution), isExtendedMarketHours, reference.Date, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:31\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:32 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:33\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardFromPreMarket()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 9, 28, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddMinutes(4),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:29\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:31 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:32 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(4), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:33\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(5), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardFromPreMarketMinuteToSecond()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2011, 4, 26, 8, 39, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.Date.Add(new TimeSpan(9, 30, 0)),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            const bool isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromSeconds(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 8:40:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:30:01 to 9:30:59 (ff)\n            for (var i = 1; i < 60; i++)\n            {\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.AreEqual(reference.Date.Add(new TimeSpan(9, 30, i)), fillForwardEnumerator.Current.EndTime);\n                Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n                Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n            }\n\n            // 9:31:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.Date.Add(new TimeSpan(9, 31, 0)), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(2, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardRestOfDay()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 15, 57, 0);\n            var data = Enumerable.Range(0, 1).Select(x => new TradeBar\n            {\n                Time = reference.AddMinutes(x * 2),\n                Value = x,\n                Period = dataResolution,\n                Volume = 100\n            }).ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, reference.AddMinutes(3), dataResolution, exchange.TimeZone, false);\n\n            // 3:58\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 3:59 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardEndOfSubscription()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 15, 57, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, reference.AddMinutes(3), dataResolution, exchange.TimeZone, false);\n\n            // 3:58\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 3:59 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardGapBeforeEndOfSubscription()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 15, 57, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, reference.Date.AddHours(16), dataResolution, exchange.TimeZone, false);\n\n            // 3:58\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 3:39 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardToNextDay()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2015, 6, 25, 14, 0, 0);\n            var end = reference.Date.AddDays(1).AddHours(10);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = end - dataResolution,\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            bool isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromHours(1)), isExtendedMarketHours, reference, end, dataResolution, exchange.TimeZone, false);\n\n            // 3:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 10:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(end, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void SkipsAfterMarketData()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2015, 6, 25, 14, 0, 0);\n            var end = reference.Date.AddDays(1).AddHours(10);\n            var data = new BaseData[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddHours(3),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                },\n                new TradeBar\n                {\n                    Time = reference.Date.AddDays(1).AddHours(10) - dataResolution,\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 300\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            bool isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromHours(1)), isExtendedMarketHours, reference, end, dataResolution, exchange.TimeZone, false);\n\n            // 3:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 6:00 - this is raw data, the FF enumerator doesn't try to perform filtering per se, just filtering on when to FF\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(4), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 10:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(end, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(2, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(300, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void FillsForwardDailyOnHoursInMarketHours(bool strictEndTimes)\n        {\n            var symbol = strictEndTimes ? Symbols.SPX : Symbols.SPY;\n            var dataResolution = Time.OneDay;\n            var reference = new DateTime(2015, 6, 25);\n            var expectedBarPeriod = Time.OneDay;\n            if (strictEndTimes)\n            {\n                expectedBarPeriod = new TimeSpan(6, 45, 0);\n                reference = reference.AddHours(8.5);\n            }\n            var data = new BaseData[]\n            {\n                // thurs 6/25\n                new TradeBar{Value = 0, Time = reference, Period = expectedBarPeriod, Volume = 100},\n                // fri 6/26\n                new TradeBar{Value = 1, Time = reference.AddDays(1), Period = expectedBarPeriod, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType));\n            bool isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromHours(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, strictEndTimes);\n\n            // 12:00am // 15:15\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.Add(expectedBarPeriod), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // NEXT DAY\n            var fillForwardReferenceTime = reference.AddDays(1).AddHours(9);\n            if (strictEndTimes)\n            {\n                fillForwardReferenceTime = reference.AddDays(1).AddMinutes(30);\n                // 9 hrs\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.AreEqual(fillForwardReferenceTime, fillForwardEnumerator.Current.EndTime);\n                Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n                Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n            }\n\n            // 10:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 11:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 12:00pm (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(3), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 1:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(4), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 2:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(5), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 3:00 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(fillForwardReferenceTime.AddHours(6), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            if (!strictEndTimes)\n            {\n                // 4:00 (ff)\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.AreEqual(fillForwardReferenceTime.AddHours(7), fillForwardEnumerator.Current.EndTime);\n                Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n                Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n            }\n\n            // 12:00am\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(strictEndTimes ? reference.AddDays(1).Add(expectedBarPeriod) : reference.AddDays(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(expectedBarPeriod, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void FillsForwardDailyMissingDays(bool strictEndTimes)\n        {\n            var symbol = strictEndTimes ? Symbols.SPX : Symbols.SPY;\n            var dataResolution = Time.OneDay;\n            var expectedBarPeriod = Time.OneDay;\n            var reference = new DateTime(2015, 6, 25);\n            if (strictEndTimes)\n            {\n                expectedBarPeriod = new TimeSpan(6, 45, 0);\n                reference = reference.AddHours(8.5);\n            }\n            var data = new BaseData[]\n            {\n                // thurs 6/25\n                new TradeBar{Value = 0, Time = reference, Period = expectedBarPeriod, Volume = 100},\n                // fri 6/26\n                new TradeBar{Value = 1, Time = reference.AddDays(5), Period = expectedBarPeriod, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType));\n            bool isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromDays(1)), isExtendedMarketHours,\n                // we add a tenth of a day to reproduce a bug where we would fill forward beyoned the expected end time\n                reference, data.Last().EndTime.AddDays(1.10), dataResolution, exchange.TimeZone, strictEndTimes);\n\n            var dataReferenceTime = reference.AddDays(1);\n            if (strictEndTimes)\n            {\n                dataReferenceTime = reference.Add(expectedBarPeriod);\n            }\n\n            // 6/25\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.IsTrue(((TradeBar)fillForwardEnumerator.Current).Period == expectedBarPeriod);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 6/26\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime.AddDays(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.IsTrue(((TradeBar)fillForwardEnumerator.Current).Period == expectedBarPeriod);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 6/29\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime.AddDays(4), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.IsTrue(((TradeBar)fillForwardEnumerator.Current).Period == expectedBarPeriod);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 6/30\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime.AddDays(5), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.IsTrue(((TradeBar)fillForwardEnumerator.Current).Period == expectedBarPeriod);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 7/1\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime.AddDays(6), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.IsTrue(((TradeBar)fillForwardEnumerator.Current).Period == expectedBarPeriod);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.AreEqual(!strictEndTimes, fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillForwardsDailyMissingDaysRespectingEarlyClose()\n        {\n            var symbol = Symbols.SPY;\n            var dataResolution = Time.OneDay;\n            var commonMarketDuration = new TimeSpan(6, 30, 0);\n            var startTimeOfDay = new TimeSpan(9, 30, 0);\n            var reference = new DateTime(2015, 11, 25).Add(startTimeOfDay);\n\n            var data = new BaseData[]\n            {\n                // wed 11/25\n                new TradeBar {Value = 0, Time = reference, Period = commonMarketDuration, Volume = 100},\n                // tue 12/1\n                new TradeBar {Value = 1, Time = reference.AddDays(6), Period = commonMarketDuration, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType));\n            var isExtendedMarketHours = false;\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromDays(1)), isExtendedMarketHours,\n                reference, data[^1].EndTime.Date.AddDays(1), dataResolution, exchange.TimeZone, dailyStrictEndTimeEnabled: true);\n\n            var dataReferenceTime = reference;\n            var dataReferenceEndTime = reference.Add(commonMarketDuration);\n\n            // wed 11/25\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(dataReferenceEndTime, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(commonMarketDuration, ((TradeBar)fillForwardEnumerator.Current).Period);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // thu 11/26 (no data, holiday)\n\n            // fri 11/27 (early close: 1pm)\n            dataReferenceTime = dataReferenceTime.AddDays(2);\n            dataReferenceEndTime = dataReferenceEndTime.AddDays(2);\n            var earlyClose = dataReferenceEndTime.Date.Add(TimeSpan.FromHours(13));\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(earlyClose, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(earlyClose - dataReferenceTime, ((TradeBar)fillForwardEnumerator.Current).Period);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // mon 11/30\n            dataReferenceTime = dataReferenceTime.AddDays(3);\n            dataReferenceEndTime = dataReferenceEndTime.AddDays(3);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(dataReferenceEndTime, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(commonMarketDuration, ((TradeBar)fillForwardEnumerator.Current).Period);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // tue 12/1\n            dataReferenceTime = dataReferenceTime.AddDays(1);\n            dataReferenceEndTime = dataReferenceEndTime.AddDays(1);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(dataReferenceTime, fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(dataReferenceEndTime, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(commonMarketDuration, ((TradeBar)fillForwardEnumerator.Current).Period);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n        }\n\n        [Test]\n        public void FillsForwardHoursAtEndOfDayByHalfHour()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2015, 6, 25, 14, 0, 0);\n            var data = new BaseData[]\n            {\n                // thurs 6/25\n                new TradeBar{Value = 0, Time = reference, Period = dataResolution, Volume = 100},\n                // fri 6/26\n                new TradeBar{Value = 1, Time = reference.Date.AddDays(1), Period = dataResolution, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            bool isExtendedMarketHours = false;\n            var ffResolution = TimeSpan.FromMinutes(30);\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(ffResolution), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 3:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 3:30\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(1.5), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 4:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 12:00am\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data.Last().EndTime, fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardHourlyOnMinutesBeginningOfDay()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2015, 6, 25);\n            var data = new BaseData[]\n            {\n                // thurs 6/25\n                new TradeBar{Value = 0, Time = reference, Period = dataResolution, Volume = 100},\n                // fri 6/26\n                new TradeBar{Value = 1, Time = reference.Date.AddHours(9), Period = dataResolution, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            bool isExtendedMarketHours = false;\n            var ffResolution = TimeSpan.FromMinutes(15);\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(ffResolution), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 12:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:45 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(9.75), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 10:00\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddHours(10), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void FillsForwardMissingDaysOnFillForwardResolutionOfAnHour(bool strictEndTimes)\n        {\n            var symbol = strictEndTimes ? Symbols.SPX : Symbols.SPY;\n            var reference = new DateTime(2015, 6, 23);\n            var dataResolution = Time.OneDay;\n            var expectedBarPeriod = Time.OneDay;\n            if (strictEndTimes)\n            {\n                expectedBarPeriod = new TimeSpan(6, 45, 0);\n                reference = reference.AddHours(8.5);\n            }\n            var data = new BaseData[]\n            {\n                // tues 6/23\n                new TradeBar{Value = 0, Time = reference, Period = expectedBarPeriod, Volume = 100},\n                // wed 7/1\n                new TradeBar{Value = 1, Time = reference.AddDays(8), Period = expectedBarPeriod, Volume = 200},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType));\n            bool isExtendedMarketHours = false;\n            var ffResolution = TimeSpan.FromHours(1);\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(ffResolution), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, strictEndTimes);\n\n            int dailyBars = 0;\n            int hourlyBars = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Log.Debug($\"FillsForwardMissingDaysOnFillForwardResolutionOfAnHour(): {fillForwardEnumerator.Current.EndTime.ToStringInvariant()}\");\n                var startTime = fillForwardEnumerator.Current.Time.TimeOfDay;\n                if (startTime == TimeSpan.Zero || startTime == new TimeSpan(8, 30, 0))\n                {\n                    dailyBars++;\n                }\n                else\n                {\n                    hourlyBars++;\n                    Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n                }\n            }\n\n            // we expect 7 daily bars here, beginning tues, wed, thurs, fri, mon, tues, wed\n            Assert.AreEqual(7, dailyBars);\n\n            // we expect 6 days worth of ff hourly bars at 7 bars a day\n            Assert.AreEqual(42, hourlyBars);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void OandaFillsForwardDailyForexOnWeekends()\n        {\n            var dailyBarsEmitted = 0;\n            var fillForwardBars = new List<BaseData>();\n\n            // 3 QuoteBars as they would be read from the EURUSD oanda daily file by QuoteBar.Reader()\n            // The conversion from dataTimeZone to exchangeTimeZone has been done by hand\n            // dataTimeZone == UTC\n            /*\n                20120719 00:00,1.22769,1.2324,1.22286,1.22759,0,1.22781,1.23253,1.22298,1.22771,0\n                20120720 00:00,1.22757,1.22823,1.21435,1.21542,0,1.22769,1.22835,1.21449,1.21592,0\n                20120722 00:00,1.21542,1.21542,1.21037,1.21271,0,1.21592,1.21592,1.21087,1.21283,0\n                20120723 00:00,1.21273,1.21444,1.20669,1.21238,0,1.21285,1.21454,1.20685,1.21249,0\n             */\n            var data = new BaseData[]\n            {\n                // fri 7/20\n                new QuoteBar{Value = 0, Time = new DateTime(2012, 7, 19, 20, 0, 0), Period = Time.OneDay},\n                // sunday 7/22\n                new QuoteBar{Value = 1, Time = new DateTime(2012, 7, 21, 20, 0, 0), Period = Time.OneDay},\n                // monday 7/23\n                new QuoteBar{Value = 2, Time = new DateTime(2012, 7, 22, 20, 0, 0), Period = Time.OneDay},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var market = Market.Oanda;\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, market);\n\n            var marketHours = MarketHoursDatabase.FromDataFolder();\n            var exchange = new ForexExchange(marketHours.GetExchangeHours(market, symbol, SecurityType.Forex));\n\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromDays(1)), false, data[0].Time.Date, data.Last().EndTime, Time.OneDay, TimeZones.Utc, false);\n\n            while (fillForwardEnumerator.MoveNext())\n            {\n                fillForwardBars.Add(fillForwardEnumerator.Current);\n                Log.Debug(fillForwardEnumerator.Current.Time.DayOfWeek + \" \" + fillForwardEnumerator.Current.Time + \" - \" + fillForwardEnumerator.Current.EndTime.DayOfWeek + \" \" + fillForwardEnumerator.Current.EndTime);\n                dailyBarsEmitted++;\n            }\n\n            Assert.AreEqual(3, dailyBarsEmitted);\n            Assert.AreEqual(new DateTime(2012, 7, 19, 20, 0, 0), fillForwardBars[0].Time);\n            Assert.AreEqual(new DateTime(2012, 7, 21, 20, 0, 0), fillForwardBars[1].Time);\n            Assert.AreEqual(new DateTime(2012, 7, 22, 20, 0, 0), fillForwardBars[2].Time);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void HandlesDaylightSavingTimeChange()\n        {\n            var dailyBarsEmitted = 0;\n            var fillForwardBars = new List<BaseData>();\n\n            // 3 QuoteBars as they would be read from the EURUSD oanda daily file by QuoteBar.Reader()\n            // The conversion from dataTimeZone to exchangeTimeZone has been done by hand\n            // dataTimeZone == UTC\n            /*\n                20180311 00:00,1.2308,1.2308,1.2308,1.2308,0,1.23096,1.23096,1.23096,1.23096,0\n                20180312 00:00,1.23082,1.23449,1.22898,1.23382,0,1.23097,1.23463,1.22911,1.23396,0\n            */\n            var data = new BaseData[]\n            {\n                // Sunday 3/11\n                new QuoteBar{Value = 0, Time = new DateTime(2018, 3, 10, 19, 0, 0), Period = Time.OneDay},\n                // Monday 3/12\n                new QuoteBar{Value = 1, Time = new DateTime(2018, 3, 11, 20, 0, 0), Period = Time.OneDay},\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var market = Market.Oanda;\n            var symbol = Symbol.Create(\"EURUSD\", SecurityType.Forex, market);\n\n            var marketHours = MarketHoursDatabase.FromDataFolder();\n            var exchange = new ForexExchange(marketHours.GetExchangeHours(market, symbol, SecurityType.Forex));\n\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromDays(1)), false, data[0].Time.Date, data.Last().EndTime, Time.OneDay, TimeZones.Utc, false);\n\n            while (fillForwardEnumerator.MoveNext())\n            {\n                fillForwardBars.Add(fillForwardEnumerator.Current);\n                Log.Debug(fillForwardEnumerator.Current.Time.DayOfWeek + \" \" + fillForwardEnumerator.Current.Time + \" - \" + fillForwardEnumerator.Current.EndTime.DayOfWeek + \" \" + fillForwardEnumerator.Current.EndTime);\n                dailyBarsEmitted++;\n            }\n\n            Assert.AreEqual(2, dailyBarsEmitted);\n            Assert.AreEqual(new DateTime(2018, 3, 10, 19, 0, 0), fillForwardBars[0].Time);\n            Assert.AreEqual(new DateTime(2018, 3, 11, 20, 0, 0), fillForwardBars[1].Time);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void HandlesDaylightSavingTimeChange_InifinteLoop()\n        {\n            var dailyBarsEmitted = 0;\n            var fillForwardBars = new List<BaseData>();\n\n            var data = new BaseData[]\n            {\n                new QuoteBar{Value = 0, Time = new DateTime(2019, 10, 4, 10, 0, 0), Period = Time.OneDay},\n                new QuoteBar{Value = 1, Time = new DateTime(2019, 10, 8, 11, 0, 0), Period = Time.OneDay}\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var algo = new AlgorithmStub();\n            var market = Market.Oanda;\n            var security = algo.AddCfd(\"AU200AUD\", Resolution.Daily, market);\n\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, security.Exchange, Ref.Create(TimeSpan.FromDays(1)), false, data[0].Time.Date, data.Last().EndTime, Time.OneDay, TimeZones.Utc, false);\n\n            while (fillForwardEnumerator.MoveNext())\n            {\n                fillForwardBars.Add(fillForwardEnumerator.Current);\n                Log.Debug(fillForwardEnumerator.Current.Time.DayOfWeek + \" \" + fillForwardEnumerator.Current.Time + \" - \" + fillForwardEnumerator.Current.EndTime.DayOfWeek + \" \" + fillForwardEnumerator.Current.EndTime + \" \" + fillForwardEnumerator.Current.IsFillForward);\n                dailyBarsEmitted++;\n            }\n\n            Assert.AreEqual(4, dailyBarsEmitted);\n            Assert.AreEqual(new DateTime(2019, 10, 4, 10, 0, 0), fillForwardBars[0].Time);\n            Assert.AreEqual(new DateTime(2019, 10, 6, 11, 0, 0), fillForwardBars[1].Time);\n            Assert.AreEqual(new DateTime(2019, 10, 7, 11, 0, 0), fillForwardBars[2].Time);\n            Assert.AreEqual(new DateTime(2019, 10, 8, 11, 0, 0), fillForwardBars[3].Time);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardAfterMarketOpen_DataSecond_FillForwardMinute()\n        {\n            var dataResolution = Time.OneSecond;\n            var reference = new DateTime(2015, 6, 25, 9, 49, 59);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddMinutes(4),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:49:59 -> 9:50\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddSeconds(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:50 -> 9:50:01 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddSeconds(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardOnMarketOpen_DataSecond_FillForwardMinute()\n        {\n            var dataResolution = Time.OneSecond;\n            var reference = new DateTime(2015, 6, 25, 9, 29, 59);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddMinutes(4),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:29:59 -> 9:30\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddSeconds(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:30 -> 9:30:01 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddSeconds(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardOnMarketOpen_DataMinute_FillForwardSecond()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 9, 29, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddMinutes(4),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromSeconds(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:29 -> 9:30\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:30 -> 9:30:01 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1).AddSeconds(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardOnMarketOpen_DataMinute_FillForwardMinute()\n        {\n            var dataResolution = Time.OneMinute;\n            var reference = new DateTime(2015, 6, 25, 9, 29, 0);\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference,\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddMinutes(4),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, reference, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 9:29 -> 9:30\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:30 -> 9:31 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(reference.AddMinutes(2), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [TestCase(Resolution.Second, Resolution.Second)]\n        [TestCase(Resolution.Second, Resolution.Minute)]\n        [TestCase(Resolution.Minute, Resolution.Second)]\n        [TestCase(Resolution.Minute, Resolution.Minute)]\n        [TestCase(Resolution.Minute, Resolution.Daily)]\n        [TestCase(Resolution.Daily, Resolution.Minute)]\n        public void FillsForwardBarsForDifferentResolutions(Resolution resolution, Resolution anotherSymbolResolution)\n        {\n            FillForwardTestAlgorithm.FillForwardBars.Clear();\n\n            FillForwardTestAlgorithm.Resolution = resolution;\n            FillForwardTestAlgorithm.ResolutionAnotherSymbol = anotherSymbolResolution;\n\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(FillForwardTestAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: \"FillForwardTestSetupHandler\");\n\n            var expectedDataFile = $\"ff_{resolution}_{anotherSymbolResolution}.txt\";\n\n            // updates expected data\n            if (false)\n            {\n#pragma warning disable CS0162 // Unreachable code detected; used to store expected data\n                QuantConnect.Compression.ZipCreateAppendData(\n                    \"../../TestData/FillForwardBars.zip\", expectedDataFile, FillForwardTestAlgorithm.Result.Value, overrideEntry: true);\n#pragma warning restore CS0162\n            }\n            QuantConnect.Compression.Unzip(\"TestData/FillForwardBars.zip\", \"./\", overwrite: true);\n            var expected = File.ReadAllLines(expectedDataFile);\n\n            Assert.AreEqual(expected.Length, FillForwardTestAlgorithm.FillForwardBars.Count);\n            Assert.IsTrue(expected.SequenceEqual(FillForwardTestAlgorithm.FillForwardBars));\n        }\n\n        private static TestCaseData[] SubscriptionStarts => new[] {\n            new TestCaseData(new DateTime(2011, 1, 21, 0, 0, 0), new ForexExchange()),  // no move\n            new TestCaseData(new DateTime(2011, 3, 11, 0, 0, 0), new ForexExchange()),   // move to EDT\n            new TestCaseData(new DateTime(2011, 7, 8, 0, 0, 0), new ForexExchange()),  // no move\n            new TestCaseData(new DateTime(2011, 11, 4, 0, 0, 0), new ForexExchange()), // move to EST\n\n            new TestCaseData(new DateTime(2011, 1, 21, 0, 0, 0), new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex))),  // no move\n            new TestCaseData(new DateTime(2011, 3, 11, 0, 0, 0), new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex))),   // move to EDT\n            new TestCaseData(new DateTime(2011, 7, 8, 0, 0, 0), new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex))),  // no move\n            new TestCaseData(new DateTime(2011, 11, 4, 0, 0, 0), new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex))), // move to EST\n\n            new TestCaseData(new DateTime(2011, 1, 21, 0, 0, 0), new EquityExchange()),  // no move\n            new TestCaseData(new DateTime(2011, 3, 11, 0, 0, 0), new EquityExchange()),   // move to EDT\n            new TestCaseData(new DateTime(2011, 7, 8, 0, 0, 0),  new EquityExchange()),  // no move\n            new TestCaseData(new DateTime(2011, 11, 4, 0, 0, 0), new EquityExchange()), // move to EST\n        };\n\n        private static IEnumerable<TestCaseData> DaylightSavingCases(int offsetInHours)\n        {\n            return SubscriptionStarts.Select(origin =>\n            {\n                var list = new List<object>(origin.Arguments) { DateTimeZone.ForOffset(Offset.FromHours(offsetInHours)) };\n\n                return new TestCaseData(list.ToArray());\n            });\n        }\n\n        [Test]\n        [TestCaseSource(nameof(DaylightSavingCases), new object[] { -5 })]\n        [TestCaseSource(nameof(DaylightSavingCases), new object[] { 0 })]\n        [TestCaseSource(nameof(DaylightSavingCases), new object[] { -3 })]\n        public void FillsForwardDaylightSavingTime(DateTime reference, SecurityExchange exchange, DateTimeZone dataTimeZone)\n        {\n            var dataResolution = Time.OneDay;\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(2).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(3).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[1].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[2].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test, TestCaseSource(nameof(SubscriptionStarts))]\n        public void FillsForwardDaylightSavingTimeUtcPlus5(DateTime reference, SecurityExchange exchange)\n        {\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(+5));\n            var dataResolution = Time.OneDay;\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(2).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(3).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.AddTicks(2 * dataResolution.Ticks), fillForwardEnumerator.Current.EndTime);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[1].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[2].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        private static TestCaseData[] NoMoveSubscriptionStarts => new[] {\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5))),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5))),  // no move\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new EquityExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5))),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new EquityExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5))),  // no move\n\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new ForexExchange(), DateTimeZone.Utc),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new ForexExchange(), DateTimeZone.Utc),  // no move\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new EquityExchange(), DateTimeZone.Utc),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new EquityExchange(), DateTimeZone.Utc),  // no move\n\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(+5))),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(+5))),  // no move\n            new TestCaseData(new DateTime(2011, 7, 4, 0, 0, 0), new EquityExchange(), DateTimeZone.ForOffset(Offset.FromHours(+5))),  // no move\n            new TestCaseData(new DateTime(2011, 1, 17, 0, 0, 0), new EquityExchange(), DateTimeZone.ForOffset(Offset.FromHours(+5)))  // no move\n        };\n\n        [Test, TestCaseSource(nameof(NoMoveSubscriptionStarts))]\n        public void FillsForwardMiddleWeek(DateTime reference, SecurityExchange exchange, DateTimeZone dataTimeZone)\n        {\n            var dataResolution = Time.OneDay;\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(2).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(3).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.AddTicks(2 * dataResolution.Ticks), fillForwardEnumerator.Current.EndTime);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[1].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[2].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardFromPreMarketWhenDaylightMove()\n        {\n            var dataResolution = Time.OneMinute;\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = new DateTime(2008, 3, 7, 16, 20, 0),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = new DateTime(2008, 3, 10, 8, 33, 0),\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 200\n                },\n                new TradeBar\n                {\n                    Time = new DateTime(2008, 3, 10, 9, 28, 0),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 300\n                },\n                new TradeBar\n                {\n                    Time = new DateTime(2008, 3, 10, 9, 32, 0),\n                    Value = 3,\n                    Period = dataResolution,\n                    Volume = 400\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var exchange = new EquityExchange();\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(TimeSpan.FromMinutes(1)), isExtendedMarketHours, data[0].Time.Date, data.Last().EndTime, dataResolution, exchange.TimeZone, false);\n\n            // 2008-03-07 16:50\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[0].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(0, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(100, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 2008-03-10 08:33 (pre-market)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[1].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(1, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(200, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 2008-03-10 09:28 (pre-market)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[2].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(2, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(300, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:30 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(new DateTime(2008, 3, 10, 9, 31, 0), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(2, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:31 (ff)\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(new DateTime(2008, 3, 10, 9, 32, 0), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(2, fillForwardEnumerator.Current.Value);\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(0, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            // 9:32\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.AreEqual(data[3].Time.Add(dataResolution), fillForwardEnumerator.Current.EndTime);\n            Assert.AreEqual(3, fillForwardEnumerator.Current.Value);\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(dataResolution, fillForwardEnumerator.Current.EndTime - fillForwardEnumerator.Current.Time);\n            Assert.AreEqual(400, ((TradeBar)fillForwardEnumerator.Current).Volume);\n\n            Assert.IsFalse(fillForwardEnumerator.MoveNext());\n            fillForwardEnumerator.Dispose();\n        }\n\n        private static TestCaseData[] ExchangeSet => new[] {\n            new TestCaseData(new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5)), Resolution.Minute),\n            new TestCaseData(new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5)), Resolution.Hour),\n            new TestCaseData(new ForexExchange(), DateTimeZone.ForOffset(Offset.FromHours(-5)), Resolution.Daily),\n\n            new TestCaseData(new EquityExchange(), TimeZones.NewYork, Resolution.Minute),\n            new TestCaseData(new EquityExchange(), TimeZones.NewYork, Resolution.Hour),\n            new TestCaseData(new EquityExchange(), TimeZones.NewYork, Resolution.Daily),\n\n            new TestCaseData(new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex)), DateTimeZone.Utc, Resolution.Minute),\n            new TestCaseData(new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex)), DateTimeZone.Utc, Resolution.Hour),\n            new TestCaseData(new SecurityExchange(MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.Oanda, null, SecurityType.Forex)), DateTimeZone.Utc, Resolution.Daily)\n        };\n\n        private static IEnumerable<TestCaseData> ExchangeSettings(string daylight, DateTime start, params object[] extra)\n        {\n            return ExchangeSet.Select(origin =>\n            {\n                var list = new List<object>(origin.Arguments)\n                {\n                    daylight,\n                    start\n                };\n\n                if (extra?.Any() == true)\n                {\n                    list.AddRange(extra);\n                }\n\n                return new TestCaseData(list.ToArray());\n            });\n        }\n\n        private static IEnumerable<TestCaseData> ExchangeDaylightTimeSet(int durationInDays, Resolution fillforwardResolution)\n        {\n            return ExchangeSettings(\"DST\", new DateTime(2011, 3, 7), durationInDays, fillforwardResolution);\n        }\n\n        private static IEnumerable<TestCaseData> ExchangeStandardTimeSet(int durationInDays, Resolution fillforwardResolution)\n        {\n            return ExchangeSettings(\"ST\", new DateTime(2011, 10, 31), durationInDays, fillforwardResolution);\n        }\n\n        [Test]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 6, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 7, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 14, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 6, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 7, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 14, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 7, Resolution.Minute })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 7, Resolution.Hour })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 7, Resolution.Minute })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 7, Resolution.Hour })]\n        public void FillsForwardBarsAroundDaylightMovementForDifferentResolutions_Enumerator(SecurityExchange exchange, DateTimeZone dataTimeZone, Resolution resolution, string dst, DateTime reference, int durationInDays, Resolution fillforwardResolution)\n        {\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = resolution.ToTimeSpan(),\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(durationInDays).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 1,\n                    Period = resolution.ToTimeSpan(),\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var isExtendedMarketHours = false;\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(fillforwardResolution.ToTimeSpan()),\n                isExtendedMarketHours,\n                data[0].Time.Date,\n                data.Last().EndTime,\n                resolution.ToTimeSpan(),\n                dataTimeZone, false);\n\n            var ffbars = new List<string>();\n            while (fillForwardEnumerator.MoveNext())\n            {\n                if (fillForwardEnumerator.Current?.IsFillForward == true)\n                {\n                    var bar = fillForwardEnumerator.Current;\n                    ffbars.Add($\"{bar.Time:yyyy.MM.dd H:m:s} - {bar.EndTime:yyyy.MM.dd H:m:s}\");\n                }\n            }\n\n            fillForwardEnumerator.Dispose();\n\n            var expectedDataFile = $\"enum_{dst}_{durationInDays}_{exchange.TimeZone.Id.Replace(\"/\", \"_\")}_{dataTimeZone.Id.Replace(\"/\", \"_\")}_{resolution}_{fillforwardResolution}.txt\";\n\n            // updates expected data\n            if (false)\n            {\n#pragma warning disable CS0162 // Unreachable code detected; used to store expected data\n                QuantConnect.Compression.ZipCreateAppendData(\n                    \"../../TestData/FillForwardBars.zip\",\n                    expectedDataFile,\n                    string.Join(Environment.NewLine, ffbars),\n                    overrideEntry: true);\n#pragma warning restore CS0162\n            }\n            QuantConnect.Compression.Unzip(\"TestData/FillForwardBars.zip\", \"./\", overwrite: true);\n            var expected = File.ReadAllLines(expectedDataFile);\n\n            Assert.AreEqual(expected.Length, ffbars.Count);\n            Assert.IsTrue(expected.SequenceEqual(ffbars));\n        }\n\n        [TestCase(15)]\n        [TestCase(18)]\n        [TestCase(19)]\n        [TestCase(21)]\n        public void FillsForwardUntilDelisted(int warningDay)\n        {\n            var exchange = new OptionExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            DateTimeZone dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            var reference = new DateTime(2014, 6, 5)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n            var dataResolution = Time.OneDay;\n            var expiry = new DateTime(2014, 6, warningDay)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n            var delisted = new DateTime(2014, 6, 22)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n\n            var spy = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry);\n\n            var data = new BaseData[]\n            {\n                new BaseDataCollection(\n                    reference,\n                    reference.Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference,\n                            Value = 1,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new BaseDataCollection(\n                    reference.AddDays(1),\n                    reference.AddDays(1).Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference.AddDays(1),\n                            Value = 2,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new Delisting(spy, expiry.Date.ConvertTo(dataTimeZone, exchange.TimeZone), 100, DelistingType.Warning),\n            }.ToList();\n\n            // add intermediate values between warning and delisted\n            int intermediateDay = (delisted.Day - expiry.Day) / 2;\n            if (intermediateDay > 0)\n            {\n                data.Add(new BaseDataCollection(\n                    expiry.AddDays(intermediateDay),\n                    expiry.AddDays(intermediateDay).Add(dataResolution),\n                    spy,\n                    new List<BaseData>\n                    {\n                        new TradeBar\n                        {\n                            Time = expiry.AddDays(intermediateDay),\n                            Value = 1,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }));\n            }\n\n            // add delisted\n            data.Add(new Delisting(spy, delisted, 100, DelistingType.Delisted));\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());  // 2014.06.05\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());  // 2014.06.06\n\n            var counter = 0;\n            var previous = fillForwardEnumerator.Current;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Assert.NotNull(fillForwardEnumerator.Current);\n                // we don't care about 'Time' because lean only uses 'EndTime', in case some auxiliary data point comes in 'Time == EndTime'\n                // but the enumerator output should always go increasing 'EndTime'\n                Assert.GreaterOrEqual(fillForwardEnumerator.Current.EndTime, previous?.EndTime);\n                Assert.AreEqual(\n                    fillForwardEnumerator.Current.DataType != MarketDataType.Auxiliary,\n                    fillForwardEnumerator.Current.IsFillForward || (intermediateDay != 0 && fillForwardEnumerator.Current.Time.Day == expiry.Day + intermediateDay));\n                if (fillForwardEnumerator.Current.IsFillForward)\n                {\n                    Assert.AreNotEqual(MarketDataType.Auxiliary, fillForwardEnumerator.Current.DataType);\n                    counter++;\n                }\n                else\n                {\n                    Assert.True(fillForwardEnumerator.Current.DataType == MarketDataType.Auxiliary\n                        || fillForwardEnumerator.Current.Time == data[3].Time);\n                }\n                previous = fillForwardEnumerator.Current;\n            }\n\n            Assert.AreEqual(\n                (int)(data.Last().EndTime - data[1].EndTime).TotalDays - (intermediateDay > 0 ? 1 : 0),\n                counter);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardUntilDelistedMinuteResolution()\n        {\n            var exchange = new OptionExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            DateTimeZone dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            var reference = new DateTime(2014, 6, 5, 10, 10, 0)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n            var dataResolution = Time.OneMinute;\n            var expiry = new DateTime(2014, 6, 15)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n            var delisted = new DateTime(2014, 6, 22)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n\n            var spy = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry);\n\n            var data = new BaseData[]\n            {\n                new BaseDataCollection(\n                    reference,\n                    reference.Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference,\n                            Value = 1,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new BaseDataCollection(\n                    reference.AddDays(1),\n                    reference.AddDays(1).Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference.AddDays(1),\n                            Value = 2,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new Delisting(spy, expiry.Date, 100, DelistingType.Warning),\n                new BaseDataCollection(\n                    reference.AddDays(12),\n                    reference.AddDays(12).Add(dataResolution),\n                    spy,\n                    new List<BaseData>\n                    {\n                        new TradeBar\n                        {\n                            Time = reference.AddDays(12),\n                            Value = 1,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new Delisting(spy, delisted, 100, DelistingType.Delisted)\n            }.ToList();\n\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            // Fast forward 2014.06.05 - 06\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                if (fillForwardEnumerator.Current.Time.Day == 7)\n                {\n                    break;\n                }\n            }\n\n            var dateSet = new HashSet<DateTime>();\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Assert.NotNull(fillForwardEnumerator.Current);\n                if (fillForwardEnumerator.Current.IsFillForward)\n                {\n                    Assert.AreNotEqual(MarketDataType.Auxiliary, fillForwardEnumerator.Current.DataType);\n                    dateSet.Add(fillForwardEnumerator.Current.Time.Date);\n                }\n                else\n                {\n                    Assert.True(fillForwardEnumerator.Current.DataType == MarketDataType.Auxiliary\n                        || fillForwardEnumerator.Current.Time == data[3].Time);\n                }\n            }\n\n            // '+1' means receiving not-Auxiliary minute data on last day of period\n            Assert.AreEqual(\n                (int)(data.Last().EndTime - data[1].EndTime).TotalDays + 1,\n                dateSet.Count);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardSymbolChangedDailyResolution()\n        {\n            var symbol = Symbols.Fut_SPY_Mar19_2016;\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n            var reference = new DateTime(2014, 6, 5, 20, 0, 0);\n            var dataResolution = Time.OneDay;\n\n            var data = new BaseData[]\n            {\n                new TradeBar {\n                    Time = reference,\n                    Value = 1,\n                    Period = dataResolution,\n                    Volume = 100,\n                    Symbol = symbol\n                }, new TradeBar {\n                    Time = reference.AddDays(1),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 200,\n                    Symbol = symbol\n                },\n                new SymbolChangedEvent(symbol, reference.AddDays(3).Date, symbol.Value, symbol.Value),\n                new TradeBar {\n                    Time = reference.AddDays(2),\n                    Value = 3,\n                    Period = dataResolution,\n                    Volume = 300,\n                    Symbol = symbol\n                }}.ToList();\n\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(enumerator,\n                new FutureExchange(entry.ExchangeHours),\n                Ref.Create(dataResolution),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                entry.DataTimeZone, false);\n\n            BaseData previous = null;\n            var counter = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Assert.NotNull(fillForwardEnumerator.Current);\n                // we don't care about 'Time' because lean only uses 'EndTime', in case some auxiliary data point comes in 'Time == EndTime'\n                // but the enumerator output should always go increasing 'EndTime'\n                if (previous != null)\n                {\n                    Assert.GreaterOrEqual(fillForwardEnumerator.Current.EndTime, previous?.EndTime);\n                }\n                if (fillForwardEnumerator.Current.IsFillForward)\n                {\n                    Assert.AreNotEqual(MarketDataType.Auxiliary, fillForwardEnumerator.Current.DataType);\n                    counter++;\n                }\n                previous = fillForwardEnumerator.Current;\n            }\n\n            Assert.AreEqual((int)(data.Last().EndTime - data[1].EndTime).TotalDays - 1, counter);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 6, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 7, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeDaylightTimeSet), new object[] { 14, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 6, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 7, Resolution.Daily })]\n        [TestCaseSource(nameof(ExchangeStandardTimeSet), new object[] { 14, Resolution.Daily })]\n        public void FillsForwardBarsAroundDaylightMovementForDifferentResolutions_Algorithm(SecurityExchange exchange, DateTimeZone dataTimeZone, Resolution resolution, string dst, DateTime reference, int durationInDays, Resolution ffResolution)\n        {\n            MarketHoursDatabase MarketHours = MarketHoursDatabase.FromDataFolder();\n            MarketHours.SetEntry(\n                Market.FXCM,\n                \"EURUSD\",\n                SecurityType.Forex,\n                exchange.Hours,\n                dataTimeZone);\n            FillForwardDaylightMovementTestAlgorithm.FillForwardBars.Clear();\n            FillForwardDaylightMovementTestAlgorithm.Resolution = resolution;\n            FillForwardDaylightMovementTestAlgorithm.RefDateTime = reference;\n            FillForwardDaylightMovementTestAlgorithm.DurationInDays = durationInDays;\n\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(nameof(FillForwardDaylightMovementTestAlgorithm),\n                new Dictionary<string, string>(),\n                Language.CSharp,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                setupHandler: \"FillForwardDaylightMovementTestSetupHandler\");\n\n            var expectedDataFile = $\"alg_{dst}_{durationInDays}_{exchange.TimeZone.Id.Replace(\"/\", \"_\")}_{dataTimeZone.Id.Replace(\"/\", \"_\")}_{resolution}.txt\";\n\n            // updates expected data\n            if (false)\n            {\n#pragma warning disable CS0162 // Unreachable code detected; used to store expected data\n                QuantConnect.Compression.ZipCreateAppendData(\n                    \"../../TestData/FillForwardBars.zip\",\n                    expectedDataFile,\n                    string.Join(Environment.NewLine, FillForwardDaylightMovementTestAlgorithm.Result.Value),\n                    overrideEntry: true);\n#pragma warning restore CS0162\n            }\n            QuantConnect.Compression.Unzip(\"TestData/FillForwardBars.zip\", \"./\", overwrite: true);\n            var expected = File.ReadAllLines(expectedDataFile);\n\n            Assert.AreEqual(expected.Length, FillForwardDaylightMovementTestAlgorithm.FillForwardBars.Count);\n            Assert.IsTrue(expected.SequenceEqual(FillForwardDaylightMovementTestAlgorithm.FillForwardBars));\n        }\n\n        [Test]\n        public void SkipFF2AMOfSundayDST()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2011, 3, 12);\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            var exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(2).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(dataResolution),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            int count = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                if (fillForwardEnumerator.Current?.IsFillForward == true)\n                {\n                    if (fillForwardEnumerator.Current.Time.DayOfWeek == DayOfWeek.Sunday &&\n                        fillForwardEnumerator.Current.Time.Hour == 2)\n                    {\n                        Assert.Fail(\"Shouldn't fill forward bar of 1AM of Sunday when changed Daylight Saving Time.\");\n                    }\n                }\n\n                count++;\n            }\n\n            Assert.Greater(count, 0);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForward2AMOfSundayST()\n        {\n            var dataResolution = Time.OneHour;\n            var reference = new DateTime(2011, 11, 5);\n            var dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            var exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n\n            var data = new[]\n            {\n                new TradeBar\n                {\n                    Time = reference.ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 0,\n                    Period = dataResolution,\n                    Volume = 100\n                },\n                new TradeBar\n                {\n                    Time = reference.AddDays(2).ConvertTo(dataTimeZone, exchange.TimeZone),\n                    Value = 2,\n                    Period = dataResolution,\n                    Volume = 100\n                }\n            }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(dataResolution),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            int count = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                if (fillForwardEnumerator.Current?.IsFillForward == true)\n                {\n                    if (fillForwardEnumerator.Current.Time.DayOfWeek == DayOfWeek.Sunday &&\n                        fillForwardEnumerator.Current.Time.Hour == 2)\n                    {\n                        count++;\n                    }\n                }\n            }\n\n            Assert.AreEqual(1, count);\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillsForwardNotDelistingAuxiliary()\n        {\n            var exchange = new OptionExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            DateTimeZone dataTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            var reference = new DateTime(2014, 6, 5)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n            var dataResolution = Time.OneDay;\n            var expiry = new DateTime(2014, 6, 15)\n                .ConvertTo(dataTimeZone, exchange.TimeZone);\n\n            var spy = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Put, 2, expiry);\n\n            var data = new BaseData[]\n            {\n                new BaseDataCollection(\n                    reference,\n                    reference.Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference,\n                            Value = 1,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new BaseDataCollection(\n                    reference.AddDays(1),\n                    reference.AddDays(1).Add(dataResolution),\n                    spy,\n                    new List<BaseData>{new TradeBar\n                        {\n                            Time = reference.AddDays(1),\n                            Value = 2,\n                            Period = dataResolution,\n                            Volume = 100\n                        }\n                    }),\n                new Dividend\n                {\n                    DataType = MarketDataType.Auxiliary,\n                    Distribution = 0.5m,\n                    ReferencePrice = decimal.MaxValue - 10000m,\n\n                    Symbol = spy,\n                    Time = reference.AddDays(5),\n                    Value = 0.5m\n                }\n            }.ToList();\n\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new FillForwardEnumerator(\n                enumerator,\n                exchange,\n                Ref.Create(TimeSpan.FromDays(1)),\n                false,\n                reference,\n                data.Last().EndTime,\n                dataResolution,\n                dataTimeZone, false);\n\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());  // 2014.06.05\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());  // 2014.06.06\n\n            var counter = 0;\n            var previous = fillForwardEnumerator.Current;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                Assert.NotNull(fillForwardEnumerator.Current);\n                // we don't care about .Time because lean only uses .EndTime\n                // in case some auxiliary data point comes in it will respect endtime being ascendant but it's time == endtime\n                Assert.GreaterOrEqual(fillForwardEnumerator.Current.EndTime, previous?.EndTime ?? DateTime.MinValue);\n                Assert.AreEqual(\n                    fillForwardEnumerator.Current.DataType != MarketDataType.Auxiliary,\n                    fillForwardEnumerator.Current.IsFillForward);\n                if (fillForwardEnumerator.Current.IsFillForward)\n                {\n                    counter++;\n                }\n\n                previous = fillForwardEnumerator.Current;\n            }\n\n            Assert.AreEqual(\n                (int)(data.Last().EndTime - data[1].EndTime).TotalDays,\n                counter);\n\n            fillForwardEnumerator.Dispose();\n        }\n\n        [Test]\n        public void FillForwardIsSkippedWhenLateOpenAtMarketEnd()\n        {\n            // Set resolution for data and fill forward to one day\n            var dataResolution = Time.OneDay;\n            var fillForwardResolution = Time.OneDay;\n\n            // Define the initial time and subscription end time\n            var time = new DateTime(2020, 6, 28, 8, 30, 0);\n            var subscriptionEndTime = time.AddDays(30);\n\n            var enumerator = new List<BaseData>\n            {\n                new TradeBar { Time = new DateTime(2020, 6, 28, 8, 30, 0), EndTime = new DateTime(2020, 6, 28, 16, 0, 0), Value = 1, Volume = 100},\n                new TradeBar { Time = new DateTime(2020, 7, 6, 8, 30, 0), EndTime = new DateTime(2020, 7, 6, 16, 0, 0), Value = 1, Volume = 100},\n            }.GetEnumerator();\n\n            // LateOpen occurs at 4:00 PM meaning the market is closed\n            var lateOpenTime = new DateTime(2020, 7, 3, 16, 0, 0);\n            var exchangeHours = CreateCustomFutureExchangeHours(new DateTime(), lateOpenTime);\n            var exchange = new SecurityExchange(exchangeHours);\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange, Ref.Create(fillForwardResolution), false, time.Date, subscriptionEndTime, dataResolution, exchange.TimeZone, true);\n\n            // Date to check for late open\n            int dataCount = 0;\n\n            // Set to store unique dates\n            SortedSet<DateTime> uniqueDates = new SortedSet<DateTime>();\n\n            // Iterate through the enumerator\n            while (fillForwardEnumerator.MoveNext())\n            {\n                var currentValue = fillForwardEnumerator.Current;\n\n                // Add unique end time to the sorted set and increment data count\n                uniqueDates.Add(currentValue.EndTime);\n                dataCount++;\n\n                // Ensure that no fill forward occurs on the late open date (5 PM)\n                Assert.AreNotEqual(lateOpenTime.Date, currentValue.EndTime);\n                Assert.IsFalse(fillForwardEnumerator.Current.EndTime > subscriptionEndTime);\n            }\n\n            // Ensure there are no duplicate dates in the result\n            Assert.AreEqual(dataCount, uniqueDates.Count);\n        }\n\n        [Test]\n        public void FillForwardsFromLastTrackedPoint()\n        {\n            var dataResolution = Time.OneHour;\n            var fillForwardResolution = Time.OneHour;\n\n            var subscriptionStartTime = new DateTime(2025, 6, 13);\n            var subscriptionEndTime = subscriptionStartTime.AddDays(1);\n\n            var firstPoint = new TradeBar { Time = subscriptionStartTime.AddHours(12), Value = 2, Period = dataResolution, Volume = 200 };\n            using var enumerator = new List<BaseData> { firstPoint }.GetEnumerator();\n\n            var lastDataPoint = new LastPointTracker()\n            {\n                LastDataPoint = new TradeBar { Time = subscriptionStartTime.AddHours(-12), Value = 1, Period = dataResolution, Volume = 100 },\n            };\n\n            var exchange = new EquityExchange();\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange,\n                Ref.Create(fillForwardResolution), false, subscriptionStartTime, subscriptionEndTime,\n                dataResolution, exchange.TimeZone, false, lastPointTracker: lastDataPoint);\n\n            var lastTradeBar = lastDataPoint.LastDataPoint as TradeBar;\n            var dataCount = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                dataCount++;\n                var current = fillForwardEnumerator.Current as TradeBar;\n\n                if (current.Time == firstPoint.Time)\n                {\n                    Assert.IsFalse(current.IsFillForward);\n                }\n                else\n                {\n                    Assert.IsTrue(current.IsFillForward);\n\n                    var expectedOriginBar = current.Time < firstPoint.Time ? lastTradeBar : firstPoint;\n                    Assert.AreEqual(expectedOriginBar.Value, current.Value);\n                }\n            }\n\n            Assert.AreEqual(7, dataCount);\n        }\n\n        [Test]\n        public void DoesNotEmitFillForwardBarOverlappingNextAvailableBar()\n        {\n            var dataResolution = Time.OneDay;\n            var fillForwardResolution = Time.OneDay;\n\n            var subscriptionStartTime = new DateTime(2024, 11, 1);\n            var subscriptionEndTime = subscriptionStartTime.AddDays(3);\n\n            var bar1 = new TradeBar { Time = subscriptionStartTime.AddHours(-12), Value = 1, Period = dataResolution };\n            var bar2 = new TradeBar { Time = subscriptionEndTime.AddHours(-12), Value = 2, Period = dataResolution };\n            using var enumerator = new List<BaseData> { bar1, bar2 }.GetEnumerator();\n\n            var exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            using var fillForwardEnumerator = new FillForwardEnumerator(enumerator, exchange,\n                Ref.Create(fillForwardResolution), false, subscriptionStartTime, subscriptionEndTime,\n                dataResolution, exchange.TimeZone, false);\n\n            var ffBar1 = bar1.Clone(fillForward: true);\n            ffBar1.Time = subscriptionStartTime;\n\n            var ffbar2 = bar1.Clone(fillForward: true);\n            ffbar2.Time = subscriptionStartTime.AddDays(1);\n\n            var expectedData = new List<BaseData>\n            {\n                bar1,\n                ffBar1,\n                ffbar2,\n                // This test reproduces GH issue #9092:\n                // An additional FF bar would be emitted here overlapping bar2\n                bar2\n            };\n\n            var i = 0;\n            while (fillForwardEnumerator.MoveNext())\n            {\n                var current = fillForwardEnumerator.Current;\n                var expectedCurrent = expectedData[i++];\n\n                Assert.AreEqual(expectedCurrent.Time, current.Time, $\"Failed on index {i - 1}\");\n                Assert.AreEqual(expectedCurrent.EndTime, current.EndTime, $\"Failed on index {i - 1}\");\n                Assert.AreEqual(expectedCurrent.Value, current.Value, $\"Failed on index {i - 1}\");\n                Assert.AreEqual(expectedCurrent.IsFillForward, current.IsFillForward, $\"Failed on index {i - 1}\");\n            }\n\n            Assert.AreEqual(expectedData.Count, i);\n        }\n\n        private static SecurityExchangeHours CreateCustomFutureExchangeHours(DateTime earlyClose, DateTime lateOpen)\n        {\n            var sunday = new LocalMarketHours(\n                DayOfWeek.Sunday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0)) // 1.00:00:00 = 25 horas\n            );\n\n            var monday = new LocalMarketHours(\n                DayOfWeek.Monday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var tuesday = new LocalMarketHours(\n                DayOfWeek.Tuesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var wednesday = new LocalMarketHours(\n                DayOfWeek.Wednesday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var thursday = new LocalMarketHours(\n                DayOfWeek.Thursday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0)),\n                new MarketHoursSegment(MarketHoursState.PostMarket, new TimeSpan(17, 0, 0), new TimeSpan(25, 0, 0))\n            );\n\n            var friday = new LocalMarketHours(\n                DayOfWeek.Friday,\n                new MarketHoursSegment(MarketHoursState.PreMarket, new TimeSpan(0, 0, 0), new TimeSpan(8, 30, 0)),\n                new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(8, 30, 0), new TimeSpan(16, 0, 0))\n            );\n\n            var saturday = LocalMarketHours.ClosedAllDay(DayOfWeek.Saturday);\n\n            var earlyCloses = new Dictionary<DateTime, TimeSpan>\n            {\n                { earlyClose.Date, earlyClose.TimeOfDay }\n            };\n\n            var lateOpens = new Dictionary<DateTime, TimeSpan>\n            {\n                { lateOpen.Date, lateOpen.TimeOfDay }\n            };\n\n            var holidays = new List<DateTime>\n            {\n                new DateTime(2025, 4, 18)\n            };\n\n            var exchangeHours = new SecurityExchangeHours(\n                TimeZones.Chicago,\n                holidays,\n                new[]\n                {\n                    sunday,\n                    monday,\n                    tuesday,\n                    wednesday,\n                    thursday,\n                    friday,\n                    saturday\n                }.ToDictionary(x => x.DayOfWeek),\n                earlyCloses,\n                lateOpens\n            );\n\n            return exchangeHours;\n        }\n\n        public class FillForwardTestAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition\n        {\n            protected Symbol _symbol { get; set; }\n            public static List<string> FillForwardBars { get; set; } = new List<string>();\n            public static Lazy<string> Result { get; set; }\n            public static Resolution Resolution { get; set; }\n            public static Resolution ResolutionAnotherSymbol { get; set; }\n            public override void Initialize()\n            {\n                SetStartDate(2013, 10, 04);\n                SetEndDate(2013, 10, 07);\n                AddEquity(\"SPY\", ResolutionAnotherSymbol);\n                _symbol = AddEquity(\"AIG\", Resolution).Symbol;\n            }\n            public override void OnData(Slice data)\n            {\n                if (data.ContainsKey(_symbol))\n                {\n                    var tradeBar = data[_symbol] as TradeBar;\n                    if (tradeBar != null && tradeBar.IsFillForward)\n                    {\n                        FillForwardBars.Add($\"{tradeBar.EndTime:d H:m:s} {Time:d H:m:s}\");\n                    }\n                }\n            }\n            public override void OnEndOfAlgorithm()\n            {\n                Result = new Lazy<string>(() => string.Join(Environment.NewLine, FillForwardBars));\n            }\n\n            public bool CanRunLocally { get; } = true;\n            public List<Language> Languages { get; } = new() { Language.CSharp };\n\n            /// <summary>\n            /// Data Points count of all timeslices of algorithm\n            /// </summary>\n            public long DataPoints => 0;\n\n            /// </summary>\n            /// Data Points count of the algorithm history\n            /// </summary>\n            public int AlgorithmHistoryDataPoints => 0;\n\n            /// <summary>\n            /// Final status of the algorithm\n            /// </summary>\n            public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;\n\n            public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>();\n        }\n\n        public class FillForwardDaylightMovementTestAlgorithm : FillForwardTestAlgorithm\n        {\n            public static DateTime RefDateTime { get; set; }\n            public static int DurationInDays { get; set; }\n\n            public override void Initialize()\n            {\n                SetStartDate(RefDateTime);\n                SetEndDate(RefDateTime.AddDays(DurationInDays));\n                _symbol = AddForex(\"EURUSD\", Resolution, market: Market.FXCM).Symbol;\n            }\n\n            public override void OnData(Slice data)\n            {\n                if (data.ContainsKey(_symbol))\n                {\n                    var bar = data[_symbol] as QuoteBar;\n                    if (bar != null && bar.IsFillForward)\n                    {\n                        FillForwardBars.Add($\"{bar.Time:yyyy.MM.dd H:m:s} - {bar.EndTime:yyyy.MM.dd H:m:s}\");\n                    }\n                }\n            }\n        }\n\n        public class FillForwardTestSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            internal static FillForwardTestAlgorithm TestAlgorithm { get; set; }\n\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = TestAlgorithm = new FillForwardTestAlgorithm();\n                return Algorithm;\n            }\n        }\n\n        public class FillForwardDaylightMovementTestSetupHandler : AlgorithmRunner.RegressionSetupHandlerWrapper\n        {\n            internal static FillForwardTestAlgorithm TestAlgorithm { get; set; }\n\n            public override IAlgorithm CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, string assemblyPath)\n            {\n                Algorithm = TestAlgorithm = new FillForwardDaylightMovementTestAlgorithm();\n                return Algorithm;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/FrontierAwareEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class FrontierAwareEnumeratorTests\n    {\n        [Test]\n        public void ReturnsTrueWhenNextDataIsAheadOfFrontier()\n        {\n            var currentTime = new DateTime(2015, 10, 13);\n            var timeProvider = new ManualTimeProvider(currentTime);\n            var underlying = new List<Tick>\n            {\n                new Tick {Time = currentTime.AddSeconds(1)}\n            };\n\n            var offsetProvider = new TimeZoneOffsetProvider(DateTimeZone.Utc, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1));\n            var frontierAware = new FrontierAwareEnumerator(underlying.GetEnumerator(), timeProvider, offsetProvider);\n\n            Assert.IsTrue(frontierAware.MoveNext());\n            Assert.IsNull(frontierAware.Current);\n            frontierAware.Dispose();\n        }\n\n        [Test]\n        public void YieldsDataWhenFrontierPasses()\n        {\n            var currentTime = new DateTime(2015, 10, 13);\n            var timeProvider = new ManualTimeProvider(currentTime);\n            var underlying = new List<Tick>\n            {\n                new Tick {Time = currentTime.AddSeconds(1)}\n            };\n\n            var offsetProvider = new TimeZoneOffsetProvider(DateTimeZone.Utc, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1));\n            var frontierAware = new FrontierAwareEnumerator(underlying.GetEnumerator(), timeProvider, offsetProvider);\n\n            timeProvider.AdvanceSeconds(1);\n\n            Assert.IsTrue(frontierAware.MoveNext());\n            Assert.IsNotNull(frontierAware.Current);\n            Assert.AreEqual(underlying[0], frontierAware.Current);\n            frontierAware.Dispose();\n        }\n\n        [Test]\n        public void YieldsFutureDataAtCorrectTime()\n        {\n            var currentTime = new DateTime(2015, 10, 13);\n            var timeProvider = new ManualTimeProvider(currentTime);\n            var underlying = new List<Tick>\n            {\n                new Tick {Time = currentTime.AddSeconds(10)}\n            };\n\n            var offsetProvider = new TimeZoneOffsetProvider(DateTimeZone.Utc, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1));\n            var frontierAware = new FrontierAwareEnumerator(underlying.GetEnumerator(), timeProvider, offsetProvider);\n\n            for (int i = 0; i < 10; i++)\n            {\n                timeProvider.AdvanceSeconds(1);\n                Assert.IsTrue(frontierAware.MoveNext());\n                if (i < 9)\n                {\n                    Assert.IsNull(frontierAware.Current);\n                }\n                else\n                {\n                    Assert.IsNotNull(frontierAware.Current);\n                    Assert.AreEqual(underlying[0], frontierAware.Current);\n                }\n            }\n            frontierAware.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/LiveAuxiliaryDataEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Globalization;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class LiveAuxiliaryDataEnumeratorTests\n    {\n        [TestCase(DataMappingMode.OpenInterest, \"20130616\", false)]\n        [TestCase(DataMappingMode.FirstDayMonth, \"20130602\", false)]\n        [TestCase(DataMappingMode.LastTradingDay, \"20130623\", false)]\n        [TestCase(DataMappingMode.OpenInterest, \"20130616\", true)]\n        [TestCase(DataMappingMode.FirstDayMonth, \"20130602\", true)]\n        [TestCase(DataMappingMode.LastTradingDay, \"20130623\", true)]\n        public void EmitsMappingEventsBasedOnCurrentMapFileAndTime(DataMappingMode dataMappingMode, string mappingDate, bool delayed)\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.ES_Future_Chain,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false,\n                dataMappingMode: dataMappingMode);\n            var symbolMaps = new List<SubscriptionDataConfig.NewSymbolEventArgs>();\n            config.NewSymbol += (sender, args) => symbolMaps.Add(args);\n            var time = new DateTime(2013, 05, 28);\n            var cache = new SecurityCache();\n\n            cache.AddData(new Tick(time, config.Symbol, 20, 10));\n            var timeProvider = new ManualTimeProvider(time);\n\n            var futureTicker1 = \"es vhle2yxr5blt\";\n            TestMapFileResolver.MapFile = new MapFile(Futures.Indices.SP500EMini, new[]\n            {\n                new MapFileRow(Time.BeginningOfTime, Futures.Indices.SP500EMini, Exchange.CME),\n                new MapFileRow(new DateTime(2013,06,01), futureTicker1, Exchange.CME, DataMappingMode.FirstDayMonth),\n                new MapFileRow(new DateTime(2013,06,15), futureTicker1, Exchange.CME, DataMappingMode.OpenInterest),\n                new MapFileRow(new DateTime(2013,06,22), futureTicker1, Exchange.CME, DataMappingMode.LastTradingDay),\n            });\n\n            IEnumerator<BaseData> enumerator;\n            Assert.IsTrue(LiveAuxiliaryDataEnumerator.TryCreate(config, timeProvider, cache, new TestMapFileProvider(), TestGlobals.FactorFileProvider, time, out enumerator));\n\n            // get's mapped right away!\n            Assert.AreEqual(futureTicker1.ToUpper(), config.MappedSymbol);\n\n            Assert.AreEqual(1, symbolMaps.Count);\n            Assert.AreEqual(Symbols.ES_Future_Chain, symbolMaps[0].Old);\n            Assert.AreEqual(Futures.Indices.SP500EMini, symbolMaps[0].Old.ID.Symbol);\n            Assert.AreEqual(Symbols.ES_Future_Chain, symbolMaps[0].New);\n            Assert.AreEqual(futureTicker1.ToUpper(), symbolMaps[0].New.Underlying.ID.ToString());\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var expectedMappingDate = DateTime.ParseExact(mappingDate, DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n            if (delayed)\n            {\n                // we advance to the mapping date, without any new mapFile!\n                timeProvider.Advance(expectedMappingDate.ConvertToUtc(config.ExchangeTimeZone) - timeProvider.GetUtcNow() + Time.LiveAuxiliaryDataOffset);\n            }\n            else\n            {\n                // just advance a day to show nothing happens until mapping time\n                timeProvider.Advance(TimeSpan.FromDays(1));\n            }\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var futureTicker2 = \"es vk2zrh843z7l\";\n            TestMapFileResolver.MapFile = new MapFile(Futures.Indices.SP500EMini, TestMapFileResolver.MapFile.Concat(\n                new[]\n                {\n                    new MapFileRow(new DateTime(2013,09,01), futureTicker2, Exchange.CME, DataMappingMode.FirstDayMonth),\n                    new MapFileRow(new DateTime(2013,09,14), futureTicker2, Exchange.CME, DataMappingMode.OpenInterest),\n                    new MapFileRow(new DateTime(2013,09,21), futureTicker2, Exchange.CME, DataMappingMode.LastTradingDay),\n                }));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            if (delayed)\n            {\n                // we got a new mapFile! advance the date and expect mapping to have happened\n                timeProvider.Advance(TimeSpan.FromDays(1));\n            }\n            else\n            {\n                // we advance to the mapping date\n                timeProvider.Advance(expectedMappingDate.ConvertToUtc(config.ExchangeTimeZone) - timeProvider.GetUtcNow() + Time.LiveAuxiliaryDataOffset);\n            }\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n\n            Assert.AreEqual(2, symbolMaps.Count);\n            Assert.AreEqual(Symbols.ES_Future_Chain, symbolMaps[1].Old);\n            Assert.AreEqual(futureTicker1.ToUpper(), symbolMaps[1].Old.Underlying.ID.ToString());\n            Assert.AreEqual(Symbols.ES_Future_Chain, symbolMaps[1].New);\n            Assert.AreEqual(futureTicker2.ToUpper(), symbolMaps[1].New.Underlying.ID.ToString());\n\n            Assert.AreEqual(futureTicker2.ToUpper(), config.MappedSymbol);\n\n            Assert.AreEqual(futureTicker2.ToUpper(), (enumerator.Current as SymbolChangedEvent).NewSymbol);\n            Assert.AreEqual(futureTicker1.ToUpper(), (enumerator.Current as SymbolChangedEvent).OldSymbol);\n            Assert.AreEqual(config.Symbol, (enumerator.Current as SymbolChangedEvent).Symbol);\n            Assert.AreEqual(timeProvider.GetUtcNow().Date, (enumerator.Current as SymbolChangedEvent).Time);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EmitsDelistingEventsBasedOnCurrentTime()\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY_C_192_Feb19_2016,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var delistingDate = config.Symbol.GetDelistingDate();\n            var time = delistingDate.AddDays(-10);\n            var cache = new SecurityCache();\n            cache.AddData(new Tick(DateTime.UtcNow, config.Symbol, 20, 10));\n            var timeProvider = new ManualTimeProvider(time);\n\n            IEnumerator<BaseData> enumerator;\n            Assert.IsTrue(LiveAuxiliaryDataEnumerator.TryCreate(config, timeProvider, cache, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, config.Symbol.ID.Date, out enumerator));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            // advance until delisting date, take into account 5 hour offset of NY + TradableDateOffset\n            timeProvider.Advance(TimeSpan.FromDays(10));\n            timeProvider.Advance(TimeSpan.FromHours(5));\n            timeProvider.Advance(Time.LiveAuxiliaryDataOffset);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(DelistingType.Warning, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(config.Symbol, (enumerator.Current as Delisting).Symbol);\n            Assert.AreEqual(delistingDate, (enumerator.Current as Delisting).Time);\n            Assert.AreEqual(15, (enumerator.Current as Delisting).Price);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            // when the day ends the delisted event will pass through, respecting the offset\n            timeProvider.Advance(TimeSpan.FromDays(1));\n\n            cache.AddData(new Tick(DateTime.UtcNow, config.Symbol, 40, 20));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(DelistingType.Delisted, (enumerator.Current as Delisting).Type);\n            Assert.AreEqual(config.Symbol, (enumerator.Current as Delisting).Symbol);\n            Assert.AreEqual(delistingDate.AddDays(1), (enumerator.Current as Delisting).Time);\n            Assert.AreEqual(30, (enumerator.Current as Delisting).Price);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            enumerator.Dispose();\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void EquityEmitsDelistingEventsBasedOnCurrentTime(bool delayed)\n        {\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var time = new DateTime(2013, 05, 28);\n            var cache = new SecurityCache();\n\n            cache.AddData(new Tick(time, config.Symbol, 20, 10));\n            var timeProvider = new ManualTimeProvider(time);\n\n            TestMapFileResolver.MapFile = new MapFile(config.Symbol.ID.Symbol, new[]\n            {\n                new MapFileRow(Time.BeginningOfTime, config.Symbol.ID.Symbol),\n                new MapFileRow(Time.EndOfTime, config.Symbol.ID.Symbol),\n            });\n\n            IEnumerator<BaseData> enumerator;\n            Assert.IsTrue(LiveAuxiliaryDataEnumerator.TryCreate(config, timeProvider, cache, new TestMapFileProvider(), TestGlobals.FactorFileProvider, time, out enumerator));\n\n            // get's mapped right away!\n            Assert.AreEqual(\"SPY\", config.MappedSymbol);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var delistingDate = time.AddDays(2);\n            var delistedMapFile = new MapFile(config.Symbol.ID.Symbol, new[]\n            {\n                new MapFileRow(Time.BeginningOfTime, config.Symbol.ID.Symbol),\n                new MapFileRow(delistingDate, config.Symbol.ID.Symbol),\n            });\n\n            // just advance a day to show nothing happens until mapping time\n            timeProvider.Advance(TimeSpan.FromDays(1));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            if (!delayed)\n            {\n                TestMapFileResolver.MapFile = delistedMapFile;\n            }\n\n            // we advance to the mapping date, without any new mapFile!\n            timeProvider.Advance(delistingDate.ConvertToUtc(config.ExchangeTimeZone) - timeProvider.GetUtcNow() + Time.LiveAuxiliaryDataOffset);\n\n            if (delayed)\n            {\n                // nothing happens\n                Assert.IsTrue(enumerator.MoveNext());\n                Assert.IsNull(enumerator.Current);\n\n                TestMapFileResolver.MapFile = delistedMapFile;\n\n                timeProvider.Advance(Time.OneDay);\n            }\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n\n            var delisted = enumerator.Current as Delisting;\n            Assert.IsNotNull(delisted);\n            Assert.AreEqual(DelistingType.Warning, delisted.Type);\n\n            if (!delayed)\n            {\n                Assert.IsTrue(enumerator.MoveNext());\n                Assert.IsNull(enumerator.Current);\n\n                // delisting passed\n                timeProvider.Advance(TimeSpan.FromDays(1));\n            }\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n\n            delisted = enumerator.Current as Delisting;\n            Assert.IsNotNull(delisted);\n            Assert.AreEqual(DelistingType.Delisted, delisted.Type);\n            enumerator.Dispose();\n        }\n\n        private class TestMapFileProvider : IMapFileProvider\n        {\n            public void Initialize(IDataProvider dataProvider)\n            {\n            }\n\n            public MapFileResolver Get(AuxiliaryDataKey auxiliaryDataKey)\n            {\n                return new TestMapFileResolver();\n            }\n        }\n\n        private class TestMapFileResolver : MapFileResolver\n        {\n            public static MapFile MapFile { get; set; }\n            public TestMapFileResolver()\n                : base(new[] { MapFile })\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/LiveEquityDataSynchronizingEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class LiveEquityDataSynchronizingEnumeratorTests\n    {\n        // this test case generates data points in the past, will complete very quickly\n        [TestCase(-15, 1)]\n        // this test case generates data points in the future, will require at least 10 seconds to complete\n        [TestCase(0, 11)]\n        public void SynchronizesData(int timeOffsetSeconds, int testTimeSeconds)\n        {\n            var start = DateTime.UtcNow;\n            var end = start.AddSeconds(testTimeSeconds);\n\n            var time = start;\n            var tickList1 = Enumerable.Range(0, 10).Select(x => new Tick { Time = time.AddSeconds(x * 1 + timeOffsetSeconds), Value = x }).ToList();\n            var tickList2 = Enumerable.Range(0, 5).Select(x => new Tick { Time = time.AddSeconds(x * 2 + timeOffsetSeconds), Value = x + 100 }).ToList();\n            var stream1 = tickList1.GetEnumerator();\n            var stream2 = tickList2.GetEnumerator();\n\n            var count1 = 0;\n            var count2 = 0;\n            var previous = DateTime.MinValue;\n            var synchronizer = new LiveAuxiliaryDataSynchronizingEnumerator(new RealTimeProvider(), DateTimeZone.Utc, stream1, new List<IEnumerator<BaseData>> { stream2 });\n            while (synchronizer.MoveNext() && DateTime.UtcNow < end)\n            {\n                if (synchronizer.Current != null)\n                {\n                    if (synchronizer.Current.Value < 100)\n                    {\n                        Assert.AreEqual(count1, synchronizer.Current.Value);\n                        count1++;\n                    }\n                    else\n                    {\n                        Assert.AreEqual(count2 + 100, synchronizer.Current.Value);\n                        count2++;\n                    }\n\n                    Assert.That(synchronizer.Current.EndTime, Is.GreaterThanOrEqualTo(previous));\n                    previous = synchronizer.Current.EndTime;\n\n                    Log.Trace($\"Data point emitted: {synchronizer.Current.EndTime:O} - {synchronizer.Current}\");\n                }\n            }\n\n            Log.Trace($\"Total point count: {count1 + count2}\");\n\n            Assert.AreEqual(tickList1.Count, count1);\n            Assert.AreEqual(tickList2.Count, count2);\n            synchronizer.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/LiveFillForwardEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class LiveFillForwardEnumeratorTests\n    {\n        [Test]\n        public void FillsForwardOnNulls()\n        {\n            var reference = new DateTime(2015, 10, 08);\n            var period = Time.OneSecond;\n            var underlying = new List<BaseData>\n            {\n                // 0 seconds\n                new TradeBar(reference, Symbols.SPY, 10, 20, 5, 15, 123456, period),\n                // 1 seconds\n                null,\n                // 3 seconds\n                new TradeBar(reference.AddSeconds(2), Symbols.SPY, 100, 200, 50, 150, 1234560, period),\n                null,\n                null,\n                null,\n                null\n            };\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(reference);\n            var exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            var fillForward = new LiveFillForwardEnumerator(timeProvider, underlying.GetEnumerator(), exchange, Ref.Create(Time.OneSecond), false, reference, Time.EndOfTime, Resolution.Second, exchange.TimeZone, false);\n\n            // first point is always emitted\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[0], fillForward.Current);\n            Assert.AreEqual(123456, ((TradeBar)fillForward.Current).Volume);\n\n            // stepping again without advancing time does nothing, but we'll still\n            // return true as per IEnumerator contract\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.IsNull(fillForward.Current);\n\n            timeProvider.SetCurrentTime(reference.AddSeconds(2));\n\n            // non-null next will fill forward in between\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[0].EndTime, fillForward.Current.Time);\n            Assert.AreEqual(underlying[0].Value, fillForward.Current.Value);\n            Assert.IsTrue(fillForward.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForward.Current).Volume);\n\n            // even without stepping the time this will advance since non-null data is ready\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[2], fillForward.Current);\n            Assert.AreEqual(1234560, ((TradeBar)fillForward.Current).Volume);\n\n            // step ahead into null data territory\n            timeProvider.SetCurrentTime(reference.AddSeconds(4));\n\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[2].Value, fillForward.Current.Value);\n            Assert.AreEqual(timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork).RoundDown(Time.OneSecond), fillForward.Current.EndTime);\n            Assert.IsTrue(fillForward.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForward.Current).Volume);\n\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.IsNull(fillForward.Current);\n\n            timeProvider.SetCurrentTime(reference.AddSeconds(5));\n\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[2].Value, fillForward.Current.Value);\n            Assert.AreEqual(timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork).RoundDown(Time.OneSecond), fillForward.Current.EndTime);\n            Assert.IsTrue(fillForward.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForward.Current).Volume);\n\n            timeProvider.SetCurrentTime(reference.AddSeconds(6));\n\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.AreEqual(underlying[2].Value, fillForward.Current.Value);\n            Assert.AreEqual(timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork).RoundDown(Time.OneSecond), fillForward.Current.EndTime);\n            Assert.IsTrue(fillForward.Current.IsFillForward);\n            Assert.AreEqual(0, ((TradeBar)fillForward.Current).Volume);\n\n            fillForward.Dispose();\n        }\n\n        [Test]\n        public void HandlesDaylightSavingTimeChange()\n        {\n            // In 2018, Daylight Saving Time (DST) began at 2 AM on Sunday, March 11\n            // This means that clocks were moved forward one hour on March 11\n            var reference = new DateTime(2018, 3, 10);\n            var period = Time.OneDay;\n            var underlying = new List<TradeBar>\n            {\n                new TradeBar(reference, Symbols.SPY, 10, 20, 5, 15, 123456, period),\n                // Daylight Saving Time change, the data still goes from midnight to midnight\n                new TradeBar(reference.AddDays(1), Symbols.SPY, 100, 200, 50, 150, 1234560, period)\n            };\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(reference);\n            var exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            var fillForward = new LiveFillForwardEnumerator(\n                timeProvider,\n                underlying.GetEnumerator(),\n                exchange,\n                Ref.Create(Time.OneDay),\n                false,\n                reference,\n                Time.EndOfTime,\n                Resolution.Daily,\n                exchange.TimeZone, false);\n\n            // first point is always emitted\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.IsFalse(fillForward.Current.IsFillForward);\n            Assert.AreEqual(underlying[0], fillForward.Current);\n            //Assert.AreEqual(underlying[0].EndTime, fillForward.Current.EndTime);\n            Assert.AreEqual(123456, ((TradeBar)fillForward.Current).Volume);\n\n            // Daylight Saving Time change -> add 1 hour\n            timeProvider.SetCurrentTime(reference.AddDays(1).AddHours(1));\n\n            // second data point emitted\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.IsFalse(fillForward.Current.IsFillForward);\n            Assert.AreEqual(underlying[1], fillForward.Current);\n            //Assert.AreEqual(underlying[1].EndTime, fillForward.Current.EndTime);\n            Assert.AreEqual(1234560, ((TradeBar)fillForward.Current).Volume);\n\n            Assert.IsTrue(fillForward.MoveNext());\n            Assert.IsTrue(fillForward.Current.IsFillForward);\n            Assert.AreEqual(underlying[1].EndTime, fillForward.Current.Time);\n            Assert.AreEqual(underlying[1].Value, fillForward.Current.Value);\n            Assert.AreEqual(0, ((TradeBar)fillForward.Current).Volume);\n\n            fillForward.Dispose();\n        }\n\n        [Test]\n        public void LiveFillForwardEnumeratorDoesNotStall()\n        {\n            var reference = new DateTime(2020, 5, 21, 9, 40, 0, 100);\n            var timeProvider = new ManualTimeProvider(reference, TimeZones.NewYork);\n\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, reference.Date, Resolution.Minute, out var enqueueableEnumerator, false);\n            var openingBar = new TradeBar\n            {\n                Open = 0.01m,\n                High = 0.01m,\n                Low = 0.01m,\n                Close = 0.01m,\n                Volume = 1,\n                EndTime = new DateTime(2020, 5, 21, 9, 40, 0),\n                Symbol = Symbols.AAPL\n            };\n            var secondBar = new TradeBar\n            {\n                Open = 1m,\n                High = 2m,\n                Low = 1m,\n                Close = 2m,\n                Volume = 100,\n                EndTime = new DateTime(2020, 5, 21, 9, 42, 0),\n                Symbol = Symbols.AAPL\n            };\n\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            // Advance the time, we expect a fill-forward bar.\n            timeProvider.SetCurrentTime(new DateTime(2020, 5, 21, 9, 41, 0, 100) + LiveFillForwardEnumerator.GetMaximumDataTimeout(Resolution.Minute));\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime.AddMinutes(1), fillForwardEnumerator.Current.EndTime);\n\n            // Now we expect data. The secondBar should be fill-forwarded from here on out after the MoveNext\n            timeProvider.SetCurrentTime(new DateTime(2020, 5, 21, 9, 42, 0, 100));\n            enqueueableEnumerator.Enqueue(secondBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            enqueueableEnumerator.Dispose();\n        }\n\n        private static IEnumerable<TestCaseData> TimeOutTestCases\n        {\n            get\n            {\n                // Hour resolution, fill forward to market open\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 10, 0, 0), true, true);\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 10, 0, 0), false, false);\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 10, 0, 0), null, true, false);\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 10, 0, 0), null, false, false);\n                // over a weekend (22th is a Friday and 25th Monday is a holiday)\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 10, 0, 0), true, true);\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 10, 0, 0), false, false);\n                // market close\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 15, 0, 0), null, true, true);\n                yield return new(Resolution.Hour, new DateTime(2020, 5, 21, 15, 0, 0), null, false, false);\n\n                // Minute resolution, fill forward to market open\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 9, 31, 0), true, true);\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 9, 31, 0), false, false);\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 9, 31, 0), null, true, false);\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 9, 31, 0), null, false, false);\n                // over a weekend\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 9, 31, 0), true, true);\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 9, 31, 0), false, false);\n                // market close\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 15, 59, 0), null, true, true);\n                yield return new(Resolution.Minute, new DateTime(2020, 5, 21, 15, 59, 0), null, false, false);\n\n                // Second resolution, fill forward to market open\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 9, 30, 1), true, true);\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 16, 0, 0), new DateTime(2020, 5, 22, 9, 30, 1), false, false);\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 9, 30, 1), null, true, false);\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 9, 30, 1), null, false, false);\n                // over a weekend\n                yield return new(Resolution.Second, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 9, 30, 1), true, true);\n                yield return new(Resolution.Second, new DateTime(2020, 5, 22, 16, 0, 0), new DateTime(2020, 5, 26, 9, 30, 1), false, false);\n                // market close\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 15, 59, 59), null, true, true);\n                yield return new(Resolution.Second, new DateTime(2020, 5, 21, 15, 59, 59), null, false, false);\n            }\n        }\n\n        [TestCaseSource(nameof(TimeOutTestCases))]\n        public void TakesIntoAccountTimeOut(Resolution resolution, DateTime previousDataEndTime, DateTime? expectedNextBarEndTime, bool dataArrivedLate, bool shouldHaveTimeout)\n        {\n            var timeProvider = new ManualTimeProvider(previousDataEndTime, TimeZones.NewYork);\n\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, previousDataEndTime.Date, resolution, out var enqueueableEnumerator, dailyStrictEndTimeEnabled: false);\n            var period = resolution.ToTimeSpan();\n            var openingBar = new TradeBar(previousDataEndTime.Subtract(period), Symbols.AAPL, 0.01m, 0.01m, 0.01m, 0.01m, 1, period);\n\n            expectedNextBarEndTime ??= previousDataEndTime.Add(resolution.ToTimeSpan());\n            var secondBar = new TradeBar(openingBar.EndTime, Symbols.AAPL, 1m, 2m, 1m, 2m, 100, period);\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            // Advance the time, we don't expect a fill-forward bar because the timeout amount has not passed yet\n            timeProvider.SetCurrentTime(expectedNextBarEndTime.Value);\n            if (dataArrivedLate)\n            {\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n\n                if (shouldHaveTimeout)\n                {\n                    Assert.IsNull(fillForwardEnumerator.Current);\n\n                    // Advance the time, including the expected timout, we expect a fill-forward bar.\n                    timeProvider.Advance(LiveFillForwardEnumerator.GetMaximumDataTimeout(resolution));\n\n                    Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                }\n\n                Assert.IsNotNull(fillForwardEnumerator.Current);\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n                Assert.AreEqual(expectedNextBarEndTime, fillForwardEnumerator.Current.EndTime);\n\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n                Assert.AreEqual(expectedNextBarEndTime, fillForwardEnumerator.Current.EndTime);\n\n            }\n\n            // Now we expect data. The secondBar should be fill-forwarded from here on out after the MoveNext\n            enqueueableEnumerator.Enqueue(secondBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            enqueueableEnumerator.Dispose();\n        }\n\n        [Test]\n        public void TakesIntoAccountTimeOutWhenThereAreBigGaps([Values(Resolution.Second, Resolution.Minute, Resolution.Hour)] Resolution resolution)\n        {\n            var start = new DateTime(2020, 5, 20, 12, 0, 0);\n            var end = new DateTime(2020, 5, 22, 16, 0, 0);\n\n            var timeProvider = new ManualTimeProvider(start, TimeZones.NewYork);\n\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, start, resolution, out var enqueueableEnumerator, dailyStrictEndTimeEnabled: false);\n            var period = resolution.ToTimeSpan();\n            var openingBar = new TradeBar(start.Subtract(period), Symbols.AAPL, 0.01m, 0.01m, 0.01m, 0.01m, 1, period);\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            timeProvider.Advance(period);\n\n            var previous = (TradeBar)fillForwardEnumerator.Current;\n            var currentIsMarketOpen = false;\n            var currentIsMarketClose = false;\n            while (previous.EndTime < end)\n            {\n                var currentTime = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n\n                Assert.IsTrue(fillForwardEnumerator.MoveNext(), $\"Previous: {previous.EndTime}\");\n\n                if (currentIsMarketOpen || currentIsMarketClose)\n                {\n                    Assert.IsNull(fillForwardEnumerator.Current, $\"Previous: {previous.EndTime}\");\n\n                    // Advance the time, including the expected timout, we expect a fill-forward bar.\n                    timeProvider.Advance(LiveFillForwardEnumerator.GetMaximumDataTimeout(resolution));\n                    Assert.IsTrue(fillForwardEnumerator.MoveNext(), $\"Previous: {previous.EndTime}\");\n                }\n\n                Assert.IsNotNull(fillForwardEnumerator.Current, $\"Previous: {previous.EndTime}\");\n\n                var current = (TradeBar)fillForwardEnumerator.Current;\n                Assert.IsTrue(current.IsFillForward, $\"Current: {previous.EndTime}\");\n                Assert.AreEqual(previous.Open, current.Open, $\"Current: {previous.EndTime}\");\n                Assert.AreEqual(previous.Price, current.Price, $\"Current: {previous.EndTime}\");\n\n                var expectedEndTime = previous.EndTime.Add(period);\n                if (currentIsMarketOpen)\n                {\n                    expectedEndTime = expectedEndTime.Date.AddDays(1).AddHours(9).AddMinutes(30).Add(period);\n                    if (resolution == Resolution.Hour)\n                    {\n                        expectedEndTime = expectedEndTime.RoundDown(period);\n                    }\n                }\n                Assert.AreEqual(expectedEndTime, current.EndTime, $\"Current: {previous.EndTime}\");\n\n                currentIsMarketOpen = current.EndTime.TimeOfDay == TimeSpan.FromHours(16);\n                currentIsMarketClose = current.EndTime.TimeOfDay == TimeSpan.FromHours(16) - period;\n                previous = current;\n\n                // Advance the time provider\n                var nextTime = current.EndTime.Add(period);\n                if (nextTime.TimeOfDay > TimeSpan.FromHours(16))\n                {\n                    // If the next time is after market close, we need to advance to the next day\n                    nextTime = nextTime.Date.AddDays(1).AddHours(9).AddMinutes(30).Add(period);\n                    if (resolution == Resolution.Hour)\n                    {\n                        nextTime = nextTime.RoundDown(period);\n                    }\n                }\n                timeProvider.SetCurrentTime(nextTime);\n            }\n\n            enqueueableEnumerator.Dispose();\n        }\n\n        [TestCase(true, true)]\n        [TestCase(false, true)]\n        [TestCase(true, false)]\n        [TestCase(false, false)]\n        public void TakesIntoAccountTimeOutDaily(bool dailyStrictEndTimeEnabled, bool dataArrivedLate)\n        {\n            var resolution = Resolution.Daily;\n            var referenceOpenTime = new DateTime(2020, 5, 21, 9, 30, 0);\n            var referenceTime = new DateTime(2020, 5, 21, 16, 0, 0);\n            if (!dailyStrictEndTimeEnabled)\n            {\n                referenceOpenTime = referenceOpenTime.Date;\n                referenceTime = referenceTime.Date.AddDays(1);\n            }\n            var timeProvider = new ManualTimeProvider(referenceTime, TimeZones.NewYork);\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, referenceTime.Date, resolution, out var enqueueableEnumerator, dailyStrictEndTimeEnabled);\n            var openingBar = new TradeBar\n            {\n                Open = 0.01m,\n                High = 0.01m,\n                Low = 0.01m,\n                Close = 0.01m,\n                Volume = 1,\n                Time = referenceOpenTime,\n                EndTime = referenceTime,\n                Symbol = Symbols.AAPL\n            };\n            var secondBar = new TradeBar\n            {\n                Open = 1m,\n                High = 2m,\n                Low = 1m,\n                Close = 2m,\n                Volume = 100,\n                Time = referenceOpenTime.AddDays(1),\n                EndTime = referenceTime.AddDays(1),\n                Symbol = Symbols.AAPL\n            };\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            // Advance the time, we don't expect a fill-forward bar because the timeout amount has not passed yet\n            timeProvider.SetCurrentTime(secondBar.EndTime);\n\n            if (dataArrivedLate)\n            {\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.IsNull(fillForwardEnumerator.Current);\n\n                // Advance the time, including the expected timout, we expect a fill-forward bar.\n                timeProvider.Advance(LiveFillForwardEnumerator.GetMaximumDataTimeout(resolution));\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.IsTrue(fillForwardEnumerator.Current.IsFillForward);\n                Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n                Assert.AreEqual(secondBar.EndTime, fillForwardEnumerator.Current.EndTime);\n            }\n\n            // Now we expect data. The secondBar should be fill-forwarded from here on out after the MoveNext\n            enqueueableEnumerator.Enqueue(secondBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.IsFalse(fillForwardEnumerator.Current.IsFillForward);\n            Assert.AreEqual(secondBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(secondBar.EndTime, fillForwardEnumerator.Current.EndTime);\n            enqueueableEnumerator.Dispose();\n        }\n\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Hour)]\n        public void MultiResolutionSmallerFillForwardResolution(Resolution resolution)\n        {\n            var ffResolution = Resolution.Second;\n            var referenceOpenTime = new DateTime(2020, 5, 21, 14, 0, 0);\n            if (resolution == Resolution.Minute)\n            {\n                referenceOpenTime = new DateTime(2020, 5, 21, 15, 59, 0);\n            }\n            var referenceTime = new DateTime(2020, 5, 21, 15, 0, 0);\n\n            var timeProvider = new ManualTimeProvider(referenceTime, TimeZones.NewYork);\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, referenceTime.Date, resolution, out var enqueueableEnumerator, true, ffResolution);\n            var openingBar = new TradeBar\n            {\n                Open = 0.01m,\n                High = 0.01m,\n                Low = 0.01m,\n                Close = 0.01m,\n                Volume = 1,\n                Time = referenceOpenTime,\n                EndTime = referenceTime,\n                Symbol = Symbols.AAPL\n            };\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            // Advance the time, we expect a fill-forward bar\n\n            for (var i = 0; i < 60; i++)\n            {\n                timeProvider.Advance(Time.OneSecond);\n\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.NotNull(fillForwardEnumerator.Current);\n                Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n                Assert.AreEqual(timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork), fillForwardEnumerator.Current.EndTime);\n            }\n\n            enqueueableEnumerator.Dispose();\n        }\n\n        [TestCase(Resolution.Daily, Resolution.Minute)]\n        [TestCase(Resolution.Hour, Resolution.Minute)]\n        [TestCase(Resolution.Daily, Resolution.Second)]\n        [TestCase(Resolution.Hour, Resolution.Second)]\n        public void MultiResolutionMarketClose(Resolution resolution, Resolution ffResolution)\n        {\n            var referenceOpenTime = new DateTime(2020, 5, 21, 9, 30, 0);\n            if (resolution == Resolution.Hour)\n            {\n                referenceOpenTime = new DateTime(2020, 5, 21, 15, 0, 0);\n            }\n            var referenceTime = new DateTime(2020, 5, 21, 16, 0, 0);\n            var timeProvider = new ManualTimeProvider(referenceTime, TimeZones.NewYork);\n            using var fillForwardEnumerator = GetLiveFillForwardEnumerator(timeProvider, referenceTime.Date, resolution, out var enqueueableEnumerator, true, ffResolution);\n            var openingBar = new TradeBar\n            {\n                Open = 0.01m,\n                High = 0.01m,\n                Low = 0.01m,\n                Close = 0.01m,\n                Volume = 1,\n                Time = referenceOpenTime,\n                EndTime = referenceTime,\n                Symbol = Symbols.AAPL\n            };\n\n            // Enqueue the first point, which will be emitted ASAP.\n            enqueueableEnumerator.Enqueue(openingBar);\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            Assert.NotNull(fillForwardEnumerator.Current);\n            Assert.AreEqual(openingBar.Open, ((TradeBar)fillForwardEnumerator.Current).Open);\n            Assert.AreEqual(openingBar.EndTime, fillForwardEnumerator.Current.EndTime);\n\n            for (var i = 0; i < 600; i++)\n            {\n                // Advance the time, we don't expect a fill-forward bar, we've emitted our daily bar already and market is closed\n                timeProvider.Advance(ffResolution.ToTimeSpan());\n                Assert.IsTrue(fillForwardEnumerator.MoveNext());\n                Assert.IsNull(fillForwardEnumerator.Current);\n            }\n\n            enqueueableEnumerator.Dispose();\n        }\n\n        private static LiveFillForwardEnumerator GetLiveFillForwardEnumerator(ITimeProvider timeProvider, DateTime startTime, Resolution resolution,\n            out EnqueueableEnumerator<BaseData> enqueueableEnumerator, bool dailyStrictEndTimeEnabled, Resolution? ffResolution = null)\n        {\n            enqueueableEnumerator = new EnqueueableEnumerator<BaseData>();\n            var fillForwardEnumerator = new LiveFillForwardEnumerator(\n                timeProvider,\n                enqueueableEnumerator,\n                new SecurityExchange(MarketHoursDatabase.FromDataFolder()\n                    .ExchangeHoursListing\n                    .First(kvp => kvp.Key.Market == Market.USA && kvp.Key.SecurityType == SecurityType.Equity)\n                    .Value\n                    .ExchangeHours),\n                Ref.CreateReadOnly(() => (ffResolution ?? resolution).ToTimeSpan()),\n                false,\n                startTime,\n                Time.EndOfTime,\n                resolution,\n                TimeZones.NewYork,\n                dailyStrictEndTimeEnabled: dailyStrictEndTimeEnabled\n            );\n\n            return fillForwardEnumerator;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/LiveSubscriptionEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class LiveSubscriptionEnumeratorTests\n    {\n        [Test]\n        public void HandlesSymbolMapping()\n        {\n            var canonical = Symbols.Fut_SPY_Feb19_2016.Canonical;\n            var dataQueue = new TestDataQueueHandler\n            {\n                DataPerSymbol = new Dictionary<Symbol, List<BaseData>>\n                {\n                    { Symbols.Fut_SPY_Feb19_2016,\n                        new List<BaseData>{ new Tick(Time.BeginningOfTime, Symbols.Fut_SPY_Feb19_2016, 1, 1)} },\n                    { Symbols.Fut_SPY_Mar19_2016,\n                        new List<BaseData>{ new Tick(Time.BeginningOfTime, Symbols.Fut_SPY_Mar19_2016, 2, 2)} },\n                }\n            };\n            var config = new SubscriptionDataConfig(typeof(Tick), canonical, Resolution.Tick,\n                DateTimeZone.Utc, DateTimeZone.Utc, false, false, false)\n            {\n                MappedSymbol = Symbols.Fut_SPY_Feb19_2016.ID.ToString()\n            };\n\n            var compositeDataQueueHandler = new TestDataQueueHandlerManager(new AlgorithmSettings());\n            compositeDataQueueHandler.ExposedDataHandlers.Add(dataQueue);\n            var data = new LiveSubscriptionEnumerator(config, compositeDataQueueHandler, (_, _) => {}, (_) => false);\n\n            Assert.IsTrue(data.MoveNext());\n            Assert.AreEqual(1, (data.Current as Tick).AskPrice);\n            Assert.AreEqual(canonical, (data.Current as Tick).Symbol);\n\n            Assert.IsFalse(data.MoveNext());\n            Assert.IsNull(data.Current);\n\n            Assert.AreEqual(2, dataQueue.DataPerSymbol.Count);\n            config.MappedSymbol = Symbols.Fut_SPY_Mar19_2016.ID.ToString();\n            Assert.AreEqual(1, dataQueue.DataPerSymbol.Count);\n\n            Assert.IsTrue(data.MoveNext());\n            Assert.AreEqual(2, (data.Current as Tick).AskPrice);\n            Assert.AreEqual(canonical, (data.Current as Tick).Symbol);\n            Assert.AreNotEqual(canonical, dataQueue.DataPerSymbol[Symbols.Fut_SPY_Mar19_2016].Single().Symbol);\n\n            Assert.IsFalse(data.MoveNext());\n            Assert.IsNull(data.Current);\n\n            Assert.AreEqual(1, dataQueue.DataPerSymbol.Count);\n\n            data.Dispose();\n            compositeDataQueueHandler.Dispose();\n        }\n\n        internal class TestDataQueueHandler : IDataQueueHandler\n        {\n            public bool IsConnected => true;\n\n            public Dictionary<Symbol, List<BaseData>> DataPerSymbol;\n\n            public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n            {\n                if (DataPerSymbol.TryGetValue(dataConfig.Symbol, out var baseDatas))\n                {\n                    return baseDatas.GetEnumerator();\n                }\n                throw new Exception($\"Failed to find a data enumerator for symbol {dataConfig.Symbol}!\");\n            }\n            public void Unsubscribe(SubscriptionDataConfig dataConfig)\n            {\n                DataPerSymbol.Remove(dataConfig.Symbol);\n            }\n            public void SetJob(LiveNodePacket job)\n            {\n            }\n            public void Dispose()\n            {\n            }\n        }\n\n        private class TestDataQueueHandlerManager : DataQueueHandlerManager\n        {\n            public List<IDataQueueHandler> ExposedDataHandlers => DataHandlers;\n            public TestDataQueueHandlerManager(IAlgorithmSettings settings) : base(settings)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/MappingEventProviderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class MappingEventProviderTests\n    {\n        private SubscriptionDataConfig _config;\n\n        [SetUp]\n        public void SetUp()\n        {\n            var symbol = Symbol.Create(\"TFCFA\", SecurityType.Equity, Market.USA);\n\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n        }\n\n        [Test]\n        public void InitialMapping()\n        {\n            var provider = new MappingEventProvider();\n\n            Assert.AreEqual(\"TFCFA\", _config.MappedSymbol);\n\n            provider.Initialize(_config,\n                null,\n                TestGlobals.MapFileProvider,\n                new DateTime(2006, 1, 1));\n\n            Assert.AreEqual(\"NWSA\", _config.MappedSymbol);\n        }\n\n        [Test]\n        public void MappingEvent()\n        {\n            var provider = new MappingEventProvider();\n            provider.Initialize(_config,\n                null,\n                TestGlobals.MapFileProvider,\n                new DateTime(2006, 1, 1));\n\n            Assert.AreEqual(\"NWSA\", _config.MappedSymbol);\n\n            var symbolEvent = (SymbolChangedEvent)provider\n                .GetEvents(new NewTradableDateEventArgs(\n                    new DateTime(2013, 6, 29),\n                    null,\n                    _config.Symbol,\n                    null)).Single();\n\n            Assert.AreEqual(\"FOXA\", symbolEvent.NewSymbol);\n            Assert.AreEqual(\"NWSA\", symbolEvent.OldSymbol);\n            Assert.AreEqual(\"FOXA\", _config.MappedSymbol);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/PriceScaleFactorEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing System.Collections;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing Tick = QuantConnect.Data.Market.Tick;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class PriceScaleFactorEnumeratorTests\n    {\n        private SubscriptionDataConfig _config;\n        private RawDataEnumerator _rawDataEnumerator;\n\n        [SetUp]\n        public void Setup()\n        {\n            _config = GetConfig(Symbols.SPY, Resolution.Daily);\n            _rawDataEnumerator = new RawDataEnumerator();\n        }\n\n        [Test]\n        public void EquityTradeBar()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n            _rawDataEnumerator.CurrentValue = new TradeBar(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                10,\n                10,\n                10,\n                10,\n                100);\n            Assert.IsTrue(enumerator.MoveNext());\n            var tradeBar = enumerator.Current as TradeBar;\n            var expectedValue = 10 * _config.PriceScaleFactor;\n\n            Assert.Less(expectedValue, 10);\n            Assert.AreEqual(expectedValue, tradeBar.Price);\n            Assert.AreEqual(expectedValue, tradeBar.Open);\n            Assert.AreEqual(expectedValue, tradeBar.Close);\n            Assert.AreEqual(expectedValue, tradeBar.High);\n            Assert.AreEqual(expectedValue, tradeBar.Low);\n            Assert.AreEqual(expectedValue, tradeBar.Value);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EquityQuoteBar()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n            _rawDataEnumerator.CurrentValue = new QuoteBar(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                new Bar(10, 10, 10, 10),\n                100,\n                new Bar(10, 10, 10, 10),\n                100);\n            Assert.IsTrue(enumerator.MoveNext());\n            var quoteBar = enumerator.Current as QuoteBar;\n            var expectedValue = 10 * _config.PriceScaleFactor;\n\n            Assert.Less(expectedValue, 10);\n\n            Assert.AreEqual(expectedValue, quoteBar.Price);\n            Assert.AreEqual(expectedValue, quoteBar.Value);\n            Assert.AreEqual(expectedValue, quoteBar.Open);\n            Assert.AreEqual(expectedValue, quoteBar.Close);\n            Assert.AreEqual(expectedValue, quoteBar.High);\n            Assert.AreEqual(expectedValue, quoteBar.Low);\n            // bid\n            Assert.AreEqual(expectedValue, quoteBar.Bid.Open);\n            Assert.AreEqual(expectedValue, quoteBar.Bid.Close);\n            Assert.AreEqual(expectedValue, quoteBar.Bid.High);\n            Assert.AreEqual(expectedValue, quoteBar.Bid.Low);\n            // ask\n            Assert.AreEqual(expectedValue, quoteBar.Ask.Open);\n            Assert.AreEqual(expectedValue, quoteBar.Ask.Close);\n            Assert.AreEqual(expectedValue, quoteBar.Ask.High);\n            Assert.AreEqual(expectedValue, quoteBar.Ask.Low);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void EquityTick()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n            _rawDataEnumerator.CurrentValue = new Tick(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                10,\n                10,\n                10);\n            Assert.IsTrue(enumerator.MoveNext());\n            var tick = enumerator.Current as Tick;\n            var expectedValue = 10 * _config.PriceScaleFactor;\n\n            Assert.Less(expectedValue, 10);\n            Assert.AreEqual(expectedValue, tick.Price);\n            Assert.AreEqual(expectedValue, tick.Value);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void FactorFileIsNull()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                null);\n            _rawDataEnumerator.CurrentValue = new Tick(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                10,\n                10,\n                10);\n            Assert.IsTrue(enumerator.MoveNext());\n            var tick = enumerator.Current as Tick;\n            Assert.AreEqual(10, tick.Price);\n            Assert.AreEqual(10, tick.Value);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void RawEnumeratorReturnsFalse()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n            _rawDataEnumerator.CurrentValue = new Tick(\n                new DateTime(2018, 1, 1),\n                _config.Symbol,\n                10,\n                10,\n                10);\n            _rawDataEnumerator.MoveNextReturnValue = false;\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.AreEqual(_rawDataEnumerator.CurrentValue, enumerator.Current);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void RawEnumeratorCurrentIsNull()\n        {\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n            _rawDataEnumerator.CurrentValue = null;\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void UpdatesFactorFileCorrectly()\n        {\n            var dateBeforeUpadate = new DateTime(2018, 3, 14);\n            var dateAtUpadate = new DateTime(2018, 3, 15);\n            var dateAfterUpadate = new DateTime(2018, 3, 16);\n\n            var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                _config,\n                TestGlobals.FactorFileProvider);\n\n            // Before factor file update date (2018, 3, 15)\n            _rawDataEnumerator.CurrentValue = new Tick(\n                dateBeforeUpadate,\n                _config.Symbol,\n                10,\n                10,\n                10);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            var factorFile = TestGlobals.FactorFileProvider.Get(_config.Symbol);\n            var expectedFactor = factorFile.GetPriceFactor(dateBeforeUpadate, DataNormalizationMode.Adjusted);\n            var tick = enumerator.Current as Tick;\n            Assert.AreEqual(expectedFactor, _config.PriceScaleFactor);\n            Assert.AreEqual(10 * expectedFactor, tick.Price);\n            Assert.AreEqual(10 * expectedFactor, tick.Value);\n\n            // At factor file update date (2018, 3, 15)\n            _rawDataEnumerator.CurrentValue = new Tick(\n                dateAtUpadate,\n                _config.Symbol,\n                10,\n                10,\n                10);\n            Assert.IsTrue(enumerator.MoveNext());\n            var expectedFactor2 = factorFile.GetPriceFactor(dateAtUpadate, DataNormalizationMode.Adjusted);\n            var tick2 = enumerator.Current as Tick;\n            Assert.AreEqual(expectedFactor2, _config.PriceScaleFactor);\n            Assert.AreEqual(10 * expectedFactor2, tick2.Price);\n            Assert.AreEqual(10 * expectedFactor2, tick2.Value);\n\n            // After factor file update date (2018, 3, 15)\n            _rawDataEnumerator.CurrentValue = new Tick(\n                dateAfterUpadate,\n                _config.Symbol,\n                10,\n                10,\n                10);\n            Assert.IsTrue(enumerator.MoveNext());\n            var expectedFactor3 = factorFile.GetPriceFactor(dateAfterUpadate, DataNormalizationMode.Adjusted);\n            var tick3 = enumerator.Current as Tick;\n            Assert.AreEqual(expectedFactor3, _config.PriceScaleFactor);\n            Assert.AreEqual(10 * expectedFactor3, tick3.Price);\n            Assert.AreEqual(10 * expectedFactor3, tick3.Value);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void PricesAreProperlyAdjustedForLookAheadScaledRawDataNormalizationMode()\n        {\n            var factorFileEntries = new[]\n            {\n                new DateTime(2005, 02, 25),\n                new DateTime(2012, 08, 08),\n                new DateTime(2013, 05, 08),\n                new DateTime(2014, 08, 06),\n                new DateTime(2015, 08, 05)\n            };\n            var endDate = factorFileEntries.Last().AddDays(1);\n\n            var config = GetConfig(Symbols.AAPL, Resolution.Daily);\n            config.DataNormalizationMode = DataNormalizationMode.ScaledRaw;\n\n            using var enumerator = new PriceScaleFactorEnumerator(\n                _rawDataEnumerator,\n                config,\n                TestGlobals.FactorFileProvider,\n                endDate: endDate);\n\n            var price = 100m;\n            var factorFile = TestGlobals.FactorFileProvider.Get(config.Symbol);\n            var endDateFactor = factorFile.GetPriceFactor(endDate, config.DataNormalizationMode);\n\n            var performAssertions = (DateTime date) =>\n            {\n                var expectedFactor = factorFile.GetPriceFactor(date, config.DataNormalizationMode);\n                Assert.AreEqual(expectedFactor / endDateFactor, config.PriceScaleFactor);\n\n                var tradeBar = enumerator.Current as TradeBar;\n                var expectedValue = price * config.PriceScaleFactor;\n                Assert.AreEqual(expectedValue, tradeBar.Price);\n                Assert.AreEqual(expectedValue, tradeBar.Open);\n                Assert.AreEqual(expectedValue, tradeBar.Close);\n                Assert.AreEqual(expectedValue, tradeBar.High);\n                Assert.AreEqual(expectedValue, tradeBar.Low);\n                Assert.AreEqual(expectedValue, tradeBar.Value);\n\n                return expectedFactor;\n            };\n\n            foreach (var factorFileDate in factorFileEntries)\n            {\n                // before split\n                var dateBeforeSplit = factorFileDate.AddDays(-1);\n                _rawDataEnumerator.CurrentValue = new TradeBar(dateBeforeSplit, config.Symbol, price, price, price, price, price);\n                Assert.IsTrue(enumerator.MoveNext());\n                var expectedFactorBeforeSplit = performAssertions(dateBeforeSplit);\n\n                // at split\n                _rawDataEnumerator.CurrentValue = new TradeBar(factorFileDate, config.Symbol, price, price, price, price, price);\n                Assert.IsTrue(enumerator.MoveNext());\n                var expectedFactorAtSplit = performAssertions(factorFileDate);\n                Assert.AreEqual(expectedFactorBeforeSplit, expectedFactorAtSplit);\n\n                // after split\n                var dateAfterSplit = factorFileDate.AddDays(1);\n                _rawDataEnumerator.CurrentValue = new TradeBar(dateAfterSplit, config.Symbol, price, price, price, price, price);\n                Assert.IsTrue(enumerator.MoveNext());\n                var expectedFactorAfterSplit = performAssertions(dateAfterSplit);\n                Assert.AreNotEqual(expectedFactorAtSplit, expectedFactorAfterSplit);\n\n                if (factorFileDate == factorFileEntries.Last())\n                {\n                    // prices should have been adjusted to the end date prices, instead of the latest factor file entry (today),\n                    // So the last factor should be 1.\n                    Assert.AreEqual(1m, config.PriceScaleFactor);\n                }\n            }\n        }\n\n        private static SubscriptionDataConfig GetConfig(Symbol symbol, Resolution resolution)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar),\n                symbol,\n                resolution,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n        }\n\n        private class RawDataEnumerator : IEnumerator<BaseData>\n        {\n            public bool MoveNextReturnValue { get; set; }\n            public BaseData CurrentValue { get; set; }\n\n            public BaseData Current => CurrentValue;\n\n            object IEnumerator.Current => CurrentValue;\n\n            public RawDataEnumerator()\n            {\n                MoveNextReturnValue = true;\n            }\n            public bool MoveNext()\n            {\n                return MoveNextReturnValue;\n            }\n\n            public void Reset()\n            {\n                throw new NotImplementedException();\n            }\n            public void Dispose()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/QuoteBarFillForwardEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class QuoteBarFillForwardEnumeratorTests\n    {\n        [Test]\n        public void FillsForwardBidAskBars()\n        {\n            var bar1 = new QuoteBar\n            {\n                Bid = new Bar(3m, 4m, 1m, 2m),\n                Ask = new Bar(3.1m, 4.1m, 1.1m, 2.1m),\n            };\n\n            var bar2 = new QuoteBar\n            {\n                Bid = null,\n                Ask = null,\n            };\n\n            var data = new[] { bar1, bar2 }.ToList();\n            var enumerator = data.GetEnumerator();\n\n            var fillForwardEnumerator = new QuoteBarFillForwardEnumerator(enumerator);\n\n            // 9:31\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            var quoteBar1 = (QuoteBar)fillForwardEnumerator.Current;\n            Assert.AreSame(bar1.Bid, quoteBar1.Bid);\n            Assert.AreSame(bar1.Ask, quoteBar1.Ask);\n\n            // 9:32\n            Assert.IsTrue(fillForwardEnumerator.MoveNext());\n            var quoteBar2 = (QuoteBar)fillForwardEnumerator.Current;\n            Assert.AreSame(quoteBar1.Bid, quoteBar2.Bid);\n            Assert.AreSame(quoteBar1.Ask, quoteBar2.Ask);\n\n            fillForwardEnumerator.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/RateLimitEnumeratorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Globalization;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class RateLimitEnumeratorTests\n    {\n        [Test]\n        public void LimitsBasedOnTimeBetweenCalls()\n        {\n            var currentTime = new DateTime(2015, 10, 10, 13, 6, 0);\n            var timeProvider = new ManualTimeProvider(currentTime, TimeZones.Utc);\n            var data = Enumerable.Range(0, 100).Select(x => new Tick {Symbol = CreateSymbol(x)}).GetEnumerator();\n            var rateLimit = new RateLimitEnumerator<BaseData>(data, timeProvider, Time.OneSecond);\n\n            Assert.IsTrue(rateLimit.MoveNext());\n\n            while (rateLimit.MoveNext() && rateLimit.Current == null)\n            {\n                timeProvider.AdvanceSeconds(0.1);\n            }\n\n            var delta = (timeProvider.GetUtcNow() - currentTime).TotalSeconds;\n\n            Assert.AreEqual(1, delta);\n\n            Assert.AreEqual(\"1\", data.Current.Symbol.Value);\n\n            rateLimit.Dispose();\n        }\n\n        private static Symbol CreateSymbol(int x)\n        {\n            return new Symbol(\n                SecurityIdentifier.GenerateBase(null, x.ToString(CultureInfo.InvariantCulture), Market.USA),\n                 x.ToString(CultureInfo.InvariantCulture));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/RefreshEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing System.IO;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class RefreshEnumeratorTests\n    {\n        [Test]\n        public void StaleFileHandleException()\n        {\n            var fakeEnumerator = new Mock<IEnumerator<int?>>();\n            fakeEnumerator.Setup(e => e.MoveNext()).Throws(new IOException(\"stale file handle\"));\n            fakeEnumerator.Setup(e => e.Dispose()).Verifiable();\n            var refresher = new RefreshEnumerator<int?>(() => fakeEnumerator.Object);\n\n            // does not throw exception but disposes of enumerator\n            refresher.MoveNext();\n\n            fakeEnumerator.Verify(enumerator => enumerator.Dispose(), Times.Once);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void RefreshesEnumeratorOnFirstMoveNext()\n        {\n            var refreshed = false;\n            var refresher = new RefreshEnumerator<int?>(() =>\n            {\n                refreshed = true;\n                return new List<int?>().GetEnumerator();\n            });\n\n            refresher.MoveNext();\n            Assert.IsTrue(refreshed);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void MoveNextReturnsTrueWhenUnderlyingEnumeratorReturnsFalse()\n        {\n            var refresher = new RefreshEnumerator<int?>(() => new List<int?>().GetEnumerator());\n            Assert.IsTrue(refresher.MoveNext());\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void CurrentIsDefault_T_WhenUnderlyingEnumeratorReturnsFalse()\n        {\n            var refresher = new RefreshEnumerator<int?>(() => new List<int?>().GetEnumerator());\n            refresher.MoveNext();\n            Assert.AreEqual(default(int?), refresher.Current);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void UnderlyingEnumeratorDisposed_WhenUnderlyingEnumeratorReturnsFalse()\n        {\n            var fakeEnumerator = new Mock<IEnumerator<int?>>();\n            fakeEnumerator.Setup(e => e.MoveNext()).Returns(false);\n            fakeEnumerator.Setup(e => e.Dispose()).Verifiable();\n            var refresher = new RefreshEnumerator<int?>(() => fakeEnumerator.Object);\n            refresher.MoveNext();\n\n            fakeEnumerator.Verify(enumerator => enumerator.Dispose(), Times.Once);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void DisposeCallsUnderlyingDispose()\n        {\n            var fakeEnumerator = new Mock<IEnumerator<int?>>();\n            fakeEnumerator.Setup(e => e.MoveNext()).Returns(true);\n            fakeEnumerator.Setup(e => e.Dispose()).Verifiable();\n            var refresher = new RefreshEnumerator<int?>(() => fakeEnumerator.Object);\n            refresher.MoveNext();\n            refresher.Dispose();\n\n            fakeEnumerator.Verify(enumerator => enumerator.Dispose(), Times.Once);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void ResetCallsUnderlyingReset()\n        {\n            var fakeEnumerator = new Mock<IEnumerator<int?>>();\n            fakeEnumerator.Setup(e => e.MoveNext()).Returns(true);\n            fakeEnumerator.Setup(e => e.Reset()).Verifiable();\n            var refresher = new RefreshEnumerator<int?>(() => fakeEnumerator.Object);\n            refresher.MoveNext();\n            refresher.Reset();\n\n            fakeEnumerator.Verify(enumerator => enumerator.Reset(), Times.Once);\n\n            refresher.Dispose();\n        }\n\n        [Test]\n        public void RefreshesAfterMoveNextReturnsFalse()\n        {\n            var refreshCount = 0;\n            var list = new List<int?> {1, 2};\n            var refresher = new RefreshEnumerator<int?>(() =>\n            {\n                refreshCount++;\n                return list.GetEnumerator();\n            });\n\n            Assert.IsTrue(refresher.MoveNext());\n            Assert.AreEqual(1, refreshCount);\n            Assert.AreEqual(1, refresher.Current);\n\n            Assert.IsTrue(refresher.MoveNext());\n            Assert.AreEqual(1, refreshCount);\n            Assert.AreEqual(2, refresher.Current);\n\n            Assert.IsTrue(refresher.MoveNext());\n            Assert.AreEqual(1, refreshCount);\n            Assert.AreEqual(default(int?), refresher.Current);\n\n            Assert.IsTrue(refresher.MoveNext());\n            Assert.AreEqual(2, refreshCount);\n            Assert.AreEqual(1, refresher.Current);\n\n            Assert.IsTrue(refresher.MoveNext());\n            Assert.AreEqual(2, refreshCount);\n            Assert.AreEqual(2, refresher.Current);\n\n            refresher.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/ScannableEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ScannableEnumeratorTests\n    {\n        [Test]\n        public void PassesTicksStraightThrough()\n        {\n            var currentTime = new DateTime(2000, 01, 01);\n            using var identityDataConsolidator = new IdentityDataConsolidator<Tick>();\n            var enumerator = new ScannableEnumerator<Tick>(\n                identityDataConsolidator,\n                DateTimeZone.ForOffset(Offset.FromHours(-5)),\n                new ManualTimeProvider(currentTime),\n                (s, e) => { }\n            );\n\n            // returns true even if no data present until stop is called\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick1 = new Tick(currentTime, Symbols.SPY, 199.55m, 199, 200) { Quantity = 10 };\n            enumerator.Update(tick1);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(tick1, enumerator.Current);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick2 = new Tick(currentTime, Symbols.SPY, 199.56m, 199.21m, 200.02m) { Quantity = 5 };\n            enumerator.Update(tick2);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(tick2, enumerator.Current);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void NewDataAvailableShouldFire()\n        {\n            var currentTime = new DateTime(2000, 01, 01);\n            var available = false;\n            using var identityDataConsolidator = new IdentityDataConsolidator<Tick>();\n            var enumerator = new ScannableEnumerator<Tick>(\n                identityDataConsolidator,\n                DateTimeZone.ForOffset(Offset.FromHours(-5)),\n                new ManualTimeProvider(currentTime),\n                (s, e) => { available = true; }\n            );\n\n            // returns true even if no data present until stop is called\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            Assert.IsFalse(available);\n\n            var tick1 = new Tick(currentTime, Symbols.SPY, 199.55m, 199, 200) { Quantity = 10 };\n            enumerator.Update(tick1);\n            Assert.IsTrue(available);\n\n            enumerator.Dispose();\n        }\n\n        [Test]\n        public void AggregatesNewQuoteBarProperly()\n        {\n            var reference = DateTime.Today;\n\n            using var tickQuoteBarConsolidator = new TickQuoteBarConsolidator(4);\n            using var enumerator = new ScannableEnumerator<Data.BaseData>(\n                tickQuoteBarConsolidator,\n                DateTimeZone.ForOffset(Offset.FromHours(-5)),\n                new ManualTimeProvider(reference),\n                (s, e) => { }\n            );\n\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference,\n                BidPrice = 10,\n                BidSize = 20,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick1);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddMinutes(1),\n                AskPrice = 20,\n                AskSize = 10,\n                TickType = TickType.Quote\n            };\n\n            var badTick = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddMinutes(1),\n                AskPrice = 25,\n                AskSize = 100,\n                BidPrice = -100,\n                BidSize = 2,\n                Value = 50,\n                Quantity = 1234,\n                TickType = TickType.Trade\n            };\n            enumerator.Update(badTick);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            enumerator.Update(tick2);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddMinutes(2),\n                BidPrice = 12,\n                BidSize = 50,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick3);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddMinutes(3),\n                AskPrice = 17,\n                AskSize = 15,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick4);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n\n            QuoteBar quoteBar = enumerator.Current as QuoteBar;\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(Symbols.SPY, quoteBar.Symbol);\n            Assert.AreEqual(tick1.Time, quoteBar.Time);\n            Assert.AreEqual(tick4.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Low);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.High);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Close);\n            Assert.AreEqual(tick3.BidSize, quoteBar.LastBidSize);\n\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Low);\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.High);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Close);\n            Assert.AreEqual(tick4.AskSize, quoteBar.LastAskSize);\n        }\n\n        [Test]\n        public void ForceScanQuoteBar()\n        {\n            var reference = new DateTime(2020, 2, 2, 1, 0, 0);\n            var timeProvider = new ManualTimeProvider(reference);\n            var dateTimeZone = DateTimeZone.ForOffset(Offset.FromHours(-5));\n            using var tickQuoteBarConsolidator = new TickQuoteBarConsolidator(TimeSpan.FromMinutes(1));\n            using var enumerator = new ScannableEnumerator<Data.BaseData>(\n                tickQuoteBarConsolidator,\n                dateTimeZone,\n                timeProvider,\n                (s, e) => { }\n            );\n\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.ConvertFromUtc(dateTimeZone),\n                BidPrice = 10,\n                BidSize = 20,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick1);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(1).ConvertFromUtc(dateTimeZone),\n                AskPrice = 20,\n                AskSize = 10,\n                TickType = TickType.Quote\n            };\n\n            enumerator.Update(tick2);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(2).ConvertFromUtc(dateTimeZone),\n                BidPrice = 12,\n                BidSize = 50,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick3);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.AddSeconds(3).ConvertFromUtc(dateTimeZone),\n                AskPrice = 17,\n                AskSize = 15,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick4);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.AdvanceSeconds(120);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n            QuoteBar quoteBar = enumerator.Current as QuoteBar;\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(Symbols.SPY, quoteBar.Symbol);\n            Assert.AreEqual(tick1.Time, quoteBar.Time);\n            Assert.AreNotEqual(tick4.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Low);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.High);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Close);\n            Assert.AreEqual(tick3.BidSize, quoteBar.LastBidSize);\n\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Low);\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.High);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Close);\n            Assert.AreEqual(tick4.AskSize, quoteBar.LastAskSize);\n        }\n\n        [Test]\n        public void MoveNextScanQuoteBar()\n        {\n            var offset = Offset.FromHours(-5);\n            var timeZone = DateTimeZone.ForOffset(offset);\n            var utc = new DateTimeOffset(DateTime.Today);\n            var reference = utc.ToOffset(offset.ToTimeSpan());\n            var timeProvider = new ManualTimeProvider(reference.DateTime, timeZone);\n\n            using var tickQuoteBarConsolidator = new TickQuoteBarConsolidator(TimeSpan.FromMinutes(1));\n            using var enumerator = new ScannableEnumerator<Data.BaseData>(\n                tickQuoteBarConsolidator,\n                timeZone,\n                timeProvider,\n                (s, e) => { }\n            );\n\n            var tick1 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.DateTime,\n                BidPrice = 10,\n                BidSize = 20,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick1);\n\n            var tick2 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.DateTime.AddSeconds(1),\n                AskPrice = 20,\n                AskSize = 10,\n                TickType = TickType.Quote\n            };\n\n            enumerator.Update(tick2);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick3 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.DateTime.AddSeconds(2),\n                BidPrice = 12,\n                BidSize = 50,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick3);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            var tick4 = new Tick\n            {\n                Symbol = Symbols.SPY,\n                Time = reference.DateTime.AddSeconds(3),\n                AskPrice = 17,\n                AskSize = 15,\n                TickType = TickType.Quote\n            };\n            enumerator.Update(tick4);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.SetCurrentTime(reference.DateTime.AddMinutes(2));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNotNull(enumerator.Current);\n            QuoteBar quoteBar = enumerator.Current as QuoteBar;\n            Assert.IsNotNull(quoteBar);\n\n            Assert.AreEqual(Symbols.SPY, quoteBar.Symbol);\n            Assert.AreEqual(tick1.Time, quoteBar.Time);\n            Assert.AreNotEqual(tick4.EndTime, quoteBar.EndTime);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Open);\n            Assert.AreEqual(tick1.BidPrice, quoteBar.Bid.Low);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.High);\n            Assert.AreEqual(tick3.BidPrice, quoteBar.Bid.Close);\n            Assert.AreEqual(tick3.BidSize, quoteBar.LastBidSize);\n\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.Open);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Low);\n            Assert.AreEqual(tick2.AskPrice, quoteBar.Ask.High);\n            Assert.AreEqual(tick4.AskPrice, quoteBar.Ask.Close);\n            Assert.AreEqual(tick4.AskSize, quoteBar.LastAskSize);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/ScheduledEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ScheduledEnumeratorTests\n    {\n        private readonly DateTime _referenceTime = new DateTime(2019, 1, 1);\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void RespectsPredicateTimeProvider(bool newDataArrivedInTime)\n        {\n            var scheduledDate = _referenceTime.AddDays(1);\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(scheduledDate.AddDays(-1), Symbols.SPY, 1, 1)\n                })\n            };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { scheduledDate },\n                new PredicateTimeProvider(timeProvider, (currentDateTime) => {\n                    // will only let time advance after it's passed the 7/8 hour frontier\n                    return currentDateTime.TimeOfDay > TimeSpan.FromMinutes(7 * 60 + DateTime.UtcNow.Second);\n                }),\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            // still null since frontier is still behind schedule\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.SetCurrentTimeUtc(scheduledDate);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.SetCurrentTimeUtc(scheduledDate.AddHours(2));\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n\n            if (newDataArrivedInTime)\n            {\n                // New data comes in!\n                underlyingEnumerator.MoveNextNewValues.Enqueue(new Tick(scheduledDate, Symbols.SPY, 10, 10));\n            }\n\n            timeProvider.SetCurrentTimeUtc(scheduledDate.AddHours(8));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(scheduledDate, enumerator.Current.Time);\n            Assert.AreEqual(newDataArrivedInTime ? 10 : 1, (enumerator.Current as Tick).BidPrice);\n\n            // schedule ended so enumerator will end too\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void ScheduleSkipsOldDates()\n        {\n            using var testEnumerator = new TestEnumerator();\n            using var enumerator = new ScheduledEnumerator(\n                testEnumerator,\n                new List<DateTime> { _referenceTime },\n                new ManualTimeProvider(_referenceTime),\n                TimeZones.Utc,\n                _referenceTime.AddDays(1));\n\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void EmptyScheduleThrowsNoException()\n        {\n            ScheduledEnumerator enumerator = null;\n            Assert.DoesNotThrow(() => enumerator = new ScheduledEnumerator(\n                new TestEnumerator(),\n                new List<DateTime>(),\n                new ManualTimeProvider(_referenceTime),\n                TimeZones.Utc,\n                DateTime.MinValue));\n\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void ReturnsTrueEvenIfUnderlyingIsNullButReturnsTrue()\n        {\n            using var underlyingEnumerator = new TestEnumerator { MoveNextReturn = true };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { _referenceTime.AddDays(1) },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void ReturnsFalseWhenUnderlyingReturnsFalse()\n        {\n            using var underlyingEnumerator = new TestEnumerator { MoveNextReturn = false };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { _referenceTime.AddDays(1) },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void ForwardsDataToFitSchedule()\n        {\n            var scheduledDate = _referenceTime.AddDays(1);\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(scheduledDate, Symbols.SPY, 1, 1),\n                    // way in the future compared with the schedule\n                    new Tick(scheduledDate.AddYears(1), Symbols.SPY, 10, 10)\n                })\n            };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { scheduledDate, scheduledDate.AddDays(1) },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // still null since frontier is still behind schedule\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.SetCurrentTimeUtc(scheduledDate);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(scheduledDate, enumerator.Current.Time);\n            Assert.AreEqual(1, (enumerator.Current as Tick).BidPrice);\n\n            // it will forward previous available value to fit the schedule\n            timeProvider.SetCurrentTimeUtc(scheduledDate.AddDays(1));\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(scheduledDate.AddDays(1), enumerator.Current.Time);\n            Assert.AreEqual(1, (enumerator.Current as Tick).BidPrice);\n\n            // schedule ended so enumerator will end too\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void UpdatesCurrentBasedOnSchedule()\n        {\n            var scheduledDate = _referenceTime.AddDays(1);\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(scheduledDate, Symbols.SPY, 1, 1)\n                })\n            };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { scheduledDate },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // still null since frontier is still behind schedule\n            Assert.IsNull(enumerator.Current);\n\n            timeProvider.SetCurrentTimeUtc(scheduledDate);\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(scheduledDate, enumerator.Current.Time);\n            Assert.AreEqual(1, (enumerator.Current as Tick).BidPrice);\n\n            // schedule ended so enumerator will end too\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void WillUseLatestDataPoint()\n        {\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(new DateTime(2019, 1, 15), Symbols.SPY, 1, 1),\n                    new Tick(new DateTime(2019, 1, 20), Symbols.SPY, 2, 1),\n                    new Tick(new DateTime(2019, 1, 25), Symbols.SPY, 3, 1)\n                })\n            };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { new DateTime(2019, 2, 1) },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // still null since frontier is still behind schedule\n            Assert.IsNull(enumerator.Current);\n\n            // frontier is now a month after the scheduled time!\n            timeProvider.SetCurrentTimeUtc(new DateTime(2019, 3, 1));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // it uses the last available data point in the enumerator\n            Assert.AreEqual(new DateTime(2019, 2, 1), enumerator.Current.Time);\n            Assert.AreEqual(3, (enumerator.Current as Tick).BidPrice);\n\n            Assert.IsNull(underlyingEnumerator.Current);\n        }\n\n        [Test]\n        public void WillUseLatestDataPointOnlyIfBeforeOrAtSchedule()\n        {\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(new DateTime(2019, 1, 20), Symbols.SPY, 2, 1),\n                    new Tick(new DateTime(2019, 1, 25), Symbols.SPY, 3, 1),\n                    // this guys is in 2020\n                    new Tick(new DateTime(2020, 1, 1), Symbols.SPY, 4, 1)\n                })\n            };\n            var timeProvider = new ManualTimeProvider(_referenceTime);\n\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { new DateTime(2019, 2, 1), new DateTime(2020, 2, 1) },\n                timeProvider,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // still null since frontier is still behind schedule\n            Assert.IsNull(enumerator.Current);\n\n            // frontier is now a month after the scheduled time!\n            timeProvider.SetCurrentTimeUtc(new DateTime(2019, 3, 1));\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // it uses the last available data point in the enumerator that is before the schedule\n            Assert.AreEqual(new DateTime(2019, 2, 1), enumerator.Current.Time);\n            Assert.AreEqual(3, (enumerator.Current as Tick).BidPrice);\n\n            // the underlying enumerator hold the next data point\n            Assert.AreEqual(new DateTime(2020, 1, 1), underlyingEnumerator.Current.Time);\n\n            // now lets test fetching the last data point\n            timeProvider.SetCurrentTimeUtc(new DateTime(2021, 3, 1));\n\n            // the underlying will end but should still emit the data point it has\n            underlyingEnumerator.MoveNextReturn = false;\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(new DateTime(2020, 2, 1), enumerator.Current.Time);\n            Assert.AreEqual(4, (enumerator.Current as Tick).BidPrice);\n\n            Assert.IsNull(underlyingEnumerator.Current);\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        [Test]\n        public void NoTimeProvider()\n        {\n            using var underlyingEnumerator = new TestEnumerator\n            {\n                MoveNextReturn = true,\n                MoveNextNewValues = new Queue<BaseData>(new List<BaseData>\n                {\n                    new Tick(new DateTime(2019, 1, 20), Symbols.SPY, 2, 1),\n                    new Tick(new DateTime(2019, 1, 25), Symbols.SPY, 3, 1),\n\n                    new Tick(new DateTime(2020, 1, 1), Symbols.SPY, 4, 1)\n                })\n            };\n            using var enumerator = new ScheduledEnumerator(\n                underlyingEnumerator,\n                new List<DateTime> { new DateTime(2019, 2, 1), new DateTime(2020, 2, 1) },\n                null,\n                TimeZones.Utc,\n                DateTime.MinValue);\n\n            Assert.IsTrue(enumerator.MoveNext());\n            // it uses the last available data point in the enumerator that is before the schedule\n            Assert.AreEqual(new DateTime(2019, 2, 1), enumerator.Current.Time);\n            Assert.AreEqual(3, (enumerator.Current as Tick).BidPrice);\n\n            // the underlying enumerator hold the next data point\n            Assert.AreEqual(new DateTime(2020, 1, 1), underlyingEnumerator.Current.Time);\n\n            // the underlying will end but should still emit the data point it has\n            underlyingEnumerator.MoveNextReturn = false;\n\n            Assert.IsTrue(enumerator.MoveNext());\n            Assert.AreEqual(new DateTime(2020, 2, 1), enumerator.Current.Time);\n            Assert.AreEqual(4, (enumerator.Current as Tick).BidPrice);\n\n            Assert.IsNull(underlyingEnumerator.Current);\n            Assert.IsFalse(enumerator.MoveNext());\n            Assert.IsNull(enumerator.Current);\n        }\n\n        private class TestEnumerator : IEnumerator<BaseData>\n        {\n            public Queue<BaseData> MoveNextNewValues { get; set; }\n            public BaseData Current { get; private set; }\n\n            object IEnumerator.Current => Current;\n\n            public bool MoveNextReturn { get; set; }\n\n            public bool MoveNext()\n            {\n                if (MoveNextNewValues != null && MoveNextNewValues.Count > 0)\n                {\n                    Current = MoveNextNewValues.Dequeue();\n                }\n                else\n                {\n                    Current = null;\n                }\n                return MoveNextReturn;\n            }\n\n            public void Reset()\n            {}\n            public void Dispose()\n            {}\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/SubscriptionDataEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class SubscriptionDataEnumeratorTests\n    {\n\n        [TestCase(typeof(TradeBar), true)]\n        [TestCase(typeof(OpenInterest), false)]\n        [TestCase(typeof(QuoteBar), false)]\n        public void EnumeratorEmitsAuxData(Type typeOfConfig, bool shouldReceiveAuxData)\n        {\n            var config = CreateConfig(Resolution.Hour, typeOfConfig);\n            var security = GetSecurity(config);\n            var time = new DateTime(2010, 1, 1);\n            var tzOffsetProvider = new TimeZoneOffsetProvider(security.Exchange.TimeZone, time, time.AddDays(1));\n\n\n            // Make a aux data stream; for this testing case we will just use delisting data points\n            var totalPoints = 8;\n            var stream = Enumerable.Range(0, totalPoints).Select(x => new Delisting { Time = time.AddHours(x) }).GetEnumerator();\n            using var enumerator = new SubscriptionDataEnumerator(config, security.Exchange.Hours, tzOffsetProvider, stream, false, false);\n\n            // Test our SubscriptionDataEnumerator to see if it emits the aux data\n            int dataReceivedCount = 0;\n            while (enumerator.MoveNext())\n            {\n                dataReceivedCount++;\n                if (enumerator.Current != null && enumerator.Current.Data.DataType == MarketDataType.Auxiliary)\n                {\n                    Assert.IsTrue(shouldReceiveAuxData);\n                }\n            }\n\n            // If it should receive aux data it should have emitted all points\n            // otherwise none should have been emitted\n            if (shouldReceiveAuxData)\n            {\n                Assert.AreEqual(totalPoints, dataReceivedCount);\n            }\n            else\n            {\n                Assert.AreEqual(0, dataReceivedCount);\n            }\n        }\n\n\n        private static Security GetSecurity(SubscriptionDataConfig config)\n        {\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private static SubscriptionDataConfig CreateConfig(Resolution resolution, Type type)\n        {\n            return new SubscriptionDataConfig(type, Symbols.SPY, resolution, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/SynchronizingBaseDataEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class SynchronizingBaseDataEnumeratorTests\n    {\n        [Test]\n        public void SynchronizesData()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var stream1 = Enumerable.Range(0, 10).Select(x => new Tick {Time = time.AddSeconds(x * 1)}).GetEnumerator();\n            var stream2 = Enumerable.Range(0, 5).Select(x => new Tick {Time = time.AddSeconds(x * 2)}).GetEnumerator();\n            var stream3 = Enumerable.Range(0, 20).Select(x => new Tick {Time = time.AddSeconds(x * 0.5)}).GetEnumerator();\n\n            var previous = DateTime.MinValue;\n            var synchronizer = new SynchronizingBaseDataEnumerator(stream1, stream2, stream3);\n            while (synchronizer.MoveNext())\n            {\n                Assert.That(synchronizer.Current.EndTime, Is.GreaterThanOrEqualTo(previous));\n                previous = synchronizer.Current.EndTime;\n            }\n\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WontRemoveEnumeratorsReturningTrueWithCurrentNull()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var stream1 = Enumerable.Range(0, 20)\n                // return null except the last value and check if its emitted\n                .Select(x => x == 19 ? new Tick {Time = time.AddSeconds(x * 100), Quantity = 998877} : null\n            ).GetEnumerator();\n            var stream2 = Enumerable.Range(0, 5).Select(x => new Tick { Time = time.AddSeconds(x * 2) }).GetEnumerator();\n            var stream3 = Enumerable.Range(0, 20).Select(x => new Tick { Time = time.AddSeconds(x * 0.5) }).GetEnumerator();\n\n            var previous = new Tick { Time = DateTime.MinValue };\n            var synchronizer = new SynchronizingBaseDataEnumerator(stream1, stream2, stream3);\n            while (synchronizer.MoveNext())\n            {\n                Assert.That(synchronizer.Current.EndTime, Is.GreaterThanOrEqualTo(previous.EndTime));\n                previous = synchronizer.Current as Tick;\n            }\n            Assert.AreEqual(998877, previous.Quantity);\n\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillRemoveEnumeratorsReturningFalse()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var stream1 = new TestEnumerator { MoveNextReturnValue = false };\n            var stream2 = Enumerable.Range(0, 10).Select(x => new Tick { Time = time.AddSeconds(x * 2) }).GetEnumerator();\n            var synchronizer = new SynchronizingBaseDataEnumerator(stream1, stream2);\n            var emitted = false;\n            while (synchronizer.MoveNext())\n            {\n                emitted = true;\n            }\n            Assert.IsTrue(emitted);\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            Assert.AreEqual(1, stream1.MoveNextCallCount);\n\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillStopIfAllEnumeratorsCurrentIsNullAndReturningTrue()\n        {\n            var stream1 = new TestEnumerator { MoveNextReturnValue = true };\n            var synchronizer = new SynchronizingBaseDataEnumerator(stream1);\n            while (synchronizer.MoveNext())\n            {\n                Assert.Fail();\n            }\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            Assert.Pass();\n\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillStopIfAllEnumeratorsCurrentIsNullAndReturningFalse()\n        {\n            var stream1 = new TestEnumerator { MoveNextReturnValue = false };\n            var synchronizer = new SynchronizingBaseDataEnumerator(stream1);\n            while (synchronizer.MoveNext())\n            {\n                Assert.Fail();\n            }\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            Assert.Pass();\n\n            synchronizer.Dispose();\n        }\n\n        private class TestEnumerator : IEnumerator<BaseData>\n        {\n            public int MoveNextCallCount { get; set; }\n            public bool MoveNextReturnValue { get; set; }\n            public bool MoveNextWasCalled { get; set; }\n\n            public TestEnumerator()\n            {\n                MoveNextWasCalled = false;\n            }\n\n            public bool MoveNext()\n            {\n                MoveNextCallCount++;\n                MoveNextWasCalled = true;\n                return MoveNextReturnValue;\n            }\n\n            public BaseData Current { get; }\n\n            object IEnumerator.Current => Current;\n            public void Dispose() { }\n            public void Reset() { }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Enumerators/SynchronizingSliceEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Enumerators\n{\n    [TestFixture]\n    public class SynchronizingSliceEnumeratorTests\n    {\n        [Test]\n        public void SynchronizesData()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var stream1 = Enumerable.Range(0, 10).Select(x => new Slice(time.AddSeconds(x * 1), new List<BaseData>(), utcTime: time.AddSeconds(x * 1))).GetEnumerator();\n            var stream2 = Enumerable.Range(0, 5).Select(x => new Slice(time.AddSeconds(x * 2), new List<BaseData>(), utcTime: time.AddSeconds(x * 2))).GetEnumerator();\n            var stream3 = Enumerable.Range(0, 20).Select(x => new Slice(time.AddSeconds(x * 0.5), new List<BaseData>(), utcTime: time.AddSeconds(x * 0.5))).GetEnumerator();\n\n            var previous = DateTime.MinValue;\n            var synchronizer = new SynchronizingSliceEnumerator(stream1, stream2, stream3);\n            while (synchronizer.MoveNext())\n            {\n                Assert.That(synchronizer.Current.UtcTime, Is.GreaterThanOrEqualTo(previous));\n                previous = synchronizer.Current.UtcTime;\n            }\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WontRemoveEnumeratorsReturningTrueWithCurrentNull()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = time };\n            var tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = time, Open = 23 };\n            var stream1 = Enumerable.Range(0, 20)\n                // return null except the last value and check if its emitted\n                .Select(x => x == 19 ? new Slice(time.AddSeconds(x * 1), new BaseData[] { tradeBar1, tradeBar2 }, utcTime: time.AddSeconds(x * 1)) : null\n            ).GetEnumerator();\n            var stream2 = Enumerable.Range(0, 5).Select(x => new Slice(time.AddSeconds(x * 2), new List<BaseData>(), utcTime: time.AddSeconds(x * 2))).GetEnumerator();\n            var stream3 = Enumerable.Range(0, 20).Select(x => new Slice(time.AddSeconds(x * 0.5), new List<BaseData>(), utcTime: time.AddSeconds(x * 0.5))).GetEnumerator();\n\n            var previous = new Slice(DateTime.MinValue, new List<BaseData>(), DateTime.MinValue);\n            var synchronizer = new SynchronizingSliceEnumerator(stream1, stream2, stream3);\n            while (synchronizer.MoveNext())\n            {\n                Assert.That(synchronizer.Current.UtcTime, Is.GreaterThanOrEqualTo(previous.UtcTime));\n                previous = synchronizer.Current;\n            }\n            Assert.AreEqual(2, previous.Bars.Count);\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillRemoveEnumeratorsReturningFalse()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 05, 00);\n            var stream1 = new TestEnumerator { MoveNextReturnValue = false };\n            var stream2 = Enumerable.Range(0, 10).Select(x => new Slice(time.AddSeconds(x * 0.5), new List<BaseData>(), utcTime: time.AddSeconds(x * 0.5))).GetEnumerator();\n            var synchronizer = new SynchronizingSliceEnumerator(stream1, stream2);\n            var emitted = false;\n            while (synchronizer.MoveNext())\n            {\n                emitted = true;\n            }\n            Assert.IsTrue(emitted);\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            Assert.AreEqual(1, stream1.MoveNextCallCount);\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillStopIfAllEnumeratorsCurrentIsNullAndReturningTrue()\n        {\n            var stream1 = new TestEnumerator { MoveNextReturnValue = true };\n            var synchronizer = new SynchronizingSliceEnumerator(stream1);\n            while (synchronizer.MoveNext())\n            {\n                Assert.Fail();\n            }\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            synchronizer.Dispose();\n        }\n\n        [Test]\n        public void WillStopIfAllEnumeratorsCurrentIsNullAndReturningFalse()\n        {\n            var stream1 = new TestEnumerator { MoveNextReturnValue = false };\n            var synchronizer = new SynchronizingSliceEnumerator(stream1);\n            while (synchronizer.MoveNext())\n            {\n                Assert.Fail();\n            }\n            Assert.IsTrue(stream1.MoveNextWasCalled);\n            synchronizer.Dispose();\n        }\n\n        private class TestEnumerator : IEnumerator<Slice>\n        {\n            public int MoveNextCallCount { get; set; }\n            public bool MoveNextReturnValue { get; set; }\n            public bool MoveNextWasCalled { get; set; }\n\n            public TestEnumerator()\n            {\n                MoveNextWasCalled = false;\n            }\n\n            public bool MoveNext()\n            {\n                MoveNextCallCount++;\n                MoveNextWasCalled = true;\n                return MoveNextReturnValue;\n            }\n\n            public Slice Current { get; }\n\n            object IEnumerator.Current => Current;\n\n            public void Dispose()\n            { }\n\n            public void Reset()\n            { }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/FakeDataQueueTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Queues;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class FakeDataQueueTests\n    {\n        [Test]\n        public void GeneratesDataCorrectly()\n        {\n            using var aggregator = new AggregationManager();\n            var algorithm = new AlgorithmStub();\n            var dataQueue = new FakeDataQueue(aggregator, dataPointsPerSecondPerSymbol: 10);\n            algorithm.AddEquity(\"SPY\", Resolution.Second);\n            List<IEnumerator<BaseData>> enumerators = new();\n            foreach (var config in algorithm.SubscriptionManager.Subscriptions)\n            {\n                using var newDataEvent = new ManualResetEvent(false);\n                enumerators.Add(dataQueue.Subscribe(config, (_, _) => {\n                    try\n                    {\n                        newDataEvent.Set();\n                    }\n                    catch (ObjectDisposedException)\n                    {\n                    }\n                }));\n\n                Assert.IsTrue(newDataEvent.WaitOne(15000));\n\n                // let's just generate a single point\n                dataQueue.Unsubscribe(config);\n            }\n            dataQueue.Dispose();\n\n            foreach (var enumerator in enumerators)\n            {\n                // assert each data type generate data correctly\n                Assert.IsTrue(enumerator.MoveNext());\n                Assert.IsNotNull(enumerator.Current);\n\n                Log.Debug($\"FakeDataQueueTests.GeneratesDataCorrectly(): {enumerator.Current}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/FileSystemDataFeedTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class FileSystemDataFeedTests\n    {\n        [Test]\n        public void TestsFileSystemDataFeedSpeed()\n        {\n            var job = new BacktestNodePacket();\n            var resultHandler = new BacktestingResultHandler();\n\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            var feed = new FileSystemDataFeed();\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(feed,\n                new UniverseSelection(\n                    algorithm,\n                    new SecurityService(algorithm.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDataBase, algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(algorithm.Portfolio), algorithm: algorithm),\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            using var synchronizer = new Synchronizer();\n            synchronizer.Initialize(algorithm, dataManager, new());\n\n            feed.Initialize(algorithm, job, resultHandler, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider, dataManager, synchronizer, dataPermissionManager.DataChannelProvider);\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n            var count = 0;\n            var stopwatch = Stopwatch.StartNew();\n            var lastMonth = algorithm.StartDate.Month;\n            foreach (var timeSlice in synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (timeSlice.Time.Month != lastMonth)\n                {\n                    var elapsed = stopwatch.Elapsed.TotalSeconds;\n                    var thousands = count / 1000d;\n                    Log.Trace($\"{DateTime.Now} - Time: {timeSlice.Time}: KPS: {thousands / elapsed}\");\n                    lastMonth = timeSlice.Time.Month;\n                }\n                count++;\n            }\n            Log.Trace(\"Count: \" + count);\n            stopwatch.Stop();\n            feed.Exit();\n            dataManager.RemoveAllSubscriptions();\n            Log.Trace($\"Elapsed time: {stopwatch.Elapsed}   KPS: {count / 1000d / stopwatch.Elapsed.TotalSeconds}\");\n        }\n\n        [Test]\n        public void TestDataFeedEnumeratorStackSpeed()\n        {\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n\n            var resultHandler = new BacktestingResultHandler();\n            using var factory = new SubscriptionDataReaderSubscriptionEnumeratorFactory(resultHandler, TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider, TestGlobals.DataCacheProvider, algorithm, enablePriceScaling: false);\n\n            var universe = algorithm.UniverseManager.Single().Value;\n            var security = algorithm.Securities.Single().Value;\n            var securityConfig = security.Subscriptions.First();\n            var subscriptionRequest = new SubscriptionRequest(false, universe, security, securityConfig, algorithm.StartDate, algorithm.EndDate);\n            var enumerator = factory.CreateEnumerator(subscriptionRequest, TestGlobals.DataProvider);\n\n            var count = 0;\n            var stopwatch = Stopwatch.StartNew();\n            var lastMonth = algorithm.StartDate.Month;\n            while (enumerator.MoveNext())\n            {\n                var current = enumerator.Current;\n                if (current == null)\n                {\n                    Log.Trace(\"ERROR: Current is null\");\n                    continue;\n                }\n\n                if (current.Time.Month != lastMonth)\n                {\n                    var elapsed = stopwatch.Elapsed.TotalSeconds;\n                    var thousands = count / 1000d;\n                    Log.Trace($\"{DateTime.Now} - Time: {current.Time}: KPS: {thousands / elapsed}\");\n                    lastMonth = current.Time.Month;\n                }\n                count++;\n            }\n            Log.Trace(\"Count: \" + count);\n\n            stopwatch.Stop();\n            enumerator.Dispose();\n            factory.DisposeSafely();\n            Log.Trace($\"Elapsed time: {stopwatch.Elapsed}   KPS: {count / 1000d / stopwatch.Elapsed.TotalSeconds}\");\n        }\n\n        [Test]\n        public void ChecksMapFileFirstDate()\n        {\n            var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n\n            var resultHandler = new TestResultHandler();\n            using var factory = new SubscriptionDataReaderSubscriptionEnumeratorFactory(resultHandler, TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider, TestGlobals.DataCacheProvider, algorithm, enablePriceScaling: false);\n\n            var universe = algorithm.UniverseManager.Single().Value;\n            var security = algorithm.AddEquity(\"AAA\", Resolution.Daily);\n            var securityConfig = security.Subscriptions.First();\n            // start date is before the first date in the map file\n            var subscriptionRequest = new SubscriptionRequest(false, universe, security, securityConfig, new DateTime(2001, 12, 1),\n                new DateTime(2016, 11, 1));\n            var enumerator = factory.CreateEnumerator(subscriptionRequest, TestGlobals.DataProvider);\n            // should initialize the data source reader\n            enumerator.MoveNext();\n\n            enumerator.Dispose();\n            factory.DisposeSafely();\n            resultHandler.Exit();\n\n            var message = ((DebugPacket)resultHandler.Messages.Single()).Message;\n            Assert.IsTrue(message.Equals(\n                \"The starting dates for the following symbols have been adjusted to match their map files first date: [AAA, 2020-09-09]\"));\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void OptionChainEnumerator(bool fillForward)\n        {\n            var job = new BacktestNodePacket();\n            var resultHandler = new BacktestingResultHandler();\n            var feed = new FileSystemDataFeed();\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algorithm.SetStartDate(new DateTime(2014, 06, 06));\n            algorithm.SetEndDate(new DateTime(2014, 06, 09));\n\n            var optionChainProvider = new BacktestingOptionChainProvider();\n            optionChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n            algorithm.SetOptionChainProvider(optionChainProvider);\n\n            var dataPermissionManager = new DataPermissionManager();\n            using var synchronizer = new Synchronizer();\n            synchronizer.Initialize(algorithm, algorithm.DataManager, new());\n\n            feed.Initialize(algorithm, job, resultHandler, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider, algorithm.DataManager, synchronizer, dataPermissionManager.DataChannelProvider);\n            var option = algorithm.AddOption(\"AAPL\", fillForward: fillForward);\n            option.SetFilter(filter => filter.FrontMonth());\n            algorithm.PostInitialize();\n\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n            var count = 0;\n            var lastMonth = algorithm.StartDate.Month;\n            foreach (var timeSlice in synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (!timeSlice.IsTimePulse && timeSlice.UniverseData?.Count > 0 && timeSlice.Time.Date <= algorithm.EndDate)\n                {\n                    var baseDataCollection = timeSlice.UniverseData.Where(x => x.Key is OptionChainUniverse).SingleOrDefault().Value;\n                    if (baseDataCollection != null)\n                    {\n                        var nyTime = timeSlice.Time.ConvertFromUtc(algorithm.TimeZone);\n                        Assert.AreEqual(new TimeSpan(0, 0, 0), nyTime.TimeOfDay, $\"Failed on: {nyTime}\");\n\n                        Assert.AreEqual(nyTime.TimeOfDay, baseDataCollection.EndTime.ConvertFromUtc(algorithm.TimeZone).TimeOfDay);\n                        Assert.IsNotNull(baseDataCollection.FilteredContracts);\n                        CollectionAssert.IsNotEmpty(baseDataCollection.FilteredContracts);\n                        count++;\n                    }\n                }\n            }\n            feed.Exit();\n            algorithm.DataManager.RemoveAllSubscriptions();\n\n            // 2 tradable dates between 2014-06-06 and 2014-06-09 (the 6th and 9th)\n            Assert.AreEqual(2, count);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void FutureChainEnumerator(bool fillForward)\n        {\n            var job = new BacktestNodePacket();\n            var resultHandler = new BacktestingResultHandler();\n            var feed = new FileSystemDataFeed();\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algorithm.SetStartDate(new DateTime(2013, 10, 07));\n            algorithm.SetEndDate(new DateTime(2013, 10, 08));\n\n            var optionChainProvider = new BacktestingOptionChainProvider();\n            optionChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n            algorithm.SetOptionChainProvider(optionChainProvider);\n\n            var dataPermissionManager = new DataPermissionManager();\n            using var synchronizer = new Synchronizer();\n            synchronizer.Initialize(algorithm, algorithm.DataManager, new());\n\n            feed.Initialize(algorithm, job, resultHandler, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider,\n                algorithm.DataManager, synchronizer, dataPermissionManager.DataChannelProvider);\n            var future = algorithm.AddFuture(\"ES\", fillForward: fillForward, extendedMarketHours: true);\n            future.SetFilter(0, 300);\n            algorithm.PostInitialize();\n\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n            var count = 0L;\n            var lastMonth = algorithm.StartDate.Month;\n            foreach (var timeSlice in synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (!timeSlice.IsTimePulse && timeSlice.UniverseData?.Count > 0 && timeSlice.Time.Date <= algorithm.EndDate)\n                {\n                    var nyTime = timeSlice.Time.ConvertFromUtc(algorithm.TimeZone);\n                    var universeData = timeSlice.UniverseData;\n                    var chainData = universeData.Where(x => x.Key is FuturesChainUniverse).Single().Value;\n\n                    Log.Trace($\"{nyTime}. Count: {count}. Universe Data Count {universeData.Count}\");\n                    Assert.AreEqual(TimeSpan.Zero, nyTime.TimeOfDay, $\"Failed on: {nyTime}. Count: {count}\");\n                    Assert.IsTrue(timeSlice.UniverseData.All(kvp => kvp.Value.EndTime.ConvertFromUtc(algorithm.TimeZone).TimeOfDay == nyTime.TimeOfDay));\n                    if (chainData.FilteredContracts.IsNullOrEmpty())\n                    {\n                        Assert.AreEqual(new DateTime(2013, 10, 09), nyTime, $\"Unexpected chain FilteredContracts was empty on {nyTime}\");\n                    }\n\n                    if (universeData.Count == 1)\n                    {\n                        // the chain\n                        Assert.IsTrue(universeData.Any(kvp => kvp.Key.Configuration.Symbol == future.Symbol));\n                    }\n                    else\n                    {\n                        // we have 2 universe data, the chain and the continuous future\n                        Assert.AreEqual(2, universeData.Count);\n                        Assert.IsTrue(universeData.All(kvp => kvp.Key.Configuration.Symbol.SecurityType == SecurityType.Future));\n                        Assert.IsTrue(universeData.Any(kvp => kvp.Key.Configuration.Symbol == future.Symbol));\n                        Assert.IsTrue(universeData.Any(kvp => kvp.Key.Configuration.Symbol.ID.Symbol.Contains(\"CONTINUOUS\", StringComparison.InvariantCultureIgnoreCase)));\n\n                        var continuousData = universeData.Where(x => x.Key is ContinuousContractUniverse).Single().Value;\n                        Assert.AreEqual(TimeSpan.Zero, nyTime.TimeOfDay, $\"Failed on: {nyTime}\");\n                        Assert.IsTrue(!chainData.FilteredContracts.IsNullOrEmpty());\n                    }\n\n                    count++;\n                }\n            }\n            feed.Exit();\n            algorithm.DataManager.RemoveAllSubscriptions();\n\n            // 2 tradable days\n            Assert.AreEqual(2, count);\n        }\n\n        [Test]\n        public void ContinuousFutureUniverseSelectionIsPerformedOnExtendedMarketHoursDates([Values] bool extendedMarketHours)\n        {\n            var job = new BacktestNodePacket();\n            var resultHandler = new BacktestingResultHandler();\n            var feed = new FileSystemDataFeed();\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algorithm.SetStartDate(new DateTime(2019, 08, 01));\n            algorithm.SetEndDate(new DateTime(2019, 08, 08));\n\n            var dataPermissionManager = new DataPermissionManager();\n            using var synchronizer = new Synchronizer();\n            synchronizer.Initialize(algorithm, algorithm.DataManager, new());\n\n            feed.Initialize(algorithm, job, resultHandler, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider,\n                algorithm.DataManager, synchronizer, dataPermissionManager.DataChannelProvider);\n            var future = algorithm.AddFuture(\"GC\", Resolution.Daily, extendedMarketHours: extendedMarketHours);\n            algorithm.PostInitialize();\n\n            var addedSecurities = new HashSet<Symbol>();\n            var mappingCounts = 0;\n\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n            foreach (var timeSlice in synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (timeSlice.IsTimePulse) continue;\n\n                var addedSymbols = timeSlice.SecurityChanges.AddedSecurities.Select(x => x.Symbol).ToHashSet();\n\n                if (timeSlice.Slice.SymbolChangedEvents.TryGetValue(future.Symbol, out var symbolChangedEvent))\n                {\n                    mappingCounts++;\n                    var oldSymbol = algorithm.Symbol(symbolChangedEvent.OldSymbol);\n                    var newSymbol = algorithm.Symbol(symbolChangedEvent.NewSymbol);\n\n                    Assert.IsTrue(addedSecurities.Contains(oldSymbol));\n\n                    Assert.IsTrue(addedSymbols.Contains(newSymbol));\n                }\n\n                addedSecurities.UnionWith(addedSymbols);\n            }\n\n            feed.Exit();\n            algorithm.DataManager.RemoveAllSubscriptions();\n\n            var expectedMappingCounts = extendedMarketHours ? 2 : 1;\n            Assert.AreEqual(expectedMappingCounts, mappingCounts);\n        }\n\n        [Test]\n        public void DataIsFillForwardedFromWarmupToNormalFeed()\n        {\n            var job = new BacktestNodePacket();\n            var resultHandler = new BacktestingResultHandler();\n            var feed = new FileSystemDataFeed();\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            algorithm.SetStartDate(new DateTime(2013, 10, 15));\n            algorithm.SetEndDate(new DateTime(2013, 10, 16));\n\n            var dataPermissionManager = new DataPermissionManager();\n            using var synchronizer = new Synchronizer();\n            synchronizer.Initialize(algorithm, algorithm.DataManager, new());\n\n            feed.Initialize(algorithm, job, resultHandler, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider, algorithm.DataManager, synchronizer, dataPermissionManager.DataChannelProvider);\n            var equity = algorithm.AddEquity(\"SPY\", fillForward: true, dataNormalizationMode: DataNormalizationMode.Raw);\n            algorithm.SetWarmup(1000);\n            algorithm.PostInitialize();\n\n            QuoteBar lastWarmupQuoteBar = null;\n            TradeBar lastWarmupTradeBar = null;\n            QuoteBar lastQuoteBar = null;\n            TradeBar lastTradeBar = null;\n\n            using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n\n            foreach (var timeSlice in synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (!timeSlice.IsTimePulse && timeSlice.Time.Date <= algorithm.EndDate)\n                {\n                    Assert.IsTrue(timeSlice.Slice.QuoteBars.TryGetValue(equity.Symbol, out var quoteBar));\n                    Assert.IsTrue(timeSlice.Slice.Bars.TryGetValue(equity.Symbol, out var tradeBar));\n\n                    if (timeSlice.Slice.Time <= algorithm.StartDate)\n                    {\n                        lastWarmupQuoteBar = quoteBar;\n                        lastWarmupTradeBar = tradeBar;\n                    }\n                    else\n                    {\n                        lastQuoteBar = quoteBar;\n                        lastTradeBar = tradeBar;\n\n                        // We don't have local data for the start-end range, so we expect all data to be fill-forwarded\n                        Assert.IsTrue(lastQuoteBar.IsFillForward);\n                        Assert.IsTrue(lastTradeBar.IsFillForward);\n                    }\n\n                }\n            }\n            feed.Exit();\n            algorithm.DataManager.RemoveAllSubscriptions();\n\n            // Assert we actually got warmup data\n            Assert.IsNotNull(lastWarmupQuoteBar);\n            Assert.IsNotNull(lastWarmupTradeBar);\n\n            // Assert we got normal data\n            Assert.IsNotNull(lastQuoteBar);\n            Assert.IsNotNull(lastTradeBar);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/FuncDataQueueHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Packets;\nusing QuantConnect.Tests.Common.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataQueueHandler\"/> that can be specified\n    /// via a function\n    /// </summary>\n    public class FuncDataQueueHandler : IDataQueueHandler\n    {\n        private readonly HashSet<SubscriptionDataConfig> _subscriptions;\n        private readonly CancellationTokenSource _cancellationTokenSource;\n        private readonly AggregationManager _aggregationManager;\n        private readonly DataQueueHandlerSubscriptionManager _subscriptionManager;\n\n        /// <summary>\n        /// Gets the subscriptions configurations currently being managed by the queue handler\n        /// </summary>\n        public List<SubscriptionDataConfig> SubscriptionDataConfigs\n        {\n            get { lock (_subscriptions) return _subscriptions.ToList(); }\n        }\n\n        /// <summary>\n        /// Gets the subscriptions Symbols currently being managed by the queue handler\n        /// </summary>\n        public List<Symbol> Subscriptions => _subscriptionManager.GetSubscribedSymbols().ToList();\n\n        /// <summary>\n        /// Returns whether the data provider is connected\n        /// </summary>\n        /// <returns>true if the data provider is connected</returns>\n        public bool IsConnected => true;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncDataQueueHandler\"/> class\n        /// </summary>\n        /// <param name=\"getNextTicksFunction\">The functional implementation to get ticks function</param>\n        /// <param name=\"timeProvider\">The time provider to use</param>\n        public FuncDataQueueHandler(Func<FuncDataQueueHandler, IEnumerable<BaseData>> getNextTicksFunction, ITimeProvider timeProvider, IAlgorithmSettings algorithmSettings)\n        {\n            _subscriptions = new HashSet<SubscriptionDataConfig>();\n            _cancellationTokenSource = new CancellationTokenSource();\n            _aggregationManager = new TestAggregationManager(timeProvider);\n            _aggregationManager.Initialize(new DataAggregatorInitializeParameters() { AlgorithmSettings = algorithmSettings });\n            _subscriptionManager = new FakeDataQueuehandlerSubscriptionManager((t) => \"quote-trade\");\n\n            Task.Factory.StartNew(() =>\n            {\n                while (!_cancellationTokenSource.IsCancellationRequested)\n                {\n                    var emitted = false;\n                    try\n                    {\n                        foreach (var baseData in getNextTicksFunction(this))\n                        {\n                            if (_cancellationTokenSource.IsCancellationRequested)\n                            {\n                                break;\n                            }\n                            emitted = true;\n                            _aggregationManager.Update(baseData);\n                        }\n                    }\n                    catch (Exception exception)\n                    {\n                        if (exception is ObjectDisposedException)\n                        {\n                            return;\n                        }\n                        Log.Error(exception);\n                    }\n\n                    if (!emitted)\n                    {\n                        Thread.Sleep(50);\n                    }\n                    else\n                    {\n                        Thread.Sleep(10);\n                    }\n                }\n            }, TaskCreationOptions.LongRunning);\n        }\n\n        /// <summary>\n        /// Sets the job we're subscribing for\n        /// </summary>\n        /// <param name=\"job\">Job we're subscribing for</param>\n        public void SetJob(LiveNodePacket job)\n        {\n        }\n\n        /// <summary>\n        /// Adds the specified symbols to the subscription\n        /// </summary>\n        /// <param name=\"dataConfig\">defines the parameters to subscribe to a data feed</param>\n        /// <param name=\"newDataAvailableHandler\">handler to be fired on new data available</param>\n        /// <returns>The new enumerator for this subscription request</returns>\n        public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n        {\n            var enumerator = _aggregationManager.Add(dataConfig, newDataAvailableHandler);\n            lock (_subscriptions)\n            {\n                _subscriptions.Add(dataConfig);\n                _subscriptionManager.Subscribe(dataConfig);\n            }\n            return enumerator;\n        }\n\n        /// <summary>\n        /// Removes the specified configuration\n        /// </summary>\n        /// <param name=\"dataConfig\">The data config to remove</param>\n        public void Unsubscribe(SubscriptionDataConfig dataConfig)\n        {\n            lock (_subscriptions)\n            {\n                _subscriptions.Remove(dataConfig);\n                _subscriptionManager.Subscribe(dataConfig);\n            }\n            _aggregationManager.Remove(dataConfig);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            if (!_cancellationTokenSource.IsCancellationRequested)\n            {\n                _cancellationTokenSource.Cancel();\n            }\n            _aggregationManager.DisposeSafely();\n            _cancellationTokenSource.DisposeSafely();\n        }\n\n        private class TestAggregationManager : AggregationManager\n        {\n            public TestAggregationManager(ITimeProvider timeProvider)\n            {\n                TimeProvider = timeProvider;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/FuncDataQueueHandlerUniverseProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataQueueHandler\"/> and <see cref=\"IDataQueueUniverseProvider\"/>\n    /// that can be specified via functions\n    /// </summary>\n    public class FuncDataQueueHandlerUniverseProvider : FuncDataQueueHandler, IDataQueueUniverseProvider\n    {\n        private readonly Func<Symbol, bool, string, IEnumerable<Symbol>> _lookupSymbolsFunction;\n        private readonly Func<bool> _canPerformSelectionFunction;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FuncDataQueueHandlerUniverseProvider\"/> class\n        /// </summary>\n        /// <param name=\"getNextTicksFunction\">The functional implementation for the <see cref=\"FuncDataQueueHandler.GetNextTicks\"/> function</param>\n        /// <param name=\"lookupSymbolsFunction\">The functional implementation for the <see cref=\"IDataQueueUniverseProvider.LookupSymbols\"/> function</param>\n        /// <param name=\"canPerformSelectionFunction\">The functional implementation for the <see cref=\"IDataQueueUniverseProvider.CanPerformSelection\"/> function</param>\n        /// <param name=\"timeProvider\">The time provider instance to use</param>\n        public FuncDataQueueHandlerUniverseProvider(\n            Func<FuncDataQueueHandler, IEnumerable<BaseData>> getNextTicksFunction,\n            Func<Symbol, bool, string, IEnumerable<Symbol>> lookupSymbolsFunction,\n            Func<bool> canPerformSelectionFunction,\n            ITimeProvider timeProvider, IAlgorithmSettings algorithmSettings)\n            : base(getNextTicksFunction, timeProvider, algorithmSettings)\n        {\n            _lookupSymbolsFunction = lookupSymbolsFunction;\n            _canPerformSelectionFunction = canPerformSelectionFunction;\n        }\n\n        /// <summary>\n        /// Method returns a collection of Symbols that are available at the data source.\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to lookup</param>\n        /// <param name=\"includeExpired\">Include expired contracts</param>\n        /// <param name=\"securityCurrency\">Expected security currency(if any)</param>\n        /// <returns></returns>\n        public IEnumerable<Symbol> LookupSymbols(Symbol symbol, bool includeExpired, string securityCurrency = null)\n        {\n            return _lookupSymbolsFunction(symbol, includeExpired, securityCurrency);\n        }\n\n        /// <summary>\n        /// Returns whether selection can take place or not.\n        /// </summary>\n        /// <returns>True if selection can take place</returns>\n        public bool CanPerformSelection()\n        {\n            return _canPerformSelectionFunction();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/IndexSubscriptionDataSourceReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class IndexSubscriptionDataSourceReaderTests\n    {\n        private DateTime _initialDate;\n        private TestDataCacheProvider _dataCacheProvider;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _initialDate = new DateTime(2018, 1, 1);\n            _dataCacheProvider = new TestDataCacheProvider();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _dataCacheProvider.DisposeSafely();\n        }\n\n        [Test]\n        public void ThrowsIfDataIsNotIndexBased()\n        {\n            var config = new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Daily,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false);\n\n            Assert.Throws<ArgumentException>(() => new IndexSubscriptionDataSourceReader(\n                _dataCacheProvider,\n                config,\n                _initialDate,\n                false,\n                TestGlobals.DataProvider,\n                null));\n        }\n\n        [Test]\n        public void GetsIndexAndSource()\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TestIndexedBasedFactory),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n\n            var reader = new IndexSubscriptionDataSourceReader(\n                _dataCacheProvider,\n                config,\n                _initialDate,\n                false,\n                TestGlobals.DataProvider,\n                null);\n            var source = (new TradeBar()).GetSource(config, _initialDate, false);\n            _dataCacheProvider.Data = \"20000101 00:00,2,2,2,2,2\";\n            var dataBars = reader.Read(source).First();\n\n            Assert.IsNotNull(dataBars);\n            Assert.IsNotNull(dataBars.Symbol, Symbols.SPY.Value);\n            Assert.AreEqual(\"20000101 00:00,2,2,2,2,2\", TestIndexedBasedFactory.IndexLine);\n            Assert.AreEqual(\"20000101 00:00,2,2,2,2,2\", TestIndexedBasedFactory.ReaderLine);\n        }\n\n        private class TestIndexedBasedFactory : IndexedBaseData\n        {\n            public static string ReaderLine { get; set; }\n            public static string IndexLine { get; set; }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                ReaderLine = line;\n                var bar = new TradeBar();\n                return bar.Reader(config, line, date, isLiveMode);\n            }\n            public override SubscriptionDataSource GetSourceForAnIndex(SubscriptionDataConfig config, DateTime date, string index, bool isLiveMode)\n            {\n                IndexLine = index;\n                return new SubscriptionDataSource(\"\",\n                    SubscriptionTransportMedium.LocalFile,\n                    FileFormat.Csv);\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(\"\",\n                    SubscriptionTransportMedium.LocalFile,\n                    FileFormat.Csv);\n            }\n        }\n\n        private class TestDataCacheProvider : IDataCacheProvider\n        {\n            private StreamWriter _writer;\n            public string Data { set; get; }\n            public bool IsDataEphemeral => false;\n\n            public Stream Fetch(string key)\n            {\n                var stream = new MemoryStream();\n                _writer = new StreamWriter(stream);\n                _writer.Write(Data);\n                _writer.Flush();\n                stream.Position = 0;\n                return stream;\n            }\n            public void Store(string key, byte[] data)\n            {\n            }\n            public List<string> GetZipEntries(string zipFile)\n            {\n                throw new NotImplementedException();\n            }\n            public void Dispose()\n            {\n                _writer.DisposeSafely();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/InternalSubscriptionManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages.Paper;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Queues;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class InternalSubscriptionManagerTests\n    {\n        private IResultHandler _resultHandler;\n        private Synchronizer _synchronizer;\n        private DataManager _dataManager;\n        private QCAlgorithm _algorithm;\n        private IDataFeed _dataFeed;\n        private AggregationManager _aggregationManager;\n        private PaperBrokerage _paperBrokerage;\n        private ITransactionHandler _transactionHandler;\n\n        [SetUp]\n        public void Setup()\n        {\n            SetupImpl(null, null, null);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler.Exit();\n            _dataFeed.Exit();\n            _dataManager.RemoveAllSubscriptions();\n            _resultHandler.Exit();\n            _synchronizer.Dispose();\n            _aggregationManager.DisposeSafely();\n            _paperBrokerage.DisposeSafely();\n        }\n\n        [TestCaseSource(nameof(DataTypeTestCases))]\n        public void CreatesSubscriptions(SubscriptionRequest subscriptionRequest, bool liveMode, bool expectNewSubscription, bool isWarmup)\n        {\n            _algorithm.SetLiveMode(liveMode);\n            if (isWarmup)\n            {\n                _algorithm.SetWarmUp(10, Resolution.Daily);\n            }\n            _algorithm.PostInitialize();\n\n            var added = false;\n            var start = DateTime.UtcNow;\n            using var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(15));\n            foreach (var timeSlice in _synchronizer.StreamData(tokenSource.Token))\n            {\n                if (!added)\n                {\n                    _algorithm.AddSecurity(subscriptionRequest.Security.Symbol, subscriptionRequest.Configuration.Resolution);\n                }\n                else if (!timeSlice.IsTimePulse)\n                {\n                    Assert.AreEqual(\n                        expectNewSubscription,\n                        _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                            .GetSubscriptionDataConfigs(Symbols.BTCUSD, includeInternalConfigs: true).Any(config => config.IsInternalFeed)\n                    );\n\n                    if (expectNewSubscription)\n                    {\n                        var utcStartTime = _dataManager.DataFeedSubscriptions\n                            .Where(subscription => subscription.Configuration.IsInternalFeed && subscription.Configuration.Symbol == Symbols.BTCUSD)\n                            .Select(subscription => subscription.UtcStartTime)\n                            .First();\n                        Assert.Greater(utcStartTime.Ticks, start.Ticks);\n\n                        // let's wait for a data point\n                        if (timeSlice.DataPointCount > 0)\n                        {\n                            break;\n                        }\n\n                        if (DateTime.UtcNow - start > TimeSpan.FromSeconds(5))\n                        {\n                            Assert.Fail(\"Timeout waiting for data point\");\n                        }\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n                _algorithm.OnEndOfTimeStep();\n                if (!added)\n                {\n                    added = true;\n                    // give time for the base exchange to pick up the data point that will trigger the universe selection\n                    // so next step we assert the internal config is there\n                    Thread.Sleep(100);\n                }\n                else\n                {\n                    Thread.Sleep(10);\n                }\n            }\n            Assert.IsFalse(tokenSource.IsCancellationRequested);\n            tokenSource.DisposeSafely();\n        }\n\n        [TestCaseSource(nameof(DataTypeTestCases))]\n        public void RemoveSubscriptions(SubscriptionRequest subscriptionRequest, bool liveMode, bool expectNewSubscription, bool isWarmup)\n        {\n            if (!expectNewSubscription)\n            {\n                // we only test cases where we expect an internal subscription\n                return;\n            }\n            _algorithm.SetLiveMode(liveMode);\n            if (isWarmup)\n            {\n                _algorithm.SetWarmUp(10, Resolution.Daily);\n            }\n            _algorithm.PostInitialize();\n            var added = false;\n            var shouldRemoved = false;\n            var count = 0;\n            using var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(15));\n            foreach (var timeSlice in _synchronizer.StreamData(tokenSource.Token))\n            {\n                if (!added)\n                {\n                    _algorithm.AddSecurity(subscriptionRequest.Security.Symbol, subscriptionRequest.Configuration.Resolution);\n                }\n                else if (!timeSlice.IsTimePulse && !shouldRemoved)\n                {\n                    Assert.IsTrue(_algorithm.SubscriptionManager.SubscriptionDataConfigService\n                            .GetSubscriptionDataConfigs(Symbols.BTCUSD, includeInternalConfigs: true).Any());\n\n                    _algorithm.RemoveSecurity(subscriptionRequest.Security.Symbol);\n                    shouldRemoved = true;\n                }\n                else if (!timeSlice.IsTimePulse && shouldRemoved)\n                {\n                    var result = _algorithm.SubscriptionManager.SubscriptionDataConfigService\n                        .GetSubscriptionDataConfigs(Symbols.BTCUSD, includeInternalConfigs: true).Any(config => config.IsInternalFeed);\n                    // can take some extra loop till the base exchange thread picks up the data point that will trigger the universe selection\n                    if (!result || count++ > 5)\n                    {\n                        Assert.IsFalse(result);\n                    }\n                    break;\n                }\n                _algorithm.OnEndOfTimeStep();\n                if (!added)\n                {\n                    added = true;\n                    // give time for the base exchange to pick up the data point that will trigger the universe selection\n                    // so next step we assert the internal config is there\n                    Thread.Sleep(100);\n                }\n                else\n                {\n                    Thread.Sleep(10);\n                }\n            }\n            Assert.IsFalse(tokenSource.IsCancellationRequested);\n        }\n\n        [Test]\n        public void PreMarketDataSetsCache()\n        {\n            var dataQueueTest = new FakeDataQueueTest();\n            dataQueueTest.ManualTimeProvider.SetCurrentTimeUtc(new DateTime(2020, 09, 03, 10, 0, 0));\n            TearDown();\n            var liveSynchronizer = new TestableLiveSynchronizer(dataQueueTest.ManualTimeProvider);\n            using var dataAggregator = new TestAggregationManager(dataQueueTest.ManualTimeProvider);\n            SetupImpl(dataQueueTest, liveSynchronizer, dataAggregator);\n\n            _algorithm.SetDateTime(dataQueueTest.ManualTimeProvider.GetUtcNow());\n            _algorithm.SetLiveMode(true);\n            _algorithm.PostInitialize();\n            var added = false;\n            var first = true;\n            var internalDataCount = 0;\n            using var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));\n            foreach (var timeSlice in _synchronizer.StreamData(tokenSource.Token))\n            {\n                dataQueueTest.ManualTimeProvider.AdvanceSeconds(60);\n                _algorithm.SetDateTime(dataQueueTest.ManualTimeProvider.GetUtcNow());\n                if (dataQueueTest.ManualTimeProvider.GetUtcNow() >= new DateTime(2020, 09, 03, 13, 0, 0))\n                {\n                    Assert.Fail(\"Timeout expect pre market data to set security prices\");\n                }\n                if (!added)\n                {\n                    _algorithm.AddEquity(\"IBM\", Resolution.Minute);\n                    _algorithm.AddEquity(\"AAPL\", Resolution.Hour);\n                }\n                else if (!timeSlice.IsTimePulse)\n                {\n                    if (timeSlice.SecuritiesUpdateData.Count > 0)\n                    {\n                        internalDataCount += timeSlice.SecuritiesUpdateData.Count(\n                            data => data.IsInternalConfig && data.Target.Symbol == Symbols.AAPL\n                        );\n                    }\n                    if (first)\n                    {\n                        Assert.IsTrue(_algorithm.SubscriptionManager.SubscriptionDataConfigService\n                            .GetSubscriptionDataConfigs(Symbols.AAPL, includeInternalConfigs: true).Any(config => config.Resolution == Resolution.Second));\n                        Assert.IsFalse(_algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.IBM, includeInternalConfigs: true)\n                            .Any(config => config.IsInternalFeed && config.Resolution == Resolution.Second));\n                        first = false;\n                    }\n                    else if(_algorithm.Securities[\"AAPL\"].Price != 0 && _algorithm.Securities[\"IBM\"].Price != 0)\n                    {\n                        #pragma warning disable CS0618\n                        _algorithm.SetHoldings(\"AAPL\", 0.01);\n                        _algorithm.SetHoldings(\"IBM\", 0.01);\n\n                        var orders = _algorithm.Transactions.GetOpenOrders(\"AAPL\");\n                        Assert.AreEqual(1, orders.Count);\n                        Assert.AreEqual(Symbols.AAPL, orders[0].Symbol);\n                        Assert.AreEqual(OrderStatus.Submitted, orders[0].Status);\n\n                        orders = _algorithm.Transactions.GetOpenOrders(\"IBM\");\n                        #pragma warning restore CS0618\n                        Assert.AreEqual(1, orders.Count);\n                        Assert.AreEqual(Symbols.IBM, orders[0].Symbol);\n                        Assert.AreEqual(OrderStatus.Submitted, orders[0].Status);\n                        break;\n                    }\n                }\n                _algorithm.OnEndOfTimeStep();\n                if (!added)\n                {\n                    added = true;\n                    Thread.Sleep(100);\n                }\n                else\n                {\n                    Thread.Sleep(10);\n                }\n            }\n            Assert.IsFalse(tokenSource.IsCancellationRequested);\n            Assert.AreNotEqual(0, internalDataCount);\n        }\n\n        [Test, Category(\"TravisExclude\")]\n        public void UniverseSelectionAddAndRemove()\n        {\n            _algorithm.SetLiveMode(true);\n            _algorithm.PostInitialize();\n            _algorithm.UniverseSettings.Resolution = Resolution.Hour;\n            _algorithm.UniverseSettings.MinimumTimeInUniverse = TimeSpan.Zero;\n            var added = false;\n            using var manualEvent = new ManualResetEvent(false);\n            using var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(15));\n            foreach (var timeSlice in _synchronizer.StreamData(tokenSource.Token))\n            {\n                if (!added)\n                {\n                    _algorithm.AddUniverse(SecurityType.Equity,\n                            \"AUniverse\",\n                            Resolution.Second,\n                            Market.USA,\n                            _algorithm.UniverseSettings,\n                            time =>\n                            {\n                                return !manualEvent.WaitOne(0) ? new[] { \"IBM\" } : new[] { \"AAPL\" };\n                            }\n                    );\n                }\n                else if (!timeSlice.IsTimePulse)\n                {\n                    if (!manualEvent.WaitOne(0))\n                    {\n                        Assert.IsTrue(_algorithm.SubscriptionManager.SubscriptionDataConfigService\n                            .GetSubscriptionDataConfigs(Symbols.IBM, includeInternalConfigs: true).Any(config => config.Resolution == Resolution.Second),\n                            \"IBM subscription was not found\");\n                        Assert.IsFalse(_algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.AAPL, includeInternalConfigs: true).Any(),\n                            \"Unexpected AAPL subscription was found\");\n                        manualEvent.Set();\n                    }\n                    else\n                    {\n                        Assert.IsTrue(_algorithm.SubscriptionManager.SubscriptionDataConfigService\n                            .GetSubscriptionDataConfigs(Symbols.AAPL, includeInternalConfigs: true).Any(config => config.Resolution == Resolution.Second),\n                            \"AAPL subscription was not found\");\n                        Assert.IsFalse(_algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(Symbols.IBM, includeInternalConfigs: true).Any(),\n                            \"Unexpected IBM subscription was found\");\n                        break;\n                    }\n                }\n                _algorithm.OnEndOfTimeStep();\n                if (!added)\n                {\n                    added = true;\n                    // we need to give time for the base data exchange to pick up the new data point which will trigger the selection\n                    Thread.Sleep(100);\n                }\n                else\n                {\n                    Thread.Sleep(10);\n                }\n            }\n            Assert.IsFalse(tokenSource.IsCancellationRequested, \"Test timed out\");\n        }\n\n        private static TestCaseData[] DataTypeTestCases\n        {\n            get\n            {\n                var result = new List<TestCaseData>();\n                var config = GetConfig(Symbols.BTCUSD, Resolution.Second);\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), true, false, false));\n\n                config = GetConfig(Symbols.BTCUSD, Resolution.Minute);\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), true, false, false));\n\n                config = GetConfig(Symbols.BTCUSD, Resolution.Hour);\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), true, true, false));\n\n                config = GetConfig(Symbols.BTCUSD, Resolution.Daily);\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), true, true, false));\n\n                config = GetConfig(Symbols.BTCUSD, Resolution.Daily);\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), true, true, true));\n\n                result.Add(new TestCaseData(new SubscriptionRequest(false, null, CreateSecurity(config), config, DateTime.UtcNow, DateTime.UtcNow), false, false, false));\n\n                return result.ToArray();\n            }\n        }\n\n        private static Security CreateSecurity(SubscriptionDataConfig config)\n        {\n            return new Security(SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private static SubscriptionDataConfig GetConfig(Symbol symbol, Resolution resolution)\n        {\n            return new SubscriptionDataConfig(typeof(TradeBar), symbol, resolution, TimeZones.Utc, TimeZones.Utc, false, false, false);\n        }\n\n        private class FakeDataQueueTest : FakeDataQueue\n        {\n            public ManualTimeProvider ManualTimeProvider { get; } = new ManualTimeProvider();\n\n            protected override ITimeProvider TimeProvider => ManualTimeProvider;\n        }\n\n        private void SetupImpl(IDataQueueHandler dataQueueHandler, Synchronizer synchronizer, IDataAggregator dataAggregator)\n        {\n            _algorithm = new AlgorithmStub(createDataManager: false);\n            _aggregationManager = new AggregationManager();\n            _dataFeed = new TestableLiveTradingDataFeed(_algorithm.Settings, dataQueueHandler ?? new FakeDataQueue(dataAggregator ?? _aggregationManager));\n            _synchronizer = synchronizer ?? new LiveSynchronizer();\n            _algorithm.SetStartDate(new DateTime(2022, 04, 13));\n\n            var registeredTypesProvider = new RegisteredSecurityDataTypesProvider();\n            var securityService = new SecurityService(_algorithm.Portfolio.CashBook,\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                _algorithm,\n                registeredTypesProvider,\n                new SecurityCacheProvider(_algorithm.Portfolio),\n                algorithm: _algorithm);\n            var universeSelection = new UniverseSelection(\n                _algorithm,\n                securityService,\n                new DataPermissionManager(),\n                TestGlobals.DataProvider,\n                Resolution.Second);\n            _dataManager = new DataManager(_dataFeed, universeSelection, _algorithm, new TimeKeeper(DateTime.UtcNow, TimeZones.NewYork),\n                MarketHoursDatabase.FromDataFolder(),\n                true,\n                new RegisteredSecurityDataTypesProvider(),\n                new DataPermissionManager());\n            _resultHandler = new TestResultHandler();\n            _synchronizer.Initialize(_algorithm, _dataManager, new());\n            _dataFeed.Initialize(_algorithm,\n                new LiveNodePacket(),\n                _resultHandler,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                TestGlobals.DataProvider,\n                _dataManager,\n                _synchronizer,\n                new DataChannelProvider());\n            _algorithm.SubscriptionManager.SetDataManager(_dataManager);\n            _algorithm.Securities.SetSecurityService(securityService);\n            var backtestingTransactionHandler = new BacktestingTransactionHandler();\n            _paperBrokerage = new PaperBrokerage(_algorithm, new LiveNodePacket());\n            backtestingTransactionHandler.Initialize(_algorithm, _paperBrokerage, _resultHandler);\n            _algorithm.Transactions.SetOrderProcessor(backtestingTransactionHandler);\n\n            if (_transactionHandler != null)\n            {\n                _transactionHandler.Exit();\n            }\n            _transactionHandler = backtestingTransactionHandler;\n        }\n        private class TestAggregationManager : AggregationManager\n        {\n            public TestAggregationManager(ITimeProvider timeProvider)\n            {\n                TimeProvider = timeProvider;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/LiveCoarseUniverseTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class LiveCoarseUniverseTests\n    {\n        [Test]\n        public void CoarseUniverseRotatesActiveSecurity()\n        {\n            var startDate = new DateTime(2014, 3, 24);\n            var endDate = new DateTime(2014, 3, 31);\n\n            var timeProvider = new ManualTimeProvider(TimeZones.NewYork);\n            timeProvider.SetCurrentTime(startDate);\n\n            var coarseTimes = new List<DateTime>\n            {\n                // coarse files go from the 24th (Monday) to the 28th (Friday)\n                // they are emitted in the next day, excluding saturday\n                new DateTime(2014, 3, 25, 5, 0, 0, 0),\n                new DateTime(2014, 3, 26, 5, 0, 0, 0),\n                new DateTime(2014, 3, 27, 5, 0, 0, 0),\n                new DateTime(2014, 3, 28, 5, 0, 0, 0),\n                // 29th is Saturday\n                new DateTime(2014, 3, 30, 5, 0, 0, 0)\n            }.ToHashSet();\n\n            var coarseSymbols = new List<Symbol> { Symbols.SPY, Symbols.AAPL, Symbols.MSFT };\n\n            using var emitted = new AutoResetEvent(false);\n            using var dataQueueHandler = new FuncDataQueueHandler(fdqh => Enumerable.Empty<BaseData>(), timeProvider, new AlgorithmSettings());\n\n            var feed = new TestableLiveTradingDataFeed(new AlgorithmSettings(), dataQueueHandler);\n\n            var algorithm = new AlgorithmStub(feed);\n            algorithm.SetLiveMode(true);\n\n            var mock = new Mock<ITransactionHandler>();\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algorithm.Transactions.SetOrderProcessor(mock.Object);\n\n            using var synchronizer = new TestableLiveSynchronizer(timeProvider);\n            synchronizer.Initialize(algorithm, algorithm.DataManager, new());\n\n            feed.Initialize(algorithm, new LiveNodePacket(), new BacktestingResultHandler(),\n                TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider, algorithm.DataManager, synchronizer, new DataChannelProvider());\n\n            var symbolIndex = 0;\n            var coarseUniverseSelectionCount = 0;\n            algorithm.AddUniverse(\n                coarse =>\n                {\n                    Log.Trace($\"Emitted at {algorithm.Time}. Coarse {coarse.First().Time} to {coarse.First().EndTime}\");\n                    Interlocked.Increment(ref coarseUniverseSelectionCount);\n                    emitted.Set();\n\n                    // rotate single symbol in universe\n                    if (symbolIndex == coarseSymbols.Count) symbolIndex = 0;\n\n                    return new[] { coarseSymbols[symbolIndex++] };\n                });\n\n            algorithm.PostInitialize();\n\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            Exception exceptionThrown = null;\n\n            // create a timer to advance time much faster than realtime\n            var timerInterval = TimeSpan.FromMilliseconds(5);\n            var timer = Ref.Create<Timer>(null);\n            timer.Value = new Timer(state =>\n            {\n                try\n                {\n                    var currentTime = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n\n                    if (currentTime.Date > endDate.Date)\n                    {\n                        feed.Exit();\n                        cancellationTokenSource.Cancel();\n                        return;\n                    }\n\n                    timeProvider.Advance(TimeSpan.FromHours(1));\n\n                    var time = timeProvider.GetUtcNow().ConvertFromUtc(TimeZones.NewYork);\n                    algorithm.SetDateTime(timeProvider.GetUtcNow());\n                    if (coarseTimes.Contains(time))\n                    {\n                        // lets wait for coarse to emit\n                        if (!emitted.WaitOne(TimeSpan.FromMilliseconds(15000)))\n                        {\n                            throw new TimeoutException($\"Timeout waiting for coarse to emit at {time}\");\n                        }\n                    }\n                    var activeSecuritiesCount = algorithm.ActiveSecurities.Count;\n\n                    Assert.That(activeSecuritiesCount <= 1);\n\n                    // restart the timer\n                    timer.Value.Change(timerInterval, Timeout.InfiniteTimeSpan);\n                }\n                catch (Exception exception)\n                {\n                    Log.Error(exception);\n                    exceptionThrown = exception;\n\n                    feed.Exit();\n                    cancellationTokenSource.Cancel();\n                }\n\n            }, null, timerInterval, Timeout.InfiniteTimeSpan);\n\n            foreach (var _ in synchronizer.StreamData(cancellationTokenSource.Token)) { }\n\n            timer.Value.DisposeSafely();\n            algorithm.DataManager.RemoveAllSubscriptions();\n\n            if (exceptionThrown != null)\n            {\n                throw new RegressionTestException(\"Exception in timer: \", exceptionThrown);\n            }\n\n            Assert.AreEqual(coarseTimes.Count, coarseUniverseSelectionCount, message: \"coarseUniverseSelectionCount\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/LiveTradingDataFeedTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing Microsoft.CodeAnalysis;\nusing Moq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Logging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Util;\nusing static QuantConnect.Tests.Engine.DataFeeds.Enumerators.LiveSubscriptionEnumeratorTests;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class LiveTradingDataFeedTests\n    {\n        private static bool LogsEnabled = false; // this is for travis log not to fill up and reach the max size.\n        private ManualTimeProvider _manualTimeProvider;\n        private AlgorithmStub _algorithm;\n        private TestableLiveSynchronizer _synchronizer;\n        private DateTime _startDate;\n        private TestableLiveTradingDataFeed _feed;\n        private DataManager _dataManager;\n        private FuncDataQueueHandler _dataQueueHandler;\n        private static readonly Dictionary<Type, BaseData> _instances = new Dictionary<Type, BaseData>\n        {\n            {typeof(BaseData), typeof(TradeBar).GetBaseDataInstance() },\n            {typeof(IndexedLinkedData), typeof(IndexedLinkedData).GetBaseDataInstance() },\n            {typeof(IndexedLinkedData2), typeof(IndexedLinkedData2).GetBaseDataInstance() },\n        };\n\n        [SetUp]\n        public void SetUp()\n        {\n            _manualTimeProvider = new ManualTimeProvider();\n            _algorithm = new AlgorithmStub(false);\n            _startDate = new DateTime(2018, 08, 1, 11, 0, 0);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            CustomMockedFileBaseData.StartDate = _startDate;\n\n            Interlocked.Exchange(ref TestCustomData.ReaderCallsCount, 0);\n            TestCustomData.ReturnNull = false;\n            TestCustomData.ThrowException = false;\n\n            FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProviderTrue(), false);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _dataManager?.RemoveAllSubscriptions();\n            _feed?.Exit();\n            _synchronizer.DisposeSafely();\n            _dataQueueHandler?.DisposeSafely();\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void EmitsStreamedDailyData(bool strictEndTimes)\n        {\n            _startDate = new DateTime(2014, 3, 27, 14, 0, 0);\n            _algorithm.SetStartDate(_startDate);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate.ConvertToUtc(TimeZones.NewYork));\n\n            var symbol = Symbols.SPY;\n            _algorithm.Settings.DailyPreciseEndTime = strictEndTimes;\n            _algorithm.SetBenchmark(x => 1);\n\n            var dqh = new TestDataQueueHandler\n            {\n                DataPerSymbol = new Dictionary<Symbol, List<BaseData>>\n                {\n                    {\n                        symbol, new List<BaseData> { new TradeBar(_algorithm.StartDate, symbol, 1, 5, 1, 3, 100, Time.OneDay) }\n                    }\n                }\n            };\n            var feed = RunDataFeed(Resolution.Daily, dataQueueHandler: dqh, equities: new() { \"SPY\" });\n            _algorithm.OnEndOfTimeStep();\n\n            DateTime emittedDataTime = default;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    var data = ts.Slice[Symbols.SPY];\n                    if (data == null)\n                    {\n                        return;\n                    }\n                    emittedDataTime = _algorithm.Time;\n                    // short cut\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, endDate: _startDate.AddDays(1),\n            secondsTimeStep: 60 * 10);\n\n            Assert.AreEqual(strictEndTimes ? _startDate.Date.AddHours(16) : _startDate.Date.AddDays(1), emittedDataTime);\n        }\n\n        [TestCase(false, true)]\n        [TestCase(true, true)]\n        [TestCase(false, false)]\n        [TestCase(true, false)]\n        public void EmitsLeanAggregatedDailyData(bool strictEndTimes, bool warmup)\n        {\n            _startDate = new DateTime(2014, 3, 27, 10, 0, 0);\n            _algorithm.Settings.DailyPreciseEndTime = strictEndTimes;\n            _algorithm.SetStartDate(_startDate);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate.ConvertToUtc(TimeZones.NewYork));\n            var endDate = _startDate.AddDays(1);\n\n            _algorithm.SetBenchmark(x => 1);\n            if (warmup)\n            {\n                _algorithm.SetWarmUp(TimeSpan.FromDays(2));\n            }\n            var feed = RunDataFeed();\n            _algorithm.AddEquity(\"SPY\", Resolution.Daily);\n            _algorithm.OnEndOfTimeStep();\n\n            List<DateTime> emittedDataTime = new();\n            List<BaseData> emittedData = new();\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    var data = ts.Slice[Symbols.SPY];\n                    if (data == null)\n                    {\n                        return;\n                    }\n                    emittedDataTime.Add(_algorithm.Time);\n                    emittedData.Add(data);\n\n                    if (warmup && emittedData.Count == 3 || !warmup && emittedData.Count == 1)\n                    {\n                        // short cut\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            for (var i = 0; i < emittedDataTime.Count; i++)\n            {\n                Assert.AreEqual(emittedDataTime[i], emittedData[i].EndTime);\n            }\n\n            if (warmup)\n            {\n                Assert.AreEqual(3, emittedData.Count);\n                Assert.AreEqual(strictEndTimes ? _startDate.Date.AddDays(-2).AddHours(16) : _startDate.Date.AddDays(-1), emittedData[0].EndTime);\n                Assert.AreEqual(strictEndTimes ? _startDate.Date.AddDays(-1).AddHours(16) : _startDate.Date, emittedData[1].EndTime);\n            }\n            else\n            {\n                Assert.AreEqual(1, emittedData.Count);\n            }\n            Assert.AreEqual(strictEndTimes ? _startDate.Date.AddHours(16) : _startDate.Date.AddDays(1), emittedData.Last().EndTime);\n        }\n\n        [TestCase(SecurityType.Option, Resolution.Daily, 7, true)]\n        [TestCase(SecurityType.Future, Resolution.Daily, 11, true)]\n        [TestCase(SecurityType.IndexOption, Resolution.Daily, 14, true)]\n        [TestCase(SecurityType.Option, Resolution.Daily, 14, true)]\n        [TestCase(SecurityType.Future, Resolution.Daily, 120, true)]\n\n        [TestCase(SecurityType.Option, Resolution.Daily, 7, false)]\n        [TestCase(SecurityType.Future, Resolution.Daily, 11, false)]\n        [TestCase(SecurityType.IndexOption, Resolution.Daily, 14, false)]\n        [TestCase(SecurityType.Option, Resolution.Hour, 7, false)]\n        [TestCase(SecurityType.Future, Resolution.Hour, 11, false)]\n        [TestCase(SecurityType.IndexOption, Resolution.Hour, 14, false)]\n        [TestCase(SecurityType.Option, Resolution.Minute, 7, false)]\n        [TestCase(SecurityType.Future, Resolution.Minute, 11, false)]\n        [TestCase(SecurityType.IndexOption, Resolution.Minute, 14, false)]\n        [TestCase(SecurityType.Option, Resolution.Second, 7, false)]\n        [TestCase(SecurityType.Future, Resolution.Second, 11, false)]\n        [TestCase(SecurityType.IndexOption, Resolution.Second, 14, false)]\n        [TestCase(SecurityType.Option, Resolution.Tick, 7, false)]\n        [TestCase(SecurityType.Future, Resolution.Tick, 11, false)]\n        [TestCase(SecurityType.IndexOption, Resolution.Tick, 14, false)]\n        [TestCase(SecurityType.Option, Resolution.Daily, 14, false)]\n        [TestCase(SecurityType.Future, Resolution.Daily, 120, false)]\n        [TestCase(SecurityType.Option, Resolution.Hour, 14, false)]\n        [TestCase(SecurityType.Future, Resolution.Hour, 120, false)]\n        [TestCase(SecurityType.Option, Resolution.Minute, 14, false)]\n        [TestCase(SecurityType.Future, Resolution.Minute, 120, false)]\n        [TestCase(SecurityType.Option, Resolution.Second, 14, false)]\n        [TestCase(SecurityType.Future, Resolution.Second, 120, false)]\n        [TestCase(SecurityType.Option, Resolution.Tick, 14, false)]\n        [TestCase(SecurityType.Future, Resolution.Tick, 120, false)]\n        public void LiveChainSelection(SecurityType securityType, Resolution resolution, int expirationDatesFilter, bool strictEndTimes)\n        {\n            _startDate = securityType == SecurityType.IndexOption ? new DateTime(2021, 1, 4) : new DateTime(2014, 6, 9);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            var endDate = _startDate.AddDays(securityType == SecurityType.Future ? 5 : 1);\n\n            _algorithm.SetBenchmark(x => 1);\n            _algorithm.Settings.DailyPreciseEndTime = strictEndTimes;\n\n            var feed = RunDataFeed();\n\n            var selectionHappened = 0;\n            if (securityType.IsOption())\n            {\n                var chainAsset = securityType == SecurityType.Option\n                    ? _algorithm.AddOption(\"AAPL\", resolution)\n                    : _algorithm.AddIndexOption(\"SPX\", resolution);\n                chainAsset.SetFilter(x =>\n                {\n                    selectionHappened++;\n                    var count = 0;\n                    var symbols = x.Expiration(0, expirationDatesFilter).IncludeWeeklys().OnlyApplyFilterAtMarketOpen().Where(x => count++ < 2).ToList();\n                    Assert.AreEqual(2, symbols.Count);\n                    return x;\n                });\n            }\n            else\n            {\n                var chainAsset = _algorithm.AddFuture(\"ES\", resolution);\n                chainAsset.SetFilter(x =>\n                {\n                    selectionHappened++;\n                    var symbols = x.Expiration(0, expirationDatesFilter).IncludeWeeklys().ToList();\n                    Assert.AreEqual(expirationDatesFilter < 30 ? 1 : 2, symbols.Count);\n                    return x;\n                });\n            }\n            _algorithm.OnEndOfTimeStep();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (selectionHappened == 2)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            var expectedSelections = securityType == SecurityType.Future ? 2 : 1;\n            Assert.AreEqual(expectedSelections, selectionHappened);\n        }\n\n        [Test]\n        public void ContinuousFuturesImmediateSelection()\n        {\n            _startDate = new DateTime(2013, 10, 7, 0, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var esSelectionTime = DateTime.MinValue;\n            var esFuture = _algorithm.AddFuture(\"ES\", Resolution.Minute, extendedMarketHours: true);\n            esFuture.SetFilter(x =>\n            {\n                esSelectionTime = x.LocalTime.ConvertToUtc(esFuture.Exchange.TimeZone);\n\n                Assert.IsNotEmpty(x);\n\n                return x;\n            });\n\n            // ES future time zone is Hong kong while ES is New York, we need to assert that both selection happen right away\n            var hsiSelectionTime = DateTime.MinValue;\n            var hsiFuture = _algorithm.AddFuture(\"HSI\", Resolution.Minute, extendedMarketHours: true);\n            hsiFuture.SetFilter(x =>\n            {\n                hsiSelectionTime = x.LocalTime.ConvertToUtc(hsiFuture.Exchange.TimeZone);\n\n                Assert.IsNotEmpty(x);\n\n                return x;\n            });\n\n            _algorithm.PostInitialize();\n\n            Assert.IsNull(esFuture.Mapped);\n            Assert.IsNull(hsiFuture.Mapped);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (esFuture.Mapped != null && hsiFuture.Mapped != null\n                    && hsiSelectionTime != DateTime.MinValue && esSelectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            // Continuous futures should select the first contract immediately\n            Assert.IsNotNull(esFuture.Mapped);\n            Assert.IsNotNull(hsiFuture.Mapped);\n\n            Assert.AreEqual(startDateUtc.Date, esSelectionTime.Date);\n            Assert.AreEqual(startDateUtc.Date, hsiSelectionTime.Date);\n\n            Assert.AreEqual(3, timeSliceCount);\n        }\n\n        [Test]\n        public void ETFsImmediateSelection()\n        {\n            _startDate = new DateTime(2020, 12, 1, 1, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var spy = _algorithm.AddEquity(\"SPY\").Symbol;\n\n            var selectionTime = DateTime.MinValue;\n            List<Symbol> constituents = null;\n\n            var universe = _algorithm.AddUniverse(_algorithm.Universe.ETF(spy, constituentsData =>\n            {\n                selectionTime = _algorithm.UtcTime;\n                constituents = constituentsData.Select(x => x.Symbol).ToList();\n                return constituents;\n            }));\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreEqual(startDateUtc, selectionTime);\n            Assert.AreEqual(1, timeSliceCount);\n\n            Assert.IsNotNull(constituents);\n            Assert.IsNotEmpty(constituents);\n\n            CollectionAssert.AreEquivalent(constituents, universe.Members.Keys);\n\n            // The algorithm's security collection has all constituents and SPY (added manually)\n            constituents.Add(spy);\n            CollectionAssert.AreEquivalent(constituents, _algorithm.Securities.Keys);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void FundamentalScheduleSelection(bool warmup)\n        {\n            _startDate = new DateTime(2014, 3, 27, 9, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(10);\n            _algorithm.SetStartDate(_startDate);\n\n            _algorithm.SetBenchmark(x => 1);\n            if (warmup)\n            {\n                _algorithm.SetWarmUp(TimeSpan.FromDays(2));\n            }\n            _algorithm.UniverseSettings.Schedule.On(_algorithm.DateRules.On(new DateTime(2014, 3, 24), new DateTime(2014, 3, 25),\n                new DateTime(2014, 3, 28), new DateTime(2014, 4, 3)));\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var selectionTime = DateTime.MinValue;\n\n            var selectionAlgoTime = new List<DateTime>();\n            var selectionDataTime = new List<DateTime>();\n            IEnumerable<Symbol> Filter(IEnumerable<Fundamental> fundamentals)\n            {\n                selectionAlgoTime.Add(_algorithm.Time.Date);\n                var dataPoint = fundamentals.Take(1);\n                selectionDataTime.Add(dataPoint.First().EndTime);\n                return dataPoint.Select(x => x.Symbol);\n            }\n\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            var universe = _algorithm.AddUniverse(Filter);\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(500), true, ts =>\n            {\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60 * 12);\n\n            Assert.AreEqual(3, selectionAlgoTime.Count, string.Join(\",\", selectionAlgoTime));\n            var index = 0;\n            if (warmup)\n            {\n                // warmup start time\n                Assert.AreEqual(new DateTime(2014, 3, 25), selectionAlgoTime[index++]);\n            }\n            else\n            {\n                // triggers right away, outside of schedule\n                Assert.AreEqual(new DateTime(2014, 3, 27), selectionAlgoTime[index++]);\n            }\n            Assert.AreEqual(new DateTime(2014, 3, 28), selectionAlgoTime[index++]);\n            Assert.AreEqual(new DateTime(2014, 4, 3), selectionAlgoTime[index++]);\n        }\n\n        [Test]\n        public void CoarseFundamentalsImmediateSelection()\n        {\n            _startDate = new DateTime(2014, 03, 26, 9, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var selectionTime = DateTime.MinValue;\n            List<Symbol> selectedSymbols = null;\n\n            IEnumerable<Symbol> CoarseFilter(IEnumerable<CoarseFundamental> coarse)\n            {\n                selectionTime = _algorithm.UtcTime;\n                selectedSymbols = coarse.Select(x => x.Symbol).ToList();\n                return selectedSymbols;\n            }\n\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            var universe = _algorithm.AddUniverse(CoarseFilter);\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreEqual(startDateUtc, selectionTime);\n            Assert.AreEqual(1, timeSliceCount);\n\n            Assert.IsNotNull(selectedSymbols);\n            Assert.IsNotEmpty(selectedSymbols);\n            CollectionAssert.AreEquivalent(selectedSymbols, universe.Members.Keys);\n            CollectionAssert.AreEquivalent(selectedSymbols, _algorithm.Securities.Keys);\n        }\n\n        [Test]\n        public void FutureChainsImmediateSelection()\n        {\n            _startDate = new DateTime(2014, 6, 9, 12, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var firstSelectionTimeUtc = DateTime.MinValue;\n            List<Symbol> selectedSymbols = null;\n\n            var future = _algorithm.AddFuture(\"ES\");\n            future.SetFilter(universe =>\n            {\n                firstSelectionTimeUtc = universe.LocalTime.ConvertToUtc(future.Exchange.TimeZone);\n                selectedSymbols = universe.Data.Select(x => x.Symbol).ToList();\n\n                return universe;\n            });\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (firstSelectionTimeUtc != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreEqual(startDateUtc, firstSelectionTimeUtc);\n            Assert.AreEqual(1, timeSliceCount);\n            Assert.IsNotNull(selectedSymbols);\n            Assert.IsNotEmpty(selectedSymbols);\n        }\n\n        [TestCase(SecurityType.Option)]\n        [TestCase(SecurityType.IndexOption)]\n        public void OptionChainImmediateSelection(SecurityType securityType)\n        {\n            _startDate = securityType == SecurityType.Option\n                ? new DateTime(2015, 12, 24, 12, 0, 0)\n                : new DateTime(2021, 01, 04, 12, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var firstSelectionTimeUtc = DateTime.MinValue;\n            List<Symbol> selectedSymbols = null;\n\n            var option = securityType == SecurityType.Option\n                ? _algorithm.AddOption(\"GOOG\")\n                : _algorithm.AddIndexOption(\"SPX\");\n            option.SetFilter(universe =>\n            {\n                firstSelectionTimeUtc = universe.LocalTime.ConvertToUtc(option.Exchange.TimeZone);\n                selectedSymbols = (List<Symbol>)universe;\n\n                return universe;\n            });\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(10), true, ts =>\n            {\n                timeSliceCount++;\n                if (firstSelectionTimeUtc != default)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60);\n\n            Assert.AreEqual(startDateUtc, firstSelectionTimeUtc);\n            Assert.GreaterOrEqual(timeSliceCount, 1);\n            Assert.IsNotNull(selectedSymbols);\n            Assert.IsNotEmpty(selectedSymbols);\n        }\n\n        [Test]\n        public void CustomUniverseImmediateSelection()\n        {\n            _startDate = new DateTime(2013, 10, 07);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var selectionTime = DateTime.MinValue;\n\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            var universe = _algorithm.AddUniverse(SecurityType.Equity,\n                \"my-custom-universe\",\n                Resolution.Daily,\n                Market.USA,\n                _algorithm.UniverseSettings,\n                time =>\n                {\n                    selectionTime = _algorithm.UtcTime;\n                    return new[] { \"SPY\", \"GOOG\", \"APPL\" };\n                });\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            var expectedSymbols = new List<Symbol>()\n            {\n                Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"GOOG\", SecurityType.Equity, Market.USA),\n                Symbol.Create(\"APPL\", SecurityType.Equity, Market.USA)\n            };\n\n            Assert.AreEqual(startDateUtc, selectionTime);\n            Assert.AreEqual(1, timeSliceCount);\n\n            CollectionAssert.AreEquivalent(expectedSymbols, universe.Members.Keys);\n            CollectionAssert.AreEquivalent(expectedSymbols, _algorithm.Securities.Keys);\n        }\n\n        [Test]\n        public void CustomDataUniverseImmediateSelection()\n        {\n            _startDate = new DateTime(2014, 03, 26, 11, 0, 0);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var selectionTime = DateTime.MinValue;\n            List<Symbol> selectedSymbols = null;\n\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            var universe = _algorithm.AddUniverse<CoarseFundamental>(\"my-custom-coarse-universe\", stockDataSource =>\n            {\n                selectionTime = _algorithm.UtcTime;\n                selectedSymbols = stockDataSource.Select(x => x.Symbol).ToList();\n\n                return selectedSymbols;\n            });\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreEqual(startDateUtc, selectionTime);\n            Assert.AreEqual(1, timeSliceCount);\n\n            Assert.IsNotNull(selectedSymbols);\n            Assert.IsNotEmpty(selectedSymbols);\n            CollectionAssert.AreEquivalent(selectedSymbols, universe.Members.Keys);\n            CollectionAssert.AreEquivalent(selectedSymbols, _algorithm.Securities.Keys);\n        }\n\n        [Test]\n        public void ConstituentsImmediateSelection()\n        {\n            _startDate = new DateTime(2013, 10, 08);\n            var startDateUtc = _startDate.ConvertToUtc(_algorithm.TimeZone);\n            _manualTimeProvider.SetCurrentTimeUtc(startDateUtc);\n            var endDate = _startDate.AddDays(5);\n\n            _algorithm.SetBenchmark(x => 1);\n\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var selectionTime = DateTime.MinValue;\n            List<Symbol> constituents = null;\n\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n\n            var customUniverseSymbol = new Symbol(\n                SecurityIdentifier.GenerateConstituentIdentifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.Equity,\n                    Market.USA),\n                \"constituents-universe-qctest\");\n            using var constituentsUniverse = new ConstituentsUniverse(customUniverseSymbol, _algorithm.UniverseSettings, x =>\n            {\n                selectionTime = _algorithm.UtcTime;\n                constituents = x.Select(x => x.Symbol).ToList();\n\n                return constituents;\n\n            });\n\n            var universe = _algorithm.AddUniverse(constituentsUniverse);\n\n            _algorithm.PostInitialize();\n\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n\n            var timeSliceCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                timeSliceCount++;\n                if (selectionTime != DateTime.MinValue)\n                {\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreEqual(startDateUtc, selectionTime);\n            Assert.AreEqual(1, timeSliceCount);\n\n            Assert.IsNotNull(constituents);\n            Assert.IsNotEmpty(constituents);\n\n            CollectionAssert.AreEquivalent(constituents, universe.Members.Keys);\n            CollectionAssert.AreEquivalent(constituents, _algorithm.Securities.Keys);\n        }\n\n        [TestCase(false, SecurityType.Option, Resolution.Hour, false)]\n        [TestCase(true, SecurityType.Option, Resolution.Hour, false)]\n        [TestCase(false, SecurityType.IndexOption, Resolution.Hour, false)]\n        [TestCase(true, SecurityType.IndexOption, Resolution.Hour, false)]\n        [TestCase(false, SecurityType.Option, Resolution.Daily, false)]\n        [TestCase(true, SecurityType.Option, Resolution.Daily, false)]\n        [TestCase(false, SecurityType.IndexOption, Resolution.Daily, false)]\n        [TestCase(true, SecurityType.IndexOption, Resolution.Daily, false)]\n        [TestCase(false, SecurityType.Option, Resolution.Daily, true)]\n        [TestCase(true, SecurityType.Option, Resolution.Daily, true)]\n        [TestCase(false, SecurityType.IndexOption, Resolution.Daily, true)]\n        [TestCase(true, SecurityType.IndexOption, Resolution.Daily, true)]\n        public void WarmupOptionSelection(bool useWarmupResolution, SecurityType securityType, Resolution resolution, bool strictEndTimes)\n        {\n            _startDate = securityType == SecurityType.Option ? new DateTime(2014, 6, 9) : new DateTime(2021, 1, 4);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(3);\n            _algorithm.SetBenchmark(x => 1);\n\n            _algorithm.Settings.DailyPreciseEndTime = strictEndTimes;\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(2, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(2));\n            }\n\n            _algorithm.UniverseSettings.Resolution = resolution;\n            var feed = RunDataFeed();\n            // after algorithm initialization let's set the time provider time to reflect warmup window\n            _manualTimeProvider.SetCurrentTimeUtc(_algorithm.UtcTime);\n\n            var es = securityType == SecurityType.Option\n                ? _algorithm.AddOption(\"AAPL\", resolution)\n                : _algorithm.AddIndexOption(\"SPX\", resolution);\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n            var countWarmup = 0;\n            var countLive = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.UniverseData?.Count > 0)\n                {\n                    Assert.IsNotNull(ts.UniverseData.Select(x => x.Value.Underlying));\n                    Assert.IsNotEmpty(ts.UniverseData.Select(x => x.Value.FilteredContracts));\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        countWarmup++;\n                    }\n                    else\n                    {\n                        countLive++;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n\n                if (_algorithm.IsWarmingUp && countWarmup == 0 || !_algorithm.IsWarmingUp && countLive == 0)\n                {\n                    Thread.Sleep(50);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60 * 4);\n\n            Assert.AreNotEqual(0, countWarmup);\n            Assert.AreNotEqual(0, countLive);\n        }\n\n        [Test]\n        public void FutureLiveHoldingsFutureMapping()\n        {\n            _startDate = new DateTime(2013, 12, 15);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(1);\n            _algorithm.SetBenchmark(x => 1);\n            _algorithm.UniverseSettings.Resolution = Resolution.Hour;\n            var feed = RunDataFeed();\n            // after algorithm initialization let's set the time provider time to reflect warmup window\n            _manualTimeProvider.SetCurrentTimeUtc(_algorithm.UtcTime);\n\n            var es = _algorithm.AddFuture(\"ES\");\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n            var assertedHoldings = false;\n            var securityChanges = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(7), true, ts =>\n            {\n                if (ts.SecurityChanges != SecurityChanges.None)\n                {\n                    securityChanges++;\n                }\n\n                // let's wait till it's remapped\n                if (securityChanges == 3)\n                {\n                    Assert.IsNotNull(_algorithm.Securities.Total.SingleOrDefault(sec => sec.IsTradable));\n                    Assert.AreEqual(3, _algorithm.Securities.Total.Count);\n\n                    var result = LiveTradingResultHandler.GetHoldings(_algorithm.Securities.Total, _algorithm.SubscriptionManager.SubscriptionDataConfigService);\n                    // old future mapped contract is removed\n                    Assert.AreEqual(2, result.Count);\n                    Assert.IsTrue(result.TryGetValue(es.Symbol.ID.ToString(), out var holding));\n                    Assert.IsTrue(result.TryGetValue(es.Mapped.ID.ToString(), out holding));\n\n                    Assert.AreEqual(0, LiveTradingResultHandler.GetHoldings(_algorithm.Securities.Total, _algorithm.SubscriptionManager.SubscriptionDataConfigService, onlyInvested: true).Count);\n\n                    _algorithm.RemoveSecurity(es.Symbol);\n                    // allow time for the exchange to pick up the selection point\n                    Thread.Sleep(150);\n                }\n                else if (securityChanges == 4)\n                {\n                    Assert.IsTrue(_algorithm.Securities.Total.All(sec => !sec.IsTradable));\n                    Assert.AreEqual(3, _algorithm.Securities.Total.Count);\n\n                    var result = LiveTradingResultHandler.GetHoldings(_algorithm.Securities.Total, _algorithm.SubscriptionManager.SubscriptionDataConfigService);\n                    Assert.AreEqual(0, result.Count);\n\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    assertedHoldings = true;\n                }\n            },\n            endDate: _startDate.AddDays(10),\n            secondsTimeStep: 60 * 60 * 8);\n\n            Assert.IsTrue(assertedHoldings);\n            Assert.AreEqual(4, securityChanges);\n        }\n\n        [Test]\n        public void FutureLiveHoldings()\n        {\n            _startDate = new DateTime(2013, 10, 10);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(1);\n            _algorithm.SetBenchmark(x => 1);\n            _algorithm.UniverseSettings.Resolution = Resolution.Hour;\n            var feed = RunDataFeed();\n            // after algorithm initialization let's set the time provider time to reflect warmup window\n            _manualTimeProvider.SetCurrentTimeUtc(_algorithm.UtcTime);\n\n            var es = _algorithm.AddFuture(\"ES\");\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n            var assertedHoldings = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.SecurityChanges != SecurityChanges.None)\n                {\n                    Assert.IsNotNull(_algorithm.Securities.Values.SingleOrDefault(sec => sec.IsTradable));\n                    var result = LiveTradingResultHandler.GetHoldings(_algorithm.Securities.Values, _algorithm.SubscriptionManager.SubscriptionDataConfigService);\n\n                    Assert.AreEqual(2, result.Count);\n                    Assert.IsTrue(result.TryGetValue(es.Symbol.ID.ToString(), out var holding));\n                    Assert.IsTrue(result.TryGetValue(es.Mapped.ID.ToString(), out holding));\n\n                    Assert.AreEqual(0, LiveTradingResultHandler.GetHoldings(_algorithm.Securities.Values, _algorithm.SubscriptionManager.SubscriptionDataConfigService, onlyInvested: true).Count);\n\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    assertedHoldings = true;\n                }\n            },\n            endDate: _startDate.AddDays(1),\n            secondsTimeStep: 60 * 60);\n\n            Assert.IsTrue(assertedHoldings);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupFutureSelection(bool useWarmupResolution)\n        {\n            _startDate = new DateTime(2013, 10, 10);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(1);\n            _algorithm.SetBenchmark(x => 1);\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(2, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(2));\n            }\n            _algorithm.UniverseSettings.Resolution = Resolution.Hour;\n            var feed = RunDataFeed();\n            // after algorithm initialization let's set the time provider time to reflect warmup window\n            _manualTimeProvider.SetCurrentTimeUtc(_algorithm.UtcTime);\n\n            var es = _algorithm.AddFuture(\"ES\");\n            // allow time for the exchange to pick up the selection point\n            Thread.Sleep(50);\n            var countWarmup = 0;\n            var countLive = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.UniverseData?.Count > 0)\n                {\n                    Assert.IsNotEmpty(ts.UniverseData.Select(x => x.Value.FilteredContracts));\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        countWarmup++;\n                    }\n                    else\n                    {\n                        countLive++;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60 * 60);\n\n            Assert.AreNotEqual(0, countWarmup);\n            Assert.AreNotEqual(0, countLive);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupExpiredContinuousFuture(bool useWarmupResolution)\n        {\n            _startDate = new DateTime(2014, 12, 1);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(30);\n            var futureChainProvider = new BacktestingFutureChainProvider();\n            futureChainProvider.Initialize(new(TestGlobals.MapFileProvider, TestGlobals.HistoryProvider));\n            _algorithm.SetFutureChainProvider(futureChainProvider);\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(365, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(365));\n            }\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var continuousContract = _algorithm.AddFuture(Futures.Indices.SP500EMini, Resolution.Daily,\n                dataNormalizationMode: DataNormalizationMode.BackwardsRatio,\n                dataMappingMode: DataMappingMode.LastTradingDay,\n                contractDepthOffset: 0\n            );\n            // the expiration of this option contract is before the start date of the algorithm but we should still get some data during warmup\n            continuousContract.SetFilter(0, 182);\n\n            // Post initialize after securities are added (Initialize)\n            _algorithm.PostInitialize();\n\n            var emittedChainData = false;\n            var emittedContinuousData = false;\n            var assertedSubscriptions = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (_algorithm.IsWarmingUp)\n                {\n                    Assert.IsFalse(_dataQueueHandler.SubscriptionDataConfigs.Any(\n                        // the data queue handler shouldn't of seen the expired subscription at any point\n                        x => !x.Symbol.IsCanonical() && x.Symbol.SecurityType == SecurityType.Future && x.Symbol.ID.Date < _algorithm.StartDate));\n\n                    if (ts.Slice.HasData)\n                    {\n                        emittedContinuousData |= ts.Slice.Keys.Any(s => s == continuousContract.Symbol\n                            // let's assert that during warmup the continuous future got data of expired future\n                            && continuousContract.Mapped.ID.Date < _algorithm.StartDate);\n                        emittedChainData |= ts.Slice.Keys.Any(s => !s.IsCanonical() && s.SecurityType == SecurityType.Future\n                            // let's assert that during warmup we got chain data of expired futures\n                            && s.ID.Date < _algorithm.StartDate);\n                    }\n                }\n                else\n                {\n                    Assert.IsTrue(_dataQueueHandler.SubscriptionDataConfigs.Any(\n                        // the data queue handler should of seen the Non expired subscription at any point\n                        x => !x.Symbol.IsCanonical() && x.Symbol.SecurityType == SecurityType.Future && x.Symbol.ID.Date >= _algorithm.StartDate));\n\n                    assertedSubscriptions = true;\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 60);\n\n            Assert.IsTrue(assertedSubscriptions);\n            Assert.IsTrue(emittedContinuousData);\n            Assert.IsTrue(emittedChainData);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupExpiredOption(bool useWarmupResolution)\n        {\n            _startDate = new DateTime(2014, 6, 14);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(1);\n            _algorithm.SetBenchmark(x => 1);\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(10, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(10));\n            }\n            var feed = RunDataFeed();\n\n            var aapl = _algorithm.AddEquity(\"AAPL\");\n            // the expiration of this option contract is before the start date of the algorithm but we should still get some data during warmup\n            var option = Symbol.CreateOption(aapl.Symbol, Market.USA, OptionStyle.American, OptionRight.Call, 925, new DateTime(2014, 06, 13));\n            _algorithm.AddOptionContract(option, Resolution.Minute);\n\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                // the data queue handler shouldn't of seen the expired option subscription at any point\n                Assert.IsFalse(_dataQueueHandler.SubscriptionDataConfigs.Any(x => !x.Symbol.IsCanonical() && x.Symbol.SecurityType.IsOption()));\n\n                if (ts.Slice.HasData)\n                {\n                    if (_algorithm.IsWarmingUp && ts.Slice.Keys.Any(s => s == option))\n                    {\n                        emittedData = true;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            },\n            endDate: endDate,\n            secondsTimeStep: 5);\n\n            Assert.IsTrue(emittedData);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void WarmupAddSecurity(bool useWarmupResolution)\n        {\n            _startDate = new DateTime(2014, 5, 8);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var endDate = _startDate.AddDays(10);\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(1, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(1));\n            }\n            var feed = RunDataFeed(forex: new List<string> { Symbols.EURUSD.ToString() }, resolution: Resolution.Minute);\n\n            var emittedData = false;\n            var emittedDataDuringWarmup = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.ContainsKey(Symbols.EURUSD))\n                {\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        emittedDataDuringWarmup = true;\n                    }\n                    else\n                    {\n                        emittedData = true;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n            Assert.IsTrue(emittedDataDuringWarmup);\n        }\n\n        [Test]\n        public void EmitsData()\n        {\n            var endDate = _startDate.AddDays(10);\n            var feed = RunDataFeed(forex: new List<string> { Symbols.EURUSD.ToString() });\n\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    emittedData = true;\n                    var data = ts.Slice[Symbols.EURUSD];\n                    ConsoleWriteLine(\"HasData: \" + data);\n                    ConsoleWriteLine();\n\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void HandlesMultipleSecurities()\n        {\n            var endDate = _startDate.AddDays(10);\n            var equities = new List<string> { \"SPY\", \"IBM\", \"AAPL\", \"GOOG\", \"MSFT\", \"BAC\", \"GS\" };\n            var forex = new List<string> { \"EURUSD\", \"USDJPY\", \"GBPJPY\", \"AUDUSD\", \"NZDUSD\" };\n\n            var feed = RunDataFeed(equities: equities, forex: forex);\n\n            // allow the feed to create a data point for all\n            Thread.Sleep(25);\n\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), ts =>\n            {\n                var delta = (DateTime.UtcNow - ts.Time).TotalMilliseconds;\n                var values = ts.Slice.Keys.Select(x => x.Value).ToList();\n                ConsoleWriteLine(((decimal)delta).SmartRounding().ToStringInvariant() + \"ms : \" + string.Join(\",\", values));\n                Assert.IsTrue(equities.All(x => values.Contains(x)));\n                Assert.IsTrue(forex.All(x => values.Contains(x)));\n                emittedData = true;\n\n                // we got what we wanted shortcut unit test\n                _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n            }, endDate: endDate);\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void PerformanceBenchmark()\n        {\n            var symbolCount = 600;\n\n            var count = new Count();\n            var stopwatch = Stopwatch.StartNew();\n            var feed = RunDataFeed(Resolution.Tick, equities: Enumerable.Range(0, symbolCount).Select(x => \"E\" + x.ToStringInvariant()).ToList(),\n                getNextTicksFunction: fdqh => ProduceBenchmarkTicks(fdqh, count));\n\n            var securitiesCount = _algorithm.Securities.Count;\n            var expected = _algorithm.Securities.Keys.ToHashSet();\n            Log.Trace(\"Securities.Count: \" + securitiesCount);\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                ConsoleWriteLine(\"Count: \" + ts.Slice.Keys.Count + \" \" + DateTime.UtcNow.ToStringInvariant(\"o\"));\n                if (ts.Slice.Keys.Count != securitiesCount)\n                {\n                    var included = ts.Slice.Keys.ToHashSet();\n                    expected.ExceptWith(included);\n                    ConsoleWriteLine(\"Missing: \" + string.Join(\",\", expected.OrderBy(x => x.Value)));\n                }\n            });\n            stopwatch.Stop();\n\n            Log.Trace(\"Total ticks: \" + count.Value);\n            Assert.GreaterOrEqual(count.Value, 700000);\n            Log.Trace(\"Elapsed time: \" + stopwatch.Elapsed);\n            var ticksPerSec = count.Value / stopwatch.Elapsed.TotalSeconds;\n            Log.Trace(\"Ticks/sec: \" + ticksPerSec);\n            Assert.GreaterOrEqual(ticksPerSec, 70000);\n            var ticksPerSecPerSymbol = (count.Value / stopwatch.Elapsed.TotalSeconds) / symbolCount;\n            Log.Trace(\"Ticks/sec/symbol: \" + ticksPerSecPerSymbol);\n            Assert.GreaterOrEqual(ticksPerSecPerSymbol, 100);\n        }\n\n        [Test]\n        public void DoesNotSubscribeToCustomData()\n        {\n            var endDate = _startDate.AddDays(10);\n            // Current implementation only sends equity/forex subscriptions to the queue handler,\n            // new impl sends all, the restriction shouldn't live in the feed, but rather in the\n            // queue handler impl\n            var feed = RunDataFeed(equities: new List<string> { \"SPY\" }, forex: new List<string> { \"EURUSD\" });\n            _algorithm.AddData<CustomMockedFileBaseData>(\"CustomMockedFileBaseData\");\n            var customMockedFileBaseData = SymbolCache.GetSymbol(\"CustomMockedFileBaseData\");\n\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), ts =>\n            {\n                ConsoleWriteLine(\"Count: \" + ts.Slice.Keys.Count + \" \" + DateTime.UtcNow.ToStringInvariant(\"o\"));\n                Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n                Assert.IsFalse(_dataQueueHandler.Subscriptions.Contains(customMockedFileBaseData));\n                emittedData = true;\n\n                // we got what we wanted shortcut unit test\n                _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void AddsSubscription_NewUserUniverse()\n        {\n            var endDate = _startDate.AddDays(10);\n            var feed = RunDataFeed(equities: new List<string> { \"SPY\" });\n\n            var forexFxcmUserUniverse = UserDefinedUniverse.CreateSymbol(SecurityType.Forex, Market.Oanda);\n            var emittedData = false;\n            var newDataCount = 0;\n            var securityChanges = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                securityChanges += ts.SecurityChanges.Count;\n                if (!emittedData)\n                {\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    if (ts.Data.Count > 0)\n                    {\n                        Assert.IsTrue(ts.Slice.Keys.Contains(Symbols.SPY));\n                    }\n                    // SPY benchmark\n                    Assert.AreEqual(1, _dataQueueHandler.Subscriptions.Count);\n\n                    _algorithm.AddSecurities(forex: new List<string> { \"EURUSD\" });\n                    _algorithm.OnEndOfTimeStep();\n                    emittedData = true;\n                }\n                else\n                {\n                    // SPY benchmark and EURUSD\n                    if (_dataQueueHandler.Subscriptions.Count != 2)\n                    {\n                        // The custom exchange has to pick up the universe selection data point and push it into the universe subscription to\n                        // trigger adding EURUSD in the next loop\n                        Thread.Sleep(50);\n                        return;\n                    }\n\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    if (ts.Data.Count > 0)\n                    {\n                        Assert.IsTrue(ts.Slice.Keys.Contains(Symbols.SPY));\n                    }\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD)\n                                    || _dataQueueHandler.Subscriptions.Contains(forexFxcmUserUniverse));\n                    // Might delay a couple of Slices to send over the data, so we will count them\n                    // and assert a minimum amount\n                    if (ts.Slice.Keys.Contains(Symbols.EURUSD))\n                    {\n                        newDataCount++;\n                        if (newDataCount >= 5)\n                        {\n                            // we got what we wanted shortcut unit test\n                            _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                        }\n                    }\n                }\n            }, endDate: endDate);\n\n            Log.Trace(\"newDataCount: \" + newDataCount);\n            Assert.AreEqual(2, securityChanges);\n\n            Assert.GreaterOrEqual(newDataCount, 5);\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void AddsNewUniverse()\n        {\n            var endDate = _startDate.AddDays(10);\n            _algorithm.UniverseSettings.Resolution = Resolution.Second; // Default is Minute and we need something faster\n            _algorithm.UniverseSettings.ExtendedMarketHours = true; // Current _startDate is at extended market hours\n\n            var feed = RunDataFeed(forex: new List<string> { \"EURUSD\" });\n            var firstTime = false;\n            var securityChanges = 0;\n            var newDataCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                securityChanges += ts.SecurityChanges.Count;\n                if (!firstTime)\n                {\n                    // benchmark SPY, EURUSD\n                    Assert.AreEqual(2, _dataQueueHandler.Subscriptions.Count);\n                    _algorithm.AddUniverse(\"TestUniverse\", time => new List<string> { \"AAPL\", \"SPY\" });\n                    firstTime = true;\n                }\n                else\n                {\n                    if (_dataQueueHandler.Subscriptions.Count == 2)\n                    {\n                        Assert.AreEqual(1, _dataQueueHandler.Subscriptions.Count(x => x.Value.Contains(\"TESTUNIVERSE\")));\n                    }\n                    else if (_dataQueueHandler.Subscriptions.Count == 3)\n                    {\n                        // Coarse universe isn't added to the data queue handler\n                        Assert.AreNotEqual(1, _dataQueueHandler.Subscriptions.Count(x => x.Value.Contains(\"TESTUNIVERSE\")));\n                        Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                        Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.AAPL));\n                        Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n                        // Might delay a couple of Slices to send over the data, so we will count them and assert a minimum amount\n                        if (ts.Slice.Keys.Contains(Symbols.AAPL)\n                            && ts.Slice.Keys.Contains(Symbols.SPY))\n                        {\n                            newDataCount++;\n                            if (newDataCount >= 5)\n                            {\n                                // we got what we wanted shortcut unit test\n                                _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                            }\n                        }\n                    }\n                    else\n                    {\n                        Assert.Fail($\"Subscriptions.Count: {_dataQueueHandler.Subscriptions.Count}\");\n                    }\n                }\n            }, endDate: endDate);\n\n            Log.Trace(\"newDataCount: \" + newDataCount);\n            Assert.AreEqual(3, securityChanges);\n\n            Assert.GreaterOrEqual(newDataCount, 5);\n            Assert.IsTrue(firstTime);\n        }\n\n        [Test]\n        public void AddsSubscription_SameUserUniverse()\n        {\n            var endDate = _startDate.AddDays(10);\n            var feed = RunDataFeed(equities: new List<string> { \"SPY\" });\n\n            var emittedData = false;\n            var newDataCount = 0;\n            var changes = new List<SecurityChanges>();\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.SecurityChanges != SecurityChanges.None)\n                {\n                    changes.Add(ts.SecurityChanges);\n                    return;\n                }\n                if (!emittedData)\n                {\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    if (ts.Data.Count > 0)\n                    {\n                        Assert.IsTrue(ts.Slice.Keys.Contains(Symbols.SPY));\n                    }\n                    // SPY benchmark\n                    Assert.AreEqual(1, _dataQueueHandler.Subscriptions.Count);\n\n                    _algorithm.AddSecurities(equities: new List<string> { \"AAPL\" });\n                    _algorithm.OnEndOfTimeStep();\n                    emittedData = true;\n                }\n                else\n                {\n                    if (_dataQueueHandler.Subscriptions.Count != 2)\n                    {\n                        // SPY benchmark and AAPL, retry it might not being picked up yet\n                        Thread.Sleep(50);\n                        return;\n                    }\n\n                    // there could be some slices with no data\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    if (ts.Data.Count > 0)\n                    {\n                        Assert.IsTrue(ts.Slice.Keys.Contains(Symbols.SPY));\n                    }\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.AAPL));\n                    // Might delay a couple of Slices to send over the data, so we will count them\n                    // and assert a minimum amount\n                    if (ts.Slice.Keys.Contains(Symbols.AAPL))\n                    {\n                        newDataCount++;\n                        if (newDataCount >= 5)\n                        {\n                            // we got what we wanted shortcut unit test\n                            _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                        }\n                    }\n                }\n            }, endDate: endDate);\n\n            Assert.GreaterOrEqual(newDataCount, 5);\n            Assert.IsTrue(emittedData);\n            Assert.AreEqual(2, changes.Count);\n            Assert.AreEqual(Symbols.SPY, changes[0].AddedSecurities.Single().Symbol);\n            Assert.AreEqual(Symbols.AAPL, changes[1].AddedSecurities.Single().Symbol);\n        }\n\n        [Test]\n        public void Unsubscribes()\n        {\n            var endDate = _startDate.AddDays(10);\n            var feed = RunDataFeed(equities: new List<string> { \"SPY\" }, forex: new List<string> { \"EURUSD\" });\n            _algorithm.AddData<CustomMockedFileBaseData>(\"CustomMockedFileBaseData\");\n            var customMockedFileBaseData = SymbolCache.GetSymbol(\"CustomMockedFileBaseData\");\n\n            var emittedData = false;\n            var currentSubscriptionCount = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), false, ts =>\n            {\n                Assert.IsFalse(_dataQueueHandler.Subscriptions.Contains(customMockedFileBaseData));\n                if (!emittedData)\n                {\n                    currentSubscriptionCount = _dataQueueHandler.SubscriptionDataConfigs.Count;\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n                    var subscriptions = _dataManager.DataFeedSubscriptions\n                        .Where(subscription => !subscription.Configuration.IsInternalFeed && subscription.Configuration.Symbol == Symbols.SPY);\n                    foreach (var subscription in subscriptions)\n                    {\n                        _dataManager.RemoveSubscription(subscription.Configuration);\n                    }\n                    emittedData = true;\n                }\n                else\n                {\n                    // should of remove trade and quote bar subscription for both (4)\n                    Assert.AreEqual(currentSubscriptionCount - 2, _dataQueueHandler.SubscriptionDataConfigs.Count);\n                    // internal subscription should still be there\n                    Assert.AreEqual(0, _dataQueueHandler.SubscriptionDataConfigs\n                        .Where(config => !config.IsInternalFeed)\n                        .Count(config => config.Symbol == Symbols.SPY));\n                    // Should be 1 left because of internal subscription trade hour\n                    Assert.AreEqual(1, _dataQueueHandler.SubscriptionDataConfigs.Count(config => config.Symbol == Symbols.SPY));\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void RemoveSecurity()\n        {\n            var endDate = _startDate.AddDays(10);\n            _algorithm.SetFinishedWarmingUp();\n            _algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var feed = RunDataFeed(equities: new List<string> { \"SPY\" }, forex: new List<string> { \"EURUSD\" });\n            _algorithm.AddData<CustomMockedFileBaseData>(\"CustomMockedFileBaseData\");\n            var customMockedFileBaseData = SymbolCache.GetSymbol(\"CustomMockedFileBaseData\");\n\n            var emittedData = false;\n            var currentSubscriptionCount = 0;\n            var changes = new List<SecurityChanges>();\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.SecurityChanges != SecurityChanges.None)\n                {\n                    changes.Add(ts.SecurityChanges);\n                }\n                Assert.IsFalse(_dataQueueHandler.Subscriptions.Contains(customMockedFileBaseData));\n                if (!emittedData)\n                {\n                    currentSubscriptionCount = _dataQueueHandler.SubscriptionDataConfigs.Count;\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.SPY));\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n                    _algorithm.RemoveSecurity(Symbols.SPY);\n                    emittedData = true;\n                }\n                else\n                {\n                    // should of remove trade and quote bar subscription for both (4)\n                    Assert.AreEqual(currentSubscriptionCount - 2, _dataQueueHandler.SubscriptionDataConfigs.Count);\n                    // internal subscription should still be there\n                    Assert.AreEqual(0, _dataQueueHandler.SubscriptionDataConfigs\n                        .Where(config => !config.IsInternalFeed)\n                        .Count(config => config.Symbol == Symbols.SPY));\n                    // Should be 1 left because of internal subscription trade hour\n                    Assert.AreEqual(1, _dataQueueHandler.SubscriptionDataConfigs.Count(config => config.Symbol == Symbols.SPY));\n                    Assert.IsTrue(_dataQueueHandler.Subscriptions.Contains(Symbols.EURUSD));\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n            Assert.AreEqual(4, changes.Aggregate(0, (i, securityChanges) => i + securityChanges.Count));\n            Assert.AreEqual(Symbols.SPY, changes[1].RemovedSecurities.Single().Symbol);\n        }\n\n        [Test]\n        public void BenchmarkTicksPerSecondWithTwentySymbols()\n        {\n            // this ran at ~25k ticks/per symbol for 20 symbols\n\n            var feed = RunDataFeed(Resolution.Tick, equities: Enumerable.Range(0, 20).Select(x => x.ToStringInvariant()).ToList());\n            int ticks = 0;\n            var averages = new List<decimal>();\n            var timer = new Timer(state =>\n            {\n                var avg = ticks / 20m;\n                Interlocked.Exchange(ref ticks, 0);\n                Log.Trace(\"Average ticks per symbol: \" + avg.SmartRounding());\n                averages.Add(avg);\n            }, null, Time.OneSecond, Time.OneSecond);\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), false, ts =>\n            {\n                Interlocked.Add(ref ticks, ts.Slice.Ticks.Sum(x => x.Value.Count));\n            });\n\n            timer.Dispose();\n            var average = averages.Average();\n            Log.Trace(\"\\r\\nAverage ticks per symbol per second: \" + average);\n            Assert.That(average, Is.GreaterThan(40));\n        }\n\n        [Test]\n        public void EmitsForexDataWithRoundedUtcTimes()\n        {\n            var feed = RunDataFeed(forex: new List<string> { \"EURUSD\" });\n\n            var emittedData = false;\n            var lastTime = DateTime.UtcNow;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), ts =>\n            {\n                if (!emittedData)\n                {\n                    emittedData = true;\n                    lastTime = ts.Time;\n                    return;\n                }\n                var delta = (DateTime.UtcNow - ts.Time).TotalMilliseconds;\n                Assert.AreEqual(lastTime.Add(Time.OneSecond), ts.Time);\n                Assert.AreEqual(1, ts.Slice.QuoteBars.Count);\n                lastTime = ts.Time;\n            });\n\n            Assert.IsTrue(emittedData);\n        }\n\n        [Test]\n        public void HandlesManyCustomDataSubscriptions()\n        {\n            var feed = RunDataFeed();\n            for (int i = 0; i < 100; i++)\n            {\n                _algorithm.AddData<CustomMockedFileBaseData>((100 + i).ToStringInvariant(), Resolution.Second, fillForward: false);\n            }\n\n            int count = 0;\n            var emittedData = false;\n            var stopwatch = Stopwatch.StartNew();\n\n            var previousTime = DateTime.Now;\n            Log.Trace(\"start: \" + previousTime.ToStringInvariant(\"o\"));\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), false, ts =>\n            {\n                // because this is a remote file we may skip data points while the newest\n                // version of the file is downloading [internet speed] and also we decide\n                // not to emit old data\n                stopwatch.Stop();\n                if (ts.Slice.Count == 0) return;\n\n                emittedData = true;\n                count++;\n\n                // make sure within 2 seconds\n                var delta = DateTime.Now.Subtract(previousTime);\n                previousTime = DateTime.Now;\n                Assert.IsTrue(delta <= TimeSpan.FromSeconds(2), delta.ToString());\n                ConsoleWriteLine($\"TimeProvider now: {_manualTimeProvider.GetUtcNow().ToStringInvariant()} Count: {ts.Slice.Count}. \" +\n                    $\"Delta (ms): {((decimal)delta.TotalMilliseconds).SmartRounding().ToStringInvariant()}{Environment.NewLine}\"\n                );\n            });\n\n            Log.Trace(\"Count: \" + count);\n            Log.Trace(\"Spool up time: \" + stopwatch.Elapsed);\n\n            Assert.That(count, Is.GreaterThan(5));\n            Assert.IsTrue(emittedData);\n        }\n\n        [TestCase(FileFormat.Csv, true, false)]\n        [TestCase(FileFormat.UnfoldingCollection, true, false)]\n        [TestCase(FileFormat.Csv, false, false)]\n        [TestCase(FileFormat.UnfoldingCollection, false, false)]\n        [TestCase(FileFormat.Csv, false, true)]\n        [TestCase(FileFormat.UnfoldingCollection, false, true)]\n        public void RestCustomDataReturningNullDoesNotInfinitelyPoll(FileFormat fileFormat, bool returnsNull, bool throwsException)\n        {\n            TestCustomData.FileFormat = fileFormat;\n\n            var feed = RunDataFeed();\n\n            _algorithm.AddData<TestCustomData>(\"Pinocho\", Resolution.Minute, fillForward: false);\n\n            TestCustomData.ReturnNull = returnsNull;\n            TestCustomData.ThrowException = throwsException;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), alwaysInvoke: true, ts =>\n            {\n                // we request every 30min, so let's make sure time doesn't advance beyond 30 min, we want to test we are not requesting in a tight loop in the data stack\n                Thread.Sleep(100);\n                if (ts.DataPointCount > 0)\n                {\n                    Log.Debug(\"Emitted data\");\n                }\n            });\n\n            Assert.AreEqual(1, TestCustomData.ReaderCallsCount);\n        }\n\n        [Test, Ignore(\"These tests depend on a remote server\")]\n        public void HandlesRestApi()\n        {\n            var resolution = Resolution.Second;\n            var feed = RunDataFeed();\n            _algorithm.AddData<RestApiBaseData>(\"RestApi\", resolution);\n            var symbol = SymbolCache.GetSymbol(\"RestApi\");\n\n            var count = 0;\n            var receivedData = false;\n            var timeZone = _algorithm.Securities[symbol].Exchange.TimeZone;\n            RestApiBaseData last = null;\n\n            using var cancellationTokenSource = new CancellationTokenSource();\n            foreach (var ts in _synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (!ts.Slice.ContainsKey(symbol)) return;\n\n                count++;\n                receivedData = true;\n                var data = (RestApiBaseData)ts.Slice[symbol];\n                var time = data.EndTime.ConvertToUtc(timeZone);\n                ConsoleWriteLine(DateTime.UtcNow + \": Data time: \" + time.ConvertFromUtc(TimeZones.NewYork) + Environment.NewLine);\n                if (last != null)\n                {\n                    Assert.AreEqual(last.EndTime, data.EndTime.Subtract(resolution.ToTimeSpan()));\n                }\n                last = data;\n            }\n\n            feed.Exit();\n            Assert.That(count, Is.GreaterThanOrEqualTo(8));\n            Assert.IsTrue(receivedData);\n            Assert.That(RestApiBaseData.ReaderCount, Is.LessThanOrEqualTo(30)); // we poll at 10x frequency\n\n            Log.Trace(\"Count: \" + count + \" ReaderCount: \" + RestApiBaseData.ReaderCount);\n        }\n\n        [TestCase(DataNormalizationMode.Raw, true)]\n        [TestCase(DataNormalizationMode.BackwardsRatio, true)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, true)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, true)]\n\n        [TestCase(DataNormalizationMode.Raw, false)]\n        [TestCase(DataNormalizationMode.BackwardsRatio, false)]\n        [TestCase(DataNormalizationMode.BackwardsPanamaCanal, false)]\n        [TestCase(DataNormalizationMode.ForwardPanamaCanal, false)]\n        public void LivePriceScaling(DataNormalizationMode dataNormalizationMode, bool warmup)\n        {\n            _startDate = new DateTime(2013, 10, 10);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            _algorithm.SetBenchmark(x => 1);\n            if (warmup)\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(2));\n            }\n            else\n            {\n                _algorithm.SetFinishedWarmingUp();\n            }\n            var feed = RunDataFeed(runPostInitialize: false);\n\n            var security = _algorithm.AddFuture(\"ES\",\n                dataNormalizationMode: dataNormalizationMode);\n            var symbol = security.Symbol;\n\n            _algorithm.PostInitialize();\n\n            var receivedSecurityChanges = false;\n            var receivedData = false;\n\n            var assertPrice = new Action<decimal>((decimal price) =>\n            {\n                ConsoleWriteLine($\"assertPrice: {price} for {symbol} @{security.LocalTime}\");\n                if (_algorithm.IsWarmingUp)\n                {\n                    if (dataNormalizationMode == DataNormalizationMode.ForwardPanamaCanal && Math.Abs(price - 1760m) > 10)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.Raw && Math.Abs(price -1660m) > 10)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.BackwardsPanamaCanal && Math.Abs(price - 1510m) > 10)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.BackwardsRatio && Math.Abs(price - 1560m) > 10m)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                }\n                else\n                {\n                    if (dataNormalizationMode == DataNormalizationMode.ForwardPanamaCanal && price < 90)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.Raw && Math.Abs(price - 2m) > 1)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.BackwardsPanamaCanal && price < -160)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                    else if (dataNormalizationMode == DataNormalizationMode.BackwardsRatio && Math.Abs(price - 1.48m) > price * 0.1m)\n                    {\n                        throw new RegressionTestException($\"unexpected price {price} for {symbol} @{security.LocalTime}\");\n                    }\n                }\n            });\n\n            var lastPrice = 0m;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(10), ts =>\n            {\n                foreach (var addedSecurity in ts.SecurityChanges.AddedSecurities)\n                {\n                    if (addedSecurity.Symbol == symbol)\n                    {\n                        receivedSecurityChanges = true;\n                    }\n                }\n\n                if (warmup != _algorithm.IsWarmingUp)\n                {\n                    return;\n                }\n\n                if (ts.Slice.Bars.ContainsKey(symbol))\n                {\n                    receivedData = true;\n                    assertPrice(ts.Slice.Bars[symbol].Price);\n                }\n\n                if (lastPrice != security.Price && security.HasData)\n                {\n                    lastPrice = security.Price;\n                    // assert realtime prices too\n                    assertPrice(lastPrice);\n                }\n            },\n            alwaysInvoke: true,\n            secondsTimeStep: 60 * 60 * 8,\n            endDate: _startDate.AddDays(7));\n\n            Assert.IsTrue(receivedSecurityChanges, \"Did not add symbol!\");\n            Assert.IsTrue(receivedData, \"Did not get any symbol data!\");\n        }\n\n        [TestCase(\"AAPL\", SecurityType.Equity)]\n        [TestCase(\"BTCUSD\", SecurityType.Crypto)]\n        [TestCase(\"SPX500USD\", SecurityType.Cfd)]\n        [TestCase(\"ES\", SecurityType.Future)]\n        [TestCase(\"ES\", SecurityType.FutureOption)]\n        [TestCase(\"AAPL\", SecurityType.Option)]\n        public void UserDefinedUniverseSelection(string ticker, SecurityType securityType)\n        {\n            var feed = RunDataFeed();\n            _algorithm.SetFinishedWarmingUp();\n\n            Symbol symbol = null;\n            if (securityType == SecurityType.Cfd)\n            {\n                symbol = _algorithm.AddCfd(ticker).Symbol;\n            }\n            else if (securityType == SecurityType.Equity)\n            {\n                symbol = _algorithm.AddEquity(ticker).Symbol;\n            }\n            else if (securityType == SecurityType.Crypto)\n            {\n                symbol = _algorithm.AddCrypto(ticker).Symbol;\n            }\n            else if (securityType == SecurityType.Option)\n            {\n                symbol = Symbol.CreateOption(Symbols.AAPL, Symbols.AAPL.ID.Market, OptionStyle.American,\n                    OptionRight.Call, 1, _manualTimeProvider.GetUtcNow().AddDays(20));\n                _algorithm.AddOptionContract(symbol);\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                symbol = _algorithm.AddFuture(ticker).Symbol;\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                var expiration = _manualTimeProvider.GetUtcNow().AddDays(20);\n                symbol = Symbol.CreateFuture(\"ES\", Market.CME, expiration);\n                symbol = Symbol.CreateOption(symbol, symbol.ID.Market, OptionStyle.American, OptionRight.Call, 1, expiration);\n                _algorithm.AddFutureOptionContract(symbol);\n            }\n            _algorithm.OnEndOfTimeStep();\n\n            var receivedSecurityChanges = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), ts =>\n            {\n                foreach (var addedSecurity in ts.SecurityChanges.AddedSecurities)\n                {\n                    if (addedSecurity.Symbol == symbol)\n                    {\n                        receivedSecurityChanges = true;\n                        // we got what we wanted, end unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            },\n            alwaysInvoke: true,\n            // need to give time for future universe selection to trigger, midnight exchange tz\n            secondsTimeStep: 60,\n            endDate: _startDate.AddDays(1));\n\n            Assert.IsTrue(receivedSecurityChanges, \"Did not add symbol!\");\n        }\n\n        [Test]\n        public void DelistedEventEmitted_Equity()\n        {\n            _startDate = new DateTime(2007, 05, 17);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var feed = RunDataFeed();\n            var symbol = _algorithm.AddEquity(\"AAA.1\").Symbol;\n            _algorithm.OnEndOfTimeStep();\n            _algorithm.SetFinishedWarmingUp();\n\n            var receivedDelistedWarning = 0;\n            var receivedDelisted = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                foreach (var delistingEvent in ts.Slice.Delistings)\n                {\n                    if (delistingEvent.Key != symbol)\n                    {\n                        throw new RegressionTestException($\"Unexpected delisting for symbol {delistingEvent.Key}\");\n                    }\n\n                    if (delistingEvent.Value.Type == DelistingType.Warning)\n                    {\n                        Interlocked.Increment(ref receivedDelistedWarning);\n                    }\n                    if (delistingEvent.Value.Type == DelistingType.Delisted)\n                    {\n                        Interlocked.Increment(ref receivedDelisted);\n                        // we got what we wanted, end unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            },\n            alwaysInvoke: false,\n            secondsTimeStep: 3600 * 8,\n            endDate: _startDate.AddDays(3));\n\n            Assert.AreEqual(1, receivedDelistedWarning, $\"Did not receive {DelistingType.Warning}\");\n            Assert.AreEqual(1, receivedDelisted, $\"Did not receive {DelistingType.Delisted}\");\n        }\n\n        [Test]\n        public void DelistedEventEmitted()\n        {\n            _startDate = new DateTime(2016, 2, 18);\n            var delistingDate = Symbols.SPY_C_192_Feb19_2016.GetDelistingDate();\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            var feed = RunDataFeed();\n\n            var option = _algorithm.AddOptionContract(Symbols.SPY_C_192_Feb19_2016);\n            _algorithm.OnEndOfTimeStep();\n            _algorithm.SetFinishedWarmingUp();\n\n            var receivedDelistedWarning = 0;\n            var receivedDelisted = 0;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n                {\n                    foreach (var delisting in ts.Slice.Delistings)\n                    {\n                        if (delisting.Key != Symbols.SPY_C_192_Feb19_2016)\n                        {\n                            throw new RegressionTestException($\"Unexpected delisting for symbol {delisting.Key}\");\n                        }\n\n                        if (delisting.Value.Type == DelistingType.Warning)\n                        {\n                            Interlocked.Increment(ref receivedDelistedWarning);\n                        }\n                        if (delisting.Value.Type == DelistingType.Delisted)\n                        {\n                            Interlocked.Increment(ref receivedDelisted);\n                            // we got what we wanted, end unit test\n                            _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                        }\n                    }\n                },\n                alwaysInvoke: false,\n                secondsTimeStep: 3600 * 8,\n                endDate: delistingDate.AddDays(2));\n\n            Assert.AreEqual(1, receivedDelistedWarning, $\"Did not receive {DelistingType.Warning}\");\n            Assert.AreEqual(1, receivedDelisted, $\"Did not receive {DelistingType.Delisted}\");\n\n            Assert.IsTrue(option.IsDelisted);\n            Assert.IsFalse(option.IsTradable);\n            Assert.IsFalse(_algorithm.Securities.Any(x => x.Key == option.Symbol));\n        }\n\n        [TestCase(\"20140325\", typeof(CoarseFundamental))]\n        [TestCase(\"20201202\", typeof(ETFConstituentUniverse))]\n        public void UniverseDataIsHoldUntilTimeIsRight(string dateTime, Type universeData)\n        {\n            _startDate = Time.ParseDate(dateTime);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            Log.Debug($\"StartTime {_manualTimeProvider.GetUtcNow()}\");\n\n            var feed = RunDataFeed(getNextTicksFunction: fdqh => Enumerable.Empty<BaseData>());\n            if (universeData == typeof(CoarseFundamental))\n            {\n                _algorithm.AddUniverse(coarse => coarse.Take(10).Select(x => x.Symbol));\n            }\n            else\n            {\n                _algorithm.AddUniverse(_algorithm.Universe.ETF(\"SPY\", Market.USA, _algorithm.UniverseSettings,\n                    constituentData => constituentData.Take(10).Select(x => x.Symbol)));\n            }\n            // will add the universe\n            _algorithm.OnEndOfTimeStep();\n\n            var receivedUniverseData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                if (ts.UniverseData.Count > 0 &&\n                    ts.UniverseData.First().Value.Data.First().GetType().IsAssignableTo(universeData))\n                {\n                    var now = _manualTimeProvider.GetUtcNow();\n                    Log.Trace($\"Received BaseDataCollection {now}\");\n\n                    // Assert data got hold until time was right\n                    Assert.IsTrue(now.Hour < 23 && now.Hour > 5, $\"Unexpected now value: {now}\");\n                    receivedUniverseData = true;\n\n                    // we got what we wanted, end unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, sendUniverseData: true,\n                alwaysInvoke: true,\n                secondsTimeStep: 3600,\n                endDate: _startDate.AddDays(1));\n\n            Log.Debug($\"EndTime {_manualTimeProvider.GetUtcNow()}\");\n\n            Assert.IsTrue(receivedUniverseData, \"Did not receive universe data.\");\n        }\n\n        [Test]\n        public void CustomUniverseFineFundamentalDataGetsPipedCorrectly()\n        {\n            _startDate = new DateTime(2014, 10, 07, 15, 0, 0);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            // we use test ConstituentsUniverse, we have daily data for it\n            var customUniverseSymbol = new Symbol(\n                SecurityIdentifier.GenerateConstituentIdentifier(\n                    \"constituents-universe-qctest\",\n                    SecurityType.Equity,\n                    Market.USA),\n                \"constituents-universe-qctest\");\n            using var customUniverse = new ConstituentsUniverse(customUniverseSymbol,\n                new UniverseSettings(Resolution.Daily, 1, false, true, TimeSpan.Zero));\n\n            var feed = RunDataFeed();\n\n            var fineWasCalled = false;\n            _algorithm.AddUniverse(customUniverse,\n                fine =>\n                {\n                    var symbol = fine.First().Symbol;\n                    if (symbol == Symbols.AAPL)\n                    {\n                        fineWasCalled = true;\n                    }\n                    return new[] { symbol };\n                });\n            _algorithm.OnEndOfTimeStep();\n            // allow time for the base exchange to pick up the universe selection point\n            Thread.Sleep(100);\n            SecurityChanges securityChanges = null;\n            var receivedFundamentalsData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(10), ts =>\n            {\n                if (ts.UniverseData.Count > 0 &&\n                    ts.UniverseData.First().Value.Data.First() is Fundamental)\n                {\n                    securityChanges = ts.SecurityChanges;\n                    receivedFundamentalsData = true;\n                    // short cut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, secondsTimeStep: 60 * 60,\n                alwaysInvoke: true,\n                sendUniverseData: true,\n                endDate: _startDate.AddDays(10));\n\n            Assert.IsNotNull(securityChanges);\n            Assert.IsTrue(securityChanges.AddedSecurities.Single().Symbol.Value == \"AAPL\");\n            Assert.IsTrue(receivedFundamentalsData);\n            Assert.IsTrue(fineWasCalled);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void FineCoarseFundamentalDataGetsPipedCorrectlyWarmup(bool useWarmupResolution)\n        {\n            _startDate = new DateTime(2014, 3, 27);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            if (useWarmupResolution)\n            {\n                _algorithm.SetWarmup(1, Resolution.Daily);\n            }\n            else\n            {\n                _algorithm.SetWarmup(TimeSpan.FromDays(1));\n            }\n\n            var fineWasCalled = false;\n            var fineWasCalledDuringWarmup = false;\n            _algorithm.UniverseSettings.Resolution = Resolution.Second;\n            _algorithm.AddUniverse(coarse => coarse\n                    .Where(x => x.Symbol.ID.Symbol.Contains(\"AAPL\")).Select((fundamental, _) => fundamental.Symbol),\n                fine =>\n                {\n                    var symbol = fine.FirstOrDefault()?.Symbol;\n                    if (symbol == Symbols.AAPL)\n                    {\n                        if (_algorithm.IsWarmingUp)\n                        {\n                            fineWasCalledDuringWarmup = true;\n                        }\n                        else\n                        {\n                            fineWasCalled = true;\n                        }\n                        return new[] { symbol };\n                    }\n                    return Enumerable.Empty<Symbol>();\n                });\n\n            var feed = RunDataFeed(getNextTicksFunction: fdqh => Enumerable.Empty<BaseData>());\n\n            var receivedFundamentalsData = false;\n            var receivedFundamentalsDataDuringWarmup = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                if (ts.UniverseData.Count > 0 &&\n                    ts.UniverseData.First().Value.Data.First() is Fundamental)\n                {\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        receivedFundamentalsDataDuringWarmup = true;\n                    }\n                    else\n                    {\n                        receivedFundamentalsData = true;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, sendUniverseData: true, alwaysInvoke: true, secondsTimeStep: 3600, endDate: _startDate.AddDays(10));\n\n            Assert.IsTrue(fineWasCalledDuringWarmup);\n            Assert.IsTrue(fineWasCalled);\n            Assert.IsTrue(receivedFundamentalsData);\n            Assert.IsTrue(receivedFundamentalsDataDuringWarmup);\n        }\n\n        [TestCase(\"BTCUSD\")]\n        [TestCase(\"ADAUSDT\")]\n        public void MarginInterestDataGetsPipedCorrectly(string cryptoFuture)\n        {\n            _startDate = new DateTime(2022, 12, 12);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var feed = RunDataFeed(getNextTicksFunction: fdqh => Enumerable.Empty<BaseData>());\n\n            var asset = _algorithm.AddCryptoFuture(cryptoFuture);\n\n            var receivedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                var interestRates = ts.Slice.Get<MarginInterestRate>();\n                foreach (var interestRate in interestRates)\n                {\n                    receivedData = true;\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n\n                    Assert.AreEqual(asset.Symbol, interestRate.Key);\n                }\n            }, secondsTimeStep: 60 * 60 * 3, endDate: _startDate.AddDays(2));\n\n            Assert.IsTrue(receivedData);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        public void FineCoarseFundamentalDataGetsPipedCorrectly(int numberOfUniverses)\n        {\n            _startDate = new DateTime(2014, 3, 25);\n            CustomMockedFileBaseData.StartDate = _startDate;\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var feed = RunDataFeed(getNextTicksFunction: fdqh => Enumerable.Empty<BaseData>());\n\n            var fineWasCalled = new List<bool> { false, false };\n            for (var i = 0; i < numberOfUniverses; i++)\n            {\n                var index = i;\n                _algorithm.AddUniverse(coarse => coarse\n                        .Where(x => x.Symbol.ID.Symbol.Contains(\"AAPL\")).Select((fundamental, i) => fundamental.Symbol),\n                    fine =>\n                    {\n                        var symbol = fine.First().Symbol;\n                        if (symbol == Symbols.AAPL)\n                        {\n                            fineWasCalled[index] = true;\n                        }\n                        return new[] { symbol };\n                    });\n            }\n\n            var receivedFundamentalsData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), ts =>\n            {\n                if (ts.UniverseData.Count > 0 &&\n                    ts.UniverseData.First().Value.Data.First() is Fundamental)\n                {\n                    receivedFundamentalsData = true;\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, sendUniverseData: true, alwaysInvoke: true, secondsTimeStep: 1200, endDate: _startDate.AddDays(10));\n\n            Assert.IsTrue(receivedFundamentalsData);\n            for (var i = 0; i < numberOfUniverses; i++)\n            {\n                Assert.IsTrue(fineWasCalled[i]);\n            }\n        }\n\n        [TestCase(SecurityType.Future, true)]\n        [TestCase(SecurityType.Option, true)]\n        [TestCase(SecurityType.IndexOption, true)]\n        [TestCase(SecurityType.Future, false)]\n        [TestCase(SecurityType.Option, false)]\n        [TestCase(SecurityType.IndexOption, false)]\n        public void AddChainUniverseCanNotAdvanceTime(SecurityType securityType, bool strictEndTimes)\n        {\n            _algorithm.Settings.DailyPreciseEndTime = strictEndTimes;\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            _algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            // this reproduces GH issue #5245 where time can not advance and will keep it's default value\n            var feed = RunDataFeed(lookupSymbolsFunction: null, canPerformSelection: () => false);\n\n            if (securityType == SecurityType.Future)\n            {\n                _algorithm.AddFuture(Futures.Indices.SP500EMini);\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                _algorithm.AddIndexOption(\"SPX\");\n            }\n            else\n            {\n                _algorithm.AddOption(\"AAPL\");\n            }\n            // will add the universe\n            _algorithm.OnEndOfTimeStep();\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), ts =>\n            {\n                if (ts.UniverseData.Count > 0)\n                {\n                }\n            }, secondsTimeStep: 60 * 60 * 3, // 3 hour time step\n                alwaysInvoke: true);\n\n            Assert.AreNotEqual(AlgorithmStatus.RuntimeError, _algorithm.Status);\n        }\n\n        [Test]\n        public void ConstituentsUniverse()\n        {\n            var qqq = Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA);\n            // Set a date for which we have the test data.\n            // Note the date is a Tuesday\n            _startDate = new DateTime(2013, 10, 07);\n            var endDate = new DateTime(2013, 10, 10);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate.AddHours(20));\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            _algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var yieldedSymbols = false;\n            var yieldedNoneSymbol = false;\n            var feed = RunDataFeed();\n\n            using var constituentsUniverse = new ConstituentsUniverse(\n                new Symbol(\n                    SecurityIdentifier.GenerateConstituentIdentifier(\n                        \"constituents-universe-qctest\",\n                        SecurityType.Equity,\n                        Market.USA),\n                    \"constituents-universe-qctest\"),\n                _algorithm.UniverseSettings);\n            _algorithm.AddUniverse(constituentsUniverse);\n            // will add the universe\n            _algorithm.OnEndOfTimeStep();\n            // allow time for the base exchange to pick up the universe selection point\n            Thread.Sleep(100);\n            ConsumeBridge(feed, TimeSpan.FromSeconds(10), ts =>\n            {\n                if (ts.UniverseData.Count > 0)\n                {\n                    var data = ts.UniverseData.Values.First();\n                    if (data.EndTime >= new DateTime(2013, 10, 09))\n                    {\n                        Assert.AreEqual(1, data.Data.Count);\n                        Assert.IsTrue(data.Data.Any(baseData => baseData.Symbol == Symbol.None));\n                        yieldedNoneSymbol = true;\n                    }\n                    else if (data.EndTime >= new DateTime(2013, 10, 08))\n                    {\n                        Assert.AreEqual(2, data.Data.Count);\n                        Assert.IsTrue(data.Data.Any(baseData => baseData.Symbol == Symbols.AAPL));\n                        Assert.IsTrue(data.Data.Any(baseData => baseData.Symbol == qqq));\n                        yieldedSymbols = true;\n                    }\n\n                    if (yieldedSymbols && yieldedNoneSymbol)\n                    {\n                        // we got what we wanted, end unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, secondsTimeStep: 60 * 60,\n                alwaysInvoke: true,\n                endDate: endDate);\n\n            Assert.IsTrue(yieldedSymbols, \"Did not yielded Symbols\");\n            Assert.IsTrue(yieldedNoneSymbol, \"Did not yield NoneSymbol\");\n        }\n\n        [Test]\n        public void ThrowingDataQueueHandlerRuntimeError()\n        {\n            _algorithm.UniverseSettings.Resolution = Resolution.Daily;\n            _algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n            var feed = RunDataFeed(dataQueueHandler: new ThrowingDataQueueHandler());\n\n            _algorithm.AddEquity(\"SPY\");\n            _algorithm.OnEndOfTimeStep();\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), ts =>\n            {\n                if (_algorithm.Status == AlgorithmStatus.RuntimeError)\n                {\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, secondsTimeStep: 60 * 60 * 3);\n\n            Assert.AreEqual(AlgorithmStatus.RuntimeError, _algorithm.Status);\n        }\n\n        [Test]\n        public void FastExitsDoNotThrowUnhandledExceptions()\n        {\n            var algorithm = new AlgorithmStub();\n\n            // job is used to send into DataQueueHandler\n            var job = new LiveNodePacket();\n\n            // result handler is used due to dependency in SubscriptionDataReader\n            var resultHandler = new BacktestingResultHandler();\n\n            _feed = new TestableLiveTradingDataFeed(algorithm.Settings);\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n\n            var securityService = new SecurityService(\n                algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(_feed,\n                new UniverseSelection(algorithm, securityService, dataPermissionManager, TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                true,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            _synchronizer = new TestableLiveSynchronizer();\n            _synchronizer.Initialize(algorithm, dataManager, new());\n            algorithm.AddSecurities(Resolution.Tick, Enumerable.Range(0, 20).Select(x => x.ToStringInvariant()).ToList());\n            var getNextTicksFunction = Enumerable.Range(0, 20).Select(x => new Tick { Symbol = SymbolCache.GetSymbol(x.ToStringInvariant()) }).ToList();\n            _feed.DataQueueHandler = new FuncDataQueueHandler(handler => getNextTicksFunction, new RealTimeProvider(), _algorithm.Settings);\n\n            _feed.Initialize(\n                algorithm,\n                job,\n                resultHandler,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                TestGlobals.DataProvider,\n                dataManager,\n                _synchronizer,\n                new TestDataChannelProvider());\n\n            var unhandledExceptionWasThrown = false;\n            try\n            {\n                _feed.Exit();\n            }\n            catch (Exception ex)\n            {\n                QuantConnect.Logging.Log.Error(ex.ToString());\n                unhandledExceptionWasThrown = true;\n            }\n\n            Thread.Sleep(500);\n            Assert.IsFalse(unhandledExceptionWasThrown);\n        }\n\n        [Test]\n        public void HandlesAllTickTypesAtTickResolution()\n        {\n            var symbol = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase);\n            // setting func benchmark so we don't add SPY\n            _algorithm.SetBenchmark(time => 1);\n            var feed = RunDataFeed(\n                Resolution.Tick,\n                crypto: new List<string> { symbol.Value },\n                getNextTicksFunction: dqh => Enumerable.Range(1, 2)\n                    .Select(x => new Tick\n                    {\n                        Symbol = symbol,\n                        TickType = x % 2 == 0 ? TickType.Trade : TickType.Quote\n                    })\n                    .ToList());\n\n            var tradeCount = 0;\n            var quoteCount = 0;\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(1), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    emittedData = true;\n                    tradeCount += ts.Slice.Ticks[symbol].Count(tick => tick.TickType == TickType.Trade);\n                    quoteCount += ts.Slice.Ticks[symbol].Count(tick => tick.TickType == TickType.Quote);\n                }\n            });\n\n            Assert.IsTrue(emittedData, \"No data was emitted\");\n            Assert.AreNotEqual(0, quoteCount);\n            Assert.AreNotEqual(0, tradeCount);\n        }\n\n        [Test]\n        public void SuspiciousTicksAreNotFilteredAtTickResolution()\n        {\n            var endDate = _startDate.AddDays(10);\n            var symbol = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n\n            var feed = RunDataFeed(\n                Resolution.Tick,\n                equities: new List<string> { symbol.Value },\n                getNextTicksFunction: dqh => Enumerable.Range(0, 1)\n                    .Select(\n                        x => new Tick\n                        {\n                            Symbol = symbol,\n                            TickType = TickType.Trade,\n                            Suspicious = x % 2 == 0\n                        })\n                    .ToList());\n\n            var emittedData = false;\n            var suspiciousTicksReceived = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    emittedData = true;\n\n                    foreach (var kvp in ts.Slice.Ticks)\n                    {\n                        foreach (var tick in kvp.Value)\n                        {\n                            if (tick.Suspicious)\n                            {\n                                suspiciousTicksReceived = true;\n                                // we got what we wanted shortcut unit test\n                                _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                            }\n                        }\n                    }\n                }\n            }, endDate: endDate);\n\n            Assert.IsTrue(emittedData);\n            Assert.IsTrue(suspiciousTicksReceived);\n        }\n\n        [TestCase(SecurityType.Equity, TickType.Trade)]\n        [TestCase(SecurityType.Forex, TickType.Quote)]\n        [TestCase(SecurityType.Crypto, TickType.Trade)]\n        [TestCase(SecurityType.Crypto, TickType.Quote)]\n        public void SuspiciousTicksAreFilteredAtNonTickResolution(SecurityType securityType, TickType tickType)\n        {\n            var lastTime = _manualTimeProvider.GetUtcNow();\n            var feed = RunDataFeed(Resolution.Minute,\n                equities: securityType == SecurityType.Equity ? new List<string> { Symbols.SPY.ToString() } : new List<string>(),\n                forex: securityType == SecurityType.Forex ? new List<string> { Symbols.EURUSD.ToString() } : new List<string>(),\n                crypto: securityType == SecurityType.Crypto ? new List<string> { Symbols.BTCUSD.ToString() } : new List<string>(),\n                getNextTicksFunction: (fdqh =>\n                {\n                    var time = _manualTimeProvider.GetUtcNow();\n                    if (time == lastTime) return Enumerable.Empty<BaseData>();\n                    lastTime = time;\n                    var tickTime = lastTime.AddMinutes(-1).ConvertFromUtc(TimeZones.NewYork);\n                    return fdqh.Subscriptions.Where(symbol => !_algorithm.UniverseManager.ContainsKey(symbol)) // its not a universe\n                        .Select(symbol => new Tick(tickTime, symbol, 1, 2)\n                        {\n                            Quantity = 1,\n                            TickType = tickType,\n                            Suspicious = true\n                        }).ToList();\n                }));\n\n            var emittedData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(2), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    emittedData = true;\n                }\n            });\n\n            Assert.IsFalse(emittedData);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void SkipLiveDividend(bool warmup)\n        {\n            var symbol = Symbols.AAPL;\n            // aapl has a dividend on the 6th\n            if (warmup)\n            {\n                _startDate = new DateTime(2013, 11, 09);\n                _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n                _algorithm.SetWarmup(5);\n            }\n            else\n            {\n                _startDate = new DateTime(2013, 11, 05);\n                _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            }\n\n            var startPortfolioValue = _algorithm.Portfolio.TotalPortfolioValue;\n            var feed = RunDataFeed(Resolution.Daily, equities: new List<string> { symbol.Value },\n                    getNextTicksFunction: delegate\n                    {\n                        return Enumerable.Empty<BaseData>();\n                    });\n\n            var emittedDividend = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.Dividends.ContainsKey(symbol))\n                {\n                    Assert.AreEqual(warmup, _algorithm.IsWarmingUp);\n\n                    emittedDividend = true;\n                    // we got what we wanted shortcut unit test\n                    _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                }\n            }, secondsTimeStep: warmup ? 60 * 60 : 60 * 60 * 5,\n            endDate: _startDate.AddDays(30));\n\n            Assert.IsTrue(emittedDividend);\n            // we do not handle dividends in live trading, we leave it for the cash sync\n            Assert.AreEqual(startPortfolioValue, _algorithm.Portfolio.TotalPortfolioValue);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void LiveSplitHandling(bool warmup)\n        {\n            // there's an split starting on the 7th\n            var symbol = Symbols.AAPL;\n            if (warmup)\n            {\n                _startDate = new DateTime(2014, 06, 10);\n                _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n                _algorithm.SetWarmup(6);\n            }\n            else\n            {\n                _startDate = new DateTime(2014, 06, 5);\n                _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n            }\n\n            var feed = RunDataFeed(Resolution.Daily, equities: new List<string> { symbol.Value },\n                    getNextTicksFunction: delegate\n                    {\n                        return Enumerable.Empty<BaseData>();\n                    });\n\n            var holdings = _algorithm.Securities[symbol].Holdings;\n            holdings.SetHoldings(10, quantity: 100);\n            var startPortfolioValue = _algorithm.Portfolio.TotalPortfolioValue;\n\n            var emittedSplit = false;\n            var emittedSplitWarning = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.Splits.TryGetValue(symbol, out var split))\n                {\n                    Assert.AreEqual(warmup, _algorithm.IsWarmingUp);\n\n                    if (split.Type == SplitType.SplitOccurred)\n                    {\n                        emittedSplit = true;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                    else\n                    {\n                        emittedSplitWarning = true;\n                    }\n                }\n            }, secondsTimeStep: warmup ? 60 * 60 : 60 * 60 * 12,\n            endDate: _startDate.AddDays(30));\n\n            Assert.IsTrue(emittedSplit);\n            Assert.IsTrue(emittedSplitWarning);\n            Assert.AreEqual((double)startPortfolioValue, (double)_algorithm.Portfolio.TotalPortfolioValue, delta: (double)(0.1m * _algorithm.Portfolio.TotalPortfolioValue));\n            if (!warmup)\n            {\n                Assert.AreNotEqual(10, holdings.Quantity);\n                Assert.AreNotEqual(100, holdings.AveragePrice);\n            }\n            else\n            {\n                // during warmup they shouldn't change\n                Assert.AreEqual(100, holdings.Quantity);\n                Assert.AreEqual(10, holdings.AveragePrice);\n            }\n        }\n\n        [Test]\n        public void HandlesAuxiliaryDataAtTickResolution()\n        {\n            // aapl has a dividend on the 6th\n            _startDate = new DateTime(2013, 11, 05);\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate);\n\n            var symbol = Symbols.AAPL;\n\n            var feed = RunDataFeed(\n                Resolution.Tick,\n                equities: new List<string> { symbol.Value },\n                getNextTicksFunction: delegate\n                {\n                    return new[] { (BaseData)new Tick { Symbol = symbol, TickType = TickType.Trade } };\n                });\n\n            var emittedTicks = false;\n            var emittedAuxData = false;\n            ConsumeBridge(feed, TimeSpan.FromSeconds(1), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    if (ts.Slice.Ticks.ContainsKey(symbol))\n                    {\n                        emittedTicks = true;\n                    }\n                    if (ts.Slice.Dividends.ContainsKey(symbol))\n                    {\n                        emittedAuxData = true;\n                    }\n\n                    if (emittedAuxData && emittedTicks)\n                    {\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, secondsTimeStep: 60 * 60 * 4,\n            endDate: _startDate.AddDays(2));\n\n            Assert.IsTrue(emittedTicks);\n            Assert.IsTrue(emittedAuxData);\n        }\n\n        [Test]\n        public void AggregatesTicksToTradeBar()\n        {\n            var symbol = Symbols.AAPL;\n\n            var feed = RunDataFeed(Resolution.Second, equities: new List<string> { symbol.Value });\n\n            var emittedTradeBars = false;\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(3), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    if (ts.Slice.Bars.ContainsKey(symbol))\n                    {\n                        emittedTradeBars = true;\n                        // we got what we wanted shortcut unit test\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                    }\n                }\n            }, endDate: _startDate.AddDays(1));\n\n            Assert.IsTrue(emittedTradeBars);\n        }\n\n        [Test]\n        public void DoesNotAggregateTicksToTradeBar()\n        {\n            var symbol = Symbols.AAPL;\n            var feed = RunDataFeed(\n                Resolution.Tick,\n                equities: new List<string> { symbol.Value },\n                getNextTicksFunction: delegate\n                {\n                    return Enumerable.Range(0, 2)\n                        .Select(_ => (BaseData)new Tick { Symbol = symbol, TickType = TickType.Trade })\n                        .ToList();\n                });\n\n            var emittedTradebars = false;\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(1), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    if (ts.Slice.Bars.ContainsKey(symbol))\n                    {\n                        emittedTradebars = true;\n                    }\n                }\n            });\n\n            Assert.IsFalse(emittedTradebars);\n        }\n\n        [Test]\n        public void FillForwardsWarmUpDataToLiveFeed(\n            [Values(Resolution.Minute, Resolution.Daily)] Resolution warmupResolution,\n            [Values] bool fromHistoryProviderWarmUp,\n            [Values] bool withLiveDataPoint)\n        {\n            var symbol = Symbols.SPY;\n            TradeBar lastHistoryWarmUpBar = null;\n            if (fromHistoryProviderWarmUp)\n            {\n                _startDate = new DateTime(2025, 06, 12);\n\n                var historyBarTime = warmupResolution == Resolution.Minute ? _startDate.AddHours(-12) : _startDate.AddDays(-2);\n                lastHistoryWarmUpBar = new TradeBar(historyBarTime, symbol, 1, 1, 1, 1, 100, warmupResolution.ToTimeSpan());\n\n                var historyProvider = new Mock<IHistoryProvider>();\n                historyProvider\n                    .Setup(m => m.GetHistory(It.IsAny<IEnumerable<Data.HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                    .Returns(new List<Slice>\n                    {\n                        new Slice(lastHistoryWarmUpBar.EndTime,\n                            new List<BaseData> { lastHistoryWarmUpBar },\n                            lastHistoryWarmUpBar.EndTime.ConvertToUtc(TimeZones.NewYork))\n                    });\n                _algorithm.SetHistoryProvider(historyProvider.Object);\n            }\n            else\n            {\n                _startDate = new DateTime(2013, 10, 12);\n            }\n\n            _algorithm.Settings.DailyPreciseEndTime = false;\n            _algorithm.SetStartDate(_startDate);\n            _manualTimeProvider.SetCurrentTimeUtc(_algorithm.Time.ConvertToUtc(TimeZones.NewYork));\n\n            _algorithm.SetBenchmark(_ => 0);\n            _algorithm.SetWarmUp(warmupResolution == Resolution.Minute ? 60 * 8 : 10, warmupResolution);\n\n            var firstLiveBarTime = warmupResolution == Resolution.Minute\n                ? _startDate.AddHours(8)\n                : _startDate.AddHours(0.25);\n            var firstLiveBar = new TradeBar(firstLiveBarTime, symbol, 1, 5, 1, 3, 100, Time.OneMinute);\n            var liveData = withLiveDataPoint ? new List<BaseData> { firstLiveBar } : new List<BaseData>();\n            var dqh = new TestDataQueueHandler { DataPerSymbol = new() { { symbol, liveData } } };\n            var feed = RunDataFeed(Resolution.Minute, dataQueueHandler: dqh, equities: new() { \"SPY\" });\n            _algorithm.OnEndOfTimeStep();\n\n            TradeBar lastWarmupTradeBar = null;\n            TradeBar lastTradeBar = null;\n            var dataFillForwardedFromWarmupCount = 0;\n            var dataFillForwardedFromLiveCount = 0;\n            var gotLivePoint = false;\n\n            var stopTime = withLiveDataPoint ? firstLiveBar.EndTime.AddHours(0.25) : _startDate.AddHours(0.5);\n            if (warmupResolution == Resolution.Minute)\n            {\n                stopTime = withLiveDataPoint? firstLiveBar.EndTime.AddHours(1) : _startDate.AddHours(8);\n            }\n\n            ConsumeBridge(feed, TimeSpan.FromSeconds(5), true, ts =>\n            {\n                if (ts.Slice.HasData)\n                {\n                    Assert.IsTrue(ts.Slice.Bars.TryGetValue(symbol, out var tradeBar));\n\n                    if (_algorithm.IsWarmingUp)\n                    {\n                        lastWarmupTradeBar = tradeBar;\n                    }\n                    else\n                    {\n                        lastTradeBar = tradeBar;\n\n                        if (lastTradeBar.EndTime == firstLiveBar.EndTime && withLiveDataPoint)\n                        {\n                            Assert.IsFalse(lastTradeBar.IsFillForward);\n                            gotLivePoint = true;\n                        }\n                        else\n                        {\n                            Assert.IsTrue(lastTradeBar.IsFillForward);\n\n                            if (!withLiveDataPoint || lastTradeBar.EndTime < firstLiveBar.EndTime)\n                            {\n                                dataFillForwardedFromWarmupCount++;\n                            }\n                            else if (withLiveDataPoint && lastTradeBar.EndTime > firstLiveBar.EndTime)\n                            {\n                                dataFillForwardedFromLiveCount++;\n                            }\n                        }\n\n                        if (tradeBar.EndTime >= stopTime)\n                        {\n                            // short cut\n                            _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                        }\n                    }\n                }\n            },\n            endDate: _startDate.AddDays(60),\n            secondsTimeStep: 60);\n\n            // Assert we actually got warmup data\n            Assert.IsNotNull(lastWarmupTradeBar);\n\n            // Assert we got normal data\n            Assert.IsNotNull(lastTradeBar);\n\n            // Assert we got fill-forwarded data before the actual live data\n            Assert.Greater(dataFillForwardedFromWarmupCount, 0);\n\n            // Assert we got fill-forwarded data after the actual live data\n            if (withLiveDataPoint)\n            {\n                Assert.IsTrue(gotLivePoint);\n                Assert.Greater(dataFillForwardedFromLiveCount, 0);\n            }\n            else\n            {\n                Assert.AreEqual(0, dataFillForwardedFromLiveCount);\n            }\n        }\n\n        private IDataFeed RunDataFeed(Resolution resolution = Resolution.Second, List<string> equities = null, List<string> forex = null, List<string> crypto = null,\n            Func<FuncDataQueueHandler, IEnumerable<BaseData>> getNextTicksFunction = null,\n            Func<Symbol, bool, string, IEnumerable<Symbol>> lookupSymbolsFunction = null,\n            Func<bool> canPerformSelection = null, IDataQueueHandler dataQueueHandler = null,\n            bool runPostInitialize = true)\n        {\n            _algorithm.SetStartDate(_startDate);\n            _algorithm.SetDateTime(_manualTimeProvider.GetUtcNow());\n\n            var lastTime = _manualTimeProvider.GetUtcNow();\n            getNextTicksFunction ??= (fdqh =>\n            {\n                var time = _manualTimeProvider.GetUtcNow();\n                if (time == lastTime) return Enumerable.Empty<BaseData>();\n                lastTime = time;\n                var tickTimeUtc = lastTime.AddMinutes(-1);\n                return fdqh.SubscriptionDataConfigs.Where(config => !_algorithm.UniverseManager.ContainsKey(config.Symbol)) // its not a universe\n                    .SelectMany(config =>\n                        {\n                            if (_algorithm.IsWarmingUp)\n                            {\n                                return Enumerable.Empty<Tick>();\n                            }\n                            var ticks = new List<Tick>\n                            {\n                                new Tick(tickTimeUtc.ConvertFromUtc(config.ExchangeTimeZone), config.Symbol, 1, 2)\n                                {\n                                    Quantity = 1,\n                                    // Symbol could not be in the Securities collections for the custom Universe tests. AlgorithmManager is in charge of adding them, and we are not executing that code here.\n                                    TickType = config.TickType\n                                }\n                            };\n                            return ticks;\n                        }\n                    ).ToList();\n            });\n\n            // job is used to send into DataQueueHandler\n            var job = new LiveNodePacket();\n            // result handler is used due to dependency in SubscriptionDataReader\n            var resultHandler = new BacktestingResultHandler();\n\n            if (dataQueueHandler == null)\n            {\n                _dataQueueHandler = new FuncDataQueueHandlerUniverseProvider(getNextTicksFunction,\n                    lookupSymbolsFunction ?? ((symbol, _, _) =>\n                    {\n                        var date = _manualTimeProvider.GetUtcNow()\n                            .ConvertFromUtc(MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType).TimeZone)\n                            .Date;\n\n                        var symbols = new List<Symbol>();\n                        for (var i = 0; i < 4; i++)\n                        {\n                            if (symbol.SecurityType.IsOption())\n                            {\n                                foreach (var optionRight in new[] { OptionRight.Call, OptionRight.Put })\n                                {\n                                    symbols.Add(Symbol.CreateOption(symbol.Underlying ?? symbol,\n                                        symbol.ID.Market,\n                                        symbol.SecurityType.DefaultOptionStyle(),\n                                        optionRight,\n                                        i,\n                                        date.AddDays(i)));\n                                }\n                            }\n                            else\n                            {\n                                symbols.Add(Symbol.CreateFuture(symbol.ID.Symbol, symbol.ID.Market, date.AddDays(i)));\n                            }\n                        }\n                        return symbols;\n                    }),\n                    canPerformSelection ?? (() => true), _manualTimeProvider, _algorithm.Settings);\n            }\n\n            _feed = new TestableLiveTradingDataFeed(_algorithm.Settings, dataQueueHandler ?? _dataQueueHandler);\n            _feed.TestDataQueueHandlerManager.TimeProvider = _manualTimeProvider;\n            var fileProvider = TestGlobals.DataProvider;\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(_algorithm.Portfolio.CashBook, marketHoursDatabase, symbolPropertiesDataBase, _algorithm, RegisteredSecurityDataTypesProvider.Null, new SecurityCacheProvider(_algorithm.Portfolio), algorithm: _algorithm);\n            _algorithm.Securities.SetSecurityService(securityService);\n            var dataPermissionManager = new DataPermissionManager();\n            _dataManager = new DataManager(_feed,\n                new UniverseSelection(_algorithm, securityService, dataPermissionManager, fileProvider),\n                _algorithm,\n                _algorithm.TimeKeeper,\n                marketHoursDatabase,\n                true,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            _algorithm.SubscriptionManager.SetDataManager(_dataManager);\n            _algorithm.AddSecurities(resolution, equities, forex, crypto);\n            _synchronizer = new TestableLiveSynchronizer(_manualTimeProvider, 10);\n            _synchronizer.Initialize(_algorithm, _dataManager, new());\n\n            _feed.Initialize(_algorithm, job, resultHandler, TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider, fileProvider, _dataManager, _synchronizer, new TestDataChannelProvider());\n            if (runPostInitialize)\n            {\n                _algorithm.PostInitialize();\n            }\n\n            return _feed;\n        }\n\n        private void ConsumeBridge(IDataFeed feed, TimeSpan timeout, Action<TimeSlice> handler, bool sendUniverseData = false,\n            int secondsTimeStep = 1, bool alwaysInvoke = false, DateTime endDate = default(DateTime))\n        {\n            ConsumeBridge(feed, timeout, alwaysInvoke, handler, sendUniverseData: sendUniverseData, secondsTimeStep: secondsTimeStep, endDate: endDate);\n        }\n\n        private void ConsumeBridge(IDataFeed feed,\n            TimeSpan timeout,\n            bool alwaysInvoke,\n            Action<TimeSlice> handler,\n            bool noOutput = true,\n            bool sendUniverseData = false,\n            int secondsTimeStep = 1,\n            DateTime endDate = default(DateTime))\n        {\n            var endTime = DateTime.UtcNow.Add(timeout);\n            bool startedReceivingata = false;\n            using var cancellationTokenSource = new CancellationTokenSource(timeout * 2);\n            _algorithm.SetLocked();\n            foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                _algorithm.ProcessSecurityChanges(timeSlice.SecurityChanges);\n                _algorithm.SetDateTime(timeSlice.Time);\n                if (!noOutput)\n                {\n                    ConsoleWriteLine(\"\\r\\n\" + $\"Now (EDT): {DateTime.UtcNow.ConvertFromUtc(TimeZones.NewYork):o}\" +\n                                     $\". TimeSlice.Time (EDT): {timeSlice.Time.ConvertFromUtc(TimeZones.NewYork):o}. HasData {timeSlice.Slice?.HasData}\");\n                }\n\n                if (timeSlice.IsTimePulse)\n                {\n                    continue;\n                }\n\n                AlgorithmManager.HandleDividends(timeSlice, _algorithm, liveMode: true);\n                AlgorithmManager.HandleSplits(timeSlice, _algorithm, liveMode: true);\n\n                if (!startedReceivingata\n                    && (timeSlice.Slice.Count != 0\n                        || sendUniverseData && timeSlice.UniverseData.Count > 0))\n                {\n                    startedReceivingata = true;\n                }\n                if (startedReceivingata || alwaysInvoke)\n                {\n                    handler(timeSlice);\n                }\n                _algorithm.OnEndOfTimeStep();\n                _manualTimeProvider.AdvanceSeconds(secondsTimeStep);\n                if (!_algorithm.IsWarmingUp)\n                {\n                    Thread.Sleep(10);\n                }\n                if (endDate != default(DateTime) && _manualTimeProvider.GetUtcNow() > endDate\n                    || endTime <= DateTime.UtcNow)\n                {\n                    feed.Exit();\n                    cancellationTokenSource.Cancel();\n                    // allow LTDF tasks to finish\n                    Thread.Sleep(10);\n                    return;\n                }\n            }\n        }\n\n        private class Count\n        {\n            public int Value;\n        }\n\n        private static IEnumerable<BaseData> ProduceBenchmarkTicks(FuncDataQueueHandler fdqh, Count count)\n        {\n            for (int i = 0; i < 10000; i++)\n            {\n                foreach (var symbol in fdqh.Subscriptions)\n                {\n                    count.Value++;\n                    yield return new Tick { Symbol = symbol };\n                }\n            }\n        }\n\n        private void ConsoleWriteLine(string line = \"\")\n        {\n            if (LogsEnabled)\n            {\n                Log.Trace(line);\n            }\n        }\n\n        private static TestCaseData[] DataTypeTestCases => new[]\n        {\n            // Equity - Hourly resolution\n            // We expect 7 hourly bars for 6.5 hours in open market hours\n            new TestCaseData(Symbols.SPY, Resolution.Hour, 1, 0, 7, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Equity - Minute resolution\n            // We expect 30 minute bars for 0.5 hours in open market hours\n            new TestCaseData(Symbols.SPY, Resolution.Minute, 1, 0, (int)(0.5 * 60), (int)(0.5 * 60), 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Equity - Tick resolution\n            // In this test we only emit ticks once per hour\n            // We expect only 6 ticks -- the 4 PM tick is not received because it's outside market hours -> times 2 (quote/trade bar)\n            new TestCaseData(Symbols.SPY, Resolution.Tick, 1, (7 - 1) * 2, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Forex - FXCM\n            new TestCaseData(Symbols.EURUSD, Resolution.Hour, 1, 0, 0, 24, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbols.EURUSD, Resolution.Minute, 1, 0, 0, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            // emit at the start and end time\n            new TestCaseData(Symbols.EURUSD, Resolution.Tick, 1, 24, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Forex - Oanda\n            new TestCaseData(Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda), Resolution.Hour, 1, 0, 0, 24, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda), Resolution.Minute, 1, 0, 0, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            // emit at the start and end time\n            new TestCaseData(Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda), Resolution.Tick, 1, 24, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // CFD - FXCM\n            new TestCaseData(Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.FXCM), Resolution.Hour, 1, 0, 0, 14, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.FXCM), Resolution.Minute, 1, 0, 0, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbol.Create(\"DE30EUR\", SecurityType.Cfd, Market.FXCM), Resolution.Tick, 1, 14, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // CFD - Oanda\n            new TestCaseData(Symbols.DE30EUR, Resolution.Hour, 1, 0, 0, 21, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbols.DE30EUR, Resolution.Minute, 1, 0, 0, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbols.DE30EUR, Resolution.Tick, 1, 21, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Crypto\n            new TestCaseData(Symbols.BTCUSD, Resolution.Hour, 1, 0, 24, 24, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbols.BTCUSD, Resolution.Minute, 1, 0, 1 * 60, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            // x2 because counting trades and quotes. Emit at the start and end time\n            new TestCaseData(Symbols.BTCUSD, Resolution.Tick, 1, 25 * 2, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Futures\n            // ES has two session breaks totalling 1h 15m, so total trading hours = 22.75\n            new TestCaseData(Symbols.Future_ESZ18_Dec2018, Resolution.Hour, 1, 0, 23, 23, 0, 0, false, _instances[typeof(BaseData)]),\n            new TestCaseData(Symbols.Future_ESZ18_Dec2018, Resolution.Minute, 1, 0, 1 * 60, 1 * 60, 0, 0, false, _instances[typeof(BaseData)]),\n            // x2 because counting trades and quotes. Emit at the start and end time\n            new TestCaseData(Symbols.Future_ESZ18_Dec2018, Resolution.Tick, 1, 24 * 2, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Options\n            new TestCaseData(Symbols.SPY_C_192_Feb19_2016, Resolution.Hour, 1, 0, 7, 7, 0, 0, false, _instances[typeof(BaseData)]),\n            // We expect 30 minute bars for 0.5 hours in open market hours\n            new TestCaseData(Symbols.SPY_C_192_Feb19_2016, Resolution.Minute, 1, 0, (int)(0.5 * 60), (int)(0.5 * 60), 0, 0, false, _instances[typeof(BaseData)]),\n            // x2 because counting trades and quotes\n            new TestCaseData(Symbols.SPY_C_192_Feb19_2016, Resolution.Tick, 1, (7 - 1) * 2, 0, 0, 0, 0, false, _instances[typeof(BaseData)]),\n\n            // Custom data not supported\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData2), Symbols.AAPL, Market.USA), Resolution.Hour, 1, 0, 0, 0, 0, 24 * 2, true, _instances[typeof(IndexedLinkedData2)]),\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData2), Symbols.AAPL, Market.USA), Resolution.Minute, 1, 0, 0, 0, 0, 60 * 2, true, _instances[typeof(IndexedLinkedData2)]),\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData2), Symbols.AAPL, Market.USA), Resolution.Tick, 1, 0, 0, 0, 0, 24, true, _instances[typeof(IndexedLinkedData2)]),\n\n            //// Custom data streamed\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData), Symbols.AAPL, Market.USA), Resolution.Hour, 1, 0, 0, 0, 0, 24, false, _instances[typeof(IndexedLinkedData)]),\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData), Symbols.AAPL, Market.USA), Resolution.Minute, 1, 0, 0, 0, 0, 60, false, _instances[typeof(IndexedLinkedData)]),\n            new TestCaseData(Symbol.CreateBase(typeof(IndexedLinkedData), Symbols.AAPL, Market.USA), Resolution.Tick, 1, 0, 0, 0, 0, 24, false, _instances[typeof(IndexedLinkedData)])\n        };\n\n        [TestCaseSource(nameof(DataTypeTestCases))]\n        public void HandlesAllTypes<T>(\n            Symbol symbol,\n            Resolution resolution,\n            int days,\n            int expectedTicksReceived,\n            int expectedTradeBarsReceived,\n            int expectedQuoteBarsReceived,\n            int expectedAuxPointsReceived,\n            int expectedCustomPointsReceived,\n            bool shouldThrowException,\n            T customDataType) where T : BaseData, new()\n        {\n            // startDate and endDate are in algorithm time zone. Start date has to be before the expiration of symbol\n            var startDate = new DateTime(2015, 6, 8);\n            var endDate = startDate.AddDays(days);\n\n            if (resolution == Resolution.Minute)\n            {\n                // for faster test execution time\n                startDate = startDate.AddHours(9);\n                endDate = startDate.AddHours(1);\n            }\n\n            var algorithmTimeZone = TimeZones.NewYork;\n            DateTimeZone exchangeTimeZone = null;\n\n            var timeProvider = new ManualTimeProvider(algorithmTimeZone);\n            timeProvider.SetCurrentTime(startDate);\n\n            var actualPricePointsEnqueued = 0;\n            var actualAuxPointsEnqueued = 0;\n            var lastTime = DateTime.MinValue;\n            using var emittedData = new ManualResetEvent(false);\n\n            var algorithm = new QCAlgorithm();\n            using var dataQueueStarted = new ManualResetEvent(false);\n            _dataQueueHandler = new FuncDataQueueHandler(fdqh =>\n            {\n                dataQueueStarted.Set();\n\n                if (exchangeTimeZone == null)\n                {\n                    return Enumerable.Empty<BaseData>();\n                }\n\n                var utcTime = timeProvider.GetUtcNow();\n                var exchangeTime = utcTime.ConvertFromUtc(exchangeTimeZone);\n                var ended = exchangeTime > endDate.ConvertTo(algorithmTimeZone, exchangeTimeZone);\n                if (exchangeTime == lastTime || ended)\n                {\n                    if (ended)\n                    {\n                        emittedData.Set();\n                    }\n                    return Enumerable.Empty<BaseData>();\n                }\n\n                lastTime = exchangeTime;\n\n                var algorithmTime = utcTime.ConvertFromUtc(algorithmTimeZone);\n\n                var dataPoints = new List<BaseData>();\n\n                if (symbol.SecurityType == SecurityType.Base)\n                {\n                    var dataPoint = new T\n                    {\n                        Symbol = symbol,\n                        EndTime = exchangeTime,\n                        Value = actualPricePointsEnqueued++\n                    };\n                    dataPoints.Add(dataPoint);\n\n                    ConsoleWriteLine(\n                        $\"{algorithmTime} - FuncDataQueueHandler emitted custom data point: {dataPoint}\");\n                }\n                else\n                {\n                    var tickType = TickType.Quote;\n                    var dataPoint = new Tick\n                    {\n                        Symbol = symbol,\n                        Time = exchangeTime,\n                        EndTime = exchangeTime,\n                        TickType = tickType,\n                        Value = actualPricePointsEnqueued\n                    };\n\n                    if (symbol.SecurityType != SecurityType.Equity\n                        || resolution != Resolution.Daily\n                        || resolution != Resolution.Hour)\n                    {\n                        actualPricePointsEnqueued++;\n                        // equity has minute/second/tick quote data\n                        dataPoints.Add(dataPoint);\n                    }\n\n                    ConsoleWriteLine(\n                        $\"{algorithmTime} - FuncDataQueueHandler emitted {tickType} tick: {dataPoint}\");\n\n                    dataPoint = new Tick\n                    {\n                        Symbol = symbol,\n                        Time = exchangeTime,\n                        EndTime = exchangeTime,\n                        TickType = TickType.Trade,\n                        Value = actualPricePointsEnqueued++\n                    };\n\n                    dataPoints.Add(dataPoint);\n\n                    ConsoleWriteLine(\n                        $\"{algorithmTime} - FuncDataQueueHandler emitted Trade tick: {dataPoint}\");\n                }\n\n                emittedData.Set();\n                return dataPoints;\n            }, timeProvider, algorithm.Settings);\n\n            _feed = new TestableLiveTradingDataFeed(algorithm.Settings, _dataQueueHandler);\n\n            algorithm.SetDateTime(timeProvider.GetUtcNow());\n\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(\n                    m => m.GetHistory(It.IsAny<IEnumerable<Data.HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(Enumerable.Empty<Slice>());\n            algorithm.SetHistoryProvider(historyProvider.Object);\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(\n                algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(_feed,\n                new UniverseSelection(algorithm, securityService, dataPermissionManager, TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                true,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            algorithm.SetLiveMode(true);\n\n            var mock = new Mock<ITransactionHandler>();\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algorithm.Transactions.SetOrderProcessor(mock.Object);\n\n            _synchronizer = new TestableLiveSynchronizer(timeProvider, 10);\n            _synchronizer.Initialize(algorithm, dataManager, new());\n\n            Security security;\n            switch (symbol.SecurityType)\n            {\n                case SecurityType.Base:\n                    algorithm.AddEquity(symbol.Underlying.Value, resolution, symbol.ID.Market,\n                        fillForward: false);\n\n                    if (customDataType.RequiresMapping())\n                    {\n                        security = algorithm.AddData<T>(symbol.Value, resolution,\n                            fillForward: false);\n                    }\n                    else\n                    {\n                        throw new NotImplementedException($\"Custom data not implemented: {symbol}\");\n                    }\n                    break;\n\n                case SecurityType.Future:\n                    security = algorithm.AddFutureContract(symbol, resolution, fillForward: false, extendedMarketHours: true);\n                    break;\n\n                case SecurityType.Option:\n                    security = algorithm.AddOptionContract(symbol, resolution, fillForward: false);\n                    break;\n\n                default:\n                    security = algorithm.AddSecurity(symbol.SecurityType, symbol.Value, resolution,\n                        symbol.ID.Market, false, 1, false);\n                    break;\n            }\n\n            _feed.Initialize(algorithm, new LiveNodePacket(), new BacktestingResultHandler(),\n                TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider,\n                dataManager, _synchronizer, new TestDataChannelProvider());\n\n            if (!dataQueueStarted.WaitOne(TimeSpan.FromMilliseconds(5000)))\n            {\n                throw new TimeoutException(\"Timeout waiting for IDQH to start\");\n            }\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            // for tick resolution, we advance one hour at a time for less unit test run time\n            TimeSpan advanceTimeSpan;\n            switch (resolution)\n            {\n                case Resolution.Tick:\n                default:\n                    advanceTimeSpan = TimeSpan.FromHours(1);\n                    break;\n                case Resolution.Second:\n                    advanceTimeSpan = TimeSpan.FromSeconds(1);\n                    break;\n                case Resolution.Minute:\n                    advanceTimeSpan = TimeSpan.FromSeconds(60);\n                    break;\n                case Resolution.Hour:\n                    advanceTimeSpan = TimeSpan.FromMinutes(60);\n                    break;\n                case Resolution.Daily:\n                    advanceTimeSpan = TimeSpan.FromHours(24);\n                    break;\n            }\n            try\n            {\n                algorithm.PostInitialize();\n                var actualTicksReceived = 0;\n                var actualTradeBarsReceived = 0;\n                var actualQuoteBarsReceived = 0;\n                var actualAuxPointsReceived = 0;\n                var actualCustomPointsReceived = 0;\n                var sliceCount = 0;\n                foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n                {\n                    if (timeSlice.IsTimePulse)\n                    {\n                        algorithm.OnEndOfTimeStep();\n                        exchangeTimeZone = security.Exchange.TimeZone;\n                        continue;\n                    }\n                    sliceCount++;\n\n                    // give enough time to the producer to emit\n                    if (sliceCount == 1 && !emittedData.WaitOne(300))\n                    {\n                        Assert.Fail(\"Timeout waiting for data generation\");\n                    }\n\n                    if (resolution == Resolution.Tick)\n                    {\n                        if (timeSlice.Slice.Ticks.ContainsKey(symbol))\n                        {\n                            foreach (var tick in timeSlice.Slice.Ticks[symbol].ToList())\n                            {\n                                actualTicksReceived++;\n\n                                ConsoleWriteLine(\n                                    $\"{algorithm.Time} - Tick received, value: {tick.Value} {tick.TickType} (count: {actualTicksReceived})\"\n                                );\n                            }\n                        }\n\n                        if (timeSlice.Slice.Dividends.ContainsKey(symbol))\n                        {\n                            actualAuxPointsReceived++;\n\n                            ConsoleWriteLine(\n                                $\"{algorithm.Time} - Dividend received, value: {timeSlice.Slice.Dividends[symbol].Value} (count: {actualAuxPointsReceived})\"\n                            );\n                        }\n\n                        var customDataCount = timeSlice.Slice.Get<T>().Count;\n                        if (customDataCount > 0)\n                        {\n                            actualCustomPointsReceived += customDataCount;\n\n                            ConsoleWriteLine(\n                                $\"{algorithm.Time} - Custom received, value: {timeSlice.Slice.Get<T>().First().Value} (count: {actualCustomPointsReceived})\"\n                            );\n                        }\n                    }\n                    else\n                    {\n                        if (timeSlice.Slice.Bars.ContainsKey(symbol))\n                        {\n                            actualTradeBarsReceived++;\n\n                            ConsoleWriteLine(\n                                $\"{algorithm.Time} - TradeBar received, value: {timeSlice.Slice.Bars[symbol].Value} (count: {actualTradeBarsReceived})\"\n                            );\n                        }\n\n                        if (timeSlice.Slice.Dividends.ContainsKey(symbol))\n                        {\n                            actualAuxPointsReceived++;\n\n                            ConsoleWriteLine(\n                                $\"{algorithm.Time} - Dividend received, value: {timeSlice.Slice.Dividends[symbol].Value} (count: {actualAuxPointsReceived})\"\n                            );\n                        }\n\n                        if (timeSlice.Slice.QuoteBars.ContainsKey(symbol))\n                        {\n                            actualQuoteBarsReceived++;\n\n                            ConsoleWriteLine(\n                                $\"{algorithm.Time} - QuoteBar received, value: {timeSlice.Slice.QuoteBars[symbol].Value} (count: {actualQuoteBarsReceived})\"\n                            );\n                        }\n\n                        if (symbol.SecurityType == SecurityType.Base)\n                        {\n                            var customDataCount = timeSlice.Slice.Get<T>().Count;\n                            if (customDataCount > 0)\n                            {\n                                actualCustomPointsReceived += customDataCount;\n\n                                ConsoleWriteLine(\n                                    $\"{algorithm.Time} - Custom received, value: {timeSlice.Slice.Get<T>().First().Value} (count: {actualCustomPointsReceived})\"\n                                );\n                            }\n                        }\n                    }\n\n                    algorithm.OnEndOfTimeStep();\n\n                    _synchronizer.NewDataEvent.Reset();\n                    emittedData.Reset();\n                    timeProvider.Advance(advanceTimeSpan);\n\n                    // give enough time to the producer to emit\n                    if (!emittedData.WaitOne(300))\n                    {\n                        Assert.Fail($\"Timeout waiting for data generation at {algorithm.Time} algorithm tz\");\n                    }\n\n                    var currentTime = timeProvider.GetUtcNow();\n                    algorithm.SetDateTime(currentTime);\n\n                    ConsoleWriteLine($\"Algorithm time set to {currentTime.ConvertFromUtc(algorithmTimeZone)}\");\n\n                    if (shouldThrowException && algorithm.Status == AlgorithmStatus.RuntimeError)\n                    {\n                        // expected\n                        return;\n                    }\n\n                    if (currentTime.ConvertFromUtc(algorithmTimeZone) > endDate)\n                    {\n                        _feed.Exit();\n                        cancellationTokenSource.Cancel();\n                        break;\n                    }\n\n                    if (resolution != Resolution.Tick)\n                    {\n                        var amount = currentTime.Ticks % resolution.ToTimeSpan().Ticks;\n                        if (amount == 0)\n                        {\n                            // let's avoid race conditions and give time for the funDataQueueHandler thread to distribute the data among the consolidators\n                            if (!_synchronizer.NewDataEvent.Wait(500))\n                            {\n                                if (!shouldThrowException || algorithm.Status != AlgorithmStatus.RuntimeError)\n                                {\n                                    Assert.Fail(\"Timeout waiting for data generation\");\n                                }\n                            }\n                        }\n                    }\n                    else\n                    {\n                        _synchronizer.NewDataEvent.Wait(300);\n                    }\n                }\n\n                emittedData.DisposeSafely();\n                dataQueueStarted.DisposeSafely();\n\n                Log.Trace(\n                    $\"SliceCount:{sliceCount} - PriceData: Enqueued:{actualPricePointsEnqueued} TicksReceived:{actualTicksReceived}\"\n                );\n                Log.Trace(\n                    $\"SliceCount:{sliceCount} - PriceData: Enqueued:{actualPricePointsEnqueued} TradeBarsReceived:{actualTradeBarsReceived}\"\n                );\n                Log.Trace(\n                    $\"SliceCount:{sliceCount} - PriceData: Enqueued:{actualPricePointsEnqueued} QuoteBarsReceived:{actualQuoteBarsReceived}\"\n                );\n                Log.Trace(\n                    $\"SliceCount:{sliceCount} - AuxData: Enqueued:{actualAuxPointsEnqueued} Received:{actualAuxPointsReceived}\"\n                );\n                Log.Trace(\n                    $\"SliceCount:{sliceCount} - AuxData: Enqueued:{actualPricePointsEnqueued} Received:{actualCustomPointsReceived}\"\n                );\n\n                Assert.IsTrue(actualPricePointsEnqueued > 0);\n\n                if (resolution == Resolution.Tick)\n                {\n                    if (symbol.SecurityType == SecurityType.Base)\n                    {\n                        Assert.IsTrue(actualTicksReceived == 0);\n                    }\n                    else\n                    {\n                        Assert.IsTrue(actualTicksReceived > 0);\n                    }\n                }\n                else\n                {\n                    switch (symbol.SecurityType)\n                    {\n                        case SecurityType.Equity:\n                            Assert.IsTrue(actualTradeBarsReceived > 0);\n                            if (resolution == Resolution.Daily || resolution == Resolution.Hour)\n                            {\n                                Assert.IsTrue(actualQuoteBarsReceived == 0);\n                            }\n                            else\n                            {\n                                Assert.IsTrue(actualQuoteBarsReceived > 0);\n\n                            }\n\n                            break;\n\n                        case SecurityType.Forex:\n                        case SecurityType.Cfd:\n                            Assert.IsTrue(actualQuoteBarsReceived > 0);\n                            break;\n\n                        case SecurityType.Crypto:\n                        case SecurityType.Option:\n                        case SecurityType.Future:\n                            Assert.IsTrue(actualTradeBarsReceived > 0);\n                            Assert.IsTrue(actualQuoteBarsReceived > 0);\n                            break;\n\n                        case SecurityType.Base:\n                            Assert.IsTrue(actualCustomPointsReceived > 0);\n                            break;\n                    }\n                }\n\n                Assert.AreEqual(expectedTicksReceived, actualTicksReceived);\n                Assert.AreEqual(expectedTradeBarsReceived, actualTradeBarsReceived);\n                Assert.AreEqual(expectedQuoteBarsReceived, actualQuoteBarsReceived);\n                Assert.AreEqual(expectedAuxPointsReceived, actualAuxPointsReceived);\n                Assert.AreEqual(expectedCustomPointsReceived, actualCustomPointsReceived);\n\n                dataManager.RemoveAllSubscriptions();\n                _dataQueueHandler.DisposeSafely();\n            }\n            catch (Exception exception)\n            {\n                Log.Error(exception);\n                if (!shouldThrowException)\n                {\n                    throw;\n                }\n            }\n            finally\n            {\n                dataManager?.RemoveAllSubscriptions();\n                if (!cancellationTokenSource.IsCancellationRequested)\n                {\n                    cancellationTokenSource.Cancel();\n                }\n                _dataQueueHandler.DisposeSafely();\n                _feed?.Exit();\n            }\n        }\n\n        [TestCase(SecurityType.Future, 4)]\n        [TestCase(SecurityType.Option, 1232)]\n        [TestCase(SecurityType.IndexOption, 6)]\n        public void HandlesFutureAndOptionChainUniverse(SecurityType securityType, int expectedContractsCount)\n        {\n            Log.DebuggingEnabled = LogsEnabled;\n\n            // startDate and endDate are in algorithm time zone. Midnight so selection happens right away\n            var startDate = securityType switch\n            {\n                SecurityType.Option => new DateTime(2015, 12, 24),\n                SecurityType.IndexOption => new DateTime(2021, 01, 04),\n                SecurityType.Future => new DateTime(2013, 07, 11),\n                _ => throw new ArgumentOutOfRangeException(nameof(securityType), securityType, null)\n            };\n            var endDate = startDate.AddDays(2.3);\n\n            var algorithmTimeZone = TimeZones.NewYork;\n            DateTimeZone exchangeTimeZone = null;\n\n            var timeProvider = new ManualTimeProvider(algorithmTimeZone);\n            timeProvider.SetCurrentTime(startDate);\n\n            var lastTime = DateTime.MinValue;\n            var timeAdvanceStep = TimeSpan.FromMinutes(180);\n            using var timeAdvanced = new AutoResetEvent(true);\n            using var started = new ManualResetEvent(false);\n            var futureSelectionCount = 0;\n\n            var selectedFutureSymbols = new HashSet<Symbol>();\n\n            Symbol canonicalOptionSymbol = null;\n            Exception lookupSymbolsException = null;\n\n            var futureSymbols = new HashSet<Symbol>();\n            var optionSymbols = new HashSet<Symbol>();\n\n            var algorithm = new QCAlgorithm();\n            _dataQueueHandler = new FuncDataQueueHandlerUniverseProvider(\n                fdqh =>\n                {\n                    started.Set();\n                    if (!timeAdvanced.WaitOne(TimeSpan.FromMilliseconds(5000)))\n                    {\n                        Log.Error(\"Timeout waiting for time to advance\");\n                        return Enumerable.Empty<BaseData>();\n                    }\n\n                    if (exchangeTimeZone == null)\n                    {\n                        return Enumerable.Empty<BaseData>();\n                    }\n\n                    var utcTime = timeProvider.GetUtcNow();\n                    var exchangeTime = utcTime.ConvertFromUtc(exchangeTimeZone);\n                    if (exchangeTime == lastTime ||\n                        exchangeTime > endDate.ConvertTo(algorithmTimeZone, exchangeTimeZone))\n                    {\n                        return Enumerable.Empty<BaseData>();\n                    }\n\n                    lastTime = exchangeTime;\n\n                    var dataPoints = new List<BaseData>();\n                    if (securityType.IsOption())\n                    {\n                        dataPoints.Add(new Tick\n                        {\n                            Symbol = canonicalOptionSymbol,\n                            Time = exchangeTime,\n                            EndTime = exchangeTime,\n                            TickType = TickType.Trade,\n                            Value = 100,\n                            Quantity = 1\n                        });\n                        dataPoints.Add(new Tick\n                        {\n                            Symbol = canonicalOptionSymbol.Underlying,\n                            Time = exchangeTime,\n                            EndTime = exchangeTime,\n                            TickType = TickType.Trade,\n                            Value = 100,\n                            Quantity = 1\n                        });\n\n                        dataPoints.AddRange(\n                            optionSymbols.Select(\n                                symbol => new Tick\n                                {\n                                    Symbol = symbol,\n                                    Time = exchangeTime,\n                                    EndTime = exchangeTime,\n                                    TickType = TickType.Trade,\n                                    Value = 100,\n                                    Quantity = 1\n                                }));\n                    }\n                    else if (securityType == SecurityType.Future)\n                    {\n                        if (selectedFutureSymbols.Count > 0)\n                        {\n                            var canonicalFutureSymbol = selectedFutureSymbols.First().Canonical;\n                            var mappedSymbol = (algorithm.Securities[canonicalFutureSymbol] as Future).Mapped;\n\n                            dataPoints.AddRange(\n                                selectedFutureSymbols.Union(new[] { canonicalFutureSymbol, mappedSymbol }).Select(\n                                    symbol => new Tick\n                                    {\n                                        Symbol = symbol,\n                                        Time = exchangeTime,\n                                        EndTime = exchangeTime,\n                                        TickType = TickType.Trade,\n                                        Value = 100,\n                                        Quantity = 1\n                                    }));\n                        }\n                    }\n\n                    Log.Debug($\"DQH: Emitting data point(s) at {utcTime.ConvertFromUtc(algorithmTimeZone)} ({algorithmTimeZone})\");\n\n                    return dataPoints;\n                },\n\n                // LookupSymbols\n                (symbol, includeExpired, securityCurrency) => Enumerable.Empty<Symbol>(),\n\n                // CanAdvanceTime\n                () =>\n                {\n                    var time = timeProvider.GetUtcNow().ConvertFromUtc(algorithmTimeZone);\n                    var result = time.Hour >= 1 && time.Hour < 23 && time.Day != 21;\n\n                    Log.Debug($\"CanPerformSelection() called at {time} ({algorithmTimeZone}), returning {result}\");\n\n                    return result;\n                },\n                timeProvider, algorithm.Settings);\n\n            _feed = new TestableLiveTradingDataFeed(_algorithm.Settings, _dataQueueHandler);\n\n            algorithm.SetDateTime(timeProvider.GetUtcNow());\n            algorithm.SetBenchmark(t => 0);\n\n            var historyProvider = new Mock<IHistoryProvider>();\n            historyProvider.Setup(\n                    m => m.GetHistory(It.IsAny<IEnumerable<Data.HistoryRequest>>(), It.IsAny<DateTimeZone>()))\n                .Returns(Enumerable.Empty<Slice>());\n            algorithm.SetHistoryProvider(historyProvider.Object);\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(\n                algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(_feed,\n                new UniverseSelection(algorithm, securityService, dataPermissionManager, TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                true,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n            algorithm.SetLiveMode(true);\n\n            var mock = new Mock<ITransactionHandler>();\n            mock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algorithm.Transactions.SetOrderProcessor(mock.Object);\n\n            _synchronizer = new TestableLiveSynchronizer(timeProvider, 10);\n            _synchronizer.Initialize(algorithm, dataManager, new());\n\n            if (securityType == SecurityType.Option)\n            {\n                algorithm.AddEquity(\"GOOG\", Resolution.Minute);\n                var option = algorithm.AddOption(\"GOOG\", Resolution.Minute, Market.USA);\n                option.SetFilter(x => x.StandardsOnly());\n                exchangeTimeZone = option.Exchange.TimeZone;\n\n                canonicalOptionSymbol = option.Symbol;\n            }\n            else if (securityType == SecurityType.IndexOption)\n            {\n                algorithm.AddIndex(\"SPX\", Resolution.Minute);\n                var option = algorithm.AddIndexOption(\"SPX\", Resolution.Minute, Market.USA);\n                option.SetFilter(x => x);\n                exchangeTimeZone = option.Exchange.TimeZone;\n\n                canonicalOptionSymbol = option.Symbol;\n            }\n            else if (securityType == SecurityType.Future)\n            {\n                var future = algorithm.AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, extendedMarketHours: true, fillForward: false);\n                future.SetFilter(u =>\n                {\n                    futureSelectionCount++;\n                    var result = u.IncludeWeeklys().Contracts(x => x.Take(2));\n                    selectedFutureSymbols.UnionWith(result.Take(2).Select(x => x.Symbol));\n                    return result;\n                });\n                exchangeTimeZone = future.Exchange.TimeZone;\n            }\n            else\n            {\n                throw new NotSupportedException($\"Unsupported security type: {securityType}\");\n            }\n\n            _feed.Initialize(algorithm, new LiveNodePacket(), new BacktestingResultHandler(),\n                TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider, TestGlobals.DataProvider,\n                dataManager, _synchronizer, new TestDataChannelProvider());\n\n            using var cancellationTokenSource = new CancellationTokenSource();\n\n            algorithm.PostInitialize();\n\n            DateTime? lastSecurityChangedTime = null;\n\n            if (!started.WaitOne(TimeSpan.FromMilliseconds(5000)))\n            {\n                throw new TimeoutException(\"Timeout waiting for IDQH to start\");\n            }\n\n            var interval = TimeSpan.FromMilliseconds(100);\n            Timer timer = null;\n            timer = new Timer(\n                _ =>\n                {\n                    try\n                    {\n                        // stop the timer to prevent reentrancy\n                        timer.Change(Timeout.Infinite, Timeout.Infinite);\n\n                        timeProvider.Advance(timeAdvanceStep);\n                        Log.Debug($\"Time advanced to {timeProvider.GetUtcNow()} (UTC)\");\n                        timeAdvanced.Set();\n\n                        // restart the timer\n                        timer.Change(interval, interval);\n                    }\n                    catch (ObjectDisposedException)\n                    {\n                    }\n                }, null, interval, interval);\n\n            // We should wait for the base exchange to pick up the universe and push a selection data point\n            Thread.Sleep(100);\n\n            bool IsPastEndTime(out DateTime currentTime)\n            {\n                currentTime = timeProvider.GetUtcNow();\n                if (currentTime.ConvertFromUtc(algorithmTimeZone) > endDate)\n                {\n                    _feed.Exit();\n                    cancellationTokenSource.Cancel();\n                    return true;\n                }\n\n                return false;\n            }\n\n            foreach (var timeSlice in _synchronizer.StreamData(cancellationTokenSource.Token))\n            {\n                if (timeSlice.IsTimePulse || !timeSlice.Slice.HasData && timeSlice.SecurityChanges == SecurityChanges.None)\n                {\n                    if (IsPastEndTime(out _)) break;\n\n                    continue;\n                }\n\n                var futureContractCount = 0;\n                var optionContractCount = 0;\n\n                if (securityType == SecurityType.Future)\n                {\n                    foreach (var futureChain in timeSlice.Slice.FutureChains.Values)\n                    {\n                        var symbols = futureChain.Contracts.Values.Select(x => x.Symbol).ToList();\n                        futureContractCount += symbols.Count;\n                        Log.Debug($\"{timeSlice.Time} - future contracts: {string.Join(\",\", symbols)}\");\n                    }\n                    Log.Debug($\"{timeSlice.Time} - future symbols: {string.Join(\",\", futureSymbols)}\");\n                }\n                else if (securityType.IsOption())\n                {\n                    foreach (var optionChain in timeSlice.Slice.OptionChains.Values)\n                    {\n                        var symbols = optionChain.Contracts.Values.Select(x => x.Symbol).ToList();\n                        optionContractCount += symbols.Count;\n                        Log.Debug($\"{timeSlice.Time} - option contracts: {string.Join(\",\", symbols)}\");\n                    }\n                    Log.Debug($\"{timeSlice.Time} - option symbols: {string.Join(\",\", optionSymbols)}\");\n                }\n\n                if (lastSecurityChangedTime != null &&\n                    timeSlice.Time > lastSecurityChangedTime.Value.Add(timeAdvanceStep)\n                    && timeSlice.Slice.HasData)\n                {\n                    if (securityType == SecurityType.Future)\n                    {\n                        // -2 to remove canonical & internal since it's not part of the chain\n                        Assert.AreEqual(futureSymbols.Count - 2, futureContractCount);\n\n                        foreach (var symbol in futureSymbols)\n                        {\n                            // only assert there is data for non internal subscriptions\n                            if (algorithm.SubscriptionManager.SubscriptionDataConfigService\n                                .GetSubscriptionDataConfigs(symbol).Any())\n                            {\n                                Assert.IsTrue(timeSlice.Slice.ContainsKey(symbol), $\"{symbol} was not found, has [{string.Join(\",\", timeSlice.Slice.Keys)}]\");\n                            }\n                        }\n                    }\n\n                    if (securityType.IsOption() && timeSlice.Slice.OptionChains.Values.Count > 0)\n                    {\n                        Assert.AreEqual(optionSymbols.Count, optionContractCount);\n\n                        foreach (var symbol in optionSymbols)\n                        {\n                            Assert.IsTrue(timeSlice.Slice.ContainsKey(symbol));\n                        }\n                    }\n                }\n\n                foreach (var security in timeSlice.SecurityChanges.AddedSecurities)\n                {\n                    if (security.Symbol.SecurityType == SecurityType.Future)\n                    {\n                        lastSecurityChangedTime = timeSlice.Time;\n                        Log.Debug($\"{timeSlice.Time} - Adding future symbol: {security.Symbol}\");\n\n                        futureSymbols.Add(security.Symbol);\n                    }\n                    else if (security.Symbol.SecurityType.IsOption())\n                    {\n                        lastSecurityChangedTime = timeSlice.Time;\n                        Log.Debug($\"{timeSlice.Time} - Adding option symbol: {security.Symbol}\");\n                        optionSymbols.Add(security.Symbol);\n                    }\n                }\n\n                foreach (var security in timeSlice.SecurityChanges.RemovedSecurities)\n                {\n                    if (security.Symbol.SecurityType == SecurityType.Future)\n                    {\n                        lastSecurityChangedTime = timeSlice.Time;\n                        Log.Debug($\"{timeSlice.Time} - Removing future symbol: {security.Symbol}\");\n                        futureSymbols.Remove(security.Symbol);\n                    }\n                    else if (security.Symbol.SecurityType.IsOption())\n                    {\n                        lastSecurityChangedTime = timeSlice.Time;\n                        Log.Debug($\"{timeSlice.Time} - Removing option symbol: {security.Symbol}\");\n                        optionSymbols.Remove(security.Symbol);\n                    }\n                }\n\n                algorithm.OnEndOfTimeStep();\n                // We should wait for the base exchange to pick up the universe and push a selection data point\n                Thread.Sleep(150);\n\n                foreach (var baseDataCollection in timeSlice.UniverseData.Values)\n                {\n                    var symbols = string.Join(\",\", baseDataCollection.Data.Select(x => x.Symbol));\n                    Log.Debug($\"{timeSlice.Time} - universe data: {symbols}\");\n                }\n\n                // Get current time and check if we should stop the algorithm\n                IsPastEndTime(out var currentTime);\n                algorithm.SetDateTime(currentTime);\n\n                Log.Debug($\"{timeSlice.Time} - Algorithm time set to {currentTime.ConvertFromUtc(algorithmTimeZone)} ({algorithmTimeZone})\");\n            }\n\n            if (lookupSymbolsException != null)\n            {\n                throw lookupSymbolsException;\n            }\n\n            if (securityType == SecurityType.Future)\n            {\n                Assert.AreEqual(2, futureSelectionCount);\n                // we add 2 symbols + 1 continuous future + 1 continuous future mapped symbol\n                Assert.AreEqual(4, futureSymbols.Count, \"Future symbols count mismatch\");\n            }\n            else if (securityType.IsOption())\n            {\n                Assert.AreEqual(expectedContractsCount, optionSymbols.Count, \"Option symbols count mismatch\");\n            }\n\n            dataManager.RemoveAllSubscriptions();\n            _dataQueueHandler.DisposeSafely();\n            timeAdvanced.DisposeSafely();\n            started.DisposeSafely();\n            timer.Dispose();\n        }\n\n        // Reproduces https://github.com/QuantConnect/Lean/issues/8363\n        [TestCase(Resolution.Second)]\n        [TestCase(Resolution.Minute)]\n        [TestCase(Resolution.Hour)]\n        [TestCase(Resolution.Daily)]\n        public void UsesFullPeriodDataForConsolidation(Resolution resolution)\n        {\n            _startDate = new DateTime(2014, 3, 27);\n            _algorithm.SetStartDate(_startDate);\n            _algorithm.Settings.DailyPreciseEndTime = false;\n\n            // Add a few milliseconds to the start date to mimic a real world live scenario, where the time provider\n            // will not always return an perfect rounded-down to second time\n            _manualTimeProvider.SetCurrentTimeUtc(_startDate.AddMilliseconds(1).ConvertToUtc(TimeZones.NewYork));\n\n            var symbol = Symbols.SPY;\n            _algorithm.SetBenchmark(x => 0);\n\n            var data = new[]\n            {\n                new [] { 108, 109, 90, 109, 72 },\n                new [] { 105, 105, 94, 100, 175 },\n                new [] { 93, 109, 90, 90, 170 },\n                new [] { 95, 105, 90, 91, 19 },\n                new [] { 91, 109, 91, 93, 132 },\n                new [] { 98, 109, 94, 102, 175 },\n                new [] { 107, 107, 91, 96, 97 },\n                new [] { 105, 108, 91, 101, 124 },\n                new [] { 105, 107, 91, 107, 81 },\n                new [] { 91, 109, 91, 101, 168 },\n                new [] { 93, 107, 90, 107, 199 },\n                new [] { 101, 108, 90, 90, 169 },\n                new [] { 101, 109, 90, 103, 14 },\n                new [] { 92, 109, 90, 105, 55 },\n                new [] { 96, 107, 92, 92, 176 },\n                new [] { 94, 105, 90, 94, 28 },\n                new [] { 105, 109, 91, 93, 172 },\n                new [] { 107, 109, 93, 93, 137 },\n                new [] { 95, 109, 91, 97, 168 },\n                new [] { 103, 109, 91, 107, 178 },\n                new [] { 96, 109, 96, 100, 168 },\n                new [] { 90, 108, 90, 102, 63 },\n                new [] { 100, 109, 96, 102, 134 },\n                new [] { 95, 103, 90, 94, 39 },\n                new [] { 105, 109, 91, 108, 117 },\n                new [] { 106, 106, 91, 103, 20 },\n                new [] { 95, 109, 93, 107, 7 },\n                new [] { 104, 108, 90, 102, 150 },\n                new [] { 94, 109, 90, 99, 178 },\n                new [] { 99, 109, 90, 106, 150 },\n            };\n\n            var seconds = 0;\n            var timeSpan = resolution.ToTimeSpan();\n            using var dataQueueHandler = new TestDataQueueHandler\n            {\n                DataPerSymbol = new Dictionary<Symbol, List<BaseData>>\n                {\n                    {\n                        symbol,\n                        data\n                            .Select(prices => new TradeBar(_startDate.Add(timeSpan * seconds++),\n                                symbol,\n                                prices[0],\n                                prices[1],\n                                prices[2],\n                                prices[3],\n                                prices[4],\n                                timeSpan))\n                            .Cast<BaseData>()\n                            .ToList()\n                    }\n                }\n            };\n\n            var feed = RunDataFeed(\n                resolution: resolution,\n                equities: new() { \"SPY\" },\n                dataQueueHandler: dataQueueHandler);\n\n            var consolidatedData = new List<TradeBar>();\n            var consolidatorUpdateData = new List<TradeBar>();\n\n            const int consolidatorBarCountSpan = 6;\n            var consolidatedCount = 0;\n            var dataCountUsedForFirstConsolidatedBar = 0;\n\n            _algorithm.Consolidate<TradeBar>(symbol, timeSpan * consolidatorBarCountSpan, (consolidatedBar) =>\n            {\n                _algorithm.Debug($\"Consolidated: {_algorithm.Time} - {consolidatedBar}\");\n\n                // The first consolidated bar will be consolidated from 1 to consolidatorSpanSeconds second bars,\n                // from the start time to the next multiple of consolidatorSpanSeconds\n                var dataCountToTake = 0;\n                if (consolidatedCount++ == 0)\n                {\n                    Assert.LessOrEqual(consolidatorUpdateData.Count, consolidatorBarCountSpan);\n                    dataCountToTake = dataCountUsedForFirstConsolidatedBar = consolidatorUpdateData.Count;\n                }\n                else\n                {\n                    Assert.AreEqual(dataCountUsedForFirstConsolidatedBar + consolidatorBarCountSpan * (consolidatedCount - 1),\n                        consolidatorUpdateData.Count);\n                    dataCountToTake = consolidatorBarCountSpan;\n                }\n\n                var dataForCurrentConsolidatedBar = consolidatorUpdateData\n                    .Skip(consolidatorBarCountSpan * (consolidatedCount - 1))\n                    .Take(dataCountToTake)\n                    .ToList();\n\n                Assert.AreEqual(consolidatedBar.Time, dataForCurrentConsolidatedBar[0].Time);\n                Assert.AreEqual(consolidatedBar.EndTime, dataForCurrentConsolidatedBar[^1].EndTime);\n\n                var expectedOpen = dataForCurrentConsolidatedBar[0].Open;\n                Assert.AreEqual(expectedOpen, consolidatedBar.Open);\n\n                var expectedClose = dataForCurrentConsolidatedBar[^1].Close;\n                Assert.AreEqual(expectedClose, consolidatedBar.Close);\n\n                var expectedHigh = dataForCurrentConsolidatedBar.Max(x => x.High);\n                Assert.AreEqual(expectedHigh, consolidatedBar.High);\n\n                var expectedLow = dataForCurrentConsolidatedBar.Min(x => x.Low);\n                Assert.AreEqual(expectedLow, consolidatedBar.Low);\n\n                var expectedVolume = dataForCurrentConsolidatedBar.Sum(x => x.Volume);\n                Assert.AreEqual(expectedVolume, consolidatedBar.Volume);\n            });\n\n            ConsumeBridge(feed,\n                TimeSpan.FromSeconds(5),\n                true,\n                timeSlice =>\n                {\n                    if (consolidatorUpdateData.Count >= data.Length)\n                    {\n                        // Ran out of data, stop the feed\n                        _manualTimeProvider.SetCurrentTimeUtc(Time.EndOfTime);\n                        return;\n                    }\n\n                    // Mimic the algorithm manager consolidators scan:\n\n                    // First, scan for consolidators that need to be updated\n                    // NOTE: Rounding time down to mimic the algorithm manager consolidators scan\n                    _algorithm.SubscriptionManager.ScanPastConsolidators(timeSlice.Time.RoundDown(Time.OneSecond), _algorithm);\n\n                    // Then, update the consolidators with the new data\n                    if (timeSlice.ConsolidatorUpdateData.Count > 0)\n                    {\n                        var timeKeeper = _algorithm.TimeKeeper;\n                        foreach (var update in timeSlice.ConsolidatorUpdateData)\n                        {\n                            var localTime = timeKeeper.GetLocalTimeKeeper(update.Target.ExchangeTimeZone).LocalTime;\n                            var consolidators = update.Target.Consolidators;\n                            foreach (var consolidator in consolidators)\n                            {\n                                foreach (var dataPoint in update.Data)\n                                {\n                                    if (consolidator is TradeBarConsolidator tradeBarConsolidator)\n                                    {\n                                        consolidatorUpdateData.Add(dataPoint as TradeBar);\n                                    }\n\n                                    consolidator.Update(dataPoint);\n                                }\n\n                                // scan for time after we've pumped all the data through for this consolidator\n                                consolidator.Scan(localTime);\n                            }\n                        }\n                    }\n                },\n                endDate: _startDate.Date.AddDays(60),\n                secondsTimeStep: (int)timeSpan.TotalSeconds);\n\n            Assert.AreEqual(dataQueueHandler.DataPerSymbol.Values.Single().Count / consolidatorBarCountSpan, consolidatedCount);\n        }\n\n        private class TestFundamentalDataProviderTrue : IFundamentalDataProvider\n        {\n            public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n            {\n                if (securityIdentifier == SecurityIdentifier.Empty)\n                {\n                    return default;\n                }\n                return Get(time, securityIdentifier, name);\n            }\n\n            private dynamic Get(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty enumName)\n            {\n                var name = Enum.GetName(enumName);\n                switch (name)\n                {\n                    case \"HasFundamentalData\":\n                        return true;\n                }\n                return null;\n            }\n            public void Initialize(IDataProvider dataProvider, bool liveMode)\n            {\n            }\n        }\n\n        private class ThrowingDataQueueHandler : IDataQueueHandler\n        {\n            public bool IsConnected => true;\n            public void Dispose()\n            { }\n            public void SetJob(LiveNodePacket job)\n            { }\n            public IEnumerator<BaseData> Subscribe(SubscriptionDataConfig dataConfig, EventHandler newDataAvailableHandler)\n            {\n                throw new NotImplementedException();\n            }\n            public void Unsubscribe(SubscriptionDataConfig dataConfig)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n\n    internal class TestableLiveTradingDataFeed : LiveTradingDataFeed\n    {\n        public IDataQueueHandler DataQueueHandler;\n        public TestDataQueueHandlerManager TestDataQueueHandlerManager;\n\n        public TestableLiveTradingDataFeed(IAlgorithmSettings settings, IDataQueueHandler dataQueueHandler = null)\n        {\n            DataQueueHandler = dataQueueHandler;\n            TestDataQueueHandlerManager = new(new[] { DataQueueHandler }, settings);\n        }\n\n        protected override BaseDataExchange GetBaseDataExchange()\n        {\n            var result = base.GetBaseDataExchange();\n            result.SleepInterval = 10;\n            return result;\n        }\n\n        protected override IDataQueueHandler GetDataQueueHandler()\n        {\n            return TestDataQueueHandlerManager;\n        }\n\n        public override void Exit()\n        {\n            base.Exit();\n            DataQueueHandler.DisposeSafely();\n        }\n    }\n\n    internal class TestDataQueueHandlerManager : DataQueueHandlerManager\n    {\n        public ITimeProvider TimeProvider { get; set; }\n\n        public TestDataQueueHandlerManager(IEnumerable<IDataQueueHandler> dataQueueHandlers, IAlgorithmSettings settings)\n            : base(settings)\n        {\n            DataHandlers = dataQueueHandlers.ToList();\n        }\n        protected override ITimeProvider InitializeFrontierTimeProvider()\n        {\n            return TimeProvider;\n        }\n    }\n\n    internal class TestDataChannelProvider : DataChannelProvider\n    {\n        public override bool ShouldStreamSubscription(SubscriptionDataConfig config)\n        {\n            if (config.Type == typeof(IndexedLinkedData))\n            {\n                return true;\n            }\n            return base.ShouldStreamSubscription(config);\n        }\n    }\n\n\n    internal class TestableLiveSynchronizer : LiveSynchronizer\n    {\n        private readonly ITimeProvider _timeProvider;\n        private readonly int _newLiveDataTimeout;\n\n        public ManualResetEventSlim NewDataEvent { get; set; }\n\n        public TestableLiveSynchronizer(ITimeProvider timeProvider = null, int? newLiveDataTimeout = null)\n        {\n            NewDataEvent = new ManualResetEventSlim(true);\n            _timeProvider = timeProvider ?? new RealTimeProvider();\n            _newLiveDataTimeout = newLiveDataTimeout ?? 10;\n        }\n\n        protected override int GetPulseDueTime(DateTime now)\n        {\n            return _newLiveDataTimeout;\n        }\n\n        protected override ITimeProvider GetTimeProvider()\n        {\n            return _timeProvider;\n        }\n\n        protected override void OnSubscriptionNewDataAvailable(object sender, EventArgs args)\n        {\n            base.OnSubscriptionNewDataAvailable(sender, args);\n            NewDataEvent.Set();\n        }\n    }\n\n    internal class TestCustomData : BaseData\n    {\n        public static int ReaderCallsCount;\n\n        public static bool ReturnNull { get; set; }\n\n        public static bool ThrowException { get; set; }\n\n        public static FileFormat FileFormat { get; set; }\n\n        static TestCustomData()\n        {\n            ReaderCallsCount = 0;\n            FileFormat = FileFormat.Csv;\n        }\n\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            Interlocked.Increment(ref ReaderCallsCount);\n            if (ThrowException)\n            {\n                throw new RegressionTestException(\"Custom data Reader threw exception\");\n            }\n            else if (ReturnNull)\n            {\n                return null;\n            }\n            else\n            {\n                var data = new TestCustomData\n                {\n                    // return not null but 'old data' -> there is no data yet available for today\n                    Time = date.AddHours(-100),\n                    Value = 1,\n                    Symbol = config.Symbol\n                };\n\n                if (FileFormat == FileFormat.UnfoldingCollection)\n                {\n                    return new BaseDataCollection\n                    {\n                        Time = date.AddHours(-100),\n                        // return not null but 'old data' -> there is no data yet available for today\n                        EndTime = date.AddHours(-99),\n                        Value = 1,\n                        Symbol = config.Symbol,\n                        Data = new List<BaseData> { data }\n                    };\n                }\n                return data;\n            }\n        }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            return new SubscriptionDataSource(\"localhost:1232/fake\",\n                SubscriptionTransportMedium.Rest,\n                FileFormat);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/MockDataFeed.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Lean.Engine.DataFeeds\n{\n    public class MockDataFeed : IDataFeed\n    {\n        private List<SubscriptionData> _dummyData = new List<SubscriptionData>();\n        public bool IsActive { get; }\n\n        public void Initialize(\n            IAlgorithm algorithm,\n            AlgorithmNodePacket job,\n            IResultHandler resultHandler,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            IDataProvider dataProvider,\n            IDataFeedSubscriptionManager subscriptionManager,\n            IDataFeedTimeProvider dataFeedTimeProvider,\n            IDataChannelProvider dataChannelProvider\n            )\n        {\n        }\n\n        public Subscription CreateSubscription(SubscriptionRequest request)\n        {\n            var offsetProvider = new TimeZoneOffsetProvider(request.Configuration.ExchangeTimeZone,\n                request.StartTimeUtc,\n                request.EndTimeUtc);\n            return new Subscription(request, _dummyData.GetEnumerator(), offsetProvider);\n        }\n\n        public void RemoveSubscription(Subscription subscription)\n        {\n        }\n\n        public void Exit()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/PendingRemovalsManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Portfolio;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Orders;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class PendingRemovalsManagerTests\n    {\n        private static readonly DateTime Noon = new DateTime(2015, 11, 2, 12, 0, 0);\n        private static readonly TimeKeeper TimeKeeper = new TimeKeeper(Noon.ConvertToUtc(TimeZones.NewYork), new[] { TimeZones.NewYork });\n\n        [Test]\n        public void ReturnedRemoved_Add()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n\n            var result = pendingRemovals.TryRemoveMember(member, universe);\n\n            Assert.IsTrue(result.Any());\n            Assert.AreEqual(universe, result.First().Universe);\n            Assert.AreEqual(security, result.First().Security);\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Values.Count());\n        }\n\n        [Test]\n        public void ReturnedRemoved_Check()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            orderProvider.AddOrder(new LimitOrder(security.Symbol, 1, 1, DateTime.UtcNow));\n            pendingRemovals.TryRemoveMember(member, universe);\n            orderProvider.Clear();\n\n            var result = pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe);\n\n            Assert.IsTrue(result.Any());\n            Assert.AreEqual(universe, result.First().Universe);\n            Assert.AreEqual(security, result.First().Security);\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Values.Count());\n        }\n\n        [Test]\n        public void WontRemoveBecauseOfUnderlying()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var equity = CreateSecurity(Symbols.SPY);\n            var member = new Universe.Member(Noon, equity, false);\n            var equityOption = CreateSecurity(Symbols.SPY_C_192_Feb19_2016);\n\n            // we add an order of the equity option\n            orderProvider.AddOrder(new LimitOrder(equityOption.Symbol, 1, 1, DateTime.UtcNow));\n            using var universe = new TestUniverse();\n            universe.AddMember(DateTime.UtcNow, equity, false);\n            universe.AddMember(DateTime.UtcNow, equityOption, false);\n\n            // we try to remove the equity\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(equity, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseOpenOrder_Add()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            orderProvider.AddOrder(new LimitOrder(security.Symbol, 1, 1, DateTime.UtcNow));\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseOpenOrder_Check()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            orderProvider.AddOrder(new LimitOrder(security.Symbol, 1, 1, DateTime.UtcNow));\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseHoldings_Add()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            security.Holdings.SetHoldings(10, 10);\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseHoldings_Check()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            security.Holdings.SetHoldings(10, 10);\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseTarget_Add()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            security.Holdings.Target = new PortfolioTarget(security.Symbol, 10);\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontRemoveBecauseTarget_Check()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            security.Holdings.Target = new PortfolioTarget(security.Symbol, 10);\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        [Test]\n        public void WontBeReturnedBecauseReSelected()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n            using var universe = new TestUniverse();\n            orderProvider.AddOrder(new LimitOrder(security.Symbol, 1, 1, DateTime.UtcNow));\n            pendingRemovals.TryRemoveMember(member, universe);\n\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(\n                new HashSet<Symbol> { security.Symbol}, universe).Any());\n\n            // internally it was removed because it was reselected\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(0, pendingRemovals.PendingRemovals.Values.Count());\n        }\n\n        [Test]\n        public void WontRemoveBecauseUnsettledFunds()\n        {\n            var orderProvider = new FakeOrderProcessor();\n            var pendingRemovals = new PendingRemovalsManager(orderProvider);\n            using var universe = new TestUniverse();\n            var security = SecurityTests.GetSecurity();\n            var member = new Universe.Member(Noon, security, false);\n\n            security.SetSettlementModel(new DelayedSettlementModel(1, TimeSpan.FromHours(8)));\n            var securities = new SecurityManager(TimeKeeper);\n            var transactions = new SecurityTransactionManager(null, securities);\n            var portfolio = new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings());\n            security.SettlementModel.ApplyFunds(new ApplyFundsSettlementModelParameters(portfolio, security, TimeKeeper.UtcTime.Date.AddDays(1),\n                new CashAmount(1000, Currencies.USD), null));\n\n            Assert.IsNull(pendingRemovals.TryRemoveMember(member, universe));\n            Assert.IsFalse(pendingRemovals.CheckPendingRemovals(new HashSet<Symbol>(), universe).Any());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Keys.Count());\n            Assert.AreEqual(1, pendingRemovals.PendingRemovals.Values.Count());\n            Assert.AreEqual(universe, pendingRemovals.PendingRemovals.Keys.First());\n            Assert.AreEqual(security, pendingRemovals.PendingRemovals.Values.First().First().Security);\n        }\n\n        private class TestUniverse : Universe\n        {\n            public TestUniverse()\n                : base(SecurityTests.CreateTradeBarConfig())\n            {\n            }\n            public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private static Security CreateSecurity(Symbol symbol)\n        {\n            return new Security(symbol,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/PrecalculatedSubscriptionDataTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class PrecalculatedSubscriptionDataTests\n    {\n        private SubscriptionDataConfig _config;\n\n        [SetUp]\n        public void Setup()\n        {\n            _config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n        }\n\n        [Test]\n        public void ChangeDataNormalizationMode()\n        {\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400\n            };\n\n            var factor = 0.5m;\n            var sumOfDividends = 100m;\n            var adjustedTb = tb.Clone(tb.IsFillForward).Normalize(factor, DataNormalizationMode.Adjusted, 0);\n\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.Utc);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.Utc, new DateTime(2020, 5, 21), new DateTime(2020, 5, 22));\n\n            var emitTimeUtc = offsetProvider.ConvertToUtc(tb.EndTime);\n            _config.SumOfDividends = sumOfDividends;\n\n            var subscriptionData = new PrecalculatedSubscriptionData(\n                _config,\n                tb,\n                adjustedTb,\n                DataNormalizationMode.Adjusted,\n                emitTimeUtc);\n\n            _config.DataNormalizationMode = DataNormalizationMode.Raw;\n            Assert.AreEqual(tb.Open, (subscriptionData.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High, (subscriptionData.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low, (subscriptionData.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close, (subscriptionData.Data as TradeBar).Close);\n\n            _config.DataNormalizationMode = DataNormalizationMode.Adjusted;\n            Assert.AreEqual(tb.Open * factor, (subscriptionData.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High * factor, (subscriptionData.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low * factor, (subscriptionData.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close * factor, (subscriptionData.Data as TradeBar).Close);\n\n            _config.DataNormalizationMode = DataNormalizationMode.TotalReturn;\n            Assert.Throws<ArgumentException>(() =>\n                {\n                    var data = subscriptionData.Data;\n                }\n            );\n\n            _config.DataNormalizationMode = DataNormalizationMode.SplitAdjusted;\n            Assert.Throws<ArgumentException>(() =>\n                {\n                    var data = subscriptionData.Data;\n                }\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/PredicateTimeProviderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class PredicateTimeProviderTests\n    {\n        [Test]\n        public void RespectsCustomStepEvaluator()\n        {\n            var startTime = new DateTime(2018, 1, 1);\n            var manualTimeProvider = new ManualTimeProvider(startTime);\n            var stepTimeProvider = new PredicateTimeProvider(manualTimeProvider,\n                // only step when minute is a pair number\n                time => time.Minute % 2 == 0);\n\n            Assert.AreEqual(manualTimeProvider.GetUtcNow(), stepTimeProvider.GetUtcNow());\n\n            manualTimeProvider.AdvanceSeconds(45 * 60); // advance 45 minutes, past the interval\n\n            // still the same because 45 minutes isn't pair\n            Assert.AreEqual(startTime, stepTimeProvider.GetUtcNow());\n            Assert.AreNotEqual(manualTimeProvider.GetUtcNow(), stepTimeProvider.GetUtcNow());\n\n            manualTimeProvider.AdvanceSeconds(60);\n            Assert.AreEqual(manualTimeProvider.GetUtcNow(), stepTimeProvider.GetUtcNow());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/RealTimeScheduleEventServiceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Explicit(\"Performance test\")]\n    public class RealTimeScheduleEventServiceTests\n    {\n        [Test]\n        public void Accuracy()\n        {\n            using var scheduledEventService = new RealTimeScheduleEventService(RealTimeProvider.Instance);\n            EventHandler handler = (_, __) =>\n            {\n                Log.Trace($\"{DateTime.UtcNow:O}\");\n\n                var now = DateTime.UtcNow;\n                var nextEventTime = now.RoundDown(TimeSpan.FromSeconds(1)).Add(TimeSpan.FromSeconds(1) + TimeSpan.FromMilliseconds(101));\n                scheduledEventService.ScheduleEvent(nextEventTime - now, now);\n            };\n            scheduledEventService.NewEvent += handler;\n            handler(this, null);\n            Thread.Sleep(5000);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/RestApiBaseData.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    /// <summary>\n    /// Custom data type that causes rest api calls\n    /// </summary>\n    public class RestApiBaseData : TradeBar\n    {\n        public static int ReaderCount = 0;\n        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n        {\n            ReaderCount++;\n            //[{\"symbol\":\"SPY\",\"time\":1444271505,\"alpha\":1,\"beta\":2}]\n            var array = JsonConvert.DeserializeObject<JsonSerialization[]>(line);\n            if (array.Length > 0)\n            {\n                return array[0].ToBaseData(config.DataTimeZone, config.Increment, config.Symbol);\n            }\n            return null;\n        }\n\n        public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n        {\n            var remoteFileSource = @\"https://www.quantconnect.com/live-test?type=rest&symbols=\" + config.Symbol.Value;\n            //remoteFileSource = @\"http://beta.quantconnect.com/live-test?type=rest&symbols=\" + config.Symbol.Value;\n            return new SubscriptionDataSource(remoteFileSource, SubscriptionTransportMedium.Rest, FileFormat.Csv);\n        }\n\n        private class JsonSerialization\n        {\n            public string symbol = String.Empty;\n            public double time = 0;\n            public double alpha = 0;\n            public double beta = 0;\n\n            public RestApiBaseData ToBaseData(DateTimeZone timeZone, TimeSpan period, Symbol sym)\n            {\n                var dateTime = QuantConnect.Time.UnixTimeStampToDateTime(time).ConvertFromUtc(timeZone).Subtract(period);\n                return new RestApiBaseData\n                {\n                    Symbol = sym,\n                    Time = dateTime,\n                    EndTime = dateTime.Add(period),\n                    Value = (decimal) alpha\n                };\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class SubscriptionCollectionTests\n    {\n        [Test]\n        public void EnumerationWhileUpdatingDoesNotThrow()\n        {\n            using var cts = new CancellationTokenSource();\n            var subscriptions = new SubscriptionCollection();\n            var start = DateTime.UtcNow;\n            var end = start.AddSeconds(10);\n            var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, DateTimeZone.Utc, DateTimeZone.Utc, true, false, false);\n            var security = new Equity(\n                Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                new Cash(Currencies.USD, 0, 1),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            var timeZoneOffsetProvider = new TimeZoneOffsetProvider(DateTimeZone.Utc, start, end);\n            using var enumerator = new EnqueueableEnumerator<BaseData>();\n            using var subscriptionDataEnumerator = new SubscriptionDataEnumerator(config, security.Exchange.Hours, timeZoneOffsetProvider, enumerator, false, false);\n            var subscriptionRequest = new SubscriptionRequest(false, null, security, config, start, end);\n            var subscription = new Subscription(subscriptionRequest, subscriptionDataEnumerator, timeZoneOffsetProvider);\n\n            var addTask = Task.Factory.StartNew(() =>\n            {\n                Log.Trace(\"Add task started\");\n\n                while (DateTime.UtcNow < end)\n                {\n                    if (!subscriptions.Contains(config))\n                    {\n                        subscriptions.TryAdd(subscription);\n                    }\n\n                    Thread.Sleep(1);\n                }\n\n                Log.Trace(\"Add task ended\");\n            }, cts.Token);\n\n            var removeTask = Task.Factory.StartNew(() =>\n            {\n                Log.Trace(\"Remove task started\");\n\n                while (DateTime.UtcNow < end)\n                {\n                    Subscription removed;\n                    subscriptions.TryRemove(config, out removed);\n\n                    Thread.Sleep(1);\n                }\n\n                Log.Trace(\"Remove task ended\");\n            }, cts.Token);\n\n            var readTask = Task.Factory.StartNew(() =>\n            {\n                Log.Trace(\"Read task started\");\n\n                while (DateTime.UtcNow < end)\n                {\n                    foreach (var sub in subscriptions) { }\n\n                    Thread.Sleep(1);\n                }\n\n                Log.Trace(\"Read task ended\");\n            }, cts.Token);\n\n            Task.WaitAll(addTask, removeTask, readTask);\n            subscription.Dispose();\n        }\n        [Test]\n        public void DefaultFillForwardResolution()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var defaultFillForwardResolutio = subscriptionColletion.UpdateAndGetFillForwardResolution();\n            Assert.AreEqual(defaultFillForwardResolutio.Value, new TimeSpan(0, 1, 0));\n        }\n\n        [Test]\n        public void UpdatesFillForwardResolutionOverridesDefaultWhenNotAdding()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Daily);\n\n            var fillForwardResolutio = subscriptionColletion.UpdateAndGetFillForwardResolution(subscription.Configuration);\n            Assert.AreEqual(fillForwardResolutio.Value, new TimeSpan(1, 0, 0, 0));\n            subscription.Dispose();\n        }\n\n        [Test]\n        public void UpdatesFillForwardResolutionSuccessfullyWhenNotAdding()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Second);\n\n            var fillForwardResolutio = subscriptionColletion.UpdateAndGetFillForwardResolution(subscription.Configuration);\n            Assert.AreEqual(fillForwardResolutio.Value, new TimeSpan(0, 0, 1));\n            subscription.Dispose();\n        }\n\n        [Test]\n        public void UpdatesFillForwardResolutionSuccessfullyWhenAdding()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            using var subscription = CreateSubscription(Resolution.Second);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n        }\n\n        [Test]\n        public void UpdatesFillForwardResolutionSuccessfullyOverridesDefaultWhenAdding()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Daily);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(1, 0, 0, 0));\n            subscription.Dispose();\n        }\n\n        [Test]\n        public void DoesNotUpdateFillForwardResolutionWhenAddingBiggerResolution()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Second);\n            var subscription2 = CreateSubscription(Resolution.Minute);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscriptionColletion.TryAdd(subscription2);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscription.Dispose();\n            subscription2.Dispose();\n        }\n\n        [Test]\n        public void UpdatesFillForwardResolutionWhenRemoving()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            using var subscription = CreateSubscription(Resolution.Second);\n            using var subscription2 = CreateSubscription(Resolution.Daily);\n\n            subscriptionColletion.TryAdd(subscription);\n            subscriptionColletion.TryAdd(subscription2);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscriptionColletion.TryRemove(subscription.Configuration, out var outSubscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(1, 0, 0, 0));\n            subscriptionColletion.TryRemove(subscription2.Configuration, out var outSubscription2);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            outSubscription.Dispose();\n            outSubscription2.Dispose();\n        }\n\n        [Test]\n        public void FillForwardResolutionIgnoresTick()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            using var subscription = CreateSubscription(Resolution.Tick);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            subscriptionColletion.TryRemove(subscription.Configuration, out var outSubscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            outSubscription.Dispose();\n        }\n\n        [Test]\n        public void FillForwardResolutionIgnoresInternalFeed()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            using var subscription = CreateSubscription(Resolution.Second, \"AAPL\", true);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            subscriptionColletion.TryRemove(subscription.Configuration, out var outSubscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            outSubscription.Dispose();\n        }\n\n        [Test]\n        public void DoesNotUpdateFillForwardResolutionWhenRemovingDuplicateResolution()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            using var subscription = CreateSubscription(Resolution.Second);\n            using var subscription2 = CreateSubscription(Resolution.Second, \"SPY\");\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscriptionColletion.TryAdd(subscription2);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscriptionColletion.TryRemove(subscription.Configuration, out var outSubscription);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 0, 1));\n            subscriptionColletion.TryRemove(subscription2.Configuration, out var outSubscription2);\n            Assert.AreEqual(subscriptionColletion.UpdateAndGetFillForwardResolution().Value, new TimeSpan(0, 1, 0));\n            outSubscription.Dispose();\n            outSubscription2.Dispose();\n        }\n\n        [Test]\n        public void SubscriptionsAreSortedWhenAdding()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Second, Futures.Metals.Gold, false, SecurityType.Future);\n            var subscription2 = CreateSubscription(Resolution.Second, \"SPY\");\n            var subscription3 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option);\n            var subscription4 = CreateSubscription(Resolution.Second, \"EURGBP\");\n            var subscription5 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option, TickType.OpenInterest);\n            var subscription6 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option, TickType.Quote);\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription });\n            subscriptionColletion.TryAdd(subscription2);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription2, subscription });\n            subscriptionColletion.TryAdd(subscription3);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription2, subscription3, subscription });\n            subscriptionColletion.TryAdd(subscription4);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription2, subscription3, subscription });\n            subscriptionColletion.TryAdd(subscription5);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription2, subscription3, subscription5, subscription });\n            subscriptionColletion.TryAdd(subscription6);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription2, subscription3, subscription6, subscription5, subscription });\n\n\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Equity, SecurityType.Option,\n                SecurityType.Option, SecurityType.Option, SecurityType.Future });\n\n            subscription.Dispose();\n            subscription2.Dispose();\n            subscription3.Dispose();\n            subscription4.Dispose();\n            subscription5.Dispose();\n            subscription6.Dispose();\n        }\n\n        [Test]\n        public void SubscriptionsAreSortedWhenAdding2()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Second, Futures.Metals.Gold, false, SecurityType.Future);\n            var subscription2 = CreateSubscription(Resolution.Second, \"SPY\");\n            var subscription3 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option);\n            var subscription4 = CreateSubscription(Resolution.Second, \"EURGBP\");\n\n            subscriptionColletion.TryAdd(subscription);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription });\n            subscriptionColletion.TryAdd(subscription2);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription2, subscription });\n            subscriptionColletion.TryAdd(subscription3);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription2, subscription3, subscription });\n            subscriptionColletion.TryAdd(subscription4);\n\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription2, subscription3, subscription });\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Equity, SecurityType.Option, SecurityType.Future });\n\n            subscription.Dispose();\n            subscription2.Dispose();\n            subscription3.Dispose();\n            subscription4.Dispose();\n        }\n\n        [Test]\n        public void SubscriptionsAreSortedWhenRemoving()\n        {\n            var subscriptionColletion = new SubscriptionCollection();\n            var subscription = CreateSubscription(Resolution.Second, Futures.Metals.Gold, false, SecurityType.Future);\n            var subscription2 = CreateSubscription(Resolution.Second, \"SPY\");\n            var subscription3 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option);\n            var subscription4 = CreateSubscription(Resolution.Second, \"EURGBP\");\n            var subscription5 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option, TickType.OpenInterest);\n            var subscription6 = CreateSubscription(Resolution.Second, \"AAPL\", false, SecurityType.Option, TickType.Quote);\n\n            subscriptionColletion.TryAdd(subscription);\n            subscriptionColletion.TryAdd(subscription2);\n            subscriptionColletion.TryAdd(subscription3);\n            subscriptionColletion.TryAdd(subscription4);\n            subscriptionColletion.TryAdd(subscription5);\n            subscriptionColletion.TryAdd(subscription6);\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription2, subscription3, subscription6, subscription5, subscription });\n\n            subscriptionColletion.TryRemove(subscription2.Configuration, out subscription2);\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Option,\n                            SecurityType.Option, SecurityType.Option, SecurityType.Future });\n\n            subscriptionColletion.TryRemove(subscription3.Configuration, out subscription3);\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Option, SecurityType.Option, SecurityType.Future });\n\n            subscriptionColletion.TryRemove(subscription.Configuration, out subscription);\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Option, SecurityType.Option });\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription6, subscription5 });\n\n            subscriptionColletion.TryRemove(subscription6.Configuration, out subscription6);\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] { SecurityType.Equity, SecurityType.Option });\n            Assert.AreEqual(subscriptionColletion.ToList(), new[] { subscription4, subscription5 });\n\n            subscriptionColletion.TryRemove(subscription5.Configuration, out subscription5);\n            Assert.AreEqual(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList(), new[] {SecurityType.Equity});\n\n            subscriptionColletion.TryRemove(subscription4.Configuration, out subscription4);\n            Assert.IsTrue(subscriptionColletion.Select(x => x.Configuration.SecurityType).ToList().IsNullOrEmpty());\n\n            subscription.Dispose();\n            subscription2.Dispose();\n            subscription3.Dispose();\n            subscription4.Dispose();\n            subscription5.Dispose();\n            subscription6.Dispose();\n        }\n\n        private Subscription CreateSubscription(Resolution resolution, string symbol = \"AAPL\", bool isInternalFeed = false,\n                                                SecurityType type = SecurityType.Equity, TickType tickType = TickType.Trade)\n        {\n            var start = DateTime.UtcNow;\n            var end = start.AddSeconds(10);\n            Security security;\n            Symbol _symbol;\n            if (type == SecurityType.Equity)\n            {\n                _symbol = new Symbol(SecurityIdentifier.GenerateEquity(DateTime.Now, symbol, Market.USA), symbol);\n                security = new Equity(\n                    _symbol,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 0, 1),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n            }\n            else if (type == SecurityType.Option)\n            {\n                _symbol = Symbol.CreateOption(\n                    new Symbol(SecurityIdentifier.GenerateEquity(DateTime.Now, symbol, Market.USA), symbol),\n                    Market.USA,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    0m,\n                    DateTime.Now\n                );\n                security = new Option(\n                    _symbol,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 0, 1),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache(),\n                    null\n                );\n            }\n            else if (type == SecurityType.Future)\n            {\n                _symbol = new Symbol(SecurityIdentifier.GenerateFuture(DateTime.Now, symbol, Market.COMEX), symbol);\n                security = new Future(\n                    _symbol,\n                    SecurityExchangeHours.AlwaysOpen(DateTimeZone.Utc),\n                    new Cash(Currencies.USD, 0, 1),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                );\n            }\n            else\n            {\n                throw new RegressionTestException(\"SecurityType not implemented\");\n            }\n            var config = new SubscriptionDataConfig(typeof(TradeBar), _symbol, resolution, DateTimeZone.Utc, DateTimeZone.Utc, true, false, isInternalFeed, false, tickType);\n            var timeZoneOffsetProvider = new TimeZoneOffsetProvider(DateTimeZone.Utc, start, end);\n            # pragma warning disable CA2000\n            var enumerator = new EnqueueableEnumerator<BaseData>();\n            var subscriptionDataEnumerator = new SubscriptionDataEnumerator(config, security.Exchange.Hours, timeZoneOffsetProvider, enumerator, false, false);\n                # pragma warning restore CA2000\n            var subscriptionRequest = new SubscriptionRequest(false, null, security, config, start, end);\n            return new Subscription(subscriptionRequest, subscriptionDataEnumerator, timeZoneOffsetProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionDataReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class SubscriptionDataReaderTests\n    {\n        // this is the core of this unit test:\n        // the stream will have two data points one of which does not correspond to the tradable date,\n        // and it shouldn't be emitted because we have a new source for the next tradable date\n        [TestCase(@\"25980000,1679600,1679700,1679600,1679700,200\n                99900000,1679400,1679400,1679200,1679200,600\", false, Resolution.Minute)]\n        // this test case has two data point which should be emitted because they correspond to the same tradable date\n        [TestCase(@\"25980000,1679600,1679700,1679600,1679700,200\n                30980000,1679400,1679400,1679200,1679200,600\", true, Resolution.Minute)]\n        // even if the second data point is another tradable date we emit it because daily resolution\n        // always uses the same source\n        [TestCase(@\"20191209 00:00,956900,959700,947200,958100,3647000\n                20191211 00:00,956900,959700,947200,958100,3647000\", true, Resolution.Daily)]\n        public void DoesNotEmitDataBeyondTradableDate(string data, bool shouldEmitSecondDataPoint, Resolution dataResolution)\n        {\n            var start = new DateTime(2019, 12, 9);\n            var end = new DateTime(2019, 12, 12);\n\n            var request = GetRequest(typeof(TradeBar), start, end, dataResolution, out var config);\n            using var testDataCacheProvider = new TestDataCacheProvider() { Data = data };\n            using var dataReader = new SubscriptionDataReader(config,\n                request,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                testDataCacheProvider,\n                TestGlobals.DataProvider,\n                null);\n\n            Assert.IsTrue(dataReader.MoveNext());\n            Assert.AreEqual(shouldEmitSecondDataPoint, dataReader.MoveNext());\n\n        }\n\n        [TestCase(typeof(TradeBar))]\n        [TestCase(typeof(QuoteBar))]\n        [TestCase(typeof(OpenInterest))]\n        public void EmitsNewTradableDateWhenDateAfterDelistingIsNonTradable(Type dataType)\n        {\n            var start = new DateTime(2023, 06, 30);\n            var end = new DateTime(2023, 08, 01);\n\n            var request = GetRequest(dataType, start, end, Resolution.Minute, out var config);\n            using var testDataCacheProvider = new TestDataCacheProvider();\n            using var dataReader = new SubscriptionDataReader(config,\n                request,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                testDataCacheProvider,\n                TestGlobals.DataProvider,\n                null);\n\n            var expectedLastTradableDate = new DateTime(2023, 07, 05);\n            var lastTradableDate = default(DateTime);\n\n            dataReader.NewTradableDate += (sender, args) =>\n            {\n                lastTradableDate = args.Date;\n            };\n\n            while (dataReader.MoveNext())\n            {\n            }\n\n            Assert.AreEqual(expectedLastTradableDate, lastTradableDate);\n        }\n\n        [Test]\n        public void DoesNotYieldDataWhenDelisted()\n        {\n            var start = new DateTime(2023, 8, 1);\n            var end = new DateTime(2023, 08, 10);\n\n            var request = GetRequest(typeof(TradeBar), start, end, Resolution.Minute, out var config);\n            using var testDataCacheProvider = new TestDataCacheProvider();\n            using var dataReader = new SubscriptionDataReader(config,\n                request,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                testDataCacheProvider,\n                TestGlobals.DataProvider,\n                null);\n\n            var dataYielded = false;\n            var newTradableDateCalled = false;\n            dataReader.NewTradableDate += (sender, args) =>\n            {\n                newTradableDateCalled = true;\n            };\n\n            while (dataReader.MoveNext())\n            {\n                dataYielded = true;\n            }\n\n            Assert.IsFalse(dataYielded);\n            Assert.IsFalse(newTradableDateCalled);\n        }\n\n        private static BaseDataRequest GetRequest(Type dataType, DateTime start, DateTime end, Resolution resolution, out SubscriptionDataConfig config)\n        {\n            var symbol = Symbol.CreateOption(\n                Symbols.SPX,\n                \"SPXW\",\n                Market.USA,\n                OptionStyle.European,\n                OptionRight.Call,\n                4445m,\n                // Next day is a holiday\n                new DateTime(2023, 7, 3));\n\n            var entry = MarketHoursDatabase.FromDataFolder().GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n            config = new SubscriptionDataConfig(dataType,\n                symbol,\n                resolution,\n                entry.DataTimeZone,\n                entry.ExchangeHours.TimeZone,\n                false,\n                false,\n                false);\n            return new HistoryRequest(config, entry.ExchangeHours, start, end);\n        }\n\n        private class TestDataCacheProvider : IDataCacheProvider\n        {\n            private StreamWriter _writer;\n            private bool _alreadyEmitted;\n\n            public string Data { get; set; }\n            public void Dispose()\n            {\n                _writer.DisposeSafely();\n            }\n            public List<string> GetZipEntries(string zipFile)\n            {\n                throw new NotImplementedException();\n            }\n            public bool IsDataEphemeral => true;\n            public Stream Fetch(string key)\n            {\n                if (_alreadyEmitted)\n                {\n                    return null;\n                }\n                _alreadyEmitted = true;\n\n                var stream = new MemoryStream();\n                _writer = new StreamWriter(stream);\n                _writer.Write(Data);\n                _writer.Flush();\n                stream.Position = 0;\n                return stream;\n            }\n            public void Store(string key, byte[] data)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class SubscriptionDataTests\n    {\n        [Test]\n        public void CreatedSubscriptionRoundsTimeDownForDataWithPeriod()\n        {\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY\n            };\n\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.Utc);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.Utc, new DateTime(2020, 5, 21), new DateTime(2020, 5, 22));\n\n            var subscription = SubscriptionData.Create(false, config, exchangeHours, offsetProvider, tb, config.DataNormalizationMode);\n\n            Assert.AreEqual(new DateTime(2020, 5, 21, 8, 0, 0), subscription.Data.Time);\n            Assert.AreEqual(new DateTime(2020, 5, 21, 9, 0, 0), subscription.Data.EndTime);\n        }\n\n        [Test]\n        public void CreatedSubscriptionDoesNotRoundDownForPeriodLessData()\n        {\n            var data = new MyCustomData\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Symbol = Symbols.SPY\n            };\n\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            var exchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.Utc);\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.Utc, new DateTime(2020, 5, 21), new DateTime(2020, 5, 22));\n\n            var subscription = SubscriptionData.Create(false, config, exchangeHours, offsetProvider, data, config.DataNormalizationMode);\n\n            Assert.AreEqual(new DateTime(2020, 5, 21, 8, 9, 0), subscription.Data.Time);\n            Assert.AreEqual(new DateTime(2020, 5, 21, 8, 9, 0), subscription.Data.EndTime);\n        }\n\n        [TestCase(1, 0)]\n        [TestCase(null, 0)]\n        [TestCase(null, 1000)]\n        public void CreateDefaults(decimal? scale, decimal dividends)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            config.SumOfDividends = dividends;\n\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400\n            };\n\n            var data = SubscriptionData.Create(false,\n                config,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new TimeZoneOffsetProvider(TimeZones.NewYork, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1)),\n                tb,\n                config.DataNormalizationMode,\n                scale);\n\n            Assert.True(data.GetType() == typeof(SubscriptionData));\n\n            Assert.AreEqual(tb.Open, (data.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High, (data.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low, (data.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close, (data.Data as TradeBar).Close);\n        }\n\n        [TestCase(typeof(SubscriptionData), 1)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 2)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 0.5)]\n        public void CreateZeroDividends(Type type, decimal? scale)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            config.SumOfDividends = 0;\n\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400\n            };\n\n            var data = SubscriptionData.Create(false,\n                config,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new TimeZoneOffsetProvider(TimeZones.NewYork, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1)),\n                tb,\n                config.DataNormalizationMode,\n                scale);\n\n            Assert.True(data.GetType() == type);\n\n            Assert.AreEqual(tb.Open * scale, (data.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High * scale, (data.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low * scale, (data.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close * scale, (data.Data as TradeBar).Close);\n        }\n\n        [TestCase(typeof(PrecalculatedSubscriptionData), 1)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 2)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 0.5)]\n        public void CreateAdjustedNotZeroDividends(Type type, decimal? scale)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            config.SumOfDividends = 100;\n\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400\n            };\n\n            var data = SubscriptionData.Create(false,\n                config,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new TimeZoneOffsetProvider(TimeZones.NewYork, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1)),\n                tb,\n                config.DataNormalizationMode,\n                scale);\n\n            Assert.True(data.GetType() == type);\n\n            Assert.AreEqual(tb.Open * scale, (data.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High * scale, (data.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low * scale, (data.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close * scale, (data.Data as TradeBar).Close);\n        }\n\n        [TestCase(typeof(PrecalculatedSubscriptionData), 1)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 2)]\n        [TestCase(typeof(PrecalculatedSubscriptionData), 0.5)]\n        public void CreateTotalNotZeroDividends(Type type, decimal? scale)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            config.SumOfDividends = 100;\n            config.DataNormalizationMode = DataNormalizationMode.TotalReturn;\n\n            var tb = new TradeBar\n            {\n                Time = new DateTime(2020, 5, 21, 8, 9, 0),\n                Period = TimeSpan.FromHours(1),\n                Symbol = Symbols.SPY,\n                Open = 100,\n                High = 200,\n                Low = 300,\n                Close = 400\n            };\n\n            var data = SubscriptionData.Create(false,\n                config,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new TimeZoneOffsetProvider(TimeZones.NewYork, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1)),\n                tb,\n                config.DataNormalizationMode,\n                scale);\n\n            Assert.True(data.GetType() == type);\n\n            Assert.AreEqual(tb.Open * scale + config.SumOfDividends, (data.Data as TradeBar).Open);\n            Assert.AreEqual(tb.High * scale + config.SumOfDividends, (data.Data as TradeBar).High);\n            Assert.AreEqual(tb.Low * scale + config.SumOfDividends, (data.Data as TradeBar).Low);\n            Assert.AreEqual(tb.Close * scale + config.SumOfDividends, (data.Data as TradeBar).Close);\n        }\n\n        [TestCase(true, typeof(TradeBar))]\n        [TestCase(false, typeof(TradeBar))]\n        [TestCase(true, typeof(QuoteBar))]\n        [TestCase(false, typeof(QuoteBar))]\n        [TestCase(true, typeof(Tick))]\n        [TestCase(false, typeof(Tick))]\n        public void FillForwardFlagIsCorrectlySet(bool isFillForward, Type type)\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                false,\n                false,\n                false\n            );\n\n            var scale = 0.5m;\n            config.DataNormalizationMode = DataNormalizationMode.Adjusted;\n\n            var data = (BaseData)Activator.CreateInstance(type);\n            if (isFillForward)\n            {\n                data = data.Clone(isFillForward);\n            }\n\n            var subscriptionData = (PrecalculatedSubscriptionData) SubscriptionData.Create(false, config,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new TimeZoneOffsetProvider(TimeZones.NewYork, new DateTime(2015, 1, 1), new DateTime(2016, 1, 1)),\n                data,\n                config.DataNormalizationMode,\n                scale);\n\n            config.DataNormalizationMode = DataNormalizationMode.Raw;\n            Assert.AreEqual(isFillForward, subscriptionData.Data.IsFillForward);\n\n            config.DataNormalizationMode = DataNormalizationMode.Adjusted;\n            Assert.AreEqual(isFillForward, subscriptionData.Data.IsFillForward);\n        }\n\n        internal class MyCustomData : BaseData\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionSynchronizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Category(\"TravisExclude\"), Parallelizable(ParallelScope.All)]\n    public class SubscriptionSynchronizerTests\n    {\n        [Test]\n        [TestCase(1, Resolution.Second)]\n        [TestCase(20, Resolution.Minute)]\n        [TestCase(50, Resolution.Minute)]\n        [TestCase(100, Resolution.Minute)]\n        [TestCase(250, Resolution.Minute)]\n        [TestCase(500, Resolution.Hour)]\n        [TestCase(1000, Resolution.Hour)]\n        public void SubscriptionSynchronizerPerformance(int securityCount, Resolution resolution)\n        {\n            // since data is pre-generated, it's important to use the larger resolutions with large security counts\n\n            var algorithm = PerformanceBenchmarkAlgorithms.CreateBenchmarkAlgorithm(securityCount, resolution);\n            TestSubscriptionSynchronizerSpeed(algorithm);\n        }\n\n        private void TestSubscriptionSynchronizerSpeed(QCAlgorithm algorithm)\n        {\n            var feed = new MockDataFeed();\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var securityService = new SecurityService(\n                algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n            algorithm.Securities.SetSecurityService(securityService);\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(feed,\n                new UniverseSelection(algorithm, securityService, dataPermissionManager, TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            algorithm.Initialize();\n            algorithm.PostInitialize();\n\n            // set exchanges to be always open\n            foreach (var kvp in algorithm.Securities)\n            {\n                var security = kvp.Value;\n                security.Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(security.Exchange.TimeZone));\n            }\n\n            var endTimeUtc = algorithm.EndDate.ConvertToUtc(TimeZones.NewYork);\n            var startTimeUtc = algorithm.StartDate.ConvertToUtc(TimeZones.NewYork);\n            var subscriptionBasedTimeProvider = new SubscriptionFrontierTimeProvider(startTimeUtc, dataManager);\n            var timeSliceFactory = new TimeSliceFactory(algorithm.TimeZone);\n            var synchronizer = new SubscriptionSynchronizer(dataManager.UniverseSelection, new());\n            synchronizer.SetTimeProvider(subscriptionBasedTimeProvider);\n            synchronizer.SetTimeSliceFactory(timeSliceFactory);\n            var totalDataPoints = 0;\n            var subscriptions = dataManager.DataFeedSubscriptions;\n            foreach (var kvp in algorithm.Securities)\n            {\n                int dataPointCount;\n                # pragma warning disable CA2000\n                var subscription = CreateSubscription(algorithm, kvp.Value, startTimeUtc, endTimeUtc, out dataPointCount);\n                # pragma warning restore CA2000\n                subscriptions.TryAdd(subscription);\n                totalDataPoints += dataPointCount;\n            }\n\n            // log what we're doing\n            Log.Trace($\"Running {subscriptions.Count()} subscriptions with a total of {totalDataPoints} data points. Start: {algorithm.StartDate:yyyy-MM-dd} End: {algorithm.EndDate:yyyy-MM-dd}\");\n\n            var count = 0;\n            DateTime currentTime = DateTime.MaxValue;\n            DateTime previousValue;\n            var stopwatch = Stopwatch.StartNew();\n            var enumerator = synchronizer.Sync(subscriptions, CancellationToken.None).GetEnumerator();\n            do\n            {\n                previousValue = currentTime;\n                enumerator.MoveNext();\n                var timeSlice = enumerator.Current;\n                currentTime = timeSlice.Time;\n                count += timeSlice.DataPointCount;\n            }\n            while (currentTime != previousValue);\n\n            stopwatch.Stop();\n            enumerator.DisposeSafely();\n\n            var kps = count / 1000d / stopwatch.Elapsed.TotalSeconds;\n            Log.Trace($\"Current Time: {currentTime:u}  Elapsed time: {(int)stopwatch.Elapsed.TotalSeconds,4}s  KPS: {kps,7:.00}  COUNT: {count,10}\");\n            Assert.GreaterOrEqual(count, 100); // this assert is for sanity purpose\n            dataManager.RemoveAllSubscriptions();\n        }\n\n        private Subscription CreateSubscription(QCAlgorithm algorithm, Security security, DateTime startTimeUtc, DateTime endTimeUtc, out int dataPointCount)\n        {\n            var universe = algorithm.UniverseManager.Values.OfType<UserDefinedUniverse>()\n                .Single(u => u.SelectSymbols(default(DateTime), null).Contains(security.Symbol));\n\n            var config = security.Subscriptions.First();\n            var offsetProvider = new TimeZoneOffsetProvider(TimeZones.NewYork, startTimeUtc, endTimeUtc);\n            var data = LinqExtensions.Range(algorithm.StartDate, algorithm.EndDate, c => c + config.Increment).Select(time => new DataPoint\n            {\n                Time = time,\n                EndTime = time + config.Increment\n            })\n            .Select(d => SubscriptionData.Create(false, config, security.Exchange.Hours, offsetProvider, d, config.DataNormalizationMode))\n            .ToList();\n\n            dataPointCount = data.Count;\n            var subscriptionRequest = new SubscriptionRequest(false, universe, security, config, startTimeUtc, endTimeUtc);\n            return new Subscription(subscriptionRequest, data.GetEnumerator(), offsetProvider);\n        }\n\n        private class DataPoint : BaseData\n        {\n            // bare bones base data to minimize memory footprint\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NodaTime;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.Framework.Selection;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class SubscriptionTests\n    {\n        private readonly DateTime _start = DateTime.MinValue;\n        private readonly DateTime _end = DateTime.MinValue.AddDays(1);\n\n        [Test]\n        public void ConstructorNoUniverse()\n        {\n            var subscriptionRequest = GetSubscriptionRequest(false);\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            Assert.IsFalse(subscription.Universes.Any());\n            Assert.IsFalse(subscription.EndOfStream);\n            Assert.AreEqual(_start, subscription.UtcStartTime);\n            Assert.AreEqual(_end, subscription.UtcEndTime);\n            Assert.AreEqual(subscription.Configuration, subscriptionRequest.Configuration);\n            Assert.IsFalse(subscription.IsUniverseSelectionSubscription);\n        }\n\n        [Test]\n        public void Constructor()\n        {\n            var subscriptionRequest = GetSubscriptionRequest();\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            Assert.AreEqual(1, subscription.Universes.Count());\n            Assert.AreEqual(_start, subscription.UtcStartTime);\n            Assert.AreEqual(_end, subscription.UtcEndTime);\n            Assert.AreEqual(subscriptionRequest.Universe, subscription.Universes.First());\n            Assert.IsFalse(subscription.EndOfStream);\n            Assert.AreEqual(subscription.Configuration, subscriptionRequest.Configuration);\n            Assert.IsFalse(subscription.IsUniverseSelectionSubscription);\n        }\n\n        [Test]\n        public void AddSubscriptionRequestOncePerUniverse()\n        {\n            var subscriptionRequest = GetSubscriptionRequest();\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            Assert.AreEqual(1, subscription.Universes.Count());\n            Assert.AreEqual(subscriptionRequest.Universe, subscription.Universes.First());\n\n            subscription.AddSubscriptionRequest(subscriptionRequest);\n\n            Assert.AreEqual(1, subscription.Universes.Count());\n            Assert.AreEqual(subscriptionRequest.Universe, subscription.Universes.First());\n        }\n\n        [Test]\n        public void SubscriptionOnlyAcceptsOneUniverseSelection()\n        {\n            var subscriptionRequest = GetSubscriptionRequest(true, true);\n            var subscriptionRequest2 = GetSubscriptionRequest();\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            try\n            {\n                subscription.AddSubscriptionRequest(subscriptionRequest2);\n                Assert.Fail(\"Subscription should only accept one universe selection\" +\n                    \" subscription request.\");\n            }\n            catch (Exception)\n            {\n                Assert.Pass();\n            }\n        }\n\n        [Test]\n        public void SubscriptionOnlyAcceptsSameConfiguration()\n        {\n            var subscriptionRequest = GetSubscriptionRequest();\n            var subscriptionRequest2 = GetSubscriptionRequest(resolution: Resolution.Second);\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            try\n            {\n                subscription.AddSubscriptionRequest(subscriptionRequest2);\n                Assert.Fail(\"Subscription should only accept the same configuration\");\n            }\n            catch (Exception)\n            {\n                Assert.Pass();\n            }\n        }\n\n        [Test]\n        public void RemoveSubscriptionRequest()\n        {\n            var subscriptionRequest = GetSubscriptionRequest();\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            var emptySubscription = subscription.RemoveSubscriptionRequest(subscriptionRequest.Universe);\n\n            Assert.IsTrue(emptySubscription);\n            Assert.IsFalse(subscription.Universes.Any());\n        }\n\n        [Test]\n        public void RemoveAllSubscriptionRequest()\n        {\n            var subscriptionRequest = GetSubscriptionRequest();\n            var subscriptionRequest2 = GetSubscriptionRequest();\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            subscription.AddSubscriptionRequest(subscriptionRequest2);\n            Assert.AreEqual(2, subscription.Universes.Count());\n            var emptySubscription = subscription.RemoveSubscriptionRequest();\n\n            Assert.IsTrue(emptySubscription);\n            Assert.IsFalse(subscription.Universes.Any());\n        }\n\n        [Test]\n        public void RemoveAllSubscriptionRequestNoUniverse()\n        {\n            var subscriptionRequest = GetSubscriptionRequest(false);\n            using var subscription = new Subscription(\n                subscriptionRequest,\n                null,\n                new TimeZoneOffsetProvider(DateTimeZone.Utc, _start, _end));\n\n            var emptySubscription = subscription.RemoveSubscriptionRequest();\n\n            Assert.IsTrue(emptySubscription);\n            Assert.IsFalse(subscription.Universes.Any());\n        }\n\n        private SubscriptionRequest GetSubscriptionRequest(\n            bool useUniverse = true,\n            bool isUniverseSelection = false,\n            Resolution resolution = Resolution.Minute)\n        {\n            var security = SecurityTests.GetSecurity();\n            var config = SecurityTests.CreateTradeBarConfig(resolution);\n            # pragma warning disable CA2000\n            var universe = new ManualUniverse(\n                config,\n                new UniverseSettings(Resolution.Daily, 1, true, true, TimeSpan.FromDays(1)),\n                new[] {security.Symbol}\n            );\n            #pragma warning restore CA2000\n            return new SubscriptionRequest(isUniverseSelection, useUniverse ? universe : null, security, config, _start, _end);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/SubscriptionUtilsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class SubscriptionUtilsTests\n    {\n        private Security _security;\n        private SubscriptionDataConfig _config;\n        private IFactorFileProvider _factorFileProvider;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _security = new Security(Symbols.SPY,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                new IdentityCurrencyConverter(Currencies.USD),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache());\n\n            _config = new SubscriptionDataConfig(\n                typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true, true, false);\n\n            _factorFileProvider = TestGlobals.FactorFileProvider;\n        }\n\n        [Test]\n        public void SubscriptionIsDisposed()\n        {\n            var dataPoints = 10;\n            using var enumerator = new TestDataEnumerator { MoveNextTrueCount = dataPoints };\n            #pragma warning disable CA2000\n            var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                new SubscriptionRequest(\n                    false,\n                    null,\n                    _security,\n                    _config,\n                    DateTime.UtcNow,\n                    Time.EndOfTime\n                ),\n                enumerator,\n                _factorFileProvider,\n                false, false);\n            #pragma warning restore CA2000\n\n            var count = 0;\n            while (enumerator.MoveNextTrueCount > 8)\n            {\n                if (count++ > 100)\n                {\n                    Assert.Fail($\"Timeout waiting for producer. {enumerator.MoveNextTrueCount}\");\n                }\n                Thread.Sleep(1);\n            }\n\n            subscription.DisposeSafely();\n            Assert.IsFalse(subscription.MoveNext());\n        }\n\n        [Test]\n        public void ThrowingEnumeratorStackDisposesOfSubscription()\n        {\n            using var enumerator = new TestDataEnumerator { MoveNextTrueCount = 10, ThrowException = true};\n\n            using var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                new SubscriptionRequest(\n                    false,\n                    null,\n                    _security,\n                    _config,\n                    DateTime.UtcNow,\n                    Time.EndOfTime\n                ),\n                enumerator,\n                _factorFileProvider,\n                false, false);\n\n            var count = 0;\n            while (enumerator.MoveNextTrueCount != 9)\n            {\n                if (count++ > 100)\n                {\n                    Assert.Fail(\"Timeout waiting for producer\");\n                }\n                Thread.Sleep(1);\n            }\n\n            Assert.IsFalse(subscription.MoveNext());\n            Assert.IsTrue(subscription.EndOfStream);\n\n            // enumerator is disposed by the producer\n            count = 0;\n            while (!enumerator.Disposed)\n            {\n                if (count++ > 100)\n                {\n                    Assert.Fail(\"Timeout waiting for producer\");\n                }\n                Thread.Sleep(1);\n            }\n        }\n\n        [Test]\n        // This unit tests reproduces GH 3885 where the consumer hanged forever\n        public void ConsumerDoesNotHang()\n        {\n            for (var i = 0; i < 10000; i++)\n            {\n                var dataPoints = 10;\n\n                using var enumerator = new TestDataEnumerator {MoveNextTrueCount = dataPoints};\n                #pragma warning disable CA2000\n                var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                    new SubscriptionRequest(\n                        false,\n                        null,\n                        _security,\n                        _config,\n                        DateTime.UtcNow,\n                        Time.EndOfTime\n                    ),\n                    enumerator,\n                    _factorFileProvider,\n                    false, false);\n                #pragma warning restore CA2000\n                for (var j = 0; j < dataPoints; j++)\n                {\n                   Assert.IsTrue(subscription.MoveNext());\n                }\n                Assert.IsFalse(subscription.MoveNext());\n                subscription.DisposeSafely();\n            }\n        }\n\n        [Test]\n        public void PriceScaleFirstFillForwardBar()\n        {\n            var referenceTime = new DateTime(2020, 08, 06);\n            var point = new Tick(referenceTime, Symbols.SPY, 1, 2);\n            var point2 = point.Clone(true);\n            point2.Time = referenceTime;\n            var point3 = point.Clone(false);\n            point3.Time = referenceTime.AddDays(1);\n            ;\n            var enumerator = new List<BaseData> { point2, point3 }.GetEnumerator();\n            var factorFileProfider = new Mock<IFactorFileProvider>();\n\n            var factorFile = new CorporateFactorProvider(_security.Symbol.Value, new[]\n            {\n                new CorporateFactorRow(referenceTime, 0.5m, 1),\n                new CorporateFactorRow(referenceTime.AddDays(1), 1m, 1)\n            }, referenceTime);\n\n            factorFileProfider.Setup(s => s.Get(It.IsAny<Symbol>())).Returns(factorFile);\n            #pragma warning disable CA2000\n            var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                new SubscriptionRequest(\n                    false,\n                    null,\n                    _security,\n                    _config,\n                    referenceTime,\n                    Time.EndOfTime\n                ),\n                enumerator,\n                factorFileProfider.Object,\n                true, false);\n            #pragma warning restore CA2000\n            Assert.IsTrue(subscription.MoveNext());\n            // we do expect it to pick up the prev factor file scale\n            Assert.AreEqual(1, (subscription.Current.Data as Tick).AskPrice);\n            Assert.IsTrue((subscription.Current.Data as Tick).IsFillForward);\n\n            Assert.IsTrue(subscription.MoveNext());\n            Assert.AreEqual(2, (subscription.Current.Data as Tick).AskPrice);\n            Assert.IsFalse((subscription.Current.Data as Tick).IsFillForward);\n\n            subscription.DisposeSafely();\n        }\n\n        [Test]\n        public void PriceScaleDoesNotUpdateForFillForwardBar()\n        {\n            var referenceTime = new DateTime(2020, 08, 06);\n            var point = new Tick(referenceTime, Symbols.SPY, 1, 2);\n            var point2 = point.Clone(true);\n            point2.Time = referenceTime.AddDays(1);\n            var point3 = point.Clone(false);\n            point3.Time = referenceTime.AddDays(2);\n            var enumerator = new List<BaseData> { point, point2, point3 }.GetEnumerator();\n            var factorFileProfider = new Mock<IFactorFileProvider>();\n\n            var factorFile = new CorporateFactorProvider(_security.Symbol.Value, new[]\n            {\n                new CorporateFactorRow(referenceTime, 0.5m, 1),\n                new CorporateFactorRow(referenceTime.AddDays(1), 1m, 1)\n            }, referenceTime);\n\n            factorFileProfider.Setup(s => s.Get(It.IsAny<Symbol>())).Returns(factorFile);\n            #pragma warning disable CA2000\n            var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                new SubscriptionRequest(\n                    false,\n                    null,\n                    _security,\n                    _config,\n                    referenceTime,\n                    Time.EndOfTime\n                ),\n                enumerator,\n                factorFileProfider.Object,\n                true, false);\n            #pragma warning restore CA2000\n            Assert.IsTrue(subscription.MoveNext());\n            Assert.AreEqual(1, (subscription.Current.Data as Tick).AskPrice);\n            Assert.IsFalse((subscription.Current.Data as Tick).IsFillForward);\n\n            Assert.IsTrue(subscription.MoveNext());\n            Assert.AreEqual(1, (subscription.Current.Data as Tick).AskPrice);\n            Assert.IsTrue((subscription.Current.Data as Tick).IsFillForward);\n\n            Assert.IsTrue(subscription.MoveNext());\n            Assert.AreEqual(2, (subscription.Current.Data as Tick).AskPrice);\n            Assert.IsFalse((subscription.Current.Data as Tick).IsFillForward);\n\n            subscription.DisposeSafely();\n        }\n\n        [TestCase(typeof(TradeBar), true)]\n        [TestCase(typeof(OpenInterest), false)]\n        [TestCase(typeof(QuoteBar), false)]\n        public void SubscriptionEmitsAuxData(Type typeOfConfig, bool shouldReceiveAuxData)\n        {\n            var config = new SubscriptionDataConfig(typeOfConfig, _security.Symbol, Resolution.Hour, TimeZones.NewYork, TimeZones.NewYork, true, true, false);\n\n            var totalPoints = 8;\n            var time = new DateTime(2010, 1, 1);\n            var enumerator = Enumerable.Range(0, totalPoints).Select(x => new Delisting { Time = time.AddHours(x) }).GetEnumerator();\n            #pragma warning disable CA2000\n            var subscription = SubscriptionUtils.CreateAndScheduleWorker(\n                new SubscriptionRequest(\n                    false,\n                    null,\n                    _security,\n                    config,\n                    DateTime.UtcNow,\n                    Time.EndOfTime\n                ),\n                enumerator,\n                _factorFileProvider,\n                false, false);\n            #pragma warning restore CA2000\n            // Test our subscription stream to see if it emits the aux data it should be filtered\n            // by the SubscriptionUtils produce function if the config isn't for a TradeBar\n            int dataReceivedCount = 0;\n            while (subscription.MoveNext())\n            {\n                dataReceivedCount++;\n                if (subscription.Current != null && subscription.Current.Data.DataType == MarketDataType.Auxiliary)\n                {\n                    Assert.IsTrue(shouldReceiveAuxData);\n                }\n            }\n\n            // If it should receive aux data it should have emitted all points\n            // otherwise none should have been emitted\n            if (shouldReceiveAuxData)\n            {\n                Assert.AreEqual(totalPoints, dataReceivedCount);\n            }\n            else\n            {\n                Assert.AreEqual(0, dataReceivedCount);\n            }\n        }\n\n        private class TestDataEnumerator : IEnumerator<BaseData>\n        {\n            public bool ThrowException { get; set; }\n            public bool Disposed { get; set; }\n            public int MoveNextTrueCount { get; set; }\n\n            public void Dispose()\n            {\n                Disposed = true;\n            }\n\n            public bool MoveNext()\n            {\n                Current = new Tick(DateTime.UtcNow,Symbols.SPY, 1, 2);\n                var result = --MoveNextTrueCount >= 0;\n                if (ThrowException)\n                {\n                    throw new RegressionTestException(\"TestDataEnumerator.MoveNext()\");\n                }\n                return result;\n            }\n\n            public void Reset()\n            {\n            }\n\n            public BaseData Current { get; set; }\n\n            object IEnumerator.Current => Current;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/TextSubscriptionDataSourceReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Accord.Math.Comparers;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class TextSubscriptionDataSourceReaderTests\n    {\n        private SubscriptionDataConfig _config;\n        private DateTime _initialDate;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _config = new SubscriptionDataConfig(\n                typeof(TestTradeBarFactory),\n                Symbols.SPY,\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            _initialDate = new DateTime(2018, 1, 1);\n        }\n\n        [Test]\n        public void CachedDataIsReturnedAsClone()\n        {\n            using var singleEntryDataCacheProvider = new SingleEntryDataCacheProvider(TestGlobals.DataProvider);\n            var reader = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider,\n                _config,\n                _initialDate,\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(_config, _initialDate, false);\n\n            var dataBars = reader.Read(source).First();\n            dataBars.Value = 0;\n            var dataBars2 = reader.Read(source).First();\n\n            Assert.AreNotEqual(dataBars.Price, dataBars2.Price);\n        }\n\n        [Test]\n        public void DataIsNotCachedForEphemeralDataCacheProvider()\n        {\n            var config = new SubscriptionDataConfig(\n                    typeof(TestTradeBarFactory),\n                    Symbol.Create(\"SymbolNonEphemeralTest1\", SecurityType.Equity, Market.USA),\n                    Resolution.Daily,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false);\n            using var dataCacheProvider = new CustomEphemeralDataCacheProvider { IsDataEphemeral = true};\n            var reader = new TextSubscriptionDataSourceReader(\n                dataCacheProvider,\n                config,\n                _initialDate,\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(config, _initialDate, false);\n            dataCacheProvider.Data = \"20000101 00:00,1,1,1,1,1\";\n            var dataBars = reader.Read(source).First();\n            dataCacheProvider.Data = \"20000101 00:00,2,2,2,2,2\";\n            var dataBars2 = reader.Read(source).First();\n\n            Assert.AreEqual(new DateTime(2000, 1, 1), dataBars.Time);\n            Assert.AreEqual(new DateTime(2000, 1, 1), dataBars2.Time);\n            Assert.AreNotEqual(dataBars.Price, dataBars2.Price);\n        }\n\n        [Test]\n        public void DataIsCachedForNonEphemeralDataCacheProvider()\n        {\n            var config = new SubscriptionDataConfig(\n                typeof(TestTradeBarFactory),\n                Symbol.Create(\"SymbolNonEphemeralTest2\", SecurityType.Equity, Market.USA),\n                Resolution.Daily,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            using var dataCacheProvider = new CustomEphemeralDataCacheProvider { IsDataEphemeral = false };\n            var reader = new TextSubscriptionDataSourceReader(\n                dataCacheProvider,\n                config,\n                _initialDate,\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(config, _initialDate, false);\n            dataCacheProvider.Data = \"20000101 00:00,1,1,1,1,1\";\n            var dataBars = reader.Read(source).First();\n            // even if the data changes it already cached\n            dataCacheProvider.Data = \"20000101 00:00,2,2,2,2,2\";\n            var dataBars2 = reader.Read(source).First();\n\n            Assert.AreEqual(new DateTime(2000, 1, 1), dataBars.Time);\n            Assert.AreEqual(new DateTime(2000, 1, 1), dataBars2.Time);\n            Assert.AreEqual(dataBars.Price, dataBars2.Price);\n        }\n\n        [Test]\n        public void DataIsCachedCorrectly()\n        {\n            using var singleEntryDataCacheProvider = new SingleEntryDataCacheProvider(TestGlobals.DataProvider);\n            var reader = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider,\n                _config,\n                _initialDate,\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(_config, _initialDate, false);\n\n            var dataBars = reader.Read(source).ToList();\n            var dataBars2 = reader.Read(source).ToList();\n\n            Assert.AreEqual(dataBars2.Count, dataBars.Count);\n            Assert.IsTrue(dataBars.SequenceEqual(dataBars2, new CustomComparer<BaseData>(\n                (data, baseData) =>\n                {\n                    if (data.EndTime == baseData.EndTime\n                        && data.Time == baseData.Time\n                        && data.Symbol == baseData.Symbol\n                        && data.Price == baseData.Price\n                        && data.DataType == baseData.DataType\n                        && data.Value == baseData.Value)\n                    {\n                        return 0;\n                    }\n                    return 1;\n                })));\n        }\n\n        [Test]\n        public void RespectsInitialDate()\n        {\n            using var singleEntryDataCacheProvider = new SingleEntryDataCacheProvider(TestGlobals.DataProvider);\n            var reader = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider,\n                _config,\n                _initialDate,\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(_config, _initialDate, false);\n            var dataBars = reader.Read(source).First();\n\n            Assert.Less(dataBars.EndTime, _initialDate);\n\n            // 80 days after _initialDate\n            var initialDate2 = _initialDate.AddDays(80);\n            using var defaultDataProvider2 = new DefaultDataProvider();\n            using var singleEntryDataCacheProvider2 = new SingleEntryDataCacheProvider(defaultDataProvider2);\n            var reader2 = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider2,\n                _config,\n                initialDate2,\n                false,\n                null);\n            var source2 = (new TradeBar()).GetSource(_config, initialDate2, false);\n            var dataBars2 = reader2.Read(source2).First();\n\n            Assert.Less(dataBars2.EndTime, initialDate2);\n\n            // 80 days before _initialDate\n            var initialDate3 = _initialDate.AddDays(-80);\n            using var defaultDataProvider3 = new DefaultDataProvider();\n            using var singleEntryDataCacheProvider3 = new SingleEntryDataCacheProvider(defaultDataProvider3);\n            var reader3 = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider3,\n                _config,\n                initialDate3,\n                false,\n                null);\n            var source3 = (new TradeBar()).GetSource(_config, initialDate3, false);\n            var dataBars3 = reader3.Read(source3).First();\n\n            Assert.Less(dataBars3.EndTime, initialDate3);\n        }\n\n        [TestCase(Resolution.Daily, true)]\n        [TestCase(Resolution.Hour, true)]\n        [TestCase(Resolution.Minute, false)]\n        [TestCase(Resolution.Second, false)]\n        [TestCase(Resolution.Tick, false)]\n        public void CacheBehaviorDifferentResolutions(Resolution resolution, bool shouldBeCached)\n        {\n            _config = new SubscriptionDataConfig(\n                typeof(TestTradeBarFactory),\n                Symbols.SPY,\n                resolution,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            using var singleEntryDataCacheProvider = new SingleEntryDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: false);\n            var reader = new TextSubscriptionDataSourceReader(\n                singleEntryDataCacheProvider,\n                _config,\n                new DateTime(2013, 10, 07),\n                false,\n                null);\n            var source = (new TradeBar()).GetSource(_config, new DateTime(2013, 10, 07), false);\n\n            // first call should cache\n            reader.Read(source).First();\n            TestTradeBarFactory.ReaderWasCalled = false;\n            reader.Read(source).First();\n            Assert.AreEqual(!shouldBeCached, TestTradeBarFactory.ReaderWasCalled);\n        }\n\n        [Test, Explicit(\"Performance test\")]\n        public void CacheMissPerformance()\n        {\n            long counter = 0;\n            var datas = new List<IEnumerable<BaseData>>();\n\n            var factory = new TradeBar();\n            using var cacheProvider = new CustomEphemeralDataCacheProvider();\n\n            // we load SPY hour zip into memory and use it as the source of different fake tickers\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var fakeSource = factory.GetSource(config, new DateTime(2013, 10, 07), false);\n            cacheProvider.Data = string.Join(Environment.NewLine, QuantConnect.Compression.ReadLines(fakeSource.Source));\n\n            for (var i = 0; i < 500; i++)\n            {\n                var ticker = $\"{i}\";\n                var fakeConfig = new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbol.Create(ticker, SecurityType.Equity, Market.USA),\n                    Resolution.Hour,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false);\n                var reader = new TextSubscriptionDataSourceReader(cacheProvider, fakeConfig, Time.EndOfTime, false, null);\n\n                var source = factory.GetSource(fakeConfig, Time.BeginningOfTime, false);\n                datas.Add(reader.Read(source));\n            }\n\n            var timer = new Stopwatch();\n            timer.Start();\n            Parallel.ForEach(datas, enumerable =>\n            {\n                // after the first call should use the cache\n                foreach (var data in enumerable)\n                {\n                    Interlocked.Increment(ref counter);\n                }\n            });\n            timer.Stop();\n            Log.Trace($\"Took {timer.ElapsedMilliseconds}ms. Data count {counter}\");\n\n            timer.Reset();\n            timer.Start();\n            Parallel.ForEach(datas, enumerable =>\n            {\n                // after the first call should use the cache\n                foreach (var data in enumerable)\n                {\n                    Interlocked.Increment(ref counter);\n                }\n            });\n            timer.Stop();\n            Log.Trace($\"Took2 {timer.ElapsedMilliseconds}ms. Data count {counter}\");\n        }\n\n        [Test, Explicit(\"Performance test\")]\n        public void CacheHappyPerformance()\n        {\n            long counter = 0;\n            var datas = new List<IEnumerable<BaseData>>();\n\n            var factory = new TradeBar();\n            using var cacheProvider = new CustomEphemeralDataCacheProvider();\n\n            // we load SPY hour zip into memory and use it as the source of different fake tickers\n            var config = new SubscriptionDataConfig(typeof(TradeBar),\n                Symbols.SPY,\n                Resolution.Hour,\n                TimeZones.NewYork,\n                TimeZones.NewYork,\n                true,\n                true,\n                false);\n            var fakeSource = factory.GetSource(config, new DateTime(2013, 10, 07), false);\n            cacheProvider.Data = string.Join(Environment.NewLine, QuantConnect.Compression.ReadLines(fakeSource.Source));\n\n            for (var i = 0; i < 500; i++)\n            {\n                var ticker = $\"{i}\";\n                var fakeConfig = new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbol.Create(ticker, SecurityType.Equity, Market.USA),\n                    Resolution.Hour,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true,\n                    true,\n                    false);\n                var reader = new TextSubscriptionDataSourceReader(cacheProvider, fakeConfig, Time.EndOfTime, false, null);\n\n                var source = factory.GetSource(fakeConfig, Time.BeginningOfTime, false);\n                datas.Add(reader.Read(source));\n            }\n\n            var timer = new Stopwatch();\n            timer.Start();\n            Parallel.ForEach(datas, enumerable =>\n            {\n                // after the first call should use the cache\n                foreach (var data in enumerable)\n                {\n                    Interlocked.Increment(ref counter);\n                }\n                foreach (var data in enumerable)\n                {\n                    Interlocked.Increment(ref counter);\n                }\n                foreach (var data in enumerable)\n                {\n                    Interlocked.Increment(ref counter);\n                }\n            });\n            timer.Stop();\n            Log.Trace($\"Took {timer.ElapsedMilliseconds}ms. Data count {counter}\");\n        }\n\n        private class TestTradeBarFactory : TradeBar\n        {\n            /// <summary>\n            /// Will be true when data is created from a parsed file line\n            /// </summary>\n            public static bool ReaderWasCalled { get; set; }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                ReaderWasCalled = true;\n                return base.Reader(config, line, date, isLiveMode);\n            }\n            public override BaseData Reader(SubscriptionDataConfig config, StreamReader streamReader, DateTime date, bool isLiveMode)\n            {\n                ReaderWasCalled = true;\n                return base.Reader(config, streamReader, date, isLiveMode);\n            }\n        }\n\n        private class CustomEphemeralDataCacheProvider : IDataCacheProvider\n        {\n            public string Data { set; get; }\n            public bool IsDataEphemeral { set; get; }\n\n            public List<string> GetZipEntries(string zipFile)\n            {\n                throw new NotImplementedException();\n            }\n            public Stream Fetch(string key)\n            {\n                var stream = new MemoryStream();\n                var writer = new StreamWriter(stream, leaveOpen: true);\n                writer.Write(Data);\n                writer.Flush();\n                stream.Position = 0;\n                writer.Dispose();\n                return stream;\n            }\n            public void Store(string key, byte[] data)\n            {\n            }\n            public void Dispose()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/TimeSliceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Securities.Equity;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class TimeSliceTests\n    {\n        private TimeSliceFactory _timeSliceFactory;\n        [SetUp]\n        public void SetUp()\n        {\n            _timeSliceFactory = new TimeSliceFactory(TimeZones.Utc);\n        }\n\n        [Test]\n        public void HandlesTicks_ExpectInOrderWithNoDuplicates()\n        {\n            var subscriptionDataConfig = new SubscriptionDataConfig(\n                typeof(Tick),\n                Symbols.EURUSD,\n                Resolution.Tick,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            DateTime refTime = DateTime.UtcNow;\n\n            Tick[] rawTicks = Enumerable\n                .Range(0, 10)\n                .Select(i => new Tick(refTime.AddSeconds(i), Symbols.EURUSD, 1.3465m, 1.34652m))\n                .ToArray();\n\n            IEnumerable<TimeSlice> timeSlices = rawTicks.Select(t => _timeSliceFactory.Create(\n                t.Time,\n                new List<DataFeedPacket> { new DataFeedPacket(security, subscriptionDataConfig, new List<BaseData>() { t }) },\n                SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>()),\n                new Dictionary<Universe, BaseDataCollection>()));\n\n            Tick[] timeSliceTicks = timeSlices.SelectMany(ts => ts.Slice.Ticks.Values.SelectMany(x => x)).ToArray();\n\n            Assert.AreEqual(rawTicks.Length, timeSliceTicks.Length);\n            for (int i = 0; i < rawTicks.Length; i++)\n            {\n                Assert.IsTrue(Compare(rawTicks[i], timeSliceTicks[i]));\n            }\n        }\n\n        private bool Compare(Tick expected, Tick actual)\n        {\n            return expected.Time == actual.Time\n                   && expected.BidPrice == actual.BidPrice\n                   && expected.AskPrice == actual.AskPrice\n                   && expected.Quantity == actual.Quantity;\n        }\n\n        [Test]\n        public void HandlesMultipleCustomDataOfSameTypeWithDifferentSymbols()\n        {\n            var symbol1 = Symbol.Create(\"SCF/CBOE_VX1_EW\", SecurityType.Base, Market.USA);\n            var symbol2 = Symbol.Create(\"SCF/CBOE_VX2_EW\", SecurityType.Base, Market.USA);\n\n            var subscriptionDataConfig1 = new SubscriptionDataConfig(\n                typeof(UnlinkedData), symbol1, Resolution.Daily, TimeZones.Utc, TimeZones.Utc, true, true, false, isCustom: true);\n            var subscriptionDataConfig2 = new SubscriptionDataConfig(\n                typeof(UnlinkedData), symbol2, Resolution.Daily, TimeZones.Utc, TimeZones.Utc, true, true, false, isCustom: true);\n\n            var security1 = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig1,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var security2 = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig1,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var timeSlice = _timeSliceFactory.Create(DateTime.UtcNow,\n                new List<DataFeedPacket>\n                {\n                    new DataFeedPacket(security1, subscriptionDataConfig1, new List<BaseData> {new UnlinkedData { Symbol = symbol1, Time = DateTime.UtcNow.Date, Value = 15 } }),\n                    new DataFeedPacket(security2, subscriptionDataConfig2, new List<BaseData> {new UnlinkedData { Symbol = symbol2, Time = DateTime.UtcNow.Date, Value = 20 } }),\n                },\n                SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>()),\n                new Dictionary<Universe, BaseDataCollection>());\n\n            Assert.AreEqual(2, timeSlice.CustomData.Count);\n\n            var data1 = timeSlice.CustomData[0].Data[0];\n            var data2 = timeSlice.CustomData[1].Data[0];\n\n            Assert.IsInstanceOf(typeof(UnlinkedData), data1);\n            Assert.IsInstanceOf(typeof(UnlinkedData), data2);\n            Assert.AreEqual(symbol1, data1.Symbol);\n            Assert.AreEqual(symbol2, data2.Symbol);\n            Assert.AreEqual(15, data1.Value);\n            Assert.AreEqual(20, data2.Value);\n        }\n\n        [Test]\n        public void FutureDataHasVolume()\n        {\n            var initialVolume = 100;\n            var slices = GetSlices(Symbols.Fut_SPY_Mar19_2016, initialVolume).ToArray();\n\n            for (var i = 0; i < 10; i++)\n            {\n                var chain = slices[i].FutureChains.FirstOrDefault().Value;\n                var contract = chain.FirstOrDefault();\n                var expected = (i + 1) * initialVolume;\n                Assert.AreEqual(expected, contract.Volume);\n            }\n        }\n\n        [Test]\n        public void OptionsDataHasVolume()\n        {\n            var initialVolume = 150;\n            var slices = GetSlices(Symbols.SPY_C_192_Feb19_2016, initialVolume).ToArray();\n\n            for (var i = 0; i < 10; i++)\n            {\n                var chain = slices[i].OptionChains.FirstOrDefault().Value;\n                var contract = chain.FirstOrDefault();\n                var expected = (i + 1) * initialVolume;\n                Assert.AreEqual(expected, contract.Volume);\n            }\n        }\n\n        [Test]\n        public void SuspiciousTicksAreNotAddedToConsolidatorUpdateData()\n        {\n            var symbol = Symbols.SPY;\n\n            var subscriptionDataConfig = new SubscriptionDataConfig(\n                typeof(Tick), symbol, Resolution.Tick, TimeZones.Utc, TimeZones.Utc, true, true, false);\n\n            var security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var timeSlice = _timeSliceFactory.Create(DateTime.UtcNow,\n                new List<DataFeedPacket>\n                {\n                    new DataFeedPacket(security, subscriptionDataConfig, new List<BaseData>\n                    {\n                        new Tick(DateTime.UtcNow, symbol, 280, 0, 0),\n                        new Tick(DateTime.UtcNow, symbol, 500, 0, 0) { Suspicious = true },\n                        new Tick(DateTime.UtcNow, symbol, 281, 0, 0)\n                    })\n                },\n                SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>()),\n                new Dictionary<Universe, BaseDataCollection>());\n\n            Assert.AreEqual(1, timeSlice.ConsolidatorUpdateData.Count);\n\n            var data = timeSlice.ConsolidatorUpdateData[0].Data;\n            Assert.AreEqual(2, data.Count);\n            Assert.AreEqual(280, data[0].Value);\n            Assert.AreEqual(281, data[1].Value);\n        }\n\n        private IEnumerable<Slice> GetSlices(Symbol symbol, int initialVolume)\n        {\n            var dataType = symbol.SecurityType.IsOption() ? typeof(OptionUniverse) : typeof(FutureUniverse);\n            var subscriptionDataConfig = new SubscriptionDataConfig(dataType, symbol, Resolution.Second, TimeZones.Utc, TimeZones.Utc, true, true, false);\n            var security = GetSecurity(subscriptionDataConfig);\n            var refTime = DateTime.UtcNow;\n\n            return Enumerable\n                .Range(0, 10)\n                .Select(i =>\n                {\n                    var time = refTime.AddSeconds(i);\n                    var bid = new Bar(100, 100, 100, 100);\n                    var ask = new Bar(110, 110, 110, 110);\n                    var volume = (i + 1) * initialVolume;\n\n                    var packets = new List<DataFeedPacket>();\n                    var packet = new DataFeedPacket(security, subscriptionDataConfig, new List<BaseData>\n                    {\n                        new QuoteBar(time, symbol, bid, i*10, ask, (i + 1) * 11),\n                        new TradeBar(time, symbol, 100, 100, 110, 106, volume)\n                    });\n\n                    if (symbol.SecurityType == SecurityType.Option)\n                    {\n                        var underlying = (security as Option).Underlying;\n                        packets.Add(new DataFeedPacket(underlying, underlying.SubscriptionDataConfig, new List<BaseData>\n                        {\n                            new QuoteBar(time, underlying.Symbol, bid, i*10, ask, (i + 1) * 11),\n                            new TradeBar(time, underlying.Symbol, 100, 100, 110, 106, volume)\n                        }));\n                    }\n\n                    packets.Add(packet);\n\n                    return _timeSliceFactory.Create(\n                        time,\n                        packets,\n                        SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>()),\n                        new Dictionary<Universe, BaseDataCollection>())\n                        .Slice;\n                });\n        }\n\n        private Security GetSecurity(SubscriptionDataConfig config)\n        {\n            if (config.Symbol.SecurityType == SecurityType.Option)\n            {\n                var option = new Option(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null);\n                var underlyingConfig = new SubscriptionDataConfig(typeof(TradeBar), config.Symbol.Underlying, Resolution.Second,\n                    TimeZones.Utc, TimeZones.Utc, true, true, false);\n                var equity = new Equity(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    underlyingConfig,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null);\n                option.Underlying = equity;\n\n                return option;\n            }\n\n            if (config.Symbol.SecurityType == SecurityType.Future)\n            {\n                return new Future(\n                    SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                    config,\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null);\n            }\n\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                config,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/Transport/RemoteFileSubscriptionStreamReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Net;\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.DataFeeds.Transport;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds.Transport\n{\n    [TestFixture]\n    public class RemoteFileSubscriptionStreamReaderTests\n    {\n        private TestDownloadProvider _api;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _api = new TestDownloadProvider();\n            _api.Initialize(Globals.UserId, Globals.UserToken, Globals.DataFolder);\n            RemoteFileSubscriptionStreamReader.SetDownloadProvider(_api);\n            TestDownloadProvider.DownloadCount = 0;\n            // create cache directory if not existing\n            if (!Directory.Exists(Globals.Cache))\n            {\n                Directory.CreateDirectory(Globals.Cache);\n            }\n            else\n            {\n                // clean old files out of the cache\n                Directory.Delete(Globals.Cache, true);\n                Directory.CreateDirectory(Globals.Cache);\n            }\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _api.DisposeSafely();\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SingleEntryDataCacheProviderEphemeralDataIsRespected(bool isDataEphemeral)\n        {\n            using var cacheProvider = new SingleEntryDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            using var remoteReader = new RemoteFileSubscriptionStreamReader(\n                cacheProvider,\n                @\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(1, TestDownloadProvider.DownloadCount);\n\n            using var cacheProvider2 = new SingleEntryDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            using var remoteReader2 = new RemoteFileSubscriptionStreamReader(\n                cacheProvider2,\n                @\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(isDataEphemeral ? 2 : 1, TestDownloadProvider.DownloadCount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ZipDataCacheProviderEphemeralDataIsRespected(bool isDataEphemeral)\n        {\n            using var cacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            using var remoteReader = new RemoteFileSubscriptionStreamReader(\n                cacheProvider,\n                @\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(1, TestDownloadProvider.DownloadCount);\n\n            using var cacheProvider2 = new ZipDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            using var remoteReader2 = new RemoteFileSubscriptionStreamReader(\n                cacheProvider2,\n                @\"https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc&api_key=WyAazVXnq7ATy_fefTqm\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(isDataEphemeral ? 2 : 1, TestDownloadProvider.DownloadCount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void ZipDataCacheProviderEphemeralDataIsRespectedForZippedData(bool isDataEphemeral)\n        {\n            using var cacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider, isDataEphemeral: isDataEphemeral);\n            using var remoteReader = new RemoteFileSubscriptionStreamReader(\n                cacheProvider,\n                @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(1, TestDownloadProvider.DownloadCount);\n\n            using var remoteReader2 = new RemoteFileSubscriptionStreamReader(\n                cacheProvider,\n                @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(isDataEphemeral ? 2 : 1, TestDownloadProvider.DownloadCount);\n        }\n\n        [TestCase(true, \"\", 78)]    // No fragment, will read the first entry\n        [TestCase(false, \"\", 78)]\n        [TestCase(true, \"#csv_file_10.csv\", 1)]\n        [TestCase(false, \"#csv_file_10.csv\", 1)]\n        public void GetsZippedDataForUrlNotEndingWithZipExtension(bool withQuery, string entryName, int expectedLines)\n        {\n            using var cacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider);\n            var url = @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip\" + (withQuery ? \"?some=query\" : \"\") + entryName;\n            using var remoteReader = new RemoteFileSubscriptionStreamReader(cacheProvider, url, Globals.Cache, null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n            Assert.AreEqual(1, TestDownloadProvider.DownloadCount);\n\n            var count = 0;\n            while (!remoteReader.EndOfStream)\n            {\n                var line = remoteReader.ReadLine();\n                count++;\n\n                var csv = line.ToCsv();\n                Assert.AreEqual(2, csv.Count);\n                Assert.IsTrue(int.TryParse(csv[0], NumberStyles.Number, CultureInfo.InvariantCulture, out _));\n                Assert.IsTrue(decimal.TryParse(csv[1], NumberStyles.Number, CultureInfo.InvariantCulture, out _));\n            }\n\n            Assert.AreEqual(expectedLines, count);\n        }\n\n        [Test]\n        public void InvalidDataSource()\n        {\n            using var cacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider);\n            using var remoteReader = new RemoteFileSubscriptionStreamReader(\n                cacheProvider,\n                @\"http://quantconnect.com\",\n                Globals.Cache,\n                null);\n\n            Assert.IsFalse(remoteReader.EndOfStream);\n\n            // Fails to get quantconnect.com, missing http://\n            Assert.Throws<WebException>(() => new RemoteFileSubscriptionStreamReader(\n                    new SingleEntryDataCacheProvider(new DefaultDataProvider()),\n                    @\"quantconnect.com\",\n                    Globals.Cache,\n                    null),\n                \"Api.Download(): Failed to download data from quantconnect.com. Please verify the source for missing http:// or https://\"\n            );\n        }\n\n        private class TestDownloadProvider : QuantConnect.Api.Api\n        {\n            public static int DownloadCount { get; set; }\n            static TestDownloadProvider()\n            {\n                DownloadCount = 0;\n            }\n            public override byte[] DownloadBytes(string address, IEnumerable<KeyValuePair<string, string>> headers, string userName, string password)\n            {\n                DownloadCount++;\n                return base.DownloadBytes(address, headers, userName, password);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/UniverseSelectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class UniverseSelectionTests\n    {\n        [Test]\n        public void CreatedEquityIsNotAddedToSymbolCache()\n        {\n            SymbolCache.Clear();\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.SetEndDate(new DateTime(2024, 12, 13));\n            algorithm.SetStartDate(algorithm.EndDate.Subtract(TimeSpan.FromDays(10)));\n            algorithm.AddUniverse(CoarseSelectionFunction, FineSelectionFunction);\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n            var universe = algorithm.UniverseManager.Values.First();\n            var securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                algorithm.EndDate.ConvertToUtc(algorithm.TimeZone).Subtract(TimeSpan.FromDays(1)),\n                new BaseDataCollection(\n                    DateTime.UtcNow,\n                    Symbols.AAPL,\n                    new[]\n                    {\n                        new CoarseFundamental\n                        {\n                            Symbol = Symbols.AAPL,\n                            Time = DateTime.UtcNow\n                        },\n                        new CoarseFundamental\n                        {\n                            Symbol = Symbols.SPY,\n                            Time = DateTime.UtcNow\n                        }\n                    }\n                )\n            );\n            Symbol symbol;\n            Assert.AreEqual(1, securityChanges.AddedSecurities.Count);\n            Assert.AreEqual(Symbols.AAPL, securityChanges.AddedSecurities.First().Symbol);\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"AAPL\", out symbol));\n            Assert.IsFalse(SymbolCache.TryGetSymbol(\"SPY\", out symbol));\n        }\n\n        [Test]\n        public void RemovalFromUniverseAndDataFeedMakesSecurityNotTradable()\n        {\n            SymbolCache.Clear();\n            var algorithm = new AlgorithmStub(new MockDataFeedWithSubscription());\n            var orderProcessorMock = new Mock<IOrderProcessor>();\n            orderProcessorMock.Setup(m => m.GetOpenOrders(It.IsAny<Func<Order, bool>>())).Returns(new List<Order>());\n            algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n\n            algorithm.SetStartDate(2012, 3, 27);\n            algorithm.SetEndDate(2012, 3, 30);\n            algorithm.AddUniverse(\"my-custom-universe\", dt => dt.Day < 30 ? new List<string> { \"CPRT\" } : Enumerable.Empty<string>());\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n            var universe = algorithm.UniverseManager.Values.First();\n\n            var securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                algorithm.EndDate.ConvertToUtc(algorithm.TimeZone).Subtract(TimeSpan.FromDays(2)),\n                new BaseDataCollection(\n                    algorithm.UtcTime,\n                    Symbol.Create(\"CPRT\", SecurityType.Equity, Market.USA),\n                    new List<BaseData>()\n                )\n            );\n\n            Assert.AreEqual(1, securityChanges.AddedSecurities.Count);\n            Assert.AreEqual(0, securityChanges.RemovedSecurities.Count);\n\n            var security = securityChanges.AddedSecurities.First();\n            Assert.IsTrue(security.IsTradable);\n\n            securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                algorithm.EndDate.ConvertToUtc(algorithm.TimeZone),\n                new BaseDataCollection(\n                    algorithm.UtcTime,\n                    Symbol.Create(\"CPRT\", SecurityType.Equity, Market.USA),\n                    new List<BaseData>()\n                )\n            );\n\n            Assert.AreEqual(0, securityChanges.AddedSecurities.Count);\n            Assert.AreEqual(1, securityChanges.RemovedSecurities.Count);\n            Assert.AreEqual(security.Symbol, securityChanges.RemovedSecurities.First().Symbol);\n\n            Assert.IsFalse(security.IsTradable);\n        }\n\n        [Test]\n        public void CoarseFundamentalHasFundamentalDataFalseExcludedInFineUniverseSelection()\n        {\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.SetEndDate(new DateTime(2024, 12, 13));\n            algorithm.SetStartDate(algorithm.EndDate.Subtract(TimeSpan.FromDays(10)));\n\n            algorithm.AddUniverse(\n                coarse => coarse.Select(c => c.Symbol),\n                fine => fine.Select(f => f.Symbol).Where(x => x.ID.Symbol == \"AAPL\")\n            );\n            // OnEndOfTimeStep will add all pending universe additions\n            algorithm.OnEndOfTimeStep();\n\n            var universe = algorithm.UniverseManager.Values.First();\n            var securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                algorithm.EndDate.ConvertToUtc(algorithm.TimeZone).Subtract(TimeSpan.FromDays(1)),\n                new BaseDataCollection(\n                    DateTime.UtcNow,\n                    Symbols.AAPL,\n                    new[]\n                    {\n                        new CoarseFundamental\n                        {\n                            Symbol = Symbols.AAPL,\n                            Time = DateTime.UtcNow\n                        },\n                        new CoarseFundamental\n                        {\n                            Symbol = Symbols.SPY,\n                            Time = DateTime.UtcNow\n                        }\n                    }\n                )\n            );\n\n            Assert.AreEqual(1, securityChanges.Count);\n            Assert.AreEqual(Symbols.AAPL, securityChanges.AddedSecurities.First().Symbol);\n        }\n\n        [Test]\n        public void DoesNotAddSelectedSecuritiesIfNoTradableDates()\n        {\n            var algorithm = new AlgorithmStub(new MockDataFeed());\n            algorithm.SetStartDate(2023, 12, 01);\n            algorithm.SetEndDate(2023, 12, 30); // Sunday\n\n            algorithm.AddUniverse(\n                coarse => coarse.Select(c => c.Symbol),\n                fine => fine.Select(f => f.Symbol));\n            algorithm.OnEndOfTimeStep();\n\n            var universe = algorithm.UniverseManager.Values.First();\n\n            var getUniverseData = (DateTime dt) => new BaseDataCollection(\n                dt,\n                Symbols.AAPL,\n                [\n                    new CoarseFundamental\n                    {\n                        Symbol = Symbols.AAPL,\n                        Time = dt\n                    },\n                    new CoarseFundamental\n                    {\n                        Symbol = Symbols.SPY,\n                        Time = dt\n                    }\n                ]\n            );\n\n            // Friday, one tradeale day left before end date\n            var dateTime = new DateTime(2023, 12, 29).ConvertToUtc(algorithm.TimeZone);\n            var universeData = getUniverseData(dateTime);\n\n            var securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                dateTime,\n                universeData);\n            Assert.AreEqual(2, securityChanges.AddedSecurities.Count);\n            CollectionAssert.AreEquivalent(universeData.Select(x => x.Symbol), securityChanges.AddedSecurities.Select(x => x.Symbol));\n\n            // Saturday, no tradable days left before end date\n            dateTime += TimeSpan.FromDays(1);\n            universeData = getUniverseData(dateTime);\n\n            securityChanges = algorithm.DataManager.UniverseSelection.ApplyUniverseSelection(\n                universe,\n                dateTime,\n                universeData);\n            Assert.AreEqual(0, securityChanges.AddedSecurities.Count);\n        }\n\n        private IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)\n        {\n            return new List<Symbol> {Symbols.AAPL, Symbols.SPY};\n        }\n\n        private IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)\n        {\n            return new[] { fine.First(fundamental => fundamental.Symbol.Value == \"AAPL\").Symbol };\n        }\n\n        public class MockDataFeedWithSubscription : IDataFeed\n        {\n            public bool IsActive { get; }\n\n            public void Initialize(\n                IAlgorithm algorithm,\n                AlgorithmNodePacket job,\n                IResultHandler resultHandler,\n                IMapFileProvider mapFileProvider,\n                IFactorFileProvider factorFileProvider,\n                IDataProvider dataProvider,\n                IDataFeedSubscriptionManager subscriptionManager,\n                IDataFeedTimeProvider dataFeedTimeProvider,\n                IDataChannelProvider dataChannelProvider\n            )\n            {\n            }\n\n            public Subscription CreateSubscription(SubscriptionRequest request)\n            {\n                return new Subscription(request, Enumerable.Empty<SubscriptionData>().GetEnumerator(), null);\n            }\n\n            public void RemoveSubscription(Subscription subscription)\n            {\n            }\n\n            public void Exit()\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataFeeds/ZipEntryNameSubscriptionFactoryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine.DataFeeds\n{\n    [TestFixture]\n    public class ZipEntryNameSubscriptionFactoryTests\n    {\n        [Test]\n        public void ReadsZipEntryNames()\n        {\n            var time = new DateTime(2016, 03, 03, 12, 48, 15);\n            var source = Path.Combine(\"TestData\", \"20151224_quote_american.zip\");\n            var config = new SubscriptionDataConfig(typeof (CustomData), Symbol.Create(\"XLRE\", SecurityType.Option, Market.USA), Resolution.Tick,\n                TimeZones.NewYork, TimeZones.NewYork, false, false, false);\n            using var cacheProvider = new ZipDataCacheProvider(TestGlobals.DataProvider);\n            var factory = new ZipEntryNameSubscriptionDataSourceReader(cacheProvider, config, time, false);\n            var expected = new[]\n            {\n                Symbol.CreateOption(\"XLRE\", Market.USA, OptionStyle.American, OptionRight.Call, 21m, new DateTime(2016, 08, 19)),\n                Symbol.CreateOption(\"XLRE\", Market.USA, OptionStyle.American, OptionRight.Call, 22m, new DateTime(2016, 08, 19)),\n                Symbol.CreateOption(\"XLRE\", Market.USA, OptionStyle.American, OptionRight.Put, 37m, new DateTime(2016, 08, 19)),\n            };\n\n            var actual = factory.Read(new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.ZipEntryName)).ToList();\n\n            // we only really care about the symbols\n            CollectionAssert.AreEqual(expected, actual.Select(x => x.Symbol));\n            Assert.IsTrue(actual.All(x => x is CustomData));\n        }\n\n        private class CustomData : BaseData\n        {\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var symbol = LeanData.ReadSymbolFromZipEntry(config.Symbol, config.Resolution, line);\n                return new CustomData { Time = date, Symbol = symbol };\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.ZipEntryName);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataProviders/ApiDataProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Util;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataProviders\n{\n    [TestFixture, Explicit(\"Requires configured api access, and also makes calls to data endpoints which are charging transactions\")]\n    public class ApiDataProviderTests\n    {\n        private ApiDataProvider _dataProvider;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _dataProvider = new ApiDataProvider();\n        }\n\n        // Note: Most of these cases reflect real data files included in the repo. \n        // May be useful for other tests. Only ones that aren't included are map and factor file zips\n        // CFD Cases\n        [TestCase(\"cfd/oanda/daily/xauusd.zip\", 2, true)]                           // Daily stale data\n        [TestCase(\"cfd/oanda/daily/xauusd.zip\", 0, false)]                          // Daily fresh data\n        [TestCase(\"cfd/oanda/hour/xauusd.zip\", 6, true)]                            // Hourly stale data\n        [TestCase(\"cfd/oanda/hour/xauusd.zip\", 0, false)]                           // Hourly fresh data\n        [TestCase(\"cfd/oanda/minute/xauusd/20140501_quote.zip\", 10, false)]         // Date based minute data\n        [TestCase(\"cfd/oanda/second/xauusd/20140501_quote.zip\", 10, false)]         // Date based second data\n        [TestCase(\"cfd/oanda/tick/xauusd/20140501_quote.zip\", 10, false)]           // Date based tick data\n        // Crypto Cases\n        [TestCase(\"crypto/coinbase/daily/btcusd_quote.zip\", 6, true)]                   // Daily stale data\n        [TestCase(\"crypto/coinbase/daily/btcusd_quote.zip\", 0, false)]                  // Daily fresh data\n        [TestCase(\"crypto/coinbase/minute/btcusd/20161007_trade.zip\", 6, false)]        // Date based minute data\n        [TestCase(\"crypto/coinbase/second/btcusd/20161007_trade.zip\", 6, false)]        // Date based second data\n        // Equity Cases\n        [TestCase(\"equity/usa/daily/aaa.zip\", 4, true)]                             // Daily stale data\n        [TestCase(\"equity/usa/daily/aaa.zip\", 0, false)]                            // Daily fresh data\n        [TestCase(\"equity/usa/hour/aapl.zip\", 4, true)]                             // Hourly stale data\n        [TestCase(\"equity/usa/hour/aapl.zip\", 0, false)]                            // Hourly fresh data\n        [TestCase(\"equity/usa/minute/aapl/20140605_quote.zip\", 0, false)]           // Date Based minute data\n        [TestCase(\"equity/usa/second/aig/20131004_trade.zip\", 0, false)]            // Date Based second data\n        [TestCase(\"equity/usa/tick/aig/20131007_quote.zip\", 0, false)]              // Date Based tick data\n        [TestCase(\"equity/usa/factor_files/aaa.csv\", 5, true)]                      // Stale factor file\n        [TestCase(\"equity/usa/factor_files/aaa.csv\", 0, false)]                     // Fresh factor file\n        [TestCase(\"equity/usa/factor_files/factor_files_20210601.zip\", 25, false)]  // Date based factor files ** Not included in repo\n        [TestCase(\"equity/usa/map_files/aaa.csv\", 5, true)]                         // Stale map file\n        [TestCase(\"equity/usa/map_files/aaa.csv\", 0, false)]                        // Fresh map file\n        [TestCase(\"equity/usa/map_files/map_files_20210601.zip\", 12, false)]        // Date based map files ** Not included in repo\n        [TestCase(\"equity/usa/fundamental/coarse/20140324.csv\", 5, false)]          // Date based fundamental coarse files\n        [TestCase(\"equity/usa/fundamental/fine/aapl/20140228.csv\", 30, false)]      // Date based fundamental fine files (Always false because we don't support fine files)\n        [TestCase(\"equity/usa/shortable/testbrokerage/dates/20140325.csv\", 3, false)] // Date based shortable files\n        [TestCase(\"equity/usa/shortable/testbrokerage/symbols/aapl.csv\", 10, true)] // Symbol based shortable files\n        [TestCase(\"equity/usa/universes/daily/qctest/20131007.csv\", 10, false)]     // Date based universe file\n        // Equity Option Cases\n        [TestCase(\"option/usa/minute/aapl/20140606_openinterest_american.zip\", 10, false)]   // Date based minute data\n        // Forex Cases\n        [TestCase(\"forex/oanda/daily/eurgbp.zip\", 0, false)]                        // Daily fresh Forex data\n        [TestCase(\"forex/oanda/daily/eurgbp.zip\", 10, true)]                        // Daily stale Forex data\n        [TestCase(\"forex/oanda/hour/eurusd.zip\", 0, false)]                         // Hourly fresh Forex data\n        [TestCase(\"forex/oanda/hour/eurusd.zip\", 10, true)]                         // Hourly stale Forex data\n        [TestCase(\"forex/oanda/minute/eurusd/20140501_quote.zip\", 10, false)]       // Date based Forex minute data\n        [TestCase(\"forex/oanda/second/eurusd/20140501_quote.zip\", 10, false)]       // Date based Forex second data\n        [TestCase(\"forex/oanda/tick/eurusd/20140501_quote.zip\", 10, false)]         // Date based Forex tick data\n        // Price Future Cases False because Unsupported\n        [TestCase(\"future/cboe/margins/VX.csv\", 0, false)]                           // Fresh Margins data\n        [TestCase(\"future/cboe/margins/VX.csv\", 10, false)]                          // Stale Margins data\n        [TestCase(\"future/comex/minute/gc/20131007_openinterest.zip\", 10, false)]   // Date based minute data\n        [TestCase(\"future/comex/tick/gc/20131007_openinterest.zip\", 10, false)]     // Date based tick data\n        // Future Option Cases ** All False because Unsupported\n        [TestCase(\"futureoption/cme/minute/es/20200320/20200105_quote_american.zip\", 10, false)]   // Date based minute data\n        // Index Cases / Index Option Cases *Not included because not allowed to download\n        public void ShouldDownloadTest(string file, int days, bool expected)\n        {\n            // First create our test file and set its time\n            var path = Path.Combine(\"./ApiDataTests\", file);\n            var time = DateTime.Now - TimeSpan.FromDays(days);\n            var directory = Path.GetDirectoryName(path);\n\n            if (!Directory.Exists(directory))\n            {\n                Directory.CreateDirectory(directory);\n            }\n           \n            File.Create(path).Dispose();\n            File.SetLastWriteTime(path, time);\n\n            using var dataProvider = new ApiDataProviderTest();\n            var result = dataProvider.NeedToDownloadExposed(path);\n            Assert.AreEqual(expected, result);\n\n            // Cleanup after test\n            File.Delete(path);\n        }\n\n        // Alternative\n        [TestCase(\"alternative/sec/aapl/19980108_8K.zip\")]\n        // CFD\n        [TestCase(\"cfd/oanda/daily/ch20hkd.zip\")]\n        // Crypto\n        [TestCase(\"crypto/coinbase/minute/btcusd/20150114_trade.zip\")]\n        // Equities\n        [TestCase(\"equity/usa/shortable/atreyu/dates/20180117.csv\")]\n        [TestCase(\"equity/usa/factor_files/tsla.csv\")]\n        [TestCase(\"equity/usa/factor_files/factor_files_20210601.zip\")]\n        [TestCase(\"equity/usa/map_files/googl.csv\")]\n        [TestCase(\"equity/usa/map_files/map_files_20210601.zip\")]\n        // Equity Options\n        [TestCase(\"option/usa/minute/aapl/20100603_quote_american.zip\")]\n        // Forex\n        [TestCase(\"forex/oanda/minute/eurusd/20020516_quote.zip\")]\n        // Price Futures          * False because unsupported\n        [TestCase(\"future/cbot/minute/zs/20090501_trade.zip\", false)]\n        [TestCase(\"future/sgx/margins/IN.csv\", false)]\n        // Auxiliary Data Future Cases true\n        [TestCase(\"future/comex/map_files/map_files_20211225.zip\", true)]\n        [TestCase(\"future/cme/factor_files/factor_files_20211225.zip\", true)]\n        // Future Options   * False because unsupported\n        [TestCase(\"futureoption/comex/minute/og/20120227/20120105_quote_american.zip\", false)]\n        // Index            * False because unsupported\n        [TestCase(\"index/usa/minute/spx/19980217_trade.zip\", false)]\n        // Index Options    * False because unsupported\n        [TestCase(\"indexoption/usa/minute/spx/20100603_quote_european.zip\", false)]\n        public void DownloadFiles(string file, bool expectedToExist = true)\n        {\n            var path = Path.Combine(Globals.DataFolder, file);\n\n            // Delete it if we already have it\n            if (File.Exists(path))\n            {\n                File.Delete(path);\n                Assert.IsFalse(File.Exists(path));\n            }\n\n            // Go get the file\n            var stream = _dataProvider.Fetch(path);\n\n            if (expectedToExist)\n            {\n                Assert.IsNotNull(stream);\n                stream.Dispose();\n                Assert.IsTrue(File.Exists(path));\n            }\n            else\n            {\n                Assert.IsNull(stream);\n                Assert.IsFalse(File.Exists(path));\n            }\n        }\n\n        [Test]\n        public void DownloadsFileOnceConcurrently()\n        {\n            # pragma warning disable CA2000\n            var dataProvider = new ApiDataProviderTest();\n            #pragma warning restore CA2000\n\n            var tasks = new List<Task>();\n            for (var i = 0; i < 10; i++)\n            {\n                tasks.Add(Task.Factory.StartNew(() =>\n                    dataProvider.Fetch(Path.Combine(Globals.DataFolder, \"equity\", Market.USA, \"hour\", \"f.zip\"))));\n            }\n\n            tasks.ForEach(task => task.Wait());\n            dataProvider.DisposeSafely();\n            Assert.AreEqual(1, dataProvider.DownLoadCount);\n        }\n\n        private class ApiDataProviderTest : ApiDataProvider\n        {\n            public int DownLoadCount;\n\n            public bool NeedToDownloadExposed(string filePath)\n            {\n                return base.NeedToDownload(filePath);\n            }\n            protected override bool DownloadData(string filePath)\n            {\n                Interlocked.Increment(ref DownLoadCount);\n                // simulate download delay\n                Thread.Sleep(100);\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataProviders/DefaultDataProviderTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.DataProviders\n{\n    [TestFixture]\n    public class DefaultDataProviderTests\n    {\n        private DefaultDataProvider _defaultDataProvider;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _defaultDataProvider = new DefaultDataProvider();\n        }\n\n        [Test]\n        public void DefaultDataProvider_CanReadDataThatExists()\n        {\n            var stream = _defaultDataProvider.Fetch(\"../../../Data/equity/usa/minute/aapl/20140606_trade.zip\");\n            \n            Assert.IsNotNull(stream);\n        }\n\n        [Test]\n        public void DefaultDataProvider_CannotReadDataThatDoesNotExist()\n        {\n            var stream = _defaultDataProvider.Fetch(\"../../../Data/equity/usa/minute/aapl/19980606_trade.zip\");\n\n            Assert.IsNull(stream);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DataProviders/ProcessedDataProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing System.IO;\n\nnamespace QuantConnect.Tests.Engine.DataProviders\n{\n    [TestFixture]\n    public class ProcessedDataProviderTests\n    {\n        private ProcessedDataProvider _processedDataProvider;\n        private string _originalProcessedDataDirectory;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            // Set up the processed data provider\n            _originalProcessedDataDirectory = Config.Get(\"processed-data-directory\");\n            Config.Set(\"processed-data-directory\", \"TestData\");\n\n            _processedDataProvider = new ProcessedDataProvider();\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            _processedDataProvider.Dispose();\n\n            // Revert the configuration\n            Config.Set(\"processed-data-directory\", _originalProcessedDataDirectory);\n        }\n\n        private static TestCaseData[] ExistingDataTestCases => new[]\n        {\n            // Exists in the processed data directory\n            new TestCaseData(Path.Combine(Globals.DataFolder, \"spy_10_min.txt\"), true),\n            // Does not exist in the processed data directory but exists in the main data folder\n            new TestCaseData(Path.Combine(Globals.DataFolder, \"equity/usa/minute/aapl/20140606_trade.zip\"), true),\n            // Neither the processed data directory nor in the main data folder\n            new TestCaseData(Path.Combine(Globals.DataFolder, \"equity/usa/minute/somestock/19980606_trade.zip\"), false)\n        };\n\n        [TestCaseSource(nameof(ExistingDataTestCases))]\n        public void ProcessedDataProvider_CanReadDataThatExists(string path, bool exists)\n        {\n            var stream = _processedDataProvider.Fetch(path);\n\n            if (exists)\n            {\n                Assert.IsNotNull(stream);\n            }\n            else\n            {\n                Assert.IsNull(stream);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DefaultBrokerageMessageHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing NUnit.Framework;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class DefaultBrokerageMessageHandlerTests\n    {\n        [Test]\n        public void DoesNotSetAlgorithmRunTimeErrorOnDisconnectIfAllSecuritiesClosed()\n        {\n            var referenceTime = DateTime.UtcNow;\n            var algorithm = new AlgorithmStub();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.AddSecurities(equities: new List<string> { \"SPY\" });\n            algorithm.SetDateTime(referenceTime);\n            algorithm.Securities[Symbols.SPY].Exchange.SetMarketHours(Enumerable.Empty<MarketHoursSegment>(), referenceTime.ConvertFromUtc(TimeZones.NewYork).DayOfWeek);\n            var job = new LiveNodePacket();\n            var results = new TestResultHandler();//packet => Console.WriteLine(FieldsToString(packet)));\n            using var api = new Api.Api();\n            var handler = new DefaultBrokerageMessageHandler(algorithm, job, api, TimeSpan.FromSeconds(2));\n\n            Assert.IsNull(algorithm.RunTimeError);\n\n            handler.HandleMessage(BrokerageMessageEvent.Disconnected(\"Disconnection!\"));\n\n            Assert.IsNull(algorithm.RunTimeError);\n\n            results.Exit();\n        }\n\n        [Test]\n        public void DoesNotSetRunTimeErrorWhenReconnectMessageComesThrough()\n        {\n            var algorithm = new AlgorithmStub();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.AddSecurities(equities: new List<string> { \"SPY\" });\n            var referenceTime = DateTime.UtcNow;\n            algorithm.SetDateTime(referenceTime);\n            var localReferencTime = referenceTime.ConvertFromUtc(TimeZones.NewYork);\n            var open = localReferencTime.AddSeconds(1).TimeOfDay;\n            var closed = TimeSpan.FromDays(1);\n            var marketHours = new MarketHoursSegment(MarketHoursState.Market, open, closed);\n            algorithm.Securities[Symbols.SPY].Exchange.SetMarketHours(new [] {marketHours}, localReferencTime.DayOfWeek);\n            var job = new LiveNodePacket();\n            var results = new TestResultHandler();//packet => Console.WriteLine(FieldsToString(packet)));\n            using var api = new Api.Api();\n            var handler = new DefaultBrokerageMessageHandler(algorithm, job, api, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(.25));\n\n            Assert.IsNull(algorithm.RunTimeError);\n\n            handler.HandleMessage(BrokerageMessageEvent.Disconnected(\"Disconnection!\"));\n\n            Thread.Sleep(100);\n\n            handler.HandleMessage(BrokerageMessageEvent.Reconnected(\"Reconnected!\"));\n\n            Thread.Sleep(500);\n\n            Assert.IsNull(algorithm.RunTimeError);\n\n            results.Exit();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/DefaultOptionAssignmentModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Engine\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class DefaultOptionAssignmentModelTests\n    {\n        private static readonly SecurityExchangeHours SecurityExchangeHours = SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork);\n\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Index)]\n        public void SimulatesAssignment(SecurityType securityType)\n        {\n            var underlyingSymbol = securityType == SecurityType.Index ? Symbols.SPX : Symbols.SPY;\n            var settlementType = securityType == SecurityType.Index ? SettlementType.Cash : SettlementType.PhysicalDelivery;\n            var algorithm = new QCAlgorithm();\n            var sim = new DefaultOptionAssignmentModel();\n            var securities = new SecurityManager(TimeKeeper);\n\n            algorithm.Securities = securities;\n\n            // dictionaries with expected and actual results\n            var expected = new Dictionary<Option, bool>();\n            var actual = new Dictionary<Option, bool>();\n\n            // we build option chain at expiration\n            var expiration = new DateTime(2016, 02, 19);\n            var today = expiration.AddDays(-3);\n            algorithm.SetDateTime(today);\n\n            // we define option chain with expected results for each contract (if it is optimal to exercise it or not)\n            var optionChain = new[] { new { Right = OptionRight.Call, StrikePrice = 190.0m, BidPrice = 27.81m, AskPrice = 28.01m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 193.0m, BidPrice = 24.87m, AskPrice = 24.99m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 196.0m, BidPrice = 21.50m, AskPrice = 21.63m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 198.0m, BidPrice = 18.79m, AskPrice = 18.96m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 200.0m, BidPrice = 17.77m, AskPrice = 17.96m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 202.0m, BidPrice = 15.31m, AskPrice = 15.47m, Exercise = true },\n                                    new { Right = OptionRight.Call, StrikePrice = 220.0m, BidPrice = 15.31m, AskPrice = 15.47m, Exercise = false },\n\n                                    new { Right = OptionRight.Put, StrikePrice = 225.0m, BidPrice = 7.071m, AskPrice = 7.26m, Exercise = false },\n                                    new { Right = OptionRight.Put, StrikePrice = 226.0m, BidPrice = 8.07m, AskPrice = 8.24m, Exercise = false },\n                                    new { Right = OptionRight.Put, StrikePrice = 227.0m, BidPrice = 9.59m, AskPrice = 9.77m, Exercise = false },\n                                    new { Right = OptionRight.Put, StrikePrice = 230.0m, BidPrice = 12.01m, AskPrice = 12.34m, Exercise = true },\n                                    new { Right = OptionRight.Put, StrikePrice = 240.0m, BidPrice = 22.01m, AskPrice = 22.32m, Exercise = true } };\n\n            Func<OptionRight, decimal, decimal, decimal, Option> optionDef =\n                (right, strikePrice, bidPrice, askPrice) =>\n                {\n                    var symbol = Symbol.CreateOption(underlyingSymbol, Market.USA, OptionStyle.American, right, strikePrice, expiration);\n                    var option = new Option(\n                        SecurityExchangeHours,\n                        CreateTradeBarDataConfig(SecurityType.Option, symbol),\n                        new Cash(Currencies.USD, 0, 1m),\n                        new OptionSymbolProperties(SymbolProperties.GetDefault(Currencies.USD)),\n                        ErrorCurrencyConverter.Instance,\n                        RegisteredSecurityDataTypesProvider.Null\n                    ) { ExerciseSettlement = settlementType };\n                    securities.Add(symbol, option);\n\n                    securities[symbol].Holdings.SetHoldings(1, -1000);\n                    securities[symbol].SetMarketPrice(new Tick { Symbol = symbol, AskPrice = askPrice, BidPrice = bidPrice, Value = (askPrice + bidPrice)/2.0m, Time = today });\n                    option.Underlying = securities[symbol.Underlying];\n                    return option;\n                };\n\n            // setting up the underlying instrument\n            securities.Add(\n                underlyingSymbol,\n                new Security(\n                    SecurityExchangeHours,\n                    CreateTradeBarDataConfig(securityType, underlyingSymbol),\n                    new Cash(Currencies.USD, 0, 1m),\n                    SymbolProperties.GetDefault(Currencies.USD),\n                    ErrorCurrencyConverter.Instance,\n                    RegisteredSecurityDataTypesProvider.Null,\n                    new SecurityCache()\n                )\n            );\n            securities[underlyingSymbol].SetMarketPrice(new Tick { Symbol = underlyingSymbol, AskPrice = 217.94m, BidPrice = 217.86m, Value = 217.90m, Time = securities.UtcTime });\n\n            foreach (var def in optionChain)\n            {\n                expected.Add(optionDef(def.Right, def.StrikePrice, def.BidPrice, def.AskPrice), def.Exercise);\n            }\n            // running the simulation\n\n            // checking results\n            foreach (var option in algorithm.Securities.Values.Where(security => security.Symbol.SecurityType.IsOption()).OrderBy(security => security.Symbol))\n            {\n                var result = sim.GetAssignment(new OptionAssignmentParameters((Option)option));\n\n                Assert.AreEqual(expected[(Option)option], result.Quantity > 0, $\"Failed on strike: {option.Symbol.ID.StrikePrice}\");\n            }\n        }\n\n        private SubscriptionDataConfig CreateTradeBarDataConfig(SecurityType type, Symbol symbol)\n        {\n            if (type == SecurityType.Equity)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Forex)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Option)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            if (type == SecurityType.Index)\n                return new SubscriptionDataConfig(typeof(TradeBar), symbol, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, true, true, true);\n            throw new NotImplementedException(type.ToString());\n        }\n        private static TimeKeeper TimeKeeper\n        {\n            get { return new TimeKeeper(DateTime.Now, new[] { TimeZones.NewYork }); }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/HistoricalData/FakeHistoryProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing System.Collections.Generic;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Tests.Engine.HistoricalData\n{\n    /// <summary>\n    /// Provides FAKE implementation of <see cref=\"IHistoryProvider\"/>\n    /// </summary>\n    internal class TestHistoryProvider : HistoryProviderBase\n    {\n        public override int DataPointCount => 2;\n\n        /// <summary>\n        /// Initializes this history provider to work for the specified job\n        /// </summary>\n        /// <param name=\"parameters\">The initialization parameters</param>\n        public override void Initialize(HistoryProviderInitializeParameters parameters)\n        {\n        }\n\n        /// <summary>\n        /// Gets the history for the requested securities\n        /// </summary>\n        /// <param name=\"requests\">The historical data requests</param>\n        /// <param name=\"sliceTimeZone\">The time zone used when time stamping the slice instances</param>\n        /// <returns>An enumerable of the slices of data covering the span specified in each request</returns>\n        public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n        {\n            List<Slice> result = new();\n            var slice1Date = new DateTime(2008, 01, 03, 5, 0, 0);\n            var slice2Date = new DateTime(2013, 06, 28, 13, 32, 0);\n\n            TradeBar tradeBar1 = new TradeBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            TradeBar tradeBar2 = new TradeBar { Symbol = Symbols.AAPL, Time = DateTime.Now };\n            var quoteBar1 = new QuoteBar { Symbol = Symbols.SPY, Time = DateTime.Now };\n            var tick1 = new Tick(DateTime.Now, Symbols.SPY, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var split1 = new Split(Symbols.SPY, DateTime.Now, 1, 1, SplitType.SplitOccurred);\n            var dividend1 = new Dividend(Symbols.SPY, DateTime.Now, 1, 1);\n            var delisting1 = new Delisting(Symbols.SPY, DateTime.Now, 1, DelistingType.Delisted);\n            var symbolChangedEvent1 = new SymbolChangedEvent(Symbols.SPY, DateTime.Now, \"SPY\", \"SP\");\n            Slice slice1 = new Slice(slice1Date, new BaseData[] { tradeBar1, tradeBar2,\n                quoteBar1, tick1, split1, dividend1, delisting1, symbolChangedEvent1\n            }, slice1Date);\n\n            TradeBar tradeBar3 = new TradeBar { Symbol = Symbols.MSFT, Time = DateTime.Now };\n            TradeBar tradeBar4 = new TradeBar { Symbol = Symbols.SBIN, Time = DateTime.Now };\n            var quoteBar2 = new QuoteBar { Symbol = Symbols.SBIN, Time = DateTime.Now };\n            var tick2 = new Tick(DateTime.Now, Symbols.SBIN, 1.1m, 2.1m) { TickType = TickType.Trade };\n            var split2 = new Split(Symbols.SBIN, DateTime.Now, 1, 1, SplitType.SplitOccurred);\n            var dividend2 = new Dividend(Symbols.SBIN, DateTime.Now, 1, 1);\n            var delisting2 = new Delisting(Symbols.SBIN, DateTime.Now, 1, DelistingType.Delisted);\n            var symbolChangedEvent2 = new SymbolChangedEvent(Symbols.SBIN, DateTime.Now, \"SBIN\", \"BIN\");\n            Slice slice2 = new Slice(slice2Date, new BaseData[] { tradeBar3, tradeBar4,\n                quoteBar2, tick2, split2, dividend2, delisting2, symbolChangedEvent2\n            }, slice2Date);\n\n            result.Add(slice1);\n            result.Add(slice2);\n            return result;\n        }\n\n        public void TriggerEvents()\n        {\n            OnInvalidConfigurationDetected(new InvalidConfigurationDetectedEventArgs(Symbols.SPY, \"invalid config\"));\n            OnNumericalPrecisionLimited(new NumericalPrecisionLimitedEventArgs(Symbols.SPY, \"invalid config\"));\n            OnStartDateLimited(new StartDateLimitedEventArgs(Symbols.SPY, \"invalid config\"));\n            OnDownloadFailed(new DownloadFailedEventArgs(Symbols.SPY, \"invalid config\"));\n            OnReaderErrorDetected(new ReaderErrorDetectedEventArgs(Symbols.SPY, \"invalid config\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/HistoricalData/HistoryProviderManagerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Tests.Brokerages;\nusing QuantConnect.Brokerages.Paper;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\n\nnamespace QuantConnect.Tests.Engine.HistoricalData\n{\n    [TestFixture]\n    public class HistoryProviderManagerTests\n    {\n        private HistoryProviderManager _historyProviderWrapper;\n        private PaperBrokerage _paperBrokerage;\n\n        [SetUp]\n        public void Setup()\n        {\n            Setup(DeploymentTarget.LocalPlatform);\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            Composer.Instance.Reset();\n            _paperBrokerage.DisposeSafely();\n        }\n\n        [Test]\n        public void DataPointCount()\n        {\n            var symbol = Symbol.Create(\"WM\", SecurityType.Equity, Market.USA);\n\n            var request = TestsHelpers.GetHistoryRequest(symbol, new DateTime(2008, 01, 01), new DateTime(2008, 01, 05), Resolution.Daily, TickType.Trade);\n\n            var result = _historyProviderWrapper.GetHistory(new[] { request }, TimeZones.NewYork).ToList();\n\n            Assert.IsNotNull(result);\n            Assert.IsNotEmpty(result);\n            Assert.AreEqual(5, _historyProviderWrapper.DataPointCount);\n        }\n\n        [Test]\n        public void TestEvents()\n        {\n            bool invalidConfigurationDetected = new();\n            bool numericalPrecisionLimited = new();\n            bool startDateLimited = new();\n            bool downloadFailed = new();\n            bool readerErrorDetected = new();\n            _historyProviderWrapper.InvalidConfigurationDetected += (sender, args) => { invalidConfigurationDetected = true; };\n            _historyProviderWrapper.NumericalPrecisionLimited += (sender, args) => { numericalPrecisionLimited = true; };\n            _historyProviderWrapper.StartDateLimited += (sender, args) => { startDateLimited = true; };\n            _historyProviderWrapper.DownloadFailed += (sender, args) => { downloadFailed = true; };\n            _historyProviderWrapper.ReaderErrorDetected += (sender, args) => { readerErrorDetected = true; };\n\n            var historyProvider = Composer.Instance.GetExportedValueByTypeName<IHistoryProvider>(nameof(TestHistoryProvider));\n            (historyProvider as TestHistoryProvider).TriggerEvents();\n            Assert.IsTrue(invalidConfigurationDetected);\n            Assert.IsTrue(numericalPrecisionLimited);\n            Assert.IsTrue(startDateLimited);\n            Assert.IsTrue(downloadFailed);\n            Assert.IsTrue(readerErrorDetected);\n        }\n\n        [Test]\n        public void OptionsAreMappedCorrectly()\n        {\n            var symbol = Symbol.CreateOption(\n                \"FOXA\",\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                32,\n                new DateTime(2013, 07, 20));\n\n            var request = TestsHelpers.GetHistoryRequest(symbol, new DateTime(2013, 06, 28), new DateTime(2013, 07, 03), Resolution.Minute, TickType.Quote);\n\n            var result = _historyProviderWrapper.GetHistory(new[] { request }, TimeZones.NewYork).ToList();\n\n            Assert.IsNotEmpty(result);\n\n            // assert we fetch the data for the previous and new symbol\n            var firstBar = result[1].Values.Single();\n            var lastBar = result.Last().Values.Single();\n\n            Assert.IsTrue(firstBar.Symbol.Value.Contains(\"NWSA\"));\n            Assert.AreEqual(28, firstBar.Time.Date.Day);\n            Assert.IsTrue(lastBar.Symbol.Value.Contains(\"FOXA\"));\n            Assert.AreEqual(2, lastBar.Time.Date.Day);\n            Assert.AreEqual(425, result.Count);\n            Assert.AreEqual(426, _historyProviderWrapper.DataPointCount);\n        }\n\n        [TestCase(DeploymentTarget.CloudPlatform)]\n        [TestCase(DeploymentTarget.LocalPlatform)]\n        public void EquitiesMergedCorrectly(DeploymentTarget deploymentTarget)\n        {\n            TearDown();\n            Setup(deploymentTarget);\n            var symbol = Symbol.Create(\"WM\", SecurityType.Equity, Market.USA);\n\n            var request = TestsHelpers.GetHistoryRequest(symbol, new DateTime(2008, 01, 01), new DateTime(2008, 01, 05), Resolution.Daily, TickType.Trade);\n\n            var result = _historyProviderWrapper.GetHistory(new[] { request }, TimeZones.NewYork).ToList();\n\n            Assert.IsNotEmpty(result);\n            var firstBar = result.First().Values.Single();\n            Assert.AreEqual(\"WMI\", firstBar.Symbol.Value);\n            Assert.AreEqual(deploymentTarget == DeploymentTarget.CloudPlatform ? 3 : 4, result.Count);\n            Assert.AreEqual(5, _historyProviderWrapper.DataPointCount);\n        }\n\n        [Test]\n        public void DataIncreasesInTime()\n        {\n            var symbol = Symbol.Create(\"WM\", SecurityType.Equity, Market.USA);\n\n            var request = TestsHelpers.GetHistoryRequest(symbol, new DateTime(2008, 01, 01), new DateTime(2008, 01, 05), Resolution.Daily, TickType.Trade);\n\n            var result = _historyProviderWrapper.GetHistory(new[] { request }, TimeZones.NewYork).ToList();\n\n            var initialTime = DateTime.MinValue;\n            foreach (var slice in result)\n            {\n                Assert.That(slice.UtcTime, Is.GreaterThan(initialTime));\n                initialTime = slice.UtcTime;\n            }\n        }\n\n        private void Setup(DeploymentTarget deploymentTarget)\n        {\n            _historyProviderWrapper = new();\n            var historyProviders = Newtonsoft.Json.JsonConvert.SerializeObject(new[] { nameof(SubscriptionDataReaderHistoryProvider), nameof(TestHistoryProvider) });\n            var jobWithArrayHistoryProviders = new LiveNodePacket\n            {\n                HistoryProvider = historyProviders,\n                DeploymentTarget = deploymentTarget\n            };\n            _paperBrokerage = new PaperBrokerage(null, null);\n            _historyProviderWrapper.SetBrokerage(_paperBrokerage);\n            _historyProviderWrapper.Initialize(new HistoryProviderInitializeParameters(\n                jobWithArrayHistoryProviders,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                null,\n                new AlgorithmSettings()));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/HistoricalData/SubscriptionDataReaderHistoryProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Lean.Engine.Storage;\nusing QuantConnect.Securities;\nusing QuantConnect.Storage;\nusing QuantConnect.Util;\nusing HistoryRequest = QuantConnect.Data.HistoryRequest;\n\nnamespace QuantConnect.Tests.Engine.HistoricalData\n{\n    [TestFixture]\n    public class SubscriptionDataReaderHistoryProviderTests\n    {\n        [Test]\n        public void OptionsAreMappedCorrectly()\n        {\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                null,\n                new AlgorithmSettings()));\n            var symbol = Symbol.CreateOption(\n                \"FOXA\",\n                Market.USA,\n                OptionStyle.American,\n                OptionRight.Call,\n                32,\n                new DateTime(2013, 07, 20));\n\n            var result = historyProvider.GetHistory(\n                new[]\n                {\n                    new HistoryRequest(new DateTime(2013, 06,28),\n                        new DateTime(2013, 07,03),\n                        typeof(QuoteBar),\n                        symbol,\n                        Resolution.Minute,\n                        SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                        TimeZones.NewYork,\n                        null,\n                        false,\n                        false,\n                        DataNormalizationMode.Raw,\n                        TickType.Quote)\n                },\n                TimeZones.NewYork).ToList();\n\n            Assert.IsNotEmpty(result);\n\n            // assert we fetch the data for the previous and new symbol\n            var firstBar = result.First().Values.Single();\n            var lastBar = result.Last().Values.Single();\n\n            Assert.IsTrue(firstBar.Symbol.Value.Contains(\"NWSA\"));\n            Assert.AreEqual(28, firstBar.Time.Date.Day);\n            Assert.IsTrue(lastBar.Symbol.Value.Contains(\"FOXA\"));\n            Assert.AreEqual(2, lastBar.Time.Date.Day);\n        }\n\n        [Test]\n        public void EquitiesAreMappedCorrectly()\n        {\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                null,\n                new AlgorithmSettings()));\n            var symbol = Symbol.Create(\"WM\",SecurityType.Equity,Market.USA);\n\n            var result = historyProvider.GetHistory(\n                new[]\n                {\n                    new HistoryRequest(new DateTime(2008, 01,01),\n                        new DateTime(2008, 01,05),\n                        typeof(TradeBar),\n                        symbol,\n                        Resolution.Daily,\n                        SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                        TimeZones.NewYork,\n                        null,\n                        false,\n                        false,\n                        DataNormalizationMode.Raw,\n                        TickType.Trade)\n                },\n                TimeZones.NewYork).ToList();\n\n            var firstBar = result.First().Values.Single();\n            Assert.AreEqual(\"WMI\", firstBar.Symbol.Value);\n            Assert.IsNotEmpty(result);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/PartialFillModel.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Orders;\nusing QuantConnect.Orders.Fills;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Algorithm.CSharp\n{\n    /// <summary>\n    /// Implements a custom fill model that inherit from FillModel. Override the MarketFill method to simulate partially fill orders\n    /// </summary>\n    internal class PartialFillModel : FillModel\n    {\n        private readonly QCAlgorithm _algorithm;\n        private readonly Dictionary<int, decimal> _absoluteRemainingByOrderId;\n        private readonly decimal _rate;\n        public PartialFillModel(QCAlgorithm algorithm, decimal rate = 1.0m)\n        {\n            _algorithm = algorithm;\n            _rate = rate;\n            _absoluteRemainingByOrderId = new Dictionary<int, decimal>();\n        }\n\n        public override OrderEvent MarketFill(Security asset, MarketOrder order)\n        {\n            decimal absoluteRemaining;\n            if (!_absoluteRemainingByOrderId.TryGetValue(order.Id, out absoluteRemaining))\n            {\n                absoluteRemaining = order.AbsoluteQuantity;\n                _absoluteRemainingByOrderId.Add(order.Id, order.AbsoluteQuantity);\n            }\n\n            // Create the object\n            var fill = base.MarketFill(asset, order);\n\n            // Set this fill amount\n            var absoluteFillQuantity = (int)(Math.Min(absoluteRemaining, _rate * (int)order.AbsoluteQuantity));\n            fill.FillQuantity = Math.Sign(order.Quantity) * absoluteFillQuantity;\n\n            if (absoluteRemaining == absoluteFillQuantity)\n            {\n                fill.Status = OrderStatus.Filled;\n                _absoluteRemainingByOrderId.Remove(order.Id);\n            }\n            else\n            {\n                fill.Status = OrderStatus.PartiallyFilled;\n                _absoluteRemainingByOrderId[order.Id] = absoluteRemaining - absoluteFillQuantity;\n\n                _algorithm.Debug($\"{_algorithm.Time} - Partial Fill - Remaining {absoluteRemaining} Price - {fill.FillPrice}\");\n            }\n            return fill;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Engine/PerformanceBenchmarkAlgorithms.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine\n{\n    public static class PerformanceBenchmarkAlgorithms\n    {\n        public static QCAlgorithm SingleSecurity_Second => new SingleSecurity_Second_BenchmarkTest();\n        public static QCAlgorithm FiveHundredSecurity_Second => new FiveHundredSecurity_Second_BenchmarkTest();\n\n        public static QCAlgorithm CreateBenchmarkAlgorithm(int securityCount, Resolution resolution)\n        {\n            // determine reasonable start/end dates\n            var start = new DateTime(2000, 01, 01);\n\n            // aim for 5MM data points\n            var pointsPerSecurity = 5000000 / securityCount;\n            var increment = resolution.ToTimeSpan();\n            var incrementsPerDay = Time.OneDay.Ticks / increment.Ticks;\n            var days = pointsPerSecurity / incrementsPerDay - 1;\n\n            if (days < 0)\n            {\n                throw new Exception($\"Unable to create {securityCount} subscriptions at {resolution} resolution. Consider using a larger resolution.\");\n            }\n\n            var parameters = new Parameters(securityCount, resolution, start, start.AddDays(days));\n            return new EquityBenchmarkAlgorithm(parameters);\n        }\n\n        private class SingleSecurity_Second_BenchmarkTest : QCAlgorithm\n        {\n            public SingleSecurity_Second_BenchmarkTest()\n            {\n                SubscriptionManager.SetDataManager(new DataManagerStub(this, new MockDataFeed()));\n            }\n\n            public override void Initialize()\n            {\n                SetStartDate(2008, 01, 01);\n                SetEndDate(2009, 01, 01);\n                SetCash(100000);\n                SetBenchmark(time => 0m);\n                AddEquity(\"SPY\", Resolution.Second);\n            }\n        }\n\n        private class FiveHundredSecurity_Second_BenchmarkTest : QCAlgorithm\n        {\n            public override void Initialize()\n            {\n                SetStartDate(2018, 02, 01);\n                SetEndDate(2018, 02, 01);\n                SetCash(100000);\n                SetBenchmark(time => 0m);\n                foreach (var symbol in QuantConnect.Algorithm.CSharp.Benchmarks.Symbols.Equity.All.Take(500))\n                {\n                    AddEquity(symbol, Resolution.Second);\n                }\n            }\n        }\n\n        private class EquityBenchmarkAlgorithm : QCAlgorithm\n        {\n            private readonly Parameters _parameters;\n\n            public EquityBenchmarkAlgorithm(Parameters parameters)\n            {\n                _parameters = parameters;\n            }\n\n            public override void Initialize()\n            {\n                SetStartDate(_parameters.StartDate);\n                SetEndDate(_parameters.EndDate);\n                SetBenchmark(time => 0m);\n\n                foreach (var symbol in QuantConnect.Algorithm.CSharp.Benchmarks.Symbols.Equity.All.Take(_parameters.SecurityCount))\n                {\n                    AddEquity(symbol, _parameters.Resolution);\n                }\n            }\n        }\n\n        public class Parameters\n        {\n            public int SecurityCount { get; set; }\n            public Resolution Resolution { get; set; }\n            public DateTime StartDate { get; set; }\n            public DateTime EndDate { get; set; }\n\n            public Parameters(int securityCount, Resolution resolution, DateTime startDate, DateTime endDate)\n            {\n                SecurityCount = securityCount;\n                Resolution = resolution;\n                StartDate = startDate;\n                EndDate = endDate;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Engine/ProcessSplitSymbolsDuringWarmupTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages.Backtesting;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine\n{\n    /// <summary>\n    /// Tests the ProcessSplitSymbols method directly via reflection to ensure\n    /// it properly skips processing during warmup in live mode.\n    /// </summary>\n    [TestFixture]\n    public class ProcessSplitSymbolsDuringWarmupTests\n    {\n        private QCAlgorithm _algorithm;\n        private AlgorithmManager _algorithmManager;\n        private BrokerageTransactionHandler _transactionHandler;\n        private TestResultHandler _resultHandler;\n        private BacktestingBrokerage _brokerage;\n        private MethodInfo _processSplitSymbolsMethod;\n\n        [SetUp]\n        public void SetUp()\n        {\n            // Create algorithm instance\n            _algorithm = new QCAlgorithm();\n\n            // Initialize data manager\n            _algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(_algorithm));\n            _algorithm.SetDateTime(new DateTime(2025, 10, 10, 19, 0, 0));\n            // Add equity with market price\n            var spy = _algorithm.AddEquity(\"SPY\", Resolution.Daily);\n            spy.SetMarketPrice(new Tick { Value = 100m, Symbol = spy.Symbol, Time = _algorithm.Time });\n\n            // Initialize transaction components\n            _transactionHandler = new BrokerageTransactionHandler();\n            _resultHandler = new TestResultHandler();\n            _brokerage = new BacktestingBrokerage(_algorithm);\n\n            _transactionHandler.Initialize(_algorithm, _brokerage, _resultHandler);\n            _algorithm.Transactions.SetOrderProcessor(_transactionHandler);\n\n            // Create AlgorithmManager and get ProcessSplitSymbols method via reflection\n            _algorithmManager = new AlgorithmManager(false);\n            _processSplitSymbolsMethod = typeof(AlgorithmManager).GetMethod(\n                \"ProcessSplitSymbols\",\n                BindingFlags.NonPublic | BindingFlags.Instance\n            );\n\n            Assert.IsNotNull(_processSplitSymbolsMethod, \"ProcessSplitSymbols method should be found via reflection\");\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _transactionHandler?.Exit();\n            _brokerage?.Dispose();\n            _resultHandler?.Exit();\n        }\n\n        [TestCase(false, false, true)]\n        [TestCase(true, false, true)]\n        [TestCase(false, true, true)]\n        [TestCase(true, true, true)]\n        [TestCase(false, false, false)]\n        [TestCase(true, false, false)]\n        [TestCase(false, true, false)]\n        [TestCase(true, true, false)]\n        public void ProcessSplitSymbolsDoesNotThrow(bool liveMode, bool isWarmingUp, bool hasHoldings)\n        {\n            _algorithm.SetLiveMode(liveMode);\n            if (!isWarmingUp)\n            {\n                _algorithm.SetFinishedWarmingUp();\n            }\n            Assert.AreEqual(isWarmingUp, _algorithm.IsWarmingUp, $\"Algorithm should be warming up: {isWarmingUp}\");\n\n            var splitWarnings = new List<Split>\n            {\n                new Split(\n                    Symbols.SPY,\n                    _algorithm.Time,\n                    100m,\n                    0.5m,\n                    SplitType.Warning\n                )\n            };\n\n            if (hasHoldings)\n            {\n                _algorithm.Securities[Symbols.SPY].Holdings.SetHoldings(350, 100);\n            }\n\n            Assert.DoesNotThrow(() =>\n            {\n                _processSplitSymbolsMethod.Invoke(\n                    _algorithmManager,\n                    new object[] { _algorithm, splitWarnings, new List<Delisting>() }\n                );\n            });\n\n            Assert.AreEqual(0, splitWarnings.Count, \"Split warning should be removed\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/RealTime/BacktestingRealTimeHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Engine.RealTime\n{\n    [TestFixture]\n    public class BacktestingRealTimeHandlerTests\n    {\n        private IResultHandler _resultHandler;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _resultHandler = new TestResultHandler();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            _resultHandler.Exit();\n        }\n\n        [Test]\n        public void SortsEventsAfterSetup()\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            var algo = new TestAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.AddEquity(\"SPY\");\n            var startDate = new DateTime(2019, 1, 1);\n            algo.SetStartDate(startDate);\n            algo.SetDateTime(startDate);\n            algo.SetEndDate(2020, 1, 1);\n\n            var firstCalled = false;\n            var secondCalled = false;\n            var events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> { startDate.AddMinutes(-10), startDate.AddMinutes(5)},\n                    (s, time) => { firstCalled = true; }),\n                new ScheduledEvent(\"2\", new List<DateTime> { startDate.AddMinutes(1)},\n                    (s, time) => { secondCalled = true; }),\n                new ScheduledEvent(\"3\", new List<DateTime> { startDate.AddMinutes(10)}, (s, time) => { })\n            };\n            foreach (var scheduledEvent in events)\n            {\n                realTimeHandler.Add(scheduledEvent);\n            }\n\n            realTimeHandler.Setup(algo,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                null);\n\n            realTimeHandler.SetTime(startDate.AddMinutes(1));\n            realTimeHandler.Exit();\n\n            Assert.IsTrue(secondCalled);\n            // 'first' should of been called and should be moved behind 'second' after setup\n            Assert.IsFalse(firstCalled);\n        }\n\n        [Test]\n        public void SingleScheduledEventFires_SetTime()\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            var algo = new TestAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.AddEquity(\"SPY\");\n            algo.SetStartDate(2019, 1, 1);\n            algo.SetDateTime(new DateTime(2019, 1, 1));\n            algo.SetEndDate(2020, 1, 1);\n            realTimeHandler.Setup(algo,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                null);\n\n            realTimeHandler.SetTime(DateTime.UtcNow);\n            realTimeHandler.Exit();\n            Assert.IsTrue(algo.OnEndOfDayFired);\n        }\n\n        [Test]\n        public void SingleScheduledEventFires_ScanPastEvents()\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            var algo = new TestAlgorithm();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.AddEquity(\"SPY\");\n            algo.SetStartDate(2019, 1, 1);\n            algo.SetDateTime(new DateTime(2019, 1, 1));\n            algo.SetEndDate(2020, 1, 1);\n            realTimeHandler.Setup(algo,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                null);\n\n            realTimeHandler.ScanPastEvents(DateTime.UtcNow);\n            realTimeHandler.Exit();\n            Assert.IsTrue(algo.OnEndOfDayFired);\n        }\n\n        [Test]\n        public void TriggersScheduledEventsSameTimeInOrder()\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            realTimeHandler.Setup(new AlgorithmStub(new NullDataFeed()),\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                null);\n            var eventTime = DateTime.UtcNow;\n\n            var count = 0;\n            for (var i = 0; i < 100; i++)\n            {\n                var id = i;\n                using var scheduleEvent = new ScheduledEvent($\"{id}\", eventTime,\n                    (s, time) =>\n                    {\n                        Assert.AreEqual(id, count);\n                        Assert.AreEqual(s, $\"{id}\");\n                        count++;\n                    });\n                realTimeHandler.Add(scheduleEvent);\n            }\n\n            realTimeHandler.SetTime(DateTime.UtcNow);\n            realTimeHandler.Exit();\n            Assert.AreEqual(100, count);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void SetTime(bool oneStep)\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            realTimeHandler.Setup(new AlgorithmStub(new NullDataFeed()),\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                null);\n            var date = new DateTime(2020, 1, 1);\n\n            var count = 0;\n            var asserts = 0;\n            using var scheduledEvent = new ScheduledEvent(\"1\",\n                new List<DateTime> { date, date.AddMinutes(10) },\n                (s, time) =>\n                {\n                    count++;\n                    if (count == 1)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date, time);\n                    }\n                    else if (oneStep ? count == 2 : count == 4)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(10), time);\n                    }\n                });\n            realTimeHandler.Add(scheduledEvent);\n\n            using var scheduledEvent2 = new ScheduledEvent(\"2\",\n                new List<DateTime> { date.AddMinutes(1), date.AddMinutes(2) },\n                (s, time) =>\n                {\n                    count++;\n                    if (oneStep ? count == 3 : count == 2)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(1), time);\n                    }\n                    else if (oneStep ? count == 4 : count == 3)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(2), time);\n                    }\n                });\n            realTimeHandler.Add(scheduledEvent2);\n\n            if (oneStep)\n            {\n                realTimeHandler.SetTime(date.AddDays(1));\n            }\n            else\n            {\n                realTimeHandler.SetTime(date);\n                realTimeHandler.SetTime(date.AddMinutes(1));\n                realTimeHandler.SetTime(date.AddMinutes(2));\n                realTimeHandler.SetTime(date.AddMinutes(10));\n            }\n            realTimeHandler.Exit();\n            Assert.AreEqual(4, count);\n            Assert.AreEqual(4, asserts);\n        }\n\n        [Test]\n        public void SortRespectsOriginalOrderSameTime()\n        {\n            var date = new DateTime(2020, 1, 1);\n            var events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(1)}, (s, time) => { }),\n                new ScheduledEvent(\"3\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { })\n            };\n            BacktestingRealTimeHandler.SortFirstElement(events);\n            Assert.AreEqual(date.AddMinutes(1), events[0].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(10), events[1].NextEventUtcTime);\n            // scheduled event 3 and 1 have the same time, 3 should still be next else it would mean 1 executed twice when 3 once\n            Assert.AreEqual(\"3\", events[1].Name);\n            Assert.AreEqual(date.AddMinutes(10), events[2].NextEventUtcTime);\n            Assert.AreEqual(\"1\", events[2].Name);\n\n            events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(1)}, (s, time) => { }),\n                new ScheduledEvent(\"3\", new List<DateTime> {date.AddMinutes(3)}, (s, time) => { }),\n                new ScheduledEvent(\"4\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"5\", new List<DateTime> {date.AddMinutes(50)}, (s, time) => { })\n            };\n            BacktestingRealTimeHandler.SortFirstElement(events);\n            Assert.AreEqual(date.AddMinutes(1), events[0].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(3), events[1].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(10), events[2].NextEventUtcTime);\n            // scheduled event 4 and 1 have the same time, 4 should still be next else it would mean 1 executed twice when 4 once\n            Assert.AreEqual(\"4\", events[2].Name);\n            Assert.AreEqual(date.AddMinutes(10), events[3].NextEventUtcTime);\n            Assert.AreEqual(\"1\", events[3].Name);\n            Assert.AreEqual(date.AddMinutes(50), events[4].NextEventUtcTime);\n        }\n\n        [Test]\n        public void Sort()\n        {\n            var date = new DateTime(2020, 1, 1);\n            var events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(1)}, (s, time) => { })\n            };\n            BacktestingRealTimeHandler.SortFirstElement(events);\n            Assert.AreEqual(date.AddMinutes(1), events[0].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(10), events[1].NextEventUtcTime);\n\n            events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(1)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(3)}, (s, time) => { })\n            };\n            BacktestingRealTimeHandler.SortFirstElement(events);\n            Assert.AreEqual(date.AddMinutes(1), events[0].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(3), events[1].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(10), events[2].NextEventUtcTime);\n\n            events = new List<ScheduledEvent>\n            {\n                new ScheduledEvent(\"1\", new List<DateTime> {date.AddMinutes(10)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(1)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(3)}, (s, time) => { }),\n                new ScheduledEvent(\"2\", new List<DateTime> {date.AddMinutes(50)}, (s, time) => { })\n            };\n            BacktestingRealTimeHandler.SortFirstElement(events);\n            Assert.AreEqual(date.AddMinutes(1), events[0].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(3), events[1].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(10), events[2].NextEventUtcTime);\n            Assert.AreEqual(date.AddMinutes(50), events[3].NextEventUtcTime);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void ScanPastEvents(bool oneStep)\n        {\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            realTimeHandler.Setup(new AlgorithmStub(),\n                new AlgorithmNodePacket(PacketType.AlgorithmNode) { Language = Language.CSharp },\n                _resultHandler,\n                null,\n                new TestTimeLimitManager());\n\n            var date = new DateTime(2020, 1, 1);\n\n            var count = 0;\n            var asserts = 0;\n            using var scheduledEvent = new ScheduledEvent(\"1\",\n                new List<DateTime> { date, date.AddMinutes(10) },\n                (s, time) =>\n                {\n                    count++;\n                    if (count == 1)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date, time);\n                    }\n                    else if (count == 4)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(10), time);\n                    }\n                });\n            realTimeHandler.Add(scheduledEvent);\n\n            using var scheduledEvent2 = new ScheduledEvent(\"2\",\n                new List<DateTime> { date.AddMinutes(1), date.AddMinutes(2) },\n                (s, time) =>\n                {\n                    count++;\n                    if (count == 2)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(1), time);\n                    }\n                    else if (count == 3)\n                    {\n                        asserts++;\n                        Assert.AreEqual(date.AddMinutes(2), time);\n                    }\n                });\n            realTimeHandler.Add(scheduledEvent2);\n\n            if (oneStep)\n            {\n                realTimeHandler.ScanPastEvents(date.AddDays(1));\n            }\n            else\n            {\n                realTimeHandler.ScanPastEvents(date.AddMilliseconds(1));\n                realTimeHandler.ScanPastEvents(date.AddMinutes(1).AddMilliseconds(1));\n                realTimeHandler.ScanPastEvents(date.AddMinutes(2).AddMilliseconds(1));\n                realTimeHandler.ScanPastEvents(date.AddMinutes(10).AddMilliseconds(1));\n            }\n            realTimeHandler.Exit();\n            Assert.AreEqual(4, count);\n            Assert.AreEqual(4, asserts);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void DoesNotAddOnEndOfDayEventsIfNotImplemented(Language language)\n        {\n            Security security;\n            IAlgorithm algorithm;\n            if (language == Language.CSharp)\n            {\n                algorithm = new AlgorithmStub();\n                security = (algorithm as QCAlgorithm).AddEquity(\"SPY\");\n            }\n            else\n            {\n                algorithm = new AlgorithmPythonWrapper(\"Test_CustomDataAlgorithm\");\n                algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n                security = algorithm.AddSecurity(SecurityType.Equity,\n                    \"SPY\",\n                    Resolution.Daily,\n                    Market.USA,\n                    false,\n                    1,\n                    false);\n            }\n\n            var realTimeHandler = new TestBacktestingRealTimeHandler();\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode) { Language = language },\n                _resultHandler,\n                null,\n                new TestTimeLimitManager());\n\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(\n                SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>()));\n\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.Exit();\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void AddsOnEndOfDayEventsIfImplemented(Language language)\n        {\n            Security security;\n            IAlgorithm algorithm;\n            if (language == Language.CSharp)\n            {\n                algorithm = new TestAlgorithmB();\n                security = (algorithm as QCAlgorithm).AddEquity(\"SPY\");\n            }\n            else\n            {\n                algorithm = new AlgorithmPythonWrapper(\"OnEndOfDayRegressionAlgorithm\");\n                algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(new MockDataFeed(), algorithm));\n                security = algorithm.AddSecurity(SecurityType.Equity,\n                    \"SPY\",\n                    Resolution.Daily,\n                    Market.USA,\n                    false,\n                    1,\n                    false);\n            }\n\n            var realTimeHandler = new TestBacktestingRealTimeHandler();\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode) { Language = language },\n                _resultHandler,\n                null,\n                new TestTimeLimitManager());\n            \n            // Because neither implement EOD() deprecated it should be zero\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(\n                SecurityChangesTests.CreateNonInternal(new[] { security }, Enumerable.Empty<Security>()));\n\n            Assert.AreEqual(1, realTimeHandler.GetScheduledEventsCount);\n            realTimeHandler.Exit();\n        }\n\n        [Test]\n        public void IgnoresInternalSecurityChanges()\n        {\n            var algorithm = new TestAlgorithmB();\n            var security = (algorithm as QCAlgorithm).AddEquity(\"SPY\");\n\n            var realTimeHandler = new TestBacktestingRealTimeHandler();\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode) { Language = Language.CSharp },\n                _resultHandler,\n                null,\n                new TestTimeLimitManager());\n\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(SecurityChanges.Create([], [], [security], []));\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(SecurityChanges.Create([security], [], [], []));\n            Assert.AreEqual(1, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(SecurityChanges.Create([], [], [], [security]));\n            Assert.AreEqual(1, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.OnSecuritiesChanged(SecurityChanges.Create([], [security], [], []));\n            Assert.AreEqual(0, realTimeHandler.GetScheduledEventsCount);\n\n            realTimeHandler.Exit();\n        }\n\n        private class TestTimeLimitManager : IIsolatorLimitResultProvider\n        {\n            public IsolatorLimitResult IsWithinLimit()\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestAdditionalTime(int minutes)\n            {\n                throw new NotImplementedException();\n            }\n\n            public bool TryRequestAdditionalTime(int minutes)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private class TestBacktestingRealTimeHandler : BacktestingRealTimeHandler\n        {\n            public int GetScheduledEventsCount => ScheduledEvents.Count;\n        }\n\n        private class TestAlgorithm : AlgorithmStub\n        {\n            public bool OnEndOfDayFired { get; set; }\n            public override void OnEndOfDay()\n            {\n                OnEndOfDayFired = true;\n            }\n\n            public override void OnEndOfDay(Symbol symbol)\n            {\n\n            }\n        }\n\n        /// <summary>\n        /// TestAlgorithmB is just for use where we need EOD() not to\n        /// be implemented, because it is deprecated.\n        /// For tests that require EOD() use TestAlgorithm\n        /// </summary>\n        private class TestAlgorithmB : AlgorithmStub\n        {\n            public override void OnEndOfDay(Symbol symbol)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/RealTime/LiveTradingRealTimeHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Packets;\nusing QuantConnect.Scheduling;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing Moq;\nusing QuantConnect.Brokerages.Backtesting;\nusing static QuantConnect.Tests.Engine.BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests;\nusing QuantConnect.Orders;\nusing System.Reflection;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Securities.IndexOption;\nusing QuantConnect.Configuration;\nusing NodaTime;\n\nnamespace QuantConnect.Tests.Engine.RealTime\n{\n    [TestFixture]\n    [NonParallelizable]\n    public class LiveTradingRealTimeHandlerTests\n    {\n        [SetUp]\n        public void SetUp()\n        {\n            MarketHoursDatabase.Reset();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            MarketHoursDatabase.Reset();\n        }\n\n        [Test]\n        public void ThreadSafety()\n        {\n            var realTimeHandler = new LiveTradingRealTimeHandler();\n            var algo = new AlgorithmStub();\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            algo.SetFinishedWarmingUp();\n\n            realTimeHandler.Setup(algo,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                new TestTimeLimitManager());\n\n            realTimeHandler.SetTime(DateTime.UtcNow);\n            // wait for the internal thread to start\n            WaitUntilActive(realTimeHandler);\n            using var scheduledEvent = new ScheduledEvent(\"1\", new[] { Time.EndOfTime }, (_, _) => { });\n            using var scheduledEvent2 = new ScheduledEvent(\"2\", new[] { Time.EndOfTime }, (_, _) => { });\n            Assert.DoesNotThrow(() =>\n            {\n                for (var i = 0; i < 100000; i++)\n                {\n                    realTimeHandler.Add(scheduledEvent);\n                    realTimeHandler.Add(scheduledEvent2);\n                    realTimeHandler.Add(scheduledEvent);\n                    realTimeHandler.Remove(scheduledEvent);\n                    realTimeHandler.Remove(scheduledEvent2);\n                    realTimeHandler.Remove(scheduledEvent);\n                }\n            });\n\n            realTimeHandler.Exit();\n        }\n\n        [TestCaseSource(typeof(ExchangeHoursDataClass), nameof(ExchangeHoursDataClass.TestCases))]\n        public void RefreshesMarketHoursCorrectly(SecurityExchangeHours securityExchangeHours, MarketHoursSegment expectedSegment)\n        {\n            var algorithm = new AlgorithmStub();\n            var security = algorithm.AddEquity(\"SPY\");\n\n            var realTimeHandler = new TestLiveTradingRealTimeHandler();\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                new TestTimeLimitManager());\n\n            var time = new DateTime(2023, 5, 30).Date;\n            var entry = new MarketHoursDatabase.Entry(TimeZones.NewYork, securityExchangeHours);\n            var key = new SecurityDatabaseKey(Market.USA, null, SecurityType.Equity);\n            var mhdb = new MarketHoursDatabase(new Dictionary<SecurityDatabaseKey, MarketHoursDatabase.Entry>() { { key, entry } });\n            realTimeHandler.SetMarketHoursDatabase(mhdb);\n            realTimeHandler.TestRefreshMarketHoursToday(security, time, expectedSegment);\n        }\n\n        [Test]\n        public void ResetMarketHoursCorrectly()\n        {\n            var algorithm = new TestAlgorithm { HistoryProvider = new FakeHistoryProvider() };\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetCash(100000);\n            algorithm.SetStartDate(2023, 5, 30);\n            algorithm.SetEndDate(2023, 5, 30);\n            MarketHoursDatabase.FromDataFolder().SetEntry(Market.USA, null, SecurityType.Equity, SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));\n            var security = algorithm.AddEquity(\"SPY\");\n            var symbol = security.Symbol;\n            algorithm.SetFinishedWarmingUp();\n\n            var handleOptionNotification = typeof(BrokerageTransactionHandler).GetMethod(\"HandleOptionNotification\", BindingFlags.NonPublic | BindingFlags.Instance);\n\n            var transactionHandler = new TestBrokerageTransactionHandler();\n            using var broker = new BacktestingBrokerage(algorithm);\n            transactionHandler.Initialize(algorithm, broker, new BacktestingResultHandler());\n            var realTimeHandler = new TestLiveTradingRealTimeHandlerReset();\n\n            try\n            {\n                // Creates a market order\n                security.SetMarketPrice(new TradeBar(new DateTime(2023, 5, 30), symbol, 280m, 280m, 280m, 280m, 100));\n\n                var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1, 0, 0, new DateTime(2023, 5, 30), \"TestTag1\");\n\n                var orderProcessorMock = new Mock<IOrderProcessor>();\n                orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(algorithm.Transactions, orderRequest));\n                algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object);\n                var orderTicket = transactionHandler.Process(orderRequest);\n                transactionHandler.HandleOrderRequest(orderRequest);\n                Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n                broker.Scan();\n                Assert.IsTrue(orderTicket.Status == OrderStatus.Filled);\n\n                realTimeHandler.Setup(algorithm,\n                    new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                    new BacktestingResultHandler(),\n                    null,\n                    new TestTimeLimitManager());\n                realTimeHandler.AddRefreshHoursScheduledEvent();\n\n                orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1, 0, 0, new DateTime(2023, 5, 30), \"TestTag2\");\n                orderRequest.SetOrderId(2);\n                orderTicket = transactionHandler.Process(orderRequest);\n                transactionHandler.HandleOrderRequest(orderRequest);\n                Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted);\n                broker.Scan();\n                Assert.IsTrue(orderTicket.Status != OrderStatus.Filled);\n            }\n            finally\n            {\n                transactionHandler.Exit();\n                realTimeHandler.Exit();\n            }\n\n        }\n\n        [TestCase(null)]\n        [TestCase(\"\")]\n        [TestCase(\"1.00:00:00\")]\n        [TestCase(\"2.00:00:00\")]\n        [TestCase(\"1.12:00:00\")]\n        [TestCase(\"12:00:00\")]\n        [TestCase(\"6:00:00\")]\n        [TestCase(\"6:30:00\")]\n        public void RefreshesSymbolProperties(string refreshPeriodStr)\n        {\n            var refreshPeriod = string.IsNullOrEmpty(refreshPeriodStr) ? TimeSpan.FromDays(1) : TimeSpan.Parse(refreshPeriodStr);\n            var step = refreshPeriod / 2;\n\n            using var realTimeHandler = new SPDBTestLiveTradingRealTimeHandler();\n\n            var timeProvider = realTimeHandler.PublicTimeProvider;\n            timeProvider.SetCurrentTimeUtc(new DateTime(2023, 5, 30));\n\n            var algorithm = new AlgorithmStub();\n            algorithm.Settings.DatabasesRefreshPeriod = refreshPeriod;\n            algorithm.AddEquity(\"SPY\");\n            algorithm.AddForex(\"EURUSD\");\n\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                new TestTimeLimitManager());\n\n            algorithm.SetFinishedWarmingUp();\n            realTimeHandler.SetTime(timeProvider.GetUtcNow());\n\n            // wait for the internal thread to start\n            WaitUntilActive(realTimeHandler);\n\n            for (var i = 0; i < 5; i++)\n            {\n                timeProvider.Advance(step);\n\n                // We only advanced half the time, so we should not have refreshed yet\n                if (i % 2 == 0)\n                {\n                    Assert.IsFalse(realTimeHandler.SpdbRefreshed.Wait(100));\n                }\n                else\n                {\n                    Assert.IsTrue(realTimeHandler.SpdbRefreshed.Wait(2000));\n                    realTimeHandler.SpdbRefreshed.Reset();\n                }\n            }\n        }\n\n        [TestCase(SecurityType.Equity, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Forex, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Future, typeof(SymbolProperties))]\n        [TestCase(SecurityType.FutureOption, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Cfd, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Crypto, typeof(SymbolProperties))]\n        [TestCase(SecurityType.CryptoFuture, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Index, typeof(SymbolProperties))]\n        [TestCase(SecurityType.Option, typeof(OptionSymbolProperties))]\n        [TestCase(SecurityType.IndexOption, typeof(IndexOptionSymbolProperties))]\n        public void SecuritySymbolPropertiesTypeIsRespectedAfterRefresh(SecurityType securityType, Type expectedSymbolPropertiesType)\n        {\n            using var realTimeHandler = new SPDBTestLiveTradingRealTimeHandler();\n\n            var timeProvider = realTimeHandler.PublicTimeProvider;\n            timeProvider.SetCurrentTimeUtc(new DateTime(2023, 5, 30));\n\n            var algorithm = new AlgorithmStub();\n            var refreshPeriod = TimeSpan.FromDays(1);\n            algorithm.Settings.DatabasesRefreshPeriod = refreshPeriod;\n\n            var symbol = GetSymbol(securityType);\n            var security = algorithm.AddSecurity(symbol);\n\n            Assert.IsInstanceOf(expectedSymbolPropertiesType, security.SymbolProperties);\n\n            realTimeHandler.Setup(algorithm,\n                new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                new BacktestingResultHandler(),\n                null,\n                new TestTimeLimitManager());\n\n            algorithm.SetFinishedWarmingUp();\n            realTimeHandler.SetTime(timeProvider.GetUtcNow());\n\n            // wait for the internal thread to start\n            WaitUntilActive(realTimeHandler);\n\n            var previousSymbolProperties = security.SymbolProperties;\n\n            // Refresh the spdb\n            timeProvider.Advance(refreshPeriod);\n            Assert.IsTrue(realTimeHandler.SpdbRefreshed.Wait(5000));\n\n            // Access the symbol properties again\n            // The instance must have not been changed\n            Assert.AreSame(security.SymbolProperties, previousSymbolProperties);\n            Assert.IsInstanceOf(expectedSymbolPropertiesType, security.SymbolProperties);\n        }\n\n        private static Symbol GetSymbol(SecurityType securityType)\n        {\n            return securityType switch\n            {\n                SecurityType.Equity => Symbols.SPY,\n                SecurityType.Forex => Symbols.USDJPY,\n                SecurityType.Future => Symbols.Future_ESZ18_Dec2018,\n                SecurityType.FutureOption => Symbol.CreateOption(\n                    Symbols.Future_ESZ18_Dec2018,\n                    Market.CME,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    4000m,\n                    new DateTime(2023, 6, 16)),\n                SecurityType.Cfd => Symbols.DE10YBEUR,\n                SecurityType.Crypto => Symbols.BTCUSD,\n                SecurityType.CryptoFuture => Symbol.Create(\"BTCUSD\", securityType, Market.Binance),\n                SecurityType.Index => Symbols.SPX,\n                SecurityType.Option => Symbols.SPY_C_192_Feb19_2016,\n                SecurityType.IndexOption => Symbol.Create(\"SPX\", securityType, Market.USA),\n                _ => throw new ArgumentOutOfRangeException(nameof(securityType), securityType, null)\n            };\n        }\n\n        private static void WaitUntilActive(LiveTradingRealTimeHandler realTimeHandler)\n        {\n            while (!realTimeHandler.IsActive)\n            {\n                Thread.Sleep(2);\n            }\n        }\n\n        private class TestTimeLimitManager : IIsolatorLimitResultProvider\n        {\n            public IsolatorLimitResult IsWithinLimit()\n            {\n                throw new NotImplementedException();\n            }\n            public void RequestAdditionalTime(int minutes)\n            {\n                throw new NotImplementedException();\n            }\n            public bool TryRequestAdditionalTime(int minutes)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public class TestLiveTradingRealTimeHandler : LiveTradingRealTimeHandler\n        {\n            private MarketHoursDatabase newMarketHoursDatabase;\n            public void SetMarketHoursDatabase(MarketHoursDatabase marketHoursDatabase)\n            {\n                newMarketHoursDatabase = marketHoursDatabase;\n            }\n            protected override void ResetMarketHoursDatabase()\n            {\n                if (newMarketHoursDatabase != null)\n                {\n                    MarketHoursDatabase.Merge(newMarketHoursDatabase, resetCustomEntries: false);\n                }\n                else\n                {\n                    base.ResetMarketHoursDatabase();\n                }\n            }\n\n            public void TestRefreshMarketHoursToday(Security security, DateTime time, MarketHoursSegment expectedSegment)\n            {\n                ResetMarketHoursDatabase();\n                AssertMarketHours(security, time, expectedSegment);\n            }\n\n            public void AssertMarketHours(Security security, DateTime time, MarketHoursSegment expectedSegment)\n            {\n                var marketHours = security.Exchange.Hours.GetMarketHours(time);\n                var segment = marketHours.Segments.SingleOrDefault();\n\n                if (expectedSegment == null)\n                {\n                    Assert.AreEqual(expectedSegment, segment);\n                }\n                else\n                {\n                    Assert.AreEqual(expectedSegment.Start, segment.Start);\n                    Assert.AreEqual(expectedSegment.End, segment.End);\n                    for (var hour = segment.Start; hour < segment.End; hour = hour.Add(TimeSpan.FromHours(1)))\n                    {\n                        Assert.IsTrue(marketHours.IsOpen(hour, false));\n                    }\n                    Assert.AreEqual(expectedSegment.End, security.Exchange.Hours.GetNextMarketClose(time.Date, false).TimeOfDay);\n                    Assert.AreEqual(expectedSegment.Start, security.Exchange.Hours.GetNextMarketOpen(time.Date, false).TimeOfDay);\n                }\n\n                Exit();\n            }\n        }\n\n        private class TestLiveTradingRealTimeHandlerReset : LiveTradingRealTimeHandler\n        {\n            private static AutoResetEvent OnSecurityUpdated = new AutoResetEvent(false);\n\n            public void AddRefreshHoursScheduledEvent()\n            {\n                using var scheduledEvent = new ScheduledEvent(\"RefreshHours\", new[] { new DateTime(2023, 6, 29) }, (name, triggerTime) =>\n                {\n                    // refresh market hours from api every day\n                    ResetMarketHoursDatabase();\n                });\n                Add(scheduledEvent);\n                OnSecurityUpdated.Reset();\n                SetTime(DateTime.UtcNow);\n                WaitUntilActive(this);\n                OnSecurityUpdated.WaitOne();\n                Exit();\n            }\n\n            protected override void ResetMarketHoursDatabase()\n            {\n                var entry = new MarketHoursDatabase.Entry(TimeZones.NewYork, ExchangeHoursDataClass.CreateExchangeHoursWithHolidays());\n                var key = new SecurityDatabaseKey(Market.USA, null, SecurityType.Equity);\n                var mhdb = new MarketHoursDatabase(new Dictionary<SecurityDatabaseKey, MarketHoursDatabase.Entry>() { { key, entry } });\n                MarketHoursDatabase.Merge(mhdb, resetCustomEntries: true);\n                OnSecurityUpdated.Set();\n            }\n        }\n\n        private class SPDBTestLiveTradingRealTimeHandler : LiveTradingRealTimeHandler, IDisposable\n        {\n            private bool _disposed;\n\n            public ManualTimeProvider PublicTimeProvider = new ManualTimeProvider();\n\n            protected override ITimeProvider TimeProvider { get { return PublicTimeProvider; } }\n\n            public ManualResetEventSlim SpdbRefreshed = new ManualResetEventSlim(false);\n\n            protected override void ResetSymbolPropertiesDatabase()\n            {\n                base.ResetSymbolPropertiesDatabase();\n                SpdbRefreshed.Set();\n            }\n\n            protected override void WaitTillNextSecond(DateTime time)\n            {\n                Thread.Sleep(2);\n            }\n\n            public void Dispose()\n            {\n                if (_disposed) return;\n                Exit();\n                SpdbRefreshed.Dispose();\n                _disposed = true;\n            }\n        }\n\n        public class ExchangeHoursDataClass\n        {\n            private static LocalMarketHours _sunday = new LocalMarketHours(DayOfWeek.Sunday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _monday = new LocalMarketHours(DayOfWeek.Monday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _tuesday = new LocalMarketHours(DayOfWeek.Tuesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _wednesday = new LocalMarketHours(DayOfWeek.Wednesday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _thursday = new LocalMarketHours(DayOfWeek.Thursday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _friday = new LocalMarketHours(DayOfWeek.Friday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n            private static LocalMarketHours _saturday = new LocalMarketHours(DayOfWeek.Saturday, new TimeSpan(9, 30, 0), new TimeSpan(16, 0, 0));\n\n            public static IEnumerable<TestCaseData> TestCases\n            {\n                get\n                {\n                    yield return new TestCaseData(CreateExchangeHoursWithEarlyCloseAndLateOpen(), new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(10, 0, 0), new TimeSpan(13, 0, 0)));\n                    yield return new TestCaseData(CreateExchangeHoursWithEarlyClose(), new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(9, 30, 0), new TimeSpan(13, 0, 0)));\n                    yield return new TestCaseData(CreateExchangeHoursWithLateOpen(), new MarketHoursSegment(MarketHoursState.Market, new TimeSpan(10, 0, 0), new TimeSpan(16, 0, 0)));\n                    yield return new TestCaseData(CreateExchangeHoursWithHolidays(), null);\n                }\n            }\n\n            private static SecurityExchangeHours CreateExchangeHoursWithEarlyCloseAndLateOpen()\n            {\n                var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2023, 5, 30).Date, new TimeSpan(13, 0, 0) } };\n                var lateOpens = new Dictionary<DateTime, TimeSpan>() { { new DateTime(2023, 5, 30).Date, new TimeSpan(10, 0, 0) } };\n                var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, new List<DateTime>(), new[]\n                {\n                _sunday, _monday, _tuesday, _wednesday, _thursday, _friday, _saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n                return exchangeHours;\n            }\n\n            private static SecurityExchangeHours CreateExchangeHoursWithEarlyClose()\n            {\n                var earlyCloses = new Dictionary<DateTime, TimeSpan> { { new DateTime(2023, 5, 30).Date, new TimeSpan(13, 0, 0) } };\n                var lateOpens = new Dictionary<DateTime, TimeSpan>();\n                var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, new List<DateTime>(), new[]\n                {\n                _sunday, _monday, _tuesday, _wednesday, _thursday, _friday, _saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n                return exchangeHours;\n            }\n\n            private static SecurityExchangeHours CreateExchangeHoursWithLateOpen()\n            {\n                var earlyCloses = new Dictionary<DateTime, TimeSpan>();\n                var lateOpens = new Dictionary<DateTime, TimeSpan>() { { new DateTime(2023, 5, 30).Date, new TimeSpan(10, 0, 0) } };\n                var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, new List<DateTime>(), new[]\n                {\n                _sunday, _monday, _tuesday, _wednesday, _thursday, _friday, _saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n                return exchangeHours;\n            }\n\n            public static SecurityExchangeHours CreateExchangeHoursWithHolidays()\n            {\n                var earlyCloses = new Dictionary<DateTime, TimeSpan>();\n                var lateOpens = new Dictionary<DateTime, TimeSpan>();\n                var holidays = new List<DateTime>() { new DateTime(2023, 5, 30).Date };\n                var exchangeHours = new SecurityExchangeHours(TimeZones.NewYork, holidays, new[]\n                {\n                _sunday, _monday, _tuesday, _wednesday, _thursday, _friday, _saturday\n            }.ToDictionary(x => x.DayOfWeek), earlyCloses, lateOpens);\n                return exchangeHours;\n            }\n\n        }\n\n        [TestFixture]\n        [NonParallelizable]\n        public class DateTimeRulesPickUpMarketHoursUpdates\n        {\n            private string _originalCacheDataFolder;\n\n            [SetUp]\n            public void SetUp()\n            {\n                _originalCacheDataFolder = Config.Get(\"cache-location\");\n                Config.Set(\"cache-location\", \"TestData/dynamic-market-hours/original\");\n                Globals.Reset();\n                MarketHoursDatabase.Reset();\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                Config.Set(\"cache-location\", _originalCacheDataFolder);\n                Globals.Reset();\n                MarketHoursDatabase.Reset();\n            }\n\n            private static IEnumerable<TestCaseData> TestCases()\n            {\n                // For this test case, market close will be updated from 4pm to 1pm.\n                // So we will schedule an event to be fired on market close\n                var expectedEventsFireTimesBeforeUpdate = new List<DateTime>\n                {\n                    new(2024, 12, 02, 16, 0, 0),\n                    new(2024, 12, 03, 16, 0, 0),\n                    new(2024, 12, 04, 16, 0, 0),\n                    new(2024, 12, 05, 16, 0, 0),\n                    new(2024, 12, 06, 16, 0, 0),\n                    new(2024, 12, 09, 16, 0, 0),\n                    new(2024, 12, 10, 16, 0, 0)\n                };\n                var expectedEventsFireTimesAfterUpdate = new List<DateTime>\n                {\n                    // Move next will already happen, so this first event will still be fired on the old market close time\n                    new(2024, 12, 11, 16, 0, 0),\n                    new(2024, 12, 12, 13, 0, 0),\n                    new(2024, 12, 13, 13, 0, 0),\n                    new(2024, 12, 16, 13, 0, 0),\n                    new(2024, 12, 17, 13, 0, 0),\n                    new(2024, 12, 18, 13, 0, 0)\n                };\n                var updatedMhdbFile = \"TestData/dynamic-market-hours/modified-close\";\n\n                foreach (var withAddedSecurity in new[] { true, false })\n                {\n                    yield return new TestCaseData(updatedMhdbFile,\n                        expectedEventsFireTimesBeforeUpdate,\n                        expectedEventsFireTimesAfterUpdate,\n                        false,\n                        withAddedSecurity);\n                }\n\n                // For this test case a holiday will be added, so we will schedule an event to be fired every day at noon.\n                expectedEventsFireTimesBeforeUpdate = new List<DateTime>\n                {\n                    new(2024, 12, 02, 12, 0, 0),\n                    new(2024, 12, 03, 12, 0, 0),\n                    new(2024, 12, 04, 12, 0, 0),\n                    new(2024, 12, 05, 12, 0, 0),\n                    new(2024, 12, 06, 12, 0, 0),\n                    new(2024, 12, 09, 12, 0, 0),\n                    new(2024, 12, 10, 12, 0, 0)\n                };\n                expectedEventsFireTimesAfterUpdate = new List<DateTime>\n                {\n                    new(2024, 12, 11, 12, 0, 0),\n                    new(2024, 12, 12, 12, 0, 0),\n                    // 13th is a holiday, and 14th and 15th are weekend days\n                    new(2024, 12, 16, 12, 0, 0),\n                    new(2024, 12, 17, 12, 0, 0),\n                    new(2024, 12, 18, 12, 0, 0)\n                };\n                updatedMhdbFile = \"TestData/dynamic-market-hours/modified-holidays\";\n\n                foreach (var withAddedSecurity in new[] { true, false })\n                {\n                    yield return new TestCaseData(updatedMhdbFile,\n                        expectedEventsFireTimesBeforeUpdate,\n                        expectedEventsFireTimesAfterUpdate,\n                        true,\n                        withAddedSecurity);\n                }\n            }\n\n            [TestCaseSource(nameof(TestCases))]\n            public void EventsAreFiredOnUpdatedRules(string updatedMhdbFile,\n                List<DateTime> expectedEventsFireTimesBeforeUpdate,\n                List<DateTime> expectedEventsFireTimesAfterUpdate,\n                bool updatedHolidays,\n                bool addedSecurity)\n            {\n                var algorithm = new AlgorithmStub();\n                algorithm.SetStartDate(2024, 12, 02);\n\n                // \"Disable\" mhdb automatic refresh to avoid interference with the test\n                algorithm.Settings.DatabasesRefreshPeriod = TimeSpan.FromDays(30);\n                algorithm.SetFinishedWarmingUp();\n\n                var symbol = addedSecurity ? algorithm.AddEquity(\"SPY\").Symbol : Symbols.SPY;\n\n                var realTimeHandler = new TestRealTimeHandler();\n                realTimeHandler.PublicTimeProvider.SetCurrentTimeUtc(algorithm.StartDate.ConvertToUtc(algorithm.TimeZone));\n                realTimeHandler.Setup(algorithm,\n                    new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                    new BacktestingResultHandler(),\n                    null,\n                    new TestTimeLimitManager());\n\n                algorithm.Schedule.SetEventSchedule(realTimeHandler);\n\n                // Start the real time handler thread\n                realTimeHandler.SetTime(realTimeHandler.PublicTimeProvider.GetUtcNow());\n\n                WaitUntilActive(realTimeHandler);\n\n                try\n                {\n                    var mhdb = MarketHoursDatabase.FromDataFolder();\n                    var marketHoursEntry = mhdb.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n                    var exchangeTimeZone = marketHoursEntry.ExchangeHours.TimeZone;\n\n                    // Schedule an event every day at market close\n                    var firedEventTimes = new List<DateTime>();\n                    using var fireEvent = new ManualResetEventSlim();\n\n                    if (updatedHolidays)\n                    {\n                        algorithm.Schedule.On(algorithm.DateRules.EveryDay(symbol), algorithm.TimeRules.Noon, () =>\n                        {\n                            firedEventTimes.Add(realTimeHandler.PublicTimeProvider.GetUtcNow().ConvertFromUtc(algorithm.TimeZone));\n                            fireEvent.Set();\n                        });\n                    }\n                    else\n                    {\n                        algorithm.Schedule.On(algorithm.DateRules.EveryDay(symbol), algorithm.TimeRules.BeforeMarketClose(symbol, 0), () =>\n                        {\n                            firedEventTimes.Add(realTimeHandler.PublicTimeProvider.GetUtcNow().ConvertFromUtc(exchangeTimeZone));\n                            fireEvent.Set();\n                        });\n                    }\n\n                    // Events should be fired every week day at 16:00 (market close)\n\n                    AssertScheduledEvents(realTimeHandler, exchangeTimeZone, fireEvent, firedEventTimes, expectedEventsFireTimesBeforeUpdate);\n\n                    Config.Set(\"cache-location\", updatedMhdbFile);\n                    Globals.Reset();\n                    realTimeHandler.ResetMarketHoursPublic();\n\n                    firedEventTimes.Clear();\n\n                    AssertScheduledEvents(realTimeHandler, exchangeTimeZone, fireEvent, firedEventTimes, expectedEventsFireTimesAfterUpdate);\n\n                    // Just a final check: directly check for the market hours update in the data base\n                    marketHoursEntry = mhdb.GetEntry(symbol.ID.Market, symbol, symbol.SecurityType);\n                    if (updatedHolidays)\n                    {\n                        CollectionAssert.Contains(marketHoursEntry.ExchangeHours.Holidays, new DateTime(2024, 12, 13));\n                    }\n                    else\n                    {\n                        foreach (var hours in marketHoursEntry.ExchangeHours.MarketHours.Values.Where(x => x.DayOfWeek != DayOfWeek.Saturday && x.DayOfWeek != DayOfWeek.Sunday))\n                        {\n                            Assert.AreEqual(1, hours.Segments.Count);\n                            Assert.AreEqual(new TimeSpan(13, 0, 0), hours.Segments[0].End);\n                        }\n                    }\n                }\n                finally\n                {\n                    realTimeHandler.Exit();\n                }\n            }\n\n            private static void AssertScheduledEvents(TestRealTimeHandler realTimeHandler, DateTimeZone timeZone,\n                ManualResetEventSlim fireEvent, List<DateTime> firedEventTimes, List<DateTime> expectedEventsFireTimes)\n            {\n                while (firedEventTimes.Count < expectedEventsFireTimes.Count)\n                {\n                    var currentEventsCount = firedEventTimes.Count;\n                    var utcNow = realTimeHandler.PublicTimeProvider.GetUtcNow();\n                    var nextTimeUtc = utcNow.AddMinutes(60);\n\n                    realTimeHandler.PublicTimeProvider.SetCurrentTimeUtc(nextTimeUtc);\n\n                    if (currentEventsCount < expectedEventsFireTimes.Count &&\n                        nextTimeUtc.ConvertFromUtc(timeZone) >= expectedEventsFireTimes[currentEventsCount])\n                    {\n                        Assert.IsTrue(fireEvent.Wait(1000));\n                        fireEvent.Reset();\n\n                        Assert.AreEqual(currentEventsCount + 1, firedEventTimes.Count);\n                        Assert.AreEqual(expectedEventsFireTimes[currentEventsCount], firedEventTimes.Last());\n                    }\n                }\n            }\n\n            private class TestRealTimeHandler : LiveTradingRealTimeHandler\n            {\n                public ManualTimeProvider PublicTimeProvider { get; set; } = new ManualTimeProvider();\n\n                protected override ITimeProvider TimeProvider => PublicTimeProvider;\n\n                public void ResetMarketHoursPublic()\n                {\n                    ResetMarketHoursDatabase();\n                }\n            }\n        }\n\n        [TestFixture]\n        [NonParallelizable]\n        public class SymbolPropertiesAreUpdated\n        {\n            private string _originalCacheDataFolder;\n\n            [SetUp]\n            public void SetUp()\n            {\n                _originalCacheDataFolder = Config.Get(\"cache-location\");\n                Config.Set(\"cache-location\", \"TestData/dynamic-symbol-properties/original\");\n                Globals.Reset();\n                SymbolPropertiesDatabase.Reset();\n            }\n\n            [TearDown]\n            public void TearDown()\n            {\n                Config.Set(\"cache-location\", _originalCacheDataFolder);\n                Globals.Reset();\n                SymbolPropertiesDatabase.Reset();\n            }\n\n            [Test]\n            public void SecurityGetsSymbolPropertiesUpdates()\n            {\n                var algorithm = new AlgorithmStub();\n                algorithm.SetStartDate(2024, 12, 02);\n\n                // \"Disable\" automatic refresh to avoid interference with the test\n                algorithm.Settings.DatabasesRefreshPeriod = TimeSpan.FromDays(30);\n                algorithm.SetFinishedWarmingUp();\n\n                var security = algorithm.AddEquity(\"SPY\");\n                var symbol = security.Symbol;\n\n                var realTimeHandler = new TestRealTimeHandler();\n                realTimeHandler.PublicTimeProvider.SetCurrentTimeUtc(algorithm.StartDate.ConvertToUtc(algorithm.TimeZone));\n                realTimeHandler.Setup(algorithm,\n                    new AlgorithmNodePacket(PacketType.AlgorithmNode),\n                    new BacktestingResultHandler(),\n                    null,\n                    new TestTimeLimitManager());\n\n                algorithm.Schedule.SetEventSchedule(realTimeHandler);\n\n                // Start the real time handler thread\n                realTimeHandler.SetTime(realTimeHandler.PublicTimeProvider.GetUtcNow());\n                WaitUntilActive(realTimeHandler);\n\n                try\n                {\n                    var spdb = SymbolPropertiesDatabase.FromDataFolder();\n                    var entry = spdb.GetSymbolProperties(Market.USA, symbol, symbol.SecurityType, \"USD\");\n                    var securityEntry = security.SymbolProperties;\n\n                    Assert.AreEqual(entry.Description, securityEntry.Description);\n                    Assert.AreEqual(entry.QuoteCurrency, securityEntry.QuoteCurrency);\n                    Assert.AreEqual(entry.ContractMultiplier, securityEntry.ContractMultiplier);\n                    Assert.AreEqual(entry.MinimumPriceVariation, securityEntry.MinimumPriceVariation);\n                    Assert.AreEqual(entry.LotSize, securityEntry.LotSize);\n                    Assert.AreEqual(entry.MarketTicker, securityEntry.MarketTicker);\n                    Assert.AreEqual(entry.MinimumOrderSize, securityEntry.MinimumOrderSize);\n                    Assert.AreEqual(entry.PriceMagnifier, securityEntry.PriceMagnifier);\n                    Assert.AreEqual(entry.StrikeMultiplier, securityEntry.StrikeMultiplier);\n\n                    // Back up entry\n                    entry = new SymbolProperties(entry.Description, entry.QuoteCurrency, entry.ContractMultiplier, entry.MinimumPriceVariation, entry.LotSize, entry.MarketTicker, entry.MinimumOrderSize, entry.PriceMagnifier, entry.StrikeMultiplier);\n\n                    Config.Set(\"cache-location\", \"TestData/dynamic-symbol-properties/modified\");\n                    Globals.Reset();\n                    realTimeHandler.ResetSymbolPropertiesDatabasePublic();\n\n                    var newEntry = spdb.GetSymbolProperties(Market.USA, symbol, symbol.SecurityType, \"USD\");\n\n                    Assert.AreEqual(newEntry.Description, securityEntry.Description);\n                    Assert.AreEqual(newEntry.QuoteCurrency, securityEntry.QuoteCurrency);\n                    Assert.AreEqual(newEntry.ContractMultiplier, securityEntry.ContractMultiplier);\n                    Assert.AreEqual(newEntry.MinimumPriceVariation, securityEntry.MinimumPriceVariation);\n                    Assert.AreEqual(newEntry.LotSize, securityEntry.LotSize);\n                    Assert.AreEqual(newEntry.MarketTicker, securityEntry.MarketTicker);\n                    Assert.AreEqual(newEntry.MinimumOrderSize, securityEntry.MinimumOrderSize);\n                    Assert.AreEqual(newEntry.PriceMagnifier, securityEntry.PriceMagnifier);\n                    Assert.AreEqual(newEntry.StrikeMultiplier, securityEntry.StrikeMultiplier);\n\n                    // The old entry must be outdated\n                    Assert.IsTrue(entry.Description != securityEntry.Description ||\n                        entry.QuoteCurrency != securityEntry.QuoteCurrency ||\n                        entry.ContractMultiplier != securityEntry.ContractMultiplier ||\n                        entry.MinimumPriceVariation != securityEntry.MinimumPriceVariation ||\n                        entry.LotSize != securityEntry.LotSize ||\n                        entry.MarketTicker != securityEntry.MarketTicker ||\n                        entry.MinimumOrderSize != securityEntry.MinimumOrderSize ||\n                        entry.PriceMagnifier != securityEntry.PriceMagnifier ||\n                        entry.StrikeMultiplier != securityEntry.StrikeMultiplier);\n                }\n                finally\n                {\n                    realTimeHandler.Exit();\n                }\n            }\n\n            private class TestRealTimeHandler : LiveTradingRealTimeHandler\n            {\n                public ManualTimeProvider PublicTimeProvider { get; set; } = new ManualTimeProvider();\n\n                protected override ITimeProvider TimeProvider => PublicTimeProvider;\n\n                public void ResetSymbolPropertiesDatabasePublic()\n                {\n                    ResetSymbolPropertiesDatabase();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/Setup/BacktestingSetupHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Util;\nusing QuantConnect.Packets;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Algorithm.Framework.Selection;\n\nnamespace QuantConnect.Tests.Engine.Setup\n{\n    [TestFixture]\n    public class BacktestingSetupHandlerTests\n    {\n        private IAlgorithm _algorithm;\n        private DataManager _dataManager;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _algorithm = new TestAlgorithmThrowsOnInitialize();\n            _dataManager = new DataManagerStub(_algorithm);\n            _algorithm.SubscriptionManager.SetDataManager(_dataManager);\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            _dataManager.RemoveAllSubscriptions();\n        }\n\n        [Test]\n        public void HandlesErrorOnInitializeCorrectly()\n        {\n            using var setupHandler = new BacktestingSetupHandler();\n\n            var packet = new BacktestNodePacket();\n            packet.Controls.RamAllocation = 1024 * 4;\n            var realTimeHandler = new BacktestingRealTimeHandler();\n            var resultHandler = new TestResultHandler();\n            Assert.IsFalse(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, _algorithm, null, packet,\n                resultHandler, null, realTimeHandler, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            resultHandler.Exit();\n            realTimeHandler.Exit();\n            setupHandler.DisposeSafely();\n            Assert.AreEqual(1, setupHandler.Errors.Count);\n            Assert.IsTrue(setupHandler.Errors[0].InnerException.Message.Equals(\"Some failure\", StringComparison.OrdinalIgnoreCase));\n        }\n\n        internal class TestAlgorithmThrowsOnInitialize : AlgorithmStub\n        {\n            public override void Initialize()\n            {\n                SetAccountCurrency(\"USDT\");\n\n                SetStartDate(2018, 08, 17);\n                SetEndDate(2021, 11, 15);\n\n                // this will fail later because due to default crypto market being Coinbase there is no conversion rate route\n                var symbols = new[] { \"ADAUSDT\", \"BNBUSDT\", \"BTCUSDT\", \"ETHUSDT\", \"LTCUSDT\", \"SOLUSDT\" }\n                    .Select(ticker => QuantConnect.Symbol.Create(ticker, SecurityType.Crypto, Market.Binance));\n                SetUniverseSelection(new ManualUniverseSelectionModel(symbols));\n\n                SetBenchmark(\"BTCUSDT\");\n\n                throw new Exception(\"Some failure\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/Setup/BaseSetupHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\n\nnamespace QuantConnect.Tests.Engine.Setup\n{\n    [TestFixture]\n    public class BaseSetupHandlerTests\n    {\n        [Test]\n        public void CurrencyConversionRateResolved()\n        {\n            // Unit test to prove that in the event that default resolution (minute) history request returns\n            // no data for our currency conversion that BaseSetupHandler will use a daily history request\n            // to determine the the conversion rate if possible.\n\n            // Setup history provider and algorithm\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n\n            var algorithm = new BrokerageSetupHandlerTests.TestAlgorithm { UniverseSettings = { Resolution = Resolution.Minute } };\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                algorithm.ObjectStore,\n                algorithm.Settings));\n            algorithm.SetHistoryProvider(historyProvider);\n\n            // Pick a date range where we do NOT have BTCUSD minute data\n            algorithm.SetStartDate(2015, 1, 24);\n            algorithm.SetCash(\"USD\", 0);\n            algorithm.SetCash(\"BTC\", 10);\n\n            // Have BaseSetupHandler resolve the currency conversion\n            BaseSetupHandler.SetupCurrencyConversions(algorithm, algorithm.DataManager.UniverseSelection);\n\n            // Assert that our portfolio has some value and that value is bitcoin\n            Assert.IsTrue(algorithm.Portfolio.Cash > 0);\n            Assert.IsTrue(algorithm.Portfolio.CashBook[\"BTC\"].ValueInAccountCurrency > 0);\n        }\n\n        [Test]\n        public void CurrencyConversionRateResolvedForWhiteListedCurrenciesOnly()\n        {\n            // Unit test to prove that in the event that default resolution (minute) history request returns\n            // no data for our currency conversion that BaseSetupHandler will use a daily history request\n            // to determine the the conversion rate if possible.\n\n            // Setup history provider and algorithm\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n\n            var algorithm = new BrokerageSetupHandlerTests.TestAlgorithm { UniverseSettings = { Resolution = Resolution.Minute } };\n\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(\n                null,\n                null,\n                TestGlobals.DataProvider,\n                TestGlobals.DataCacheProvider,\n                TestGlobals.MapFileProvider,\n                TestGlobals.FactorFileProvider,\n                null,\n                false,\n                new DataPermissionManager(),\n                algorithm.ObjectStore,\n                algorithm.Settings));\n            algorithm.SetHistoryProvider(historyProvider);\n\n            // Pick a date range where we do NOT have BTCUSD minute data\n            algorithm.SetStartDate(2015, 1, 24);\n            algorithm.SetCash(\"USD\", 0);\n            algorithm.SetCash(\"BTC\", 10);\n            algorithm.SetCash(\"EUR\", 1000);\n            algorithm.SetCash(\"USDT\", 1000);\n\n            // Have BaseSetupHandler resolve the currency conversion\n            BaseSetupHandler.SetupCurrencyConversions(algorithm, algorithm.DataManager.UniverseSelection, new[] { \"BTC\" });\n\n            // Bitcoin's conversion rate should be set\n            Assert.IsNotNull(algorithm.Portfolio.CashBook[\"BTC\"].CurrencyConversion);\n            Assert.AreNotEqual(0, algorithm.Portfolio.CashBook[\"BTC\"].ConversionRate);\n\n            // The remaining currencies should not have conversion rate set\n            Assert.AreEqual(0, algorithm.Portfolio.CashBook[\"EUR\"].ConversionRate);\n            Assert.AreEqual(0, algorithm.Portfolio.CashBook[\"USDT\"].ConversionRate);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/Setup/BrokerageSetupHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.RealTime;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.Setup;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option.StrategyMatcher;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\nusing Bitcoin = QuantConnect.Algorithm.CSharp.LiveTradingFeaturesAlgorithm.Bitcoin;\nusing System.Collections;\nusing QuantConnect.Configuration;\nusing NodaTime;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests.Engine.Setup\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class BrokerageSetupHandlerTests\n    {\n        private IAlgorithm _algorithm;\n        private ITransactionHandler _transactionHandler;\n        private NonDequeingTestResultsHandler _resultHandler;\n        private IBrokerage _brokerage;\n        private DataManager _dataManager;\n\n        private TestableBrokerageSetupHandler _brokerageSetupHandler;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _algorithm = new QCAlgorithm();\n            _dataManager = new DataManagerStub(_algorithm);\n            _algorithm.SubscriptionManager.SetDataManager(_dataManager);\n            _transactionHandler = new BrokerageTransactionHandler();\n            _resultHandler = new NonDequeingTestResultsHandler();\n            _brokerage = new TestBrokerage();\n\n            _brokerageSetupHandler = new TestableBrokerageSetupHandler();\n            _transactionHandler.Initialize(_algorithm, _brokerage, _resultHandler);\n        }\n\n        [OneTimeTearDown]\n        public void TearDown()\n        {\n            _dataManager.RemoveAllSubscriptions();\n            _brokerage.DisposeSafely();\n            _transactionHandler.Exit();\n            _resultHandler.Exit();\n        }\n\n        [Test]\n        public void CanGetOpenOrders()\n        {\n            _brokerageSetupHandler.PublicGetOpenOrders(_algorithm, _resultHandler, _transactionHandler, _brokerage);\n\n            Assert.AreEqual(_transactionHandler.Orders.Count, 4);\n\n            Assert.AreEqual(_transactionHandler.OrderTickets.Count, 4);\n\n            // Check Price Currency is not null\n            foreach (var order in _transactionHandler.Orders.Values)\n            {\n                Assert.IsFalse(string.IsNullOrEmpty(order.PriceCurrency));\n                Assert.AreEqual(OrderStatus.Submitted, order.Status);\n            }\n\n            // Warn the user about each open order\n            Assert.AreEqual(_resultHandler.PersistentMessages.Count, 4);\n\n            // Market order\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Market).Value.Quantity, 100);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Market).Value.SubmitRequest.LimitPrice, 1.2345m);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Market).Value.SubmitRequest.StopPrice, 1.2345m);\n\n            // Limit Order\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Limit).Value.Quantity, -100);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Limit).Value.SubmitRequest.LimitPrice, 2.2345m);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.Limit).Value.SubmitRequest.StopPrice, 0m);\n\n            // Stop market order\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopMarket).Value.Quantity, 100);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopMarket).Value.SubmitRequest.LimitPrice, 0m);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopMarket).Value.SubmitRequest.StopPrice, 2.2345m);\n\n            // Stop Limit order\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopLimit).Value.Quantity, 100);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopLimit).Value.SubmitRequest.LimitPrice, 0.2345m);\n            Assert.AreEqual(_transactionHandler.OrderTickets.First(x => x.Value.OrderType == OrderType.StopLimit).Value.SubmitRequest.StopPrice, 2.2345m);\n\n            // SPY security should be added to the algorithm\n            Assert.Contains(Symbols.SPY, _algorithm.Securities.Select(x => x.Key).ToList());\n        }\n\n        [TestCaseSource(typeof(ExistingHoldingAndOrdersDataClass), nameof(ExistingHoldingAndOrdersDataClass.GetExistingHoldingsAndOrdersTestCaseData))]\n        public void SecondExistingHoldingsAndOrdersResolution(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            ExistingHoldingsAndOrdersResolution(getHoldings, getOrders, expected, Resolution.Second);\n        }\n\n        [TestCaseSource(typeof(ExistingHoldingAndOrdersDataClass), nameof(ExistingHoldingAndOrdersDataClass.GetExistingHoldingsAndOrdersTestCaseData))]\n        public void MinuteExistingHoldingsAndOrdersResolution(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            ExistingHoldingsAndOrdersResolution(getHoldings, getOrders, expected, Resolution.Minute);\n        }\n\n        [TestCaseSource(typeof(ExistingHoldingAndOrdersDataClass), nameof(ExistingHoldingAndOrdersDataClass.GetExistingHoldingsAndOrdersTestCaseData))]\n        public void TickExistingHoldingsAndOrdersResolution(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            ExistingHoldingsAndOrdersResolution(getHoldings, getOrders, expected, Resolution.Tick);\n        }\n\n        public void ExistingHoldingsAndOrdersResolution(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected, Resolution resolution)\n        {\n            var algorithm = new TestAlgorithm { UniverseSettings = { Resolution = resolution } };\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var objectStore = new Mock<IObjectStore>();\n            var brokerage = new Mock<IBrokerage>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(getHoldings);\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(getOrders);\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            var result = setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider));\n\n            Assert.AreEqual(expected, result);\n\n            foreach (var symbol in algorithm.Securities.Keys)\n            {\n                var configs = algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol);\n                Assert.AreEqual(algorithm.UniverseSettings.Resolution, configs.First().Resolution);\n            }\n        }\n\n        [TestCaseSource(typeof(ExistingHoldingAndOrdersDataClass), nameof(ExistingHoldingAndOrdersDataClass.GetExistingHoldingsAndOrdersTestCaseData))]\n        public void ExistingHoldingsAndOrdersUniverseSettings(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            // Set our universe settings\n            var hasCrypto = false;\n            try\n            {\n                hasCrypto = getHoldings().Any(x => x.Symbol.Value == \"BTCUSD\");\n            }\n            catch\n            {\n            }\n            var algorithm = new TestAlgorithm { UniverseSettings = { Resolution = Resolution.Daily, Leverage = (hasCrypto ? 1 : 20), FillForward = false, ExtendedMarketHours = true } };\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var objectStore = new Mock<IObjectStore>();\n            var brokerage = new Mock<IBrokerage>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(getHoldings);\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(getOrders);\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            var result = setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider));\n\n            if (result != expected)\n            {\n                Assert.Fail(\"SetupHandler result did not match expected value\");\n            }\n\n            foreach (var symbol in algorithm.Securities.Keys)\n            {\n                var config = algorithm.SubscriptionManager.SubscriptionDataConfigService.GetSubscriptionDataConfigs(symbol).First();\n\n                // Assert Resolution and FillForward settings persisted\n                Assert.AreEqual(algorithm.UniverseSettings.Resolution, config.Resolution);\n                Assert.AreEqual(algorithm.UniverseSettings.FillForward, config.FillDataForward);\n\n                // Assert ExtendedHours setting persisted for equities\n                if (config.SecurityType == SecurityType.Equity)\n                {\n                    Assert.AreEqual(algorithm.UniverseSettings.ExtendedMarketHours, config.ExtendedMarketHours);\n                }\n\n                // Assert Leverage setting persisted for non options or futures (Blocked from setting leverage in Security.SetLeverage())\n                if (!symbol.SecurityType.IsOption() && symbol.SecurityType != SecurityType.Future)\n                {\n                    var security = algorithm.Securities[symbol];\n                    Assert.AreEqual(algorithm.UniverseSettings.Leverage, security.Leverage);\n                }\n            }\n        }\n\n        [TestCaseSource(typeof(ExistingHoldingAndOrdersDataClass), nameof(ExistingHoldingAndOrdersDataClass.GetExistingHoldingsAndOrdersTestCaseData))]\n        public void LoadsExistingHoldingsAndOrders(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            TestLoadExistingHoldingsAndOrders(algorithm, getHoldings, getOrders, expected);\n\n            foreach (var security in algorithm.Securities.Values)\n            {\n                if (security.Symbol.SecurityType == SecurityType.Option)\n                {\n                    Assert.AreEqual(DataNormalizationMode.Raw, security.DataNormalizationMode);\n\n                    var underlyingSecurity = algorithm.Securities[security.Symbol.Underlying];\n                    Assert.AreEqual(DataNormalizationMode.Raw, underlyingSecurity.DataNormalizationMode);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(GetExistingHoldingsAndOrdersWithCustomDataTestCase))]\n        public void LoadsExistingHoldingsAndOrdersWithCustomData(Func<List<Holding>> getHoldings, Func<List<Order>> getOrders)\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.AddData<Bitcoin>(\"BTC\");\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            TestLoadExistingHoldingsAndOrders(algorithm, getHoldings, getOrders, true);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void EnforcesTotalPortfolioValue(bool fails)\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n\n            algorithm.SetHistoryProvider(new TestHistoryProvider());\n            var job = GetJob();\n            job.BrokerageData[BrokerageSetupHandler.MaxAllocationLimitConfig] = fails ? \"1\" : \"1000000000\";\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount> { new CashAmount(10000, Currencies.USD), new CashAmount(11, Currencies.GBP) });\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.AreEqual(!fails, setupHandler.Setup(new SetupHandlerParameters(algorithm.DataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            Assert.AreEqual(10000, algorithm.Portfolio.CashBook[Currencies.USD].Amount);\n            Assert.AreEqual(11, algorithm.Portfolio.CashBook[Currencies.GBP].Amount);\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void EnforcesAccountCurrency(bool enforceAccountCurrency)\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n            if (enforceAccountCurrency)\n            {\n                job.BrokerageData[BrokerageSetupHandler.MaxAllocationLimitConfig] = \"200000\";\n            }\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.EUR);\n\n            using var setupHandler = new BrokerageSetupHandler();\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            Assert.AreEqual(enforceAccountCurrency ? Currencies.USD : Currencies.EUR, algorithm.AccountCurrency);\n        }\n\n        [Test]\n        public void HandlesErrorOnInitializeCorrectly()\n        {\n            var algorithm = new BacktestingSetupHandlerTests.TestAlgorithmThrowsOnInitialize();\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsFalse(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            setupHandler.DisposeSafely();\n            Assert.AreEqual(1, setupHandler.Errors.Count);\n            Assert.IsTrue(setupHandler.Errors[0].InnerException.Message.Equals(\"Some failure\"));\n        }\n\n        [Test]\n        public void HoldingsPositionGroupResolved()\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>\n            {\n                // covered call\n                new Holding { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = -1 },\n                new Holding { Symbol = Symbols.SPY, Quantity = 100 }\n            });\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            // let's assert be detect the covered call option strategy for existing position correctly\n            if (algorithm.Portfolio.Positions.Groups.Where(group => group.BuyingPowerModel is OptionStrategyPositionGroupBuyingPowerModel)\n                .Count(group => ((OptionStrategyPositionGroupBuyingPowerModel)@group.BuyingPowerModel).ToString() == OptionStrategyDefinitions.CoveredCall.Name\n                    && (Math.Abs(group.Quantity) == 1)) != 1)\n            {\n                factory.Dispose();\n                throw new RegressionTestException($\"Option strategy: '{OptionStrategyDefinitions.CoveredCall.Name}' was not found!\");\n            }\n        }\n\n        [Test]\n        public void LoadsHoldingsForExpectedMarket()\n        {\n            var symbol = Symbol.Create(\"AUDUSD\", SecurityType.Forex, Market.Oanda);\n\n            var algorithm = new TestAlgorithm();\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>\n            {\n                new Holding { Symbol = symbol, Quantity = 100 }\n            });\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            Security security;\n            Assert.IsTrue(algorithm.Portfolio.Securities.TryGetValue(symbol, out security));\n            Assert.AreEqual(symbol, security.Symbol);\n        }\n\n        [Test]\n        public void SeedsSecurityCorrectly()\n        {\n            var symbol = Symbol.Create(\"AUDUSD\", SecurityType.Forex, Market.Oanda);\n\n            var algorithm = new TestAlgorithm();\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>\n            {\n                new Holding { Symbol = symbol, Quantity = 100, MarketPrice = 99}\n            });\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            Security security;\n            Assert.IsTrue(algorithm.Portfolio.Securities.TryGetValue(symbol, out security));\n            Assert.AreEqual(symbol, security.Symbol);\n            Assert.AreEqual(99, security.Price);\n\n            var last = security.GetLastData();\n            Assert.IsTrue((DateTime.UtcNow.ConvertFromUtc(security.Exchange.TimeZone) - last.Time) < TimeSpan.FromSeconds(1));\n        }\n\n        [Test]\n        public void AlgorithmTimeIsSetToUtcNowBeforePostInitialize()\n        {\n            var time = DateTime.UtcNow;\n            TestAlgorithm algorithm = null;\n\n            algorithm = new TestAlgorithm(() =>\n            {\n                Assert.That(algorithm.UtcTime > time);\n            });\n\n            Assert.AreEqual(new DateTime(1998, 1, 1), algorithm.UtcTime);\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            Assert.Greater(algorithm.UtcTime, time);\n        }\n\n        [TestCase(true, true)]\n        [TestCase(true, false)]\n        [TestCase(false, true)]\n        [TestCase(false, false)]\n        public void HasErrorWithZeroTotalPortfolioValue(bool hasCashBalance, bool hasHoldings)\n        {\n            var algorithm = new TestAlgorithm();\n\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n            var job = GetJob();\n            job.Brokerage = \"TestBrokerage\";\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n            var objectStore = new Mock<IObjectStore>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(\n                hasCashBalance\n                    ? new List<CashAmount>\n                    {\n                        new CashAmount(1000, \"USD\")\n                    }\n                    : new List<CashAmount>()\n                );\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(\n                hasHoldings\n                    ? new List<Holding>\n                    {\n                        new Holding { Symbol = Symbols.SPY, Quantity = 1, AveragePrice = 100, MarketPrice = 100 }\n                    }\n                    : new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            var dataManager = new DataManagerStub(algorithm, new MockDataFeed(), true);\n\n            Assert.IsTrue(setupHandler.Setup(new SetupHandlerParameters(dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider)));\n\n            if (!hasCashBalance && !hasHoldings)\n            {\n                Assert.IsFalse(algorithm.DebugMessages.IsEmpty);\n\n                Assert.That(algorithm.DebugMessages.Any(x => x.Contains(\"No cash balances or holdings were found in the brokerage account.\")));\n            }\n        }\n\n        [Test]\n        public void ZeroQuantityCurrenciesAreNotAddedToCashBook()\n        {\n            var algorithm = new TestAlgorithm();\n            algorithm.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage);\n            algorithm.SetHistoryProvider(new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.EmptyHistoryProvider());\n\n            var job = GetJob();\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var brokerage = new Mock<IBrokerage>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n\n            // EUR with zero quantity, should NOT be added to CashBook\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>\n            {\n                new CashAmount(0, \"USD\"),\n                new CashAmount(0, \"EUR\"),\n                new CashAmount(0, \"BNFCR\"),\n                new CashAmount(123, \"ETH\")\n            });\n\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(new List<Holding>());\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(new List<Order>());\n\n            using var setupHandler = new BrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            var result = setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider));\n\n            Assert.IsTrue(result);\n            // USD should be present even though it has zero quantity because it's the account currency\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"USD\"));\n            // EUR should NOT be present (zero amount)\n            Assert.IsFalse(algorithm.Portfolio.CashBook.ContainsKey(\"EUR\"));\n            // ETH should be present\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"ETH\"));\n            // special case used in binance future fees\n            Assert.IsTrue(algorithm.Portfolio.CashBook.ContainsKey(\"BNFCR\"));\n        }\n\n        private void TestLoadExistingHoldingsAndOrders(IAlgorithm algorithm, Func<List<Holding>> getHoldings, Func<List<Order>> getOrders, bool expected)\n        {\n            var job = GetJob();\n\n            var resultHandler = new Mock<IResultHandler>();\n            var transactionHandler = new Mock<ITransactionHandler>();\n            var realTimeHandler = new Mock<IRealTimeHandler>();\n            var objectStore = new Mock<IObjectStore>();\n            var brokerage = new Mock<IBrokerage>();\n\n            brokerage.Setup(x => x.IsConnected).Returns(true);\n            brokerage.Setup(x => x.AccountBaseCurrency).Returns(Currencies.USD);\n            brokerage.Setup(x => x.GetCashBalance()).Returns(new List<CashAmount>());\n            brokerage.Setup(x => x.GetAccountHoldings()).Returns(getHoldings);\n            brokerage.Setup(x => x.GetOpenOrders()).Returns(getOrders);\n\n            using var setupHandler = new TestableBrokerageSetupHandler();\n\n            IBrokerageFactory factory;\n            setupHandler.CreateBrokerage(job, algorithm, out factory);\n            factory.Dispose();\n\n            var parameters = new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider);\n            var result = setupHandler.Setup(new SetupHandlerParameters(_dataManager.UniverseSelection, algorithm, brokerage.Object, job, resultHandler.Object,\n                transactionHandler.Object, realTimeHandler.Object, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider));\n            Assert.AreEqual(expected, result);\n        }\n\n        private static object[] GetExistingHoldingsAndOrdersWithCustomDataTestCase =\n        {\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding> { new Holding { Symbol = new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), Quantity = 1 }}),\n                new Func<List<Order>>(() => new List<Order>())},\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding> { new Holding { Symbol = Symbols.SPY, Quantity = 1 }}),\n                new Func<List<Order>>(() => new List<Order>())},\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding>()),\n                new Func<List<Order>>(() => new List<Order>() { new LimitOrder(new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), 1, 1, DateTime.UtcNow)})},\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding> { new Holding { Symbol = new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), Quantity = 1 }}),\n                new Func<List<Order>>(() => new List<Order>() { new LimitOrder(new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), 1, 1, DateTime.UtcNow)})},\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding> { new Holding { Symbol = new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), Quantity = 1 },\n                    new Holding { Symbol = Symbols.SPY, Quantity = 1 }}),\n                new Func<List<Order>>(() => new List<Order>() { new LimitOrder(new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), 1, 1, DateTime.UtcNow)})},\n            new object[] {\n                new Func<List<Holding>>(() => new List<Holding> { new Holding { Symbol = new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), Quantity = 1 },\n                    new Holding { Symbol = Symbols.SPY, Quantity = 1 }}),\n                new Func<List<Order>>(() => new List<Order>() { new LimitOrder(new Symbol(\n                    SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), 1, 1, DateTime.UtcNow),\n                    new LimitOrder(Symbols.SPY, 1, 1, DateTime.UtcNow)})}\n        };\n\n        private class ExistingHoldingAndOrdersDataClass\n        {\n            public static IEnumerable GetExistingHoldingsAndOrdersTestCaseData\n            {\n                get\n                {\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>()),\n                        new Func<List<Order>>(() => new List<Order>()), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.SPY, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.SPY, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.SPY_C_192_Feb19_2016, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.SPY, Quantity = 1 },\n                            new Holding { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.SPY, 1, 1, DateTime.UtcNow),\n                            new LimitOrder(Symbols.SPY_C_192_Feb19_2016, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = 1 },\n                            new Holding { Symbol = Symbols.SPY, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.SPY_C_192_Feb19_2016, 1, 1, DateTime.UtcNow),\n                            new LimitOrder(Symbols.SPY, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.SPY_C_192_Feb19_2016, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.SPY, 1, 1, DateTime.UtcNow),\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.EURUSD, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.EURUSD, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.BTCUSD, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.BTCUSD, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbols.Fut_SPY_Feb19_2016, Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(Symbols.Fut_SPY_Feb19_2016, 1, 1, DateTime.UtcNow)\n                        }), true);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = Symbol.Create(\"XYZ\", SecurityType.Base, Market.USA), Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            #pragma warning disable CS0618\n                            new LimitOrder(\"XYZ\", 1, 1, DateTime.UtcNow)\n                            #pragma warning restore CS0618\n                        }), false);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>\n                        {\n                            new Holding { Symbol = new Symbol(SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), Quantity = 1 }\n                        }),\n                        new Func<List<Order>>(() => new List<Order>\n                        {\n                            new LimitOrder(new Symbol(SecurityIdentifier.GenerateBase(typeof(Bitcoin), \"BTC\", Market.USA, false), \"BTC\"), 1, 1, DateTime.UtcNow)\n                        }), false);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => { throw new RegressionTestException(); }),\n                        new Func<List<Order>>(() => new List<Order>()), false);\n\n                    yield return new TestCaseData(\n                        new Func<List<Holding>>(() => new List<Holding>()),\n                        new Func<List<Order>>(() => { throw new RegressionTestException(); }), false);\n                }\n            }\n        }\n\n        internal class TestAlgorithm : QCAlgorithm\n        {\n            private readonly Action _beforePostInitializeAction;\n\n            public DataManager DataManager { get; set; }\n\n            public TestAlgorithm(Action beforePostInitializeAction = null)\n            {\n                _beforePostInitializeAction = beforePostInitializeAction;\n                DataManager = new DataManagerStub(this, new MockDataFeed(), liveMode: true);\n                SubscriptionManager.SetDataManager(DataManager);\n            }\n\n            public override void Initialize() { }\n\n            public override void PostInitialize()\n            {\n                _beforePostInitializeAction?.Invoke();\n                base.PostInitialize();\n            }\n        }\n\n        internal static LiveNodePacket GetJob()\n        {\n            var job = new LiveNodePacket\n            {\n                UserId = 1,\n                ProjectId = 1,\n                DeployId = \"1\",\n                Brokerage = \"PaperBrokerage\",\n                DataQueueHandler = \"none\"\n            };\n            // Increasing RAM limit, else the tests fail. This is happening in master, when running all the tests together, locally (not travis).\n            job.Controls.RamAllocation = 1024 * 1024 * 1024;\n            return job;\n        }\n\n        private class NonDequeingTestResultsHandler : TestResultHandler\n        {\n            private readonly AlgorithmNodePacket _job = new BacktestNodePacket();\n            public readonly ConcurrentQueue<Packet> PersistentMessages = new ConcurrentQueue<Packet>();\n\n            public override void DebugMessage(string message)\n            {\n                PersistentMessages.Enqueue(new DebugPacket(_job.ProjectId, _job.AlgorithmId, _job.CompileId, message));\n            }\n        }\n\n        private class TestableBrokerageSetupHandler : BrokerageSetupHandler\n        {\n            public void PublicGetOpenOrders(IAlgorithm algorithm, IResultHandler resultHandler, ITransactionHandler transactionHandler, IBrokerage brokerage)\n            {\n                GetOpenOrders(algorithm, resultHandler, transactionHandler, brokerage);\n            }\n\n            public bool TestLoadExistingHoldingsAndOrders(IBrokerage brokerage, IAlgorithm algorithm, SetupHandlerParameters parameters)\n            {\n                return LoadExistingHoldingsAndOrders(brokerage, algorithm, parameters);\n            }\n        }\n\n        private class TestHistoryProvider : HistoryProviderBase\n        {\n            public override int DataPointCount { get; }\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<Data.HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                var requestsList = requests.ToList();\n                if (requestsList.Count == 0)\n                {\n                    return Enumerable.Empty<Slice>();\n                }\n\n                var request = requestsList[0];\n                return new List<Slice>{ new Slice(DateTime.UtcNow,\n                    new List<BaseData> {new QuoteBar(DateTime.MinValue, request.Symbol, new Bar(1, 2, 3, 4), 5, new Bar(1, 2, 3, 4), 5) }, DateTime.UtcNow)};\n            }\n        }\n    }\n\n    internal class TestBrokerageFactory : BrokerageFactory\n    {\n        public TestBrokerageFactory() : base(typeof(TestBrokerage))\n        {\n        }\n\n        public override Dictionary<string, string> BrokerageData => new Dictionary<string, string>();\n        public override IBrokerageModel GetBrokerageModel(IOrderProvider orderProvider) => new BrokerageTransactionHandlerTests.BrokerageTransactionHandlerTests.TestBrokerageModel();\n        public override IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm) => new TestBrokerage();\n        public override void Dispose() { }\n    }\n\n    /// <summary>\n    /// Public so that mock can access it\n    /// </summary>\n    public class TestBrokerage : Brokerage\n    {\n        public override bool IsConnected { get; } = true;\n        public int GetCashBalanceCallCount { get; set; }\n\n        public TestBrokerage() : base(\"Test\")\n        {\n        }\n\n        public TestBrokerage(string name) : base(name)\n        {\n        }\n\n        public override List<Order> GetOpenOrders()\n        {\n            const decimal delta = 1m;\n            const decimal price = 1.2345m;\n            const int quantity = 100;\n            const decimal pricePlusDelta = price + delta;\n            const decimal priceMinusDelta = price - delta;\n            var tz = TimeZones.NewYork;\n\n            var time = new DateTime(2016, 2, 4, 16, 0, 0).ConvertToUtc(tz);\n            var marketOrderWithPrice = new MarketOrder(Symbols.SPY, quantity, time)\n            {\n                Price = price\n            };\n\n            return new List<Order>\n            {\n                marketOrderWithPrice,\n                new LimitOrder(Symbols.SPY, -quantity, pricePlusDelta, time),\n                new StopMarketOrder(Symbols.SPY, quantity, pricePlusDelta, time),\n                new StopLimitOrder(Symbols.SPY, quantity, pricePlusDelta, priceMinusDelta, time)\n            };\n        }\n\n        public override List<CashAmount> GetCashBalance()\n        {\n            GetCashBalanceCallCount++;\n\n            return new List<CashAmount> { new CashAmount(10, Currencies.USD) };\n        }\n\n        #region UnusedMethods\n\n        public override List<Holding> GetAccountHoldings()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override bool PlaceOrder(Order order)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override bool UpdateOrder(Order order)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override bool CancelOrder(Order order)\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void Connect()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void Disconnect()\n        {\n            throw new NotImplementedException();\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "Tests/Engine/TestResultHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.Results;\nusing QuantConnect.Lean.Engine.TransactionHandlers;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Statistics;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Engine\n{\n    /// <summary>\n    /// Provides a result handler implementation that handles result packets via\n    /// a constructor defined function. Also, this implementation does not require\n    /// the Run method to be called at all, a task is launched via ctor to process\n    /// the packets\n    /// </summary>\n    public class TestResultHandler : BaseResultsHandler, IResultHandler\n    {\n        private AlgorithmNodePacket _job = new BacktestNodePacket();\n\n        private readonly Action<Packet> _packetHandler;\n        private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();\n\n        public new ConcurrentQueue<Packet> Messages { get; set; }\n        public new ConcurrentDictionary<string, Chart> Charts { get; set; }\n        public new bool IsActive { get; private set; }\n\n        public TestResultHandler(Action<Packet> packetHandler = null)\n        {\n            Messages = new ConcurrentQueue<Packet>();\n            _packetHandler = packetHandler;\n            if (_packetHandler != null)\n            {\n                Task.Run(() =>\n                {\n                    try\n                    {\n                        IsActive = true;\n                        while (!_cancellationTokenSource.IsCancellationRequested)\n                        {\n                            Packet packet;\n                            if (Messages.TryDequeue(out packet))\n                            {\n                                _packetHandler(packet);\n                            }\n\n                            Thread.Sleep(1);\n                        }\n                    }\n                    finally\n                    {\n                        IsActive = false;\n                    }\n                });\n            }\n        }\n\n        public override void Initialize(ResultHandlerInitializeParameters parameters)\n        {\n            _job = parameters.Job;\n        }\n\n        protected override void Run()\n        {\n        }\n\n        public virtual void DebugMessage(string message)\n        {\n            Messages.Enqueue(new DebugPacket(_job.ProjectId, _job.AlgorithmId, _job.CompileId, message));\n        }\n\n        public void SystemDebugMessage(string message)\n        {\n            Messages.Enqueue(new SystemDebugPacket(_job.ProjectId, _job.AlgorithmId, _job.CompileId, message));\n        }\n\n\n        public void SecurityType(List<SecurityType> types)\n        {\n        }\n\n        public void LogMessage(string message)\n        {\n            Messages.Enqueue(new LogPacket(_job.AlgorithmId, message));\n        }\n\n        public void ErrorMessage(string error, string stacktrace = \"\")\n        {\n            Messages.Enqueue(new HandledErrorPacket(_job.AlgorithmId, error, stacktrace));\n        }\n\n        public void RuntimeError(string message, string stacktrace = \"\")\n        {\n            Messages.Enqueue(new RuntimeErrorPacket(_job.UserId, _job.AlgorithmId, message, stacktrace));\n        }\n\n        public void BrokerageMessage(BrokerageMessageEvent brokerageMessageEvent)\n        {\n        }\n\n        protected override void Sample(string chartName, string seriesName, int seriesIndex, SeriesType seriesType, ISeriesPoint value, string unit = \"$\")\n        {\n            //Add a copy locally:\n            if (!Charts.ContainsKey(chartName))\n            {\n                Charts.AddOrUpdate(chartName, new Chart(chartName));\n            }\n\n            //Add the sample to our chart:\n            if (!Charts[chartName].Series.ContainsKey(seriesName))\n            {\n                Charts[chartName].Series.Add(seriesName, new Series(seriesName, seriesType, seriesIndex, unit));\n            }\n\n            //Add our value:\n            Charts[chartName].Series[seriesName].Values.Add(value);\n        }\n\n        protected override void AddToLogStore(string message)\n        {\n        }\n\n        protected void SampleRange(List<Chart> updates)\n        {\n            foreach (var update in updates)\n            {\n                //Create the chart if it doesn't exist already:\n                if (!Charts.ContainsKey(update.Name))\n                {\n                    Charts.AddOrUpdate(update.Name, new Chart(update.Name, update.ChartType));\n                }\n\n                //Add these samples to this chart.\n                foreach (var series in update.Series.Values)\n                {\n                    //If we don't already have this record, its the first packet\n                    if (!Charts[update.Name].Series.ContainsKey(series.Name))\n                    {\n                        Charts[update.Name].Series.Add(series.Name, new Series(series.Name, series.SeriesType, series.Index, series.Unit));\n                    }\n\n                    //We already have this record, so just the new samples to the end:\n                    Charts[update.Name].Series[series.Name].Values.AddRange(series.Values);\n                }\n            }\n        }\n\n        public void SetAlgorithm(IAlgorithm algorithm, decimal startingPortfolioValue)\n        {\n        }\n\n        protected override void StoreResult(Packet packet)\n        {\n        }\n\n        public void SendStatusUpdate(AlgorithmStatus status, string message = \"\")\n        {\n        }\n\n        public void RuntimeStatistic(string key, string value)\n        {\n        }\n\n        public override void OrderEvent(OrderEvent newEvent)\n        {\n        }\n\n        public override void Exit()\n        {\n            _cancellationTokenSource.Cancel();\n            _cancellationTokenSource.DisposeSafely();\n        }\n\n        public void ProcessSynchronousEvents(bool forceProcess = false)\n        {\n        }\n\n        public StatisticsResults StatisticsResults()\n        {\n            return new StatisticsResults();\n        }\n\n        public void SetSummaryStatistic(string name, string value)\n        {\n        }\n\n        public void AlgorithmTagsUpdated(HashSet<string> tags)\n        {\n        }\n\n        public void AlgorithmNameUpdated(string name)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AbsolutePriceOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AbsolutePriceOscillatorTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new AbsolutePriceOscillator(5, 10);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_apo.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"APO_5_10\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AccelerationBandsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AccelerationBandsTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AccelerationBands(period: 20, width: 4m);\n        }\n\n        protected override string TestFileName => \"spy_acceleration_bands_20_4.txt\";\n\n        protected override string TestColumnName => \"MiddleBand\";\n\n        [Test]\n        public void ComparesWithExternalDataLowerBand()\n        {\n            var abands = CreateIndicator();\n            TestHelper.TestIndicator(\n                abands,\n                \"spy_acceleration_bands_20_4.txt\",\n                \"LowerBand\",\n                (ind, expected) => Assert.AreEqual(expected, (double) ((AccelerationBands) ind).LowerBand.Current.Value,\n                    delta: 1e-4, message: \"Lower band test fail.\")\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataUpperBand()\n        {\n            var abands = CreateIndicator();\n            TestHelper.TestIndicator(\n                abands,\n                \"spy_acceleration_bands_20_4.txt\",\n                \"UpperBand\",\n                (ind, expected) => Assert.AreEqual(expected, (double) ((AccelerationBands) ind).UpperBand.Current.Value,\n                    delta: 1e-4, message: \"Upper band test fail.\")\n            );\n        }\n\n        [Test]\n        public void WorksWithLowValues()\n        {\n            var abands = CreateIndicator();\n            var random = new Random();\n            var time = DateTime.UtcNow;\n            for(int i = 0; i < 40; i++)\n            {\n                var value = random.NextDouble() * 0.000000000000000000000000000001;\n                Assert.DoesNotThrow(() => abands.Update(new TradeBar { High = (decimal)value, Low = (decimal)value, Time = time.AddDays(i)}));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AccumulationDistributionOscillatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class AccumulationDistributionOscillatorTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new AccumulationDistributionOscillator(3, 10);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_ad_osc.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"AdOsc_3_10\"; }\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AccumulationDistributionTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AccumulationDistributionTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new AccumulationDistribution(\"AD\");\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_ad.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"AD\"; }\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AdvanceDeclineDifferenceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AdvanceDeclineDifferenceTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var adDifference = new AdvanceDeclineDifference(\"test_name\");\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(adDifference.AddStock);\n            }\n            else\n            {\n                adDifference.AddStock(Symbols.AAPL);\n                adDifference.AddStock(Symbols.IBM);\n                adDifference.AddStock(Symbols.GOOG);\n                RenkoBarSize = 5000000;\n            }\n            return adDifference;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL, Symbols.IBM];\n        }\n\n        [Test]\n        public virtual void ShouldIgnoreRemovedStocks()\n        {\n            var adDifference = (AdvanceDeclineDifference)CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(1m, adDifference.Current.Value);\n            adDifference.Reset();\n            adDifference.RemoveStock(Symbols.GOOG);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(0m, adDifference.Current.Value);\n        }\n\n        [Test]\n        public virtual void IgnorePeriodIfAnyStockMissed()\n        {\n            var adDifference = (AdvanceDeclineDifference)CreateIndicator();\n            adDifference.AddStock(Symbols.MSFT);\n            var reference = System.DateTime.Today;\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Time = reference.AddMinutes(1) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Time = reference.AddMinutes(2) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(0m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 3, Time = reference.AddMinutes(3) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Time = reference.AddMinutes(3) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 2, Time = reference.AddMinutes(3) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(1m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Time = reference.AddMinutes(4) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 2, Time = reference.AddMinutes(4) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Time = reference.AddMinutes(4) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 2, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(2m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(5) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 3, Time = reference.AddMinutes(5) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(2m, adDifference.Current.Value);\n\n            adDifference.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(6) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 4, Time = reference.AddMinutes(6) });\n            adDifference.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 5, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(2m, adDifference.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 1, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(1m, indicator.Current.Value);\n            Assert.AreEqual(6, indicator.Samples);\n        }\n\n        [Test]\n        public virtual void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 1, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(1m, indicator.Current.Value);\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<TradeBar>)\n            {\n                var aaplRenkoConsolidator = new RenkoConsolidator(10000m);\n                aaplRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var googRenkoConsolidator = new RenkoConsolidator(100000m);\n                googRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var ibmRenkoConsolidator = new RenkoConsolidator(10000m);\n                ibmRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                foreach (var parts in GetCsvFileStream(TestFileName))\n                {\n                    var tradebar = parts.GetTradeBar();\n                    if (tradebar.Symbol.Value == \"AAPL\")\n                    {\n                        aaplRenkoConsolidator.Update(tradebar);\n                    }\n                    else if (tradebar.Symbol.Value == \"GOOG\")\n                    {\n                        googRenkoConsolidator.Update(tradebar);\n                    }\n                    else\n                    {\n                        ibmRenkoConsolidator.Update(tradebar);\n                    }\n                }\n\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveRenkoBars(indicator);\n                aaplRenkoConsolidator.Dispose();\n                googRenkoConsolidator.Dispose();\n                ibmRenkoConsolidator.Dispose();\n            }\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<TradeBar>)\n            {\n                var aaplRenkoConsolidator = new VolumeRenkoConsolidator(10000000m);\n                aaplRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var googRenkoConsolidator = new VolumeRenkoConsolidator(500000m);\n                googRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var ibmRenkoConsolidator = new VolumeRenkoConsolidator(500000m);\n                ibmRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                foreach (var parts in GetCsvFileStream(TestFileName))\n                {\n                    var tradebar = parts.GetTradeBar();\n                    if (tradebar.Symbol.Value == \"AAPL\")\n                    {\n                        aaplRenkoConsolidator.Update(tradebar);\n                    }\n                    else if (tradebar.Symbol.Value == \"GOOG\")\n                    {\n                        googRenkoConsolidator.Update(tradebar);\n                    }\n                    else\n                    {\n                        ibmRenkoConsolidator.Update(tradebar);\n                    }\n                }\n\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(indicator);\n                aaplRenkoConsolidator.Dispose();\n                googRenkoConsolidator.Dispose();\n                ibmRenkoConsolidator.Dispose();\n            }\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            for (int i = 0; i < 10; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n                // indicator is not ready yet\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 1, Time = reference.AddMinutes(2) });\n\n                // indicator is ready\n                // The last update used Symbol.GOOG, so the indicator's current Symbol should be GOOG\n                Assert.AreEqual(Symbols.GOOG, indicator.Current.Symbol);\n            }\n        }\n\n        protected override string TestFileName => \"arms_data.txt\";\n\n        protected override string TestColumnName => \"A/D Difference\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AdvanceDeclineRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AdvanceDeclineRatioTests : AdvanceDeclineDifferenceTests\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var adr = new AdvanceDeclineRatio(\"test_name\");\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(adr.AddStock);\n            }\n            else\n            {\n                adr.Add(Symbols.AAPL);\n                adr.Add(Symbols.IBM);\n                adr.Add(Symbols.GOOG);\n                RenkoBarSize = 5000000;\n            }\n            return adr;\n        }\n\n        [Test]\n        public override void ShouldIgnoreRemovedStocks()\n        {\n            var adr = (AdvanceDeclineRatio)CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(2m, adr.Current.Value);\n            adr.Reset();\n            adr.Remove(Symbols.GOOG);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(1m, adr.Current.Value);\n        }\n\n        [Test]\n        public override void IgnorePeriodIfAnyStockMissed()\n        {\n            var adr = (AdvanceDeclineRatio)CreateIndicator();\n            adr.Add(Symbols.MSFT);\n            var reference = System.DateTime.Today;\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 3, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 2, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(2m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 2, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 2, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(1m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 3, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(1m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 4, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 5, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(1m, adr.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 1, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(2m, indicator.Current.Value);\n            Assert.AreEqual(6, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 1, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(2m, indicator.Current.Value);\n        }\n\n        protected override string TestFileName => \"arms_data.txt\";\n\n        protected override string TestColumnName => \"A/D Ratio\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AdvanceDeclineRatioVolumeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AdvanceDeclineVolumeRatioTests : AdvanceDeclineDifferenceTests\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var advr = new AdvanceDeclineVolumeRatio(\"test_name\");\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(advr.AddStock);\n            }\n            else\n            {\n                advr.Add(Symbols.AAPL);\n                advr.Add(Symbols.IBM);\n                advr.Add(Symbols.GOOG);\n                RenkoBarSize = 5000000;\n            }\n            return advr;\n        }\n\n        [Test]\n        public override void ShouldIgnoreRemovedStocks()\n        {\n            var advr = (AdvanceDeclineVolumeRatio)CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            advr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            advr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            advr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, advr.Current.Value);\n\n            advr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            advr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            advr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(2m, advr.Current.Value);\n            advr.Reset();\n            advr.Remove(Symbols.AAPL);\n\n            advr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            advr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            advr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, advr.Current.Value);\n\n            advr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            advr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            advr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 150, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(1.5m, advr.Current.Value);\n        }\n\n        [Test]\n        public override void IgnorePeriodIfAnyStockMissed()\n        {\n            var adr = (AdvanceDeclineVolumeRatio)CreateIndicator();\n            adr.Add(Symbols.MSFT);\n            var reference = System.DateTime.Today;\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 3, Volume = 100, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 200, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(1m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 2, Volume = 250, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 2, Volume = 100, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 2, Volume = 150, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(5m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 3, Volume = 220, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 2, Volume = 120, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 100, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(5m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 70, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 3, Volume = 200, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 10, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(5m, adr.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 20, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 5, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 10, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(6m, indicator.Current.Value);\n            Assert.AreEqual(6, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 20, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 5, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 10, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(6m, indicator.Current.Value);\n        }\n\n        protected override string TestFileName => \"arms_data.txt\";\n\n        protected override string TestColumnName => \"A/D Volume Ratio\";\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AlphaIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AlphaIndicatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override string TestFileName => \"alpha_indicator_datatest.csv\";\n\n        protected override string TestColumnName => \"Alpha\";\n\n        private DateTime _reference = new DateTime(2020, 1, 1);\n\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            Symbol symbolA = \"AMZN 2T\";\n            Symbol symbolB = \"SPX 2T\";\n            if (SymbolList.Count > 1)\n            {\n                symbolA = SymbolList[0];\n                symbolB = SymbolList[1];\n            }\n#pragma warning disable CS0618\n            var indicator = new Alpha(\"testAlphaIndicator\", symbolA, symbolB, 5);\n#pragma warning restore CS0618\n            return indicator;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL];\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var period = 5;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.IBM, Symbols.SPY, period);\n            var warmUpPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!warmUpPeriod.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            // warmup period is 5 + 1\n            for (var i = 1; i <= warmUpPeriod.Value; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n\n                Assert.IsFalse(indicator.IsReady);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n\n                if (i < warmUpPeriod.Value)\n                {\n                    Assert.IsFalse(indicator.IsReady);\n                }\n                else\n                {\n                    Assert.IsTrue(indicator.IsReady);\n                }\n\n            }\n\n            Assert.AreEqual(2 * warmUpPeriod.Value, indicator.Samples);\n        }\n\n        [Test]\n        public override void WorksWithLowValues()\n        {\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.IBM, Symbols.SPY, 10);\n            var warmUpPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            var random = new Random();\n            var time = DateTime.UtcNow;\n            for (int i = 0; i < 2 * warmUpPeriod; i++)\n            {\n                var value = (decimal)(random.NextDouble() * 0.000000000000000000000000000001);\n                Assert.DoesNotThrow(() => indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = value, High = value, Volume = 100, Close = value, Time = _reference.AddDays(1 + i) }));\n                Assert.DoesNotThrow(() => indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = value, High = value, Volume = 100, Close = value, Time = _reference.AddDays(1 + i) }));\n            }\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var firstRenkoConsolidator = new RenkoConsolidator(10m);\n            var secondRenkoConsolidator = new RenkoConsolidator(10m);\n            firstRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"AMZN\")\n                {\n                    firstRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstRenkoConsolidator.Dispose();\n            secondRenkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var firstVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000);\n            var secondVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000000);\n            firstVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"AMZN\")\n                {\n                    firstVolumeRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondVolumeRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstVolumeRenkoConsolidator.Dispose();\n            secondVolumeRenkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public void AcceptsQuoteBarsAsInput()\n        {\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new QuoteBar { Symbol = Symbols.IBM, Ask = new Bar(1, 2, 1, 500), Bid = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n                indicator.Update(new QuoteBar { Symbol = Symbols.SPY, Ask = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public void EqualAlphaValue()\n        {\n            int period = 5;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, period);\n\n            for (int i = 0; i <= period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < period)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(0.0032053150, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void RiskFreeRate()\n        {\n            decimal riskFreeRate = 0.0002m;\n            int period = 5;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, period, riskFreeRate);\n\n            for (int i = 0; i <= period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < period)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(0.0030959108, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void RiskFreeRate252()\n        {\n            int alphaPeriod = 1;\n            int betaPeriod = 252;\n            decimal riskFreeRate = 0.0025m;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, alphaPeriod, betaPeriod, riskFreeRate);\n\n            for (int i = 0; i <= betaPeriod; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < betaPeriod)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(-0.0000620852, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void NoRiskFreeRate252()\n        {\n            int alphaPeriod = 1;\n            int betaPeriod = 252;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, alphaPeriod, betaPeriod);\n\n            for (int i = 0; i <= betaPeriod; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < betaPeriod)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(0.0008518139, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void ConstantZeroRiskFreeRateModel()\n        {\n            int alphaPeriod = 1;\n            int betaPeriod = 252;\n            IRiskFreeInterestRateModel riskFreeRateModel = new ConstantRiskFreeRateInterestRateModel(0.0m);\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, alphaPeriod, betaPeriod, riskFreeRateModel);\n\n            for (int i = 0; i <= betaPeriod; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < betaPeriod)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(0.0008518139, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void ConstantRiskFreeRateModel()\n        {\n            int alphaPeriod = 1;\n            int betaPeriod = 252;\n            IRiskFreeInterestRateModel riskFreeRateModel = new ConstantRiskFreeRateInterestRateModel(0.0025m);\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, alphaPeriod, betaPeriod, riskFreeRateModel);\n\n            for (int i = 0; i <= betaPeriod; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < betaPeriod)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(-0.0000620852, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public void NullRiskFreeRate()\n        {\n            int alphaPeriod = 1;\n            int betaPeriod = 252;\n            var indicator = new Alpha(\"testAlphaIndicator\", Symbols.AAPL, Symbols.SPX, alphaPeriod, betaPeriod, riskFreeRate: null);\n\n            for (int i = 0; i <= betaPeriod; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 100 + i, Time = startTime, EndTime = endTime });\n\n                Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 200 + i * 3, Time = startTime, EndTime = endTime });\n\n                if (i < betaPeriod)\n                {\n                    Assert.AreEqual(0.0, (double)indicator.Current.Value, 0.0000000001);\n                }\n                else\n                {\n                    Assert.AreEqual(0.0008518139, (double)indicator.Current.Value, 0.0000000001);\n                }\n\n            }\n        }\n\n        [Test]\n        public override void TracksPreviousState()\n        {\n            var period = 5;\n            var indicator = new Alpha(Symbols.AAPL, Symbols.SPX, period);\n            var previousValue = indicator.Current.Value;\n\n            // Update the indicator and verify the previous values\n            for (var i = 1; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                // Verify the previous value matches the indicator's previous value\n                Assert.AreEqual(previousValue, indicator.Previous.Value);\n\n                // Update previousValue to the current value for the next iteration\n                previousValue = indicator.Current.Value;\n            }\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var period = 5;\n            var indicator = new Beta(Symbols.AAPL, Symbols.SPX, period);\n\n            for (var i = 0; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                // Update with the first symbol (AAPL) — indicator.Current.Symbol should reflect this update\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.AAPL, indicator.Current.Symbol);\n\n                // Update with the second symbol (SPX) — indicator.Current.Symbol should now be SPX\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.SPX, indicator.Current.Symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ArmsIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ArmsIndexTests : AdvanceDeclineDifferenceTests\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var indicator = new ArmsIndex(\"test_name\");\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(indicator.AddStock);\n            }\n            else\n            {\n                indicator.Add(Symbols.AAPL);\n                indicator.Add(Symbols.IBM);\n                indicator.Add(Symbols.GOOG);\n                RenkoBarSize = 5000000;\n            }\n            return indicator;\n        }\n\n        [Test]\n        public override void ShouldIgnoreRemovedStocks()\n        {\n            var trin = (ArmsIndex)CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            trin.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            trin.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            trin.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, trin.Current.Value);\n\n            trin.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            trin.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            trin.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(1m, trin.Current.Value);\n            trin.Reset();\n            trin.Remove(Symbols.IBM);\n\n            trin.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            trin.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            trin.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, trin.Current.Value);\n\n            trin.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            trin.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            trin.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreNotEqual(1m, trin.Current.Value);\n        }\n\n        [Test]\n        public override void IgnorePeriodIfAnyStockMissed()\n        {\n            var adr = (ArmsIndex)CreateIndicator();\n            adr.Add(Symbols.MSFT);\n            var reference = System.DateTime.Today;\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 100, Time = reference.AddMinutes(2) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 100, Time = reference.AddMinutes(2) });\n\n            Assert.AreEqual(0m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 3, Volume = 100, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 200, Time = reference.AddMinutes(3) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(2m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 100, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 2, Volume = 250, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 2, Volume = 100, Time = reference.AddMinutes(4) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 2, Volume = 150, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(3m / 5m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 140, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 5, Volume = 110, Time = reference.AddMinutes(5) });\n            adr.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = 1, Volume = 150, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(3m / 5m, adr.Current.Value);\n\n            adr.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 120, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 3, Volume = 350, Time = reference.AddMinutes(6) });\n            adr.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 4, Volume = 200, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(3m / 5m, adr.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 60, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 10, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 40, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(0.2m, indicator.Current.Value);\n            Assert.AreEqual(6, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator();\n            var reference = System.DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = 2, Volume = 60, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 0.5m, Volume = 10, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Volume = 40, Time = reference.AddMinutes(2) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(0.2m, indicator.Current.Value);\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            var startDate = new DateTime(2019, 1, 1);\n\n            for (var i = 10; i > 0; i--)\n            {\n                var input = GetInput(Symbols.AAPL, startDate, i);\n                indicator.Update(input);\n            }\n\n            for (var i = 10; i > 0; i--)\n            {\n                var input = GetInput(Symbols.IBM, startDate, i);\n                indicator.Update(input);\n            }\n\n            for (var i = 10; i > 0; i--)\n            {\n                var input = GetInput(Symbols.GOOG, startDate, i);\n                indicator.Update(input);\n            }\n\n            Assert.AreEqual(3, indicator.Samples);\n\n            indicator.Reset();\n\n            for (var i = 0; i < 10; i++)\n            {\n                var input = GetInput(Symbols.AAPL, startDate, i);\n                indicator.Update(input);\n            }\n\n            for (var i = 0; i < 10; i++)\n            {\n                var input = GetInput(Symbols.IBM, startDate, i);\n                indicator.Update(input);\n            }\n\n            for (var i = 0; i < 10; i++)\n            {\n                var input = GetInput(Symbols.GOOG, startDate, i);\n                indicator.Update(input);\n            }\n\n            Assert.AreEqual(30, indicator.Samples);\n        }\n\n        protected override string TestFileName => \"arms_data.txt\";\n\n        protected override string TestColumnName => \"TRIN\";\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ArnaudLegouxMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ArnaudLegouxMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new ArnaudLegouxMovingAverage(9, 6);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_alma.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"ALMA\"; }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AroonOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AroonOscillatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AroonOscillator(14, 14);\n        }\n\n        protected override string TestFileName => \"spy_aroon_oscillator.txt\";\n\n        protected override string TestColumnName => \"Aroon Oscillator 14\";\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var aroon = new AroonOscillator(3, 3);\n            aroon.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today,\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            aroon.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today.AddSeconds(1),\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            aroon.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today.AddSeconds(2),\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            Assert.IsFalse(aroon.IsReady);\n            aroon.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today.AddSeconds(3),\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            Assert.IsTrue(aroon.IsReady);\n\n            aroon.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(aroon);\n            TestHelper.AssertIndicatorIsInDefaultState(aroon.AroonUp);\n            TestHelper.AssertIndicatorIsInDefaultState(aroon.AroonDown);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AugenPriceSpikeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AugenPriceSpikeTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new AugenPriceSpike(20);\n        }\n\n        protected override string TestFileName => \"spy_aps.txt\";\n\n        protected override string TestColumnName => \"APS\";\n\n        [Test]\n        public void TestWithStream()\n        {\n            var aps = new AugenPriceSpike(22);\n            foreach (var data in TestHelper.GetDataStream(50))\n            {\n                aps.Update(data.Time, data.Value);\n            }\n        }\n\n        [Test]\n        public void TestForPeriod()\n        {\n            Assert.Throws<ArgumentException>(() => new AugenPriceSpike(1));\n            Assert.Throws<ArgumentException>(() => new AugenPriceSpike(2));\n        }\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1); }\n        }\n\n        [Test]\n        public void PeriodSet()\n        {\n            var aps = new AugenPriceSpike(period: 20);\n            var reference = DateTime.Today;\n\n            double correctValue = 0.31192350881956543;\n            decimal finalTestValue = 22;\n\n            int count = 0;\n            List<double> testValues = new List<double>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 };\n\n            foreach (decimal i in testValues)\n            {\n                count += 1;\n                aps.Update(reference.AddMinutes(count), i);\n                Assert.IsFalse(aps.IsReady);\n                Assert.AreEqual(0, aps.Current.Value);\n            }\n            aps.Update(reference.AddMinutes(count + 1), finalTestValue);\n            Assert.IsTrue(aps.IsReady);\n            Assert.AreEqual(correctValue, (double)aps.Current.Value, 0.00001);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var aps = new AugenPriceSpike(10);\n            var reference = DateTime.Today;\n\n            aps.Update(reference.AddMinutes(1), 5);\n            aps.Update(reference.AddMinutes(2), 10);\n            aps.Update(reference.AddMinutes(3), 8);\n            aps.Update(reference.AddMinutes(4), 12);\n            aps.Update(reference.AddMinutes(5), 103);\n            aps.Update(reference.AddMinutes(6), 82);\n            aps.Update(reference.AddMinutes(7), 55);\n            aps.Update(reference.AddMinutes(8), 10);\n            aps.Update(reference.AddMinutes(9), 878);\n            aps.Update(reference.AddMinutes(10), 84);\n            aps.Update(reference.AddMinutes(11), 832);\n            aps.Update(reference.AddMinutes(12), 81);\n            aps.Update(reference.AddMinutes(13), 867);\n            aps.Update(reference.AddMinutes(14), 89);\n            Assert.IsTrue(aps.IsReady);\n            Assert.AreNotEqual(0m, aps.Current.Value);\n\n            aps.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(aps);\n        }\n\n        [Test]\n        public void DoesNotThrowOverflowException()\n        {\n            var aps = new AugenPriceSpike(5);\n            var values = new List<decimal>\n            {\n                decimal.MaxValue,\n                0,\n                1e-18m,\n                decimal.MaxValue,\n                1m\n            };\n\n            var date = new DateTime(2024, 12, 2, 12, 0, 0);\n\n            for (var i = 0; i < values.Count; i++)\n            {\n                Assert.DoesNotThrow(() => aps.Update(date, values[i]));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AutoregressiveIntegratedMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Accord.Statistics;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AutoregressiveIntegratedMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        private static List<decimal> betweenMethods;\n        private double _ssIndicator;\n        private double _ssTest;\n\n        protected override string TestFileName => \"spy_arima.csv\";\n        protected override string TestColumnName => \"ARIMA\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            var ARIMA = CreateIndicator();\n            TestHelper.TestIndicator(ARIMA, TestFileName, TestColumnName,\n                (ind, expected) => Assert.AreEqual(expected, (double) ARIMA.Current.Value, 10d));\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            var ARIMA = CreateIndicator();\n            TestHelper.TestIndicator(ARIMA, TestFileName, TestColumnName,\n                (ind, expected) => Assert.AreEqual(expected, (double) ARIMA.Current.Value, 10d));\n            ARIMA.Reset();\n            TestHelper.TestIndicator(ARIMA, TestFileName, TestColumnName,\n                (ind, expected) => Assert.AreEqual(expected, (double) ARIMA.Current.Value, 10d));\n        }\n\n        [Test]\n        public void PredictionErrorAgainstExternalData()\n        {\n            if (betweenMethods == null)\n            {\n                betweenMethods = FillDataPerMethod();\n            }\n            \n            // Testing predictive performance vs. external.\n            Assert.LessOrEqual(_ssIndicator, _ssTest);\n        }\n\n        [Test]\n        public override void WarmsUpProperly() // Overridden in order to ensure matrix inversion during ARIMA fitting.\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            var startDate = new DateTime(2019, 1, 1);\n            for (decimal i = 0; i < period.Value; i++)\n            {\n                indicator.Update(startDate, 100m * (1m + 0.05m * i)); // Values should be sufficiently different, now.\n                Assert.AreEqual(i == period.Value - 1, indicator.IsReady);\n            }\n\n            Assert.AreEqual(period.Value, indicator.Samples);\n        }\n\n        [Test]\n        public void ExpectedDifferenceFromExternal()\n        {\n            if (betweenMethods == null)\n            {\n                betweenMethods = FillDataPerMethod();\n            }\n            \n            Assert.LessOrEqual(1.39080827453985, betweenMethods.Average()); // Mean difference\n            Assert.LessOrEqual(1.19542348709062, betweenMethods.ToDoubleArray().StandardDeviation()); // Std. Dev\n        }\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            var ARIMA = new AutoRegressiveIntegratedMovingAverage(\"ARIMA\", 1, 0, 1, 50);\n            return ARIMA;\n        }\n\n        private List<decimal> FillDataPerMethod()\n        {\n            var ARIMA = CreateIndicator();\n            var realValues = new List<decimal>();\n            var testValues = new List<decimal[]>();\n            var betweenMethods = new List<decimal>();\n            var data = TestHelper.GetCsvFileStream(TestFileName);\n            foreach (var val in data)\n            {\n                if (!string.IsNullOrEmpty(val[\"Close\"]))\n                {\n                    var close = val[\"Close\"];\n                    realValues.Add(decimal.Parse(val[\"Close\"], new NumberFormatInfo()));\n                    ARIMA.Update(new IndicatorDataPoint(Convert.ToDateTime(val[\"Date\"], new DateTimeFormatInfo()),\n                        Convert.ToDecimal(close, new NumberFormatInfo())));\n                }\n\n                if (!string.IsNullOrEmpty(val[TestColumnName]))\n                {\n                    var fromTest = decimal.Parse(val[TestColumnName], new NumberFormatInfo());\n                    testValues.Add(new[] {ARIMA.Current.Value, fromTest});\n                }\n            }\n\n            _ssIndicator = 0d;\n            _ssTest = 0d;\n            for (var i = 51; i < realValues.Count; i++)\n            {\n                var test = realValues[i];\n                var arimas = testValues[i - 50];\n                _ssIndicator += Math.Pow((double) (arimas[0] - test), 2);\n                _ssTest += Math.Pow((double) (arimas[1] - test), 2);\n                betweenMethods.Add(Math.Abs(arimas[0] - arimas[1]));\n            }\n\n            return betweenMethods;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AverageDirectionalIndexTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AverageDirectionalIndexTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AverageDirectionalIndex(14);\n        }\n\n        protected override string TestFileName => \"spy_with_adx.txt\";\n\n        protected override string TestColumnName => \"ADX 14\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            const double epsilon = .0001;\n            var adx = CreateIndicator();\n\n            TestHelper.TestIndicator(adx, TestFileName, \"+DI14\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((AverageDirectionalIndex)ind).PositiveDirectionalIndex.Current.Value, epsilon)\n            );\n            adx.Reset();\n\n            TestHelper.TestIndicator(adx, TestFileName, \"-DI14\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((AverageDirectionalIndex)ind).NegativeDirectionalIndex.Current.Value, epsilon)\n            );\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AverageDirectionalMovementIndexRatingTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AverageDirectionalMovementIndexRatingTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AverageDirectionalMovementIndexRating(14);\n        }\n\n        protected override string TestFileName => \"spy_with_adx.txt\";\n\n        protected override string TestColumnName => \"ADXR 14\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1.0); }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AverageRangeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AverageRangeTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AverageRange(20);\n        }\n        protected override string TestFileName => \"spy_adr.csv\";\n\n        protected override string TestColumnName => \"adr\";\n\n        [Test]\n        public void ComputesCorrectly()\n        {\n            var period = 20;\n            var adr = new AverageRange(period);\n            var values = new List<TradeBar>();\n            for (int i = 0; i < period; i++)\n            {\n                var value = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = DateTime.Now.AddSeconds(i),\n                    High = 2 * i,\n                    Low = i\n                };\n                adr.Update(value);\n                values.Add(value);\n            }\n            var expected = values.Average(x => x.High - x.Low);\n            Assert.AreEqual(expected, adr.Current.Value);\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var period = 5;\n            var adr = new AverageRange(period);\n            for (int i = 0; i < period; i++)\n            {\n                Assert.IsFalse(adr.IsReady);\n                var value = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = DateTime.Now.AddSeconds(i),\n                    High = 2 * i,\n                    Low = i\n                };\n                adr.Update(value);\n            }\n            Assert.IsTrue(adr.IsReady);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/AverageTrueRangeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AverageTrueRangeTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new AverageTrueRange(14);\n        }\n\n        protected override string TestFileName => \"spy_atr_wilder.txt\";\n\n        protected override string TestColumnName => \"Average True Range 14\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            var atrSimple = new AverageTrueRange(14, MovingAverageType.Simple);\n            TestHelper.TestIndicator(atrSimple, \"spy_atr.txt\", \"Average True Range 14\");\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var atr = new AverageTrueRange(14, MovingAverageType.Simple);\n            atr.Update(new TradeBar\n            {\n                Time = DateTime.Today,\n                Open = 1m,\n                High = 3m,\n                Low = .5m,\n                Close = 2.75m,\n                Volume = 1234567890\n            });\n\n            atr.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(atr);\n            TestHelper.AssertIndicatorIsInDefaultState(atr.TrueRange);\n        }\n\n        [Test]\n        public void TrueRangePropertyIsReadyAfterTwoUpdates()\n        {\n            var atr = new AverageTrueRange(14, MovingAverageType.Simple);\n            Assert.IsFalse(atr.TrueRange.IsReady);\n\n            atr.Update(new TradeBar\n            {\n                Time = DateTime.Today,\n                Open = 1m,\n                High = 3m,\n                Low = .5m,\n                Close = 2.75m,\n                Volume = 1234567890\n            });\n\n            Assert.IsFalse(atr.TrueRange.IsReady);\n\n            atr.Update(new TradeBar\n            {\n                Time = DateTime.Today,\n                Open = 1m,\n                High = 3m,\n                Low = .5m,\n                Close = 2.75m,\n                Volume = 1234567890\n            });\n\n            Assert.IsTrue(atr.TrueRange.IsReady);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/AwesomeOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class AwesomeOscillatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 100000000m;\n            return new AwesomeOscillator(5, 34);\n        }\n\n        protected override string TestFileName => \"spy_ao.txt\";\n\n        protected override string TestColumnName => \"AO\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/BalanceOfPowerTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class BalanceOfPowerTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 100000000m;\n            return new BalanceOfPower();\n        }\n\n        protected override string TestFileName => \"spy_bop.txt\";\n\n        protected override string TestColumnName => \"BOP\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/BetaIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing MathNet.Numerics.Statistics;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class BetaIndicatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override string TestFileName => \"bi_datatest.csv\";\n\n        protected override string TestColumnName => \"Beta\";\n\n        private DateTime _reference = new DateTime(2020, 1, 1);\n\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            Symbol symbolA = \"AMZN 2T\";\n            Symbol symbolB = \"SPX 2T\";\n            if (SymbolList.Count > 1)\n            {\n                symbolA = SymbolList[0];\n                symbolB = SymbolList[1];\n            }\n#pragma warning disable CS0618\n            var indicator = new Beta(\"testBetaIndicator\", symbolA, symbolB, 5);\n#pragma warning restore CS0618\n            return indicator;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL];\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = new Beta(\"testBetaIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = new Beta(\"testBetaIndicator\", Symbols.IBM, Symbols.SPY, 5);\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            for (var i = 0; i < period.Value; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2 * period.Value, indicator.Samples);\n        }\n\n        [Test]\n        public override void WorksWithLowValues()\n        {\n#pragma warning disable CS0618\n            Symbol = \"SPX 2T\";\n#pragma warning restore CS0618\n            base.WorksWithLowValues();\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var firstRenkoConsolidator = new RenkoConsolidator(10m);\n            var secondRenkoConsolidator = new RenkoConsolidator(10m);\n            firstRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"AMZN\")\n                {\n                    firstRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstRenkoConsolidator.Dispose();\n            secondRenkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var firstVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000);\n            var secondVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000000);\n            firstVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"AMZN\")\n                {\n                    firstVolumeRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondVolumeRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstVolumeRenkoConsolidator.Dispose();\n            secondVolumeRenkoConsolidator.Dispose();\n        }\n\n\n        [Test]\n        public void AcceptsQuoteBarsAsInput()\n        {\n            var indicator = new Beta(\"testBetaIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new QuoteBar { Symbol = Symbols.IBM, Ask = new Bar(1, 2, 1, 500), Bid = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n                indicator.Update(new QuoteBar { Symbol = Symbols.SPY, Ask = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public void EqualBetaValue()\n        {\n            var indicator = new Beta(\"testBetaIndicator\", Symbols.AAPL, Symbols.SPX, 5);\n\n            for (int i = 0; i < 3; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n            }\n\n            Assert.AreEqual(1, (double)indicator.Current.Value, 0.0001);\n        }\n\n        [Test]\n        public void NotEqualBetaValue()\n        {\n            var indicator = new Beta(\"testBetaIndicator\", Symbols.AAPL, Symbols.SPX, 5);\n\n            for (int i = 0; i < 3; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = i + 2, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreNotEqual(1, (double)indicator.Current.Value);\n        }\n\n        [Test]\n        public void ValidateBetaCalculation()\n        {\n            var beta = new Beta(Symbols.AAPL, Symbols.SPX, 3);\n\n            var values = new List<TradeBar>()\n            {\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 10, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 35, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2),EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2), EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 15, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 80, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 37, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 90, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 105, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 302, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n            };\n\n            // Calculating beta manually using the formula: Beta = Covariance(AAPL, SPX) / Variance(SPX)\n            var closeAAPL = new List<double>() { 10, 15, 90, 105 };\n            var closeSPX = new List<double>() { 35, 80, 37, 302 };\n            var priceChangesAAPL = new List<double>();\n            var priceChangesSPX = new List<double>();\n            for (int i = 1; i < 4; i++)\n            {\n                priceChangesAAPL.Add((closeAAPL[i] - closeAAPL[i - 1]) / closeAAPL[i - 1]);\n                priceChangesSPX.Add((closeSPX[i] - closeSPX[i - 1]) / closeSPX[i - 1]);\n            }\n            var variance = priceChangesSPX.Variance();\n            var covariance = priceChangesAAPL.Covariance(priceChangesSPX);\n            var expectedBeta = (decimal)(covariance / variance);\n\n            // Calculating beta using the indicator\n            for (int i = 0; i < values.Count; i++)\n            {\n                beta.Update(values[i]);\n            }\n\n            Assert.AreEqual(expectedBeta, beta.Current.Value);\n        }\n\n        [Test]\n        public void BetaWithDifferentTimeZones()\n        {\n            var indicator = new Beta(Symbols.SPY, Symbols.BTCUSD, 5);\n\n            for (int i = 0; i < 10; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.BTCUSD, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n            }\n            Assert.AreEqual(1, (double)indicator.Current.Value);\n        }\n\n        [Test]\n        public override void TracksPreviousState()\n        {\n            var period = 5;\n            var indicator = new Beta(Symbols.SPY, Symbols.AAPL, period);\n            var previousValue = indicator.Current.Value;\n\n            // Update the indicator and verify the previous values\n            for (var i = 1; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                // Verify the previous value matches the indicator's previous value\n                Assert.AreEqual(previousValue, indicator.Previous.Value);\n\n                // Update previousValue to the current value for the next iteration\n                previousValue = indicator.Current.Value;\n            }\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var period = 5;\n            var indicator = new Beta(Symbols.SPY, Symbols.AAPL, period);\n\n            for (var i = 0; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                // Update with the first symbol (SPY) — indicator.Current.Symbol should reflect this update\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.SPY, indicator.Current.Symbol);\n\n                // Update with the first symbol (AAPL) — indicator.Current.Symbol should reflect this update\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.AAPL, indicator.Current.Symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/BollingerBandsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class BollingerBandsTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new BollingerBands(20, 2.0m);\n        }\n\n        protected override string TestFileName => \"spy_bollinger_bands.txt\";\n\n        protected override string TestColumnName => \"Bollinger Bands® 20 2 Bottom\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double) ((BollingerBands) indicator).LowerBand.Current.Value, 1e-3);\n\n        [Test]\n        public void ComparesWithExternalDataMiddleBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as BollingerBands,\n                TestFileName,\n                \"Moving Average 20\",\n                ind => (double) ind.MiddleBand.Current.Value\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataUpperBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as BollingerBands,\n                TestFileName,\n                \"Bollinger Bands® 20 2 Top\",\n                ind => (double) ind.UpperBand.Current.Value\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataBandWidth()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as BollingerBands,\n                TestFileName,\n                \"BandWidth\",\n                ind => (double)ind.BandWidth.Current.Value\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataPercentB()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as BollingerBands,\n                TestFileName,\n                \"%B\",\n                ind => (double)ind.PercentB.Current.Value\n            );\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var bb = new BollingerBands(2, 2m);\n            bb.Update(DateTime.Today, 1m);\n\n            Assert.IsFalse(bb.IsReady);\n            bb.Update(DateTime.Today.AddSeconds(1), 2m);\n            Assert.IsTrue(bb.IsReady);\n            Assert.IsTrue(bb.StandardDeviation.IsReady);\n            Assert.IsTrue(bb.LowerBand.IsReady);\n            Assert.IsTrue(bb.MiddleBand.IsReady);\n            Assert.IsTrue(bb.UpperBand.IsReady);\n            Assert.IsTrue(bb.BandWidth.IsReady);\n            Assert.IsTrue(bb.PercentB.IsReady);\n\n            bb.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(bb);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.StandardDeviation);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.LowerBand);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.MiddleBand);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.UpperBand);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.BandWidth);\n            TestHelper.AssertIndicatorIsInDefaultState(bb.PercentB);\n        }\n\n        [Test]\n        public void LowerUpperBandUpdateOnce()\n        {\n            var bb = new BollingerBands(2, 2m);\n            var lowerBandUpdateCount = 0;\n            var upperBandUpdateCount = 0;\n            bb.LowerBand.Updated += (sender, updated) =>\n            {\n                lowerBandUpdateCount++;\n            };\n            bb.UpperBand.Updated += (sender, updated) =>\n            {\n                upperBandUpdateCount++;\n            };\n\n            Assert.AreEqual(0, lowerBandUpdateCount);\n            Assert.AreEqual(0, upperBandUpdateCount);\n            bb.Update(DateTime.Today, 1m);\n\n            Assert.AreEqual(1, lowerBandUpdateCount);\n            Assert.AreEqual(1, upperBandUpdateCount);\n        }\n\n        [Test]\n        public void DoesNotUpdateWhenStale()\n        {\n            // Unit test for GH Issue #4927\n            var period = 5;\n            var bb = new BollingerBands(period, 2m);\n\n            var lastPercentB = new IndicatorDataPoint();\n            var lastUpdateTime = DateTime.MinValue;\n            bb.Updated += (s, e) =>\n            {\n                if (bb.IsReady && lastPercentB == bb.PercentB.Current)\n                {\n                    throw new ArgumentException(\"BollingerBand is stale and should not be updating\");\n                }\n\n                lastUpdateTime = e.Time;\n                lastPercentB = bb.PercentB.Current;\n            };\n\n            // Push in identical value points for the entire period.\n            for (int i = 0; i < period; i++)\n            {\n                bb.Update(DateTime.UtcNow, 1);\n            }\n\n            // Push in another identical value point, this should not update!\n            var time = DateTime.UtcNow;\n            bb.Update(time, 1);\n\n            // Assert this was not updated\n            Assert.AreNotEqual(time, lastUpdateTime);\n\n            // Push in a new value\n            time = DateTime.UtcNow;\n            bb.Update(time, 2);\n\n            // Assert this did update\n            Assert.AreEqual(time, lastUpdateTime);\n            Assert.AreEqual(lastPercentB, bb.PercentB.Current);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CandlestickPatterns/CandlestickPatternTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Indicators.CandlestickPatterns;\n\nnamespace QuantConnect.Tests.Indicators.CandlestickPatterns\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class CandlestickPatternTests\n    {\n        private static readonly string[] _testFileNames =\n        {\n            \"spy_candle_patterns.txt\", \"ewz_candle_patterns.txt\", \"eurusd_candle_patterns.txt\"\n        };\n\n        private static TestCaseData[] PatternTestParameters\n        {\n            get\n            {\n                var rows = new List<TestCaseData>();\n\n                foreach (var testFileName in _testFileNames)\n                {\n                    rows.Add(new TestCaseData(new TwoCrows(), \"CDL2CROWS\", testFileName).SetName(\"TwoCrows-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeBlackCrows(), \"CDL3BLACKCROWS\", testFileName).SetName(\"ThreeBlackCrows-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeInside(), \"CDL3INSIDE\", testFileName).SetName(\"ThreeInside-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeLineStrike(), \"CDL3LINESTRIKE\", testFileName).SetName(\"ThreeLineStrike-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeOutside(), \"CDL3OUTSIDE\", testFileName).SetName(\"ThreeOutside-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeStarsInSouth(), \"CDL3STARSINSOUTH\", testFileName).SetName(\"ThreeStarsInSouth-\" + testFileName));\n                    rows.Add(new TestCaseData(new ThreeWhiteSoldiers(), \"CDL3WHITESOLDIERS\", testFileName).SetName(\"ThreeWhiteSoldiers-\" + testFileName));\n                    rows.Add(new TestCaseData(new AbandonedBaby(), \"CDLABANDONEDBABY\", testFileName).SetName(\"AbandonedBaby-\" + testFileName));\n                    rows.Add(new TestCaseData(new AdvanceBlock(), \"CDLADVANCEBLOCK\", testFileName).SetName(\"AdvanceBlock-\" + testFileName));\n                    rows.Add(new TestCaseData(new BeltHold(), \"CDLBELTHOLD\", testFileName).SetName(\"BeltHold-\" + testFileName));\n                    rows.Add(new TestCaseData(new Breakaway(), \"CDLBREAKAWAY\", testFileName).SetName(\"Breakaway-\" + testFileName));\n                    rows.Add(new TestCaseData(new ClosingMarubozu(), \"CDLCLOSINGMARUBOZU\", testFileName).SetName(\"ClosingMarubozu-\" + testFileName));\n                    rows.Add(new TestCaseData(new ConcealedBabySwallow(), \"CDLCONCEALBABYSWALL\", testFileName).SetName(\"ConcealedBabySwallow-\" + testFileName));\n                    rows.Add(new TestCaseData(new Counterattack(), \"CDLCOUNTERATTACK\", testFileName).SetName(\"Counterattack-\" + testFileName));\n                    rows.Add(new TestCaseData(new DarkCloudCover(), \"CDLDARKCLOUDCOVER\", testFileName).SetName(\"DarkCloudCover-\" + testFileName));\n                    rows.Add(new TestCaseData(new Doji(), \"CDLDOJI\", testFileName).SetName(\"Doji-\" + testFileName));\n                    rows.Add(new TestCaseData(new DojiStar(), \"CDLDOJISTAR\", testFileName).SetName(\"DojiStar-\" + testFileName));\n                    rows.Add(new TestCaseData(new DragonflyDoji(), \"CDLDRAGONFLYDOJI\", testFileName).SetName(\"DragonflyDoji-\" + testFileName));\n                    rows.Add(new TestCaseData(new Engulfing(), \"CDLENGULFING\", testFileName).SetName(\"Engulfing-\" + testFileName));\n                    rows.Add(new TestCaseData(new EveningDojiStar(), \"CDLEVENINGDOJISTAR\", testFileName).SetName(\"EveningDojiStar-\" + testFileName));\n                    rows.Add(new TestCaseData(new EveningStar(), \"CDLEVENINGSTAR\", testFileName).SetName(\"EveningStar-\" + testFileName));\n                    rows.Add(new TestCaseData(new GapSideBySideWhite(), \"CDLGAPSIDESIDEWHITE\", testFileName).SetName(\"GapSideBySideWhite-\" + testFileName));\n                    rows.Add(new TestCaseData(new GravestoneDoji(), \"CDLGRAVESTONEDOJI\", testFileName).SetName(\"GravestoneDoji-\" + testFileName));\n                    rows.Add(new TestCaseData(new Hammer(), \"CDLHAMMER\", testFileName).SetName(\"Hammer-\" + testFileName));\n                    rows.Add(new TestCaseData(new HangingMan(), \"CDLHANGINGMAN\", testFileName).SetName(\"HangingMan-\" + testFileName));\n                    rows.Add(new TestCaseData(new Harami(), \"CDLHARAMI\", testFileName).SetName(\"Harami-\" + testFileName));\n                    rows.Add(new TestCaseData(new HaramiCross(), \"CDLHARAMICROSS\", testFileName).SetName(\"HaramiCross-\" + testFileName));\n                    if (testFileName.Contains(\"ewz\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test only passes with the ewz test file \n                        rows.Add(new TestCaseData(new HighWaveCandle(), \"CDLHIGHWAVE\", testFileName).SetName(\"HighWaveCandle-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new Hikkake(), \"CDLHIKKAKE\", testFileName).SetName(\"Hikkake-\" + testFileName));\n                    if (testFileName.Contains(\"spy\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test only passes with the spy test file \n                        rows.Add(new TestCaseData(new HikkakeModified(), \"CDLHIKKAKEMOD\", testFileName).SetName(\"HikkakeModified-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new HomingPigeon(), \"CDLHOMINGPIGEON\", testFileName).SetName(\"HomingPigeon-\" + testFileName));\n                    rows.Add(new TestCaseData(new IdenticalThreeCrows(), \"CDLIDENTICAL3CROWS\", testFileName).SetName(\"IdenticalThreeCrows-\" + testFileName));\n                    rows.Add(new TestCaseData(new InNeck(), \"CDLINNECK\", testFileName).SetName(\"InNeck-\" + testFileName));\n                    rows.Add(new TestCaseData(new InvertedHammer(), \"CDLINVERTEDHAMMER\", testFileName).SetName(\"InvertedHammer-\" + testFileName));\n                    rows.Add(new TestCaseData(new Kicking(), \"CDLKICKING\", testFileName).SetName(\"Kicking-\" + testFileName));\n                    rows.Add(new TestCaseData(new KickingByLength(), \"CDLKICKINGBYLENGTH\", testFileName).SetName(\"KickingByLength-\" + testFileName));\n                    rows.Add(new TestCaseData(new LadderBottom(), \"CDLLADDERBOTTOM\", testFileName).SetName(\"LadderBottom-\" + testFileName));\n                    rows.Add(new TestCaseData(new LongLeggedDoji(), \"CDLLONGLEGGEDDOJI\", testFileName).SetName(\"LongLeggedDoji-\" + testFileName));\n                    rows.Add(new TestCaseData(new LongLineCandle(), \"CDLLONGLINE\", testFileName).SetName(\"LongLineCandle-\" + testFileName));\n                    rows.Add(new TestCaseData(new Marubozu(), \"CDLMARUBOZU\", testFileName).SetName(\"Marubozu-\" + testFileName));\n                    rows.Add(new TestCaseData(new MatchingLow(), \"CDLMATCHINGLOW\", testFileName).SetName(\"MatchingLow-\" + testFileName));\n                    rows.Add(new TestCaseData(new MatHold(), \"CDLMATHOLD\", testFileName).SetName(\"MatHold-\" + testFileName));\n                    rows.Add(new TestCaseData(new MorningDojiStar(), \"CDLMORNINGDOJISTAR\", testFileName).SetName(\"MorningDojiStar-\" + testFileName));\n                    if (!testFileName.Contains(\"eurusd\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test does not pass with the eurusd test file \n                        rows.Add(new TestCaseData(new MorningStar(), \"CDLMORNINGSTAR\", testFileName).SetName(\"MorningStar-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new OnNeck(), \"CDLONNECK\", testFileName).SetName(\"OnNeck-\" + testFileName));\n                    rows.Add(new TestCaseData(new Piercing(), \"CDLPIERCING\", testFileName).SetName(\"Piercing-\" + testFileName));\n                    if (!testFileName.Contains(\"spy\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test does not pass with the spy test file \n                        rows.Add(new TestCaseData(new RickshawMan(), \"CDLRICKSHAWMAN\", testFileName).SetName(\"RickshawMan-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new RiseFallThreeMethods(), \"CDLRISEFALL3METHODS\", testFileName).SetName(\"RiseFallThreeMethods-\" + testFileName));\n                    rows.Add(new TestCaseData(new SeparatingLines(), \"CDLSEPARATINGLINES\", testFileName).SetName(\"SeparatingLines-\" + testFileName));\n                    rows.Add(new TestCaseData(new ShootingStar(), \"CDLSHOOTINGSTAR\", testFileName).SetName(\"ShootingStar-\" + testFileName));\n                    if (!testFileName.Contains(\"spy\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test does not pass with the spy test file \n                        rows.Add(new TestCaseData(new ShortLineCandle(), \"CDLSHORTLINE\", testFileName).SetName(\"ShortLineCandle-\" + testFileName));\n                    }\n                    if (!testFileName.Contains(\"spy\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test does not pass with the spy test file \n                        rows.Add(new TestCaseData(new SpinningTop(), \"CDLSPINNINGTOP\", testFileName).SetName(\"SpinningTop-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new StalledPattern(), \"CDLSTALLEDPATTERN\", testFileName).SetName(\"StalledPattern-\" + testFileName));\n                    if (testFileName.Contains(\"ewz\"))\n                    {\n                        // Lean uses decimals while TA-lib uses doubles, so this test only passes with the ewz test file \n                        rows.Add(new TestCaseData(new StickSandwich(), \"CDLSTICKSANDWICH\", testFileName).SetName(\"StickSandwich-\" + testFileName));\n                    }\n                    rows.Add(new TestCaseData(new Takuri(), \"CDLTAKURI\", testFileName).SetName(\"Takuri-\" + testFileName));\n                    rows.Add(new TestCaseData(new TasukiGap(), \"CDLTASUKIGAP\", testFileName).SetName(\"TasukiGap-\" + testFileName));\n                    rows.Add(new TestCaseData(new Thrusting(), \"CDLTHRUSTING\", testFileName).SetName(\"Thrusting-\" + testFileName));\n                    rows.Add(new TestCaseData(new Tristar(), \"CDLTRISTAR\", testFileName).SetName(\"Tristar-\" + testFileName));\n                    rows.Add(new TestCaseData(new UniqueThreeRiver(), \"CDLUNIQUE3RIVER\", testFileName).SetName(\"UniqueThreeRiver-\" + testFileName));\n                    rows.Add(new TestCaseData(new UpsideGapTwoCrows(), \"CDLUPSIDEGAP2CROWS\", testFileName).SetName(\"UpsideGapTwoCrows-\" + testFileName));\n                    rows.Add(new TestCaseData(new UpDownGapThreeMethods(), \"CDLXSIDEGAP3METHODS\", testFileName).SetName(\"UpDownGapThreeMethods-\" + testFileName));\n                }\n\n                return rows.ToArray();\n            }\n        }\n\n        [Test, TestCaseSource(nameof(PatternTestParameters))]\n        public void ComparesAgainstExternalData(IndicatorBase<IBaseDataBar> indicator, string columnName, string testFileName)\n        {\n            TestHelper.TestIndicator(indicator, testFileName, columnName, Assertion);\n        }\n\n        [Test, TestCaseSource(nameof(PatternTestParameters))]\n        public void ComparesAgainstExternalDataAfterReset(CandlestickPattern indicator, string columnName, string testFileName)\n        {\n            TestHelper.TestIndicator(indicator, testFileName, columnName, Assertion);\n            indicator.Reset();\n            TestHelper.TestIndicator(indicator, testFileName, columnName, Assertion);\n        }\n\n        [Test, TestCaseSource(nameof(PatternTestParameters))]\n        public void ResetsProperly(CandlestickPattern indicator, string columnName, string testFileName)\n        {\n            TestHelper.TestIndicatorReset(indicator, testFileName);\n        }\n\n        private static Action<IndicatorBase<IBaseDataBar>, double> Assertion\n        {\n            get\n            {\n                return (indicator, expected) =>\n                {\n                    // Trace line for debugging\n                    // Console.WriteLine(indicator.Current.EndTime + \"\\t\" + expected + \"\\t\" + indicator.Current.Value * 100);\n\n                    Assert.AreEqual(expected, (double) indicator.Current.Value * 100);\n                };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ChaikinMoneyFlowTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ChaikinMoneyFlowTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new ChaikinMoneyFlow(\"CMF\", 20);\n        }\n\n        protected override string TestFileName => \"spy_cmf.txt\";\n\n        protected override string TestColumnName => \"CMF_20\";\n        \n        [Test]\n        public void TestTradeBarsWithNoVolume()\n        {\n            // As volume is a multiplier in numerator, should return default value 0m.\n            var cmf = new ChaikinMoneyFlow(\"CMF\", 3);\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Volume = 0\n                };\n                cmf.Update(tradeBar); \n            }\n            Assert.AreEqual(cmf.Current.Value, 0m);\n        }\n        [Test]\n        public void TestDivByZero()\n        {\n            var cmf = new ChaikinMoneyFlow(\"CMF\", 3);\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                // Should handle High = Low case by returning 0m.\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = 1,\n                    Low = 1,\n                    Volume = 1\n                };\n                cmf.Update(tradeBar); \n            }\n            Assert.AreEqual(cmf.Current.Value, 0m);\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n      "
  },
  {
    "path": "Tests/Indicators/ChaikinOscillatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public class ChaikinOscillatorTests : AccumulationDistributionOscillatorTests\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new ChaikinOscillator(3, 10);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ChandeKrollStopTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ChandeKrollStopTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            return new ChandeKrollStop(5, 2.0m, 3);\n        }\n\n        protected override string TestFileName => \"spy_with_ChandeKrollStop.csv\";\n\n        protected override string TestColumnName => \"short_stop\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double)((ChandeKrollStop)indicator).ShortStop.Current.Value, 1e-6);\n\n\n        [Test]\n        public void CompareAgainstExternalDataForLongStop()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"long_stop\",\n                (ind, expected) => Assert.AreEqual(expected, (double) ((ChandeKrollStop) ind).LongStop.Current.Value, 1e-6)\n            );\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ChandeMomentumOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ChandeMomentumOscillatorTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new ChandeMomentumOscillator(5);\n        }\n\n        protected override string TestFileName => \"spy_cmo.txt\";\n\n        protected override string TestColumnName => \"CMO_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ChoppinessIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ChoppinessIndexTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            //VolumeRenkoBarSize = 0.5m;  // AcceptsVolumeRenkoBarsAsInput is hanging when uncommented\n            return new ChoppinessIndex(14);\n        }\n\n        protected override string TestFileName => \"spy_with_chop.csv\";\n\n        protected override string TestColumnName => \"CHOP14\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CommodityChannelIndexTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class CommodityChannelIndexTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new CommodityChannelIndex(14);\n        }\n\n        protected override string TestFileName => \"spy_with_cci.txt\";\n\n        protected override string TestColumnName => \"Commodity Channel Index (CCI) 14\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double) indicator.Current.Value, 1e-2);\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var cci = new CommodityChannelIndex(2);\n            cci.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today,\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            Assert.IsFalse(cci.IsReady);\n            cci.Update(new TradeBar\n            {\n                Symbol = Symbols.SPY,\n                Time = DateTime.Today.AddSeconds(1),\n                Open = 3m,\n                High = 7m,\n                Low = 2m,\n                Close = 5m,\n                Volume = 10\n            });\n            Assert.IsTrue(cci.IsReady);\n\n            cci.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(cci);\n            TestHelper.AssertIndicatorIsInDefaultState(cci.TypicalPriceAverage);\n            TestHelper.AssertIndicatorIsInDefaultState(cci.TypicalPriceMeanDeviation);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/CommonIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public abstract class CommonIndicatorTests<T>\n        where T : class, IBaseData\n    {\n        protected Symbol Symbol { get; set; } = Symbols.SPY;\n        protected List<Symbol> SymbolList = new List<Symbol>();\n        protected bool ValueCanBeZero { get; set; } = false;\n\n        [Test]\n        public virtual void ComparesAgainstExternalData()\n        {\n            var indicator = CreateIndicator();\n            RunTestIndicator(indicator);\n        }\n\n        [Test]\n        public virtual void ComparesAgainstExternalDataAfterReset()\n        {\n            var indicator = CreateIndicator();\n            RunTestIndicator(indicator);\n            indicator.Reset();\n            RunTestIndicator(indicator);\n        }\n\n        [Test]\n        public virtual void ResetsProperly()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<IndicatorDataPoint>)\n                TestHelper.TestIndicatorReset(indicator as IndicatorBase<IndicatorDataPoint>, TestFileName);\n            else if (indicator is IndicatorBase<IBaseDataBar>)\n                TestHelper.TestIndicatorReset(indicator as IndicatorBase<IBaseDataBar>, TestFileName);\n            else if (indicator is IndicatorBase<TradeBar>)\n                TestHelper.TestIndicatorReset(indicator as IndicatorBase<TradeBar>, TestFileName);\n            else\n                throw new NotSupportedException(\"ResetsProperly: Unsupported indicator data type: \" + typeof(T));\n        }\n\n        [Test]\n        public virtual void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            var startDate = new DateTime(2019, 1, 1);\n\n            for (var i = 0; i < period.Value; i++)\n            {\n                var input = GetInput(startDate, i);\n                indicator.Update(input);\n                Assert.AreEqual(i == period.Value - 1, indicator.IsReady);\n            }\n\n            Assert.AreEqual(period.Value, indicator.Samples);\n        }\n\n        protected QCAlgorithm CreateAlgorithm()\n        {\n            var algo = new QCAlgorithm();\n            algo.SetHistoryProvider(TestGlobals.HistoryProvider);\n            algo.SubscriptionManager.SetDataManager(new DataManagerStub(algo));\n            return algo;\n        }\n\n        [Test]\n        public virtual void WarmUpIndicatorProducesConsistentResults()\n        {\n            var algo = CreateAlgorithm();\n            algo.SetStartDate(2020, 1, 1);\n            algo.SetEndDate(2021, 2, 1);\n\n            SymbolList = GetSymbols();\n\n            var firstIndicator = CreateIndicator();\n            var period = (firstIndicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n            if (period == null || period == 0)\n            {\n                Assert.Ignore($\"{firstIndicator.Name}, Skipping this test because it's not applicable.\");\n            }\n            // Warm up the first indicator\n            algo.WarmUpIndicator(SymbolList, firstIndicator, Resolution.Daily);\n\n            // Warm up the second indicator manually\n            var secondIndicator = CreateIndicator();\n            var history = algo.History(SymbolList, period.Value, Resolution.Daily).ToList();\n            foreach (var slice in history)\n            {\n                foreach (var symbol in SymbolList)\n                {\n                    secondIndicator.Update(slice[symbol]);\n                }\n            }\n            SymbolList.Clear();\n\n            // Assert that the indicators are ready\n            Assert.IsTrue(firstIndicator.IsReady);\n            Assert.IsTrue(secondIndicator.IsReady);\n            if (!ValueCanBeZero)\n            {\n                Assert.AreNotEqual(firstIndicator.Current.Value, 0);\n            }\n\n            // Ensure that the first indicator has processed some data\n            Assert.AreNotEqual(firstIndicator.Samples, 0);\n\n            // Validate that both indicators have the same number of processed samples\n            Assert.AreEqual(firstIndicator.Samples, secondIndicator.Samples);\n\n            // Validate that both indicators produce the same final computed value\n            Assert.AreEqual(firstIndicator.Current.Value, secondIndicator.Current.Value);\n        }\n\n        [Test]\n        public virtual void TimeMovesForward()\n        {\n            var indicator = CreateIndicator();\n            var startDate = new DateTime(2019, 1, 1);\n\n            for (var i = 10; i > 0; i--)\n            {\n                var input = GetInput(startDate, i);\n                indicator.Update(input);\n            }\n\n            Assert.AreEqual(1, indicator.Samples);\n        }\n\n        [Test]\n        public virtual void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<TradeBar> ||\n                indicator is IndicatorBase<IBaseData> ||\n                indicator is BarIndicator ||\n                indicator is IndicatorBase<IBaseDataBar>)\n            {\n                var renkoConsolidator = new RenkoConsolidator(RenkoBarSize);\n                renkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                TestHelper.UpdateRenkoConsolidator(renkoConsolidator, TestFileName);\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveRenkoBars(indicator);\n                renkoConsolidator.Dispose();\n            }\n        }\n\n        [Test]\n        public virtual void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<TradeBar> ||\n                indicator is IndicatorBase<IBaseData> ||\n                indicator is BarIndicator ||\n                indicator is IndicatorBase<IBaseDataBar>)\n            {\n                var volumeRenkoConsolidator = new VolumeRenkoConsolidator(VolumeRenkoBarSize);\n                volumeRenkoConsolidator.DataConsolidated += (sender, volumeRenkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(volumeRenkoBar));\n                };\n\n                TestHelper.UpdateRenkoConsolidator(volumeRenkoConsolidator, TestFileName);\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(indicator);\n                volumeRenkoConsolidator.Dispose();\n            }\n        }\n\n        [Test]\n        public virtual void TracksPreviousState()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            var startDate = new DateTime(2024, 1, 1);\n            var previousValue = indicator.Current.Value;\n\n            // Update the indicator and verify the previous values\n            for (var i = 0; i < 2 * period; i++)\n            {\n                indicator.Update(GetInput(startDate, i));\n\n                // Verify the previous value matches the indicator's previous value\n                Assert.AreEqual(previousValue, indicator.Previous.Value);\n\n                // Update previousValue to the current value for the next iteration\n                previousValue = indicator.Current.Value;\n            }\n        }\n\n        [Test]\n        public virtual void WorksWithLowValues()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            var random = new Random();\n            var time = new DateTime(2023, 5, 28);\n            for (int i = 0; i < 2 * period; i++)\n            {\n                var value = (decimal)(random.NextDouble() * 0.000000000000000000000000000001);\n                Assert.DoesNotThrow(() => indicator.Update(GetInput(Symbol, time, i, value, value, value, value)));\n            }\n        }\n\n        [Test]\n        public virtual void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            var startDate = new DateTime(2024, 1, 1);\n\n            for (var i = 0; i < 2 * period; i++)\n            {\n                // Feed input data to the indicator, each input uses Symbol.SPY\n                indicator.Update(GetInput(startDate, i));\n\n                // The indicator should retain the symbol from the input (SPY)\n                Assert.AreEqual(Symbols.SPY, indicator.Current.Symbol);\n            }\n        }\n\n        protected virtual void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n\n        protected virtual void IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(IndicatorBase indicator)\n        {\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n\n        protected static IBaseData GetInput(DateTime startDate, int days) => GetInput(Symbols.SPY, startDate, days);\n\n        protected static IBaseData GetInput(Symbol symbol, DateTime startDate, int days) => GetInput(symbol, startDate, days, 100m + days, 105m + days, 95m + days, 100 + days);\n\n        protected static IBaseData GetInput(Symbol symbol, DateTime startDate, int days, decimal open, decimal high, decimal low, decimal close)\n        {\n            if (typeof(T) == typeof(IndicatorDataPoint))\n            {\n                return new IndicatorDataPoint(symbol, startDate.AddDays(days), close);\n            }\n\n            return new TradeBar(\n                startDate.AddDays(days),\n                symbol,\n                open,\n                high,\n                low,\n                close,\n                100m,\n                Time.OneDay\n            );\n        }\n\n        public PyObject GetIndicatorAsPyObject()\n        {\n            using (Py.GIL())\n            {\n                return Indicator.ToPython();\n            }\n        }\n\n        public IndicatorBase<T> Indicator => CreateIndicator();\n\n        /// <summary>\n        /// Executes a test of the specified indicator\n        /// </summary>\n        protected virtual void RunTestIndicator(IndicatorBase<T> indicator)\n        {\n            if (indicator is IndicatorBase<IndicatorDataPoint>)\n                TestHelper.TestIndicator(\n                    indicator as IndicatorBase<IndicatorDataPoint>,\n                    TestFileName,\n                    TestColumnName,\n                    Assertion as Action<IndicatorBase<IndicatorDataPoint>, double>\n                );\n            else if (indicator is IndicatorBase<IBaseDataBar>)\n                TestHelper.TestIndicator(\n                    indicator as IndicatorBase<IBaseDataBar>,\n                    TestFileName,\n                    TestColumnName,\n                    Assertion as Action<IndicatorBase<IBaseDataBar>, double>\n                );\n            else if (indicator is IndicatorBase<TradeBar>)\n                TestHelper.TestIndicator(\n                    indicator as IndicatorBase<TradeBar>,\n                    TestFileName,\n                    TestColumnName,\n                    Assertion as Action<IndicatorBase<TradeBar>, double>);\n            else\n                throw new NotSupportedException(\"RunTestIndicator: Unsupported indicator data type: \" + typeof(T));\n        }\n\n        /// <summary>\n        /// Returns a custom assertion function, parameters are the indicator and the expected value from the file\n        /// </summary>\n        protected virtual Action<IndicatorBase<T>, double> Assertion\n        {\n            get\n            {\n                return (indicator, expected) =>\n                {\n                    Assert.AreEqual(expected, (double)indicator.Current.Value, 1e-3);\n\n                    var relativeDifference = Math.Abs(((double)indicator.Current.Value - expected) / expected);\n                    Assert.LessOrEqual(relativeDifference, 1); // less than 1% error rate\n                };\n            }\n        }\n\n        /// <summary>\n        /// Returns a new instance of the indicator to test\n        /// </summary>\n        protected abstract IndicatorBase<T> CreateIndicator();\n\n        /// <summary>\n        /// Returns the CSV file name containing test data for the indicator\n        /// </summary>\n        protected abstract string TestFileName { get; }\n\n        /// <summary>\n        /// Returns the name of the column of the CSV file corresponding to the pre-calculated data for the indicator\n        /// </summary>\n        protected abstract string TestColumnName { get; }\n\n        /// <summary>\n        /// Returns the list of symbols used for testing, defaulting to SPY.\n        /// </summary>\n        protected virtual List<Symbol> GetSymbols() => [Symbols.SPY];\n\n        /// <summary>\n        /// Returns the BarSize for the RenkoBar test, namely, AcceptsRenkoBarsAsInput()\n        /// </summary>\n        protected decimal RenkoBarSize { get; set; } = 10m;\n\n        /// <summary>\n        /// Returns the BarSize for the VolumeRenkoBar test, namely, AcceptsVolumeRenkoBarsAsInput()\n        /// </summary>\n        protected decimal VolumeRenkoBarSize { get; set; } = 500000m;\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CompositeIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class CompositeIndicatorTests\n    {\n        [Test]\n        public void CompositeIsReadyWhenBothAre()\n        {\n            var left = new Delay(1);\n            var right = new Delay(2);\n            var composite = CreateCompositeIndicator(left, right, (l, r) => l.Current.Value + r.Current.Value);\n\n            left.Update(DateTime.Today.AddSeconds(0), 1m);\n            right.Update(DateTime.Today.AddSeconds(0), 1m);\n            Assert.IsFalse(composite.IsReady);\n            Assert.IsFalse(composite.Left.IsReady);\n            Assert.IsFalse(composite.Right.IsReady);\n\n            left.Update(DateTime.Today.AddSeconds(1), 2m);\n            right.Update(DateTime.Today.AddSeconds(1), 2m);\n            Assert.IsFalse(composite.IsReady);\n            Assert.IsTrue(composite.Left.IsReady);\n            Assert.IsFalse(composite.Right.IsReady);\n\n            left.Update(DateTime.Today.AddSeconds(2), 3m);\n            right.Update(DateTime.Today.AddSeconds(2), 3m);\n            Assert.IsTrue(composite.IsReady);\n            Assert.IsTrue(composite.Left.IsReady);\n            Assert.IsTrue(composite.Right.IsReady);\n\n            left.Update(DateTime.Today.AddSeconds(3), 4m);\n            right.Update(DateTime.Today.AddSeconds(3), 4m);\n            Assert.IsTrue(composite.IsReady);\n            Assert.IsTrue(composite.Left.IsReady);\n            Assert.IsTrue(composite.Right.IsReady);\n        }\n\n        [Test]\n        public void CallsDelegateCorrectly()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = CreateCompositeIndicator(left, right, (l, r) =>\n            {\n                Assert.AreEqual(left, l);\n                Assert.AreEqual(right, r);\n                return l.Current.Value + r.Current.Value;\n            });\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, 1m);\n            Assert.AreEqual(2m, composite.Current.Value);\n        }\n\n        [Test]\n        public virtual void ResetsProperly()\n        {\n            var left = new Maximum(\"left\", 2);\n            var right = new Minimum(\"right\", 2);\n            var composite = CreateCompositeIndicator(left, right, (l, r) => l.Current.Value + r.Current.Value);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, -1m);\n\n            left.Update(DateTime.Today.AddDays(1), -1m);\n            right.Update(DateTime.Today.AddDays(1), 1m);\n\n            Assert.AreEqual(left.PeriodsSinceMaximum, 1);\n            Assert.AreEqual(right.PeriodsSinceMinimum, 1);\n\n            composite.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(composite);\n            TestHelper.AssertIndicatorIsInDefaultState(left);\n            TestHelper.AssertIndicatorIsInDefaultState(right);\n            Assert.AreEqual(left.PeriodsSinceMaximum, 0);\n            Assert.AreEqual(right.PeriodsSinceMinimum, 0);\n        }\n\n        [TestCase(\"sum\", 5, 10, 15, false)]\n        [TestCase(\"min\", -12, 52, -12, false)]\n        [TestCase(\"sum\", 5, 10, 15, true)]\n        [TestCase(\"min\", -12, 52, -12, true)]\n        public virtual void PythonCompositeIndicatorConstructorValidatesBehavior(string operation, decimal leftValue, decimal rightValue, decimal expectedValue, bool usePythonIndicator)\n        {\n            var left = new SimpleMovingAverage(\"SMA\", 10);\n            var right = new SimpleMovingAverage(\"SMA\", 10);\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Indicators import *\n\ndef create_composite_indicator(left, right, operation):\n    if operation == 'sum':\n        def composer(l, r):\n            return IndicatorResult(l.current.value + r.current.value)\n    elif operation == 'min':\n        def composer(l, r):\n            return IndicatorResult(min(l.current.value, r.current.value))\n    return CompositeIndicator(left, right, composer)\n\ndef update_indicators(left, right, value_left, value_right):\n    left.update(IndicatorDataPoint(DateTime.Now, value_left))\n    right.update(IndicatorDataPoint(DateTime.Now, value_right))\n            \");\n\n                using var createCompositeIndicator = testModule.GetAttr(\"create_composite_indicator\");\n                using var updateIndicators = testModule.GetAttr(\"update_indicators\");\n\n                using var leftPy = usePythonIndicator ? CreatePyObjectIndicator(10) : left.ToPython();\n                using var rightPy = usePythonIndicator ? CreatePyObjectIndicator(10) : right.ToPython();\n\n                // Create composite indicator using Python logic\n                using var composite = createCompositeIndicator.Invoke(leftPy, rightPy, operation.ToPython());\n\n                // Update the indicator with sample values (left, right)\n                updateIndicators.Invoke(leftPy, rightPy, leftValue.ToPython(), rightValue.ToPython());\n\n                // Verify composite indicator name and properties\n                using var name = composite.GetAttr(\"Name\");\n                Assert.AreEqual($\"COMPOSE({left.Name},{right.Name})\", name.ToString());\n\n                // Validate the composite indicator's computed value\n                using var value = composite.GetAttr(\"Current\").GetAttr(\"Value\");\n                Assert.AreEqual(expectedValue, value.As<decimal>());\n            }\n        }\n\n        private static PyObject CreatePyObjectIndicator(int period)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    \"custom_indicator\",\n                    @\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, period):\n        self.name = 'SMA'\n        self.value = 0\n        self.period = period\n        self.warm_up_period = period\n        self.queue = deque(maxlen=period)\n        self.current = IndicatorDataPoint(DateTime.Now, self.value)\n\n    def update(self, input):\n        self.queue.appendleft(input.value)\n        count = len(self.queue)\n        self.value = sum(self.queue) / count\n        self.current = IndicatorDataPoint(input.time, self.value)\n        self.on_updated(IndicatorDataPoint(DateTime.Now, input.value))\n\"\n                );\n\n                var indicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                                  .Invoke(period.ToPython());\n\n                return indicator;\n            }\n        }\n\n        protected virtual CompositeIndicator CreateCompositeIndicator(IndicatorBase left, IndicatorBase right, QuantConnect.Indicators.CompositeIndicator.IndicatorComposer composer)\n        {\n            return new CompositeIndicator(left, right, composer);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ConnorsRelativeStrengthIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ConnorsRelativeStrengthIndexTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new ConnorsRelativeStrengthIndex(3, 2, 100);\n        }\n        protected override string TestFileName => \"spy_crsi.csv\";\n\n        protected override string TestColumnName => \"crsi\";\n\n        [Test]\n        public void DoesNotThrowDivisionByZero()\n        {\n            var crsi = new ConnorsRelativeStrengthIndex(2, 2, 2);\n            for (var i = 0; i < 10; i++)\n            {\n                Assert.DoesNotThrow(() => crsi.Update(DateTime.UtcNow, 0m));\n            }\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var rsiPeriod = 2;\n            var rsiPeriodStreak = 3;\n            var lookBackPeriod = 4;\n            var crsi = new ConnorsRelativeStrengthIndex(rsiPeriod, rsiPeriodStreak, lookBackPeriod);\n            int minInputValues = Math.Max(rsiPeriod, Math.Max(rsiPeriodStreak, lookBackPeriod));\n            for (int i = 0; i < minInputValues; i++)\n            {\n                Assert.IsFalse(crsi.IsReady);\n                crsi.Update(DateTime.Now, i + 1);\n            }\n            Assert.IsTrue(crsi.IsReady);\n        }\n\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ConstantIndicatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ConstantIndicatorTests\n    {\n        [Test]\n        public void ComputesCorrectly()\n        {\n            var cons = new ConstantIndicator<IndicatorDataPoint>(\"c\", 1m);\n            Assert.AreEqual(1m, cons.Current.Value);\n            Assert.IsTrue(cons.IsReady);\n\n            cons.Update(DateTime.Today, 3m);\n            Assert.AreEqual(1m, cons.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            // constant reset should reset samples but the value should still be the same\n            var cons = new ConstantIndicator<IndicatorDataPoint>(\"c\", 1m);\n            cons.Update(DateTime.Today, 3m);\n            cons.Update(DateTime.Today.AddDays(1), 10m);\n\n            cons.Reset();\n            Assert.AreEqual(1m, cons.Current.Value);\n            Assert.AreEqual(DateTime.MinValue, cons.Current.Time);\n            Assert.AreEqual(0, cons.Samples);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CoppockCurveTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class CoppockCurveTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new CoppockCurve();\n        }\n\n        protected override string TestFileName => \"spy_coppock_curve.csv\";\n        protected override string TestColumnName => \"CoppockCurve\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/CorrelationPearsonTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class CorrelationPearsonTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override string TestFileName => \"spy_qqq_corr.csv\";\n\n        private DateTime _reference = new DateTime(2020, 1, 1);\n\n        protected CorrelationType _correlationType { get; set; } = CorrelationType.Pearson;\n        protected override string TestColumnName => (_correlationType == CorrelationType.Pearson) ? \"Correlation_Pearson\" : \"Correlation_Spearman\";\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            Symbol symbolA = Symbols.SPY;\n            Symbol symbolB = \"QQQ RIWIV7K5Z9LX\";\n            if (SymbolList.Count > 1)\n            {\n                symbolA = SymbolList[0];\n                symbolB = SymbolList[1];\n            }\n#pragma warning disable CS0618\n            var indicator = new Correlation(\"testCorrelationIndicator\", symbolA, symbolB, 252, _correlationType);\n#pragma warning restore CS0618\n            return indicator;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL];\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = new Correlation(\"testCorrelationIndicator\", Symbols.IBM, Symbols.SPY, 5, _correlationType);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = new Correlation(\"testCorrelationIndicator\", Symbols.IBM, Symbols.SPY, 5, _correlationType);\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            for (var i = 0; i < period.Value; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2 * period.Value, indicator.Samples);\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = new Correlation(Symbols.SPY, \"QQQ RIWIV7K5Z9LX\", 70, _correlationType);\n            var firstRenkoConsolidator = new RenkoConsolidator(10m);\n            var secondRenkoConsolidator = new RenkoConsolidator(10m);\n            firstRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n            int counter = 0;\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"SPY\")\n                {\n                    firstRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondRenkoConsolidator.Update(tradebar);\n                    counter++;\n                }\n                if (counter >= 100)\n                    break;\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstRenkoConsolidator.Dispose();\n            secondRenkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var firstVolumeRenkoConsolidator = new VolumeRenkoConsolidator(100000);\n            var secondVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000);\n            firstVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n            int counter = 0;\n            foreach (var parts in GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"SPY\")\n                {\n                    firstVolumeRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondVolumeRenkoConsolidator.Update(tradebar);\n                    counter++;\n                }\n                if (counter >= 500)\n                    break;\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstVolumeRenkoConsolidator.Dispose();\n            secondVolumeRenkoConsolidator.Dispose();\n        }\n        [Test]\n        public void AcceptsQuoteBarsAsInput()\n        {\n            var indicator = new Correlation(\"testCorrelationIndicator\", Symbols.IBM, Symbols.SPY, 5, _correlationType);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new QuoteBar { Symbol = Symbols.IBM, Ask = new Bar(1, 2, 1, 500), Bid = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n                indicator.Update(new QuoteBar { Symbol = Symbols.SPY, Ask = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public void EqualCorrelationValue()\n        {\n            var indicator = new Correlation(\"testCorrelationIndicator\", Symbols.AAPL, Symbols.SPX, 3, _correlationType);\n\n            for (int i = 0; i < 3; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n            }\n\n            Assert.AreEqual(1, (double)indicator.Current.Value);\n        }\n\n        [Test]\n        public void NotEqualCorrelationValue()\n        {\n            var indicator = new Correlation(\"testCorrelationIndicator\", Symbols.AAPL, Symbols.SPX, 3, _correlationType);\n\n            for (int i = 0; i < 3; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = i + 2, Time = startTime, EndTime = endTime });\n            }\n\n            Assert.AreNotEqual(0, (double)indicator.Current.Value);\n        }\n\n        [Test]\n        public void CorrelationWithDifferentTimeZones()\n        {\n            var indicator = new Correlation(Symbols.SPY, Symbols.BTCUSD, 3);\n\n            for (int i = 0; i < 10; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.BTCUSD, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n            }\n            Assert.AreEqual(1, (double)indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CorrelationSpearmanTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class CorrelationSpearmanTests : CorrelationPearsonTests\n    { \n        public CorrelationSpearmanTests()\n        {\n            _correlationType = CorrelationType.Spearman;\n        }\n        \n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/CovarianceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing MathNet.Numerics.Statistics;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class CovarianceTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override string TestFileName => \"spy_qqq_cov.csv\";\n\n        protected override string TestColumnName => \"Covariance\";\n\n        private DateTime _reference = new DateTime(2020, 1, 1);\n\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            Symbol symbolA;\n            Symbol symbolB;\n            if (SymbolList.Count > 1)\n            {\n                symbolA = SymbolList[0];\n                symbolB = SymbolList[1];\n            }\n            else\n            {\n                symbolA = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n                symbolB = Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA);\n            }\n            var indicator = new Covariance(\"testCovarianceIndicator\", symbolA, symbolB, 252);\n            return indicator;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            var QQQ = Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA);\n            return [Symbols.SPY, QQQ];\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = new Covariance(\"testCovarianceIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = new Covariance(\"testCovarianceIndicator\", Symbols.IBM, Symbols.SPY, 5);\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            for (var i = 0; i < period.Value; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2 * period.Value, indicator.Samples);\n        }\n\n        [Test]\n        public override void WorksWithLowValues()\n        {\n            SymbolList = GetSymbols();\n            Symbol = SymbolList[1];\n            base.WorksWithLowValues();\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = new Covariance(\"testCovarianceIndicator\", Symbols.SPY, Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), 5);\n            var firstRenkoConsolidator = new RenkoConsolidator(10m);\n            var secondRenkoConsolidator = new RenkoConsolidator(10m);\n            firstRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName).Take(50))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"SPY\")\n                {\n                    firstRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstRenkoConsolidator.Dispose();\n            secondRenkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = new Covariance(\"testCovarianceIndicator\", Symbols.SPY, Symbol.Create(\"QQQ\", SecurityType.Equity, Market.USA), 5);\n            var firstVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000);\n            var secondVolumeRenkoConsolidator = new VolumeRenkoConsolidator(1000000000);\n            firstVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            secondVolumeRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in GetCsvFileStream(TestFileName).Take(50))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Symbol.Value == \"SPY\")\n                {\n                    firstVolumeRenkoConsolidator.Update(tradebar);\n                }\n                else\n                {\n                    secondVolumeRenkoConsolidator.Update(tradebar);\n                }\n            }\n\n            // With VolumeRenkoConsolidator(1000000000), limited data won't produce enough bars\n            // The test verifies the indicator accepts the input, not that it becomes ready\n            Assert.AreNotEqual(0, indicator.Samples);\n            firstVolumeRenkoConsolidator.Dispose();\n            secondVolumeRenkoConsolidator.Dispose();\n        }\n\n\n        [Test]\n        public void AcceptsQuoteBarsAsInput()\n        {\n            var indicator = new Covariance(\"testCovarianceIndicator\", Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new QuoteBar { Symbol = Symbols.IBM, Ask = new Bar(1, 2, 1, 500), Bid = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n                indicator.Update(new QuoteBar { Symbol = Symbols.SPY, Ask = new Bar(1, 2, 1, 500), Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n        \n        [Test]\n        public void ValidateCovarianceCalculation()\n        {\n            var cov = new Covariance(Symbols.AAPL, Symbols.SPX, 3);\n\n            var values = new List<TradeBar>()\n            {\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 10, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 35, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2),EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2), EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 15, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 80, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 37, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 90, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 105, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 302, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n            };\n\n            // Calculating covariance manually\n            var closeAAPL = new List<double>() { 10, 15, 90, 105 };\n            var closeSPX = new List<double>() { 35, 80, 37, 302 };\n            var priceChangesAAPL = new List<double>();\n            var priceChangesSPX = new List<double>();\n            for (int i = 1; i < 4; i++)\n            {\n                priceChangesAAPL.Add((closeAAPL[i] - closeAAPL[i - 1]) / closeAAPL[i - 1]);\n                priceChangesSPX.Add((closeSPX[i] - closeSPX[i - 1]) / closeSPX[i - 1]);\n            }\n            var expectedCovariance = priceChangesAAPL.Covariance(priceChangesSPX);\n\n            // Calculating covariance using the indicator\n            for (int i = 0; i < values.Count; i++)\n            {\n                cov.Update(values[i]);\n            }\n\n            Assert.AreEqual((decimal)expectedCovariance, cov.Current.Value);\n        }\n\n        [Test]\n        public void CovarianceWithDifferentTimeZones()\n        {\n            var indicator = new Covariance(Symbols.SPY, Symbols.BTCUSD, 5);\n\n            for (int i = 0; i < 10; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.BTCUSD, Low = 1, High = 2, Volume = 100, Close = i + 1, Time = startTime, EndTime = endTime });\n            }\n            // All close prices are increasing by constant amount, so returns are decreasing but positive.\n            // Both assets have same prices, so covariance should be equal to variance of either.\n             Assert.IsTrue(indicator.Current.Value > 0);\n        }\n\n        [Test]\n        public override void TracksPreviousState()\n        {\n            var period = 5;\n            var indicator = new Covariance(Symbols.SPY, Symbols.AAPL, period);\n            var previousValue = indicator.Current.Value;\n\n            // Update the indicator and verify the previous values\n            for (var i = 1; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                // Verify the previous value matches the indicator's previous value\n                Assert.AreEqual(previousValue, indicator.Previous.Value);\n\n                // Update previousValue to the current value for the next iteration\n                previousValue = indicator.Current.Value;\n            }\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var period = 5;\n            var indicator = new Covariance(Symbols.SPY, Symbols.AAPL, period);\n\n            for (var i = 0; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                // Update with the first symbol (SPY) — indicator.Current.Symbol should reflect this update\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.SPY, indicator.Current.Symbol);\n\n                // Update with the first symbol (AAPL) — indicator.Current.Symbol should reflect this update\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                Assert.AreEqual(Symbols.AAPL, indicator.Current.Symbol);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/DeMarkerIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DeMarkerIndicatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.001m;\n            VolumeRenkoBarSize = 1000m;\n            return new DeMarkerIndicator(\"DEM\", 14);\n        }\n        \n        protected override string TestFileName => \"eurusd60_dem.txt\";\n\n        protected override string TestColumnName => \"dem\";\n        \n        [Test]\n        public void TestDivByZero()\n        {\n            var dem = new DeMarkerIndicator(\"DEM\", 3);\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                // Should handle High = Low case by returning 0m.\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = 1,\n                    Low = 1,\n                    Volume = 1\n                };\n                dem.Update(tradeBar); \n            }\n            Assert.AreEqual(dem.Current.Value, 0m);\n        }\n    }\n}\n      \n"
  },
  {
    "path": "Tests/Indicators/DelayTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DelayTests\n    {\n        [Test]\n        public void DelayZeroThrowsArgumentException()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                new Delay(0);\n            }, \"size of at least 1\");\n        }\n\n        [Test]\n        public void DelayOneRepeatsFirstInputValue()\n        {\n            var delay = new Delay(1);\n\n            var data = new IndicatorDataPoint(DateTime.UtcNow, 1m);\n            delay.Update(data);\n            Assert.AreEqual(1m, delay.Current.Value);\n\n            data = new IndicatorDataPoint(DateTime.UtcNow.AddSeconds(1), 2m);\n            delay.Update(data);\n            Assert.AreEqual(1m, delay.Current.Value);\n\n            data = new IndicatorDataPoint(DateTime.UtcNow.AddSeconds(1), 2m);\n            delay.Update(data);\n            Assert.AreEqual(2m, delay.Current.Value);\n        }\n\n        [Test]\n        public void DelayTakesPeriodPlus2UpdatesToEmitNonInitialPoint()\n        {\n            const int start = 1;\n            const int count = 10;\n            for (var i = start; i < count+start; i++)\n            {\n                TestDelayTakesPeriodPlus2UpdatesToEmitNonInitialPoint(i);\n            }\n        }\n\n        private void TestDelayTakesPeriodPlus2UpdatesToEmitNonInitialPoint(int period)\n        {\n            var delay = new Delay(period);\n            for (var i = 0; i < period + 2; i++)\n            {\n                Assert.AreEqual(0m, delay.Current.Value);\n                delay.Update(new IndicatorDataPoint(DateTime.Today.AddSeconds(i), i));\n            }\n            Assert.AreEqual(1m, delay.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var delay = new Delay(2);\n\n            foreach (var data in TestHelper.GetDataStream(3))\n            {\n                delay.Update(data);\n            }\n            Assert.IsTrue(delay.IsReady);\n            Assert.AreEqual(3, delay.Samples);\n\n            delay.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(delay);\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            var delay = new Delay(20);\n            var count = ((IIndicatorWarmUpPeriodProvider) delay).WarmUpPeriod;\n            var dataArray = TestHelper.GetDataStream(count).ToArray();\n\n            for (var i = 0; i < count; i++)\n            {\n                delay.Update(dataArray[i]);\n                Assert.AreEqual(i == count - 1, delay.IsReady);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/DeltaTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class DeltaTests : OptionBaseIndicatorTests<Delta>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n            => new Delta(\"testDeltaIndicator\", _symbol, 0.0403m, 0.0m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new Delta(\"testDeltaIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new Delta(\"testDeltaIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.D(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            // 2 updates per iteration, 1 for greek, 1 for IV\n            RiskFreeRateUpdatesPerIteration = 2;\n            DividendYieldUpdatesPerIteration = 2;\n        }\n\n        [TestCase(\"american/third_party_1_greeks.csv\", true, false, 0.03)]\n        [TestCase(\"american/third_party_1_greeks.csv\", false, false, 0.03)]\n        // Just placing the test and data here, we are unsure about the smoothing function and not going to reverse engineer\n        [TestCase(\"american/third_party_2_greeks.csv\", false, true, 10000)]\n        public void ComparesAgainstExternalData(string subPath, bool reset, bool singleContract, double errorRate, double errorMargin = 1e-4,\n            int callColumn = 9, int putColumn = 8)\n        {\n            var path = Path.Combine(\"TestData\", \"greeksindicator\", subPath);\n            // skip last entry since for deep ITM, IV will not affect much on price. Thus root finding will not be optimizing a non-convex function.\n            foreach (var line in File.ReadAllLines(path).Skip(3).SkipLast(1))\n            {\n                var items = line.Split(',');\n\n                var interestRate = Parse.Decimal(items[^2]);\n                var dividendYield = Parse.Decimal(items[^1]);\n\n                var model = ParseSymbols(items, path.Contains(\"american\"), out var call, out var put);\n\n                Delta callIndicator;\n                Delta putIndicator;\n                if (singleContract)\n                {\n                    callIndicator = new Delta(call, interestRate, dividendYield, optionModel: model);\n                    putIndicator = new Delta(put, interestRate, dividendYield, optionModel: model);\n                }\n                else\n                {\n                    callIndicator = new Delta(call, interestRate, dividendYield, put, model);\n                    putIndicator = new Delta(put, interestRate, dividendYield, call, model);\n                }\n\n                RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n\n                if (reset == true)\n                {\n                    callIndicator.Reset();\n                    putIndicator.Reset();\n\n                    RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n                }\n            }\n        }\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.546, OptionStyle.European)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.446, OptionStyle.European)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.693, OptionStyle.European)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.260, OptionStyle.European)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.243, OptionStyle.European)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.526, OptionStyle.European)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 0.632, OptionStyle.European)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -0.417, OptionStyle.European)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 0.765, OptionStyle.European)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.052, OptionStyle.European)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.263, OptionStyle.European)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -0.556, OptionStyle.European)]\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.546, OptionStyle.American)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.446, OptionStyle.American)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.693, OptionStyle.American)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.260, OptionStyle.American)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.243, OptionStyle.American)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.526, OptionStyle.American)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 0.632, OptionStyle.American)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -0.417, OptionStyle.American)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 0.765, OptionStyle.American)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.052, OptionStyle.American)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.264, OptionStyle.American)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -0.556, OptionStyle.American)]\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refDelta, OptionStyle style)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, _reference.AddDays(expiry));\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Delta(symbol, 0.0403m, 0.0m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refDelta, (double)indicator.Current.Value, 0.0017d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 15)]\n        [TestCase(15, 450.0, OptionRight.Call, 0)]\n        [TestCase(15, 450.0, OptionRight.Call, 5)]\n        [TestCase(15, 450.0, OptionRight.Call, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, expiration);\n            var indicator = new Delta(symbol, 0.0403m, 0.0m,\n                optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/DerivativeOscillatorIndicatorTests.cs",
    "content": "/*\n* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators;\n\n[TestFixture]\npublic class DerivativeOscillatorIndicatorTests : CommonIndicatorTests<IndicatorDataPoint>\n{\n    protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n    {\n        return new DerivativeOscillator(\"D014\", 14, 5, 3, 9);\n    }\n\n    protected override string TestFileName => \"spy_do.csv\";\n\n    protected override string TestColumnName => \"DO\";\n\n    [Test]\n    public override void ResetsProperly()\n    {\n        var derivativeOscillator = new DerivativeOscillator(\"D014\", 14, 5, 3, 9);\n        var period = derivativeOscillator.WarmUpPeriod;\n\n        // Generate a stream of random data and calculate the derivative oscillator\n        var seed = 14;\n        Random rand = new Random(seed);\n        var reference = DateTime.Today;\n        for(int i = 0; i < period; i++) \n        {\n            var data = new IndicatorDataPoint(reference.AddSeconds(i), rand.Next());\n            derivativeOscillator.Update(data);\n        }\n\n        var expected = derivativeOscillator.Current.Value;\n        \n        Assert.IsTrue(derivativeOscillator.IsReady);\n        Assert.AreNotEqual(0m, derivativeOscillator.Current.Value);\n        Assert.AreNotEqual(0, derivativeOscillator.Samples);\n\n        // Now do some partial updates\n        for(int i = 0; i < 5; i++)\n        {\n            var data = new IndicatorDataPoint(reference.AddSeconds(i), rand.Next());\n            derivativeOscillator.Update(data);\n        }\n        \n        // Check if reset functionality works\n        derivativeOscillator.Reset();\n        TestHelper.AssertIndicatorIsInDefaultState(derivativeOscillator);\n\n        // Update using the exact same random data stream again to verify if internals were reset properly\n        // But now insert data until it is ready.\n        rand = new Random(seed);\n        reference = DateTime.Today;\n        int j = 0;\n        while (!derivativeOscillator.IsReady)\n        {\n            var data = new IndicatorDataPoint(reference.AddSeconds(j), rand.Next());\n            derivativeOscillator.Update(data);\n            j++;\n        }\n\n        Assert.IsTrue(derivativeOscillator.IsReady);\n        Assert.AreNotEqual(0m, derivativeOscillator.Current.Value);\n        Assert.AreNotEqual(0, derivativeOscillator.Samples);\n\n        // If they are not equal, the internal indicators were not reset properly\n        Assert.AreEqual(expected, derivativeOscillator.Current.Value);\n    }\n\n    [Test]\n    public void ComparesWithExternalData()\n    {\n        TestHelper.TestIndicator(\n            CreateIndicator(),\n            TestFileName,\n            TestColumnName,\n            (ind, expected) => Assert.AreEqual(expected, (double)((DerivativeOscillator)ind).Current.Value, 1e-9)\n        );\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/DetrendedPriceOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DetrendedPriceOscillatorTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override string TestColumnName => \"DPO\";\n\n        protected override string TestFileName => \"spy_dpo.csv\";\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new DetrendedPriceOscillator(period: 21);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/DonchianChannelTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DonchianChannelTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new DonchianChannel(50);\n        }\n\n        protected override string TestFileName => \"spy_with_don50.txt\";\n\n        protected override string TestColumnName => \"Donchian Channels 50 Mean\";\n\n        [Test]\n        public void CompareAgainstExternalDataForUpperBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Donchian Channels 50 Top\",\n                (ind, expected) => Assert.AreEqual(expected, (double) ((DonchianChannel) ind).UpperBand.Current.Value)\n            );\n        }\n\n        [Test]\n        public void CompareAgainstExternalDataForLowerBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Donchian Channels 50 Bottom\",\n                (ind, expected) => Assert.AreEqual(expected, (double) ((DonchianChannel) ind).LowerBand.Current.Value)\n            );\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/DoubleExponentialMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DoubleExponentialMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new DoubleExponentialMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_dema.txt\";\n\n        protected override string TestColumnName => \"DEMA_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/DualSymbolIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class DualSymbolIndicatorTests\n    {\n        private DateTime _reference = new DateTime(2020, 1, 1);\n\n        [Test]\n        public void TimeMovesForward()\n        {\n            var indicator = new TestAverageIndicator(Symbols.IBM, Symbols.SPY, 5);\n\n            for (var i = 10; i > 0; i--)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 500, Time = _reference.AddDays(1 + i) });\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public void ValidateCalculation()\n        {\n            var indicator = new TestAverageIndicator(Symbols.AAPL, Symbols.SPX, 3);\n\n            var bars = new List<TradeBar>()\n            {\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 10, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 35, Time = _reference.AddDays(1), EndTime = _reference.AddDays(2) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2),EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 2, Time = _reference.AddDays(2), EndTime = _reference.AddDays(3) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 15, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 80, Time = _reference.AddDays(3), EndTime = _reference.AddDays(4) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 4, Time = _reference.AddDays(4), EndTime = _reference.AddDays(5) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 37, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 90, Time = _reference.AddDays(5), EndTime = _reference.AddDays(6) },\n                new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 105, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n                new TradeBar() { Symbol = Symbols.SPX, Low = 1, High = 2, Volume = 100, Close = 302, Time = _reference.AddDays(6), EndTime = _reference.AddDays(7) },\n            };\n\n            foreach (var bar in bars)\n            {\n                indicator.Update(bar);\n            }\n\n            var closeAAPL = new List<decimal>() { 10, 15, 90, 105 };\n            var closeSPX = new List<decimal>() { 35, 80, 37, 302 };\n            var expectedValue = 0m;\n            for (var i = 0; i < closeAAPL.Count; i++)\n            {\n                expectedValue += (closeAAPL[i] + closeSPX[i]) / 2;\n            }\n\n            Assert.AreEqual(expectedValue, indicator.Current.Value);\n        }\n\n        [Test]\n        public void WorksWithDifferentTimeZones()\n        {\n            var indicator = new TestAverageIndicator(Symbols.SPY, Symbols.BTCUSD, 5);\n\n            for (int i = 0; i < 10; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 100, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.BTCUSD, Low = 1, High = 2, Volume = 100, Close = 100, Time = startTime, EndTime = endTime });\n            }\n            Assert.AreEqual(100 * 10, indicator.Current.Value);\n        }\n\n        [Test]\n        public void TracksPreviousState()\n        {\n            var period = 5;\n            var indicator = new TestAverageIndicator(Symbols.SPY, Symbols.AAPL, period);\n            var previousValue = indicator.Current.Value;\n\n            // Update the indicator and verify the previous values\n            for (var i = 1; i < 2 * period; i++)\n            {\n                var startTime = _reference.AddDays(1 + i);\n                var endTime = startTime.AddDays(1);\n                indicator.Update(new TradeBar() { Symbol = Symbols.SPY, Low = 1, High = 2, Volume = 100, Close = 1000 + i * 10, Time = startTime, EndTime = endTime });\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Close = 1000 + (i * 15), Time = startTime, EndTime = endTime });\n                // Verify the previous value matches the indicator's previous value\n                Assert.AreEqual(previousValue, indicator.Previous.Value);\n\n                // Update previousValue to the current value for the next iteration\n                previousValue = indicator.Current.Value;\n            }\n        }\n\n        private class TestAverageIndicator : DualSymbolIndicator<IBaseDataBar>\n        {\n            public TestAverageIndicator(Symbol targetSymbol, Symbol referenceSymbol, int period)\n                : base(\"TestIndicator\", targetSymbol, referenceSymbol, period)\n            {\n            }\n\n            public override bool IsReady => TargetDataPoints.IsReady && ReferenceDataPoints.IsReady;\n\n            protected override decimal ComputeIndicator()\n            {\n                var prevValue = IndicatorValue;\n                var result = IndicatorValue += (TargetDataPoints[0].Close + ReferenceDataPoints[0].Close) / 2;\n                Console.WriteLine($\"Previous Value: {prevValue}, Current Value: {IndicatorValue} (Inputs: {TargetDataPoints[^1]} and {ReferenceDataPoints[^1]})\");\n                return result;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/EaseOfMovementValueTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class EaseOfMovementValueTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            // Even if the indicator is ready, there may be zero values\n            ValueCanBeZero = true;\n            RenkoBarSize = 0.5m;\n            return new EaseOfMovementValue();\n        }\n\n        protected override string TestFileName => \"spy_emv.txt\";\n\n        protected override string TestColumnName => \"EMV\";\n        \n        [Test]\n        public void TestTradeBarsWithVolume()\n        {\n            var emv = new EaseOfMovementValue();\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Volume = data.Value\n                };\n                emv.Update(tradeBar);\n            }\n        }\n\n        protected override Action<IndicatorBase<TradeBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1); }\n        }\n\n        [Test]\n        public virtual void PeriodSet()\n        {\n            var emv = new EaseOfMovementValue(period: 3, scale: 1);\n            var reference = System.DateTime.Today;\n\n            emv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddMinutes(1) });\n            Assert.AreEqual(0, emv.Current.Value);\n            Assert.IsFalse(emv.IsReady);\n\n            emv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 3, High = 4, Volume = 200, Time = reference.AddMinutes(2) });\n            Assert.AreEqual(0.005, (double)emv.Current.Value, 0.00001);\n            Assert.IsFalse(emv.IsReady);\n\n            emv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 5, High = 6, Volume = 300, Time = reference.AddMinutes(3) });\n            Assert.AreEqual(0.00556, (double)emv.Current.Value, 0.00001);\n            Assert.IsTrue(emv.IsReady);\n\n            emv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 6, High = 7, Volume = 400, Time = reference.AddMinutes(4) });\n            Assert.AreEqual(0.00639, (double)emv.Current.Value, 0.00001);\n            Assert.IsTrue(emv.IsReady);\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because the bars it's receiving are the same.\n        /// Therefore we skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ExponentialMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class ExponentialMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n             return new ExponentialMovingAverage(14);\n        }\n\n        protected override string TestFileName => \"spy_ema.csv\";\n\n        protected override string TestColumnName => \"EMA14\";\n\n        [Test]\n        public void EmaComputesCorrectly()\n        {\n            const int period = 4;\n            decimal[] values = { 1m, 10m, 100m, 1000m, 2000m, 3000m, 4000m, 5000m, 6000m, 7000m, 8000m, 9000m, 10000m };\n            const decimal expFactor = 2m/(1m + period);\n\n            var ema4 = new ExponentialMovingAverage(period);\n\n            decimal expectedCurrent = 0m;\n            for (int i = 0; i < values.Length; i++)\n            {\n                ema4.Update(new IndicatorDataPoint(DateTime.UtcNow.AddSeconds(i), values[i]));\n                if (i == period - 1)\n                {\n                    // The indicator is ready after the first full period, the first value should be a SMA of the first period\n                    expectedCurrent = values.Take(period).Sum() / period;\n                }\n                if (i >= period)\n                {\n                    expectedCurrent = values[i] * expFactor + (1 - expFactor) * expectedCurrent;\n                }\n                Assert.AreEqual(expectedCurrent, ema4.Current.Value, $\"Index: {i}\");\n            }\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            // ema reset is just setting the value and samples back to 0\n            var ema = new ExponentialMovingAverage(3);\n\n            foreach (var data in TestHelper.GetDataStream(5))\n            {\n                ema.Update(data);\n            }\n            Assert.IsTrue(ema.IsReady);\n            Assert.AreNotEqual(0m, ema.Current.Value);\n            Assert.AreNotEqual(0, ema.Samples);\n\n            ema.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(ema);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/FilteredIdentityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Test class for QuantConnect.Indicators.FilteredIdentity\n    /// </summary>\n    [TestFixture]\n    public class FilteredIdentityTests\n    {\n        [TestCase(\"lambda\")]\n        [TestCase(\"function\")]\n        public void FilteredIdentityWorksWithPythonFilter(string filterType)\n        {\n            using (Py.GIL())\n            {\n                string filterCode = filterType == \"lambda\"\n                    ? \"filter = lambda x: x.Close > x.Open\"\n                    : \"filter = filter\";\n\n                string functionCode = filterType == \"function\"\n                    ? @\"\ndef filter(data):\n    return data.Close > data.Open\n\"\n                    : \"\";\n\n                var testModule = PyModule.FromString(\"TestFilteredIdentity\",\n                    $@\"\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\n\n{functionCode}\n\ndef test_filtered_identity():\n    test = FilteredIdentity(Symbols.SPY, {filterCode})\n    tradeBar1 = TradeBar()\n    tradeBar1.Close = 100\n    tradeBar1.Open = 50\n    tradeBar2 = TradeBar()\n    tradeBar2.Close = 20\n    tradeBar2.Open = 50\n    tradeBar3 = TradeBar()\n    tradeBar3.Close = 300\n    tradeBar3.Open = 50\n    test.Update(tradeBar1)\n    test.Update(tradeBar2)\n    test.Update(tradeBar3)\n    return test\n\");\n\n                var test = testModule.GetAttr(\"test_filtered_identity\").Invoke();\n                var filteredIdentity = test.As<FilteredIdentity>();\n                Assert.AreEqual(3, filteredIdentity.Samples);\n                Assert.AreEqual(300, filteredIdentity.Current.Value);\n                Assert.AreEqual(100, filteredIdentity.Previous.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/FisherTransformTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class FisherTransformTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new FisherTransform(10);\n        }\n\n        protected override string TestFileName => \"spy_with_fisher.txt\";\n\n        protected override string TestColumnName => \"Fisher Transform 10\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ForceIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ForceIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            // VolumeRenkoBarSize = 0.5m; // when uncommented test AcceptsVolumeRenkoBarsAsInput in hanging\n            return new ForceIndex(20);\n        }\n\n        protected override string TestFileName => \"spy_with_ForceIndex.csv\";\n\n        protected override string TestColumnName => \"ForceIndex20\";\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/FractalAdaptiveMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class FractalAdaptiveMovingAverageTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new FractalAdaptiveMovingAverage(16);\n        }\n\n        protected override string TestFileName => \"frama.txt\";\n\n        protected override string TestColumnName => \"Filt\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double) indicator.Current.Value, 0.006);\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var frama = new FractalAdaptiveMovingAverage(6);\n\n            foreach (var data in TestHelper.GetDataStream(7))\n            {\n                frama.Update(new TradeBar { High = data.Value, Low = data.Value });\n            }\n            Assert.IsTrue(frama.IsReady);\n            Assert.AreNotEqual(0m, frama.Current.Value);\n            Assert.AreNotEqual(0, frama.Samples);\n\n            frama.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(frama);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/FunctionalIndicatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class FunctionalIndicatorTests\n    {\n        [Test]\n        public void ComputesDelegateCorrectly()\n        {\n            var func = new FunctionalIndicator<IndicatorDataPoint>(\"f\", data => data.Value, @this => @this.Samples > 1, () => {/*no reset action required*/});\n            func.Update(DateTime.Today, 1m);\n            Assert.IsFalse(func.IsReady);\n            Assert.AreEqual(1m, func.Current.Value);\n\n            func.Update(DateTime.Today.AddSeconds(1), 2m);\n            Assert.IsTrue(func.IsReady);\n            Assert.AreEqual(2m, func.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var inner = new SimpleMovingAverage(2);\n            var func = new FunctionalIndicator<IndicatorDataPoint>(\"f\", data =>\n            {\n                inner.Update(data);\n                return inner.Current.Value*2;\n            },\n            @this => inner.IsReady,\n            () => inner.Reset()\n            );\n\n            func.Update(DateTime.Today, 1m);\n            func.Update(DateTime.Today.AddSeconds(1), 2m);\n            Assert.IsTrue(func.IsReady);\n\n            func.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(inner);\n            TestHelper.AssertIndicatorIsInDefaultState(func);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/GammaTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class GammaTests : OptionBaseIndicatorTests<Gamma>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n            => new Gamma(\"testGammaIndicator\", _symbol, 0.0403m, 0.0m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new Gamma(\"testGammaIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new Gamma(\"testGammaIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.G(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            // 2 updates per iteration, 1 for greek, 1 for IV\n            RiskFreeRateUpdatesPerIteration = 2;\n            DividendYieldUpdatesPerIteration = 2;\n        }\n\n        [TestCase(\"american/third_party_1_greeks.csv\", true, false, 0.12)]\n        [TestCase(\"american/third_party_1_greeks.csv\", false, false, 0.12)]\n        // Just placing the test and data here, we are unsure about the smoothing function and not going to reverse engineer\n        [TestCase(\"american/third_party_2_greeks.csv\", false, true, 10000, 0.002)]\n        public void ComparesAgainstExternalData(string subPath, bool reset, bool singleContract, double errorRate, double errorMargin = 1e-4,\n            int callColumn = 11, int putColumn = 10)\n        {\n            var path = Path.Combine(\"TestData\", \"greeksindicator\", subPath);\n            // skip last entry since for deep ITM, IV will not affect much on price. Thus root finding will not be optimizing a non-convex function.\n            foreach (var line in File.ReadAllLines(path).Skip(3).SkipLast(1))\n            {\n                var items = line.Split(',');\n\n                var interestRate = Parse.Decimal(items[^2]);\n                var dividendYield = Parse.Decimal(items[^1]);\n\n                var model = ParseSymbols(items, path.Contains(\"american\"), out var call, out var put);\n\n                Gamma callIndicator;\n                Gamma putIndicator;\n                if (singleContract)\n                {\n                    callIndicator = new Gamma(call, interestRate, dividendYield, optionModel: model);\n                    putIndicator = new Gamma(put, interestRate, dividendYield, optionModel: model);\n                }\n                else\n                {\n                    callIndicator = new Gamma(call, interestRate, dividendYield, put, model);\n                    putIndicator = new Gamma(put, interestRate, dividendYield, call, model);\n                }\n\n                RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n\n                if (reset == true)\n                {\n                    callIndicator.Reset();\n                    putIndicator.Reset();\n\n                    RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n                }\n            }\n        }\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.0071, OptionStyle.European)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, 0.0042, OptionStyle.European)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.0067, OptionStyle.European)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, 0.0083, OptionStyle.European)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.0136, OptionStyle.European)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, 0.0042, OptionStyle.European)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 0.0128, OptionStyle.European)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, 0.0059, OptionStyle.European)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 0.0070, OptionStyle.European)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, 0.0057, OptionStyle.European)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.0193, OptionStyle.European)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, 0.0073, OptionStyle.European)]\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.0071, OptionStyle.American)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, 0.0042, OptionStyle.American)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.0067, OptionStyle.American)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, 0.0083, OptionStyle.American)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.0136, OptionStyle.American)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, 0.0042, OptionStyle.American)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 0.0129, OptionStyle.American)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, 0.0059, OptionStyle.American)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 0.0070, OptionStyle.American)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, 0.0058, OptionStyle.American)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.0193, OptionStyle.American)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, 0.0073, OptionStyle.American)]\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refGamma, OptionStyle style)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, _reference.AddDays(expiry));\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Gamma(symbol, 0.0403m, 0.0m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refGamma, (double)indicator.Current.Value, 0.0005d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.American, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.American, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.American, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.American, 15)] // Expires at 16:00\n        [TestCase(15.0, 450.0, OptionRight.Call, OptionStyle.American, 0)]\n        [TestCase(15.0, 450.0, OptionRight.Call, OptionStyle.American, 5)]\n        [TestCase(15.0, 450.0, OptionRight.Call, OptionStyle.American, 10)]\n        [TestCase(15.0, 450.0, OptionRight.Call, OptionStyle.American, 15)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.European, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.European, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.European, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, OptionStyle.European, 15)]\n        [TestCase(0.5, 450.0, OptionRight.Call, OptionStyle.European, 0)]\n        [TestCase(0.5, 450.0, OptionRight.Call, OptionStyle.European, 5)]\n        [TestCase(0.5, 450.0, OptionRight.Call, OptionStyle.European, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, OptionStyle.European, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, OptionStyle style, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, expiration);\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Gamma(symbol, 0.0403m, 0.0m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/HeikinAshiTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class HeikinAshiTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new HeikinAshi();\n        }\n\n        protected override string TestFileName => \"spy_heikin_ashi.txt\";\n\n        protected override string TestColumnName => \"\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            TestHelper.TestIndicator(new HeikinAshi(), TestFileName, \"HA_Open\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Open.Current.Value, 1e-3));\n            TestHelper.TestIndicator(new HeikinAshi(), TestFileName, \"HA_High\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).High.Current.Value, 1e-3));\n            TestHelper.TestIndicator(new HeikinAshi(), TestFileName, \"HA_Low\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Low.Current.Value, 1e-3));\n            TestHelper.TestIndicator(new HeikinAshi(), TestFileName, \"HA_Close\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Close.Current.Value, 1e-3));\n            TestHelper.TestIndicator(new HeikinAshi(), TestFileName, \"Volume\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Volume.Current.Value, 1e-3));\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            var indicator = CreateIndicator();\n            for (var i = 1; i <= 2; i++)\n            {\n                TestHelper.TestIndicator(indicator, TestFileName, \"HA_Open\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Open.Current.Value, 1e-3));\n                indicator.Reset();\n                TestHelper.TestIndicator(indicator, TestFileName, \"HA_High\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).High.Current.Value, 1e-3));\n                indicator.Reset();\n                TestHelper.TestIndicator(indicator, TestFileName, \"HA_Low\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Low.Current.Value, 1e-3));\n                indicator.Reset();\n                TestHelper.TestIndicator(indicator, TestFileName, \"HA_Close\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Close.Current.Value, 1e-3));\n                indicator.Reset();\n                TestHelper.TestIndicator(indicator, TestFileName, \"Volume\", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Volume.Current.Value, 1e-3));\n                indicator.Reset();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/HilbertTransformTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators;\n\n[TestFixture]\npublic class HilbertTransformTests : CommonIndicatorTests<IndicatorDataPoint>\n{\n    protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n    {\n        return new HilbertTransform();\n    }\n\n    protected override string TestFileName => \"spy_with_hilbert.csv\";\n\n    protected override string TestColumnName => \"Close\";\n\n    [Test]\n    public void ComparesAgainstExternalDataInPhase()\n    {\n        var hilbertTransform = new HilbertTransform();\n        TestHelper.TestIndicator(\n            hilbertTransform,\n            TestFileName,\n            \"InPhase\",\n            (_, expected) =>\n                Assert.AreEqual(expected, (double)hilbertTransform.InPhase.Current.Value, 1e-3));\n    }\n\n    [Test]\n    public void ComparesAgainstExternalDataQuadrature()\n    {\n        var hilbertTransform = new HilbertTransform();\n        TestHelper.TestIndicator(\n            hilbertTransform,\n            TestFileName,\n            \"Quadrature\",\n            (actual, expected) =>\n                Assert.AreEqual(expected, (double)hilbertTransform.Quadrature.Current.Value, 1e-3));\n    }\n\n    [Test]\n    public override void ResetsProperly()\n    {\n        var hti = new HilbertTransform(length: 2);\n        TestHelper.AssertIndicatorIsInDefaultState(hti);\n        TestHelper.AssertIndicatorIsInDefaultState(hti.Quadrature);\n        TestHelper.AssertIndicatorIsInDefaultState(hti.InPhase);\n\n        hti.Update(DateTime.Today, 1m);\n        hti.Update(DateTime.Today.AddSeconds(1), 2m);\n        hti.Update(DateTime.Today.AddSeconds(2), 3m);\n        hti.Update(DateTime.Today.AddSeconds(3), 1m);\n        hti.Update(DateTime.Today.AddSeconds(4), 2m);\n        hti.Update(DateTime.Today.AddSeconds(5), 3m);\n        hti.Update(DateTime.Today.AddSeconds(6), 1m);\n        hti.Update(DateTime.Today.AddSeconds(7), 2m);\n        hti.Update(DateTime.Today.AddSeconds(8), 3m);\n        Assert.IsTrue(hti.IsReady);\n\n        hti.Reset();\n        TestHelper.AssertIndicatorIsInDefaultState(hti);\n        TestHelper.AssertIndicatorIsInDefaultState(hti.Quadrature);\n        TestHelper.AssertIndicatorIsInDefaultState(hti.InPhase);\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/HullMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class HullMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new HullMovingAverage(16);\n        }\n\n        protected override string TestFileName => \"spy_hma.txt\";\n\n        protected override string TestColumnName => \"HMA_16\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/HurstExponentTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class HurstExponentTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new HurstExponent(\"HE\", 252, 20);\n        }\n        protected override string TestFileName => \"spy_hurst_exponent.csv\";\n\n        protected override string TestColumnName => \"hurst_exponent\";\n\n        [Test]\n        public void DoesNotThrowDivisionByZero()\n        {\n            var he = new HurstExponent(2);\n            var date = new DateTime(2024, 12, 2, 12, 0, 0);\n\n            for (var i = 0; i < 10; i++)\n            {\n                Assert.DoesNotThrow(() => he.Update(date, 0m));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/IchimokuKinkoHyoTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class IchimokuKinkoHyoTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new IchimokuKinkoHyo();\n        }\n\n        protected override string TestFileName => \"spy_with_ichimoku.csv\";\n\n        protected override string TestColumnName => \"Tenkan\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)indicator).Tenkan.Current.Value, 1e-3);\n\n        [Test]\n        public void ComparesWithExternalDataTenkanMaximum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"TenkanMaximum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).TenkanMaximum.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataTenkanMinimum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"TenkanMinimum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).TenkanMinimum.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataKijunMaximum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"KijunMaximum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).KijunMaximum.Current.Value)\n                );\n        }\n        [Test]\n        public void ComparesWithExternalDataKijunMinimum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"KijunMinimum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).KijunMinimum.Current.Value)\n                );\n        }\n        [Test]\n        public void ComparesWithExternalDataKijun()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Kijun\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).Kijun.Current.Value)\n                );\n        }\n        [Test]\n        public void ComparesWithExternalDataDelayedTenkanSenkouA()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"DelayedTenkanSenkouA\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).DelayedTenkanSenkouA.Current.Value)\n                );\n        }\n\n\n        [Test]\n        public void ComparesWithExternalDataDelayedKijunSenkouA()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"DelayedKijunSenkouA\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).DelayedKijunSenkouA.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataSenkouA()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Senkou A\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).SenkouA.Current.Value)\n                );\n        }\n        [Test]\n        public void ComparesWithExternalDataSenkouBMaximum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"SenkouBMaximum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).SenkouBMaximum.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataSenkouBMinimum()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"SenkouBMinimum\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).SenkouBMinimum.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataDelayedMaximumSenkouB()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"DelayedMaximumSenkouB\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).DelayedMaximumSenkouB.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataDelayedMinimumSenkouB()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"DelayedMinimumSenkouB\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((IchimokuKinkoHyo)ind).DelayedMinimumSenkouB.Current.Value)\n                );\n        }\n\n        [Test]\n        public void ComponentsAreNonZeroWhenIndicatorIsReady()\n        {\n            var indicator = new IchimokuKinkoHyo(2, 3, 2, 4, 2, 2);\n            var date = new DateTime(2017, 1, 1);\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                var tradeBar = new TradeBar(date + TimeSpan.FromDays(i), Symbols.SPY,\n                    100 * i, 200 * i, 100 * i, 200 * i, 500 * i);\n                indicator.Update(tradeBar);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreNotEqual(0m, indicator.Tenkan.Current.Value);\n            Assert.AreNotEqual(0m, indicator.Kijun.Current.Value);\n            Assert.AreNotEqual(0m, indicator.SenkouA.Current.Value);\n            Assert.AreNotEqual(0m, indicator.SenkouB.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/IdentityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Test class for QuantConnect.Indicators.Identity\n    /// </summary>\n    [TestFixture]\n    public class IdentityTests\n    {\n        [Test]\n        public void TestIdentityInvariants()\n        {\n            // the invariants of the identity indicator is to be ready after\n            // a single sample has been added, and always produce the same value\n            // as the last ingested value\n\n            var identity = new Identity(\"test\");\n            Assert.IsFalse(identity.IsReady);\n\n            const decimal value = 1m;\n            identity.Update(new IndicatorDataPoint(DateTime.UtcNow, value));\n            Assert.IsTrue(identity.IsReady);\n            Assert.AreEqual(value, identity.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var identity = new Identity(\"test\");\n            Assert.IsFalse(identity.IsReady);\n            Assert.AreEqual(0m, identity.Current.Value);\n\n            foreach (var data in TestHelper.GetDataStream(2))\n            {\n                identity.Update(data);\n            }\n            Assert.IsTrue(identity.IsReady);\n            Assert.AreEqual(2, identity.Samples);\n\n            identity.Reset();\n\n            Assert.IsFalse(identity.IsReady);\n            Assert.AreEqual(0, identity.Samples);\n        }\n\n        [Test]\n        public void WarmsUpProperly() \n        {\n            var identityIndicator = new Identity(\"Example\");\n            var time = new DateTime(2020, 8, 1);\n            var period = ((IIndicatorWarmUpPeriodProvider)identityIndicator).WarmUpPeriod;\n\n            Assert.IsFalse(identityIndicator.IsReady);\n\n            for (var i = 0; i < period; i++)\n            {\n                identityIndicator.Update(time.AddDays(i), i);\n                Assert.AreEqual(i == period - 1, identityIndicator.IsReady);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ImpliedVolatilityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class ImpliedVolatilityTests : OptionBaseIndicatorTests<ImpliedVolatility>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n           => new ImpliedVolatility(\"testImpliedVolatilityIndicator\", _symbol, 0.053m, 0.0153m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new ImpliedVolatility(\"testImpliedVolatilityIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new ImpliedVolatility(\"testImpliedVolatilityIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.IV(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            RiskFreeRateUpdatesPerIteration = 1;\n            DividendYieldUpdatesPerIteration = 1;\n        }\n\n        [TestCase(\"american/third_party_1_greeks.csv\", true, false, 0.08)]\n        [TestCase(\"american/third_party_1_greeks.csv\", false, false, 0.08)]\n        // Just placing the test and data here, we are unsure about the smoothing function and not going to reverse engineer\n        [TestCase(\"american/third_party_2_greeks.csv\", false, true, 10000)]\n        public void ComparesAgainstExternalData(string subPath, bool reset, bool singleContract, double errorRate, double errorMargin = 1e-4,\n            int callColumn = 7, int putColumn = 6)\n        {\n            var path = Path.Combine(\"TestData\", \"greeksindicator\", subPath);\n            // skip last entry since for deep ITM, IV will not affect much on price. Thus root finding will not be optimizing a non-convex function.\n            foreach (var line in File.ReadAllLines(path).Skip(3).SkipLast(1))\n            {\n                var items = line.Split(',');\n\n                var interestRate = Parse.Decimal(items[^2]);\n                var dividendYield = Parse.Decimal(items[^1]);\n\n                var model = ParseSymbols(items, path.Contains(\"american\"), out var call, out var put);\n\n                ImpliedVolatility callIndicator;\n                ImpliedVolatility putIndicator;\n                if (singleContract)\n                {\n                    callIndicator = new ImpliedVolatility(call, interestRate, dividendYield, optionModel: model);\n                    putIndicator = new ImpliedVolatility(put, interestRate, dividendYield, optionModel: model);\n                }\n                else\n                {\n                    callIndicator = new ImpliedVolatility(call, interestRate, dividendYield, put, model);\n                    putIndicator = new ImpliedVolatility(put, interestRate, dividendYield, call, model);\n                }\n\n                RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n\n                if (reset == true)\n                {\n                    callIndicator.Reset();\n                    putIndicator.Reset();\n\n                    RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n                }\n            }\n        }\n\n        [TestCase(23.753, 27.651, 450.0, OptionRight.Call, 60, 0.309, 0.309)]\n        [TestCase(33.928, 5.564, 470.0, OptionRight.Call, 60, 0.191, 0.279)]\n        [TestCase(47.701, 10.213, 430.0, OptionRight.Put, 60, 0.247, 0.545)]\n        public void SetSmoothingFunction(decimal price, decimal mirrorPrice, decimal spotPrice, OptionRight right, int expiry, double refIV1, double refIV2)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, _reference.AddDays(expiry));\n            var mirrorSymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right == OptionRight.Call ? OptionRight.Put : OptionRight.Call,\n                450m, _reference.AddDays(expiry));\n            var indicator = new ImpliedVolatility(symbol, 0.0530m, 0.0153m, mirrorSymbol, OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var mirrorOptionDataPoint = new IndicatorDataPoint(mirrorSymbol, _reference, mirrorPrice);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(mirrorOptionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refIV1, (double)indicator.Current.Value, 0.0025d);\n\n            indicator.SetSmoothingFunction((iv, mirrorIv) => iv);\n\n            optionDataPoint = new IndicatorDataPoint(symbol, _reference.AddMilliseconds(1), price);\n            mirrorOptionDataPoint = new IndicatorDataPoint(mirrorSymbol, _reference.AddMilliseconds(1), mirrorPrice);\n            spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference.AddMilliseconds(1), spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(mirrorOptionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refIV2, (double)indicator.Current.Value, 0.0035d);\n        }\n\n        [TestCase(23.753, 27.651, 450.0, OptionRight.Call, 60, 0.309, 0.309)]\n        [TestCase(33.928, 5.564, 470.0, OptionRight.Call, 60, 0.191, 0.279)]\n        [TestCase(47.701, 10.213, 430.0, OptionRight.Put, 60, 0.247, 0.545)]\n        public void SetPythonSmoothingFunction(decimal price, decimal mirrorPrice, decimal spotPrice, OptionRight right, int expiry, double refIV1, double refIV2)\n        {\n            using var _ = Py.GIL();\n            var module = PyModule.FromString(Guid.NewGuid().ToString(), $@\"\ndef TestSmoothingFunction(iv: float, mirror_iv: float) -> float:\n    return iv\");\n            var pythonSmoothingFunction = module.GetAttr(\"TestSmoothingFunction\");\n\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, _reference.AddDays(expiry));\n            var mirrorSymbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right == OptionRight.Call ? OptionRight.Put : OptionRight.Call,\n                450m, _reference.AddDays(expiry));\n            var indicator = new ImpliedVolatility(symbol, 0.0530m, 0.0153m, mirrorSymbol, OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var mirrorOptionDataPoint = new IndicatorDataPoint(mirrorSymbol, _reference, mirrorPrice);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(mirrorOptionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refIV1, (double)indicator.Current.Value, 0.0025d);\n\n            indicator.SetSmoothingFunction(pythonSmoothingFunction);\n\n            optionDataPoint = new IndicatorDataPoint(symbol, _reference.AddMilliseconds(1), price);\n            mirrorOptionDataPoint = new IndicatorDataPoint(mirrorSymbol, _reference.AddMilliseconds(1), mirrorPrice);\n            spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference.AddMilliseconds(1), spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(mirrorOptionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refIV2, (double)indicator.Current.Value, 0.0035d);\n        }\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.309)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, 0.515)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.279)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, 0.205)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.133)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, 0.545)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 0.097)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, 0.207)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 0.140)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, 0.055)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.057)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, 0.177)]\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refIV)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, _reference.AddDays(expiry));\n            var indicator = new ImpliedVolatility(symbol, 0.0530m, 0.0153m, optionModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refIV, (double)indicator.Current.Value, 0.0036d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 15)]\n        [TestCase(15, 450.0, OptionRight.Call, 0)]\n        [TestCase(15, 450.0, OptionRight.Call, 5)]\n        [TestCase(15, 450.0, OptionRight.Call, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, expiration);\n            var indicator = new ImpliedVolatility(symbol, 0.0530m, 0.0153m, optionModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = new ImpliedVolatility(\"testImpliedVolatilityIndicator\", _symbol, 0.053m, 0.0153m);\n            var warmUpPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!warmUpPeriod.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            // warmup period is 5 + 1\n            for (var i = 1; i <= warmUpPeriod.Value; i++)\n            {\n                var time = _reference.AddDays(i);\n                var price = 500m;\n                var optionPrice = Math.Max(price - 450, 0) * 1.1m;\n\n                indicator.Update(new IndicatorDataPoint(_symbol, time, optionPrice));\n\n                if (i == 1)\n                {\n                    Assert.IsFalse(indicator.IsReady);\n                }\n\n                indicator.Update(new IndicatorDataPoint(_underlying, time, price));\n\n                Assert.IsTrue(indicator.IsReady);\n            }\n\n            Assert.AreEqual(2 * warmUpPeriod.Value, indicator.Samples);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/IndicatorBasedOptionPriceModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Tests.Common;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class IndicatorBasedOptionPriceModelTests\n    {\n        [TestCase(true, 6.05392693521696, 0.3559978, 0.7560627, 0.0430897, 0.0663327, -1599.430292, 0.0000904)]\n        [TestCase(false, 5.05414551764534, 0.1427122, 0.957485, 0.0311303, 0.020584, -163.902082, 0.0000057)]\n        public void WorksWithAndWithoutMirrorContract([Values] bool withMirrorContract, decimal expectedTheoreticalPrice,\n            decimal expectedIv, decimal expectedDelta, decimal expectedGamma, decimal expectedVega,\n            decimal expectedTheta, decimal expectedRho)\n        {\n            GetTestData(true, true, withMirrorContract, out var option, out var contract, out var securities);\n\n            var model = new IndicatorBasedOptionPriceModel(securityProvider: securities);\n\n            var result = model.Evaluate(new OptionPriceModelParameters(option, null, contract));\n            var theoreticalPrice = result.TheoreticalPrice;\n            var iv = result.ImpliedVolatility;\n            var greeks = result.Greeks;\n\n            Assert.Multiple(() =>\n            {\n                Assert.AreEqual(expectedTheoreticalPrice, theoreticalPrice);\n                Assert.AreEqual(expectedIv, iv);\n                Assert.AreEqual(expectedDelta, greeks.Delta);\n                Assert.AreEqual(expectedGamma, greeks.Gamma);\n                Assert.AreEqual(expectedVega, greeks.Vega);\n                Assert.AreEqual(expectedTheta, greeks.Theta);\n                Assert.AreEqual(expectedRho, greeks.Rho);\n            });\n        }\n\n        [TestCase(false, false)]\n        [TestCase(true, false)]\n        [TestCase(false, true)]\n        public void WontCalculateIfMissindData(bool withUnderlyingData, bool withOptionData)\n        {\n            GetTestData(withUnderlyingData, withOptionData, true, out var option, out var contract, out var securities);\n            \n            var model = new IndicatorBasedOptionPriceModel(securityProvider: securities);\n            var result = model.Evaluate(new OptionPriceModelParameters(option, null, contract));\n\n            Assert.AreEqual(OptionPriceModelResult.None, result);\n        }\n\n        private static void GetTestData(bool withUnderlying, bool withOption, bool withMirrorOption,\n            out Option option, out OptionContract contract, out SecurityManager securities)\n        {\n            var underlyingSymbol = Symbols.GOOG;\n            var date = new DateTime(2015, 11, 24);\n            var contractSymbol = Symbols.CreateOptionSymbol(underlyingSymbol.Value, OptionRight.Call, 745m, date);\n\n            var tz = TimeZones.NewYork;\n            var underlyingPrice = 750m;\n            var underlyingVolume = 10000;\n            var contractPrice = 5.05m;\n            var mirrorContractPrice = 1.05m;\n            var underlying = OptionPriceModelTests.GetEquity(underlyingSymbol, 0m, underlyingVolume, tz);\n            option = OptionPriceModelTests.GetOption(contractSymbol, underlying, tz);\n            contract = OptionPriceModelTests.GetOptionContract(contractSymbol, underlyingSymbol, date);\n\n            var time = date.Add(new TimeSpan(9, 31, 0));\n            var timeKeeper = new TimeKeeper(time.ConvertToUtc(tz));\n            securities = new SecurityManager(timeKeeper);\n\n            if (withUnderlying)\n            {\n                var underlyingData = new Tick { Symbol = underlying.Symbol, Time = time, Value = underlyingPrice, Quantity = underlyingVolume, TickType = TickType.Trade };\n                underlying.SetMarketPrice(underlyingData);\n                securities.Add(underlying);\n            }\n\n            if (withOption)\n            {\n                var contractData = new Tick { Symbol = contractSymbol, Time = time, Value = contractPrice, Quantity = 10, TickType = TickType.Trade };\n                option.SetMarketPrice(contractData);\n                securities.Add(option);\n            }\n\n            if (withMirrorOption)\n            {\n                var mirrorContractSymbol = Symbol.CreateOption(contractSymbol.Underlying,\n                    contractSymbol.ID.Symbol,\n                    contractSymbol.ID.Market,\n                    contractSymbol.ID.OptionStyle,\n                    contractSymbol.ID.OptionRight == OptionRight.Call ? OptionRight.Put : OptionRight.Call,\n                    contractSymbol.ID.StrikePrice,\n                    contractSymbol.ID.Date);\n                var mirrorContractData = new Tick { Symbol = mirrorContractSymbol, Time = time, Value = mirrorContractPrice, Quantity = 10, TickType = TickType.Trade };\n                var mirrorOption = OptionPriceModelTests.GetOption(mirrorContractSymbol, underlying, tz);\n                mirrorOption.SetMarketPrice(mirrorContractData);\n                securities.Add(mirrorOption);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/IndicatorExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class IndicatorExtensionsTests\n    {\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void PipesDataUsingOfFromFirstToSecond()\n        {\n            var first = new SimpleMovingAverage(2);\n            var second = new Delay(1);\n\n            // this is a configuration step, but returns the reference to the second for method chaining\n            second.Of(first);\n\n            var data1 = new IndicatorDataPoint(DateTime.UtcNow, 1m);\n            var data2 = new IndicatorDataPoint(DateTime.UtcNow, 2m);\n            var data3 = new IndicatorDataPoint(DateTime.UtcNow, 3m);\n            var data4 = new IndicatorDataPoint(DateTime.UtcNow, 4m);\n\n            // sma has one item\n            first.Update(data1);\n            Assert.IsFalse(first.IsReady);\n            Assert.AreEqual(0m, second.Current.Value);\n\n            // sma is ready, delay will repeat this value\n            first.Update(data2);\n            Assert.IsTrue(first.IsReady);\n            Assert.IsFalse(second.IsReady);\n            Assert.AreEqual(1.5m, second.Current.Value);\n\n            // delay is ready, and repeats its first input\n            first.Update(data3);\n            Assert.IsTrue(second.IsReady);\n            Assert.AreEqual(1.5m, second.Current.Value);\n\n            // now getting the delayed data\n            first.Update(data4);\n            Assert.AreEqual(2.5m, second.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void PipesDataFirstWeightedBySecond()\n        {\n            const int period = 4;\n            var value = new Identity(\"Value\");\n            var weight = new Identity(\"Weight\");\n\n            var third = value.WeightedBy(weight, period);\n\n            var data = Enumerable.Range(1, 10).ToList();\n            var window = Enumerable.Reverse(data).Take(period);\n            var current = window.Sum(x => 2 * x * x) / (decimal)window.Sum(x => x);\n\n            foreach (var item in data)\n            {\n                value.Update(new IndicatorDataPoint(DateTime.UtcNow, Convert.ToDecimal(2 * item)));\n                weight.Update(new IndicatorDataPoint(DateTime.UtcNow, Convert.ToDecimal(item)));\n            }\n\n            Assert.AreEqual(current, third.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void NewDataPushesToDerivedIndicators()\n        {\n            var identity = new Identity(\"identity\");\n            var sma = new SimpleMovingAverage(3);\n\n            identity.Updated += (sender, consolidated) =>\n            {\n                sma.Update(consolidated);\n            };\n\n            identity.Update(DateTime.UtcNow, 1m);\n            identity.Update(DateTime.UtcNow, 2m);\n            Assert.IsFalse(sma.IsReady);\n\n            identity.Update(DateTime.UtcNow, 3m);\n            Assert.IsTrue(sma.IsReady);\n            Assert.AreEqual(2m, sma.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MultiChainSMA()\n        {\n            var identity = new Identity(\"identity\");\n            var delay = new Delay(2);\n\n            // create the SMA of the delay of the identity\n            var sma = delay.Of(identity).SMA(2);\n\n            identity.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(sma.IsReady);\n\n            identity.Update(DateTime.UtcNow, 2m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(sma.IsReady);\n\n            identity.Update(DateTime.UtcNow, 3m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsFalse(sma.IsReady);\n\n            identity.Update(DateTime.UtcNow, 4m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsTrue(sma.IsReady);\n\n            Assert.AreEqual(1.5m, sma.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MultiChainEMA()\n        {\n            var identity = new Identity(\"identity\");\n            var delay = new Delay(2);\n\n            // create the EMA of chained methods\n            var ema = delay.Of(identity).EMA(2, 1);\n\n            // Assert.IsTrue(ema. == 1);\n            identity.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(ema.IsReady);\n\n            identity.Update(DateTime.UtcNow, 2m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(ema.IsReady);\n\n            identity.Update(DateTime.UtcNow, 3m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsFalse(ema.IsReady);\n\n            identity.Update(DateTime.UtcNow, 4m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsTrue(ema.IsReady);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MultiChainMAX()\n        {\n            var identity = new Identity(\"identity\");\n            var delay = new Delay(2);\n\n            // create the MAX of the delay of the identity\n            var max = delay.Of(identity).MAX(2);\n\n            identity.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(max.IsReady);\n\n            identity.Update(DateTime.UtcNow, 2m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(max.IsReady);\n\n            identity.Update(DateTime.UtcNow, 3m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsFalse(max.IsReady);\n\n            identity.Update(DateTime.UtcNow, 4m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsTrue(max.IsReady);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MultiChainMIN()\n        {\n            var identity = new Identity(\"identity\");\n            var delay = new Delay(2);\n\n            // create the MIN of the delay of the identity\n            var min = delay.Of(identity).MIN(2);\n\n            identity.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(min.IsReady);\n\n            identity.Update(DateTime.UtcNow, 2m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsFalse(delay.IsReady);\n            Assert.IsFalse(min.IsReady);\n\n            identity.Update(DateTime.UtcNow, 3m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsFalse(min.IsReady);\n\n            identity.Update(DateTime.UtcNow, 4m);\n            Assert.IsTrue(identity.IsReady);\n            Assert.IsTrue(delay.IsReady);\n            Assert.IsTrue(min.IsReady);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void PlusAddsLeftAndRightAfterBothUpdated()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = left.Plus(right);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, 1m);\n            Assert.AreEqual(2m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(2m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 3m);\n            Assert.AreEqual(2m, composite.Current.Value);\n\n            right.Update(DateTime.Today, 4m);\n            Assert.AreEqual(7m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void PlusAddsLeftAndConstant()\n        {\n            var left = new Identity(\"left\");\n            var composite = left.Plus(5);\n\n            left.Update(DateTime.Today, 1m);\n            Assert.AreEqual(6m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(7m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MinusSubtractsLeftAndRightAfterBothUpdated()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = left.Minus(right);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, 1m);\n            Assert.AreEqual(0m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(0m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 3m);\n            Assert.AreEqual(0m, composite.Current.Value);\n\n            right.Update(DateTime.Today, 4m);\n            Assert.AreEqual(-1m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void MinusSubtractsLeftAndConstant()\n        {\n            var left = new Identity(\"left\");\n            var composite = left.Minus(1);\n\n            left.Update(DateTime.Today, 1m);\n            Assert.AreEqual(0m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(1m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void OverDividesLeftAndRightAfterBothUpdated()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = left.Over(right);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, 1m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 3m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            right.Update(DateTime.Today, 4m);\n            Assert.AreEqual(3m / 4m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void OverDividesLeftAndConstant()\n        {\n            var left = new Identity(\"left\");\n            var composite = left.Over(2);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 4m);\n            Assert.AreEqual(2m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void OverHandlesDivideByZero()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = left.Over(right);\n            var updatedEventFired = false;\n            composite.Updated += delegate { updatedEventFired = true; };\n\n            left.Update(DateTime.Today, 1m);\n            Assert.IsFalse(updatedEventFired);\n            right.Update(DateTime.Today, 0m);\n            Assert.IsFalse(updatedEventFired);\n\n            // submitting another update to right won't cause an update without corresponding update to left\n            right.Update(DateTime.Today, 1m);\n            Assert.IsFalse(updatedEventFired);\n            left.Update(DateTime.Today, 1m);\n            Assert.IsTrue(updatedEventFired);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void TimesMultipliesLeftAndRightAfterBothUpdated()\n        {\n            var left = new Identity(\"left\");\n            var right = new Identity(\"right\");\n            var composite = left.Times(right);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, 1m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 3m);\n            Assert.AreEqual(1m, composite.Current.Value);\n\n            right.Update(DateTime.Today, 4m);\n            Assert.AreEqual(12m, composite.Current.Value);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void TimesMultipliesLeftAndConstant()\n        {\n            var left = new Identity(\"left\");\n            var composite = left.Times(10);\n\n            left.Update(DateTime.Today, 1m);\n            Assert.AreEqual(10m, composite.Current.Value);\n\n            left.Update(DateTime.Today, 2m);\n            Assert.AreEqual(20m, composite.Current.Value);\n\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void WorksForIndicatorsOfDifferentTypes()\n        {\n            var indicatorA1 = new TestIndicatorA(\"1\");\n            var indicatorA2 = new TestIndicatorA(\"2\");\n\n            indicatorA1.Over(indicatorA2);\n            indicatorA1.Minus(indicatorA2);\n            indicatorA1.Times(indicatorA2);\n            indicatorA1.Plus(indicatorA2);\n            indicatorA1.Of(indicatorA2);\n\n            var indicatorB1 = new TestIndicatorB(\"1\");\n            var indicatorB2 = new TestIndicatorB(\"2\");\n            indicatorB1.Over(indicatorB2);\n            indicatorB1.Minus(indicatorB2);\n            indicatorB1.Times(indicatorB2);\n            indicatorB1.Plus(indicatorB2);\n            indicatorB1.Of(indicatorB2);\n        }\n\n        protected static TestCaseData[] IndicatorOfDifferentBaseCases()\n        {\n            // Helper for getting all permutations of the indicators listed below\n            static IEnumerable<IEnumerable<T>>\n                GetPermutations<T>(IEnumerable<T> list, int length)\n            {\n                if (length == 1) return list.Select(t => new T[] { t });\n                return GetPermutations(list, length - 1)\n                    .SelectMany(t => list.Where(o => !t.Contains(o)),\n                        (t1, t2) => t1.Concat(new T[] { t2 }));\n            }\n\n            // Define our indicators to test on\n            var testIndicators = new IIndicator[]\n            {\n                new TestIndicator<BaseData>(\"BD\"),\n                new TestIndicator<QuoteBar>(\"QB\"),\n                new TestIndicator<TradeBar>(\"TB\"),\n                new TestIndicator<IndicatorDataPoint>(\"IDP\")\n            };\n\n            // Methods defined in CompositeTestRunner\n            var methods = new string[]\n            {\n                \"minus\", \"plus\", \"over\", \"times\"\n            };\n\n            // Create every combination of indicators\n            var combinations = GetPermutations(testIndicators, 2);\n\n            // Create a case for each method with each combination of indicators\n            var cases = new List<TestCaseData>();\n            foreach (var combo in combinations)\n            {\n                foreach (var method in methods)\n                {\n                    var newCase = new TestCaseData(combo, method);\n                    cases.Add(newCase);\n                }\n            }\n\n            return cases.ToArray();\n        }\n\n        [TestCaseSource(nameof(IndicatorOfDifferentBaseCases))]\n        public void DifferentBaseIndicators(IEnumerable<IIndicator> indicators, string method)\n        {\n            CompositeTestRunner(indicators.ElementAt(0), indicators.ElementAt(1), method);\n        }\n        \n        [TestCaseSource(nameof(IndicatorOfDifferentBaseCases))]\n        public void DifferentBaseIndicatorsPy(IEnumerable<IIndicator> indicators, string method)\n        {\n            using (Py.GIL())\n            {\n                CompositeTestRunner(indicators.ElementAt(0).ToPython(), indicators.ElementAt(1).ToPython(), method);\n            }\n        }\n\n        public static void CompositeTestRunner(dynamic left, dynamic right, string method)\n        {\n            // Reset before every test; the permutation setup in test cases uses the same instance for each permutation\n            left.Reset();\n            right.Reset();\n\n            double expected;\n            CompositeIndicator compositeIndicator;\n\n            switch (method)\n            {\n                case \"minus\":\n                    expected = -5; // 5 - 10\n                    compositeIndicator = IndicatorExtensions.Minus(left, right);\n                    break;\n                case \"plus\":\n                    expected = 15; // 5 + 10\n                    compositeIndicator = IndicatorExtensions.Plus(left, right);\n                    break;\n                case \"over\":\n                    expected = .5; // 5 / 10\n                    compositeIndicator = IndicatorExtensions.Over(left, right);\n                    break;\n                case \"times\":\n                    expected = 50; // 5 * 10\n                    compositeIndicator = IndicatorExtensions.Times(left, right);\n                    break;\n                default:\n                    Assert.Fail($\"Method '{method}' not handled by this test, please implement\");\n                    throw new ArgumentException($\"Cannot proceed with test using method {method}\");\n            }\n\n            // Check our values are all zero\n            Assert.AreEqual(0, (int)right.Current.Value);\n            Assert.AreEqual(0, (int)left.Current.Value);\n            Assert.AreEqual(0, compositeIndicator.Current.Value);\n\n            // Use our test indicator method to update left and right\n            left.UpdateValue(5);\n            right.UpdateValue(10);\n\n            // Check final expected values, this ensures that composites are updating correctly\n            Assert.AreEqual(5, (int)left.Current.Value);\n            Assert.AreEqual(10, (int)right.Current.Value);\n            Assert.AreEqual(expected, compositeIndicator.Current.Value);\n        }\n\n        [Test]\n        public void MinusSubtractsLeftAndConstant_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var composite = (IIndicator) IndicatorExtensions.Minus(left.ToPython(), 10);\n\n                left.Update(DateTime.Today, 1);\n                Assert.AreEqual(-9, composite.Current.Value);\n\n                left.Update(DateTime.Today, 2);\n                Assert.AreEqual(-8, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void PlusAddsLeftAndConstant_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var composite = (IIndicator)IndicatorExtensions.Plus(left.ToPython(), 10);\n\n                left.Update(DateTime.Today, 1);\n                Assert.AreEqual(11, composite.Current.Value);\n\n                left.Update(DateTime.Today, 2);\n                Assert.AreEqual(12, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void OverDivdesLeftAndConstant_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var composite = (IIndicator)IndicatorExtensions.Over(left.ToPython(), 5);\n\n                left.Update(DateTime.Today, 10);\n                Assert.AreEqual(2, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(4, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void TimesMultipliesLeftAndConstant_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var composite = (IIndicator)IndicatorExtensions.Times(left.ToPython(), 5);\n\n                left.Update(DateTime.Today, 10);\n                Assert.AreEqual(50, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(100, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void TimesMultipliesLeftAndRight_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var right = new Identity(\"right\");\n                var composite = (IIndicator)IndicatorExtensions.Times(left.ToPython(), right.ToPython());\n\n                left.Update(DateTime.Today, 10);\n                right.Update(DateTime.Today, 10);\n                Assert.AreEqual(100, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(100, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void OverDividesLeftAndRight_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var right = new Identity(\"right\");\n                var composite = (IIndicator)IndicatorExtensions.Over(left.ToPython(), right.ToPython());\n\n                left.Update(DateTime.Today, 10);\n                right.Update(DateTime.Today, 10);\n                Assert.AreEqual(1, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(1, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void PlusAddsLeftAndRight_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var right = new Identity(\"right\");\n                var composite = (IIndicator)IndicatorExtensions.Plus(left.ToPython(), right.ToPython());\n\n                left.Update(DateTime.Today, 10);\n                right.Update(DateTime.Today, 10);\n                Assert.AreEqual(20, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(20, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void MinusSubstractsLeftAndRight_Py()\n        {\n            using (Py.GIL())\n            {\n                var left = new Identity(\"left\");\n                var right = new Identity(\"right\");\n                var composite = (IIndicator)IndicatorExtensions.Minus(left.ToPython(), right.ToPython());\n\n                left.Update(DateTime.Today, 10);\n                right.Update(DateTime.Today, 10);\n                Assert.AreEqual(0, composite.Current.Value);\n\n                left.Update(DateTime.Today, 20);\n                Assert.AreEqual(0, composite.Current.Value);\n            }\n        }\n\n        [Test]\n        public void RunPythonRegressionAlgorithmWithIndicatorExtensions()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"IndicatorExtensionsSMAWithCustomIndicatorsRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0.717\"},\n                    {\"Tracking Error\", \"0.593\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"},\n                    {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus,\n                initialCash: 100000);\n        }\n\n        private class TestIndicatorA : IndicatorBase<IBaseData>\n        {\n            public TestIndicatorA(string name) : base(name)\n            {\n            }\n            public override bool IsReady { get; }\n            protected override decimal ComputeNextValue(IBaseData input)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private class TestIndicatorB : IndicatorBase<IndicatorDataPoint>\n        {\n            public TestIndicatorB(string name) : base(name)\n            {\n            }\n            public override bool IsReady\n            {\n                get\n                {\n                    throw new NotImplementedException();\n                }\n            }\n            protected override decimal ComputeNextValue(IndicatorDataPoint input)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        private class TestIndicator<T> : IndicatorBase<T>\n            where T : IBaseData\n        {\n            public TestIndicator(string name)\n                : base(name)\n            {\n\n            }\n\n            public override bool IsReady\n            {\n                get\n                {\n                    return true;\n                }\n            }\n\n            public void UpdateValue(int value)\n            {\n                Current = new IndicatorDataPoint(DateTime.MinValue, value);\n                OnUpdated(Current);\n            }\n\n            protected override decimal ComputeNextValue(T input)\n            {\n                return input.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/IndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing QuantConnect.Logging;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    ///     Test class for QuantConnect.Indicators.Indicator\n    /// </summary>\n    [TestFixture]\n    public class IndicatorTests\n    {\n        [Test]\n        public void NameSaves()\n        {\n            // just testing that we get the right name out\n            const string name = \"name\";\n            var target = new TestIndicator(name);\n            Assert.AreEqual(name, target.Name);\n        }\n\n        [Test]\n        public void UpdatesProperly()\n        {\n            // we want to make sure the initialized value is the default value\n            // for a datapoint, and also verify the our indicator updates as we\n            // expect it to, in this case, it should return identity\n            var target = new TestIndicator();\n\n            Assert.AreEqual(DateTime.MinValue, target.Current.Time);\n            Assert.AreEqual(0m, target.Current.Value);\n\n            var time = DateTime.UtcNow;\n            var data = new IndicatorDataPoint(time, 1m);\n\n            target.Update(data);\n            Assert.AreEqual(1m, target.Current.Value);\n\n            target.Update(new IndicatorDataPoint(time.AddMilliseconds(1), 2m));\n            Assert.AreEqual(2m, target.Current.Value);\n        }\n\n        [Test]\n        public void ShouldNotThrowOnDifferentDataType()\n        {\n            var target = new TestIndicator();\n            Assert.DoesNotThrow(() =>\n            {\n                target.Update(new Tick());\n            });\n        }\n\n        [Test]\n        public void PassesOnDuplicateTimes()\n        {\n            var target = new TestIndicator();\n\n            var time = DateTime.UtcNow;\n\n            const decimal value1 = 1m;\n            var data = new IndicatorDataPoint(time, value1);\n            target.Update(data);\n            Assert.AreEqual(value1, target.Current.Value);\n\n            // this won't update because we told it to ignore duplicate\n            // data based on time\n            target.Update(data);\n            Assert.AreEqual(value1, target.Current.Value);\n        }\n\n        [Test]\n        public void SortsTheSameAsDecimalDescending()\n        {\n            int count = 100;\n            var targets = Enumerable.Range(0, count)\n                .Select(x => new TestIndicator(x.ToString(CultureInfo.InvariantCulture)))\n                .ToList();\n\n            for (int i = 0; i < targets.Count; i++)\n            {\n                targets[i].Update(DateTime.Today, i);\n            }\n\n            var expected = Enumerable.Range(0, count)\n                .Select(x => (decimal)x)\n                .OrderByDescending(x => x)\n                .ToList();\n\n            var actual = targets.OrderByDescending(x => x).ToList();\n            foreach (var pair in expected.Zip<decimal, TestIndicator, Tuple<decimal, TestIndicator>>(actual, Tuple.Create))\n            {\n                Assert.AreEqual(pair.Item1, pair.Item2.Current.Value);\n            }\n        }\n\n        [Test]\n        public void SortsTheSameAsDecimalAsecending()\n        {\n            int count = 100;\n            var targets = Enumerable.Range(0, count).Select(x => new TestIndicator(x.ToString(CultureInfo.InvariantCulture))).ToList();\n            for (int i = 0; i < targets.Count; i++)\n            {\n                targets[i].Update(DateTime.Today, i);\n            }\n\n            var expected = Enumerable.Range(0, count).Select(x => (decimal)x).OrderBy(x => x).ToList();\n            var actual = targets.OrderBy(x => x).ToList();\n            foreach (var pair in expected.Zip<decimal, TestIndicator, Tuple<decimal, TestIndicator>>(actual, Tuple.Create))\n            {\n                Assert.AreEqual(pair.Item1, pair.Item2.Current.Value);\n            }\n        }\n\n        [Test]\n        public void ComparisonFunctions()\n        {\n            TestComparisonOperators<int>();\n            TestComparisonOperators<long>();\n            TestComparisonOperators<float>();\n            TestComparisonOperators<double>();\n        }\n\n        [Test]\n        public void EqualsMethodShouldNotThrowExceptions()\n        {\n            var indicator = new TestIndicator();\n            var res = true;\n            try\n            {\n                res = indicator.Equals(new Exception(\"\"));\n            }\n            catch (InvalidCastException)\n            {\n                Assert.Fail();\n            }\n            Assert.IsFalse(res);\n        }\n\n        [Test]\n        public void IndicatorMustBeEqualToItself()\n        {\n            var indicators = typeof(Indicator).Assembly.GetTypes()\n                .Where(t => t.BaseType.Name != \"CandlestickPattern\" && !t.Name.StartsWith(\"<\"))\n                .OrderBy(t => t.Name)\n                .ToList();\n\n            var counter = 0;\n            object instantiatedIndicator;\n            foreach (var indicator in indicators)\n            {\n                try\n                {\n                    instantiatedIndicator = Activator.CreateInstance(indicator, new object[] { 10 });\n                    counter++;\n                }\n                catch (Exception)\n                {\n                    // Some indicators will fail because they don't have a single-parameter constructor.\n                    continue;\n                }\n\n                Assert.IsTrue(instantiatedIndicator.Equals(instantiatedIndicator));\n                var anotherInstantiatedIndicator = Activator.CreateInstance(indicator, new object[] { 10 });\n                Assert.IsFalse(instantiatedIndicator.Equals(anotherInstantiatedIndicator));\n            }\n            Log.Trace($\"{counter} indicators out of {indicators.Count} were tested.\");\n        }\n\n        [Test]\n        public void IndicatorsOfDifferentTypeDiplaySameCurrentTime()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spy = algorithm.AddEquity(\"SPY\");\n\n            var indicatorTimeList = new List<DateTime>();\n            // RSI is a DataPointIndicator\n            algorithm.RSI(spy.Symbol, 14).Updated += (_, e) => indicatorTimeList.Add(e.EndTime);\n            // STO is a BarIndicator\n            algorithm.STO(spy.Symbol, 14, 2, 2).Updated += (_, e) => indicatorTimeList.Add(e.EndTime);\n            // MFI is a TradeBarIndicator\n            algorithm.MFI(spy.Symbol, 14).Updated += (_, e) => indicatorTimeList.Add(e.EndTime);\n\n            var consolidators = spy.Subscriptions.SelectMany(x => x.Consolidators).ToList();\n            Assert.AreEqual(3, consolidators.Count);   // One consolidator for each indicator\n\n            var bars = new[] { 30, 31 }.Select(d =>\n                new TradeBar(new DateTime(2020, 03, 04, 9, d, 0),\n                             spy.Symbol, 100, 100, 100, 100, 1000));\n\n            foreach (var bar in bars)\n            {\n                foreach (var consolidator in consolidators)\n                {\n                    consolidator.Update(bar);\n                }\n            }\n\n            // All indicators should have the same EndTime, with xx:31:00 & xx:32:00\n            Assert.AreEqual(6, indicatorTimeList.Count);\n            Assert.AreEqual(2, indicatorTimeList.Distinct().Count());\n            Assert.AreEqual(3, indicatorTimeList.Count(x => x.Minute == 31));\n            Assert.AreEqual(3, indicatorTimeList.Count(x => x.Minute == 32));\n        }\n\n        [TestCase(2)]\n        [TestCase(5)]\n        [TestCase(10)]\n        public void IndicatorKeepsHistory(int historyWindow)\n        {\n            var indicator = new TestIndicator(\"Test indicator\");\n            indicator.Window.Size = historyWindow;\n\n            var points = new List<IndicatorDataPoint>(100);\n            var referenceDate = new DateTime(2023, 06, 12, 9, 0, 0);\n            for (int i = 0; i < 100; i++)\n            {\n                // The first iteration will not update the indicator. By default, first value is IndicatorDataPoint(DateTime.MinValue, 0)\n                if (i == 0)\n                {\n                    var defaultValue = new IndicatorDataPoint(DateTime.MinValue, 0);\n                    Assert.AreEqual(defaultValue, indicator.Current);\n                    Assert.AreEqual(defaultValue, indicator[0]);\n                }\n                else\n                {\n                    var dateTime = referenceDate.AddMinutes(i);\n                    indicator.Update(dateTime, i);\n                    var expected = new IndicatorDataPoint(dateTime, i);\n\n                    Assert.AreEqual(expected, indicator.Current);\n                    Assert.AreEqual(expected, indicator[0]);\n                }\n\n                points.Insert(0, indicator[0]);\n                var startIndex = Math.Max(0, i - historyWindow + 1);\n                for (int j = startIndex; j <= i; j++)\n                {\n                    Assert.AreEqual(points[i - j], indicator[i - j]);\n                }\n\n                // Check the enumerator\n                var windowPoints = indicator.ToList();\n                var count = i - startIndex < historyWindow ? i - startIndex + 1 : historyWindow;\n                CollectionAssert.AreEqual(points.GetRange(0, count), windowPoints);\n            }\n        }\n\n        [Test]\n        public void HistoryWindowIsCorrectlyReset()\n        {\n            var indicator = new TestIndicator(\"Test indicator\");\n            indicator.Window.Size = 20;\n\n            // Update the indicator a few times\n            var referenceDate = new DateTime(2023, 06, 12, 9, 0, 0);\n            for (var i = 1; i < indicator.Window.Size; i++)\n            {\n                indicator.Update(referenceDate.AddMinutes(i - 1), i);\n            }\n\n            Assert.AreEqual(indicator.Window.Size, indicator.Window.Count);\n\n            indicator.Reset();\n\n            // Window size is kept\n            Assert.AreEqual(20, indicator.Window.Size);\n\n            // Window values are removed\n            Assert.AreEqual(1, indicator.Window.Count);\n            Assert.AreEqual(new IndicatorDataPoint(DateTime.MinValue, 0), indicator[0]);\n            Assert.IsNull(indicator[1]);\n        }\n\n        [Test]\n        public void CanAccessCurrentAndPreviousState()\n        {\n            var indicator = new TestIndicator(\"Test indicator\");\n            indicator.Window.Size = 10;\n\n            // Update the indicator a few times\n            var referenceDate = new DateTime(2023, 06, 12, 9, 0, 0);\n            var dataPoints = new List<IndicatorDataPoint>(indicator.Window.Size);\n            for (var i = 0; i < indicator.Window.Size; i++)\n            {\n                var dateTime = referenceDate.AddMinutes(i);\n                indicator.Update(dateTime, i);\n                dataPoints.Add(new IndicatorDataPoint(dateTime, i));\n            }\n\n            Assert.AreEqual(dataPoints[^1], indicator.Current);\n            Assert.AreEqual(dataPoints[^1], indicator[0]);\n\n            Assert.AreEqual(dataPoints[^2], indicator.Previous);\n            Assert.AreEqual(dataPoints[^2], indicator[1]);\n        }\n\n        [Test]\n        public void PreviousValueIsNotNullAtStart()\n        {\n            var indicator = new TestIndicator(\"Test indicator\");\n\n            // Access current and previous without warming the indicator up\n            var defaultValue = new IndicatorDataPoint(DateTime.MinValue, 0);\n            Assert.IsNotNull(indicator.Current);\n            Assert.AreEqual(defaultValue, indicator.Current);\n            Assert.IsNotNull(indicator.Previous);\n            Assert.AreEqual(defaultValue, indicator.Previous);\n        }\n\n        [Test]\n        public void IndicatorShouldRetainSymbolWhenUpdatedWithDifferentDataType()\n        {\n            var target = new TestIndicator();\n            var date = new DateTime(2020, 1, 1);\n            target.Update(new Tick(date, Symbols.SPY, 1, 1));\n            Assert.AreEqual(Symbols.SPY, target.Current.Symbol);\n        }\n\n        private static void TestComparisonOperators<TValue>()\n        {\n            var indicator = new TestIndicator();\n            TestOperator(indicator, default(TValue), \"GreaterThan\", true, false);\n            TestOperator(indicator, default(TValue), \"GreaterThan\", false, false);\n            TestOperator(indicator, default(TValue), \"GreaterThanOrEqual\", true, true);\n            TestOperator(indicator, default(TValue), \"GreaterThanOrEqual\", false, true);\n            TestOperator(indicator, default(TValue), \"LessThan\", true, false);\n            TestOperator(indicator, default(TValue), \"LessThan\", false, false);\n            TestOperator(indicator, default(TValue), \"LessThanOrEqual\", true, true);\n            TestOperator(indicator, default(TValue), \"LessThanOrEqual\", false, true);\n            TestOperator(indicator, default(TValue), \"Equality\", true, true);\n            TestOperator(indicator, default(TValue), \"Equality\", false, true);\n            TestOperator(indicator, default(TValue), \"Inequality\", true, false);\n            TestOperator(indicator, default(TValue), \"Inequality\", false, false);\n        }\n\n        private static void TestOperator<TIndicator, TValue>(TIndicator indicator, TValue value, string opName, bool tvalueIsFirstParm, bool expected)\n        {\n            var method = GetOperatorMethodInfo<TValue>(opName, tvalueIsFirstParm ? 0 : 1);\n            var ctIndicator = Expression.Constant(indicator);\n            var ctValue = Expression.Constant(value);\n            var call = tvalueIsFirstParm ? Expression.Call(method, ctValue, ctIndicator) : Expression.Call(method, ctIndicator, ctValue);\n            var lamda = Expression.Lambda<Func<bool>>(call);\n            var func = lamda.Compile();\n            Assert.AreEqual(expected, func());\n        }\n\n        private static MethodInfo GetOperatorMethodInfo<T>(string @operator, int argIndex)\n        {\n            var methodName = \"op_\" + @operator;\n            var method =\n                typeof(IndicatorBase).GetMethods(BindingFlags.Static | BindingFlags.Public)\n                .SingleOrDefault(x => x.Name == methodName && x.GetParameters()[argIndex].ParameterType == typeof(T));\n\n            if (method == null)\n            {\n                Assert.Fail(\"Failed to find method for \" + @operator + \" of type \" + typeof(T).Name + \" at index: \" + argIndex);\n            }\n\n            return method;\n        }\n\n        private class TestIndicator : Indicator\n        {\n            /// <summary>\n            ///     Initializes a new instance of the Indicator class using the specified name.\n            /// </summary>\n            /// <param name=\"name\">The name of this indicator</param>\n            public TestIndicator(string name)\n                : base(name)\n            {\n            }\n            /// <summary>\n            ///     Initializes a new instance of the Indicator class using the name \"test\"\n            /// </summary>\n            public TestIndicator()\n                : base(\"test\")\n            {\n            }\n\n            /// <summary>\n            ///     Gets a flag indicating when this indicator is ready and fully initialized\n            /// </summary>\n            public override bool IsReady\n            {\n                get { return true; }\n            }\n\n            /// <summary>\n            ///     Computes the next value of this indicator from the given state\n            /// </summary>\n            /// <param name=\"input\">The input given to the indicator</param>\n            /// <returns>A new value for this indicator</returns>\n            protected override decimal ComputeNextValue(IndicatorDataPoint input)\n            {\n                return input.Value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/InternalBarStrengthTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class InternalBarStrengthTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new InternalBarStrength(\"IBS\");\n        }\n\n        protected override string TestFileName => \"spy_with_ibs.csv\";\n\n        protected override string TestColumnName => \"IBS\";\n\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/KaufmanAdaptiveMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class KaufmanAdaptiveMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new KaufmanAdaptiveMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_kama.txt\";\n\n        protected override string TestColumnName => \"KAMA_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/KaufmanEfficiencyRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class KaufmanEfficiencyRatioTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new KaufmanEfficiencyRatio(10);\n        }\n\n        protected override string TestFileName => \"spy_ker.txt\";\n\n        protected override string TestColumnName => \"KER\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/KeltnerChannelsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class KeltnerChannelsTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new KeltnerChannels(20, 1.5m);\n        }\n\n        protected override string TestFileName => \"spy_with_keltner.csv\";\n\n        protected override string TestColumnName => \"Middle Band\";\n\n        [Test]\n        public void ComparesWithExternalDataUpperBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Keltner Channels 20 Top\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double) ((KeltnerChannels) ind).UpperBand.Current.Value,\n                    1e-3\n                )\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataLowerBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Keltner Channels 20 Bottom\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double) ((KeltnerChannels) ind).LowerBand.Current.Value,\n                    1e-3\n                )\n            );\n        }\n\n        [Test]\n        public void ComparesTimeStampBetweenKeltnerChannelAndMiddleBand()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Middle Band\",\n                (ind, expected) => Assert.AreEqual(\n                    ((KeltnerChannels)ind).Current.EndTime,\n                    ((KeltnerChannels)ind).MiddleBand.Current.EndTime\n                )\n            );\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var kch = CreateIndicator() as KeltnerChannels;\n            foreach (var data in TestHelper.GetTradeBarStream(TestFileName, false))\n            {\n               kch.Update(data);\n            }\n\n            Assert.IsTrue(kch.IsReady);\n            Assert.IsTrue(kch.UpperBand.IsReady);\n            Assert.IsTrue(kch.LowerBand.IsReady);\n            Assert.IsTrue(kch.MiddleBand.IsReady);\n            Assert.IsTrue(kch.AverageTrueRange.IsReady);\n\n            kch.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(kch);\n            TestHelper.AssertIndicatorIsInDefaultState(kch.UpperBand);\n            TestHelper.AssertIndicatorIsInDefaultState(kch.LowerBand);\n            TestHelper.AssertIndicatorIsInDefaultState(kch.AverageTrueRange);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/KlingerVolumeOscillatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n\n    /// <summary>\n    /// Tests for the Klinger Volume Oscillator (KVO) indicator\n    /// </summary>\n    public class KlingerVolumeOscillatorTests : CommonIndicatorTests<TradeBar>\n    {\n        /// <summary>\n        /// Generated Klinger Volume Oscillator test data from talipp\n        /// </summary>\n        protected override string TestFileName => \"spy_with_kvo.csv\";\n\n        /// <summary>\n        /// Generated column for KVO(5,10) from talipp\n        /// </summary>\n        protected override string TestColumnName => \"KVO5_10\";\n\n        /// <summary>\n        /// Required by CommonIndicatorTests: return a fresh instance of your indicator.\n        /// </summary>\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n\n            // match generated data from talipp\n            return new KlingerVolumeOscillator(fastPeriod: 5, slowPeriod: 10);\n        }\n\n        /// <summary>\n        /// This indicator doesn't accept Renko Bars as input. Skip this test.\n        /// </summary>\n        public override void AcceptsRenkoBarsAsInput()\n        {\n        }\n\n        [Test]\n        public void SignalLineIsReadyAfterWarmUpPeriod()\n        {\n            var indicator = CreateIndicator() as KlingerVolumeOscillator;\n            Assert.IsFalse(indicator.Signal.IsReady);\n            // Warm up the indicator\n            for (int i = 0; i < indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(new TradeBar { Time = DateTime.UtcNow.AddDays(i), Close = 100 + i, Volume = 1000 });\n            }\n            Assert.IsTrue(indicator.Signal.IsReady);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/KnowSureThingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class KnowSureThingTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new KnowSureThing(5, 5, 10, 5, 15, 5, 25, 10, 9, MovingAverageType.Simple);\n        }\n\n        protected override string TestFileName => \"spy_with_kst.csv\";\n\n        protected override string TestColumnName => \"kst\";\n\n        [Test]\n        public void ComparesWithExternalDataSignal()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as KnowSureThing,\n                TestFileName,\n                \"signal\",\n                ind => (double)ind.SignalLine.Current.Value\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/LeastSquaresMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Result tested vs. Python available at: http://tinyurl.com/o7redso\n    /// </summary>\n    [TestFixture]\n    public class LeastSquaresMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new LeastSquaresMovingAverage(20);\n        }\n\n        protected override string TestFileName => string.Empty;\n\n        protected override string TestColumnName => string.Empty;\n\n        #region Array input\n        // Real AAPL minute data rounded to 2 decimals.\n        public static decimal[] Prices =\n        {\n            125.99m, 125.91m, 125.75m, 125.62m, 125.54m, 125.45m, 125.47m,\n            125.4m , 125.43m, 125.45m, 125.42m, 125.36m, 125.23m, 125.32m,\n            125.26m, 125.31m, 125.41m, 125.5m , 125.51m, 125.41m, 125.54m,\n            125.51m, 125.61m, 125.43m, 125.42m, 125.42m, 125.46m, 125.43m,\n            125.4m , 125.35m, 125.3m , 125.28m, 125.21m, 125.37m, 125.32m,\n            125.34m, 125.37m, 125.26m, 125.28m, 125.16m\n        };\n        #endregion Array input\n\n        #region Array expected\n        public static decimal[] Expected =\n        {\n            125.99m  , 125.91m  , 125.75m  , 125.62m  , 125.54m  , 125.45m  ,\n            125.47m  , 125.4m   , 125.43m  , 125.45m  , 125.42m  , 125.36m  ,\n            125.23m  , 125.32m  , 125.26m  , 125.31m  , 125.41m  , 125.5m   ,\n            125.51m  , 125.2679m  , 125.328m , 125.381m , 125.4423m, 125.4591m,\n            125.4689m, 125.4713m, 125.4836m, 125.4834m, 125.4803m, 125.4703m,\n            125.4494m, 125.4206m, 125.3669m, 125.3521m, 125.3214m, 125.2986m,\n            125.2909m, 125.2723m, 125.2619m, 125.2224m,\n        };\n        #endregion Array input\n\n        protected override void RunTestIndicator(IndicatorBase<IndicatorDataPoint> indicator)\n        {\n            var time = DateTime.Now;\n\n            for (var i = 0; i < Prices.Length; i++)\n            {\n                indicator.Update(time.AddMinutes(i), Prices[i]);\n                Assert.AreEqual(Expected[i], Math.Round(indicator.Current.Value, 4));\n            }\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var indicator = CreateIndicator();\n            var time = DateTime.Now;\n\n            for (var i = 0; i < 20; i++)\n            {\n                indicator.Update(time.AddMinutes(i), Prices[i]);\n                Assert.AreEqual(Expected[i], Math.Round(indicator.Current.Value, 4));\n            }\n\n            Assert.IsTrue(indicator.IsReady, \"LeastSquaresMovingAverage Ready\");\n            indicator.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var period = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!period.HasValue) return;\n\n            var time = DateTime.Now;\n\n            for (var i = 1; i < period.Value; i++)\n            {\n                indicator.Update(time.AddMinutes(i - 1), Prices[i - 1]);\n                Assert.AreEqual(Expected[i - 1], Math.Round(indicator.Current.Value, 4));\n                Assert.IsFalse(indicator.IsReady);\n            }\n\n            indicator.Update(time.AddMinutes(period.Value - 1), Prices[period.Value - 1]);\n            Assert.IsTrue(indicator.IsReady);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/LinearWeightedMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class LinearWeightedMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override string TestFileName => \"spx_lwma.csv\";\n\n        protected override string TestColumnName => \"LWMA\";\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new LinearWeightedMovingAverage(6);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        // See http://en.wikipedia.org/wiki/Moving_average\n        // for the formula and the numbers in this test.\n        public void ComputesCorrectly(int period)\n        {\n            var values = new[] {77m, 79m, 79m, 81m, 83m};\n            var weights = Enumerable.Range(1, period).ToArray();\n            var current = weights.Sum(i => i * values[i - 1]) / weights.Sum();\n\n            var lwma = new LinearWeightedMovingAverage(period);\n            var time = DateTime.UtcNow;\n\n            for (var i = 0; i < period; i++)\n            {\n                lwma.Update(time.AddSeconds(i), values[i]);\n            }\n            Assert.AreEqual(current, lwma.Current.Value);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var lwma = new LinearWeightedMovingAverage(6);\n\n            foreach (var data in TestHelper.GetDataStream(8))\n            {\n                lwma.Update(data);\n            }\n            Assert.IsTrue(lwma.IsReady);\n            Assert.AreNotEqual(0m, lwma.Current.Value);\n            Assert.AreNotEqual(0, lwma.Samples);\n\n            lwma.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(lwma);\n        }\n\n        [TestCase(1)]\n        [TestCase(2)]\n        [TestCase(3)]\n        [TestCase(4)]\n        [TestCase(5)]\n        // See http://en.wikipedia.org/wiki/Moving_average\n        // for the formula and the numbers in this test.\n        public void WarmsUpProperly(int period)\n        {\n            var values = new[] { 77m, 79m, 79m, 81m, 83m };\n            var weights = Enumerable.Range(1, period).ToArray();\n            var current = weights.Sum(i => i * values[i - 1]) / weights.Sum();\n\n            var lwma = new LinearWeightedMovingAverage(period);\n            var time = DateTime.UtcNow;\n\n            var warmUpPeriod = (lwma as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            for (var i = 0; i < warmUpPeriod; i++)\n            {\n                lwma.Update(time.AddSeconds(i), values[i]);\n                Assert.AreEqual(i == warmUpPeriod - 1, lwma.IsReady);\n            }\n            Assert.AreEqual(current, lwma.Current.Value);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/LogReturnTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class LogReturnTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new LogReturn(14);\n        }\n\n        protected override string TestFileName => \"spy_logr14.txt\";\n\n        protected override string TestColumnName => \"LOGR14\";\n\n        [Test]\n        public void LOGRComputesCorrectly()\n        {\n            var period = 4;\n            var logr = new LogReturn(period);\n            var data = new[] { 1, 10, 100, 1000, 10000, 1234, 56789 };\n            var seen = new List<int>();\n            var time = DateTime.Now;\n\n            for (var i = 0; i < data.Length; i++)\n            {\n                var datum = data[i];\n                var value0 = 0.0;\n\n                if (seen.Count >= 0 && seen.Count < period)\n                {\n                    value0 = data[0];\n                }\n                else if (seen.Count >= period)\n                {\n                    value0 = data[i - period];\n                }\n\n                var expected = (decimal)Math.Log(datum / value0);\n\n                seen.Add(datum);\n                logr.Update(time.AddSeconds(i), datum);\n                Assert.AreEqual(expected, logr.Current.Value);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MassIndexTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MassIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new MassIndex();\n        }\n\n        protected override string TestFileName => \"spy_mass_index_25.txt\";\n\n        protected override string TestColumnName => \"MassIndex\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MaximumTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MaximumTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new Maximum(5);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_max.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"MAX_5\"; }\n        }\n\n        [Test]\n        public void ComputesCorrectly()\n        {\n            var max = new Maximum(3);\n\n            var reference = DateTime.MinValue;\n\n            max.Update(reference.AddDays(1), 1m);\n            Assert.AreEqual(1m, max.Current.Value);\n            Assert.AreEqual(0, max.PeriodsSinceMaximum);\n\n            max.Update(reference.AddDays(2), -1m);\n            Assert.AreEqual(1m, max.Current.Value);\n            Assert.AreEqual(1, max.PeriodsSinceMaximum);\n\n            max.Update(reference.AddDays(3), 0m);\n            Assert.AreEqual(1m, max.Current.Value);\n            Assert.AreEqual(2, max.PeriodsSinceMaximum);\n\n            max.Update(reference.AddDays(4), -2m);\n            Assert.AreEqual(0m, max.Current.Value);\n            Assert.AreEqual(1, max.PeriodsSinceMaximum);\n\n            max.Update(reference.AddDays(5), -2m);\n            Assert.AreEqual(0m, max.Current.Value);\n            Assert.AreEqual(2, max.PeriodsSinceMaximum);\n        }\n\n        [Test]\n        public void ComputesCorrectlyMaximum()\n        {\n            const int period = 5;\n            var max = new Maximum(period);\n\n            Assert.AreEqual(0m, max.Current.Value);\n\n            // test an increasing stream of data\n            for (int i = 0; i < period; i++)\n            {\n                max.Update(DateTime.Now.AddDays(i), i);\n                Assert.AreEqual(i, max.Current.Value);\n                Assert.AreEqual(0, max.PeriodsSinceMaximum);\n            }\n\n            // test a decreasing stream of data\n            for (int i = 0; i < period; i++)\n            {\n                max.Update(DateTime.Now.AddDays(period + i), period - i - 1);\n                Assert.AreEqual(period - 1, max.Current.Value);\n                Assert.AreEqual(i, max.PeriodsSinceMaximum);\n            }\n\n            Assert.AreEqual(max.Period, max.PeriodsSinceMaximum + 1);\n        }\n\n        [Test]\n        public void ResetsProperlyMaximum()\n        {\n            var max = new Maximum(3);\n            max.Update(DateTime.Today, 1m);\n            max.Update(DateTime.Today.AddSeconds(1), 2m);\n            max.Update(DateTime.Today.AddSeconds(2), 1m);\n            Assert.IsTrue(max.IsReady);\n\n            max.Reset();\n            Assert.AreEqual(0, max.PeriodsSinceMaximum);\n            TestHelper.AssertIndicatorIsInDefaultState(max);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/McClellanIndicatorsTestHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public interface ITestMcClellanOscillator\n    {\n        public void TestUpdate(IndicatorDataPoint input);\n    }\n\n    /// <summary> \n    /// Miscellaneous tool for McClellan Indicator test\n    /// </summary>\n    public class McClellanIndicatorTestHelper\n    {\n        /// <summary> \n        /// Run test for McClellan Indicator\n        /// </summary>\n        /// <param name=\"indicator\">McClellan Indicator instance</param>\n        /// <param name=\"fileName\">External source file name</param>\n        /// <param name=\"columnName\">External source reference column name</param>\n        public static void RunTestIndicator<T>(T indicator, string fileName, string columnName)\n            where T : TradeBarIndicator, ITestMcClellanOscillator\n        {\n            foreach (var parts in TestHelper.GetCsvFileStream(fileName))\n            {\n                parts.TryGetValue(\"a/d difference\", out var adDifference);\n                parts.TryGetValue(\"date\", out var date);\n\n                var data = new IndicatorDataPoint(Parse.DateTimeExact(date, \"yyyyMMdd\"), adDifference.ToDecimal());\n                indicator.TestUpdate(data);\n\n                if (!indicator.IsReady || !parts.TryGetValue(columnName, out var expected))\n                {\n                    continue;\n                }\n\n                // Source data has only 2 decimal places\n                Assert.AreEqual(Parse.Double(expected), (double)indicator.Current.Value, 0.02d);\n            }\n        }\n\n        /// <summary>\n        /// Updates the given consolidator with the entries from the given external CSV file\n        /// </summary>\n        /// <param name=\"renkoConsolidator\">RenkoConsoliadtor instance</param>\n        /// <param name=\"fileName\">External source file name</param>\n        public static void UpdateRenkoConsolidator(IDataConsolidator renkoConsolidator, string fileName)\n        {\n            var closeValue = 1m;\n            foreach (var parts in TestHelper.GetCsvFileStream(fileName))\n            {\n                parts.TryGetValue(\"a/d difference\", out var adDifference);\n                parts.TryGetValue(\"date\", out var date);\n\n                var data = new TradeBar() { Symbol = Symbols.SPY, Close = closeValue, Open = closeValue - 1, Volume = 1, Time = Parse.DateTimeExact(date, \"yyyyMMdd\") };\n                closeValue++;\n                renkoConsolidator.Update(data);\n            }\n        }\n\n        /// <summary> \n        /// Get the simulated number of advance and decline asset\n        /// </summary>\n        /// <param name=\"adDifference\">Number of advancing asset minus that of declining ones</param>\n        /// <param name=\"advance\">Simulated number of advancing asset</param>\n        /// <param name=\"decline\">Simulated number of declining asset</param>\n        public static bool GetAdvanceDeclineNumber(decimal adDifference, out int advance, out int decline)\n        {\n            // x + (3000 - x) = adDifference\n            var simulatedAdvance = (adDifference + 2530m) / 2m;\n\n            // Both -0.5 if `simulatedAdvance` is not divisible by 2\n            if (simulatedAdvance % 1 != 0)\n            {\n                advance = (int)Math.Floor(simulatedAdvance);\n                decline = 2530 - advance - 1;\n                return false;\n            }\n\n            advance = (int)simulatedAdvance;\n            decline = 2530 - advance;\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/McClellanOscillatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class McClellanOscillatorTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var mcClellanOscillator = new McClellanOscillator(19, 39);\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(mcClellanOscillator.Add);\n            }\n            else\n            {\n                mcClellanOscillator.Add(Symbols.MSFT);\n                mcClellanOscillator.Add(Symbols.GOOG);\n                mcClellanOscillator.Add(Symbols.AAPL);\n            }\n            return mcClellanOscillator;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL, Symbols.IBM];\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = (McClellanOscillator)CreateIndicator();\n            var reference = DateTime.Today;\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n            }\n\n            Assert.AreEqual(0m, indicator.Current.Value);\n            Assert.AreEqual(indicator.WarmUpPeriod * 3, indicator.Samples);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var indicator = (McClellanOscillator)CreateIndicator();\n            var reference = DateTime.Today;\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            var indicator = new TestMcClellanOscillator();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            var indicator = new TestMcClellanOscillator();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n            indicator.Reset();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = new TestMcClellanOscillator();\n            var renkoConsolidator = new RenkoConsolidator(0.5m);\n            renkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            McClellanIndicatorTestHelper.UpdateRenkoConsolidator(renkoConsolidator, TestFileName);\n            Assert.AreNotEqual(0, indicator.Samples);\n            renkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = new TestMcClellanOscillator();\n            var volumeRenkoConsolidator = new VolumeRenkoConsolidator(0.5m);\n            volumeRenkoConsolidator.DataConsolidated += (sender, volumeRenkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(volumeRenkoBar));\n            };\n\n            McClellanIndicatorTestHelper.UpdateRenkoConsolidator(volumeRenkoConsolidator, TestFileName);\n            Assert.AreNotEqual(0, indicator.Samples);\n            volumeRenkoConsolidator.Dispose();\n        }\n\n        protected override string TestFileName => \"mcclellan_data.csv\";\n\n        protected override string TestColumnName => \"MO\";\n    }\n\n    public class TestMcClellanOscillator : McClellanOscillator, ITestMcClellanOscillator\n    {\n        private Dictionary<Symbol, decimal> _symbols = new();\n        private int _dateCount = 1;\n\n        public TestMcClellanOscillator() : base()\n        {\n            // Maximum A/D difference from the test set is 2527\n            for (int i = 1; i <= 2530; i++)\n            {\n                var symbol = Symbol.Create($\"TestSymbol{i}\", SecurityType.Equity, Market.USA);\n                _symbols.Add(symbol, 0m);\n                Add(symbol);\n            }\n\n            // Set to the first EMA values to account for past A/D Difference values that we don't have access\n            Reset();\n            EMAFast.Update(new DateTime(2022, 6, 30), -209.85m);\n            EMASlow.Update(new DateTime(2022, 6, 30), -186.41m);\n        }\n\n        public void TestUpdate(IndicatorDataPoint input)\n        {\n            var isTotal2530 = McClellanIndicatorTestHelper.GetAdvanceDeclineNumber(input.Value, out var advance, out var decline);\n            var symbols = _symbols.Keys.ToList();\n\n            for (int i = 0; i < advance; i++)\n            {\n                Update(new TradeBar() { Symbol = symbols[i], Close = _dateCount, Volume = 1, Time = input.Time });\n                _symbols[symbols[i]] = _dateCount;\n            }\n            for (int j = 1; j <= decline; j++)\n            {\n                Update(new TradeBar() { Symbol = symbols[^j], Close = -_dateCount, Volume = 1, Time = input.Time });\n                _symbols[symbols[^j]] = -_dateCount;\n            }\n            if (!isTotal2530)\n            {\n                Update(new TradeBar() { Symbol = symbols[advance], Close = _symbols[symbols[advance]], Volume = 1, Time = input.Time });\n            }\n\n            _dateCount += 1;\n        }\n\n        public override void Reset()\n        {\n            base.Reset();\n            _dateCount = 1;\n\n            foreach (var symbol in _symbols.Keys)\n            {\n                _symbols[symbol] = 0m;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/McClellanSummationIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class McClellanSummationIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            var mcClellanOscillator = new McClellanSummationIndex(19, 39);\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(mcClellanOscillator.Add);\n            }\n            else\n            {\n                mcClellanOscillator.Add(Symbols.MSFT);\n                mcClellanOscillator.Add(Symbols.GOOG);\n                mcClellanOscillator.Add(Symbols.AAPL);\n            }\n            return mcClellanOscillator;\n        }\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL, Symbols.IBM];\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = (McClellanSummationIndex)CreateIndicator();\n            var reference = DateTime.Today;\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n            }\n\n            Assert.AreEqual(60m, indicator.Current.Value);\n            Assert.AreEqual(indicator.WarmUpPeriod * 3, indicator.Samples);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var indicator = (McClellanSummationIndex)CreateIndicator();\n            var reference = DateTime.Today;\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = i, Volume = 1, Time = reference.AddMinutes(i) });\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            var indicator = new TestMcClellanSummationIndex();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            var indicator = new TestMcClellanSummationIndex();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n            indicator.Reset();\n            McClellanIndicatorTestHelper.RunTestIndicator(indicator, TestFileName, TestColumnName);\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = new TestMcClellanSummationIndex();\n            var renkoConsolidator = new RenkoConsolidator(0.5m);\n            renkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            McClellanIndicatorTestHelper.UpdateRenkoConsolidator(renkoConsolidator, TestFileName);\n            Assert.AreNotEqual(0, indicator.Samples);\n            renkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = new TestMcClellanSummationIndex();\n            var volumeRenkoConsolidator = new VolumeRenkoConsolidator(0.5m);\n            volumeRenkoConsolidator.DataConsolidated += (sender, volumeRenkoBar) =>\n            {\n                Assert.DoesNotThrow(() => indicator.Update(volumeRenkoBar));\n            };\n\n            McClellanIndicatorTestHelper.UpdateRenkoConsolidator(volumeRenkoConsolidator, TestFileName);\n            Assert.AreNotEqual(0, indicator.Samples);\n            volumeRenkoConsolidator.Dispose();\n        }\n\n        protected override string TestFileName => \"mcclellan_data.csv\";\n\n        protected override string TestColumnName => \"MSI\";\n    }\n\n    public class TestMcClellanSummationIndex : McClellanSummationIndex, ITestMcClellanOscillator\n    {\n        private Dictionary<Symbol, decimal> _symbols = new();\n        private int _dateCount = 1;\n\n        public TestMcClellanSummationIndex() : base()\n        {\n            // Maximum A/D difference from the test set is 2527\n            for (int i = 1; i <= 2530; i++)\n            {\n                var symbol = Symbol.Create($\"TestSymbol{i}\", SecurityType.Equity, Market.USA);\n                _symbols.Add(symbol, 0m);\n                Add(symbol);\n            }\n\n            // Set to the first EMA values to account for past A/D Difference values that we don't have access\n            Reset();\n            Summation.Time = new DateTime(2022, 6, 30);\n            Summation.Value = -606.25m;\n            McClellanOscillator.EMAFast.Update(new DateTime(2022, 6, 30), -209.85m);\n            McClellanOscillator.EMASlow.Update(new DateTime(2022, 6, 30), -186.41m);\n        }\n\n        public void TestUpdate(IndicatorDataPoint input)\n        {\n            var isTotal2530 = McClellanIndicatorTestHelper.GetAdvanceDeclineNumber(input.Value, out var advance, out var decline);\n            var symbols = _symbols.Keys.ToList();\n\n            for (int i = 0; i < advance; i++)\n            {\n                Update(new TradeBar() { Symbol = symbols[i], Close = _dateCount, Volume = 1, Time = input.Time });\n                _symbols[symbols[i]] = _dateCount;\n            }\n            for (int j = 1; j <= decline; j++)\n            {\n                Update(new TradeBar() { Symbol = symbols[^j], Close = -_dateCount, Volume = 1, Time = input.Time });\n                _symbols[symbols[^j]] = -_dateCount;\n            }\n            if (!isTotal2530)\n            {\n                Update(new TradeBar() { Symbol = symbols[advance], Close = _symbols[symbols[advance]], Volume = 1, Time = input.Time });\n            }\n\n            _dateCount += 1;\n        }\n\n        public override void Reset()\n        {\n            base.Reset();\n            _dateCount = 1;\n\n            foreach (var symbol in _symbols.Keys)\n            {\n                _symbols[symbol] = 0m;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/McGinleyDynamicTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class McGinleyDynamicTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new McGinleyDynamic(14);\n        }\n\n        protected override string TestFileName => \"spy_with_McGinleyDynamic.csv\";\n        protected override string TestColumnName => \"McGinleyDynamic14\";\n\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var indicator = new McGinleyDynamic(3);\n\n            indicator.Update(new DateTime(2024, 7, 9, 0, 1, 0), 1m);\n            indicator.Update(new DateTime(2024, 7, 9, 0, 2, 0), 1m);\n            Assert.IsFalse(indicator.IsReady);\n            indicator.Update(new DateTime(2024, 7, 9, 0, 3, 0), 1m);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var indicator = new McGinleyDynamic(3);\n\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                indicator.Update(data);\n            }\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n            indicator.Update(new DateTime(2024, 7, 9, 0, 1, 0), 2.0m);\n            indicator.Update(new DateTime(2024, 7, 9, 0, 2, 0), 2.0m);\n            indicator.Update(new DateTime(2024, 7, 9, 0, 3, 0), 2.0m);\n            Assert.AreEqual(indicator.Current.Value, 2.0m);\n        }\n\n        [Test]\n        public override void WorksWithLowValues()\n        {\n            var indicator = new McGinleyDynamic(\"test\", 10);\n\n            var startDate = new DateTime(2020, 6, 4);\n            var dataPoints = new List<IndicatorDataPoint>()\n            {\n                new IndicatorDataPoint(startDate, 0m),\n                new IndicatorDataPoint(startDate.AddDays(1), 0m),\n                new IndicatorDataPoint(startDate.AddDays(2), 0m),\n                new IndicatorDataPoint(startDate.AddDays(3), 0m),\n                new IndicatorDataPoint(startDate.AddDays(4), 3.27743794800m),\n                new IndicatorDataPoint(startDate.AddDays(5), 7.46527532600m),\n                new IndicatorDataPoint(startDate.AddDays(6), 2.54419732600m),\n                new IndicatorDataPoint(startDate.AddDays(7), 0m),\n                new IndicatorDataPoint(startDate.AddDays(8), 0m),\n                new IndicatorDataPoint(startDate.AddDays(9), 0.71847738800m),\n                new IndicatorDataPoint(startDate.AddDays(10), 0m),\n                new IndicatorDataPoint(startDate.AddDays(11), 1.86016748400m),\n                new IndicatorDataPoint(startDate.AddDays(12), 0.45273917600m),\n                new IndicatorDataPoint(startDate.AddDays(13), 0m),\n                new IndicatorDataPoint(startDate.AddDays(14), 1.80111454800m),\n                new IndicatorDataPoint(startDate.AddDays(15), 0m),\n                new IndicatorDataPoint(startDate.AddDays(16), 2.74596152400m),\n                new IndicatorDataPoint(startDate.AddDays(17), 0m),\n                new IndicatorDataPoint(startDate.AddDays(18), 0m),\n                new IndicatorDataPoint(startDate.AddDays(19), 0m),\n                new IndicatorDataPoint(startDate.AddDays(20), 0.84642541600m),\n            };\n\n            for (int i=0; i < 21; i++)\n            {\n                Assert.DoesNotThrow(() => indicator.Update(dataPoints[i]));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/MeanAbsoluteDeviationTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MeanAbsoluteDeviationTests\n    {\n        [Test]\n        public void ComputesCorrectly()\n        {\n            // Indicator output was compared against the octave code:\n            // mad = @(v) mean(abs(v - mean(v)));\n            var mad = new MeanAbsoluteDeviation(3);\n            var reference = DateTime.MinValue;\n\n            mad.Update(reference.AddDays(1), 1m);\n            Assert.AreEqual(0m, mad.Current.Value);\n\n            mad.Update(reference.AddDays(2), -1m);\n            Assert.AreEqual(1m, mad.Current.Value);\n\n            mad.Update(reference.AddDays(3), 1m);\n            Assert.AreEqual(0.888888888888889m, decimal.Round(mad.Current.Value, 15));\n\n            mad.Update(reference.AddDays(4), -2m);\n            Assert.AreEqual(1.111111111111111m, decimal.Round(mad.Current.Value, 15));\n\n            mad.Update(reference.AddDays(5), 3m);\n            Assert.AreEqual(1.777777777777778m, decimal.Round(mad.Current.Value, 15));\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var mad = new MeanAbsoluteDeviation(3);\n            mad.Update(DateTime.Today, 1m);\n            mad.Update(DateTime.Today.AddSeconds(1), 2m);\n            mad.Update(DateTime.Today.AddSeconds(1), 1m);\n            Assert.IsTrue(mad.IsReady);\n\n            mad.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(mad);\n            TestHelper.AssertIndicatorIsInDefaultState(mad.Mean);\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            var mad = new MeanAbsoluteDeviation(20);\n            var time = DateTime.Today;\n            var period = ((IIndicatorWarmUpPeriodProvider)mad).WarmUpPeriod;\n\n            for (var i = 0; i < period; i++)\n            {\n                mad.Update(time.AddDays(i), i);\n                Assert.AreEqual(i == period - 1, mad.IsReady);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MesaAdaptiveMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MesaAdaptiveMovingAverageTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new MesaAdaptiveMovingAverage(\"MAMA\");\n        }\n        protected override string TestFileName => \"spy_mama.csv\";\n\n        protected override string TestColumnName => \"mama\";\n\n        [Test]\n        public void DoesNotThrowDivisionByZero()\n        {\n            var mama = new MesaAdaptiveMovingAverage(\"MAMA\");\n\n            for (var i = 0; i < 500; i++)\n            {\n                var data = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = DateTime.Now.AddSeconds(i),\n                    Open = 0,\n                    Low = 0,\n                    High = 0,\n                    Close = 0\n                };\n                Assert.DoesNotThrow(() => mama.Update(data));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MidPointTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MidPointTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new MidPoint(5);\n        }\n\n        protected override string TestFileName => \"spy_midpoint.txt\";\n\n        protected override string TestColumnName => \"MIDPOINT_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MidPriceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class MidPriceTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new MidPrice(5);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_midprice.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"MIDPRICE_5\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/MinimumTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MinimumTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new Minimum(5);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_min.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"MIN_5\"; }\n        }\n\n        [Test]\n        public void ComputesCorrectly()\n        {\n            var min = new Minimum(3);\n\n            var reference = DateTime.UtcNow;\n\n            min.Update(reference, 1m);\n            Assert.AreEqual(1m, min.Current.Value);\n            Assert.AreEqual(0, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(1), 2m);\n            Assert.AreEqual(1m, min.Current.Value);\n            Assert.AreEqual(1, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(2), -1m);\n            Assert.AreEqual(-1m, min.Current.Value);\n            Assert.AreEqual(0, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(3), 2m);\n            Assert.AreEqual(-1m, min.Current.Value);\n            Assert.AreEqual(1, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(4), 0m);\n            Assert.AreEqual(-1m, min.Current.Value);\n            Assert.AreEqual(2, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(5), 3m);\n            Assert.AreEqual(0m, min.Current.Value);\n            Assert.AreEqual(1, min.PeriodsSinceMinimum);\n\n            min.Update(reference.AddDays(6), 2m);\n            Assert.AreEqual(0m, min.Current.Value);\n            Assert.AreEqual(2, min.PeriodsSinceMinimum);\n        }\n\n        [Test]\n        public void ResetsProperlyMinimum()\n        {\n            var min = new Minimum(3);\n            min.Update(DateTime.Today, 1m);\n            min.Update(DateTime.Today.AddSeconds(1), 2m);\n            min.Update(DateTime.Today.AddSeconds(2), 1m);\n            Assert.IsTrue(min.IsReady);\n\n            min.Reset();\n            Assert.AreEqual(0, min.PeriodsSinceMinimum);\n            TestHelper.AssertIndicatorIsInDefaultState(min);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/MomentumPercentTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MomentumPercentTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new MomentumPercent(50);\n        }\n\n        protected override string TestFileName => \"spy_with_rocp50.txt\";\n\n        protected override string TestColumnName => \"Rate of Change % 50\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MomentumTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MomentumTests\n    {\n        [Test]\n        public void ComputesCorrectly()\n        {\n            var mom =  new Momentum(5);\n            foreach (var data in TestHelper.GetDataStream(5))\n            {\n                mom.Update(data);\n                Assert.AreEqual(data.Value, mom.Current.Value);\n            }\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var mom = new Momentum(5);\n            foreach (var data in TestHelper.GetDataStream(6))\n            {\n                mom.Update(data);\n            }\n            Assert.IsTrue(mom.IsReady);\n\n            mom.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(mom);\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            var mom = new Momentum(5);\n            var period = ((IIndicatorWarmUpPeriodProvider)mom).WarmUpPeriod;\n            var dataStream = TestHelper.GetDataStream(period).ToArray();\n\n            for (var i = 0; i < period; i++)\n            {\n                mom.Update(dataStream[i]);\n                Assert.AreEqual(i == period - 1, mom.IsReady);\n            }\n            Assert.IsTrue(mom.IsReady);\n            Assert.IsTrue(mom.Samples > mom.Period);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MomersionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing QuantConnect.Logging;\nusing System;\nusing System.Collections;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Result tested vs. Python and Excel available in http://tinyurl.com/ob5tslj\n    /// </summary>\n    [TestFixture]\n    public class MomersionTests\n    {\n        #region Array input\n\n        // Real AAPL minute data rounded to 2 decimals.\n        private readonly decimal[] _prices = {\n            125.99m, 125.91m, 125.75m, 125.62m, 125.54m, 125.45m, 125.47m,\n            125.4m , 125.43m, 125.45m, 125.42m, 125.36m, 125.23m, 125.32m,\n            125.26m, 125.31m, 125.41m, 125.5m , 125.51m, 125.41m, 125.54m,\n            125.51m, 125.61m, 125.43m, 125.42m, 125.42m, 125.46m, 125.43m,\n            125.4m , 125.35m\n        };\n\n        private readonly decimal[] _expectedMinPeriod = {\n            50.00m, 50.00m, 50.00m, 50.00m, 50.00m, 50.00m, 50.00m, 50.00m, 57.14m, 62.50m,\n            55.56m, 60.00m, 63.64m, 58.33m, 53.85m, 50.00m, 53.33m, 56.25m, 58.82m, 55.56m,\n            52.63m, 50.00m, 45.00m, 40.00m, 40.00m, 36.84m, 38.89m, 38.89m, 44.44m, 44.44m\n        };\n\n        private readonly decimal[] _expectedFullPeriod = {\n            50m, 50m   , 50m  , 50m, 50m, 50m  , 50m, 50m,\n            50m, 50m   , 50m  , 50m, 60m, 50m  , 40m, 30m,\n            40m, 50m   , 60m  , 50m, 50m, 40m  , 30m, 30m,\n            40m, 44.44m, 37.5m, 25m, 25m, 37.5m,\n        };\n\n        #endregion Array input\n\n        [TestCase(7, 20)]\n        [TestCase(null, 10)]\n        public void ComputesCorrectly(int? minPeriod, int fullPeriod)\n        {\n            var momersion = new Momersion(minPeriod, fullPeriod);\n            var expected = minPeriod.HasValue ? _expectedMinPeriod : _expectedFullPeriod;\n\n            RunTestIndicator(momersion, expected);\n        }\n\n        [TestCase(7, 20)]\n        [TestCase(null, 10)]\n        public void ResetsProperly(int? minPeriod, int fullPeriod)\n        {\n            var momersion = new Momersion(minPeriod, fullPeriod);\n            var expected = minPeriod.HasValue ? _expectedMinPeriod : _expectedFullPeriod;\n\n            RunTestIndicator(momersion, expected);\n\n            Assert.IsTrue(momersion.IsReady);\n\n            momersion.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(momersion);\n        }\n\n        [TestCase(7, 20)]\n        [TestCase(null, 10)]\n        public void WarmsUpProperly(int? minPeriod, int fullPeriod)\n        {\n            var momersion = new Momersion(minPeriod, fullPeriod);\n            var period = ((IIndicatorWarmUpPeriodProvider)momersion).WarmUpPeriod;\n            var dataStream = TestHelper.GetDataStream(period).ToArray();\n\n            for (var i = 0; i < period; i++)\n            {\n                momersion.Update(dataStream[i]);\n                Assert.AreEqual(i == period - 1, momersion.IsReady);\n            }\n        }\n\n        private void RunTestIndicator(Momersion momersion, IEnumerable expected)\n        {\n            var time = DateTime.Now;\n            var actual = new decimal[_prices.Length];\n\n            for (var i = 0; i < _prices.Length; i++)\n            {\n                momersion.Update(time.AddMinutes(i), _prices[i]);\n                actual[i] = Math.Round(momersion.Current.Value, 2);\n\n                Log.Trace($\"Bar : {i} | {momersion}, Is ready? {momersion.IsReady}\");\n            }\n            Assert.AreEqual(expected, actual);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/MoneyFlowIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class MoneyFlowIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            return new MoneyFlowIndex(20);\n        }\n\n        protected override string TestFileName => \"spy_mfi.txt\";\n\n        protected override string TestColumnName => \"Money Flow Index 20\";\n\n        [Test]\n        public void TestTradeBarsWithNoVolume()\n        {\n            var mfi = new MoneyFlowIndex(3);\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Volume = 0\n                };\n                mfi.Update(tradeBar);\n            }\n            Assert.AreEqual(mfi.Current.Value, 100.0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/MovingAverageConvergenceDivergenceTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MovingAverageConvergenceDivergenceTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new MovingAverageConvergenceDivergence(fastPeriod: 12, slowPeriod: 26, signalPeriod: 9);\n        }\n\n        protected override string TestFileName => \"spy_with_macd.txt\";\n\n        protected override string TestColumnName => \"MACD\";\n\n        [Test]\n        public void FastPeriodLessThanSlowPeriod()\n        {\n            var a = new MovingAverageConvergenceDivergence(fastPeriod: 2, slowPeriod: 3, signalPeriod: 2);\n            Assert.Throws<ArgumentException>(() => new MovingAverageConvergenceDivergence(fastPeriod: 3, slowPeriod: 3, signalPeriod: 2));\n            Assert.Throws<ArgumentException>(() => new MovingAverageConvergenceDivergence(fastPeriod: 4, slowPeriod: 3, signalPeriod: 2));\n        }\n\n        [Test]\n        public void ComparesWithExternalDataMacdHistogram()\n        {\n            var macd = CreateIndicator();\n            TestHelper.TestIndicator(\n                macd,\n                TestFileName,\n                \"Histogram\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double) ((MovingAverageConvergenceDivergence) ind).Histogram.Current.Value,\n                    delta: 1e-4\n                )\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataMacdSignal()\n        {\n            var macd = CreateIndicator();\n            TestHelper.TestIndicator(\n                macd,\n                TestFileName,\n                \"Signal\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double) ((MovingAverageConvergenceDivergence) ind).Signal.Current.Value,\n                    delta: 1e-4\n                )\n            );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataMacdValue()\n        {\n            var macd = CreateIndicator();\n            TestHelper.TestIndicator(\n                macd,\n                TestFileName,\n                \"MACD\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double)((MovingAverageConvergenceDivergence)ind).Current.Value,\n                    delta: 1e-4\n                )\n            );\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            int fastPeriod = 3,\n                slowPeriod = 4,\n                signalPeriod = 2;\n            var macd = new MovingAverageConvergenceDivergence(fastPeriod: fastPeriod, slowPeriod: slowPeriod, signalPeriod: signalPeriod);\n\n            Assert.IsFalse(macd.Signal.IsReady);\n            Assert.IsFalse(macd.Histogram.IsReady);\n            Assert.IsFalse(macd.IsReady);\n\n            for (var i = 0; i < fastPeriod; i++)\n            {\n                Assert.IsFalse(macd.Fast.IsReady);\n                macd.Update(new IndicatorDataPoint(DateTime.Today.AddSeconds(i), i));\n            }\n            Assert.IsTrue(macd.Fast.IsReady);\n\n\n            for (var i = fastPeriod; i < slowPeriod; i++)\n            {\n                Assert.IsFalse(macd.Slow.IsReady);\n                macd.Update(new IndicatorDataPoint(DateTime.Today.AddSeconds(i), i));\n            }\n            Assert.IsTrue(macd.Slow.IsReady);\n\n\n            for (var i = slowPeriod; i < macd.WarmUpPeriod; i++)\n            {\n                Assert.IsFalse(macd.Signal.IsReady);\n                Assert.IsFalse(macd.Histogram.IsReady);\n                Assert.IsFalse(macd.IsReady);\n                macd.Update(new IndicatorDataPoint(DateTime.Today.AddSeconds(i), i));\n            }\n            Assert.IsTrue(macd.Signal.IsReady);\n            Assert.IsTrue(macd.Histogram.IsReady);\n            Assert.IsTrue(macd.IsReady);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/MovingAverageTypeExtensionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class MovingAverageTypeExtensionsTests\n    {\n        [Test]\n        public void CreatesCorrectAveragingIndicator()\n        {\n            var indicator = MovingAverageType.Simple.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(SimpleMovingAverage), indicator);\n\n            indicator = MovingAverageType.Exponential.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(ExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.Wilders.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(WilderMovingAverage), indicator);\n\n            indicator = MovingAverageType.LinearWeightedMovingAverage.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(LinearWeightedMovingAverage), indicator);\n\n            indicator = MovingAverageType.DoubleExponential.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(DoubleExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.TripleExponential.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(TripleExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.Triangular.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(TriangularMovingAverage), indicator);\n\n            indicator = MovingAverageType.T3.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(T3MovingAverage), indicator);\n\n            indicator = MovingAverageType.Kama.AsIndicator(1);\n            Assert.IsInstanceOf(typeof(KaufmanAdaptiveMovingAverage), indicator);\n\n            indicator = MovingAverageType.Hull.AsIndicator(4);\n            Assert.IsInstanceOf(typeof(HullMovingAverage), indicator);\n\n            indicator = MovingAverageType.Alma.AsIndicator(9);\n            Assert.IsInstanceOf(typeof(ArnaudLegouxMovingAverage), indicator);\n\n            string name = string.Empty;\n            indicator = MovingAverageType.Simple.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(SimpleMovingAverage), indicator);\n\n            indicator = MovingAverageType.Exponential.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(ExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.Wilders.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(WilderMovingAverage), indicator);\n\n            indicator = MovingAverageType.LinearWeightedMovingAverage.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(LinearWeightedMovingAverage), indicator);\n\n            indicator = MovingAverageType.DoubleExponential.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(DoubleExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.TripleExponential.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(TripleExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.Triangular.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(TriangularMovingAverage), indicator);\n\n            indicator = MovingAverageType.T3.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(T3MovingAverage), indicator);\n\n            indicator = MovingAverageType.Kama.AsIndicator(name, 1);\n            Assert.IsInstanceOf(typeof(KaufmanAdaptiveMovingAverage), indicator);\n\n            indicator = MovingAverageType.Hull.AsIndicator(name, 4);\n            Assert.IsInstanceOf(typeof(HullMovingAverage), indicator);\n\n            indicator = MovingAverageType.Alma.AsIndicator(name, 9);\n            Assert.IsInstanceOf(typeof(ArnaudLegouxMovingAverage), indicator);\n\n            indicator = MovingAverageType.Zlema.AsIndicator(name, 9);\n            Assert.IsInstanceOf(typeof(ZeroLagExponentialMovingAverage), indicator);\n\n            indicator = MovingAverageType.MGD.AsIndicator(name, 9);\n            Assert.IsInstanceOf(typeof(McGinleyDynamic), indicator);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/NewHighsNewLowsDifferenceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class NewHighsNewLowsDifferenceTests : NewHighsNewLowsTestsBase<IBaseDataBar>\n    {\n        protected override NewHighsNewLows<IBaseDataBar> CreateNewHighsNewLowsIndicator()\n        {\n            // For test purposes we use period of two\n            return new NewHighsNewLows(\"test_name\", 2);\n        }\n\n        protected override IndicatorBase<IBaseDataBar> GetSubIndicator(IndicatorBase<IBaseDataBar> mainIndicator)\n        {\n            return (mainIndicator as NewHighsNewLows).Difference;\n        }\n\n        [Test]\n        public virtual void ShouldIgnoreRemovedStocks()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Difference.Current.Value);\n\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.5m, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(-3m, indicator.Difference.Current.Value);\n\n            indicator.Reset();\n            indicator.Remove(Symbols.GOOG);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Difference.Current.Value);\n\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.5m, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Time = reference.AddMinutes(3) });\n            // new low (ignored)\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(-2m, indicator.Difference.Current.Value);\n        }\n\n        [Test]\n        public virtual void IgnorePeriodIfAnyStockMissed()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            indicator.Add(Symbols.MSFT);\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Difference.Current.Value);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.5m, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Low = 1, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(0m, indicator.Difference.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 4, Low = 1, Time = reference.AddMinutes(4) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.3m, Time = reference.AddMinutes(4) });\n            // no change\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(4) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 4, Low = 1, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(1m, indicator.Difference.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 5, Low = 1, Time = reference.AddMinutes(5) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.2m, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 5, Low = 1, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(2m, indicator.Difference.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 6, Low = 1, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 3, Low = 1, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 6, Low = 1, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(2m, indicator.Difference.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 7, Low = 1, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 7, Low = 1, Time = reference.AddMinutes(7) });\n\n            Assert.AreEqual(2m, indicator.Difference.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            var reference = DateTime.Today;\n\n            // setup period (unordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 0.2m, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(2) });\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.75m, Low = 0.1m, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 2, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(1m, indicator.Difference.Current.Value);\n            Assert.AreEqual(9, indicator.Samples);\n            Assert.AreEqual(1, indicator.Difference.Samples);\n        }\n\n        [Test]\n        public virtual void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            var reference = DateTime.Today;\n\n            // setup period (ordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(2) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 4, Low = 1, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(3m, indicator.Difference.Current.Value);\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            var reference = DateTime.Today;\n\n            for (int i = 0; i < 10; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n\n                // indicator is not ready yet\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n\n                // indicator is ready\n\n                // The last update used Symbol.GOOG, so the indicator's current Symbol should be GOOG\n                Assert.AreEqual(Symbols.GOOG, indicator.Difference.Current.Symbol);\n            }\n        }\n\n        protected override string TestFileName => \"nhnl_data.csv\";\n\n        protected override string TestColumnName => \"NH/NL Difference\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/NewHighsNewLowsRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class NewHighsNewLowsRatioTests : NewHighsNewLowsTestsBase<IBaseDataBar>\n    {\n        protected override NewHighsNewLows<IBaseDataBar> CreateNewHighsNewLowsIndicator()\n        {\n            // For test purposes we use period of two\n            return new NewHighsNewLows(\"test_name\", 2);\n        }\n\n        protected override IndicatorBase<IBaseDataBar> GetSubIndicator(IndicatorBase<IBaseDataBar> mainIndicator)\n        {\n            // we need to use the Ratio sub-indicator\n            return (mainIndicator as NewHighsNewLows).Ratio;\n        }\n\n        [Test]\n        public void ShouldIgnoreRemovedStocks()\n        {\n            var indicator = (NewHighsNewLows)CreateIndicator();\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 0.9m, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(0.5m, indicator.Ratio.Current.Value);\n\n            indicator.Reset();\n            indicator.Remove(Symbols.GOOG);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 0.9m, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.9m, Time = reference.AddMinutes(3) });\n            // new low (ignored)\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(2m, indicator.Ratio.Current.Value);\n        }\n\n        [Test]\n        public void IgnorePeriodIfAnyStockMissed()\n        {\n            var indicator = (NewHighsNewLows)CreateIndicator();\n            indicator.Add(Symbols.MSFT);\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.Ratio.Current.Value);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.5m, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Low = 1, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(0m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 4, Low = 1, Time = reference.AddMinutes(4) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.3m, Time = reference.AddMinutes(4) });\n            // no change\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(4) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 4, Low = 1, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(2m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 5, Low = 1, Time = reference.AddMinutes(5) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.2m, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 5, Low = 1, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(3m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 6, Low = 1, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 3, Low = 1, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 6, Low = 1, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(3m, indicator.Ratio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 7, Low = 1, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 7, Low = 1, Time = reference.AddMinutes(7) });\n\n            Assert.AreEqual(3m, indicator.Ratio.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = (NewHighsNewLows)CreateIndicator();\n            var reference = DateTime.Today;\n\n            // setup period (unordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 0.2m, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(2) });\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.75m, Low = 0.1m, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 2, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.Ratio.IsReady);\n            Assert.AreEqual(2m, indicator.Ratio.Current.Value);\n            Assert.AreEqual(9, indicator.Samples);\n            Assert.AreEqual(1, indicator.Ratio.Samples);\n        }\n\n        [Test]\n        public void WarmsUpOrdered()\n        {\n            var indicator = (NewHighsNewLows)CreateIndicator();\n            var reference = DateTime.Today;\n\n            // setup period (ordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 1, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Time = reference.AddMinutes(2) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.Ratio.IsReady);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 4, Low = 1, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.Ratio.IsReady);\n            Assert.AreEqual(3m, indicator.Ratio.Current.Value);\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLows;\n            var reference = DateTime.Today;\n\n            for (int i = 0; i < 10; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n\n                // indicator is not ready yet\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n\n                // indicator is ready\n\n                // The last update used Symbol.GOOG, so the indicator's current Symbol should be GOOG\n                Assert.AreEqual(Symbols.GOOG, indicator.Ratio.Current.Symbol);\n            }\n        }\n\n        protected override string TestFileName => \"nhnl_data.csv\";\n\n        protected override string TestColumnName => \"NH/NL Ratio\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/NewHighsNewLowsTestsBase.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.Tests.Indicators.TestHelper;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public abstract class NewHighsNewLowsTestsBase<T> : CommonIndicatorTests<T>\n        where T : class, IBaseDataBar\n    {\n        protected override IndicatorBase<T> CreateIndicator()\n        {\n            var nhnlRatio = CreateNewHighsNewLowsIndicator();\n            if (SymbolList.Count > 2)\n            {\n                SymbolList.Take(3).ToList().ForEach(nhnlRatio.Add);\n            }\n            else\n            {\n                nhnlRatio.Add(Symbols.AAPL);\n                nhnlRatio.Add(Symbols.IBM);\n                nhnlRatio.Add(Symbols.GOOG);\n                RenkoBarSize = 5000000;\n            }\n\n            // Even if the indicator is ready, there may be zero values\n            ValueCanBeZero = true;\n\n            return nhnlRatio;\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.SPY, Symbols.AAPL, Symbols.IBM];\n        }\n\n        protected override Action<IndicatorBase<T>, double> Assertion => (indicator, expected) =>\n        {\n            // we need to use the Ratio sub-indicator\n            base.Assertion(GetSubIndicator(indicator), expected);\n        };\n\n        protected abstract NewHighsNewLows<T> CreateNewHighsNewLowsIndicator();\n\n        protected abstract IndicatorBase<T> GetSubIndicator(IndicatorBase<T> mainIndicator);\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<IBaseDataBar>)\n            {\n                var aaplRenkoConsolidator = new RenkoConsolidator(10000m);\n                aaplRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var googRenkoConsolidator = new RenkoConsolidator(100000m);\n                googRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var ibmRenkoConsolidator = new RenkoConsolidator(10000m);\n                ibmRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                foreach (var parts in GetCsvFileStream(TestFileName))\n                {\n                    var tradebar = parts.GetTradeBar();\n                    if (tradebar.Symbol.Value == \"AAPL\")\n                    {\n                        aaplRenkoConsolidator.Update(tradebar);\n                    }\n                    else if (tradebar.Symbol.Value == \"GOOG\")\n                    {\n                        googRenkoConsolidator.Update(tradebar);\n                    }\n                    else\n                    {\n                        ibmRenkoConsolidator.Update(tradebar);\n                    }\n                }\n\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveRenkoBars(indicator);\n                aaplRenkoConsolidator.Dispose();\n                googRenkoConsolidator.Dispose();\n                ibmRenkoConsolidator.Dispose();\n            }\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            if (indicator is IndicatorBase<IBaseDataBar>)\n            {\n                var aaplRenkoConsolidator = new VolumeRenkoConsolidator(10000000m);\n                aaplRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var googRenkoConsolidator = new VolumeRenkoConsolidator(500000m);\n                googRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                var ibmRenkoConsolidator = new VolumeRenkoConsolidator(500000m);\n                ibmRenkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n                {\n                    Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n                };\n\n                foreach (var parts in GetCsvFileStream(TestFileName))\n                {\n                    var tradebar = parts.GetTradeBar();\n                    if (tradebar.Symbol.Value == \"AAPL\")\n                    {\n                        aaplRenkoConsolidator.Update(tradebar);\n                    }\n                    else if (tradebar.Symbol.Value == \"GOOG\")\n                    {\n                        googRenkoConsolidator.Update(tradebar);\n                    }\n                    else\n                    {\n                        ibmRenkoConsolidator.Update(tradebar);\n                    }\n                }\n\n                Assert.IsTrue(indicator.IsReady);\n                Assert.AreNotEqual(0, indicator.Samples);\n                IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(indicator);\n                aaplRenkoConsolidator.Dispose();\n                googRenkoConsolidator.Dispose();\n                ibmRenkoConsolidator.Dispose();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/NewHighsNewLowsVolumeRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    internal class NewHighsNewLowsVolumeRatioTests : NewHighsNewLowsTestsBase<TradeBar>\n    {\n        protected override NewHighsNewLows<TradeBar> CreateNewHighsNewLowsIndicator()\n        {\n            // For test purposes we use period of two\n            return new NewHighsNewLowsVolume(\"test_name\", 2);\n        }\n\n        protected override IndicatorBase<TradeBar> GetSubIndicator(IndicatorBase<TradeBar> mainIndicator)\n        {\n            return (mainIndicator as NewHighsNewLowsVolume).VolumeRatio;\n        }\n\n        [Test]\n        public void ShouldIgnoreRemovedStocks()\n        {\n            var indicator = (NewHighsNewLowsVolume)CreateIndicator();\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Volume = 100, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(0.5m, indicator.VolumeRatio.Current.Value);\n\n            indicator.Reset();\n            indicator.Remove(Symbols.GOOG);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.9m, Volume = 100, Time = reference.AddMinutes(3) });\n            // new low (ignored)\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 0.2m, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(200m, indicator.VolumeRatio.Current.Value);\n        }\n\n        [Test]\n        public void IgnorePeriodIfAnyStockMissed()\n        {\n            var indicator = (NewHighsNewLowsVolume)CreateIndicator();\n            indicator.Add(Symbols.MSFT);\n            var reference = DateTime.Today;\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n\n            // value is not ready yet\n            Assert.AreEqual(0m, indicator.VolumeRatio.Current.Value);\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.5m, Volume = 100, Time = reference.AddMinutes(3) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, Close = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.AreEqual(0m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 4, Low = 1, Volume = 100, Time = reference.AddMinutes(4) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.3m, Volume = 100, Time = reference.AddMinutes(4) });\n            // no change\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(4) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 4, Low = 1, Volume = 100, Time = reference.AddMinutes(4) });\n\n            Assert.AreEqual(2m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 5, Low = 1, Volume = 100, Time = reference.AddMinutes(5) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 2, Low = 0.2m, Volume = 100, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Volume = 100, Time = reference.AddMinutes(5) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 5, Low = 1, Volume = 100, Time = reference.AddMinutes(5) });\n\n            Assert.AreEqual(3m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 6, Low = 1, Volume = 100, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(6) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 6, Low = 1, Volume = 100, Time = reference.AddMinutes(6) });\n\n            Assert.AreEqual(3m, indicator.VolumeRatio.Current.Value);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 7, Low = 1, Volume = 100, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Volume = 100, Time = reference.AddMinutes(7) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.MSFT, High = 7, Low = 1, Volume = 100, Time = reference.AddMinutes(7) });\n\n            Assert.AreEqual(3m, indicator.VolumeRatio.Current.Value);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLowsVolume;\n            var reference = DateTime.Today;\n\n            // setup period (unordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 0.2m, Volume = 100, Time = reference.AddMinutes(2) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            // new low\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.75m, Low = 0.1m, Volume = 100, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 2, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(2m, indicator.VolumeRatio.Current.Value);\n            Assert.AreEqual(9, indicator.Samples);\n            Assert.AreEqual(1, indicator.VolumeRatio.Samples);\n        }\n\n        [Test]\n        public void WarmsUpOrdered()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLowsVolume;\n            var reference = DateTime.Today;\n\n            // setup period (ordered)\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 100, Time = reference.AddMinutes(1) });\n\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 0.5m, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(2) });\n\n            // indicator is not ready yet\n            Assert.IsFalse(indicator.IsReady);\n\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 4, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n            // new high\n            indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 5, Low = 1, Volume = 100, Time = reference.AddMinutes(3) });\n\n            Assert.IsTrue(indicator.IsReady);\n            Assert.AreEqual(300m, indicator.VolumeRatio.Current.Value);\n        }\n\n        [Test]\n        public override void IndicatorShouldHaveSymbolAfterUpdates()\n        {\n            var indicator = CreateIndicator() as NewHighsNewLowsVolume;\n            var reference = DateTime.Today;\n\n            for (int i = 0; i < 10; i++)\n            {\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 1, Low = 1, Volume = 1, Time = reference.AddMinutes(1) });\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 2, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.5m, Volume = 1, Time = reference.AddMinutes(2) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(2) });\n\n                // indicator is not ready yet\n\n                indicator.Update(new TradeBar() { Symbol = Symbols.AAPL, High = 3, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.IBM, High = 1, Low = 0.3m, Volume = 1, Time = reference.AddMinutes(3) });\n                indicator.Update(new TradeBar() { Symbol = Symbols.GOOG, High = 4, Low = 1, Volume = 1, Time = reference.AddMinutes(3) });\n\n                // indicator is ready\n\n                // The last update used Symbol.GOOG, so the indicator's current Symbol should be GOOG\n                Assert.AreEqual(Symbols.GOOG, indicator.VolumeRatio.Current.Symbol);\n            }\n        }\n\n        protected override string TestFileName => \"nhnl_data.csv\";\n\n        protected override string TestColumnName => \"NH/NL Volume Ratio\";\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/NormalizedAverageTrueRangeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class NormalizedAverageTrueRangeTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new NormalizedAverageTrueRange(5);\n        }\n\n        protected override string TestFileName => \"spy_natr.txt\";\n\n        protected override string TestColumnName => \"NATR_5\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/OnBalanceVolumeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OnBalanceVolumeTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new OnBalanceVolume();\n        }\n\n        protected override string TestFileName => \"spy_with_obv.txt\";\n\n        protected override string TestColumnName => \"OBV\";\n\n        protected override Action<IndicatorBase<TradeBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(\n                    expected.ToStringInvariant(\"0.##E-00\"),\n                    indicator.Current.Value.ToStringInvariant(\"0.##E-00\")\n                );\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/OptionBaseIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public abstract class OptionBaseIndicatorTests<T> : CommonIndicatorTests<IBaseData>\n        where T : OptionIndicatorBase\n    {\n        // count of risk free rate calls per each update on opiton indicator\n        protected int RiskFreeRateUpdatesPerIteration { get; set; }\n\n        // count of dividend yield calls per each update on option indicator\n        protected int DividendYieldUpdatesPerIteration { get; set; }\n\n        protected static DateTime _reference = new DateTime(2023, 8, 1, 10, 0, 0);\n        protected static Symbol _symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, OptionRight.Call, 450m, new DateTime(2023, 9, 1));\n        protected Symbol _underlying => _symbol.Underlying;\n\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n        {\n            throw new NotImplementedException(\"method `CreateIndicator()` is required to be set up\");\n        }\n\n        protected virtual OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n        {\n            throw new NotImplementedException(\"method `CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)` is required to be set up\");\n        }\n\n        protected virtual OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            throw new NotImplementedException(\"method `CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)` is required to be set up\");\n        }\n\n        protected virtual OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n        {\n            throw new NotImplementedException(\"method `CreateIndicator(QCAlgorithm algorithm)` is required to be set up\");\n        }\n\n        protected OptionPricingModelType ParseSymbols(string[] items, bool american, out Symbol call, out Symbol put)\n        {\n            var ticker = items[0];\n            var expiry = DateTime.ParseExact(items[1], \"dd/MM/yyyy HH:mm:ss\", CultureInfo.InvariantCulture);\n            var strike = Parse.Decimal(items[2]);\n            var style = american ? OptionStyle.American : OptionStyle.European;\n\n            call = Symbol.CreateOption(ticker, Market.USA, style, OptionRight.Call, strike, expiry);\n            put = Symbol.CreateOption(ticker, Market.USA, style, OptionRight.Put, strike, expiry);\n\n            return american ? OptionPricingModelType.ForwardTree : OptionPricingModelType.BlackScholes;\n        }\n\n        protected void RunTestIndicator(Symbol call, Symbol put, OptionIndicatorBase callIndicator, OptionIndicatorBase putIndicator,\n            string[] items, int callColumn, int putColumn, double errorRate, double errorMargin = 1e-4)\n        {\n            var time = DateTime.ParseExact(items[3], \"dd/MM/yyyy HH:mm:ss\", CultureInfo.InvariantCulture);\n\n            var callDataPoint = new IndicatorDataPoint(call, time, decimal.Parse(items[5], NumberStyles.Any, CultureInfo.InvariantCulture));\n            var putDataPoint = new IndicatorDataPoint(put, time, decimal.Parse(items[4], NumberStyles.Any, CultureInfo.InvariantCulture));\n            var underlyingDataPoint = new IndicatorDataPoint(call.Underlying, time, decimal.Parse(items[^4], NumberStyles.Any, CultureInfo.InvariantCulture));\n\n            callIndicator.Update(callDataPoint);\n            callIndicator.Update(underlyingDataPoint);\n            if (callIndicator.UseMirrorContract)\n            {\n                callIndicator.Update(putDataPoint);\n            }\n\n            var expected = double.Parse(items[callColumn], NumberStyles.Any, CultureInfo.InvariantCulture);\n            var acceptance = Math.Max(errorRate * Math.Abs(expected), errorMargin);     // percentage error\n            Assert.AreEqual(expected, (double)callIndicator.Current.Value, acceptance);\n\n            putIndicator.Update(putDataPoint);\n            putIndicator.Update(underlyingDataPoint);\n            if (putIndicator.UseMirrorContract)\n            {\n                putIndicator.Update(callDataPoint);\n            }\n\n            expected = double.Parse(items[putColumn], NumberStyles.Any, CultureInfo.InvariantCulture);\n            acceptance = Math.Max(errorRate * Math.Abs(expected), errorMargin);     // percentage error\n            Assert.AreEqual(expected, (double)putIndicator.Current.Value, acceptance);\n        }\n\n        protected override List<Symbol> GetSymbols()\n        {\n            return [Symbols.GOOG];\n        }\n\n        [Test]\n        public void ZeroGreeksIfExpired()\n        {\n            var indicator = CreateIndicator();\n            var date = new DateTime(2099, 1, 1);    // date that the option must be expired already\n            var price = 500m;\n            var optionPrice = 10m;\n\n            indicator.Update(new IndicatorDataPoint(_symbol, date, optionPrice));\n            indicator.Update(new IndicatorDataPoint(_underlying, date, price));\n\n            Assert.AreEqual(0m, indicator.Current.Value);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var indicator = CreateIndicator();\n\n            for (var i = 0; i < 5; i++)\n            {\n                var price = 500m;\n                var optionPrice = Math.Max(price - 450, 0) * 1.1m;\n\n                indicator.Update(new IndicatorDataPoint(_symbol, _reference.AddDays(1 + i), optionPrice));\n                indicator.Update(new IndicatorDataPoint(_underlying, _reference.AddDays(1 + i), price));\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        [Test]\n        public override void TimeMovesForward()\n        {\n            var indicator = CreateIndicator();\n\n            for (var i = 10; i > 0; i--)\n            {\n                var price = 500m;\n                var optionPrice = Math.Max(price - 450, 0) * 1.1m;\n\n                indicator.Update(new IndicatorDataPoint(_symbol, _reference.AddDays(1 + i), optionPrice));\n                indicator.Update(new IndicatorDataPoint(_underlying, _reference.AddDays(1 + i), price));\n            }\n\n            Assert.AreEqual(2, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var indicator = CreateIndicator();\n            var warmUpPeriod = (indicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n\n            if (!warmUpPeriod.HasValue)\n            {\n                Assert.Ignore($\"{indicator.Name} is not IIndicatorWarmUpPeriodProvider\");\n                return;\n            }\n\n            // warmup period is 5 + 1\n            for (var i = 1; i <= warmUpPeriod.Value; i++)\n            {\n                var time = _reference.AddDays(i);\n                var price = 500m;\n                var optionPrice = Math.Max(price - 450, 0) * 1.1m;\n\n                indicator.Update(new IndicatorDataPoint(_symbol, time, optionPrice));\n\n                Assert.IsFalse(indicator.IsReady);\n\n                indicator.Update(new IndicatorDataPoint(_underlying, time, price));\n\n                Assert.IsTrue(indicator.IsReady);\n            }\n\n            Assert.AreEqual(2 * warmUpPeriod.Value, indicator.Samples);\n        }\n\n        [Test]\n        public override void WarmUpIndicatorProducesConsistentResults()\n        {\n            var algo = CreateAlgorithm();\n\n            algo.SetStartDate(2015, 12, 24);\n            algo.SetEndDate(2015, 12, 24);\n\n            var underlying = Symbols.GOOG;\n\n            var expiration = new DateTime(2015, 12, 24);\n            var strike = 650m;\n\n            var option = Symbol.CreateOption(underlying, Market.USA, OptionStyle.American, OptionRight.Put, strike, expiration);\n            SymbolList = [option];\n\n            var symbolsForWarmUp = new List<Symbol> { option, option.Underlying };\n            // Define the risk-free rate and dividend yield models\n            var risk = new ConstantRiskFreeRateInterestRateModel(12);\n            var dividend = new ConstantDividendYieldModel(12);\n\n            // Create the first indicator using the risk and dividend models\n            var firstIndicator = CreateIndicator(risk, dividend);\n            var period = (firstIndicator as IIndicatorWarmUpPeriodProvider)?.WarmUpPeriod;\n            if (period == null || period == 0)\n            {\n                Assert.Ignore($\"{firstIndicator.Name}, Skipping this test because it's not applicable.\");\n            }\n\n            // Warm up the first indicator\n            algo.WarmUpIndicator(symbolsForWarmUp, firstIndicator, Resolution.Daily);\n\n            // Warm up the second indicator manually\n            var secondIndicator = CreateIndicator(risk, dividend);\n            var history = algo.History(symbolsForWarmUp, period.Value, Resolution.Daily).ToList();\n            foreach (var slice in history)\n            {\n                foreach (var symbol in symbolsForWarmUp)\n                {\n                    secondIndicator.Update(slice[symbol]);\n                }\n            }\n            SymbolList.Clear();\n\n            // Assert that the indicators are ready\n            Assert.IsTrue(firstIndicator.IsReady);\n            Assert.IsTrue(secondIndicator.IsReady);\n            if (!ValueCanBeZero)\n            {\n                Assert.AreNotEqual(firstIndicator.Current.Value, 0);\n            }\n\n            // Ensure that the first indicator has processed some data\n            Assert.AreNotEqual(firstIndicator.Samples, 0);\n\n            // Validate that both indicators have the same number of processed samples\n            Assert.AreEqual(firstIndicator.Samples, secondIndicator.Samples);\n\n            // Validate that both indicators produce the same final computed value\n            Assert.AreEqual(firstIndicator.Current.Value, secondIndicator.Current.Value);\n        }\n\n        [Test]\n        public override void WorksWithLowValues()\n        {\n            Symbol = _symbol;\n            base.WorksWithLowValues();\n        }\n\n        [Test]\n        public void UsesRiskFreeInterestRateModel()\n        {\n            const int count = 20;\n            var dates = Enumerable.Range(0, count).Select(i => new DateTime(2022, 11, 21, 10, 0, 0) + TimeSpan.FromDays(i)).ToList();\n            var interestRateValues = Enumerable.Range(0, count).Select(i => 0m + (10 - 0m) * (i / (count - 1m))).ToList();\n\n            var interestRateProviderMock = new Mock<IRiskFreeInterestRateModel>();\n\n            // Set up\n            for (int i = 0; i < count; i++)\n            {\n                interestRateProviderMock.Setup(x => x.GetInterestRate(dates[i])).Returns(interestRateValues[i]).Verifiable();\n            }\n\n            var indicator = CreateIndicator(interestRateProviderMock.Object);\n\n            for (int i = 0; i < count; i++)\n            {\n                indicator.Update(new IndicatorDataPoint(_symbol, dates[i], 80m + i));\n                indicator.Update(new IndicatorDataPoint(_underlying, dates[i], 500m + i));\n                Assert.AreEqual(interestRateValues[i], indicator.RiskFreeRate.Current.Value);\n            }\n\n            // Assert\n            Assert.IsTrue(indicator.IsReady);\n            interestRateProviderMock.Verify(x => x.GetInterestRate(It.IsAny<DateTime>()), Times.Exactly(dates.Count * RiskFreeRateUpdatesPerIteration));\n            for (int i = 0; i < count; i++)\n            {\n                interestRateProviderMock.Verify(x => x.GetInterestRate(dates[i]), Times.Exactly(RiskFreeRateUpdatesPerIteration));\n            }\n        }\n\n        [Test]\n        public void UsesPythonDefinedRiskFreeInterestRateModel()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(Guid.NewGuid().ToString(), $@\"\nfrom AlgorithmImports import *\n\nclass TestRiskFreeInterestRateModel:\n    CallCount = 0\n\n    def GetInterestRate(self, date: datetime) -> float:\n        TestRiskFreeInterestRateModel.CallCount += 1\n        return 0.5\n\ndef getOptionIndicatorBaseIndicator(symbol: Symbol) -> OptionIndicatorBase:\n    return {typeof(T).Name}(symbol, TestRiskFreeInterestRateModel())\n            \");\n\n            var iv = module.GetAttr(\"getOptionIndicatorBaseIndicator\").Invoke(_symbol.ToPython()).GetAndDispose<T>();\n            var modelClass = module.GetAttr(\"TestRiskFreeInterestRateModel\");\n\n            var reference = new DateTime(2022, 11, 21, 10, 0, 0);\n            for (int i = 0; i < 20; i++)\n            {\n                iv.Update(new IndicatorDataPoint(_symbol, reference + TimeSpan.FromMinutes(i), 10m + i));\n                iv.Update(new IndicatorDataPoint(_underlying, reference + TimeSpan.FromMinutes(i), 1000m + i));\n                Assert.AreEqual((i + 1) * RiskFreeRateUpdatesPerIteration, modelClass.GetAttr(\"CallCount\").GetAndDispose<int>());\n            }\n        }\n\n        [Test]\n        public void OptionIndicatorUsesAlgorithmsRiskFreeRateModelSetAfterIndicatorRegistration()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var historyProvider = new SubscriptionDataReaderHistoryProvider();\n            historyProvider.Initialize(new HistoryProviderInitializeParameters(null, null,\n                TestGlobals.DataProvider, TestGlobals.DataCacheProvider, TestGlobals.MapFileProvider, TestGlobals.FactorFileProvider,\n                null, true, new DataPermissionManager(), algorithm.ObjectStore, algorithm.Settings));\n            algorithm.SetHistoryProvider(historyProvider);\n\n            algorithm.SetDateTime(_reference);\n            algorithm.AddEquity(_underlying.Value);\n            algorithm.AddOptionContract(_symbol);\n            algorithm.Settings.AutomaticIndicatorWarmUp = true;\n\n            // Register indicator\n            var indicator = CreateIndicator(algorithm);\n\n            // Setup risk free rate model\n            var interestRateProviderMock = new Mock<IRiskFreeInterestRateModel>();\n            interestRateProviderMock.Setup(x => x.GetInterestRate(_reference)).Verifiable();\n\n            // Update indicator\n            indicator.Update(new IndicatorDataPoint(_symbol, _reference, 30m));\n            indicator.Update(new IndicatorDataPoint(_underlying, _reference, 300m));\n\n            // Our interest rate provider shouldn't have been called yet since it's hasn't been set to the algorithm\n            interestRateProviderMock.Verify(x => x.GetInterestRate(_reference), Times.Never);\n\n            // Set the interest rate provider to the algorithm\n            algorithm.SetRiskFreeInterestRateModel(interestRateProviderMock.Object);\n\n            // Update indicator\n            indicator.Update(new IndicatorDataPoint(_symbol, _reference.AddDays(1), 30m));\n            indicator.Update(new IndicatorDataPoint(_underlying, _reference.AddDays(1), 300m));\n\n            // Our interest rate provider should have been called once by each update\n            interestRateProviderMock.Verify(x => x.GetInterestRate(_reference.AddDays(1)), Times.Exactly(RiskFreeRateUpdatesPerIteration));\n        }\n\n        [Test]\n        public void UsesDividendYieldModel()\n        {\n            const int count = 20;\n            var dates = Enumerable.Range(0, count).Select(i => new DateTime(2022, 11, 21, 10, 0, 0) + TimeSpan.FromDays(i)).ToList();\n            var dividends = Enumerable.Range(0, count).Select(i => 0m + (10 - 0m) * (i / (count - 1m))).ToList();\n\n            var dividendYieldProviderMock = new Mock<IDividendYieldModel>();\n\n            // Set up\n            var underlyingBasePrice = 500m;\n            for (int i = 0; i < count; i++)\n            {\n                dividendYieldProviderMock.Setup(x => x.GetDividendYield(dates[i], underlyingBasePrice + i)).Returns(dividends[i]).Verifiable();\n            }\n\n            var indicator = CreateIndicator(new ConstantRiskFreeRateInterestRateModel(0.05m), dividendYieldProviderMock.Object);\n\n            for (int i = 0; i < count; i++)\n            {\n                indicator.Update(new IndicatorDataPoint(_symbol, dates[i], 80m + i));\n                indicator.Update(new IndicatorDataPoint(_underlying, dates[i], underlyingBasePrice + i));\n                Assert.AreEqual(dividends[i], indicator.DividendYield.Current.Value);\n            }\n\n            // Assert\n            Assert.IsTrue(indicator.IsReady);\n            dividendYieldProviderMock.Verify(x => x.GetDividendYield(It.IsAny<DateTime>(), It.IsAny<decimal>()), Times.Exactly(dates.Count * DividendYieldUpdatesPerIteration));\n            for (int i = 0; i < count; i++)\n            {\n                dividendYieldProviderMock.Verify(x => x.GetDividendYield(dates[i], underlyingBasePrice + i), Times.Exactly(DividendYieldUpdatesPerIteration));\n            }\n        }\n\n        [Test]\n        public void UsesPythonDefinedDividendYieldModel()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(Guid.NewGuid().ToString(), $@\"\nfrom AlgorithmImports import *\n\nclass TestDividendYieldModel:\n    call_count = 0\n\n    def get_dividend_yield(self, date: datetime, price: float) -> float:\n        TestDividendYieldModel.call_count += 1\n        return 0.5\n\ndef get_option_indicator_base_indicator(symbol: Symbol) -> OptionIndicatorBase:\n    return {typeof(T).Name}(symbol, InterestRateProvider(), TestDividendYieldModel())\n            \");\n\n            var indicator = module.GetAttr(\"get_option_indicator_base_indicator\").Invoke(_symbol.ToPython()).GetAndDispose<T>();\n            var modelClass = module.GetAttr(\"TestDividendYieldModel\");\n\n            var reference = new DateTime(2022, 11, 21, 10, 0, 0);\n            for (int i = 0; i < 20; i++)\n            {\n                indicator.Update(new IndicatorDataPoint(_symbol, reference + TimeSpan.FromMinutes(i), 10m + i));\n                indicator.Update(new IndicatorDataPoint(_underlying, reference + TimeSpan.FromMinutes(i), 1000m + i));\n                Assert.AreEqual((i + 1) * DividendYieldUpdatesPerIteration, modelClass.GetAttr(\"call_count\").GetAndDispose<int>());\n            }\n        }\n\n        // Not used\n        protected override string TestFileName => null;\n        protected override string TestColumnName => null;\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            // Not used\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            // Not used\n        }\n\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            // Not used\n        }\n\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            // Not used\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ParabolicStopAndReverseExtendedTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ParabolicStopAndReverseExtendedTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new ParabolicStopAndReverseExtended();\n        }\n\n        protected override string TestFileName => \"spy_sarext.txt\";\n\n        protected override string TestColumnName => \"SAREXT\"; \n\n        [TestCase(\"SAREXT_PARAM1\", 0.0, 0.0, 0.03, 0.02, 0.4, 0.02, 0.01, 0.3)]\n        [TestCase(\"SAREXT_PARAM2\", 100, 0.0, 0.03, 0.02, 0.4, 0.02, 0.01, 0.3)]\n        [TestCase(\"SAREXT_PARAM3\", -95, 0.0, 0.03, 0.02, 0.4, 0.02, 0.01, 0.3)]\n        [TestCase(\"SAREXT_PARAM4\", 100, 0.02, 0.03, 0.02, 0.4, 0.02, 0.01, 0.3)]\n        public void ComparesWithExternalDataWithParams(string colName, decimal ss, decimal offset, \n            decimal afss, decimal afis, decimal afms, decimal afsl, decimal afil, decimal afml)  \n        {\n            var sarext = new ParabolicStopAndReverseExtended(sarStart : ss, offsetOnReverse : offset, \n                afStartShort : afss, afIncrementShort : afis, afMaxShort : afms, \n                afStartLong : afsl, afIncrementLong : afil, afMaxLong : afml);\n            TestHelper.TestIndicator(\n                sarext,\n                TestFileName,\n                colName,\n                (ind, expected) => Assert.AreEqual(expected, (double)sarext.Current.Value, delta: 1e-4)\n            );\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ParabolicStopAndReverseTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ParabolicStopAndReverseTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new ParabolicStopAndReverse();\n        }\n\n        protected override string TestFileName => \"spy_sarext.txt\";\n\n        protected override string TestColumnName => \"SAR\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/PercentagePriceOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PercentagePriceOscillatorTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new PercentagePriceOscillator(5, 10);\n        }\n\n        protected override string TestFileName => \"spy_ppo.txt\";\n\n        protected override string TestColumnName => \"PPO_5_10\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/PivotPointsHighLowTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PivotPointsHighLowTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            // Even if the indicator is ready, there may be zero values\n            ValueCanBeZero = true;\n            return new PivotPointsHighLow(10);\n        }\n\n        protected override string TestFileName => \"spy_pivot_pnt_hl.txt\";\n\n        protected override string TestColumnName => \"PPHL\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            var indicator = (PivotPointsHighLow)CreateIndicator();\n            RunTestIndicator(indicator);\n\n            var highPivotPoints = indicator.GetHighPivotPointsArray();\n            var lowPivotPoints = indicator.GetLowPivotPointsArray();\n            var pivotPoints = indicator.GetAllPivotPointsArray();\n\n            Assert.True(highPivotPoints.Length > 0);\n            Assert.True(lowPivotPoints.Length > 0);\n            Assert.True(pivotPoints.Length > 0);\n            Assert.AreEqual(pivotPoints.Length, highPivotPoints.Length + lowPivotPoints.Length);\n\n            Assert.That(pivotPoints, Is.Ordered.Descending.By(\"Time\"));\n        }\n\n        [TestCase(PivotPointType.Low)]\n        [TestCase(PivotPointType.High)]\n        [TestCase(PivotPointType.Both)]\n        [TestCase(PivotPointType.None)]\n        public void PivotPointPerType(PivotPointType pointType)\n        {\n            var pointsHighLow = new PivotPointsHighLow(10, 20);\n\n            for (var i = 0; i < pointsHighLow.WarmUpPeriod; i++)\n            {\n                Assert.IsFalse(pointsHighLow.IsReady);\n\n                var low = 1;\n                var high = 1;\n                if (i == 10)\n                {\n                    if (pointType == PivotPointType.Low || pointType == PivotPointType.Both)\n                    {\n                        low = 0;\n                    }\n                    if (pointType == PivotPointType.High || pointType == PivotPointType.Both)\n                    {\n                        high = 2;\n                    }\n                }\n\n                var bar = new TradeBar(DateTime.UtcNow.AddSeconds(i), Symbols.AAPL, i, high, low, i, i);\n                pointsHighLow.Update(bar);\n            }\n\n            Assert.IsTrue(pointsHighLow.IsReady);\n\n            var bothPivotPoint = pointsHighLow.GetAllPivotPointsArray();\n            var lowPivotPoint = pointsHighLow.GetLowPivotPointsArray();\n            var highPivotPoint = pointsHighLow.GetHighPivotPointsArray();\n\n            if (pointType == PivotPointType.None)\n            {\n                Assert.AreEqual(0, bothPivotPoint.Length);\n            }\n            if (pointType == PivotPointType.Both)\n            {\n                Assert.AreEqual(2, bothPivotPoint.Length);\n                Assert.AreEqual(1, lowPivotPoint.Length);\n                Assert.AreEqual(1, highPivotPoint.Length);\n                Assert.IsTrue(lowPivotPoint.Any(point => point.Value == 0));\n                Assert.IsTrue(highPivotPoint.Any(point => point.Value == 2));\n            }\n            if (pointType == PivotPointType.High)\n            {\n                Assert.AreEqual(1, bothPivotPoint.Length);\n                Assert.AreEqual(0, lowPivotPoint.Length);\n                Assert.AreEqual(1, highPivotPoint.Length);\n                Assert.IsTrue(highPivotPoint.Any(point => point.Value == 2));\n            }\n            if (pointType == PivotPointType.Low)\n            {\n                Assert.AreEqual(1, bothPivotPoint.Length);\n                Assert.AreEqual(1, lowPivotPoint.Length);\n                Assert.AreEqual(0, highPivotPoint.Length);\n                Assert.IsTrue(lowPivotPoint.Any(point => point.Value == 0));\n            }\n        }\n\n        /// <summary>\n        /// The expected value for this indicator is always zero\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n\n        /// <summary>\n        /// The expected value for this indicator is always zero\n        /// </summary>\n        protected override void IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(IndicatorBase indicator)\n        {\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void StrictVsRelaxedHighPivotDetection(bool strict)\n        {\n            var indicator = new PivotPointsHighLow(2, 2, strict: strict);\n            var referenceTime = new DateTime(2020, 1, 1);\n\n            // Create 5 bars where middle bar high EQUALS neighbors\n            // All bars have high = 100, which should only detect pivot in relaxed mode\n            for (var i = 0; i < 5; i++)\n            {\n                var bar = new TradeBar(referenceTime.AddSeconds(i), Symbols.AAPL, 100, 100, 90, 95, 1000);\n                indicator.Update(bar);\n            }\n\n            var highPivots = indicator.GetHighPivotPointsArray();\n\n            if (strict)\n            {\n                // Strict mode: middle bar high (100) is NOT > neighbors (100), so NO pivot\n                Assert.AreEqual(0, highPivots.Length, \"Strict mode should reject equal high values\");\n            }\n            else\n            {\n                // Relaxed mode: middle bar high (100) is >= neighbors (100), so YES pivot\n                Assert.AreEqual(1, highPivots.Length, \"Relaxed mode should accept equal high values\");\n                Assert.AreEqual(100, highPivots[0].Value);\n            }\n\n            var lowPivots = indicator.GetLowPivotPointsArray();\n\n            if (strict)\n            {\n                // Strict mode: middle bar low (50) is NOT < neighbors (50), so NO pivot\n                Assert.AreEqual(0, lowPivots.Length, \"Strict mode should reject equal low values\");\n            }\n            else\n            {\n                // Relaxed mode: middle bar low (50) is <= neighbors (50), so YES pivot\n                Assert.AreEqual(1, lowPivots.Length, \"Relaxed mode should accept equal low values\");\n                Assert.AreEqual(90, lowPivots[0].Value);\n            }\n        }\n\n        [Test]\n        public void DefaultBehaviorIsStrict()\n        {\n            // Create indicator without specifying strict parameter (should default to true)\n            var indicator = new PivotPointsHighLow(2, 2);\n            var referenceTime = new DateTime(2020, 1, 1);\n\n            // Create bars with equal high values\n            for (var i = 0; i < 5; i++)\n            {\n                var bar = new TradeBar(referenceTime.AddSeconds(i), Symbols.AAPL, 100, 100, 90, 95, 1000);\n                indicator.Update(bar);\n            }\n\n            var highPivots = indicator.GetHighPivotPointsArray();\n\n            // Default behavior should be strict, so NO pivot detected\n            Assert.AreEqual(0, highPivots.Length, \"Default behavior should be strict mode\");\n        }\n\n        [Test]\n        public void QCAlgorithmHelperMethodOverloadResolution()\n        {\n            // This test verifies that calling PPHL with minimal arguments compiles without ambiguity\n            // and uses the correct default behavior (strict mode)\n\n            // Instead of using QCAlgorithm, directly test the indicator\n            // The key point is that the method signature compiles without ambiguity\n            var indicator = new PivotPointsHighLow(2, 2);\n            var referenceTime = new DateTime(2020, 1, 1);\n\n            // Create bars with equal high values\n            for (var i = 0; i < 5; i++)\n            {\n                var bar = new TradeBar(referenceTime.AddSeconds(i), Symbols.AAPL, 100, 100, 90, 95, 1000);\n                indicator.Update(bar);\n            }\n\n            var highPivots = indicator.GetHighPivotPointsArray();\n\n            // Should default to strict mode, so NO pivot detected with equal values\n            Assert.AreEqual(0, highPivots.Length, \"Default constructor should use strict mode\");\n        }\n\n        [Test]\n        public void QCAlgorithmHelperOverloadResolution()\n        {\n            // This test verifies that all valid PPHL helper method call patterns compile without ambiguity\n            // and maintain backward compatibility with the original API.\n            // If this test compiles and passes, the overload resolution is working correctly.\n\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            var spy = algorithm.AddEquity(\"SPY\");\n            var symbol = spy.Symbol;\n\n            // Backward-compatible patterns that existed before adding the strict parameter:\n\n            // Pattern 1: Minimal call with just symbol and lengths\n            var pphl1 = algorithm.PPHL(symbol, 3, 3);\n            Assert.IsNotNull(pphl1, \"Minimal call pattern should work\");\n\n            // Pattern 2: With lastStoredValues\n            var pphl2 = algorithm.PPHL(symbol, 3, 3, 100);\n            Assert.IsNotNull(pphl2, \"Call with lastStoredValues should work\");\n\n            // Pattern 3: With lastStoredValues and resolution (CRITICAL backward compatibility test)\n            var pphl3 = algorithm.PPHL(symbol, 3, 3, 100, Resolution.Minute);\n            Assert.IsNotNull(pphl3, \"Call with lastStoredValues and resolution should work for backward compatibility\");\n\n            // Pattern 4: With lastStoredValues, resolution, and selector (CRITICAL backward compatibility test)\n            var pphl4 = algorithm.PPHL(symbol, 3, 3, 100, Resolution.Minute, (x) => x as IBaseDataBar);\n            Assert.IsNotNull(pphl4, \"Full original signature should work for backward compatibility\");\n\n            // New patterns with strict parameter:\n\n            // Pattern 5: With named strict parameter only\n            var pphl5 = algorithm.PPHL(symbol, 3, 3, strict: false);\n            Assert.IsNotNull(pphl5, \"Call with named strict parameter should work\");\n\n            // Pattern 6: With lastStoredValues and strict\n            var pphl6 = algorithm.PPHL(symbol, 3, 3, 100, false);\n            Assert.IsNotNull(pphl6, \"Call with lastStoredValues and strict should work\");\n\n            // Pattern 7: With lastStoredValues, strict, and resolution\n            var pphl7 = algorithm.PPHL(symbol, 3, 3, 100, false, Resolution.Minute);\n            Assert.IsNotNull(pphl7, \"Call with lastStoredValues, strict, and resolution should work\");\n\n            // Pattern 8: Full new signature\n            var pphl8 = algorithm.PPHL(symbol, 3, 3, 100, true, Resolution.Minute, (x) => x as IBaseDataBar);\n            Assert.IsNotNull(pphl8, \"Full new signature should work\");\n\n            // Pattern 9: With named parameters for clarity\n            var pphl9 = algorithm.PPHL(symbol, 3, 3, lastStoredValues: 50, strict: false, resolution: Resolution.Daily);\n            Assert.IsNotNull(pphl9, \"Call with named parameters should work\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/PremierStochasticOscillatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PremierStochasticOscillatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new PremierStochasticOscillator(\"PSO\", 8, 5);\n        }\n\n        protected override string TestFileName => \"spy_pso.csv\";\n\n        protected override string TestColumnName => \"pso\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double)((PremierStochasticOscillator)indicator).Current.Value, 1e-3);\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            int period = 3;\n            int emaPeriod = 2;\n            var pso = new PremierStochasticOscillator(period, emaPeriod);\n            int minInputValues = period + 2 * (emaPeriod - 1);\n            for (int i = 0; i < minInputValues; i++)\n            {\n                var data = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = DateTime.Now.AddSeconds(i),\n                    Close = i\n                };\n                pso.Update(data);\n            }\n            Assert.IsTrue(pso.IsReady);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/PythonIndicatorNoinheritanceTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PythonIndicatorNoinheritanceSnakeCaseTests : PythonIndicatorNoinheritanceTests\n    {\n        protected override bool SnakeCase => true;\n    }\n\n    [TestFixture]\n    public class PythonIndicatorNoinheritanceTests : PythonIndicatorTests\n    {\n        protected override bool SnakeCase => false;\n\n        /// <summary>\n        /// In this Custom Indicator, Update returns a boolean\n        /// </summary>\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    $@\"\nfrom collections import deque\nfrom datetime import datetime, timedelta\nfrom numpy import sum\n\nclass CustomSimpleMovingAverage():\n    def __init__(self, name, period):\n        self.{(SnakeCase ? \"name\" : \"Name\")}= name\n        self.{(SnakeCase ? \"value\" : \"Value\")} = 0\n        self.{(SnakeCase ? \"is_ready\" : \"IsReady\")} = False\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def {(SnakeCase ? \"update\" : \"Update\")}(self, input):\n        self.queue.appendleft(input.{(SnakeCase ? \"value\" : \"Value\")})\n        count = len(self.queue)\n        self.{(SnakeCase ? \"value\" : \"Value\")} = sum(self.queue) / count\n        self.{(SnakeCase ? \"is_ready\" : \"IsReady\")} = count == self.queue.maxlen\n        return self.{(SnakeCase ? \"is_ready\" : \"IsReady\")}\n\"\n                );\n                var indicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                    .Invoke(\"custom\".ToPython(), 14.ToPython());\n\n                return new PythonIndicator(indicator);\n            }\n        }\n\n        protected override void RunTestIndicator(IndicatorBase<IBaseData> indicator)\n        {\n            var first = true;\n            var closeIndex = -1;\n            var targetIndex = -1;\n            foreach (var line in File.ReadLines(Path.Combine(\"TestData\", TestFileName)))\n            {\n                var parts = line.Split(new[] { ',' }, StringSplitOptions.None);\n\n                if (first)\n                {\n                    first = false;\n                    for (var i = 0; i < parts.Length; i++)\n                    {\n                        if (parts[i].Trim() == \"Close\")\n                        {\n                            closeIndex = i;\n                        }\n                        if (parts[i].Trim() == TestColumnName)\n                        {\n                            targetIndex = i;\n                        }\n                    }\n                    if (closeIndex * targetIndex < 0)\n                    {\n                        Assert.Fail($\"Didn't find one of 'Close' or '{TestColumnName}' in the header: {line}\");\n                    }\n\n                    continue;\n                }\n\n                var close = decimal.Parse(parts[closeIndex], CultureInfo.InvariantCulture);\n                var date = Time.ParseDate(parts[0]);\n\n                var data = new IndicatorDataPoint(date, close);\n                indicator.Update(data);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts[targetIndex].Trim()))\n                {\n                    continue;\n                }\n\n                var expected = double.Parse(parts[targetIndex], CultureInfo.InvariantCulture);\n                Assertion.Invoke(indicator, expected);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/PythonIndicatorNoinheritanceTestsLegacy.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PythonIndicatorNoinheritanceTestsSnakeCaseLegacy : PythonIndicatorNoinheritanceTestsLegacy\n    {\n        protected override bool SnakeCase => true;\n    }\n\n    [TestFixture]\n    public class PythonIndicatorNoinheritanceTestsLegacy : PythonIndicatorTests\n    {\n        protected override bool SnakeCase => false;\n\n        /// <summary>\n        /// In this Custom Indicator, Update returns void\n        /// </summary>\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    $@\"\nfrom collections import deque\nfrom datetime import datetime, timedelta\nfrom numpy import sum\n\nclass CustomSimpleMovingAverage():\n    def __init__(self, name, period):\n        self.{(SnakeCase ? \"name\" : \"Name\")}= name\n        self.{(SnakeCase ? \"value\" : \"Value\")} = 0\n        self.{(SnakeCase ? \"is_ready\" : \"IsReady\")} = False\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def {(SnakeCase ? \"update\" : \"Update\")}(self, input):\n        self.queue.appendleft(input.{(SnakeCase ? \"value\" : \"Value\")})\n        count = len(self.queue)\n        self.{(SnakeCase ? \"value\" : \"Value\")} = sum(self.queue) / count\n        self.{(SnakeCase ? \"is_ready\" : \"IsReady\")} = count == self.queue.maxlen\n\"\n                );\n                var indicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                    .Invoke(\"custom\".ToPython(), 14.ToPython());\n\n                return new PythonIndicator(indicator);\n            }\n        }\n\n        protected override void RunTestIndicator(IndicatorBase<IBaseData> indicator)\n        {\n            var first = true;\n            var closeIndex = -1;\n            var targetIndex = -1;\n            foreach (var line in File.ReadLines(Path.Combine(\"TestData\", TestFileName)))\n            {\n                var parts = line.Split(new[] { ',' }, StringSplitOptions.None);\n\n                if (first)\n                {\n                    first = false;\n                    for (var i = 0; i < parts.Length; i++)\n                    {\n                        if (parts[i].Trim() == \"Close\")\n                        {\n                            closeIndex = i;\n                        }\n                        if (parts[i].Trim() == TestColumnName)\n                        {\n                            targetIndex = i;\n                        }\n                    }\n                    if (closeIndex * targetIndex < 0)\n                    {\n                        Assert.Fail($\"Didn't find one of 'Close' or '{TestColumnName}' in the header: {line}\");\n                    }\n\n                    continue;\n                }\n\n                var close = decimal.Parse(parts[closeIndex], CultureInfo.InvariantCulture);\n                var date = Time.ParseDate(parts[0]);\n\n                var data = new IndicatorDataPoint(date, close);\n                indicator.Update(data);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts[targetIndex].Trim()))\n                {\n                    continue;\n                }\n\n                var expected = double.Parse(parts[targetIndex], CultureInfo.InvariantCulture);\n                Assertion.Invoke(indicator, expected);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/PythonIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class PythonIndicatorTestsSnakeCase : PythonIndicatorTests\n    {\n        protected override bool SnakeCase => true;\n    }\n\n    [TestFixture]\n    public class PythonIndicatorTests : CommonIndicatorTests<IBaseData>\n    {\n        [SetUp]\n        public void SetUp()\n        {\n            SymbolCache.Clear();\n        }\n\n        protected virtual bool SnakeCase => false;\n\n        private PyObject CreatePythonIndicator(int period = 14)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    $@\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.{(SnakeCase ? \"name\" : \"Name\")} = name\n        self.{(SnakeCase ? \"value\" : \"Value\")} = 0\n        self.{(SnakeCase ? \"period\" : \"Period\")} = period\n        self.{(SnakeCase ? \"warm_up_period\" : \"WarmUpPeriod\")} = period\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def {(SnakeCase ? \"update\" : \"Update\")}(self, input):\n        self.queue.appendleft(input.Value)\n        count = len(self.queue)\n        self.{(SnakeCase ? \"value\" : \"Value\")} = np.sum(self.queue) / count\n        return count == self.queue.maxlen\n\"\n                );\n                var indicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                    .Invoke(\"custom\".ToPython(), period.ToPython());\n\n                return indicator;\n            }\n        }\n\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n        {\n            return new PythonIndicator(CreatePythonIndicator());\n        }\n\n        protected override string TestFileName => \"spy_with_indicators.txt\";\n\n        protected override string TestColumnName => \"SMA14\";\n\n        protected override void RunTestIndicator(IndicatorBase<IBaseData> indicator)\n        {\n            var first = true;\n            var closeIndex = -1;\n            var targetIndex = -1;\n            foreach (var line in File.ReadLines(Path.Combine(\"TestData\", TestFileName)))\n            {\n                var parts = line.Split(new[] { ',' }, StringSplitOptions.None);\n\n                if (first)\n                {\n                    first = false;\n                    for (var i = 0; i < parts.Length; i++)\n                    {\n                        if (parts[i].Trim() == \"Close\")\n                        {\n                            closeIndex = i;\n                        }\n                        if (parts[i].Trim() == TestColumnName)\n                        {\n                            targetIndex = i;\n                        }\n                    }\n                    if (closeIndex * targetIndex < 0)\n                    {\n                        Assert.Fail($\"Didn't find one of 'Close' or '{TestColumnName}' in the header: {line}\");\n                    }\n\n                    continue;\n                }\n\n                var close = decimal.Parse(parts[closeIndex], CultureInfo.InvariantCulture);\n                var date = Time.ParseDate(parts[0]);\n\n                var data = new IndicatorDataPoint(date, close);\n                indicator.Update(data);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts[targetIndex].Trim()))\n                {\n                    continue;\n                }\n\n                var expected = double.Parse(parts[targetIndex], CultureInfo.InvariantCulture);\n                Assertion.Invoke(indicator, expected);\n            }\n        }\n\n        protected override Action<IndicatorBase<IBaseData>, double> Assertion => (indicator, expected) =>\n            Assert.AreEqual(expected, (double) indicator.Current.Value, 1e-2);\n\n        [Test]\n        public void SmaComputesCorrectly()\n        {\n            var sma = new SimpleMovingAverage(4);\n            var data = new[] {1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m};\n\n            var seen = new List<decimal>();\n            for (int i = 0; i < data.Length; i++)\n            {\n                var datum = data[i];\n                seen.Add(datum);\n                sma.Update(new IndicatorDataPoint(DateTime.Now.AddSeconds(i), datum));\n                Assert.AreEqual(Enumerable.Reverse(seen).Take(sma.Period).Average(), sma.Current.Value);\n            }\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var sma = new SimpleMovingAverage(3);\n\n            sma.Update(DateTime.UtcNow, 1m);\n            sma.Update(DateTime.UtcNow, 1m);\n            Assert.IsFalse(sma.IsReady);\n            sma.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(sma.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var sma = new SimpleMovingAverage(3);\n\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                sma.Update(data);\n            }\n            Assert.IsTrue(sma.IsReady);\n\n            sma.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(sma);\n            TestHelper.AssertIndicatorIsInDefaultState(sma.RollingSum);\n            sma.Update(DateTime.UtcNow, 2.0m);\n            Assert.AreEqual(sma.Current.Value, 2.0m);\n        }\n\n        [Test]\n        public void RegisterPythonCustomIndicatorProperly()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spy = algorithm.AddEquity(\"SPY\").Symbol;\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\nclass GoodCustomIndicator(PythonIndicator):\n    def __init__(self):\n        self.Value = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\nclass BadCustomIndicator(PythonIndicator):\n    def __init__(self):\n        self.Valeu = 0\n    def Update(self, input):\n        self.Value = input.Value\n        return True\"\n                );\n\n                var goodIndicator = module.GetAttr(\"GoodCustomIndicator\").Invoke();\n                Assert.DoesNotThrow(() => algorithm.RegisterIndicator(spy, goodIndicator, Resolution.Minute));\n\n                var actual = algorithm.SubscriptionManager.Subscriptions\n                    .FirstOrDefault(config => config.TickType == TickType.Trade)\n                    .Consolidators.Count;\n                Assert.AreEqual(1, actual);\n\n                var badIndicator = module.GetAttr(\"BadCustomIndicator\").Invoke();\n                Assert.Throws<NotImplementedException>(() => algorithm.RegisterIndicator(spy, badIndicator, Resolution.Minute));\n            }\n        }\n\n        [Test]\n        public void AllPythonRegisterIndicatorCases()\n        {\n            //This test covers all three cases of registering a indicator through Python\n\n            //Setup algorithm and Equity\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spy = algorithm.AddEquity(\"SPY\").Symbol;\n\n            //Setup Python Indicator and Consolidator\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"consolidator = QuoteBarConsolidator(timedelta(days = 5)) \\n\" +\n                    \"timeDelta = timedelta(days=2)\\n\" +\n                    \"class CustomIndicator(PythonIndicator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.value = 0\\n\" +\n                    \"   def update(self, input):\\n\" +\n                    \"       self.value = input.value\\n\" +\n                    \"       return True\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       pass\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       pass\\n\"\n                );\n\n                //Get our variables from Python\n                var PyIndicator = module.GetAttr(\"CustomIndicator\").Invoke();\n                var PyConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                var Consolidator = module.GetAttr(\"consolidator\");\n                algorithm.SubscriptionManager.AddConsolidator(spy, Consolidator);\n                var TimeDelta = module.GetAttr(\"timeDelta\");\n\n                //Test 1: Using a C# Consolidator; Should convert consolidator into IDataConsolidator\n                Assert.DoesNotThrow(() => algorithm.RegisterIndicator(spy, PyIndicator, Consolidator));\n\n                //Test 2: Using a Python Consolidator; Should wrap consolidator\n                Assert.DoesNotThrow(() => algorithm.RegisterIndicator(spy, PyIndicator, PyConsolidator));\n\n                //Test 3: Using a timedelta object; Should convert timedelta to timespan\n                Assert.DoesNotThrow(() => algorithm.RegisterIndicator(spy, PyIndicator, TimeDelta));\n            }\n        }\n\n        //Test 1: Using a C# Consolidator; Should convert consolidator into IDataConsolidator and fail because of the InputType\n        [TestCase(\"consolidator\", false, \"Type mismatch found between consolidator and symbol. Symbol: SPY does not support input type: QuoteBar. Supported types: TradeBar.\")]\n        //Test 2: Using a Python Consolidator; Should wrap consolidator and fail because of the InputType\n        [TestCase(\"CustomConsolidator\", true, \"Type mismatch found between consolidator and symbol. Symbol: SPY does not support input type: QuoteBar. Supported types: TradeBar.\")]\n        //Test 3: Using an invalid consolidator; Should try to convert into C#, Python Consolidator and timedelta and fail as the type is invalid\n        [TestCase(\"InvalidConsolidator\", true, \"Invalid third argument, should be either a valid consolidator or timedelta object. The following exception was thrown: \")]\n        public void AllPythonRegisterIndicatorBadCases(string consolidatorName, bool needsInvoke, string expectedMessage)\n        {\n            //This test covers all three bad cases of registering a indicator through Python\n\n            //Setup algorithm and Equity\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.AddData<TradeBar>(\"SPY\", Resolution.Daily);\n            var spy = \"SPY\";\n\n            //Setup Python Indicator and Consolidator\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"consolidator = QuoteBarConsolidator(timedelta(days = 5)) \\n\" +\n                    \"class CustomIndicator(PythonIndicator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.value = 0\\n\" +\n                    \"   def update(self, input):\\n\" +\n                    \"       self.value = input.value\\n\" +\n                    \"       return True\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       pass\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       pass\\n\" +\n                    \"class InvalidConsolidator:\\n\" +\n                    \"   pass\\n\"\n                );\n\n                //Get our variables from Python\n                var PyIndicator = module.GetAttr(\"CustomIndicator\").Invoke();\n                var Consolidator = module.GetAttr(consolidatorName);\n                if (needsInvoke)\n                {\n                    Consolidator = Consolidator.Invoke();\n                }\n\n                #pragma warning disable CS0618\n                var exception = Assert.Throws<ArgumentException>(() => algorithm.RegisterIndicator(spy, PyIndicator, Consolidator));\n                #pragma warning restore CS0618\n                Assert.That(exception.Message, Is.EqualTo(expectedMessage));\n            }\n        }\n\n        [Test]\n        public void WarmsUpProperlyPythonIndicator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.Name = name\n        self.Value = 0\n        self.queue = deque(maxlen=period)\n        self.WarmUpPeriod = period\n\n    # Update method is mandatory\n    def Update(self, input):\n        self.queue.appendleft(input.Value)\n        count = len(self.queue)\n        self.Value = np.sum(self.queue) / count\n        return count == self.queue.maxlen\n\"\n                );\n                var pythonIndicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                    .Invoke(\"custom\".ToPython(), 14.ToPython());\n                var SMAWithWarmUpPeriod = new PythonIndicator(pythonIndicator);\n                var reference = new DateTime(2000, 1, 1, 0, 0, 0);\n                var period = ((IIndicatorWarmUpPeriodProvider)SMAWithWarmUpPeriod).WarmUpPeriod;\n\n                // Check the WarmUpPeriod parameter is the one defined in the constructor of the custom indicator\n                Assert.AreEqual(14, period);\n\n                for (var i = 0; i < period; i++)\n                {\n                    SMAWithWarmUpPeriod.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddDays(1 + i) });\n                    Assert.AreEqual(i == period - 1, SMAWithWarmUpPeriod.IsReady);\n                }\n            }\n        }\n\n        [Test]\n        public void SetDefaultWarmUpPeriodProperly()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\n                    Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\nfrom collections import deque\n\nclass CustomSimpleMovingAverage(PythonIndicator):\n    def __init__(self, name, period):\n        self.Name = name\n        self.Value = 0\n        self.queue = deque(maxlen=period)\n\n    # Update method is mandatory\n    def Update(self, input):\n        self.queue.appendleft(input.Value)\n        count = len(self.queue)\n        self.Value = np.sum(self.queue) / count\n        return count == self.queue.maxlen\n\"\n                );\n                var pythonIndicator = module.GetAttr(\"CustomSimpleMovingAverage\")\n                    .Invoke(\"custom\".ToPython(), 14.ToPython());\n                var indicator = new PythonIndicator(pythonIndicator);\n\n                Assert.AreEqual(0, indicator.WarmUpPeriod);\n            }\n        }\n\n        [Test]\n        public void PythonIndicatorDoesntRequireWrappingToWork()\n        {\n            var data = new[] { 1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m, 2468m, 13579m };\n            var seen = new List<decimal>();\n            var start = new DateTime(2022, 11, 15);\n            var period = 4;\n\n            using (Py.GIL())\n            {\n                using dynamic customSma = CreatePythonIndicator(period);\n                var wrapper = new PythonIndicator(customSma);\n\n                for (int i = 0; i < data.Length; i++)\n                {\n                    var datum = data[i];\n                    seen.Add(datum);\n\n                    wrapper.Update(new IndicatorDataPoint(start.AddSeconds(i), datum));\n\n                    var value = SnakeCase ? (decimal)customSma.value : (decimal)customSma.Value;\n\n                    Assert.AreEqual(Enumerable.Reverse(seen).Take(period).Average(), value);\n                }\n            }\n        }\n\n        [Test]\n        public void IndicatorExtensionsWorkForPythonIndicators()\n        {\n            var data = new[] { 1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m, 2468m, 13579m };\n            var seen = new List<decimal>();\n            var start = new DateTime(2022, 11, 15);\n\n            var period = 4;\n            var sma = new SimpleMovingAverage(period);\n\n            using (Py.GIL())\n            {\n                using dynamic customSma = CreatePythonIndicator(period);\n                IndicatorExtensions.Of(customSma, sma.ToPython());\n\n                for (int i = 0; i < data.Length; i++)\n                {\n                    var datum = data[i];\n\n                    sma.Update(new IndicatorDataPoint(start.AddSeconds(i), datum));\n\n                    if (i < 2 * period - 2)\n                    {\n                        Assert.IsFalse((bool)customSma.IsReady);\n                    }\n                    else\n                    {\n                        Assert.IsTrue((bool)customSma.IsReady);\n                    }\n\n                    var value = SnakeCase ? (decimal)customSma.value : (decimal)customSma.Value;\n                    if (i < period - 1)\n                    {\n                        Assert.AreEqual(0m, value);\n                    }\n                    else\n                    {\n                        seen.Add(sma.Current.Value);\n                        Assert.AreEqual(Enumerable.Reverse(seen).Take(period).Average(), value);\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void PythonIndicatorExtensionInRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\n                \"CustomIndicatorWithExtensionAlgorithm\",\n                new (),\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        /// <summary>\n        /// The external test file of this indicator does not define market data. Therefore\n        /// we skip the test\n        /// </summary>\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n        }\n\n        /// <summary>\n        /// The external test file of this indicator does not define market data. Therefore\n        /// we skip the test\n        /// </summary>\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RateOfChangePercentTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RateOfChangePercentTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new RateOfChangePercent(50);\n        }\n\n        protected override string TestFileName => \"spy_with_rocp50.txt\";\n\n        protected override string TestColumnName => \"Rate of Change % 50\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/RateOfChangeRatioTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RateOfChangeRatioTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new RateOfChangeRatio(5);\n        }\n\n        protected override string TestFileName => \"spy_rocr.txt\";\n\n        protected override string TestColumnName => \"ROCR_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/RateOfChangeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RateOfChangeTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new RateOfChange(50);\n        }\n\n        protected override string TestFileName => \"spy_with_rocp50.txt\";\n\n        protected override string TestColumnName => \"Rate of Change % 50\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double) indicator.Current.Value * 100, 1e-3);\n\n        /// <summary>\n        /// Test for issue #5491\n        /// </summary>\n        [Test]\n        public void IndicatorValueIsNotZeroWhenReady()\n        {\n            var indicator = new RateOfChange(1);\n            var time = DateTime.Now;\n\n            for (int i = 1; i <= indicator.WarmUpPeriod; i++)\n            {\n                indicator.Update(time, i);\n                time = time.AddSeconds(1);\n\n                Assert.AreEqual(i == indicator.WarmUpPeriod, indicator.IsReady);\n            }\n\n            Assert.IsTrue(indicator.Current > 0);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RegressionChannelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Result tested vs. Python available at: http://tinyurl.com/o7redso\n    /// </summary>\n    [TestFixture]\n    public class RegressionChannelTests\n    {\n        [Test]\n        public void ComputesCorrectly()\n        {\n            const int period = 20;\n            var indicator = new RegressionChannel(period, 2);\n            var stdDev = new StandardDeviation(period);\n            var time = DateTime.Now;\n\n            var prices = LeastSquaresMovingAverageTests.Prices;\n            var expected = LeastSquaresMovingAverageTests.Expected;\n\n            var actual = new decimal[prices.Length];\n\n            for (var i = 0; i < prices.Length; i++)\n            {\n                indicator.Update(time.AddMinutes(i), prices[i]);\n                stdDev.Update(time, prices[i]);\n                actual[i] = Math.Round(indicator.Current.Value, 4);\n            }\n            Assert.AreEqual(expected, actual);\n\n            var expectedUpper = indicator.Current.Value + stdDev.Current.Value * 2;\n            Assert.AreEqual(expectedUpper, indicator.UpperChannel.Current.Value);\n            var expectedLower = indicator.Current.Value - stdDev.Current.Value * 2;\n            Assert.AreEqual(expectedLower, indicator.LowerChannel.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            const int period = 10;\n            var indicator = new RegressionChannel(period, 2);\n            var time = DateTime.Now;\n\n            for (var i = 0; i < period + 1; i++)\n            {\n                indicator.Update(time.AddMinutes(i), 1m);\n            }\n            Assert.IsTrue(indicator.IsReady, \"Regression Channel ready\");\n            indicator.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            var indicator = new RegressionChannel(20, 2);\n            var period = ((IIndicatorWarmUpPeriodProvider)indicator).WarmUpPeriod;\n            var prices = LeastSquaresMovingAverageTests.Prices;\n            var time = DateTime.Now;\n\n            for (var i = 0; i < period; i++)\n            {\n                indicator.Update(time.AddMinutes(i), prices[i]);\n                Assert.AreEqual(i == period - 1, indicator.IsReady);\n            }\n        }\n\n        [Test]\n        public void LowerUpperChannelUpdateOnce()\n        {\n            var regressionChannel = new RegressionChannel(2, 2m);\n            var lowerChannelUpdateCount = 0;\n            var upperChannelUpdateCount = 0;\n            regressionChannel.LowerChannel.Updated += (sender, updated) =>\n            {\n                lowerChannelUpdateCount++;\n            };\n            regressionChannel.UpperChannel.Updated += (sender, updated) =>\n            {\n                upperChannelUpdateCount++;\n            };\n\n            Assert.AreEqual(0, lowerChannelUpdateCount);\n            Assert.AreEqual(0, upperChannelUpdateCount);\n            regressionChannel.Update(DateTime.Today, 1m);\n\n            Assert.AreEqual(1, lowerChannelUpdateCount);\n            Assert.AreEqual(1, upperChannelUpdateCount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RelativeDailyVolumeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class RelativeDailyVolumeTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            return new RelativeDailyVolume(2);\n        }\n\n        protected override string TestFileName => \"spy_rdv.txt\";\n\n        protected override string TestColumnName => \"RDV\";\n\n        protected override Action<IndicatorBase<TradeBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 0.001); }\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var rdv = new RelativeDailyVolume(2); // Default resolution is daily\n            var reference = System.DateTime.Today;\n\n            rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddDays(1) });\n            rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 3, High = 4, Volume = 200, Time = reference.AddDays(2) });\n            rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 5, High = 6, Volume = 300, Time = reference.AddDays(3) });\n            Assert.IsTrue(rdv.IsReady);\n            Assert.AreNotEqual(0m, rdv.Current.Value);\n\n            rdv.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(rdv);\n        }\n\n        public void AddTradeBarData(ref RelativeDailyVolume rdv, int iterations, Resolution resolution, DateTime reference)\n        {\n            for (int i = 0; i < iterations; i++)\n            {\n                if (resolution == Resolution.Daily)\n                {\n                    rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddDays(1 + i) });\n                }\n                else if (resolution == Resolution.Hour)\n                {\n                    rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddHours(1 + i) });\n                }\n                else if (resolution == Resolution.Minute)\n                {\n                    rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddMinutes(1 + i) });\n                }\n                else if (resolution == Resolution.Second)\n                {\n                    rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddSeconds(1 + i) });\n                }\n                else\n                {\n                    rdv.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddSeconds(1 + i) });\n                }\n            }\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var rdv1 = new RelativeDailyVolume(2);\n            var rdv2 = new RelativeDailyVolume(2);\n            var rdv3 = new RelativeDailyVolume(2);\n            var rdv4 = new RelativeDailyVolume(2);\n            var rdv5 = new RelativeDailyVolume(2);\n            var rdv6 = new RelativeDailyVolume(2);\n            var rdv7 = new RelativeDailyVolume(2);\n            var rdv8 = new RelativeDailyVolume(2);\n            var reference = new DateTime(2000, 1, 1, 0, 0, 0);\n\n            AddTradeBarData(ref rdv1, 2 + 1, Resolution.Daily, reference); // Needs one more datapoint after x days to be ready\n            AddTradeBarData(ref rdv2, 48, Resolution.Hour, reference);\n            AddTradeBarData(ref rdv3, (1440 * 2), Resolution.Minute, reference);\n            AddTradeBarData(ref rdv4, (86400 * 2), Resolution.Second, reference);\n            AddTradeBarData(ref rdv5, 2, Resolution.Daily, reference);\n            AddTradeBarData(ref rdv6, 47, Resolution.Hour, reference);\n            AddTradeBarData(ref rdv7, (1440 * 2) - 1, Resolution.Minute, reference);\n            AddTradeBarData(ref rdv8, (86400 * 2) - 1, Resolution.Second, reference);\n\n            Assert.IsTrue(rdv1.IsReady);\n            Assert.IsTrue(rdv2.IsReady);\n            Assert.IsTrue(rdv3.IsReady);\n            Assert.IsTrue(rdv4.IsReady);\n            Assert.IsFalse(rdv5.IsReady);\n            Assert.IsFalse(rdv6.IsReady);\n            Assert.IsFalse(rdv7.IsReady);\n            Assert.IsFalse(rdv8.IsReady);\n        }\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RelativeMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RelativeMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new RelativeMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_with_rma.csv\";\n\n        protected override string TestColumnName => \"RMA5\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1e-2); }\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var rma = new RelativeMovingAverage(5);\n            foreach (var data in TestHelper.GetDataStream(5 * 3))\n            {\n                Assert.IsFalse(rma.IsReady);\n                rma.Update(data);\n            }\n            Assert.IsTrue(rma.IsReady);\n\n            rma.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(rma);\n            TestHelper.AssertIndicatorIsInDefaultState(rma.ShortAverage);\n            TestHelper.AssertIndicatorIsInDefaultState(rma.MediumAverage);\n            TestHelper.AssertIndicatorIsInDefaultState(rma.LongAverage);\n            rma.Update(DateTime.UtcNow, 2.0m);\n            Assert.AreEqual(rma.Current.Value, 2.0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RelativeStrengthIndexTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RelativeStrengthIndexTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new RelativeStrengthIndex(14);\n        }\n\n        protected override string TestFileName => \"spy_with_indicators.txt\";\n\n        protected override string TestColumnName => \"RSI 14 Wilder\";\n\n        [Test]\n        public void ComparesAgainstExternalDataSma()\n        {\n            var rsiSimple = new RelativeStrengthIndex(\"rsi\", 14, MovingAverageType.Simple);\n            TestHelper.TestIndicator(rsiSimple, \"RSI 14\");\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var rsi = new RelativeStrengthIndex(2);\n            rsi.Update(DateTime.Today, 1m);\n            rsi.Update(DateTime.Today.AddSeconds(1), 2m);\n            Assert.IsFalse(rsi.IsReady);\n\n            rsi.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(rsi);\n            TestHelper.AssertIndicatorIsInDefaultState(rsi.AverageGain);\n            TestHelper.AssertIndicatorIsInDefaultState(rsi.AverageLoss);\n        }\n\n        [Test]\n        public void DoesNotThrowDivisionByZero()\n        {\n            var rsi = new RelativeStrengthIndex(14, MovingAverageType.DoubleExponential);\n\n            rsi.Update(DateTime.UtcNow, 101m);\n            rsi.Update(DateTime.UtcNow, 103m);\n\n            for (var i = 0; i < 500; i++)\n            {\n                rsi.Update(DateTime.UtcNow, 102m);\n\n                // validate the expected range\n                Assert.That(rsi >= 0 && rsi <= 100);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/RelativeVigorIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RelativeVigorIndexTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 10000000m;\n            return new RelativeVigorIndex(\"RVI\", 10);\n        }\n\n        protected override string TestFileName => \"spy_rvi.txt\";\n        protected override string TestColumnName => \"RVI\";\n\n        [Test]\n        public void ComparesWithExternalDataRviSignal()\n        {\n            var rvi = CreateIndicator();\n            TestHelper.TestIndicator(rvi, TestFileName, \"RVI_S\",\n                (ind, expected) => Assert.AreEqual(expected,\n                    (double)((RelativeVigorIndex)ind).Signal.Current.Value, 0.06));\n        }\n\n        [Test]\n        public void TestDivByZero() // Should give 0 (default) to avoid div by zero errors.\n        {\n            var rvi = CreateIndicator();\n            for (int i = 0; i < 13; i++)\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = 0m,\n                    Close = 0m,\n                    High = 0m,\n                    Low = 0m,\n                    Volume = 1\n                };\n                rvi.Update(tradeBar);\n            }\n            Assert.AreEqual(rvi.Current.Value, 0m);\n            Assert.AreEqual(((RelativeVigorIndex)rvi).Signal.Current.Value, 0m);\n        }\n\n        [Test]\n        public void SignalUpdatesOnFlatMarket()\n        {\n            var rvi = new RelativeVigorIndex(\"RVI\", 10);\n            var referenceTime = System.DateTime.Today;\n\n            for (int i = 0; i < 30; i++)\n            {\n                rvi.Update(new TradeBar\n                {\n                    Time = referenceTime.AddMinutes(i),\n                    Open = 105m,\n                    High = 105m,\n                    Low = 105m,\n                    Close = 105m,\n                    Volume = 1000\n                });\n            }\n\n            var signalSamples = rvi.Signal.Samples;\n            Assert.AreEqual(18, signalSamples);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ResetCompositeIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    public class ResetCompositeIndicatorTests : CompositeIndicatorTests\n    {\n        [Test]\n        public override void ResetsProperly()\n        {\n            var left = new Maximum(\"left\", 2);\n            var right = new Minimum(\"right\", 2);\n            var resetActionExectuted = false;\n            var resetAction = () =>\n            {\n                resetActionExectuted = true;\n            };\n            var composite = new ResetCompositeIndicator(left, right, (l, r) => l.Current.Value + r.Current.Value, resetAction);\n\n            left.Update(DateTime.Today, 1m);\n            right.Update(DateTime.Today, -1m);\n\n            left.Update(DateTime.Today.AddDays(1), -1m);\n            right.Update(DateTime.Today.AddDays(1), 1m);\n\n            Assert.AreEqual(left.PeriodsSinceMaximum, 1);\n            Assert.AreEqual(right.PeriodsSinceMinimum, 1);\n\n            composite.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(composite);\n            TestHelper.AssertIndicatorIsInDefaultState(left);\n            TestHelper.AssertIndicatorIsInDefaultState(right);\n            Assert.AreEqual(left.PeriodsSinceMaximum, 0);\n            Assert.AreEqual(right.PeriodsSinceMinimum, 0);\n            Assert.IsTrue(resetActionExectuted);\n        }\n\n        protected override CompositeIndicator CreateCompositeIndicator(IndicatorBase left, IndicatorBase right, CompositeIndicator.IndicatorComposer composer)\n        {\n            return new ResetCompositeIndicator(left, right, composer, () => { });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RhoTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class RhoTests : OptionBaseIndicatorTests<Rho>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n            => new Rho(\"testRhoIndicator\", _symbol, 0.0403m, 0.0m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new Rho(\"testRhoIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new Rho(\"testRhoIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.R(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            // 2 updates per iteration, 1 for greek, 1 for IV\n            RiskFreeRateUpdatesPerIteration = 2;\n            DividendYieldUpdatesPerIteration = 2;\n        }\n\n        // No Rho data available from IB\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.3628, OptionStyle.European)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.3885, OptionStyle.European)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.4761, OptionStyle.European)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.2119, OptionStyle.European)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.1652, OptionStyle.European)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.4498, OptionStyle.European)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 1.2862, OptionStyle.European)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -1.0337, OptionStyle.European)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 1.5558, OptionStyle.European)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.1235, OptionStyle.European)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.5326, OptionStyle.European)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -1.3178, OptionStyle.European)]\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.3628, OptionStyle.American)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.3884, OptionStyle.American)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.4761, OptionStyle.American)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.2119, OptionStyle.American)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.1648, OptionStyle.American)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.4498, OptionStyle.American)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 1.2861, OptionStyle.American)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -1.0336, OptionStyle.American)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 1.5558, OptionStyle.American)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.1230, OptionStyle.American)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.5306, OptionStyle.American)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -1.3180, OptionStyle.American)]\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refRho, OptionStyle style)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, _reference.AddDays(expiry));\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Rho(symbol, 0.053m, 0.0153m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refRho, (double)indicator.Current.Value, 0.017d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 15)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 0)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 5)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, expiration);\n            var indicator = new Rho(symbol, 0.053m, 0.0153m,\n                optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RogersSatchellVolatilityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class RogersSatchellVolatilityTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            return new RogersSatchellVolatility(9);\n        }\n\n        protected override string TestFileName => \"spy_with_rsv.csv\";\n        protected override string TestColumnName => \"RSV9\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/RollingWindowTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class RollingWindowTests\n    {\n        [Test]\n        public void ResizedFromZero()\n        {\n            var window = new RollingWindow<int>(0);\n\n            Assert.AreEqual(0, window.Count);\n            Assert.AreEqual(0, window.Size);\n            window.Size = 1;\n            window.Add(10);\n\n            Assert.AreEqual(1, window.Count);\n            Assert.AreEqual(1, window.Size);\n            Assert.AreEqual(10, window[0]);\n            Assert.AreEqual(10, window[-1]);\n        }\n\n        [Test]\n        public void NotFullRollingWindowNegativeIndex()\n        {\n            var window = new RollingWindow<int>(3);\n            window.Add(10);\n            window.Add(20);\n\n            Assert.AreEqual(20, window.First());\n            Assert.AreEqual(20, window[0]);\n            Assert.AreEqual(20, window[-2]);\n\n            Assert.AreEqual(10, window[1]);\n            Assert.AreEqual(10, window[-1]);\n            Assert.AreEqual(10, window.Last());\n\n            Assert.AreEqual(0, window[2]);\n            Assert.AreEqual(0, window[-3]);\n\n            window.Add(30);\n            window.Add(40);\n\n            Assert.AreEqual(40, window.First());\n            Assert.AreEqual(40, window[0]);\n            Assert.AreEqual(40, window[-3]);\n\n            Assert.AreEqual(20, window[2]);\n            Assert.AreEqual(20, window[-1]);\n            Assert.AreEqual(20, window.Last());\n\n            Assert.IsTrue(window.IsReady);\n            Assert.AreEqual(3, window.Size);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(4, window.Samples);\n        }\n\n        [Test]\n        public void NewWindowIsEmpty()\n        {\n            var window = new RollingWindow<int>(1);\n            Assert.AreEqual(1, window.Size);\n            Assert.AreEqual(0, window.Count);\n            Assert.AreEqual(0, window.Samples);\n            Assert.IsFalse(window.IsReady);\n        }\n\n        [Test]\n        public void AddsData()\n        {\n            var window = new RollingWindow<int>(2);\n            Assert.AreEqual(0, window.Count);\n            Assert.AreEqual(0, window.Samples);\n            Assert.AreEqual(2, window.Size);\n            Assert.IsFalse(window.IsReady);\n\n            window.Add(1);\n            Assert.AreEqual(1, window.Count);\n            Assert.AreEqual(1, window.Samples);\n            Assert.AreEqual(2, window.Size);\n            Assert.IsFalse(window.IsReady);\n\n            // add one more and the window is ready\n            window.Add(2);\n            Assert.AreEqual(2, window.Count);\n            Assert.AreEqual(2, window.Samples);\n            Assert.AreEqual(2, window.Size);\n            Assert.IsTrue(window.IsReady);\n        }\n\n        [Test]\n        public void OldDataFallsOffBackOfWindow()\n        {\n            var window = new RollingWindow<int>(1);\n            Assert.IsFalse(window.IsReady);\n\n            // add one and the window is ready, but MostRecentlyRemoved throws\n\n            window.Add(0);\n            Assert.Throws<InvalidOperationException>(() => { var x = window.MostRecentlyRemoved; });\n            Assert.AreEqual(1, window.Count);\n            Assert.IsTrue(window.IsReady);\n\n            // add another one and MostRecentlyRemoved is available\n\n            window.Add(1);\n            Assert.AreEqual(0, window.MostRecentlyRemoved);\n            Assert.AreEqual(1, window.Count);\n            Assert.IsTrue(window.IsReady);\n        }\n\n        [Test]\n        public void IndexingBasedOnReverseInsertedOrder()\n        {\n            var window = new RollingWindow<int>(3);\n            Assert.AreEqual(3, window.Size);\n\n            window.Add(0);\n            Assert.AreEqual(1, window.Count);\n            Assert.AreEqual(0, window[0]);\n\n            window.Add(1);\n            Assert.AreEqual(2, window.Count);\n            Assert.AreEqual(0, window[1]);\n            Assert.AreEqual(1, window[0]);\n\n            window.Add(2);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(0, window[2]);\n            Assert.AreEqual(1, window[1]);\n            Assert.AreEqual(2, window[0]);\n\n            window.Add(3);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(1, window[2]);\n            Assert.AreEqual(2, window[1]);\n            Assert.AreEqual(3, window[0]);\n        }\n\n        [Test]\n        public void EnumeratesAsExpected()\n        {\n            var window = new RollingWindow<int>(3) { 0, 1, 2 };\n            var inOrder = window.ToList();\n            Assert.AreEqual(2, inOrder[0]);\n            Assert.AreEqual(1, inOrder[1]);\n            Assert.AreEqual(0, inOrder[2]);\n\n            window.Add(3);\n            var inOrder2 = window.ToList();\n            Assert.AreEqual(3, inOrder2[0]);\n            Assert.AreEqual(2, inOrder2[1]);\n            Assert.AreEqual(1, inOrder2[2]);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var window = new RollingWindow<int>(3) { 0, 1, 2 };\n            window.Reset();\n            Assert.AreEqual(0, window.Samples);\n        }\n\n        [Test]\n        public void RetrievesNonZeroIndexProperlyAfterReset()\n        {\n            var window = new RollingWindow<int>(3);\n            window.Add(0);\n            Assert.AreEqual(1, window.Count);\n            Assert.AreEqual(0, window[0]);\n\n            window.Add(1);\n            Assert.AreEqual(2, window.Count);\n            Assert.AreEqual(0, window[1]);\n            Assert.AreEqual(1, window[0]);\n\n            window.Add(2);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(0, window[2]);\n            Assert.AreEqual(1, window[1]);\n            Assert.AreEqual(2, window[0]);\n\n            window.Add(3);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(1, window[2]);\n            Assert.AreEqual(2, window[1]);\n            Assert.AreEqual(3, window[0]);\n\n            window.Reset();\n            window.Add(0);\n            Assert.AreEqual(1, window.Count);\n            Assert.AreEqual(0, window[0]);\n\n            window.Add(1);\n            Assert.AreEqual(2, window.Count);\n            Assert.AreEqual(0, window[1]);\n            Assert.AreEqual(1, window[0]);\n\n            window.Add(2);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(0, window[2]);\n            Assert.AreEqual(1, window[1]);\n            Assert.AreEqual(2, window[0]);\n\n            window.Add(3);\n            Assert.AreEqual(3, window.Count);\n            Assert.AreEqual(1, window[2]);\n            Assert.AreEqual(2, window[1]);\n            Assert.AreEqual(3, window[0]);\n        }\n\n        [Test]\n        public void DoesNotThrowWhenIndexIsNegative()\n        {\n            var window = new RollingWindow<int>(1);\n            Assert.IsFalse(window.IsReady);\n\n            Assert.DoesNotThrow(() => { var x = window[-1]; });\n        }\n\n        [Test]\n        public void WindowCanBeIndexedOutsideCount()\n        {\n            const int windowSize = 10;\n            var window = new RollingWindow<int>(windowSize);\n\n            // Add some data to the window\n            const int count = windowSize / 2;\n            for (var i = 0; i < count; i++)\n            {\n                window.Add(i);\n            }\n            Assert.AreEqual(count, window.Count);\n\n            // Index the indicator outside the current count but within its size\n            for (var i = window.Count; i < window.Size; i++)\n            {\n                Assert.AreEqual(default(int), window[i]);\n                Assert.AreEqual(windowSize, window.Size);\n            }\n        }\n\n        [Test]\n        public void WindowCanBeIndexedOutsideCountUsingSetter()\n        {\n            const int windowSize = 20;\n            const int initialElementsCount = 5;\n            const int indexingStart = 10;\n            var window = new RollingWindow<int>(windowSize);\n\n            // Add some data to the window\n            for (var i = 0; i < initialElementsCount; i++)\n            {\n                window.Add(i);\n            }\n            Assert.AreEqual(initialElementsCount, window.Count);\n\n            // Index the indicator outside the current count but within its size\n            for (var i = indexingStart; i < window.Size; i++)\n            {\n                window[i] = i;\n                Assert.AreEqual(i, window[i]);\n                Assert.AreEqual(windowSize, window.Size);\n            }\n\n            // The middle indexes that were not touched should have the default value\n            for (var i = initialElementsCount; i < indexingStart; i++)\n            {\n                Assert.AreEqual(default(int), window[i]);\n            }\n        }\n\n        [Test]\n        public void WindowCanBeIndexedOutsideSizeAndGetsResized()\n        {\n            const int windowSize = 10;\n            var window = new RollingWindow<int>(windowSize);\n\n            // Index the indicator outside the current size\n            for (var i = windowSize; i < windowSize + 10; i++)\n            {\n                Assert.AreEqual(default(int), window[i]);\n                Assert.AreEqual(i + 1, window.Size);\n            }\n\n            // Explicitly resize the window\n            var oldSize = window.Size;\n            window.Size = window.Size + 10;\n            for (var i = oldSize; i < window.Size; i++)\n            {\n                Assert.AreEqual(default(int), window[i]);\n            }\n        }\n\n        [Test]\n        public void WindowCanBeIndexedOutsideSizeUsingSetterAndGetsResized()\n        {\n            const int windowSize = 10;\n            var window = new RollingWindow<int>(windowSize);\n\n            // Index the indicator outside the current size\n            for (var i = windowSize; i < windowSize + 10; i++)\n            {\n                window[i] = i;\n                Assert.AreEqual(i, window[i]);\n                Assert.AreEqual(i + 1, window.Size);\n            }\n        }\n\n        [Test]\n        public void NewElementsHaveDefaultValuesWhenResizingUp()\n        {\n            var window = new RollingWindow<int>(10);\n\n            // Explicitly resize the window\n            var oldSize = window.Size;\n            window.Size = window.Size * 2;\n            for (var i = oldSize; i < window.Size; i++)\n            {\n                Assert.AreEqual(default(int), window[i]);\n            }\n        }\n\n        [Test]\n        public void HistoryWindowResizingUpKeepsCurrentValues()\n        {\n            const int windowSize = 10;\n            var window = new RollingWindow<int>(windowSize);\n\n            // Fill the window up\n            var values = new List<int>(window.Size);\n            for (var i = 0; i < window.Size; i++)\n            {\n                window.Add(i);\n                values.Insert(0, i);\n            }\n\n            // Resize up\n            window.Size = window.Size * 2;\n            Assert.AreEqual(values.Count, window.Count);\n            CollectionAssert.AreEqual(values, window.Take(values.Count));\n        }\n\n        [Test]\n        public void HistoryWindowResizingDownKeepsCurrentValuesWithinNewSizeBelowCurrentCount()\n        {\n            const int windowSize = 20;\n            const int smallerSize = 10;\n\n            var window = new RollingWindow<int>(windowSize);\n\n            // Fill the window up\n            var values = new List<int>(window.Size);\n            for (var i = 0; i < window.Size; i++)\n            {\n                window.Add(i);\n                values.Insert(0, i);\n            }\n\n            window.Size = smallerSize;\n            Assert.AreEqual(smallerSize, window.Size);\n            Assert.AreEqual(smallerSize, window.Count);\n            CollectionAssert.AreEqual(values.Take(smallerSize), window);\n        }\n\n        [Test]\n        public void HistoryWindowResizingDownKeepsCurrentValuesWithinNewSizeAboveCurrentCount()\n        {\n            const int windowSize = 20;\n            const int dataCount = 5;\n            const int smallerSize = 10;\n\n            var window = new RollingWindow<int>(windowSize);\n\n            // Add some data to the window\n            var values = new List<int>(window.Size);\n            for (var i = 0; i < dataCount; i++)\n            {\n                window.Add(i);\n                values.Insert(0, i);\n            }\n\n            window.Size = smallerSize;\n            Assert.AreEqual(smallerSize, window.Size);\n            Assert.AreEqual(dataCount, window.Count);\n            CollectionAssert.AreEqual(values.Take(smallerSize), window);\n        }\n\n        [Test]\n        public void RollingWindowSupportsNegativeIndices()\n        {\n            var window = new RollingWindow<int>(5);\n\n            // At initialization, all values should be 0, whether accessed with positive or negative indices.\n            for (int i = 0; i < window.Size; i++)\n            {\n                Assert.AreEqual(0, window[0]);\n                Assert.AreEqual(0, window[~i]);\n            }\n\n            // Add two elements and test negative indexing before window is full\n            window.Add(7);\n            window.Add(-2);\n            Assert.AreEqual(7, window[-1]);\n            Assert.AreEqual(7, window.Last());\n            Assert.AreEqual(-2, window[0]);\n            Assert.AreEqual(-2, window.First());\n            Assert.AreEqual(2, window.Count);\n            Assert.IsFalse(window.IsReady);\n\n            // Fill the window to capacity\n            window.Add(5);\n            window.Add(1);\n            window.Add(4);\n            Assert.IsTrue(window.IsReady);\n\n            // Test that -1 is the same as Count - 1\n            Assert.AreEqual(window[window.Count - 1], window[-1]);\n\n            // Verify full reverse access using negative indices\n            for (int i = 0; i < window.Count; i++)\n            {\n                Assert.AreEqual(window[window.Count - 1 - i], window[~i]);\n            }\n\n            // Overwrite all values using negative indices\n            for (int i = 1; i <= window.Count; i++)\n            {\n                window[-i] = i;\n            }\n\n            // Verify final state of the window after overwrite\n            for (int i = 0; i < window.Count; i++)\n            {\n                Assert.AreEqual(window[window.Count - 1 - i], window[~i]);\n            }\n        }\n\n        [Test]\n        public void NegativeIndexThrowsWhenExceedingWindowSize()\n        {\n            var window = new RollingWindow<int>(3);\n\n            // Fill window completely\n            window.Add(10);\n            window.Add(20);\n            window.Add(30);\n\n            // Valid negative indices\n            Assert.AreEqual(10, window[-1]);\n            Assert.AreEqual(20, window[-2]);\n            Assert.AreEqual(30, window[-3]);\n\n            // Invalid negative indices (exceeding window size)\n            Assert.Throws<ArgumentOutOfRangeException>(() => { var x = window[-4]; });\n            Assert.Throws<ArgumentOutOfRangeException>(() => { var x = window[-5]; });\n        }\n\n        [Test]\n        public void SetterThrowsForInvalidNegativeIndices()\n        {\n            var window = new RollingWindow<int>(2);\n            window.Add(1);\n            window.Add(2);\n\n            // Valid sets\n            window[-1] = 20;\n            window[-2] = 10;\n\n            // Verify valid changes were made\n            Assert.AreEqual(10, window[0]);\n            Assert.AreEqual(20, window[1]);\n\n            // Invalid sets\n            Assert.Throws<ArgumentOutOfRangeException>(() => window[-3] = 30);\n            Assert.Throws<ArgumentOutOfRangeException>(() => window[-4] = 40);\n        }\n\n        [Test]\n        public void MixedPositiveAndNegativeIndexBehavior()\n        {\n            var window = new RollingWindow<int>(4);\n\n            // Fill window with test data\n            for (int i = 1; i <= 4; i++)\n            {\n                window.Add(i * 10);\n            }\n\n            // Test all valid positions\n            for (int i = 0; i < 4; i++)\n            {\n                var positiveIndexValue = window[i];\n                var negativeIndexValue = window[-(4 - i)];\n                Assert.AreEqual(positiveIndexValue, negativeIndexValue);\n            }\n\n            // Test invalid positions\n            var testCases = new[] { -5, -10, int.MinValue };\n            foreach (var index in testCases)\n            {\n                Assert.Throws<ArgumentOutOfRangeException>(() => { var x = window[index]; });\n            }\n        }\n\n        [TestCase(\"tuple\", 3)]\n        [TestCase(\"list\", 6)]\n        [TestCase(\"dict\", 2)]\n        [TestCase(\"float\", 3.9)]\n        [TestCase(\"trade_bar\", 100)]\n        [TestCase(\"quote_bar\", 100)]\n        [TestCase(\"custom_data_type\", 123)]\n        public void RollingWindowWorksWithAnyType(string type, decimal expectedValue)\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"TestRollingWindow\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass MyCustomDataType(PythonData):\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live: bool) -> SubscriptionDataSource:\n        fileName = LeanData.GenerateZipFileName(Symbols.SPY, date, Resolution.MINUTE, config.TickType)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live: bool) -> BaseData:\n        data = line.split(',')\n        result = MyCustomDataType()\n\ndef rolling_window_with_tuple():\n    rollingWindow = RollingWindow(5)\n    rollingWindow.add((1, \"\"a\"\"))\n    rollingWindow.add((2, \"\"b\"\"))\n    rollingWindow.add((3, \"\"c\"\"))\n    return rollingWindow[0][0]\n\ndef rolling_window_with_list():\n    rollingWindow = RollingWindow(5)\n    rollingWindow.add([1, 2, 3])\n    rollingWindow.add([5])\n    rollingWindow.add([6, 7, 8])\n    return rollingWindow[0][0]\n\ndef rolling_window_with_dict():\n    rollingWindow = RollingWindow(5)\n    rollingWindow.add({\"\"key1\"\": 1, \"\"key2\"\": \"\"a\"\"})\n    rollingWindow.add({\"\"key1\"\": 2, \"\"key2\"\": \"\"b\"\"})\n    return rollingWindow[0][\"\"key1\"\"]\n\ndef rolling_window_with_float():\n    rollingWindow = RollingWindow(5)\n    rollingWindow.add(1.5)\n    rollingWindow.add(2.7)\n    rollingWindow.add(3.9)\n    return rollingWindow[0]\n\ndef rolling_window_with_trade_bar():\n    rollingWindow = RollingWindow(5)\n    bar1 = TradeBar()\n    bar1.close = 100\n    rollingWindow.add(bar1)\n    return rollingWindow[0].close\n\ndef rolling_window_with_quote_bar():\n    rollingWindow = RollingWindow(5)\n    bar1 = QuoteBar()\n    bar1.value = 100\n    rollingWindow.add(bar1)\n    return rollingWindow[0].value\n\ndef rolling_window_with_custom_data_type():\n    rollingWindow = RollingWindow(5)\n    customData = PythonData(MyCustomDataType())\n    customData.test = 123\n    rollingWindow.add(customData)\n    return rollingWindow[0].test\n\");\n                var methodName = \"rolling_window_with_\" + type;\n\n                var test = testModule.GetAttr(methodName).Invoke();\n                var value = test.As<decimal>();\n                Assert.AreEqual(expectedValue, value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SchaffTrendCycleTests.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    class SchaffTrendCycleTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new SchaffTrendCycle();\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_stc.txt\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"STC\"; }\n        }\n\n        /// <summary>\n        /// Returns a custom assertion function, parameters are the indicator and the expected value from the file\n        /// This overwrites the virtual function to allow a +/- 1 variance since this indicator is highly sensitive with\n        /// a chain of EMAs and Stochastics calculation.\n        /// </summary>\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1); }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SessionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SessionTests\n    {\n        [TestCase(0)]\n        [TestCase(1)]\n        [TestCase(2)]\n        public void AddMethodPreservesPreviousValuesInSessionWindow(int initialSize)\n        {\n            var symbol = Symbols.SPY;\n            var session = GetSession(TickType.Trade, initialSize: initialSize);\n            session.Size = 2;\n\n            var date = new DateTime(2025, 8, 25);\n\n            var bar1 = new TradeBar(date.AddHours(12), symbol, 100, 101, 99, 100, 1000, TimeSpan.FromHours(1));\n            session.Update(bar1);\n            var bar2 = new TradeBar(date.AddHours(13), symbol, 101, 102, 100, 101, 1100, TimeSpan.FromHours(1));\n            session.Update(bar2);\n\n            // Verify current session values after multiple updates\n            Assert.AreEqual(100, session[0].Open);\n            Assert.AreEqual(102, session[0].High);\n            Assert.AreEqual(99, session[0].Low);\n            Assert.AreEqual(101, session[0].Close);\n            Assert.AreEqual(2100, session[0].Volume);\n\n            // Start of a new trading day\n            date = date.AddDays(1);\n            session.Scan(date);\n            bar1 = new TradeBar(date.AddHours(12), symbol, 200, 201, 199, 200, 2000, TimeSpan.FromHours(1));\n            session.Update(bar1);\n            bar2 = new TradeBar(date.AddHours(13), symbol, 300, 301, 299, 300, 3100, TimeSpan.FromHours(1));\n            session.Update(bar2);\n\n            // Verify current session reflects new day data\n            Assert.AreEqual(200, session[0].Open);\n            Assert.AreEqual(301, session[0].High);\n            Assert.AreEqual(199, session[0].Low);\n            Assert.AreEqual(300, session[0].Close);\n            Assert.AreEqual(5100, session[0].Volume);\n\n            // Verify previous session values are preserved\n            Assert.AreEqual(100, session[1].Open);\n            Assert.AreEqual(102, session[1].High);\n            Assert.AreEqual(99, session[1].Low);\n            Assert.AreEqual(101, session[1].Close);\n            Assert.AreEqual(2100, session[1].Volume);\n        }\n\n        [Test]\n        public void EndTimeDoesNotOverflowWhenAccessedBeforeFirstUpdate()\n        {\n            var symbol = Symbols.SPY;\n            var session = GetSession(TickType.Trade, 3);\n\n            // Verify EndTime does not overflow when accessed before the first Update()\n            Assert.DoesNotThrow(() =>\n            {\n                var currentEndTime = session.EndTime;\n            });\n\n            session.Update(new TradeBar(new DateTime(2025, 8, 25, 10, 0, 0), symbol, 100, 101, 99, 100, 1000, TimeSpan.FromHours(1)));\n            Assert.AreEqual(new DateTime(2025, 8, 26), session.EndTime);\n            Assert.AreEqual(100, session.Open);\n            Assert.AreEqual(101, session.High);\n            Assert.AreEqual(99, session.Low);\n            Assert.AreEqual(100, session.Close);\n            Assert.AreEqual(1000, session.Volume);\n        }\n\n        private static IEnumerable<TestCaseData> ConsolidationTestCases()\n        {\n            // Hour resolution during regular market hours\n            yield return new TestCaseData(new DateTime(2025, 8, 25, 10, 0, 0), Resolution.Hour);\n\n            // Daily resolution and bar emitted at midnight\n            yield return new TestCaseData(new DateTime(2025, 8, 25, 0, 0, 0), Resolution.Daily);\n        }\n\n        [TestCaseSource(nameof(ConsolidationTestCases))]\n        public void ConsolidatesDaily(DateTime baseDate, Resolution resolution)\n        {\n            var symbol = Symbols.SPY;\n            var session = GetSession(TickType.Trade, 4);\n            var days = new[]\n            {\n                new { Expected = new TradeBar(baseDate.Date,            symbol, 100, 101, 99, 100, 6000, Time.OneDay) },\n                new { Expected = new TradeBar(baseDate.Date.AddDays(1), symbol, 100, 101, 99, 100, 6000, Time.OneDay) },\n                new { Expected = new TradeBar(baseDate.Date.AddDays(2), symbol, 100, 101, 99, 100, 6000, Time.OneDay) },\n            };\n\n            Assert.AreEqual(1, session.Samples);\n\n            for (int i = 0; i < days.Length; i++)\n            {\n                var startDate = baseDate.AddDays(i);\n                var endDate = startDate.Date.AddDays(1);\n\n                if (resolution == Resolution.Hour)\n                {\n                    for (int j = 0; j < 6; j++)\n                    {\n                        session.Update(new TradeBar(startDate.AddHours(j), symbol, 100, 101, 99, 100, 1000, Time.OneHour));\n                    }\n                }\n                else\n                {\n                    session.Update(new TradeBar(startDate, symbol, 100, 101, 99, 100, 6000, Time.OneDay));\n                }\n\n                session.Scan(endDate);\n                Assert.AreEqual(i + 2, session.Samples);\n                Assert.IsTrue(BarsAreEqual(days[i].Expected, session[1]));\n            }\n        }\n\n        [TestCaseSource(nameof(NextSessionTradingDayCases))]\n        public void CreatesNewSessionBarWithCorrectNextTradingDay(DateTime startDate, DateTime expectedDate)\n        {\n            var symbol = Symbols.SPY;\n            var session = GetSession(TickType.Trade, 3);\n            var endDate = startDate.AddHours(14);\n\n            for (int i = 0; i < 6; i++)\n            {\n                session.Update(new TradeBar(startDate.AddHours(i), symbol, 100, 101, 99, 100, 1000, TimeSpan.FromHours(1)));\n            }\n\n            session.Scan(endDate);\n\n            var sessionBar = session[0];\n            Assert.AreNotEqual(DateTime.MaxValue, sessionBar.Time);\n            Assert.AreEqual(expectedDate, sessionBar.Time);\n            Assert.AreEqual(expectedDate.AddDays(1), sessionBar.EndTime);\n            Assert.AreEqual(0, sessionBar.Open);\n            Assert.AreEqual(0, sessionBar.High);\n            Assert.AreEqual(0, sessionBar.Low);\n            Assert.AreEqual(0, sessionBar.Close);\n            Assert.AreEqual(0, sessionBar.Volume);\n        }\n\n        private static IEnumerable<TestCaseData> NextSessionTradingDayCases()\n        {\n            // Regular weekday: next trading day is simply the next calendar day\n            yield return new TestCaseData(new DateTime(2025, 8, 25, 10, 0, 0), new DateTime(2025, 8, 26));\n\n            // Friday before Labor Day weekend -> next trading day is Tuesday (Sep 2, 2025)\n            yield return new TestCaseData(new DateTime(2025, 8, 29, 10, 0, 0), new DateTime(2025, 9, 2));\n        }\n\n        private static Session GetSession(TickType tickType, int initialSize)\n        {\n            var symbol = Symbols.SPY;\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var exchangeHours = marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);\n            return new Session(tickType, exchangeHours, symbol, initialSize);\n        }\n\n        private static bool BarsAreEqual(TradeBar bar1, TradeBar bar2)\n        {\n            return bar1.Time == bar2.Time &&\n                   bar1.EndTime == bar2.EndTime &&\n                   bar1.Open == bar2.Open &&\n                   bar1.High == bar2.High &&\n                   bar1.Low == bar2.Low &&\n                   bar1.Close == bar2.Close &&\n                   bar1.Volume == bar2.Volume;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SharpeRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n\t[TestFixture]\n\tpublic class SharpeRatioTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n    \tprotected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n    \t{\n            return new SharpeRatio(\"SR\", 10);\n    \t}\n\n        protected override string TestFileName => \"spy_sr.txt\";\n\n        protected override string TestColumnName => \"SR_10\";\n\n        [Test]\n        public void TestTradeBarsWithSameValue()\n        {\n    \t\t// With the value not changing, the indicator should return default value 0m.\n    \t\tvar sr = new SharpeRatio(\"SR\", 10);\n\n    \t\t// push the value 100000 into the indicator 20 times (sharpeRatioPeriod + movingAveragePeriod)\n    \t\tfor(int i = 0; i < 20; i++) {\n    \t\t\tIndicatorDataPoint point = new IndicatorDataPoint(new DateTime(), 100000m);\n    \t\t\tsr.Update(point);\n    \t\t}\n\n    \t\tAssert.AreEqual(sr.Current.Value, 0m);\n        }\n\n        [Test]\n        public void TestTradeBarsWithDifferingValue()\n        {\n        \t// With the value changing, the indicator should return a value that is not the default 0m.\n        \tvar sr = new SharpeRatio(\"SR\", 10);\n\n    \t\t// push the value 100000 into the indicator 20 times (sharpeRatioPeriod + movingAveragePeriod)\n    \t\tfor(int i = 0; i < 20; i++) {\n    \t\t\tIndicatorDataPoint point = new IndicatorDataPoint(new DateTime(), 100000m + i);\n    \t\t\tsr.Update(point);\n    \t\t}\n\n    \t\tAssert.AreNotEqual(sr.Current.Value, 0m);\n        }\n\n        [Test]\n        public void TestDivByZero()\n        {\n        \t// With the value changing, the indicator should return a value that is not the default 0m.\n        \tvar sr = new SharpeRatio(\"SR\", 10);\n\n    \t\t// push the value 100000 into the indicator 20 times (sharpeRatioPeriod + movingAveragePeriod)\n    \t\tfor(int i = 0; i < 20; i++)\n            {\n    \t\t\tIndicatorDataPoint point = new IndicatorDataPoint(new DateTime(), 0);\n    \t\t\tsr.Update(point);\n    \t\t}\n\n    \t\tAssert.AreEqual(sr.Current.Value, 0m);\n        }\n\n        [Test]\n        public void UsesRiskFreeInterestRateModel()\n        {\n            const int count = 20;\n            var dates = Enumerable.Range(0, count).Select(i => new DateTime(2023, 11, 21, 10, 0, 0) + TimeSpan.FromMinutes(i)).ToList();\n            var interestRateValues = Enumerable.Range(0, count).Select(i => 0m + (10 - 0m) * (i / (count - 1m))).ToList();\n\n            var interestRateProviderMock = new Mock<IRiskFreeInterestRateModel>();\n\n            // Set up\n            for (int i = 0; i < count; i++)\n            {\n                interestRateProviderMock.Setup(x => x.GetInterestRate(dates[i])).Returns(interestRateValues[i]).Verifiable();\n            }\n\n            var sr = new TestableSharpeRatio(\"SR\", 10, interestRateProviderMock.Object);\n\n            // Push the value 100000 into the indicator 20 times (sharpeRatioPeriod + movingAveragePeriod)\n            for (int i = 0; i < count; i++)\n            {\n                sr.Update(new IndicatorDataPoint(dates[i], 100000m + i));\n                Assert.AreEqual(interestRateValues[i], sr.RiskFreeRatePublic.Current.Value);\n            }\n\n            // Assert\n            Assert.IsTrue(sr.IsReady);\n            interestRateProviderMock.Verify(x => x.GetInterestRate(It.IsAny<DateTime>()), Times.Exactly(dates.Count));\n            for (int i = 0; i < count; i++)\n            {\n                interestRateProviderMock.Verify(x => x.GetInterestRate(dates[i]), Times.Once);\n            }\n        }\n\n        [Test]\n        public void UsesPythonDefinedRiskFreeInterestRateModel()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(Guid.NewGuid().ToString(), @\"\nfrom AlgorithmImports import *\n\nclass TestRiskFreeInterestRateModel:\n    CallCount = 0\n\n    def GetInterestRate(self, date: datetime) -> float:\n        TestRiskFreeInterestRateModel.CallCount += 1\n        return 0.5\n\ndef getSharpeRatioIndicator() -> SharpeRatio:\n    return SharpeRatio(\"\"SR\"\", 10, TestRiskFreeInterestRateModel())\n            \");\n\n            var sr = module.GetAttr(\"getSharpeRatioIndicator\").Invoke().GetAndDispose<SharpeRatio>();\n            var modelClass = module.GetAttr(\"TestRiskFreeInterestRateModel\");\n\n            var reference = new DateTime(2023, 11, 21, 10, 0, 0);\n            for (int i = 0; i < 20; i++)\n            {\n                sr.Update(new IndicatorDataPoint(reference + TimeSpan.FromMinutes(i), 100000m + i));\n                Assert.AreEqual(i + 1, modelClass.GetAttr(\"CallCount\").GetAndDispose<int>());\n            }\n        }\n\n        private class TestableSharpeRatio : SharpeRatio\n        {\n            public Identity RiskFreeRatePublic => RiskFreeRate;\n\n            public TestableSharpeRatio(string name, int period, IRiskFreeInterestRateModel riskFreeRateModel)\n                : base(name, period, riskFreeRateModel)\n            {\n            }\n            public TestableSharpeRatio(int period, decimal riskFreeRate = 0.0m)\n                : base(period, riskFreeRate)\n            {\n            }\n\n            public TestableSharpeRatio(string name, int period, decimal riskFreeRate = 0.0m)\n                : base(name, period, riskFreeRate)\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SimpleMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SimpleMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new SimpleMovingAverage(14);\n        }\n\n        protected override string TestFileName => \"spy_with_indicators.txt\";\n\n        protected override string TestColumnName => \"SMA14\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1e-2); }\n        }\n\n        [Test]\n        public void SmaComputesCorrectly()\n        {\n            var sma = new SimpleMovingAverage(4);\n            var data = new[] {1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m};\n\n            var seen = new List<decimal>();\n            for (int i = 0; i < data.Length; i++)\n            {\n                var datum = data[i];\n                seen.Add(datum);\n                sma.Update(new IndicatorDataPoint(DateTime.Now.AddSeconds(i), datum));\n                Assert.AreEqual(Enumerable.Reverse(seen).Take(sma.Period).Average(), sma.Current.Value);\n            }\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var sma = new SimpleMovingAverage(3);\n\n            sma.Update(DateTime.UtcNow, 1m);\n            sma.Update(DateTime.UtcNow, 1m);\n            Assert.IsFalse(sma.IsReady);\n            sma.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(sma.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var sma = new SimpleMovingAverage(3);\n\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                sma.Update(data);\n            }\n            Assert.IsTrue(sma.IsReady);\n            \n            sma.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(sma);\n            TestHelper.AssertIndicatorIsInDefaultState(sma.RollingSum);\n            sma.Update(DateTime.UtcNow, 2.0m);\n            Assert.AreEqual(sma.Current.Value, 2.0m);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/SmoothedOnBalanceVolumeTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SmoothedOnBalanceVolumeTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            // VolumeRenkoBarSize = 0.5m;  // uncomment this and AcceptsVolumeRenkoBarsAsInput hangle infinitely\n            return new SmoothedOnBalanceVolume(20);\n        }\n\n        protected override string TestFileName => \"spy_with_sobv.csv\";\n\n        protected override string TestColumnName => \"SOBV20\";\n\n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SortinoRatioTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Accord.Math;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Indicators \n{\n    [TestFixture]\n    public class SortinoRatioTests : CommonIndicatorTests<IndicatorDataPoint>\n    {   \n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new SortinoRatio(\"SORTINO\", 15);\n        }\n\n        protected override string TestFileName => \"spy_sortino.csv\";\n\n        protected override string TestColumnName => \"sortino_rf_0_period_15\";\n\n        [Test]\n        public void TestConstantValues() \n        {\n            // With the value not changing, the indicator should return default value 0m.\n            var sortino = new SortinoRatio(\"SORTINO\", 15);\n\n            // push the value 100000 into the indicator 20 times\n            var time = DateTime.MinValue;\n            for(int i = 0; i < 20; i++) {\n                IndicatorDataPoint point = new IndicatorDataPoint(time.AddDays(i), 100000m);\n                sortino.Update(point);\n            }\n            \n            Assert.AreEqual(sortino.Current.Value, 0m);\n        }\n        \n        [Test]\n        public void TestOnlyIncreasingValues() \n        {\n            // With the value increasing each step, the indicator should return 0m.\n            var sr = new SortinoRatio(\"SORTINO\", 15);\n\n            // push only increasing values into the indicator\n            var time = DateTime.MinValue;\n            for (int i = 20; i > 0; i--) {\n                IndicatorDataPoint point = new IndicatorDataPoint(time.AddDays(20-i), 100000m + i);\n                sr.Update(point);\n            }\n            \n            Assert.AreNotEqual(sr.Current.Value, 0m);\n        }\n\n        [Test]\n        public void TestValuesFromCMEGroup()\n        {\n            // Source: https://www.cmegroup.com/education/files/rr-sortino-a-sharper-ratio.pdf\n\n            List<decimal> values = new List<decimal>();\n            values.Add(1m);\n            var annualReturns = new[] { .17, .15, .23, -.05, .12, .09, .13, -.04 };\n            for (var i = 0; i < annualReturns.Count(x => true); i++)\n            {\n                values.Add(values[i] * (decimal)(1 + annualReturns[i]));\n            }\n\n            var periods = annualReturns.Count(x => true);\n            var sr = new SortinoRatio(\"SORTINO\", periods, minimumAcceptableReturn: 0);\n\n            var time = DateTime.MinValue;\n            for (int i = 0; i <= periods; i++)\n            {\n                IndicatorDataPoint point = new IndicatorDataPoint(time.AddDays(i), values[i]);\n                sr.Update(point);\n            }\n\n            Assert.AreEqual(4.417, sr.Current.Value.RoundToSignificantDigits(4));\n        }\n\n        [Test]\n        public void RunTestIndicatorWithNonZeroRiskFreeRate()\n        {\n            TestHelper.TestIndicator(new SortinoRatio(\"SORTINO\", 15, 0.01), TestFileName, \"sortino_rf_0.01_period_15\", Assertion);\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SqueezeMomentumTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SqueezeMomentumTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            VolumeRenkoBarSize = 0.5m;\n            return new SqueezeMomentum(\"SM\", 20, 2, 20, 1.5m);\n        }\n        protected override string TestFileName => \"spy_sm.csv\";\n\n        protected override string TestColumnName => \"squeeze on\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/StandardDeviationTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class StandardDeviationTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        [Test]\n        public void ComputesCorrectly()\n        {\n            // Indicator output was compared against the following function in Julia\n            // stdpop(v) = sqrt(sum((v - mean(v)).^2) / length(v))\n            var std = new StandardDeviation(3);\n            var reference = DateTime.MinValue;\n\n            std.Update(reference.AddDays(1), 1m);\n            Assert.AreEqual(0m, std.Current.Value);\n\n            std.Update(reference.AddDays(2), -1m);\n            Assert.AreEqual(1m, std.Current.Value);\n\n            std.Update(reference.AddDays(3), 1m);\n            Assert.AreEqual(0.942809041582063m, std.Current.Value);\n\n            std.Update(reference.AddDays(4), -2m);\n            Assert.AreEqual(1.24721912892465m, std.Current.Value);\n\n            std.Update(reference.AddDays(5), 3m);\n            Assert.AreEqual(2.05480466765633m, std.Current.Value);\n        }\n\n        [Test]\n        public void ResetsProperlyStandardDeviation()\n        {\n            var std = new StandardDeviation(3);\n            std.Update(DateTime.Today, 1m);\n            std.Update(DateTime.Today.AddSeconds(1), 5m);\n            std.Update(DateTime.Today.AddSeconds(2), 1m);\n            Assert.IsTrue(std.IsReady);\n\n            std.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(std);\n        }\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new StandardDeviation(10);\n        }\n\n        protected override string TestFileName => \"spy_var.txt\";\n\n        protected override string TestColumnName => \"Var\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(Math.Sqrt(expected), (double) indicator.Current.Value, 1e-6);\n    }\n}"
  },
  {
    "path": "Tests/Indicators/StochasticRelativeStrengthIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class StochasticRelativeStrengthIndexTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new StochasticRelativeStrengthIndex(14, 14, 3, 3);\n        }\n\n        protected override string TestFileName => \"spy_with_StochRSI.csv\";\n\n        protected override string TestColumnName => \"k\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double) ((StochasticRelativeStrengthIndex) indicator).K.Current.Value, 1e-3);\n\n        [Test]\n        public void ComparesWithExternalDataColumnD()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator() as StochasticRelativeStrengthIndex,\n                TestFileName,\n                \"d\",\n                ind => (double) ind.D.Current.Value\n            );\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/StochasticTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class StochasticTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new Stochastic(12, 3, 5);\n        }\n\n        protected override string TestFileName => \"spy_with_stoch12k3.txt\";\n\n        protected override string TestColumnName => \"%D 5\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double)((Stochastic)indicator).StochD.Current.Value, 1e-3);\n\n        [Test]\n        public void ComparesAgainstExternalDataOnStochasticsK()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Stochastics 12 %K 3\",\n                (ind, expected) => Assert.AreEqual(\n                    expected,\n                    (double) ((Stochastic) ind).StochK.Current.Value,\n                    1e-3\n                )\n            );\n        }\n\n        [Test]\n        public void PrimaryOutputIsFastStochProperty()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"Stochastics 12 %K 3\",\n                (ind, expected) => Assert.AreEqual(\n                    (double) ((Stochastic) ind).FastStoch.Current.Value,\n                    ind.Current.Value\n                )\n            );\n        }\n\n        [Test]\n        public new void ResetsProperly()\n        {\n            var stochastics = CreateIndicator() as Stochastic;\n\n            foreach (var bar in TestHelper.GetTradeBarStream(TestFileName, false))\n            {\n                stochastics.Update(bar);\n            }\n            Assert.IsTrue(stochastics.IsReady);\n            Assert.IsTrue(stochastics.FastStoch.IsReady);\n            Assert.IsTrue(stochastics.StochK.IsReady);\n            Assert.IsTrue(stochastics.StochD.IsReady);\n\n            stochastics.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(stochastics);\n            TestHelper.AssertIndicatorIsInDefaultState(stochastics.FastStoch);\n            TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochK);\n            TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochD);\n        }\n\n        [Test]\n        public void HandlesEqualMinAndMax()\n        {\n            var reference = DateTime.Now;\n            var stochastics = new Stochastic(\"sto\", 2, 2, 2);\n            for (var i = 0; i < 4; i++)\n            {\n                var bar = new TradeBar(reference.AddSeconds(i), Symbols.SPY, 1, 1, 1, 1, 1);\n                stochastics.Update(bar);\n                Assert.AreEqual(0m, stochastics.Current.Value);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/SumTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SumTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new Sum(2);\n        }\n\n        protected override string TestFileName => \"\";\n\n        protected override string TestColumnName => \"\";\n\n        protected override void RunTestIndicator(IndicatorBase<IndicatorDataPoint> indicator)\n        {\n            var time = DateTime.UtcNow;\n\n            foreach (var i in new[] {1, 2, 3})\n            {\n                indicator.Update(time.AddDays(i), i);\n            }\n\n            Assert.AreEqual(indicator.Current.Value, 2m + 3m);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var sum = (Sum) CreateIndicator();\n            RunTestIndicator(sum);\n\n            Assert.IsTrue(sum.IsReady);\n\n            sum.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(sum);\n            Assert.AreEqual(sum.Current.Value, 0m);\n            sum.Update(DateTime.UtcNow, 1);\n            Assert.AreEqual(sum.Current.Value, 1m);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/SuperTrendTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SuperTrendTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new SuperTrend(10,3);\n        }\n\n        protected override string TestFileName => \"dwac_supertrend.txt\";\n\n        protected override string TestColumnName => \"Super\";\n\n        protected override Action<IndicatorBase<IBaseDataBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 0.05); }\n        }\n\n        [Test]\n        public void Getters()\n        {\n            var STR = new SuperTrend(10, 3);\n            foreach (var data in TestHelper.GetDataStream(100))\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Volume = data.Value\n                };\n                STR.Update(tradeBar);\n            }\n            Assert.IsTrue(STR.IsReady);\n            Assert.AreNotEqual(0, STR.BasicUpperBand);\n            Assert.AreNotEqual(0, STR.BasicLowerBand);\n            Assert.AreNotEqual(0, STR.CurrentTrailingUpperBand);\n            Assert.AreNotEqual(0, STR.CurrentTrailingLowerBand);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var STR = new SuperTrend(10, 3);\n            foreach (var data in TestHelper.GetDataStream(100))\n            {\n                var tradeBar = new TradeBar\n                {\n                    Open = data.Value,\n                    Close = data.Value,\n                    High = data.Value,\n                    Low = data.Value,\n                    Volume = data.Value\n                };\n                STR.Update(tradeBar);\n            }\n            Assert.IsTrue(STR.IsReady);\n\n            STR.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(STR);\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/SwissArmyKnifeTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class SwissArmyKnifeTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new SwissArmyKnife(20, 0.1, SwissArmyKnifeTool.Gauss);\n        }\n\n        protected override string TestFileName => \"spy_swiss.txt\";\n\n        protected override string TestColumnName => \"Gauss\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) => \n                Assert.AreEqual(expected, (double) indicator.Current.Value, 0.01);\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var sak = new SwissArmyKnife(4, 0.1, SwissArmyKnifeTool.BandPass);\n\n            foreach (var data in TestHelper.GetDataStream(5))\n            {\n                sak.Update(data);\n            }\n            Assert.IsTrue(sak.IsReady);\n            Assert.AreNotEqual(0m, sak.Current.Value);\n            Assert.AreNotEqual(0, sak.Samples);\n\n            sak.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(sak);\n        }\n\n        [Test]\n        public void ComparesBandPassAgainstExternalData()\n        {\n            var indicator = new SwissArmyKnife(20, 0.1, SwissArmyKnifeTool.BandPass);\n            RunTestIndicator(indicator, \"BP\", 0.043m);\n        }\n\n        [Test]\n        public void Compares2PHPAgainstExternalData()\n        {\n            var indicator = new SwissArmyKnife(20, 0.1, SwissArmyKnifeTool.TwoPoleHighPass);\n            RunTestIndicator(indicator, \"2PHP\", 0.01m);\n        }\n\n        [Test]\n        public void ComparesHPAgainstExternalData()\n        {\n            var indicator = new SwissArmyKnife(20, 0.1, SwissArmyKnifeTool.HighPass);\n            RunTestIndicator(indicator, \"HP\", 0.01m);\n        }\n\n        [Test]\n        public void ComparesButterAgainstExternalData()\n        {\n            var indicator = new SwissArmyKnife(20, 0.1, SwissArmyKnifeTool.Butter);\n            RunTestIndicator(indicator, \"Butter\", 0.01m);\n        }\n\n        private void RunTestIndicator(IndicatorBase<IndicatorDataPoint> indicator, string field, decimal variance)\n        {\n            TestHelper.TestIndicator(indicator, TestFileName, field, (actual, expected) => { AssertResult(expected, actual.Current.Value, variance); });\n        }\n\n        private static void AssertResult(double expected, decimal actual, decimal variance)\n        {\n            System.Diagnostics.Debug.WriteLine(expected + \",\" + actual + \",\" + Math.Abs((decimal)expected - actual));\n            Assert.IsTrue(Math.Abs((decimal)expected - actual) < variance);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/T3MovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class T3MovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new T3MovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_t3.txt\";\n\n        protected override string TestColumnName => \"T3_5\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected)\n                => Assert.AreEqual(expected, (double) indicator.Current.Value, 2e-2);\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TargetDownsideDeviationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TargetDownsideDeviationTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n\n        [Test]\n        public void AlwaysZeroWitNonNegativeNumbers()\n        {\n            var tdd = new TargetDownsideDeviation(3);\n            var reference = DateTime.MinValue;\n            for (var i = 0; i < 100; i++)\n            {\n                tdd.Update(reference.AddDays(i), i);\n                Assert.AreEqual(0m, tdd.Current.Value);\n            }\n        }\n\n        [Test]\n        public void ResetsProperlyTargetDownsideDeviation()\n        {\n            var tdd = new TargetDownsideDeviation(3);\n            tdd.Update(DateTime.Today, 1m);\n            tdd.Update(DateTime.Today.AddSeconds(1), 5m);\n            tdd.Update(DateTime.Today.AddSeconds(2), 1m);\n            tdd.Update(DateTime.Today.AddSeconds(2), 4m);\n            Assert.IsTrue(tdd.IsReady);\n\n            tdd.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(tdd);\n        }\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            // Even if the indicator is ready, there may be zero values\n            ValueCanBeZero = true;\n            return new TargetDownsideDeviation(3);\n        }\n\n        protected override string TestFileName => \"spy_tdd.csv\";\n\n        protected override string TestColumnName => \"tdd\";\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion =>\n            (indicator, expected) =>\n                Assert.AreEqual(expected, (double)indicator.Current.Value, 1e-6);\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/TestHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    /// <summary>\n    /// Provides helper methods for testing indicatora\n    /// </summary>\n    public static class TestHelper\n    {\n        /// <summary>\n        /// Gets a stream of IndicatorDataPoints that can be fed to an indicator. The data stream starts at {DateTime.Today, 1m} and\n        /// increasing at {1 second, 1m}\n        /// </summary>\n        /// <param name=\"count\">The number of data points to stream</param>\n        /// <param name=\"valueProducer\">Function to produce the value of the data, null to use the index</param>\n        /// <returns>A stream of IndicatorDataPoints</returns>\n        public static IEnumerable<IndicatorDataPoint> GetDataStream(int count, Func<int, decimal> valueProducer = null)\n        {\n            var reference = DateTime.Today;\n            valueProducer = valueProducer ?? (x => x);\n            for (int i = 0; i < count; i++)\n            {\n                yield return new IndicatorDataPoint(reference.AddSeconds(i), valueProducer.Invoke(i));\n            }\n        }\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the spy_with_indicators.txt file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"epsilon\">The maximum delta between expected and actual</param>\n        public static void TestIndicator(IndicatorBase<IndicatorDataPoint> indicator, string targetColumn, double epsilon = 1e-3)\n        {\n            TestIndicator(indicator, \"spy_with_indicators.txt\", targetColumn, (i, expected) => Assert.AreEqual(expected, (double) i.Current.Value, epsilon));\n        }\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specificied comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\"></param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"customAssertion\">Sets custom assertion logic, parameter is the indicator, expected value from the file</param>\n        public static void TestIndicator(IndicatorBase<IndicatorDataPoint> indicator, string externalDataFilename, string targetColumn, Action<IndicatorBase<IndicatorDataPoint>, double> customAssertion)\n        {\n            foreach (var parts in GetCsvFileStream(externalDataFilename))\n            {\n                if (!(parts.ContainsKey(\"Close\") && parts.ContainsKey(targetColumn)))\n                {\n                    Assert.Fail($\"Didn't find one of 'Close' or '{targetColumn}' in the header.\");\n                    break;\n                }\n\n                var close = parts.GetCsvValue(\"close\").ToDecimal();\n                var date = Time.ParseDate(parts.GetCsvValue(\"date\", \"time\"));\n\n                indicator.Update(date, close);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts.GetCsvValue(targetColumn).Trim()))\n                {\n                    continue;\n                }\n\n                var expected = Parse.Double(parts.GetCsvValue(targetColumn));\n                customAssertion.Invoke(indicator, expected);\n            }\n        }\n\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specificied comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\"></param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"epsilon\">The maximum delta between expected and actual</param>\n        public static void TestIndicator(IndicatorBase<IBaseDataBar> indicator, string externalDataFilename, string targetColumn, double epsilon = 1e-3)\n        {\n            TestIndicator(indicator, externalDataFilename, targetColumn,\n                (i, expected) => Assert.AreEqual(expected, (double)i.Current.Value, epsilon,\n                    \"Failed at \" + i.Current.Time.ToStringInvariant(\"o\")\n                ));\n        }\n\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specificied comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\"></param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"epsilon\">The maximum delta between expected and actual</param>\n        public static void TestIndicator(IndicatorBase<TradeBar> indicator, string externalDataFilename, string targetColumn, double epsilon = 1e-3)\n        {\n            TestIndicator(indicator, externalDataFilename, targetColumn,\n                (i, expected) => Assert.AreEqual(expected, (double)i.Current.Value, epsilon,\n                    \"Failed at \" + i.Current.Time.ToStringInvariant(\"o\")\n                ));\n        }\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specificied comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\"></param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"selector\">A function that receives the indicator as input and outputs a value to match the target column</param>\n        /// <param name=\"epsilon\">The maximum delta between expected and actual</param>\n        public static void TestIndicator<T>(T indicator, string externalDataFilename, string targetColumn, Func<T, double> selector, double epsilon = 1e-3)\n            where T : Indicator\n        {\n            TestIndicator(indicator, externalDataFilename, targetColumn,\n                (i, expected) => Assert.AreEqual(expected, selector(indicator), epsilon,\n                    \"Failed at \" + i.Current.Time.ToStringInvariant(\"o\")\n                ));\n        }\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specified comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"customAssertion\">Sets custom assertion logic, parameter is the indicator, expected value from the file</param>\n        public static void TestIndicator(IndicatorBase<IBaseDataBar> indicator, string externalDataFilename, string targetColumn, Action<IndicatorBase<IBaseDataBar>, double> customAssertion)\n        {\n            // TODO : Collapse duplicate implementations -- type constraint shenanigans and after 4am\n\n            foreach (var parts in GetCsvFileStream(externalDataFilename))\n            {\n                var tradebar = parts.GetTradeBar();\n\n                indicator.Update(tradebar);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts.GetCsvValue(targetColumn).Trim()))\n                {\n                    continue;\n                }\n\n                var expected = Parse.Double(parts.GetCsvValue(targetColumn));\n                customAssertion.Invoke(indicator, expected);\n            }\n        }\n\n        /// <summary>\n        /// Compare the specified indicator against external data using the specified comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        /// <param name=\"targetColumn\">The column with the correct answers</param>\n        /// <param name=\"customAssertion\">Sets custom assertion logic, parameter is the indicator, expected value from the file</param>\n        public static void TestIndicator(IndicatorBase<TradeBar> indicator, string externalDataFilename, string targetColumn, Action<IndicatorBase<TradeBar>, double> customAssertion)\n        {\n            foreach (var parts in GetCsvFileStream(externalDataFilename))\n            {\n                var tradebar = parts.GetTradeBar();\n\n                indicator.Update(tradebar);\n\n                if (!indicator.IsReady || string.IsNullOrEmpty(parts.GetCsvValue(targetColumn).Trim()))\n                {\n                    continue;\n                }\n\n                double expected = Parse.Double(parts.GetCsvValue(targetColumn));\n                customAssertion.Invoke(indicator, expected);\n            }\n        }\n\n        /// <summary>\n        /// Updates the given consolidator with the entries from the given external CSV file\n        /// </summary>\n        /// <param name=\"renkoConsolidator\">RenkoConsolidator instance to update</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        public static void UpdateRenkoConsolidator(IDataConsolidator renkoConsolidator, string externalDataFilename)\n        {\n            foreach (var parts in GetCsvFileStream(externalDataFilename))\n            {\n                var tradebar = parts.GetTradeBar();\n                if (tradebar.Volume == 0)\n                {\n                    tradebar.Volume = 1;\n                }\n                renkoConsolidator.Update(tradebar);\n            }\n        }\n\n        /// <summary>\n        /// Tests a reset of the specified indicator after processing external data using the specified comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        public static void TestIndicatorReset(IndicatorBase<IBaseDataBar> indicator, string externalDataFilename)\n        {\n            foreach (var data in GetTradeBarStream(externalDataFilename, false))\n            {\n                indicator.Update(data);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        /// <summary>\n        /// Tests a reset of the specified indicator after processing external data using the specified comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        public static void TestIndicatorReset(IndicatorBase<TradeBar> indicator, string externalDataFilename)\n        {\n            foreach (var data in GetTradeBarStream(externalDataFilename, false))\n            {\n                indicator.Update(data);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        /// <summary>\n        /// Tests a reset of the specified indicator after processing external data using the specified comma delimited text file.\n        /// The 'Close' column will be fed to the indicator as input\n        /// </summary>\n        /// <param name=\"indicator\">The indicator under test</param>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        public static void TestIndicatorReset(IndicatorBase<IndicatorDataPoint> indicator, string externalDataFilename)\n        {\n            var date = DateTime.Today;\n\n            foreach (var parts in GetCsvFileStream(externalDataFilename))\n            {\n                if (!(parts.ContainsKey(\"Close\")))\n                {\n                    Assert.Fail(\"Didn't find column 'Close'\");\n                    break;\n                }\n                indicator.Update(date, parts.GetCsvValue(\"close\").ToDecimal());\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            indicator.Reset();\n\n            AssertIndicatorIsInDefaultState(indicator);\n        }\n\n        /// <summary>\n        /// Gets a stream of lines from the specified file\n        /// </summary>\n        /// <param name=\"externalDataFilename\">The external CSV file name</param>\n        public static IEnumerable<IReadOnlyDictionary<string, string>> GetCsvFileStream(string externalDataFilename)\n        {\n            var enumerator = File.ReadLines(Path.Combine(\"TestData\", FileExtension.ToNormalizedPath(externalDataFilename))).GetEnumerator();\n            if (!enumerator.MoveNext())\n            {\n                yield break;\n            }\n\n            string[] header = enumerator.Current.Split(',');\n            while (enumerator.MoveNext())\n            {\n                var values = enumerator.Current.Split(',');\n                var headerAndValues = header.Zip(values, (h, v) => new {h, v});\n                var dictionary = headerAndValues.ToDictionary(x => x.h.Trim(), x => x.v.Trim(), StringComparer.OrdinalIgnoreCase);\n                yield return new ReadOnlyDictionary<string, string>(dictionary);\n            }\n        }\n\n        /// <summary>\n        /// Gets a stream of trade bars from the specified file\n        /// </summary>\n        public static IEnumerable<TradeBar> GetTradeBarStream(string externalDataFilename, bool fileHasVolume = true)\n        {\n            return GetCsvFileStream(externalDataFilename).Select(values => GetTradeBar(values, fileHasVolume));\n        }\n\n        /// <summary>\n        /// Asserts that the indicator has zero samples, is not ready, and has the default value\n        /// </summary>\n        /// <param name=\"indicator\">The indicator to assert</param>\n        public static void AssertIndicatorIsInDefaultState<T>(IndicatorBase<T> indicator)\n            where T : IBaseData\n        {\n            Assert.AreEqual(0m, indicator.Current.Value);\n            Assert.AreEqual(DateTime.MinValue, indicator.Current.Time);\n            Assert.AreEqual(0, indicator.Samples);\n            Assert.IsFalse(indicator.IsReady);\n\n            var fields = indicator.GetType().GetProperties()\n                .Where(x => x.PropertyType.IsSubclassOfGeneric(typeof(IndicatorBase<T>)) ||\n                            x.PropertyType.IsSubclassOfGeneric(typeof(IndicatorBase<TradeBar>)) ||\n                            x.PropertyType.IsSubclassOfGeneric(typeof(IndicatorBase<IndicatorDataPoint>)));\n            foreach (var field in fields)\n            {\n                var subIndicator = field.GetValue(indicator);\n\n                if (subIndicator == null ||\n                    subIndicator is ConstantIndicator<T> ||\n                    subIndicator is ConstantIndicator<TradeBar> ||\n                    subIndicator is ConstantIndicator<IndicatorDataPoint>)\n                    continue;\n\n                if (field.PropertyType.IsSubclassOfGeneric(typeof (IndicatorBase<T>)))\n                {\n                    AssertIndicatorIsInDefaultState(subIndicator as IndicatorBase<T>);\n                }\n                else if (field.PropertyType.IsSubclassOfGeneric(typeof(IndicatorBase<TradeBar>)))\n                {\n                    AssertIndicatorIsInDefaultState(subIndicator as IndicatorBase<TradeBar>);\n                }\n                else if (field.PropertyType.IsSubclassOfGeneric(typeof(IndicatorBase<IndicatorDataPoint>)))\n                {\n                    AssertIndicatorIsInDefaultState(subIndicator as IndicatorBase<IndicatorDataPoint>);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Grabs the first value from the set of keys\n        /// </summary>\n        private static string GetCsvValue(this IReadOnlyDictionary<string, string> dictionary, params string[] keys)\n        {\n            string value = null;\n            if (keys.Any(key => dictionary.TryGetValue(key, out value)))\n            {\n                return value;\n            }\n\n            throw new ArgumentException(\"Unable to find column: \" + string.Join(\", \", keys));\n        }\n\n        /// <summary>\n        /// Grabs the TradeBar values from the set of keys\n        /// </summary>\n        public static TradeBar GetTradeBar(this IReadOnlyDictionary<string, string> dictionary, bool forceVolumeColumn = false)\n        {\n            var sid = (dictionary.ContainsKey(\"symbol\") || dictionary.ContainsKey(\"ticker\"))\n                ? SecurityIdentifier.GenerateEquity(dictionary.GetCsvValue(\"symbol\", \"ticker\"), Market.USA)\n                : SecurityIdentifier.Empty;\n\n            return new TradeBar\n            {\n                Symbol = sid != SecurityIdentifier.Empty\n                    ? new Symbol(sid, dictionary.GetCsvValue(\"symbol\", \"ticker\"))\n                    : Symbol.Empty,\n                Time = Time.ParseDate(dictionary.GetCsvValue(\"date\", \"time\")),\n                Open = dictionary.GetCsvValue(\"open\").ToDecimal(),\n                High = dictionary.GetCsvValue(\"high\").ToDecimal(),\n                Low = dictionary.GetCsvValue(\"low\").ToDecimal(),\n                Close = dictionary.GetCsvValue(\"close\").ToDecimal(),\n                Volume = forceVolumeColumn || dictionary.ContainsKey(\"volume\") ? Parse.Long(dictionary.GetCsvValue(\"volume\"), NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint) : 0\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ThetaTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class ThetaTests : OptionBaseIndicatorTests<Theta>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n            => new Theta(\"testThetaIndicator\", _symbol, 0.0403m, 0.0m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new Theta(\"testThetaIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new Theta(\"testThetaIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.T(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            // 2 updates per iteration, 1 for greek, 1 for IV\n            RiskFreeRateUpdatesPerIteration = 2;\n            DividendYieldUpdatesPerIteration = 2;\n        }\n\n        // close to expiry prone to vary\n        [TestCase(\"american/third_party_1_greeks.csv\", true, false, 0.6, 1.5e-3)]\n        [TestCase(\"american/third_party_1_greeks.csv\", false, false, 0.6, 1.5e-3)]\n        // Just placing the test and data here, we are unsure about the smoothing function and not going to reverse engineer\n        [TestCase(\"american/third_party_2_greeks.csv\", false, true, 10000, 0.03)]\n        public void ComparesAgainstExternalData(string subPath, bool reset, bool singleContract, double errorRate, double errorMargin = 1e-4,\n            int callColumn = 15, int putColumn = 14)\n        {\n            var path = Path.Combine(\"TestData\", \"greeksindicator\", subPath);\n            // skip last entry since for deep ITM, IV will not affect much on price. Thus root finding will not be optimizing a non-convex function.\n            foreach (var line in File.ReadAllLines(path).Skip(3).SkipLast(1))\n            {\n                var items = line.Split(',');\n\n                var interestRate = Parse.Decimal(items[^2]);\n                var dividendYield = Parse.Decimal(items[^1]);\n\n                var model = ParseSymbols(items, path.Contains(\"american\"), out var call, out var put);\n\n                Theta callIndicator;\n                Theta putIndicator;\n                if (singleContract)\n                {\n                    callIndicator = new Theta(call, interestRate, dividendYield, optionModel: model);\n                    putIndicator = new Theta(put, interestRate, dividendYield, optionModel: model);\n                }\n                else\n                {\n                    callIndicator = new Theta(call, interestRate, dividendYield, put, model);\n                    putIndicator = new Theta(put, interestRate, dividendYield, call, model);\n                }\n\n                RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n\n                if (reset == true)\n                {\n                    callIndicator.Reset();\n                    putIndicator.Reset();\n\n                    RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n                }\n            }\n        }\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, -0.2092, OptionStyle.European)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.2835, OptionStyle.European)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, -0.1858, OptionStyle.European)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.0918, OptionStyle.European)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, -0.0712, OptionStyle.European)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.2852, OptionStyle.European)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, -0.0601, OptionStyle.European)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -0.0483, OptionStyle.European)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, -0.0733, OptionStyle.European)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.0027, OptionStyle.European)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, -0.0274, OptionStyle.European)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -0.0297, OptionStyle.European)]\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, -0.2095, OptionStyle.American)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, -0.2838, OptionStyle.American)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, -0.1886, OptionStyle.American)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, -0.0936, OptionStyle.American)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, -0.0682, OptionStyle.American)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, -0.2859, OptionStyle.American)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, -0.0603, OptionStyle.American)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, -0.0483, OptionStyle.American)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, -0.0730, OptionStyle.American)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, -0.0035, OptionStyle.American)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, -0.0265, OptionStyle.American)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, -0.0300, OptionStyle.American)]\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refTheta, OptionStyle style)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, _reference.AddDays(expiry));\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Theta(symbol, 0.0403m, 0.0m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refTheta, (double)indicator.Current.Value, 0.0042d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 15)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 0)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 5)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, expiration);\n            var indicator = new Theta(symbol, 0.0403m, 0.0m,\n                optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/TimeProfileTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TimeProfileTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override string TestFileName => \"tp_datatest.csv\";\n\n        protected override string TestColumnName => \"POCPrice\";\n\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            return new TimeProfile(3);\n        }\n        protected override Action<IndicatorBase<TradeBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 0.01); }\n        }\n\n        [Test]\n        public void ComparesWithExternalDataPOCVolume()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"POCVolume\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).POCVolume)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataProfileHigh()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"PH\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).ProfileHigh)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataProfileLow()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"PL\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).ProfileLow)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataValueArea()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VA\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).ValueAreaVolume,0.01)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataVAH()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VAH\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).ValueAreaHigh)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataVAL()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VAL\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((TimeProfile)ind).ValueAreaLow)\n                );\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var tp = (TimeProfile)CreateIndicator();\n            var reference = new System.DateTime(2020, 8, 1);\n            Assert.IsFalse(tp.IsReady);\n            for (int i = 0; i < 3; i++)\n            {\n                tp.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddDays(1 + i) });\n            }\n            Assert.IsTrue(tp.IsReady);\n            tp.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(tp);\n            tp.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddDays(1) });\n            Assert.AreEqual(tp.Current.Value, 1m);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var tp = new TimeProfile(20);\n            var reference = new DateTime(2000, 1, 1);\n            var period = ((IIndicatorWarmUpPeriodProvider)tp).WarmUpPeriod;\n\n            // Check TimeProfile indicator assigns properly a WarmUpPeriod\n            Assert.AreEqual(20, period);\n            for (var i = 0; i < period; i++)\n            {\n                tp.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddDays(1 + i) });\n                Assert.AreEqual(i == period - 1, tp.IsReady);\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "Tests/Indicators/TimeSeriesForecastTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TimeSeriesForecastTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            var tsf = new TimeSeriesForecast(5);\n            \n            return tsf;\n        }\n\n        protected override string TestFileName => \"spy_tsf.csv\";\n        protected override string TestColumnName => \"tsf\";\n        \n        [Test]\n        public void ComputesCorrectly()\n        {\n            var tsf = CreateIndicator();\n            const int period = 5;\n            \n            // Data source: https://tulipindicators.org/tsf\n            var data = new[] {81.59m, 81.06m, 82.87m, 83.00m, 83.61m, 83.15m, 82.84m, 83.99m, 84.55m, 84.36m, 85.53m, 86.54m, 86.89m, 87.77m, 87.29m};\n            var output = new [] {0m, 0m, 0m, 0m, 84.22m, 84.21m, 83.12m, 83.68m, 84.44m, 85.02m, 85.98m, 86.82m, 87.63m, 88.67m, 88.23m};\n\n            var reference = DateTime.MinValue;\n\n            for (var i = 0; i < output.Length; i++)\n            {\n                tsf.Update(reference.AddDays(i + 1), data[i]);\n                if (i >= period)\n                {\n                    Assert.AreEqual(output[i], decimal.Round(tsf.Current.Value, 2));\n                }\n            }\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            const int period = 3;\n            var tsf = new TimeSeriesForecast(period);\n            var reference = DateTime.MinValue;\n\n            tsf.Update(reference, 1m);\n            tsf.Update(reference.AddDays(1), 1m);\n            tsf.Update(reference.AddDays(2), 1m);\n            Assert.IsTrue(tsf.IsReady);\n            \n            tsf.Reset();\n            Assert.IsFalse(tsf.IsReady);\n            TestHelper.AssertIndicatorIsInDefaultState(tsf);\n        }\n\n        [Test]\n        public void CorrectPeriodSize()\n        {\n            Assert.Throws<ArgumentException>(() => new TimeSeriesForecast(1));\n            Assert.DoesNotThrow(() => new TimeSeriesForecast(2));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/TimeSeriesIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Linq;\nusing Accord.Math;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TimeSeriesIndicatorTests\n    {\n        [Test]\n        public void DifferencesSeries()\n        {\n            var test = EvenOddSeries();\n\n            double[] heads;\n            var differencer = TimeSeriesIndicator.DifferenceSeries(1, test, out heads);\n            Assert.AreEqual(-1, differencer.Sum());\n        }\n\n        [Test]\n        public void UndifferencesSeries()\n        {\n            var test = EvenOddSeries();\n\n            double[] heads;\n            var differencer = TimeSeriesIndicator.DifferenceSeries(1, test, out heads);\n            Assert.AreEqual(test.Sum(), TimeSeriesIndicator.InverseDifferencedSeries(differencer, heads).Sum());\n        }\n\n        [Test]\n        public void LagsSeriesTest()\n        {\n            var test = EvenOddSeries(0, 1);\n            var lags = TimeSeriesIndicator.LaggedSeries(1, test);\n            \n            Assert.AreEqual(50, test.Sum());\n            Assert.AreEqual(49d, lags.Sum());\n        }\n\n        [Test]\n        public void CumulativeSumTest()\n        {\n            var test = EvenOddSeries(0, 1, 50);\n            var sums = TimeSeriesIndicator.CumulativeSum(test.ToList());\n            \n            Assert.AreEqual(25, test.Sum());\n            Assert.AreEqual(625, sums.Sum()); // From excel\n        }\n\n        private static double[] EvenOddSeries(int even = 1, int odd = 2, int len = 100)\n        {\n            var test = new double[len];\n            for (var i = 0; i < test.Length; i++)\n            {\n                switch (i % 2)\n                {\n                    case 0:\n                        test[i] = even;\n                        break;\n                    default:\n                        test[i] = odd;\n                        break;\n                }\n            }\n\n            return test;\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TomDemarkSequentialTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Accord;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TomDemarkSequentialTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override string TestFileName => \"td_sequential_test_data.csv\";\n        protected override string TestColumnName => \"TDS\";\n        \n        protected override TomDemarkSequential CreateIndicator()\n        {\n            return new TomDemarkSequential(\"ABC\");\n        }\n        \n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var ci = CreateIndicator();\n\n            Assert.IsFalse(ci.IsReady);\n            Enumerable.Range(1, 6).DoForEach(t => ci.Update(new TradeBar()));\n            Assert.IsTrue(ci.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var ci = CreateIndicator();\n            Enumerable.Range(1, 6).DoForEach(t => ci.Update(new TradeBar()));\n            Assert.IsTrue(ci.IsReady);\n            ci.Reset();\n            TestHelper.AssertIndicatorIsInDefaultState(ci);\n        }\n\n        [Test]\n        public override void AcceptsRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var renkoConsolidator = new RenkoConsolidator(RenkoBarSize);\n            var renkoBarCount = 0;\n            renkoConsolidator.DataConsolidated += (sender, renkoBar) =>\n            {\n                renkoBarCount++;\n                Assert.DoesNotThrow(() => indicator.Update(renkoBar));\n            };\n\n            foreach (var parts in TestHelper.GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                renkoConsolidator.Update(tradebar);\n            }\n          \n            Assert.IsTrue(renkoBarCount >= 1, \"At least one Renko bars were emitted.\");\n            renkoConsolidator.Dispose();\n        }\n\n        [Test]\n        public override void AcceptsVolumeRenkoBarsAsInput()\n        {\n            var indicator = CreateIndicator();\n            var volumeRenkoConsolidator = new VolumeRenkoConsolidator(VolumeRenkoBarSize);\n            var renkoBarCount = 0;\n            \n            volumeRenkoConsolidator.DataConsolidated += (sender, volumeRenkoBar) =>\n            {\n                renkoBarCount++;\n                Assert.DoesNotThrow(() => indicator.Update(volumeRenkoBar));\n            };\n\n            foreach (var parts in TestHelper.GetCsvFileStream(TestFileName))\n            {\n                var tradebar = parts.GetTradeBar();\n                volumeRenkoConsolidator.Update(tradebar);\n            }\n            \n            Assert.IsTrue(renkoBarCount >= 1, \"Atleast one renko bar were emitted.\");\n            volumeRenkoConsolidator.Dispose();\n        }\n\n        [TestCase(TomDemarkSequentialPhase.BuySetup)]\n        [TestCase(TomDemarkSequentialPhase.SellSetup)]\n        [TestCase(TomDemarkSequentialPhase.BuyCountdown)]\n        [TestCase(TomDemarkSequentialPhase.SellCountdown)]\n        [TestCase(TomDemarkSequentialPhase.BuySetupPerfect)]\n        [TestCase(TomDemarkSequentialPhase.SellSetupPerfect)]\n        public void GivenTradeBarsThenValidateExpectedResult(TomDemarkSequentialPhase phase)\n        {\n            var indicator = CreateIndicator();\n            var (prices, time) = SetupData(phase);\n            var expectedSetupStepCount = 1;\n            var expectedCountdownStepCount = 2;\n            var expectedPhase = (decimal)phase;\n\n            for (var index = 0; index < prices.Length; index++)\n            {\n                var price = prices[index];\n                var bar = new TradeBar(time, \"ABC\", price.Open, price.High, price.Low, price.Close, 1000);\n                var isReady = indicator.Update(bar);\n                time = time.AddMinutes(1);\n\n                if (index >= 5)\n                {\n                    Assert.IsTrue(isReady);\n                    if (phase is TomDemarkSequentialPhase.BuyCountdown or TomDemarkSequentialPhase.SellCountdown)\n                    {\n                        if (index < 14)\n                        {\n                            Assert.AreEqual(expectedSetupStepCount++, indicator.SetupPhaseStepCount);\n                        }\n                        else\n                        {\n                            Assert.AreEqual(expectedCountdownStepCount++, indicator.CountdownPhaseStepCount);\n                            Assert.AreEqual(expectedPhase, indicator.Current.Value);\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(expectedSetupStepCount++, indicator.SetupPhaseStepCount);\n\n                        expectedPhase = index switch\n                        {\n                            < 13 => phase switch\n                            {\n                                TomDemarkSequentialPhase.BuySetupPerfect => (decimal)TomDemarkSequentialPhase.BuySetup,\n                                TomDemarkSequentialPhase.SellSetupPerfect =>\n                                    (decimal)TomDemarkSequentialPhase.SellSetup,\n                                _ => (decimal)phase\n                            },\n                            _ => (decimal)phase\n                        };\n                        Assert.AreEqual(expectedPhase, indicator.Current.Value);\n                    }\n                }\n                else\n                {\n                    Assert.IsFalse(isReady);\n                }\n            }\n        }\n\n        private struct OCHL\n        {\n            public decimal Open { get; set; }\n            public decimal High { get; set; }\n            public decimal Low { get; set; }\n            public decimal Close { get; set; }\n        }\n        \n        private static (OCHL[], DateTime) SetupData(TomDemarkSequentialPhase phase)\n        {\n            OCHL[] prices = [];\n            var time = new DateTime(2023, 1, 1, 9, 30, 0);\n            prices = phase switch\n            {\n                TomDemarkSequentialPhase.BuySetup =>\n                [\n                    // Bar 1 to 9 - Close < Close 4 bars ago\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 100 },\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 115 },\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 114 },\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 113 },\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 111 },\n                    new OCHL { Open = 110, High = 111, Low = 109, Close = 110 },\n                    new OCHL { Open = 108, High = 109, Low = 107, Close = 106 },\n                    new OCHL { Open = 106, High = 107, Low = 105, Close = 104 },\n                    new OCHL { Open = 104, High = 105, Low = 103, Close = 102 },\n                    new OCHL { Open = 102, High = 103, Low = 101, Close = 100 },\n                    new OCHL { Open = 100, High = 101, Low = 91.5m, Close = 98 },\n                    new OCHL { Open = 98, High = 99, Low = 95.5m, Close = 96 },\n                    new OCHL { Open = 96, High = 97, Low = 96, Close = 94 },\n                    new OCHL { Open = 94, High = 105, Low = 104, Close = 92 }\n                ],\n                TomDemarkSequentialPhase.SellSetup =>\n                [\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 91 },\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 85 },\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 87 },\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 88 },\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 89 },\n                    new OCHL { Open = 90, High = 91, Low = 89, Close = 90 }, // 1\n                    new OCHL { Open = 91, High = 92, Low = 90, Close = 91 }, // 2\n                    new OCHL { Open = 92, High = 93, Low = 91, Close = 92 }, // 3\n                    new OCHL { Open = 93, High = 94, Low = 92, Close = 93 }, // 4\n                    new OCHL { Open = 94, High = 95, Low = 93, Close = 94 }, // 5 (Close > Bar1.Close)\n                    new OCHL { Open = 95, High = 96, Low = 94, Close = 95 }, // 6 (Close > Bar2.Close)\n                    new OCHL { Open = 96, High = 97, Low = 95, Close = 96 }, // 7 (Close > Bar3.Close)\n                    new OCHL { Open = 97, High = 94, Low = 95.5m, Close = 97 },\n                    new OCHL { Open = 98, High = 91.8m, Low = 90.8m, Close = 98 }\n                ],\n                TomDemarkSequentialPhase.SellSetupPerfect => CreateSellSetupPerfect(),\n                TomDemarkSequentialPhase.BuySetupPerfect => CreateBuySetupPerfect(),\n                TomDemarkSequentialPhase.BuyCountdown => CreateBuyCountdownData(),\n                TomDemarkSequentialPhase.SellCountdown => CreateSellCountdownData(),\n                _ => prices\n            };\n\n            return (prices, time);\n        }\n\n        private static OCHL[] CreateSellCountdownData()\n        {\n            var ochls = new List<OCHL> { new OCHL { Open = 110, High = 90, Low = 90, Close = 110 } };\n            ochls.AddRange(Enumerable.Range(100, 25)\n                .Select(x => new OCHL { Open = x, High = x, Low = x, Close = x }));\n            return ochls.ToArray();\n        }\n\n        private static OCHL[] CreateBuyCountdownData()\n        {\n            var ochls = new List<OCHL> { new OCHL { Open = 90, High = 90, Low = 90, Close = 90 } };\n            ochls.AddRange(Enumerable.Range(1, 25).Select(y =>\n            {\n                var x = (decimal)(100 - y);\n                return new OCHL { Open = x, High = x, Low = x, Close = x };\n            }));\n            return ochls.ToArray();\n        }\n\n        private static OCHL[] CreateSellSetupPerfect()\n        {\n            var ochls = new List<OCHL> { new OCHL { Open = 110, High = 90, Low = 90, Close = 110 } };\n            ochls.AddRange(Enumerable.Range(100, 13)\n                .Select(x => new OCHL { Open = x, High = x, Low = x, Close = x }));\n            return ochls.ToArray();\n        }\n\n        private static OCHL[] CreateBuySetupPerfect()\n        {\n            var ochls = new List<OCHL> { new OCHL { Open = 90, High = 90, Low = 90, Close = 90 } };\n            ochls.AddRange(Enumerable.Range(1, 13).Select(y =>\n            {\n                var x = (decimal)(100 - y);\n                return new OCHL { Open = x, High = x, Low = x, Close = x };\n            }));\n            return ochls.ToArray();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/TriangularMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TriangularMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new TriangularMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_trima.txt\";\n\n        protected override string TestColumnName => \"TRIMA\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            foreach (var period in new[] {5, 6})\n            {\n                RunTestIndicator(new TriangularMovingAverage(period), period);\n            }\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            foreach (var period in new[] { 5, 6 })\n            {\n                var indicator = new TriangularMovingAverage(period);\n                RunTestIndicator(indicator, period);\n                indicator.Reset();\n                RunTestIndicator(indicator, period);\n            }\n        }\n\n        private void RunTestIndicator(TriangularMovingAverage trima, int period)\n        {\n            TestHelper.TestIndicator(trima, TestFileName, TestColumnName + \"_\" + period, Assertion);\n        }\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TripleExponentialMovingAverageTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TripleExponentialMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new TripleExponentialMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_tema.txt\";\n\n        protected override string TestColumnName => \"TEMA_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TrixTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TrixTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new Trix(5);\n        }\n\n        protected override string TestFileName => \"spy_trix.txt\";\n\n        protected override string TestColumnName => \"TRIX_5\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TrueRangeTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TrueRangeTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new TrueRange();\n        }\n\n        protected override string TestFileName => \"spy_tr.txt\";\n\n        protected override string TestColumnName => \"TR\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/TrueStrengthIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class TrueStrengthIndexTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new TrueStrengthIndex();\n        }\n\n        protected override string TestFileName => \"spy_tsi.csv\";\n\n        protected override string TestColumnName => \"TSI_25_13\";\n\n        [Test]\n        public void ComparesWithExternalDataSignal()\n        {\n            var tsi = CreateIndicator();\n            TestHelper.TestIndicator(\n                tsi,\n                TestFileName,\n                \"Signal_7\",\n                (ind, expected) =>\n                {\n                    var tsi = (TrueStrengthIndex)ind;\n                    if (!tsi.Signal.IsReady) return;\n                    Assert.AreEqual(expected, (double)tsi.Signal.Current.Value, delta: 1e-4);\n                }\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/UltimateOscillatorTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class UltimateOscillatorTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            VolumeRenkoBarSize = 10000000m;\n            return new UltimateOscillator(7, 14, 28);\n        }\n\n        [TestCase(0f, 56)]\n        public void IndicatorWorksAsExpectedWhenPricesDontVary(float price, int n)\n        {\n            var prices = Enumerable.Repeat(price, n);\n            var indicator = CreateIndicator();\n            var time = new DateTime(2000, 5, 28);\n\n            var days = 1;\n            foreach (var p in prices)\n            {\n                Assert.DoesNotThrow(() => indicator.Update(new TradeBar() { Time=time.AddDays(days), Close = (decimal)p, Low = (decimal)p, High = (decimal)p, Value = (decimal)p}));\n                days++;\n            }\n\n            Assert.AreEqual((decimal)50, indicator.Current.Value);\n        }\n\n        protected override string TestFileName => \"spy_ultosc.txt\";\n\n        protected override string TestColumnName => \"ULTOSC_7_14_28\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/ValueAtRiskTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing System;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class ValueAtRiskTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        private const int _tradingDays = 252;\n        \n        protected override string TestFileName => \"spy_valueatrisk.csv\";\n\n        protected override string TestColumnName => \"VaR_99\";\n\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new ValueAtRisk(_tradingDays, 0.99d);\n        }\n\n        protected override Action<IndicatorBase<IndicatorDataPoint>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 1e-3); }\n        }\n\n        [Test]\n        public void ComparesAgainstExternalData95()\n        {\n            var indicator = new ValueAtRisk(_tradingDays, 0.95);\n\n            TestHelper.TestIndicator(indicator, TestFileName, \"VaR_95\", Assertion);\n        }\n\n        [Test]\n        public void ComparesAgainstExternalData90()\n        {\n            var indicator = new ValueAtRisk(_tradingDays, 0.9d);\n\n            TestHelper.TestIndicator(indicator, TestFileName, \"VaR_90\", Assertion);\n        }\n\n        [Test]\n        public void DivisonByZero()\n        {\n            var indicator = CreateIndicator();\n\n            for (int i = 0; i < _tradingDays; i++)\n            {\n                var indicatorDataPoint = new IndicatorDataPoint(new DateTime(), 0);\n                indicator.Update(indicatorDataPoint);\n            }\n\n            Assert.AreEqual(indicator.Current.Value, 0m);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public void PeriodBelowMinimumThrows()\n        {\n            var period = 2; \n\n            var exception = Assert.Throws<ArgumentException>(() => new ValueAtRisk(period, 0.99d));\n            Assert.That(exception.Message, Is.EqualTo($\"Period parameter for ValueAtRisk indicator must be greater than 2 but was {period}\"));\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tests/Indicators/VariableIndexDynamicAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class VariableIndexDynamicAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new VariableIndexDynamicAverage(9);\n        }\n\n        protected override string TestFileName => \"spy_vidya.txt\";\n\n        protected override string TestColumnName => \"VIDYA_9\";\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/VarianceTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class VarianceTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new Variance(10);\n        }\n\n        protected override string TestFileName => \"spy_var.txt\";\n\n        protected override string TestColumnName => \"Var\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/VegaTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Indicators;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class VegaTests : OptionBaseIndicatorTests<Vega>\n    {\n        protected override IndicatorBase<IBaseData> CreateIndicator()\n            => new Vega(\"testVegaIndicator\", _symbol, 0.0403m, 0.0m);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel)\n            => new Vega(\"testVegaIndicator\", _symbol, riskFreeRateModel);\n\n        protected override OptionIndicatorBase CreateIndicator(IRiskFreeInterestRateModel riskFreeRateModel, IDividendYieldModel dividendYieldModel)\n        {\n            var symbol = (SymbolList.Count > 0) ? SymbolList[0] : _symbol;\n            return new Vega(\"testVegaIndicator\", symbol, riskFreeRateModel, dividendYieldModel);\n        }\n\n        protected override OptionIndicatorBase CreateIndicator(QCAlgorithm algorithm)\n            => algorithm.V(_symbol);\n\n        [SetUp]\n        public void SetUp()\n        {\n            // 2 updates per iteration, 1 for greek, 1 for IV\n            RiskFreeRateUpdatesPerIteration = 2;\n            DividendYieldUpdatesPerIteration = 2;\n        }\n\n        [TestCase(\"american/third_party_1_greeks.csv\", true, false, 0.2, 2e-4)]\n        [TestCase(\"american/third_party_1_greeks.csv\", false, false, 0.2, 2e-4)]\n        // Just placing the test and data here, we are unsure about the smoothing function and not going to reverse engineer\n        [TestCase(\"american/third_party_2_greeks.csv\", false, true, 10000)]\n        public void ComparesAgainstExternalData(string subPath, bool reset, bool singleContract, double errorRate, double errorMargin = 1e-4,\n            int callColumn = 13, int putColumn = 12)\n        {\n            var path = Path.Combine(\"TestData\", \"greeksindicator\", subPath);\n            // skip last entry since for deep ITM, IV will not affect much on price. Thus root finding will not be optimizing a non-convex function.\n            foreach (var line in File.ReadAllLines(path).Skip(3).SkipLast(1))\n            {\n                var items = line.Split(',');\n\n                var interestRate = Parse.Decimal(items[^2]);\n                var dividendYield = Parse.Decimal(items[^1]);\n\n                var model = ParseSymbols(items, path.Contains(\"american\"), out var call, out var put);\n\n                Vega callIndicator;\n                Vega putIndicator;\n                if (singleContract)\n                {\n                    callIndicator = new Vega(call, interestRate, dividendYield, optionModel: model);\n                    putIndicator = new Vega(put, interestRate, dividendYield, optionModel: model);\n                }\n                else\n                {\n                    callIndicator = new Vega(call, interestRate, dividendYield, put, model);\n                    putIndicator = new Vega(put, interestRate, dividendYield, call, model);\n                }\n\n                RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n\n                if (reset == true)\n                {\n                    callIndicator.Reset();\n                    putIndicator.Reset();\n\n                    RunTestIndicator(call, put, callIndicator, putIndicator, items, callColumn, putColumn, errorRate, errorMargin);\n                }\n            }\n        }\n\n        // Reference values from QuantLib\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.7215, OptionStyle.European)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, 0.7195, OptionStyle.European)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.6705, OptionStyle.European)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, 0.6181, OptionStyle.European)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.5429, OptionStyle.European)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, 0.6922, OptionStyle.European)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 1.1932, OptionStyle.European)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, 1.2263, OptionStyle.European)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 1.0370, OptionStyle.European)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, 0.3528, OptionStyle.European)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 0.9707, OptionStyle.European)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, 1.1816, OptionStyle.European)]\n        [TestCase(23.753, 450.0, OptionRight.Call, 60, 0.7206, OptionStyle.American)]\n        [TestCase(35.830, 450.0, OptionRight.Put, 60, 0.7189, OptionStyle.American)]\n        [TestCase(33.928, 470.0, OptionRight.Call, 60, 0.6791, OptionStyle.American)]\n        [TestCase(6.428, 470.0, OptionRight.Put, 60, 0.6290, OptionStyle.American)]\n        [TestCase(3.219, 430.0, OptionRight.Call, 60, 0.5690, OptionStyle.American)]\n        [TestCase(47.701, 430.0, OptionRight.Put, 60, 0.6921, OptionStyle.American)]\n        [TestCase(16.528, 450.0, OptionRight.Call, 180, 1.1958, OptionStyle.American)]\n        [TestCase(21.784, 450.0, OptionRight.Put, 180, 1.2248, OptionStyle.American)]\n        [TestCase(35.207, 470.0, OptionRight.Call, 180, 1.0459, OptionStyle.American)]\n        [TestCase(0.409, 470.0, OptionRight.Put, 180, 0.4350, OptionStyle.American)]\n        [TestCase(2.642, 430.0, OptionRight.Call, 180, 1.0122, OptionStyle.American)]\n        [TestCase(27.772, 430.0, OptionRight.Put, 180, 1.1852, OptionStyle.American)]\n        // No American option Vega from QuantLib\n        public void ComparesAgainstExternalData2(decimal price, decimal spotPrice, OptionRight right, int expiry, double refVega, OptionStyle style)\n        {\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, style, right, 450m, _reference.AddDays(expiry));\n            var model = style == OptionStyle.European ? OptionPricingModelType.BlackScholes : OptionPricingModelType.BinomialCoxRossRubinstein;\n            var indicator = new Vega(symbol, 0.053m, 0.0153m, optionModel: model, ivModel: OptionPricingModelType.BlackScholes);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, _reference, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, _reference, spotPrice);\n            indicator.Update(optionDataPoint);\n            indicator.Update(spotDataPoint);\n\n            Assert.AreEqual(refVega, (double)indicator.Current.Value, 0.0072d);\n        }\n\n        [TestCase(0.5, 470.0, OptionRight.Put, 0)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 5)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 10)]\n        [TestCase(0.5, 470.0, OptionRight.Put, 15)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 0)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 5)]\n        [TestCase(15.0, 450.0, OptionRight.Call, 10)]\n        [TestCase(0.5, 450.0, OptionRight.Call, 15)]\n        public void CanComputeOnExpirationDate(decimal price, decimal spotPrice, OptionRight right, int hoursAfterExpiryDate)\n        {\n            var expiration = new DateTime(2024, 12, 6);\n            var symbol = Symbol.CreateOption(\"SPY\", Market.USA, OptionStyle.American, right, 450m, expiration);\n            var indicator = new Vega(symbol, 0.053m, 0.0153m,\n                optionModel: OptionPricingModelType.BinomialCoxRossRubinstein, ivModel: OptionPricingModelType.BlackScholes);\n\n            var currentTime = expiration.AddHours(hoursAfterExpiryDate);\n\n            var optionDataPoint = new IndicatorDataPoint(symbol, currentTime, price);\n            var spotDataPoint = new IndicatorDataPoint(symbol.Underlying, currentTime, spotPrice);\n\n            Assert.IsFalse(indicator.Update(optionDataPoint));\n            Assert.IsTrue(indicator.Update(spotDataPoint));\n\n            Assert.AreNotEqual(0, indicator.Current.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/VolumeProfileTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class VolumeProfileTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override string TestFileName => \"vp_datatest.csv\";\n\n        protected override string TestColumnName => \"POCPrice\";\n\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            return new VolumeProfile(3);\n        }\n        protected override Action<IndicatorBase<TradeBar>, double> Assertion\n        {\n            get { return (indicator, expected) => Assert.AreEqual(expected, (double)indicator.Current.Value, 0.01); }\n        }\n\n        [Test]\n        public void ComparesWithExternalDataPOCVolume()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"POCVolume\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).POCVolume)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataProfileHigh()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"PH\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).ProfileHigh)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataProfileLow()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"PL\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).ProfileLow)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataValueArea()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VA\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).ValueAreaVolume, 0.01)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataVAH()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VAH\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).ValueAreaHigh)\n                );\n        }\n\n        [Test]\n        public void ComparesWithExternalDataVAL()\n        {\n            TestHelper.TestIndicator(\n                CreateIndicator(),\n                TestFileName,\n                \"VAL\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((VolumeProfile)ind).ValueAreaLow)\n                );\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var vp = (VolumeProfile)CreateIndicator();\n            var reference = new System.DateTime(2020, 8, 1);\n            Assert.IsFalse(vp.IsReady);\n            for (int i = 0; i < 3; i++)\n            {\n                vp.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddDays(1 + i) });\n            }\n            Assert.IsTrue(vp.IsReady);\n            vp.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(vp);\n            vp.Update(new TradeBar() { Symbol = Symbols.IBM, Close = 1, Volume = 1, Time = reference.AddDays(1) });\n            Assert.AreEqual(vp.Current.Value, 1m);\n        }\n\n        [Test]\n        public override void WarmsUpProperly()\n        {\n            var vp = new VolumeProfile(20);\n            var reference = new DateTime(2000, 1, 1);\n            var period = ((IIndicatorWarmUpPeriodProvider)vp).WarmUpPeriod;\n\n            // Check VolumeProfile indicator assigns properly a WarmUpPeriod\n            Assert.AreEqual(20, period);\n            for (var i = 0; i < period; i++)\n            {\n                vp.Update(new TradeBar() { Symbol = Symbols.AAPL, Low = 1, High = 2, Volume = 100, Time = reference.AddDays(1 + i) });\n                Assert.AreEqual(i == period - 1, vp.IsReady);\n            }\n        }\n\n        [TestCaseSource(nameof(BarsSequenceCases))]\n        public void DoesNotFailWithZeroVolumeBars(Bar[] bars)\n        {\n            var vp = new VolumeProfile(2);\n            var reference = new DateTime(2000, 1, 1);\n            var period = ((IIndicatorWarmUpPeriodProvider)vp).WarmUpPeriod;\n            for (var i = 0; i < bars.Length; i++)\n            {\n                var dataPoint = new TradeBar() { Symbol = Symbols.AAPL, Close = bars[i].closePrice, Volume = bars[i].volume, Time = reference.AddDays(1 + i) };\n                Assert.DoesNotThrow(() => vp.Update(dataPoint));\n                Assert.AreEqual(bars[i].expectedPOCPrice, vp.Current.Value);\n            }\n        }\n\n        public static Bar[][] BarsSequenceCases =\n        {\n            new Bar[] // Represents a sequence of real bars and a zero volume bar\n            {\n                new Bar(){ closePrice = 314.25m, volume = 100, expectedPOCPrice = 314.25m},\n                new Bar(){ closePrice = 314.242m, volume = 100, expectedPOCPrice = 314.25m},\n                new Bar(){ closePrice = 314.248m, volume = 0, expectedPOCPrice = 314.25m},\n                new Bar(){ closePrice = 315.25m, volume = 100, expectedPOCPrice = 315.25m},\n                new Bar(){ closePrice = 315.241m, volume = 100, expectedPOCPrice = 315.25m}\n            },\n\n            new Bar[] // Represents a sequence of a real bar and zero volume bars\n            {\n                new Bar(){ closePrice = 313.25m, volume = 100, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 313.241m, volume = 0, expectedPOCPrice = 0}\n            },\n\n            new Bar[] // Represents a sequence of zero volume bars and a real bar\n            {\n                new Bar(){ closePrice = 314.243m, volume = 0, expectedPOCPrice = 314.25m},\n                new Bar(){ closePrice = 314.243m, volume = 0, expectedPOCPrice = 314.25m},\n                new Bar(){ closePrice = 314.243m, volume = 0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 314.243m, volume = 0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 315.243m, volume = 100, expectedPOCPrice = 315.25m},\n            },\n\n            new Bar[] // Represents an alternant sequence of zero volume bars and real bars\n            {\n                new Bar(){ closePrice = 312.25m, volume = 100, expectedPOCPrice = 312.25m},\n                new Bar(){ closePrice = 312.243m, volume = 0, expectedPOCPrice = 312.25m},\n                new Bar(){ closePrice = 312.25m, volume = 100, expectedPOCPrice = 312.25m},\n                new Bar(){ closePrice = 312.243m, volume = 0, expectedPOCPrice = 312.25m},\n                new Bar(){ closePrice = 312.243m, volume = 100, expectedPOCPrice = 312.25m},\n            },\n\n            new Bar[] // Represents a sequence of zero volume bars, a real bar and zero volume bars\n            {\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.25m, volume = 100, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 0},\n            },\n\n            new Bar[] // Represents a sequence of zero volume bars\n            {\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 313.25m},\n                new Bar(){ closePrice = 313.25m, volume =  0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 0},\n                new Bar(){ closePrice = 313.243m, volume = 0, expectedPOCPrice = 0},\n            }\n        };\n\n        public class Bar\n        {\n            public decimal closePrice { get; set; }\n            public decimal volume { get; set; }\n            public decimal expectedPOCPrice { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tests/Indicators/VolumeWeightedAveragePriceIndicatorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class VolumeWeightedAveragePriceIndicatorTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            RenkoBarSize = 0.1m;\n            return new VolumeWeightedAveragePriceIndicator(50);\n        }\n\n        protected override string TestFileName => \"spy_with_vwap.txt\";\n\n        protected override string TestColumnName => \"Moving VWAP 50\";\n\n        [Test]\n        public void VwapComputesCorrectly()\n        {\n            const int period = 4;\n            const int volume = 100;\n            var ind = new VolumeWeightedAveragePriceIndicator(period);\n            var data = new[] {1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m};\n\n            var seen = new List<decimal>();\n            for (var i = 0; i < data.Length; i++)\n            {\n                var datum = data[i];\n                seen.Add(datum);\n                ind.Update(new TradeBar(DateTime.Now.AddSeconds(i), Symbols.SPY, datum, datum, datum, datum, volume));\n                // When volume is constant, VWAP is a simple moving average\n                Assert.AreEqual(Enumerable.Reverse(seen).Take(period).Average(), ind.Current.Value);\n            }\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var ind = new VolumeWeightedAveragePriceIndicator(3);\n\n            ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 1m, 1m, 1m, 1m, 1));\n            ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 1m, 1m, 1m, 1m, 1));\n            Assert.IsFalse(ind.IsReady);\n            ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 1m, 1m, 1m, 1m, 1));\n            Assert.IsTrue(ind.IsReady);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var ind = CreateIndicator();\n\n            foreach (var data in TestHelper.GetTradeBarStream(TestFileName))\n            {\n                ind.Update(data);\n            }\n            Assert.IsTrue(ind.IsReady);\n\n            ind.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(ind);\n            ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 2m, 2m, 2m, 2m, 1));\n            Assert.AreEqual(ind.Current.Value, 2m);\n        }\n        \n        [Test]\n        public void ResetsInnerVolumeWeightedAveragePriceIndicatorProperly()\n        {\n            var indicator = new TestVolumeWeightedAveragePriceIndicator(50);\n\n            foreach (var data in TestHelper.GetTradeBarStream(TestFileName))\n            {\n                indicator.Update(data);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            var lastVWAPIndicator = indicator.GetInnerVolumeWeightedAveragePriceIndicator();\n\n            Assert.AreNotEqual(0, lastVWAPIndicator.Samples);\n            Assert.AreNotEqual(0, lastVWAPIndicator.Left.Samples);\n            Assert.AreNotEqual(0, lastVWAPIndicator.Right.Samples);\n            Assert.IsTrue(lastVWAPIndicator.IsReady);\n            Assert.IsTrue(lastVWAPIndicator.Left.IsReady);\n            Assert.IsTrue(lastVWAPIndicator.Right.IsReady);\n\n            indicator.Reset();\n            var newVWAPIndicator = indicator.GetInnerVolumeWeightedAveragePriceIndicator();\n\n            Assert.IsTrue(Object.ReferenceEquals(lastVWAPIndicator, newVWAPIndicator));\n            Assert.AreEqual(0, newVWAPIndicator.Samples);\n            Assert.AreEqual(0, newVWAPIndicator.Left.Samples);\n            Assert.AreEqual(0, newVWAPIndicator.Right.Samples);\n            Assert.IsFalse(newVWAPIndicator.IsReady);\n            Assert.IsFalse(newVWAPIndicator.Left.IsReady);\n            Assert.IsFalse(newVWAPIndicator.Right.IsReady);\n        }\n\n        [Test]\n        public void ResetsInnerPriceIndicatorProperly()\n        {\n            var indicator = new TestVolumeWeightedAveragePriceIndicator(50);\n\n            foreach (var data in TestHelper.GetTradeBarStream(TestFileName))\n            {\n                indicator.Update(data);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            var lastPriceIndicator = indicator.GetInnerPriceIndicator();\n            Assert.AreNotEqual(0, lastPriceIndicator.Samples);\n            Assert.IsTrue(lastPriceIndicator.IsReady);\n\n            indicator.Reset();\n\n            var newPriceIndicator = indicator.GetInnerPriceIndicator();\n            Assert.AreEqual(0, newPriceIndicator.Samples);\n            Assert.IsFalse(newPriceIndicator.IsReady);\n        }\n\n        [Test]\n        public void ResetsInnerVolumeIndicatorProperly()\n        {\n            var indicator = new TestVolumeWeightedAveragePriceIndicator(50);\n\n            foreach (var data in TestHelper.GetTradeBarStream(TestFileName))\n            {\n                indicator.Update(data);\n            }\n\n            Assert.IsTrue(indicator.IsReady);\n\n            var lastVolumeIndicator = indicator.GetInnerVolumeIndicator();\n            Assert.AreNotEqual(0, lastVolumeIndicator.Samples);\n            Assert.IsTrue(lastVolumeIndicator.IsReady);\n\n            indicator.Reset();\n\n            var newVolumeIndicator = indicator.GetInnerVolumeIndicator();\n            Assert.AreEqual(0, newVolumeIndicator.Samples);\n            Assert.IsFalse(newVolumeIndicator.IsReady);\n        }\n        \n        /// <summary>\n        /// The final value of this indicator is zero because it uses the Volume of the bars it receives.\n        /// Since RenkoBar's don't always have Volume, the final current value is zero. Therefore we\n        /// skip this test\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n\n    public class TestVolumeWeightedAveragePriceIndicator : VolumeWeightedAveragePriceIndicator\n    {\n        public TestVolumeWeightedAveragePriceIndicator(int period) : base(period)\n        {\n        }\n\n        public CompositeIndicator GetInnerVolumeWeightedAveragePriceIndicator()\n        {\n            return VWAP;\n        }\n\n        public IndicatorBase GetInnerPriceIndicator()\n        {\n            return Price;\n        }\n\n        public IndicatorBase GetInnerVolumeIndicator()\n        {\n            return Volume;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/VolumeWeightedMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class VolumeWeightedMovingAverageTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n\n            return new VolumeWeightedMovingAverage(\"VWMA\", 20);\n        }\n\n        protected override string TestFileName => \"spy_with_vwma.csv\";\n\n        protected override string TestColumnName => \"VWMA20\";\n\n\n        /// <summary>\n        /// This indicator doesn't accept Renko Bars as input. Skip this test.\n        /// </summary>\n        public override void AcceptsRenkoBarsAsInput()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/VortexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class VortexTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            return new Vortex(14);\n        }\n\n        protected override string TestFileName => \"spy_with_vtx.csv\";\n\n        protected override string TestColumnName => \"plus_vtx\";\n\n        [Test]\n        public override void ComparesAgainstExternalData()\n        {\n            const double epsilon = 0.0001;\n\n            var vortex = CreateIndicator();\n\n            TestHelper.TestIndicator(vortex, TestFileName, \"plus_vtx\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((Vortex)ind).PlusVortex.Current.Value, epsilon)\n            );\n        }\n\n        [Test]\n        public override void ComparesAgainstExternalDataAfterReset()\n        {\n            const double epsilon = 0.0001;\n\n            var vortex = CreateIndicator();\n\n\n            TestHelper.TestIndicator(vortex, TestFileName, \"plus_vtx\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((Vortex)ind).PlusVortex.Current.Value, epsilon)\n            );\n\n            vortex.Reset();\n\n            TestHelper.TestIndicator(vortex, TestFileName, \"minus_vtx\",\n                (ind, expected) => Assert.AreEqual(expected, (double)((Vortex)ind).MinusVortex.Current.Value, epsilon)\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/WilderAccumulativeSwingIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class WilderAccumulativeSwingIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new WilderAccumulativeSwingIndex(8);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_asi.csv\"; }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"ASI\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/WilderSwingIndexTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class WilderSwingIndexTests : CommonIndicatorTests<TradeBar>\n    {\n        protected override IndicatorBase<TradeBar> CreateIndicator()\n        {\n            return new WilderSwingIndex(8);\n        }\n\n        protected override string TestFileName\n        {\n            get { return \"spy_si.csv\";  }\n        }\n\n        protected override string TestColumnName\n        {\n            get { return \"SI\"; }\n        }\n\n        /// <summary>\n        /// The final value of this indicator after being warmed up with VolumeRenkoBar's, is zero\n        /// since sometimes it receives two consecutive bars with the same open and close values.\n        /// Therefore we skip this test.\n        /// </summary>\n        /// <param name=\"indicator\"></param>\n        protected override void IndicatorValueIsNotZeroAfterReceiveVolumeRenkoBars(IndicatorBase indicator)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/WilliamsPercentRTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class WilliamsPercentRTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            RenkoBarSize = 1m;\n            VolumeRenkoBarSize = 0.5m;\n            return new WilliamsPercentR(14);\n        }\n\n        protected override string TestFileName => \"spy_with_williamsR14.txt\";\n\n        protected override string TestColumnName => \"Williams %R 14\";\n    }\n}"
  },
  {
    "path": "Tests/Indicators/WindowIdentityTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class WindowIdentityTests\n    {\n        [Test]\n        public void WindowIdentityComputesCorrectly()\n        {\n            var indicator = new WindowIdentity(4);\n            var data = new[] {1m, 10m, 100m, 1000m, 10000m, 1234m, 56789m};\n\n            var seen = new List<decimal>();\n            for (int i = 0; i < data.Length; i++)\n            {\n                var datum = data[i];\n                seen.Add(datum);\n                indicator.Update(new IndicatorDataPoint(DateTime.Now.AddSeconds(i), datum));\n                Assert.AreEqual(seen.LastOrDefault(), indicator.Current.Value);\n            }\n        }\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var indicator = new WindowIdentity(3);\n\n            indicator.Update(DateTime.UtcNow, 1m);\n            indicator.Update(DateTime.UtcNow, 1m);\n            Assert.IsFalse(indicator.IsReady);\n            indicator.Update(DateTime.UtcNow, 1m);\n            Assert.IsTrue(indicator.IsReady);\n        }\n\n        [Test]\n        public void ResetsProperly()\n        {\n            var indicator = new WindowIdentity(3);\n\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                indicator.Update(data);\n            }\n            Assert.IsTrue(indicator.IsReady);\n            \n            indicator.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(indicator);\n            indicator.Update(DateTime.UtcNow, 2.0m);\n            Assert.AreEqual(indicator.Current.Value, 2.0m);\n        }\n\n        [Test]\n        public void CompareAgainstExternalData()\n        {\n            var indicator = new WindowIdentity(14);\n            TestHelper.TestIndicator(indicator, \"Close\", 1e-2); // test file only has\n        }\n\n        [Test]\n        public void WarmsUpProperly()\n        {\n            var windowIdentityIndicator = new WindowIdentity(\"Example\", 13);\n            var time = new DateTime(2020, 8, 1);\n            var period = ((IIndicatorWarmUpPeriodProvider)windowIdentityIndicator).WarmUpPeriod;\n\n            for (var i = 0; i < period; i++)\n            {\n                windowIdentityIndicator.Update(time.AddDays(i), i);\n                Assert.AreEqual(i == period - 1, windowIdentityIndicator.IsReady);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ZeroLagExponentialMovingAverageTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ZeroLagExponentialMovingAverageTests : CommonIndicatorTests<IndicatorDataPoint>\n    {\n        protected override IndicatorBase<IndicatorDataPoint> CreateIndicator()\n        {\n            return new ZeroLagExponentialMovingAverage(5);\n        }\n\n        protected override string TestFileName => \"spy_with_zlema.csv\";\n\n        protected override string TestColumnName => \"ZLEMA5\";\n\n\n        [Test]\n        public void IsReadyAfterPeriodUpdates()\n        {\n            var zlema = new ZeroLagExponentialMovingAverage(5);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 0, 0), 1m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 1, 0), 1m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 2, 0), 1m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 3, 0), 1m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 4, 0), 1m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 5, 0), 1m);\n            Assert.IsFalse(zlema.IsReady);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 6, 0), 1m);\n            Assert.IsTrue(zlema.IsReady);\n            Assert.AreEqual(zlema.WarmUpPeriod, 7);\n        }\n\n        [Test]\n        public override void ResetsProperly()\n        {\n            var zlema = new ZeroLagExponentialMovingAverage(3);\n\n            foreach (var data in TestHelper.GetDataStream(4))\n            {\n                zlema.Update(data);\n            }\n            Assert.IsTrue(zlema.IsReady);\n\n            zlema.Reset();\n\n            TestHelper.AssertIndicatorIsInDefaultState(zlema);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 0, 0), 2.0m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 1, 0), 2.0m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 2, 0), 2.0m);\n            zlema.Update(new DateTime(2024, 07, 05, 0, 3, 0), 2.0m);\n            Assert.AreEqual(zlema.Current.Value, 2.0m);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Indicators/ZigZagTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Indicators;\n\nnamespace QuantConnect.Tests.Indicators\n{\n    [TestFixture]\n    public class ZigZagTests : CommonIndicatorTests<IBaseDataBar>\n    {\n        protected override IndicatorBase<IBaseDataBar> CreateIndicator()\n        {\n            return new ZigZag(\"ZigZag\", 0.05m, 10);\n        }\n        protected override string TestFileName => \"spy_zigzag.csv\";\n\n        protected override string TestColumnName => \"zigzag\";\n\n        [Test]\n        public void HighPivotShouldBeZeroWhenAllValuesAreEqual()\n        {\n            var zigzag = new ZigZag(\"ZigZag\", 0.05m, 5);\n            var date = new DateTime(2024, 12, 2, 12, 0, 0);\n\n            for (int i = 0; i < 10; i++)\n            {\n                var data = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = date,\n                    Open = 5,\n                    Low = 5,\n                    High = 5,\n                };\n                zigzag.Update(data);\n            }\n            Assert.AreEqual(0m, zigzag.HighPivot.Current.Value);\n        }\n\n        [Test]\n        public void LowPivotReflectsInputWhenValuesAreEqual()\n        {\n            var zigzag = new ZigZag(\"ZigZag\", 0.05m, 5);\n            var date = new DateTime(2024, 12, 2, 12, 0, 0);\n            var value = 5m;\n\n            for (int i = 0; i < 10; i++)\n            {\n                var data = new TradeBar\n                {\n                    Symbol = Symbol.Empty,\n                    Time = date,\n                    Open = value,\n                    Low = value,\n                    High = value,\n                };\n                zigzag.Update(data);\n            }\n            Assert.AreEqual(value, zigzag.LowPivot.Current.Value);\n        }\n    }\n}"
  },
  {
    "path": "Tests/JobQueueTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Queues;\nusing System;\n\nnamespace QuantConnect.Tests\n{\n    [TestFixture]\n    public class JobQueueTests\n    {\n        [TestCase(\"QuantConnect.Algorithm.CSharp.dll\", \"CSharp\", Language.CSharp, true)]\n        [TestCase(\"QuantConnect.Algorithm.CSharp.dll\", \"\", Language.CSharp, true)]\n        [TestCase(\"QUANTCONNECT.ALGORITHM.CSHARP.DLL\", \"\", Language.CSharp, true)]\n        [TestCase(\"../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py\", \"Python\", Language.Python, true)]\n        [TestCase(\"../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py\", \"\", Language.Python, true)]\n        [TestCase(\"../../../ALGORITHM.PYTHON/BASICTEMPLATEFRAMEWORKALGORITHM.PY\", \"\", Language.Python, true)]\n        [TestCase(\"../../../test.jar\", \"\", Language.Java, false)]\n        public void JobQueueSetsAlgorithmLanguageCorrectly(string algorithmLocation, string algorithmLanguage, Language expectedLangauge, bool isValidExtension)\n        {\n            Config.Set(\"algorithm-location\", algorithmLocation);\n            Config.Set(\"algorithm-language\", algorithmLanguage);\n\n            var jobQueue = new JobQueueTestClass();\n            if (isValidExtension)\n            {\n                Assert.AreEqual(expectedLangauge, jobQueue.GetLanguage());\n            }\n            else\n            {\n                Assert.Throws<ArgumentException>(() => jobQueue.GetLanguage());\n            }\n        }\n    }\n\n    public class JobQueueTestClass : JobQueue\n    {\n        public Language GetLanguage() { return Language; }\n    }\n}\n"
  },
  {
    "path": "Tests/Logging/FileLogHandlerTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests.Logging\n{\n    [TestFixture]\n    public class FileLogHandlerTests\n    {\n        [Test]\n        public void WritesMessageToFile()\n        {\n            const string file = \"log2.txt\";\n            File.Delete(file);\n\n            var debugMessage = \"*debug message*\" + DateTime.UtcNow.ToStringInvariant(\"o\");\n            using (var log = new FileLogHandler(file))\n            {\n                log.Debug(debugMessage);\n            }\n\n            var contents = File.ReadAllText(file);\n            Assert.IsNotNull(contents);\n            Assert.IsTrue(contents.Contains(debugMessage));\n\n            File.Delete(file);\n        }\n\n        [Test]\n        public void UsesGlobalFilePath()\n        {\n            var previous = Log.FilePath;\n            Directory.CreateDirectory(\"filePathTest\");\n            Log.FilePath = Path.Combine(\"filePathTest\", \"log2.txt\");\n            File.Delete(Log.FilePath);\n\n            var debugMessage = \"*debug message*\" + DateTime.UtcNow.ToStringInvariant(\"o\");\n            using (var log = new FileLogHandler())\n            {\n                log.Debug(debugMessage);\n            }\n\n            var contents = File.ReadAllText(Log.FilePath);\n            File.Delete(Log.FilePath);\n            Log.FilePath = previous;\n\n            Assert.IsNotNull(contents);\n            Assert.IsTrue(contents.Contains(debugMessage));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Messaging/StreamingMessageHandlerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System.Collections.Generic;\nusing NetMQ;\nusing NetMQ.Sockets;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Messaging;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\n\nnamespace QuantConnect.Tests.Messaging\n{\n    [TestFixture, Ignore(\"This test requires an open TCP to be configured.\")]\n    public class StreamingMessageHandlerTests\n    {\n        private readonly string _port = \"1234\";\n        private StreamingMessageHandler _messageHandler;\n\n        [OneTimeSetUp]\n        public void SetUp()\n        {\n            Config.Set(\"desktop-http-port\", _port);\n\n            _messageHandler = new StreamingMessageHandler();\n            _messageHandler.Initialize(null);\n        }\n\n        [Test]\n        public void MessageHandler_WillSend_MultipartMessage()\n        {\n            using (var pullSocket = new PullSocket(\">tcp://localhost:\" + _port))\n            {\n                var logPacket = new LogPacket\n                {\n                    Message = \"1\"\n                };\n\n                var tx = JsonConvert.SerializeObject(logPacket);\n\n                _messageHandler.Transmit(logPacket);\n\n                var message = pullSocket.ReceiveMultipartMessage();\n\n                Assert.IsTrue(message.FrameCount == 1);\n                Assert.IsTrue(message[0].ConvertToString() == tx);\n            }\n        }\n\n        [Test]\n        public void MessageHandler_SendsCorrectPackets_ToCorrectRoutes()\n        {\n            //Allow proper decoding of orders.\n            JsonConvert.DefaultSettings = () => new JsonSerializerSettings\n            {\n                Converters = { new OrderJsonConverter() }\n            };\n\n            // Create list of packets to test\n            var debug = new DebugPacket();\n            var log = new LogPacket();\n            var backtest = new BacktestResultPacket();\n            var handled = new HandledErrorPacket();\n            var error = new RuntimeErrorPacket();\n            var packetList = new List<Packet>\n                {\n                    log,\n                    debug,\n                    backtest,\n                    handled,\n                    error\n                };\n\n            using (var pullSocket = new PullSocket(\">tcp://localhost:\" + _port))\n            {\n                var count = 0;\n                while (count < packetList.Count)\n                {\n                    _messageHandler.Send(packetList[count]);\n\n                    var message = pullSocket.ReceiveMultipartMessage();\n\n                    var payload = message[0].ConvertToString();\n                    var packet = JsonConvert.DeserializeObject<Packet>(payload);\n\n                    Assert.IsTrue(message.FrameCount == 1);\n\n                    if (PacketType.Debug == packet.Type)\n                        Assert.IsTrue(payload == JsonConvert.SerializeObject(debug));\n\n                    if (PacketType.HandledError == packet.Type)\n                        Assert.IsTrue(payload == JsonConvert.SerializeObject(handled));\n\n                    if (PacketType.BacktestResult == packet.Type)\n                        Assert.IsTrue(payload == JsonConvert.SerializeObject(backtest));\n\n                    if (PacketType.RuntimeError == packet.Type)\n                        Assert.IsTrue(payload == JsonConvert.SerializeObject(error));\n\n                    if (PacketType.Log == packet.Type)\n                        Assert.IsTrue(payload == JsonConvert.SerializeObject(log));\n\n                    count++;\n                }\n            }\n        }\n\n        [Test]\n        public void MessageHandler_WillSend_NewBackTestJob_ToCorrectRoute()\n        {\n            var backtest = new BacktestNodePacket();\n\n            using (var pullSocket = new PullSocket(\">tcp://localhost:\" + _port))\n            {\n                _messageHandler.SetAuthentication(backtest);\n\n                var message = pullSocket.ReceiveMultipartMessage();\n\n                var payload = message[0].ConvertToString();\n                var packet = JsonConvert.DeserializeObject<Packet>(payload);\n\n                Assert.IsTrue(message.FrameCount == 1);\n                Assert.IsTrue(PacketType.BacktestNode == packet.Type);\n                Assert.IsTrue(payload == JsonConvert.SerializeObject(backtest));\n            }\n        }\n\n        [Test]\n        public void MessageHandler_WillSend_NewLiveJob_ToCorrectRoute()\n        {\n            using (var pullSocket = new PullSocket(\">tcp://localhost:\" + _port))\n            {\n                _messageHandler.SetAuthentication(new LiveNodePacket());\n\n                var message = pullSocket.ReceiveMultipartMessage();\n\n                var payload = message[0].ConvertToString();\n                var packet = JsonConvert.DeserializeObject<Packet>(payload);\n\n                Assert.IsTrue(message.FrameCount == 1);\n                Assert.IsTrue(PacketType.LiveNode == packet.Type);\n                Assert.IsTrue(payload == JsonConvert.SerializeObject(new LiveNodePacket()));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/NUnitLogHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// ILogHandler implementation for NUnit tests that displays log output immediately.\n    /// </summary>\n    public class NUnitLogHandler : ILogHandler\n    {\n        private const string DefaultDateFormat = \"yyyyMMdd HH:mm:ss.fff\";\n        private readonly TextWriter _trace;\n        private readonly TextWriter _error;\n        private readonly string _dateFormat;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NUnitLogHandler\"/> class.\n        /// </summary>\n        public NUnitLogHandler()\n            : this(DefaultDateFormat)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NUnitLogHandler\"/> class.\n        /// </summary>\n        /// <param name=\"dateFormat\">Specifies the date format to use when writing log messages to the console window</param>\n        public NUnitLogHandler(string dateFormat = DefaultDateFormat)\n        {\n            _trace = TestContext.Progress;\n            _error = TestContext.Progress;\n            _dateFormat = dateFormat;\n        }\n\n        /// <summary>\n        /// Write error message to log\n        /// </summary>\n        /// <param name=\"text\">The error text to log</param>\n        public virtual void Error(string text)\n        {\n            _error.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} ERROR:: {text}\");\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The debug text to log</param>\n        public virtual void Debug(string text)\n        {\n            _trace.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} DEBUG:: {text}\");\n        }\n\n        /// <summary>\n        /// Write debug message to log\n        /// </summary>\n        /// <param name=\"text\">The trace text to log</param>\n        public virtual void Trace(string text)\n        {\n            _trace.WriteLine($\"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} TRACE:: {text}\");\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/FakeLeanOptimizer.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Parameters;\n\nnamespace QuantConnect.Tests.Optimizer\n{\n    public class FakeLeanOptimizer : LeanOptimizer\n    {\n        private readonly HashSet<string> _backtests = new HashSet<string>();\n\n        public event EventHandler Update;\n\n        public FakeLeanOptimizer(OptimizationNodePacket nodePacket)\n            : base(nodePacket)\n        {\n        }\n\n        protected override string RunLean(ParameterSet parameterSet, string backtestName)\n        {\n            var id = Guid.NewGuid().ToString();\n            _backtests.Add(id);\n\n            Task.Delay(100).ContinueWith(task =>\n            {\n                try\n                {\n                    var sum = parameterSet.Value.Where(pair => pair.Key != \"skipFromResultSum\").Sum(s => s.Value.ToDecimal());\n                    if (sum != 29)\n                    {\n                        NewResult(BacktestResult.Create(sum, sum / 100).ToJson(), id);\n                    }\n                    else\n                    {\n                        // fail some backtests by passing empty json\n                        NewResult(string.Empty, id);\n                    }\n                }\n                catch\n                {\n                }\n            });\n\n            return id;\n        }\n\n        protected override void AbortLean(string backtestId)\n        {\n            _backtests.Remove(backtestId);\n        }\n\n        protected override void SendUpdate()\n        {\n            OnUpdate();\n        }\n\n        private void OnUpdate()\n        {\n            Update?.Invoke(this, EventArgs.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/LeanOptimizerTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Threading;\nusing QuantConnect.Configuration;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\n\nnamespace QuantConnect.Tests.Optimizer\n{\n    [TestFixture, Parallelizable(ParallelScope.Children)]\n    public class LeanOptimizerTests\n    {\n        [TestCase(\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\")]\n        [TestCase(\"QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy\")]\n        public void MaximizeNoTarget(string strategyName)\n        {\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                OptimizationStrategy = strategyName,\n                Criterion = new Target(\"Profit\",\n                    new Maximization(),\n                    null),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 3)\n                },\n                MaximumConcurrentBacktests = 20,\n                OptimizationStrategySettings = new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = 10 }\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n\n            OptimizationResult result = null;\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n            Assert.NotNull(result);\n            Assert.AreEqual(\n                110,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Profit);\n\n            Assert.AreEqual(10, result.ParameterSet.Value[\"ema-slow\"].ToDecimal());\n            Assert.AreEqual(100, result.ParameterSet.Value[\"ema-fast\"].ToDecimal());\n        }\n\n        [TestCase(\"QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy\")]\n        [TestCase(\"QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy\")]\n        public void MinimizeWithTarget(string strategyName)\n        {\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                OptimizationStrategy = strategyName,\n                Criterion = new Target(\"Profit\", new Minimization(), 20),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 3)\n                },\n                MaximumConcurrentBacktests = 20,\n                OptimizationStrategySettings = new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = 10 }\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n\n            OptimizationResult result = null;\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n            Assert.NotNull(result);\n            Assert.GreaterOrEqual(\n                20,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Profit);\n        }\n\n        [Test]\n        public void MaximizeGridWithConstraints()\n        {\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                Criterion = new Target(\"Profit\", new Maximization(), null),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1m),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 3m)\n                },\n                Constraints = new List<Constraint>\n                {\n                    new Constraint(\"Drawdown\", ComparisonOperatorTypes.LessOrEqual, 0.15m)\n                },\n                MaximumConcurrentBacktests = 20\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n\n            OptimizationResult result = null;\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n            Assert.NotNull(result);\n            Assert.AreEqual(\n                15,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Profit);\n            Assert.AreEqual(\n                0.15m,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Drawdown);\n\n        }\n\n        [Test]\n        public void MaximizeEulerWithConstraints()\n        {\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                OptimizationStrategy = \"QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy\",\n                Criterion = new Target(\"Profit\", new Maximization(), null),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 10m, 0.1m)\n                },\n                Constraints = new List<Constraint>\n                {\n                    new Constraint(\"Drawdown\", ComparisonOperatorTypes.LessOrEqual, 0.15m)\n                },\n                MaximumConcurrentBacktests = 20,\n                OptimizationStrategySettings = new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = 10 }\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n\n            OptimizationResult result = null;\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n            Assert.NotNull(result);\n            Assert.AreEqual(\n                15,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Profit);\n            Assert.AreEqual(\n                0.15m,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Drawdown);\n\n        }\n\n        [Test]\n        public void MinimizeWithTargetAndConstraints()\n        {\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                Criterion = new Target(\"Profit\", new Minimization(), 20),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 3)\n                },\n                Constraints = new List<Constraint>\n                {\n                    new Constraint(\"Drawdown\", ComparisonOperatorTypes.LessOrEqual, 0.15m)\n                },\n                MaximumConcurrentBacktests = 20\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n\n            OptimizationResult result = null;\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n            Assert.NotNull(result);\n            Assert.GreaterOrEqual(\n                20,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Profit);\n            Assert.GreaterOrEqual(\n                0.15m,\n                JsonConvert.DeserializeObject<BacktestResult>(result.JsonBacktestResult).Statistics.Drawdown);\n\n        }\n\n        [Test]\n        public void TrackEstimation()\n        {\n            Config.Set(\"optimization-update-interval\", 1);\n            OptimizationResult result = null;\n            using var resetEvent = new ManualResetEvent(false);\n            var packet = new OptimizationNodePacket\n            {\n                Criterion = new Target(\"Profit\", new Minimization(), null),\n                OptimizationParameters = new HashSet<OptimizationParameter>\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 10, 1),\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 10)\n                },\n                Constraints = new List<Constraint>\n                {\n                    new Constraint(\"Drawdown\", ComparisonOperatorTypes.LessOrEqual, 0.15m)\n                },\n                MaximumConcurrentBacktests = 5\n            };\n            using var optimizer = new FakeLeanOptimizer(packet);\n            // keep stats up-to-date\n            int totalBacktest = optimizer.GetCurrentEstimate();\n            int totalUpdates = 0;\n            int completedTests = 0;\n            int failed = 0;\n            optimizer.Update += (s, e) =>\n            {\n                var runtimeStats = optimizer.GetRuntimeStatistics();\n                Assert.LessOrEqual(int.Parse(runtimeStats[\"Running\"], CultureInfo.InvariantCulture), packet.MaximumConcurrentBacktests);\n                Assert.LessOrEqual(completedTests, int.Parse(runtimeStats[\"Completed\"], CultureInfo.InvariantCulture));\n                Assert.LessOrEqual(failed, int.Parse(runtimeStats[\"Failed\"], CultureInfo.InvariantCulture));\n\n                Assert.AreEqual(totalBacktest, optimizer.GetCurrentEstimate());\n\n                completedTests = int.Parse(runtimeStats[\"Completed\"], CultureInfo.InvariantCulture);\n                failed = int.Parse(runtimeStats[\"Failed\"], CultureInfo.InvariantCulture);\n\n                if (completedTests > 0)\n                {\n                    // 'ms' aren't stored so might be 0\n                    Assert.GreaterOrEqual(TimeSpan.Parse(runtimeStats[\"Average Length\"], CultureInfo.InvariantCulture), TimeSpan.Zero);\n                }\n\n                totalUpdates++;\n            };\n            optimizer.Ended += (s, solution) =>\n            {\n                result = solution;\n                optimizer.DisposeSafely();\n                resetEvent.Set();\n            };\n\n            optimizer.Start();\n\n            resetEvent.WaitOne();\n\n            var runtimeStatistics = optimizer.GetRuntimeStatistics();\n            Assert.NotZero(int.Parse(runtimeStatistics[\"Completed\"], CultureInfo.InvariantCulture));\n            Assert.NotZero(int.Parse(runtimeStatistics[\"Failed\"], CultureInfo.InvariantCulture));\n            // we have 2 force updates at least, expect a few more over it.\n            Assert.Greater(totalUpdates, 2);\n            Assert.AreEqual(int.Parse(runtimeStatistics[\"Completed\"], CultureInfo.InvariantCulture)\n                            + int.Parse(runtimeStatistics[\"Failed\"], CultureInfo.InvariantCulture)\n                            + int.Parse(runtimeStatistics[\"Running\"], CultureInfo.InvariantCulture), totalBacktest);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Models.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing System.Globalization;\n\nnamespace QuantConnect.Tests.Optimizer\n{\n    internal class BacktestResult\n    {\n        private static JsonSerializerSettings _jsonSettings = new JsonSerializerSettings { Culture = CultureInfo.InvariantCulture, NullValueHandling = NullValueHandling.Ignore};\n        public Statistics Statistics { get; set; }\n\n        public static BacktestResult Create(decimal? profit = null, decimal? drawdown = null)\n        {\n            return new BacktestResult\n            {\n                Statistics = new Statistics\n                {\n                    Profit = profit,\n                    Drawdown = drawdown\n                }\n            };\n        }\n\n        public string ToJson() => JsonConvert.SerializeObject(this, _jsonSettings);\n    }\n\n    public class Statistics\n    {\n        public decimal? Profit { get; set; }\n\n        public decimal? Drawdown { get; set; }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Objectives/ConstraintTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Util;\nusing System;\n\nnamespace QuantConnect.Tests.Optimizer.Objectives\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ConstraintTests\n    {\n        [TestCase(101.0)]\n        [TestCase(1000.0)]\n        public void Meet(decimal value)\n        {\n            var constraint = new Constraint(\"Profit\", ComparisonOperatorTypes.Greater, 100m);\n            Assert.IsTrue(constraint.IsMet(BacktestResult.Create(value).ToJson()));\n        }\n\n        [TestCase(1.0)]\n        [TestCase(99.9)]\n        [TestCase(100d)]\n        public void Fails(decimal value)\n        {\n            var constraint = new Constraint(\"Profit\", ComparisonOperatorTypes.Greater, 100m);\n            Assert.IsFalse(constraint.IsMet(BacktestResult.Create(value).ToJson()));\n        }\n\n        [Test]\n        public void ThrowIfTargetNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var constraint = new Constraint(\"Drawdown\", ComparisonOperatorTypes.Less, null);\n            });\n        }\n\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void ThrowIfResultNullOrEmpty(string json)\n        {\n            var constraint = new Constraint(\"Drawdown\", ComparisonOperatorTypes.Less, 10);\n\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                constraint.IsMet(json);\n            });\n        }\n\n        [Test]\n        public void IgnoreBadJson()\n        {\n            var constraint = new Constraint(\"Drawdown\", ComparisonOperatorTypes.Less, 0.1m);\n\n            Assert.IsFalse(constraint.IsMet(\"{\\\"Drawdown\\\":\\\"10.0%\\\"}\"));\n        }\n\n        [TestCase(\"Drawdown\")]\n        [TestCase(\"Statistics.Drawdown\")]\n        [TestCase(\"['Statistics'].['Drawdown']\")]\n        public void ParseName(string targetName)\n        {\n            var target = new Constraint(targetName, ComparisonOperatorTypes.Equals, 100);\n\n            Assert.AreEqual(\"['Statistics'].['Drawdown']\", target.Target);\n        }\n\n        [Test]\n        public void FromJson()\n        {\n            var json = \"{\\\"operator\\\": \\\"equals\\\",\\\"target\\\": \\\"pin ocho.Gepetto\\\",\\\"targetValue\\\": 11}\";\n\n            var constraint = (Constraint)JsonConvert.DeserializeObject(json, typeof(Constraint));\n\n            Assert.AreEqual(\"['pin ocho'].['Gepetto']\", constraint.Target);\n            Assert.AreEqual(ComparisonOperatorTypes.Equals, constraint.Operator);\n            Assert.AreEqual(11, constraint.TargetValue.Value);\n        }\n\n        [Test]\n        public void RoundTrip()\n        {\n            var origin =  new Constraint(\"['Statistics'].['Drawdown']\", ComparisonOperatorTypes.Equals, 100);\n            \n            var json = JsonConvert.SerializeObject(origin);\n            var actual = JsonConvert.DeserializeObject<Constraint>(json);\n            \n            Assert.NotNull(actual);\n            Assert.AreEqual(origin.Target, actual.Target);\n            Assert.AreEqual(origin.Operator, actual.Operator);\n            Assert.AreEqual(origin.TargetValue, actual.TargetValue);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Objectives/ExtremumTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n\nusing NUnit.Framework;\nusing QuantConnect.Optimizer.Objectives;\nusing System;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Tests.Optimizer.Objectives\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class ExtremumTests\n    {\n        private static TestCaseData[] Extremums => new TestCaseData[]\n        {\n            new TestCaseData(new Maximization()),\n            new TestCaseData(new Minimization())\n        };\n\n\n        [TestCase(\"\\\"max\\\"\")]\n        [TestCase(\"\\\"min\\\"\")]\n        [TestCase(\"\\\"Max\\\"\")]\n        [TestCase(\"\\\"miN\\\"\")]\n        public void Deserialize(string extremum)\n        {\n            var actual = JsonConvert.DeserializeObject<Extremum>(extremum);\n            Extremum expected = extremum.Equals(\"\\\"max\\\"\", StringComparison.OrdinalIgnoreCase)\n                ? new Maximization() as Extremum\n                : new Minimization();\n\n            Assert.NotNull(actual);\n            Assert.AreEqual(expected.GetType(), actual.GetType());\n        }\n\n        [TestCase(\"\\\"\\\"\")]\n        [TestCase(\"\\\"n/a\\\"\")]\n        public void ThrowsIfNotRecognized(string extremum)\n        {\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                JsonConvert.DeserializeObject<Extremum>(extremum);\n            });\n        }\n\n        [Test, TestCaseSource(nameof(Extremums))]\n        public void Serialize(Extremum extremum)\n        {\n            var json = JsonConvert.SerializeObject(extremum);\n\n            var actual = JsonConvert.DeserializeObject<Extremum>(json);\n            Assert.NotNull(actual);\n            Assert.AreEqual(extremum.GetType(), actual.GetType());\n        }\n\n        [TestCase(0, 10)]\n        [TestCase(10, 10)]\n        [TestCase(10, 0)]\n        public void Linear(decimal current, decimal candidate)\n        {\n            Func<decimal, decimal, bool> comparer = (a, b) => a <= b;\n            var strategy = new Extremum(comparer);\n\n            Assert.AreEqual(comparer(current, candidate), strategy.Better(current, candidate));\n        }\n\n        [TestCase(101, 10)]\n        [TestCase(100, 10)]\n        [TestCase(99, 10)]\n        public void NonLinear(decimal current, decimal candidate)\n        {\n            Func<decimal, decimal, bool> comparer = (a, b) => a >= b * b;\n            var strategy = new Extremum(comparer);\n\n            Assert.AreEqual(comparer(current, candidate), strategy.Better(current, candidate));\n        }\n\n        [TestFixture]\n        public class MaximizationTests\n        {\n            Maximization _strategy = new Maximization();\n\n            [Test]\n            public void Greater()\n            {\n                Assert.IsTrue(_strategy.Better(0, 10));\n            }\n\n            [TestCase(10, 10)]\n            [TestCase(10, 0)]\n            public void LessThanOrEqual(decimal current, decimal candidate)\n            {\n                Assert.IsFalse(_strategy.Better(current, candidate));\n            }\n        }\n\n        [TestFixture]\n        public class MinimizationTests\n        {\n            Minimization _strategy = new Minimization();\n\n            [Test]\n            public void Less()\n            {\n                Assert.IsTrue(_strategy.Better(10, 0));\n            }\n\n            [TestCase(10, 10)]\n            [TestCase(0, 10)]\n            public void GreatThanOrEqual(decimal current, decimal candidate)\n            {\n                Assert.IsFalse(_strategy.Better(current, candidate));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Objectives/TargetTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Optimizer.Objectives;\nusing System;\n\nnamespace QuantConnect.Tests.Optimizer.Objectives\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class TargetTests\n    {\n        [Test]\n        public void MoveAheadNoTarget()\n        {\n            var target = new Target(\"Profit\", new Maximization(), null);\n            Assert.IsTrue(target.MoveAhead(BacktestResult.Create(profit: 10m).ToJson()));\n            Assert.AreEqual(10m, target.Current);\n            Assert.IsFalse(target.MoveAhead(BacktestResult.Create(profit: 5m).ToJson()));\n            Assert.AreEqual(10m, target.Current);\n            Assert.IsTrue(target.MoveAhead(BacktestResult.Create(profit: 15m).ToJson()));\n            Assert.AreEqual(15m, target.Current);\n        }\n\n        [Test]\n        public void MoveAheadReachFirst()\n        {\n            var target = new Target(\"Profit\", new Minimization(), 100);\n            bool reached = false;\n            target.Reached += (s, e) =>\n            {\n                reached = true;\n            };\n\n            Assert.IsTrue(target.MoveAhead(BacktestResult.Create(profit: 10m).ToJson()));\n            target.CheckCompliance();\n\n            Assert.AreEqual(10m, target.Current);\n            Assert.IsTrue(reached);\n        }\n\n        [Test]\n        public void MoveAheadReachLast()\n        {\n            var target = new Target(\"Profit\", new Minimization(), 100);\n            bool reached = false;\n            target.Reached += (s, e) =>\n            {\n                reached = true;\n            };\n\n            for (var profit = 500m; profit > 0; profit -= 50)\n            {\n                Assert.IsTrue(target.MoveAhead(BacktestResult.Create(profit: profit).ToJson()));\n                Assert.AreEqual(profit, target.Current);\n                target.CheckCompliance();\n            }\n            \n            Assert.IsTrue(reached);\n        }\n\n        [TestCase(\"\")]\n        [TestCase(null)]\n        public void ThrowIfNullOrEmpty(string json)\n        {\n            var target = new Target(\"Profit\", new Maximization(), null);\n\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                target.MoveAhead(json);\n            });\n        }\n\n        [Test]\n        public void IgnoreBadJson()\n        {\n            var target = new Target(\"Profit\", new Maximization(), null);\n            \n            Assert.IsFalse(target.MoveAhead(\"{\\\"Profit\\\":10}\"));\n            Assert.AreEqual(null, target.Current);\n        }\n\n        [TestCase(\"Sharpe Ratio\")]\n        [TestCase(\"Statistics.Sharpe Ratio\")]\n        [TestCase(\"['Statistics'].['Sharpe Ratio']\")]\n        public void ParseTargetName(string targetName)\n        {\n            var target = new Target(targetName, new Minimization(), 100);\n\n            Assert.AreEqual(\"['Statistics'].['Sharpe Ratio']\", target.Target);\n        }\n\n        [TestCase(\"null\")]\n        [TestCase(\"11\")]\n        public void FromJson(string value)\n        {\n            var json = $\"{{\\\"extremum\\\": \\\"max\\\",\\\"target\\\": \\\"pin ocho.Gepetto\\\",\\\"targetValue\\\": {value}}}\";\n\n            var target = (Target)JsonConvert.DeserializeObject(json, typeof(Target));\n\n            Assert.AreEqual(\"['pin ocho'].['Gepetto']\", target.Target);\n            Assert.AreEqual(typeof(Maximization), target.Extremum.GetType());\n\n            if (value == \"null\")\n            {\n                Assert.IsNull(target.TargetValue);\n            }\n            else\n            {\n                Assert.AreEqual(11, target.TargetValue);\n            }\n        }\n\n        [Test]\n        public void RoundTrip()\n        {\n            var origin = new Target(\"['Statistics'].['Drawdown']\", new Maximization(), 100);\n\n            var json = JsonConvert.SerializeObject(origin);\n            var actual = JsonConvert.DeserializeObject<Target>(json);\n\n            Assert.NotNull(actual);\n            Assert.AreEqual(origin.Target, actual.Target);\n            Assert.AreEqual(origin.Extremum.GetType(), actual.Extremum.GetType());\n            Assert.AreEqual(origin.TargetValue, actual.TargetValue);\n        }\n\n        [TestCase(\"['TotalPerformance'].['TradeStatistics'].['ProfitToMaxDrawdownRatio']\", \"-1\")]\n        [TestCase(\"['totalPerformance'].['tradeStatistics'].['profitToMaxDrawdownRatio']\", \"-1\")]\n        [TestCase(\"['TotalPerformance'].['TradeStatistics'].['lossRate']\", \"1\")]\n        [TestCase(\"['totalPerformance'].['tradeStatistics'].['lossRate']\", \"1\")]\n        [TestCase(\"['Statistics'].['Start Equity']\", \"100000\")]\n        [TestCase(\"['statistics'].['start equity']\", \"100000\")]\n        [TestCase(\"['Statistics'].['Sharpe Ratio']\", \"-5.283\")]\n        [TestCase(\"['statistics'].['sharpe ratio']\", \"-5.283\")]\n        [TestCase(\"['Statistics'].['Sharp Ratio']\", null)]\n        [TestCase(\"['statistics'].['sharp ratio']\", null)]\n        public void TargetMoveAheadIsCaseInsensitive(string target, string expected)\n        {\n            Assert.AreEqual(expected, (Target.GetTokenInJsonBacktest(jsonBacktestResultExample, target))?.Value<string>());\n        }\n\n        private string jsonBacktestResultExample = @\"{\n\t\"\"totalPerformance\"\": {\n\t\t\"\"tradeStatistics\"\": {\n\t\t\t\"\"lossRate\"\": \"\"1\"\",\n\t\t\t\"\"profitToMaxDrawdownRatio\"\": \"\"-1\"\",\n\t\t}\n\t},\n\t\"\"statistics\"\": {\n\t\t\"\"Start Equity\"\": \"\"100000\"\",\n\t\t\"\"Sharpe Ratio\"\": \"\"-5.283\"\",\n\t}\n}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/OptimizationNodePacketTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Strategies;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.Optimizer\n{\n    [TestFixture, Parallelizable(ParallelScope.All)]\n    public class OptimizationNodePacketTest\n    {\n        private static JsonSerializerSettings _jsonSettings = new JsonSerializerSettings() { Culture = CultureInfo.InvariantCulture };\n\n        [TestCase(\"QuantConnect.Optimizer.EulerSearchOptimizationStrategy\", typeof(StepBaseOptimizationStrategySettings))]\n        [TestCase(\"QuantConnect.Optimizer.GridSearchOptimizationStrategy\", typeof(OptimizationStrategySettings))]\n        public void RoundTrip(string strategyName, Type settingType)\n        {\n            var optimizationNodePacket = new OptimizationNodePacket()\n            {\n                CompileId = Guid.NewGuid().ToString(),\n                OptimizationId = Guid.NewGuid().ToString(),\n                OptimizationStrategy = strategyName,\n                Criterion = new Target(\"Profit\", new Maximization(), 100.5m),\n                Constraints = new List<Constraint>\n                {\n                    new Constraint(\"Drawdown\", ComparisonOperatorTypes.LessOrEqual, 0.1m),\n                    new Constraint(\"Profit\", ComparisonOperatorTypes.Greater, 100)\n                },\n                OptimizationParameters = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-slow\", 1, 100, 1m),\n                    new OptimizationStepParameter(\"ema-fast\", -10, 0, 0.5m),\n                    new StaticOptimizationParameter(\"pinocho\", \"11\")\n                },\n                MaximumConcurrentBacktests = 10,\n                OptimizationStrategySettings = (OptimizationStrategySettings)Activator.CreateInstance(settingType)\n            };\n            var serialize = JsonConvert.SerializeObject(optimizationNodePacket, _jsonSettings);\n            var result = JsonConvert.DeserializeObject<OptimizationNodePacket>(serialize, _jsonSettings);\n\n            // common\n            Assert.AreEqual(PacketType.OptimizationNode, result.Type);\n\n            // assert strategy\n            Assert.AreEqual(optimizationNodePacket.OptimizationStrategy, result.OptimizationStrategy);\n            Assert.AreEqual(optimizationNodePacket.OptimizationId, result.OptimizationId);\n            Assert.AreEqual(optimizationNodePacket.CompileId, result.CompileId);\n\n            // assert optimization parameters\n            foreach (var expected in optimizationNodePacket.OptimizationParameters.OfType<OptimizationStepParameter>())\n            {\n                var actual = result.OptimizationParameters.FirstOrDefault(s => s.Name == expected.Name) as OptimizationStepParameter;\n                Assert.NotNull(actual);\n                Assert.AreEqual(expected.MinValue, actual.MinValue);\n                Assert.AreEqual(expected.MaxValue, actual.MaxValue);\n                Assert.AreEqual(expected.Step, actual.Step);\n            }\n\n            // assert optimization parameters\n            var staticOptimizationParameters = optimizationNodePacket.OptimizationParameters.OfType<StaticOptimizationParameter>().ToList();\n            Assert.AreEqual(1, staticOptimizationParameters.Count);\n            foreach (var parameter in staticOptimizationParameters)\n            {\n                Assert.AreEqual(\"11\", parameter.Value);\n                Assert.AreEqual(\"pinocho\", parameter.Name);\n            }\n\n            // assert target\n            Assert.AreEqual(optimizationNodePacket.Criterion.Target, result.Criterion.Target);\n            Assert.AreEqual(optimizationNodePacket.Criterion.Extremum.GetType(), result.Criterion.Extremum.GetType());\n            Assert.AreEqual(optimizationNodePacket.Criterion.TargetValue, result.Criterion.TargetValue);\n\n            // assert constraints\n            foreach (var expected in optimizationNodePacket.Constraints)\n            {\n                var actual = result.Constraints.FirstOrDefault(s => s.Target == expected.Target);\n                Assert.NotNull(actual);\n                Assert.AreEqual(expected.Operator, actual.Operator);\n                Assert.AreEqual(expected.TargetValue, actual.TargetValue);\n            }\n\n            // others\n            Assert.AreEqual(optimizationNodePacket.MaximumConcurrentBacktests, result.MaximumConcurrentBacktests);\n            Assert.AreEqual(settingType, result.OptimizationStrategySettings.GetType());\n        }\n\n        [TestCase(\"StepBaseOptimizationStrategySettings\", \"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"targetValue\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"targetValue\\\": 11}],\" +\n                       $\"\\\"optimizationStrategySettings\\\":{{\\\"$type\\\":\\\"QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategySettings, QuantConnect.Optimizer\\\",\\\"default-segment-amount\\\":0,\\\"max-run-time\\\":\\\"10675199.02:48:05.4775807\\\"}}}}\")]\n        [TestCase(\"OptimizationStrategySettings\", \"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"targetValue\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"targetValue\\\": 11}],\" +\n                       $\"\\\"optimizationStrategySettings\\\":{{\\\"$type\\\":\\\"QuantConnect.Optimizer.Strategies.OptimizationStrategySettings, QuantConnect.Optimizer\\\",\\\"default-segment-amount\\\":0,\\\"max-run-time\\\":\\\"10675199.02:48:05.4775807\\\"}}}}\")]\n        [TestCase(\"StepBaseOptimizationStrategySettings\", \"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"target-value\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"target-value\\\": 11}],\" +\n                       $\"\\\"optimizationStrategySettings\\\":{{\\\"$type\\\":\\\"QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategySettings, QuantConnect.Optimizer\\\",\\\"default-segment-amount\\\":0,\\\"max-run-time\\\":\\\"10675199.02:48:05.4775807\\\"}}}}\")]\n        [TestCase(\"OptimizationStrategySettings\", \"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"target-value\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"target-value\\\": 11}],\" +\n                       $\"\\\"optimizationStrategySettings\\\":{{\\\"$type\\\":\\\"QuantConnect.Optimizer.Strategies.OptimizationStrategySettings, QuantConnect.Optimizer\\\",\\\"default-segment-amount\\\":0,\\\"max-run-time\\\":\\\"10675199.02:48:05.4775807\\\"}}}}\")]\n        public void FromJson(string settingTypeName ,string json)\n        {\n            var packet = (OptimizationNodePacket)JsonConvert.DeserializeObject(json, typeof(OptimizationNodePacket));\n\n            Assert.AreEqual(\"['Statistics'].['Sharpe Ratio']\", packet.Criterion.Target);\n            Assert.AreEqual(typeof(Minimization), packet.Criterion.Extremum.GetType());\n            Assert.AreEqual(2, packet.OptimizationParameters.Count);\n            Assert.AreEqual(1, packet.Constraints.Count);\n            Assert.AreEqual(\"['Statistics'].['Sharpe Ratio']\", packet.Constraints.Single().Target);\n            Assert.AreEqual(settingTypeName, packet.OptimizationStrategySettings.GetType().Name);\n        }\n\n        [TestCase(\"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"targetValue\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"targetValue\\\": 11}]}\")]\n        [TestCase(\"{\\\"OptimizationParameters\\\": [{\\\"Name\\\":\\\"sleep-ms\\\",\\\"min\\\":0,\\\"max\\\":0,\\\"Step\\\":1},\" +\n                       \"{\\\"Name\\\":\\\"total-trades\\\",\\\"min\\\":0,\\\"max\\\":2,\\\"Step\\\":1}],\" +\n                       \"\\\"criterion\\\": {\\\"extremum\\\" : \\\"min\\\",\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"target-value\\\": 10},\" +\n                       \"\\\"constraints\\\": [{\\\"target\\\": \\\"Statistics.Sharpe Ratio\\\",\\\"operator\\\": \\\"equals\\\",\\\"target-value\\\": 11}]}\")]\n        public void FromJsonNoSettings(string json)\n        {\n            var packet = (OptimizationNodePacket)JsonConvert.DeserializeObject(json, typeof(OptimizationNodePacket));\n\n            Assert.AreEqual(\"['Statistics'].['Sharpe Ratio']\", packet.Criterion.Target);\n            Assert.AreEqual(typeof(Minimization), packet.Criterion.Extremum.GetType());\n            Assert.AreEqual(2, packet.OptimizationParameters.Count);\n            Assert.AreEqual(1, packet.Constraints.Count);\n            Assert.AreEqual(\"['Statistics'].['Sharpe Ratio']\", packet.Constraints.Single().Target);\n            Assert.IsNull(packet.OptimizationStrategySettings);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Parameters/OptimizationParameterEnumeratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Optimizer.Parameters;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Optimizer.Parameters\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OptimizationParameterEnumeratorTests\n    {\n        private static TestCaseData[] OptimizationParameters => new[]\n        {\n            new TestCaseData(new OptimizationStepParameter(\"ema-fast\", -100, 0, 1m)),\n            new TestCaseData(new OptimizationStepParameter(\"ema-slow\", 100, 1000, 10m))\n        };\n\n        [Test, TestCaseSource(nameof(OptimizationParameters))]\n        public void NotIEnumerable(OptimizationParameter optimizationParameter)\n        {\n            Assert.IsNotInstanceOf<IEnumerable<string>>(optimizationParameter);\n        }\n\n        [TestFixture]\n        public class StepParameter\n        {\n            private static TestCaseData[] OptimizationParameters => new[]\n            {\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", -100, 0, 1m)),\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", -10, 10, 0.1m)),\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", 1, 100, 1m)),\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", 100, 100, 0.5m))\n            };\n\n            [Test, TestCaseSource(nameof(OptimizationParameters))]\n            public void Enumerate(OptimizationStepParameter optimizationParameter)\n            {\n                using var enumerator = new OptimizationStepParameterEnumerator(optimizationParameter);\n                int total = 0;\n\n                for (decimal value = optimizationParameter.MinValue; value <= optimizationParameter.MaxValue; value += optimizationParameter.Step.Value)\n                {\n                    total++;\n                    Assert.IsTrue(enumerator.MoveNext());\n                    Assert.AreEqual(value, enumerator.Current.ToDecimal());\n                }\n\n                Assert.AreEqual(Math.Floor((optimizationParameter.MaxValue - optimizationParameter.MinValue) / optimizationParameter.Step.Value) + 1, total);\n                Assert.IsFalse(enumerator.MoveNext());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Parameters/OptimizationParameterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\n\nusing System;\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Optimizer.Parameters;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json.Serialization;\n\nnamespace QuantConnect.Tests.Optimizer.Parameters\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class OptimizationParameterTests\n    {\n        [TestFixture]\n        public class StepParameter\n        {\n            private static TestCaseData[] OptimizationParameters => new[]\n            {\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", 1, 100, 1m)),\n                new TestCaseData(new OptimizationStepParameter(\"ema-fast\", 1, 100, 1m, 0.0005m))\n            };\n\n            [TestCase(5)]\n            [TestCase(0.5)]\n            public void StepShouldBePositiveAlways(double step)\n            {\n                var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100, new decimal(step));\n\n                Assert.NotNull(optimizationParameter.Step);\n                Assert.Positive(optimizationParameter.Step.Value);\n                Assert.AreEqual(optimizationParameter.Step, optimizationParameter.MinStep);\n                Assert.AreEqual(Math.Abs(step), optimizationParameter.Step);\n            }\n\n            [TestCase(-5)]\n            [TestCase(-0.5)]\n            [TestCase(0)]\n            public void ThrowIfStepIsNegativeOrZero(double step)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100, new decimal(step));\n                });\n            }\n\n            [TestCase(1, 0.1)]\n            [TestCase(5, 5)]\n            public void StepShouldBeGreatOrEqualThanMinStep(decimal step, decimal minStep)\n            {\n                var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100, step, minStep);\n\n                var actual = Math.Max(Math.Abs(step), Math.Abs(minStep));\n                Assert.AreEqual(actual, optimizationParameter.Step);\n            }\n\n            [TestCase(5, 10)]\n            [TestCase(0.1, 0.2)]\n            public void ThrowsIfStepLessThanMinStep(decimal step, decimal minStep)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100, step, minStep);\n                });\n            }\n\n            [TestCase(0, 0)]\n            [TestCase(0.5, 0)]\n            [TestCase(0, 2)]\n            public void PreventZero(decimal step, decimal minStep)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100, step, minStep);\n                });\n            }\n\n            [Test, TestCaseSource(nameof(OptimizationParameters))]\n            public void Serialize(OptimizationStepParameter parameterSet)\n            {\n                var json = JsonConvert.SerializeObject(parameterSet);\n                var optimizationParameter = JsonConvert.DeserializeObject<OptimizationParameter>(json) as OptimizationStepParameter;\n\n                Assert.NotNull(optimizationParameter);\n                Assert.AreEqual(parameterSet.Name, optimizationParameter.Name);\n                Assert.AreEqual(parameterSet.MinValue, optimizationParameter.MinValue);\n                Assert.AreEqual(parameterSet.MaxValue, optimizationParameter.MaxValue);\n                Assert.AreEqual(parameterSet.Step, optimizationParameter.Step);\n                Assert.AreEqual(parameterSet.MinStep, optimizationParameter.MinStep);\n            }\n\n            [Test, TestCaseSource(nameof(OptimizationParameters))]\n            public void SerializeCollection(OptimizationStepParameter parameterSet)\n            {\n                var json = JsonConvert.SerializeObject(new[] { parameterSet as OptimizationParameter });\n                var optimizationParameters = JsonConvert.DeserializeObject<List<OptimizationParameter>>(json);\n\n                Assert.AreEqual(1, optimizationParameters.Count);\n\n                var parsed = optimizationParameters[0] as OptimizationStepParameter;\n                Assert.NotNull(parsed);\n                Assert.AreEqual(parameterSet.Name, parsed.Name);\n                Assert.AreEqual(parameterSet.MinValue, parsed.MinValue);\n                Assert.AreEqual(parameterSet.MaxValue, parsed.MaxValue);\n                Assert.AreEqual(parameterSet.Step, parsed.Step);\n                Assert.AreEqual(parameterSet.MinStep, parsed.MinStep);\n            }\n\n            [Test]\n            public void StaticParameterRoundTripSerialization()\n            {\n                var expected = \"{\\\"value\\\":\\\"50.0\\\",\\\"name\\\":\\\"ema-fast\\\"}\";\n\n                var staticParameter = JsonConvert.DeserializeObject<StaticOptimizationParameter>(expected);\n\n                Assert.IsNotNull(staticParameter);\n                Assert.AreEqual(\"50.0\", staticParameter.Value);\n                Assert.AreEqual(\"ema-fast\", staticParameter.Name);\n\n                var serialized = JsonConvert.SerializeObject(staticParameter, new JsonSerializerSettings()\n                {\n                    ContractResolver = new DefaultContractResolver\n                    {\n                        NamingStrategy = new CamelCaseNamingStrategy\n                        {\n                            ProcessDictionaryKeys = false,\n                            OverrideSpecifiedNames = true\n                        }\n                    }\n                });\n\n                Assert.AreEqual(expected, serialized);\n            }\n\n            [Test]\n            public void DeserializeSingle()\n            {\n                var json = @\"\n                    {\n                        \"\"name\"\":\"\"ema-fast\"\",\n                        \"\"min\"\": 50,\n                        \"\"max\"\": 150,\n                        \"\"step\"\": 50,\n                    }\";\n\n                var optimizationParameter = JsonConvert.DeserializeObject<OptimizationParameter>(json) as OptimizationStepParameter;\n\n                Assert.NotNull(optimizationParameter);\n                Assert.AreEqual(\"ema-fast\", optimizationParameter.Name);\n                Assert.AreEqual(50, optimizationParameter.MinValue);\n                Assert.AreEqual(150, optimizationParameter.MaxValue);\n                Assert.AreEqual(50, optimizationParameter.Step);\n                Assert.AreEqual(50, optimizationParameter.MinStep);\n            }\n\n            [Test]\n            public void DeserializeSingleCaseInsensitive()\n            {\n                var json = @\"\n                    {\n                        \"\"Name\"\":\"\"ema-fast\"\",\n                        \"\"mIn\"\": 50,\n                        \"\"maX\"\": 150,\n                        \"\"STEP\"\": 50,\n                    }\";\n\n                var optimizationParameter = JsonConvert.DeserializeObject<OptimizationParameter>(json) as OptimizationStepParameter;\n\n                Assert.NotNull(optimizationParameter);\n                Assert.AreEqual(\"ema-fast\", optimizationParameter.Name);\n                Assert.AreEqual(50, optimizationParameter.MinValue);\n                Assert.AreEqual(150, optimizationParameter.MaxValue);\n                Assert.AreEqual(50, optimizationParameter.Step);\n            }\n\n            [Test]\n            public void DeserializeSingleWithOptional()\n            {\n                var json = @\"\n                    {\n                        \"\"name\"\":\"\"ema-fast\"\",\n                        \"\"min\"\": 50,\n                        \"\"max\"\": 150,\n                        \"\"step\"\": 50,\n                        \"\"min-step\"\": 0.001\n                    }\";\n\n                var optimizationParameter = JsonConvert.DeserializeObject<OptimizationParameter>(json) as OptimizationStepParameter;\n\n                Assert.NotNull(optimizationParameter);\n                Assert.AreEqual(\"ema-fast\", optimizationParameter.Name);\n                Assert.AreEqual(50, optimizationParameter.MinValue);\n                Assert.AreEqual(150, optimizationParameter.MaxValue);\n                Assert.AreEqual(50, optimizationParameter.Step);\n                Assert.AreEqual(0.001, optimizationParameter.MinStep);\n            }\n\n            [Test]\n            public void DeserializeCollection()\n            {\n                var json = @\"[\n                    {\n                        \"\"name\"\":\"\"ema-fast\"\",\n                        \"\"min\"\": 50,\n                        \"\"max\"\": 150,\n                        \"\"step\"\": 50,\n                    },{\n                        \"\"name\"\":\"\"ema-slow\"\",\n                        \"\"min\"\": 50,\n                        \"\"max\"\": 250,\n                        \"\"step\"\": 10,\n                    }]\";\n\n                var optimizationParameters = JsonConvert.DeserializeObject<List<OptimizationParameter>>(json)\n                    .OfType<OptimizationStepParameter>()\n                    .ToList();\n\n                Assert.AreEqual(2, optimizationParameters.Count);\n\n                Assert.AreEqual(\"ema-fast\", optimizationParameters[0].Name);\n                Assert.AreEqual(50, optimizationParameters[0].MinValue);\n                Assert.AreEqual(150, optimizationParameters[0].MaxValue);\n                Assert.AreEqual(50, optimizationParameters[0].Step);\n                Assert.AreEqual(\"ema-slow\", optimizationParameters[1].Name);\n                Assert.AreEqual(50, optimizationParameters[1].MinValue);\n                Assert.AreEqual(250, optimizationParameters[1].MaxValue);\n                Assert.AreEqual(10, optimizationParameters[1].Step);\n            }\n\n            [Test]\n            public void ThrowIfNotStepParameter()\n            {\n                var json = @\"\n                    {\n                        \"\"name\"\":\"\"ema-fast\"\",\n                        \"\"values\"\": [\"\"a\"\",\"\"b\"\",\"\"c\"\",\"\"d\"\"]\n                    }\";\n\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    JsonConvert.DeserializeObject<OptimizationParameter>(json);\n                });\n            }\n\n            [TestCase(-1, -10, -1)]\n            [TestCase(10, 1, 1)]\n            public void ThrowIfMinGreatThanMax(decimal min, decimal max, decimal step)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                {\n                    var param = new OptimizationStepParameter(\"ema-fast\", min, max, step);\n                });\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Strategies/EulerSearchOptimizationStrategyTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Optimizer.Strategies\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class EulerSearchOptimizationStrategyTests : OptimizationStrategyTests\n    {\n        [TestFixture]\n        public class EulerSearchTests\n        {\n            private EulerSearchOptimizationStrategy _strategy;\n\n            [SetUp]\n            public void Init()\n            {\n                this._strategy = new EulerSearchOptimizationStrategy();\n            }\n\n            [TestCase(10)]\n            [TestCase(5)]\n            [TestCase(2)]\n            public void Depth(int _defaultSegmentAmount)\n            {\n                var param = new OptimizationStepParameter(\"ema-fast\", 10, 100, 10, 0.1m);\n                var set = new HashSet<OptimizationParameter> { param, new StaticOptimizationParameter(\"pepe\", \"pipi\") };\n                _strategy.Initialize(\n                    new Target(\"Profit\", new Maximization(), null),\n                    new List<Constraint>(),\n                    set,\n                    new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = _defaultSegmentAmount });\n                Queue<OptimizationResult> _pendingOptimizationResults = new Queue<OptimizationResult>();\n                int depth = -1;\n                _strategy.NewParameterSet += (s, parameterSet) =>\n                    {\n                        if (_pendingOptimizationResults.Count == 0)\n                        {\n                            depth++;\n                        }\n\n                        _pendingOptimizationResults.Enqueue(new OptimizationResult(_stringify(_profit(parameterSet), _drawdown(parameterSet)), parameterSet, \"\"));\n                    };\n\n                _strategy.PushNewResults(OptimizationResult.Initial);\n\n                while (_pendingOptimizationResults.TryDequeue(out var item))\n                {\n                    _strategy.PushNewResults(item);\n                }\n\n                Assert.AreEqual(Math.Ceiling(Math.Log((double)(param.Step / param.MinStep), _defaultSegmentAmount)), depth);\n            }\n\n            [Test]\n            public void ThrowIfNoSettingsPassed()\n            {\n                Assert.Throws<ArgumentNullException>(() =>\n                {\n                    _strategy.Initialize(\n                        new Target(\"Profit\", new Maximization(), null),\n                        new List<Constraint>(),\n                        new HashSet<OptimizationParameter>\n                        {\n                            new OptimizationStepParameter(\"ema-fast\", 10, 100, 10, 0.1m),\n                            new StaticOptimizationParameter(\"pepe\", \"pipi\")\n                        },\n                        null);\n                });\n            }\n\n            [TestCase(5)]\n            [TestCase(10)]\n            public void Reduce(int amountOfSegments)\n            {\n                var param = new OptimizationStepParameter(\"ema-fast\", 10, 100, 10, 0.1m);\n                var set = new HashSet<OptimizationParameter> { param, new StaticOptimizationParameter(\"pepe\", \"pipi\") };\n                _strategy.Initialize(\n                    new Target(\"Profit\", new Maximization(), null),\n                    new List<Constraint>(),\n                    set,\n                    new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = amountOfSegments });\n                Queue<OptimizationResult> pendingOptimizationResults = new Queue<OptimizationResult>();\n                int depth = -1;\n                _strategy.NewParameterSet += (s, parameterSet) =>\n                {\n                    if (pendingOptimizationResults.Count == 0)\n                    {\n                        depth++;\n                    }\n\n                    pendingOptimizationResults.Enqueue(new OptimizationResult(_stringify(_profit(parameterSet), _drawdown(parameterSet)), parameterSet, \"\"));\n                };\n\n                _strategy.PushNewResults(OptimizationResult.Initial);\n\n                var step = param.Step ?? 1;\n                var datapoint = param.MinValue;\n                while (pendingOptimizationResults.Count > 0)\n                {\n                    var count = pendingOptimizationResults.Count;\n                    for (int i = 0; i < count; i++)\n                    {\n                        var optimizationResult = pendingOptimizationResults.Dequeue();\n                        Assert.AreEqual(datapoint + step * i,\n                            optimizationResult.ParameterSet.Value[\"ema-fast\"].ToDecimal());\n                        _strategy.PushNewResults(optimizationResult);\n                    }\n\n                    step = Math.Max(param.MinStep.Value, step / amountOfSegments);\n                    datapoint = param.MaxValue - step * ((decimal)amountOfSegments / 2);\n                }\n            }\n        }\n\n        protected override IOptimizationStrategy CreateStrategy()\n        {\n            return new EulerSearchOptimizationStrategy();\n        }\n\n        protected override OptimizationStrategySettings CreateSettings()\n        {\n            return new StepBaseOptimizationStrategySettings(){DefaultSegmentAmount = 10};\n        }\n\n        private static TestCaseData[] StrategySettings => new[]\n        {\n            new TestCaseData(new Maximization(), OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5.0\"}, { \"ema-fast\" , \"6.0\"} })),\n            new TestCaseData(new Minimization(), OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(new Maximization(), OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"6.0\" }, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(new Minimization(), OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n\n        [Test, TestCaseSource(nameof(StrategySettings))]\n        public override void StepInsideNoTargetNoConstraints(Extremum extremum, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideNoTargetNoConstraints(extremum, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithConstraint => new[]\n        {\n            new TestCaseData(0.05m, OptimizationStepParameters,new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1.1\"}, { \"ema-fast\" , \"3.8\"} })),\n            new TestCaseData(0.06m, OptimizationStepParameters,new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1.9\"}, { \"ema-fast\" , \"4.0\"} })),\n            new TestCaseData(0.05m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3.9\" }, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(0.06m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"2\"}, { \"ema-fast\" , \"3.9\" }, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n        [Test, TestCaseSource(nameof(OptimizeWithConstraint))]\n        public override void StepInsideWithConstraints(decimal drawdown, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideWithConstraints(drawdown, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithTarget => new[]\n        {\n            new TestCaseData(0m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(4m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(5m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(8m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"3\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(0m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(5m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(8m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"3\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n        [Test, TestCaseSource(nameof(OptimizeWithTarget))]\n        public override void StepInsideWithTarget(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideWithTarget(targetValue, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithTargetNotReached => new[]\n        {\n            new TestCaseData(15m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5.0\"}, { \"ema-fast\" , \"6.0\" } })),\n            new TestCaseData(155m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"6.0\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n\n        [Test, TestCaseSource(nameof(OptimizeWithTargetNotReached))]\n        public override void TargetNotReached(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.TargetNotReached(targetValue, optimizationParameters, solution);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Strategies/GridSearchOptimizationStrategyTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Math = System.Math;\n\nnamespace QuantConnect.Tests.Optimizer.Strategies\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class GridSearchOptimizationStrategyTests : OptimizationStrategyTests\n    {\n        [TestFixture]\n        public class GridSearchTests\n        {\n            private GridSearchOptimizationStrategy _strategy;\n\n            [SetUp]\n            public void Init()\n            {\n                this._strategy = new GridSearchOptimizationStrategy();\n            }\n\n            [TestCase(1)]\n            [TestCase(0.5)]\n            public void SinglePoint(decimal step)\n            {\n                var args = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 0, 0, step),\n                    new OptimizationStepParameter(\"ema-slow\", 0, 0, step),\n                    new OptimizationStepParameter(\"ema-custom\", 1, 1, step)\n                };\n\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), args, new StepBaseOptimizationStrategySettings());\n\n                _strategy.NewParameterSet += (s, parameterSet) =>\n                {\n                    Assert.AreEqual(0, parameterSet.Value[\"ema-fast\"].ToDecimal());\n                    Assert.AreEqual(0, parameterSet.Value[\"ema-slow\"].ToDecimal());\n                    Assert.AreEqual(1, parameterSet.Value[\"ema-custom\"].ToDecimal());\n                };\n\n                _strategy.PushNewResults(OptimizationResult.Initial);\n            }\n\n            [TestCase(10, 100, 1)]\n            [TestCase(10, 100, 500)]\n            public void Step1D(decimal min, decimal max, decimal step)\n            {\n                var param = new OptimizationStepParameter(\"ema-fast\", min, max, step);\n                var set = new HashSet<OptimizationParameter>() { param };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), set, new StepBaseOptimizationStrategySettings());\n                var counter = 0;\n\n                using (var enumerator = new EnqueueableEnumerator<ParameterSet>())\n                {\n                    _strategy.NewParameterSet += (s, parameterSet) =>\n                    {\n                        enumerator.Enqueue(parameterSet);\n                    };\n\n                    _strategy.PushNewResults(OptimizationResult.Initial);\n\n                    using (var paramEnumerator = new OptimizationStepParameterEnumerator(param))\n                    {\n                        while (paramEnumerator.MoveNext())\n                        {\n                            var value = paramEnumerator.Current;\n                            counter++;\n                            Assert.IsTrue(enumerator.MoveNext());\n\n                            var suggestion = enumerator.Current;\n\n                            Assert.IsNotNull(suggestion);\n                            Assert.IsTrue(suggestion.Value.All(s => set.Any(arg => arg.Name == s.Key)));\n                            Assert.AreEqual(1, suggestion.Value.Count);\n                            Assert.AreEqual(value, suggestion.Value[\"ema-fast\"]);\n                        }\n                    }\n\n                    Assert.AreEqual(0, enumerator.Count);\n                }\n\n                Assert.Greater(counter, 0);\n                Assert.AreEqual(Math.Floor((param.MaxValue - param.MinValue) / param.Step.Value) + 1, counter);\n            }\n\n            [TestCase(1, 1, 1)]\n            [TestCase(10, 100, 1)]\n            [TestCase(10, 100, 500)]\n            public void Estimate1D(decimal min, decimal max, decimal step)\n            {\n                var param = new OptimizationStepParameter(\"ema-fast\", min, max, step);\n                var staticParam = new StaticOptimizationParameter(\"pepe\", \"SPY\");\n                var set = new HashSet<OptimizationParameter> { param, staticParam };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), set, new StepBaseOptimizationStrategySettings());\n\n                Assert.AreEqual(Math.Floor(Math.Abs(max - min) / Math.Abs(step)) + 1, _strategy.GetTotalBacktestEstimate());\n            }\n\n            private static TestCaseData[] OptimizationStepParameter2D => new[]{\n                new TestCaseData(new decimal[,] {{10, 100, 1}, {20, 200, 1}}),\n                new TestCaseData(new decimal[,] {{10.5m, 100.5m, 1.5m}, { 20m, 209.9m, 3.5m}})\n            };\n\n            [Test, TestCaseSource(nameof(OptimizationStepParameter2D))]\n            public void Step2D(decimal[,] data)\n            {\n                var args = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", data[0,0], data[0,1], data[0,2]),\n                    new OptimizationStepParameter(\"ema-slow\", data[1,0], data[1,1], data[1,2])\n                };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), args, new StepBaseOptimizationStrategySettings());\n                var counter = 0;\n                using (var enumerator = new EnqueueableEnumerator<ParameterSet>())\n                {\n                    _strategy.NewParameterSet += (s, parameterSet) =>\n                    {\n                        enumerator.Enqueue(parameterSet);\n                    };\n\n                    _strategy.PushNewResults(OptimizationResult.Initial);\n\n                    var fastParam = args.First(arg => arg.Name == \"ema-fast\") as OptimizationStepParameter;\n                    var slowParam = args.First(arg => arg.Name == \"ema-slow\") as OptimizationStepParameter;\n\n                    using (var fastEnumerator = new OptimizationStepParameterEnumerator(fastParam))\n                    {\n                        using (var slowEnumerator = new OptimizationStepParameterEnumerator(slowParam))\n                        {\n                            while (fastEnumerator.MoveNext())\n                            {\n                                var fast = fastEnumerator.Current;\n                                slowEnumerator.Reset();\n                                while (slowEnumerator.MoveNext())\n                                {\n                                    var slow = slowEnumerator.Current;\n\n                                    counter++;\n                                    Assert.IsTrue(enumerator.MoveNext());\n\n                                    var suggestion = enumerator.Current;\n\n                                    Assert.IsNotNull(suggestion);\n                                    Assert.IsTrue(suggestion.Value.All(s => args.Any(arg => arg.Name == s.Key)));\n                                    Assert.AreEqual(2, suggestion.Value.Count);\n                                    Assert.AreEqual(fast, suggestion.Value[\"ema-fast\"]);\n                                    Assert.AreEqual(slow, suggestion.Value[\"ema-slow\"]);\n                                }\n                            }\n                        }\n                    }\n\n\n                    Assert.AreEqual(0, enumerator.Count);\n                }\n\n                Assert.Greater(counter, 0);\n\n                var total = 1m;\n                foreach (var arg in args.Cast<OptimizationStepParameter>())\n                {\n                    total *= Math.Floor((arg.MaxValue - arg.MinValue) / arg.Step.Value) + 1;\n                }\n\n                Assert.AreEqual(total, counter);\n            }\n\n            [Test, TestCaseSource(nameof(OptimizationStepParameter2D))]\n            public void Estimate2D(decimal[,] data)\n            {\n                var args = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", data[0,0], data[0,1], data[0,2]),\n                    new OptimizationStepParameter(\"ema-slow\", data[1,0], data[1,1], data[1,2]),\n                    new StaticOptimizationParameter(\"pepe\", \"SPY\")\n                };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), args, new StepBaseOptimizationStrategySettings());\n\n                var total = 1m;\n                foreach (var arg in args.OfType<OptimizationStepParameter>())\n                {\n                    total *= Math.Floor((arg.MaxValue - arg.MinValue) / arg.Step.Value) + 1;\n                }\n\n                Assert.AreEqual(total, _strategy.GetTotalBacktestEstimate());\n            }\n\n            [Test]\n            public void Step3D()\n            {\n                var args = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 1),\n                    new OptimizationStepParameter(\"ema-slow\", 20, 200, 4),\n                    new OptimizationStepParameter(\"ema-custom\", 30, 300, 30),\n                    new StaticOptimizationParameter(\"pepe\", \"SPY\")\n                };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), null, args, new StepBaseOptimizationStrategySettings());\n                var counter = 0;\n\n                using (var enumerator = new EnqueueableEnumerator<ParameterSet>())\n                {\n                    _strategy.NewParameterSet += (s, parameterSet) =>\n                    {\n                        enumerator.Enqueue(parameterSet);\n                    };\n\n                    _strategy.PushNewResults(OptimizationResult.Initial);\n\n                    var fastParam = args.First(arg => arg.Name == \"ema-fast\") as OptimizationStepParameter;\n                    var slowParam = args.First(arg => arg.Name == \"ema-slow\") as OptimizationStepParameter;\n                    var customParam = args.First(arg => arg.Name == \"ema-custom\") as OptimizationStepParameter;\n                    using (var fastEnumerator = new OptimizationStepParameterEnumerator(fastParam))\n                    {\n                        using (var slowEnumerator = new OptimizationStepParameterEnumerator(slowParam))\n                        {\n                            using (var customEnumerator = new OptimizationStepParameterEnumerator(customParam))\n                            {\n                                while (fastEnumerator.MoveNext())\n                                {\n                                    var fast = fastEnumerator.Current;\n                                    slowEnumerator.Reset();\n\n                                    while (slowEnumerator.MoveNext())\n                                    {\n                                        var slow = slowEnumerator.Current;\n                                        customEnumerator.Reset();\n\n                                        while (customEnumerator.MoveNext())\n                                        {\n                                            var custom = customEnumerator.Current;\n                                            counter++;\n                                            Assert.IsTrue(enumerator.MoveNext());\n\n                                            var parameterSet = enumerator.Current;\n\n                                            Assert.IsNotNull(parameterSet);\n                                            Assert.IsTrue(parameterSet.Value.All(s =>\n                                                args.Any(arg => arg.Name == s.Key)));\n                                            Assert.AreEqual(4, parameterSet.Value.Count);\n                                            Assert.AreEqual(fast, parameterSet.Value[\"ema-fast\"]);\n                                            Assert.AreEqual(slow, parameterSet.Value[\"ema-slow\"]);\n                                            Assert.AreEqual(custom, parameterSet.Value[\"ema-custom\"]);\n                                            Assert.AreEqual(\"SPY\", parameterSet.Value[\"pepe\"]);\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n\n                    Assert.AreEqual(0, enumerator.Count);\n                }\n\n                Assert.Greater(counter, 0);\n\n                var total = 1m;\n                foreach (var arg in args.OfType<OptimizationStepParameter>())\n                {\n                    total *= (arg.MaxValue - arg.MinValue) / arg.Step.Value + 1;\n                }\n\n                Assert.AreEqual(total, counter);\n            }\n\n            [Test]\n            public void Estimate3D()\n            {\n                var args = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 1),\n                    new OptimizationStepParameter(\"ema-slow\", 20, 200, 4),\n                    new OptimizationStepParameter(\"ema-custom\", 30, 300, 2)\n                };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), null, args, new StepBaseOptimizationStrategySettings());\n\n                var total = 1m;\n                foreach (var arg in args.Cast<OptimizationStepParameter>())\n                {\n                    total *= (arg.MaxValue - arg.MinValue) / arg.Step.Value + 1;\n                }\n\n                Assert.AreEqual(total, _strategy.GetTotalBacktestEstimate());\n            }\n\n            [Test]\n            public void NoStackOverflowException()\n            {\n                var depth = 100;\n                var args = new HashSet<OptimizationParameter>();\n\n                for (int i = 0; i < depth; i++)\n                {\n                    args.Add(new OptimizationStepParameter($\"ema-{i}\", 10, 100, 1));\n                }\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), args, new StepBaseOptimizationStrategySettings());\n\n                var counter = 0;\n                _strategy.NewParameterSet += (s, parameterSet) =>\n                {\n                    counter++;\n                    Assert.AreEqual(depth, parameterSet.Value.Count);\n                    if (counter == 10000)\n                    {\n                        throw new Exception(\"Break loop due to large amount of data\");\n                    }\n                };\n\n                Assert.Throws<Exception>(() =>\n                {\n                    _strategy.PushNewResults(OptimizationResult.Initial);\n                });\n\n                Assert.AreEqual(10000, counter);\n            }\n\n            [Test]\n            public void IncrementParameterSetId()\n            {\n                int nextId = 1,\n                    last = 1;\n\n                var set = new HashSet<OptimizationParameter>()\n                {\n                    new OptimizationStepParameter(\"ema-fast\", 10, 100, 1)\n                };\n                _strategy.Initialize(new Target(\"Profit\", new Maximization(), null), null, set, new StepBaseOptimizationStrategySettings());\n\n                _strategy.NewParameterSet += (s, parameterSet) =>\n                {\n                    Assert.AreEqual(nextId++, parameterSet.Id);\n                };\n\n                last = nextId;\n                _strategy.PushNewResults(OptimizationResult.Initial);\n                Assert.Greater(nextId, last);\n\n                last = nextId;\n                _strategy.PushNewResults(OptimizationResult.Initial);\n                Assert.Greater(nextId, last);\n            }\n        }\n\n        protected override IOptimizationStrategy CreateStrategy()\n        {\n            return new GridSearchOptimizationStrategy();\n        }\n\n        protected override OptimizationStrategySettings CreateSettings()\n        {\n            return new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = 10 };\n        }\n\n        private static TestCaseData[] StrategySettings => new[]\n        {\n            new TestCaseData(new Maximization(), OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(new Minimization(), OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(new Maximization(), OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(new Minimization(), OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n\n        [Test, TestCaseSource(nameof(StrategySettings))]\n        public override void StepInsideNoTargetNoConstraints(Extremum extremum, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideNoTargetNoConstraints(extremum, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithConstraint => new[]\n        {\n            new TestCaseData(0.05m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(0.06m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"2\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(0.05m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(0.06m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"2\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n        [Test, TestCaseSource(nameof(OptimizeWithConstraint))]\n        public override void StepInsideWithConstraints(decimal drawdown, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideWithConstraints(drawdown, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithTarget => new[]\n        {\n            new TestCaseData(0m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(4m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"} })),\n            new TestCaseData(5m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(8m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"3\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(0m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"3\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(5m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"1\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } })),\n            new TestCaseData(8m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"3\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n        [Test, TestCaseSource(nameof(OptimizeWithTarget))]\n        public override void StepInsideWithTarget(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.StepInsideWithTarget(targetValue, optimizationParameters, solution);\n        }\n\n        private static TestCaseData[] OptimizeWithTargetNotReached => new[]\n        {\n            new TestCaseData(15m, OptimizationStepParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"5\"} })),\n            new TestCaseData(155m, OptimizationMixedParameters, new ParameterSet(-1, new Dictionary<string, string>{{\"ema-slow\", \"5\"}, { \"ema-fast\" , \"5\"}, { \"skipFromResultSum\", \"SPY\" } }))\n        };\n\n        [Test, TestCaseSource(nameof(OptimizeWithTargetNotReached))]\n        public override void TargetNotReached(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            base.TargetNotReached(targetValue, optimizationParameters, solution);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Strategies/OptimizationStrategyTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Optimizer.Strategies\n{\n    public abstract class OptimizationStrategyTests\n    {\n        protected IOptimizationStrategy Strategy { get; set; }\n        protected static Func<ParameterSet, decimal> _profit { get; } = parameterSet => parameterSet.Value.Where(pair => pair.Key != \"skipFromResultSum\").Sum(arg => arg.Value.ToDecimal());\n        protected static Func<ParameterSet, decimal> _drawdown { get; } = parameterSet => parameterSet.Value.Where(pair => pair.Key != \"skipFromResultSum\").Sum(arg => arg.Value.ToDecimal()) / 100.0m;\n        protected static Func<string, string, decimal> _parse { get; } = (dump, parameter) => JObject.Parse(dump).SelectToken($\"Statistics.{parameter}\").Value<decimal>();\n        protected static Func<decimal, decimal, string> _stringify { get; } = (profit, drawdown) => BacktestResult.Create(profit, drawdown).ToJson();\n\n        private Queue<OptimizationResult> _pendingOptimizationResults;\n\n        [SetUp]\n        public void Init()\n        {\n            _pendingOptimizationResults = new Queue<OptimizationResult>();\n            Strategy = CreateStrategy();\n\n            Strategy.NewParameterSet += (s, parameterSet) =>\n            {\n                _pendingOptimizationResults.Enqueue(new OptimizationResult(_stringify(_profit(parameterSet), _drawdown(parameterSet)), parameterSet, \"\"));\n            };\n        }\n\n        [Test]\n        public void ThrowOnReinitialization()\n        {\n            int nextId = 1;\n            Strategy.NewParameterSet += (s, parameterSet) =>\n            {\n                Assert.AreEqual(nextId++, parameterSet.Id);\n            };\n\n            var set1 = new HashSet<OptimizationParameter>()\n            {\n                new OptimizationStepParameter(\"ema-fast\", 10, 100, 1)\n            };\n            Strategy.Initialize(new Target(\"Profit\", new Maximization(), null), new List<Constraint>(), set1, CreateSettings());\n\n            Strategy.PushNewResults(OptimizationResult.Initial);\n            Assert.Greater(nextId, 1);\n\n            var set2 = new HashSet<OptimizationParameter>()\n            {\n                new OptimizationStepParameter(\"ema-fast\", 10, 100, 1),\n                new OptimizationStepParameter(\"ema-slow\", 10, 100, 2)\n            };\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                Strategy.Initialize(new Target(\"Profit\", new Minimization(), null), null, set2, CreateSettings());\n            });\n        }\n\n        [Test]\n        public void ThrowIfNotInitialized()\n        {\n            var strategy = new GridSearchOptimizationStrategy();\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                strategy.PushNewResults(OptimizationResult.Initial);\n            });\n        }\n\n        protected static HashSet<OptimizationParameter> OptimizationStepParameters = new HashSet<OptimizationParameter>\n        {\n            new OptimizationStepParameter(\"ema-slow\", 1, 5, 1, 0.1m),\n            new OptimizationStepParameter(\"ema-fast\", 3, 6, 2,0.1m)\n        };\n\n        protected static HashSet<OptimizationParameter> OptimizationMixedParameters = new HashSet<OptimizationParameter>\n        {\n            new OptimizationStepParameter(\"ema-slow\", 1, 5, 1),\n            new OptimizationStepParameter(\"ema-fast\", 3, 6.75m, 2,0.1m),\n            new StaticOptimizationParameter(\"skipFromResultSum\", \"SPY\")\n        };\n\n        public virtual void StepInsideNoTargetNoConstraints(Extremum extremum, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            Strategy.Initialize(\n                new Target(\"Profit\", extremum, null),\n                null,\n                optimizationParameters,\n                CreateSettings());\n\n            Strategy.PushNewResults(OptimizationResult.Initial);\n\n            while (_pendingOptimizationResults.TryDequeue(out var item))\n            {\n                Strategy.PushNewResults(item);\n            }\n\n            Assert.AreEqual(_profit(solution), _parse(Strategy.Solution.JsonBacktestResult, \"Profit\"));\n            foreach (var arg in Strategy.Solution.ParameterSet.Value)\n            {\n                Assert.AreEqual(solution.Value[arg.Key], arg.Value);\n            }\n        }\n\n        public virtual void StepInsideWithConstraints(decimal drawdown, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            Strategy.Initialize(\n                new Target(\"Profit\", new Maximization(), null),\n                new List<Constraint> { new Constraint(\"Drawdown\", ComparisonOperatorTypes.Less, drawdown) },\n                optimizationParameters,\n                CreateSettings());\n\n            Strategy.PushNewResults(OptimizationResult.Initial);\n\n            while (_pendingOptimizationResults.TryDequeue(out var item))\n            {\n                Strategy.PushNewResults(item);\n            }\n\n            Assert.AreEqual(_profit(solution), _parse(Strategy.Solution.JsonBacktestResult, \"Profit\"));\n            Assert.AreEqual(_drawdown(solution), _parse(Strategy.Solution.JsonBacktestResult, \"Drawdown\"));\n            foreach (var arg in Strategy.Solution.ParameterSet.Value)\n            {\n                Assert.AreEqual(solution.Value[arg.Key], arg.Value);\n            }\n        }\n\n        public virtual void StepInsideWithTarget(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            bool reached = false;\n            var target = new Target(\"Profit\", new Maximization(), targetValue);\n            target.Reached += (s, e) =>\n            {\n                reached = true;\n            };\n\n            Strategy.Initialize(\n                target,\n                null,\n                optimizationParameters,\n                CreateSettings());\n\n\n            Strategy.PushNewResults(OptimizationResult.Initial);\n\n            while (!reached && _pendingOptimizationResults.TryDequeue(out var item))\n            {\n                Strategy.PushNewResults(item);\n            }\n\n            Assert.IsTrue(reached);\n            Assert.AreEqual(_profit(solution), _parse(Strategy.Solution.JsonBacktestResult, \"Profit\"));\n            foreach (var arg in Strategy.Solution.ParameterSet.Value)\n            {\n                Assert.AreEqual(solution.Value[arg.Key], arg.Value);\n            }\n        }\n\n        public virtual void TargetNotReached(decimal targetValue, HashSet<OptimizationParameter> optimizationParameters, ParameterSet solution)\n        {\n            bool reached = false;\n            var target = new Target(\"Profit\", new Maximization(), targetValue);\n            target.Reached += (s, e) =>\n            {\n                reached = true;\n            };\n\n            Strategy.Initialize(\n                target,\n                null,\n                optimizationParameters,\n                CreateSettings());\n\n\n            Strategy.PushNewResults(OptimizationResult.Initial);\n\n            while (!reached && _pendingOptimizationResults.TryDequeue(out var item))\n            {\n                Strategy.PushNewResults(item);\n            }\n\n            Assert.IsFalse(reached);\n            Assert.AreEqual(_profit(solution), _parse(Strategy.Solution.JsonBacktestResult, \"Profit\"));\n            foreach (var arg in Strategy.Solution.ParameterSet.Value)\n            {\n                Assert.AreEqual(solution.Value[arg.Key], arg.Value);\n            }\n        }\n\n        protected static TestCaseData[] Estimations => new[]\n        {\n            new TestCaseData(OptimizationStepParameters, 10),\n            new TestCaseData(OptimizationMixedParameters,10)\n        };\n        [Test, TestCaseSource(nameof(Estimations))]\n        public virtual void Estimate(HashSet<OptimizationParameter> optimizationParameters, int expected)\n        {\n            Strategy.Initialize(\n                new Target(\"Profit\", new Maximization(), null),\n                null,\n                optimizationParameters,\n                CreateSettings());\n\n            Assert.AreEqual(expected, Strategy.GetTotalBacktestEstimate());\n        }\n\n        protected abstract IOptimizationStrategy CreateStrategy();\n        protected abstract OptimizationStrategySettings CreateSettings();\n    }\n}\n"
  },
  {
    "path": "Tests/Optimizer/Strategies/StepBaseOptimizationStrategyTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Optimizer;\nusing QuantConnect.Optimizer.Objectives;\nusing QuantConnect.Optimizer.Parameters;\nusing QuantConnect.Optimizer.Strategies;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Math = System.Math;\nusing OptimizationParameter = QuantConnect.Optimizer.Parameters.OptimizationParameter;\n\nnamespace QuantConnect.Tests.Optimizer.Strategies\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class StepBaseOptimizationStrategyTests\n    {\n        private GridSearchOptimizationStrategy _strategy;\n\n        [SetUp]\n        public void Init()\n        {\n            this._strategy = new GridSearchOptimizationStrategy();\n        }\n\n        [Test]\n        public void ThrowIfNoStepProvidedWhenNoSegmentValue()\n        {\n            var optimizationParameter = new OptimizationStepParameter(\"ema-fast\", 1, 100);\n            Assert.Throws<ArgumentException>(() =>\n            {\n                _strategy.Initialize(\n                    new Target(\"Profit\", new Maximization(), null),\n                    new List<Constraint>(),\n                    new HashSet<OptimizationParameter> { optimizationParameter },\n                    new StepBaseOptimizationStrategySettings());\n            });\n        }\n\n        [TestCase(4)]\n        [TestCase(5)]\n        [TestCase(10)]\n        public void CalculateStep(int numberOfSegments)\n        {\n            var set = new HashSet<OptimizationParameter>\n            {\n                new OptimizationStepParameter(\"ema-fast\", 1, 100),\n                new OptimizationStepParameter(\"ema-slow\", -10, -10),\n                new OptimizationStepParameter(\"ema-custom\", -100, -1)\n            };\n\n            _strategy.Initialize(\n                new Target(\"Profit\", new Maximization(), null),\n                new List<Constraint>(),\n                set,\n                new StepBaseOptimizationStrategySettings { DefaultSegmentAmount = numberOfSegments });\n\n            foreach (var parameter in set)\n            {\n                var stepParameter = parameter as OptimizationStepParameter;\n                Assert.NotNull(stepParameter);\n                var actual = Math.Abs(stepParameter.MaxValue - stepParameter.MinValue) /\n                    numberOfSegments;\n                Assert.AreEqual(actual, stepParameter.Step);\n                Assert.AreEqual(actual / 10, stepParameter.MinStep);\n            }\n        }\n\n        private static TestCaseData[] StepBaseSettings => new[]\n        {\n            new TestCaseData(new StepBaseOptimizationStrategySettings {DefaultSegmentAmount = 0}),\n            new TestCaseData(new StepBaseOptimizationStrategySettings {DefaultSegmentAmount = -1}),\n            new TestCaseData(null),\n            new TestCaseData(new StepBaseOptimizationStrategySettings()),\n            new TestCaseData(new OptimizationStrategySettings())\n        };\n\n        [Test, TestCaseSource(nameof(StepBaseSettings))]\n        public void ThrowExceptionIfCantCalculateStep(OptimizationStrategySettings settings)\n        {\n            var set = new HashSet<OptimizationParameter>\n            {\n                new OptimizationStepParameter(\"ema-fast\", 1, 100),\n                new OptimizationStepParameter(\"ema-slow\", -10, -10),\n                new OptimizationStepParameter(\"ema-custom\", -100, -1)\n            };\n\n            foreach (var parameter in set)\n            {\n                var stepParameter = parameter as OptimizationStepParameter;\n                Assert.NotNull(stepParameter);\n                Assert.Null(stepParameter.Step);\n                Assert.Null(stepParameter.MinStep);\n            }\n\n            Assert.Throws<ArgumentException>(() =>\n            {\n                _strategy.Initialize(\n                    new Target(\"Profit\", new Maximization(), null),\n                    new List<Constraint>(),\n                    set,\n                    settings);\n            });\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.Tests\")]\n[assembly: AssemblyProduct(\"QuantConnect.Tests\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"7b9bd814-ef00-4c83-9843-81ca75db53d1\")]\n"
  },
  {
    "path": "Tests/Python/AlgorithmPythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Orders;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class AlgorithmPythonWrapperTests\n    {\n        private string _baseCode;\n\n        [SetUp]\n        public void Setup()\n        {\n            _baseCode = File.ReadAllText(Path.Combine(\"./RegressionAlgorithms\", \"Test_AlgorithmPythonWrapper.py\"));\n        }\n\n        [TestCase(\"\")]\n        [TestCase(\"def OnEndOfDay(self): pass\")]\n        [TestCase(\"def OnEndOfDay(self, symbol): pass\")]\n        public void CallOnEndOfDayDoesNotThrow(string code)\n        {\n            // If we define either one or the other overload of OnEndOfDay.\n            // the algorithm will not throw or log the error\n            using (Py.GIL())\n            {\n                var algorithm = GetAlgorithm(code);\n\n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay());\n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay(Symbols.SPY));\n                Assert.Null(algorithm.RunTimeError);\n            }\n        }\n\n        [Test]\n        [TestCase(\"def OnEndOfDay(self): self.Name = 'EOD'\\r\\n    def OnEndOfDay(self, symbol): self.Name = 'EODSymbol'\", \"EODSymbol\")]\n        [TestCase(\"def OnEndOfDay(self, symbol): self.Name = 'EODSymbol'\\r\\n    def OnEndOfDay(self): self.Name = 'EOD'\", \"EOD\")]\n        public void OnEndOfDayBothImplemented(string code, string expectedImplementation)\n        {\n            // If we implement both OnEndOfDay functions we expect it to not throw,\n            // but only the latest will be seen and used.\n            // To test this we will have the functions set something we can verify such as Algo name\n            using (Py.GIL())\n            {\n                var algorithm = GetAlgorithm(code);\n                \n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay());\n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay(Symbols.SPY));\n                Assert.Null(algorithm.RunTimeError);\n\n                // Check the name\n                Assert.AreEqual(expectedImplementation, algorithm.Name);\n\n                // Check the wrapper EOD Implemented variables to confirm\n                switch (expectedImplementation)\n                {\n                    case \"EOD\":\n                        Assert.IsTrue(algorithm.IsOnEndOfDayImplemented);\n                        Assert.IsFalse(algorithm.IsOnEndOfDaySymbolImplemented);\n                        break;\n                    case \"EODSymbol\":\n                        Assert.IsTrue(algorithm.IsOnEndOfDaySymbolImplemented);\n                        Assert.IsFalse(algorithm.IsOnEndOfDayImplemented);\n                        break;\n                }\n            }\n        }\n\n        [Test]\n        public void CallOnEndOfDayExceptionNoParameter()\n        {\n            // When we define OnEndOfDay without a parameter and it has an user error (divide by zero)\n            // it doesn't throw and stop the algorithm, but set its RuntimeError\n            using (Py.GIL())\n            {\n                var algorithm = GetAlgorithm(\"def OnEndOfDay(self): 1/0\");\n\n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay());\n                Assert.NotNull(algorithm.RunTimeError);\n            }\n        }\n\n        [TestCase(\"\", false)]\n        [TestCase(\"def OnMarginCall(self, orders): pass\", true)]\n        [TestCase(\"def OnMarginCall(self, orders): return orders\", false)]\n        public void OnMarginCall(string code, bool throws)\n        {\n            using (Py.GIL())\n            {\n                var algorithm = GetAlgorithm(code);\n                Assert.Null(algorithm.RunTimeError);\n\n                var order = new SubmitOrderRequest(OrderType.Limit,\n                        SecurityType.Base,\n                        Symbol.Empty,\n                        1,\n                        1,\n                        1,\n                        DateTime.UtcNow,\n                        \"\");\n                if (throws)\n                {\n                    Assert.Throws<Exception>(() => algorithm.OnMarginCall(new List<SubmitOrderRequest> { order }));\n                }\n                else\n                {\n                    Assert.DoesNotThrow(() => algorithm.OnMarginCall(new List<SubmitOrderRequest> { order }));\n                }\n            }\n        }\n\n        [Test]\n        public void CallOnEndOfDayExceptionWithParameter()\n        {\n            // When we define OnEndOfDay with the Symbol parameter and it has an user error (divide by zero)\n            // it doesn't throw and stop the algorithm, but set its RuntimeError\n            using (Py.GIL())\n            {\n                var algorithm = GetAlgorithm(\"def OnEndOfDay(self, symbol): 1/0\");\n\n                Assert.Null(algorithm.RunTimeError);\n                Assert.DoesNotThrow(() => algorithm.OnEndOfDay(Symbols.SPY));\n                Assert.NotNull(algorithm.RunTimeError);\n            }\n        }\n\n        private AlgorithmPythonWrapper GetAlgorithm(string code)\n        {\n            code = $\"{_baseCode}{Environment.NewLine}    {code}\";\n\n            using (Py.GIL())\n            {\n                PyModule.FromString(\"Test_AlgorithmPythonWrapper\", code);\n                return new AlgorithmPythonWrapper(\"Test_AlgorithmPythonWrapper\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/BasePythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Python;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class BasePythonWrapperTests\n    {\n        [Test]\n        public void EqualsReturnsTrueForWrapperAndUnderlyingModel()\n        {\n            using var _ = Py.GIL();\n\n            var module = PyModule.FromString(\"EqualsReturnsTrueForWrapperAndUnderlyingModel\", @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import BasePythonWrapperTests\n\nclass PythonDerivedTestModel(BasePythonWrapperTests.TestModel):\n    pass\n\nclass PythonTestModel:\n    pass\n\");\n            var pyDerivedModel = module.GetAttr(\"PythonDerivedTestModel\").Invoke();\n            var wrapper = new BasePythonWrapper<ITestModel>(pyDerivedModel);\n            var pyModel = module.GetAttr(\"PythonTestModel\").Invoke();\n\n            Assert.IsTrue(wrapper.Equals(pyDerivedModel));\n            Assert.IsTrue(wrapper.Equals(new BasePythonWrapper<ITestModel>(pyDerivedModel)));\n            Assert.IsFalse(wrapper.Equals(pyModel));\n        }\n\n        [TestFixture]\n        public class RuntimeChecks\n        {\n            [TestFixture]\n            public class InvokingMethod\n            {\n                public interface ITestInvokeMethodModel\n                {\n                    int IntReturnTypeMethod();\n                }\n\n                [Test]\n                public void ThrowsWhenWhenWrongReturnType([Values] bool withValidReturnType)\n                {\n                    using var _ = Py.GIL();\n                    using var module = PyModule.FromString(nameof(ThrowsWhenWhenWrongReturnType), @\"\nclass PythonTestInvokeMethodModel():\n    def __init__(self):\n        self._return_valid_type = True\n\n    def set_return_valid_type(self, value):\n        self._return_valid_type = value\n\n    def int_return_type_method(self):\n        if self._return_valid_type:\n            return 1\n\n        # Should return a integer to properly match the interface\n        return \"\"string\"\"\n\");\n\n                    using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodModel\").Invoke();\n                    using var pyWithValidReturnType = withValidReturnType.ToPython();\n                    pyInstance.GetAttr(\"set_return_valid_type\").Invoke(pyWithValidReturnType);\n\n                    var wrapper = new BasePythonWrapper<ITestInvokeMethodModel>(pyInstance);\n\n                    if (withValidReturnType)\n                    {\n                        var result = -1;\n                        Assert.DoesNotThrow(() => result = wrapper.InvokeMethod<int>(\"IntReturnTypeMethod\"));\n                        Assert.AreEqual(1, result);\n                    }\n                    else\n                    {\n                        Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethod<int>(\"IntReturnTypeMethod\"));\n                    }\n                }\n\n                [TestFixture]\n                public class WithOutParameters\n                {\n                    public interface ITestInvokeMethodWithOutParamsModel\n                    {\n                        DateTime MethodWithOutParams(out int intOutParam, out string stringOutParam);\n                    }\n\n                    [Test]\n                    public void ThrowsWhenWrongOutParamType([Values] bool withValidOutParamsTypes)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenWrongOutParamType), @\"\nfrom datetime import datetime\n\nclass PythonTestInvokeMethodWithOutParamsModel():\n    def __init__(self):\n        self._return_valid_out_param_type = True\n\n    def set_return_valid_out_param_type(self, value):\n        self._return_valid_out_param_type = value\n\n    def method_with_out_params(self, int_out_param, string_out_param):\n        if self._return_valid_out_param_type:\n            int_out_param = 1\n            string_out_param = 'string'\n        else:\n            int_out_param = 'string'    # Invalid type\n            string_out_param = 'string'\n\n        return datetime(2024, 6, 21), int_out_param, string_out_param\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodWithOutParamsModel\").Invoke();\n                        using var pyWithValidOutParamsTypes = withValidOutParamsTypes.ToPython();\n                        pyInstance.GetAttr(\"set_return_valid_out_param_type\").Invoke(pyWithValidOutParamsTypes);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodWithOutParamsModel>(pyInstance);\n\n                        AssertInvoke(wrapper, withValidOutParamsTypes);\n                    }\n\n                    [Test]\n                    public void ThrowsWhenWrongOutParamCount([Values] bool withValidOutParamCount)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenWrongOutParamCount), @\"\nfrom datetime import datetime\n\nclass PythonTestInvokeMethodWithOutParamsModel():\n    def __init__(self):\n        self._return_valid_out_params_count = True\n\n    def set_return_valid_out_params_count(self, value):\n        self._return_valid_out_params_count = value\n\n    def method_with_out_params(self, int_out_param, string_out_param):\n        int_out_param = 1\n        string_out_param = 'string'\n        if self._return_valid_out_params_count:\n            return datetime(2024, 6, 21), int_out_param, string_out_param\n        else:\n            return datetime(2024, 6, 21), int_out_param\n\");\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodWithOutParamsModel\").Invoke();\n                        using var pyWithValidOutParamCount = withValidOutParamCount.ToPython();\n                        pyInstance.GetAttr(\"set_return_valid_out_params_count\").Invoke(pyWithValidOutParamCount);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodWithOutParamsModel>(pyInstance);\n\n                        AssertInvoke<ArgumentException>(wrapper, withValidOutParamCount);\n                    }\n\n                    [Test]\n                    public void ThrowsWhenReturnedTypeIsNotATuple([Values] bool withValidReturnType)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenWrongReturnType), @\"\nfrom datetime import datetime\n\nclass PythonTestInvokeMethodWithOutParamsModel():\n    def __init__(self):\n        self._use_valid_return_type = True\n\n    def set_use_valid_return_type(self, value):\n        self._use_valid_return_type = value\n\n    def method_with_out_params(self, int_out_param, string_out_param):\n        int_out_param = 1\n        string_out_param = 'string'\n        if self._use_valid_return_type:\n            return datetime(2024, 6, 21), int_out_param, string_out_param\n        else:\n            return 1   # Invalid return type, not a tuple\n\");\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodWithOutParamsModel\").Invoke();\n                        using var pyWithValidOutParamCount = withValidReturnType.ToPython();\n                        pyInstance.GetAttr(\"set_use_valid_return_type\").Invoke(pyWithValidOutParamCount);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodWithOutParamsModel>(pyInstance);\n\n                        AssertInvoke<ArgumentException>(wrapper, withValidReturnType);\n                    }\n\n                    [Test]\n                    public void ThrowsWhenWrongReturnType([Values] bool withValidReturnType)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenWrongReturnType), @\"\nfrom datetime import datetime\n\nclass PythonTestInvokeMethodWithOutParamsModel():\n    def __init__(self):\n        self._use_valid_return_type = True\n\n    def set_use_valid_return_type(self, value):\n        self._use_valid_return_type = value\n\n    def method_with_out_params(self, int_out_param, string_out_param):\n        int_out_param = 1\n        string_out_param = 'string'\n        if self._use_valid_return_type:\n            return datetime(2024, 6, 21), int_out_param, string_out_param\n        else:\n            return 1, int_out_param, string_out_param\n\");\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodWithOutParamsModel\").Invoke();\n                        using var pyWithValidOutParamCount = withValidReturnType.ToPython();\n                        pyInstance.GetAttr(\"set_use_valid_return_type\").Invoke(pyWithValidOutParamCount);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodWithOutParamsModel>(pyInstance);\n\n                        AssertInvoke(wrapper, withValidReturnType);\n                    }\n\n                    private static void AssertInvoke<TException>(BasePythonWrapper<ITestInvokeMethodWithOutParamsModel> wrapper, bool validCase)\n                        where TException : Exception\n                    {\n                        var outParametersTypes = new Type[] { typeof(int), typeof(string) };\n                        var intOutParameter = -1;\n                        var stringOutParameter = string.Empty;\n\n                        if (validCase)\n                        {\n                            var result = wrapper.InvokeMethodWithOutParameters<DateTime>(\"MethodWithOutParams\", outParametersTypes,\n                                out var outParameters, intOutParameter, stringOutParameter);\n                            Assert.AreEqual(new DateTime(2024, 6, 21), result);\n                            Assert.AreEqual(1, outParameters[0]);\n                            Assert.AreEqual(\"string\", outParameters[1]);\n                        }\n                        else\n                        {\n                            Assert.Throws<TException>(() => wrapper.InvokeMethodWithOutParameters<DateTime>(\"MethodWithOutParams\",\n                                outParametersTypes, out var _, intOutParameter, stringOutParameter));\n                        }\n                    }\n\n                    private static void AssertInvoke(BasePythonWrapper<ITestInvokeMethodWithOutParamsModel> wrapper, bool validCase)\n                    {\n                        AssertInvoke<InvalidCastException>(wrapper, validCase);\n                    }\n                }\n\n                [TestFixture]\n                public class WithEnumerableReturnType\n                {\n                    public interface ITestInvokeMethodReturningIterable\n                    {\n                        IEnumerable<int> Range(int min, int max);\n                    }\n\n                    [Test]\n                    public void ThrowsWhenReturnTypeIsNotIterable([Values] bool withValidReturnType)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenReturnTypeIsNotIterable), @\"\nclass PythonTestInvokeMethodReturningIterable():\n    def __init__(self):\n        self._use_valid_return_type = True\n\n    def set_use_valid_return_type(self, value):\n        self._use_valid_return_type = value\n\n    def range(self, min, max):\n        if self._use_valid_return_type:\n            return range(min, max)\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodReturningIterable\").Invoke();\n                        using var pyWithValidReturnType = withValidReturnType.ToPython();\n                        pyInstance.GetAttr(\"set_use_valid_return_type\").Invoke(pyWithValidReturnType);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodReturningIterable>(pyInstance);\n\n                        if (withValidReturnType)\n                        {\n                            var result = wrapper.InvokeMethodAndEnumerate<int>(\"Range\", 5, 10).ToList();\n                            CollectionAssert.AreEqual(new[] { 5, 6, 7, 8, 9 }, result);\n                        }\n                        else\n                        {\n                            Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethodAndEnumerate<int>(\"Range\", 5, 10).ToList());\n                        }\n                    }\n\n                    [Test]\n                    public void ThrowsWhenIteratorItemIsOfWrongType()\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenIteratorItemIsOfWrongType), @\"\nclass PythonTestInvokeMethodReturningIterable():\n    def range(self, min, max):\n        for i in range(min, max):\n            yield i\n        yield 'string'\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodReturningIterable\").Invoke();\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodReturningIterable>(pyInstance);\n\n                        Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethodAndEnumerate<int>(\"Range\", 5, 10).ToList());\n                    }\n                }\n\n                [TestFixture]\n                public class WithDictionaryReturnType\n                {\n                    public interface ITestInvokeMethodReturningDictionary\n                    {\n                        Dictionary<Symbol, List<double>> GetDictionary();\n                    }\n\n                    [TestCase(true, false)]\n                    [TestCase(true, true)]\n                    [TestCase(false)]\n                    public void ThrowsWhenReturnTypeIsNotDictionary(bool withValidReturnType, bool returnNone = false)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenReturnTypeIsNotDictionary), @\"\nfrom QuantConnect.Tests import Symbols\n\nclass PythonTestInvokeMethodReturningDictionary():\n    def __init__(self):\n        self._use_valid_return_type = True\n        self._return_none = False\n\n    def set_use_valid_return_type(self, value):\n        self._use_valid_return_type = value\n\n    def set_return_none(self, value):\n        self._return_none = value\n\n    def get_dictionary(self):\n        if self._use_valid_return_type:\n            if not self._return_none:\n                return {\n                    Symbols.SPY: [1.1, 2.2],\n                    Symbols.USDJPY: [3.3, 4.4, 5.5],\n                    Symbols.SPY_C_192_Feb19_2016: [6.6],\n                }\n            else:\n                # None is a valid value for a Dictionary\n                return None\n        else:\n            return [1, 2, 3]\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodReturningDictionary\").Invoke();\n                        using var pyWithValidReturnType = withValidReturnType.ToPython();\n                        pyInstance.GetAttr(\"set_use_valid_return_type\").Invoke(pyWithValidReturnType);\n                        using var pyReturnNone = returnNone.ToPython();\n                        pyInstance.GetAttr(\"set_return_none\").Invoke(pyReturnNone);\n\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodReturningDictionary>(pyInstance);\n\n                        if (withValidReturnType)\n                        {\n                            var result = wrapper.InvokeMethodAndGetDictionary<Symbol, List<double>>(\"GetDictionary\");\n\n                            if (returnNone)\n                            {\n                                Assert.IsNull(result);\n                            }\n                            else\n                            {\n                                var expectedDictionary = new Dictionary<Symbol, List<double>>()\n                                {\n                                    { Symbols.SPY, new() { 1.1, 2.2 } },\n                                    { Symbols.USDJPY, new() { 3.3, 4.4, 5.5 } },\n                                    { Symbols.SPY_C_192_Feb19_2016, new() { 6.6 } },\n                                };\n\n                                Assert.IsNotNull(result);\n                                Assert.AreEqual(expectedDictionary.Count, result.Count);\n\n                                foreach (var kvp in expectedDictionary)\n                                {\n                                    Assert.IsTrue(result.TryGetValue(kvp.Key, out var resultValue));\n                                    CollectionAssert.AreEqual(kvp.Value, resultValue);\n                                }\n                            }\n                        }\n                        else\n                        {\n                            Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethodAndGetDictionary<Symbol, List<double>>(\"GetDictionary\"));\n                        }\n                    }\n\n                    [Test]\n                    public void ThrowsWhenDictionaryKeyIsOfWrongType()\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenDictionaryKeyIsOfWrongType), @\"\nfrom datetime import datetime\nfrom QuantConnect.Tests import Symbols\n\nclass PythonTestInvokeMethodReturningDictionary():\n    def get_dictionary(self):\n        date = datetime(2024, 8, 14)\n        return {\n            Symbols.SPY: [1.1, 2.2],\n            Symbols.USDJPY: [3.3, 4.4, 5.5],\n            date: [6.6],\n        }\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodReturningDictionary\").Invoke();\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodReturningDictionary>(pyInstance);\n\n                        Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethodAndGetDictionary<Symbol, List<double>>(\"GetDictionary\"));\n                    }\n\n                    [Test]\n                    public void ThrowsWhenDictionaryValueIsOfWrongType()\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(ThrowsWhenDictionaryValueIsOfWrongType), @\"\nfrom QuantConnect.Tests import Symbols\n\nclass PythonTestInvokeMethodReturningDictionary():\n    def get_dictionary(self):\n        return {\n            Symbols.SPY: [1.1, 2.2],\n            Symbols.USDJPY: [3.3, 4.4, 5.5],\n            Symbols.SPY_C_192_Feb19_2016: 6.6,\n        }\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestInvokeMethodReturningDictionary\").Invoke();\n                        var wrapper = new BasePythonWrapper<ITestInvokeMethodReturningDictionary>(pyInstance);\n\n                        Assert.Throws<InvalidCastException>(() => wrapper.InvokeMethodAndGetDictionary<Symbol, List<double>>(\"GetDictionary\"));\n                    }\n                }\n\n                [TestFixture]\n                public class WrappingResult\n                {\n                    public interface ITestModel\n                    {\n                        IFeeModel GetFeeModel();\n                    }\n\n                    public class TestModel : ITestModel\n                    {\n                        public IFeeModel GetFeeModel()\n                        {\n                            return new FeeModel();\n                        }\n                    }\n\n                    public class TestModelPythonWrapper : BasePythonWrapper<ITestModel>\n                    {\n                        public TestModelPythonWrapper(PyObject pyInstance) : base(pyInstance)\n                        {\n                        }\n                    }\n\n                    [Test]\n                    public void WrapsResult([Values] bool withWrappedResult)\n                    {\n                        using var _ = Py.GIL();\n                        using var module = PyModule.FromString(nameof(WrapsResult), @\"\nfrom AlgorithmImports import *\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import BasePythonWrapperTests\n\nclass PythonFeeModel(FeeModel):\n    pass\n\nclass PythonTestModel(BasePythonWrapperTests.RuntimeChecks.InvokingMethod.WrappingResult.TestModel):\n    def __init__(self):\n        self._use_wrapped_result = True\n\n    def set_use_wrapped_result(self, value):\n        self._use_wrapped_result = value\n\n    def get_fee_model(self):\n        if self._use_wrapped_result:\n            return PythonFeeModel()\n\n        return FeeModel()\n\");\n\n                        using var pyInstance = module.GetAttr(\"PythonTestModel\").Invoke();\n                        using var pyWithWrappedResult = withWrappedResult.ToPython();\n                        pyInstance.GetAttr(\"set_use_wrapped_result\").Invoke(pyWithWrappedResult);\n\n                        var wrapper = new TestModelPythonWrapper(pyInstance);\n                        var wrappingFunctionCalled = false;\n                        var feeModel = wrapper.InvokeMethodAndWrapResult<IFeeModel>(\"GetFeeModel\", (pyInstance) =>\n                        {\n                            wrappingFunctionCalled = true;\n                            return new FeeModelPythonWrapper(pyInstance);\n                        });\n\n                        if (withWrappedResult)\n                        {\n                            Assert.IsTrue(wrappingFunctionCalled);\n                            Assert.IsInstanceOf<FeeModelPythonWrapper>(feeModel);\n                        }\n                        else\n                        {\n                            Assert.IsFalse(wrappingFunctionCalled);\n                            Assert.IsInstanceOf<FeeModel>(feeModel);\n                            Assert.IsNotInstanceOf<FeeModelPythonWrapper>(feeModel);\n                        }\n                    }\n                }\n            }\n\n            [TestFixture]\n            public class WorkingWithProperties\n            {\n                public interface ITestProperties\n                {\n                    List<double> Numbers { get; set; }\n                }\n\n                [Test]\n                public void ThrowsWhenSettingPropertyValueOfInvalidType([Values] bool withValidType)\n                {\n                    using var _ = Py.GIL();\n                    using var module = PyModule.FromString(nameof(ThrowsWhenSettingPropertyValueOfInvalidType), @\"\nclass PythonTestSetProperty():\n    def __init__(self):\n        self._numbers = None\n        self._use_valid_type = True\n\n    def set_use_valid_type(self, value):\n        self._use_valid_type = value\n\n    @property\n    def numbers(self):\n        return self._numbers\n\n    @numbers.setter\n    def numbers(self, value):\n        self._numbers = value\n\n    def set_valid_numbers(self):\n        self.numbers = [1.1, 2.2, 3.3]\n\n    def set_invalid_numbers(self):\n        self.numbers = 1\n\");\n\n                    using var pyInstance = module.GetAttr(\"PythonTestSetProperty\").Invoke();\n                    using var pyWithValidReturnType = withValidType.ToPython();\n                    pyInstance.GetAttr(\"set_use_valid_type\").Invoke(pyWithValidReturnType);\n\n                    var wrapper = new BasePythonWrapper<ITestProperties>(pyInstance);\n\n                    if (withValidType)\n                    {\n                        var result = wrapper.GetProperty<List<double>>(\"Numbers\");\n                        // The default value is null\n                        Assert.IsNull(result);\n\n                        // set the property\n                        pyInstance.InvokeMethod(\"set_valid_numbers\");\n                        result = wrapper.GetProperty<List<double>>(\"Numbers\");\n                        var expectedNumbers = new List<double> { 1.1, 2.2, 3.3 };\n                        CollectionAssert.AreEqual(expectedNumbers, result);\n                    }\n                    else\n                    {\n                        pyInstance.InvokeMethod(\"set_invalid_numbers\");\n                        Assert.Throws<InvalidCastException>(() => wrapper.GetProperty<List<double>>(\"Numbers\"));\n                    }\n                }\n            }\n        }\n\n        public interface ITestModel\n        {\n        }\n\n        public class TestModel : ITestModel\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/DataConsolidatorPythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing QuantConnect.Statistics;\nusing QuantConnect.Tests.Common.Data;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class DataConsolidatorPythonWrapperTests: BaseConsolidatorTests\n    {\n        [Test]\n        public void UpdatePyConsolidator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.update_was_called = False\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       self.update_was_called = True\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       pass\\n\");\n\n                var customConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                using var wrapper = new DataConsolidatorPythonWrapper(customConsolidator);\n\n                var time = DateTime.Today;\n                var period = TimeSpan.FromMinutes(1);\n                var bar1 = new QuoteBar\n                {\n                    Time = time,\n                    Symbol = Symbols.SPY,\n                    Bid = new Bar(1, 2, 0.75m, 1.25m),\n                    LastBidSize = 3,\n                    Ask = null,\n                    LastAskSize = 0,\n                    Value = 1,\n                    Period = period\n                };\n\n                wrapper.Update(bar1);\n\n                bool called;\n                customConsolidator.GetAttr(\"update_was_called\").TryConvert(out called);\n                Assert.True(called);\n            }\n        }\n\n        [Test]\n        public void ScanPyConsolidator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.scan_was_called = False\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       pass\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       self.scan_was_called = True\\n\");\n\n                var customConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                using var wrapper = new DataConsolidatorPythonWrapper(customConsolidator);\n\n                var time = DateTime.Today;\n                var period = TimeSpan.FromMinutes(1);\n\n                wrapper.Scan(DateTime.Now);\n\n                bool called;\n                customConsolidator.GetAttr(\"scan_was_called\").TryConvert(out called);\n                Assert.True(called);\n            }\n        }\n\n        [Test]\n        public void InputTypePyConsolidator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       pass\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       pass\\n\");\n\n                var customConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                using var wrapper = new DataConsolidatorPythonWrapper(customConsolidator);\n\n                var time = DateTime.Today;\n                var period = TimeSpan.FromMinutes(1);\n\n                var type = wrapper.InputType;\n                Assert.True(type == typeof(QuoteBar));\n            }\n        }\n\n        [Test]\n        public void OutputTypePyConsolidator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.input_type = QuoteBar\\n\" +\n                    \"       self.output_type = QuoteBar\\n\" +\n                    \"       self.consolidated = None\\n\" +\n                    \"       self.working_data = None\\n\" +\n                    \"   def update(self, data):\\n\" +\n                    \"       pass\\n\" +\n                    \"   def scan(self, time):\\n\" +\n                    \"       pass\\n\");\n\n                var customConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                using var wrapper = new DataConsolidatorPythonWrapper(customConsolidator);\n\n                var time = DateTime.Today;\n                var period = TimeSpan.FromMinutes(1);\n\n                var type = wrapper.OutputType;\n                Assert.True(type == typeof(QuoteBar));\n            }\n        }\n\n        [Test]\n        public void RunRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"CustomConsolidatorRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"15\"},\n                    {\"Average Win\", \"0.42%\"},\n                    {\"Average Loss\", \"-0.03%\"},\n                    {\"Compounding Annual Return\", \"76.673%\"},\n                    {\"Drawdown\", \"0.200%\"},\n                    {\"Expectancy\", \"4.239\"},\n                    {\"Net Profit\", \"1.203%\"},\n                    {\"Sharpe Ratio\", \"7.908\"},\n                    {\"Probabilistic Sharpe Ratio\", \"95.063%\"},\n                    {\"Loss Rate\", \"62%\"},\n                    {\"Win Rate\", \"38%\"},\n                    {\"Profit-Loss Ratio\", \"12.97\"},\n                    {\"Alpha\", \"0.408\"},\n                    {\"Beta\", \"0.35\"},\n                    {\"Annual Standard Deviation\", \"0.067\"},\n                    {\"Annual Variance\", \"0.005\"},\n                    {\"Information Ratio\", \"1.484\"},\n                    {\"Tracking Error\", \"0.117\"},\n                    {\"Treynor Ratio\", \"1.526\"},\n                    {\"Total Fees\", \"$24.34\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        [Test]\n        public void AttachAndTriggerEvent()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"class ImplementingClass():\\n\" +\n                    \"   def __init__(self):\\n\" +\n                    \"       self.EventCalled = False\\n\" +\n                    \"       self.Consolidator = CustomConsolidator(timedelta(minutes=2))\\n\" +\n                    \"       self.Consolidator.DataConsolidated += self.ConsolidatorEvent\\n\" +\n                    \"   def ConsolidatorEvent(self, sender, bar):\\n\" +\n                    \"       self.EventCalled = True\\n\" +\n                    \"class CustomConsolidator(QuoteBarConsolidator):\\n\" +\n                    \"   def __init__(self,span):\\n\" +\n                    \"       super().__init__(span)\\n\" +\n                    \"       self.Span = span\\n\");\n\n                var implementingClass = module.GetAttr(\"ImplementingClass\").Invoke();\n                var customConsolidator = implementingClass.GetAttr(\"Consolidator\");\n                using var wrapper = new DataConsolidatorPythonWrapper(customConsolidator);\n\n                bool called;\n                implementingClass.GetAttr(\"EventCalled\").TryConvert(out called);\n                Assert.False(called);\n\n                var time = DateTime.Today;\n                var period = TimeSpan.FromMinutes(1);\n                var bar1 = new QuoteBar\n                {\n                    Time = time,\n                    Symbol = Symbols.SPY,\n                    Bid = new Bar(1, 2, 0.75m, 1.25m),\n                    LastBidSize = 3,\n                    Ask = null,\n                    LastAskSize = 0,\n                    Value = 1,\n                    Period = period\n                };\n\n                wrapper.Update(bar1);\n                wrapper.Scan(time.AddMinutes(2));\n                implementingClass.GetAttr(\"EventCalled\").TryConvert(out called);\n                Assert.True(called);\n            }\n        }\n\n        [Test]\n        public void SubscriptionManagedDoesNotWrapCSharpConsolidators()\n        {\n            //Setup algorithm and Equity\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spy = algorithm.AddEquity(\"SPY\").Symbol;\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"from AlgorithmImports import *\\n\" +\n                    \"consolidator = QuoteBarConsolidator(timedelta(5))\");\n\n                var pyConsolidator = module.GetAttr(\"consolidator\");\n\n                algorithm.SubscriptionManager.AddConsolidator(spy, pyConsolidator);\n\n                pyConsolidator.TryConvert(out IDataConsolidator consolidator);\n                algorithm.SubscriptionManager.RemoveConsolidator(spy, consolidator);\n\n                var count = algorithm.SubscriptionManager\n                    .SubscriptionDataConfigService\n                    .GetSubscriptionDataConfigs(spy)\n                    .Sum(x => x.Consolidators.Count);\n\n                Assert.AreEqual(0, count);\n                consolidator.Dispose();\n            }\n\n        }\n\n        protected override IEnumerable<IBaseData> GetTestValues()\n        {\n            var time = DateTime.Today;\n            return new List<QuoteBar>()\n            {\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 0.5m, 1.75m), Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m), LastBidSize = 10, LastAskSize = 0 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(0, 4, 0.4m, 3.75m), Ask = new Bar(2.3m, 9.4m, 2.3m, 4.5m), LastBidSize = 5, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(2, 2, 0.9m, 1.45m), Ask = new Bar(2.7m, 8.4m, 3.6m, 3.6m), LastBidSize = 8, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(2, 6, 2.5m, 5.55m), Ask = new Bar(3.2m, 6.4m, 2.3m, 5.3m), LastBidSize = 9, LastAskSize = 4 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 1.5m, 0.34m), Ask = new Bar(3.6m, 9.4m, 3.7m, 3.8m), LastBidSize = 5, LastAskSize = 8 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(1, 2, 1.1m, 0.75m), Ask = new Bar(3.8m, 8.4m, 7.3m, 5.3m), LastBidSize = 9, LastAskSize = 5 },\n                new QuoteBar(){Time = time, Symbol = Symbols.SPY, Bid = new Bar(3, 3, 2.2m, 1.12m), Ask = new Bar(4.5m, 7.2m, 7.1m, 6.1m), LastBidSize = 6, LastAskSize = 3 },\n            };\n        }\n\n        protected override void AssertConsolidator(IDataConsolidator consolidator)\n        {\n            base.AssertConsolidator(consolidator);\n            using (Py.GIL())\n            {\n                var pythonConsolidator = consolidator as TestDataConsolidatorPythonWrapper;\n                pythonConsolidator.RawIndicator.GetAttr(\"update_was_called\").TryConvert(out bool pythonConsolidatorUpdateWasCalled);\n                Assert.IsFalse(pythonConsolidatorUpdateWasCalled);\n            }\n        }\n\n        protected override IDataConsolidator CreateConsolidator()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                        \"from AlgorithmImports import *\\n\" +\n                        \"class CustomConsolidator(PythonConsolidator):\\n\" +\n                        \"   def __init__(self):\\n\" +\n                        \"       self.update_was_called = False\\n\" +\n                        \"       self.input_type = QuoteBar\\n\" +\n                        \"       self.output_type = QuoteBar\\n\" +\n                        \"       self.consolidated = None\\n\" +\n                        \"       self.working_data = None\\n\" +\n                        \"   def update(self, data):\\n\" +\n                        \"       self.update_was_called = True\\n\" +\n                        \"   def scan(self, time):\\n\" +\n                        \"       pass\\n\" +\n                        \"   def reset(self):\\n\" +\n                        \"       self.update_was_called = False\\n\");\n\n                var customConsolidator = module.GetAttr(\"CustomConsolidator\").Invoke();\n                return new TestDataConsolidatorPythonWrapper(customConsolidator);\n            }\n        }\n\n        public class TestDataConsolidatorPythonWrapper : DataConsolidatorPythonWrapper\n        {\n            public PyObject RawIndicator { get; set; }\n            public TestDataConsolidatorPythonWrapper(PyObject consolidator) : base(consolidator)\n            {\n                RawIndicator = consolidator;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/Indicators/IndicatorExtensionsTests.py",
    "content": "﻿#\n# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nfrom clr import AddReference\nAddReference(\"QuantConnect.Indicators\")\n\nfrom QuantConnect.Indicators import *\nfrom datetime import datetime\nimport decimal as d\nimport unittest\n\nclass IndicatorExtensionsTests(unittest.TestCase):\n    def test_PipesDataUsingOfFromFirstToSecond(self):\n        first = SimpleMovingAverage(2)\n        second = Delay(1)\n\n        # this is a configuration step, but returns the reference to the second for method chaining\n        third = IndicatorExtensions.Of(second, first)\n\n        data1 = IndicatorDataPoint(datetime.now(), 1)\n        data2 = IndicatorDataPoint(datetime.now(), 2)\n        data3 = IndicatorDataPoint(datetime.now(), 3)\n        data4 = IndicatorDataPoint(datetime.now(), 4)\n\n        # sma has one item\n        first.Update(data1)\n        self.assertFalse(first.IsReady)\n        self.assertEqual(0, second.Current.Value)\n\n        # sma is ready, delay will repeat this value\n        first.Update(data2)\n        self.assertTrue(first.IsReady)\n        self.assertFalse(second.IsReady)\n        self.assertEqual(1.5, second.Current.Value)\n\n        # delay is ready, and repeats its first input\n        first.Update(data3)\n        self.assertTrue(second.IsReady)\n        self.assertEqual(1.5, second.Current.Value)\n\n        # now getting the delayed data\n        first.Update(data4)\n        self.assertEqual(2.5, second.Current.Value)\n\n    def test_PipesDataFirstWeightedBySecond(self):\n        period = 4\n        value = Identity(\"Value\")\n        weight = Identity(\"Weight\")\n\n        third = IndicatorExtensions.WeightedBy(value, weight, period)\n\n        data = range(1, 11)\n        window = list(reversed(data))[:period]\n        current = sum([ 2 * x * x for x in window ]) / float(sum(window))\n\n        for item in data:\n            value.Update(datetime.now(), 2 * item)\n            weight.Update(datetime.now(), item)\n\n        self.assertEqual(current, float(third.Current.Value))\n\n    def test_NewDataPushesToDerivedIndicators(self):\n        identity = Identity(\"identity\")\n        self.sma = SimpleMovingAverage(3)\n\n        identity.Updated += self.identity_updated\n\n        identity.Update(datetime.now(), 1)\n        identity.Update(datetime.now(), 2)\n        self.assertFalse(self.sma.IsReady)\n\n        identity.Update(datetime.now(), 3)\n        self.assertTrue(self.sma.IsReady)\n        self.assertEqual(2, self.sma.Current.Value)\n\n    def identity_updated(self, sender, consolidated):\n        self.sma.Update(consolidated)\n\n    def test_MultiChainSMA(self):\n        identity = Identity(\"identity\")\n        delay = Delay(2)\n\n        # create the SMA of the delay of the identity\n        sma = IndicatorExtensions.SMA(IndicatorExtensions.Of(delay, identity), 2)\n\n        identity.Update(datetime.now(), 1)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(sma.IsReady)\n\n        identity.Update(datetime.now(), 2)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(sma.IsReady)\n\n        identity.Update(datetime.now(), 3)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertFalse(sma.IsReady)\n\n        identity.Update(datetime.now(), 4)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertTrue(sma.IsReady)\n\n        self.assertEqual(1.5, sma.Current.Value)\n\n    def test_MultiChainEMA(self):\n        identity = Identity(\"identity\")\n        delay = Delay(2)\n\n        # create the EMA of chained methods\n        ema = IndicatorExtensions.EMA(IndicatorExtensions.Of(delay, identity), 2, d.Decimal(1))\n            \n        identity.Update(datetime.now(), 1)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(ema.IsReady)\n\n        identity.Update(datetime.now(), 2)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(ema.IsReady)\n\n        identity.Update(datetime.now(), 3)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertFalse(ema.IsReady)\n\n        identity.Update(datetime.now(), 4)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertTrue(ema.IsReady)\n\n        self.assertEqual(2, ema.Current.Value)\n\n    def test_MultiChainMAX(self):\n        identity = Identity(\"identity\")\n        delay = Delay(2)\n\n        # create the MAX of the delay of the identity\n        max = IndicatorExtensions.MAX(IndicatorExtensions.Of(delay, identity), 2)\n\n        identity.Update(datetime.now(), 1)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(max.IsReady)\n\n        identity.Update(datetime.now(), 2)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(max.IsReady)\n\n        identity.Update(datetime.now(), 3)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertFalse(max.IsReady)\n\n        identity.Update(datetime.now(), 4)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertTrue(max.IsReady)\n\n        self.assertEqual(2, max.Current.Value)\n\n    def test_MultiChainMIN(self):\n        identity = Identity(\"identity\")\n        delay = Delay(2)\n\n        # create the MAX of the delay of the identity\n        min = IndicatorExtensions.MIN(IndicatorExtensions.Of(delay, identity), 2)\n\n        identity.Update(datetime.now(), 1)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(min.IsReady)\n\n        identity.Update(datetime.now(), 2)\n        self.assertTrue(identity.IsReady)\n        self.assertFalse(delay.IsReady)\n        self.assertFalse(min.IsReady)\n\n        identity.Update(datetime.now(), 3)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertFalse(min.IsReady)\n\n        identity.Update(datetime.now(), 4)\n        self.assertTrue(identity.IsReady)\n        self.assertTrue(delay.IsReady)\n        self.assertTrue(min.IsReady)\n\n        self.assertEqual(1, min.Current.Value)\n\n    def test_PlusAddsLeftAndRightAfterBothUpdated(self):\n        left = Identity(\"left\")\n        right = Identity(\"right\")\n        composite = IndicatorExtensions.Plus(left, right)\n\n        left.Update(datetime.now(), 1)\n        right.Update(datetime.now(), 1)\n        self.assertEqual(2, composite.Current.Value)\n\n        left.Update(datetime.today(), 2)\n        self.assertEqual(2, composite.Current.Value)\n\n        left.Update(datetime.today(), 3)\n        self.assertEqual(2, composite.Current.Value)\n\n        right.Update(datetime.today(), 4)\n        self.assertEqual(7, composite.Current.Value)\n\n    def test_MinusSubtractsLeftAndRightAfterBothUpdated(self):\n        left = Identity(\"left\")\n        right = Identity(\"right\")\n        composite = IndicatorExtensions.Minus(left, right)\n\n        left.Update(datetime.today(), 1)\n        right.Update(datetime.today(), 1)\n        self.assertEqual(0, composite.Current.Value)\n\n        left.Update(datetime.today(), 2)\n        self.assertEqual(0, composite.Current.Value)\n\n        left.Update(datetime.today(), 3)\n        self.assertEqual(0, composite.Current.Value)\n\n        right.Update(datetime.today(), 4)\n        self.assertEqual(-1, composite.Current.Value)\n\n    def test_OverDivdesLeftAndRightAfterBothUpdated(self):\n        left = Identity(\"left\")\n        right = Identity(\"right\")\n        composite = IndicatorExtensions.Over(left, right)\n\n        left.Update(datetime.today(), 1)\n        right.Update(datetime.today(), 1)\n        self.assertEqual(1, composite.Current.Value)\n\n        left.Update(datetime.today(), 2)\n        self.assertEqual(1, composite.Current.Value)\n\n        left.Update(datetime.today(), 3)\n        self.assertEqual(1, composite.Current.Value)\n\n        right.Update(datetime.today(), 4)\n        self.assertEqual(3.0 / 4.0, composite.Current.Value)\n\n    def test_OverHandlesDivideByZero(self):\n        left = Identity(\"left\")\n        right = Identity(\"right\")\n        composite = IndicatorExtensions.Over(left, right)\n        self.updatedEventFired = False\n        composite.Updated += self.composite_updated\n\n        left.Update(datetime.today(), 1)\n        self.assertFalse(self.updatedEventFired)\n        right.Update(datetime.today(), 0)\n        self.assertFalse(self.updatedEventFired)\n\n        # submitting another update to right won't cause an update without corresponding update to left\n        right.Update(datetime.today(), 1)\n        self.assertFalse(self.updatedEventFired)\n        left.Update(datetime.today(), 1)\n        self.assertTrue(self.updatedEventFired)\n\n    def composite_updated(self, sender, consolidated):\n        self.updatedEventFired = True\n\n    def test_TimesMultipliesLeftAndRightAfterBothUpdated(self):\n        left = Identity(\"left\")\n        right = Identity(\"right\")\n        composite = IndicatorExtensions.Times(left, right)\n\n        left.Update(datetime.today(), 1)\n        right.Update(datetime.today(), 1)\n        self.assertEqual(1, composite.Current.Value)\n\n        left.Update(datetime.today(), 2)\n        self.assertEqual(1, composite.Current.Value)\n\n        left.Update(datetime.today(), 3)\n        self.assertEqual(1, composite.Current.Value)\n\n        right.Update(datetime.today(), 4)\n        self.assertEqual(12, composite.Current.Value)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "Tests/Python/MethodOverloadTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class MethodOverloadTests\n    {\n        private dynamic _algorithm;\n\n        /// <summary>\n        /// Run before every test\n        /// </summary>\n        [SetUp]\n        public void Setup()\n        {\n            PythonInitializer.Initialize();\n\n            using (Py.GIL())\n            {\n                var module = Py.Import(\"Test_MethodOverload\");\n                _algorithm = module.GetAttr(\"Test_MethodOverload\").Invoke();\n                // this is required else will get a 'RuntimeBinderException' because fails to match constructor method\n                dynamic algo = _algorithm.AsManagedObject((Type)_algorithm.GetPythonType().AsManagedObject(typeof(Type)));\n                _algorithm.subscription_manager.set_data_manager(new DataManagerStub(algo));\n                _algorithm.initialize();\n            }\n        }\n\n        [Test]\n        public void CallPlotTests()\n        {\n            using (Py.GIL())\n            {\n                // self.Plot('NUMBER', 0.1)\n                Assert.DoesNotThrow(() => _algorithm.call_plot_number_test());\n\n                // self.Plot('STD', self.std), where self.sma = self.SMA('SPY', 20)\n                Assert.DoesNotThrow(() => _algorithm.call_plot_sma_test());\n\n                // self.Plot('SMA', self.sma), where self.std = self.STD('SPY', 20)\n                Assert.DoesNotThrow(() => _algorithm.call_plot_std_test());\n\n                // self.Plot(\"ERROR\", self.Name), where self.Name is IAlgorithm.Name: string\n                Assert.Throws<PythonException>(() => _algorithm.call_plot_throw_test());\n\n                // self.Plot(\"ERROR\", self.Portfolio), where self.Portfolio is IAlgorithm.Portfolio: instance of SecurityPortfolioManager\n                Assert.That(() => _algorithm.call_plot_throw_managed_test(),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>());\n\n                // self.Plot(\"ERROR\", self.a), where self.a is an instance of a python object\n                Assert.That(() => _algorithm.call_plot_throw_pyobject_test(),\n                    Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/NamedArgumentsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class NamedArgumentsTests\n    {\n        [Test]\n        public void AddEquityTest()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n\n            using (Py.GIL())\n            {\n                // Test function that will used named args in Python -> C#\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"def test(algorithm):\\n\" +\n                    \"   aapl = algorithm.AddEquity(ticker='AAPL')\\n\" +\n                    \"   return aapl\\n\"\n                );\n\n                var testFunction = module.GetAttr(\"test\");\n                var equity = testFunction.Invoke(algorithm.ToPython()).As<Equity>();\n                \n                Assert.AreEqual(\"AAPL\", equity.Symbol.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PandasConverterTests.BackwardsCompatibility.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public partial class PandasConverterTests\n    {\n        [Test, TestCaseSource(nameof(TestDataFrameNonExceptionFunctions))]\n        public void BackwardsCompatibilityDataFrameDataFrameNonExceptionFunctions(string method, string index, bool cache)\n        {\n            if(method == \".to_orc()\")\n            {\n                if (OS.IsWindows)\n                {\n                    // not supported in windows\n                    return;\n                }\n                // orc does not support serializing a non-default index for the index; you can .reset_index() to make the index into column(s)\n                method = $\".reset_index(){method}\";\n            }\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, symbol):\n    df = df.lastprice.unstack(level=0){method}\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestDataFrameParameterlessFunctions))]\n        public void BackwardsCompatibilityDataFrameParameterlessFunctions(string method, string index, bool cache)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, symbol):\n    df = df.lastprice.unstack(level=0){method}\n    # If not DataFrame, return\n    if not hasattr(df, 'columns'):\n        return\n    if df.iloc[-1][{index}] is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestDataFrameOtherParameterFunctions))]\n        public void BackwardsCompatibilityDataFrameOtherParameterFunctions(string method, string index, bool cache)\n        {   \n            // Cannot compare non identically indexed dataframes\n            if (method == \".compare(other)\" && _newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, other, symbol):\n    df = df{method}\n    df = df.lastprice.unstack(level=0)\n    # If not DataFrame, return\n    if not hasattr(df, 'columns'):\n        return\n    if df.iloc[-1][{index}] is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestSeriesNonExceptionFunctions))]\n        public void BackwardsCompatibilitySeriesNonExceptionFunctions(string method, string index, bool cache)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, symbol):\n    series = df.lastprice\n    series = series{method}\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestSeriesParameterlessFunctions))]\n        public void BackwardsCompatibilitySeriesParameterlessFunctions(string method, string index, bool cache)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, symbol):\n    series = df.lastprice\n    series = series{method}\n    # If not Series, return\n    if not hasattr(series, 'index') or type(series) is tuple:\n        return\n    if series.loc[{index}].iloc[-1] is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [Test, TestCaseSource(nameof(TestSeriesOtherParameterFunctions))]\n        public void BackwardsCompatibilitySeriesOtherParameterFunctions(string method, string index, bool cache)\n        {\n            // Cannot compare non identically indexed dataframes\n            if (method == \".compare(other)\" && _newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(df, other, symbol):\n    series, other = other.lastprice, df.lastprice\n    series = series{method}\n    # If not Series, return\n    if not hasattr(series, 'index') or type(series) is tuple:\n        return\n    if series.loc[{index}].iloc[-1] is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        private static TestCaseData[] TestDataFrameNonExceptionFunctions\n        {\n            get\n            {\n                var functions = new[]\n                {\n                    \".agg('mean', axis=0)\",\n                    \".aggregate('mean', axis=0)\",\n                    \".clip(100, 200)\",\n                    \".fillna(value=999)\",\n                    \".first('2S')\",\n                    \".isin([100])\",\n                    \".last('2S')\",\n                    \".melt()\"\n                };\n                \n                if (!IsNewerPandas()){\n                    var additionalFunctions = new[]\n                    {\n                    \".clip_lower(100)\",\n                    \".clip_upper(200)\",\n                    };\n                    functions.Concat(additionalFunctions);\n                }\n\n                var testCases = functions.SelectMany(x => new[]\n                {\n                    new TestCaseData(x, \"'SPY'\", true),\n                    new TestCaseData(x, \"symbol\", false),\n                    new TestCaseData(x, \"str(symbol.ID)\", false)\n                }).ToList();\n\n                testCases.AddRange(_parameterlessFunctions[\"DataFrame\"]);\n                return testCases.ToArray();\n            }\n        }\n\n        private static TestCaseData[] TestSeriesNonExceptionFunctions\n        {\n            get\n            {\n                var functions = new[]\n                {\n                    \".add_suffix('lean')\",\n                    \".add_prefix('lean')\",\n                    \".agg('mean', axis=0)\",\n                    \".aggregate('mean', axis=0)\",\n                    \".clip(100, 200)\",\n                    \".fillna(value=999)\",\n                    \".isin([100])\",\n                    \".searchsorted(200)\",\n                    \".value_counts()\"\n                };\n\n                if (!IsNewerPandas()){\n                    var additionalFunctions = new[]\n                    {\n                    \".clip_lower(100)\",\n                    \".clip_upper(200)\",\n                    };\n                    functions.Concat(additionalFunctions);\n                }\n\n\n                var testCases = functions.SelectMany(x => new[]\n                {\n                    new TestCaseData(x, \"'SPY'\", true),\n                    new TestCaseData(x, \"symbol\", false),\n                    new TestCaseData(x, \"str(symbol.ID)\", false)\n                })\n                .ToList();\n\n                testCases.AddRange(_parameterlessFunctions[\"Series\"]);\n                return testCases.ToArray();\n            }\n        }\n\n        private static TestCaseData[] TestDataFrameParameterlessFunctions => _parameterlessFunctions[\"DataFrameParameterless\"];\n\n        private static TestCaseData[] TestSeriesParameterlessFunctions => _parameterlessFunctions[\"SeriesParameterless\"];\n\n        private static TestCaseData[] TestDataFrameOtherParameterFunctions\n        {\n            get\n            {\n                var functions = new[]\n                {\n                    \"+\",\n                    \"-\",\n                    \"/\",\n                    \"*\",\n                    \"%\",\n                    \"**\",\n                    \"//\"\n                }\n                .SelectMany(x => new[]\n                {\n                    new TestCaseData($\" {x} other\", \"'SPY'\", true),\n                    new TestCaseData($\" {x} other\", \"symbol\", false),\n                    new TestCaseData($\" {x} other\", \"str(symbol.ID)\", false)\n                }).ToList();\n\n                functions.AddRange(_parameterlessFunctions[\"DataFrameOtherParameter\"]);\n                return functions.ToArray();\n            }\n        }\n\n        private static TestCaseData[] TestSeriesOtherParameterFunctions\n        {\n            get\n            {\n                var functions = new[]\n                {\n                    \"+\",\n                    \"-\",\n                    \"/\",\n                    \"*\",\n                    \"%\",\n                    \"**\",\n                    \"//\"\n                }\n                .SelectMany(x => new[]\n                {\n                    new TestCaseData($\" {x} other\", \"'SPY'\", true),\n                    new TestCaseData($\" {x} other\", \"symbol\", false),\n                    new TestCaseData($\" {x} other\", \"str(symbol.ID)\", false)\n                }).ToList();\n\n                functions.AddRange(_parameterlessFunctions[\"SeriesOtherParameter\"]);\n                return functions.ToArray();\n            }\n        }\n\n        private static Dictionary<string, TestCaseData[]> _parameterlessFunctions = GetParameterlessFunctions();\n\n        private static Dictionary<string, TestCaseData[]> GetParameterlessFunctions()\n        {\n            // Initialize the Python engine and begin allow thread\n            PythonInitializer.Initialize();\n\n            var functionsByType = new Dictionary<string, TestCaseData[]>();\n\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\"Test\",\n                    @\"import pandas\nfrom inspect import getmembers, isfunction, signature\n\nskipped = [ 'boxplot', 'hist', 'plot',        # <- Graphics\n    'agg', 'aggregate', 'align', 'bool','combine', 'corrwith', 'dot', 'drop',\n    'equals', 'ewm', 'fillna', 'filter', 'groupby', 'join', 'mask', 'melt',\n    'pivot', 'pivot_table', 'reindex_like', 'rename', 'reset_index', 'select_dtypes',\n    'slice_shift', 'swaplevel', 'to_clipboard', 'to_excel', 'to_feather', 'to_gbq',\n    'to_hdf', 'to_list', 'tolist', 'to_parquet', 'to_period', 'to_pickle', 'to_sql', 'to_xml',\n    'to_stata', 'to_timestamp', 'to_xarray', 'tshift', 'update', 'value_counts', 'where']\n\nnewPandas = int(pandas.__version__.split('.')[0]) >= 1\n\ndef getSimpleExceptionTestFunctions(cls):\n    functions = [ 'describe', 'mode']\n    if not newPandas:\n        functions.append('get_dtype_counts')\n        functions.append('get_ftype_counts')\n    for name, member in getmembers(cls):\n        if isfunction(member) and name.startswith('to') and name not in skipped:\n            functions.append(name)\n    return functions\n\nDataFrame = getSimpleExceptionTestFunctions(pandas.DataFrame)\nSeries = getSimpleExceptionTestFunctions(pandas.Series)\nskipped += set(DataFrame + Series)\n\ndef getParameterlessFunctions(cls):\n    functions = list()\n    for name, member in getmembers(cls):\n        if isfunction(member) and not name.startswith('_') and name not in skipped:\n            parameters = signature(member).parameters\n            count = 0\n            for parameter in parameters.values():\n                if parameter.default is parameter.empty:\n                    count += 1\n                else:\n                    break\n            if count < 2:\n                functions.append(name)\n    return functions\n\ndef getOtherParameterFunctions(cls):\n    functions = list()\n    for name, member in getmembers(pandas.DataFrame):\n        if isfunction(member) and not name.startswith('_') and name not in skipped:\n            parameters = signature(member).parameters\n            for parameter in parameters.values():\n                if parameter.name == 'other':\n                    functions.append(name)\n                    break\n    return functions\n\nDataFrameParameterless = getParameterlessFunctions(pandas.DataFrame)\nSeriesParameterless = getParameterlessFunctions(pandas.Series)\nDataFrameOtherParameter = getOtherParameterFunctions(pandas.DataFrame)\nSeriesOtherParameter = getOtherParameterFunctions(pandas.Series)\n\");\n                Func<string, string, TestCaseData[]> converter = (s, p) =>\n                {\n                    var list = (List<string>)module.GetAttr(s).AsManagedObject(typeof(List<string>));\n                    return list.SelectMany(x => new[]\n                    {\n                        new TestCaseData($\".{x}{p}\", \"'SPY'\", true),\n                        new TestCaseData($\".{x}{p}\", \"symbol\", false),\n                        new TestCaseData($\".{x}{p}\", \"str(symbol.ID)\", false)\n                    }\n                    ).ToArray();\n                };\n\n                functionsByType.Add(\"DataFrame\", converter(\"DataFrame\", \"()\"));\n                functionsByType.Add(\"Series\", converter(\"Series\", \"()\"));\n                functionsByType.Add(\"DataFrameParameterless\", converter(\"DataFrameParameterless\", \"()\"));\n                functionsByType.Add(\"SeriesParameterless\", converter(\"SeriesParameterless\", \"()\"));\n                functionsByType.Add(\"DataFrameOtherParameter\", converter(\"DataFrameOtherParameter\", \"(other)\"));\n                functionsByType.Add(\"SeriesOtherParameter\", converter(\"SeriesOtherParameter\", \"(other)\"));\n            }\n\n            return functionsByType;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PandasConverterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Custom;\nusing QuantConnect.Data.Custom.IconicTypes;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Tests.Common.Data.UniverseSelection;\nusing QuantConnect.Tests.ToolBox;\nusing QuantConnect.ToolBox;\nusing QuantConnect.Util;\nusing QuantConnect.Indicators;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public partial class PandasConverterTests\n    {\n        private PandasConverter _converter = new PandasConverter();\n        private bool _newerPandas;\n\n        private static bool IsNewerPandas()\n        {\n            bool newPandas;\n            using (Py.GIL())\n            {\n                var pandas = Py.Import(\"pandas\");\n                using var local = new PyDict();\n                local[\"pd\"] = pandas;\n                newPandas = PythonEngine.Eval(\"int(pd.__version__.split('.')[0]) >= 1\", locals: local).As<bool>();\n            }\n            return newPandas;\n        }\n\n        [SetUp]\n        public void Setup()\n        {\n            SymbolCache.Clear();\n            _newerPandas = IsNewerPandas();\n        }\n\n        [TearDown]\n        public void TearDown()\n        {\n            SymbolCache.Clear();\n        }\n\n        [Test]\n        public void HandlesBaseDataCollection([Values] bool flatten)\n        {\n            var converter = new PandasConverter();\n            var data = new[]\n            {\n                new EnumerableData\n                {\n                    Data = new List<BaseData>\n                    {\n                        new TradeBar(new DateTime(2020, 1, 2), Symbols.IBM, 101m, 102m, 100m, 101m, 10m),\n                        new TradeBar(new DateTime(2020, 1, 3), Symbols.IBM, 101m, 102m, 100m, 101m, 20m),\n                    },\n                    Symbol = Symbols.IBM,\n                    Time = new DateTime(2020, 1, 1)\n                }\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data, flatten: flatten);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                if (flatten)\n                {\n                    var indexNames = dataFrame.index.names.AsManagedObject(typeof(string[]));\n                    CollectionAssert.AreEqual(new[] { \"time\", \"symbol\" }, indexNames);\n\n                    Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                    var count = dataFrame.__len__().AsManagedObject(typeof(int));\n                    Assert.AreEqual(2, count);\n                    AssertFlattenBaseDataCollectionDataFrameTimes(data, dataFrame);\n                }\n                else\n                {\n                    var subDataFrame = dataFrame.loc[Symbols.IBM];\n                    Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                    var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                    Assert.AreEqual(1, count);\n                }\n            }\n        }\n\n        [Test]\n        public void HandlesBaseDataCollectionWithMultipleSymbols()\n        {\n            var converter = new PandasConverter();\n            var data = new[]\n            {\n                new EnumerableData\n                {\n                    Data = new List<BaseData>\n                    {\n                        new TradeBar(new DateTime(2020, 1, 2), Symbols.IBM, 101m, 102m, 100m, 101m, 10m),\n                        new TradeBar(new DateTime(2020, 1, 3), Symbols.IBM, 101m, 102m, 100m, 101m, 20m),\n                    },\n                    Symbol = Symbols.IBM,\n                    Time = new DateTime(2020, 1, 1)\n                },\n                new EnumerableData\n                {\n                    Data = new List<BaseData>\n                    {\n                        new TradeBar(new DateTime(2020, 1, 2), Symbols.SPY, 201m, 202m, 200m, 201m, 10m),\n                        new TradeBar(new DateTime(2020, 1, 3), Symbols.SPY, 201m, 202m, 200m, 201m, 20m),\n                        new TradeBar(new DateTime(2020, 1, 4), Symbols.SPY, 201m, 202m, 200m, 201m, 20m),\n                    },\n                    Symbol = Symbols.SPY,\n                    Time = new DateTime(2020, 1, 1)\n                }\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data, flatten: true);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var indexNames = dataFrame.index.names.AsManagedObject(typeof(string[]));\n                CollectionAssert.AreEqual(new[] { \"collection_symbol\", \"time\", \"symbol\" }, indexNames);\n\n                Assert.Multiple(() =>\n                {\n                    foreach (var collection in data)\n                    {\n                        var symbol = collection.Symbol;\n\n                        var subDataFrame = dataFrame.loc[symbol];\n                        Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)), $\"Empty sub-dataframe for {symbol}\");\n\n                        var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                        Assert.AreEqual(collection.Data.Count, count, $\"Unexpected data count for {symbol}\");\n\n                        var collectionTimes = subDataFrame.index.get_level_values(0);\n                        var symbols = subDataFrame.index.get_level_values(1);\n                        var times = subDataFrame[\"time\"];\n\n                        for (var i = 0; i < collection.Data.Count; i++)\n                        {\n                            var datum = collection.Data[i];\n                            Assert.AreEqual(collection.EndTime, collectionTimes[i].AsManagedObject(typeof(DateTime)));\n                            Assert.AreEqual(datum.Symbol, symbols[i].AsManagedObject(typeof(Symbol)));\n                            Assert.AreEqual(datum.EndTime, times[i].AsManagedObject(typeof(DateTime)));\n                        }\n                    }\n                });\n\n                AssertFlattenBaseDataCollectionDataFrameTimes(data, dataFrame);\n            }\n        }\n\n        private static void AssertFlattenBaseDataCollectionDataFrameTimes(EnumerableData[] data, dynamic dataFrame)\n        {\n            // For base data collections, the end time of each data point is added as a column\n            // And the time in the index is the collection's time\n            var columnNames = new List<string>();\n            foreach (var column in dataFrame.columns)\n            {\n                columnNames.Add(column.__str__().AsManagedObject(typeof(string)));\n            }\n            CollectionAssert.Contains(columnNames, \"time\");\n\n            var times = dataFrame.time.AsManagedObject(typeof(DateTime[]));\n            CollectionAssert.AreEqual(data.SelectMany(collection => collection.Select(x => x.EndTime)), times);\n        }\n\n        [Test]\n        public void HandlesEnumerableWithMultipleSymbols()\n        {\n            var converter = new PandasConverter();\n            var data = new List<BaseData>\n            {\n                new TradeBar(new DateTime(2020, 1, 2), Symbols.IBM, 101m, 102m, 100m, 101m, 10m),\n                new TradeBar(new DateTime(2020, 1, 3), Symbols.IBM, 101m, 102m, 100m, 101m, 20m),\n                new TradeBar(new DateTime(2020, 1, 2), Symbols.SPY_C_192_Feb19_2016, 51m, 52m, 50m, 51m, 100m),\n                new TradeBar(new DateTime(2020, 1, 3), Symbols.SPY_C_192_Feb19_2016, 51m, 52m, 50m, 51m, 200m),\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data, forceMultiValueSymbol: true);\n\n            using (Py.GIL())\n            {\n                Assert.Multiple(() =>\n                {\n                    foreach (var symbol in data.Select(x => x.Symbol).Distinct())\n                    {\n                        Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)), $\"Unexpected empty sub dataframe for {symbol}\");\n\n                        var subDataFrame = dataFrame.loc[symbol];\n                        Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                        var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                        Assert.AreEqual(2, count, $\"Unexpected rows count for {symbol} sub dataframe\");\n\n                        var dataCount = subDataFrame.values.__len__().AsManagedObject(typeof(int));\n                        Assert.AreEqual(2, dataCount, $\"Unexpected rows count for {symbol} sub dataframe\");\n                    }\n                });\n            }\n        }\n\n        [Test]\n        public void HandlesEmptyEnumerable()\n        {\n            var converter = new PandasConverter();\n            var rawBars = Enumerable.Empty<TradeBar>().ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsTrue(dataFrame.empty.AsManagedObject(typeof(bool)));\n            }\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            var history = GetHistory(Symbols.SPY, Resolution.Minute, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsTrue(dataFrame.empty.AsManagedObject(typeof(bool)));\n            }\n        }\n\n        [Test]\n        public void HandlesTradeBars()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.SPY;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new TradeBar(DateTime.UtcNow.AddMinutes(i), symbol, i + 101m, i + 102m, i + 100m, i + 101m, 0m))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var close = subDataFrame.loc[index].close.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Close, close);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            var history = GetHistory(symbol, Resolution.Minute, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var close = subDataFrame.loc[index].close.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Close, close);\n                }\n            }\n        }\n\n        [Test]\n        public void HandlesQuoteBars()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.EURUSD;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new QuoteBar(DateTime.UtcNow.AddMinutes(i), symbol, new Bar(i + 1.01m, i + 1.02m, i + 1.00m, i + 1.01m), 0m, new Bar(i + 1.01m, i + 1.02m, i + 1.00m, i + 1.01m), 0m))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var close = subDataFrame.loc[index].close.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Close, close);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            var history = GetHistory(symbol, Resolution.Minute, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var close = subDataFrame.loc[index].askclose.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Ask.Close, close);\n                }\n            }\n        }\n\n        [Test]\n        public void HandlesNullableValues()\n        {\n            var converter = new PandasConverter();\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new NullableValueData\n                {\n                    Symbol = Symbols.AAPL,\n                    EndTime = new DateTime(2020, 1, 1),\n                    NullableInt = null,\n                    NullableTime = null,\n                    NullableColumn = null\n                })\n                .ToArray();\n\n            rawBars[0].NullableInt = 0;\n            rawBars[1].NullableTime = new DateTime(2020, 1, 2);\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.AreEqual(2, dataFrame.columns.__len__().AsManagedObject(typeof(int)));\n                var count = dataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n            }\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            var history = GetHistory(Symbols.AAPL, Resolution.Daily, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.AreEqual(2, dataFrame.columns.__len__().AsManagedObject(typeof(int)));\n                var count = dataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n            }\n        }\n\n        /// <summary>\n        /// Specific issues for symbol LOW, reference GH issue #4886\n        /// </summary>\n        [Test]\n        public void HandlesOddTickers()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.LOW;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new TradeBar(DateTime.UtcNow.AddMinutes(i), symbol, i + 101m, i + 102m, i + 100m, i + 101m, 0m))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            var history = GetHistory(symbol, Resolution.Minute, rawBars);\n            dynamic dataFrame = converter.GetDataFrame(history);\n\n            // Add LOW to our symbol cache\n            SymbolCache.Set(\"LOW\", Symbols.LOW);\n\n            using (Py.GIL())\n            {\n\n                dynamic test = PyModule.FromString(\"testModule\",\n    $@\"\ndef Test(dataFrame):\n    data = dataFrame.loc['LOW']\n    if data.empty:\n        raise Exception('LOW history data is empty')\n    if data.__len__() != 10:\n        raise Exception('Expected 10 data points')\n    lowData = data.low\n    if lowData.empty:\n        raise Exception('LOW history low data is empty')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(dataFrame));\n\n            }\n        }\n\n        [Test]\n        public void BreakingOddTickers()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.LOW;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new TradeBar(DateTime.UtcNow.AddMinutes(i), symbol, i + 101m, i + 102m, i + 100m, i + 101m, 0m))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<TradeBar>\n            var history = GetHistory(symbol, Resolution.Minute, rawBars);\n            dynamic dataFrame = converter.GetDataFrame(history);\n\n            // Add LOW to our symbol cache\n            SymbolCache.Set(\"LOW\", Symbols.LOW);\n\n            using (Py.GIL())\n            {\n\n                var Test = PyModule.FromString(\"testModule\",\n    $@\"\ndef Test1(dataFrame):\n    # Should not throw, access all LOW ticker data\n    data = dataFrame.loc['LOW']\ndef Test2(dataFrame):\n    # Bad accessor, expected to throw\n    data = dataFrame.LOW\ndef Test3(dataFrame):\n    # Should not throw, access all LOW ticker data\n    data = dataFrame.loc['low']\ndef Test4(dataFrame):\n    # Should not throw, access data column low for all tickers\n    data = dataFrame.low\n\");\n\n                dynamic test1 = Test.GetAttr(\"Test1\");\n                dynamic test2 = Test.GetAttr(\"Test2\");\n                dynamic test3 = Test.GetAttr(\"Test3\");\n                dynamic test4 = Test.GetAttr(\"Test4\");\n\n                Assert.DoesNotThrow(() => test1(dataFrame));\n                Assert.Throws<PythonException>(() => test2(dataFrame));\n                Assert.DoesNotThrow(() => test3(dataFrame));\n                Assert.DoesNotThrow(() => test4(dataFrame));\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void BackwardsCompatibilityDataFrame_Subset(bool cache)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.droplevel('symbol')\n    data = data[['lastprice', 'quantity']][:-1]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_add_prefix(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.add_prefix('price_')['price_lastprice'].unstack(level=0)\n    data = data.iloc[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_add_suffix(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.add_suffix('_tick')['lastprice_tick'].unstack(level=0)\n    data = data.iloc[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_align(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    data = dataFrame.lastprice.unstack(level=0)\n    other = other.lastprice.unstack(level=0)\n    data, other = data.align(other, axis=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_apply(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).apply(np.sqrt)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_applymap(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).applymap(lambda x: x*2)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_asfreq(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).asfreq(freq='30S')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_asof(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, symbol):\n    idx = pd.DatetimeIndex(['2018-02-27 09:03:30'])\n    data = dataFrame.lastprice.unstack(level=0).asof(idx)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_assign(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.assign(tmp=lambda x: x.lastprice * 1.1)['tmp'].unstack(level=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_astype(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).astype('float16')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_at(string index, bool cache = false)\n        {\n            // Syntax like ({index},) deprecated in newer version of pandas\n            // Same result achievable by .loc[{index}]['lastprice']\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.at[({index},), 'lastprice']\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_at_time(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).at_time('04:00')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_axes(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    axes = dataFrame.axes[0]\n    if {index} not in axes.levels[0]:\n        raise ValueError('SPY was not found')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_between_time(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).between_time('02:00', '06:00')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_columns(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    columns = dataFrame.lastprice.unstack(level=0).columns\n    if {index} not in columns:\n        raise ValueError('SPY was not found')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_combine(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, other, symbol):\n    dataFrame = dataFrame.lastprice.unstack(level=0)\n    other = other.lastprice.unstack(level=0)\n    data = dataFrame.combine(other, np.minimum)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_concat(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, dataFrame2, symbol):\n    newDataFrame = pd.concat([dataFrame, dataFrame2])\n    data = newDataFrame['lastprice'].unstack(level=0).iloc[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_corrwith(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, other, symbol):\n    other = other.lastprice.unstack(level=0)\n    data = dataFrame.lastprice.unstack(level=0).corrwith(other)\n    data = data.loc[{index}]\n    if not np.isnan(data):\n        raise Exception('Data should be NaN')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_drop(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.drop(columns=['exchange']).lastprice.unstack(level=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_droplevel(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.droplevel('time').lastprice\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_dtypes(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).dtypes\n    data = data.loc[{index}]\n    if data != np.float64:\n        raise Exception('Data type is ' + str(data))\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_eval(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.eval('tmp=lastprice * 1.1')['tmp'].unstack(level=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_equals(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    if not dataFrame.equals(other):\n        raise Exception('Dataframe are not equal')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_ewm(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0)\n    data = data.ewm(com=0.5).mean()\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_expanding(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0)\n    data = data.expanding(2).sum()\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_explode(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.explode('lastprice').lastprice.unstack(level=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_filter(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.filter(items=['lastprice']).lastprice.unstack(level=0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_ftypes(string index, bool cache = false)\n        {\n            // ftypes deprecated in newer pandas; use dtypes instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0).ftypes\n    data = data.loc[{index}]\n    if str(data) != 'float64:dense':\n        raise Exception('Data type is ' + str(data))\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_get_OnProperty(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.get({index})\n    if data.empty:\n        raise Exception('Data is empty')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_getitem(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame['lastprice'][{index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_get_value_index(string index, bool cache = false)\n        {\n            // get_value deprecated in new Pandas; Syntax also deprecated; Use .at[] or .iat[] instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.get_value(({index},), 'lastprice')\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_get_value_column(string index, bool cache = false)\n        {\n            // get_value deprecated in new Pandas; use at[] or iat[] instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0)\n    idx = data.index[0]\n    data = data.get_value(idx, {index})\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_groupby(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(df, other, symbol):\n    df = pd.concat([df, other])\n    df = df.groupby(level=0).mean(numeric_only=True)\n    data = df.lastprice.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_iloc(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame['lastprice'].unstack(level=0).iloc[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_insert(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(level=0)\n    data.insert(0, 'nine', 999)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_index_levels_contains(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    if {index} not in dataFrame.index.levels[0]:\n        raise ValueError('SPY was not found')\").GetAttr(\"Test\");\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n\n        [TestCase(\"items\", \"'SPY'\", true)]\n        [TestCase(\"items\", \"symbol\")]\n        [TestCase(\"items\", \"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_items(string method, string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    for index, data in dataFrame.{method}():\n        pass\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_iterrows(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    for index, data in dataFrame.lastprice.unstack(level=0).iterrows():\n        pass\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_ix(string index, bool cache = false)\n        {\n            // ix deprecated in newer pandas; use loc and iloc instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame['lastprice'].unstack(level=0).ix[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_join(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, dataFrame2, symbol):\n    newDataFrame = dataFrame.join(dataFrame2, lsuffix='_')\n    data = newDataFrame['lastprice_'].unstack(level=0).iloc[-1][{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_loc(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.loc[{index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"['SPY','AAPL']\", true)]\n        [TestCase(\"symbols\")]\n        [TestCase(\"[str(symbols[0].ID), str(symbols[1].ID)]\")]\n        [TestCase(\"('SPY','AAPL')\", true)]\n        [TestCase(\"(str(symbols[0].ID), str(symbols[1].ID))\")]\n        public void BackwardsCompatibilityDataFrame_loc_list(string index, bool cache = false)\n        {\n            if (cache)\n            {\n                SymbolCache.Set(\"SPY\", Symbols.SPY);\n                SymbolCache.Set(\"AAPL\", Symbols.AAPL);\n            }\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbols):\n    data = dataFrame.lastprice.unstack(0)\n    data = data.loc[:, {index}]\").GetAttr(\"Test\");\n\n                var symbols = new List<Symbol> { Symbols.SPY, Symbols.AAPL };\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(symbols), symbols));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_loc_after_xs(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    time = dataFrame.index.get_level_values('time')[0]\n    dataFrame = dataFrame.xs(time, level='time')\n    data = dataFrame.loc[{index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_loc_OnProperty(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.loc[{index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_loc_SubDataFrame(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.loc[{index}].loc['2013-10-07 04:00:00']\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"*symbols\", true)]\n        [TestCase(\"*[str(symbol.ID) for symbol in symbols]\", true)]\n        [TestCase(\"'AAPL', 'GOOG'\", true)]\n        [TestCase(\"*symbols\", false)]\n        [TestCase(\"*[str(symbol.ID) for symbol in symbols]\", false)]\n        [TestCase(\"'AAPL', 'GOOG'\", false)]\n        public void BackwardsCompatibilityDataFrame_loc_slicers(string index, bool cache)\n        {\n            if (cache)\n            {\n                SymbolCache.Set(\"SPY\", Symbols.SPY);\n                SymbolCache.Set(\"AAPL\", Symbols.AAPL);\n                SymbolCache.Set(\"GOOG\", Symbols.GOOG);\n            }\n\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\ndef sortDataFrameIndex(dataFrame):\n    dataFrame.sort_index(ascending=True, inplace=True)\n\ndef indexDataFrameBySymbols(dataFrame, symbols):\n    # MultiIndex slicing requires the index to be lexsorted\n    sortDataFrameIndex(dataFrame)\n    return dataFrame.loc[(slice({index}), slice(None)), :]\n\ndef indexDataFrameBySymbol(dataFrame, symbol):\n    sortDataFrameIndex(dataFrame)\n    return dataFrame.loc[(symbol, slice(None)), :]\n\");\n                dynamic indexDataFrameBySymbols = testModule.GetAttr(\"indexDataFrameBySymbols\");\n                dynamic indexDataFrameBySymbol = testModule.GetAttr(\"indexDataFrameBySymbol\");\n\n                var symbols = new List<Symbol> { Symbols.SPY, Symbols.AAPL, Symbols.GOOG };\n                var dataFrame = GetTestDataFrame(symbols);\n\n                var looupkSymbols = new List<Symbol> { Symbols.AAPL, Symbols.GOOG };\n                dynamic indexedDataFrame = null;\n                Assert.DoesNotThrow(() => indexedDataFrame = indexDataFrameBySymbols(dataFrame, looupkSymbols));\n                Assert.IsNotNull(indexedDataFrame);\n\n                dynamic aaplDataFrame = null;\n                Assert.DoesNotThrow(() => aaplDataFrame = indexDataFrameBySymbol(indexedDataFrame, Symbols.AAPL));\n                Assert.IsNotNull(aaplDataFrame);\n\n                dynamic googDataFrame = null;\n                Assert.DoesNotThrow(() => googDataFrame = indexDataFrameBySymbol(indexedDataFrame, Symbols.GOOG));\n                Assert.IsNotNull(googDataFrame);\n\n                // SPY entries should not be present in the indexed data frame since it was not part of the lookup symbols\n                dynamic spyDataFrame = null;\n                Assert.Throws<PythonException>(() => spyDataFrame = indexDataFrameBySymbol(indexedDataFrame, Symbols.SPY));\n                Assert.IsNull(spyDataFrame);\n            }\n        }\n\n        [TestCase(\"2013-10-07 04:00:00\", true)]\n        [TestCase(\"2013-10-07 04:00:00\", false)]\n        public void BackwardsCompatibilityDataFrame_loc_slicers_none(string index, bool cache)\n        {\n            if (cache)\n            {\n                SymbolCache.Set(\"SPY\", Symbols.SPY);\n                SymbolCache.Set(\"AAPL\", Symbols.AAPL);\n            }\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame):\n    return dataFrame.loc[(slice(None), '{index}'), 'lastprice']\").GetAttr(\"Test\");\n\n                var symbols = new List<Symbol> { Symbols.SPY, Symbols.AAPL };\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(symbols)));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_mask(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(0)\n    data = data.mask(data > 0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_pivot_table(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, symbol):\n    df = dataFrame.reset_index()\n    table = pd.pivot_table(df, index=['symbol', 'time'], aggfunc='first')\n    data = table.lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_merge(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, dataFrame2, symbol):\n    newDataFrame = dataFrame.merge(dataFrame2, on='symbol', how='outer')\n    data = newDataFrame.loc[{index}]\n    if len(data) is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"nlargest\", \"'SPY'\", true)]\n        [TestCase(\"nlargest\", \"symbol\")]\n        [TestCase(\"nlargest\", \"str(symbol.ID)\")]\n        [TestCase(\"nsmallest\", \"'SPY'\", true)]\n        [TestCase(\"nsmallest\", \"symbol\")]\n        [TestCase(\"nsmallest\", \"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_nlarg_smallest(string method, string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.{method}(3, 'lastprice')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_pipe(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, other, symbol):\n    def mean_by_group(dataframe, level):\n        return dataframe.groupby(level=level).mean(numeric_only=True)\n\n    df = pd.concat([dataFrame, other])\n    data = df.pipe(mean_by_group, level=0)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_pop(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.pop('lastprice')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_query(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.query('lastprice > 100').lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_query_index(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    time = '2011-02-01'\n    data = dataFrame.lastprice.unstack(0).query('index > @time')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_reindex_like(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    data = other.reindex_like(dataFrame)\n    data = data.lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_rename(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            var rename = \"columns={'lastprice': 'price', 'B': 'c'}\";\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.rename({rename})['price'].unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_reorder_levels(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.reorder_levels(['time', 'symbol']).lastprice.unstack(1)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_resample(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(0)\n    data = data.resample('2S').sum()\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_reset_index(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(0).reset_index('time')\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_rolling(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.rolling(2).sum(numeric_only=True)\n    data = data.lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_select_dtypes(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.select_dtypes(exclude=['int']).lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_set_value(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            // set_value deprecated in newer pandas; use .at[] or .iat instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    idx = dataFrame.first_valid_index()\n    data = dataFrame.set_value(idx, 'lastprice', 100).lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 3), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_shift(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.shift().lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_sort_values(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.sort_values(by=['lastprice']).lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_swapaxes(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(0).swapaxes('index', 'columns')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_swaplevel(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.swaplevel().lastprice.unstack(1)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_take(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.take([0, 3]).lastprice.unstack(0)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_transform(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.unstack(0).transform(np.sqrt)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_T(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.T.iloc[0]\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_transpose(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.transpose().iloc[0]\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_series_shift(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom datetime import timedelta as d\ndef Test(dataFrame, symbol):\n    series = dataFrame.droplevel(0)\n    data = series.shift(freq=d(1))\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_tz_localize_convert(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.tz_localize('UTC', level=1)\n    data = data.tz_convert('America/New_York', level=1)\n    data = data.lastprice.unstack(0)[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_unstack_lastprice(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.unstack(level=0).lastprice[{index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_unstack_loc_loc(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    df2 = dataFrame.unstack(level=0)\n    df3 = df2.loc[:,'lastprice']\n    data = df3.loc[:, {index}]\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_unstack_get(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    df2 = dataFrame.lastprice.unstack(level=0)\n    data = df2.get({index})\n    if data.empty:\n        raise Exception('Data is empty')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_update(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            var other = \"{'lastprice': ['d', 'e', 'f']}\";\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, symbol):\n    other = pd.DataFrame({other}, index=dataFrame.index)\n    dataFrame.update(other)\n    data = dataFrame.lastprice.unstack(0)[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 3), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_where(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    dataFrame = dataFrame.lastprice.unstack(0)\n    data = dataFrame.where(dataFrame > 167)\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 3), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilityDataFrame_xs(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.xs({index})\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol)\")]\n        public void BackwardsCompatibilitySeries__str__(string symbol, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\nfrom datetime import datetime as dt\ndef Test(dataFrame, symbol):\n    close = dataFrame.lastprice.unstack(0)\n    to_append = pd.Series([100], name={symbol}, index=pd.Index([dt.now()], name='time'))\n    result = pd.concat([close, to_append], ignore_index=True)\n    return str([result[x] for x in [symbol]])\").GetAttr(\"Test\");\n                var result = \"Remapper\";\n                Assert.DoesNotThrow(() => result = test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n                // result should not contain \"Remapper\" string because the test\n                // returns the string representation of a Series object\n                Assert.False(result.Contains(\"Remapper\"));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol)\")]\n        public void BackwardsCompatibilitySeries__repr__(string symbol, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\nfrom datetime import datetime as dt\ndef Test(dataFrame, symbol):\n    close = dataFrame.lastprice.unstack(0)\n    to_append = pd.Series([100], name={symbol}, index=pd.Index([dt.now()], name='time'))\n    result = pd.concat([close, to_append], ignore_index=True)\n    return repr([result[x] for x in [symbol]])\").GetAttr(\"Test\");\n                var result = \"Remapper\";\n                Assert.DoesNotThrow(() => result = test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n                // result should not contain \"Remapper\" string because the test\n                // returns the string representation of a Series object\n                Assert.False(result.Contains(\"Remapper\"));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_align(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    data = dataFrame.lastprice\n    other = other.lastprice\n    data, other = data.align(other, axis=0)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_apply(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.apply(np.sqrt)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_asfreq(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.asfreq(freq='30S')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_asof(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, symbol):\n    idx = pd.DatetimeIndex(['2018-02-27 09:03:30'])\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.asof(idx)\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_astype(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    data = dataFrame.lastprice.astype('float16')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_at_time(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.at_time('04:00')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_between(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.between(100, 200)\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_between_time(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.between_time('02:00', '06:00')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_combine(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, other, symbol):\n    series = dataFrame.lastprice\n    other = other.lastprice\n    data = series.combine(other, np.minimum)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_drop(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    dt = series.first_valid_index()[1]\n    data = series.drop(dt, level=1)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 2), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_droplevel(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.droplevel('time')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_equals(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    series = dataFrame.lastprice\n    other = other.lastprice\n    if not series.equals(other):\n        raise Exception('Dataframe are not equal')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_ewm(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.ewm(com=0.5).mean()\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_expanding(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.expanding(2).sum()\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_filter(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.filter(like='04:00')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_first(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.first('2S')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_get(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.get({index})\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_get_value(string index, bool cache = false)\n        {\n            // get_value deprecated in new Pandas; Use .at[] or .iat[] instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    dt = series.first_valid_index()[1]\n    data = series.get_value(({index}, dt))\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_groupby(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(df, other, symbol):\n    series = pd.concat([df, other]).lastprice\n    data = series.groupby(level=0).mean()\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_last(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice.droplevel(0)\n    data = series.last('2S')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_map(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            var map = \"map({167: 100})\";\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.{map}\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_mask(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.mask(series > 0)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_pipe(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, other, symbol):\n    def mean_by_group(dataframe, level):\n        return dataframe.groupby(level=level).mean()\n\n    df = pd.concat([dataFrame, other]).lastprice\n    data = df.pipe(mean_by_group, level=0)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_reindex_like(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, other, symbol):\n    series = dataFrame.lastprice\n    other = other.lastprice\n    data = other.reindex_like(series)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), GetTestDataFrame(Symbols.AAPL), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_rename(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.rename('price')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_repeat(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.repeat(3)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_reorder_levels(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.reorder_levels(['time', 'symbol'])\n    data = data.unstack(1)[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_resample(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.resample('2S', level=1).mean()\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_reset_index(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.reset_index('time')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_rolling(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.rolling(2).sum()\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_set_value(string index, bool cache = false)\n        {\n            // set_value deprecated in newer pandas; Use .at[] or .iat[] instead\n            if (_newerPandas)\n            {\n                return;\n            }\n\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    idx = series.first_valid_index()\n    data = series.set_value(idx, 100)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_shift(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.shift()\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_swapaxes(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.swapaxes('index', 'index')\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_swaplevel(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.swaplevel()\n    data = data.unstack(0).loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_take(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.take([0, 3])\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 10), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_transform(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport numpy as np\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.transform([np.sqrt, np.exp])\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_T(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.T\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_transpose(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.transpose()\n    data = data[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_tz_localize_convert(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.tz_localize('UTC', level=1)\n    data = data.tz_convert('America/New_York', level=1)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_update(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nimport pandas as pd\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    other = pd.Series(['d', 'e', 'f'], index=series.index)\n    series.update(other)\n    data = series.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 3), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_where(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.where(series > 167)\n    data = data.loc[{index}]\n    if data is 0:\n        raise Exception('Data is zero')\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY, 3), Symbols.SPY));\n            }\n        }\n\n        [TestCase(\"'SPY'\", true)]\n        [TestCase(\"symbol\")]\n        [TestCase(\"str(symbol.ID)\")]\n        public void BackwardsCompatibilitySeries_xs(string index, bool cache = false)\n        {\n            if (cache) SymbolCache.Set(\"SPY\", Symbols.SPY);\n\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\ndef Test(dataFrame, symbol):\n    series = dataFrame.lastprice\n    data = series.xs({index})\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n\n        [Test]\n        public void NotBackwardsCompatibilityDataFrame_index_levels_contains_ticker_notInCache()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    @\"\ndef Test(dataFrame, symbol):\n    if 'SPY' not in dataFrame.index.levels[0]:\n        raise ValueError('SPY was not found')\").GetAttr(\"Test\");\n                Assert.Throws<PythonException>(() => test(GetTestDataFrame(Symbols.SPY), Symbols.SPY));\n            }\n        }\n\n        [Test]\n        public void HandlesTradeTicks()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.SPY;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new Tick(symbol, $\"1440{i:D2}00,167{i:D2}00,1{i:D2},T,T,0\", new DateTime(2013, 10, 7)))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                Assert.IsTrue(subDataFrame.get(\"askprice\") == null);\n                Assert.IsTrue(subDataFrame.get(\"exchange\") != null);\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].lastprice.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].LastPrice, value);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            var history = GetHistory(symbol, Resolution.Tick, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                Assert.IsTrue(subDataFrame.get(\"askprice\") == null);\n                Assert.IsTrue(subDataFrame.get(\"exchange\") != null);\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].lastprice.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].LastPrice, value);\n                }\n            }\n        }\n\n        [Test]\n        public void HandlesQuoteTicks()\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.EURUSD;\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i => new Tick(DateTime.UtcNow.AddMilliseconds(100 * i), symbol, 0.99m, 1.01m))\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                Assert.IsTrue(subDataFrame.get(\"askprice\") != null);\n                Assert.IsTrue(subDataFrame.get(\"exchange\") == null);\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].lastprice.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].LastPrice, value);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<QuoteBar>\n            var history = GetHistory(symbol, Resolution.Tick, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                Assert.IsTrue(subDataFrame.get(\"askprice\") != null);\n                Assert.IsTrue(subDataFrame.get(\"exchange\") == null);\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].askprice.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].AskPrice, value);\n                }\n            }\n        }\n\n\n        private static Resolution[] ResolutionCases = { Resolution.Tick, Resolution.Minute, Resolution.Second };\n        private static Symbol[] SymbolCases = { Symbols.Fut_SPY_Feb19_2016, Symbols.Fut_SPY_Mar19_2016, Symbols.SPY_C_192_Feb19_2016, Symbols.SPY_P_192_Feb19_2016 };\n\n        [Test]\n        public void HandlesOpenInterestTicks([ValueSource(nameof(ResolutionCases))] Resolution resolution, [ValueSource(nameof(SymbolCases))] Symbol symbol)\n        {\n            // Arrange\n            var converter = new PandasConverter();\n            var tickType = TickType.OpenInterest;\n            var dataType = LeanData.GetDataType(resolution, tickType);\n            var subcriptionDataConfig = new SubscriptionDataConfig(dataType, symbol, resolution,\n                                                                   TimeZones.Chicago, TimeZones.Chicago,\n                                                                   tickType: tickType, fillForward: false,\n                                                                   extendedHours: true, isInternalFeed: true);\n            var openinterest = new List<OpenInterest>();\n            for (int i = 0; i < 10; i++)\n            {\n                var line = $\"{1000 * i},{11 * i}\";\n                var openInterestTicks = new OpenInterest(subcriptionDataConfig, symbol, line, new DateTime(2017, 10, 10));\n                openinterest.Add(openInterestTicks);\n            }\n\n            // Act\n            dynamic dataFrame = converter.GetDataFrame(openinterest);\n\n            //Assert\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                Assert.IsTrue(subDataFrame.get(\"openinterest\") != null);\n\n                var count = subDataFrame.shape[0].AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].openinterest.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(openinterest[i].Value, value);\n                }\n            }\n\n        }\n\n        [Test]\n        [TestCase(typeof(CustomData), \"yyyy-MM-dd\")]\n        [TestCase(typeof(FxcmVolume), \"yyyyMMdd HH:mm\")]\n        public void HandlesCustomDataBars(Type type, string format)\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.LTCUSD;\n\n            var config = GetSubscriptionDataConfig<BaseData>(symbol, Resolution.Daily);\n            var custom = Activator.CreateInstance(type) as BaseData;\n            if (type == typeof(CustomData)) custom.Reader(config, \"date,open,high,low,close,transactions\", DateTime.UtcNow, false);\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i =>\n                {\n                    var line = $\"{DateTime.UtcNow.AddDays(i).ToStringInvariant(format)},{i + 101},{i + 102},{i + 100},{i + 101},{i + 101}\";\n                    return custom.Reader(config, line, DateTime.UtcNow.AddDays(i), false);\n                })\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<BaseData>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n\n                    var transactions = subDataFrame.loc[index].transactions.AsManagedObject(typeof(decimal));\n                    var expected = (rawBars[i] as DynamicData)?.GetProperty(\"transactions\");\n                    expected = expected ?? type.GetProperty(\"Transactions\")?.GetValue(rawBars[i]);\n                    Assert.AreEqual(expected, transactions);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<BaseData>\n            var history = GetHistory(symbol, Resolution.Daily, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n                    var transactions = subDataFrame.loc[index].transactions.AsManagedObject(typeof(decimal));\n                    var expected = (rawBars[i] as DynamicData)?.GetProperty(\"transactions\");\n                    expected = expected ?? type.GetProperty(\"Transactions\")?.GetValue(rawBars[i]);\n                    Assert.AreEqual(expected, transactions);\n                }\n            }\n        }\n\n        [Test]\n        public void HandlesCustomDataWithValueColumn()\n        {\n            // Reproduce issue #5596\n            // Value column data is duplicated in series\n\n            var converter = new PandasConverter();\n            var symbol = Symbols.LTCUSD;\n\n            var config = GetSubscriptionDataConfig<BaseData>(symbol, Resolution.Daily);\n            var custom = Activator.CreateInstance(typeof(CustomData)) as BaseData;\n            custom.Reader(config, \"Date,Value\", DateTime.UtcNow, false);\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i =>\n                {\n                    var line = $\"{DateTime.UtcNow.AddDays(i).ToStringInvariant(\"yyyy-MM-dd\")},{i + 40000}\";\n                    return custom.Reader(config, line, DateTime.UtcNow.AddDays(i), false);\n                })\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<BaseData>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<Slices>\n            var history = GetHistory(symbol, Resolution.Daily, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n                }\n            }\n        }\n\n        [Test]\n        [TestCase(typeof(SubTradeBar), \"SubProperty\")]\n        [TestCase(typeof(SubSubTradeBar), \"SubSubProperty\")]\n        public void HandlesCustomDataBarsInheritsFromTradeBar(Type type, string propertyName)\n        {\n            var converter = new PandasConverter();\n            var symbol = Symbols.LTCUSD;\n\n            var config = GetSubscriptionDataConfig<UnlinkedDataTradeBar>(symbol, Resolution.Daily);\n            dynamic custom = Activator.CreateInstance(type);\n\n            var rawBars = Enumerable\n                .Range(0, 10)\n                .Select(i =>\n                {\n                    var line = $\"{DateTime.UtcNow.AddDays(i).ToStringInvariant(\"yyyyMMdd HH:mm\")},{i + 101},{i + 102},{i + 100},{i + 101},{i + 101}\";\n                    return custom.Reader(config, line, DateTime.UtcNow.AddDays(i), false) as BaseData;\n                })\n                .ToArray();\n\n            // GetDataFrame with argument of type IEnumerable<BaseData>\n            dynamic dataFrame = converter.GetDataFrame(rawBars);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 10);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n\n                    var transactions = subDataFrame.loc[index][propertyName.ToLowerInvariant()].AsManagedObject(typeof(decimal));\n                    var expected = type.GetProperty(propertyName)?.GetValue(rawBars[i]);\n                    Assert.AreEqual(expected, transactions);\n                }\n            }\n\n            // GetDataFrame with argument of type IEnumerable<BaseData>\n            var history = GetHistory(symbol, Resolution.Daily, rawBars);\n            dataFrame = converter.GetDataFrame(history);\n\n            using (Py.GIL())\n            {\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var subDataFrame = dataFrame.loc[symbol];\n                Assert.IsFalse(subDataFrame.empty.AsManagedObject(typeof(bool)));\n\n                var count = subDataFrame.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n\n                for (var i = 0; i < count; i++)\n                {\n                    var index = subDataFrame.index[i];\n                    var value = subDataFrame.loc[index].value.AsManagedObject(typeof(decimal));\n                    Assert.AreEqual(rawBars[i].Value, value);\n                }\n            }\n        }\n\n        private static object[] SpotMarketCases => LeanDataReaderTests.SpotMarketCases;\n        private static object[] OptionAndFuturesCases => LeanDataReaderTests.OptionAndFuturesCases;\n\n        [Test, TestCaseSource(nameof(SpotMarketCases))]\n        public void HandlesLeanDataReaderOutputForSpotMarkets(string securityType, string market, string resolution, string ticker, string fileName, int rowsInfile, double sumValue)\n        {\n            using (Py.GIL())\n            {\n                // Arrange\n                var dataFolder = \"../../../Data\";\n                var filepath = LeanDataReaderTests.GenerateFilepathForTesting(dataFolder, securityType, market, resolution, ticker, fileName);\n                var leanDataReader = new LeanDataReader(filepath);\n                var data = leanDataReader.Parse();\n                var converter = new PandasConverter();\n                // Act\n                dynamic df = converter.GetDataFrame(data);\n                // Assert\n                Assert.AreEqual(rowsInfile, df.shape[0].AsManagedObject(typeof(int)));\n\n                int columnsNumber = df.shape[1].AsManagedObject(typeof(int));\n                if (columnsNumber == 3 || columnsNumber == 6)\n                {\n                    Assert.AreEqual(sumValue, df.get(\"lastprice\").sum().AsManagedObject(typeof(double)), 1e-4);\n                }\n                else\n                {\n                    Assert.AreEqual(sumValue, df.get(\"close\").sum().AsManagedObject(typeof(double)), 1e-4);\n                }\n            }\n        }\n\n        [Test, TestCaseSource(nameof(OptionAndFuturesCases))]\n        public void HandlesLeanDataReaderOutputForOptionAndFutures(string composedFilePath, Symbol symbol, int rowsInfile, double sumValue)\n        {\n            using (Py.GIL())\n            {\n                // Arrange\n                var leanDataReader = new LeanDataReader(composedFilePath);\n                var data = leanDataReader.Parse();\n                var converter = new PandasConverter();\n                // Act\n                dynamic df = converter.GetDataFrame(data);\n                // Assert\n                Assert.AreEqual(rowsInfile, df.shape[0].AsManagedObject(typeof(int)));\n\n                int columnsNumber = df.shape[1].AsManagedObject(typeof(int));\n                var lastPrice = df.get(\"lastprice\");\n                if (lastPrice != null)\n                {\n                    Assert.AreEqual(sumValue, lastPrice.sum().AsManagedObject(typeof(double)), 1e-4);\n                }\n                else if (columnsNumber == 1)\n                {\n                    Assert.AreEqual(sumValue, df.get(\"openinterest\").sum().AsManagedObject(typeof(double)), 1e-4);\n                }\n                else\n                {\n                    Assert.AreEqual(sumValue, df.get(\"close\").sum().AsManagedObject(typeof(double)), 1e-4);\n                }\n            }\n        }\n\n        [Test]\n        public void AcceptsPythonDictAsIndicatorData()\n        {\n            using (Py.GIL())\n            {\n                dynamic test = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom QuantConnect.Python import PandasConverter\nfrom QuantConnect.Indicators import IndicatorDataPoint;\ndef Test():\n    pdConverter = PandasConverter()\n    return pdConverter.GetIndicatorDataFrame({{'ind': [IndicatorDataPoint()]}})\").GetAttr(\"Test\");\n\n                Assert.DoesNotThrow(() => test());\n            }\n        }\n\n        [Test]\n        public void DoesntAcceptOtherPythonObjectRatherThanDict()\n        {\n            using (Py.GIL())\n            {\n                dynamic tests = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom QuantConnect.Python import PandasConverter\nfrom QuantConnect.Indicators import IndicatorDataPoint;\npdConverter = PandasConverter()\ndef Test1():\n    pdConverter.GetIndicatorDataFrame([\"\"ind\"\", IndicatorDataPoint()])\ndef Test2():\n    pdConverter.GetIndicatorDataFrame(IndicatorDataPoint())\ndef Test3():\n    pdConverter.GetIndicatorDataFrame({{'ind': IndicatorDataPoint()}})\");\n\n                dynamic test1 = tests.GetAttr(\"Test1\");\n                dynamic test2 = tests.GetAttr(\"Test2\");\n                dynamic test3 = tests.GetAttr(\"Test3\");\n\n                Assert.That(() => test1(), Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>());\n                Assert.That(() => test2(), Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>());\n                Assert.That(() => test3(), Throws.InstanceOf<ClrBubbledException>().With.InnerException.InstanceOf<ArgumentException>());\n            }\n        }\n\n        [Test]\n        public void ReturnsTheCorrectDataInTheDataFrameFromPyDict()\n        {\n            using (Py.GIL())\n            {\n                dynamic tests = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom datetime import datetime, timedelta\nfrom QuantConnect.Python import PandasConverter\nfrom QuantConnect.Indicators import IndicatorDataPoint;\n\ndef DataFrameContainsCorrectData():\n    dateTime = datetime(2018, 1, 1)\n    makePoint = lambda i: IndicatorDataPoint(dateTime + timedelta(minutes=i), i)\n    indicator1DataPoints = [makePoint(i) for i in range(10)]\n    indicator2DataPoints = [makePoint(i) for i in range(5)]\n    indicator3DataPoints = []\n    pdConverter = PandasConverter()\n    dataFrame = pdConverter.GetIndicatorDataFrame({{\n        'ind1': indicator1DataPoints,\n        'ind2': indicator2DataPoints,\n        'ind3': indicator3DataPoints\n    }})\n\n    hasData = lambda key, data: dataFrame[key].tolist()[:len(data)] == [point.Value for point in data]\n\n    return (\n        dataFrame.shape == (10, 3) and\n        dataFrame.columns.tolist() == ['ind1', 'ind2', 'ind3'] and\n        dataFrame.index.tolist() == [point.EndTime for point in indicator1DataPoints] and\n        hasData('ind1', indicator1DataPoints) and\n        hasData('ind2', indicator2DataPoints) and\n        hasData('ind3', indicator3DataPoints)\n    )\n\ndef DataFrameIsEmpty():\n    indicatorDataPoints = []\n    pdConverter = PandasConverter()\n    dataFrame = pdConverter.GetIndicatorDataFrame({{'ind1': indicatorDataPoints}})\n\n    return dataFrame.empty\");\n\n                dynamic dataFrameContainsCorrectData = tests.GetAttr(\"DataFrameContainsCorrectData\");\n                dynamic dataFrameIsEmpty = tests.GetAttr(\"DataFrameIsEmpty\");\n\n                Assert.IsTrue(dataFrameContainsCorrectData().As<bool>());\n                Assert.IsTrue(dataFrameIsEmpty().As<bool>());\n            }\n        }\n\n        [Test]\n        public void ReturnsTheCorrectDataInTheDataFrameFromDictionary()\n        {\n            using (Py.GIL())\n            {\n                var dateTime = new DateTime(2018, 1, 1);\n                Func<int, IndicatorDataPoint> makePoint = i => new IndicatorDataPoint(dateTime.AddMinutes(i), i);\n                var indicator1DataPoints = Enumerable.Range(0, 10).Select(i => makePoint(i)).ToList();\n                var indicator2DataPoints = Enumerable.Range(0, 5).Select(i => makePoint(i)).ToList();\n                var indicator3DataPoints = new List<IndicatorDataPoint>();\n\n                var pdConverter = new PandasConverter();\n                var dataFrame = pdConverter.GetIndicatorDataFrame(new Dictionary<string, List<IndicatorDataPoint>>\n                {\n                    {\"ind1\", indicator1DataPoints},\n                    {\"ind2\", indicator2DataPoints},\n                    {\"ind3\", indicator3DataPoints}\n                });\n\n                Func<string, List<double>> getIndicatorData = key => dataFrame.GetItem(key).GetAttr(\"tolist\").Invoke().As<List<double>>();\n                CollectionAssert.AreEqual(new int[] { 10, 3 }, dataFrame.GetAttr(\"shape\").As<int[]>());\n                CollectionAssert.AreEqual(new string[] { \"ind1\", \"ind2\", \"ind3\" }, dataFrame.GetAttr(\"columns\").As<string[]>());\n                CollectionAssert.AreEqual(indicator1DataPoints.Select(point => point.EndTime).ToList(), dataFrame.GetAttr(\"index\").GetAttr(\"tolist\").Invoke().As<List<DateTime>>());\n                CollectionAssert.AreEqual(indicator1DataPoints.Select(point => point.Value), getIndicatorData(\"ind1\").GetRange(0, indicator1DataPoints.Count));\n                CollectionAssert.AreEqual(indicator2DataPoints.Select(point => point.Value), getIndicatorData(\"ind2\").GetRange(0, indicator2DataPoints.Count));\n                CollectionAssert.AreEqual(indicator3DataPoints.Select(point => point.Value), getIndicatorData(\"ind3\").GetRange(0, indicator3DataPoints.Count));\n            }\n        }\n\n        [TestCaseSource(nameof(GetHistoryWithDuplicateTimes))]\n        public void HandlesSlicesWithDuplicateTimeStamps(Symbol symbol, IEnumerable<Slice> data, string expectedDataFrameString)\n        {\n            var converter = new PandasConverter();\n            dynamic dataFrame = null;\n            Assert.DoesNotThrow(() => dataFrame = converter.GetDataFrame(data));\n\n            using (Py.GIL())\n            {\n                Assert.AreEqual(expectedDataFrameString.Replace(\"\\n\", string.Empty).Replace(\"\\r\", string.Empty),\n                    dataFrame.to_string().As<string>().Replace(\"\\n\", string.Empty).Replace(\"\\r\", string.Empty));\n            }\n        }\n\n        [Test]\n        public void RunDataFrameFromTickHistoryRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\n                \"PandasDataFrameFromMultipleTickTypeTickHistoryRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"0\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"0%\"},\n                    {\"Drawdown\", \"0%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"0%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0\"},\n                    {\"Tracking Error\", \"0\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$0.00\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n\n        [Test]\n        public void ConcatenatesDataFrames()\n        {\n            using (Py.GIL())\n            {\n                var test = PyModule.FromString(\"ConcatenatesDataFrames\",\n                    @\"\nimport pandas as pd\n\nindex1 = pd.Index(['X', 'Y'], name=\"\"Class\"\")\ndf1 = pd.DataFrame([[1, 2], [3, 4]], index=index1, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex2 = pd.Index(['L', 'M'], name=\"\"Class\"\")\ndf2 = pd.DataFrame([[5, 6], [7, 8]], index=index2, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex3 = pd.Index(['R', 'S'], name=\"\"Class\"\")\ndf3 = pd.DataFrame([[9, 10], [11, 12]], index=index3, columns=[\"\"A\"\", \"\"B\"\"])\n\nconcatenated = pd.concat([df1, df2, df3])\n\");\n\n                using var df1 = test.GetAttr(\"df1\");\n                using var df2 = test.GetAttr(\"df2\");\n                using var df3 = test.GetAttr(\"df3\");\n                using var expected = test.GetAttr(\"concatenated\");\n\n                using var concatenated = PandasConverter.ConcatDataFrames(new[] { df1, df2, df3 }, sort: false, dropna: false);\n\n                Assert.AreEqual(expected.GetAttr(\"to_string\").Invoke().GetAndDispose<string>(),\n                    concatenated.GetAttr(\"to_string\").Invoke().GetAndDispose<string>());\n            }\n        }\n\n        [Test]\n        public void ConcatenatesDataFramesWithAddedIndexLevel()\n        {\n            using (Py.GIL())\n            {\n                var test = PyModule.FromString(\"ConcatenatesDataFramesWithAddedIndexLevel\",\n                    @\"\nimport pandas as pd\n\nindex1 = pd.Index(['X', 'Y'], name=\"\"Class\"\")\ndf1 = pd.DataFrame([[1, 2], [3, 4]], index=index1, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex2 = pd.Index(['L', 'M'], name=\"\"Class\"\")\ndf2 = pd.DataFrame([[5, 6], [7, 8]], index=index2, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex3 = pd.Index(['R', 'S'], name=\"\"Class\"\")\ndf3 = pd.DataFrame([[9, 10], [11, 12]], index=index3, columns=[\"\"A\"\", \"\"B\"\"])\n\nconcatenated = pd.concat([df1, df2, df3], keys=['df1', 'df2', 'df3'], names=['source_df'])\n\");\n\n                using var df1 = test.GetAttr(\"df1\");\n                using var df2 = test.GetAttr(\"df2\");\n                using var df3 = test.GetAttr(\"df3\");\n                using var expected = test.GetAttr(\"concatenated\");\n\n                using var concatenated = PandasConverter.ConcatDataFrames(new[] { df1, df2, df3 },\n                    keys: new[] { \"df1\", \"df2\", \"df3\" },\n                    names: new[] { \"source_df\" },\n                    sort: false,\n                    dropna: false);\n\n                Assert.AreEqual(expected.GetAttr(\"to_string\").Invoke().GetAndDispose<string>(),\n                    concatenated.GetAttr(\"to_string\").Invoke().GetAndDispose<string>());\n            }\n        }\n\n        [Test]\n        public void ConcatenatesDataFramesWithAddedMultiIndexLevel()\n        {\n            using (Py.GIL())\n            {\n                var test = PyModule.FromString(\"ConcatenatesDataFramesWithAddedMultiIndexLevel\",\n                    @\"\nimport pandas as pd\n\nindex1 = pd.Index(['X', 'Y'], name='Class')\ndf1 = pd.DataFrame([[1, 2], [3, 4]], index=index1, columns=['A', 'B'])\n\nindex2 = pd.Index(['L', 'M'], name='Class')\ndf2 = pd.DataFrame([[5, 6], [7, 8]], index=index2, columns=['A', 'B'])\n\nindex3 = pd.Index(['R', 'S'], name='Class')\ndf3 = pd.DataFrame([[9, 10], [11, 12]], index=index3, columns=['A', 'B'])\n\nindex4 = pd.Index(['A', 'B'], name='Class')\ndf4 = pd.DataFrame([[11, 12], [13, 14]], index=index4, columns=['A', 'B'])\n\nconcatenated = pd.concat([df1, df2, df3, df4],\n                         keys=[('Category 1', 'DF1'), ('Category 1', 'DF2'), ('Category 2', 'DF3'), ('Category 2', 'DF4')],\n                         names=['Category', 'Source DF'])\n\");\n\n                using var df1 = test.GetAttr(\"df1\");\n                using var df2 = test.GetAttr(\"df2\");\n                using var df3 = test.GetAttr(\"df3\");\n                using var df4 = test.GetAttr(\"df4\");\n                using var expected = test.GetAttr(\"concatenated\");\n\n                using var concatenated = PandasConverter.ConcatDataFrames(new[] { df1, df2, df3, df4 },\n                    keys: new[] {\n                        new[] { \"Category 1\", \"DF1\" },\n                        new[] { \"Category 1\", \"DF2\" },\n                        new[] { \"Category 2\", \"DF3\" },\n                        new[] { \"Category 2\", \"DF4\" },\n                    },\n                    names: new[] { \"Category\", \"Source DF\" },\n                    sort: false,\n                    dropna: false);\n\n                using var index = concatenated.GetAttr(\"index\");\n                using var getLevelValues = index.GetAttr(\"get_level_values\");\n                var level1 = getLevelValues.Invoke(0).GetAndDispose<string[]>();\n                var level2 = getLevelValues.Invoke(1).GetAndDispose<string[]>();\n                var level3 = getLevelValues.Invoke(2).GetAndDispose<string[]>();\n\n\n\n                CollectionAssert.AreEqual(\n                    new[] { \"Category 1\", \"Category 1\", \"Category 1\", \"Category 1\", \"Category 2\", \"Category 2\", \"Category 2\", \"Category 2\" },\n                    level1);\n                CollectionAssert.AreEqual(new[] { \"DF1\", \"DF1\", \"DF2\", \"DF2\", \"DF3\", \"DF3\", \"DF4\", \"DF4\" }, level2);\n                CollectionAssert.AreEqual(new[] { \"X\", \"Y\", \"L\", \"M\", \"R\", \"S\", \"A\", \"B\" }, level3);\n\n                Assert.AreEqual(expected.GetAttr(\"to_string\").Invoke().GetAndDispose<string>(),\n                    concatenated.GetAttr(\"to_string\").Invoke().GetAndDispose<string>());\n            }\n        }\n\n        [Test]\n        public void ConcatenateReturnsEmptyDataFrameIfInputListIsEmpty()\n        {\n            using (Py.GIL())\n            {\n                var test = PyModule.FromString(\"ConcatenateReturnsEmptyDataFrameIfInputListIsEmpty\",\n                    @\"\nimport pandas as pd\n\nindex1 = pd.Index(['X', 'Y'], name=\"\"Class\"\")\ndf1 = pd.DataFrame([[1, 2], [3, 4]], index=index1, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex2 = pd.Index(['L', 'M'], name=\"\"Class\"\")\ndf2 = pd.DataFrame([[5, 6], [7, 8]], index=index2, columns=[\"\"A\"\", \"\"B\"\"])\n\nindex3 = pd.Index(['R', 'S'], name=\"\"Class\"\")\ndf3 = pd.DataFrame([[9, 10], [11, 12]], index=index3, columns=[\"\"A\"\", \"\"B\"\"])\n\nconcatenated = pd.concat([df1, df2, df3], keys=['df1', 'df2', 'df3'], names=['source_df'])\n\");\n\n                using var df1 = test.GetAttr(\"df1\");\n                using var df2 = test.GetAttr(\"df2\");\n                using var df3 = test.GetAttr(\"df3\");\n                using var expected = test.GetAttr(\"concatenated\");\n\n                using var concatenated = PandasConverter.ConcatDataFrames(Array.Empty<PyObject>());\n\n                Assert.IsTrue(concatenated.GetAttr(\"empty\").GetAndDispose<bool>());\n            }\n        }\n\n        [Test]\n        public void DataFrameDoesNotContainDefaultDateTimes()\n        {\n            using (Py.GIL())\n            {\n                var dateTime = new DateTime(2018, 1, 1);\n                Func<int, IndicatorDataPoint> makePoint = i => new IndicatorDataPoint(dateTime.AddMinutes(i), i);\n                var indicatorDataPoints = Enumerable.Range(0, 10).Select(i => makePoint(i)).ToList();\n                // Add a default(DateTime) entry to test filtering\n                indicatorDataPoints.Add(new IndicatorDataPoint(default, 1));\n\n                var pdConverter = new PandasConverter();\n                dynamic dataFrame = pdConverter.GetIndicatorDataFrame(new Dictionary<string, List<IndicatorDataPoint>>\n                {\n                    {\"ind\", indicatorDataPoints},\n                });\n                var index = dataFrame.index;\n                foreach (dynamic time in index)\n                {\n                    DateTime timestamp = (DateTime)time.AsManagedObject(typeof(DateTime));\n                    // Ensure the DataFrame index does not include default(DateTime)\n                    Assert.AreNotEqual(default(DateTime), timestamp);\n                }\n            }\n        }\n\n        public IEnumerable<Slice> GetHistory<T>(Symbol symbol, Resolution resolution, IEnumerable<T> data)\n            where T : IBaseData\n        {\n            var subscriptionDataConfig = GetSubscriptionDataConfig<T>(symbol, resolution);\n            var security = GetSecurity(subscriptionDataConfig);\n            var timeSliceFactory = new TimeSliceFactory(TimeZones.Utc);\n            return data.Select(t => timeSliceFactory.Create(\n               t.Time,\n               new List<DataFeedPacket> { new DataFeedPacket(security, subscriptionDataConfig, new List<BaseData>() { t as BaseData }) },\n               SecurityChangesTests.CreateNonInternal(Enumerable.Empty<Security>(), Enumerable.Empty<Security>()),\n                new Dictionary<Universe, BaseDataCollection>()).Slice);\n        }\n\n        private SubscriptionDataConfig GetSubscriptionDataConfig<T>(Symbol symbol, Resolution resolution)\n        {\n            return new SubscriptionDataConfig(\n                typeof(T),\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n        }\n\n        private Security GetSecurity(SubscriptionDataConfig subscriptionDataConfig)\n        {\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        private dynamic GetTestDataFrame(Symbol symbol, int count = 1)\n        {\n            return GetTestDataFrame(new[] { symbol }, count);\n        }\n\n        private dynamic GetTestDataFrame(IEnumerable<Symbol> symbols, int count = 1)\n        {\n            var slices = Enumerable\n                .Range(0, count)\n                .Select(\n                    i =>\n                    {\n                        var time = new DateTime(2013, 10, 7).AddMilliseconds(14400000 + i * 10000);\n                        return new Slice(\n                            time,\n                            symbols.Select(\n                                symbol => new Tick\n                                {\n                                    Time = time,\n                                    Symbol = symbol,\n                                    Value = 167 + i / 10,\n                                    Quantity = 1 + i * 10,\n                                    Exchange = \"T\"\n                                }\n                            ), time\n                        );\n                    }\n                );\n            return _converter.GetDataFrame(slices);\n        }\n\n        /// <summary>\n        /// Test cases to verify that the <see cref=\"PandasConverter\"/> handles slices with duplicate time stamps.\n        /// We want to verify we handle non-unique multi-index errors from Pandas as described in GH issue #4297\n        /// </summary>\n        private static TestCaseData[] GetHistoryWithDuplicateTimes()\n        {\n            var time = new DateTime(2013, 10, 8);\n            var symbol = Symbols.SPY;\n\n            return new[]\n            {\n                // Trade, quote and open interest ticks\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, symbol, \"04000001\", \"Q\", 100, 1m), // trade\n                                new Tick(time, symbol, \"04000002\", \"P\", 100m, 110m, 150m, 120m), // quote\n                                new OpenInterest(time, symbol, 150m) // open interest\n                            },\n                            time\n                        )\n                    },\n$\"                             askprice  asksize  bidprice  bidsize exchange  lastprice  openinterest  quantity{Environment.NewLine}\" +\n$\"symbol           time                                                                                        {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08       NaN      NaN       NaN      NaN   NASDAQ        1.0           NaN     100.0{Environment.NewLine}\" +\n$\"                 2013-10-08     120.0    150.0     110.0    100.0     ARCA      115.0           NaN       0.0{Environment.NewLine}\" +\n$\"                 2013-10-08       NaN      NaN       NaN      NaN                 NaN         150.0       0.0\"\n                ),\n                // Trade tick\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, symbol, \"04000001\", \"Q\", 100, 1m), // trade\n                            },\n                            time\n                        )\n                    },\n$\"                            exchange  lastprice  quantity{Environment.NewLine}\" +\n$\"symbol           time                                    {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08   NASDAQ        1.0     100.0\"\n                ),\n                // Trade ticks with same timestamp\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, symbol, \"04000001\", \"Q\", 100, 1m), // trade\n                                new Tick(time, symbol, \"04000001\", \"Q\", 200, 2m), // trade\n                            },\n                            time\n                        )\n                    },\n$\"                            exchange  lastprice  quantity{Environment.NewLine}\" +\n$\"symbol           time                                    {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08   NASDAQ        1.0     100.0{Environment.NewLine}\" +\n$\"                 2013-10-08   NASDAQ        2.0     200.0\"\n                ),\n                // Quote tick\n                new TestCaseData(\n                    Symbols.BTCUSD,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, Symbols.BTCUSD, \"04000002\", \"P\", 100m, 110m, 150m, 120m), // quote\n                            },\n                            time\n                        )\n                    },\n$\"                       askprice  asksize  bidprice  bidsize  lastprice{Environment.NewLine}\" +\n$\"symbol     time                                                       {Environment.NewLine}\" +\n$\"BTCUSD 2XR 2013-10-08     120.0    150.0     110.0    100.0      115.0\"\n                ),\n                // Quote ticks with same timestamp\n                new TestCaseData(\n                    Symbols.BTCUSD,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, Symbols.BTCUSD, \"04000002\", \"P\", 100m, 110m, 150m, 120m), // quote\n                                new Tick(time, Symbols.BTCUSD, \"04000002\", \"P\", 200m, 210m, 250m, 220m), // quote\n                            },\n                            time\n                        )\n                    },\n$\"                       askprice  asksize  bidprice  bidsize  lastprice{Environment.NewLine}\" +\n$\"symbol     time                                                       {Environment.NewLine}\" +\n$\"BTCUSD 2XR 2013-10-08     120.0    150.0     110.0    100.0      115.0{Environment.NewLine}\" +\n$\"           2013-10-08     220.0    250.0     210.0    200.0      215.0\"\n                ),\n                // Open interest tick\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new OpenInterest(time, symbol, 150m) // open interest\n                            },\n                            time\n                        )\n                    },\n$\"                             openinterest{Environment.NewLine}\" +\n$\"symbol           time                    {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08         150.0\"\n                ),\n                // Open interest ticks with same timestamp\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new OpenInterest(time, symbol, 150m), // open interest\n                                new OpenInterest(time, symbol, 250m) // open interest\n                            },\n                            time\n                        )\n                    },\n$\"                             openinterest{Environment.NewLine}\" +\n$\"symbol           time                    {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08         150.0{Environment.NewLine}\" +\n$\"                 2013-10-08         250.0\"\n                ),\n                // Trade, quote and open interest ticks with different times\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new[]\n                            {\n                                new Tick(time, symbol, \"04000001\", \"Q\", 100, 1m), // trade\n                                new Tick(time.AddTicks(1000000), symbol, \"04000002\", \"P\", 100m, 110m, 150m, 120m), // quote\n                                new OpenInterest(time.AddSeconds(2 * 1000000), symbol, 150m) // open interest\n                            },\n                            time\n                        )\n                    },\n$\"                                          askprice  asksize  bidprice  bidsize exchange  lastprice  openinterest  quantity{Environment.NewLine}\" +\n$\"symbol           time                                                                                                     {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08 00:00:00.000       NaN      NaN       NaN      NaN   NASDAQ        1.0           NaN     100.0{Environment.NewLine}\" +\n$\"                 2013-10-08 00:00:00.100     120.0    150.0     110.0    100.0     ARCA      115.0           NaN       0.0{Environment.NewLine}\" +\n$\"                 2013-10-31 03:33:20.000       NaN      NaN       NaN      NaN                 NaN         150.0       0.0\"\n                ),\n                // Trade and quote bars\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new BaseData[]\n                            {\n                                new TradeBar(time, symbol, 101m, 102m, 100m, 101m, 10m),\n                                new QuoteBar(time, symbol, new Bar(101m, 102m, 100m, 101m), 99m, new Bar(110m, 112m, 105m, 110m), 98m)\n                            },\n                            time\n                        )\n                    },\n$\"                                      askclose  askhigh  asklow  askopen  asksize  bidclose  bidhigh  bidlow  bidopen  bidsize  close   high    low   open  volume{Environment.NewLine}\" +\n$\"symbol           time                                                                                                                                             {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08 00:01:00     110.0    112.0   105.0    110.0     98.0     101.0    102.0   100.0    101.0     99.0  101.0  102.0  100.0  101.0    10.0\"\n                ),\n                // Trade bar\n                new TestCaseData(\n                    symbol,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new BaseData[]\n                            {\n                                new TradeBar(time, symbol, 101m, 102m, 100m, 101m, 10m)\n                            },\n                            time\n                        )\n                    },\n$\"                                      close   high    low   open  volume{Environment.NewLine}\" +\n$\"symbol           time                                                   {Environment.NewLine}\" +\n$\"SPY R735QTJ8XC9X 2013-10-08 00:01:00  101.0  102.0  100.0  101.0    10.0\"\n                ),\n                // Quote bar\n                new TestCaseData(\n                    Symbols.BTCUSD,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new BaseData[]\n                            {\n                                new QuoteBar(time, Symbols.BTCUSD, new Bar(101m, 102m, 100m, 101m), 99m, new Bar(110m, 112m, 105m, 110m), 98m)\n                            },\n                            time\n                        )\n                    },\n$\"                                askclose  askhigh  asklow  askopen  asksize  bidclose  bidhigh  bidlow  bidopen  bidsize  close   high    low   open{Environment.NewLine}\" +\n$\"symbol     time                                                                                                                                     {Environment.NewLine}\" +\n$\"BTCUSD 2XR 2013-10-08 00:01:00     110.0    112.0   105.0    110.0     98.0     101.0    102.0   100.0    101.0     99.0  105.5  107.0  102.5  105.5\"\n                ),\n                // Trade and quote bars with different times\n                new TestCaseData(\n                    Symbols.BTCUSD,\n                    new[]\n                    {\n                        new Slice(\n                            time,\n                            new BaseData[]\n                            {\n                                new TradeBar(time, Symbols.BTCUSD, 101m, 102m, 100m, 101m, 10m),\n                            },\n                            time\n                        ),\n                        new Slice(\n                            time.AddMinutes(1),\n                            new BaseData[]\n                            {\n                                new QuoteBar(time.AddMinutes(1).AddSeconds(1), Symbols.BTCUSD, new Bar(101m, 102m, 100m, 101m), 99m, new Bar(110m, 112m, 105m, 110m), 98m)\n                            },\n                            time.AddMinutes(1))\n                    },\n$\"                                askclose  askhigh  asklow  askopen  asksize  bidclose  bidhigh  bidlow  bidopen  bidsize  close   high    low   open  volume{Environment.NewLine}\" +\n$\"symbol     time                                                                                                                                             {Environment.NewLine}\" +\n$\"BTCUSD 2XR 2013-10-08 00:01:00       NaN      NaN     NaN      NaN      NaN       NaN      NaN     NaN      NaN      NaN  101.0  102.0  100.0  101.0    10.0{Environment.NewLine}\" +\n$\"           2013-10-08 00:02:01     110.0    112.0   105.0    110.0     98.0     101.0    102.0   100.0    101.0     99.0  105.5  107.0  102.5  105.5     NaN\"\n                ),\n            };\n        }\n\n        internal class SubTradeBar : TradeBar\n        {\n            public decimal SubProperty => Value;\n\n            public SubTradeBar() { }\n\n            public SubTradeBar(TradeBar tradeBar) : base(tradeBar) { }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode) =>\n                new SubTradeBar((TradeBar)base.Reader(config, line, date, isLiveMode));\n        }\n\n        internal class SubSubTradeBar : SubTradeBar\n        {\n            public decimal SubSubProperty => Value;\n\n            public SubSubTradeBar() { }\n\n            public SubSubTradeBar(TradeBar tradeBar) : base(tradeBar) { }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode) =>\n                new SubSubTradeBar((TradeBar)base.Reader(config, line, date, isLiveMode));\n        }\n\n        internal class NullableValueData : BaseData\n        {\n            public int? NullableInt { get; set; }\n\n            public DateTime? NullableTime { get; set; }\n\n            public double? NullableColumn { get; set; }\n        }\n\n        internal class CustomData : DynamicData\n        {\n            private bool _isInitialized;\n            private readonly List<string> _propertyNames = new List<string>();\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                // be sure to instantiate the correct type\n                var data = (CustomData)Activator.CreateInstance(GetType());\n                data.Symbol = config.Symbol;\n                var csv = line.Split(',');\n\n                if (!_isInitialized)\n                {\n                    _isInitialized = true;\n                    foreach (var propertyName in csv)\n                    {\n                        var property = propertyName.Trim();\n                        // should we remove property names like Time?\n                        // do we need to alias the Time??\n                        data.SetProperty(property, 0m);\n                        _propertyNames.Add(property);\n                    }\n                    // Returns null at this point where we are only reading the properties names\n                    return null;\n                }\n\n                data.Time = DateTime.ParseExact(csv[0], \"yyyy-MM-dd\", CultureInfo.InvariantCulture);\n\n                for (var i = 1; i < csv.Length; i++)\n                {\n                    var value = csv[i].ToDecimal();\n                    data.SetProperty(_propertyNames[i], value);\n                }\n\n                if (!_propertyNames.Contains(\"Value\"))\n                {\n                    data.Value = 1;\n                }\n\n                return data;\n            }\n        }\n\n        internal class EnumerableData : BaseDataCollection\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PandasConverterUnwrappingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public partial class PandasConverterTests\n    {\n        // Over complicating it on purpose to test the expanding of nested classes\n        private class BarOpen\n        {\n            public decimal Open { get; set; }\n            public BarOpen(decimal open)\n            {\n                Open = open;\n            }\n        }\n\n        private class BarHigh\n        {\n            public decimal High { get; set; }\n            public BarHigh(decimal high)\n            {\n                High = high;\n            }\n        }\n\n        private class BarLow\n        {\n            public decimal Low { get; set; }\n            public BarLow(decimal low)\n            {\n                Low = low;\n            }\n        }\n\n        private class BarClose\n        {\n            public decimal Close { get; set; }\n            public BarClose(decimal close)\n            {\n                Close = close;\n            }\n        }\n\n        private class CustomBar\n        {\n            public BarOpen Open { get; set; }\n            public BarHigh High { get; set; }\n            public BarLow Low { get; set; }\n            public BarClose Close { get; set; }\n        }\n\n        private class CustomTradeBar : BaseData\n        {\n            public CustomBar Prices { get; set; }\n\n            public decimal Volume { get; set; }\n\n            public CustomTradeBar(Symbol symbol, decimal open, decimal high, decimal low, decimal close, decimal volume)\n            {\n                Symbol = symbol;\n                Prices = new CustomBar\n                {\n                    Open = new BarOpen(open),\n                    High = new BarHigh(high),\n                    Low = new BarLow(low),\n                    Close = new BarClose(close),\n                };\n                Volume = volume;\n            }\n        }\n\n        [Test]\n        public void ExpandsNestedClassesIntoDataFrameColumns()\n        {\n            var converter = new PandasConverter();\n            var data = new List<CustomTradeBar>\n            {\n                new CustomTradeBar(Symbols.IBM, 101m, 102m, 100m, 101m, 10m),\n                new CustomTradeBar(Symbols.IBM, 102m, 103m, 101m, 101m, 9m),\n                new CustomTradeBar(Symbols.IBM, 99m, 100m, 98m, 99m, 10m),\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            var expectedColumnNames = new List<string>() { \"open\", \"high\", \"low\", \"close\", \"volume\" };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n        }\n\n        private class CustomQuoteBar : BaseData\n        {\n            public CustomBar Bid { get; set; }\n\n            public decimal BidSize { get; set; }\n\n            public CustomBar Ask { get; set; }\n\n            public decimal AskSize { get; set; }\n\n            public CustomQuoteBar(Symbol symbol, decimal bidOpen, decimal bidHigh, decimal bidLow, decimal bidClose, decimal bidSize,\n                decimal askOpen, decimal askHigh, decimal askLow, decimal askClose, decimal askSize)\n            {\n                Symbol = symbol;\n                Bid = new CustomBar\n                {\n                    Open = new BarOpen(bidOpen),\n                    High = new BarHigh(bidHigh),\n                    Low = new BarLow(bidLow),\n                    Close = new BarClose(bidClose),\n                };\n                BidSize = bidSize;\n                Ask = new CustomBar\n                {\n                    Open = new BarOpen(askOpen),\n                    High = new BarHigh(askHigh),\n                    Low = new BarLow(askLow),\n                    Close = new BarClose(askClose),\n                };\n                AskSize = askSize;\n            }\n        }\n\n        [Test]\n        public void ExpandsNestedClassesIntoDataFrameColumnsWithDuplicateNames()\n        {\n            var converter = new PandasConverter();\n            var data = new List<CustomQuoteBar>\n            {\n                new CustomQuoteBar(Symbols.IBM, 101m, 102m, 100m, 101m, 10m, 101m, 102m, 100m, 101m, 10m),\n                new CustomQuoteBar(Symbols.IBM, 102m, 103m, 101m, 101m, 9m, 102m, 103m, 101m, 101m, 9m),\n                new CustomQuoteBar(Symbols.IBM, 99m, 100m, 98m, 99m, 10m, 99m, 100m, 98m, 99m, 10m),\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            var expectedColumnNames = new List<string>() {\n                \"bidopen\", \"bidhigh\", \"bidlow\", \"bidclose\", \"bidsize\",\n                \"askopen\", \"askhigh\", \"asklow\", \"askclose\", \"asksize\"\n            };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n        }\n\n        public class TestInnerData1\n        {\n            public decimal DecimalValue1 { get; set; }\n            public string StringValue1 { get; set; }\n\n        }\n\n        [PandasNonExpandable]\n        public class TestInnerData2\n        {\n            public decimal DecimalValue2 { get; set; }\n            public string StringValue2 { get; set; }\n        }\n\n        public class TestData1 : BaseData\n        {\n            public TestInnerData1 TestInnerData1 { get; set; }\n            public TestInnerData2 TestInnerData2 { get; set; }\n\n            [PandasNonExpandable]\n            public TestInnerData1 TestInnerData3 { get; set; }\n\n            public TestData1(Symbol symbol, decimal decimalValue1, string stringValue1, decimal decimalValue2, string stringValue2,\n                decimal decimalValue3, string stringValue3)\n            {\n                Symbol = symbol;\n                TestInnerData1 = new TestInnerData1\n                {\n                    DecimalValue1 = decimalValue1,\n                    StringValue1 = stringValue1,\n                };\n                TestInnerData2 = new TestInnerData2\n                {\n                    DecimalValue2 = decimalValue2,\n                    StringValue2 = stringValue2,\n                };\n                TestInnerData3 = new TestInnerData1\n                {\n                    DecimalValue1 = decimalValue3,\n                    StringValue1 = stringValue3,\n                };\n            }\n        }\n\n        [Test]\n        public void DoesNotExpandMarkedPropertiesAndClasses()\n        {\n            var converter = new PandasConverter();\n            var data = new List<TestData1>\n            {\n                new TestData1(Symbols.IBM, 1m, \"Test 1.1\", 2m, \"Test 1.2\", 3m, \"Test 1.3\"),\n                new TestData1(Symbols.IBM, 10m, \"Test 2.1\", 20m, \"Test 2.2\", 30m, \"Test 2.3\"),\n                new TestData1(Symbols.IBM, 100m, \"Test 3.1\", 200m, \"Test 3.2\", 300m, \"Test 3.3\"),\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            var expectedColumnNames = new List<string>() { \"decimalvalue1\", \"stringvalue1\", \"testinnerdata2\", \"testinnerdata3\" };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n\n            using var _ = Py.GIL();\n\n            foreach (var value in dataFrame[\"testinnerdata2\"])\n            {\n                Assert.DoesNotThrow(() => value.As<TestInnerData2>());\n            }\n\n            foreach (var value in dataFrame[\"testinnerdata3\"])\n            {\n                Assert.DoesNotThrow(() => value.As<TestInnerData1>());\n            }\n        }\n\n        private static void AssertDataFrameColumns(dynamic dataFrame, int dataCount, List<string> expectedColumnNames)\n        {\n            using var _ = Py.GIL();\n\n            Assert.AreEqual(dataCount, dataFrame.shape[0].As<int>());\n            Assert.AreEqual(expectedColumnNames.Count, dataFrame.shape[1].As<int>());\n\n            var columnNames = new List<string>();\n            foreach (var pandasColumn in dataFrame.columns.to_list())\n            {\n                columnNames.Add(pandasColumn.__str__().As<string>());\n            }\n            CollectionAssert.AreEquivalent(expectedColumnNames, columnNames);\n        }\n\n        private class TestInnerData3\n        {\n            public decimal TestValue1 { get; set; }\n\n            public decimal TestValue2 { get; set; }\n\n            [PandasIgnore]\n            public decimal IgnoredValue { get; set; }\n        }\n\n        private class TestData2 : BaseData\n        {\n            public TestInnerData3 InnerData { get; set; }\n\n            public string MainValue { get; set; }\n\n            public TestData2(Symbol symbol, string mainValue, decimal testValue1, decimal testValue2, decimal ignoredValue)\n            {\n                Symbol = symbol;\n                MainValue = mainValue;\n                InnerData = new TestInnerData3()\n                {\n                    TestValue1 = testValue1,\n                    TestValue2 = testValue2,\n                    IgnoredValue = ignoredValue\n                };\n            }\n        }\n\n        [Test]\n        public void OmitsPropertiesMarkedToBeIgnored()\n        {\n            var converter = new PandasConverter();\n            var data = new List<TestData2>\n            {\n                new TestData2(Symbols.IBM, \"Main value 1\", 10m, 200m, 5m),\n                new TestData2(Symbols.IBM, \"Main value 2\", 20m, 300m, 10m),\n                new TestData2(Symbols.IBM, \"Main value 3\", 30m, 400m, 15m),\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            var expectedColumnNames = new List<string>() { \"mainvalue\", \"testvalue1\", \"testvalue2\" };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n        }\n\n        [PandasIgnoreMembers]\n        private class TestIgnoreMembersBaseClass : BaseData\n        {\n            public decimal Decimal1 { get; set; }\n            public decimal Decimal2 { get; set; }\n        }\n\n        private class TestIgnoreMembersDerivedClass : TestIgnoreMembersBaseClass\n        {\n            public decimal Decimal3 { get; set; }\n            public decimal Decimal4 { get; set; }\n        }\n\n        [Test]\n        public void OmitsBaseClassMembers()\n        {\n            var converter = new PandasConverter();\n            var data = new List<TestIgnoreMembersDerivedClass>\n            {\n                new TestIgnoreMembersDerivedClass { Decimal1 = 1m, Decimal2 = 2m, Decimal3 = 3m, Decimal4 = 4m },\n                new TestIgnoreMembersDerivedClass { Decimal1 = 10m, Decimal2 = 20m, Decimal3 = 30m, Decimal4 = 40m },\n                new TestIgnoreMembersDerivedClass { Decimal1 = 100m, Decimal2 = 200m, Decimal3 = 300m, Decimal4 = 400m },\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            // BaseData and TestIgnoreMembersBaseClass members are ignored\n            var expectedColumnNames = new List<string>() { \"decimal3\", \"decimal4\" };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n        }\n\n        private class TestRenameMembersClass : ISymbolProvider\n        {\n            [PandasColumn(\"TheSymbol\")]\n            public Symbol Symbol { get; set; }\n\n            [PandasColumn(\"Decimal\")]\n            public decimal DecimalValue { get; set; }\n\n            [PandasColumn(\"String\")]\n            public string StringValue { get; set; }\n        }\n\n        [Test]\n        public void RenamesMemberNames()\n        {\n            var converter = new PandasConverter();\n            var data = new List<TestRenameMembersClass>\n            {\n                new TestRenameMembersClass { Symbol = Symbols.IBM, DecimalValue = 1m, StringValue = \"Test 1\" },\n                new TestRenameMembersClass { Symbol = Symbols.AAPL, DecimalValue = 10m, StringValue = \"Test 2\" },\n                new TestRenameMembersClass { Symbol = Symbols.SPY, DecimalValue = 100m, StringValue = \"Test 3\" },\n            };\n\n            dynamic dataFrame = converter.GetDataFrame(data);\n\n            var expectedColumnNames = new List<string>() { \"thesymbol\", \"decimal\", \"string\" };\n\n            AssertDataFrameColumns(dataFrame, data.Count, expectedColumnNames);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PandasIndexingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing static QLNet.NumericHaganPricer;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    // TODO: Rename to PandasPythonTests, dedicate class to python tests under ./PandasTests directory\n    public class PandasIndexingTests\n    {\n        private dynamic _module;\n        private dynamic _pandasIndexingTests;\n        private dynamic _pandasDataFrameTests;\n\n        [SetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                _module = Py.Import(\"PandasIndexingTests\");\n                _pandasIndexingTests = _module.PandasIndexingTests();\n                _pandasDataFrameTests = _module.PandasDataFrameTests();\n            }\n        }\n\n        [Test]\n        public void IndexingDataFrameWithList()\n        {\n            using (Py.GIL())\n            {\n                Assert.DoesNotThrow((() => _pandasIndexingTests.test_indexing_dataframe_with_list()));\n            }\n        }\n\n        [Test]\n        public void ContainsUserMappedTickers()\n        {\n            using (Py.GIL())\n            {\n                PyObject result = _pandasDataFrameTests.test_contains_user_mapped_ticker();\n                var test = result.As<bool>();\n\n                Assert.IsTrue(test);\n            }\n        }\n\n        [TestCase(\"SPY WhatEver\")]\n        [TestCase(\"Sharpe ratio\")]\n        public void ContainsUserDefinedColumnsWithSpaces(string columnName)\n        {\n            using (Py.GIL())\n            {\n                PyObject result = _pandasDataFrameTests.test_contains_user_defined_columns_with_spaces(columnName);\n                var test = result.As<bool>();\n\n                Assert.IsTrue(test);\n            }\n        }\n\n        [Test]\n        public void ExpectedException()\n        {\n            using (Py.GIL())\n            {\n                PyObject result = _pandasDataFrameTests.test_expected_exception();\n                var exception = result.As<string>();\n\n                Assert.IsTrue(exception.Contains(\"No key found for either mapped or original key.\", StringComparison.InvariantCulture), exception);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PandasTests/PandasIndexingTests.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\nfrom QuantConnect.Tests import *\nfrom QuantConnect.Tests.Python import *\n\n# TODO: Rename to PandasResearchTests and keep this class for QB related tests; rename py module to PandasTests\nclass PandasIndexingTests():\n    def __init__(self):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(2020, 1, 1)\n        self.qb.SetEndDate(2020, 1, 4)\n        self.symbol = self.qb.AddEquity(\"SPY\", Resolution.Daily).Symbol\n\n    def test_indexing_dataframe_with_list(self):\n        symbols = [self.symbol]\n        self.history = self.qb.History(symbols, 30)\n        self.history = self.history['close'].unstack(level=0).dropna()\n        test = self.history[[self.symbol]]\n        return True\n\n# Test class that sets up two dataframes to test on\nclass PandasDataFrameTests():\n    def __init__(self):\n        self.spy = Symbols.SPY\n        self.aapl = Symbols.AAPL\n\n        # Set our symbol cache\n        SymbolCache.Set(\"SPY\", self.spy)\n        SymbolCache.Set(\"AAPL\", self.aapl)\n\n        pdConverter = PandasConverter()\n\n        # Create our dataframes\n        self.spydf = pdConverter.GetDataFrame(PythonTestingUtils.GetSlices(self.spy))\n\n    def test_contains_user_mapped_ticker(self):\n        # Create a new DF that has a plain ticker, test that our mapper doesn't break\n        # searching for it.\n        df = pd.DataFrame({'spy': [2, 5, 8, 10]})\n        return 'spy' in df\n\n    def test_expected_exception(self):\n        # Try indexing a ticker that doesn't exist in this frame, but is still in our cache\n        try:\n            self.spydf['aapl']\n        except KeyError as e:\n            return str(e)\n\n    def test_contains_user_defined_columns_with_spaces(self, column_name):\n        # Adds a column, then try accessing it.\n        # If the colums has white spaces, it should not fail\n        df = self.spydf.copy()\n        df[column_name] = 1\n        try:\n            x = df[column_name]\n            return True\n        except:\n            return False\n"
  },
  {
    "path": "Tests/Python/PandasTests/PandasMapperTests.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n'''\nTo test this script directly you will need to import QuantConnect Dlls using clrloader from the appropriate \nlocation, the code below shows how to do this. Otherwise you can run it directly from C# in Lean without it.\n\nTo run as a solo script, add the following code to your script\n\nRequires:\nclr-loader==0.1.6\npandas\n\n*********** CODE ***********\nimport os\nimport sys\n\n# Get to DLL location where we are testing, change as needed\nfileDirectory = os.path.dirname(os.path.abspath(__file__))\ndlldir = \"../../bin/Debug\"\ndlldir = os.path.join(fileDirectory, dlldir)\n\n# Move us to dll directory and add it to path\nos.chdir(dlldir)\nsys.path.append(dlldir)\n\n# Tell PythonNet to use .dotnet 6\nfrom pythonnet import set_runtime\nimport clr_loader\nset_runtime(clr_loader.get_coreclr(os.path.join(dlldir, \"QuantConnect.Lean.Launcher.runtimeconfig.json\")))\n\n'''\n\nfrom clr import AddReference\nAddReference(\"QuantConnect.Common\")\nAddReference(\"QuantConnect.Tests\")\n\nfrom QuantConnect import *\nfrom QuantConnect.Python import PandasConverter\nfrom QuantConnect.Tests import Symbols\nfrom QuantConnect.Tests.Python import PythonTestingUtils\n\n# Import our mapper which wraps core pandas functions (included in build dir)\nimport PandasMapper\nimport pandas as pd\n\n# Get some dataframes from Lean to test on\nspy = Symbols.SPY\naapl = Symbols.AAPL\nSymbolCache.Set(\"SPY\", spy)\nSymbolCache.Set(\"AAPL\", aapl)\n\npdConverter = PandasConverter()\n\nslices = PythonTestingUtils.GetSlices(spy)\nspydf = pdConverter.GetDataFrame(slices)\n\nslices = PythonTestingUtils.GetSlices(aapl)\naapldf = pdConverter.GetDataFrame(slices)\n\n\ndef Test_Concat(dataFrame, dataFrame2, indexer):\n    newDataFrame = pd.concat([dataFrame, dataFrame2])\n    data = newDataFrame['lastprice'].unstack(level=0).iloc[-1][indexer]\n    if data is 0:\n        raise Exception('Data is zero')\n\ndef Test_Join(dataFrame, dataFrame2, indexer):\n    newDataFrame = dataFrame.join(dataFrame2, lsuffix='_')\n    base =  newDataFrame['lastprice_'].unstack(level=0)\n    data = base.iloc[-1][indexer]\n    if data is 0:\n        raise Exception('Data is zero')\n\nTest_Concat(spydf, aapldf, \"spy\")\nTest_Concat(spydf, aapldf, spy)\nTest_Concat(spydf, aapldf, str(spy.ID))\n\nTest_Join(spydf, aapldf, \"spy\")\nTest_Join(spydf, aapldf, spy)\nTest_Join(spydf, aapldf, str(spy.ID))\n"
  },
  {
    "path": "Tests/Python/PortfolioCustomModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Tests.Common.Securities;\nusing QuantConnect.Tests.Engine.DataFeeds;\nusing System;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PortfolioCustomModelTests\n    {\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SetMarginCallModelSuccess(bool isChild)\n        {\n            var algorithm = new QCAlgorithm();\n            var portfolio = algorithm.Portfolio;\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(new DateTime(2018, 8, 20, 15, 0, 0));\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n\n            var spy = algorithm.AddEquity(\"SPY\", Resolution.Daily);\n            spy.SetMarketPrice(new Tick(algorithm.Time, Symbols.SPY, 100m, 100m));\n\n            // Test two custom buying power models.\n            // The first inherits from C# SecurityMarginModel and the other is 100% python\n            var code = isChild\n                ? CreateCustomMarginCallModelFromSecurityMarginModelCode()\n                : CreateCustomMarginCallModelCode();\n\n            portfolio.SetMarginCallModel(CreateCustomMarginCallModel(code, portfolio));\n            Assert.IsAssignableFrom<MarginCallModelPythonWrapper>(portfolio.MarginCallModel);\n\n            bool issueMarginCallWarning;\n            var marginCallOrders = portfolio.MarginCallModel.GetMarginCallOrders(out issueMarginCallWarning);\n\n            if (isChild)\n            {\n                Assert.IsFalse(issueMarginCallWarning);\n                Assert.AreEqual(0, marginCallOrders.Count);\n            }\n            else\n            {\n                Assert.IsTrue(issueMarginCallWarning);\n                Assert.AreEqual(3, marginCallOrders.Count);\n            }\n        }\n\n        [Test]\n        public void SetMarginCallModelFails()\n        {\n            var algorithm = new QCAlgorithm();\n            var portfolio = algorithm.Portfolio;\n\n            // Renaming GetMarginCall will cause a NotImplementedException exception\n            var code = CreateCustomMarginCallModelCode();\n            code = code.Replace(\"GetMarginCall\", \"SetMarginCall\");\n            var pyObject = CreateCustomMarginCallModel(code, portfolio);\n            Assert.Throws<NotImplementedException>(() => portfolio.SetMarginCallModel(CreateCustomMarginCallModel(code, portfolio)));\n        }\n\n        private PyObject CreateCustomMarginCallModel(string code, SecurityPortfolioManager portfolio)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\"CustomMarginCallModel\", code);\n                dynamic CustomMarginCallModel = module.GetAttr(\"CustomMarginCallModel\");\n                return CustomMarginCallModel(portfolio, null);\n            }\n        }\n\n        private string CreateCustomMarginCallModelCode() => @\"\nimport os, sys\nsys.path.append(os.getcwd())\n\nfrom AlgorithmImports import *\n\nclass CustomMarginCallModel:\n    def __init__(self, portfolio, defaultOrderProperties):\n        self.portfolio = portfolio\n        self.defaultOrderProperties = defaultOrderProperties\n\n    def ExecuteMarginCall(self, generatedMarginCallOrders):\n        return []\n    \n    def GenerateMarginCallOrder(self, security, netLiquidationValue, totalMargin, maintenanceMarginRequirement):\n        time = Extensions.ConvertToUtc(security.LocalTime, security.Exchange.TimeZone)\n        quantity = netLiquidationValue / security.Price\n        return SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, quantity, 0, 0, time, 'Margin Call', None)\n\n    def GetMarginCallOrders(self, issueMarginCallWarning):\n        issueMarginCallWarning = True\n        spy = self.portfolio.Securities['SPY']\n        totalPortfolioValue = self.portfolio.TotalPortfolioValue\n        totalMarginUsed = self.portfolio.TotalMarginUsed\n\n        order = self.GenerateMarginCallOrder(spy, totalPortfolioValue, totalMarginUsed, 0)\n        \n        return [order, order, order], issueMarginCallWarning\";\n\n        private string CreateCustomMarginCallModelFromSecurityMarginModelCode() => @\"\nimport os, sys\nsys.path.append(os.getcwd())\n\nfrom AlgorithmImports import *\n\nclass CustomMarginCallModel(DefaultMarginCallModel):\n    def __init__(self, portfolio, defaultOrderProperties):\n        super().__init__(portfolio, defaultOrderProperties)\n        self.porfolio = portfolio\n        self.defaultOrderProperties = defaultOrderProperties\n\n    def GenerateMarginCallOrder(self, security, netLiquidationValue, totalMargin, maintenanceMarginRequirement):\n        time = Extensions.ConvertToUtc(security.LocalTime, security.Exchange.TimeZone)\n        quantity = netLiquidationValue / security.Price\n        return SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, quantity, 0, 0, time, 'Margin Call', None)\";\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonCollectionsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing NUnit.Framework;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonCollectionsTests\n    {\n        private static dynamic containsKeyTest;\n        private static dynamic containsTest;\n        private static string testModule = @\"\ndef ContainsTest(key, collection):\n    if key in collection.Keys:\n        return True\n    return False\n\ndef ContainsKeyTest(key, collection):\n    return collection.ContainsKey(key)\n\";\n\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            using (Py.GIL())\n            {\n                var pyModule = PyModule.FromString(\"module\", testModule);\n                containsTest = pyModule.GetAttr(\"ContainsTest\");\n                containsKeyTest = pyModule.GetAttr(\"ContainsKeyTest\");\n            }\n        }\n\n        [TestCase(\"AAPL\", false)]\n        [TestCase(\"SPY\", true)]\n        public void Contains(string key, bool expected)\n        {\n            using (Py.GIL())\n            {\n                var dic = new Dictionary<string, object> { { \"SPY\", new object() } };\n                Assert.AreEqual(expected, (bool)containsTest(key, dic));\n            }\n        }\n\n        [TestCase(\"AAPL\", false)]\n        [TestCase(\"SPY\", true)]\n        public void ContainsKey(string key, bool expected)\n        {\n            using (Py.GIL())\n            {\n                var dic = new Dictionary<string, object> { { \"SPY\", new object() } };\n                Assert.AreEqual(expected, (bool)containsKeyTest(key, dic));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonDataTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NodaTime;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\nusing System.Reflection;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonDataTests\n    {\n        [TestCase(\"value\", \"symbol\")]\n        [TestCase(\"Value\", \"Symbol\")]\n        public void ValueAndSymbol(string value, string symbol)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def Reader(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.{symbol} = config.Symbol\n        result.{value} = 10\n        result.time = datetime.strptime(\"\"2022-05-05\"\", \"\"%Y-%m-%d\"\")\n        result.end_time = datetime.strptime(\"\"2022-05-15\"\", \"\"%Y-%m-%d\"\")\n        return result\");\n\n                var data = GetDataFromModule(testModule);\n\n                Assert.AreEqual(Symbols.SPY, data.Symbol);\n                Assert.AreEqual(10, data.Value);\n                Assert.AreEqual(Symbols.SPY, data.symbol);\n                Assert.AreEqual(10, data.value);\n            }\n        }\n\n        [TestCase(\"EndTime\", \"Time\")]\n        [TestCase(\"endtime\", \"Time\")]\n        [TestCase(\"end_time\", \"Time\")]\n        [TestCase(\"EndTime\", \"time\")]\n        [TestCase(\"endtime\", \"time\")]\n        [TestCase(\"end_time\", \"time\")]\n        public void TimeAndEndTimeCanBeSet(string endtime, string time)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def Reader(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.Symbol = config.Symbol\n        result.Value = 10\n        result.{time} = datetime.strptime(\"\"2022-05-05\"\", \"\"%Y-%m-%d\"\")\n        result.{endtime} = datetime.strptime(\"\"2022-05-15\"\", \"\"%Y-%m-%d\"\")\n        return result\");\n\n                var data = GetDataFromModule(testModule);\n\n                Assert.AreEqual(new DateTime(2022, 5, 5), data.Time);\n                Assert.AreEqual(new DateTime(2022, 5, 15), data.EndTime);\n            }\n        }\n\n        [TestCase(\"EndTime\")]\n        [TestCase(\"endtime\")]\n        [TestCase(\"end_time\")]\n        public void OnlyEndTimeCanBeSet(string endtime)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def Reader(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.Symbol = config.Symbol\n        result.Value = 10\n        result.{endtime} = datetime.strptime(\"\"2022-05-05\"\", \"\"%Y-%m-%d\"\")\n        return result\");\n\n                var data = GetDataFromModule(testModule);\n\n                Assert.AreEqual(new DateTime(2022, 5, 5), data.Time);\n                Assert.AreEqual(new DateTime(2022, 5, 5), data.EndTime);\n            }\n        }\n\n        [TestCase(\"Time\")]\n        [TestCase(\"time\")]\n        public void OnlyTimeCanBeSet(string time)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\n\nclass CustomDataTest(PythonData):\n    def Reader(self, config, line, date, isLiveMode):\n        result = CustomDataTest()\n        result.Symbol = config.Symbol\n        result.Value = 10\n        result.{time} = datetime.strptime(\"\"2022-05-05\"\", \"\"%Y-%m-%d\"\")\n        return result\");\n\n                var data = GetDataFromModule(testModule);\n\n                Assert.AreEqual(new DateTime(2022, 5, 5), data.Time);\n                Assert.AreEqual(new DateTime(2022, 5, 5), data.EndTime);\n            }\n        }\n\n        public class TestPythonData : PythonData\n        {\n            private static void Throw()\n            {\n                throw new Exception(\"TestPythonData.Throw()\");\n            }\n\n            public override bool RequiresMapping()\n            {\n                Throw();\n                return true;\n            }\n\n            public override bool IsSparseData()\n            {\n                Throw();\n                return true;\n            }\n\n            public override Resolution DefaultResolution()\n            {\n                Throw();\n                return Resolution.Daily;\n            }\n\n            public override List<Resolution> SupportedResolutions()\n            {\n                Throw();\n                return new List<Resolution> { Resolution.Daily };\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                Throw();\n                return new TestPythonData();\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                Throw();\n                return new SubscriptionDataSource(\"test\", SubscriptionTransportMedium.LocalFile);\n            }\n        }\n\n        [TestCase(\"RequiresMapping\")]\n        [TestCase(\"IsSparseData\")]\n        [TestCase(\"DefaultResolution\")]\n        [TestCase(\"SupportedResolutions\")]\n        [TestCase(\"Reader\")]\n        [TestCase(\"GetSource\")]\n        public void CallsCSharpMethodsIfNotDefinedInPython(string methodName)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                    $@\"\nfrom AlgorithmImports import *\n\nfrom QuantConnect.Tests.Python import *\n\nclass CustomDataClass(PythonDataTests.TestPythonData):\n    pass\");\n\n                var customDataClass = testModule.GetAttr(\"CustomDataClass\");\n                var type = Extensions.CreateType(customDataClass);\n                var data = new PythonData(customDataClass());\n\n                var args = Array.Empty<object>();\n                var methodArgsType = Array.Empty<Type>();\n                if (methodName.Equals(\"Reader\", StringComparison.OrdinalIgnoreCase))\n                {\n                    var config = new SubscriptionDataConfig(type, Symbols.SPY, Resolution.Daily, DateTimeZone.Utc,\n                        DateTimeZone.Utc, false, false, false, isCustom: true);\n                    args = new object[] { config, \"line\", DateTime.MinValue, false };\n                    methodArgsType = new[] { typeof(SubscriptionDataConfig), typeof(string), typeof(DateTime), typeof(bool) };\n                }\n                else if (methodName.Equals(\"GetSource\", StringComparison.OrdinalIgnoreCase))\n                {\n                    var config = new SubscriptionDataConfig(type, Symbols.SPY, Resolution.Daily, DateTimeZone.Utc,\n                        DateTimeZone.Utc, false, false, false, isCustom: true);\n                    args = new object[] { config, DateTime.MinValue, false };\n                    methodArgsType = new[] { typeof(SubscriptionDataConfig), typeof(DateTime), typeof(bool) };\n                }\n\n                var exception = Assert.Throws<TargetInvocationException>(() => typeof(PythonData).GetMethod(methodName, methodArgsType).Invoke(data, args));\n                Assert.AreEqual($\"TestPythonData.Throw()\", exception.InnerException.Message);\n            }\n        }\n\n        private static BaseData GetDataFromModule(dynamic testModule)\n        {\n            var type = Extensions.CreateType(testModule.GetAttr(\"CustomDataTest\"));\n            var customDataTest = new PythonData(testModule.GetAttr(\"CustomDataTest\")());\n            var config = new SubscriptionDataConfig(type, Symbols.SPY, Resolution.Daily, DateTimeZone.Utc,\n                DateTimeZone.Utc, false, false, false, isCustom: true);\n            return customDataTest.Reader(config, \"something\", DateTime.UtcNow, false);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonMemoryLeakTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing System.Threading;\nusing QuantConnect.Orders;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Orders.Fees;\nusing QuantConnect.Tests.Common.Securities;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonMemoryLeakTests\n    {\n        private Security _security;\n        private static DateTime orderDateTime;\n\n        [SetUp]\n        public void SetUp()\n        {\n            _security = SecurityTests.GetSecurity();\n            orderDateTime = new DateTime(2017, 2, 2, 13, 0, 0);\n            var reference = orderDateTime;\n            var referenceUtc = reference.ConvertToUtc(TimeZones.NewYork);\n            var timeKeeper = new TimeKeeper(referenceUtc);\n            _security.SetLocalTimeKeeper(timeKeeper.GetLocalTimeKeeper(TimeZones.NewYork));\n        }\n\n        [Test]\n        public void DoesNotLeak()\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    @\"\nfrom AlgorithmImports import *\n\ndef jose(security):\n    security.SetFeeModel(MakerTakerModel())\nclass MakerTakerModel(FeeModel):\n    def __init__(self, maker = -.0016, taker = .003):\n        self.maker = maker \n        self.taker = taker\n\n    def GetOrderFee(self, parameters: OrderFeeParameters) -> OrderFee:\n        qty = parameters.Order.Quantity\n        ord_type = parameters.Order.Type\n\n        # fee_in_usd = .0008\n\n        # make_ps = -.0016 #Rebate\n        # take_ps = .003\n\n        if ord_type in [OrderType.Market, OrderType.StopMarket]:\n            fee_usd = self.taker * qty \n        else:\n            fee_usd = self.maker * qty\n\n        return OrderFee(CashAmount(fee_usd, 'USD'))\");\n\n                module.GetAttr(\"jose\").Invoke(_security.ToPython());\n\n                var parameters = new OrderFeeParameters(_security, new MarketOrder(_security.Symbol, 1, orderDateTime));\n                // warmup\n                var result = _security.FeeModel.GetOrderFee(parameters);\n                Assert.IsNotNull(result);\n\n                // let the system stabilize\n                Thread.Sleep(1000);\n                var start = GC.GetTotalMemory(true);\n                for (var i = 0; i < 50000; i++)\n                {\n                    result = _security.FeeModel.GetOrderFee(parameters);\n\n                    Assert.IsNotNull(result);\n\n                    if (i % 10000 == 0)\n                    {\n                        Log.Debug($\"Memory: {GC.GetTotalMemory(true)}\");\n                    }\n                }\n                Thread.Sleep(1000);\n                var end = GC.GetTotalMemory(true);\n\n                var message = $\"Start: {start}. End {end}. Variation {((end - start) / (decimal)start * 100).RoundToSignificantDigits(2)}%\";\n                Log.Debug(message);\n\n                // 5% noise, leak was >10%\n                Assert.LessOrEqual(end, start * 1.05, message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonOptionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Statistics;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonOptionTests\n    {\n        [Test]\n        public void PythonFilterFunctionReturnsList()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spyOption = algorithm.AddOption(\"SPY\");\n\n            using (Py.GIL())\n            {\n                //Filter function that returns a list of symbols\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"def filter(universe):\\n\" +\n                    \"   universe = universe.WeeklysOnly().Expiration(0, 10)\\n\" +\n                    \"   return [symbol for symbol in universe\\n\"+\n                    \"           if symbol.ID.OptionRight != OptionRight.Put\\n\" +\n                    \"           and universe.Underlying.Price - symbol.ID.StrikePrice < 10]\\n\"\n                );\n\n                var filterFunction = module.GetAttr(\"filter\");\n                Assert.DoesNotThrow(() => spyOption.SetFilter(filterFunction));\n            }\n\n\n        }\n\n        [Test]\n        public void PythonFilterFunctionReturnsUniverse()\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            var spyOption = algorithm.AddOption(\"SPY\");\n\n            using (Py.GIL())\n            {\n                //Filter function that returns a OptionFilterUniverse\n                var module = PyModule.FromString(Guid.NewGuid().ToString(),\n                    \"def filter(universe):\\n\" +\n                    \"   universe = universe.WeeklysOnly().Expiration(0, 5)\\n\" +\n                    \"   return universe\"\n                );\n\n                var filterFunction = module.GetAttr(\"filter\");\n                Assert.DoesNotThrow(() => spyOption.SetFilter(filterFunction));\n            }\n        }\n\n        [Test]\n        public void FilterReturnsUniverseRegression()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"FilterUniverseRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"2\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"-0.02%\"},\n                    {\"Compounding Annual Return\", \"-1.521%\"},\n                    {\"Drawdown\", \"0.000%\"},\n                    {\"Expectancy\", \"-1\"},\n                    {\"End Equity\", \"99979\"},\n                    {\"Net Profit\", \"-0.021%\"},\n                    {\"Sharpe Ratio\", \"0\"},\n                    {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                    {\"Loss Rate\", \"100%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"0\"},\n                    {\"Beta\", \"0\"},\n                    {\"Annual Standard Deviation\", \"0\"},\n                    {\"Annual Variance\", \"0\"},\n                    {\"Information Ratio\", \"0\"},\n                    {\"Tracking Error\", \"0\"},\n                    {\"Treynor Ratio\", \"0\"},\n                    {\"Total Fees\", \"$1.00\"},\n                    {\"OrderListHash\", \"22f0bc8a92f13dfa5d16c507824e2b68\"}\n                    },\n                    Language.Python,\n                    AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonPackagesTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing Python.Runtime;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture, Category(\"TravisExclude\")]\n    public class PythonPackagesTests\n    {\n        [Test]\n        public void Tinygrad()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import numpy as np\n    from tinygrad import Tensor\n\n    t1 = Tensor([1, 2, 3, 4, 5])\n    na = np.array([1, 2, 3, 4, 5])\n    t2 = Tensor(na)\n\");\n        }\n\n        [Test]\n        public void Tigramite()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import numpy as np\n    import matplotlib\n    from matplotlib import pyplot as plt\n\n    import tigramite\n    from tigramite import data_processing as pp\n    from tigramite.toymodels import structural_causal_processes as toys\n\n    from tigramite.toymodels import surrogate_generator\n\n    from tigramite import plotting as tp\n    from tigramite.pcmci import PCMCI\n    from tigramite.independence_tests.parcorr import ParCorr\n    from tigramite.models import Models, Prediction\n\n    import math\n    import sklearn\n    from sklearn.linear_model import LinearRegression\n\n    np.random.seed(14)     # Fix random seed\n    lin_f = lambda x: x\n    links_coeffs = {0: [((0, -1), 0.7, lin_f)],\n                    1: [((1, -1), 0.8, lin_f), ((0, -1), 0.3, lin_f)],\n                    2: [((2, -1), 0.5, lin_f), ((0, -2), -0.5, lin_f)],\n                    3: [((3, -1), 0., lin_f)], #, ((4, -1), 0.4, lin_f)],\n                    4: [((4, -1), 0., lin_f), ((3, 0), 0.5, lin_f)], #, ((3, -1), 0.3, lin_f)],\n                    }\n    T = 200     # time series length\n    # Make some noise with different variance, alternatively just noises=None\n    noises = np.array([(1. + 0.2*float(j))*np.random.randn((T + int(math.floor(0.2*T))))\n                       for j in range(len(links_coeffs))]).T\n\n    data, _ = toys.structural_causal_process(links_coeffs, T=T, noises=noises, seed=14)\n    T, N = data.shape\n\n    # For generality, we include some masking\n    # mask = np.zeros(data.shape, dtype='int')\n    # mask[:int(T/2)] = True\n    mask=None\n\n    # Initialize dataframe object, specify time axis and variable names\n    var_names = [r'$X^0$', r'$X^1$', r'$X^2$', r'$X^3$', r'$X^4$']\n    dataframe = pp.DataFrame(data,\n                             mask=mask,\n                             datatime = {0:np.arange(len(data))},\n                             var_names=var_names)\n\");\n        }\n\n        [Test, Explicit()]\n        public void Tsfel()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import tsfel\n    import pandas as pd\n\n    # load dataset\n    data = tsfel.datasets.load_biopluxecg()\n\n    # Retrieves a pre-defined feature configuration file to extract the temporal, statistical and spectral feature sets\n    cfg = tsfel.get_features_by_domain()\n\n    # Extract features\n    X = tsfel.time_series_features_extractor(cfg, data)\n\");\n        }\n\n        [Test]\n        public void Cvxportfolio()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import cvxportfolio as cvx\n    import numpy as np\n    import pandas as pd\n\n    objective = cvx.ReturnsForecast() - 0.5 * cvx.FullCovariance()\n    constraints = [cvx.LongOnly(), cvx.LeverageLimit(1)]\n\n    strategy = cvx.SinglePeriodOptimization(objective, constraints)\n\");\n        }\n\n        [Test]\n        public void Cesium()\n        {\n            AssertCode(@\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn\nfrom cesium import datasets, featurize\n\ndef RunTest():\n    seaborn.set()\n\n    eeg = datasets.fetch_andrzejak()\n\n    # Group together classes (Z, O), (N, F), (S) as normal, interictal, ictal\n    eeg[\"\"classes\"\"] = eeg[\"\"classes\"\"].astype(\"\"U16\"\")  # allocate memory for longer class names\n    eeg[\"\"classes\"\"][np.logical_or(eeg[\"\"classes\"\"] == \"\"Z\"\", eeg[\"\"classes\"\"] == \"\"O\"\")] = \"\"Normal\"\"\n    eeg[\"\"classes\"\"][\n        np.logical_or(eeg[\"\"classes\"\"] == \"\"N\"\", eeg[\"\"classes\"\"] == \"\"F\"\")\n    ] = \"\"Interictal\"\"\n    eeg[\"\"classes\"\"][eeg[\"\"classes\"\"] == \"\"S\"\"] = \"\"Ictal\"\"\n\n    fig, ax = plt.subplots(1, len(np.unique(eeg[\"\"classes\"\"])), sharey=True)\n    for label, subplot in zip(np.unique(eeg[\"\"classes\"\"]), ax):\n        i = np.where(eeg[\"\"classes\"\"] == label)[0][0]\n        subplot.plot(eeg[\"\"times\"\"][i], eeg[\"\"measurements\"\"][i])\n        subplot.set(xlabel=\"\"time (s)\"\", ylabel=\"\"signal\"\", title=label)\n\n    features_to_use = [\n        \"\"amplitude\"\",\n        \"\"percent_beyond_1_std\"\",\n        \"\"maximum\"\",\n        \"\"max_slope\"\",\n        \"\"median\"\",\n        \"\"median_absolute_deviation\"\",\n        \"\"percent_close_to_median\"\",\n        \"\"minimum\"\",\n        \"\"skew\"\",\n        \"\"std\"\",\n        \"\"weighted_average\"\",\n    ]\n    fset_cesium = featurize.featurize_time_series(\n        times=eeg[\"\"times\"\"],\n        values=eeg[\"\"measurements\"\"],\n        errors=None,\n        features_to_use=features_to_use,\n    )\n    print(fset_cesium.head())\n\");\n        }\n\n        [Test, Explicit(\"Run separate\")]\n        public void Thinc()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from thinc.api import PyTorchWrapper, chain, Linear\n    import torch.nn\n\n    model = chain(\n        PyTorchWrapper(torch.nn.Linear(16, 8)),\n        Linear(4, 8)\n    )\n    X = model.ops.alloc2f(1, 16)  # make a dummy batch\n    model.initialize(X=X)\n    Y, backprop = model(X, is_train=True)\n    dX = backprop(Y)\n\");\n        }\n\n        [Test]\n        public void Scs()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import scipy\n    import scs\n    import numpy as np\n\n    # Set up the problem data\n    P = scipy.sparse.csc_matrix([[3.0, -1.0], [-1.0, 2.0]])\n    A = scipy.sparse.csc_matrix([[-1.0, 1.0], [1.0, 0.0], [0.0, 1.0]])\n    b = np.array([-1, 0.3, -0.5])\n    c = np.array([-1.0, -1.0])\n\n    # Populate dicts with data to pass into SCS\n    data = dict(P=P, A=A, b=b, c=c)\n    cone = dict(z=1, l=2)\n\n    # Initialize solver\n    solver = scs.SCS(data, cone, eps_abs=1e-9, eps_rel=1e-9)\n    # Solve!\n    sol = solver.solve()\n\n    print(f\"\"SCS took {sol['info']['iter']} iters\"\")\n    print(\"\"Optimal solution vector x*:\"\")\n    print(sol[\"\"x\"\"])\n\n    print(\"\"Optimal dual vector y*:\"\")\n    print(sol[\"\"y\"\"])\");\n        }\n\n        [Test]\n        public void ScikitImage()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import skimage as ski\n    from skimage import data, color\n    from skimage.transform import rescale, resize, downscale_local_mean\n\n    img = ski.data.astronaut()\n    top_left = img[:100, :100]\n\n    image = color.rgb2gray(data.astronaut())\n\n    image_rescaled = rescale(image, 0.25, anti_aliasing=False)\n    image_resized = resize(\n        image, (image.shape[0] // 4, image.shape[1] // 4), anti_aliasing=True\n    )\n    image_downscaled = downscale_local_mean(image, (4, 3))\");\n        }\n\n        [Test]\n        public void TensorboardX()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from tensorboardX import SummaryWriter\n    #SummaryWriter encapsulates everything\n    writer = SummaryWriter('runs/exp-1')\n    #creates writer object. The log will be saved in 'runs/exp-1'\n    writer2 = SummaryWriter()\n    #creates writer2 object with auto generated file name, the dir will be something like 'runs/Aug20-17-20-33'\n    writer3 = SummaryWriter(comment='3x learning rate')\");\n        }\n\n        [Test]\n        public void Peft()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from transformers import AutoModelForSeq2SeqLM\n    from peft import get_peft_config, get_peft_model, LoraConfig, TaskType\n    model_name_or_path = \"\"bigscience/mt0-large\"\"\n    tokenizer_name_or_path = \"\"bigscience/mt0-large\"\"\n\n    peft_config = LoraConfig(\n        task_type=TaskType.SEQ_2_SEQ_LM, inference_mode=False, r=8, lora_alpha=32, lora_dropout=0.1\n    )\");\n        }\n\n        [Test, Explicit()]\n        public void StatsForecast()\n        {\n            AssertCode(@\"\nfrom statsforecast import StatsForecast\nfrom statsforecast.models import AutoARIMA\nfrom statsforecast.utils import AirPassengersDF\n\ndef RunTest():\n    df = AirPassengersDF\n    sf = StatsForecast(\n        models=[AutoARIMA(season_length=12)],\n        freq='ME',\n    )\n    sf.fit(df)\n    sf.predict(h=12, level=[95])\");\n        }\n\n        [Test]\n        public void Ydf()\n        {\n            AssertCode(@\"\nimport ydf\nimport pandas as pd\n\ndef RunTest():\n    ds_path = \"\"https://raw.githubusercontent.com/google/yggdrasil-decision-forests/main/yggdrasil_decision_forests/test_data/dataset\"\"\n    train_ds = pd.read_csv(f\"\"{ds_path}/adult_train.csv\"\")\n    test_ds = pd.read_csv(f\"\"{ds_path}/adult_test.csv\"\")\n\n    model = ydf.GradientBoostedTreesLearner(label=\"\"income\"\").train(train_ds)\n\n    print(model.evaluate(test_ds))\n\n    model.save(\"\"my_model\"\")\n\n    loaded_model = ydf.load_model(\"\"my_model\"\")\");\n        }\n\n        [Test]\n        public void Cmaes()\n        {\n            AssertCode(@\"\nimport numpy as np\nfrom cmaes import CMA\n\ndef RunTest():\n    def quadratic(x1, x2):\n        return (x1 - 3) ** 2 + (10 * (x2 + 2)) ** 2\n\n    optimizer = CMA(mean=np.zeros(2), sigma=1.3)\n\n    for generation in range(1):\n        solutions = []\n        for _ in range(optimizer.population_size):\n            x = optimizer.ask()\n            value = quadratic(x[0], x[1])\n            solutions.append((x, value))\n            print(f\"\"#{generation} {value} (x1={x[0]}, x2 = {x[1]})\"\")\n        optimizer.tell(solutions)\");\n        }\n\n        [Test]\n        public void Transitions()\n        {\n            AssertCode(@\"\nfrom transitions import Machine\n\ndef RunTest():\n    # Define your states\n    states = ['awake', 'sleeping', 'dreaming']\n\n    # Create a model (can be any object)\n    class Human:\n        def __init__(self, name):\n            self.name = name\n\n    # Instantiate the model\n    person = Human(\"\"Alice\"\")\n    machine = Machine(model=person, states=states, initial='awake')\n\n    machine.add_transition('fall_asleep', 'awake', 'sleeping')\n    machine.add_transition('start_dreaming', 'sleeping', 'dreaming')\n    machine.add_transition('wake_up', 'dreaming', 'awake')\n    machine.add_transition('wake_up', 'sleeping', 'awake') # Can have multiple transitions for same event\n\n    print(f\"\"{person.name} is currently {person.state}\"\")\n    person.fall_asleep()\n    print(f\"\"{person.name} is now {person.state}\"\")\n    person.start_dreaming()\n    print(f\"\"{person.name} is now {person.state}\"\")\");\n        }\n\n        [Test]\n        public void Casualml()\n        {\n            AssertCode(@\"\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import Ridge\nfrom causalml.inference.meta import BaseRRegressor\n\ndef RunTest():\n    # 1. Generate synthetic data (replace with your actual data)\n    np.random.seed(42)\n    n_samples = 100\n    X = pd.DataFrame(np.random.rand(n_samples, 5), columns=[f'feature_{i}' for i in range(5)])\n    treatment = np.random.randint(0, 2, n_samples)\n    y = (10 * treatment + 2 * X['feature_0'] + np.random.randn(n_samples))\n\n    # 2. Instantiate the R-Learner with a base model\n    rl = BaseRRegressor(learner=Ridge(alpha=1.0))\n\n    # 3. Estimate the Average Treatment Effect (ATE)\n    # Note: In a real scenario, 'p' (propensity scores) would be estimated\n    # if not available from a randomized experiment.\n    # For simplicity, we'll assume a constant propensity for this example.\n    p = np.full(n_samples, 0.5)\n\n    te, lb, ub = rl.estimate_ate(X=X, p=p, treatment=treatment, y=y)\n\n    print(f'Average Treatment Effect (BaseRRegressor using XGBoost): {te[0]:.2f} ({lb[0]:.2f}, {ub[0]:.2f})')\");\n        }\n\n        [Test]\n        public void Networkx()\n        {\n            AssertCode(@\"\nimport networkx as nx\ndef RunTest():\n    G = nx.Graph()\n    H = nx.path_graph(10)\n    G.add_nodes_from(H)\n    G.clear()\");\n        }\n\n        [Test]\n        public void Accelerator()\n        {\n            AssertCode(@\"\ndef RunTest():\n\timport torch\n\timport torch.nn.functional as F\n\tfrom datasets import load_dataset\n\tfrom accelerate import Accelerator\n\n\taccelerator = Accelerator()\n\tdevice = accelerator.device\n\n\tmodel = torch.nn.Transformer().to(device)\n\toptimizer = torch.optim.Adam(model.parameters())\n\");\n        }\n\n        [Test]\n        public void Lingam()\n        {\n            AssertCode(@\"\nimport numpy as np\nimport pandas as pd\nimport graphviz\nimport lingam\nfrom lingam.utils import make_dot\n\ndef RunTest():\n    x3 = np.random.uniform(size=1000)\n    x0 = 3.0*x3 + np.random.uniform(size=1000)\n    x2 = 6.0*x3 + np.random.uniform(size=1000)\n    x1 = 3.0*x0 + 2.0*x2 + np.random.uniform(size=1000)\n    x5 = 4.0*x0 + np.random.uniform(size=1000)\n    x4 = 8.0*x0 - 1.0*x2 + np.random.uniform(size=1000)\n    X = pd.DataFrame(np.array([x0, x1, x2, x3, x4, x5]).T ,columns=['x0', 'x1', 'x2', 'x3', 'x4', 'x5'])\n    X.head()\n\n    model = lingam.DirectLiNGAM()\n    model.fit(X)\n\");\n        }\n\n        [Test]\n        public void Econml()\n        {\n            AssertCode(@\"\nimport numpy as np\nimport pandas as pd\nfrom econml.dml import LinearDML\nfrom sklearn.ensemble import RandomForestRegressor\n\ndef RunTest():\n    # Generate some synthetic data\n    np.random.seed(42)\n    n_samples = 1000\n    n_features = 5\n\n    # Confounders (W)\n    W = np.random.rand(n_samples, n_features)\n\n    # Treatment (T) - depends on W\n    T = (W[:, 0] + W[:, 1] + np.random.randn(n_samples) * 0.5 > 1).astype(int)\n\n    # Heterogeneous treatment effect (effect_modifier)\n    effect_modifier = W[:, 2] * 2 + W[:, 3]\n\n    # Outcome (Y) - depends on W, T, and effect_modifier\n    Y = 2 * W[:, 0] + 3 * W[:, 1] + T * effect_modifier + np.random.randn(n_samples) * 1\n\n    # Define the models for the nuisance functions\n    # These models are used to predict the outcome and treatment based on confounders\n    model_y = RandomForestRegressor(n_estimators=100, min_samples_leaf=10, random_state=42)\n    model_t = RandomForestRegressor(n_estimators=100, min_samples_leaf=10, random_state=42)\n\n    # Initialize the LinearDML estimator\n    # We specify the models for Y and T, and the features that modify the treatment effect (X)\n    dml = LinearDML(model_y=model_y,\n                    model_t=model_t,\n                    random_state=42)\n\n    # Fit the model\n    # Y: Outcome variable\n    # T: Treatment variable\n    # X: Features that modify the treatment effect (can be None if no heterogeneity is assumed)\n    # W: Confounders\n    dml.fit(Y, T, X=effect_modifier.reshape(-1, 1), W=W)\n\n    # Estimate the Conditional Average Treatment Effect (CATE)\n    # We need to provide the features (X) for which we want to estimate the CATE\n    X_test = np.array([[0.5], [1.0], [1.5]]) # Example values for the effect modifier\n    cate_estimates = dml.const_marginal_effect(X_test)\n\n    print(cate_estimates)\n\n    # Get the confidence intervals for the CATE estimates\n    cate_intervals = dml.const_marginal_effect_interval(X_test)\n    print(cate_intervals)\n\");\n        }\n\n        [Test, Explicit(\"Legacy\")]\n        public void alibi_detect()\n        {\n            AssertCode(@\"\ndef RunTest():\n\tfrom alibi_detect.datasets import fetch_cifar10c\n\n\tcorruption = ['gaussian_noise']\n\tX, y = fetch_cifar10c(corruption=corruption, severity=1, return_X_y=True)\");\n        }\n\n        [Test]\n        public void PytorchTabnet()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from pytorch_tabnet.tab_model import TabNetClassifier, TabNetRegressor\n\n    clf = TabNetClassifier()\");\n        }\n\n        [Test]\n        public void FeatureEngine()\n        {\n            AssertCode(@\"\ndef RunTest():\n\timport pandas as pd\n\tfrom feature_engine.encoding import RareLabelEncoder\n\n\tdata = {'var_A': ['A'] * 10 + ['B'] * 10 + ['C'] * 2 + ['D'] * 1}\n\tdata = pd.DataFrame(data)\n\tdata['var_A'].value_counts()\n\trare_encoder = RareLabelEncoder(tol=0.10, n_categories=3)\n\tdata_encoded = rare_encoder.fit_transform(data)\n\tdata_encoded['var_A'].value_counts()\");\n        }\n\n        [Test]\n        public void Nolds()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import nolds\n    import numpy as np\n\n    rwalk = np.cumsum(np.random.random(1000))\n    h = nolds.dfa(rwalk)\");\n        }\n\n        [Test]\n        public void Pgmpy()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from pgmpy.base import DAG\n    G = DAG()\n    G.add_node(node='a')\n    G.add_nodes_from(nodes=['a', 'b'])\");\n        }\n\n        [Test]\n        public void Control()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import numpy as np\n    import control\n\n    num1 = np.array([2])\n    den1 = np.array([1, 0])\n    num2 = np.array([3])\n    den2 = np.array([4, 1])\n    H1 = control.tf(num1, den1)\n    H2 = control.tf(num2, den2)\n\n    H = control.series(H1, H2)\");\n        }\n\n        [Test, Explicit(\"Requires older pandas\")]\n        public void PyCaret()\n        {\n            AssertCode(@\"\nfrom pycaret.datasets import get_data\nfrom pycaret.classification import setup\n\ndef RunTest():\n    data = get_data('diabetes')\n    s = setup(data, target = 'Class variable', session_id = 123)\");\n        }\n\n        [Test]\n        public void NGBoost()\n        {\n            AssertCode(@\"\ndef RunTest():\n\tfrom ngboost import NGBClassifier\n\tfrom ngboost.distns import k_categorical, Bernoulli\n\tfrom sklearn.datasets import load_breast_cancer\n\tfrom sklearn.model_selection import train_test_split\n\n\tX, y = load_breast_cancer(return_X_y=True)\n\ty[0:15] = 2 # artificially make this a 3-class problem instead of a 2-class problem\n\tX_cls_train, X_cls_test, Y_cls_train, Y_cls_test = train_test_split(X, y, test_size=0.2)\n\n\tngb_cat = NGBClassifier(Dist=k_categorical(3), verbose=False) # tell ngboost that there are 3 possible outcomes\n\t_ = ngb_cat.fit(X_cls_train, Y_cls_train) # Y should have only 3 values: {0,1,2}\");\n        }\n\n        [Test]\n        public void MLFlow()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import mlflow\n    from mlflow.models import infer_signature\n\n    import pandas as pd\n    from sklearn import datasets\n    from sklearn.model_selection import train_test_split\n    from sklearn.linear_model import LogisticRegression\n    from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score\n\n\n    # Load the Iris dataset\n    X, y = datasets.load_iris(return_X_y=True)\n\n    # Split the data into training and test sets\n    X_train, X_test, y_train, y_test = train_test_split(\n        X, y, test_size=0.2, random_state=42\n    )\n\n    # Define the model hyperparameters\n    params = {\n        \"\"solver\"\": \"\"lbfgs\"\",\n        \"\"max_iter\"\": 1000,\n        \"\"multi_class\"\": \"\"auto\"\",\n        \"\"random_state\"\": 8888,\n    }\n\n    # Train the model\n    lr = LogisticRegression(**params)\n    lr.fit(X_train, y_train)\n\n    # Predict on the test set\n    y_pred = lr.predict(X_test)\n\n    # Calculate metrics\n    accuracy = accuracy_score(y_test, y_pred)\");\n        }\n\n        [Test]\n        public void TPOT()\n        {\n            AssertCode(@\"\ndef RunTest():\n    from tpot import TPOTClassifier\n    from sklearn.datasets import load_digits\n    from sklearn.model_selection import train_test_split\n\n    digits = load_digits()\n    X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target,\n                                                        train_size=0.75, test_size=0.25)\n\n    pipeline_optimizer = TPOTClassifier(generations=2, population_size=2, cv=5,\n                                        random_state=42, verbosity=2)\n    pipeline_optimizer.fit(X_train, y_train)\n    print(pipeline_optimizer.score(X_test, y_test))\n    pipeline_optimizer.export('tpot_exported_pipeline.py')\");\n        }\n\n        [Test, Explicit(\"Needs to be run by itself to avoid hanging\")]\n        public void XTransformers()\n        {\n            AssertCode(\n                @\"\nimport torch\nfrom x_transformers import XTransformer\n\ndef RunTest():\n    model = XTransformer(\n        dim = 512,\n        enc_num_tokens = 256,\n        enc_depth = 6,\n        enc_heads = 8,\n        enc_max_seq_len = 1024,\n        dec_num_tokens = 256,\n        dec_depth = 6,\n        dec_heads = 8,\n        dec_max_seq_len = 1024,\n        tie_token_emb = True      # tie embeddings of encoder and decoder\n    )\n\n    src = torch.randint(0, 256, (1, 1024))\n    src_mask = torch.ones_like(src).bool()\n    tgt = torch.randint(0, 256, (1, 1024))\n\n    loss = model(src, tgt, mask = src_mask) # (1, 1024, 512)\n    loss.backward()\");\n        }\n\n        [Test, Explicit(\"Requires old polars\")]\n        public void Functime()\n        {\n            AssertCode(\n                @\"\nimport polars as pl\nfrom functime.cross_validation import train_test_split\nfrom functime.seasonality import add_fourier_terms\nfrom functime.forecasting import linear_model\nfrom functime.preprocessing import scale\nfrom functime.metrics import mase\n\ndef RunTest():\n    # Load commodities price data\n    y = pl.read_parquet(\"\"https://github.com/functime-org/functime/raw/main/data/commodities.parquet\"\")\n    entity_col, time_col = y.columns[:2]\n\n    # Time series split\n    y_train, y_test = y.pipe(train_test_split(test_size=3))\n\n    # Fit-predict\n    forecaster = linear_model(freq=\"\"1mo\"\", lags=24)\n    forecaster.fit(y=y_train)\n    y_pred = forecaster.predict(fh=3)\n\n    # functime ❤️ functional design\n    # fit-predict in a single line\n    y_pred = linear_model(freq=\"\"1mo\"\", lags=24)(y=y_train, fh=3)\n\n    # Score forecasts in parallel\n    scores = mase(y_true=y_test, y_pred=y_pred, y_train=y_train)\n\n    # Forecast with target transforms and feature transforms\n    forecaster = linear_model(\n        freq=\"\"1mo\"\",\n        lags=24,\n        target_transform=scale(),\n        feature_transform=add_fourier_terms(sp=12, K=6)\n    )\n\n    # Forecast with exogenous regressors!\n    # Just pass them into X\n    X = (\n        y.select([entity_col, time_col])\n        .pipe(add_fourier_terms(sp=12, K=6)).collect()\n    )\n    X_train, X_future = y.pipe(train_test_split(test_size=3))\n    forecaster = linear_model(freq=\"\"1mo\"\", lags=24)\n    forecaster.fit(y=y_train, X=X_train)\n    y_pred = forecaster.predict(fh=3, X=X_future)\");\n        }\n\n        [Test, Explicit(\"Run separate\")]\n        public void Mlforecast()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nimport lightgbm as lgb\n\nfrom mlforecast import MLForecast\nfrom sklearn.linear_model import LinearRegression\n\ndef RunTest():\n    df = pd.read_csv('https://datasets-nixtla.s3.amazonaws.com/air-passengers.csv', parse_dates=['ds'])\n    mlf = MLForecast(\n        models = [LinearRegression(), lgb.LGBMRegressor()],\n        lags=[1, 12],\n        freq = 'M'\n    )\n    mlf.fit(df)\n    mlf.predict(12)\");\n        }\n\n        [Test]\n        public void Mapie()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom numpy.typing import NDArray\nfrom sklearn.neural_network import MLPRegressor\nfrom mapie.metrics.regression import regression_coverage_score\nfrom mapie.regression import SplitConformalRegressor\nfrom mapie.utils import train_conformalize_test_split\n\nRANDOM_STATE = 1\n\ndef RunTest():\n    def f(x: NDArray) -> NDArray:\n        \"\"\"\"\"\"Polynomial function used to generate one-dimensional data.\"\"\"\"\"\"\n        return np.array(5 * x + 5 * x**4 - 9 * x**2)\n\n\n    rng = np.random.default_rng(1)\n    sigma = 0.1\n    n_samples = 10000\n    X = np.linspace(0, 1, n_samples)\n    y = f(X) + rng.normal(0, sigma, n_samples)\n    X = X.reshape(-1, 1)\n    (X_train, X_conformalize, X_test,\n     y_train, y_conformalize, y_test) = train_conformalize_test_split(\n        X, y,\n        train_size=0.8, conformalize_size=0.1, test_size=0.1,\n        random_state=RANDOM_STATE\n    )\n    regressor = MLPRegressor(activation=\"\"relu\"\", random_state=RANDOM_STATE)\n    regressor.fit(X_train, y_train)\n\n    confidence_level = 0.95\n    mapie_regressor = SplitConformalRegressor(\n        estimator=regressor, confidence_level=confidence_level, prefit=True\n    )\n    mapie_regressor.conformalize(X_conformalize, y_conformalize)\n    y_pred, y_pred_interval = mapie_regressor.predict_interval(X_test)\n    coverage_score = regression_coverage_score(y_test, y_pred_interval)\n    print(f\"\"For a confidence level of {confidence_level:.2f}, \"\"\n          f\"\"the target coverage is {confidence_level:.3f}, \"\"\n          f\"\"and the effective coverage is {coverage_score[0]:.3f}.\"\")\");\n        }\n\n        [Test]\n        public void H20()\n        {\n            AssertCode(\n                @\"\nimport h2o\n\ndef RunTest():\n    h2o.init(ip = \"\"localhost\"\", port = 54321)\n    h2o.cluster().shutdown()\");\n        }\n\n        [Test]\n        public void Langchain()\n        {\n            AssertCode(\n                @\"\nfrom langchain.prompts import PromptTemplate\n\ndef RunTest():\n    prompt = PromptTemplate.from_template(\"\"What is a good name for a company that makes {product}?\"\")\n    prompt.format(product=\"\"colorful socks\"\")\");\n        }\n\n        [Test]\n        public void Rbeast()\n        {\n            AssertCode(\n                @\"\nimport Rbeast as rb\n\ndef RunTest():\n    (Nile, Year) = rb.load_example('nile')\n    o = rb.beast(Nile, season = 'none')\n    rb.plot(o)\");\n        }\n\n        [Test, Explicit(\"Needs to be run by itself to avoid hanging\")]\n        public void Transformers()\n        {\n            AssertCode(\n                @\"\nfrom transformers import pipeline\n\ndef RunTest():\n    classifier = pipeline('sentiment-analysis')\n\n    classifier('We are very happy to introduce pipeline to the transformers repository.')\");\n        }\n\n        [Test]\n        public void FixedEffectModel()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport pandas as pd\n\nfrom fixedeffect.iv import ivgmm\nfrom fixedeffect.utils.panel_dgp import gen_data\n\ndef RunTest():\n    N = 100\n    T = 10\n    beta = [-3,1,2,3,4]\n    ate = 1\n    exp_date = 5\n    df = gen_data(N, T, beta, ate, exp_date)\n    formula = 'y ~ x_1|id+time|0|(x_2~x_3+x_4)'\n    model_iv2sls = ivgmm(data_df = df, formula = formula)\n    result = model_iv2sls.fit()\n    result\");\n        }\n\n        [Test]\n        public void Iisignature()\n        {\n            AssertCode(\n                @\"\nimport iisignature\nimport numpy as np\n\ndef RunTest():\n    path = np . random . uniform ( size =(20 ,3) )\n    signature = iisignature . sig ( path ,4)\n    s = iisignature . prepare (3 ,4)\n    logsignature = iisignature . logsig ( path , s )\");\n        }\n\n        [Test]\n        public void PyStan()\n        {\n            AssertCode(\n                @\"\nimport stan\n\ndef RunTest():\n    schools_code = \"\"\"\"\"\"\n    data {\n      int<lower=0> J;         // number of schools\n      array[J] real y;              // estimated treatment effects\n      array[J] real<lower=0> sigma; // standard error of effect estimates\n    }\n    parameters {\n      real mu;                // population treatment effect\n      real<lower=0> tau;      // standard deviation in treatment effects\n      vector[J] eta;          // unscaled deviation from mu by school\n    }\n    transformed parameters {\n      vector[J] theta = mu + tau * eta;        // school treatment effects\n    }\n    model {\n      target += normal_lpdf(eta | 0, 1);       // prior log-density\n      target += normal_lpdf(y | theta, sigma); // log-likelihood\n    }\n    \"\"\"\"\"\"\n\n    schools_data = {\"\"J\"\": 8,\n                    \"\"y\"\": [28,  8, -3,  7, -1,  1, 18, 12],\n                    \"\"sigma\"\": [15, 10, 16, 11,  9, 11, 10, 18]}\n\n    posterior = stan.build(schools_code, data=schools_data)\n    fit = posterior.sample(num_chains=4, num_samples=1000)\n    eta = fit[\"\"eta\"\"]  # array with shape (8, 4000)\n    df = fit.to_frame()  # pandas `DataFrame, requires pandas\");\n        }\n\n        [Test]\n        public void Deslib()\n        {\n            AssertCode(@\"\nimport numpy as np\nfrom sklearn.datasets import make_classification\nfrom sklearn.model_selection import train_test_split\nfrom deslib.des import METADES\nfrom deslib.des import KNORAE\n\ndef RunTest():\n    # Setting up the random state to have consistent results\n    rng = np.random.RandomState(42)\n\n    # Generate a classification dataset\n    X, y = make_classification(n_samples=1000, random_state=rng)\n    # split the data into training and test data\n    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33,\n                                                        random_state=rng)\n\n    # Split the data into training and DSEL for DS techniques\n    X_train, X_dsel, y_train, y_dsel = train_test_split(X_train, y_train,\n                                                        test_size=0.5,\n                                                        random_state=rng)\n\n    # Initialize the DS techniques. DS methods can be initialized without\n    # specifying a single input parameter. In this example, we just pass the random\n    # state in order to always have the same result.\n    kne = KNORAE(random_state=rng)\n    meta = METADES(random_state=rng)\n\n    # Fitting the des techniques\n    kne.fit(X_dsel, y_dsel)\n    meta.fit(X_dsel, y_dsel)\n\n    # Calculate classification accuracy of each technique\n    print('Evaluating DS techniques:')\n    print('Classification accuracy KNORA-Eliminate: ',\n          kne.score(X_test, y_test))\n    print('Classification accuracy META-DES: ', meta.score(X_test, y_test))\n\");\n        }\n\n        [Test, Explicit(\"Run separate\")]\n        public void PyvinecopulibTest()\n        {\n            AssertCode(\n                @\"\nimport pyvinecopulib as pv\nimport numpy as np\n\ndef RunTest():\n    pv.Bicop()\n    cop = pv.Bicop(family=pv.gaussian, parameters=np.array([[0.5]]))\n    print(cop)\n    print(pv.Bicop(family=pv.clayton, rotation=90, parameters=np.array([[3.0]])))\n\n    cop = pv.Bicop(family=pv.student, parameters=np.array([[0.5], [4]]))\n    print(cop)\n    u = cop.simulate(n=10, seeds=[1, 2, 3])\n    fcts = [\n      cop.pdf,\n      cop.cdf,\n      cop.hfunc1,\n      cop.hfunc2,\n      cop.hinv1,\n      cop.hinv2,\n      cop.loglik,\n      cop.aic,\n      cop.bic,\n    ]\n    [f(u) for f in fcts]\n\");\n        }\n\n        [Test]\n        public void HvplotTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport pandas as pd\nimport hvplot.pandas\n\ndef RunTest():\n    index = pd.date_range('1/1/2000', periods=1000)\n    df = pd.DataFrame(np.random.randn(1000, 4), index=index, columns=list('ABCD')).cumsum()\n\n    df.head()\n    pd.options.plotting.backend = 'holoviews'\n    df.plot()\");\n        }\n\n        [Test]\n        public void StumpyTest()\n        {\n            AssertCode(\n                @\"\nimport stumpy\nimport numpy as np\n\ndef RunTest():\n    your_time_series = np.random.rand(100)\n    window_size = 10  # Approximately, how many data points might be found in a pattern\n\n    stumpy.stump(your_time_series, m=window_size)\");\n        }\n\n        [Test]\n        public void RiverTest()\n        {\n            AssertCode(\n                @\"\nfrom river import datasets\n\ndef RunTest():\n    datasets.Phishing()\");\n        }\n\n        [Test]\n        public void BokehTest()\n        {\n            AssertCode(\n                @\"\nfrom bokeh.plotting import figure, output_file, show\n\ndef RunTest():\n    # output to static HTML file\n    output_file(\"\"line.html\"\")\n\n    p = figure(width=400, height=400)\n\n    # add a circle renderer with a size, color, and alpha\n    p.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color=\"\"navy\"\", alpha=0.5)\n\n    # show the results\n    show(p)\");\n        }\n\n        [Test]\n        public void LineProfilerTest()\n        {\n            AssertCode(\n                @\"\nfrom line_profiler import LineProfiler\nimport random\n\ndef RunTest():\n    def do_stuff(numbers):\n        s = sum(numbers)\n        l = [numbers[i]/43 for i in range(len(numbers))]\n        m = ['hello'+str(numbers[i]) for i in range(len(numbers))]\n\n    numbers = [random.randint(1,100) for i in range(1000)]\n    lp = LineProfiler()\n    lp_wrapper = lp(do_stuff)\n    lp_wrapper(numbers)\n    lp.print_stats()\");\n        }\n\n        [Test]\n        public void FuzzyCMeansTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom fcmeans import FCM\nfrom matplotlib import pyplot as plt\n\ndef RunTest():\n    n_samples = 3000\n\n    X = np.concatenate((\n        np.random.normal((-2, -2), size=(n_samples, 2)),\n        np.random.normal((2, 2), size=(n_samples, 2))\n    ))\n    fcm = FCM(n_clusters=2)\n    fcm.fit(X)\n    # outputs\n    fcm_centers = fcm.centers\n    fcm.predict(X)\");\n        }\n\n        [Test]\n        public void MdptoolboxTest()\n        {\n            AssertCode(\n                @\"\nimport mdptoolbox.example\n\ndef RunTest():\n    P, R = mdptoolbox.example.forest()\n    vi = mdptoolbox.mdp.ValueIteration(P, R, 0.9)\n    vi.run()\n    vi.policy\");\n        }\n\n        [Test]\n        public void NumerapiTest()\n        {\n            AssertCode(\n                @\"\nimport numerapi\n\ndef RunTest():\n    napi = numerapi.NumerAPI(verbosity=\"\"warning\"\")\n    napi.get_leaderboard()\");\n        }\n\n        [Test]\n        public void StockstatsTest()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nimport stockstats\n\ndef RunTest():\n    d = {'date': [ '20220901', '20220902' ], 'open': [ 1, 2 ], 'close': [ 1, 2 ],'high': [ 1, 2], 'low': [ 1, 2 ], 'volume': [ 1, 2 ] }\n    df = pd.DataFrame(data=d)\n    stock = stockstats.wrap(df)\");\n        }\n\n        [Test]\n        public void HurstTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom hurst import compute_Hc, random_walk\n\ndef RunTest():\n    # Use random_walk() function or generate a random walk series manually:\n    # series = random_walk(99999, cumprod=True)\n    np.random.seed(42)\n    random_changes = 1. + np.random.randn(99999) / 1000.\n    series = np.cumprod(random_changes)  # create a random walk from random changes\n\n    # Evaluate Hurst equation\n    H, c, data = compute_Hc(series, kind='price', simplified=True)\");\n        }\n\n        [Test]\n        public void PolarsTest()\n        {\n            AssertCode(\n                @\"\nimport polars as pl\n\ndef RunTest():\n    df = pl.DataFrame({ \"\"A\"\": [1, 2, 3, 4, 5], \"\"fruits\"\": [\"\"banana\"\", \"\"banana\"\", \"\"apple\"\", \"\"apple\"\", \"\"banana\"\"], \"\"cars\"\": [\"\"beetle\"\", \"\"audi\"\", \"\"beetle\"\", \"\"beetle\"\", \"\"beetle\"\"], })\n    df.sort(\"\"fruits\"\")\");\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void TensorflowProbabilityTest()\n        {\n            AssertCode(\n                @\"\nimport tensorflow as tf\nimport tensorflow_probability as tfp\n\ndef RunTest():\n    # Pretend to load synthetic data set.\n    features = tfp.distributions.Normal(loc=0., scale=1.).sample(int(100e3))\n    labels = tfp.distributions.Bernoulli(logits=1.618 * features).sample()\n\n    # Specify model.\n    model = tfp.glm.Bernoulli()\n\n    # Fit model given data.\n    coeffs, linear_response, is_converged, num_iter = tfp.glm.fit(\n        model_matrix=features[:, tf.newaxis],\n        response=tf.cast(labels, dtype=tf.float32),\n        model=model)\");\n        }\n\n        [Test]\n        public void MpmathTest()\n        {\n            AssertCode(\n                @\"\nfrom mpmath import sin, cos\n\ndef RunTest():\n    sin(1), cos(1)\");\n        }\n\n        [Test]\n        public void LimeTest()\n        {\n            AssertCode(\n                @\"\nfrom __future__ import print_function\nimport sklearn\nimport sklearn.datasets\nimport sklearn.ensemble\nimport numpy as np\nimport lime\nimport lime.lime_tabular\nnp.random.seed(1)\n\ndef RunTest():\n\tiris = sklearn.datasets.load_iris()\n\n\ttrain, test, labels_train, labels_test = sklearn.model_selection.train_test_split(iris.data, iris.target, train_size=0.80)\n\n\trf = sklearn.ensemble.RandomForestClassifier(n_estimators=500)\n\trf.fit(train, labels_train)\n\n\tsklearn.metrics.accuracy_score(labels_test, rf.predict(test))\n\texplainer = lime.lime_tabular.LimeTabularExplainer(train, feature_names=iris.feature_names, class_names=iris.target_names, discretize_continuous=True)\"\n            );\n        }\n\n        [Test]\n        public void ShapTest()\n        {\n            AssertCode(\n                @\"\nimport xgboost\nimport numpy as np\nimport shap\n\ndef RunTest():\n\t# simulate some binary data and a linear outcome with an interaction term\n\t# note we make the features in X perfectly independent of each other to make\n\t# it easy to solve for the exact SHAP values\n\tN = 2000\n\tX = np.zeros((N,5))\n\tX[:1000,0] = 1\n\tX[:500,1] = 1\n\tX[1000:1500,1] = 1\n\tX[:250,2] = 1\n\tX[500:750,2] = 1\n\tX[1000:1250,2] = 1\n\tX[1500:1750,2] = 1\n\tX[:,0:3] -= 0.5\n\ty = 2*X[:,0] - 3*X[:,1]\n\n\tXd = xgboost.DMatrix(X, label=y)\n\tmodel = xgboost.train({\n\t    'eta':1, 'max_depth':3, 'base_score': 0, \"\"lambda\"\": 0\n\t}, Xd, 1)\n\tprint(\"\"Model error =\"\", np.linalg.norm(y-model.predict(Xd)))\n\tprint(model.get_dump(with_stats=True)[0])\n\n\t# make sure the SHAP values add up to marginal predictions\n\tpred = model.predict(Xd, output_margin=True)\n\texplainer = shap.TreeExplainer(model)\n\tshap_values = explainer.shap_values(Xd)\n\tnp.abs(shap_values.sum(1) + explainer.expected_value - pred).max()\n\n\tshap.summary_plot(shap_values, X)\"\n            );\n        }\n\n        [Test, Explicit(\"Run separate\")]\n        public void MlxtendTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport itertools\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.svm import SVC\nfrom sklearn.ensemble import RandomForestClassifier\nfrom mlxtend.classifier import EnsembleVoteClassifier\nfrom mlxtend.data import iris_data\nfrom mlxtend.plotting import plot_decision_regions\n\ndef RunTest():\n   # Initializing Classifiers\n   clf1 = LogisticRegression(random_state=0)\n   clf2 = RandomForestClassifier(random_state=0)\n   clf3 = SVC(random_state=0, probability=True)\n   eclf = EnsembleVoteClassifier(clfs=[clf1, clf2, clf3],\n                                 weights=[2, 1, 1], voting='soft')\n   # Loading some example data\n   X, y = iris_data()\n   X = X[:,[0, 2]]\n\n   # Plotting Decision Regions\n   gs = gridspec.GridSpec(2, 2)\n   fig = plt.figure(figsize=(10, 8))\n\n   labels = ['Logistic Regression',\n             'Random Forest',\n             'RBF kernel SVM',\n             'Ensemble']\n\n   for clf, lab, grd in zip([clf1, clf2, clf3, eclf],\n                            labels,\n                            itertools.product([0, 1],\n                            repeat=2)):\n       clf.fit(X, y)\n       ax = plt.subplot(gs[grd[0], grd[1]])\n       fig = plot_decision_regions(X=X, y=y,\n                                   clf=clf, legend=2)\n       plt.title(lab)\n\n   plt.show()\"\n            );\n        }\n\n        [Test]\n        public void Filterpy()\n        {\n            AssertCode(\n                $@\"\nfrom filterpy.kalman import KalmanFilter\n\ndef RunTest():\n    kf = KalmanFilter(dim_x=3, dim_z=1)\"\n            );\n        }\n\n        [Test]\n        public void Genai()\n        {\n            AssertCode(\n                $@\"\nfrom google import genai\nfrom google.genai import types\n\ndef RunTest():\n    assert(genai.__version__ == '1.56.0')\"\n            );\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void IgniteTest()\n        {\n            AssertCode(\n                $@\"\nimport ignite\n\ndef RunTest():\n    assert(ignite.__version__ == '0.5.3')\"\n            );\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void StellargraphTest()\n        {\n            AssertCode(\n                $@\"\nimport stellargraph\n\ndef RunTest():\n    assert(stellargraph.__version__ == '1.2.1')\"\n            );\n        }\n\n        [Test, Explicit(\"Sometimes hangs when run along side the other tests\")]\n        public void TensorlyTest()\n        {\n            AssertCode(\n                @\"\nimport tensorly as tl\nfrom tensorly import random\n\ndef RunTest():\n\ttensor = random.random_tensor((10, 10, 10))\n\t# This will be a NumPy array by default\n\ttl.set_backend('pytorch')\n\t# TensorLy now uses TensorLy for all operations\n\n\ttensor = random.random_tensor((10, 10, 10))\n\t# This will be a PyTorch array by default\n\ttl.max(tensor)\n\ttl.mean(tensor)\n\ttl.dot(tl.unfold(tensor, 0), tl.transpose(tl.unfold(tensor, 0)))\"\n            );\n        }\n\n        [Test]\n        public void SpacyTest()\n        {\n            AssertCode(\n                @\"\nimport spacy\nfrom spacy.lang.en.examples import sentences\n\ndef RunTest():\n    nlp = spacy.load(\"\"en_core_web_md\"\")\n    doc = nlp(sentences[0])\n    print(doc.text)\"\n            );\n        }\n\n        [Test]\n        public void PyEMDTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport PyEMD\n\ndef RunTest():\n    s = np.random.random(100)\n    emd = PyEMD.EMD()\n    IMFs = emd(s)\"\n            );\n        }\n\n        [Test]\n        public void RipserTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport ripser\nimport persim\ndef RunTest():\n    data = np.random.random((100,2))\n    diagrams = ripser.ripser(data)['dgms']\n    persim.plot_diagrams(diagrams, show=True)\"\n            );\n        }\n\n        [Test]\n        public void AlphalensTest()\n        {\n            AssertCode(\n                @\"\nimport alphalens\nimport pandas\ndef RunTest():\n    tickers = ['A', 'B', 'C', 'D', 'E', 'F']\n\n    factor_groups = {'A': 1, 'B': 1, 'C': 1, 'D': 2, 'E': 2, 'F': 2}\n\n    daily_rets = [1, 1, 2, 1, 1, 2]\n    price_data = [[daily_rets[0]**i, daily_rets[1]**i, daily_rets[2]**i,\n           daily_rets[3]**i, daily_rets[4]**i, daily_rets[5]**i]\n          for i in range(1, 5)]  # 4 days\n\n    start = '2015-1-11'\n    factor_end = '2015-1-13'\n    price_end = '2015-1-14'  # 1D fwd returns\n\n    price_index = pandas.date_range(start=start, end=price_end)\n    price_index.name = 'date'\n    prices = pandas.DataFrame(index=price_index, columns=tickers, data=price_data)\n\n    factor = 2\n    factor_index = pandas.date_range(start=start, end=factor_end)\n    factor_index.name = 'date'\n    factor = pandas.DataFrame(index=factor_index, columns=tickers,\n       data=factor).stack()\n\n    # Ingest and format data\n    factor_data = alphalens.utils.get_clean_factor_and_forward_returns(\n        factor, prices,\n        groupby=factor_groups,\n        quantiles=None,\n        bins=True,\n        periods=(1,))\"\n            );\n        }\n\n        [Test]\n        public void NumpyTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\ndef RunTest():\n    return numpy.pi\"\n            );\n        }\n\n        [Test]\n        public void ScipyTest()\n        {\n            AssertCode(\n                @\"\nfrom scipy.ndimage import mean as nd_mean\nimport numpy\ndef RunTest():\n    return nd_mean(numpy.array([1, 2, 3, 4, 5]))\"\n            );\n        }\n\n        [Test]\n        public void SklearnTest()\n        {\n            AssertCode(\n                @\"\nfrom sklearn.ensemble import RandomForestClassifier\ndef RunTest():\n    return RandomForestClassifier()\"\n            );\n        }\n\n        [Test]\n        public void CvxoptTest()\n        {\n            AssertCode(\n                @\"\nimport cvxopt\ndef RunTest():\n    return cvxopt.matrix([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], (2,3))\"\n            );\n        }\n\n        [Test]\n        public void TalibTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nimport talib\ndef RunTest():\n    return talib.SMA(numpy.random.random(100))\"\n            );\n        }\n\n        [Test]\n        public void CvxpyTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nimport cvxpy\ndef RunTest():\n    numpy.random.seed(1)\n    n = 10\n    mu = numpy.abs(numpy.random.randn(n, 1))\n    Sigma = numpy.random.randn(n, n)\n    Sigma = Sigma.T.dot(Sigma)\n\n    w = cvxpy.Variable(n)\n    gamma = cvxpy.Parameter(nonneg=True)\n    ret = mu.T*w\n    risk = cvxpy.quad_form(w, Sigma)\n    return cvxpy.Problem(cvxpy.Maximize(ret - gamma*risk), [cvxpy.sum(w) == 1, w >= 0])\"\n            );\n        }\n\n        [Test]\n        public void StatsmodelsTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nimport statsmodels.api as sm\ndef RunTest():\n    nsample = 100\n    x = numpy.linspace(0, 10, 100)\n    X = numpy.column_stack((x, x**2))\n    beta = numpy.array([1, 0.1, 10])\n    e = numpy.random.normal(size=nsample)\n\n    X = sm.add_constant(X)\n    y = numpy.dot(X, beta) + e\n\n    model = sm.OLS(y, X)\n    results = model.fit()\n    return results.summary()\"\n            );\n        }\n\n        [Test]\n        public void PykalmanTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nfrom pykalman import KalmanFilter\ndef RunTest():\n    kf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]])\n    measurements = numpy.asarray([[1,0], [0,0], [0,1]])  # 3 observations\n    kf = kf.em(measurements, n_iter=5)\n    return kf.filter(measurements)\"\n            );\n        }\n\n        [Test, Explicit(\"Legacy\")]\n        public void AesaraTest()\n        {\n            AssertCode(\n                @\"\nimport aesara\ndef RunTest():\n    a = aesara.tensor.vector()          # declare variable\n    out = a + a ** 10               # build symbolic expression\n    f = aesara.function([a], out)   # compile function\n    return f([0, 1, 2])\"\n            );\n        }\n\n        [Test]\n        public void XgboostTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nimport xgboost\ndef RunTest():\n    data = numpy.random.rand(5,10)            # 5 entities, each contains 10 features\n    label = numpy.random.randint(2, size=5)   # binary target\n    return xgboost.DMatrix( data, label=label)\"\n            );\n        }\n\n        [Test]\n        public void ArchTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nfrom arch import arch_model\ndef RunTest():\n    r = numpy.array([0.945532630498276,\n        0.614772790142383,\n        0.834417758890680,\n        0.862344782601800,\n        0.555858715401929,\n        0.641058419842652,\n        0.720118656981704,\n        0.643948007732270,\n        0.138790608092353,\n        0.279264178231250,\n        0.993836948076485,\n        0.531967023876420,\n        0.964455754192395,\n        0.873171802181126,\n        0.937828816793698])\n\n    garch11 = arch_model(r, p=1, q=1)\n    res = garch11.fit(update_freq=10)\n    return res.summary()\"\n            );\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void KerasTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation\ndef RunTest():\n    # Initialize the constructor\n    model = Sequential()\n\n    # Add an input layer\n    model.add(Dense(12, activation='relu', input_shape=(11,)))\n\n    # Add one hidden layer\n    model.add(Dense(8, activation='relu'))\n\n    # Add an output layer\n    model.add(Dense(1, activation='sigmoid'))\n    return model\"\n            );\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void TensorflowTest()\n        {\n            AssertCode(\n                @\"\nimport tensorflow as tf\ndef RunTest():\n    mnist = tf.keras.datasets.mnist\n\n    (x_train, y_train), (x_test, y_test) = mnist.load_data()\n    x_train, x_test = x_train / 255.0, x_test / 255.0\n\n    model = tf.keras.models.Sequential([\n        tf.keras.layers.Flatten(input_shape=(28, 28)),\n        tf.keras.layers.Dense(128, activation='relu'),\n        tf.keras.layers.Dropout(0.2),\n        tf.keras.layers.Dense(10)\n    ])\n    model(x_train[:1]).numpy()\"\n            );\n        }\n\n        [Test]\n        public void DeapTest()\n        {\n            AssertCode(\n                @\"\nimport numpy\nfrom deap import algorithms, base, creator, tools\ndef RunTest():\n    # onemax example evolves to print list of ones: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n    numpy.random.seed(1)\n    def evalOneMax(individual):\n        return sum(individual),\n\n    creator.create('FitnessMax', base.Fitness, weights=(1.0,))\n    creator.create('Individual', list, typecode = 'b', fitness = creator.FitnessMax)\n\n    toolbox = base.Toolbox()\n    toolbox.register('attr_bool', numpy.random.randint, 0, 1)\n    toolbox.register('individual', tools.initRepeat, creator.Individual, toolbox.attr_bool, 10)\n    toolbox.register('population', tools.initRepeat, list, toolbox.individual)\n    toolbox.register('evaluate', evalOneMax)\n    toolbox.register('mate', tools.cxTwoPoint)\n    toolbox.register('mutate', tools.mutFlipBit, indpb = 0.05)\n    toolbox.register('select', tools.selTournament, tournsize = 3)\n\n    pop = toolbox.population(n = 50)\n    hof = tools.HallOfFame(1)\n    stats = tools.Statistics(lambda ind: ind.fitness.values)\n    stats.register('avg', numpy.mean)\n    stats.register('std', numpy.std)\n    stats.register('min', numpy.min)\n    stats.register('max', numpy.max)\n\n    pop, log = algorithms.eaSimple(pop, toolbox, cxpb = 0.5, mutpb = 0.2, ngen = 30,\n                                   stats = stats, halloffame = hof, verbose = False) # change to verbose=True to see evolution table\n    return hof[0]\"\n            );\n        }\n\n        [Test]\n        public void QuantlibTest()\n        {\n            AssertCode(\n                @\"\nimport QuantLib as ql\ndef RunTest():\n    todaysDate = ql.Date(15, 1, 2015)\n    ql.Settings.instance().evaluationDate = todaysDate\n    spotDates = [ql.Date(15, 1, 2015), ql.Date(15, 7, 2015), ql.Date(15, 1, 2016)]\n    spotRates = [0.0, 0.005, 0.007]\n    dayCount = ql.Thirty360(ql.Thirty360.BondBasis)\n    calendar = ql.UnitedStates(ql.UnitedStates.NYSE)\n    interpolation = ql.Linear()\n    compounding = ql.Compounded\n    compoundingFrequency = ql.Annual\n    spotCurve = ql.ZeroCurve(spotDates, spotRates, dayCount, calendar, interpolation,\n                                compounding, compoundingFrequency)\n    return ql.YieldTermStructureHandle(spotCurve)\"\n            );\n        }\n\n        [Test]\n        public void CopulaTest()\n        {\n            AssertCode(\n                @\"\nfrom copulas.univariate.gaussian import GaussianUnivariate\nimport pandas as pd\ndef RunTest():\n    data=pd.DataFrame({'feature_01': [5.1, 4.9, 4.7, 4.6, 5.0]})\n    feature1 = data['feature_01']\n    gu = GaussianUnivariate()\n    gu.fit(feature1)\n    return gu\"\n            );\n        }\n\n        [Test]\n        public void HmmlearnTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom hmmlearn import hmm\ndef RunTest():\n    # Build an HMM instance and set parameters\n    model = hmm.GaussianHMM(n_components=4, covariance_type='full')\n    \n    # Instead of fitting it from the data, we directly set the estimated\n    # parameters, the means and covariance of the components\n    model.startprob_ = np.array([0.6, 0.3, 0.1, 0.0])\n    # The transition matrix, note that there are no transitions possible\n    # between component 1 and 3\n    model.transmat_ = np.array([[0.7, 0.2, 0.0, 0.1],\n                               [0.3, 0.5, 0.2, 0.0],\n                               [0.0, 0.3, 0.5, 0.2],\n                               [0.2, 0.0, 0.2, 0.6]])\n    # The means of each component\n    model.means_ = np.array([[0.0,  0.0],\n                             [0.0, 11.0],\n                             [9.0, 10.0],\n                             [11.0, -1.0]])\n    # The covariance of each component\n    model.covars_ = .5 * np.tile(np.identity(2), (4, 1, 1))\n\n    # Generate samples\n    return model.sample(500)\"\n            );\n        }\n\n        [Test]\n        public void LightgbmTest()\n        {\n            AssertCode(\n                @\"\nimport lightgbm as lgb\nimport numpy as np\nimport pandas as pd\nfrom scipy.special import expit\ndef RunTest():\n    # Simulate some binary data with a single categorical and\n    # single continuous predictor\n    np.random.seed(0)\n    N = 1000\n    X = pd.DataFrame({\n        'continuous': range(N),\n        'categorical': np.repeat([0, 1, 2, 3, 4], N / 5)\n    })\n    CATEGORICAL_EFFECTS = [-1, -1, -2, -2, 2]\n    LINEAR_TERM = np.array([\n        -0.5 + 0.01 * X['continuous'][k]\n        + CATEGORICAL_EFFECTS[X['categorical'][k]] for k in range(X.shape[0])\n    ]) + np.random.normal(0, 1, X.shape[0])\n    TRUE_PROB = expit(LINEAR_TERM)\n    Y = np.random.binomial(1, TRUE_PROB, size=N)\n    \n    return {\n        'X': X,\n        'probability_labels': TRUE_PROB,\n        'binary_labels': Y,\n        'lgb_with_binary_labels': lgb.Dataset(X, Y),\n        'lgb_with_probability_labels': lgb.Dataset(X, TRUE_PROB),\n        }\"\n            );\n        }\n\n        [Test]\n        public void FbProphetTest()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nfrom prophet import Prophet\ndef RunTest():\n    df=pd.DataFrame({'ds': ['2007-12-10', '2007-12-11', '2007-12-12', '2007-12-13', '2007-12-14'], 'y': [9.590761, 8.519590, 8.183677, 8.072467, 7.893572]})\n    m = Prophet()\n    m.fit(df)\n    future = m.make_future_dataframe(periods=365)\n    return m.predict(future)\"\n            );\n        }\n\n        [Test]\n        public void FastAiTest()\n        {\n            AssertCode(\n                @\"\nfrom fastai.text import *\ndef RunTest():\n    return 'Test is only importing the module, since available tests take too long'\"\n            );\n        }\n\n        [Test]\n        public void PyramidArimaTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport pmdarima as pm\nfrom pmdarima.datasets import load_wineind\ndef RunTest():\n    # this is a dataset from R\n    wineind = load_wineind().astype(np.float64)\n    # fit stepwise auto-ARIMA\n    stepwise_fit = pm.auto_arima(wineind, start_p=1, start_q=1,\n                                 max_p=3, max_q=3, m=12,\n                                 start_P=0, seasonal=True,\n                                 d=1, D=1, trace=True,\n                                 error_action='ignore',    # don't want to know if an order does not work\n                                 suppress_warnings=True,   # don't want convergence warnings\n                                 stepwise=True)            # set to stepwise\n\n    return stepwise_fit.summary()\"\n            );\n        }\n\n        [Test]\n        public void Ijson()\n        {\n            AssertCode(\n                @\"\nimport io\nimport ijson\n\ndef RunTest():\n    parse_events = ijson.parse(io.BytesIO(b'[\"\"skip\"\", {\"\"a\"\": 1}, {\"\"b\"\": 2}, {\"\"c\"\": 3}]'))\n    while True:\n        prefix, event, value = next(parse_events)\n        if value == \"\"skip\"\":\n            break\n    for obj in ijson.items(parse_events, 'item'):\n        print(obj)\");\n        }\n\n        [Test]\n        public void MljarSupervised()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom supervised.automl import AutoML\n\ndef RunTest():\n    df = pd.read_csv(\n        \"\"https://raw.githubusercontent.com/pplonski/datasets-for-start/master/adult/data.csv\"\",\n        skipinitialspace=True,\n    )\n    X_train, X_test, y_train, y_test = train_test_split(\n        df[df.columns[:-1]], df[\"\"income\"\"], test_size=0.25\n    )\n\n    automl = AutoML(total_time_limit=3)\n    automl.fit(X_train, y_train)\n\n    predictions = automl.predict(X_test)\");\n        }\n\n        [Test]\n        public void DmTree()\n        {\n            AssertCode(\n                @\"\nimport tree\n\ndef RunTest():\n    structure = [[1], [[[2, 3]]], [4]]\n    tree.flatten(structure)\");\n        }\n\n        [Test]\n        public void Ortools()\n        {\n            AssertCode(\n                @\"\nfrom ortools.linear_solver import pywraplp\n\ndef RunTest():\n\t# Create the linear solver with the GLOP backend.\n\tsolver = pywraplp.Solver.CreateSolver('GLOP')\n\n\t# Create the variables x and y.\n\tx = solver.NumVar(0, 1, 'x')\n\ty = solver.NumVar(0, 2, 'y')\n\n\tprint('Number of variables =', solver.NumVariables())\");\n        }\n\n        [Test, Explicit(\"Requires old version of TF, addons are winding down\")]\n        public void TensorflowAddons()\n        {\n            AssertCode(\n                @\"\nimport tensorflow as tf\nimport tensorflow_addons as tfa\n\ndef RunTest():\n    train,test = tf.keras.datasets.mnist.load_data()\n    x_train, y_train = train\n    x_train = x_train[..., tf.newaxis] / 255.0\");\n        }\n\n        [Test]\n        public void Yellowbrick()\n        {\n            AssertCode(\n                @\"\nfrom yellowbrick.features import ParallelCoordinates\nfrom sklearn.datasets import make_classification\n\ndef RunTest():\n    X, y = make_classification(n_samples=5000, n_features=2, n_informative=2,\n                               n_redundant=0, n_repeated=0, n_classes=3,\n                               n_clusters_per_class=1,\n                               weights=[0.01, 0.05, 0.94],\n                               class_sep=0.8, random_state=0)\n    visualizer = ParallelCoordinates()\n    visualizer.fit_transform(X, y)\n    visualizer.show()\");\n        }\n\n        [Test]\n        public void Livelossplot()\n        {\n            AssertCode(\n                @\"\nfrom sklearn import datasets\nfrom sklearn.model_selection import train_test_split\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\n\ndef RunTest():\n\t# try with make_moons\n\tX, y = datasets.make_circles(noise=0.2, factor=0.5, random_state=1)\n\tX_train, X_test, y_train, y_test = \\\n\t\ttrain_test_split(X, y, test_size=.4, random_state=42)\n\n\t# plot them\n\tcm_bright = ListedColormap(['#FF0000', '#0000FF'])\n\tplt.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright)\n\tplt.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, alpha=0.3)\");\n        }\n\n        [Test]\n        public void Gymnasium()\n        {\n            AssertCode(\n                @\"\nimport gymnasium as gym\n\ndef RunTest():\n    env = gym.make(\"\"CartPole-v1\"\")\n\n    observation, info = env.reset(seed=42)\n    action = env.action_space.sample()\n    observation, reward, terminated, truncated, info = env.step(action)\n\n    env.close()\");\n        }\n\n        [Test]\n        public void Interpret()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom interpret.glassbox import ExplainableBoostingClassifier\nfrom io import StringIO\n\ndef RunTest():\n    csv = StringIO(\"\"39, State-gov, 77516, Bachelors, 13, Never-married, Adm-clerical, Not-in-family, White, Male, 2174, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"50, Self-emp-not-inc, 83311, Bachelors, 13, Married-civ-spouse, Exec-managerial, Husband, White, Male, 0, 0, 13, United-States, <=50K\\n\"\"\n        + \"\"38, Private, 215646, HS-grad, 9, Divorced, Handlers-cleaners, Not-in-family, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"53, Private, 234721, 11th, 7, Married-civ-spouse, Handlers-cleaners, Husband, Black, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"28, Private, 338409, Bachelors, 13, Married-civ-spouse, Prof-specialty, Wife, Black, Female, 0, 0, 40, Cuba, <=50K\\n\"\"\n        + \"\"37, Private, 284582, Masters, 14, Married-civ-spouse, Exec-managerial, Wife, White, Female, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"49, Private, 160187, 9th, 5, Married-spouse-absent, Other-service, Not-in-family, Black, Female, 0, 0, 16, Jamaica, <=50K\\n\"\"\n        + \"\"52, Self-emp-not-inc, 209642, HS-grad, 9, Married-civ-spouse, Exec-managerial, Husband, White, Male, 0, 0, 45, United-States, >50K\\n\"\"\n        + \"\"31, Private, 45781, Masters, 14, Never-married, Prof-specialty, Not-in-family, White, Female, 14084, 0, 50, United-States, >50K\\n\"\"\n        + \"\"42, Private, 159449, Bachelors, 13, Married-civ-spouse, Exec-managerial, Husband, White, Male, 5178, 0, 40, United-States, >50K\\n\"\"\n        + \"\"37, Private, 280464, Some-college, 10, Married-civ-spouse, Exec-managerial, Husband, Black, Male, 0, 0, 80, United-States, >50K\\n\"\"\n        + \"\"30, State-gov, 141297, Bachelors, 13, Married-civ-spouse, Prof-specialty, Husband, Asian-Pac-Islander, Male, 0, 0, 40, India, >50K\\n\"\"\n        + \"\"23, Private, 122272, Bachelors, 13, Never-married, Adm-clerical, Own-child, White, Female, 0, 0, 30, United-States, <=50K\\n\"\"\n        + \"\"32, Private, 205019, Assoc-acdm, 12, Never-married, Sales, Not-in-family, Black, Male, 0, 0, 50, United-States, <=50K\\n\"\"\n        + \"\"40, Private, 121772, Assoc-voc, 11, Married-civ-spouse, Craft-repair, Husband, Asian-Pac-Islander, Male, 0, 0, 40, ?, >50K\\n\"\"\n        + \"\"34, Private, 245487, 7th-8th, 4, Married-civ-spouse, Transport-moving, Husband, Amer-Indian-Eskimo, Male, 0, 0, 45, Mexico, <=50K\\n\"\"\n        + \"\"25, Self-emp-not-inc, 176756, HS-grad, 9, Never-married, Farming-fishing, Own-child, White, Male, 0, 0, 35, United-States, <=50K\\n\"\"\n        + \"\"32, Private, 186824, HS-grad, 9, Never-married, Machine-op-inspct, Unmarried, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"38, Private, 28887, 11th, 7, Married-civ-spouse, Sales, Husband, White, Male, 0, 0, 50, United-States, <=50K\\n\"\"\n        + \"\"43, Self-emp-not-inc, 292175, Masters, 14, Divorced, Exec-managerial, Unmarried, White, Female, 0, 0, 45, United-States, >50K\\n\"\"\n        + \"\"40, Private, 193524, Doctorate, 16, Married-civ-spouse, Prof-specialty, Husband, White, Male, 0, 0, 60, United-States, >50K\\n\"\"\n        + \"\"54, Private, 302146, HS-grad, 9, Separated, Other-service, Unmarried, Black, Female, 0, 0, 20, United-States, <=50K\\n\"\"\n        + \"\"35, Federal-gov, 76845, 9th, 5, Married-civ-spouse, Farming-fishing, Husband, Black, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"43, Private, 117037, 11th, 7, Married-civ-spouse, Transport-moving, Husband, White, Male, 0, 2042, 40, United-States, <=50K\\n\"\"\n        + \"\"59, Private, 109015, HS-grad, 9, Divorced, Tech-support, Unmarried, White, Female, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"56, Local-gov, 216851, Bachelors, 13, Married-civ-spouse, Tech-support, Husband, White, Male, 0, 0, 40, United-States, >50K\\n\"\"\n        + \"\"19, Private, 168294, HS-grad, 9, Never-married, Craft-repair, Own-child, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"54, ?, 180211, Some-college, 10, Married-civ-spouse, ?, Husband, Asian-Pac-Islander, Male, 0, 0, 60, South, >50K\\n\"\"\n        + \"\"39, Private, 367260, HS-grad, 9, Divorced, Exec-managerial, Not-in-family, White, Male, 0, 0, 80, United-States, <=50K\\n\"\"\n        + \"\"49, Private, 193366, HS-grad, 9, Married-civ-spouse, Craft-repair, Husband, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"23, Local-gov, 190709, Assoc-acdm, 12, Never-married, Protective-serv, Not-in-family, White, Male, 0, 0, 52, United-States, <=50K\\n\"\"\n        + \"\"20, Private, 266015, Some-college, 10, Never-married, Sales, Own-child, Black, Male, 0, 0, 44, United-States, <=50K\\n\"\"\n        + \"\"45, Private, 386940, Bachelors, 13, Divorced, Exec-managerial, Own-child, White, Male, 0, 1408, 40, United-States, <=50K\\n\"\"\n        + \"\"30, Federal-gov, 59951, Some-college, 10, Married-civ-spouse, Adm-clerical, Own-child, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"22, State-gov, 311512, Some-college, 10, Married-civ-spouse, Other-service, Husband, Black, Male, 0, 0, 15, United-States, <=50K\\n\"\"\n        + \"\"48, Private, 242406, 11th, 7, Never-married, Machine-op-inspct, Unmarried, White, Male, 0, 0, 40, Puerto-Rico, <=50K\\n\"\"\n        + \"\"21, Private, 197200, Some-college, 10, Never-married, Machine-op-inspct, Own-child, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"19, Private, 544091, HS-grad, 9, Married-AF-spouse, Adm-clerical, Wife, White, Female, 0, 0, 25, United-States, <=50K\\n\"\"\n        + \"\"31, Private, 84154, Some-college, 10, Married-civ-spouse, Sales, Husband, White, Male, 0, 0, 38, ?, >50K\\n\"\"\n        + \"\"48, Self-emp-not-inc, 265477, Assoc-acdm, 12, Married-civ-spouse, Prof-specialty, Husband, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"31, Private, 507875, 9th, 5, Married-civ-spouse, Machine-op-inspct, Husband, White, Male, 0, 0, 43, United-States, <=50K\\n\"\"\n        + \"\"53, Self-emp-not-inc, 88506, Bachelors, 13, Married-civ-spouse, Prof-specialty, Husband, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"24, Private, 172987, Bachelors, 13, Married-civ-spouse, Tech-support, Husband, White, Male, 0, 0, 50, United-States, <=50K\\n\"\"\n        + \"\"49, Private, 94638, HS-grad, 9, Separated, Adm-clerical, Unmarried, White, Female, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"25, Private, 289980, HS-grad, 9, Never-married, Handlers-cleaners, Not-in-family, White, Male, 0, 0, 35, United-States, <=50K\\n\"\"\n        + \"\"57, Federal-gov, 337895, Bachelors, 13, Married-civ-spouse, Prof-specialty, Husband, Black, Male, 0, 0, 40, United-States, >50K\\n\"\"\n        + \"\"53, Private, 144361, HS-grad, 9, Married-civ-spouse, Machine-op-inspct, Husband, White, Male, 0, 0, 38, United-States, <=50K\\n\"\"\n        + \"\"44, Private, 128354, Masters, 14, Divorced, Exec-managerial, Unmarried, White, Female, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"41, State-gov, 101603, Assoc-voc, 11, Married-civ-spouse, Craft-repair, Husband, White, Male, 0, 0, 40, United-States, <=50K\\n\"\"\n        + \"\"29, Private, 271466, Assoc-voc, 11, Never-married, Prof-specialty, Not-in-family, White, Male, 0, 0, 43, United-States, <=50K\"\")\n\n    df = pd.read_csv(csv, header=None)\n    df.columns = [\n        \"\"Age\"\", \"\"WorkClass\"\", \"\"fnlwgt\"\", \"\"Education\"\", \"\"EducationNum\"\",\n        \"\"MaritalStatus\"\", \"\"Occupation\"\", \"\"Relationship\"\", \"\"Race\"\", \"\"Gender\"\",\n        \"\"CapitalGain\"\", \"\"CapitalLoss\"\", \"\"HoursPerWeek\"\", \"\"NativeCountry\"\", \"\"Income\"\"\n    ]\n    train_cols = df.columns[0:-1]\n    label = df.columns[-1]\n    X = df[train_cols]\n    y = df[label]\n\n    seed = 1\n    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=seed)\n\n    ebm = ExplainableBoostingClassifier(random_state=seed, outer_bags=2, max_rounds=50)\n    ebm.fit(X_train, y_train)\");\n        }\n\n        [Test]\n        public void Doubleml()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom doubleml.datasets import make_plr_CCDDHNR2018\n\ndef RunTest():\n    np.random.seed(1234)\n\n    n_rep = 1000\n    n_obs = 500\n    n_vars = 20\n    alpha = 0.5\n    data = list()\n\n    for i_rep in range(n_rep):\n        (x, y, d) = make_plr_CCDDHNR2018(alpha=alpha, n_obs=n_obs, dim_x=n_vars, return_type='array')\n        data.append((x, y, d))\");\n        }\n\n        [Test]\n        public void ImbalancedLearn()\n        {\n            AssertCode(\n                @\"\nfrom sklearn.datasets import make_classification\nfrom imblearn.over_sampling import RandomOverSampler\nfrom collections import Counter\n\ndef RunTest():\n    X, y = make_classification(n_samples=5000, n_features=2, n_informative=2,\n                                n_redundant=0, n_repeated=0, n_classes=3,\n                                n_clusters_per_class=1,\n                                weights=[0.01, 0.05, 0.94],\n                                class_sep=0.8, random_state=0)\n\n    ros = RandomOverSampler(random_state=0)\n\n    X_resampled, y_resampled = ros.fit_resample(X, y)\n\n    print(sorted(Counter(y_resampled).items()))\");\n        }\n\n        [Test, Explicit(\"Requires keras < 3\")]\n        public void ScikerasTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom sklearn.datasets import make_classification\nfrom tensorflow import keras\nfrom scikeras.wrappers import KerasClassifier\n\ndef RunTest():\n    X, y = make_classification(1000, 20, n_informative=10, random_state=0)\n    X = X.astype(np.float32)\n    y = y.astype(np.int64)\n\n    def get_model(hidden_layer_dim, meta):\n        # note that meta is a special argument that will be\n        # handed a dict containing input metadata\n        n_features_in_ = meta[\"\"n_features_in_\"\"]\n        X_shape_ = meta[\"\"X_shape_\"\"]\n        n_classes_ = meta[\"\"n_classes_\"\"]\n\n        model = keras.models.Sequential()\n        model.add(keras.layers.Dense(n_features_in_, input_shape=X_shape_[1:]))\n        model.add(keras.layers.Activation(\"\"relu\"\"))\n        model.add(keras.layers.Dense(hidden_layer_dim))\n        model.add(keras.layers.Activation(\"\"relu\"\"))\n        model.add(keras.layers.Dense(n_classes_))\n        model.add(keras.layers.Activation(\"\"softmax\"\"))\n        return model\n\n    clf = KerasClassifier(\n        get_model,\n        loss=\"\"sparse_categorical_crossentropy\"\",\n        hidden_layer_dim=100,\n    )\n\n    clf.fit(X, y)\n    y_proba = clf.predict_proba(X)\");\n        }\n\n        [Test]\n        public void Lazypredict()\n        {\n            AssertCode(\n                @\"\nfrom lazypredict.Supervised import LazyClassifier\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\n\ndef RunTest():\n    data = load_breast_cancer()\n    X = data.data\n    y= data.target\n\n    X_train, X_test, y_train, y_test = train_test_split(X, y,test_size=.5,random_state =123)\n\n    clf = LazyClassifier(verbose=0,ignore_warnings=True, custom_metric=None)\n    models,predictions = clf.fit(X_train, X_test, y_train, y_test)\");\n        }\n\n        [Test]\n        public void Darts()\n        {\n            AssertCode(\n                @\"\nfrom darts.datasets import ETTh2Dataset\nfrom darts.ad import KMeansScorer\n\ndef RunTest():\n    series = ETTh2Dataset().load()[:10000][[\"\"MUFL\"\", \"\"LULL\"\"]]\n    train, val = series.split_before(0.6)\n    scorer = KMeansScorer(k=2, window=5)\n    scorer.fit(train)\n    anom_score = scorer.score(val)\");\n        }\n\n        [Test]\n        public void Fastparquet()\n        {\n            AssertCode(\n                @\"\nfrom fastparquet import write\nimport pandas as pd\n\ndef RunTest():\n    d = {'date': [ '20220901', '20220902' ], 'open': [ 1, 2 ], 'close': [ 1, 2 ],'high': [ 1, 2], 'low': [ 1, 2 ], 'volume': [ 1, 2 ] }\n    df = pd.DataFrame(data=d)\n    write('outfile.parq', df)\");\n        }\n\n        [Test]\n        public void Dimod()\n        {\n            AssertCode(\n                @\"\nimport dimod\n\ndef RunTest():\n    bqm = dimod.BinaryQuadraticModel({0: -1, 1: 1}, {(0, 1): 2}, 0.0, dimod.BINARY)\n\n    sampleset = dimod.ExactSolver().sample(bqm)\n    return sampleset\");\n        }\n\n        [Test]\n        public void DwaveSamplers()\n        {\n            AssertCode(\n                @\"\nfrom dwave.samplers import PlanarGraphSolver\n\ndef RunTest():\n    solver = PlanarGraphSolver()\");\n        }\n\n        [Test]\n        public void Statemachine()\n        {\n            AssertCode(\n                @\"\nfrom statemachine import StateMachine, State\n\ndef RunTest():\n    class StateObject(StateMachine):\n        aState = State(\"\"A\"\", initial = True)\n        bState = State(\"\"B\"\")\n\n        transitionA = aState.to(bState)\n        transitionB = bState.to(aState)\n\n    instance = StateObject()\");\n        }\n\n        [Test]\n        public void pymannkendall()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nimport pymannkendall as mk\n\ndef RunTest():\n    # Data generation for analysis\n    data = np.random.rand(360,1)\n\n    result = mk.original_test(data)\n    return result\");\n        }\n\n        [Test]\n        public void Pyomo()\n        {\n            AssertCode(\n                @\"\nfrom pyomo.environ import *\n\ndef RunTest():\n\tV = 40     # liters\n\tkA = 0.5   # 1/min\n\tkB = 0.1   # l/min\n\tCAf = 2.0  # moles/liter\n\n\t# create a model instance\n\tmodel = ConcreteModel()\n\n\t# create x and y variables in the model\n\tmodel.q = Var()\n\n\t# add a model objective\n\tmodel.objective = Objective(expr = model.q*V*kA*CAf/(model.q + V*kB)/(model.q + V*kA), sense=maximize)\n\n\t# compute a solution using ipopt for nonlinear optimization\n\tresults = SolverFactory('ipopt').solve(model)\n\n\t# print solutions\n\tqmax = model.q()\n\tCBmax = model.objective()\n\tprint('\\nFlowrate at maximum CB = ', qmax, 'liters per minute.')\n\tprint('\\nMaximum CB =', CBmax, 'moles per liter.')\n\tprint('\\nProductivity = ', qmax*CBmax, 'moles per minute.')\");\n        }\n\n        [Test]\n        public void Gpflow()\n        {\n            AssertCode(\n                @\"\nimport gpflow\nimport numpy as np\nimport matplotlib\n\ndef RunTest():\n    X = np.array(\n        [\n            [0.865], [0.666], [0.804], [0.771], [0.147], [0.866], [0.007], [0.026],\n            [0.171], [0.889], [0.243], [0.028],\n        ]\n    )\n    Y = np.array(\n        [\n            [1.57], [3.48], [3.12], [3.91], [3.07], [1.35], [3.80], [3.82], [3.49],\n            [1.30], [4.00], [3.82],\n        ]\n    )\n\n    model = gpflow.models.GPR((X, Y), kernel=gpflow.kernels.SquaredExponential())\n    opt = gpflow.optimizers.Scipy()\n    opt.minimize(model.training_loss, model.trainable_variables)\n\n    Xnew = np.array([[0.5]])\n    model.predict_f(Xnew)\");\n        }\n\n        [Test, Explicit(\"Sometimes hangs when run along side the other tests\")]\n        public void StableBaselinesTest()\n        {\n            AssertCode(\n                @\"\nfrom stable_baselines3 import PPO\nfrom stable_baselines3.common.env_util import make_vec_env\n\ndef RunTest():\n    env = make_vec_env(\"\"CartPole-v1\"\", n_envs=1)\n\n    model = PPO(\"\"MlpPolicy\"\", env, verbose=1)\n    model.learn(total_timesteps=500)\");\n        }\n\n        [Test]\n        public void GensimTest()\n        {\n            AssertCode(\n                @\"\nfrom gensim import models\n\ndef RunTest():\n    # https://radimrehurek.com/gensim/tutorial.html\n    corpus = [[(0, 1.0), (1, 1.0), (2, 1.0)],\n              [(2, 1.0), (3, 1.0), (4, 1.0), (5, 1.0), (6, 1.0), (8, 1.0)],\n              [(1, 1.0), (3, 1.0), (4, 1.0), (7, 1.0)],\n              [(0, 1.0), (4, 2.0), (7, 1.0)],\n              [(3, 1.0), (5, 1.0), (6, 1.0)],\n              [(9, 1.0)],\n              [(9, 1.0), (10, 1.0)],\n              [(9, 1.0), (10, 1.0), (11, 1.0)],\n              [(8, 1.0), (10, 1.0), (11, 1.0)]]\n\n    tfidf = models.TfidfModel(corpus)\n    vec = [(0, 1), (4, 1)]\n    return f'{tfidf[vec]}'\"\n            );\n        }\n\n        [Test, Explicit()]\n        public void ScikitOptimizeTest()\n        {\n            AssertCode(\n                @\"\nimport numpy as np\nfrom skopt import gp_minimize\n\ndef f(x):\n    return (np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) * np.random.randn() * 0.1)\n\ndef RunTest():\n    res = gp_minimize(f, [(-2.0, 2.0)], n_calls=10)\n    return f'Test passed: {res}'\"\n            );\n        }\n\n        [Test]\n        public void CremeTest()\n        {\n            AssertCode(\n                @\"\nfrom creme import datasets\n\ndef RunTest():\n    X_y = datasets.Bikes()\n    x, y = next(iter(X_y))\n    return f'Number of bikes: {y}'\"\n            );\n        }\n\n        [Test]\n        public void NltkTest()\n        {\n            AssertCode(\n                @\"\nimport nltk.data\n\ndef RunTest():\n    text = '''\n    Punkt knows that the periods in Mr. Smith and Johann S. Bach\n    do not mark sentence boundaries.  And sometimes sentences\n    can start with non-capitalized words.  i is a good variable\n    name.\n    '''\n    sent_detector = nltk.data.load('tokenizers/punkt/english.pickle')\n    return '\\n-----\\n'.join(sent_detector.tokenize(text.strip()))\"\n            );\n        }\n\n        [Test]\n        public void NltkVaderTest()\n        {\n            AssertCode(\n                @\"\nfrom nltk.sentiment.vader import SentimentIntensityAnalyzer\nfrom nltk import tokenize\n\ndef RunTest():\n    sentences = [\n        'VADER is smart, handsome, and funny.', # positive sentence example...    'VADER is smart, handsome, and funny!', # punctuation emphasis handled correctly (sentiment intensity adjusted)\n        'VADER is very smart, handsome, and funny.',  # booster words handled correctly (sentiment intensity adjusted)\n        'VADER is VERY SMART, handsome, and FUNNY.',  # emphasis for ALLCAPS handled\n        'VADER is VERY SMART, handsome, and FUNNY!!!',# combination of signals - VADER appropriately adjusts intensity\n        'VADER is VERY SMART, really handsome, and INCREDIBLY FUNNY!!!',# booster words & punctuation make this close to ceiling for score\n        'The book was good.',         # positive sentence\n        'The book was kind of good.', # qualified positive sentence is handled correctly (intensity adjusted)\n        'The plot was good, but the characters are uncompelling and the dialog is not great.', # mixed negation sentence\n        'A really bad, horrible book.',       # negative sentence with booster words\n        'At least it is not a horrible book.', # negated negative sentence with contraction\n        ':) and :D',     # emoticons handled\n        '',              # an empty string is correctly handled\n        'Today sux',     #  negative slang handled\n        'Today sux!',    #  negative slang with punctuation emphasis handled\n        'Today SUX!',    #  negative slang with capitalization emphasis\n        'Today kinda sux! But I will get by, lol' # mixed sentiment example with slang and constrastive conjunction 'but'\n    ]\n    paragraph = 'It was one of the worst movies I have seen, despite good reviews. \\\n        Unbelievably bad acting!! Poor direction.VERY poor production. \\\n        The movie was bad.Very bad movie.VERY bad movie.VERY BAD movie.VERY BAD movie!'\n\n    lines_list = tokenize.sent_tokenize(paragraph)\n    sentences.extend(lines_list)\n\n    sid = SentimentIntensityAnalyzer()\n    for sentence in sentences:\n        ss = sid.polarity_scores(sentence)\n\n    return f'{sid}'\"\n            );\n        }\n\n        [Test, Explicit(\"Requires mlfinlab installed\")]\n        public void MlfinlabTest()\n        {\n            AssertCode(\n                @\"\nfrom mlfinlab.portfolio_optimization.hrp import HierarchicalRiskParity\nfrom mlfinlab.portfolio_optimization.mean_variance import MeanVarianceOptimisation\nimport numpy as np\nimport pandas as pd\nimport os\n\ndef RunTest():\n# Read in data\n    data_file = os.getcwd() + '/TestData/stock_prices.csv'\n    stock_prices = pd.read_csv(data_file, parse_dates=True, index_col='Date') # The date column may be named differently for your input.\n\n    # Compute HRP weights\n    hrp = HierarchicalRiskParity()\n    hrp.allocate(asset_prices=stock_prices, resample_by='B')\n    hrp_weights = hrp.weights.sort_values(by=0, ascending=False, axis=1)\n\n    # Compute IVP weights\n    mvo = MeanVarianceOptimisation()\n    mvo.allocate(asset_prices=stock_prices, solution='inverse_variance', resample_by='B')\n    ivp_weights = mvo.weights.sort_values(by=0, ascending=False, axis=1)\n    \n    return f'HRP: {hrp_weights} IVP: {ivp_weights}'\"\n            );\n        }\n\n        [Test]\n        public void JaxTest()\n        {\n            AssertCode(\n                @\"\nfrom jax import *\nimport jax.numpy as jnp\n\ndef predict(params, inputs):\n  for W, b in params:\n    outputs = jnp.dot(inputs, W) + b\n    inputs = jnp.tanh(outputs)\n  return outputs\n\ndef logprob_fun(params, inputs, targets):\n  preds = predict(params, inputs)\n  return jnp.sum((preds - targets)**2)\n\ndef RunTest():\n    grad_fun = jit(grad(logprob_fun))  # compiled gradient evaluation function\n    return jit(vmap(grad_fun, in_axes=(None, 0, 0)))  # fast per-example grads\"\n            );\n        }\n\n        [Test, Explicit(\"Legacy\")]\n        public void NeuralTangentsTest()\n        {\n            AssertCode(\n                @\"\nfrom jax import *\nimport neural_tangents as nt\nfrom neural_tangents import *\n\ndef RunTest():\n    key = random.PRNGKey(1)\n    key1, key2 = random.split(key, 2)\n    x_train = random.normal(key1, (20, 32, 32, 3))\n    y_train = random.uniform(key1, (20, 10))\n    x_test = random.normal(key2, (5, 32, 32, 3))\n\n    init_fn, apply_fn, kernel_fn = stax.serial(\n        stax.Conv(128, (3, 3)),\n        stax.Relu(),\n        stax.Conv(256, (3, 3)),\n        stax.Relu(),\n        stax.Conv(512, (3, 3)),\n        stax.Flatten(),\n        stax.Dense(10)\n    )\n\n    predict_fn = nt.predict.gradient_descent_mse_ensemble(kernel_fn, x_train, y_train)\n    # (5, 10) np.ndarray NNGP test prediction\n    predict_fn(x_test=x_test, get='nngp')\"\n            );\n        }\n\n\n        [Test]\n        public void SmmTest()\n        {\n            AssertCode(\n                @\"\nimport ssm\n\ndef RunTest():\n    T = 100  # number of time bins\n    K = 5    # number of discrete states\n    D = 2    # dimension of the observations\n\n    # make an hmm and sample from it\n    hmm = ssm.HMM(K, D, observations='gaussian')\n    z, y = hmm.sample(T)\n    test_hmm = ssm.HMM(K, D, observations='gaussian')\n    test_hmm.fit(y)\n    return test_hmm.most_likely_states(y)\"\n            );\n        }\n\n        [Test, Explicit(\"Hangs if run along side the rest\")]\n        public void RiskparityportfolioTest()\n        {\n            AssertCode(\n                @\"\nimport riskparityportfolio as rp\nimport numpy as np\n\ndef RunTest():\n    Sigma = np.vstack((np.array((1.0000, 0.0015, -0.0119)),\n                    np.array((0.0015, 1.0000, -0.0308)),\n                    np.array((-0.0119, -0.0308, 1.0000))))\n    b = np.array((0.1594, 0.0126, 0.8280))\n    w = rp.vanilla.design(Sigma, b)\n    rc = w @ (Sigma * w)\n    return rc/np.sum(rc)\"\n            );\n        }\n\n        [Test]\n        public void PyrbTest()\n        {\n            AssertCode(\n                @\"\nimport pandas as pd\nimport numpy as np\nfrom pyrb import ConstrainedRiskBudgeting\n\ndef RunTest():\n    vol = [0.05,0.05,0.07,0.1,0.15,0.15,0.15,0.18]\n    cor = np.array([[100,  80,  60, -20, -10, -20, -20, -20],\n               [ 80, 100,  40, -20, -20, -10, -20, -20],\n               [ 60,  40, 100,  50,  30,  20,  20,  30],\n               [-20, -20,  50, 100,  60,  60,  50,  60],\n               [-10, -20,  30,  60, 100,  90,  70,  70],\n               [-20, -10,  20,  60,  90, 100,  60,  70],\n               [-20, -20,  20,  50,  70,  60, 100,  70],\n               [-20, -20,  30,  60,  70,  70,  70, 100]])/100\n    cov = np.outer(vol,vol)*cor\n    C = None\n    d = None\n\n    CRB = ConstrainedRiskBudgeting(cov,C=C,d=d)\n    CRB.solve()\n    return CRB\"\n            );\n        }\n\n        [Test]\n        public void CopulaeTest()\n        {\n            AssertCode(\n                @\"\nfrom copulae import NormalCopula\nimport numpy as np\n\ndef RunTest():\n    np.random.seed(8)\n    data = np.random.normal(size=(300, 8))\n    cop = NormalCopula(8)\n    cop.fit(data)\n\n    cop.random(10)  # simulate random number\n\n    # getting parameters\n    p = cop.params\n    # cop.params = ...  # you can override parameters too, even after it's fitted!  \n\n    # get a summary of the copula. If it's fitted, fit details will be present too\n    return cop.summary()\"\n            );\n        }\n        [Test]\n        public void SanityClrInstallation()\n        {\n            AssertCode(\n                @\"\nfrom os import walk\nimport setuptools as _\n\ndef RunTest():\n    try:\n        import clr\n        clr.AddReference()\n        print('No clr errors')\n        #Checks complete\n    except: #isolate error cause\n        try:\n            import clr\n            print('clr exists') #Module exists\n            try:\n                f = []\n                for (dirpath, dirnames, filenames) in walk(print(clr.__path__)):\n                    f.extend(filenames)\n                    break\n                return(f.values['style_builder.py']) #If this is reached, likely due to an issue with this file itself\n            except:\n                print('no style_builder') #pythonnet install error, most likely\n\n        except:\n            print('clr does not exist') #Only remaining cause\"\n            );\n        }\n\n        [Test, Explicit(\"Sometimes hangs when run along side the other tests\")]\n        public void AxPlatformTest()\n        {\n            AssertCode(@\"\nfrom ax import Client, RangeParameterConfig\n\ndef RunTest():\n    # 1. Initialize the Client.\n    client = Client()\n\n    # 2. Configure where Ax will search.\n    client.configure_experiment(\n        name=\"\"booth_function\"\",\n        parameters=[\n            RangeParameterConfig(\n                name=\"\"x1\"\",\n                bounds=(-10.0, 10.0),\n                parameter_type=\"\"float\"\",\n            ),\n            RangeParameterConfig(\n                name=\"\"x2\"\",\n                bounds=(-10.0, 10.0),\n                parameter_type=\"\"float\"\",\n            ),\n        ],\n    )\n\n    # 3. Configure a metric Ax will target (see other Tutorials for adding constraints,\n    # multiple objectives, tracking metrics etc.)\n    client.configure_optimization(objective=\"\"-1 * booth\"\")\n\n    # 4 Conduct the experiment with 20 trials: get each trial from Ax, evaluate the\n    # objective function, log data back to Ax.\n    for _ in range(10):\n        # Use higher value of `max_trials` to run trials in parallel.\n        for trial_index, parameters in client.get_next_trials(max_trials=1).items():\n            client.complete_trial(\n                trial_index=trial_index,\n                raw_data={\n                    \"\"booth\"\": (parameters[\"\"x1\"\"] + 2 * parameters[\"\"x2\"\"] - 7) ** 2\n                    + (2 * parameters[\"\"x1\"\"] + parameters[\"\"x2\"\"] - 5) ** 2\n                },\n            )\n\n    # 5. Obtain the best-performing configuration; the true minimum for the booth\n    # function is at (1, 3)\n    client.get_best_parameterization()\n\");\n        }\n\n        [Test]\n        public void RiskfolioLibTest()\n        {\n            AssertCode(@\"\nimport riskfolio as rp\nimport pandas as pd\n\ndef RunTest():\n\t# Data\n\tdate_index = pd.DatetimeIndex(data=['2020-06-15', '2020-06-15', '2020-06-15'])\n\td = {'AAPL': [10, 22, 11], 'AMC': [21,  13, 45]}\n\tdf = pd.DataFrame(data=d).set_index(date_index)\n\tdf = df.pct_change().dropna()\n\n\t# Building the portfolio object\n\tport = rp.Portfolio(returns=df)\n\n\tmethod_mu='hist' # Method to estimate expected returns based on historical data.\n\tmethod_cov='hist' # Method to estimate covariance matrix based on historical data.\n\n\tport.assets_stats(method_mu=method_mu, method_cov=method_cov)\n\n\t# Estimate optimal portfolio:\n\n\tmodel='Classic' # Could be Classic (historical), BL (Black Litterman) or FM (Factor Model)\n\trm = 'MV' # Risk measure used, this time will be variance\n\tobj = 'Sharpe' # Objective function, could be MinRisk, MaxRet, Utility or Sharpe\n\thist = True # Use historical scenarios for risk measures that depend on scenarios\n\trf = 0 # Risk free rate\n\tl = 0 # Risk aversion factor, only useful when obj is 'Utility'\n\n\tw = port.optimization(model=model, rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n\n\tw.T\");\n        }\n\n        [Test, Explicit(\"Needs to be run by itself\")]\n        public void Neuralforecast()\n        {\n            AssertCode(@\"from neuralforecast import NeuralForecast\nfrom neuralforecast.models import NBEATS\nfrom neuralforecast.utils import AirPassengersDF\n\ndef RunTest():\n    nf = NeuralForecast(\n        models = [NBEATS(input_size=12, h=12, max_steps=20)],\n        freq = 'ME'\n    )\n\n    nf.fit(df=AirPassengersDF)\n    nf.predict()\");\n        }\n\n        [Test]\n        public void KDEpy()\n        {\n            AssertCode(@\"\nfrom KDEpy import FFTKDE\nfrom scipy.stats import norm\nimport numpy as np\n\ndef RunTest():\n    # Generate a distribution and draw 2**6 data points\n    dist = norm(loc=0, scale=1)\n    data = dist.rvs(2**6)\n\n    # Compute kernel density estimate on a grid using Silverman's rule for bw\n    x, y1 = FFTKDE(bw=\"\"silverman\"\").fit(data).evaluate(2**10)\n\n    # Compute a weighted estimate on the same grid, using verbose API\n    weights = np.arange(len(data)) + 1\n    estimator = FFTKDE(kernel='biweight', bw='silverman')\n    y2 = estimator.fit(data, weights=weights).evaluate(x)\n    \");\n        }\n\n        [Test]\n        public void Skfolio()\n        {\n            AssertCode(@\"import numpy as np\nfrom sklearn.model_selection import train_test_split\n\nfrom skfolio import Population, RiskMeasure\nfrom skfolio.datasets import load_sp500_dataset\nfrom skfolio.optimization import InverseVolatility, MeanRisk, ObjectiveFunction\nfrom skfolio.preprocessing import prices_to_returns\n\ndef RunTest():\n    prices = load_sp500_dataset()\n\n    X = prices_to_returns(prices)\n    X_train, X_test = train_test_split(X, test_size=0.33, shuffle=False)\n\n    print(X_train.head())\");\n        }\n\n        [Test]\n        public void Sweetviz()\n        {\n            AssertCode(@\"\ndef RunTest():\n    import sweetviz as sv\n    import pandas as pd\n    \n    df = pd.DataFrame({\n        'col1': [1, 2, 3],\n        'col2': [4, 5, 6],\n        'target': [0, 1, 0]\n    })\n    \n    report = sv.analyze(df, target_feat='target')\");\n        }\n\n        [TestCase(\"tf2onnx\", \"1.16.1\", \"__version__\"), Explicit(\"These need to be run by themselves\")]\n        [TestCase(\"skl2onnx\", \"1.19.1\", \"__version__\")]\n        [TestCase(\"onnxmltools\", \"1.14.0\", \"__version__\")]\n        public void ModuleVersionTestExplicit(string module, string value, string attribute)\n        {\n            RunModuleVersionTest(module, value, attribute);\n        }\n\n        /// <summary>\n        /// Simple test for modules that don't have short test example\n        /// </summary>\n        /// <param name=\"module\">The module we are testing</param>\n        /// <param name=\"version\">The module version</param>\n        [TestCase(\"pulp\", \"3.3.0\", \"VERSION\")]\n        [TestCase(\"pymc\", \"5.25.1\", \"__version__\")]\n        [TestCase(\"pypfopt\", \"pypfopt\", \"__name__\")]\n        [TestCase(\"wrapt\", \"1.17.3\", \"__version__\")]\n        [TestCase(\"tslearn\", \"0.7.0\", \"__version__\")]\n        [TestCase(\"tweepy\", \"4.16.0\", \"__version__\")]\n        [TestCase(\"pywt\", \"1.8.0\", \"__version__\")]\n        [TestCase(\"umap\", \"0.5.9.post2\", \"__version__\")]\n        [TestCase(\"dtw\", \"1.5.3\", \"__version__\")]\n        [TestCase(\"mplfinance\", \"0.12.10b0\", \"__version__\")]\n        [TestCase(\"cufflinks\", \"0.17.3\", \"__version__\")]\n        [TestCase(\"ipywidgets\", \"8.1.8\", \"__version__\")]\n        [TestCase(\"astropy\", \"7.2.0\", \"__version__\")]\n        [TestCase(\"gluonts\", \"0.16.2\", \"__version__\")]\n        [TestCase(\"featuretools\", \"1.31.0\", \"__version__\")]\n        [TestCase(\"pennylane\", \"0.43.1\", \"version()\")]\n        [TestCase(\"pyfolio\", \"0.9.9\", \"__version__\")]\n        [TestCase(\"altair\", \"6.0.0\", \"__version__\")]\n        [TestCase(\"modin\", \"0.37.1\", \"__version__\")]\n        [TestCase(\"persim\", \"0.3.8\", \"__version__\")]\n        [TestCase(\"pydmd\", \"pydmd\", \"__name__\")]\n        [TestCase(\"pandas_ta\", \"0.3.14b0\", \"__version__\")]\n        [TestCase(\"tensortrade\", \"1.0.3\", \"__version__\")]\n        [TestCase(\"quantstats\", \"0.0.77\", \"__version__\")]\n        [TestCase(\"panel\", \"1.7.5\", \"__version__\")]\n        [TestCase(\"pyheat\", \"pyheat\", \"__name__\")]\n        [TestCase(\"tensorflow_decision_forests\", \"1.12.0\", \"__version__\")]\n        [TestCase(\"pomegranate\", \"1.1.2\", \"__version__\")]\n        [TestCase(\"cv2\", \"4.11.0\", \"__version__\")]\n        [TestCase(\"ot\", \"0.9.6.post1\", \"__version__\")]\n        [TestCase(\"datasets\", \"3.6.0\", \"__version__\")]\n        [TestCase(\"ipympl\", \"0.9.8\", \"__version__\")]\n        [TestCase(\"PyQt6\", \"PyQt6\", \"__name__\")]\n        [TestCase(\"pytorch_forecasting\", \"1.5.0\", \"__version__\")]\n        [TestCase(\"sismic\", \"1.6.11\", \"__version__\")]\n        [TestCase(\"chronos\", \"chronos\", \"__name__\")]\n        public void ModuleVersionTest(string module, string value, string attribute)\n        {\n            RunModuleVersionTest(module, value, attribute);\n        }\n\n        private void RunModuleVersionTest(string module, string value, string attribute)\n        {\n            AssertCode(\n                $@\"\nimport {module}\n\ndef RunTest():\n    assert({module}.{attribute} == '{value}')\"\n            );\n        }\n\n        private static void AssertCode(string code)\n        {\n            using var _ = Py.GIL();\n            using var module = PyModule.FromString(Guid.NewGuid().ToString(), code);\n            Assert.DoesNotThrow(() =>\n            {\n                using var response = module.InvokeMethod(\"RunTest\");\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonRegressionAlgorithmsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing QuantConnect.Statistics;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonRegressionAlgorithmsTests\n    {\n        [Test]\n        public void SelectUniverseSymbolsFromIDRegressionAlgorithm()\n        {\n            var parameters = new RegressionTests.AlgorithmStatisticsTestParameters(\"SelectUniverseSymbolsFromIDRegressionAlgorithm\",\n                new Dictionary<string, string> { {PerformanceMetrics.TotalOrders, \"0\"} },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameters.Algorithm,\n                parameters.Statistics,\n                parameters.Language,\n                parameters.ExpectedFinalStatus);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonSliceGetByTypeTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Statistics;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Common\n{\n    [TestFixture]\n    public class PythonSliceGetByTypeTests\n    {\n        [Test]\n        public void RunPythonSliceGetByTypeRegressionAlgorithm()\n        {\n            var parameter = new RegressionTests.AlgorithmStatisticsTestParameters(\"SliceGetByTypeRegressionAlgorithm\",\n                new Dictionary<string, string> {\n                    {PerformanceMetrics.TotalOrders, \"1\"},\n                    {\"Average Win\", \"0%\"},\n                    {\"Average Loss\", \"0%\"},\n                    {\"Compounding Annual Return\", \"284.284%\"},\n                    {\"Drawdown\", \"2.200%\"},\n                    {\"Expectancy\", \"0\"},\n                    {\"Net Profit\", \"1.736%\"},\n                    {\"Sharpe Ratio\", \"8.86\"},\n                    {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n                    {\"Loss Rate\", \"0%\"},\n                    {\"Win Rate\", \"0%\"},\n                    {\"Profit-Loss Ratio\", \"0\"},\n                    {\"Alpha\", \"-0.004\"},\n                    {\"Beta\", \"0.997\"},\n                    {\"Annual Standard Deviation\", \"0.222\"},\n                    {\"Annual Variance\", \"0.049\"},\n                    {\"Information Ratio\", \"-14.547\"},\n                    {\"Tracking Error\", \"0.001\"},\n                    {\"Treynor Ratio\", \"1.972\"},\n                    {\"Total Fees\", \"$3.45\"},\n                    {\"OrderListHash\", \"275925e122dc6f40501d1e3f35339e26\"}\n                },\n                Language.Python,\n                AlgorithmStatus.Completed);\n\n            AlgorithmRunner.RunLocalBacktest(parameter.Algorithm,\n                parameter.Statistics,\n                parameter.Language,\n                parameter.ExpectedFinalStatus);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonTestingUtils.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.Python\n{\n    public static class PythonTestingUtils\n    {\n        public static dynamic GetSlices(Symbol symbol)\n        {\n            var slices = Enumerable\n                .Range(0, 100)\n                .Select(\n                    i =>\n                    {\n                        var time = new DateTime(2013, 10, 7).AddMilliseconds(14400000 + i * 10000);\n                        return new Slice(\n                            time,\n                            new List<BaseData> {\n                                new Tick\n                                {\n                                    Time = time,\n                                    Symbol = symbol,\n                                    Value = 167 + i / 10,\n                                    Quantity = 1 + i * 10,\n                                    Exchange = \"T\"\n                                }\n                            }, time\n                        );\n                    }\n                );\n            return slices;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonThreadingTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Python;\nusing System.Threading.Tasks;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonThreadingTests\n    {\n        [Test]\n        public void ImportsCanBeExecutedFromDifferentThreads()\n        {\n            PythonInitializer.Initialize();\n\n            Task.Factory.StartNew(() =>\n            {\n                using (Py.GIL())\n                {\n                    var module = Py.Import(\"Test_MethodOverload\");\n                    module.GetAttr(\"Test_MethodOverload\").Invoke();\n                }\n            }).Wait();\n\n            PythonInitializer.Initialize();\n            Task.Factory.StartNew(() =>\n            {\n                using (Py.GIL())\n                {\n                    var module = Py.Import(\"Test_AlgorithmPythonWrapper\");\n                    module.GetAttr(\"Test_AlgorithmPythonWrapper\").Invoke();\n                }\n            }).Wait();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonVirtualEnvironmentTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing System;\nusing System.IO;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Python;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class PythonVirtualEnvironmentTests\n    {\n        [TestCase(null)]\n        [TestCase(\"/something\")]\n        [TestCase(\"non existing env\")]\n        public void InvalidVirtualEnvironment(string venv)\n        {\n            Assert.IsFalse(PythonInitializer.ActivatePythonVirtualEnvironment(venv));\n        }\n\n        [Test]\n        public void VirtualEnvironment()\n        {\n            if (Directory.Exists(\"testenv\"))\n            {\n                Directory.Delete(\"testenv\", true);\n            }\n\n            using (Py.GIL())\n            {\n                PythonEngine.Exec(\"import venv;venv.create(\\\"testenv\\\", system_site_packages=True)\");\n            }\n\n            Assert.IsTrue(PythonInitializer.ActivatePythonVirtualEnvironment(\"testenv\"));\n        }\n\n        [Test, Explicit(\"Requires a virtual env setup\")]\n        public void AssertVirtualEnvironment()\n        {\n            Assert.IsTrue(PythonInitializer.ActivatePythonVirtualEnvironment(\"/lean-testenv\"));\n\n            using (Py.GIL())\n            {\n                var code = @\"import lean\n\ndef assertLeanVersion():\n    return lean.__version__\";\n                var module = PyModule.FromString(Guid.NewGuid().ToString(), code);\n                dynamic assertVersion = module.GetAttr(\"assertLeanVersion\");\n\n                Assert.AreEqual(\"1.0.221\", (string)assertVersion());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/PythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Python;\nusing System.Collections.Generic;\nusing QuantConnect.Statistics;\nusing System.Reflection;\n\nnamespace QuantConnect.Tests.Python\n{\n    public static class PythonWrapperTests\n    {\n        [TestFixture]\n        public class ValidateImplementationOf\n        {\n            [TestCase(nameof(MissingMethodOne), \"ModelMissingMethodOne\", \"MethodOne\")]\n            [TestCase(nameof(MissingProperty), \"ModelMissingProperty\", \"PropertyOne\")]\n            public void ThrowsOnMissingMember(string moduleName, string className, string missingMemberName)\n            {\n                using (Py.GIL())\n                {\n                    var moduleStr = GetFieldValue(moduleName);\n                    var module = PyModule.FromString(nameof(ValidateImplementationOf), moduleStr);\n                    var model = module.GetAttr(className).Invoke();\n                    Assert.That(() => model.ValidateImplementationOf<IModel>(), Throws\n                        .Exception.InstanceOf<NotImplementedException>().With.Message.Contains(missingMemberName));\n                }\n            }\n\n            [TestCase(nameof(FullyImplemented), \"FullyImplementedModel\")]\n            [TestCase(nameof(FullyImplementedSnakeCase), \"FullyImplementedSnakeCaseModel\")]\n            [TestCase(nameof(FullyImplementedWithPropertyAsField), \"FullyImplementedModelWithPropertyAsField\")]\n            [TestCase(nameof(DerivedFromCsharp), \"DerivedFromCSharpModel\")]\n            public void DoesNotThrowWhenInterfaceFullyImplemented(string moduleName, string className)\n            {\n                using (Py.GIL())\n                {\n                    var moduleStr = GetFieldValue(moduleName);\n                    var module = PyModule.FromString(nameof(ValidateImplementationOf), moduleStr);\n                    var model = module.GetAttr(className).Invoke();\n                    Assert.That(() => model.ValidateImplementationOf<IModel>(), Throws.Nothing);\n                }\n            }\n\n            [Test]\n            public void SettlementModelPythonWrapperWorks()\n            {\n                var results = AlgorithmRunner.RunLocalBacktest(\"CustomSettlementModelRegressionAlgorithm\",\n                    new Dictionary<string, string>()\n                    {\n                        {PerformanceMetrics.TotalOrders, \"0\"},\n                        {\"Average Win\", \"0%\"},\n                        {\"Average Loss\", \"0%\"},\n                        {\"Compounding Annual Return\", \"119.460%\"},\n                        {\"Drawdown\", \"0%\"},\n                        {\"Expectancy\", \"0\"},\n                        {\"Net Profit\", \"1.010%\"},\n                        {\"Sharpe Ratio\", \"-5.989\"},\n                        {\"Sortino Ratio\", \"0\"},\n                        {\"Probabilistic Sharpe Ratio\", \"1.216%\"},\n                        {\"Loss Rate\", \"0%\"},\n                        {\"Win Rate\", \"0%\"},\n                        {\"Profit-Loss Ratio\", \"0\"},\n                        {\"Alpha\", \"-0.411\"},\n                        {\"Beta\", \"-0.033\"},\n                        {\"Annual Standard Deviation\", \"0.079\"},\n                        {\"Annual Variance\", \"0.006\"},\n                        {\"Information Ratio\", \"-10.086\"},\n                        {\"Tracking Error\", \"0.243\"},\n                        {\"Treynor Ratio\", \"14.619\"},\n                        {\"Total Fees\", \"$0.00\"},\n                        {\"Estimated Strategy Capacity\", \"$0\"},\n                        {\"Lowest Capacity Asset\", \"\"},\n                        {\"Portfolio Turnover\", \"0%\"},\n                        {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n                    },\n                    Language.Python,\n                    AlgorithmStatus.Completed,\n                    algorithmLocation: \"../../../Algorithm.Python/CustomSettlementModelRegressionAlgorithm.py\"\n                );\n            }\n\n            [Test]\n            public void BenchmarkModelPythonWrapperWorks()\n            {\n                var results = AlgorithmRunner.RunLocalBacktest(\"CustomBenchmarkRegressionAlgorithm\",\n                    new Dictionary<string, string>()\n                    {\n                        {PerformanceMetrics.TotalOrders, \"0\"},\n                        {\"Average Win\", \"0%\"},\n                        {\"Average Loss\", \"0%\"},\n                        {\"Compounding Annual Return\", \"0%\"},\n                        {\"Drawdown\", \"0%\"},\n                        {\"Expectancy\", \"0\"},\n                        {\"Net Profit\", \"0%\"},\n                        {\"Sharpe Ratio\", \"0\"},\n                        {\"Sortino Ratio\", \"0\"},\n                        {\"Probabilistic Sharpe Ratio\", \"0%\"},\n                        {\"Loss Rate\", \"0%\"},\n                        {\"Win Rate\", \"0%\"},\n                        {\"Profit-Loss Ratio\", \"0\"},\n                        {\"Alpha\", \"0\"},\n                        {\"Beta\", \"0\"},\n                        {\"Annual Standard Deviation\", \"0\"},\n                        {\"Annual Variance\", \"0\"},\n                        {\"Information Ratio\", \"-6.654540153820717E+27\"},\n                        {\"Tracking Error\", \"11.906\"},\n                        {\"Treynor Ratio\", \"0\"},\n                        {\"Total Fees\", \"$0.00\"},\n                        {\"Estimated Strategy Capacity\", \"$0\"},\n                        {\"Lowest Capacity Asset\", \"\"},\n                        {\"Portfolio Turnover\", \"0%\"},\n                        {\"OrderListHash\", \"d41d8cd98f00b204e9800998ecf8427e\"}\n                    },\n                    Language.Python,\n                    AlgorithmStatus.Completed,\n                    algorithmLocation: \"../../../Algorithm.Python/CustomBenchmarkRegressionAlgorithm.py\"\n                );\n            }\n\n            [Test]\n            public void PEP8StyleAlgorithmsImplementationsWork()\n            {\n                AlgorithmRunner.RunLocalBacktest(\"PEP8StyleBasicAlgorithm\",\n                    new Dictionary<string, string>()\n                    {\n                        {\"Total Orders\", \"1\"},\n                        {\"Average Win\", \"0%\"},\n                        {\"Average Loss\", \"0%\"},\n                        {\"Compounding Annual Return\", \"271.453%\"},\n                        {\"Drawdown\", \"2.200%\"},\n                        {\"Expectancy\", \"0\"},\n                        {\"Start Equity\", \"100000\"},\n                        {\"End Equity\", \"101691.92\"},\n                        {\"Net Profit\", \"1.692%\"},\n                        {\"Sharpe Ratio\", \"8.854\"},\n                        {\"Sortino Ratio\", \"0\"},\n                        {\"Probabilistic Sharpe Ratio\", \"67.609%\"},\n                        {\"Loss Rate\", \"0%\"},\n                        {\"Win Rate\", \"0%\"},\n                        {\"Profit-Loss Ratio\", \"0\"},\n                        {\"Alpha\", \"-0.005\"},\n                        {\"Beta\", \"0.996\"},\n                        {\"Annual Standard Deviation\", \"0.222\"},\n                        {\"Annual Variance\", \"0.049\"},\n                        {\"Information Ratio\", \"-14.565\"},\n                        {\"Tracking Error\", \"0.001\"},\n                        {\"Treynor Ratio\", \"1.97\"},\n                        {\"Total Fees\", \"$3.44\"},\n                        {\"Estimated Strategy Capacity\", \"$56000000.00\"},\n                        {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n                        {\"Portfolio Turnover\", \"19.93%\"},\n                        {\"OrderListHash\", \"3da9fa60bf95b9ed148b95e02e0cfc9e\"}\n                    },\n                    Language.Python,\n                    AlgorithmStatus.Completed,\n                    algorithmLocation: \"../../../Algorithm.Python/PEP8StyleBasicAlgorithm.py\"\n                );\n            }\n\n            [Test]\n            public void PEP8StyleCustomModelsWork()\n            {\n                AlgorithmRunner.RunLocalBacktest(\"CustomModelsPEP8Algorithm\",\n                    new Dictionary<string, string>()\n                    {\n                        {\"Total Orders\", \"63\"},\n                        {\"Average Win\", \"0.11%\"},\n                        {\"Average Loss\", \"-0.06%\"},\n                        {\"Compounding Annual Return\", \"-7.236%\"},\n                        {\"Drawdown\", \"2.400%\"},\n                        {\"Expectancy\", \"-0.187\"},\n                        {\"Start Equity\", \"100000\"},\n                        {\"End Equity\", \"99370.95\"},\n                        {\"Net Profit\", \"-0.629%\"},\n                        {\"Sharpe Ratio\", \"-1.47\"},\n                        {\"Sortino Ratio\", \"-2.086\"},\n                        {\"Probabilistic Sharpe Ratio\", \"21.874%\"},\n                        {\"Loss Rate\", \"70%\"},\n                        {\"Win Rate\", \"30%\"},\n                        {\"Profit-Loss Ratio\", \"1.73\"},\n                        {\"Alpha\", \"-0.102\"},\n                        {\"Beta\", \"0.122\"},\n                        {\"Annual Standard Deviation\", \"0.04\"},\n                        {\"Annual Variance\", \"0.002\"},\n                        {\"Information Ratio\", \"-4.126\"},\n                        {\"Tracking Error\", \"0.102\"},\n                        {\"Treynor Ratio\", \"-0.479\"},\n                        {\"Total Fees\", \"$62.25\"},\n                        {\"Estimated Strategy Capacity\", \"$52000000.00\"},\n                        {\"Lowest Capacity Asset\", \"SPY R735QTJ8XC9X\"},\n                        {\"Portfolio Turnover\", \"197.95%\"},\n                        {\"OrderListHash\", \"709bbf9af9ec6b43a10617dc192a6a5b\"}\n                    },\n                    Language.Python,\n                    AlgorithmStatus.Completed,\n                    algorithmLocation: \"../../../Algorithm.Python/CustomModelsPEP8Algorithm.py\"\n                );\n            }\n\n            private static string GetFieldValue(string name)\n            {\n                return typeof(ValidateImplementationOf).GetField(name, BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) as string;\n            }\n\n            private const string FullyImplemented =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass FullyImplementedModel:\n    def MethodOne():\n        pass\n    def MethodTwo():\n        pass\n    @property\n    def PropertyOne(self):\n        return 'value'\n\n\";\n\n            private const string FullyImplementedSnakeCase =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass FullyImplementedSnakeCaseModel:\n    def method_one():\n        pass\n    def method_two():\n        pass\n    @property\n    def property_one(self):\n        pass\n\n\";\n\n            private const string FullyImplementedWithPropertyAsField =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass FullyImplementedModelWithPropertyAsField:\n    def method_one():\n        pass\n    def method_two():\n        pass\n    def __init__(self):\n        self.property_one = 'value'\n\";\n\n            private const string DerivedFromCsharp =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass DerivedFromCSharpModel(PythonWrapperTests.ValidateImplementationOf.Model):\n    def MethodOne():\n        pass\n    @property\n    def PropertyOne(self):\n        return 'value'\n\n\";\n\n            private const string MissingMethodOne =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass ModelMissingMethodOne:\n    def MethodTwo():\n        pass\n    @property\n    def PropertyOne(self):\n        return 'value'\n\";\n\n            private const string MissingProperty =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass ModelMissingProperty:\n    def MethodOne():\n        pass\n    def MethodTwo():\n        pass\n\";\n\n            interface IModel\n            {\n                string PropertyOne { get; set; }\n                void MethodOne();\n                void MethodTwo();\n            }\n\n            public class Model : IModel\n            {\n                public string PropertyOne { get; set; }\n\n                public void MethodOne()\n                {\n                }\n\n                public void MethodTwo()\n                {\n                }\n            }\n        }\n\n\n        [TestFixture]\n        public class InvokeTests\n        {\n            [Test]\n            public void InvokesCSharpMethod()\n            {\n                using (Py.GIL())\n                {\n                    var module = PyModule.FromString(nameof(InvokeTests), InvokeModule);\n                    var model = module.GetAttr(\"PythonInvokeTestsModel\").Invoke();\n                    Assert.That(model.InvokeMethod<int>(\"AddThreeNumbers\", 1, 2, 3), Is.EqualTo(6));\n                }\n            }\n\n            [Test]\n            public void InvokesPythonMethod()\n            {\n                using (Py.GIL())\n                {\n                    var module = PyModule.FromString(nameof(InvokeTests), InvokeModule);\n                    var model = module.GetAttr(\"PythonInvokeTestsModel\").Invoke();\n                    Assert.That(model.InvokeMethod<int>(\"AddTwoNumbers\", 1, 2), Is.EqualTo(3));\n                }\n            }\n\n            private const string InvokeModule =\n                @\"\nfrom clr import AddReference\nAddReference('QuantConnect.Tests')\n\nfrom QuantConnect.Tests.Python import *\n\nclass PythonInvokeTestsModel(PythonWrapperTests.InvokeTests.InvokeTestsModel):\n    def add_two_numbers(self, a, b):\n        return a + b\n\";\n\n            public class InvokeTestsModel\n            {\n                public int AddTwoNumbers(int a, int b)\n                {\n                    throw new NotImplementedException();\n                }\n\n                public int AddThreeNumbers(int a, int b, int c)\n                {\n                    return a + b + c;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/SecurityCustomModelTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Algorithm;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Equity;\nusing QuantConnect.Tests.Common.Securities;\nusing System;\nusing QuantConnect.Tests.Engine.DataFeeds;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class SecurityCustomModelTests\n    {\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void SetBuyingPowerModelSuccess(bool isChild)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.SubscriptionManager.SetDataManager(new DataManagerStub(algorithm));\n            algorithm.SetDateTime(new DateTime(2018, 8, 20, 15, 0, 0));\n            algorithm.Transactions.SetOrderProcessor(new FakeOrderProcessor());\n\n            var spy = algorithm.AddEquity(\"SPY\", Resolution.Daily);\n            spy.SetMarketPrice(new Tick(algorithm.Time, Symbols.SPY, 100m, 100m));\n\n            // Test two custom buying power models.\n            // The first inherits from C# SecurityMarginModel and the other is 100% python\n            var code = isChild\n                ? CreateCustomBuyingPowerModelFromSecurityMarginModelCode()\n                : CreateCustomBuyingPowerModelCode();\n\n            spy.SetBuyingPowerModel(CreateCustomBuyingPowerModel(code));\n            Assert.IsAssignableFrom<BuyingPowerModelPythonWrapper>(spy.MarginModel);\n            Assert.AreEqual(1, spy.MarginModel.GetLeverage(spy));\n\n            spy.SetLeverage(2);\n            Assert.AreEqual(2, spy.MarginModel.GetLeverage(spy));\n\n            var quantity = algorithm.CalculateOrderQuantity(spy.Symbol, 1m);\n            Assert.AreEqual(isChild ? 100 : 200, quantity);\n        }\n\n        [Test]\n        public void SetBuyingPowerModelFails()\n        {\n            var spy = GetSecurity<Equity>(Symbols.SPY, Resolution.Daily);\n\n            // Renaming GetMaximumOrderQuantityForTargetDeltaBuyingPower will cause a NotImplementedException exception\n            var code = CreateCustomBuyingPowerModelCode();\n            code = code.Replace(\"GetMaximumOrderQuantityForDeltaBuyingPower\", \"AnotherName\");\n            var pyObject = CreateCustomBuyingPowerModel(code);\n            Assert.Throws<NotImplementedException>(() => spy.SetBuyingPowerModel(pyObject));\n        }\n\n        private PyObject CreateCustomBuyingPowerModel(string code)\n        {\n            using (Py.GIL())\n            {\n                var module = PyModule.FromString(\"CustomBuyingPowerModel\", code);\n                return module.GetAttr(\"CustomBuyingPowerModel\").Invoke();\n            }\n        }\n\n        private string CreateCustomBuyingPowerModelCode() => @\"\nimport os, sys\nsys.path.append(os.getcwd())\n\nfrom AlgorithmImports import *\n\nclass CustomBuyingPowerModel:\n    def __init__(self):\n        self.margin = 1.0\n\n    def GetBuyingPower(self, context):\n        return BuyingPower(context.Portfolio.MarginRemaining)\n\n    def GetMaximumOrderQuantityForDeltaBuyingPower(self, context):\n        return GetMaximumOrderQuantityResult(200)\n\n    def GetLeverage(self, security):\n        return 1.0 / self.margin\n\n    def GetMaximumOrderQuantityForTargetBuyingPower(self, context):\n        return GetMaximumOrderQuantityResult(200)\n\n    def GetReservedBuyingPowerForPosition(self, context):\n        return ReservedBuyingPowerForPosition(context.Security.Holdings.AbsoluteHoldingsCost * self.margin)\n\n    def HasSufficientBuyingPowerForOrder(self, context):\n        return HasSufficientBuyingPowerForOrderResult(True)\n\n    def GetMaintenanceMargin(self, context):\n        return None\n\n    def GetInitialMarginRequirement(self, context):\n        return None\n\n    def GetInitialMarginRequiredForOrder(self, context):\n        return None\n\n    def SetLeverage(self, security, leverage):\n        self.margin = 1.0 / float(leverage)\";\n\n        private string CreateCustomBuyingPowerModelFromSecurityMarginModelCode() => @\"\nimport os, sys\nsys.path.append(os.getcwd())\n\nfrom AlgorithmImports import *\n\nclass CustomBuyingPowerModel(SecurityMarginModel):\n    def GetMaximumOrderQuantityForTargetBuyingPower(self, context):\n        return GetMaximumOrderQuantityResult(100)\";\n\n        private Security GetSecurity<T>(Symbol symbol, Resolution resolution)\n        {\n            var subscriptionDataConfig = new SubscriptionDataConfig(\n                typeof(T),\n                symbol,\n                resolution,\n                TimeZones.Utc,\n                TimeZones.Utc,\n                true,\n                true,\n                false);\n\n            return new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.Utc),\n                subscriptionDataConfig,\n                new Cash(Currencies.USD, 0, 1m),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Python/SettlementModelPythonWrapperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.AlgorithmFactory.Python.Wrappers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Orders;\nusing Moq;\nusing static QuantConnect.Tests.Engine.PerformanceBenchmarkAlgorithms;\nusing QuantConnect.Python;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Python\n{\n    [TestFixture]\n    public class SettlementModelPythonWrapperTests\n    {\n        [Test]\n        public void GetsDefaultUnsettledCashFromNone()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nclass CustomSettlementModel:\n    def ApplyFunds(self, parameters):\n        pass\n\n    def Scan(self, parameters):\n        pass\n\n    def GetUnsettledCash(self):\n        return None\n        \");\n\n                var settlementModel = new SettlementModelPythonWrapper(testModule.GetAttr(\"CustomSettlementModel\").Invoke());\n                var result = settlementModel.GetUnsettledCash();\n                Assert.AreEqual(default(CashAmount), result);\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/QuantConnect.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <RootNamespace>QuantConnect.Tests</RootNamespace>\n    <AssemblyName>QuantConnect.Tests</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <ServerGarbageCollection>true</ServerGarbageCollection>\n    <Description>QuantConnect LEAN Engine: Tests Project - The test collection</Description>\n    <NoWarn>CA1707;CA1062;IDE0066</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <Import Project=\"$(SolutionDir)\\.nuget\\NuGet.targets\" Condition=\"Exists('$(SolutionDir)\\.nuget\\NuGet.targets')\" />\n  <ItemGroup>\n    <PackageReference Include=\"QuantConnect.pythonnet\" Version=\"2.0.53\" />\n    <PackageReference Include=\"Accord\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Accord.Math\" Version=\"3.6.0\" />\n    <PackageReference Include=\"Common.Logging\" Version=\"3.4.1\" />\n    <PackageReference Include=\"Common.Logging.Core\" Version=\"3.4.1\" />\n    <PackageReference Include=\"Deedle\" Version=\"2.1.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.9.4\" />\n    <PackageReference Include=\"Microsoft.TestPlatform.ObjectModel\" Version=\"16.9.4\" />\n    <PackageReference Include=\"Moq\" Version=\"4.16.1\" />\n    <PackageReference Include=\"NetMQ\" Version=\"4.0.1.6\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.2\" />\n    <PackageReference Include=\"NodaTime\" Version=\"3.0.5\" />\n    <PackageReference Include=\"NUnit\" Version=\"4.2.2\" />\n    <PackageReference Include=\"NUnit3TestAdapter\" Version=\"4.6.0\">\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"protobuf-net\" Version=\"3.1.33\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Using Include=\"NUnit.Framework.Legacy.ClassicAssert\" Alias=\"Assert\" />\n    <Using Include=\"NUnit.Framework.Legacy.CollectionAssert\" Alias=\"CollectionAssert\" />\n    <Using Include=\"NUnit.Framework.Legacy.StringAssert\" Alias=\"StringAssert\" />\n    <Using Include=\"NUnit.Framework.Legacy.DirectoryAssert\" Alias=\"DirectoryAssert\" />\n    <Using Include=\"NUnit.Framework.Legacy.FileAssert\" Alias=\"FileAssert\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n    <Content Include=\"Research\\RegressionScripts\\Test_QuantBookIndicator.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"TestData\\greeksindicator\\american\\third_party_1_greeks.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeksindicator\\american\\third_party_2_greeks.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811C00430000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811C00450000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811C00470000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811P00430000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811P00450000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230811P00470000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901C00430000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901C00450000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901C00470000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901P00430000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901P00450000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPY230901P00470000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811C04300000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811C04500000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811C04700000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811P04300000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811P04500000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230811P04700000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901C04300000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901C04500000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901C04700000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901P04300000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901P04500000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\greeks\\SPX230901P04700000.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\20151224_quote_american.zip\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\aapl_fine_fundamental.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\bi_datatest.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\alpha_indicator_datatest.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\CashTestingStrategy.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Content Include=\"Research\\RegressionScripts\\custom_data.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Research\\RegressionScripts\\Test_QuantBookHistory.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Research\\RegressionTemplates\\BasicTemplateResearchCSharp.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Research\\RegressionTemplates\\BasicTemplateResearchPython.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Research\\RegressionTemplates\\BasicTemplateCustomDataTypeHistoryResearchCSharp.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Research\\RegressionTemplates\\BasicTemplateCustomDataTypeHistoryResearchPython.ipynb\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Python\\Indicators\\IndicatorExtensionsTests.py\" />\n    <Content Include=\"Python\\PandasTests\\PandasMapperTests.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Python\\PandasTests\\PandasIndexingTests.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"RegressionAlgorithms\\Test_AlgorithmPythonWrapper.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"RegressionAlgorithms\\Test_CustomDataAlgorithm.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"RegressionAlgorithms\\Test_PythonExceptionInterpreter.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"RegressionAlgorithms\\Test_MethodOverload.py\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\aapl_chain.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\arms_data.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\equity\\usa\\shortable\\testbrokerage\\dates\\20201221.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\equity\\usa\\shortable\\testbrokerage\\dates\\20201222.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\equity\\usa\\shortable\\testbrokerage\\symbols\\aapl.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\equity\\usa\\shortable\\testbrokerage\\symbols\\goog.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\eurusd60_dem.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\FuturesExpiryFunctionsTestData.xml\">\n      <SubType>Designer</SubType>\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\eurusd_candle_patterns.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\ewz_candle_patterns.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\tp_datatest.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\vp_datatest.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\SampleMarketHoursDatabase.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\frama.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Include=\"TestData\\daily-stock-picker-backtest.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\daily-stock-picker-live.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\portfolio_targets.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\FillForwardBars.zip\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\fxVolumeDaily.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\fxVolumeHourly.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\fxVolumeMinute.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\multizip.zip\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Content Include=\"TestData\\spy_acceleration_bands_20_4.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\mcclellan_data.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_alma.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ao.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_atr_wilder.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_cmf.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_sr.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_pivot_pnt_hl.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_hma.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_mass_index_25.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_coppock_curve.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_rvi.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_rdv.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dwac_supertrend.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_stc.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\stock_prices.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\custom_future_chris_cme_es1.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\custom_future_chris_cme_es2.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\00010101_05_example_psychsignal_testdata.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_report_data.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Include=\"TestData\\spy_dpo.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\spy_with_ichimoku.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"TestData\\spy_with_keltner.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\equity\\usa\\shortable\\testinteractivebrokers\\dates\\20201221.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\equity\\usa\\shortable\\testinteractivebrokers\\dates\\20201222.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\equity\\usa\\shortable\\testinteractivebrokers\\symbols\\aapl.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\equity\\usa\\shortable\\testinteractivebrokers\\symbols\\goog.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\nhnl_data.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_arima.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_qqq_corr.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_qqq_cov.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_si.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_asi.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_sortino.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_valueatrisk.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\vix_contango.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_chop.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_ForceIndex.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_hilbert.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_ChandeKrollStop.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_ibs.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_McGinleyDynamic.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_rsv.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_sobv.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_StochRSI.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_vwma.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\spy_with_zlema.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestData\\td_sequential_test_data.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Algorithm.CSharp\\QuantConnect.Algorithm.CSharp.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm.Framework\\QuantConnect.Algorithm.Framework.csproj\" />\n    <ProjectReference Include=\"..\\AlgorithmFactory\\QuantConnect.AlgorithmFactory.csproj\" />\n    <ProjectReference Include=\"..\\Algorithm\\QuantConnect.Algorithm.csproj\" />\n    <ProjectReference Include=\"..\\Api\\QuantConnect.Api.csproj\" />\n    <ProjectReference Include=\"..\\Brokerages\\QuantConnect.Brokerages.csproj\" />\n    <ProjectReference Include=\"..\\Common\\QuantConnect.csproj\" />\n    <ProjectReference Include=\"..\\Compression\\QuantConnect.Compression.csproj\" />\n    <ProjectReference Include=\"..\\Configuration\\QuantConnect.Configuration.csproj\" />\n    <ProjectReference Include=\"..\\DownloaderDataProvider\\QuantConnect.DownloaderDataProvider.Launcher.csproj\" />\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n    <ProjectReference Include=\"..\\Indicators\\QuantConnect.Indicators.csproj\" />\n    <ProjectReference Include=\"..\\Optimizer\\QuantConnect.Optimizer.csproj\" />\n    <ProjectReference Include=\"..\\Research\\QuantConnect.Research.csproj\" />\n    <ProjectReference Include=\"..\\Launcher\\QuantConnect.Lean.Launcher.csproj\" />\n    <ProjectReference Include=\"..\\Logging\\QuantConnect.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Messaging\\QuantConnect.Messaging.csproj\" />\n    <ProjectReference Include=\"..\\Queues\\QuantConnect.Queues.csproj\" />\n    <ProjectReference Include=\"..\\Report\\QuantConnect.Report.csproj\" />\n    <ProjectReference Include=\"..\\ToolBox\\QuantConnect.ToolBox.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"TestData\\spx_lwma.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_10_min.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ad.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ad_osc.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_apo.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_aps.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_aroon_oscillator.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_atr.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_bollinger_bands.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_bop.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_candle_patterns.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_cmo.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_dema.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_heikin_ashi.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_kama.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_logr14.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_max.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_mfi.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_midpoint.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_midprice.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_min.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_natr.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ohlcv.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ppo.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_sarext.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_swiss.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_t3.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_tsf.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_rocr.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_emv.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_vidya.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_tr.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_tema.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_tsi.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_trima.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ultosc.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_trix.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_var.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_do.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_ema.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_adx.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_cci.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_don50.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_fisher.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_indicators.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_kst.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_macd.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_obv.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_rma.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_roc50.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_rocp50.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_stoch12k3.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_pso.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_vwap.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_williamsR14.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_cash_equity.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_cash_fills.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_forex_equity.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_forex_fills.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_forex_fills_jwb_quantity.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\test_forex_fills_mch_quantity.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_vtx.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_with_kvo.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_adr.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_mama.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_crsi.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_hurst_exponent.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_sm.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_zigzag.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\spy_tdd.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"TestData\\symbol-properties\\symbol-properties-database.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dynamic-market-hours\\original\\market-hours\\market-hours-database.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dynamic-market-hours\\modified-close\\market-hours\\market-hours-database.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dynamic-market-hours\\modified-holidays\\market-hours\\market-hours-database.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dynamic-symbol-properties\\original\\symbol-properties\\symbol-properties-database.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"TestData\\dynamic-symbol-properties\\modified\\symbol-properties\\symbol-properties-database.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "Tests/RegressionAlgorithms/Test_AlgorithmPythonWrapper.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass Test_AlgorithmPythonWrapper(QCAlgorithm):\n\n    def initialize(self):\n        pass\n\n    def on_data(self, slice):\n        pass\n"
  },
  {
    "path": "Tests/RegressionAlgorithms/Test_CustomDataAlgorithm.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom custom_data import *\n\nclass Test_CustomDataAlgorithm(QCAlgorithm):\n\n    def initialize(self):\n        self.add_data(Nifty, \"NIFTY\")\n        self.add_data(CustomPythonData, \"IBM\", Resolution.DAILY)\n\nclass Nifty(PythonData):\n    '''NIFTY Custom Data Class'''\n    def get_source(self, config, date, is_live_mode):\n        return SubscriptionDataSource(\"https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1\", SubscriptionTransportMedium.REMOTE_FILE)\n\n\n    def reader(self, config, line, date, is_live_mode):\n        if not (line.strip() and line[0].isdigit()): return None\n\n        # New Nifty object\n        index = Nifty()\n        index.symbol = config.symbol\n\n        try:\n            # Example File Format:\n            # Date,       Open       High        Low       Close     Volume      Turnover\n            # 2011-09-13  7792.9    7799.9     7722.65    7748.7    116534670    6107.78\n            data = line.split(',')\n            index.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            index.value = decimal.decimal(data[4])\n            index[\"Open\"] = float(data[1])\n            index[\"High\"] = float(data[2])\n            index[\"Low\"] = float(data[3])\n            index[\"Close\"] = float(data[4])\n\n\n        except ValueError:\n                # Do nothing\n                return None\n\n        return index\n"
  },
  {
    "path": "Tests/RegressionAlgorithms/Test_MethodOverload.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass Test_MethodOverload(QCAlgorithm):\n    def initialize(self):\n        self.add_equity(\"SPY\", Resolution.SECOND)\n        self.sma = self.sma('SPY', 20)\n        self.std = self.std('SPY', 20)\n        self.a = A()\n\n    def on_data(self, data):\n        pass\n\n    def call_plot_std_test(self):\n        self.plot('STD', self.std)\n\n    def call_plot_sma_test(self):\n        self.plot('SMA', self.sma)\n\n    def call_plot_number_test(self):\n        self.plot('NUMBER', 0.1)\n\n    def call_plot_throw_test(self):\n        self.plot(\"ERROR\", self.name)\n\n    def call_plot_throw_managed_test(self):\n        self.plot(\"ERROR\", self.portfolio)\n\n    def call_plot_throw_pyobject_test(self):\n        self.plot(\"ERROR\", self.a)\n\n    def no_method_match(self):\n        self.log(1)\n\n\nclass A(object):\n   def __init__(self):\n       pass\n"
  },
  {
    "path": "Tests/RegressionAlgorithms/Test_PythonExceptionInterpreter.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass Test_PythonExceptionInterpreter(QCAlgorithm):\n    def initialize(self):\n        pass\n\n    def key_error(self):\n        x = dict()['SPY']\n\n    def no_method_match(self):\n        self.set_cash('SPY')\n\n    def unsupported_operand(self):\n        x = None + \"Pepe Grillo\"\n\n    def zero_division_error(self):\n        x = 1 / 0\n\n    def dotnet_error(self):\n        self.market_order(None, 1);\n"
  },
  {
    "path": "Tests/RegressionTestMessageHandler.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine;\nusing QuantConnect.Packets;\nusing QuantConnect.Util;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Local/desktop implementation of messaging system for Lean Engine.\n    /// </summary>\n    public class RegressionTestMessageHandler : QuantConnect.Messaging.Messaging\n    {\n        private static readonly bool _updateRegressionStatistics = Config.GetBool(\"regression-update-statistics\", false);\n        private AlgorithmNodePacket _job;\n        private AlgorithmManager _algorithmManager;\n\n        /// <summary>\n        /// Initialize the messaging system\n        /// </summary>\n        public void SetAlgorithmManager(AlgorithmManager algorithmManager)\n        {\n            _algorithmManager = algorithmManager;\n        }\n\n        /// <summary>\n        /// Set the messaging channel\n        /// </summary>\n        public override void SetAuthentication(AlgorithmNodePacket job)\n        {\n            base.SetAuthentication(job);\n            _job = job;\n        }\n\n        /// <summary>\n        /// Send a generic base packet without processing\n        /// </summary>\n        public override void Send(Packet packet)\n        {\n            base.Send(packet);\n            switch (packet.Type)\n            {\n                case PacketType.BacktestResult:\n                    var result = (BacktestResultPacket)packet;\n\n                    if (result.Progress == 1)\n                    {\n                        if (_updateRegressionStatistics && _job.Language == Language.CSharp)\n                        {\n                            UpdateRegressionStatisticsInSourceFile(result.Results.Statistics, _algorithmManager, \"../../../Algorithm.CSharp\", $\"{_job.AlgorithmId}.cs\");\n                        }\n                    }\n                    break;\n\n                default:\n                    break;\n            }\n        }\n\n        public static void UpdateRegressionStatisticsInSourceFile(IDictionary<string, string> statistics, AlgorithmManager algorithmManager, string folder, string fileToUpdate)\n        {\n            var algorithmSource = Directory.EnumerateFiles(folder, fileToUpdate, SearchOption.AllDirectories).Single();\n            var file = File.ReadAllLines(algorithmSource).ToList().GetEnumerator();\n            var lines = new List<string>();\n            while (file.MoveNext())\n            {\n                var line = file.Current;\n                if (line == null)\n                {\n                    continue;\n                }\n\n                if (line.Contains(\"Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>\")\n                    || line.Contains(\"Dictionary<string, string> ExpectedStatistics => new()\"))\n                {\n                    if (!statistics.Any() || line.EndsWith(\"();\"))\n                    {\n                        lines.Add(line);\n                        continue;\n                    }\n\n                    lines.Add(line);\n                    lines.Add(\"        {\");\n\n                    foreach (var pair in statistics)\n                    {\n                        lines.Add($\"            {{\\\"{pair.Key}\\\", \\\"{pair.Value}\\\"}},\");\n                    }\n\n                    // remove trailing comma\n                    var lastLine = lines[lines.Count - 1];\n                    lines[lines.Count - 1] = lastLine.Substring(0, lastLine.Length - 1);\n\n                    // now we skip existing expected statistics in file\n                    while (file.MoveNext())\n                    {\n                        line = file.Current;\n                        if (line != null && line.Contains(\"};\"))\n                        {\n                            lines.Add(line);\n                            break;\n                        }\n                    }\n                }\n                else if (line.Contains($\"long DataPoints =>\"))\n                {\n                    if (line.EndsWith(\"-1;\"))\n                    {\n                        lines.Add(line);\n                    }\n                    else\n                    {\n                        lines.Add(GetDataPointLine(line, algorithmManager?.DataPoints.ToString()));\n                    }\n                }\n                else if (line.Contains($\"int AlgorithmHistoryDataPoints =>\"))\n                {\n                    if (line.EndsWith(\"-1;\"))\n                    {\n                        lines.Add(line);\n                    }\n                    else\n                    {\n                        lines.Add(GetDataPointLine(line, algorithmManager?.AlgorithmHistoryDataPoints.ToString()));\n                    }\n                }\n                else if (line.Contains($\"AlgorithmStatus AlgorithmStatus =>\"))\n                {\n                    lines.Add(GetAlgorithmStatusLine(line, algorithmManager?.State.ToString()));\n                }\n                else\n                {\n                    lines.Add(line);\n                }\n            }\n\n            file.DisposeSafely();\n            File.WriteAllLines(algorithmSource, lines);\n        }\n\n        private static string GetDataPointLine(string currentLine, string count)\n        {\n            var dataParts = currentLine.Split(\" \");\n            dataParts[^1] = count + \";\";\n            return string.Join(\" \", dataParts);\n        }\n\n        private static string GetAlgorithmStatusLine(string currentLine, string algorithmStatus)\n        {\n            var dataParts = currentLine.Split(\" \");\n            dataParts[^1] = \"AlgorithmStatus.\" + algorithmStatus + \";\";\n            return string.Join(\" \", dataParts);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/RegressionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Algorithm.CSharp;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests\n{\n    [TestFixture, Category(\"TravisExclude\"), Category(\"RegressionTests\")]\n    public class RegressionTests\n    {\n        [Test, TestCaseSource(nameof(GetLocalRegressionTestParameters))]\n        public void AlgorithmStatisticsRegression(AlgorithmStatisticsTestParameters parameters)\n        {\n            // ensure we start with a fresh config every time when running multiple tests\n            Config.Reset();\n\n            Config.Set(\"quandl-auth-token\", \"WyAazVXnq7ATy_fefTqm\");\n            Config.Set(\"forward-console-messages\", \"false\");\n\n            if (parameters.Algorithm == \"OptionChainConsistencyRegressionAlgorithm\")\n            {\n                // special arrangement for consistency test - we check if limits work fine\n                Config.Set(\"symbol-minute-limit\", \"100\");\n                Config.Set(\"symbol-second-limit\", \"100\");\n                Config.Set(\"symbol-tick-limit\", \"100\");\n            }\n\n            if (parameters.Algorithm == \"TrainingInitializeRegressionAlgorithm\" ||\n                parameters.Algorithm == \"TrainingOnDataRegressionAlgorithm\")\n            {\n                // limit time loop to 90 seconds and set leaky bucket capacity to one minute w/ zero refill\n                Config.Set(\"algorithm-manager-time-loop-maximum\", \"1.5\");\n                Config.Set(\"scheduled-event-leaky-bucket-capacity\", \"1\");\n                Config.Set(\"scheduled-event-leaky-bucket-refill-amount\", \"0\");\n            }\n\n            var algorithmManager = AlgorithmRunner.RunLocalBacktest(\n                parameters.Algorithm,\n                parameters.Statistics,\n                parameters.Language,\n                parameters.ExpectedFinalStatus\n            ).AlgorithmManager;\n\n            if (parameters.Algorithm == \"TrainingOnDataRegressionAlgorithm\")\n            {\n                // this training algorithm should have consumed the only minute available in the bucket\n                Assert.AreEqual(0, algorithmManager.TimeLimit.AdditionalTimeBucket.AvailableTokens);\n            }\n\n            // Skip non-deterministic data points regression algorithms\n            if (parameters.DataPoints != -1)\n            {\n                Assert.AreEqual(parameters.DataPoints, algorithmManager.DataPoints, \"Failed on DataPoints\");\n            }\n            // Skip non-deterministic history data points regression algorithms\n            if (parameters.AlgorithmHistoryDataPoints != -1)\n            {\n                Assert.AreEqual(parameters.AlgorithmHistoryDataPoints, algorithmManager.AlgorithmHistoryDataPoints, \"Failed on AlgorithmHistoryDataPoints\");\n            }\n        }\n\n        public static TestCaseData[] GetLocalRegressionTestParameters()\n        {\n            return GetRegressionTestParameters<IRegressionAlgorithmDefinition, AlgorithmStatisticsTestParameters, BasicTemplateAlgorithm>(canRunLocally: true,\n                (instance, language) => new AlgorithmStatisticsTestParameters(instance.GetType().Name, instance.ExpectedStatistics, language,\n                instance.AlgorithmStatus, instance.DataPoints, instance.AlgorithmHistoryDataPoints));\n        }\n\n        public static TestCaseData[] GetRegressionTestParameters<T, K, J>(bool canRunLocally, Func<T, Language, K> factory)\n            where T : IRegressionAlgorithmDefinition\n            where K : AlgorithmStatisticsTestParameters\n            where J : class\n        {\n            TestGlobals.Initialize();\n\n            // since these are static test cases, they are executed before test setup\n            AssemblyInitialize.AdjustCurrentDirectory();\n\n            var languages = Config.GetValue(\"regression-test-languages\", JArray.FromObject(new[] { \"CSharp\", \"Python\" }))\n                .Select(str => Parse.Enum<Language>(str.Value<string>()))\n                .ToHashSet();\n\n            // find all regression algorithms in Algorithm.CSharp\n            return (\n                from type in typeof(J).Assembly.GetTypes()\n                where typeof(T).IsAssignableFrom(type)\n                where !type.IsAbstract                          // non-abstract\n                where type.GetConstructor(Array.Empty<Type>()) != null  // has default ctor\n                let instance = (T)Activator.CreateInstance(type)\n                where instance.CanRunLocally == canRunLocally                 // open source has data to run this algorithm\n                from language in instance.Languages.Where(languages.Contains)\n                select factory(instance, language)\n            )\n            .OrderBy(x => x.Language).ThenBy(x => x.Algorithm)\n            // generate test cases from test parameters\n            .Select(x => new TestCaseData(x).SetName(x.Language + \"/\" + x.Algorithm))\n            .ToArray();\n        }\n\n        public class AlgorithmStatisticsTestParameters\n        {\n            public string Algorithm { get; init; }\n            public Dictionary<string, string> Statistics { get; init; }\n            public Language Language { get; init; }\n            public AlgorithmStatus ExpectedFinalStatus { get; init; }\n            public long DataPoints { get; init; }\n            public int AlgorithmHistoryDataPoints { get; init; }\n\n            public AlgorithmStatisticsTestParameters(\n                string algorithm,\n                Dictionary<string, string> statistics,\n                Language language,\n                AlgorithmStatus expectedFinalStatus,\n                long dataPoints = 0,\n                int algorithmHistoryDataPoints = 0\n                )\n            {\n                Algorithm = algorithm;\n                Statistics = statistics;\n                Language = language;\n                ExpectedFinalStatus = expectedFinalStatus;\n                DataPoints = dataPoints;\n                AlgorithmHistoryDataPoints = algorithmHistoryDataPoints;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Report/CalculationTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing NUnit.Framework;\nusing QuantConnect.Report;\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class CalculationTests\n    {\n        [TestCase(new double[] { 1, 2, 4, 8 }, new double[] { 1, 1, 1 })]\n        [TestCase(new double[] { 0, 4, 5, 2.5 }, new double[] { double.PositiveInfinity, 0.25, -0.5 })]\n        public void PercentChangeProducesCorrectValues(double[] inputs, double[] expected)\n        {\n            var series = (new Series<DateTime, double>(CreateFakeSeries(inputs))).PercentChange();\n\n            Assert.AreEqual(expected, series.Values.ToList());\n        }\n\n        [TestCase(new double[] { 1, 2, 3, 4 }, new double[] { 1, 3, 6, 10 })]\n        [TestCase(new double[] { 0, 0, 0, 0 }, new double[] { 0, 0, 0, 0 })]\n        [TestCase(new double[] { 0.25, 0.5, 0.75, 1}, new double[] { 0.25, 0.75, 1.5, 2.5 })]\n        public void CumulativeSumProducesCorrectValues(double[] inputs, double[] expected)\n        {\n            var series = (new Series<DateTime, double>(CreateFakeSeries(inputs))).CumulativeSum().Values.ToList();\n\n            Assert.AreEqual(expected, series);\n        }\n\n        [TestCase(new double[] { 97.85916, 94.16154, 94.30944, 94.34978, 97.10619 },\n            new double[] {-1.829905, -3.804112, 0.1581819, 0.04307238, 2.942012 }, 2, new double[]{ 1.0071140181639988, 1.0070287327461955 })]\n        [TestCase(new double[] { -97.85916, -94.16154, -94.30944, -94.34978, -97.10619 },\n            new double[] { 1.829905, 3.804112, -0.1581819, -0.04307238, -2.942012 }, 2, new double[] { -1.0071140181639988, -1.0070287327461955 })]\n        [TestCase(new double[] { -32.85916, 54.16154, -10.30944, -20.34978, -97.10619 },\n            new double[] { 1.829905, 3.804112, -0.1581819, -0.04307238, -2.942012 }, 2, new double[] { 0.0005318694569107083, -0.010360916195344518})]\n        [TestCase(new double[] { }, new double[] { }, 2, new double[] { })]\n        public void BetaProducesCorrectValues(double[] benchmarkValues, double[] performanceValues, int period, double[] expected)\n        {\n            var benchmarkPoints = new SortedList<DateTime, double>(CreateFakeSeries(benchmarkValues));\n            var performancePoints = new SortedList<DateTime, double>(CreateFakeSeries(performanceValues));\n\n            var betaValues = (Rolling.Beta(performancePoints, benchmarkPoints, period)).Values.ToArray();\n            for (var index = 0; index < betaValues.Length; index++)\n            {\n                var betaValue = betaValues[index];\n                Assert.AreEqual(expected[index], betaValue, 0.001d);\n            }\n        }\n\n        private Dictionary<DateTime, double> CreateFakeSeries(double[] inputs)\n        {\n            var i = 0;\n            return inputs.ToList().ToDictionary(item =>\n            {\n                var time = new DateTime(2000, 1, 1).AddDays(i);\n                i++;\n\n                return time;\n            }, item => item);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Report/DrawdownCollectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Packets;\nusing QuantConnect.Report;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class DrawdownCollectionTests\n    {\n        [Test]\n        public void MaxDrawdown()\n        {\n            var series = new Deedle.Series<DateTime, double>(new []\n            {\n                new KeyValuePair<DateTime, double>(new DateTime(2020, 1, 1), 100000),\n                new KeyValuePair<DateTime, double>(new DateTime(2020, 1, 2), 90000),\n                new KeyValuePair<DateTime, double>(new DateTime(2020, 1, 3), 100000),\n                new KeyValuePair<DateTime, double>(new DateTime(2020, 1, 4), 100000),\n                new KeyValuePair<DateTime, double>(new DateTime(2020, 1, 5), 80000)\n            });\n\n            var collection = DrawdownCollection.GetDrawdownPeriods(series, 1).ToList();\n\n            Assert.AreEqual(1, collection.Count);\n            Assert.AreEqual(0.2, collection.First().Drawdown, 0.0001);\n        }\n\n        [TestCase(false)]\n        [TestCase(true)]\n        public void NoDrawdown(bool hasEquityPoint)\n        {\n            var strategyEquityChart = new Chart(\"Strategy Equity\");\n            var equitySeries = new Series(\"Equity\");\n            strategyEquityChart.AddSeries(equitySeries);\n\n            if (hasEquityPoint)\n            {\n                equitySeries.AddPoint(new DateTime(2020, 1, 1), 100000);\n            }\n\n            var backtest = new BacktestResult\n            {\n                Charts = new Dictionary<string, Chart> {[strategyEquityChart.Name] = strategyEquityChart}\n            };\n\n            var normalizedResults = DrawdownCollection.NormalizeResults(backtest, null);\n\n            Assert.AreEqual(0, normalizedResults.KeyCount);\n            Assert.AreEqual(0, normalizedResults.ValueCount);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Report/PortfolioLooperAlgorithmTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Orders;\nusing QuantConnect.Report;\nusing QuantConnect.Securities;\nusing QuantConnect.Brokerages;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class PortfolioLooperAlgorithmTests\n    {\n        private PortfolioLooperAlgorithm CreateAlgorithm(IEnumerable<Order> orders, AlgorithmConfiguration algorithmConfiguration = null)\n        {\n            var algorithm = new PortfolioLooperAlgorithm(100000m, orders, algorithmConfiguration);\n\n            // Create MHDB and Symbol properties DB instances for the DataManager\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n            var symbolPropertiesDataBase = SymbolPropertiesDatabase.FromDataFolder();\n            var dataPermissionManager = new DataPermissionManager();\n            var dataManager = new DataManager(new QuantConnect.Report.MockDataFeed(),\n                new UniverseSelection(\n                    algorithm,\n                    new SecurityService(algorithm.Portfolio.CashBook,\n                        marketHoursDatabase,\n                        symbolPropertiesDataBase,\n                        algorithm,\n                        RegisteredSecurityDataTypesProvider.Null,\n                        new SecurityCacheProvider(algorithm.Portfolio),\n                        algorithm: algorithm),\n                    dataPermissionManager,\n                    TestGlobals.DataProvider),\n                algorithm,\n                algorithm.TimeKeeper,\n                marketHoursDatabase,\n                false,\n                RegisteredSecurityDataTypesProvider.Null,\n                dataPermissionManager);\n\n            var securityService = new SecurityService(algorithm.Portfolio.CashBook,\n                marketHoursDatabase,\n                symbolPropertiesDataBase,\n                algorithm,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(algorithm.Portfolio),\n                algorithm: algorithm);\n\n            // Initialize security services and other properties so that we\n            // don't get null reference exceptions during our re-calculation\n            algorithm.Securities.SetSecurityService(securityService);\n            algorithm.SubscriptionManager.SetDataManager(dataManager);\n\n            return algorithm;\n        }\n\n        [Test]\n        public void Algorithm_CanSetLeverageOnAllSecurityTypes()\n        {\n            var orders = new Symbol[]\n            {\n                Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 120m, new DateTime(2020, 5, 21)),\n                Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda),\n                Symbol.Create(\"XAUUSD\", SecurityType.Cfd, Market.Oanda),\n                Symbol.CreateFuture(Futures.Energy.CrudeOilWTI, Market.NYMEX, new DateTime(2020, 5, 21)),\n                Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase)\n            }.Select(s => new MarketOrder(s, 1m, new DateTime(2020, 1, 1))).ToList();\n\n            var algorithm = CreateAlgorithm(orders);\n            Assert.DoesNotThrow(() => algorithm.FromOrders(orders));\n        }\n\n        [Test]\n        public void Algorithm_UsesExpectedLeverageOnAllSecurityTypes()\n        {\n            var orders = new Symbol[]\n            {\n                Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA),\n                Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 120m, new DateTime(2020, 5, 21)),\n                Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.Oanda),\n                Symbol.Create(\"XAUUSD\", SecurityType.Cfd, Market.Oanda),\n                Symbol.CreateFuture(Futures.Energy.CrudeOilWTI, Market.NYMEX, new DateTime(2020, 5, 21)),\n                Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.Coinbase)\n            }.Select(s => new MarketOrder(s, 1m, new DateTime(2020, 1, 1)));\n\n            var algorithm = CreateAlgorithm(orders);\n\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Equity).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 10000m));\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Option).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 1m));\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Forex).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 10000m));\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Cfd).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 10000m));\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Future).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 1m));\n            Assert.IsTrue(algorithm.Securities.Where(x => x.Key.SecurityType == SecurityType.Crypto).All(x => x.Value.BuyingPowerModel.GetLeverage(x.Value) == 10000m));\n        }\n\n        [TestCase(\"BTC\", BrokerageName.Binance, AccountType.Cash)]\n        [TestCase(\"USDT\", BrokerageName.Coinbase, AccountType.Cash)]\n        [TestCase(\"EUR\", BrokerageName.Bitfinex, AccountType.Margin)]\n        public void SetsTheRightAlgorithmConfiguration(string currency, BrokerageName brokerageName, AccountType accountType)\n        {\n            var algorithm = CreateAlgorithm(new List<Order>(),\n                new AlgorithmConfiguration(\"AlgorightmName\", new HashSet<string>(), currency, brokerageName, accountType,\n                    new Dictionary<string, string>(), DateTime.MinValue, DateTime.MinValue, null));\n            algorithm.Initialize();\n\n            Assert.AreEqual(currency, algorithm.AccountCurrency);\n            Assert.AreEqual(brokerageName, BrokerageModel.GetBrokerageName(algorithm.BrokerageModel));\n            Assert.AreEqual(accountType, algorithm.BrokerageModel.AccountType);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Report/PortfolioLooperTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Deedle;\nusing NUnit.Framework;\nusing QuantConnect.Orders;\nusing QuantConnect.Report;\nusing QuantConnect.Brokerages;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class PortfolioLooperTests\n    {\n        [Test]\n        public void EmptyEquitySeriesDoesNotCrash()\n        {\n            var equityPoints = new SortedList<DateTime, double>\n            {\n                { new DateTime(2019, 1, 3, 5, 0, 5), 100000 }\n            };\n            var series = new Series<DateTime, double>(equityPoints);\n            var order = new MarketOrder(Symbols.SPY, 1m, new DateTime(2019, 1, 3, 5, 0, 0));\n\n            // Force an order ID >= 1 on the order, otherwise the test will fail\n            // because the order will be filtered out.\n            order.GetType().GetProperty(\"Id\").SetValue(order, 1);\n\n            var orders = new List<Order>\n            {\n                order\n            };\n\n            Assert.DoesNotThrow(() => PortfolioLooper.FromOrders(series, orders).ToList());\n        }\n\n        [TestCase(OrderType.Market, 0, 0)]\n        [TestCase(OrderType.Limit, 0, 80000)]\n        [TestCase(OrderType.StopLimit, 80000, 80000)]\n        [TestCase(OrderType.StopMarket, 80000, 0)]\n        [TestCase(OrderType.MarketOnOpen, 0, 0, true)]\n        [TestCase(OrderType.MarketOnClose, 0, 0, true)]\n        public void OrderProcessedInLooper(OrderType orderType, double stopPrice, double limitPrice, bool hasNullLastFillTime = false)\n        {\n            var equityPoints = new SortedList<DateTime, double>\n            {\n                { new DateTime(2019, 1, 3, 5, 0, 5), 100000 },\n                { new DateTime(2019, 1, 4, 5, 0, 5), 90000 },\n            };\n\n            var series = new Series<DateTime, double>(equityPoints);\n            var entryOrder = Order.CreateOrder(new SubmitOrderRequest(\n                orderType,\n                SecurityType.Equity,\n                Symbols.SPY,\n                1,\n                (decimal)stopPrice,\n                (decimal)limitPrice,\n                new DateTime(2019, 1, 3, 5, 0, 5),\n                string.Empty\n            ));\n            var exitOrder = Order.CreateOrder(new SubmitOrderRequest(\n                orderType,\n                SecurityType.Equity,\n                Symbols.SPY,\n                -1,\n                (decimal)stopPrice,\n                (decimal)limitPrice,\n                new DateTime(2019, 1, 4, 5, 0, 5),\n                string.Empty\n            ));\n\n            if (!hasNullLastFillTime)\n            {\n                entryOrder.LastFillTime = new DateTime(2019, 1, 3, 5, 0, 5);\n                exitOrder.LastFillTime = new DateTime(2019, 1, 4, 5, 0, 5);\n            }\n\n            entryOrder.GetType().GetProperty(\"Id\").SetValue(entryOrder, 1);\n            entryOrder.GetType().GetProperty(\"Price\").SetValue(entryOrder, 100000m);\n            Order marketOnFillOrder = null;\n            if (hasNullLastFillTime)\n            {\n                marketOnFillOrder = entryOrder.Clone();\n                marketOnFillOrder.GetType().GetProperty(\"Status\").SetValue(marketOnFillOrder, OrderStatus.Filled);\n                marketOnFillOrder.GetType().GetProperty(\"Time\").SetValue(marketOnFillOrder, new DateTime(2019, 1, 3, 6, 0 ,5));\n            }\n            exitOrder.GetType().GetProperty(\"Id\").SetValue(exitOrder, 2);\n            exitOrder.GetType().GetProperty(\"Price\").SetValue(exitOrder, 80000m);\n            exitOrder.GetType().GetProperty(\"Status\").SetValue(exitOrder, OrderStatus.Filled);\n\n            var orders = new[] { entryOrder, marketOnFillOrder, exitOrder }.Where(x => x != null);\n\n            var looper = PortfolioLooper.FromOrders(series, orders);\n            var pointInTimePortfolio = looper.ToList();\n\n            Assert.AreEqual(3, pointInTimePortfolio.Count);\n            Assert.AreEqual(100000, pointInTimePortfolio[0].TotalPortfolioValue);\n            Assert.AreEqual(80000, pointInTimePortfolio[1].TotalPortfolioValue);\n            Assert.AreEqual(80000, pointInTimePortfolio[2].TotalPortfolioValue);\n        }\n\n        [Test]\n        public void OptionOrderDoesNotThrow()\n        {\n            var equityPoints = new SortedList<DateTime, double>\n            {\n                { new DateTime(2019, 1, 3, 5, 0, 5), 100000 },\n                { new DateTime(2019, 1, 4, 5, 0, 5), 90000 },\n            };\n\n            var series = new Series<DateTime, double>(equityPoints);\n            var equity = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n            var optionSid = SecurityIdentifier.GenerateOption(\n                equity.ID.Date,\n                equity.ID,\n                equity.ID.Market,\n                200m,\n                OptionRight.Call,\n                OptionStyle.American);\n            var option = new Symbol(optionSid, optionSid.Symbol);\n\n            var entryOrder = Order.CreateOrder(new SubmitOrderRequest(\n                OrderType.Market,\n                SecurityType.Option,\n                option,\n                1,\n                0m,\n                0m,\n                new DateTime(2019, 1, 3, 5, 0, 5),\n                string.Empty\n            ));\n            var exitOrder = Order.CreateOrder(new SubmitOrderRequest(\n                OrderType.Market,\n                SecurityType.Option,\n                option,\n                -1,\n                0m,\n                0m,\n                new DateTime(2019, 1, 4, 5, 0, 5),\n                string.Empty\n            ));\n\n            entryOrder.LastFillTime = new DateTime(2019, 1, 3, 5, 0, 5);\n            exitOrder.LastFillTime = new DateTime(2019, 1, 4, 5, 0, 5);\n\n            entryOrder.GetType().GetProperty(\"Id\").SetValue(entryOrder, 1);\n            entryOrder.GetType().GetProperty(\"Price\").SetValue(entryOrder, 100000m);\n\n            Order marketOnFillOrder = null;\n            exitOrder.GetType().GetProperty(\"Id\").SetValue(exitOrder, 2);\n            exitOrder.GetType().GetProperty(\"Price\").SetValue(exitOrder, 80000m);\n            exitOrder.GetType().GetProperty(\"Status\").SetValue(exitOrder, OrderStatus.Filled);\n\n            var orders = new[] { entryOrder, marketOnFillOrder, exitOrder }.Where(x => x != null);\n\n            var looper = PortfolioLooper.FromOrders(series, orders);\n            Assert.DoesNotThrow(() =>\n            {\n                foreach (var pointInTimePortfolio in looper)\n                {\n                    Assert.AreEqual(option, pointInTimePortfolio.Order.Symbol);\n                    Assert.AreEqual(option.Underlying, pointInTimePortfolio.Order.Symbol.Underlying);\n                }\n            });\n        }\n\n        [TestCase(\"BNTUSDT\", \"USDT\")]\n        [TestCase(\"AUDBUSD\", \"BUSD\")]\n        public void OrderProcessedInLooper_WithNonDefaultAlgorithmSettings(string symbol, string currency)\n        {\n            var equityPoints = new SortedList<DateTime, double>\n            {\n                { new DateTime(2020, 2, 12, 20, 0, 0), 100000 },\n                { new DateTime(2020, 2, 13, 20, 0, 0), 900000 },\n            };\n            var series = new Series<DateTime, double>(equityPoints);\n            var orderPrice = 0.35m;\n            var orderQuantity = 30000m;\n            var order = Order.CreateOrder(new SubmitOrderRequest(\n                OrderType.Market,\n                SecurityType.Crypto,\n                Symbol.Create(symbol, SecurityType.Crypto, Market.Binance),\n                orderQuantity,\n                0m,\n                0m,\n                new DateTime(2020, 2, 12, 20, 0, 0),\n                string.Empty\n            ));\n            order.LastFillTime = new DateTime(2020, 2, 12, 20, 0, 0);\n            order.GetType().GetProperty(\"Id\").SetValue(order, 1);\n            order.GetType().GetProperty(\"Status\").SetValue(order, OrderStatus.Filled);\n            order.GetType().GetProperty(\"Price\").SetValue(order, orderPrice);\n            var orders = new[] { order };\n\n            var looper = PortfolioLooper.FromOrders(series, orders,\n                new AlgorithmConfiguration(\"AlgorightmName\", new HashSet<string>(), currency, BrokerageName.Binance, AccountType.Cash,\n                    new Dictionary<string, string>(), DateTime.MinValue, DateTime.MinValue, null, 0));\n            var pointInTimePortfolio = looper.ToList();\n\n            Assert.AreEqual(2, pointInTimePortfolio.Count);\n            Assert.AreEqual(100000m, pointInTimePortfolio[0].TotalPortfolioValue);\n\n            var holdings = pointInTimePortfolio[0].Holdings;\n            Assert.AreEqual(1, holdings.Count);\n            Assert.AreEqual(orderQuantity, holdings[0].Quantity);\n            Assert.AreEqual(orderQuantity * orderPrice, holdings[0].HoldingsValue);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Report/ReportChartsTest.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Python.Runtime;\nusing QuantConnect.Packets;\nusing QuantConnect.Report;\nusing Newtonsoft.Json;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class ReportChartTests\n    {\n        [Test]\n        public void RunsAllReportChartTests()\n        {\n            using (Py.GIL())\n            {\n                var code = File.ReadAllText(\"../../../Report/ReportChartTests.py\");\n                using var scope = Py.CreateScope();\n                Assert.DoesNotThrow(() => scope.Exec(code));\n            }\n        }\n\n        [Test]\n        public void ExposureReportWorksForEverySecurityType()\n        {\n            var backtestResult = GetBacktestResult();\n            QuantConnect.Report.Report report = null;\n\n            Assert.DoesNotThrow(() => report = new QuantConnect.Report.Report(\"Report\", \"Report\", \"v1.0.0\", backtestResult, (LiveResult)null));\n            string html = \"\";\n            Assert.DoesNotThrow(() => report.Compile(out html, out _));\n            Assert.IsNotEmpty(html);\n        }\n\n        [Test]\n        public void ReportChartsColorMapWorksForEverySecurityType()\n        {\n            using (Py.GIL())\n            {\n                var reportChartsModule = Py.Import(\"ReportCharts\");\n                var reportChartsClass = reportChartsModule.GetAttr(\"ReportCharts\");\n                dynamic colorMap = reportChartsClass.GetAttr(\"color_map\");\n                var chartSecurities = new HashSet<string>();\n\n                foreach (string security in colorMap.keys())\n                {\n                    chartSecurities.Add(security);\n                }\n\n                foreach (var security in Enum.GetValues(typeof(SecurityType)))\n                {\n                    if (security.ToString() != \"Base\" && security.ToString() != \"Index\")\n                    {\n                        Assert.IsTrue(chartSecurities.Contains(security.ToString()), $\"{security} SecurityType is not present in ReportCharts.py color_map dictionary\");\n                    }\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(CurrencySymbols))]\n        public void EstimatedCapacityIsParsedRegardlessOfTheCurrency(string currencySymbol)\n        {\n            var backtestResult = new BacktestResult()\n            {\n                Statistics = new Dictionary<string, string>(){ { \"Estimated Strategy Capacity\", $\"{currencySymbol}1,000,000.00\" } }\n            };\n            QuantConnect.Report.ReportElements.EstimatedCapacityReportElement element = new(\"\", \"\", backtestResult, new LiveResult());\n\n            Assert.DoesNotThrow(() => element.Render());\n        }\n\n        [Test, Sequential]\n        public void ProperlyRendersEstimatedCapacity(\n            [Values(999d, 9999d, 99999d, 999999d, 9999999d, 99999999d, 999999999d, 9999999999d)] decimal capacity,\n            [Values(\"1K\", \"10K\", \"100K\", \"1M\", \"10M\", \"100M\", \"1B\", \"10B\")] string expectedRenderedCapacity)\n        {\n            var backtestResult = new BacktestResult()\n            {\n                Statistics = new Dictionary<string, string>() { { \"Estimated Strategy Capacity\", $\"${capacity}\" } }\n            };\n            QuantConnect.Report.ReportElements.EstimatedCapacityReportElement element = new(\"\", \"\", backtestResult, new LiveResult());\n\n            string renderedCapacity = element.Render();\n            Assert.AreEqual(expectedRenderedCapacity, renderedCapacity);\n        }\n\n        [TestCase(\"€\")]\n        [TestCase(\"Fr\")]\n        [TestCase(\"ZRX\")]\n        public void GeneratesReportWithNonUSDCurrency(string currencySymbol)\n        {\n            var backtestResult = GetBacktestResult();\n            var capacity = backtestResult.Statistics[\"Estimated Strategy Capacity\"];\n            backtestResult.Statistics[\"Estimated Strategy Capacity\"] = capacity.Replace(\"$\", currencySymbol, StringComparison.Ordinal);\n            QuantConnect.Report.Report report = null;\n\n            Assert.DoesNotThrow(() => report = new QuantConnect.Report.Report(\"Report\", \"Report\", \"v1.0.0\", backtestResult, (LiveResult)null));\n            string html = \"\";\n            Assert.DoesNotThrow(() => report.Compile(out html, out _));\n            Assert.IsNotEmpty(html);\n        }\n\n        static BacktestResult GetBacktestResult()\n        {\n            var backtestSettings = new JsonSerializerSettings\n            {\n                Converters = new List<JsonConverter> { new NullResultValueTypeJsonConverter<BacktestResult>() },\n                FloatParseHandling = FloatParseHandling.Decimal\n            };\n            var backtest = JsonConvert.DeserializeObject<BacktestResult>(\n                File.ReadAllText(Path.Combine(\"TestData\", \"test_report_data.json\")), backtestSettings);\n\n            return backtest;\n        }\n\n        static IEnumerable<string> CurrencySymbols => Currencies.CurrencySymbols.Values.Distinct();\n    }\n}\n"
  },
  {
    "path": "Tests/Report/ResultDeserializationTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json;\nusing NUnit.Framework;\nusing QuantConnect.Api;\nusing QuantConnect.Orders;\nusing QuantConnect.Packets;\nusing QuantConnect.Report;\nusing QuantConnect.Report.ReportElements;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static QuantConnect.Report.Report;\n\nnamespace QuantConnect.Tests.Report\n{\n    [TestFixture]\n    public class ResultDeserializationTests\n    {\n        private const string OrderStringReplace = \"{{orderStringReplace}}\";\n        private const string OrderTypeStringReplace = \"{{marketOrderType}}\";\n        private const string EmptyJson = \"{}\";\n\n        private const string ValidBacktestResultJson2 = \"{\\\"backtest\\\":{\\\"note\\\":null,\\\"name\\\":\\\"Emotional Black Mosquito\\\",\\\"organizationId\\\":99568,\\\"projectId\\\":15863659,\\\"completed\\\":true,\\\"optimizationId\\\":null,\\\"backtestId\\\"\" +\n            \":\\\"2d5e2342b73ffb04bfa6ff4a505e3cad\\\",\\\"tradeableDates\\\":381,\\\"researchGuide\\\":{\\\"minutes\\\":1,\\\"backtestCount\\\":1,\\\"parameters\\\":0},\\\"backtestStart\\\":\\\"2022-03-10 00:00:00\\\",\\\"backtestEnd\\\":\\\"2023-09-14 23:59:59\\\",\" +\n            \"\\\"created\\\":\\\"2023-09-15 16:23:31\\\",\\\"snapshotId\\\":15863663,\\\"status\\\":\\\"Completed.\\\",\\\"error\\\":null,\\\"stacktrace\\\":null,\\\"progress\\\":1,\\\"profitLoss\\\":[],\\\"hasInitializeError\\\":false,\\\"charts\\\":{\\\"Portfolio Turnover\\\":\" +\n            \"{\\\"Name\\\":\\\"Portfolio Turnover\\\"},\\\"Drawdown\\\":{\\\"Name\\\":\\\"Drawdown\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Equity Drawdown\\\":{\\\"Name\\\":\\\"Equity Drawdown\\\",\\\"Unit\\\":\\\"%\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1646888400,\\\"y\\\":0}\" +\n            \",{\\\"x\\\":1646974800,\\\"y\\\":0}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Exposure\\\":{\\\"Name\\\":\\\"Exposure\\\"},\\\"Universe Analytics\\\":{\\\"Name\\\":\\\"Universe Analytics\\\"},\\\"Strategy Equity\\\":{\\\"Name\\\":\\\"Strategy Equity\\\"\" +\n            \",\\\"LastValue\\\":null},\\\"Capacity\\\":{\\\"Name\\\":\\\"Capacity\\\"},\\\"Benchmark\\\":{\\\"Name\\\":\\\"Benchmark\\\"}},\\\"parameterSet\\\":[],\\\"alphaRuntimeStatistics\\\":null,\\\"runtimeStatistics\\\":{\\\"Equity\\\":\\\"$100,000.00\\\",\\\"Fees\\\":\\\"-$0.00\\\",\" +\n            \"\\\"Holdings\\\":\\\"$0.00\\\",\\\"Net Profit\\\":\\\"$0.00\\\",\\\"Probabilistic Sharpe Ratio\\\":\\\"0%\\\",\\\"Return\\\":\\\"0.00 %\\\",\\\"Unrealized\\\":\\\"$0.00\\\",\\\"Volume\\\":\\\"$0.00\\\"},\\\"statistics\\\":{\\\"Total Trades\\\":\\\"0\\\",\\\"Average Win\\\":\\\"0%\\\",\" +\n            \"\\\"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\\\"\" +\n            \":\\\"0%\\\",\\\"Profit-Loss Ratio\\\":\\\"0\\\",\\\"Alpha\\\":\\\"0\\\",\\\"Beta\\\":\\\"0\\\",\\\"Annual Standard Deviation\\\":\\\"0\\\",\\\"Annual Variance\\\":\\\"0\\\",\\\"Information Ratio\\\":\\\"-0.309\\\",\\\"Tracking Error\\\":\\\"0.169\\\",\\\"Treynor Ratio\\\":\\\"0\\\"\" +\n            \",\\\"Total Fees\\\":\\\"$0.00\\\",\\\"Estimated Strategy Capacity\\\":\\\"$0\\\",\\\"Lowest Capacity Asset\\\":\\\"\\\",\\\"Portfolio Turnover\\\":\\\"0%\\\"},\\\"totalPerformance\\\":{\\\"TradeStatistics\\\":{\\\"StartDateTime\\\":null,\\\"EndDateTime\\\":null,\" +\n            \"\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\"\" +\n            \":\\\"0\\\",\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\" +\n            \"\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\" +\n            \"\\\"LossRate\\\":\\\"0\\\",\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\" +\n            \"\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\\\"MaximumDrawdownDuration\\\"\" +\n            \":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"},\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\\\"0\\\"\" +\n            \",\\\"Drawdown\\\":\\\"0\\\",\\\"TotalNetProfit\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"ProbabilisticSharpeRatio\\\":\\\"0\\\",\\\"Alpha\\\":\\\"0\\\",\\\"Beta\\\":\\\"0\\\",\\\"AnnualStandardDeviation\\\":\\\"0\\\",\\\"AnnualVariance\\\":\\\"0\\\",\\\"InformationRatio\\\":\\\"-0.3094\\\",\" +\n            \"\\\"TrackingError\\\":\\\"0.1686\\\",\\\"TreynorRatio\\\":\\\"0\\\",\\\"PortfolioTurnover\\\":\\\"0\\\"},\\\"ClosedTrades\\\":[]},\\\"signals\\\":null,\\\"nodeName\\\":\\\"B8-16 node 1ed393c8\\\"},\\\"success\\\":true}\";\n\n        private const string ValidBacktestResultJson = \"{\\\"RollingWindow\\\":{\\\"M1_20131011\\\":{\\\"TradeStatistics\\\":{\\\"StartDateTime\\\":null,\\\"EndDateTime\\\":null,\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\":\\\"0\\\",\" +\n            \"\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\" +\n            \"\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\" +\n            \"\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\\\"MaximumDrawdownDuration\\\":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"},\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\" +\n            \"\\\"2.7145\\\",\\\"Drawdown\\\":\\\"0.022\\\",\\\"TotalNetProfit\\\":\\\"0.0169\\\",\\\"SharpeRatio\\\":\\\"8.8881\\\",\\\"ProbabilisticSharpeRatio\\\":\\\"0.6761\\\",\\\"Alpha\\\":\\\"-0.0049\\\",\\\"Beta\\\":\\\"0.9961\\\",\\\"AnnualStandardDeviation\\\":\\\"0.2217\\\",\\\"AnnualVariance\\\":\\\"0.0491\\\",\\\"InformationRatio\\\":\\\"-14.5651\\\",\\\"TrackingError\\\":\\\"0.0009\\\",\\\"TreynorRatio\\\":\\\"1.9780\\\",\\\"PortfolioTurnover\\\":\\\"0.1993\\\"},\" +\n            \"\\\"ClosedTrades\\\":[]},\\\"M3_20131011\\\":{\\\"TradeStatistics\\\":{\\\"StartDateTime\\\":null,\\\"EndDateTime\\\":null,\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\":\\\"0\\\",\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\" +\n            \"\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\" +\n            \"\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\" +\n            \"\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\\\"MaximumDrawdownDuration\\\":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"},\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\\\"2.7145\\\",\\\"Drawdown\\\":\\\"0.022\\\",\\\"TotalNetProfit\\\"\" +\n            \":\\\"0.0169\\\",\\\"SharpeRatio\\\":\\\"8.8881\\\",\\\"ProbabilisticSharpeRatio\\\":\\\"0.6761\\\",\\\"Alpha\\\":\\\"-0.0049\\\",\\\"Beta\\\":\\\"0.9961\\\",\\\"AnnualStandardDeviation\\\":\\\"0.2217\\\",\\\"AnnualVariance\\\":\\\"0.0491\\\",\\\"InformationRatio\\\":\\\"-14.5651\\\",\\\"TrackingError\\\":\\\"0.0009\\\",\\\"TreynorRatio\\\":\\\"1.9780\\\",\\\"PortfolioTurnover\\\":\\\"0.1993\\\"},\\\"ClosedTrades\\\":[]},\\\"M6_20131011\\\":{\\\"TradeStatistics\\\"\" +\n            \":{\\\"StartDateTime\\\":null,\\\"EndDateTime\\\":null,\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\":\\\"0\\\",\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\" +\n            \"\\\"AverageWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\" +\n            \"\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\"\" +\n            \":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\\\"MaximumDrawdownDuration\\\":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"},\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\\\"2.7145\\\",\\\"Drawdown\\\":\\\"0.022\\\",\\\"TotalNetProfit\\\":\\\"0.0169\\\",\\\"SharpeRatio\\\":\" +\n            \"\\\"8.8881\\\",\\\"ProbabilisticSharpeRatio\\\":\\\"0.6761\\\",\\\"Alpha\\\":\\\"-0.0049\\\",\\\"Beta\\\":\\\"0.9961\\\",\\\"AnnualStandardDeviation\\\":\\\"0.2217\\\",\\\"AnnualVariance\\\":\\\"0.0491\\\",\\\"InformationRatio\\\":\\\"-14.5651\\\",\\\"TrackingError\\\":\\\"0.0009\\\",\\\"TreynorRatio\\\":\\\"1.9780\\\",\\\"PortfolioTurnover\\\":\\\"0.1993\\\"},\\\"ClosedTrades\\\":[]},\\\"M12_20131011\\\":{\\\"TradeStatistics\\\":{\\\"StartDateTime\\\"\" +\n            \":null,\\\"EndDateTime\\\":null,\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\":\\\"0\\\",\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageWinningTradeDuration\\\":\" +\n            \"\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\"\" +\n            \":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\" +\n            \"\\\"MaximumDrawdownDuration\\\":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"},\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\\\"2.7145\\\",\\\"Drawdown\\\":\\\"0.022\\\",\\\"TotalNetProfit\\\":\\\"0.0169\\\",\\\"SharpeRatio\\\":\\\"8.8881\\\",\\\"ProbabilisticSharpeRatio\\\"\" +\n            \":\\\"0.6761\\\",\\\"Alpha\\\":\\\"-0.0049\\\",\\\"Beta\\\":\\\"0.9961\\\",\\\"AnnualStandardDeviation\\\":\\\"0.2217\\\",\\\"AnnualVariance\\\":\\\"0.0491\\\",\\\"InformationRatio\\\":\\\"-14.5651\\\",\\\"TrackingError\\\":\\\"0.0009\\\",\\\"TreynorRatio\\\":\\\"1.9780\\\",\\\"PortfolioTurnover\\\":\\\"0.1993\\\"},\\\"ClosedTrades\\\":[]}},\\\"TotalPerformance\\\":{\\\"TradeStatistics\\\":{\\\"StartDateTime\\\":null,\\\"EndDateTime\\\":null,\" +\n            \"\\\"TotalNumberOfTrades\\\":0,\\\"NumberOfWinningTrades\\\":0,\\\"NumberOfLosingTrades\\\":0,\\\"TotalProfitLoss\\\":\\\"0\\\",\\\"TotalProfit\\\":\\\"0\\\",\\\"TotalLoss\\\":\\\"0\\\",\\\"LargestProfit\\\":\\\"0\\\",\\\"LargestLoss\\\":\\\"0\\\",\\\"AverageProfitLoss\\\":\\\"0\\\",\\\"AverageProfit\\\":\\\"0\\\",\\\"AverageLoss\\\":\\\"0\\\",\\\"AverageTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"AverageLosingTradeDuration\\\"\" +\n            \":\\\"00:00:00\\\",\\\"MedianTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianWinningTradeDuration\\\":\\\"00:00:00\\\",\\\"MedianLosingTradeDuration\\\":\\\"00:00:00\\\",\\\"MaxConsecutiveWinningTrades\\\":0,\\\"MaxConsecutiveLosingTrades\\\":0,\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"AverageMAE\\\":\\\"0\\\",\\\"AverageMFE\\\":\\\"0\\\",\\\"LargestMAE\\\":\\\"0\\\",\\\"LargestMFE\\\":\\\"0\\\"\" +\n            \",\\\"MaximumClosedTradeDrawdown\\\":\\\"0\\\",\\\"MaximumIntraTradeDrawdown\\\":\\\"0\\\",\\\"ProfitLossStandardDeviation\\\":\\\"0\\\",\\\"ProfitLossDownsideDeviation\\\":\\\"0\\\",\\\"ProfitFactor\\\":\\\"0\\\",\\\"SharpeRatio\\\":\\\"0\\\",\\\"SortinoRatio\\\":\\\"0\\\",\\\"ProfitToMaxDrawdownRatio\\\":\\\"0\\\",\\\"MaximumEndTradeDrawdown\\\":\\\"0\\\",\\\"AverageEndTradeDrawdown\\\":\\\"0\\\",\\\"MaximumDrawdownDuration\\\":\\\"00:00:00\\\",\\\"TotalFees\\\":\\\"0\\\"}\" +\n            \",\\\"PortfolioStatistics\\\":{\\\"AverageWinRate\\\":\\\"0\\\",\\\"AverageLossRate\\\":\\\"0\\\",\\\"ProfitLossRatio\\\":\\\"0\\\",\\\"WinRate\\\":\\\"0\\\",\\\"LossRate\\\":\\\"0\\\",\\\"Expectancy\\\":\\\"0\\\",\\\"CompoundingAnnualReturn\\\":\\\"2.7145\\\",\\\"Drawdown\\\":\\\"0.022\\\",\\\"TotalNetProfit\\\":\\\"0.0169\\\",\\\"SharpeRatio\\\":\\\"8.8881\\\",\\\"ProbabilisticSharpeRatio\\\":\\\"0.6761\\\",\\\"Alpha\\\":\\\"-0.0049\\\",\\\"Beta\\\":\\\"0.9961\\\",\\\"AnnualStandardDeviation\\\"\" +\n            \":\\\"0.2217\\\",\\\"AnnualVariance\\\":\\\"0.0491\\\",\\\"InformationRatio\\\":\\\"-14.5651\\\",\\\"TrackingError\\\":\\\"0.0009\\\",\\\"TreynorRatio\\\":\\\"1.9780\\\",\\\"PortfolioTurnover\\\":\\\"0.1993\\\"},\\\"ClosedTrades\\\":[]},\\\"Charts\\\":{\\\"Drawdown\\\":{\\\"Name\\\":\\\"Drawdown\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Equity Drawdown\\\":{\\\"Name\\\":\\\"Equity Drawdown\\\",\\\"Unit\\\":\\\"%\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381118400\" +\n            \",\\\"y\\\":0.0},{\\\"x\\\":1381204800,\\\"y\\\":-0.02},{\\\"x\\\":1381291200,\\\"y\\\":-1.18},{\\\"x\\\":1381377600,\\\"y\\\":-1.12},{\\\"x\\\":1381464000,\\\"y\\\":0.0},{\\\"x\\\":1381521600,\\\"y\\\":0.0}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Strategy Equity\\\":{\\\"Name\\\":\\\"Strategy Equity\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Equity\\\":{\\\"Name\\\":\\\"Equity\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":2,\\\"Values\\\":\" +\n            \"[[1381118400,100000.0,100000.0,100000.0,100000.0],[1381152660,99990.6114,99990.6114,99990.6114,99990.6114],[1381152960,99948.971,100056.0463,99895.4333,100056.0463],[1381153260,99984.6627,100020.3545,99984.6627,100008.4573],[1381153560,100073.8922,100127.4299,100073.8922,100097.6867],[1381153860,100139.3271,100234.5052,100139.3271,100234.5052],[1381154160,100204.7621,100204.7621,100157.173,100157.173],\" +\n            \"[1381154460,100139.3271,100180.9676,100139.3271,100169.0703],[1381154760,100115.5326,100145.2758,100103.6354,100145.2758],[1381155060,100210.7107,100371.3238,100210.7107,100365.3751],[1381155360,100359.4265,100424.8614,100359.4265,100401.0669],[1381155660,100395.1183,100442.7073,100377.2724,100442.7073],[1381155960,100436.7587,100490.2964,100407.0155,100466.5018],[1381156260,100496.245,100514.0909\" +\n            \",100460.5532,100514.0909],[1381156560,100537.8854,100537.8854,100430.8101,100430.8101],[1381156860,100407.0155,100424.8614,100407.0155,100418.9128],[1381157160,100407.0155,100407.0155,100383.221,100383.221],[1381157460,100424.8614,100454.6046,100418.9128,100424.8614],[1381157760,100442.7073,100484.3477,100442.7073,100460.5532],[1381158060,100424.8614,100436.7587,100424.8614,100424.8614],\" +\n            \"[1381158360,100341.5806,100353.4779,100323.7347,100341.5806],[1381158660,100347.5292,100395.1183,100335.632,100395.1183],[1381158960,100418.9128,100418.9128,100329.6833,100329.6833],[1381159260,100341.5806,100341.5806,100288.0429,100311.8374],[1381159560,100341.5806,100359.4265,100341.5806,100359.4265],[1381159860,100347.5292,100359.4265,100329.6833,100341.5806],[1381160160,100329.6833,100472.4505,\" +\n            \"100329.6833,100472.4505],[1381160460,100466.5018,100466.5018,100424.8614,100436.7587],[1381160760,100424.8614,100484.3477,100407.0155,100484.3477],[1381161060,100496.245,100537.8854,100484.3477,100537.8854],[1381161360,100525.9882,100525.9882,100472.4505,100484.3477],[1381161660,100484.3477,100490.2964,100430.8101,100430.8101],[1381161960,100401.0669,100424.8614,100395.1183,100407.0155],[1381162260,\" +\n            \"100430.8101,100460.5532,100418.9128,100436.7587],[1381162560,100424.8614,100430.8101,100418.9128,100430.8101],[1381162860,100436.7587,100436.7587,100424.8614,100430.8101],[1381163160,100377.2724,100395.1183,100377.2724,100377.2724],[1381163460,100359.4265,100359.4265,100228.5566,100228.5566],[1381163760,100222.608,100293.9916,100222.608,100264.2484],[1381164060,100282.0943,100282.0943,100258.2998,\" +\n            \"100258.2998],[1381164360,100282.0943,100323.7347,100276.1457,100323.7347],[1381164660,100335.632,100335.632,100299.9402,100323.7347],[1381164960,100341.5806,100341.5806,100317.7861,100317.7861],[1381165260,100323.7347,100323.7347,100216.6593,100276.1457],[1381165560,100317.7861,100317.7861,100264.2484,100264.2484],[1381165860,100246.4025,100299.9402,100240.4539,100299.9402],[1381166160,100365.3751\" +\n            \",100365.3751,100341.5806,100365.3751],[1381166460,100395.1183,100395.1183,100377.2724,100383.221],[1381166760,100383.221,100383.221,100365.3751,100377.2724],[1381167060,100365.3751,100407.0155,100335.632,100407.0155],[1381167360,100395.1183,100395.1183,100359.4265,100389.1696],[1381167660,100365.3751,100365.3751,100293.9916,100317.7861],[1381167960,100311.8374,100335.632,100299.9402,100323.7347]\" +\n            \",[1381168260,100347.5292,100359.4265,100329.6833,100329.6833],[1381168560,100353.4779,100383.221,100347.5292,100383.221],[1381168860,100418.9128,100514.0909,100418.9128,100514.0909],[1381169160,100514.0909,100543.8341,100496.245,100496.245],[1381169460,100430.8101,100430.8101,100389.1696,100424.8614],[1381169760,100454.6046,100454.6046,100407.0155,100418.9128],[1381170060,100418.9128,100454.6046\" +\n            \",100383.221,100436.7587],[1381170360,100412.9642,100430.8101,100412.9642,100424.8614],[1381170660,100412.9642,100448.656,100383.221,100436.7587],[1381170960,100448.656,100454.6046,100442.7073,100454.6046],[1381171260,100496.245,100496.245,100442.7073,100442.7073],[1381171560,100430.8101,100430.8101,100359.4265,100383.221],[1381171860,100395.1183,100442.7073,100395.1183,100442.7073],[1381172160\" +\n            \",100418.9128,100472.4505,100401.0669,100472.4505],[1381172460,100484.3477,100484.3477,100454.6046,100454.6046],[1381172760,100430.8101,100472.4505,100430.8101,100436.7587],[1381173060,100436.7587,100454.6046,100418.9128,100454.6046],[1381173360,100448.656,100448.656,100430.8101,100448.656],[1381173660,100418.9128,100436.7587,100383.221,100383.221],[1381173960,100341.5806,100341.5806,100299.9402\" +\n            \",100299.9402],[1381174260,100288.0429,100305.8888,100288.0429,100293.9916],[1381174560,100276.1457,100293.9916,100228.5566,100228.5566],[1381174860,100240.4539,100246.4025,100198.8135,100198.8135],[1381175160,100169.0703,100228.5566,100169.0703,100180.9676],[1381175460,100121.4813,100145.2758,100103.6354,100139.3271],[1381175760,100121.4813,100127.4299,100044.149,100044.149],[1381204800,100109.584\" +\n            \",100127.4299,99978.7141,99978.7141],[1381239060,100026.3032,100026.3032,100026.3032,100026.3032],[1381239360,99978.7141,100008.4573,99919.2278,99919.2278],[1381239660,99895.4333,99895.4333,99776.4607,99776.4607],[1381239960,99806.2038,100014.4059,99806.2038,100014.4059],[1381240260,100014.4059,100014.4059,99895.4333,99895.4333],[1381240560,99853.7929,100061.9949,99853.7929,100061.9949],[1381240860\" +\n            \",100038.2004,100050.0977,100020.3545,100020.3545],[1381241160,99907.3305,99978.7141,99877.5874,99978.7141],[1381241460,99943.0223,99943.0223,99829.9983,99829.9983],[1381241760,99883.536,99931.1251,99883.536,99931.1251],[1381242060,99937.0737,100014.4059,99937.0737,100014.4059],[1381242360,99978.7141,99996.56,99966.8168,99966.8168],[1381242660,99960.8682,100014.4059,99954.9196,99954.9196],[1381242960\" +\n            \",99895.4333,99907.3305,99877.5874,99895.4333],[1381243260,99913.2792,99913.2792,99841.8956,99841.8956],[1381243560,99853.7929,99907.3305,99853.7929,99907.3305],[1381243860,99806.2038,99806.2038,99586.1045,99586.1045],[1381244160,99633.6935,99633.6935,99574.2072,99574.2072],[1381244460,99568.2586,99586.1045,99532.5668,99532.5668],[1381244760,99520.6695,99520.6695,99419.5428,99490.9264],[1381245060\" +\n            \",99508.7723,99609.899,99508.7723,99609.899],[1381245360,99592.0531,99627.7449,99562.3099,99562.3099],[1381245660,99580.1558,99580.1558,99532.5668,99550.4127],[1381245960,99562.3099,99598.0017,99520.6695,99598.0017],[1381246260,99550.4127,99550.4127,99490.9264,99490.9264],[1381246560,99461.1832,99473.0805,99366.0051,99366.0051],[1381246860,99395.7483,99395.7483,99312.4674,99342.2106],[1381247160\" +\n            \",99294.6215,99360.0565,99294.6215,99318.4161],[1381247460,99252.9811,99258.9298,99205.3921,99258.9298],[1381247760,99282.7243,99306.5188,99270.827,99300.5702],[1381248060,99300.5702,99342.2106,99270.827,99270.827],[1381248360,99258.9298,99306.5188,99258.9298,99282.7243],[1381248660,99264.8784,99306.5188,99223.238,99270.827],[1381248960,99229.1866,99270.827,99223.238,99223.238],[1381249260,99235.1352,\" +\n            \"99235.1352,99193.4948,99193.4948],[1381249560,99181.5976,99193.4948,99134.0085,99134.0085],[1381249860,99145.9058,99199.4434,99128.0599,99128.0599],[1381250160,99116.1626,99116.1626,99074.5222,99104.2653],[1381250460,99169.7003,99175.6489,99151.8544,99151.8544],[1381250760,99169.7003,99318.4161,99169.7003,99318.4161],[1381251060,99312.4674,99324.3647,99288.6729,99288.6729],[1381251360,99247.0325\" +\n            \",99247.0325,99211.3407,99229.1866],[1381251660,99247.0325,99312.4674,99247.0325,99312.4674],[1381251960,99348.1592,99348.1592,99258.9298,99258.9298],[1381252260,99247.0325,99247.0325,99199.4434,99211.3407],[1381252560,99229.1866,99270.827,99181.5976,99181.5976],[1381252860,99187.5462,99193.4948,99122.1112,99122.1112],[1381253160,99122.1112,99193.4948,99122.1112,99187.5462],[1381253460,99235.1352\" +\n            \",99288.6729,99169.7003,99288.6729],[1381253760,99306.5188,99306.5188,99241.0839,99241.0839],[1381254060,99187.5462,99217.2893,99187.5462,99193.4948],[1381254360,99199.4434,99211.3407,99157.803,99169.7003],[1381254660,99151.8544,99151.8544,99092.3681,99134.0085],[1381254960,99122.1112,99151.8544,99110.214,99151.8544],[1381255260,99157.803,99199.4434,99062.6249,99062.6249],[1381255560,99044.779\" +\n            \",99044.779,99003.1386,99032.8818],[1381255860,99015.0359,99026.9331,98967.4468,99026.9331],[1381256160,99009.0873,99050.7277,99003.1386,99003.1386],[1381256460,98955.5496,99009.0873,98937.7037,98937.7037],[1381256760,98937.7037,99116.1626,98937.7037,99098.3167],[1381257060,99157.803,99169.7003,99116.1626,99163.7517],[1381257360,99169.7003,99169.7003,99038.8304,99038.8304],[1381257660,99032.8818\" +\n            \",99080.4708,99026.9331,99074.5222],[1381257960,99032.8818,99086.4195,99020.9845,99020.9845],[1381258260,98991.2414,99020.9845,98967.4468,98967.4468],[1381258560,99020.9845,99020.9845,98955.5496,98955.5496],[1381258860,98979.3441,99086.4195,98979.3441,99086.4195],[1381259160,99092.3681,99128.0599,99092.3681,99092.3681],[1381259460,99116.1626,99116.1626,99009.0873,99026.9331],[1381259760,98973.3955\" +\n            \",99020.9845,98967.4468,98973.3955],[1381260060,99003.1386,99086.4195,99003.1386,99086.4195],[1381260360,99139.9571,99235.1352,99139.9571,99217.2893],[1381260660,99247.0325,99264.8784,99217.2893,99264.8784],[1381260960,99270.827,99270.827,99092.3681,99092.3681],[1381261260,99080.4708,99169.7003,99080.4708,99169.7003],[1381261560,99151.8544,99163.7517,99104.2653,99104.2653],[1381261860,99038.8304,99050.7277\" +\n            \",98979.3441,99050.7277],[1381262160,99003.1386,99020.9845,98890.1146,98890.1146],[1381291200,98836.577,98919.8578,98824.6797,98824.6797],[1381325460,98985.2927,98985.2927,98985.2927,98985.2927],[1381325760,99015.0359,99015.0359,98878.2174,98890.1146],[1381326060,98937.7037,98973.3955,98907.9605,98907.9605],[1381326360,98842.5256,98842.5256,98753.2961,98794.9365],[1381326660,98866.3201,98866.3201,98658.118,98658.118]\" +\n            \",[1381326960,98723.553,98777.0906,98699.7584,98753.2961],[1381327260,98854.4228,98907.9605,98854.4228,98872.2687],[1381327560,98818.7311,98830.6283,98729.5016,98729.5016],[1381327860,98729.5016,98836.577,98729.5016,98777.0906],[1381328160,98741.3989,98818.7311,98717.6043,98818.7311],[1381328460,98800.8852,98800.8852,98741.3989,98794.9365],[1381328760,98747.3475,98985.2927,98747.3475,98985.2927],[1381329060,\" +\n            \"98907.9605,98943.6523,98907.9605,98919.8578],[1381329360,98931.755,99009.0873,98878.2174,98878.2174],[1381329660,98836.577,98890.1146,98836.577,98890.1146],[1381329960,98907.9605,98907.9605,98818.7311,98818.7311],[1381330260,98687.8612,98759.2448,98687.8612,98759.2448],[1381330560,98753.2961,98753.2961,98580.7858,98592.6831],[1381330860,98616.4776,98634.3235,98539.1454,98574.8372],[1381331160,98634.3235,\" +\n            \"98664.0667,98622.4262,98628.3749],[1381331460,98604.5803,98604.5803,98449.9159,98449.9159],[1381331760,98485.6077,98485.6077,98402.3269,98402.3269],[1381332060,98390.4296,98420.1728,98342.8406,98342.8406],[1381332360,98283.3543,98336.8919,98283.3543,98336.8919],[1381332660,98390.4296,98426.1214,98390.4296,98426.1214],[1381332960,98473.7105,98551.0427,98473.7105,98491.5564]\" +\n            \",[1381333260,98503.4536,98539.1454,98461.8132,98485.6077]]},\\\"Daily Performance\\\":{\\\"Name\\\":\\\"Daily Performance\\\",\\\"Unit\\\":\\\"%\\\",\\\"Index\\\":1,\\\"SeriesType\\\":3,\\\"Values\\\":[{\\\"x\\\":1381118400,\\\"y\\\":0.0},{\\\"x\\\":1381204800,\\\"y\\\":-0.02128589},{\\\"x\\\":1381291200,\\\"y\\\":-1.15428},{\\\"x\\\":1381377600,\\\"y\\\":0.0541744},{\\\"x\\\":1381464000,\\\"y\\\":2.207916},{\\\"x\\\":1381521600,\\\"y\\\":0.6239327}],\\\"Color\\\"\" +\n            \":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Benchmark\\\":{\\\"Name\\\":\\\"Benchmark\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Benchmark\\\":{\\\"Name\\\":\\\"Benchmark\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381118400,\\\"y\\\":146.0268},{\\\"x\\\":1381204800,\\\"y\\\":144.7558},{\\\"x\\\":1381291200,\\\"y\\\":143.0784},{\\\"x\\\":1381377600,\\\"y\\\":143.1562},{\\\"x\\\":1381464000,\\\"y\\\":146.3294},{\\\"x\\\":1381521600,\" +\n            \"\\\"y\\\":147.2459}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Capacity\\\":{\\\"Name\\\":\\\"Capacity\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Strategy Capacity\\\":{\\\"Name\\\":\\\"Strategy Capacity\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381118400,\\\"y\\\":0.0},{\\\"x\\\":1381204800,\\\"y\\\":0.0},{\\\"x\\\":1381291200,\\\"y\\\":0.0},{\\\"x\\\":1381377600,\\\"y\\\":0.0},{\\\"x\\\":1381464000,\\\"y\\\":0.0},\" +\n            \"{\\\"x\\\":1381521600,\\\"y\\\":56181000.0}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Portfolio Turnover\\\":{\\\"Name\\\":\\\"Portfolio Turnover\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Portfolio Turnover\\\":{\\\"Name\\\":\\\"Portfolio Turnover\\\",\\\"Unit\\\":\\\"%\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381204800,\\\"y\\\":0.9963103},{\\\"x\\\":1381291200,\\\"y\\\":0.0},{\\\"x\\\":1381377600,\\\"y\\\":0.0},{\\\"x\\\":1381464000,\\\"y\\\":0.0}\" +\n            \",{\\\"x\\\":1381521600,\\\"y\\\":0.0}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Exposure\\\":{\\\"Name\\\":\\\"Exposure\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Equity - Long Ratio\\\":{\\\"Name\\\":\\\"Equity - Long Ratio\\\",\\\"Unit\\\":\\\"\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381118400,\\\"y\\\":0.0},{\\\"x\\\":1381204800,\\\"y\\\":0.9961},{\\\"x\\\":1381291200,\\\"y\\\":0.9961},{\\\"x\\\":1381377600,\\\"y\\\":0.9961},{\\\"x\\\":1381464000,\\\"y\\\":0.9962}\" +\n            \",{\\\"x\\\":1381521600,\\\"y\\\":0.9962}],\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"},\\\"Equity - Short Ratio\\\":{\\\"Name\\\":\\\"Equity - Short Ratio\\\",\\\"Unit\\\":\\\"\\\",\\\"Index\\\":0,\\\"SeriesType\\\":0,\\\"Values\\\":[{\\\"x\\\":1381118400,\\\"y\\\":0.0},{\\\"x\\\":1381204800,\\\"y\\\":0.0},{\\\"x\\\":1381291200,\\\"y\\\":0.0},{\\\"x\\\":1381377600,\\\"y\\\":0.0},{\\\"x\\\":1381464000,\\\"y\\\":0.0},{\\\"x\\\":1381521600,\\\"y\\\":0.0}],\\\"Color\\\":\\\"\\\"\" +\n            \",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}},\\\"Assets Sales Volume\\\":{\\\"Name\\\":\\\"Assets Sales Volume\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"SPY\\\":{\\\"Name\\\":\\\"SPY\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"SeriesType\\\":7,\\\"Values\\\":[{\\\"x\\\":1381204800,\\\"y\\\":99609.8262},{\\\"x\\\":1381291200,\\\"y\\\":99609.8262},{\\\"x\\\":1381377600,\\\"y\\\":99609.8262},{\\\"x\\\":1381464000,\\\"y\\\":99609.8262},{\\\"x\\\":1381521600,\\\"y\\\":99609.8262}],\\\"Color\\\":\\\"\\\"\" +\n            \",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}}},\\\"Orders\\\":{\\\"1\\\":{\\\"Type\\\":0,\\\"Id\\\":1,\\\"ContingentId\\\":0,\\\"BrokerId\\\":[\\\"1\\\"],\\\"Symbol\\\":{\\\"Value\\\":\\\"SPY\\\",\\\"ID\\\":\\\"SPY R735QTJ8XC9X\\\",\\\"Permtick\\\":\\\"SPY\\\"},\\\"Price\\\":144.78172417,\\\"PriceCurrency\\\":\\\"USD\\\",\\\"Time\\\":\\\"2013-10-07T13:31:00Z\\\",\\\"CreatedTime\\\":\\\"2013-10-07T13:31:00Z\\\",\\\"LastFillTime\\\":\\\"2013-10-07T13:31:00Z\\\",\\\"Quantity\\\":688.0,\\\"Status\\\":3,\\\"Properties\\\"\" +\n            \":{\\\"TimeInForce\\\":{}},\\\"SecurityType\\\":1,\\\"Direction\\\":0,\\\"Value\\\":99609.82622896,\\\"OrderSubmissionData\\\":{\\\"BidPrice\\\":144.77307790400,\\\"AskPrice\\\":144.78172417000,\\\"LastPrice\\\":144.77307790400},\\\"IsMarketable\\\":true}},\\\"ProfitLoss\\\":{},\\\"Statistics\\\":{\\\"Total Trades\\\":\\\"1\\\",\\\"Average Win\\\":\\\"0%\\\",\\\"Average Loss\\\":\\\"0%\\\",\\\"Compounding Annual Return\\\":\\\"271.453%\\\",\\\"Drawdown\\\":\\\"2.200%\\\",\\\"Expectancy\\\":\\\"0\\\"\" +\n            \",\\\"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.222\\\",\\\"Annual Variance\\\":\\\"0.049\\\",\\\"Information Ratio\\\":\\\"-14.565\\\",\\\"Tracking Error\\\":\\\"0.001\\\",\\\"Treynor Ratio\\\":\\\"1.978\\\",\\\"Total Fees\\\":\\\"$3.44\\\"\" +\n            \",\\\"Estimated Strategy Capacity\\\":\\\"$56000000.00\\\",\\\"Lowest Capacity Asset\\\":\\\"SPY R735QTJ8XC9X\\\",\\\"Portfolio Turnover\\\":\\\"19.93%\\\"},\\\"RuntimeStatistics\\\":{\\\"Equity\\\":\\\"$101,691.92\\\",\\\"Fees\\\":\\\"-$3.44\\\",\\\"Holdings\\\":\\\"$101,305.19\\\",\\\"Net Profit\\\":\\\"$-3.44\\\",\\\"Probabilistic Sharpe Ratio\\\":\\\"67.609%\\\",\\\"Return\\\":\\\"1.69 %\\\",\\\"Unrealized\\\":\\\"$1,656.23\\\",\\\"Volume\\\":\\\"$99,609.83\\\"},\\\"State\\\":{\\\"StartTime\\\":\" +\n            \"\\\"2023-08-09 17:14:06\\\",\\\"EndTime\\\":\\\"2023-08-09 17:14:07\\\",\\\"RuntimeError\\\":\\\"\\\",\\\"StackTrace\\\":\\\"\\\",\\\"LogCount\\\":\\\"4\\\",\\\"OrderCount\\\":\\\"1\\\",\\\"InsightCount\\\":\\\"0\\\",\\\"Name\\\":\\\"local\\\",\\\"Hostname\\\":\\\"MM\\\",\\\"Status\\\":\\\"Completed\\\"},\\\"AlgorithmConfiguration\\\":{\\\"AccountCurrency\\\":\\\"USD\\\",\\\"Brokerage\\\":0,\\\"AccountType\\\":0,\\\"Parameters\\\":{\\\"intrinio-username\\\":\\\"\\\",\\\"intrinio-password\\\":\\\"\\\",\\\"ema-fast\\\":\\\"10\\\",\" +\n            \"\\\"ema-slow\\\":\\\"20\\\"}}}\";\n        private const string InvalidBacktestResultJson = \"{\\\"RollingWindow\\\":{},\\\"TotalPerformance\\\":null,\\\"Charts\\\":{\\\"Equity\\\":{\\\"Name\\\":\\\"Equity\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Performance\\\":{\\\"Name\\\":\\\"Performance\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"Values\\\":[{\\\"x\\\":1583704925,\\\"y\\\":5.0},{\\\"x\\\":1583791325,\\\"y\\\":null},{\\\"x\\\":1583877725,\\\"y\\\":7.0},{\\\"x\\\":1583964125,\\\"y\\\":8.0},{\\\"x\\\":1584050525,\\\"y\\\":9.0}],\\\"SeriesType\\\":0,\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}}},\\\"Orders\\\":\" + OrderStringReplace + \",\\\"ProfitLoss\\\":{},\\\"Statistics\\\":{},\\\"RuntimeStatistics\\\":{}}\";\n        private const string InvalidLiveResultJson = \"{\\\"Holdings\\\":{},\\\"Cash\\\":{\\\"USD\\\":{\\\"SecuritySymbol\\\":{\\\"Value\\\":\\\"\\\",\\\"ID\\\":\\\" 0\\\",\\\"Permtick\\\":\\\"\\\"},\\\"Symbol\\\":\\\"USD\\\",\\\"Amount\\\":0.0,\\\"ConversionRate\\\":1.0,\\\"CurrencySymbol\\\":\\\"$\\\",\\\"ValueInAccountCurrency\\\":0.0}},\\\"ServerStatistics\\\":{\\\"CPU Usage\\\":\\\"0.0%\\\",\\\"Used RAM (MB)\\\":\\\"68\\\",\\\"Total RAM (MB)\\\":\\\"\\\",\\\"Used Disk Space (MB)\\\":\\\"1\\\",\\\"Total Disk Space (MB)\\\":\\\"5\\\",\\\"Hostname\\\":\\\"LEAN\\\",\\\"LEAN Version\\\":\\\"v2.4.0.0\\\"},\\\"Charts\\\":{\\\"Equity\\\":{\\\"Name\\\":\\\"Equity\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Performance\\\":{\\\"Name\\\":\\\"Performance\\\",\\\"Unit\\\":\\\"$\\\",\\\"Index\\\":0,\\\"Values\\\":[{\\\"x\\\":1583705127,\\\"y\\\":5.0},{\\\"x\\\":1583791527,\\\"y\\\":null},{\\\"x\\\":1583877927,\\\"y\\\":7.0},{\\\"x\\\":1583964327,\\\"y\\\":8.0},{\\\"x\\\":1584050727,\\\"y\\\":9.0}],\\\"SeriesType\\\":0,\\\"Color\\\":\\\"\\\",\\\"ScatterMarkerSymbol\\\":\\\"none\\\"}}}},\\\"Orders\\\":\" + OrderStringReplace + \",\\\"ProfitLoss\\\":{},\\\"Statistics\\\":{},\\\"RuntimeStatistics\\\":{}}\";\n        private const string OrderJson = @\"{'1': {\n    'Type':\" + OrderTypeStringReplace + @\",\n    'Value':99986.827413672,\n    'Id':1,\n    'ContingentId':0,\n    'BrokerId':[1],\n    'Symbol':{'Value':'SPY',\n    'Permtick':'SPY'},\n    'Price':100.086914328,\n    'Time':'2010-03-04T14:31:00Z',\n    'Quantity':999,\n    'Status':3,\n    'Duration':2,\n    'DurationValue':'2010-04-04T14:31:00Z',\n    'Tag':'',\n    'SecurityType':1,\n    'Direction':0,\n    'AbsoluteQuantity':999,\n    'GroupOrderManager': {\n        'Id': 1,\n        'Count': 3,\n        'Quantity': 10,\n        'LimitPrice': 123.456,\n        'OrderIds': [1, 2, 3]\n    }\n}}\";\n        [TestCase(\"charts\")]\n        [TestCase(\"Charts\")]\n        public void ValidBacktestResultDefaultSerializer(string chartKey)\n        {\n            var result = JsonConvert.DeserializeObject<BacktestResponseWrapper>(ValidBacktestResultJson2.Replace(\"charts\", chartKey, StringComparison.InvariantCulture)).Backtest;\n\n            Assert.AreEqual(7, result.Charts.Count);\n            Assert.IsTrue(result.Charts.Where(x => x.Key == \"Drawdown\").All(kvp => !kvp.Value.IsEmpty()));\n        }\n\n        [Test]\n        public void ValidBacktestResult()\n        {\n            var settings = new JsonSerializerSettings\n            {\n                Converters = new List<JsonConverter> { new NullResultValueTypeJsonConverter<BacktestResult>() },\n                FloatParseHandling = FloatParseHandling.Decimal\n            };\n\n            var result = JsonConvert.DeserializeObject<BacktestResult>(ValidBacktestResultJson, settings);\n\n            Assert.AreEqual(7, result.Charts.Count);\n            Assert.IsTrue(result.Charts.All(kvp => !kvp.Value.IsEmpty()));\n        }\n\n        [Test]\n        public void BacktestResult_NullChartPoint_IsSkipped()\n        {\n            var converter = new NullResultValueTypeJsonConverter<BacktestResult>();\n            var settings = new JsonSerializerSettings\n            {\n                NullValueHandling = NullValueHandling.Ignore\n            };\n\n            var deWithoutConverter = JsonConvert.DeserializeObject<BacktestResult>(InvalidBacktestResultJson.Replace(OrderStringReplace, EmptyJson), settings);\n            var deWithConverter = JsonConvert.DeserializeObject<BacktestResult>(InvalidBacktestResultJson.Replace(OrderStringReplace, EmptyJson), converter);\n\n            var noConverterPoints = GetChartPoints(deWithoutConverter).ToList();\n            var withConverterPoints = GetChartPoints(deWithConverter).ToList();\n\n            Assert.IsTrue(withConverterPoints.All(kvp => kvp.Value > 0));\n            Assert.AreEqual(4, withConverterPoints.Count);\n\n            Assert.AreEqual(1, noConverterPoints.Count(kvp => !kvp.Value.HasValue));\n            Assert.AreEqual(5, noConverterPoints.Count);\n\n            var convertedSerialized = JsonConvert.SerializeObject(deWithConverter);\n            var roundtripDeserialization = JsonConvert.DeserializeObject<BacktestResult>(convertedSerialized);\n\n            Assert.IsTrue(withConverterPoints.SequenceEqual(GetChartPoints(roundtripDeserialization).ToList()));\n        }\n\n        [Test]\n        public void LiveResult_NullChartPoint_IsSkipped()\n        {\n            var converter = new NullResultValueTypeJsonConverter<LiveResult>();\n            var settings = new JsonSerializerSettings\n            {\n                NullValueHandling = NullValueHandling.Ignore\n            };\n\n            var deWithoutConverter = JsonConvert.DeserializeObject<LiveResult>(InvalidLiveResultJson.Replace(OrderStringReplace, EmptyJson), settings);\n            var deWithConverter = JsonConvert.DeserializeObject<LiveResult>(InvalidLiveResultJson.Replace(OrderStringReplace, EmptyJson), converter);\n\n            var noConverterPoints = GetChartPoints(deWithoutConverter).ToList();\n            var withConverterPoints = GetChartPoints(deWithConverter).ToList();\n\n            Assert.IsTrue(withConverterPoints.All(kvp => kvp.Value > 0));\n            Assert.AreEqual(4, withConverterPoints.Count);\n\n            Assert.AreEqual(1, noConverterPoints.Count(kvp => !kvp.Value.HasValue));\n            Assert.AreEqual(5, noConverterPoints.Count);\n\n            var convertedSerialized = JsonConvert.SerializeObject(deWithConverter);\n            var roundtripDeserialization = JsonConvert.DeserializeObject<LiveResult>(convertedSerialized);\n\n            Assert.IsTrue(withConverterPoints.SequenceEqual(GetChartPoints(roundtripDeserialization).ToList()));\n        }\n\n        [Test]\n        public void NullCandleStickPoint_IsSkipped()\n        {\n            var converter = new NullResultValueTypeJsonConverter<LiveResult>();\n            var settings = new JsonSerializerSettings\n            {\n                NullValueHandling = NullValueHandling.Ignore\n            };\n\n            var nullCandlestick = \"{\\\"Charts\\\":{\\\"Strategy Equity\\\":{\\\"Name\\\":\\\"Strategy Equity\\\",\\\"ChartType\\\":0,\\\"Series\\\":{\\\"Equity\\\":{\\\"Name\\\":\\\"Equity\\\",\\\"Values\\\":[[1695991900,null,null,null,null],[1695992500,10000000,10000000,10000000,10000000]],\\\"SeriesType\\\":2,\\\"Index\\\":2,\\\"Unit\\\":\\\"\\\"}}}}}\";\n            var deWithoutConverter = JsonConvert.DeserializeObject<LiveResult>(nullCandlestick, settings);\n            var deWithConverter = JsonConvert.DeserializeObject<LiveResult>(nullCandlestick, converter);\n\n            var noConverterPoints = deWithoutConverter.Charts[\"Strategy Equity\"].Series[\"Equity\"].Values.Cast<Candlestick>().ToList();\n            var withConverterPoints = deWithConverter.Charts[\"Strategy Equity\"].Series[\"Equity\"].Values.Cast<Candlestick>().ToList();\n\n            Assert.IsTrue(withConverterPoints.All(kvp => kvp.Close > 0));\n            Assert.AreEqual(1, withConverterPoints.Count);\n\n            Assert.AreEqual(1, noConverterPoints.Count(kvp => !kvp.Close.HasValue));\n            Assert.AreEqual(2, noConverterPoints.Count);\n\n            var convertedSerialized = JsonConvert.SerializeObject(deWithConverter);\n            var roundtripDeserialization = JsonConvert.DeserializeObject<LiveResult>(convertedSerialized);\n            var roundTripCandlestick = roundtripDeserialization.Charts[\"Strategy Equity\"].Series[\"Equity\"].Values.Cast<Candlestick>();\n\n            Assert.IsTrue(withConverterPoints.Select(x => x.Close).SequenceEqual(roundTripCandlestick.Select(x => x.Close)));\n        }\n\n        [Test]\n        public void OrderTypeEnumStringAndValueDeserialization()\n        {\n\n            var settings = new JsonSerializerSettings\n            {\n                Converters = new[] { new NullResultValueTypeJsonConverter<LiveResult>() }\n            };\n\n            foreach (var orderType in (OrderType[])Enum.GetValues(typeof(OrderType)))\n            {\n                //var orderObjectType = OrderTypeNormalizingJsonConverter.TypeFromOrderTypeEnum(orderType);\n                var intValueJson = OrderJson.Replace(OrderTypeStringReplace, ((int)orderType).ToStringInvariant());\n                var upperCaseJson = OrderJson.Replace(OrderTypeStringReplace, $\"'{orderType.ToStringInvariant().ToUpperInvariant()}'\");\n                var camelCaseJson = OrderJson.Replace(OrderTypeStringReplace, $\"'{orderType.ToStringInvariant().ToCamelCase()}'\");\n\n                var intValueLiveResult = InvalidLiveResultJson.Replace(OrderStringReplace, intValueJson);\n                var upperCaseLiveResult = InvalidLiveResultJson.Replace(OrderStringReplace, upperCaseJson);\n                var camelCaseLiveResult = InvalidLiveResultJson.Replace(OrderStringReplace, camelCaseJson);\n\n                var intInstance = JsonConvert.DeserializeObject<LiveResult>(intValueLiveResult, settings).Orders.Values.Single();\n                var upperCaseInstance = JsonConvert.DeserializeObject<LiveResult>(upperCaseLiveResult, settings).Orders.Values.Single();\n                var camelCaseInstance = JsonConvert.DeserializeObject<LiveResult>(camelCaseLiveResult, settings).Orders.Values.Single();\n\n                CollectionAssert.AreEqual(intInstance.BrokerId, upperCaseInstance.BrokerId);\n                Assert.AreEqual(intInstance.ContingentId, upperCaseInstance.ContingentId);\n                Assert.AreEqual(intInstance.Direction, upperCaseInstance.Direction);\n                Assert.AreEqual(intInstance.TimeInForce.GetType(), upperCaseInstance.TimeInForce.GetType());\n                Assert.AreEqual(intInstance.Id, upperCaseInstance.Id);\n                Assert.AreEqual(intInstance.Price, upperCaseInstance.Price);\n                Assert.AreEqual(intInstance.PriceCurrency, upperCaseInstance.PriceCurrency);\n                Assert.AreEqual(intInstance.SecurityType, upperCaseInstance.SecurityType);\n                Assert.AreEqual(intInstance.Status, upperCaseInstance.Status);\n                Assert.AreEqual(intInstance.Symbol, upperCaseInstance.Symbol);\n                Assert.AreEqual(intInstance.Tag, upperCaseInstance.Tag);\n                Assert.AreEqual(intInstance.Time, upperCaseInstance.Time);\n                Assert.AreEqual(intInstance.CreatedTime, upperCaseInstance.CreatedTime);\n                Assert.AreEqual(intInstance.LastFillTime, upperCaseInstance.LastFillTime);\n                Assert.AreEqual(intInstance.LastUpdateTime, upperCaseInstance.LastUpdateTime);\n                Assert.AreEqual(intInstance.CanceledTime, upperCaseInstance.CanceledTime);\n                Assert.AreEqual(intInstance.Type, upperCaseInstance.Type);\n                Assert.AreEqual(intInstance.Value, upperCaseInstance.Value);\n                Assert.AreEqual(intInstance.Quantity, upperCaseInstance.Quantity);\n                Assert.AreEqual(intInstance.TimeInForce.GetType(), upperCaseInstance.TimeInForce.GetType());\n                Assert.AreEqual(intInstance.Symbol.ID.Market, upperCaseInstance.Symbol.ID.Market);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.AskPrice, upperCaseInstance.OrderSubmissionData?.AskPrice);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.BidPrice, upperCaseInstance.OrderSubmissionData?.BidPrice);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.LastPrice, upperCaseInstance.OrderSubmissionData?.LastPrice);\n\n                CollectionAssert.AreEqual(intInstance.BrokerId, camelCaseInstance.BrokerId);\n                Assert.AreEqual(intInstance.ContingentId, camelCaseInstance.ContingentId);\n                Assert.AreEqual(intInstance.Direction, camelCaseInstance.Direction);\n                Assert.AreEqual(intInstance.TimeInForce.GetType(), camelCaseInstance.TimeInForce.GetType());\n                Assert.AreEqual(intInstance.Id, camelCaseInstance.Id);\n                Assert.AreEqual(intInstance.Price, camelCaseInstance.Price);\n                Assert.AreEqual(intInstance.PriceCurrency, camelCaseInstance.PriceCurrency);\n                Assert.AreEqual(intInstance.SecurityType, camelCaseInstance.SecurityType);\n                Assert.AreEqual(intInstance.Status, camelCaseInstance.Status);\n                Assert.AreEqual(intInstance.Symbol, camelCaseInstance.Symbol);\n                Assert.AreEqual(intInstance.Tag, camelCaseInstance.Tag);\n                Assert.AreEqual(intInstance.Time, camelCaseInstance.Time);\n                Assert.AreEqual(intInstance.CreatedTime, camelCaseInstance.CreatedTime);\n                Assert.AreEqual(intInstance.LastFillTime, camelCaseInstance.LastFillTime);\n                Assert.AreEqual(intInstance.LastUpdateTime, camelCaseInstance.LastUpdateTime);\n                Assert.AreEqual(intInstance.CanceledTime, camelCaseInstance.CanceledTime);\n                Assert.AreEqual(intInstance.Type, camelCaseInstance.Type);\n                Assert.AreEqual(intInstance.Value, camelCaseInstance.Value);\n                Assert.AreEqual(intInstance.Quantity, camelCaseInstance.Quantity);\n                Assert.AreEqual(intInstance.TimeInForce.GetType(), camelCaseInstance.TimeInForce.GetType());\n                Assert.AreEqual(intInstance.Symbol.ID.Market, camelCaseInstance.Symbol.ID.Market);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.AskPrice, camelCaseInstance.OrderSubmissionData?.AskPrice);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.BidPrice, camelCaseInstance.OrderSubmissionData?.BidPrice);\n                Assert.AreEqual(intInstance.OrderSubmissionData?.LastPrice, camelCaseInstance.OrderSubmissionData?.LastPrice);\n            }\n        }\n\n        [TestCaseSource(nameof(CreatesReportParametersTableCorrectlyTestCases))]\n        public void CreatesReportParametersTableCorrectly(string parametersTemplate, Dictionary<string, string> parameters, string expectedParametersTable)\n        {\n            parametersTemplate = parametersTemplate.Replace(\"\\r\", string.Empty);\n            var algorithmConfiguration = new AlgorithmConfiguration { Parameters = parameters };\n            var parametersReportElment = new ParametersReportElement(\"parameters\", \"\", algorithmConfiguration, null, parametersTemplate);\n            var parametersTable = parametersReportElment.Render();\n            expectedParametersTable = expectedParametersTable.Replace(\"\\r\", string.Empty);\n            Assert.AreEqual(expectedParametersTable, parametersTable);\n        }\n\n        [TestCase(htmlExampleCode + @\"\n\n<!--crisis\n<div class=\"\"col-xs-4\"\">\n    <table class=\"\"crisis-chart table compact\"\">\n        <thead>\n        <tr>\n            <th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr>\n            <td style=\"\"padding:0;\"\">\n                <img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\">\n            </td>\n        </tr>\n        </tbody>\n    </table>\n</div>\ncrisis-->\n\",\n            @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\", @\"<div class=\"\"col-xs-4\"\">\n    <table class=\"\"crisis-chart table compact\"\">\n        <thead>\n        <tr>\n            <th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr>\n            <td style=\"\"padding:0;\"\">\n                <img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\">\n            </td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n\")]\n        [TestCase(htmlExampleCode + @\"\n<!--parameters\n<tr>\n\t<td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td>\n\t<td class = \"\"title\"\"> {{$SECOND-KPI-NAME}} </td><td> {{$SECOND-KPI-VALUE}} </td>\n</tr>\nparameters-->\",\n            @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\", @\"<tr>\n\t<td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td>\n\t<td class = \"\"title\"\"> {{$SECOND-KPI-NAME}} </td><td> {{$SECOND-KPI-VALUE}} </td>\n</tr>\n\")]\n        [TestCase(@\"<!--crisis<div class=\"\"col-xs-4\"\"><table class=\"\"crisis-chart table compact\"\"><thead><tr><th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th></tr></thead><tbody><tr><td style=\"\"padding:0;\"\"><img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\"></td></tr></tbody></table></div>crisis-->\",\n            @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\", @\"<div class=\"\"col-xs-4\"\"><table class=\"\"crisis-chart table compact\"\"><thead><tr><th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th></tr></thead><tbody><tr><td style=\"\"padding:0;\"\"><img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\"></td></tr></tbody></table></div>\")]\n        [TestCase(@\"<!--parameters<tr><td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td></tr>parameters-->\",\n            @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\", @\"<tr><td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td></tr>\")]\n        public void GetsExpectedCrisisAndParametersHTMLCodes(string input, string pattern, string expected)\n        {\n            var htmlCode = GetRegexInInput(pattern, input);\n            Assert.IsNotNull(htmlCode);\n            Assert.AreEqual(expected, htmlCode);\n        }\n\n        [TestCase(htmlExampleCode + @\"\n\n<!--crisis\n<div class=\"\"col-xs-4\"\">\n    <table class=\"\"crisis-chart table compact\"\">\n        <thead>\n        <tr>\n            <th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr>\n            <td style=\"\"padding:0;\"\">\n                <img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\">\n            </td>\n        </tr>\n        </tbody>\n    </table>\n</div>\ncrisis-->\n\", @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\")]\n        [TestCase(htmlExampleCode + @\"\n<!--parameters\n<tr>\n\t<td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td>\n\t<td class = \"\"title\"\"> {{$SECOND-KPI-NAME}} </td><td> {{$SECOND-KPI-VALUE}} </td>\n</tr>\nparameters-->\", @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\")]\n        [TestCase(@\"\", @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\")]\n        [TestCase(@\"\", @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\")]\n        [TestCase(@\"<div class=\"\"col-xs-4\"\"><table class=\"\"crisis-chart table compact\"\"><thead><tr><th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th></tr></thead><tbody><tr><td style=\"\"padding:0;\"\"><img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\"></td></tr></tbody></table></div>crisis-->\",\n    @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\")]\n        [TestCase(@\"<!--crisis<div class=\"\"col-xs-4\"\"><table class=\"\"crisis-chart table compact\"\"><thead><tr><th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th></tr></thead><tbody><tr><td style=\"\"padding:0;\"\"><img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\"></td></tr></tbody></table></div>\",\n    @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\")]\n        [TestCase(@\"<div class=\"\"col-xs-4\"\"><table class=\"\"crisis-chart table compact\"\"><thead><tr><th style=\"\"display: block; height: 75px;\"\">{{$TEXT-CRISIS-TITLE}}</th></tr></thead><tbody><tr><td style=\"\"padding:0;\"\"><img src=\"\"{{$PLOT-CRISIS-CONTENT}}\"\"></td></tr></tbody></table></div>\",\n    @\"<!--crisis(\\r|\\n)*((\\r|\\n|.)*?)crisis-->\")]\n        [TestCase(@\"<tr><td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td></tr>parameters-->\",\n    @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\")]\n        [TestCase(@\"<!--parameters<tr><td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td></tr>\",\n    @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\")]\n        [TestCase(@\"<tr><td class = \"\"title\"\"> {{$FIRST-KPI-NAME}} </td><td> {{$FIRST-KPI-VALUE}} </td></tr>\",\n    @\"<!--parameters(\\r|\\n)*((\\r|\\n|.)*?)parameters-->\")]\n        public void FindsNoMatchingForCrisisAndParametersInGivenInput(string input, string pattern)\n        {\n            var matching = GetRegexInInput(pattern, input);\n            Assert.IsNull(matching);\n        }\n\n        public IEnumerable<KeyValuePair<long, decimal?>> GetChartPoints(Result result)\n        {\n            return result.Charts[\"Equity\"].Series[\"Performance\"].Values.Cast<ChartPoint>().Select(point => new KeyValuePair<long, decimal?>(point.x, point.y));\n        }\n\n        private const string htmlExampleCode = @\"            <div class=\"\"page\"\" style=\"\"{{$CSS-CRISIS-PAGE-STYLE}}\"\">\n                <div class=\"\"header\"\">\n                    <div class=\"\"header-left\"\">\n                        <img src=\"\"https://cdn.quantconnect.com/web/i/logo.png\"\">\n                    </div>\n                    <div class=\"\"header-right\"\">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"\"content\"\">\n                    <div class=\"\"container-row\"\">\n                        {{$HTML-CRISIS-PLOTS}}\n                    </div>\n                </div>\n            </div>\n\t\t\t<div class=\"\"page\"\" id=\"\"parameters\"\" style=\"\"{{$CSS-PARAMETERS-PAGE-STYLE}}\"\">\n                <div class=\"\"header\"\">\n                    <div class=\"\"header-left\"\">\n                        <img src=\"\"https://cdn.quantconnect.com/web/i/logo.png\"\">\n                    </div>\n                    <div class=\"\"header-right\"\">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>\n                </div>\n                <div class=\"\"content\"\">\n                    <div class=\"\"container-row\"\">\n                        <div class=\"\"col-xs-12\"\">\n                            <table id=\"\"key-characteristics\"\" class=\"\"table compact\"\">\n                                <thead>\n                                <tr>\n                                    <th class=\"\"title\"\">Parameters</th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                    {{$PARAMETERS}}\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                </div>\n            </div>\n    </body>\n    </html>\";\n\n        public static object[] CreatesReportParametersTableCorrectlyTestCases = new object[]\n        {\n            // Happy test cases\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" } },\n                @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-three </td><td> three </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" } }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-three </td><td> three </td>\n\t<td class = \"\"title\"\">  </td><td>  </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" } }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n    <td class = \"\"title\"\"> {{$KEY2}} </td><td> {{$VALUE2}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" }, { \"test-key-four\", \"4\"} }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n    <td class = \"\"title\"\"> test-key-three </td><td> three </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-four </td><td> 4 </td>\n\t<td class = \"\"title\"\">  </td><td>  </td>\n    <td class = \"\"title\"\">  </td><td>  </td>\n</tr>\"},\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n    <td class = \"\"title\"\"> {{$KEY2}} </td><td> {{$VALUE2}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" }, { \"test-key-four\", \"4\"}, { \"test-key-five\", \"5\"} }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n    <td class = \"\"title\"\"> test-key-three </td><td> three </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-four </td><td> 4 </td>\n\t<td class = \"\"title\"\"> test-key-five </td><td> 5 </td>\n    <td class = \"\"title\"\">  </td><td>  </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE0}} </td>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n    <td class = \"\"title\"\"> {{$KEY2}} </td><td> {{$VALUE2}} </td>\n    <td class = \"\"title\"\"> {{$KEY3}} </td><td> {{$VALUE3}} </td>\n    <td class = \"\"title\"\"> {{$KEY4}} </td><td> {{$VALUE4}} </td>\n    <td class = \"\"title\"\"> {{$KEY5}} </td><td> {{$VALUE5}} </td>\n    <td class = \"\"title\"\"> {{$KEY6}} </td><td> {{$VALUE6}} </td>\n    <td class = \"\"title\"\"> {{$KEY7}} </td><td> {{$VALUE7}} </td>\n    <td class = \"\"title\"\"> {{$KEY8}} </td><td> {{$VALUE8}} </td>\n    <td class = \"\"title\"\"> {{$KEY9}} </td><td> {{$VALUE9}} </td>\n    <td class = \"\"title\"\"> {{$KEY10}} </td><td> {{$VALUE10}} </td>\n    <td class = \"\"title\"\"> {{$KEY11}} </td><td> {{$VALUE11}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" }, { \"test-key-four\", \"4\" }, { \"test-key-five\", \"5\" },\n                { \"test-key-six\", \"6\" }, { \"test-key-seven\", \"7\" }, { \"test-key-eight\", \"8\" }, { \"test-key-nine\", \"9\" }, { \"test-key-ten\", \"10\"}, { \"test-key-eleven\", \"11\"}}, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> 1 </td>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n    <td class = \"\"title\"\"> test-key-three </td><td> three </td>\n    <td class = \"\"title\"\"> test-key-four </td><td> 4 </td>\n    <td class = \"\"title\"\"> test-key-five </td><td> 5 </td>\n    <td class = \"\"title\"\"> test-key-six </td><td> 6 </td>\n    <td class = \"\"title\"\"> test-key-seven </td><td> 7 </td>\n    <td class = \"\"title\"\"> test-key-eight </td><td> 8 </td>\n    <td class = \"\"title\"\"> test-key-nine </td><td> 9 </td>\n    <td class = \"\"title\"\"> test-key-ten </td><td> 10 </td>\n    <td class = \"\"title\"\"> test-key-eleven </td><td> 11 </td>\n    <td class = \"\"title\"\">  </td><td>  </td>\n</tr>\"},\n            // Sad test cases\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" } }, @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY0}} </td><td> {{$VALUE}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" } }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-one </td><td> {{$VALUE}} </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-two </td><td> {{$VALUE}} </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> test-key-three </td><td> {{$VALUE}} </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE0}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" } }, @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> 1 </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> 2 </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> three </td>\n</tr>\"},\n\n            new object[] { @\"<tr>\n\t<td class = \"\"title\"\"> {{$KEY1}} </td><td> {{$VALUE1}} </td>\n\t<td class = \"\"title\"\"> {{$KEY2}} </td><td> {{$VALUE2}} </td>\n    <td class = \"\"title\"\"> {{$KEY3}} </td><td> {{$VALUE3}} </td>\n</tr>\", new Dictionary<string, string>() { { \"test-key-one\", \"1\" }, { \"test-key-two\", \"2\" }, { \"test-key-three\", \"three\" }, { \"test-key-four\", \"4\"} }, @\"<tr>\n\t<td class = \"\"title\"\"> test-key-two </td><td> 2 </td>\n\t<td class = \"\"title\"\"> test-key-three </td><td> three </td>\n    <td class = \"\"title\"\"> {{$KEY3}} </td><td> {{$VALUE3}} </td>\n</tr>\n<tr>\n\t<td class = \"\"title\"\">  </td><td>  </td>\n\t<td class = \"\"title\"\">  </td><td>  </td>\n    <td class = \"\"title\"\"> {{$KEY3}} </td><td> {{$VALUE3}} </td>\n</tr>\"},\n        };\n    }\n}\n"
  },
  {
    "path": "Tests/Research/QuantBookFundamentalTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Logging;\nusing QuantConnect.Research;\nusing QuantConnect.Securities;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture]\n    public class QuantBookFundamentalTests\n    {\n        private dynamic _module;\n        private DateTime _startDate;\n        private DateTime _endDate;\n        private ILogHandler _logHandler;\n        private QuantBook _qb;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            // Store initial handler\n            _logHandler = Log.LogHandler;\n\n            SymbolCache.Clear();\n            MarketHoursDatabase.Reset();\n\n            Config.Set(\"fundamental-data-provider\", \"NullFundamentalDataProvider\");\n\n            // Using a date that we have data for in the repo\n            _startDate = new DateTime(2014, 3, 31);\n            _endDate = new DateTime(2014, 3, 31);\n\n            // Our qb instance to test on\n            _qb = new QuantBook();\n\n            using (Py.GIL())\n            {\n                _module = Py.Import(\"Test_QuantBookHistory\");\n            }\n        }\n\n        [OneTimeTearDown]\n        public void OneTimeTearDown()\n        {\n            // Reset to initial handler\n            Log.LogHandler = _logHandler;\n        }\n\n        [Test]\n        public void DefaultEndDate()\n        {\n            var startDate = DateTime.UtcNow.Date.AddDays(-7);\n\n            // Expected end date should be either today if tradable, or last tradable day\n            var aapl = _qb.AddEquity(\"AAPL\");\n            var now = DateTime.UtcNow.Date;\n            var expectedEndDate = aapl.Exchange.Hours.IsDateOpen(now) ? now : aapl.Exchange.Hours.GetPreviousTradingDay(now);\n            expectedEndDate = expectedEndDate.AddDays(1);\n\n            IEnumerable<DataDictionary<dynamic>> data = _qb.GetFundamental(\"AAPL\", \"\", startDate);\n\n            // Check that the last day in the collection is as expected\n            var lastDay = data.Last();\n            Assert.AreEqual(expectedEndDate, lastDay.Time);\n            Assert.AreEqual(expectedEndDate, lastDay[aapl.Symbol].EndTime);\n        }\n\n        [TestCaseSource(nameof(DataTestCases))]\n        public void PyFundamentalData(dynamic input)\n        {\n            using (Py.GIL())\n            {\n                var testModule = _module.FundamentalHistoryTest();\n                FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProvider(), false);\n                var dataFrame = testModule.getFundamentals(input[0], input[1], _startDate, _endDate);\n\n                // Should not be empty\n                Assert.IsFalse(dataFrame.empty.AsManagedObject(typeof(bool)));\n\n                // Get the test row (plus 1 day since data is time-stamped with the base data's end time)\n                var testRow = dataFrame.loc[_startDate.AddDays(1).ToPython()];\n                Assert.IsFalse(testRow.empty.AsManagedObject(typeof(bool)));\n\n                // Check the length\n                var count = testRow.__len__().AsManagedObject(typeof(int));\n                Assert.AreEqual(count, 1);\n\n                // Verify the data value\n                var index = testRow.index[0];\n                if (input.Length == 4)\n                {\n                    var fine = testRow.at[index].AsManagedObject(typeof(FineFundamental));\n                    Assert.AreEqual(input[2], input[3](fine));\n                }\n                else\n                {\n                    var value = testRow.at[index].AsManagedObject(input[2].GetType());\n                    Assert.AreEqual(input[2], value);\n                }\n            }\n        }\n\n        [TestCaseSource(nameof(DataTestCases))]\n        public void CSharpFundamentalData(dynamic input)\n        {\n            FundamentalService.Initialize(TestGlobals.DataProvider, new TestFundamentalDataProvider(), false);\n            var data = _qb.GetFundamental(input[0], input[1], _startDate, _endDate);\n            var currentDate = _startDate;\n\n            foreach (var day in data)\n            {\n                // plus 1 day since data is time-stamped with the base data's end time\n                currentDate = currentDate.AddDays(1);\n\n                foreach (var value in day.Values)\n                {\n                    if (input.Length == 4)\n                    {\n                        Assert.AreEqual(input[2], input[3](value));\n                    }\n                    else\n                    {\n                        Assert.AreEqual(input[2], value);\n                    }\n                    Assert.AreEqual(currentDate, day.Time);\n                }\n            }\n        }\n\n        [Test]\n        public void PyReturnNoneTest()\n        {\n            using (Py.GIL())\n            {\n                var start = new DateTime(2023, 10, 10);\n                var symbol = Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA);\n                var testModule = _module.FundamentalHistoryTest();\n                var data = testModule.getFundamentals(symbol, \"ValuationRatios.PERatio\", start, start.AddDays(5));\n                Assert.AreNotEqual(true, (bool)data.empty);\n\n                var subdataframe = data.loc[start.AddDays(1).ToPython()];\n                PyObject result = subdataframe[symbol.ID.ToString()];\n                Assert.IsNull(result.As<object>());\n            }\n        }\n\n        [TestCaseSource(nameof(NullRequestTestCases))]\n        public void PyReturnNullTest(dynamic input)\n        {\n            using (Py.GIL())\n            {\n                var testModule = _module.FundamentalHistoryTest();\n                var data = testModule.getFundamentals(input[0], input[1], input[2], input[3]);\n                Assert.AreEqual(true, (bool)data.empty);\n            }\n        }\n\n        [TestCaseSource(nameof(NullRequestTestCases))]\n        public void CSharpReturnNullTest(dynamic input)\n        {\n            var data = _qb.GetFundamental(input[0], input[1], input[2], input[3]);\n            Assert.IsEmpty(data);\n        }\n\n        [TestCaseSource(nameof(FundamentalEndTimeTestCases))]\n        public void FundamentalDataEndTime(DateTime startDate, DateTime endDate)\n        {\n            var originalQBEndDate = _qb.EndDate;\n            _qb.SetEndDate(endDate);\n\n            var security = _qb.AddEquity(\"AAPL\");\n\n            var history = _qb.History(Symbols.AAPL, startDate, endDate, Resolution.Daily).ToList();\n            Assert.IsNotEmpty(history);\n\n            var fundamental = (_qb.GetFundamental(\"AAPL\", \"\", startDate, endDate) as IEnumerable<DataDictionary<dynamic>>).ToList();\n\n            var isEndDateOpen = security.Exchange.Hours.IsDateOpen(endDate);\n            var expectedFundamentalCount = 10;\n            var expectedHistoryCount = isEndDateOpen ? expectedFundamentalCount - 1 : expectedFundamentalCount;\n\n            Assert.AreEqual(expectedFundamentalCount, fundamental.Count);\n            Assert.AreEqual(expectedHistoryCount, history.Count);\n\n            var historyTimes = history.Select(x => x.EndTime.AddHours(+8));// shift 4pm to midnight to match fundamental\n            var fundamentalTimes = fundamental.Select(x => x.Time).SkipLast(isEndDateOpen ? 1 : 0);\n\n            CollectionAssert.AreEqual(historyTimes, fundamentalTimes);\n\n            Assert.IsTrue(fundamental.All(x => x.Time == x.Values.Cast<FineFundamental>().Single().EndTime));\n\n            _qb.RemoveSecurity(security.Symbol);\n            _qb.SetEndDate(originalQBEndDate);\n        }\n\n        // Different requests and their expected values\n        private static readonly object[] DataTestCases =\n        {\n            new object[] {new List<string> {\"AAPL\"}, null, 13.2725m, new Func<FineFundamental, double>(fundamental => fundamental.ValuationRatios.PERatio) },\n            new object[] {new List<string> {\"AAPL\"}, \"ValuationRatios.PERatio\", 13.2725m},\n            new object[] {Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA), \"ValuationRatios.BookValuePerShare\", 22.5177},\n            new object[] {new List<Symbol> {Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA)}, \"FinancialStatements.NumberOfShareHolders.Value\", 36319}\n        };\n\n        // Different requests that should return null\n        // Nonexistent data; start date after end date;\n        private static readonly object[] NullRequestTestCases =\n        {\n            new object[] {Symbol.Create(\"AIG\", SecurityType.Equity, Market.USA), \"ValuationRatios.PERatio\", new DateTime(1972, 4, 1),  new DateTime(1972, 4, 1)},\n            new object[] {Symbol.Create(\"IBM\", SecurityType.Equity, Market.USA), \"ValuationRatios.BookValuePerShare\", new DateTime(2014, 4, 1), new DateTime(2014, 3, 31)},\n        };\n\n        private static readonly TestCaseData[] FundamentalEndTimeTestCases =\n        {\n            // monday,friday\n            new TestCaseData(new DateTime(2014, 3, 31), new DateTime(2014, 4, 11)),\n            // monday,saturday\n            new TestCaseData(new DateTime(2014, 3, 31), new DateTime(2014, 4, 12))\n        };\n\n        private class TestFundamentalDataProvider : IFundamentalDataProvider\n        {\n            public T Get<T>(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name)\n            {\n                if (securityIdentifier == SecurityIdentifier.Empty)\n                {\n                    return default;\n                }\n                return Get(time, securityIdentifier, name);\n            }\n\n            private dynamic Get(DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty enumName)\n            {\n                var name = Enum.GetName(enumName);\n                switch (name)\n                {\n                    case \"ValuationRatios_PERatio\":\n                        return 13.2725d;\n                    case \"ValuationRatios_BookValuePerShare\":\n                        return 22.5177d;\n                    case \"FinancialStatements_NumberOfShareHolders_TwelveMonths\":\n                        return 36319;\n                }\n                return null;\n            }\n            public void Initialize(IDataProvider dataProvider, bool liveMode)\n            {\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tests/Research/QuantBookHistoryTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Research;\nusing QuantConnect.Logging;\nusing QuantConnect.Data.Fundamental;\nusing System.Data;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Data;\nusing NodaTime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Data.UniverseSelection;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture]\n    public class QuantBookHistoryTests\n    {\n        private ILogHandler _logHandler;\n        dynamic _module;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            // Store initial handler\n            _logHandler = Log.LogHandler;\n\n            SymbolCache.Clear();\n            MarketHoursDatabase.Reset();\n\n            using (Py.GIL())\n            {\n                _module = Py.Import(\"Test_QuantBookHistory\");\n            }\n        }\n\n        [OneTimeTearDown]\n        public void OneTimeTearDown()\n        {\n            // Reset to initial handler\n            Log.LogHandler = _logHandler;\n        }\n\n        [Test]\n        [TestCase(2013, 10, 11, SecurityType.Equity, \"SPY\")]\n        [TestCase(2014, 5, 9, SecurityType.Forex, \"EURUSD\")]\n        [TestCase(2016, 10, 9, SecurityType.Crypto, \"BTCUSD\")]\n        public void SecurityQuantBookHistoryTests(int year, int month, int day, SecurityType securityType, string symbol)\n        {\n            using (Py.GIL())\n            {\n                var startDate = new DateTime(year, month, day);\n                var securityTestHistory = _module.SecurityHistoryTest(startDate, securityType, symbol);\n\n                // Get the last 10 candles\n                var periodHistory = securityTestHistory.test_period_overload(10);\n                var count = (periodHistory.shape[0] as PyObject).AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n\n                // Get the one day of data\n                var timedeltaHistory = securityTestHistory.test_period_overload(TimeSpan.FromDays(1));\n                var firstIndex = (DateTime)(timedeltaHistory.index.values[0] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-1).Date, firstIndex.Date);\n\n                // Get the one day of data, ending one day before start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate.AddDays(-1));\n                firstIndex = (DateTime)(startEndHistory.index.values[0] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-2).Date, firstIndex.Date);\n            }\n        }\n\n        [Test]\n        [TestCase(2014, 5, 9, \"Nifty\", \"NIFTY\")]\n        public void CustomDataQuantBookHistoryTests(int year, int month, int day, string customDataType, string symbol)\n        {\n            using (Py.GIL())\n            {\n                var startDate = new DateTime(year, month, day);\n                var securityTestHistory = _module.CustomDataHistoryTest(startDate, customDataType, symbol);\n\n                // Get the last 5 candles\n                var periodHistory = securityTestHistory.test_period_overload(5);\n                var count = (periodHistory.shape[0] as PyObject).AsManagedObject(typeof(int));\n                Assert.AreEqual(5, count);\n\n                // Get the one day of data\n                var timedeltaHistory = securityTestHistory.test_period_overload(TimeSpan.FromDays(8));\n                var firstIndex =\n                    (DateTime)(timedeltaHistory.index.values[0] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.AreEqual(startDate.AddDays(-7), firstIndex);\n\n                // Get the one day of data, ending one day before start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate.AddDays(-2));\n                firstIndex = (DateTime)(startEndHistory.index.values[0] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.AreEqual(startDate.AddDays(-2).Date, firstIndex.Date);\n            }\n        }\n\n        [Test]\n        public void MultipleSecuritiesQuantBookHistoryTests()\n        {\n            using (Py.GIL())\n            {\n                var startDate = new DateTime(2014, 5, 9);\n                var securityTestHistory = _module.MultipleSecuritiesHistoryTest(startDate, null, null);\n\n                // Get the last 5 candles\n                var periodHistory = securityTestHistory.test_period_overload(5);\n\n                // Note there is no data for BTCUSD at 2014\n\n                //symbol                 EURUSD         SPY\n                //time\n                //2014-05-02 16:00:00        NaN        164.219446\n                //2014-05-04 20:00:00   1.387185               NaN\n                //2014-05-05 16:00:00        NaN        164.551273\n                //2014-05-05 20:00:00   1.387480               NaN\n                //2014-05-06 16:00:00        NaN        163.127909\n                //2014-05-06 20:00:00   1.392925               NaN\n                //2014-05-07 16:00:00        NaN        164.070997\n                //2014-05-07 20:00:00   1.391070               NaN\n                //2014-05-08 16:00:00        NaN        163.905083\n                //2014-05-08 20:00:00   1.384265               NaN\n                Log.Trace(periodHistory.ToString());\n\n                var count = (periodHistory.shape[0] as PyObject).AsManagedObject(typeof(int));\n                Assert.AreEqual(10, count);\n\n                // Get the one day of data\n                var timedeltaHistory = securityTestHistory.test_period_overload(TimeSpan.FromDays(8));\n                var firstIndex = (DateTime)(timedeltaHistory.index.values[0] as PyObject).AsManagedObject(typeof(DateTime));\n\n                // EURUSD exchange time zone is NY but data is UTC so we have a 4 hour difference with algo TZ which is NY\n                Assert.AreEqual(startDate.AddDays(-8).AddHours(16), firstIndex);\n            }\n        }\n\n        [Test]\n        public void CanonicalOptionQuantBookHistory()\n        {\n            using (Py.GIL())\n            {\n                var symbol = \"TWX\";\n                var startDate = new DateTime(2014, 6, 6);\n                var securityTestHistory = _module.OptionHistoryTest(startDate, SecurityType.Option, symbol);\n\n                // Get the one day of data, ending on start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate);\n                Log.Trace(startEndHistory.ToString());\n                var firstIndex = (DateTime)(startEndHistory.index.values[0][4] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-1).Date, firstIndex.Date);\n            }\n        }\n\n        [Test]\n        public void CanonicalOptionIntradayQuantBookHistory()\n        {\n            using (Py.GIL())\n            {\n                var symbol = \"TWX\";\n                var currentDate = new DateTime(2014, 6, 6, 18, 0, 0);\n                var securityTestHistory = _module.OptionHistoryTest(new DateTime(2014, 6, 7), SecurityType.Option, symbol);\n\n                var startEndHistory = securityTestHistory.test_daterange_overload(currentDate, new DateTime(2014, 6, 6, 10, 0, 0));\n                Log.Trace(startEndHistory.ToString());\n                Assert.IsFalse((bool)startEndHistory.empty);\n            }\n        }\n\n        private static TestCaseData[] CanonicalOptionIntradayHistoryTestCases\n        {\n            get\n            {\n                var twx = Symbol.Create(\"TWX\", SecurityType.Equity, Market.USA);\n                var twxOption = Symbol.CreateCanonicalOption(twx);\n\n                var spx = Symbol.Create(\"SPX\", SecurityType.Index, Market.USA);\n                var spxwOption = Symbol.CreateCanonicalOption(spx, Market.USA, null);\n\n                return\n                [\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05), (DateTime?)null, Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05), new DateTime(2014, 06, 05), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05), new DateTime(2014, 06, 06), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05, 0, 0, 0), new DateTime(2014, 06, 05, 15, 0, 0), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05, 10, 0, 0), new DateTime(2014, 06, 05, 15, 0, 0), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05, 10, 0, 0), new DateTime(2014, 06, 06), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05, 10, 0, 0), new DateTime(2014, 06, 06, 10, 0, 0), Resolution.Minute),\n                    new TestCaseData(twxOption, new DateTime(2014, 06, 05, 10, 0, 0), new DateTime(2014, 06, 06, 15, 0, 0), Resolution.Minute),\n\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 04), (DateTime?)null, Resolution.Hour),\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 04), new DateTime(2021, 01, 04), Resolution.Hour),\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 04), new DateTime(2021, 01, 05), Resolution.Hour),\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 04, 10, 0, 0), new DateTime(2021, 01, 04, 15, 0, 0), Resolution.Hour),\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 04, 10, 0, 0), new DateTime(2021, 01, 05, 15, 0, 0), Resolution.Hour),\n                    new TestCaseData(spxwOption, new DateTime(2021, 01, 14, 10, 0, 0), new DateTime(2021, 01, 14, 15, 0, 0), Resolution.Hour),\n                ];\n            }\n        }\n\n        [TestCaseSource(nameof(CanonicalOptionIntradayHistoryTestCases))]\n        public void CanonicalOptionIntradayQuantBookHistoryWithIntradayRange(Symbol canonicalOption, DateTime start, DateTime? end, Resolution resolution)\n        {\n            var quantBook = new QuantBook();\n            var historyProvider = new TestHistoryProvider(quantBook.HistoryProvider);\n            quantBook.SetHistoryProvider(historyProvider);\n            quantBook.SetStartDate((end ?? start).Date.AddDays(1));\n\n            var option = quantBook.AddSecurity(canonicalOption);\n            var history = quantBook.OptionHistory(canonicalOption, start, end, resolution);\n\n            Assert.Greater(history.Count, 0);\n\n            var symbolsInHistory = history.SelectMany(slice => slice.AllData.Select(x => x.Symbol)).Distinct().ToList();\n            Assert.Greater(symbolsInHistory.Count, 1);\n\n            var underlying = symbolsInHistory.Where(x => x == canonicalOption.Underlying).ToList();\n            Assert.AreEqual(1, underlying.Count);\n\n            var contractsSymbols = symbolsInHistory.Where(x => x.SecurityType == canonicalOption.SecurityType).ToList();\n            Assert.Greater(contractsSymbols.Count, 1);\n\n            var expectedDates = new HashSet<DateTime> { start.Date };\n            if (end.HasValue && end.Value > end.Value.Date)\n            {\n                expectedDates.Add(end.Value.Date);\n            }\n\n            var dataDates = history.SelectMany(slice => slice.AllData.Where(x => contractsSymbols.Contains(x.Symbol)).Select(x => x.EndTime.Date)).ToHashSet();\n            CollectionAssert.AreEqual(expectedDates, dataDates);\n\n            // OptionUniverse must have been requested for all dates in the range\n            foreach (var date in Time.EachTradeableDay(option, start.Date, (end ?? start).Date))\n            {\n                Assert.AreEqual(1, historyProvider.HistoryRequests.Count(request => request.DataType == typeof(OptionUniverse) && request.EndTimeLocal == date));\n            }\n        }\n\n        [Test]\n        public void OptionContractQuantBookHistory()\n        {\n            using (Py.GIL())\n            {\n                var symbol = Symbol.CreateOption(\"TWX\", Market.USA, OptionStyle.American, OptionRight.Call, 70, new DateTime(2015, 01, 17));\n                var startDate = new DateTime(2014, 6, 6);\n                var securityTestHistory = _module.OptionContractHistoryTest(startDate, SecurityType.Option, symbol);\n\n                // Get the one day of data, ending on start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate);\n                Log.Trace(startEndHistory.ToString());\n                var firstIndex = (DateTime)(startEndHistory.index.values[0][4] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-1).Date, firstIndex.Date);\n            }\n        }\n\n        [Test]\n        public void OptionIndexWeekly()\n        {\n            var qb = new QuantBook();\n            var spxw = qb.AddIndexOption(Symbols.SPX, \"SPXW\");\n            spxw.SetFilter(u => u.Strikes(0, 1)\n                 // single week ahead since there are many SPXW contracts and we want to preserve performance\n                 .Expiration(0, 7)\n                 .IncludeWeeklys());\n\n            var startTime = new DateTime(2021, 1, 4);\n\n            var historyByOptionSymbol = qb.GetOptionHistory(spxw.Symbol, startTime);\n            var historyByUnderlyingSymbol = qb.GetOptionHistory(Symbols.SPX, \"SPXW\", startTime);\n\n            List<DateTime> expiry;\n            List<DateTime> byUnderlyingExpiry;\n\n            historyByOptionSymbol.GetExpiryDates().TryConvert(out expiry);\n            historyByUnderlyingSymbol.GetExpiryDates().TryConvert(out byUnderlyingExpiry);\n\n            List<decimal> strikes;\n            List<decimal> byUnderlyingStrikes;\n\n            historyByOptionSymbol.GetStrikes().TryConvert(out strikes);\n            historyByUnderlyingSymbol.GetStrikes().TryConvert(out byUnderlyingStrikes);\n\n            Assert.IsTrue(expiry.Count > 0);\n            Assert.IsTrue(expiry.SequenceEqual(byUnderlyingExpiry));\n\n            Assert.IsTrue(strikes.Count > 0);\n            Assert.IsTrue(strikes.SequenceEqual(byUnderlyingStrikes));\n        }\n\n        [Test]\n        public void OptionUnderlyingSymbolQuantBookHistory()\n        {\n            var qb = new QuantBook();\n            var twx = qb.AddEquity(\"TWX\");\n            var twxOptions = qb.AddOption(\"TWX\");\n\n            var historyByOptionSymbol = qb.GetOptionHistory(twxOptions.Symbol, new DateTime(2014, 6, 5), new DateTime(2014, 6, 6));\n            var historyByEquitySymbol = qb.GetOptionHistory(twx.Symbol, new DateTime(2014, 6, 5), new DateTime(2014, 6, 6));\n\n            List<DateTime> expiry;\n            List<DateTime> byUnderlyingExpiry;\n\n            historyByOptionSymbol.GetExpiryDates().TryConvert(out expiry);\n            historyByEquitySymbol.GetExpiryDates().TryConvert(out byUnderlyingExpiry);\n\n            List<decimal> strikes;\n            List<decimal> byUnderlyingStrikes;\n\n            historyByOptionSymbol.GetStrikes().TryConvert(out strikes);\n            historyByEquitySymbol.GetStrikes().TryConvert(out byUnderlyingStrikes);\n\n            Assert.IsTrue(expiry.Count > 0);\n            Assert.IsTrue(expiry.SequenceEqual(byUnderlyingExpiry));\n\n            Assert.IsTrue(strikes.Count > 0);\n            Assert.IsTrue(strikes.SequenceEqual(byUnderlyingStrikes));\n        }\n\n        [TestCase(182, 2)]\n        [TestCase(120, 1)]\n        public void CanonicalFutureQuantBookHistory(int maxFilter, int numberOfFutureContracts)\n        {\n            using (Py.GIL())\n            {\n                var symbol = Futures.Indices.SP500EMini;\n                var startDate = new DateTime(2013, 10, 11);\n                var securityTestHistory = _module.FutureHistoryTest(startDate, SecurityType.Future, symbol);\n\n                // Get the one day of data, ending on start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate, startDate.AddDays(-1), maxFilter);\n\n                Log.Trace(startEndHistory.index.levels[1].size.ToString());\n                Assert.AreEqual(numberOfFutureContracts, (int)startEndHistory.index.levels[1].size);\n\n                Log.Trace(startEndHistory.ToString());\n                var firstIndex = (DateTime)(startEndHistory.index.values[0][2] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-1).Date, firstIndex.Date);\n            }\n        }\n\n        [TestCase(182, 2)]\n        [TestCase(120, 1)]\n        public void CanonicalFutureIntradayQuantBookHistory(int maxFilter, int numberOfFutureContracts)\n        {\n            using (Py.GIL())\n            {\n                var symbol = Futures.Indices.SP500EMini;\n                var currentDate = new DateTime(2013, 10, 11, 18, 0, 0);\n                var securityTestHistory = _module.FutureHistoryTest(new DateTime(2013, 10, 12), SecurityType.Future, symbol);\n\n                var startEndHistory = securityTestHistory.test_daterange_overload(currentDate, new DateTime(2013, 10, 11, 10, 0, 0), maxFilter);\n\n                Log.Trace(startEndHistory.index.levels[1].size.ToString());\n                Assert.AreEqual(numberOfFutureContracts, (int)startEndHistory.index.levels[1].size);\n\n                Log.Trace(startEndHistory.ToString());\n                Assert.IsFalse((bool)startEndHistory.empty);\n            }\n        }\n\n        private static TestCaseData[] CanonicalFutureIntradayHistoryTestCases\n        {\n            get\n            {\n                var es = Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n                return\n                [\n                    new TestCaseData(es, new DateTime(2013, 10, 10), (DateTime?)null),\n                    new TestCaseData(es, new DateTime(2013, 10, 10), new DateTime(2013, 10, 10)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10), new DateTime(2013, 10, 11)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10, 0, 0, 0), new DateTime(2013, 10, 10, 15, 0, 0)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10, 10, 0, 0), new DateTime(2013, 10, 10, 15, 0, 0)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10, 10, 0, 0), new DateTime(2013, 10, 11)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10, 10, 0, 0), new DateTime(2013, 10, 11, 10, 0, 0)),\n                    new TestCaseData(es, new DateTime(2013, 10, 10, 10, 0, 0), new DateTime(2013, 10, 11, 15, 0, 0))\n                ];\n            }\n        }\n\n        [TestCaseSource(nameof(CanonicalFutureIntradayHistoryTestCases))]\n        public void CanonicalFutureIntradayQuantBookHistoryWithIntradayRange(Symbol canonicalFuture, DateTime start, DateTime? end)\n        {\n            var quantBook = new QuantBook();\n            var historyProvider = new TestHistoryProvider(quantBook.HistoryProvider);\n            quantBook.SetHistoryProvider(historyProvider);\n            quantBook.SetStartDate((end ?? start).Date.AddDays(1));\n            var future = quantBook.AddSecurity(canonicalFuture) as Future;\n            future.SetFilter(universe => universe);\n\n            var history = quantBook.FutureHistory(canonicalFuture, start, end, Resolution.Minute);\n            Assert.Greater(history.Count, 0);\n\n            var symbolsInHistory = history.SelectMany(slice => slice.AllData.Select(x => x.Symbol)).Distinct().ToList();\n            Assert.Greater(symbolsInHistory.Count, 1);\n\n            var expectedDates = new HashSet<DateTime> { start.Date };\n            if (end.HasValue && end.Value > end.Value.Date)\n            {\n                expectedDates.Add(end.Value.Date);\n            }\n\n            var dataDates = history.SelectMany(slice => slice.AllData.Select(x => x.EndTime.Date)).ToHashSet();\n            CollectionAssert.AreEqual(expectedDates, dataDates);\n\n            // FutureUniverse must have been requested for all dates in the range\n            foreach (var date in Time.EachTradeableDay(future, start.Date, (end ?? start).Date))\n            {\n                Assert.AreEqual(1, historyProvider.HistoryRequests.Count(request => request.DataType == typeof(FutureUniverse) && request.EndTimeLocal == date));\n            }\n        }\n\n        [Test]\n        public void FutureContractQuantBookHistory()\n        {\n            using (Py.GIL())\n            {\n                var symbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2014, 12, 19));\n                var startDate = new DateTime(2013, 10, 11);\n                var securityTestHistory = _module.FutureContractHistoryTest(startDate, SecurityType.Future, symbol);\n\n                // Get the one day of data, ending on start date\n                var startEndHistory = securityTestHistory.test_daterange_overload(startDate);\n                Log.Trace(startEndHistory.ToString());\n                var firstIndex = (DateTime)(startEndHistory.index.values[0][2] as PyObject).AsManagedObject(typeof(DateTime));\n                Assert.GreaterOrEqual(startDate.AddDays(-1).Date, firstIndex.Date);\n            }\n        }\n\n        [Test]\n        public void FuturesOptionsWithFutureContract()\n        {\n            using (Py.GIL())\n            {\n                var qb = new QuantBook();\n                var expiry = new DateTime(2020, 3, 20);\n                var future = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, expiry);\n                var start = new DateTime(2020, 1, 5);\n                var end = new DateTime(2020, 1, 6);\n                var history = qb.GetOptionHistory(future, start, end, Resolution.Minute, extendedMarketHours: true);\n                dynamic df = history.GetAllData();\n\n                Assert.IsNotNull(df);\n                Assert.IsFalse((bool)df.empty.AsManagedObject(typeof(bool)));\n                Assert.Greater((int)df.__len__().AsManagedObject(typeof(int)), 360);\n                Assert.AreEqual(5, (int)df.index.levels.__len__().AsManagedObject(typeof(int)));\n                Assert.IsTrue((bool)df.index.levels[0].__contains__(expiry.ToStringInvariant(\"yyyy-MM-dd\")).AsManagedObject(typeof(bool)));\n            }\n        }\n\n        [Test]\n        public void FuturesOptionsWithFutureOptionContract()\n        {\n            using (Py.GIL())\n            {\n                var qb = new QuantBook();\n                var expiry = new DateTime(2020, 3, 20);\n                var future = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, expiry);\n                var futureOption = Symbol.CreateOption(\n                    future,\n                    future.ID.Market,\n                    OptionStyle.American,\n                    OptionRight.Call,\n                    3300m,\n                    expiry);\n\n                var start = new DateTime(2020, 1, 5);\n                var end = new DateTime(2020, 1, 6);\n                var history = qb.GetOptionHistory(futureOption, start, end, Resolution.Minute, extendedMarketHours: true);\n                dynamic df = history.GetAllData();\n\n                Assert.IsNotNull(df);\n                Assert.IsFalse((bool)df.empty.AsManagedObject(typeof(bool)));\n                Assert.AreEqual(360, (int)df.__len__().AsManagedObject(typeof(int)));\n                Assert.AreEqual(5, (int)df.index.levels.__len__().AsManagedObject(typeof(int)));\n                Assert.IsTrue((bool)df.index.levels[0].__contains__(expiry.ToStringInvariant(\"yyyy-MM-dd\")).AsManagedObject(typeof(bool)));\n            }\n        }\n\n        [Test]\n        public void CanoicalFutureCrashesGetOptionHistory()\n        {\n            var qb = new QuantBook();\n            var future = Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME);\n\n            Assert.Throws<ArgumentException>(() =>\n            {\n                qb.GetOptionHistory(future, default(DateTime), DateTime.MaxValue, Resolution.Minute);\n            });\n        }\n\n        [TestCase(true, true, 1920)]\n        [TestCase(true, false, 780)]\n        [TestCase(false, true, 898)]\n        [TestCase(false, false, 390)]\n        public void OptionHistorySpecifyingFillForwardAndExtendedMarket(bool fillForward, bool extendedMarket, int expectedCount)\n        {\n            using (Py.GIL())\n            {\n                var qb = new QuantBook();\n                var start = new DateTime(2013, 10, 11);\n                var end = new DateTime(2013, 10, 15);\n\n                var spy = qb.AddEquity(\"SPY\");\n                dynamic history = qb.GetOptionHistory(spy.Symbol, start, end, Resolution.Minute, fillForward, extendedMarket).GetAllData();\n                var historyCount = (history.shape[0] as PyObject).As<int>();\n\n                Assert.AreEqual(expectedCount, historyCount);\n            }\n        }\n\n        [TestCase(true, true, 8640)]\n        [TestCase(true, false, 2700)]\n        [TestCase(false, true, 6899)]\n        [TestCase(false, false, 2249)]\n        public void FutureHistorySpecifyingFillForwardAndExtendedMarket(bool fillForward, bool extendedMarket, int expectedCount)\n        {\n            using (Py.GIL())\n            {\n                var qb = new QuantBook();\n                var start = new DateTime(2013, 10, 6);\n                var end = new DateTime(2013, 10, 15);\n\n                var future = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2013, 12, 20));\n                dynamic history = qb.GetFutureHistory(future, start, end, Resolution.Minute, fillForward, extendedMarket).GetAllData();\n                var historyCount = (history.shape[0] as PyObject).As<int>();\n\n                Assert.AreEqual(expectedCount, historyCount);\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void OptionHistoryObjectIsIterable(Language language)\n        {\n            var qb = new QuantBook();\n            var start = new DateTime(2013, 10, 11);\n            var end = new DateTime(2013, 10, 15);\n\n            var spy = qb.AddEquity(\"SPY\");\n            var history = qb.GetOptionHistory(spy.Symbol, start, end, Resolution.Minute);\n\n            Assert.DoesNotThrow(() =>\n            {\n                if (language == Language.CSharp)\n                {\n                    Assert.AreEqual(780, history.Count);\n                }\n                else\n                {\n                    using (Py.GIL())\n                    {\n                        var testModule = PyModule.FromString(\"testModule\",\n                        @\"\ndef getOptionHistory(qb, symbol, start, end, resolution):\n    return qb.GetOptionHistory(symbol, start, end, resolution)\n\ndef getHistoryCount(history):\n    return len(list(history))\n        \");\n\n                        dynamic getOptionHistory = testModule.GetAttr(\"getOptionHistory\");\n                        dynamic getHistoryCount = testModule.GetAttr(\"getHistoryCount\");\n                        var pyHistory = getOptionHistory(qb, spy.Symbol, start, end, Resolution.Minute);\n                        Assert.AreEqual(780, getHistoryCount(pyHistory).AsManagedObject(typeof(int)));\n                    }\n                }\n            });\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void FutureHistoryObjectIsIterable(Language language)\n        {\n            var qb = new QuantBook();\n            var start = new DateTime(2013, 10, 6);\n            var end = new DateTime(2013, 10, 15);\n\n            var futureSymbol = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2013, 12, 20));\n            var history = qb.GetFutureHistory(futureSymbol, start, end, Resolution.Minute);\n\n            Assert.DoesNotThrow(() =>\n            {\n                if (language == Language.CSharp)\n                {\n                    Assert.AreEqual(2700, history.Count);\n                }\n                else\n                {\n                    using (Py.GIL())\n                    {\n                        var testModule = PyModule.FromString(\"testModule\",\n                        @\"\ndef getFutureHistory(qb, symbol, start, end, resolution):\n    return qb.GetFutureHistory(symbol, start, end, resolution)\n\ndef getHistoryCount(history):\n    return len(list(history))\n        \");\n\n                        dynamic getFutureHistory = testModule.GetAttr(\"getFutureHistory\");\n                        dynamic getHistoryCount = testModule.GetAttr(\"getHistoryCount\");\n                        var pyHistory = getFutureHistory(qb, futureSymbol, start, end, Resolution.Minute);\n                        Assert.AreEqual(2700, getHistoryCount(pyHistory).AsManagedObject(typeof(int)));\n                    }\n                }\n            });\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python)]\n        public void GetOptionContractsWithFrontMonthFilter(Language language)\n        {\n            using (Py.GIL())\n            {\n                Assert.DoesNotThrow(() =>\n                {\n                    if (language == Language.CSharp)\n                    {\n                        var qb = new QuantBook();\n                        var start = new DateTime(2015, 12, 24);\n                        var end = new DateTime(2015, 12, 24);\n\n                        var goog = qb.AddEquity(\"GOOG\");\n                        var option = qb.AddOption(goog.Symbol);\n                        option.SetFilter(universe => universe.Strikes(-5, 5).FrontMonth());\n\n                        var history = qb.GetOptionHistory(goog.Symbol, start, end, Resolution.Minute, fillForward: false, extendedMarketHours: false);\n                        dynamic data = history.GetAllData();\n                        var labels = data.axes[0].names;\n                        Assert.AreEqual(\"expiry\", (labels[0] as PyObject).As<string>());\n                    }\n                    else\n                    {\n                        var testModule = PyModule.FromString(\"testModule\",\n                            @\"\nfrom AlgorithmImports import *\ndef getAllData():\n    qb = QuantBook()\n    underlying_symbol = qb.AddEquity(\"\"GOOG\"\").Symbol\n    option = qb.AddOption(underlying_symbol)\n    option.SetFilter(lambda option_filter_universe: option_filter_universe.Strikes(-5, 5).FrontMonth())\n    option_history = qb.OptionHistory(underlying_symbol, datetime(2015, 12, 24), datetime(2015, 12, 24), Resolution.Minute, fillForward=False, extendedMarketHours=False)\n    data = option_history.GetAllData()\n    return data.axes[0].names[0]\");\n\n                        dynamic getAllData = testModule.GetAttr(\"getAllData\");\n                        var data = getAllData();\n                        Assert.AreEqual(\"expiry\", data.AsManagedObject(typeof(string)));\n                    }\n                });\n            }\n        }\n\n        [Test]\n        public void HistoryDataDoesnNotReturnDataLabelWithBaseDataCollectionTypes()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistory():\n    qb = QuantBook()\n    symbol = qb.AddEquity(\"\"AAPL\"\", Resolution.Daily).symbol\n    dataset_symbol = qb.AddData(FundamentalUniverse, symbol).symbol\n    history = qb.History(dataset_symbol, datetime(2014, 3, 1), datetime(2014, 4, 1), Resolution.Daily)\n    return history\n\");\n                dynamic getHistory = testModule.GetAttr(\"getHistory\");\n                var pyHistory = getHistory() as PyObject;\n                var isHistoryEmpty = pyHistory.GetAttr(\"empty\").GetAndDispose<bool?>();\n                Assert.IsFalse(isHistoryEmpty);\n                Assert.IsFalse(pyHistory.HasAttr(\"data\"));\n            }\n        }\n\n        [Test]\n        public void HistoryDataDoesWorksCorrecltyWithoutAddingTheCustomDataInPython()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getHistory():\n    qb = QuantBook()\n    symbol = qb.AddEquity(\"\"AAPL\"\", Resolution.Daily).symbol\n    dataset_symbol = Symbol.CreateBase(FundamentalUniverse, symbol, symbol.ID.Market)\n    history = qb.History(dataset_symbol, datetime(2014, 3, 1), datetime(2014, 4, 1), Resolution.Daily)\n    return history\n\");\n                dynamic getHistory = testModule.GetAttr(\"getHistory\");\n                var pyHistory = getHistory() as PyObject;\n                var isHistoryEmpty = pyHistory.GetAttr(\"empty\").GetAndDispose<bool?>();\n                Assert.IsFalse(isHistoryEmpty);\n                Assert.IsFalse(pyHistory.HasAttr(\"data\"));\n            }\n        }\n\n        [Test]\n        public void HistoryDataDoesWorksCorrectlyWithCustomDataInPython()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nfrom datetime import datetime\n\nfrom AlgorithmImports import *\n\ndef getHistory():\n    qb = QuantBook()\n    qb.add_data(\n        type=TestTradeBar,\n        ticker='TEST1',\n        properties=SymbolProperties(\n            description='TEST1',\n            quoteCurrency='USD',\n            contractMultiplier=1,\n            minimumPriceVariation=0.01,\n            lotSize=1,\n            marketTicker='TEST1',\n        ),\n        exchange_hours=SecurityExchangeHours.always_open(TimeZones.NEW_YORK),\n        resolution=Resolution.MINUTE,\n        fill_forward=True,\n        leverage=1,\n    )\n    history = qb.history(qb.securities.keys(), datetime(2024, 8, 2), datetime(2024, 8, 3))\n    return history\n\nclass TestTradeBar(TradeBar):\n    def get_source(self, config: SubscriptionDataConfig, date: datetime, is_live_mode: bool) -> SubscriptionDataSource:\n        return SubscriptionDataSource(source='../../TestData/test.csv',\n                                      transportMedium=SubscriptionTransportMedium.LOCAL_FILE,\n                                      format=FileFormat.CSV)\n\n    def reader(self, config: SubscriptionDataConfig, line: str, date: datetime, is_live_mode: bool) -> BaseData:\n        if not line[0].isdigit():\n            return None\n        data = line.split(',')\n        bar_time = datetime.utcfromtimestamp(int(data[0]))\n\n        open = float(data[1])\n        high = float(data[2])\n        low = float(data[3])\n        close = float(data[4])\n        volume = int(float(data[7]))\n        return TradeBar(bar_time, config.symbol, open, high, low, close, volume)\n\");\n                dynamic getHistory = testModule.GetAttr(\"getHistory\");\n                var pyHistory = getHistory() as PyObject;\n                var isHistoryEmpty = pyHistory.GetAttr(\"empty\").GetAndDispose<bool?>();\n                Assert.IsFalse(isHistoryEmpty);\n                Assert.IsFalse(pyHistory.HasAttr(\"data\"));\n            }\n        }\n\n        [Test]\n        public void HistoryDataWorksCorrecltyWithoutAddingTheCustomDataInCSharp()\n        {\n            var qb = new QuantBook();\n            var symbol = qb.AddEquity(\"AAPL\", Resolution.Daily).Symbol;\n            var datasetSymbol = Symbol.CreateBase(typeof(FundamentalUniverse), symbol, symbol.ID.Market);\n            MarketHoursDatabase.Reset();\n            Assert.DoesNotThrow(() => qb.History(datasetSymbol, new DateTime(2014, 3, 1), new DateTime(2014, 4, 1), Resolution.Daily).ToList());\n        }\n\n        [Test]\n        public void HistoryDataDoesnNotReturnDataLabelWithBaseDataCollectionTypesAndPeriods()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef get_history():\n    qb = QuantBook()\n    qb.set_start_date(2014, 4, 8)\n    symbol = qb.add_equity(\"\"AAPL\"\", Resolution.DAILY).symbol\n    dataset_symbol = qb.add_data(FundamentalUniverse, symbol).symbol\n    history = qb.history(dataset_symbol, 20, Resolution.DAILY)\n    return history\n\");\n                dynamic getHistory = testModule.GetAttr(\"get_history\");\n                var pyHistory = getHistory() as PyObject;\n                var isHistoryEmpty = pyHistory.GetAttr(\"empty\").GetAndDispose<bool?>();\n                Assert.IsFalse(isHistoryEmpty);\n                Assert.IsFalse(pyHistory.HasAttr(\"data\"));\n            }\n        }\n\n        [Test]\n        public void IndicatorHistoryDoesNotReturnPeriodColumn()\n        {\n            using (Py.GIL())\n            {\n                var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef get_indicator_history():\n    qb = QuantBook()\n    qb.set_start_date(2014, 4, 8)\n    symbol = qb.add_equity(\"\"AAPL\"\", Resolution.DAILY).symbol\n    history = qb.indicator(ValueAtRisk(252, 0.95), symbol, 365, Resolution.DAILY)\n    return history\n\");\n                dynamic getHistory = testModule.GetAttr(\"get_indicator_history\");\n                var pyHistory = getHistory() as PyObject;\n                var columns = pyHistory.GetAttr(\"columns\")\n                    .InvokeMethod(\"tolist\")\n                    .AsManagedObject(typeof(List<string>)) as List<string>;\n                Assert.IsFalse(columns.Contains(\"period\"));\n                Assert.AreEqual(1, columns.Count);\n            }\n        }\n\n        private class TestHistoryProvider : HistoryProviderBase\n        {\n            private IHistoryProvider _provider;\n\n            public List<HistoryRequest> HistoryRequests { get; } = new();\n\n            public override int DataPointCount => _provider.DataPointCount;\n\n            public TestHistoryProvider(IHistoryProvider provider)\n            {\n                _provider = provider;\n            }\n\n            public override void Initialize(HistoryProviderInitializeParameters parameters)\n            {\n            }\n\n            public override IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)\n            {\n                requests = requests.ToList();\n                HistoryRequests.AddRange(requests);\n                return _provider.GetHistory(requests, sliceTimeZone);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Research/QuantBookIndicatorsTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing Python.Runtime;\nusing System;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture]\n    public class QuantBookIndicatorsTests\n    {\n        private ILogHandler _logHandler;\n        dynamic _module;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            // Store initial handler\n            _logHandler = Log.LogHandler;\n\n            SymbolCache.Clear();\n            MarketHoursDatabase.Reset();\n\n            using (Py.GIL())\n            {\n                _module = Py.Import(\"Test_QuantBookIndicator\");\n            }\n        }\n\n        [OneTimeTearDown]\n        public void OneTimeTearDown()\n        {\n            // Reset to initial handler\n            Log.LogHandler = _logHandler;\n        }\n\n        [TestCase(2013, 10, 11, SecurityType.Equity, \"SPY\")]\n        [TestCase(2014, 5, 9, SecurityType.Forex, \"EURUSD\")]\n        [TestCase(2016, 10, 9, SecurityType.Crypto, \"BTCUSD\")]\n        public void QuantBookIndicatorTests(int year, int month, int day, SecurityType securityType, string symbol)\n        {\n            using (Py.GIL())\n            {\n                var startDate = new DateTime(year, month, day);\n                var indicatorTest = _module.IndicatorTest(startDate, securityType, symbol);\n\n                var endDate = startDate;\n                startDate = endDate.AddYears(-1);\n\n                // Tests a data point indicator\n                var dfBB = indicatorTest.test_bollinger_bands(symbol, startDate, endDate, Resolution.Daily).DataFrame;\n                Assert.IsTrue(GetDataFrameLength(dfBB) > 0);\n\n                // Tests a bar indicator\n                var dfATR = indicatorTest.test_average_true_range(symbol, startDate, endDate, Resolution.Daily).DataFrame;\n                Assert.IsTrue(GetDataFrameLength(dfATR) > 0);\n\n                if (securityType == SecurityType.Forex)\n                {\n                    return;\n                }\n\n                // Tests a trade bar indicator\n                var dfOBV = indicatorTest.test_on_balance_volume(symbol, startDate, endDate, Resolution.Daily).DataFrame;\n                Assert.IsTrue(GetDataFrameLength(dfOBV) > 0);\n            }\n        }\n\n        [TestCase(2013, 10, 11, SecurityType.Equity, \"SPY\")]\n        [TestCase(2014, 5, 9, SecurityType.Forex, \"EURUSD\")]\n        [TestCase(2016, 10, 9, SecurityType.Crypto, \"BTCUSD\")]\n        public void QuantBookIndicatorTests_BackwardsCompatibility(int year, int month, int day, SecurityType securityType, string symbol)\n        {\n            using (Py.GIL())\n            {\n                var startDate = new DateTime(year, month, day);\n                var indicatorTest = _module.IndicatorTest(startDate, securityType, symbol);\n\n                var endDate = startDate;\n                startDate = endDate.AddYears(-1);\n\n                // Tests a data point indicator\n                var dfBB = indicatorTest.test_bollinger_bands_backwards_compatibility(symbol, startDate, endDate, Resolution.Daily);\n                Assert.IsTrue(GetDataFrameLength(dfBB) > 0);\n\n                // Tests a bar indicator\n                var dfATR = indicatorTest.test_average_true_range_backwards_compatibility(symbol, startDate, endDate, Resolution.Daily);\n                Assert.IsTrue(GetDataFrameLength(dfATR) > 0);\n\n                if (securityType == SecurityType.Forex)\n                {\n                    return;\n                }\n\n                // Tests a trade bar indicator\n                var dfOBV = indicatorTest.test_on_balance_volume_backwards_compatibility(symbol, startDate, endDate, Resolution.Daily);\n                Assert.IsTrue(GetDataFrameLength(dfOBV) > 0);\n            }\n        }\n\n        internal static int GetDataFrameLength(dynamic df) => (int)(df.shape[0] as PyObject).AsManagedObject(typeof(int));\n    }\n}\n"
  },
  {
    "path": "Tests/Research/QuantBookSelectionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Linq;\nusing Python.Runtime;\nusing NUnit.Framework;\nusing QuantConnect.Research;\nusing System.Collections.Generic;\nusing QuantConnect.Data.Fundamental;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Scheduling;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture]\n    public class QuantBookSelectionTests\n    {\n        private QuantBook _qb;\n        private DateTime _end;\n        private DateTime _start;\n\n        [SetUp]\n        public void Setup()\n        {\n            _qb = new QuantBook();\n            _end = new DateTime(2014, 4, 22);\n            _start = new DateTime(2014, 3, 24);\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        public void UniverseSelectionData(Language language, bool flatten = false)\n        {\n            if (language == Language.CSharp)\n            {\n                var universe = _qb.AddUniverse((IEnumerable<Fundamental> fundamentals) => fundamentals.Select(x => x.Symbol));\n                var history = _qb.UniverseHistory(universe, _start, _end).ToList();\n\n                // we asked for 4 weeks, 5 work days for each week expected\n                Assert.AreEqual(20, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() > 7000));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getUniverseHistory(qb, start, end):\n    universe = qb.AddUniverse(lambda fundamentals: [ x.Symbol for x in fundamentals ])\n\" + GetBaseImplementation(expectedCount: 7000, identation: \"    \", flatten: flatten));\n\n                    dynamic getUniverse = testModule.GetAttr(\"getUniverseHistory\");\n                    var pyHistory = getUniverse(_qb, _start, _end);\n\n                    Console.WriteLine((string)pyHistory.to_string());\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(20, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalDataCount = pyHistory.loc[date].shape[0].AsManagedObject(typeof(int));\n                            Assert.GreaterOrEqual(fundamentalDataCount, 7000);\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(20, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 20; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var type = typeof(List<Fundamental>);\n                            var fundamental = (List<Fundamental>)pyHistory.loc[index].AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Count, 7000);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp, false)]\n        [TestCase(Language.Python, false, true)]\n        [TestCase(Language.Python, false, false)]\n        [TestCase(Language.CSharp, true)]\n        [TestCase(Language.Python, true, true)]\n        [TestCase(Language.Python, true, false)]\n        public void UniverseSelection(Language language, bool useUniverseUnchanged, bool flatten = false)\n        {\n            var selectionState = false;\n            if (language == Language.CSharp)\n            {\n                var universe = _qb.AddUniverse((IEnumerable<Fundamental> fundamentals) =>\n                {\n                    if (!useUniverseUnchanged || !selectionState)\n                    {\n                        selectionState = true;\n                        return new[] { Symbols.AAPL };\n                    }\n                    // after the first call we will return 'unchanged' if 'useUniverseUnchanged' is true\n                    return Universe.Unchanged;\n                });\n                var history = _qb.UniverseHistory(universe, _start, _end).ToList();\n\n                // we asked for 4 weeks, 5 work days for each week expected\n                Assert.AreEqual(20, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() == 1));\n                Assert.IsTrue(history.All(x => x.Single().Symbol == Symbols.AAPL));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def __init__(self, useUniverseUnchanged):\n        self.useUniverseUnchanged = useUniverseUnchanged\n        self.state = False\n\n    def selection(self, fundamentals):\n        if not self.useUniverseUnchanged or not self.state:\n            self.state = True\n            return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n        return Universe.Unchanged\n\n    def getUniverseHistory(self, qb, start, end):\n        universe = qb.add_universe(self.selection)\n\" + GetBaseImplementation(expectedCount: 1, identation: \"        \", flatten: flatten)).GetAttr(\"Test\");\n\n                    var instance = testModule(useUniverseUnchanged);\n                    var pyHistory = instance.getUniverseHistory(_qb, _start, _end);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(20, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalData = pyHistory.loc[date];\n                            var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                            Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                        }\n\n                    }\n                    else\n                    {\n                        Assert.AreEqual(20, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 20; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var series = pyHistory.loc[index];\n                            var type = typeof(Fundamental[]);\n                            var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Length, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        public void UniverseSelectionWithDateRule(Language language, bool flatten = false)\n        {\n            if (language == Language.CSharp)\n            {\n                var universe = _qb.AddUniverse((IEnumerable<Fundamental> fundamentals) =>\n                {\n                    return new[] { Symbols.AAPL };\n                });\n                var history = _qb.UniverseHistory(universe, _start, _end, _qb.DateRules.WeekEnd()).ToList();\n\n                Assert.AreEqual(4, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() == 1));\n                Assert.IsTrue(history.All(x => x.Single().Symbol == Symbols.AAPL));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic testModule = PyModule.FromString(\"testModule\", @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, flatten):\n        universe = qb.add_universe(self.selection)\n        universeDataPerTime = qb.universe_history(universe, start, end, date_rule = qb.date_rules.week_end(), flatten=flatten)\n\n        if flatten:\n            for date in universeDataPerTime.index.levels[0]:\n                dateUniverseData = universeDataPerTime.loc[date]\n                dataPointCount = dateUniverseData.shape[0]\n                if dataPointCount < 1:\n                    raise ValueError(f'Unexpected historical Fundamentals data count {dataPointCount}! Expected > 0')\n        else:\n            for universeDataCollection in universeDataPerTime:\n                dataPointCount = 0\n                for fundamental in universeDataCollection:\n                    dataPointCount += 1\n                    if type(fundamental) is not Fundamental:\n                        raise ValueError(f\"\"Unexpected Fundamentals data type {type(fundamental)}! {str(fundamental)}\"\")\n                if dataPointCount < 1:\n                    raise ValueError(f\"\"Unexpected historical Fundamentals data count {dataPointCount}! Expected > expectedCount\"\")\n\n        return universeDataPerTime\n\").GetAttr(\"Test\");\n\n                    var instance = testModule();\n                    var pyHistory = instance.getUniverseHistory(_qb, _start, _end, flatten);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(4, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalData = pyHistory.loc[date];\n                            var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                            Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(4, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 4; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var series = pyHistory.loc[index];\n                            var type = typeof(Fundamental[]);\n                            var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Length, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        public void UniverseSelectionEtf(Language language, bool flatten = false)\n        {\n            _start = new DateTime(2020, 12, 1);\n            _end = new DateTime(2021, 1, 31);\n            var selectionState = false;\n            if (language == Language.CSharp)\n            {\n                var spy = Symbol.Create(\"SPY\", SecurityType.Equity, Market.USA);\n                var universe = _qb.Universe.ETF(spy, _qb.UniverseSettings, (IEnumerable<ETFConstituentUniverse> etfConstituents) =>\n                {\n                    if (!selectionState)\n                    {\n                        selectionState = true;\n                        return new[] { Symbols.AAPL };\n                    }\n                    // after the first call we will return 'unchanged' if 'useUniverseUnchanged' is true\n                    return Universe.Unchanged;\n                });\n                var history = _qb.UniverseHistory(universe, _start, _end).ToList();\n\n                // we asked for 2 weeks, 5 work days for each week expected\n                Assert.AreEqual(41, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() == 1));\n                Assert.IsTrue(history.All(x => x.Single().Symbol == Symbols.AAPL));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(ETFConstituentUniverse))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def __init__(self):\n        self.state = False\n\n    def selection(self, etfConstituents):\n        if not self.state:\n            self.state = True\n            return [ x.Symbol for x in etfConstituents if x.Symbol.Value == \"\"AAPL\"\" ]\n        return Universe.Unchanged\n\n    def getUniverseHistory(self, qb, start, end, flatten):\n        universe = qb.add_universe(qb.universe.etf(\"\"SPY\"\", Market.USA, qb.universe_settings, self.selection))\n        universeDataPerTime = qb.universe_history(universe, start, end, flatten=flatten)\n\n        if flatten:\n            for date in universeDataPerTime.index.levels[0]:\n                dateUniverseData = universeDataPerTime.loc[date]\n                dataPointCount = dateUniverseData.shape[0]\n                if dataPointCount < 1:\n                    raise ValueError(f\"\"Unexpected historical Fundamentals data count {dataPointCount}! Expected > 0\"\")\n        else:\n            for universeDataCollection in universeDataPerTime:\n                dataPointCount = 0\n                for etfConstituent in universeDataCollection:\n                    dataPointCount += 1\n                    if type(etfConstituent) is not ETFConstituentUniverse:\n                        raise ValueError(f\"\"Unexpected data type {type(etfConstituent)}! {str(ETFConstituentUniverse)}\"\")\n                if dataPointCount < 1:\n                    raise ValueError(f\"\"Unexpected historical Fundamentals data count {dataPointCount}! Expected > expectedCount\"\")\n\n        return universeDataPerTime\n\").GetAttr(\"Test\");\n\n                    var instance = testModule();\n                    var pyHistory = instance.getUniverseHistory(_qb, _start, _end, flatten);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(41, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalData = pyHistory.loc[date];\n                            var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                            Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(41, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 41; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var series = pyHistory.loc[index];\n                            var type = typeof(ETFConstituentUniverse[]);\n                            var etfConstituent = (ETFConstituentUniverse[])series.AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(etfConstituent.Length, 1);\n                            Assert.AreEqual(Symbols.AAPL, etfConstituent[0].Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        public void UniverseSelectionData_BackwardsCompatibility(Language language, bool flatten = false)\n        {\n            if (language == Language.CSharp)\n            {\n                var history = _qb.UniverseHistory<Fundamentals, Fundamental>(_start, _end).ToList();\n\n                // we asked for 4 weeks, 5 work days for each week expected\n                Assert.AreEqual(20, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() > 7000));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    var testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\ndef getUniverseHistory(qb, start, end, flatten):\n    return qb.universe_history(Fundamentals, start, end, flatten=flatten)\n                    \");\n\n                    dynamic getUniverse = testModule.GetAttr(\"getUniverseHistory\");\n                    var pyHistory = getUniverse(_qb, _start, _end, flatten);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(20, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalDataCount = pyHistory.loc[date].shape[0].AsManagedObject(typeof(int));\n                            Assert.GreaterOrEqual(fundamentalDataCount, 7000);\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(20, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 20; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var type = typeof(List<Fundamental>);\n                            var fundamental = (List<Fundamental>)pyHistory.loc[index].AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Count, 7000);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp, false)]\n        [TestCase(Language.Python, false, true)]\n        [TestCase(Language.Python, false, false)]\n        [TestCase(Language.CSharp, true)]\n        [TestCase(Language.Python, true, true)]\n        [TestCase(Language.Python, true, false)]\n        public void UniverseSelection_BackwardsCompatibility(Language language, bool useUniverseUnchanged, bool flatten = false)\n        {\n            var selectionState = false;\n            if (language == Language.CSharp)\n            {\n                var history = _qb.UniverseHistory<Fundamentals, Fundamental>(_start, _end, (fundamental) =>\n                {\n                    if (!useUniverseUnchanged || !selectionState)\n                    {\n                        selectionState = true;\n                        return new[] { Symbols.AAPL };\n                    }\n                    // after the first call we will return 'unchanged' if 'useUniverseUnchanged' is true\n                    return Universe.Unchanged;\n                }).ToList();\n\n                // we asked for 4 weeks, 5 work days for each week expected\n                Assert.AreEqual(20, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() == 1));\n                Assert.IsTrue(history.All(x => x.Single().Symbol == Symbols.AAPL));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def __init__(self, useUniverseUnchanged):\n        self.useUniverseUnchanged = useUniverseUnchanged\n        self.state = False\n\n    def selection(self, fundamentals):\n        if not self.useUniverseUnchanged or not self.state:\n            self.state = True\n            return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n        return Universe.Unchanged\n\n    def getUniverseHistory(self, qb, start, end, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection, flatten=flatten)\n\").GetAttr(\"Test\");\n\n                    var instance = testModule(useUniverseUnchanged);\n                    var pyHistory = instance.getUniverseHistory(_qb, _start, _end, flatten);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(20, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalData = pyHistory.loc[date];\n                            var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                            Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                        }\n                    }\n                    else\n                    {\n                        Assert.AreEqual(20, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 20; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var series = pyHistory.loc[index];\n                            var type = typeof(Fundamental[]);\n                            var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Length, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        [TestCase(Language.CSharp)]\n        [TestCase(Language.Python, true)]\n        [TestCase(Language.Python, false)]\n        public void GenericUniverseSelectionIsCompatibleWithDateRule(Language language, bool flatten = false)\n        {\n            if (language == Language.CSharp)\n            {\n                var history = _qb.UniverseHistory<Fundamentals, Fundamental>(_start, _end, (fundamental) =>\n                {\n                    return new[] { Symbols.AAPL };\n                }, _qb.DateRules.WeekEnd()).ToList();\n\n                // we asked for 4 weeks, 5 work days for each week expected\n                Assert.AreEqual(4, history.Count);\n                Assert.IsTrue(history.All(x => x.Count() == 1));\n                Assert.IsTrue(history.All(x => x.Single().Symbol == Symbols.AAPL));\n                Assert.IsTrue(history.All(x => x.All(fundamental => fundamental.GetType() == typeof(Fundamental))));\n            }\n            else\n            {\n                using (Py.GIL())\n                {\n                    dynamic testModule = PyModule.FromString(\"testModule\",\n                    @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection, date_rule = qb.date_rules.week_end(), flatten=flatten)\n\").GetAttr(\"Test\");\n\n                    var instance = testModule();\n                    var pyHistory = instance.getUniverseHistory(_qb, _start, _end, flatten);\n\n                    if (flatten)\n                    {\n                        Assert.AreEqual(4, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                        foreach (var date in pyHistory.index.levels[0])\n                        {\n                            var fundamentalData = pyHistory.loc[date];\n                            var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                            Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                        }\n\n                        Assert.AreEqual(4, pyHistory.__len__().AsManagedObject(typeof(int)));\n                    }\n                    else\n                    {\n                        Assert.AreEqual(4, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                        for (var i = 0; i < 4; i++)\n                        {\n                            var index = pyHistory.index[i];\n                            var series = pyHistory.loc[index];\n                            var type = typeof(Fundamental[]);\n                            var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                            Assert.GreaterOrEqual(fundamental.Length, 1);\n                            Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                        }\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void MonthlyEndGenericUniverseSelectionWorksAsExpected()\n        {\n            var history = _qb.UniverseHistory<Fundamentals, Fundamental>(\n                new DateTime(2014, 3, 24),\n                new DateTime(2014, 4, 7),\n                (fundamental) =>\n                {\n                    return new[] { Symbols.AAPL };\n                },\n                _qb.DateRules.MonthEnd(Symbols.AAPL)).ToList();\n            var lastDayOfMonth = history.Select(x => x.First()).Select(x => x.EndTime).First();\n            Assert.IsNotNull(lastDayOfMonth);\n            Assert.AreEqual(new DateTime(2014, 3, 29), lastDayOfMonth);\n        }\n\n        [Test]\n        public void MonthlyStartGenericUniverseSelectionWorksAsExpected()\n        {\n            var history = _qb.UniverseHistory<Fundamentals, Fundamental>(\n                new DateTime(2014, 3, 24),\n                new DateTime(2014, 4, 7),\n                (fundamental) =>\n                {\n                    return new[] { Symbols.AAPL };\n                },\n                _qb.DateRules.MonthStart(Symbols.AAPL)).ToList();\n            var firstDayOfMonth = history.Select(x => x.First()).Select(x => x.EndTime).First();\n            Assert.IsNotNull(firstDayOfMonth);\n            Assert.AreEqual(new DateTime(2014, 4, 1), firstDayOfMonth);\n        }\n\n        [Test]\n        public void MonthlyEndSelectionWorksAsExpected()\n        {\n            var universe = _qb.AddUniverse((IEnumerable<Fundamental> fundamentals) =>\n            {\n                return new[] { Symbols.AAPL };\n            });\n            var history = _qb.UniverseHistory(universe, new DateTime(2014, 3, 15), new DateTime(2014, 4, 7), _qb.DateRules.MonthEnd(Symbols.AAPL)).ToList();\n            var lastDayOfMonth = history.Select(x => x.First()).Select(x => x.EndTime).First();\n            Assert.IsNotNull(lastDayOfMonth);\n            Assert.AreEqual(new DateTime(2014, 3, 29), lastDayOfMonth);\n        }\n\n        [Test]\n        public void MonthlyStartSelectionWorksAsExpected()\n        {\n            var universe = _qb.AddUniverse((IEnumerable<Fundamental> fundamentals) =>\n            {\n                return new[] { Symbols.AAPL };\n            });\n            var history = _qb.UniverseHistory(universe, new DateTime(2014, 3, 15), new DateTime(2014, 4, 7), _qb.DateRules.MonthStart(Symbols.AAPL)).ToList();\n            var firstDayOfMonth = history.Select(x => x.First()).Select(x => x.EndTime).First();\n            Assert.IsNotNull(firstDayOfMonth);\n            Assert.AreEqual(new DateTime(2014, 4, 1), firstDayOfMonth);\n        }\n\n        [Test]\n        public void WeekendGenericUniverseSelectionWorksAsExpected()\n        {\n            var history = _qb.UniverseHistory<Fundamentals, Fundamental>(\n                new DateTime(2014, 3, 24),\n                new DateTime(2014, 4, 7),\n                (fundamental) =>\n                {\n                    return new[] { Symbols.AAPL };\n                },\n                _qb.DateRules.Every(DayOfWeek.Wednesday)).ToList();\n            var dates = history.Select(x => x.First()).Select(x => x.EndTime).ToList();\n            Assert.IsNotNull(dates);\n            Assert.IsTrue(dates.All(x => x.DayOfWeek == DayOfWeek.Wednesday));\n        }\n\n        [Test]\n        public void PythonMonthlyStartGenericUniverseSelectionWorksAsExpected([Values] bool flatten)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, symbol, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection, date_rule = qb.date_rules.month_start(symbol), flatten=flatten)\n\").GetAttr(\"Test\");\n\n                var instance = testModule();\n                var pyHistory = instance.getUniverseHistory(_qb, new DateTime(2014, 3, 24), new DateTime(2014, 4, 7), Symbols.AAPL, flatten);\n                Assert.AreEqual(1, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                var firstDayOfTheMonth = pyHistory.index[0][flatten ? 0 : 1].AsManagedObject(typeof(DateTime));\n                Assert.AreEqual(new DateTime(2014, 4, 1), firstDayOfTheMonth);\n            }\n        }\n\n\n        [Test]\n        public void PythonMonthlyEndGenericUniverseSelectionWorksAsExpected([Values] bool flatten)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, symbol, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection, date_rule = qb.date_rules.month_end(symbol), flatten=flatten)\n\").GetAttr(\"Test\");\n\n                var instance = testModule();\n                var pyHistory = instance.getUniverseHistory(_qb, new DateTime(2014, 3, 24), new DateTime(2014, 4, 7), Symbols.AAPL, flatten);\n                Assert.AreEqual(1, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                var firstDayOfTheMonth = (pyHistory.index[0][flatten ? 0 : 1]).AsManagedObject(typeof(DateTime));\n                Assert.AreEqual(new DateTime(2014, 3, 29), firstDayOfTheMonth);\n            }\n        }\n\n        [Test]\n        public void PythonDailyGenericUniverseSelectionWorksAsExpected([Values] bool flatten)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, symbol, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection, date_rule = qb.date_rules.every_day(), flatten=flatten)\n\").GetAttr(\"Test\");\n\n                var instance = testModule();\n                var pyHistory = instance.getUniverseHistory(_qb, new DateTime(2014, 3, 24), new DateTime(2014, 4, 7), Symbols.AAPL, flatten);\n\n                if (flatten)\n                {\n                    Assert.AreEqual(10, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                    foreach (var date in pyHistory.index.levels[0])\n                    {\n                        var fundamentalData = pyHistory.loc[date];\n                        var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                        Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                        Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                    }\n                }\n                else\n                {\n                    Assert.AreEqual(10, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                    for (var i = 0; i < 10; i++)\n                    {\n                        var index = pyHistory.index[i];\n                        var series = pyHistory.loc[index];\n                        var type = typeof(Fundamental[]);\n                        var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                        Assert.GreaterOrEqual(fundamental.Length, 1);\n                        Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void PythonWeekendGenericUniverseSelectionWorksAsExpected([Values] bool flatten)\n        {\n            using (Py.GIL())\n            {\n                dynamic testModule = PyModule.FromString(\"testModule\",\n                @\"\nfrom AlgorithmImports import *\nfrom datetime import datetime\n\nclass Test():\n    def selection(self, fundamentals):\n        return [ x.Symbol for x in fundamentals if x.Symbol.Value == \"\"AAPL\"\" ]\n\n    def getUniverseHistory(self, qb, start, end, symbol, flatten):\n        return qb.universe_history(Fundamentals, start, end, self.selection,\n            date_rule=qb.date_rules.on(datetime(2014, 3, 30), datetime(2014, 3, 31), datetime(2014, 4, 1)),\n            flatten=flatten)\n\").GetAttr(\"Test\");\n\n                var instance = testModule();\n                var pyHistory = instance.getUniverseHistory(_qb, new DateTime(2014, 3, 24), new DateTime(2014, 4, 7), Symbols.AAPL, flatten);\n\n                if (flatten)\n                {\n                    Assert.AreEqual(2, pyHistory.index.levels[0].__len__().AsManagedObject(typeof(int)));\n\n                    foreach (var date in pyHistory.index.levels[0])\n                    {\n                        var fundamentalData = pyHistory.loc[date];\n                        var fundamentalDataCount = fundamentalData.shape[0].AsManagedObject(typeof(int));\n\n                        Assert.GreaterOrEqual(fundamentalDataCount, 1);\n                        Assert.AreEqual(Symbols.AAPL, fundamentalData.index[0].AsManagedObject(typeof(Symbol)));\n                    }\n                }\n                else\n                {\n                    Assert.AreEqual(2, pyHistory.__len__().AsManagedObject(typeof(int)));\n\n                    for (var i = 0; i < 2; i++)\n                    {\n                        var index = pyHistory.index[i];\n                        var series = pyHistory.loc[index];\n                        var type = typeof(Fundamental[]);\n                        var fundamental = (Fundamental[])series.AsManagedObject(type);\n\n                        Assert.GreaterOrEqual(fundamental.Length, 1);\n                        Assert.AreEqual(Symbols.AAPL, fundamental[0].Symbol);\n                    }\n                }\n            }\n        }\n\n        [Test]\n        public void PerformSelectionDoesNotSkipDataPointWhenPreviousDataPointIsYielded()\n        {\n            var historyDataPoints = new List<BaseDataCollection>()\n            {\n                new BaseDataCollection(new DateTime(2024, 10, 14), Symbols.AAPL),\n                new BaseDataCollection(new DateTime(2024, 10, 15), Symbols.AAPL),\n                new BaseDataCollection(new DateTime(2024, 10, 17), Symbols.AAPL),\n                new BaseDataCollection(new DateTime(2024, 10, 22), Symbols.AAPL),\n            };\n\n            var dateRule = _qb.DateRules.On(new DateTime(2024, 10, 14), new DateTime(2024, 10, 16), new DateTime(2024, 10, 18));\n            var selectedDates = QuantBookTestClass.PerformSelection(historyDataPoints, new DateTime(2024, 10, 14), new DateTime(2024, 10, 22), dateRule).Select(x => x.EndTime).ToList();\n\n            for (int index = 0; index < 3; index++)\n            {\n                Assert.AreEqual(historyDataPoints[index].EndTime, selectedDates[index]);\n            }\n        }\n\n        private static string GetBaseImplementation(int expectedCount, string identation, bool flatten = true)\n        {\n            if (flatten)\n            {\n                return @\"\n{identation}universe_data_df = qb.universe_history(universe, start, end, flatten=True)\n{identation}for date in universe_data_df.index.levels[0]:\n{identation}    dateUniverseData = universe_data_df.loc[date]\n{identation}    dataPointCount = dateUniverseData.shape[0]\n{identation}    if dataPointCount < expectedCount:\n{identation}        raise ValueError(f\"\"Unexpected historical Fundamentals data count {dataPointCount}! Expected > expectedCount\"\")\n{identation}return universe_data_df\n\".Replace(\"expectedCount\", expectedCount.ToStringInvariant(), StringComparison.InvariantCulture)\n.Replace(\"{identation}\", identation, StringComparison.InvariantCulture);\n            }\n\n            return @\"\n{identation}universeDataPerTime = qb.universe_history(universe, start, end)\n{identation}for universeDataCollection in universeDataPerTime:\n{identation}    dataPointCount = 0\n{identation}    for fundamental in universeDataCollection:\n{identation}        dataPointCount += 1\n{identation}        if type(fundamental) is not Fundamental:\n{identation}            raise ValueError(f\"\"Unexpected Fundamentals data type {type(fundamental)}! {str(fundamental)}\"\")\n{identation}    if dataPointCount < expectedCount:\n{identation}        raise ValueError(f\"\"Unexpected historical Fundamentals data count {dataPointCount}! Expected > expectedCount\"\")\n{identation}return universeDataPerTime\n\".Replace(\"expectedCount\", expectedCount.ToStringInvariant(), StringComparison.InvariantCulture)\n.Replace(\"{identation}\", identation, StringComparison.InvariantCulture);\n        }\n\n        private class QuantBookTestClass: QuantBook\n        {\n            public static IEnumerable<BaseDataCollection> PerformSelection(IEnumerable<BaseDataCollection> history, DateTime start, DateTime end, IDateRule dateRule)\n            {\n                Func<BaseDataCollection, BaseDataCollection> processDataPointFunction = dataPoint => dataPoint;\n                Func<BaseDataCollection, DateTime> getTime = dataPoint => dataPoint.EndTime.Date;\n                return PerformSelection<BaseDataCollection, BaseDataCollection>(history, processDataPointFunction, getTime, start, end, dateRule);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Research/QuantBookTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Research;\nusing QuantConnect.Configuration;\nusing Newtonsoft.Json.Linq;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture]\n    public class QuantBookTests\n    {\n        [Test]\n        public void AlgorithmModeIsResearch()\n        {\n            var qb = new QuantBook();\n            Assert.AreEqual(AlgorithmMode.Research, qb.AlgorithmMode);\n        }\n\n        [TestCase(DeploymentTarget.CloudPlatform)]\n        [TestCase(DeploymentTarget.LocalPlatform)]\n        [TestCase(null)]\n        public void SetsDeploymentTarget(DeploymentTarget? deploymentTarget)\n        {\n            Config.Reset();\n            if (deploymentTarget.HasValue)\n            {\n                Config.Set(\"deployment-target\", JToken.FromObject(deploymentTarget));\n                Config.Write();\n            }\n            else\n            {\n                // The default value for deploymentTarget = DeploymentTarget.LocalPlatform\n                deploymentTarget = DeploymentTarget.LocalPlatform;\n            }\n\n            var qb = new QuantBook();\n            Assert.AreEqual(deploymentTarget, qb.DeploymentTarget);\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tests/Research/RegressionScripts/Test_QuantBookHistory.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nfrom custom_data import *\n\nclass SecurityHistoryTest():\n    def __init__(self, start_date, security_type, symbol):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(start_date)\n        self.symbol = self.qb.AddSecurity(security_type, symbol).Symbol\n        self.column = 'close'\n\n    def __str__(self):\n        return \"{} on {}\".format(self.symbol.ID, self.qb.StartDate)\n\n    def test_period_overload(self, period):\n        history = self.qb.History([self.symbol], period)\n        return history[self.column].unstack(level=0)\n\n    def test_daterange_overload(self, end):\n        start = end - timedelta(1)\n        history = self.qb.History([self.symbol], start, end)\n        return history[self.column].unstack(level=0)\n\nclass OptionHistoryTest(SecurityHistoryTest):\n    def test_daterange_overload(self, end, start = None):\n        if start is None:\n            start = end - timedelta(1)\n        history = self.qb.GetOptionHistory(self.symbol, start, end)\n        return history.GetAllData()\n\nclass FutureHistoryTest(SecurityHistoryTest):\n    def test_daterange_overload(self, end, start = None, maxFilter = 182):\n        if start is None:\n            start = end - timedelta(1)\n        self.qb.Securities[self.symbol].SetFilter(0, maxFilter) # default is 35 days\n        history = self.qb.GetFutureHistory(self.symbol, start, end)\n        return history.GetAllData()\n\nclass FutureContractHistoryTest():\n    def __init__(self, start_date, security_type, symbol):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(start_date)\n        self.symbol = symbol\n        self.column = 'close'\n\n    def test_daterange_overload(self, end):\n        start = end - timedelta(1)\n        history = self.qb.GetFutureHistory(self.symbol, start, end)\n        return history.GetAllData()\n\nclass OptionContractHistoryTest(FutureContractHistoryTest):\n    def test_daterange_overload(self, end):\n        start = end - timedelta(1)\n        history = self.qb.GetOptionHistory(self.symbol, start, end)\n        return history.GetAllData()\n\nclass CustomDataHistoryTest(SecurityHistoryTest):\n    def __init__(self, start_date, security_type, symbol):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(start_date)\n\n        if security_type == 'Nifty':\n            type = Nifty\n            self.column = 'close'\n        elif security_type == 'CustomPythonData':\n            type = CustomPythonData\n            self.column = 'close'\n        else:\n            raise\n\n        self.symbol = self.qb.AddData(type, symbol, Resolution.Daily).Symbol\n\nclass MultipleSecuritiesHistoryTest(SecurityHistoryTest):\n    def __init__(self, start_date, security_type, symbol):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(start_date)\n        self.qb.AddEquity('SPY', Resolution.Daily)\n        self.qb.AddForex('EURUSD', Resolution.Daily)\n        self.qb.AddCrypto('BTCUSD', Resolution.Daily)\n\n    def test_period_overload(self, period):\n        history = self.qb.History(self.qb.Securities.Keys, period)\n        return history['close'].unstack(level=0)\n\nclass FundamentalHistoryTest():\n    def __init__(self):\n        self.qb = QuantBook()\n\n    def getFundamentals(self, ticker, selector, start, end):\n        return self.qb.GetFundamental(ticker, selector, start, end)\n"
  },
  {
    "path": "Tests/Research/RegressionScripts/Test_QuantBookIndicator.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nclass IndicatorTest():\n    def __init__(self, start_date, security_type, symbol):\n        self.qb = QuantBook()\n        self.qb.SetStartDate(start_date)\n        self.symbol = self.qb.AddSecurity(security_type, symbol).Symbol\n\n    def __str__(self):\n        return \"{} on {}\".format(self.symbol.ID, self.qb.StartDate)\n\n    def test_bollinger_bands(self, symbol, start, end, resolution):\n        ind = BollingerBands(10, 2)\n        return self.qb.IndicatorHistory(ind, symbol, start, end, resolution)\n\n    def test_average_true_range(self, symbol, start, end, resolution):\n        ind = AverageTrueRange(14)\n        return self.qb.IndicatorHistory(ind, symbol, start, end, resolution)\n\n    def test_on_balance_volume(self, symbol, start, end, resolution):\n        ind = OnBalanceVolume(symbol)\n        return self.qb.IndicatorHistory(ind, symbol, start, end, resolution)\n    \n    def test_bollinger_bands_backwards_compatibility(self, symbol, start, end, resolution):\n        ind = BollingerBands(10, 2)\n        return self.qb.Indicator(ind, symbol, start, end, resolution)\n\n    def test_average_true_range_backwards_compatibility(self, symbol, start, end, resolution):\n        ind = AverageTrueRange(14)\n        return self.qb.Indicator(ind, symbol, start, end, resolution)\n\n    def test_on_balance_volume_backwards_compatibility(self, symbol, start, end, resolution):\n        ind = OnBalanceVolume(symbol)\n        return self.qb.Indicator(ind, symbol, start, end, resolution)\n"
  },
  {
    "path": "Tests/Research/RegressionScripts/custom_data.py",
    "content": "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom AlgorithmImports import *\n\nimport decimal\n\nclass CustomPythonData(PythonData):\n    def get_source(self, config, date, is_live):\n        source = Globals.DataFolder + \"/equity/usa/daily/ibm.zip\"\n        return SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)\n\n    def reader(self, config, line, date, is_live):\n        if line == None:\n            return None\n\n        customPythonData = CustomPythonData()\n        customPythonData.Symbol = config.Symbol\n\n        scaleFactor = 1 / 10000\n        csv = line.split(\",\")\n        customPythonData.Time = datetime.strptime(csv[0], '%Y%m%d %H:%M')\n        customPythonData[\"Open\"] = float(csv[1]) * scaleFactor\n        customPythonData[\"High\"] = float(csv[2]) * scaleFactor\n        customPythonData[\"Low\"] = float(csv[3]) * scaleFactor\n        customPythonData[\"Close\"] = float(csv[4]) * scaleFactor\n        customPythonData[\"Volume\"] = float(csv[5])\n        return customPythonData\n\nclass Nifty(PythonData):\n    '''NIFTY Custom Data Class'''\n    def get_source(self, config, date, is_live_mode):\n        return SubscriptionDataSource(\"https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1\", SubscriptionTransportMedium.REMOTE_FILE)\n\n\n    def reader(self, config, line, date, is_live_mode):\n        if not (line.strip() and line[0].isdigit()): return None\n\n        # New Nifty object\n        index = Nifty()\n        index.symbol = config.symbol\n\n        try:\n            # Example File Format:\n            # Date,       Open       High        Low       Close     Volume      Turnover\n            # 2011-09-13  7792.9    7799.9     7722.65    7748.7    116534670    6107.78\n            data = line.split(',')\n            index.time = datetime.strptime(data[0], \"%Y-%m-%d\")\n            index.value = decimal.Decimal(data[4])\n            index[\"Open\"] = float(data[1])\n            index[\"High\"] = float(data[2])\n            index[\"Low\"] = float(data[3])\n            index[\"Close\"] = float(data[4])\n\n\n        except ValueError:\n                # Do nothing\n                return None\n\n        return index\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateCustomDataTypeHistoryResearchCSharp.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Research.RegressionTemplates\n{\n    /// <summary>\n    /// Basic template framework for regression testing of research notebooks\n    /// </summary>\n    public class BasicTemplateCustomDataTypeHistoryResearchCSharp : IRegressionResearchDefinition\n    {\n        /// <summary>\n        /// Expected output from the reading the raw notebook file\n        /// </summary>\n        /// <remarks>Requires to be implemented last in the file <see cref=\"ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile\"/>\n        /// get should start from next line</remarks>\n        public string ExpectedOutput =>\n            \"{ \\\"cells\\\": [  {   \\\"cell_type\\\": \\\"markdown\\\",   \\\"id\\\": \\\"c5f3ed6d\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.003499,     \\\"end_t\" +\n            \"ime\\\": \\\"2023-02-17T23:37:52.736173\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T23:37:52.732674\\\",     \\\"status\\\": \\\"completed\\\"    \" +\n            \"},    \\\"tags\\\": []   },   \\\"source\\\": [    \\\"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/icon.png)\\\",    \\\"<hr>\\\"   ]  },  {   \\\"cell_type\" +\n            \"\\\": \\\"markdown\\\",   \\\"id\\\": \\\"2025ecbd\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.002997,     \\\"end_time\\\": \\\"2023-02-17T23:37:52.74\" +\n            \"1673\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T23:37:52.738676\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"sou\" +\n            \"rce\\\": [    \\\"# Custom data history\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 1,   \\\"id\\\": \\\"bbc993a0\\\",   \\\"metadata\\\": {    \\\"e\" +\n            \"xecution\\\": {     \\\"iopub.execute_input\\\": \\\"2023-02-17T23:37:52.761679Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-02-17T23:37:52.753179Z\\\",     \\\"iopub.st\" +\n            \"atus.idle\\\": \\\"2023-02-17T23:38:01.186963Z\\\",     \\\"shell.execute_reply\\\": \\\"2023-02-17T23:38:01.173466Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\":\" +\n            \" 8.442283,     \\\"end_time\\\": \\\"2023-02-17T23:38:01.187462\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T23:37:52.745179\\\",     \\\"statu\" +\n            \"s\\\": \\\"completed\\\"    },    \\\"tags\\\": [],    \\\"vscode\\\": {     \\\"languageId\\\": \\\"csharp\\\"    }   },   \\\"outputs\\\": [    {     \\\"data\\\": {      \\\"text/\" +\n            \"html\\\": [       \\\"\\\",       \\\"<div>\\\",       \\\"    <div id='dotnet-interactive-this-cell-122456.Microsoft.DotNet.Interactive.Http.HttpPort' style='dis\" +\n            \"play: none'>\\\",       \\\"        The below script needs to be able to find the current output cell; this is an easy method to get it.\\\",       \\\"    </\" +\n            \"div>\\\",       \\\"    <script type='text/javascript'>\\\",       \\\"async function probeAddresses(probingAddresses) {\\\",       \\\"    function timeout(ms, p\" +\n            \"romise) {\\\",       \\\"        return new Promise(function (resolve, reject) {\\\",       \\\"            setTimeout(function () {\\\",       \\\"              \" +\n            \"  reject(new Error('timeout'))\\\",       \\\"            }, ms)\\\",       \\\"            promise.then(resolve, reject)\\\",       \\\"        })\\\",       \\\"   \" +\n            \" }\\\",       \\\"\\\",       \\\"    if (Array.isArray(probingAddresses)) {\\\",       \\\"        for (let i = 0; i < probingAddresses.length; i++) {\\\",       \\\"\" +\n            \"\\\",       \\\"            let rootUrl = probingAddresses[i];\\\",       \\\"\\\",       \\\"            if (!rootUrl.endsWith('/')) {\\\",       \\\"               \" +\n            \" rootUrl = `${rootUrl}/`;\\\",       \\\"            }\\\",       \\\"\\\",       \\\"            try {\\\",       \\\"                let response = await timeout(10\" +\n            \"00, fetch(`${rootUrl}discovery`, {\\\",       \\\"                    method: 'POST',\\\",       \\\"                    cache: 'no-cache',\\\",       \\\"       \" +\n            \"             mode: 'cors',\\\",       \\\"                    timeout: 1000,\\\",       \\\"                    headers: {\\\",       \\\"                        \" +\n            \"'Content-Type': 'text/plain'\\\",       \\\"                    },\\\",       \\\"                    body: probingAddresses[i]\\\",       \\\"                }))\" +\n            \";\\\",       \\\"\\\",       \\\"                if (response.status == 200) {\\\",       \\\"                    return rootUrl;\\\",       \\\"                }\\\", \" +\n            \"      \\\"            }\\\",       \\\"            catch (e) { }\\\",       \\\"        }\\\",       \\\"    }\\\",       \\\"}\\\",       \\\"\\\",       \\\"function loadDotn\" +\n            \"etInteractiveApi() {\\\",       \\\"    probeAddresses([\\\\\\\"http://172.19.192.1:1000/\\\\\\\", \\\\\\\"http://192.168.56.1:1000/\\\\\\\", \\\\\\\"http://192.168.16.104:10\" +\n            \"00/\\\\\\\", \\\\\\\"http://127.0.0.1:1000/\\\\\\\"])\\\",       \\\"        .then((root) => {\\\",       \\\"        // use probing to find host url and api resources\\\",\" +\n            \"       \\\"        // load interactive helpers and language services\\\",       \\\"        let dotnetInteractiveRequire = require.config({\\\",       \\\"     \" +\n            \"   context: '122456.Microsoft.DotNet.Interactive.Http.HttpPort',\\\",       \\\"                paths:\\\",       \\\"            {\\\",       \\\"               \" +\n            \" 'dotnet-interactive': `${root}resources`\\\",       \\\"                }\\\",       \\\"        }) || require;\\\",       \\\"\\\",       \\\"            window.dot\" +\n            \"netInteractiveRequire = dotnetInteractiveRequire;\\\",       \\\"\\\",       \\\"            window.configureRequireFromExtension = function(extensionName, ex\" +\n            \"tensionCacheBuster) {\\\",       \\\"                let paths = {};\\\",       \\\"                paths[extensionName] = `${root}extensions/${extensionName}\" +\n            \"/resources/`;\\\",       \\\"                \\\",       \\\"                let internalRequire = require.config({\\\",       \\\"                    context: ex\" +\n            \"tensionCacheBuster,\\\",       \\\"                    paths: paths,\\\",       \\\"                    urlArgs: `cacheBuster=${extensionCacheBuster}`\\\",     \" +\n            \"  \\\"                    }) || require;\\\",       \\\"\\\",       \\\"                return internalRequire\\\",       \\\"            };\\\",       \\\"        \\\", \" +\n            \"      \\\"            dotnetInteractiveRequire([\\\",       \\\"                    'dotnet-interactive/dotnet-interactive'\\\",       \\\"                ],\\\",\" +\n            \"       \\\"                function (dotnet) {\\\",       \\\"                    dotnet.init(window);\\\",       \\\"                },\\\",       \\\"            \" +\n            \"    function (error) {\\\",       \\\"                    console.log(error);\\\",       \\\"                }\\\",       \\\"            );\\\",       \\\"        })\" +\n            \"\\\",       \\\"        .catch(error => {console.log(error);});\\\",       \\\"    }\\\",       \\\"\\\",       \\\"// ensure `require` is available globally\\\",      \" +\n            \" \\\"if ((typeof(require) !==  typeof(Function)) || (typeof(require.config) !== typeof(Function))) {\\\",       \\\"    let require_script = document.create\" +\n            \"Element('script');\\\",       \\\"    require_script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js');\\\",    \" +\n            \"   \\\"    require_script.setAttribute('type', 'text/javascript');\\\",       \\\"    \\\",       \\\"    \\\",       \\\"    require_script.onload = function() {\\\"\" +\n            \",       \\\"        loadDotnetInteractiveApi();\\\",       \\\"    };\\\",       \\\"\\\",       \\\"    document.getElementsByTagName('head')[0].appendChild(requir\" +\n            \"e_script);\\\",       \\\"}\\\",       \\\"else {\\\",       \\\"    loadDotnetInteractiveApi();\\\",       \\\"}\\\",       \\\"\\\",       \\\"    </script>\\\",       \\\"</di\" +\n            \"v>\\\"      ]     },     \\\"metadata\\\": {},     \\\"output_type\\\": \\\"display_data\\\"    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",  \" +\n            \"   \\\"text\\\": [      \\\"Initialize.csx: Loading assemblies from C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    }   ], \" +\n            \"  \\\"source\\\": [    \\\"// We need to load assemblies at the start in their own cell\\\",    \\\"#load \\\\\\\"./Initialize.csx\\\\\\\"\\\"   ]  },  {   \\\"cell_type\\\":\" +\n            \" \\\"code\\\",   \\\"execution_count\\\": 2,   \\\"id\\\": \\\"0f8ca7c8\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2023-02-17T23:38:01.\" +\n            \"204969Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-02-17T23:38:01.203966Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T23:38:01.720374Z\\\",     \\\"shell.execute\" +\n            \"_reply\\\": \\\"2023-02-17T23:38:01.718372Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.527908,     \\\"end_time\\\": \\\"2023-02-17T23:38:01.720374\\\",     \" +\n            \"\\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T23:38:01.192466\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": [],    \\\"vscode\\\": {     \\\"\" +\n            \"languageId\\\": \\\"csharp\\\"    }   },   \\\"outputs\\\": [    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23\" +\n            \":38:01.491 TRACE:: Config.GetValue(): debug-mode - Using default value: False\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stre\" +\n            \"am\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.493 TRACE:: Config.Get(): Configuration key not found. Key: results-destination-folder - Using default \" +\n            \"value: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.496 TRACE:: Config.Get(\" +\n            \"): Configuration key not found. Key: plugin-directory - Using default value: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stre\" +\n            \"am\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.501 TRACE:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default valu\" +\n            \"e: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.502 TRACE:: Composer(): Loa\" +\n            \"ding Assemblies from C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\":\" +\n            \" \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.587 TRAC\" +\n            \"E:: Config.Get(): Configuration key not found. Key: version-id - Using default value: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\"\" +\n            \": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.587 TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default valu\" +\n            \"e: ../../../Data/\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.588 TRACE:: E\" +\n            \"ngine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.5.0.0 Mode: DEBUG (64bit) Host: ABREU\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\"\" +\n            \": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.589 TRACE:: Engine.Main(): Started 7:38 PM\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"o\" +\n            \"utput_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.597 TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Usi\" +\n            \"ng default value: LocalLeanManager\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38\" +\n            \":01.619 TRACE:: Config.Get(): Configuration key not found. Key: data-permission-manager - Using default value: DataPermissionManager\\\"     ]    },    \" +\n            \"{     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.623 TRACE:: Config.Get(): Configuration key not \" +\n            \"found. Key: results-destination-folder - Using default value: C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    },    {\" +\n            \"     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20230217 23:38:01.657 TRACE:: Config.Get(): Configuration key not f\" +\n            \"ound. Key: object-store-root - Using default value: ./storage\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\" +\n            \"\\\": [      \\\"20230217 23:38:01.668 TRACE:: Config.Get(): Configuration key not found. Key: results-destination-folder - Using default value: C:\\\\\\\\Use\" +\n            \"rs\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    }   ],   \\\"source\\\": [    \\\"// Initialize Lean Engine.\\\",    \\\"#load \\\\\\\"./Qua\" +\n            \"ntConnect.csx\\\\\\\"\\\",    \\\"\\\",    \\\"using System.Globalization;\\\",    \\\"using System.Linq;\\\",    \\\"using QuantConnect;\\\",    \\\"using QuantConnect.Data;\" +\n            \"\\\",    \\\"using QuantConnect.Algorithm;\\\",    \\\"using QuantConnect.Research;\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 3,   \\\"id\\\"\" +\n            \": \\\"83870958\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2023-02-17T23:38:01.737374Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-\" +\n            \"02-17T23:38:01.735874Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T23:38:02.793265Z\\\",     \\\"shell.execute_reply\\\": \\\"2023-02-17T23:38:02.792263Z\\\"    \" +\n            \"},    \\\"papermill\\\": {     \\\"duration\\\": 1.067389,     \\\"end_time\\\": \\\"2023-02-17T23:38:02.793764\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2\" +\n            \"023-02-17T23:38:01.726375\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": [],    \\\"vscode\\\": {     \\\"languageId\\\": \\\"csharp\\\"    }   },   \\\"output\" +\n            \"s\\\": [],   \\\"source\\\": [    \\\"class CustomDataType : DynamicData\\\",    \\\"{\\\",    \\\"    public decimal Open;\\\",    \\\"    public decimal High;\\\",    \\\" \" +\n            \"   public decimal Low;\\\",    \\\"    public decimal Close;\\\",    \\\"\\\",    \\\"    public override SubscriptionDataSource GetSource(SubscriptionDataConfig \" +\n            \"config, DateTime date, bool isLiveMode)\\\",    \\\"    {\\\",    \\\"        var source = \\\\\\\"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to\" +\n            \"_my_csv_data.csv?dl=0\\\\\\\";\\\",    \\\"        return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile);\\\",    \\\"    }\\\",    \\\"\\\"\" +\n            \",    \\\"    public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\\\",    \\\"    {\\\",    \\\"        i\" +\n            \"f (string.IsNullOrWhiteSpace(line.Trim()))\\\",    \\\"        {\\\",    \\\"            return null;\\\",    \\\"        }\\\",    \\\"\\\",    \\\"        try\\\",    \\\" \" +\n            \"       {\\\",    \\\"            var csv = line.Split(\\\\\\\",\\\\\\\");\\\",    \\\"            var data = new CustomDataType()\\\",    \\\"            {\\\",    \\\"      \" +\n            \"          Symbol = config.Symbol,\\\",    \\\"                Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture).AddHours(20)\" +\n            \",\\\",    \\\"                Value = csv[4].ToDecimal(),\\\",    \\\"                Open = csv[1].ToDecimal(),\\\",    \\\"                High = csv[2].ToDecim\" +\n            \"al(),\\\",    \\\"                Low = csv[3].ToDecimal(),\\\",    \\\"                Close = csv[4].ToDecimal()\\\",    \\\"            };\\\",    \\\"\\\",    \\\"   \" +\n            \"         return data;\\\",    \\\"        }\\\",    \\\"        catch\\\",    \\\"        {\\\",    \\\"            return null;\\\",    \\\"        }\\\",    \\\"    }\\\",   \" +\n            \" \\\"}\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 4,   \\\"id\\\": \\\"ed9ea0a3\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execu\" +\n            \"te_input\\\": \\\"2023-02-17T23:38:02.815268Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-02-17T23:38:02.814265Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T23:38\" +\n            \":10.436355Z\\\",     \\\"shell.execute_reply\\\": \\\"2023-02-17T23:38:10.435324Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 7.633591,     \\\"end_time\\\": \\\"\" +\n            \"2023-02-17T23:38:10.436355\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T23:38:02.802764\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"t\" +\n            \"ags\\\": [],    \\\"vscode\\\": {     \\\"languageId\\\": \\\"csharp\\\"    }   },   \\\"outputs\\\": [    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\", \" +\n            \"    \\\"text\\\": [      \\\"PythonEngine.Initialize(): clr GetManifestResourceStream...\\\"     ]    }   ],   \\\"source\\\": [    \\\"var qb = new QuantBook();\\\",\" +\n            \"    \\\"var symbol = qb.AddData<CustomDataType>(\\\\\\\"CustomDataType\\\\\\\", Resolution.Hour).Symbol;\\\",    \\\"\\\",    \\\"var start = new DateTime(2017, 8, 20);\" +\n            \"\\\",    \\\"var end = start.AddHours(48);\\\",    \\\"var history = qb.History<CustomDataType>(symbol, start, end, Resolution.Hour).ToList();\\\",    \\\"\\\",    \" +\n            \"\\\"if (history.Count == 0)\\\",    \\\"{\\\",    \\\"    throw new Exception(\\\\\\\"No history data returned\\\\\\\");\\\",    \\\"}\\\"   ]  } ], \\\"metadata\\\": {  \\\"kernel\" +\n            \"spec\\\": {   \\\"display_name\\\": \\\".NET (C#)\\\",   \\\"language\\\": \\\"C#\\\",   \\\"name\\\": \\\".net-csharp\\\"  },  \\\"language_info\\\": {   \\\"file_extension\\\": \\\".cs\" +\n            \"\\\",   \\\"mimetype\\\": \\\"text/x-csharp\\\",   \\\"name\\\": \\\"C#\\\",   \\\"pygments_lexer\\\": \\\"csharp\\\",   \\\"version\\\": \\\"10.0\\\"  },  \\\"papermill\\\": {   \\\"default\" +\n            \"_parameters\\\": {},   \\\"duration\\\": 25.341314,   \\\"end_time\\\": \\\"2023-02-17T23:38:13.053129\\\",   \\\"environment_variables\\\": {},   \\\"exception\\\": null, \" +\n            \"  \\\"input_path\\\": \\\"C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\Research\\\\\\\\RegressionTemplates\\\\\\\\BasicTemplateCustomDat\" +\n            \"aTypeHistoryResearchCSharp.ipynb\\\",   \\\"output_path\\\": \\\"C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\Research\\\\\\\\Regressi\" +\n            \"onTemplates\\\\\\\\BasicTemplateCustomDataTypeHistoryResearchCSharp-output.ipynb\\\",   \\\"parameters\\\": {},   \\\"start_time\\\": \\\"2023-02-17T23:37:47.711815\\\"\" +\n            \",   \\\"version\\\": \\\"2.4.0\\\"  } }, \\\"nbformat\\\": 4, \\\"nbformat_minor\\\": 5}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateCustomDataTypeHistoryResearchCSharp.ipynb",
    "content": "{\n    \"cells\": [\n        {\n            \"cell_type\": \"markdown\",\n            \"metadata\": {},\n            \"source\": [ \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/icon.png)\\n\", \"<hr>\" ]\n        },\n        {\n            \"cell_type\": \"markdown\",\n            \"metadata\": {},\n            \"source\": [ \"# Custom data history\" ]\n        },\n        {\n            \"cell_type\": \"code\",\n            \"execution_count\": 1,\n            \"metadata\": { \"vscode\": { \"languageId\": \"csharp\" } },\n            \"outputs\": [],\n            \"source\": [ \"// We need to load assemblies at the start in their own cell\\n\", \"#load \\\"./Initialize.csx\\\"\" ]\n        },\n        {\n            \"cell_type\": \"code\",\n            \"execution_count\": 8,\n            \"metadata\": { \"vscode\": { \"languageId\": \"csharp\" } },\n            \"outputs\": [],\n            \"source\": [ \"// Initialize Lean Engine.\\n\", \"#load \\\"./QuantConnect.csx\\\"\\n\", \"\\n\", \"using System.Globalization;\\n\", \"using System.Linq;\\n\", \"using QuantConnect;\\n\", \"using QuantConnect.Data;\\n\", \"using QuantConnect.Algorithm;\\n\", \"using QuantConnect.Research;\" ]\n        },\n        {\n            \"cell_type\": \"code\",\n            \"execution_count\": 9,\n            \"metadata\": { \"vscode\": { \"languageId\": \"csharp\" } },\n            \"outputs\": [],\n            \"source\": [ \"class CustomDataType : DynamicData\\n\", \"{\\n\", \"    public decimal Open;\\n\", \"    public decimal High;\\n\", \"    public decimal Low;\\n\", \"    public decimal Close;\\n\", \"\\n\", \"    public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\\n\", \"    {\\n\", \"        var source = \\\"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\\\";\\n\", \"        return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile);\\n\", \"    }\\n\", \"\\n\", \"    public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\\n\", \"    {\\n\", \"        if (string.IsNullOrWhiteSpace(line.Trim()))\\n\", \"        {\\n\", \"            return null;\\n\", \"        }\\n\", \"\\n\", \"        try\\n\", \"        {\\n\", \"            var csv = line.Split(\\\",\\\");\\n\", \"            var data = new CustomDataType()\\n\", \"            {\\n\", \"                Symbol = config.Symbol,\\n\", \"                Time = DateTime.ParseExact(csv[0], DateFormat.DB, CultureInfo.InvariantCulture).AddHours(20),\\n\", \"                Value = csv[4].ToDecimal(),\\n\", \"                Open = csv[1].ToDecimal(),\\n\", \"                High = csv[2].ToDecimal(),\\n\", \"                Low = csv[3].ToDecimal(),\\n\", \"                Close = csv[4].ToDecimal()\\n\", \"            };\\n\", \"\\n\", \"            return data;\\n\", \"        }\\n\", \"        catch\\n\", \"        {\\n\", \"            return null;\\n\", \"        }\\n\", \"    }\\n\", \"}\" ]\n        },\n        {\n            \"cell_type\": \"code\",\n            \"execution_count\": 11,\n            \"metadata\": { \"vscode\": { \"languageId\": \"csharp\" } },\n            \"outputs\": [],\n            \"source\": [ \"var qb = new QuantBook();\\n\", \"var symbol = qb.AddData<CustomDataType>(\\\"CustomDataType\\\", Resolution.Hour).Symbol;\\n\", \"\\n\", \"var start = new DateTime(2017, 8, 20);\\n\", \"var end = start.AddHours(48);\\n\", \"var history = qb.History<CustomDataType>(symbol, start, end, Resolution.Hour).ToList();\\n\", \"\\n\", \"if (history.Count == 0)\\n\", \"{\\n\", \"    throw new Exception(\\\"No history data returned\\\");\\n\", \"}\" ]\n        }\n    ],\n    \"metadata\": {\n        \"kernelspec\": {\n            \"display_name\": \".NET (C#)\",\n            \"language\": \"C#\",\n            \"name\": \".net-csharp\"\n        },\n        \"language_info\": {\n            \"file_extension\": \".cs\",\n            \"mimetype\": \"text/x-csharp\",\n            \"name\": \"C#\",\n            \"pygments_lexer\": \"csharp\",\n            \"version\": \"9.0\"\n        }\n    },\n    \"nbformat\": 4,\n    \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateCustomDataTypeHistoryResearchPython.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Research.RegressionTemplates\n{\n    /// <summary>\n    /// Basic template framework for regression testing of research notebooks\n    /// </summary>\n    public class BasicTemplateCustomDataTypeHistoryResearchPython : IRegressionResearchDefinition\n    {\n        /// <summary>\n        /// Expected output from the reading the raw notebook file\n        /// </summary>\n        /// <remarks>Requires to be implemented last in the file <see cref=\"ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile\"/>\n        /// get should start from next line</remarks>\n        public string ExpectedOutput =>\n            \"{ \\\"cells\\\": [  {   \\\"cell_type\\\": \\\"markdown\\\",   \\\"id\\\": \\\"d0ea3064\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.003996,     \\\"end_t\" +\n            \"ime\\\": \\\"2023-02-17T21:33:10.586532\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T21:33:10.582536\\\",     \\\"status\\\": \\\"completed\\\"    \" +\n            \"},    \\\"tags\\\": []   },   \\\"source\\\": [    \\\"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\\",    \\\"## Welcome to \" +\n            \"The QuantConnect Research Page\\\",    \\\"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\\",    \\\"#### Con\" +\n            \"tribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\\\"   ]  },  {   \\\"cell_type\\\": \\\"m\" +\n            \"arkdown\\\",   \\\"id\\\": \\\"e3e3d0c7\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.003965,     \\\"end_time\\\": \\\"2023-02-17T21:33:10.593525\\\",\" +\n            \"     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T21:33:10.589560\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"source\\\": \" +\n            \"[    \\\"## QuantBook Basics\\\",    \\\"\\\",    \\\"### Start QuantBook\\\",    \\\"- Add the references and imports\\\",    \\\"- Create a QuantBook instance\\\"   ]  \" +\n            \"},  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 1,   \\\"id\\\": \\\"d0e8fcfc\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \" +\n            \"\\\"2023-02-17T21:33:10.602549Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-02-17T21:33:10.601530Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T21:33:10.616522Z\\\"\" +\n            \",     \\\"shell.execute_reply\\\": \\\"2023-02-17T21:33:10.614535Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.021984,     \\\"end_time\\\": \\\"2023-02-17T21\" +\n            \":33:10.618527\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T21:33:10.596543\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   }\" +\n            \",   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"import warnings\\\",    \\\"warnings.filterwarnings(\\\\\\\"ignore\\\\\\\")\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"\" +\n            \"execution_count\\\": 2,   \\\"id\\\": \\\"a845a7ca\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2023-02-17T21:33:10.627549Z\\\",     \" +\n            \"\\\"iopub.status.busy\\\": \\\"2023-02-17T21:33:10.627549Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T21:33:15.142098Z\\\",     \\\"shell.execute_reply\\\": \\\"202\" +\n            \"3-02-17T21:33:15.140599Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 4.526574,     \\\"end_time\\\": \\\"2023-02-17T21:33:15.149104\\\",     \\\"exception\\\": \" +\n            \"false,     \\\"start_time\\\": \\\"2023-02-17T21:33:10.622530\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [\" +\n            \"    \\\"# Load in our startup script, required to set runtime for PythonNet\\\",    \\\"%run ./start.py\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"executio\" +\n            \"n_count\\\": 3,   \\\"id\\\": \\\"9b0cd81c\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2023-02-17T21:33:15.162102Z\\\",     \\\"iopub.\" +\n            \"status.busy\\\": \\\"2023-02-17T21:33:15.160599Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T21:33:15.266621Z\\\",     \\\"shell.execute_reply\\\": \\\"2023-02-17T\" +\n            \"21:33:15.263102Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.117533,     \\\"end_time\\\": \\\"2023-02-17T21:33:15.270138\\\",     \\\"exception\\\": false,  \" +\n            \"   \\\"start_time\\\": \\\"2023-02-17T21:33:15.152605\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"cl\" +\n            \"ass CustomDataType(PythonData):\\\",    \\\"\\\",    \\\"    def GetSource(self, config: SubscriptionDataConfig, date: datetime, isLive: bool) -> Subscription\" +\n            \"DataSource:\\\",    \\\"        source = \\\\\\\"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\\\\\\\"\\\",    \\\"        retu\" +\n            \"rn SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile)\\\",    \\\"\\\",    \\\"    def Reader(self, config: SubscriptionDataConfig, line: \" +\n            \"str, date: datetime, isLive: bool) -> BaseData:\\\",    \\\"        if not (line.strip()):\\\",    \\\"            return None\\\",    \\\"\\\",    \\\"        data =\" +\n            \" line.split(',')\\\",    \\\"        obj_data = CustomDataType()\\\",    \\\"        obj_data.Symbol = config.Symbol\\\",    \\\"\\\",    \\\"        try:\\\",    \\\"   \" +\n            \"         obj_data.Time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S') + timedelta(hours=20)\\\",    \\\"            obj_data[\\\\\\\"open\\\\\\\"] = float(data\" +\n            \"[1])\\\",    \\\"            obj_data[\\\\\\\"high\\\\\\\"] = float(data[2])\\\",    \\\"            obj_data[\\\\\\\"low\\\\\\\"] = float(data[3])\\\",    \\\"            obj_da\" +\n            \"ta[\\\\\\\"close\\\\\\\"] = float(data[4])\\\",    \\\"            obj_data.Value = obj_data[\\\\\\\"close\\\\\\\"]\\\",    \\\"\\\",    \\\"            # property for asserting \" +\n            \"the correct data is fetched\\\",    \\\"            obj_data[\\\\\\\"some_property\\\\\\\"] = \\\\\\\"some property value\\\\\\\"\\\",    \\\"        except ValueError:\\\",   \" +\n            \" \\\"            return None\\\",    \\\"\\\",    \\\"        return obj_data\\\",    \\\"\\\",    \\\"    def __str__ (self):\\\",    \\\"        return f\\\\\\\"Time: {self.T\" +\n            \"ime}, Value: {self.Value}, SomeProperty: {self['some_property']}, Open: {self['open']}, High: {self['high']}, Low: {self['low']}, Close: {self['close'\" +\n            \"]}\\\\\\\"\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 4,   \\\"id\\\": \\\"e21f2b04\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.exe\" +\n            \"cute_input\\\": \\\"2023-02-17T21:33:15.282600Z\\\",     \\\"iopub.status.busy\\\": \\\"2023-02-17T21:33:15.281102Z\\\",     \\\"iopub.status.idle\\\": \\\"2023-02-17T21:\" +\n            \"33:17.198103Z\\\",     \\\"shell.execute_reply\\\": \\\"2023-02-17T21:33:17.196601Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 1.926991,     \\\"end_time\\\": \" +\n            \"\\\"2023-02-17T21:33:17.200100\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2023-02-17T21:33:15.273109\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"\" +\n            \"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"# Create an instance\\\",    \\\"qb = QuantBook()\\\",    \\\"symbol = qb.AddData(CustomDataType, \\\\\\\"\" +\n            \"CustomDataType\\\\\\\", Resolution.Hour).Symbol\\\",    \\\"\\\",    \\\"startDate = datetime(2017, 8, 20)\\\",    \\\"endDate = startDate + timedelta(hours=48)\\\",   \" +\n            \" \\\"history = list(qb.History[CustomDataType](symbol, startDate, endDate, Resolution.Hour))\\\",    \\\"\\\",    \\\"if len(history) == 0:\\\",    \\\"    raise Ex\" +\n            \"ception(\\\\\\\"No history data returned\\\\\\\")\\\"   ]  } ], \\\"metadata\\\": {  \\\"kernelspec\\\": {   \\\"display_name\\\": \\\"Python 3 (ipykernel)\\\",   \\\"language\\\":\" +\n            \" \\\"python\\\",   \\\"name\\\": \\\"python3\\\"  },  \\\"language_info\\\": {   \\\"codemirror_mode\\\": {    \\\"name\\\": \\\"ipython\\\",    \\\"version\\\": 3   },   \\\"file_exte\" +\n            \"nsion\\\": \\\".py\\\",   \\\"mimetype\\\": \\\"text/x-python\\\",   \\\"name\\\": \\\"python\\\",   \\\"nbconvert_exporter\\\": \\\"python\\\",   \\\"pygments_lexer\\\": \\\"ipython3\\\",\" +\n            \"   \\\"version\\\": \\\"3.8.10\\\"  },  \\\"papermill\\\": {   \\\"default_parameters\\\": {},   \\\"duration\\\": 13.405899,   \\\"end_time\\\": \\\"2023-02-17T21:33:20.058754\" +\n            \"\\\",   \\\"environment_variables\\\": {},   \\\"exception\\\": null,   \\\"input_path\\\": \\\"C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\R\" +\n            \"esearch\\\\\\\\RegressionTemplates\\\\\\\\BasicTemplateCustomDataTypeHistoryResearchPython.ipynb\\\",   \\\"output_path\\\": \\\"C:\\\\\\\\Users\\\\\\\\jhona\\\\\\\\QuantConnect\\\\\\\\L\" +\n            \"ean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\Research\\\\\\\\RegressionTemplates\\\\\\\\BasicTemplateCustomDataTypeHistoryResearchPython-output.ipynb\\\",   \\\"parameters\\\": \" +\n            \"{},   \\\"start_time\\\": \\\"2023-02-17T21:33:06.652855\\\",   \\\"version\\\": \\\"2.4.0\\\"  },  \\\"vscode\\\": {   \\\"interpreter\\\": {    \\\"hash\\\": \\\"9650cb4e16cdd4a8\" +\n            \"e8e2d128bf38d875813998db22a3c986335f89e0cb4d7bb2\\\"   }  } }, \\\"nbformat\\\": 4, \\\"nbformat_minor\\\": 5}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateCustomDataTypeHistoryResearchPython.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Add the references and imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import warnings\\n\",\n    \"warnings.filterwarnings(\\\"ignore\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Load in our startup script, required to set runtime for PythonNet\\n\",\n    \"%run ./start.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"class CustomDataType(PythonData):\\n\",\n    \"\\n\",\n    \"    def GetSource(self, config: SubscriptionDataConfig, date: datetime, isLive: bool) -> SubscriptionDataSource:\\n\",\n    \"        source = \\\"https://www.dl.dropboxusercontent.com/s/d83xvd7mm9fzpk0/path_to_my_csv_data.csv?dl=0\\\"\\n\",\n    \"        return SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile)\\n\",\n    \"\\n\",\n    \"    def Reader(self, config: SubscriptionDataConfig, line: str, date: datetime, isLive: bool) -> BaseData:\\n\",\n    \"        if not (line.strip()):\\n\",\n    \"            return None\\n\",\n    \"\\n\",\n    \"        data = line.split(',')\\n\",\n    \"        obj_data = CustomDataType()\\n\",\n    \"        obj_data.Symbol = config.Symbol\\n\",\n    \"\\n\",\n    \"        try:\\n\",\n    \"            obj_data.Time = datetime.strptime(data[0], '%Y-%m-%d %H:%M:%S') + timedelta(hours=20)\\n\",\n    \"            obj_data[\\\"open\\\"] = float(data[1])\\n\",\n    \"            obj_data[\\\"high\\\"] = float(data[2])\\n\",\n    \"            obj_data[\\\"low\\\"] = float(data[3])\\n\",\n    \"            obj_data[\\\"close\\\"] = float(data[4])\\n\",\n    \"            obj_data.Value = obj_data[\\\"close\\\"]\\n\",\n    \"\\n\",\n    \"            # property for asserting the correct data is fetched\\n\",\n    \"            obj_data[\\\"some_property\\\"] = \\\"some property value\\\"\\n\",\n    \"        except ValueError:\\n\",\n    \"            return None\\n\",\n    \"\\n\",\n    \"        return obj_data\\n\",\n    \"\\n\",\n    \"    def __str__ (self):\\n\",\n    \"        return f\\\"Time: {self.Time}, Value: {self.Value}, SomeProperty: {self['some_property']}, Open: {self['open']}, High: {self['high']}, Low: {self['low']}, Close: {self['close']}\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Create an instance\\n\",\n    \"qb = QuantBook()\\n\",\n    \"symbol = qb.AddData(CustomDataType, \\\"CustomDataType\\\", Resolution.Hour).Symbol\\n\",\n    \"\\n\",\n    \"startDate = datetime(2017, 8, 20)\\n\",\n    \"endDate = startDate + timedelta(hours=48)\\n\",\n    \"history = list(qb.History[CustomDataType](symbol, startDate, endDate, Resolution.Hour))\\n\",\n    \"\\n\",\n    \"if len(history) == 0:\\n\",\n    \"    raise Exception(\\\"No history data returned\\\")\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.8.10\"\n  },\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"9650cb4e16cdd4a8e8e2d128bf38d875813998db22a3c986335f89e0cb4d7bb2\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateResearchCSharp.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Research.RegressionTemplates\n{\n    /// <summary>\n    /// Basic template framework for regression testing of research notebooks\n    /// </summary>\n    public class BasicTemplateResearchCSharp : IRegressionResearchDefinition\n    {\n        /// <summary>\n        /// Expected output from the reading the raw notebook file\n        /// </summary>\n        /// <remarks>Requires to be implemented last in the file <see cref=\"ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile\"/>\n        /// get should start from next line</remarks>\n        public string ExpectedOutput =>\n            \"{ \\\"cells\\\": [  {   \\\"cell_type\\\": \\\"markdown\\\",   \\\"id\\\": \\\"a4652bd4\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.005036,     \\\"end_t\" +\n            \"ime\\\": \\\"2022-03-02T20:44:55.508287\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:55.503251\\\",     \\\"status\\\": \\\"completed\\\"    \" +\n            \"},    \\\"tags\\\": []   },   \\\"source\\\": [    \\\"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\\",    \\\"## Welcome to \" +\n            \"The QuantConnect Research Page\\\",    \\\"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\\",    \\\"#### Con\" +\n            \"tribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\\\"   ]  },  {   \\\"cell_type\\\": \\\"m\" +\n            \"arkdown\\\",   \\\"id\\\": \\\"acb5aec0\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.002024,     \\\"end_time\\\": \\\"2022-03-02T20:44:55.513310\\\",\" +\n            \"     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:55.511286\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"source\\\": \" +\n            \"[    \\\"## QuantBook Basics\\\",    \\\"\\\",    \\\"### Start QuantBook\\\",    \\\"- Add the references and imports\\\",    \\\"- Create a QuantBook instance\\\"   ]  \" +\n            \"},  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 1,   \\\"id\\\": \\\"39de525f\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \" +\n            \"\\\"2022-03-02T20:44:55.529252Z\\\",     \\\"iopub.status.busy\\\": \\\"2022-03-02T20:44:55.522252Z\\\",     \\\"iopub.status.idle\\\": \\\"2022-03-02T20:44:57.058250Z\\\"\" +\n            \",     \\\"shell.execute_reply\\\": \\\"2022-03-02T20:44:57.052865Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 1.542006,     \\\"end_time\\\": \\\"2022-03-02T20\" +\n            \":44:57.058250\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:55.516244\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   }\" +\n            \",   \\\"outputs\\\": [    {     \\\"data\\\": {      \\\"text/html\\\": [       \\\"\\\",       \\\"<div>\\\",       \\\"    <div id='dotnet-interactive-this-cell-4972.Micr\" +\n            \"osoft.DotNet.Interactive.Http.HttpPort' style='display: none'>\\\",       \\\"        The below script needs to be able to find the current output cell; t\" +\n            \"his is an easy method to get it.\\\",       \\\"    </div>\\\",       \\\"    <script type='text/javascript'>\\\",       \\\"async function probeAddresses(probing\" +\n            \"Addresses) {\\\",       \\\"    function timeout(ms, promise) {\\\",       \\\"        return new Promise(function (resolve, reject) {\\\",       \\\"            \" +\n            \"setTimeout(function () {\\\",       \\\"                reject(new Error('timeout'))\\\",       \\\"            }, ms)\\\",       \\\"            promise.then(res\" +\n            \"olve, reject)\\\",       \\\"        })\\\",       \\\"    }\\\",       \\\"\\\",       \\\"    if (Array.isArray(probingAddresses)) {\\\",       \\\"        for (let i =\" +\n            \" 0; i < probingAddresses.length; i++) {\\\",       \\\"\\\",       \\\"            let rootUrl = probingAddresses[i];\\\",       \\\"\\\",       \\\"            if (!\" +\n            \"rootUrl.endsWith('/')) {\\\",       \\\"                rootUrl = `${rootUrl}/`;\\\",       \\\"            }\\\",       \\\"\\\",       \\\"            try {\\\",     \" +\n            \"  \\\"                let response = await timeout(1000, fetch(`${rootUrl}discovery`, {\\\",       \\\"                    method: 'POST',\\\",       \\\"      \" +\n            \"              cache: 'no-cache',\\\",       \\\"                    mode: 'cors',\\\",       \\\"                    timeout: 1000,\\\",       \\\"               \" +\n            \"     headers: {\\\",       \\\"                        'Content-Type': 'text/plain'\\\",       \\\"                    },\\\",       \\\"                    body:\" +\n            \" probingAddresses[i]\\\",       \\\"                }));\\\",       \\\"\\\",       \\\"                if (response.status == 200) {\\\",       \\\"                 \" +\n            \"   return rootUrl;\\\",       \\\"                }\\\",       \\\"            }\\\",       \\\"            catch (e) { }\\\",       \\\"        }\\\",       \\\"    }\\\",\" +\n            \"       \\\"}\\\",       \\\"\\\",       \\\"function loadDotnetInteractiveApi() {\\\",       \\\"    probeAddresses([\\\\\\\"http://192.168.29.151:1000/\\\\\\\", \\\\\\\"http:/\" +\n            \"/127.0.0.1:1000/\\\\\\\"])\\\",       \\\"        .then((root) => {\\\",       \\\"        // use probing to find host url and api resources\\\",       \\\"        //\" +\n            \" load interactive helpers and language services\\\",       \\\"        let dotnetInteractiveRequire = require.config({\\\",       \\\"        context: '4972.M\" +\n            \"icrosoft.DotNet.Interactive.Http.HttpPort',\\\",       \\\"                paths:\\\",       \\\"            {\\\",       \\\"                'dotnet-interactive'\" +\n            \": `${root}resources`\\\",       \\\"                }\\\",       \\\"        }) || require;\\\",       \\\"\\\",       \\\"            window.dotnetInteractiveRequire\" +\n            \" = dotnetInteractiveRequire;\\\",       \\\"\\\",       \\\"            window.configureRequireFromExtension = function(extensionName, extensionCacheBuster) {\" +\n            \"\\\",       \\\"                let paths = {};\\\",       \\\"                paths[extensionName] = `${root}extensions/${extensionName}/resources/`;\\\",     \" +\n            \"  \\\"                \\\",       \\\"                let internalRequire = require.config({\\\",       \\\"                    context: extensionCacheBuster,\\\"\" +\n            \",       \\\"                    paths: paths,\\\",       \\\"                    urlArgs: `cacheBuster=${extensionCacheBuster}`\\\",       \\\"                 \" +\n            \"   }) || require;\\\",       \\\"\\\",       \\\"                return internalRequire\\\",       \\\"            };\\\",       \\\"        \\\",       \\\"            d\" +\n            \"otnetInteractiveRequire([\\\",       \\\"                    'dotnet-interactive/dotnet-interactive'\\\",       \\\"                ],\\\",       \\\"            \" +\n            \"    function (dotnet) {\\\",       \\\"                    dotnet.init(window);\\\",       \\\"                },\\\",       \\\"                function (error) \" +\n            \"{\\\",       \\\"                    console.log(error);\\\",       \\\"                }\\\",       \\\"            );\\\",       \\\"        })\\\",       \\\"        .\" +\n            \"catch(error => {console.log(error);});\\\",       \\\"    }\\\",       \\\"\\\",       \\\"// ensure `require` is available globally\\\",       \\\"if ((typeof(requir\" +\n            \"e) !==  typeof(Function)) || (typeof(require.config) !== typeof(Function))) {\\\",       \\\"    let require_script = document.createElement('script');\\\",\" +\n            \"       \\\"    require_script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js');\\\",       \\\"    require_scri\" +\n            \"pt.setAttribute('type', 'text/javascript');\\\",       \\\"    \\\",       \\\"    \\\",       \\\"    require_script.onload = function() {\\\",       \\\"        loa\" +\n            \"dDotnetInteractiveApi();\\\",       \\\"    };\\\",       \\\"\\\",       \\\"    document.getElementsByTagName('head')[0].appendChild(require_script);\\\",       \\\"\" +\n            \"}\\\",       \\\"else {\\\",       \\\"    loadDotnetInteractiveApi();\\\",       \\\"}\\\",       \\\"\\\",       \\\"    </script>\\\",       \\\"</div>\\\"      ]     },    \" +\n            \" \\\"metadata\\\": {},     \\\"output_type\\\": \\\"display_data\\\"    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"\" +\n            \"Initialize.csx: Loading assemblies from D:\\\\\\\\quantconnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    }   ],   \\\"source\\\": [    \\\"// QuantBook C# Res\" +\n            \"earch Environment\\\",    \\\"// For more information see https://www.quantconnect.com/docs/research/overview\\\",    \\\"#load \\\\\\\"./Initialize.csx\\\\\\\"\\\"   ]\" +\n            \"  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 2,   \\\"id\\\": \\\"ceb0015a\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\"\" +\n            \": \\\"2022-03-02T20:44:57.066259Z\\\",     \\\"iopub.status.busy\\\": \\\"2022-03-02T20:44:57.066259Z\\\",     \\\"iopub.status.idle\\\": \\\"2022-03-02T20:44:57.188021\" +\n            \"Z\\\",     \\\"shell.execute_reply\\\": \\\"2022-03-02T20:44:57.187022Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.126763,     \\\"end_time\\\": \\\"2022-03-02\" +\n            \"T20:44:57.188021\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:57.061258\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": [] \" +\n            \"  },   \\\"outputs\\\": [    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.140 TRACE:: Config.GetV\" +\n            \"alue(): debug-mode - Using default value: False\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"2\" +\n            \"0220302 20:44:57.141 TRACE:: Config.Get(): Configuration key not found. Key: results-destination-folder - Using default value: \\\"     ]    },    {    \" +\n            \" \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.141 TRACE:: Config.Get(): Configuration key not found\" +\n            \". Key: plugin-directory - Using default value: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"2\" +\n            \"0220302 20:44:57.142 TRACE:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default value: \\\"     ]    },    {     \\\"n\" +\n            \"ame\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.142 TRACE:: Composer(): Loading Assemblies from D:\\\\\\\\qua\" +\n            \"ntconnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    },    {     \\\"\" +\n            \"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.168 TRACE:: Config.Get(): Configuration key not found. K\" +\n            \"ey: version-id - Using default value: \\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 2\" +\n            \"0:44:57.169 TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: ../../../Data/\\\"     ]    },    {     \\\"name\" +\n            \"\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.169 TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v\" +\n            \"2.5.0.0 Mode: DEBUG (64bit) Host: P3561-70DPBL3\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"2\" +\n            \"0220302 20:44:57.171 TRACE:: Engine.Main(): Started 2:14 AM\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\"\" +\n            \": [      \\\"20220302 20:44:57.173 TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value: LocalLeanManager\\\"  \" +\n            \"   ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.179 TRACE:: Config.Get(): Configur\" +\n            \"ation key not found. Key: data-permission-manager - Using default value: DataPermissionManager\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"outp\" +\n            \"ut_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.180 TRACE:: Config.Get(): Configuration key not found. Key: results-destination-folder\" +\n            \" - Using default value: D:\\\\\\\\quantconnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\" +\n            \"\\\",     \\\"text\\\": [      \\\"20220302 20:44:57.185 TRACE:: Config.Get(): Configuration key not found. Key: object-store-root - Using default value: ./st\" +\n            \"orage\\\"     ]    }   ],   \\\"source\\\": [    \\\"#load \\\\\\\"./QuantConnect.csx\\\\\\\"\\\",    \\\"\\\",    \\\"using QuantConnect;\\\",    \\\"using QuantConnect.Data;\\\",\" +\n            \"    \\\"using QuantConnect.Algorithm;\\\",    \\\"using QuantConnect.Research;\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 3,   \\\"id\\\": \\\"\" +\n            \"e81ef855\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2022-03-02T20:44:57.200095Z\\\",     \\\"iopub.status.busy\\\": \\\"2022-03-0\" +\n            \"2T20:44:57.199026Z\\\",     \\\"iopub.status.idle\\\": \\\"2022-03-02T20:44:58.393456Z\\\",     \\\"shell.execute_reply\\\": \\\"2022-03-02T20:44:58.392457Z\\\"    },  \" +\n            \"  \\\"papermill\\\": {     \\\"duration\\\": 1.200436,     \\\"end_time\\\": \\\"2022-03-02T20:44:58.393456\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-\" +\n            \"03-02T20:44:57.193020\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\":\" +\n            \" \\\"stream\\\",     \\\"text\\\": [      \\\"PythonEngine.Initialize(): Runtime.Initialize()...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\"\" +\n            \": \\\"stream\\\",     \\\"text\\\": [      \\\"Runtime.Initialize(): Py_Initialize...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\" +\n            \"\\\",     \\\"text\\\": [      \\\"Runtime.Initialize(): PyEval_InitThreads...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",  \" +\n            \"   \\\"text\\\": [      \\\"Runtime.Initialize(): Initialize types...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"te\" +\n            \"xt\\\": [      \\\"Runtime.Initialize(): Initialize types end.\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\":\" +\n            \" [      \\\"Runtime.Initialize(): AssemblyManager.Initialize()...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"te\" +\n            \"xt\\\": [      \\\"Runtime.Initialize(): AssemblyManager.UpdatePath()...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",    \" +\n            \" \\\"text\\\": [      \\\"PythonEngine.Initialize(): GetCLRModule()...\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"t\" +\n            \"ext\\\": [      \\\"PythonEngine.Initialize(): clr GetManifestResourceStream...\\\"     ]    }   ],   \\\"source\\\": [    \\\"var qb = new QuantBook();\\\",    \\\"v\" +\n            \"ar spy = qb.AddEquity(\\\\\\\"SPY\\\\\\\");\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 4,   \\\"id\\\": \\\"06cd5f47\\\",   \\\"metadata\\\": {    \\\"e\" +\n            \"xecution\\\": {     \\\"iopub.execute_input\\\": \\\"2022-03-02T20:44:58.408454Z\\\",     \\\"iopub.status.busy\\\": \\\"2022-03-02T20:44:58.408454Z\\\",     \\\"iopub.st\" +\n            \"atus.idle\\\": \\\"2022-03-02T20:44:58.449457Z\\\",     \\\"shell.execute_reply\\\": \\\"2022-03-02T20:44:58.449457Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\":\" +\n            \" 0.048992,     \\\"end_time\\\": \\\"2022-03-02T20:44:58.449457\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:58.400465\\\",     \\\"statu\" +\n            \"s\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"var startDate = new DateTime(2021,1,1);\\\",    \\\"var endDate = ne\" +\n            \"w DateTime(2021,12,31);\\\",    \\\"var history = qb.History(qb.Securities.Keys, startDate, endDate, Resolution.Daily);\\\"   ]  },  {   \\\"cell_type\\\": \\\"co\" +\n            \"de\\\",   \\\"execution_count\\\": 5,   \\\"id\\\": \\\"37b045b2\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2022-03-02T20:44:58.46348\" +\n            \"5Z\\\",     \\\"iopub.status.busy\\\": \\\"2022-03-02T20:44:58.463485Z\\\",     \\\"iopub.status.idle\\\": \\\"2022-03-02T20:44:58.611572Z\\\",     \\\"shell.execute_repl\" +\n            \"y\\\": \\\"2022-03-02T20:44:58.611572Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.156117,     \\\"end_time\\\": \\\"2022-03-02T20:44:58.611572\\\",     \\\"exc\" +\n            \"eption\\\": false,     \\\"start_time\\\": \\\"2022-03-02T20:44:58.455455\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [    {   \" +\n            \"  \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"SPY: O: 374.075 H: 374.2245 L: 363.6392 C: 367.5863 V: 94685703\\\"     \" +\n            \"]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"SPY: O: 366.8487 H: 371.2642 L: 366.8487 C: 370.118 V: \" +\n            \"54790079\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"SPY: O: 368.4634 H: 375.7495 L: 367.9152\" +\n            \" C: 372.3307 V: 93254510\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"SPY: O: 374.9521 H: 378.\" +\n            \"65 L: 374.693 C: 377.8626 V: 62474792\\\"     ]    },    {     \\\"name\\\": \\\"stdout\\\",     \\\"output_type\\\": \\\"stream\\\",     \\\"text\\\": [      \\\"SPY: O: 379\" +\n            \".3876 H: 380.2448 L: 375.8791 C: 380.0156 V: 63370827\\\"     ]    }   ],   \\\"source\\\": [    \\\"foreach(var slice in history.Take(5)) {\\\",    \\\"    Conso\" +\n            \"le.WriteLine(slice.Bars[spy.Symbol].ToString());\\\",    \\\"}\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": null,   \\\"id\\\": \\\"bd2ab8d7\\\"\" +\n            \",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.006983,     \\\"end_time\\\": \\\"2022-03-02T20:44:58.626572\\\",     \\\"exception\\\": false,     \\\"\" +\n            \"start_time\\\": \\\"2022-03-02T20:44:58.619589\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": []  } ], \\\"met\" +\n            \"adata\\\": {  \\\"kernelspec\\\": {   \\\"display_name\\\": \\\".NET (C#)\\\",   \\\"language\\\": \\\"C#\\\",   \\\"name\\\": \\\".net-csharp\\\"  },  \\\"language_info\\\": {   \\\"fil\" +\n            \"e_extension\\\": \\\".cs\\\",   \\\"mimetype\\\": \\\"text/x-csharp\\\",   \\\"name\\\": \\\"C#\\\",   \\\"pygments_lexer\\\": \\\"csharp\\\",   \\\"version\\\": \\\"9.0\\\"  },  \\\"papermi\" +\n            \"ll\\\": {   \\\"default_parameters\\\": {},   \\\"duration\\\": 7.291395,   \\\"end_time\\\": \\\"2022-03-02T20:45:01.252292\\\",   \\\"environment_variables\\\": {},   \\\"e\" +\n            \"xception\\\": null,   \\\"input_path\\\": \\\"D:\\\\\\\\quantconnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\BasicTemplateResearchCSharp.ipynb\\\",   \\\"output_path\\\": \\\"\" +\n            \"D:\\\\\\\\quantconnect\\\\\\\\Lean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\BasicTemplateResearchCSharp-output.ipynb\\\",   \\\"parameters\\\": {},   \\\"start_time\\\": \\\"2022-03-0\" +\n            \"2T20:44:53.960897\\\",   \\\"version\\\": \\\"2.3.4\\\"  } }, \\\"nbformat\\\": 4, \\\"nbformat_minor\\\": 5}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateResearchCSharp.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Add the references and imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"// QuantBook C# Research Environment\\n\",\n    \"// For more information see https://www.quantconnect.com/docs/research/overview\\n\",\n    \"#load \\\"./Initialize.csx\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#load \\\"./QuantConnect.csx\\\"\\n\",\n    \"\\n\",\n    \"using QuantConnect;\\n\",\n    \"using QuantConnect.Data;\\n\",\n    \"using QuantConnect.Algorithm;\\n\",\n    \"using QuantConnect.Research;\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"var qb = new QuantBook();\\n\",\n    \"var spy = qb.AddEquity(\\\"SPY\\\");\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"var startDate = new DateTime(2021,1,1);\\n\",\n    \"var endDate = new DateTime(2021,12,31);\\n\",\n    \"var history = qb.History(qb.Securities.Keys, startDate, endDate, Resolution.Daily);\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"foreach(var slice in history.Take(5)) {\\n\",\n    \"    Console.WriteLine(slice.Bars[spy.Symbol].ToString());\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \".NET (C#)\",\n   \"language\": \"C#\",\n   \"name\": \".net-csharp\"\n  },\n  \"language_info\": {\n   \"file_extension\": \".cs\",\n   \"mimetype\": \"text/x-csharp\",\n   \"name\": \"C#\",\n   \"pygments_lexer\": \"csharp\",\n   \"version\": \"9.0\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateResearchPython.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\n\nnamespace QuantConnect.Tests.Research.RegressionTemplates\n{\n    /// <summary>\n    /// Basic template framework for regression testing of research notebooks\n    /// </summary>\n    public class BasicTemplateResearchPython : IRegressionResearchDefinition\n    {\n        /// <summary>\n        /// Expected output from the reading the raw notebook file\n        /// </summary>\n        /// <remarks>Requires to be implemented last in the file <see cref=\"ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile\"/>\n        /// get should start from next line</remarks>\n        public string ExpectedOutput =>\n            \"{ \\\"cells\\\": [  {   \\\"cell_type\\\": \\\"markdown\\\",   \\\"id\\\": \\\"f5416762\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.001898,     \\\"end_t\" +\n            \"ime\\\": \\\"2024-06-06T22:15:49.572477\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:49.570579\\\",     \\\"status\\\": \\\"completed\\\"    \" +\n            \"},    \\\"tags\\\": []   },   \\\"source\\\": [    \\\"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\\",    \\\"## Welcome to \" +\n            \"The QuantConnect Research Page\\\",    \\\"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\\",    \\\"#### Con\" +\n            \"tribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\\\"   ]  },  {   \\\"cell_type\\\": \\\"m\" +\n            \"arkdown\\\",   \\\"id\\\": \\\"44ed65de\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.001,     \\\"end_time\\\": \\\"2024-06-06T22:15:49.574475\\\",   \" +\n            \"  \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:49.573475\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"source\\\": [  \" +\n            \"  \\\"## QuantBook Basics\\\",    \\\"\\\",    \\\"### Start QuantBook\\\",    \\\"- Add the references and imports\\\",    \\\"- Create a QuantBook instance\\\"   ]  }, \" +\n            \" {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 1,   \\\"id\\\": \\\"677a4f25\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2\" +\n            \"024-06-06T22:15:49.577476Z\\\",     \\\"iopub.status.busy\\\": \\\"2024-06-06T22:15:49.577476Z\\\",     \\\"iopub.status.idle\\\": \\\"2024-06-06T22:15:49.581464Z\\\", \" +\n            \"    \\\"shell.execute_reply\\\": \\\"2024-06-06T22:15:49.581464Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.006902,     \\\"end_time\\\": \\\"2024-06-06T22:1\" +\n            \"5:49.582478\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:49.575576\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   }, \" +\n            \"  \\\"outputs\\\": [],   \\\"source\\\": [    \\\"import warnings\\\",    \\\"warnings.filterwarnings(\\\\\\\"ignore\\\\\\\")\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"ex\" +\n            \"ecution_count\\\": 2,   \\\"id\\\": \\\"e752d505\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2024-06-06T22:15:49.584480Z\\\",     \\\"\" +\n            \"iopub.status.busy\\\": \\\"2024-06-06T22:15:49.584480Z\\\",     \\\"iopub.status.idle\\\": \\\"2024-06-06T22:15:51.028418Z\\\",     \\\"shell.execute_reply\\\": \\\"2024-\" +\n            \"06-06T22:15:51.028418Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 1.445955,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.029433\\\",     \\\"exception\\\": fa\" +\n            \"lse,     \\\"start_time\\\": \\\"2024-06-06T22:15:49.583478\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [  \" +\n            \"  \\\"# Load in our startup script, required to set runtime for PythonNet\\\",    \\\"%run ./start.py\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_\" +\n            \"count\\\": 3,   \\\"id\\\": \\\"08d48a2d\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2024-06-06T22:15:51.032433Z\\\",     \\\"iopub.st\" +\n            \"atus.busy\\\": \\\"2024-06-06T22:15:51.032433Z\\\",     \\\"iopub.status.idle\\\": \\\"2024-06-06T22:15:51.344980Z\\\",     \\\"shell.execute_reply\\\": \\\"2024-06-06T22\" +\n            \":15:51.344980Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.315568,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.345999\\\",     \\\"exception\\\": false,    \" +\n            \" \\\"start_time\\\": \\\"2024-06-06T22:15:51.030431\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"# Cr\" +\n            \"eate an instance\\\",    \\\"qb = QuantBook()\\\",    \\\"\\\",    \\\"# Select asset data\\\",    \\\"spy = qb.AddEquity(\\\\\\\"SPY\\\\\\\")\\\"   ]  },  {   \\\"cell_type\\\": \\\"\" +\n            \"markdown\\\",   \\\"id\\\": \\\"07f707ad\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.000998,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.348997\\\"\" +\n            \",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:51.347999\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"source\\\":\" +\n            \" [    \\\"### Historical Data Requests\\\",    \\\"\\\",    \\\"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as \" +\n            \"multi-index pandas.DataFrame where the first index is the Symbol.\\\",    \\\"\\\",    \\\"For more information, please follow the [link](https://www.quantcon\" +\n            \"nect.com/docs#Historical-Data-Historical-Data-Requests).\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 4,   \\\"id\\\": \\\"ef440f9e\\\",   \\\"\" +\n            \"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2024-06-06T22:15:51.352999Z\\\",     \\\"iopub.status.busy\\\": \\\"2024-06-06T22:15:51.35299\" +\n            \"9Z\\\",     \\\"iopub.status.idle\\\": \\\"2024-06-06T22:15:51.356860Z\\\",     \\\"shell.execute_reply\\\": \\\"2024-06-06T22:15:51.356860Z\\\"    },    \\\"papermill\\\":\" +\n            \" {     \\\"duration\\\": 0.00689,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.357885\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:51.35\" +\n            \"0995\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"startDate = DateTime(2021,1,1)\\\",    \\\"endDat\" +\n            \"e = DateTime(2021,12,31)\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 5,   \\\"id\\\": \\\"33a5fd5d\\\",   \\\"metadata\\\": {    \\\"execution\\\":\" +\n            \" {     \\\"iopub.execute_input\\\": \\\"2024-06-06T22:15:51.361875Z\\\",     \\\"iopub.status.busy\\\": \\\"2024-06-06T22:15:51.360883Z\\\",     \\\"iopub.status.idle\\\"\" +\n            \": \\\"2024-06-06T22:15:51.453871Z\\\",     \\\"shell.execute_reply\\\": \\\"2024-06-06T22:15:51.453871Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.095009, \" +\n            \"    \\\"end_time\\\": \\\"2024-06-06T22:15:51.454884\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:51.359875\\\",     \\\"status\\\": \\\"comp\" +\n            \"leted\\\"    },    \\\"scrolled\\\": true,    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"# Gets historical data from the subscribed assets, t\" +\n            \"he last 360 datapoints with daily resolution\\\",    \\\"h1 = qb.History(qb.Securities.Keys, startDate, endDate, Resolution.Daily)\\\",    \\\"\\\",    \\\"if h1.\" +\n            \"shape[0] < 1:\\\",    \\\"    raise Exception(\\\\\\\"History request resulted in no data\\\\\\\")\\\"   ]  },  {   \\\"cell_type\\\": \\\"markdown\\\",   \\\"id\\\": \\\"e8f9c90\" +\n            \"d\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.000996,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.457883\\\",     \\\"exception\\\": false,    \" +\n            \" \\\"start_time\\\": \\\"2024-06-06T22:15:51.456887\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"source\\\": [    \\\"### Indicators\\\",    \\\"\" +\n            \"\\\",    \\\"We can easily get the indicator of a given symbol with QuantBook. \\\",    \\\"\\\",    \\\"For all indicators, please checkout QuantConnect Indicato\" +\n            \"rs [Reference Table](https://www.quantconnect.com/docs#Indicators-Reference-Table)\\\"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": 6,  \" +\n            \" \\\"id\\\": \\\"dcc7e1f0\\\",   \\\"metadata\\\": {    \\\"execution\\\": {     \\\"iopub.execute_input\\\": \\\"2024-06-06T22:15:51.461887Z\\\",     \\\"iopub.status.busy\\\": \" +\n            \"\\\"2024-06-06T22:15:51.461887Z\\\",     \\\"iopub.status.idle\\\": \\\"2024-06-06T22:15:51.502741Z\\\",     \\\"shell.execute_reply\\\": \\\"2024-06-06T22:15:51.502741\" +\n            \"Z\\\"    },    \\\"papermill\\\": {     \\\"duration\\\": 0.044872,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.503757\\\",     \\\"exception\\\": false,     \\\"start_time\" +\n            \"\\\": \\\"2024-06-06T22:15:51.458885\\\",     \\\"status\\\": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": [    \\\"# Example with BB\" +\n            \", it is a datapoint indicator\\\",    \\\"# Define the indicator\\\",    \\\"bb = BollingerBands(30, 2)\\\",    \\\"\\\",    \\\"# Gets historical data of indicator\\\"\" +\n            \",    \\\"bbdf = qb.IndicatorHistory(bb, \\\\\\\"SPY\\\\\\\", startDate, endDate, Resolution.Daily).data_frame\\\",    \\\"\\\",    \\\"# drop undesired fields\\\",    \\\"bbdf = b\" +\n            \"bdf.drop('standarddeviation', axis=1)\\\",    \\\"\\\",    \\\"if bbdf.shape[0] < 1:\\\",    \\\"    raise Exception(\\\\\\\"Bollinger Bands resulted in no data\\\\\\\")\\\"\" +\n            \"   ]  },  {   \\\"cell_type\\\": \\\"code\\\",   \\\"execution_count\\\": null,   \\\"id\\\": \\\"3095c061\\\",   \\\"metadata\\\": {    \\\"papermill\\\": {     \\\"duration\\\": 0.\" +\n            \"001003,     \\\"end_time\\\": \\\"2024-06-06T22:15:51.506759\\\",     \\\"exception\\\": false,     \\\"start_time\\\": \\\"2024-06-06T22:15:51.505756\\\",     \\\"status\\\"\" +\n            \": \\\"completed\\\"    },    \\\"tags\\\": []   },   \\\"outputs\\\": [],   \\\"source\\\": []  } ], \\\"metadata\\\": {  \\\"kernelspec\\\": {   \\\"display_name\\\": \\\"Python 3\" +\n            \" (ipykernel)\\\",   \\\"language\\\": \\\"python\\\",   \\\"name\\\": \\\"python3\\\"  },  \\\"language_info\\\": {   \\\"codemirror_mode\\\": {    \\\"name\\\": \\\"ipython\\\",    \\\"\" +\n            \"version\\\": 3   },   \\\"file_extension\\\": \\\".py\\\",   \\\"mimetype\\\": \\\"text/x-python\\\",   \\\"name\\\": \\\"python\\\",   \\\"nbconvert_exporter\\\": \\\"python\\\",   \\\"\" +\n            \"pygments_lexer\\\": \\\"ipython3\\\",   \\\"version\\\": \\\"3.11.7\\\"  },  \\\"papermill\\\": {   \\\"default_parameters\\\": {},   \\\"duration\\\": 6.254067,   \\\"end_time\\\"\" +\n            \": \\\"2024-06-06T22:15:54.143637\\\",   \\\"environment_variables\\\": {},   \\\"exception\\\": null,   \\\"input_path\\\": \\\"D:\\\\\\\\QuantConnect\\\\\\\\MyLean\\\\\\\\Lean\\\\\\\\T\" +\n            \"ests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\Research\\\\\\\\RegressionTemplates\\\\\\\\BasicTemplateResearchPython.ipynb\\\",   \\\"output_path\\\": \\\"D:\\\\\\\\QuantConnect\\\\\\\\MyLean\\\\\\\\L\" +\n            \"ean\\\\\\\\Tests\\\\\\\\bin\\\\\\\\Debug\\\\\\\\Research\\\\\\\\RegressionTemplates\\\\\\\\BasicTemplateResearchPython-output.ipynb\\\",   \\\"parameters\\\": {},   \\\"start_time\\\":\" +\n            \" \\\"2024-06-06T22:15:47.889570\\\",   \\\"version\\\": \\\"2.4.0\\\"  } }, \\\"nbformat\\\": 4, \\\"nbformat_minor\\\": 5}\";\n    }\n}\n"
  },
  {
    "path": "Tests/Research/RegressionTemplates/BasicTemplateResearchPython.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![QuantConnect Logo](https://cdn.quantconnect.com/web/i/qc_notebook_logo_rev0.png)\\n\",\n    \"## Welcome to The QuantConnect Research Page\\n\",\n    \"#### Refer to this page for documentation https://www.quantconnect.com/docs/research/overview#\\n\",\n    \"#### Contribute to this template file https://github.com/QuantConnect/Lean/blob/master/Research/BasicQuantBookTemplate.ipynb\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## QuantBook Basics\\n\",\n    \"\\n\",\n    \"### Start QuantBook\\n\",\n    \"- Add the references and imports\\n\",\n    \"- Create a QuantBook instance\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import warnings\\n\",\n    \"warnings.filterwarnings(\\\"ignore\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Load in our startup script, required to set runtime for PythonNet\\n\",\n    \"%run ./start.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Create an instance\\n\",\n    \"qb = QuantBook()\\n\",\n    \"\\n\",\n    \"# Select asset data\\n\",\n    \"spy = qb.AddEquity(\\\"SPY\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Historical Data Requests\\n\",\n    \"\\n\",\n    \"We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.\\n\",\n    \"\\n\",\n    \"For more information, please follow the [link](https://www.quantconnect.com/docs#Historical-Data-Historical-Data-Requests).\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"startDate = DateTime(2021,1,1)\\n\",\n    \"endDate = DateTime(2021,12,31)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"scrolled\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution\\n\",\n    \"h1 = qb.History(qb.Securities.Keys, startDate, endDate, Resolution.Daily)\\n\",\n    \"\\n\",\n    \"if h1.shape[0] < 1:\\n\",\n    \"    raise Exception(\\\"History request resulted in no data\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Indicators\\n\",\n    \"\\n\",\n    \"We can easily get the indicator of a given symbol with QuantBook. \\n\",\n    \"\\n\",\n    \"For all indicators, please checkout QuantConnect Indicators [Reference Table](https://www.quantconnect.com/docs#Indicators-Reference-Table)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Example with BB, it is a datapoint indicator\\n\",\n    \"# Define the indicator\\n\",\n    \"bb = BollingerBands(30, 2)\\n\",\n    \"\\n\",\n    \"# Gets historical data of indicator\\n\",\n    \"bbdf = qb.IndicatorHistory(bb, \\\"SPY\\\", startDate, endDate, Resolution.Daily).data_frame\\n\",\n    \"\\n\",\n    \"# drop undesired fields\\n\",\n    \"bbdf = bbdf.drop('standarddeviation', axis=1)\\n\",\n    \"\\n\",\n    \"if bbdf.shape[0] < 1:\\n\",\n    \"    raise Exception(\\\"Bollinger Bands resulted in no data\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.7\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n"
  },
  {
    "path": "Tests/Research/StartTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests.Research\n{\n    [TestFixture, Category(\"ResearchRegressionTests\")]\n    public class StartTests\n    {\n        [Test]\n        public void RunStartFromPython()\n        {\n            TestProcess.RunPythonProcess(\"start.py\", out var process);\n\n            Assert.AreEqual(0, process.ExitCode);\n\n            process.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ResearchRegressionTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Regression testing of C# and python notebooks via the research regression templates implemented from\n    /// <see cref=\"IRegressionResearchDefinition\"/>\n    /// </summary>\n    /// <remarks>Papermill assumes the notebook are present in output directory</remarks>\n    /// <remarks>Assumes C# templates are in Tests/Research/RegressionTemplates to update the expected output</remarks>\n    /// <remarks>Requires \"research-regression-update-output\" to be true in config to update results in C# templates</remarks>\n    /// <remarks>Run in the GH CI through<see cref=\".github/workflows/research-regression-tests.yml\"/></remarks>\n    [TestFixture, Category(\"ResearchRegressionTests\")]\n    public class ResearchRegressionTests\n    {\n        // Update in config.json when template expected result needs to be updated\n        private static readonly bool _updateResearchRegressionOutput = Config.GetBool(\"research-regression-update-output\", false);\n\n        [Test, TestCaseSource(nameof(GetResearchRegressionTestParameters))]\n        public void ResearchRegression(ResearchRegressionTestParameters parameters)\n        {\n            var actualOutput = RunResearchNotebookAndGetOutput(parameters.NotebookPath, parameters.NotebookOutputPath, Directory.GetCurrentDirectory(), out Process process);\n\n            // Update expected result if required.\n            if (_updateResearchRegressionOutput)\n            {\n                UpdateResearchRegressionOutputInSourceFile(parameters.NotebookName, actualOutput);\n            }\n            var actualCells = JToken.Parse(CleanDispensableEscapeCharacters(actualOutput))[\"cells\"];\n            var expectedCells = JToken.Parse(parameters.ExpectedOutput)[\"cells\"];\n            var expectedAndActualCells = expectedCells.Zip(actualCells, (e, a) => new { Expected = e, Actual = a });\n\n            foreach (var cell in expectedAndActualCells)\n            {\n                // Assert Notebook Cell Input\n                Assert.AreEqual(cell.Expected[\"source\"].ToString(), cell.Actual[\"source\"].ToString());\n\n                // Assert Notebook Cell Output\n                var expectedCellOutputs = cell.Expected[\"outputs\"];\n                var actualCellOutputs = cell.Actual[\"outputs\"];\n                if (expectedCellOutputs != null)\n                {\n                    if (actualCellOutputs == null)\n                    {\n                        Assert.Fail(\"Shouldn't be null when expected is not null\");\n                    }\n                    // Iterate over all outputs for the given notebook cell\n                    var expectedCellOutputsAndActualCellOutputs = expectedCellOutputs.Zip(actualCellOutputs, (e, a) => new { Expected = e, Actual = a });\n                    foreach (var cellOutputsItem in expectedCellOutputsAndActualCellOutputs)\n                    {\n                        if (cellOutputsItem.Expected[\"data\"] != null && cellOutputsItem.Expected[\"data\"][\"text/html\"] != null)\n                        {\n                            continue;\n                        }\n                        else if (cellOutputsItem.Expected[\"name\"]?.ToString() == \"stdout\" && cellOutputsItem.Expected[\"text\"] != null)\n                        {\n                            if (!IsDeterministic(cellOutputsItem.Expected[\"text\"].ToString()))\n                            {\n                                continue;\n                            }\n                        }\n                        Assert.AreEqual(cellOutputsItem.Expected.ToString(), cellOutputsItem.Actual.ToString());\n                    }\n                }\n            }\n\n            // Assert if the notebook was run by papermill\n            Assert.AreEqual(0, process.ExitCode);\n            process.Dispose();\n        }\n\n        public class ResearchRegressionTestParameters\n        {\n            public string NotebookName { get; init; }\n            public string NotebookPath { get; init; }\n            public string ExpectedOutput { get; init; }\n            public string NotebookOutputPath { get; init; }\n\n            public ResearchRegressionTestParameters(string notebookName, string notebookPath, string expectedOutput)\n            {\n                NotebookName = notebookName;\n                NotebookPath = notebookPath;\n                ExpectedOutput = expectedOutput;\n                NotebookOutputPath = notebookPath.Split(\".\")[0] + \"-output\" + \".ipynb\";\n            }\n        }\n\n        private static void UpdateResearchRegressionOutputInSourceFile(string templateName, string expectedOutput)\n        {\n            var templatePath = Directory.EnumerateFiles(\"../../Research/RegressionTemplates\", $\"*{templateName}.cs\", SearchOption.AllDirectories).Single();\n            var file = File.ReadAllLines(templatePath).ToList().GetEnumerator();\n            var lines = new List<string>();\n            while (file.MoveNext())\n            {\n                var line = file.Current;\n                if (line == null)\n                {\n                    continue;\n                }\n\n                if (line.Contains(\"public string ExpectedOutput =>\"))\n                {\n                    // Add the line as it assumes the expected output starts from next line\n                    lines.Add(line);\n\n                    // Escape the \"escape\" sequence for correct parse back\n                    expectedOutput = expectedOutput\n                        .Replace(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\")\n                        .Replace(\"\\\\\\\"\", \"\\\\\\\\\\\"\")\n                        .Replace(\"\\\"\", \"\\\\\\\"\");\n                    expectedOutput = CleanDispensableEscapeCharacters(expectedOutput);\n\n                    // Split string in multiple lines\n                    List<string> expectedOutputLines = new();\n                    if (!expectedOutput.IsNullOrEmpty())\n                    {\n                        expectedOutputLines = SplitIntoMultipleLines(expectedOutput, 150);\n                    }\n                    else\n                    {\n                        expectedOutputLines.Add(\"\\\"\\\";\");\n                    }\n\n                    lines.AddRange(expectedOutputLines);\n\n                    // now we skip the old expected ouptut in file\n                    while (file.MoveNext())\n                    {\n                        line = file.Current;\n                        if (line != null && line.StartsWith(\"    }\"))\n                        {\n                            lines.Add(line);\n                            break;\n                        }\n                    }\n                }\n                else\n                {\n                    lines.Add(line);\n                }\n            }\n\n            file.DisposeSafely();\n            File.WriteAllLines(templatePath, lines);\n        }\n\n        /// <summary>\n        /// Split long string into multiple lines\n        /// </summary>\n        /// <remarks>Doesn't break a line if it ends with \"\\\"</remarks>\n        private static List<string> SplitIntoMultipleLines(string longInput, int maxChunkSize)\n        {\n            List<string> resultLines = new();\n            for (int i = 0; i < longInput.Length;)\n            {\n                var chunk = longInput.Substring(i, Math.Min(maxChunkSize, longInput.Length - i));\n                i += maxChunkSize;\n                // Can't split if last charcter is \"\\\"\n                while (chunk.EndsWith(\"\\\\\") && i < longInput.Length)\n                {\n                    chunk += longInput[i];\n                    i++;\n                }\n                resultLines.Add($\"            \\\"{chunk}\\\" +\");\n            }\n            // use ; for endline\n            var lastLine = resultLines.Last();\n            resultLines[resultLines.Count - 1] = lastLine.Remove(lastLine.Length - 2) + \";\";\n            return resultLines;\n        }\n\n        private static string CleanDispensableEscapeCharacters(string json)\n        {\n            json = json\n                .Replace(\"\\\\n\", string.Empty)\n                .Replace(\"\\n\", string.Empty)\n                .Replace(\"\\\\r\", string.Empty)\n                .Replace(\"\\r\", string.Empty)\n                .Replace(\"\\\\t\", string.Empty)\n                .Replace(\"\\t\", string.Empty);\n            return json;\n        }\n\n        private static string RunResearchNotebookAndGetOutput(string notebookPath, string notebookoutputPath, string workingDirectoryForNotebook, out Process process)\n        {\n            var args = $\"-m papermill \\\"{notebookPath}\\\" \\\"{notebookoutputPath}\\\" --log-output --cwd {workingDirectoryForNotebook}\";\n\n            TestProcess.RunPythonProcess(args, out process);\n\n            return File.ReadAllText(notebookoutputPath);\n        }\n\n        private static bool IsDeterministic(string input)\n        {\n            Regex rgxDateTime = new(@\"(\\d{4})(\\d{2})(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2}).(\\d{3}) TRACE::\");\n            if (input.Contains(\"Initialize.csx\"))\n            {\n                return false;\n            }\n            else if (input.Contains(\"Runtime.Initialize():\"))\n            {\n                return false;\n            }\n            else if (input.Contains(\"PythonEngine.Initialize():\"))\n            {\n                return false;\n            }\n            else if (rgxDateTime.IsMatch(input))\n            {\n                return false;\n            }\n            return true;\n        }\n\n        private static ResearchRegressionTestParameters[] GetResearchTemplates()\n        {\n            return Composer.Instance.GetExportedTypes<IRegressionResearchDefinition>()\n                .Where(type =>\n                    !type.IsAbstract &&\n                    type.GetConstructor(Array.Empty<Type>()) != null)\n                .Select(type => new\n                {\n                    instance = (IRegressionResearchDefinition)Activator.CreateInstance(type),\n                    name = type.Name,\n                    path = Path.GetFullPath(Path.Combine(Path.Combine(type.Assembly.Location, @\"../Research/RegressionTemplates\"), type.Name + \".ipynb\"))\n                })\n                .Select(tempObj => new ResearchRegressionTestParameters(tempObj.name, tempObj.path, tempObj.instance.ExpectedOutput))\n                .ToArray();\n        }\n\n        private static TestCaseData[] GetResearchRegressionTestParameters()\n        {\n            // since these are static test cases, they are executed before test setup\n            AssemblyInitialize.AdjustCurrentDirectory();\n            var result = GetResearchTemplates()\n                .OrderBy(x => x.NotebookName)\n                // generate test cases from test parameters\n                .Select(x => new TestCaseData(x).SetName(x.NotebookName))\n                .ToArray();\n            return result; ;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Symbols.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reflection;\nusing QuantConnect.Brokerages;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Provides symbol instances for unit tests\n    /// </summary>\n    public static class Symbols\n    {\n        public static readonly Symbol SPY = CreateEquitySymbol(\"SPY\");\n        public static readonly Symbol AAPL = CreateEquitySymbol(\"AAPL\");\n        public static readonly Symbol MSFT = CreateEquitySymbol(\"MSFT\");\n        public static readonly Symbol ZNGA = CreateEquitySymbol(\"ZNGA\");\n        public static readonly Symbol FXE = CreateEquitySymbol(\"FXE\");\n        public static readonly Symbol LODE = CreateEquitySymbol(\"LODE\");\n        public static readonly Symbol IBM = CreateEquitySymbol(\"IBM\");\n        public static readonly Symbol GOOG = CreateEquitySymbol(\"GOOG\");\n        public static readonly Symbol NFLX = CreateEquitySymbol(\"NFLX\");\n        public static readonly Symbol CAT = CreateEquitySymbol(\"CAT\");\n        public static readonly Symbol SGX = CreateEquitySymbol(\"SGX\", Market.SGX);\n        public static readonly Symbol SBIN = CreateEquitySymbol(\"SBIN\",Market.India);\n        public static readonly Symbol IDEA = CreateEquitySymbol(\"IDEA\", Market.India);\n\n        public static readonly Symbol LOW = CreateEquitySymbol(\"LOW\");\n\n        public static readonly Symbol USDJPY = CreateForexSymbol(\"USDJPY\");\n        public static readonly Symbol EURUSD = CreateForexSymbol(\"EURUSD\");\n        public static readonly Symbol EURGBP = CreateForexSymbol(\"EURGBP\");\n        public static readonly Symbol GBPUSD = CreateForexSymbol(\"GBPUSD\");\n        public static readonly Symbol GBPJPY = CreateForexSymbol(\"GBPJPY\");\n\n        public static readonly Symbol BTCUSD = CreateCryptoSymbol(\"BTCUSD\");\n        public static readonly Symbol LTCUSD = CreateCryptoSymbol(\"LTCUSD\");\n        public static readonly Symbol ETHUSD = CreateCryptoSymbol(\"ETHUSD\");\n        public static readonly Symbol BTCEUR = CreateCryptoSymbol(\"BTCEUR\");\n        public static readonly Symbol ETHBTC = CreateCryptoSymbol(\"ETHBTC\");\n\n        public static readonly Symbol DE10YBEUR = CreateCfdSymbol(\"DE10YBEUR\", Market.Oanda);\n        public static readonly Symbol DE30EUR = CreateCfdSymbol(\"DE30EUR\", Market.Oanda);\n        public static readonly Symbol XAGUSD = CreateCfdSymbol(\"XAGUSD\", Market.Oanda);\n        public static readonly Symbol XAUUSD = CreateCfdSymbol(\"XAUUSD\", Market.Oanda);\n        public static readonly Symbol XAUJPY = CreateCfdSymbol(\"XAUJPY\", Market.Oanda);\n\n        public static readonly Symbol SPY_Option_Chain = CreateOptionsCanonicalSymbol(\"SPY\");\n        public static readonly Symbol SPY_C_192_Feb19_2016 = CreateOptionSymbol(\"SPY\", OptionRight.Call, 192m, new DateTime(2016, 02, 19));\n        public static readonly Symbol SPY_P_192_Feb19_2016 = CreateOptionSymbol(\"SPY\", OptionRight.Put, 192m, new DateTime(2016, 02, 19));\n\n        public static readonly Symbol Fut_SPY_Feb19_2016 = CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2016, 02, 19));\n        public static readonly Symbol Fut_SPY_Mar19_2016 = CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2016, 03, 19));\n\n        public static readonly Symbol ES_Future_Chain = CreateFuturesCanonicalSymbol(Futures.Indices.SP500EMini);\n        public static readonly Symbol Future_ESZ18_Dec2018 = CreateFutureSymbol(Futures.Indices.SP500EMini, new DateTime(2018, 12, 21));\n        public static readonly Symbol Future_CLF19_Jan2019 = CreateFutureSymbol(\"CL\", new DateTime(2018, 12, 19));\n\n        public static readonly Symbol SPX = CreateIndexSymbol(\"SPX\");\n\n        public static readonly ImmutableArray<Symbol> All =\n            typeof(Symbols).GetFields(BindingFlags.Public | BindingFlags.Static)\n                .Where(field => field.FieldType == typeof(Symbol))\n                .Select(field => (Symbol) field.GetValue(null))\n                .ToImmutableArray();\n\n        /// <summary>\n        /// Can be supplied in TestCase attribute\n        /// </summary>\n        public enum SymbolsKey\n        {\n            SPY,\n            AAPL,\n            MSFT,\n            SBIN,\n            IDEA,\n            ZNGA,\n            FXE,\n            USDJPY,\n            EURUSD,\n            BTCUSD,\n            EURGBP,\n            GBPUSD,\n            DE10YBEUR,\n            SPY_C_192_Feb19_2016,\n            SPY_P_192_Feb19_2016,\n            Fut_SPY_Feb19_2016,\n            Fut_SPY_Mar19_2016\n        }\n\n        /// <summary>\n        /// Convert key into symbol instance\n        /// </summary>\n        /// <param name=\"key\">the symbol key</param>\n        /// <returns>The matching symbol instance</returns>\n        /// <remarks>Using reflection minimizes maintenance but is slower at runtime.</remarks>\n        public static Symbol Lookup(SymbolsKey key)\n        {\n            return (Symbol)typeof(Symbols).GetField(key.ToString(), BindingFlags.Public | BindingFlags.Static).GetValue(null);\n        }\n\n        /// <summary>\n        /// Gets a symbol matching the specified <paramref name=\"type\"/>\n        /// </summary>\n        public static Symbol GetBySecurityType(SecurityType type)\n        {\n            switch (type)\n            {\n                case SecurityType.Equity:   return SPY;\n                case SecurityType.Option:   return SPY_C_192_Feb19_2016;\n                case SecurityType.Forex:    return EURUSD;\n                case SecurityType.Future:   return Future_CLF19_Jan2019;\n                case SecurityType.Cfd:      return XAGUSD;\n                case SecurityType.Crypto:   return BTCUSD;\n                case SecurityType.Index:    return SPX;\n                default:\n                    throw new NotImplementedException($\"Symbols.GetBySecurityType({type}) is not implemented.\");\n            }\n        }\n\n        private static Symbol CreateForexSymbol(string symbol)\n        {\n            return Symbol.Create(symbol, SecurityType.Forex, Market.Oanda);\n        }\n\n        private static Symbol CreateEquitySymbol(string symbol, string market = Market.USA)\n        {\n            TestGlobals.Initialize();\n            return Symbol.Create(symbol, SecurityType.Equity, market);\n        }\n        public static Symbol CreateFutureSymbol(string symbol, DateTime expiry)\n        {\n            string market;\n            if (!SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(symbol, SecurityType.Future, out market))\n            {\n                market = DefaultBrokerageModel.DefaultMarketMap[SecurityType.Future];\n            }\n            return Symbol.CreateFuture(symbol, market, expiry);\n        }\n        public static Symbol CreateFutureOptionSymbol(Symbol underlying, OptionRight right, decimal strike, DateTime expiry)\n        {\n            return Symbol.CreateOption(underlying, underlying.ID.Market, OptionStyle.American, right, strike, expiry);\n        }\n\n        private static Symbol CreateCfdSymbol(string symbol, string market)\n        {\n            return Symbol.Create(symbol, SecurityType.Cfd, market);\n        }\n\n        internal static Symbol CreateOptionSymbol(string symbol, OptionRight right, decimal strike, DateTime expiry, string market = Market.USA)\n        {\n            return Symbol.CreateOption(symbol, market, OptionStyle.American, right, strike, expiry);\n        }\n\n        private static Symbol CreateCryptoSymbol(string symbol)\n        {\n            return Symbol.Create(symbol, SecurityType.Crypto, Market.Coinbase);\n        }\n\n        private static Symbol CreateOptionsCanonicalSymbol(string underlying)\n        {\n            return Symbol.Create(underlying, SecurityType.Option, Market.USA, \"?\" + underlying);\n        }\n\n        public static Symbol CreateFuturesCanonicalSymbol(string ticker)\n        {\n            string market;\n            if (!SymbolPropertiesDatabase.FromDataFolder().TryGetMarket(ticker, SecurityType.Future, out market))\n            {\n                market = DefaultBrokerageModel.DefaultMarketMap[SecurityType.Future];\n            }\n            return Symbol.Create(ticker, SecurityType.Future, market, \"/\" + ticker);\n        }\n\n        internal static Symbol CreateIndexSymbol(string ticker)\n        {\n            return Symbol.Create(ticker, SecurityType.Index, Market.USA);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/TestData/00010101_05_example_psychsignal_testdata.csv",
    "content": "SOURCE,SYMBOL,TIMESTAMP_UTC,BULLISH_INTENSITY,BEARISH_INTENSITY,BULL_MINUS_BEAR,BULL_SCORED_MESSAGES,BEAR_SCORED_MESSAGES,BULL_BEAR_MSG_RATIO,TOTAL_SCANNED_MESSAGES\nnone,ZZZZZZZ,0001-01-01T05:45:00Z,0.0,0.0,0.0,0.0,0.0,0.0,0"
  },
  {
    "path": "Tests/TestData/CashTestingStrategy.csv",
    "content": "TIME,,QUANTITY,DELTA QUANTITY,LEVERAGE,TX VALUE,CASH IMPACT,REAL CASH,DEBT,HOLDINGS VALUE,EQUITY\n12/31/12,1,0,0,10,0,0,100000,0,0,100000\n01/01/13,1,100,100,10,100,10,99990,90,100,100000\n01/02/13,1,100,0,10,0,0,99990,90,100,100000\n01/03/13,1,100,0,10,0,0,99990,90,100,100000\n01/04/13,1,100,0,10,0,0,99990,90,100,100000\n01/05/13,1,100,0,10,0,0,99990,90,100,100000\n01/06/13,1,100,0,10,0,0,99990,90,100,100000\n01/07/13,1,100,0,10,0,0,99990,90,100,100000\n01/08/13,1,100,0,10,0,0,99990,90,100,100000\n01/09/13,1,100,0,10,0,0,99990,90,100,100000\n01/10/13,1,100,0,10,0,0,99990,90,100,100000\n01/11/13,1,100,0,10,0,0,99990,90,100,100000\n01/12/13,1,100,0,10,0,0,99990,90,100,100000\n01/13/13,1,100,0,10,0,0,99990,90,100,100000\n01/14/13,1,100,0,10,0,0,99990,90,100,100000\n01/15/13,1,100,0,10,0,0,99990,90,100,100000\n01/16/13,1,100,0,10,0,0,99990,90,100,100000\n01/17/13,1,100,0,10,0,0,99990,90,100,100000\n01/18/13,1,100,0,10,0,0,99990,90,100,100000\n01/19/13,1,100,0,10,0,0,99990,90,100,100000\n01/20/13,1,100,0,10,0,0,99990,90,100,100000\n01/21/13,1,100,0,10,0,0,99990,90,100,100000\n01/22/13,1,100,0,10,0,0,99990,90,100,100000\n01/23/13,1,100,0,10,0,0,99990,90,100,100000\n01/24/13,1,100,0,10,0,0,99990,90,100,100000\n01/25/13,1,100,0,10,0,0,99990,90,100,100000\n01/26/13,1,100,0,10,0,0,99990,90,100,100000\n01/27/13,1,100,0,10,0,0,99990,90,100,100000\n01/28/13,1,100,0,10,0,0,99990,90,100,100000\n01/29/13,1,100,0,10,0,0,99990,90,100,100000\n01/30/13,1,100,0,10,0,0,99990,90,100,100000\n01/31/13,1,100,0,10,0,0,99990,90,100,100000\n02/01/13,2,50,-50,10,-100,-10,100000,0,100,100100\n02/02/13,2,50,0,10,0,0,100000,0,100,100100\n02/03/13,2,50,0,10,0,0,100000,0,100,100100\n02/04/13,2,50,0,10,0,0,100000,0,100,100100\n02/05/13,2,50,0,10,0,0,100000,0,100,100100\n02/06/13,2,50,0,10,0,0,100000,0,100,100100\n02/07/13,2,50,0,10,0,0,100000,0,100,100100\n02/08/13,2,50,0,10,0,0,100000,0,100,100100\n02/09/13,2,50,0,10,0,0,100000,0,100,100100\n02/10/13,2,50,0,10,0,0,100000,0,100,100100\n02/11/13,2,50,0,10,0,0,100000,0,100,100100\n02/12/13,2,50,0,10,0,0,100000,0,100,100100\n02/13/13,2,50,0,10,0,0,100000,0,100,100100\n02/14/13,2,50,0,10,0,0,100000,0,100,100100\n02/15/13,2,50,0,10,0,0,100000,0,100,100100\n02/16/13,2,50,0,10,0,0,100000,0,100,100100\n02/17/13,2,50,0,10,0,0,100000,0,100,100100\n02/18/13,2,50,0,10,0,0,100000,0,100,100100\n02/19/13,2,50,0,10,0,0,100000,0,100,100100\n02/20/13,2,50,0,10,0,0,100000,0,100,100100\n02/21/13,2,50,0,10,0,0,100000,0,100,100100\n02/22/13,2,50,0,10,0,0,100000,0,100,100100\n02/23/13,2,50,0,10,0,0,100000,0,100,100100\n02/24/13,2,50,0,10,0,0,100000,0,100,100100\n02/25/13,2,50,0,10,0,0,100000,0,100,100100\n02/26/13,2,50,0,10,0,0,100000,0,100,100100\n02/27/13,2,50,0,10,0,0,100000,0,100,100100\n02/28/13,2,50,0,10,0,0,100000,0,100,100100\n03/01/13,3,-50,-100,10,-300,-30,100030,-270,-150,100150\n03/02/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/03/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/04/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/05/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/06/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/07/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/08/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/09/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/10/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/11/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/12/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/13/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/14/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/15/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/16/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/17/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/18/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/19/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/20/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/21/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/22/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/23/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/24/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/25/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/26/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/27/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/28/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/29/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/30/13,3,-50,0,10,0,0,100030,-270,-150,100150\n03/31/13,3,-50,0,10,0,0,100030,-270,-150,100150\n04/01/13,4,-100,-50,10,-200,-20,100050,-450,-400,100100\n04/02/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/03/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/04/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/05/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/06/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/07/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/08/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/09/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/10/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/11/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/12/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/13/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/14/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/15/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/16/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/17/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/18/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/19/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/20/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/21/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/22/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/23/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/24/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/25/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/26/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/27/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/28/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/29/13,4,-100,0,10,0,0,100050,-450,-400,100100\n04/30/13,4,-100,0,10,0,0,100050,-450,-400,100100\n05/01/13,5,-50,50,10,250,25,100025,-225,-250,100000\n05/02/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/03/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/04/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/05/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/06/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/07/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/08/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/09/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/10/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/11/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/12/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/13/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/14/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/15/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/16/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/17/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/18/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/19/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/20/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/21/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/22/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/23/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/24/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/25/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/26/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/27/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/28/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/29/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/30/13,5,-50,0,10,0,0,100025,-225,-250,100000\n05/31/13,5,-50,0,10,0,0,100025,-225,-250,100000\n06/01/13,6,50,100,10,600,60,99965,315,300,99950\n06/02/13,6,50,0,10,0,0,99965,315,300,99950\n06/03/13,6,50,0,10,0,0,99965,315,300,99950\n06/04/13,6,50,0,10,0,0,99965,315,300,99950\n06/05/13,6,50,0,10,0,0,99965,315,300,99950\n06/06/13,6,50,0,10,0,0,99965,315,300,99950\n06/07/13,6,50,0,10,0,0,99965,315,300,99950\n06/08/13,6,50,0,10,0,0,99965,315,300,99950\n06/09/13,6,50,0,10,0,0,99965,315,300,99950\n06/10/13,6,50,0,10,0,0,99965,315,300,99950\n06/11/13,6,50,0,10,0,0,99965,315,300,99950\n06/12/13,6,50,0,10,0,0,99965,315,300,99950\n06/13/13,6,50,0,10,0,0,99965,315,300,99950\n06/14/13,6,50,0,10,0,0,99965,315,300,99950\n06/15/13,6,50,0,10,0,0,99965,315,300,99950\n06/16/13,6,50,0,10,0,0,99965,315,300,99950\n06/17/13,6,50,0,10,0,0,99965,315,300,99950\n06/18/13,6,50,0,10,0,0,99965,315,300,99950\n06/19/13,6,50,0,10,0,0,99965,315,300,99950\n06/20/13,6,50,0,10,0,0,99965,315,300,99950\n06/21/13,6,50,0,10,0,0,99965,315,300,99950\n06/22/13,6,50,0,10,0,0,99965,315,300,99950\n06/23/13,6,50,0,10,0,0,99965,315,300,99950\n06/24/13,6,50,0,10,0,0,99965,315,300,99950\n06/25/13,6,50,0,10,0,0,99965,315,300,99950\n06/26/13,6,50,0,10,0,0,99965,315,300,99950\n06/27/13,6,50,0,10,0,0,99965,315,300,99950\n06/28/13,6,50,0,10,0,0,99965,315,300,99950\n06/29/13,6,50,0,10,0,0,99965,315,300,99950\n06/30/13,6,50,0,10,0,0,99965,315,300,99950\n07/01/13,7,100,50,10,350,35,99930,630,700,100000\n07/02/13,7,100,0,10,0,0,99930,630,700,100000\n07/03/13,7,100,0,10,0,0,99930,630,700,100000\n07/04/13,7,100,0,10,0,0,99930,630,700,100000\n07/05/13,7,100,0,10,0,0,99930,630,700,100000\n07/06/13,7,100,0,10,0,0,99930,630,700,100000\n07/07/13,7,100,0,10,0,0,99930,630,700,100000\n07/08/13,7,100,0,10,0,0,99930,630,700,100000\n07/09/13,7,100,0,10,0,0,99930,630,700,100000\n07/10/13,7,100,0,10,0,0,99930,630,700,100000\n07/11/13,7,100,0,10,0,0,99930,630,700,100000\n07/12/13,7,100,0,10,0,0,99930,630,700,100000\n07/13/13,7,100,0,10,0,0,99930,630,700,100000\n07/14/13,7,100,0,10,0,0,99930,630,700,100000\n07/15/13,7,100,0,10,0,0,99930,630,700,100000\n07/16/13,7,100,0,10,0,0,99930,630,700,100000\n07/17/13,7,100,0,10,0,0,99930,630,700,100000\n07/18/13,7,100,0,10,0,0,99930,630,700,100000\n07/19/13,7,100,0,10,0,0,99930,630,700,100000\n07/20/13,7,100,0,10,0,0,99930,630,700,100000\n07/21/13,7,100,0,10,0,0,99930,630,700,100000\n07/22/13,7,100,0,10,0,0,99930,630,700,100000\n07/23/13,7,100,0,10,0,0,99930,630,700,100000\n07/24/13,7,100,0,10,0,0,99930,630,700,100000\n07/25/13,7,100,0,10,0,0,99930,630,700,100000\n07/26/13,7,100,0,10,0,0,99930,630,700,100000\n07/27/13,7,100,0,10,0,0,99930,630,700,100000\n07/28/13,7,100,0,10,0,0,99930,630,700,100000\n07/29/13,7,100,0,10,0,0,99930,630,700,100000\n07/30/13,7,100,0,10,0,0,99930,630,700,100000\n07/31/13,7,100,0,10,0,0,99930,630,700,100000\n08/01/13,8,50,-50,10,-400,-40,99970,270,400,100100\n08/02/13,8,50,0,10,0,0,99970,270,400,100100\n08/03/13,8,50,0,10,0,0,99970,270,400,100100\n08/04/13,8,50,0,10,0,0,99970,270,400,100100\n08/05/13,8,50,0,10,0,0,99970,270,400,100100\n08/06/13,8,50,0,10,0,0,99970,270,400,100100\n08/07/13,8,50,0,10,0,0,99970,270,400,100100\n08/08/13,8,50,0,10,0,0,99970,270,400,100100\n08/09/13,8,50,0,10,0,0,99970,270,400,100100\n08/10/13,8,50,0,10,0,0,99970,270,400,100100\n08/11/13,8,50,0,10,0,0,99970,270,400,100100\n08/12/13,8,50,0,10,0,0,99970,270,400,100100\n08/13/13,8,50,0,10,0,0,99970,270,400,100100\n08/14/13,8,50,0,10,0,0,99970,270,400,100100\n08/15/13,8,50,0,10,0,0,99970,270,400,100100\n08/16/13,8,50,0,10,0,0,99970,270,400,100100\n08/17/13,8,50,0,10,0,0,99970,270,400,100100\n08/18/13,8,50,0,10,0,0,99970,270,400,100100\n08/19/13,8,50,0,10,0,0,99970,270,400,100100\n08/20/13,8,50,0,10,0,0,99970,270,400,100100\n08/21/13,8,50,0,10,0,0,99970,270,400,100100\n08/22/13,8,50,0,10,0,0,99970,270,400,100100\n08/23/13,8,50,0,10,0,0,99970,270,400,100100\n08/24/13,8,50,0,10,0,0,99970,270,400,100100\n08/25/13,8,50,0,10,0,0,99970,270,400,100100\n08/26/13,8,50,0,10,0,0,99970,270,400,100100\n08/27/13,8,50,0,10,0,0,99970,270,400,100100\n08/28/13,8,50,0,10,0,0,99970,270,400,100100\n08/29/13,8,50,0,10,0,0,99970,270,400,100100\n08/30/13,8,50,0,10,0,0,99970,270,400,100100\n08/31/13,8,50,0,10,0,0,99970,270,400,100100\n09/01/13,9,-50,-100,10,-900,-90,100060,-540,-450,100150\n09/02/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/03/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/04/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/05/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/06/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/07/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/08/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/09/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/10/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/11/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/12/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/13/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/14/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/15/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/16/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/17/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/18/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/19/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/20/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/21/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/22/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/23/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/24/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/25/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/26/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/27/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/28/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/29/13,9,-50,0,10,0,0,100060,-540,-450,100150\n09/30/13,9,-50,0,10,0,0,100060,-540,-450,100150\n10/01/13,10,-100,-50,10,-500,-50,100110,-990,-1000,100100\n10/02/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/03/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/04/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/05/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/06/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/07/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/08/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/09/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/10/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/11/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/12/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/13/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/14/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/15/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/16/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/17/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/18/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/19/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/20/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/21/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/22/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/23/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/24/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/25/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/26/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/27/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/28/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/29/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/30/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n10/31/13,10,-100,0,10,0,0,100110,-990,-1000,100100\n11/01/13,11,-50,50,10,550,55,100055,-495,-550,100000\n11/02/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/03/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/04/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/05/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/06/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/07/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/08/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/09/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/10/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/11/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/12/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/13/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/14/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/15/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/16/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/17/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/18/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/19/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/20/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/21/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/22/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/23/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/24/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/25/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/26/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/27/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/28/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/29/13,11,-50,0,10,0,0,100055,-495,-550,100000\n11/30/13,11,-50,0,10,0,0,100055,-495,-550,100000\n12/01/13,12,50,100,10,1200,120,99935,585,600,99950\n12/02/13,12,50,0,10,0,0,99935,585,600,99950\n12/03/13,12,50,0,10,0,0,99935,585,600,99950\n12/04/13,12,50,0,10,0,0,99935,585,600,99950\n12/05/13,12,50,0,10,0,0,99935,585,600,99950\n12/06/13,12,50,0,10,0,0,99935,585,600,99950\n12/07/13,12,50,0,10,0,0,99935,585,600,99950\n12/08/13,12,50,0,10,0,0,99935,585,600,99950\n12/09/13,12,50,0,10,0,0,99935,585,600,99950\n12/10/13,12,50,0,10,0,0,99935,585,600,99950\n12/11/13,12,50,0,10,0,0,99935,585,600,99950\n12/12/13,12,50,0,10,0,0,99935,585,600,99950\n12/13/13,12,50,0,10,0,0,99935,585,600,99950\n12/14/13,12,50,0,10,0,0,99935,585,600,99950\n12/15/13,12,0,-50,10,-600,-60,99995,45,0,99950\n12/16/13,12,0,0,10,0,0,99995,45,0,99950\n12/17/13,12,0,0,10,0,0,99995,45,0,99950\n12/18/13,12,0,0,10,0,0,99995,45,0,99950\n12/19/13,12,0,0,10,0,0,99995,45,0,99950\n12/20/13,12,0,0,10,0,0,99995,45,0,99950\n12/21/13,12,0,0,10,0,0,99995,45,0,99950\n12/22/13,12,0,0,10,0,0,99995,45,0,99950\n12/23/13,12,0,0,10,0,0,99995,45,0,99950\n12/24/13,12,0,0,10,0,0,99995,45,0,99950\n12/25/13,12,0,0,10,0,0,99995,45,0,99950\n12/26/13,12,0,0,10,0,0,99995,45,0,99950\n12/27/13,12,0,0,10,0,0,99995,45,0,99950\n12/28/13,12,0,0,10,0,0,99995,45,0,99950\n12/29/13,12,0,0,10,0,0,99995,45,0,99950\n12/30/13,12,0,0,10,0,0,99995,45,0,99950\n12/31/13,12,0,0,10,0,0,99995,45,0,99950\n"
  },
  {
    "path": "Tests/TestData/SampleMarketHoursDatabase.json",
    "content": "{\n  \"entries\": {\n    \"Equity-usa-[*]\": {\n      \"dataTimeZone\": \"America/New_York\",\n      \"exchangeTimeZone\": \"America/New_York\",\n      \"sunday\": [],\n      \"monday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": [\n        \"1/1/1998\",\n        \"1/1/1999\",\n        \"1/1/2001\",\n        \"1/1/2002\",\n        \"1/1/2003\",\n        \"1/1/2004\",\n        \"1/2/2006\",\n        \"1/1/2007\",\n        \"1/1/2008\",\n        \"1/1/2009\",\n        \"1/1/2010\",\n        \"1/1/2011\",\n        \"1/2/2012\",\n        \"1/1/2013\",\n        \"1/1/2014\",\n        \"1/1/2015\",\n        \"1/1/2016\",\n        \"1/2/2007\",\n        \"9/11/2001\",\n        \"9/12/2001\",\n        \"9/13/2001\",\n        \"9/14/2001\",\n        \"6/11/2004\",\n        \"10/29/2012\",\n        \"10/30/2012\",\n        \"1/19/1998\",\n        \"1/18/1999\",\n        \"1/17/2000\",\n        \"1/15/2001\",\n        \"1/21/2002\",\n        \"1/20/2003\",\n        \"1/19/2004\",\n        \"1/17/2005\",\n        \"1/16/2006\",\n        \"1/15/2007\",\n        \"1/21/2008\",\n        \"1/19/2009\",\n        \"1/18/2010\",\n        \"1/17/2011\",\n        \"1/16/2012\",\n        \"1/21/2013\",\n        \"1/20/2014\",\n        \"1/19/2015\",\n        \"1/18/2016\",\n        \"2/16/1998\",\n        \"2/15/1999\",\n        \"2/21/2000\",\n        \"2/19/2001\",\n        \"2/18/2002\",\n        \"2/17/2003\",\n        \"2/16/2004\",\n        \"2/21/2005\",\n        \"2/20/2006\",\n        \"2/19/2007\",\n        \"2/18/2008\",\n        \"2/16/2009\",\n        \"2/15/2010\",\n        \"2/21/2011\",\n        \"2/20/2012\",\n        \"2/18/2013\",\n        \"2/17/2014\",\n        \"2/16/2015\",\n        \"2/15/2016\",\n        \"4/10/1998\",\n        \"4/2/1999\",\n        \"4/21/2000\",\n        \"4/13/2001\",\n        \"3/29/2002\",\n        \"4/18/2003\",\n        \"4/9/2004\",\n        \"3/25/2005\",\n        \"4/14/2006\",\n        \"4/6/2007\",\n        \"3/21/2008\",\n        \"4/10/2009\",\n        \"4/2/2010\",\n        \"4/22/2011\",\n        \"4/6/2012\",\n        \"3/29/2013\",\n        \"4/18/2014\",\n        \"4/3/2015\",\n        \"3/25/2016\",\n        \"5/25/1998\",\n        \"5/31/1999\",\n        \"5/29/2000\",\n        \"5/28/2001\",\n        \"5/27/2002\",\n        \"5/26/2003\",\n        \"5/31/2004\",\n        \"5/30/2005\",\n        \"5/29/2006\",\n        \"5/28/2007\",\n        \"5/26/2008\",\n        \"5/25/2009\",\n        \"5/31/2010\",\n        \"5/30/2011\",\n        \"5/28/2012\",\n        \"5/27/2013\",\n        \"5/26/2014\",\n        \"5/25/2015\",\n        \"5/30/2016\",\n        \"7/3/1998\",\n        \"7/5/1999\",\n        \"7/4/2000\",\n        \"7/4/2001\",\n        \"7/4/2002\",\n        \"7/4/2003\",\n        \"7/5/2004\",\n        \"7/4/2005\",\n        \"7/4/2006\",\n        \"7/4/2007\",\n        \"7/4/2008\",\n        \"7/3/2009\",\n        \"7/5/2010\",\n        \"7/4/2011\",\n        \"7/4/2012\",\n        \"7/4/2013\",\n        \"7/4/2014\",\n        \"7/3/2015\",\n        \"7/4/2016\",\n        \"9/7/1998\",\n        \"9/6/1999\",\n        \"9/4/2000\",\n        \"9/3/2001\",\n        \"9/2/2002\",\n        \"9/1/2003\",\n        \"9/6/2004\",\n        \"9/5/2005\",\n        \"9/4/2006\",\n        \"9/3/2007\",\n        \"9/1/2008\",\n        \"9/7/2009\",\n        \"9/6/2010\",\n        \"9/5/2011\",\n        \"9/3/2012\",\n        \"9/2/2013\",\n        \"9/1/2014\",\n        \"9/7/2015\",\n        \"9/5/2016\",\n        \"11/26/1998\",\n        \"11/25/1999\",\n        \"11/23/2000\",\n        \"11/22/2001\",\n        \"11/28/2002\",\n        \"11/27/2003\",\n        \"11/25/2004\",\n        \"11/24/2005\",\n        \"11/23/2006\",\n        \"11/22/2007\",\n        \"11/27/2008\",\n        \"11/26/2009\",\n        \"11/25/2010\",\n        \"11/24/2011\",\n        \"11/22/2012\",\n        \"11/28/2013\",\n        \"11/27/2014\",\n        \"11/26/2015\",\n        \"11/24/2016\",\n        \"12/25/1998\",\n        \"12/24/1999\",\n        \"12/25/2000\",\n        \"12/25/2001\",\n        \"12/25/2002\",\n        \"12/25/2003\",\n        \"12/24/2004\",\n        \"12/26/2005\",\n        \"12/25/2006\",\n        \"12/25/2007\",\n        \"12/25/2008\",\n        \"12/25/2009\",\n        \"12/24/2010\",\n        \"12/26/2011\",\n        \"12/25/2012\",\n        \"12/25/2013\",\n        \"12/25/2014\",\n        \"12/25/2015\",\n        \"12/25/2016\"\n      ],\n      \"earlyCloses\": {\n        \"11/25/2016\": \"13:00:00\"\n      }\n    },\n    \"Forex-fxcm-[*]\": {\n      \"dataTimeZone\": \"UTC-05\",\n      \"exchangeTimeZone\": \"UTC-05\",\n      \"sunday\": [\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"monday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"17:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": []\n    },\n    \"Future-cfe-VX\": {\n      \"dataTimeZone\": \"UTC\",\n      \"exchangeTimeZone\": \"America/Chicago\",\n      \"sunday\": [\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"premarket\"\n        }\n      ],\n      \"monday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"08:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"08:30:00\",\n          \"end\": \"15:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"15:00:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"postmarket\"\n        },\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"08:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"08:30:00\",\n          \"end\": \"15:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"15:00:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"postmarket\"\n        },\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"08:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"08:30:00\",\n          \"end\": \"15:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"15:00:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"postmarket\"\n        },\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"08:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"08:30:00\",\n          \"end\": \"15:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"15:00:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"postmarket\"\n        },\n        {\n          \"start\": \"17:00:00\",\n          \"end\": \"1.00:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"00:00:00\",\n          \"end\": \"08:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"08:30:00\",\n          \"end\": \"15:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"15:00:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": []\n    }\n  }\n}\n"
  },
  {
    "path": "Tests/TestData/aapl_chain.csv",
    "content": "AAPL 31KBXAYC89PBA|AAPL R735QTJ8XC9X\nAAPL 31OJK5C9C7RL2|AAPL R735QTJ8XC9X\nAAPL 31KBXAXG5AWW6|AAPL R735QTJ8XC9X\nAAPL 31KBXAXJ4GXS6|AAPL R735QTJ8XC9X\nAAPL XL7X5ID0ZVXI|AAPL R735QTJ8XC9X\nAAPL XG8PSIFGLFMU|AAPL R735QTJ8XC9X\nAAPL XDR43YNOMT8M|AAPL R735QTJ8XC9X\nAAPL XL7X5HIXH43Q|AAPL R735QTJ8XC9X\nAAPL 31BBZ86O4C21Y|AAPL R735QTJ8XC9X\nAAPL XBGEKFM2GB0M|AAPL R735QTJ8XC9X\nAAPL XC7Z2RQYF812|AAPL R735QTJ8XC9X\nAAPL 31A6MGLM938HY|AAPL R735QTJ8XC9X\nAAPL XB2MB4Y8R7PI|AAPL R735QTJ8XC9X\nAAPL 31R15TU4BJFRA|AAPL R735QTJ8XC9X\nAAPL XFH59VL8GSPY|AAPL R735QTJ8XC9X\nAAPL XVD8068VROQU|AAPL R735QTJ8XC9X\nAAPL XVD8066KF01Y|AAPL R735QTJ8XC9X\nAAPL XG8PSI5JDCO6|AAPL R735QTJ8XC9X\nAAPL 31C3JQTF1DZZA|AAPL R735QTJ8XC9X\nAAPL XB2MB6K4KCZQ|AAPL R735QTJ8XC9X\nAAPL XCZJLCCH6O06|AAPL R735QTJ8XC9X\nAAPL XVD8065QNBT2|AAPL R735QTJ8XC9X\nAAPL XB9IFHUQO4FA|AAPL R735QTJ8XC9X\nAAPL 31EL5FAJQ4LGM|AAPL R735QTJ8XC9X\nAAPL XB2MASTMZVNQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXGH7KZQ|AAPL R735QTJ8XC9X\nAAPL XHYQYCYOOZNQ|AAPL R735QTJ8XC9X\nAAPL XAVQ658AS96U|AAPL R735QTJ8XC9X\nAAPL XCZJLDCJ1HLY|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q3L37GM|AAPL R735QTJ8XC9X\nAAPL 31EL5FB77FU5I|AAPL R735QTJ8XC9X\nAAPL XB9IFU4B3N46|AAPL R735QTJ8XC9X\nAAPL 31R15TU1IBQX2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BRN83GM|AAPL R735QTJ8XC9X\nAAPL 31ADIL8HMKB7Q|AAPL R735QTJ8XC9X\nAAPL XG8PSGY1LGUE|AAPL R735QTJ8XC9X\nAAPL 31AY6YV08S552|AAPL R735QTJ8XC9X\nAAPL XHYQYCW7DYX2|AAPL R735QTJ8XC9X\nAAPL 31A6MG8T66D52|AAPL R735QTJ8XC9X\nAAPL 31R15TUN0946E|AAPL R735QTJ8XC9X\nAAPL 31BBZ86T2Y3JA|AAPL R735QTJ8XC9X\nAAPL 31AKEPJVDUKQU|AAPL R735QTJ8XC9X\nAAPL 31AKEPVD01DXI|AAPL R735QTJ8XC9X\nAAPL XAVQ659AI9HI|AAPL R735QTJ8XC9X\nAAPL 31CV49F8VP012|AAPL R735QTJ8XC9X\nAAPL XPFJZVVR0Z2E|AAPL R735QTJ8XC9X\nAAPL XB2MASRBN6YU|AAPL R735QTJ8XC9X\nAAPL XL7X5HRJ0DIE|AAPL R735QTJ8XC9X\nAAPL XL7X5IBDGJFQ|AAPL R735QTJ8XC9X\nAAPL XCZJLCBZBNUU|AAPL R735QTJ8XC9X\nAAPL 31A6MGKXG113A|AAPL R735QTJ8XC9X\nAAPL XL7X5HHXR3T2|AAPL R735QTJ8XC9X\nAAPL 31KBXAYAKQCTI|AAPL R735QTJ8XC9X\nAAPL XL7X5HFMEF46|AAPL R735QTJ8XC9X\nAAPL 31H2R3SX85GUE|AAPL R735QTJ8XC9X\nAAPL 31ADIKXK0PUUE|AAPL R735QTJ8XC9X\nAAPL XVD80697OCUE|AAPL R735QTJ8XC9X\nAAPL XCZJLD49CR52|AAPL R735QTJ8XC9X\nAAPL XB2MASTYWJRA|AAPL R735QTJ8XC9X\nAAPL XCZJLCXN7D5Y|AAPL R735QTJ8XC9X\nAAPL 31A6MG9UVKJ8M|AAPL R735QTJ8XC9X\nAAPL 31ARAUIOWVXL2|AAPL R735QTJ8XC9X\nAAPL 31A6MGLDZEI12|AAPL R735QTJ8XC9X\nAAPL XAVQ6HMBWO1Y|AAPL R735QTJ8XC9X\nAAPL 31CV49EMVWMME|AAPL R735QTJ8XC9X\nAAPL XBGEK3WUE3K6|AAPL R735QTJ8XC9X\nAAPL XBNAORCW55LY|AAPL R735QTJ8XC9X\nAAPL XCZJLDAVI546|AAPL R735QTJ8XC9X\nAAPL 31EL5FAMP8H6U|AAPL R735QTJ8XC9X\nAAPL XFH59ULCKB5Y|AAPL R735QTJ8XC9X\nAAPL XAVQ666J5E92|AAPL R735QTJ8XC9X\nAAPL 31UH85N6T9NC6|AAPL R735QTJ8XC9X\nAAPL XFH59VEMBEQU|AAPL R735QTJ8XC9X\nAAPL XB2MAU7925BA|AAPL R735QTJ8XC9X\nAAPL XC7Z2QTVOA5I|AAPL R735QTJ8XC9X\nAAPL XBNAORI0NDZA|AAPL R735QTJ8XC9X\nAAPL 31A6MG8QIX0CM|AAPL R735QTJ8XC9X\nAAPL XG8PSH0CY5JA|AAPL R735QTJ8XC9X\nAAPL 31BBZ863Y1D6U|AAPL R735QTJ8XC9X\nAAPL 31R15TU3NQ3K6|AAPL R735QTJ8XC9X\nAAPL XAVQ6JGHEJT2|AAPL R735QTJ8XC9X\nAAPL 31EL5FB0LAG6E|AAPL R735QTJ8XC9X\nAAPL XRX5OE5S2YKM|AAPL R735QTJ8XC9X\nAAPL XRX5OE1Z59FQ|AAPL R735QTJ8XC9X\nAAPL 31EL5FAOOOHS6|AAPL R735QTJ8XC9X\nAAPL 31C3JQS977LT2|AAPL R735QTJ8XC9X\nAAPL XC7Z2RU9HX0M|AAPL R735QTJ8XC9X\nAAPL XHYQYCXD2B9I|AAPL R735QTJ8XC9X\nAAPL XDR43YLJ8GLI|AAPL R735QTJ8XC9X\nAAPL 31H2R3TCLSG9Y|AAPL R735QTJ8XC9X\nAAPL XDR43YNUL5AE|AAPL R735QTJ8XC9X\nAAPL 31FCPXWVLBXQE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXDZWK92|AAPL R735QTJ8XC9X\nAAPL XB2MASRTI746|AAPL R735QTJ8XC9X\nAAPL XL7X5HI9NRWM|AAPL R735QTJ8XC9X\nAAPL 31C3JQTGOXCH2|AAPL R735QTJ8XC9X\nAAPL XCZJLCEGMOLI|AAPL R735QTJ8XC9X\nAAPL XAVQ6K5AGR7Q|AAPL R735QTJ8XC9X\nAAPL 31H2R3SXK24XY|AAPL R735QTJ8XC9X\nAAPL XBU6TF1PBNYE|AAPL R735QTJ8XC9X\nAAPL XL7X5HT6JQ06|AAPL R735QTJ8XC9X\nAAPL 31A6MGMRLIWUE|AAPL R735QTJ8XC9X\nAAPL XB9IFH2MJ812|AAPL R735QTJ8XC9X\nAAPL 319ZQBVZNDC5I|AAPL R735QTJ8XC9X\nAAPL 31ARAUKASP2VA|AAPL R735QTJ8XC9X\nAAPL 31AKEPL2JPSH2|AAPL R735QTJ8XC9X\nAAPL 31A6MG9ZU6KPY|AAPL R735QTJ8XC9X\nAAPL 31A6MGMZV7NBA|AAPL R735QTJ8XC9X\nAAPL XRX5OEKHWLT2|AAPL R735QTJ8XC9X\nAAPL XAVQ659GGLJA|AAPL R735QTJ8XC9X\nAAPL 31BBZ860H2HBA|AAPL R735QTJ8XC9X\nAAPL XCZJLCBHGNPI|AAPL R735QTJ8XC9X\nAAPL XBNAORH6VPQE|AAPL R735QTJ8XC9X\nAAPL XAVQ65401P2E|AAPL R735QTJ8XC9X\nAAPL 31C3JQT3GMKIU|AAPL R735QTJ8XC9X\nAAPL XFH59UOHOO3Q|AAPL R735QTJ8XC9X\nAAPL XHYQYDVLFGBQ|AAPL R735QTJ8XC9X\nAAPL 31A6MGJS3LCQU|AAPL R735QTJ8XC9X\nAAPL 31AKEPJVJSWSM|AAPL R735QTJ8XC9X\nAAPL XBU6TQQFIV9I|AAPL R735QTJ8XC9X\nAAPL 31ADIKWBP6ARQ|AAPL R735QTJ8XC9X\nAAPL 31ADIKXGPN5UU|AAPL R735QTJ8XC9X\nAAPL XAVQ6IROCCEE|AAPL R735QTJ8XC9X\nAAPL 31BBZ87CXE9GM|AAPL R735QTJ8XC9X\nAAPL XB2MB6SE93GM|AAPL R735QTJ8XC9X\nAAPL XVD80691Q0SM|AAPL R735QTJ8XC9X\nAAPL XFH59UMO6ZK6|AAPL R735QTJ8XC9X\nAAPL 31A6MG8RCOOLI|AAPL R735QTJ8XC9X\nAAPL 31CV49ELQ8A9Y|AAPL R735QTJ8XC9X\nAAPL XFH59URGUOZQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5CO81W12|AAPL R735QTJ8XC9X\nAAPL 31ARAU7GE5J46|AAPL R735QTJ8XC9X\nAAPL 31KBXAXGB98XY|AAPL R735QTJ8XC9X\nAAPL XCZJLCCN501Y|AAPL R735QTJ8XC9X\nAAPL XBGEK56NIO2U|AAPL R735QTJ8XC9X\nAAPL 319ZQBWOGFJK6|AAPL R735QTJ8XC9X\nAAPL 31CV49FDUB1IE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXFNFWQU|AAPL R735QTJ8XC9X\nAAPL 31UH85M445GXY|AAPL R735QTJ8XC9X\nAAPL 31ADIKX1TT1EU|AAPL R735QTJ8XC9X\nAAPL XBGEK53CFZ3A|AAPL R735QTJ8XC9X\nAAPL 31H2R3TO6JVQE|AAPL R735QTJ8XC9X\nAAPL 31BBZ8649Y1AE|AAPL R735QTJ8XC9X\nAAPL 31C3JQSDZT62U|AAPL R735QTJ8XC9X\nAAPL XPFJZVT3RM9Y|AAPL R735QTJ8XC9X\nAAPL XBGEK3W0MFBA|AAPL R735QTJ8XC9X\nAAPL XVD806UDP206|AAPL R735QTJ8XC9X\nAAPL 31KBXAY0NI9UU|AAPL R735QTJ8XC9X\nAAPL 31C3JQSWUH6JQ|AAPL R735QTJ8XC9X\nAAPL 31CV49FFHUE06|AAPL R735QTJ8XC9X\nAAPL XAVQ6GXIUGNA|AAPL R735QTJ8XC9X\nAAPL XBU6TG61Z6UE|AAPL R735QTJ8XC9X\nAAPL XCZJLCG4613A|AAPL R735QTJ8XC9X\nAAPL 31FCPXXMJQCME|AAPL R735QTJ8XC9X\nAAPL XCZJLCR11Z6U|AAPL R735QTJ8XC9X\nAAPL 31AKEPVL9Q4EE|AAPL R735QTJ8XC9X\nAAPL 31ARAUKZLRA9Y|AAPL R735QTJ8XC9X\nAAPL 31ADIKW97VA12|AAPL R735QTJ8XC9X\nAAPL XPFJZWDG0N6U|AAPL R735QTJ8XC9X\nAAPL 31FCPXWVFDLOM|AAPL R735QTJ8XC9X\nAAPL XHYQYCUJWRL2|AAPL R735QTJ8XC9X\nAAPL XVD806788C92|AAPL R735QTJ8XC9X\nAAPL 31EL5FBDTL84M|AAPL R735QTJ8XC9X\nAAPL XAVQ669U838M|AAPL R735QTJ8XC9X\nAAPL 31A6MGMB25FWM|AAPL R735QTJ8XC9X\nAAPL 31AY6Z8BILTXI|AAPL R735QTJ8XC9X\nAAPL 319ZQBM42VV52|AAPL R735QTJ8XC9X\nAAPL XBU6TSKL0R0M|AAPL R735QTJ8XC9X\nAAPL XFH59UPZ9OJQ|AAPL R735QTJ8XC9X\nAAPL XFH59UKURG6E|AAPL R735QTJ8XC9X\nAAPL 31C3JQSCI85MU|AAPL R735QTJ8XC9X\nAAPL XB2MATSD80VA|AAPL R735QTJ8XC9X\nAAPL 31OJK5CCNAGKM|AAPL R735QTJ8XC9X\nAAPL 31R15TU4HHRT2|AAPL R735QTJ8XC9X\nAAPL XB9IFHKTG1GM|AAPL R735QTJ8XC9X\nAAPL XBU6TF0JNBLY|AAPL R735QTJ8XC9X\nAAPL 31A6MG8QOVCEE|AAPL R735QTJ8XC9X\nAAPL 31CV49EME1MH2|AAPL R735QTJ8XC9X\nAAPL XB9IFHE7ANHI|AAPL R735QTJ8XC9X\nAAPL 31UH85M8EY686|AAPL R735QTJ8XC9X\nAAPL XBU6TF218C1Y|AAPL R735QTJ8XC9X\nAAPL 31C3JQSB6LH8M|AAPL R735QTJ8XC9X\nAAPL XRX5OE5G6AH2|AAPL R735QTJ8XC9X\nAAPL 319ZQBXLJ6HFQ|AAPL R735QTJ8XC9X\nAAPL 31C3JQTDDUNHI|AAPL R735QTJ8XC9X\nAAPL XDR43YP67TOM|AAPL R735QTJ8XC9X\nAAPL 31C3JQSQ8BSKM|AAPL R735QTJ8XC9X\nAAPL 31ADIKWTK4AXY|AAPL R735QTJ8XC9X\nAAPL XFH59UM6BZEU|AAPL R735QTJ8XC9X\nAAPL XBNAOSNIZ97Q|AAPL R735QTJ8XC9X\nAAPL XL7X5HG49F9I|AAPL R735QTJ8XC9X\nAAPL XDR43YOOCTJA|AAPL R735QTJ8XC9X\nAAPL 31KBXAXP2QUEE|AAPL R735QTJ8XC9X\nAAPL XB9IFGW0DU1Y|AAPL R735QTJ8XC9X\nAAPL 31FCPXWW959XI|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q62E87A|AAPL R735QTJ8XC9X\nAAPL XFH59V1E0MSM|AAPL R735QTJ8XC9X\nAAPL 31AKEPXVYLH3A|AAPL R735QTJ8XC9X\nAAPL 31H2R3SW8FGJQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q7E0WLI|AAPL R735QTJ8XC9X\nAAPL XPFJZWK2615Y|AAPL R735QTJ8XC9X\nAAPL 31AY6Z8JSAKEE|AAPL R735QTJ8XC9X\nAAPL XRX5OE3YLA12|AAPL R735QTJ8XC9X\nAAPL 31ARAU7F8H6RQ|AAPL R735QTJ8XC9X\nAAPL XB2MAU2AG3TY|AAPL R735QTJ8XC9X\nAAPL XVD8064WVNK6|AAPL R735QTJ8XC9X\nAAPL 31ADIKW9JRY4M|AAPL R735QTJ8XC9X\nAAPL 31AKEPUFXAG1Y|AAPL R735QTJ8XC9X\nAAPL XRX5OE6RSYVA|AAPL R735QTJ8XC9X\nAAPL 31ADIKXDEKGVA|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q6Q7KEE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXU1CVVQ|AAPL R735QTJ8XC9X\nAAPL XPFJZVUX9ATI|AAPL R735QTJ8XC9X\nAAPL XBGEKGREVZD2|AAPL R735QTJ8XC9X\nAAPL XBNAORHISDTY|AAPL R735QTJ8XC9X\nAAPL 31ARAUKRC2JT2|AAPL R735QTJ8XC9X\nAAPL 31A6MG8R6QCJQ|AAPL R735QTJ8XC9X\nAAPL XHYQYD1BYCG6|AAPL R735QTJ8XC9X\nAAPL 31BBZ86RFER1I|AAPL R735QTJ8XC9X\nAAPL 31AY6Z7MPJMIU|AAPL R735QTJ8XC9X\nAAPL 31ADIKW91WXZA|AAPL R735QTJ8XC9X\nAAPL XB2MATYZDEUE|AAPL R735QTJ8XC9X\nAAPL XB9IFTW1EWNA|AAPL R735QTJ8XC9X\nAAPL XL7X5HJR8SCM|AAPL R735QTJ8XC9X\nAAPL 31AKEPJWJIX3A|AAPL R735QTJ8XC9X\nAAPL 31OJK5BSB1FNQ|AAPL R735QTJ8XC9X\nAAPL XRX5OE5Y1AME|AAPL R735QTJ8XC9X\nAAPL 319ZQBXTSV7WM|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q19SNXI|AAPL R735QTJ8XC9X\nAAPL XHYQYCXJ0NBA|AAPL R735QTJ8XC9X\nAAPL XBNAORH0XDOM|AAPL R735QTJ8XC9X\nAAPL 31R15TUONSGO6|AAPL R735QTJ8XC9X\nAAPL XPFJZVU3HMKM|AAPL R735QTJ8XC9X\nAAPL XAVQ65460146|AAPL R735QTJ8XC9X\nAAPL 31OJK5C12J146|AAPL R735QTJ8XC9X\nAAPL XFH59UQB6CNA|AAPL R735QTJ8XC9X\nAAPL 31A6MG8S6GCUE|AAPL R735QTJ8XC9X\nAAPL 31EL5FBIS79LY|AAPL R735QTJ8XC9X\nAAPL XB9IFGSPB52E|AAPL R735QTJ8XC9X\nAAPL 31AY6YV0WLHC6|AAPL R735QTJ8XC9X\nAAPL XBU6TSSUPHHI|AAPL R735QTJ8XC9X\nAAPL XPFJZVQSEXL2|AAPL R735QTJ8XC9X\nAAPL XG8PSGWVX4HY|AAPL R735QTJ8XC9X\nAAPL XFH59UONN05I|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q4WPVUU|AAPL R735QTJ8XC9X\nAAPL 31R15TU2TYFBA|AAPL R735QTJ8XC9X\nAAPL 31FCPXXY4HS2U|AAPL R735QTJ8XC9X\nAAPL XPFJZVPMSQEE|AAPL R735QTJ8XC9X\nAAPL XB2MASO6KZ6U|AAPL R735QTJ8XC9X\nAAPL 31ADIKWCCZMYU|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q68CK92|AAPL R735QTJ8XC9X\nAAPL 31R15TU1CDEVA|AAPL R735QTJ8XC9X\nAAPL 31H2R3SY7VH52|AAPL R735QTJ8XC9X\nAAPL XCZJLDJ56VL2|AAPL R735QTJ8XC9X\nAAPL XG8PSGYVD53A|AAPL R735QTJ8XC9X\nAAPL 31CV49F0M09K6|AAPL R735QTJ8XC9X\nAAPL XCZJLDE6KU3Q|AAPL R735QTJ8XC9X\nAAPL 31R15TU1U8F0M|AAPL R735QTJ8XC9X\nAAPL XB2MB70NXTXI|AAPL R735QTJ8XC9X\nAAPL XBU6TSCBC0JQ|AAPL R735QTJ8XC9X\nAAPL XB9IFH5XLX0M|AAPL R735QTJ8XC9X\nAAPL XFH59UKIUS2U|AAPL R735QTJ8XC9X\nAAPL XFH59UM0DND2|AAPL R735QTJ8XC9X\nAAPL XVD80652TZLY|AAPL R735QTJ8XC9X\nAAPL XG8PSGVKAG3Q|AAPL R735QTJ8XC9X\nAAPL XDR43YL7BSHY|AAPL R735QTJ8XC9X\nAAPL XDR43ZHY3X46|AAPL R735QTJ8XC9X\nAAPL XB9IFGDTJ5S6|AAPL R735QTJ8XC9X\nAAPL 31R15TU3HRRIE|AAPL R735QTJ8XC9X\nAAPL XL7X5HPVH10M|AAPL R735QTJ8XC9X\nAAPL XPFJZVTRKYH2|AAPL R735QTJ8XC9X\nAAPL 31ADIKWAVEMIU|AAPL R735QTJ8XC9X\nAAPL XB9IFG96TSEE|AAPL R735QTJ8XC9X\nAAPL 31BBZ864RT1FQ|AAPL R735QTJ8XC9X\nAAPL 31ARAU8ROV42U|AAPL R735QTJ8XC9X\nAAPL 31ARAU8B5HN52|AAPL R735QTJ8XC9X\nAAPL XAVQ6IJENLXI|AAPL R735QTJ8XC9X\nAAPL XBNAORG17DDY|AAPL R735QTJ8XC9X\nAAPL XHYQYCWV7B46|AAPL R735QTJ8XC9X\nAAPL 31BBZ86WE0SIU|AAPL R735QTJ8XC9X\nAAPL 31AY6Z90BO1C6|AAPL R735QTJ8XC9X\nAAPL XHYQYCY6TZIE|AAPL R735QTJ8XC9X\nAAPL 31A6MGA3599PI|AAPL R735QTJ8XC9X\nAAPL XPFJZVW8VZ7Q|AAPL R735QTJ8XC9X\nAAPL XPFJZVQYD9MU|AAPL R735QTJ8XC9X\nAAPL 31A6MG8R0S0HY|AAPL R735QTJ8XC9X\nAAPL 31C3JQSBCJTAE|AAPL R735QTJ8XC9X\nAAPL 31UH85M59TTAE|AAPL R735QTJ8XC9X\nAAPL 31OJK5BTGPS06|AAPL R735QTJ8XC9X\nAAPL XG8PSH0UT5OM|AAPL R735QTJ8XC9X\nAAPL XFH59VOJJHPI|AAPL R735QTJ8XC9X\nAAPL 31BBZ865LKPOM|AAPL R735QTJ8XC9X\nAAPL XAVQ6H5SJ746|AAPL R735QTJ8XC9X\nAAPL 31BBZ87B9UWYU|AAPL R735QTJ8XC9X\nAAPL XG8PSI28ANOM|AAPL R735QTJ8XC9X\nAAPL XL7X5HGY13IE|AAPL R735QTJ8XC9X\nAAPL XPFJZVRY39XI|AAPL R735QTJ8XC9X\nAAPL XBU6TG4EFUCM|AAPL R735QTJ8XC9X\nAAPL XG8PSIAHZE5I|AAPL R735QTJ8XC9X\nAAPL XB9IFGE5FTVQ|AAPL R735QTJ8XC9X\nAAPL XBNAOSF9AIQU|AAPL R735QTJ8XC9X\nAAPL 31AKEPYCHYY12|AAPL R735QTJ8XC9X\nAAPL 31EL5FBC61VMU|AAPL R735QTJ8XC9X\nAAPL XB9IFGDHMHOM|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZDJTHI|AAPL R735QTJ8XC9X\nAAPL XBNAP43BQJ0M|AAPL R735QTJ8XC9X\nAAPL 31KBXAXI4QXHI|AAPL R735QTJ8XC9X\nAAPL 31EL5FBKFQM3Q|AAPL R735QTJ8XC9X\nAAPL XFH59VMW057Q|AAPL R735QTJ8XC9X\nAAPL XL7X5HKF24JQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXIMLXMU|AAPL R735QTJ8XC9X\nAAPL XFH59UNNWZUU|AAPL R735QTJ8XC9X\nAAPL XB9IFGCHWHDY|AAPL R735QTJ8XC9X\nAAPL XG8PSIC5IQNA|AAPL R735QTJ8XC9X\nAAPL 31C3JQSETKUBQ|AAPL R735QTJ8XC9X\nAAPL XBGEK4YDTXLY|AAPL R735QTJ8XC9X\nAAPL XBGEK3XI7FRA|AAPL R735QTJ8XC9X\nAAPL 31ADIKWQ91LYE|AAPL R735QTJ8XC9X\nAAPL 31FCPXWWR0A2U|AAPL R735QTJ8XC9X\nAAPL 31ARAU7G8772E|AAPL R735QTJ8XC9X\nAAPL 319ZQBL85VERQ|AAPL R735QTJ8XC9X\nAAPL XHYQYCX73Z7Q|AAPL R735QTJ8XC9X\nAAPL XCZJLDUPYB1I|AAPL R735QTJ8XC9X\nAAPL XAVQ66JRG67A|AAPL R735QTJ8XC9X\nAAPL 31KBXAXGN5X1I|AAPL R735QTJ8XC9X\nAAPL 31BBZ86HI6O2U|AAPL R735QTJ8XC9X\nAAPL XFH59UPND0G6|AAPL R735QTJ8XC9X\nAAPL 31BBZ876B8VHI|AAPL R735QTJ8XC9X\nAAPL XRX5OE2H09L2|AAPL R735QTJ8XC9X\nAAPL XB9IFG8UX4AU|AAPL R735QTJ8XC9X\nAAPL XB2MASSBD79I|AAPL R735QTJ8XC9X\nAAPL XPFJZVQAM2LI|AAPL R735QTJ8XC9X\nAAPL XB9IFUKUH41Y|AAPL R735QTJ8XC9X\nAAPL XCZJLDT2EYJQ|AAPL R735QTJ8XC9X\nAAPL XL7X5HY55RHI|AAPL R735QTJ8XC9X\nAAPL XB9IFS1VX0W6|AAPL R735QTJ8XC9X\nAAPL XG8PSGZJ6HAE|AAPL R735QTJ8XC9X\nAAPL 31CV49ELEBM6E|AAPL R735QTJ8XC9X\nAAPL XB9IFHFUTZZA|AAPL R735QTJ8XC9X\nAAPL XBGEKIDAP4NA|AAPL R735QTJ8XC9X\nAAPL 31A6MG9RKHU92|AAPL R735QTJ8XC9X\nAAPL 31H2R3SYPQHAE|AAPL R735QTJ8XC9X\nAAPL XDR43ZQ7SNL2|AAPL R735QTJ8XC9X\nAAPL 31R15TTZCZJFQ|AAPL R735QTJ8XC9X\nAAPL XB9IFHMGZDYE|AAPL R735QTJ8XC9X\nAAPL XDR43YMIYGW6|AAPL R735QTJ8XC9X\nAAPL 31UH85M7R4U12|AAPL R735QTJ8XC9X\nAAPL XB9IFG9UN4LI|AAPL R735QTJ8XC9X\nAAPL 31C3JQTTX84FA|AAPL R735QTJ8XC9X\nAAPL 31FCPXWUFNLDY|AAPL R735QTJ8XC9X\nAAPL XVD8077LZTYE|AAPL R735QTJ8XC9X\nAAPL 31ADIKXBR14DI|AAPL R735QTJ8XC9X\nAAPL 31ARAUKJ2DTC6|AAPL R735QTJ8XC9X\nAAPL XRX5OE05PQ1Y|AAPL R735QTJ8XC9X\nAAPL XL7X5HDSYVQE|AAPL R735QTJ8XC9X\nAAPL XB9IFGD5PTL2|AAPL R735QTJ8XC9X\nAAPL 31EL5FBNQTB3A|AAPL R735QTJ8XC9X\nAAPL XB9IFHHIDCH2|AAPL R735QTJ8XC9X\nAAPL 31ARAU7G28V0M|AAPL R735QTJ8XC9X\nAAPL XG8PSGT8ZWKM|AAPL R735QTJ8XC9X\nAAPL XL7X5HGG63D2|AAPL R735QTJ8XC9X\nAAPL XPFJZVQ4NQJQ|AAPL R735QTJ8XC9X\nAAPL XHYQYD1TTCLI|AAPL R735QTJ8XC9X\nAAPL 31KBXAXHYSLFQ|AAPL R735QTJ8XC9X\nAAPL 319ZQBMAP1946|AAPL R735QTJ8XC9X\nAAPL 31FCPXXJ8NNMU|AAPL R735QTJ8XC9X\nAAPL XCZJLCCT3C3Q|AAPL R735QTJ8XC9X\nAAPL 31C3JQSB0N56U|AAPL R735QTJ8XC9X\nAAPL 31EL5FAN73HC6|AAPL R735QTJ8XC9X\nAAPL 31AKEPJV1XWNA|AAPL R735QTJ8XC9X\nAAPL XBGEK59YLD2E|AAPL R735QTJ8XC9X\nAAPL XAVQ6IZY12VA|AAPL R735QTJ8XC9X\nAAPL 31UH85M2YJ9RA|AAPL R735QTJ8XC9X\nAAPL 31UH85M6RETQE|AAPL R735QTJ8XC9X\nAAPL 31A6MG8SU9P1I|AAPL R735QTJ8XC9X\nAAPL XB9IFGH4JPLY|AAPL R735QTJ8XC9X\nAAPL XC7Z2RC2L3L2|AAPL R735QTJ8XC9X\nAAPL XDR43YPZZHXI|AAPL R735QTJ8XC9X\nAAPL XVD806SQ5PIE|AAPL R735QTJ8XC9X\nAAPL 31ADIKWC12YVA|AAPL R735QTJ8XC9X\nAAPL 31EL5FAJK69EU|AAPL R735QTJ8XC9X\nAAPL 31UH85N55QAUE|AAPL R735QTJ8XC9X\nAAPL XBGEK3WIHFGM|AAPL R735QTJ8XC9X\nAAPL 31CV49EMPYAKM|AAPL R735QTJ8XC9X\nAAPL XDR43YOIEHHI|AAPL R735QTJ8XC9X\nAAPL XG8PSIDT2352|AAPL R735QTJ8XC9X\nAAPL 31FCPXWWF3LZA|AAPL R735QTJ8XC9X\nAAPL 31EL5FAOUMTTY|AAPL R735QTJ8XC9X\nAAPL 31R15TULCPROM|AAPL R735QTJ8XC9X\nAAPL XVD8065WLNUU|AAPL R735QTJ8XC9X\nAAPL XBGEK4V2R8ME|AAPL R735QTJ8XC9X\nAAPL XL7X5IEOJ8FA|AAPL R735QTJ8XC9X\nAAPL XDR43ZL96M3Q|AAPL R735QTJ8XC9X\nAAPL XPFJZVSFYA2U|AAPL R735QTJ8XC9X\nAAPL XG8PSHYX7YP2|AAPL R735QTJ8XC9X\nAAPL 31C3JQT6RP9IE|AAPL R735QTJ8XC9X\nAAPL 31BBZ864XRDHI|AAPL R735QTJ8XC9X\nAAPL 31A6MG8NDUSKM|AAPL R735QTJ8XC9X\nAAPL XFH59UOTLC7A|AAPL R735QTJ8XC9X\nAAPL 31BBZ873066HY|AAPL R735QTJ8XC9X\nAAPL XDR43ZYHHE1Y|AAPL R735QTJ8XC9X\nAAPL 31UH85M53VH8M|AAPL R735QTJ8XC9X\nAAPL 31A6MGJ3AJ5C6|AAPL R735QTJ8XC9X\nAAPL XL7X5HFGG32E|AAPL R735QTJ8XC9X\nAAPL XG8PSIH44S4M|AAPL R735QTJ8XC9X\nAAPL XBGEK3XU43UU|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q782KJQ|AAPL R735QTJ8XC9X\nAAPL XRX5OE5A7YFA|AAPL R735QTJ8XC9X\nAAPL XG8PSGVQ8S5I|AAPL R735QTJ8XC9X\nAAPL XPFJZW6TV97Q|AAPL R735QTJ8XC9X\nAAPL 31OJK5BQ5N30M|AAPL R735QTJ8XC9X\nAAPL 31A6MGKP6CAME|AAPL R735QTJ8XC9X\nAAPL 319ZQBL37BIG6|AAPL R735QTJ8XC9X\nAAPL 31C3JQT1T3812|AAPL R735QTJ8XC9X\nAAPL XFH59UQH4OP2|AAPL R735QTJ8XC9X\nAAPL XVD806ZCB3HI|AAPL R735QTJ8XC9X\nAAPL XBNAP20WJWSM|AAPL R735QTJ8XC9X\nAAPL 31BBZ863M4P3A|AAPL R735QTJ8XC9X\nAAPL XB2MAU0MWRC6|AAPL R735QTJ8XC9X\nAAPL XHYQYD06A03Q|AAPL R735QTJ8XC9X\nAAPL XRX5OER41ZS6|AAPL R735QTJ8XC9X\nAAPL XB9IFGBO4T52|AAPL R735QTJ8XC9X\nAAPL XHYQYD2BOCQU|AAPL R735QTJ8XC9X\nAAPL XFH59VBB8PRA|AAPL R735QTJ8XC9X\nAAPL 31BBZ86349OXY|AAPL R735QTJ8XC9X\nAAPL 31ARAUL7VG0QU|AAPL R735QTJ8XC9X\nAAPL XVD80687YCJQ|AAPL R735QTJ8XC9X\nAAPL XVD806ADCP6U|AAPL R735QTJ8XC9X\nAAPL 31CV49ELK9Y86|AAPL R735QTJ8XC9X\nAAPL XDR43YN0TH1I|AAPL R735QTJ8XC9X\nAAPL XG8PSGYJGGZQ|AAPL R735QTJ8XC9X\nAAPL XBU6TF2P1O92|AAPL R735QTJ8XC9X\nAAPL 31FCPXXKW704M|AAPL R735QTJ8XC9X\nAAPL 31C3JQSCC9TL2|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q6K98CM|AAPL R735QTJ8XC9X\nAAPL XRX5OE3GQ9VQ|AAPL R735QTJ8XC9X\nAAPL XPFJZVURAYRQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3SX274SM|AAPL R735QTJ8XC9X\nAAPL 31R15TUTMEI5I|AAPL R735QTJ8XC9X\nAAPL 31AY6YVWZK9RA|AAPL R735QTJ8XC9X\nAAPL XRX5OE44JM2U|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q5EKW06|AAPL R735QTJ8XC9X\nAAPL XAVQ66D5AS86|AAPL R735QTJ8XC9X\nAAPL XL7X5HE4VJTY|AAPL R735QTJ8XC9X\nAAPL XBNAORI6LQ12|AAPL R735QTJ8XC9X\nAAPL XBNAP50EHGW6|AAPL R735QTJ8XC9X\nAAPL 31ADIKW9PQA6E|AAPL R735QTJ8XC9X\nAAPL XAVQ6JOR3A9Y|AAPL R735QTJ8XC9X\nAAPL XRX5OEPGINAE|AAPL R735QTJ8XC9X\nAAPL 31ADIKWBJ7YPY|AAPL R735QTJ8XC9X\nAAPL XB2MASRZGJ5Y|AAPL R735QTJ8XC9X\nAAPL 31R15TURYV5NQ|AAPL R735QTJ8XC9X\nAAPL XFH59URYPP52|AAPL R735QTJ8XC9X\nAAPL XBU6TF17GNT2|AAPL R735QTJ8XC9X\nAAPL 31FCPXWVRA9S6|AAPL R735QTJ8XC9X\nAAPL 31AKEPJW1NWXY|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q42Y7LY|AAPL R735QTJ8XC9X\nAAPL 31ARAUIX6KO1Y|AAPL R735QTJ8XC9X\nAAPL XFH59UN03NNQ|AAPL R735QTJ8XC9X\nAAPL 31UH85M73BHTY|AAPL R735QTJ8XC9X\nAAPL XAVQ6686OQQU|AAPL R735QTJ8XC9X\nAAPL 31CV49EYYGX2E|AAPL R735QTJ8XC9X\nAAPL XBGEKEGQ0MO6|AAPL R735QTJ8XC9X\nAAPL XDR43ZGAKKME|AAPL R735QTJ8XC9X\nAAPL XB2MASSN9VD2|AAPL R735QTJ8XC9X\nAAPL XBGEKI510E6E|AAPL R735QTJ8XC9X\nAAPL XBNAORFJCD8M|AAPL R735QTJ8XC9X\nAAPL 31ADIKW8E3LS6|AAPL R735QTJ8XC9X\nAAPL XAVQ658SN9C6|AAPL R735QTJ8XC9X\nAAPL 31EL5FAM1F4ZQ|AAPL R735QTJ8XC9X\nAAPL 31AKEPX75J9OM|AAPL R735QTJ8XC9X\nAAPL XCZJLCH9UDFQ|AAPL R735QTJ8XC9X\nAAPL XB9IFGAOESUE|AAPL R735QTJ8XC9X\nAAPL 31UH85M4M0H3A|AAPL R735QTJ8XC9X\nAAPL XVD806M40BJA|AAPL R735QTJ8XC9X\nAAPL XB2MAU3XZGBQ|AAPL R735QTJ8XC9X\nAAPL 31BBZ86KT9D2E|AAPL R735QTJ8XC9X\nAAPL XG8PSH06ZTHI|AAPL R735QTJ8XC9X\nAAPL XBNAOSK7WK86|AAPL R735QTJ8XC9X\nAAPL XBGEKGJ578W6|AAPL R735QTJ8XC9X\nAAPL 319ZQBL7O0EME|AAPL R735QTJ8XC9X\nAAPL 31ARAU7BXGMXY|AAPL R735QTJ8XC9X\nAAPL XFH59UQT1CSM|AAPL R735QTJ8XC9X\nAAPL XHYQYCY0VNGM|AAPL R735QTJ8XC9X\nAAPL XBU6TGEBNXBA|AAPL R735QTJ8XC9X\nAAPL 31ARAU8CT0ZMU|AAPL R735QTJ8XC9X\nAAPL 31BBZ8643ZP8M|AAPL R735QTJ8XC9X\nAAPL 31OJK5BPZOQYU|AAPL R735QTJ8XC9X\nAAPL XFH59UQ580LI|AAPL R735QTJ8XC9X\nAAPL XFH59URMT11I|AAPL R735QTJ8XC9X\nAAPL XBU6TG2QWHUU|AAPL R735QTJ8XC9X\nAAPL XHYQYD00BO1Y|AAPL R735QTJ8XC9X\nAAPL XB9IFGACI4QU|AAPL R735QTJ8XC9X\nAAPL XG8PSH0IWHL2|AAPL R735QTJ8XC9X\nAAPL XBU6TEWWQ3OM|AAPL R735QTJ8XC9X\nAAPL 31AY6Z6XWHF46|AAPL R735QTJ8XC9X\nAAPL 31ADIKWRWKYG6|AAPL R735QTJ8XC9X\nAAPL 31UH85M6FI5MU|AAPL R735QTJ8XC9X\nAAPL XBGEK3WOFRIE|AAPL R735QTJ8XC9X\nAAPL 31AKEPL4794YU|AAPL R735QTJ8XC9X\nAAPL XL7X5HDN0JOM|AAPL R735QTJ8XC9X\nAAPL XFH59UZQHAAU|AAPL R735QTJ8XC9X\nAAPL 31UH85NA4CCBQ|AAPL R735QTJ8XC9X\nAAPL XBNAORIIIE4M|AAPL R735QTJ8XC9X\nAAPL 31FCPXY4QN61Y|AAPL R735QTJ8XC9X\nAAPL XB9IFHRFLFFQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q3WZVK6|AAPL R735QTJ8XC9X\nAAPL 31BBZ863S3152|AAPL R735QTJ8XC9X\nAAPL 31CV49EJWQLQE|AAPL R735QTJ8XC9X\nAAPL 31ADIKWCIXZ0M|AAPL R735QTJ8XC9X\nAAPL XB9IFGR1RSKM|AAPL R735QTJ8XC9X\nAAPL XCZJLCABUGIU|AAPL R735QTJ8XC9X\nAAPL XL7X5HJX74EE|AAPL R735QTJ8XC9X\nAAPL 31A6MG9WJ3VQE|AAPL R735QTJ8XC9X\nAAPL 31ADIKWHZCVHI|AAPL R735QTJ8XC9X\nAAPL XVD8063FCS9Y|AAPL R735QTJ8XC9X\nAAPL 31C3JQSEHO686|AAPL R735QTJ8XC9X\nAAPL 31ARAU8G43OME|AAPL R735QTJ8XC9X\nAAPL 31UH85M63LHJA|AAPL R735QTJ8XC9X\nAAPL XVD80799J6G6|AAPL R735QTJ8XC9X\nAAPL XDR43YM71SSM|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q3R1JIE|AAPL R735QTJ8XC9X\nAAPL XAVQ6G8PS98M|AAPL R735QTJ8XC9X\nAAPL 319ZQBZFOOD6U|AAPL R735QTJ8XC9X\nAAPL XBGEK3SPLVHI|AAPL R735QTJ8XC9X\nAAPL XFH59V8060RQ|AAPL R735QTJ8XC9X\nAAPL XVD8075YGHGM|AAPL R735QTJ8XC9X\nAAPL 31ARAU8HRN146|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q5KJ81Y|AAPL R735QTJ8XC9X\nAAPL 31AY6Z98LCRT2|AAPL R735QTJ8XC9X\nAAPL 31CV49EJQS9OM|AAPL R735QTJ8XC9X\nAAPL XFH59UR4Y0W6|AAPL R735QTJ8XC9X\nAAPL 31A6MG9Y6N886|AAPL R735QTJ8XC9X\nAAPL XB9IFGM35R3A|AAPL R735QTJ8XC9X\nAAPL XCZJLCEYHOQU|AAPL R735QTJ8XC9X\nAAPL 31BBZ861YLCLI|AAPL R735QTJ8XC9X\nAAPL 31EL5FALVGSXY|AAPL R735QTJ8XC9X\nAAPL 31CV49EN1UYO6|AAPL R735QTJ8XC9X\nAAPL XBGEK51OWMLI|AAPL R735QTJ8XC9X\nAAPL XB2MB63L6W1Y|AAPL R735QTJ8XC9X\nAAPL XBU6TGB0L8BQ|AAPL R735QTJ8XC9X\nAAPL 31ADIKX54VQEE|AAPL R735QTJ8XC9X\nAAPL 31AY6YVVC0X9I|AAPL R735QTJ8XC9X\nAAPL XBGEKF5J2U2U|AAPL R735QTJ8XC9X\nAAPL XB9IFGC01H8M|AAPL R735QTJ8XC9X\nAAPL 31H2R3TRHMKPY|AAPL R735QTJ8XC9X\nAAPL 31BBZ87HW0AXY|AAPL R735QTJ8XC9X\nAAPL XBNAP3MSD22U|AAPL R735QTJ8XC9X\nAAPL 31C3JQSAUOT52|AAPL R735QTJ8XC9X\nAAPL XDR43YNIOH6U|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZ1N5DY|AAPL R735QTJ8XC9X\nAAPL XC7Z2RLZT6JQ|AAPL R735QTJ8XC9X\nAAPL XBU6TR6YWC7A|AAPL R735QTJ8XC9X\nAAPL XBGEK3XO5RT2|AAPL R735QTJ8XC9X\nAAPL 31EL5FBM39YLI|AAPL R735QTJ8XC9X\nAAPL XB9IFGKFMELI|AAPL R735QTJ8XC9X\nAAPL 31H2R3TFWV59I|AAPL R735QTJ8XC9X\nAAPL XDR43YIQ2WX2|AAPL R735QTJ8XC9X\nAAPL 31FCPXY6E6IJQ|AAPL R735QTJ8XC9X\nAAPL XCZJLCDSTCEE|AAPL R735QTJ8XC9X\nAAPL XCZJLCH3W1DY|AAPL R735QTJ8XC9X\nAAPL 319ZQBYZ5AW92|AAPL R735QTJ8XC9X\nAAPL XHYQYCX15N5Y|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q4QRJT2|AAPL R735QTJ8XC9X\nAAPL XBGEKHOHMX8M|AAPL R735QTJ8XC9X\nAAPL XG8PSGYDI4XY|AAPL R735QTJ8XC9X\nAAPL XBU6TRNI9T52|AAPL R735QTJ8XC9X\nAAPL 31AY6Z7UZ8CZQ|AAPL R735QTJ8XC9X\nAAPL 31ADIKXOZBWBQ|AAPL R735QTJ8XC9X\nAAPL XFH59URAWCXY|AAPL R735QTJ8XC9X\nAAPL 31C3JQTLNJDYE|AAPL R735QTJ8XC9X\nAAPL 319ZQBZW81U4M|AAPL R735QTJ8XC9X\nAAPL XCZJLE2ZN1IE|AAPL R735QTJ8XC9X\nAAPL XVD8074AX4YU|AAPL R735QTJ8XC9X\nAAPL 31A6MGJBK7VT2|AAPL R735QTJ8XC9X\nAAPL 31UH85MV8I7VQ|AAPL R735QTJ8XC9X\nAAPL XL7X5I6EUHYE|AAPL R735QTJ8XC9X\nAAPL XB2MB7PH01C6|AAPL R735QTJ8XC9X\nAAPL XAVQ66ESU4PY|AAPL R735QTJ8XC9X\nAAPL 319ZQBL6OAEBQ|AAPL R735QTJ8XC9X\nAAPL 31AY6Z8S1ZAVA|AAPL R735QTJ8XC9X\nAAPL 31BBZ860N0TD2|AAPL R735QTJ8XC9X\nAAPL 31CV49F3X2YJQ|AAPL R735QTJ8XC9X\nAAPL XHYQYDQMTEUE|AAPL R735QTJ8XC9X\nAAPL 31H2R3SWQAGP2|AAPL R735QTJ8XC9X\nAAPL 31CV49EL2EY2U|AAPL R735QTJ8XC9X\nAAPL 31A6MG8SCEOW6|AAPL R735QTJ8XC9X\nAAPL 31AY6Z76665L2|AAPL R735QTJ8XC9X\nAAPL 31CV49FZCAJXI|AAPL R735QTJ8XC9X\nAAPL XB9IFHPS22XY|AAPL R735QTJ8XC9X\nAAPL XL7X5HILKG06|AAPL R735QTJ8XC9X\nAAPL XDR43YLV54P2|AAPL R735QTJ8XC9X\nAAPL 31ADIKWGBTIZQ|AAPL R735QTJ8XC9X\nAAPL XG8PSGY7JSW6|AAPL R735QTJ8XC9X\nAAPL XB9IFHAW7YHY|AAPL R735QTJ8XC9X\nAAPL 31KBXAXIAP9JA|AAPL R735QTJ8XC9X\nAAPL 31A6MG9MLVSRQ|AAPL R735QTJ8XC9X\nAAPL 319ZQBME03Y3Q|AAPL R735QTJ8XC9X\nAAPL 31CV49FKGGFHI|AAPL R735QTJ8XC9X\nAAPL 31C3JQTK001GM|AAPL R735QTJ8XC9X\nAAPL XFH59UK6Y3ZA|AAPL R735QTJ8XC9X\nAAPL 31AKEPXFF805I|AAPL R735QTJ8XC9X\nAAPL XAVQ657MYWZQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5CFYD5K6|AAPL R735QTJ8XC9X\nAAPL XRX5OEM5FYAU|AAPL R735QTJ8XC9X\nAAPL XFH59V9NPD9I|AAPL R735QTJ8XC9X\nAAPL XL7X5HESMQVA|AAPL R735QTJ8XC9X\nAAPL XHYQYD0U3CAU|AAPL R735QTJ8XC9X\nAAPL 31ADIKX069OX2|AAPL R735QTJ8XC9X\nAAPL 31ADIKWOLI9GM|AAPL R735QTJ8XC9X\nAAPL 319ZQBL7ZX2PY|AAPL R735QTJ8XC9X\nAAPL XPFJZWGR3C6E|AAPL R735QTJ8XC9X\nAAPL 31H2R3SWEDSLI|AAPL R735QTJ8XC9X\nAAPL 31A6MG8SID0XY|AAPL R735QTJ8XC9X\nAAPL XBU6TGCO4KTI|AAPL R735QTJ8XC9X\nAAPL 31ADIKWB7BAME|AAPL R735QTJ8XC9X\nAAPL XB2MB56IFY6E|AAPL R735QTJ8XC9X\nAAPL XB9IFHJ5WOYU|AAPL R735QTJ8XC9X\nAAPL XBNAOSAAOH9I|AAPL R735QTJ8XC9X\nAAPL XBGEK54ZZBL2|AAPL R735QTJ8XC9X\nAAPL XB9IFSIFAHTY|AAPL R735QTJ8XC9X\nAAPL XRX5OE1N8LC6|AAPL R735QTJ8XC9X\nAAPL XCZJLCDYROG6|AAPL R735QTJ8XC9X\nAAPL XCZJLDFU46LI|AAPL R735QTJ8XC9X\nAAPL 31A6MG9T816QU|AAPL R735QTJ8XC9X\nAAPL 31BBZ865RJ1QE|AAPL R735QTJ8XC9X\nAAPL XB9IFG90VGCM|AAPL R735QTJ8XC9X\nAAPL XCZJLCFY7P1I|AAPL R735QTJ8XC9X\nAAPL XFH59UPHEOEE|AAPL R735QTJ8XC9X\nAAPL XBU6TGFZ79T2|AAPL R735QTJ8XC9X\nAAPL 31UH85M9EO6IU|AAPL R735QTJ8XC9X\nAAPL 31OJK5BQHJR46|AAPL R735QTJ8XC9X\nAAPL 31KBXAXD6715Y|AAPL R735QTJ8XC9X\nAAPL 31EL5FAJE7XD2|AAPL R735QTJ8XC9X\nAAPL XAVQ6HULLEIU|AAPL R735QTJ8XC9X\nAAPL XAVQ657SX91I|AAPL R735QTJ8XC9X\nAAPL XAVQ66I3WTPI|AAPL R735QTJ8XC9X\nAAPL XAVQ6FS6ESAU|AAPL R735QTJ8XC9X\nAAPL 31KBXAYDVT1T2|AAPL R735QTJ8XC9X\nAAPL XRX5OE1T6XDY|AAPL R735QTJ8XC9X\nAAPL XB2MAST54VIE|AAPL R735QTJ8XC9X\nAAPL 31CV49FXOR7FQ|AAPL R735QTJ8XC9X\nAAPL XCZJLD2LTENA|AAPL R735QTJ8XC9X\nAAPL 31AY6YV02TT3A|AAPL R735QTJ8XC9X\nAAPL XG8PSH0OUTMU|AAPL R735QTJ8XC9X\nAAPL 31C3JQSAOQH3A|AAPL R735QTJ8XC9X\nAAPL XRX5OE63ZMO6|AAPL R735QTJ8XC9X\nAAPL XL7X5HHFW3NQ|AAPL R735QTJ8XC9X\nAAPL 31AY6YUW9Y946|AAPL R735QTJ8XC9X\nAAPL 31KBXAXCUAD2E|AAPL R735QTJ8XC9X\nAAPL XB2MASOCJB8M|AAPL R735QTJ8XC9X\nAAPL XHYQYD1NV0JQ|AAPL R735QTJ8XC9X\nAAPL XB9IFGUCUHK6|AAPL R735QTJ8XC9X\nAAPL 31ARAU7F2IUPY|AAPL R735QTJ8XC9X\nAAPL 31ARAU8EGKC4M|AAPL R735QTJ8XC9X\nAAPL 31EL5FAKJU4JQ|AAPL R735QTJ8XC9X\nAAPL 31ARAULOETHOM|AAPL R735QTJ8XC9X\nAAPL XVD80658SBNQ|AAPL R735QTJ8XC9X\nAAPL 31AKEPJRWVOVA|AAPL R735QTJ8XC9X\nAAPL XCZJLCC59ZWM|AAPL R735QTJ8XC9X\nAAPL XB2MB3SWBJD2|AAPL R735QTJ8XC9X\nAAPL XRX5OE4GGA6E|AAPL R735QTJ8XC9X\nAAPL 31AKEPKVXKEHY|AAPL R735QTJ8XC9X\nAAPL 31UH85N8GSZTY|AAPL R735QTJ8XC9X\nAAPL XB9IFUT45UIU|AAPL R735QTJ8XC9X\nAAPL XFH59V6CMO9Y|AAPL R735QTJ8XC9X\nAAPL 31UH85N0749D2|AAPL R735QTJ8XC9X\nAAPL XG8PSGWPYSG6|AAPL R735QTJ8XC9X\nAAPL 31AKEPWQM5SQU|AAPL R735QTJ8XC9X\nAAPL 319ZQBL7C3QIU|AAPL R735QTJ8XC9X\nAAPL XBGEKG2LTRYE|AAPL R735QTJ8XC9X\nAAPL XPFJZVWWPBEU|AAPL R735QTJ8XC9X\nAAPL XVD8068JV0NA|AAPL R735QTJ8XC9X\nAAPL 31A6MGAD2HCO6|AAPL R735QTJ8XC9X\nAAPL XG8PSGT31KIU|AAPL R735QTJ8XC9X\nAAPL 31ADIL9V8OQ12|AAPL R735QTJ8XC9X\nAAPL XBU6TF1VA006|AAPL R735QTJ8XC9X\nAAPL 31ARAU8L2PQ3Q|AAPL R735QTJ8XC9X\nAAPL 31AY6YUZ924UE|AAPL R735QTJ8XC9X\nAAPL XCZJLCGG2P6U|AAPL R735QTJ8XC9X\nAAPL XFH59UNTVBWM|AAPL R735QTJ8XC9X\nAAPL 31ARAUI03TQ6E|AAPL R735QTJ8XC9X\nAAPL XB2MAU5LISTI|AAPL R735QTJ8XC9X\nAAPL 31KBXAXFBJ8NA|AAPL R735QTJ8XC9X\nAAPL 31C3JQT545X0M|AAPL R735QTJ8XC9X\nAAPL 31H2R3THKEHRA|AAPL R735QTJ8XC9X\nAAPL 31A6MGKGWNK5I|AAPL R735QTJ8XC9X\nAAPL XPFJZVVF4AYU|AAPL R735QTJ8XC9X\nAAPL 31CV49EM83AFA|AAPL R735QTJ8XC9X\nAAPL XRX5OE73PMYU|AAPL R735QTJ8XC9X\nAAPL 31H2R3SY1X53A|AAPL R735QTJ8XC9X\nAAPL 319ZQBL7I22KM|AAPL R735QTJ8XC9X\nAAPL 31A6MG9O9F59I|AAPL R735QTJ8XC9X\nAAPL XDR43Z329SO6|AAPL R735QTJ8XC9X\nAAPL 31BBZ879MBKH2|AAPL R735QTJ8XC9X\nAAPL 319ZQBYILXFBA|AAPL R735QTJ8XC9X\nAAPL XBNAOSZ3QOO6|AAPL R735QTJ8XC9X\nAAPL XL7X5HI3PFUU|AAPL R735QTJ8XC9X\nAAPL 31FCPXXUTF33A|AAPL R735QTJ8XC9X\nAAPL XFH59V31JZAE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXENPWG6|AAPL R735QTJ8XC9X\nAAPL 31CV49FUDOIG6|AAPL R735QTJ8XC9X\nAAPL XG8PSHOZZVQE|AAPL R735QTJ8XC9X\nAAPL 31UH85MYJKWVA|AAPL R735QTJ8XC9X\nAAPL 31H2R3TMJ0J8M|AAPL R735QTJ8XC9X\nAAPL 31ADIKWADJMDI|AAPL R735QTJ8XC9X\nAAPL XCZJLCF4G0SM|AAPL R735QTJ8XC9X\nAAPL 31ADIKWCOWB2E|AAPL R735QTJ8XC9X\nAAPL 31EL5FANUWTJA|AAPL R735QTJ8XC9X\nAAPL XB9IFG8D49BA|AAPL R735QTJ8XC9X\nAAPL 31CV49FAJ8CIU|AAPL R735QTJ8XC9X\nAAPL 31ADIKWBV4MTI|AAPL R735QTJ8XC9X\nAAPL 31EL5FB5JWHNQ|AAPL R735QTJ8XC9X\nAAPL XB9IFHCJRAZQ|AAPL R735QTJ8XC9X\nAAPL XB2MATP25BVQ|AAPL R735QTJ8XC9X\nAAPL XG8PSHQNJ886|AAPL R735QTJ8XC9X\nAAPL 31R15TU206R2E|AAPL R735QTJ8XC9X\nAAPL XB2MATNELZDY|AAPL R735QTJ8XC9X\nAAPL 31A6MGK8MYTOM|AAPL R735QTJ8XC9X\nAAPL XB2MB5ES4ONA|AAPL R735QTJ8XC9X\nAAPL 31BBZ87EKXLYE|AAPL R735QTJ8XC9X\nAAPL XPFJZWQOBF52|AAPL R735QTJ8XC9X\nAAPL XL7X5I1G8GH2|AAPL R735QTJ8XC9X\nAAPL 31CV49FISX2ZQ|AAPL R735QTJ8XC9X\nAAPL XVD806NRJO12|AAPL R735QTJ8XC9X\nAAPL XAVQ6IB4YVGM|AAPL R735QTJ8XC9X\nAAPL 31C3JQSBUETFQ|AAPL R735QTJ8XC9X\nAAPL XBNAP4JV3ZYE|AAPL R735QTJ8XC9X\nAAPL XBNAP5XH8ERQ|AAPL R735QTJ8XC9X\nAAPL 319ZQBX4ZT0HY|AAPL R735QTJ8XC9X\nAAPL 31UH85M4XX56U|AAPL R735QTJ8XC9X\nAAPL 319ZQBM7DYK4M|AAPL R735QTJ8XC9X\nAAPL XPFJZWTZE44M|AAPL R735QTJ8XC9X\nAAPL 31H2R3SYVOTC6|AAPL R735QTJ8XC9X\nAAPL XAVQ6JX0S0QU|AAPL R735QTJ8XC9X\nAAPL 31KBXAY79NNTY|AAPL R735QTJ8XC9X\nAAPL 31AKEPWICH29Y|AAPL R735QTJ8XC9X\nAAPL XPFJZWLPPDNQ|AAPL R735QTJ8XC9X\nAAPL XFH59V4P3BS6|AAPL R735QTJ8XC9X\nAAPL XVD8069VHP1I|AAPL R735QTJ8XC9X\nAAPL XBGEK4WQAL46|AAPL R735QTJ8XC9X\nAAPL XAVQ661KJCRQ|AAPL R735QTJ8XC9X\nAAPL XVD8065EQNPI|AAPL R735QTJ8XC9X\nAAPL 31C3JQTICGOYU|AAPL R735QTJ8XC9X\nAAPL XHYQYCV7Q3S6|AAPL R735QTJ8XC9X\nAAPL XB9IFGXNX6JQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5BSGZRPI|AAPL R735QTJ8XC9X\nAAPL XC7Z2RNNCJ1I|AAPL R735QTJ8XC9X\nAAPL 31C3JQTBQBAZQ|AAPL R735QTJ8XC9X\nAAPL 319ZQBYQVM5S6|AAPL R735QTJ8XC9X\nAAPL 31H2R3TKVH6QU|AAPL R735QTJ8XC9X\nAAPL 31R15TU0UIEPY|AAPL R735QTJ8XC9X\nAAPL XPFJZWP0S2NA|AAPL R735QTJ8XC9X\nAAPL 31CV49FW17UXY|AAPL R735QTJ8XC9X\nAAPL 31A6MGLUIRYYU|AAPL R735QTJ8XC9X\nAAPL XBGEK58B20KM|AAPL R735QTJ8XC9X\nAAPL 31ADIKWV7NNFQ|AAPL R735QTJ8XC9X\nAAPL XBNAP2PPM47A|AAPL R735QTJ8XC9X\nAAPL 31AY6Z6PMSONA|AAPL R735QTJ8XC9X\nAAPL XFH59UOBQC1Y|AAPL R735QTJ8XC9X\nAAPL 31AY6YWA7V1PI|AAPL R735QTJ8XC9X\nAAPL 31C3JQT8F8M06|AAPL R735QTJ8XC9X\nAAPL 319ZQBXD9HQYU|AAPL R735QTJ8XC9X\nAAPL XVD8069DMOW6|AAPL R735QTJ8XC9X\nAAPL XG8PSGXJQGP2|AAPL R735QTJ8XC9X\nAAPL 31KBXAXGT493A|AAPL R735QTJ8XC9X\nAAPL 31ADIKXNBSJTY|AAPL R735QTJ8XC9X\nAAPL 31ADIKWA7LABQ|AAPL R735QTJ8XC9X\nAAPL 31UH85MMYTHEU|AAPL R735QTJ8XC9X\nAAPL 31R15TUQBBT5Y|AAPL R735QTJ8XC9X\nAAPL 31AKEPL5USHGM|AAPL R735QTJ8XC9X\nAAPL 31KBXAXVOW8DI|AAPL R735QTJ8XC9X\nAAPL XHYQYD0C8C5I|AAPL R735QTJ8XC9X\nAAPL XG8PSI76WP5Y|AAPL R735QTJ8XC9X\nAAPL 31H2R3TJ7XU92|AAPL R735QTJ8XC9X\nAAPL 31KBXAXE5UWAU|AAPL R735QTJ8XC9X\nAAPL XC7Z2RKC9U1Y|AAPL R735QTJ8XC9X\nAAPL XCZJLD0YA25I|AAPL R735QTJ8XC9X\nAAPL 31UH85M5XN5HI|AAPL R735QTJ8XC9X\nAAPL 31KBXAXHSU9DY|AAPL R735QTJ8XC9X\nAAPL XRX5OE253LHI|AAPL R735QTJ8XC9X\nAAPL XAVQ658GQL8M|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q52O7WM|AAPL R735QTJ8XC9X\nAAPL 319ZQBL8HS2VA|AAPL R735QTJ8XC9X\nAAPL XBNAOSDLR692|AAPL R735QTJ8XC9X\nAAPL XFH59UPTBCHY|AAPL R735QTJ8XC9X\nAAPL XB9IFT78CP8M|AAPL R735QTJ8XC9X\nAAPL XB2MASTH1JLY|AAPL R735QTJ8XC9X\nAAPL XC7Z2QVJ7MNA|AAPL R735QTJ8XC9X\nAAPL XDR43ZTIVCKM|AAPL R735QTJ8XC9X\nAAPL 31ADIKW7KE2P2|AAPL R735QTJ8XC9X\nAAPL 31R15TUJP6F6U|AAPL R735QTJ8XC9X\nAAPL XL7X5HJFC492|AAPL R735QTJ8XC9X\nAAPL 31C3JQSEBPU6E|AAPL R735QTJ8XC9X\nAAPL XHYQYD1600EE|AAPL R735QTJ8XC9X\nAAPL 31R15TU265346|AAPL R735QTJ8XC9X\nAAPL 31A6MG8SOBCZQ|AAPL R735QTJ8XC9X\nAAPL XAVQ6GGZGZPI|AAPL R735QTJ8XC9X\nAAPL XL7X5HH3ZFK6|AAPL R735QTJ8XC9X\nAAPL 31ADIKWB1CYKM|AAPL R735QTJ8XC9X\nAAPL 31A6MGJJTWM9Y|AAPL R735QTJ8XC9X\nAAPL XVD8065KOZRA|AAPL R735QTJ8XC9X\nAAPL 31BBZ87G8GYG6|AAPL R735QTJ8XC9X\nAAPL XBU6TF11IBRA|AAPL R735QTJ8XC9X\nAAPL XDR43YM13GQU|AAPL R735QTJ8XC9X\nAAPL XPFJZWF3JZOM|AAPL R735QTJ8XC9X\nAAPL XRX5OEUF4ORQ|AAPL R735QTJ8XC9X\nAAPL XB9IFTFI1FPI|AAPL R735QTJ8XC9X\nAAPL XL7X5HUU32HY|AAPL R735QTJ8XC9X\nAAPL 31FCPXWSG9PYE|AAPL R735QTJ8XC9X\nAAPL 31BBZ86UQHG12|AAPL R735QTJ8XC9X\nAAPL XVD8063X7SFA|AAPL R735QTJ8XC9X\nAAPL 31FCPXXRICE3Q|AAPL R735QTJ8XC9X\nAAPL XVD807AX2IXY|AAPL R735QTJ8XC9X\nAAPL 31AKEPVTJEUVA|AAPL R735QTJ8XC9X\nAAPL XPFJZW56BWPY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7FKDUVA|AAPL R735QTJ8XC9X\nAAPL XG8PSGTEY8ME|AAPL R735QTJ8XC9X\nAAPL XCZJLCDMV0CM|AAPL R735QTJ8XC9X\nAAPL XC7Z2RAF1R3A|AAPL R735QTJ8XC9X\nAAPL XB9IFGCTT5HI|AAPL R735QTJ8XC9X\nAAPL 31ARAU7EQM6ME|AAPL R735QTJ8XC9X\nAAPL 31C3JQSDBZTVQ|AAPL R735QTJ8XC9X\nAAPL XB9IFGAUD4W6|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q6W5WG6|AAPL R735QTJ8XC9X\nAAPL XBU6TF2J3C7A|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q3F4VEU|AAPL R735QTJ8XC9X\nAAPL XB9IFH98OM06|AAPL R735QTJ8XC9X\nAAPL XRX5OENSZASM|AAPL R735QTJ8XC9X\nAAPL XBU6TGMLCNS6|AAPL R735QTJ8XC9X\nAAPL 31FCPXWUXILJA|AAPL R735QTJ8XC9X\nAAPL 31R15TU45L3PI|AAPL R735QTJ8XC9X\nAAPL XBNAOT2ETDNQ|AAPL R735QTJ8XC9X\nAAPL XVD8063R9GDI|AAPL R735QTJ8XC9X\nAAPL 31ARAUI8DIGNA|AAPL R735QTJ8XC9X\nAAPL XRX5OE3MOLXI|AAPL R735QTJ8XC9X\nAAPL 31AKEPUWGNWZQ|AAPL R735QTJ8XC9X\nAAPL XFH59UKOT44M|AAPL R735QTJ8XC9X\nAAPL XG8PSGWK0GEE|AAPL R735QTJ8XC9X\nAAPL 319ZQBM2FCINA|AAPL R735QTJ8XC9X\nAAPL XL7X5HFAHR0M|AAPL R735QTJ8XC9X\nAAPL XBNAOSU54N6U|AAPL R735QTJ8XC9X\nAAPL XHYQYCXUXBEU|AAPL R735QTJ8XC9X\nAAPL XAVQ657B28W6|AAPL R735QTJ8XC9X\nAAPL XG8PSGWE24CM|AAPL R735QTJ8XC9X\nAAPL 31OJK5BRH9REU|AAPL R735QTJ8XC9X\nAAPL XAVQ657YVL3A|AAPL R735QTJ8XC9X\nAAPL XBNAP4BLF9HI|AAPL R735QTJ8XC9X\nAAPL 31KBXAYKHYFS6|AAPL R735QTJ8XC9X\nAAPL XB9IFGCBY5C6|AAPL R735QTJ8XC9X\nAAPL XC7Z2QYUABMU|AAPL R735QTJ8XC9X\nAAPL XL7X5HL8TSSM|AAPL R735QTJ8XC9X\nAAPL 31AY6YUZQX4ZQ|AAPL R735QTJ8XC9X\nAAPL XB9IFGA0LGNA|AAPL R735QTJ8XC9X\nAAPL 31OJK5BUYASG6|AAPL R735QTJ8XC9X\nAAPL XL7X5HJ9DS7A|AAPL R735QTJ8XC9X\nAAPL XDR43ZBBYJ52|AAPL R735QTJ8XC9X\nAAPL 31A6MGABEY06E|AAPL R735QTJ8XC9X\nAAPL 31ADIKWA1MY9Y|AAPL R735QTJ8XC9X\nAAPL 31ARAUJU9BLXI|AAPL R735QTJ8XC9X\nAAPL XPFJZVPYPEHY|AAPL R735QTJ8XC9X\nAAPL 31H2R3TWG8M7A|AAPL R735QTJ8XC9X\nAAPL 31ADIKW7EFQNA|AAPL R735QTJ8XC9X\nAAPL 31ADIKWBD9MO6|AAPL R735QTJ8XC9X\nAAPL XB9IFGAIGGSM|AAPL R735QTJ8XC9X\nAAPL XB9IFG9CS4G6|AAPL R735QTJ8XC9X\nAAPL 31C3JQT05JVJA|AAPL R735QTJ8XC9X\nAAPL 31UH85M831I4M|AAPL R735QTJ8XC9X\nAAPL XCZJLDWDHNJA|AAPL R735QTJ8XC9X\nAAPL XB2MATQPOODI|AAPL R735QTJ8XC9X\nAAPL XHYQYD2HMOSM|AAPL R735QTJ8XC9X\nAAPL 31R15TU4TEFWM|AAPL R735QTJ8XC9X\nAAPL 31KBXAXH50X6U|AAPL R735QTJ8XC9X\nAAPL XPFJZVTXJAIU|AAPL R735QTJ8XC9X\nAAPL 31UH85M88ZU6E|AAPL R735QTJ8XC9X\nAAPL 31EL5FAND1TDY|AAPL R735QTJ8XC9X\nAAPL XFH59ULUFBBA|AAPL R735QTJ8XC9X\nAAPL XHYQYDGPLBVQ|AAPL R735QTJ8XC9X\nAAPL XHYQYCUPV3MU|AAPL R735QTJ8XC9X\nAAPL XBNAOSVSNZOM|AAPL R735QTJ8XC9X\nAAPL XB2MB3KMMSW6|AAPL R735QTJ8XC9X\nAAPL 31BBZ864LUPDY|AAPL R735QTJ8XC9X\nAAPL XDR43YO6HTDY|AAPL R735QTJ8XC9X\nAAPL XB9IFGDZHHTY|AAPL R735QTJ8XC9X\nAAPL 31H2R3SXE3SW6|AAPL R735QTJ8XC9X\nAAPL XB2MB5VBI5L2|AAPL R735QTJ8XC9X\nAAPL 31R15TU2I1R7Q|AAPL R735QTJ8XC9X\nAAPL 31R15TTZIXVHI|AAPL R735QTJ8XC9X\nAAPL XHYQYCYIQNLY|AAPL R735QTJ8XC9X\nAAPL 31ARAUJDPY4ZQ|AAPL R735QTJ8XC9X\nAAPL 31C3JQTOYM2XY|AAPL R735QTJ8XC9X\nAAPL XB2MATXBU2CM|AAPL R735QTJ8XC9X\nAAPL 31AKEPL7IBTYE|AAPL R735QTJ8XC9X\nAAPL 31CV49FSQ55YE|AAPL R735QTJ8XC9X\nAAPL XRX5OE0BO23Q|AAPL R735QTJ8XC9X\nAAPL 31CV49ELW6MBQ|AAPL R735QTJ8XC9X\nAAPL XFH59UMI8NIE|AAPL R735QTJ8XC9X\nAAPL 31BBZ865FMDMU|AAPL R735QTJ8XC9X\nAAPL XL7X5HFSCR5Y|AAPL R735QTJ8XC9X\nAAPL 31R15TU3TOFLY|AAPL R735QTJ8XC9X\nAAPL XG8PSGXDS4NA|AAPL R735QTJ8XC9X\nAAPL XB2MAU8WLHT2|AAPL R735QTJ8XC9X\nAAPL XB2MAUC7O6SM|AAPL R735QTJ8XC9X\nAAPL XBNAORICK22U|AAPL R735QTJ8XC9X\nAAPL XB9IFHWE7GX2|AAPL R735QTJ8XC9X\nAAPL 31CV49EJEVLL2|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q1LPC12|AAPL R735QTJ8XC9X\nAAPL 31AKEPKUA1206|AAPL R735QTJ8XC9X\nAAPL 319ZQBVJ3ZV7Q|AAPL R735QTJ8XC9X\nAAPL XB9IFGB0BGXY|AAPL R735QTJ8XC9X\nAAPL XDR43Z9OF6NA|AAPL R735QTJ8XC9X\nAAPL XBU6TT9E2YFA|AAPL R735QTJ8XC9X\nAAPL XBU6TRF8L2O6|AAPL R735QTJ8XC9X\nAAPL 31BBZ86ZP3HIE|AAPL R735QTJ8XC9X\nAAPL XCZJLCDAYC92|AAPL R735QTJ8XC9X\nAAPL 31BBZ86J5Q0KM|AAPL R735QTJ8XC9X\nAAPL 31FCPXXWGYFL2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BTARFYE|AAPL R735QTJ8XC9X\nAAPL XBNAOT0RA15Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5BQNI35Y|AAPL R735QTJ8XC9X\nAAPL 319ZQBWG6QT3A|AAPL R735QTJ8XC9X\nAAPL 31ADIKWMXYWYU|AAPL R735QTJ8XC9X\nAAPL XBU6TF01SBGM|AAPL R735QTJ8XC9X\nAAPL 31AY6YUZKYSXY|AAPL R735QTJ8XC9X\nAAPL XCZJLD5WW3MU|AAPL R735QTJ8XC9X\nAAPL XB9IFGBU356U|AAPL R735QTJ8XC9X\nAAPL XHYQYD1HWOHY|AAPL R735QTJ8XC9X\nAAPL 31CV49EK8N9TY|AAPL R735QTJ8XC9X\nAAPL 31OJK5BP5Z7VQ|AAPL R735QTJ8XC9X\nAAPL XL7X5HKL0GLI|AAPL R735QTJ8XC9X\nAAPL XG8PSI0KRB6U|AAPL R735QTJ8XC9X\nAAPL XL7X5HLES4UE|AAPL R735QTJ8XC9X\nAAPL 31OJK5C7OOF3A|AAPL R735QTJ8XC9X\nAAPL XBGEKEX9E3LY|AAPL R735QTJ8XC9X\nAAPL 31BBZ862MEOSM|AAPL R735QTJ8XC9X\nAAPL XAVQ6FJWQ1TY|AAPL R735QTJ8XC9X\nAAPL 31BBZ8624JONA|AAPL R735QTJ8XC9X\nAAPL XVD806B161DY|AAPL R735QTJ8XC9X\nAAPL XAVQ658YLLDY|AAPL R735QTJ8XC9X\nAAPL 31AKEPY48A7K6|AAPL R735QTJ8XC9X\nAAPL XHYQYDA3FXWM|AAPL R735QTJ8XC9X\nAAPL 31ARAU7FEFITI|AAPL R735QTJ8XC9X\nAAPL 31UH85M7F85XI|AAPL R735QTJ8XC9X\nAAPL XFH59VJKXG86|AAPL R735QTJ8XC9X\nAAPL 31BBZ8663FPTY|AAPL R735QTJ8XC9X\nAAPL 31AY6YV0EQH6U|AAPL R735QTJ8XC9X\nAAPL XB9IFGB69SZQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXETO8HY|AAPL R735QTJ8XC9X\nAAPL XDR43ZWTY1K6|AAPL R735QTJ8XC9X\nAAPL 31UH85M98PUH2|AAPL R735QTJ8XC9X\nAAPL XBGEK3W6KRD2|AAPL R735QTJ8XC9X\nAAPL 31ADIKX3HCDWM|AAPL R735QTJ8XC9X\nAAPL XL7X5I82DUG6|AAPL R735QTJ8XC9X\nAAPL XDR43YPC65QE|AAPL R735QTJ8XC9X\nAAPL 31A6MGA1HPX7Q|AAPL R735QTJ8XC9X\nAAPL XBNAORHUP1XI|AAPL R735QTJ8XC9X\nAAPL XVD806W18EHY|AAPL R735QTJ8XC9X\nAAPL 31AKEPJV7W8P2|AAPL R735QTJ8XC9X\nAAPL XHYQYDBQZAEE|AAPL R735QTJ8XC9X\nAAPL 319ZQBMFNNALI|AAPL R735QTJ8XC9X\nAAPL 31EL5FAN155AE|AAPL R735QTJ8XC9X\nAAPL XBNAORFV91C6|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q7248HY|AAPL R735QTJ8XC9X\nAAPL 31FCPXXO79P46|AAPL R735QTJ8XC9X\nAAPL XBNAP368ZL52|AAPL R735QTJ8XC9X\nAAPL 31ADIKWLAFKH2|AAPL R735QTJ8XC9X\nAAPL 31CV49EHXCQAU|AAPL R735QTJ8XC9X\nAAPL XL7X5HGA7RBA|AAPL R735QTJ8XC9X\nAAPL 31FCPXY1FKH2E|AAPL R735QTJ8XC9X\nAAPL 319ZQBMIYPZL2|AAPL R735QTJ8XC9X\nAAPL 31FCPXWXQQADI|AAPL R735QTJ8XC9X\nAAPL XDR43YQBW612|AAPL R735QTJ8XC9X\nAAPL XDR43YKVF4EE|AAPL R735QTJ8XC9X\nAAPL 31H2R3TT55X7Q|AAPL R735QTJ8XC9X\nAAPL XB2MAUAK4UAU|AAPL R735QTJ8XC9X\nAAPL 31KBXAXFHHKP2|AAPL R735QTJ8XC9X\nAAPL 31UH85M5ROTFQ|AAPL R735QTJ8XC9X\nAAPL 31C3JQSCU4TQE|AAPL R735QTJ8XC9X\nAAPL 31OJK5BSYURUU|AAPL R735QTJ8XC9X\nAAPL XPFJZVS9ZY12|AAPL R735QTJ8XC9X\nAAPL XBNAP5P7JOAU|AAPL R735QTJ8XC9X\nAAPL XCZJLDMG9KKM|AAPL R735QTJ8XC9X\nAAPL 31C3JQSBII5C6|AAPL R735QTJ8XC9X\nAAPL 31EL5FAXA7R6U|AAPL R735QTJ8XC9X\nAAPL XBGEK3VUO39I|AAPL R735QTJ8XC9X\nAAPL 31AKEPJVPR8UE|AAPL R735QTJ8XC9X\nAAPL 31FCPXWW36XVQ|AAPL R735QTJ8XC9X\nAAPL XBGEK501DA3Q|AAPL R735QTJ8XC9X\nAAPL XRX5OE3SMXZA|AAPL R735QTJ8XC9X\nAAPL 31OJK5BRT6FIE|AAPL R735QTJ8XC9X\nAAPL 31ADIKW8Q09VQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2R0HTO4M|AAPL R735QTJ8XC9X\nAAPL XB2MB7H7BAVA|AAPL R735QTJ8XC9X\nAAPL XAVQ6J87PTC6|AAPL R735QTJ8XC9X\nAAPL XPFJZW8HELPI|AAPL R735QTJ8XC9X\nAAPL 319ZQBM5QF7MU|AAPL R735QTJ8XC9X\nAAPL 31KBXAXHGXLAE|AAPL R735QTJ8XC9X\nAAPL XG8PSHX9OM7A|AAPL R735QTJ8XC9X\nAAPL 31CV49EJKTXMU|AAPL R735QTJ8XC9X\nAAPL XVD80672A07A|AAPL R735QTJ8XC9X\nAAPL XCZJLC9ZXSFA|AAPL R735QTJ8XC9X\nAAPL XCZJLCFS9CZQ|AAPL R735QTJ8XC9X\nAAPL 31AY6YVYN3M92|AAPL R735QTJ8XC9X\nAAPL 31C3JQTQM5FFQ|AAPL R735QTJ8XC9X\nAAPL XFH59URSRD3A|AAPL R735QTJ8XC9X\nAAPL 31FCPXXFXKYNA|AAPL R735QTJ8XC9X\nAAPL 31C3JQSD035S6|AAPL R735QTJ8XC9X\nAAPL XDR43YOUB5L2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BP00VTY|AAPL R735QTJ8XC9X\nAAPL 31A6MG9KYCG9Y|AAPL R735QTJ8XC9X\nAAPL 31H2R3TAY93S6|AAPL R735QTJ8XC9X\nAAPL 31EL5FAM7DH1I|AAPL R735QTJ8XC9X\nAAPL 31C3JQSCO6HOM|AAPL R735QTJ8XC9X\nAAPL 31CV49FH5DQHY|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q4EUVPI|AAPL R735QTJ8XC9X\nAAPL XHYQYCZOEZYE|AAPL R735QTJ8XC9X\nAAPL XBNAORGJ2DJA|AAPL R735QTJ8XC9X\nAAPL 31UH85M7X362U|AAPL R735QTJ8XC9X\nAAPL 31KBXAXEZMKJQ|AAPL R735QTJ8XC9X\nAAPL XL7X5IHZLXEU|AAPL R735QTJ8XC9X\nAAPL 31AKEPWA2SBT2|AAPL R735QTJ8XC9X\nAAPL 31ADIKXF23TD2|AAPL R735QTJ8XC9X\nAAPL XHYQYCV1RRQE|AAPL R735QTJ8XC9X\nAAPL 31AKEPKXL3QZQ|AAPL R735QTJ8XC9X\nAAPL 31UH85M2SKXPI|AAPL R735QTJ8XC9X\nAAPL 31BBZ874NPIZQ|AAPL R735QTJ8XC9X\nAAPL XL7X5HJ3FG5I|AAPL R735QTJ8XC9X\nAAPL 31BBZ8659O1L2|AAPL R735QTJ8XC9X\nAAPL XFH59VHXE3QE|AAPL R735QTJ8XC9X\nAAPL XAVQ66OQ27OM|AAPL R735QTJ8XC9X\nAAPL 31C3JQSC0D5HI|AAPL R735QTJ8XC9X\nAAPL 31ADIKW8859QE|AAPL R735QTJ8XC9X\nAAPL 31OJK5BSMY3RA|AAPL R735QTJ8XC9X\nAAPL 31AY6YUZWVH1I|AAPL R735QTJ8XC9X\nAAPL 31AKEPJRQXCTI|AAPL R735QTJ8XC9X\nAAPL XBGEK3SJNJFQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZ7LHFQ|AAPL R735QTJ8XC9X\nAAPL XAVQ6I2VA4ZQ|AAPL R735QTJ8XC9X\nAAPL XDR43YO0JHC6|AAPL R735QTJ8XC9X\nAAPL XBNAP3EIOBLY|AAPL R735QTJ8XC9X\nAAPL XB9IFSYYNYRQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5C4DLQ3Q|AAPL R735QTJ8XC9X\nAAPL 31CV49FC6RP0M|AAPL R735QTJ8XC9X\nAAPL 31EL5FAMV6T8M|AAPL R735QTJ8XC9X\nAAPL XVD8067W1OG6|AAPL R735QTJ8XC9X\nAAPL XC7Z2R25D0ME|AAPL R735QTJ8XC9X\nAAPL XVD8063LB4BQ|AAPL R735QTJ8XC9X\nAAPL XHYQYDOZA2CM|AAPL R735QTJ8XC9X\nAAPL XG8PSGVW747A|AAPL R735QTJ8XC9X\nAAPL XDR43ZOK9B3A|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q1FQZZA|AAPL R735QTJ8XC9X\nAAPL 31KBXAXDC5D7Q|AAPL R735QTJ8XC9X\nAAPL 31A6MGA4SSM7A|AAPL R735QTJ8XC9X\nAAPL XVD806A7ED52|AAPL R735QTJ8XC9X\nAAPL XBGEK3Y60RYE|AAPL R735QTJ8XC9X\nAAPL 31ARAUJ5G9EIU|AAPL R735QTJ8XC9X\nAAPL 31R15TU3BTFGM|AAPL R735QTJ8XC9X\nAAPL 31A6MGMJBU6DI|AAPL R735QTJ8XC9X\nAAPL XB2MATLR2MW6|AAPL R735QTJ8XC9X\nAAPL XVD806R2MD0M|AAPL R735QTJ8XC9X\nAAPL XBU6TGKXTBAE|AAPL R735QTJ8XC9X\nAAPL XC7Z2RFDNSKM|AAPL R735QTJ8XC9X\nAAPL XAVQ6584TX52|AAPL R735QTJ8XC9X\nAAPL XBGEKGAVIIFA|AAPL R735QTJ8XC9X\nAAPL 31UH85M69JTL2|AAPL R735QTJ8XC9X\nAAPL XHYQYDX8YSTI|AAPL R735QTJ8XC9X\nAAPL 31UH85MOMCTWM|AAPL R735QTJ8XC9X\nAAPL XBGEK4TF7W4M|AAPL R735QTJ8XC9X\nAAPL XCZJLCA5W4H2|AAPL R735QTJ8XC9X\nAAPL XBNAP58O67D2|AAPL R735QTJ8XC9X\nAAPL 31OJK5CRJ4L0M|AAPL R735QTJ8XC9X\nAAPL XBGEK3XC93PI|AAPL R735QTJ8XC9X\nAAPL 319ZQBMCCKLLY|AAPL R735QTJ8XC9X\nAAPL XCZJLD7KFG4M|AAPL R735QTJ8XC9X\nAAPL XB2MASSHBJBA|AAPL R735QTJ8XC9X\nAAPL 31EL5FBH4NX46|AAPL R735QTJ8XC9X\nAAPL XDR43YMUV4ZQ|AAPL R735QTJ8XC9X\nAAPL XB2MATVOAPUU|AAPL R735QTJ8XC9X\nAAPL 31H2R3SXVYT1I|AAPL R735QTJ8XC9X\nAAPL XCZJLCZAQPNQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5BSSWFT2|AAPL R735QTJ8XC9X\nAAPL 319ZQBWWQ4A12|AAPL R735QTJ8XC9X\nAAPL 31AKEPXNOWQME|AAPL R735QTJ8XC9X\nAAPL 31EL5FAVMOEP2|AAPL R735QTJ8XC9X\nAAPL XL7X5HWHMEZQ|AAPL R735QTJ8XC9X\nAAPL 31ARAUHRU4ZPI|AAPL R735QTJ8XC9X\nAAPL 31KBXAYFJCEAU|AAPL R735QTJ8XC9X\nAAPL 31R15TU5Z2S92|AAPL R735QTJ8XC9X\nAAPL XCZJLE1C3P0M|AAPL R735QTJ8XC9X\nAAPL 31R15TU6514AU|AAPL R735QTJ8XC9X\nAAPL 31EL5FANJ05FQ|AAPL R735QTJ8XC9X\nAAPL XB9IFTNRQ66E|AAPL R735QTJ8XC9X\nAAPL XL7X5HKWX4P2|AAPL R735QTJ8XC9X\nAAPL 31AKEPKSMHPIE|AAPL R735QTJ8XC9X\nAAPL XDR43YPU15VQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAYIUF3AE|AAPL R735QTJ8XC9X\nAAPL 31A6MG8ROLCP2|AAPL R735QTJ8XC9X\nAAPL XPFJZW3ISK86|AAPL R735QTJ8XC9X\nAAPL XL7X5IJN59WM|AAPL R735QTJ8XC9X\nAAPL 31ADILA3IDGHY|AAPL R735QTJ8XC9X\nAAPL 31C3JQSTJEHK6|AAPL R735QTJ8XC9X\nAAPL 31H2R3STX4X0M|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q6EAWAU|AAPL R735QTJ8XC9X\nAAPL 31KBXAYH6VQSM|AAPL R735QTJ8XC9X\nAAPL XB9IFH4A2KIU|AAPL R735QTJ8XC9X\nAAPL 31C3JQSDHY5XI|AAPL R735QTJ8XC9X\nAAPL 31OJK5CKWZ71I|AAPL R735QTJ8XC9X\nAAPL XC7Z2RH1752E|AAPL R735QTJ8XC9X\nAAPL 31ADIL8Y5XS5I|AAPL R735QTJ8XC9X\nAAPL XHYQYCWJAN0M|AAPL R735QTJ8XC9X\nAAPL 31ARAU8ODSF3A|AAPL R735QTJ8XC9X\nAAPL 31UH85M7L6HZA|AAPL R735QTJ8XC9X\nAAPL 31ARAUJLZMVGM|AAPL R735QTJ8XC9X\nAAPL 31KBXAXD08P46|AAPL R735QTJ8XC9X\nAAPL 31C3JQSE5RI4M|AAPL R735QTJ8XC9X\nAAPL XDR43YLDA4JQ|AAPL R735QTJ8XC9X\nAAPL 31UH85MQ9W6EE|AAPL R735QTJ8XC9X\nAAPL XG8PSGXVN4SM|AAPL R735QTJ8XC9X\nAAPL 31H2R3SVWISG6|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q4KT7RA|AAPL R735QTJ8XC9X\nAAPL XRX5OE69XYPY|AAPL R735QTJ8XC9X\nAAPL 31H2R3TUSP9PI|AAPL R735QTJ8XC9X\nAAPL XC7Z2RPAVVJA|AAPL R735QTJ8XC9X\nAAPL 31ARAU8MQ92LI|AAPL R735QTJ8XC9X\nAAPL 31C3JQSBOGHDY|AAPL R735QTJ8XC9X\nAAPL XB2MB5N1TF46|AAPL R735QTJ8XC9X\nAAPL XB2MASSZ6JGM|AAPL R735QTJ8XC9X\nAAPL XL7X5I9PX6XY|AAPL R735QTJ8XC9X\nAAPL XBGEK3YBZ406|AAPL R735QTJ8XC9X\nAAPL XPFJZVRM6LTY|AAPL R735QTJ8XC9X\nAAPL 31KBXAXSDTJDY|AAPL R735QTJ8XC9X\nAAPL 31FCPXWULLXFQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q7VVWQU|AAPL R735QTJ8XC9X\nAAPL 31AKEPWYVUJ7Q|AAPL R735QTJ8XC9X\nAAPL XG8PSGTKWKO6|AAPL R735QTJ8XC9X\nAAPL 31ADIL8136U9Y|AAPL R735QTJ8XC9X\nAAPL XCZJLD97YSME|AAPL R735QTJ8XC9X\nAAPL 31FCPXYD0BWIU|AAPL R735QTJ8XC9X\nAAPL XBNAOSQU1Y7A|AAPL R735QTJ8XC9X\nAAPL 31BBZ86MGSPK6|AAPL R735QTJ8XC9X\nAAPL XVD8067E6OAU|AAPL R735QTJ8XC9X\nAAPL XPFJZVSXTA86|AAPL R735QTJ8XC9X\nAAPL XBU6TEX2OFQE|AAPL R735QTJ8XC9X\nAAPL XRX5OE4MEM86|AAPL R735QTJ8XC9X\nAAPL XHYQYCYCSBK6|AAPL R735QTJ8XC9X\nAAPL XL7X5HHRSRRA|AAPL R735QTJ8XC9X\nAAPL 31KBXAXJMBXXI|AAPL R735QTJ8XC9X\nAAPL XG8PSGYPET1I|AAPL R735QTJ8XC9X\nAAPL XBGEK5I8A3JA|AAPL R735QTJ8XC9X\nAAPL XG8PSGVEC41Y|AAPL R735QTJ8XC9X\nAAPL XB2MAUDV7JAE|AAPL R735QTJ8XC9X\nAAPL XBU6TRVRYJLY|AAPL R735QTJ8XC9X\nAAPL XBNAP4S4SQFA|AAPL R735QTJ8XC9X\nAAPL XL7X5HH9XRLY|AAPL R735QTJ8XC9X\nAAPL 31AKEPJUK2WHY|AAPL R735QTJ8XC9X\nAAPL 31BBZ862SD0UE|AAPL R735QTJ8XC9X\nAAPL XPFJZWIEMOO6|AAPL R735QTJ8XC9X\nAAPL XFH59UO5S006|AAPL R735QTJ8XC9X\nAAPL XPFJZVTFOADI|AAPL R735QTJ8XC9X\nAAPL XDR43YL1DGG6|AAPL R735QTJ8XC9X\nAAPL 31AKEPKZ8N3HI|AAPL R735QTJ8XC9X\nAAPL 31ADIKX8FYFDY|AAPL R735QTJ8XC9X\nAAPL XRX5OE3ARXTY|AAPL R735QTJ8XC9X\nAAPL 31EL5FAKPSGLI|AAPL R735QTJ8XC9X\nAAPL XRX5OE2SWXOM|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q5QHK3Q|AAPL R735QTJ8XC9X\nAAPL XBGEKFDSRKJQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXIGNLL2|AAPL R735QTJ8XC9X\nAAPL XVD8066WBO5I|AAPL R735QTJ8XC9X\nAAPL 31KBXAXFTE8SM|AAPL R735QTJ8XC9X\nAAPL XB9IFG875X9I|AAPL R735QTJ8XC9X\nAAPL XRX5OE0HME5I|AAPL R735QTJ8XC9X\nAAPL 31ARAU89HYANA|AAPL R735QTJ8XC9X\nAAPL XFH59UMCABGM|AAPL R735QTJ8XC9X\nAAPL 31ARAUIGN7746|AAPL R735QTJ8XC9X\nAAPL XCZJLDKSQ82U|AAPL R735QTJ8XC9X\nAAPL XPFJZVRG89S6|AAPL R735QTJ8XC9X\nAAPL 31EL5FB8UZ6NA|AAPL R735QTJ8XC9X\nAAPL XVD806B74DFQ|AAPL R735QTJ8XC9X\nAAPL XPFJZVV95YX2|AAPL R735QTJ8XC9X\nAAPL XG8PSGZ1BH52|AAPL R735QTJ8XC9X\nAAPL XL7X5HDYX7S6|AAPL R735QTJ8XC9X\nAAPL 31H2R3TPU3886|AAPL R735QTJ8XC9X\nAAPL XRX5OE2MYLMU|AAPL R735QTJ8XC9X\nAAPL 31H2R3T01D5OM|AAPL R735QTJ8XC9X\nAAPL 31ADIKWJMW7ZA|AAPL R735QTJ8XC9X\nAAPL XFH59ULIIN7Q|AAPL R735QTJ8XC9X\nAAPL 31ARAULG54R7Q|AAPL R735QTJ8XC9X\nAAPL 31UH85MRXFIW6|AAPL R735QTJ8XC9X\nAAPL XDR43YMOWSXY|AAPL R735QTJ8XC9X\nAAPL XVD806AP9DAE|AAPL R735QTJ8XC9X\nAAPL 31CV49EN7TAPY|AAPL R735QTJ8XC9X\nAAPL 31C3JQS9D5XUU|AAPL R735QTJ8XC9X\nAAPL XFH59UNZTNYE|AAPL R735QTJ8XC9X\nAAPL 31R15TU4NG3UU|AAPL R735QTJ8XC9X\nAAPL 31AKEPJUVZKLI|AAPL R735QTJ8XC9X\nAAPL 31FCPXY333TK6|AAPL R735QTJ8XC9X\nAAPL 31FCPXWV3GXL2|AAPL R735QTJ8XC9X\nAAPL XAVQ6GP95Q6E|AAPL R735QTJ8XC9X\nAAPL 31EL5FAMDBT3A|AAPL R735QTJ8XC9X\nAAPL XDR43YIW18YU|AAPL R735QTJ8XC9X\nAAPL 31ADIL9EPB93A|AAPL R735QTJ8XC9X\nAAPL XCZJLDO3SX2E|AAPL R735QTJ8XC9X\nAAPL XB9IFGPE8G2U|AAPL R735QTJ8XC9X\nAAPL XDR43ZV6EP2E|AAPL R735QTJ8XC9X\nAAPL XB2MATU0RDD2|AAPL R735QTJ8XC9X\nAAPL XRX5OE549MDI|AAPL R735QTJ8XC9X\nAAPL 31CV49FNRJ4H2|AAPL R735QTJ8XC9X\nAAPL XPFJZVV37MVA|AAPL R735QTJ8XC9X\nAAPL 31ARAU7FQC6X2|AAPL R735QTJ8XC9X\nAAPL XHYQYDK0O0VA|AAPL R735QTJ8XC9X\nAAPL 31A6MG8RIN0NA|AAPL R735QTJ8XC9X\nAAPL 31ADIKW826XOM|AAPL R735QTJ8XC9X\nAAPL 31OJK5BV494HY|AAPL R735QTJ8XC9X\nAAPL XB9IFGBI6H3A|AAPL R735QTJ8XC9X\nAAPL 31AKEPKNNVO12|AAPL R735QTJ8XC9X\nAAPL 31UH85M6LGHOM|AAPL R735QTJ8XC9X\nAAPL XCZJLDREVM1Y|AAPL R735QTJ8XC9X\nAAPL 31BBZ862AI0P2|AAPL R735QTJ8XC9X\nAAPL XHYQYD0I6O7A|AAPL R735QTJ8XC9X\nAAPL XL7X5HZSP3ZA|AAPL R735QTJ8XC9X\nAAPL 31CV49FR2LTGM|AAPL R735QTJ8XC9X\nAAPL XHYQYDTXW3TY|AAPL R735QTJ8XC9X\nAAPL 31R15TU5B9G1Y|AAPL R735QTJ8XC9X\nAAPL 319ZQBVRDOLOM|AAPL R735QTJ8XC9X\nAAPL XHYQYCWP8Z2E|AAPL R735QTJ8XC9X\nAAPL 31ARAU7GW0J9I|AAPL R735QTJ8XC9X\nAAPL XG8PSHVM59PI|AAPL R735QTJ8XC9X\nAAPL 31OJK5CJ9FUJQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXWVX8LTY|AAPL R735QTJ8XC9X\nAAPL XDR43ZCZHVMU|AAPL R735QTJ8XC9X\nAAPL XB2MB6BUVMIU|AAPL R735QTJ8XC9X\nAAPL XCZJLCFAECUE|AAPL R735QTJ8XC9X\nAAPL XPFJZWSBURMU|AAPL R735QTJ8XC9X\nAAPL XG8PSI3VU06E|AAPL R735QTJ8XC9X\nAAPL 31ADIKXLO97C6|AAPL R735QTJ8XC9X\nAAPL 31C3JQTA2RYHY|AAPL R735QTJ8XC9X\nAAPL XBU6TGHMQMAU|AAPL R735QTJ8XC9X\nAAPL 319ZQBY22JYDI|AAPL R735QTJ8XC9X\nAAPL XB2MASRHLJ0M|AAPL R735QTJ8XC9X\nAAPL XAVQ6HE27XL2|AAPL R735QTJ8XC9X\nAAPL 31A6MGK0DA37Q|AAPL R735QTJ8XC9X\nAAPL XVD806XORQZQ|AAPL R735QTJ8XC9X\nAAPL 319ZQBL6U8QDI|AAPL R735QTJ8XC9X\nAAPL 31C3JQSENMI9Y|AAPL R735QTJ8XC9X\nAAPL XDR43YK7LS7A|AAPL R735QTJ8XC9X\nAAPL XC7Z2R5GFPLY|AAPL R735QTJ8XC9X\nAAPL XC7Z2RDQ4G2U|AAPL R735QTJ8XC9X\nAAPL XBNAORGUZ1MU|AAPL R735QTJ8XC9X\nAAPL XAVQ66382P9I|AAPL R735QTJ8XC9X\nAAPL 31UH85N3I6YCM|AAPL R735QTJ8XC9X\nAAPL XHYQYCZ0LNRA|AAPL R735QTJ8XC9X\nAAPL 31R15TU5T4G7A|AAPL R735QTJ8XC9X\nAAPL XFH59UKCWG12|AAPL R735QTJ8XC9X\nAAPL XAVQ66GGDH7Q|AAPL R735QTJ8XC9X\nAAPL XBGEK5EX7EJQ|AAPL R735QTJ8XC9X\nAAPL XB2MASS5EV7Q|AAPL R735QTJ8XC9X\nAAPL 31CV49EKKJXXI|AAPL R735QTJ8XC9X\nAAPL 31EL5FAYXR3OM|AAPL R735QTJ8XC9X\nAAPL XAVQ657H0KXY|AAPL R735QTJ8XC9X\nAAPL 31CV49FM3ZRZA|AAPL R735QTJ8XC9X\nAAPL XL7X5ILAOMEE|AAPL R735QTJ8XC9X\nAAPL 31UH85M2MMLNQ|AAPL R735QTJ8XC9X\nAAPL 31A6MG8RUJOQU|AAPL R735QTJ8XC9X\nAAPL XFH59UQYZOUE|AAPL R735QTJ8XC9X\nAAPL 31FCPXY81PV1I|AAPL R735QTJ8XC9X\nAAPL 31UH85M34HLT2|AAPL R735QTJ8XC9X\nAAPL 31FCPXY9P97JA|AAPL R735QTJ8XC9X\nAAPL XBGEK3WCJ3EU|AAPL R735QTJ8XC9X\nAAPL 31CV49EI3B2CM|AAPL R735QTJ8XC9X\nAAPL XB9IFGDNKTQE|AAPL R735QTJ8XC9X\nAAPL XBNAOSP6ILPI|AAPL R735QTJ8XC9X\nAAPL XBU6TF0VJZPI|AAPL R735QTJ8XC9X\nAAPL 31ARAU8Q1BRL2|AAPL R735QTJ8XC9X\nAAPL 31ADIKW9VOM86|AAPL R735QTJ8XC9X\nAAPL XB9IFGDBO5MU|AAPL R735QTJ8XC9X\nAAPL XVD8070ZUFZA|AAPL R735QTJ8XC9X\nAAPL XBU6TF0PLNNQ|AAPL R735QTJ8XC9X\nAAPL XFH59VCYS292|AAPL R735QTJ8XC9X\nAAPL XB9IFGA6JSP2|AAPL R735QTJ8XC9X\nAAPL XPFJZVVL2N0M|AAPL R735QTJ8XC9X\nAAPL XHYQYCYUNBPI|AAPL R735QTJ8XC9X\nAAPL XAVQ66LEZIP2|AAPL R735QTJ8XC9X\nAAPL XRX5OE6LUMTI|AAPL R735QTJ8XC9X\nAAPL XBNAP2XZAUO6|AAPL R735QTJ8XC9X\nAAPL XHYQYDF21ZDY|AAPL R735QTJ8XC9X\nAAPL 31ADIKXID6ICM|AAPL R735QTJ8XC9X\nAAPL 31FCPXWX2WY6E|AAPL R735QTJ8XC9X\nAAPL XBU6TQYP7LQE|AAPL R735QTJ8XC9X\nAAPL 319ZQBYAC8OUE|AAPL R735QTJ8XC9X\nAAPL XB9IFSA5LRD2|AAPL R735QTJ8XC9X\nAAPL 31BBZ877YS7ZA|AAPL R735QTJ8XC9X\nAAPL XHYQYCZIGNWM|AAPL R735QTJ8XC9X\nAAPL 319ZQBMHB6N3A|AAPL R735QTJ8XC9X\nAAPL 31A6MGM2SGPFQ|AAPL R735QTJ8XC9X\nAAPL XL7X5I4RB5GM|AAPL R735QTJ8XC9X\nAAPL XCZJLDZOKCIU|AAPL R735QTJ8XC9X\nAAPL XBNAP5GXUXTY|AAPL R735QTJ8XC9X\nAAPL XDR43YJ1ZL0M|AAPL R735QTJ8XC9X\nAAPL XHYQYDLO7DD2|AAPL R735QTJ8XC9X\nAAPL XCZJLCEAOCJQ|AAPL R735QTJ8XC9X\nAAPL 31ADILABS26YU|AAPL R735QTJ8XC9X\nAAPL XB2MB78XMKEE|AAPL R735QTJ8XC9X\nAAPL XRX5OEW2O19I|AAPL R735QTJ8XC9X\nAAPL 31KBXAY2B1MCM|AAPL R735QTJ8XC9X\nAAPL 31UH85MLBA4X2|AAPL R735QTJ8XC9X\nAAPL XBNAOSGWTV8M|AAPL R735QTJ8XC9X\nAAPL 31R15TU1OA2YU|AAPL R735QTJ8XC9X\nAAPL 31EL5FBAIIJ52|AAPL R735QTJ8XC9X\nAAPL XPFJZVULCMPY|AAPL R735QTJ8XC9X\nAAPL XB2MB49FP0AU|AAPL R735QTJ8XC9X\nAAPL XDR440050QJQ|AAPL R735QTJ8XC9X\nAAPL XCZJLCFMB0XY|AAPL R735QTJ8XC9X\nAAPL 31AY6YUZF0GW6|AAPL R735QTJ8XC9X\nAAPL 31FCPXWSABDWM|AAPL R735QTJ8XC9X\nAAPL 31H2R3SVKM4CM|AAPL R735QTJ8XC9X\nAAPL XDR43ZEN184M|AAPL R735QTJ8XC9X\nAAPL 31EL5FAL1P4P2|AAPL R735QTJ8XC9X\nAAPL 31UH85MWW1KDI|AAPL R735QTJ8XC9X\nAAPL XC7Z2R73Z23Q|AAPL R735QTJ8XC9X\nAAPL 31KBXAY5M4BC6|AAPL R735QTJ8XC9X\nAAPL XBGEK4RROJMU|AAPL R735QTJ8XC9X\nAAPL 31ADIKW9DTM2U|AAPL R735QTJ8XC9X\nAAPL XVD8069JL0XY|AAPL R735QTJ8XC9X\nAAPL XRX5OE4AHY4M|AAPL R735QTJ8XC9X\nAAPL 31CV49EL8DA4M|AAPL R735QTJ8XC9X\nAAPL 319ZQBM0RT65I|AAPL R735QTJ8XC9X\nAAPL 31FCPXXPUT1LY|AAPL R735QTJ8XC9X\nAAPL 31R15TU4ZCRYE|AAPL R735QTJ8XC9X\nAAPL 31UH85MTKYVDY|AAPL R735QTJ8XC9X\nAAPL XG8PSGW83SAU|AAPL R735QTJ8XC9X\nAAPL XC7Z2R3SWD46|AAPL R735QTJ8XC9X\nAAPL 31CV49F29JM1Y|AAPL R735QTJ8XC9X\nAAPL 31BBZ865XHDS6|AAPL R735QTJ8XC9X\nAAPL 319ZQBL765EH2|AAPL R735QTJ8XC9X\nAAPL XBGEKHG7Y6RQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3TE9BSRQ|AAPL R735QTJ8XC9X\nAAPL XCZJLDPRC9K6|AAPL R735QTJ8XC9X\nAAPL 31EL5FAL7NGQU|AAPL R735QTJ8XC9X\nAAPL XDR43YMD04UE|AAPL R735QTJ8XC9X\nAAPL XBGEK3VOPR7Q|AAPL R735QTJ8XC9X\nAAPL 31H2R3SU3392E|AAPL R735QTJ8XC9X\nAAPL 31EL5FAO0V5L2|AAPL R735QTJ8XC9X\nAAPL 31KBXAY3YKYUE|AAPL R735QTJ8XC9X\nAAPL XL7X5HJLAGAU|AAPL R735QTJ8XC9X\nAAPL XB9IFH0YZVJA|AAPL R735QTJ8XC9X\nAAPL XB9IFGNQP3L2|AAPL R735QTJ8XC9X\nAAPL XB9IFHT34RXI|AAPL R735QTJ8XC9X\nAAPL 319ZQBL6CDQ86|AAPL R735QTJ8XC9X\nAAPL XCZJLCDGWOAU|AAPL R735QTJ8XC9X\nAAPL 31C3JQSYI0J1I|AAPL R735QTJ8XC9X\nAAPL XBNAOSSHLAP2|AAPL R735QTJ8XC9X\nAAPL XPFJZWND8Q5I|AAPL R735QTJ8XC9X\nAAPL 319ZQBZ7EZMPY|AAPL R735QTJ8XC9X\nAAPL XBNAORG75PFQ|AAPL R735QTJ8XC9X\nAAPL 31BBZ871CMU06|AAPL R735QTJ8XC9X\nAAPL XL7X5HGM4FEU|AAPL R735QTJ8XC9X\nAAPL 31EL5FAOCRTOM|AAPL R735QTJ8XC9X\nAAPL XL7X5HLKQGW6|AAPL R735QTJ8XC9X\nAAPL 31BBZ862YBCW6|AAPL R735QTJ8XC9X\nAAPL 31UH85N1UNLUU|AAPL R735QTJ8XC9X\nAAPL 31CV49EK2OXS6|AAPL R735QTJ8XC9X\nAAPL 31FCPXWU9P9C6|AAPL R735QTJ8XC9X\nAAPL XL7X5HEYL2X2|AAPL R735QTJ8XC9X\nAAPL 31ADIL89CVKQU|AAPL R735QTJ8XC9X\nAAPL XFH59UWFELBA|AAPL R735QTJ8XC9X\nAAPL 31OJK5BRBBFD2|AAPL R735QTJ8XC9X\nAAPL 31UH85M4RYT52|AAPL R735QTJ8XC9X\nAAPL XBU6TG7PIJC6|AAPL R735QTJ8XC9X\nAAPL XG8PSHTYLX7Q|AAPL R735QTJ8XC9X\nAAPL XPFJZWA4XY7A|AAPL R735QTJ8XC9X\nAAPL 31AKEPKQYYD0M|AAPL R735QTJ8XC9X\nAAPL XVD8067Q3CEE|AAPL R735QTJ8XC9X\nAAPL XHYQYDNBQPUU|AAPL R735QTJ8XC9X\nAAPL XRX5OE2YV9QE|AAPL R735QTJ8XC9X\nAAPL XBGEKH7Y9GAU|AAPL R735QTJ8XC9X\nAAPL 31AY6YW0AMYQU|AAPL R735QTJ8XC9X\nAAPL 31ARAU7GQ277Q|AAPL R735QTJ8XC9X\nAAPL 31UH85M8KWI9Y|AAPL R735QTJ8XC9X\nAAPL XFH59UN61ZPI|AAPL R735QTJ8XC9X\nAAPL 31UH85M5FS5C6|AAPL R735QTJ8XC9X\nAAPL 31ADIKWCUUN46|AAPL R735QTJ8XC9X\nAAPL 319ZQBL3D9UHY|AAPL R735QTJ8XC9X\nAAPL XVD806A1G13A|AAPL R735QTJ8XC9X\nAAPL 31A6MGN84WDS6|AAPL R735QTJ8XC9X\nAAPL 31OJK5C6152LI|AAPL R735QTJ8XC9X\nAAPL XBU6TF276O3Q|AAPL R735QTJ8XC9X\nAAPL 31ADIKW7QCEQU|AAPL R735QTJ8XC9X\nAAPL XC7Z2R8RIELI|AAPL R735QTJ8XC9X\nAAPL XPFJZVT9PYBQ|AAPL R735QTJ8XC9X\nAAPL XFH59UY2XXT2|AAPL R735QTJ8XC9X\nAAPL 31ADIKWWV6ZXI|AAPL R735QTJ8XC9X\nAAPL 31AY6YV0KOT8M|AAPL R735QTJ8XC9X\nAAPL 31BBZ86Y1K50M|AAPL R735QTJ8XC9X\nAAPL 31A6MGL5PPRK6|AAPL R735QTJ8XC9X\nAAPL 31A6MG8QUTOG6|AAPL R735QTJ8XC9X\nAAPL 31EL5FBFH4KME|AAPL R735QTJ8XC9X\nAAPL 31CV49EKELLVQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2QX6QZ52|AAPL R735QTJ8XC9X\nAAPL XPFJZVTLMMFA|AAPL R735QTJ8XC9X\nAAPL XCZJLCE4Q0HY|AAPL R735QTJ8XC9X\nAAPL XG8PSHNCGJ8M|AAPL R735QTJ8XC9X\nAAPL 31BBZ86PRVEJQ|AAPL R735QTJ8XC9X\nAAPL XBNAOSXG7C6E|AAPL R735QTJ8XC9X\nAAPL XAVQ6G0G3IRQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3SWKC4NA|AAPL R735QTJ8XC9X\nAAPL 31R15TUV9XUNA|AAPL R735QTJ8XC9X\nAAPL 31EL5FB3WD55Y|AAPL R735QTJ8XC9X\nAAPL XPFJZVVWZB46|AAPL R735QTJ8XC9X\nAAPL 31AY6YUW3ZX2E|AAPL R735QTJ8XC9X\nAAPL 31FCPXXHL4B52|AAPL R735QTJ8XC9X\nAAPL 319ZQBM91HWME|AAPL R735QTJ8XC9X\nAAPL XL7X5I33RSYU|AAPL R735QTJ8XC9X\nAAPL 31KBXAXGZ2L52|AAPL R735QTJ8XC9X\nAAPL XB9IFG9IQGHY|AAPL R735QTJ8XC9X\nAAPL XL7X5HKQYSNA|AAPL R735QTJ8XC9X\nAAPL 31ARAU8JF6DLY|AAPL R735QTJ8XC9X\nAAPL XHYQYCZUDC06|AAPL R735QTJ8XC9X\nAAPL 31OJK5CHLWI1Y|AAPL R735QTJ8XC9X\nAAPL 319ZQBL7072FA|AAPL R735QTJ8XC9X\nAAPL XAVQ664VM1RA|AAPL R735QTJ8XC9X\nAAPL XDR43YOCG5FQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3SXQ0GZQ|AAPL R735QTJ8XC9X\nAAPL 31ARAUK2J0CEE|AAPL R735QTJ8XC9X\nAAPL XCZJLDHHNJ3A|AAPL R735QTJ8XC9X\nAAPL 31AKEPJVVPKW6|AAPL R735QTJ8XC9X\nAAPL XFH59UP5I0AU|AAPL R735QTJ8XC9X\nAAPL XBNAORCQ6TK6|AAPL R735QTJ8XC9X\nAAPL XB9IFHO4IQG6|AAPL R735QTJ8XC9X\nAAPL 31KBXAXIYILQE|AAPL R735QTJ8XC9X\nAAPL 31C3JQSDNWHZA|AAPL R735QTJ8XC9X\nAAPL XHYQYD1ZRONA|AAPL R735QTJ8XC9X\nAAPL XC7Z2RIOQHK6|AAPL R735QTJ8XC9X\nAAPL XB9IFGZBGJ1I|AAPL R735QTJ8XC9X\nAAPL 31R15TUI1N2P2|AAPL R735QTJ8XC9X\nAAPL XB2MB3CCY2FA|AAPL R735QTJ8XC9X\nAAPL 31H2R3SYDTT6U|AAPL R735QTJ8XC9X\nAAPL XBGEK5D9O21Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5BTSMG3Q|AAPL R735QTJ8XC9X\nAAPL 31OJK5CEATT2E|AAPL R735QTJ8XC9X\nAAPL XDR43Z80VU5I|AAPL R735QTJ8XC9X\nAAPL 31ADIL9MYZZK6|AAPL R735QTJ8XC9X\nAAPL 31C3JQSD61HTY|AAPL R735QTJ8XC9X\nAAPL 31CV49EKQI9ZA|AAPL R735QTJ8XC9X\nAAPL 31ADIKWAPGAH2|AAPL R735QTJ8XC9X\nAAPL 31FCPXWX8VA86|AAPL R735QTJ8XC9X\nAAPL 31OJK5BS533LY|AAPL R735QTJ8XC9X\nAAPL XBNAP3V21SJQ|AAPL R735QTJ8XC9X\nAAPL XBNAOSBY7TRA|AAPL R735QTJ8XC9X\nAAPL 31EL5FB28TSO6|AAPL R735QTJ8XC9X\nAAPL XRX5OE2B1XJA|AAPL R735QTJ8XC9X\nAAPL 31FCPXWWL1Y12|AAPL R735QTJ8XC9X\nAAPL 31AY6YW599086|AAPL R735QTJ8XC9X\nAAPL 31OJK5CAZR42U|AAPL R735QTJ8XC9X\nAAPL 31AY6YW8KBP7Q|AAPL R735QTJ8XC9X\nAAPL XL7X5HL2VGQU|AAPL R735QTJ8XC9X\nAAPL 31EL5FALJK4UE|AAPL R735QTJ8XC9X\nAAPL 31AKEPU7NLPL2|AAPL R735QTJ8XC9X\nAAPL 31EL5FALPIGW6|AAPL R735QTJ8XC9X\nAAPL XBNAOSLVFWPY|AAPL R735QTJ8XC9X\nAAPL XBNAORHOQPVQ|AAPL R735QTJ8XC9X\nAAPL XHYQYD0O5092|AAPL R735QTJ8XC9X\nAAPL 31AY6Z7EFUW1Y|AAPL R735QTJ8XC9X\nAAPL XDR43ZMWPYLI|AAPL R735QTJ8XC9X\nAAPL XB9IFGCNUTFQ|AAPL R735QTJ8XC9X\nAAPL 31A6MG9PWYHRA|AAPL R735QTJ8XC9X\nAAPL 31UH85M4A3SZQ|AAPL R735QTJ8XC9X\nAAPL XBGEKHWRBNPI|AAPL R735QTJ8XC9X\nAAPL XL7X5HEATVVQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXWURK9HI|AAPL R735QTJ8XC9X\nAAPL 31H2R3SVQKGEE|AAPL R735QTJ8XC9X\nAAPL XFH59VG9UR8M|AAPL R735QTJ8XC9X\nAAPL 31OJK5BR5D3BA|AAPL R735QTJ8XC9X\nAAPL XB2MASTSY7PI|AAPL R735QTJ8XC9X\nAAPL 31OJK5BQTGF7Q|AAPL R735QTJ8XC9X\nAAPL 31OJK5CMKIJJA|AAPL R735QTJ8XC9X\nAAPL XHYQYDSACRC6|AAPL R735QTJ8XC9X\nAAPL XBNAORGD41HI|AAPL R735QTJ8XC9X\nAAPL XB9IFGC5ZTAE|AAPL R735QTJ8XC9X\nAAPL 31ARAU7FWAIYU|AAPL R735QTJ8XC9X\nAAPL XG8PSHLOX6QU|AAPL R735QTJ8XC9X\nAAPL XG8PSGX1VGJQ|AAPL R735QTJ8XC9X\nAAPL XC7Z2QS84XNQ|AAPL R735QTJ8XC9X\nAAPL XPFJZVSLWM4M|AAPL R735QTJ8XC9X\nAAPL 31AKEPW1T3LC6|AAPL R735QTJ8XC9X\nAAPL XBGEK3X0CFLY|AAPL R735QTJ8XC9X\nAAPL 31C3JQTNB2QG6|AAPL R735QTJ8XC9X\nAAPL XB2MB4PZ2H8M|AAPL R735QTJ8XC9X\nAAPL 31ADIKWYIQCFA|AAPL R735QTJ8XC9X\nAAPL 31H2R3SW2H4HY|AAPL R735QTJ8XC9X\nAAPL XL7X5HK93SHY|AAPL R735QTJ8XC9X\nAAPL XG8PSGX7TSLI|AAPL R735QTJ8XC9X\nAAPL 31OJK5CPVL8IU|AAPL R735QTJ8XC9X\nAAPL 31H2R3T9APRAE|AAPL R735QTJ8XC9X\nAAPL XAVQ65753WUE|AAPL R735QTJ8XC9X\nAAPL 31C3JQTS9ORXI|AAPL R735QTJ8XC9X\nAAPL 31FCPXXT5VQLI|AAPL R735QTJ8XC9X\nAAPL XB2MB4HPDQRQ|AAPL R735QTJ8XC9X\nAAPL XVD8072NDSH2|AAPL R735QTJ8XC9X\nAAPL XVD80662JZWM|AAPL R735QTJ8XC9X\nAAPL 31OJK5BQZER9I|AAPL R735QTJ8XC9X\nAAPL 31AKEPKM0CBJA|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q58MJYE|AAPL R735QTJ8XC9X\nAAPL XB2MB41609TY|AAPL R735QTJ8XC9X\nAAPL XBNAORGP0PL2|AAPL R735QTJ8XC9X\nAAPL 31C3JQSV6XU1Y|AAPL R735QTJ8XC9X\nAAPL XCZJLCCB8BYE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXYZYXD2|AAPL R735QTJ8XC9X\nAAPL XB2MASTB37K6|AAPL R735QTJ8XC9X\nAAPL XHYQYCUVTFOM|AAPL R735QTJ8XC9X\nAAPL 31KBXAXEHRKEE|AAPL R735QTJ8XC9X\nAAPL XBU6TT14E7YE|AAPL R735QTJ8XC9X\nAAPL XCZJLCFGCOW6|AAPL R735QTJ8XC9X\nAAPL XBU6TG9D1VTY|AAPL R735QTJ8XC9X\nAAPL 31AY6YW6WSCPY|AAPL R735QTJ8XC9X\nAAPL 31ARAU87UEY5I|AAPL R735QTJ8XC9X\nAAPL 31R15TU2ZWRD2|AAPL R735QTJ8XC9X\nAAPL 31CV49F5KMB1I|AAPL R735QTJ8XC9X\nAAPL XPFJZWBSHAP2|AAPL R735QTJ8XC9X\nAAPL XHYQYD25Q0P2|AAPL R735QTJ8XC9X\nAAPL 31BBZ863A80ZQ|AAPL R735QTJ8XC9X\nAAPL 31CV49FPF2GYU|AAPL R735QTJ8XC9X\nAAPL XL7X5HFYB37Q|AAPL R735QTJ8XC9X\nAAPL 31BBZ864FWDC6|AAPL R735QTJ8XC9X\nAAPL 31AKEPKPBF0IU|AAPL R735QTJ8XC9X\nAAPL XL7X5HIRIS1Y|AAPL R735QTJ8XC9X\nAAPL XPFJZVPSR2G6|AAPL R735QTJ8XC9X\nAAPL 31FCPXXZS14KM|AAPL R735QTJ8XC9X\nAAPL 31KBXAY8X70BQ|AAPL R735QTJ8XC9X\nAAPL XDR43ZJLN9LY|AAPL R735QTJ8XC9X\nAAPL 31H2R3STR6KYU|AAPL R735QTJ8XC9X\nAAPL XB9IFUCKSDL2|AAPL R735QTJ8XC9X\nAAPL XG8PSHSB2KPY|AAPL R735QTJ8XC9X\nAAPL XC7Z2RSLYKIU|AAPL R735QTJ8XC9X\nAAPL 31CV49EM24YDI|AAPL R735QTJ8XC9X\nAAPL XVD8067K50CM|AAPL R735QTJ8XC9X\nAAPL XDR43YZR73OM|AAPL R735QTJ8XC9X\nAAPL XPFJZVU9FYME|AAPL R735QTJ8XC9X\nAAPL XDR43ZRVC02U|AAPL R735QTJ8XC9X\nAAPL 31KBXAXHAZ98M|AAPL R735QTJ8XC9X\nAAPL 31C3JQSRVV52E|AAPL R735QTJ8XC9X\nAAPL 31OJK5BUGFSAU|AAPL R735QTJ8XC9X\nAAPL 31ADIL96FMIME|AAPL R735QTJ8XC9X\nAAPL XHYQYDID4ODI|AAPL R735QTJ8XC9X\nAAPL 31OJK5BT4T3WM|AAPL R735QTJ8XC9X\nAAPL XB9IFSQOZ8AU|AAPL R735QTJ8XC9X\nAAPL 31AKEPV4QCNGM|AAPL R735QTJ8XC9X\nAAPL XG8PSI8UG1NQ|AAPL R735QTJ8XC9X\nAAPL 31ADIL8PW91OM|AAPL R735QTJ8XC9X\nAAPL 31EL5FAOIQ5QE|AAPL R735QTJ8XC9X\nAAPL 31AY6YW3LPNQE|AAPL R735QTJ8XC9X\nAAPL XCZJLDY11012|AAPL R735QTJ8XC9X\nAAPL XPFJZVWEUB9I|AAPL R735QTJ8XC9X\nAAPL XPFJZW1V97QE|AAPL R735QTJ8XC9X\nAAPL 31R15TU10GQRQ|AAPL R735QTJ8XC9X\nAAPL 31AKEPUO6Z6IU|AAPL R735QTJ8XC9X\nAAPL 31UH85M4G251I|AAPL R735QTJ8XC9X\nAAPL XBGEK5BM4PK6|AAPL R735QTJ8XC9X\nAAPL 31AY6YW1Y6B8M|AAPL R735QTJ8XC9X\nAAPL XPFJZVS41LZA|AAPL R735QTJ8XC9X\nAAPL 31R15TU35V3EU|AAPL R735QTJ8XC9X\nAAPL XL7X5HHLUFPI|AAPL R735QTJ8XC9X\nAAPL XDR43YN6RT3A|AAPL R735QTJ8XC9X\nAAPL XPFJZVRA9XQE|AAPL R735QTJ8XC9X\nAAPL XAVQ66N2IV6U|AAPL R735QTJ8XC9X\nAAPL XAVQ6594JXFQ|AAPL R735QTJ8XC9X\nAAPL XRX5OE4YBABQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3SVENSAU|AAPL R735QTJ8XC9X\nAAPL 31KBXAXF5KWLI|AAPL R735QTJ8XC9X\nAAPL XBU6TS41NA2U|AAPL R735QTJ8XC9X\nAAPL 31AY6Z838X3GM|AAPL R735QTJ8XC9X\nAAPL XBGEKGZOKPTY|AAPL R735QTJ8XC9X\nAAPL 31UH85M6XD5S6|AAPL R735QTJ8XC9X\nAAPL XL7X5IGC2KX2|AAPL R735QTJ8XC9X\nAAPL XRX5OESRLC9Y|AAPL R735QTJ8XC9X\nAAPL 31R15TU16F2TI|AAPL R735QTJ8XC9X\nAAPL XVD8068PTCP2|AAPL R735QTJ8XC9X\nAAPL XB9IFHY1QTEU|AAPL R735QTJ8XC9X\nAAPL 31EL5FANOYHHI|AAPL R735QTJ8XC9X\nAAPL XDR43Z6DCHNQ|AAPL R735QTJ8XC9X\nAAPL XBU6TF07QNIE|AAPL R735QTJ8XC9X\nAAPL 31OJK5BTYKS5I|AAPL R735QTJ8XC9X\nAAPL XBNAOSIKD7QE|AAPL R735QTJ8XC9X\nAAPL XFH59UMU5BLY|AAPL R735QTJ8XC9X\nAAPL XB9IFG8J2LD2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BOU2JS6|AAPL R735QTJ8XC9X\nAAPL 31CV49F785NJA|AAPL R735QTJ8XC9X\nAAPL 319ZQBL6IC29Y|AAPL R735QTJ8XC9X\nAAPL XAVQ66BHRFQE|AAPL R735QTJ8XC9X\nAAPL XVD8066QDC3Q|AAPL R735QTJ8XC9X\nAAPL 31BBZ860B459I|AAPL R735QTJ8XC9X\nAAPL 31ARAU7C3EYZQ|AAPL R735QTJ8XC9X\nAAPL 31AKEPJW7M8ZQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXISK9OM|AAPL R735QTJ8XC9X\nAAPL 31BBZ862GGCQU|AAPL R735QTJ8XC9X\nAAPL XBU6TF1DEZUU|AAPL R735QTJ8XC9X\nAAPL 31AKEPL0W6FZA|AAPL R735QTJ8XC9X\nAAPL XVD8068DWOLI|AAPL R735QTJ8XC9X\nAAPL XFH59UNHYNT2|AAPL R735QTJ8XC9X\nAAPL 31OJK5C2Q2DLY|AAPL R735QTJ8XC9X\nAAPL XRX5OE5M4MIU|AAPL R735QTJ8XC9X\nAAPL 31ADIKXA3HRVQ|AAPL R735QTJ8XC9X\nAAPL XBU6TF2D505I|AAPL R735QTJ8XC9X\nAAPL 31A6MG8NJT4ME|AAPL R735QTJ8XC9X\nAAPL 31KBXAXQQA6W6|AAPL R735QTJ8XC9X\nAAPL 31KBXAXXCFKVA|AAPL R735QTJ8XC9X\nAAPL 31ADIKX6SF2W6|AAPL R735QTJ8XC9X\nAAPL XCZJLCD5007A|AAPL R735QTJ8XC9X\nAAPL XCZJLCESJCP2|AAPL R735QTJ8XC9X\nAAPL 31R15TU2O039I|AAPL R735QTJ8XC9X\nAAPL XB2MASRNJV2E|AAPL R735QTJ8XC9X\nAAPL XVD80668IBYE|AAPL R735QTJ8XC9X\nAAPL XPFJZVRS4XVQ|AAPL R735QTJ8XC9X\nAAPL XVD806PF30IU|AAPL R735QTJ8XC9X\nAAPL XFH59UPBGCCM|AAPL R735QTJ8XC9X\nAAPL XCZJLCGM118M|AAPL R735QTJ8XC9X\nAAPL XPFJZVX2NNGM|AAPL R735QTJ8XC9X\nAAPL XB9IFH7L59IE|AAPL R735QTJ8XC9X\nAAPL 319ZQBW7X22ME|AAPL R735QTJ8XC9X\nAAPL XHYQYCZ6JZT2|AAPL R735QTJ8XC9X\nAAPL 31ADIKW8K1XTY|AAPL R735QTJ8XC9X\nAAPL XBGEKFUC51HI|AAPL R735QTJ8XC9X\nAAPL 31EL5FALDLSSM|AAPL R735QTJ8XC9X\nAAPL XG8PSH011HFQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5CT6NXIE|AAPL R735QTJ8XC9X\nAAPL XC12Y3HYTQHY|AAPL R735QTJ8XC9X\nAAPL XC12YFO86K7A|AAPL R735QTJ8XC9X\nAAPL XBNAP65QX58M|AAPL R735QTJ8XC9X\nAAPL XC12Y46RVXWM|AAPL R735QTJ8XC9X\nAAPL 31B533IJRI32E|AAPL R735QTJ8XC9X\nAAPL XBGEKILKDV46|AAPL R735QTJ8XC9X\nAAPL XRX5OE6XRAX2|AAPL R735QTJ8XC9X\nAAPL 31B533IGGHJ8M|AAPL R735QTJ8XC9X\nAAPL 31B533WC8IKZQ|AAPL R735QTJ8XC9X\nAAPL 31B533VF5RN46|AAPL R735QTJ8XC9X\nAAPL XC12YG4RK152|AAPL R735QTJ8XC9X\nAAPL XVD806AJB18M|AAPL R735QTJ8XC9X\nAAPL XC12Y41T9WFA|AAPL R735QTJ8XC9X\nAAPL 31B533IKL9RBA|AAPL R735QTJ8XC9X\nAAPL 31B533IL34RGM|AAPL R735QTJ8XC9X\nAAPL 31B533W3YTUIU|AAPL R735QTJ8XC9X\nAAPL XC12Y2KW4XS6|AAPL R735QTJ8XC9X\nAAPL XC12YFWHVAO6|AAPL R735QTJ8XC9X\nAAPL 31B533IKR83D2|AAPL R735QTJ8XC9X\nAAPL XBU6TGJA9YSM|AAPL R735QTJ8XC9X\nAAPL 31B533IK3ER5Y|AAPL R735QTJ8XC9X\nAAPL 31B533IJLJR0M|AAPL R735QTJ8XC9X\nAAPL XBU6TF0DOZK6|AAPL R735QTJ8XC9X\nAAPL 31B533IK9D37Q|AAPL R735QTJ8XC9X\nAAPL XC12YHIDOFYE|AAPL R735QTJ8XC9X\nAAPL 31ADIKWD0SZ5Y|AAPL R735QTJ8XC9X\nAAPL 31B533IKFBF9I|AAPL R735QTJ8XC9X\nAAPL 31B533JR3BMUE|AAPL R735QTJ8XC9X\nAAPL XC12Y2MJOA9Y|AAPL R735QTJ8XC9X\nAAPL 31B533JPFSACM|AAPL R735QTJ8XC9X\nAAPL XC12Y2L81LVQ|AAPL R735QTJ8XC9X\nAAPL XC12YGLAXI2U|AAPL R735QTJ8XC9X\nAAPL XBU6TTHNROW6|AAPL R735QTJ8XC9X\nAAPL XBU6TTPXGFD2|AAPL R735QTJ8XC9X\nAAPL 31R15TU6AZGCM|AAPL R735QTJ8XC9X\nAAPL XPFJZVXEKBK6|AAPL R735QTJ8XC9X\nAAPL XC12Y2MDPY86|AAPL R735QTJ8XC9X\nAAPL 31UH85M9QKUME|AAPL R735QTJ8XC9X\nAAPL 31B533UQCPFPI|AAPL R735QTJ8XC9X\nAAPL 31BBZ87JJJNFQ|AAPL R735QTJ8XC9X\nAAPL XCZJLCGRZDAE|AAPL R735QTJ8XC9X\nAAPL 31B533IL933IE|AAPL R735QTJ8XC9X\nAAPL 31B533JNS8XUU|AAPL R735QTJ8XC9X\nAAPL XRX5OE79NZ0M|AAPL R735QTJ8XC9X\nAAPL XBU6TTY755TY|AAPL R735QTJ8XC9X\nAAPL 31ADILAK1QXFQ|AAPL R735QTJ8XC9X\nAAPL XRX5OE7XHB7Q|AAPL R735QTJ8XC9X\nAAPL XC12YGTKM8JQ|AAPL R735QTJ8XC9X\nAAPL XC12YF7OT39I|AAPL R735QTJ8XC9X\nAAPL 31B533JM4PLD2|AAPL R735QTJ8XC9X\nAAPL 31B533JDV0UW6|AAPL R735QTJ8XC9X\nAAPL XRX5OE7FMB2E|AAPL R735QTJ8XC9X\nAAPL XC12Y3Q8IGYU|AAPL R735QTJ8XC9X\nAAPL 31ARAU8TCEGKM|AAPL R735QTJ8XC9X\nAAPL XBGEKITU2LL2|AAPL R735QTJ8XC9X\nAAPL XC12Y2H97PUU|AAPL R735QTJ8XC9X\nAAPL XC12YFFYHTQE|AAPL R735QTJ8XC9X\nAAPL XC12YGD18RLY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7H1YVBA|AAPL R735QTJ8XC9X\nAAPL XC12Y3RW1TGM|AAPL R735QTJ8XC9X\nAAPL XC12Y3WUNUXY|AAPL R735QTJ8XC9X\nAAPL 31B533JW1XOBQ|AAPL R735QTJ8XC9X\nAAPL 31B533IGAJ76U|AAPL R735QTJ8XC9X\nAAPL XC12Y2LJY9ZA|AAPL R735QTJ8XC9X\nAAPL 31CV49EI99EEE|AAPL R735QTJ8XC9X\nAAPL XPFJZVWQQZD2|AAPL R735QTJ8XC9X\nAAPL XPFJZVXKINLY|AAPL R735QTJ8XC9X\nAAPL 31B533V6W2WNA|AAPL R735QTJ8XC9X\nAAPL XG8PSGZV35DY|AAPL R735QTJ8XC9X\nAAPL XG8PSGZ79T6U|AAPL R735QTJ8XC9X\nAAPL 31B533VNFGDL2|AAPL R735QTJ8XC9X\nAAPL XBGEK3Y02FWM|AAPL R735QTJ8XC9X\nAAPL XBNAP2HFXDQE|AAPL R735QTJ8XC9X\nAAPL XG8PSGZP4TC6|AAPL R735QTJ8XC9X\nAAPL XVD806AV7PC6|AAPL R735QTJ8XC9X\nAAPL 31B533VVP541Y|AAPL R735QTJ8XC9X\nAAPL 31B533U9TBYRQ|AAPL R735QTJ8XC9X\nAAPL XC12YH1UAZ0M|AAPL R735QTJ8XC9X\nAAPL 31B533JXPH0TI|AAPL R735QTJ8XC9X\nAAPL XBNAP6E0LVPI|AAPL R735QTJ8XC9X\nAAPL XC12Y405QJXI|AAPL R735QTJ8XC9X\nAAPL 31OJK5BU4J47A|AAPL R735QTJ8XC9X\nAAPL 31B533IJXGF46|AAPL R735QTJ8XC9X\nAAPL 31B533JSQUZC6|AAPL R735QTJ8XC9X\nAAPL XDR43YJ7XX2E|AAPL R735QTJ8XC9X\nAAPL XRX5OE7RIZ5Y|AAPL R735QTJ8XC9X\nAAPL XC12Y2LVUY2U|AAPL R735QTJ8XC9X\nAAPL XC12Y2M7RM6E|AAPL R735QTJ8XC9X\nAAPL XC12Y3TJL5YE|AAPL R735QTJ8XC9X\nAAPL XC12Y3YI77FQ|AAPL R735QTJ8XC9X\nAAPL XPFJZVWKSNBA|AAPL R735QTJ8XC9X\nAAPL 31UH85M8QUUBQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2M1TA4M|AAPL R735QTJ8XC9X\nAAPL 31FCPXWXETM9Y|AAPL R735QTJ8XC9X\nAAPL 31EL5FAP0L5VQ|AAPL R735QTJ8XC9X\nAAPL 31CV49ENDRMRQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2L239TY|AAPL R735QTJ8XC9X\nAAPL 31CV49EODHN2E|AAPL R735QTJ8XC9X\nAAPL XBGEK4Q45752|AAPL R735QTJ8XC9X\nAAPL XRX5OE7LKN46|AAPL R735QTJ8XC9X\nAAPL XC12Y3V74IG6|AAPL R735QTJ8XC9X\nAAPL 31B533UYME66E|AAPL R735QTJ8XC9X\nAAPL 31ADILASBFNWM|AAPL R735QTJ8XC9X\nAAPL XC12Y2LDZXXI|AAPL R735QTJ8XC9X\nAAPL 31FCPXWYWEMPY|AAPL R735QTJ8XC9X\nAAPL 31B533JKH68VA|AAPL R735QTJ8XC9X\nAAPL 31AKEPL95V6G6|AAPL R735QTJ8XC9X\nAAPL XFH59US4O16U|AAPL R735QTJ8XC9X\nAAPL 31FCPXWYQGAO6|AAPL R735QTJ8XC9X\nAAPL XC12YHA3ZPHI|AAPL R735QTJ8XC9X\nAAPL XC12Y3ENR1IE|AAPL R735QTJ8XC9X\nAAPL 31B533JFIK7DY|AAPL R735QTJ8XC9X\nAAPL XRX5OE0NKQ7A|AAPL R735QTJ8XC9X\nAAPL 31CV49EOJFZ46|AAPL R735QTJ8XC9X\nAAPL 31B533UI30P8M|AAPL R735QTJ8XC9X\nAAPL XBGEK3VCT346|AAPL R735QTJ8XC9X\nAAPL 31C3JQSEZJ6DI|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q1RNO2U|AAPL R735QTJ8XC9X\nAAPL 31B533IJFLEYU|AAPL R735QTJ8XC9X\nAAPL XCZJLCAHSSKM|AAPL R735QTJ8XC9X\nAAPL 31B533JITMWDI|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZPGHL2|AAPL R735QTJ8XC9X\nAAPL 31FCPXWXKRYBQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2MPMMBQ|AAPL R735QTJ8XC9X\nAAPL XC12Y3OKZ4H2|AAPL R735QTJ8XC9X\nAAPL 31A6MGA83VB6U|AAPL R735QTJ8XC9X\nAAPL 31B533JH63JVQ|AAPL R735QTJ8XC9X\nAAPL 31A6MGA6GBYP2|AAPL R735QTJ8XC9X\nAAPL XBGEKE8GBW7A|AAPL R735QTJ8XC9X\nAAPL XCZJLCGXXPC6|AAPL R735QTJ8XC9X\nAAPL XBGEK5GKQR1I|AAPL R735QTJ8XC9X\nAAPL XC12Y43GT8X2|AAPL R735QTJ8XC9X\nAAPL 31A6MGNGEL492|AAPL R735QTJ8XC9X\nAAPL XBU6TFZFTSVA|AAPL R735QTJ8XC9X\nAAPL 31ARAU8YB0I1Y|AAPL R735QTJ8XC9X\nAAPL XC12Y2MVKYDI|AAPL R735QTJ8XC9X\nAAPL XBU6TFXSAGDI|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q7PXKP2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BUAHG92|AAPL R735QTJ8XC9X\nAAPL 31AY6YWBVEE7A|AAPL R735QTJ8XC9X\nAAPL XC12YEZF4CSM|AAPL R735QTJ8XC9X\nAAPL 31ARAUMD7VP3A|AAPL R735QTJ8XC9X\nAAPL XC12Y2KK89OM|AAPL R735QTJ8XC9X\nAAPL 31R15TU6GXSEE|AAPL R735QTJ8XC9X\nAAPL 31CV49ENJPYTI|AAPL R735QTJ8XC9X\nAAPL 31B533JUEEBTY|AAPL R735QTJ8XC9X\nAAPL 31ARAULWOI85I|AAPL R735QTJ8XC9X\nAAPL 31FCPXWY8LAIU|AAPL R735QTJ8XC9X\nAAPL 31ARAUM4Y6YME|AAPL R735QTJ8XC9X\nAAPL 31AKEPLE4H7XI|AAPL R735QTJ8XC9X\nAAPL 31BBZ87OI5OX2|AAPL R735QTJ8XC9X\nAAPL 31B533ILF1FK6|AAPL R735QTJ8XC9X\nAAPL XDR43YPI4HS6|AAPL R735QTJ8XC9X\nAAPL 31B533WSRW1XI|AAPL R735QTJ8XC9X\nAAPL 31A6MGNOO9UPY|AAPL R735QTJ8XC9X\nAAPL XC12Y2KQ6LQE|AAPL R735QTJ8XC9X\nAAPL 31FCPXWSM8206|AAPL R735QTJ8XC9X\nAAPL 31FCPXWYEJMKM|AAPL R735QTJ8XC9X\nAAPL XC12YEIVQVUU|AAPL R735QTJ8XC9X\nAAPL XB9IFGEBE5XI|AAPL R735QTJ8XC9X\nAAPL XBNAORIOGQ6E|AAPL R735QTJ8XC9X\nAAPL XBU6TG13D5D2|AAPL R735QTJ8XC9X\nAAPL 31B533JZD0DBA|AAPL R735QTJ8XC9X\nAAPL XC12YEAM25DY|AAPL R735QTJ8XC9X\nAAPL 31C3JQTX8ATEU|AAPL R735QTJ8XC9X\nAAPL 31ADILB0L4EDI|AAPL R735QTJ8XC9X\nAAPL XB9IFV9NJBGM|AAPL R735QTJ8XC9X\nAAPL XB9IFV1DUKZQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVCZQC2O6|AAPL R735QTJ8XC9X\nAAPL XZDYPX16VLHI|AAPL R735QTJ8XC9X\nAAPL XZDYPX0P0LC6|AAPL R735QTJ8XC9X\nAAPL XBGEK3YHXG1Y|AAPL R735QTJ8XC9X\nAAPL 31ADIKWDINZBA|AAPL R735QTJ8XC9X\nAAPL 31C3JQS9J49WM|AAPL R735QTJ8XC9X\nAAPL XZDYPWVEK0X2|AAPL R735QTJ8XC9X\nAAPL 31YHYVCURS6CM|AAPL R735QTJ8XC9X\nAAPL 31YHYVCY2SQ6E|AAPL R735QTJ8XC9X\nAAPL XC12Y454CLEU|AAPL R735QTJ8XC9X\nAAPL 31AKEPYT1CEYU|AAPL R735QTJ8XC9X\nAAPL 31YHYVCYEPE9Y|AAPL R735QTJ8XC9X\nAAPL XDR43YQHUI2U|AAPL R735QTJ8XC9X\nAAPL 31EL5FAPIG612|AAPL R735QTJ8XC9X\nAAPL XZDYPWZJC8ZQ|AAPL R735QTJ8XC9X\nAAPL XZDYPWYVIWSM|AAPL R735QTJ8XC9X\nAAPL XZDYPX075L6U|AAPL R735QTJ8XC9X\nAAPL 31YHYVCULTUAU|AAPL R735QTJ8XC9X\nAAPL 31ADIKWDCPN9I|AAPL R735QTJ8XC9X\nAAPL 31YHYVCWX4DTY|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q81U8SM|AAPL R735QTJ8XC9X\nAAPL XZDYPX0D3X8M|AAPL R735QTJ8XC9X\nAAPL 31YHYVCYKNQBQ|AAPL R735QTJ8XC9X\nAAPL XZDYPWYPKKQU|AAPL R735QTJ8XC9X\nAAPL XZDYPX017952|AAPL R735QTJ8XC9X\nAAPL 31YHYVCY8R286|AAPL R735QTJ8XC9X\nAAPL XZDYPWZ7FKW6|AAPL R735QTJ8XC9X\nAAPL XZDYPX10X9FQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVCXQW22U|AAPL R735QTJ8XC9X\nAAPL XC12Y3MXFRZA|AAPL R735QTJ8XC9X\nAAPL XZDYPX0J29AE|AAPL R735QTJ8XC9X\nAAPL 31EL5FAPCHTZA|AAPL R735QTJ8XC9X\nAAPL XZDYPX1CTXJA|AAPL R735QTJ8XC9X\nAAPL XBU6TF2V00AU|AAPL R735QTJ8XC9X\nAAPL XZDYPWZ1H8UE|AAPL R735QTJ8XC9X\nAAPL 31B533WKI7BGM|AAPL R735QTJ8XC9X\nAAPL XZDYPWVKICYU|AAPL R735QTJ8XC9X\nAAPL 31B533XHKY9C6|AAPL R735QTJ8XC9X\nAAPL XZDYPWYDNWNA|AAPL R735QTJ8XC9X\nAAPL XBGEKEOZPD52|AAPL R735QTJ8XC9X\nAAPL XBNAOS8N54RQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2N1JAFA|AAPL R735QTJ8XC9X\nAAPL XZDYPWZDDWXY|AAPL R735QTJ8XC9X\nAAPL 31YHYVCYQM2DI|AAPL R735QTJ8XC9X\nAAPL XC12Y3GBAE06|AAPL R735QTJ8XC9X\nAAPL 31R15TU6MW4G6|AAPL R735QTJ8XC9X\nAAPL 31BIVD62ZGQFA|AAPL R735QTJ8XC9X\nAAPL XZDYPWYJM8P2|AAPL R735QTJ8XC9X\nAAPL XCEV7S67DJ9I|AAPL R735QTJ8XC9X\nAAPL 31AKEPZ1B15FQ|AAPL R735QTJ8XC9X\nAAPL 31B533ILKZRLY|AAPL R735QTJ8XC9X\nAAPL XCEV7EZK72P2|AAPL R735QTJ8XC9X\nAAPL XBNAP6MAAM6E|AAPL R735QTJ8XC9X\nAAPL 31BIVCTOMFNGM|AAPL R735QTJ8XC9X\nAAPL 31BIVD7027OAU|AAPL R735QTJ8XC9X\nAAPL 31ARAUMLHKFK6|AAPL R735QTJ8XC9X\nAAPL 31YHYVCX911XI|AAPL R735QTJ8XC9X\nAAPL 31YHYVCZEFEKM|AAPL R735QTJ8XC9X\nAAPL 31BIVCTKTK3HI|AAPL R735QTJ8XC9X\nAAPL 31AKEPYKRNOHY|AAPL R735QTJ8XC9X\nAAPL 31BIVD6RSIXTY|AAPL R735QTJ8XC9X\nAAPL XCEV7DQ8XIBQ|AAPL R735QTJ8XC9X\nAAPL XCEV7SMQR07A|AAPL R735QTJ8XC9X\nAAPL 31BIVCUVGE73A|AAPL R735QTJ8XC9X\nAAPL 31BIVCUOU8T46|AAPL R735QTJ8XC9X\nAAPL XCZJLCHFSPHI|AAPL R735QTJ8XC9X\nAAPL 31AY6YVTOHKRQ|AAPL R735QTJ8XC9X\nAAPL XBNAP6UJZCNA|AAPL R735QTJ8XC9X\nAAPL 31BIVCUQHS5LY|AAPL R735QTJ8XC9X\nAAPL XZDYPWY1R8JQ|AAPL R735QTJ8XC9X\nAAPL 31BIVD7GLL58M|AAPL R735QTJ8XC9X\nAAPL 31BIVCUTSUULI|AAPL R735QTJ8XC9X\nAAPL XCEV7DP97I12|AAPL R735QTJ8XC9X\nAAPL 31C3JQTYVU5WM|AAPL R735QTJ8XC9X\nAAPL 31BIVCTP4ANLY|AAPL R735QTJ8XC9X\nAAPL 31AY6YWDIXQP2|AAPL R735QTJ8XC9X\nAAPL XC12YHQND6FA|AAPL R735QTJ8XC9X\nAAPL XCEV7DQWQUIU|AAPL R735QTJ8XC9X\nAAPL 31AKEPJWPH952|AAPL R735QTJ8XC9X\nAAPL 31OJK5BPBXJXI|AAPL R735QTJ8XC9X\nAAPL XBU6TU6GTWAU|AAPL R735QTJ8XC9X\nAAPL XZDYPWZPAL1I|AAPL R735QTJ8XC9X\nAAPL XCEV7QSL94G6|AAPL R735QTJ8XC9X\nAAPL 31AY6Z9XEEZ7Q|AAPL R735QTJ8XC9X\nAAPL 31AKEPZ9KPVWM|AAPL R735QTJ8XC9X\nAAPL 31BIVD6JIU7D2|AAPL R735QTJ8XC9X\nAAPL XZDYPWV8LOVA|AAPL R735QTJ8XC9X\nAAPL XCEV7DR8NIME|AAPL R735QTJ8XC9X\nAAPL XCEV7R0UXUX2|AAPL R735QTJ8XC9X\nAAPL 31B533XPUMZT2|AAPL R735QTJ8XC9X\nAAPL 31BIVCTOYCBK6|AAPL R735QTJ8XC9X\nAAPL XCEV7EULL17Q|AAPL R735QTJ8XC9X\nAAPL 31YHYVD0872TI|AAPL R735QTJ8XC9X\nAAPL XCEV7F66CGO6|AAPL R735QTJ8XC9X\nAAPL XCEV7DR2P6KM|AAPL R735QTJ8XC9X\nAAPL XCEV7F7TVT5Y|AAPL R735QTJ8XC9X\nAAPL 31BIVCUS5BI3Q|AAPL R735QTJ8XC9X\nAAPL XCEV7F9HF5NQ|AAPL R735QTJ8XC9X\nAAPL 31BIVCV0F08KM|AAPL R735QTJ8XC9X\nAAPL XC12Y3L9WFHI|AAPL R735QTJ8XC9X\nAAPL 31CV49ENPOAVA|AAPL R735QTJ8XC9X\nAAPL 31BIVCTPG7BPI|AAPL R735QTJ8XC9X\nAAPL 31BIVD7OV9VPI|AAPL R735QTJ8XC9X\nAAPL XCEV7DQKU6FA|AAPL R735QTJ8XC9X\nAAPL XCEV7DQEVUDI|AAPL R735QTJ8XC9X\nAAPL XCEV7FB4YI5I|AAPL R735QTJ8XC9X\nAAPL XC12YHYX1WW6|AAPL R735QTJ8XC9X\nAAPL XCEV7DQQSIH2|AAPL R735QTJ8XC9X\nAAPL 31YHYVCX32PVQ|AAPL R735QTJ8XC9X\nAAPL 31BIVCTOSDZIE|AAPL R735QTJ8XC9X\nAAPL XZDYPX0UYXDY|AAPL R735QTJ8XC9X\nAAPL 31BIVCUYRGW2U|AAPL R735QTJ8XC9X\nAAPL 31BIVCTPM5NRA|AAPL R735QTJ8XC9X\nAAPL XBGEKJ23RC1Y|AAPL R735QTJ8XC9X\nAAPL XCEV7F2V9ROM|AAPL R735QTJ8XC9X\nAAPL XCEV7RPO02BQ|AAPL R735QTJ8XC9X\nAAPL 31ADIKXX90MSM|AAPL R735QTJ8XC9X\nAAPL 31BBZ866LAPZA|AAPL R735QTJ8XC9X\nAAPL 31AY6YV12JTDY|AAPL R735QTJ8XC9X\nAAPL XBU6TUEQIMRQ|AAPL R735QTJ8XC9X\nAAPL XCEV7DPL464M|AAPL R735QTJ8XC9X\nAAPL XCEV7T3A4H52|AAPL R735QTJ8XC9X\nAAPL 31AKEPJXDALC6|AAPL R735QTJ8XC9X\nAAPL 31BIVCUX3XJL2|AAPL R735QTJ8XC9X\nAAPL XPFJZVX8LZIE|AAPL R735QTJ8XC9X\nAAPL 31ARAU7HDVJEU|AAPL R735QTJ8XC9X\nAAPL XCEV7SV0FQO6|AAPL R735QTJ8XC9X\nAAPL 31BIVCTOAIZD2|AAPL R735QTJ8XC9X\nAAPL XCZJLCHRPDL2|AAPL R735QTJ8XC9X\nAAPL 31ARAUMTR9612|AAPL R735QTJ8XC9X\nAAPL 31AY6Z9GV1I9Y|AAPL R735QTJ8XC9X\nAAPL XCEV7F17QF6U|AAPL R735QTJ8XC9X\nAAPL XCEV7DRELUO6|AAPL R735QTJ8XC9X\nAAPL XZDYPWXPUKG6|AAPL R735QTJ8XC9X\nAAPL 31AKEPJWVFL6U|AAPL R735QTJ8XC9X\nAAPL XDR43YQ5XTZA|AAPL R735QTJ8XC9X\nAAPL XB2MASU4UVT2|AAPL R735QTJ8XC9X\nAAPL 31ARAU8WNH5K6|AAPL R735QTJ8XC9X\nAAPL 31BIVCUN6PGME|AAPL R735QTJ8XC9X\nAAPL 31ARAU8UZXT2E|AAPL R735QTJ8XC9X\nAAPL 31BIVCULJ644M|AAPL R735QTJ8XC9X\nAAPL 31B533X11KSEE|AAPL R735QTJ8XC9X\nAAPL XCEV7DPX0U86|AAPL R735QTJ8XC9X\nAAPL 31BIVD78BWERQ|AAPL R735QTJ8XC9X\nAAPL XCEV7F4IT46E|AAPL R735QTJ8XC9X\nAAPL XCEV7SEH29QE|AAPL R735QTJ8XC9X\nAAPL 31ADIKXSAELBA|AAPL R735QTJ8XC9X\nAAPL XCEV7EW94DPI|AAPL R735QTJ8XC9X\nAAPL 31C3JQSFBFUH2|AAPL R735QTJ8XC9X\nAAPL XCEV7RHEBBUU|AAPL R735QTJ8XC9X\nAAPL 31YHYVCUFVI92|AAPL R735QTJ8XC9X\nAAPL XCEV7RXXOSSM|AAPL R735QTJ8XC9X\nAAPL XCEV7DPR2I6E|AAPL R735QTJ8XC9X\nAAPL 31YHYVCZWAEPY|AAPL R735QTJ8XC9X\nAAPL XDR43YPO2TTY|AAPL R735QTJ8XC9X\nAAPL XCEV7DLMAA3Q|AAPL R735QTJ8XC9X\nAAPL XBGEKJADG2IU|AAPL R735QTJ8XC9X\nAAPL 31AKEPJX7C9AE|AAPL R735QTJ8XC9X\nAAPL 31YHYVCZKDQME|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q91K93A|AAPL R735QTJ8XC9X\nAAPL 31BIVCTO4KNBA|AAPL R735QTJ8XC9X\nAAPL 31AKEPLCGXVFQ|AAPL R735QTJ8XC9X\nAAPL XCEV7QC1VNIE|AAPL R735QTJ8XC9X\nAAPL 31FCPXYENV90M|AAPL R735QTJ8XC9X\nAAPL 31ADILB8UT4UE|AAPL R735QTJ8XC9X\nAAPL XVD806BOZDL2|AAPL R735QTJ8XC9X\nAAPL XBGEK4MT2I5I|AAPL R735QTJ8XC9X\nAAPL 31YHYVCYWKEFA|AAPL R735QTJ8XC9X\nAAPL XCZJLCHLR1JA|AAPL R735QTJ8XC9X\nAAPL 31YHYVCZ8H2IU|AAPL R735QTJ8XC9X\nAAPL 31BIVD7X4YM6E|AAPL R735QTJ8XC9X\nAAPL 31CV49ENVMMX2|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q8DQWW6|AAPL R735QTJ8XC9X\nAAPL 31AY6Z9P4Q8QU|AAPL R735QTJ8XC9X\nAAPL 31BIVCTNYMB9I|AAPL R735QTJ8XC9X\nAAPL 31BBZ87L72ZXI|AAPL R735QTJ8XC9X\nAAPL 31FCPXYGBELIE|AAPL R735QTJ8XC9X\nAAPL XCEV7EXWNQ7A|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q8VLX1I|AAPL R735QTJ8XC9X\nAAPL 31B533K10JPT2|AAPL R735QTJ8XC9X\nAAPL 31BIVCV715MJQ|AAPL R735QTJ8XC9X\nAAPL 31AKEPLATEIXY|AAPL R735QTJ8XC9X\nAAPL 31BBZ87RT8DWM|AAPL R735QTJ8XC9X\nAAPL 31AY6YV18I5FQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2KE9XMU|AAPL R735QTJ8XC9X\nAAPL 31ADIKXQMV8TI|AAPL R735QTJ8XC9X\nAAPL 31ADIKXTXXXT2|AAPL R735QTJ8XC9X\nAAPL 31BIVCV3Q2XK6|AAPL R735QTJ8XC9X\nAAPL 31AY6YV1QD5L2|AAPL R735QTJ8XC9X\nAAPL XVD806BJ11JA|AAPL R735QTJ8XC9X\nAAPL 31BIVCTOGHBEU|AAPL R735QTJ8XC9X\nAAPL 31ARAU7H7X7D2|AAPL R735QTJ8XC9X\nAAPL 31B533X9B9IVA|AAPL R735QTJ8XC9X\nAAPL 31AY6ZA5O3POM|AAPL R735QTJ8XC9X\nAAPL 31BIVD6B95GW6|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q87SKUE|AAPL R735QTJ8XC9X\nAAPL 31BBZ87MUMCFA|AAPL R735QTJ8XC9X\nAAPL XB9IFVQ6WSEE|AAPL R735QTJ8XC9X\nAAPL 31YHYVDOPAGYU|AAPL R735QTJ8XC9X\nAAPL XCEV7FEG1752|AAPL R735QTJ8XC9X\nAAPL XCEV7ERAIC86|AAPL R735QTJ8XC9X\nAAPL XCEV7DLS8M5I|AAPL R735QTJ8XC9X\nAAPL XB9IFWN9NQ9Y|AAPL R735QTJ8XC9X\nAAPL XVD808ELYUSM|AAPL R735QTJ8XC9X\nAAPL 31YHYVCXKXQ12|AAPL R735QTJ8XC9X\nAAPL 31ADILBXNVC92|AAPL R735QTJ8XC9X\nAAPL 31EL5FAP6JHXI|AAPL R735QTJ8XC9X\nAAPL 31AY6ZADXSG5I|AAPL R735QTJ8XC9X\nAAPL 31AY6YWGU0FOM|AAPL R735QTJ8XC9X\nAAPL XZDYPX1OQLMU|AAPL R735QTJ8XC9X\nAAPL XCEV7DPF5U2U|AAPL R735QTJ8XC9X\nAAPL XBGEKK7G70EE|AAPL R735QTJ8XC9X\nAAPL XB9IFVYGLIVA|AAPL R735QTJ8XC9X\nAAPL XVD808G9I7AE|AAPL R735QTJ8XC9X\nAAPL XCEV7EKOCY92|AAPL R735QTJ8XC9X\nAAPL 31C3JQU3UG7DY|AAPL R735QTJ8XC9X\nAAPL XBGEKJZ6I9XI|AAPL R735QTJ8XC9X\nAAPL XCZJLE4N6E06|AAPL R735QTJ8XC9X\nAAPL 31YHYVDN1R4H2|AAPL R735QTJ8XC9X\nAAPL XZDYPX1UOXOM|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q8JP8XY|AAPL R735QTJ8XC9X\nAAPL XB9IFWEZYZT2|AAPL R735QTJ8XC9X\nAAPL 31AKEPLHFJWX2|AAPL R735QTJ8XC9X\nAAPL XBGEKJIN4SZQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVD0E5EVA|AAPL R735QTJ8XC9X\nAAPL 31AKEPJXP79FQ|AAPL R735QTJ8XC9X\nAAPL 31BIVD8DOC346|AAPL R735QTJ8XC9X\nAAPL XCEV7QKBKDZA|AAPL R735QTJ8XC9X\nAAPL 31AY6YV1EGHHI|AAPL R735QTJ8XC9X\nAAPL 31ADILC5XK2PY|AAPL R735QTJ8XC9X\nAAPL 31B533K2O32AU|AAPL R735QTJ8XC9X\nAAPL XZDYPXNUHB3A|AAPL R735QTJ8XC9X\nAAPL XBGEKJQWTJGM|AAPL R735QTJ8XC9X\nAAPL XZDYPX2II9VQ|AAPL R735QTJ8XC9X\nAAPL XZDYPX2CJXTY|AAPL R735QTJ8XC9X\nAAPL 31BIVCV22JL2E|AAPL R735QTJ8XC9X\nAAPL XZDYPWXJW8EE|AAPL R735QTJ8XC9X\nAAPL 31YHYVCXWUE4M|AAPL R735QTJ8XC9X\nAAPL XB9IFVHX81XI|AAPL R735QTJ8XC9X\nAAPL XB9IFW6QA9C6|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q8PNKZQ|AAPL R735QTJ8XC9X\nAAPL XCEV7Q3S6X1I|AAPL R735QTJ8XC9X\nAAPL 31BIVCTPY2BUU|AAPL R735QTJ8XC9X\nAAPL 31AY6YWF6H36U|AAPL R735QTJ8XC9X\nAAPL 31B533XY4BQ9Y|AAPL R735QTJ8XC9X\nAAPL 31BIVD85ENCNA|AAPL R735QTJ8XC9X\nAAPL XBU6TFUH7RDY|AAPL R735QTJ8XC9X\nAAPL XCEV7EJ0TLRA|AAPL R735QTJ8XC9X\nAAPL 31C3JQTVKRGX2|AAPL R735QTJ8XC9X\nAAPL XBGEK4OGLUNA|AAPL R735QTJ8XC9X\nAAPL 31AKEPJXJ8XDY|AAPL R735QTJ8XC9X\nAAPL XCEV7DOXATXI|AAPL R735QTJ8XC9X\nAAPL 31B533ILQY3NQ|AAPL R735QTJ8XC9X\nAAPL 31EL5FAPOEI2U|AAPL R735QTJ8XC9X\nAAPL 31BIVCTKZIFJA|AAPL R735QTJ8XC9X\nAAPL 31FCPXWXWOMFA|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQ0B66E|AAPL R735QTJ8XC9X\nAAPL 31BIVCTNSNZ7Q|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQ69I86|AAPL R735QTJ8XC9X\nAAPL 31CV49EO1KYYU|AAPL R735QTJ8XC9X\nAAPL 31R15TU6YSSJQ|AAPL R735QTJ8XC9X\nAAPL XCEV7EMBWAQU|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQI66BQ|AAPL R735QTJ8XC9X\nAAPL XCEV7DORCHVQ|AAPL R735QTJ8XC9X\nAAPL XCEV7DP395ZA|AAPL R735QTJ8XC9X\nAAPL 31BIVCTKNLRFQ|AAPL R735QTJ8XC9X\nAAPL 31EL5FAJW2XIE|AAPL R735QTJ8XC9X\nAAPL XCEV7DRKK6PY|AAPL R735QTJ8XC9X\nAAPL 31C3JQSFNCIKM|AAPL R735QTJ8XC9X\nAAPL 31BIVD8LY0TL2|AAPL R735QTJ8XC9X\nAAPL 31EL5FAK219K6|AAPL R735QTJ8XC9X\nAAPL 31ARAU7HJTVGM|AAPL R735QTJ8XC9X\nAAPL 31AKEPJX1DX8M|AAPL R735QTJ8XC9X\nAAPL XC12Y2H39DT2|AAPL R735QTJ8XC9X\nAAPL XCEV7ENZFN8M|AAPL R735QTJ8XC9X\nAAPL 31ADILBPE6LS6|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQC7U9Y|AAPL R735QTJ8XC9X\nAAPL 31R15TU6SUGHY|AAPL R735QTJ8XC9X\nAAPL 31C3JQSF5HIFA|AAPL R735QTJ8XC9X\nAAPL XCEV7DOLE5TY|AAPL R735QTJ8XC9X\nAAPL XC12Y2K8BLL2|AAPL R735QTJ8XC9X\nAAPL 31ARAU7HVQJK6|AAPL R735QTJ8XC9X\nAAPL XCEV7R94MLDY|AAPL R735QTJ8XC9X\nAAPL 31BBZ866X7E2U|AAPL R735QTJ8XC9X\nAAPL 31FCPXYBCSK12|AAPL R735QTJ8XC9X\nAAPL 31ADILCE78T6U|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZJI5JA|AAPL R735QTJ8XC9X\nAAPL XCZJLCBNEZRA|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q396JD2|AAPL R735QTJ8XC9X\nAAPL XZDYPX26LLS6|AAPL R735QTJ8XC9X\nAAPL 31YHYVD028QRQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVDQCTTGM|AAPL R735QTJ8XC9X\nAAPL 31AKEPZHUEMDI|AAPL R735QTJ8XC9X\nAAPL 31BIVCV5DMA1Y|AAPL R735QTJ8XC9X\nAAPL 31BBZ8669E1VQ|AAPL R735QTJ8XC9X\nAAPL 31BIVCTQ40NWM|AAPL R735QTJ8XC9X\nAAPL 31YHYVCWR61S6|AAPL R735QTJ8XC9X\nAAPL XBNAORJCA2DI|AAPL R735QTJ8XC9X\nAAPL XBU6TEX8MRS6|AAPL R735QTJ8XC9X\nAAPL XBNAORJ6BQBQ|AAPL R735QTJ8XC9X\nAAPL XCEV7EPMYZQE|AAPL R735QTJ8XC9X\nAAPL XBNAORJI8EFA|AAPL R735QTJ8XC9X\nAAPL XZDYPXM6XYLI|AAPL R735QTJ8XC9X\nAAPL XBNAORD23HNQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAXDI3P9I|AAPL R735QTJ8XC9X\nAAPL XBNAORIUF286|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q2RBJ7Q|AAPL R735QTJ8XC9X\nAAPL XBU6TF3ITCHY|AAPL R735QTJ8XC9X\nAAPL XZDYPXR5K02U|AAPL R735QTJ8XC9X\nAAPL XZDYPXPI0NL2|AAPL R735QTJ8XC9X\nAAPL XBU6TF30YCCM|AAPL R735QTJ8XC9X\nAAPL XZDYPX20N9QE|AAPL R735QTJ8XC9X\nAAPL XBNAP2968N9I|AAPL R735QTJ8XC9X\nAAPL 31BIVCTPS3ZT2|AAPL R735QTJ8XC9X\nAAPL 31H2R3SZVETMU|AAPL R735QTJ8XC9X\nAAPL XBU6TF3CV0G6|AAPL R735QTJ8XC9X\nAAPL XCEV7FCSHUNA|AAPL R735QTJ8XC9X\nAAPL XC7Z34DR5IO6|AAPL R735QTJ8XC9X\nAAPL XZDYPX2OGLXI|AAPL R735QTJ8XC9X\nAAPL 31BIVCVDNB0IU|AAPL R735QTJ8XC9X\nAAPL XBGEKKFPVQVA|AAPL R735QTJ8XC9X\nAAPL XBNAP7ZWF0ZQ|AAPL R735QTJ8XC9X\nAAPL XBU6TF3OROJQ|AAPL R735QTJ8XC9X\nAAPL XC7Z33X7S1QE|AAPL R735QTJ8XC9X\nAAPL XBNAP72TO346|AAPL R735QTJ8XC9X\nAAPL XCZJLE6APQHY|AAPL R735QTJ8XC9X\nAAPL XC12Y2N7HMH2|AAPL R735QTJ8XC9X\nAAPL XC7Z34M0U952|AAPL R735QTJ8XC9X\nAAPL 31BBZ8JFVOE6E|AAPL R735QTJ8XC9X\nAAPL XBNAP7JD1K1Y|AAPL R735QTJ8XC9X\nAAPL 31BBZ8L1RHJGM|AAPL R735QTJ8XC9X\nAAPL XC7Z34UAIZLY|AAPL R735QTJ8XC9X\nAAPL XC7Z35J3L70M|AAPL R735QTJ8XC9X\nAAPL XC7Z33GOEKSM|AAPL R735QTJ8XC9X\nAAPL XC12Y48FFAEE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXK46Y2U|AAPL R735QTJ8XC9X\nAAPL 31BBZ8JWF1V46|AAPL R735QTJ8XC9X\nAAPL XC7Z33OY3B9I|AAPL R735QTJ8XC9X\nAAPL XC7Z352K7Q2U|AAPL R735QTJ8XC9X\nAAPL 31BBZ8JO5D4NA|AAPL R735QTJ8XC9X\nAAPL 31BBZ8KCYFC1Y|AAPL R735QTJ8XC9X\nAAPL XBU6TGPWFCRQ|AAPL R735QTJ8XC9X\nAAPL XC7Z345HGS7A|AAPL R735QTJ8XC9X\nAAPL XBNAP7RMQAIU|AAPL R735QTJ8XC9X\nAAPL 31BBZ8KL842IU|AAPL R735QTJ8XC9X\nAAPL XBNAP7B3CTL2|AAPL R735QTJ8XC9X\nAAPL 31BBZ8LA169XI|AAPL R735QTJ8XC9X\nAAPL 31BBZ8KTHSSZQ|AAPL R735QTJ8XC9X\nAAPL XC12Y2HF61WM|AAPL R735QTJ8XC9X\nAAPL XBU6TGO8W09Y|AAPL R735QTJ8XC9X\nAAPL XC7Z35ATWGJQ|AAPL R735QTJ8XC9X\nAAPL XZDYPWXVSWHY|AAPL R735QTJ8XC9X\nAAPL 31KBXAXKG3M6E|AAPL R735QTJ8XC9X\nAAPL 31R15TU74R4LI|AAPL R735QTJ8XC9X\nAAPL 31BBZ8K4OQLL2|AAPL R735QTJ8XC9X\nAAPL 31BBZ8LIAV0EE|AAPL R735QTJ8XC9X\nAAPL 31AY6YV2W1HXI|AAPL R735QTJ8XC9X\nAAPL XC12Y3JMD2ZQ|AAPL R735QTJ8XC9X\nAAPL 31CV49G5YFXWM|AAPL R735QTJ8XC9X\nAAPL 31AKEPZQ43CUE|AAPL R735QTJ8XC9X\nAAPL 31R15TU55B406|AAPL R735QTJ8XC9X\nAAPL 31AY6YV229TOM|AAPL R735QTJ8XC9X\nAAPL XDR4408EPH0M|AAPL R735QTJ8XC9X\nAAPL 31ARAU8ZYJUJQ|AAPL R735QTJ8XC9X\nAAPL 31CV49G4AWLEU|AAPL R735QTJ8XC9X\nAAPL 31CV49G2ND8X2|AAPL R735QTJ8XC9X\nAAPL XDR44053MS12|AAPL R735QTJ8XC9X\nAAPL XDR4406R64IU|AAPL R735QTJ8XC9X\nAAPL XDR4401SK31I|AAPL R735QTJ8XC9X\nAAPL XDR440BPS606|AAPL R735QTJ8XC9X\nAAPL 31ARAUNAAMMYU|AAPL R735QTJ8XC9X\nAAPL XC12YER5FMBQ|AAPL R735QTJ8XC9X\nAAPL 31CV49G0ZTWFA|AAPL R735QTJ8XC9X\nAAPL XDR440A28TIE|AAPL R735QTJ8XC9X\nAAPL 31ARAU91M371I|AAPL R735QTJ8XC9X\nAAPL XDR440DDBIHY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7HPS7IE|AAPL R735QTJ8XC9X\nAAPL XDR4403G3FJA|AAPL R735QTJ8XC9X\nAAPL 31ARAUNQU03WM|AAPL R735QTJ8XC9X\nAAPL XDR440GOE7HI|AAPL R735QTJ8XC9X\nAAPL 31BPRHIHAGTPI|AAPL R735QTJ8XC9X\nAAPL XCEV7TJTHY2U|AAPL R735QTJ8XC9X\nAAPL 31BPRHIIY067A|AAPL R735QTJ8XC9X\nAAPL 31AY6YV1KETJA|AAPL R735QTJ8XC9X\nAAPL XCLRC2OPCEAU|AAPL R735QTJ8XC9X\nAAPL XCLRCH40187A|AAPL R735QTJ8XC9X\nAAPL 31BPRHVHBHWAU|AAPL R735QTJ8XC9X\nAAPL XCLRC2I370BQ|AAPL R735QTJ8XC9X\nAAPL XCEV7TBJT7LY|AAPL R735QTJ8XC9X\nAAPL 31BPRHUBZ27YE|AAPL R735QTJ8XC9X\nAAPL 31BPRHUSIFOW6|AAPL R735QTJ8XC9X\nAAPL 31BPRHH503DLY|AAPL R735QTJ8XC9X\nAAPL 31BPRHH9SOXVQ|AAPL R735QTJ8XC9X\nAAPL XC12YIFGFDTY|AAPL R735QTJ8XC9X\nAAPL XCLRC2S0F3AE|AAPL R735QTJ8XC9X\nAAPL 31BPRHV0S4FD2|AAPL R735QTJ8XC9X\nAAPL XCLRCFI482X2|AAPL R735QTJ8XC9X\nAAPL XCLRCEL1H51I|AAPL R735QTJ8XC9X\nAAPL XCLRCF9UJCG6|AAPL R735QTJ8XC9X\nAAPL 31AY6ZAUH5X3A|AAPL R735QTJ8XC9X\nAAPL XCLRCFQDWTDY|AAPL R735QTJ8XC9X\nAAPL 31BPRHH9ATXQE|AAPL R735QTJ8XC9X\nAAPL XCLRC2LE9PBA|AAPL R735QTJ8XC9X\nAAPL XCLRC15STK86|AAPL R735QTJ8XC9X\nAAPL XC12YINQ44AU|AAPL R735QTJ8XC9X\nAAPL XCLRCECRSEKM|AAPL R735QTJ8XC9X\nAAPL XCLRC1B3A4NA|AAPL R735QTJ8XC9X\nAAPL XBU6TUN07D8M|AAPL R735QTJ8XC9X\nAAPL 31BPRHUK8QYFA|AAPL R735QTJ8XC9X\nAAPL XCLRC2GFNNTY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7IPI7T2|AAPL R735QTJ8XC9X\nAAPL XC12YI76QND2|AAPL R735QTJ8XC9X\nAAPL XCEV7TS36OJQ|AAPL R735QTJ8XC9X\nAAPL XCLRC1AXBSLI|AAPL R735QTJ8XC9X\nAAPL 31BPRHIKLJIP2|AAPL R735QTJ8XC9X\nAAPL XCLRCGNGNR9I|AAPL R735QTJ8XC9X\nAAPL 31BPRHIFMXH7Q|AAPL R735QTJ8XC9X\nAAPL 31BPRHIM92V6U|AAPL R735QTJ8XC9X\nAAPL XCLRC1ALF4HY|AAPL R735QTJ8XC9X\nAAPL XCLRCGF6Z0SM|AAPL R735QTJ8XC9X\nAAPL XG8PSGV2FFYE|AAPL R735QTJ8XC9X\nAAPL XCLRC2QCVQSM|AAPL R735QTJ8XC9X\nAAPL XCLRC2JQQCTI|AAPL R735QTJ8XC9X\nAAPL 31ARAUNZ3OUDI|AAPL R735QTJ8XC9X\nAAPL XC12Y4A2YMW6|AAPL R735QTJ8XC9X\nAAPL XCLRC1A3K4CM|AAPL R735QTJ8XC9X\nAAPL XBU6TUV9W3PI|AAPL R735QTJ8XC9X\nAAPL 31ARAU7IDLJPI|AAPL R735QTJ8XC9X\nAAPL XBU6TV3JKU6E|AAPL R735QTJ8XC9X\nAAPL 31BPRHV91T5TY|AAPL R735QTJ8XC9X\nAAPL XCLRCGVQCHQE|AAPL R735QTJ8XC9X\nAAPL XCLRC1ARDGJQ|AAPL R735QTJ8XC9X\nAAPL XCLRC2N1T1T2|AAPL R735QTJ8XC9X\nAAPL 31BPRHVPL6MRQ|AAPL R735QTJ8XC9X\nAAPL 31BPRHICBUS86|AAPL R735QTJ8XC9X\nAAPL 31BPRHHAGIA2U|AAPL R735QTJ8XC9X\nAAPL 31BPRHH9MQLTY|AAPL R735QTJ8XC9X\nAAPL XCLRCF1KULZA|AAPL R735QTJ8XC9X\nAAPL XCLRC1BR3GUE|AAPL R735QTJ8XC9X\nAAPL XCLRC19LP47A|AAPL R735QTJ8XC9X\nAAPL 31BPRHH94VLOM|AAPL R735QTJ8XC9X\nAAPL XCLRC1BF6SQU|AAPL R735QTJ8XC9X\nAAPL 31C3JQU26WUW6|AAPL R735QTJ8XC9X\nAAPL XCLRCG6XAABQ|AAPL R735QTJ8XC9X\nAAPL 31BPRHH8SYXL2|AAPL R735QTJ8XC9X\nAAPL 31BPRHH8H29HI|AAPL R735QTJ8XC9X\nAAPL 31BPRHWEE8U6E|AAPL R735QTJ8XC9X\nAAPL XDR440F0UUZQ|AAPL R735QTJ8XC9X\nAAPL XCLRC1AFGSG6|AAPL R735QTJ8XC9X\nAAPL XCLRC2VBHS9Y|AAPL R735QTJ8XC9X\nAAPL 31BIVCUI83F52|AAPL R735QTJ8XC9X\nAAPL 31YHYVD1VQFBA|AAPL R735QTJ8XC9X\nAAPL 31BPRHIDZE4PY|AAPL R735QTJ8XC9X\nAAPL 31BPRHVXUVD8M|AAPL R735QTJ8XC9X\nAAPL 31BPRHHAAJY12|AAPL R735QTJ8XC9X\nAAPL XCLRC19XLSAU|AAPL R735QTJ8XC9X\nAAPL XCLRCFYNLJUU|AAPL R735QTJ8XC9X\nAAPL 31BPRHH8N0LJA|AAPL R735QTJ8XC9X\nAAPL XCLRCETB5VIE|AAPL R735QTJ8XC9X\nAAPL 31AY6ZAM7H6ME|AAPL R735QTJ8XC9X\nAAPL XCLRC15YRW9Y|AAPL R735QTJ8XC9X\nAAPL 31BPRHI90S38M|AAPL R735QTJ8XC9X\nAAPL XCLRC19FQS5I|AAPL R735QTJ8XC9X\nAAPL XCLRCHC9PYO6|AAPL R735QTJ8XC9X\nAAPL 31ARAUN20XWHY|AAPL R735QTJ8XC9X\nAAPL XCLRC2WZ14RQ|AAPL R735QTJ8XC9X\nAAPL XCLRC1BL54SM|AAPL R735QTJ8XC9X\nAAPL 31B533YMXDXOM|AAPL R735QTJ8XC9X\nAAPL XCLRC1B98GP2|AAPL R735QTJ8XC9X\nAAPL XCLRC2TNYFS6|AAPL R735QTJ8XC9X\nAAPL 31BIVD9AR30ZQ|AAPL R735QTJ8XC9X\nAAPL 31BIVCUJVMRMU|AAPL R735QTJ8XC9X\nAAPL XCLRC2ES4BC6|AAPL R735QTJ8XC9X\nAAPL XCLRC29TI9UU|AAPL R735QTJ8XC9X\nAAPL 31AY6YWIHJS6E|AAPL R735QTJ8XC9X\nAAPL 31BPRHIR7OWO6|AAPL R735QTJ8XC9X\nAAPL 31AY6YV2885QE|AAPL R735QTJ8XC9X\nAAPL 31AY6YWK534O6|AAPL R735QTJ8XC9X\nAAPL 31CV49GCKLBVQ|AAPL R735QTJ8XC9X\nAAPL 31CV49GE84ODI|AAPL R735QTJ8XC9X\nAAPL 31BPRHHASEY6E|AAPL R735QTJ8XC9X\nAAPL XCLRC2YMKH9I|AAPL R735QTJ8XC9X\nAAPL 31BPRHIAOBFQE|AAPL R735QTJ8XC9X\nAAPL XC7Z2QN9IW6E|AAPL R735QTJ8XC9X\nAAPL 31AY6YV1WBHMU|AAPL R735QTJ8XC9X\nAAPL XBNAP1SMV6BQ|AAPL R735QTJ8XC9X\nAAPL 31AY6YV2K4TTY|AAPL R735QTJ8XC9X\nAAPL 31BIVD8U7PK1Y|AAPL R735QTJ8XC9X\nAAPL 31BBZ8682VQFA|AAPL R735QTJ8XC9X\nAAPL 31BPRHH8YX9MU|AAPL R735QTJ8XC9X\nAAPL XCEV7ESY1OPY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7C9DB1I|AAPL R735QTJ8XC9X\nAAPL 31AY6ZB2QUNK6|AAPL R735QTJ8XC9X\nAAPL 31AY6YV2Q35VQ|AAPL R735QTJ8XC9X\nAAPL 31BBZ87Q5P1EU|AAPL R735QTJ8XC9X\nAAPL 31YHYVDLE7RZA|AAPL R735QTJ8XC9X\nAAPL 31BIVCTQ9YZYE|AAPL R735QTJ8XC9X\nAAPL 31BPRHH9YN9XI|AAPL R735QTJ8XC9X\nAAPL 31YHYVD1JTR7Q|AAPL R735QTJ8XC9X\nAAPL 31ARAUNIKBDFQ|AAPL R735QTJ8XC9X\nAAPL 31CV49GFVO0VA|AAPL R735QTJ8XC9X\nAAPL 31YHYVD0K3QX2|AAPL R735QTJ8XC9X\nAAPL 31BPRHINWM7OM|AAPL R735QTJ8XC9X\nAAPL XCLRC2BH1MCM|AAPL R735QTJ8XC9X\nAAPL 31EL5FARBXUKM|AAPL R735QTJ8XC9X\nAAPL XCLRC19RNG92|AAPL R735QTJ8XC9X\nAAPL XG8PSGV8DS06|AAPL R735QTJ8XC9X\nAAPL 31FCPXWY2MYH2|AAPL R735QTJ8XC9X\nAAPL 31AY6YUWFWL5Y|AAPL R735QTJ8XC9X\nAAPL 31B533Y6E0GQU|AAPL R735QTJ8XC9X\nAAPL XBU6TFW4R3VQ|AAPL R735QTJ8XC9X\nAAPL 31BPRHHA4LLZA|AAPL R735QTJ8XC9X\nAAPL 31BIVD9RAGHXI|AAPL R735QTJ8XC9X\nAAPL 31B533K7MP3S6|AAPL R735QTJ8XC9X\nAAPL 31CV49GAX1ZDY|AAPL R735QTJ8XC9X\nAAPL 31BPRHW64K3PI|AAPL R735QTJ8XC9X\nAAPL 31BWNM61H03TY|AAPL R735QTJ8XC9X\nAAPL XCSNGOUA3EH2|AAPL R735QTJ8XC9X\nAAPL XCEV7DLGBY1Y|AAPL R735QTJ8XC9X\nAAPL XCSNH3ZDIAX2|AAPL R735QTJ8XC9X\nAAPL 31BWNM4TT9VYE|AAPL R735QTJ8XC9X\nAAPL 31BWNMIT8CFYE|AAPL R735QTJ8XC9X\nAAPL XCSNGOUXWQO6|AAPL R735QTJ8XC9X\nAAPL XZDYPX2UEXZA|AAPL R735QTJ8XC9X\nAAPL XCSNH4O6KIBQ|AAPL R735QTJ8XC9X\nAAPL XCSNGOV9TERQ|AAPL R735QTJ8XC9X\nAAPL XBU6TVK2YB46|AAPL R735QTJ8XC9X\nAAPL XCSNGQAJF0X2|AAPL R735QTJ8XC9X\nAAPL 31BWNMICOYZ0M|AAPL R735QTJ8XC9X\nAAPL XCSNGQ78CBXI|AAPL R735QTJ8XC9X\nAAPL XCSNGOV3V2PY|AAPL R735QTJ8XC9X\nAAPL 31BWNM4TZ8806|AAPL R735QTJ8XC9X\nAAPL XCSNH3IU4TZA|AAPL R735QTJ8XC9X\nAAPL XCSNGOURYEME|AAPL R735QTJ8XC9X\nAAPL 31CV49G7LZAEE|AAPL R735QTJ8XC9X\nAAPL 31H2R3T0J85TY|AAPL R735QTJ8XC9X\nAAPL 31ARAU7IJJVRA|AAPL R735QTJ8XC9X\nAAPL XCSNGQC6YDEU|AAPL R735QTJ8XC9X\nAAPL XCSNH4WG98SM|AAPL R735QTJ8XC9X\nAAPL XCSNH3R3TKG6|AAPL R735QTJ8XC9X\nAAPL XCSNH32ARD1I|AAPL R735QTJ8XC9X\nAAPL XC12YIVZSURQ|AAPL R735QTJ8XC9X\nAAPL 31AY6YWLSMH5Y|AAPL R735QTJ8XC9X\nAAPL XCEV7U0CVF0M|AAPL R735QTJ8XC9X\nAAPL 31BWNM634JGBQ|AAPL R735QTJ8XC9X\nAAPL XCSNH5CZMPQE|AAPL R735QTJ8XC9X\nAAPL 31BPRHX37B1L2|AAPL R735QTJ8XC9X\nAAPL 31BWNM4THD7UU|AAPL R735QTJ8XC9X\nAAPL 31BIVD9J0RRGM|AAPL R735QTJ8XC9X\nAAPL 31BIVD92HEAIU|AAPL R735QTJ8XC9X\nAAPL XCEV7U8MK5HI|AAPL R735QTJ8XC9X\nAAPL XCSNH2LRDW3Q|AAPL R735QTJ8XC9X\nAAPL 31BWNMI4FA8JQ|AAPL R735QTJ8XC9X\nAAPL 31BWNMJ1I16FA|AAPL R735QTJ8XC9X\nAAPL 31BWNM4P6MNQE|AAPL R735QTJ8XC9X\nAAPL XCSNH3AKG3IE|AAPL R735QTJ8XC9X\nAAPL XCSNH47N71DY|AAPL R735QTJ8XC9X\nAAPL 31BWNMIKYNPHI|AAPL R735QTJ8XC9X\nAAPL XCSNH4FWVRUU|AAPL R735QTJ8XC9X\nAAPL XCSNGQ5KSZFQ|AAPL R735QTJ8XC9X\nAAPL XBU6TVBT9KNA|AAPL R735QTJ8XC9X\nAAPL 31BWNMJI1END2|AAPL R735QTJ8XC9X\nAAPL XCSNGOPZCUCM|AAPL R735QTJ8XC9X\nAAPL XCSNGQ8VVOFA|AAPL R735QTJ8XC9X\nAAPL 31BWNMJ9RPWW6|AAPL R735QTJ8XC9X\nAAPL 31BWNM64S2STI|AAPL R735QTJ8XC9X\nAAPL 31EL5FAR016H2|AAPL R735QTJ8XC9X\nAAPL 31JKCSB7X0SJQ|AAPL R735QTJ8XC9X\nAAPL XKGCMV8DUB2E|AAPL R735QTJ8XC9X\nAAPL 31JKCSB4G1WO6|AAPL R735QTJ8XC9X\nAAPL XKGCMV91NN9I|AAPL R735QTJ8XC9X\nAAPL XKGCMV9DKBD2|AAPL R735QTJ8XC9X\nAAPL 31JKCSB7L44G6|AAPL R735QTJ8XC9X\nAAPL XCSNGQ3X9MXY|AAPL R735QTJ8XC9X\nAAPL XCLRCHST3FLY|AAPL R735QTJ8XC9X\nAAPL 31JKCSB88XGNA|AAPL R735QTJ8XC9X\nAAPL XCSNGOTMA29Y|AAPL R735QTJ8XC9X\nAAPL 31BWNM4SNLJLY|AAPL R735QTJ8XC9X\nAAPL XKGCMV58S3AE|AAPL R735QTJ8XC9X\nAAPL XCSNGOTY6QDI|AAPL R735QTJ8XC9X\nAAPL XKGCMVADABNQ|AAPL R735QTJ8XC9X\nAAPL 31BWNM66FM5BA|AAPL R735QTJ8XC9X\nAAPL 31JKCSB8QSGSM|AAPL R735QTJ8XC9X\nAAPL 31BWNMJYKS4AU|AAPL R735QTJ8XC9X\nAAPL 31JKCSB92P4W6|AAPL R735QTJ8XC9X\nAAPL 31B533YENP77Q|AAPL R735QTJ8XC9X\nAAPL XKGCMVAP6ZRA|AAPL R735QTJ8XC9X\nAAPL XCSNH2U12MKM|AAPL R735QTJ8XC9X\nAAPL 31JKCSB9ELSZQ|AAPL R735QTJ8XC9X\nAAPL 31BIVDA7TTYVA|AAPL R735QTJ8XC9X\nAAPL XKGCMVAJ8NPI|AAPL R735QTJ8XC9X\nAAPL 31C3JQU0JDIEE|AAPL R735QTJ8XC9X\nAAPL 31JKCSB98NGXY|AAPL R735QTJ8XC9X\nAAPL XCSNGQFI12EE|AAPL R735QTJ8XC9X\nAAPL 31BWNM4SZI7PI|AAPL R735QTJ8XC9X\nAAPL 31JKCSB82Z4LI|AAPL R735QTJ8XC9X\nAAPL 31BWNMKF45L8M|AAPL R735QTJ8XC9X\nAAPL XCLRC199SG3Q|AAPL R735QTJ8XC9X\nAAPL XKGCMV5EQFC6|AAPL R735QTJ8XC9X\nAAPL XCSNGOTS8EBQ|AAPL R735QTJ8XC9X\nAAPL XCSNGQ29QAG6|AAPL R735QTJ8XC9X\nAAPL XKGCMV9VFBIE|AAPL R735QTJ8XC9X\nAAPL 31BWNM5T7BDD2|AAPL R735QTJ8XC9X\nAAPL XKGCMVA7BZLY|AAPL R735QTJ8XC9X\nAAPL XKGCMVB71ZWM|AAPL R735QTJ8XC9X\nAAPL XKGCMVB13NUU|AAPL R735QTJ8XC9X\nAAPL 31JKCSB8KU4QU|AAPL R735QTJ8XC9X\nAAPL XCSNGOVROEX2|AAPL R735QTJ8XC9X\nAAPL XKGCMV8JSN46|AAPL R735QTJ8XC9X\nAAPL XCSNGQDUHPWM|AAPL R735QTJ8XC9X\nAAPL 31BWNM4T5GJRA|AAPL R735QTJ8XC9X\nAAPL XCSNGOTGBQ86|AAPL R735QTJ8XC9X\nAAPL 31BWNM4UB4W3Q|AAPL R735QTJ8XC9X\nAAPL XKGCMV8VPB7Q|AAPL R735QTJ8XC9X\nAAPL XKGCMVBIYO06|AAPL R735QTJ8XC9X\nAAPL 31BWNM5Y5XEUE|AAPL R735QTJ8XC9X\nAAPL 31BWNM5ZTGRC6|AAPL R735QTJ8XC9X\nAAPL 31H2R3SUEZX5Y|AAPL R735QTJ8XC9X\nAAPL 31BWNMJQB3DTY|AAPL R735QTJ8XC9X\nAAPL 31JKCSB8EVSP2|AAPL R735QTJ8XC9X\nAAPL 31BWNM4TBEVT2|AAPL R735QTJ8XC9X\nAAPL 31BWNM5UUUPUU|AAPL R735QTJ8XC9X\nAAPL 31B533ILWWFPI|AAPL R735QTJ8XC9X\nAAPL 31JKCSB7R2GHY|AAPL R735QTJ8XC9X\nAAPL 31BPRHWUXMB46|AAPL R735QTJ8XC9X\nAAPL XKGCMVA1DNK6|AAPL R735QTJ8XC9X\nAAPL XKGCMV9JINEU|AAPL R735QTJ8XC9X\nAAPL XKGCMVAV5BT2|AAPL R735QTJ8XC9X\nAAPL XCLRCHKJEP52|AAPL R735QTJ8XC9X\nAAPL 31BWNM4STJVNQ|AAPL R735QTJ8XC9X\nAAPL 31B533YV72O5I|AAPL R735QTJ8XC9X\nAAPL XCSNGOUM02KM|AAPL R735QTJ8XC9X\nAAPL XKGCMV97LZBA|AAPL R735QTJ8XC9X\nAAPL XCSNGPVNKWH2|AAPL R735QTJ8XC9X\nAAPL XC7Z2Q13UBVQ|AAPL R735QTJ8XC9X\nAAPL XKGCMVBOX01Y|AAPL R735QTJ8XC9X\nAAPL XZDYPY12S31I|AAPL R735QTJ8XC9X\nAAPL 31YHYVE0A1WFA|AAPL R735QTJ8XC9X\nAAPL XCSNH2580F5Y|AAPL R735QTJ8XC9X\nAAPL 31BWNM5WIE2CM|AAPL R735QTJ8XC9X\nAAPL XCSNH2DHP5MU|AAPL R735QTJ8XC9X\nAAPL XCSNGQ0M6XYE|AAPL R735QTJ8XC9X\nAAPL XC12YJ49HL8M|AAPL R735QTJ8XC9X\nAAPL 31JKCSBAQ8HDY|AAPL R735QTJ8XC9X\nAAPL XCSNGOVFRQTI|AAPL R735QTJ8XC9X\nAAPL 31KBXAXKM1Y86|AAPL R735QTJ8XC9X\nAAPL XCSNGOVXMQYU|AAPL R735QTJ8XC9X\nAAPL 31B533IGMFVAE|AAPL R735QTJ8XC9X\nAAPL XCSNGOU452FA|AAPL R735QTJ8XC9X\nAAPL 31B533K9A8G9Y|AAPL R735QTJ8XC9X\nAAPL XKGCMVC6S07A|AAPL R735QTJ8XC9X\nAAPL XKGCMVCCQC92|AAPL R735QTJ8XC9X\nAAPL 31BPRHH8B3XFQ|AAPL R735QTJ8XC9X\nAAPL 31JKCSB6RCG7A|AAPL R735QTJ8XC9X\nAAPL XCSNGQH5KEW6|AAPL R735QTJ8XC9X\nAAPL 31BWNM69QOUAU|AAPL R735QTJ8XC9X\nAAPL 31BWNM6BE86SM|AAPL R735QTJ8XC9X\nAAPL XCSNGOVLQ2VA|AAPL R735QTJ8XC9X\nAAPL XCSNH54PXZ9I|AAPL R735QTJ8XC9X\nAAPL 31BWNM6835HT2|AAPL R735QTJ8XC9X\nAAPL 31BWNM4SHN7K6|AAPL R735QTJ8XC9X\nAAPL XKGCMV8PQZ5Y|AAPL R735QTJ8XC9X\nAAPL XKGCMV52TR8M|AAPL R735QTJ8XC9X\nAAPL 31JKCSB7F5SEE|AAPL R735QTJ8XC9X\nAAPL 31BWNMK6UGURQ|AAPL R735QTJ8XC9X\nAAPL XKGCMVXOPDGM|AAPL R735QTJ8XC9X\nAAPL XKGCMVC0TO5I|AAPL R735QTJ8XC9X\nAAPL 31BPRHXJQOIIU|AAPL R735QTJ8XC9X\nAAPL 31BWNM4U56K1Y|AAPL R735QTJ8XC9X\nAAPL 31JKCSB4A3KME|AAPL R735QTJ8XC9X\nAAPL XKGCMV7K2MTI|AAPL R735QTJ8XC9X\nAAPL XCSNGPXB48YU|AAPL R735QTJ8XC9X\nAAPL 31BWNM4UH385I|AAPL R735QTJ8XC9X\nAAPL 31B533IMERFUU|AAPL R735QTJ8XC9X\nAAPL XKGCMV87VZ0M|AAPL R735QTJ8XC9X\nAAPL 31BIVCVAC8BJA|AAPL R735QTJ8XC9X\nAAPL 31JKCSBYJIJC6|AAPL R735QTJ8XC9X\nAAPL 31AY6ZBJA84HY|AAPL R735QTJ8XC9X\nAAPL XKGCMW0ZS2G6|AAPL R735QTJ8XC9X\nAAPL 31YHYVD21ORD2|AAPL R735QTJ8XC9X\nAAPL XKGCMVBUVC3Q|AAPL R735QTJ8XC9X\nAAPL 31BIVCTQLVO1Y|AAPL R735QTJ8XC9X\nAAPL 31BPRHI7D8QQU|AAPL R735QTJ8XC9X\nAAPL 31BPRHWMNXKNA|AAPL R735QTJ8XC9X\nAAPL 31CAFVU5V3QO6|AAPL R735QTJ8XC9X\nAAPL XD6FQ1GK0XNQ|AAPL R735QTJ8XC9X\nAAPL XCSNGPYYNLGM|AAPL R735QTJ8XC9X\nAAPL XD6FQEEXINRA|AAPL R735QTJ8XC9X\nAAPL XHYQYEDSC9RA|AAPL R735QTJ8XC9X\nAAPL XKGCMWJ6OVVQ|AAPL R735QTJ8XC9X\nAAPL XD6FQ1BLEW6E|AAPL R735QTJ8XC9X\nAAPL XD6FQEVGW4P2|AAPL R735QTJ8XC9X\nAAPL XD6FQ1EWHL5Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5BW3Z4SM|AAPL R735QTJ8XC9X\nAAPL XD6FQDQ4GGCM|AAPL R735QTJ8XC9X\nAAPL 31CAFVFYU5SEE|AAPL R735QTJ8XC9X\nAAPL XFH59W3FDM5I|AAPL R735QTJ8XC9X\nAAPL XKGCMWPSU9UU|AAPL R735QTJ8XC9X\nAAPL 31H2R3U8101NQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFYI94AU|AAPL R735QTJ8XC9X\nAAPL XFH59W1RU9NQ|AAPL R735QTJ8XC9X\nAAPL 31JKCSB4M08PY|AAPL R735QTJ8XC9X\nAAPL 31CAFVH5U2O2U|AAPL R735QTJ8XC9X\nAAPL XD6FQG0TBT1I|AAPL R735QTJ8XC9X\nAAPL 31CAFVT8SCSSM|AAPL R735QTJ8XC9X\nAAPL XFH59W52WYNA|AAPL R735QTJ8XC9X\nAAPL XKGCMWMHRKVA|AAPL R735QTJ8XC9X\nAAPL 31EL5FC0Z431I|AAPL R735QTJ8XC9X\nAAPL XD6FPZZMVZ0M|AAPL R735QTJ8XC9X\nAAPL 31EL5FBXO1E1Y|AAPL R735QTJ8XC9X\nAAPL XG8PSHIDUHRA|AAPL R735QTJ8XC9X\nAAPL 31H2R3T0D9TS6|AAPL R735QTJ8XC9X\nAAPL XKGCMWO5AXD2|AAPL R735QTJ8XC9X\nAAPL 31CAFVH955D2E|AAPL R735QTJ8XC9X\nAAPL XD6FQFSJN2KM|AAPL R735QTJ8XC9X\nAAPL XCLRC2D4KYUE|AAPL R735QTJ8XC9X\nAAPL XFH59W04AX5Y|AAPL R735QTJ8XC9X\nAAPL 31CAFVUE4SH52|AAPL R735QTJ8XC9X\nAAPL 31H2R3UCZM352|AAPL R735QTJ8XC9X\nAAPL 31CAFVTPBQ9QE|AAPL R735QTJ8XC9X\nAAPL 31EL5FBZBKQJQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFYO7GCM|AAPL R735QTJ8XC9X\nAAPL 31CAFVUMEH7LY|AAPL R735QTJ8XC9X\nAAPL XD6FQ18AC76U|AAPL R735QTJ8XC9X\nAAPL 31EL5FC2MNFJA|AAPL R735QTJ8XC9X\nAAPL 31CAFVHASOPK6|AAPL R735QTJ8XC9X\nAAPL XHYQYEAH9KRQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVTXLF07A|AAPL R735QTJ8XC9X\nAAPL 31CAFVH7HM0KM|AAPL R735QTJ8XC9X\nAAPL XHYQYEC4SX9I|AAPL R735QTJ8XC9X\nAAPL XD6FPZZGXMYU|AAPL R735QTJ8XC9X\nAAPL 31CAFVFXUFS3Q|AAPL R735QTJ8XC9X\nAAPL XD6FQDYE56TI|AAPL R735QTJ8XC9X\nAAPL XD6FQF3QKV5Y|AAPL R735QTJ8XC9X\nAAPL 31CAFVFY6CG7A|AAPL R735QTJ8XC9X\nAAPL 31H2R3UBC2QNA|AAPL R735QTJ8XC9X\nAAPL XD6FQEN77E86|AAPL R735QTJ8XC9X\nAAPL XD6FQFK9YC3Q|AAPL R735QTJ8XC9X\nAAPL XFH59VYGRKO6|AAPL R735QTJ8XC9X\nAAPL 31CAFVH46JBL2|AAPL R735QTJ8XC9X\nAAPL XD6FPZZAZAX2|AAPL R735QTJ8XC9X\nAAPL XD6FQD9L2ZEU|AAPL R735QTJ8XC9X\nAAPL XD6FPZZ50YVA|AAPL R735QTJ8XC9X\nAAPL 31EL5FC4A6S12|AAPL R735QTJ8XC9X\nAAPL XD6FQFC09LMU|AAPL R735QTJ8XC9X\nAAPL XD6FQ1D8Y8O6|AAPL R735QTJ8XC9X\nAAPL 31CAFVFTJP7ZA|AAPL R735QTJ8XC9X\nAAPL XHYQYEFFVM92|AAPL R735QTJ8XC9X\nAAPL XKGCMVZC8PYE|AAPL R735QTJ8XC9X\nAAPL XD6FPZYZ2MTI|AAPL R735QTJ8XC9X\nAAPL 31H2R3U9OJE5I|AAPL R735QTJ8XC9X\nAAPL XD6FQE6NTXAE|AAPL R735QTJ8XC9X\nAAPL 31CAFVFYCAS92|AAPL R735QTJ8XC9X\nAAPL XD6FQDHURPVQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFWUPRT2|AAPL R735QTJ8XC9X\nAAPL 31JKCSB9QIH3A|AAPL R735QTJ8XC9X\nAAPL XD6FPZUCFELI|AAPL R735QTJ8XC9X\nAAPL XD6FPZZSUB2E|AAPL R735QTJ8XC9X\nAAPL XD6FQ00APB7Q|AAPL R735QTJ8XC9X\nAAPL 31JKCSB7394AU|AAPL R735QTJ8XC9X\nAAPL 31CAFVFXCKRYE|AAPL R735QTJ8XC9X\nAAPL 31B533K4BMESM|AAPL R735QTJ8XC9X\nAAPL 31JKCSCK1I1RA|AAPL R735QTJ8XC9X\nAAPL 31CAFVUUO5Y2U|AAPL R735QTJ8XC9X\nAAPL XD6FPZXNFYFA|AAPL R735QTJ8XC9X\nAAPL XD6FPZUIDQNA|AAPL R735QTJ8XC9X\nAAPL XD6FQ14Z9I7A|AAPL R735QTJ8XC9X\nAAPL 31BWNM5RJS0VA|AAPL R735QTJ8XC9X\nAAPL XD6FQ1LIMZ52|AAPL R735QTJ8XC9X\nAAPL 31CAFVTH21J9I|AAPL R735QTJ8XC9X\nAAPL XD6FQ1N66BMU|AAPL R735QTJ8XC9X\nAAPL 31CAFVT0IO2BQ|AAPL R735QTJ8XC9X\nAAPL 31R15TU5H7S3Q|AAPL R735QTJ8XC9X\nAAPL 31CAFVFXOHG1Y|AAPL R735QTJ8XC9X\nAAPL XHYQYE8TQ89Y|AAPL R735QTJ8XC9X\nAAPL 31JKCSC071VTY|AAPL R735QTJ8XC9X\nAAPL 31CAFVFX6MFWM|AAPL R735QTJ8XC9X\nAAPL XD6FQ1I7KA5I|AAPL R735QTJ8XC9X\nAAPL 31CAFVFXIJ406|AAPL R735QTJ8XC9X\nAAPL XD6FQ100NGPY|AAPL R735QTJ8XC9X\nAAPL XD6FQ11O6T7Q|AAPL R735QTJ8XC9X\nAAPL 31R15TTZOW7JA|AAPL R735QTJ8XC9X\nAAPL XD6FPZZYSN46|AAPL R735QTJ8XC9X\nAAPL XD6FQ1JV3MNA|AAPL R735QTJ8XC9X\nAAPL XD6FQ19XVJOM|AAPL R735QTJ8XC9X\nAAPL 31CAFVHCG821Y|AAPL R735QTJ8XC9X\nAAPL 31CAFVH2IZZ3A|AAPL R735QTJ8XC9X\nAAPL XD6FPZYB9AME|AAPL R735QTJ8XC9X\nAAPL 31B533IM2URRA|AAPL R735QTJ8XC9X\nAAPL 31H2R3SU91L46|AAPL R735QTJ8XC9X\nAAPL 31BPRHH561PNQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVHFRAR1I|AAPL R735QTJ8XC9X\nAAPL 31CAFVH0VGMLI|AAPL R735QTJ8XC9X\nAAPL XD6FQ16MSUP2|AAPL R735QTJ8XC9X\nAAPL 31JKCSCLP1E92|AAPL R735QTJ8XC9X\nAAPL 31JKCSCIDYP9I|AAPL R735QTJ8XC9X\nAAPL XD6FQ004QZ5Y|AAPL R735QTJ8XC9X\nAAPL XKGCMWKU88DI|AAPL R735QTJ8XC9X\nAAPL 31OJK5BPHVVZA|AAPL R735QTJ8XC9X\nAAPL 31CAFVGZ7XA3Q|AAPL R735QTJ8XC9X\nAAPL XD6FPZYN5YPY|AAPL R735QTJ8XC9X\nAAPL 31BWNMHW5LI2U|AAPL R735QTJ8XC9X\nAAPL 31JKCSBA2F56U|AAPL R735QTJ8XC9X\nAAPL 31JKCSB6XAS92|AAPL R735QTJ8XC9X\nAAPL 31CAFVFX0O3UU|AAPL R735QTJ8XC9X\nAAPL XD6FQ0YD4486|AAPL R735QTJ8XC9X\nAAPL XD6FQ13BQ5PI|AAPL R735QTJ8XC9X\nAAPL 31B533Z3GREME|AAPL R735QTJ8XC9X\nAAPL 31CAFVFWORFRA|AAPL R735QTJ8XC9X\nAAPL 31JKCSBA8DH8M|AAPL R735QTJ8XC9X\nAAPL XKGCMVCIOOAU|AAPL R735QTJ8XC9X\nAAPL XD6FPZYH7MO6|AAPL R735QTJ8XC9X\nAAPL XD6FPZXZCMIU|AAPL R735QTJ8XC9X\nAAPL 31CAFVGXKDXLY|AAPL R735QTJ8XC9X\nAAPL 31BPRHIPK5K6E|AAPL R735QTJ8XC9X\nAAPL 31JKCSBWVZ6UE|AAPL R735QTJ8XC9X\nAAPL 31CAFVVJH85HI|AAPL R735QTJ8XC9X\nAAPL 31UH85MA8FURQ|AAPL R735QTJ8XC9X\nAAPL XD6FPZXTEAH2|AAPL R735QTJ8XC9X\nAAPL 31CAFVVB7JF0M|AAPL R735QTJ8XC9X\nAAPL 31CAFVGU9B8ME|AAPL R735QTJ8XC9X\nAAPL 31DMOS0W3WR9I|AAPL R735QTJ8XC9X\nAAPL XDDBUNEIYOPY|AAPL R735QTJ8XC9X\nAAPL 31DMOS1UU4WH2|AAPL R735QTJ8XC9X\nAAPL XD6FQD1BE8XY|AAPL R735QTJ8XC9X\nAAPL 31CHC0H18KTDY|AAPL R735QTJ8XC9X\nAAPL 31CHC03DQ8I3Q|AAPL R735QTJ8XC9X\nAAPL XD6FQG930JIE|AAPL R735QTJ8XC9X\nAAPL 31DMOS1T6LJZA|AAPL R735QTJ8XC9X\nAAPL 31CHC03J0P2IU|AAPL R735QTJ8XC9X\nAAPL 31DMOS0VG3F2E|AAPL R735QTJ8XC9X\nAAPL XDDBUNJNGX3A|AAPL R735QTJ8XC9X\nAAPL 31CHC0IN4DYO6|AAPL R735QTJ8XC9X\nAAPL XEIOMKWKQ9S6|AAPL R735QTJ8XC9X\nAAPL 31DMOS0W9V3BA|AAPL R735QTJ8XC9X\nAAPL XEIOMKRM6DGM|AAPL R735QTJ8XC9X\nAAPL XEIOMKWQOLTY|AAPL R735QTJ8XC9X\nAAPL 31DMOS0VXYF7Q|AAPL R735QTJ8XC9X\nAAPL 31CHC03IIU2DI|AAPL R735QTJ8XC9X\nAAPL XEIOMKX8JLZA|AAPL R735QTJ8XC9X\nAAPL XDDBUNJZDL6U|AAPL R735QTJ8XC9X\nAAPL XEIOMKXKGA2U|AAPL R735QTJ8XC9X\nAAPL 31CHC03I0Z286|AAPL R735QTJ8XC9X\nAAPL 31CHC04YAAOO6|AAPL R735QTJ8XC9X\nAAPL 31DMOS1ZSQXYE|AAPL R735QTJ8XC9X\nAAPL XEIOMKWERXQE|AAPL R735QTJ8XC9X\nAAPL 31DMOS1Y57LGM|AAPL R735QTJ8XC9X\nAAPL 31DMOS24RCZFQ|AAPL R735QTJ8XC9X\nAAPL XEIOMM5K361Y|AAPL R735QTJ8XC9X\nAAPL XDDBUP0QK7S6|AAPL R735QTJ8XC9X\nAAPL XEIOMM8V5V1I|AAPL R735QTJ8XC9X\nAAPL 31BBZ860YXHGM|AAPL R735QTJ8XC9X\nAAPL XDDBV3T9JTMU|AAPL R735QTJ8XC9X\nAAPL 31DMOS0UMBQTI|AAPL R735QTJ8XC9X\nAAPL 31DMOS0QTG6UE|AAPL R735QTJ8XC9X\nAAPL XEIOMKWWMXVQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNJHIL1I|AAPL R735QTJ8XC9X\nAAPL XDDBUOVRY6AU|AAPL R735QTJ8XC9X\nAAPL 31CHC04UZ7ZOM|AAPL R735QTJ8XC9X\nAAPL 31DMOS2BDIDEU|AAPL R735QTJ8XC9X\nAAPL XEIOMMISDY06|AAPL R735QTJ8XC9X\nAAPL 31UH85M92RIFA|AAPL R735QTJ8XC9X\nAAPL XEIOMMC68K12|AAPL R735QTJ8XC9X\nAAPL 31CHC04Q0LY7A|AAPL R735QTJ8XC9X\nAAPL XEIOMMDTRWIU|AAPL R735QTJ8XC9X\nAAPL 31CHC04TBON6U|AAPL R735QTJ8XC9X\nAAPL 31DMOS29PZ0X2|AAPL R735QTJ8XC9X\nAAPL 31BIVCVBZRO12|AAPL R735QTJ8XC9X\nAAPL 31CHC03ICVQBQ|AAPL R735QTJ8XC9X\nAAPL XDDBUOU4ETT2|AAPL R735QTJ8XC9X\nAAPL 31DMOS0U4GQO6|AAPL R735QTJ8XC9X\nAAPL XDDBUOXFHISM|AAPL R735QTJ8XC9X\nAAPL XDDBUNJBK8ZQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNJTF952|AAPL R735QTJ8XC9X\nAAPL XEIOMKW8TLOM|AAPL R735QTJ8XC9X\nAAPL 31DMOS233TMXY|AAPL R735QTJ8XC9X\nAAPL XDDBV2FNFETI|AAPL R735QTJ8XC9X\nAAPL XDDBV27DQOCM|AAPL R735QTJ8XC9X\nAAPL XDDBUNITP8UE|AAPL R735QTJ8XC9X\nAAPL 31DMOS0USA2VA|AAPL R735QTJ8XC9X\nAAPL 31DMOS26EWBXI|AAPL R735QTJ8XC9X\nAAPL 31DMOS21GAAG6|AAPL R735QTJ8XC9X\nAAPL XEIOMMFHB90M|AAPL R735QTJ8XC9X\nAAPL 31DMOS0UGDERQ|AAPL R735QTJ8XC9X\nAAPL 31CHC0IEUP87A|AAPL R735QTJ8XC9X\nAAPL XDDBUOSGVHBA|AAPL R735QTJ8XC9X\nAAPL XEIOMM77MIJQ|AAPL R735QTJ8XC9X\nAAPL XEIOMKRS4PIE|AAPL R735QTJ8XC9X\nAAPL XEIOMM0LH4KM|AAPL R735QTJ8XC9X\nAAPL 31DMOS0UY8EX2|AAPL R735QTJ8XC9X\nAAPL 31B533IM8T3T2|AAPL R735QTJ8XC9X\nAAPL XDDBV2NX45AE|AAPL R735QTJ8XC9X\nAAPL XEIOMMAIP7JA|AAPL R735QTJ8XC9X\nAAPL 31DMOS0VM1R46|AAPL R735QTJ8XC9X\nAAPL 31JKCSBBVWTQE|AAPL R735QTJ8XC9X\nAAPL XEIOMKX2L9XI|AAPL R735QTJ8XC9X\nAAPL 31CHC03IOSEFA|AAPL R735QTJ8XC9X\nAAPL 31DMOS282FOFA|AAPL R735QTJ8XC9X\nAAPL XC7Z2QIAWUP2|AAPL R735QTJ8XC9X\nAAPL XEIOMMKFXAHY|AAPL R735QTJ8XC9X\nAAPL XKGCMVCON0CM|AAPL R735QTJ8XC9X\nAAPL 31JKCSCNCKQQU|AAPL R735QTJ8XC9X\nAAPL XDDBUOZ30VAE|AAPL R735QTJ8XC9X\nAAPL XDDBV2W6SVRA|AAPL R735QTJ8XC9X\nAAPL 31DMOS0VS035Y|AAPL R735QTJ8XC9X\nAAPL 31DMOS0V46QYU|AAPL R735QTJ8XC9X\nAAPL 31CHC04MPJ97Q|AAPL R735QTJ8XC9X\nAAPL XEIOMKXEHY12|AAPL R735QTJ8XC9X\nAAPL 31CHC03HP2E4M|AAPL R735QTJ8XC9X\nAAPL XDDBV3CQ6CP2|AAPL R735QTJ8XC9X\nAAPL XEIOMMH4ULIE|AAPL R735QTJ8XC9X\nAAPL XDDBUNKBA9AE|AAPL R735QTJ8XC9X\nAAPL 31H2R3T1135ZA|AAPL R735QTJ8XC9X\nAAPL XDDBUNKH8LC6|AAPL R735QTJ8XC9X\nAAPL 31CHC03HV0Q6E|AAPL R735QTJ8XC9X\nAAPL 31DMOS2D11PWM|AAPL R735QTJ8XC9X\nAAPL 31CHC04L1ZWPY|AAPL R735QTJ8XC9X\nAAPL 31CHC0IVE2P52|AAPL R735QTJ8XC9X\nAAPL 31DMOS0WFTFD2|AAPL R735QTJ8XC9X\nAAPL 31CHC0H9I9JUU|AAPL R735QTJ8XC9X\nAAPL 31CHC0HYBBR9I|AAPL R735QTJ8XC9X\nAAPL 31CHC03HD5Q12|AAPL R735QTJ8XC9X\nAAPL 31CHC04RO5AP2|AAPL R735QTJ8XC9X\nAAPL XDDBV34GHM86|AAPL R735QTJ8XC9X\nAAPL XEIOMKV93LDY|AAPL R735QTJ8XC9X\nAAPL 31DMOS0QNHUSM|AAPL R735QTJ8XC9X\nAAPL 31DMOS2EOL2EE|AAPL R735QTJ8XC9X\nAAPL XDDBUP2E3K9Y|AAPL R735QTJ8XC9X\nAAPL 31DMOS1WHO8YU|AAPL R735QTJ8XC9X\nAAPL XEIOMM3WJTK6|AAPL R735QTJ8XC9X\nAAPL 31CHC0HQ1N0SM|AAPL R735QTJ8XC9X\nAAPL XDDBV1Z41XVQ|AAPL R735QTJ8XC9X\nAAPL 31DMOS0WLRREU|AAPL R735QTJ8XC9X\nAAPL 31CHC0GSYW2X2|AAPL R735QTJ8XC9X\nAAPL 31CHC0HHRYABQ|AAPL R735QTJ8XC9X\nAAPL 31CHC04G3DV8M|AAPL R735QTJ8XC9X\nAAPL XEIOMKVF1XFQ|AAPL R735QTJ8XC9X\nAAPL 31CHC0I6L0HQE|AAPL R735QTJ8XC9X\nAAPL 31CHC04OD2LPI|AAPL R735QTJ8XC9X\nAAPL 31DMOS0UAF2PY|AAPL R735QTJ8XC9X\nAAPL XEIOMKVQYLJA|AAPL R735QTJ8XC9X\nAAPL XVD8084OQRTY|AAPL R735QTJ8XC9X\nAAPL 31KBXAXJSA9ZA|AAPL R735QTJ8XC9X\nAAPL XD6FPZXHHMDI|AAPL R735QTJ8XC9X\nAAPL 31CHC04WMRC6E|AAPL R735QTJ8XC9X\nAAPL XDDBUNK5BX8M|AAPL R735QTJ8XC9X\nAAPL 31BBZ8679426E|AAPL R735QTJ8XC9X\nAAPL XDDBUNHZXKLI|AAPL R735QTJ8XC9X\nAAPL XEIOMKVL09HI|AAPL R735QTJ8XC9X\nAAPL XVD8087ZTGTI|AAPL R735QTJ8XC9X\nAAPL 31CHC0J3NRFLY|AAPL R735QTJ8XC9X\nAAPL 31CHC04HQX7QE|AAPL R735QTJ8XC9X\nAAPL XDDBUP5P699I|AAPL R735QTJ8XC9X\nAAPL XDDBV0TRM9JA|AAPL R735QTJ8XC9X\nAAPL 31CHC03HJ422U|AAPL R735QTJ8XC9X\nAAPL XEIOMLVMV33A|AAPL R735QTJ8XC9X\nAAPL 31DMOS0QZEIW6|AAPL R735QTJ8XC9X\nAAPL XEIOMKVWWXL2|AAPL R735QTJ8XC9X\nAAPL 31BIVCTQRU03Q|AAPL R735QTJ8XC9X\nAAPL 31DMOS0TSK2KM|AAPL R735QTJ8XC9X\nAAPL XDDBUNIHSKQU|AAPL R735QTJ8XC9X\nAAPL XDDBV1QUD7EU|AAPL R735QTJ8XC9X\nAAPL 31DMOS2HZNRDY|AAPL R735QTJ8XC9X\nAAPL XD6FPZY5AYKM|AAPL R735QTJ8XC9X\nAAPL XEIOMLYXXS2U|AAPL R735QTJ8XC9X\nAAPL 31DMOS2JN73VQ|AAPL R735QTJ8XC9X\nAAPL XCSNH1WYBOP2|AAPL R735QTJ8XC9X\nAAPL XVD8089NCTBA|AAPL R735QTJ8XC9X\nAAPL 31DMOS1O7ZIHY|AAPL R735QTJ8XC9X\nAAPL XDDBUONI9FTY|AAPL R735QTJ8XC9X\nAAPL XEIOMKUR8L8M|AAPL R735QTJ8XC9X\nAAPL 31CHC03H77DZA|AAPL R735QTJ8XC9X\nAAPL 31DMOS1PVIUZQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNI5VWNA|AAPL R735QTJ8XC9X\nAAPL XZDYPYRJDMXY|AAPL R735QTJ8XC9X\nAAPL XDDBUNJ5LWXY|AAPL R735QTJ8XC9X\nAAPL 31DMOS0TYIEME|AAPL R735QTJ8XC9X\nAAPL 31DMOS1RJ27HI|AAPL R735QTJ8XC9X\nAAPL XZDYPZ3452EE|AAPL R735QTJ8XC9X\nAAPL 31JKCSB9KK51I|AAPL R735QTJ8XC9X\nAAPL XDDBUP41MWRQ|AAPL R735QTJ8XC9X\nAAPL 31CHC04JEGK86|AAPL R735QTJ8XC9X\nAAPL XEIOMKV359C6|AAPL R735QTJ8XC9X\nAAPL 31UH85MA2HIPY|AAPL R735QTJ8XC9X\nAAPL XDDBV3KZV35Y|AAPL R735QTJ8XC9X\nAAPL XEIOMM290H2E|AAPL R735QTJ8XC9X\nAAPL XDDBV1AAZQH2|AAPL R735QTJ8XC9X\nAAPL 31JKCSCP0438M|AAPL R735QTJ8XC9X\nAAPL 31H2R3UEN5FMU|AAPL R735QTJ8XC9X\nAAPL XDDBV121B006|AAPL R735QTJ8XC9X\nAAPL XC7Z2QOX28O6|AAPL R735QTJ8XC9X\nAAPL XDDBV1IKOGXY|AAPL R735QTJ8XC9X\nAAPL 31CHC0JBXG62U|AAPL R735QTJ8XC9X\nAAPL XVD8086CA4BQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFZC0SJQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVV2XUOJQ|AAPL R735QTJ8XC9X\nAAPL 31BWNML3X7SNA|AAPL R735QTJ8XC9X\nAAPL XZDYPYWHZOFA|AAPL R735QTJ8XC9X\nAAPL 31JKCSB9WGT52|AAPL R735QTJ8XC9X\nAAPL 31CHC03IUQQH2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BUSCGEE|AAPL R735QTJ8XC9X\nAAPL XDDBUOLUQ3C6|AAPL R735QTJ8XC9X\nAAPL 31DMOS2GC4EW6|AAPL R735QTJ8XC9X\nAAPL XZDYPYZT2DEU|AAPL R735QTJ8XC9X\nAAPL 31YHYVD0W0F0M|AAPL R735QTJ8XC9X\nAAPL 31CHC04ZXU15Y|AAPL R735QTJ8XC9X\nAAPL XDDBUOQTC4TI|AAPL R735QTJ8XC9X\nAAPL 31YHYVEU1Q5BA|AAPL R735QTJ8XC9X\nAAPL XDDBUOP5SSBQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVVRQWVYE|AAPL R735QTJ8XC9X\nAAPL XVD8081DO2UE|AAPL R735QTJ8XC9X\nAAPL XZDYPYT6WZFQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNINQWSM|AAPL R735QTJ8XC9X\nAAPL 31CAFVGVWUL46|AAPL R735QTJ8XC9X\nAAPL 31CHC051LDDNQ|AAPL R735QTJ8XC9X\nAAPL XEIOMLXAEFL2|AAPL R735QTJ8XC9X\nAAPL 31OJK5BUME4CM|AAPL R735QTJ8XC9X\nAAPL XIQBH0MIHE92|AAPL R735QTJ8XC9X\nAAPL 31HUBMGGR565I|AAPL R735QTJ8XC9X\nAAPL 31HUBMF7LTXTY|AAPL R735QTJ8XC9X\nAAPL XIQBH07MN9T2|AAPL R735QTJ8XC9X\nAAPL XIQBGZ8KIGHY|AAPL R735QTJ8XC9X\nAAPL XIQBH05Z3XBA|AAPL R735QTJ8XC9X\nAAPL 31DMOS0WRQ3GM|AAPL R735QTJ8XC9X\nAAPL XCZJLQ5XX686|AAPL R735QTJ8XC9X\nAAPL XIQBGZ8EK4G6|AAPL R735QTJ8XC9X\nAAPL XCZJLQUQZDMU|AAPL R735QTJ8XC9X\nAAPL XIQBH0T4MS86|AAPL R735QTJ8XC9X\nAAPL XCZJLQE7LWP2|AAPL R735QTJ8XC9X\nAAPL 31C3JR6TY970M|AAPL R735QTJ8XC9X\nAAPL XCZJLQMHAN5Y|AAPL R735QTJ8XC9X\nAAPL XIQBH0ZQS67A|AAPL R735QTJ8XC9X\nAAPL XIQBGZ9W54W6|AAPL R735QTJ8XC9X\nAAPL 31HUBMF6A79FQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMF6S29L2|AAPL R735QTJ8XC9X\nAAPL XIQBGZ9EA4QU|AAPL R735QTJ8XC9X\nAAPL XIQBGZ7EU45I|AAPL R735QTJ8XC9X\nAAPL XCLRC193U41Y|AAPL R735QTJ8XC9X\nAAPL XIQBH0KUY1RA|AAPL R735QTJ8XC9X\nAAPL XCZJLR30O43Q|AAPL R735QTJ8XC9X\nAAPL 31HUBMGIEOINA|AAPL R735QTJ8XC9X\nAAPL XIQBGZ6R0RYE|AAPL R735QTJ8XC9X\nAAPL 31HUBMGF3LTNQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMF5YALC6|AAPL R735QTJ8XC9X\nAAPL XIQBGZ7WP4AU|AAPL R735QTJ8XC9X\nAAPL XIQBGZ7QQS92|AAPL R735QTJ8XC9X\nAAPL XIQBGZ88LSEE|AAPL R735QTJ8XC9X\nAAPL 31HUBMF6M3XJA|AAPL R735QTJ8XC9X\nAAPL 31C3JR727XXHI|AAPL R735QTJ8XC9X\nAAPL 31HUBMGP0TWME|AAPL R735QTJ8XC9X\nAAPL 31HUBMGBSJ4O6|AAPL R735QTJ8XC9X\nAAPL 31HUBMF73YXOM|AAPL R735QTJ8XC9X\nAAPL XIQBGZ92DGNA|AAPL R735QTJ8XC9X\nAAPL XIQBGZ3RWW86|AAPL R735QTJ8XC9X\nAAPL 31C3JR7IRBEFA|AAPL R735QTJ8XC9X\nAAPL XIQBH0PTK38M|AAPL R735QTJ8XC9X\nAAPL 31HUBMGDG2H5Y|AAPL R735QTJ8XC9X\nAAPL XIQBGZ8QGSJQ|AAPL R735QTJ8XC9X\nAAPL XIQBGZ3LYK6E|AAPL R735QTJ8XC9X\nAAPL XIQBH0FWC09Y|AAPL R735QTJ8XC9X\nAAPL 31C3JR7AHMNYE|AAPL R735QTJ8XC9X\nAAPL 31HUBMF6Y0LMU|AAPL R735QTJ8XC9X\nAAPL 31HUBMG56DQP2|AAPL R735QTJ8XC9X\nAAPL 31C3JR5WVI952|AAPL R735QTJ8XC9X\nAAPL XCZJLPXO8FRA|AAPL R735QTJ8XC9X\nAAPL 31C3JR5OLTIO6|AAPL R735QTJ8XC9X\nAAPL XCZJLRBACUKM|AAPL R735QTJ8XC9X\nAAPL XIQBGZ72XG1Y|AAPL R735QTJ8XC9X\nAAPL XCZJLPPEJPAE|AAPL R735QTJ8XC9X\nAAPL 31C3JR6LOKGJQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMGA4ZS6E|AAPL R735QTJ8XC9X\nAAPL 31HUBMF2T8DK6|AAPL R735QTJ8XC9X\nAAPL 31C3JR6DEVQ2U|AAPL R735QTJ8XC9X\nAAPL XIQBH0O60QQU|AAPL R735QTJ8XC9X\nAAPL XCZJLRJK1L1I|AAPL R735QTJ8XC9X\nAAPL XIQBH11EBIP2|AAPL R735QTJ8XC9X\nAAPL XIQBH0HJVCRQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMG8HGFOM|AAPL R735QTJ8XC9X\nAAPL XIQBGZ8WF4LI|AAPL R735QTJ8XC9X\nAAPL XCLRC285YXD2|AAPL R735QTJ8XC9X\nAAPL 31HUBMG3IUE7A|AAPL R735QTJ8XC9X\nAAPL XCZJLRRTQBIE|AAPL R735QTJ8XC9X\nAAPL XIQBH0J7EP9I|AAPL R735QTJ8XC9X\nAAPL XIQBH0RH3FQE|AAPL R735QTJ8XC9X\nAAPL XIQBGZ78VS3Q|AAPL R735QTJ8XC9X\nAAPL 31JKCSBAEBTAE|AAPL R735QTJ8XC9X\nAAPL 31C3JR6556ZLY|AAPL R735QTJ8XC9X\nAAPL XCSNGOTADE6E|AAPL R735QTJ8XC9X\nAAPL 31HUBMF6G5LHI|AAPL R735QTJ8XC9X\nAAPL XIQBH0CL9BAE|AAPL R735QTJ8XC9X\nAAPL XIQBGZA23GXY|AAPL R735QTJ8XC9X\nAAPL XIQBGZ9K8GSM|AAPL R735QTJ8XC9X\nAAPL XEIOMLTZBQLI|AAPL R735QTJ8XC9X\nAAPL 31CHC04CSB692|AAPL R735QTJ8XC9X\nAAPL 31CHC03GVAPVQ|AAPL R735QTJ8XC9X\nAAPL XIQBH09A6MAU|AAPL R735QTJ8XC9X\nAAPL 31DMOS1KWWTIE|AAPL R735QTJ8XC9X\nAAPL XCZJLCSOLBOM|AAPL R735QTJ8XC9X\nAAPL XIQBH0WFPH7Q|AAPL R735QTJ8XC9X\nAAPL XIQBGZ3G084M|AAPL R735QTJ8XC9X\nAAPL 31HUBMF5GFL6U|AAPL R735QTJ8XC9X\nAAPL 31HUBMG6TX36U|AAPL R735QTJ8XC9X\nAAPL XCLRCDFP1GP2|AAPL R735QTJ8XC9X\nAAPL 31BPRHTN600JQ|AAPL R735QTJ8XC9X\nAAPL 31CHC03DKA61Y|AAPL R735QTJ8XC9X\nAAPL 31HUBMF648XDY|AAPL R735QTJ8XC9X\nAAPL XCEV7PN8TG3Q|AAPL R735QTJ8XC9X\nAAPL XDDBUNIBU8P2|AAPL R735QTJ8XC9X\nAAPL XIQBGZ98BSP2|AAPL R735QTJ8XC9X\nAAPL XCEV7PEZ4PMU|AAPL R735QTJ8XC9X\nAAPL XZDYPYUUGBXI|AAPL R735QTJ8XC9X\nAAPL 31CHC03GPCDTY|AAPL R735QTJ8XC9X\nAAPL 31HUBMF5SC9AE|AAPL R735QTJ8XC9X\nAAPL 31JKCSB6FFS3Q|AAPL R735QTJ8XC9X\nAAPL 31CHC04EFUIQU|AAPL R735QTJ8XC9X\nAAPL 31YHYVCWL7PQE|AAPL R735QTJ8XC9X\nAAPL 31KBXAXJGDLVQ|AAPL R735QTJ8XC9X\nAAPL 31BIVD5MG39HI|AAPL R735QTJ8XC9X\nAAPL 31CHC0JK74WJQ|AAPL R735QTJ8XC9X\nAAPL 31DMOS0TGNEH2|AAPL R735QTJ8XC9X\nAAPL 31HUBMF2NA1IE|AAPL R735QTJ8XC9X\nAAPL XIQBH0E8SNS6|AAPL R735QTJ8XC9X\nAAPL 31CHC03H191XI|AAPL R735QTJ8XC9X\nAAPL 31BPRHTVFOR0M|AAPL R735QTJ8XC9X\nAAPL 31BPRHT6MMJLY|AAPL R735QTJ8XC9X\nAAPL 31CAFVFTDQVXI|AAPL R735QTJ8XC9X\nAAPL XDDBUOK76QUE|AAPL R735QTJ8XC9X\nAAPL XIQBGZ6WZ406|AAPL R735QTJ8XC9X\nAAPL XIQBH0AXPYSM|AAPL R735QTJ8XC9X\nAAPL 31UH85NYXEJQE|AAPL R735QTJ8XC9X\nAAPL XCLRCDNYQ75Y|AAPL R735QTJ8XC9X\nAAPL XCLRCCZ5NZRA|AAPL R735QTJ8XC9X\nAAPL XCEV7PVII6KM|AAPL R735QTJ8XC9X\nAAPL 31HUBMF54IX3A|AAPL R735QTJ8XC9X\nAAPL 31BPRHSYCXT52|AAPL R735QTJ8XC9X\nAAPL XZDYPWXDXWCM|AAPL R735QTJ8XC9X\nAAPL XCLRCD7FCQ86|AAPL R735QTJ8XC9X\nAAPL 31BPRHU3PDHHI|AAPL R735QTJ8XC9X\nAAPL 31JKCSBV8FUCM|AAPL R735QTJ8XC9X\nAAPL XKGCMV785YPY|AAPL R735QTJ8XC9X\nAAPL XCLRCE4I3O3Q|AAPL R735QTJ8XC9X\nAAPL 31BIVD5UPRZYE|AAPL R735QTJ8XC9X\nAAPL 31DMOS0TAP2FA|AAPL R735QTJ8XC9X\nAAPL 31BIVD5E6EJ0M|AAPL R735QTJ8XC9X\nAAPL 31YHYVEVP9HT2|AAPL R735QTJ8XC9X\nAAPL XIQBGZ7KSG7A|AAPL R735QTJ8XC9X\nAAPL 31BPRHTEWBA2U|AAPL R735QTJ8XC9X\nAAPL XIQBH0US64PY|AAPL R735QTJ8XC9X\nAAPL XCLRCDW8EXMU|AAPL R735QTJ8XC9X\nAAPL XZDYPXKJEM3Q|AAPL R735QTJ8XC9X\nAAPL XDDBUOIJNECM|AAPL R735QTJ8XC9X\nAAPL XZDYPZ1GLPWM|AAPL R735QTJ8XC9X\nAAPL XVD808317FC6|AAPL R735QTJ8XC9X\nAAPL 31DMOS1MKG606|AAPL R735QTJ8XC9X\nAAPL 31CAFVGSLRW4M|AAPL R735QTJ8XC9X\nAAPL 31CHC04B4RTRA|AAPL R735QTJ8XC9X\nAAPL XD6FQ0TEI2QU|AAPL R735QTJ8XC9X\nAAPL XIQBGZAE051I|AAPL R735QTJ8XC9X\nAAPL 31HUBMGK27V52|AAPL R735QTJ8XC9X\nAAPL 31HUBMF7RS9VQ|AAPL R735QTJ8XC9X\nAAPL XIQBH0Y38TPI|AAPL R735QTJ8XC9X\nAAPL 31CAFVGQY8JMU|AAPL R735QTJ8XC9X\nAAPL 31CN8P1X23JRA|AAPL R735QTJ8XC9X\nAAPL XDJ8J7PO7FRA|AAPL R735QTJ8XC9X\nAAPL 31BWNMGZ2UK7A|AAPL R735QTJ8XC9X\nAAPL 31CAFVHJ2DG12|AAPL R735QTJ8XC9X\nAAPL 31HUBMF4YKL1I|AAPL R735QTJ8XC9X\nAAPL XDJ8JJVFN45I|AAPL R735QTJ8XC9X\nAAPL XDDBV04YK24M|AAPL R735QTJ8XC9X\nAAPL XDDBV0LHXJ2E|AAPL R735QTJ8XC9X\nAAPL XDJ8J8XTSNS6|AAPL R735QTJ8XC9X\nAAPL 31BPRHXBGZS1Y|AAPL R735QTJ8XC9X\nAAPL 31BWNMH7CJAO6|AAPL R735QTJ8XC9X\nAAPL 31BIVCV8OOZ1I|AAPL R735QTJ8XC9X\nAAPL XDJ8JKSIE212|AAPL R735QTJ8XC9X\nAAPL 31UH85O0KXW86|AAPL R735QTJ8XC9X\nAAPL 31YHYVDJQOFHI|AAPL R735QTJ8XC9X\nAAPL 31CN8ONP1FL6U|AAPL R735QTJ8XC9X\nAAPL 31CHC0FNMGEKM|AAPL R735QTJ8XC9X\nAAPL 31CN8OOYOLTNQ|AAPL R735QTJ8XC9X\nAAPL XCSNH1OOMY86|AAPL R735QTJ8XC9X\nAAPL XDJ8J914VCRQ|AAPL R735QTJ8XC9X\nAAPL XD6FQCKS0S06|AAPL R735QTJ8XC9X\nAAPL 31CN8ONOVH952|AAPL R735QTJ8XC9X\nAAPL 31HUBMF7FVLS6|AAPL R735QTJ8XC9X\nAAPL 31HUBMFWWP086|AAPL R735QTJ8XC9X\nAAPL XCSNH1GEY7RA|AAPL R735QTJ8XC9X\nAAPL 31CN8ONPDC9AE|AAPL R735QTJ8XC9X\nAAPL 31CN8OOVDJ4O6|AAPL R735QTJ8XC9X\nAAPL 31CHC0G45TVIE|AAPL R735QTJ8XC9X\nAAPL XEIOMKRG81EU|AAPL R735QTJ8XC9X\nAAPL 31CAFVSBPLUX2|AAPL R735QTJ8XC9X\nAAPL 31CN8OOS2GFOM|AAPL R735QTJ8XC9X\nAAPL 31HUBMFTLMB8M|AAPL R735QTJ8XC9X\nAAPL XDJ8J92SEP9I|AAPL R735QTJ8XC9X\nAAPL XDJ8JKK8PBK6|AAPL R735QTJ8XC9X\nAAPL XDJ8J7PCARNQ|AAPL R735QTJ8XC9X\nAAPL XCSNH0ZVKQTI|AAPL R735QTJ8XC9X\nAAPL 31CN8P1GIQ2TI|AAPL R735QTJ8XC9X\nAAPL XDJ8J7Q62FWM|AAPL R735QTJ8XC9X\nAAPL 31CHC03J6NEKM|AAPL R735QTJ8XC9X\nAAPL XVD808BAW5T2|AAPL R735QTJ8XC9X\nAAPL 31CAFVSS8ZBUU|AAPL R735QTJ8XC9X\nAAPL XDJ8JKBZ0L3A|AAPL R735QTJ8XC9X\nAAPL 31CN8OOQEX36U|AAPL R735QTJ8XC9X\nAAPL 31CAFVS3FX4G6|AAPL R735QTJ8XC9X\nAAPL 31CN8ONOPIX3A|AAPL R735QTJ8XC9X\nAAPL 31BWNMHFM8152|AAPL R735QTJ8XC9X\nAAPL 31CN8P0RPNVEU|AAPL R735QTJ8XC9X\nAAPL XD6FQC48NB2E|AAPL R735QTJ8XC9X\nAAPL 31CN8P1891CCM|AAPL R735QTJ8XC9X\nAAPL 31CN8OZE3JGLI|AAPL R735QTJ8XC9X\nAAPL 31JKCSBTKWHUU|AAPL R735QTJ8XC9X\nAAPL 31JKCSB6LE45I|AAPL R735QTJ8XC9X\nAAPL XIQBGZ6L2FWM|AAPL R735QTJ8XC9X\nAAPL XDJ8JLHBG9FQ|AAPL R735QTJ8XC9X\nAAPL 31CN8ONOJKL1I|AAPL R735QTJ8XC9X\nAAPL XDDBV0D88SLI|AAPL R735QTJ8XC9X\nAAPL XDJ8J7LJF7OM|AAPL R735QTJ8XC9X\nAAPL XIQBGZXPF6UE|AAPL R735QTJ8XC9X\nAAPL XDJ8JL0S2SHY|AAPL R735QTJ8XC9X\nAAPL 31CN8OZMD872E|AAPL R735QTJ8XC9X\nAAPL XD6FPZXBJABQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFWIT3PI|AAPL R735QTJ8XC9X\nAAPL XDJ8J8UIPYSM|AAPL R735QTJ8XC9X\nAAPL 31CN8OZUMWXJA|AAPL R735QTJ8XC9X\nAAPL 31UH85O3W0L7Q|AAPL R735QTJ8XC9X\nAAPL 31CHC0GCFILZA|AAPL R735QTJ8XC9X\nAAPL XCSNH1859HAE|AAPL R735QTJ8XC9X\nAAPL 31CN8P0JFZ4XY|AAPL R735QTJ8XC9X\nAAPL 31HUBMF5AH952|AAPL R735QTJ8XC9X\nAAPL 31BWNMHNVWRLY|AAPL R735QTJ8XC9X\nAAPL XD6FQCT1PIH2|AAPL R735QTJ8XC9X\nAAPL XD6FQCCIC1JA|AAPL R735QTJ8XC9X\nAAPL 31CHC0GKP7CG6|AAPL R735QTJ8XC9X\nAAPL XDJ8JL91RIYU|AAPL R735QTJ8XC9X\nAAPL XDJ8J8ZHC09Y|AAPL R735QTJ8XC9X\nAAPL XDDBUZWOVBNQ|AAPL R735QTJ8XC9X\nAAPL XDDBUZOF6L6U|AAPL R735QTJ8XC9X\nAAPL 31CHC0FVW551I|AAPL R735QTJ8XC9X\nAAPL 31CAFVSJZALDY|AAPL R735QTJ8XC9X\nAAPL 31CN8OP0C565I|AAPL R735QTJ8XC9X\nAAPL 31YHYVF2BEVS6|AAPL R735QTJ8XC9X\nAAPL 31CN8OOX12H5Y|AAPL R735QTJ8XC9X\nAAPL 31CN8P0B6AEH2|AAPL R735QTJ8XC9X\nAAPL 31CN8ONKQP12E|AAPL R735QTJ8XC9X\nAAPL XDJ8JLXUTQDI|AAPL R735QTJ8XC9X\nAAPL XDJ8J7PU5RT2|AAPL R735QTJ8XC9X\nAAPL 31HUBMF4SM8ZQ|AAPL R735QTJ8XC9X\nAAPL XDJ8JM64IGUE|AAPL R735QTJ8XC9X\nAAPL 31CN8OOTPZS6E|AAPL R735QTJ8XC9X\nAAPL XDJ8J8W69BAE|AAPL R735QTJ8XC9X\nAAPL 31CN8P1OSETAE|AAPL R735QTJ8XC9X\nAAPL 31BIVD9ZK58EE|AAPL R735QTJ8XC9X\nAAPL 31CN8P02WLO06|AAPL R735QTJ8XC9X\nAAPL XDJ8J7QC0RYE|AAPL R735QTJ8XC9X\nAAPL XEIOMKUX6XAE|AAPL R735QTJ8XC9X\nAAPL 31CN8P0ZZCLVQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNHTZ8JQ|AAPL R735QTJ8XC9X\nAAPL XCSNGPU01JZA|AAPL R735QTJ8XC9X\nAAPL XDJ8JMEE77BA|AAPL R735QTJ8XC9X\nAAPL XDR43Z1EQG6E|AAPL R735QTJ8XC9X\nAAPL XHYQYDDEIMW6|AAPL R735QTJ8XC9X\nAAPL XRX5OEIUD9BA|AAPL R735QTJ8XC9X\nAAPL XDR43YKDK492|AAPL R735QTJ8XC9X\nAAPL XHYQYCWDCAYU|AAPL R735QTJ8XC9X\nAAPL XCZJLCUC4O6E|AAPL R735QTJ8XC9X\nAAPL XCZJLCBTDBT2|AAPL R735QTJ8XC9X\nAAPL XDR43YKJIGAU|AAPL R735QTJ8XC9X\nAAPL XCZJLCVZO0O6|AAPL R735QTJ8XC9X\nAAPL XDR43Z4PT55Y|AAPL R735QTJ8XC9X\nAAPL XDR43YKPGSCM|AAPL R735QTJ8XC9X\nAAPL XG8PSHGQB59I|AAPL R735QTJ8XC9X\nAAPL XIQBGZ5LCFLY|AAPL R735QTJ8XC9X\nAAPL XIQBGZSQT5D2|AAPL R735QTJ8XC9X\nAAPL XKGCMVUDMOH2|AAPL R735QTJ8XC9X\nAAPL XIQBGZ5RARNQ|AAPL R735QTJ8XC9X\nAAPL XKGCMV7E4ARQ|AAPL R735QTJ8XC9X\nAAPL XG8PSHK1DU92|AAPL R735QTJ8XC9X\nAAPL XIQBGZUECHUU|AAPL R735QTJ8XC9X\nAAPL XKGCMVW160YU|AAPL R735QTJ8XC9X\nAAPL XIQBGZ5X93PI|AAPL R735QTJ8XC9X\nAAPL XIQBGZW1VUCM|AAPL R735QTJ8XC9X\nAAPL XEIOMKU3F91I|AAPL R735QTJ8XC9X\nAAPL XIQBGZ637FRA|AAPL R735QTJ8XC9X\nAAPL XKGCMV7Q0YVA|AAPL R735QTJ8XC9X\nAAPL XEIOMLLPN04M|AAPL R735QTJ8XC9X\nAAPL XEIOMKU9DL3A|AAPL R735QTJ8XC9X\nAAPL XIQBGZ695RT2|AAPL R735QTJ8XC9X\nAAPL XKGCMV7VZAX2|AAPL R735QTJ8XC9X\nAAPL XEIOMLND6CME|AAPL R735QTJ8XC9X\nAAPL XIQBGZZCYJC6|AAPL R735QTJ8XC9X\nAAPL XD6FPZU6H2JQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNED0CO6|AAPL R735QTJ8XC9X\nAAPL XD6FQ0RQYQ92|AAPL R735QTJ8XC9X\nAAPL XDDBUOBXI0DI|AAPL R735QTJ8XC9X\nAAPL XEIOMLP0PP46|AAPL R735QTJ8XC9X\nAAPL XDDBUNHI2KG6|AAPL R735QTJ8XC9X\nAAPL XEIOMKULA96U|AAPL R735QTJ8XC9X\nAAPL XDDBUODL1CVA|AAPL R735QTJ8XC9X\nAAPL XEIOMLQO91LY|AAPL R735QTJ8XC9X\nAAPL XDDBUNHO0WHY|AAPL R735QTJ8XC9X\nAAPL XD6FQ0V21F8M|AAPL R735QTJ8XC9X\nAAPL XDDBUOF8KPD2|AAPL R735QTJ8XC9X\nAAPL XEIOMLSBSE3Q|AAPL R735QTJ8XC9X\nAAPL XIQBH04BKKTI|AAPL R735QTJ8XC9X\nAAPL XCSNGPSCI7HI|AAPL R735QTJ8XC9X\nAAPL XD6FQ0WPKRQE|AAPL R735QTJ8XC9X\nAAPL XDDBUOGW41UU|AAPL R735QTJ8XC9X\nAAPL XDJ8J8R7N9T2|AAPL R735QTJ8XC9X\nAAPL XDJ8JJEW9N7Q|AAPL R735QTJ8XC9X\nAAPL XDJ8JJN5YDOM|AAPL R735QTJ8XC9X\nAAPL XDJ8J8SV6MAU|AAPL R735QTJ8XC9X\nAAPL XDJ8J7PI93PI|AAPL R735QTJ8XC9X\nAAPL XDJ8JK3PBUME|AAPL R735QTJ8XC9X\nAAPL XDJ8JLPL4ZWM|AAPL R735QTJ8XC9X\nAAPL XVD807ZQ4QCM|AAPL R735QTJ8XC9X\nAAPL XIQBGZA81SZQ|AAPL R735QTJ8XC9X\nAAPL XZDYPYY5J0X2|AAPL R735QTJ8XC9X\nAAPL 31HUBMFRY2YQU|AAPL R735QTJ8XC9X\nAAPL 31HUBMFV95NQE|AAPL R735QTJ8XC9X\nAAPL 31HUBMFYK8CPY|AAPL R735QTJ8XC9X\nAAPL 31CN8P25BSA86|AAPL R735QTJ8XC9X\nAAPL 31CN8ONPJALC6|AAPL R735QTJ8XC9X\nAAPL 31CN8P2DLH0P2|AAPL R735QTJ8XC9X\nAAPL 31CN8OP1ZOINA|AAPL R735QTJ8XC9X\nAAPL 31HUBMGLPR7MU|AAPL R735QTJ8XC9X\nAAPL 31C3JR7R104W6|AAPL R735QTJ8XC9X\nAAPL 31HUBMF7XQLXI|AAPL R735QTJ8XC9X\nAAPL 31CAFVHE3REJQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMGNDAK4M|AAPL R735QTJ8XC9X\nAAPL 31BWNMKNDUBPI|AAPL R735QTJ8XC9X\nAAPL 31HUBMF83OXZA|AAPL R735QTJ8XC9X\nAAPL 31BWNMKVNJ26E|AAPL R735QTJ8XC9X\nAAPL 31CAFVW00LMFA|AAPL R735QTJ8XC9X\nAAPL 31CAFVW8AACW6|AAPL R735QTJ8XC9X\nAAPL 31CHC0JSGTN0M|AAPL R735QTJ8XC9X\nAAPL 31BWNM4UN1K7A|AAPL R735QTJ8XC9X\nAAPL 31CAFVFZ044G6|AAPL R735QTJ8XC9X\nAAPL 31HUBMF89NA12|AAPL R735QTJ8XC9X\nAAPL 31BPRHXS0D8ZQ|AAPL R735QTJ8XC9X\nAAPL 31BWNMLC6WJ46|AAPL R735QTJ8XC9X\nAAPL 31BPRHISV895Y|AAPL R735QTJ8XC9X\nAAPL 31BWNM6D1RJAE|AAPL R735QTJ8XC9X\nAAPL 31CAFVHHEU3JA|AAPL R735QTJ8XC9X\nAAPL 31HUBMGQOD946|AAPL R735QTJ8XC9X\nAAPL 31BIVCTQFXC06|AAPL R735QTJ8XC9X\nAAPL 31BPRHHAMGM4M|AAPL R735QTJ8XC9X\nAAPL 31BWNM4USZW92|AAPL R735QTJ8XC9X\nAAPL 31CAFVFZ62GHY|AAPL R735QTJ8XC9X\nAAPL 31CHC03JCLQME|AAPL R735QTJ8XC9X\nAAPL 31HUBMF8FLM2U|AAPL R735QTJ8XC9X\nAAPL 31BPRHIUIRLNQ|AAPL R735QTJ8XC9X\nAAPL 31BWNM6EPAVS6|AAPL R735QTJ8XC9X\nAAPL 31CHC0538WQ5I|AAPL R735QTJ8XC9X\nAAPL 31HUBMGSBWLLY|AAPL R735QTJ8XC9X\nAAPL 31BWNM4UYY8AU|AAPL R735QTJ8XC9X\nAAPL 31CHC03JIK2O6|AAPL R735QTJ8XC9X\nAAPL 31HUBMF8LJY4M|AAPL R735QTJ8XC9X\nAAPL 31BPRHIW6AY5I|AAPL R735QTJ8XC9X\nAAPL 31BWNM6GCU89Y|AAPL R735QTJ8XC9X\nAAPL 31CAFVHKPWSIU|AAPL R735QTJ8XC9X\nAAPL 31CHC054WG2NA|AAPL R735QTJ8XC9X\nAAPL 31CV49G99IMW6|AAPL R735QTJ8XC9X\nAAPL 31HUBMGTZFY3Q|AAPL R735QTJ8XC9X\nAAPL 31BPRHHAYDA86|AAPL R735QTJ8XC9X\nAAPL 31BWNM4V4WKCM|AAPL R735QTJ8XC9X\nAAPL 31CAFVFZHZ4LI|AAPL R735QTJ8XC9X\nAAPL 31CHC03JOIEPY|AAPL R735QTJ8XC9X\nAAPL 31HUBMF8RIA6E|AAPL R735QTJ8XC9X\nAAPL 31BPRHIXTUANA|AAPL R735QTJ8XC9X\nAAPL 31CAFVHMDG50M|AAPL R735QTJ8XC9X\nAAPL 31HUBMGVMZALI|AAPL R735QTJ8XC9X\nAAPL 31CAFVFTPNK12|AAPL R735QTJ8XC9X\nAAPL 31HUBMF2Z6PLY|AAPL R735QTJ8XC9X\nAAPL 31HUBMGXAIN3A|AAPL R735QTJ8XC9X\nAAPL 31HUBMF93EY9Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5BVG5SLI|AAPL R735QTJ8XC9X\nAAPL 31C3JQU5HZJVQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMGYY1ZL2|AAPL R735QTJ8XC9X\nAAPL 31YHYVEQQNGBQ|AAPL R735QTJ8XC9X\nAAPL 31C3JQSFTAUME|AAPL R735QTJ8XC9X\nAAPL 31HUBMF99DABQ|AAPL R735QTJ8XC9X\nAAPL 31JKCSBAW6TFQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5BVM44NA|AAPL R735QTJ8XC9X\nAAPL 31YHYVD11YR2E|AAPL R735QTJ8XC9X\nAAPL 31HUBMH0LLC2U|AAPL R735QTJ8XC9X\nAAPL 31YHYVESE6STI|AAPL R735QTJ8XC9X\nAAPL 31C3JQSFZ96O6|AAPL R735QTJ8XC9X\nAAPL 31CV49EOPEB5Y|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZ2CYRQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3T0P6HVQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMF9FBMDI|AAPL R735QTJ8XC9X\nAAPL 31JKCSBB255HI|AAPL R735QTJ8XC9X\nAAPL 31OJK5BVS2GP2|AAPL R735QTJ8XC9X\nAAPL 31YHYVD17X346|AAPL R735QTJ8XC9X\nAAPL 31UH85O28H8PY|AAPL R735QTJ8XC9X\nAAPL 31C3JQSG57IPY|AAPL R735QTJ8XC9X\nAAPL 31CV49EOVCN7Q|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZ8BATI|AAPL R735QTJ8XC9X\nAAPL 31H2R3T0V4TXI|AAPL R735QTJ8XC9X\nAAPL 31HUBMF9L9YFA|AAPL R735QTJ8XC9X\nAAPL 31JKCSBB83HJA|AAPL R735QTJ8XC9X\nAAPL 31KBXAXJY8M12|AAPL R735QTJ8XC9X\nAAPL 31OJK5BVY0SQU|AAPL R735QTJ8XC9X\nAAPL 31UH85M9KMIKM|AAPL R735QTJ8XC9X\nAAPL 31YHYVD1DVF5Y|AAPL R735QTJ8XC9X\nAAPL 31C3JQSGB5URQ|AAPL R735QTJ8XC9X\nAAPL 31CV49EP1AZ9I|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQO4IDI|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZE9MVA|AAPL R735QTJ8XC9X\nAAPL 31JKCSBBE1TL2|AAPL R735QTJ8XC9X\nAAPL 31UH85O5JJXPI|AAPL R735QTJ8XC9X\nAAPL 31YHYVEXCSUAU|AAPL R735QTJ8XC9X\nAAPL 31C3JQSGH46TI|AAPL R735QTJ8XC9X\nAAPL 31CV49EP79BBA|AAPL R735QTJ8XC9X\nAAPL 31EL5FAQU2UFA|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZK7YX2|AAPL R735QTJ8XC9X\nAAPL 31H2R3T171I12|AAPL R735QTJ8XC9X\nAAPL 31JKCSBBK05MU|AAPL R735QTJ8XC9X\nAAPL 31KBXAXKA5A4M|AAPL R735QTJ8XC9X\nAAPL 31OJK5BW9XGUE|AAPL R735QTJ8XC9X\nAAPL 31UH85M9WJ6O6|AAPL R735QTJ8XC9X\nAAPL 31YHYVD1PS39I|AAPL R735QTJ8XC9X\nAAPL 31UH85O773A7A|AAPL R735QTJ8XC9X\nAAPL 31YHYVEZ0C6SM|AAPL R735QTJ8XC9X\nAAPL 31C3JQSGN2IVA|AAPL R735QTJ8XC9X\nAAPL 31CV49EPD7ND2|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZQ6AYU|AAPL R735QTJ8XC9X\nAAPL 31H2R3T1CZU2U|AAPL R735QTJ8XC9X\nAAPL 31JKCSBBPYHOM|AAPL R735QTJ8XC9X\nAAPL 31OJK5BWFVSW6|AAPL R735QTJ8XC9X\nAAPL 31UH85O8UMMP2|AAPL R735QTJ8XC9X\nAAPL 31YHYVF0NVJAE|AAPL R735QTJ8XC9X\nAAPL 31C3JQSGT0UX2|AAPL R735QTJ8XC9X\nAAPL 31CV49EPJ5ZEU|AAPL R735QTJ8XC9X\nAAPL 31EL5FAR5ZIIU|AAPL R735QTJ8XC9X\nAAPL 31FCPXWZW4N0M|AAPL R735QTJ8XC9X\nAAPL 31H2R3T1IY64M|AAPL R735QTJ8XC9X\nAAPL 31OJK5BWLU4XY|AAPL R735QTJ8XC9X\nAAPL 31UH85OAI5Z6U|AAPL R735QTJ8XC9X\nAAPL 31C3JQSGYZ6YU|AAPL R735QTJ8XC9X\nAAPL 31CV49EPP4BGM|AAPL R735QTJ8XC9X\nAAPL 31FCPXX022Z2E|AAPL R735QTJ8XC9X\nAAPL 31H2R3T1OWI6E|AAPL R735QTJ8XC9X\nAAPL 31KBXAXKS0A9Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5BWRSGZQ|AAPL R735QTJ8XC9X\nAAPL 31UH85MAEE6TI|AAPL R735QTJ8XC9X\nAAPL 31C3JQS9P2LYE|AAPL R735QTJ8XC9X\nAAPL 31CV49EIF7QG6|AAPL R735QTJ8XC9X\nAAPL 31FCPXWSS6E1Y|AAPL R735QTJ8XC9X\nAAPL 31R15TTZUUJL2|AAPL R735QTJ8XC9X\nAAPL 31UH85ODT8O6E|AAPL R735QTJ8XC9X\nAAPL 31UH85MAQAUX2|AAPL R735QTJ8XC9X\nAAPL 31UH85OFGS0O6|AAPL R735QTJ8XC9X\nAAPL 31UH85MAW96YU|AAPL R735QTJ8XC9X\nAAPL XEIOMLDFY9NQ|AAPL R735QTJ8XC9X\nAAPL XG8PSHF2RSRQ|AAPL R735QTJ8XC9X\nAAPL XIQBGZPFQGDI|AAPL R735QTJ8XC9X\nAAPL XKGCMVR2JZHI|AAPL R735QTJ8XC9X\nAAPL XZDYPXH8BX46|AAPL R735QTJ8XC9X\nAAPL XD6FPZW5UXZA|AAPL R735QTJ8XC9X\nAAPL XDDBUNGCE83Q|AAPL R735QTJ8XC9X\nAAPL XDJ8J7NCUR2E|AAPL R735QTJ8XC9X\nAAPL XEIOMKTFLWUE|AAPL R735QTJ8XC9X\nAAPL XIQBGZ5FE3K6|AAPL R735QTJ8XC9X\nAAPL XKGCMV727MO6|AAPL R735QTJ8XC9X\nAAPL XZDYPWX7ZKAU|AAPL R735QTJ8XC9X\nAAPL XD6FQ0HTQNAE|AAPL R735QTJ8XC9X\nAAPL XDDBUO209XEU|AAPL R735QTJ8XC9X\nAAPL XDJ8J890QGDI|AAPL R735QTJ8XC9X\nAAPL XEIOMLF3HM5I|AAPL R735QTJ8XC9X\nAAPL XIQBGZR39SVA|AAPL R735QTJ8XC9X\nAAPL XKGCMVSQ3BZA|AAPL R735QTJ8XC9X\nAAPL XZDYPXIVV9LY|AAPL R735QTJ8XC9X\nAAPL XD6FPZWBTA12|AAPL R735QTJ8XC9X\nAAPL XDDBUNGICK5I|AAPL R735QTJ8XC9X\nAAPL XDJ8J7NIT346|AAPL R735QTJ8XC9X\nAAPL XEIOMKTLK8W6|AAPL R735QTJ8XC9X\nAAPL XD6FQ0JH9ZS6|AAPL R735QTJ8XC9X\nAAPL XDDBUO3NT9WM|AAPL R735QTJ8XC9X\nAAPL XDJ8J8AO9SVA|AAPL R735QTJ8XC9X\nAAPL XEIOMLGR0YNA|AAPL R735QTJ8XC9X\nAAPL XD6FPZWHRM2U|AAPL R735QTJ8XC9X\nAAPL XDDBUNGOAW7A|AAPL R735QTJ8XC9X\nAAPL XDJ8J7NORF5Y|AAPL R735QTJ8XC9X\nAAPL XEIOMKTRIKXY|AAPL R735QTJ8XC9X\nAAPL XD6FQ0L4TC9Y|AAPL R735QTJ8XC9X\nAAPL XDDBUO5BCMEE|AAPL R735QTJ8XC9X\nAAPL XDJ8J8CBT5D2|AAPL R735QTJ8XC9X\nAAPL XEIOMLIEKB52|AAPL R735QTJ8XC9X\nAAPL XD6FPZWNPY4M|AAPL R735QTJ8XC9X\nAAPL XDDBUNGU9892|AAPL R735QTJ8XC9X\nAAPL XDJ8J7NUPR7Q|AAPL R735QTJ8XC9X\nAAPL XEIOMKTXGWZQ|AAPL R735QTJ8XC9X\nAAPL XD6FQ0MSCORQ|AAPL R735QTJ8XC9X\nAAPL XDDBUO6YVYW6|AAPL R735QTJ8XC9X\nAAPL XDJ8J8DZCHUU|AAPL R735QTJ8XC9X\nAAPL XEIOMLK23NMU|AAPL R735QTJ8XC9X\nAAPL XD6FPZWTOA6E|AAPL R735QTJ8XC9X\nAAPL XDDBUNH07KAU|AAPL R735QTJ8XC9X\nAAPL XDJ8J7O0O39I|AAPL R735QTJ8XC9X\nAAPL XD6FQ0OFW19I|AAPL R735QTJ8XC9X\nAAPL XDDBUO8MFBDY|AAPL R735QTJ8XC9X\nAAPL XDJ8J8FMVUCM|AAPL R735QTJ8XC9X\nAAPL XD6FPZWZMM86|AAPL R735QTJ8XC9X\nAAPL XDDBUNH65WCM|AAPL R735QTJ8XC9X\nAAPL XDJ8J7O6MFBA|AAPL R735QTJ8XC9X\nAAPL XD6FQ0Q3FDRA|AAPL R735QTJ8XC9X\nAAPL XDDBUOA9YNVQ|AAPL R735QTJ8XC9X\nAAPL XDJ8J8HAF6UE|AAPL R735QTJ8XC9X\nAAPL XDJ8J7LDGVMU|AAPL R735QTJ8XC9X\nAAPL XDJ8J8IXYJC6|AAPL R735QTJ8XC9X\nAAPL XCSNGOSYGQ2U|AAPL R735QTJ8XC9X\nAAPL XDJ8J7OIJ3EU|AAPL R735QTJ8XC9X\nAAPL XCLRC24UW8DI|AAPL R735QTJ8XC9X\nAAPL XCSNGPP1FIHY|AAPL R735QTJ8XC9X\nAAPL XDJ8J8KLHVTY|AAPL R735QTJ8XC9X\nAAPL XCLRC18XVS06|AAPL R735QTJ8XC9X\nAAPL XCSNGOT4F24M|AAPL R735QTJ8XC9X\nAAPL XDJ8J7OOHFGM|AAPL R735QTJ8XC9X\nAAPL XCLRC26IFKVA|AAPL R735QTJ8XC9X\nAAPL XCSNGPQOYUZQ|AAPL R735QTJ8XC9X\nAAPL XDJ8J8M918BQ|AAPL R735QTJ8XC9X\nAAPL XDJ8J7OUFRIE|AAPL R735QTJ8XC9X\nAAPL XDJ8J8NWKKTI|AAPL R735QTJ8XC9X\nAAPL XDJ8J7P0E3K6|AAPL R735QTJ8XC9X\nAAPL XDJ8J8PK3XBA|AAPL R735QTJ8XC9X\nAAPL XDJ8J7P6CFLY|AAPL R735QTJ8XC9X\nAAPL XDJ8J7QHZ406|AAPL R735QTJ8XC9X\nAAPL XDJ8J94FY1RA|AAPL R735QTJ8XC9X\nAAPL XDJ8J7QNXG1Y|AAPL R735QTJ8XC9X\nAAPL XDJ8J963HE92|AAPL R735QTJ8XC9X\nAAPL XDJ8J7QTVS3Q|AAPL R735QTJ8XC9X\nAAPL 31DMOS1CN831I|AAPL R735QTJ8XC9X\nAAPL 31FCPXXEA1M5I|AAPL R735QTJ8XC9X\nAAPL 31HUBMFON09RA|AAPL R735QTJ8XC9X\nAAPL 31JKCSBQ9TSVA|AAPL R735QTJ8XC9X\nAAPL 31YHYVDGFLQHY|AAPL R735QTJ8XC9X\nAAPL 31CAFVFVD4RD2|AAPL R735QTJ8XC9X\nAAPL 31CHC03FJO1HI|AAPL R735QTJ8XC9X\nAAPL 31CN8ONMK4KG6|AAPL R735QTJ8XC9X\nAAPL 31DMOS0SMVQ86|AAPL R735QTJ8XC9X\nAAPL 31HUBMF4MNWXY|AAPL R735QTJ8XC9X\nAAPL 31JKCSB69HG1Y|AAPL R735QTJ8XC9X\nAAPL 31YHYVCWF9DOM|AAPL R735QTJ8XC9X\nAAPL 31CAFVGH10GO6|AAPL R735QTJ8XC9X\nAAPL 31CHC0417JQSM|AAPL R735QTJ8XC9X\nAAPL 31CN8OO8809RA|AAPL R735QTJ8XC9X\nAAPL 31DMOS1EARFJA|AAPL R735QTJ8XC9X\nAAPL 31HUBMFQAJM92|AAPL R735QTJ8XC9X\nAAPL 31JKCSBRXD5D2|AAPL R735QTJ8XC9X\nAAPL 31YHYVDI352ZQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVFVJ33EU|AAPL R735QTJ8XC9X\nAAPL 31CHC03FPMDJA|AAPL R735QTJ8XC9X\nAAPL 31CN8ONMQ2WHY|AAPL R735QTJ8XC9X\nAAPL 31DMOS0SSU29Y|AAPL R735QTJ8XC9X\nAAPL 31CAFVGIOJT5Y|AAPL R735QTJ8XC9X\nAAPL 31CHC042V33AE|AAPL R735QTJ8XC9X\nAAPL 31CN8OO9VJM92|AAPL R735QTJ8XC9X\nAAPL 31DMOS1FYAS12|AAPL R735QTJ8XC9X\nAAPL 31CAFVFVP1FGM|AAPL R735QTJ8XC9X\nAAPL 31CHC03FVKPL2|AAPL R735QTJ8XC9X\nAAPL 31CN8ONMW18JQ|AAPL R735QTJ8XC9X\nAAPL 31DMOS0SYSEBQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVGKC35NQ|AAPL R735QTJ8XC9X\nAAPL 31CHC044IMFS6|AAPL R735QTJ8XC9X\nAAPL 31CN8OOBJ2YQU|AAPL R735QTJ8XC9X\nAAPL 31DMOS1HLU4IU|AAPL R735QTJ8XC9X\nAAPL 31CAFVFVUZRIE|AAPL R735QTJ8XC9X\nAAPL 31CHC03G1J1MU|AAPL R735QTJ8XC9X\nAAPL 31CN8ONN1ZKLI|AAPL R735QTJ8XC9X\nAAPL 31DMOS0T4QQDI|AAPL R735QTJ8XC9X\nAAPL 31CAFVGLZMI5I|AAPL R735QTJ8XC9X\nAAPL 31CHC04665S9Y|AAPL R735QTJ8XC9X\nAAPL 31CN8OOD6MB8M|AAPL R735QTJ8XC9X\nAAPL 31DMOS1J9DH0M|AAPL R735QTJ8XC9X\nAAPL 31CAFVFW0Y3K6|AAPL R735QTJ8XC9X\nAAPL 31CHC03G7HDOM|AAPL R735QTJ8XC9X\nAAPL 31CN8ONN7XWNA|AAPL R735QTJ8XC9X\nAAPL 31CAFVGNN5UNA|AAPL R735QTJ8XC9X\nAAPL 31CHC047TP4RQ|AAPL R735QTJ8XC9X\nAAPL 31CN8OOEU5NQE|AAPL R735QTJ8XC9X\nAAPL 31CAFVFW6WFLY|AAPL R735QTJ8XC9X\nAAPL 31CHC03GDFPQE|AAPL R735QTJ8XC9X\nAAPL 31CN8ONNDW8P2|AAPL R735QTJ8XC9X\nAAPL 31CAFVGPAP752|AAPL R735QTJ8XC9X\nAAPL 31CHC049H8H9I|AAPL R735QTJ8XC9X\nAAPL 31CN8OOGHP086|AAPL R735QTJ8XC9X\nAAPL 31CN8ONKKQP0M|AAPL R735QTJ8XC9X\nAAPL 31CN8OOI58CPY|AAPL R735QTJ8XC9X\nAAPL 31BWNM4S5QJGM|AAPL R735QTJ8XC9X\nAAPL 31CN8ONNPSWSM|AAPL R735QTJ8XC9X\nAAPL 31BPRHI4261RA|AAPL R735QTJ8XC9X\nAAPL 31BWNM5O8PBVQ|AAPL R735QTJ8XC9X\nAAPL 31CN8OOJSRP7Q|AAPL R735QTJ8XC9X\nAAPL 31BPRHH855LDY|AAPL R735QTJ8XC9X\nAAPL 31BWNM4SBOVIE|AAPL R735QTJ8XC9X\nAAPL 31CN8ONNVR8UE|AAPL R735QTJ8XC9X\nAAPL 31BPRHI5PPE92|AAPL R735QTJ8XC9X\nAAPL 31BWNM5PW8ODI|AAPL R735QTJ8XC9X\nAAPL 31CN8OOLGB1PI|AAPL R735QTJ8XC9X\nAAPL 31CN8ONO1PKW6|AAPL R735QTJ8XC9X\nAAPL 31CN8OON3UE7A|AAPL R735QTJ8XC9X\nAAPL 31CN8ONO7NWXY|AAPL R735QTJ8XC9X\nAAPL 31CN8OOORDQP2|AAPL R735QTJ8XC9X\nAAPL 31CN8ONODM8ZQ|AAPL R735QTJ8XC9X\nAAPL 31CN8ONPP8XDY|AAPL R735QTJ8XC9X\nAAPL 31CN8OP3N7V52|AAPL R735QTJ8XC9X\nAAPL 31CN8ONPV79FQ|AAPL R735QTJ8XC9X\nAAPL 31CN8OP5AR7MU|AAPL R735QTJ8XC9X\nAAPL 31CN8ONQ15LHI|AAPL R735QTJ8XC9X\nAAPL XCSNH0RLW0CM|AAPL R735QTJ8XC9X\nAAPL XD6FQBVYYKLI|AAPL R735QTJ8XC9X\nAAPL XDDBUZG5HUPY|AAPL R735QTJ8XC9X\nAAPL XDY08Y4P3P3A|AAPL R735QTJ8XC9X\nAAPL XDY08NAEBXPI|AAPL R735QTJ8XC9X\nAAPL XDY08YCYSFK6|AAPL R735QTJ8XC9X\nAAPL XDY08M71EF46|AAPL R735QTJ8XC9X\nAAPL XDY08YL8H612|AAPL R735QTJ8XC9X\nAAPL XDY08NC1VA7A|AAPL R735QTJ8XC9X\nAAPL XDY08YTI5WHY|AAPL R735QTJ8XC9X\nAAPL XDY08M77CR5Y|AAPL R735QTJ8XC9X\nAAPL XDY08Z1RUMYU|AAPL R735QTJ8XC9X\nAAPL XDY08NDPEMP2|AAPL R735QTJ8XC9X\nAAPL XDY08ZA1JDFQ|AAPL R735QTJ8XC9X\nAAPL XDY08M7DB37Q|AAPL R735QTJ8XC9X\nAAPL XDY08ZIB83WM|AAPL R735QTJ8XC9X\nAAPL XDY08NFCXZ6U|AAPL R735QTJ8XC9X\nAAPL XDY08ZQKWUDI|AAPL R735QTJ8XC9X\nAAPL XDY08M32KJ3A|AAPL R735QTJ8XC9X\nAAPL XDY08ZYULKUE|AAPL R735QTJ8XC9X\nAAPL XDY08NH0HBOM|AAPL R735QTJ8XC9X\nAAPL XDY09074ABBA|AAPL R735QTJ8XC9X\nAAPL XDY08M7P7RBA|AAPL R735QTJ8XC9X\nAAPL XDY090FDZ1S6|AAPL R735QTJ8XC9X\nAAPL XDY08NIO0O6E|AAPL R735QTJ8XC9X\nAAPL XDY090NNNS92|AAPL R735QTJ8XC9X\nAAPL XDY08M7V63D2|AAPL R735QTJ8XC9X\nAAPL XDY090VXCIPY|AAPL R735QTJ8XC9X\nAAPL XDY08NKBK0O6|AAPL R735QTJ8XC9X\nAAPL XDJ8JMMNVXS6|AAPL R735QTJ8XC9X\nAAPL XDY09147196U|AAPL R735QTJ8XC9X\nAAPL XDY08M814FEU|AAPL R735QTJ8XC9X\nAAPL XDJ8JMUXKO92|AAPL R735QTJ8XC9X\nAAPL XDY091CGPZNQ|AAPL R735QTJ8XC9X\nAAPL XDJ8J97R0QQU|AAPL R735QTJ8XC9X\nAAPL 31BWNMGQT5TQE|AAPL R735QTJ8XC9X\nAAPL 31CAFVRV68DZA|AAPL R735QTJ8XC9X\nAAPL 31CHC0FFCRO3Q|AAPL R735QTJ8XC9X\nAAPL 31D20EE3WDIH2|AAPL R735QTJ8XC9X\nAAPL 31D20E39LLR3A|AAPL R735QTJ8XC9X\nAAPL 31D20EEC628XY|AAPL R735QTJ8XC9X\nAAPL 31D20E268O8HY|AAPL R735QTJ8XC9X\nAAPL 31D20EEKFQZEU|AAPL R735QTJ8XC9X\nAAPL 31D20E3B953L2|AAPL R735QTJ8XC9X\nAAPL 31D20EESPFPVQ|AAPL R735QTJ8XC9X\nAAPL 31D20E26EMKJQ|AAPL R735QTJ8XC9X\nAAPL 31D20EF0Z4GCM|AAPL R735QTJ8XC9X\nAAPL 31D20E3CWOG2U|AAPL R735QTJ8XC9X\nAAPL 31D20EF98T6TI|AAPL R735QTJ8XC9X\nAAPL 31D20E26KKWLI|AAPL R735QTJ8XC9X\nAAPL 31D20EFHIHXAE|AAPL R735QTJ8XC9X\nAAPL 31D20E3EK7SKM|AAPL R735QTJ8XC9X\nAAPL 31D20EFPS6NRA|AAPL R735QTJ8XC9X\nAAPL 31D20E229UCH2|AAPL R735QTJ8XC9X\nAAPL 31D20EFY1VE86|AAPL R735QTJ8XC9X\nAAPL 31D20E3G7R52E|AAPL R735QTJ8XC9X\nAAPL 31D20EG6BK4P2|AAPL R735QTJ8XC9X\nAAPL 31D20E26WHKP2|AAPL R735QTJ8XC9X\nAAPL 31D20EGEL8V5Y|AAPL R735QTJ8XC9X\nAAPL 31D20E3HVAHK6|AAPL R735QTJ8XC9X\nAAPL 31D20EGMUXLMU|AAPL R735QTJ8XC9X\nAAPL 31D20E272FWQU|AAPL R735QTJ8XC9X\nAAPL 31D20EGV4MC3Q|AAPL R735QTJ8XC9X\nAAPL 31D20E3JITU1Y|AAPL R735QTJ8XC9X\nAAPL 31CN8P2LV5R5Y|AAPL R735QTJ8XC9X\nAAPL 31D20EH3EB2KM|AAPL R735QTJ8XC9X\nAAPL 31D20E278E8SM|AAPL R735QTJ8XC9X\nAAPL 31CN8P2U4UHMU|AAPL R735QTJ8XC9X\nAAPL 31D20EHBNZT1I|AAPL R735QTJ8XC9X\nAAPL 31CN8OP6YAK4M|AAPL R735QTJ8XC9X\nAAPL XDY08M51YEIU|AAPL R735QTJ8XC9X\nAAPL XDY08MS7F49Y|AAPL R735QTJ8XC9X\nAAPL XDY08M57WQKM|AAPL R735QTJ8XC9X\nAAPL XDY08MTUYGRQ|AAPL R735QTJ8XC9X\nAAPL XDY08M5DV2ME|AAPL R735QTJ8XC9X\nAAPL XDY08MVIHT9I|AAPL R735QTJ8XC9X\nAAPL XDY08M5JTEO6|AAPL R735QTJ8XC9X\nAAPL XDY08MX615RA|AAPL R735QTJ8XC9X\nAAPL XDY08M5PRQPY|AAPL R735QTJ8XC9X\nAAPL XDY08MYTKI92|AAPL R735QTJ8XC9X\nAAPL XDY08M2WM71I|AAPL R735QTJ8XC9X\nAAPL XDY08N0H3UQU|AAPL R735QTJ8XC9X\nAAPL XDY08M61OETI|AAPL R735QTJ8XC9X\nAAPL XDY08N24N78M|AAPL R735QTJ8XC9X\nAAPL XDY08M67MQVA|AAPL R735QTJ8XC9X\nAAPL XDY08N3S6JQE|AAPL R735QTJ8XC9X\nAAPL XDY08M6DL2X2|AAPL R735QTJ8XC9X\nAAPL XDY08N5FPW86|AAPL R735QTJ8XC9X\nAAPL XDY08M6JJEYU|AAPL R735QTJ8XC9X\nAAPL XDY08N7398PY|AAPL R735QTJ8XC9X\nAAPL XDY08M6PHR0M|AAPL R735QTJ8XC9X\nAAPL XDY08N8QSL7Q|AAPL R735QTJ8XC9X\nAAPL XDY08M6VG32E|AAPL R735QTJ8XC9X\nAAPL XDY08NLZ3D5Y|AAPL R735QTJ8XC9X\nAAPL XDY08M872RGM|AAPL R735QTJ8XC9X\nAAPL XDY08NNMMPNQ|AAPL R735QTJ8XC9X\nAAPL XDY08M8D13IE|AAPL R735QTJ8XC9X\nAAPL XDY08NPA625I|AAPL R735QTJ8XC9X\nAAPL XDJ8J7QZU45I|AAPL R735QTJ8XC9X\nAAPL XDY08M8IZFK6|AAPL R735QTJ8XC9X\nAAPL XDY08NQXPENA|AAPL R735QTJ8XC9X\nAAPL XDY08M8OXRLY|AAPL R735QTJ8XC9X\nAAPL XDY08NSL8R52|AAPL R735QTJ8XC9X\nAAPL 31D20E24987WM|AAPL R735QTJ8XC9X\nAAPL 31D20E2REOXNQ|AAPL R735QTJ8XC9X\nAAPL 31D20E24F6JYE|AAPL R735QTJ8XC9X\nAAPL 31D20E2T28A5I|AAPL R735QTJ8XC9X\nAAPL 31D20E24L4W06|AAPL R735QTJ8XC9X\nAAPL 31D20E2UPRMNA|AAPL R735QTJ8XC9X\nAAPL 31D20E24R381Y|AAPL R735QTJ8XC9X\nAAPL 31D20E2WDAZ52|AAPL R735QTJ8XC9X\nAAPL 31D20E24X1K3Q|AAPL R735QTJ8XC9X\nAAPL 31D20E2Y0UBMU|AAPL R735QTJ8XC9X\nAAPL 31D20E223W0FA|AAPL R735QTJ8XC9X\nAAPL 31D20E2ZODO4M|AAPL R735QTJ8XC9X\nAAPL 31D20E258Y87A|AAPL R735QTJ8XC9X\nAAPL 31D20E31BX0ME|AAPL R735QTJ8XC9X\nAAPL 31D20E25EWK92|AAPL R735QTJ8XC9X\nAAPL 31D20E32ZGD46|AAPL R735QTJ8XC9X\nAAPL 31D20E25KUWAU|AAPL R735QTJ8XC9X\nAAPL 31D20E34MZPLY|AAPL R735QTJ8XC9X\nAAPL 31D20E25QT8CM|AAPL R735QTJ8XC9X\nAAPL 31D20E36AJ23Q|AAPL R735QTJ8XC9X\nAAPL 31D20E25WRKEE|AAPL R735QTJ8XC9X\nAAPL 31D20E37Y2ELI|AAPL R735QTJ8XC9X\nAAPL 31D20E262PWG6|AAPL R735QTJ8XC9X\nAAPL 31D20E3L6D6JQ|AAPL R735QTJ8XC9X\nAAPL 31D20E27ECKUE|AAPL R735QTJ8XC9X\nAAPL 31D20E3MTWJ1I|AAPL R735QTJ8XC9X\nAAPL 31D20E27KAWW6|AAPL R735QTJ8XC9X\nAAPL 31D20E3OHFVJA|AAPL R735QTJ8XC9X\nAAPL 31CN8ONQ73XJA|AAPL R735QTJ8XC9X\nAAPL 31D20E27Q98XY|AAPL R735QTJ8XC9X\nAAPL 31D20E3Q4Z812|AAPL R735QTJ8XC9X\nAAPL 31D20E27W7KZQ|AAPL R735QTJ8XC9X\nAAPL 31D20E3RSIKIU|AAPL R735QTJ8XC9X\nAAPL XL7X5IMY7YW6|AAPL R735QTJ8XC9X\nAAPL XPFJZWYY05LY|AAPL R735QTJ8XC9X\nAAPL XL7X5IOLRBDY|AAPL R735QTJ8XC9X\nAAPL XPFJZX0LJI3Q|AAPL R735QTJ8XC9X\nAAPL XL7X5IQ9ANVQ|AAPL R735QTJ8XC9X\nAAPL XPFJZX292ULI|AAPL R735QTJ8XC9X\nAAPL 31KBXAYM5HS9Y|AAPL R735QTJ8XC9X\nAAPL 31OJK5CY59YZQ|AAPL R735QTJ8XC9X\nAAPL 31KBXAYNT14RQ|AAPL R735QTJ8XC9X\nAAPL 31OJK5CZSTBHI|AAPL R735QTJ8XC9X\nAAPL 31KBXAYPGKH9I|AAPL R735QTJ8XC9X\nAAPL 31OJK5D1GCNZA|AAPL R735QTJ8XC9X\nAAPL XE4WD9QQ2P3A|AAPL R735QTJ8XC9X\nAAPL XD6FQAYW7MPY|AAPL R735QTJ8XC9X\nAAPL XDDBUYJ2QWUE|AAPL R735QTJ8XC9X\nAAPL XDJ8JIQ37FT2|AAPL R735QTJ8XC9X\nAAPL XDY08X7MCR7Q|AAPL R735QTJ8XC9X\nAAPL XE4WDKRSW1C6|AAPL R735QTJ8XC9X\nAAPL XE4WDAR9SIUE|AAPL R735QTJ8XC9X\nAAPL XD6FQB75WD6U|AAPL R735QTJ8XC9X\nAAPL XDDBUYRCFNBA|AAPL R735QTJ8XC9X\nAAPL XDJ8JIYCW69Y|AAPL R735QTJ8XC9X\nAAPL XDY08XFW1HOM|AAPL R735QTJ8XC9X\nAAPL XE4WDL02KRT2|AAPL R735QTJ8XC9X\nAAPL XE4WD9QW1152|AAPL R735QTJ8XC9X\nAAPL XD6FQBFFL3NQ|AAPL R735QTJ8XC9X\nAAPL XDDBUYZM4DS6|AAPL R735QTJ8XC9X\nAAPL XDJ8JJ6MKWQU|AAPL R735QTJ8XC9X\nAAPL XDY08XO5Q85I|AAPL R735QTJ8XC9X\nAAPL XE4WDL8C9I9Y|AAPL R735QTJ8XC9X\nAAPL XE4WDASXBVC6|AAPL R735QTJ8XC9X\nAAPL XD6FQBNP9U4M|AAPL R735QTJ8XC9X\nAAPL XDDBUZ7VT492|AAPL R735QTJ8XC9X\nAAPL XDY08XWFEYME|AAPL R735QTJ8XC9X\nAAPL XE4WDLGLY8QU|AAPL R735QTJ8XC9X\nAAPL XE4WD9R1ZD6U|AAPL R735QTJ8XC9X\nAAPL XE4WDLOVMZ7Q|AAPL R735QTJ8XC9X\nAAPL XE4WDAUKV7TY|AAPL R735QTJ8XC9X\nAAPL XE4WDLX5BPOM|AAPL R735QTJ8XC9X\nAAPL XE4WD9R7XP8M|AAPL R735QTJ8XC9X\nAAPL XE4WDM5F0G5I|AAPL R735QTJ8XC9X\nAAPL XE4WDAW8EKBQ|AAPL R735QTJ8XC9X\nAAPL XE4WDMDOP6ME|AAPL R735QTJ8XC9X\nAAPL XE4WD9RDW1AE|AAPL R735QTJ8XC9X\nAAPL XE4WDMLYDX3A|AAPL R735QTJ8XC9X\nAAPL XE4WDAXVXWTI|AAPL R735QTJ8XC9X\nAAPL XE4WDMU82NK6|AAPL R735QTJ8XC9X\nAAPL XE4WD9RJUDC6|AAPL R735QTJ8XC9X\nAAPL XE4WDN2HRE12|AAPL R735QTJ8XC9X\nAAPL XE4WDAZJH9BA|AAPL R735QTJ8XC9X\nAAPL XE4WDNARG4HY|AAPL R735QTJ8XC9X\nAAPL XE4WD9N93T7Q|AAPL R735QTJ8XC9X\nAAPL XE4WDNJ14UYU|AAPL R735QTJ8XC9X\nAAPL XE4WDB170LT2|AAPL R735QTJ8XC9X\nAAPL XE4WDNRATLFQ|AAPL R735QTJ8XC9X\nAAPL XE4WD9RVR1FQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIPPXCIH2|AAPL R735QTJ8XC9X\nAAPL 31CAFVQY3HG3Q|AAPL R735QTJ8XC9X\nAAPL 31CHC0EIA0Q86|AAPL R735QTJ8XC9X\nAAPL 31CN8OYPAH96U|AAPL R735QTJ8XC9X\nAAPL 31D20ED6TMKLI|AAPL R735QTJ8XC9X\nAAPL 31D8WJ0R05UPY|AAPL R735QTJ8XC9X\nAAPL 31D8WIQQH2C86|AAPL R735QTJ8XC9X\nAAPL 31CAFVR6D66KM|AAPL R735QTJ8XC9X\nAAPL 31CHC0EQJPGP2|AAPL R735QTJ8XC9X\nAAPL 31CN8OYXK5ZNQ|AAPL R735QTJ8XC9X\nAAPL 31D20EDF3BB2E|AAPL R735QTJ8XC9X\nAAPL 31D8WJ0Z9UL6U|AAPL R735QTJ8XC9X\nAAPL 31D8WIPQ3AUIU|AAPL R735QTJ8XC9X\nAAPL 31CAFVREMUX1I|AAPL R735QTJ8XC9X\nAAPL 31CHC0EYTE75Y|AAPL R735QTJ8XC9X\nAAPL 31CN8OZ5TUQ4M|AAPL R735QTJ8XC9X\nAAPL 31D20EDND01JA|AAPL R735QTJ8XC9X\nAAPL 31D8WJ17JJBNQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIQS4LOPY|AAPL R735QTJ8XC9X\nAAPL 31CAFVRMWJNIE|AAPL R735QTJ8XC9X\nAAPL 31CHC0F732XMU|AAPL R735QTJ8XC9X\nAAPL 31D20EDVMOS06|AAPL R735QTJ8XC9X\nAAPL 31D8WJ1FT824M|AAPL R735QTJ8XC9X\nAAPL 31D8WIPQ996KM|AAPL R735QTJ8XC9X\nAAPL 31D8WJ1O2WSLI|AAPL R735QTJ8XC9X\nAAPL 31D8WIQTS517Q|AAPL R735QTJ8XC9X\nAAPL 31D8WJ1WCLJ2E|AAPL R735QTJ8XC9X\nAAPL 31D8WIPQF7IME|AAPL R735QTJ8XC9X\nAAPL 31D8WJ24MA9JA|AAPL R735QTJ8XC9X\nAAPL 31D8WIQVFODPI|AAPL R735QTJ8XC9X\nAAPL 31D8WJ2CVZ006|AAPL R735QTJ8XC9X\nAAPL 31D8WIPQL5UO6|AAPL R735QTJ8XC9X\nAAPL 31D8WJ2L5NQH2|AAPL R735QTJ8XC9X\nAAPL 31D8WIQX37Q7A|AAPL R735QTJ8XC9X\nAAPL 31D8WJ2TFCGXY|AAPL R735QTJ8XC9X\nAAPL 31D8WIPQR46PY|AAPL R735QTJ8XC9X\nAAPL 31D8WJ31P17EU|AAPL R735QTJ8XC9X\nAAPL 31D8WIQYQR2P2|AAPL R735QTJ8XC9X\nAAPL 31D8WJ39YPXVQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIPMGDMLI|AAPL R735QTJ8XC9X\nAAPL 31D8WJ3I8EOCM|AAPL R735QTJ8XC9X\nAAPL 31D8WIR0EAF6U|AAPL R735QTJ8XC9X\nAAPL 31D8WJ3QI3ETI|AAPL R735QTJ8XC9X\nAAPL 31D8WIPR30UTI|AAPL R735QTJ8XC9X\nAAPL XD6FQ0G67ASM|AAPL R735QTJ8XC9X\nAAPL XDDBUO0CQKX2|AAPL R735QTJ8XC9X\nAAPL XDJ8J87D73VQ|AAPL R735QTJ8XC9X\nAAPL XDY08MOWCFAE|AAPL R735QTJ8XC9X\nAAPL XE4WDA92VPEU|AAPL R735QTJ8XC9X\nAAPL XDY08M4W02H2|AAPL R735QTJ8XC9X\nAAPL XE4WD9P2JCLI|AAPL R735QTJ8XC9X\nAAPL XDY08MQJVRS6|AAPL R735QTJ8XC9X\nAAPL XE4WDAAQF1WM|AAPL R735QTJ8XC9X\nAAPL XE4WD9P8HONA|AAPL R735QTJ8XC9X\nAAPL XE4WDACDYEEE|AAPL R735QTJ8XC9X\nAAPL XE4WD9PEG0P2|AAPL R735QTJ8XC9X\nAAPL XE4WDAE1HQW6|AAPL R735QTJ8XC9X\nAAPL XE4WD9PKECQU|AAPL R735QTJ8XC9X\nAAPL XE4WDAFP13DY|AAPL R735QTJ8XC9X\nAAPL XE4WD9PQCOSM|AAPL R735QTJ8XC9X\nAAPL XE4WDAHCKFVQ|AAPL R735QTJ8XC9X\nAAPL XE4WD9PWB0UE|AAPL R735QTJ8XC9X\nAAPL XE4WDAJ03SDI|AAPL R735QTJ8XC9X\nAAPL XE4WD9N35H5Y|AAPL R735QTJ8XC9X\nAAPL XE4WDAKNN4VA|AAPL R735QTJ8XC9X\nAAPL XE4WD9Q87OXY|AAPL R735QTJ8XC9X\nAAPL XE4WDAMB6HD2|AAPL R735QTJ8XC9X\nAAPL XE4WD9QE60ZQ|AAPL R735QTJ8XC9X\nAAPL XE4WDANYPTUU|AAPL R735QTJ8XC9X\nAAPL XE4WD9QK4D1I|AAPL R735QTJ8XC9X\nAAPL XE4WDAPM96CM|AAPL R735QTJ8XC9X\nAAPL XE4WDB2UJYAU|AAPL R735QTJ8XC9X\nAAPL XE4WD9S1PDHI|AAPL R735QTJ8XC9X\nAAPL XE4WDB4I3ASM|AAPL R735QTJ8XC9X\nAAPL XE4WD9S7NPJA|AAPL R735QTJ8XC9X\nAAPL XE4WDB65MNAE|AAPL R735QTJ8XC9X\nAAPL XE4WD9SDM1L2|AAPL R735QTJ8XC9X\nAAPL XE4WDB7T5ZS6|AAPL R735QTJ8XC9X\nAAPL XE4WD9SJKDMU|AAPL R735QTJ8XC9X\nAAPL XE4WDB9GPC9Y|AAPL R735QTJ8XC9X\nAAPL XE4WD9SPIPOM|AAPL R735QTJ8XC9X\nAAPL XDJ8J99EK38M|AAPL R735QTJ8XC9X\nAAPL XE4WDBB48ORQ|AAPL R735QTJ8XC9X\nAAPL XDY08M8UW3NQ|AAPL R735QTJ8XC9X\nAAPL 31CAFVGFDH46E|AAPL R735QTJ8XC9X\nAAPL 31CHC03ZK0EAU|AAPL R735QTJ8XC9X\nAAPL 31CN8OO6KGX9I|AAPL R735QTJ8XC9X\nAAPL 31D20E2O3M8O6|AAPL R735QTJ8XC9X\nAAPL 31D8WIQ8A5ISM|AAPL R735QTJ8XC9X\nAAPL 31D20E2439VUU|AAPL R735QTJ8XC9X\nAAPL 31D8WIPO9T5ZA|AAPL R735QTJ8XC9X\nAAPL 31D20E2PR5L5Y|AAPL R735QTJ8XC9X\nAAPL 31D8WIQ9XOVAE|AAPL R735QTJ8XC9X\nAAPL 31D8WIPOFRI12|AAPL R735QTJ8XC9X\nAAPL 31D8WIQBL87S6|AAPL R735QTJ8XC9X\nAAPL 31D8WIPOLPU2U|AAPL R735QTJ8XC9X\nAAPL 31D8WIQD8RK9Y|AAPL R735QTJ8XC9X\nAAPL 31D8WIPORO64M|AAPL R735QTJ8XC9X\nAAPL 31D8WIQEWAWRQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIPOXMI6E|AAPL R735QTJ8XC9X\nAAPL 31D8WIQGJU99I|AAPL R735QTJ8XC9X\nAAPL 31D8WIPP3KU86|AAPL R735QTJ8XC9X\nAAPL 31D8WIQI7DLRA|AAPL R735QTJ8XC9X\nAAPL 31D8WIPMAFAJQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIQJUWY92|AAPL R735QTJ8XC9X\nAAPL 31D8WIPPFHIBQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIQLIGAQU|AAPL R735QTJ8XC9X\nAAPL 31D8WIPPLFUDI|AAPL R735QTJ8XC9X\nAAPL 31D8WIQN5ZN8M|AAPL R735QTJ8XC9X\nAAPL 31D8WIPPRE6FA|AAPL R735QTJ8XC9X\nAAPL 31D8WIQOTIZQE|AAPL R735QTJ8XC9X\nAAPL 31D8WIR21TROM|AAPL R735QTJ8XC9X\nAAPL 31D8WIPR8Z6VA|AAPL R735QTJ8XC9X\nAAPL 31D8WIR3PD46E|AAPL R735QTJ8XC9X\nAAPL 31D8WIPREXIX2|AAPL R735QTJ8XC9X\nAAPL 31D8WIR5CWGO6|AAPL R735QTJ8XC9X\nAAPL 31D8WIPRKVUYU|AAPL R735QTJ8XC9X\nAAPL 31D8WIR70FT5Y|AAPL R735QTJ8XC9X\nAAPL 31D8WIPRQU70M|AAPL R735QTJ8XC9X\nAAPL 31D8WIR8NZ5NQ|AAPL R735QTJ8XC9X\nAAPL 31D8WIPRWSJ2E|AAPL R735QTJ8XC9X\nAAPL 31CN8OP8LTWME|AAPL R735QTJ8XC9X\nAAPL 31D8WIRABII5I|AAPL R735QTJ8XC9X\nAAPL 31D20E2825X1I|AAPL R735QTJ8XC9X\nAAPL XE4WD9SVH1QE|AAPL R735QTJ8XC9X\nAAPL XE4WDBCRS19I|AAPL R735QTJ8XC9X\nAAPL 31D8WIPS2QV46|AAPL R735QTJ8XC9X\nAAPL 31D8WIRBZ1UNA|AAPL R735QTJ8XC9X\nAAPL XD6FPZVZWLXI|AAPL R735QTJ8XC9X\nAAPL XDDBUNG6FW1Y|AAPL R735QTJ8XC9X\nAAPL XDJ8J7N6WF0M|AAPL R735QTJ8XC9X\nAAPL XDY08M4Q1QFA|AAPL R735QTJ8XC9X\nAAPL XE4WD9OWL0JQ|AAPL R735QTJ8XC9X\nAAPL XEIOMKT9NKSM|AAPL R735QTJ8XC9X\nAAPL XG8PSGUWH3WM|AAPL R735QTJ8XC9X\nAAPL XIQBGZ59FRIE|AAPL R735QTJ8XC9X\nAAPL XKGCMV6W9AME|AAPL R735QTJ8XC9X\nAAPL XZDYPWX21892|AAPL R735QTJ8XC9X\nAAPL 31CAFVFV76FBA|AAPL R735QTJ8XC9X\nAAPL 31CHC03FDPPFQ|AAPL R735QTJ8XC9X\nAAPL 31CN8ONME68EE|AAPL R735QTJ8XC9X\nAAPL 31D20E23XBJT2|AAPL R735QTJ8XC9X\nAAPL 31D8WIPO3UTXI|AAPL R735QTJ8XC9X\nAAPL 31DMOS0SGXE6E|AAPL R735QTJ8XC9X\nAAPL 31FCPXWU3QXAE|AAPL R735QTJ8XC9X\nAAPL 31HUBMF4GPKW6|AAPL R735QTJ8XC9X\nAAPL 31JKCSB63J406|AAPL R735QTJ8XC9X\nAAPL 31YHYVCW9B1MU|AAPL R735QTJ8XC9X\nAAPL XD6FQ0EINYAU|AAPL R735QTJ8XC9X\nAAPL XDDBUNYP78FA|AAPL R735QTJ8XC9X\nAAPL XDJ8J85PNRDY|AAPL R735QTJ8XC9X\nAAPL XDY08MN8T2SM|AAPL R735QTJ8XC9X\nAAPL XE4WDA7FCCX2|AAPL R735QTJ8XC9X\nAAPL XEIOMLBSEX5Y|AAPL R735QTJ8XC9X\nAAPL XG8PSHDF8G9Y|AAPL R735QTJ8XC9X\nAAPL XIQBGZNS73VQ|AAPL R735QTJ8XC9X\nAAPL XKGCMVPF0MZQ|AAPL R735QTJ8XC9X\nAAPL XZDYPXFKSKME|AAPL R735QTJ8XC9X\nAAPL 31CAFVGDPXROM|AAPL R735QTJ8XC9X\nAAPL 31CHC03XWH1T2|AAPL R735QTJ8XC9X\nAAPL 31CN8OO4WXKRQ|AAPL R735QTJ8XC9X\nAAPL 31D20E2MG2W6E|AAPL R735QTJ8XC9X\nAAPL 31D8WIQ6MM6AU|AAPL R735QTJ8XC9X\nAAPL 31DMOS1AZOQJQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXXCMI9NQ|AAPL R735QTJ8XC9X\nAAPL 31HUBMFMZGX9I|AAPL R735QTJ8XC9X\nAAPL 31JKCSBOMAGDI|AAPL R735QTJ8XC9X\nAAPL 31YHYVDES2E06|AAPL R735QTJ8XC9X\nAAPL XDR449NFTH3A|AAPL R735QTJ8XC9X\nAAPL XDR449VPI7K6|AAPL R735QTJ8XC9X\nAAPL XDR44A3Z6Y12|AAPL R735QTJ8XC9X\nAAPL XDR44AC8VOHY|AAPL R735QTJ8XC9X\nAAPL XDR44AKIKEYU|AAPL R735QTJ8XC9X\nAAPL XDR44ASS95FQ|AAPL R735QTJ8XC9X\nAAPL 31CV49PMN3AH2|AAPL R735QTJ8XC9X\nAAPL 31CV49PUWS0XY|AAPL R735QTJ8XC9X\nAAPL 31CV49Q36GREU|AAPL R735QTJ8XC9X\nAAPL 31CV49QBG5HVQ|AAPL R735QTJ8XC9X\nAAPL 31CV49QJPU8CM|AAPL R735QTJ8XC9X\nAAPL 31CV49QRZIYTI|AAPL R735QTJ8XC9X\nAAPL XD6FQ0CV4LT2|AAPL R735QTJ8XC9X\nAAPL XDDBUNX1NVXI|AAPL R735QTJ8XC9X\nAAPL XDJ8J8424EW6|AAPL R735QTJ8XC9X\nAAPL XDY08MLL9QAU|AAPL R735QTJ8XC9X\nAAPL XE4WDA5RT0FA|AAPL R735QTJ8XC9X\nAAPL XEIOMLA4VKO6|AAPL R735QTJ8XC9X\nAAPL XG8PSHBRP3S6|AAPL R735QTJ8XC9X\nAAPL XIQBGZM4NRDY|AAPL R735QTJ8XC9X\nAAPL XKGCMVNRHAHY|AAPL R735QTJ8XC9X\nAAPL XZDYPXDX984M|AAPL R735QTJ8XC9X\nAAPL XD6FPZVTY9VQ|AAPL R735QTJ8XC9X\nAAPL XDDBUNG0HK06|AAPL R735QTJ8XC9X\nAAPL XDJ8J7N0Y2YU|AAPL R735QTJ8XC9X\nAAPL XDY08M4K3EDI|AAPL R735QTJ8XC9X\nAAPL XE4WD9OQMOHY|AAPL R735QTJ8XC9X\nAAPL XEIOMKT3P8QU|AAPL R735QTJ8XC9X\nAAPL XG8PSGUQIRUU|AAPL R735QTJ8XC9X\nAAPL XIQBGZ53HFGM|AAPL R735QTJ8XC9X\nAAPL XKGCMV6QAYKM|AAPL R735QTJ8XC9X\nAAPL XZDYPWWW2W7A|AAPL R735QTJ8XC9X\nAAPL XFH59VQ72U7A|AAPL R735QTJ8XC9X\nAAPL XFH59VRUM6P2|AAPL R735QTJ8XC9X\nAAPL XFH59VTI5J6U|AAPL R735QTJ8XC9X\nAAPL XFH59VV5OVOM|AAPL R735QTJ8XC9X\nAAPL XFH59VWT886E|AAPL R735QTJ8XC9X\nAAPL 31CAFVGC2EF6U|AAPL R735QTJ8XC9X\nAAPL 31CHC03W8XPBA|AAPL R735QTJ8XC9X\nAAPL 31CN8OO39E89Y|AAPL R735QTJ8XC9X\nAAPL 31D20E2KSJJOM|AAPL R735QTJ8XC9X\nAAPL 31D8WIQ4Z2TT2|AAPL R735QTJ8XC9X\nAAPL 31DMOS19C5E1Y|AAPL R735QTJ8XC9X\nAAPL 31FCPXXAYYX5Y|AAPL R735QTJ8XC9X\nAAPL 31HUBMFLBXKRQ|AAPL R735QTJ8XC9X\nAAPL 31JKCSBMYR3VQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVDD4J1IE|AAPL R735QTJ8XC9X\nAAPL 31CAFVFV1839I|AAPL R735QTJ8XC9X\nAAPL 31CHC03F7RDDY|AAPL R735QTJ8XC9X\nAAPL 31CN8ONM87WCM|AAPL R735QTJ8XC9X\nAAPL 31D20E23RD7RA|AAPL R735QTJ8XC9X\nAAPL 31D8WIPNXWHVQ|AAPL R735QTJ8XC9X\nAAPL 31DMOS0SAZ24M|AAPL R735QTJ8XC9X\nAAPL 31FCPXWTXSL8M|AAPL R735QTJ8XC9X\nAAPL 31HUBMF4AR8UE|AAPL R735QTJ8XC9X\nAAPL 31JKCSB5XKRYE|AAPL R735QTJ8XC9X\nAAPL 31YHYVCW3CPL2|AAPL R735QTJ8XC9X\nAAPL 31EL5FBPECNL2|AAPL R735QTJ8XC9X\nAAPL 31EL5FBR1W02U|AAPL R735QTJ8XC9X\nAAPL 31EL5FBSPFCKM|AAPL R735QTJ8XC9X\nAAPL 31EL5FBUCYP2E|AAPL R735QTJ8XC9X\nAAPL 31EL5FBW0I1K6|AAPL R735QTJ8XC9X\nAAPL XE4WDKJJ7AVA|AAPL R735QTJ8XC9X\nAAPL 31D8WJ0IQH492|AAPL R735QTJ8XC9X\nAAPL XEBSHY1J3Q06|AAPL R735QTJ8XC9X\nAAPL XEBSHXA2UAYU|AAPL R735QTJ8XC9X\nAAPL XEBSHY36N2HY|AAPL R735QTJ8XC9X\nAAPL XEBSHX79ORAE|AAPL R735QTJ8XC9X\nAAPL XEBSHY4U6EZQ|AAPL R735QTJ8XC9X\nAAPL XEBSHXAEQZ2E|AAPL R735QTJ8XC9X\nAAPL XEBSHY6HPRHI|AAPL R735QTJ8XC9X\nAAPL XEBSHXAKPB46|AAPL R735QTJ8XC9X\nAAPL XEBSHY8593ZA|AAPL R735QTJ8XC9X\nAAPL XEBSHXAQNN5Y|AAPL R735QTJ8XC9X\nAAPL XDDBUY2JDFWM|AAPL R735QTJ8XC9X\nAAPL XDJ8JI9JTYVA|AAPL R735QTJ8XC9X\nAAPL XDY08WR2ZA9Y|AAPL R735QTJ8XC9X\nAAPL XE4WDKB9IKEE|AAPL R735QTJ8XC9X\nAAPL XEBSI7VG1UIU|AAPL R735QTJ8XC9X\nAAPL XEBSHY9SSGH2|AAPL R735QTJ8XC9X\nAAPL XDDBUYAT26DI|AAPL R735QTJ8XC9X\nAAPL XDJ8JIHTIPC6|AAPL R735QTJ8XC9X\nAAPL XDY08WZCO0QU|AAPL R735QTJ8XC9X\nAAPL XEBSI83PQKZQ|AAPL R735QTJ8XC9X\nAAPL XEBSHXAWLZ7Q|AAPL R735QTJ8XC9X\nAAPL XEBSI8BZFBGM|AAPL R735QTJ8XC9X\nAAPL XEBSHYBGBSYU|AAPL R735QTJ8XC9X\nAAPL XEBSI8K941XI|AAPL R735QTJ8XC9X\nAAPL XEBSHXB2KB9I|AAPL R735QTJ8XC9X\nAAPL XEBSI8SISSEE|AAPL R735QTJ8XC9X\nAAPL XEBSHYD3V5GM|AAPL R735QTJ8XC9X\nAAPL XEBSI90SHIVA|AAPL R735QTJ8XC9X\nAAPL XEBSHXB8INBA|AAPL R735QTJ8XC9X\nAAPL XEBSI99269C6|AAPL R735QTJ8XC9X\nAAPL XEBSHYEREHYE|AAPL R735QTJ8XC9X\nAAPL XEBSI9HBUZT2|AAPL R735QTJ8XC9X\nAAPL XEBSHXBEGZD2|AAPL R735QTJ8XC9X\nAAPL XEBSI9PLJQ9Y|AAPL R735QTJ8XC9X\nAAPL XEBSHYGEXUG6|AAPL R735QTJ8XC9X\nAAPL XEBSI9XV8GQU|AAPL R735QTJ8XC9X\nAAPL XEBSHXBKFBEU|AAPL R735QTJ8XC9X\nAAPL XEBSHYI2H6XY|AAPL R735QTJ8XC9X\nAAPL XEBSHXBQDNGM|AAPL R735QTJ8XC9X\nAAPL XEBSHYJQ0JFQ|AAPL R735QTJ8XC9X\nAAPL XEBSHX7FN3C6|AAPL R735QTJ8XC9X\nAAPL XEBSHYLDJVXI|AAPL R735QTJ8XC9X\nAAPL XEBSHXC2ABK6|AAPL R735QTJ8XC9X\nAAPL XEBSHYN138FA|AAPL R735QTJ8XC9X\nAAPL XEBSHXC88NLY|AAPL R735QTJ8XC9X\nAAPL XEBSHYOOMKX2|AAPL R735QTJ8XC9X\nAAPL 31DFSNE0QDJDY|AAPL R735QTJ8XC9X\nAAPL 31DFSND9A44CM|AAPL R735QTJ8XC9X\nAAPL 31DFSNE2DWVVQ|AAPL R735QTJ8XC9X\nAAPL 31DFSND6GYKO6|AAPL R735QTJ8XC9X\nAAPL 31DFSNE41G8DI|AAPL R735QTJ8XC9X\nAAPL 31DFSND9M0SG6|AAPL R735QTJ8XC9X\nAAPL 31DFSNE5OZKVA|AAPL R735QTJ8XC9X\nAAPL 31DFSND9RZ4HY|AAPL R735QTJ8XC9X\nAAPL 31DFSNE7CIXD2|AAPL R735QTJ8XC9X\nAAPL 31DFSND9XXGJQ|AAPL R735QTJ8XC9X\nAAPL 31CHC0E1QN9AE|AAPL R735QTJ8XC9X\nAAPL 31CN8OY8R3S92|AAPL R735QTJ8XC9X\nAAPL 31D20ECQA93NQ|AAPL R735QTJ8XC9X\nAAPL 31D8WJ0AGSDS6|AAPL R735QTJ8XC9X\nAAPL 31DFSNNUNBNWM|AAPL R735QTJ8XC9X\nAAPL 31DFSNE9029UU|AAPL R735QTJ8XC9X\nAAPL 31CHC0EA0BZRA|AAPL R735QTJ8XC9X\nAAPL 31CN8OYH0SIPY|AAPL R735QTJ8XC9X\nAAPL 31D20ECYJXU4M|AAPL R735QTJ8XC9X\nAAPL 31DFSNO2X0EDI|AAPL R735QTJ8XC9X\nAAPL 31DFSNDA3VSLI|AAPL R735QTJ8XC9X\nAAPL 31DFSNOB6P4UE|AAPL R735QTJ8XC9X\nAAPL 31DFSNEANLMCM|AAPL R735QTJ8XC9X\nAAPL 31DFSNOJGDVBA|AAPL R735QTJ8XC9X\nAAPL 31DFSNDA9U4NA|AAPL R735QTJ8XC9X\nAAPL 31DFSNORQ2LS6|AAPL R735QTJ8XC9X\nAAPL 31DFSNECB4YUE|AAPL R735QTJ8XC9X\nAAPL 31DFSNOZZRC92|AAPL R735QTJ8XC9X\nAAPL 31DFSNDAFSGP2|AAPL R735QTJ8XC9X\nAAPL 31DFSNP89G2PY|AAPL R735QTJ8XC9X\nAAPL 31DFSNEDYOBC6|AAPL R735QTJ8XC9X\nAAPL 31DFSNPGJ4T6U|AAPL R735QTJ8XC9X\nAAPL 31DFSNDALQSQU|AAPL R735QTJ8XC9X\nAAPL 31DFSNPOSTJNQ|AAPL R735QTJ8XC9X\nAAPL 31DFSNEFM7NTY|AAPL R735QTJ8XC9X\nAAPL 31DFSNPX2IA4M|AAPL R735QTJ8XC9X\nAAPL 31DFSNDARP4SM|AAPL R735QTJ8XC9X\nAAPL 31DFSNEH9R0BQ|AAPL R735QTJ8XC9X\nAAPL 31DFSNDAXNGUE|AAPL R735QTJ8XC9X\nAAPL 31DFSNEIXACTI|AAPL R735QTJ8XC9X\nAAPL 31DFSND6MWWPY|AAPL R735QTJ8XC9X\nAAPL 31DFSNEKKTPBA|AAPL R735QTJ8XC9X\nAAPL 31DFSNDB9K4XY|AAPL R735QTJ8XC9X\nAAPL 31DFSNEM8D1T2|AAPL R735QTJ8XC9X\nAAPL 31DFSNDBFIGZQ|AAPL R735QTJ8XC9X\nAAPL 31DFSNENVWEAU|AAPL R735QTJ8XC9X\nAAPL XEBSHX934AO6|AAPL R735QTJ8XC9X\nAAPL XEBSHXT9EZJA|AAPL R735QTJ8XC9X\nAAPL XEBSHX992MPY|AAPL R735QTJ8XC9X\nAAPL XEBSHXUWYC12|AAPL R735QTJ8XC9X\nAAPL XEBSHX9F0YRQ|AAPL R735QTJ8XC9X\nAAPL XEBSHXWKHOIU|AAPL R735QTJ8XC9X\nAAPL XEBSHX9KZATI|AAPL R735QTJ8XC9X\nAAPL XEBSHXY8110M|AAPL R735QTJ8XC9X\nAAPL XEBSHX9QXMVA|AAPL R735QTJ8XC9X\nAAPL XEBSHXZVKDIE|AAPL R735QTJ8XC9X\nAAPL XEBSHX9WVYX2|AAPL R735QTJ8XC9X\nAAPL XEBSHXCE6ZNQ|AAPL R735QTJ8XC9X\nAAPL XEBSHYQC5XEU|AAPL R735QTJ8XC9X\nAAPL XEBSHXCK5BPI|AAPL R735QTJ8XC9X\nAAPL XEBSHYRZP9WM|AAPL R735QTJ8XC9X\nAAPL XFH59W6QGB52|AAPL R735QTJ8XC9X\nAAPL XFH59W8DZNMU|AAPL R735QTJ8XC9X\nAAPL XFH59WA1J04M|AAPL R735QTJ8XC9X\nAAPL XE4WD9T1FDS6|AAPL R735QTJ8XC9X\nAAPL 31DFSND8AE41Y|AAPL R735QTJ8XC9X\nAAPL 31DFSNDSGOSX2|AAPL R735QTJ8XC9X\nAAPL 31DFSND8GCG3Q|AAPL R735QTJ8XC9X\nAAPL 31DFSNDU485EU|AAPL R735QTJ8XC9X\nAAPL 31DFSND8MAS5I|AAPL R735QTJ8XC9X\nAAPL 31DFSNDVRRHWM|AAPL R735QTJ8XC9X\nAAPL 31DFSND8S947A|AAPL R735QTJ8XC9X\nAAPL 31DFSNDXFAUEE|AAPL R735QTJ8XC9X\nAAPL 31DFSND8Y7G92|AAPL R735QTJ8XC9X\nAAPL 31DFSNDZ2U6W6|AAPL R735QTJ8XC9X\nAAPL 31DFSND945SAU|AAPL R735QTJ8XC9X\nAAPL 31DFSNDBLGT1I|AAPL R735QTJ8XC9X\nAAPL 31DFSNEPJFQSM|AAPL R735QTJ8XC9X\nAAPL 31DFSNDBRF53A|AAPL R735QTJ8XC9X\nAAPL 31DFSNER6Z3AE|AAPL R735QTJ8XC9X\nAAPL 31EL5FC5XQ4IU|AAPL R735QTJ8XC9X\nAAPL 31EL5FC7L9H0M|AAPL R735QTJ8XC9X\nAAPL 31EL5FC98STIE|AAPL R735QTJ8XC9X\nAAPL 31D8WIPS8P75Y|AAPL R735QTJ8XC9X\nAAPL XEBSHXCQ3NRA|AAPL R735QTJ8XC9X\nAAPL XEBSHYTN8MEE|AAPL R735QTJ8XC9X\nAAPL XEBSHXCW1ZT2|AAPL R735QTJ8XC9X\nAAPL 31DFSNDBXDH52|AAPL R735QTJ8XC9X\nAAPL 31DFSNESUIFS6|AAPL R735QTJ8XC9X\nAAPL 31DFSNDC3BT6U|AAPL R735QTJ8XC9X\nAAPL XDR4496WG05I|AAPL R735QTJ8XC9X\nAAPL XDR449F64QME|AAPL R735QTJ8XC9X\nAAPL XDR44B11XVWM|AAPL R735QTJ8XC9X\nAAPL XEBSHYVARYW6|AAPL R735QTJ8XC9X\nAAPL XEBSHXD20BUU|AAPL R735QTJ8XC9X\nAAPL XEBSHYWYBBDY|AAPL R735QTJ8XC9X\nAAPL 31CV49P63PTJA|AAPL R735QTJ8XC9X\nAAPL 31CV49PEDEK06|AAPL R735QTJ8XC9X\nAAPL 31CV49R097PAE|AAPL R735QTJ8XC9X\nAAPL 31DFSNEUI1S9Y|AAPL R735QTJ8XC9X\nAAPL 31DFSNDC9A58M|AAPL R735QTJ8XC9X\nAAPL 31DFSNEW5L4RQ|AAPL R735QTJ8XC9X\nAAPL XEPKR8E40746|AAPL R735QTJ8XC9X\nAAPL XEPKR948MXRA|AAPL R735QTJ8XC9X\nAAPL XEPKR8E9YJ5Y|AAPL R735QTJ8XC9X\nAAPL XEPKR95W6A92|AAPL R735QTJ8XC9X\nAAPL XEPKR8EFWV7Q|AAPL R735QTJ8XC9X\nAAPL XEPKR97JPMQU|AAPL R735QTJ8XC9X\nAAPL XEPKR8BMRBJA|AAPL R735QTJ8XC9X\nAAPL XEPKR9978Z8M|AAPL R735QTJ8XC9X\nAAPL XEPKR8ERTJBA|AAPL R735QTJ8XC9X\nAAPL XEPKR9AUSBQE|AAPL R735QTJ8XC9X\nAAPL XDJ8JHKQRRGM|AAPL R735QTJ8XC9X\nAAPL XDY08W29X2VA|AAPL R735QTJ8XC9X\nAAPL XE4WDJMGGCZQ|AAPL R735QTJ8XC9X\nAAPL XEBSI76MZN46|AAPL R735QTJ8XC9X\nAAPL XEPKRIB027D2|AAPL R735QTJ8XC9X\nAAPL XEPKR8EXRVD2|AAPL R735QTJ8XC9X\nAAPL XDJ8JHT0GHXI|AAPL R735QTJ8XC9X\nAAPL XDY08WAJLTC6|AAPL R735QTJ8XC9X\nAAPL XE4WDJUQ53GM|AAPL R735QTJ8XC9X\nAAPL XEBSI7EWODL2|AAPL R735QTJ8XC9X\nAAPL XEPKRIJ9QXTY|AAPL R735QTJ8XC9X\nAAPL XEPKR9CIBO86|AAPL R735QTJ8XC9X\nAAPL XDJ8JI1A58EE|AAPL R735QTJ8XC9X\nAAPL XDY08WITAJT2|AAPL R735QTJ8XC9X\nAAPL XE4WDK2ZTTXI|AAPL R735QTJ8XC9X\nAAPL XEBSI7N6D41Y|AAPL R735QTJ8XC9X\nAAPL XEPKRIRJFOAU|AAPL R735QTJ8XC9X\nAAPL XEPKR8F3Q7EU|AAPL R735QTJ8XC9X\nAAPL XEPKRIZT4ERQ|AAPL R735QTJ8XC9X\nAAPL XEPKR9E5V0PY|AAPL R735QTJ8XC9X\nAAPL XEPKRJ82T58M|AAPL R735QTJ8XC9X\nAAPL XEPKR8F9OJGM|AAPL R735QTJ8XC9X\nAAPL XEPKRJGCHVPI|AAPL R735QTJ8XC9X\nAAPL XEPKR9FTED7Q|AAPL R735QTJ8XC9X\nAAPL XEPKRJOM6M6E|AAPL R735QTJ8XC9X\nAAPL XEPKR8FFMVIE|AAPL R735QTJ8XC9X\nAAPL XEPKRJWVVCNA|AAPL R735QTJ8XC9X\nAAPL XEPKR9HGXPPI|AAPL R735QTJ8XC9X\nAAPL XEPKRK55K346|AAPL R735QTJ8XC9X\nAAPL XEPKR8FLL7K6|AAPL R735QTJ8XC9X\nAAPL XEPKRKDF8TL2|AAPL R735QTJ8XC9X\nAAPL XEPKR9J4H27A|AAPL R735QTJ8XC9X\nAAPL XEPKRKLOXK1Y|AAPL R735QTJ8XC9X\nAAPL XEPKR8FRJJLY|AAPL R735QTJ8XC9X\nAAPL XEPKR9KS0EP2|AAPL R735QTJ8XC9X\nAAPL XEPKR8FXHVNQ|AAPL R735QTJ8XC9X\nAAPL XEPKR9MFJR6U|AAPL R735QTJ8XC9X\nAAPL XEPKR8G3G7PI|AAPL R735QTJ8XC9X\nAAPL XEPKR9O333OM|AAPL R735QTJ8XC9X\nAAPL XEPKR8BSPNL2|AAPL R735QTJ8XC9X\nAAPL XEPKR9PQMG6E|AAPL R735QTJ8XC9X\nAAPL XEPKR8GFCVT2|AAPL R735QTJ8XC9X\nAAPL XEPKR9RE5SO6|AAPL R735QTJ8XC9X\nAAPL 31DTKWODBA0HY|AAPL R735QTJ8XC9X\nAAPL 31DTKWP3FWR52|AAPL R735QTJ8XC9X\nAAPL 31DTKWODH8CJQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWP53G3MU|AAPL R735QTJ8XC9X\nAAPL 31DTKWODN6OLI|AAPL R735QTJ8XC9X\nAAPL 31DTKWP6QZG4M|AAPL R735QTJ8XC9X\nAAPL 31DTKWOAU14X2|AAPL R735QTJ8XC9X\nAAPL 31DTKWP8EISME|AAPL R735QTJ8XC9X\nAAPL 31DTKWODZ3CP2|AAPL R735QTJ8XC9X\nAAPL 31DTKWPA22546|AAPL R735QTJ8XC9X\nAAPL 31CN8OXJY1KUE|AAPL R735QTJ8XC9X\nAAPL 31D20EC1H6W92|AAPL R735QTJ8XC9X\nAAPL 31D8WIZLNQ6DI|AAPL R735QTJ8XC9X\nAAPL 31DFSNN5U9GHY|AAPL R735QTJ8XC9X\nAAPL 31DTKWYA7C0QU|AAPL R735QTJ8XC9X\nAAPL 31DTKWOE51OQU|AAPL R735QTJ8XC9X\nAAPL 31CN8OXS7QBBA|AAPL R735QTJ8XC9X\nAAPL 31D20EC9QVMPY|AAPL R735QTJ8XC9X\nAAPL 31D8WIZTXEWUE|AAPL R735QTJ8XC9X\nAAPL 31DFSNNE3Y6YU|AAPL R735QTJ8XC9X\nAAPL 31DTKWYIH0R7Q|AAPL R735QTJ8XC9X\nAAPL 31DTKWPBPLHLY|AAPL R735QTJ8XC9X\nAAPL 31CN8OY0HF1S6|AAPL R735QTJ8XC9X\nAAPL 31D20ECI0KD6U|AAPL R735QTJ8XC9X\nAAPL 31D8WJ0273NBA|AAPL R735QTJ8XC9X\nAAPL 31DFSNNMDMXFQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWYQQPHOM|AAPL R735QTJ8XC9X\nAAPL 31DTKWOEB00SM|AAPL R735QTJ8XC9X\nAAPL 31DTKWYZ0E85I|AAPL R735QTJ8XC9X\nAAPL 31DTKWPDD4U3Q|AAPL R735QTJ8XC9X\nAAPL 31DTKWZ7A2YME|AAPL R735QTJ8XC9X\nAAPL 31DTKWOEGYCUE|AAPL R735QTJ8XC9X\nAAPL 31DTKWZFJRP3A|AAPL R735QTJ8XC9X\nAAPL 31DTKWPF0O6LI|AAPL R735QTJ8XC9X\nAAPL 31DTKWZNTGFK6|AAPL R735QTJ8XC9X\nAAPL 31DTKWOEMWOW6|AAPL R735QTJ8XC9X\nAAPL 31DTKWZW35612|AAPL R735QTJ8XC9X\nAAPL 31DTKWPGO7J3A|AAPL R735QTJ8XC9X\nAAPL 31DTKX04CTWHY|AAPL R735QTJ8XC9X\nAAPL 31DTKWOESV0XY|AAPL R735QTJ8XC9X\nAAPL 31DTKX0CMIMYU|AAPL R735QTJ8XC9X\nAAPL 31DTKWPIBQVL2|AAPL R735QTJ8XC9X\nAAPL 31DTKX0KW7DFQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWOEYTCZQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWPJZA82U|AAPL R735QTJ8XC9X\nAAPL 31DTKWOF4RP1I|AAPL R735QTJ8XC9X\nAAPL 31DTKWPLMTKKM|AAPL R735QTJ8XC9X\nAAPL 31DTKWOFAQ13A|AAPL R735QTJ8XC9X\nAAPL 31DTKWPNACX2E|AAPL R735QTJ8XC9X\nAAPL 31DTKWOAZZGYU|AAPL R735QTJ8XC9X\nAAPL 31DTKWPOXW9K6|AAPL R735QTJ8XC9X\nAAPL 31DTKWOFMMP6U|AAPL R735QTJ8XC9X\nAAPL 31DTKWPQLFM1Y|AAPL R735QTJ8XC9X\nAAPL XEBSHXRLVN1I|AAPL R735QTJ8XC9X\nAAPL XEPKR8VYY7AE|AAPL R735QTJ8XC9X\nAAPL XEPKR8DG6UX2|AAPL R735QTJ8XC9X\nAAPL XEPKR8XMHJS6|AAPL R735QTJ8XC9X\nAAPL XEPKR8DM56YU|AAPL R735QTJ8XC9X\nAAPL XEPKR8ZA0W9Y|AAPL R735QTJ8XC9X\nAAPL XEPKR8DS3J0M|AAPL R735QTJ8XC9X\nAAPL XEPKR90XK8RQ|AAPL R735QTJ8XC9X\nAAPL XEPKR8DY1V2E|AAPL R735QTJ8XC9X\nAAPL XEPKR92L3L9I|AAPL R735QTJ8XC9X\nAAPL XEPKR8GLB7UU|AAPL R735QTJ8XC9X\nAAPL XEPKR9T1P55Y|AAPL R735QTJ8XC9X\nAAPL XEPKR8GR9JWM|AAPL R735QTJ8XC9X\nAAPL 31DFSNDQT5GFA|AAPL R735QTJ8XC9X\nAAPL 31DTKWOV680O6|AAPL R735QTJ8XC9X\nAAPL 31DTKWOCNGOAU|AAPL R735QTJ8XC9X\nAAPL 31DTKWOWTRD5Y|AAPL R735QTJ8XC9X\nAAPL 31DTKWOCTF0CM|AAPL R735QTJ8XC9X\nAAPL 31DTKWOYHAPNQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWOCZDCEE|AAPL R735QTJ8XC9X\nAAPL 31DTKWP04U25I|AAPL R735QTJ8XC9X\nAAPL 31DTKWOD5BOG6|AAPL R735QTJ8XC9X\nAAPL 31DTKWP1SDENA|AAPL R735QTJ8XC9X\nAAPL 31DTKWOFSL18M|AAPL R735QTJ8XC9X\nAAPL 31DTKWPS8YYJQ|AAPL R735QTJ8XC9X\nAAPL 31DTKWOFYJDAE|AAPL R735QTJ8XC9X\nAAPL XEWGVVZA9HJA|AAPL R735QTJ8XC9X\nAAPL XEWGW70J15TY|AAPL R735QTJ8XC9X\nAAPL XEWGW7H2EMRQ|AAPL R735QTJ8XC9X\nAAPL XEWGVX1NGZTY|AAPL R735QTJ8XC9X\nAAPL XEWGW7PC3D8M|AAPL R735QTJ8XC9X\nAAPL XEWGVX3B0CBQ|AAPL R735QTJ8XC9X\nAAPL XEWGW85VGU6E|AAPL R735QTJ8XC9X\nAAPL XEWGVVZY2TQE|AAPL R735QTJ8XC9X\nAAPL XEPKRKTYMAIU|AAPL R735QTJ8XC9X\nAAPL XEWGW8E55KNA|AAPL R735QTJ8XC9X\nAAPL XEWGVX4YJOTI|AAPL R735QTJ8XC9X\nAAPL XDR44B9BMMDI|AAPL R735QTJ8XC9X\nAAPL XEPKRL28B0ZQ|AAPL R735QTJ8XC9X\nAAPL XEWGW8MEUB46|AAPL R735QTJ8XC9X\nAAPL XEWGVW0415S6|AAPL R735QTJ8XC9X\nAAPL XEBSIA64X77Q|AAPL R735QTJ8XC9X\nAAPL XEPKRLAHZRGM|AAPL R735QTJ8XC9X\nAAPL XEWGW8UOJ1L2|AAPL R735QTJ8XC9X\nAAPL XEBSIAEELXOM|AAPL R735QTJ8XC9X\nAAPL XEPKRLIROHXI|AAPL R735QTJ8XC9X\nAAPL XEWGW92Y7S1Y|AAPL R735QTJ8XC9X\nAAPL XEWGVW09ZHTY|AAPL R735QTJ8XC9X\nAAPL XEWGVX89MDT2|AAPL R735QTJ8XC9X\nAAPL XEWGVVVZ8XPI|AAPL R735QTJ8XC9X\nAAPL XEWGVX9X5QAU|AAPL R735QTJ8XC9X\nAAPL XEWGVW0LW5XI|AAPL R735QTJ8XC9X\nAAPL XEWGVXBKP2SM|AAPL R735QTJ8XC9X\nAAPL XEWGVW0RUHZA|AAPL R735QTJ8XC9X\nAAPL XEWGVXD88FAE|AAPL R735QTJ8XC9X\nAAPL XEWGVW0XSU12|AAPL R735QTJ8XC9X\nAAPL XEPKR9UP8HNQ|AAPL R735QTJ8XC9X\nAAPL XEWGVXEVRRS6|AAPL R735QTJ8XC9X\nAAPL 31E0H1CQXIQ92|AAPL R735QTJ8XC9X\nAAPL 31E0H1BV0KF1I|AAPL R735QTJ8XC9X\nAAPL 31E0H1CSL22QU|AAPL R735QTJ8XC9X\nAAPL 31E0H1BYBKYVA|AAPL R735QTJ8XC9X\nAAPL 31E0H1CVW4RQE|AAPL R735QTJ8XC9X\nAAPL 31E0H1CXJO486|AAPL R735QTJ8XC9X\nAAPL 31E0H1BYNHMYU|AAPL R735QTJ8XC9X\nAAPL 31E0H1CZ77GPY|AAPL R735QTJ8XC9X\nAAPL 31E0H1BYTFZ0M|AAPL R735QTJ8XC9X\nAAPL 31E0H1BYZEB2E|AAPL R735QTJ8XC9X\nAAPL 31E0H1NWT1X3A|AAPL R735QTJ8XC9X\nAAPL 31E0H1D2IA5PI|AAPL R735QTJ8XC9X\nAAPL 31E0H1O52QNK6|AAPL R735QTJ8XC9X\nAAPL 31E0H1BZ5CN46|AAPL R735QTJ8XC9X\nAAPL 31DTKX0T5W3WM|AAPL R735QTJ8XC9X\nAAPL 31E0H1D45TI7A|AAPL R735QTJ8XC9X\nAAPL 31CV49R8IWFRA|AAPL R735QTJ8XC9X\nAAPL 31E0H1BZBAZ5Y|AAPL R735QTJ8XC9X\nAAPL XEWGVWRQ8WVA|AAPL R735QTJ8XC9X\nAAPL XEWGVVVTALNQ|AAPL R735QTJ8XC9X\nAAPL XEWGVWTDS9D2|AAPL R735QTJ8XC9X\nAAPL XEWGVVYYCTFQ|AAPL R735QTJ8XC9X\nAAPL XEWGVWV1BLUU|AAPL R735QTJ8XC9X\nAAPL XEWGVVZ4B5HI|AAPL R735QTJ8XC9X\nAAPL XEWGVWWOUYCM|AAPL R735QTJ8XC9X\nAAPL XEWGVWYCEAUE|AAPL R735QTJ8XC9X\nAAPL XEWGVVZG7TL2|AAPL R735QTJ8XC9X\nAAPL XEWGVWZZXNC6|AAPL R735QTJ8XC9X\nAAPL XEWGW78SPWAU|AAPL R735QTJ8XC9X\nAAPL XEWGVVZM65MU|AAPL R735QTJ8XC9X\nAAPL XEWGVVZS4HOM|AAPL R735QTJ8XC9X\nAAPL XEWGW7XLS3PI|AAPL R735QTJ8XC9X\nAAPL XEWGVX6M31BA|AAPL R735QTJ8XC9X\nAAPL XEPKR8GX7VYE|AAPL R735QTJ8XC9X\nAAPL 31E0H1BY5MMTI|AAPL R735QTJ8XC9X\nAAPL 31E0H1CU8LF8M|AAPL R735QTJ8XC9X\nAAPL 31E0H1BYHJAX2|AAPL R735QTJ8XC9X\nAAPL 31E0H1MZQAZ7Q|AAPL R735QTJ8XC9X\nAAPL 31E0H1N7ZZPOM|AAPL R735QTJ8XC9X\nAAPL 31E0H1NG9OG5I|AAPL R735QTJ8XC9X\nAAPL 31E0H1D0UQT7Q|AAPL R735QTJ8XC9X\nAAPL 31E0H1NOJD6ME|AAPL R735QTJ8XC9X\nAAPL 31E0H1ODCFE12|AAPL R735QTJ8XC9X\nAAPL 31DTKX11FKUDI|AAPL R735QTJ8XC9X\nAAPL 31E0H1OLM44HY|AAPL R735QTJ8XC9X\nAAPL 31DFSNQ5C70LI|AAPL R735QTJ8XC9X\nAAPL 31DTKX19P9KUE|AAPL R735QTJ8XC9X\nAAPL 31E0H1OTVSUYU|AAPL R735QTJ8XC9X\nAAPL 31E0H1D5TCUP2|AAPL R735QTJ8XC9X\nAAPL 31DFSNQDLVR2E|AAPL R735QTJ8XC9X\nAAPL 31DTKX1HYYBBA|AAPL R735QTJ8XC9X\nAAPL 31E0H1P25HLFQ|AAPL R735QTJ8XC9X\nAAPL 31E0H1BZH9B7Q|AAPL R735QTJ8XC9X\nAAPL 31E0H1D7GW76U|AAPL R735QTJ8XC9X\nAAPL 31E0H1BV6IR3A|AAPL R735QTJ8XC9X\nAAPL 31E0H1D94FJOM|AAPL R735QTJ8XC9X\nAAPL 31E0H1BZT5ZBA|AAPL R735QTJ8XC9X\nAAPL 31E0H1DARYW6E|AAPL R735QTJ8XC9X\nAAPL 31E0H1BZZ4BD2|AAPL R735QTJ8XC9X\nAAPL 31E0H1DCFI8O6|AAPL R735QTJ8XC9X\nAAPL 31E0H1C052NEU|AAPL R735QTJ8XC9X\nAAPL 31DTKWPTWIB1I|AAPL R735QTJ8XC9X\nAAPL 31E0H1DE31L5Y|AAPL R735QTJ8XC9X\nAAPL 31DTKWOG4HPC6|AAPL R735QTJ8XC9X\nAAPL XEWGVWHT0TWM|AAPL R735QTJ8XC9X\nAAPL XEWGVVXSOH3A|AAPL R735QTJ8XC9X\nAAPL XEWGVWJGK6EE|AAPL R735QTJ8XC9X\nAAPL XEWGVVXYMT52|AAPL R735QTJ8XC9X\nAAPL XEWGVWL43IW6|AAPL R735QTJ8XC9X\nAAPL XEWGVVY4L56U|AAPL R735QTJ8XC9X\nAAPL XEWGVWMRMVDY|AAPL R735QTJ8XC9X\nAAPL XEWGVVYAJH8M|AAPL R735QTJ8XC9X\nAAPL XEWGVWOF67VQ|AAPL R735QTJ8XC9X\nAAPL XEWGVVYGHTAE|AAPL R735QTJ8XC9X\nAAPL XEWGVWQ2PKDI|AAPL R735QTJ8XC9X\nAAPL XEWGVVYMG5C6|AAPL R735QTJ8XC9X\nAAPL XEWGVW13R62U|AAPL R735QTJ8XC9X\nAAPL XEWGVXGJB49Y|AAPL R735QTJ8XC9X\nAAPL 31E0H1CH0ANAE|AAPL R735QTJ8XC9X\nAAPL 31E0H1BWZYAH2|AAPL R735QTJ8XC9X\nAAPL 31E0H1CINTZS6|AAPL R735QTJ8XC9X\nAAPL 31E0H1BX5WMIU|AAPL R735QTJ8XC9X\nAAPL 31E0H1CKBDC9Y|AAPL R735QTJ8XC9X\nAAPL 31E0H1BXBUYKM|AAPL R735QTJ8XC9X\nAAPL 31E0H1CLYWORQ|AAPL R735QTJ8XC9X\nAAPL 31E0H1BXHTAME|AAPL R735QTJ8XC9X\nAAPL 31E0H1CNMG19I|AAPL R735QTJ8XC9X\nAAPL 31E0H1BXNRMO6|AAPL R735QTJ8XC9X\nAAPL 31E0H1CP9ZDRA|AAPL R735QTJ8XC9X\nAAPL 31E0H1BXTPYPY|AAPL R735QTJ8XC9X\nAAPL 31E0H1C0B0ZGM|AAPL R735QTJ8XC9X\nAAPL 31E0H1DFQKXNQ|AAPL R735QTJ8XC9X\nAAPL XDR44BHLBCUE|AAPL R735QTJ8XC9X\nAAPL XDR44BPV03BA|AAPL R735QTJ8XC9X\nAAPL XDR44BY4OTS6|AAPL R735QTJ8XC9X\nAAPL XDR44C6EDK92|AAPL R735QTJ8XC9X\nAAPL XDR44CEO2APY|AAPL R735QTJ8XC9X\nAAPL XDR44CMXR16U|AAPL R735QTJ8XC9X\nAAPL XDR44CV7FRNQ|AAPL R735QTJ8XC9X\nAAPL XDR44D3H4I4M|AAPL R735QTJ8XC9X\nAAPL XDR44DBQT8LI|AAPL R735QTJ8XC9X\nAAPL XDR44DK0HZ2E|AAPL R735QTJ8XC9X\nAAPL XDR44DSA6PJA|AAPL R735QTJ8XC9X\nAAPL XEPKR9WCRU5I|AAPL R735QTJ8XC9X\nAAPL 31CV49RGSL686|AAPL R735QTJ8XC9X\nAAPL 31CV49RP29WP2|AAPL R735QTJ8XC9X\nAAPL 31CV49RXBYN5Y|AAPL R735QTJ8XC9X\nAAPL 31CV49S5LNDMU|AAPL R735QTJ8XC9X\nAAPL 31CV49SDVC43Q|AAPL R735QTJ8XC9X\nAAPL 31CV49SM50UKM|AAPL R735QTJ8XC9X\nAAPL 31CV49SUEPL1I|AAPL R735QTJ8XC9X\nAAPL 31CV49T2OEBIE|AAPL R735QTJ8XC9X\nAAPL 31CV49TAY31ZA|AAPL R735QTJ8XC9X\nAAPL 31CV49TJ7RSG6|AAPL R735QTJ8XC9X\nAAPL 31CV49TRHGIX2|AAPL R735QTJ8XC9X\nAAPL 31DTKWPVK1NJA|AAPL R735QTJ8XC9X\nAAPL XEBSIAMOAO5I|AAPL R735QTJ8XC9X\nAAPL XEPKRLR1D8EE|AAPL R735QTJ8XC9X\nAAPL XEWGW9B7WIIU|AAPL R735QTJ8XC9X\nAAPL XEBSIAUXZEME|AAPL R735QTJ8XC9X\nAAPL XEPKRLZB1YVA|AAPL R735QTJ8XC9X\nAAPL XEWGW9JHL8ZQ|AAPL R735QTJ8XC9X\nAAPL XEPKR8H36806|AAPL R735QTJ8XC9X\nAAPL XEWGVW19PI4M|AAPL R735QTJ8XC9X\nAAPL XEPKR9Y0B6NA|AAPL R735QTJ8XC9X\nAAPL XEWGVXI6UGRQ|AAPL R735QTJ8XC9X\nAAPL XFH59WBP2CME|AAPL R735QTJ8XC9X\nAAPL 31DFSNQLVKHJA|AAPL R735QTJ8XC9X\nAAPL 31DTKX1Q8N1S6|AAPL R735QTJ8XC9X\nAAPL 31E0H1PAF6BWM|AAPL R735QTJ8XC9X\nAAPL 31DFSNQU59806|AAPL R735QTJ8XC9X\nAAPL 31DTKX1YIBS92|AAPL R735QTJ8XC9X\nAAPL 31E0H1PIOV2DI|AAPL R735QTJ8XC9X\nAAPL 31DTKWOGAG1DY|AAPL R735QTJ8XC9X\nAAPL 31E0H1C0GZBIE|AAPL R735QTJ8XC9X\nAAPL 31DTKWPX7L012|AAPL R735QTJ8XC9X\nAAPL 31E0H1DHE4A5I|AAPL R735QTJ8XC9X\nAAPL 31EL5FCAWC606|AAPL R735QTJ8XC9X\nAAPL XEIOMX1IE9XI|AAPL R735QTJ8XC9X\nAAPL XEIOMX9S30EE|AAPL R735QTJ8XC9X\nAAPL XEIOMXI1RQVA|AAPL R735QTJ8XC9X\nAAPL XEIOMXQBGHC6|AAPL R735QTJ8XC9X\nAAPL XEIOMXYL57T2|AAPL R735QTJ8XC9X\nAAPL XEIOMY6UTY9Y|AAPL R735QTJ8XC9X\nAAPL XEIOMYF4IOQU|AAPL R735QTJ8XC9X\nAAPL XEIOMYNE7F7Q|AAPL R735QTJ8XC9X\nAAPL 31DMOSD0PO3BA|AAPL R735QTJ8XC9X\nAAPL 31DMOSD8ZCTS6|AAPL R735QTJ8XC9X\nAAPL 31DMOSDH91K92|AAPL R735QTJ8XC9X\nAAPL 31DMOSDPIQAPY|AAPL R735QTJ8XC9X\nAAPL 31DMOSDXSF16U|AAPL R735QTJ8XC9X\nAAPL 31DMOSE623RNQ|AAPL R735QTJ8XC9X\nAAPL 31DMOSEEBSI4M|AAPL R735QTJ8XC9X\nAAPL 31DMOSEMLH8LI|AAPL R735QTJ8XC9X\nAAPL XEPKR8H94K1Y|AAPL R735QTJ8XC9X\nAAPL XEWGVW1FNU6E|AAPL R735QTJ8XC9X\nAAPL XG8PSIIRO4ME|AAPL R735QTJ8XC9X\nAAPL XG8PSIKF7H46|AAPL R735QTJ8XC9X\nAAPL XFH59WDCLP46|AAPL R735QTJ8XC9X\nAAPL XG8PSIM2QTLY|AAPL R735QTJ8XC9X\nAAPL XFH59WF051LY|AAPL R735QTJ8XC9X\nAAPL XG8PSINQA63Q|AAPL R735QTJ8XC9X\nAAPL XG8PSIPDTILI|AAPL R735QTJ8XC9X\nAAPL 31DTKWOGGEDFQ|AAPL R735QTJ8XC9X\nAAPL 31E0H1C0MXNK6|AAPL R735QTJ8XC9X\nAAPL 31FCPXYHYXY06|AAPL R735QTJ8XC9X\nAAPL 31FCPXYJMHAHY|AAPL R735QTJ8XC9X\nAAPL 31EL5FCCJVIHY|AAPL R735QTJ8XC9X\nAAPL 31FCPXYLA0MZQ|AAPL R735QTJ8XC9X\nAAPL 31EL5FCE7EUZQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXYMXJZHI|AAPL R735QTJ8XC9X\nAAPL 31FCPXYOL3BZA|AAPL R735QTJ8XC9X\nAAPL XEPKR9ZNUJ52|AAPL R735QTJ8XC9X\nAAPL XEWGVXJUDT9I|AAPL R735QTJ8XC9X\nAAPL XEPKR8HF2W3Q|AAPL R735QTJ8XC9X\nAAPL XEWGVW1LM686|AAPL R735QTJ8XC9X\nAAPL 31DTKWPYV4CIU|AAPL R735QTJ8XC9X\nAAPL 31E0H1DJ1NMNA|AAPL R735QTJ8XC9X\nAAPL 31DTKWOGMCPHI|AAPL R735QTJ8XC9X\nAAPL 31E0H1C0SVZLY|AAPL R735QTJ8XC9X\nAAPL XF3D0KDKBJHI|AAPL R735QTJ8XC9X\nAAPL XF3D0JJ4W3K6|AAPL R735QTJ8XC9X\nAAPL XF3D0KF7UVZA|AAPL R735QTJ8XC9X\nAAPL XF3D0JJAUFLY|AAPL R735QTJ8XC9X\nAAPL XF3D0KGVE8H2|AAPL R735QTJ8XC9X\nAAPL XF3D0JJGSRNQ|AAPL R735QTJ8XC9X\nAAPL XF3D0KIIXKYU|AAPL R735QTJ8XC9X\nAAPL XF3D0JJMR3PI|AAPL R735QTJ8XC9X\nAAPL XF3D0KK6GXGM|AAPL R735QTJ8XC9X\nAAPL XF3D0JJSPFRA|AAPL R735QTJ8XC9X\nAAPL XF3D0V18XWW6|AAPL R735QTJ8XC9X\nAAPL XF3D0KLU09YE|AAPL R735QTJ8XC9X\nAAPL XF3D0V9IMND2|AAPL R735QTJ8XC9X\nAAPL XF3D0JJYNRT2|AAPL R735QTJ8XC9X\nAAPL XF3D0VHSBDTY|AAPL R735QTJ8XC9X\nAAPL XF3D0KNHJMG6|AAPL R735QTJ8XC9X\nAAPL XF3D0VQ204AU|AAPL R735QTJ8XC9X\nAAPL XF3D0JK4M3UU|AAPL R735QTJ8XC9X\nAAPL XF3D0VYBOURQ|AAPL R735QTJ8XC9X\nAAPL XF3D0KP52YXY|AAPL R735QTJ8XC9X\nAAPL XF3D0W6LDL8M|AAPL R735QTJ8XC9X\nAAPL XF3D0JKAKFWM|AAPL R735QTJ8XC9X\nAAPL XF3D0WEV2BPI|AAPL R735QTJ8XC9X\nAAPL XF3D0KQSMBFQ|AAPL R735QTJ8XC9X\nAAPL XF3D0WN4R26E|AAPL R735QTJ8XC9X\nAAPL XF3D0JKGIRYE|AAPL R735QTJ8XC9X\nAAPL XF3D0WVEFSNA|AAPL R735QTJ8XC9X\nAAPL XF3D0KSG5NXI|AAPL R735QTJ8XC9X\nAAPL XF3D0X3O4J46|AAPL R735QTJ8XC9X\nAAPL XF3D0JG5S7TY|AAPL R735QTJ8XC9X\nAAPL XF3D0KU3P0FA|AAPL R735QTJ8XC9X\nAAPL XF3D0JKSFG1Y|AAPL R735QTJ8XC9X\nAAPL XF3D0KVR8CX2|AAPL R735QTJ8XC9X\nAAPL XF3D0JKYDS3Q|AAPL R735QTJ8XC9X\nAAPL XF3D0KXERPEU|AAPL R735QTJ8XC9X\nAAPL XF3D0JL4C45I|AAPL R735QTJ8XC9X\nAAPL XF3D0KZ2B1WM|AAPL R735QTJ8XC9X\nAAPL XF3D0JLAAG7A|AAPL R735QTJ8XC9X\nAAPL XF3D0L0PUEEE|AAPL R735QTJ8XC9X\nAAPL 31E7D60CRLCVA|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZIC5WXY|AAPL R735QTJ8XC9X\nAAPL 31E7D60EF4PD2|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZII48ZQ|AAPL R735QTJ8XC9X\nAAPL 31E7D60G2O1UU|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZIO2L1I|AAPL R735QTJ8XC9X\nAAPL 31E7D60HQ7ECM|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZIU0X3A|AAPL R735QTJ8XC9X\nAAPL 31E7D60JDQQUE|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZIZZ952|AAPL R735QTJ8XC9X\nAAPL 31E7D6B0G7Q9Y|AAPL R735QTJ8XC9X\nAAPL 31E7D60L1A3C6|AAPL R735QTJ8XC9X\nAAPL 31E7D6B8PWGQU|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZJ5XL6U|AAPL R735QTJ8XC9X\nAAPL 31E7D6BGZL77Q|AAPL R735QTJ8XC9X\nAAPL 31E7D60MOTFTY|AAPL R735QTJ8XC9X\nAAPL 31E7D6BP99XOM|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZJBVX8M|AAPL R735QTJ8XC9X\nAAPL 31E7D6BXIYO5I|AAPL R735QTJ8XC9X\nAAPL 31E7D60OCCSBQ|AAPL R735QTJ8XC9X\nAAPL 31E7D6C5SNEME|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZJHU9AE|AAPL R735QTJ8XC9X\nAAPL 31E7D6CE2C53A|AAPL R735QTJ8XC9X\nAAPL 31E7D60PZW4TI|AAPL R735QTJ8XC9X\nAAPL 31E7D6CMC0VK6|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZJNSLC6|AAPL R735QTJ8XC9X\nAAPL 31E7D6CULPM12|AAPL R735QTJ8XC9X\nAAPL 31E7D60RNFHBA|AAPL R735QTJ8XC9X\nAAPL 31E7D6D2VECHY|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZFD217Q|AAPL R735QTJ8XC9X\nAAPL 31E7D60TAYTT2|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZJZP9FQ|AAPL R735QTJ8XC9X\nAAPL 31E7D60UYI6AU|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZK5NLHI|AAPL R735QTJ8XC9X\nAAPL 31E7D60WM1ISM|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZKBLXJA|AAPL R735QTJ8XC9X\nAAPL 31E7D60Y9KVAE|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZKHK9L2|AAPL R735QTJ8XC9X\nAAPL 31E7D60ZX47S6|AAPL R735QTJ8XC9X\nAAPL XF3D0K5AMT0M|AAPL R735QTJ8XC9X\nAAPL XF3D0JIB4FBA|AAPL R735QTJ8XC9X\nAAPL XF3D0K6Y65IE|AAPL R735QTJ8XC9X\nAAPL XF3D0JIH2RD2|AAPL R735QTJ8XC9X\nAAPL XF3D0K8LPI06|AAPL R735QTJ8XC9X\nAAPL XF3D0JIN13EU|AAPL R735QTJ8XC9X\nAAPL XF3D0KA98UHY|AAPL R735QTJ8XC9X\nAAPL XF3D0JISZFGM|AAPL R735QTJ8XC9X\nAAPL XF3D0KBWS6ZQ|AAPL R735QTJ8XC9X\nAAPL XF3D0JFZTVS6|AAPL R735QTJ8XC9X\nAAPL XF3D0JLG8S92|AAPL R735QTJ8XC9X\nAAPL XF3D0L2DDQW6|AAPL R735QTJ8XC9X\nAAPL XEWGVXLHX5RA|AAPL R735QTJ8XC9X\nAAPL XEWGVW1RKI9Y|AAPL R735QTJ8XC9X\nAAPL 31E7D604HWMEE|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZHIE8P2|AAPL R735QTJ8XC9X\nAAPL 31E7D6065FYW6|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZHOCKQU|AAPL R735QTJ8XC9X\nAAPL 31E7D607SZBDY|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZHUAWSM|AAPL R735QTJ8XC9X\nAAPL 31E7D609GINVQ|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZI098UE|AAPL R735QTJ8XC9X\nAAPL 31E7D60B420DI|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZF73P5Y|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZKNILMU|AAPL R735QTJ8XC9X\nAAPL 31E7D611KNK9Y|AAPL R735QTJ8XC9X\nAAPL 31E0H1DKP6Z52|AAPL R735QTJ8XC9X\nAAPL 31E0H1C0YUBNQ|AAPL R735QTJ8XC9X\nAAPL XF3D0K3N3GIU|AAPL R735QTJ8XC9X\nAAPL XF3D0JI5639I|AAPL R735QTJ8XC9X\nAAPL XF3D0JLM74AU|AAPL R735QTJ8XC9X\nAAPL XF3D0L40X3DY|AAPL R735QTJ8XC9X\nAAPL 31E7D602UD9WM|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZHCFWNA|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZKTGXOM|AAPL R735QTJ8XC9X\nAAPL 31E7D61386WRQ|AAPL R735QTJ8XC9X\nAAPL XFA957ZEE63Q|AAPL R735QTJ8XC9X\nAAPL XFA9573HDPQE|AAPL R735QTJ8XC9X\nAAPL XFA95811XILI|AAPL R735QTJ8XC9X\nAAPL XFA9573NC1S6|AAPL R735QTJ8XC9X\nAAPL XFA9582PGV3A|AAPL R735QTJ8XC9X\nAAPL XFA9573TADTY|AAPL R735QTJ8XC9X\nAAPL XFA9584D07L2|AAPL R735QTJ8XC9X\nAAPL XFA9573Z8PVQ|AAPL R735QTJ8XC9X\nAAPL XFA95860JK2U|AAPL R735QTJ8XC9X\nAAPL XFA9574571XI|AAPL R735QTJ8XC9X\nAAPL XFA95J1YUNYE|AAPL R735QTJ8XC9X\nAAPL XFA9587O2WKM|AAPL R735QTJ8XC9X\nAAPL XFA95JA8JEFA|AAPL R735QTJ8XC9X\nAAPL XFA9574B5DZA|AAPL R735QTJ8XC9X\nAAPL XFA95JII84W6|AAPL R735QTJ8XC9X\nAAPL XFA9589BM92E|AAPL R735QTJ8XC9X\nAAPL XFA95JQRWVD2|AAPL R735QTJ8XC9X\nAAPL XFA9574H3Q12|AAPL R735QTJ8XC9X\nAAPL XFA95JZ1LLTY|AAPL R735QTJ8XC9X\nAAPL XFA958AZ5LK6|AAPL R735QTJ8XC9X\nAAPL XFA95K7BACAU|AAPL R735QTJ8XC9X\nAAPL XFA9574N222U|AAPL R735QTJ8XC9X\nAAPL XFA95KFKZ2RQ|AAPL R735QTJ8XC9X\nAAPL XFA958CMOY1Y|AAPL R735QTJ8XC9X\nAAPL XFA95KNUNT8M|AAPL R735QTJ8XC9X\nAAPL XFA9570CBHYE|AAPL R735QTJ8XC9X\nAAPL XFA958EA8AJQ|AAPL R735QTJ8XC9X\nAAPL XFA9574YYQ6E|AAPL R735QTJ8XC9X\nAAPL XFA958FXRN1I|AAPL R735QTJ8XC9X\nAAPL XFA95754X286|AAPL R735QTJ8XC9X\nAAPL XFA958HLAZJA|AAPL R735QTJ8XC9X\nAAPL XFA9575AVE9Y|AAPL R735QTJ8XC9X\nAAPL XFA958J8UC12|AAPL R735QTJ8XC9X\nAAPL XFA9575GTQBQ|AAPL R735QTJ8XC9X\nAAPL XFA958KWDOIU|AAPL R735QTJ8XC9X\nAAPL XFA9575MS2DI|AAPL R735QTJ8XC9X\nAAPL XFA958MJX10M|AAPL R735QTJ8XC9X\nAAPL XF3D0JLS5GCM|AAPL R735QTJ8XC9X\nAAPL XG8PSIR1CV3A|AAPL R735QTJ8XC9X\nAAPL 31EE9ANYLNZHI|AAPL R735QTJ8XC9X\nAAPL 31EE9AN2ONJ46|AAPL R735QTJ8XC9X\nAAPL 31EE9AO097BZA|AAPL R735QTJ8XC9X\nAAPL 31EE9AN2ULV5Y|AAPL R735QTJ8XC9X\nAAPL 31EE9AO1WQOH2|AAPL R735QTJ8XC9X\nAAPL 31EE9AN30K77Q|AAPL R735QTJ8XC9X\nAAPL 31EE9AO3KA0YU|AAPL R735QTJ8XC9X\nAAPL 31EE9AN36IJ9I|AAPL R735QTJ8XC9X\nAAPL 31EE9AO57TDGM|AAPL R735QTJ8XC9X\nAAPL 31EE9AN3CGVBA|AAPL R735QTJ8XC9X\nAAPL 31EE9AZ164HC6|AAPL R735QTJ8XC9X\nAAPL 31EE9AO6VCPYE|AAPL R735QTJ8XC9X\nAAPL 31EE9AZ9FT7T2|AAPL R735QTJ8XC9X\nAAPL 31EE9AN3IF7D2|AAPL R735QTJ8XC9X\nAAPL 31EE9AZHPHY9Y|AAPL R735QTJ8XC9X\nAAPL 31EE9AO8IW2G6|AAPL R735QTJ8XC9X\nAAPL 31EE9AZPZ6OQU|AAPL R735QTJ8XC9X\nAAPL 31EE9AN3ODJEU|AAPL R735QTJ8XC9X\nAAPL 31EE9AZY8VF7Q|AAPL R735QTJ8XC9X\nAAPL 31EE9AOA6FEXY|AAPL R735QTJ8XC9X\nAAPL 31EE9B06IK5OM|AAPL R735QTJ8XC9X\nAAPL 31EE9AN3UBVGM|AAPL R735QTJ8XC9X\nAAPL 31EE9B0ES8W5I|AAPL R735QTJ8XC9X\nAAPL 31EE9AOBTYRFQ|AAPL R735QTJ8XC9X\nAAPL 31EE9B0N1XMME|AAPL R735QTJ8XC9X\nAAPL 31EE9AMZJLBC6|AAPL R735QTJ8XC9X\nAAPL 31EE9AODHI3XI|AAPL R735QTJ8XC9X\nAAPL 31EE9AN468JK6|AAPL R735QTJ8XC9X\nAAPL 31EE9AOF51GFA|AAPL R735QTJ8XC9X\nAAPL 31EE9AN4C6VLY|AAPL R735QTJ8XC9X\nAAPL 31EE9AOGSKSX2|AAPL R735QTJ8XC9X\nAAPL 31EE9AN4I57NQ|AAPL R735QTJ8XC9X\nAAPL 31EE9AOIG45EU|AAPL R735QTJ8XC9X\nAAPL 31EE9AN4O3JPI|AAPL R735QTJ8XC9X\nAAPL 31EE9AOK3NHWM|AAPL R735QTJ8XC9X\nAAPL 31EE9AN4U1VRA|AAPL R735QTJ8XC9X\nAAPL 31EE9AOLR6UEE|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZKZF9QE|AAPL R735QTJ8XC9X\nAAPL 31FCPXYQ8MOH2|AAPL R735QTJ8XC9X\nAAPL XFA9572ZIPL2|AAPL R735QTJ8XC9X\nAAPL XFA957W3BH46|AAPL R735QTJ8XC9X\nAAPL XFA95706D5WM|AAPL R735QTJ8XC9X\nAAPL XFA957XQUTLY|AAPL R735QTJ8XC9X\nAAPL XFA9573BFDOM|AAPL R735QTJ8XC9X\nAAPL XEBSIB37O53A|AAPL R735QTJ8XC9X\nAAPL XEPKRM7KQPC6|AAPL R735QTJ8XC9X\nAAPL XEWGW9RR9ZGM|AAPL R735QTJ8XC9X\nAAPL XF3D0XBXT9L2|AAPL R735QTJ8XC9X\nAAPL XFA95KW4CJPI|AAPL R735QTJ8XC9X\nAAPL XEBSIBBHCVK6|AAPL R735QTJ8XC9X\nAAPL XEIOMYVNW5OM|AAPL R735QTJ8XC9X\nAAPL XEPKRMFUFFT2|AAPL R735QTJ8XC9X\nAAPL XEWGWA00YPXI|AAPL R735QTJ8XC9X\nAAPL XF3D0XK7I01Y|AAPL R735QTJ8XC9X\nAAPL XFA95L4E1A6E|AAPL R735QTJ8XC9X\nAAPL XEBSIBJR1M12|AAPL R735QTJ8XC9X\nAAPL XEIOMZ3XKW5I|AAPL R735QTJ8XC9X\nAAPL XEPKRMO4469Y|AAPL R735QTJ8XC9X\nAAPL XEWGWA8ANGEE|AAPL R735QTJ8XC9X\nAAPL XF3D0XSH6QIU|AAPL R735QTJ8XC9X\nAAPL XFA95LCNQ0NA|AAPL R735QTJ8XC9X\nAAPL XEBSIBS0QCHY|AAPL R735QTJ8XC9X\nAAPL XEIOMZC79MME|AAPL R735QTJ8XC9X\nAAPL XEPKRMWDSWQU|AAPL R735QTJ8XC9X\nAAPL XEWGWAGKC6VA|AAPL R735QTJ8XC9X\nAAPL XF3D0Y0QVGZQ|AAPL R735QTJ8XC9X\nAAPL XFA95LKXER46|AAPL R735QTJ8XC9X\nAAPL XEBSIC0AF2YU|AAPL R735QTJ8XC9X\nAAPL XEIOMZKGYD3A|AAPL R735QTJ8XC9X\nAAPL XEPKRN4NHN7Q|AAPL R735QTJ8XC9X\nAAPL XEWGWAOU0XC6|AAPL R735QTJ8XC9X\nAAPL XF3D0Y90K7GM|AAPL R735QTJ8XC9X\nAAPL XFA95LT73HL2|AAPL R735QTJ8XC9X\nAAPL XFA9575SQEFA|AAPL R735QTJ8XC9X\nAAPL XFA958O7GDIE|AAPL R735QTJ8XC9X\nAAPL XEPKRA1BDVMU|AAPL R735QTJ8XC9X\nAAPL XF3D0L5OGFVQ|AAPL R735QTJ8XC9X\nAAPL XEPKR8HL185I|AAPL R735QTJ8XC9X\nAAPL XEWGVXN5GI92|AAPL R735QTJ8XC9X\nAAPL XEWGVW1XIUBQ|AAPL R735QTJ8XC9X\nAAPL XG8PSISOW7L2|AAPL R735QTJ8XC9X\nAAPL 31EE9AN26SIYU|AAPL R735QTJ8XC9X\nAAPL 31EE9ANVALAHY|AAPL R735QTJ8XC9X\nAAPL 31EE9AMZDMZAE|AAPL R735QTJ8XC9X\nAAPL 31EE9ANWY4MZQ|AAPL R735QTJ8XC9X\nAAPL 31EE9AN2IP72E|AAPL R735QTJ8XC9X\nAAPL 31DFSNR2EXYH2|AAPL R735QTJ8XC9X\nAAPL 31DTKX26S0IPY|AAPL R735QTJ8XC9X\nAAPL 31E0H1PQYJSUE|AAPL R735QTJ8XC9X\nAAPL 31E7D6DB532YU|AAPL R735QTJ8XC9X\nAAPL 31EE9B0VBMD3A|AAPL R735QTJ8XC9X\nAAPL 31DFSNRAOMOXY|AAPL R735QTJ8XC9X\nAAPL 31DMOSEUV5Z2E|AAPL R735QTJ8XC9X\nAAPL 31DTKX2F1P96U|AAPL R735QTJ8XC9X\nAAPL 31E0H1PZ88JBA|AAPL R735QTJ8XC9X\nAAPL 31E7D6DJERTFQ|AAPL R735QTJ8XC9X\nAAPL 31EE9B13LB3K6|AAPL R735QTJ8XC9X\nAAPL 31DFSNRIYBFEU|AAPL R735QTJ8XC9X\nAAPL 31DMOSF34UPJA|AAPL R735QTJ8XC9X\nAAPL 31DTKX2NBDZNQ|AAPL R735QTJ8XC9X\nAAPL 31E0H1Q7HX9S6|AAPL R735QTJ8XC9X\nAAPL 31E7D6DROGJWM|AAPL R735QTJ8XC9X\nAAPL 31EE9B1BUZU12|AAPL R735QTJ8XC9X\nAAPL 31DFSNRR805VQ|AAPL R735QTJ8XC9X\nAAPL 31DMOSFBEJG06|AAPL R735QTJ8XC9X\nAAPL 31DTKX2VL2Q4M|AAPL R735QTJ8XC9X\nAAPL 31E0H1QFRM092|AAPL R735QTJ8XC9X\nAAPL 31E7D6DZY5ADI|AAPL R735QTJ8XC9X\nAAPL 31EE9B1K4OKHY|AAPL R735QTJ8XC9X\nAAPL 31DFSNRZHOWCM|AAPL R735QTJ8XC9X\nAAPL 31DMOSFJO86H2|AAPL R735QTJ8XC9X\nAAPL 31DTKX33URGLI|AAPL R735QTJ8XC9X\nAAPL 31E0H1QO1AQPY|AAPL R735QTJ8XC9X\nAAPL 31E7D6E87U0UE|AAPL R735QTJ8XC9X\nAAPL 31EE9B1SEDAYU|AAPL R735QTJ8XC9X\nAAPL 31EE9AN5007T2|AAPL R735QTJ8XC9X\nAAPL 31EE9AONEQ6W6|AAPL R735QTJ8XC9X\nAAPL 31DTKWQ0INP0M|AAPL R735QTJ8XC9X\nAAPL 31E7D614VQ99I|AAPL R735QTJ8XC9X\nAAPL 31DTKWOGSB1JA|AAPL R735QTJ8XC9X\nAAPL 31E0H1DMCQBMU|AAPL R735QTJ8XC9X\nAAPL 31E0H1C14SNPI|AAPL R735QTJ8XC9X\nAAPL 31FCPXYRW60YU|AAPL R735QTJ8XC9X\nAAPL XFA9572HNPFQ|AAPL R735QTJ8XC9X\nAAPL XFA957R4PFMU|AAPL R735QTJ8XC9X\nAAPL XFA9572NM1HI|AAPL R735QTJ8XC9X\nAAPL XFA957SS8S4M|AAPL R735QTJ8XC9X\nAAPL XFA9572TKDJA|AAPL R735QTJ8XC9X\nAAPL XFA957UFS4ME|AAPL R735QTJ8XC9X\nAAPL XFA9575YOQH2|AAPL R735QTJ8XC9X\nAAPL XF3D0JLY3SEE|AAPL R735QTJ8XC9X\nAAPL 31EE9AN1OXITI|AAPL R735QTJ8XC9X\nAAPL 31EE9ANQBZ90M|AAPL R735QTJ8XC9X\nAAPL 31EE9AN1UVUVA|AAPL R735QTJ8XC9X\nAAPL 31EE9ANRZILIE|AAPL R735QTJ8XC9X\nAAPL 31EE9AN20U6X2|AAPL R735QTJ8XC9X\nAAPL 31EE9ANTN1Y06|AAPL R735QTJ8XC9X\nAAPL 31EE9AN55YJUU|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZL5DLS6|AAPL R735QTJ8XC9X\nAAPL XFA9572BPDDY|AAPL R735QTJ8XC9X\nAAPL XFA957PH6352|AAPL R735QTJ8XC9X\nAAPL XFA958PUZQ06|AAPL R735QTJ8XC9X\nAAPL XG8PSIUCFK2U|AAPL R735QTJ8XC9X\nAAPL 31EE9AN1IZ6RQ|AAPL R735QTJ8XC9X\nAAPL 31EE9ANOOFWIU|AAPL R735QTJ8XC9X\nAAPL 31EE9AOP29JDY|AAPL R735QTJ8XC9X\nAAPL 31FCPXYTJPDGM|AAPL R735QTJ8XC9X\nAAPL XFO1EI80EM12|AAPL R735QTJ8XC9X\nAAPL XFO1EJ72JFC6|AAPL R735QTJ8XC9X\nAAPL XFO1EI86CY2U|AAPL R735QTJ8XC9X\nAAPL XFO1EJ8Q2RTY|AAPL R735QTJ8XC9X\nAAPL XFO1EI8CBA4M|AAPL R735QTJ8XC9X\nAAPL XFO1EJADM4BQ|AAPL R735QTJ8XC9X\nAAPL XFO1EI8I9M6E|AAPL R735QTJ8XC9X\nAAPL XFO1EJC15GTI|AAPL R735QTJ8XC9X\nAAPL XFO1EI8O7Y86|AAPL R735QTJ8XC9X\nAAPL XFO1EJDOOTBA|AAPL R735QTJ8XC9X\nAAPL XFO1EUV4ZFLY|AAPL R735QTJ8XC9X\nAAPL XFO1EI8U6A9Y|AAPL R735QTJ8XC9X\nAAPL XFO1EV3EO62U|AAPL R735QTJ8XC9X\nAAPL XFO1EJFC85T2|AAPL R735QTJ8XC9X\nAAPL XFO1EVBOCWJQ|AAPL R735QTJ8XC9X\nAAPL XFO1EI904MBQ|AAPL R735QTJ8XC9X\nAAPL XFO1EVJY1N0M|AAPL R735QTJ8XC9X\nAAPL XFO1EJGZRIAU|AAPL R735QTJ8XC9X\nAAPL XFO1EVS7QDHI|AAPL R735QTJ8XC9X\nAAPL XFO1EI4PE27A|AAPL R735QTJ8XC9X\nAAPL XFO1EW0HF3YE|AAPL R735QTJ8XC9X\nAAPL XFO1EJINAUSM|AAPL R735QTJ8XC9X\nAAPL XFO1EW8R3UFA|AAPL R735QTJ8XC9X\nAAPL XFO1EI9C1AFA|AAPL R735QTJ8XC9X\nAAPL XFO1EWH0SKW6|AAPL R735QTJ8XC9X\nAAPL XFO1EJKAU7AE|AAPL R735QTJ8XC9X\nAAPL XFO1EWPAHBD2|AAPL R735QTJ8XC9X\nAAPL XFO1EI9HZMH2|AAPL R735QTJ8XC9X\nAAPL XFO1EWXK61TY|AAPL R735QTJ8XC9X\nAAPL XFO1EJLYDJS6|AAPL R735QTJ8XC9X\nAAPL XFO1EI9NXYIU|AAPL R735QTJ8XC9X\nAAPL XFO1EJNLWW9Y|AAPL R735QTJ8XC9X\nAAPL XFO1EI9TWAKM|AAPL R735QTJ8XC9X\nAAPL XFO1EJP9G8RQ|AAPL R735QTJ8XC9X\nAAPL XFO1EI9ZUMME|AAPL R735QTJ8XC9X\nAAPL XFO1EJQWZL9I|AAPL R735QTJ8XC9X\nAAPL XFO1EIA5SYO6|AAPL R735QTJ8XC9X\nAAPL XFO1EJSKIXRA|AAPL R735QTJ8XC9X\nAAPL XFO1EIABRAPY|AAPL R735QTJ8XC9X\nAAPL XFA95764N2IU|AAPL R735QTJ8XC9X\nAAPL XIQBGZAJYH3A|AAPL R735QTJ8XC9X\nAAPL 31ES1JY77OFEU|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ69T8PY|AAPL R735QTJ8XC9X\nAAPL 31ES1JY7DMRGM|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ7XCL7Q|AAPL R735QTJ8XC9X\nAAPL 31ES1JY7JL3IE|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ9KVXPI|AAPL R735QTJ8XC9X\nAAPL 31ES1JY7PJFK6|AAPL R735QTJ8XC9X\nAAPL 31ES1JZB8FA7A|AAPL R735QTJ8XC9X\nAAPL 31ES1JY7VHRLY|AAPL R735QTJ8XC9X\nAAPL 31ES1JZCVYMP2|AAPL R735QTJ8XC9X\nAAPL 31ES1KAUC98ZQ|AAPL R735QTJ8XC9X\nAAPL 31ES1JY81G3NQ|AAPL R735QTJ8XC9X\nAAPL 31ES1KB2LXZGM|AAPL R735QTJ8XC9X\nAAPL 31ES1JZEJHZ6U|AAPL R735QTJ8XC9X\nAAPL 31ES1KBAVMPXI|AAPL R735QTJ8XC9X\nAAPL 31ES1JY87EFPI|AAPL R735QTJ8XC9X\nAAPL 31ES1KBJ5BGEE|AAPL R735QTJ8XC9X\nAAPL 31ES1JZG71BOM|AAPL R735QTJ8XC9X\nAAPL 31ES1KBRF06VA|AAPL R735QTJ8XC9X\nAAPL 31ES1JY3WNVL2|AAPL R735QTJ8XC9X\nAAPL 31ES1KBZOOXC6|AAPL R735QTJ8XC9X\nAAPL 31ES1JZHUKO6E|AAPL R735QTJ8XC9X\nAAPL 31ES1KC7YDNT2|AAPL R735QTJ8XC9X\nAAPL 31ES1JY8JB3T2|AAPL R735QTJ8XC9X\nAAPL 31ES1KCG82E9Y|AAPL R735QTJ8XC9X\nAAPL 31ES1JZJI40O6|AAPL R735QTJ8XC9X\nAAPL 31ES1KCOHR4QU|AAPL R735QTJ8XC9X\nAAPL 31ES1JY8P9FUU|AAPL R735QTJ8XC9X\nAAPL 31ES1KCWRFV7Q|AAPL R735QTJ8XC9X\nAAPL 31ES1JZL5ND5Y|AAPL R735QTJ8XC9X\nAAPL 31ES1JY8V7RWM|AAPL R735QTJ8XC9X\nAAPL 31ES1JZMT6PNQ|AAPL R735QTJ8XC9X\nAAPL 31ES1JY9163YE|AAPL R735QTJ8XC9X\nAAPL 31ES1JZOGQ25I|AAPL R735QTJ8XC9X\nAAPL 31ES1JY974G06|AAPL R735QTJ8XC9X\nAAPL 31ES1JZQ49ENA|AAPL R735QTJ8XC9X\nAAPL 31ES1JY9D2S1Y|AAPL R735QTJ8XC9X\nAAPL 31ES1JZRRSR52|AAPL R735QTJ8XC9X\nAAPL 31ES1JY9J143Q|AAPL R735QTJ8XC9X\nAAPL 31EE9AN5BWVWM|AAPL R735QTJ8XC9X\nAAPL 31HUBMF9R8AH2|AAPL R735QTJ8XC9X\nAAPL XFO1EIYSUOVA|AAPL R735QTJ8XC9X\nAAPL XFO1EI7CL9TY|AAPL R735QTJ8XC9X\nAAPL XFO1EJ0GE1D2|AAPL R735QTJ8XC9X\nAAPL XFO1EI4JFQ5I|AAPL R735QTJ8XC9X\nAAPL XFO1EJ23XDUU|AAPL R735QTJ8XC9X\nAAPL XFO1EI7OHXXI|AAPL R735QTJ8XC9X\nAAPL XFO1EJ3RGQCM|AAPL R735QTJ8XC9X\nAAPL XFO1EI7UG9ZA|AAPL R735QTJ8XC9X\nAAPL XFO1EJ5F02UE|AAPL R735QTJ8XC9X\nAAPL XFO1EJU82A92|AAPL R735QTJ8XC9X\nAAPL 31ES1JYY04I92|AAPL R735QTJ8XC9X\nAAPL 31ES1JY6JV37Q|AAPL R735QTJ8XC9X\nAAPL 31ES1JYZNNUQU|AAPL R735QTJ8XC9X\nAAPL 31ES1JY3QPJJA|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ1B778M|AAPL R735QTJ8XC9X\nAAPL 31ES1JY6VRRBA|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ2YQJQE|AAPL R735QTJ8XC9X\nAAPL 31ES1JY71Q3D2|AAPL R735QTJ8XC9X\nAAPL 31ES1JZ4M9W86|AAPL R735QTJ8XC9X\nAAPL 31ES1JZTFC3MU|AAPL R735QTJ8XC9X\nAAPL XFO1EITU8NDY|AAPL R735QTJ8XC9X\nAAPL XFO1EI6UQ9OM|AAPL R735QTJ8XC9X\nAAPL XFO1EIVHRZVQ|AAPL R735QTJ8XC9X\nAAPL XFO1EI70OLQE|AAPL R735QTJ8XC9X\nAAPL XFO1EIX5BCDI|AAPL R735QTJ8XC9X\nAAPL XFO1EI76MXS6|AAPL R735QTJ8XC9X\nAAPL XFO1EIAHPMRQ|AAPL R735QTJ8XC9X\nAAPL 31ES1JYT1IGRQ|AAPL R735QTJ8XC9X\nAAPL 31ES1JY62032E|AAPL R735QTJ8XC9X\nAAPL 31ES1JYUP1T9I|AAPL R735QTJ8XC9X\nAAPL 31ES1JY67YF46|AAPL R735QTJ8XC9X\nAAPL 31ES1JYWCL5RA|AAPL R735QTJ8XC9X\nAAPL 31ES1JY6DWR5Y|AAPL R735QTJ8XC9X\nAAPL 31ES1JY9OZG5I|AAPL R735QTJ8XC9X\nAAPL XF3D0L7BZSDI|AAPL R735QTJ8XC9X\nAAPL XFA958RIJ2HY|AAPL R735QTJ8XC9X\nAAPL XFO1EJVVLMQU|AAPL R735QTJ8XC9X\nAAPL XIQBGZAPWT52|AAPL R735QTJ8XC9X\nAAPL 31E7D616J9LRA|AAPL R735QTJ8XC9X\nAAPL 31EE9AOQPSVVQ|AAPL R735QTJ8XC9X\nAAPL 31ES1JZV2VG4M|AAPL R735QTJ8XC9X\nAAPL 31HUBMF9X6MIU|AAPL R735QTJ8XC9X\nAAPL XL7X5IRWU0DI|AAPL R735QTJ8XC9X\nAAPL XL7X5ITKDCVA|AAPL R735QTJ8XC9X\nAAPL XL7X5IV7WPD2|AAPL R735QTJ8XC9X\nAAPL XL7X5IWVG1UU|AAPL R735QTJ8XC9X\nAAPL XL7X5IYIZECM|AAPL R735QTJ8XC9X\nAAPL XL7X5J06IQUE|AAPL R735QTJ8XC9X\nAAPL XL7X5J1U23C6|AAPL R735QTJ8XC9X\nAAPL XL7X5J3HLFTY|AAPL R735QTJ8XC9X\nAAPL XL7X5J554SBQ|AAPL R735QTJ8XC9X\nAAPL XFA9576ALEKM|AAPL R735QTJ8XC9X\nAAPL XFO1EIANNYTI|AAPL R735QTJ8XC9X\nAAPL XL7X5J6SO4TI|AAPL R735QTJ8XC9X\nAAPL XL7X5J8G7HBA|AAPL R735QTJ8XC9X\nAAPL XL7X5JA3QTT2|AAPL R735QTJ8XC9X\nAAPL XIQBGZAVV56U|AAPL R735QTJ8XC9X\nAAPL 31KBXAYR43TRA|AAPL R735QTJ8XC9X\nAAPL 31KBXAYSRN692|AAPL R735QTJ8XC9X\nAAPL 31KBXAYUF6IQU|AAPL R735QTJ8XC9X\nAAPL 31KBXAYW2PV8M|AAPL R735QTJ8XC9X\nAAPL 31KBXAYXQ97QE|AAPL R735QTJ8XC9X\nAAPL 31KBXAYZDSK86|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ11BWPY|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ2OV97Q|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ4CELPI|AAPL R735QTJ8XC9X\nAAPL 31EE9AN5HV7YE|AAPL R735QTJ8XC9X\nAAPL 31ES1JY9UXS7A|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ5ZXY7A|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ7NHAP2|AAPL R735QTJ8XC9X\nAAPL 31KBXAZ9B0N6U|AAPL R735QTJ8XC9X\nAAPL 31HUBMFA34YKM|AAPL R735QTJ8XC9X\nAAPL XFH5A7J84VYE|AAPL R735QTJ8XC9X\nAAPL XFH5A7RHTMFA|AAPL R735QTJ8XC9X\nAAPL XFH5A7ZRICW6|AAPL R735QTJ8XC9X\nAAPL XFH5A88173D2|AAPL R735QTJ8XC9X\nAAPL XFH5A8GAVTTY|AAPL R735QTJ8XC9X\nAAPL XFH5A8OKKKAU|AAPL R735QTJ8XC9X\nAAPL XFH5A8WU9ARQ|AAPL R735QTJ8XC9X\nAAPL XFH5A953Y18M|AAPL R735QTJ8XC9X\nAAPL XFH5A9DDMRPI|AAPL R735QTJ8XC9X\nAAPL 31EL5FNIFEPC6|AAPL R735QTJ8XC9X\nAAPL 31EL5FNQP3FT2|AAPL R735QTJ8XC9X\nAAPL 31EL5FNYYS69Y|AAPL R735QTJ8XC9X\nAAPL 31EL5FO78GWQU|AAPL R735QTJ8XC9X\nAAPL 31EL5FOFI5N7Q|AAPL R735QTJ8XC9X\nAAPL 31EL5FONRUDOM|AAPL R735QTJ8XC9X\nAAPL 31EL5FOW1J45I|AAPL R735QTJ8XC9X\nAAPL 31EL5FP4B7UME|AAPL R735QTJ8XC9X\nAAPL 31EL5FPCKWL3A|AAPL R735QTJ8XC9X\nAAPL XJOS48YI0U86|AAPL R735QTJ8XC9X\nAAPL XJOS49LNHJZA|AAPL R735QTJ8XC9X\nAAPL XJOS48YNZ69Y|AAPL R735QTJ8XC9X\nAAPL XJOS49NB0WH2|AAPL R735QTJ8XC9X\nAAPL XJOS48YTXIBQ|AAPL R735QTJ8XC9X\nAAPL XJOS49OYK8YU|AAPL R735QTJ8XC9X\nAAPL XJOS48YZVUDI|AAPL R735QTJ8XC9X\nAAPL XJOS49QM3LGM|AAPL R735QTJ8XC9X\nAAPL XJOS48Z5U6FA|AAPL R735QTJ8XC9X\nAAPL XJOS49S9MXYE|AAPL R735QTJ8XC9X\nAAPL XJOS48WCOMQU|AAPL R735QTJ8XC9X\nAAPL XJOS49TX6AG6|AAPL R735QTJ8XC9X\nAAPL XJOS48ZHQUIU|AAPL R735QTJ8XC9X\nAAPL XJOS49VKPMXY|AAPL R735QTJ8XC9X\nAAPL XJOS48ZNP6KM|AAPL R735QTJ8XC9X\nAAPL XJOS49X88ZFQ|AAPL R735QTJ8XC9X\nAAPL XJOS48ZTNIME|AAPL R735QTJ8XC9X\nAAPL XJOS49YVSBXI|AAPL R735QTJ8XC9X\nAAPL XJOS48ZZLUO6|AAPL R735QTJ8XC9X\nAAPL XJOS4A0JBOFA|AAPL R735QTJ8XC9X\nAAPL XJOS4905K6PY|AAPL R735QTJ8XC9X\nAAPL XJOS4A26V0X2|AAPL R735QTJ8XC9X\nAAPL XJOS490BIIRQ|AAPL R735QTJ8XC9X\nAAPL XJOS4A3UEDEU|AAPL R735QTJ8XC9X\nAAPL XJOS490HGUTI|AAPL R735QTJ8XC9X\nAAPL XJOS4A5HXPWM|AAPL R735QTJ8XC9X\nAAPL XJOS490NF6VA|AAPL R735QTJ8XC9X\nAAPL XJOS4A75H2EE|AAPL R735QTJ8XC9X\nAAPL XJOS490TDIX2|AAPL R735QTJ8XC9X\nAAPL XJOS4A8T0EW6|AAPL R735QTJ8XC9X\nAAPL XJOS48WIMYSM|AAPL R735QTJ8XC9X\nAAPL XJOS4AAGJRDY|AAPL R735QTJ8XC9X\nAAPL XJOS4915A70M|AAPL R735QTJ8XC9X\nAAPL XJOS4AC433VQ|AAPL R735QTJ8XC9X\nAAPL XJOS491B8J2E|AAPL R735QTJ8XC9X\nAAPL XJOS4ADRMGDI|AAPL R735QTJ8XC9X\nAAPL XJOS491H6V46|AAPL R735QTJ8XC9X\nAAPL XJOS4AFF5SVA|AAPL R735QTJ8XC9X\nAAPL XJOS491N575Y|AAPL R735QTJ8XC9X\nAAPL XJOS4AH2P5D2|AAPL R735QTJ8XC9X\nAAPL XJOS491T3J7Q|AAPL R735QTJ8XC9X\nAAPL XJOS4AIQ8HUU|AAPL R735QTJ8XC9X\nAAPL XJOS491Z1V9I|AAPL R735QTJ8XC9X\nAAPL XJOS4AKDRUCM|AAPL R735QTJ8XC9X\nAAPL XJOS492507BA|AAPL R735QTJ8XC9X\nAAPL XJOS4AM1B6UE|AAPL R735QTJ8XC9X\nAAPL XJOS492AYJD2|AAPL R735QTJ8XC9X\nAAPL XJOS4ANOUJC6|AAPL R735QTJ8XC9X\nAAPL XJOS492GWVEU|AAPL R735QTJ8XC9X\nAAPL XJOS4APCDVTY|AAPL R735QTJ8XC9X\nAAPL XJOS48WOLAUE|AAPL R735QTJ8XC9X\nAAPL XJOS4AQZX8BQ|AAPL R735QTJ8XC9X\nAAPL XJOS492STJIE|AAPL R735QTJ8XC9X\nAAPL XJOS4ASNGKTI|AAPL R735QTJ8XC9X\nAAPL XJOS492YRVK6|AAPL R735QTJ8XC9X\nAAPL 31ISS9OXPANLY|AAPL R735QTJ8XC9X\nAAPL 31ISS9PKURDD2|AAPL R735QTJ8XC9X\nAAPL 31ISS9OXV8ZNQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9PMIAPUU|AAPL R735QTJ8XC9X\nAAPL 31ISS9OY17BPI|AAPL R735QTJ8XC9X\nAAPL 31ISS9PO5U2CM|AAPL R735QTJ8XC9X\nAAPL 31ISS9OY75NRA|AAPL R735QTJ8XC9X\nAAPL 31ISS9PPTDEUE|AAPL R735QTJ8XC9X\nAAPL 31ISS9OYD3ZT2|AAPL R735QTJ8XC9X\nAAPL 31ISS9PRGWRC6|AAPL R735QTJ8XC9X\nAAPL 31ISS9OVJYG4M|AAPL R735QTJ8XC9X\nAAPL 31ISS9PT4G3TY|AAPL R735QTJ8XC9X\nAAPL 31ISS9OYP0NWM|AAPL R735QTJ8XC9X\nAAPL 31ISS9PURZGBQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9OYUYZYE|AAPL R735QTJ8XC9X\nAAPL 31ISS9PWFISTI|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZ0XC06|AAPL R735QTJ8XC9X\nAAPL 31ISS9PY325BA|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZ6VO1Y|AAPL R735QTJ8XC9X\nAAPL 31ISS9PZQLHT2|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZCU03Q|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q1E4UAU|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZISC5I|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q31O6SM|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZOQO7A|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q4P7JAE|AAPL R735QTJ8XC9X\nAAPL 31ISS9OZUP092|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q6CQVS6|AAPL R735QTJ8XC9X\nAAPL 31ISS9P00NCAU|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q80A89Y|AAPL R735QTJ8XC9X\nAAPL 31ISS9OVPWS6E|AAPL R735QTJ8XC9X\nAAPL 31ISS9Q9NTKRQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9P0CK0EE|AAPL R735QTJ8XC9X\nAAPL 31ISS9QBBCX9I|AAPL R735QTJ8XC9X\nAAPL 31ISS9P0IICG6|AAPL R735QTJ8XC9X\nAAPL 31ISS9QCYW9RA|AAPL R735QTJ8XC9X\nAAPL 31ISS9P0OGOHY|AAPL R735QTJ8XC9X\nAAPL 31ISS9QEMFM92|AAPL R735QTJ8XC9X\nAAPL 31ISS9P0UF0JQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9QG9YYQU|AAPL R735QTJ8XC9X\nAAPL 31ISS9P10DCLI|AAPL R735QTJ8XC9X\nAAPL 31ISS9QHXIB8M|AAPL R735QTJ8XC9X\nAAPL 31ISS9P16BONA|AAPL R735QTJ8XC9X\nAAPL 31ISS9QJL1NQE|AAPL R735QTJ8XC9X\nAAPL 31ISS9P1CA0P2|AAPL R735QTJ8XC9X\nAAPL 31ISS9QL8L086|AAPL R735QTJ8XC9X\nAAPL 31ISS9P1I8CQU|AAPL R735QTJ8XC9X\nAAPL 31ISS9QMW4CPY|AAPL R735QTJ8XC9X\nAAPL 31ISS9P1O6OSM|AAPL R735QTJ8XC9X\nAAPL 31ISS9QOJNP7Q|AAPL R735QTJ8XC9X\nAAPL 31ISS9OVVV486|AAPL R735QTJ8XC9X\nAAPL 31ISS9QQ771PI|AAPL R735QTJ8XC9X\nAAPL 31ISS9P203CW6|AAPL R735QTJ8XC9X\nAAPL 31ISS9QRUQE7A|AAPL R735QTJ8XC9X\nAAPL 31ISS9P261OXY|AAPL R735QTJ8XC9X\nAAPL XFTY32FCRT3A|AAPL R735QTJ8XC9X\nAAPL XFTY33HE2NAE|AAPL R735QTJ8XC9X\nAAPL XFTY32FIQ552|AAPL R735QTJ8XC9X\nAAPL XFTY33J1LZS6|AAPL R735QTJ8XC9X\nAAPL XFTY32FOOH6U|AAPL R735QTJ8XC9X\nAAPL XFTY33KP5C9Y|AAPL R735QTJ8XC9X\nAAPL XFTY32FUMT8M|AAPL R735QTJ8XC9X\nAAPL XFTY33MCOORQ|AAPL R735QTJ8XC9X\nAAPL XFTY32G0L5AE|AAPL R735QTJ8XC9X\nAAPL XFTY3FQYI5ZA|AAPL R735QTJ8XC9X\nAAPL XFTY33O0819I|AAPL R735QTJ8XC9X\nAAPL XFTY3FZ86WG6|AAPL R735QTJ8XC9X\nAAPL XFTY32BPUL5Y|AAPL R735QTJ8XC9X\nAAPL XFTY3G7HVMX2|AAPL R735QTJ8XC9X\nAAPL XFTY33PNRDRA|AAPL R735QTJ8XC9X\nAAPL XFTY3GFRKDDY|AAPL R735QTJ8XC9X\nAAPL XFTY32GCHTDY|AAPL R735QTJ8XC9X\nAAPL XFTY3GO193UU|AAPL R735QTJ8XC9X\nAAPL XFTY33RBAQ92|AAPL R735QTJ8XC9X\nAAPL XFTY3GWAXUBQ|AAPL R735QTJ8XC9X\nAAPL XFTY32GIG5FQ|AAPL R735QTJ8XC9X\nAAPL XFTY3H4KMKSM|AAPL R735QTJ8XC9X\nAAPL XFTY33SYU2QU|AAPL R735QTJ8XC9X\nAAPL XEWGWAX3PNT2|AAPL R735QTJ8XC9X\nAAPL XF3D0YHA8XXI|AAPL R735QTJ8XC9X\nAAPL XFA95M1GS81Y|AAPL R735QTJ8XC9X\nAAPL XFH5A9LNBI6E|AAPL R735QTJ8XC9X\nAAPL XFO1EX5TUSAU|AAPL R735QTJ8XC9X\nAAPL XFTY3HCUBB9I|AAPL R735QTJ8XC9X\nAAPL XFTY32GOEHHI|AAPL R735QTJ8XC9X\nAAPL XEWGWB5DEE9Y|AAPL R735QTJ8XC9X\nAAPL XF3D0YPJXOEE|AAPL R735QTJ8XC9X\nAAPL XFA95M9QGYIU|AAPL R735QTJ8XC9X\nAAPL XFH5A9TX08NA|AAPL R735QTJ8XC9X\nAAPL XFO1EXE3JIRQ|AAPL R735QTJ8XC9X\nAAPL XFTY3HL401QE|AAPL R735QTJ8XC9X\nAAPL XFTY33UMDF8M|AAPL R735QTJ8XC9X\nAAPL XEWGWBDN34QU|AAPL R735QTJ8XC9X\nAAPL XF3D0YXTMEVA|AAPL R735QTJ8XC9X\nAAPL XFA95MI05OZQ|AAPL R735QTJ8XC9X\nAAPL XFH5AA26OZ46|AAPL R735QTJ8XC9X\nAAPL XFO1EXMD898M|AAPL R735QTJ8XC9X\nAAPL XFTY3HTDOS7A|AAPL R735QTJ8XC9X\nAAPL XFTY32GUCTJA|AAPL R735QTJ8XC9X\nAAPL XEWGWBLWRV7Q|AAPL R735QTJ8XC9X\nAAPL XF3D0Z63B5C6|AAPL R735QTJ8XC9X\nAAPL XFA95MQ9UFGM|AAPL R735QTJ8XC9X\nAAPL XFH5AAAGDPL2|AAPL R735QTJ8XC9X\nAAPL XFO1EXUMWZPI|AAPL R735QTJ8XC9X\nAAPL XFTY3I1NDIO6|AAPL R735QTJ8XC9X\nAAPL XFTY33W9WRQE|AAPL R735QTJ8XC9X\nAAPL XEWGWBU6GLOM|AAPL R735QTJ8XC9X\nAAPL XF3D0ZECZVT2|AAPL R735QTJ8XC9X\nAAPL XFA95MYJJ5XI|AAPL R735QTJ8XC9X\nAAPL XFH5AAIQ2G1Y|AAPL R735QTJ8XC9X\nAAPL XFO1EY2WLQ6E|AAPL R735QTJ8XC9X\nAAPL XFTY3I9X2952|AAPL R735QTJ8XC9X\nAAPL XFTY32H0B5L2|AAPL R735QTJ8XC9X\nAAPL XFTY33XXG486|AAPL R735QTJ8XC9X\nAAPL XFTY32H69HMU|AAPL R735QTJ8XC9X\nAAPL XFTY33ZKZGPY|AAPL R735QTJ8XC9X\nAAPL XFTY32HC7TOM|AAPL R735QTJ8XC9X\nAAPL XFTY3418IT7Q|AAPL R735QTJ8XC9X\nAAPL XFTY32HI65QE|AAPL R735QTJ8XC9X\nAAPL XFTY342W25PI|AAPL R735QTJ8XC9X\nAAPL XF3D0JM424G6|AAPL R735QTJ8XC9X\nAAPL XFTY32HO4HS6|AAPL R735QTJ8XC9X\nAAPL XJOS4934Q7LY|AAPL R735QTJ8XC9X\nAAPL XJOS493AOJNQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8IEK1MH2|AAPL R735QTJ8XC9X\nAAPL 31EXY8JGLCGO6|AAPL R735QTJ8XC9X\nAAPL 31EXY8IEPZYIU|AAPL R735QTJ8XC9X\nAAPL 31EXY8JI8VT5Y|AAPL R735QTJ8XC9X\nAAPL 31EXY8IEVYAKM|AAPL R735QTJ8XC9X\nAAPL 31EXY8JJWF5NQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8IF1WMME|AAPL R735QTJ8XC9X\nAAPL 31EXY8JLJYI5I|AAPL R735QTJ8XC9X\nAAPL 31EXY8IF7UYO6|AAPL R735QTJ8XC9X\nAAPL 31EXY8VQ5RZD2|AAPL R735QTJ8XC9X\nAAPL 31EXY8JN7HUNA|AAPL R735QTJ8XC9X\nAAPL 31EXY8VYFGPTY|AAPL R735QTJ8XC9X\nAAPL 31EXY8IAX4EJQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8W6P5GAU|AAPL R735QTJ8XC9X\nAAPL 31EXY8JOV1752|AAPL R735QTJ8XC9X\nAAPL 31EXY8WEYU6RQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8IFJRMRQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8WN8IX8M|AAPL R735QTJ8XC9X\nAAPL 31EXY8JQIKJMU|AAPL R735QTJ8XC9X\nAAPL 31EXY8WVI7NPI|AAPL R735QTJ8XC9X\nAAPL 31EXY8IFPPYTI|AAPL R735QTJ8XC9X\nAAPL 31EXY8X3RWE6E|AAPL R735QTJ8XC9X\nAAPL 31EXY8JS63W4M|AAPL R735QTJ8XC9X\nAAPL 31E0H1QWAZH6U|AAPL R735QTJ8XC9X\nAAPL 31E7D6EGHIRBA|AAPL R735QTJ8XC9X\nAAPL 31EE9B20O21FQ|AAPL R735QTJ8XC9X\nAAPL 31EL5FPKULBK6|AAPL R735QTJ8XC9X\nAAPL 31ES1KD514LOM|AAPL R735QTJ8XC9X\nAAPL 31EXY8XC1L4NA|AAPL R735QTJ8XC9X\nAAPL 31EXY8IFVOAVA|AAPL R735QTJ8XC9X\nAAPL 31E0H1R4KO7NQ|AAPL R735QTJ8XC9X\nAAPL 31E7D6EOR7HS6|AAPL R735QTJ8XC9X\nAAPL 31EE9B28XQRWM|AAPL R735QTJ8XC9X\nAAPL 31EL5FPT4A212|AAPL R735QTJ8XC9X\nAAPL 31ES1KDDATC5I|AAPL R735QTJ8XC9X\nAAPL 31EXY8XKB9V46|AAPL R735QTJ8XC9X\nAAPL 31EXY8JTTN8ME|AAPL R735QTJ8XC9X\nAAPL 31E0H1RCUCY4M|AAPL R735QTJ8XC9X\nAAPL 31E7D6EX0W892|AAPL R735QTJ8XC9X\nAAPL 31EE9B2H7FIDI|AAPL R735QTJ8XC9X\nAAPL 31EL5FQ1DYSHY|AAPL R735QTJ8XC9X\nAAPL 31ES1KDLKI2ME|AAPL R735QTJ8XC9X\nAAPL 31EXY8XSKYLL2|AAPL R735QTJ8XC9X\nAAPL 31EXY8IG1MMX2|AAPL R735QTJ8XC9X\nAAPL 31E0H1RL41OLI|AAPL R735QTJ8XC9X\nAAPL 31E7D6F5AKYPY|AAPL R735QTJ8XC9X\nAAPL 31EE9B2PH48UE|AAPL R735QTJ8XC9X\nAAPL 31EL5FQ9NNIYU|AAPL R735QTJ8XC9X\nAAPL 31ES1KDTU6T3A|AAPL R735QTJ8XC9X\nAAPL 31EXY8Y0UNC1Y|AAPL R735QTJ8XC9X\nAAPL 31EXY8JVH6L46|AAPL R735QTJ8XC9X\nAAPL 31E0H1RTDQF2E|AAPL R735QTJ8XC9X\nAAPL 31E7D6FDK9P6U|AAPL R735QTJ8XC9X\nAAPL 31EE9B2XQSZBA|AAPL R735QTJ8XC9X\nAAPL 31EL5FQHXC9FQ|AAPL R735QTJ8XC9X\nAAPL 31ES1KE23VJK6|AAPL R735QTJ8XC9X\nAAPL 31EXY8Y94C2IU|AAPL R735QTJ8XC9X\nAAPL 31EXY8IG7KYYU|AAPL R735QTJ8XC9X\nAAPL 31EXY8JX4PXLY|AAPL R735QTJ8XC9X\nAAPL 31EXY8IGDJB0M|AAPL R735QTJ8XC9X\nAAPL 31EXY8JYS9A3Q|AAPL R735QTJ8XC9X\nAAPL 31EXY8IGJHN2E|AAPL R735QTJ8XC9X\nAAPL 31EXY8K0FSMLI|AAPL R735QTJ8XC9X\nAAPL 31EXY8IGPFZ46|AAPL R735QTJ8XC9X\nAAPL 31EXY8K23BZ3A|AAPL R735QTJ8XC9X\nAAPL 31E7D5ZLBBXTY|AAPL R735QTJ8XC9X\nAAPL 31EXY8IGVEB5Y|AAPL R735QTJ8XC9X\nAAPL 31ISS9P2C00ZQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9P2HYD1I|AAPL R735QTJ8XC9X\nAAPL XFTY32BJW946|AAPL R735QTJ8XC9X\nAAPL XFTY3394DWTI|AAPL R735QTJ8XC9X\nAAPL XFTY32EOYGW6|AAPL R735QTJ8XC9X\nAAPL XFTY33ARX9BA|AAPL R735QTJ8XC9X\nAAPL XFTY32EUWSXY|AAPL R735QTJ8XC9X\nAAPL XFTY33CFGLT2|AAPL R735QTJ8XC9X\nAAPL XFTY32F0V4ZQ|AAPL R735QTJ8XC9X\nAAPL XFTY33E2ZYAU|AAPL R735QTJ8XC9X\nAAPL XFTY32F6TH1I|AAPL R735QTJ8XC9X\nAAPL XFTY33FQJASM|AAPL R735QTJ8XC9X\nAAPL Y1VKEF5RIOIU|AAPL R735QTJ8XC9X\nAAPL Y1VKEGJPFH46|AAPL R735QTJ8XC9X\nAAPL Y1VKEFAE5WQU|AAPL R735QTJ8XC9X\nAAPL Y1VKEGLCYTLY|AAPL R735QTJ8XC9X\nAAPL Y1VKEFAK48SM|AAPL R735QTJ8XC9X\nAAPL Y1VKEGN0I63Q|AAPL R735QTJ8XC9X\nAAPL Y1VKEFAQ2KUE|AAPL R735QTJ8XC9X\nAAPL Y1VKEGOO1ILI|AAPL R735QTJ8XC9X\nAAPL Y1VKEFAW0WW6|AAPL R735QTJ8XC9X\nAAPL Y1VKEGQBKV3A|AAPL R735QTJ8XC9X\nAAPL XJOS493GMVPI|AAPL R735QTJ8XC9X\nAAPL 31EXY8IAR62HY|AAPL R735QTJ8XC9X\nAAPL 31EXY8J8BNQ7A|AAPL R735QTJ8XC9X\nAAPL 31EXY8IDW8A9Y|AAPL R735QTJ8XC9X\nAAPL 31EXY8J9Z72P2|AAPL R735QTJ8XC9X\nAAPL 31EXY8IE26MBQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8JBMQF6U|AAPL R735QTJ8XC9X\nAAPL 31EXY8IE84YDI|AAPL R735QTJ8XC9X\nAAPL 31EXY8JDA9ROM|AAPL R735QTJ8XC9X\nAAPL 31EXY8IEE3AFA|AAPL R735QTJ8XC9X\nAAPL 31EXY8JEXT46E|AAPL R735QTJ8XC9X\nAAPL 320ZKJV4YSHWM|AAPL R735QTJ8XC9X\nAAPL 320ZKJWIWPAHY|AAPL R735QTJ8XC9X\nAAPL 320ZKJV9LFQ4M|AAPL R735QTJ8XC9X\nAAPL 320ZKJWKK8MZQ|AAPL R735QTJ8XC9X\nAAPL 320ZKJV9RE26E|AAPL R735QTJ8XC9X\nAAPL 320ZKJWM7RZHI|AAPL R735QTJ8XC9X\nAAPL 320ZKJV9XCE86|AAPL R735QTJ8XC9X\nAAPL 320ZKJWNVBBZA|AAPL R735QTJ8XC9X\nAAPL 320ZKJVA3AQ9Y|AAPL R735QTJ8XC9X\nAAPL 320ZKJWPIUOH2|AAPL R735QTJ8XC9X\nAAPL 31ISS9P2NWP3A|AAPL R735QTJ8XC9X\nAAPL Y1VKEF9EFWG6|AAPL R735QTJ8XC9X\nAAPL Y1VKEF9KE8HY|AAPL R735QTJ8XC9X\nAAPL Y1VKEF9QCKJQ|AAPL R735QTJ8XC9X\nAAPL Y1VKEF9WAWLI|AAPL R735QTJ8XC9X\nAAPL Y1VKEFA298NA|AAPL R735QTJ8XC9X\nAAPL Y1VKEFB1Z8XY|AAPL R735QTJ8XC9X\nAAPL Y1VKEFB7XKZQ|AAPL R735QTJ8XC9X\nAAPL Y1VKEFBDVX1I|AAPL R735QTJ8XC9X\nAAPL Y1VKEFBJU93A|AAPL R735QTJ8XC9X\nAAPL Y1VKEFBPSL52|AAPL R735QTJ8XC9X\nAAPL Y1VKEF5XH0KM|AAPL R735QTJ8XC9X\nAAPL Y1VKEFCPILFQ|AAPL R735QTJ8XC9X\nAAPL Y1VKEF63FCME|AAPL R735QTJ8XC9X\nAAPL 320ZKJV8LPPTY|AAPL R735QTJ8XC9X\nAAPL 320ZKJV8RO1VQ|AAPL R735QTJ8XC9X\nAAPL 320ZKJV8XMDXI|AAPL R735QTJ8XC9X\nAAPL 320ZKJV93KPZA|AAPL R735QTJ8XC9X\nAAPL 320ZKJV99J212|AAPL R735QTJ8XC9X\nAAPL 320ZKJVA992BQ|AAPL R735QTJ8XC9X\nAAPL 320ZKJVAF7EDI|AAPL R735QTJ8XC9X\nAAPL 320ZKJVAL5QFA|AAPL R735QTJ8XC9X\nAAPL 320ZKJVAR42H2|AAPL R735QTJ8XC9X\nAAPL 320ZKJVAX2EIU|AAPL R735QTJ8XC9X\nAAPL 320ZKJV54QTYE|AAPL R735QTJ8XC9X\nAAPL 320ZKJVBWSETI|AAPL R735QTJ8XC9X\nAAPL 320ZKJV5AP606|AAPL R735QTJ8XC9X\nAAPL XFTY32DV6SNA|AAPL R735QTJ8XC9X\nAAPL Y1VKEF7WUW06|AAPL R735QTJ8XC9X\nAAPL XFTY332I8IUE|AAPL R735QTJ8XC9X\nAAPL Y1VKEFWJWM7A|AAPL R735QTJ8XC9X\nAAPL XFTY32E154P2|AAPL R735QTJ8XC9X\nAAPL Y1VKEF82T81Y|AAPL R735QTJ8XC9X\nAAPL XFTY3345RVC6|AAPL R735QTJ8XC9X\nAAPL Y1VKEFY7FYP2|AAPL R735QTJ8XC9X\nAAPL XFTY32E73GQU|AAPL R735QTJ8XC9X\nAAPL Y1VKEF88RK3Q|AAPL R735QTJ8XC9X\nAAPL XFTY335TB7TY|AAPL R735QTJ8XC9X\nAAPL Y1VKEFZUZB6U|AAPL R735QTJ8XC9X\nAAPL XFTY32ED1SSM|AAPL R735QTJ8XC9X\nAAPL Y1VKEF8EPW5I|AAPL R735QTJ8XC9X\nAAPL XFTY337GUKBQ|AAPL R735QTJ8XC9X\nAAPL Y1VKEG1IINOM|AAPL R735QTJ8XC9X\nAAPL Y1VKEF5LKCH2|AAPL R735QTJ8XC9X\nAAPL Y1VKEF8QMK92|AAPL R735QTJ8XC9X\nAAPL Y1VKEF8WKWAU|AAPL R735QTJ8XC9X\nAAPL Y1VKEF92J8CM|AAPL R735QTJ8XC9X\nAAPL Y1VKEF98HKEE|AAPL R735QTJ8XC9X\nAAPL Y1VKEFC1P98M|AAPL R735QTJ8XC9X\nAAPL Y1VKEFC7NLAE|AAPL R735QTJ8XC9X\nAAPL Y1VKEFCDLXC6|AAPL R735QTJ8XC9X\nAAPL Y1VKEFCJK9DY|AAPL R735QTJ8XC9X\nAAPL XJOS493ML7RA|AAPL R735QTJ8XC9X\nAAPL Y1VKEFCVGXHI|AAPL R735QTJ8XC9X\nAAPL Y1VKEFD1F9JA|AAPL R735QTJ8XC9X\nAAPL 31EXY8ID2GM12|AAPL R735QTJ8XC9X\nAAPL 320ZKJV744PDY|AAPL R735QTJ8XC9X\nAAPL 31EXY8J1PIC86|AAPL R735QTJ8XC9X\nAAPL 320ZKJVVR6FL2|AAPL R735QTJ8XC9X\nAAPL 31EXY8ID8EY2U|AAPL R735QTJ8XC9X\nAAPL 320ZKJV7A31FQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8J3D1OPY|AAPL R735QTJ8XC9X\nAAPL 320ZKJVXEPS2U|AAPL R735QTJ8XC9X\nAAPL 31EXY8IDEDA4M|AAPL R735QTJ8XC9X\nAAPL 320ZKJV7G1DHI|AAPL R735QTJ8XC9X\nAAPL 31EXY8J50L17Q|AAPL R735QTJ8XC9X\nAAPL 320ZKJVZ294KM|AAPL R735QTJ8XC9X\nAAPL 31EXY8IDKBM6E|AAPL R735QTJ8XC9X\nAAPL 320ZKJV7LZPJA|AAPL R735QTJ8XC9X\nAAPL 31EXY8J6O4DPI|AAPL R735QTJ8XC9X\nAAPL 320ZKJW0PSH2E|AAPL R735QTJ8XC9X\nAAPL 320ZKJV4SU5UU|AAPL R735QTJ8XC9X\nAAPL 320ZKJV7XWDMU|AAPL R735QTJ8XC9X\nAAPL 320ZKJV83UPOM|AAPL R735QTJ8XC9X\nAAPL 320ZKJV89T1QE|AAPL R735QTJ8XC9X\nAAPL 320ZKJV8FRDS6|AAPL R735QTJ8XC9X\nAAPL 320ZKJVB8Z2ME|AAPL R735QTJ8XC9X\nAAPL 320ZKJVBEXEO6|AAPL R735QTJ8XC9X\nAAPL 320ZKJVBKVQPY|AAPL R735QTJ8XC9X\nAAPL 320ZKJVBQU2RQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9P2TV152|AAPL R735QTJ8XC9X\nAAPL 320ZKJVC2QQVA|AAPL R735QTJ8XC9X\nAAPL 320ZKJVC8P2X2|AAPL R735QTJ8XC9X\nAAPL XG1TNUD35C2U|AAPL R735QTJ8XC9X\nAAPL XG1TNTCPDUDI|AAPL R735QTJ8XC9X\nAAPL XG1TNUEQOOKM|AAPL R735QTJ8XC9X\nAAPL XG1TNTCVC6FA|AAPL R735QTJ8XC9X\nAAPL XG1TNUGE812E|AAPL R735QTJ8XC9X\nAAPL XG1TNTD1AIH2|AAPL R735QTJ8XC9X\nAAPL XG1TNUI1RDK6|AAPL R735QTJ8XC9X\nAAPL XG1TNTD78UIU|AAPL R735QTJ8XC9X\nAAPL XG1TNUJPAQ1Y|AAPL R735QTJ8XC9X\nAAPL XG1TNTDD76KM|AAPL R735QTJ8XC9X\nAAPL XG1TO6OB479I|AAPL R735QTJ8XC9X\nAAPL XG1TNULCU2JQ|AAPL R735QTJ8XC9X\nAAPL XG1TO6WKSXQE|AAPL R735QTJ8XC9X\nAAPL XG1TNT92GMG6|AAPL R735QTJ8XC9X\nAAPL XG1TO74UHO7A|AAPL R735QTJ8XC9X\nAAPL XG1TNUN0DF1I|AAPL R735QTJ8XC9X\nAAPL XG1TO7D46EO6|AAPL R735QTJ8XC9X\nAAPL XG1TNTDP3UO6|AAPL R735QTJ8XC9X\nAAPL XG1TO7LDV552|AAPL R735QTJ8XC9X\nAAPL XG1TNUONWRJA|AAPL R735QTJ8XC9X\nAAPL XG1TO7TNJVLY|AAPL R735QTJ8XC9X\nAAPL XG1TNTDV26PY|AAPL R735QTJ8XC9X\nAAPL XG1TO81X8M2U|AAPL R735QTJ8XC9X\nAAPL XG1TNUQBG412|AAPL R735QTJ8XC9X\nAAPL XG1TO8A6XCJQ|AAPL R735QTJ8XC9X\nAAPL XG1TNTE10IRQ|AAPL R735QTJ8XC9X\nAAPL XG1TO8IGM30M|AAPL R735QTJ8XC9X\nAAPL XG1TNURYZGIU|AAPL R735QTJ8XC9X\nAAPL XG1TO8QQATHI|AAPL R735QTJ8XC9X\nAAPL XG1TNTE6YUTI|AAPL R735QTJ8XC9X\nAAPL XG1TNUTMIT0M|AAPL R735QTJ8XC9X\nAAPL XG1TNTECX6VA|AAPL R735QTJ8XC9X\nAAPL XG1TNUVA25IE|AAPL R735QTJ8XC9X\nAAPL XG1TNTEIVIX2|AAPL R735QTJ8XC9X\nAAPL XG1TNUWXLI06|AAPL R735QTJ8XC9X\nAAPL XG1TNTEOTUYU|AAPL R735QTJ8XC9X\nAAPL XG1TNUYL4UHY|AAPL R735QTJ8XC9X\nAAPL XG1TNTEUS70M|AAPL R735QTJ8XC9X\nAAPL XG1TNV08O6ZQ|AAPL R735QTJ8XC9X\nAAPL 31F5TTACAF5GM|AAPL R735QTJ8XC9X\nAAPL 31F5TT9BWNNRA|AAPL R735QTJ8XC9X\nAAPL 31F5TTADXYHYE|AAPL R735QTJ8XC9X\nAAPL 31F5TT9C2LZT2|AAPL R735QTJ8XC9X\nAAPL 31F5TTAFLHUG6|AAPL R735QTJ8XC9X\nAAPL 31F5TT9C8KBUU|AAPL R735QTJ8XC9X\nAAPL 31F5TTAH916XY|AAPL R735QTJ8XC9X\nAAPL 31F5TT9CEINWM|AAPL R735QTJ8XC9X\nAAPL 31F5TTAIWKJFQ|AAPL R735QTJ8XC9X\nAAPL 31F5TT9CKGZYE|AAPL R735QTJ8XC9X\nAAPL 31F5TTMNIE0NA|AAPL R735QTJ8XC9X\nAAPL 31F5TTAKK3VXI|AAPL R735QTJ8XC9X\nAAPL 31F5TTMVS2R46|AAPL R735QTJ8XC9X\nAAPL 31F5TT989QFTY|AAPL R735QTJ8XC9X\nAAPL 31F5TTN41RHL2|AAPL R735QTJ8XC9X\nAAPL 31F5TTAM7N8FA|AAPL R735QTJ8XC9X\nAAPL 31F5TTNCBG81Y|AAPL R735QTJ8XC9X\nAAPL 31F5TT9CWDO1Y|AAPL R735QTJ8XC9X\nAAPL 31F5TTNKL4YIU|AAPL R735QTJ8XC9X\nAAPL 31F5TTANV6KX2|AAPL R735QTJ8XC9X\nAAPL 31F5TTNSUTOZQ|AAPL R735QTJ8XC9X\nAAPL 31F5TT9D2C03Q|AAPL R735QTJ8XC9X\nAAPL 31F5TTO14IFGM|AAPL R735QTJ8XC9X\nAAPL 31F5TTAPIPXEU|AAPL R735QTJ8XC9X\nAAPL 31F5TTO9E75XI|AAPL R735QTJ8XC9X\nAAPL 31F5TT9D8AC5I|AAPL R735QTJ8XC9X\nAAPL 31F5TTOHNVWEE|AAPL R735QTJ8XC9X\nAAPL 31F5TTAR699WM|AAPL R735QTJ8XC9X\nAAPL 31F5TTOPXKMVA|AAPL R735QTJ8XC9X\nAAPL 31F5TT9DE8O7A|AAPL R735QTJ8XC9X\nAAPL 31F5TTASTSMEE|AAPL R735QTJ8XC9X\nAAPL 31F5TT9DK7092|AAPL R735QTJ8XC9X\nAAPL 31F5TTAUHBYW6|AAPL R735QTJ8XC9X\nAAPL 31F5TT9DQ5CAU|AAPL R735QTJ8XC9X\nAAPL 31F5TTAW4VBDY|AAPL R735QTJ8XC9X\nAAPL 31F5TT9DW3OCM|AAPL R735QTJ8XC9X\nAAPL 31F5TTAXSENVQ|AAPL R735QTJ8XC9X\nAAPL 31F5TT9E220EE|AAPL R735QTJ8XC9X\nAAPL 31F5TTAZFY0DI|AAPL R735QTJ8XC9X\nAAPL XG1TNTC1KI6E|AAPL R735QTJ8XC9X\nAAPL XG1TNU84JALI|AAPL R735QTJ8XC9X\nAAPL XG1TNTC7IU86|AAPL R735QTJ8XC9X\nAAPL XG1TNU9S2N3A|AAPL R735QTJ8XC9X\nAAPL XG1TNTCDH69Y|AAPL R735QTJ8XC9X\nAAPL XG1TNUBFLZL2|AAPL R735QTJ8XC9X\nAAPL XG1TNTCJFIBQ|AAPL R735QTJ8XC9X\nAAPL XJOS493SJJT2|AAPL R735QTJ8XC9X\nAAPL XIQBGZB1TH8M|AAPL R735QTJ8XC9X\nAAPL Y1VKEFD7DLL2|AAPL R735QTJ8XC9X\nAAPL 31F5TT9B8UBK6|AAPL R735QTJ8XC9X\nAAPL 31F5TTA7BT3ZA|AAPL R735QTJ8XC9X\nAAPL 31F5TT9BESNLY|AAPL R735QTJ8XC9X\nAAPL 31F5TTA8ZCGH2|AAPL R735QTJ8XC9X\nAAPL 31F5TT9BKQZNQ|AAPL R735QTJ8XC9X\nAAPL 31F5TTAAMVSYU|AAPL R735QTJ8XC9X\nAAPL 31F5TT9BQPBPI|AAPL R735QTJ8XC9X\nAAPL 31ISS9P2ZTD6U|AAPL R735QTJ8XC9X\nAAPL 31HUBMFA93AME|AAPL R735QTJ8XC9X\nAAPL 320ZKJVCENEYU|AAPL R735QTJ8XC9X\nAAPL XG1TNTZUUK4M|AAPL R735QTJ8XC9X\nAAPL XG1TNTBDR5ZA|AAPL R735QTJ8XC9X\nAAPL XG1TNU1IDWME|AAPL R735QTJ8XC9X\nAAPL XG1TNTBJPI12|AAPL R735QTJ8XC9X\nAAPL XG1TNU35X946|AAPL R735QTJ8XC9X\nAAPL XG1TNTBPNU2U|AAPL R735QTJ8XC9X\nAAPL XG1TNU4TGLLY|AAPL R735QTJ8XC9X\nAAPL XG1TNT8WIAEE|AAPL R735QTJ8XC9X\nAAPL XG1TNU6GZY3Q|AAPL R735QTJ8XC9X\nAAPL XJOS493YHVUU|AAPL R735QTJ8XC9X\nAAPL 31F5TT9Z24DIE|AAPL R735QTJ8XC9X\nAAPL 31F5TT9AL0ZD2|AAPL R735QTJ8XC9X\nAAPL 31F5TTA0PNQ06|AAPL R735QTJ8XC9X\nAAPL 31F5TT9AQZBEU|AAPL R735QTJ8XC9X\nAAPL 31F5TTA2D72HY|AAPL R735QTJ8XC9X\nAAPL 31F5TT9AWXNGM|AAPL R735QTJ8XC9X\nAAPL 31F5TTA40QEZQ|AAPL R735QTJ8XC9X\nAAPL 31F5TT983S3S6|AAPL R735QTJ8XC9X\nAAPL 31F5TTA5O9RHI|AAPL R735QTJ8XC9X\nAAPL 31ISS9P35RP8M|AAPL R735QTJ8XC9X\nAAPL XGFLX5J3R8TI|AAPL R735QTJ8XC9X\nAAPL XGFLX4H8EQO6|AAPL R735QTJ8XC9X\nAAPL XGFLX5KRALBA|AAPL R735QTJ8XC9X\nAAPL XGFLX4HED2PY|AAPL R735QTJ8XC9X\nAAPL XGFLX5METXT2|AAPL R735QTJ8XC9X\nAAPL XGFLX4HKBERQ|AAPL R735QTJ8XC9X\nAAPL XGFLX5O2DAAU|AAPL R735QTJ8XC9X\nAAPL XGFLX4HQ9QTI|AAPL R735QTJ8XC9X\nAAPL XGFLX5PPWMSM|AAPL R735QTJ8XC9X\nAAPL XGFLX4DFJ6P2|AAPL R735QTJ8XC9X\nAAPL XGFLXI97K8G6|AAPL R735QTJ8XC9X\nAAPL XGFLX5RDFZAE|AAPL R735QTJ8XC9X\nAAPL XGFLXIHH8YX2|AAPL R735QTJ8XC9X\nAAPL XGFLX4I26EX2|AAPL R735QTJ8XC9X\nAAPL XGFLXIPQXPDY|AAPL R735QTJ8XC9X\nAAPL XGFLX5T0ZBS6|AAPL R735QTJ8XC9X\nAAPL XGFLXIY0MFUU|AAPL R735QTJ8XC9X\nAAPL XGFLX4I84QYU|AAPL R735QTJ8XC9X\nAAPL XGFLXJ6AB6BQ|AAPL R735QTJ8XC9X\nAAPL XGFLX5UOIO9Y|AAPL R735QTJ8XC9X\nAAPL XGFLXJEJZWSM|AAPL R735QTJ8XC9X\nAAPL XGFLX4IE330M|AAPL R735QTJ8XC9X\nAAPL XGFLXJMTON9I|AAPL R735QTJ8XC9X\nAAPL XGFLX5WC20RQ|AAPL R735QTJ8XC9X\nAAPL XGFLXJV3DDQE|AAPL R735QTJ8XC9X\nAAPL XGFLX4IK1F2E|AAPL R735QTJ8XC9X\nAAPL XGFLXK3D247A|AAPL R735QTJ8XC9X\nAAPL XGFLX5XZLD9I|AAPL R735QTJ8XC9X\nAAPL XGFLXKBMQUO6|AAPL R735QTJ8XC9X\nAAPL XGFLX4IPZR46|AAPL R735QTJ8XC9X\nAAPL XGFLX5ZN4PRA|AAPL R735QTJ8XC9X\nAAPL XGFLX4IVY35Y|AAPL R735QTJ8XC9X\nAAPL XGFLX61AO292|AAPL R735QTJ8XC9X\nAAPL XGFLX4J1WF7Q|AAPL R735QTJ8XC9X\nAAPL XGFLX62Y7EQU|AAPL R735QTJ8XC9X\nAAPL XGFLX4J7UR9I|AAPL R735QTJ8XC9X\nAAPL XGFLX64LQR8M|AAPL R735QTJ8XC9X\nAAPL XG1TNTF0QJ2E|AAPL R735QTJ8XC9X\nAAPL XGFLX4JDT3BA|AAPL R735QTJ8XC9X\nAAPL XFA958T62EZQ|AAPL R735QTJ8XC9X\nAAPL XFO1EJXJ4Z8M|AAPL R735QTJ8XC9X\nAAPL XFTY344JLI7A|AAPL R735QTJ8XC9X\nAAPL XG1TNV1W7JHI|AAPL R735QTJ8XC9X\nAAPL XGFLX669A3QE|AAPL R735QTJ8XC9X\nAAPL 31FJM2LIB127A|AAPL R735QTJ8XC9X\nAAPL 31FJM2KGFOK1Y|AAPL R735QTJ8XC9X\nAAPL 31FJM2LJYKEP2|AAPL R735QTJ8XC9X\nAAPL 31FJM2KGLMW3Q|AAPL R735QTJ8XC9X\nAAPL 31FJM2LLM3R6U|AAPL R735QTJ8XC9X\nAAPL 31FJM2KGRL85I|AAPL R735QTJ8XC9X\nAAPL 31FJM2LN9N3OM|AAPL R735QTJ8XC9X\nAAPL 31FJM2KGXJK7A|AAPL R735QTJ8XC9X\nAAPL 31FJM2LOX6G6E|AAPL R735QTJ8XC9X\nAAPL 31FJM2KCMT02U|AAPL R735QTJ8XC9X\nAAPL 31FJM2Y8EU1TY|AAPL R735QTJ8XC9X\nAAPL 31FJM2LQKPSO6|AAPL R735QTJ8XC9X\nAAPL 31FJM2YGOISAU|AAPL R735QTJ8XC9X\nAAPL 31FJM2KH9G8AU|AAPL R735QTJ8XC9X\nAAPL 31FJM2YOY7IRQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2LS8955Y|AAPL R735QTJ8XC9X\nAAPL 31FJM2YX7W98M|AAPL R735QTJ8XC9X\nAAPL 31FJM2KHFEKCM|AAPL R735QTJ8XC9X\nAAPL 31FJM2Z5HKZPI|AAPL R735QTJ8XC9X\nAAPL 31FJM2LTVSHNQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2ZDR9Q6E|AAPL R735QTJ8XC9X\nAAPL 31FJM2KHLCWEE|AAPL R735QTJ8XC9X\nAAPL 31FJM2ZM0YGNA|AAPL R735QTJ8XC9X\nAAPL 31FJM2LVJBU5I|AAPL R735QTJ8XC9X\nAAPL 31FJM2ZUAN746|AAPL R735QTJ8XC9X\nAAPL 31FJM2KHRB8G6|AAPL R735QTJ8XC9X\nAAPL 31FJM302KBXL2|AAPL R735QTJ8XC9X\nAAPL 31FJM2LX6V6NA|AAPL R735QTJ8XC9X\nAAPL 31FJM30AU0O1Y|AAPL R735QTJ8XC9X\nAAPL 31FJM2KHX9KHY|AAPL R735QTJ8XC9X\nAAPL 31FJM2LYUEJ52|AAPL R735QTJ8XC9X\nAAPL 31FJM2KI37WJQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2M0HXVMU|AAPL R735QTJ8XC9X\nAAPL 31FJM2KI968LI|AAPL R735QTJ8XC9X\nAAPL 31FJM2M25H84M|AAPL R735QTJ8XC9X\nAAPL 31FJM2KIF4KNA|AAPL R735QTJ8XC9X\nAAPL 31FJM2M3T0KME|AAPL R735QTJ8XC9X\nAAPL 31F5TT9E80CG6|AAPL R735QTJ8XC9X\nAAPL 31FJM2KIL2WP2|AAPL R735QTJ8XC9X\nAAPL 31EE9AOSDC8DI|AAPL R735QTJ8XC9X\nAAPL 31ES1JZWQESME|AAPL R735QTJ8XC9X\nAAPL 31EXY8K3QVBL2|AAPL R735QTJ8XC9X\nAAPL 31F5TTB13HCVA|AAPL R735QTJ8XC9X\nAAPL 31FJM2M5GJX46|AAPL R735QTJ8XC9X\nAAPL XGFLX4GQJQIU|AAPL R735QTJ8XC9X\nAAPL XGFLX5FSOJTY|AAPL R735QTJ8XC9X\nAAPL XGFLX4GWI2KM|AAPL R735QTJ8XC9X\nAAPL XGFLX5HG7WBQ|AAPL R735QTJ8XC9X\nAAPL XGFLX4H2GEME|AAPL R735QTJ8XC9X\nAAPL 31FJM2KFXTJWM|AAPL R735QTJ8XC9X\nAAPL 31FJM2LEZYD7Q|AAPL R735QTJ8XC9X\nAAPL 31FJM2KG3RVYE|AAPL R735QTJ8XC9X\nAAPL 31FJM2LGNHPPI|AAPL R735QTJ8XC9X\nAAPL 31FJM2KG9Q806|AAPL R735QTJ8XC9X\nAAPL XGFLX4GKLEH2|AAPL R735QTJ8XC9X\nAAPL XGFLX5E557C6|AAPL R735QTJ8XC9X\nAAPL XH76FQPSLJ46|AAPL R735QTJ8XC9X\nAAPL XH76FRRTWDBA|AAPL R735QTJ8XC9X\nAAPL XH76FQPYJV5Y|AAPL R735QTJ8XC9X\nAAPL XH76FRTHFPT2|AAPL R735QTJ8XC9X\nAAPL XH76FQQ4I77Q|AAPL R735QTJ8XC9X\nAAPL XH76FRV4Z2AU|AAPL R735QTJ8XC9X\nAAPL XH76FQQAGJ9I|AAPL R735QTJ8XC9X\nAAPL XH76FRWSIESM|AAPL R735QTJ8XC9X\nAAPL XH76FQQGEVBA|AAPL R735QTJ8XC9X\nAAPL XH76FRYG1RAE|AAPL R735QTJ8XC9X\nAAPL XH76FQM5OB6U|AAPL R735QTJ8XC9X\nAAPL XH76FS03L3S6|AAPL R735QTJ8XC9X\nAAPL XH76FQQSBJEU|AAPL R735QTJ8XC9X\nAAPL XH76FS1R4G9Y|AAPL R735QTJ8XC9X\nAAPL XH76FQQY9VGM|AAPL R735QTJ8XC9X\nAAPL XH76FS3ENSRQ|AAPL R735QTJ8XC9X\nAAPL XH76FQR487IE|AAPL R735QTJ8XC9X\nAAPL XH76FS52759I|AAPL R735QTJ8XC9X\nAAPL XH76FQRA6JK6|AAPL R735QTJ8XC9X\nAAPL XH76FS6PQHRA|AAPL R735QTJ8XC9X\nAAPL XH76FQRG4VLY|AAPL R735QTJ8XC9X\nAAPL XH76FS8D9U92|AAPL R735QTJ8XC9X\nAAPL XH76FQRM37NQ|AAPL R735QTJ8XC9X\nAAPL XH76FSA0T6QU|AAPL R735QTJ8XC9X\nAAPL XH76FQRS1JPI|AAPL R735QTJ8XC9X\nAAPL XH76FSBOCJ8M|AAPL R735QTJ8XC9X\nAAPL XH76FQRXZVRA|AAPL R735QTJ8XC9X\nAAPL XH76FSDBVVQE|AAPL R735QTJ8XC9X\nAAPL XH76FQS3Y7T2|AAPL R735QTJ8XC9X\nAAPL XH76FSEZF886|AAPL R735QTJ8XC9X\nAAPL XFA9570I9U06|AAPL R735QTJ8XC9X\nAAPL XFO1EI4VCE92|AAPL R735QTJ8XC9X\nAAPL XFTY32BVSX7Q|AAPL R735QTJ8XC9X\nAAPL XG1TNT98EYHY|AAPL R735QTJ8XC9X\nAAPL XGFLX4DLHIQU|AAPL R735QTJ8XC9X\nAAPL XH76FQMBMN8M|AAPL R735QTJ8XC9X\nAAPL XIQBGZB7RTAE|AAPL R735QTJ8XC9X\nAAPL XJOS4944G7WM|AAPL R735QTJ8XC9X\nAAPL XKGCMVCULCEE|AAPL R735QTJ8XC9X\nAAPL XZDYPX30DA12|AAPL R735QTJ8XC9X\nAAPL Y1VKEFDDBXMU|AAPL R735QTJ8XC9X\nAAPL 31FJM2KFRV7UU|AAPL R735QTJ8XC9X\nAAPL 31FJM2LDCF0PY|AAPL R735QTJ8XC9X\nAAPL 31GB6L6OZVCHY|AAPL R735QTJ8XC9X\nAAPL 31GB6L7R166P2|AAPL R735QTJ8XC9X\nAAPL 31GB6L6P5TOJQ|AAPL R735QTJ8XC9X\nAAPL 31GB6L7SOPJ6U|AAPL R735QTJ8XC9X\nAAPL 31GB6L6PBS0LI|AAPL R735QTJ8XC9X\nAAPL 31GB6L7UC8VOM|AAPL R735QTJ8XC9X\nAAPL 31GB6L6PHQCNA|AAPL R735QTJ8XC9X\nAAPL 31GB6L7VZS86E|AAPL R735QTJ8XC9X\nAAPL 31GB6L6PNOOP2|AAPL R735QTJ8XC9X\nAAPL 31GB6L7XNBKO6|AAPL R735QTJ8XC9X\nAAPL 31GB6L6LCY4KM|AAPL R735QTJ8XC9X\nAAPL 31GB6L7ZAUX5Y|AAPL R735QTJ8XC9X\nAAPL 31GB6L6PZLCSM|AAPL R735QTJ8XC9X\nAAPL 31GB6L80YE9NQ|AAPL R735QTJ8XC9X\nAAPL 31GB6L6Q5JOUE|AAPL R735QTJ8XC9X\nAAPL 31GB6L82LXM5I|AAPL R735QTJ8XC9X\nAAPL 31GB6L6QBI0W6|AAPL R735QTJ8XC9X\nAAPL 31GB6L849GYNA|AAPL R735QTJ8XC9X\nAAPL 31GB6L6QHGCXY|AAPL R735QTJ8XC9X\nAAPL 31GB6L85X0B52|AAPL R735QTJ8XC9X\nAAPL 31GB6L6QNEOZQ|AAPL R735QTJ8XC9X\nAAPL 31GB6L87KJNMU|AAPL R735QTJ8XC9X\nAAPL 31GB6L6QTD11I|AAPL R735QTJ8XC9X\nAAPL 31GB6L898304M|AAPL R735QTJ8XC9X\nAAPL 31GB6L6QZBD3A|AAPL R735QTJ8XC9X\nAAPL 31GB6L8AVMCME|AAPL R735QTJ8XC9X\nAAPL 31GB6L6R59P52|AAPL R735QTJ8XC9X\nAAPL 31GB6L8CJ5P46|AAPL R735QTJ8XC9X\nAAPL 31GB6L6RB816U|AAPL R735QTJ8XC9X\nAAPL 31GB6L8E6P1LY|AAPL R735QTJ8XC9X\nAAPL 31EE9AMZPJNDY|AAPL R735QTJ8XC9X\nAAPL 31ES1JY42M7MU|AAPL R735QTJ8XC9X\nAAPL 31EXY8IB32QLI|AAPL R735QTJ8XC9X\nAAPL 31F5TT98FORVQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2KCSRC4M|AAPL R735QTJ8XC9X\nAAPL 31GB6L6LIWGME|AAPL R735QTJ8XC9X\nAAPL 31HUBMFAF1MO6|AAPL R735QTJ8XC9X\nAAPL 31ISS9P3BQ1AE|AAPL R735QTJ8XC9X\nAAPL 31JKCSBC1V5S6|AAPL R735QTJ8XC9X\nAAPL 31YHYVD27N3EU|AAPL R735QTJ8XC9X\nAAPL 320ZKJVCKLR0M|AAPL R735QTJ8XC9X\nAAPL XGFLX4G2QEBQ|AAPL R735QTJ8XC9X\nAAPL XGFLX596J5UU|AAPL R735QTJ8XC9X\nAAPL XGFLX4D9KUNA|AAPL R735QTJ8XC9X\nAAPL XGFLX5AU2ICM|AAPL R735QTJ8XC9X\nAAPL XGFLX4GEN2FA|AAPL R735QTJ8XC9X\nAAPL XGFLX5CHLUUE|AAPL R735QTJ8XC9X\nAAPL XH76FQPGOV0M|AAPL R735QTJ8XC9X\nAAPL XH76FROITOBQ|AAPL R735QTJ8XC9X\nAAPL XH76FQPMN72E|AAPL R735QTJ8XC9X\nAAPL XH76FRQ6D0TI|AAPL R735QTJ8XC9X\nAAPL XG1TNV3JQVZA|AAPL R735QTJ8XC9X\nAAPL XGFLX67WTG86|AAPL R735QTJ8XC9X\nAAPL XH76FSGMYKPY|AAPL R735QTJ8XC9X\nAAPL XH76FQSFUVWM|AAPL R735QTJ8XC9X\nAAPL 31FJM2KFA07PI|AAPL R735QTJ8XC9X\nAAPL 31FJM2L8DSZ8M|AAPL R735QTJ8XC9X\nAAPL 31FJM2KCGUO12|AAPL R735QTJ8XC9X\nAAPL 31FJM2LA1CBQE|AAPL R735QTJ8XC9X\nAAPL 31FJM2KFLWVT2|AAPL R735QTJ8XC9X\nAAPL 31FJM2LBOVO86|AAPL R735QTJ8XC9X\nAAPL 31GB6L6ONYOEE|AAPL R735QTJ8XC9X\nAAPL 31GB6L7NQ3HPI|AAPL R735QTJ8XC9X\nAAPL 31GB6L6OTX0G6|AAPL R735QTJ8XC9X\nAAPL 31GB6L7PDMU7A|AAPL R735QTJ8XC9X\nAAPL 31F5TTB2R0PD2|AAPL R735QTJ8XC9X\nAAPL 31FJM2M7439LY|AAPL R735QTJ8XC9X\nAAPL 31GB6L8FU8E3Q|AAPL R735QTJ8XC9X\nAAPL 31GB6L6RN4PAE|AAPL R735QTJ8XC9X\nAAPL XGFLX4FQTQ86|AAPL R735QTJ8XC9X\nAAPL XGFLX55VGGVA|AAPL R735QTJ8XC9X\nAAPL XGFLX4FWS29Y|AAPL R735QTJ8XC9X\nAAPL XGFLX57IZTD2|AAPL R735QTJ8XC9X\nAAPL XH76FRHWOACM|AAPL R735QTJ8XC9X\nAAPL XH76FQLZPZ52|AAPL R735QTJ8XC9X\nAAPL XH76FRJK7MUE|AAPL R735QTJ8XC9X\nAAPL XH76FQP4S6X2|AAPL R735QTJ8XC9X\nAAPL XH76FRL7QZC6|AAPL R735QTJ8XC9X\nAAPL XH76FQPAQIYU|AAPL R735QTJ8XC9X\nAAPL XH76FRMVABTY|AAPL R735QTJ8XC9X\nAAPL XFA958UTLRHI|AAPL R735QTJ8XC9X\nAAPL XFO1EJZ6OBQE|AAPL R735QTJ8XC9X\nAAPL XFTY34674UP2|AAPL R735QTJ8XC9X\nAAPL XG1TNTFCN75Y|AAPL R735QTJ8XC9X\nAAPL XGFLX4JPPREU|AAPL R735QTJ8XC9X\nAAPL XH76FSIAHX7Q|AAPL R735QTJ8XC9X\nAAPL XH76FQSLT7YE|AAPL R735QTJ8XC9X\nAAPL XG8PSIVZYWKM|AAPL R735QTJ8XC9X\nAAPL XIQBGZ3XV89Y|AAPL R735QTJ8XC9X\nAAPL XJOS48WUJMW6|AAPL R735QTJ8XC9X\nAAPL XKGCMV5KORDY|AAPL R735QTJ8XC9X\nAAPL XZDYPWVQGP0M|AAPL R735QTJ8XC9X\nAAPL 31FJM2KEY3JLY|AAPL R735QTJ8XC9X\nAAPL 31FJM2L52QA92|AAPL R735QTJ8XC9X\nAAPL 31FJM2KF41VNQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2L6Q9MQU|AAPL R735QTJ8XC9X\nAAPL 31GB6L7H3Y3QE|AAPL R735QTJ8XC9X\nAAPL 31GB6L6L6ZSIU|AAPL R735QTJ8XC9X\nAAPL 31GB6L7IRHG86|AAPL R735QTJ8XC9X\nAAPL 31GB6L6OC20AU|AAPL R735QTJ8XC9X\nAAPL 31GB6L7KF0SPY|AAPL R735QTJ8XC9X\nAAPL 31GB6L6OI0CCM|AAPL R735QTJ8XC9X\nAAPL 31GB6L7M2K57Q|AAPL R735QTJ8XC9X\nAAPL 31EE9AOU0VKVA|AAPL R735QTJ8XC9X\nAAPL 31ES1JZYDY546|AAPL R735QTJ8XC9X\nAAPL 31EXY8K5EEO2U|AAPL R735QTJ8XC9X\nAAPL 31F5TT9EJX0JQ|AAPL R735QTJ8XC9X\nAAPL 31FJM2KIWZKSM|AAPL R735QTJ8XC9X\nAAPL 31GB6L8HHRQLI|AAPL R735QTJ8XC9X\nAAPL 31GB6L6RT31C6|AAPL R735QTJ8XC9X\nAAPL 31FCPXYV78PYE|AAPL R735QTJ8XC9X\nAAPL 31HUBMF3551NQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9OW1TG9Y|AAPL R735QTJ8XC9X\nAAPL 31JKCSB4RYKRQ|AAPL R735QTJ8XC9X\nAAPL 31YHYVCUXQIEE|AAPL R735QTJ8XC9X\nAAPL XGMI1T88WKFA|AAPL R735QTJ8XC9X\nAAPL XGMI1S1WT0XY|AAPL R735QTJ8XC9X\nAAPL XGMI1T9WFWX2|AAPL R735QTJ8XC9X\nAAPL XGMI1RXM2GTI|AAPL R735QTJ8XC9X\nAAPL XGMI1TBJZ9EU|AAPL R735QTJ8XC9X\nAAPL XGMI1S28PP1I|AAPL R735QTJ8XC9X\nAAPL XGMI1TD7ILWM|AAPL R735QTJ8XC9X\nAAPL XGMI1S2EO13A|AAPL R735QTJ8XC9X\nAAPL XGMI1TEV1YEE|AAPL R735QTJ8XC9X\nAAPL XGMI26YQJ6X2|AAPL R735QTJ8XC9X\nAAPL XGMI1S2KMD52|AAPL R735QTJ8XC9X\nAAPL XGMI27707XDY|AAPL R735QTJ8XC9X\nAAPL XGMI1TGILAW6|AAPL R735QTJ8XC9X\nAAPL XGMI27F9WNUU|AAPL R735QTJ8XC9X\nAAPL XGMI1S2QKP6U|AAPL R735QTJ8XC9X\nAAPL XGMI27NJLEBQ|AAPL R735QTJ8XC9X\nAAPL XGMI1TI64NDY|AAPL R735QTJ8XC9X\nAAPL XGMI27VTA4SM|AAPL R735QTJ8XC9X\nAAPL XGMI1S2WJ18M|AAPL R735QTJ8XC9X\nAAPL XFA95N6T7WEE|AAPL R735QTJ8XC9X\nAAPL XFH5AAQZR6IU|AAPL R735QTJ8XC9X\nAAPL XFO1EYB6AGNA|AAPL R735QTJ8XC9X\nAAPL XFTY3II6QZLY|AAPL R735QTJ8XC9X\nAAPL XG1TO9FJD0W6|AAPL R735QTJ8XC9X\nAAPL XGFLXKJWFL52|AAPL R735QTJ8XC9X\nAAPL XGMI2842YV9I|AAPL R735QTJ8XC9X\nAAPL XGMI1TJTNZVQ|AAPL R735QTJ8XC9X\nAAPL XFA95NF2WMVA|AAPL R735QTJ8XC9X\nAAPL XFH5AAZ9FWZQ|AAPL R735QTJ8XC9X\nAAPL XFO1EYJFZ746|AAPL R735QTJ8XC9X\nAAPL XFTY3IQGFQ2U|AAPL R735QTJ8XC9X\nAAPL XG1TO9NT1RD2|AAPL R735QTJ8XC9X\nAAPL XGFLXKS64BLY|AAPL R735QTJ8XC9X\nAAPL XGMI28CCNLQE|AAPL R735QTJ8XC9X\nAAPL XGMI1S32HDAE|AAPL R735QTJ8XC9X\nAAPL XFA95NNCLDC6|AAPL R735QTJ8XC9X\nAAPL XFH5AB7J4NGM|AAPL R735QTJ8XC9X\nAAPL XFO1EYRPNXL2|AAPL R735QTJ8XC9X\nAAPL XFTY3IYQ4GJQ|AAPL R735QTJ8XC9X\nAAPL XG1TO9W2QHTY|AAPL R735QTJ8XC9X\nAAPL XGFLXL0FT22U|AAPL R735QTJ8XC9X\nAAPL XGMI28KMCC7A|AAPL R735QTJ8XC9X\nAAPL XGMI1TLH7CDI|AAPL R735QTJ8XC9X\nAAPL XFH5ABFSTDXI|AAPL R735QTJ8XC9X\nAAPL XFO1EYZZCO1Y|AAPL R735QTJ8XC9X\nAAPL XFTY3J6ZT70M|AAPL R735QTJ8XC9X\nAAPL XG1TOA4CF8AU|AAPL R735QTJ8XC9X\nAAPL XGFLXL8PHSJQ|AAPL R735QTJ8XC9X\nAAPL XGMI28SW12O6|AAPL R735QTJ8XC9X\nAAPL XGMI1S38FPC6|AAPL R735QTJ8XC9X\nAAPL XFH5ABO2I4EE|AAPL R735QTJ8XC9X\nAAPL XFO1EZ891EIU|AAPL R735QTJ8XC9X\nAAPL XFTY3JF9HXHI|AAPL R735QTJ8XC9X\nAAPL XG1TOACM3YRQ|AAPL R735QTJ8XC9X\nAAPL XGFLXLGZ6J0M|AAPL R735QTJ8XC9X\nAAPL XGMI2915PT52|AAPL R735QTJ8XC9X\nAAPL XGMI1TN4QOVA|AAPL R735QTJ8XC9X\nAAPL XGMI1S3EE1DY|AAPL R735QTJ8XC9X\nAAPL XGMI1TOSA1D2|AAPL R735QTJ8XC9X\nAAPL XGMI1S3KCDFQ|AAPL R735QTJ8XC9X\nAAPL XGMI1TQFTDUU|AAPL R735QTJ8XC9X\nAAPL XGMI1RXS0SVA|AAPL R735QTJ8XC9X\nAAPL XGMI1TS3CQCM|AAPL R735QTJ8XC9X\nAAPL XFO1EIAZKMX2|AAPL R735QTJ8XC9X\nAAPL XFTY32I015VQ|AAPL R735QTJ8XC9X\nAAPL XGMI1S3W91JA|AAPL R735QTJ8XC9X\nAAPL XFO1EK0U7O86|AAPL R735QTJ8XC9X\nAAPL XFTY347UO76U|AAPL R735QTJ8XC9X\nAAPL XG1TNV57A8H2|AAPL R735QTJ8XC9X\nAAPL XGFLX69KCSPY|AAPL R735QTJ8XC9X\nAAPL XGMI1TTQW2UE|AAPL R735QTJ8XC9X\nAAPL XFO1EIB5IYYU|AAPL R735QTJ8XC9X\nAAPL XFTY32I5ZHXI|AAPL R735QTJ8XC9X\nAAPL XG1TNTFILJ7Q|AAPL R735QTJ8XC9X\nAAPL XGFLX4JVO3GM|AAPL R735QTJ8XC9X\nAAPL XGMI1S427DL2|AAPL R735QTJ8XC9X\nAAPL XFO1EK2HR0PY|AAPL R735QTJ8XC9X\nAAPL XFTY349I7JOM|AAPL R735QTJ8XC9X\nAAPL XG1TNV6UTKYU|AAPL R735QTJ8XC9X\nAAPL XGFLX6B7W57Q|AAPL R735QTJ8XC9X\nAAPL XGMI1TVEFFC6|AAPL R735QTJ8XC9X\nAAPL 31FQI797G6DT2|AAPL R735QTJ8XC9X\nAAPL 31FQI78142UBQ|AAPL R735QTJ8XC9X\nAAPL 31FQI7993PQAU|AAPL R735QTJ8XC9X\nAAPL 31FQI77WTCA7A|AAPL R735QTJ8XC9X\nAAPL 31FQI79AR92SM|AAPL R735QTJ8XC9X\nAAPL 31FQI781FZIFA|AAPL R735QTJ8XC9X\nAAPL 31FQI79CESFAE|AAPL R735QTJ8XC9X\nAAPL 31FQI781LXUH2|AAPL R735QTJ8XC9X\nAAPL 31FQI79E2BRS6|AAPL R735QTJ8XC9X\nAAPL 31FQI7MXXT0AU|AAPL R735QTJ8XC9X\nAAPL 31FQI781RW6IU|AAPL R735QTJ8XC9X\nAAPL 31FQI7N67HQRQ|AAPL R735QTJ8XC9X\nAAPL 31FQI79FPV49Y|AAPL R735QTJ8XC9X\nAAPL 31FQI7NEH6H8M|AAPL R735QTJ8XC9X\nAAPL 31FQI781XUIKM|AAPL R735QTJ8XC9X\nAAPL 31FQI7NMQV7PI|AAPL R735QTJ8XC9X\nAAPL 31FQI79HDEGRQ|AAPL R735QTJ8XC9X\nAAPL 31FQI7NV0JY6E|AAPL R735QTJ8XC9X\nAAPL 31FQI7823SUME|AAPL R735QTJ8XC9X\nAAPL 31EE9B360HPS6|AAPL R735QTJ8XC9X\nAAPL 31EL5FQQ70ZWM|AAPL R735QTJ8XC9X\nAAPL 31ES1KEADKA12|AAPL R735QTJ8XC9X\nAAPL 31EXY8YHE0SZQ|AAPL R735QTJ8XC9X\nAAPL 31F5TTPEQMU9Y|AAPL R735QTJ8XC9X\nAAPL 31FJM30J3PEIU|AAPL R735QTJ8XC9X\nAAPL 31FQI7O3A8ONA|AAPL R735QTJ8XC9X\nAAPL 31FQI79J0XT9I|AAPL R735QTJ8XC9X\nAAPL 31EE9B3EA6G92|AAPL R735QTJ8XC9X\nAAPL 31EL5FQYGPQDI|AAPL R735QTJ8XC9X\nAAPL 31ES1KEIN90HY|AAPL R735QTJ8XC9X\nAAPL 31EXY8YPNPJGM|AAPL R735QTJ8XC9X\nAAPL 31F5TTPN0BKQU|AAPL R735QTJ8XC9X\nAAPL 31FJM30RDE4ZQ|AAPL R735QTJ8XC9X\nAAPL 31FQI7OBJXF46|AAPL R735QTJ8XC9X\nAAPL 31FQI7829R6O6|AAPL R735QTJ8XC9X\nAAPL 31EE9B3MJV6PY|AAPL R735QTJ8XC9X\nAAPL 31EL5FR6QEGUE|AAPL R735QTJ8XC9X\nAAPL 31ES1KEQWXQYU|AAPL R735QTJ8XC9X\nAAPL 31EXY8YXXE9XI|AAPL R735QTJ8XC9X\nAAPL 31F5TTPVA0B7Q|AAPL R735QTJ8XC9X\nAAPL 31FJM30ZN2VGM|AAPL R735QTJ8XC9X\nAAPL 31FQI7OJTM5L2|AAPL R735QTJ8XC9X\nAAPL 31FQI79KOH5RA|AAPL R735QTJ8XC9X\nAAPL 31EL5FRF037BA|AAPL R735QTJ8XC9X\nAAPL 31ES1KEZ6MHFQ|AAPL R735QTJ8XC9X\nAAPL 31EXY8Z6730EE|AAPL R735QTJ8XC9X\nAAPL 31F5TTQ3JP1OM|AAPL R735QTJ8XC9X\nAAPL 31FJM317WRLXI|AAPL R735QTJ8XC9X\nAAPL 31FQI7OS3AW1Y|AAPL R735QTJ8XC9X\nAAPL 31FQI782FPIPY|AAPL R735QTJ8XC9X\nAAPL 31EL5FRN9RXS6|AAPL R735QTJ8XC9X\nAAPL 31ES1KF7GB7WM|AAPL R735QTJ8XC9X\nAAPL 31EXY8ZEGRQVA|AAPL R735QTJ8XC9X\nAAPL 31F5TTQBTDS5I|AAPL R735QTJ8XC9X\nAAPL 31FJM31G6GCEE|AAPL R735QTJ8XC9X\nAAPL 31FQI7P0CZMIU|AAPL R735QTJ8XC9X\nAAPL 31FQI79MC0I92|AAPL R735QTJ8XC9X\nAAPL 31FQI782LNURQ|AAPL R735QTJ8XC9X\nAAPL 31FQI79NZJUQU|AAPL R735QTJ8XC9X\nAAPL 31FQI782RM6TI|AAPL R735QTJ8XC9X\nAAPL 31FQI79PN378M|AAPL R735QTJ8XC9X\nAAPL 31FQI77WZAM92|AAPL R735QTJ8XC9X\nAAPL 31FQI79RAMJQE|AAPL R735QTJ8XC9X\nAAPL 31ES1JYA6UGAU|AAPL R735QTJ8XC9X\nAAPL 31EXY8IH7AZ9I|AAPL R735QTJ8XC9X\nAAPL 31FQI7833IUX2|AAPL R735QTJ8XC9X\nAAPL 31ES1K001HHLY|AAPL R735QTJ8XC9X\nAAPL 31EXY8K71Y0KM|AAPL R735QTJ8XC9X\nAAPL 31F5TTB4EK1UU|AAPL R735QTJ8XC9X\nAAPL 31FJM2M8RMM3Q|AAPL R735QTJ8XC9X\nAAPL 31FQI79SY5W86|AAPL R735QTJ8XC9X\nAAPL 31ES1JYACSSCM|AAPL R735QTJ8XC9X\nAAPL 31EXY8IHD9BBA|AAPL R735QTJ8XC9X\nAAPL 31F5TT9EPVCLI|AAPL R735QTJ8XC9X\nAAPL 31FJM2KJ2XWUE|AAPL R735QTJ8XC9X\nAAPL 31FQI7839H6YU|AAPL R735QTJ8XC9X\nAAPL 31ES1K01P0U3Q|AAPL R735QTJ8XC9X\nAAPL 31EXY8K8PHD2E|AAPL R735QTJ8XC9X\nAAPL 31F5TTB623ECM|AAPL R735QTJ8XC9X\nAAPL 31FJM2MAF5YLI|AAPL R735QTJ8XC9X\nAAPL 31FQI79ULP8PY|AAPL R735QTJ8XC9X\nAAPL XH76FQOMX6RQ|AAPL R735QTJ8XC9X\nAAPL XH76FRG94XUU|AAPL R735QTJ8XC9X\nAAPL XH76FQOSVITI|AAPL R735QTJ8XC9X\nAAPL XGMI1S131CP2|AAPL R735QTJ8XC9X\nAAPL XGMI1T1MR6G6|AAPL R735QTJ8XC9X\nAAPL XGMI1S18ZOQU|AAPL R735QTJ8XC9X\nAAPL XGMI1T3AAIXY|AAPL R735QTJ8XC9X\nAAPL XGMI1S1EY0SM|AAPL R735QTJ8XC9X\nAAPL XGMI1T4XTVFQ|AAPL R735QTJ8XC9X\nAAPL XGMI1S1KWCUE|AAPL R735QTJ8XC9X\nAAPL XGMI1T6LD7XI|AAPL R735QTJ8XC9X\nAAPL XGMI1S1QUOW6|AAPL R735QTJ8XC9X\nAAPL XFH59WGNOE3Q|AAPL R735QTJ8XC9X\nAAPL XH76FSJY19PI|AAPL R735QTJ8XC9X\nAAPL XFO1EIBBHB0M|AAPL R735QTJ8XC9X\nAAPL XFTY32IBXTZA|AAPL R735QTJ8XC9X\nAAPL XG1TNTFOJV9I|AAPL R735QTJ8XC9X\nAAPL XGFLX4K1MFIE|AAPL R735QTJ8XC9X\nAAPL XGMI1S485PMU|AAPL R735QTJ8XC9X\nAAPL XH76FQSRRK06|AAPL R735QTJ8XC9X\nAAPL XFO1EK45AD7Q|AAPL R735QTJ8XC9X\nAAPL XH76FSLLKM7A|AAPL R735QTJ8XC9X\nAAPL XG8PSIXNI92E|AAPL R735QTJ8XC9X\nAAPL XG8PSIZB1LK6|AAPL R735QTJ8XC9X\nAAPL XG8PSJ0YKY1Y|AAPL R735QTJ8XC9X\nAAPL XG8PSJ2M4AJQ|AAPL R735QTJ8XC9X\nAAPL XG8PSJ49NN1I|AAPL R735QTJ8XC9X\nAAPL XG8PSH16PTS6|AAPL R735QTJ8XC9X\nAAPL XG8PSJ5X6ZJA|AAPL R735QTJ8XC9X\nAAPL XG8PSH1CO5TY|AAPL R735QTJ8XC9X\nAAPL XL7X5HM2LH1I|AAPL R735QTJ8XC9X\nAAPL XPFJZVY2DNRA|AAPL R735QTJ8XC9X\nAAPL XRX5OE8FCBD2|AAPL R735QTJ8XC9X\nAAPL XZDYPX3I8A6E|AAPL R735QTJ8XC9X\nAAPL Y1VKEFDV6XS6|AAPL R735QTJ8XC9X\nAAPL 31GB6L6NU705I|AAPL R735QTJ8XC9X\nAAPL 31GB6L7FGER8M|AAPL R735QTJ8XC9X\nAAPL 31GB6L6O05C7A|AAPL R735QTJ8XC9X\nAAPL 31FQI780AB62U|AAPL R735QTJ8XC9X\nAAPL 31FQI790U0ZTY|AAPL R735QTJ8XC9X\nAAPL 31FQI780G9I4M|AAPL R735QTJ8XC9X\nAAPL 31FQI792HKCBQ|AAPL R735QTJ8XC9X\nAAPL 31FQI780M7U6E|AAPL R735QTJ8XC9X\nAAPL 31FQI79453OTI|AAPL R735QTJ8XC9X\nAAPL 31FQI780S6686|AAPL R735QTJ8XC9X\nAAPL 31FQI795SN1BA|AAPL R735QTJ8XC9X\nAAPL 31FQI780Y4I9Y|AAPL R735QTJ8XC9X\nAAPL 31EL5FCFUY7HI|AAPL R735QTJ8XC9X\nAAPL 31GB6L8J5B33A|AAPL R735QTJ8XC9X\nAAPL 31ES1JYAIR4EE|AAPL R735QTJ8XC9X\nAAPL 31EXY8IHJ7ND2|AAPL R735QTJ8XC9X\nAAPL 31F5TT9EVTONA|AAPL R735QTJ8XC9X\nAAPL 31FJM2KJ8W8W6|AAPL R735QTJ8XC9X\nAAPL 31FQI783FFJ0M|AAPL R735QTJ8XC9X\nAAPL 31GB6L6RZ1DDY|AAPL R735QTJ8XC9X\nAAPL 31ES1K03CK6LI|AAPL R735QTJ8XC9X\nAAPL 31GB6L8KSUFL2|AAPL R735QTJ8XC9X\nAAPL 31FCPXYWUS2G6|AAPL R735QTJ8XC9X\nAAPL 31FCPXYYIBEXY|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ05URFQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ1TE3XI|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ3GXGFA|AAPL R735QTJ8XC9X\nAAPL 31FCPXX0DZN5Y|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ54GSX2|AAPL R735QTJ8XC9X\nAAPL 31FCPXX0JXZ7Q|AAPL R735QTJ8XC9X\nAAPL 31KBXAXL9VAFA|AAPL R735QTJ8XC9X\nAAPL 31OJK5BX9NH52|AAPL R735QTJ8XC9X\nAAPL 31R15TU7MM4QU|AAPL R735QTJ8XC9X\nAAPL 31YHYVD2PI3K6|AAPL R735QTJ8XC9X\nAAPL 320ZKJVD2GR5Y|AAPL R735QTJ8XC9X\nAAPL XH76FRELLLD2|AAPL R735QTJ8XC9X\nAAPL XGMI1RXG44RQ|AAPL R735QTJ8XC9X\nAAPL XGMI1SV0LSH2|AAPL R735QTJ8XC9X\nAAPL XGMI1S0L6CJQ|AAPL R735QTJ8XC9X\nAAPL XGMI1SWO54YU|AAPL R735QTJ8XC9X\nAAPL XGMI1S0R4OLI|AAPL R735QTJ8XC9X\nAAPL XGMI1SYBOHGM|AAPL R735QTJ8XC9X\nAAPL XGMI1S0X30NA|AAPL R735QTJ8XC9X\nAAPL XGMI1SZZ7TYE|AAPL R735QTJ8XC9X\nAAPL XFTY34B5QW6E|AAPL R735QTJ8XC9X\nAAPL XG1TNV8ICXGM|AAPL R735QTJ8XC9X\nAAPL XGFLX6CVFHPI|AAPL R735QTJ8XC9X\nAAPL XGMI1TX1YRTY|AAPL R735QTJ8XC9X\nAAPL XH76FQSXPW1Y|AAPL R735QTJ8XC9X\nAAPL XH76FSN93YP2|AAPL R735QTJ8XC9X\nAAPL 31GB6L7DSVEQU|AAPL R735QTJ8XC9X\nAAPL 31FQI77WNDY5I|AAPL R735QTJ8XC9X\nAAPL 31FQI78U7VLUU|AAPL R735QTJ8XC9X\nAAPL 31FQI77ZSG5XI|AAPL R735QTJ8XC9X\nAAPL 31FQI78VVEYCM|AAPL R735QTJ8XC9X\nAAPL 31FQI77ZYEHZA|AAPL R735QTJ8XC9X\nAAPL 31FQI78XIYAUE|AAPL R735QTJ8XC9X\nAAPL 31FQI7804CU12|AAPL R735QTJ8XC9X\nAAPL 31FQI78Z6HNC6|AAPL R735QTJ8XC9X\nAAPL 31EXY8KAD0PK6|AAPL R735QTJ8XC9X\nAAPL 31F5TTB7PMQUE|AAPL R735QTJ8XC9X\nAAPL 31FJM2MC2PB3A|AAPL R735QTJ8XC9X\nAAPL 31FQI79W98L7Q|AAPL R735QTJ8XC9X\nAAPL 31GB6L6S4ZPFQ|AAPL R735QTJ8XC9X\nAAPL 31GB6L8MGDS2U|AAPL R735QTJ8XC9X\nAAPL XGMI1RZXD0CM|AAPL R735QTJ8XC9X\nAAPL XH76FQOGYUPY|AAPL R735QTJ8XC9X\nAAPL XGMI1SQ1ZQZQ|AAPL R735QTJ8XC9X\nAAPL XGMI1S03BCEE|AAPL R735QTJ8XC9X\nAAPL XGMI1SRPJ3HI|AAPL R735QTJ8XC9X\nAAPL XGMI1S099OG6|AAPL R735QTJ8XC9X\nAAPL XGMI1STD2FZA|AAPL R735QTJ8XC9X\nAAPL XG1TNTFUI7BA|AAPL R735QTJ8XC9X\nAAPL XGFLX4K7KRK6|AAPL R735QTJ8XC9X\nAAPL XGMI1S4E41OM|AAPL R735QTJ8XC9X\nAAPL XH76FQT3O83Q|AAPL R735QTJ8XC9X\nAAPL XH76FSOWNB6U|AAPL R735QTJ8XC9X\nAAPL 31FQI77Z4MTQE|AAPL R735QTJ8XC9X\nAAPL 31GB6L6NO8O3Q|AAPL R735QTJ8XC9X\nAAPL 31FQI78P99KDI|AAPL R735QTJ8XC9X\nAAPL 31FQI77ZAL5S6|AAPL R735QTJ8XC9X\nAAPL 31FQI78QWSWVA|AAPL R735QTJ8XC9X\nAAPL 31FQI77ZGJHTY|AAPL R735QTJ8XC9X\nAAPL 31FQI78SKC9D2|AAPL R735QTJ8XC9X\nAAPL 31F5TT9F1S0P2|AAPL R735QTJ8XC9X\nAAPL 31FJM2KJEUKXY|AAPL R735QTJ8XC9X\nAAPL 31FQI783LDV2E|AAPL R735QTJ8XC9X\nAAPL 31GB6L6SAY1HI|AAPL R735QTJ8XC9X\nAAPL 31GB6L8O3X4KM|AAPL R735QTJ8XC9X\nAAPL XFTY32IHW612|AAPL R735QTJ8XC9X\nAAPL XFTY34CTA8O6|AAPL R735QTJ8XC9X\nAAPL XG1TNVA5W9YE|AAPL R735QTJ8XC9X\nAAPL XGFLX6EIYU7A|AAPL R735QTJ8XC9X\nAAPL XGMI1TYPI4BQ|AAPL R735QTJ8XC9X\nAAPL XH76FQT9MK5I|AAPL R735QTJ8XC9X\nAAPL XH76FSQK6NOM|AAPL R735QTJ8XC9X\nAAPL XKGCMVDCGCJQ|AAPL R735QTJ8XC9X\nAAPL XG8PSJ7KQC12|AAPL R735QTJ8XC9X\nAAPL 31EXY8IHP5ZEU|AAPL R735QTJ8XC9X\nAAPL 31EXY8KC0K21Y|AAPL R735QTJ8XC9X\nAAPL 31F5TTB9D63C6|AAPL R735QTJ8XC9X\nAAPL 31FJM2MDQ8NL2|AAPL R735QTJ8XC9X\nAAPL 31FQI79XWRXPI|AAPL R735QTJ8XC9X\nAAPL 31GB6L6SGWDJA|AAPL R735QTJ8XC9X\nAAPL 31GB6L8PRGH2E|AAPL R735QTJ8XC9X\nAAPL 31JKCSBCJQ5XI|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ6S05EU|AAPL R735QTJ8XC9X\nAAPL XG8PSW2N5D52|AAPL R735QTJ8XC9X\nAAPL XG8PSWAWU3LY|AAPL R735QTJ8XC9X\nAAPL XG8PSWJ6IU2U|AAPL R735QTJ8XC9X\nAAPL XG8PSWRG7KJQ|AAPL R735QTJ8XC9X\nAAPL XG8PSWZPWB0M|AAPL R735QTJ8XC9X\nAAPL XG8PSX7ZL1HI|AAPL R735QTJ8XC9X\nAAPL XG8PSXG99RYE|AAPL R735QTJ8XC9X\nAAPL XG8PSXOIYIFA|AAPL R735QTJ8XC9X\nAAPL XG8PSXWSN8W6|AAPL R735QTJ8XC9X\nAAPL 31FCPYC1UF6IU|AAPL R735QTJ8XC9X\nAAPL 31FCPYCA43WZQ|AAPL R735QTJ8XC9X\nAAPL 31FCPYCIDSNGM|AAPL R735QTJ8XC9X\nAAPL 31FCPYCQNHDXI|AAPL R735QTJ8XC9X\nAAPL 31FCPYCYX64EE|AAPL R735QTJ8XC9X\nAAPL 31FCPYD76UUVA|AAPL R735QTJ8XC9X\nAAPL 31FCPYDFGJLC6|AAPL R735QTJ8XC9X\nAAPL 31FCPYDNQ8BT2|AAPL R735QTJ8XC9X\nAAPL 31FCPYDVZX29Y|AAPL R735QTJ8XC9X\nAAPL XHYQYDYWI5BA|AAPL R735QTJ8XC9X\nAAPL XHYQYE0K1HT2|AAPL R735QTJ8XC9X\nAAPL XHYQYE27KUAU|AAPL R735QTJ8XC9X\nAAPL XHYQYE3V46SM|AAPL R735QTJ8XC9X\nAAPL XHYQYE5INJAE|AAPL R735QTJ8XC9X\nAAPL XHYQYE766VS6|AAPL R735QTJ8XC9X\nAAPL XHYQYEH3EYQU|AAPL R735QTJ8XC9X\nAAPL XHYQYEIQYB8M|AAPL R735QTJ8XC9X\nAAPL XHYQYEKEHNQE|AAPL R735QTJ8XC9X\nAAPL XFO1EZGIQ4ZQ|AAPL R735QTJ8XC9X\nAAPL XFTY3JNJ6NYE|AAPL R735QTJ8XC9X\nAAPL XG1TOAKVSP8M|AAPL R735QTJ8XC9X\nAAPL XG8PSY52BZD2|AAPL R735QTJ8XC9X\nAAPL XGFLXLP8V9HI|AAPL R735QTJ8XC9X\nAAPL XGMI299FEJLY|AAPL R735QTJ8XC9X\nAAPL XFO1EZOSEVGM|AAPL R735QTJ8XC9X\nAAPL XFTY3JVSVEFA|AAPL R735QTJ8XC9X\nAAPL XG1TOAT5HFPI|AAPL R735QTJ8XC9X\nAAPL XG8PSYDC0PTY|AAPL R735QTJ8XC9X\nAAPL XGFLXLXIJZYE|AAPL R735QTJ8XC9X\nAAPL XGMI29HP3A2U|AAPL R735QTJ8XC9X\nAAPL XHYQYEM21086|AAPL R735QTJ8XC9X\nAAPL XHYQYENPKCPY|AAPL R735QTJ8XC9X\nAAPL XHYQYEPD3P7Q|AAPL R735QTJ8XC9X\nAAPL XHYQYER0N1PI|AAPL R735QTJ8XC9X\nAAPL XHYQYESO6E7A|AAPL R735QTJ8XC9X\nAAPL XHYQYEUBPQP2|AAPL R735QTJ8XC9X\nAAPL XHYQYEVZ936U|AAPL R735QTJ8XC9X\nAAPL XG1TNTG0GJD2|AAPL R735QTJ8XC9X\nAAPL XGFLX4KDJ3LY|AAPL R735QTJ8XC9X\nAAPL XGMI1S4K2DQE|AAPL R735QTJ8XC9X\nAAPL XHYQYEXMSFOM|AAPL R735QTJ8XC9X\nAAPL XHYQYEZABS6E|AAPL R735QTJ8XC9X\nAAPL XH76FQTFKW7A|AAPL R735QTJ8XC9X\nAAPL XH76FSS7Q06E|AAPL R735QTJ8XC9X\nAAPL XHYQYF0XV4O6|AAPL R735QTJ8XC9X\nAAPL XHYQYF2LEH5Y|AAPL R735QTJ8XC9X\nAAPL XHYQYF48XTNQ|AAPL R735QTJ8XC9X\nAAPL XHYQYF5WH65I|AAPL R735QTJ8XC9X\nAAPL XHYQYD2TJCW6|AAPL R735QTJ8XC9X\nAAPL XKGCMVDOD0NA|AAPL R735QTJ8XC9X\nAAPL XL7X5HMEI552|AAPL R735QTJ8XC9X\nAAPL XPFJZVYEABUU|AAPL R735QTJ8XC9X\nAAPL XRX5OE8R8ZGM|AAPL R735QTJ8XC9X\nAAPL XVD806C0W1OM|AAPL R735QTJ8XC9X\nAAPL XZDYPX3U4Y9Y|AAPL R735QTJ8XC9X\nAAPL Y1VKEFE73LVQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3TY3RYP2|AAPL R735QTJ8XC9X\nAAPL 31H2R3TZRBB6U|AAPL R735QTJ8XC9X\nAAPL 31H2R3U1EUNOM|AAPL R735QTJ8XC9X\nAAPL 31H2R3U32E06E|AAPL R735QTJ8XC9X\nAAPL 31H2R3U4PXCO6|AAPL R735QTJ8XC9X\nAAPL 31H2R3U6DGP5Y|AAPL R735QTJ8XC9X\nAAPL 31H2R3UGAOS4M|AAPL R735QTJ8XC9X\nAAPL 31H2R3UHY84ME|AAPL R735QTJ8XC9X\nAAPL 31H2R3UJLRH46|AAPL R735QTJ8XC9X\nAAPL 31ES1KFFPZYDI|AAPL R735QTJ8XC9X\nAAPL 31EXY8ZMQGHC6|AAPL R735QTJ8XC9X\nAAPL 31F5TTQK32IME|AAPL R735QTJ8XC9X\nAAPL 31FCPYE49LSQU|AAPL R735QTJ8XC9X\nAAPL 31FJM31OG52VA|AAPL R735QTJ8XC9X\nAAPL 31FQI7P8MOCZQ|AAPL R735QTJ8XC9X\nAAPL 31ES1KFNZOOUE|AAPL R735QTJ8XC9X\nAAPL 31EXY8ZV057T2|AAPL R735QTJ8XC9X\nAAPL 31F5TTQSCR93A|AAPL R735QTJ8XC9X\nAAPL 31FCPYECJAJ7Q|AAPL R735QTJ8XC9X\nAAPL 31FJM31WPTTC6|AAPL R735QTJ8XC9X\nAAPL 31FQI7PGWD3GM|AAPL R735QTJ8XC9X\nAAPL 31H2R3UL9ATLY|AAPL R735QTJ8XC9X\nAAPL 31H2R3UMWU63Q|AAPL R735QTJ8XC9X\nAAPL 31H2R3UOKDILI|AAPL R735QTJ8XC9X\nAAPL 31H2R3UQ7WV3A|AAPL R735QTJ8XC9X\nAAPL 31H2R3URVG7L2|AAPL R735QTJ8XC9X\nAAPL 31H2R3UTIZK2U|AAPL R735QTJ8XC9X\nAAPL 31H2R3UV6IWKM|AAPL R735QTJ8XC9X\nAAPL 31F5TT9F7QCQU|AAPL R735QTJ8XC9X\nAAPL 31FJM2KJKSWZQ|AAPL R735QTJ8XC9X\nAAPL 31FQI783RC746|AAPL R735QTJ8XC9X\nAAPL 31H2R3UWU292E|AAPL R735QTJ8XC9X\nAAPL 31H2R3UYHLLK6|AAPL R735QTJ8XC9X\nAAPL 31GB6L6SMUPL2|AAPL R735QTJ8XC9X\nAAPL 31GB6L8REZTK6|AAPL R735QTJ8XC9X\nAAPL 31H2R3V054Y1Y|AAPL R735QTJ8XC9X\nAAPL 31H2R3V1SOAJQ|AAPL R735QTJ8XC9X\nAAPL 31H2R3V3G7N1I|AAPL R735QTJ8XC9X\nAAPL 31H2R3V53QZJA|AAPL R735QTJ8XC9X\nAAPL 31H2R3T20T69Y|AAPL R735QTJ8XC9X\nAAPL 31JKCSBCVMU12|AAPL R735QTJ8XC9X\nAAPL 31KBXAXLLRYIU|AAPL R735QTJ8XC9X\nAAPL 31OJK5BXLK58M|AAPL R735QTJ8XC9X\nAAPL 31R15TU7YISUE|AAPL R735QTJ8XC9X\nAAPL 31UH85MB85V2E|AAPL R735QTJ8XC9X\nAAPL 31YHYVD31ERNQ|AAPL R735QTJ8XC9X\nAAPL 320ZKJVDEDF9I|AAPL R735QTJ8XC9X\nAAPL XGTE6FM3CB2E|AAPL R735QTJ8XC9X\nAAPL XGTE6GU2Z71I|AAPL R735QTJ8XC9X\nAAPL XGTE6FHSLQXY|AAPL R735QTJ8XC9X\nAAPL XGTE6GVQIJJA|AAPL R735QTJ8XC9X\nAAPL XGTE6FMF8Z5Y|AAPL R735QTJ8XC9X\nAAPL XGTE6GXE1W12|AAPL R735QTJ8XC9X\nAAPL XGTE6FML7B7Q|AAPL R735QTJ8XC9X\nAAPL XGTE6GZ1L8IU|AAPL R735QTJ8XC9X\nAAPL XGTE6FMR5N9I|AAPL R735QTJ8XC9X\nAAPL XGTE6UR6R7IE|AAPL R735QTJ8XC9X\nAAPL XGTE6H0P4L0M|AAPL R735QTJ8XC9X\nAAPL XGTE6UZGFXZA|AAPL R735QTJ8XC9X\nAAPL XGTE6FMX3ZBA|AAPL R735QTJ8XC9X\nAAPL XGTE6V7Q4OG6|AAPL R735QTJ8XC9X\nAAPL XGTE6H2CNXIE|AAPL R735QTJ8XC9X\nAAPL XGTE6VFZTEX2|AAPL R735QTJ8XC9X\nAAPL XGTE6FN32BD2|AAPL R735QTJ8XC9X\nAAPL XGTE6VO9I5DY|AAPL R735QTJ8XC9X\nAAPL XGTE6H407A06|AAPL R735QTJ8XC9X\nAAPL XGTE6VWJ6VUU|AAPL R735QTJ8XC9X\nAAPL XGTE6FN90NEU|AAPL R735QTJ8XC9X\nAAPL XGTE6W4SVMBQ|AAPL R735QTJ8XC9X\nAAPL XGTE6H5NQMHY|AAPL R735QTJ8XC9X\nAAPL XGTE6WD2KCSM|AAPL R735QTJ8XC9X\nAAPL XGTE6FNEYZGM|AAPL R735QTJ8XC9X\nAAPL XGTE6WLC939I|AAPL R735QTJ8XC9X\nAAPL XGTE6H7B9YZQ|AAPL R735QTJ8XC9X\nAAPL XGTE6WTLXTQE|AAPL R735QTJ8XC9X\nAAPL XGTE6FNKXBIE|AAPL R735QTJ8XC9X\nAAPL XGTE6X1VMK7A|AAPL R735QTJ8XC9X\nAAPL XGTE6H8YTBHI|AAPL R735QTJ8XC9X\nAAPL XGTE6FNQVNK6|AAPL R735QTJ8XC9X\nAAPL XGTE6HAMCNZA|AAPL R735QTJ8XC9X\nAAPL XGTE6FHYK2ZQ|AAPL R735QTJ8XC9X\nAAPL XGTE6HC9W0H2|AAPL R735QTJ8XC9X\nAAPL XGTE6FO2SBNQ|AAPL R735QTJ8XC9X\nAAPL XGTE6HDXFCYU|AAPL R735QTJ8XC9X\nAAPL XGTE6FO8QNPI|AAPL R735QTJ8XC9X\nAAPL XGTE6HFKYPGM|AAPL R735QTJ8XC9X\nAAPL XGTE6FOEOZRA|AAPL R735QTJ8XC9X\nAAPL XG1TNVBTFMG6|AAPL R735QTJ8XC9X\nAAPL XGFLX6G6I6P2|AAPL R735QTJ8XC9X\nAAPL XGMI1U0D1GTI|AAPL R735QTJ8XC9X\nAAPL XG1TNTG6EVEU|AAPL R735QTJ8XC9X\nAAPL XH76FQTLJ892|AAPL R735QTJ8XC9X\nAAPL XH76FSTV9CO6|AAPL R735QTJ8XC9X\nAAPL XHYQYF7K0INA|AAPL R735QTJ8XC9X\nAAPL XHYQYD2ZHOXY|AAPL R735QTJ8XC9X\nAAPL XJOS494MB81Y|AAPL R735QTJ8XC9X\nAAPL XG8PSH1IMHVQ|AAPL R735QTJ8XC9X\nAAPL XG8PSJ989OIU|AAPL R735QTJ8XC9X\nAAPL XG8PSH1OKTXI|AAPL R735QTJ8XC9X\nAAPL 31FXEBVLAM4G6|AAPL R735QTJ8XC9X\nAAPL 31FXEBWTA90FA|AAPL R735QTJ8XC9X\nAAPL 31FXEBVGZVKBQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBWUXSCX2|AAPL R735QTJ8XC9X\nAAPL 31FXEBVLMISJQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBWWLBPEU|AAPL R735QTJ8XC9X\nAAPL 31FXEBVLSH4LI|AAPL R735QTJ8XC9X\nAAPL 31FXEBWY8V1WM|AAPL R735QTJ8XC9X\nAAPL 31FXEBVLYFGNA|AAPL R735QTJ8XC9X\nAAPL 31FXECAQE10W6|AAPL R735QTJ8XC9X\nAAPL 31FXEBWZWEEEE|AAPL R735QTJ8XC9X\nAAPL 31FXECAYNPRD2|AAPL R735QTJ8XC9X\nAAPL 31FXEBVM4DSP2|AAPL R735QTJ8XC9X\nAAPL 31FXECB6XEHTY|AAPL R735QTJ8XC9X\nAAPL 31FXEBX1JXQW6|AAPL R735QTJ8XC9X\nAAPL 31FXECBF738AU|AAPL R735QTJ8XC9X\nAAPL 31FXEBVMAC4QU|AAPL R735QTJ8XC9X\nAAPL 31FXECBNGRYRQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBX37H3DY|AAPL R735QTJ8XC9X\nAAPL 31FXECBVQGP8M|AAPL R735QTJ8XC9X\nAAPL 31FXEBVMGAGSM|AAPL R735QTJ8XC9X\nAAPL 31FXECC405FPI|AAPL R735QTJ8XC9X\nAAPL 31FXEBX4V0FVQ|AAPL R735QTJ8XC9X\nAAPL 31FXECCC9U66E|AAPL R735QTJ8XC9X\nAAPL 31FXEBVMM8SUE|AAPL R735QTJ8XC9X\nAAPL 31FXECCKJIWNA|AAPL R735QTJ8XC9X\nAAPL 31FXEBX6IJSDI|AAPL R735QTJ8XC9X\nAAPL 31FXECCST7N46|AAPL R735QTJ8XC9X\nAAPL 31FXEBVMS74W6|AAPL R735QTJ8XC9X\nAAPL 31FXECD12WDL2|AAPL R735QTJ8XC9X\nAAPL 31FXEBX8634VA|AAPL R735QTJ8XC9X\nAAPL 31FXEBVMY5GXY|AAPL R735QTJ8XC9X\nAAPL 31FXEBX9TMHD2|AAPL R735QTJ8XC9X\nAAPL 31FXEBVH5TWDI|AAPL R735QTJ8XC9X\nAAPL 31FXEBXBH5TUU|AAPL R735QTJ8XC9X\nAAPL 31FXEBVNA251I|AAPL R735QTJ8XC9X\nAAPL 31FXEBXD4P6CM|AAPL R735QTJ8XC9X\nAAPL 31FXEBVNG0H3A|AAPL R735QTJ8XC9X\nAAPL 31FXEBXES8IUE|AAPL R735QTJ8XC9X\nAAPL 31FXEBVNLYT52|AAPL R735QTJ8XC9X\nAAPL 31F5TTBB0PFTY|AAPL R735QTJ8XC9X\nAAPL 31FJM2MFDS02U|AAPL R735QTJ8XC9X\nAAPL 31FQI79ZKBA7A|AAPL R735QTJ8XC9X\nAAPL 31F5TT9FDOOSM|AAPL R735QTJ8XC9X\nAAPL 31GB6L6SST1MU|AAPL R735QTJ8XC9X\nAAPL 31GB6L8T2J61Y|AAPL R735QTJ8XC9X\nAAPL 31H2R3V6RAC12|AAPL R735QTJ8XC9X\nAAPL 31H2R3T26RIBQ|AAPL R735QTJ8XC9X\nAAPL 31ISS9P3TL1FQ|AAPL R735QTJ8XC9X\nAAPL 31FCPXX0PWB9I|AAPL R735QTJ8XC9X\nAAPL 31FCPXZ8FJHWM|AAPL R735QTJ8XC9X\nAAPL 31FCPXX0VUNBA|AAPL R735QTJ8XC9X\nAAPL XH76FQTRHKAU|AAPL R735QTJ8XC9X\nAAPL 31FXEBXI3B7TY|AAPL R735QTJ8XC9X\nAAPL XGTE6FLRFMYU|AAPL R735QTJ8XC9X\nAAPL 31FXEBWMO3MG6|AAPL R735QTJ8XC9X\nAAPL 31GB6L6SYRDOM|AAPL R735QTJ8XC9X\nAAPL 31FXEBWOBMYXY|AAPL R735QTJ8XC9X\nAAPL 31FXEBVKMSS92|AAPL R735QTJ8XC9X\nAAPL 31H2R3T2CPUDI|AAPL R735QTJ8XC9X\nAAPL 31FXEBVNRX56U|AAPL R735QTJ8XC9X\nAAPL 31H2R3V8ETOIU|AAPL R735QTJ8XC9X\nAAPL XGTE6FLFIYVA|AAPL R735QTJ8XC9X\nAAPL XGTE6GP4D5K6|AAPL R735QTJ8XC9X\nAAPL XGMI1S4Q0PS6|AAPL R735QTJ8XC9X\nAAPL XHYQYD35G0ZQ|AAPL R735QTJ8XC9X\nAAPL XGTE6FOKNBT2|AAPL R735QTJ8XC9X\nAAPL XGFLX4KJHFNQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBWRMPNXI|AAPL R735QTJ8XC9X\nAAPL 31GB6L8UQ2IJQ|AAPL R735QTJ8XC9X\nAAPL XGTE6HIW1EG6|AAPL R735QTJ8XC9X\nAAPL XGTE6GNGTT2E|AAPL R735QTJ8XC9X\nAAPL XHYQYF97JV52|AAPL R735QTJ8XC9X\nAAPL XGTE6FKXNYPY|AAPL R735QTJ8XC9X\nAAPL 31FXEBVKGUG7A|AAPL R735QTJ8XC9X\nAAPL XGTE6HH8I1YE|AAPL R735QTJ8XC9X\nAAPL 31FJM2KJQR91I|AAPL R735QTJ8XC9X\nAAPL XGTE6FL3MARQ|AAPL R735QTJ8XC9X\nAAPL 31FQI783XAJ5Y|AAPL R735QTJ8XC9X\nAAPL XH76FSVISP5Y|AAPL R735QTJ8XC9X\nAAPL XGTE6GQRWI1Y|AAPL R735QTJ8XC9X\nAAPL XGTE6GII7RL2|AAPL R735QTJ8XC9X\nAAPL 31FXEBVKYPGCM|AAPL R735QTJ8XC9X\nAAPL XGTE6GK5R42U|AAPL R735QTJ8XC9X\nAAPL XGTE6GSFFUJQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBVKAW45I|AAPL R735QTJ8XC9X\nAAPL 31FXEBVL4NSEE|AAPL R735QTJ8XC9X\nAAPL 31FXEBWHPHKYU|AAPL R735QTJ8XC9X\nAAPL 31FXEBVK4XS3Q|AAPL R735QTJ8XC9X\nAAPL XGTE6FL9KMTI|AAPL R735QTJ8XC9X\nAAPL XGFLX6HU1J6U|AAPL R735QTJ8XC9X\nAAPL 31FXEBWJD0XGM|AAPL R735QTJ8XC9X\nAAPL 31FXEBWPZ6BFQ|AAPL R735QTJ8XC9X\nAAPL 31FXEBXGFRVC6|AAPL R735QTJ8XC9X\nAAPL XGTE6FLXDZ0M|AAPL R735QTJ8XC9X\nAAPL 31FJM2MH1BCKM|AAPL R735QTJ8XC9X\nAAPL XGTE6FLLHAX2|AAPL R735QTJ8XC9X\nAAPL XGTE6GLTAGKM|AAPL R735QTJ8XC9X\nAAPL 31FXEBWL0K9YE|AAPL R735QTJ8XC9X\nAAPL 31FXEBVKSR4AU|AAPL R735QTJ8XC9X\nAAPL XHYQYFAV37MU|AAPL R735QTJ8XC9X\nAAPL XGTE6FOQLNUU|AAPL R735QTJ8XC9X\nAAPL XH76FSX6C1NQ|AAPL R735QTJ8XC9X\nAAPL XGFLX4KPFRPI|AAPL R735QTJ8XC9X\nAAPL XH76FQMHKZAE|AAPL R735QTJ8XC9X\nAAPL XGMI1U20KTBA|AAPL R735QTJ8XC9X\nAAPL 31FQI7A17UMP2|AAPL R735QTJ8XC9X\n"
  },
  {
    "path": "Tests/TestData/aapl_fine_fundamental.json",
    "content": "{\"CompanyReference\":{\"1\":\"0C00000ADA\",\"2\":\"Apple\",\"3\":\"Apple Inc\",\"4\":\"Apple Inc\",\"5\":\"USA\",\"6\":\"320193\",\"9\":\"U\",\"10\":9,\"11\":\"N\",\"12\":\"0P000000GY\",\"13\":\"AAPL\",\"14\":\"NAS\",\"15\":\"USA\",\"16\":\"ENG\",\"17\":\"Ernst & Young LLP\",\"18\":\"ENG\",\"19\":\"Ernst & Young LLP\",\"20\":\"ENG\",\"23\":\"XNAS\",\"24\":1,\"25\":\"1977\",\"27\":\"2018-09-30\"},\"SecurityReference\":{\"1001\":\"AAPL\",\"1002\":\"NAS\",\"1004\":\"USD\",\"1005\":\"908440\",\"1009\":\"1980-12-12\",\"1012\":\"ST00000001\",\"1014\":\"A\",\"1015\":true,\"1018\":\"E0USA002US\",\"1022\":\"XNAS\",\"1026\":1.0,\"1027\":0.00001,\"1029\":\"126.1.AAPL\"},\"FinancialStatements\":{\"20001\":\"2018-03-31\",\"20002\":\"2018-05-02\",\"20003\":\"0000320193-18-000070\",\"20004\":\"10-Q\",\"28004\":{},\"IncomeStatement\":{\"20013\":{\"3M\":37715000000.0,\"6M\":92096000000.0,\"9M\":108400000000.0,\"12M\":141048000000.0},\"20030\":{\"3M\":3000000.0,\"6M\":-2000000.0,\"9M\":-2000000.0,\"12M\":1000000.0},\"20046\":{\"3M\":23422000000.0,\"6M\":57334000000.0,\"9M\":68255000000.0,\"12M\":88186000000.0},\"20057\":{\"3M\":792000000.0,\"6M\":1526000000.0,\"9M\":1657000000.0,\"12M\":2323000000.0},\"20064\":{\"3M\":792000000.0,\"6M\":1526000000.0,\"9M\":1657000000.0,\"12M\":2323000000.0},\"20075\":{\"3M\":1505000000.0,\"6M\":2957000000.0,\"9M\":3833000000.0,\"12M\":5201000000.0},\"20077\":{\"3M\":713000000.0,\"6M\":1431000000.0,\"9M\":2176000000.0,\"12M\":2878000000.0},\"20091\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20093\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20094\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20095\":{\"3M\":713000000.0,\"6M\":1431000000.0,\"9M\":2176000000.0,\"12M\":2878000000.0},\"20100\":{\"3M\":61137000000.0,\"6M\":149430000000.0,\"9M\":176655000000.0,\"12M\":229234000000.0},\"20108\":{\"3M\":7528000000.0,\"6M\":15166000000.0,\"9M\":20031000000.0,\"12M\":26842000000.0},\"20109\":{\"3M\":15894000000.0,\"6M\":42168000000.0,\"9M\":48224000000.0,\"12M\":61344000000.0},\"20112\":{\"3M\":61137000000.0,\"6M\":149430000000.0,\"9M\":176655000000.0,\"12M\":229234000000.0},\"20117\":{\"3M\":-439000000.0,\"6M\":-401000000.0,\"9M\":-228000000.0,\"12M\":-133000000.0},\"20136\":{\"3M\":16168000000.0,\"6M\":43198000000.0,\"9M\":50172000000.0,\"12M\":64089000000.0},\"20145\":{\"3M\":2346000000.0,\"6M\":9311000000.0,\"9M\":12535000000.0,\"12M\":15738000000.0},\"20151\":{\"3M\":3378000000.0,\"6M\":6785000000.0,\"9M\":8584000000.0,\"12M\":11581000000.0},\"20159\":{\"3M\":4150000000.0,\"6M\":8381000000.0,\"9M\":11447000000.0,\"12M\":15261000000.0},\"20162\":{\"3M\":148000000.0,\"6M\":285000000.0,\"9M\":141000000.0,\"12M\":-104000000.0},\"20164\":{\"3M\":45243000000.0,\"6M\":107262000000.0,\"9M\":128431000000.0,\"12M\":167890000000.0},\"20177\":{\"3M\":1505000000.0,\"6M\":2957000000.0,\"9M\":3833000000.0,\"12M\":5201000000.0},\"20189\":{\"3M\":16960000000.0,\"6M\":44724000000.0,\"9M\":51829000000.0,\"12M\":66412000000.0},\"20190\":{\"3M\":19699000000.0,\"6M\":50208000000.0,\"9M\":59502000000.0,\"12M\":76569000000.0},\"20208\":{\"12M\":40000000.0},\"20269\":{\"3M\":-7000000.0,\"6M\":1000000.0,\"9M\":3000000.0,\"12M\":-4000000.0},\"20289\":{\"3M\":5000000.0,\"6M\":10000000.0,\"9M\":18000000.0,\"12M\":23000000.0},\"20309\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20312\":{\"6M\":98000000.0,\"9M\":98000000.0,\"12M\":-2000000.0},\"20314\":{\"3M\":37715000000.0,\"6M\":92096000000.0,\"9M\":108400000000.0,\"12M\":141048000000.0},\"20315\":{\"3M\":2739000000.0,\"6M\":5484000000.0,\"9M\":7673000000.0,\"12M\":10157000000.0},\"20316\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20331\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20346\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20412\":{\"3M\":-439000000.0,\"6M\":-401000000.0,\"9M\":-228000000.0,\"12M\":-133000000.0},\"20416\":{\"3M\":148000000.0,\"6M\":285000000.0,\"9M\":141000000.0,\"12M\":-104000000.0},\"20417\":{\"3M\":148000000.0,\"6M\":285000000.0,\"9M\":141000000.0,\"12M\":-104000000.0},\"20418\":{\"3M\":0.220759,\"6M\":0.220759,\"9M\":0.251908,\"12M\":0.245565},\"20419\":{},\"20420\":{\"3M\":19699000000.0,\"6M\":50208000000.0,\"9M\":59502000000.0,\"12M\":76569000000.0},\"20424\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"20435\":{\"3M\":15894000000.0,\"6M\":42168000000.0,\"9M\":48224000000.0,\"12M\":61344000000.0},\"20441\":{\"3M\":16168000000.0,\"6M\":43198000000.0,\"9M\":50172000000.0,\"12M\":64089000000.0}},\"BalanceSheet\":{\"23000\":{\"3M\":34311000000.0,\"12M\":49049000000.0},\"23001\":{\"3M\":14324000000.0,\"12M\":17874000000.0},\"23004\":{\"3M\":26756000000.0,\"12M\":25744000000.0},\"23008\":{\"3M\":-45425000000.0,\"12M\":-41293000000.0},\"23009\":{\"3M\":-3064000000.0,\"12M\":-150000000.0},\"23012\":{\"3M\":20559000000.0,\"12M\":19764000000.0},\"23027\":{\"3M\":38044000000.0,\"12M\":35867000000.0},\"23028\":{\"3M\":9529000000.0,\"12M\":7982000000.0},\"23029\":{\"3M\":17962000000.0,\"12M\":12307000000.0},\"23030\":{\"3M\":45059000000.0,\"12M\":20289000000.0},\"23033\":{\"3M\":87940000000.0,\"12M\":74181000000.0},\"23038\":{\"3M\":38044000000.0,\"12M\":35867000000.0},\"23044\":{\"3M\":130053000000.0,\"12M\":128645000000.0},\"23045\":{\"3M\":20478000000.0,\"12M\":18473000000.0},\"23046\":{\"3M\":20478000000.0,\"12M\":18473000000.0},\"23047\":{\"3M\":89320000000.0,\"12M\":100814000000.0},\"23057\":{\"3M\":3635000000.0,\"12M\":34340000000.0},\"23058\":{\"3M\":7775000000.0,\"12M\":7548000000.0},\"23061\":{\"3M\":7775000000.0,\"12M\":7548000000.0},\"23062\":{\"3M\":3087000000.0,\"12M\":2836000000.0},\"23064\":{\"3M\":5546000000.0,\"12M\":5546000000.0},\"23065\":{\"3M\":100000000.0},\"23066\":{\"3M\":129000000.0,\"12M\":163000000.0},\"23067\":{\"3M\":548000000.0,\"12M\":31504000000.0},\"23097\":{\"3M\":5889000000.0,\"12M\":5717000000.0},\"23098\":{\"3M\":8038000000.0,\"12M\":8015000000.0},\"23100\":{\"3M\":80502000000.0,\"12M\":75076000000.0},\"23103\":{\"3M\":152000000.0,\"12M\":210000000.0},\"23108\":{\"3M\":7662000000.0,\"12M\":4855000000.0},\"23111\":{\"3M\":179286000000.0,\"12M\":194714000000.0},\"23123\":{\"3M\":101362000000.0,\"12M\":97207000000.0},\"23124\":{\"3M\":101362000000.0,\"12M\":97207000000.0},\"23139\":{\"3M\":35077000000.0,\"12M\":33783000000.0},\"23143\":{\"3M\":23000000.0},\"23151\":{\"3M\":11450000000.0,\"12M\":8498000000.0},\"23155\":{\"3M\":2149000000.0,\"12M\":2298000000.0},\"23163\":{\"3M\":42881000000.0,\"12M\":53892000000.0},\"23165\":{\"3M\":34311000000.0,\"12M\":49049000000.0},\"23166\":{\"3M\":61067000000.0,\"12M\":74793000000.0},\"23174\":{\"3M\":3000000.0,\"12M\":76000000.0},\"23179\":{\"3M\":190000000.0,\"12M\":309000000.0},\"23180\":{\"3M\":781000000.0,\"12M\":844000000.0},\"23189\":{\"3M\":22408000000.0,\"12M\":35673000000.0},\"23204\":{\"3M\":91898000000.0,\"12M\":98330000000.0},\"23215\":{\"3M\":126878000000.0,\"12M\":134047000000.0},\"23217\":{\"3M\":1566000000.0,\"12M\":1209000000.0},\"23220\":{\"3M\":367502000000.0,\"12M\":375319000000.0},\"23226\":{\"3M\":237449000000.0,\"12M\":246674000000.0},\"23245\":{\"3M\":248718000000.0,\"12M\":249727000000.0},\"23252\":{\"3M\":5546000000.0,\"12M\":5546000000.0},\"23253\":{\"3M\":129000000.0,\"12M\":163000000.0},\"23259\":{\"3M\":240624000000.0,\"12M\":241272000000.0},\"23260\":{\"3M\":151304000000.0,\"12M\":140458000000.0},\"23261\":{\"3M\":126878000000.0,\"12M\":134047000000.0},\"23262\":{\"3M\":14384000000.0,\"12M\":17932000000.0},\"23266\":{\"3M\":-60000000.0,\"12M\":-58000000.0},\"23275\":{\"3M\":1798000000.0,\"12M\":1324000000.0},\"23279\":{\"3M\":11980000000.0,\"12M\":11977000000.0},\"23280\":{\"3M\":126878000000.0,\"12M\":134047000000.0},\"23300\":{\"3M\":2476000000.0,\"12M\":1640000000.0},\"23304\":{\"3M\":105000000.0,\"12M\":70000000.0},\"23312\":{\"3M\":14931000000.0,\"12M\":13587000000.0},\"23313\":{\"3M\":7787000000.0,\"12M\":7279000000.0},\"23319\":{\"3M\":57784000000.0,\"12M\":54210000000.0},\"23331\":{\"3M\":12043000000.0,\"12M\":13936000000.0},\"23332\":{\"3M\":8498000000.0,\"12M\":6496000000.0},\"23335\":{\"3M\":-36000000.0,\"12M\":-7000000.0},\"23337\":{\"3M\":2000000.0},\"23339\":{\"3M\":23086000000.0,\"12M\":10162000000.0},\"23340\":{\"3M\":184000000.0,\"12M\":184000000.0},\"23342\":{\"3M\":8084000000.0,\"12M\":17799000000.0},\"23347\":{\"3M\":3000000.0,\"12M\":76000000.0},\"23351\":{},\"23355\":{\"3M\":5186000000.0,\"12M\":471000000.0},\"23358\":{\"3M\":-54000000.0},\"23374\":{\"3M\":228240000000.0,\"12M\":231254000000.0},\"23378\":{\"3M\":1000000.0,\"12M\":4000000.0},\"23379\":{\"3M\":11394000000.0,\"12M\":8911000000.0},\"23382\":{\"3M\":4853000000.0,\"12M\":4853000000.0},\"23383\":{\"3M\":126878000000.0,\"12M\":126032000000.0},\"23384\":{\"3M\":126878000000.0,\"12M\":134047000000.0},\"23385\":{\"3M\":40733000000.0,\"12M\":27831000000.0},\"23386\":{\"3M\":121840000000.0,\"12M\":115680000000.0},\"23393\":{\"3M\":4943282000.0,\"12M\":5126201000.0},\"23403\":{\"3M\":126878000000.0,\"12M\":126032000000.0},\"23414\":{\"3M\":179286000000.0,\"12M\":194714000000.0},\"23472\":{\"3M\":34913000000.0},\"23475\":{\"3M\":1551000000.0,\"12M\":1209000000.0},\"23531\":{\"3M\":76781000000.0,\"12M\":95391000000.0},\"23532\":{\"3M\":4943282000.0,\"12M\":5126201000.0}},\"CashFlowStatement\":{\"26005\":{\"3M\":-4041000000.0,\"6M\":-7005000000.0,\"9M\":-8795000000.0,\"12M\":-12795000000.0},\"26007\":{\"3M\":-3190000000.0,\"6M\":-6529000000.0,\"9M\":-9499000000.0,\"12M\":-12769000000.0},\"26008\":{\"3M\":-26272000000.0,\"6M\":-33773000000.0,\"9M\":-13351000000.0,\"12M\":-17347000000.0},\"26009\":{\"3M\":28710000000.0,\"6M\":15120000000.0,\"9M\":-36504000000.0,\"12M\":-46446000000.0},\"26010\":{\"3M\":15130000000.0,\"6M\":43423000000.0,\"9M\":47942000000.0,\"12M\":63598000000.0},\"26012\":{\"3M\":-26272000000.0,\"6M\":-33773000000.0,\"9M\":-13351000000.0,\"12M\":-17347000000.0},\"26013\":{\"3M\":28710000000.0,\"6M\":15120000000.0,\"9M\":-36504000000.0,\"12M\":-46446000000.0},\"26014\":{\"3M\":15130000000.0,\"6M\":43423000000.0,\"9M\":47942000000.0,\"12M\":63598000000.0},\"26015\":{\"3M\":27491000000.0,\"6M\":20289000000.0,\"9M\":20484000000.0,\"12M\":20484000000.0},\"26016\":{\"3M\":45059000000.0,\"6M\":45059000000.0,\"9M\":18571000000.0,\"12M\":20289000000.0},\"26022\":{\"3M\":-27808000000.0,\"6M\":-13220000000.0,\"9M\":-5212000000.0,\"12M\":9618000000.0},\"26027\":{\"3M\":17568000000.0,\"6M\":24770000000.0,\"9M\":-1913000000.0,\"12M\":-195000000.0},\"26034\":{\"3M\":-3241000000.0,\"6M\":-2807000000.0,\"9M\":-1014000000.0,\"12M\":-2723000000.0},\"26040\":{\"3M\":-27808000000.0,\"6M\":-13220000000.0,\"9M\":-5212000000.0,\"12M\":9618000000.0},\"26041\":{\"3M\":-27808000000.0,\"6M\":-13220000000.0,\"9M\":-5212000000.0,\"12M\":9618000000.0},\"26045\":{\"3M\":28468000000.0,\"6M\":13238000000.0,\"9M\":6693000000.0,\"12M\":-6347000000.0},\"26053\":{\"3M\":-2141000000.0,\"6M\":35794000000.0,\"9M\":-5656000000.0,\"12M\":-5550000000.0},\"26056\":{\"3M\":-498000000.0,\"6M\":-34235000000.0,\"9M\":4764000000.0,\"12M\":5966000000.0},\"26057\":{\"3M\":-498000000.0,\"6M\":-34235000000.0,\"9M\":4764000000.0,\"12M\":5966000000.0},\"26060\":{\"3M\":2739000000.0,\"6M\":5484000000.0,\"9M\":7673000000.0,\"12M\":10157000000.0},\"26061\":{\"3M\":2739000000.0,\"6M\":5484000000.0,\"9M\":7673000000.0,\"12M\":10157000000.0},\"26071\":{\"3M\":-22429000000.0,\"6M\":-32524000000.0,\"9M\":-24831000000.0,\"12M\":-32345000000.0},\"26072\":{\"3M\":-501000000.0,\"6M\":6470000000.0,\"9M\":22091000000.0,\"12M\":29014000000.0},\"26073\":{\"3M\":-500000000.0,\"6M\":6469000000.0,\"9M\":18225000000.0,\"12M\":25162000000.0},\"26075\":{\"3M\":-1000000.0,\"6M\":1000000.0,\"9M\":3866000000.0,\"12M\":3852000000.0},\"26080\":{\"3M\":13822000000.0,\"6M\":33887000000.0,\"9M\":37637000000.0,\"12M\":48351000000.0},\"26088\":{\"3M\":-22756000000.0,\"6M\":-32851000000.0,\"9M\":-25105000000.0,\"12M\":-32900000000.0},\"26090\":{\"6M\":-500000000.0,\"9M\":-3500000000.0,\"12M\":-3500000000.0},\"26098\":{\"3M\":281000000.0,\"6M\":327000000.0,\"9M\":274000000.0,\"12M\":555000000.0},\"26099\":{\"6M\":6969000000.0,\"9M\":21725000000.0,\"12M\":28662000000.0},\"26108\":{\"3M\":-154000000.0,\"6M\":-126000000.0,\"9M\":-209000000.0,\"12M\":-344000000.0},\"26110\":{\"3M\":-7177000000.0,\"6M\":-48449000000.0,\"9M\":-123781000000.0,\"12M\":-159486000000.0},\"26112\":{\"3M\":-4195000000.0,\"6M\":-7005000000.0,\"9M\":-8586000000.0,\"12M\":-12451000000.0},\"26115\":{\"3M\":-132000000.0,\"6M\":-305000000.0,\"9M\":-248000000.0,\"12M\":-329000000.0},\"26116\":{\"3M\":-132000000.0,\"6M\":-305000000.0,\"9M\":-248000000.0,\"12M\":-329000000.0},\"26117\":{\"3M\":-154000000.0,\"6M\":-126000000.0,\"9M\":-209000000.0,\"12M\":-344000000.0},\"26118\":{\"3M\":32800000000.0,\"6M\":22377000000.0,\"9M\":-27687000000.0,\"12M\":-33147000000.0},\"26119\":{\"3M\":-4195000000.0,\"6M\":-7005000000.0,\"9M\":-8586000000.0,\"12M\":-12451000000.0},\"26125\":{\"3M\":39977000000.0,\"6M\":70826000000.0,\"9M\":96094000000.0,\"12M\":126339000000.0},\"26127\":{\"6M\":10000000.0,\"9M\":11000000.0,\"12M\":11000000.0},\"26137\":{\"3M\":9093000000.0,\"6M\":3523000000.0,\"9M\":3381000000.0,\"12M\":-2093000000.0},\"26146\":{\"3M\":-570000000.0,\"6M\":-824000000.0,\"9M\":-944000000.0,\"12M\":-1514000000.0},\"26147\":{\"3M\":-29000000.0,\"6M\":577000000.0,\"9M\":4254000000.0,\"12M\":521000000.0},\"26148\":{\"3M\":440000000.0,\"6M\":38583000000.0,\"9M\":-6123000000.0,\"12M\":-6098000000.0},\"26154\":{\"3M\":-3190000000.0,\"6M\":-6529000000.0,\"9M\":-9499000000.0,\"12M\":-12769000000.0},\"26160\":{\"3M\":10000000.0,\"6M\":9000000.0,\"9M\":14000000.0,\"12M\":24000000.0},\"26163\":{\"3M\":10000000.0,\"6M\":9000000.0,\"9M\":14000000.0,\"12M\":24000000.0},\"26164\":{\"3M\":-152000000.0,\"6M\":-1190000000.0,\"9M\":-1112000000.0,\"12M\":-1247000000.0},\"26165\":{\"3M\":83000000.0,\"6M\":53000000.0,\"9M\":226000000.0,\"12M\":-175000000.0},\"26166\":{\"3M\":-140000000.0,\"6M\":-151000000.0,\"9M\":-142000000.0,\"12M\":-166000000.0},\"26172\":{\"3M\":1348000000.0,\"6M\":2644000000.0,\"9M\":3666000000.0,\"12M\":4840000000.0},\"26179\":{\"3M\":-9891000000.0,\"6M\":-6340000000.0,\"9M\":9752000000.0,\"12M\":11591000000.0},\"26180\":{\"3M\":-1979000000.0,\"6M\":-1356000000.0,\"9M\":1456000000.0,\"12M\":2092000000.0},\"26181\":{\"3M\":281000000.0,\"6M\":327000000.0,\"9M\":274000000.0,\"12M\":555000000.0},\"26182\":{\"6M\":6969000000.0,\"9M\":21725000000.0,\"12M\":28662000000.0},\"26183\":{\"6M\":-500000000.0,\"9M\":-3500000000.0,\"12M\":-3500000000.0},\"26184\":{\"3M\":-22756000000.0,\"6M\":-32851000000.0,\"9M\":-25105000000.0,\"12M\":-32900000000.0},\"26185\":{\"3M\":11089000000.0,\"6M\":36418000000.0,\"9M\":39147000000.0,\"12M\":50803000000.0}}},\"EarningReports\":{\"20001\":\"2018-03-31\",\"20002\":\"2018-05-02\",\"20003\":\"0000320193-18-000070\",\"20004\":\"10-Q\",\"29000\":{\"3M\":2.75,\"6M\":6.69,\"9M\":7.18,\"12M\":9.27},\"29001\":{},\"29002\":{\"3M\":0.000595,\"6M\":-0.000397,\"9M\":-0.000397,\"12M\":0.000198},\"29004\":{\"3M\":2.75,\"6M\":6.69,\"9M\":7.18,\"12M\":9.27},\"29005\":{\"3M\":2.73,\"6M\":6.63,\"9M\":7.14,\"12M\":9.21},\"29006\":{},\"29007\":{\"3M\":0.000593,\"6M\":-0.000397,\"9M\":-0.000397,\"12M\":0.000197},\"29009\":{\"3M\":2.73,\"6M\":6.63,\"9M\":7.14,\"12M\":9.21},\"29010\":{\"3M\":5024877000.0,\"6M\":5068877000.0,\"9M\":5239847000.0,\"12M\":5217242000.0},\"29011\":{\"3M\":5068493000.0,\"6M\":5113140000.0,\"9M\":5274394000.0,\"12M\":5251692000.0},\"29012\":{\"3M\":0.63,\"6M\":1.26,\"9M\":1.77,\"12M\":2.4},\"29014\":{\"3M\":2.75,\"6M\":6.69,\"9M\":7.18,\"12M\":9.27},\"29017\":{\"3M\":2.73,\"6M\":6.63,\"9M\":7.14,\"12M\":9.21},\"29019\":{\"3M\":2.75,\"6M\":6.69,\"9M\":7.18,\"12M\":9.27},\"29020\":{\"3M\":2.73,\"6M\":6.63,\"9M\":7.14,\"12M\":9.21},\"29021\":{\"3M\":0.63,\"6M\":1.26,\"9M\":1.77,\"12M\":2.4},\"29024\":{\"3M\":4.333333,\"6M\":5.261905,\"9M\":4.033898,\"12M\":3.8375}},\"OperationRatios\":{\"10001\":{\"1Y\":0.063045,\"3Y\":0.078379,\"3M\":0.679245,\"5Y\":0.079316},\"10002\":{\"1Y\":0.021991,\"3Y\":0.053245,\"3M\":1.002591,\"5Y\":0.02118},\"10003\":{\"1Y\":0.05831,\"3Y\":0.069628,\"3M\":0.872783,\"5Y\":0.029877},\"10004\":{\"1Y\":0.05831,\"3Y\":0.069628,\"3M\":0.872783,\"5Y\":0.029877},\"10005\":{\"1Y\":-0.033817,\"3Y\":0.021233,\"5Y\":0.045732},\"10006\":{\"1Y\":-0.028177,\"3Y\":0.005996,\"5Y\":0.041513},\"10007\":{\"1Y\":0.063045,\"3Y\":0.078379,\"3M\":0.679245,\"5Y\":0.079316},\"11001\":{\"1Y\":0.384699,\"3M\":0.384085,\"6M\":0.386805,\"9M\":0.386375},\"11002\":{\"1Y\":0.267604,\"3M\":0.297577,\"6M\":0.285386,\"9M\":0.272984},\"11003\":{\"1Y\":0.279579,\"3M\":0.30614,\"6M\":0.296113,\"9M\":0.284011},\"11004\":{\"1Y\":0.210924,\"3M\":0.227255,\"6M\":0.220348,\"9M\":0.213054},\"11005\":{\"1Y\":0.245565,\"3M\":0.257677,\"6M\":0.255867,\"9M\":0.249841},\"11006\":{\"1Y\":0.289713,\"3M\":0.314453,\"6M\":0.304152,\"9M\":0.293391},\"11007\":{\"1Y\":0.334021,\"3M\":0.345543,\"6M\":0.344678,\"9M\":0.336826},\"11008\":{\"1Y\":1863691.056911,\"3M\":717829.268293,\"6M\":1131439.655172,\"9M\":1522887.931034},\"11009\":{\"1Y\":1.276063,\"3M\":1.242011},\"11010\":{\"1Y\":1.08967,\"3M\":1.105918},\"11011\":{\"1Y\":0.420347,\"3M\":0.425699},\"11012\":{\"1Y\":28.588894,\"3M\":37.825613,\"6M\":37.837915,\"9M\":31.278817},\"11013\":{\"1Y\":0.725171,\"3M\":0.741246},\"11014\":{\"1Y\":2.799906,\"3M\":2.901547},\"11015\":{\"1Y\":0.862981,\"3M\":0.873045},\"11016\":{\"1Y\":0.210924,\"3M\":0.227255,\"6M\":0.220348,\"9M\":0.213054},\"12001\":{\"1Y\":26.77225,\"3M\":21.348819},\"12002\":{\"1Y\":9.04038,\"3M\":7.782452},\"12003\":{\"1Y\":111.717979,\"3M\":93.995168},\"12004\":{\"1Y\":-75.905349,\"3M\":-64.863898},\"12005\":{\"1Y\":13.63352,\"3M\":4.274241},\"12006\":{\"1Y\":40.37441,\"3M\":11.725097},\"12007\":{\"1Y\":3.267155,\"3M\":0.970795},\"12008\":{\"1Y\":7.54146,\"3M\":2.617562},\"12009\":{\"1Y\":0.657769,\"3M\":0.225781},\"12010\":{\"1Y\":0.368675,\"3M\":0.146328},\"12011\":{\"1Y\":0.138739,\"3M\":0.05131},\"12012\":{\"1Y\":0.198619,\"3M\":0.076213},\"12013\":{\"1Y\":0.221621},\"12014\":{\"1Y\":1.050712},\"12015\":{\"1Y\":0.055816},\"12016\":{\"1Y\":0.308218,\"3M\":0.300889},\"12017\":{\"1Y\":0.357155,\"3M\":0.344644},\"12018\":{\"1Y\":-0.05558,\"3Y\":0.092478,\"5Y\":0.063565},\"12019\":{\"1Y\":0.046557,\"3Y\":0.077277,\"5Y\":0.051324},\"12020\":{\"5Y\":0.387636},\"12021\":{\"5Y\":0.21682},\"12022\":{\"5Y\":0.2921},\"12023\":{\"5Y\":0.21682},\"12024\":{\"5Y\":0.368541},\"12025\":{\"5Y\":0.173178},\"12026\":{\"5Y\":0.25081},\"12027\":{\"1Y\":0.215495,\"3M\":0.080492},\"12028\":{\"5Y\":0.073938},\"12029\":{\"1Y\":0.73582,\"3M\":0.66633},\"12030\":{\"1Y\":0.197648,\"3M\":0.189661},\"12031\":{\"1Y\":-0.167104},\"12032\":{\"1Y\":0.798814},\"12033\":{\"1Y\":0.045209,\"3Y\":0.063163,\"5Y\":0.025464},\"12034\":{\"1Y\":0.166725,\"3Y\":0.174189,\"5Y\":0.163445},\"12035\":{\"1Y\":0.24729,\"3Y\":0.261121,\"5Y\":0.330561},\"12036\":{\"1Y\":0.271675,\"3Y\":0.397168,\"5Y\":-0.353908},\"12037\":{\"1Y\":-0.134328,\"3Y\":0.230188,\"5Y\":-0.005337},\"12038\":{\"1Y\":0.044127,\"3Y\":0.073967,\"5Y\":0.055244},\"12039\":{\"1Y\":0.148767,\"3Y\":0.089685,\"5Y\":0.348356},\"12040\":{\"3Y\":-0.244538,\"5Y\":-0.167353},\"12042\":{\"1Y\":-0.056634,\"3Y\":0.057144,\"5Y\":-0.031283},\"12043\":{\"1Y\":8.23191,\"3M\":3.161621},\"12044\":{\"1Y\":393097.560976,\"3M\":163130.081301}},\"EarningRatios\":{\"13015\":{\"1Y\":0.108303,\"3Y\":0.126073,\"3M\":0.879227,\"5Y\":0.078662},\"13016\":{\"1Y\":0.108303,\"3Y\":0.126073,\"3M\":0.879227,\"5Y\":0.078662},\"13017\":{\"1Y\":0.100917,\"3Y\":0.098323,\"5Y\":0.446814},\"13018\":{\"1Y\":0.08802,\"3M\":0.055064,\"3Y\":0.112037,\"5Y\":0.077788},\"13019\":{\"5Y\":0.182419},\"13020\":{\"1Y\":0.017824,\"3Y\":0.05879,\"5Y\":0.090795},\"13021\":{\"1Y\":0.08802,\"3M\":0.055064,\"3Y\":0.112037,\"5Y\":0.077788},\"13022\":{\"1Y\":0.108303,\"3M\":0.879227,\"3Y\":0.126073,\"5Y\":0.078662},\"13023\":{\"1Y\":0.11018,\"3M\":0.875598,\"3Y\":0.12619,\"5Y\":0.077682}},\"ValuationRatios\":{\"14000\":0.2526,\"14001\":0.2771,\"14002\":0.0614,\"14003\":45.9147,\"14004\":27.6308,\"14005\":12.4122,\"14006\":10.0435,\"14007\":0.0589,\"14008\":16.967146,\"14009\":0.2778,\"14010\":3.599285,\"14011\":0.1672,\"14012\":5.981008,\"14013\":0.0751,\"14014\":13.314297,\"14015\":0.0608,\"14016\":16.454423,\"14017\":0.0152,\"14018\":0.0152,\"14019\":0.0673,\"14020\":14.8588,\"14021\":1.0831,\"14022\":7.6441,\"14023\":26.0466,\"14024\":22.4888,\"14025\":20.7923,\"14026\":2.52,\"14027\":5.5227,\"14028\":4.12,\"14029\":3.5949,\"14030\":11.1327,\"14031\":0.0377,\"14032\":0.0529,\"14033\":14.587638,\"14034\":0.98498,\"14035\":16.967146,\"14036\":10.844009,\"14037\":0.0185,\"14038\":0.4026,\"14039\":0.1388,\"14040\":0.0779,\"14041\":12.8307,\"14042\":\"Annual\",\"14046\":80.172,\"14048\":3.6951,\"14049\":13.2027,\"14050\":2.1725,\"14051\":16.8924,\"14052\":12.7215,\"14055\":11.245,\"14056\":3.4046,\"14057\":13.2686,\"14058\":0.050374,\"14059\":0.141772,\"14060\":0.038533,\"14061\":-0.073007,\"14066\":10.81213,\"14067\":9.342452,\"14068\":13.012047,\"14069\":3.205991,\"14070\":2.239533,\"14071\":0.137738,\"14072\":0.132097,\"14073\":0.48395,\"14074\":0.071323,\"14075\":-0.22455,\"14094\":27.1701,\"14095\":0.042224,\"14096\":0.140617,\"14097\":0.02323,\"14098\":-0.081277,\"14103\":0.111543,\"14104\":0.14592,\"14105\":0.106645,\"14106\":0.023615,\"14111\":-0.068157,\"14112\":-0.028562,\"14113\":-0.022896,\"14114\":-0.068028,\"14119\":12.8601,\"14120\":10.3738,\"14121\":0.1422,\"14122\":0.1578,\"14123\":2.159659},\"DataType\":3}"
  },
  {
    "path": "Tests/TestData/alpha_indicator_datatest.csv",
    "content": "Symbol,Date,High,Low,Open,Close,Volume,Adj Close,Alpha\nAMZN,20211004,3279.989990234375,3176.25,3279.389892578125,3189.780029296875,4523100,3189.780029296875,0.0\nSPX,20211004,4355.509765625,4278.93994140625,4348.83984375,4300.4599609375,3110560000,4300.4599609375,0.0\nAMZN,20211005,3260.72998046875,3202.4599609375,3204.5,3221.0,3269200,3221.0,0.0\nSPX,20211005,4369.22998046875,4309.8701171875,4309.8701171875,4345.72021484375,2967400000,4345.72021484375,0.0\nAMZN,20211006,3264.340087890625,3198.6201171875,3213.530029296875,3262.010009765625,2533000,3262.010009765625,0.0\nSPX,20211006,4365.56982421875,4290.490234375,4319.56982421875,4363.5498046875,3219590000,4363.5498046875,0.0\nAMZN,20211007,3325.75,3283.06005859375,3291.5400390625,3302.429931640625,2409100,3302.429931640625,0.0\nSPX,20211007,4429.97021484375,4383.72998046875,4383.72998046875,4399.759765625,3096080000,4399.759765625,0.0\nAMZN,20211008,3321.429931640625,3288.199951171875,3317.0,3288.6201171875,1995500,3288.6201171875,0.0\nSPX,20211008,4412.02001953125,4386.22021484375,4406.509765625,4391.33984375,2401890000,4391.33984375,0.0\nAMZN,20211011,3292.590087890625,3238.10009765625,3275.0,3246.300048828125,2034200,3246.300048828125,0.0\nSPX,20211011,4415.8798828125,4360.58984375,4385.43994140625,4361.18994140625,2580000000,4361.18994140625,-0.0005767183\nAMZN,20211012,3267.530029296875,3236.280029296875,3257.0,3247.330078125,1819600,3247.330078125,-0.0005767183\nSPX,20211012,4374.89013671875,4342.08984375,4368.31005859375,4350.64990234375,2608150000,4350.64990234375,0.0012562599\nAMZN,20211013,3288.3798828125,3261.090087890625,3269.7099609375,3284.280029296875,2420100,3284.280029296875,0.0012562599\nSPX,20211013,4372.8701171875,4329.919921875,4358.009765625,4363.7998046875,2926460000,4363.7998046875,0.0013642896\nAMZN,20211014,3312.60009765625,3290.780029296875,3302.449951171875,3299.860107421875,2109500,3299.860107421875,0.0013642896\nSPX,20211014,4439.72998046875,4386.75,4386.75,4438.259765625,2642920000,4438.259765625,-0.0012270947\nAMZN,20211015,3410.419921875,3304.0,3311.419921875,3409.02001953125,5175100,3409.02001953125,-0.0012270947\nSPX,20211015,4475.81982421875,4447.68994140625,4447.68994140625,4471.3701171875,3000560000,4471.3701171875,0.0039591224\nAMZN,20211018,3449.169921875,3385.10009765625,3388.360107421875,3446.739990234375,3174100,3446.739990234375,0.0039591224\nSPX,20211018,4488.75,4447.47021484375,4463.72021484375,4486.4599609375,2683540000,4486.4599609375,0.0106741968\nAMZN,20211019,3454.68994140625,3422.0,3434.2900390625,3444.14990234375,2386100,3444.14990234375,0.0106741968\nSPX,20211019,4520.39990234375,4496.41015625,4497.33984375,4519.6298828125,2531210000,4519.6298828125,0.0156123035\nAMZN,20211020,3462.860107421875,3400.3701171875,3452.659912109375,3415.06005859375,2139800,3415.06005859375,0.0156123035\nSPX,20211020,4540.8701171875,4524.39990234375,4524.419921875,4536.18994140625,2671560000,4536.18994140625,0.0067115384\nAMZN,20211021,3440.280029296875,3403.0,3414.25,3435.010009765625,1881400,3435.010009765625,0.0067115384\nSPX,20211021,4551.43994140625,4526.89013671875,4532.240234375,4549.77978515625,3016950000,4549.77978515625,-0.0071266806\nAMZN,20211022,3429.840087890625,3331.300048828125,3421.0,3335.550048828125,3139100,3335.550048828125,-0.0071266806\nSPX,20211022,4559.669921875,4524.0,4546.1201171875,4544.89990234375,3062810000,4544.89990234375,-0.0150219079\nAMZN,20211025,3347.800048828125,3297.699951171875,3335.0,3320.3701171875,2226000,3320.3701171875,-0.0150219079\nSPX,20211025,4572.6201171875,4537.35986328125,4553.68994140625,4566.47998046875,3250210000,4566.47998046875,-0.0187079888\nAMZN,20211026,3416.1201171875,3343.97998046875,3349.510009765625,3376.070068359375,2698300,3376.070068359375,-0.0187079888\nSPX,20211026,4598.52978515625,4569.169921875,4578.68994140625,4574.7900390625,2866500000,4574.7900390625,-0.012869384\nAMZN,20211027,3437.0,3371.449951171875,3388.0,3392.489990234375,2702200,3392.489990234375,-0.012869384\nSPX,20211027,4584.56982421875,4551.66015625,4580.22021484375,4551.68017578125,3259510000,4551.68017578125,-0.0016360681\nAMZN,20211028,3479.0,3386.0,3402.10009765625,3446.570068359375,5708700,3446.570068359375,-0.0016360681\nSPX,20211028,4597.5498046875,4562.83984375,4562.83984375,4596.419921875,3197560000,4596.419921875,-0.0018125424\nAMZN,20211029,3374.820068359375,3273.320068359375,3300.02001953125,3372.429931640625,6469500,3372.429931640625,-0.0018125424\nSPX,20211029,4608.080078125,4567.58984375,4572.8701171875,4605.3798828125,3632260000,4605.3798828125,0.0007397001\nAMZN,20211101,3375.860107421875,3292.02001953125,3361.800048828125,3318.110107421875,3608900,3318.110107421875,0.0007397001\nSPX,20211101,4620.33984375,4595.06005859375,4610.6201171875,4613.669921875,2924000000,4613.669921875,-0.0017179984\nAMZN,20211102,3331.1201171875,3283.550048828125,3315.010009765625,3312.75,2627600,3312.75,-0.0017179984\nSPX,20211102,4635.14990234375,4613.33984375,4613.33984375,4630.64990234375,3309690000,4630.64990234375,-0.0058533229\nAMZN,20211103,3394.919921875,3297.52001953125,3309.0,3384.0,3397200,3384.0,-0.0058533229\nSPX,20211103,4663.4599609375,4621.18994140625,4630.64990234375,4660.56982421875,3339440000,4660.56982421875,-0.0235832886\nAMZN,20211104,3498.6298828125,3365.0,3370.0,3477.0,5346300,3477.0,-0.0235832886\nSPX,20211104,4683.0,4662.58984375,4662.93017578125,4680.06005859375,3332940000,4680.06005859375,-0.033398299\nAMZN,20211105,3566.25,3476.97998046875,3477.0,3549.01953125,2937769,3549.01953125,-0.033398299\nSPX,20211105,4718.5,4699.259765625,4699.259765625,4701.85986328125,1462781000,4701.85986328125,-0.0260208999\n"
  },
  {
    "path": "Tests/TestData/arms_data.txt",
    "content": "Date,Symbol,Open,High,Low,Close,Volume,A/D Ratio,A/D Volume Ratio,TRIN,A/D Difference\n20190102,AAPL,1548900,1588500,1542400,1579200,28370261,0,0,0.0000000000 ,0\n20190102,GOOG,10171300,10524000,10141300,10458600,1219740,0,0,0.0000000000 ,0\n20190102,IBM,1120000,1159800,1116900,1151900,3244233,0,0,0.0000000000 ,0\n20190103,AAPL,1439500,1457500,1420000,1420900,83238505,0,0,0.0000000000 ,0\n20190103,GOOG,10410000,10567700,10140300,10151900,1468159,0,0,0.0000000000 ,0\n20190103,IBM,1145300,1148500,1126900,1129300,3401399,0,0,0.0000000000 ,-3\n20190104,AAPL,1445800,1485400,1438000,1482600,52261612,0,0,0.0000000000 ,-3\n20190104,GOOG,10330000,10708600,10275600,10707100,1722662,0,0,0.0000000000 ,-3\n20190104,IBM,1149100,1174900,1144800,1172900,3814850,3,57799124,0.0000000519 ,3\n20190107,AAPL,1486300,1488300,1459000,1478900,50933385,3,57799124,0.0000000519 ,3\n20190107,GOOG,10715000,10740000,10539600,10683900,1709957,3,57799124,0.0000000519 ,3\n20190107,IBM,1175000,1188300,1167100,1181000,3247405,0.5,0.061686908,8.1054475940 ,-1\n20190108,AAPL,1493400,1518200,1485200,1507700,37363174,0.5,0.061686908,8.1054475940 ,-1\n20190108,GOOG,10761100,10847800,10603000,10765300,1332941,0.5,0.061686908,8.1054475940 ,-1\n20190108,IBM,1196600,1205400,1189800,1198600,3942624,3,42638739,0.0000000704 ,3\n20190109,AAPL,1511600,1545300,1496300,1533100,41636996,3,42638739,0.0000000704 ,3\n20190109,GOOG,10813400,10826400,10664000,10745400,1027741,3,42638739,0.0000000704 ,3\n20190109,IBM,1209100,1213900,1198800,1206400,3083182,2,43.5130816,0.0459631890 ,1\n20190110,AAPL,1524500,1539700,1508600,1538000,33478211,2,43.5130816,0.0459631890 ,1\n20190110,GOOG,10699900,10711500,10576800,10692200,1110320,2,43.5130816,0.0459631890 ,1\n20190110,IBM,1201600,1218600,1199500,1217400,3176528,2,33.01277019,0.0605826170 ,1\n20190111,AAPL,1528100,1537000,1515100,1523000,23450358,2,33.01277019,0.0605826170 ,1\n20190111,GOOG,10619100,10647300,10484800,10571700,1321465,2,33.01277019,0.0605826170 ,1\n20190111,IBM,1215800,1215800,1202200,1214300,2901424,0,0,0.0000000000 ,-3\n20190114,AAPL,1508700,1512700,1492200,1499900,27532102,0,0,0.0000000000 ,-3\n20190114,GOOG,10469200,10515300,10413000,10444800,966733,0,0,0.0000000000 ,-3\n20190114,IBM,1205100,1206400,1198000,1203400,4254599,0,0,0.0000000000 ,-3\n20190115,AAPL,1502700,1533900,1500500,1530500,26284167,0,0,0.0000000000 ,-3\n20190115,GOOG,10509100,10800500,10470500,10768600,1231237,0,0,0.0000000000 ,-3\n20190115,IBM,1209600,1219300,1208200,1217000,3088304,3,30603708,0.0000000980 ,3\n20190116,AAPL,1530000,1558800,1530000,1549200,27673320,3,30603708,0.0000000980 ,3\n20190116,GOOG,10787800,10920900,10787800,10807700,1112963,3,30603708,0.0000000980 ,3\n20190116,IBM,1215800,1220000,1208300,1215700,3235296,2,8.897573205,0.2247803930 ,1\n20190117,AAPL,1542200,1576500,1532600,1558600,27463983,2,8.897573205,0.2247803930 ,1\n20190117,GOOG,10794700,10918000,10741800,10912900,852114,2,8.897573205,0.2247803930 ,1\n20190117,IBM,1205600,1224000,1205500,1221800,3936493,3,32252590,0.0000000930 ,3\n20190118,AAPL,1575200,1578800,1559900,1568200,28994344,3,32252590,0.0000000930 ,3\n20190118,GOOG,10983300,11086000,10906900,10982500,1571248,3,32252590,0.0000000930 ,3\n20190118,IBM,1232700,1247000,1227200,1238300,5079604,3,35645196,0.0000000842 ,3\n20190122,AAPL,1564000,1567300,1526200,1536900,25079137,3,35645196,0.0000000842 ,3\n20190122,GOOG,10887700,10913200,10634700,10710800,1113354,3,35645196,0.0000000842 ,3\n20190122,IBM,1232200,1238000,1215400,1223700,6851547,0,0,0.0000000000 ,-3\n20190123,AAPL,1541200,1551400,1517000,1539700,20692626,0,0,0.0000000000 ,-3\n20190123,GOOG,10786700,10849300,10593100,10758500,866412,0,0,0.0000000000 ,-3\n20190123,IBM,1312500,1350000,1303200,1328900,20736688,3,42295726,0.0000000709 ,3\n20190124,AAPL,1539400,1544800,1517400,1527100,21201995,3,42295726,0.0000000709 ,3\n20190124,GOOG,10741100,10791700,10606500,10743300,896027,3,42295726,0.0000000709 ,3\n20190124,IBM,1326100,1332000,1314500,1325100,5563047,0,0,0.0000000000 ,-3\n20190125,AAPL,1552800,1581400,1543200,1577200,30695002,0,0,0.0000000000 ,-3\n20190125,GOOG,10844400,10940000,10813900,10909900,949640,0,0,0.0000000000 ,-3\n20190125,IBM,1328700,1344400,1324300,1339900,5155390,3,36800032,0.0000000815 ,3\n20190128,AAPL,1555300,1563300,1536700,1563000,22548976,3,36800032,0.0000000815 ,3\n20190128,GOOG,10801100,10830500,10634700,10702500,1082572,3,36800032,0.0000000815 ,3\n20190128,IBM,1331000,1348100,1326000,1343100,4265756,0.5,0.180511069,2.7699132400 ,-1\n20190129,AAPL,1562000,1581300,1541100,1546600,31507605,0.5,0.180511069,2.7699132400 ,-1\n20190129,GOOG,10722300,10751500,10556600,10602300,834511,0.5,0.180511069,2.7699132400 ,-1\n20190129,IBM,1342900,1354100,1336000,1343400,4141354,0.5,0.128048332,3.9047755810 ,-1\n20190130,AAPL,1632800,1661500,1602300,1652400,55940805,0.5,0.128048332,3.9047755810 ,-1\n20190130,GOOG,10672400,10911900,10668500,10894200,1072214,0.5,0.128048332,3.9047755810 ,-1\n20190130,IBM,1340000,1350300,1332500,1344100,3939387,3,60952406,0.0000000492 ,3\n20190131,AAPL,1661100,1690000,1645600,1663400,32499436,3,60952406,0.0000000492 ,3\n20190131,GOOG,11044700,11173400,10950000,11161800,1260420,3,60952406,0.0000000492 ,3\n20190131,IBM,1344500,1346500,1337400,1344000,3337118,2,10.11647056,0.1976974070 ,1\n20190201,AAPL,1669300,1689800,1659300,1665400,26100838,2,10.11647056,0.1976974070 ,1\n20190201,GOOG,11125600,11250000,11045600,11102300,1143535,2,10.11647056,0.1976974070 ,1\n20190201,IBM,1349700,1351900,1333500,1340800,3312237,0.5,5.85775888,0.0853568760 ,-1\n20190204,AAPL,1674800,1716600,1672800,1712700,27747804,0.5,5.85775888,0.0853568760 ,-1\n20190204,GOOG,11120000,11325000,11090000,11325000,1878894,0.5,5.85775888,0.0853568760 ,-1\n20190204,IBM,1340200,1351800,1329900,1351800,3316380,3,32943078,0.0000000911 ,3\n20190205,AAPL,1728600,1750800,1723500,1741000,32540764,3,32943078,0.0000000911 ,3\n20190205,GOOG,11235900,11469200,11170300,11460000,3104755,3,32943078,0.0000000911 ,3\n20190205,IBM,1352800,1358100,1349300,1355300,3190321,3,38835840,0.0000000772 ,3\n20190206,AAPL,1747000,1755700,1728600,1742800,26390527,3,38835840,0.0000000772 ,3\n20190206,GOOG,11415000,11470000,11127600,11152300,1845545,3,38835840,0.0000000772 ,3\n20190206,IBM,1352200,1366500,1351700,1363300,4333342,2,16.64758594,0.1201375390 ,1\n20190207,AAPL,1723900,1739400,1703400,1709900,29006527,2,16.64758594,0.1201375390 ,1\n20190207,GOOG,11048400,11049300,10860000,10987100,1766403,2,16.64758594,0.1201375390 ,1\n20190207,IBM,1336200,1344600,1321200,1332000,3937685,0,0,0.0000000000 ,-3\n20190208,AAPL,1688800,1706600,1684200,1705000,21210282,0,0,0.0000000000 ,-3\n20190208,GOOG,10868700,10990000,10864400,10950800,871200,0,0,0.0000000000 ,-3\n20190208,IBM,1325500,1337000,1321900,1337000,2394720,0.5,0.108449243,4.6104517300 ,-1\n20190211,AAPL,1710500,1712100,1692500,1694500,18366473,0.5,0.108449243,4.6104517300 ,-1\n20190211,GOOG,10968000,11060000,10928300,10950100,785879,0.5,0.108449243,4.6104517300 ,-1\n20190211,IBM,1342900,1351200,1340000,1340100,2449210,0.5,0.127880377,3.9099040190 ,-1\n20190212,AAPL,1701300,1710000,1697000,1708900,19540639,0.5,0.127880377,3.9099040190 ,-1\n20190212,GOOG,11056000,11253500,11052600,11212200,1471781,0.5,0.127880377,3.9099040190 ,-1\n20190212,IBM,1351500,1361900,1348700,1360300,2894463,3,23906883,0.0000001255 ,3\n20190213,AAPL,1714300,1724800,1699200,1701700,20022816,3,23906883,0.0000001255 ,3\n20190213,GOOG,11248600,11348000,11185000,11205800,939841,3,23906883,0.0000001255 ,3\n20190213,IBM,1369400,1379100,1365100,1375100,3675941,0.5,0.175356635,2.8513320870 ,-1\n20190214,AAPL,1697600,1712700,1693900,1707900,18491122,0.5,0.175356635,2.8513320870 ,-1\n20190214,GOOG,11180500,11283500,11100000,11216300,855272,0.5,0.175356635,2.8513320870 ,-1\n20190214,IBM,1372300,1375900,1362100,1364800,2394993,2,8.077849914,0.2475906360 ,1\n20190215,AAPL,1712200,1717000,1697500,1703800,21513915,2,8.077849914,0.2475906360 ,1\n20190215,GOOG,11297700,11316700,11105800,11135800,1222931,2,8.077849914,0.2475906360 ,1\n20190215,IBM,1377000,1381900,1373900,1380300,3078927,0.5,0.135415748,3.6923327410 ,-1\n20190219,AAPL,1697200,1714400,1694300,1709400,16853497,0.5,0.135415748,3.6923327410 ,-1\n20190219,GOOG,11104400,11218600,11099600,11188100,878344,0.5,0.135415748,3.6923327410 ,-1\n20190219,IBM,1378100,1387000,1373600,1387000,2740525,3,20472366,0.0000001465 ,3\n20190220,AAPL,1711900,1733200,1709900,1720900,22718221,3,20472366,0.0000001465 ,3\n20190220,GOOG,11199900,11233600,11053000,11144300,912517,3,20472366,0.0000001465 ,3\n20190220,IBM,1387600,1392200,1372300,1380300,2989005,0.5,5.822912443,0.0858676830 ,-1\n20190221,AAPL,1718000,1723700,1703100,1711400,15778960,0.5,5.822912443,0.0858676830 ,-1\n20190221,GOOG,11111100,11119800,10923500,10971200,1103655,0.5,5.822912443,0.0858676830 ,-1\n20190221,IBM,1378200,1383300,1373800,1378400,2378211,0,0,0.0000000000 ,-3\n20190222,AAPL,1716000,1730000,1713800,1729700,15409727,0,0,0.0000000000 ,-3\n20190222,GOOG,11024600,11112500,10950000,11106300,886859,0,0,0.0000000000 ,-3\n20190222,IBM,1387300,1393600,1384500,1392600,2550451,3,18847037,0.0000001592 ,3\n20190225,AAPL,1739900,1758700,1739400,1742500,19691132,3,18847037,0.0000001592 ,3\n20190225,GOOG,11170400,11187700,11072300,11089700,1243148,3,18847037,0.0000001592 ,3\n20190225,IBM,1400000,1404500,1393200,1394300,2577238,2,17.91288728,0.1116514590 ,1\n20190226,AAPL,1737100,1753000,1731600,1743500,14731642,2,17.91288728,0.1116514590 ,1\n20190226,GOOG,11057500,11196000,10995800,11149300,1068777,2,17.91288728,0.1116514590 ,1\n20190226,IBM,1396700,1404600,1394800,1397300,2503496,3,18303915,0.0000001639 ,3\n20190227,AAPL,1732500,1750000,1727300,1748800,23019795,3,18303915,0.0000001639 ,3\n20190227,GOOG,11093100,11179900,11010000,11162500,864775,3,18303915,0.0000001639 ,3\n20190227,IBM,1392500,1395600,1384300,1391500,2069284,2,11.54243207,0.1732737080 ,1\n20190228,AAPL,1743200,1749100,1729100,1732000,19986497,2,11.54243207,0.1732737080 ,1\n20190228,GOOG,11118400,11276800,11108300,11206500,1121226,2,11.54243207,0.1732737080 ,1\n20190228,IBM,1387500,1390000,1377300,1381200,2490995,0.5,0.049882167,10.0236222700 ,-1\n20190301,AAPL,1742800,1751500,1728900,1749700,21191283,0.5,0.049882167,10.0236222700 ,-1\n20190301,GOOG,11257300,11429900,11243500,11414700,1283817,0.5,0.049882167,10.0236222700 ,-1\n20190301,IBM,1393100,1400400,1386400,1391700,2598921,3,25074021,0.0000001196 ,3\n20190304,AAPL,1756800,1777500,1739700,1758600,24418623,3,25074021,0.0000001196 ,3\n20190304,GOOG,11461000,11582500,11306200,11478000,1261341,3,25074021,0.0000001196 ,3\n20190304,IBM,1399900,1400800,1371700,1385000,2661368,2,9.64915938,0.2072719420 ,1\n20190305,AAPL,1759200,1760000,1745400,1755100,15511056,2,9.64915938,0.2072719420 ,1\n20190305,GOOG,11515000,11695200,11460500,11616200,1318441,2,9.64915938,0.2072719420 ,1\n20190305,IBM,1383700,1387200,1375600,1379300,2294783,0.5,0.07404543,6.7526112010 ,-1\n20190306,AAPL,1747600,1754900,1739400,1745100,17521402,0.5,0.07404543,6.7526112010 ,-1\n20190306,GOOG,11647800,11672400,11554900,11579600,912091,0.5,0.07404543,6.7526112010 ,-1\n20190306,IBM,1380600,1383600,1367200,1369800,2351144,0,0,0.0000000000 ,-3\n20190307,AAPL,1739100,1744400,1720200,1724700,20419582,0,0,0.0000000000 ,-3\n20190307,GOOG,11539100,11568600,11347500,11435300,1013586,0,0,0.0000000000 ,-3\n20190307,IBM,1366100,1368900,1346500,1353600,3620161,0,0,0.0000000000 ,-3\n20190308,AAPL,1702800,1730800,1695000,1729200,19651510,0,0,0.0000000000 ,-3\n20190308,GOOG,11259800,11471900,11231500,11427400,1018262,0,0,0.0000000000 ,-3\n20190308,IBM,1342500,1352400,1336100,1350400,3403914,0.5,4.443855242,0.1125149160 ,-1\n20190311,AAPL,1754900,1791300,1753500,1789800,26548756,0.5,4.443855242,0.1125149160 ,-1\n20190311,GOOG,11457500,11761900,11441400,11757600,1384014,0.5,4.443855242,0.1125149160 ,-1\n20190311,IBM,1360300,1377300,1358400,1377200,3259429,3,31192199,0.0000000962 ,3\n20190312,AAPL,1799300,1826700,1793700,1809400,27622968,3,31192199,0.0000000962 ,3\n20190312,GOOG,11782400,12000000,11782400,11927700,1869564,3,31192199,0.0000000962 ,3\n20190312,IBM,1385700,1396900,1378600,1382800,3129203,3,32621735,0.0000000920 ,3\n20190313,AAPL,1822900,1832900,1809200,1817200,24264018,3,32621735,0.0000000920 ,3\n20190313,GOOG,11999900,12019900,11919400,11933100,1313900,3,32621735,0.0000000920 ,3\n20190313,IBM,1382800,1393200,1378600,1385400,2527701,3,28105619,0.0000001067 ,3\n20190314,AAPL,1839100,1841000,1825600,1837300,19549079,3,28105619,0.0000001067 ,3\n20190314,GOOG,11945100,11979600,11844800,11858000,994417,3,28105619,0.0000001067 ,3\n20190314,IBM,1385100,1389300,1380700,1388000,2128787,2,21.79957302,0.0917449160 ,1\n20190315,AAPL,1847800,1873300,1837400,1862100,32967677,2,21.79957302,0.0917449160 ,1\n20190315,GOOG,11921900,11966200,11825500,11852400,1784155,2,21.79957302,0.0917449160 ,1\n20190315,IBM,1395800,1403300,1392500,1394300,3635412,2,20.5156441,0.0974865810 ,1\n20190318,AAPL,1858100,1883900,1857900,1880200,22763260,2,20.5156441,0.0974865810 ,1\n20190318,GOOG,11830100,11901900,11773700,11844500,981951,2,20.5156441,0.0974865810 ,1\n20190318,IBM,1398300,1403700,1387200,1402500,2710158,2,25.94163864,0.0770961320 ,1\n20190319,AAPL,1882400,1889900,1859200,1865400,27185557,2,25.94163864,0.0770961320 ,1\n20190319,GOOG,11873100,12004500,11858000,11995500,1034017,2,25.94163864,0.0770961320 ,1\n20190319,IBM,1409600,1417000,1400100,1405300,2654092,2,0.135664279,14.7422742000 ,1\n20190320,AAPL,1862800,1894900,1847300,1881700,27274230,2,0.135664279,14.7422742000 ,1\n20190320,GOOG,11976500,12272500,11960400,12240100,1692662,2,0.135664279,14.7422742000 ,1\n20190320,IBM,1405300,1407000,1389900,1396200,2813292,2,10.2964399,0.1942418950 ,1\n20190321,AAPL,1900200,1963200,1898100,1950500,43361081,2,10.2964399,0.1942418950 ,1\n20190321,GOOG,12169400,12318200,12136700,12317900,919910,2,10.2964399,0.1942418950 ,1\n20190321,IBM,1390000,1421200,1390000,1414500,2821095,3,47102086,0.0000000637 ,3\n20190322,AAPL,1953400,1976900,1907700,1910600,38667194,3,47102086,0.0000000637 ,3\n20190322,GOOG,12263200,12305300,12026500,12059200,1486536,3,47102086,0.0000000637 ,3\n20190322,IBM,1409700,1414400,1389100,1394600,3148502,0,0,0.0000000000 ,-3\n20190325,AAPL,1917100,1919800,1866000,1887700,40970851,0,0,0.0000000000 ,-3\n20190325,GOOG,11976400,12065400,11869800,11924100,1185757,0,0,0.0000000000 ,-3\n20190325,IBM,1390600,1399000,1383600,1392000,2328678,0,0,0.0000000000 ,-3\n20190326,AAPL,1914900,1928800,1845900,1867900,43987220,0,0,0.0000000000 ,-3\n20190326,GOOG,11996100,12029700,11768000,11848500,1784154,0,0,0.0000000000 ,-3\n20190326,IBM,1399300,1410200,1394200,1402200,2009766,0.5,0.043908798,11.3872395200 ,-1\n20190327,AAPL,1888400,1897600,1865400,1885000,26785493,0.5,0.043908798,11.3872395200 ,-1\n20190327,GOOG,11876300,11876300,11591400,11730600,1251820,0.5,0.043908798,11.3872395200 ,-1\n20190327,IBM,1402600,1404800,1384100,1392400,2381589,0.5,7.37200051,0.0678241950 ,-1\n20190328,AAPL,1889300,1895600,1875300,1887100,19466097,0.5,7.37200051,0.0678241950 ,-1\n20190328,GOOG,11698300,11717000,11595000,11684900,878223,0.5,7.37200051,0.0678241950 ,-1\n20190328,IBM,1399100,1404400,1391100,1399500,1901090,2,24.33002438,0.0822029590 ,1\n20190329,AAPL,1899500,1900800,1885400,1899400,18639099,2,24.33002438,0.0822029590 ,1\n20190329,GOOG,11756900,11794200,11628000,11731100,971516,2,24.33002438,0.0822029590 ,1\n20190329,IBM,1405000,1412100,1401500,1411100,2086371,3,21696986,0.0000001383 ,3\n20190401,AAPL,1916400,1916800,1883800,1912400,23096523,3,21696986,0.0000001383 ,3\n20190401,GOOG,11840700,11968000,11818400,11941500,1030256,3,21696986,0.0000001383 ,3\n20190401,IBM,1415100,1433900,1415100,1432400,3079888,3,27206667,0.0000001103 ,3\n20190402,AAPL,1910500,1944600,1910500,1940400,20026095,3,27206667,0.0000001103 ,3\n20190402,GOOG,11957500,12013500,11858100,12004200,616071,3,27206667,0.0000001103 ,3\n20190402,IBM,1431300,1439500,1426000,1430100,2058194,2,10.02926158,0.1994164760 ,1\n20190403,AAPL,1932500,1965000,1931500,1953500,20033154,2,10.02926158,0.1994164760 ,1\n20190403,GOOG,12078400,12163300,12005000,12053300,861858,2,10.02926158,0.1994164760 ,1\n20190403,IBM,1436500,1442200,1430200,1436000,2321998,3,23217010,0.0000001292 ,3\n20190404,AAPL,1948900,1963700,1931400,1957200,17224373,3,23217010,0.0000001292 ,3\n20190404,GOOG,12060000,12160900,12041300,12146800,786602,3,23217010,0.0000001292 ,3\n20190404,IBM,1436200,1441400,1425500,1427600,2466019,2,7.303664327,0.2738351480 ,1\n20190405,AAPL,1964100,1971000,1959300,1969700,16026098,2,7.303664327,0.2738351480 ,1\n20190405,GOOG,12147000,12162200,12050000,12071400,760551,2,7.303664327,0.2738351480 ,1\n20190405,IBM,1432900,1435000,1424600,1433100,2353774,2,24.16652138,0.0827591180 ,1\n20190408,AAPL,1964200,2002300,1963300,2000800,23831141,2,24.16652138,0.0827591180 ,1\n20190408,GOOG,12071500,12085000,11997800,12038400,730048,2,24.16652138,0.0827591180 ,1\n20190408,IBM,1430200,1434200,1428800,1433700,1804889,2,35.11554035,0.0569548410 ,1\n20190409,AAPL,2003400,2028500,1992300,1995000,33104131,2,35.11554035,0.0569548410 ,1\n20190409,GOOG,11960000,12022900,11935000,11981300,696431,2,35.11554035,0.0569548410 ,1\n20190409,IBM,1427600,1429500,1418400,1422100,2473930,0,0,0.0000000000 ,-3\n20190410,AAPL,1987400,2007400,1981800,2006600,20023619,0,0,0.0000000000 ,-3\n20190410,GOOG,12002600,12039200,11962800,12021600,614098,0,0,0.0000000000 ,-3\n20190410,IBM,1422000,1435000,1420100,1430400,2008464,3,22646181,0.0000001325 ,3\n20190411,AAPL,2008500,2010000,1984500,1989400,18037895,3,22646181,0.0000001325 ,3\n20190411,GOOG,12047100,12079800,12002300,12046200,530110,3,22646181,0.0000001325 ,3\n20190411,IBM,1438000,1441100,1430900,1438100,2467900,2,0.166206201,12.0332453800 ,1\n20190412,AAPL,1992300,2001400,1962100,1988900,25108070,2,0.166206201,12.0332453800 ,1\n20190412,GOOG,12093000,12184200,12081200,12178600,822510,2,0.166206201,12.0332453800 ,1\n20190412,IBM,1442600,1444400,1437000,1443600,2271167,2,0.123214449,16.2318625500 ,1\n20190415,AAPL,1985700,1998400,1980100,1992300,14628164,2,0.123214449,16.2318625500 ,1\n20190415,GOOG,12177400,12242500,12091100,12216300,992028,2,0.123214449,16.2318625500 ,1\n20190415,IBM,1444700,1444700,1432700,1439200,2729623,2,5.722472297,0.3494992890 ,1\n20190416,AAPL,1994600,2013700,1985600,1992500,24268015,2,5.722472297,0.3494992890 ,1\n20190416,GOOG,12250000,12304200,12201200,12274600,774879,2,5.722472297,0.3494992890 ,1\n20190416,IBM,1444000,1453900,1440500,1451400,5459515,3,30502409,0.0000000984 ,3\n20190417,AAPL,1995800,2034600,1986100,2031200,27999611,3,30502409,0.0000000984 ,3\n20190417,GOOG,12320300,12405600,12278600,12365200,1049803,3,30502409,0.0000000984 ,3\n20190417,IBM,1373700,1419600,1362800,1390800,11627349,2,2.498369491,0.8005221030 ,1\n20190418,AAPL,2031200,2041500,2025200,2038600,20443680,2,2.498369491,0.8005221030 ,1\n20190418,GOOG,12390800,12420800,12346100,12368100,1018437,2,2.498369491,0.8005221030 ,1\n20190418,IBM,1390000,1404900,1387800,1403300,3958106,3,25420223,0.0000001180 ,3\n20190422,AAPL,2026600,2049400,2023300,2046400,13775526,3,25420223,0.0000001180 ,3\n20190422,GOOG,12329000,12494300,12283000,12490900,662517,3,25420223,0.0000001180 ,3\n20190422,IBM,1394200,1405500,1384800,1388700,3350803,2,4.308830749,0.4641630450 ,1\n20190423,AAPL,2044300,2077500,2039000,2075100,19810816,2,4.308830749,0.4641630450 ,1\n20190423,GOOG,12506900,12691500,12462700,12645000,1114144,2,4.308830749,0.4641630450 ,1\n20190423,IBM,1391500,1409200,1389500,1404100,3072805,3,23997765,0.0000001250 ,3\n20190424,AAPL,2074400,2084800,2070500,2071200,14932007,3,23997765,0.0000001250 ,3\n20190424,GOOG,12652500,12680300,12549500,12550500,700959,3,23997765,0.0000001250 ,3\n20190424,IBM,1406000,1412900,1398500,1399700,2019400,0,0,0.0000000000 ,-3\n20190425,AAPL,2068400,2077600,2051200,2052400,15970808,0,0,0.0000000000 ,-3\n20190425,GOOG,12652600,12676500,12520000,12629800,956135,0,0,0.0000000000 ,-3\n20190425,IBM,1397000,1397000,1377300,1386500,2373830,0.5,0.05212068,9.5931211950 ,-1\n20190426,AAPL,2048300,2050000,2021200,2042900,16420146,0.5,0.05212068,9.5931211950 ,-1\n20190426,GOOG,12665500,12736800,12602800,12718000,1083643,0.5,0.05212068,9.5931211950 ,-1\n20190426,IBM,1392800,1398900,1388200,1394300,1940500,2,0.184172723,10.8593714000 ,1\n20190429,AAPL,2044000,2059700,2038600,2046100,19605618,2,0.184172723,10.8593714000 ,1\n20190429,GOOG,12730100,12892800,12663800,12874300,1717098,2,0.184172723,10.8593714000 ,1\n20190429,IBM,1391500,1396200,1388200,1390800,1946116,2,10.95654935,0.1825392230 ,1\n20190430,AAPL,2030600,2033900,1991100,2005100,35906353,2,10.95654935,0.1825392230 ,1\n20190430,GOOG,11850500,11930000,11748700,11894700,5795501,2,10.95654935,0.1825392230 ,1\n20190430,IBM,1394200,1404400,1386800,1402600,2712449,0.5,0.065043847,7.6871221960 ,-1\n20190501,AAPL,2099700,2153100,2092300,2105200,58431082,0.5,0.065043847,7.6871221960 ,-1\n20190501,GOOG,11880100,11884900,11671500,11676500,2457471,0.5,0.065043847,7.6871221960 ,-1\n20190501,IBM,1406400,1418000,1401900,1405700,2599938,2,24.8348892,0.0805318670 ,1\n20190502,AAPL,2099500,2126500,2081300,2091700,28925386,2,24.8348892,0.0805318670 ,1\n20190502,GOOG,11676600,11737900,11550100,11623600,1797876,2,24.8348892,0.0805318670 ,1\n20190502,IBM,1404900,1412700,1394100,1396400,2728959,0,0,0.0000000000 ,-3\n20190503,AAPL,2107600,2118400,2102300,2117800,18034291,0,0,0.0000000000 ,-3\n20190503,GOOG,11726700,11868800,11689800,11855600,1770247,0,0,0.0000000000 ,-3\n20190503,IBM,1397000,1410000,1397000,1402800,1967201,3,21771739,0.0000001378 ,3\n20190506,AAPL,2042900,2088400,2035000,2086000,28839202,3,21771739,0.0000001378 ,3\n20190506,GOOG,11678200,11908500,11662600,11894900,1420016,3,21771739,0.0000001378 ,3\n20190506,IBM,1382900,1406900,1379000,1404000,2198109,2,0.125458569,15.9415177100 ,1\n20190507,AAPL,2059300,2074000,2008300,2028600,34855750,2,0.125458569,15.9415177100 ,1\n20190507,GOOG,11804700,11905400,11610500,11746200,1350758,2,0.125458569,15.9415177100 ,1\n20190507,IBM,1391800,1394800,1362000,1376200,4062939,0,0,0.0000000000 ,-3\n20190508,AAPL,2020200,2053400,2017600,2029000,22876206,0,0,0.0000000000 ,-3\n20190508,GOOG,11715200,11805300,11656600,11657400,1150107,0,0,0.0000000000 ,-3\n20190508,IBM,1377700,1386700,1371300,1380000,2823027,2,22.34508007,0.0895051610 ,1\n20190509,AAPL,2004600,2016800,1966700,2007200,32813078,2,22.34508007,0.0895051610 ,1\n20190509,GOOG,11589000,11697700,11508500,11626100,1076230,2,22.34508007,0.0895051610 ,1\n20190509,IBM,1348900,1355700,1330300,1353400,3234443,0,0,0.0000000000 ,-3\n20190510,AAPL,1974300,1988500,1927600,1972500,36509516,0,0,0.0000000000 ,-3\n20190510,GOOG,11603000,11726000,11424900,11644900,1196664,0,0,0.0000000000 ,-3\n20190510,IBM,1348800,1357500,1324400,1353200,3404127,0.5,0.029981327,16.6770470200 ,-1\n20190513,AAPL,1876900,1894800,1828500,1857200,50683171,0.5,0.029981327,16.6770470200 ,-1\n20190513,GOOG,11415000,11480000,11220000,11326100,1634334,0.5,0.029981327,16.6770470200 ,-1\n20190513,IBM,1332800,1335500,1309600,1314100,3593331,0,0,0.0000000000 ,-3\n20190514,AAPL,1864100,1897100,1854100,1886600,31680942,0,0,0.0000000000 ,-3\n20190514,GOOG,11371100,11410000,11195200,11203300,1641019,0,0,0.0000000000 ,-3\n20190514,IBM,1318200,1343200,1318100,1333400,2780832,2,21.00022852,0.0952370590 ,1\n20190515,AAPL,1863000,1917500,1860100,1909200,23820574,2,21.00022852,0.0952370590 ,1\n20190515,GOOG,11178700,11714200,11167500,11640600,2011343,2,21.00022852,0.0952370590 ,1\n20190515,IBM,1325900,1345900,1323700,1344000,2134015,3,27965932,0.0000001073 ,3\n20190516,AAPL,1899100,1924800,1888400,1901400,28935602,3,27965932,0.0000001073 ,3\n20190516,GOOG,11657800,11883600,11626400,11789800,1375292,3,27965932,0.0000001073 ,3\n20190516,IBM,1347400,1361000,1346400,1358700,2367170,2,0.129337624,15.4634045200 ,1\n20190517,AAPL,1870600,1909000,1867600,1889800,28930584,2,0.129337624,15.4634045200 ,1\n20190517,GOOG,11699500,11802500,11599900,11623000,1054944,2,0.129337624,15.4634045200 ,1\n20190517,IBM,1346800,1354000,1339400,1342900,2138590,0,0,0.0000000000 ,-3\n20190520,AAPL,1836300,1843400,1802900,1830900,33467674,0,0,0.0000000000 ,-3\n20190520,GOOG,11445000,11470900,11313500,11383300,1174301,0,0,0.0000000000 ,-3\n20190520,IBM,1335300,1354300,1329400,1351200,2969086,0.5,0.085707758,5.8337776140 ,-1\n20190521,AAPL,1852200,1880000,1847000,1865900,24078878,0.5,0.085707758,5.8337776140 ,-1\n20190521,GOOG,11480400,11527800,11379400,11496300,885148,0.5,0.085707758,5.8337776140 ,-1\n20190521,IBM,1360100,1370400,1358300,1364600,1969099,3,26933125,0.0000001114 ,3\n20190522,AAPL,1848600,1857100,1825500,1827900,26908150,3,26933125,0.0000001114 ,3\n20190522,GOOG,11460000,11587500,11453700,11514200,783717,3,26933125,0.0000001114 ,3\n20190522,IBM,1360000,1367500,1357200,1363600,1460512,0.5,0.027626153,18.0987921100 ,-1\n20190523,AAPL,1798500,1805400,1778100,1796700,31309823,0.5,0.027626153,18.0987921100 ,-1\n20190523,GOOG,11425400,11458900,11294200,11405500,1038778,0.5,0.027626153,18.0987921100 ,-1\n20190523,IBM,1351300,1351300,1304500,1323900,4606839,0,0,0.0000000000 ,-3\n20190524,AAPL,1802900,1821400,1786200,1790300,21640795,0,0,0.0000000000 ,-3\n20190524,GOOG,11479700,11499100,11317300,11340000,1023769,0,0,0.0000000000 ,-3\n20190524,IBM,1335300,1342000,1315900,1323000,2291630,0,0,0.0000000000 ,-3\n20190528,AAPL,1788900,1805900,1779200,1781700,22752739,0,0,0.0000000000 ,-3\n20190528,GOOG,11352400,11517700,11331200,11331800,1075412,0,0,0.0000000000 ,-3\n20190528,IBM,1320100,1326400,1302700,1304600,2419010,0,0,0.0000000000 ,-3\n20190529,AAPL,1764800,1793500,1760000,1773500,26364270,0,0,0.0000000000 ,-3\n20190529,GOOG,11290000,11294500,11082500,11163600,1425120,0,0,0.0000000000 ,-3\n20190529,IBM,1300000,1302600,1283300,1296800,3201934,0,0,0.0000000000 ,-3\n20190530,AAPL,1779900,1792300,1766700,1782500,19994104,0,0,0.0000000000 ,-3\n20190530,GOOG,11180000,11231500,11121200,11177900,865165,0,0,0.0000000000 ,-3\n20190530,IBM,1297400,1299700,1289300,1295600,2351813,2,8.869442001,0.2254933290 ,1\n20190531,AAPL,1762200,1779900,1749900,1750000,23031208,2,8.869442001,0.2254933290 ,1\n20190531,GOOG,11034100,11096000,11001000,11038500,1272882,2,8.869442001,0.2254933290 ,1\n20190531,IBM,1284400,1284400,1268600,1270200,2523395,0,0,0.0000000000 ,-3\n20190603,AAPL,1755800,1779200,1702700,1732800,36949732,0,0,0.0000000000 ,-3\n20190603,GOOG,10660200,10670000,10250100,10363100,4745310,0,0,0.0000000000 ,-3\n20190603,IBM,1270000,1285600,1270000,1282600,3463489,0.5,0.083067167,6.0192253820 ,-1\n20190604,AAPL,1754500,1798400,1745200,1796700,27402677,0.5,0.083067167,6.0192253820 ,-1\n20190604,GOOG,10420100,10562100,10337600,10530600,2550546,0.5,0.083067167,6.0192253820 ,-1\n20190604,IBM,1295600,1327400,1290900,1326900,3074020,3,33027243,0.0000000908 ,3\n20190605,AAPL,1842500,1849900,1811400,1825400,26229032,3,33027243,0.0000000908 ,3\n20190605,GOOG,10522000,10535600,10304300,10429500,1991132,3,33027243,0.0000000908 ,3\n20190605,IBM,1332200,1336100,1304700,1314500,2770367,0.5,5.508566105,0.0907677230 ,-1\n20190606,AAPL,1830900,1854700,1821500,1852300,18722674,0.5,5.508566105,0.0907677230 ,-1\n20190606,GOOG,10449900,10474700,10334300,10446000,1392091,0.5,5.508566105,0.0907677230 ,-1\n20190606,IBM,1321900,1326400,1309200,1322000,1962106,3,22076871,0.0000001359 ,3\n20190607,AAPL,1866000,1919200,1857700,1901400,27840129,3,22076871,0.0000001359 ,3\n20190607,GOOG,10504100,10717000,10482700,10660300,1544742,3,22076871,0.0000001359 ,3\n20190607,IBM,1320800,1347200,1320800,1332900,2144277,3,31529148,0.0000000952 ,3\n20190610,AAPL,1923300,1953700,1916100,1925200,23916792,3,31529148,0.0000000952 ,3\n20190610,GOOG,10733900,10928400,10726600,10803800,1308312,3,31529148,0.0000000952 ,3\n20190610,IBM,1343800,1353400,1339100,1347000,2479503,3,27704607,0.0000001083 ,3\n20190611,AAPL,1948400,1960000,1936000,1948100,22798624,3,27704607,0.0000001083 ,3\n20190611,GOOG,10946900,11019900,10775200,10788100,1285869,3,27704607,0.0000001083 ,3\n20190611,IBM,1353200,1364400,1350500,1359700,2771962,2,19.88584063,0.1005740740 ,1\n20190612,AAPL,1939900,1959700,1933700,1941900,16452770,2,19.88584063,0.1005740740 ,1\n20190612,GOOG,10780000,10805900,10676100,10773300,962420,2,19.88584063,0.1005740740 ,1\n20190612,IBM,1354900,1359400,1344100,1348700,1729989,0,0,0.0000000000 ,-3\n20190613,AAPL,1947200,1968000,1936000,1947400,18162145,0,0,0.0000000000 ,-3\n20190613,GOOG,10830000,10942200,10804400,10887900,885444,0,0,0.0000000000 ,-3\n20190613,IBM,1351300,1362700,1350900,1357700,1920879,3,20968468,0.0000001431 ,3\n20190614,AAPL,1916200,1935800,1903000,1927400,15883266,3,20968468,0.0000001431 ,3\n20190614,GOOG,10860200,10925800,10800000,10853500,994158,3,20968468,0.0000001431 ,3\n20190614,IBM,1353500,1356500,1344300,1351900,1527445,0,0,0.0000000000 ,-3\n20190617,AAPL,1929000,1949600,1921700,1939500,12890733,0,0,0.0000000000 ,-3\n20190617,GOOG,10867400,10993700,10860100,10925000,809378,0,0,0.0000000000 ,-3\n20190617,IBM,1353900,1360300,1347000,1349500,1814647,2,7.549738875,0.2649098240 ,1\n20190618,AAPL,1960200,2002900,1952100,1985000,23830038,2,7.549738875,0.2649098240 ,1\n20190618,GOOG,11087000,11165200,10986700,11034700,1208540,2,7.549738875,0.2649098240 ,1\n20190618,IBM,1352000,1371900,1352000,1364200,2276060,3,27314638,0.0000001098 ,3\n20190619,AAPL,1996800,1998900,1973100,1978200,17677106,3,27314638,0.0000001098 ,3\n20190619,GOOG,11050000,11070000,10934200,11025800,1014357,3,27314638,0.0000001098 ,3\n20190619,IBM,1364300,1376700,1362400,1371000,1893849,0.5,0.101321603,4.9347817760 ,-1\n20190620,AAPL,2003700,2006000,1980300,1994000,18629038,0.5,0.101321603,4.9347817760 ,-1\n20190620,GOOG,11179900,11201800,11050000,11109500,1003009,0.5,0.101321603,4.9347817760 ,-1\n20190620,IBM,1389300,1395200,1382100,1388500,2216468,3,21848515,0.0000001373 ,3\n20190621,AAPL,1984400,2008500,1981400,1988000,26177066,3,21848515,0.0000001373 ,3\n20190621,GOOG,11075800,11249000,11071300,11224400,1469439,3,21848515,0.0000001373 ,3\n20190621,IBM,1386900,1395400,1384000,1391800,3222090,2,0.179222874,11.1592898600 ,1\n20190624,AAPL,1985600,2001600,1981700,1985500,14854581,2,0.179222874,11.1592898600 ,1\n20190624,GOOG,11191800,11221600,11110000,11158300,1264074,2,0.179222874,11.1592898600 ,1\n20190624,IBM,1392000,1401400,1390500,1393600,1762740,0.5,0.109360241,4.5720455210 ,-1\n20190625,AAPL,1984800,1992900,1952900,1955700,19610359,0.5,0.109360241,4.5720455210 ,-1\n20190625,GOOG,11129300,11154600,10838000,10863400,1352189,0.5,0.109360241,4.5720455210 ,-1\n20190625,IBM,1394600,1395000,1381300,1383700,2251465,0,0,0.0000000000 ,-3\n20190626,AAPL,1978500,2009900,1973400,1998000,22885387,0,0,0.0000000000 ,-3\n20190626,GOOG,10876900,10933000,10722900,10798000,1591139,0,0,0.0000000000 ,-3\n20190626,IBM,1388700,1396800,1384200,1385300,1612064,2,15.3961728,0.1299024130 ,1\n20190627,AAPL,2004000,2015700,1995700,1997300,15632774,2,15.3961728,0.1299024130 ,1\n20190627,GOOG,10848400,10870000,10751800,10759300,870095,2,15.3961728,0.1299024130 ,1\n20190627,IBM,1387200,1393000,1379600,1385200,1675796,0,0,0.0000000000 ,-3\n20190628,AAPL,1987200,1994900,1970500,1979200,19956663,0,0,0.0000000000 ,-3\n20190628,GOOG,10763600,10810000,10732500,10806200,1252274,0,0,0.0000000000 ,-3\n20190628,IBM,1385700,1391400,1378600,1379200,2567968,0.5,0.055595761,8.9934914280 ,-1\n20190701,AAPL,2032800,2044900,2006500,2016800,24264641,0.5,0.055595761,8.9934914280 ,-1\n20190701,GOOG,10994600,11075800,10937200,10979500,1288236,0.5,0.055595761,8.9934914280 ,-1\n20190701,IBM,1396000,1414900,1392900,1399200,2717318,3,28270195,0.0000001061 ,3\n20190702,AAPL,2014300,2031300,2013600,2027100,15965830,3,28270195,0.0000001061 ,3\n20190702,GOOG,11013900,11117700,10989000,11117700,871863,3,28270195,0.0000001061 ,3\n20190702,IBM,1396700,1404200,1394800,1402000,2091296,3,18928989,0.0000001585 ,3\n20190703,AAPL,2032100,2044400,2027000,2044100,9430155,3,18928989,0.0000001585 ,3\n20190703,GOOG,11160500,11267700,11138100,11219200,669181,3,18928989,0.0000001585 ,3\n20190703,IBM,1407200,1418100,1404900,1414900,1479573,3,11578909,0.0000002591 ,3\n20190705,AAPL,2033500,2050800,2029000,2042500,15239601,3,11578909,0.0000002591 ,3\n20190705,GOOG,11177900,11329200,11150000,11320300,1000689,3,11578909,0.0000002591 ,3\n20190705,IBM,1408700,1414900,1399100,1413700,1819874,0.5,0.058658839,8.5238645790 ,-1\n20190708,AAPL,2009400,2014000,1984100,2000200,22281039,0.5,0.058658839,8.5238645790 ,-1\n20190708,GOOG,11259200,11270000,11113200,11163500,1031603,0.5,0.058658839,8.5238645790 ,-1\n20190708,IBM,1411000,1412800,1402800,1405800,1963230,0,0,0.0000000000 ,-3\n20190709,AAPL,1992000,2015100,1988100,2012200,17873539,0,0,0.0000000000 ,-3\n20190709,GOOG,11122300,11281000,11070000,11245800,1153922,0,0,0.0000000000 ,-3\n20190709,IBM,1406100,1409900,1391300,1393400,2873887,2,6.620810422,0.3020778230 ,1\n20190710,AAPL,2019000,2037300,2015600,2032100,15735306,2,6.620810422,0.3020778230 ,1\n20190710,GOOG,11310000,11421000,11308800,11404800,1089447,2,6.620810422,0.3020778230 ,1\n20190710,IBM,1400000,1419000,1399300,1404600,2178813,3,19003566,0.0000001579 ,3\n20190711,AAPL,2033500,2043900,2017100,2017400,16252329,3,19003566,0.0000001579 ,3\n20190711,GOOG,11429500,11532200,11393000,11442100,1106386,3,19003566,0.0000001579 ,3\n20190711,IBM,1407900,1415400,1403000,1412400,1873952,2,0.183379133,10.9063663200 ,1\n20190712,AAPL,2025300,2040000,2022000,2032400,15652854,2,0.183379133,10.9063663200 ,1\n20190712,GOOG,11439900,11472700,11386500,11445600,766543,2,0.183379133,10.9063663200 ,1\n20190712,IBM,1419200,1429100,1417300,1426900,2255321,3,18674718,0.0000001606 ,3\n20190715,AAPL,2040500,2058700,2040000,2052000,14611018,3,18674718,0.0000001606 ,3\n20190715,GOOG,11455300,11508800,11396200,11505600,809028,3,18674718,0.0000001606 ,3\n20190715,IBM,1428900,1435000,1421400,1433100,2100010,3,17520056,0.0000001712 ,3\n20190716,AAPL,2047400,2061100,2035000,2044900,14612121,3,17520056,0.0000001712 ,3\n20190716,GOOG,11458000,11585800,11450000,11536000,1156894,3,17520056,0.0000001712 ,3\n20190716,IBM,1431600,1440300,1430600,1435200,2924182,2,0.279293882,7.1609158990 ,1\n20190717,AAPL,2043100,2050900,2032700,2032800,11705771,2,0.279293882,7.1609158990 ,1\n20190717,GOOG,11524900,11583200,11457100,11464900,1001430,2,0.279293882,7.1609158990 ,1\n20190717,IBM,1436800,1438000,1419500,1431000,4677082,0,0,0.0000000000 ,-3\n20190718,AAPL,2040000,2058800,2037000,2056600,15514507,0,0,0.0000000000 ,-3\n20190718,GOOG,11410000,11476900,11327300,11468000,959692,0,0,0.0000000000 ,-3\n20190718,IBM,1424500,1503000,1424100,1496300,11889986,3,28364185,0.0000001058 ,3\n20190719,AAPL,2057800,2065000,2023600,2025700,18324264,3,28364185,0.0000001058 ,3\n20190719,GOOG,11497700,11512700,11296200,11300100,1227100,3,28364185,0.0000001058 ,3\n20190719,IBM,1499600,1515800,1495600,1498100,6056454,0.5,0.309771431,1.6140933280 ,-1\n20190722,AAPL,2037800,2072300,2036100,2072300,19154085,0.5,0.309771431,1.6140933280 ,-1\n20190722,GOOG,11340700,11392700,11242400,11382800,1075273,0.5,0.309771431,1.6140933280 ,-1\n20190722,IBM,1501600,1519400,1497000,1497500,3660075,2,5.527033736,0.3618577510 ,1\n20190723,AAPL,2083700,2089100,2073000,2088300,16514267,2,5.527033736,0.3618577510 ,1\n20190723,GOOG,11434700,11469100,11317700,11465600,988570,2,5.527033736,0.3618577510 ,1\n20190723,IBM,1505700,1507200,1483900,1503800,2908133,3,20410970,0.0000001470 ,3\n20190724,AAPL,2076700,2091500,2071800,2086700,13148873,3,20410970,0.0000001470 ,3\n20190724,GOOG,11311500,11439800,11270000,11381800,1292101,3,20410970,0.0000001470 ,3\n20190724,IBM,1501200,1514500,1492000,1500400,2661472,0,0,0.0000000000 ,-3\n20190725,AAPL,2087200,2092400,2067300,2070500,11966186,0,0,0.0000000000 ,-3\n20190725,GOOG,11370100,11419000,11210000,11348600,1579386,0,0,0.0000000000 ,-3\n20190725,IBM,1498000,1506200,1486100,1504100,2388821,0.5,0.176354384,2.8352002860 ,-1\n20190726,AAPL,2074000,2097300,2071400,2077500,15726362,0.5,0.176354384,2.8352002860 ,-1\n20190726,GOOG,12240400,12656300,12232400,12477400,4327585,0.5,0.176354384,2.8352002860 ,-1\n20190726,IBM,1509200,1514000,1501000,1513400,1955575,3,22009522,0.0000001363 ,3\n20190729,AAPL,2084700,2106400,2084100,2096700,19204268,3,22009522,0.0000001363 ,3\n20190729,GOOG,12410000,12472300,12282700,12387500,2056580,3,22009522,0.0000001363 ,3\n20190729,IBM,1511100,1514600,1503300,1509300,1617308,0.5,5.227232839,0.0956529040 ,-1\n20190730,AAPL,2088300,2106600,2073100,2088800,24740263,0.5,5.227232839,0.0956529040 ,-1\n20190730,GOOG,12265800,12348700,12232600,12251400,1360406,0.5,5.227232839,0.0956529040 ,-1\n20190730,IBM,1500000,1503900,1492400,1497700,2278632,0,0,0.0000000000 ,-3\n20190731,AAPL,2164000,2213700,2113000,2127800,63857734,0,0,0.0000000000 ,-3\n20190731,GOOG,12233300,12512300,12071100,12166800,1526178,0,0,0.0000000000 ,-3\n20190731,IBM,1497000,1501800,1463900,1482400,2748127,0.5,14.93991046,0.0334674030 ,-1\n20190801,AAPL,2140100,2180300,2067300,2084500,51934597,0.5,14.93991046,0.0334674030 ,-1\n20190801,GOOG,12143600,12343300,12055100,12094800,1804644,0.5,14.93991046,0.0334674030 ,-1\n20190801,IBM,1489000,1528100,1485000,1503000,5835516,0.5,0.108589476,4.6044977690 ,-1\n20190802,AAPL,2051500,2064300,2016300,2040900,36037467,0.5,0.108589476,4.6044977690 ,-1\n20190802,GOOG,12007400,12071000,11889200,11936300,1455908,0.5,0.108589476,4.6044977690 ,-1\n20190802,IBM,1490300,1528900,1455900,1472800,7643491,0,0,0.0000000000 ,-3\n20190805,AAPL,1978800,1986500,1925800,1932200,45466995,0,0,0.0000000000 ,-3\n20190805,GOOG,11706000,11752400,11401800,11523200,2267696,0,0,0.0000000000 ,-3\n20190805,IBM,1449800,1451000,1391700,1407500,6186074,0,0,0.0000000000 ,-3\n20190806,AAPL,1964300,1980700,1940400,1969800,32111414,0,0,0.0000000000 ,-3\n20190806,GOOG,11628500,11800000,11598900,11693600,1363456,0,0,0.0000000000 ,-3\n20190806,IBM,1420000,1424700,1393100,1407300,4294639,2,7.794571325,0.2565888380 ,1\n20190807,AAPL,1954900,1995600,1938200,1991400,29406192,2,7.794571325,0.2565888380 ,1\n20190807,GOOG,11567500,11784400,11491600,11738200,1214158,2,7.794571325,0.2565888380 ,1\n20190807,IBM,1390000,1395800,1364800,1391300,5028053,2,6.089901996,0.3284125100 ,1\n20190808,AAPL,2003100,2035300,1993900,2034500,23463801,2,6.089901996,0.3284125100 ,1\n20190808,GOOG,11832200,12050100,11733800,12045100,1254711,2,6.089901996,0.3284125100 ,1\n20190808,IBM,1384500,1404200,1377800,1401300,4344213,3,29062725,0.0000001032 ,3\n20190809,AAPL,2013000,2027600,1992900,2009900,21848205,3,29062725,0.0000001032 ,3\n20190809,GOOG,11980000,12039700,11835200,11881400,917903,3,29062725,0.0000001032 ,3\n20190809,IBM,1393000,1393000,1353500,1361200,4720674,0,0,0.0000000000 ,-3\n20190812,AAPL,1994600,2020600,1991500,2005000,19913300,0,0,0.0000000000 ,-3\n20190812,GOOG,11792300,11848600,11675000,11742300,865880,0,0,0.0000000000 ,-3\n20190812,IBM,1356600,1358700,1331800,1340900,3390677,0,0,0.0000000000 ,-3\n20190813,AAPL,2010000,2121400,2008300,2089800,43883110,0,0,0.0000000000 ,-3\n20190813,GOOG,11714600,12049300,11714600,11972600,1117326,0,0,0.0000000000 ,-3\n20190813,IBM,1338100,1365700,1328500,1357800,3939008,3,48939444,0.0000000613 ,3\n20190814,AAPL,2032800,2064400,2025000,2027500,31227195,3,48939444,0.0000000613 ,3\n20190814,GOOG,11763700,11823600,11607900,11641300,1330650,3,48939444,0.0000000613 ,3\n20190814,IBM,1339100,1341600,1309800,1312400,3912510,0,0,0.0000000000 ,-3\n20190815,AAPL,2034600,2051500,1996700,2016800,24652850,0,0,0.0000000000 ,-3\n20190815,GOOG,11684000,11759200,11620800,11675700,1095137,0,0,0.0000000000 ,-3\n20190815,IBM,1314200,1323600,1302500,1318800,3303365,2,0.178417587,11.2096572600 ,1\n20190816,AAPL,2041700,2071600,2038500,2064400,24842738,2,0.178417587,11.2096572600 ,1\n20190816,GOOG,11795500,11826800,11715800,11776000,1161671,2,0.178417587,11.2096572600 ,1\n20190816,IBM,1330400,1345900,1329800,1337400,2406250,3,28410659,0.0000001056 ,3\n20190819,AAPL,2106900,2127300,2100400,2103400,21632067,3,28410659,0.0000001056 ,3\n20190819,GOOG,11906000,12069900,11900900,11985300,1003576,3,28410659,0.0000001056 ,3\n20190819,IBM,1348800,1363200,1348800,1350300,2773650,3,25409293,0.0000001181 ,3\n20190820,AAPL,2107800,2133500,2103200,2103500,21348212,3,25409293,0.0000001181 ,3\n20190820,GOOG,11953900,11961100,11820000,11826900,682728,3,25409293,0.0000001181 ,3\n20190820,IBM,1351100,1352700,1328200,1331000,2504433,0.5,6.698190647,0.0746470240 ,-1\n20190821,AAPL,2129700,2136500,2116100,2126700,18922195,0.5,6.698190647,0.0746470240 ,-1\n20190821,GOOG,11920600,11990000,11871100,11912400,646709,0.5,6.698190647,0.0746470240 ,-1\n20190821,IBM,1347100,1359000,1338000,1342800,2467302,3,22036206,0.0000001361 ,3\n20190822,AAPL,2131900,2144300,2107500,2124500,19534453,3,22036206,0.0000001361 ,3\n20190822,GOOG,11940700,11980500,11784500,11895000,784498,3,22036206,0.0000001361 ,3\n20190822,IBM,1349900,1356400,1338500,1343400,2191473,0.5,0.107853649,4.6359117620 ,-1\n20190823,AAPL,2093900,2120500,2010000,2026300,41268018,0.5,0.107853649,4.6359117620 ,-1\n20190823,GOOG,11820500,11940800,11476000,11517200,1399418,0.5,0.107853649,4.6359117620 ,-1\n20190823,IBM,1336000,1342000,1288300,1295700,3740545,0,0,0.0000000000 ,-3\n20190826,AAPL,2058900,2071900,2050600,2066000,23135836,0,0,0.0000000000 ,-3\n20190826,GOOG,11605000,11694700,11528000,11694700,1029694,0,0,0.0000000000 ,-3\n20190826,IBM,1310100,1313000,1291800,1299900,2342907,3,26508437,0.0000001132 ,3\n20190827,AAPL,2078100,2085500,2035400,2041300,19567155,3,26508437,0.0000001132 ,3\n20190827,GOOG,11805300,11829500,11615600,11682700,884564,3,26508437,0.0000001132 ,3\n20190827,IBM,1310800,1316900,1303300,1311700,3754502,0.5,0.183578798,2.7236260690 ,-1\n20190828,AAPL,2041000,2057200,2033300,2055200,14183557,0.5,0.183578798,2.7236260690 ,-1\n20190828,GOOG,11626900,11762100,11572000,11710200,625006,0.5,0.183578798,2.7236260690 ,-1\n20190828,IBM,1303300,1328800,1300600,1327200,2210239,3,17018802,0.0000001763 ,3\n20190829,AAPL,2086900,2093200,2066500,2091000,18608188,3,17018802,0.0000001763 ,3\n20190829,GOOG,11820700,11964100,11811200,11930400,978995,3,17018802,0.0000001763 ,3\n20190829,IBM,1341300,1356900,1340400,1349300,2518503,3,22105686,0.0000001357 ,3\n20190830,AAPL,2101500,2104500,2072000,2087400,17065976,3,22105686,0.0000001357 ,3\n20190830,GOOG,11985000,11995000,11838100,11884200,846644,3,22105686,0.0000001357 ,3\n20190830,IBM,1356800,1360600,1343800,1354600,2001659,0.5,0.111745741,4.4744434600 ,-1\n20190903,AAPL,2064200,2069800,2042200,2056900,17995638,0.5,0.111745741,4.4744434600 ,-1\n20190903,GOOG,11784700,11867500,11632000,11682400,1293007,0.5,0.111745741,4.4744434600 ,-1\n20190903,IBM,1346700,1349000,1333600,1341500,2033141,0,0,0.0000000000 ,-3\n20190904,AAPL,2083900,2094800,2073100,2092500,17133945,0,0,0.0000000000 ,-3\n20190904,GOOG,11784500,11834800,11707600,11814100,967215,0,0,0.0000000000 ,-3\n20190904,IBM,1358500,1364300,1351500,1363100,1561819,3,19662979,0.0000001526 ,3\n20190905,AAPL,2118500,2139600,2115100,2132800,20682004,3,19662979,0.0000001526 ,3\n20190905,GOOG,11923200,12130400,11915300,12112300,1284567,3,19662979,0.0000001526 ,3\n20190905,IBM,1383500,1417000,1380500,1409700,4210893,3,26177464,0.0000001146 ,3\n20190906,AAPL,2139800,2144200,2125100,2132700,17454572,3,26177464,0.0000001146 ,3\n20190906,GOOG,12073900,12121000,12026000,12049300,916327,3,26177464,0.0000001146 ,3\n20190906,IBM,1415200,1415200,1404600,1405500,2228125,0,0,0.0000000000 ,-3\n20190909,AAPL,2148600,2164400,2110700,2141500,23787972,0,0,0.0000000000 ,-3\n20190909,GOOG,12076600,12200000,11927200,12049200,1345648,0,0,0.0000000000 ,-3\n20190909,IBM,1405900,1430100,1404600,1426200,3474580,2,20.25979454,0.0987176840 ,1\n20190910,AAPL,2138100,2167800,2117100,2167700,28051341,2,20.25979454,0.0987176840 ,1\n20190910,GOOG,11955400,12100000,11944700,12074500,1131329,2,20.25979454,0.0987176840 ,1\n20190910,IBM,1430000,1454600,1429600,1450200,4363217,3,33545887,0.0000000894 ,3\n20190911,AAPL,2181200,2236400,2177300,2235700,40687303,3,33545887,0.0000000894 ,3\n20190911,GOOG,12041800,12225900,12022000,12201700,1150453,3,33545887,0.0000000894 ,3\n20190911,IBM,1448500,1450800,1427200,1436000,3087123,2,13.55234502,0.1475759360 ,1\n20190912,AAPL,2248000,2264200,2228600,2230900,27809109,2,13.55234502,0.1475759360 ,1\n20190912,GOOG,12249800,12416800,12230000,12340000,1554159,2,13.55234502,0.1475759360 ,1\n20190912,IBM,1440300,1440700,1418800,1436100,1985446,2,0.127282215,15.7131143600 ,1\n20190913,AAPL,2200100,2207900,2170200,2188000,36334641,2,0.127282215,15.7131143600 ,1\n20190913,GOOG,12313500,12408800,12270100,12392200,1136449,2,0.127282215,15.7131143600 ,1\n20190913,IBM,1440000,1446500,1432600,1436400,1660207,2,0.076969413,25.9843478300 ,1\n20190916,AAPL,2177400,2201300,2175600,2199000,18858994,2,0.076969413,25.9843478300 ,1\n20190916,GOOG,12304700,12395600,12256000,12313000,938240,2,0.076969413,25.9843478300 ,1\n20190916,IBM,1425000,1435900,1422700,1424300,1473455,0.5,7.81980889,0.0639401820 ,-1\n20190917,AAPL,2198700,2208200,2191200,2206500,15950731,0.5,7.81980889,0.0639401820 ,-1\n20190917,GOOG,12316800,12350500,12236700,12291600,801300,0.5,7.81980889,0.0639401820 ,-1\n20190917,IBM,1424700,1424800,1406900,1421800,1965391,0.5,5.765273751,0.0867261510 ,-1\n20190918,AAPL,2211300,2228500,2194500,2227700,22852282,0.5,5.765273751,0.0867261510 ,-1\n20190918,GOOG,12282800,12356100,12163100,12326500,957556,0.5,5.765273751,0.0867261510 ,-1\n20190918,IBM,1420000,1422900,1405300,1422100,1732555,3,25542393,0.0000001175 ,3\n20190919,AAPL,2221200,2237600,2203700,2209500,19957797,3,25542393,0.0000001175 ,3\n20190919,GOOG,12320200,12444900,12320200,12386400,898159,3,25542393,0.0000001175 ,3\n20190919,IBM,1425300,1450100,1424600,1429400,2760621,2,0.183325845,10.9095365100 ,1\n20190920,AAPL,2213900,2225500,2174800,2176900,31800687,2,0.183325845,10.9095365100 ,1\n20190920,GOOG,12347500,12433200,12228100,12296800,1527184,2,0.183325845,10.9095365100 ,1\n20190920,IBM,1435100,1438300,1418300,1418300,3679511,0,0,0.0000000000 ,-3\n20190923,AAPL,2189100,2198400,2176500,2186800,16559468,0,0,0.0000000000 ,-3\n20190923,GOOG,12271200,12392300,12240000,12340900,924827,0,0,0.0000000000 ,-3\n20190923,IBM,1411900,1422100,1405600,1420300,1450872,3,18935167,0.0000001584 ,3\n20190924,AAPL,2211400,2224800,2171900,2176800,27421294,3,18935167,0.0000001584 ,3\n20190924,GOOG,12400000,12467800,12110200,12190900,1369997,3,18935167,0.0000001584 ,3\n20190924,IBM,1422800,1428900,1410700,1417800,2612966,0,0,0.0000000000 ,-3\n20190925,AAPL,2187500,2215000,2171500,2209900,19455919,0,0,0.0000000000 ,-3\n20190925,GOOG,12164300,12484000,12100000,12463100,1342641,0,0,0.0000000000 ,-3\n20190925,IBM,1418700,1436000,1408600,1432000,1927961,3,22726521,0.0000001320 ,3\n20190926,AAPL,2198800,2209400,2188300,2198900,16281412,3,22726521,0.0000001320 ,3\n20190926,GOOG,12419900,12459800,12324500,12420000,1336283,3,22726521,0.0000001320 ,3\n20190926,IBM,1431100,1438400,1414100,1436000,1821053,0.5,0.103364998,4.8372273950 ,-1\n20190927,AAPL,2204300,2209600,2172800,2188500,23029276,0.5,0.103364998,4.8372273950 ,-1\n20190927,GOOG,12425000,12444600,12144600,12250800,1168550,0.5,0.103364998,4.8372273950 ,-1\n20190927,IBM,1441100,1450700,1423800,1433100,1905797,0,0,0.0000000000 ,-3\n20190930,AAPL,2209300,2245800,2208000,2239800,22658210,0,0,0.0000000000 ,-3\n20190930,GOOG,12214100,12260000,12123400,12186300,1184162,0,0,0.0000000000 ,-3\n20190930,IBM,1437400,1465700,1437400,1454100,3060246,2,21.71869727,0.0920865550 ,1\n20191001,AAPL,2251300,2282000,2241900,2245800,32509565,2,21.71869727,0.0920865550 ,1\n20191001,GOOG,12207900,12312500,12035800,12051700,1130161,2,21.71869727,0.0920865550 ,1\n20191001,IBM,1456000,1473500,1435400,1436200,2484575,0.5,8.993620834,0.0555949610 ,-1\n20191002,AAPL,2230900,2235900,2179300,2189600,31739723,0.5,8.993620834,0.0555949610 ,-1\n20191002,GOOG,11969300,11969800,11717600,11771900,1373217,0.5,8.993620834,0.0555949610 ,-1\n20191002,IBM,1421000,1422700,1405900,1417700,2622675,0,0,0.0000000000 ,-3\n20191003,AAPL,2185300,2209600,2151500,2208100,26301723,0,0,0.0000000000 ,-3\n20191003,GOOG,11822500,11894900,11620600,11873100,1506514,0,0,0.0000000000 ,-3\n20191003,IBM,1415000,1420600,1391900,1419800,2531777,3,30340014,0.0000000989 ,3\n20191004,AAPL,2257100,2274900,2239000,2270100,31236611,3,30340014,0.0000000989 ,3\n20191004,GOOG,11924100,12115400,11890400,12088400,1012930,3,30340014,0.0000000989 ,3\n20191004,IBM,1421300,1430500,1410300,1429900,1697755,3,33947296,0.0000000884 ,3\n20191007,AAPL,2263100,2299300,2258600,2270600,28675249,3,33947296,0.0000000884 ,3\n20191007,GOOG,12050400,12184000,12040000,12072500,762527,3,33947296,0.0000000884 ,3\n20191007,IBM,1423700,1427000,1412200,1412600,1672475,0.5,11.77627328,0.0424582540 ,-1\n20191008,AAPL,2258800,2280600,2243300,2243900,25163243,0.5,11.77627328,0.0424582540 ,-1\n20191008,GOOG,11964300,12060800,11890100,11892400,922604,0.5,11.77627328,0.0424582540 ,-1\n20191008,IBM,1401500,1404700,1382500,1383800,2699773,0,0,0.0000000000 ,-3\n20191009,AAPL,2270800,2277900,2256500,2270000,17033593,0,0,0.0000000000 ,-3\n20191009,GOOG,12001100,12083500,11974300,12019300,768220,0,0,0.0000000000 ,-3\n20191009,IBM,1397800,1403300,1388000,1396300,2215673,3,20017486,0.0000001499 ,3\n20191010,AAPL,2279000,2304400,2273000,2300900,26646576,3,20017486,0.0000001499 ,3\n20191010,GOOG,12002600,12150000,11973400,12089500,725405,3,20017486,0.0000001499 ,3\n20191010,IBM,1398400,1417800,1395700,1411300,2221612,3,29593593,0.0000001014 ,3\n20191011,AAPL,2329500,2376400,2323000,2362200,38743375,3,29593593,0.0000001014 ,3\n20191011,GOOG,12220100,12285500,12137000,12145700,1141581,3,29593593,0.0000001014 ,3\n20191011,IBM,1427500,1445000,1426100,1426700,2578804,3,42463760,0.0000000706 ,3\n20191014,AAPL,2351000,2381400,2346700,2358900,22169934,3,42463760,0.0000000706 ,3\n20191014,GOOG,12137800,12263300,12119700,12171300,786716,3,42463760,0.0000000706 ,3\n20191014,IBM,1423100,1424300,1413200,1419900,1938501,0.5,0.032632396,15.3221970000 ,-1\n20191015,AAPL,2363900,2376500,2348800,2353200,18817360,0.5,0.032632396,15.3221970000 ,-1\n20191015,GOOG,12216800,12472000,12202900,12425100,1267548,0.5,0.032632396,15.3221970000 ,-1\n20191015,IBM,1425400,1437200,1418100,1429300,2580404,2,0.204489471,9.7804546620 ,1\n20191016,AAPL,2333700,2352400,2332000,2343900,16250144,2,0.204489471,9.7804546620 ,1\n20191016,GOOG,12408300,12547400,12382000,12436500,975593,2,0.204489471,9.7804546620 ,1\n20191016,IBM,1424500,1429500,1414000,1420400,4356894,0.5,0.047342709,10.5612883300 ,-1\n20191017,AAPL,2350900,2361500,2335300,2352900,15525663,0.5,0.047342709,10.5612883300 ,-1\n20191017,GOOG,12509400,12634600,12498600,12530600,853693,0.5,0.047342709,10.5612883300 ,-1\n20191017,IBM,1350000,1360000,1329200,1342500,14363555,2,1.140341371,1.7538607740 ,1\n20191018,AAPL,2343600,2375800,2342900,2362800,21645988,2,1.140341371,1.7538607740 ,1\n20191018,GOOG,12542200,12590600,12410700,12454900,1218185,2,1.140341371,1.7538607740 ,1\n20191018,IBM,1343900,1344900,1322700,1340900,6279388,0.5,2.887065988,0.1731862040 ,-1\n20191021,AAPL,2376500,2409900,2373200,2405300,19185571,0.5,2.887065988,0.1731862040 ,-1\n20191021,GOOG,12517900,12549300,12405700,12460400,871520,0.5,2.887065988,0.1731862040 ,-1\n20191021,IBM,1325400,1330900,1309000,1325800,5444353,2,3.684017366,0.5428856060 ,1\n20191022,AAPL,2411700,2422000,2396200,2399700,19151854,2,3.684017366,0.5428856060 ,1\n20191022,GOOG,12489900,12506200,12413900,12429400,960662,2,3.684017366,0.5428856060 ,1\n20191022,IBM,1325300,1340500,1316100,1339400,3711584,0.5,0.184541009,2.7094248740 ,-1\n20191023,AAPL,2421000,2432400,2412200,2431400,17279116,0.5,0.184541009,2.7094248740 ,-1\n20191023,GOOG,12414700,12598900,12414700,12592400,830273,0.5,0.184541009,2.7094248740 ,-1\n20191023,IBM,1335200,1345600,1327300,1343900,3112861,3,21222250,0.0000001414 ,3\n20191024,AAPL,2445100,2448000,2418100,2436000,15751993,3,21222250,0.0000001414 ,3\n20191024,GOOG,12614500,12640000,12539300,12604600,908331,3,21222250,0.0000001414 ,3\n20191024,IBM,1347900,1350700,1333100,1340800,2249594,2,7.405924802,0.2700540520 ,1\n20191025,AAPL,2431700,2467300,2428800,2465800,15719212,2,7.405924802,0.2700540520 ,1\n20191025,GOOG,12531100,12695400,12500000,12650700,1085974,2,7.405924802,0.2700540520 ,1\n20191025,IBM,1341000,1359200,1341000,1354100,2267458,3,19072644,0.0000001573 ,3\n20191028,AAPL,2475000,2492500,2467300,2490400,21869429,3,19072644,0.0000001573 ,3\n20191028,GOOG,12760000,12993300,12725400,12901800,2032974,3,19072644,0.0000001573 ,3\n20191028,IBM,1360000,1366100,1354500,1359700,2629152,3,26531555,0.0000001131 ,3\n20191029,AAPL,2490100,2497400,2425700,2432900,32432237,3,26531555,0.0000001131 ,3\n20191029,GOOG,12765900,12815900,12571000,12628200,1703363,3,26531555,0.0000001131 ,3\n20191029,IBM,1354400,1355700,1334400,1338200,3793673,0,0,0.0000000000 ,-3\n20191030,AAPL,2449000,2453000,2412100,2433000,25182163,0,0,0.0000000000 ,-3\n20191030,GOOG,12564400,12693600,12518500,12612000,1257190,0,0,0.0000000000 ,-3\n20191030,IBM,1338200,1352800,1332600,1352500,1995841,2,21.61805614,0.0925152560 ,1\n20191031,AAPL,2472000,2491800,2423700,2488400,29358225,2,21.61805614,0.0925152560 ,1\n20191031,GOOG,12612800,12675500,12507900,12602000,1125543,2,21.61805614,0.0925152560 ,1\n20191031,IBM,1351000,1351100,1332300,1337500,2406865,0.5,8.311108173,0.0601604490 ,-1\n20191101,AAPL,2495400,2559300,2491700,2558300,34738822,0.5,8.311108173,0.0601604490 ,-1\n20191101,GOOG,12649200,12746200,12602900,12745000,1437033,0.5,8.311108173,0.0601604490 ,-1\n20191101,IBM,1345000,1355600,1340900,1355300,2494236,3,38670091,0.0000000776 ,3\n20191104,AAPL,2573700,2578500,2553800,2574800,23068018,3,38670091,0.0000000776 ,3\n20191104,GOOG,12771000,12941000,12762700,12909600,1330494,3,38670091,0.0000000776 ,3\n20191104,IBM,1364100,1377400,1362300,1376800,2675125,3,27073637,0.0000001108 ,3\n20191105,AAPL,2570600,2581900,2563200,2571500,17418674,3,27073637,0.0000001108 ,3\n20191105,GOOG,12934500,12989300,12913100,12918200,1092319,3,27073637,0.0000001108 ,3\n20191105,IBM,1378000,1387600,1376500,1378900,2148099,2,0.186031267,10.7508809300 ,1\n20191106,AAPL,2568700,2574900,2553600,2572400,15127808,2,0.186031267,10.7508809300 ,1\n20191106,GOOG,12894600,12934200,12827400,12913400,925635,2,0.186031267,10.7508809300 ,1\n20191106,IBM,1379300,1387700,1375500,1387700,2968964,2,19.55065658,0.1022983550 ,1\n20191107,AAPL,2587400,2603500,2581100,2594900,21971865,2,19.55065658,0.1022983550 ,1\n20191107,GOOG,12947300,13238000,12941200,13088600,1894197,2,19.55065658,0.1022983550 ,1\n20191107,IBM,1378700,1391400,1375900,1376900,2563423,2,9.310231671,0.2148174260 ,1\n20191108,AAPL,2587000,2604400,2568500,2601400,15707487,2,9.310231671,0.2148174260 ,1\n20191108,GOOG,13054800,13181900,13035300,13113100,1161270,2,9.310231671,0.2148174260 ,1\n20191108,IBM,1375800,1376100,1362200,1376000,1881670,2,8.96477969,0.2230952760 ,1\n20191111,AAPL,2583000,2624700,2582700,2622000,19212474,2,8.96477969,0.2230952760 ,1\n20191111,GOOG,13033700,13070000,12974600,12989200,902335,2,8.96477969,0.2230952760 ,1\n20191111,IBM,1371400,1371400,1350000,1354500,2089368,0.5,6.421918887,0.0778583490 ,-1\n20191112,AAPL,2615600,2627900,2609200,2619800,19134367,0.5,6.421918887,0.0778583490 ,-1\n20191112,GOOG,13008900,13100000,12955000,12987900,851300,0.5,6.421918887,0.0778583490 ,-1\n20191112,IBM,1357000,1366400,1350200,1356000,2343046,0.5,0.117236317,4.2648900340 ,-1\n20191113,AAPL,2611300,2647800,2610500,2644700,23793564,0.5,0.117236317,4.2648900340 ,-1\n20191113,GOOG,12940700,13040000,12935100,12974400,739932,0.5,0.117236317,4.2648900340 ,-1\n20191113,IBM,1352800,1355800,1338500,1344700,2444171,0.5,7.472611282,0.0669110140 ,-1\n20191114,AAPL,2638800,2648800,2620900,2626900,19914659,0.5,7.472611282,0.0669110140 ,-1\n20191114,GOOG,12968900,13170500,12956200,13115800,1053847,0.5,7.472611282,0.0669110140 ,-1\n20191114,IBM,1341300,1343300,1333400,1339900,3652342,0.5,0.04471706,11.1814148800 ,-1\n20191115,AAPL,2637000,2657800,2630100,2657500,22034209,0.5,0.04471706,11.1814148800 ,-1\n20191115,GOOG,13162100,13348800,13142200,13348600,1385295,0.5,0.04471706,11.1814148800 ,-1\n20191115,IBM,1343900,1351200,1340300,1343600,2726635,3,26146139,0.0000001147 ,3\n20191118,AAPL,2657900,2674300,2642300,2671200,17721094,3,26146139,0.0000001147 ,3\n20191118,GOOG,13336400,13359400,13175000,13206500,1209170,3,26146139,0.0000001147 ,3\n20191118,IBM,1343000,1344700,1332300,1342600,2344828,0.5,4.986241973,0.1002759200 ,-1\n20191119,AAPL,2678600,2680000,2654000,2662900,14461687,0.5,4.986241973,0.1002759200 ,-1\n20191119,GOOG,13273900,13278700,13128500,13151300,978451,0.5,4.986241973,0.1002759200 ,-1\n20191119,IBM,1348800,1353800,1344600,1345000,2113812,0.5,0.136903699,3.6522022680 ,-1\n20191120,AAPL,2655500,2660800,2604000,2632200,21910862,0.5,0.136903699,3.6522022680 ,-1\n20191120,GOOG,13117400,13152200,12910000,13028600,1045769,0.5,0.136903699,3.6522022680 ,-1\n20191120,IBM,1343300,1344600,1327600,1331700,2656759,0,0,0.0000000000 ,-3\n20191121,AAPL,2639800,2640100,2611800,2620100,25496077,0,0,0.0000000000 ,-3\n20191121,GOOG,13016400,13125900,12927800,13011200,823543,0,0,0.0000000000 ,-3\n20191121,IBM,1334000,1341700,1330000,1338200,1922589,0.5,0.073047749,6.8448378880 ,-1\n20191122,AAPL,2625500,2631800,2608400,2618400,14050291,0.5,0.073047749,6.8448378880 ,-1\n20191122,GOOG,13050000,13085700,12913200,12953500,1129508,0.5,0.073047749,6.8448378880 ,-1\n20191122,IBM,1341900,1346500,1335900,1342800,1854309,0.5,0.122156361,4.0931147250 ,-1\n20191125,AAPL,2626400,2664400,2625200,2664200,14952237,0.5,0.122156361,4.0931147250 ,-1\n20191125,GOOG,12993600,13114600,12977200,13069500,824157,0.5,0.122156361,4.0931147250 ,-1\n20191125,IBM,1345800,1360000,1343500,1359600,1951649,3,17728043,0.0000001692 ,3\n20191126,AAPL,2669300,2672100,2625000,2641000,14612190,3,17728043,0.0000001692 ,3\n20191126,GOOG,13093300,13150000,13052200,13135400,808707,3,17728043,0.0000001692 ,3\n20191126,IBM,1360800,1360800,1347700,1350600,2161558,0.5,0.048212659,10.3707202700 ,-1\n20191127,AAPL,2656300,2679800,2653100,2679400,14257370,0.5,0.048212659,10.3707202700 ,-1\n20191127,GOOG,13149200,13183600,13099400,13135000,839355,0.5,0.048212659,10.3707202700 ,-1\n20191127,IBM,1354200,1357100,1336200,1337400,2736584,0.5,3.987028302,0.1254066840 ,-1\n20191129,AAPL,2666000,2680000,2659000,2671800,8740858,0.5,3.987028302,0.1254066840 ,-1\n20191129,GOOG,13071100,13103600,13039700,13044800,443442,0.5,3.987028302,0.1254066840 ,-1\n20191129,IBM,1335000,1344900,1330300,1344600,1258007,0.5,0.13697364,3.6503373930 ,-1\n20191202,AAPL,2675900,2682500,2634500,2640900,19883796,0.5,0.13697364,3.6503373930 ,-1\n20191202,GOOG,13034900,13058300,12810000,12897700,1228578,0.5,0.13697364,3.6503373930 ,-1\n20191202,IBM,1345000,1345000,1324800,1329500,2379052,0,0,0.0000000000 ,-3\n20191203,AAPL,2582500,2595300,2562900,2595200,25349659,0,0,0.0000000000 ,-3\n20191203,GOOG,12798700,12986400,12786700,12952700,1020330,0,0,0.0000000000 ,-3\n20191203,IBM,1318400,1324400,1307000,1320900,2988726,0.5,0.036005228,13.8868722100 ,-1\n20191204,AAPL,2610700,2633100,2606900,2617400,14277781,0.5,0.036005228,13.8868722100 ,-1\n20191204,GOOG,13071100,13258300,13047000,13203000,1375828,0.5,0.036005228,13.8868722100 ,-1\n20191204,IBM,1328100,1336600,1319600,1320000,2572145,2,6.085819034,0.3286328410 ,1\n20191205,AAPL,2637500,2658900,2627300,2655800,15167492,2,6.085819034,0.3286328410 ,1\n20191205,GOOG,13293300,13296000,13163100,13287200,1000657,2,6.085819034,0.3286328410 ,1\n20191205,IBM,1329500,1332400,1316300,1319000,3036627,2,5.324377673,0.3756307540 ,1\n20191206,AAPL,2675000,2710000,2673000,2707000,22748535,2,5.324377673,0.3756307540 ,1\n20191206,GOOG,13338700,13444200,13331200,13406200,1105070,2,5.324377673,0.3756307540 ,1\n20191206,IBM,1328500,1338900,1327000,1332000,2927403,3,26781008,0.0000001120 ,3\n20191209,AAPL,2700700,2707900,2649100,2669200,27578946,3,26781008,0.0000001120 ,3\n20191209,GOOG,13382400,13595600,13370200,13435500,1182862,3,26781008,0.0000001120 ,3\n20191209,IBM,1334000,1345600,1332600,1339400,2232481,2,0.123838779,16.1500300300 ,1\n20191210,AAPL,2686000,2700700,2658600,2686200,20123240,2,0.123838779,16.1500300300 ,1\n20191210,GOOG,13424900,13499500,13355200,13449500,929248,2,0.123838779,16.1500300300 ,1\n20191210,IBM,1340700,1348400,1335600,1339000,2724122,2,7.728173701,0.2587933550 ,1\n20191211,AAPL,2688000,2711000,2685000,2707400,16804424,2,7.728173701,0.2587933550 ,1\n20191211,GOOG,13473400,13517500,13427000,13450200,704154,2,7.728173701,0.2587933550 ,1\n20191211,IBM,1341000,1345000,1336800,1337600,2712692,2,6.454318441,0.3098700530 ,1\n20191212,AAPL,2678200,2725500,2673200,2714600,30574418,2,6.454318441,0.3098700530 ,1\n20191212,GOOG,13459400,13554200,13403500,13499300,1095676,2,6.454318441,0.3098700530 ,1\n20191212,IBM,1337400,1356600,1336600,1353200,2732737,3,34402831,0.0000000872 ,3\n20191213,AAPL,2714400,2753000,2709300,2752500,29562777,3,34402831,0.0000000872 ,3\n20191213,GOOG,13497800,13531400,13437700,13478300,1184357,3,34402831,0.0000000872 ,3\n20191213,IBM,1345800,1355000,1340100,1342300,2059243,0.5,9.114187014,0.0548595280 ,-1\n20191216,AAPL,2769900,2807900,2769500,2798600,26440928,0.5,9.114187014,0.0548595280 ,-1\n20191216,GOOG,13560000,13647500,13521000,13614400,1139317,0.5,9.114187014,0.0548595280 ,-1\n20191216,IBM,1347000,1354500,1338600,1341200,2164923,2,12.73959628,0.1569908460 ,1\n20191217,AAPL,2796600,2817700,2788000,2804400,24199828,2,12.73959628,0.1569908460 ,1\n20191217,GOOG,13635600,13650000,13514300,13548400,1499801,2,12.73959628,0.1569908460 ,1\n20191217,IBM,1343300,1346900,1334600,1342300,2260885,2,17.64281595,0.1133605890 ,1\n20191218,AAPL,2797100,2819000,2791200,2797100,22958590,2,17.64281595,0.1133605890 ,1\n20191218,GOOG,13574500,13605200,13511400,13519400,1012765,2,17.64281595,0.1133605890 ,1\n20191218,IBM,1345100,1350000,1341700,1344500,2112294,0.5,0.088117422,5.6742468020 ,-1\n20191219,AAPL,2795100,2811800,2789500,2800300,17549156,0.5,0.088117422,5.6742468020 ,-1\n20191219,GOOG,13518200,13584500,13488900,13562000,1083615,0.5,0.088117422,5.6742468020 ,-1\n20191219,IBM,1344600,1347100,1341900,1344800,2381597,3,21014368,0.0000001428 ,3\n20191220,AAPL,2821700,2826500,2785600,2792800,28653733,3,21014368,0.0000001428 ,3\n20191220,GOOG,13633500,13637000,13490000,13492900,1666550,3,21014368,0.0000001428 ,3\n20191220,IBM,1357400,1364100,1350300,1356200,4239216,0.5,0.139814526,3.5761663280 ,-1\n20191223,AAPL,2805800,2842500,2803700,2839700,18669478,0.5,0.139814526,3.5761663280 ,-1\n20191223,GOOG,13574300,13598000,13465900,13483400,710157,0.5,0.139814526,3.5761663280 ,-1\n20191223,IBM,1357000,1361200,1350100,1355600,1898481,0.5,7.156791398,0.0698637100 ,-1\n20191224,AAPL,2845200,2848900,2829300,2842700,9434609,0.5,7.156791398,0.0698637100 ,-1\n20191224,GOOG,13485000,13504800,13428200,13434800,273972,0.5,7.156791398,0.0698637100 ,-1\n20191224,IBM,1356200,1356200,1346100,1349600,1012044,0.5,7.336307635,0.0681541760 ,-1\n20191226,AAPL,2848200,2899800,2847000,2899100,20594335,0.5,7.336307635,0.0681541760 ,-1\n20191226,GOOG,13468600,13613800,13444300,13604000,575477,0.5,7.336307635,0.0681541760 ,-1\n20191226,IBM,1349700,1353000,1346600,1349000,1481367,2,14.29072742,0.1399508890 ,1\n20191227,AAPL,2910600,2939700,2881100,2898200,32582221,2,14.29072742,0.1399508890 ,1\n20191227,GOOG,13625800,13647500,13493100,13513400,907153,2,14.29072742,0.1399508890 ,1\n20191227,IBM,1350000,1357500,1348800,1352800,2180289,0.5,0.065103904,7.6800309860 ,-1\n20191230,AAPL,2895700,2926900,2852300,2917000,33654017,0.5,0.065103904,7.6800309860 ,-1\n20191230,GOOG,13516700,13527900,13339900,13363700,922092,0.5,0.065103904,7.6800309860 ,-1\n20191230,IBM,1352500,1353000,1325000,1327600,3309507,0.5,7.953026031,0.0628691520 ,-1\n20191231,AAPL,2899300,2936800,2895200,2933700,21171424,0.5,7.953026031,0.0628691520 ,-1\n20191231,GOOG,13330900,13383100,13292100,13368700,708707,0.5,7.953026031,0.0628691520 ,-1\n20191231,IBM,1325500,1341200,1324000,1340200,2844027,3,24724158,0.0000001213 ,3\n"
  },
  {
    "path": "Tests/TestData/bi_datatest.csv",
    "content": "Symbol,Date,High,Low,Open,Close,Volume,Adj Close,Beta\nAMZN,20211004,3279.989990234375,3176.25,3279.389892578125,3189.780029296875,4523100,3189.780029296875,0\nSPX,20211004,4355.509765625,4278.93994140625,4348.83984375,4300.4599609375,3110560000,4300.4599609375,0\nAMZN,20211005,3260.72998046875,3202.4599609375,3204.5,3221.0,3269200,3221.0,0\nSPX,20211005,4369.22998046875,4309.8701171875,4309.8701171875,4345.72021484375,2967400000,4345.72021484375,0\nAMZN,20211006,3264.340087890625,3198.6201171875,3213.530029296875,3262.010009765625,2533000,3262.010009765625,0\nSPX,20211006,4365.56982421875,4290.490234375,4319.56982421875,4363.5498046875,3219590000,4363.5498046875,-0.458533447\nAMZN,20211007,3325.75,3283.06005859375,3291.5400390625,3302.429931640625,2409100,3302.429931640625,-0.458533447\nSPX,20211007,4429.97021484375,4383.72998046875,4383.72998046875,4399.759765625,3096080000,4399.759765625,-0.409675968\nAMZN,20211008,3321.429931640625,3288.199951171875,3317.0,3288.6201171875,1995500,3288.6201171875,-0.409675968\nSPX,20211008,4412.02001953125,4386.22021484375,4406.509765625,4391.33984375,2401890000,4391.33984375,1.166105454\nAMZN,20211011,3292.590087890625,3238.10009765625,3275.0,3246.300048828125,2034200,3246.300048828125,1.166105454\nSPX,20211011,4415.8798828125,4360.58984375,4385.43994140625,4361.18994140625,2580000000,4361.18994140625,1.46640552\nAMZN,20211012,3267.530029296875,3236.280029296875,3257.0,3247.330078125,1819600,3247.330078125,1.46640552\nSPX,20211012,4374.89013671875,4342.08984375,4368.31005859375,4350.64990234375,2608150000,4350.64990234375,1.750343086\nAMZN,20211013,3288.3798828125,3261.090087890625,3269.7099609375,3284.280029296875,2420100,3284.280029296875,1.750343086\nSPX,20211013,4372.8701171875,4329.919921875,4358.009765625,4363.7998046875,2926460000,4363.7998046875,1.727848937\nAMZN,20211014,3312.60009765625,3290.780029296875,3302.449951171875,3299.860107421875,2109500,3299.860107421875,1.727848937\nSPX,20211014,4439.72998046875,4386.75,4386.75,4438.259765625,2642920000,4438.259765625,0.621509074\nAMZN,20211015,3410.419921875,3304.0,3311.419921875,3409.02001953125,5175100,3409.02001953125,0.621509074\nSPX,20211015,4475.81982421875,4447.68994140625,4447.68994140625,4471.3701171875,3000560000,4471.3701171875,0.922922917\nAMZN,20211018,3449.169921875,3385.10009765625,3388.360107421875,3446.739990234375,3174100,3446.739990234375,0.922922917\nSPX,20211018,4488.75,4447.47021484375,4463.72021484375,4486.4599609375,2683540000,4486.4599609375,0.25307576\nAMZN,20211019,3454.68994140625,3422.0,3434.2900390625,3444.14990234375,2386100,3444.14990234375,0.25307576\nSPX,20211019,4520.39990234375,4496.41015625,4497.33984375,4519.6298828125,2531210000,4519.6298828125,-0.484044822\nAMZN,20211020,3462.860107421875,3400.3701171875,3452.659912109375,3415.06005859375,2139800,3415.06005859375,-0.484044822\nSPX,20211020,4540.8701171875,4524.39990234375,4524.419921875,4536.18994140625,2671560000,4536.18994140625,0.157447516\nAMZN,20211021,3440.280029296875,3403.0,3414.25,3435.010009765625,1881400,3435.010009765625,0.157447516\nSPX,20211021,4551.43994140625,4526.89013671875,4532.240234375,4549.77978515625,3016950000,4549.77978515625,3.070627551\nAMZN,20211022,3429.840087890625,3331.300048828125,3421.0,3335.550048828125,3139100,3335.550048828125,3.070627551\nSPX,20211022,4559.669921875,4524.0,4546.1201171875,4544.89990234375,3062810000,4544.89990234375,3.293313624\nAMZN,20211025,3347.800048828125,3297.699951171875,3335.0,3320.3701171875,2226000,3320.3701171875,3.293313624\nSPX,20211025,4572.6201171875,4537.35986328125,4553.68994140625,4566.47998046875,3250210000,4566.47998046875,3.196949447\nAMZN,20211026,3416.1201171875,3343.97998046875,3349.510009765625,3376.070068359375,2698300,3376.070068359375,3.196949447\nSPX,20211026,4598.52978515625,4569.169921875,4578.68994140625,4574.7900390625,2866500000,4574.7900390625,3.703064397\nAMZN,20211027,3437.0,3371.449951171875,3388.0,3392.489990234375,2702200,3392.489990234375,3.703064397\nSPX,20211027,4584.56982421875,4551.66015625,4580.22021484375,4551.68017578125,3259510000,4551.68017578125,0.626560824\nAMZN,20211028,3479.0,3386.0,3402.10009765625,3446.570068359375,5708700,3446.570068359375,0.626560824\nSPX,20211028,4597.5498046875,4562.83984375,4562.83984375,4596.419921875,3197560000,4596.419921875,1.278764178\nAMZN,20211029,3374.820068359375,3273.320068359375,3300.02001953125,3372.429931640625,6469500,3372.429931640625,1.278764178\nSPX,20211029,4608.080078125,4567.58984375,4572.8701171875,4605.3798828125,3632260000,4605.3798828125,0.588131043\nAMZN,20211101,3375.860107421875,3292.02001953125,3361.800048828125,3318.110107421875,3608900,3318.110107421875,0.588131043\nSPX,20211101,4620.33984375,4595.06005859375,4610.6201171875,4613.669921875,2924000000,4613.669921875,0.826491586\nAMZN,20211102,3331.1201171875,3283.550048828125,3315.010009765625,3312.75,2627600,3312.75,0.826491586\nSPX,20211102,4635.14990234375,4613.33984375,4613.33984375,4630.64990234375,3309690000,4630.64990234375,0.887785578\nAMZN,20211103,3394.919921875,3297.52001953125,3309.0,3384.0,3397200,3384.0,0.887785578\nSPX,20211103,4663.4599609375,4621.18994140625,4630.64990234375,4660.56982421875,3339440000,4660.56982421875,4.895868782\nAMZN,20211104,3498.6298828125,3365.0,3370.0,3477.0,5346300,3477.0,4.895868782\nSPX,20211104,4683.0,4662.58984375,4662.93017578125,4680.06005859375,3332940000,4680.06005859375,9.779665289\nAMZN,20211105,3566.25,3476.97998046875,3477.0,3549.01953125,2937769,3549.01953125,9.779665289\nSPX,20211105,4718.5,4699.259765625,4699.259765625,4701.85986328125,1462781000,4701.85986328125,8.761816471"
  },
  {
    "path": "Tests/TestData/custom_future_chris_cme_es1.csv",
    "content": "Date,Open,High,Low,Last,Change,Settle,Volume,Previous Day Open Interest\n2018-03-27,2659.5,2679.75,2596.0,2612.75,43.75,2615.75,2367868.0,2889651.0\n2018-03-28,2612.75,2633.75,2593.0,2608.0,8.25,2607.5,2730613.0,2884080.0\n2018-03-29,2609.75,2659.5,2601.0,2637.25,35.5,2643.0,1960617.0,2918961.0\n2018-04-02,2635.0,2641.5,2552.0,2582.75,68.0,2575.0,2324918.0,2887303.0\n2018-04-03,2581.25,2618.75,2573.5,2612.75,38.25,2613.25,2158961.0,2933144.0\n2018-04-04,2612.0,2649.75,2559.5,2645.0,33.75,2647.0,2175430.0,2942545.0\n2018-04-05,2645.75,2672.25,2644.0,2662.0,14.75,2661.75,1588771.0,2937636.0\n2018-04-06,2663.0,2664.0,2584.5,2605.0,56.0,2605.75,2512853.0,2914793.0\n2018-04-09,2607.5,2653.75,2607.5,2618.0,13.25,2619.0,1713782.0,2900411.0\n2018-04-10,2617.75,2666.25,2612.25,2654.5,36.0,2655.0,1943849.0,2923967.0\n2018-04-11,2654.5,2661.25,2626.0,2642.5,14.0,2641.0,1584027.0,2907441.0\n2018-04-12,2642.5,2675.0,2639.75,2665.0,23.0,2664.0,1252235.0,2860319.0\n2018-04-13,2661.75,2680.5,2644.75,2659.25,6.75,2657.25,1647627.0,2860677.0\n2018-04-16,2673.25,2687.0,2660.75,2679.5,24.5,2681.75,1186422.0,2875836.0\n2018-04-17,2679.25,2713.75,2678.75,2705.5,24.75,2706.5,1217732.0,2868740.0\n2018-04-18,2704.5,2718.5,2703.75,2710.5,3.25,2709.75,1027616.0,2880705.0\n2018-04-19,2711.75,2713.25,2681.5,2692.75,16.75,2693.0,1530003.0,2876346.0"
  },
  {
    "path": "Tests/TestData/custom_future_chris_cme_es2.csv",
    "content": "Date,Open,High,Low,Last,Change,Settle,Volume,Previous Day Open Interest\n2018-03-27,2665.0,2684.25,2600.75,2617.5,44.25,2620.25,8142.0,56806.0\n2018-03-28,2615.25,2638.0,2597.25,2612.5,8.0,2612.25,7373.0,59939.0\n2018-03-29,2615.0,2664.0,2606.0,2641.0,35.5,2647.75,6649.0,62020.0\n2018-04-02,2639.0,2645.75,2556.75,2587.0,68.75,2579.0,7456.0,65324.0\n2018-04-03,2586.5,2622.25,2578.0,2616.75,38.25,2617.25,20221.0,68892.0\n2018-04-04,2616.5,2653.75,2563.5,2649.25,33.75,2651.0,8283.0,77232.0\n2018-04-05,2650.5,2676.0,2648.25,2666.25,15.0,2666.0,9843.0,79005.0\n2018-04-06,2666.25,2667.5,2588.25,2608.75,56.0,2610.0,14135.0,81064.0\n2018-04-09,2613.0,2657.25,2613.0,2622.0,13.0,2623.0,10932.0,81272.0\n2018-04-10,2621.5,2670.25,2616.5,2658.5,36.25,2659.25,4706.0,84533.0\n2018-04-11,2658.0,2665.25,2630.5,2647.0,14.0,2645.25,3353.0,84462.0\n2018-04-12,2647.25,2679.0,2644.5,2669.0,23.0,2668.25,4662.0,84754.0\n2018-04-13,2665.5,2684.25,2649.0,2663.5,6.5,2661.75,6287.0,85412.0\n2018-04-16,2676.5,2691.5,2665.5,2683.75,24.5,2686.25,3952.0,85062.0\n2018-04-17,2686.0,2718.5,2683.75,2710.0,25.0,2711.25,6342.0,85786.0\n2018-04-18,2709.5,2722.75,2708.25,2715.5,3.25,2714.5,7295.0,86883.0\n2018-04-19,2716.5,2717.5,2686.5,2698.0,16.5,2698.0,22463.0,85271.0"
  },
  {
    "path": "Tests/TestData/daily-stock-picker-backtest.csv",
    "content": "20170704,SPY,QQQ,FB,AAPL,IWM\n20170706,QQQ,AAPL,IWM,FB,GOOGL\n20170707,IWM,AAPL,FB,BAC,GOOGL\n20170708,AAPL,FB,GOOGL,GOOG,BAC\n20170711,FB,GOOGL,BAC,GOOG,IBM\n20170712,BAC,GOOGL,GOOG,IBM,AIG\n20170713,GOOG,BAC,IBM,USO,AIG\n20170714,BAC,AIG,IBM,USO,WM\n20170715,IBM,USO,AIG,WM,BNO\n20170718,SPY,QQQ,AAPL,IWM,FB\n20170719,QQQ,FB,AAPL,BAC,IWM\n20170720,FB,AAPL,IWM,IBM,BAC\n20170721,FB,AAPL,GOOG,BAC,GOOGL\n20170722,FB,GOOG,GOOGL,BAC,IBM\n20170725,FB,IWM,BAC,IBM,AIG\n20170726,FB,BAC,IBM,AIG,USO\n20170727,BAC,IBM,USO,AIG,WM\n20170728,IBM,AIG,USO,WM,BNO\n20170729,SPY,QQQ,FB,AAPL,IWM\n20170801,QQQ,FB,AAPL,IWM,GOOGL\n20170802,QQQ,IWM,FB,BAC,GOOGL\n20170803,IWM,FB,GOOGL,GOOG,BAC\n20170804,FB,BAC,GOOG,GOOGL,AIG\n20170805,FB,GOOGL,GOOG,IBM,AIG\n20170808,GOOG,BAC,IBM,AIG,USO\n20170809,GOOG,IBM,AIG,USO,WM\n20170810,IBM,AIG,USO,WM,BNO\n20170811,SPY,QQQ,IWM,AAPL,FB\n20170812,QQQ,AAPL,IWM,FB,BAC\n20170815,AAPL,IWM,FB,BAC,GOOGL\n20170816,IWM,FB,BAC,GOOGL,GOOG\n20170817,FB,BAC,GOOGL,GOOG,IBM\n20170818,BAC,GOOGL,GOOG,IBM,AIG\n20170819,GOOGL,GOOG,IBM,AIG,USO\n20170822,GOOG,IBM,USO,AIG,WM\n20170823,AIG,IBM,USO,WM,BNO\n20170824,SPY,QQQ,AAPL,IWM,FB\n20170825,QQQ,AAPL,IWM,FB,GOOG\n20170826,QQQ,IWM,FB,GOOGL,BAC\n20170829,IWM,FB,GOOGL,GOOG,BAC\n20170830,FB,BAC,GOOG,GOOGL,IBM\n20170831,GOOG,BAC,GOOGL,IBM,AIG\n20170901,GOOG,BAC,IBM,AIG,USO\n20170902,GOOG,IBM,AIG,USO,WM\n20170906,AIG,IBM,WM,USO,BNO\n20170907,SPY,QQQ,AAPL,IWM,FB\n20170908,QQQ,AAPL,FB,IWM,BAC\n20170909,AAPL,IWM,FB,BAC,GOOG\n20170912,IWM,FB,BAC,GOOGL,GOOG\n20170913,BAC,FB,GOOGL,GOOG,IBM\n20170914,FB,GOOG,GOOGL,IBM,AIG\n20170915,GOOGL,GOOG,IBM,AIG,USO\n20170916,BAC,IBM,AIG,WM,USO\n20170919,IBM,AIG,USO,WM,BNO\n20170920,SPY,QQQ,AAPL,FB,IWM\n20170921,AAPL,QQQ,IWM,BAC,FB\n20170922,QQQ,IWM,FB,BAC,GOOGL\n20170923,QQQ,FB,BAC,GOOGL,GOOG\n20170926,IWM,GOOGL,GOOG,BAC,IBM\n20170927,GOOG,GOOGL,BAC,IBM,AIG\n20170928,BAC,GOOG,IBM,AIG,USO\n20170929,GOOG,IBM,USO,WM,AIG\n20170930,IBM,AIG,USO,WM,BNO\n20171003,SPY,IWM,QQQ,AAPL,FB\n20171004,IWM,QQQ,AAPL,BAC,FB\n20171005,IWM,AAPL,FB,BAC,GOOGL\n20171006,AAPL,FB,GOOGL,BAC,GOOG\n20171007,FB,GOOGL,BAC,GOOG,IBM\n20171010,BAC,GOOGL,GOOG,IBM,AIG\n20171011,BAC,GOOG,IBM,AIG,USO\n20171012,BAC,IBM,AIG,WM,USO\n20171013,IBM,AIG,WM,USO,BNO\n20171014,SPY,BAC,QQQ,AAPL,IWM\n20171017,AAPL,QQQ,IWM,BAC,FB\n20171018,AAPL,FB,QQQ,BAC,GOOGL\n20171019,QQQ,AAPL,FB,BAC,GOOGL\n20171020,FB,GOOGL,IBM,BAC,GOOG\n20171021,BAC,GOOGL,GOOG,IBM,AIG\n20171024,GOOGL,GOOG,IBM,AIG,WM\n20171025,IBM,GOOG,AIG,USO,WM\n20171026,IBM,AIG,USO,WM,BNO\n20171027,SPY,QQQ,AAPL,IWM,GOOGL\n20171028,QQQ,AAPL,GOOG,GOOGL,FB\n20171031,QQQ,IWM,FB,GOOGL,GOOG\n20171101,IWM,FB,GOOGL,GOOG,BAC\n20171102,AAPL,GOOGL,GOOG,BAC,IBM\n20171103,BAC,GOOGL,GOOG,IBM,AIG\n20171104,GOOG,BAC,AIG,IBM,USO\n20171107,BAC,IBM,AIG,USO,WM\n20171108,IBM,AIG,USO,WM,BNO\n20171109,SPY,IWM,AAPL,QQQ,BAC\n20171110,QQQ,IWM,AAPL,BAC,FB\n20171111,AAPL,IWM,FB,BAC,GOOGL\n20171114,QQQ,BAC,FB,GOOG,GOOGL\n20171115,FB,BAC,GOOGL,GOOG,IBM\n20171116,FB,GOOGL,GOOG,IBM,AIG\n20171117,GOOGL,GOOG,IBM,AIG,USO\n20171118,BAC,IBM,AIG,WM,USO\n20171121,IBM,AIG,USO,WM,BNO\n20171122,SPY,AAPL,IWM,QQQ,FB\n20171123,AAPL,QQQ,IWM,FB,BAC\n20171125,FB,QQQ,IWM,GOOGL,GOOG\n20171128,IWM,FB,GOOGL,GOOG,BAC\n20171129,BAC,FB,GOOGL,GOOG,IBM\n20171130,BAC,GOOGL,GOOG,IBM,AIG\n20171201,GOOGL,GOOG,IBM,AIG,WM\n20171202,GOOGL,IBM,AIG,WM,USO\n20171205,IBM,AIG,WM,USO,BNO\n20171206,SPY,QQQ,AAPL,IWM,FB\n20171207,QQQ,AAPL,FB,IWM,BAC\n20171208,AAPL,FB,IWM,BAC,GOOGL\n20171209,FB,IWM,BAC,GOOGL,GOOG\n20171212,FB,BAC,GOOGL,GOOG,IBM\n20171213,BAC,GOOGL,GOOG,IBM,AIG\n20171214,GOOGL,GOOG,IBM,AIG,WM\n20171215,GOOGL,IBM,AIG,WM,USO\n20171216,IBM,AIG,WM,USO,BNO\n20171219,SPY,AAPL,QQQ,IWM,FB\n20171220,QQQ,AAPL,IWM,FB,BAC\n20171221,AAPL,IWM,BAC,FB,GOOGL\n20171222,IWM,BAC,FB,GOOGL,GOOG\n20171223,BAC,FB,GOOGL,GOOG,IBM\n20171227,BAC,GOOGL,GOOG,IBM,USO\n20171228,GOOGL,BAC,IBM,AIG,USO\n20171229,GOOG,IBM,AIG,USO,WM\n20171230,IBM,AIG,USO,WM,BNO\n20180103,SPY,QQQ,AAPL,IWM,FB\n20180104,AAPL,QQQ,IWM,FB,GOOGL\n20180105,QQQ,IWM,FB,BAC,GOOGL\n20180106,IWM,FB,GOOGL,BAC,GOOG\n20180109,IWM,BAC,GOOGL,GOOG,IBM\n20180110,BAC,GOOGL,GOOG,IBM,AIG\n20180111,GOOGL,GOOG,IBM,AIG,USO\n20180112,GOOG,IBM,AIG,USO,WM\n20180113,IBM,AIG,USO,WM,BNO\n20180117,SPY,QQQ,FB,AAPL,IWM\n20180118,QQQ,AAPL,FB,BAC,IWM\n20180119,QQQ,FB,IWM,BAC,GOOGL\n20180120,FB,IWM,IBM,BAC,GOOG\n20180123,IWM,GOOGL,GOOG,BAC,IBM\n20180124,GOOGL,BAC,GOOG,IBM,AIG\n20180125,GOOGL,GOOG,IBM,AIG,USO\n20180126,GOOG,IBM,AIG,USO,WM\n20180127,IBM,AIG,USO,WM,BNO\n20180130,SPY,AAPL,QQQ,FB,IWM\n20180131,QQQ,AAPL,IWM,FB,GOOGL\n20180201,AAPL,IWM,FB,GOOGL,BAC\n20180202,AAPL,IWM,GOOGL,GOOG,BAC\n20180203,IWM,GOOG,FB,BAC,IBM\n20180206,BAC,GOOGL,GOOG,IBM,AIG\n20180207,GOOGL,GOOG,IBM,AIG,WM\n20180208,GOOG,IBM,AIG,USO,WM\n20180209,IBM,AIG,USO,WM,BNO\n20180210,SPY,QQQ,AAPL,IWM,FB\n20180213,QQQ,AAPL,FB,IWM,GOOGL\n20180214,AAPL,FB,IWM,BAC,GOOGL\n20180215,IWM,FB,BAC,GOOGL,GOOG\n20180216,FB,BAC,GOOGL,GOOG,IBM\n20180217,GOOGL,GOOG,BAC,IBM,AIG\n20180221,BAC,GOOG,IBM,AIG,USO\n20180222,GOOG,IBM,AIG,WM,USO\n20180223,IBM,AIG,USO,WM,BNO\n20180224,SPY,QQQ,AAPL,FB,IWM\n20180227,AAPL,QQQ,FB,IWM,GOOG\n20180228,AAPL,IWM,FB,GOOGL,BAC\n20180301,IWM,FB,GOOGL,GOOG,BAC\n20180302,FB,GOOGL,BAC,GOOG,IBM\n20180303,GOOGL,GOOG,BAC,IBM,AIG\n20180306,GOOGL,GOOG,IBM,AIG,WM\n20180307,GOOG,IBM,AIG,WM,USO\n20180308,IBM,AIG,USO,WM,BNO\n20180309,SPY,QQQ,AAPL,IWM,FB\n20180310,QQQ,AAPL,IWM,FB,GOOG\n20180313,AAPL,IWM,GOOGL,FB,GOOG\n20180314,FB,IWM,GOOGL,GOOG,BAC\n20180315,IWM,GOOGL,BAC,GOOG,IBM\n20180316,GOOGL,GOOG,BAC,IBM,AIG\n20180317,GOOG,BAC,IBM,AIG,USO\n20180320,BAC,IBM,AIG,WM,USO\n20180321,IBM,AIG,USO,WM,BNO\n20180322,SPY,FB,QQQ,AAPL,IWM\n20180323,QQQ,FB,AAPL,IWM,GOOGL\n20180324,FB,AAPL,IWM,BAC,GOOGL\n20180327,AAPL,IWM,GOOGL,GOOG,BAC\n20180328,IWM,GOOG,GOOGL,BAC,IBM\n20180329,GOOGL,GOOG,BAC,IBM,AIG\n20180330,GOOG,BAC,IBM,AIG,USO\n20180403,BAC,IBM,AIG,USO,WM\n20180404,IBM,AIG,WM,USO,BNO\n20180405,SPY,QQQ,FB,AAPL,IWM\n20180406,QQQ,FB,AAPL,IWM,GOOGL\n20180407,FB,AAPL,IWM,BAC,GOOGL\n20180410,FB,IWM,GOOG,BAC,GOOGL\n20180411,IWM,GOOG,GOOGL,BAC,IBM\n20180412,GOOGL,BAC,GOOG,IBM,USO\n20180413,BAC,GOOG,IBM,AIG,USO\n20180414,GOOG,IBM,AIG,USO,WM\n20180417,IBM,AIG,USO,WM,BNO\n20180418,SPY,QQQ,AAPL,IWM,FB\n20180419,QQQ,AAPL,IWM,FB,IBM\n20180420,AAPL,FB,IWM,BAC,GOOGL\n20180421,IWM,FB,GOOGL,GOOG,BAC\n20180424,GOOGL,IWM,GOOG,BAC,IBM\n20180425,FB,IWM,BAC,IBM,AIG\n20180426,GOOG,BAC,IBM,WM,USO\n20180427,BAC,IBM,USO,WM,AIG\n20180428,IBM,AIG,WM,USO,BNO\n20180501,SPY,QQQ,AAPL,FB,IWM\n20180502,QQQ,AAPL,IWM,FB,GOOGL\n20180503,QQQ,FB,IWM,GOOG,BAC\n20180504,IWM,FB,BAC,GOOGL,GOOG\n20180505,FB,GOOG,GOOGL,BAC,AIG\n20180508,GOOGL,GOOG,BAC,IBM,AIG\n20180509,GOOGL,GOOG,USO,IBM,AIG\n20180510,GOOG,IBM,AIG,USO,WM\n20180511,IBM,AIG,USO,WM,BNO\n20180512,SPY,AAPL,QQQ,FB,IWM\n20180515,QQQ,AAPL,IWM,FB,GOOGL\n20180516,AAPL,IWM,FB,BAC,GOOGL\n20180517,IWM,FB,BAC,GOOGL,GOOG\n20180518,FB,BAC,GOOGL,GOOG,AIG\n20180519,GOOGL,BAC,GOOG,IBM,AIG\n20180522,BAC,GOOG,IBM,AIG,USO\n20180523,GOOGL,IBM,USO,AIG,WM\n20180524,IBM,USO,AIG,WM,BNO\n20180525,SPY,QQQ,AAPL,IWM,BAC\n20180526,QQQ,AAPL,IWM,FB,BAC\n20180530,AAPL,BAC,IWM,FB,GOOG\n20180531,AAPL,FB,BAC,GOOGL,GOOG\n20180601,AAPL,GOOGL,GOOG,BAC,IBM\n20180602,GOOG,FB,BAC,IBM,USO\n20180605,GOOG,BAC,IBM,USO,AIG\n20180606,BAC,IBM,USO,AIG,WM\n20180607,IBM,AIG,USO,WM,BNO\n20180608,SPY,QQQ,FB,AAPL,IWM\n20180609,QQQ,AAPL,IWM,FB,BAC\n20180612,AAPL,IWM,FB,BAC,GOOGL\n20180613,IWM,FB,BAC,GOOGL,GOOG\n20180614,FB,BAC,GOOG,GOOGL,IBM\n20180615,BAC,GOOGL,GOOG,IBM,AIG\n20180616,GOOG,BAC,IBM,AIG,USO\n20180619,GOOG,IBM,AIG,USO,WM\n20180620,IBM,AIG,USO,WM,BNO\n20180621,SPY,QQQ,FB,IWM,AAPL\n20180622,QQQ,AAPL,IWM,FB,GOOGL\n20180623,QQQ,AAPL,FB,BAC,GOOGL\n20180626,AAPL,FB,GOOGL,GOOG,BAC\n20180627,FB,GOOG,GOOGL,BAC,IBM\n20180628,GOOGL,BAC,GOOG,USO,IBM\n20180629,GOOGL,GOOG,IBM,USO,AIG\n20180630,GOOG,IBM,USO,AIG,WM\n20180703,IBM,USO,AIG,WM,BNO\n20180704,SPY,QQQ,AAPL,IWM,FB"
  },
  {
    "path": "Tests/TestData/daily-stock-picker-live.csv",
    "content": "SPY,QQQ,AAPL,IWM,FB"
  },
  {
    "path": "Tests/TestData/dwac_supertrend.txt",
    "content": "Date,Open,High,Low,Close,Super\n2021-09-30T10:30:00Z,10.38,10.38,10.38,10.38,0\n2021-09-30T11:30:00Z,9.98,9.98,9.98,9.98,0\n2021-09-30T15:30:00Z,9.97,9.97,9.97,9.97,0\n2021-10-01T10:30:00Z,9.94,9.94,9.94,9.94,0\n2021-10-06T09:30:00Z,9.92,9.92,9.92,9.92,0\n2021-10-07T12:30:00Z,9.95,9.96,9.95,9.96,0\n2021-10-07T14:30:00Z,9.96,9.96,9.96,9.96,0\n2021-10-19T15:30:00Z,10.01,10.01,10.01,10.01,0\n2021-10-21T09:30:00Z,12.73,16.09,12.63,15.85,0\n2021-10-21T10:30:00Z,15.98,20,15.88,17.72,21.174\n2021-10-21T11:30:00Z,17.73,26.79,17.51,24.86,16.4554\n2021-10-21T12:30:00Z,24.88,39.5,24,39.03,21.97486\n2021-10-21T13:30:00Z,38.96,51.83,36,43.08,30.368374\n2021-10-21T14:30:00Z,42.65,49.99,41.97,45.85,31.3820366\n2021-10-21T15:30:00Z,45.68,46.08,41,45.97,31.3820366\n2021-10-22T09:30:00Z,118.89,170.01,99,99,84.09704965\n2021-10-22T10:30:00Z,94.85,121.67,69.62,76.66,156.6271553\n2021-10-22T11:30:00Z,79.24,107.18,77.54,99.02,156.3999398\n2021-10-22T12:30:00Z,100.75,114.82,97,109.03,156.3999398\n2021-10-22T13:30:00Z,107,107.43,89,93.33,156.3999398\n2021-10-22T14:30:00Z,94.26,101.15,87.5,93.17,154.8434761\n2021-10-22T15:30:00Z,93.52,96,88.18,94.27,148.9026285\n2021-10-25T09:30:00Z,120,120.96,89.01,93,148.9026285\n2021-10-25T10:30:00Z,93,105,93,98,148.9026285\n2021-10-25T11:30:00Z,97.6,103,95.77,101,148.9026285\n2021-10-25T12:30:00Z,100.87,100.87,93,95.2,148.4653306\n2021-10-25T13:30:00Z,94.39,96.25,82.64,86.28,139.9052975\n2021-10-25T14:30:00Z,86.22,93,84.43,86.72,136.7002677\n2021-10-25T15:30:00Z,86.3,89.12,82.505,84.765,130.983741\n2021-10-26T09:30:00Z,87.34,91.28,66.3,68.11,126.9381169\n2021-10-26T10:30:00Z,68.16,71.49,65.38,67,113.6013052\n2021-10-26T11:30:00Z,67.02,71.26,66.24,70.2,110.9056747\n2021-10-26T12:30:00Z,70.7,71.9,66.1,67.05,108.6801072\n2021-10-26T13:30:00Z,67.02,68.86,65.66,67.39,103.9320965\n2021-10-26T14:30:00Z,67.69,67.69,58.52,59.44,98.86088683\n2021-10-26T15:30:00Z,59.21,59.445,55.625,59,90.86129815\n2021-10-27T09:30:00Z,60.12,63.25,52.835,57.98,90.86129815\n2021-10-27T10:30:00Z,57.91,67.99,57.08,66,90.86129815\n2021-10-27T11:30:00Z,65,65,60.62,62.93,90.86129815\n2021-10-27T12:30:00Z,61.7,62.36,59.11,60.65,90.12787472\n2021-10-27T13:30:00Z,60.02,73.98,60.02,69.17,90.12787472\n2021-10-27T14:30:00Z,69.75,73.27,65.83,67.68,90.12787472\n2021-10-27T15:30:00Z,67.95,69.5,64.01,64.7,90.12787472\n2021-10-28T09:30:00Z,70.49,74.74,65.75,74.6,90.12787472\n2021-10-28T10:30:00Z,74.57,76,70.7,70.8,90.12787472\n2021-10-28T11:30:00Z,70.33,73.54,69.51,72.69,90.12787472\n2021-10-28T12:30:00Z,72.49,77.25,72.49,74.71,90.12787472\n2021-10-28T13:30:00Z,74.61,75.9,71.61,73.97,90.12787472\n2021-10-28T14:30:00Z,73.48,75.19,70.4,72.22,90.12787472\n2021-10-28T15:30:00Z,71.61,74.25,71.56,72.77,90.12787472\n2021-10-29T09:30:00Z,70.32,71,66.5,68.68,89.65369053\n2021-10-29T10:30:00Z,69.46,69.5,67.98,68.04,88.00932148\n2021-10-29T11:30:00Z,67.48,68.71,67.3,68.71,85.77038933\n2021-10-29T12:30:00Z,68.14,72,67.97,71.65,85.77038933\n2021-10-29T13:30:00Z,71.345,74.41,70.8,74.19,85.77038933\n2021-10-29T14:30:00Z,74.49,74.64,66.5,67.7,85.77038933\n2021-10-29T15:30:00Z,68.41,68.41,67.02,67.69,83.74426294\n2021-11-01T09:30:00Z,66.6,68.99,65.5,66.82,82.71833665\n2021-11-01T10:30:00Z,66.52,66.52,65.07,66.16,80.24600298\n2021-11-01T11:30:00Z,65.75,66,62,62.22,78.25390268\n2021-11-01T12:30:00Z,62.3,63.5,61.2,61.2,75.86851241\n2021-11-01T13:30:00Z,61.19,62.22,60.5,61.97,74.04266117\n2021-11-01T14:30:00Z,62.04,62.34,61.15,61.36,73.51639506\n2021-11-01T15:30:00Z,61.11,61.28,60.51,60.7,71.74425555\n2021-11-02T09:30:00Z,59.19,59.2,55.95,56.6,68.76433\n2021-11-02T10:30:00Z,56.87,57.47,54.88,57.09,67.022397\n2021-11-02T11:30:00Z,56.94,63.13,56.335,62,67.022397\n2021-11-02T12:30:00Z,62.1,62.1,58.87,60.97,67.022397\n2021-11-02T13:30:00Z,61.81,63.19,60.92,61.25,67.022397\n2021-11-02T14:30:00Z,61.74,68,61.74,67.24,56.04393464\n2021-11-02T15:30:00Z,67.3,67.3,64.5,64.71,56.04393464\n2021-11-03T09:30:00Z,65.22,67.65,61.58,63.05,56.04393464\n2021-11-03T10:30:00Z,63.3,69.75,63.11,67.75,56.04393464\n2021-11-03T11:30:00Z,68.05,68.05,62.71,64.045,56.04393464\n2021-11-03T12:30:00Z,64.04,64.75,63.52,63.71,56.04393464\n2021-11-03T13:30:00Z,64.19,65.43,64.1,65.43,56.04393464\n2021-11-03T14:30:00Z,65.49,65.55,63.1,63.28,56.04393464\n2021-11-03T15:30:00Z,63.35,63.77,63,63.29,56.04393464\n"
  },
  {
    "path": "Tests/TestData/dynamic-market-hours/modified-close/market-hours/market-hours-database.json",
    "content": "{\n  \"entries\": {\n    \"Equity-usa-[*]\": {\n      \"dataTimeZone\": \"America/New_York\",\n      \"exchangeTimeZone\": \"America/New_York\",\n      \"sunday\": [],\n      \"monday\": [\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"13:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"13:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"13:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"13:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"13:00:00\",\n          \"state\": \"market\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": [\n        \"12/25/2024\"\n      ],\n      \"earlyCloses\": {}\n    }\n  }\n}"
  },
  {
    "path": "Tests/TestData/dynamic-market-hours/modified-holidays/market-hours/market-hours-database.json",
    "content": "{\n  \"entries\": {\n    \"Equity-usa-[*]\": {\n      \"dataTimeZone\": \"America/New_York\",\n      \"exchangeTimeZone\": \"America/New_York\",\n      \"sunday\": [],\n      \"monday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": [\n        \"12/13/2024\",\n        \"12/25/2024\"\n      ],\n      \"earlyCloses\": {}\n    }\n  }\n}"
  },
  {
    "path": "Tests/TestData/dynamic-market-hours/original/market-hours/market-hours-database.json",
    "content": "{\n  \"entries\": {\n    \"Equity-usa-[*]\": {\n      \"dataTimeZone\": \"America/New_York\",\n      \"exchangeTimeZone\": \"America/New_York\",\n      \"sunday\": [],\n      \"monday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"tuesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"wednesday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"thursday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"friday\": [\n        {\n          \"start\": \"04:00:00\",\n          \"end\": \"09:30:00\",\n          \"state\": \"premarket\"\n        },\n        {\n          \"start\": \"09:30:00\",\n          \"end\": \"16:00:00\",\n          \"state\": \"market\"\n        },\n        {\n          \"start\": \"16:00:00\",\n          \"end\": \"20:00:00\",\n          \"state\": \"postmarket\"\n        }\n      ],\n      \"saturday\": [],\n      \"holidays\": [\n        \"12/25/2024\"\n      ],\n      \"earlyCloses\": {}\n    }\n  }\n}"
  },
  {
    "path": "Tests/TestData/dynamic-symbol-properties/modified/symbol-properties/symbol-properties-database.csv",
    "content": "market,symbol,type,description,quote_currency,contract_multiplier,minimum_price_variation,lot_size,market_ticker,minimum_order_size,price_magnifier,strike_multiplier\nusa,SPY,equity,,USD,1,0.001,10\n"
  },
  {
    "path": "Tests/TestData/dynamic-symbol-properties/original/symbol-properties/symbol-properties-database.csv",
    "content": "market,symbol,type,description,quote_currency,contract_multiplier,minimum_price_variation,lot_size,market_ticker,minimum_order_size,price_magnifier,strike_multiplier\nusa,SPY,equity,,USD,1,0.01,1\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testbrokerage/dates/20201221.csv",
    "content": "aapl,2000\ngoog,5000\nbac,200\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testbrokerage/dates/20201222.csv",
    "content": "aapl,4000\ngoog,10000\nbac,400\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testbrokerage/symbols/aapl.csv",
    "content": "20201221,2000\n20201222,4000\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testbrokerage/symbols/goog.csv",
    "content": "20201221,5000\n20201222,10000\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testinteractivebrokers/dates/20201221.csv",
    "content": "#SYM,AVAILABLE,REBATERATE,FEERATE\naapl,2000,5.0700,0.2500\ngoog,5000,5.1700,0.3500\nbac,200,,\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testinteractivebrokers/dates/20201222.csv",
    "content": "#SYM,AVAILABLE,REBATERATE,FEERATE\naapl,4000,5.0900,0.3000\ngoog,10000,5.1900,0.4000\nbac,400,,\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testinteractivebrokers/symbols/aapl.csv",
    "content": "#DATE,AVAILABLE,REBATERATE,FEERATE\n20201221,2000,5.0700,0.2500\n20201222,4000,5.0900,0.3000\n"
  },
  {
    "path": "Tests/TestData/equity/usa/shortable/testinteractivebrokers/symbols/goog.csv",
    "content": "#DATE,AVAILABLE,REBATERATE,FEERATE\n20201221,5000,5.1700,0.3500\n20201222,10000,5.1900,0.4000\n"
  },
  {
    "path": "Tests/TestData/eurusd60_dem.txt",
    "content": ",Date,Open,High,Low,Close,Volume,DeM\n0,2019/02/15 14:00:00,1.12525,1.1285100000000001,1.12514,1.12686,9915,\n1,2019/02/15 15:00:00,1.1269,1.1276,1.12574,1.12628,7985,\n2,2019/02/15 16:00:00,1.1263100000000001,1.12744,1.12604,1.12677,5442,\n3,2019/02/15 17:00:00,1.12677,1.1276899999999999,1.1266399999999999,1.12727,2726,\n4,2019/02/15 18:00:00,1.12726,1.13058,1.12717,1.12995,4562,\n5,2019/02/15 19:00:00,1.12996,1.1303,1.12937,1.1294799999999998,3411,\n6,2019/02/15 20:00:00,1.12947,1.13004,1.12943,1.1298700000000002,2135,\n7,2019/02/15 21:00:00,1.1298700000000002,1.12991,1.12904,1.1290799999999999,1568,\n8,2019/02/17 22:05:00,1.12923,1.12933,1.12876,1.12914,856,\n9,2019/02/17 23:05:00,1.1291200000000001,1.1295600000000001,1.1289,1.1294600000000001,1149,\n10,2019/02/18,1.12944,1.13046,1.12934,1.13025,1954,\n11,2019/02/18 01:00:00,1.13022,1.1311200000000001,1.13022,1.13093,1888,\n12,2019/02/18 02:00:00,1.1309200000000001,1.13245,1.1308799999999999,1.13171,2391,\n13,2019/02/18 03:00:00,1.13172,1.1321299999999999,1.13158,1.1316899999999999,1653,0.9033189033189092\n14,2019/02/18 04:00:00,1.1317,1.13178,1.13103,1.13117,1015,0.8368983957219237\n15,2019/02/18 05:00:00,1.13117,1.1313,1.13063,1.13079,1417,0.7944162436548251\n16,2019/02/18 06:00:00,1.13079,1.1311200000000001,1.1306100000000001,1.13079,1661,0.7924050632911511\n17,2019/02/18 07:00:00,1.13079,1.13153,1.1301299999999999,1.13069,3518,0.751756440281016\n18,2019/02/18 08:00:00,1.13068,1.13083,1.12945,1.1307200000000002,4410,0.5576619273301682\n19,2019/02/18 09:00:00,1.1307,1.13185,1.13055,1.13152,3569,0.6190476190476176\n20,2019/02/18 10:00:00,1.13151,1.1329799999999999,1.13106,1.13275,3734,0.6698113207547115\n21,2019/02/18 11:00:00,1.1327399999999999,1.1331,1.1324,1.133,2733,0.7064555420219155\n22,2019/02/18 12:00:00,1.13299,1.13334,1.13244,1.13304,3139,0.7392900856793121\n23,2019/02/18 13:00:00,1.13303,1.13306,1.13202,1.13216,3324,0.6949760765550252\n24,2019/02/18 14:00:00,1.13215,1.13267,1.1319299999999999,1.13216,3257,0.650331125827805\n25,2019/02/18 15:00:00,1.1321700000000001,1.13221,1.1304299999999998,1.13065,3812,0.5065554231227423\n26,2019/02/18 16:00:00,1.13067,1.13132,1.13044,1.13058,3068,0.4135977337110306\n27,2019/02/18 17:00:00,1.13057,1.13107,1.13021,1.13106,1370,0.4005486968449785\n28,2019/02/18 18:00:00,1.13106,1.13129,1.1307,1.1310200000000001,1393,0.4511494252873368\n29,2019/02/18 19:00:00,1.1310200000000001,1.13123,1.13091,1.13117,841,0.4786585365853434\n30,2019/02/18 20:00:00,1.13117,1.13158,1.1311200000000001,1.13141,1147,0.5065312046443907\n31,2019/02/18 21:00:00,1.13142,1.13155,1.13079,1.13079,1946,0.48657187993680845\n32,2019/02/18 22:05:00,1.13097,1.13117,1.13091,1.13117,311,0.5451327433628119\n33,2019/02/18 23:05:00,1.13117,1.13123,1.13101,1.13113,419,0.4520255863539152\n34,2019/02/19,1.1310799999999999,1.13134,1.13028,1.13053,1840,0.25\n35,2019/02/19 01:00:00,1.13052,1.13069,1.1302,1.13038,1648,0.22477064220182322\n36,2019/02/19 02:00:00,1.13039,1.13047,1.12976,1.13009,1260,0.16228070175437356\n37,2019/02/19 03:00:00,1.13008,1.13029,1.12935,1.12952,1108,0.1626373626373446\n38,2019/02/19 04:00:00,1.12951,1.12979,1.12927,1.12962,1224,0.16299559471364067\n39,2019/02/19 05:00:00,1.12963,1.12994,1.12941,1.12991,1288,0.2789968652037079\n40,2019/02/19 06:00:00,1.1299299999999999,1.12994,1.1293,1.1295600000000001,1418,0.26969696969691326\n41,2019/02/19 07:00:00,1.1295600000000001,1.1305,1.1295,1.12989,3375,0.39944903581263186\n42,2019/02/19 08:00:00,1.12988,1.13239,1.12939,1.13214,5408,0.576709796672792\n43,2019/02/19 09:00:00,1.13215,1.1324100000000001,1.13005,1.13027,5592,0.5782688766113921\n44,2019/02/19 10:00:00,1.13026,1.1313799999999998,1.1299,1.13066,3853,0.5334608030592346\n45,2019/02/19 11:00:00,1.13066,1.13099,1.12752,1.12827,6591,0.38324175824175866\n46,2019/02/19 12:00:00,1.12825,1.12883,1.12761,1.12869,4475,0.38324175824175866\n47,2019/02/19 13:00:00,1.12868,1.13005,1.12859,1.12955,5185,0.4680094786729876\n48,2019/02/19 14:00:00,1.1295600000000001,1.1322,1.12955,1.1319299999999999,6921,0.6143589743589816\n49,2019/02/19 15:00:00,1.13192,1.13394,1.13158,1.13334,7675,0.6774758983347868\n50,2019/02/19 16:00:00,1.13334,1.13422,1.13275,1.13276,6482,0.7119999999999935\n51,2019/02/19 17:00:00,1.13275,1.13571,1.13202,1.13478,7037,0.7274119448698325\n52,2019/02/19 18:00:00,1.13477,1.13535,1.13448,1.13487,3873,0.7318952234206525\n53,2019/02/19 19:00:00,1.13485,1.13501,1.13353,1.1340000000000001,3271,0.6785195936139409\n54,2019/02/19 20:00:00,1.13399,1.1344100000000001,1.13389,1.1342299999999998,2787,0.6839795171909395\n55,2019/02/19 21:00:00,1.13422,1.13422,1.13392,1.1339299999999999,843,0.6704805491990927\n56,2019/02/19 22:05:00,1.13411,1.13437,1.1335,1.13382,1620,0.6035958904109711\n57,2019/02/19 23:05:00,1.13382,1.13404,1.1337899999999999,1.13395,964,0.6029159519725634\n58,2019/02/20,1.13395,1.1353,1.1339299999999999,1.13496,2325,0.6491777603758938\n59,2019/02/20 01:00:00,1.13496,1.13557,1.1347399999999999,1.13541,2450,0.8030018761726109\n60,2019/02/20 02:00:00,1.1354,1.13551,1.13497,1.135,1651,0.8030018761726109\n61,2019/02/20 03:00:00,1.13501,1.13505,1.13424,1.13445,1307,0.7217305801376553\n62,2019/02/20 04:00:00,1.13448,1.13458,1.13415,1.13434,1222,0.639950678175091\n63,2019/02/20 05:00:00,1.1343299999999998,1.1345399999999999,1.13372,1.13373,963,0.507352941176486\n64,2019/02/20 06:00:00,1.13372,1.13395,1.13321,1.13334,1582,0.4509246088193564\n65,2019/02/20 07:00:00,1.13333,1.1345299999999998,1.1331200000000001,1.13432,3422,0.4124087591240799\n66,2019/02/20 08:00:00,1.13428,1.13527,1.1336600000000001,1.13445,5514,0.4823151125402023\n67,2019/02/20 09:00:00,1.13444,1.1358,1.13411,1.13465,4824,0.6086206896551752\n68,2019/02/20 10:00:00,1.1346399999999999,1.13469,1.1336899999999999,1.1342,3014,0.5675241157556219\n69,2019/02/20 11:00:00,1.13419,1.13419,1.1329799999999999,1.13351,3112,0.5093795093795066\n70,2019/02/20 12:00:00,1.13351,1.13458,1.13246,1.13394,4840,0.518569463548831\n71,2019/02/20 13:00:00,1.13395,1.1345299999999998,1.1331200000000001,1.13363,4865,0.518569463548831\n72,2019/02/20 14:00:00,1.13362,1.13404,1.13297,1.1337700000000002,4996,0.4074675324675168\n73,2019/02/20 15:00:00,1.13378,1.13499,1.13354,1.1348799999999999,7028,0.4663742690058374\n74,2019/02/20 16:00:00,1.13487,1.13691,1.1347399999999999,1.13679,6045,0.5833333333333355\n75,2019/02/20 17:00:00,1.13678,1.137,1.136,1.13655,4162,0.6403940886699598\n76,2019/02/20 18:00:00,1.13656,1.13707,1.1362,1.13629,3884,0.6506172839506212\n77,2019/02/20 19:00:00,1.13628,1.1366399999999999,1.13344,1.13507,9756,0.5052732502396852\n78,2019/02/20 20:00:00,1.1350799999999999,1.13509,1.1339700000000001,1.13398,3585,0.5312499999999923\n79,2019/02/20 21:00:00,1.13395,1.1340700000000001,1.13352,1.13362,1329,0.48350515463917065\n80,2019/02/20 22:05:00,1.13373,1.1346,1.13373,1.13442,1891,0.4720758693361241\n81,2019/02/20 23:05:00,1.1344100000000001,1.13465,1.1343,1.13457,581,0.44395116537178675\n82,2019/02/21,1.1345100000000001,1.13478,1.1340000000000001,1.1342299999999998,2315,0.4578713968957687\n83,2019/02/21 01:00:00,1.1342299999999998,1.13437,1.1332200000000001,1.13341,3991,0.4543454345434353\n84,2019/02/21 02:00:00,1.13342,1.1340000000000001,1.13342,1.1337899999999999,1816,0.45721271393640833\n85,2019/02/21 03:00:00,1.1337700000000002,1.1349799999999999,1.1336899999999999,1.13477,1862,0.5152838427947269\n86,2019/02/21 04:00:00,1.1347399999999999,1.1351200000000001,1.13467,1.13494,1630,0.5311475409835923\n87,2019/02/21 05:00:00,1.13495,1.13524,1.13351,1.13358,3585,0.4251054852320448\n88,2019/02/21 06:00:00,1.1335600000000001,1.1335600000000001,1.13249,1.133,3399,0.24592074592070615\n89,2019/02/21 07:00:00,1.13299,1.13394,1.13194,1.13342,5940,0.254777070063649\n90,2019/02/21 08:00:00,1.13344,1.13629,1.13341,1.1355600000000001,8538,0.3999999999999696\n91,2019/02/21 09:00:00,1.13553,1.1355600000000001,1.13216,1.1327,5507,0.45927379784099226\n92,2019/02/21 10:00:00,1.13269,1.1344299999999998,1.13232,1.13439,3932,0.45927379784099226\n93,2019/02/21 11:00:00,1.13439,1.1349799999999999,1.1337899999999999,1.13496,3857,0.5082604470359361\n94,2019/02/21 12:00:00,1.13497,1.13565,1.1348799999999999,1.1351200000000001,4953,0.5148609779482173\n95,2019/02/21 13:00:00,1.13513,1.1366,1.13483,1.1361700000000001,7197,0.5509666080843609\n96,2019/02/21 14:00:00,1.13618,1.1365399999999999,1.13374,1.1342700000000001,6607,0.5099667774086386\n97,2019/02/21 15:00:00,1.13426,1.1351799999999999,1.1339700000000001,1.13469,6276,0.5452930728241571\n98,2019/02/21 16:00:00,1.1347,1.1347399999999999,1.13304,1.13378,5680,0.5036915504511863\n99,2019/02/21 17:00:00,1.13376,1.1337899999999999,1.13226,1.13301,4828,0.43035863219350357\n100,2019/02/21 18:00:00,1.133,1.13321,1.13266,1.13293,3620,0.4236286919831195\n101,2019/02/21 19:00:00,1.1329,1.13365,1.13266,1.1336,3047,0.4850136239782045\n102,2019/02/21 20:00:00,1.1335899999999999,1.13404,1.13325,1.13382,2476,0.5520231213872816\n103,2019/02/21 21:00:00,1.13378,1.1337899999999999,1.13315,1.1332,1636,0.5602094240837794\n104,2019/02/21 22:05:00,1.1329799999999999,1.13376,1.1329799999999999,1.1335899999999999,1971,0.40705563093622565\n105,2019/02/21 23:05:00,1.1336,1.13398,1.13358,1.13395,1268,0.5078864353312116\n106,2019/02/22,1.13391,1.1341299999999999,1.13378,1.13389,1937,0.5192604006163046\n107,2019/02/22 01:00:00,1.13388,1.1340000000000001,1.13319,1.1336899999999999,2208,0.431852986217421\n108,2019/02/22 02:00:00,1.13371,1.13395,1.13361,1.13389,1666,0.36689419795216055\n109,2019/02/22 03:00:00,1.13389,1.13394,1.13315,1.13385,1872,0.22556390977436988\n110,2019/02/22 04:00:00,1.13384,1.13386,1.13321,1.13358,1258,0.28368794326233054\n111,2019/02/22 05:00:00,1.13358,1.13383,1.13324,1.13378,1350,0.28368794326233054\n112,2019/02/22 06:00:00,1.13378,1.1344299999999998,1.1335600000000001,1.13429,1780,0.4615384615383783\n113,2019/02/22 07:00:00,1.1342700000000001,1.1348799999999999,1.13409,1.13459,3166,0.6302521008402618\n114,2019/02/22 08:00:00,1.13459,1.1351200000000001,1.1341299999999999,1.13481,4070,0.6535433070865674\n115,2019/02/22 09:00:00,1.1348,1.13483,1.1337700000000002,1.1339299999999999,4291,0.5495978552278823\n116,2019/02/22 10:00:00,1.13392,1.1341700000000001,1.1334600000000001,1.1341299999999999,3158,0.45479452054795233\n117,2019/02/22 11:00:00,1.13416,1.13444,1.13347,1.13381,2912,0.5052356020942174\n118,2019/02/22 12:00:00,1.13382,1.13383,1.13252,1.13265,3203,0.4195652173912995\n119,2019/02/22 13:00:00,1.1326399999999999,1.13384,1.13157,1.13358,6764,0.32209737827716245\n120,2019/02/22 14:00:00,1.13357,1.1342700000000001,1.13276,1.1333799999999998,6245,0.3558718861210389\n121,2019/02/22 15:00:00,1.13339,1.13553,1.13339,1.1339299999999999,6935,0.5182829888712566\n122,2019/02/22 16:00:00,1.13394,1.13447,1.1334600000000001,1.13401,4719,0.5182829888712566\n123,2019/02/22 17:00:00,1.13401,1.13544,1.13277,1.1345,6089,0.5647530040053516\n124,2019/02/22 18:00:00,1.1345,1.1348,1.13421,1.1343,3565,0.5647530040053516\n125,2019/02/22 19:00:00,1.1343,1.13437,1.13347,1.1336700000000002,3865,0.5139732685297802\n126,2019/02/22 20:00:00,1.13368,1.1337899999999999,1.13316,1.13316,3150,0.4571788413098358\n127,2019/02/22 21:00:00,1.1331799999999999,1.13331,1.13295,1.1332,937,0.4129870129870176\n128,2019/02/24 22:05:00,1.1328200000000002,1.13382,1.1328,1.13373,2324,0.4248768472906355\n129,2019/02/24 23:05:00,1.13372,1.13419,1.13355,1.13418,1750,0.4698646986469657\n130,2019/02/25,1.13402,1.13478,1.1337700000000002,1.1347399999999999,1282,0.5243757431628774\n131,2019/02/25 01:00:00,1.13473,1.13489,1.13428,1.13442,1907,0.515151515151507\n132,2019/02/25 02:00:00,1.1344100000000001,1.13448,1.13368,1.13398,2277,0.5379746835443007\n133,2019/02/25 03:00:00,1.1339700000000001,1.13437,1.1337700000000002,1.13434,1559,0.6109510086455285\n134,2019/02/25 04:00:00,1.1343299999999998,1.1343299999999998,1.13394,1.13395,907,0.5852534562211824\n135,2019/02/25 05:00:00,1.13395,1.1343,1.13386,1.1342299999999998,1546,0.4784240150093838\n136,2019/02/25 06:00:00,1.13424,1.13495,1.1342,1.1348,1315,0.5351170568561794\n137,2019/02/25 07:00:00,1.13479,1.13584,1.13478,1.13562,3022,0.5988483685220908\n138,2019/02/25 08:00:00,1.1356,1.13568,1.1341299999999999,1.1344299999999998,4447,0.5324232081911329\n139,2019/02/25 09:00:00,1.13442,1.13524,1.1343299999999998,1.1349,3640,0.6093750000000101\n140,2019/02/25 10:00:00,1.13489,1.1367,1.13481,1.13635,3593,0.7304625199362252\n141,2019/02/25 11:00:00,1.13636,1.13671,1.1360299999999999,1.13644,2985,0.7561779242174946\n142,2019/02/25 12:00:00,1.13645,1.13645,1.13542,1.13568,3736,0.677740863787412\n143,2019/02/25 13:00:00,1.1357,1.1359299999999999,1.13476,1.13542,4893,0.5879556259905101\n144,2019/02/25 14:00:00,1.13543,1.13605,1.135,1.13516,5603,0.5547945205479824\n145,2019/02/25 15:00:00,1.13517,1.13584,1.13399,1.1346100000000001,6284,0.4643916913946877\n146,2019/02/25 16:00:00,1.13459,1.13544,1.13431,1.13444,5031,0.5097719869707122\n147,2019/02/25 17:00:00,1.1344299999999998,1.1348799999999999,1.13363,1.1347399999999999,6087,0.4589442815249497\n148,2019/02/25 18:00:00,1.13473,1.13553,1.1344100000000001,1.13552,2947,0.5060240963855669\n149,2019/02/25 19:00:00,1.1354899999999999,1.13644,1.1353600000000001,1.1364100000000001,2359,0.5650602409638671\n150,2019/02/25 20:00:00,1.1364299999999998,1.1367,1.13608,1.13609,1945,0.5436156763590706\n151,2019/02/25 21:00:00,1.1361,1.1361700000000001,1.1356,1.1356600000000001,731,0.4546666666666971\n152,2019/02/25 22:05:00,1.13606,1.13657,1.13557,1.13592,1775,0.5233516483516788\n153,2019/02/25 23:05:00,1.13592,1.13647,1.1356899999999999,1.13644,781,0.5233516483516788\n154,2019/02/26,1.13625,1.1365,1.13604,1.13609,1559,0.4068376068376439\n155,2019/02/26 01:00:00,1.1361,1.13628,1.1353799999999998,1.13565,1825,0.36461538461540655\n156,2019/02/26 02:00:00,1.13565,1.13644,1.13562,1.1363,1930,0.4181818181818189\n157,2019/02/26 03:00:00,1.13629,1.1367200000000002,1.13602,1.1361700000000001,1536,0.4955908289241925\n158,2019/02/26 04:00:00,1.13618,1.13639,1.1358,1.13581,862,0.46620450606587027\n159,2019/02/26 05:00:00,1.13582,1.13615,1.1355600000000001,1.1358700000000002,909,0.5380000000000243\n160,2019/02/26 06:00:00,1.13586,1.1359,1.1349,1.13494,1819,0.47526501766786095\n161,2019/02/26 07:00:00,1.1349200000000002,1.13582,1.1347399999999999,1.13494,4116,0.5233463035019446\n162,2019/02/26 08:00:00,1.13494,1.13585,1.13452,1.13544,4715,0.4367088607595061\n163,2019/02/26 09:00:00,1.13544,1.13675,1.13541,1.13669,3608,0.4355179704016961\n164,2019/02/26 10:00:00,1.13667,1.13714,1.13616,1.13632,4258,0.45061728395061673\n165,2019/02/26 11:00:00,1.13634,1.13645,1.13541,1.13639,3576,0.42690058479532317\n166,2019/02/26 12:00:00,1.13637,1.1367399999999999,1.13606,1.13637,4149,0.416833667334663\n167,2019/02/26 13:00:00,1.13636,1.1374799999999998,1.13543,1.13719,5762,0.4433962264150759\n168,2019/02/26 14:00:00,1.1372,1.1372,1.1358,1.13602,5881,0.4407582938388464\n169,2019/02/26 15:00:00,1.1360299999999999,1.1361700000000001,1.13448,1.13584,8962,0.3991416309012819\n170,2019/02/26 16:00:00,1.13583,1.1379700000000001,1.13539,1.1372799999999998,8886,0.5133256083429862\n171,2019/02/26 17:00:00,1.13726,1.13795,1.1368,1.1379299999999999,4027,0.4970059880239324\n172,2019/02/26 18:00:00,1.13792,1.13805,1.1371799999999999,1.13799,2778,0.5164034021871065\n173,2019/02/26 19:00:00,1.13801,1.14024,1.13796,1.13957,4887,0.6326129666011523\n174,2019/02/26 20:00:00,1.1395899999999999,1.13962,1.13904,1.13916,3103,0.6764705882352728\n175,2019/02/26 21:00:00,1.13915,1.13916,1.13881,1.13887,851,0.6715328467153219\n176,2019/02/26 22:05:00,1.13887,1.1393799999999998,1.13878,1.1392799999999998,1649,0.6913451511991345\n177,2019/02/26 23:05:00,1.1392799999999998,1.13933,1.1390200000000001,1.13927,740,0.6593785960874262\n178,2019/02/27,1.13933,1.13957,1.13878,1.13904,2122,0.6355353075170329\n179,2019/02/27 01:00:00,1.13903,1.13927,1.13815,1.13852,3180,0.6443418013856379\n180,2019/02/27 02:00:00,1.1385299999999998,1.13869,1.1381,1.1381299999999999,1352,0.6282660332541088\n181,2019/02/27 03:00:00,1.13814,1.1381700000000001,1.13771,1.13792,2235,0.6115591397849144\n182,2019/02/27 04:00:00,1.1379,1.13801,1.13761,1.13763,2162,0.6034482758620385\n183,2019/02/27 05:00:00,1.13762,1.13804,1.1374799999999998,1.13775,1666,0.7178683385579325\n184,2019/02/27 06:00:00,1.13774,1.13783,1.1372200000000001,1.1374799999999998,2017,0.5743801652892165\n185,2019/02/27 07:00:00,1.1374799999999998,1.13834,1.13729,1.13778,3731,0.6149532710280026\n186,2019/02/27 08:00:00,1.1378,1.13957,1.1376600000000001,1.13939,5336,0.6820987654320742\n187,2019/02/27 09:00:00,1.13939,1.13972,1.13869,1.13945,3679,0.5360360360360202\n188,2019/02/27 10:00:00,1.13945,1.13992,1.13909,1.13942,3772,0.5560344827586026\n189,2019/02/27 11:00:00,1.13943,1.14032,1.1392799999999998,1.13964,4819,0.6195426195425898\n190,2019/02/27 12:00:00,1.13963,1.1396600000000001,1.13815,1.13829,4828,0.4850615114235692\n191,2019/02/27 13:00:00,1.1383,1.13929,1.13798,1.1384299999999998,5946,0.4709897610921684\n192,2019/02/27 14:00:00,1.13842,1.13913,1.13781,1.1381700000000001,6106,0.45405405405409077\n193,2019/02/27 15:00:00,1.13816,1.1394799999999998,1.13685,1.1381,9495,0.4606741573033788\n194,2019/02/27 16:00:00,1.13808,1.13866,1.13619,1.13685,7301,0.41959064327487317\n195,2019/02/27 17:00:00,1.13689,1.13704,1.13626,1.13685,3351,0.44496124031009243\n196,2019/02/27 18:00:00,1.13683,1.1376600000000001,1.13683,1.13751,2290,0.5007173601147983\n197,2019/02/27 19:00:00,1.13751,1.13754,1.13665,1.13691,2505,0.4949928469242078\n198,2019/02/27 20:00:00,1.13691,1.13713,1.13675,1.13707,1892,0.5141158989598913\n199,2019/02/27 21:00:00,1.1370799999999999,1.13736,1.13685,1.13686,1348,0.4930232558139593\n200,2019/02/27 22:05:00,1.1366100000000001,1.13749,1.13655,1.1374799999999998,1947,0.368141592920348\n201,2019/02/27 23:05:00,1.13749,1.13795,1.13742,1.13792,1047,0.40100671140939514\n202,2019/02/28,1.1377899999999999,1.1379700000000001,1.13742,1.1374600000000001,2286,0.38235294117648533\n203,2019/02/28 01:00:00,1.13745,1.13774,1.13697,1.1377,2461,0.31046312178389174\n204,2019/02/28 02:00:00,1.1376899999999999,1.1379299999999999,1.13762,1.13773,1771,0.4089979550102202\n205,2019/02/28 03:00:00,1.13772,1.13794,1.1376600000000001,1.13773,1311,0.4249471458773816\n206,2019/02/28 04:00:00,1.13772,1.13781,1.13741,1.13764,840,0.41787941787941424\n207,2019/02/28 05:00:00,1.13763,1.1376899999999999,1.13737,1.13753,1101,0.4689265536723352\n208,2019/02/28 06:00:00,1.13754,1.1375899999999999,1.13696,1.13716,2457,0.5045592705167128\n209,2019/02/28 07:00:00,1.13715,1.13834,1.13667,1.1381299999999999,5620,0.5565819861431937\n210,2019/02/28 08:00:00,1.13811,1.13904,1.13802,1.13821,4795,0.5646258503401498\n211,2019/02/28 09:00:00,1.13821,1.13932,1.1381700000000001,1.13907,4339,0.6141906873614417\n212,2019/02/28 10:00:00,1.1390799999999999,1.14073,1.1389200000000002,1.14011,4506,0.7060810810810868\n213,2019/02/28 11:00:00,1.1401,1.14192,1.14009,1.1416600000000001,5179,0.7470930232558193\n214,2019/02/28 12:00:00,1.14165,1.14185,1.1408,1.14099,4559,0.7767441860465125\n215,2019/02/28 13:00:00,1.1409799999999999,1.14174,1.1381700000000001,1.1386,9408,0.5278422273782043\n216,2019/02/28 14:00:00,1.13859,1.1394600000000001,1.13794,1.13828,6915,0.5130237825594532\n217,2019/02/28 15:00:00,1.13829,1.13878,1.13591,1.13862,9989,0.4351585014409256\n218,2019/02/28 16:00:00,1.1386399999999999,1.13957,1.1377700000000002,1.13781,7555,0.46594005449592285\n219,2019/02/28 17:00:00,1.13778,1.1382299999999999,1.13697,1.13814,5043,0.4338983050847482\n220,2019/02/28 18:00:00,1.13815,1.13873,1.1376700000000002,1.13799,3659,0.46639004149378765\n221,2019/02/28 19:00:00,1.13798,1.13829,1.1375899999999999,1.13775,3232,0.4648469809760149\n222,2019/02/28 20:00:00,1.13774,1.13804,1.13723,1.1372799999999998,2919,0.46677740863787937\n223,2019/02/28 21:00:00,1.13726,1.1374600000000001,1.1369200000000002,1.1370200000000001,1263,0.43059239610964783\n224,2019/02/28 22:05:00,1.137,1.13737,1.13683,1.1370200000000001,1820,0.3897196261682239\n225,2019/02/28 23:05:00,1.1370200000000001,1.13737,1.13691,1.13727,413,0.3733205374280201\n226,2019/03/01,1.13719,1.1372799999999998,1.13683,1.13696,1564,0.2728272827282801\n227,2019/03/01 01:00:00,1.13696,1.1374799999999998,1.13691,1.13716,1668,0.1839506172839619\n228,2019/03/01 02:00:00,1.13715,1.13717,1.13635,1.13691,1203,0.17205542725174128\n229,2019/03/01 03:00:00,1.13691,1.1371799999999999,1.13673,1.13689,1167,0.24834437086090733\n230,2019/03/01 04:00:00,1.13689,1.13749,1.13689,1.13737,952,0.2957516339869152\n231,2019/03/01 05:00:00,1.1373799999999998,1.13743,1.1369799999999999,1.1370200000000001,725,0.4425427872860212\n232,2019/03/01 06:00:00,1.13701,1.13736,1.1361,1.13616,1840,0.24401913875596867\n233,2019/03/01 07:00:00,1.1361700000000001,1.13739,1.1361700000000001,1.13719,3614,0.3079178885630363\n234,2019/03/01 08:00:00,1.1371799999999999,1.1372799999999998,1.13529,1.13629,5415,0.14511873350918258\n235,2019/03/01 09:00:00,1.13628,1.1366100000000001,1.1356899999999999,1.1359700000000001,4260,0.14824797843661625\n236,2019/03/01 10:00:00,1.13599,1.13768,1.1354899999999999,1.1374600000000001,3915,0.35064935064930447\n237,2019/03/01 11:00:00,1.13745,1.1385399999999999,1.13729,1.13837,3916,0.4796905222436447\n238,2019/03/01 12:00:00,1.13838,1.1387399999999999,1.1376899999999999,1.1378,3766,0.5075757575757024\n239,2019/03/01 13:00:00,1.13778,1.13846,1.13749,1.13814,7253,0.4890510948904589\n240,2019/03/01 14:00:00,1.13815,1.1399700000000001,1.1375899999999999,1.1395600000000001,6894,0.6063675832127128\n241,2019/03/01 15:00:00,1.13957,1.1408200000000002,1.13848,1.13859,8649,0.6402116402116228\n242,2019/03/01 16:00:00,1.1386,1.13881,1.1372799999999998,1.13745,6509,0.5902439024390089\n243,2019/03/01 17:00:00,1.1374600000000001,1.1376700000000002,1.13644,1.13648,3568,0.534883720930228\n244,2019/03/01 18:00:00,1.13649,1.1366,1.1361299999999999,1.1363,2978,0.5005537098560268\n245,2019/03/01 19:00:00,1.13631,1.1365,1.1354,1.13576,4457,0.463114754098357\n246,2019/03/01 20:00:00,1.1357700000000002,1.13646,1.1355,1.1364100000000001,3862,0.509009009008993\n247,2019/03/01 21:00:00,1.1364100000000001,1.13673,1.13628,1.13638,1392,0.5219298245613889\n248,2019/03/03 22:05:00,1.1375899999999999,1.13808,1.13753,1.13772,1000,0.6371220020855044\n249,2019/03/03 23:05:00,1.13773,1.13786,1.13719,1.1374600000000001,1942,0.6153071500503503\n250,2019/03/04,1.13744,1.13745,1.1367200000000002,1.1369,2136,0.5520262869660606\n251,2019/03/04 01:00:00,1.1369,1.13696,1.13663,1.13683,1388,0.5000000000000132\n252,2019/03/04 02:00:00,1.13684,1.1370200000000001,1.13632,1.13649,1450,0.4736225087925199\n253,2019/03/04 03:00:00,1.13648,1.1367200000000002,1.1361299999999999,1.1366100000000001,1452,0.4741784037558827\n254,2019/03/04 04:00:00,1.13663,1.1367,1.13634,1.1364100000000001,1082,0.3609129814550752\n255,2019/03/04 05:00:00,1.1364299999999998,1.1366,1.13614,1.13621,1483,0.26415094339624023\n256,2019/03/04 06:00:00,1.1362,1.13676,1.1360299999999999,1.1365399999999999,1125,0.3388581952117952\n257,2019/03/04 07:00:00,1.1365299999999998,1.13688,1.13551,1.13576,4353,0.3747609942638661\n258,2019/03/04 08:00:00,1.1357700000000002,1.1357700000000002,1.1333799999999998,1.1342299999999998,7471,0.2780141843971577\n259,2019/03/04 09:00:00,1.13422,1.13465,1.1336700000000002,1.13425,4923,0.3101265822784699\n260,2019/03/04 10:00:00,1.13424,1.13447,1.13342,1.13371,4107,0.29832572298324295\n261,2019/03/04 11:00:00,1.13372,1.1342299999999998,1.1327200000000002,1.1332799999999998,5132,0.24142857142856303\n262,2019/03/04 12:00:00,1.13327,1.13381,1.13303,1.1333799999999998,4538,0.060176991150442054\n263,2019/03/04 13:00:00,1.13337,1.1345100000000001,1.13316,1.13424,4846,0.17304492512480887\n264,2019/03/04 14:00:00,1.13425,1.13428,1.13216,1.1325399999999999,4980,0.15902140672784143\n265,2019/03/04 15:00:00,1.13255,1.13269,1.13086,1.1322299999999998,6642,0.13419354838711\n266,2019/03/04 16:00:00,1.1322299999999998,1.13283,1.13171,1.13279,4940,0.14893617021276342\n267,2019/03/04 17:00:00,1.13278,1.1335,1.1327200000000002,1.13316,3168,0.2237499999999946\n268,2019/03/04 18:00:00,1.1331799999999999,1.13347,1.1326100000000001,1.1329200000000001,2335,0.22071516646115222\n269,2019/03/04 19:00:00,1.1329200000000001,1.1332200000000001,1.13246,1.1330200000000001,1813,0.22208436724564748\n270,2019/03/04 20:00:00,1.1329799999999999,1.13422,1.13281,1.13419,2114,0.29920364050055603\n271,2019/03/04 21:00:00,1.13418,1.13426,1.13389,1.13392,1069,0.3113553113553039\n272,2019/03/04 22:05:00,1.13354,1.1340700000000001,1.1333799999999998,1.1336899999999999,1426,0.38812785388126236\n273,2019/03/04 23:05:00,1.1336899999999999,1.13385,1.1336,1.1336,1631,0.38812785388126236\n274,2019/03/05,1.1336,1.13375,1.13323,1.1333799999999998,1676,0.3811659192825015\n275,2019/03/05 01:00:00,1.1334,1.13354,1.1332200000000001,1.13331,1839,0.4249999999999926\n276,2019/03/05 02:00:00,1.13332,1.1336,1.13319,1.13351,1883,0.42857142857140257\n277,2019/03/05 03:00:00,1.1335,1.13374,1.13268,1.13271,2177,0.33940397350989976\n278,2019/03/05 04:00:00,1.1327200000000002,1.1331,1.1324299999999998,1.13304,1344,0.38752362948954755\n279,2019/03/05 05:00:00,1.13303,1.13304,1.13271,1.13284,1032,0.5137844611528042\n280,2019/03/05 06:00:00,1.13286,1.13309,1.13201,1.1323299999999998,1869,0.42608695652164724\n281,2019/03/05 07:00:00,1.13232,1.1327399999999999,1.13178,1.13265,4347,0.3100961538460749\n282,2019/03/05 08:00:00,1.1326399999999999,1.13378,1.13157,1.13351,5877,0.43962264150937963\n283,2019/03/05 09:00:00,1.1334799999999998,1.1336899999999999,1.13248,1.13266,4433,0.45242718446597047\n284,2019/03/05 10:00:00,1.1327,1.13289,1.1320000000000001,1.1324,2856,0.28725701943843435\n285,2019/03/05 11:00:00,1.13237,1.13334,1.13224,1.13333,2610,0.3452380952380842\n286,2019/03/05 12:00:00,1.13334,1.13381,1.13224,1.13228,3991,0.44199999999999884\n287,2019/03/05 13:00:00,1.13237,1.1331,1.1322299999999998,1.13304,4519,0.441117764471051\n288,2019/03/05 14:00:00,1.13303,1.1334899999999999,1.1318700000000002,1.1325399999999999,5840,0.4823747680890612\n289,2019/03/05 15:00:00,1.13236,1.13236,1.12916,1.1306100000000001,8912,0.32138442521630245\n290,2019/03/05 16:00:00,1.1306200000000002,1.1307,1.1291799999999999,1.12983,6135,0.31749999999999806\n291,2019/03/05 17:00:00,1.12981,1.12995,1.1289200000000001,1.12968,3105,0.31537450722734045\n292,2019/03/05 18:00:00,1.1296899999999999,1.13101,1.12935,1.13056,3100,0.4109263657957438\n293,2019/03/05 19:00:00,1.13053,1.13079,1.1301700000000001,1.13024,2015,0.4109263657957438\n294,2019/03/05 20:00:00,1.13025,1.13079,1.13024,1.13073,1670,0.44458930899612825\n295,2019/03/05 21:00:00,1.1307200000000002,1.1308200000000002,1.13044,1.13069,1224,0.4605087014726095\n296,2019/03/05 22:05:00,1.13066,1.13076,1.12978,1.13011,2116,0.3488372093023744\n297,2019/03/05 23:05:00,1.13012,1.13063,1.13009,1.13057,1341,0.3488372093023744\n298,2019/03/06,1.13055,1.13067,1.12974,1.1300299999999999,2319,0.35935198821800785\n299,2019/03/06 01:00:00,1.13004,1.13031,1.12979,1.13024,1457,0.31388012618300065\n300,2019/03/06 02:00:00,1.13025,1.13031,1.12919,1.1295,1950,0.23493044822259562\n301,2019/03/06 03:00:00,1.12951,1.12979,1.12894,1.12926,1707,0.2265275707899016\n302,2019/03/06 04:00:00,1.12925,1.1299,1.12925,1.12984,1246,0.20428336079079504\n303,2019/03/06 05:00:00,1.12985,1.12995,1.1293799999999998,1.12974,1319,0.37829912023468276\n304,2019/03/06 06:00:00,1.1297,1.13032,1.12939,1.13018,1727,0.4391534391535088\n305,2019/03/06 07:00:00,1.13018,1.13035,1.12958,1.13004,3827,0.4760563380282009\n306,2019/03/06 08:00:00,1.1300299999999999,1.13099,1.1299,1.13065,4169,0.40575079872206804\n307,2019/03/06 09:00:00,1.13067,1.13068,1.1299700000000001,1.1300700000000001,3765,0.40575079872206804\n308,2019/03/06 10:00:00,1.13004,1.13048,1.12976,1.13028,3488,0.3802395209581013\n309,2019/03/06 11:00:00,1.13028,1.1306200000000002,1.13011,1.13014,2939,0.4000000000000257\n310,2019/03/06 12:00:00,1.13016,1.13052,1.12994,1.1302299999999998,3102,0.46621621621622333\n311,2019/03/06 13:00:00,1.1302299999999998,1.1314600000000001,1.1285100000000001,1.1304299999999998,7553,0.43527204502818023\n312,2019/03/06 14:00:00,1.13044,1.13165,1.13039,1.13095,5716,0.48148148148151193\n313,2019/03/06 15:00:00,1.13096,1.1323,1.13057,1.1316700000000002,6643,0.539792387543282\n314,2019/03/06 16:00:00,1.1316700000000002,1.1324299999999998,1.13114,1.1318,4405,0.612052730696828\n315,2019/03/06 17:00:00,1.13179,1.1319299999999999,1.1304100000000001,1.13077,3000,0.5613126079447532\n316,2019/03/06 18:00:00,1.13078,1.1311200000000001,1.13058,1.1307,1893,0.5528169014084848\n317,2019/03/06 19:00:00,1.1307200000000002,1.1310799999999999,1.13039,1.13073,2360,0.5309278350515789\n318,2019/03/06 20:00:00,1.1307399999999999,1.13117,1.1306100000000001,1.13107,1264,0.5072202166065457\n319,2019/03/06 21:00:00,1.13107,1.1311,1.13056,1.1306,1199,0.50000000000004\n320,2019/03/06 22:05:00,1.13079,1.13094,1.1306200000000002,1.1308200000000002,921,0.4349593495935442\n321,2019/03/06 23:05:00,1.13083,1.13132,1.1308200000000002,1.13127,1018,0.4754716981132567\n322,2019/03/07,1.13121,1.13153,1.1309200000000001,1.13114,1740,0.5150943396226779\n323,2019/03/07 01:00:00,1.13114,1.13131,1.13079,1.1308200000000002,1382,0.48960302457466365\n324,2019/03/07 02:00:00,1.13079,1.13097,1.1304299999999998,1.1306100000000001,1784,0.4726277372262598\n325,2019/03/07 03:00:00,1.1306200000000002,1.1308200000000002,1.13024,1.1304100000000001,1357,0.49999999999993266\n326,2019/03/07 04:00:00,1.1304100000000001,1.1306,1.13037,1.13037,958,0.4694533762057299\n327,2019/03/07 05:00:00,1.13035,1.1306100000000001,1.13028,1.1306,1207,0.3203124999999153\n328,2019/03/07 06:00:00,1.1306100000000001,1.1307,1.13018,1.1302,996,0.2977099236640905\n329,2019/03/07 07:00:00,1.13016,1.13095,1.13006,1.13069,3122,0.4557522123892901\n330,2019/03/07 08:00:00,1.1307,1.1313,1.13044,1.1310799999999999,5338,0.5287356321838387\n331,2019/03/07 09:00:00,1.13109,1.13134,1.1307399999999999,1.1309,3712,0.5772357723576319\n332,2019/03/07 10:00:00,1.13091,1.13181,1.13078,1.1316,3149,0.6338028169012995\n333,2019/03/07 11:00:00,1.13158,1.13199,1.13069,1.13084,3134,0.6470588235293563\n334,2019/03/07 12:00:00,1.13084,1.13101,1.12744,1.12883,7799,0.3137876386687573\n335,2019/03/07 13:00:00,1.1288200000000002,1.1288200000000002,1.12535,1.126,12417,0.19950124688277313\n336,2019/03/07 14:00:00,1.12599,1.126,1.12293,1.1232600000000001,10113,0.13587487781035948\n337,2019/03/07 15:00:00,1.12324,1.12428,1.1229799999999999,1.12314,7475,0.13762376237623788\n338,2019/03/07 16:00:00,1.12317,1.12333,1.12058,1.12131,7357,0.11449752883031492\n339,2019/03/07 17:00:00,1.12133,1.12289,1.1207200000000002,1.1225,6986,0.11631799163180029\n340,2019/03/07 18:00:00,1.12249,1.1225399999999999,1.1215700000000002,1.1218299999999999,3649,0.11631799163180029\n341,2019/03/07 19:00:00,1.12182,1.12189,1.1175700000000002,1.1183,6630,0.08706624605678003\n342,2019/03/07 20:00:00,1.1183100000000001,1.11871,1.11782,1.11811,3729,0.08237547892720505\n343,2019/03/07 21:00:00,1.1181,1.11944,1.1179700000000001,1.11923,1556,0.11048689138577139\n344,2019/03/07 22:05:00,1.11914,1.11947,1.11901,1.11942,787,0.0923566878980871\n345,2019/03/07 23:05:00,1.11942,1.11984,1.11937,1.11978,931,0.1110417966313112\n346,2019/03/08,1.1197700000000002,1.1197700000000002,1.11855,1.11907,2632,0.07997557997557601\n347,2019/03/08 01:00:00,1.11907,1.11944,1.11848,1.1188,2015,0.06983930778738337\n348,2019/03/08 02:00:00,1.1188,1.1200299999999999,1.11861,1.11981,1851,0.12721893491122432\n349,2019/03/08 03:00:00,1.11982,1.12004,1.11934,1.11964,2017,0.15122377622375902\n350,2019/03/08 04:00:00,1.11964,1.1199299999999999,1.1193799999999998,1.11986,1945,0.19179600886916018\n351,2019/03/08 05:00:00,1.11985,1.12016,1.11964,1.12012,1375,0.21189189189188826\n352,2019/03/08 06:00:00,1.12011,1.12089,1.1200700000000001,1.12066,1974,0.3548812664907503\n353,2019/03/08 07:00:00,1.1207,1.1211200000000001,1.1197,1.12093,5700,0.3569682151589153\n354,2019/03/08 08:00:00,1.12094,1.12119,1.11996,1.12079,5661,0.36242424242421734\n355,2019/03/08 09:00:00,1.12077,1.1215,1.12056,1.12122,4669,0.7236842105262657\n356,2019/03/08 10:00:00,1.12124,1.12194,1.12085,1.1217700000000002,4938,0.7479999999999536\n357,2019/03/08 11:00:00,1.12178,1.1220299999999999,1.12134,1.1214600000000001,4573,0.7110091743118762\n358,2019/03/08 12:00:00,1.12145,1.12225,1.12124,1.1221,4309,0.707526881720393\n359,2019/03/08 13:00:00,1.12206,1.1240700000000001,1.12142,1.1225100000000001,10204,0.7770491803278439\n360,2019/03/08 14:00:00,1.1225,1.12353,1.1221700000000001,1.12256,7900,0.8977272727272412\n361,2019/03/08 15:00:00,1.1225399999999999,1.12375,1.1225100000000001,1.1235700000000002,9153,0.9134438305708747\n362,2019/03/08 16:00:00,1.12358,1.1244,1.12323,1.12424,6422,0.9143897996356766\n363,2019/03/08 17:00:00,1.12425,1.12456,1.12374,1.12399,4051,0.9166666666666404\n364,2019/03/08 18:00:00,1.124,1.12428,1.1238,1.12401,2590,0.9166666666666404\n365,2019/03/08 19:00:00,1.124,1.1243,1.12384,1.12421,2322,0.9134438305708747\n366,2019/03/08 20:00:00,1.12424,1.12427,1.12311,1.12313,2975,0.7790055248618818\n367,2019/03/08 21:00:00,1.12313,1.12345,1.12301,1.12333,1102,0.8113590263691975\n368,2019/03/10 21:05:00,1.12307,1.12335,1.12304,1.12333,71,0.8086419753086799\n369,2019/03/10 22:05:00,1.12329,1.1235899999999999,1.1230200000000001,1.12354,704,0.8024948024948466\n370,2019/03/10 23:05:00,1.12354,1.12371,1.1230799999999999,1.12313,755,0.7884187082405876\n371,2019/03/11,1.1231,1.12319,1.12226,1.12275,1796,0.6609195402299609\n372,2019/03/11 01:00:00,1.12276,1.12295,1.12237,1.12285,1825,0.6591836734694595\n373,2019/03/11 02:00:00,1.12284,1.1232,1.12284,1.12315,1441,0.4984984984985886\n374,2019/03/11 03:00:00,1.12313,1.1233,1.12304,1.12323,785,0.5131195335277834\n375,2019/03/11 04:00:00,1.12324,1.12333,1.12315,1.12331,895,0.4845679012346366\n376,2019/03/11 05:00:00,1.1233,1.12344,1.1231799999999998,1.1233,931,0.3814814814815555\n377,2019/03/11 06:00:00,1.12329,1.12406,1.1232799999999998,1.12368,1445,0.4715189873418651\n378,2019/03/11 07:00:00,1.12368,1.1250200000000001,1.1234600000000001,1.12485,4416,0.5946601941748407\n379,2019/03/11 08:00:00,1.12484,1.12496,1.12425,1.1246,5285,0.5926829268293391\n380,2019/03/11 09:00:00,1.12458,1.12579,1.12421,1.12519,4459,0.76886792452836\n381,2019/03/11 10:00:00,1.1252,1.12522,1.12355,1.12429,5219,0.6791666666667333\n382,2019/03/11 11:00:00,1.12428,1.1249,1.12394,1.12429,4210,0.6791666666667333\n383,2019/03/11 12:00:00,1.1243,1.12474,1.12322,1.12362,6175,0.5741444866920993\n384,2019/03/11 13:00:00,1.12363,1.12543,1.12358,1.12471,6785,0.6157804459691835\n385,2019/03/11 14:00:00,1.1247200000000002,1.12489,1.1235600000000001,1.1241700000000001,5260,0.7137176938370374\n386,2019/03/11 15:00:00,1.12418,1.12447,1.1221299999999998,1.12245,4659,0.5557275541795867\n387,2019/03/11 16:00:00,1.12249,1.12342,1.12219,1.1233,4964,0.5378421900161182\n388,2019/03/11 17:00:00,1.12331,1.12414,1.12297,1.12412,4055,0.5797950219619364\n389,2019/03/11 18:00:00,1.12414,1.12459,1.12381,1.12395,3087,0.6041379310344915\n390,2019/03/11 19:00:00,1.12396,1.125,1.1237700000000002,1.1247200000000002,3942,0.6166007905138555\n391,2019/03/11 20:00:00,1.12473,1.12476,1.1240700000000001,1.1245100000000001,1821,0.5824964131994445\n392,2019/03/11 21:05:00,1.1244,1.12735,1.12439,1.12687,2611,0.6616279069767627\n393,2019/03/11 22:05:00,1.12686,1.1269799999999999,1.1259299999999999,1.12649,3815,0.6616279069767627\n394,2019/03/11 23:05:00,1.12648,1.1267399999999999,1.1254,1.12589,1525,0.5883777239709642\n395,2019/03/12,1.1258299999999999,1.12608,1.12551,1.12588,2495,0.6394736842105415\n396,2019/03/12 01:00:00,1.1258700000000001,1.1263,1.12578,1.12602,1496,0.6496163682864652\n397,2019/03/12 02:00:00,1.12602,1.1263,1.12573,1.12627,1031,0.7104895104895078\n398,2019/03/12 03:00:00,1.12628,1.1265399999999999,1.12602,1.12608,748,0.6910447761193972\n399,2019/03/12 04:00:00,1.1260700000000001,1.12608,1.1250799999999999,1.1251,1078,0.6076115485564043\n400,2019/03/12 05:00:00,1.12509,1.12566,1.12509,1.1255,1035,0.7479806138933721\n401,2019/03/12 06:00:00,1.1255,1.12599,1.12533,1.12578,1224,0.7607361963190123\n402,2019/03/12 07:00:00,1.1257700000000002,1.1267,1.12543,1.12658,4109,0.7603686635944698\n403,2019/03/12 08:00:00,1.1266100000000001,1.12828,1.1263299999999998,1.1282,6659,0.7958115183246031\n404,2019/03/12 09:00:00,1.12819,1.12839,1.12722,1.12727,5696,0.7917808219177849\n405,2019/03/12 10:00:00,1.12726,1.12774,1.12669,1.12689,4223,0.7381864623243589\n406,2019/03/12 11:00:00,1.1268799999999999,1.12742,1.125,1.12532,9657,0.4603174603174252\n407,2019/03/12 12:00:00,1.12531,1.12842,1.12489,1.12812,8591,0.521144278606924\n408,2019/03/12 13:00:00,1.12811,1.12828,1.12724,1.12794,6757,0.5579227696404291\n409,2019/03/12 14:00:00,1.1279299999999999,1.12805,1.12663,1.1271,5619,0.516009852216703\n410,2019/03/12 15:00:00,1.1271200000000001,1.12939,1.12668,1.1275899999999999,6269,0.5746753246752738\n411,2019/03/12 16:00:00,1.12758,1.12945,1.12733,1.12932,5020,0.5805405405405042\n412,2019/03/12 17:00:00,1.12935,1.1294600000000001,1.1288200000000002,1.1289200000000001,3103,0.56984478935696\n413,2019/03/12 18:00:00,1.12891,1.13,1.12886,1.12974,3578,0.6589327146171443\n414,2019/03/12 19:00:00,1.12974,1.13044,1.12893,1.12961,7437,0.6754966887416981\n415,2019/03/12 20:00:00,1.1295899999999999,1.12994,1.12819,1.1287,2239,0.6114044350580592\n416,2019/03/12 21:05:00,1.12855,1.12895,1.1285399999999999,1.12893,804,0.5799086757990665\n417,2019/03/12 22:05:00,1.12891,1.1289799999999999,1.12876,1.12876,605,0.48959778085989475\n418,2019/03/12 23:05:00,1.12877,1.12895,1.12846,1.1286200000000002,1166,0.4621621621621385\n419,2019/03/13,1.1286,1.12895,1.12859,1.12876,1285,0.49781659388644856\n420,2019/03/13 01:00:00,1.12877,1.12895,1.12866,1.12868,1338,0.6602316602316464\n421,2019/03/13 02:00:00,1.12869,1.12893,1.12832,1.1284100000000001,1396,0.5487528344671144\n422,2019/03/13 03:00:00,1.12842,1.1285100000000001,1.12825,1.12838,826,0.5401785714285636\n423,2019/03/13 04:00:00,1.12838,1.12858,1.12825,1.1283,920,0.631979695431448\n424,2019/03/13 05:00:00,1.1283,1.12873,1.12822,1.1286200000000002,1126,0.4676258992805606\n425,2019/03/13 06:00:00,1.1286200000000002,1.1288200000000002,1.1283,1.1286399999999999,1317,0.47330960854090615\n426,2019/03/13 07:00:00,1.12863,1.12889,1.12781,1.12792,4180,0.4136904761903958\n427,2019/03/13 08:00:00,1.1279299999999999,1.12965,1.1277,1.1293799999999998,5558,0.4363143631436049\n428,2019/03/13 09:00:00,1.12939,1.12974,1.12886,1.1293600000000001,3864,0.37724550898199255\n429,2019/03/13 10:00:00,1.1293600000000001,1.1302299999999998,1.1291,1.12925,4487,0.566343042071133\n430,2019/03/13 11:00:00,1.12924,1.1304299999999998,1.12893,1.13018,4703,0.5635838150288407\n431,2019/03/13 12:00:00,1.1302,1.13044,1.1291200000000001,1.12933,5277,0.5610465116278571\n432,2019/03/13 13:00:00,1.12934,1.13123,1.1290200000000001,1.1307,6160,0.6749379652605083\n433,2019/03/13 14:00:00,1.1307200000000002,1.13132,1.1305,1.1305,4585,0.6820388349514308\n434,2019/03/13 15:00:00,1.1305100000000001,1.13135,1.12998,1.13085,5741,0.6081370449678476\n435,2019/03/13 16:00:00,1.13087,1.1314899999999999,1.12998,1.1305,3944,0.666666666666617\n436,2019/03/13 17:00:00,1.13049,1.13079,1.1299700000000001,1.1302299999999998,2381,0.6757369614512231\n437,2019/03/13 18:00:00,1.1302299999999998,1.1333799999999998,1.13022,1.1329,3738,0.793650793650784\n438,2019/03/13 19:00:00,1.13294,1.13382,1.13211,1.13332,8040,0.805285118219741\n439,2019/03/13 20:00:00,1.13333,1.1336700000000002,1.13253,1.13257,3685,0.8028169014084379\n440,2019/03/13 21:05:00,1.13249,1.1331799999999999,1.13239,1.13316,2514,0.8428143712574862\n441,2019/03/13 22:05:00,1.13315,1.13371,1.13303,1.13365,931,0.8517350157728802\n442,2019/03/13 23:05:00,1.13364,1.13372,1.1329,1.133,1152,0.8325508607198929\n443,2019/03/14,1.13304,1.13325,1.13258,1.13269,1849,0.7765273311897223\n444,2019/03/14 01:00:00,1.13271,1.13275,1.13228,1.13267,1973,0.7528455284553031\n445,2019/03/14 02:00:00,1.13266,1.13315,1.13246,1.1326399999999999,1580,0.7675840978593479\n446,2019/03/14 03:00:00,1.13263,1.13279,1.1319700000000001,1.13205,1418,0.6889250814332611\n447,2019/03/14 04:00:00,1.13205,1.13221,1.13173,1.13186,1539,0.6581875993640737\n448,2019/03/14 05:00:00,1.13185,1.1322299999999998,1.13171,1.1319299999999999,1531,0.7145328719723364\n449,2019/03/14 06:00:00,1.1319299999999999,1.13201,1.13132,1.13174,2458,0.6616915422885984\n450,2019/03/14 07:00:00,1.13174,1.13278,1.13119,1.13232,4291,0.6878612716762988\n451,2019/03/14 08:00:00,1.1323299999999998,1.1335600000000001,1.13231,1.1326,6274,0.5772994129158887\n452,2019/03/14 09:00:00,1.13259,1.1326,1.13109,1.13131,5956,0.42614601018679005\n453,2019/03/14 10:00:00,1.1313,1.13135,1.13009,1.13059,7516,0.36429608127725277\n454,2019/03/14 11:00:00,1.1306,1.13113,1.12955,1.13014,6168,0.3443072702332369\n455,2019/03/14 12:00:00,1.13012,1.13104,1.12976,1.13009,5782,0.2928994082840563\n456,2019/03/14 13:00:00,1.13009,1.13044,1.12937,1.12996,6888,0.2810271041369666\n457,2019/03/14 14:00:00,1.12995,1.1307200000000002,1.12939,1.12999,7107,0.32281205164997695\n458,2019/03/14 15:00:00,1.13,1.1309,1.1295899999999999,1.1303,6342,0.354744525547476\n459,2019/03/14 16:00:00,1.13032,1.13044,1.12964,1.12991,3582,0.3147286821705593\n460,2019/03/14 17:00:00,1.1299299999999999,1.13035,1.12968,1.1298700000000002,3117,0.3406040268456475\n461,2019/03/14 18:00:00,1.12986,1.13073,1.1298,1.12995,3536,0.3950819672131409\n462,2019/03/14 19:00:00,1.12994,1.13035,1.12983,1.1302,2575,0.394389438943924\n463,2019/03/14 20:00:00,1.13018,1.13044,1.13006,1.13031,1436,0.43055555555556835\n464,2019/03/14 21:05:00,1.1301700000000001,1.1307399999999999,1.12982,1.13071,3188,0.37222222222225554\n465,2019/03/14 22:05:00,1.13071,1.1309,1.1305100000000001,1.1305100000000001,678,0.29079497907953095\n466,2019/03/14 23:05:00,1.13052,1.13087,1.13046,1.1306100000000001,1044,0.3850415512465638\n467,2019/03/15,1.1306200000000002,1.13091,1.13038,1.13055,1488,0.5238095238095122\n468,2019/03/15 01:00:00,1.13055,1.13121,1.13039,1.13096,1600,0.6947791164658037\n469,2019/03/15 02:00:00,1.13096,1.13222,1.13094,1.13222,1717,0.7828571428570839\n470,2019/03/15 03:00:00,1.13222,1.13268,1.13184,1.1319,1815,0.8963585434173185\n471,2019/03/15 04:00:00,1.13189,1.1319,1.1314899999999999,1.1318700000000002,769,0.8021978021977312\n472,2019/03/15 05:00:00,1.13184,1.1318700000000002,1.13143,1.13162,732,0.7784090909090389\n473,2019/03/15 06:00:00,1.13161,1.13202,1.1315600000000001,1.1318700000000002,1552,0.7874659400544382\n474,2019/03/15 07:00:00,1.1318700000000002,1.1325100000000001,1.13157,1.1325,3649,0.8124999999999533\n475,2019/03/15 08:00:00,1.1325,1.1328799999999999,1.13186,1.13232,4914,0.8120481927710246\n476,2019/03/15 09:00:00,1.1323,1.13245,1.1311799999999999,1.1321700000000001,3793,0.6977225672876962\n477,2019/03/15 10:00:00,1.1321700000000001,1.1326200000000002,1.13145,1.1318700000000002,3889,0.7026476578410717\n478,2019/03/15 11:00:00,1.13188,1.1321,1.13166,1.13183,2839,0.7208237986269284\n479,2019/03/15 12:00:00,1.13185,1.1319299999999999,1.13025,1.1303299999999998,4408,0.5320284697508206\n480,2019/03/15 13:00:00,1.13032,1.1334799999999998,1.12996,1.13293,6921,0.612685560053938\n481,2019/03/15 14:00:00,1.1329200000000001,1.13439,1.13237,1.13351,5345,0.6597560975609486\n482,2019/03/15 15:00:00,1.1335,1.13404,1.1321700000000001,1.1326200000000002,5952,0.6308641975308409\n483,2019/03/15 16:00:00,1.1326399999999999,1.13281,1.13139,1.13172,4466,0.5209656925031434\n484,2019/03/15 17:00:00,1.13171,1.13237,1.13162,1.13199,2440,0.49122807017541176\n485,2019/03/15 18:00:00,1.13199,1.13222,1.1317,1.1319299999999999,2011,0.5155807365438846\n486,2019/03/15 19:00:00,1.13192,1.13227,1.13186,1.1321700000000001,2133,0.5234042553191268\n487,2019/03/15 20:00:00,1.13218,1.13289,1.13175,1.13266,1619,0.545216251638242\n488,2019/03/17 21:05:00,1.13208,1.13256,1.13204,1.1325,352,0.5140056022408626\n489,2019/03/17 22:05:00,1.1325,1.1327399999999999,1.13229,1.13245,516,0.5007194244604043\n490,2019/03/17 23:05:00,1.13246,1.13246,1.13186,1.13189,736,0.5194029850746203\n491,2019/03/18,1.1319,1.1324100000000001,1.13189,1.13205,1281,0.5068912710566386\n492,2019/03/18 01:00:00,1.13204,1.1326,1.1319700000000001,1.1325100000000001,1328,0.5208333333333044\n493,2019/03/18 02:00:00,1.13255,1.13327,1.13242,1.1332200000000001,1569,0.6973244147156977\n494,2019/03/18 03:00:00,1.13321,1.13378,1.13309,1.1334899999999999,1469,0.673118279569855\n495,2019/03/18 04:00:00,1.1335,1.13381,1.13337,1.1336,1234,0.5968169761272529\n496,2019/03/18 05:00:00,1.13358,1.1336,1.13316,1.13341,1091,0.595238095238017\n497,2019/03/18 06:00:00,1.1334,1.13446,1.13323,1.13422,2033,0.8056994818652652\n498,2019/03/18 07:00:00,1.13421,1.13495,1.13382,1.13494,3455,0.8275862068965306\n499,2019/03/18 08:00:00,1.1349200000000002,1.13503,1.1341,1.13442,5164,0.8306997742663482\n500,2019/03/18 09:00:00,1.1344100000000001,1.13505,1.1340000000000001,1.13505,4642,0.8111111111110865\n501,2019/03/18 10:00:00,1.13506,1.13525,1.1347200000000002,1.1351799999999999,3724,0.8136020151133505\n502,2019/03/18 11:00:00,1.13517,1.1358,1.13506,1.1356600000000001,3331,0.836283185840703\n503,2019/03/18 12:00:00,1.13568,1.13586,1.13456,1.13459,4293,0.7469387755102179\n504,2019/03/18 13:00:00,1.13458,1.1349200000000002,1.1341299999999999,1.13455,3887,0.7469387755101842\n505,2019/03/18 14:00:00,1.13456,1.1349200000000002,1.1340299999999999,1.1344100000000001,3318,0.7319999999999823\n506,2019/03/18 15:00:00,1.13442,1.1346100000000001,1.13301,1.1336700000000002,5759,0.5951972555746283\n507,2019/03/18 16:00:00,1.1336899999999999,1.13416,1.13255,1.1329200000000001,3787,0.4982206405694032\n508,2019/03/18 17:00:00,1.13293,1.13319,1.13242,1.1327200000000002,2111,0.4370229007633716\n509,2019/03/18 18:00:00,1.13271,1.13368,1.13258,1.13365,1701,0.48245614035089934\n510,2019/03/18 19:00:00,1.13368,1.13418,1.1334899999999999,1.13418,1845,0.5425709515859949\n511,2019/03/18 20:00:00,1.13419,1.13425,1.1335600000000001,1.1336899999999999,1261,0.4730769230769393\n512,2019/03/18 21:05:00,1.13358,1.13378,1.13342,1.13364,1121,0.4061855670103403\n513,2019/03/18 22:05:00,1.13363,1.13374,1.13341,1.1335,580,0.39539748953976545\n514,2019/03/18 23:05:00,1.13351,1.1336600000000001,1.13344,1.13357,856,0.40128755364809604\n515,2019/03/19,1.1335,1.1339700000000001,1.13333,1.13375,1909,0.40573770491803374\n516,2019/03/19 01:00:00,1.13376,1.13416,1.13363,1.1337899999999999,1322,0.3584070796460329\n517,2019/03/19 02:00:00,1.1337899999999999,1.13426,1.13368,1.13422,1551,0.40886699507387275\n518,2019/03/19 03:00:00,1.13426,1.13483,1.13416,1.13477,1164,0.5309523809523724\n519,2019/03/19 04:00:00,1.13476,1.13485,1.1345399999999999,1.13457,1038,0.5461165048543488\n520,2019/03/19 05:00:00,1.13456,1.13468,1.13418,1.13434,1278,0.6502890173409974\n521,2019/03/19 06:00:00,1.13435,1.135,1.1343299999999998,1.1349,1778,0.7740963855421594\n522,2019/03/19 07:00:00,1.13489,1.13514,1.13444,1.13468,3035,0.8138138138137974\n523,2019/03/19 08:00:00,1.13463,1.1356899999999999,1.1345299999999998,1.13542,3745,0.817109144542742\n524,2019/03/19 09:00:00,1.13541,1.13555,1.13486,1.13521,3198,0.7854671280276471\n525,2019/03/19 10:00:00,1.1351799999999999,1.13573,1.13469,1.13547,3422,0.7507886435330758\n526,2019/03/19 11:00:00,1.1354600000000001,1.13612,1.13516,1.1355,3330,0.8099415204678112\n527,2019/03/19 12:00:00,1.1354899999999999,1.1361,1.13467,1.1351799999999999,4389,0.710256410256416\n528,2019/03/19 13:00:00,1.13517,1.1361,1.13439,1.13459,5079,0.6626794258373119\n529,2019/03/19 14:00:00,1.13457,1.13524,1.13382,1.1349799999999999,4391,0.5681293302540342\n530,2019/03/19 15:00:00,1.13499,1.13601,1.13442,1.1346100000000001,4533,0.6191446028513244\n531,2019/03/19 16:00:00,1.13462,1.13562,1.13448,1.1349,4856,0.611226611226612\n532,2019/03/19 17:00:00,1.13491,1.13586,1.13471,1.13535,2580,0.582589285714289\n533,2019/03/19 18:00:00,1.1353600000000001,1.13553,1.13515,1.13527,1786,0.5807174887892494\n534,2019/03/19 19:00:00,1.13527,1.13588,1.13501,1.13578,2336,0.6405228758169988\n535,2019/03/19 20:00:00,1.13578,1.13578,1.1348,1.13515,1338,0.5848214285714177\n536,2019/03/19 21:05:00,1.13514,1.13532,1.13486,1.13501,1550,0.5714285714285569\n537,2019/03/19 22:05:00,1.1350200000000001,1.1353600000000001,1.13497,1.13527,1005,0.514360313315934\n538,2019/03/19 23:05:00,1.13529,1.13542,1.13511,1.13539,728,0.5218508997429313\n539,2019/03/20,1.13526,1.1356700000000002,1.13467,1.13467,1951,0.4964539007092493\n540,2019/03/20 01:00:00,1.13467,1.1349,1.13425,1.13489,1967,0.40140845070423453\n541,2019/03/20 02:00:00,1.13486,1.13499,1.13455,1.13471,947,0.46632124352329846\n542,2019/03/20 03:00:00,1.1347200000000002,1.13478,1.13444,1.1346399999999999,1180,0.48780487804876144\n543,2019/03/20 04:00:00,1.1346100000000001,1.13478,1.13444,1.13457,1029,0.5769230769230413\n544,2019/03/20 05:00:00,1.13457,1.13478,1.13452,1.1347,545,0.43829787234040707\n545,2019/03/20 06:00:00,1.13469,1.13497,1.13452,1.13468,1300,0.48031496062992673\n546,2019/03/20 07:00:00,1.13467,1.13532,1.13401,1.13448,3338,0.42088607594938815\n547,2019/03/20 08:00:00,1.13447,1.1350799999999999,1.13351,1.1342700000000001,4875,0.363387978142108\n548,2019/03/20 09:00:00,1.13428,1.1352,1.13416,1.1348799999999999,3784,0.33434650455932197\n549,2019/03/20 10:00:00,1.1348799999999999,1.13544,1.1347200000000002,1.13503,3424,0.40361445783137523\n550,2019/03/20 11:00:00,1.1350200000000001,1.13575,1.13494,1.13575,3245,0.45454545454549905\n551,2019/03/20 12:00:00,1.13574,1.13658,1.13537,1.13541,5998,0.5520361990950333\n552,2019/03/20 13:00:00,1.13542,1.13608,1.1352200000000001,1.13588,5026,0.527716186252804\n553,2019/03/20 14:00:00,1.1359,1.13639,1.13552,1.1356600000000001,5250,0.5907990314770237\n554,2019/03/20 15:00:00,1.1356899999999999,1.13612,1.13456,1.1352200000000001,5606,0.5224839400428541\n555,2019/03/20 16:00:00,1.1351799999999999,1.13562,1.13476,1.13495,4651,0.5131004366812594\n556,2019/03/20 17:00:00,1.13494,1.13578,1.13469,1.13571,3424,0.5340425531915223\n557,2019/03/20 18:00:00,1.13573,1.14466,1.13573,1.1445299999999998,18174,0.8387334315169448\n558,2019/03/20 19:00:00,1.14452,1.14478,1.1416600000000001,1.14337,9109,0.8401459854014666\n559,2019/03/20 20:00:00,1.1433200000000001,1.1433200000000001,1.14096,1.1413,3375,0.7966220971147047\n560,2019/03/20 21:05:00,1.14143,1.14273,1.14136,1.1425299999999998,2461,0.8217228464419436\n561,2019/03/20 22:05:00,1.14254,1.1426,1.14208,1.1426,1538,0.8536964980544669\n562,2019/03/20 23:05:00,1.1426,1.14299,1.1422299999999999,1.14281,901,0.8567073170731606\n563,2019/03/21,1.1429,1.14343,1.14241,1.14314,2692,0.8588588588588486\n564,2019/03/21 01:00:00,1.14313,1.1437,1.14262,1.14311,1743,0.8584337349397485\n565,2019/03/21 02:00:00,1.1431,1.14339,1.1426,1.14275,1798,0.8476343223736929\n566,2019/03/21 03:00:00,1.14275,1.14303,1.14222,1.14237,1612,0.8322834645669135\n567,2019/03/21 04:00:00,1.14235,1.14259,1.14208,1.14256,1367,0.8188347964884095\n568,2019/03/21 05:00:00,1.14257,1.1426399999999999,1.1417899999999999,1.14194,1248,0.8656591099915797\n569,2019/03/21 06:00:00,1.1419700000000002,1.14247,1.1417700000000002,1.1423299999999998,1705,0.8642078792958914\n570,2019/03/21 07:00:00,1.14234,1.14293,1.14116,1.14129,4800,0.8308535630383549\n571,2019/03/21 08:00:00,1.14124,1.14134,1.1392200000000001,1.13983,6987,0.29674099485415034\n572,2019/03/21 09:00:00,1.13986,1.14066,1.1397700000000002,1.14057,4428,0.281961471103286\n573,2019/03/21 10:00:00,1.14058,1.14065,1.1384,1.1388,5067,0.25235109717864673\n574,2019/03/21 11:00:00,1.13878,1.1395,1.13836,1.1391799999999999,4838,0.2507788161993389\n575,2019/03/21 12:00:00,1.13919,1.13965,1.13838,1.1385,5701,0.2678843226788175\n576,2019/03/21 13:00:00,1.1385100000000001,1.1394799999999998,1.13781,1.13915,6440,0.20296296296294958\n577,2019/03/21 14:00:00,1.13916,1.13916,1.13639,1.13709,7591,0.12031047865457961\n578,2019/03/21 15:00:00,1.1371,1.1372,1.13532,1.1360299999999999,8129,0.07737397420866422\n579,2019/03/21 16:00:00,1.13604,1.13619,1.13426,1.1351799999999999,8860,0.06896551724136811\n580,2019/03/21 17:00:00,1.13514,1.13529,1.13421,1.13525,4709,0.07142857142855942\n581,2019/03/21 18:00:00,1.13524,1.13628,1.13462,1.13526,6602,0.16352824578790293\n582,2019/03/21 19:00:00,1.13529,1.13667,1.13516,1.1366399999999999,5400,0.1962524654832496\n583,2019/03/21 20:00:00,1.13665,1.1376899999999999,1.13636,1.13729,2648,0.2701974865350015\n584,2019/03/21 21:05:00,1.1374600000000001,1.13786,1.13683,1.13734,2474,0.26562500000002065\n585,2019/03/21 22:05:00,1.13735,1.13772,1.1372200000000001,1.1374,707,0.3277108433735109\n586,2019/03/21 23:05:00,1.1374,1.1376600000000001,1.13731,1.13735,732,0.3277108433735109\n587,2019/03/22,1.13735,1.13741,1.13609,1.13667,2926,0.3337423312883644\n588,2019/03/22 01:00:00,1.13667,1.13758,1.13646,1.13754,2188,0.34903381642514264\n589,2019/03/22 02:00:00,1.13753,1.13764,1.13707,1.13733,1840,0.34188034188035255\n590,2019/03/22 03:00:00,1.13734,1.13758,1.1371799999999999,1.13743,1415,0.36745406824147886\n591,2019/03/22 04:00:00,1.13743,1.13773,1.13736,1.13773,1123,0.46456692913385383\n592,2019/03/22 05:00:00,1.13772,1.13783,1.1375,1.1376700000000002,1373,0.5669144981412463\n593,2019/03/22 06:00:00,1.1376600000000001,1.13804,1.1375899999999999,1.13794,1779,0.7196467991169838\n594,2019/03/22 07:00:00,1.13792,1.13903,1.13784,1.13873,4129,0.7769652650822706\n595,2019/03/22 08:00:00,1.1387399999999999,1.13899,1.1288,1.13028,14875,0.241124260355033\n596,2019/03/22 09:00:00,1.13027,1.13127,1.12923,1.13044,9458,0.21858339680121536\n597,2019/03/22 10:00:00,1.13048,1.1319299999999999,1.12944,1.1308799999999999,7326,0.19655442443226487\n598,2019/03/22 11:00:00,1.13086,1.13113,1.12935,1.12984,6446,0.1843971631205557\n599,2019/03/22 12:00:00,1.12983,1.13106,1.1295899999999999,1.13053,5614,0.1843971631205557\n600,2019/03/22 13:00:00,1.13052,1.13151,1.1294899999999999,1.13044,7659,0.2107250755286943\n601,2019/03/22 14:00:00,1.13044,1.1308799999999999,1.12761,1.12784,10908,0.20071942446042682\n602,2019/03/22 15:00:00,1.12785,1.1286399999999999,1.1272799999999998,1.12822,8664,0.18634423897581034\n603,2019/03/22 16:00:00,1.1282299999999998,1.12954,1.12812,1.12837,6969,0.23221476510067374\n604,2019/03/22 17:00:00,1.12836,1.12972,1.12816,1.12962,3537,0.24137931034483368\n605,2019/03/22 18:00:00,1.12963,1.12965,1.12832,1.12935,2612,0.23375753516411182\n606,2019/03/22 19:00:00,1.12934,1.13009,1.12929,1.12971,2816,0.2508185985592792\n607,2019/03/22 20:00:00,1.12972,1.12998,1.12934,1.12986,1411,0.2403718459495459\n608,2019/03/24 21:05:00,1.12925,1.12994,1.12885,1.12976,1242,0.18063186813187562\n609,2019/03/24 22:05:00,1.12978,1.12984,1.1293600000000001,1.1295,994,0.4764492753623263\n610,2019/03/24 23:05:00,1.1295,1.1298,1.12944,1.12952,718,0.4764492753623263\n611,2019/03/25,1.12953,1.12963,1.12885,1.12895,2229,0.36146788990827616\n612,2019/03/25 01:00:00,1.12895,1.12952,1.12895,1.1294600000000001,2147,0.3675373134328497\n613,2019/03/25 02:00:00,1.12947,1.12991,1.12947,1.1295600000000001,1469,0.4104347826086938\n614,2019/03/25 03:00:00,1.1295600000000001,1.12999,1.1294600000000001,1.1298700000000002,1425,0.3761814744801642\n615,2019/03/25 04:00:00,1.1298700000000002,1.1300299999999999,1.1295600000000001,1.1297700000000002,1068,0.5884057971014124\n616,2019/03/25 05:00:00,1.12978,1.13039,1.12978,1.13028,1394,0.6867816091954055\n617,2019/03/25 06:00:00,1.13025,1.1304299999999998,1.12994,1.1303,1914,0.5839694656488168\n618,2019/03/25 07:00:00,1.13029,1.1313799999999998,1.13025,1.13086,4052,0.6784660766961341\n619,2019/03/25 08:00:00,1.13083,1.13114,1.12943,1.13079,5609,0.5463182897861859\n620,2019/03/25 09:00:00,1.13078,1.13228,1.1307399999999999,1.13201,5789,0.6109979633400864\n621,2019/03/25 10:00:00,1.13199,1.13244,1.1312,1.13123,4350,0.6232741617356614\n622,2019/03/25 11:00:00,1.1312200000000001,1.13137,1.1303299999999998,1.1308799999999999,4041,0.5798165137614243\n623,2019/03/25 12:00:00,1.13087,1.13237,1.13085,1.13181,5538,0.6449612403100495\n624,2019/03/25 13:00:00,1.13182,1.13267,1.13121,1.13161,6681,0.6607407407407127\n625,2019/03/25 14:00:00,1.1316,1.13253,1.13111,1.13211,6140,0.7124600638977464\n626,2019/03/25 15:00:00,1.13209,1.1331,1.13176,1.13211,6005,0.7364568081991052\n627,2019/03/25 16:00:00,1.1321299999999999,1.13228,1.13101,1.1311200000000001,5708,0.6453407510430986\n628,2019/03/25 17:00:00,1.13111,1.13205,1.13097,1.13162,3152,0.6386554621848353\n629,2019/03/25 18:00:00,1.13161,1.13258,1.13103,1.13117,4848,0.6618610747050799\n630,2019/03/25 19:00:00,1.1311799999999999,1.13145,1.13106,1.13145,2570,0.6451169188445269\n631,2019/03/25 20:00:00,1.13144,1.13147,1.13097,1.13117,1150,0.6362397820163205\n632,2019/03/25 21:05:00,1.1311200000000001,1.1316700000000002,1.1311200000000001,1.13166,5085,0.5948406676782803\n633,2019/03/25 22:05:00,1.1316700000000002,1.13191,1.1313600000000001,1.1314600000000001,1184,0.6921797004991388\n634,2019/03/25 23:05:00,1.13144,1.1316700000000002,1.13139,1.1314600000000001,1146,0.620123203285389\n635,2019/03/26,1.13139,1.13184,1.13126,1.13173,2230,0.6047904191616373\n636,2019/03/26 01:00:00,1.13172,1.13215,1.13143,1.13161,2186,0.7505617977528002\n637,2019/03/26 02:00:00,1.1316,1.1316700000000002,1.1313799999999998,1.13164,2076,0.6685714285713779\n638,2019/03/26 03:00:00,1.13165,1.13174,1.13141,1.13157,1508,0.6452599388378445\n639,2019/03/26 04:00:00,1.13157,1.13173,1.1310799999999999,1.1310799999999999,1445,0.602857142857035\n640,2019/03/26 05:00:00,1.13109,1.13117,1.1305100000000001,1.13069,1875,0.4399999999999136\n641,2019/03/26 06:00:00,1.13069,1.13114,1.1306200000000002,1.1307399999999999,2215,0.5599999999999226\n642,2019/03/26 07:00:00,1.13073,1.13163,1.13047,1.1312200000000001,4148,0.6059701492536524\n643,2019/03/26 08:00:00,1.13121,1.1314899999999999,1.13026,1.13063,5307,0.49504950495038835\n644,2019/03/26 09:00:00,1.13063,1.13185,1.1306200000000002,1.13165,4952,0.5486725663716137\n645,2019/03/26 10:00:00,1.13166,1.13255,1.13144,1.13228,5283,0.6381909547738105\n646,2019/03/26 11:00:00,1.13228,1.13255,1.13084,1.1310200000000001,4949,0.5342465753423907\n647,2019/03/26 12:00:00,1.13103,1.13113,1.12842,1.1287399999999999,7733,0.3201219512194588\n648,2019/03/26 13:00:00,1.1287399999999999,1.1296,1.12796,1.1285,6915,0.2991452991452524\n649,2019/03/26 14:00:00,1.12853,1.12995,1.1285100000000001,1.12971,6754,0.32248939179630365\n650,2019/03/26 15:00:00,1.12974,1.12981,1.1277700000000002,1.1278700000000002,5935,0.2626666666666463\n651,2019/03/26 16:00:00,1.12788,1.12901,1.12788,1.1288,4834,0.26442953020132554\n652,2019/03/26 17:00:00,1.1288,1.12943,1.12778,1.12829,4450,0.2936708860759415\n653,2019/03/26 18:00:00,1.12829,1.1283299999999998,1.12758,1.1276899999999999,3688,0.29858429858429786\n654,2019/03/26 19:00:00,1.12768,1.12805,1.12647,1.12689,3620,0.2791817087845883\n655,2019/03/26 20:00:00,1.12691,1.1271,1.1263100000000001,1.12652,1943,0.27390791027154016\n656,2019/03/26 21:05:00,1.12639,1.12721,1.12629,1.1271200000000001,1617,0.24371859296483175\n657,2019/03/26 22:05:00,1.12713,1.12768,1.12706,1.1275,1008,0.29318734793188006\n658,2019/03/26 23:05:00,1.12751,1.12763,1.12731,1.12735,985,0.26081424936386116\n659,2019/03/27,1.1273600000000001,1.12737,1.12611,1.12665,2473,0.16148325358851373\n660,2019/03/27 01:00:00,1.12666,1.12669,1.1254600000000001,1.12552,3781,0.16052318668252002\n661,2019/03/27 02:00:00,1.12551,1.12572,1.12505,1.12566,2745,0.21093750000000272\n662,2019/03/27 03:00:00,1.12565,1.1256899999999999,1.12524,1.12525,1227,0.22727272727272727\n663,2019/03/27 04:00:00,1.12526,1.1257700000000002,1.12524,1.12572,1728,0.1904761904762222\n664,2019/03/27 05:00:00,1.12574,1.12592,1.12533,1.12568,1441,0.24212598425198245\n665,2019/03/27 06:00:00,1.12568,1.1266399999999999,1.12561,1.12658,2422,0.33620689655171754\n666,2019/03/27 07:00:00,1.12656,1.12658,1.12465,1.12519,5902,0.24519230769231182\n667,2019/03/27 08:00:00,1.12517,1.12778,1.12496,1.12753,7984,0.3770718232044296\n668,2019/03/27 09:00:00,1.12754,1.12849,1.12696,1.12798,5115,0.50292397660819\n669,2019/03/27 10:00:00,1.1279700000000001,1.1285100000000001,1.12742,1.12774,5940,0.5164179104477684\n670,2019/03/27 11:00:00,1.12775,1.1284,1.12677,1.12802,4643,0.4639889196676013\n671,2019/03/27 12:00:00,1.12805,1.12825,1.12658,1.1271,7856,0.4149855907781057\n672,2019/03/27 13:00:00,1.12709,1.12717,1.12478,1.12581,9104,0.3295194508009244\n673,2019/03/27 14:00:00,1.12582,1.126,1.12436,1.12515,8385,0.36180904522614915\n674,2019/03/27 15:00:00,1.12516,1.12564,1.12418,1.12506,8977,0.3845126835781103\n675,2019/03/27 16:00:00,1.12504,1.12653,1.12435,1.12625,7596,0.4730238393977475\n676,2019/03/27 17:00:00,1.12626,1.1267200000000002,1.12509,1.12535,5409,0.48529411764707236\n677,2019/03/27 18:00:00,1.12535,1.12649,1.12519,1.12637,4465,0.4801980198019749\n678,2019/03/27 19:00:00,1.12638,1.12639,1.1247,1.12509,3651,0.44299287410927474\n679,2019/03/27 20:00:00,1.1251,1.1251,1.1243,1.12432,1860,0.37160493827163427\n680,2019/03/27 21:05:00,1.12447,1.12547,1.12446,1.125,1752,0.4500665778961685\n681,2019/03/27 22:05:00,1.1250200000000001,1.12525,1.1248200000000002,1.12491,1273,0.3454833597464664\n682,2019/03/27 23:05:00,1.12493,1.12521,1.12475,1.12517,1271,0.2592592592592897\n683,2019/03/28,1.12505,1.1253799999999998,1.12468,1.12479,2648,0.27504244482171597\n684,2019/03/28 01:00:00,1.12478,1.12531,1.12429,1.1245399999999999,2414,0.28774422735345434\n685,2019/03/28 02:00:00,1.12453,1.1255,1.12453,1.1254899999999999,1999,0.3214920071047835\n686,2019/03/28 03:00:00,1.12548,1.12573,1.12523,1.12544,1541,0.5024630541871811\n687,2019/03/28 04:00:00,1.12543,1.12548,1.12517,1.12543,1354,0.5513513513513302\n688,2019/03/28 05:00:00,1.12544,1.12573,1.12531,1.12564,1779,0.6074270557028965\n689,2019/03/28 06:00:00,1.12563,1.12609,1.12547,1.1255899999999999,2045,0.5432098765431888\n690,2019/03/28 07:00:00,1.12561,1.1260299999999999,1.12366,1.1237700000000002,6211,0.32304526748967377\n691,2019/03/28 08:00:00,1.12379,1.12545,1.12337,1.12519,8415,0.30485436893199347\n692,2019/03/28 09:00:00,1.12521,1.12585,1.12496,1.12547,5725,0.38932806324105357\n693,2019/03/28 10:00:00,1.1254600000000001,1.12579,1.12466,1.12514,4239,0.3971774193547842\n694,2019/03/28 11:00:00,1.12513,1.12515,1.12238,1.1225399999999999,5996,0.23289665211057775\n695,2019/03/28 12:00:00,1.12256,1.12333,1.12204,1.12209,6558,0.22191400832172878\n696,2019/03/28 13:00:00,1.1221,1.12304,1.12131,1.12168,9695,0.20330368487925388\n697,2019/03/28 14:00:00,1.1216899999999999,1.12366,1.1216899999999999,1.1233799999999998,7657,0.24848484848484523\n698,2019/03/28 15:00:00,1.12337,1.12382,1.1221299999999998,1.12353,8482,0.2755610972568463\n699,2019/03/28 16:00:00,1.12355,1.12355,1.1215,1.1227,7010,0.2387706855791944\n700,2019/03/28 17:00:00,1.12269,1.12361,1.1224299999999998,1.1234899999999999,4755,0.22316043425813958\n701,2019/03/28 18:00:00,1.12351,1.12376,1.12247,1.12263,3209,0.23866348448687846\n702,2019/03/28 19:00:00,1.1226200000000002,1.12283,1.12198,1.12228,2698,0.20301624129931856\n703,2019/03/28 20:00:00,1.12229,1.12269,1.1219,1.12191,1312,0.16666666666666669\n704,2019/03/28 21:05:00,1.12228,1.12291,1.12215,1.1228,1988,0.23851851851852598\n705,2019/03/28 22:05:00,1.1228,1.12296,1.12266,1.12275,943,0.25499231950844714\n706,2019/03/28 23:05:00,1.12274,1.12295,1.12259,1.12295,602,0.2038834951456349\n707,2019/03/29,1.12291,1.12345,1.12245,1.1231799999999998,2494,0.2699386503067675\n708,2019/03/29 01:00:00,1.1231799999999998,1.1232799999999998,1.12263,1.12271,1954,0.4150943396226662\n709,2019/03/29 02:00:00,1.1227,1.12301,1.12234,1.1229799999999999,1941,0.4200477326969104\n710,2019/03/29 03:00:00,1.1229799999999999,1.1229799999999999,1.1225399999999999,1.1228,1158,0.5086705202312053\n711,2019/03/29 04:00:00,1.1228,1.12303,1.1223,1.12297,1605,0.3801916932907772\n712,2019/03/29 05:00:00,1.12294,1.12355,1.12286,1.12335,1581,0.4441260744986219\n713,2019/03/29 06:00:00,1.1233600000000001,1.12354,1.1228799999999999,1.12342,2164,0.5419580419580762\n714,2019/03/29 07:00:00,1.12342,1.12386,1.1228,1.1229799999999999,4723,0.565625000000072\n715,2019/03/29 08:00:00,1.1229799999999999,1.12358,1.12219,1.1229799999999999,6236,0.4535519125683713\n716,2019/03/29 09:00:00,1.1229799999999999,1.12314,1.12111,1.12111,5681,0.3905882352941925\n717,2019/03/29 10:00:00,1.1211,1.12263,1.12094,1.12227,6295,0.3824884792627535\n718,2019/03/29 11:00:00,1.12228,1.12362,1.12227,1.12295,6472,0.47553816046972514\n719,2019/03/29 12:00:00,1.12296,1.12463,1.12271,1.12314,7142,0.5584843492587007\n720,2019/03/29 13:00:00,1.12316,1.12388,1.12287,1.1234600000000001,6390,0.5650000000000532\n721,2019/03/29 14:00:00,1.12347,1.12412,1.12206,1.12273,9607,0.48829953198132386\n722,2019/03/29 15:00:00,1.12269,1.1235899999999999,1.12201,1.12267,9097,0.4845201238390457\n723,2019/03/29 16:00:00,1.12266,1.12305,1.12206,1.12249,6865,0.5072933549433216\n724,2019/03/29 17:00:00,1.12248,1.1225,1.12145,1.12209,3854,0.46165191740417333\n725,2019/03/29 18:00:00,1.12208,1.12268,1.1213600000000001,1.12147,4137,0.4822485207100739\n726,2019/03/29 19:00:00,1.1214600000000001,1.12208,1.1212799999999998,1.1216899999999999,3201,0.4335443037974556\n727,2019/03/29 20:00:00,1.1217,1.1218,1.12147,1.12166,1451,0.4335443037974556\n728,2019/03/31 21:05:00,1.12269,1.1231200000000001,1.12201,1.12259,687,0.5165745856353442\n729,2019/03/31 22:05:00,1.1225399999999999,1.1226200000000002,1.1221,1.12214,503,0.5641025641025451\n730,2019/03/31 23:05:00,1.12216,1.12245,1.12199,1.12228,1036,0.6607773851589724\n731,2019/04/01,1.12229,1.12278,1.12209,1.12277,1627,0.6993127147765897\n732,2019/04/01 01:00:00,1.12277,1.12291,1.12247,1.12257,1854,0.6471774193548026\n733,2019/04/01 02:00:00,1.12258,1.12324,1.1224,1.12313,1674,0.5816091954022622\n734,2019/04/01 03:00:00,1.1231200000000001,1.12335,1.1229799999999999,1.12316,1316,0.5919282511210443\n735,2019/04/01 04:00:00,1.12317,1.12348,1.12311,1.12337,1142,0.714689265536654\n736,2019/04/01 05:00:00,1.12337,1.12416,1.1233600000000001,1.12386,1931,0.7697841726618249\n737,2019/04/01 06:00:00,1.12381,1.12388,1.1231799999999998,1.12335,5129,0.7379310344826688\n738,2019/04/01 07:00:00,1.12333,1.12426,1.1227200000000002,1.12386,6477,0.783842794759789\n739,2019/04/01 08:00:00,1.12385,1.12495,1.1233899999999999,1.12456,7053,0.8199999999999511\n740,2019/04/01 09:00:00,1.12458,1.12484,1.1235899999999999,1.12373,4730,0.8333333333333333\n741,2019/04/01 10:00:00,1.12372,1.12379,1.12303,1.1231,4031,0.7481751824817703\n742,2019/04/01 11:00:00,1.12311,1.12381,1.12266,1.12289,4237,0.6153846153846191\n743,2019/04/01 12:00:00,1.1229200000000001,1.12471,1.12291,1.12345,6567,0.6788990825688197\n744,2019/04/01 13:00:00,1.12344,1.12447,1.1229799999999999,1.12352,6338,0.6928838951311059\n745,2019/04/01 14:00:00,1.1234600000000001,1.1234600000000001,1.1211,1.122,10182,0.4891146589260048\n746,2019/04/01 15:00:00,1.12199,1.12234,1.12081,1.1209200000000001,5481,0.4595744680851225\n747,2019/04/01 16:00:00,1.12091,1.1211,1.12038,1.12059,3492,0.41101694915255216\n748,2019/04/01 17:00:00,1.1206,1.12094,1.12037,1.1207799999999999,2178,0.4011461318051715\n749,2019/04/01 18:00:00,1.12077,1.12122,1.12058,1.1212,2576,0.4137447405329816\n750,2019/04/01 19:00:00,1.12119,1.12124,1.12083,1.12099,2469,0.353941267387955\n751,2019/04/01 20:00:00,1.1209799999999999,1.12137,1.1208200000000001,1.1212,1150,0.3763608087092107\n752,2019/04/01 21:05:00,1.12076,1.12094,1.11978,1.12022,1842,0.3076923076923051\n753,2019/04/01 22:05:00,1.12022,1.12071,1.12021,1.1206,840,0.22727272727273573\n754,2019/04/01 23:05:00,1.12059,1.12074,1.12043,1.12046,614,0.23115577889447778\n755,2019/04/02,1.12047,1.1208200000000001,1.12042,1.1205200000000002,1289,0.2654545454545563\n756,2019/04/02 01:00:00,1.1205200000000002,1.12055,1.1196700000000002,1.1203,1545,0.24573378839593313\n757,2019/04/02 02:00:00,1.1203100000000001,1.1205100000000001,1.12008,1.1202299999999998,1063,0.10887096774194054\n758,2019/04/02 03:00:00,1.12022,1.12048,1.11989,1.1202299999999998,2107,0.10485436893204521\n759,2019/04/02 04:00:00,1.12024,1.12024,1.11955,1.12019,1816,0.14958448753463557\n760,2019/04/02 05:00:00,1.1202,1.1211,1.12006,1.1207200000000002,2155,0.33492822966509994\n761,2019/04/02 06:00:00,1.12073,1.12075,1.1198700000000001,1.12005,3440,0.35532994923863104\n762,2019/04/02 07:00:00,1.12004,1.1203299999999998,1.1189799999999999,1.11991,5505,0.29045643153528095\n763,2019/04/02 08:00:00,1.11992,1.12043,1.11931,1.11976,4402,0.2629310344827949\n764,2019/04/02 09:00:00,1.1197700000000002,1.12055,1.1196700000000002,1.12035,4438,0.27848101265826103\n765,2019/04/02 10:00:00,1.12034,1.12055,1.11986,1.11998,3671,0.25869565217394513\n766,2019/04/02 11:00:00,1.11999,1.1205200000000002,1.11968,1.1201,4160,0.31818181818185864\n767,2019/04/02 12:00:00,1.12011,1.1211799999999998,1.11976,1.1205200000000002,5647,0.4204545454545282\n768,2019/04/02 13:00:00,1.1205200000000002,1.12075,1.1197700000000002,1.12011,5580,0.41647597254003177\n769,2019/04/02 14:00:00,1.1201,1.12055,1.11848,1.11909,6518,0.3123877917414415\n770,2019/04/02 15:00:00,1.1190799999999999,1.1192600000000001,1.1183299999999998,1.11859,5070,0.35010060362167517\n771,2019/04/02 16:00:00,1.11859,1.1197700000000002,1.11853,1.1196700000000002,3605,0.4105839416057865\n772,2019/04/02 17:00:00,1.11966,1.12158,1.11925,1.1193799999999998,6840,0.5718309859154286\n773,2019/04/02 18:00:00,1.1193799999999998,1.1197700000000002,1.11916,1.11975,2932,0.5927007299269276\n774,2019/04/02 19:00:00,1.11976,1.12019,1.1193600000000001,1.12008,1928,0.5647425897034901\n775,2019/04/02 20:00:00,1.12006,1.12048,1.11985,1.12036,1170,0.6006144393240048\n776,2019/04/02 21:05:00,1.1202299999999998,1.1205200000000002,1.12,1.1202,1726,0.6978798586571594\n777,2019/04/02 22:05:00,1.12017,1.12045,1.12017,1.1204100000000001,501,0.6924460431653702\n778,2019/04/02 23:05:00,1.1204,1.12049,1.12024,1.1203,586,0.6879562043794714\n779,2019/04/03,1.1203,1.12168,1.12016,1.1216,2683,0.7348148148147565\n780,2019/04/03 01:00:00,1.1215899999999999,1.12261,1.12122,1.12236,2637,0.7853333333332907\n781,2019/04/03 02:00:00,1.12237,1.12252,1.12196,1.12201,1717,0.7646198830409008\n782,2019/04/03 03:00:00,1.12201,1.12228,1.12191,1.1221299999999998,924,0.7590711175616377\n783,2019/04/03 04:00:00,1.12215,1.1226,1.12206,1.12224,1275,0.9374999999999695\n784,2019/04/03 05:00:00,1.12224,1.12261,1.1220700000000001,1.1225100000000001,1453,0.9619377162629592\n785,2019/04/03 06:00:00,1.1225,1.12283,1.12171,1.12229,5106,0.9008547008546647\n786,2019/04/03 07:00:00,1.12228,1.12424,1.1214899999999999,1.12373,7439,0.8589065255731421\n787,2019/04/03 08:00:00,1.1237,1.12445,1.1231799999999998,1.1243,5965,0.8773747841105077\n788,2019/04/03 09:00:00,1.1243299999999998,1.12544,1.1238299999999999,1.12476,4799,0.888364779874191\n789,2019/04/03 10:00:00,1.12475,1.12489,1.12428,1.12428,2863,0.8830313014826804\n790,2019/04/03 11:00:00,1.12427,1.125,1.12418,1.12459,3097,0.8701923076922854\n791,2019/04/03 12:00:00,1.12461,1.12496,1.1233600000000001,1.12342,5702,0.769121813031168\n792,2019/04/03 13:00:00,1.12341,1.1236700000000002,1.1227200000000002,1.12324,5283,0.7036553524804272\n793,2019/04/03 14:00:00,1.1232600000000001,1.12425,1.12245,1.12293,6920,0.6602209944751064\n794,2019/04/03 15:00:00,1.12294,1.12425,1.1228,1.12412,4796,0.6101426307448099\n795,2019/04/03 16:00:00,1.12412,1.1248799999999999,1.12386,1.12438,3159,0.6455331412103328\n796,2019/04/03 17:00:00,1.12438,1.12479,1.1241,1.12456,2736,0.6502177068214481\n797,2019/04/03 18:00:00,1.12455,1.12465,1.12381,1.1238700000000001,2569,0.6064139941690475\n798,2019/04/03 19:00:00,1.12386,1.12411,1.12371,1.1238,1963,0.5971223021582226\n799,2019/04/03 20:00:00,1.1237700000000002,1.12379,1.12316,1.12316,946,0.5679190751444719\n800,2019/04/03 21:05:00,1.12341,1.12384,1.1232799999999998,1.12374,2202,0.4812734082396605\n801,2019/04/03 22:05:00,1.12375,1.12429,1.12374,1.12424,671,0.5035842293906448\n802,2019/04/03 23:05:00,1.12421,1.12455,1.12419,1.12442,700,0.4288659793813864\n803,2019/04/04,1.1244100000000001,1.12471,1.12434,1.1244,1233,0.447105788423117\n804,2019/04/04 01:00:00,1.1244,1.1245100000000001,1.1243100000000001,1.12438,1006,0.4409937888198529\n805,2019/04/04 02:00:00,1.12438,1.12447,1.12372,1.1237700000000002,1423,0.46304347826082\n806,2019/04/04 03:00:00,1.1237700000000002,1.12421,1.12365,1.12418,1103,0.5285359801488225\n807,2019/04/04 04:00:00,1.12419,1.12428,1.124,1.12405,1012,0.4984615384615284\n808,2019/04/04 05:00:00,1.12405,1.1247200000000002,1.12396,1.1247200000000002,1284,0.5522788203753469\n809,2019/04/04 06:00:00,1.1247200000000002,1.1247200000000002,1.1234,1.12385,3835,0.3907103825136864\n810,2019/04/04 07:00:00,1.12384,1.1246399999999999,1.1233,1.12402,4903,0.3803191489361971\n811,2019/04/04 08:00:00,1.1240299999999999,1.12409,1.1230200000000001,1.12313,3901,0.38133333333338937\n812,2019/04/04 09:00:00,1.12314,1.1235899999999999,1.1220299999999999,1.12267,4111,0.3081896551724428\n813,2019/04/04 10:00:00,1.12268,1.12324,1.12256,1.12274,4398,0.34963325183377375\n814,2019/04/04 11:00:00,1.12275,1.1229799999999999,1.12216,1.1223100000000001,4609,0.3108108108108656\n815,2019/04/04 12:00:00,1.12232,1.12242,1.12122,1.12172,6229,0.18864097363088408\n816,2019/04/04 13:00:00,1.12171,1.1218,1.12056,1.12131,6356,0.12570356472801678\n817,2019/04/04 14:00:00,1.12134,1.12184,1.12096,1.1215899999999999,6047,0.10556621881002538\n818,2019/04/04 15:00:00,1.12162,1.12245,1.12145,1.12158,4413,0.20034542314337583\n819,2019/04/04 16:00:00,1.1216,1.12201,1.12131,1.12188,3207,0.21722846441950353\n820,2019/04/04 17:00:00,1.12189,1.122,1.1213,1.12191,2335,0.21969696969699548\n821,2019/04/04 18:00:00,1.1219,1.12237,1.1216899999999999,1.12204,1901,0.26164874551972866\n822,2019/04/04 19:00:00,1.12205,1.1224,1.12189,1.12239,2088,0.20467836257308653\n823,2019/04/04 20:00:00,1.12238,1.12265,1.1219700000000001,1.1219700000000001,1130,0.26970954356843235\n824,2019/04/04 21:05:00,1.1219700000000001,1.1223299999999998,1.12174,1.1221299999999998,1724,0.26262626262622135\n825,2019/04/04 22:05:00,1.12212,1.12227,1.12201,1.12208,708,0.2783725910063697\n826,2019/04/04 23:05:00,1.12209,1.12239,1.12209,1.12219,611,0.3736842105262488\n827,2019/04/05,1.12219,1.12287,1.12188,1.12219,2214,0.4231625835188744\n828,2019/04/05 01:00:00,1.12219,1.1225,1.12219,1.1224299999999998,934,0.4645476772615456\n829,2019/04/05 02:00:00,1.12242,1.1225399999999999,1.12234,1.12237,888,0.6081504702193081\n830,2019/04/05 03:00:00,1.12238,1.12245,1.12224,1.12236,897,0.7376425855512072\n831,2019/04/05 04:00:00,1.12238,1.12277,1.1223,1.12265,815,0.7628865979380381\n832,2019/04/05 05:00:00,1.12267,1.12286,1.12252,1.1226,1581,0.711297071129568\n833,2019/04/05 06:00:00,1.12259,1.12362,1.12259,1.1232,2881,0.8172757475082125\n834,2019/04/05 07:00:00,1.1231799999999998,1.1234,1.12245,1.1228799999999999,4088,0.7834394904457793\n835,2019/04/05 08:00:00,1.12289,1.1230799999999999,1.1224299999999998,1.12297,3489,0.7491039426522046\n836,2019/04/05 09:00:00,1.12296,1.1232600000000001,1.12279,1.12284,3077,0.7619047619046685\n837,2019/04/05 10:00:00,1.12285,1.12314,1.12261,1.1228,2970,0.6933797909407318\n838,2019/04/05 11:00:00,1.1228,1.12293,1.12234,1.1224399999999999,3036,0.6838487972508166\n839,2019/04/05 12:00:00,1.1224399999999999,1.1248,1.12166,1.1235600000000001,9547,0.7069597069597117\n840,2019/04/05 13:00:00,1.12358,1.12384,1.12201,1.12253,6586,0.7003745318352168\n841,2019/04/05 14:00:00,1.12252,1.12332,1.12218,1.12237,6233,0.7010752688172208\n842,2019/04/05 15:00:00,1.12239,1.12239,1.12096,1.12166,4781,0.5553662691652668\n843,2019/04/05 16:00:00,1.12166,1.12195,1.12127,1.12143,2997,0.5523156089194166\n844,2019/04/05 17:00:00,1.12142,1.12158,1.12103,1.12152,2295,0.5393634840871337\n845,2019/04/05 18:00:00,1.12152,1.12175,1.12133,1.12174,1864,0.5274914089347337\n846,2019/04/05 19:00:00,1.12175,1.12178,1.12137,1.12175,1399,0.522569444444475\n847,2019/04/05 20:00:00,1.12181,1.12184,1.12155,1.1215700000000002,555,0.4565217391304596\n848,2019/04/07 21:05:00,1.12127,1.122,1.12127,1.1218700000000001,682,0.46082089552242483\n849,2019/04/07 22:05:00,1.12184,1.12194,1.12173,1.12182,428,0.4625468164794489\n850,2019/04/07 23:05:00,1.12181,1.12188,1.1214899999999999,1.12178,507,0.4240740740740917\n851,2019/04/08,1.1218299999999999,1.1221,1.1214600000000001,1.12173,2272,0.45886654478979794\n852,2019/04/08 01:00:00,1.12172,1.12212,1.12144,1.12201,1831,0.4828244274809515\n853,2019/04/08 02:00:00,1.122,1.12257,1.12196,1.12248,1849,0.35350318471341274\n854,2019/04/08 03:00:00,1.12248,1.1231799999999998,1.1224,1.1228799999999999,2109,0.45866666666666145\n855,2019/04/08 04:00:00,1.1228799999999999,1.12307,1.1227200000000002,1.12303,1322,0.45866666666666145\n856,2019/04/08 05:00:00,1.12303,1.12304,1.1225,1.12257,1163,0.6254545454545181\n857,2019/04/08 06:00:00,1.12259,1.12295,1.12242,1.12263,3019,0.6077738515900625\n858,2019/04/08 07:00:00,1.12263,1.12293,1.12212,1.12283,3933,0.5951557093425288\n859,2019/04/08 08:00:00,1.12284,1.12368,1.12257,1.12332,3471,0.6628242074927703\n860,2019/04/08 09:00:00,1.12333,1.12392,1.12304,1.1239,2795,0.682065217391284\n861,2019/04/08 10:00:00,1.12389,1.1245399999999999,1.12362,1.12427,2562,0.7240566037735591\n862,2019/04/08 11:00:00,1.12428,1.12509,1.1240700000000001,1.1246399999999999,3967,0.7954022988505546\n863,2019/04/08 12:00:00,1.12465,1.1264,1.12426,1.12609,4665,0.8427561837455728\n864,2019/04/08 13:00:00,1.12609,1.12741,1.12596,1.12727,5562,0.8989113530326522\n865,2019/04/08 14:00:00,1.12727,1.1272799999999998,1.12592,1.12609,5007,0.8938906752411069\n866,2019/04/08 15:00:00,1.12608,1.12636,1.12579,1.1261,3540,0.8779714738510056\n867,2019/04/08 16:00:00,1.12609,1.12686,1.12596,1.12668,2266,0.8789308176100363\n868,2019/04/08 17:00:00,1.12669,1.1268200000000002,1.12578,1.1261700000000001,1735,0.83979763912307\n869,2019/04/08 18:00:00,1.12616,1.12625,1.1259299999999999,1.12611,1486,0.83979763912307\n870,2019/04/08 19:00:00,1.12612,1.12645,1.12594,1.12645,1847,0.8764805414551423\n871,2019/04/08 20:00:00,1.1264299999999998,1.1264299999999998,1.12586,1.12614,979,0.8764805414551752\n872,2019/04/08 21:05:00,1.1258700000000001,1.12646,1.1258700000000001,1.12596,2879,0.9237588652482406\n873,2019/04/08 22:05:00,1.12598,1.1263,1.12547,1.1256899999999999,1083,0.8431001890359033\n874,2019/04/08 23:05:00,1.12568,1.1257,1.12552,1.12553,742,0.8356435643564213\n875,2019/04/09,1.12552,1.1263,1.12552,1.12589,1511,0.834990059642143\n876,2019/04/09 01:00:00,1.12589,1.12656,1.12579,1.12628,1885,0.8248945147679247\n877,2019/04/09 02:00:00,1.12629,1.12667,1.12626,1.12655,1468,0.7655367231638325\n878,2019/04/09 03:00:00,1.12658,1.1268799999999999,1.1263299999999998,1.12669,1246,0.697080291970784\n879,2019/04/09 04:00:00,1.12669,1.1268200000000002,1.12652,1.12653,1149,0.7074074074073979\n880,2019/04/09 05:00:00,1.1265100000000001,1.1266,1.1261700000000001,1.1263100000000001,1513,0.6541095890411152\n881,2019/04/09 06:00:00,1.1263,1.12675,1.12591,1.1261700000000001,3300,0.5512367491165884\n882,2019/04/09 07:00:00,1.12618,1.1271799999999998,1.1255899999999999,1.12649,4514,0.5852941176470281\n883,2019/04/09 08:00:00,1.12649,1.12798,1.12618,1.12796,5465,0.6642857142856988\n884,2019/04/09 09:00:00,1.12795,1.12804,1.12658,1.12737,4771,0.6527093596058934\n885,2019/04/09 10:00:00,1.12737,1.1278299999999999,1.12713,1.1277700000000002,4113,0.6658291457286005\n886,2019/04/09 11:00:00,1.12778,1.12798,1.1272799999999998,1.12741,4011,0.6756097560975108\n887,2019/04/09 12:00:00,1.12743,1.1282,1.12722,1.12786,4640,0.7512562814070713\n888,2019/04/09 13:00:00,1.12788,1.12839,1.12758,1.12788,6052,0.7625899280575839\n889,2019/04/09 14:00:00,1.12788,1.12815,1.12691,1.12726,5543,0.6084905660377505\n890,2019/04/09 15:00:00,1.12727,1.12802,1.12675,1.1276700000000002,4324,0.5603864734299477\n891,2019/04/09 16:00:00,1.1276700000000002,1.1278,1.12697,1.12697,2663,0.5483870967741828\n892,2019/04/09 17:00:00,1.1269799999999999,1.1272799999999998,1.12627,1.12671,2174,0.44247787610620903\n893,2019/04/09 18:00:00,1.12668,1.12675,1.12626,1.1266,1453,0.44150110375276724\n894,2019/04/09 19:00:00,1.1266100000000001,1.12679,1.12616,1.1264,2153,0.4722222222222208\n895,2019/04/09 20:00:00,1.1264,1.12658,1.1261299999999999,1.12618,1248,0.4796954314720905\n896,2019/04/09 21:05:00,1.1262299999999998,1.12649,1.12621,1.12634,937,0.4576802507837383\n897,2019/04/09 22:05:00,1.12634,1.1266100000000001,1.12621,1.12656,675,0.3107569721116144\n898,2019/04/09 23:05:00,1.12656,1.12668,1.12648,1.1265100000000001,559,0.3134920634920809\n899,2019/04/10,1.12649,1.12669,1.1257,1.12581,1713,0.2416918429003319\n900,2019/04/10 01:00:00,1.12581,1.12614,1.1255,1.12568,1690,0.19345238095239098\n901,2019/04/10 02:00:00,1.1256700000000002,1.12588,1.12561,1.12582,1197,0.1396103896103582\n902,2019/04/10 03:00:00,1.12581,1.12621,1.12572,1.12602,1445,0.17701863354034783\n903,2019/04/10 04:00:00,1.1260299999999999,1.12635,1.12588,1.1261,1188,0.2639405204460626\n904,2019/04/10 05:00:00,1.12611,1.12634,1.1259,1.12627,1436,0.28063241106717324\n905,2019/04/10 06:00:00,1.12627,1.12734,1.12612,1.1271200000000001,2550,0.48441926345608405\n906,2019/04/10 07:00:00,1.12711,1.12723,1.12608,1.12653,4425,0.5958188153309681\n907,2019/04/10 08:00:00,1.12652,1.12719,1.1261299999999999,1.12693,3810,0.5979020979020688\n908,2019/04/10 09:00:00,1.1269200000000001,1.12785,1.12675,1.1277700000000002,2777,0.6893491124260064\n909,2019/04/10 10:00:00,1.12776,1.12791,1.12722,1.12748,2870,0.7008797653959001\n910,2019/04/10 11:00:00,1.12747,1.1280700000000001,1.12721,1.12758,4110,0.712290502793301\n911,2019/04/10 12:00:00,1.1275700000000002,1.12876,1.12531,1.12558,10873,0.5157024793388354\n912,2019/04/10 13:00:00,1.1255600000000001,1.12594,1.1229200000000001,1.1241,10068,0.36439665471925237\n913,2019/04/10 14:00:00,1.12409,1.12524,1.12399,1.1249799999999999,5394,0.401055408970989\n914,2019/04/10 15:00:00,1.125,1.1269,1.12486,1.12658,5100,0.5199115044247861\n915,2019/04/10 16:00:00,1.12657,1.12781,1.1262,1.12752,3485,0.5638190954773914\n916,2019/04/10 17:00:00,1.12753,1.1277700000000002,1.12732,1.12745,2893,0.5488565488565564\n917,2019/04/10 18:00:00,1.1274,1.1277,1.12626,1.12706,4244,0.48766603415560145\n918,2019/04/10 19:00:00,1.12703,1.12772,1.1269200000000001,1.12719,2250,0.4886363636363737\n919,2019/04/10 20:00:00,1.12719,1.12744,1.1269200000000001,1.12733,1324,0.43514644351465076\n920,2019/04/10 21:05:00,1.1272799999999998,1.12758,1.12713,1.1274899999999999,1371,0.44513457556936775\n921,2019/04/10 22:05:00,1.1274899999999999,1.12766,1.12733,1.12766,711,0.4496919917864616\n922,2019/04/10 23:05:00,1.1277,1.12776,1.12747,1.1275600000000001,414,0.416122004357307\n923,2019/04/11,1.1275,1.12791,1.12724,1.1275700000000002,1450,0.41157894736842676\n924,2019/04/11 01:00:00,1.1275700000000002,1.1278299999999999,1.12748,1.12761,1144,0.4019292604501592\n925,2019/04/11 02:00:00,1.12763,1.12775,1.12742,1.12753,1237,0.45000000000001467\n926,2019/04/11 03:00:00,1.12752,1.1276700000000002,1.12724,1.12763,858,0.6666666666666666\n927,2019/04/11 04:00:00,1.12762,1.12802,1.12754,1.12794,1098,0.6902834008097067\n928,2019/04/11 05:00:00,1.12795,1.12827,1.12784,1.12816,1061,0.5665722379603351\n929,2019/04/11 06:00:00,1.12816,1.12822,1.12743,1.1278299999999999,3709,0.3597359735973609\n930,2019/04/11 07:00:00,1.12782,1.1287,1.1274899999999999,1.12811,5939,0.4472934472934518\n931,2019/04/11 08:00:00,1.1281,1.12847,1.1274600000000001,1.12789,4502,0.633064516129108\n932,2019/04/11 09:00:00,1.12791,1.1284399999999999,1.1275899999999999,1.12776,2740,0.6300813008130647\n933,2019/04/11 10:00:00,1.1277700000000002,1.12837,1.1274,1.1283299999999998,2552,0.5849056603774249\n934,2019/04/11 11:00:00,1.12832,1.12832,1.1263299999999998,1.12665,4036,0.3938547486033608\n935,2019/04/11 12:00:00,1.12666,1.1267200000000002,1.12551,1.12596,5629,0.30787037037037157\n936,2019/04/11 13:00:00,1.12596,1.12715,1.12566,1.12707,5141,0.35698924731182696\n937,2019/04/11 14:00:00,1.1270799999999999,1.1275700000000002,1.12665,1.12737,5045,0.4115138592750823\n938,2019/04/11 15:00:00,1.12737,1.12739,1.12589,1.12611,4239,0.3541284403670019\n939,2019/04/11 16:00:00,1.12612,1.12632,1.12554,1.12579,2248,0.3362369337979287\n940,2019/04/11 17:00:00,1.1258299999999999,1.1261700000000001,1.12496,1.1254899999999999,2516,0.3143322475570222\n941,2019/04/11 18:00:00,1.1254899999999999,1.1258700000000001,1.1252799999999998,1.1255600000000001,1899,0.27288428324701347\n942,2019/04/11 19:00:00,1.12554,1.12601,1.12543,1.12592,1831,0.2588028169014083\n943,2019/04/11 20:00:00,1.12592,1.1259299999999999,1.12511,1.12514,802,0.262969588550991\n944,2019/04/11 21:05:00,1.12544,1.12582,1.1252799999999998,1.12565,2416,0.1937377690802277\n945,2019/04/11 22:05:00,1.12565,1.12605,1.12564,1.12584,797,0.2297551789077017\n946,2019/04/11 23:05:00,1.1258299999999999,1.1262,1.12582,1.12598,673,0.25091575091574686\n947,2019/04/12,1.12591,1.12914,1.1256899999999999,1.12832,4101,0.516786570743396\n948,2019/04/12 01:00:00,1.12832,1.1285100000000001,1.12765,1.12842,2517,0.5928473177441557\n949,2019/04/12 02:00:00,1.1284100000000001,1.12904,1.12838,1.1289200000000001,1466,0.693409742120329\n950,2019/04/12 03:00:00,1.12891,1.12943,1.12866,1.12895,1188,0.6916426512968132\n951,2019/04/12 04:00:00,1.12895,1.12915,1.12886,1.1291,743,0.6717791411042715\n952,2019/04/12 05:00:00,1.1291,1.1291,1.1283299999999998,1.12855,1130,0.6963434022257029\n953,2019/04/12 06:00:00,1.12856,1.12883,1.12821,1.12838,2482,0.7227722772276898\n954,2019/04/12 07:00:00,1.12842,1.12911,1.12812,1.1288200000000002,3934,0.7965811965811815\n955,2019/04/12 08:00:00,1.12881,1.13095,1.12868,1.1305100000000001,6626,0.8452535760728092\n956,2019/04/12 09:00:00,1.1305100000000001,1.13139,1.13039,1.13137,4381,0.8510638297872257\n957,2019/04/12 10:00:00,1.1313600000000001,1.13185,1.13053,1.1312799999999998,3839,0.8929889298892804\n958,2019/04/12 11:00:00,1.13127,1.13211,1.13063,1.13063,4122,0.896305125148968\n959,2019/04/12 12:00:00,1.1306399999999999,1.1322,1.1306399999999999,1.13199,4350,0.8945454545454378\n960,2019/04/12 13:00:00,1.1320000000000001,1.13234,1.1310799999999999,1.13135,4182,0.8944174757281349\n961,2019/04/12 14:00:00,1.13139,1.13221,1.13114,1.13132,5497,0.8568665377175998\n962,2019/04/12 15:00:00,1.13134,1.13204,1.13035,1.13039,4296,0.7432885906040105\n963,2019/04/12 16:00:00,1.13038,1.13073,1.12944,1.12981,2961,0.6151419558359498\n964,2019/04/12 17:00:00,1.12982,1.12991,1.12939,1.12965,1730,0.5849999999999832\n965,2019/04/12 18:00:00,1.1296700000000002,1.12989,1.1295,1.1295600000000001,1544,0.5849999999999832\n966,2019/04/12 19:00:00,1.12954,1.12984,1.1293799999999998,1.12982,1719,0.6279069767441703\n967,2019/04/12 20:00:00,1.12983,1.12983,1.12921,1.12973,961,0.6223404255319122\n968,2019/04/14 21:05:00,1.1303299999999998,1.13037,1.1298700000000002,1.1303299999999998,503,0.6488812392426835\n969,2019/04/14 22:05:00,1.13031,1.1306200000000002,1.1301299999999999,1.13035,616,0.5165876777251469\n970,2019/04/14 23:05:00,1.13035,1.13069,1.13018,1.13025,1102,0.4701298701298773\n971,2019/04/15,1.13028,1.13059,1.13011,1.13035,1505,0.3901734104046113\n972,2019/04/15 01:00:00,1.13035,1.1308799999999999,1.13014,1.13084,1464,0.3954154727793523\n973,2019/04/15 02:00:00,1.13085,1.13139,1.13076,1.13134,1351,0.4603580562659506\n974,2019/04/15 03:00:00,1.13132,1.1313799999999998,1.13106,1.1310799999999999,1125,0.44031830238726055\n975,2019/04/15 04:00:00,1.13107,1.13123,1.13083,1.13086,879,0.41499999999999837\n976,2019/04/15 05:00:00,1.13087,1.13101,1.13053,1.13063,1153,0.47293447293448465\n977,2019/04/15 06:00:00,1.1306200000000002,1.13137,1.13022,1.13114,2929,0.6177370030580986\n978,2019/04/15 07:00:00,1.13114,1.13205,1.1311,1.13161,4724,0.6923076923077098\n979,2019/04/15 08:00:00,1.1316,1.1319700000000001,1.1312200000000001,1.13176,4063,0.6923076923077098\n980,2019/04/15 09:00:00,1.13176,1.13192,1.1312,1.1313600000000001,3093,0.7105263157894905\n981,2019/04/15 10:00:00,1.13137,1.1314799999999998,1.1307,1.1309200000000001,3660,0.6537530266343695\n982,2019/04/15 11:00:00,1.1309,1.1316,1.13057,1.13075,3167,0.5937499999999819\n983,2019/04/15 12:00:00,1.13077,1.13145,1.13075,1.1312799999999998,3948,0.5654596100278245\n984,2019/04/15 13:00:00,1.1312799999999998,1.13153,1.12972,1.1303,4084,0.440604751619861\n985,2019/04/15 14:00:00,1.13031,1.1311799999999999,1.13024,1.13079,4792,0.4473684210526239\n986,2019/04/15 15:00:00,1.13078,1.13078,1.12999,1.13034,3645,0.3871681415929335\n987,2019/04/15 16:00:00,1.13035,1.13084,1.13018,1.13063,2198,0.3194103194103548\n988,2019/04/15 17:00:00,1.1306200000000002,1.13077,1.13014,1.13022,1337,0.31630170316304884\n989,2019/04/15 18:00:00,1.13022,1.13047,1.12996,1.1303299999999998,1776,0.32019704433501606\n990,2019/04/15 19:00:00,1.13034,1.13052,1.12996,1.1305,1542,0.35433070866144023\n991,2019/04/15 20:00:00,1.13052,1.13052,1.13008,1.13028,1165,0.3152866242038667\n992,2019/04/15 21:05:00,1.13035,1.1306100000000001,1.12996,1.13011,1870,0.14981273408247892\n993,2019/04/15 22:05:00,1.13012,1.13029,1.13009,1.1302299999999998,540,0.14981273408247892\n994,2019/04/15 23:05:00,1.1302299999999998,1.1304299999999998,1.1301700000000001,1.1304,556,0.1935483870968101\n995,2019/04/16,1.13035,1.1307,1.1302,1.1305100000000001,1409,0.31640625000011824\n996,2019/04/16 01:00:00,1.13052,1.1306,1.12923,1.1293,2040,0.21036585365857827\n997,2019/04/16 02:00:00,1.12929,1.12989,1.12925,1.12981,1211,0.21036585365857827\n998,2019/04/16 03:00:00,1.12982,1.13029,1.12964,1.1302299999999998,1080,0.39299610894949133\n999,2019/04/16 04:00:00,1.13024,1.13044,1.13015,1.1304,1035,0.42647058823533857\n1000,2019/04/16 05:00:00,1.13039,1.13053,1.13018,1.13046,1333,0.4882812500000539\n1001,2019/04/16 06:00:00,1.13044,1.13093,1.13009,1.13076,2790,0.5317725752508604\n1002,2019/04/16 07:00:00,1.13075,1.13114,1.1298700000000002,1.13097,5172,0.5325443786982765\n1003,2019/04/16 08:00:00,1.13097,1.13135,1.1304100000000001,1.13047,4105,0.5894428152493016\n1004,2019/04/16 09:00:00,1.13047,1.1310200000000001,1.12794,1.12904,8776,0.33619210977703406\n1005,2019/04/16 10:00:00,1.12901,1.1304299999999998,1.12894,1.13002,5596,0.33619210977703406\n1006,2019/04/16 11:00:00,1.13,1.13103,1.1298700000000002,1.1309,4324,0.39710610932476864\n1007,2019/04/16 12:00:00,1.1309,1.13113,1.12915,1.1296700000000002,6387,0.36505681818182456\n1008,2019/04/16 13:00:00,1.12965,1.1302299999999998,1.12939,1.1295600000000001,6724,0.3521739130435036\n1009,2019/04/16 14:00:00,1.1295600000000001,1.13055,1.12933,1.12998,6215,0.35378031383739184\n1010,2019/04/16 15:00:00,1.12995,1.13021,1.12871,1.12921,5169,0.3723723723724052\n1011,2019/04/16 16:00:00,1.12923,1.12927,1.12798,1.12836,3299,0.335588633288252\n1012,2019/04/16 17:00:00,1.1283299999999998,1.1288799999999999,1.12826,1.12876,2298,0.29756795422034654\n1013,2019/04/16 18:00:00,1.12875,1.12901,1.12842,1.1287200000000002,1707,0.29555236728844236\n1014,2019/04/16 19:00:00,1.12875,1.12889,1.12822,1.12826,1941,0.2782485875706715\n1015,2019/04/16 20:00:00,1.12828,1.12838,1.12796,1.12796,1121,0.22919708029203043\n1016,2019/04/16 21:05:00,1.1283299999999998,1.1286100000000001,1.1282,1.12858,1344,0.23909774436097392\n1017,2019/04/16 22:05:00,1.12859,1.12877,1.12784,1.12816,1262,0.22126436781614606\n1018,2019/04/16 23:05:00,1.12815,1.1285100000000001,1.12815,1.12842,672,0.34298440979963307\n1019,2019/04/17,1.1284100000000001,1.12867,1.1281,1.1286200000000002,1664,0.3617021276596478\n1020,2019/04/17 01:00:00,1.1286200000000002,1.12943,1.12836,1.1293,1532,0.3827160493827493\n1021,2019/04/17 02:00:00,1.12933,1.13025,1.1293,1.1298,2464,0.5308641975309059\n1022,2019/04/17 03:00:00,1.12979,1.13032,1.1297700000000002,1.13027,1343,0.5375253549696165\n1023,2019/04/17 04:00:00,1.13026,1.1304,1.13024,1.13028,1230,0.5205183585313554\n1024,2019/04/17 05:00:00,1.13029,1.13111,1.13026,1.1311,1528,0.6610169491525528\n1025,2019/04/17 06:00:00,1.13109,1.13134,1.1303299999999998,1.1306,3524,0.7938388625592646\n1026,2019/04/17 07:00:00,1.13059,1.13234,1.13035,1.13166,4790,0.8333333333333476\n1027,2019/04/17 08:00:00,1.13164,1.1320000000000001,1.13107,1.13154,3806,0.8290766208251557\n1028,2019/04/17 09:00:00,1.13153,1.1319,1.13055,1.1308200000000002,3751,0.7800369685767018\n1029,2019/04/17 10:00:00,1.13083,1.13117,1.13046,1.13091,3202,0.8053435114503744\n1030,2019/04/17 11:00:00,1.1309200000000001,1.13131,1.13016,1.13018,3674,0.757798165137605\n1031,2019/04/17 12:00:00,1.13018,1.1307200000000002,1.13,1.13032,4160,0.7799607072691453\n1032,2019/04/17 13:00:00,1.1303299999999998,1.1305,1.12906,1.13034,5589,0.6583747927031453\n1033,2019/04/17 14:00:00,1.13034,1.1307,1.12904,1.13027,6827,0.663907284768206\n1034,2019/04/17 15:00:00,1.13029,1.1303,1.1294899999999999,1.1295600000000001,4560,0.615530303030304\n1035,2019/04/17 16:00:00,1.1295600000000001,1.1300700000000001,1.12927,1.1295899999999999,3117,0.5192307692307775\n1036,2019/04/17 17:00:00,1.1296,1.13022,1.12955,1.12964,2028,0.5273109243697423\n1037,2019/04/17 18:00:00,1.12963,1.12991,1.1293799999999998,1.12982,2120,0.5010309278350125\n1038,2019/04/17 19:00:00,1.1298,1.13011,1.12973,1.1299,1319,0.4423963133640077\n1039,2019/04/17 20:00:00,1.12991,1.13002,1.12926,1.12937,1230,0.36899563318773326\n1040,2019/04/17 21:05:00,1.12935,1.12991,1.1293,1.12973,2895,0.19273743016756242\n1041,2019/04/17 22:05:00,1.12974,1.12998,1.1297,1.1297700000000002,557,0.20821917808216062\n1042,2019/04/17 23:05:00,1.12976,1.12982,1.12961,1.12962,522,0.23602484472047333\n1043,2019/04/18,1.12963,1.12984,1.12939,1.12983,1093,0.23145400593466178\n1044,2019/04/18 01:00:00,1.12984,1.1300299999999999,1.1292,1.12921,2168,0.2507552870089846\n1045,2019/04/18 02:00:00,1.1292,1.12954,1.1289200000000001,1.12919,1311,0.2419825072885758\n1046,2019/04/18 03:00:00,1.1292,1.12939,1.1291799999999999,1.12937,1075,0.33333333333327386\n1047,2019/04/18 04:00:00,1.1293799999999998,1.12953,1.1292799999999998,1.12944,808,0.31950207468873437\n1048,2019/04/18 05:00:00,1.12945,1.1300700000000001,1.12944,1.12996,1473,0.44406779661017537\n1049,2019/04/18 06:00:00,1.12996,1.13035,1.12961,1.13009,2684,0.5282392026577735\n1050,2019/04/18 07:00:00,1.13008,1.13021,1.1264299999999998,1.12706,9320,0.23841059602646938\n1051,2019/04/18 08:00:00,1.12707,1.12707,1.12427,1.1260299999999999,9334,0.17932752179327133\n1052,2019/04/18 09:00:00,1.12604,1.12605,1.1248799999999999,1.12513,4071,0.1583652618135348\n1053,2019/04/18 10:00:00,1.1251200000000001,1.12568,1.12487,1.12537,3118,0.16824966078697468\n1054,2019/04/18 11:00:00,1.12537,1.12579,1.12496,1.12517,3372,0.18048128342246725\n1055,2019/04/18 12:00:00,1.1252,1.12535,1.1237700000000002,1.1240299999999999,7664,0.14883720930233207\n1056,2019/04/18 13:00:00,1.1240299999999999,1.12534,1.1235700000000002,1.12491,6756,0.14695752009185378\n1057,2019/04/18 14:00:00,1.12491,1.12504,1.1235600000000001,1.12428,5885,0.14858490566039287\n1058,2019/04/18 15:00:00,1.12429,1.12445,1.12374,1.12405,4274,0.13209876543212168\n1059,2019/04/18 16:00:00,1.1240299999999999,1.1240299999999999,1.12286,1.12294,3816,0.1229885057471451\n1060,2019/04/18 17:00:00,1.12293,1.1230200000000001,1.12258,1.12277,3249,0.11915367483297931\n1061,2019/04/18 18:00:00,1.12278,1.12313,1.12268,1.1229799999999999,2247,0.11620111731843351\n1062,2019/04/18 19:00:00,1.1229799999999999,1.1231,1.12286,1.12293,1756,0.0594530321046089\n1063,2019/04/18 20:00:00,1.12293,1.1232600000000001,1.12265,1.12275,1198,0.04470588235294813\n1064,2019/04/18 21:05:00,1.1229200000000001,1.12348,1.12271,1.12345,961,0.10830324909747206\n1065,2019/04/18 22:05:00,1.1234600000000001,1.12371,1.12332,1.1237,511,0.22991689750691482\n1066,2019/04/18 23:05:00,1.12368,1.12379,1.1234,1.1234600000000001,405,0.2466124661246689\n1067,2019/04/19,1.12345,1.12402,1.12344,1.12395,405,0.2915601023017801\n1068,2019/04/19 01:00:00,1.12394,1.12416,1.12388,1.12409,290,0.29695431472079775\n1069,2019/04/19 02:00:00,1.1241,1.12419,1.12321,1.1235899999999999,919,0.3478260869564882\n1070,2019/04/19 03:00:00,1.12362,1.1236700000000002,1.1235899999999999,1.12363,196,0.36923076923073145\n1071,2019/04/19 04:00:00,1.12363,1.1237700000000002,1.12348,1.1237700000000002,374,0.37681159420288646\n1072,2019/04/19 05:00:00,1.1238,1.1243,1.1238,1.12427,1977,0.4597989949748586\n1073,2019/04/19 06:00:00,1.12426,1.12447,1.12412,1.12419,2640,0.6116207951070295\n1074,2019/04/19 07:00:00,1.12419,1.1245100000000001,1.12418,1.12432,1685,0.6732673267326929\n1075,2019/04/19 08:00:00,1.1243299999999998,1.1247200000000002,1.12429,1.12461,692,0.6837060702875815\n1076,2019/04/19 09:00:00,1.1246,1.12461,1.12429,1.1244299999999998,792,0.6837060702875815\n1077,2019/04/19 10:00:00,1.12442,1.12468,1.12438,1.1246200000000002,651,0.7243816254417194\n1078,2019/04/19 11:00:00,1.1246200000000002,1.1246399999999999,1.12447,1.12449,344,0.7011494252873895\n1079,2019/04/19 12:00:00,1.1245,1.12456,1.1241700000000001,1.12438,1674,0.597014925373164\n1080,2019/04/19 13:00:00,1.12438,1.12459,1.12418,1.1244,1563,0.5893536121673129\n1081,2019/04/19 14:00:00,1.12438,1.12474,1.12434,1.1246,1610,0.5764705882353279\n1082,2019/04/19 15:00:00,1.1246200000000002,1.1247,1.12436,1.12456,2510,0.5518672199170388\n1083,2019/04/19 16:00:00,1.12455,1.12455,1.12421,1.12446,1286,0.6989247311828123\n1084,2019/04/19 17:00:00,1.12446,1.12449,1.12421,1.12436,1037,0.6989247311828123\n1085,2019/04/19 18:00:00,1.12436,1.12456,1.12425,1.12445,1232,0.7383720930232114\n1086,2019/04/19 19:00:00,1.1244399999999999,1.12461,1.1244100000000001,1.12446,735,0.6370967741935368\n1087,2019/04/19 20:00:00,1.12447,1.12465,1.12436,1.12456,5903,0.5689655172412539\n1088,2019/04/21 21:05:00,1.12428,1.12446,1.12365,1.1238,423,0.3387978142075647\n1089,2019/04/21 22:05:00,1.12381,1.1242299999999998,1.12381,1.12419,752,0.25308641975296964\n1090,2019/04/21 23:05:00,1.12418,1.1244100000000001,1.12412,1.12435,313,0.3277777777777832\n1091,2019/04/22,1.12437,1.1245,1.12418,1.12421,784,0.33516483516488743\n1092,2019/04/22 01:00:00,1.12421,1.12438,1.12399,1.12402,849,0.3034825870647431\n1093,2019/04/22 02:00:00,1.1240299999999999,1.12412,1.12363,1.12394,918,0.29468599033820575\n1094,2019/04/22 03:00:00,1.12392,1.12409,1.12364,1.12364,787,0.2843137254902494\n1095,2019/04/22 04:00:00,1.12364,1.12379,1.12355,1.1237700000000002,616,0.21717171717175965\n1096,2019/04/22 05:00:00,1.1237700000000002,1.1243100000000001,1.12368,1.1242299999999998,899,0.380000000000032\n1097,2019/04/22 06:00:00,1.12421,1.1244,1.124,1.12429,1314,0.42622950819674515\n1098,2019/04/22 07:00:00,1.1243,1.12467,1.1241,1.1246399999999999,1197,0.4833948339483549\n1099,2019/04/22 08:00:00,1.12463,1.12473,1.12428,1.12455,968,0.4814814814814845\n1100,2019/04/22 09:00:00,1.1245399999999999,1.12494,1.1245399999999999,1.12486,825,0.5104895104895013\n1101,2019/04/22 10:00:00,1.12486,1.12515,1.12479,1.12493,812,0.5469798657718559\n1102,2019/04/22 11:00:00,1.12493,1.12503,1.12468,1.12476,991,0.6848739495798558\n1103,2019/04/22 12:00:00,1.12477,1.12544,1.12458,1.1248799999999999,2263,0.705882352941199\n1104,2019/04/22 13:00:00,1.12487,1.1253799999999998,1.12481,1.1251200000000001,2078,0.6863468634686272\n1105,2019/04/22 14:00:00,1.12513,1.12565,1.12496,1.12542,2430,0.705882352941199\n1106,2019/04/22 15:00:00,1.12543,1.12616,1.12524,1.12575,1562,0.7943925233644776\n1107,2019/04/22 16:00:00,1.12575,1.1261299999999999,1.1257,1.12578,1636,0.8947368421052836\n1108,2019/04/22 17:00:00,1.12579,1.12611,1.12578,1.12605,1231,0.8947368421052836\n1109,2019/04/22 18:00:00,1.12605,1.12614,1.12581,1.12581,1671,0.9247311827956912\n1110,2019/04/22 19:00:00,1.12581,1.12601,1.12576,1.1258299999999999,1011,0.887931034482795\n1111,2019/04/22 20:00:00,1.12581,1.12584,1.12555,1.12555,717,0.8073770491803574\n1112,2019/04/22 21:05:00,1.12561,1.12594,1.12537,1.12592,614,0.7346938775510352\n1113,2019/04/22 22:05:00,1.1259299999999999,1.12601,1.12585,1.12594,428,0.735772357723599\n1114,2019/04/22 23:05:00,1.12596,1.12599,1.12579,1.12581,365,0.6926406926407317\n1115,2019/04/23,1.12584,1.12584,1.12442,1.1244299999999998,1772,0.40057636887611003\n1116,2019/04/23 01:00:00,1.1244399999999999,1.12506,1.1244399999999999,1.12491,1281,0.413690476190512\n1117,2019/04/23 02:00:00,1.12491,1.12507,1.12469,1.12491,951,0.3461538461539029\n1118,2019/04/23 03:00:00,1.12491,1.1254600000000001,1.12491,1.12526,966,0.42461538461544707\n1119,2019/04/23 04:00:00,1.12526,1.1253,1.12493,1.12496,873,0.37248322147654034\n1120,2019/04/23 05:00:00,1.12496,1.12514,1.12466,1.12493,1263,0.21897810218982303\n1121,2019/04/23 06:00:00,1.12491,1.12491,1.12425,1.12474,3764,0.19047619047622738\n1122,2019/04/23 07:00:00,1.12475,1.12509,1.12414,1.12447,4905,0.22674418604650526\n1123,2019/04/23 08:00:00,1.12449,1.12579,1.1241700000000001,1.12497,4071,0.35279805352799865\n1124,2019/04/23 09:00:00,1.12499,1.12609,1.12494,1.1255899999999999,3262,0.40137614678898953\n1125,2019/04/23 10:00:00,1.12558,1.12558,1.12486,1.12524,2958,0.41371158392434393\n1126,2019/04/23 11:00:00,1.12525,1.12526,1.12438,1.12459,3391,0.3724604966139979\n1127,2019/04/23 12:00:00,1.12461,1.12474,1.12163,1.12174,5882,0.22222222222222915\n1128,2019/04/23 13:00:00,1.12173,1.1218,1.12037,1.12103,5978,0.19013237063779626\n1129,2019/04/23 14:00:00,1.1210200000000001,1.12115,1.11919,1.12063,6082,0.19458128078818582\n1130,2019/04/23 15:00:00,1.1206399999999999,1.12122,1.11999,1.1211799999999998,3793,0.20146520146521102\n1131,2019/04/23 16:00:00,1.1211799999999998,1.1215700000000002,1.121,1.12131,3580,0.23329425556858988\n1132,2019/04/23 17:00:00,1.12131,1.1214,1.12091,1.1213,2611,0.19441069258809365\n1133,2019/04/23 18:00:00,1.12129,1.12162,1.12107,1.12145,1951,0.2153846153846263\n1134,2019/04/23 19:00:00,1.1214,1.1224299999999998,1.1214,1.1224100000000001,2241,0.2925472747497102\n1135,2019/04/23 20:00:00,1.1224,1.12273,1.12211,1.12259,1049,0.3299549549549579\n1136,2019/04/23 21:05:00,1.12235,1.1225,1.1221,1.12229,1501,0.31976744186048833\n1137,2019/04/23 22:05:00,1.12228,1.12232,1.12208,1.12214,796,0.2588383838383925\n1138,2019/04/23 23:05:00,1.12216,1.1224100000000001,1.1221299999999998,1.1223299999999998,642,0.23865110246435897\n1139,2019/04/24,1.12236,1.12237,1.12166,1.12173,1565,0.2271604938271959\n1140,2019/04/24 01:00:00,1.12173,1.1220299999999999,1.12091,1.12166,2942,0.21983273596180267\n1141,2019/04/24 02:00:00,1.12165,1.12166,1.12087,1.12137,2040,0.3250883392226654\n1142,2019/04/24 03:00:00,1.1213799999999998,1.12143,1.1208200000000001,1.1210799999999999,1418,0.4134831460674739\n1143,2019/04/24 04:00:00,1.12107,1.1216,1.12105,1.1215700000000002,1383,0.5843023255814985\n1144,2019/04/24 05:00:00,1.12158,1.1217700000000002,1.12129,1.1214,1113,0.5960451977402377\n1145,2019/04/24 06:00:00,1.1214,1.1215,1.12036,1.12077,3614,0.4271844660195316\n1146,2019/04/24 07:00:00,1.12076,1.12174,1.12005,1.12163,5693,0.43668122270751825\n1147,2019/04/24 08:00:00,1.12162,1.12192,1.11943,1.12178,7380,0.3798449612403848\n1148,2019/04/24 09:00:00,1.1217700000000002,1.1223,1.1210200000000001,1.1214,4239,0.3234672304440985\n1149,2019/04/24 10:00:00,1.12142,1.1214899999999999,1.12077,1.12087,3842,0.26282051282060803\n1150,2019/04/24 11:00:00,1.12087,1.12115,1.12032,1.12109,3746,0.24023437500007788\n1151,2019/04/24 12:00:00,1.1210799999999999,1.12115,1.12022,1.1203,4164,0.236538461538545\n1152,2019/04/24 13:00:00,1.12032,1.12032,1.11805,1.11923,6331,0.1565934065934527\n1153,2019/04/24 14:00:00,1.11917,1.12094,1.1188799999999999,1.1204100000000001,7413,0.23687752355320474\n1154,2019/04/24 15:00:00,1.12043,1.12045,1.11897,1.11909,4428,0.26347305389226133\n1155,2019/04/24 16:00:00,1.1191,1.1191799999999998,1.1156,1.11584,5902,0.17582417582420945\n1156,2019/04/24 17:00:00,1.1158299999999999,1.11647,1.1152799999999998,1.11639,3895,0.17120622568096325\n1157,2019/04/24 18:00:00,1.11637,1.1164399999999999,1.11402,1.1141,5439,0.13984168865438418\n1158,2019/04/24 19:00:00,1.11408,1.11569,1.11408,1.1156,3188,0.1267857142857284\n1159,2019/04/24 20:00:00,1.11561,1.1158700000000001,1.11506,1.11516,1476,0.15311004784690804\n1160,2019/04/24 21:05:00,1.11522,1.11581,1.11515,1.11572,2159,0.1373737373737562\n1161,2019/04/24 22:05:00,1.11575,1.1158700000000001,1.11531,1.11538,979,0.13537117903933232\n1162,2019/04/24 23:05:00,1.11538,1.11555,1.11497,1.1153,1110,0.09429824561406375\n1163,2019/04/25,1.1152799999999998,1.11534,1.11448,1.11521,1802,0.09188034188036977\n1164,2019/04/25 01:00:00,1.11521,1.11543,1.11445,1.11538,1828,0.10520487264675472\n1165,2019/04/25 02:00:00,1.11537,1.11598,1.11501,1.11589,1680,0.15822784810128895\n1166,2019/04/25 03:00:00,1.1158700000000001,1.1159,1.11556,1.11561,1005,0.20519835841316042\n1167,2019/04/25 04:00:00,1.11562,1.1157700000000002,1.11501,1.11569,1094,0.1215469613259904\n1168,2019/04/25 05:00:00,1.11568,1.1158299999999999,1.11524,1.11552,1394,0.12876712328766166\n1169,2019/04/25 06:00:00,1.11551,1.1162100000000001,1.1151,1.1154700000000002,3343,0.2966292134831741\n1170,2019/04/25 07:00:00,1.11543,1.1159299999999999,1.11442,1.11541,6707,0.2744282744283065\n1171,2019/04/25 08:00:00,1.1154,1.11548,1.11344,1.1147,5878,0.2913907284768439\n1172,2019/04/25 09:00:00,1.11469,1.11476,1.1128799999999999,1.11332,4796,0.2593320235756551\n1173,2019/04/25 10:00:00,1.11332,1.1141,1.11309,1.11323,3469,0.23217922606925553\n1174,2019/04/25 11:00:00,1.11324,1.11338,1.11215,1.1123299999999998,4372,0.1948717948718071\n1175,2019/04/25 12:00:00,1.11232,1.11306,1.11176,1.11303,6742,0.17475728155339107\n1176,2019/04/25 13:00:00,1.113,1.1146399999999999,1.11293,1.11414,6189,0.3584905660377211\n1177,2019/04/25 14:00:00,1.11415,1.11541,1.11388,1.1143299999999998,5779,0.4454545454545488\n1178,2019/04/25 15:00:00,1.1143399999999999,1.11475,1.11319,1.11392,4132,0.4038694074969808\n1179,2019/04/25 16:00:00,1.1139299999999999,1.1143100000000001,1.11294,1.11362,2883,0.3500627352572219\n1180,2019/04/25 17:00:00,1.11363,1.1138299999999999,1.11319,1.11354,2228,0.3500627352572219\n1181,2019/04/25 18:00:00,1.11355,1.1135700000000002,1.11267,1.11268,2019,0.3513853904282277\n1182,2019/04/25 19:00:00,1.11267,1.11335,1.11267,1.11324,1814,0.346446700507653\n1183,2019/04/25 20:00:00,1.11323,1.11335,1.11285,1.11285,901,0.31929347826088783\n1184,2019/04/25 21:05:00,1.11305,1.11362,1.11291,1.11354,1939,0.376978417266208\n1185,2019/04/25 22:05:00,1.11353,1.1137299999999999,1.11341,1.1137,650,0.4490131578947468\n1186,2019/04/25 23:05:00,1.11369,1.11388,1.11348,1.1135,842,0.5079365079365408\n1187,2019/04/26,1.11348,1.11363,1.11238,1.1129,2843,0.42540620384048927\n1188,2019/04/26 01:00:00,1.1129,1.11381,1.11266,1.1133600000000001,2521,0.5091514143095075\n1189,2019/04/26 02:00:00,1.1133600000000001,1.11409,1.1129,1.11385,2770,0.5661016949152731\n1190,2019/04/26 03:00:00,1.11384,1.11385,1.11344,1.1135,1195,0.40740740740744547\n1191,2019/04/26 04:00:00,1.11354,1.11374,1.11348,1.11348,884,0.27887323943663733\n1192,2019/04/26 05:00:00,1.1134899999999999,1.1139700000000001,1.11327,1.11385,1518,0.36969696969702764\n1193,2019/04/26 06:00:00,1.11385,1.1147,1.1134,1.1144100000000001,3715,0.5158730158730312\n1194,2019/04/26 07:00:00,1.1144,1.1146399999999999,1.11378,1.11404,3827,0.5158730158730312\n1195,2019/04/26 08:00:00,1.11404,1.11442,1.11291,1.11419,4160,0.4721549636803945\n1196,2019/04/26 09:00:00,1.11422,1.1144399999999999,1.11369,1.11369,2219,0.4746987951807182\n1197,2019/04/26 10:00:00,1.11368,1.1139299999999999,1.11344,1.11365,2189,0.4477272727272605\n1198,2019/04/26 11:00:00,1.11366,1.11414,1.11322,1.1133,3216,0.41885964912281326\n1199,2019/04/26 12:00:00,1.11331,1.1158700000000001,1.11107,1.11476,11105,0.4237695078031473\n1200,2019/04/26 13:00:00,1.11476,1.11566,1.11419,1.1153899999999999,8475,0.4132029339853506\n1201,2019/04/26 14:00:00,1.11537,1.1173600000000001,1.11511,1.11624,9197,0.5785876993166463\n1202,2019/04/26 15:00:00,1.11627,1.11684,1.11534,1.1153600000000001,5672,0.5697674418604801\n1203,2019/04/26 16:00:00,1.11534,1.1163299999999998,1.11506,1.11627,2628,0.5372093023255912\n1204,2019/04/26 17:00:00,1.11626,1.11656,1.11558,1.11566,1597,0.5492638731597008\n1205,2019/04/26 18:00:00,1.1156700000000002,1.11596,1.1150799999999998,1.11537,1803,0.5198285101822173\n1206,2019/04/26 19:00:00,1.11538,1.1153899999999999,1.11467,1.1147200000000002,2460,0.4967741935484019\n1207,2019/04/26 20:00:00,1.1147200000000002,1.11533,1.11463,1.11486,1014,0.45180023228805916\n1208,2019/04/28 21:05:00,1.1146200000000002,1.11505,1.11461,1.11496,1078,0.4507531865585435\n1209,2019/04/28 22:05:00,1.11495,1.11505,1.11476,1.11494,441,0.5012886597938371\n1210,2019/04/28 23:05:00,1.11494,1.11514,1.1147200000000002,1.1149,755,0.5031766200762737\n1211,2019/04/29,1.11485,1.11499,1.11471,1.11484,1188,0.5190039318480051\n1212,2019/04/29 01:00:00,1.11484,1.1149,1.11447,1.1148799999999999,903,0.5040322580645423\n1213,2019/04/29 02:00:00,1.1148799999999999,1.11576,1.11485,1.11575,1049,0.6515837104072753\n1214,2019/04/29 03:00:00,1.11571,1.11585,1.11552,1.11574,690,0.6585365853658826\n1215,2019/04/29 04:00:00,1.11574,1.11596,1.11568,1.1158,595,0.47260273972607636\n1216,2019/04/29 05:00:00,1.11578,1.11598,1.1156,1.11571,876,0.4635761589404163\n1217,2019/04/29 06:00:00,1.11569,1.11657,1.1155700000000002,1.11591,2494,0.5922619047619858\n1218,2019/04/29 07:00:00,1.11592,1.1165399999999999,1.11555,1.11596,3310,0.5587301587301955\n1219,2019/04/29 08:00:00,1.11595,1.11666,1.11561,1.11647,2874,0.6787003610109371\n1220,2019/04/29 09:00:00,1.11645,1.11655,1.11594,1.11617,2383,0.7966101694915971\n1221,2019/04/29 10:00:00,1.11616,1.11617,1.1151,1.1152600000000001,1712,0.5949367088608245\n1222,2019/04/29 11:00:00,1.11525,1.11562,1.1149,1.1150799999999998,2379,0.5628742514970542\n1223,2019/04/29 12:00:00,1.1150799999999998,1.1161,1.11449,1.11552,4930,0.5579196217494478\n1224,2019/04/29 13:00:00,1.1155,1.1159299999999999,1.11499,1.11501,3799,0.5536585365853897\n1225,2019/04/29 14:00:00,1.1150200000000001,1.11673,1.11484,1.11657,4374,0.6091269841270348\n1226,2019/04/29 15:00:00,1.11659,1.1169799999999999,1.11629,1.11653,3364,0.6574257425742995\n1227,2019/04/29 16:00:00,1.11656,1.11837,1.11648,1.11806,3709,0.6899641577061391\n1228,2019/04/29 17:00:00,1.11806,1.11829,1.11775,1.11792,2455,0.684881602914441\n1229,2019/04/29 18:00:00,1.11791,1.1186399999999999,1.11763,1.11826,2283,0.6837606837607069\n1230,2019/04/29 19:00:00,1.11827,1.11853,1.11814,1.11828,1482,0.692173913043516\n1231,2019/04/29 20:00:00,1.11828,1.1185399999999999,1.11819,1.11839,788,0.6614785992217849\n1232,2019/04/29 21:05:00,1.11846,1.1185,1.11822,1.1183299999999998,900,0.6640625000000119\n1233,2019/04/29 22:05:00,1.11834,1.11843,1.11827,1.11839,256,0.656000000000004\n1234,2019/04/29 23:05:00,1.11839,1.1185399999999999,1.1183100000000001,1.11845,468,0.6634050880626152\n1235,2019/04/30,1.11836,1.1190799999999999,1.11824,1.11894,870,0.805327868852412\n1236,2019/04/30 01:00:00,1.11893,1.11893,1.11788,1.11856,2990,0.7797619047618688\n1237,2019/04/30 02:00:00,1.11856,1.11896,1.11846,1.11881,981,0.8325358851674234\n1238,2019/04/30 03:00:00,1.11883,1.11925,1.11868,1.11868,871,0.8434004474272596\n1239,2019/04/30 04:00:00,1.11868,1.11883,1.1185200000000002,1.11881,561,0.807065217391291\n1240,2019/04/30 05:00:00,1.11881,1.11899,1.1175899999999999,1.1178299999999999,1210,0.6371681415928586\n1241,2019/04/30 06:00:00,1.1178,1.11829,1.11754,1.11824,2911,0.468553459119393\n1242,2019/04/30 07:00:00,1.1183,1.11947,1.11806,1.11856,5198,0.6123853211008466\n1243,2019/04/30 08:00:00,1.11857,1.12075,1.1185,1.12056,6901,0.6963249516440676\n1244,2019/04/30 09:00:00,1.12057,1.1215700000000002,1.1205200000000002,1.12099,4506,0.7378964941569136\n1245,2019/04/30 10:00:00,1.121,1.12135,1.12036,1.12115,2717,0.718241042345251\n1246,2019/04/30 11:00:00,1.12114,1.12196,1.12096,1.12194,2561,0.7437037037036791\n1247,2019/04/30 12:00:00,1.12195,1.12275,1.1215600000000001,1.1219,5745,0.7705570291776913\n1248,2019/04/30 13:00:00,1.1219,1.12287,1.12152,1.12253,4508,0.7667984189723095\n1249,2019/04/30 14:00:00,1.1225399999999999,1.1225399999999999,1.12048,1.1205,6482,0.6583541147132091\n1250,2019/04/30 15:00:00,1.12049,1.12074,1.11972,1.1200299999999999,6393,0.6270783847980969\n1251,2019/04/30 16:00:00,1.1200299999999999,1.1217,1.11992,1.12163,3047,0.664171122994644\n1252,2019/04/30 17:00:00,1.12163,1.1225,1.12129,1.12194,3268,0.6815415821500935\n1253,2019/04/30 18:00:00,1.1219299999999999,1.12214,1.12151,1.1221299999999998,3539,0.6927835051546106\n1254,2019/04/30 19:00:00,1.1221299999999998,1.12222,1.1215,1.1216,3312,0.763218390804588\n1255,2019/04/30 20:00:00,1.12161,1.12172,1.1213600000000001,1.1213899999999999,1237,0.7554038680318517\n1256,2019/04/30 21:05:00,1.1215,1.12166,1.12109,1.1214899999999999,1096,0.6928934010152106\n1257,2019/04/30 22:05:00,1.1214899999999999,1.12154,1.12103,1.12131,801,0.6276276276276196\n1258,2019/04/30 23:05:00,1.12131,1.12155,1.12115,1.12154,414,0.5760683760683574\n1259,2019/05/01,1.12152,1.12179,1.12144,1.12179,622,0.6087689713322063\n1260,2019/05/01 01:00:00,1.1218,1.12182,1.12163,1.1216899999999999,551,0.5663551401869125\n1261,2019/05/01 02:00:00,1.1217,1.12175,1.12134,1.1214899999999999,529,0.46185567010311956\n1262,2019/05/01 03:00:00,1.1215,1.12194,1.1214899999999999,1.1218,658,0.47336065573771235\n1263,2019/05/01 04:00:00,1.12181,1.12184,1.1216899999999999,1.1217,284,0.6015625000000334\n1264,2019/05/01 05:00:00,1.12171,1.12184,1.1216899999999999,1.12184,441,0.750000000000018\n1265,2019/05/01 06:00:00,1.12182,1.122,1.1213799999999998,1.1216,1380,0.5830115830116452\n1266,2019/05/01 07:00:00,1.1215899999999999,1.12296,1.12155,1.12269,1869,0.6072727272727425\n1267,2019/05/01 08:00:00,1.12267,1.12296,1.12225,1.12277,1440,0.6072727272727425\n1268,2019/05/01 09:00:00,1.12276,1.12392,1.12274,1.12341,2190,0.7044198895027852\n1269,2019/05/01 10:00:00,1.12342,1.12385,1.12333,1.1235899999999999,1340,0.7327586206896388\n1270,2019/05/01 11:00:00,1.1235899999999999,1.12368,1.12296,1.12364,1671,0.7122905027933274\n1271,2019/05/01 12:00:00,1.12362,1.12368,1.12214,1.1224100000000001,4959,0.5875576036866466\n1272,2019/05/01 13:00:00,1.1224,1.12285,1.12228,1.12278,3195,0.5866050808314132\n1273,2019/05/01 14:00:00,1.12279,1.12476,1.12279,1.1239700000000001,7069,0.7016666666666739\n1274,2019/05/01 15:00:00,1.12398,1.12495,1.1239700000000001,1.12449,3038,0.7094155844155885\n1275,2019/05/01 16:00:00,1.12447,1.12465,1.12401,1.12415,2256,0.7444633730834674\n1276,2019/05/01 17:00:00,1.1241700000000001,1.12473,1.1241700000000001,1.12458,2326,0.7395833333333329\n1277,2019/05/01 18:00:00,1.12455,1.1264299999999998,1.11937,1.1193799999999998,18973,0.4861337683523562\n1278,2019/05/01 19:00:00,1.1193799999999998,1.1199700000000001,1.11867,1.11947,10510,0.4598765432098709\n1279,2019/05/01 20:00:00,1.1194600000000001,1.11994,1.11901,1.1194600000000001,1607,0.46437149719774673\n1280,2019/05/01 21:05:00,1.11947,1.12017,1.1193600000000001,1.12011,1180,0.431122448979595\n1281,2019/05/01 22:05:00,1.1201,1.1203100000000001,1.12005,1.12017,658,0.43781512605042455\n1282,2019/05/01 23:05:00,1.12017,1.12022,1.11992,1.1202,619,0.38392050587172855\n1283,2019/05/02,1.12015,1.1206,1.1199299999999999,1.12056,1240,0.4043668122270795\n1284,2019/05/02 01:00:00,1.12057,1.12087,1.12045,1.12081,1195,0.4317180616740126\n1285,2019/05/02 02:00:00,1.1208200000000001,1.12083,1.11996,1.12012,1456,0.44464609800364\n1286,2019/05/02 03:00:00,1.12011,1.12079,1.12011,1.12057,1261,0.44464609800364\n1287,2019/05/02 04:00:00,1.12058,1.12087,1.12047,1.12071,1055,0.33405875952123154\n1288,2019/05/02 05:00:00,1.12071,1.1208,1.12037,1.1204100000000001,1104,0.31648351648353645\n1289,2019/05/02 06:00:00,1.1204,1.1207200000000002,1.1191799999999998,1.1192799999999998,3633,0.27988338192420953\n1290,2019/05/02 07:00:00,1.1192600000000001,1.1218700000000001,1.11907,1.1213,6374,0.3443766346992231\n1291,2019/05/02 08:00:00,1.1213,1.12155,1.1205200000000002,1.12079,4413,0.45271629778676936\n1292,2019/05/02 09:00:00,1.1207799999999999,1.12129,1.11998,1.12015,3131,0.46777546777549034\n1293,2019/05/02 10:00:00,1.12014,1.1202299999999998,1.1195700000000002,1.1201299999999998,2833,0.43103448275866096\n1294,2019/05/02 11:00:00,1.12014,1.1209,1.1198,1.12043,5427,0.47526501766787954\n1295,2019/05/02 12:00:00,1.12046,1.12114,1.11952,1.11962,5891,0.4619205298013694\n1296,2019/05/02 13:00:00,1.11961,1.12017,1.11755,1.11849,6383,0.35406091370561593\n1297,2019/05/02 14:00:00,1.1185,1.11877,1.11761,1.11814,6354,0.32133333333336334\n1298,2019/05/02 15:00:00,1.11815,1.1184399999999999,1.11715,1.1184,6956,0.27828348504554745\n1299,2019/05/02 16:00:00,1.11838,1.11838,1.1174,1.11776,4367,0.29722222222225336\n1300,2019/05/02 17:00:00,1.1178299999999999,1.11795,1.11727,1.1178,2911,0.2919508867667443\n1301,2019/05/02 18:00:00,1.1178,1.11806,1.11719,1.11747,2242,0.2916666666666928\n1302,2019/05/02 19:00:00,1.11748,1.11774,1.11721,1.11721,2183,0.29564032697550274\n1303,2019/05/02 20:00:00,1.11722,1.1173600000000001,1.11703,1.11714,867,0.34281200631915415\n1304,2019/05/02 21:05:00,1.11724,1.11732,1.11714,1.11731,396,0.20118343195270547\n1305,2019/05/02 22:05:00,1.11732,1.11752,1.1172600000000001,1.11751,872,0.23149905123343378\n1306,2019/05/02 23:05:00,1.1174899999999999,1.11751,1.11725,1.1172600000000001,679,0.2573839662447742\n1307,2019/05/03,1.11723,1.11771,1.11701,1.1177,967,0.29769392033546127\n1308,2019/05/03 01:00:00,1.1177,1.1177,1.11701,1.11745,1416,0.18292682926829995\n1309,2019/05/03 02:00:00,1.11745,1.11771,1.1173,1.11741,1307,0.14484679665739453\n1310,2019/05/03 03:00:00,1.11741,1.11756,1.11724,1.1173,900,0.3095238095238316\n1311,2019/05/03 04:00:00,1.11731,1.11745,1.11666,1.11681,997,0.23008849557523953\n1312,2019/05/03 05:00:00,1.1168200000000001,1.11729,1.1167799999999999,1.1171,1179,0.28888888888889164\n1313,2019/05/03 06:00:00,1.1171,1.11714,1.11598,1.11611,3539,0.2000000000000171\n1314,2019/05/03 07:00:00,1.11609,1.11689,1.1157700000000002,1.11676,5631,0.1940298507462959\n1315,2019/05/03 08:00:00,1.11675,1.11677,1.11606,1.11648,3442,0.1646586345381691\n1316,2019/05/03 09:00:00,1.1165100000000001,1.11659,1.11534,1.11538,3358,0.12772585669782857\n1317,2019/05/03 10:00:00,1.1153600000000001,1.11594,1.11516,1.11523,2954,0.12772585669782857\n1318,2019/05/03 11:00:00,1.11521,1.11529,1.11437,1.1151799999999998,3030,0.10250000000001099\n1319,2019/05/03 12:00:00,1.11517,1.1164100000000001,1.1134700000000002,1.11596,9925,0.2285223367698093\n1320,2019/05/03 13:00:00,1.11596,1.11716,1.1153899999999999,1.11716,8132,0.3170731707317354\n1321,2019/05/03 14:00:00,1.1171799999999998,1.11941,1.11704,1.11868,10039,0.4934289127837879\n1322,2019/05/03 15:00:00,1.1187,1.11994,1.1183,1.11875,9251,0.5235955056180082\n1323,2019/05/03 16:00:00,1.11876,1.1200299999999999,1.11835,1.11953,4420,0.5278396436525843\n1324,2019/05/03 17:00:00,1.11954,1.11971,1.1192,1.11923,2653,0.5313901345291684\n1325,2019/05/03 18:00:00,1.11922,1.11999,1.11896,1.11933,2806,0.5665914221219216\n1326,2019/05/03 19:00:00,1.11934,1.12017,1.11916,1.11991,2739,0.5752212389380816\n1327,2019/05/03 20:00:00,1.11992,1.12043,1.11978,1.12034,903,0.6423529411764934\n1328,2019/05/05 21:05:00,1.11776,1.11876,1.11706,1.11846,1946,0.495912806539513\n1329,2019/05/05 22:05:00,1.11843,1.12,1.11829,1.11961,2532,0.5469387755102121\n1330,2019/05/05 23:05:00,1.1196,1.11982,1.11809,1.11843,2256,0.5711849957374374\n1331,2019/05/06,1.11848,1.11876,1.11802,1.11849,3355,0.5765920826161938\n1332,2019/05/06 01:00:00,1.11849,1.11942,1.11829,1.11915,2927,0.640557006092264\n1333,2019/05/06 02:00:00,1.11915,1.11916,1.11846,1.1189,1839,0.6589229144667333\n1334,2019/05/06 03:00:00,1.11889,1.11933,1.1187,1.11932,1774,0.6366704161979795\n1335,2019/05/06 04:00:00,1.11932,1.11954,1.11903,1.11906,1460,0.5284671532846786\n1336,2019/05/06 05:00:00,1.11906,1.1192799999999998,1.11856,1.1191,1528,0.4550810014727724\n1337,2019/05/06 06:00:00,1.1191,1.11944,1.11868,1.1189,2809,0.4606413994169461\n1338,2019/05/06 07:00:00,1.11885,1.11934,1.11834,1.1187,5309,0.43888888888892486\n1339,2019/05/06 08:00:00,1.11871,1.11921,1.11827,1.11835,2620,0.4266666666667154\n1340,2019/05/06 09:00:00,1.11836,1.1195,1.11827,1.11932,3100,0.4358600583090717\n1341,2019/05/06 10:00:00,1.11931,1.11981,1.11887,1.11973,3232,0.4399421128799263\n1342,2019/05/06 11:00:00,1.11972,1.12032,1.11958,1.11975,3103,0.7553191489362285\n1343,2019/05/06 12:00:00,1.11979,1.1203,1.1178700000000001,1.11828,4599,0.44680851063835636\n1344,2019/05/06 13:00:00,1.11829,1.1192799999999998,1.11802,1.11911,4481,0.4647887323944253\n1345,2019/05/06 14:00:00,1.11909,1.11964,1.11842,1.11962,4755,0.5076045627377135\n1346,2019/05/06 15:00:00,1.1195899999999999,1.11978,1.1188799999999999,1.11962,4361,0.45358649789036576\n1347,2019/05/06 16:00:00,1.11962,1.1206399999999999,1.11954,1.12025,3224,0.5375000000000486\n1348,2019/05/06 17:00:00,1.12024,1.12089,1.12016,1.12036,2561,0.5440140845070968\n1349,2019/05/06 18:00:00,1.12037,1.1206,1.12004,1.12029,2130,0.5152057245080901\n1350,2019/05/06 19:00:00,1.12028,1.12056,1.12006,1.12008,1743,0.5625000000000406\n1351,2019/05/06 20:00:00,1.1201,1.12017,1.11976,1.11982,1061,0.5171102661597241\n1352,2019/05/06 21:05:00,1.11941,1.11989,1.11903,1.11969,1643,0.4814159292035554\n1353,2019/05/06 22:05:00,1.11968,1.11999,1.11962,1.11999,545,0.4964788732394332\n1354,2019/05/06 23:05:00,1.12,1.12015,1.11995,1.12008,749,0.48468468468468484\n1355,2019/05/07,1.12004,1.12029,1.11973,1.11996,1658,0.4499999999999921\n1356,2019/05/07 01:00:00,1.11995,1.12046,1.1196700000000002,1.12042,1597,0.4097744360902395\n1357,2019/05/07 02:00:00,1.1204100000000001,1.1205100000000001,1.12021,1.12048,1223,0.6092896174863506\n1358,2019/05/07 03:00:00,1.12049,1.12073,1.12032,1.12068,1287,0.6314432989690713\n1359,2019/05/07 04:00:00,1.12069,1.1214,1.12049,1.12131,2907,0.6587112171837539\n1360,2019/05/07 05:00:00,1.12131,1.12158,1.1208,1.1213600000000001,1900,0.6619385342789462\n1361,2019/05/07 06:00:00,1.1213600000000001,1.12174,1.12057,1.12085,5764,0.5585106382978721\n1362,2019/05/07 07:00:00,1.12087,1.1216,1.11937,1.11952,6678,0.39278131634817626\n1363,2019/05/07 08:00:00,1.11951,1.12011,1.11927,1.11961,3991,0.39445628997866994\n1364,2019/05/07 09:00:00,1.1196,1.1204,1.11935,1.12038,3246,0.42971887550201554\n1365,2019/05/07 10:00:00,1.12035,1.1206,1.11958,1.1197,3249,0.47950819672131373\n1366,2019/05/07 11:00:00,1.11972,1.11985,1.11768,1.11824,4089,0.3867768595041408\n1367,2019/05/07 12:00:00,1.11824,1.11909,1.11815,1.1183299999999998,3940,0.37647058823530377\n1368,2019/05/07 13:00:00,1.11836,1.11866,1.11745,1.11855,5028,0.32049306625579643\n1369,2019/05/07 14:00:00,1.1185399999999999,1.11925,1.11811,1.11875,5707,0.3764880952381257\n1370,2019/05/07 15:00:00,1.11877,1.1190799999999999,1.1177,1.11775,5195,0.34202898550726024\n1371,2019/05/07 16:00:00,1.11774,1.11786,1.1166200000000002,1.11745,4020,0.29129886506936964\n1372,2019/05/07 17:00:00,1.11744,1.11792,1.117,1.1178,4035,0.27670527670529504\n1373,2019/05/07 18:00:00,1.11778,1.1192600000000001,1.11717,1.11819,3960,0.33412322274884665\n1374,2019/05/07 19:00:00,1.1182,1.1191799999999998,1.11798,1.1186200000000002,3435,0.31961259079905796\n1375,2019/05/07 20:00:00,1.11861,1.11929,1.11848,1.11896,1310,0.3245614035088073\n1376,2019/05/07 21:05:00,1.11897,1.11947,1.1188200000000001,1.11929,1213,0.3979885057471771\n1377,2019/05/07 22:05:00,1.11933,1.11934,1.1191,1.1192,830,0.40379008746360756\n1378,2019/05/07 23:05:00,1.11921,1.1192600000000001,1.11885,1.11891,680,0.3636363636363992\n1379,2019/05/08,1.11884,1.11922,1.1188200000000001,1.11921,1538,0.3428571428571944\n1380,2019/05/08 01:00:00,1.11921,1.1199700000000001,1.11921,1.11979,2034,0.5509090909091635\n1381,2019/05/08 02:00:00,1.11979,1.12034,1.11942,1.12001,3186,0.5792163543441742\n1382,2019/05/08 03:00:00,1.12,1.12055,1.11982,1.12034,2009,0.6710037174721751\n1383,2019/05/08 04:00:00,1.1203299999999998,1.12063,1.12029,1.12048,1486,0.6365503080082728\n1384,2019/05/08 05:00:00,1.12047,1.12061,1.12012,1.12039,1253,0.6695464362851642\n1385,2019/05/08 06:00:00,1.12038,1.12124,1.12038,1.12066,4986,0.8923444976076901\n1386,2019/05/08 07:00:00,1.12065,1.12096,1.11961,1.12046,5599,0.7505112474438002\n1387,2019/05/08 08:00:00,1.12047,1.12107,1.11964,1.1197700000000002,5363,0.6666666666667072\n1388,2019/05/08 09:00:00,1.11978,1.12057,1.1193799999999998,1.12024,3996,0.6224489795918482\n1389,2019/05/08 10:00:00,1.1202299999999998,1.12043,1.1191,1.1203299999999998,5794,0.5696821515892692\n1390,2019/05/08 11:00:00,1.12035,1.1207200000000002,1.11981,1.12024,5164,0.5809523809524137\n1391,2019/05/08 12:00:00,1.12026,1.12039,1.1188799999999999,1.11982,7154,0.47563352826512006\n1392,2019/05/08 13:00:00,1.1198,1.1205,1.1195700000000002,1.1198700000000001,6895,0.5110220440882045\n1393,2019/05/08 14:00:00,1.11988,1.12061,1.11931,1.12029,6794,0.499061913696054\n1394,2019/05/08 15:00:00,1.1203299999999998,1.12133,1.11989,1.1205200000000002,8263,0.496226415094315\n1395,2019/05/08 16:00:00,1.1205200000000002,1.12093,1.11826,1.1188200000000001,4670,0.3445121951219562\n1396,2019/05/08 17:00:00,1.1188200000000001,1.1191200000000001,1.11824,1.11894,3640,0.32182103610674545\n1397,2019/05/08 18:00:00,1.1189799999999999,1.11937,1.1185,1.11911,2464,0.33944954128437566\n1398,2019/05/08 19:00:00,1.11914,1.1194899999999999,1.11903,1.11933,2510,0.3605546995377116\n1399,2019/05/08 20:00:00,1.11934,1.11934,1.1188799999999999,1.1191200000000001,981,0.2845257903493835\n1400,2019/05/08 21:05:00,1.1190200000000001,1.1194600000000001,1.1189799999999999,1.11942,1368,0.3414179104477306\n1401,2019/05/08 22:05:00,1.11941,1.11976,1.11941,1.11962,768,0.36396396396392244\n1402,2019/05/08 23:05:00,1.11963,1.11981,1.1195,1.11975,1002,0.38764044943815484\n1403,2019/05/09,1.1197,1.11975,1.11906,1.11911,3654,0.37636363636357967\n1404,2019/05/09 01:00:00,1.1191200000000001,1.11952,1.1188799999999999,1.11903,2509,0.3302411873839695\n1405,2019/05/09 02:00:00,1.11903,1.11905,1.11856,1.1189200000000001,2205,0.37238493723842436\n1406,2019/05/09 03:00:00,1.11893,1.1192,1.1187200000000002,1.11906,1617,0.37759336099575835\n1407,2019/05/09 04:00:00,1.11905,1.1194600000000001,1.11897,1.11944,1302,0.41825902335449666\n1408,2019/05/09 05:00:00,1.11944,1.11973,1.11923,1.11963,1884,0.3568075117370013\n1409,2019/05/09 06:00:00,1.11962,1.12026,1.1194,1.11973,3840,0.6487341772151183\n1410,2019/05/09 07:00:00,1.11973,1.1203,1.11828,1.11863,6856,0.48604651162786644\n1411,2019/05/09 08:00:00,1.1186200000000002,1.1189200000000001,1.11731,1.11883,7705,0.3665338645418155\n1412,2019/05/09 09:00:00,1.11884,1.11973,1.1185399999999999,1.1195899999999999,4658,0.44308231173377405\n1413,2019/05/09 10:00:00,1.11958,1.1196,1.11853,1.11907,4300,0.4542190305206405\n1414,2019/05/09 11:00:00,1.1190799999999999,1.1192,1.11842,1.11893,3906,0.43345323741004743\n1415,2019/05/09 12:00:00,1.11894,1.12002,1.11868,1.11966,5245,0.48190789473683143\n1416,2019/05/09 13:00:00,1.11966,1.12421,1.1191,1.12348,8194,0.6917808219178148\n1417,2019/05/09 14:00:00,1.1234600000000001,1.12505,1.1223,1.1229799999999999,11796,0.7448210922787324\n1418,2019/05/09 15:00:00,1.123,1.12351,1.1225399999999999,1.12274,6048,0.7576628352490608\n1419,2019/05/09 16:00:00,1.12275,1.12311,1.12116,1.1215,6817,0.6878260869565324\n1420,2019/05/09 17:00:00,1.12154,1.12258,1.12129,1.12247,5233,0.6837004405286485\n1421,2019/05/09 18:00:00,1.12248,1.1228,1.12201,1.1224,3886,0.682581786030075\n1422,2019/05/09 19:00:00,1.12239,1.12257,1.1217700000000002,1.12188,2239,0.6604609929078328\n1423,2019/05/09 20:00:00,1.12184,1.12209,1.12096,1.12137,1618,0.5986159169550312\n1424,2019/05/09 21:05:00,1.1214600000000001,1.12196,1.12134,1.12192,1786,0.6615384615384776\n1425,2019/05/09 22:05:00,1.12192,1.122,1.12175,1.12191,953,0.7307286166842802\n1426,2019/05/09 23:05:00,1.1219,1.1220299999999999,1.12171,1.12181,1089,0.7033218785796223\n1427,2019/05/10,1.12181,1.1229799999999999,1.12175,1.12289,4938,0.73319544984488\n1428,2019/05/10 01:00:00,1.1228799999999999,1.12344,1.12278,1.12321,2726,0.7534930139720621\n1429,2019/05/10 02:00:00,1.12322,1.12324,1.12263,1.12274,1746,0.7197860962567002\n1430,2019/05/10 03:00:00,1.12273,1.1232,1.12252,1.1229200000000001,2988,0.48197343453513414\n1431,2019/05/10 04:00:00,1.1229200000000001,1.12314,1.1225399999999999,1.1225399999999999,2139,0.3837471783295847\n1432,2019/05/10 05:00:00,1.1225399999999999,1.12287,1.1223,1.12268,1539,0.364025695931506\n1433,2019/05/10 06:00:00,1.12269,1.12289,1.12174,1.1227200000000002,3374,0.44444444444445075\n1434,2019/05/10 07:00:00,1.12271,1.12327,1.12249,1.1225399999999999,4496,0.4941176470588371\n1435,2019/05/10 08:00:00,1.1225399999999999,1.1232,1.1219700000000001,1.12306,4763,0.41318681318682265\n1436,2019/05/10 09:00:00,1.12305,1.12381,1.1230200000000001,1.12319,3259,0.5060975609756048\n1437,2019/05/10 10:00:00,1.1231799999999998,1.12337,1.12227,1.12333,3578,0.512345679012359\n1438,2019/05/10 11:00:00,1.12335,1.12364,1.1224299999999998,1.12294,4114,0.5380116959064465\n1439,2019/05/10 12:00:00,1.12295,1.1246399999999999,1.12266,1.12416,7616,0.6108374384236516\n1440,2019/05/10 13:00:00,1.12419,1.12489,1.12366,1.12449,5976,0.6283891547049754\n1441,2019/05/10 14:00:00,1.1245,1.12532,1.1238700000000001,1.12432,6546,0.5947826086956952\n1442,2019/05/10 15:00:00,1.1243299999999998,1.12465,1.12392,1.12406,5957,0.5595463137996576\n1443,2019/05/10 16:00:00,1.12405,1.1241,1.12327,1.12362,3722,0.5112262521589108\n1444,2019/05/10 17:00:00,1.12362,1.12362,1.12276,1.12347,4314,0.47819063004848356\n1445,2019/05/10 18:00:00,1.1234600000000001,1.12351,1.12296,1.1231,2342,0.47819063004848356\n1446,2019/05/10 19:00:00,1.1230799999999999,1.1234899999999999,1.12291,1.12316,2677,0.49333333333334517\n1447,2019/05/10 20:00:00,1.12316,1.12388,1.12296,1.1237700000000002,1004,0.5731497418244792\n1448,2019/05/12 21:05:00,1.12344,1.12411,1.12321,1.12366,1849,0.5618374558304211\n1449,2019/05/12 22:05:00,1.12366,1.12371,1.12342,1.12351,971,0.6186770428015745\n1450,2019/05/12 23:05:00,1.12352,1.12385,1.1233899999999999,1.1235600000000001,766,0.5765957446808507\n1451,2019/05/13,1.12342,1.12371,1.12305,1.12311,1182,0.6317016317016624\n1452,2019/05/13 01:00:00,1.1231200000000001,1.12347,1.1231200000000001,1.1234,968,0.6069651741293876\n1453,2019/05/13 02:00:00,1.12341,1.12342,1.12286,1.12319,1365,0.43902439024395035\n1454,2019/05/13 03:00:00,1.1232,1.1233600000000001,1.1229200000000001,1.12294,657,0.39273927392743385\n1455,2019/05/13 04:00:00,1.12294,1.1230200000000001,1.12278,1.12293,649,0.2773722627737155\n1456,2019/05/13 05:00:00,1.12294,1.12301,1.12267,1.12297,886,0.2666666666666771\n1457,2019/05/13 06:00:00,1.12296,1.12362,1.12294,1.1230200000000001,2314,0.48754448398576344\n1458,2019/05/13 07:00:00,1.12301,1.1235899999999999,1.12225,1.12293,4295,0.4581939799331002\n1459,2019/05/13 08:00:00,1.1229200000000001,1.1235700000000002,1.1226200000000002,1.12293,4250,0.4581939799331002\n1460,2019/05/13 09:00:00,1.12294,1.12412,1.1228200000000002,1.12386,3039,0.5501432664755883\n1461,2019/05/13 10:00:00,1.1238299999999999,1.1239299999999999,1.12337,1.12344,2457,0.4935483870966963\n1462,2019/05/13 11:00:00,1.12342,1.12371,1.12278,1.12313,2848,0.3757225433525336\n1463,2019/05/13 12:00:00,1.12314,1.1262,1.1231,1.1257,9846,0.6369747899159228\n1464,2019/05/13 13:00:00,1.1256899999999999,1.1263100000000001,1.12495,1.12544,8695,0.6383701188454797\n1465,2019/05/13 14:00:00,1.12543,1.1258299999999999,1.1241,1.12421,7044,0.5874999999999809\n1466,2019/05/13 15:00:00,1.1242299999999998,1.1244,1.12274,1.12316,5220,0.48453608247421176\n1467,2019/05/13 16:00:00,1.12314,1.12379,1.12289,1.1234899999999999,2920,0.5013333333333272\n1468,2019/05/13 17:00:00,1.1234899999999999,1.12379,1.12305,1.12321,3024,0.5013333333333272\n1469,2019/05/13 18:00:00,1.12322,1.12348,1.12284,1.12313,3872,0.4966974900924779\n1470,2019/05/13 19:00:00,1.1231200000000001,1.12345,1.12297,1.12303,2401,0.5040214477211762\n1471,2019/05/13 20:00:00,1.12303,1.12304,1.12209,1.1221,1020,0.4075032341526494\n1472,2019/05/13 21:05:00,1.12209,1.1226,1.12201,1.1224299999999998,1154,0.4424157303370758\n1473,2019/05/13 22:05:00,1.12242,1.12315,1.12226,1.12307,1495,0.4823989569752288\n1474,2019/05/13 23:05:00,1.1230799999999999,1.12319,1.12279,1.12317,844,0.44553072625698337\n1475,2019/05/14,1.1231799999999998,1.12363,1.1231200000000001,1.1235899999999999,1893,0.477631578947368\n1476,2019/05/14 01:00:00,1.12361,1.12363,1.1230799999999999,1.12323,1996,0.5148936170212635\n1477,2019/05/14 02:00:00,1.12322,1.12352,1.1230200000000001,1.12323,1390,0.24675324675323737\n1478,2019/05/14 03:00:00,1.12323,1.1240299999999999,1.12323,1.1239,1489,0.30677290836649035\n1479,2019/05/14 04:00:00,1.12389,1.12405,1.12381,1.1239299999999999,1067,0.3723150357994785\n1480,2019/05/14 05:00:00,1.12392,1.1240700000000001,1.1237,1.12374,1279,0.5337837837837417\n1481,2019/05/14 06:00:00,1.12373,1.12412,1.1231799999999998,1.12323,3230,0.46175637393761554\n1482,2019/05/14 07:00:00,1.12329,1.12419,1.12289,1.12379,4459,0.4370179948585694\n1483,2019/05/14 08:00:00,1.12379,1.12436,1.12363,1.12419,3115,0.48571428571424946\n1484,2019/05/14 09:00:00,1.12418,1.12429,1.1233899999999999,1.12364,3150,0.4572127139363935\n1485,2019/05/14 10:00:00,1.12363,1.12371,1.12248,1.12289,3249,0.45388349514559734\n1486,2019/05/14 11:00:00,1.1228799999999999,1.1238,1.12283,1.12303,3105,0.474576271186407\n1487,2019/05/14 12:00:00,1.12304,1.12324,1.12035,1.12135,7130,0.2326732673266917\n1488,2019/05/14 13:00:00,1.12134,1.12194,1.12076,1.1211,5753,0.22757475083054665\n1489,2019/05/14 14:00:00,1.12109,1.12142,1.12043,1.1211,5361,0.15736040609135318\n1490,2019/05/14 15:00:00,1.1211200000000001,1.12131,1.12036,1.12066,4441,0.1565656565656458\n1491,2019/05/14 16:00:00,1.12067,1.12144,1.12061,1.12094,2449,0.17637271214640027\n1492,2019/05/14 17:00:00,1.12095,1.1213899999999999,1.12073,1.12111,1988,0.10000000000000808\n1493,2019/05/14 18:00:00,1.1210799999999999,1.12164,1.12061,1.12061,2028,0.13333333333333586\n1494,2019/05/14 19:00:00,1.1206399999999999,1.12093,1.12063,1.1207200000000002,1371,0.13286713286711685\n1495,2019/05/14 20:00:00,1.1207,1.1208200000000001,1.12008,1.1203100000000001,918,0.12456140350877391\n1496,2019/05/14 21:05:00,1.12029,1.12084,1.12029,1.1207200000000002,1604,0.12313432835819149\n1497,2019/05/14 22:05:00,1.12073,1.1207799999999999,1.12061,1.1206399999999999,421,0.09441233140653137\n1498,2019/05/14 23:05:00,1.12065,1.12071,1.12022,1.12029,694,0.0917602996254473\n1499,2019/05/15,1.12035,1.12037,1.12004,1.1203100000000001,1324,0.10629067245116683\n1500,2019/05/15 01:00:00,1.1203299999999998,1.1207799999999999,1.1202299999999998,1.12058,1470,0.164300202839711\n1501,2019/05/15 02:00:00,1.12057,1.12066,1.12026,1.12065,1480,0.33061224489788077\n1502,2019/05/15 03:00:00,1.12066,1.12084,1.1205200000000002,1.12081,721,0.3764258555132541\n1503,2019/05/15 04:00:00,1.12081,1.12093,1.12049,1.1209200000000001,702,0.44628099173541663\n1504,2019/05/15 05:00:00,1.12091,1.12133,1.1208200000000001,1.1211200000000001,909,0.5381818181817046\n1505,2019/05/15 06:00:00,1.12111,1.12116,1.1204100000000001,1.12067,2423,0.44554455445534685\n1506,2019/05/15 07:00:00,1.12066,1.12131,1.11978,1.12127,5668,0.39370078740149905\n1507,2019/05/15 08:00:00,1.12125,1.12165,1.12109,1.1213899999999999,3471,0.42063492063481905\n1508,2019/05/15 09:00:00,1.1214,1.1214,1.11989,1.11994,3900,0.3192771084336732\n1509,2019/05/15 10:00:00,1.11995,1.12042,1.11945,1.11953,3929,0.3264887063654433\n1510,2019/05/15 11:00:00,1.11954,1.1195899999999999,1.11776,1.11804,4453,0.24006116207947986\n1511,2019/05/15 12:00:00,1.11804,1.11922,1.1178299999999999,1.1183299999999998,6494,0.24006116207947986\n1512,2019/05/15 13:00:00,1.11832,1.1191,1.11788,1.1185399999999999,6320,0.2552845528454998\n1513,2019/05/15 14:00:00,1.11853,1.1224100000000001,1.11819,1.12079,10470,0.5258620689655067\n1514,2019/05/15 15:00:00,1.12075,1.12089,1.11991,1.12071,5515,0.5039458850056376\n1515,2019/05/15 16:00:00,1.1207,1.1211,1.1201299999999998,1.12059,3311,0.5154185022026456\n1516,2019/05/15 17:00:00,1.1206,1.12079,1.12026,1.12071,1965,0.5056179775280891\n1517,2019/05/15 18:00:00,1.1207,1.12071,1.12017,1.1203100000000001,1882,0.4971815107102784\n1518,2019/05/15 19:00:00,1.1203,1.12035,1.11969,1.12024,1374,0.44804469273745096\n1519,2019/05/15 20:00:00,1.12029,1.1203299999999998,1.11992,1.12005,942,0.469555035128828\n1520,2019/05/15 21:05:00,1.1201299999999998,1.12063,1.11875,1.12057,1030,0.4507042253521401\n1521,2019/05/15 22:05:00,1.12057,1.12089,1.12029,1.12061,953,0.4459016393442853\n1522,2019/05/15 23:05:00,1.12061,1.12083,1.1204100000000001,1.12066,767,0.5132075471698275\n1523,2019/05/16,1.12067,1.12084,1.12045,1.12061,841,0.5438829787234235\n1524,2019/05/16 01:00:00,1.12061,1.12094,1.12014,1.12079,2654,0.6714743589743665\n1525,2019/05/16 02:00:00,1.1207799999999999,1.12094,1.1205399999999999,1.12076,1410,0.6714743589743665\n1526,2019/05/16 03:00:00,1.12077,1.12087,1.12066,1.1208200000000001,878,0.6714743589743665\n1527,2019/05/16 04:00:00,1.12083,1.12095,1.12077,1.12093,648,0.3189368770764169\n1528,2019/05/16 05:00:00,1.12094,1.121,1.12071,1.12091,902,0.3237179487179813\n1529,2019/05/16 06:00:00,1.12089,1.12105,1.12043,1.12068,2010,0.262345679012391\n1530,2019/05/16 07:00:00,1.12067,1.12119,1.12037,1.12083,3641,0.28779069767442295\n1531,2019/05/16 08:00:00,1.12085,1.1220700000000001,1.1206,1.12201,3409,0.44208037825061075\n1532,2019/05/16 09:00:00,1.12201,1.12237,1.12076,1.12111,3287,0.5358024691358148\n1533,2019/05/16 10:00:00,1.1211,1.12119,1.12048,1.1205399999999999,2714,0.5011547344110929\n1534,2019/05/16 11:00:00,1.12056,1.12093,1.11973,1.1204,3531,0.5180055401661994\n1535,2019/05/16 12:00:00,1.1204100000000001,1.12061,1.11868,1.11873,5991,0.3659090909091011\n1536,2019/05/16 13:00:00,1.1187200000000002,1.11922,1.11827,1.11859,5526,0.33471933471935916\n1537,2019/05/16 14:00:00,1.11858,1.11868,1.11716,1.11775,6487,0.2707275803722544\n1538,2019/05/16 15:00:00,1.11776,1.11801,1.11723,1.11774,3774,0.2727272727272801\n1539,2019/05/16 16:00:00,1.11773,1.11815,1.11752,1.11768,2427,0.29078014184398226\n1540,2019/05/16 17:00:00,1.1176700000000002,1.11795,1.11744,1.11788,1970,0.2867132867132932\n1541,2019/05/16 18:00:00,1.11789,1.11794,1.11697,1.11699,1984,0.25531914893619573\n1542,2019/05/16 19:00:00,1.11697,1.11768,1.11659,1.11766,2256,0.23667711598746982\n1543,2019/05/16 20:00:00,1.11765,1.11766,1.1172,1.11734,651,0.24132231404958512\n1544,2019/05/16 21:05:00,1.1174,1.11755,1.11715,1.1174899999999999,884,0.22372881355934857\n1545,2019/05/16 22:05:00,1.1174899999999999,1.11754,1.1171200000000001,1.1173899999999999,797,0.08712871287128635\n1546,2019/05/16 23:05:00,1.1173899999999999,1.11747,1.11721,1.11727,577,0.029473684210532217\n1547,2019/05/17,1.11731,1.1175700000000002,1.11701,1.11747,1272,0.05031446540885363\n1548,2019/05/17 01:00:00,1.11745,1.11788,1.11744,1.11785,1442,0.1270207852194128\n1549,2019/05/17 02:00:00,1.11786,1.11789,1.11752,1.11773,1444,0.17021276595748128\n1550,2019/05/17 03:00:00,1.11774,1.11792,1.1175700000000002,1.1177,1479,0.20274914089348858\n1551,2019/05/17 04:00:00,1.11769,1.11789,1.11756,1.11789,1201,0.32596685082876314\n1552,2019/05/17 05:00:00,1.11789,1.11796,1.11701,1.11729,1391,0.27160493827163085\n1553,2019/05/17 06:00:00,1.11729,1.11824,1.11714,1.1180299999999999,3523,0.3112840466925774\n1554,2019/05/17 07:00:00,1.11802,1.11836,1.11743,1.11768,4284,0.3524904214559507\n1555,2019/05/17 08:00:00,1.11769,1.1178299999999999,1.11684,1.1173600000000001,3371,0.3369963369963611\n1556,2019/05/17 09:00:00,1.1173600000000001,1.11763,1.1158,1.1163100000000001,4706,0.2713864306784752\n1557,2019/05/17 10:00:00,1.1163,1.11719,1.11628,1.11671,3931,0.2713864306784752\n1558,2019/05/17 11:00:00,1.1167200000000002,1.11684,1.1158299999999999,1.11663,4236,0.24274406332453502\n1559,2019/05/17 12:00:00,1.1166399999999999,1.1178700000000001,1.11657,1.1176,5558,0.4070981210855947\n1560,2019/05/17 13:00:00,1.1175700000000002,1.11771,1.11714,1.11731,5147,0.4070981210855947\n1561,2019/05/17 14:00:00,1.1173,1.1173899999999999,1.1155,1.11594,7104,0.3017944535073164\n1562,2019/05/17 15:00:00,1.1159299999999999,1.11661,1.11574,1.11647,4213,0.2646048109965629\n1563,2019/05/17 16:00:00,1.11648,1.1168799999999999,1.1163,1.11639,2170,0.2960526315789106\n1564,2019/05/17 17:00:00,1.11638,1.11665,1.1160700000000001,1.11643,2639,0.2818471337579314\n1565,2019/05/17 18:00:00,1.11642,1.11643,1.1158700000000001,1.1158700000000001,1425,0.2735703245749357\n1566,2019/05/17 19:00:00,1.1158700000000001,1.1166399999999999,1.1158700000000001,1.11601,3775,0.31518151815176876\n1567,2019/05/17 20:00:00,1.1159999999999999,1.1160700000000001,1.1154899999999999,1.1157700000000002,975,0.26461038961034977\n1568,2019/05/19 21:05:00,1.1159299999999999,1.1166200000000002,1.1159299999999999,1.1164,929,0.3125948406676326\n1569,2019/05/19 22:05:00,1.11639,1.1166200000000002,1.11619,1.11622,625,0.3433333333332751\n1570,2019/05/19 23:05:00,1.11624,1.11646,1.11618,1.1164399999999999,937,0.4144869215291087\n1571,2019/05/20,1.1164,1.1165,1.1158700000000001,1.11636,1840,0.39473684210522036\n1572,2019/05/20 01:00:00,1.11637,1.1167200000000002,1.11606,1.11618,1925,0.4557956777995796\n1573,2019/05/20 02:00:00,1.11619,1.1162100000000001,1.11569,1.11584,1608,0.29119638826180827\n1574,2019/05/20 03:00:00,1.11585,1.11585,1.11527,1.11534,1350,0.2659793814432548\n1575,2019/05/20 04:00:00,1.1153600000000001,1.11552,1.1152600000000001,1.11534,925,0.4006211180123851\n1576,2019/05/20 05:00:00,1.11534,1.11534,1.11503,1.11525,1023,0.3739130434782055\n1577,2019/05/20 06:00:00,1.11523,1.11558,1.11503,1.11543,2556,0.36842105263156866\n1578,2019/05/20 07:00:00,1.11543,1.1163,1.1153899999999999,1.11626,3650,0.5063938618925676\n1579,2019/05/20 08:00:00,1.11626,1.11659,1.11534,1.11548,4123,0.5604938271604774\n1580,2019/05/20 09:00:00,1.1154700000000002,1.11648,1.1154,1.1157299999999999,3228,0.5364583333333383\n1581,2019/05/20 10:00:00,1.11572,1.1159700000000001,1.1152799999999998,1.1154,3069,0.5754189944134338\n1582,2019/05/20 11:00:00,1.11541,1.11624,1.11529,1.1159700000000001,2176,0.53939393939393\n1583,2019/05/20 12:00:00,1.1159999999999999,1.11669,1.11596,1.1163299999999998,3929,0.5946666666666672\n1584,2019/05/20 13:00:00,1.1163100000000001,1.11687,1.11561,1.11653,5081,0.5644028103044556\n1585,2019/05/20 14:00:00,1.1165399999999999,1.11683,1.11625,1.1165,3727,0.6045918367346672\n1586,2019/05/20 15:00:00,1.1165100000000001,1.11744,1.11637,1.1169200000000001,3627,0.6403712296983413\n1587,2019/05/20 16:00:00,1.1169200000000001,1.1169799999999999,1.1164,1.1167799999999999,2033,0.7005076142131562\n1588,2019/05/20 17:00:00,1.11677,1.11699,1.1165100000000001,1.11668,1652,0.7847025495750461\n1589,2019/05/20 18:00:00,1.1167,1.11689,1.11647,1.1167,1369,0.7780898876403821\n1590,2019/05/20 19:00:00,1.11669,1.11679,1.11647,1.11647,1305,0.8318318318317998\n1591,2019/05/20 20:00:00,1.11646,1.1166200000000002,1.11639,1.1165100000000001,600,0.7981072555204504\n1592,2019/05/20 21:05:00,1.11661,1.11691,1.11659,1.11683,1624,0.766423357664159\n1593,2019/05/20 22:05:00,1.11684,1.11694,1.11673,1.1168,303,0.7572016460904218\n1594,2019/05/20 23:05:00,1.11681,1.1171799999999998,1.11668,1.11669,1176,0.7647058823527924\n1595,2019/05/21,1.11668,1.11674,1.1164100000000001,1.11643,984,0.7247386759581361\n1596,2019/05/21 01:00:00,1.11643,1.1166200000000002,1.11625,1.1166200000000002,1567,0.6557971014492046\n1597,2019/05/21 02:00:00,1.1166200000000002,1.11666,1.1163100000000001,1.11643,963,0.5957446808509412\n1598,2019/05/21 03:00:00,1.11642,1.1166200000000002,1.11625,1.1163,1457,0.6489361702125699\n1599,2019/05/21 04:00:00,1.1163100000000001,1.1163100000000001,1.11596,1.1159700000000001,686,0.5622119815666713\n1600,2019/05/21 05:00:00,1.11596,1.11596,1.11516,1.11521,1334,0.25847457627100706\n1601,2019/05/21 06:00:00,1.11521,1.1153899999999999,1.11439,1.11487,3029,0.19488817891360496\n1602,2019/05/21 07:00:00,1.11486,1.11575,1.1146200000000002,1.11552,3782,0.27586206896541604\n1603,2019/05/21 08:00:00,1.11554,1.11555,1.11416,1.11468,3160,0.2461538461537498\n1604,2019/05/21 09:00:00,1.11467,1.11581,1.11466,1.11503,3122,0.29326923076912786\n1605,2019/05/21 10:00:00,1.11501,1.11554,1.11436,1.11455,3236,0.2785388127852974\n1606,2019/05/21 11:00:00,1.1145399999999999,1.1148200000000001,1.11438,1.11459,3181,0.22738386308060388\n1607,2019/05/21 12:00:00,1.11457,1.11609,1.11457,1.11571,4774,0.407129455909874\n1608,2019/05/21 13:00:00,1.11572,1.1158299999999999,1.11487,1.11499,4182,0.38293650793646644\n1609,2019/05/21 14:00:00,1.11499,1.11875,1.1149,1.11796,7940,0.6306892067619864\n1610,2019/05/21 15:00:00,1.11799,1.11837,1.11569,1.11578,8191,0.6440903054448572\n1611,2019/05/21 16:00:00,1.11574,1.11624,1.1157299999999999,1.1159700000000001,1831,0.6421895861147985\n1612,2019/05/21 17:00:00,1.11599,1.11624,1.11581,1.11598,1472,0.6473755047106259\n1613,2019/05/21 18:00:00,1.1159700000000001,1.11599,1.11537,1.11568,1880,0.6345646437994579\n1614,2019/05/21 19:00:00,1.11569,1.11615,1.11569,1.1161299999999998,1259,0.7161383285302533\n1615,2019/05/21 20:00:00,1.11611,1.1165,1.11591,1.11591,858,0.8159509202453873\n1616,2019/05/21 21:05:00,1.11596,1.11643,1.11586,1.11629,1516,0.798711755233493\n1617,2019/05/21 22:05:00,1.1163,1.11647,1.11624,1.11638,765,0.8635578583765317\n1618,2019/05/21 23:05:00,1.11639,1.11655,1.1163299999999998,1.1164100000000001,535,0.8591800356506429\n1619,2019/05/22,1.11637,1.11658,1.11605,1.1160700000000001,1118,0.8629893238434552\n1620,2019/05/22 01:00:00,1.1160700000000001,1.1165200000000002,1.1160700000000001,1.11645,1128,0.8629893238434552\n1621,2019/05/22 02:00:00,1.1164399999999999,1.11655,1.11594,1.11602,1027,0.8004434589800473\n1622,2019/05/22 03:00:00,1.1160299999999999,1.1163,1.11599,1.11617,720,0.8004434589800473\n1623,2019/05/22 04:00:00,1.11615,1.11618,1.11532,1.11553,917,0.3053097345131826\n1624,2019/05/22 05:00:00,1.11552,1.11566,1.11521,1.11521,1215,0.2911392405062319\n1625,2019/05/22 06:00:00,1.1152,1.1158,1.11503,1.11529,2600,0.3085501858734657\n1626,2019/05/22 07:00:00,1.11527,1.11556,1.11485,1.11522,3577,0.2891986062716347\n1627,2019/05/22 08:00:00,1.11521,1.11635,1.115,1.1159299999999999,3680,0.5031055900619948\n1628,2019/05/22 09:00:00,1.11594,1.11725,1.11578,1.11675,2761,0.5959595959595354\n1629,2019/05/22 10:00:00,1.11674,1.1173600000000001,1.1167,1.1168799999999999,2166,0.5698924731182097\n1630,2019/05/22 11:00:00,1.11689,1.11701,1.11642,1.1166200000000002,2529,0.5367088607593999\n1631,2019/05/22 12:00:00,1.11663,1.11801,1.11648,1.11668,3948,0.6272912423624446\n1632,2019/05/22 13:00:00,1.11668,1.1168799999999999,1.11575,1.11624,3638,0.5395683453236839\n1633,2019/05/22 14:00:00,1.11626,1.11681,1.11524,1.1153600000000001,4948,0.5156249999999295\n1634,2019/05/22 15:00:00,1.11541,1.1160299999999999,1.11509,1.11563,4270,0.5025380710659126\n1635,2019/05/22 16:00:00,1.11564,1.1159700000000001,1.11533,1.11569,1995,0.5113043478260453\n1636,2019/05/22 17:00:00,1.11568,1.1163,1.11545,1.11609,1715,0.5378289473683775\n1637,2019/05/22 18:00:00,1.11611,1.11635,1.11566,1.11595,2377,0.6080586080585473\n1638,2019/05/22 19:00:00,1.11594,1.11595,1.1152799999999998,1.11533,1616,0.5794066317625721\n1639,2019/05/22 20:00:00,1.11533,1.11545,1.1149799999999999,1.11504,811,0.5569176882661437\n1640,2019/05/22 21:05:00,1.11505,1.1154600000000001,1.11505,1.1154600000000001,1042,0.5758122743681853\n1641,2019/05/22 22:05:00,1.11545,1.11569,1.11527,1.1155899999999999,764,0.528112449799157\n1642,2019/05/22 23:05:00,1.1156,1.1156700000000002,1.11542,1.1154899999999999,738,0.42401960784307646\n1643,2019/05/23,1.11545,1.11545,1.11513,1.11523,914,0.38028169014076874\n1644,2019/05/23 01:00:00,1.11524,1.11534,1.1147799999999999,1.11515,1285,0.37413394919160975\n1645,2019/05/23 02:00:00,1.11513,1.1152600000000001,1.11476,1.11513,1403,0.18507462686561443\n1646,2019/05/23 03:00:00,1.11514,1.11523,1.1148200000000001,1.11499,1093,0.2366412213739597\n1647,2019/05/23 04:00:00,1.1149799999999999,1.11499,1.1147799999999999,1.1148799999999999,685,0.2883720930231103\n1648,2019/05/23 05:00:00,1.11487,1.11499,1.11463,1.11493,887,0.28837209302314004\n1649,2019/05/23 06:00:00,1.11493,1.11519,1.11388,1.11419,3248,0.2645161290321726\n1650,2019/05/23 07:00:00,1.1142,1.1147799999999999,1.11327,1.11402,6459,0.14497041420113133\n1651,2019/05/23 08:00:00,1.1140299999999999,1.11453,1.11301,1.11394,4845,0.12256267409469185\n1652,2019/05/23 09:00:00,1.1139299999999999,1.11394,1.11289,1.11345,3559,0.1321321321321199\n1653,2019/05/23 10:00:00,1.11348,1.11376,1.1131799999999998,1.1135,2738,0.14521452145212901\n1654,2019/05/23 11:00:00,1.11352,1.1138700000000001,1.11321,1.1138299999999999,2866,0.17252396166132053\n1655,2019/05/23 12:00:00,1.11385,1.1143399999999999,1.11341,1.11352,3494,0.23145400593464655\n1656,2019/05/23 13:00:00,1.1135,1.11366,1.11068,1.1132600000000001,9010,0.12786885245897595\n1657,2019/05/23 14:00:00,1.1132799999999998,1.11564,1.1132600000000001,1.11484,8793,0.35430038510907114\n1658,2019/05/23 15:00:00,1.11486,1.11723,1.11473,1.11706,6638,0.4817275747507966\n1659,2019/05/23 16:00:00,1.11707,1.1183100000000001,1.11691,1.11818,4228,0.5381565906838197\n1660,2019/05/23 17:00:00,1.11817,1.11871,1.11755,1.11771,3208,0.5557673975214222\n1661,2019/05/23 18:00:00,1.11773,1.1185,1.11763,1.11821,2185,0.5578947368420922\n1662,2019/05/23 19:00:00,1.1182299999999998,1.1183100000000001,1.11776,1.11776,2266,0.5660194174757082\n1663,2019/05/23 20:00:00,1.11775,1.11829,1.11773,1.11815,795,0.6002132196161729\n1664,2019/05/23 21:05:00,1.11824,1.1184,1.11815,1.11828,875,0.646396396396364\n1665,2019/05/23 22:05:00,1.11828,1.11828,1.11805,1.11822,686,0.6582568807339072\n1666,2019/05/23 23:05:00,1.11818,1.11849,1.11818,1.11838,701,0.6753688989784064\n1667,2019/05/24,1.1183,1.11832,1.11768,1.1179999999999999,1498,0.6390977443608811\n1668,2019/05/24 01:00:00,1.11801,1.11829,1.1177700000000002,1.11808,1945,0.6347826086956286\n1669,2019/05/24 02:00:00,1.11809,1.1183,1.11788,1.11811,1338,0.6155606407322549\n1670,2019/05/24 03:00:00,1.1181,1.11824,1.11794,1.11808,981,0.8951747088186189\n1671,2019/05/24 04:00:00,1.11808,1.1182,1.1178700000000001,1.11806,763,0.8292682926829547\n1672,2019/05/24 05:00:00,1.11806,1.1184399999999999,1.1180299999999999,1.11827,599,0.7454545454545762\n1673,2019/05/24 06:00:00,1.11826,1.1205200000000002,1.1181,1.11953,4678,0.813333333333361\n1674,2019/05/24 07:00:00,1.11952,1.12008,1.11832,1.11881,4572,0.7910447761194376\n1675,2019/05/24 08:00:00,1.1188,1.11931,1.11824,1.11842,3411,0.7725947521866058\n1676,2019/05/24 09:00:00,1.11839,1.11909,1.11778,1.11897,3912,0.6812339331619914\n1677,2019/05/24 10:00:00,1.1189799999999999,1.1195,1.11853,1.11853,2902,0.7166276346604888\n1678,2019/05/24 11:00:00,1.11855,1.1191799999999998,1.11815,1.11821,3483,0.6497797356828717\n1679,2019/05/24 12:00:00,1.11822,1.12002,1.11822,1.11951,5550,0.7178030303030832\n1680,2019/05/24 13:00:00,1.11952,1.11986,1.1187200000000002,1.11961,5129,0.7061143984221437\n1681,2019/05/24 14:00:00,1.11958,1.121,1.1192,1.1204100000000001,5120,0.8266199649737642\n1682,2019/05/24 15:00:00,1.12043,1.1209200000000001,1.1195899999999999,1.11968,4293,0.8266199649737642\n1683,2019/05/24 16:00:00,1.1196700000000002,1.12056,1.11963,1.12048,1952,0.8263157894737162\n1684,2019/05/24 17:00:00,1.12049,1.1211799999999998,1.12047,1.12099,1751,0.8433544303797718\n1685,2019/05/24 18:00:00,1.121,1.121,1.12056,1.12089,876,0.852799999999997\n1686,2019/05/24 19:00:00,1.12087,1.12093,1.12073,1.12084,802,0.8469217970049938\n1687,2019/05/24 20:00:00,1.12085,1.1209,1.12043,1.12055,663,0.711583924349879\n1688,2019/05/26 21:05:00,1.12093,1.12111,1.12081,1.12087,229,0.7252252252252255\n1689,2019/05/26 22:05:00,1.12086,1.1210200000000001,1.1208,1.121,405,0.7368421052631606\n1690,2019/05/26 23:05:00,1.121,1.12111,1.1206399999999999,1.1206399999999999,659,0.7956730769230274\n1691,2019/05/27,1.12063,1.1207,1.12029,1.12067,1274,0.7073170731707092\n1692,2019/05/27 01:00:00,1.12068,1.12119,1.12066,1.1211799999999998,1342,0.8052256532066326\n1693,2019/05/27 02:00:00,1.12117,1.12137,1.12096,1.12105,1140,0.7690140845070119\n1694,2019/05/27 03:00:00,1.1210799999999999,1.12147,1.12101,1.1213600000000001,698,0.775342465753395\n1695,2019/05/27 04:00:00,1.1213600000000001,1.12137,1.12061,1.12063,754,0.5807560137456683\n1696,2019/05/27 05:00:00,1.12061,1.1211,1.12061,1.12096,1316,0.5807560137456683\n1697,2019/05/27 06:00:00,1.12095,1.12101,1.1201299999999998,1.12043,2317,0.4985250737462375\n1698,2019/05/27 07:00:00,1.12042,1.12042,1.11951,1.1196,2792,0.31563421828905697\n1699,2019/05/27 08:00:00,1.11961,1.11976,1.11913,1.11922,2549,0.28381962864718563\n1700,2019/05/27 09:00:00,1.11923,1.11979,1.11909,1.1193600000000001,1911,0.2864583333332969\n1701,2019/05/27 10:00:00,1.11934,1.11947,1.1191200000000001,1.1191799999999998,1319,0.3107344632767933\n1702,2019/05/27 11:00:00,1.11919,1.11973,1.11907,1.11954,1464,0.31593406593399304\n1703,2019/05/27 12:00:00,1.11954,1.1198,1.11947,1.1195899999999999,1803,0.32972972972966613\n1704,2019/05/27 13:00:00,1.1196,1.11992,1.11866,1.1191799999999998,2718,0.2853881278538719\n1705,2019/05/27 14:00:00,1.1191799999999998,1.11933,1.119,1.11914,1609,0.31017369727044947\n1706,2019/05/27 15:00:00,1.11916,1.11947,1.11905,1.11914,1017,0.2445652173913145\n1707,2019/05/27 16:00:00,1.11913,1.11921,1.119,1.11907,619,0.2028169014084438\n1708,2019/05/27 17:00:00,1.11907,1.1191200000000001,1.11896,1.11901,176,0.1776504297994233\n1709,2019/05/27 18:00:00,1.119,1.1190200000000001,1.1188,1.11897,258,0.19076923076922614\n1710,2019/05/27 19:00:00,1.1189799999999999,1.11923,1.1189799999999999,1.11913,199,0.23988439306353426\n1711,2019/05/27 20:00:00,1.11913,1.11931,1.119,1.11921,315,0.2973856209150156\n1712,2019/05/27 21:05:00,1.11929,1.11945,1.11903,1.1193799999999998,258,0.40697674418600543\n1713,2019/05/27 22:05:00,1.1193799999999998,1.11943,1.11923,1.11927,609,0.4772727272726814\n1714,2019/05/27 23:05:00,1.1192799999999998,1.11932,1.11914,1.11931,759,0.45945945945944594\n1715,2019/05/28,1.1192600000000001,1.1195899999999999,1.11911,1.1192,1026,0.5119047619047083\n1716,2019/05/28 01:00:00,1.11921,1.1193799999999998,1.11806,1.11836,1655,0.31595092024537474\n1717,2019/05/28 02:00:00,1.11835,1.1185,1.11791,1.1182,1416,0.2874251497005626\n1718,2019/05/28 03:00:00,1.11818,1.11837,1.11799,1.11821,757,0.3485477178422403\n1719,2019/05/28 04:00:00,1.11822,1.11826,1.1178,1.11817,959,0.32307692307682717\n1720,2019/05/28 05:00:00,1.11815,1.11865,1.11814,1.11856,1084,0.38245614035076103\n1721,2019/05/28 06:00:00,1.11856,1.11868,1.11764,1.11838,3118,0.33633633633624527\n1722,2019/05/28 07:00:00,1.11839,1.1187,1.11751,1.11863,5960,0.3313953488371534\n1723,2019/05/28 08:00:00,1.1186200000000002,1.11942,1.11837,1.11921,4218,0.4649999999999631\n1724,2019/05/28 09:00:00,1.11923,1.1198,1.11894,1.1189799999999999,3563,0.4868105515587191\n1725,2019/05/28 10:00:00,1.11901,1.11905,1.11814,1.11883,3129,0.3987730061349158\n1726,2019/05/28 11:00:00,1.1188200000000001,1.11933,1.11863,1.11932,2438,0.4155069582504231\n1727,2019/05/28 12:00:00,1.11931,1.1193799999999998,1.11832,1.11885,3234,0.39703153988859713\n1728,2019/05/28 13:00:00,1.11883,1.11945,1.1188200000000001,1.11911,3924,0.4115456238360619\n1729,2019/05/28 14:00:00,1.1191200000000001,1.11944,1.11694,1.1173600000000001,6270,0.2791366906474483\n1730,2019/05/28 15:00:00,1.1173600000000001,1.11812,1.1171,1.1176,5837,0.32881355932199197\n1731,2019/05/28 16:00:00,1.11763,1.11774,1.11617,1.11648,3464,0.2904191616766206\n1732,2019/05/28 17:00:00,1.11648,1.1171,1.1163100000000001,1.11706,2097,0.2904191616766206\n1733,2019/05/28 18:00:00,1.11705,1.1171799999999998,1.1163,1.11643,1913,0.3069908814589282\n1734,2019/05/28 19:00:00,1.1164100000000001,1.11665,1.11601,1.11648,2150,0.25154320987651047\n1735,2019/05/28 20:00:00,1.11647,1.1167799999999999,1.11589,1.11599,1098,0.2790322580644826\n1736,2019/05/28 21:05:00,1.1163299999999998,1.11655,1.1161299999999998,1.11639,1388,0.28264462809912194\n1737,2019/05/28 22:05:00,1.1164,1.1165100000000001,1.11635,1.11643,696,0.18574108818004373\n1738,2019/05/28 23:05:00,1.1164399999999999,1.11684,1.11638,1.1167799999999999,676,0.1780303030302514\n1739,2019/05/29,1.11673,1.11721,1.11666,1.11689,1785,0.27010309278345457\n1740,2019/05/29 01:00:00,1.1168799999999999,1.11701,1.1164399999999999,1.1166,2205,0.21503131524005192\n1741,2019/05/29 02:00:00,1.11657,1.1166200000000002,1.11616,1.1164100000000001,1826,0.2080679405520133\n1742,2019/05/29 03:00:00,1.1164,1.11657,1.1163299999999998,1.11648,841,0.19612068965512763\n1743,2019/05/29 04:00:00,1.1165,1.11657,1.11616,1.11642,1066,0.3105802047781298\n1744,2019/05/29 05:00:00,1.1164100000000001,1.1168799999999999,1.11625,1.11661,1594,0.3765432098764937\n1745,2019/05/29 06:00:00,1.11661,1.11669,1.1154700000000002,1.11562,3320,0.3948220064724566\n1746,2019/05/29 07:00:00,1.11565,1.11601,1.11516,1.11531,4750,0.3588235294116967\n1747,2019/05/29 08:00:00,1.11532,1.11589,1.11517,1.11543,3805,0.344410876132893\n1748,2019/05/29 09:00:00,1.11542,1.11578,1.11495,1.1155700000000002,3004,0.3518518518518404\n1749,2019/05/29 10:00:00,1.11558,1.11585,1.11534,1.11563,2605,0.35294117647057544\n1750,2019/05/29 11:00:00,1.11563,1.11574,1.11471,1.1151,3364,0.29268292682925506\n1751,2019/05/29 12:00:00,1.1150799999999998,1.11565,1.1148200000000001,1.11494,3883,0.29268292682925506\n1752,2019/05/29 13:00:00,1.11493,1.1149799999999999,1.11399,1.11439,4705,0.17899761336513148\n1753,2019/05/29 14:00:00,1.11438,1.11529,1.1134899999999999,1.11418,7982,0.14902807775375887\n1754,2019/05/29 15:00:00,1.11422,1.11425,1.1124,1.1135,7131,0.12545454545453336\n1755,2019/05/29 16:00:00,1.1134899999999999,1.11391,1.1131799999999998,1.11334,2720,0.1321839080459609\n1756,2019/05/29 17:00:00,1.11334,1.11375,1.11259,1.11372,4060,0.11876075731496136\n1757,2019/05/29 18:00:00,1.11371,1.11385,1.1132,1.1132799999999998,1780,0.13763066202088792\n1758,2019/05/29 19:00:00,1.11329,1.11343,1.11286,1.1132,1815,0.08318890814558925\n1759,2019/05/29 20:00:00,1.11317,1.11344,1.11297,1.11306,962,0.09800000000001803\n1760,2019/05/29 21:05:00,1.11311,1.1137299999999999,1.1131,1.11351,1242,0.15662650602410444\n1761,2019/05/29 22:05:00,1.1135,1.1137299999999999,1.11337,1.11361,629,0.15662650602410444\n1762,2019/05/29 23:05:00,1.11362,1.1137299999999999,1.11351,1.11363,541,0.16386554621849228\n1763,2019/05/30,1.11353,1.11425,1.11341,1.11392,1022,0.23163841807911142\n1764,2019/05/30 01:00:00,1.1139299999999999,1.11428,1.11391,1.11392,1072,0.2675159235668877\n1765,2019/05/30 02:00:00,1.11392,1.11396,1.1133899999999999,1.11382,1390,0.24091778202677291\n1766,2019/05/30 03:00:00,1.1138299999999999,1.11386,1.11364,1.11379,538,0.2863636363636478\n1767,2019/05/30 04:00:00,1.11379,1.11409,1.1136700000000002,1.11396,931,0.30890052356022185\n1768,2019/05/30 05:00:00,1.11394,1.11396,1.11331,1.1135700000000002,855,0.38187702265370377\n1769,2019/05/30 06:00:00,1.11356,1.11365,1.11297,1.1134600000000001,2619,0.34402332361514393\n1770,2019/05/30 07:00:00,1.1134700000000002,1.11353,1.11239,1.11313,4111,0.3450292397660496\n1771,2019/05/30 08:00:00,1.11315,1.11375,1.11306,1.11337,2443,0.3672316384180681\n1772,2019/05/30 09:00:00,1.1133600000000001,1.11429,1.11317,1.1142,2095,0.4919786096256462\n1773,2019/05/30 10:00:00,1.11419,1.11428,1.11345,1.11363,2545,0.490616621983883\n1774,2019/05/30 11:00:00,1.11365,1.11399,1.11341,1.1135700000000002,2045,0.44252873563216444\n1775,2019/05/30 12:00:00,1.11356,1.11411,1.11295,1.11309,3381,0.40886699507387275\n1776,2019/05/30 13:00:00,1.1131,1.1132799999999998,1.1115700000000002,1.1123399999999999,5340,0.30514705882352217\n1777,2019/05/30 14:00:00,1.11235,1.11289,1.11188,1.11258,4961,0.23651452282155766\n1778,2019/05/30 15:00:00,1.1126200000000002,1.11396,1.11245,1.11388,4649,0.3720136518771326\n1779,2019/05/30 16:00:00,1.11385,1.11385,1.11323,1.11355,2239,0.4082397003745357\n1780,2019/05/30 17:00:00,1.11354,1.11396,1.11352,1.11369,1624,0.42018348623854146\n1781,2019/05/30 18:00:00,1.1136700000000002,1.11374,1.1132600000000001,1.11341,2281,0.3759124087591452\n1782,2019/05/30 19:00:00,1.11341,1.11356,1.11332,1.11344,2101,0.4023437500000327\n1783,2019/05/30 20:00:00,1.11343,1.1134600000000001,1.11284,1.1128799999999999,768,0.3916349809886228\n1784,2019/05/30 21:05:00,1.11303,1.11311,1.11275,1.1129799999999999,1994,0.43186582809226465\n1785,2019/05/30 22:05:00,1.11299,1.11329,1.11284,1.11325,1738,0.4270613107822311\n1786,2019/05/30 23:05:00,1.11324,1.11341,1.1128799999999999,1.11293,1674,0.3712296983758776\n1787,2019/05/31,1.11291,1.11399,1.11287,1.11338,1929,0.44489795918369657\n1788,2019/05/31 01:00:00,1.1133899999999999,1.11384,1.1133,1.1137,1857,0.4485596707819201\n1789,2019/05/31 02:00:00,1.1136700000000002,1.1136700000000002,1.11323,1.1133899999999999,1914,0.4735632183908361\n1790,2019/05/31 03:00:00,1.11338,1.1134600000000001,1.11299,1.11301,1495,0.6417445482866267\n1791,2019/05/31 04:00:00,1.11303,1.11305,1.11247,1.11279,1636,0.5522788203753798\n1792,2019/05/31 05:00:00,1.11276,1.11323,1.1126200000000002,1.11289,1920,0.4119718309859169\n1793,2019/05/31 06:00:00,1.1129,1.11358,1.11285,1.11341,3192,0.4764890282131847\n1794,2019/05/31 07:00:00,1.11341,1.11479,1.1132,1.11425,4602,0.6107226107226197\n1795,2019/05/31 08:00:00,1.11424,1.11543,1.11424,1.11476,4484,0.6980728051391879\n1796,2019/05/31 09:00:00,1.11477,1.11562,1.11467,1.11497,4597,0.7098765432098867\n1797,2019/05/31 10:00:00,1.11496,1.11543,1.11458,1.11459,3581,0.7718120805369068\n1798,2019/05/31 11:00:00,1.1146,1.11497,1.11404,1.11428,3955,0.701219512195139\n1799,2019/05/31 12:00:00,1.11429,1.11643,1.11429,1.11558,5833,0.7629032258064735\n1800,2019/05/31 13:00:00,1.11556,1.11605,1.11519,1.11582,4998,0.7582236842105439\n1801,2019/05/31 14:00:00,1.1158299999999999,1.1179299999999999,1.1141299999999998,1.11414,8735,0.7010676156583516\n1802,2019/05/31 15:00:00,1.11415,1.11564,1.11365,1.11485,6799,0.663299663299666\n1803,2019/05/31 16:00:00,1.11489,1.1163100000000001,1.11471,1.11612,3512,0.6919032597266135\n1804,2019/05/31 17:00:00,1.11611,1.11687,1.1156700000000002,1.11663,3163,0.7263479145473124\n1805,2019/05/31 18:00:00,1.11663,1.11776,1.11653,1.11725,4921,0.7872549019607835\n1806,2019/05/31 19:00:00,1.11722,1.11743,1.11675,1.11725,3288,0.7834331337325374\n1807,2019/05/31 20:00:00,1.1172600000000001,1.1172600000000001,1.11653,1.11659,832,0.7583417593528916\n1808,2019/06/02 21:05:00,1.11642,1.11715,1.11608,1.11715,1262,0.6889375684556487\n1809,2019/06/02 22:05:00,1.11714,1.11734,1.1169,1.1171,1490,0.6728110599078402\n1810,2019/06/02 23:05:00,1.1171,1.1173799999999998,1.11703,1.11733,813,0.6670574443141791\n1811,2019/06/03,1.11727,1.11815,1.11723,1.11788,2097,0.7014115092291106\n1812,2019/06/03 01:00:00,1.11786,1.11859,1.11752,1.11843,2290,0.7574094401756433\n1813,2019/06/03 02:00:00,1.1184399999999999,1.11879,1.11821,1.1187799999999999,1830,0.7184713375796292\n1814,2019/06/03 03:00:00,1.11876,1.11894,1.1183299999999998,1.11843,1628,0.7237500000000147\n1815,2019/06/03 04:00:00,1.11842,1.11857,1.11761,1.11765,1020,0.6764705882353461\n1816,2019/06/03 05:00:00,1.11764,1.11789,1.1173799999999998,1.11743,1041,0.7070524412296665\n1817,2019/06/03 06:00:00,1.11742,1.1176,1.11598,1.1163299999999998,3589,0.5175718849840351\n1818,2019/06/03 07:00:00,1.1163399999999999,1.1174,1.1161299999999998,1.11725,6678,0.4701754385965091\n1819,2019/06/03 08:00:00,1.1172600000000001,1.11798,1.11657,1.11792,5142,0.4397031539888828\n1820,2019/06/03 09:00:00,1.11791,1.11829,1.11691,1.11729,3853,0.4701754385965091\n1821,2019/06/03 10:00:00,1.11727,1.1184399999999999,1.11727,1.11836,2840,0.5026642984014188\n1822,2019/06/03 11:00:00,1.11837,1.1189,1.1177700000000002,1.1180299999999999,3379,0.5833333333333497\n1823,2019/06/03 12:00:00,1.11805,1.1199700000000001,1.11805,1.11947,4857,0.6395705521472664\n1824,2019/06/03 13:00:00,1.11947,1.12048,1.11846,1.12015,4738,0.6638054363376489\n1825,2019/06/03 14:00:00,1.12015,1.12087,1.1195899999999999,1.12011,7713,0.6444780635401134\n1826,2019/06/03 15:00:00,1.12012,1.1208,1.1198700000000001,1.12042,4968,0.6191247974068316\n1827,2019/06/03 16:00:00,1.12043,1.12175,1.1203100000000001,1.12152,3730,0.6604046242774798\n1828,2019/06/03 17:00:00,1.1215,1.12503,1.1214600000000001,1.1243,7014,0.766169154228868\n1829,2019/06/03 18:00:00,1.12429,1.1259,1.1238299999999999,1.12586,4716,0.8401960784313703\n1830,2019/06/03 19:00:00,1.12585,1.12616,1.1245100000000001,1.12469,5389,0.8631476050831035\n1831,2019/06/03 20:00:00,1.12468,1.12468,1.12399,1.12404,1330,0.944385026737961\n1832,2019/06/03 21:05:00,1.12405,1.12446,1.12405,1.12446,1047,0.944385026737961\n1833,2019/06/03 22:05:00,1.12446,1.1246200000000002,1.1243100000000001,1.12449,648,0.9417693169092882\n1834,2019/06/03 23:05:00,1.12447,1.12474,1.12437,1.1245399999999999,1381,0.9405034324942718\n1835,2019/06/04,1.12455,1.1254899999999999,1.1244399999999999,1.12497,2273,0.9443254817987079\n1836,2019/06/04 01:00:00,1.1249799999999999,1.1250200000000001,1.12436,1.12473,1700,0.9330357142857206\n1837,2019/06/04 02:00:00,1.1247,1.12535,1.1245100000000001,1.12529,1609,0.9270072992700782\n1838,2019/06/04 03:00:00,1.1252799999999998,1.12533,1.12513,1.12529,1378,0.9221789883268557\n1839,2019/06/04 04:00:00,1.12532,1.12573,1.1245,1.12466,3110,0.8526946107784555\n1840,2019/06/04 05:00:00,1.1246399999999999,1.1254899999999999,1.12452,1.12531,1997,0.8526946107784555\n1841,2019/06/04 06:00:00,1.12532,1.12704,1.12471,1.12639,4394,0.862569832402249\n1842,2019/06/04 07:00:00,1.12638,1.1276899999999999,1.1260700000000001,1.12624,5757,0.8053797468354574\n1843,2019/06/04 08:00:00,1.1262299999999998,1.12634,1.12428,1.12476,4649,0.5828729281767874\n1844,2019/06/04 09:00:00,1.12474,1.12517,1.1239700000000001,1.12477,4861,0.5432098765432061\n1845,2019/06/04 10:00:00,1.12478,1.12586,1.12424,1.1258299999999999,4743,0.623324396782853\n1846,2019/06/04 11:00:00,1.12582,1.1263100000000001,1.12521,1.12534,4037,0.6447534766118982\n1847,2019/06/04 12:00:00,1.12533,1.1253799999999998,1.12311,1.1234600000000001,7280,0.5015228426395928\n1848,2019/06/04 13:00:00,1.12344,1.1266399999999999,1.12261,1.12474,7837,0.5291557876414359\n1849,2019/06/04 14:00:00,1.1247,1.12529,1.12283,1.1231799999999998,11022,0.4962756052141695\n1850,2019/06/04 15:00:00,1.1232,1.12421,1.12309,1.12364,4652,0.5000000000000104\n1851,2019/06/04 16:00:00,1.12363,1.1246399999999999,1.12319,1.1244299999999998,2904,0.5046468401487088\n1852,2019/06/04 17:00:00,1.1244299999999998,1.12601,1.1242299999999998,1.12586,3714,0.5605935696620077\n1853,2019/06/04 18:00:00,1.12585,1.12663,1.12541,1.1258299999999999,4022,0.5989761092150293\n1854,2019/06/04 19:00:00,1.12581,1.12642,1.12547,1.12568,2347,0.5989761092150293\n1855,2019/06/04 20:00:00,1.1257,1.1257,1.12511,1.12511,946,0.5194681861348645\n1856,2019/06/04 21:05:00,1.12517,1.12541,1.12509,1.12526,1211,0.48686868686870205\n1857,2019/06/04 22:05:00,1.1252799999999998,1.12537,1.125,1.12521,760,0.5878048780488143\n1858,2019/06/04 23:05:00,1.12521,1.1256,1.12517,1.12533,787,0.6219211822660273\n1859,2019/06/05,1.12532,1.1261,1.12526,1.1257700000000002,1581,0.6128625472887991\n1860,2019/06/05 01:00:00,1.12576,1.12639,1.1255700000000002,1.1263,2467,0.6048906048906197\n1861,2019/06/05 02:00:00,1.12629,1.12653,1.1260700000000001,1.12609,1754,0.8330464716007057\n1862,2019/06/05 03:00:00,1.12608,1.1262299999999998,1.12584,1.12612,1172,0.8364485981308181\n1863,2019/06/05 04:00:00,1.12611,1.12624,1.1258700000000001,1.126,873,0.8368298368298163\n1864,2019/06/05 05:00:00,1.12602,1.12653,1.12599,1.12632,1216,0.8471615720523858\n1865,2019/06/05 06:00:00,1.1263100000000001,1.12723,1.12572,1.12601,3757,0.8105468749999901\n1866,2019/06/05 07:00:00,1.12601,1.1268200000000002,1.1256700000000002,1.12667,4953,0.7315789473684331\n1867,2019/06/05 08:00:00,1.12669,1.12842,1.12642,1.1278700000000002,4768,0.7866108786610837\n1868,2019/06/05 09:00:00,1.12788,1.12883,1.12766,1.1283,3787,0.8034682080924825\n1869,2019/06/05 10:00:00,1.1283100000000001,1.12858,1.12564,1.12604,4959,0.6087591240875705\n1870,2019/06/05 11:00:00,1.12604,1.12646,1.12517,1.12554,5472,0.5712328767123233\n1871,2019/06/05 12:00:00,1.1255700000000002,1.1306200000000002,1.1252799999999998,1.12921,13407,0.7326297273526766\n1872,2019/06/05 13:00:00,1.12923,1.1295899999999999,1.12663,1.12663,8151,0.7271095152603185\n1873,2019/06/05 14:00:00,1.1266200000000002,1.1271200000000001,1.12561,1.1262299999999998,12152,0.6518010291595114\n1874,2019/06/05 15:00:00,1.12625,1.12628,1.12399,1.12419,8215,0.5627405696689756\n1875,2019/06/05 16:00:00,1.1241700000000001,1.12419,1.12307,1.1234899999999999,4618,0.5206971677559894\n1876,2019/06/05 17:00:00,1.1235,1.12358,1.1230799999999999,1.12329,2548,0.5295420974889264\n1877,2019/06/05 18:00:00,1.12329,1.12335,1.1219299999999999,1.12257,3099,0.4877384196185315\n1878,2019/06/05 19:00:00,1.1225399999999999,1.12303,1.1220299999999999,1.12242,2845,0.4774148714384974\n1879,2019/06/05 20:00:00,1.1224,1.12257,1.12196,1.12206,1164,0.457375833951083\n1880,2019/06/05 21:05:00,1.12212,1.12279,1.12212,1.12279,2137,0.467789165446559\n1881,2019/06/05 22:05:00,1.12277,1.12303,1.1225,1.1228,980,0.40894308943090235\n1882,2019/06/05 23:05:00,1.1228200000000002,1.12309,1.12279,1.12283,938,0.3916317991631844\n1883,2019/06/06,1.12279,1.12319,1.1226200000000002,1.12266,1472,0.4686274509804138\n1884,2019/06/06 01:00:00,1.12268,1.12287,1.12236,1.12247,1463,0.47847847847849245\n1885,2019/06/06 02:00:00,1.12247,1.12271,1.12236,1.12266,1339,0.10634648370495538\n1886,2019/06/06 03:00:00,1.12265,1.1230799999999999,1.12261,1.12301,1055,0.15967741935479215\n1887,2019/06/06 04:00:00,1.123,1.12324,1.12293,1.12323,908,0.21535580524342313\n1888,2019/06/06 05:00:00,1.12321,1.1233799999999998,1.12296,1.12333,879,0.33419689119165813\n1889,2019/06/06 06:00:00,1.12335,1.1235600000000001,1.12225,1.12277,3359,0.3838120104438722\n1890,2019/06/06 07:00:00,1.12276,1.12344,1.12224,1.12321,3576,0.3828125000000014\n1891,2019/06/06 08:00:00,1.1232,1.12421,1.12316,1.1239,3497,0.6473988439306569\n1892,2019/06/06 09:00:00,1.1239,1.1239,1.1232,1.12366,4141,0.6473988439306569\n1893,2019/06/06 10:00:00,1.12365,1.12392,1.12306,1.12342,2813,0.6366197183098495\n1894,2019/06/06 11:00:00,1.12341,1.12719,1.12014,1.12639,8562,0.5577731092436913\n1895,2019/06/06 12:00:00,1.1264,1.13085,1.12592,1.12866,14063,0.6746522411128236\n1896,2019/06/06 13:00:00,1.12866,1.1295899999999999,1.1244100000000001,1.12542,12320,0.6025017373175826\n1897,2019/06/06 14:00:00,1.12543,1.12828,1.12543,1.12805,7340,0.606940509915006\n1898,2019/06/06 15:00:00,1.1280700000000001,1.12996,1.12796,1.12935,6266,0.659588159588161\n1899,2019/06/06 16:00:00,1.12934,1.1299700000000001,1.12821,1.1293,3481,0.6598070739549866\n1900,2019/06/06 17:00:00,1.12933,1.12943,1.12863,1.12871,1951,0.6515151515151599\n1901,2019/06/06 18:00:00,1.1287200000000002,1.12885,1.12671,1.1272799999999998,6110,0.5743801652892642\n1902,2019/06/06 19:00:00,1.12726,1.12814,1.12723,1.12742,2669,0.5708333333333464\n1903,2019/06/06 20:00:00,1.12743,1.12753,1.12678,1.1275,1244,0.5751833740831328\n1904,2019/06/06 21:05:00,1.1275899999999999,1.12794,1.1272799999999998,1.12784,1858,0.5859188544152804\n1905,2019/06/06 22:05:00,1.12785,1.12789,1.1276700000000002,1.1277,457,0.5659787367104521\n1906,2019/06/06 23:05:00,1.1277,1.12789,1.12751,1.12752,909,0.5603715170278663\n1907,2019/06/07,1.12753,1.12762,1.12719,1.12744,1728,0.5536480686695244\n1908,2019/06/07 01:00:00,1.12743,1.12751,1.12703,1.12745,1846,0.5603112840466973\n1909,2019/06/07 02:00:00,1.12742,1.12745,1.1267399999999999,1.12683,1743,0.3039073806078273\n1910,2019/06/07 03:00:00,1.12684,1.1269799999999999,1.12658,1.1266399999999999,1460,0.3776978417266262\n1911,2019/06/07 04:00:00,1.1266399999999999,1.1268200000000002,1.12658,1.12667,1197,0.3776978417266262\n1912,2019/06/07 05:00:00,1.12666,1.1267,1.1263299999999998,1.12638,879,0.10169491525424823\n1913,2019/06/07 06:00:00,1.12638,1.1266200000000002,1.1256,1.1262,3108,0.084536082474227\n1914,2019/06/07 07:00:00,1.12619,1.12699,1.12595,1.1262299999999998,3770,0.1494252873562798\n1915,2019/06/07 08:00:00,1.12622,1.1268,1.1257,1.12649,3565,0.21971830985908306\n1916,2019/06/07 09:00:00,1.12647,1.12683,1.12561,1.12561,2320,0.2207084468664146\n1917,2019/06/07 10:00:00,1.1256,1.12657,1.12509,1.12624,2892,0.21657754010688204\n1918,2019/06/07 11:00:00,1.1262299999999998,1.1271200000000001,1.12618,1.12703,2788,0.24484536082468003\n1919,2019/06/07 12:00:00,1.12704,1.1326399999999999,1.12686,1.13166,13635,0.6882978723403865\n1920,2019/06/07 13:00:00,1.1317,1.13258,1.1307200000000002,1.13189,10413,0.7002164502164228\n1921,2019/06/07 14:00:00,1.13188,1.1347399999999999,1.1315600000000001,1.13374,8980,0.7788808664259778\n1922,2019/06/07 15:00:00,1.13373,1.1345299999999998,1.1323,1.13237,5859,0.790293040293021\n1923,2019/06/07 16:00:00,1.13237,1.13419,1.1323299999999998,1.1339299999999999,3571,0.8118532455315052\n1924,2019/06/07 17:00:00,1.13394,1.1343,1.13332,1.13429,3416,0.8260869565217264\n1925,2019/06/07 18:00:00,1.1343,1.13438,1.13307,1.13391,3479,0.8084326306140938\n1926,2019/06/07 19:00:00,1.1339,1.1339,1.1326200000000002,1.13329,2395,0.7938793879387893\n1927,2019/06/07 20:00:00,1.13327,1.1336600000000001,1.1332,1.1332,914,0.8497109826589501\n1928,2019/06/09 21:05:00,1.1324299999999998,1.1330200000000001,1.1321299999999999,1.13281,1045,0.7626353790613547\n1929,2019/06/09 22:05:00,1.13281,1.13285,1.13139,1.1315600000000001,1189,0.730337078651676\n1930,2019/06/09 23:05:00,1.13157,1.13209,1.1315600000000001,1.13188,877,0.7353711790392876\n1931,2019/06/10,1.1318,1.13239,1.13157,1.13158,1945,0.7764915405164653\n1932,2019/06/10 01:00:00,1.13158,1.13164,1.13104,1.1314899999999999,2418,0.7288135593220278\n1933,2019/06/10 02:00:00,1.1314799999999998,1.13152,1.13105,1.1312799999999998,1447,0.46572934973636826\n1934,2019/06/10 03:00:00,1.13129,1.13145,1.13101,1.13107,945,0.4624781849912593\n1935,2019/06/10 04:00:00,1.13106,1.1312,1.1306100000000001,1.1307399999999999,1375,0.12342569269518973\n1936,2019/06/10 05:00:00,1.13076,1.13084,1.1302,1.13042,1244,0.11187214611869832\n1937,2019/06/10 06:00:00,1.1304100000000001,1.13123,1.13031,1.1311,2413,0.1844863731655811\n1938,2019/06/10 07:00:00,1.13109,1.13109,1.12893,1.12927,3725,0.12748344370857057\n1939,2019/06/10 08:00:00,1.12927,1.13014,1.1291200000000001,1.12961,3888,0.12084063047283687\n1940,2019/06/10 09:00:00,1.12961,1.13063,1.12952,1.1306,2879,0.20521739130434347\n1941,2019/06/10 10:00:00,1.13058,1.13093,1.13042,1.1307399999999999,2178,0.24462809917354597\n1942,2019/06/10 11:00:00,1.13073,1.1310200000000001,1.1297,1.12974,3085,0.2711571675302386\n1943,2019/06/10 12:00:00,1.12974,1.13111,1.12974,1.13081,3653,0.3229571984435836\n1944,2019/06/10 13:00:00,1.1308200000000002,1.1319299999999999,1.1299299999999999,1.13002,4516,0.4161073825503226\n1945,2019/06/10 14:00:00,1.13004,1.1316899999999999,1.12904,1.13157,5116,0.3328244274809126\n1946,2019/06/10 15:00:00,1.13158,1.13195,1.13087,1.13097,3981,0.3885350318471432\n1947,2019/06/10 16:00:00,1.13097,1.13172,1.1308200000000002,1.13158,2140,0.3854660347551507\n1948,2019/06/10 17:00:00,1.1315600000000001,1.13176,1.1309200000000001,1.13135,2190,0.39178515007901193\n1949,2019/06/10 18:00:00,1.13133,1.1324100000000001,1.13123,1.1314899999999999,4048,0.4756838905775332\n1950,2019/06/10 19:00:00,1.13151,1.13188,1.13132,1.13176,1326,0.507293354943304\n1951,2019/06/10 20:00:00,1.13175,1.13183,1.13097,1.1310799999999999,897,0.4469820554649593\n1952,2019/06/10 21:05:00,1.13111,1.1313600000000001,1.13087,1.13126,907,0.5649484536082835\n1953,2019/06/10 22:05:00,1.13127,1.13147,1.1312,1.1314600000000001,317,0.5745967741935692\n1954,2019/06/10 23:05:00,1.1314600000000001,1.1318,1.13142,1.13176,526,0.5604166666666731\n1955,2019/06/11,1.13176,1.13183,1.13085,1.13143,1683,0.4745098039215534\n1956,2019/06/11 01:00:00,1.1314600000000001,1.13184,1.13079,1.13104,3016,0.5366972477064104\n1957,2019/06/11 02:00:00,1.13103,1.1315600000000001,1.1307,1.13154,1235,0.5160550458715641\n1958,2019/06/11 03:00:00,1.13153,1.13158,1.13125,1.13135,959,0.4073033707865277\n1959,2019/06/11 04:00:00,1.1313600000000001,1.13179,1.13114,1.1317,852,0.5551839464882836\n1960,2019/06/11 05:00:00,1.1316899999999999,1.1319,1.1313799999999998,1.13188,1160,0.5316901408450074\n1961,2019/06/11 06:00:00,1.1318700000000002,1.13221,1.1313,1.13144,3386,0.5723270440251133\n1962,2019/06/11 07:00:00,1.13143,1.13313,1.13141,1.13206,4407,0.6650246305418428\n1963,2019/06/11 08:00:00,1.13202,1.13245,1.1311200000000001,1.13125,4680,0.5540540540540241\n1964,2019/06/11 09:00:00,1.13123,1.13199,1.1312200000000001,1.13181,3939,0.5540540540540241\n1965,2019/06/11 10:00:00,1.13182,1.13246,1.13129,1.1313799999999998,4018,0.6596858638743377\n1966,2019/06/11 11:00:00,1.13139,1.1320700000000001,1.13035,1.13097,3740,0.5407725321888273\n1967,2019/06/11 12:00:00,1.13099,1.13266,1.13011,1.13179,8284,0.557620817843857\n1968,2019/06/11 13:00:00,1.1318,1.13252,1.13121,1.13147,6322,0.5287128712871214\n1969,2019/06/11 14:00:00,1.13147,1.13245,1.13105,1.1314,6191,0.5726681127982935\n1970,2019/06/11 15:00:00,1.13141,1.13176,1.13084,1.1314899999999999,4909,0.5536842105263241\n1971,2019/06/11 16:00:00,1.1314899999999999,1.13311,1.13137,1.1329,3478,0.6622296173044999\n1972,2019/06/11 17:00:00,1.1329,1.1336899999999999,1.13253,1.1332200000000001,3922,0.6910197869102023\n1973,2019/06/11 18:00:00,1.13319,1.13372,1.13306,1.13321,2345,0.6942675159235854\n1974,2019/06/11 19:00:00,1.1332200000000001,1.13324,1.1326,1.13278,2126,0.6410256410256719\n1975,2019/06/11 20:00:00,1.13279,1.13295,1.13242,1.13248,656,0.6137071651090418\n1976,2019/06/11 21:05:00,1.1326399999999999,1.13283,1.13258,1.1327200000000002,619,0.5490909090909111\n1977,2019/06/11 22:05:00,1.13275,1.1328799999999999,1.1326200000000002,1.1327,463,0.583650190114053\n1978,2019/06/11 23:05:00,1.13271,1.13296,1.13258,1.1329,500,0.5855018587360221\n1979,2019/06/12,1.13281,1.13316,1.13265,1.1329,1452,0.563600782778826\n1980,2019/06/12 01:00:00,1.1328799999999999,1.1333799999999998,1.13266,1.13285,2666,0.7061503416855885\n1981,2019/06/12 02:00:00,1.13284,1.13295,1.13259,1.13276,1582,0.6914600550963568\n1982,2019/06/12 03:00:00,1.13278,1.13337,1.13277,1.13332,1142,0.723456790123407\n1983,2019/06/12 04:00:00,1.13331,1.13341,1.13307,1.1333600000000001,1101,0.755725190839633\n1984,2019/06/12 05:00:00,1.13334,1.13372,1.13304,1.1336899999999999,1921,0.8078817733989676\n1985,2019/06/12 06:00:00,1.1336899999999999,1.13401,1.1332,1.1333600000000001,3278,0.7399999999999349\n1986,2019/06/12 07:00:00,1.13334,1.1339700000000001,1.1329,1.13395,4511,0.6029411764705582\n1987,2019/06/12 08:00:00,1.13394,1.1343,1.13319,1.1333799999999998,5014,0.642384105960204\n1988,2019/06/12 09:00:00,1.13337,1.13351,1.13239,1.13286,3473,0.5773809523808969\n1989,2019/06/12 10:00:00,1.13287,1.1331,1.13116,1.13198,4441,0.4399092970521133\n1990,2019/06/12 11:00:00,1.1319700000000001,1.1325,1.1314600000000001,1.1321299999999999,4503,0.4399092970521133\n1991,2019/06/12 12:00:00,1.13214,1.13404,1.1313799999999998,1.1319299999999999,8050,0.5735785953176654\n1992,2019/06/12 13:00:00,1.13192,1.13195,1.13069,1.1314799999999998,5747,0.5114503816793629\n1993,2019/06/12 14:00:00,1.1314600000000001,1.13255,1.13129,1.13196,5513,0.5395683453237139\n1994,2019/06/12 15:00:00,1.1319700000000001,1.13244,1.1308200000000002,1.13097,4117,0.49027777777777526\n1995,2019/06/12 16:00:00,1.13097,1.1314899999999999,1.1288799999999999,1.12965,4342,0.3891951488423203\n1996,2019/06/12 17:00:00,1.12968,1.1298,1.12907,1.1293600000000001,3035,0.35953757225431066\n1997,2019/06/12 18:00:00,1.12933,1.12958,1.12822,1.1285399999999999,2708,0.3245243128963793\n1998,2019/06/12 19:00:00,1.12853,1.12889,1.12837,1.1287,1475,0.30263157894733705\n1999,2019/06/12 20:00:00,1.12871,1.1289,1.1285,1.1286100000000001,876,0.28054298642531983\n2000,2019/06/12 21:05:00,1.12877,1.12932,1.12877,1.1293,1305,0.3236607142857006\n2001,2019/06/12 22:05:00,1.1293,1.12934,1.12916,1.12921,414,0.2994219653179025\n2002,2019/06/12 23:05:00,1.12921,1.12939,1.12921,1.12921,561,0.33417721518984145\n2003,2019/06/13,1.12919,1.12951,1.12901,1.12903,1177,0.3948497854077044\n2004,2019/06/13 01:00:00,1.12904,1.12979,1.12876,1.12951,2866,0.4042553191489167\n2005,2019/06/13 02:00:00,1.12952,1.1296899999999999,1.12929,1.12937,2582,0.25423728813560215\n2006,2019/06/13 03:00:00,1.1293600000000001,1.12958,1.1291,1.1293,1455,0.2777777777777846\n2007,2019/06/13 04:00:00,1.12929,1.12975,1.1290799999999999,1.12974,845,0.2144288577154445\n2008,2019/06/13 05:00:00,1.12973,1.13,1.12958,1.12985,1075,0.2767295597484028\n2009,2019/06/13 06:00:00,1.12985,1.1303299999999998,1.1286100000000001,1.12943,3784,0.3995157384987754\n2010,2019/06/13 07:00:00,1.12942,1.13014,1.12919,1.1294899999999999,5540,0.3995157384987754\n2011,2019/06/13 08:00:00,1.1294799999999998,1.13,1.1291200000000001,1.1291200000000001,4092,0.4925373134328526\n2012,2019/06/13 09:00:00,1.1291200000000001,1.12952,1.12868,1.12883,2870,0.43535620052769036\n2013,2019/06/13 10:00:00,1.12884,1.12927,1.12836,1.12869,3090,0.3999999999999892\n2014,2019/06/13 11:00:00,1.12868,1.12964,1.12848,1.12964,2990,0.3925925925925654\n2015,2019/06/13 12:00:00,1.12963,1.12963,1.12734,1.12782,5430,0.3036750483558894\n2016,2019/06/13 13:00:00,1.12781,1.12837,1.1271200000000001,1.12719,5727,0.284644194756565\n2017,2019/06/13 14:00:00,1.1271799999999998,1.1280700000000001,1.12681,1.12713,5793,0.26266416510317964\n2018,2019/06/13 15:00:00,1.12714,1.1277,1.1270200000000001,1.12737,3127,0.23333333333331485\n2019,2019/06/13 16:00:00,1.12739,1.1279299999999999,1.1272799999999998,1.12758,2699,0.2683896620278121\n2020,2019/06/13 17:00:00,1.12762,1.12836,1.12747,1.12791,2646,0.3377609108159405\n2021,2019/06/13 18:00:00,1.1279,1.12845,1.1276,1.12784,3879,0.32882011605415723\n2022,2019/06/13 19:00:00,1.1279,1.12814,1.1272799999999998,1.12744,2174,0.2767175572519155\n2023,2019/06/13 20:00:00,1.12741,1.12766,1.12727,1.12758,611,0.2835443037974941\n2024,2019/06/13 21:05:00,1.12764,1.12786,1.12751,1.12772,836,0.31807228915665015\n2025,2019/06/13 22:05:00,1.12772,1.12806,1.12766,1.12786,586,0.35514018691589316\n2026,2019/06/13 23:05:00,1.1278700000000002,1.12802,1.12771,1.12791,508,0.39583333333336346\n2027,2019/06/14,1.12786,1.12819,1.12781,1.12784,1358,0.45799457994582227\n2028,2019/06/14 01:00:00,1.12785,1.1278700000000002,1.12731,1.12752,1956,0.3455497382199181\n2029,2019/06/14 02:00:00,1.12751,1.12802,1.12741,1.12744,1952,0.5194346289752769\n2030,2019/06/14 03:00:00,1.12745,1.1276899999999999,1.1269799999999999,1.12716,1616,0.48355263157891226\n2031,2019/06/14 04:00:00,1.12715,1.12737,1.12704,1.12724,811,0.5384615384615071\n2032,2019/06/14 05:00:00,1.12723,1.1273600000000001,1.12691,1.12709,1038,0.5139860139859899\n2033,2019/06/14 06:00:00,1.1270799999999999,1.1282,1.12701,1.1281299999999999,2957,0.5994236311239027\n2034,2019/06/14 07:00:00,1.1281299999999999,1.12869,1.12742,1.12837,6095,0.6062322946175173\n2035,2019/06/14 08:00:00,1.12838,1.1288799999999999,1.12774,1.1279299999999999,3914,0.6170798898071174\n2036,2019/06/14 09:00:00,1.12792,1.12792,1.12596,1.12701,4800,0.44007858546166045\n2037,2019/06/14 10:00:00,1.127,1.1271799999999998,1.12612,1.1264,3116,0.4409448818897211\n2038,2019/06/14 11:00:00,1.12639,1.12652,1.12513,1.1258700000000001,4842,0.3475298126064289\n2039,2019/06/14 12:00:00,1.12588,1.12675,1.12307,1.1231,10462,0.26005025125624326\n2040,2019/06/14 13:00:00,1.1231,1.1243299999999998,1.12309,1.12411,8005,0.26005025125624326\n2041,2019/06/14 14:00:00,1.12416,1.12455,1.12218,1.12248,7480,0.23766816143495226\n2042,2019/06/14 15:00:00,1.12249,1.12273,1.1213,1.12161,4820,0.22795698924728597\n2043,2019/06/14 16:00:00,1.12161,1.12172,1.12057,1.1208200000000001,3646,0.1993927125505943\n2044,2019/06/14 17:00:00,1.12086,1.12116,1.12021,1.12096,3251,0.2008154943934633\n2045,2019/06/14 18:00:00,1.1209799999999999,1.12135,1.12063,1.12065,1813,0.21599999999999855\n2046,2019/06/14 19:00:00,1.12065,1.12131,1.12063,1.12067,1411,0.2188449848024294\n2047,2019/06/14 20:00:00,1.12067,1.12124,1.12049,1.12114,1092,0.1439476553980373\n2048,2019/06/16 21:05:00,1.12101,1.1213600000000001,1.1209799999999999,1.1213600000000001,615,0.10795454545456967\n2049,2019/06/16 22:05:00,1.12135,1.12153,1.12133,1.12143,664,0.10592255125285835\n2050,2019/06/16 23:05:00,1.1214,1.1216899999999999,1.12137,1.12151,965,0.15223463687151215\n2051,2019/06/17,1.12155,1.12214,1.12151,1.12188,1291,0.20236530880421463\n2052,2019/06/17 01:00:00,1.12189,1.1223299999999998,1.1216899999999999,1.1223299999999998,1443,0.25403817914831334\n2053,2019/06/17 02:00:00,1.12235,1.12239,1.1219299999999999,1.12194,760,0.3406113537118215\n2054,2019/06/17 03:00:00,1.12195,1.12205,1.12184,1.12198,618,0.33404710920774516\n2055,2019/06/17 04:00:00,1.122,1.12201,1.12131,1.12164,1135,0.329238329238357\n2056,2019/06/17 05:00:00,1.12163,1.12171,1.12134,1.12162,1241,0.4200626959247987\n2057,2019/06/17 06:00:00,1.12162,1.12162,1.12043,1.12094,2968,0.39762611275966797\n2058,2019/06/17 07:00:00,1.12095,1.12131,1.12034,1.12125,4147,0.43225806451615306\n2059,2019/06/17 08:00:00,1.12125,1.1218299999999999,1.12125,1.12135,2968,0.4868804664722813\n2060,2019/06/17 09:00:00,1.12134,1.12168,1.12103,1.12114,2408,0.4575342465753068\n2061,2019/06/17 10:00:00,1.12113,1.12194,1.12105,1.12192,2497,0.5119363395225074\n2062,2019/06/17 11:00:00,1.1219299999999999,1.12303,1.12152,1.12291,3343,0.6118143459915268\n2063,2019/06/17 12:00:00,1.1229200000000001,1.12467,1.1229200000000001,1.12365,5364,0.7037037037036957\n2064,2019/06/17 13:00:00,1.12362,1.12415,1.1234600000000001,1.12381,3702,0.6958677685950363\n2065,2019/06/17 14:00:00,1.12382,1.12432,1.1220299999999999,1.12234,3574,0.5458333333333077\n2066,2019/06/17 15:00:00,1.1223299999999998,1.12354,1.12218,1.12333,3436,0.5335235378031185\n2067,2019/06/17 16:00:00,1.1233799999999998,1.12376,1.12261,1.12263,1885,0.5439330543932814\n2068,2019/06/17 17:00:00,1.1226,1.12277,1.1218,1.12186,2358,0.4942965779467312\n2069,2019/06/17 18:00:00,1.1218700000000001,1.12212,1.1213600000000001,1.12166,2266,0.49999999999997147\n2070,2019/06/17 19:00:00,1.12166,1.12194,1.12145,1.1215899999999999,1324,0.49999999999997147\n2071,2019/06/17 20:00:00,1.1215600000000001,1.1219299999999999,1.1214899999999999,1.12176,524,0.5660377358490171\n2072,2019/06/17 21:05:00,1.12184,1.1221700000000001,1.12176,1.1221299999999998,628,0.5880681818181678\n2073,2019/06/17 22:05:00,1.1221299999999998,1.12232,1.12204,1.1221,589,0.5652173913043362\n2074,2019/06/17 23:05:00,1.12209,1.12245,1.12205,1.12239,907,0.5927051671732455\n2075,2019/06/18,1.12238,1.12258,1.12216,1.12245,972,0.5844961240310038\n2076,2019/06/18 01:00:00,1.12247,1.12305,1.12245,1.12304,1867,0.5403087478559295\n2077,2019/06/18 02:00:00,1.123,1.1233799999999998,1.1229799999999999,1.12316,1301,0.40707964601768604\n2078,2019/06/18 03:00:00,1.12317,1.12324,1.12297,1.1229799999999999,709,0.40618101545253976\n2079,2019/06/18 04:00:00,1.123,1.12333,1.12293,1.1232799999999998,823,0.5751633986928352\n2080,2019/06/18 05:00:00,1.1232799999999998,1.1239,1.1231799999999998,1.12364,1818,0.6418732782369344\n2081,2019/06/18 06:00:00,1.12362,1.1237700000000002,1.12301,1.12358,2385,0.5893854748603757\n2082,2019/06/18 07:00:00,1.1235700000000002,1.12425,1.12355,1.12371,3480,0.7969230769231925\n2083,2019/06/18 08:00:00,1.12372,1.12374,1.11877,1.11896,13888,0.3412384716732385\n2084,2019/06/18 09:00:00,1.11894,1.1189799999999999,1.1181,1.11847,6024,0.31355932203388354\n2085,2019/06/18 10:00:00,1.11846,1.12096,1.11826,1.12021,4683,0.4462890625000026\n2086,2019/06/18 11:00:00,1.12022,1.12039,1.11856,1.1195700000000002,4962,0.43299999999998817\n2087,2019/06/18 12:00:00,1.11956,1.12077,1.11849,1.11982,7519,0.44271844660193993\n2088,2019/06/18 13:00:00,1.11982,1.1205399999999999,1.11952,1.11982,8855,0.43559488692232023\n2089,2019/06/18 14:00:00,1.1197700000000002,1.11979,1.11817,1.11858,9950,0.37752414398595224\n2090,2019/06/18 15:00:00,1.11859,1.12124,1.11824,1.11954,9550,0.4268391269199588\n2091,2019/06/18 16:00:00,1.11955,1.12008,1.1193799999999998,1.12008,3834,0.4111295681063157\n2092,2019/06/18 17:00:00,1.12012,1.12038,1.11901,1.11945,3720,0.41338582677165814\n2093,2019/06/18 18:00:00,1.11947,1.11964,1.11929,1.1193799999999998,2034,0.4105011933174318\n2094,2019/06/18 19:00:00,1.11941,1.11982,1.1192600000000001,1.1194,1687,0.39066339066341255\n2095,2019/06/18 20:00:00,1.1194,1.1198700000000001,1.11931,1.11933,872,0.39867659222499996\n2096,2019/06/18 21:05:00,1.11931,1.1197,1.11929,1.11954,642,0.3731728288908258\n2097,2019/06/18 22:05:00,1.11953,1.1195899999999999,1.11942,1.1194899999999999,316,0.6335766423358188\n2098,2019/06/18 23:05:00,1.1194899999999999,1.1197700000000002,1.11947,1.11975,585,0.7106918238994373\n2099,2019/06/19,1.11976,1.1202,1.11961,1.12,1826,0.6174636174636949\n2100,2019/06/19 01:00:00,1.11999,1.12006,1.1192799999999998,1.1195,2246,0.5778210116732058\n2101,2019/06/19 02:00:00,1.1195,1.11964,1.11913,1.1192799999999998,1396,0.5351239669422186\n2102,2019/06/19 03:00:00,1.11927,1.11934,1.11903,1.11929,1049,0.5242914979757779\n2103,2019/06/19 04:00:00,1.11929,1.1193799999999998,1.11868,1.1187799999999999,1116,0.6608040201005569\n2104,2019/06/19 05:00:00,1.1188,1.1193600000000001,1.1187200000000002,1.11919,1655,0.4664031620554219\n2105,2019/06/19 06:00:00,1.1192,1.11962,1.1191,1.11954,2689,0.5161290322581312\n2106,2019/06/19 07:00:00,1.11955,1.12005,1.11889,1.12,3577,0.568840579710151\n2107,2019/06/19 08:00:00,1.11999,1.12057,1.1197,1.11996,3552,0.6371951219512311\n2108,2019/06/19 09:00:00,1.11996,1.12061,1.11968,1.12024,2859,0.6230031948881571\n2109,2019/06/19 10:00:00,1.1202299999999998,1.1207,1.12005,1.12065,2932,0.6277602523658874\n2110,2019/06/19 11:00:00,1.12066,1.12075,1.12021,1.12028,2423,0.6374999999999696\n2111,2019/06/19 12:00:00,1.12029,1.12069,1.12005,1.12047,2934,0.6071428571428382\n2112,2019/06/19 13:00:00,1.1205,1.12079,1.12019,1.12037,2863,0.5975609756096991\n2113,2019/06/19 14:00:00,1.12038,1.12164,1.12006,1.1215899999999999,5061,0.6214099216709871\n2114,2019/06/19 15:00:00,1.12158,1.12196,1.1213,1.1213,3338,0.7068062827225295\n2115,2019/06/19 16:00:00,1.12131,1.12153,1.12045,1.12148,3657,0.5973451327433452\n2116,2019/06/19 17:00:00,1.1214899999999999,1.12219,1.12124,1.1218,2931,0.6614173228346403\n2117,2019/06/19 18:00:00,1.12175,1.12539,1.12175,1.12456,24163,0.8263624841571714\n2118,2019/06/19 19:00:00,1.12458,1.12471,1.12199,1.12285,8857,0.8263624841571714\n2119,2019/06/19 20:00:00,1.12284,1.12313,1.1225100000000001,1.12253,1657,0.8204456094364474\n2120,2019/06/19 21:05:00,1.12268,1.12314,1.1226399999999999,1.1230799999999999,952,0.8342857142857364\n2121,2019/06/19 22:05:00,1.12309,1.12361,1.1229799999999999,1.1235899999999999,872,0.8330935251798758\n2122,2019/06/19 23:05:00,1.12362,1.1237700000000002,1.1234,1.12353,885,0.8382978723404371\n2123,2019/06/20,1.12354,1.1257700000000002,1.12348,1.12572,4110,0.8727678571428673\n2124,2019/06/20 01:00:00,1.1257,1.12658,1.12553,1.12629,5431,0.8827160493827239\n2125,2019/06/20 02:00:00,1.12629,1.12687,1.12566,1.12669,3536,0.9005076142132012\n2126,2019/06/20 03:00:00,1.1267,1.12727,1.1264299999999998,1.12709,3502,0.9034482758620718\n2127,2019/06/20 04:00:00,1.1270799999999999,1.12721,1.12612,1.12614,1639,0.8776371308017051\n2128,2019/06/20 05:00:00,1.12614,1.12689,1.12596,1.1265399999999999,2561,0.858369098712468\n2129,2019/06/20 06:00:00,1.12655,1.12837,1.12649,1.12751,7122,0.9527638190955022\n2130,2019/06/20 07:00:00,1.12752,1.12979,1.12689,1.12974,8173,0.956115779645214\n2131,2019/06/20 08:00:00,1.12973,1.13009,1.12814,1.1289200000000001,6089,0.9398207426376752\n2132,2019/06/20 09:00:00,1.12893,1.13049,1.12857,1.13044,4877,0.9427527405603218\n2133,2019/06/20 10:00:00,1.13042,1.13058,1.12966,1.13027,3752,0.9433734939759323\n2134,2019/06/20 11:00:00,1.13026,1.1314899999999999,1.12988,1.131,5523,0.9489130434782863\n2135,2019/06/20 12:00:00,1.13101,1.13166,1.12937,1.13021,7788,0.8958554729011937\n2136,2019/06/20 13:00:00,1.13021,1.13048,1.12933,1.12955,6237,0.8902045209903313\n2137,2019/06/20 14:00:00,1.12954,1.1307200000000002,1.1285100000000001,1.12881,7984,0.7796407185629161\n2138,2019/06/20 15:00:00,1.12886,1.12935,1.1270200000000001,1.12828,5853,0.6312292358804455\n2139,2019/06/20 16:00:00,1.12826,1.12974,1.1281,1.1292,6297,0.6352683461117566\n2140,2019/06/20 17:00:00,1.12919,1.12965,1.12866,1.1294799999999998,4104,0.6185567010309683\n2141,2019/06/20 18:00:00,1.12947,1.12971,1.1286399999999999,1.12927,3281,0.642352941176486\n2142,2019/06/20 19:00:00,1.1292799999999998,1.12976,1.1289,1.1291200000000001,2508,0.6567342073897644\n2143,2019/06/20 20:00:00,1.1291200000000001,1.12926,1.12853,1.1291200000000001,1281,0.5535714285714427\n2144,2019/06/20 21:05:00,1.12927,1.1294899999999999,1.12886,1.1292799999999998,2118,0.466338259441725\n2145,2019/06/20 22:05:00,1.12929,1.12944,1.1291200000000001,1.12917,684,0.4386873920552898\n2146,2019/06/20 23:05:00,1.12917,1.12951,1.12885,1.12939,958,0.38568935427575757\n2147,2019/06/21,1.12937,1.12982,1.1292,1.12943,1720,0.4084033613445622\n2148,2019/06/21 01:00:00,1.12942,1.13063,1.12921,1.1306200000000002,2175,0.3982905982906252\n2149,2019/06/21 02:00:00,1.1306100000000001,1.13087,1.1298,1.1298,3427,0.4436229205175639\n2150,2019/06/21 03:00:00,1.12981,1.13035,1.1298,1.13016,1615,0.4469273743016829\n2151,2019/06/21 04:00:00,1.13015,1.1303299999999998,1.12929,1.12943,1181,0.44813278008295004\n2152,2019/06/21 05:00:00,1.12944,1.12991,1.1291200000000001,1.12926,1889,0.6171428571428296\n2153,2019/06/21 06:00:00,1.12926,1.12926,1.12827,1.12863,4232,0.44696969696968847\n2154,2019/06/21 07:00:00,1.1286399999999999,1.13158,1.12845,1.13113,10329,0.6512738853503126\n2155,2019/06/21 08:00:00,1.1311,1.13111,1.12996,1.13028,5778,0.6500000000000108\n2156,2019/06/21 09:00:00,1.13027,1.13057,1.12965,1.12991,3534,0.6160990712074323\n2157,2019/06/21 10:00:00,1.12991,1.13171,1.12965,1.13076,5038,0.7081604426002716\n2158,2019/06/21 11:00:00,1.13077,1.13165,1.13016,1.13163,5216,0.6985714285714256\n2159,2019/06/21 12:00:00,1.13165,1.13265,1.1313799999999998,1.13246,5456,0.7362499999999932\n2160,2019/06/21 13:00:00,1.13245,1.13339,1.13172,1.13258,6669,0.780952380952393\n2161,2019/06/21 14:00:00,1.13258,1.13306,1.13081,1.13205,9253,0.6944444444444547\n2162,2019/06/21 15:00:00,1.13206,1.13296,1.1316,1.13281,5609,0.6642246642246752\n2163,2019/06/21 16:00:00,1.13281,1.13434,1.13181,1.13404,7055,0.7052518756698906\n2164,2019/06/21 17:00:00,1.1340700000000001,1.13679,1.1339299999999999,1.1361299999999999,6868,0.766553480475392\n2165,2019/06/21 18:00:00,1.13612,1.137,1.1356,1.13685,3360,0.8048780487805005\n2166,2019/06/21 19:00:00,1.13685,1.13774,1.1364100000000001,1.1372799999999998,3254,0.8282157676348519\n2167,2019/06/21 20:00:00,1.1372799999999998,1.13733,1.13666,1.13716,1391,0.8910714285714275\n2168,2019/06/23 21:05:00,1.13705,1.13743,1.13655,1.13737,599,0.8536853685368448\n2169,2019/06/23 22:05:00,1.1373799999999998,1.13773,1.13706,1.13749,1364,0.8583599574014821\n2170,2019/06/23 23:05:00,1.1375,1.13848,1.13709,1.13846,1842,0.8962360122075236\n2171,2019/06/24,1.1383,1.1386,1.1379,1.1381299999999999,3146,0.8842224744608373\n2172,2019/06/24 01:00:00,1.1381700000000001,1.1383299999999998,1.13764,1.13772,2661,0.8588754134509415\n2173,2019/06/24 02:00:00,1.13773,1.1385299999999998,1.13753,1.13848,1823,0.8341288782816237\n2174,2019/06/24 03:00:00,1.13847,1.1385299999999998,1.13801,1.13806,1233,0.8180628272251328\n2175,2019/06/24 04:00:00,1.1380700000000001,1.13808,1.13745,1.1374600000000001,1196,0.8573388203017933\n2176,2019/06/24 05:00:00,1.1374600000000001,1.13808,1.13745,1.1377,1624,0.8573388203017933\n2177,2019/06/24 06:00:00,1.1377,1.13891,1.13758,1.1377700000000002,4742,0.8456973293768694\n2178,2019/06/24 07:00:00,1.13776,1.1384299999999998,1.1372,1.13761,5086,0.6959314775160763\n2179,2019/06/24 08:00:00,1.1376,1.13944,1.1372799999999998,1.13855,5805,0.7404021937842967\n2180,2019/06/24 09:00:00,1.1385399999999999,1.1394799999999998,1.13837,1.13936,3566,0.7023060796645852\n2181,2019/06/24 10:00:00,1.1393799999999998,1.13943,1.13878,1.1391,3066,0.7023060796645852\n2182,2019/06/24 11:00:00,1.13909,1.13981,1.13909,1.1393799999999998,3322,0.7348178137652069\n2183,2019/06/24 12:00:00,1.13937,1.1396899999999999,1.1385100000000001,1.13873,4507,0.6379310344828114\n2184,2019/06/24 13:00:00,1.13873,1.13915,1.13799,1.1384299999999998,5137,0.5170340681363171\n2185,2019/06/24 14:00:00,1.1384299999999998,1.13957,1.13789,1.13889,6089,0.5343228200371261\n2186,2019/06/24 15:00:00,1.1389,1.14004,1.1385,1.13916,5398,0.5982142857142977\n2187,2019/06/24 16:00:00,1.13917,1.13926,1.1385100000000001,1.13887,2861,0.5954631379962397\n2188,2019/06/24 17:00:00,1.13887,1.1391,1.1384,1.1390799999999999,1809,0.5833333333333471\n2189,2019/06/24 18:00:00,1.1390799999999999,1.14036,1.13904,1.1400700000000001,2248,0.7229508196721359\n2190,2019/06/24 19:00:00,1.14008,1.14008,1.13936,1.13952,2106,0.7229508196721359\n2191,2019/06/24 20:00:00,1.1394799999999998,1.13986,1.1394799999999998,1.13974,896,0.6793168880455397\n2192,2019/06/24 21:05:00,1.13975,1.13985,1.13953,1.13974,912,0.7321063394683097\n2193,2019/06/24 22:05:00,1.13973,1.13994,1.1395,1.13992,711,0.6649999999999889\n2194,2019/06/24 23:05:00,1.13994,1.13999,1.1396,1.13991,774,0.6658354114713347\n2195,2019/06/25,1.1399,1.14059,1.13962,1.1401299999999999,3507,0.7093275488069499\n2196,2019/06/25 01:00:00,1.1401299999999999,1.14099,1.14011,1.14066,4739,0.710583153347735\n2197,2019/06/25 02:00:00,1.14065,1.14067,1.1401299999999999,1.14018,2943,0.8123456790123172\n2198,2019/06/25 03:00:00,1.1402,1.14078,1.1400299999999999,1.1406100000000001,2929,0.9090909090908983\n2199,2019/06/25 04:00:00,1.14062,1.14116,1.1405399999999999,1.1409200000000002,2917,0.9333333333333251\n2200,2019/06/25 05:00:00,1.14091,1.14097,1.13915,1.13933,3897,0.6393805309734669\n2201,2019/06/25 06:00:00,1.13933,1.1404299999999998,1.1392799999999998,1.1401299999999999,5557,0.6393805309734669\n2202,2019/06/25 07:00:00,1.14014,1.1402700000000001,1.1385299999999998,1.1388,6665,0.5600775193798558\n2203,2019/06/25 08:00:00,1.13881,1.13894,1.13808,1.13848,4954,0.37471264367816537\n2204,2019/06/25 09:00:00,1.13849,1.13865,1.13771,1.13784,3759,0.34533898305084926\n2205,2019/06/25 10:00:00,1.13785,1.13865,1.13781,1.1384299999999998,3100,0.34533898305084926\n2206,2019/06/25 11:00:00,1.1384299999999998,1.1384299999999998,1.13761,1.1382,3510,0.3313008130081316\n2207,2019/06/25 12:00:00,1.13819,1.13941,1.13818,1.1393799999999998,4279,0.4359861591695882\n2208,2019/06/25 13:00:00,1.1393799999999998,1.1397899999999999,1.13871,1.13907,4320,0.4664484451718625\n2209,2019/06/25 14:00:00,1.13904,1.13983,1.13784,1.13821,8099,0.35669781931464617\n2210,2019/06/25 15:00:00,1.1382,1.13881,1.13795,1.13848,4377,0.3139534883721003\n2211,2019/06/25 16:00:00,1.13849,1.13876,1.13602,1.13625,7267,0.23773584905660672\n2212,2019/06/25 17:00:00,1.13625,1.1389200000000002,1.13431,1.13704,16088,0.20187304890741423\n2213,2019/06/25 18:00:00,1.1370200000000001,1.13774,1.13637,1.13727,5866,0.16901408450706562\n2214,2019/06/25 19:00:00,1.13726,1.13755,1.13615,1.13667,3107,0.19354838709679287\n2215,2019/06/25 20:00:00,1.13673,1.1372,1.1366,1.1366,1483,0.19354838709679287\n2216,2019/06/25 21:05:00,1.13649,1.13701,1.1363299999999998,1.13673,1295,0.20580474934038356\n2217,2019/06/25 22:05:00,1.13676,1.1369799999999999,1.1359299999999999,1.13685,1347,0.20717131474104677\n2218,2019/06/25 23:05:00,1.13685,1.13687,1.13657,1.13676,1557,0.21787709497207694\n2219,2019/06/26,1.1367399999999999,1.13719,1.136,1.13618,2633,0.23354037267079777\n2220,2019/06/26 01:00:00,1.1361700000000001,1.13619,1.13531,1.13571,2798,0.22014051522247763\n2221,2019/06/26 02:00:00,1.13573,1.13599,1.13527,1.13544,3294,0.11842105263155818\n2222,2019/06/26 03:00:00,1.13544,1.1356899999999999,1.13532,1.13551,1508,0.07202216066482378\n2223,2019/06/26 04:00:00,1.13552,1.1357,1.13523,1.13553,1127,0.07644305772231645\n2224,2019/06/26 05:00:00,1.13555,1.13626,1.13541,1.13626,1895,0.15064562410331356\n2225,2019/06/26 06:00:00,1.1362700000000001,1.13645,1.13562,1.13584,4068,0.23709369024855753\n2226,2019/06/26 07:00:00,1.13584,1.1373799999999998,1.13574,1.13639,6156,0.4685314685313944\n2227,2019/06/26 08:00:00,1.13638,1.13688,1.13543,1.13581,4538,0.4369565217390606\n2228,2019/06/26 09:00:00,1.13582,1.1366,1.13509,1.13592,6980,0.42584745762706067\n2229,2019/06/26 10:00:00,1.13591,1.1368,1.13564,1.1366399999999999,4845,0.4491869918698592\n2230,2019/06/26 11:00:00,1.13665,1.1367399999999999,1.1357700000000002,1.13596,4280,0.47526881720425873\n2231,2019/06/26 12:00:00,1.13595,1.13679,1.1354899999999999,1.1359,6527,0.4934497816593222\n2232,2019/06/26 13:00:00,1.13588,1.13628,1.13471,1.13507,6197,0.42164179104474286\n2233,2019/06/26 14:00:00,1.13503,1.13821,1.135,1.13768,6695,0.6046874999999889\n2234,2019/06/26 15:00:00,1.13764,1.13909,1.13721,1.1390799999999999,5635,0.7207890743550536\n2235,2019/06/26 16:00:00,1.13907,1.13907,1.13811,1.13824,3262,0.7251908396946306\n2236,2019/06/26 17:00:00,1.13824,1.1383,1.13742,1.13745,3024,0.6560773480662905\n2237,2019/06/26 18:00:00,1.13744,1.13757,1.13676,1.13689,2775,0.6076923076923011\n2238,2019/06/26 19:00:00,1.13689,1.13732,1.1364100000000001,1.1365,2465,0.550724637681157\n2239,2019/06/26 20:00:00,1.1365,1.13691,1.1364100000000001,1.13677,1158,0.5391891891891917\n2240,2019/06/26 21:05:00,1.1369,1.13763,1.13688,1.13742,1500,0.5257301808066753\n2241,2019/06/26 22:05:00,1.13741,1.13744,1.1372,1.13724,381,0.5494186046511653\n2242,2019/06/26 23:05:00,1.13725,1.13745,1.1372,1.13731,466,0.578625954198482\n2243,2019/06/27,1.13735,1.13739,1.13687,1.13724,1465,0.5374251497006125\n2244,2019/06/27 01:00:00,1.13723,1.13737,1.13676,1.1370200000000001,2112,0.5287187039764448\n2245,2019/06/27 02:00:00,1.137,1.13701,1.13592,1.13615,2580,0.4849315068493368\n2246,2019/06/27 03:00:00,1.13616,1.13631,1.13583,1.13588,985,0.5355521936459898\n2247,2019/06/27 04:00:00,1.13584,1.13585,1.1348799999999999,1.13524,1713,0.28596802841917335\n2248,2019/06/27 05:00:00,1.13525,1.13552,1.1347399999999999,1.1354899999999999,1669,0.14928425357871603\n2249,2019/06/27 06:00:00,1.1354899999999999,1.13596,1.1350200000000001,1.13575,4141,0.21951219512193798\n2250,2019/06/27 07:00:00,1.13574,1.13733,1.13574,1.1367200000000002,8252,0.42262895174705967\n2251,2019/06/27 08:00:00,1.13675,1.1374,1.13632,1.13711,5175,0.4815498154981357\n2252,2019/06/27 09:00:00,1.13714,1.13811,1.13662,1.1374799999999998,5376,0.5743944636677901\n2253,2019/06/27 10:00:00,1.13749,1.13802,1.1366100000000001,1.13781,5453,0.5734024179619891\n2254,2019/06/27 11:00:00,1.1378,1.13804,1.13693,1.1374799999999998,4215,0.5147347740667857\n2255,2019/06/27 12:00:00,1.1374600000000001,1.13761,1.13638,1.1366100000000001,6283,0.46453900709218193\n2256,2019/06/27 13:00:00,1.13662,1.1367399999999999,1.1356,1.13581,5251,0.40717628705146003\n2257,2019/06/27 14:00:00,1.13584,1.13734,1.1357,1.13688,5956,0.4805389221556775\n2258,2019/06/27 15:00:00,1.13689,1.13744,1.1361700000000001,1.1370799999999999,4766,0.49625187406296056\n2259,2019/06/27 16:00:00,1.1370799999999999,1.13713,1.13626,1.13658,2577,0.5677530017152527\n2260,2019/06/27 17:00:00,1.13659,1.13704,1.1364100000000001,1.13669,2270,0.5766550522648096\n2261,2019/06/27 18:00:00,1.1367,1.13729,1.1365,1.13729,1988,0.7063492063492043\n2262,2019/06/27 19:00:00,1.13731,1.13735,1.1366399999999999,1.1368200000000002,1779,0.7298387096774321\n2263,2019/06/27 20:00:00,1.13681,1.13713,1.13678,1.13687,1073,0.7035398230088631\n2264,2019/06/27 21:05:00,1.13691,1.13691,1.13667,1.13688,630,0.5552147239264387\n2265,2019/06/27 22:05:00,1.13687,1.13689,1.1367200000000002,1.13678,298,0.5454545454546024\n2266,2019/06/27 23:05:00,1.13676,1.13729,1.13675,1.13707,679,0.4965277777778318\n2267,2019/06/28,1.13707,1.1375899999999999,1.13688,1.13697,2151,0.5457413249211566\n2268,2019/06/28 01:00:00,1.137,1.1372,1.1365299999999998,1.13665,2369,0.48857142857144903\n2269,2019/06/28 02:00:00,1.1366399999999999,1.1369799999999999,1.13652,1.13683,1422,0.5777027027027656\n2270,2019/06/28 03:00:00,1.1368200000000002,1.13684,1.1364299999999998,1.1365,1061,0.7533039647577553\n2271,2019/06/28 04:00:00,1.13652,1.13666,1.1362299999999999,1.13628,1248,0.5935828877005633\n2272,2019/06/28 05:00:00,1.13628,1.13638,1.1360299999999999,1.1363,1428,0.5126903553299773\n2273,2019/06/28 06:00:00,1.1363,1.13792,1.1363,1.1378,4054,0.7264957264957618\n2274,2019/06/28 07:00:00,1.1378,1.1392200000000001,1.13778,1.13866,5666,0.8004158004158308\n2275,2019/06/28 08:00:00,1.13865,1.13916,1.1382700000000001,1.13897,3665,0.7894736842105647\n2276,2019/06/28 09:00:00,1.139,1.13931,1.13836,1.1384299999999998,4238,0.7935483870968084\n2277,2019/06/28 10:00:00,1.13842,1.1388,1.13806,1.13819,2961,0.745454545454583\n2278,2019/06/28 11:00:00,1.1382,1.1384,1.1367399999999999,1.13711,4170,0.5990259740259677\n2279,2019/06/28 12:00:00,1.13709,1.1385,1.13709,1.13849,5930,0.6054313099041461\n2280,2019/06/28 13:00:00,1.13848,1.13883,1.1376600000000001,1.13825,5467,0.6009693053311712\n2281,2019/06/28 14:00:00,1.13824,1.13891,1.13755,1.13884,7219,0.5756578947368381\n2282,2019/06/28 15:00:00,1.13883,1.1391799999999999,1.13713,1.13743,5381,0.5872274143301972\n2283,2019/06/28 16:00:00,1.13742,1.13755,1.1350200000000001,1.13585,3493,0.4424882629107883\n2284,2019/06/28 17:00:00,1.13584,1.13685,1.13552,1.13685,3618,0.44721233689204976\n2285,2019/06/28 18:00:00,1.13684,1.13776,1.1365299999999998,1.13771,2759,0.5120350109409245\n2286,2019/06/28 19:00:00,1.13771,1.13771,1.13693,1.13713,2103,0.5234899328859098\n2287,2019/06/28 20:00:00,1.13711,1.13714,1.13662,1.13693,1247,0.4072632944228287\n2288,2019/06/30 21:05:00,1.13582,1.13687,1.13582,1.1364299999999998,1714,0.25520110957004477\n2289,2019/06/30 22:05:00,1.1364100000000001,1.13707,1.13631,1.13684,1823,0.27530364372469684\n2290,2019/06/30 23:05:00,1.1368200000000002,1.13696,1.1359700000000001,1.1359700000000001,1436,0.24868421052631445\n2291,2019/07/01,1.1359700000000001,1.13636,1.13534,1.13535,2537,0.2383354350567401\n2292,2019/07/01 01:00:00,1.1353600000000001,1.1354899999999999,1.13476,1.13511,2693,0.26286509040333766\n2293,2019/07/01 02:00:00,1.1351200000000001,1.13561,1.13507,1.1351799999999999,1402,0.26490984743413243\n2294,2019/07/01 03:00:00,1.1352,1.1353,1.13491,1.13523,865,0.2244318181818397\n2295,2019/07/01 04:00:00,1.1351799999999999,1.13529,1.13476,1.1348,1168,0.2142857142857256\n2296,2019/07/01 05:00:00,1.13481,1.13485,1.1321299999999999,1.13281,4220,0.13758389261747908\n2297,2019/07/01 06:00:00,1.13283,1.1332799999999998,1.13236,1.13265,4118,0.18008784773063335\n2298,2019/07/01 07:00:00,1.13266,1.1329200000000001,1.13162,1.13209,7456,0.1624834874504938\n2299,2019/07/01 08:00:00,1.1321,1.1333,1.13198,1.13301,5291,0.09943181818180814\n2300,2019/07/01 09:00:00,1.1330200000000001,1.1333600000000001,1.13205,1.13232,3940,0.10704225352113839\n2301,2019/07/01 10:00:00,1.13231,1.13371,1.13231,1.13368,3773,0.15546218487394345\n2302,2019/07/01 11:00:00,1.1336600000000001,1.1359700000000001,1.1334899999999999,1.13476,6479,0.3918604651162827\n2303,2019/07/01 12:00:00,1.1347399999999999,1.13558,1.1342299999999998,1.13455,4451,0.377380952380958\n2304,2019/07/01 13:00:00,1.13456,1.13487,1.13334,1.1334799999999998,4527,0.354189944134082\n2305,2019/07/01 14:00:00,1.1334799999999998,1.1336899999999999,1.13211,1.13239,7043,0.3319371727748755\n2306,2019/07/01 15:00:00,1.1324,1.13246,1.13034,1.13065,5734,0.2951582867784041\n2307,2019/07/01 16:00:00,1.13063,1.1307200000000002,1.1291799999999999,1.12939,3517,0.25891341256366424\n2308,2019/07/01 17:00:00,1.1293799999999998,1.1295,1.1280700000000001,1.1283,3460,0.23959151610369356\n2309,2019/07/01 18:00:00,1.1283,1.1287200000000002,1.12816,1.12848,2653,0.24244833068362817\n2310,2019/07/01 19:00:00,1.12849,1.12886,1.1284399999999999,1.12867,1837,0.31615460852328703\n2311,2019/07/01 20:00:00,1.12865,1.1288200000000002,1.12826,1.12853,1018,0.3106134371957167\n2312,2019/07/01 21:05:00,1.12845,1.12886,1.12842,1.12877,867,0.33751306165098177\n2313,2019/07/01 22:05:00,1.12876,1.12893,1.12798,1.12886,1896,0.3010309278350515\n2314,2019/07/01 23:05:00,1.12885,1.12885,1.12855,1.12865,875,0.2966804979252984\n2315,2019/07/02,1.1286399999999999,1.1287200000000002,1.12829,1.12837,1175,0.26282722513088785\n2316,2019/07/02 01:00:00,1.12838,1.12869,1.12822,1.1282299999999998,1701,0.03396739130430277\n2317,2019/07/02 02:00:00,1.12824,1.12836,1.12748,1.12794,1442,0.030864197530823076\n2318,2019/07/02 03:00:00,1.12794,1.12828,1.12791,1.12795,736,0.03467406380023088\n2319,2019/07/02 04:00:00,1.12795,1.12895,1.12774,1.1289200000000001,1603,0.1348973607037685\n2320,2019/07/02 05:00:00,1.1289200000000001,1.12915,1.12866,1.12906,1316,0.2133333333333209\n2321,2019/07/02 06:00:00,1.12906,1.12951,1.12868,1.12909,3203,0.33258426966291627\n2322,2019/07/02 07:00:00,1.1290799999999999,1.1299,1.1285399999999999,1.12884,4836,0.4832041343668984\n2323,2019/07/02 08:00:00,1.12883,1.1294799999999998,1.1287,1.1293,3621,0.4832041343668984\n2324,2019/07/02 09:00:00,1.1293,1.1321,1.12891,1.13065,5971,0.6850393700787677\n2325,2019/07/02 10:00:00,1.1306399999999999,1.1310799999999999,1.12963,1.1298700000000002,4411,0.7050243111831556\n2326,2019/07/02 11:00:00,1.12986,1.13025,1.1294899999999999,1.12958,3248,0.6874003189792834\n2327,2019/07/02 12:00:00,1.1295899999999999,1.13015,1.12903,1.12976,3216,0.6816720257234993\n2328,2019/07/02 13:00:00,1.12979,1.13027,1.12965,1.12988,3197,0.6876971608833128\n2329,2019/07/02 14:00:00,1.12989,1.1301299999999999,1.12858,1.12943,5188,0.6097902097902237\n2330,2019/07/02 15:00:00,1.12942,1.13039,1.1293,1.13,4688,0.6294277929155524\n2331,2019/07/02 16:00:00,1.13,1.13114,1.13,1.1306200000000002,4511,0.7306122448979697\n2332,2019/07/02 17:00:00,1.1306100000000001,1.1306399999999999,1.1291200000000001,1.13009,3556,0.6524908869988187\n2333,2019/07/02 18:00:00,1.1300700000000001,1.1300700000000001,1.12873,1.1290200000000001,2744,0.6041131105398782\n2334,2019/07/02 19:00:00,1.12905,1.12965,1.12818,1.12829,3467,0.5535055350553706\n2335,2019/07/02 20:00:00,1.12828,1.12884,1.12828,1.1285100000000001,1140,0.53281853281856\n2336,2019/07/02 21:05:00,1.12856,1.1291200000000001,1.12837,1.12901,793,0.5359042553191892\n2337,2019/07/02 22:05:00,1.12901,1.12915,1.12886,1.12904,1021,0.5377483443708994\n2338,2019/07/02 23:05:00,1.12903,1.1291799999999999,1.1287200000000002,1.129,1022,0.28823529411766985\n2339,2019/07/03,1.12901,1.12939,1.12865,1.1292799999999998,1756,0.312267657992579\n2340,2019/07/03 01:00:00,1.12927,1.1294799999999998,1.1287399999999999,1.12879,2219,0.3320825515947524\n2341,2019/07/03 02:00:00,1.1288,1.12917,1.12856,1.12914,1847,0.35049504950496035\n2342,2019/07/03 03:00:00,1.12915,1.1293,1.12865,1.12867,1185,0.35177865612647197\n2343,2019/07/03 04:00:00,1.12868,1.12895,1.12857,1.12879,1180,0.4373464373464568\n2344,2019/07/03 05:00:00,1.12879,1.129,1.12846,1.1289200000000001,1189,0.39546599496221996\n2345,2019/07/03 06:00:00,1.12893,1.12894,1.12781,1.12838,3577,0.21188630490953655\n2346,2019/07/03 07:00:00,1.12839,1.1284399999999999,1.1268200000000002,1.1277,5264,0.20603015075374193\n2347,2019/07/03 08:00:00,1.1277,1.12883,1.12763,1.12881,4577,0.30402010050252254\n2348,2019/07/03 09:00:00,1.12879,1.12921,1.12828,1.12883,3866,0.4173228346457028\n2349,2019/07/03 10:00:00,1.12884,1.12995,1.1284100000000001,1.12971,2883,0.5120879120879436\n2350,2019/07/03 11:00:00,1.1297,1.12994,1.12883,1.1290799999999999,3167,0.48009367681501175\n2351,2019/07/03 12:00:00,1.12909,1.12996,1.12765,1.12822,5976,0.37500000000003064\n2352,2019/07/03 13:00:00,1.1282299999999998,1.1299299999999999,1.12794,1.12906,5563,0.3814041745731021\n2353,2019/07/03 14:00:00,1.12907,1.13111,1.1279700000000001,1.1280700000000001,8251,0.48298217179909597\n2354,2019/07/03 15:00:00,1.12806,1.1284399999999999,1.12727,1.12743,4551,0.42625368731569396\n2355,2019/07/03 16:00:00,1.12744,1.1284,1.12715,1.1280700000000001,2622,0.43005952380958073\n2356,2019/07/03 17:00:00,1.12809,1.12842,1.12766,1.12785,1162,0.4205748865356057\n2357,2019/07/03 18:00:00,1.12785,1.12806,1.1276700000000002,1.12778,798,0.42572741194491454\n2358,2019/07/03 19:00:00,1.12778,1.1280299999999999,1.12772,1.12774,511,0.42857142857146846\n2359,2019/07/03 20:00:00,1.12775,1.12786,1.12752,1.12768,862,0.46114864864869515\n2360,2019/07/03 21:05:00,1.1277,1.1280700000000001,1.1276899999999999,1.12802,307,0.5719844357976998\n2361,2019/07/03 22:05:00,1.1280299999999999,1.1287399999999999,1.12802,1.1286399999999999,698,0.5940959409594118\n2362,2019/07/03 23:05:00,1.12865,1.12879,1.12857,1.12869,669,0.5677799607072764\n2363,2019/07/04,1.12869,1.12886,1.1284299999999998,1.1286399999999999,770,0.4868421052631457\n2364,2019/07/04 01:00:00,1.12863,1.12941,1.12859,1.12939,968,0.5420743639921621\n2365,2019/07/04 02:00:00,1.1293799999999998,1.1294799999999998,1.12819,1.1283100000000001,1176,0.6438356164383082\n2366,2019/07/04 03:00:00,1.12832,1.12867,1.12815,1.12818,861,0.6380090497737024\n2367,2019/07/04 04:00:00,1.12818,1.1286,1.12814,1.1285399999999999,549,0.5046153846152782\n2368,2019/07/04 05:00:00,1.12853,1.12859,1.1282,1.1283299999999998,702,0.643137254901863\n2369,2019/07/04 06:00:00,1.12835,1.1285,1.1280700000000001,1.12832,1625,0.6406249999998862\n2370,2019/07/04 07:00:00,1.1283100000000001,1.12846,1.12791,1.12832,3030,0.5999999999998684\n2371,2019/07/04 08:00:00,1.1283299999999998,1.12895,1.12786,1.12794,2974,0.651234567901133\n2372,2019/07/04 09:00:00,1.12782,1.12855,1.1277,1.12848,2622,0.6205882352939909\n2373,2019/07/04 10:00:00,1.12847,1.12897,1.12812,1.12855,2409,0.6988950276241919\n2374,2019/07/04 11:00:00,1.1285399999999999,1.12893,1.12837,1.1286100000000001,1618,0.6803519061582298\n2375,2019/07/04 12:00:00,1.1286100000000001,1.12884,1.12821,1.12827,1824,0.5689655172412433\n2376,2019/07/04 13:00:00,1.12828,1.12828,1.1272799999999998,1.12782,2394,0.42328042328031384\n2377,2019/07/04 14:00:00,1.12782,1.12819,1.12771,1.1281299999999999,1500,0.4285714285713398\n2378,2019/07/04 15:00:00,1.1281299999999999,1.12837,1.12789,1.12818,1573,0.36249999999991067\n2379,2019/07/04 16:00:00,1.12818,1.12842,1.12804,1.1280700000000001,1044,0.41007194244594775\n2380,2019/07/04 17:00:00,1.1280700000000001,1.1283299999999998,1.1280700000000001,1.12821,437,0.4160583941604923\n2381,2019/07/04 18:00:00,1.12822,1.12848,1.12821,1.12847,354,0.4479166666666033\n2382,2019/07/04 19:00:00,1.12846,1.12853,1.12838,1.12838,357,0.4573378839590002\n2383,2019/07/04 20:00:00,1.12838,1.1285100000000001,1.12828,1.1283299999999998,954,0.46206896551719173\n2384,2019/07/04 21:05:00,1.12811,1.12855,1.12811,1.12853,259,0.4677966101694336\n2385,2019/07/04 22:05:00,1.1285100000000001,1.1287399999999999,1.12838,1.12863,594,0.4153846153845431\n2386,2019/07/04 23:05:00,1.12863,1.12863,1.1284399999999999,1.12849,491,0.4426229508196199\n2387,2019/07/05,1.1285,1.12857,1.1279299999999999,1.12796,887,0.2608695652173303\n2388,2019/07/05 01:00:00,1.12795,1.12819,1.12775,1.1279,867,0.24354243542431192\n2389,2019/07/05 02:00:00,1.12789,1.12816,1.12784,1.12814,747,0.25882352941173603\n2390,2019/07/05 03:00:00,1.1281299999999999,1.1284100000000001,1.12811,1.1282,504,0.48663101604281056\n2391,2019/07/05 04:00:00,1.12821,1.12822,1.128,1.12806,481,0.45959595959597255\n2392,2019/07/05 05:00:00,1.12805,1.12809,1.12775,1.1278700000000002,959,0.35609756097561823\n2393,2019/07/05 06:00:00,1.1278700000000002,1.12814,1.12716,1.1272799999999998,3052,0.27651515151513845\n2394,2019/07/05 07:00:00,1.1272799999999998,1.1274600000000001,1.12652,1.1267,3698,0.22256097560974333\n2395,2019/07/05 08:00:00,1.12666,1.12677,1.12609,1.12618,3787,0.16292134831457136\n2396,2019/07/05 09:00:00,1.12619,1.1264,1.12555,1.12634,2787,0.1308641975308075\n2397,2019/07/05 10:00:00,1.12632,1.12679,1.12588,1.12614,3482,0.21198156682021357\n2398,2019/07/05 11:00:00,1.12614,1.12645,1.12568,1.1258299999999999,3138,0.20323325635100956\n2399,2019/07/05 12:00:00,1.12584,1.12701,1.12321,1.12438,11766,0.1743375174337559\n2400,2019/07/05 13:00:00,1.12438,1.12438,1.1214899999999999,1.1218700000000001,8411,0.1406074240719905\n2401,2019/07/05 14:00:00,1.12188,1.12252,1.1207,1.1221700000000001,6708,0.13631406761177942\n2402,2019/07/05 15:00:00,1.12218,1.12225,1.12077,1.12153,5372,0.13904338153503856\n2403,2019/07/05 16:00:00,1.12152,1.12232,1.1214600000000001,1.1218299999999999,2907,0.14569536423841173\n2404,2019/07/05 17:00:00,1.12184,1.12208,1.12154,1.12181,1964,0.1214528944381309\n2405,2019/07/05 18:00:00,1.12182,1.12214,1.12171,1.12214,1625,0.12899543378994266\n2406,2019/07/05 19:00:00,1.12215,1.12278,1.12212,1.12263,1874,0.1934426229508057\n2407,2019/07/05 20:00:00,1.1226200000000002,1.12274,1.1224100000000001,1.12265,803,0.20211515863689603\n2408,2019/07/07 21:05:00,1.12214,1.12284,1.12214,1.1226200000000002,48,0.22087378640775815\n2409,2019/07/07 22:05:00,1.12263,1.12281,1.12249,1.12279,267,0.23303457106272862\n2410,2019/07/07 23:05:00,1.12278,1.1228200000000002,1.12259,1.1226200000000002,311,0.2513736263736201\n2411,2019/07/08,1.1226399999999999,1.12291,1.12192,1.1220299999999999,692,0.2\n2412,2019/07/08 01:00:00,1.12206,1.12277,1.12201,1.12269,581,0.2053691275167778\n2413,2019/07/08 02:00:00,1.12266,1.12266,1.12229,1.1225399999999999,360,0.21945701357463698\n2414,2019/07/08 03:00:00,1.12253,1.12289,1.1225,1.12277,360,0.4095563139931461\n2415,2019/07/08 04:00:00,1.12277,1.1230799999999999,1.12247,1.1230799999999999,803,0.5889830508473851\n2416,2019/07/08 05:00:00,1.12307,1.12323,1.12263,1.12294,1331,0.6135458167330149\n2417,2019/07/08 06:00:00,1.12294,1.12294,1.12192,1.12198,2880,0.4666666666666243\n2418,2019/07/08 07:00:00,1.12199,1.12323,1.12194,1.12313,3721,0.5116279069766916\n2419,2019/07/08 08:00:00,1.1231200000000001,1.1234,1.1228200000000002,1.12309,2726,0.5267605633802386\n2420,2019/07/08 09:00:00,1.12309,1.12323,1.1225399999999999,1.12276,2653,0.3855799373039958\n2421,2019/07/08 10:00:00,1.12275,1.12296,1.12144,1.1214600000000001,2253,0.2867132867132415\n2422,2019/07/08 11:00:00,1.12147,1.1221,1.1213,1.1220299999999999,2413,0.2783251231526765\n2423,2019/07/08 12:00:00,1.12204,1.12265,1.12124,1.12229,4087,0.3597430406851775\n2424,2019/07/08 13:00:00,1.12228,1.1224,1.12143,1.12182,3902,0.3583690987123898\n2425,2019/07/08 14:00:00,1.12181,1.1220700000000001,1.12093,1.12145,3597,0.35909090909086067\n2426,2019/07/08 15:00:00,1.12145,1.12184,1.12068,1.12077,2566,0.3397849462365062\n2427,2019/07/08 16:00:00,1.12079,1.12165,1.12066,1.12143,1865,0.33832976445391527\n2428,2019/07/08 17:00:00,1.12144,1.12204,1.1214,1.1214899999999999,1421,0.3602484472049172\n2429,2019/07/08 18:00:00,1.1215,1.12165,1.1211200000000001,1.12115,1217,0.3169734151328915\n2430,2019/07/08 19:00:00,1.12114,1.12127,1.12086,1.12087,1307,0.2799999999999432\n2431,2019/07/08 20:00:00,1.12087,1.1213899999999999,1.1207799999999999,1.1213799999999998,666,0.3385300668150638\n2432,2019/07/08 21:05:00,1.12133,1.12174,1.1212600000000001,1.12155,532,0.34725274725269256\n2433,2019/07/08 22:05:00,1.12155,1.12168,1.12143,1.12143,714,0.32191780821911975\n2434,2019/07/08 23:05:00,1.1214,1.12158,1.12135,1.12148,452,0.337320574162653\n2435,2019/07/09,1.12147,1.12184,1.1213,1.12152,1010,0.49262536873151413\n2436,2019/07/09 01:00:00,1.12152,1.12165,1.12093,1.1213,1190,0.4613259668507849\n2437,2019/07/09 02:00:00,1.1212799999999998,1.12135,1.12113,1.12117,683,0.3720930232557762\n2438,2019/07/09 03:00:00,1.12116,1.12134,1.12109,1.12111,669,0.3672131147540558\n2439,2019/07/09 04:00:00,1.1211200000000001,1.1217700000000002,1.1210200000000001,1.12172,799,0.5081967213114933\n2440,2019/07/09 05:00:00,1.12172,1.12175,1.12133,1.12133,714,0.5535714285714682\n2441,2019/07/09 06:00:00,1.12134,1.1213899999999999,1.12059,1.1207,2936,0.44034090909092394\n2442,2019/07/09 07:00:00,1.1207200000000002,1.12131,1.12046,1.12075,4297,0.35582822085893084\n2443,2019/07/09 08:00:00,1.12074,1.1209799999999999,1.1195700000000002,1.11982,3176,0.29974160206721046\n2444,2019/07/09 09:00:00,1.11985,1.12043,1.11929,1.12035,2686,0.29820051413883425\n2445,2019/07/09 10:00:00,1.12034,1.12083,1.12011,1.12017,2333,0.3520782396088346\n2446,2019/07/09 11:00:00,1.12019,1.12025,1.11954,1.12025,2396,0.2529002320185806\n2447,2019/07/09 12:00:00,1.12026,1.1209,1.12002,1.12043,4016,0.35080645161292867\n2448,2019/07/09 13:00:00,1.12042,1.12096,1.12012,1.12066,4140,0.36437246963563646\n2449,2019/07/09 14:00:00,1.1206399999999999,1.12105,1.12001,1.1205200000000002,3969,0.3374741200828581\n2450,2019/07/09 15:00:00,1.1205200000000002,1.1210799999999999,1.12045,1.12087,3132,0.36971046770602184\n2451,2019/07/09 16:00:00,1.12087,1.1210200000000001,1.11995,1.12081,2506,0.3326653306613331\n2452,2019/07/09 17:00:00,1.1208200000000001,1.12135,1.12074,1.12104,2054,0.3768939393939466\n2453,2019/07/09 18:00:00,1.1210200000000001,1.12115,1.12074,1.12075,1301,0.32635983263595275\n2454,2019/07/09 19:00:00,1.12074,1.12083,1.12028,1.1206399999999999,1516,0.2977099236640859\n2455,2019/07/09 20:00:00,1.12067,1.1207799999999999,1.1204100000000001,1.12075,557,0.34666666666662255\n2456,2019/07/09 21:05:00,1.12068,1.12085,1.1206,1.12075,523,0.36711711711707173\n2457,2019/07/09 22:05:00,1.12074,1.12079,1.1205200000000002,1.12055,333,0.449035812672118\n2458,2019/07/09 23:05:00,1.1205399999999999,1.12061,1.12038,1.1204,575,0.46704871060166225\n2459,2019/07/10,1.1204,1.1204,1.12015,1.1203100000000001,959,0.3704819277107971\n2460,2019/07/10 01:00:00,1.12032,1.12049,1.12019,1.12038,994,0.4647887323942913\n2461,2019/07/10 02:00:00,1.12037,1.12099,1.12024,1.12096,1038,0.4349442379181162\n2462,2019/07/10 03:00:00,1.12096,1.12096,1.12056,1.12068,693,0.42205323193907235\n2463,2019/07/10 04:00:00,1.12066,1.12077,1.12061,1.12071,566,0.41975308641962894\n2464,2019/07/10 05:00:00,1.1207,1.1210200000000001,1.12066,1.12093,988,0.4679245283018447\n2465,2019/07/10 06:00:00,1.12093,1.12175,1.1203100000000001,1.12122,4073,0.6099071207430031\n2466,2019/07/10 07:00:00,1.12121,1.1216899999999999,1.1208,1.12142,3683,0.5655172413792824\n2467,2019/07/10 08:00:00,1.12143,1.12266,1.1214,1.12249,4133,0.6744186046511562\n2468,2019/07/10 09:00:00,1.12248,1.12289,1.12191,1.12235,4559,0.7802197802197964\n2469,2019/07/10 10:00:00,1.12234,1.12234,1.1215700000000002,1.12162,2749,0.713567839196031\n2470,2019/07/10 11:00:00,1.12162,1.12179,1.1211799999999998,1.12131,2686,0.6441860465116183\n2471,2019/07/10 12:00:00,1.12131,1.1255,1.12122,1.12496,9756,0.8171500630516804\n2472,2019/07/10 13:00:00,1.12497,1.12529,1.1236700000000002,1.12389,6700,0.8318356867779247\n2473,2019/07/10 14:00:00,1.12388,1.1256899999999999,1.12353,1.12525,7656,0.8493827160493553\n2474,2019/07/10 15:00:00,1.12521,1.12626,1.12424,1.12595,5264,0.8578088578088362\n2475,2019/07/10 16:00:00,1.12595,1.12638,1.12523,1.12589,3322,0.8512195121950987\n2476,2019/07/10 17:00:00,1.12588,1.1260299999999999,1.12526,1.12537,3290,0.8512195121950987\n2477,2019/07/10 18:00:00,1.1254,1.12614,1.12506,1.12523,3105,0.8331374853113797\n2478,2019/07/10 19:00:00,1.12524,1.12568,1.12522,1.12531,1785,0.8280871670701971\n2479,2019/07/10 20:00:00,1.12531,1.12537,1.1249799999999999,1.12504,882,0.8234501347708257\n2480,2019/07/10 21:05:00,1.1252,1.12558,1.1249,1.12547,1278,0.8197146562904868\n2481,2019/07/10 22:05:00,1.12547,1.12596,1.1252799999999998,1.1257,605,0.8047752808988263\n2482,2019/07/10 23:05:00,1.12572,1.1259299999999999,1.12551,1.12579,753,0.7982583454281068\n2483,2019/07/11,1.12582,1.12647,1.12579,1.12608,1815,0.8519040902679091\n2484,2019/07/11 01:00:00,1.12605,1.12636,1.12576,1.12614,1486,0.8974739970281957\n2485,2019/07/11 02:00:00,1.12618,1.12725,1.12611,1.12725,1883,0.8235294117646625\n2486,2019/07/11 03:00:00,1.12724,1.12805,1.12717,1.12779,2076,0.8535031847133323\n2487,2019/07/11 04:00:00,1.12779,1.12786,1.12741,1.12753,1135,0.8681055155875321\n2488,2019/07/11 05:00:00,1.12753,1.12786,1.12691,1.12695,1251,0.7439024390244048\n2489,2019/07/11 06:00:00,1.12693,1.12724,1.1266399999999999,1.1269200000000001,2681,0.6894117647058717\n2490,2019/07/11 07:00:00,1.12693,1.12779,1.12678,1.12766,3887,0.7249999999999895\n2491,2019/07/11 08:00:00,1.12765,1.12778,1.12713,1.12732,2693,0.7505567928730301\n2492,2019/07/11 09:00:00,1.12732,1.12733,1.1266,1.1266,2706,0.6713147410358571\n2493,2019/07/11 10:00:00,1.12658,1.12737,1.12637,1.1271200000000001,3234,0.6752475247525165\n2494,2019/07/11 11:00:00,1.12713,1.12782,1.1264299999999998,1.1276899999999999,3926,0.7005758157389843\n2495,2019/07/11 12:00:00,1.1277,1.12853,1.12618,1.12671,9658,0.6873920552677357\n2496,2019/07/11 13:00:00,1.1267200000000002,1.12722,1.12513,1.12568,5108,0.5818713450292707\n2497,2019/07/11 14:00:00,1.1256899999999999,1.1260299999999999,1.12504,1.12523,5636,0.5383411580594938\n2498,2019/07/11 15:00:00,1.12522,1.12621,1.12507,1.1260299999999999,3615,0.5535168195718936\n2499,2019/07/11 16:00:00,1.12604,1.1261,1.12447,1.1254,3864,0.4368000000000287\n2500,2019/07/11 17:00:00,1.12544,1.12578,1.12453,1.12514,5174,0.35412844036701385\n2501,2019/07/11 18:00:00,1.12513,1.12585,1.12509,1.1257,2915,0.3623188405797527\n2502,2019/07/11 19:00:00,1.12573,1.12605,1.12543,1.12565,2184,0.4214559386973564\n2503,2019/07/11 20:00:00,1.12561,1.12561,1.12506,1.1252799999999998,976,0.413533834586522\n2504,2019/07/11 21:05:00,1.1253,1.12574,1.12524,1.1254600000000001,1312,0.363265306122496\n2505,2019/07/11 22:05:00,1.1254600000000001,1.12584,1.1254600000000001,1.12558,1068,0.3760000000000455\n2506,2019/07/11 23:05:00,1.1255899999999999,1.12561,1.12489,1.12494,724,0.37301587301589856\n2507,2019/07/12,1.12493,1.12598,1.12489,1.12581,1426,0.4299610894941787\n2508,2019/07/12 01:00:00,1.12582,1.1264399999999999,1.12575,1.12639,1686,0.43106796116504653\n2509,2019/07/12 02:00:00,1.12638,1.1267,1.1262299999999998,1.1265399999999999,1260,0.3977528089887693\n2510,2019/07/12 03:00:00,1.1265399999999999,1.12717,1.12638,1.12715,1300,0.5788113695090431\n2511,2019/07/12 04:00:00,1.12716,1.12733,1.1269200000000001,1.12709,1117,0.6091370558375443\n2512,2019/07/12 05:00:00,1.1270799999999999,1.1274600000000001,1.12696,1.1272799999999998,1409,0.6041131105398383\n2513,2019/07/12 06:00:00,1.1273,1.12731,1.12663,1.1271200000000001,2977,0.6491712707182206\n2514,2019/07/12 07:00:00,1.12714,1.12744,1.12614,1.12645,4024,0.5849056603773338\n2515,2019/07/12 08:00:00,1.1264399999999999,1.12697,1.12611,1.12618,3767,0.5738095238095015\n2516,2019/07/12 09:00:00,1.12625,1.12668,1.12542,1.12564,4552,0.471215351812368\n2517,2019/07/12 10:00:00,1.12565,1.12596,1.12533,1.12575,2392,0.5011337868480548\n2518,2019/07/12 11:00:00,1.12571,1.1260299999999999,1.12456,1.12469,3841,0.4199218749999743\n2519,2019/07/12 12:00:00,1.12466,1.12533,1.1237700000000002,1.12447,6022,0.35283993115317225\n2520,2019/07/12 13:00:00,1.12449,1.1249,1.12406,1.1248200000000002,5191,0.3912213740458028\n2521,2019/07/12 14:00:00,1.1248200000000002,1.12519,1.12436,1.12514,4282,0.3817829457364253\n2522,2019/07/12 15:00:00,1.12513,1.12588,1.12491,1.12533,3832,0.4081632653061351\n2523,2019/07/12 16:00:00,1.12526,1.12675,1.12523,1.1267200000000002,2690,0.4683333333333271\n2524,2019/07/12 17:00:00,1.12673,1.12697,1.12632,1.1267200000000002,2072,0.44521739130435295\n2525,2019/07/12 18:00:00,1.12671,1.12737,1.1266100000000001,1.12715,2237,0.467445742904849\n2526,2019/07/12 19:00:00,1.12714,1.1272799999999998,1.1268200000000002,1.12706,1475,0.45563139931739616\n2527,2019/07/12 20:00:00,1.1271,1.12713,1.12669,1.1269799999999999,722,0.47173144876322154\n2528,2019/07/14 21:05:00,1.12647,1.12732,1.12624,1.12714,1529,0.48063380281689144\n2529,2019/07/14 22:05:00,1.12716,1.1274,1.12711,1.12713,495,0.49040139616053396\n2530,2019/07/14 23:05:00,1.1271200000000001,1.12719,1.1268799999999999,1.1270799999999999,794,0.5332068311194876\n2531,2019/07/15,1.12709,1.12743,1.1269799999999999,1.12737,1099,0.5627306273062336\n2532,2019/07/15 01:00:00,1.12737,1.1274,1.1264,1.12689,2020,0.5775193798449518\n2533,2019/07/15 02:00:00,1.1269200000000001,1.1271200000000001,1.12639,1.1270200000000001,2248,0.6803652968036066\n2534,2019/07/15 03:00:00,1.12701,1.1272799999999998,1.12637,1.12719,1594,0.6885964912280196\n2535,2019/07/15 04:00:00,1.12719,1.12741,1.1268,1.12719,1136,0.6772727272726955\n2536,2019/07/15 05:00:00,1.1271799999999998,1.12737,1.12696,1.1272799999999998,823,0.6172506738544042\n2537,2019/07/15 06:00:00,1.12725,1.12778,1.1270200000000001,1.1274600000000001,2235,0.5630769230768884\n2538,2019/07/15 07:00:00,1.12745,1.1283299999999998,1.1271,1.12798,3537,0.6033519553071978\n2539,2019/07/15 08:00:00,1.1279700000000001,1.12801,1.12693,1.12725,3491,0.5253731343282927\n2540,2019/07/15 09:00:00,1.12724,1.12811,1.12686,1.1278700000000002,2290,0.528409090909025\n2541,2019/07/15 10:00:00,1.12788,1.12835,1.12768,1.12772,2117,0.5785123966941831\n2542,2019/07/15 11:00:00,1.12774,1.12775,1.12611,1.1263,2626,0.41885964912275664\n2543,2019/07/15 12:00:00,1.1263,1.1273,1.12622,1.12652,3366,0.4084821428571096\n2544,2019/07/15 13:00:00,1.12652,1.1270799999999999,1.12622,1.1267200000000002,3155,0.43058823529410123\n2545,2019/07/15 14:00:00,1.12671,1.1267200000000002,1.1255600000000001,1.12612,3613,0.3404710920770719\n2546,2019/07/15 15:00:00,1.1261299999999999,1.12622,1.1252799999999998,1.12584,2991,0.36384439359262327\n2547,2019/07/15 16:00:00,1.12585,1.12635,1.12573,1.12588,1879,0.3830734966591907\n2548,2019/07/15 17:00:00,1.1258700000000001,1.1259299999999999,1.12535,1.12563,1085,0.3326226012793131\n2549,2019/07/15 18:00:00,1.12564,1.12596,1.1255899999999999,1.12586,885,0.31808278867102113\n2550,2019/07/15 19:00:00,1.12585,1.12588,1.1255700000000002,1.12565,930,0.31670281995663474\n2551,2019/07/15 20:00:00,1.1256899999999999,1.1258700000000001,1.12561,1.12571,639,0.2500000000000132\n2552,2019/07/15 21:05:00,1.12576,1.1261700000000001,1.12576,1.12596,2088,0.2025316455696594\n2553,2019/07/15 22:05:00,1.12598,1.12629,1.12594,1.1261,585,0.23589743589745663\n2554,2019/07/15 23:05:00,1.12611,1.12618,1.12594,1.12595,511,0.21983914209117675\n2555,2019/07/16,1.12599,1.12627,1.1257,1.12579,991,0.1753926701571157\n2556,2019/07/16 01:00:00,1.12579,1.12608,1.1254899999999999,1.12582,1815,0.2723577235773154\n2557,2019/07/16 02:00:00,1.12581,1.12626,1.1257,1.12625,971,0.3219696969697906\n2558,2019/07/16 03:00:00,1.12624,1.1263100000000001,1.12591,1.12594,629,0.33457249070643785\n2559,2019/07/16 04:00:00,1.1259299999999999,1.12602,1.12582,1.12596,644,0.4245283018869308\n2560,2019/07/16 05:00:00,1.12596,1.12605,1.12574,1.12579,830,0.47692307692326613\n2561,2019/07/16 06:00:00,1.12579,1.12614,1.1253,1.1256,2273,0.37872340425546186\n2562,2019/07/16 07:00:00,1.1255899999999999,1.12579,1.12449,1.1248200000000002,3304,0.32014388489218626\n2563,2019/07/16 08:00:00,1.12484,1.12487,1.1235600000000001,1.1244299999999998,4393,0.2336956521739557\n2564,2019/07/16 09:00:00,1.1244399999999999,1.12453,1.1230799999999999,1.1231200000000001,3557,0.20772946859904107\n2565,2019/07/16 10:00:00,1.12313,1.12324,1.12173,1.1223,3877,0.15664845173042788\n2566,2019/07/16 11:00:00,1.12228,1.12258,1.1219299999999999,1.12214,3004,0.10789980732178979\n2567,2019/07/16 12:00:00,1.12215,1.1223,1.12087,1.12189,5760,0.07177814029367117\n2568,2019/07/16 13:00:00,1.12189,1.1221700000000001,1.12116,1.12175,4076,0.07177814029367117\n2569,2019/07/16 14:00:00,1.12175,1.12238,1.12071,1.12235,4291,0.08668730650153575\n2570,2019/07/16 15:00:00,1.12234,1.12239,1.1210799999999999,1.1211,2683,0.09105431309903926\n2571,2019/07/16 16:00:00,1.12109,1.12209,1.12087,1.1212,3764,0.06200317965022635\n2572,2019/07/16 17:00:00,1.12119,1.12196,1.12026,1.12096,3718,0.049635036496323635\n2573,2019/07/16 18:00:00,1.12096,1.1210799999999999,1.12016,1.12063,2706,0.049562682215716254\n2574,2019/07/16 19:00:00,1.12061,1.12119,1.12038,1.12087,1959,0.06122448979590384\n2575,2019/07/16 20:00:00,1.12087,1.12103,1.1206399999999999,1.1208799999999999,884,0.052132701421795796\n2576,2019/07/16 21:05:00,1.1210200000000001,1.1212,1.12087,1.12104,846,0.08787346221440885\n2577,2019/07/16 22:05:00,1.12111,1.12122,1.12101,1.12103,480,0.10878661087868188\n2578,2019/07/16 23:05:00,1.12103,1.1212600000000001,1.1209799999999999,1.12113,533,0.12814645308927833\n2579,2019/07/17,1.12114,1.12119,1.12065,1.1211200000000001,1475,0.16716417910452508\n2580,2019/07/17 01:00:00,1.1211200000000001,1.12147,1.12099,1.12125,1342,0.23140495867774658\n2581,2019/07/17 02:00:00,1.12124,1.1213799999999998,1.12074,1.12119,1679,0.29787234042561234\n2582,2019/07/17 03:00:00,1.1211799999999998,1.12145,1.12095,1.12131,946,0.3148788927336996\n2583,2019/07/17 04:00:00,1.1213,1.12153,1.1212600000000001,1.12152,805,0.3376623376624937\n2584,2019/07/17 05:00:00,1.12152,1.1217,1.1213899999999999,1.12155,945,0.38056680161955914\n2585,2019/07/17 06:00:00,1.12155,1.12155,1.11994,1.12021,2722,0.2533692722372784\n2586,2019/07/17 07:00:00,1.1202,1.12125,1.12019,1.12068,4239,0.3032258064517053\n2587,2019/07/17 08:00:00,1.12069,1.12143,1.1206399999999999,1.12101,3072,0.35220125786168793\n2588,2019/07/17 09:00:00,1.1210200000000001,1.12196,1.1210200000000001,1.12165,2898,0.4277777777778343\n2589,2019/07/17 10:00:00,1.12166,1.12188,1.12122,1.12181,2403,0.4277777777778343\n2590,2019/07/17 11:00:00,1.12182,1.1221700000000001,1.12163,1.12171,1971,0.4462365591398562\n2591,2019/07/17 12:00:00,1.12172,1.1218,1.12087,1.12113,3573,0.36771300448436317\n2592,2019/07/17 13:00:00,1.12111,1.12205,1.12109,1.1220299999999999,3278,0.39870689655180175\n2593,2019/07/17 14:00:00,1.12201,1.12265,1.12144,1.12249,3797,0.49898167006116095\n2594,2019/07/17 15:00:00,1.12247,1.12324,1.1223100000000001,1.12307,3502,0.5287356321839687\n2595,2019/07/17 16:00:00,1.12305,1.12332,1.12238,1.1224100000000001,2613,0.5623762376238165\n2596,2019/07/17 17:00:00,1.12242,1.12273,1.1222299999999998,1.12265,1359,0.5399610136452473\n2597,2019/07/17 18:00:00,1.12266,1.12307,1.1221299999999998,1.12224,2106,0.5519125683060456\n2598,2019/07/17 19:00:00,1.1222299999999998,1.1225399999999999,1.12188,1.12248,1789,0.5134649910233875\n2599,2019/07/17 20:00:00,1.12245,1.12249,1.12219,1.1223100000000001,1089,0.694174757281607\n2600,2019/07/17 21:05:00,1.12237,1.12293,1.12229,1.12277,1024,0.7236842105263632\n2601,2019/07/17 22:05:00,1.12278,1.1228200000000002,1.12263,1.12268,575,0.7123287671233474\n2602,2019/07/17 23:05:00,1.12268,1.12284,1.12263,1.1227,634,0.6744186046512135\n2603,2019/07/18,1.12268,1.12385,1.12253,1.12374,1936,0.7269076305221265\n2604,2019/07/18 01:00:00,1.12373,1.1240299999999999,1.12323,1.12333,2719,0.7207392197125487\n2605,2019/07/18 02:00:00,1.12333,1.1239,1.12327,1.12386,1202,0.8540145985401562\n2606,2019/07/18 03:00:00,1.1238700000000001,1.12412,1.12372,1.12389,1196,0.8529411764705994\n2607,2019/07/18 04:00:00,1.1239,1.12396,1.12358,1.1235899999999999,700,0.7955801104972454\n2608,2019/07/18 05:00:00,1.12361,1.1240700000000001,1.12355,1.12392,1216,0.757097791798119\n2609,2019/07/18 06:00:00,1.12391,1.12435,1.12333,1.12374,2835,0.7242339832868767\n2610,2019/07/18 07:00:00,1.12373,1.12421,1.12347,1.1238700000000001,4616,0.7558139534883623\n2611,2019/07/18 08:00:00,1.12386,1.12414,1.12354,1.12391,3661,0.7533333333333185\n2612,2019/07/18 09:00:00,1.12391,1.12395,1.12286,1.12315,3234,0.658892128279832\n2613,2019/07/18 10:00:00,1.12316,1.1232799999999998,1.12048,1.1212600000000001,7563,0.38898450946639535\n2614,2019/07/18 11:00:00,1.12125,1.12277,1.12094,1.12192,4712,0.3389199255120583\n2615,2019/07/18 12:00:00,1.12191,1.1225,1.1211799999999998,1.12163,6785,0.3389199255120583\n2616,2019/07/18 13:00:00,1.12164,1.1219,1.1212600000000001,1.12164,4907,0.33644859813080624\n2617,2019/07/18 14:00:00,1.12166,1.12232,1.12129,1.12178,4610,0.2596566523604946\n2618,2019/07/18 15:00:00,1.1217700000000002,1.12293,1.1214899999999999,1.1227200000000002,3441,0.3222003929273088\n2619,2019/07/18 16:00:00,1.12269,1.12283,1.1220299999999999,1.12238,2400,0.3222003929273088\n2620,2019/07/18 17:00:00,1.12239,1.1236700000000002,1.12219,1.1234,2455,0.39579684763573053\n2621,2019/07/18 18:00:00,1.12341,1.12693,1.1233,1.12677,7849,0.6251415628538955\n2622,2019/07/18 19:00:00,1.12678,1.128,1.12639,1.12752,7081,0.6639344262294903\n2623,2019/07/18 20:00:00,1.1274600000000001,1.12782,1.12721,1.12754,1244,0.669546436285092\n2624,2019/07/18 21:05:00,1.12762,1.1279299999999999,1.12741,1.1279299999999999,481,0.6734258271077799\n2625,2019/07/18 22:05:00,1.12794,1.12816,1.12399,1.12542,4967,0.5023041474654358\n2626,2019/07/18 23:05:00,1.12541,1.1260700000000001,1.1253,1.1260700000000001,1800,0.529983792544569\n2627,2019/07/19,1.12601,1.12679,1.12584,1.12605,3025,0.6797752808988724\n2628,2019/07/19 01:00:00,1.12605,1.12645,1.12588,1.12634,2502,0.6797752808988724\n2629,2019/07/19 02:00:00,1.1263299999999998,1.12673,1.12614,1.1267200000000002,1485,0.68795620437956\n2630,2019/07/19 03:00:00,1.1267200000000002,1.12678,1.12611,1.12622,1289,0.6874999999999962\n2631,2019/07/19 04:00:00,1.1262299999999998,1.12634,1.12579,1.12591,1147,0.6553930530164535\n2632,2019/07/19 05:00:00,1.12592,1.12626,1.12544,1.12563,1297,0.6142322097378217\n2633,2019/07/19 06:00:00,1.12564,1.1264,1.12544,1.1258299999999999,3115,0.6192236598890896\n2634,2019/07/19 07:00:00,1.12582,1.1265100000000001,1.12561,1.1264299999999998,4039,0.5916749256689682\n2635,2019/07/19 08:00:00,1.1264299999999998,1.12646,1.12499,1.12509,3000,0.36375838926172677\n2636,2019/07/19 09:00:00,1.12507,1.12519,1.1235600000000001,1.1238,3787,0.20998719590268083\n2637,2019/07/19 10:00:00,1.12381,1.1242,1.1230200000000001,1.12381,3310,0.19640718562873477\n2638,2019/07/19 11:00:00,1.12379,1.12388,1.12316,1.12317,2833,0.18567961165049365\n2639,2019/07/19 12:00:00,1.1231799999999998,1.12323,1.12166,1.1225100000000001,4155,0.21346469622331146\n2640,2019/07/19 13:00:00,1.12252,1.1234,1.1221299999999998,1.1233899999999999,3941,0.23482428115015663\n2641,2019/07/19 14:00:00,1.1234,1.12384,1.12199,1.12212,5739,0.1944444444444656\n2642,2019/07/19 15:00:00,1.12214,1.1224299999999998,1.1213899999999999,1.12201,4683,0.17708333333334708\n2643,2019/07/19 16:00:00,1.12201,1.1228799999999999,1.12143,1.12284,3599,0.19738751814225008\n2644,2019/07/19 17:00:00,1.12283,1.12293,1.12222,1.12238,2882,0.19825072886301404\n2645,2019/07/19 18:00:00,1.12237,1.12247,1.12032,1.12184,7080,0.1611374407583234\n2646,2019/07/19 19:00:00,1.12184,1.1221299999999998,1.12148,1.12182,2456,0.1681087762670286\n2647,2019/07/19 20:00:00,1.12184,1.12229,1.1214600000000001,1.12175,1286,0.16974169741702164\n2648,2019/07/21 21:05:00,1.12133,1.12194,1.12133,1.12162,679,0.15582822085893383\n2649,2019/07/21 22:05:00,1.12164,1.12184,1.12151,1.12179,946,0.16865869853921917\n2650,2019/07/21 23:05:00,1.1217700000000002,1.12181,1.1214,1.12172,866,0.2045088566828134\n2651,2019/07/22,1.12173,1.1219700000000001,1.121,1.12113,1809,0.2295345104334501\n2652,2019/07/22 01:00:00,1.1211200000000001,1.1214,1.1207200000000002,1.1213899999999999,2595,0.21966205837180247\n2653,2019/07/22 02:00:00,1.12137,1.1218,1.1213,1.12171,1439,0.3382624768946989\n2654,2019/07/22 03:00:00,1.12172,1.1219700000000001,1.1214600000000001,1.1217700000000002,1145,0.338262476894726\n2655,2019/07/22 04:00:00,1.1217700000000002,1.12205,1.12153,1.12175,990,0.2993890020367283\n2656,2019/07/22 05:00:00,1.12173,1.12196,1.1213899999999999,1.12179,1120,0.3303370786517659\n2657,2019/07/22 06:00:00,1.1218,1.12235,1.12116,1.12225,3013,0.3051948051948629\n2658,2019/07/22 07:00:00,1.12226,1.1223299999999998,1.1212799999999998,1.12192,3913,0.29759299781185883\n2659,2019/07/22 08:00:00,1.1219,1.12199,1.12148,1.1217,3145,0.5093632958802106\n2660,2019/07/22 09:00:00,1.12171,1.12194,1.12125,1.12165,2488,0.4689655172414453\n2661,2019/07/22 10:00:00,1.12166,1.1224,1.12158,1.12216,2682,0.5220125786163904\n2662,2019/07/22 11:00:00,1.1221299999999998,1.12216,1.12066,1.12079,2967,0.41813602015118506\n2663,2019/07/22 12:00:00,1.1208,1.12194,1.12067,1.12175,3702,0.41813602015118506\n2664,2019/07/22 13:00:00,1.12174,1.12249,1.12153,1.12234,3472,0.5011337868481304\n2665,2019/07/22 14:00:00,1.1223299999999998,1.12245,1.12129,1.12216,3807,0.5012224938875657\n2666,2019/07/22 15:00:00,1.12215,1.12237,1.12131,1.12137,2654,0.5380577427821676\n2667,2019/07/22 16:00:00,1.1213899999999999,1.12194,1.12117,1.1218,1796,0.4647887323943874\n2668,2019/07/22 17:00:00,1.12179,1.12196,1.1214600000000001,1.1218,1410,0.441176470588243\n2669,2019/07/22 18:00:00,1.1218299999999999,1.12184,1.12104,1.12105,1748,0.37967914438504957\n2670,2019/07/22 19:00:00,1.12101,1.12129,1.12058,1.12107,2243,0.3497536945812956\n2671,2019/07/22 20:00:00,1.12091,1.12095,1.12061,1.12087,859,0.2994186046512043\n2672,2019/07/22 21:05:00,1.12083,1.12093,1.1206399999999999,1.1208,505,0.2994186046512043\n2673,2019/07/22 22:05:00,1.1208,1.12084,1.12058,1.1208,494,0.29428571428576017\n2674,2019/07/22 23:05:00,1.1208,1.1208200000000001,1.12035,1.12039,742,0.29428571428576017\n2675,2019/07/23,1.1204,1.12076,1.12029,1.12042,1899,0.18387096774197478\n2676,2019/07/23 01:00:00,1.12042,1.12043,1.1193799999999998,1.11992,2142,0.18446601941750573\n2677,2019/07/23 02:00:00,1.11991,1.12006,1.1197,1.11988,1065,0.18446601941750573\n2678,2019/07/23 03:00:00,1.11989,1.11998,1.11909,1.1194600000000001,1357,0.006349206349247077\n2679,2019/07/23 04:00:00,1.11947,1.1194899999999999,1.11894,1.1191799999999998,1214,0.006535947712460511\n2680,2019/07/23 05:00:00,1.11917,1.1194,1.11885,1.11889,1314,0.006349206349247077\n2681,2019/07/23 06:00:00,1.1188799999999999,1.11916,1.1185,1.1189,2597,0.005952380952419502\n2682,2019/07/23 07:00:00,1.1189,1.11954,1.11838,1.11929,3728,0.09895833333333816\n2683,2019/07/23 08:00:00,1.1192799999999998,1.11929,1.11806,1.11827,3107,0.10160427807487679\n2684,2019/07/23 09:00:00,1.11828,1.11828,1.1175700000000002,1.11765,2682,0.1007957559681868\n2685,2019/07/23 10:00:00,1.11766,1.11824,1.11754,1.1181,3056,0.10000000000001168\n2686,2019/07/23 11:00:00,1.11808,1.1184399999999999,1.11714,1.11724,3370,0.13181818181818872\n2687,2019/07/23 12:00:00,1.11725,1.1174899999999999,1.1167799999999999,1.11685,3394,0.12340425531915035\n2688,2019/07/23 13:00:00,1.11686,1.1169200000000001,1.11511,1.1159999999999999,4543,0.09446254071661592\n2689,2019/07/23 14:00:00,1.11602,1.1165200000000002,1.11486,1.1148799999999999,4132,0.09162717219589407\n2690,2019/07/23 15:00:00,1.11485,1.11574,1.11471,1.11556,3223,0.10412926391383129\n2691,2019/07/23 16:00:00,1.1155700000000002,1.11575,1.11493,1.11503,2061,0.10573476702510735\n2692,2019/07/23 17:00:00,1.1150200000000001,1.11572,1.1147799999999999,1.11532,2927,0.11523437500001736\n2693,2019/07/23 18:00:00,1.11532,1.1153600000000001,1.11476,1.11499,2189,0.11823647294590872\n2694,2019/07/23 19:00:00,1.1149799999999999,1.1152799999999998,1.1146399999999999,1.11484,1975,0.11752988047810509\n2695,2019/07/23 20:00:00,1.11484,1.1152,1.11455,1.1150799999999998,1186,0.12394957983194922\n2696,2019/07/23 21:05:00,1.11505,1.11552,1.11505,1.11515,1032,0.11572052401749741\n2697,2019/07/23 22:05:00,1.11516,1.1153,1.11506,1.11513,455,0.12441314553993485\n2698,2019/07/23 23:05:00,1.11514,1.11516,1.11493,1.11505,450,0.13589743589746392\n2699,2019/07/24,1.11503,1.1151799999999998,1.11438,1.1148,2073,0.12387387387388525\n2700,2019/07/24 01:00:00,1.11481,1.1149799999999999,1.11429,1.11455,1697,0.08905852417304669\n2701,2019/07/24 02:00:00,1.11457,1.1146200000000002,1.11429,1.1145,1014,0.09803921568629892\n2702,2019/07/24 03:00:00,1.11449,1.11463,1.11429,1.1143299999999998,824,0.18848167539264032\n2703,2019/07/24 04:00:00,1.1143399999999999,1.1145,1.11424,1.11449,535,0.2105263157894395\n2704,2019/07/24 05:00:00,1.1145,1.11473,1.11405,1.11473,971,0.297979797979751\n2705,2019/07/24 06:00:00,1.1147200000000002,1.11531,1.11466,1.1151799999999998,1992,0.4549019607842765\n2706,2019/07/24 07:00:00,1.11517,1.11551,1.11266,1.11385,7647,0.29565217391301957\n2707,2019/07/24 08:00:00,1.11384,1.11428,1.1134700000000002,1.11381,4953,0.2969432314410182\n2708,2019/07/24 09:00:00,1.1138,1.11438,1.11352,1.1138,3744,0.320175438596469\n2709,2019/07/24 10:00:00,1.11381,1.1153899999999999,1.1138,1.11537,3157,0.45072992700727776\n2710,2019/07/24 11:00:00,1.11538,1.11548,1.1139700000000001,1.1140700000000001,3453,0.4266666666666481\n2711,2019/07/24 12:00:00,1.11405,1.1146399999999999,1.1138700000000001,1.11414,3931,0.41869158878502893\n2712,2019/07/24 13:00:00,1.11415,1.11532,1.114,1.11485,4459,0.4949152542372925\n2713,2019/07/24 14:00:00,1.11484,1.11554,1.114,1.1142,4131,0.56216216216217\n2714,2019/07/24 15:00:00,1.1142299999999998,1.1145200000000002,1.11385,1.11409,3062,0.5561497326203115\n2715,2019/07/24 16:00:00,1.11408,1.1150200000000001,1.11388,1.11447,1994,0.5924713584287923\n2716,2019/07/24 17:00:00,1.11448,1.11458,1.11394,1.1140299999999999,2428,0.5918032786885221\n2717,2019/07/24 18:00:00,1.1140299999999999,1.11405,1.1133899999999999,1.11354,1569,0.5469696969697008\n2718,2019/07/24 19:00:00,1.11353,1.11363,1.11325,1.11363,1675,0.5348101265822951\n2719,2019/07/24 20:00:00,1.1135899999999999,1.1139700000000001,1.1135,1.11396,991,0.5164473684210865\n2720,2019/07/24 21:05:00,1.11391,1.1143399999999999,1.11385,1.11411,1180,0.7788235294117831\n2721,2019/07/24 22:05:00,1.11411,1.11429,1.11405,1.11409,708,0.7788235294117831\n2722,2019/07/24 23:05:00,1.1141,1.11424,1.11394,1.11417,691,0.7535211267605733\n2723,2019/07/25,1.11415,1.11417,1.11341,1.1135899999999999,1917,0.5820105820106175\n2724,2019/07/25 01:00:00,1.1136,1.11409,1.11332,1.11381,1584,0.5582010582010887\n2725,2019/07/25 02:00:00,1.1138,1.11385,1.1134700000000002,1.1135,938,0.5733695652174213\n2726,2019/07/25 03:00:00,1.11352,1.11356,1.11335,1.1135,1012,0.4583333333333066\n2727,2019/07/25 04:00:00,1.1135,1.11355,1.11338,1.11341,509,0.41724137931033584\n2728,2019/07/25 05:00:00,1.11341,1.1136,1.11327,1.1135,666,0.4329896907216243\n2729,2019/07/25 06:00:00,1.11352,1.11368,1.11287,1.11303,2123,0.2906574394463666\n2730,2019/07/25 07:00:00,1.11306,1.11343,1.11246,1.11274,3411,0.25454545454545086\n2731,2019/07/25 08:00:00,1.11274,1.11337,1.11218,1.11287,2811,0.2772277227722736\n2732,2019/07/25 09:00:00,1.1128799999999999,1.11301,1.11249,1.1128200000000001,1869,0.2906574394463442\n2733,2019/07/25 10:00:00,1.11283,1.11483,1.1128200000000001,1.1139299999999999,3760,0.5308924485125358\n2734,2019/07/25 11:00:00,1.11391,1.11615,1.1112799999999998,1.11137,8047,0.4766763848396117\n2735,2019/07/25 12:00:00,1.1113899999999999,1.11606,1.1101,1.1154,15036,0.4067164179104309\n2736,2019/07/25 13:00:00,1.11541,1.11861,1.11522,1.11806,14661,0.5553435114503732\n2737,2019/07/25 14:00:00,1.11804,1.11873,1.11574,1.11599,7159,0.5898709036742623\n2738,2019/07/25 15:00:00,1.11598,1.11608,1.1154600000000001,1.1154600000000001,4397,0.5789473684210401\n2739,2019/07/25 16:00:00,1.1154600000000001,1.11564,1.11321,1.11332,5353,0.47482014388487803\n2740,2019/07/25 17:00:00,1.11331,1.11446,1.11261,1.11446,3256,0.4572748267898314\n2741,2019/07/25 18:00:00,1.11448,1.1150799999999998,1.11428,1.11438,2387,0.48199853049227276\n2742,2019/07/25 19:00:00,1.11436,1.11501,1.11429,1.1144100000000001,1889,0.48401486988846987\n2743,2019/07/25 20:00:00,1.11443,1.11475,1.11429,1.1146399999999999,769,0.49575944487277257\n2744,2019/07/25 21:05:00,1.11456,1.1148,1.11455,1.11466,477,0.5138778747026113\n2745,2019/07/25 22:05:00,1.1146399999999999,1.1147,1.11449,1.1146,556,0.523002421307505\n2746,2019/07/25 23:05:00,1.11461,1.11471,1.11443,1.11443,441,0.5208667736757661\n2747,2019/07/26,1.11443,1.1149200000000001,1.1142,1.1146,1762,0.44043321299639915\n2748,2019/07/26 01:00:00,1.11461,1.11499,1.11458,1.1147,1438,0.4378769601930195\n2749,2019/07/26 02:00:00,1.11469,1.11497,1.11468,1.1148200000000001,943,0.5105485232067585\n2750,2019/07/26 03:00:00,1.11479,1.11506,1.11448,1.11485,846,0.24123711340202617\n2751,2019/07/26 04:00:00,1.11486,1.11489,1.1146200000000002,1.11471,509,0.22198731501054839\n2752,2019/07/26 05:00:00,1.1147,1.11479,1.11432,1.1145399999999999,1118,0.2210526315789085\n2753,2019/07/26 06:00:00,1.1145100000000001,1.11467,1.11391,1.11447,2299,0.3608247422679948\n2754,2019/07/26 07:00:00,1.11446,1.11446,1.11329,1.11341,4413,0.35836177474396497\n2755,2019/07/26 08:00:00,1.11338,1.11394,1.11315,1.11354,3405,0.17551020408161563\n2756,2019/07/26 09:00:00,1.11353,1.11469,1.11352,1.11414,1803,0.3687500000000022\n2757,2019/07/26 10:00:00,1.11415,1.1142,1.11297,1.11311,2323,0.31466666666666243\n2758,2019/07/26 11:00:00,1.11312,1.11345,1.11297,1.11343,1755,0.3054054054053811\n2759,2019/07/26 12:00:00,1.11345,1.11438,1.11251,1.11329,6317,0.4095427435387423\n2760,2019/07/26 13:00:00,1.1133,1.11414,1.11268,1.11304,5107,0.413306451612866\n2761,2019/07/26 14:00:00,1.11305,1.11363,1.1115700000000002,1.11266,6173,0.3268206039076074\n2762,2019/07/26 15:00:00,1.11265,1.11268,1.11116,1.1120700000000001,3966,0.2964824120602821\n2763,2019/07/26 16:00:00,1.11205,1.11245,1.1112,1.11215,2892,0.2964824120602821\n2764,2019/07/26 17:00:00,1.1121299999999998,1.11261,1.11186,1.1124,2086,0.31506849315069224\n2765,2019/07/26 18:00:00,1.1124100000000001,1.11289,1.11239,1.11253,1375,0.34640522875815905\n2766,2019/07/26 19:00:00,1.11251,1.11291,1.1123299999999998,1.11236,1184,0.3627118644067839\n2767,2019/07/26 20:00:00,1.11238,1.1132,1.11236,1.11273,980,0.42041522491349065\n2768,2019/07/28 21:05:00,1.11219,1.1130799999999998,1.11219,1.11306,429,0.45590994371482313\n2769,2019/07/28 22:05:00,1.11303,1.1132,1.11297,1.11315,432,0.4802259887005614\n2770,2019/07/28 23:05:00,1.11315,1.11322,1.11291,1.11291,436,0.3922413793103613\n2771,2019/07/29,1.11291,1.11372,1.11283,1.11361,1421,0.4967880085653134\n2772,2019/07/29 01:00:00,1.11361,1.11385,1.1135,1.1135700000000002,1012,0.5104166666666653\n2773,2019/07/29 02:00:00,1.11358,1.11358,1.11301,1.11315,1136,0.3897435897436142\n2774,2019/07/29 03:00:00,1.11315,1.11319,1.11283,1.11285,923,0.37254901960786124\n2775,2019/07/29 04:00:00,1.11286,1.11286,1.11253,1.11265,649,0.4648318042813248\n2776,2019/07/29 05:00:00,1.11264,1.1128200000000001,1.11253,1.11268,883,0.5314685314685401\n2777,2019/07/29 06:00:00,1.11267,1.11271,1.11214,1.11222,2079,0.4676923076923052\n2778,2019/07/29 07:00:00,1.1122299999999998,1.1124,1.1117700000000001,1.11196,2601,0.3930635838150348\n2779,2019/07/29 08:00:00,1.1119700000000001,1.11247,1.11166,1.11227,2303,0.34226190476194057\n2780,2019/07/29 09:00:00,1.11227,1.11271,1.1120299999999999,1.11238,2355,0.38920454545457556\n2781,2019/07/29 10:00:00,1.11236,1.1128200000000001,1.11208,1.11238,2238,0.35628742514976147\n2782,2019/07/29 11:00:00,1.11238,1.11238,1.1113600000000001,1.11186,2979,0.30591259640109564\n2783,2019/07/29 12:00:00,1.1118700000000001,1.11245,1.1112600000000001,1.11227,3976,0.2893401015228907\n2784,2019/07/29 13:00:00,1.11229,1.11306,1.11174,1.1126200000000002,4758,0.3870246085011422\n2785,2019/07/29 14:00:00,1.11261,1.11382,1.11256,1.11315,4312,0.42795698924736236\n2786,2019/07/29 15:00:00,1.1131799999999998,1.1143399999999999,1.1127799999999999,1.11428,3468,0.47222222222225896\n2787,2019/07/29 16:00:00,1.11426,1.11426,1.11378,1.11398,1600,0.5230769230769531\n2788,2019/07/29 17:00:00,1.11396,1.11427,1.1138700000000001,1.11418,999,0.5456621004566685\n2789,2019/07/29 18:00:00,1.11415,1.11485,1.11391,1.11466,1792,0.6373390557940195\n2790,2019/07/29 19:00:00,1.11466,1.11506,1.11442,1.1147,2248,0.6529774127310373\n2791,2019/07/29 20:00:00,1.11467,1.11471,1.11432,1.11439,761,0.6943231441048578\n2792,2019/07/29 21:05:00,1.11439,1.11463,1.11419,1.11449,192,0.7327188940092433\n2793,2019/07/29 22:05:00,1.1145100000000001,1.11465,1.1144100000000001,1.11446,168,0.7488038277512281\n2794,2019/07/29 23:05:00,1.11447,1.11447,1.11415,1.11417,263,0.6880952380952388\n2795,2019/07/30,1.11412,1.11429,1.1139700000000001,1.11409,624,0.6510538641686356\n2796,2019/07/30 01:00:00,1.1141,1.11425,1.11329,1.1137299999999999,1001,0.6572104018912084\n2797,2019/07/30 02:00:00,1.11371,1.11436,1.11369,1.11417,606,0.6762589928057117\n2798,2019/07/30 03:00:00,1.11414,1.11436,1.11404,1.1142299999999998,517,0.6207865168538816\n2799,2019/07/30 04:00:00,1.11424,1.11424,1.11361,1.1136700000000002,942,0.4489164086686685\n2800,2019/07/30 05:00:00,1.11368,1.11391,1.11324,1.11325,1621,0.3019480519480143\n2801,2019/07/30 06:00:00,1.1132600000000001,1.11415,1.11325,1.11353,3206,0.35240963855418583\n2802,2019/07/30 07:00:00,1.11356,1.11455,1.1131799999999998,1.11432,5556,0.4126984126983428\n2803,2019/07/30 08:00:00,1.11432,1.1149,1.11416,1.11463,3545,0.3746478873239179\n2804,2019/07/30 09:00:00,1.1146399999999999,1.11473,1.11391,1.1145,3417,0.3119777158774031\n2805,2019/07/30 10:00:00,1.11449,1.11523,1.11437,1.1145100000000001,2800,0.4060150375939347\n2806,2019/07/30 11:00:00,1.1145100000000001,1.1152799999999998,1.11438,1.11507,3330,0.42710997442447807\n2807,2019/07/30 12:00:00,1.1150799999999998,1.1159299999999999,1.11429,1.1153600000000001,5979,0.4967602591792208\n2808,2019/07/30 13:00:00,1.11537,1.11538,1.11417,1.11493,5095,0.5122494432071081\n2809,2019/07/30 14:00:00,1.11493,1.11507,1.11376,1.11376,4410,0.4872881355931849\n2810,2019/07/30 15:00:00,1.11376,1.11507,1.11376,1.11473,3456,0.5693069306930555\n2811,2019/07/30 16:00:00,1.11471,1.1154700000000002,1.11458,1.11515,2658,0.5981524249422615\n2812,2019/07/30 17:00:00,1.11517,1.11552,1.11489,1.1152799999999998,1734,0.6027397260273848\n2813,2019/07/30 18:00:00,1.11527,1.11605,1.11523,1.11562,2335,0.707589285714256\n2814,2019/07/30 19:00:00,1.11556,1.11586,1.11538,1.11575,1419,0.771289537712859\n2815,2019/07/30 20:00:00,1.1157700000000002,1.1157700000000002,1.11534,1.11551,901,0.749360613810695\n2816,2019/07/30 21:05:00,1.1153899999999999,1.11569,1.11534,1.11542,864,0.7354651162790709\n2817,2019/07/30 22:05:00,1.11543,1.11578,1.1154,1.11569,795,0.7138364779874085\n2818,2019/07/30 23:05:00,1.11571,1.11581,1.11563,1.11565,579,0.7770270270270386\n2819,2019/07/31,1.11566,1.1158700000000001,1.11531,1.11531,1471,0.6549295774648412\n2820,2019/07/31 01:00:00,1.11532,1.11543,1.11475,1.11525,2357,0.540298507462719\n2821,2019/07/31 02:00:00,1.1152600000000001,1.11545,1.11513,1.1152600000000001,1172,0.44866920152095874\n2822,2019/07/31 03:00:00,1.11525,1.11555,1.11523,1.11537,842,0.49042145593872044\n2823,2019/07/31 04:00:00,1.11538,1.11551,1.11531,1.1154899999999999,616,0.5818181818182057\n2824,2019/07/31 05:00:00,1.11548,1.1157299999999999,1.1154,1.11566,1045,0.6198347107438025\n2825,2019/07/31 06:00:00,1.11566,1.11616,1.11542,1.11543,3458,0.624489795918364\n2826,2019/07/31 07:00:00,1.1154,1.11563,1.11484,1.11521,3425,0.49664429530202897\n2827,2019/07/31 08:00:00,1.11519,1.11552,1.11427,1.1144,3488,0.31456953642389124\n2828,2019/07/31 09:00:00,1.1144,1.1148799999999999,1.1143100000000001,1.11455,2801,0.31456953642389124\n2829,2019/07/31 10:00:00,1.11457,1.11475,1.11438,1.11463,2463,0.3187919463087796\n2830,2019/07/31 11:00:00,1.1146399999999999,1.1150799999999998,1.11442,1.11499,2067,0.38670694864051763\n2831,2019/07/31 12:00:00,1.11499,1.11524,1.1143100000000001,1.11505,3291,0.3868194842407803\n2832,2019/07/31 13:00:00,1.11507,1.11513,1.11381,1.11414,4832,0.33333333333340814\n2833,2019/07/31 14:00:00,1.11415,1.11415,1.11306,1.11335,5714,0.29099307159356763\n2834,2019/07/31 15:00:00,1.11334,1.11379,1.11258,1.11293,5537,0.29647058823533395\n2835,2019/07/31 16:00:00,1.11294,1.11294,1.11201,1.11277,2956,0.258333333333353\n2836,2019/07/31 17:00:00,1.11283,1.11381,1.11271,1.11361,3397,0.36086175942550097\n2837,2019/07/31 18:00:00,1.11366,1.11381,1.10639,1.10846,24524,0.1690496215307012\n2838,2019/07/31 19:00:00,1.10845,1.1103,1.10656,1.10693,12970,0.15338474721509301\n2839,2019/07/31 20:00:00,1.10693,1.10771,1.10598,1.10761,2276,0.11505922165820719\n2840,2019/07/31 21:05:00,1.10774,1.10801,1.1069200000000001,1.10752,1750,0.14384748700173133\n2841,2019/07/31 22:05:00,1.10753,1.10792,1.1072799999999998,1.1077700000000001,990,0.1513217866909729\n2842,2019/07/31 23:05:00,1.10776,1.10791,1.10686,1.10711,1367,0.14574187884108808\n2843,2019/08/01,1.10712,1.10714,1.10333,1.1041100000000001,6256,0.11126005361930226\n2844,2019/08/01 01:00:00,1.10412,1.10512,1.1037,1.1048799999999999,4535,0.09115832762166168\n2845,2019/08/01 02:00:00,1.10489,1.10505,1.10437,1.1049,2378,0.08170391061451705\n2846,2019/08/01 03:00:00,1.10489,1.105,1.10425,1.10453,1573,0.0839311334289733\n2847,2019/08/01 04:00:00,1.1045200000000002,1.1052899999999999,1.10433,1.1052799999999998,1178,0.10830860534123159\n2848,2019/08/01 05:00:00,1.1052899999999999,1.10534,1.10463,1.10514,1984,0.1157088122605287\n2849,2019/08/01 06:00:00,1.10513,1.10524,1.1034,1.10412,4412,0.11013858497446302\n2850,2019/08/01 07:00:00,1.1041100000000001,1.1047200000000001,1.10321,1.10323,5452,0.049117421335377526\n2851,2019/08/01 08:00:00,1.10322,1.1047799999999999,1.1031600000000001,1.10469,3672,0.10263929618764538\n2852,2019/08/01 09:00:00,1.1046799999999999,1.1049799999999999,1.10376,1.1039,4065,0.12820512820509009\n2853,2019/08/01 10:00:00,1.10389,1.1041299999999998,1.1030200000000001,1.10332,4242,0.12534818941500545\n2854,2019/08/01 11:00:00,1.10333,1.10414,1.10265,1.1033899999999999,5448,0.08402203856746451\n2855,2019/08/01 12:00:00,1.10338,1.10409,1.10266,1.10294,5773,0.08402203856746451\n2856,2019/08/01 13:00:00,1.10293,1.10463,1.10266,1.10425,6406,0.1558265582655517\n2857,2019/08/01 14:00:00,1.10428,1.10619,1.10428,1.10575,9989,0.50092421441771\n2858,2019/08/01 15:00:00,1.10576,1.10693,1.10558,1.1060299999999998,6506,0.5609756097560651\n2859,2019/08/01 16:00:00,1.10602,1.10694,1.1058,1.10679,3278,0.5616883116882838\n2860,2019/08/01 17:00:00,1.10679,1.10955,1.10637,1.1082299999999998,15000,0.7017341040462337\n2861,2019/08/01 18:00:00,1.10822,1.1088200000000001,1.10753,1.10847,12446,0.6913875598086064\n2862,2019/08/01 19:00:00,1.10848,1.1093899999999999,1.10792,1.10924,7367,0.7094594594594419\n2863,2019/08/01 20:00:00,1.1092,1.10932,1.1083,1.10845,2600,0.8235294117646991\n2864,2019/08/01 21:05:00,1.10818,1.10851,1.1080299999999998,1.10829,1013,0.8150064683052649\n2865,2019/08/01 22:05:00,1.1083,1.10836,1.10742,1.10794,1470,0.7582017010935397\n2866,2019/08/01 23:05:00,1.1079,1.10827,1.10775,1.10786,1587,0.7521793275217731\n2867,2019/08/02,1.10785,1.10962,1.10779,1.10885,5729,0.8553240740740511\n2868,2019/08/02 01:00:00,1.10886,1.1091600000000001,1.10853,1.10886,6417,0.8934624697336534\n2869,2019/08/02 02:00:00,1.10885,1.10944,1.10693,1.10748,6022,0.7554240631163572\n2870,2019/08/02 03:00:00,1.10748,1.10769,1.10704,1.10735,2962,0.7416666666666522\n2871,2019/08/02 04:00:00,1.10735,1.10837,1.10731,1.1082100000000001,2480,0.7155963302752125\n2872,2019/08/02 05:00:00,1.1082,1.10836,1.10768,1.10792,2852,0.6892230576440921\n2873,2019/08/02 06:00:00,1.10788,1.10893,1.10788,1.10858,5363,0.70960187353628\n2874,2019/08/02 07:00:00,1.10861,1.1114700000000002,1.10814,1.11131,10675,0.707201889020058\n2875,2019/08/02 08:00:00,1.1112799999999998,1.11129,1.10944,1.1095700000000002,7441,0.707201889020058\n2876,2019/08/02 09:00:00,1.10955,1.11025,1.10951,1.10969,4818,0.6860759493670845\n2877,2019/08/02 10:00:00,1.1097,1.10974,1.10876,1.10953,4798,0.6265895953757169\n2878,2019/08/02 11:00:00,1.10952,1.11065,1.10952,1.11032,5001,0.6813778256189541\n2879,2019/08/02 12:00:00,1.11032,1.11066,1.10779,1.10847,13429,0.608445297504794\n2880,2019/08/02 13:00:00,1.10849,1.11038,1.10811,1.11001,13483,0.608445297504794\n2881,2019/08/02 14:00:00,1.11001,1.11071,1.10953,1.11024,10009,0.5659574468085155\n2882,2019/08/02 15:00:00,1.1102299999999998,1.11142,1.1097700000000001,1.11123,7098,0.596439169139469\n2883,2019/08/02 16:00:00,1.11122,1.11153,1.11049,1.1113899999999999,4263,0.7026378896882532\n2884,2019/08/02 17:00:00,1.11143,1.1116,1.11037,1.1106200000000002,4038,0.6951934349355345\n2885,2019/08/02 18:00:00,1.11063,1.1113,1.11053,1.11104,4382,0.6687898089172113\n2886,2019/08/02 19:00:00,1.11104,1.11113,1.11069,1.11093,3931,0.6687898089172113\n2887,2019/08/02 20:00:00,1.11093,1.11093,1.11036,1.11051,1007,0.6149802890933204\n2888,2019/08/04 21:05:00,1.11032,1.11127,1.11027,1.1108,1904,0.450909090909111\n2889,2019/08/04 22:05:00,1.1108,1.11091,1.1104100000000001,1.11077,1031,0.450909090909111\n2890,2019/08/04 23:05:00,1.1107799999999999,1.11087,1.1106,1.11074,604,0.450909090909111\n2891,2019/08/05,1.11069,1.11322,1.1106200000000002,1.11253,4393,0.6802816901408719\n2892,2019/08/05 01:00:00,1.11253,1.11299,1.11188,1.11217,7861,0.6332794830371886\n2893,2019/08/05 02:00:00,1.11216,1.11236,1.11117,1.1122100000000001,6658,0.7577519379845363\n2894,2019/08/05 03:00:00,1.1122,1.11306,1.1122,1.11253,3350,0.7866894197952553\n2895,2019/08/05 04:00:00,1.1125200000000002,1.11315,1.11227,1.11271,2239,0.777580071174411\n2896,2019/08/05 05:00:00,1.11271,1.11306,1.1123299999999998,1.1125200000000002,2796,0.7454175152749868\n2897,2019/08/05 06:00:00,1.11253,1.11306,1.11166,1.11211,6046,0.6489945155393778\n2898,2019/08/05 07:00:00,1.11211,1.1134899999999999,1.11138,1.11296,7789,0.6527545909850191\n2899,2019/08/05 08:00:00,1.11297,1.1147,1.1129200000000001,1.11463,5820,0.7111111111111564\n2900,2019/08/05 09:00:00,1.1146200000000002,1.11541,1.1141299999999998,1.11485,6213,0.7370417193426455\n2901,2019/08/05 10:00:00,1.11483,1.117,1.1147799999999999,1.117,5017,0.8091603053435424\n2902,2019/08/05 11:00:00,1.11701,1.1180299999999999,1.11663,1.1179299999999999,6193,0.830092118730829\n2903,2019/08/05 12:00:00,1.11794,1.11839,1.11713,1.11766,4887,0.8361303060217397\n2904,2019/08/05 13:00:00,1.11765,1.11842,1.11697,1.1177700000000002,5985,0.8236434108527393\n2905,2019/08/05 14:00:00,1.11776,1.11996,1.11776,1.11849,8902,0.8086225026288404\n2906,2019/08/05 15:00:00,1.1185,1.1197,1.11789,1.11963,7072,0.8086225026288404\n2907,2019/08/05 16:00:00,1.11962,1.12127,1.11931,1.12105,6529,0.8929604628737008\n2908,2019/08/05 17:00:00,1.12105,1.12115,1.12036,1.1204,4741,0.885211995863525\n2909,2019/08/05 18:00:00,1.12039,1.12068,1.11991,1.12025,4391,0.8444666001994231\n2910,2019/08/05 19:00:00,1.12024,1.12061,1.11933,1.11964,5349,0.7983034872761727\n2911,2019/08/05 20:00:00,1.11964,1.12037,1.11941,1.12022,1395,0.8521126760563339\n2912,2019/08/05 21:05:00,1.12025,1.12166,1.11982,1.12163,1560,0.8868821292775675\n2913,2019/08/05 22:05:00,1.12164,1.12278,1.12153,1.12273,3368,0.8859060402684533\n2914,2019/08/05 23:05:00,1.1227200000000002,1.12447,1.12263,1.12416,3465,0.8957055214723918\n2915,2019/08/06,1.12412,1.12493,1.12391,1.12424,5204,0.8842412451361852\n2916,2019/08/06 01:00:00,1.1242299999999998,1.1242299999999998,1.12232,1.1225399999999999,7152,0.7435424354243582\n2917,2019/08/06 02:00:00,1.12253,1.12313,1.12247,1.12274,3043,0.7347328244274816\n2918,2019/08/06 03:00:00,1.12273,1.12284,1.12093,1.1211799999999998,2851,0.6483516483516414\n2919,2019/08/06 04:00:00,1.12116,1.1211799999999998,1.11896,1.12022,6490,0.4999999999999909\n2920,2019/08/06 05:00:00,1.12024,1.1207,1.11964,1.1196700000000002,3797,0.4999999999999909\n2921,2019/08/06 06:00:00,1.1196700000000002,1.12116,1.11966,1.12036,6761,0.45022421524661926\n2922,2019/08/06 07:00:00,1.12036,1.12184,1.1196700000000002,1.12137,8511,0.48182586644123526\n2923,2019/08/06 08:00:00,1.1213799999999998,1.1213899999999999,1.11973,1.11986,6151,0.5008787346221304\n2924,2019/08/06 09:00:00,1.11984,1.12049,1.11943,1.12008,3946,0.5135135135135022\n2925,2019/08/06 10:00:00,1.12011,1.12022,1.11925,1.1202,3175,0.5053191489361658\n2926,2019/08/06 11:00:00,1.12019,1.12021,1.1182,1.11843,4251,0.3994565217391228\n2927,2019/08/06 12:00:00,1.1184399999999999,1.11875,1.1177,1.1179299999999999,4699,0.3157389635316684\n2928,2019/08/06 13:00:00,1.11794,1.11834,1.11671,1.1173,7359,0.16460905349792887\n2929,2019/08/06 14:00:00,1.11727,1.1187200000000002,1.1171200000000001,1.11819,6630,0.15767634854773582\n2930,2019/08/06 15:00:00,1.11824,1.1205399999999999,1.1182299999999998,1.1196,7310,0.33839918946301506\n2931,2019/08/06 16:00:00,1.1195700000000002,1.1205100000000001,1.11929,1.11972,4395,0.33839918946301506\n2932,2019/08/06 17:00:00,1.11971,1.12045,1.1194,1.11941,4062,0.4009603841536624\n2933,2019/08/06 18:00:00,1.11941,1.12006,1.1190200000000001,1.11999,4542,0.49554896142435234\n2934,2019/08/06 19:00:00,1.12001,1.12006,1.1192600000000001,1.11973,3402,0.49554896142435234\n2935,2019/08/06 20:00:00,1.11972,1.1206399999999999,1.11969,1.11992,1432,0.5043731778425784\n2936,2019/08/06 21:05:00,1.11989,1.12042,1.11989,1.12026,1101,0.44983818770227324\n2937,2019/08/06 22:05:00,1.12032,1.12043,1.12006,1.12006,607,0.45072697899839825\n2938,2019/08/06 23:05:00,1.12006,1.12055,1.12006,1.1205,1031,0.48419301164726025\n2939,2019/08/07,1.1205100000000001,1.12171,1.12038,1.12086,3654,0.5822603719599463\n2940,2019/08/07 01:00:00,1.12086,1.1219299999999999,1.1205100000000001,1.12131,5112,0.6964285714285766\n2941,2019/08/07 02:00:00,1.12131,1.12143,1.1205399999999999,1.12091,5562,0.757950530035369\n2942,2019/08/07 03:00:00,1.1209200000000001,1.12166,1.12056,1.1214,4246,0.9224489795918674\n2943,2019/08/07 04:00:00,1.1213899999999999,1.12152,1.1210200000000001,1.1210799999999999,1699,0.9159292035398509\n2944,2019/08/07 05:00:00,1.12109,1.12116,1.1203299999999998,1.12061,2741,0.6843657817108776\n2945,2019/08/07 06:00:00,1.12061,1.1207200000000002,1.1195,1.11982,4097,0.5497630331753408\n2946,2019/08/07 07:00:00,1.11982,1.12026,1.11884,1.11891,5716,0.4754098360655708\n2947,2019/08/07 08:00:00,1.1189,1.11945,1.11865,1.11906,4559,0.49466950959484784\n2948,2019/08/07 09:00:00,1.11903,1.11903,1.11812,1.11848,4961,0.4444444444444208\n2949,2019/08/07 10:00:00,1.11847,1.1187799999999999,1.11788,1.1184,3926,0.3565573770491798\n2950,2019/08/07 11:00:00,1.1184100000000001,1.11975,1.11835,1.1196,4848,0.4632478632478714\n2951,2019/08/07 12:00:00,1.11972,1.12083,1.11906,1.12066,8931,0.5462427745664704\n2952,2019/08/07 13:00:00,1.12068,1.1240299999999999,1.1203100000000001,1.1233899999999999,11736,0.685999999999993\n2953,2019/08/07 14:00:00,1.1233799999999998,1.12399,1.12066,1.12155,12253,0.6447963800904889\n2954,2019/08/07 15:00:00,1.12154,1.12365,1.12127,1.12348,9199,0.6357308584686734\n2955,2019/08/07 16:00:00,1.1235,1.12414,1.1225399999999999,1.12267,8856,0.655323819978037\n2956,2019/08/07 17:00:00,1.12267,1.12305,1.1209799999999999,1.12162,8558,0.5498084291187599\n2957,2019/08/07 18:00:00,1.12162,1.12222,1.12091,1.1214,7998,0.5461465271170283\n2958,2019/08/07 19:00:00,1.1214,1.12168,1.12025,1.12034,7005,0.5477099236641293\n2959,2019/08/07 20:00:00,1.12022,1.12063,1.11979,1.1198,1789,0.5677546983185037\n2960,2019/08/07 21:05:00,1.12008,1.12037,1.11972,1.12026,2584,0.6029411764705889\n2961,2019/08/07 22:05:00,1.12026,1.12061,1.12021,1.12049,1051,0.6248693834900839\n2962,2019/08/07 23:05:00,1.12048,1.12065,1.12008,1.12036,1258,0.653637350705757\n2963,2019/08/08,1.1203299999999998,1.12133,1.1203,1.1209799999999999,3628,0.6943005181347212\n2964,2019/08/08 01:00:00,1.1209799999999999,1.12119,1.12002,1.12068,5843,0.6395089285714224\n2965,2019/08/08 02:00:00,1.12069,1.1212,1.12068,1.12096,2177,0.590621039290235\n2966,2019/08/08 03:00:00,1.12096,1.12111,1.1207799999999999,1.121,1713,0.31130063965882887\n2967,2019/08/08 04:00:00,1.121,1.12109,1.1208200000000001,1.12094,917,0.31130063965882887\n2968,2019/08/08 05:00:00,1.1209200000000001,1.12127,1.1207799999999999,1.12117,1408,0.33401221995924113\n2969,2019/08/08 06:00:00,1.1211799999999998,1.12153,1.12,1.12061,4250,0.2582417582417515\n2970,2019/08/08 07:00:00,1.12061,1.1219299999999999,1.1202,1.1216899999999999,4697,0.4209302325581333\n2971,2019/08/08 08:00:00,1.12168,1.12274,1.1213600000000001,1.12142,3366,0.519841269841267\n2972,2019/08/08 09:00:00,1.12143,1.12201,1.12095,1.1211200000000001,3862,0.5469728601252413\n2973,2019/08/08 10:00:00,1.1211200000000001,1.12114,1.12,1.12001,2815,0.49621212121211755\n2974,2019/08/08 11:00:00,1.12001,1.12039,1.11855,1.11877,4626,0.3933933933933838\n2975,2019/08/08 12:00:00,1.11876,1.12045,1.11808,1.12039,6289,0.3510791366906353\n2976,2019/08/08 13:00:00,1.12038,1.12239,1.11868,1.11964,12975,0.4977064220183465\n2977,2019/08/08 14:00:00,1.11964,1.12323,1.1192799999999998,1.1199299999999999,8907,0.5067567567567507\n2978,2019/08/08 15:00:00,1.12,1.12194,1.1199299999999999,1.12065,6012,0.5232558139534847\n2979,2019/08/08 16:00:00,1.12063,1.12158,1.1203299999999998,1.12046,3681,0.5227008149010405\n2980,2019/08/08 17:00:00,1.12047,1.1210200000000001,1.11986,1.11998,4685,0.49558498896248027\n2981,2019/08/08 18:00:00,1.11999,1.12043,1.11821,1.11853,6011,0.4192343604108322\n2982,2019/08/08 19:00:00,1.11849,1.11929,1.11846,1.11867,2683,0.41086749285034146\n2983,2019/08/08 20:00:00,1.11866,1.11871,1.11766,1.11784,1370,0.39512195121951926\n2984,2019/08/08 21:05:00,1.11795,1.11935,1.1175700000000002,1.119,1119,0.40548204158791235\n2985,2019/08/08 22:05:00,1.11894,1.1190200000000001,1.1185,1.11866,1303,0.3561924257932433\n2986,2019/08/08 23:05:00,1.11865,1.11889,1.11857,1.11858,903,0.3717948717948803\n2987,2019/08/09,1.11861,1.11942,1.11847,1.11923,2030,0.44358407079647094\n2988,2019/08/09 01:00:00,1.11924,1.11968,1.1189200000000001,1.1193799999999998,2841,0.5439490445860082\n2989,2019/08/09 02:00:00,1.1194,1.1196700000000002,1.1192600000000001,1.1195899999999999,1120,0.5751366120218823\n2990,2019/08/09 03:00:00,1.11958,1.1196,1.1193600000000001,1.11956,1128,0.42193308550187975\n2991,2019/08/09 04:00:00,1.1195700000000002,1.11962,1.11925,1.11944,832,0.31049250535335937\n2992,2019/08/09 05:00:00,1.11945,1.11973,1.11945,1.1195899999999999,1128,0.3263598326359992\n2993,2019/08/09 06:00:00,1.1195899999999999,1.1197,1.1184399999999999,1.1186399999999999,3017,0.2694300518134743\n2994,2019/08/09 07:00:00,1.11865,1.11973,1.11836,1.1187200000000002,4530,0.2928176795580049\n2995,2019/08/09 08:00:00,1.1187,1.11978,1.11829,1.11937,4632,0.42051282051284095\n2996,2019/08/09 09:00:00,1.1193799999999998,1.1206399999999999,1.11929,1.12035,3932,0.525210084033616\n2997,2019/08/09 10:00:00,1.12036,1.12076,1.11953,1.1205,3623,0.6421568627451012\n2998,2019/08/09 11:00:00,1.1205,1.1205399999999999,1.11951,1.12029,4304,0.5875370919881415\n2999,2019/08/09 12:00:00,1.1203,1.12043,1.11947,1.12012,5423,0.5806451612903267\n3000,2019/08/09 13:00:00,1.1201299999999998,1.12032,1.1191200000000001,1.11927,4867,0.5265957446808777\n3001,2019/08/09 14:00:00,1.1192600000000001,1.12035,1.1187799999999999,1.12004,8959,0.42285714285711457\n3002,2019/08/09 15:00:00,1.12008,1.12212,1.1199299999999999,1.12209,7172,0.596806387225537\n3003,2019/08/09 16:00:00,1.1220700000000001,1.12225,1.12039,1.1210799999999999,6886,0.6070038910505688\n3004,2019/08/09 17:00:00,1.12107,1.12121,1.1203,1.12036,4733,0.5965583173996121\n3005,2019/08/09 18:00:00,1.12036,1.12074,1.1203100000000001,1.12065,2239,0.6078431372548926\n3006,2019/08/09 19:00:00,1.12065,1.12069,1.1202299999999998,1.1202299999999998,2805,0.5897435897435583\n3007,2019/08/09 20:00:00,1.1202299999999998,1.12028,1.12008,1.12008,878,0.7102137767220937\n3008,2019/08/11 21:05:00,1.11989,1.1203100000000001,1.1197,1.12019,569,0.6629711751662898\n3009,2019/08/11 22:05:00,1.1202,1.12035,1.12002,1.12017,706,0.6726862302482794\n3010,2019/08/11 23:05:00,1.1202,1.1207799999999999,1.12,1.1207,1058,0.634328358208947\n3011,2019/08/12,1.12068,1.12075,1.12014,1.12048,1537,0.6230769230769033\n3012,2019/08/12 01:00:00,1.12048,1.12074,1.12028,1.1207,2201,0.6262886597937799\n3013,2019/08/12 02:00:00,1.12071,1.12093,1.12061,1.12076,1557,0.6501240694788731\n3014,2019/08/12 03:00:00,1.12077,1.1208,1.12055,1.12055,1165,0.7005347593581913\n3015,2019/08/12 04:00:00,1.12055,1.12094,1.1205399999999999,1.12087,907,0.7755681818181115\n3016,2019/08/12 05:00:00,1.12087,1.1210799999999999,1.12068,1.12105,1487,0.5820105820104167\n3017,2019/08/12 06:00:00,1.12104,1.12104,1.12008,1.12008,3437,0.41101694915242676\n3018,2019/08/12 07:00:00,1.12011,1.12014,1.11669,1.11675,7820,0.1713780918727374\n3019,2019/08/12 08:00:00,1.11674,1.11773,1.11617,1.11755,6923,0.15695792880254314\n3020,2019/08/12 09:00:00,1.11754,1.11858,1.11724,1.11846,5180,0.26187050359709696\n3021,2019/08/12 10:00:00,1.11846,1.11998,1.11824,1.11969,4762,0.3926829268292526\n3022,2019/08/12 11:00:00,1.11969,1.11978,1.11858,1.11883,5273,0.40949935815144783\n3023,2019/08/12 12:00:00,1.11883,1.12137,1.11868,1.12091,4853,0.507494646680932\n3024,2019/08/12 13:00:00,1.1209200000000001,1.1220299999999999,1.12075,1.12174,5282,0.5204188481675225\n3025,2019/08/12 14:00:00,1.12175,1.12201,1.12116,1.1217700000000002,4996,0.5204188481675225\n3026,2019/08/12 15:00:00,1.12178,1.12303,1.121,1.1210200000000001,5319,0.5582479030754793\n3027,2019/08/12 16:00:00,1.12103,1.12145,1.12091,1.1211799999999998,2950,0.545625587958605\n3028,2019/08/12 17:00:00,1.12117,1.12158,1.12103,1.12135,2071,0.5542056074766405\n3029,2019/08/12 18:00:00,1.12133,1.1223100000000001,1.12096,1.12198,2994,0.57444933920706\n3030,2019/08/12 19:00:00,1.1219,1.12191,1.12106,1.12122,2385,0.5691347011596977\n3031,2019/08/12 20:00:00,1.12122,1.12154,1.12113,1.1212799999999998,1073,0.6013195098963412\n3032,2019/08/12 21:05:00,1.12141,1.12198,1.1211200000000001,1.12171,2019,0.8891786179922275\n3033,2019/08/12 22:05:00,1.12172,1.12175,1.12133,1.12151,986,0.9538461538461916\n3034,2019/08/12 23:05:00,1.12152,1.12162,1.1213799999999998,1.12158,706,0.9476190476190901\n3035,2019/08/13,1.1216,1.1216,1.1205399999999999,1.12055,2362,0.7961672473868039\n3036,2019/08/13 01:00:00,1.12056,1.12095,1.1204100000000001,1.12087,2558,0.7785349233390884\n3037,2019/08/13 02:00:00,1.12087,1.12087,1.11857,1.1190799999999999,3008,0.48692810457520364\n3038,2019/08/13 03:00:00,1.11909,1.11943,1.11815,1.11883,3352,0.3945578231292913\n3039,2019/08/13 04:00:00,1.1188200000000001,1.119,1.11858,1.11894,1686,0.3945578231292913\n3040,2019/08/13 05:00:00,1.11894,1.11941,1.1187799999999999,1.1192799999999998,1513,0.33463796477498864\n3041,2019/08/13 06:00:00,1.11929,1.11981,1.11873,1.1192600000000001,4722,0.38574040219381983\n3042,2019/08/13 07:00:00,1.11927,1.1197,1.11853,1.11919,6179,0.3574007220216996\n3043,2019/08/13 08:00:00,1.11919,1.1193600000000001,1.11856,1.11911,4101,0.26371308016879735\n3044,2019/08/13 09:00:00,1.1191200000000001,1.1209200000000001,1.11838,1.1205200000000002,5168,0.4336419753086658\n3045,2019/08/13 10:00:00,1.1205399999999999,1.1221,1.1203100000000001,1.12158,4679,0.5208877284595521\n3046,2019/08/13 11:00:00,1.12158,1.12192,1.12119,1.12143,3400,0.4923717059639503\n3047,2019/08/13 12:00:00,1.12142,1.1228,1.1205100000000001,1.12165,9593,0.5051311288483679\n3048,2019/08/13 13:00:00,1.12164,1.1219,1.11697,1.1184100000000001,13543,0.35987002437043686\n3049,2019/08/13 14:00:00,1.1184100000000001,1.1198700000000001,1.11748,1.1187200000000002,14682,0.38622493461203755\n3050,2019/08/13 15:00:00,1.11874,1.11944,1.11801,1.11826,8683,0.39065255731922144\n3051,2019/08/13 16:00:00,1.11824,1.11849,1.1171200000000001,1.1179299999999999,5146,0.4263715110683418\n3052,2019/08/13 17:00:00,1.11792,1.11858,1.11732,1.11753,5325,0.4493041749503058\n3053,2019/08/13 18:00:00,1.11752,1.1178,1.1171799999999998,1.11732,2754,0.443137254901957\n3054,2019/08/13 19:00:00,1.11733,1.11751,1.11716,1.1173,2293,0.41896024464831616\n3055,2019/08/13 20:00:00,1.1173,1.1174,1.11693,1.11693,763,0.38686131386861006\n3056,2019/08/13 21:05:00,1.11697,1.11752,1.11693,1.1171799999999998,1738,0.40273396424816377\n3057,2019/08/13 22:05:00,1.11719,1.11745,1.11704,1.11735,773,0.40273396424816377\n3058,2019/08/13 23:05:00,1.11735,1.11766,1.11722,1.1176,1276,0.31077694235589925\n3059,2019/08/14,1.11763,1.1178,1.11727,1.11775,2835,0.20749279538904078\n3060,2019/08/14 01:00:00,1.11774,1.1179299999999999,1.11713,1.1172,3324,0.21775312066572966\n3061,2019/08/14 02:00:00,1.1171799999999998,1.1178,1.1171,1.11751,2598,0.1214788732394135\n3062,2019/08/14 03:00:00,1.1175,1.1177,1.1169200000000001,1.11704,1960,0.2974137931034309\n3063,2019/08/14 04:00:00,1.11703,1.1173600000000001,1.1168799999999999,1.11716,1823,0.29237288135588196\n3064,2019/08/14 05:00:00,1.11716,1.11725,1.11648,1.1166200000000002,2581,0.24999999999995978\n3065,2019/08/14 06:00:00,1.11661,1.11784,1.11645,1.11773,3854,0.5140562248995127\n3066,2019/08/14 07:00:00,1.11771,1.1184399999999999,1.11745,1.1179700000000001,4296,0.5966666666666003\n3067,2019/08/14 08:00:00,1.11796,1.11848,1.1175,1.11761,3748,0.631034482758613\n3068,2019/08/14 09:00:00,1.1176,1.11842,1.11722,1.1178299999999999,3561,0.579113924050634\n3069,2019/08/14 10:00:00,1.11784,1.1189,1.1174899999999999,1.11795,4674,0.677419354838716\n3070,2019/08/14 11:00:00,1.11794,1.11855,1.11656,1.1183299999999998,8989,0.5189573459715592\n3071,2019/08/14 12:00:00,1.11832,1.11903,1.11727,1.11771,8924,0.5680851063829835\n3072,2019/08/14 13:00:00,1.11768,1.11798,1.11556,1.11568,7471,0.39677419354837995\n3073,2019/08/14 14:00:00,1.1156700000000002,1.11589,1.1136700000000002,1.11483,8619,0.2918238993710737\n3074,2019/08/14 15:00:00,1.11484,1.11517,1.11376,1.1143299999999998,6067,0.2851562500000087\n3075,2019/08/14 16:00:00,1.11432,1.11445,1.11354,1.11439,3715,0.2782719186785293\n3076,2019/08/14 17:00:00,1.11442,1.11458,1.11368,1.1141,3930,0.29667519181585195\n3077,2019/08/14 18:00:00,1.11411,1.1144,1.11321,1.1138299999999999,3278,0.281212121212126\n3078,2019/08/14 19:00:00,1.11384,1.11415,1.11303,1.11332,5245,0.28891656288916706\n3079,2019/08/14 20:00:00,1.11332,1.11386,1.1131799999999998,1.11337,1374,0.23346828609987594\n3080,2019/08/14 21:05:00,1.11362,1.1143100000000001,1.11341,1.1142,2853,0.21763085399451454\n3081,2019/08/14 22:05:00,1.11422,1.1144399999999999,1.11402,1.11428,1058,0.22721088435373424\n3082,2019/08/14 23:05:00,1.11429,1.11448,1.11417,1.11425,771,0.24050632911391615\n3083,2019/08/15,1.1143100000000001,1.1145,1.1139299999999999,1.11415,2562,0.18142235123366646\n3084,2019/08/15 01:00:00,1.11415,1.11467,1.1140299999999999,1.11425,3359,0.23164763458400206\n3085,2019/08/15 02:00:00,1.11426,1.11438,1.1138700000000001,1.11411,1995,0.1617900172116974\n3086,2019/08/15 03:00:00,1.11411,1.1147799999999999,1.11409,1.11473,1586,0.29777777777775827\n3087,2019/08/15 04:00:00,1.1147200000000002,1.1151200000000001,1.1146200000000002,1.1150799999999998,1405,0.569491525423727\n3088,2019/08/15 05:00:00,1.1150799999999998,1.11514,1.11468,1.11481,1599,0.5723905723905574\n3089,2019/08/15 06:00:00,1.1148200000000001,1.1152799999999998,1.11401,1.11481,6717,0.5168539325842563\n3090,2019/08/15 07:00:00,1.11479,1.11514,1.11401,1.11476,7198,0.4985422740524685\n3091,2019/08/15 08:00:00,1.1147799999999999,1.11534,1.1142,1.11479,4808,0.6044303797468226\n3092,2019/08/15 09:00:00,1.1148,1.11505,1.11396,1.11503,7844,0.5931677018633502\n3093,2019/08/15 10:00:00,1.1150200000000001,1.11578,1.11496,1.11534,6467,0.6683544303797393\n3094,2019/08/15 11:00:00,1.11534,1.1158,1.1146399999999999,1.11506,9157,0.5755208333332863\n3095,2019/08/15 12:00:00,1.11507,1.11543,1.1134600000000001,1.11417,12223,0.4253578732106386\n3096,2019/08/15 13:00:00,1.11418,1.1144399999999999,1.11071,1.1112,13000,0.2684210526315691\n3097,2019/08/15 14:00:00,1.1112,1.11168,1.1091,1.11069,11091,0.22569832402232803\n3098,2019/08/15 15:00:00,1.11069,1.11119,1.10951,1.11025,5736,0.2107061503416655\n3099,2019/08/15 16:00:00,1.11025,1.11065,1.10966,1.1099,2981,0.2146171693735226\n3100,2019/08/15 17:00:00,1.1099,1.11186,1.1096,1.1112799999999998,3525,0.28029504741832295\n3101,2019/08/15 18:00:00,1.1112799999999998,1.11141,1.1100299999999999,1.11068,5717,0.25355191256827475\n3102,2019/08/15 19:00:00,1.11069,1.11133,1.11025,1.11131,3481,0.2519167579408304\n3103,2019/08/15 20:00:00,1.1113,1.1113899999999999,1.11042,1.11066,1094,0.2649164677804146\n3104,2019/08/15 21:05:00,1.11056,1.11095,1.11016,1.11085,2837,0.25694444444443215\n3105,2019/08/15 22:05:00,1.11086,1.111,1.11066,1.11093,947,0.24381625441694016\n3106,2019/08/15 23:05:00,1.1109200000000001,1.11119,1.1109,1.111,773,0.2677725118483134\n3107,2019/08/16,1.11107,1.11109,1.10994,1.1103399999999999,2357,0.17647058823527303\n3108,2019/08/16 01:00:00,1.11036,1.11037,1.10963,1.10981,1895,0.17476851851850736\n3109,2019/08/16 02:00:00,1.1098299999999999,1.10995,1.10954,1.10994,1453,0.19999999999998236\n3110,2019/08/16 03:00:00,1.10995,1.11027,1.10981,1.1102100000000001,1225,0.35742187499998324\n3111,2019/08/16 04:00:00,1.1102299999999998,1.1104,1.10978,1.1103100000000001,1166,0.5340599455040677\n3112,2019/08/16 05:00:00,1.1103,1.11046,1.10998,1.11042,1911,0.5415549597854973\n3113,2019/08/16 06:00:00,1.11043,1.1106,1.10999,1.11029,2872,0.5581395348836996\n3114,2019/08/16 07:00:00,1.11028,1.11055,1.10846,1.10853,6391,0.2300242130750225\n3115,2019/08/16 08:00:00,1.10855,1.10867,1.10812,1.10839,4779,0.2125279642057801\n3116,2019/08/16 09:00:00,1.10836,1.1086200000000002,1.1079299999999999,1.10838,5498,0.2038626609441647\n3117,2019/08/16 10:00:00,1.10837,1.1085200000000002,1.10745,1.1076700000000002,4388,0.175196850393677\n3118,2019/08/16 11:00:00,1.1076700000000002,1.10855,1.10731,1.10802,4848,0.1843687374748819\n3119,2019/08/16 12:00:00,1.10801,1.1081299999999998,1.10659,1.10735,5921,0.15371024734977715\n3120,2019/08/16 13:00:00,1.10735,1.10779,1.10681,1.10751,4604,0.12431444241312775\n3121,2019/08/16 14:00:00,1.1075,1.11065,1.10691,1.1105,10509,0.4803256445047246\n3122,2019/08/16 15:00:00,1.11048,1.11048,1.10869,1.10895,5159,0.5014164305948787\n3123,2019/08/16 16:00:00,1.10893,1.1095700000000002,1.1084399999999999,1.10931,3267,0.49030470914124114\n3124,2019/08/16 17:00:00,1.10932,1.10981,1.10899,1.1097,3008,0.4845938375349586\n3125,2019/08/16 18:00:00,1.10971,1.11025,1.10942,1.1095700000000002,2903,0.508086253369221\n3126,2019/08/16 19:00:00,1.10958,1.1095899999999999,1.1089799999999999,1.10924,2498,0.47564102564096516\n3127,2019/08/16 20:00:00,1.10923,1.1093,1.1088799999999999,1.10893,1093,0.4600515463916899\n3128,2019/08/18 21:05:00,1.10915,1.10971,1.10901,1.1096700000000002,1140,0.5993975903613816\n3129,2019/08/18 22:05:00,1.1097,1.11009,1.10932,1.1093600000000001,1624,0.6526946107783844\n3130,2019/08/18 23:05:00,1.10937,1.1094600000000001,1.10891,1.10917,1777,0.6318840579709674\n3131,2019/08/19,1.1091600000000001,1.1092,1.10876,1.10904,1929,0.663622526636149\n3132,2019/08/19 01:00:00,1.10904,1.1093600000000001,1.10873,1.1091799999999998,2084,0.6813353566008599\n3133,2019/08/19 02:00:00,1.1091799999999998,1.1093,1.1089200000000001,1.1092600000000001,1488,0.764906303236743\n3134,2019/08/19 03:00:00,1.1092600000000001,1.10941,1.109,1.10906,914,0.7692307692307179\n3135,2019/08/19 04:00:00,1.1090799999999998,1.10919,1.10891,1.10911,827,0.5420560747663143\n3136,2019/08/19 05:00:00,1.10915,1.1092,1.10873,1.10907,1595,0.5147058823529047\n3137,2019/08/19 06:00:00,1.1090799999999998,1.10952,1.10896,1.10942,2581,0.5965417867434937\n3138,2019/08/19 07:00:00,1.10943,1.11069,1.1089799999999999,1.11036,6179,0.6818181818181611\n3139,2019/08/19 08:00:00,1.1103399999999999,1.1109799999999999,1.10999,1.11018,5373,0.6705882352940906\n3140,2019/08/19 09:00:00,1.11018,1.11069,1.1098,1.11005,3884,0.7124999999999806\n3141,2019/08/19 10:00:00,1.1100299999999999,1.11133,1.10964,1.11064,4814,0.7425531914893488\n3142,2019/08/19 11:00:00,1.11065,1.11087,1.10953,1.11024,5212,0.6999999999999799\n3143,2019/08/19 12:00:00,1.11025,1.11045,1.10971,1.1099,2809,0.6716417910447531\n3144,2019/08/19 13:00:00,1.10988,1.11002,1.10941,1.1095,2988,0.6905370843989611\n3145,2019/08/19 14:00:00,1.10951,1.11032,1.10933,1.1094600000000001,3609,0.7246376811594033\n3146,2019/08/19 15:00:00,1.10948,1.10976,1.1092600000000001,1.10951,2436,0.7064676616915462\n3147,2019/08/19 16:00:00,1.1095,1.10981,1.10924,1.10931,1939,0.7066014669926378\n3148,2019/08/19 17:00:00,1.1093,1.10963,1.1089,1.10895,1788,0.6435185185184862\n3149,2019/08/19 18:00:00,1.10897,1.109,1.10811,1.10817,3015,0.5537848605577229\n3150,2019/08/19 19:00:00,1.10814,1.10847,1.1075700000000002,1.1076,2329,0.5158286778398318\n3151,2019/08/19 20:00:00,1.10761,1.10796,1.10761,1.10775,869,0.4851485148514525\n3152,2019/08/19 21:05:00,1.1077700000000001,1.1081,1.1077700000000001,1.1081,823,0.35323383084573734\n3153,2019/08/19 22:05:00,1.10806,1.10835,1.10805,1.10822,709,0.34673366834166736\n3154,2019/08/19 23:05:00,1.1082100000000001,1.10826,1.10791,1.1081299999999998,865,0.35114503816790704\n3155,2019/08/20,1.10814,1.10875,1.10814,1.1084399999999999,2137,0.3397790055248028\n3156,2019/08/20 01:00:00,1.10845,1.10875,1.10835,1.10858,2005,0.3504273504272964\n3157,2019/08/20 02:00:00,1.10858,1.1087,1.10851,1.10867,1549,0.3504273504272964\n3158,2019/08/20 03:00:00,1.10866,1.10881,1.10851,1.10867,1251,0.4036144578312826\n3159,2019/08/20 04:00:00,1.10867,1.10874,1.10849,1.10863,790,0.35135135135129664\n3160,2019/08/20 05:00:00,1.10864,1.10869,1.10805,1.1084100000000001,1828,0.3123123123122402\n3161,2019/08/20 06:00:00,1.1084,1.10864,1.10755,1.10765,3446,0.26329787234039537\n3162,2019/08/20 07:00:00,1.10764,1.1079700000000001,1.10714,1.10717,4946,0.25848563968665317\n3163,2019/08/20 08:00:00,1.1071799999999998,1.10782,1.1070799999999998,1.10779,3286,0.31935483870963305\n3164,2019/08/20 09:00:00,1.1077700000000001,1.1084100000000001,1.10761,1.1082299999999998,4346,0.5015873015872414\n3165,2019/08/20 10:00:00,1.10822,1.1084100000000001,1.10782,1.10817,3488,0.5015873015872414\n3166,2019/08/20 11:00:00,1.10816,1.1083399999999999,1.10753,1.10782,3168,0.43636363636356174\n3167,2019/08/20 12:00:00,1.10782,1.1082,1.10741,1.10771,3610,0.37539432176652904\n3168,2019/08/20 13:00:00,1.1077299999999999,1.10869,1.1065200000000002,1.10788,6787,0.38095238095235695\n3169,2019/08/20 14:00:00,1.10791,1.10934,1.10756,1.1089,6488,0.40262582056892543\n3170,2019/08/20 15:00:00,1.1088799999999999,1.1095899999999999,1.10874,1.1091600000000001,3811,0.4336099585062043\n3171,2019/08/20 16:00:00,1.10915,1.10995,1.10893,1.10984,2134,0.4729729729729683\n3172,2019/08/20 17:00:00,1.1098299999999999,1.11064,1.10961,1.11049,2208,0.5260416666666629\n3173,2019/08/20 18:00:00,1.11051,1.1106200000000002,1.1095899999999999,1.10966,1751,0.5260416666666629\n3174,2019/08/20 19:00:00,1.1096700000000002,1.1104,1.10965,1.1101,1973,0.5695488721804448\n3175,2019/08/20 20:00:00,1.11014,1.11016,1.10964,1.10996,1068,0.6273291925465586\n3176,2019/08/20 21:05:00,1.10992,1.11025,1.10963,1.11012,1945,0.6902654867256202\n3177,2019/08/20 22:05:00,1.11012,1.1101299999999998,1.10976,1.10984,676,0.6995515695067086\n3178,2019/08/20 23:05:00,1.10984,1.10989,1.1096700000000002,1.10969,708,0.6388888888888749\n3179,2019/08/21,1.10972,1.10981,1.10913,1.1092,1440,0.5622222222221834\n3180,2019/08/21 01:00:00,1.1092,1.1097299999999999,1.10909,1.10972,1423,0.595294117647028\n3181,2019/08/21 02:00:00,1.1097299999999999,1.11048,1.10971,1.10985,1817,0.6721311475409434\n3182,2019/08/21 03:00:00,1.10986,1.11008,1.10943,1.10948,1470,0.7380952380951472\n3183,2019/08/21 04:00:00,1.1094600000000001,1.1095,1.10931,1.1093600000000001,619,0.658461538461463\n3184,2019/08/21 05:00:00,1.10933,1.10963,1.10914,1.1095899999999999,1085,0.6121212121211551\n3185,2019/08/21 06:00:00,1.10958,1.10976,1.10891,1.10911,2294,0.5424242424242108\n3186,2019/08/21 07:00:00,1.10913,1.1097299999999999,1.10876,1.10923,3139,0.39855072463763974\n3187,2019/08/21 08:00:00,1.10922,1.1105399999999999,1.10897,1.10974,3883,0.538028169014048\n3188,2019/08/21 09:00:00,1.10975,1.10999,1.10937,1.10944,3174,0.538028169014048\n3189,2019/08/21 10:00:00,1.10943,1.1102299999999998,1.10935,1.11011,2873,0.5657894736841735\n3190,2019/08/21 11:00:00,1.11011,1.11067,1.1101,1.11024,2537,0.6038647342995205\n3191,2019/08/21 12:00:00,1.11025,1.11048,1.1098700000000001,1.11029,2989,0.5720823798627117\n3192,2019/08/21 13:00:00,1.11027,1.11038,1.1095700000000002,1.10984,2487,0.5458515283842865\n3193,2019/08/21 14:00:00,1.1098299999999999,1.10998,1.1092,1.10923,3870,0.5668934240362877\n3194,2019/08/21 15:00:00,1.10924,1.10998,1.1092,1.10965,2914,0.5720823798627117\n3195,2019/08/21 16:00:00,1.10966,1.1104100000000001,1.10955,1.11025,2676,0.5382716049383\n3196,2019/08/21 17:00:00,1.11025,1.1103,1.1093600000000001,1.1093600000000001,1901,0.5505050505050987\n3197,2019/08/21 18:00:00,1.1093600000000001,1.11046,1.10801,1.10855,5916,0.4373831775701031\n3198,2019/08/21 19:00:00,1.10849,1.1089,1.10807,1.10847,2854,0.43762376237625217\n3199,2019/08/21 20:00:00,1.10846,1.10856,1.1082100000000001,1.1084,1118,0.44349680170574546\n3200,2019/08/21 21:05:00,1.10845,1.10904,1.10845,1.10896,498,0.5099601593625482\n3201,2019/08/21 22:05:00,1.1089799999999999,1.1091600000000001,1.1089,1.1090200000000001,385,0.4318706697459797\n3202,2019/08/21 23:05:00,1.10905,1.10911,1.1088799999999999,1.10899,713,0.42988505747127276\n3203,2019/08/22,1.10901,1.10901,1.10839,1.10855,1351,0.3558951965065976\n3204,2019/08/22 01:00:00,1.10856,1.10885,1.1084100000000001,1.10865,1219,0.28743961352659647\n3205,2019/08/22 02:00:00,1.10864,1.10899,1.1086,1.10876,948,0.3283950617284182\n3206,2019/08/22 03:00:00,1.10876,1.10895,1.1085,1.10867,1049,0.34545454545456533\n3207,2019/08/22 04:00:00,1.10865,1.10866,1.10809,1.1081299999999998,780,0.3419023136247149\n3208,2019/08/22 05:00:00,1.10814,1.1083399999999999,1.10802,1.10808,1449,0.33585858585862083\n3209,2019/08/22 06:00:00,1.10809,1.1082,1.10753,1.1081299999999998,2865,0.22388059701493612\n3210,2019/08/22 07:00:00,1.1081299999999998,1.11085,1.10776,1.11047,9412,0.5478395061728084\n3211,2019/08/22 08:00:00,1.11046,1.1112799999999998,1.10979,1.10984,5351,0.707407407407386\n3212,2019/08/22 09:00:00,1.1098299999999999,1.1099,1.1071600000000001,1.10818,6112,0.4757160647571536\n3213,2019/08/22 10:00:00,1.10818,1.1083399999999999,1.10674,1.1068200000000001,4144,0.4520710059171483\n3214,2019/08/22 11:00:00,1.10681,1.10836,1.1063100000000001,1.1079999999999999,6209,0.39904988123515345\n3215,2019/08/22 12:00:00,1.10802,1.10865,1.10714,1.10794,5574,0.41094295692664284\n3216,2019/08/22 13:00:00,1.10795,1.10986,1.10794,1.10955,6306,0.4846625766871181\n3217,2019/08/22 14:00:00,1.10958,1.10958,1.10674,1.10795,6644,0.4518589132507166\n3218,2019/08/22 15:00:00,1.10794,1.10895,1.10788,1.10883,3444,0.4518589132507166\n3219,2019/08/22 16:00:00,1.10884,1.10889,1.10782,1.10814,2437,0.4418828049951991\n3220,2019/08/22 17:00:00,1.10814,1.10848,1.10781,1.10819,2016,0.44573643410852604\n3221,2019/08/22 18:00:00,1.1082,1.10891,1.1082,1.10847,1652,0.48646034816248374\n3222,2019/08/22 19:00:00,1.10846,1.10869,1.10817,1.10818,1528,0.4883495145631167\n3223,2019/08/22 20:00:00,1.10819,1.10822,1.1078700000000001,1.10788,956,0.4975272007913124\n3224,2019/08/22 21:05:00,1.10785,1.10818,1.1078299999999999,1.10804,1255,0.3173333333333574\n3225,2019/08/22 22:05:00,1.10804,1.1083100000000001,1.10804,1.10822,474,0.2888888888889403\n3226,2019/08/22 23:05:00,1.1082100000000001,1.1085399999999999,1.1079999999999999,1.10832,972,0.4772727272727408\n3227,2019/08/23,1.10832,1.1085,1.10788,1.10788,1662,0.5088105726872575\n3228,2019/08/23 01:00:00,1.10788,1.10802,1.10731,1.10746,1909,0.49141630901289096\n3229,2019/08/23 02:00:00,1.1074700000000002,1.10759,1.1071799999999998,1.10735,1361,0.4444444444444554\n3230,2019/08/23 03:00:00,1.10734,1.10741,1.1066,1.10674,1266,0.20413436692508016\n3231,2019/08/23 04:00:00,1.10676,1.10695,1.10604,1.10689,1436,0.2445820433436526\n3232,2019/08/23 05:00:00,1.10689,1.107,1.10656,1.1067799999999999,1300,0.25609756097558173\n3233,2019/08/23 06:00:00,1.10676,1.1069799999999999,1.10651,1.1068799999999999,2350,0.25688073394493105\n3234,2019/08/23 07:00:00,1.1068799999999999,1.10737,1.10656,1.10683,4480,0.33698630136986646\n3235,2019/08/23 08:00:00,1.10685,1.1073,1.10661,1.10673,3334,0.24844720496891665\n3236,2019/08/23 09:00:00,1.1067200000000001,1.10683,1.10551,1.10592,3697,0.18648018648016043\n3237,2019/08/23 10:00:00,1.10592,1.10604,1.10513,1.10544,3401,0.18306636155603523\n3238,2019/08/23 11:00:00,1.10542,1.10645,1.10523,1.10564,2980,0.25527426160336325\n3239,2019/08/23 12:00:00,1.10565,1.1072799999999998,1.10565,1.1063,9985,0.3511029411764249\n3240,2019/08/23 13:00:00,1.10629,1.10722,1.10619,1.1066,4190,0.3249516441005682\n3241,2019/08/23 14:00:00,1.10664,1.11143,1.10525,1.1109200000000001,12429,0.5774509803921436\n3242,2019/08/23 15:00:00,1.11093,1.1147200000000002,1.11036,1.1147,16203,0.7105263157894687\n3243,2019/08/23 16:00:00,1.1146399999999999,1.11467,1.11267,1.11381,6984,0.7177482408131406\n3244,2019/08/23 17:00:00,1.11382,1.11449,1.11355,1.11394,5047,0.7518427518427457\n3245,2019/08/23 18:00:00,1.11394,1.11531,1.11394,1.1145200000000002,4276,0.8019246190858078\n3246,2019/08/23 19:00:00,1.1145100000000001,1.11499,1.11411,1.11411,4486,0.8011272141706962\n3247,2019/08/23 20:00:00,1.1141299999999998,1.1147,1.1133,1.1146,2052,0.7549317147192701\n3248,2019/08/25 21:05:00,1.11475,1.11562,1.11388,1.11519,1686,0.7644055433989759\n3249,2019/08/25 22:05:00,1.1152,1.11635,1.11499,1.11517,5316,0.7763157894736797\n3250,2019/08/25 23:05:00,1.11517,1.11517,1.11418,1.11429,2634,0.7922261484098962\n3251,2019/08/26,1.1142299999999998,1.11459,1.1135700000000002,1.11429,4661,0.7795549374130906\n3252,2019/08/26 01:00:00,1.11427,1.11473,1.11381,1.1144100000000001,5343,0.7753366406803857\n3253,2019/08/26 02:00:00,1.11442,1.1147799999999999,1.11315,1.11392,4244,0.7262330235882993\n3254,2019/08/26 03:00:00,1.1139,1.11432,1.11374,1.1141,2469,0.7262330235882993\n3255,2019/08/26 04:00:00,1.11411,1.11467,1.11409,1.11428,3053,0.685527747551722\n3256,2019/08/26 05:00:00,1.11429,1.11468,1.11402,1.1143299999999998,4357,0.5050167224080415\n3257,2019/08/26 06:00:00,1.11432,1.1152600000000001,1.11281,1.11332,7288,0.4633204633204927\n3258,2019/08/26 07:00:00,1.1132799999999998,1.11355,1.1115899999999999,1.11208,13807,0.4004449388209249\n3259,2019/08/26 08:00:00,1.1120700000000001,1.11208,1.11103,1.11143,7546,0.318442153493712\n3260,2019/08/26 09:00:00,1.11144,1.11205,1.1108799999999999,1.1117299999999999,7015,0.3130630630630714\n3261,2019/08/26 10:00:00,1.11172,1.1124,1.11133,1.1119700000000001,6308,0.37173396674585807\n3262,2019/08/26 11:00:00,1.11198,1.11204,1.11091,1.1115700000000002,5522,0.27904040404042013\n3263,2019/08/26 12:00:00,1.1115700000000002,1.11194,1.1106,1.11112,5737,0.19733333333335723\n3264,2019/08/26 13:00:00,1.11111,1.11239,1.11093,1.1117,8564,0.2703081232493319\n3265,2019/08/26 14:00:00,1.11171,1.11217,1.11124,1.11135,6826,0.29555895865239906\n3266,2019/08/26 15:00:00,1.11137,1.1116,1.11069,1.11104,6344,0.25792507204612924\n3267,2019/08/26 16:00:00,1.11103,1.11153,1.11077,1.11093,3699,0.2792937399679269\n3268,2019/08/26 17:00:00,1.11094,1.11095,1.10963,1.11043,3491,0.2360922659430351\n3269,2019/08/26 18:00:00,1.11043,1.11069,1.1094600000000001,1.1097299999999999,2871,0.19332406119613016\n3270,2019/08/26 19:00:00,1.10974,1.1100299999999999,1.10955,1.10962,2663,0.19409282700426223\n3271,2019/08/26 20:00:00,1.10962,1.1101,1.10937,1.11006,1294,0.15619389587078805\n3272,2019/08/26 21:05:00,1.10995,1.1105200000000002,1.1099299999999999,1.11002,1219,0.2704402515724011\n3273,2019/08/26 22:05:00,1.11002,1.11016,1.10991,1.10996,706,0.30496453900717146\n3274,2019/08/26 23:05:00,1.1099299999999999,1.1102100000000001,1.10979,1.1101,985,0.3152941176471683\n3275,2019/08/27,1.1100700000000001,1.11051,1.11001,1.11032,1958,0.30714285714295114\n3276,2019/08/27 01:00:00,1.1103399999999999,1.11053,1.11006,1.1103100000000001,3088,0.3447368421053371\n3277,2019/08/27 02:00:00,1.11029,1.11068,1.11022,1.11048,1953,0.4010989010989571\n3278,2019/08/27 03:00:00,1.11047,1.11048,1.11001,1.11009,1438,0.29705882352945784\n3279,2019/08/27 04:00:00,1.1101,1.11016,1.10975,1.1098,1325,0.2759562841530542\n3280,2019/08/27 05:00:00,1.10981,1.11036,1.1098,1.1102,2299,0.3655589123867623\n3281,2019/08/27 06:00:00,1.1102100000000001,1.1105399999999999,1.10976,1.1105200000000002,5340,0.3937677053824828\n3282,2019/08/27 07:00:00,1.11049,1.11144,1.11036,1.11087,7011,0.6960486322189737\n3283,2019/08/27 08:00:00,1.11086,1.11155,1.11055,1.1112799999999998,5360,0.7430340557276457\n3284,2019/08/27 09:00:00,1.11127,1.11148,1.11057,1.11074,6294,0.7430340557276457\n3285,2019/08/27 10:00:00,1.11073,1.1108,1.11015,1.11066,4873,0.6852941176471176\n3286,2019/08/27 11:00:00,1.11067,1.1109200000000001,1.10998,1.11009,4985,0.6207951070336961\n3287,2019/08/27 12:00:00,1.11008,1.11093,1.1100299999999999,1.11084,4554,0.6257668711656663\n3288,2019/08/27 13:00:00,1.11085,1.11087,1.1094,1.11012,6627,0.5349462365591346\n3289,2019/08/27 14:00:00,1.1101,1.1103100000000001,1.1091600000000001,1.1101299999999998,6425,0.4617486338797968\n3290,2019/08/27 15:00:00,1.11016,1.1102299999999998,1.1087,1.10935,5244,0.4073170731707371\n3291,2019/08/27 16:00:00,1.10937,1.10968,1.10853,1.10963,3971,0.36893203883497183\n3292,2019/08/27 17:00:00,1.10964,1.10964,1.1089,1.1092,2436,0.38874680306908116\n3293,2019/08/27 18:00:00,1.1092,1.10955,1.10901,1.10925,1662,0.4164383561644074\n3294,2019/08/27 19:00:00,1.10924,1.10924,1.1088,1.10893,2097,0.3606557377049369\n3295,2019/08/27 20:00:00,1.10896,1.10904,1.10867,1.10899,853,0.31932773109246987\n3296,2019/08/27 21:05:00,1.109,1.1094,1.1089799999999999,1.10915,1640,0.19801980198018498\n3297,2019/08/27 22:05:00,1.10914,1.1092,1.1090200000000001,1.10911,886,0.1678082191780517\n3298,2019/08/27 23:05:00,1.10911,1.1092600000000001,1.10889,1.1089,894,0.1768488745980774\n3299,2019/08/28,1.10891,1.1092,1.10857,1.10876,2256,0.18272425249171373\n3300,2019/08/28 01:00:00,1.1087799999999999,1.109,1.10851,1.10867,2592,0.15467625899279283\n3301,2019/08/28 02:00:00,1.10869,1.10889,1.10861,1.1088,1663,0.1516245487364968\n3302,2019/08/28 03:00:00,1.10879,1.10885,1.10857,1.10871,1433,0.19266055045874925\n3303,2019/08/28 04:00:00,1.10871,1.1087200000000001,1.10839,1.10864,821,0.1981132075471787\n3304,2019/08/28 05:00:00,1.10867,1.10895,1.10849,1.10884,1361,0.343915343915334\n3305,2019/08/28 06:00:00,1.1088200000000001,1.1089,1.1084399999999999,1.10881,3207,0.36723163841804507\n3306,2019/08/28 07:00:00,1.1088,1.10965,1.1087,1.10927,4429,0.5555555555555164\n3307,2019/08/28 08:00:00,1.1092600000000001,1.10975,1.10826,1.10885,7000,0.4901960784313455\n3308,2019/08/28 09:00:00,1.10887,1.1095,1.10853,1.10911,6025,0.5263157894736596\n3309,2019/08/28 10:00:00,1.1091,1.1097299999999999,1.10879,1.10927,4547,0.586440677966059\n3310,2019/08/28 11:00:00,1.10927,1.1092799999999998,1.10828,1.10832,4394,0.44193548387095155\n3311,2019/08/28 12:00:00,1.1083399999999999,1.10858,1.1079700000000001,1.1081299999999998,4461,0.4017595307918003\n3312,2019/08/28 13:00:00,1.1081,1.10857,1.10735,1.10814,5911,0.341145833333327\n3313,2019/08/28 14:00:00,1.10812,1.1083399999999999,1.10731,1.10756,5915,0.36797752808986506\n3314,2019/08/28 15:00:00,1.1074899999999999,1.10845,1.1073899999999999,1.1083,3867,0.39335180055399793\n3315,2019/08/28 16:00:00,1.10832,1.1084399999999999,1.10758,1.1078299999999999,2532,0.39335180055399793\n3316,2019/08/28 17:00:00,1.10785,1.1085200000000002,1.10768,1.10828,2710,0.4109589041096232\n3317,2019/08/28 18:00:00,1.10828,1.10843,1.10772,1.10794,1945,0.43227665706056095\n3318,2019/08/28 19:00:00,1.10791,1.10809,1.10746,1.10755,2771,0.36285714285720705\n3319,2019/08/28 20:00:00,1.10756,1.1077700000000001,1.10746,1.10769,1147,0.36811594202906145\n3320,2019/08/28 21:05:00,1.10778,1.1084100000000001,1.1077,1.10817,2595,0.34730538922162574\n3321,2019/08/28 22:05:00,1.10817,1.1084100000000001,1.10804,1.10832,1173,0.37857142857151127\n3322,2019/08/28 23:05:00,1.10832,1.10861,1.1083100000000001,1.10853,1320,0.4200000000000711\n3323,2019/08/29,1.1085399999999999,1.10864,1.10828,1.1085,1924,0.3745583038869818\n3324,2019/08/29 01:00:00,1.10848,1.1087,1.1082299999999998,1.10828,2274,0.4609053497942628\n3325,2019/08/29 02:00:00,1.10829,1.10829,1.10799,1.10818,1570,0.47457627118646617\n3326,2019/08/29 03:00:00,1.10818,1.10845,1.10814,1.10839,1041,0.673684210526322\n3327,2019/08/29 04:00:00,1.10839,1.1084399999999999,1.10804,1.10808,798,0.6530612244898213\n3328,2019/08/29 05:00:00,1.10809,1.10849,1.10809,1.1084,1639,0.6421052631579316\n3329,2019/08/29 06:00:00,1.1084100000000001,1.10855,1.10805,1.10807,2907,0.6400000000000133\n3330,2019/08/29 07:00:00,1.10799,1.10845,1.10746,1.10818,7045,0.47808764940237775\n3331,2019/08/29 08:00:00,1.10816,1.10828,1.10756,1.10762,5672,0.47808764940237775\n3332,2019/08/29 09:00:00,1.10758,1.10778,1.107,1.10762,4677,0.4270462633451519\n3333,2019/08/29 10:00:00,1.10761,1.10771,1.1071799999999998,1.10741,3481,0.4270462633451519\n3334,2019/08/29 11:00:00,1.10742,1.1076,1.1069200000000001,1.1073899999999999,3757,0.23045267489710314\n3335,2019/08/29 12:00:00,1.10738,1.10816,1.10687,1.107,5190,0.3684210526315905\n3336,2019/08/29 13:00:00,1.10696,1.10733,1.10556,1.10625,7011,0.22168674698796612\n3337,2019/08/29 14:00:00,1.10626,1.10927,1.10589,1.1066799999999999,8598,0.4693200663350288\n3338,2019/08/29 15:00:00,1.10669,1.10669,1.10546,1.10579,4450,0.43622047244099543\n3339,2019/08/29 16:00:00,1.1058,1.1059,1.10497,1.10527,3332,0.419696969696998\n3340,2019/08/29 17:00:00,1.10525,1.10542,1.10417,1.10533,3924,0.3604972375690959\n3341,2019/08/29 18:00:00,1.10532,1.10546,1.1050200000000001,1.1051799999999998,2600,0.3690807799443282\n3342,2019/08/29 19:00:00,1.1051600000000001,1.10579,1.10512,1.10574,1931,0.39276139410190053\n3343,2019/08/29 20:00:00,1.1057299999999999,1.10582,1.10551,1.10563,1033,0.3924221921515844\n3344,2019/08/29 21:05:00,1.1055700000000002,1.10588,1.10542,1.10569,600,0.42589928057556303\n3345,2019/08/29 22:05:00,1.10571,1.10581,1.10558,1.1057700000000001,574,0.42589928057556303\n3346,2019/08/29 23:05:00,1.10581,1.1059999999999999,1.10575,1.10586,759,0.47872340425534715\n3347,2019/08/30,1.10586,1.10595,1.10514,1.1053600000000001,2894,0.4381084840055866\n3348,2019/08/30 01:00:00,1.1053600000000001,1.10537,1.10471,1.1048799999999999,2538,0.42798913043479175\n3349,2019/08/30 02:00:00,1.1048799999999999,1.10497,1.10422,1.1043100000000001,1394,0.3577348066298316\n3350,2019/08/30 03:00:00,1.1043100000000001,1.10459,1.10419,1.1044100000000001,1264,0.4345637583892587\n3351,2019/08/30 04:00:00,1.10439,1.10455,1.10428,1.1044399999999999,1054,0.16169154228852425\n3352,2019/08/30 05:00:00,1.1044399999999999,1.10495,1.10443,1.1047799999999999,2363,0.26315789473684503\n3353,2019/08/30 06:00:00,1.1047799999999999,1.10514,1.1034899999999999,1.10374,5554,0.2678185745140241\n3354,2019/08/30 07:00:00,1.10375,1.10402,1.1032899999999999,1.10376,6563,0.3076923076922865\n3355,2019/08/30 08:00:00,1.10374,1.10437,1.10346,1.10375,4514,0.35714285714284255\n3356,2019/08/30 09:00:00,1.10376,1.10455,1.1037,1.10399,4505,0.33412887828159277\n3357,2019/08/30 10:00:00,1.104,1.10443,1.10384,1.10402,3170,0.32932692307689676\n3358,2019/08/30 11:00:00,1.10404,1.10418,1.10346,1.10351,3743,0.2984054669703768\n3359,2019/08/30 12:00:00,1.10351,1.1042100000000001,1.10337,1.10378,4360,0.2971175166297226\n3360,2019/08/30 13:00:00,1.10384,1.1048799999999999,1.10384,1.10443,4257,0.3647294589178185\n3361,2019/08/30 14:00:00,1.1044200000000002,1.10491,1.10096,1.1012,5361,0.2537722908093372\n3362,2019/08/30 15:00:00,1.1011799999999998,1.1013,1.09846,1.0988799999999999,9766,0.19764957264958105\n3363,2019/08/30 16:00:00,1.09887,1.0992600000000001,1.09847,1.09871,3060,0.20856820744082266\n3364,2019/08/30 17:00:00,1.0987,1.09871,1.09629,1.0971,4765,0.1678765880217865\n3365,2019/08/30 18:00:00,1.0970799999999998,1.09795,1.09691,1.09765,3341,0.1678765880217865\n3366,2019/08/30 19:00:00,1.09764,1.09923,1.09761,1.09913,3272,0.22941176470587343\n3367,2019/08/30 20:00:00,1.09913,1.09925,1.0988799999999999,1.0990799999999998,1227,0.23725671918443925\n3368,2019/09/01 21:05:00,1.09886,1.09954,1.0982399999999999,1.0995,1207,0.24739583333333554\n3369,2019/09/01 22:05:00,1.09951,1.09962,1.099,1.09935,1433,0.22933333333333605\n3370,2019/09/01 23:05:00,1.09935,1.0993600000000001,1.09893,1.09901,1454,0.21543985637344235\n3371,2019/09/02,1.0989799999999998,1.0991,1.09861,1.0987200000000001,1945,0.20942408376964872\n3372,2019/09/02 01:00:00,1.09874,1.09927,1.09843,1.09906,2471,0.22484689413824335\n3373,2019/09/02 02:00:00,1.09905,1.09919,1.0986799999999999,1.09901,1420,0.22458001768346614\n3374,2019/09/02 03:00:00,1.09901,1.09928,1.0989,1.09899,1052,0.18266542404476624\n3375,2019/09/02 04:00:00,1.09899,1.09922,1.09875,1.09875,791,0.24215809284819922\n3376,2019/09/02 05:00:00,1.09875,1.0989799999999998,1.09861,1.09863,1116,0.344028520499139\n3377,2019/09/02 06:00:00,1.0986200000000002,1.09922,1.09798,1.0982100000000001,2649,0.33487654320992083\n3378,2019/09/02 07:00:00,1.0982,1.09858,1.09766,1.09818,4292,0.4696969696970374\n3379,2019/09/02 08:00:00,1.0982,1.09873,1.0969799999999998,1.09723,4908,0.4256880733945467\n3380,2019/09/02 09:00:00,1.09725,1.09735,1.09576,1.09586,5086,0.19294990723571598\n3381,2019/09/02 10:00:00,1.0958700000000001,1.0968799999999999,1.0958700000000001,1.09661,3075,0.18994413407828759\n3382,2019/09/02 11:00:00,1.0966200000000002,1.0974899999999999,1.09655,1.0968200000000001,2846,0.2653465346535535\n3383,2019/09/02 12:00:00,1.0968200000000001,1.09703,1.0962399999999999,1.09653,2361,0.23863636363643723\n3384,2019/09/02 13:00:00,1.09654,1.0967200000000001,1.09599,1.0967,2173,0.23076923076930897\n3385,2019/09/02 14:00:00,1.0967,1.09701,1.09612,1.09691,2172,0.28545119705346367\n3386,2019/09/02 15:00:00,1.09684,1.09704,1.09626,1.0967200000000001,2544,0.275929549902213\n3387,2019/09/02 16:00:00,1.09671,1.0975,1.09667,1.0973,1905,0.33572710951530255\n3388,2019/09/02 17:00:00,1.0973,1.0973,1.09676,1.09689,724,0.3248175182482004\n3389,2019/09/02 18:00:00,1.09689,1.09707,1.09687,1.09691,398,0.33395872420265854\n3390,2019/09/02 19:00:00,1.09694,1.09704,1.09691,1.09697,348,0.3429672447013691\n3391,2019/09/02 20:00:00,1.09696,1.0972600000000001,1.09626,1.09656,3176,0.3391136801541521\n3392,2019/09/02 21:05:00,1.09665,1.09722,1.09661,1.09684,1136,0.3613963039014393\n3393,2019/09/02 22:05:00,1.09685,1.09685,1.0964399999999999,1.09646,693,0.3824228028503459\n3394,2019/09/02 23:05:00,1.09647,1.0965,1.09615,1.09638,876,0.4908536585365591\n3395,2019/09/03,1.09638,1.09641,1.09511,1.09533,2400,0.3726851851851699\n3396,2019/09/03 01:00:00,1.0953,1.09533,1.09345,1.09392,4563,0.18621973929234883\n3397,2019/09/03 02:00:00,1.09392,1.09394,1.09305,1.09309,2267,0.18315018315016976\n3398,2019/09/03 03:00:00,1.0931,1.09404,1.0931,1.09354,1753,0.20715630885120417\n3399,2019/09/03 04:00:00,1.09353,1.09404,1.09336,1.09401,1761,0.1613545816733015\n3400,2019/09/03 05:00:00,1.094,1.09489,1.09342,1.0946,3202,0.2791095890410962\n3401,2019/09/03 06:00:00,1.09459,1.09483,1.0933899999999999,1.0941299999999998,5764,0.21626617375231755\n3402,2019/09/03 07:00:00,1.09412,1.09454,1.09325,1.09394,7704,0.2108108108108253\n3403,2019/09/03 08:00:00,1.09392,1.09509,1.09382,1.09486,4869,0.28196721311474515\n3404,2019/09/03 09:00:00,1.09487,1.09487,1.09375,1.09418,3855,0.27876823338734863\n3405,2019/09/03 10:00:00,1.09417,1.09428,1.09256,1.09378,4977,0.23112480739597252\n3406,2019/09/03 11:00:00,1.09379,1.09423,1.09261,1.09366,5186,0.23112480739597252\n3407,2019/09/03 12:00:00,1.09366,1.09422,1.09342,1.09394,3910,0.2373417721518854\n3408,2019/09/03 13:00:00,1.09395,1.09535,1.09275,1.09465,7015,0.3358876117496786\n3409,2019/09/03 14:00:00,1.09465,1.09785,1.09465,1.09588,10718,0.5522066738428384\n3410,2019/09/03 15:00:00,1.09589,1.0969799999999998,1.09578,1.09665,5948,0.6723460026212305\n3411,2019/09/03 16:00:00,1.09664,1.0972,1.0961,1.09697,2925,0.718120805369127\n3412,2019/09/03 17:00:00,1.09699,1.09732,1.09676,1.0971899999999999,2207,0.7188755020080367\n3413,2019/09/03 18:00:00,1.09717,1.0975,1.09646,1.09666,1942,0.6981132075471714\n3414,2019/09/03 19:00:00,1.09664,1.0972899999999999,1.09645,1.09673,2180,0.6610407876230605\n3415,2019/09/03 20:00:00,1.09675,1.09752,1.09663,1.0972600000000001,1171,0.6744186046511832\n3416,2019/09/03 21:05:00,1.0972899999999999,1.0977299999999999,1.09705,1.09715,1147,0.6964769647696426\n3417,2019/09/03 22:05:00,1.0971600000000001,1.0971899999999999,1.0968200000000001,1.09705,783,0.6501416430594973\n3418,2019/09/03 23:05:00,1.09701,1.0973,1.0968200000000001,1.09722,774,0.6619718309859265\n3419,2019/09/04,1.09721,1.0979,1.09712,1.09738,2086,0.8141321044547021\n3420,2019/09/04 01:00:00,1.09738,1.09794,1.0973600000000001,1.0973700000000002,2822,0.8152671755725308\n3421,2019/09/04 02:00:00,1.0973600000000001,1.09752,1.09721,1.0974700000000002,1693,0.7970149253731348\n3422,2019/09/04 03:00:00,1.09746,1.09761,1.09722,1.09755,1327,0.861723446893773\n3423,2019/09/04 04:00:00,1.09754,1.09761,1.0972600000000001,1.09745,1173,0.7228915662650398\n3424,2019/09/04 05:00:00,1.09744,1.09768,1.0972600000000001,1.0974700000000002,1566,0.7304687499999813\n3425,2019/09/04 06:00:00,1.0974899999999999,1.0985200000000002,1.09732,1.09807,5127,0.7830188679245158\n3426,2019/09/04 07:00:00,1.09802,1.0993899999999999,1.0976,1.09919,6168,0.8244274809159999\n3427,2019/09/04 08:00:00,1.0991799999999998,1.10125,1.09853,1.10067,6309,0.926553672316365\n3428,2019/09/04 09:00:00,1.10066,1.1023100000000001,1.10029,1.102,6177,0.9402515723270379\n3429,2019/09/04 10:00:00,1.10199,1.1021100000000001,1.1013,1.10162,4085,0.9380097879282139\n3430,2019/09/04 11:00:00,1.1016299999999999,1.10196,1.1006799999999999,1.10146,3930,0.8470948012232294\n3431,2019/09/04 12:00:00,1.10145,1.102,1.1008799999999999,1.10161,4453,0.8787401574802957\n3432,2019/09/04 13:00:00,1.1016,1.1019,1.1009799999999998,1.10112,4456,0.8766025641025434\n3433,2019/09/04 14:00:00,1.10114,1.10319,1.10096,1.10283,6730,0.8863309352517852\n3434,2019/09/04 15:00:00,1.10285,1.10325,1.10225,1.1024100000000001,4662,0.8866571018651287\n3435,2019/09/04 16:00:00,1.1024,1.1031,1.1022399999999999,1.10256,3066,0.9048316251830119\n3436,2019/09/04 17:00:00,1.10255,1.10291,1.10217,1.1027,3194,0.8942731277533283\n3437,2019/09/04 18:00:00,1.1027,1.10381,1.1024100000000001,1.10311,3461,0.9066147859922383\n3438,2019/09/04 19:00:00,1.1031,1.10354,1.10266,1.1032,2319,0.9057591623036854\n3439,2019/09/04 20:00:00,1.10319,1.10354,1.1027200000000001,1.10354,1381,0.8941176470588434\n3440,2019/09/04 21:05:00,1.1033899999999999,1.1035700000000002,1.10304,1.1034899999999999,1228,0.8791946308725153\n3441,2019/09/04 22:05:00,1.10351,1.10364,1.1033,1.1033899999999999,526,0.8273381294964343\n3442,2019/09/04 23:05:00,1.1034,1.1034899999999999,1.1033600000000001,1.10345,564,0.7684887459807409\n3443,2019/09/05,1.1034,1.10372,1.10304,1.10338,1723,0.7158469945355379\n3444,2019/09/05 01:00:00,1.1033899999999999,1.10388,1.1027,1.10283,4393,0.7853107344633055\n3445,2019/09/05 02:00:00,1.10284,1.10331,1.10261,1.10307,2711,0.763231197771629\n3446,2019/09/05 03:00:00,1.1030799999999998,1.10309,1.10261,1.10267,1592,0.763231197771629\n3447,2019/09/05 04:00:00,1.10269,1.10291,1.1024100000000001,1.10265,1419,0.5846774193548998\n3448,2019/09/05 05:00:00,1.10266,1.103,1.1024399999999999,1.1027,1453,0.589641434262968\n3449,2019/09/05 06:00:00,1.1027,1.1027,1.10165,1.1022,4689,0.4498480243161455\n3450,2019/09/05 07:00:00,1.10216,1.10428,1.10182,1.1039299999999999,6971,0.6375000000000075\n3451,2019/09/05 08:00:00,1.1039299999999999,1.1044,1.1028799999999999,1.10371,5502,0.5671641791045048\n3452,2019/09/05 09:00:00,1.10371,1.10477,1.10351,1.10435,6054,0.6036446469248531\n3453,2019/09/05 10:00:00,1.10436,1.10563,1.1042100000000001,1.1056,5787,0.6685714285714411\n3454,2019/09/05 11:00:00,1.10559,1.10667,1.10533,1.10653,4372,0.7220447284345155\n3455,2019/09/05 12:00:00,1.10653,1.1066799999999999,1.1052,1.1059299999999999,5857,0.7045813586098107\n3456,2019/09/05 13:00:00,1.1059299999999999,1.1084399999999999,1.10579,1.10807,6283,0.7688504326328944\n3457,2019/09/05 14:00:00,1.10786,1.10786,1.10404,1.1042399999999999,9859,0.6447793326157149\n3458,2019/09/05 15:00:00,1.10425,1.10511,1.1036700000000002,1.1037299999999999,5011,0.6364628820960883\n3459,2019/09/05 16:00:00,1.10372,1.10419,1.1034899999999999,1.10408,3146,0.6302702702702629\n3460,2019/09/05 17:00:00,1.10406,1.1043,1.1034,1.10381,2216,0.6285714285714286\n3461,2019/09/05 18:00:00,1.1038,1.1039299999999999,1.10317,1.1035700000000002,1852,0.6265822784810143\n3462,2019/09/05 19:00:00,1.10358,1.10371,1.10334,1.10356,1741,0.6230031948881835\n3463,2019/09/05 20:00:00,1.10355,1.1036700000000002,1.1033,1.10342,828,0.6770833333333245\n3464,2019/09/05 21:05:00,1.10338,1.1038299999999999,1.1032799999999998,1.10372,882,0.6118784530386415\n3465,2019/09/05 22:05:00,1.10371,1.1037700000000001,1.1034899999999999,1.10355,601,0.6053370786516457\n3466,2019/09/05 23:05:00,1.10355,1.1035700000000002,1.10321,1.10338,870,0.5604551920341121\n3467,2019/09/06,1.1033600000000001,1.1034899999999999,1.10293,1.10297,1785,0.477519379844934\n3468,2019/09/06 01:00:00,1.1029799999999998,1.10348,1.10297,1.10299,1502,0.3770794824398731\n3469,2019/09/06 02:00:00,1.1029799999999998,1.10356,1.10296,1.10334,1485,0.3936567164178772\n3470,2019/09/06 03:00:00,1.1033600000000001,1.10346,1.1032600000000001,1.1034,1155,0.09722222222217937\n3471,2019/09/06 04:00:00,1.10342,1.10376,1.10331,1.1037299999999999,1114,0.3023255813952816\n3472,2019/09/06 05:00:00,1.10372,1.10461,1.1036299999999999,1.10436,1460,0.5703422053231024\n3473,2019/09/06 06:00:00,1.10437,1.10459,1.1037299999999999,1.1042100000000001,5507,0.612244897959156\n3474,2019/09/06 07:00:00,1.10419,1.10511,1.10356,1.10463,6036,0.649659863945591\n3475,2019/09/06 08:00:00,1.10461,1.1047799999999999,1.10364,1.1036700000000002,4916,0.7047970479704869\n3476,2019/09/06 09:00:00,1.10369,1.104,1.10284,1.10301,5612,0.5441595441595528\n3477,2019/09/06 10:00:00,1.103,1.10314,1.10238,1.1029799999999998,4692,0.4860050890585164\n3478,2019/09/06 11:00:00,1.10296,1.10296,1.10198,1.10219,4358,0.4216867469879982\n3479,2019/09/06 12:00:00,1.10219,1.10461,1.10219,1.1039700000000001,9789,0.5862068965517716\n3480,2019/09/06 13:00:00,1.10398,1.10568,1.10396,1.1049799999999999,8102,0.6783004552352248\n3481,2019/09/06 14:00:00,1.1049799999999999,1.10531,1.10382,1.1047200000000001,6336,0.6930232558139767\n3482,2019/09/06 15:00:00,1.10474,1.105,1.10391,1.10419,3891,0.6930232558139767\n3483,2019/09/06 16:00:00,1.10417,1.10476,1.10266,1.1034899999999999,5493,0.5768725361366855\n3484,2019/09/06 17:00:00,1.1034899999999999,1.10391,1.1025,1.10378,4752,0.5649935649935921\n3485,2019/09/06 18:00:00,1.1037700000000001,1.10378,1.10283,1.10294,2476,0.5475234270415292\n3486,2019/09/06 19:00:00,1.10291,1.10323,1.10246,1.1025399999999999,2151,0.46351931330475116\n3487,2019/09/06 20:00:00,1.10253,1.10279,1.10248,1.10261,1188,0.46351931330475116\n3488,2019/09/08 21:05:00,1.1024200000000002,1.10273,1.1024,1.1024100000000001,346,0.42633228840127396\n3489,2019/09/08 22:05:00,1.1024100000000001,1.1025,1.1023,1.10233,792,0.4197530864197733\n3490,2019/09/08 23:05:00,1.1023100000000001,1.10237,1.1019299999999999,1.102,687,0.44958677685950504\n3491,2019/09/09,1.10199,1.10239,1.10151,1.10172,2117,0.4543946932006757\n3492,2019/09/09 01:00:00,1.10171,1.10285,1.10151,1.10266,2688,0.5254515599343397\n3493,2019/09/09 02:00:00,1.10266,1.10267,1.10237,1.1024100000000001,1376,0.34909909909910314\n3494,2019/09/09 03:00:00,1.1024200000000002,1.1027200000000001,1.1024,1.1026799999999999,768,0.15497076023396045\n3495,2019/09/09 04:00:00,1.10267,1.1029200000000001,1.10257,1.1027,851,0.2097701149425674\n3496,2019/09/09 05:00:00,1.1026799999999999,1.1028200000000001,1.1024399999999999,1.1025,1090,0.20221606648202123\n3497,2019/09/09 06:00:00,1.1025,1.1031799999999998,1.10222,1.1028799999999999,3287,0.37074829931969966\n3498,2019/09/09 07:00:00,1.1028799999999999,1.10342,1.10255,1.10309,4597,0.44039735099339183\n3499,2019/09/09 08:00:00,1.1030799999999998,1.10365,1.10291,1.10334,3784,0.4800000000000055\n3500,2019/09/09 09:00:00,1.10333,1.10417,1.10285,1.10378,3746,0.6011560693641822\n3501,2019/09/09 10:00:00,1.1037700000000001,1.1038700000000001,1.10209,1.10253,3980,0.49289099526066976\n3502,2019/09/09 11:00:00,1.1025399999999999,1.10362,1.10229,1.10362,3676,0.502415458937187\n3503,2019/09/09 12:00:00,1.10361,1.10586,1.10276,1.10428,5947,0.6878980891719594\n3504,2019/09/09 13:00:00,1.1043100000000001,1.10554,1.10418,1.10554,5218,0.7309644670050832\n3505,2019/09/09 14:00:00,1.10553,1.1063,1.1044100000000001,1.1057299999999999,5948,0.8121990369181317\n3506,2019/09/09 15:00:00,1.10571,1.10655,1.10544,1.10555,4095,0.8056478405315467\n3507,2019/09/09 16:00:00,1.10553,1.10677,1.10553,1.1059299999999999,3040,0.8124999999999889\n3508,2019/09/09 17:00:00,1.10595,1.10599,1.1053,1.10558,2059,0.7819314641744475\n3509,2019/09/09 18:00:00,1.10559,1.10565,1.10507,1.10519,1962,0.7472868217054258\n3510,2019/09/09 19:00:00,1.1051600000000001,1.10538,1.10486,1.1048799999999999,1525,0.7381316998468762\n3511,2019/09/09 20:00:00,1.10487,1.1049200000000001,1.10446,1.1047200000000001,1157,0.7023622047244318\n3512,2019/09/09 21:05:00,1.1046,1.1052,1.10449,1.1049799999999999,1363,0.7042253521126794\n3513,2019/09/09 22:05:00,1.105,1.10507,1.10483,1.1049,965,0.6931818181818239\n3514,2019/09/09 23:05:00,1.10491,1.10491,1.10457,1.10466,975,0.6421232876712362\n3515,2019/09/10,1.10461,1.10467,1.1042299999999998,1.10425,1847,0.6918819188191759\n3516,2019/09/10 01:00:00,1.1042399999999999,1.10467,1.10412,1.10425,2720,0.6781193490054335\n3517,2019/09/10 02:00:00,1.1042299999999998,1.10466,1.10401,1.1045200000000002,1564,0.4441176470588142\n3518,2019/09/10 03:00:00,1.1045399999999999,1.1046,1.10425,1.10437,925,0.4441176470588142\n3519,2019/09/10 04:00:00,1.10436,1.10467,1.1042399999999999,1.1042399999999999,753,0.3014705882352467\n3520,2019/09/10 05:00:00,1.1042399999999999,1.10463,1.1042299999999998,1.10428,1203,0.2298387096773995\n3521,2019/09/10 06:00:00,1.10428,1.10525,1.1041100000000001,1.10485,3191,0.32333333333334074\n3522,2019/09/10 07:00:00,1.10484,1.10591,1.1038700000000001,1.10445,5689,0.4441416893732883\n3523,2019/09/10 08:00:00,1.10446,1.1046200000000002,1.10361,1.1038,5099,0.44054054054050806\n3524,2019/09/10 09:00:00,1.10378,1.10463,1.10358,1.10459,3370,0.4645892351274314\n3525,2019/09/10 10:00:00,1.10458,1.10461,1.10362,1.10386,2622,0.5239616613418\n3526,2019/09/10 11:00:00,1.1038700000000001,1.10412,1.10322,1.10362,3978,0.41846153846151046\n3527,2019/09/10 12:00:00,1.1036,1.10433,1.10353,1.10396,4285,0.45375722543350916\n3528,2019/09/10 13:00:00,1.10395,1.1043399999999999,1.1034,1.1039299999999999,4056,0.4730538922155227\n3529,2019/09/10 14:00:00,1.10395,1.1045399999999999,1.1030200000000001,1.10415,6060,0.49720670391062666\n3530,2019/09/10 15:00:00,1.10418,1.1051600000000001,1.10401,1.10418,5303,0.5867970660147018\n3531,2019/09/10 16:00:00,1.10417,1.10479,1.104,1.10406,3089,0.6015037593985619\n3532,2019/09/10 17:00:00,1.10405,1.10449,1.10358,1.10445,2100,0.5442176870748722\n3533,2019/09/10 18:00:00,1.1044399999999999,1.10483,1.1037700000000001,1.1047200000000001,2129,0.571734475374782\n3534,2019/09/10 19:00:00,1.1047200000000001,1.1047200000000001,1.10372,1.1039299999999999,2922,0.5668789808917636\n3535,2019/09/10 20:00:00,1.1039299999999999,1.1043399999999999,1.10392,1.10427,1138,0.5163727959697695\n3536,2019/09/10 21:05:00,1.1041,1.105,1.10344,1.10487,1830,0.48693586698339303\n3537,2019/09/10 22:05:00,1.10486,1.10507,1.10458,1.10463,944,0.5273631840796438\n3538,2019/09/10 23:05:00,1.10463,1.1049799999999999,1.10461,1.10497,1165,0.5301507537689015\n3539,2019/09/11,1.1049799999999999,1.1054700000000002,1.10458,1.10463,2282,0.5777777777778327\n3540,2019/09/11 01:00:00,1.10463,1.10476,1.10433,1.10461,1703,0.5977011494253542\n3541,2019/09/11 02:00:00,1.1046200000000002,1.1051600000000001,1.1046,1.10467,1729,0.6145374449339942\n3542,2019/09/11 03:00:00,1.1046799999999999,1.10507,1.10446,1.1049200000000001,1174,0.612334801762193\n3543,2019/09/11 04:00:00,1.10494,1.10551,1.10486,1.10525,1882,0.6863636363636765\n3544,2019/09/11 05:00:00,1.10522,1.10533,1.10461,1.10485,1824,0.5955334987593649\n3545,2019/09/11 06:00:00,1.10486,1.10489,1.1041100000000001,1.1047200000000001,2985,0.5309734513274841\n3546,2019/09/11 07:00:00,1.1047200000000001,1.10481,1.1033600000000001,1.1033899999999999,4520,0.49484536082480074\n3547,2019/09/11 08:00:00,1.10338,1.10344,1.10226,1.10253,4157,0.36720142602501427\n3548,2019/09/11 09:00:00,1.1025399999999999,1.10273,1.10196,1.10196,4176,0.35153583617754114\n3549,2019/09/11 10:00:00,1.10196,1.10216,1.10066,1.10073,4530,0.2877094972067611\n3550,2019/09/11 11:00:00,1.10076,1.1010799999999998,1.0996299999999999,1.09968,4398,0.19858156028374177\n3551,2019/09/11 12:00:00,1.09969,1.10065,1.0996299999999999,1.10004,4538,0.19054441260750332\n3552,2019/09/11 13:00:00,1.10005,1.10026,1.09933,1.09948,4569,0.1826923076923605\n3553,2019/09/11 14:00:00,1.0994700000000002,1.09991,1.09849,1.09972,4937,0.11052631578949582\n3554,2019/09/11 15:00:00,1.09969,1.1001299999999998,1.099,1.10002,3621,0.14002642007926686\n3555,2019/09/11 16:00:00,1.10001,1.10077,1.09958,1.1006799999999999,2434,0.1664532650448224\n3556,2019/09/11 17:00:00,1.10067,1.10112,1.10041,1.10077,1739,0.20573566084789563\n3557,2019/09/11 18:00:00,1.10074,1.10117,1.10048,1.10066,2125,0.1651376146789036\n3558,2019/09/11 19:00:00,1.10066,1.10107,1.10063,1.101,1368,0.17073170731707465\n3559,2019/09/11 20:00:00,1.10101,1.1013700000000002,1.10086,1.101,973,0.21727019498609182\n3560,2019/09/11 21:05:00,1.10087,1.10096,1.10079,1.10095,244,0.2400000000000205\n3561,2019/09/11 22:05:00,1.10094,1.10103,1.10071,1.10085,665,0.2936936936937286\n3562,2019/09/11 23:05:00,1.10086,1.1013600000000001,1.10083,1.1013,1621,0.3512544802867883\n3563,2019/09/12,1.1013,1.1013899999999999,1.10076,1.10103,2341,0.4543378995434099\n3564,2019/09/12 01:00:00,1.10103,1.1014700000000002,1.10103,1.10132,1798,0.6034985422741398\n3565,2019/09/12 02:00:00,1.1013,1.1013,1.10084,1.10093,1206,0.5718232044199885\n3566,2019/09/12 03:00:00,1.10095,1.10133,1.10095,1.1012600000000001,1413,0.626865671641886\n3567,2019/09/12 04:00:00,1.10124,1.10143,1.10115,1.1013600000000001,1023,0.8429118773947263\n3568,2019/09/12 05:00:00,1.10135,1.10146,1.10117,1.10132,864,0.8305785123968144\n3569,2019/09/12 06:00:00,1.1013,1.10143,1.10051,1.10138,2700,0.5614754098362352\n3570,2019/09/12 07:00:00,1.1013899999999999,1.10185,1.10112,1.1016700000000001,4388,0.5737051792830349\n3571,2019/09/12 08:00:00,1.10165,1.1032,1.10152,1.10266,4648,0.719160104986983\n3572,2019/09/12 09:00:00,1.10266,1.1031,1.10247,1.1029,3107,0.719160104986983\n3573,2019/09/12 10:00:00,1.1029200000000001,1.10312,1.1019299999999999,1.10235,3323,0.6044226044226765\n3574,2019/09/12 11:00:00,1.10237,1.1069,1.09606,1.09656,11176,0.457142857142886\n3575,2019/09/12 12:00:00,1.09655,1.0973,1.09266,1.09456,18834,0.3650887573964688\n3576,2019/09/12 13:00:00,1.09453,1.10463,1.094,1.1034899999999999,18950,0.5510460251046112\n3577,2019/09/12 14:00:00,1.10348,1.10689,1.10281,1.1029200000000001,15742,0.5909439754413\n3578,2019/09/12 15:00:00,1.10293,1.10791,1.10257,1.10731,8973,0.5998531571218851\n3579,2019/09/12 16:00:00,1.10731,1.1074,1.1061299999999998,1.10674,4933,0.6040665434380813\n3580,2019/09/12 17:00:00,1.10673,1.10867,1.10656,1.10667,4845,0.6214209968186689\n3581,2019/09/12 18:00:00,1.10667,1.1074899999999999,1.10632,1.10734,3497,0.614843475202256\n3582,2019/09/12 19:00:00,1.10734,1.10735,1.1062,1.10646,2213,0.6118513323983215\n3583,2019/09/12 20:00:00,1.10645,1.10648,1.10612,1.1063399999999999,911,0.6245526127415891\n3584,2019/09/12 21:05:00,1.10635,1.1066799999999999,1.1061299999999998,1.10646,873,0.6215728715728702\n3585,2019/09/12 22:05:00,1.10647,1.10651,1.10574,1.1057700000000001,985,0.5934230194319897\n3586,2019/09/12 23:05:00,1.10576,1.10579,1.1054899999999999,1.1056,547,0.5879303961495742\n3587,2019/09/13,1.10565,1.10645,1.10565,1.10639,2043,0.6093692364441174\n3588,2019/09/13 01:00:00,1.10638,1.1066,1.10624,1.1064399999999999,1514,0.7319704713231105\n3589,2019/09/13 02:00:00,1.10643,1.10661,1.10635,1.1065399999999999,879,0.9071729957805924\n3590,2019/09/13 03:00:00,1.1065399999999999,1.10689,1.1065200000000002,1.1068799999999999,989,0.8158995815899572\n3591,2019/09/13 04:00:00,1.10687,1.10727,1.10665,1.10691,1078,0.7504725897920635\n3592,2019/09/13 05:00:00,1.1069,1.10727,1.10687,1.10707,1004,0.7320099255583187\n3593,2019/09/13 06:00:00,1.10706,1.10962,1.10674,1.10953,7461,0.8141321044546957\n3594,2019/09/13 07:00:00,1.10954,1.1109200000000001,1.10914,1.10935,8610,0.8149847094801322\n3595,2019/09/13 08:00:00,1.10934,1.1097299999999999,1.10769,1.10914,7477,0.6877419354838851\n3596,2019/09/13 09:00:00,1.1091600000000001,1.1104,1.10893,1.11002,4833,0.7228915662650706\n3597,2019/09/13 10:00:00,1.1100299999999999,1.11057,1.109,1.1091,4182,0.7353992848629491\n3598,2019/09/13 11:00:00,1.10911,1.1106200000000002,1.1090799999999998,1.11024,3372,0.7305825242718662\n3599,2019/09/13 12:00:00,1.1102299999999998,1.11045,1.10788,1.10873,7569,0.6651933701657688\n3600,2019/09/13 13:00:00,1.1087200000000001,1.10879,1.1065200000000002,1.10683,6573,0.5925196850394084\n3601,2019/09/13 14:00:00,1.10683,1.1085399999999999,1.10604,1.10801,7117,0.5370741482966235\n3602,2019/09/13 15:00:00,1.10802,1.1085,1.1069,1.10735,3963,0.5300101729400061\n3603,2019/09/13 16:00:00,1.10737,1.10762,1.10663,1.10756,2800,0.5153617443013118\n3604,2019/09/13 17:00:00,1.10755,1.1079299999999999,1.10703,1.10759,2688,0.5167984189723541\n3605,2019/09/13 18:00:00,1.10761,1.10769,1.10665,1.1066799999999999,2256,0.4792490118577254\n3606,2019/09/13 19:00:00,1.10667,1.10768,1.10667,1.10762,2135,0.4792490118577254\n3607,2019/09/13 20:00:00,1.10759,1.10788,1.1074700000000002,1.10772,1432,0.3443877551020565\n3608,2019/09/15 21:05:00,1.10727,1.10756,1.107,1.10734,959,0.1997146932952969\n3609,2019/09/15 22:05:00,1.10735,1.10811,1.10723,1.10792,2643,0.3191489361701927\n3610,2019/09/15 23:05:00,1.1079299999999999,1.1086,1.10791,1.10828,1387,0.29848229342324284\n3611,2019/09/16,1.10829,1.1084100000000001,1.10727,1.10753,3441,0.24999999999997397\n3612,2019/09/16 01:00:00,1.10755,1.10792,1.1075,1.10784,2625,0.24409448818893756\n3613,2019/09/16 02:00:00,1.1078299999999999,1.1078299999999999,1.1072899999999999,1.10744,1563,0.2891791044775576\n3614,2019/09/16 03:00:00,1.1074700000000002,1.10759,1.10697,1.1070200000000001,1154,0.3587962962962226\n3615,2019/09/16 04:00:00,1.10703,1.1073899999999999,1.1069799999999999,1.1072799999999998,816,0.4036458333332764\n3616,2019/09/16 05:00:00,1.10727,1.1072799999999998,1.10673,1.10683,1019,0.3789731051344328\n3617,2019/09/16 06:00:00,1.10681,1.10765,1.10665,1.1070799999999998,4562,0.449648711943776\n3618,2019/09/16 07:00:00,1.10707,1.10818,1.10671,1.1071799999999998,4694,0.4766146993318443\n3619,2019/09/16 08:00:00,1.10715,1.10723,1.1057700000000001,1.10591,4734,0.42376237623763\n3620,2019/09/16 09:00:00,1.10589,1.1069,1.1057299999999999,1.1060299999999998,4253,0.4204322200392772\n3621,2019/09/16 10:00:00,1.10604,1.10604,1.10381,1.10382,3898,0.28487518355359687\n3622,2019/09/16 11:00:00,1.1038299999999999,1.10428,1.10277,1.10296,4468,0.26287262872629646\n3623,2019/09/16 12:00:00,1.10293,1.10353,1.1024200000000002,1.10263,5291,0.1935933147632634\n3624,2019/09/16 13:00:00,1.10261,1.10267,1.10112,1.1011600000000001,4753,0.11264080100126776\n3625,2019/09/16 14:00:00,1.1011600000000001,1.10171,1.09931,1.0997,6228,0.09825327510918312\n3626,2019/09/16 15:00:00,1.09969,1.101,1.0993,1.10058,5698,0.09814612868049193\n3627,2019/09/16 16:00:00,1.1006,1.10096,1.09971,1.10022,3833,0.1004464285714414\n3628,2019/09/16 17:00:00,1.1002299999999998,1.1004200000000002,1.09938,1.09953,2450,0.10033444816054721\n3629,2019/09/16 18:00:00,1.09952,1.10066,1.09951,1.10059,2320,0.12377850162865647\n3630,2019/09/16 19:00:00,1.10057,1.10109,1.10049,1.1006799999999999,2831,0.16719914802980274\n3631,2019/09/16 20:00:00,1.1006799999999999,1.10075,1.0997700000000001,1.0997700000000001,1196,0.12422360248444106\n3632,2019/09/16 21:05:00,1.0996700000000001,1.1002100000000001,1.09955,1.1001100000000001,1677,0.07165775401066786\n3633,2019/09/16 22:05:00,1.1001299999999998,1.10057,1.1001100000000001,1.10032,989,0.1174458380843415\n3634,2019/09/16 23:05:00,1.1003,1.10048,1.10007,1.10028,897,0.11744583808434447\n3635,2019/09/17,1.10027,1.10112,1.10007,1.10086,2658,0.2229639519358997\n3636,2019/09/17 01:00:00,1.1008799999999999,1.10107,1.10007,1.1006799999999999,3225,0.2589147286821517\n3637,2019/09/17 02:00:00,1.1006799999999999,1.10132,1.10054,1.10117,2006,0.3023622047243934\n3638,2019/09/17 03:00:00,1.1011600000000001,1.1013,1.10051,1.101,1751,0.37795275590549837\n3639,2019/09/17 04:00:00,1.10099,1.1012899999999999,1.10089,1.10124,1325,0.5871559633027492\n3640,2019/09/17 05:00:00,1.10121,1.10135,1.10067,1.1011600000000001,1351,0.5593220338983508\n3641,2019/09/17 06:00:00,1.10117,1.10124,1.0989799999999998,1.09954,5174,0.37858508604207786\n3642,2019/09/17 07:00:00,1.09953,1.10172,1.09953,1.10162,7260,0.4572490706319804\n3643,2019/09/17 08:00:00,1.10161,1.1022399999999999,1.10121,1.1014,4746,0.4840989399293427\n3644,2019/09/17 09:00:00,1.1014,1.10196,1.10063,1.1016700000000001,4843,0.39759036144580573\n3645,2019/09/17 10:00:00,1.10168,1.10247,1.10085,1.1024200000000002,3976,0.5035714285714318\n3646,2019/09/17 11:00:00,1.1024200000000002,1.10269,1.1016,1.10233,3941,0.542857142857144\n3647,2019/09/17 12:00:00,1.10232,1.1032,1.102,1.10265,4624,0.55478260869566\n3648,2019/09/17 13:00:00,1.10264,1.10388,1.10204,1.1032600000000001,9607,0.6056338028169103\n3649,2019/09/17 14:00:00,1.10325,1.10501,1.10294,1.1047200000000001,7302,0.6337209302325585\n3650,2019/09/17 15:00:00,1.10471,1.10661,1.10471,1.10628,6034,0.7028301886792454\n3651,2019/09/17 16:00:00,1.10627,1.10709,1.10566,1.1069200000000001,3418,0.7106773823191643\n3652,2019/09/17 17:00:00,1.1069,1.10732,1.1065200000000002,1.10656,2801,0.7205387205387151\n3653,2019/09/17 18:00:00,1.10659,1.1071799999999998,1.10655,1.10656,2464,0.7205387205387151\n3654,2019/09/17 19:00:00,1.10655,1.10722,1.10645,1.10711,1920,0.7297605473203991\n3655,2019/09/17 20:00:00,1.10703,1.10742,1.107,1.10721,1214,0.9065934065934069\n3656,2019/09/17 21:05:00,1.10703,1.1073,1.10687,1.10725,573,0.8831168831168881\n3657,2019/09/17 22:05:00,1.10724,1.1073,1.10699,1.10699,824,0.8736349453978244\n3658,2019/09/17 23:05:00,1.10699,1.10753,1.1069799999999999,1.10733,888,0.9604612850082359\n3659,2019/09/18,1.10734,1.10744,1.1068,1.10694,2132,0.9268292682927074\n3660,2019/09/18 01:00:00,1.10695,1.10714,1.10659,1.10691,2044,0.8900523560209629\n3661,2019/09/18 02:00:00,1.1069200000000001,1.10694,1.10649,1.10663,1383,0.8627819548872427\n3662,2019/09/18 03:00:00,1.10663,1.10673,1.10646,1.10653,1162,0.8372591006424318\n3663,2019/09/18 04:00:00,1.1065200000000002,1.10655,1.10639,1.10639,745,0.7700831024931135\n3664,2019/09/18 05:00:00,1.10643,1.10663,1.10626,1.1065200000000002,1147,0.5675675675676568\n3665,2019/09/18 06:00:00,1.10655,1.10683,1.10563,1.1057299999999999,2985,0.3813229571985488\n3666,2019/09/18 07:00:00,1.10572,1.1068,1.10511,1.10542,6550,0.26223776223784206\n3667,2019/09/18 08:00:00,1.10544,1.1056,1.10407,1.10414,5384,0.19230769230775582\n3668,2019/09/18 09:00:00,1.10415,1.1048799999999999,1.10364,1.10486,4709,0.16945107398568082\n3669,2019/09/18 10:00:00,1.10486,1.10519,1.10426,1.1043399999999999,4187,0.19069767441861593\n3670,2019/09/18 11:00:00,1.10433,1.10519,1.1039700000000001,1.10512,3921,0.18385650224216588\n3671,2019/09/18 12:00:00,1.10512,1.10572,1.10507,1.1056,3959,0.27054108216436296\n3672,2019/09/18 13:00:00,1.1056,1.10608,1.10507,1.10548,4642,0.28962818003917085\n3673,2019/09/18 14:00:00,1.10548,1.1065399999999999,1.10537,1.10602,4427,0.35992578849722645\n3674,2019/09/18 15:00:00,1.10604,1.10649,1.10542,1.10607,2967,0.3745173745173875\n3675,2019/09/18 16:00:00,1.10604,1.10679,1.1059700000000001,1.1063,2839,0.41635687732342835\n3676,2019/09/18 17:00:00,1.10628,1.10674,1.10582,1.10636,2924,0.40727272727272645\n3677,2019/09/18 18:00:00,1.10636,1.10645,1.10132,1.10325,15534,0.22557905337361744\n3678,2019/09/18 19:00:00,1.10325,1.1047,1.10162,1.10327,8366,0.22222222222221713\n3679,2019/09/18 20:00:00,1.10323,1.10352,1.10239,1.10293,1784,0.22047244094488155\n3680,2019/09/18 21:05:00,1.10276,1.1034899999999999,1.10265,1.10323,1430,0.234169653524488\n3681,2019/09/18 22:05:00,1.10323,1.10333,1.1029200000000001,1.103,953,0.2673942701227758\n3682,2019/09/18 23:05:00,1.10296,1.10304,1.10263,1.1028799999999999,1047,0.27260083449234407\n3683,2019/09/19,1.1028799999999999,1.10293,1.10225,1.10251,2280,0.22727272727271614\n3684,2019/09/19 01:00:00,1.10251,1.1032600000000001,1.10239,1.10311,3576,0.2712328767123301\n3685,2019/09/19 02:00:00,1.1031,1.10356,1.10299,1.10323,2706,0.24752475247523137\n3686,2019/09/19 03:00:00,1.10325,1.1037700000000001,1.1031799999999998,1.10354,3398,0.2312138728323679\n3687,2019/09/19 04:00:00,1.10354,1.1039299999999999,1.1034,1.10388,1524,0.19637462235647174\n3688,2019/09/19 05:00:00,1.1038700000000001,1.10426,1.10362,1.10409,1597,0.23453237410071442\n3689,2019/09/19 06:00:00,1.10409,1.10487,1.10401,1.1044399999999999,4068,0.2672176308539919\n3690,2019/09/19 07:00:00,1.10445,1.10523,1.10346,1.10509,8836,0.28678304239401403\n3691,2019/09/19 08:00:00,1.10509,1.10643,1.10507,1.10585,6864,0.7415254237288169\n3692,2019/09/19 09:00:00,1.10585,1.1068200000000001,1.1056,1.10615,6044,0.7612524461839613\n3693,2019/09/19 10:00:00,1.10616,1.10669,1.10556,1.1065200000000002,4866,0.7553398058252777\n3694,2019/09/19 11:00:00,1.10651,1.10731,1.1059999999999999,1.10674,5996,0.7816291161178848\n3695,2019/09/19 12:00:00,1.1067200000000001,1.1071799999999998,1.10608,1.10667,4919,0.7816291161178848\n3696,2019/09/19 13:00:00,1.10665,1.10695,1.10591,1.10606,5203,0.7982300884956264\n3697,2019/09/19 14:00:00,1.10606,1.10608,1.10496,1.1054899999999999,5262,0.7250803858521405\n3698,2019/09/19 15:00:00,1.1055,1.1057,1.10426,1.1046,3687,0.6342943854325179\n3699,2019/09/19 16:00:00,1.10461,1.1047200000000001,1.10381,1.10451,2527,0.5756676557863875\n3700,2019/09/19 17:00:00,1.1045200000000002,1.10615,1.1045,1.10591,5345,0.6407035175879634\n3701,2019/09/19 18:00:00,1.1059,1.1059700000000001,1.105,1.10538,2777,0.6333333333333704\n3702,2019/09/19 19:00:00,1.10537,1.10538,1.10396,1.10437,2798,0.5417156286721778\n3703,2019/09/19 20:00:00,1.10437,1.10445,1.1039299999999999,1.10405,1012,0.5044136191677326\n3704,2019/09/19 21:05:00,1.10394,1.10437,1.1038700000000001,1.10414,789,0.5141242937853411\n3705,2019/09/19 22:05:00,1.10414,1.10451,1.1039299999999999,1.10446,978,0.4285714285714549\n3706,2019/09/19 23:05:00,1.10448,1.1045399999999999,1.10439,1.10443,688,0.39222614840988135\n3707,2019/09/20,1.1044200000000002,1.10515,1.1043399999999999,1.10501,2361,0.4506369426751528\n3708,2019/09/20 01:00:00,1.1050200000000001,1.10541,1.1049799999999999,1.10519,1905,0.41722972972970845\n3709,2019/09/20 02:00:00,1.1051600000000001,1.10592,1.10507,1.10586,1428,0.46345256609640645\n3710,2019/09/20 03:00:00,1.10585,1.10585,1.10542,1.1056,1204,0.4760383386581308\n3711,2019/09/20 04:00:00,1.1056,1.10591,1.10555,1.10579,1233,0.5661080074487721\n3712,2019/09/20 05:00:00,1.1057700000000001,1.10586,1.10542,1.1054899999999999,1383,0.6333333333333133\n3713,2019/09/20 06:00:00,1.1054899999999999,1.10639,1.10535,1.10599,3881,0.7212121212121095\n3714,2019/09/20 07:00:00,1.10598,1.10673,1.10457,1.1050200000000001,5829,0.5344827586206782\n3715,2019/09/20 08:00:00,1.10503,1.1057299999999999,1.10469,1.1047,4591,0.5344827586206782\n3716,2019/09/20 09:00:00,1.1047,1.1053899999999999,1.10446,1.10475,4365,0.6475195822454202\n3717,2019/09/20 10:00:00,1.1047200000000001,1.1051799999999998,1.10398,1.10428,4296,0.5794392523364574\n3718,2019/09/20 11:00:00,1.10427,1.10428,1.10247,1.10321,4771,0.43280977312389285\n3719,2019/09/20 12:00:00,1.10321,1.10334,1.1018700000000001,1.10253,5097,0.37802907915991946\n3720,2019/09/20 13:00:00,1.10255,1.10259,1.10124,1.10195,5804,0.34020618556701165\n3721,2019/09/20 14:00:00,1.1019299999999999,1.10222,1.10041,1.1010799999999998,6823,0.24425287356320433\n3722,2019/09/20 15:00:00,1.10106,1.1017,1.09959,1.10022,6566,0.19148936170211886\n3723,2019/09/20 16:00:00,1.10022,1.10105,1.1001,1.1007,2888,0.13266761768900287\n3724,2019/09/20 17:00:00,1.1006799999999999,1.1019299999999999,1.10054,1.10184,6116,0.22940430925218736\n3725,2019/09/20 18:00:00,1.10186,1.10194,1.10095,1.10144,3757,0.22448979591834772\n3726,2019/09/20 19:00:00,1.10146,1.10215,1.10121,1.10188,3069,0.2487373737373584\n3727,2019/09/20 20:00:00,1.10184,1.10215,1.1014700000000002,1.1016700000000001,1224,0.19672131147540037"
  },
  {
    "path": "Tests/TestData/eurusd_candle_patterns.txt",
    "content": "Date,Open,High,Low,Close,Volume,CDL2CROWS,CDL3BLACKCROWS,CDL3INSIDE,CDL3LINESTRIKE,CDL3OUTSIDE,CDL3STARSINSOUTH,CDL3WHITESOLDIERS,CDLABANDONEDBABY,CDLADVANCEBLOCK,CDLBELTHOLD,CDLBREAKAWAY,CDLCLOSINGMARUBOZU,CDLCONCEALBABYSWALL,CDLCOUNTERATTACK,CDLDARKCLOUDCOVER,CDLDOJI,CDLDOJISTAR,CDLDRAGONFLYDOJI,CDLENGULFING,CDLEVENINGDOJISTAR,CDLEVENINGSTAR,CDLGAPSIDESIDEWHITE,CDLGRAVESTONEDOJI,CDLHAMMER,CDLHANGINGMAN,CDLHARAMI,CDLHARAMICROSS,CDLHIGHWAVE,CDLHIKKAKE,CDLHIKKAKEMOD,CDLHOMINGPIGEON,CDLIDENTICAL3CROWS,CDLINNECK,CDLINVERTEDHAMMER,CDLKICKING,CDLKICKINGBYLENGTH,CDLLADDERBOTTOM,CDLLONGLEGGEDDOJI,CDLLONGLINE,CDLMARUBOZU,CDLMATCHINGLOW,CDLMATHOLD,CDLMORNINGDOJISTAR,CDLMORNINGSTAR,CDLONNECK,CDLPIERCING,CDLRICKSHAWMAN,CDLRISEFALL3METHODS,CDLSEPARATINGLINES,CDLSHOOTINGSTAR,CDLSHORTLINE,CDLSPINNINGTOP,CDLSTALLEDPATTERN,CDLSTICKSANDWICH,CDLTAKURI,CDLTASUKIGAP,CDLTHRUSTING,CDLTRISTAR,CDLUNIQUE3RIVER,CDLUPSIDEGAP2CROWS,CDLXSIDEGAP3METHODS\n4/1/2007 12:00:00 AM,1.337395,1.337695,1.333245,1.335395,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n4/2/2007 12:00:00 AM,1.335495,1.338345,1.334345,1.336645,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n4/3/2007 12:00:00 AM,1.336545,1.338095,1.331845,1.333395,0,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n4/4/2007 12:00:00 AM,1.333345,1.338095,1.332845,1.336745,0,,,,,0,,,,,,,,,,,,,,100,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n4/5/2007 12:00:00 AM,1.336795,1.344145,1.335345,1.342045,0,,,,,100,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n4/6/2007 12:00:00 AM,1.342095,1.342645,1.336445,1.337445,0,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n4/8/2007 12:00:00 AM,1.337645,1.337995,1.336045,1.336045,0,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,100,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,0\n4/9/2007 12:00:00 AM,1.336145,1.343445,1.334045,1.341445,0,,,,,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n4/10/2007 12:00:00 AM,1.341545,1.345495,1.340245,1.342095,0,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n4/11/2007 12:00:00 AM,1.342045,1.346845,1.340745,1.346445,0,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,200,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n4/12/2007 12:00:00 AM,1.346345,1.352395,1.344145,1.351445,0,,,,0,0,,,,,0,,0,,,,0,,0,0,,,0,0,,,,,0,0,0,,,,,,,,0,0,0,0,,,,,,0,,,,0,0,,0,0,0,,,,,0\n4/13/2007 12:00:00 AM,1.351495,1.355295,1.348545,1.353045,0,,,,0,0,,,,,0,,0,,0,0,0,0,0,0,,,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,,,,0,0,0,,0,0,0,100,,0,0,0,0,,,,0\n4/15/2007 12:00:00 AM,1.354195,1.357695,1.354195,1.356045,0,0,,0,0,0,0,0,0,-100,0,,0,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2007 12:00:00 AM,1.356095,1.356295,1.352545,1.353545,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,0,,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/17/2007 12:00:00 AM,1.353645,1.359445,1.352745,1.358445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2007 12:00:00 AM,1.358545,1.361945,1.355645,1.360245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2007 12:00:00 AM,1.360145,1.362845,1.356145,1.361845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2007 12:00:00 AM,1.361745,1.363745,1.358645,1.359245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2007 12:00:00 AM,1.359945,1.360795,1.358245,1.358445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/23/2007 12:00:00 AM,1.358345,1.359445,1.354145,1.355945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2007 12:00:00 AM,1.356045,1.364345,1.355145,1.363645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2007 12:00:00 AM,1.363545,1.366545,1.362245,1.364595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/26/2007 12:00:00 AM,1.364745,1.365445,1.358445,1.360345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2007 12:00:00 AM,1.360445,1.368245,1.358745,1.365045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2007 12:00:00 AM,1.365045,1.365045,1.361495,1.364445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/30/2007 12:00:00 AM,1.364345,1.367895,1.358945,1.365245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/1/2007 12:00:00 AM,1.365145,1.367295,1.356245,1.356545,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2007 12:00:00 AM,1.356595,1.361195,1.356045,1.359945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/3/2007 12:00:00 AM,1.360045,1.362195,1.353545,1.354445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2007 12:00:00 AM,1.354545,1.361095,1.353945,1.359645,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2007 12:00:00 AM,1.360345,1.361145,1.359095,1.360645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n5/7/2007 12:00:00 AM,1.360695,1.362695,1.359345,1.361195,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n5/8/2007 12:00:00 AM,1.361145,1.362145,1.351645,1.354345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2007 12:00:00 AM,1.354445,1.356595,1.351945,1.352795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2007 12:00:00 AM,1.352745,1.356395,1.346245,1.347845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2007 12:00:00 AM,1.347895,1.352945,1.346645,1.352945,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n5/13/2007 12:00:00 AM,1.353845,1.355045,1.352895,1.354845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/14/2007 12:00:00 AM,1.354945,1.355795,1.352445,1.354345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/15/2007 12:00:00 AM,1.354245,1.360945,1.352745,1.359145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2007 12:00:00 AM,1.359045,1.360945,1.350445,1.352845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2007 12:00:00 AM,1.352895,1.354395,1.347745,1.348745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2007 12:00:00 AM,1.348845,1.352145,1.346545,1.351095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2007 12:00:00 AM,1.351245,1.353095,1.351145,1.351645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n5/21/2007 12:00:00 AM,1.351545,1.351945,1.343645,1.345395,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2007 12:00:00 AM,1.345345,1.347595,1.343845,1.345645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/23/2007 12:00:00 AM,1.345745,1.350095,1.341645,1.345145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/24/2007 12:00:00 AM,1.345045,1.346195,1.341145,1.342195,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2007 12:00:00 AM,1.342195,1.347295,1.341345,1.344645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2007 12:00:00 AM,1.344495,1.345745,1.344495,1.345745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/28/2007 12:00:00 AM,1.345645,1.345845,1.341945,1.343445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/29/2007 12:00:00 AM,1.343345,1.351995,1.343145,1.344945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2007 12:00:00 AM,1.344845,1.345145,1.340745,1.343045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2007 12:00:00 AM,1.342995,1.347745,1.342945,1.345095,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2007 12:00:00 AM,1.345195,1.346295,1.339245,1.344645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/3/2007 12:00:00 AM,1.344595,1.345245,1.343695,1.344645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n6/4/2007 12:00:00 AM,1.344745,1.350445,1.343245,1.350395,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2007 12:00:00 AM,1.350345,1.355345,1.348945,1.352545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2007 12:00:00 AM,1.352445,1.353845,1.348545,1.350645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2007 12:00:00 AM,1.350545,1.351195,1.341945,1.342345,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2007 12:00:00 AM,1.342395,1.342845,1.332045,1.336845,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2007 12:00:00 AM,1.337245,1.337445,1.334345,1.335245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/11/2007 12:00:00 AM,1.335145,1.336745,1.333345,1.336445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2007 12:00:00 AM,1.336345,1.336945,1.328745,1.330095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2007 12:00:00 AM,1.330195,1.331645,1.326345,1.331245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2007 12:00:00 AM,1.331345,1.333045,1.327945,1.332245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2007 12:00:00 AM,1.332345,1.338645,1.330545,1.337945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2007 12:00:00 AM,1.338545,1.339345,1.337595,1.339095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/18/2007 12:00:00 AM,1.339045,1.342845,1.338845,1.342145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/19/2007 12:00:00 AM,1.342045,1.343745,1.338445,1.343295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2007 12:00:00 AM,1.343245,1.343545,1.338345,1.339645,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2007 12:00:00 AM,1.339545,1.340595,1.337245,1.339295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/22/2007 12:00:00 AM,1.339395,1.346895,1.339245,1.346645,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,100,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2007 12:00:00 AM,1.346695,1.347345,1.345795,1.346645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/25/2007 12:00:00 AM,1.346595,1.347345,1.343945,1.346445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/26/2007 12:00:00 AM,1.346345,1.347895,1.343245,1.343995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2007 12:00:00 AM,1.343945,1.346445,1.341545,1.346245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2007 12:00:00 AM,1.346145,1.348195,1.342345,1.343845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2007 12:00:00 AM,1.343745,1.353995,1.343545,1.353445,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2007 12:00:00 AM,1.353345,1.354745,1.352945,1.353345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/2/2007 12:00:00 AM,1.353245,1.363845,1.352845,1.362345,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2007 12:00:00 AM,1.362245,1.363345,1.358445,1.361545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/4/2007 12:00:00 AM,1.361445,1.363095,1.360645,1.361295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/5/2007 12:00:00 AM,1.361445,1.365895,1.357895,1.359895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/6/2007 12:00:00 AM,1.359845,1.364095,1.356795,1.362445,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2007 12:00:00 AM,1.363145,1.363645,1.361645,1.362545,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/9/2007 12:00:00 AM,1.362445,1.363795,1.361045,1.361745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/10/2007 12:00:00 AM,1.361645,1.378795,1.359445,1.373745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2007 12:00:00 AM,1.373695,1.378095,1.373345,1.375345,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2007 12:00:00 AM,1.375395,1.379845,1.374945,1.378145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/13/2007 12:00:00 AM,1.378195,1.381395,1.376345,1.378745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/15/2007 12:00:00 AM,1.378595,1.379195,1.377095,1.379045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n7/16/2007 12:00:00 AM,1.378945,1.380295,1.375945,1.378545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/17/2007 12:00:00 AM,1.378495,1.382395,1.375745,1.382395,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2007 12:00:00 AM,1.382345,1.383295,1.375245,1.379945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2007 12:00:00 AM,1.379845,1.383095,1.378645,1.379595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/20/2007 12:00:00 AM,1.379595,1.384295,1.377995,1.382645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2007 12:00:00 AM,1.384145,1.384545,1.382995,1.383395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/23/2007 12:00:00 AM,1.383345,1.384295,1.379545,1.381995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2007 12:00:00 AM,1.382095,1.385195,1.380145,1.380845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2007 12:00:00 AM,1.380795,1.382345,1.369645,1.370645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2007 12:00:00 AM,1.370545,1.377095,1.369245,1.374345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2007 12:00:00 AM,1.374245,1.374845,1.363045,1.363795,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2007 12:00:00 AM,1.363545,1.364345,1.360995,1.363495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/30/2007 12:00:00 AM,1.363445,1.372695,1.362645,1.371595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2007 12:00:00 AM,1.371545,1.372295,1.365245,1.366045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2007 12:00:00 AM,1.365945,1.370895,1.363745,1.365895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/2/2007 12:00:00 AM,1.365995,1.371295,1.365095,1.370545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2007 12:00:00 AM,1.370595,1.381945,1.368345,1.378745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2007 12:00:00 AM,1.377395,1.383995,1.376845,1.381545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2007 12:00:00 AM,1.381595,1.383895,1.378045,1.380745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/7/2007 12:00:00 AM,1.380795,1.381095,1.373645,1.375045,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2007 12:00:00 AM,1.375095,1.382595,1.372145,1.380345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2007 12:00:00 AM,1.380295,1.381695,1.365445,1.366395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2007 12:00:00 AM,1.366345,1.370545,1.364145,1.369595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2007 12:00:00 AM,1.369695,1.370845,1.368245,1.370345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n8/13/2007 12:00:00 AM,1.370445,1.370645,1.360245,1.361445,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2007 12:00:00 AM,1.361495,1.362495,1.351545,1.351545,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2007 12:00:00 AM,1.351595,1.351945,1.338545,1.340145,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2007 12:00:00 AM,1.340045,1.344695,1.336045,1.341195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/17/2007 12:00:00 AM,1.341245,1.354645,1.336895,1.349195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2007 12:00:00 AM,1.348195,1.349945,1.347345,1.349495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/20/2007 12:00:00 AM,1.349345,1.350845,1.346045,1.347345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/21/2007 12:00:00 AM,1.347445,1.351995,1.345045,1.346845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/22/2007 12:00:00 AM,1.346945,1.356045,1.346445,1.355195,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2007 12:00:00 AM,1.355295,1.358795,1.353445,1.356645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/24/2007 12:00:00 AM,1.356745,1.368245,1.355445,1.366695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2007 12:00:00 AM,1.367995,1.368445,1.366495,1.367245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/27/2007 12:00:00 AM,1.367145,1.367995,1.362545,1.362945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/28/2007 12:00:00 AM,1.362945,1.367995,1.356345,1.358845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2007 12:00:00 AM,1.358745,1.368045,1.356645,1.365945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2007 12:00:00 AM,1.366045,1.367345,1.359245,1.367345,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2007 12:00:00 AM,1.367245,1.371895,1.362045,1.362245,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n9/2/2007 12:00:00 AM,1.363345,1.363945,1.362645,1.363845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/3/2007 12:00:00 AM,1.363945,1.365395,1.360545,1.360695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/4/2007 12:00:00 AM,1.360645,1.362845,1.355145,1.361845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2007 12:00:00 AM,1.361795,1.367145,1.356945,1.364545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2007 12:00:00 AM,1.364645,1.370945,1.363545,1.366845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2007 12:00:00 AM,1.366745,1.379795,1.366345,1.376795,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2007 12:00:00 AM,1.377445,1.378695,1.376645,1.377145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0\n9/10/2007 12:00:00 AM,1.377045,1.381595,1.376895,1.380445,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2007 12:00:00 AM,1.380345,1.38484,1.37784,1.383945,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2007 12:00:00 AM,1.383995,1.391405,1.383645,1.389745,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2007 12:00:00 AM,1.389795,1.392705,1.38634,1.387245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2007 12:00:00 AM,1.38718,1.38956,1.38443,1.38774,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/16/2007 12:00:00 AM,1.38777,1.388445,1.385745,1.387745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n9/17/2007 12:00:00 AM,1.387845,1.388845,1.384875,1.38594,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/18/2007 12:00:00 AM,1.385845,1.39884,1.382855,1.39756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2007 12:00:00 AM,1.397575,1.39876,1.393645,1.39766,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/20/2007 12:00:00 AM,1.39765,1.409855,1.397245,1.407445,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2007 12:00:00 AM,1.40746,1.411995,1.404245,1.409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2007 12:00:00 AM,1.4091,1.411775,1.40867,1.410145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n9/24/2007 12:00:00 AM,1.410045,1.41307,1.406645,1.407865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n9/25/2007 12:00:00 AM,1.407775,1.416225,1.406135,1.41354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2007 12:00:00 AM,1.413535,1.41551,1.41116,1.41371,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/27/2007 12:00:00 AM,1.41376,1.418965,1.41298,1.416745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2007 12:00:00 AM,1.41667,1.427815,1.415645,1.425925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2007 12:00:00 AM,1.427745,1.428285,1.425835,1.426475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/1/2007 12:00:00 AM,1.426475,1.427435,1.421065,1.421745,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2007 12:00:00 AM,1.421665,1.42245,1.413905,1.417805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2007 12:00:00 AM,1.417775,1.420045,1.40834,1.40914,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2007 12:00:00 AM,1.409195,1.415045,1.40673,1.413845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2007 12:00:00 AM,1.41378,1.415755,1.403435,1.413495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/7/2007 12:00:00 AM,1.413795,1.415315,1.41305,1.413555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n10/8/2007 12:00:00 AM,1.41355,1.41395,1.40164,1.402155,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2007 12:00:00 AM,1.40217,1.411805,1.40154,1.411345,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2007 12:00:00 AM,1.411335,1.41718,1.41014,1.415615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/11/2007 12:00:00 AM,1.415635,1.424095,1.41536,1.41962,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/12/2007 12:00:00 AM,1.419625,1.421355,1.41543,1.41776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2007 12:00:00 AM,1.416995,1.418695,1.416245,1.416645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n10/15/2007 12:00:00 AM,1.416745,1.42433,1.416645,1.420035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2007 12:00:00 AM,1.42006,1.422665,1.414435,1.417095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2007 12:00:00 AM,1.417155,1.423715,1.415745,1.42315,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2007 12:00:00 AM,1.423145,1.43104,1.422655,1.430205,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2007 12:00:00 AM,1.430185,1.43195,1.4245,1.429545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/21/2007 12:00:00 AM,1.432595,1.43492,1.430645,1.430745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/22/2007 12:00:00 AM,1.430765,1.4339,1.41263,1.41965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2007 12:00:00 AM,1.419645,1.42798,1.417695,1.425975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2007 12:00:00 AM,1.42595,1.427655,1.418845,1.42677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/25/2007 12:00:00 AM,1.426775,1.434515,1.424845,1.432745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2007 12:00:00 AM,1.43269,1.43935,1.432445,1.439045,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2007 12:00:00 AM,1.439085,1.442645,1.439085,1.441045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,0,0,0,0,0,0\n10/29/2007 12:00:00 AM,1.441065,1.44384,1.43771,1.440735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/30/2007 12:00:00 AM,1.440645,1.44475,1.437445,1.44408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2007 12:00:00 AM,1.444055,1.450425,1.441935,1.446395,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2007 12:00:00 AM,1.446375,1.447845,1.440435,1.44445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2007 12:00:00 AM,1.44448,1.452855,1.44216,1.451495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2007 12:00:00 AM,1.450645,1.45246,1.447865,1.449185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/5/2007 12:00:00 AM,1.449145,1.450045,1.4444,1.44825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/6/2007 12:00:00 AM,1.448255,1.46669,1.448245,1.463545,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2007 12:00:00 AM,1.463645,1.473045,1.461445,1.463445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/8/2007 12:00:00 AM,1.463455,1.473845,1.462545,1.471845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2007 12:00:00 AM,1.471825,1.475235,1.46324,1.466915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2007 12:00:00 AM,1.467185,1.467895,1.462245,1.463845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/12/2007 12:00:00 AM,1.463745,1.466445,1.45205,1.457045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2007 12:00:00 AM,1.457145,1.466645,1.456745,1.465845,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n11/14/2007 12:00:00 AM,1.46577,1.472555,1.463945,1.46752,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/15/2007 12:00:00 AM,1.467445,1.47045,1.460535,1.461645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2007 12:00:00 AM,1.461545,1.46726,1.458155,1.464845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2007 12:00:00 AM,1.466645,1.468745,1.465545,1.466245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0\n11/19/2007 12:00:00 AM,1.466145,1.46853,1.462145,1.466635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/20/2007 12:00:00 AM,1.46657,1.485345,1.466045,1.484045,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2007 12:00:00 AM,1.48396,1.48732,1.4776,1.486045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2007 12:00:00 AM,1.48605,1.496795,1.482245,1.492245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2007 12:00:00 AM,1.492345,1.493645,1.478545,1.48367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2007 12:00:00 AM,1.482745,1.483945,1.481045,1.48228,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/26/2007 12:00:00 AM,1.48225,1.488645,1.480595,1.486845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/27/2007 12:00:00 AM,1.486875,1.490105,1.480935,1.481925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2007 12:00:00 AM,1.481875,1.48589,1.471175,1.48242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/29/2007 12:00:00 AM,1.482345,1.48356,1.472355,1.47404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2007 12:00:00 AM,1.473965,1.4785,1.462945,1.462995,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2007 12:00:00 AM,1.463395,1.46693,1.463295,1.466445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/3/2007 12:00:00 AM,1.466365,1.470855,1.462045,1.4667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/4/2007 12:00:00 AM,1.466655,1.477045,1.463545,1.475645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2007 12:00:00 AM,1.475565,1.475945,1.457245,1.461745,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2007 12:00:00 AM,1.461645,1.465975,1.452545,1.460845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/7/2007 12:00:00 AM,1.46078,1.467325,1.45993,1.465395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/9/2007 12:00:00 AM,1.465345,1.465845,1.46418,1.464345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/10/2007 12:00:00 AM,1.46442,1.473625,1.464045,1.47276,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2007 12:00:00 AM,1.472755,1.475075,1.463935,1.46595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2007 12:00:00 AM,1.465945,1.474435,1.465545,1.472645,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2007 12:00:00 AM,1.47257,1.473735,1.457695,1.462345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2007 12:00:00 AM,1.46225,1.465635,1.441145,1.442345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2007 12:00:00 AM,1.438645,1.445045,1.438195,1.444245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0\n12/17/2007 12:00:00 AM,1.44423,1.44532,1.43308,1.439945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2007 12:00:00 AM,1.43992,1.443595,1.43663,1.44197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2007 12:00:00 AM,1.44195,1.442265,1.43256,1.437615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2007 12:00:00 AM,1.437605,1.43761,1.43108,1.435735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2007 12:00:00 AM,1.4357,1.44101,1.4349,1.43578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/23/2007 12:00:00 AM,1.43741,1.438845,1.436795,1.43854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/24/2007 12:00:00 AM,1.43856,1.44133,1.437495,1.4408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/25/2007 12:00:00 AM,1.439895,1.440095,1.439585,1.439685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/27/2007 12:00:00 AM,1.451485,1.46392,1.4477,1.46062,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2007 12:00:00 AM,1.460585,1.47276,1.46023,1.471565,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2007 12:00:00 AM,1.472295,1.47471,1.470695,1.47433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/31/2007 12:00:00 AM,1.474325,1.474735,1.458265,1.459385,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2008 12:00:00 AM,1.465245,1.475,1.464215,1.471205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2008 12:00:00 AM,1.471175,1.478105,1.468805,1.474425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2008 12:00:00 AM,1.474415,1.48247,1.46958,1.47532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/6/2008 12:00:00 AM,1.475395,1.47567,1.469735,1.472195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2008 12:00:00 AM,1.47222,1.47365,1.466605,1.46964,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2008 12:00:00 AM,1.469635,1.474275,1.469315,1.47181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2008 12:00:00 AM,1.47184,1.4743,1.46394,1.468075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2008 12:00:00 AM,1.468055,1.48148,1.464205,1.481175,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2008 12:00:00 AM,1.481215,1.4819,1.476215,1.477715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/13/2008 12:00:00 AM,1.478195,1.48172,1.477895,1.481685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/14/2008 12:00:00 AM,1.48171,1.49148,1.48107,1.48748,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2008 12:00:00 AM,1.487515,1.492225,1.47757,1.483555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/16/2008 12:00:00 AM,1.48352,1.485315,1.4595,1.4657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2008 12:00:00 AM,1.465675,1.471475,1.45896,1.46461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/18/2008 12:00:00 AM,1.46461,1.469535,1.4604,1.461675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2008 12:00:00 AM,1.460045,1.460745,1.453265,1.45349,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2008 12:00:00 AM,1.45347,1.45602,1.43905,1.441515,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2008 12:00:00 AM,1.44151,1.468475,1.43657,1.46282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2008 12:00:00 AM,1.462845,1.464525,1.451105,1.461855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/24/2008 12:00:00 AM,1.461835,1.477895,1.459115,1.475235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2008 12:00:00 AM,1.475145,1.477345,1.46612,1.46716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/27/2008 12:00:00 AM,1.468095,1.4709,1.46633,1.467365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/28/2008 12:00:00 AM,1.467365,1.479775,1.46622,1.476855,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2008 12:00:00 AM,1.47687,1.478745,1.473795,1.476455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/30/2008 12:00:00 AM,1.476445,1.490755,1.475505,1.483975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2008 12:00:00 AM,1.484005,1.491375,1.480195,1.486375,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/1/2008 12:00:00 AM,1.48637,1.494335,1.478595,1.47985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n2/3/2008 12:00:00 AM,1.480895,1.482495,1.479325,1.481445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n2/4/2008 12:00:00 AM,1.481475,1.4849,1.47989,1.481565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/5/2008 12:00:00 AM,1.481565,1.482245,1.462295,1.464285,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2008 12:00:00 AM,1.46431,1.467155,1.459195,1.461625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2008 12:00:00 AM,1.4616,1.465175,1.44396,1.4486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2008 12:00:00 AM,1.448575,1.45468,1.445135,1.451215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/10/2008 12:00:00 AM,1.451795,1.45461,1.451245,1.454005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/11/2008 12:00:00 AM,1.454,1.457705,1.44822,1.451345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0\n2/12/2008 12:00:00 AM,1.451345,1.461465,1.44965,1.45757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2008 12:00:00 AM,1.457535,1.459845,1.453195,1.456805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/14/2008 12:00:00 AM,1.456825,1.464865,1.456105,1.463835,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2008 12:00:00 AM,1.463845,1.470895,1.463795,1.46777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2008 12:00:00 AM,1.467795,1.46865,1.466345,1.468545,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/18/2008 12:00:00 AM,1.468545,1.469045,1.46106,1.466225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2008 12:00:00 AM,1.466255,1.47569,1.466095,1.471945,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2008 12:00:00 AM,1.47185,1.47327,1.461445,1.471445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/21/2008 12:00:00 AM,1.47147,1.483795,1.47025,1.480245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2008 12:00:00 AM,1.48027,1.486315,1.479245,1.48307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2008 12:00:00 AM,1.483945,1.484095,1.481145,1.481255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/25/2008 12:00:00 AM,1.48128,1.484465,1.47946,1.482645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/26/2008 12:00:00 AM,1.482655,1.504795,1.477795,1.499545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2008 12:00:00 AM,1.499505,1.51438,1.49926,1.51125,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2008 12:00:00 AM,1.511245,1.522965,1.507355,1.517795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/29/2008 12:00:00 AM,1.51782,1.52392,1.514355,1.518045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/2/2008 12:00:00 AM,1.519495,1.522525,1.51865,1.520545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n3/3/2008 12:00:00 AM,1.52046,1.527625,1.51575,1.51832,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0\n3/4/2008 12:00:00 AM,1.518395,1.52492,1.51734,1.519445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/5/2008 12:00:00 AM,1.519395,1.530225,1.514545,1.527705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2008 12:00:00 AM,1.527735,1.53956,1.527735,1.538195,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2008 12:00:00 AM,1.538145,1.546065,1.531445,1.534675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2008 12:00:00 AM,1.536295,1.540395,1.535845,1.538445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/10/2008 12:00:00 AM,1.538495,1.54013,1.531245,1.536445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2008 12:00:00 AM,1.536435,1.54956,1.52825,1.536145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/12/2008 12:00:00 AM,1.53615,1.558695,1.535245,1.556595,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2008 12:00:00 AM,1.55655,1.564505,1.553595,1.560095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2008 12:00:00 AM,1.5601,1.568845,1.553245,1.56704,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2008 12:00:00 AM,1.567645,1.590405,1.56752,1.58453,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2008 12:00:00 AM,1.584505,1.58579,1.568645,1.578645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2008 12:00:00 AM,1.578585,1.583235,1.561395,1.568665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2008 12:00:00 AM,1.56865,1.578545,1.556845,1.559735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2008 12:00:00 AM,1.55973,1.56083,1.53969,1.541845,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2008 12:00:00 AM,1.541845,1.547245,1.54169,1.543855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/23/2008 12:00:00 AM,1.543945,1.543945,1.53415,1.535045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/24/2008 12:00:00 AM,1.535065,1.55693,1.53489,1.555745,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2008 12:00:00 AM,1.555695,1.565845,1.552555,1.56336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/26/2008 12:00:00 AM,1.563345,1.58583,1.558375,1.581485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2008 12:00:00 AM,1.58141,1.58274,1.57265,1.579385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2008 12:00:00 AM,1.57941,1.583895,1.574155,1.580475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/30/2008 12:00:00 AM,1.580195,1.581705,1.57596,1.580135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n3/31/2008 12:00:00 AM,1.580205,1.589635,1.57483,1.577545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/1/2008 12:00:00 AM,1.57756,1.57814,1.55635,1.560165,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2008 12:00:00 AM,1.560205,1.570195,1.553295,1.564445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/3/2008 12:00:00 AM,1.564485,1.568535,1.551055,1.565445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/4/2008 12:00:00 AM,1.56542,1.577325,1.565345,1.573045,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2008 12:00:00 AM,1.573145,1.573745,1.565045,1.566945,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2008 12:00:00 AM,1.566955,1.579845,1.562745,1.575445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2008 12:00:00 AM,1.575485,1.57773,1.56735,1.570395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2008 12:00:00 AM,1.57044,1.586495,1.56994,1.584345,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2008 12:00:00 AM,1.58437,1.591325,1.572545,1.577255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2008 12:00:00 AM,1.57732,1.585545,1.575535,1.58278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/13/2008 12:00:00 AM,1.569595,1.572985,1.567125,1.571595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/14/2008 12:00:00 AM,1.571555,1.588645,1.569595,1.582645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2008 12:00:00 AM,1.582695,1.587515,1.575135,1.578645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2008 12:00:00 AM,1.578685,1.597925,1.578685,1.59485,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2008 12:00:00 AM,1.594905,1.598355,1.58466,1.589945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2008 12:00:00 AM,1.58994,1.59561,1.57116,1.58092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2008 12:00:00 AM,1.580495,1.583515,1.57963,1.58294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/21/2008 12:00:00 AM,1.58293,1.59476,1.579185,1.591465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2008 12:00:00 AM,1.591445,1.60191,1.58348,1.59914,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2008 12:00:00 AM,1.599155,1.59981,1.58337,1.5847,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2008 12:00:00 AM,1.58472,1.58723,1.563825,1.56924,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2008 12:00:00 AM,1.569275,1.57016,1.55553,1.559365,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2008 12:00:00 AM,1.561095,1.564645,1.55933,1.56401,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/28/2008 12:00:00 AM,1.56399,1.56932,1.55966,1.56528,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/29/2008 12:00:00 AM,1.56527,1.56592,1.55404,1.55735,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2008 12:00:00 AM,1.557345,1.564415,1.551775,1.56363,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2008 12:00:00 AM,1.563605,1.564255,1.543055,1.544995,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2008 12:00:00 AM,1.54496,1.54976,1.536055,1.54131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/4/2008 12:00:00 AM,1.543645,1.547725,1.54235,1.54708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100\n5/5/2008 12:00:00 AM,1.547035,1.55356,1.54265,1.552385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2008 12:00:00 AM,1.55239,1.55943,1.545245,1.55066,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/7/2008 12:00:00 AM,1.550655,1.551545,1.528375,1.5311,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2008 12:00:00 AM,1.531095,1.54419,1.52923,1.54034,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2008 12:00:00 AM,1.54033,1.548885,1.540165,1.548215,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2008 12:00:00 AM,1.545145,1.54851,1.54018,1.54133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2008 12:00:00 AM,1.54137,1.55703,1.53666,1.553835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2008 12:00:00 AM,1.55383,1.55662,1.54311,1.545585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2008 12:00:00 AM,1.54559,1.54865,1.539585,1.54637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/15/2008 12:00:00 AM,1.5464,1.554655,1.54198,1.547245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/16/2008 12:00:00 AM,1.547245,1.56016,1.544875,1.559405,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2008 12:00:00 AM,1.559545,1.559845,1.556085,1.556495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/19/2008 12:00:00 AM,1.556525,1.56331,1.54862,1.55316,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/20/2008 12:00:00 AM,1.553145,1.568575,1.550615,1.5667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2008 12:00:00 AM,1.566695,1.58011,1.563155,1.57708,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2008 12:00:00 AM,1.5771,1.58141,1.569335,1.573165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2008 12:00:00 AM,1.573195,1.57941,1.56968,1.57751,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2008 12:00:00 AM,1.576795,1.57921,1.574965,1.57611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/26/2008 12:00:00 AM,1.576095,1.57991,1.57414,1.57881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/27/2008 12:00:00 AM,1.578785,1.581825,1.56668,1.5696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2008 12:00:00 AM,1.56961,1.57605,1.56088,1.563405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2008 12:00:00 AM,1.563395,1.56411,1.54858,1.55181,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2008 12:00:00 AM,1.551795,1.556915,1.54621,1.55573,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2008 12:00:00 AM,1.556895,1.556945,1.55316,1.55379,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/2/2008 12:00:00 AM,1.553795,1.558925,1.54868,1.55347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/3/2008 12:00:00 AM,1.55353,1.56282,1.541065,1.545315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2008 12:00:00 AM,1.5453,1.548345,1.53848,1.539535,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2008 12:00:00 AM,1.53952,1.56043,1.536505,1.558055,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2008 12:00:00 AM,1.55808,1.57751,1.55724,1.576975,0,0,0,0,0,100,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2008 12:00:00 AM,1.578495,1.580015,1.57658,1.5783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/9/2008 12:00:00 AM,1.57832,1.58438,1.55582,1.558235,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2008 12:00:00 AM,1.55826,1.561835,1.54408,1.547675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2008 12:00:00 AM,1.547655,1.55866,1.54574,1.5487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/12/2008 12:00:00 AM,1.54872,1.549425,1.53793,1.54515,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2008 12:00:00 AM,1.54509,1.54531,1.53036,1.536215,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2008 12:00:00 AM,1.540545,1.54169,1.537275,1.539895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n6/16/2008 12:00:00 AM,1.53987,1.55411,1.534465,1.55312,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2008 12:00:00 AM,1.553095,1.55523,1.54654,1.5505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2008 12:00:00 AM,1.550495,1.55792,1.54632,1.556745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2008 12:00:00 AM,1.55675,1.55862,1.546635,1.55115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2008 12:00:00 AM,1.55115,1.56515,1.5505,1.56258,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2008 12:00:00 AM,1.56227,1.563595,1.55958,1.56174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/23/2008 12:00:00 AM,1.56174,1.56191,1.54683,1.551695,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2008 12:00:00 AM,1.5517,1.56216,1.551145,1.55727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2008 12:00:00 AM,1.557255,1.568665,1.55367,1.567785,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2008 12:00:00 AM,1.567795,1.57673,1.562895,1.57359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2008 12:00:00 AM,1.573485,1.57911,1.57194,1.579005,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/29/2008 12:00:00 AM,1.577845,1.57971,1.577315,1.57858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/30/2008 12:00:00 AM,1.578615,1.583605,1.57278,1.575625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2008 12:00:00 AM,1.57563,1.58273,1.572315,1.580345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2008 12:00:00 AM,1.580385,1.58914,1.57773,1.587785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2008 12:00:00 AM,1.587785,1.59094,1.56742,1.57171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/4/2008 12:00:00 AM,1.57167,1.57276,1.565505,1.569885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2008 12:00:00 AM,1.56982,1.570655,1.563085,1.56459,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/7/2008 12:00:00 AM,1.564625,1.575345,1.561135,1.570855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n7/8/2008 12:00:00 AM,1.57078,1.57395,1.56354,1.566325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2008 12:00:00 AM,1.566315,1.574915,1.56606,1.57279,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2008 12:00:00 AM,1.57272,1.58016,1.56912,1.57941,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2008 12:00:00 AM,1.579455,1.59474,1.576535,1.592335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2008 12:00:00 AM,1.596785,1.59706,1.588305,1.59045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/14/2008 12:00:00 AM,1.59051,1.59441,1.584155,1.59418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2008 12:00:00 AM,1.59414,1.60379,1.58658,1.59053,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/16/2008 12:00:00 AM,1.590495,1.594865,1.580075,1.585035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2008 12:00:00 AM,1.585005,1.58932,1.578295,1.58468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/18/2008 12:00:00 AM,1.58474,1.58872,1.58076,1.58377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/20/2008 12:00:00 AM,1.584445,1.58731,1.582845,1.58691,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/21/2008 12:00:00 AM,1.586945,1.59366,1.58322,1.59246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2008 12:00:00 AM,1.59245,1.59444,1.57576,1.579735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2008 12:00:00 AM,1.579675,1.579755,1.56706,1.56959,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2008 12:00:00 AM,1.56959,1.571365,1.56286,1.56921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/25/2008 12:00:00 AM,1.56926,1.57535,1.56667,1.56988,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/27/2008 12:00:00 AM,1.570895,1.572345,1.568445,1.572025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n7/28/2008 12:00:00 AM,1.57203,1.576805,1.56878,1.57446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2008 12:00:00 AM,1.57446,1.57573,1.55536,1.55888,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2008 12:00:00 AM,1.55885,1.56165,1.55225,1.55862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/31/2008 12:00:00 AM,1.558675,1.57,1.555545,1.556965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2008 12:00:00 AM,1.556925,1.55894,1.55144,1.554035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/3/2008 12:00:00 AM,1.55662,1.559465,1.55641,1.558955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/4/2008 12:00:00 AM,1.55896,1.5631,1.55288,1.55349,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0\n8/5/2008 12:00:00 AM,1.55354,1.5547,1.544435,1.54934,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2008 12:00:00 AM,1.5494,1.55164,1.539835,1.54328,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2008 12:00:00 AM,1.543245,1.550295,1.519405,1.52147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2008 12:00:00 AM,1.521495,1.524725,1.49978,1.50176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2008 12:00:00 AM,1.493095,1.49921,1.490695,1.498645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/11/2008 12:00:00 AM,1.498545,1.50834,1.48613,1.488375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2008 12:00:00 AM,1.488395,1.496435,1.48158,1.493195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2008 12:00:00 AM,1.493195,1.497995,1.48428,1.489785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/14/2008 12:00:00 AM,1.48974,1.49506,1.475325,1.47755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2008 12:00:00 AM,1.47755,1.4786,1.465925,1.46727,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2008 12:00:00 AM,1.467795,1.476595,1.467185,1.476335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/18/2008 12:00:00 AM,1.47632,1.476795,1.466735,1.469075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/19/2008 12:00:00 AM,1.4691,1.480555,1.46302,1.47703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2008 12:00:00 AM,1.477045,1.47852,1.46726,1.477495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n8/21/2008 12:00:00 AM,1.4775,1.49081,1.474265,1.486805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2008 12:00:00 AM,1.4868,1.48945,1.47585,1.47741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n8/24/2008 12:00:00 AM,1.478445,1.479115,1.47157,1.47187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/25/2008 12:00:00 AM,1.47186,1.480825,1.469645,1.470975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/26/2008 12:00:00 AM,1.470965,1.474295,1.457115,1.473245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2008 12:00:00 AM,1.473185,1.479255,1.466665,1.479165,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2008 12:00:00 AM,1.4792,1.481125,1.46721,1.47429,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2008 12:00:00 AM,1.474325,1.47677,1.464065,1.466985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2008 12:00:00 AM,1.469695,1.472295,1.461625,1.463675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2008 12:00:00 AM,1.46371,1.466695,1.45567,1.45706,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2008 12:00:00 AM,1.45705,1.459825,1.446655,1.44933,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2008 12:00:00 AM,1.44927,1.452825,1.43857,1.45095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/4/2008 12:00:00 AM,1.451025,1.45443,1.42133,1.4279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2008 12:00:00 AM,1.42787,1.434775,1.419635,1.42345,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2008 12:00:00 AM,1.433285,1.442875,1.431125,1.44075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2008 12:00:00 AM,1.440785,1.442525,1.404695,1.408735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2008 12:00:00 AM,1.40877,1.422625,1.40587,1.41341,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2008 12:00:00 AM,1.4134,1.41786,1.393305,1.395175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2008 12:00:00 AM,1.39521,1.40408,1.38823,1.399955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2008 12:00:00 AM,1.399905,1.42231,1.39858,1.42163,0,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2008 12:00:00 AM,1.43452,1.44813,1.42879,1.44393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2008 12:00:00 AM,1.443965,1.44486,1.408495,1.41896,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2008 12:00:00 AM,1.418985,1.428245,1.407295,1.415945,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/17/2008 12:00:00 AM,1.41597,1.43944,1.40985,1.435855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2008 12:00:00 AM,1.43578,1.454115,1.41919,1.42116,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2008 12:00:00 AM,1.421165,1.44932,1.415095,1.447395,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2008 12:00:00 AM,1.44904,1.45631,1.443725,1.453385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/22/2008 12:00:00 AM,1.453405,1.48664,1.446485,1.47768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2008 12:00:00 AM,1.477685,1.481305,1.462265,1.468005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2008 12:00:00 AM,1.468055,1.47464,1.460395,1.47079,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/25/2008 12:00:00 AM,1.47075,1.476795,1.45606,1.467495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/26/2008 12:00:00 AM,1.46752,1.467815,1.45548,1.461185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/28/2008 12:00:00 AM,1.455405,1.456355,1.44837,1.45021,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/29/2008 12:00:00 AM,1.45015,1.45749,1.43026,1.43568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2008 12:00:00 AM,1.435695,1.442605,1.400935,1.41284,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2008 12:00:00 AM,1.412855,1.41741,1.393175,1.397735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2008 12:00:00 AM,1.397735,1.399065,1.37472,1.384555,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2008 12:00:00 AM,1.38452,1.390825,1.370295,1.38044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/5/2008 12:00:00 AM,1.367145,1.37073,1.360955,1.36347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/6/2008 12:00:00 AM,1.363485,1.36462,1.344365,1.358715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2008 12:00:00 AM,1.358665,1.374345,1.351515,1.3598,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/8/2008 12:00:00 AM,1.35979,1.37549,1.354565,1.367835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2008 12:00:00 AM,1.36801,1.378515,1.3544,1.3549,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2008 12:00:00 AM,1.35483,1.36529,1.325945,1.341345,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2008 12:00:00 AM,1.357485,1.362355,1.345765,1.35333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/13/2008 12:00:00 AM,1.353265,1.36916,1.34716,1.368435,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2008 12:00:00 AM,1.36847,1.376915,1.353595,1.3578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2008 12:00:00 AM,1.3578,1.36875,1.342425,1.34738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2008 12:00:00 AM,1.34735,1.35384,1.334665,1.34636,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/17/2008 12:00:00 AM,1.34638,1.35116,1.33868,1.340475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/19/2008 12:00:00 AM,1.342645,1.34787,1.34009,1.345635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/20/2008 12:00:00 AM,1.345675,1.353035,1.328795,1.333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2008 12:00:00 AM,1.333055,1.33371,1.29105,1.29194,0,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2008 12:00:00 AM,1.291945,1.294375,1.27285,1.2756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2008 12:00:00 AM,1.275565,1.30062,1.273525,1.276325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/24/2008 12:00:00 AM,1.27635,1.28275,1.24956,1.25875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2008 12:00:00 AM,1.255995,1.26861,1.253245,1.25976,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2008 12:00:00 AM,1.25966,1.262845,1.233,1.2432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2008 12:00:00 AM,1.24315,1.284515,1.2409,1.271545,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2008 12:00:00 AM,1.271545,1.329745,1.262655,1.32324,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2008 12:00:00 AM,1.32324,1.325535,1.274615,1.28535,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2008 12:00:00 AM,1.28537,1.286925,1.266675,1.27393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2008 12:00:00 AM,1.274695,1.28676,1.27398,1.28405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/3/2008 12:00:00 AM,1.284065,1.289825,1.2527,1.258125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2008 12:00:00 AM,1.25819,1.304825,1.256965,1.285165,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2008 12:00:00 AM,1.285125,1.31165,1.279355,1.28738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/6/2008 12:00:00 AM,1.28736,1.293155,1.265345,1.27584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2008 12:00:00 AM,1.275875,1.28505,1.271575,1.27629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/9/2008 12:00:00 AM,1.282115,1.2898,1.277705,1.28886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/10/2008 12:00:00 AM,1.288855,1.292715,1.267585,1.273815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/11/2008 12:00:00 AM,1.273835,1.280075,1.247645,1.2572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2008 12:00:00 AM,1.25725,1.2632,1.24373,1.245895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/13/2008 12:00:00 AM,1.24588,1.28566,1.23888,1.2727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2008 12:00:00 AM,1.2727,1.279915,1.26125,1.26885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/16/2008 12:00:00 AM,1.253345,1.25962,1.251215,1.256465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/17/2008 12:00:00 AM,1.25645,1.274215,1.25459,1.261635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2008 12:00:00 AM,1.26171,1.270015,1.25667,1.261995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/19/2008 12:00:00 AM,1.262005,1.281395,1.2472,1.248795,0,0,0,0,100,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2008 12:00:00 AM,1.24879,1.25938,1.242435,1.248625,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/21/2008 12:00:00 AM,1.248585,1.26377,1.24365,1.25775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/23/2008 12:00:00 AM,1.259045,1.265625,1.258495,1.264345,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/24/2008 12:00:00 AM,1.264355,1.29598,1.25649,1.28514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2008 12:00:00 AM,1.28514,1.30812,1.280365,1.29766,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2008 12:00:00 AM,1.29775,1.30272,1.281925,1.29203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2008 12:00:00 AM,1.29208,1.29685,1.285995,1.29082,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/28/2008 12:00:00 AM,1.290845,1.295695,1.26457,1.270075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2008 12:00:00 AM,1.271225,1.27124,1.26214,1.268215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/1/2008 12:00:00 AM,1.268205,1.270405,1.258175,1.26483,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2008 12:00:00 AM,1.264835,1.27672,1.256195,1.27004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100\n12/3/2008 12:00:00 AM,1.27006,1.27291,1.260185,1.26727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/4/2008 12:00:00 AM,1.267265,1.284815,1.254945,1.274635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/5/2008 12:00:00 AM,1.27466,1.27998,1.26278,1.271545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/7/2008 12:00:00 AM,1.272945,1.27858,1.27193,1.275865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/8/2008 12:00:00 AM,1.275975,1.2968,1.274575,1.28731,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2008 12:00:00 AM,1.28729,1.300125,1.279905,1.295645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2008 12:00:00 AM,1.29571,1.307025,1.29034,1.30476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2008 12:00:00 AM,1.304745,1.340645,1.30415,1.3367,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2008 12:00:00 AM,1.336665,1.341545,1.32508,1.337405,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/14/2008 12:00:00 AM,1.336755,1.349645,1.33675,1.34887,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2008 12:00:00 AM,1.34885,1.37362,1.343005,1.372815,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2008 12:00:00 AM,1.37276,1.41924,1.362955,1.41401,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2008 12:00:00 AM,1.413995,1.44559,1.40076,1.443435,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2008 12:00:00 AM,1.443435,1.47196,1.41808,1.426345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2008 12:00:00 AM,1.426265,1.430775,1.38253,1.39184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2008 12:00:00 AM,1.39357,1.404715,1.391195,1.39754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2008 12:00:00 AM,1.397545,1.41251,1.390175,1.39795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/23/2008 12:00:00 AM,1.39795,1.40214,1.391445,1.39569,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/24/2008 12:00:00 AM,1.39569,1.40191,1.39465,1.3995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2008 12:00:00 AM,1.404345,1.41192,1.403245,1.405915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n12/28/2008 12:00:00 AM,1.406415,1.417365,1.406345,1.4152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/29/2008 12:00:00 AM,1.415215,1.436275,1.391595,1.40988,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/30/2008 12:00:00 AM,1.409875,1.42213,1.39865,1.40834,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/31/2008 12:00:00 AM,1.40834,1.414255,1.3852,1.39388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2009 12:00:00 AM,1.386805,1.3987,1.384035,1.385165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2009 12:00:00 AM,1.39051,1.39635,1.384385,1.3883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/5/2009 12:00:00 AM,1.3883,1.394295,1.352765,1.35561,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2009 12:00:00 AM,1.35561,1.35658,1.331265,1.351615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2009 12:00:00 AM,1.351495,1.374705,1.34632,1.363255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2009 12:00:00 AM,1.363255,1.380005,1.35343,1.364795,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/9/2009 12:00:00 AM,1.364765,1.37525,1.34149,1.343025,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2009 12:00:00 AM,1.347595,1.347645,1.33727,1.338825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/12/2009 12:00:00 AM,1.338875,1.34458,1.328945,1.332995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/13/2009 12:00:00 AM,1.33296,1.333155,1.314045,1.325775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2009 12:00:00 AM,1.325795,1.333635,1.309335,1.3179,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2009 12:00:00 AM,1.31789,1.325465,1.30258,1.322095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2009 12:00:00 AM,1.322055,1.334405,1.31857,1.328925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/18/2009 12:00:00 AM,1.333795,1.33861,1.331265,1.334425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n1/19/2009 12:00:00 AM,1.334365,1.336275,1.297935,1.2996,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2009 12:00:00 AM,1.299565,1.3031,1.284435,1.29699,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/21/2009 12:00:00 AM,1.29704,1.30863,1.282495,1.303825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n1/22/2009 12:00:00 AM,1.303835,1.30829,1.290795,1.29415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2009 12:00:00 AM,1.29418,1.30348,1.27649,1.298525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/25/2009 12:00:00 AM,1.296435,1.296555,1.286145,1.29441,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n1/26/2009 12:00:00 AM,1.294435,1.32585,1.287255,1.321175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2009 12:00:00 AM,1.32127,1.33294,1.31185,1.32634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/28/2009 12:00:00 AM,1.32644,1.332855,1.308215,1.31215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2009 12:00:00 AM,1.3123,1.31791,1.28766,1.289085,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2009 12:00:00 AM,1.28906,1.292495,1.27777,1.28049,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/1/2009 12:00:00 AM,1.276945,1.278575,1.271105,1.27213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/2/2009 12:00:00 AM,1.27219,1.291415,1.27067,1.28748,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n2/3/2009 12:00:00 AM,1.28748,1.305825,1.280155,1.30081,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2009 12:00:00 AM,1.300755,1.307055,1.27988,1.28364,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2009 12:00:00 AM,1.28368,1.29055,1.27613,1.27852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2009 12:00:00 AM,1.278485,1.29927,1.274775,1.29257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2009 12:00:00 AM,1.296295,1.299245,1.29119,1.295325,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n2/9/2009 12:00:00 AM,1.295315,1.30935,1.281075,1.28226,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2009 12:00:00 AM,1.2822,1.30751,1.281855,1.28914,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2009 12:00:00 AM,1.289155,1.299765,1.28337,1.2911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/12/2009 12:00:00 AM,1.2911,1.29427,1.272165,1.29267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n2/13/2009 12:00:00 AM,1.292695,1.29383,1.28213,1.28879,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2009 12:00:00 AM,1.278345,1.28085,1.275295,1.276465,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/16/2009 12:00:00 AM,1.276455,1.28255,1.26327,1.2648,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2009 12:00:00 AM,1.26477,1.267385,1.255875,1.259415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/18/2009 12:00:00 AM,1.25949,1.264065,1.25135,1.25838,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/19/2009 12:00:00 AM,1.258345,1.27604,1.257075,1.25923,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/20/2009 12:00:00 AM,1.25917,1.28841,1.25578,1.2836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2009 12:00:00 AM,1.280645,1.29467,1.277945,1.29048,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2009 12:00:00 AM,1.290515,1.299165,1.26627,1.27258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2009 12:00:00 AM,1.272575,1.28783,1.27006,1.28313,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2009 12:00:00 AM,1.283165,1.28989,1.269045,1.273525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2009 12:00:00 AM,1.273545,1.281055,1.268265,1.27332,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/27/2009 12:00:00 AM,1.273285,1.27502,1.26045,1.267615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2009 12:00:00 AM,1.26322,1.263785,1.254575,1.256855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/2/2009 12:00:00 AM,1.25685,1.26394,1.253865,1.261755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/3/2009 12:00:00 AM,1.261715,1.267775,1.245635,1.24858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2009 12:00:00 AM,1.248595,1.26636,1.24854,1.26157,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2009 12:00:00 AM,1.261635,1.2622,1.248125,1.257835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2009 12:00:00 AM,1.25785,1.27538,1.25699,1.263735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2009 12:00:00 AM,1.265495,1.27268,1.265495,1.2673,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/9/2009 12:00:00 AM,1.267315,1.26805,1.25562,1.267575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n3/10/2009 12:00:00 AM,1.26759,1.28222,1.26113,1.26683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/11/2009 12:00:00 AM,1.26681,1.28712,1.261715,1.28294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2009 12:00:00 AM,1.282935,1.2945,1.27322,1.292615,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2009 12:00:00 AM,1.29264,1.295745,1.286235,1.29137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/15/2009 12:00:00 AM,1.288725,1.292285,1.283415,1.28931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/16/2009 12:00:00 AM,1.289325,1.307135,1.28831,1.300395,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2009 12:00:00 AM,1.30041,1.305625,1.293175,1.30459,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2009 12:00:00 AM,1.304585,1.35343,1.29867,1.34551,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2009 12:00:00 AM,1.345475,1.3738,1.341875,1.365795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2009 12:00:00 AM,1.3658,1.37265,1.351735,1.35662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2009 12:00:00 AM,1.362345,1.368415,1.361265,1.36653,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/23/2009 12:00:00 AM,1.36655,1.373565,1.34857,1.365245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/24/2009 12:00:00 AM,1.36525,1.36783,1.343115,1.348695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2009 12:00:00 AM,1.348645,1.365105,1.341875,1.35677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2009 12:00:00 AM,1.35672,1.36398,1.349445,1.35671,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/27/2009 12:00:00 AM,1.356685,1.359125,1.32571,1.32986,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2009 12:00:00 AM,1.322495,1.328585,1.321105,1.32728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/30/2009 12:00:00 AM,1.32727,1.3274,1.311275,1.32575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n3/31/2009 12:00:00 AM,1.325675,1.334295,1.317365,1.320925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2009 12:00:00 AM,1.32096,1.32942,1.316675,1.32732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/2/2009 12:00:00 AM,1.327345,1.351745,1.325135,1.34408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2009 12:00:00 AM,1.344125,1.348715,1.33653,1.348685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2009 12:00:00 AM,1.349895,1.35819,1.349825,1.35714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/6/2009 12:00:00 AM,1.35715,1.35774,1.332185,1.336235,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2009 12:00:00 AM,1.336265,1.339725,1.31772,1.31998,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2009 12:00:00 AM,1.319995,1.33081,1.31479,1.326345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2009 12:00:00 AM,1.3264,1.333585,1.3089,1.31354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2009 12:00:00 AM,1.313535,1.317625,1.311195,1.317605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/12/2009 12:00:00 AM,1.318795,1.31931,1.31266,1.316595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2009 12:00:00 AM,1.316625,1.339225,1.316555,1.332855,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2009 12:00:00 AM,1.332895,1.336675,1.322015,1.324425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2009 12:00:00 AM,1.32443,1.32974,1.31466,1.321765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/16/2009 12:00:00 AM,1.32177,1.323185,1.310305,1.31193,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2009 12:00:00 AM,1.311955,1.312405,1.30182,1.302595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/19/2009 12:00:00 AM,1.306175,1.306195,1.296645,1.30029,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2009 12:00:00 AM,1.300295,1.30182,1.28884,1.293765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2009 12:00:00 AM,1.293735,1.299385,1.28984,1.292565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/22/2009 12:00:00 AM,1.29256,1.303785,1.28856,1.2999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2009 12:00:00 AM,1.29993,1.31622,1.299685,1.31469,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2009 12:00:00 AM,1.31472,1.33012,1.313765,1.32429,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2009 12:00:00 AM,1.324645,1.32475,1.31557,1.316515,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2009 12:00:00 AM,1.316535,1.31823,1.299665,1.302305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2009 12:00:00 AM,1.30231,1.319735,1.29646,1.3187,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2009 12:00:00 AM,1.318685,1.33414,1.316965,1.331145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2009 12:00:00 AM,1.33114,1.33856,1.319125,1.32536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/1/2009 12:00:00 AM,1.32536,1.332795,1.32277,1.32641,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/3/2009 12:00:00 AM,1.326845,1.33463,1.326465,1.3322,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/4/2009 12:00:00 AM,1.33219,1.34379,1.32125,1.337025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/5/2009 12:00:00 AM,1.33701,1.343575,1.32463,1.32735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2009 12:00:00 AM,1.327315,1.33744,1.32471,1.328525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/7/2009 12:00:00 AM,1.328515,1.347,1.325175,1.33742,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2009 12:00:00 AM,1.33741,1.36323,1.336315,1.362695,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2009 12:00:00 AM,1.36489,1.36682,1.361645,1.36562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,-100,0,100,0,0,0,0,0,0\n5/11/2009 12:00:00 AM,1.365595,1.36662,1.35576,1.359925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100\n5/12/2009 12:00:00 AM,1.359945,1.372225,1.358655,1.36896,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2009 12:00:00 AM,1.36897,1.371595,1.35257,1.355365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2009 12:00:00 AM,1.35538,1.366545,1.35317,1.36361,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/15/2009 12:00:00 AM,1.363545,1.364465,1.346215,1.348935,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2009 12:00:00 AM,1.34794,1.349005,1.34237,1.34405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/18/2009 12:00:00 AM,1.344105,1.357095,1.343165,1.35704,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n5/19/2009 12:00:00 AM,1.35705,1.366845,1.353775,1.36158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2009 12:00:00 AM,1.36159,1.383015,1.358375,1.37908,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2009 12:00:00 AM,1.379075,1.39554,1.372775,1.39301,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2009 12:00:00 AM,1.39301,1.405085,1.38991,1.400205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2009 12:00:00 AM,1.402045,1.404745,1.39759,1.39883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/25/2009 12:00:00 AM,1.398795,1.40278,1.394395,1.397165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/26/2009 12:00:00 AM,1.39716,1.40049,1.385935,1.39767,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/27/2009 12:00:00 AM,1.397735,1.399555,1.38146,1.381895,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2009 12:00:00 AM,1.381845,1.399795,1.3793,1.3984,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2009 12:00:00 AM,1.3984,1.416835,1.39712,1.41374,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2009 12:00:00 AM,1.414445,1.416535,1.409955,1.414425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/1/2009 12:00:00 AM,1.414375,1.424615,1.41137,1.4169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/2/2009 12:00:00 AM,1.41692,1.433135,1.410175,1.43064,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2009 12:00:00 AM,1.43062,1.433835,1.41095,1.416785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n6/4/2009 12:00:00 AM,1.416755,1.42415,1.407035,1.42004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/5/2009 12:00:00 AM,1.42006,1.426785,1.39328,1.39641,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2009 12:00:00 AM,1.397045,1.400235,1.39265,1.39833,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/8/2009 12:00:00 AM,1.39829,1.39962,1.38055,1.3871,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2009 12:00:00 AM,1.3871,1.410175,1.38525,1.407385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2009 12:00:00 AM,1.40739,1.41439,1.39156,1.402805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/11/2009 12:00:00 AM,1.402795,1.417865,1.394335,1.409925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/12/2009 12:00:00 AM,1.409945,1.411575,1.393565,1.399895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2009 12:00:00 AM,1.39961,1.40017,1.39474,1.39561,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/15/2009 12:00:00 AM,1.395595,1.39627,1.37485,1.380015,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2009 12:00:00 AM,1.38004,1.39335,1.379315,1.38662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2009 12:00:00 AM,1.386615,1.398555,1.38225,1.39583,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2009 12:00:00 AM,1.39588,1.400145,1.38717,1.39203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/19/2009 12:00:00 AM,1.39208,1.401235,1.38831,1.394495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/21/2009 12:00:00 AM,1.394895,1.395695,1.388595,1.39079,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/22/2009 12:00:00 AM,1.390795,1.39173,1.38267,1.38621,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/23/2009 12:00:00 AM,1.38622,1.410875,1.38288,1.40874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2009 12:00:00 AM,1.408735,1.41383,1.388855,1.39678,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2009 12:00:00 AM,1.396805,1.404725,1.38892,1.40424,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2009 12:00:00 AM,1.40425,1.411805,1.401475,1.40681,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/28/2009 12:00:00 AM,1.406645,1.407755,1.400325,1.40284,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100\n6/29/2009 12:00:00 AM,1.402835,1.413185,1.39832,1.410945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2009 12:00:00 AM,1.41094,1.41522,1.400115,1.40346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2009 12:00:00 AM,1.403485,1.420115,1.401765,1.411375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2009 12:00:00 AM,1.41137,1.412775,1.392865,1.39827,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2009 12:00:00 AM,1.398245,1.402755,1.396345,1.39774,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/5/2009 12:00:00 AM,1.3959,1.39865,1.39524,1.397015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/6/2009 12:00:00 AM,1.396995,1.39982,1.38767,1.39777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0\n7/7/2009 12:00:00 AM,1.39776,1.405025,1.388145,1.390415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2009 12:00:00 AM,1.39043,1.393815,1.383295,1.389685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/9/2009 12:00:00 AM,1.389695,1.407215,1.38925,1.39777,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2009 12:00:00 AM,1.39772,1.39878,1.38787,1.39484,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2009 12:00:00 AM,1.394945,1.39787,1.39241,1.39287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/13/2009 12:00:00 AM,1.39286,1.40073,1.389745,1.39834,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2009 12:00:00 AM,1.39834,1.401435,1.39116,1.39827,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/15/2009 12:00:00 AM,1.39831,1.4135,1.39776,1.4073,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2009 12:00:00 AM,1.40726,1.416615,1.40558,1.411645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2009 12:00:00 AM,1.411595,1.414735,1.406325,1.40998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/19/2009 12:00:00 AM,1.40984,1.41809,1.40959,1.415685,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2009 12:00:00 AM,1.415645,1.424885,1.41457,1.42082,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2009 12:00:00 AM,1.420795,1.427715,1.41637,1.419535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/22/2009 12:00:00 AM,1.41956,1.4257,1.415625,1.42328,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2009 12:00:00 AM,1.42325,1.42913,1.411965,1.416065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2009 12:00:00 AM,1.416085,1.425365,1.415415,1.42147,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2009 12:00:00 AM,1.42253,1.423545,1.41719,1.423185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n7/27/2009 12:00:00 AM,1.42321,1.42981,1.42036,1.42426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/28/2009 12:00:00 AM,1.42428,1.43044,1.41307,1.417005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2009 12:00:00 AM,1.41699,1.418335,1.40077,1.405645,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2009 12:00:00 AM,1.405595,1.413515,1.401445,1.41273,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2009 12:00:00 AM,1.412745,1.42794,1.40867,1.42521,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2009 12:00:00 AM,1.426695,1.430895,1.42287,1.42347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2009 12:00:00 AM,1.423495,1.444505,1.42065,1.438995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2009 12:00:00 AM,1.438985,1.44301,1.43674,1.44114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/5/2009 12:00:00 AM,1.441195,1.44471,1.435565,1.43995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/6/2009 12:00:00 AM,1.439945,1.44223,1.43296,1.436045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/7/2009 12:00:00 AM,1.43607,1.441455,1.41542,1.417145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2009 12:00:00 AM,1.41797,1.421115,1.416845,1.420225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/10/2009 12:00:00 AM,1.42023,1.42187,1.41047,1.41421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2009 12:00:00 AM,1.414215,1.418505,1.411045,1.414425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/12/2009 12:00:00 AM,1.414435,1.424715,1.408655,1.422065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2009 12:00:00 AM,1.42207,1.432705,1.421465,1.426995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n8/14/2009 12:00:00 AM,1.426985,1.43066,1.416065,1.418945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n8/16/2009 12:00:00 AM,1.41877,1.41951,1.41412,1.415445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/17/2009 12:00:00 AM,1.41546,1.415905,1.40456,1.410445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2009 12:00:00 AM,1.41048,1.417225,1.40696,1.414095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2009 12:00:00 AM,1.4141,1.426715,1.40849,1.42232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2009 12:00:00 AM,1.422315,1.427535,1.420085,1.42252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/21/2009 12:00:00 AM,1.42253,1.4376,1.42087,1.433595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2009 12:00:00 AM,1.4333,1.435915,1.433095,1.43362,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/24/2009 12:00:00 AM,1.43362,1.434355,1.427365,1.430075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/25/2009 12:00:00 AM,1.43009,1.436275,1.42527,1.430195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2009 12:00:00 AM,1.43016,1.4353,1.42066,1.424275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2009 12:00:00 AM,1.424285,1.440655,1.42217,1.435645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2009 12:00:00 AM,1.435645,1.438825,1.42816,1.430015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2009 12:00:00 AM,1.430995,1.431735,1.42812,1.428745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/31/2009 12:00:00 AM,1.42879,1.43673,1.42567,1.435495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2009 12:00:00 AM,1.435495,1.437775,1.41773,1.42127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2009 12:00:00 AM,1.421295,1.42943,1.41921,1.427345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/3/2009 12:00:00 AM,1.42739,1.43484,1.423645,1.425195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2009 12:00:00 AM,1.425195,1.43271,1.419155,1.43041,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2009 12:00:00 AM,1.43025,1.433415,1.429945,1.43328,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/7/2009 12:00:00 AM,1.433295,1.436035,1.43202,1.43417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n9/8/2009 12:00:00 AM,1.43416,1.453515,1.43338,1.448295,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2009 12:00:00 AM,1.4483,1.45999,1.446665,1.4575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2009 12:00:00 AM,1.45751,1.461325,1.45027,1.46045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2009 12:00:00 AM,1.460395,1.463515,1.45536,1.458265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/13/2009 12:00:00 AM,1.460065,1.460795,1.45217,1.45452,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/14/2009 12:00:00 AM,1.45454,1.465235,1.45157,1.462065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2009 12:00:00 AM,1.46207,1.468575,1.456135,1.4682,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2009 12:00:00 AM,1.46819,1.473715,1.46418,1.47272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n9/17/2009 12:00:00 AM,1.472735,1.47669,1.46887,1.471725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/18/2009 12:00:00 AM,1.47174,1.47364,1.46476,1.470245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/20/2009 12:00:00 AM,1.47084,1.47124,1.46831,1.470285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n9/21/2009 12:00:00 AM,1.4703,1.471345,1.46116,1.46832,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2009 12:00:00 AM,1.468265,1.484275,1.468265,1.481,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2009 12:00:00 AM,1.480995,1.484415,1.46864,1.472775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2009 12:00:00 AM,1.4728,1.48027,1.462355,1.465085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2009 12:00:00 AM,1.46509,1.47242,1.46146,1.46694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/27/2009 12:00:00 AM,1.46951,1.472025,1.468335,1.47092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/28/2009 12:00:00 AM,1.470905,1.471235,1.456455,1.46218,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2009 12:00:00 AM,1.46219,1.464615,1.45274,1.459385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2009 12:00:00 AM,1.45938,1.46734,1.457555,1.46538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2009 12:00:00 AM,1.465405,1.466805,1.451175,1.45147,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2009 12:00:00 AM,1.4515,1.46482,1.44812,1.4574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2009 12:00:00 AM,1.46092,1.461385,1.45811,1.45983,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/5/2009 12:00:00 AM,1.45982,1.46695,1.45927,1.4658,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2009 12:00:00 AM,1.46579,1.476245,1.46556,1.472115,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2009 12:00:00 AM,1.47213,1.473725,1.46507,1.47147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/8/2009 12:00:00 AM,1.471475,1.481735,1.47048,1.47734,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2009 12:00:00 AM,1.47729,1.47791,1.467385,1.471165,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2009 12:00:00 AM,1.47236,1.474235,1.47175,1.472015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/12/2009 12:00:00 AM,1.47203,1.48133,1.46767,1.47912,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2009 12:00:00 AM,1.479125,1.48763,1.47621,1.48487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2009 12:00:00 AM,1.484895,1.49466,1.48402,1.493175,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2009 12:00:00 AM,1.49317,1.496745,1.48434,1.49547,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2009 12:00:00 AM,1.495465,1.49672,1.4849,1.48945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2009 12:00:00 AM,1.488825,1.491965,1.487625,1.48945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n10/19/2009 12:00:00 AM,1.48943,1.498085,1.48288,1.496745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2009 12:00:00 AM,1.49677,1.499385,1.48827,1.49311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2009 12:00:00 AM,1.493095,1.504625,1.48887,1.5013,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2009 12:00:00 AM,1.501335,1.504315,1.4944,1.50386,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2009 12:00:00 AM,1.50381,1.506035,1.49858,1.4997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100\n10/25/2009 12:00:00 AM,1.499485,1.501125,1.49872,1.499035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/26/2009 12:00:00 AM,1.499075,1.506295,1.4845,1.485785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2009 12:00:00 AM,1.48581,1.49273,1.47706,1.482005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/28/2009 12:00:00 AM,1.482035,1.484105,1.469105,1.47162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2009 12:00:00 AM,1.47163,1.485865,1.468325,1.483895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2009 12:00:00 AM,1.48386,1.48583,1.47117,1.47128,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2009 12:00:00 AM,1.47168,1.474665,1.468535,1.470525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/2/2009 12:00:00 AM,1.47048,1.48451,1.470265,1.47727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2009 12:00:00 AM,1.477265,1.48109,1.462665,1.47321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2009 12:00:00 AM,1.47318,1.4909,1.47027,1.486645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2009 12:00:00 AM,1.48655,1.49181,1.48116,1.48769,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/6/2009 12:00:00 AM,1.487695,1.49143,1.481385,1.48458,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/8/2009 12:00:00 AM,1.488355,1.48852,1.48625,1.486625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/9/2009 12:00:00 AM,1.48662,1.502015,1.48535,1.50053,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2009 12:00:00 AM,1.50053,1.50205,1.49383,1.49921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/11/2009 12:00:00 AM,1.499215,1.50482,1.49537,1.49831,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/12/2009 12:00:00 AM,1.49834,1.50161,1.48215,1.48564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2009 12:00:00 AM,1.48567,1.493805,1.48247,1.492145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2009 12:00:00 AM,1.4919,1.49585,1.49167,1.495645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/16/2009 12:00:00 AM,1.495645,1.501555,1.4881,1.498265,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/17/2009 12:00:00 AM,1.49826,1.499895,1.480795,1.48751,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2009 12:00:00 AM,1.48754,1.499055,1.48693,1.495425,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2009 12:00:00 AM,1.495435,1.49563,1.484355,1.491385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2009 12:00:00 AM,1.49138,1.49355,1.4801,1.48616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2009 12:00:00 AM,1.485605,1.487235,1.483295,1.48679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/23/2009 12:00:00 AM,1.486835,1.499925,1.486835,1.49551,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2009 12:00:00 AM,1.495535,1.49884,1.488865,1.49662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/25/2009 12:00:00 AM,1.49664,1.514425,1.49617,1.51268,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2009 12:00:00 AM,1.51267,1.51389,1.493375,1.496715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2009 12:00:00 AM,1.496735,1.50016,1.48285,1.49676,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/29/2009 12:00:00 AM,1.50148,1.50211,1.496385,1.4998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2009 12:00:00 AM,1.49981,1.508365,1.49732,1.50354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2009 12:00:00 AM,1.50354,1.511715,1.49712,1.50897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2009 12:00:00 AM,1.50896,1.510945,1.503245,1.50672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2009 12:00:00 AM,1.50672,1.514135,1.50371,1.50633,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/4/2009 12:00:00 AM,1.50631,1.509115,1.48219,1.48469,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2009 12:00:00 AM,1.485655,1.4874,1.485375,1.487145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/7/2009 12:00:00 AM,1.487195,1.4905,1.47564,1.48384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2009 12:00:00 AM,1.483845,1.486695,1.46689,1.46924,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2009 12:00:00 AM,1.46921,1.47819,1.46738,1.47357,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2009 12:00:00 AM,1.47358,1.47601,1.46837,1.47296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/11/2009 12:00:00 AM,1.47299,1.477605,1.458615,1.46282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2009 12:00:00 AM,1.462625,1.463085,1.45978,1.46223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n12/14/2009 12:00:00 AM,1.46225,1.46855,1.4608,1.46578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100\n12/15/2009 12:00:00 AM,1.465745,1.465905,1.450365,1.454045,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2009 12:00:00 AM,1.45407,1.459065,1.45057,1.452535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/17/2009 12:00:00 AM,1.45251,1.453115,1.430405,1.43442,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2009 12:00:00 AM,1.434395,1.441205,1.426145,1.43344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/20/2009 12:00:00 AM,1.430985,1.43387,1.43014,1.433075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/21/2009 12:00:00 AM,1.433085,1.43731,1.426565,1.42851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2009 12:00:00 AM,1.42851,1.433195,1.42175,1.42538,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/23/2009 12:00:00 AM,1.42545,1.436635,1.42343,1.43358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2009 12:00:00 AM,1.433555,1.441785,1.4331,1.436415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/27/2009 12:00:00 AM,1.438895,1.439355,1.435935,1.43761,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/28/2009 12:00:00 AM,1.437595,1.441345,1.435375,1.43734,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/29/2009 12:00:00 AM,1.43738,1.445825,1.43317,1.43411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2009 12:00:00 AM,1.4341,1.436115,1.42736,1.434125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/31/2009 12:00:00 AM,1.434115,1.444075,1.43066,1.43324,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/3/2010 12:00:00 AM,1.430245,1.433695,1.429845,1.43164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/4/2010 12:00:00 AM,1.43159,1.445545,1.42577,1.44248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2010 12:00:00 AM,1.442465,1.4484,1.43463,1.436445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2010 12:00:00 AM,1.43647,1.4435,1.428265,1.440135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2010 12:00:00 AM,1.44012,1.444695,1.42991,1.431715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2010 12:00:00 AM,1.43172,1.44391,1.42637,1.441495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2010 12:00:00 AM,1.44287,1.447865,1.44084,1.446425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/11/2010 12:00:00 AM,1.44644,1.45564,1.44629,1.45083,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n1/12/2010 12:00:00 AM,1.450805,1.454575,1.44536,1.44759,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2010 12:00:00 AM,1.44762,1.45791,1.445655,1.45226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2010 12:00:00 AM,1.452265,1.4556,1.444635,1.44996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/15/2010 12:00:00 AM,1.449955,1.450315,1.43367,1.43795,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2010 12:00:00 AM,1.435435,1.43707,1.43445,1.436825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/18/2010 12:00:00 AM,1.43685,1.440855,1.4335,1.44046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2010 12:00:00 AM,1.440435,1.44141,1.42527,1.42805,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2010 12:00:00 AM,1.428075,1.428895,1.408095,1.411265,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2010 12:00:00 AM,1.41127,1.414315,1.402925,1.40987,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/22/2010 12:00:00 AM,1.409875,1.416945,1.40868,1.4158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/24/2010 12:00:00 AM,1.41579,1.417295,1.414225,1.41531,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/25/2010 12:00:00 AM,1.415335,1.4194,1.412855,1.414715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/26/2010 12:00:00 AM,1.41473,1.41792,1.404245,1.408225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2010 12:00:00 AM,1.408215,1.40964,1.39941,1.402945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2010 12:00:00 AM,1.40293,1.405245,1.393615,1.396325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2010 12:00:00 AM,1.39635,1.39872,1.38627,1.38646,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2010 12:00:00 AM,1.386425,1.38826,1.385405,1.387565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/1/2010 12:00:00 AM,1.387535,1.393855,1.385295,1.392245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/2/2010 12:00:00 AM,1.392245,1.397615,1.388665,1.397565,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2010 12:00:00 AM,1.39757,1.402605,1.388275,1.389785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2010 12:00:00 AM,1.389775,1.390255,1.37137,1.374165,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2010 12:00:00 AM,1.37417,1.37459,1.35856,1.36636,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2010 12:00:00 AM,1.36581,1.36675,1.36316,1.36434,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/8/2010 12:00:00 AM,1.36429,1.37133,1.36215,1.365525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/9/2010 12:00:00 AM,1.36555,1.38392,1.36495,1.378155,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2010 12:00:00 AM,1.37812,1.38126,1.367655,1.37479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2010 12:00:00 AM,1.37483,1.38011,1.359565,1.36876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2010 12:00:00 AM,1.36886,1.3689,1.35319,1.361755,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2010 12:00:00 AM,1.362585,1.362595,1.360745,1.362295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n2/15/2010 12:00:00 AM,1.362275,1.36337,1.357885,1.359795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/16/2010 12:00:00 AM,1.359795,1.377885,1.35887,1.376205,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2010 12:00:00 AM,1.376195,1.378865,1.358605,1.3608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2010 12:00:00 AM,1.360775,1.36545,1.344505,1.34672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2010 12:00:00 AM,1.346715,1.360735,1.34537,1.359515,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2010 12:00:00 AM,1.36366,1.36404,1.36016,1.36295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n2/22/2010 12:00:00 AM,1.362945,1.365365,1.357365,1.36059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/23/2010 12:00:00 AM,1.360605,1.369205,1.34968,1.352395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2010 12:00:00 AM,1.35241,1.36265,1.350195,1.35427,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/25/2010 12:00:00 AM,1.354295,1.357065,1.34516,1.35366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/26/2010 12:00:00 AM,1.35364,1.36832,1.35343,1.36157,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2010 12:00:00 AM,1.36249,1.364015,1.36173,1.363925,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/1/2010 12:00:00 AM,1.36394,1.36542,1.346065,1.35613,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2010 12:00:00 AM,1.356135,1.36219,1.34353,1.36194,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2010 12:00:00 AM,1.36193,1.3736,1.35926,1.37003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2010 12:00:00 AM,1.370035,1.371225,1.355125,1.358195,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2010 12:00:00 AM,1.358195,1.36299,1.353065,1.36205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2010 12:00:00 AM,1.36324,1.36457,1.362565,1.363715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n3/8/2010 12:00:00 AM,1.36369,1.370435,1.36057,1.36193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n3/9/2010 12:00:00 AM,1.36193,1.363525,1.353755,1.360645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/10/2010 12:00:00 AM,1.360645,1.367935,1.35445,1.364375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2010 12:00:00 AM,1.36434,1.368715,1.362105,1.36849,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/12/2010 12:00:00 AM,1.368475,1.37962,1.366955,1.37617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2010 12:00:00 AM,1.37642,1.37756,1.376035,1.37733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/15/2010 12:00:00 AM,1.37735,1.377405,1.363955,1.367415,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2010 12:00:00 AM,1.36739,1.37833,1.36567,1.37679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2010 12:00:00 AM,1.376795,1.38182,1.372655,1.373745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2010 12:00:00 AM,1.373695,1.37394,1.35866,1.36114,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2010 12:00:00 AM,1.361145,1.36267,1.350295,1.353555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2010 12:00:00 AM,1.353755,1.353825,1.35117,1.35129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/22/2010 12:00:00 AM,1.351285,1.35691,1.34639,1.35675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2010 12:00:00 AM,1.35673,1.35676,1.34587,1.346855,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2010 12:00:00 AM,1.34686,1.34855,1.330555,1.33292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2010 12:00:00 AM,1.332935,1.338735,1.32678,1.33058,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/26/2010 12:00:00 AM,1.33058,1.3425,1.330155,1.34224,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2010 12:00:00 AM,1.347345,1.349345,1.343605,1.34448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2010 12:00:00 AM,1.344505,1.35064,1.34191,1.34898,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2010 12:00:00 AM,1.348985,1.35372,1.339565,1.343415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2010 12:00:00 AM,1.34342,1.35482,1.338445,1.352655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2010 12:00:00 AM,1.352695,1.35914,1.34604,1.358755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2010 12:00:00 AM,1.35871,1.35893,1.34755,1.34904,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n4/4/2010 12:00:00 AM,1.349785,1.35021,1.348255,1.34942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n4/5/2010 12:00:00 AM,1.34942,1.35381,1.346065,1.346695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2010 12:00:00 AM,1.346705,1.346715,1.335555,1.338205,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2010 12:00:00 AM,1.33824,1.340215,1.3326,1.33309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/8/2010 12:00:00 AM,1.33308,1.338375,1.32825,1.337585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2010 12:00:00 AM,1.33756,1.34972,1.334185,1.34962,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2010 12:00:00 AM,1.36602,1.367725,1.36098,1.365775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/12/2010 12:00:00 AM,1.36577,1.369205,1.3566,1.35867,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2010 12:00:00 AM,1.358685,1.362725,1.35455,1.361505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2010 12:00:00 AM,1.361495,1.367865,1.359495,1.365675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2010 12:00:00 AM,1.36571,1.366675,1.352145,1.35661,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2010 12:00:00 AM,1.356625,1.356635,1.347255,1.350845,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2010 12:00:00 AM,1.346985,1.34978,1.346745,1.34766,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/19/2010 12:00:00 AM,1.34762,1.349515,1.34164,1.348635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2010 12:00:00 AM,1.348665,1.35227,1.341915,1.342235,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2010 12:00:00 AM,1.34222,1.344725,1.33585,1.338805,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2010 12:00:00 AM,1.33881,1.342145,1.320215,1.322305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2010 12:00:00 AM,1.32233,1.33997,1.32059,1.337365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2010 12:00:00 AM,1.334825,1.337635,1.333445,1.336275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/26/2010 12:00:00 AM,1.33625,1.34159,1.329155,1.339475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2010 12:00:00 AM,1.339475,1.33949,1.31442,1.31797,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2010 12:00:00 AM,1.31797,1.32661,1.31145,1.31971,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/29/2010 12:00:00 AM,1.319675,1.32788,1.318445,1.325085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/30/2010 12:00:00 AM,1.325095,1.33423,1.32248,1.33162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/2/2010 12:00:00 AM,1.33573,1.336185,1.331255,1.33126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/3/2010 12:00:00 AM,1.331245,1.33125,1.315505,1.319585,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2010 12:00:00 AM,1.319575,1.321375,1.296215,1.297765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2010 12:00:00 AM,1.297755,1.299605,1.27896,1.28162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2010 12:00:00 AM,1.281655,1.28569,1.251745,1.26545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2010 12:00:00 AM,1.265485,1.279815,1.25861,1.27304,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2010 12:00:00 AM,1.29205,1.295005,1.28409,1.286945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/10/2010 12:00:00 AM,1.286915,1.309445,1.2723,1.27375,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2010 12:00:00 AM,1.273795,1.2803,1.26156,1.26393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2010 12:00:00 AM,1.26394,1.27391,1.260555,1.264615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/13/2010 12:00:00 AM,1.26457,1.268435,1.25163,1.25321,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2010 12:00:00 AM,1.25323,1.25758,1.23586,1.23817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2010 12:00:00 AM,1.234245,1.237305,1.23407,1.235875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/17/2010 12:00:00 AM,1.23588,1.241415,1.223445,1.23828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/18/2010 12:00:00 AM,1.23829,1.244405,1.214415,1.21446,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2010 12:00:00 AM,1.21449,1.243135,1.21446,1.238495,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2010 12:00:00 AM,1.23844,1.2598,1.22962,1.253995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2010 12:00:00 AM,1.253985,1.267245,1.24711,1.257,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/23/2010 12:00:00 AM,1.253785,1.25634,1.250605,1.25119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/24/2010 12:00:00 AM,1.251195,1.25389,1.233235,1.233895,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2010 12:00:00 AM,1.2339,1.23886,1.217755,1.233295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/26/2010 12:00:00 AM,1.2333,1.23453,1.215365,1.218345,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2010 12:00:00 AM,1.21831,1.23946,1.218245,1.236755,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2010 12:00:00 AM,1.236745,1.245345,1.22682,1.226835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2010 12:00:00 AM,1.226965,1.22928,1.226055,1.22889,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/31/2010 12:00:00 AM,1.228925,1.233445,1.226645,1.22712,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2010 12:00:00 AM,1.227115,1.23541,1.21113,1.224615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/2/2010 12:00:00 AM,1.224625,1.22736,1.21753,1.225165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/3/2010 12:00:00 AM,1.225155,1.23267,1.215265,1.217855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2010 12:00:00 AM,1.21784,1.22156,1.195545,1.196745,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2010 12:00:00 AM,1.192755,1.196585,1.192345,1.19302,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n6/7/2010 12:00:00 AM,1.19301,1.199155,1.187655,1.192305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/8/2010 12:00:00 AM,1.19233,1.200905,1.19017,1.195865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2010 12:00:00 AM,1.195885,1.207335,1.19239,1.198955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/10/2010 12:00:00 AM,1.19898,1.214175,1.195695,1.213145,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2010 12:00:00 AM,1.21311,1.215235,1.204475,1.209725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2010 12:00:00 AM,1.21296,1.22067,1.21165,1.22048,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2010 12:00:00 AM,1.22051,1.229815,1.21636,1.2211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/15/2010 12:00:00 AM,1.221175,1.234945,1.21683,1.23161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2010 12:00:00 AM,1.231595,1.23532,1.225465,1.229925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/17/2010 12:00:00 AM,1.229895,1.241275,1.224205,1.238665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2010 12:00:00 AM,1.238675,1.24166,1.235355,1.23773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/20/2010 12:00:00 AM,1.24514,1.24687,1.239935,1.24159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/21/2010 12:00:00 AM,1.241495,1.24673,1.230375,1.232155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2010 12:00:00 AM,1.23222,1.235415,1.22518,1.22662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/23/2010 12:00:00 AM,1.22665,1.234365,1.220945,1.230655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2010 12:00:00 AM,1.23069,1.23885,1.226165,1.233625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/25/2010 12:00:00 AM,1.23362,1.23952,1.225415,1.23924,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2010 12:00:00 AM,1.237385,1.238885,1.236885,1.238655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/28/2010 12:00:00 AM,1.238605,1.23974,1.22656,1.228715,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2010 12:00:00 AM,1.22871,1.229075,1.21517,1.21849,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2010 12:00:00 AM,1.218545,1.23045,1.216655,1.222835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2010 12:00:00 AM,1.22281,1.25405,1.219355,1.251195,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2010 12:00:00 AM,1.25114,1.26116,1.248215,1.25498,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/4/2010 12:00:00 AM,1.256285,1.25651,1.25436,1.25466,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/5/2010 12:00:00 AM,1.25468,1.25581,1.250465,1.25081,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/6/2010 12:00:00 AM,1.250775,1.26622,1.24803,1.262265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2010 12:00:00 AM,1.26229,1.266495,1.255325,1.262495,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/8/2010 12:00:00 AM,1.26249,1.271215,1.26247,1.268955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/9/2010 12:00:00 AM,1.26896,1.272245,1.26088,1.26418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2010 12:00:00 AM,1.263785,1.26474,1.262835,1.263845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n7/12/2010 12:00:00 AM,1.263835,1.26453,1.255125,1.260325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2010 12:00:00 AM,1.260335,1.27387,1.252255,1.27197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2010 12:00:00 AM,1.271925,1.277825,1.26829,1.27343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/15/2010 12:00:00 AM,1.27345,1.295485,1.27084,1.291875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2010 12:00:00 AM,1.291865,1.30072,1.288975,1.29284,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/18/2010 12:00:00 AM,1.290615,1.291855,1.28884,1.288925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/19/2010 12:00:00 AM,1.288915,1.29919,1.28705,1.29394,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2010 12:00:00 AM,1.29393,1.30285,1.28393,1.290565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/21/2010 12:00:00 AM,1.290595,1.2913,1.273265,1.276025,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2010 12:00:00 AM,1.27605,1.293295,1.273715,1.291175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2010 12:00:00 AM,1.29119,1.296535,1.279345,1.29133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/25/2010 12:00:00 AM,1.289105,1.29275,1.28771,1.2923,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/26/2010 12:00:00 AM,1.29233,1.30054,1.288935,1.29822,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/27/2010 12:00:00 AM,1.29821,1.30461,1.2952,1.29884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/28/2010 12:00:00 AM,1.29885,1.304205,1.29666,1.299975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/29/2010 12:00:00 AM,1.300005,1.310715,1.29778,1.306695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2010 12:00:00 AM,1.30666,1.309345,1.29807,1.30369,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2010 12:00:00 AM,1.30633,1.306645,1.305395,1.30598,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/2/2010 12:00:00 AM,1.30601,1.31954,1.30556,1.317205,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2010 12:00:00 AM,1.317195,1.32622,1.31471,1.322045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2010 12:00:00 AM,1.32207,1.32393,1.313125,1.315455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2010 12:00:00 AM,1.315475,1.323545,1.31192,1.31795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/6/2010 12:00:00 AM,1.31796,1.33341,1.315755,1.32911,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2010 12:00:00 AM,1.329375,1.329665,1.327665,1.32836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/9/2010 12:00:00 AM,1.32836,1.330765,1.321175,1.321585,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2010 12:00:00 AM,1.32158,1.32281,1.307435,1.315545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2010 12:00:00 AM,1.31557,1.316055,1.283015,1.284945,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2010 12:00:00 AM,1.284965,1.29325,1.27803,1.28429,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/13/2010 12:00:00 AM,1.28426,1.29061,1.275175,1.275195,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2010 12:00:00 AM,1.2761,1.277425,1.27569,1.27571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/16/2010 12:00:00 AM,1.27569,1.28711,1.273375,1.281355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2010 12:00:00 AM,1.281325,1.291595,1.28044,1.28697,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2010 12:00:00 AM,1.286965,1.292235,1.27911,1.27953,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2010 12:00:00 AM,1.279565,1.290255,1.277175,1.280795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/20/2010 12:00:00 AM,1.28079,1.283285,1.266365,1.27068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2010 12:00:00 AM,1.270585,1.271195,1.26901,1.2699,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/23/2010 12:00:00 AM,1.269875,1.272945,1.262385,1.26312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/24/2010 12:00:00 AM,1.263125,1.271915,1.258735,1.26359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/25/2010 12:00:00 AM,1.2636,1.27267,1.26085,1.26719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2010 12:00:00 AM,1.267155,1.276475,1.26504,1.27044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2010 12:00:00 AM,1.27039,1.27796,1.26762,1.27329,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2010 12:00:00 AM,1.2761,1.276895,1.274445,1.27529,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/30/2010 12:00:00 AM,1.27525,1.27555,1.265905,1.266405,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2010 12:00:00 AM,1.2664,1.274295,1.26256,1.26735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/1/2010 12:00:00 AM,1.26738,1.285565,1.266305,1.279485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2010 12:00:00 AM,1.279475,1.284845,1.277675,1.281475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2010 12:00:00 AM,1.281455,1.28973,1.280875,1.28952,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2010 12:00:00 AM,1.28906,1.289765,1.28822,1.288805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n9/6/2010 12:00:00 AM,1.288795,1.29188,1.279965,1.28185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2010 12:00:00 AM,1.281825,1.2819,1.267645,1.26924,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2010 12:00:00 AM,1.26926,1.276335,1.2659,1.272755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2010 12:00:00 AM,1.272735,1.276605,1.266475,1.267825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2010 12:00:00 AM,1.267815,1.274695,1.2644,1.270875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/12/2010 12:00:00 AM,1.27158,1.27613,1.270395,1.276025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/13/2010 12:00:00 AM,1.27599,1.28926,1.27587,1.28634,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2010 12:00:00 AM,1.2863,1.303345,1.282945,1.29956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2010 12:00:00 AM,1.29957,1.3037,1.295545,1.30109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/16/2010 12:00:00 AM,1.30104,1.31166,1.297585,1.306665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2010 12:00:00 AM,1.30668,1.31595,1.30194,1.30377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2010 12:00:00 AM,1.30613,1.306645,1.30346,1.30435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/20/2010 12:00:00 AM,1.30434,1.31215,1.30292,1.30628,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2010 12:00:00 AM,1.30623,1.329045,1.305965,1.32836,0,0,0,0,0,100,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2010 12:00:00 AM,1.32833,1.34403,1.32676,1.339345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2010 12:00:00 AM,1.33934,1.34136,1.329115,1.329475,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2010 12:00:00 AM,1.32947,1.3494,1.32865,1.34917,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2010 12:00:00 AM,1.348635,1.34952,1.346915,1.34793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n9/27/2010 12:00:00 AM,1.34793,1.350665,1.34257,1.34301,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2010 12:00:00 AM,1.34298,1.35952,1.338055,1.357305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2010 12:00:00 AM,1.357315,1.36466,1.35665,1.362485,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2010 12:00:00 AM,1.362485,1.368365,1.35595,1.3631,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2010 12:00:00 AM,1.363125,1.37831,1.36294,1.377795,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2010 12:00:00 AM,1.380215,1.380645,1.377255,1.37757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/4/2010 12:00:00 AM,1.37754,1.37847,1.36444,1.36486,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2010 12:00:00 AM,1.364855,1.385915,1.36375,1.38535,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2010 12:00:00 AM,1.38534,1.394825,1.379855,1.3916,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2010 12:00:00 AM,1.391615,1.40294,1.3857,1.39249,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/8/2010 12:00:00 AM,1.392505,1.3984,1.38334,1.39264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/10/2010 12:00:00 AM,1.399525,1.40125,1.39742,1.39964,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n10/11/2010 12:00:00 AM,1.399645,1.399925,1.38567,1.386505,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2010 12:00:00 AM,1.386525,1.393605,1.37753,1.39204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2010 12:00:00 AM,1.39205,1.400155,1.39127,1.39834,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/14/2010 12:00:00 AM,1.398385,1.412245,1.398385,1.402495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/15/2010 12:00:00 AM,1.40247,1.415925,1.39371,1.39727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n10/17/2010 12:00:00 AM,1.39906,1.399195,1.39419,1.39517,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/18/2010 12:00:00 AM,1.39521,1.39984,1.38311,1.396345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/19/2010 12:00:00 AM,1.396345,1.400445,1.369765,1.36995,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2010 12:00:00 AM,1.36996,1.39911,1.36996,1.39762,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2010 12:00:00 AM,1.39765,1.40504,1.38718,1.39125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2010 12:00:00 AM,1.39123,1.397215,1.38581,1.392835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/24/2010 12:00:00 AM,1.39738,1.39776,1.3934,1.396195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n10/25/2010 12:00:00 AM,1.396215,1.40802,1.390785,1.392315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2010 12:00:00 AM,1.39229,1.39819,1.38256,1.384645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2010 12:00:00 AM,1.3844,1.38784,1.3734,1.37949,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2010 12:00:00 AM,1.37945,1.39515,1.377855,1.394355,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2010 12:00:00 AM,1.394365,1.394365,1.380715,1.391815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2010 12:00:00 AM,1.39625,1.39832,1.395865,1.39732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/1/2010 12:00:00 AM,1.397295,1.40115,1.386405,1.39088,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2010 12:00:00 AM,1.39088,1.40581,1.388165,1.403295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2010 12:00:00 AM,1.40324,1.41894,1.39916,1.41265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2010 12:00:00 AM,1.41267,1.42822,1.41024,1.422845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2010 12:00:00 AM,1.42284,1.423045,1.40238,1.40334,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n11/7/2010 12:00:00 AM,1.405695,1.40822,1.404375,1.407465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/8/2010 12:00:00 AM,1.40749,1.40858,1.385915,1.386285,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2010 12:00:00 AM,1.386255,1.397395,1.37477,1.376895,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2010 12:00:00 AM,1.37688,1.38252,1.367055,1.377445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/11/2010 12:00:00 AM,1.37744,1.38209,1.360775,1.362155,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2010 12:00:00 AM,1.36214,1.3777,1.357375,1.369255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2010 12:00:00 AM,1.370795,1.37089,1.36809,1.368895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/15/2010 12:00:00 AM,1.368845,1.375085,1.356345,1.35732,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2010 12:00:00 AM,1.357345,1.36559,1.34468,1.34953,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2010 12:00:00 AM,1.349525,1.35659,1.346045,1.355295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/18/2010 12:00:00 AM,1.3553,1.366745,1.354265,1.365605,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2010 12:00:00 AM,1.36562,1.373155,1.360855,1.36858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/21/2010 12:00:00 AM,1.371765,1.374445,1.37114,1.37417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/22/2010 12:00:00 AM,1.3742,1.378635,1.357685,1.359945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2010 12:00:00 AM,1.35991,1.361445,1.33598,1.338585,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2010 12:00:00 AM,1.338605,1.34214,1.32845,1.33575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/25/2010 12:00:00 AM,1.33576,1.338785,1.328655,1.33399,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/26/2010 12:00:00 AM,1.33394,1.33504,1.32005,1.324835,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2010 12:00:00 AM,1.328245,1.32901,1.323095,1.323765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/29/2010 12:00:00 AM,1.32379,1.330215,1.306385,1.310045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2010 12:00:00 AM,1.31006,1.31503,1.29689,1.29957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2010 12:00:00 AM,1.2996,1.31816,1.297105,1.3125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2010 12:00:00 AM,1.312495,1.324725,1.30604,1.3212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2010 12:00:00 AM,1.321195,1.341725,1.31933,1.34112,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2010 12:00:00 AM,1.33802,1.342255,1.337795,1.341345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/6/2010 12:00:00 AM,1.34131,1.34207,1.32464,1.328855,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2010 12:00:00 AM,1.32881,1.34006,1.323615,1.324835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2010 12:00:00 AM,1.32481,1.328045,1.318025,1.32485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/9/2010 12:00:00 AM,1.324865,1.332315,1.316425,1.324085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/10/2010 12:00:00 AM,1.32409,1.328245,1.317855,1.32282,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/12/2010 12:00:00 AM,1.31978,1.320985,1.31924,1.319695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n12/13/2010 12:00:00 AM,1.319725,1.343345,1.318265,1.339435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2010 12:00:00 AM,1.33941,1.349835,1.3355,1.33569,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2010 12:00:00 AM,1.335695,1.337765,1.32086,1.322465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2010 12:00:00 AM,1.32248,1.3266,1.31815,1.32391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/17/2010 12:00:00 AM,1.32392,1.33593,1.31333,1.318495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2010 12:00:00 AM,1.318635,1.318675,1.31521,1.316345,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/20/2010 12:00:00 AM,1.316305,1.318295,1.30946,1.311705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/21/2010 12:00:00 AM,1.31171,1.320195,1.30734,1.309095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2010 12:00:00 AM,1.309115,1.318145,1.30786,1.311435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2010 12:00:00 AM,1.31144,1.31514,1.30555,1.312295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/24/2010 12:00:00 AM,1.312245,1.314815,1.308745,1.311615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/26/2010 12:00:00 AM,1.311505,1.31178,1.30726,1.30792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/27/2010 12:00:00 AM,1.30791,1.318935,1.307905,1.318855,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2010 12:00:00 AM,1.31886,1.327445,1.308375,1.308535,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2010 12:00:00 AM,1.308545,1.323875,1.30843,1.322405,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2010 12:00:00 AM,1.322355,1.331465,1.32194,1.33014,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2010 12:00:00 AM,1.33011,1.342445,1.328895,1.33919,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2011 12:00:00 AM,1.334805,1.33629,1.33344,1.33567,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/3/2011 12:00:00 AM,1.33569,1.33953,1.32507,1.335585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/4/2011 12:00:00 AM,1.33562,1.343315,1.329145,1.331845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2011 12:00:00 AM,1.33185,1.332535,1.312555,1.31561,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2011 12:00:00 AM,1.315555,1.317045,1.296795,1.29792,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2011 12:00:00 AM,1.297915,1.3021,1.290565,1.291115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2011 12:00:00 AM,1.287765,1.2906,1.287575,1.289535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/10/2011 12:00:00 AM,1.289535,1.296655,1.287355,1.29644,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/11/2011 12:00:00 AM,1.296445,1.29927,1.29045,1.29829,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2011 12:00:00 AM,1.298265,1.314465,1.296165,1.31266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2011 12:00:00 AM,1.312655,1.338315,1.308895,1.335095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2011 12:00:00 AM,1.335115,1.345665,1.33145,1.337375,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/16/2011 12:00:00 AM,1.338545,1.338545,1.335345,1.33789,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n1/17/2011 12:00:00 AM,1.33793,1.33798,1.32442,1.32814,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2011 12:00:00 AM,1.328135,1.346605,1.32535,1.33782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2011 12:00:00 AM,1.33777,1.353845,1.337695,1.34519,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2011 12:00:00 AM,1.34517,1.35232,1.33961,1.346565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/21/2011 12:00:00 AM,1.3466,1.362475,1.34489,1.361495,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2011 12:00:00 AM,1.364205,1.36426,1.36032,1.3619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/24/2011 12:00:00 AM,1.361915,1.368565,1.35404,1.36428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/25/2011 12:00:00 AM,1.36431,1.370395,1.35726,1.368505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2011 12:00:00 AM,1.36852,1.372155,1.3641,1.371015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2011 12:00:00 AM,1.37103,1.37583,1.36392,1.372225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/28/2011 12:00:00 AM,1.372245,1.374635,1.358345,1.36086,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2011 12:00:00 AM,1.358845,1.360355,1.35714,1.35719,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/31/2011 12:00:00 AM,1.357215,1.373965,1.35705,1.371385,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n2/1/2011 12:00:00 AM,1.371365,1.38429,1.37007,1.382875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2011 12:00:00 AM,1.382805,1.38617,1.37674,1.38166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/3/2011 12:00:00 AM,1.38165,1.382565,1.36093,1.362395,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2011 12:00:00 AM,1.362425,1.3679,1.35436,1.35813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2011 12:00:00 AM,1.356565,1.357505,1.35646,1.357325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/7/2011 12:00:00 AM,1.357315,1.36267,1.350825,1.359255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/8/2011 12:00:00 AM,1.35923,1.36886,1.35725,1.36259,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2011 12:00:00 AM,1.36255,1.37443,1.36112,1.371955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2011 12:00:00 AM,1.371965,1.372805,1.35774,1.36033,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2011 12:00:00 AM,1.36035,1.36208,1.349745,1.35476,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2011 12:00:00 AM,1.350865,1.353395,1.35016,1.351195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/14/2011 12:00:00 AM,1.351225,1.35584,1.34285,1.347915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/15/2011 12:00:00 AM,1.34793,1.35508,1.34613,1.349845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2011 12:00:00 AM,1.349785,1.358855,1.346235,1.357395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2011 12:00:00 AM,1.35739,1.36274,1.35367,1.362285,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2011 12:00:00 AM,1.36226,1.371525,1.354535,1.36865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2011 12:00:00 AM,1.370135,1.37161,1.36865,1.371245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/21/2011 12:00:00 AM,1.37125,1.37129,1.364735,1.36812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2011 12:00:00 AM,1.368125,1.37038,1.3525,1.367235,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/23/2011 12:00:00 AM,1.36728,1.378655,1.36721,1.37605,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2011 12:00:00 AM,1.37604,1.382385,1.370445,1.38198,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2011 12:00:00 AM,1.381985,1.38381,1.372375,1.375055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2011 12:00:00 AM,1.37586,1.3763,1.372985,1.37343,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/28/2011 12:00:00 AM,1.373435,1.38556,1.37116,1.38209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2011 12:00:00 AM,1.3821,1.38542,1.376265,1.376795,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2011 12:00:00 AM,1.37677,1.38902,1.37434,1.38654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2011 12:00:00 AM,1.386565,1.397565,1.38326,1.39561,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2011 12:00:00 AM,1.395615,1.400755,1.394065,1.39845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/6/2011 12:00:00 AM,1.39915,1.399825,1.398635,1.39903,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,100,0,0,0,0,0,0\n3/7/2011 12:00:00 AM,1.39904,1.40361,1.395575,1.396225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2011 12:00:00 AM,1.39622,1.39887,1.386225,1.38944,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2011 12:00:00 AM,1.389435,1.394155,1.38557,1.390365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/10/2011 12:00:00 AM,1.39036,1.392455,1.377545,1.3801,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2011 12:00:00 AM,1.38008,1.39043,1.37522,1.390345,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2011 12:00:00 AM,1.396645,1.397845,1.392815,1.393505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/14/2011 12:00:00 AM,1.3935,1.40031,1.390475,1.399075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2011 12:00:00 AM,1.39904,1.40131,1.385565,1.398585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/16/2011 12:00:00 AM,1.398595,1.400105,1.38667,1.388435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2011 12:00:00 AM,1.38844,1.405255,1.38772,1.40306,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2011 12:00:00 AM,1.403075,1.41837,1.398065,1.41726,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2011 12:00:00 AM,1.41955,1.419615,1.41662,1.41689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/21/2011 12:00:00 AM,1.41684,1.424015,1.4139,1.42167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2011 12:00:00 AM,1.421705,1.424835,1.41626,1.416815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2011 12:00:00 AM,1.416845,1.42147,1.4077,1.410475,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2011 12:00:00 AM,1.410465,1.422055,1.405365,1.41697,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2011 12:00:00 AM,1.41693,1.419395,1.40552,1.40744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2011 12:00:00 AM,1.40411,1.405445,1.402115,1.40352,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/28/2011 12:00:00 AM,1.40351,1.41157,1.402645,1.407325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2011 12:00:00 AM,1.407315,1.414875,1.404725,1.412085,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2011 12:00:00 AM,1.4121,1.414745,1.40522,1.412745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/31/2011 12:00:00 AM,1.4127,1.4233,1.411595,1.415675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2011 12:00:00 AM,1.415685,1.424575,1.406195,1.4228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2011 12:00:00 AM,1.423145,1.424265,1.421755,1.423455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n4/4/2011 12:00:00 AM,1.42347,1.42684,1.41926,1.420565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2011 12:00:00 AM,1.420555,1.42457,1.41517,1.42315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2011 12:00:00 AM,1.423145,1.43489,1.422815,1.43245,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2011 12:00:00 AM,1.432485,1.43265,1.424255,1.429805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2011 12:00:00 AM,1.42982,1.448835,1.42914,1.4486,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2011 12:00:00 AM,1.447295,1.44838,1.445145,1.44804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n4/11/2011 12:00:00 AM,1.44803,1.448315,1.442085,1.442355,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2011 12:00:00 AM,1.44236,1.45195,1.437725,1.44828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2011 12:00:00 AM,1.448285,1.452065,1.441375,1.44513,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/14/2011 12:00:00 AM,1.445105,1.45145,1.43654,1.45023,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2011 12:00:00 AM,1.45023,1.45023,1.439085,1.442355,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2011 12:00:00 AM,1.441225,1.442085,1.43909,1.43968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/18/2011 12:00:00 AM,1.439685,1.440515,1.415735,1.423755,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2011 12:00:00 AM,1.423745,1.4373,1.42052,1.436485,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2011 12:00:00 AM,1.43647,1.45474,1.43543,1.451735,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2011 12:00:00 AM,1.4517,1.464855,1.45153,1.45589,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2011 12:00:00 AM,1.45588,1.458845,1.453385,1.454695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/24/2011 12:00:00 AM,1.456285,1.45893,1.455135,1.45893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/25/2011 12:00:00 AM,1.458945,1.46273,1.452545,1.45517,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0\n4/26/2011 12:00:00 AM,1.45517,1.47142,1.449365,1.470495,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2011 12:00:00 AM,1.4705,1.479595,1.46327,1.478805,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2011 12:00:00 AM,1.478785,1.48819,1.477265,1.484065,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n4/29/2011 12:00:00 AM,1.484095,1.487805,1.480395,1.48147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2011 12:00:00 AM,1.48171,1.484015,1.478065,1.481615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/2/2011 12:00:00 AM,1.48162,1.490205,1.476255,1.47945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/3/2011 12:00:00 AM,1.479455,1.48903,1.475455,1.483715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2011 12:00:00 AM,1.4837,1.49398,1.4775,1.482735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/5/2011 12:00:00 AM,1.48275,1.48992,1.45102,1.45581,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2011 12:00:00 AM,1.4558,1.45875,1.431555,1.43513,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2011 12:00:00 AM,1.437455,1.43964,1.434105,1.43889,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n5/9/2011 12:00:00 AM,1.438875,1.444215,1.425425,1.436845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/10/2011 12:00:00 AM,1.43685,1.441905,1.42701,1.440015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2011 12:00:00 AM,1.440055,1.44234,1.417255,1.42069,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2011 12:00:00 AM,1.420685,1.42768,1.412355,1.422965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/13/2011 12:00:00 AM,1.423,1.43395,1.406635,1.41004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2011 12:00:00 AM,1.40915,1.409345,1.40632,1.406525,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/16/2011 12:00:00 AM,1.40655,1.424465,1.404845,1.41453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n5/17/2011 12:00:00 AM,1.414525,1.42761,1.412035,1.42666,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2011 12:00:00 AM,1.426615,1.42869,1.419505,1.42583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/19/2011 12:00:00 AM,1.425855,1.43372,1.42066,1.432575,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2011 12:00:00 AM,1.43259,1.434545,1.413905,1.41564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2011 12:00:00 AM,1.41256,1.414725,1.409565,1.41171,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/23/2011 12:00:00 AM,1.4117,1.413535,1.39695,1.40136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2011 12:00:00 AM,1.401365,1.413325,1.401365,1.40925,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2011 12:00:00 AM,1.40923,1.41182,1.40135,1.406925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/26/2011 12:00:00 AM,1.406915,1.420635,1.40681,1.414415,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2011 12:00:00 AM,1.41442,1.430265,1.412965,1.428295,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2011 12:00:00 AM,1.43233,1.43233,1.427785,1.42901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/30/2011 12:00:00 AM,1.42904,1.435285,1.42569,1.433315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2011 12:00:00 AM,1.433315,1.443705,1.432485,1.44245,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2011 12:00:00 AM,1.44247,1.445875,1.430755,1.43453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2011 12:00:00 AM,1.434525,1.451395,1.432565,1.4487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2011 12:00:00 AM,1.44871,1.46427,1.445105,1.46359,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2011 12:00:00 AM,1.461195,1.465735,1.461195,1.465265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,0,0,0,0,0,0\n6/6/2011 12:00:00 AM,1.46529,1.46581,1.45574,1.45907,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2011 12:00:00 AM,1.459105,1.46963,1.45638,1.46797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2011 12:00:00 AM,1.468,1.468935,1.456465,1.459205,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2011 12:00:00 AM,1.45922,1.465465,1.44776,1.45372,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/10/2011 12:00:00 AM,1.453735,1.45509,1.432255,1.43332,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2011 12:00:00 AM,1.432615,1.43423,1.432115,1.4336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/13/2011 12:00:00 AM,1.433605,1.44303,1.432215,1.44149,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/14/2011 12:00:00 AM,1.44149,1.44974,1.43785,1.44331,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/15/2011 12:00:00 AM,1.4433,1.443845,1.41563,1.419175,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2011 12:00:00 AM,1.419175,1.422135,1.40735,1.42018,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/17/2011 12:00:00 AM,1.42018,1.43394,1.41275,1.430355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2011 12:00:00 AM,1.427955,1.429795,1.42562,1.425765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/20/2011 12:00:00 AM,1.42574,1.43841,1.419125,1.43618,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2011 12:00:00 AM,1.436185,1.443405,1.430505,1.437705,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/22/2011 12:00:00 AM,1.437685,1.444195,1.431,1.43309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n6/23/2011 12:00:00 AM,1.43309,1.43333,1.41265,1.426195,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2011 12:00:00 AM,1.426175,1.43065,1.41419,1.418675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2011 12:00:00 AM,1.41931,1.419805,1.41463,1.41548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/27/2011 12:00:00 AM,1.415465,1.43285,1.41029,1.431125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2011 12:00:00 AM,1.43111,1.439705,1.42373,1.435745,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2011 12:00:00 AM,1.435755,1.44845,1.432885,1.446385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2011 12:00:00 AM,1.446395,1.4538,1.4448,1.447455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/1/2011 12:00:00 AM,1.44747,1.455215,1.44366,1.45276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/3/2011 12:00:00 AM,1.4535,1.4578,1.45324,1.45638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/4/2011 12:00:00 AM,1.45639,1.45678,1.449565,1.454195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2011 12:00:00 AM,1.4542,1.4542,1.439675,1.44347,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2011 12:00:00 AM,1.443475,1.44666,1.428635,1.433535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2011 12:00:00 AM,1.433545,1.437435,1.422115,1.43613,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2011 12:00:00 AM,1.436125,1.43683,1.420575,1.42576,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2011 12:00:00 AM,1.42052,1.422655,1.41978,1.42127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/11/2011 12:00:00 AM,1.421235,1.42279,1.39865,1.403835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2011 12:00:00 AM,1.40383,1.4054,1.383745,1.398935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2011 12:00:00 AM,1.398955,1.428225,1.396225,1.42697,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2011 12:00:00 AM,1.426995,1.427195,1.41156,1.4162,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2011 12:00:00 AM,1.41622,1.419245,1.409225,1.415905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/17/2011 12:00:00 AM,1.411195,1.413385,1.41088,1.412635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/18/2011 12:00:00 AM,1.41263,1.413635,1.401425,1.41259,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,-100,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,100,0,0,0\n7/19/2011 12:00:00 AM,1.412575,1.421725,1.40685,1.417045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/20/2011 12:00:00 AM,1.41707,1.427435,1.41334,1.426085,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2011 12:00:00 AM,1.426085,1.44379,1.4139,1.440845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2011 12:00:00 AM,1.440865,1.443755,1.432415,1.436475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/24/2011 12:00:00 AM,1.438735,1.441695,1.436555,1.43669,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/25/2011 12:00:00 AM,1.4367,1.44065,1.432505,1.437335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/26/2011 12:00:00 AM,1.437325,1.452555,1.43575,1.45082,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2011 12:00:00 AM,1.450815,1.4536,1.43389,1.436125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2011 12:00:00 AM,1.436125,1.44005,1.425355,1.432675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/29/2011 12:00:00 AM,1.43266,1.44134,1.422945,1.43728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2011 12:00:00 AM,1.43824,1.43841,1.434735,1.435425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/1/2011 12:00:00 AM,1.43546,1.445395,1.418495,1.42729,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2011 12:00:00 AM,1.42727,1.428305,1.41512,1.418405,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2011 12:00:00 AM,1.4184,1.4372,1.414265,1.43496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2011 12:00:00 AM,1.434975,1.43682,1.40557,1.407535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2011 12:00:00 AM,1.407545,1.429785,1.407035,1.42814,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2011 12:00:00 AM,1.441965,1.443195,1.42889,1.430825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/8/2011 12:00:00 AM,1.43077,1.440195,1.412955,1.417615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2011 12:00:00 AM,1.41762,1.439775,1.415265,1.435465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n8/10/2011 12:00:00 AM,1.43549,1.44012,1.41229,1.413695,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2011 12:00:00 AM,1.41369,1.4294,1.410345,1.421485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2011 12:00:00 AM,1.421475,1.429145,1.41498,1.424935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/14/2011 12:00:00 AM,1.426835,1.42842,1.42515,1.42839,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/15/2011 12:00:00 AM,1.428405,1.44772,1.426335,1.44377,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2011 12:00:00 AM,1.443795,1.447205,1.43544,1.43809,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2011 12:00:00 AM,1.438085,1.45174,1.43245,1.4428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/18/2011 12:00:00 AM,1.442795,1.445205,1.427145,1.4297,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2011 12:00:00 AM,1.429715,1.44524,1.42591,1.43943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2011 12:00:00 AM,1.43831,1.4385,1.436105,1.43668,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/22/2011 12:00:00 AM,1.43664,1.443445,1.43473,1.43577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/23/2011 12:00:00 AM,1.435765,1.44999,1.435725,1.44382,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2011 12:00:00 AM,1.44382,1.448155,1.437805,1.440795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2011 12:00:00 AM,1.4408,1.44746,1.432785,1.43882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/26/2011 12:00:00 AM,1.43883,1.450165,1.432895,1.449665,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2011 12:00:00 AM,1.450045,1.45037,1.4478,1.448095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/29/2011 12:00:00 AM,1.448085,1.45493,1.44658,1.451625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/30/2011 12:00:00 AM,1.451625,1.45333,1.438475,1.443965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2011 12:00:00 AM,1.443975,1.44691,1.435865,1.43639,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2011 12:00:00 AM,1.4364,1.437765,1.422655,1.426865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2011 12:00:00 AM,1.42685,1.42881,1.418395,1.4194,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2011 12:00:00 AM,1.416235,1.417415,1.413645,1.414855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/5/2011 12:00:00 AM,1.41486,1.417335,1.40589,1.40693,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2011 12:00:00 AM,1.40692,1.42866,1.39725,1.400935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2011 12:00:00 AM,1.40092,1.41497,1.40062,1.40805,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2011 12:00:00 AM,1.40804,1.408925,1.387285,1.38894,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2011 12:00:00 AM,1.388935,1.393665,1.36271,1.36634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2011 12:00:00 AM,1.35878,1.36225,1.355475,1.358335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/12/2011 12:00:00 AM,1.358325,1.369455,1.349475,1.363845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/13/2011 12:00:00 AM,1.363855,1.37391,1.355785,1.36824,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/14/2011 12:00:00 AM,1.36823,1.37835,1.35911,1.37481,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2011 12:00:00 AM,1.37483,1.393695,1.37036,1.38806,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2011 12:00:00 AM,1.388075,1.388215,1.37539,1.378705,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2011 12:00:00 AM,1.36932,1.37154,1.366345,1.368155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n9/19/2011 12:00:00 AM,1.368165,1.37211,1.35864,1.36222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/20/2011 12:00:00 AM,1.362225,1.374475,1.359345,1.370605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/21/2011 12:00:00 AM,1.37062,1.37984,1.35576,1.35779,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2011 12:00:00 AM,1.357785,1.35905,1.33847,1.350485,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2011 12:00:00 AM,1.35046,1.356735,1.34186,1.35055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/25/2011 12:00:00 AM,1.35193,1.355055,1.34879,1.351635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n9/26/2011 12:00:00 AM,1.35163,1.35475,1.336245,1.34956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/27/2011 12:00:00 AM,1.349565,1.36683,1.347945,1.35854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2011 12:00:00 AM,1.358455,1.369015,1.35199,1.3523,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2011 12:00:00 AM,1.352305,1.36795,1.352015,1.359555,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2011 12:00:00 AM,1.35958,1.360135,1.3394,1.3394,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2011 12:00:00 AM,1.334485,1.3369,1.33321,1.335765,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/3/2011 12:00:00 AM,1.335745,1.338135,1.316385,1.319045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2011 12:00:00 AM,1.31907,1.336925,1.31455,1.331735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2011 12:00:00 AM,1.33174,1.338395,1.32604,1.334375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/6/2011 12:00:00 AM,1.33439,1.345095,1.324195,1.34269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2011 12:00:00 AM,1.34268,1.352465,1.33613,1.339285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2011 12:00:00 AM,1.339135,1.340925,1.337795,1.340025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n10/10/2011 12:00:00 AM,1.340065,1.36985,1.33929,1.36266,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2011 12:00:00 AM,1.362645,1.3684,1.356555,1.363345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/12/2011 12:00:00 AM,1.363355,1.383355,1.358285,1.37777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2011 12:00:00 AM,1.37779,1.382635,1.36854,1.37524,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/14/2011 12:00:00 AM,1.375235,1.38941,1.37235,1.388265,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2011 12:00:00 AM,1.38681,1.388725,1.386355,1.3873,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/17/2011 12:00:00 AM,1.387315,1.39143,1.372465,1.374515,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2011 12:00:00 AM,1.37454,1.381735,1.365285,1.373225,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/19/2011 12:00:00 AM,1.373205,1.386925,1.37253,1.37673,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2011 12:00:00 AM,1.3767,1.3843,1.365635,1.379425,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/21/2011 12:00:00 AM,1.3794,1.39014,1.370415,1.38917,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2011 12:00:00 AM,1.38442,1.387405,1.382925,1.385005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n10/24/2011 12:00:00 AM,1.38499,1.39566,1.382205,1.39197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2011 12:00:00 AM,1.39198,1.39608,1.384895,1.390005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/26/2011 12:00:00 AM,1.389985,1.39755,1.379825,1.38855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/27/2011 12:00:00 AM,1.38854,1.424735,1.38854,1.419855,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2011 12:00:00 AM,1.419825,1.41986,1.41337,1.41562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/30/2011 12:00:00 AM,1.41424,1.416275,1.413735,1.413805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/31/2011 12:00:00 AM,1.4138,1.417195,1.38284,1.385905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2011 12:00:00 AM,1.38592,1.38712,1.360845,1.365455,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2011 12:00:00 AM,1.365445,1.382895,1.365315,1.368855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2011 12:00:00 AM,1.368875,1.385535,1.36568,1.38224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2011 12:00:00 AM,1.382225,1.386935,1.371105,1.377205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2011 12:00:00 AM,1.38284,1.383115,1.37775,1.3788,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/7/2011 12:00:00 AM,1.378805,1.381345,1.368145,1.37593,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2011 12:00:00 AM,1.3759,1.384705,1.37245,1.382505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2011 12:00:00 AM,1.382485,1.38591,1.352195,1.35263,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2011 12:00:00 AM,1.352635,1.365295,1.34837,1.36093,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2011 12:00:00 AM,1.360905,1.379505,1.35784,1.375425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2011 12:00:00 AM,1.381245,1.381245,1.377425,1.378475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/14/2011 12:00:00 AM,1.37849,1.378915,1.35918,1.362425,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2011 12:00:00 AM,1.362435,1.364075,1.34964,1.350435,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2011 12:00:00 AM,1.35047,1.355725,1.34215,1.34398,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2011 12:00:00 AM,1.343955,1.354,1.3423,1.345425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/18/2011 12:00:00 AM,1.345405,1.36143,1.344705,1.351025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2011 12:00:00 AM,1.351445,1.35363,1.350515,1.35359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/21/2011 12:00:00 AM,1.353605,1.35408,1.343025,1.348365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2011 12:00:00 AM,1.348355,1.35688,1.346925,1.35182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2011 12:00:00 AM,1.35183,1.353115,1.332015,1.334415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2011 12:00:00 AM,1.33439,1.341165,1.3316,1.332985,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2011 12:00:00 AM,1.333,1.333315,1.321255,1.32321,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2011 12:00:00 AM,1.331545,1.332725,1.32912,1.33098,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n11/28/2011 12:00:00 AM,1.330915,1.33987,1.327285,1.331455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/29/2011 12:00:00 AM,1.331455,1.344235,1.328595,1.332295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/30/2011 12:00:00 AM,1.332315,1.353335,1.325945,1.344235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2011 12:00:00 AM,1.34424,1.352135,1.341735,1.346615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/2/2011 12:00:00 AM,1.346605,1.355005,1.33631,1.340565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n12/4/2011 12:00:00 AM,1.342575,1.34268,1.339685,1.34159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/5/2011 12:00:00 AM,1.341585,1.348645,1.337495,1.338665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2011 12:00:00 AM,1.338655,1.342805,1.333325,1.34095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2011 12:00:00 AM,1.34095,1.34535,1.3351,1.339935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/8/2011 12:00:00 AM,1.339955,1.34596,1.328915,1.334575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2011 12:00:00 AM,1.334555,1.343415,1.328165,1.338645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2011 12:00:00 AM,1.33821,1.33821,1.335945,1.33706,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/12/2011 12:00:00 AM,1.33705,1.337745,1.316105,1.316465,0,0,0,-100,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2011 12:00:00 AM,1.316455,1.323685,1.30091,1.301875,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2011 12:00:00 AM,1.30187,1.306455,1.29452,1.298495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/15/2011 12:00:00 AM,1.298505,1.30498,1.295735,1.302915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100\n12/16/2011 12:00:00 AM,1.3029,1.30843,1.299515,1.3046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/18/2011 12:00:00 AM,1.304315,1.304345,1.303125,1.303585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/19/2011 12:00:00 AM,1.303565,1.304365,1.298305,1.300615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/20/2011 12:00:00 AM,1.30062,1.31317,1.299525,1.308655,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2011 12:00:00 AM,1.308645,1.319885,1.30253,1.30361,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2011 12:00:00 AM,1.30362,1.31191,1.30169,1.305445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/23/2011 12:00:00 AM,1.30548,1.309635,1.302625,1.304825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/25/2011 12:00:00 AM,1.303795,1.30425,1.303795,1.30425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2011 12:00:00 AM,1.304235,1.30829,1.30423,1.30478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0\n12/27/2011 12:00:00 AM,1.3048,1.308335,1.30432,1.306825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/28/2011 12:00:00 AM,1.306815,1.308045,1.29121,1.292485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2011 12:00:00 AM,1.29249,1.296475,1.28582,1.29523,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2011 12:00:00 AM,1.29523,1.29988,1.290375,1.29634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/2/2012 12:00:00 AM,1.29367,1.29716,1.291755,1.293685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/3/2012 12:00:00 AM,1.29367,1.30769,1.29356,1.305405,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2012 12:00:00 AM,1.3054,1.307285,1.289775,1.293085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2012 12:00:00 AM,1.293065,1.29438,1.27702,1.27918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2012 12:00:00 AM,1.279205,1.28126,1.269695,1.27173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2012 12:00:00 AM,1.269625,1.270625,1.266605,1.26792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/9/2012 12:00:00 AM,1.267915,1.278545,1.267735,1.277255,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2012 12:00:00 AM,1.277265,1.281835,1.274265,1.275335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2012 12:00:00 AM,1.275275,1.279005,1.266125,1.272165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/12/2012 12:00:00 AM,1.272175,1.28452,1.269925,1.28204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2012 12:00:00 AM,1.28201,1.287835,1.262415,1.267685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2012 12:00:00 AM,1.263545,1.265595,1.263545,1.26477,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/16/2012 12:00:00 AM,1.26476,1.26877,1.262595,1.26662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n1/17/2012 12:00:00 AM,1.266605,1.280905,1.26647,1.274655,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2012 12:00:00 AM,1.274685,1.286805,1.273425,1.286405,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2012 12:00:00 AM,1.28638,1.297235,1.28393,1.29611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2012 12:00:00 AM,1.296115,1.29863,1.28871,1.293105,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2012 12:00:00 AM,1.28792,1.289595,1.28759,1.288685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/23/2012 12:00:00 AM,1.28869,1.30527,1.288305,1.30249,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2012 12:00:00 AM,1.30251,1.306275,1.29536,1.30351,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/25/2012 12:00:00 AM,1.303515,1.312055,1.29312,1.31063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2012 12:00:00 AM,1.31062,1.3184,1.308835,1.308835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2012 12:00:00 AM,1.3088,1.323415,1.307785,1.322,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2012 12:00:00 AM,1.32239,1.32264,1.32059,1.320675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/30/2012 12:00:00 AM,1.32074,1.32108,1.30769,1.31384,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2012 12:00:00 AM,1.31385,1.3214,1.30421,1.307585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2012 12:00:00 AM,1.3076,1.321835,1.30261,1.316975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2012 12:00:00 AM,1.31697,1.31967,1.30855,1.313605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2012 12:00:00 AM,1.3136,1.32058,1.30662,1.315745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/5/2012 12:00:00 AM,1.31234,1.31312,1.31121,1.312435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n2/6/2012 12:00:00 AM,1.31245,1.31414,1.30278,1.31182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/7/2012 12:00:00 AM,1.3118,1.327,1.308935,1.324785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2012 12:00:00 AM,1.3248,1.32885,1.32145,1.32475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/9/2012 12:00:00 AM,1.324755,1.332195,1.322685,1.32759,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2012 12:00:00 AM,1.327575,1.3291,1.315575,1.319815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2012 12:00:00 AM,1.32102,1.32609,1.3202,1.32399,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/13/2012 12:00:00 AM,1.32397,1.32841,1.31457,1.315435,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2012 12:00:00 AM,1.31543,1.32158,1.308015,1.31286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/15/2012 12:00:00 AM,1.31287,1.31907,1.304395,1.30553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2012 12:00:00 AM,1.305535,1.31592,1.29744,1.312735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2012 12:00:00 AM,1.312745,1.31977,1.31154,1.31428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/19/2012 12:00:00 AM,1.31807,1.323735,1.31732,1.322365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/20/2012 12:00:00 AM,1.32236,1.327675,1.318235,1.320765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/21/2012 12:00:00 AM,1.320775,1.329335,1.318695,1.324875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2012 12:00:00 AM,1.32488,1.32669,1.321135,1.32555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n2/23/2012 12:00:00 AM,1.325555,1.337855,1.32315,1.337415,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2012 12:00:00 AM,1.337395,1.348615,1.335715,1.345015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2012 12:00:00 AM,1.346415,1.34789,1.345655,1.34676,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,100,0,0,0,0,0,0\n2/27/2012 12:00:00 AM,1.34674,1.34682,1.33663,1.340745,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,100\n2/28/2012 12:00:00 AM,1.34077,1.34799,1.338915,1.347875,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/29/2012 12:00:00 AM,1.34787,1.348555,1.33148,1.33244,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2012 12:00:00 AM,1.332435,1.33564,1.32822,1.33266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/2/2012 12:00:00 AM,1.33266,1.333265,1.318715,1.320205,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2012 12:00:00 AM,1.31922,1.320525,1.318285,1.31855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/5/2012 12:00:00 AM,1.318535,1.32416,1.316035,1.322335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2012 12:00:00 AM,1.32235,1.32259,1.310335,1.311985,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2012 12:00:00 AM,1.31197,1.31641,1.309645,1.31409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/8/2012 12:00:00 AM,1.314075,1.329105,1.313545,1.32717,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2012 12:00:00 AM,1.32715,1.32723,1.309685,1.31218,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2012 12:00:00 AM,1.31065,1.312475,1.31055,1.312215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/12/2012 12:00:00 AM,1.3122,1.31728,1.30789,1.31698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2012 12:00:00 AM,1.31692,1.319135,1.305205,1.307915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2012 12:00:00 AM,1.30793,1.309025,1.3011,1.302065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/15/2012 12:00:00 AM,1.30206,1.311945,1.300405,1.307685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2012 12:00:00 AM,1.307695,1.318705,1.304915,1.317375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2012 12:00:00 AM,1.31763,1.318735,1.31729,1.31765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,100,0,0,0,0,0,0\n3/19/2012 12:00:00 AM,1.31766,1.32653,1.314195,1.32293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2012 12:00:00 AM,1.32295,1.325225,1.31724,1.323835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/21/2012 12:00:00 AM,1.323845,1.3285,1.31788,1.321745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/22/2012 12:00:00 AM,1.321795,1.325465,1.31337,1.320465,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/23/2012 12:00:00 AM,1.32048,1.32935,1.319,1.32692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2012 12:00:00 AM,1.32715,1.328465,1.326575,1.32833,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/26/2012 12:00:00 AM,1.328345,1.33677,1.319205,1.33573,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2012 12:00:00 AM,1.33574,1.338565,1.331265,1.33293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/28/2012 12:00:00 AM,1.332915,1.33737,1.327735,1.33257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/29/2012 12:00:00 AM,1.33259,1.33459,1.32519,1.331425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/30/2012 12:00:00 AM,1.331415,1.337655,1.330955,1.334315,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2012 12:00:00 AM,1.336255,1.337645,1.33559,1.335675,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0\n4/2/2012 12:00:00 AM,1.33568,1.33806,1.327825,1.333,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2012 12:00:00 AM,1.33301,1.33676,1.32133,1.32226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2012 12:00:00 AM,1.32227,1.32333,1.3107,1.314395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2012 12:00:00 AM,1.31442,1.31643,1.30352,1.30629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2012 12:00:00 AM,1.30628,1.31124,1.305165,1.30952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/8/2012 12:00:00 AM,1.310275,1.31049,1.306675,1.308565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/9/2012 12:00:00 AM,1.30859,1.3134,1.30331,1.310915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/10/2012 12:00:00 AM,1.31092,1.314435,1.30541,1.307145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2012 12:00:00 AM,1.30714,1.31571,1.30665,1.31189,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2012 12:00:00 AM,1.311905,1.321275,1.310215,1.318865,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2012 12:00:00 AM,1.31887,1.320115,1.306965,1.307725,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2012 12:00:00 AM,1.30657,1.307535,1.304115,1.30438,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/16/2012 12:00:00 AM,1.30439,1.314795,1.299495,1.312625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n4/17/2012 12:00:00 AM,1.31264,1.317275,1.30906,1.313535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/18/2012 12:00:00 AM,1.31353,1.31411,1.30581,1.31174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n4/19/2012 12:00:00 AM,1.311755,1.316595,1.306955,1.31433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2012 12:00:00 AM,1.31433,1.32283,1.31288,1.32142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2012 12:00:00 AM,1.318355,1.32087,1.318355,1.320745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/23/2012 12:00:00 AM,1.320765,1.321045,1.310465,1.31493,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2012 12:00:00 AM,1.314945,1.321805,1.314525,1.31958,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2012 12:00:00 AM,1.319595,1.323645,1.31737,1.323115,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2012 12:00:00 AM,1.323115,1.326275,1.31771,1.319205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2012 12:00:00 AM,1.319205,1.327005,1.31573,1.325305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2012 12:00:00 AM,1.32361,1.32474,1.32361,1.32398,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/30/2012 12:00:00 AM,1.324005,1.32667,1.32082,1.32391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/1/2012 12:00:00 AM,1.323925,1.328375,1.320445,1.32381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/2/2012 12:00:00 AM,1.32382,1.32409,1.312225,1.314795,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2012 12:00:00 AM,1.31481,1.318025,1.30955,1.31545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/4/2012 12:00:00 AM,1.315445,1.317845,1.308055,1.30833,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2012 12:00:00 AM,1.30136,1.303285,1.295535,1.29616,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2012 12:00:00 AM,1.29616,1.306535,1.29616,1.30591,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2012 12:00:00 AM,1.30588,1.306,1.29827,1.299305,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2012 12:00:00 AM,1.29927,1.300395,1.29116,1.29344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2012 12:00:00 AM,1.29343,1.297925,1.292465,1.29333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/11/2012 12:00:00 AM,1.29332,1.29574,1.290525,1.29164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2012 12:00:00 AM,1.290145,1.29032,1.28825,1.28974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n5/14/2012 12:00:00 AM,1.289765,1.290435,1.281525,1.283025,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2012 12:00:00 AM,1.283055,1.286915,1.27219,1.2735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2012 12:00:00 AM,1.273505,1.27589,1.26815,1.273225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/17/2012 12:00:00 AM,1.27322,1.274935,1.266465,1.26982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2012 12:00:00 AM,1.26984,1.279435,1.26424,1.27827,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2012 12:00:00 AM,1.276535,1.27839,1.274865,1.27717,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n5/21/2012 12:00:00 AM,1.27719,1.282455,1.272545,1.28125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2012 12:00:00 AM,1.281265,1.28146,1.265195,1.2661,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2012 12:00:00 AM,1.266115,1.268745,1.25454,1.2561,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2012 12:00:00 AM,1.256145,1.261995,1.25159,1.25355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2012 12:00:00 AM,1.253525,1.260265,1.249615,1.251615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/27/2012 12:00:00 AM,1.25782,1.257925,1.25611,1.256635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/28/2012 12:00:00 AM,1.256655,1.262445,1.251685,1.252175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2012 12:00:00 AM,1.252165,1.257465,1.246115,1.247765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2012 12:00:00 AM,1.247785,1.248705,1.236125,1.237365,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2012 12:00:00 AM,1.237355,1.242845,1.233655,1.23624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/1/2012 12:00:00 AM,1.236235,1.24591,1.2288,1.24336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2012 12:00:00 AM,1.241775,1.24455,1.23961,1.239875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/4/2012 12:00:00 AM,1.23988,1.25279,1.238585,1.25266,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2012 12:00:00 AM,1.25267,1.254265,1.241,1.24615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2012 12:00:00 AM,1.24614,1.25856,1.244125,1.257605,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2012 12:00:00 AM,1.25762,1.26254,1.254015,1.256765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/8/2012 12:00:00 AM,1.25676,1.25716,1.24354,1.25168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2012 12:00:00 AM,1.263745,1.266845,1.26309,1.264445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n6/11/2012 12:00:00 AM,1.26445,1.26472,1.244955,1.24776,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2012 12:00:00 AM,1.24775,1.25294,1.244265,1.25008,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/13/2012 12:00:00 AM,1.25008,1.261045,1.247375,1.257465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2012 12:00:00 AM,1.25748,1.263715,1.254215,1.26264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2012 12:00:00 AM,1.262615,1.266495,1.25922,1.263875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/17/2012 12:00:00 AM,1.269735,1.274765,1.26963,1.27044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n6/18/2012 12:00:00 AM,1.270445,1.27277,1.255735,1.25964,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2012 12:00:00 AM,1.259635,1.273065,1.256875,1.267925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2012 12:00:00 AM,1.267945,1.27434,1.263745,1.26809,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/21/2012 12:00:00 AM,1.2681,1.269905,1.25316,1.25501,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2012 12:00:00 AM,1.255,1.258355,1.25195,1.25702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2012 12:00:00 AM,1.25472,1.25587,1.2535,1.2538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/25/2012 12:00:00 AM,1.253805,1.254465,1.24713,1.250275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2012 12:00:00 AM,1.25027,1.253065,1.244205,1.24853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/27/2012 12:00:00 AM,1.248535,1.25083,1.24456,1.24699,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/28/2012 12:00:00 AM,1.24701,1.252445,1.240735,1.244125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/29/2012 12:00:00 AM,1.244115,1.269285,1.243295,1.265945,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2012 12:00:00 AM,1.2679,1.267965,1.26506,1.265475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/2/2012 12:00:00 AM,1.26546,1.266765,1.25683,1.257985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2012 12:00:00 AM,1.25799,1.262735,1.25594,1.26048,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/4/2012 12:00:00 AM,1.26047,1.260725,1.25081,1.251575,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2012 12:00:00 AM,1.251595,1.253865,1.2364,1.239245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2012 12:00:00 AM,1.239265,1.24015,1.226025,1.228725,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2012 12:00:00 AM,1.22642,1.22808,1.225595,1.22705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/9/2012 12:00:00 AM,1.227055,1.232435,1.226935,1.23176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/10/2012 12:00:00 AM,1.231795,1.23338,1.223535,1.225525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2012 12:00:00 AM,1.225535,1.229685,1.221295,1.22449,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/12/2012 12:00:00 AM,1.224485,1.22451,1.21668,1.218845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2012 12:00:00 AM,1.21886,1.225675,1.216235,1.224785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n7/15/2012 12:00:00 AM,1.22668,1.22721,1.224505,1.224725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/16/2012 12:00:00 AM,1.224705,1.22472,1.2179,1.21819,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2012 12:00:00 AM,1.2279,1.23169,1.21891,1.22956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/18/2012 12:00:00 AM,1.229545,1.23063,1.221705,1.2277,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n7/19/2012 12:00:00 AM,1.227715,1.232425,1.222925,1.22765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/20/2012 12:00:00 AM,1.22764,1.228295,1.21444,1.215665,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2012 12:00:00 AM,1.21197,1.213155,1.21138,1.212755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/23/2012 12:00:00 AM,1.212775,1.214495,1.206725,1.212395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/24/2012 12:00:00 AM,1.212395,1.213815,1.204225,1.20618,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2012 12:00:00 AM,1.206175,1.21705,1.205365,1.21391,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2012 12:00:00 AM,1.21389,1.232935,1.21175,1.227775,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2012 12:00:00 AM,1.227785,1.238995,1.22417,1.232045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2012 12:00:00 AM,1.229845,1.23106,1.229545,1.230255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/30/2012 12:00:00 AM,1.23026,1.23057,1.222525,1.226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2012 12:00:00 AM,1.225985,1.233,1.224885,1.229235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2012 12:00:00 AM,1.22924,1.23365,1.22182,1.223915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2012 12:00:00 AM,1.22391,1.2405,1.213375,1.217865,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2012 12:00:00 AM,1.217845,1.23923,1.21669,1.238755,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2012 12:00:00 AM,1.239745,1.244345,1.23835,1.24272,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/6/2012 12:00:00 AM,1.24273,1.24292,1.23418,1.238835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2012 12:00:00 AM,1.238835,1.244185,1.237595,1.23846,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/8/2012 12:00:00 AM,1.238465,1.240225,1.23268,1.237215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/9/2012 12:00:00 AM,1.23721,1.23873,1.226695,1.229295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2012 12:00:00 AM,1.22929,1.23168,1.22415,1.22887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/12/2012 12:00:00 AM,1.229095,1.2292,1.227495,1.22752,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/13/2012 12:00:00 AM,1.227515,1.23736,1.226105,1.232635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2012 12:00:00 AM,1.23265,1.238565,1.23166,1.23239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/15/2012 12:00:00 AM,1.232385,1.23436,1.226425,1.228895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2012 12:00:00 AM,1.22888,1.237275,1.2256,1.23572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2012 12:00:00 AM,1.235725,1.23822,1.22889,1.23327,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/19/2012 12:00:00 AM,1.235285,1.235285,1.23288,1.233215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/20/2012 12:00:00 AM,1.2332,1.236895,1.229545,1.235095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2012 12:00:00 AM,1.2351,1.248755,1.23465,1.247635,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2012 12:00:00 AM,1.247655,1.254405,1.243135,1.253395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2012 12:00:00 AM,1.253375,1.25895,1.25245,1.25598,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2012 12:00:00 AM,1.25601,1.25666,1.24815,1.25124,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2012 12:00:00 AM,1.251345,1.25239,1.25042,1.250565,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/27/2012 12:00:00 AM,1.25057,1.25358,1.24901,1.250115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/28/2012 12:00:00 AM,1.2501,1.257655,1.24655,1.25707,0,0,0,0,-100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2012 12:00:00 AM,1.25704,1.257335,1.251865,1.253045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/30/2012 12:00:00 AM,1.25305,1.256375,1.24874,1.250955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/31/2012 12:00:00 AM,1.25095,1.26375,1.24937,1.257335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2012 12:00:00 AM,1.25673,1.258685,1.25673,1.25734,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,200,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/3/2012 12:00:00 AM,1.257355,1.261125,1.25603,1.25863,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/4/2012 12:00:00 AM,1.25865,1.26277,1.252605,1.25338,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2012 12:00:00 AM,1.253365,1.26245,1.250175,1.260035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2012 12:00:00 AM,1.26005,1.26517,1.25614,1.26308,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2012 12:00:00 AM,1.26311,1.28177,1.262635,1.28174,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2012 12:00:00 AM,1.28091,1.281195,1.279135,1.27956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/10/2012 12:00:00 AM,1.279565,1.280375,1.275475,1.27616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/11/2012 12:00:00 AM,1.27614,1.28714,1.275865,1.285145,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2012 12:00:00 AM,1.28515,1.29366,1.281515,1.29022,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2012 12:00:00 AM,1.290225,1.3002,1.28567,1.29929,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2012 12:00:00 AM,1.29929,1.31689,1.298475,1.313045,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2012 12:00:00 AM,1.312005,1.313285,1.310905,1.311385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/17/2012 12:00:00 AM,1.311405,1.3172,1.308345,1.3108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/18/2012 12:00:00 AM,1.310815,1.311485,1.302945,1.304635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/19/2012 12:00:00 AM,1.30464,1.308515,1.29933,1.305725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/20/2012 12:00:00 AM,1.30575,1.305905,1.291955,1.29736,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2012 12:00:00 AM,1.297355,1.304785,1.29555,1.297985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2012 12:00:00 AM,1.297795,1.29904,1.29658,1.2967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/24/2012 12:00:00 AM,1.2967,1.29797,1.289095,1.29407,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2012 12:00:00 AM,1.29404,1.297075,1.288615,1.28986,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2012 12:00:00 AM,1.289865,1.29128,1.28353,1.287805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2012 12:00:00 AM,1.2878,1.29283,1.28287,1.291225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2012 12:00:00 AM,1.291215,1.295965,1.283875,1.285675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2012 12:00:00 AM,1.28457,1.285005,1.280385,1.280725,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2012 12:00:00 AM,1.280705,1.293865,1.28052,1.28882,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2012 12:00:00 AM,1.288845,1.296795,1.288045,1.291135,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/3/2012 12:00:00 AM,1.291145,1.29372,1.287755,1.292295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/4/2012 12:00:00 AM,1.2923,1.303165,1.291025,1.30127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2012 12:00:00 AM,1.30128,1.307155,1.29941,1.303275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2012 12:00:00 AM,1.302525,1.302685,1.301185,1.30152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/8/2012 12:00:00 AM,1.301535,1.3016,1.29376,1.29752,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2012 12:00:00 AM,1.29751,1.299095,1.284995,1.285915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2012 12:00:00 AM,1.28592,1.291325,1.283535,1.285905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/11/2012 12:00:00 AM,1.285905,1.29517,1.28255,1.29318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2012 12:00:00 AM,1.29317,1.299185,1.292245,1.295435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2012 12:00:00 AM,1.295435,1.29615,1.29309,1.293435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/15/2012 12:00:00 AM,1.29342,1.297875,1.28908,1.296745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2012 12:00:00 AM,1.296725,1.31243,1.29535,1.31058,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2012 12:00:00 AM,1.31057,1.313955,1.30855,1.31123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/18/2012 12:00:00 AM,1.311225,1.312865,1.305585,1.30685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/19/2012 12:00:00 AM,1.30684,1.307705,1.301325,1.30224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/21/2012 12:00:00 AM,1.302145,1.30294,1.301555,1.302165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n10/22/2012 12:00:00 AM,1.30217,1.30834,1.30202,1.307055,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2012 12:00:00 AM,1.30704,1.30705,1.2952,1.29737,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2012 12:00:00 AM,1.297375,1.299675,1.292035,1.296465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/25/2012 12:00:00 AM,1.29647,1.302305,1.292705,1.29388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2012 12:00:00 AM,1.29387,1.29563,1.28827,1.294105,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/28/2012 12:00:00 AM,1.294165,1.294615,1.29189,1.292205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/29/2012 12:00:00 AM,1.292195,1.293615,1.288525,1.29069,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2012 12:00:00 AM,1.29068,1.29835,1.28861,1.296125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2012 12:00:00 AM,1.296135,1.30204,1.29466,1.296445,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/1/2012 12:00:00 AM,1.29644,1.29826,1.292475,1.294665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100\n11/2/2012 12:00:00 AM,1.29464,1.29466,1.282135,1.28384,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2012 12:00:00 AM,1.281795,1.283475,1.281635,1.282275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/5/2012 12:00:00 AM,1.282275,1.28425,1.276745,1.279975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2012 12:00:00 AM,1.279965,1.282655,1.27635,1.280575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/7/2012 12:00:00 AM,1.280565,1.287635,1.27364,1.27562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2012 12:00:00 AM,1.275635,1.27764,1.27171,1.274145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/9/2012 12:00:00 AM,1.274125,1.279005,1.268995,1.27151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2012 12:00:00 AM,1.271245,1.273655,1.27093,1.272055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/12/2012 12:00:00 AM,1.272045,1.273915,1.269765,1.27059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/13/2012 12:00:00 AM,1.270595,1.27284,1.26611,1.27096,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/14/2012 12:00:00 AM,1.270955,1.27789,1.27035,1.27297,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2012 12:00:00 AM,1.27295,1.28021,1.271755,1.27813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2012 12:00:00 AM,1.27812,1.27843,1.26904,1.274275,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2012 12:00:00 AM,1.274885,1.276085,1.274005,1.275855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/19/2012 12:00:00 AM,1.27587,1.28204,1.274585,1.276685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/20/2012 12:00:00 AM,1.276675,1.282965,1.27649,1.28125,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2012 12:00:00 AM,1.281245,1.2868,1.27364,1.28641,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2012 12:00:00 AM,1.286395,1.289885,1.28341,1.287435,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0\n11/23/2012 12:00:00 AM,1.287425,1.299075,1.28684,1.297745,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2012 12:00:00 AM,1.296675,1.29776,1.296365,1.29728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/26/2012 12:00:00 AM,1.297275,1.300735,1.294425,1.298845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/27/2012 12:00:00 AM,1.29886,1.300865,1.291545,1.293755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2012 12:00:00 AM,1.293775,1.296125,1.288005,1.295055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2012 12:00:00 AM,1.29506,1.30142,1.293905,1.29719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2012 12:00:00 AM,1.297185,1.302765,1.296815,1.298615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2012 12:00:00 AM,1.298405,1.29982,1.298385,1.29957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/3/2012 12:00:00 AM,1.299565,1.30758,1.299345,1.30636,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2012 12:00:00 AM,1.30636,1.31084,1.304605,1.309915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2012 12:00:00 AM,1.30989,1.312655,1.306025,1.30724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2012 12:00:00 AM,1.30725,1.308655,1.295045,1.29615,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2012 12:00:00 AM,1.29615,1.29726,1.28763,1.292755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2012 12:00:00 AM,1.288935,1.290755,1.28876,1.290635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/10/2012 12:00:00 AM,1.29065,1.294655,1.288595,1.293705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2012 12:00:00 AM,1.293695,1.301485,1.29288,1.30116,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2012 12:00:00 AM,1.301145,1.30974,1.29957,1.306535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2012 12:00:00 AM,1.30655,1.31004,1.30409,1.307685,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/14/2012 12:00:00 AM,1.307695,1.31732,1.306635,1.316175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2012 12:00:00 AM,1.317195,1.31883,1.316315,1.316585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/17/2012 12:00:00 AM,1.3166,1.31789,1.31442,1.316115,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/18/2012 12:00:00 AM,1.316095,1.323845,1.31564,1.322855,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2012 12:00:00 AM,1.322835,1.330825,1.318865,1.321295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/20/2012 12:00:00 AM,1.32131,1.329515,1.320345,1.323715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2012 12:00:00 AM,1.32373,1.323805,1.31587,1.318555,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2012 12:00:00 AM,1.31766,1.318535,1.317325,1.318015,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/24/2012 12:00:00 AM,1.318005,1.323375,1.31714,1.317655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/26/2012 12:00:00 AM,1.31836,1.32542,1.317345,1.322785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/27/2012 12:00:00 AM,1.32281,1.32836,1.32014,1.324815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/28/2012 12:00:00 AM,1.32483,1.32567,1.31659,1.32185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2012 12:00:00 AM,1.321575,1.323245,1.32129,1.322635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/31/2012 12:00:00 AM,1.32262,1.323495,1.31722,1.3185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2013 12:00:00 AM,1.326575,1.32937,1.315665,1.31835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2013 12:00:00 AM,1.318355,1.318905,1.302255,1.30245,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2013 12:00:00 AM,1.30248,1.30897,1.299755,1.306875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2013 12:00:00 AM,1.30758,1.307945,1.30654,1.306785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/7/2013 12:00:00 AM,1.306805,1.312825,1.301685,1.31237,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2013 12:00:00 AM,1.31236,1.313985,1.305635,1.308285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2013 12:00:00 AM,1.30827,1.3096,1.303685,1.305345,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/10/2013 12:00:00 AM,1.30534,1.32797,1.303895,1.32727,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2013 12:00:00 AM,1.327265,1.336515,1.32484,1.334315,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2013 12:00:00 AM,1.33626,1.336945,1.33482,1.33582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,100,0,0,0,0,0,0\n1/14/2013 12:00:00 AM,1.33582,1.340395,1.333625,1.33771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/15/2013 12:00:00 AM,1.33773,1.33937,1.326335,1.330945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2013 12:00:00 AM,1.330955,1.332475,1.325625,1.32849,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2013 12:00:00 AM,1.328485,1.338725,1.32699,1.33741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2013 12:00:00 AM,1.337405,1.33983,1.328055,1.33156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2013 12:00:00 AM,1.330655,1.332385,1.330655,1.3318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/21/2013 12:00:00 AM,1.33178,1.333225,1.330005,1.330965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/22/2013 12:00:00 AM,1.330975,1.337165,1.326685,1.331275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/23/2013 12:00:00 AM,1.331275,1.33547,1.32644,1.330685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/24/2013 12:00:00 AM,1.330665,1.339265,1.32861,1.33679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2013 12:00:00 AM,1.336785,1.347925,1.334975,1.34565,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2013 12:00:00 AM,1.346585,1.347115,1.345325,1.346475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n1/28/2013 12:00:00 AM,1.346485,1.34772,1.34247,1.344715,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/29/2013 12:00:00 AM,1.34473,1.34972,1.34144,1.348775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2013 12:00:00 AM,1.34876,1.358755,1.34821,1.356835,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2013 12:00:00 AM,1.356825,1.361805,1.354125,1.361195,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2013 12:00:00 AM,1.36118,1.37109,1.35863,1.36408,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n2/3/2013 12:00:00 AM,1.36437,1.366005,1.363155,1.36452,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/4/2013 12:00:00 AM,1.364515,1.36491,1.34987,1.351065,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2013 12:00:00 AM,1.351055,1.359745,1.345845,1.35826,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2013 12:00:00 AM,1.358255,1.359595,1.34935,1.35218,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2013 12:00:00 AM,1.352185,1.35775,1.337065,1.338285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2013 12:00:00 AM,1.33829,1.34293,1.335335,1.33632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2013 12:00:00 AM,1.336125,1.33807,1.33535,1.33665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/11/2013 12:00:00 AM,1.33662,1.34275,1.335715,1.340185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2013 12:00:00 AM,1.34018,1.34756,1.336395,1.34526,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2013 12:00:00 AM,1.3452,1.351995,1.34263,1.344465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/14/2013 12:00:00 AM,1.34447,1.34557,1.33153,1.334995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2013 12:00:00 AM,1.335005,1.339335,1.330645,1.336505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/17/2013 12:00:00 AM,1.33496,1.335935,1.333735,1.33393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/18/2013 12:00:00 AM,1.33392,1.337945,1.332155,1.33487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/19/2013 12:00:00 AM,1.334875,1.33962,1.332895,1.339505,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2013 12:00:00 AM,1.33949,1.34341,1.327085,1.327305,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2013 12:00:00 AM,1.32733,1.328935,1.316095,1.31921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2013 12:00:00 AM,1.319215,1.324575,1.314505,1.31883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/24/2013 12:00:00 AM,1.321595,1.323395,1.31857,1.31913,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/25/2013 12:00:00 AM,1.319145,1.331895,1.304785,1.30662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2013 12:00:00 AM,1.30661,1.3123,1.30183,1.306745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/27/2013 12:00:00 AM,1.30677,1.31618,1.304145,1.315505,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2013 12:00:00 AM,1.31552,1.31582,1.305315,1.306015,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2013 12:00:00 AM,1.306015,1.310105,1.296655,1.302075,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/3/2013 12:00:00 AM,1.301345,1.30312,1.30042,1.301585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/4/2013 12:00:00 AM,1.301565,1.30408,1.298235,1.303495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2013 12:00:00 AM,1.30349,1.30753,1.301025,1.30473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/6/2013 12:00:00 AM,1.304745,1.30705,1.29653,1.297805,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2013 12:00:00 AM,1.297815,1.311835,1.297495,1.310795,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2013 12:00:00 AM,1.310815,1.31344,1.29554,1.30014,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2013 12:00:00 AM,1.299505,1.300385,1.29794,1.298735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/11/2013 12:00:00 AM,1.298715,1.305375,1.298385,1.30324,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2013 12:00:00 AM,1.303235,1.307465,1.29911,1.303045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/13/2013 12:00:00 AM,1.303045,1.30648,1.292335,1.29593,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2013 12:00:00 AM,1.295925,1.30326,1.291145,1.301215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2013 12:00:00 AM,1.30122,1.310715,1.300265,1.307525,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2013 12:00:00 AM,1.293975,1.29448,1.28883,1.289115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/18/2013 12:00:00 AM,1.28909,1.299585,1.288205,1.294365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2013 12:00:00 AM,1.29438,1.29697,1.28437,1.28642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2013 12:00:00 AM,1.28642,1.297855,1.286355,1.29392,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2013 12:00:00 AM,1.293945,1.295515,1.287975,1.290315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2013 12:00:00 AM,1.29032,1.300995,1.28882,1.29899,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2013 12:00:00 AM,1.29573,1.304865,1.294365,1.301895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2013 12:00:00 AM,1.301905,1.30481,1.282975,1.28572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2013 12:00:00 AM,1.285705,1.28899,1.282815,1.286055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/27/2013 12:00:00 AM,1.286065,1.2867,1.275075,1.27746,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2013 12:00:00 AM,1.277465,1.284445,1.27553,1.28137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2013 12:00:00 AM,1.281385,1.283725,1.27931,1.28173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/31/2013 12:00:00 AM,1.28061,1.281365,1.280015,1.280535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n4/1/2013 12:00:00 AM,1.280535,1.286815,1.277135,1.284865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2013 12:00:00 AM,1.28485,1.287755,1.280915,1.28191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2013 12:00:00 AM,1.281915,1.28644,1.27899,1.284915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2013 12:00:00 AM,1.28491,1.29489,1.27451,1.292575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2013 12:00:00 AM,1.292575,1.303975,1.290065,1.29974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2013 12:00:00 AM,1.297275,1.30062,1.296435,1.299095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/8/2013 12:00:00 AM,1.2991,1.303795,1.296845,1.302925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/9/2013 12:00:00 AM,1.302935,1.310305,1.300515,1.308075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2013 12:00:00 AM,1.308055,1.312195,1.305115,1.305205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2013 12:00:00 AM,1.305215,1.31383,1.304385,1.31162,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2013 12:00:00 AM,1.311605,1.31269,1.303675,1.31086,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/14/2013 12:00:00 AM,1.313695,1.313695,1.309595,1.30968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/15/2013 12:00:00 AM,1.30777,1.31075,1.30218,1.30532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/16/2013 12:00:00 AM,1.3053,1.320165,1.302815,1.31779,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2013 12:00:00 AM,1.317795,1.319965,1.300125,1.30336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2013 12:00:00 AM,1.303385,1.30962,1.3021,1.305255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2013 12:00:00 AM,1.30526,1.31289,1.30471,1.305275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0\n4/21/2013 12:00:00 AM,1.308295,1.308645,1.30535,1.305745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/22/2013 12:00:00 AM,1.30575,1.308405,1.301515,1.305945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/23/2013 12:00:00 AM,1.30594,1.30841,1.297295,1.29942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2013 12:00:00 AM,1.29941,1.30342,1.295445,1.30157,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2013 12:00:00 AM,1.301595,1.30934,1.29892,1.3004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/26/2013 12:00:00 AM,1.300405,1.30477,1.29907,1.302775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/28/2013 12:00:00 AM,1.30276,1.306765,1.30276,1.304085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/29/2013 12:00:00 AM,1.304095,1.31164,1.303185,1.30945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2013 12:00:00 AM,1.309425,1.31859,1.305425,1.31679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2013 12:00:00 AM,1.31679,1.32427,1.316065,1.317935,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2013 12:00:00 AM,1.317975,1.32187,1.303735,1.30661,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2013 12:00:00 AM,1.306585,1.31596,1.30333,1.311545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2013 12:00:00 AM,1.31174,1.312635,1.311055,1.312095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n5/6/2013 12:00:00 AM,1.31209,1.31412,1.305365,1.307265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n5/7/2013 12:00:00 AM,1.30727,1.3132,1.30679,1.307515,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/8/2013 12:00:00 AM,1.30752,1.31943,1.307175,1.316025,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2013 12:00:00 AM,1.31602,1.317705,1.301015,1.303195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2013 12:00:00 AM,1.303185,1.305105,1.293535,1.299225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2013 12:00:00 AM,1.295645,1.297885,1.295445,1.29672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/13/2013 12:00:00 AM,1.296705,1.29998,1.294145,1.298705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2013 12:00:00 AM,1.298685,1.302915,1.29123,1.293645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2013 12:00:00 AM,1.29364,1.294275,1.284335,1.28825,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2013 12:00:00 AM,1.288255,1.29298,1.284645,1.288295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/17/2013 12:00:00 AM,1.288305,1.288905,1.27965,1.28356,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2013 12:00:00 AM,1.281795,1.28485,1.281795,1.2831,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/20/2013 12:00:00 AM,1.283085,1.2904,1.281945,1.289055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2013 12:00:00 AM,1.28903,1.29335,1.28411,1.29199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2013 12:00:00 AM,1.291985,1.299815,1.28336,1.28422,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2013 12:00:00 AM,1.28423,1.29569,1.282155,1.2923,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2013 12:00:00 AM,1.29229,1.29934,1.290435,1.2936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/26/2013 12:00:00 AM,1.293295,1.294425,1.292625,1.293595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n5/27/2013 12:00:00 AM,1.29359,1.294865,1.29154,1.29341,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/28/2013 12:00:00 AM,1.293395,1.294975,1.284155,1.284465,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2013 12:00:00 AM,1.28447,1.29776,1.283785,1.29466,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2013 12:00:00 AM,1.294665,1.306145,1.29335,1.30422,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2013 12:00:00 AM,1.304205,1.30487,1.294425,1.299675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2013 12:00:00 AM,1.299275,1.30004,1.2983,1.299445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n6/3/2013 12:00:00 AM,1.299465,1.310775,1.29555,1.307055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2013 12:00:00 AM,1.30704,1.31015,1.304225,1.30719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/5/2013 12:00:00 AM,1.30716,1.31163,1.305305,1.308675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/6/2013 12:00:00 AM,1.30866,1.33062,1.307505,1.32423,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2013 12:00:00 AM,1.32423,1.328515,1.31915,1.32142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2013 12:00:00 AM,1.319215,1.321515,1.31881,1.320245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/10/2013 12:00:00 AM,1.320255,1.326925,1.31776,1.325285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2013 12:00:00 AM,1.325255,1.33175,1.3232,1.33124,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2013 12:00:00 AM,1.331255,1.335915,1.32655,1.334415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2013 12:00:00 AM,1.33442,1.339035,1.327865,1.335865,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/14/2013 12:00:00 AM,1.335875,1.337335,1.32948,1.334375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2013 12:00:00 AM,1.3347,1.335745,1.33375,1.33544,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/17/2013 12:00:00 AM,1.335435,1.338155,1.331855,1.336215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/18/2013 12:00:00 AM,1.3362,1.34158,1.3326,1.3393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2013 12:00:00 AM,1.339295,1.34174,1.326225,1.32817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2013 12:00:00 AM,1.328195,1.330045,1.316145,1.32278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2013 12:00:00 AM,1.32277,1.325415,1.30987,1.31212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2013 12:00:00 AM,1.30875,1.311445,1.30854,1.31065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/24/2013 12:00:00 AM,1.310665,1.314395,1.305905,1.3135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2013 12:00:00 AM,1.31351,1.31507,1.3065,1.30753,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2013 12:00:00 AM,1.307535,1.30873,1.29848,1.30163,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2013 12:00:00 AM,1.301645,1.305715,1.300015,1.30362,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/28/2013 12:00:00 AM,1.303615,1.31033,1.29913,1.301105,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2013 12:00:00 AM,1.301,1.302665,1.300505,1.3008,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/1/2013 12:00:00 AM,1.300795,1.307125,1.300735,1.306795,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2013 12:00:00 AM,1.30677,1.307815,1.29635,1.29749,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2013 12:00:00 AM,1.29749,1.303255,1.292315,1.30209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/4/2013 12:00:00 AM,1.302085,1.302085,1.28831,1.289235,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2013 12:00:00 AM,1.28923,1.290565,1.280615,1.283145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2013 12:00:00 AM,1.282775,1.28345,1.281065,1.281275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/8/2013 12:00:00 AM,1.28129,1.288185,1.28117,1.286085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n7/9/2013 12:00:00 AM,1.286095,1.289805,1.275535,1.277645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2013 12:00:00 AM,1.27768,1.320625,1.276485,1.31165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2013 12:00:00 AM,1.311665,1.31471,1.300575,1.308685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/12/2013 12:00:00 AM,1.308695,1.310005,1.299915,1.306725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2013 12:00:00 AM,1.30725,1.30845,1.305655,1.306095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/15/2013 12:00:00 AM,1.306115,1.307915,1.29934,1.3058,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/16/2013 12:00:00 AM,1.305805,1.31745,1.30501,1.314795,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2013 12:00:00 AM,1.314805,1.317845,1.30832,1.311645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2013 12:00:00 AM,1.31165,1.31256,1.306615,1.310855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n7/19/2013 12:00:00 AM,1.310865,1.31546,1.308935,1.3137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/21/2013 12:00:00 AM,1.3146,1.316045,1.313345,1.31583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/22/2013 12:00:00 AM,1.315785,1.32182,1.31442,1.31909,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/23/2013 12:00:00 AM,1.319095,1.32388,1.31635,1.32212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2013 12:00:00 AM,1.322115,1.325615,1.31766,1.319045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n7/25/2013 12:00:00 AM,1.319065,1.329595,1.316575,1.32736,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2013 12:00:00 AM,1.32737,1.329685,1.32527,1.32786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/28/2013 12:00:00 AM,1.328045,1.32938,1.327535,1.32858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n7/29/2013 12:00:00 AM,1.328565,1.32951,1.324125,1.32445,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2013 12:00:00 AM,1.32631,1.330205,1.32344,1.32658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/31/2013 12:00:00 AM,1.32656,1.334485,1.320955,1.33006,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2013 12:00:00 AM,1.33007,1.33108,1.319265,1.32116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2013 12:00:00 AM,1.321165,1.32942,1.31888,1.32818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2013 12:00:00 AM,1.327495,1.32886,1.32732,1.32772,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/5/2013 12:00:00 AM,1.327735,1.330045,1.323275,1.325765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/6/2013 12:00:00 AM,1.325755,1.33231,1.32462,1.33073,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2013 12:00:00 AM,1.330705,1.33456,1.326575,1.333995,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2013 12:00:00 AM,1.33398,1.34005,1.33281,1.33792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2013 12:00:00 AM,1.337915,1.33904,1.333275,1.33417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/11/2013 12:00:00 AM,1.33395,1.334405,1.33145,1.333845,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n8/12/2013 12:00:00 AM,1.33384,1.334035,1.32773,1.329165,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2013 12:00:00 AM,1.32916,1.331725,1.32336,1.3265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2013 12:00:00 AM,1.326525,1.32809,1.32391,1.32647,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/15/2013 12:00:00 AM,1.326465,1.33632,1.32054,1.33506,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2013 12:00:00 AM,1.335045,1.33802,1.331105,1.332785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2013 12:00:00 AM,1.332795,1.33429,1.332135,1.332915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/19/2013 12:00:00 AM,1.332895,1.337475,1.331535,1.33339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/20/2013 12:00:00 AM,1.333395,1.3452,1.332335,1.34206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2013 12:00:00 AM,1.34207,1.34271,1.33353,1.33412,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2013 12:00:00 AM,1.33412,1.33732,1.329825,1.33555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/23/2013 12:00:00 AM,1.335545,1.340975,1.333335,1.33773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/25/2013 12:00:00 AM,1.337945,1.339345,1.33774,1.338685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/26/2013 12:00:00 AM,1.33867,1.33941,1.335665,1.33782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n8/27/2013 12:00:00 AM,1.337825,1.339875,1.33223,1.33908,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2013 12:00:00 AM,1.339075,1.33978,1.33051,1.333475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2013 12:00:00 AM,1.33346,1.334015,1.32193,1.323685,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2013 12:00:00 AM,1.322795,1.323695,1.319685,1.32068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/2/2013 12:00:00 AM,1.320685,1.32274,1.31838,1.318925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2013 12:00:00 AM,1.31893,1.319695,1.313855,1.317175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2013 12:00:00 AM,1.31717,1.32179,1.3157,1.319945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2013 12:00:00 AM,1.31994,1.32232,1.31105,1.311935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2013 12:00:00 AM,1.31189,1.318965,1.31049,1.317845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2013 12:00:00 AM,1.317625,1.317905,1.315955,1.31721,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n9/9/2013 12:00:00 AM,1.317205,1.32807,1.31668,1.325565,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2013 12:00:00 AM,1.32558,1.327585,1.323025,1.32674,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2013 12:00:00 AM,1.326755,1.332465,1.32438,1.33135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2013 12:00:00 AM,1.331355,1.33246,1.325625,1.329835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2013 12:00:00 AM,1.32986,1.332165,1.32537,1.329975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/15/2013 12:00:00 AM,1.330895,1.338195,1.329565,1.33586,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2013 12:00:00 AM,1.335845,1.33856,1.333015,1.33354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2013 12:00:00 AM,1.33355,1.33695,1.332525,1.33565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/18/2013 12:00:00 AM,1.335655,1.354215,1.33382,1.352365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2013 12:00:00 AM,1.35236,1.35686,1.35094,1.353345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/20/2013 12:00:00 AM,1.35335,1.354875,1.349785,1.35267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/22/2013 12:00:00 AM,1.3542,1.355425,1.352615,1.353335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/23/2013 12:00:00 AM,1.353355,1.354475,1.347955,1.34967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2013 12:00:00 AM,1.349665,1.351895,1.34645,1.347325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2013 12:00:00 AM,1.34731,1.353735,1.34618,1.351725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2013 12:00:00 AM,1.35171,1.352625,1.34722,1.34874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/27/2013 12:00:00 AM,1.348735,1.356455,1.34743,1.352215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2013 12:00:00 AM,1.348845,1.350415,1.346845,1.349445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/30/2013 12:00:00 AM,1.349425,1.355615,1.347765,1.352355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2013 12:00:00 AM,1.352375,1.35879,1.351655,1.35229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/2/2013 12:00:00 AM,1.352265,1.36074,1.350475,1.35898,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2013 12:00:00 AM,1.358995,1.36463,1.35805,1.362285,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2013 12:00:00 AM,1.3623,1.363185,1.35383,1.355355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2013 12:00:00 AM,1.35602,1.35717,1.355195,1.356845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/7/2013 12:00:00 AM,1.35684,1.359115,1.35426,1.358085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2013 12:00:00 AM,1.358075,1.360725,1.35576,1.359885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2013 12:00:00 AM,1.3599,1.36007,1.348585,1.351845,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2013 12:00:00 AM,1.35182,1.3547,1.34876,1.35264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/11/2013 12:00:00 AM,1.352635,1.35817,1.351955,1.35403,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2013 12:00:00 AM,1.355535,1.356805,1.355125,1.355535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n10/14/2013 12:00:00 AM,1.35552,1.35978,1.35455,1.355645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/15/2013 12:00:00 AM,1.35564,1.357105,1.34795,1.35209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2013 12:00:00 AM,1.35208,1.35676,1.347285,1.35218,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/17/2013 12:00:00 AM,1.352155,1.36819,1.35158,1.366835,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2013 12:00:00 AM,1.36683,1.3704,1.365945,1.36853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/20/2013 12:00:00 AM,1.368645,1.369035,1.36809,1.368135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/21/2013 12:00:00 AM,1.36811,1.368865,1.36512,1.367215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2013 12:00:00 AM,1.367225,1.379225,1.366215,1.37782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2013 12:00:00 AM,1.37781,1.37929,1.37415,1.377865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/24/2013 12:00:00 AM,1.37787,1.382525,1.37645,1.380175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2013 12:00:00 AM,1.38018,1.38324,1.377445,1.380335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/27/2013 12:00:00 AM,1.38083,1.38117,1.379825,1.380475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/28/2013 12:00:00 AM,1.38046,1.38177,1.37751,1.378815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/29/2013 12:00:00 AM,1.378785,1.381325,1.37364,1.37426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2013 12:00:00 AM,1.374265,1.378545,1.369575,1.37235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/31/2013 12:00:00 AM,1.372315,1.37387,1.35753,1.35789,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2013 12:00:00 AM,1.35788,1.358165,1.348005,1.34904,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2013 12:00:00 AM,1.348645,1.349655,1.348395,1.34921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/4/2013 12:00:00 AM,1.349205,1.35243,1.34419,1.351535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2013 12:00:00 AM,1.351515,1.352235,1.344915,1.34721,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2013 12:00:00 AM,1.34723,1.35477,1.346765,1.35175,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2013 12:00:00 AM,1.35174,1.35291,1.32949,1.34087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2013 12:00:00 AM,1.340865,1.343795,1.331785,1.336775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2013 12:00:00 AM,1.33528,1.33626,1.33448,1.334645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/11/2013 12:00:00 AM,1.334665,1.341605,1.334665,1.34075,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n11/12/2013 12:00:00 AM,1.34075,1.34563,1.335935,1.343765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2013 12:00:00 AM,1.34378,1.34976,1.33902,1.348445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2013 12:00:00 AM,1.348435,1.34942,1.341845,1.34459,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2013 12:00:00 AM,1.344585,1.350545,1.343215,1.349595,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2013 12:00:00 AM,1.34941,1.34987,1.34803,1.34823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/18/2013 12:00:00 AM,1.34822,1.354175,1.347455,1.35017,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2013 12:00:00 AM,1.35017,1.35799,1.34878,1.356415,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2013 12:00:00 AM,1.35641,1.356425,1.34154,1.34303,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2013 12:00:00 AM,1.34305,1.348665,1.339955,1.34711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2013 12:00:00 AM,1.347095,1.355685,1.346235,1.35563,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2013 12:00:00 AM,1.35473,1.356005,1.354595,1.355135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/25/2013 12:00:00 AM,1.35514,1.355635,1.34901,1.353345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2013 12:00:00 AM,1.353355,1.35749,1.35212,1.356705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/27/2013 12:00:00 AM,1.356715,1.36129,1.355775,1.35731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/28/2013 12:00:00 AM,1.35732,1.36187,1.356375,1.360295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2013 12:00:00 AM,1.360275,1.36216,1.358015,1.359305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/1/2013 12:00:00 AM,1.358795,1.359245,1.358075,1.35851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/2/2013 12:00:00 AM,1.358495,1.36159,1.352595,1.354215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2013 12:00:00 AM,1.354225,1.36137,1.35244,1.35917,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2013 12:00:00 AM,1.35918,1.360535,1.35283,1.358545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/5/2013 12:00:00 AM,1.35855,1.36772,1.35432,1.366875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2013 12:00:00 AM,1.36688,1.37064,1.362,1.370375,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2013 12:00:00 AM,1.370485,1.372175,1.37003,1.370665,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,-100,0,0,0,0,0,0,0,0\n12/9/2013 12:00:00 AM,1.370645,1.37461,1.36942,1.373705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2013 12:00:00 AM,1.3737,1.379495,1.373435,1.376415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2013 12:00:00 AM,1.37643,1.381075,1.37403,1.378515,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/12/2013 12:00:00 AM,1.37851,1.38032,1.37375,1.37497,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n12/13/2013 12:00:00 AM,1.374975,1.37692,1.37091,1.37434,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/15/2013 12:00:00 AM,1.373195,1.374185,1.372695,1.373805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/16/2013 12:00:00 AM,1.373815,1.37988,1.373645,1.37607,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/17/2013 12:00:00 AM,1.376065,1.378235,1.372305,1.37693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/18/2013 12:00:00 AM,1.376925,1.38118,1.36681,1.36825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2013 12:00:00 AM,1.368245,1.36939,1.364945,1.36557,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2013 12:00:00 AM,1.365565,1.37094,1.3625,1.367165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/22/2013 12:00:00 AM,1.367495,1.367785,1.366785,1.367755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n12/23/2013 12:00:00 AM,1.36775,1.37169,1.367275,1.36973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2013 12:00:00 AM,1.369725,1.3698,1.36551,1.36754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/26/2013 12:00:00 AM,1.36763,1.370225,1.3675,1.36946,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2013 12:00:00 AM,1.36947,1.389365,1.369245,1.37478,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2013 12:00:00 AM,1.375095,1.377,1.374635,1.375125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n12/30/2013 12:00:00 AM,1.37512,1.381905,1.37283,1.380845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2013 12:00:00 AM,1.380835,1.381265,1.37599,1.377845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/2/2014 12:00:00 AM,1.374445,1.37586,1.36296,1.366525,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2014 12:00:00 AM,1.366535,1.36719,1.35824,1.35908,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2014 12:00:00 AM,1.358995,1.36006,1.358855,1.35957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/6/2014 12:00:00 AM,1.359555,1.36532,1.357145,1.362975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2014 12:00:00 AM,1.362965,1.365635,1.359655,1.36172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/8/2014 12:00:00 AM,1.361715,1.36351,1.35535,1.357145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2014 12:00:00 AM,1.35715,1.363325,1.354805,1.360625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2014 12:00:00 AM,1.36063,1.36874,1.35709,1.366835,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2014 12:00:00 AM,1.36757,1.36799,1.366465,1.36722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,100,0,0,0,0,0,0\n1/13/2014 12:00:00 AM,1.36721,1.368475,1.36374,1.36688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/14/2014 12:00:00 AM,1.366865,1.369945,1.36491,1.36672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/15/2014 12:00:00 AM,1.36671,1.367325,1.358135,1.359955,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2014 12:00:00 AM,1.35996,1.36497,1.35832,1.36155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/17/2014 12:00:00 AM,1.361555,1.362115,1.3517,1.35386,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2014 12:00:00 AM,1.353795,1.35447,1.3525,1.352725,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/20/2014 12:00:00 AM,1.35273,1.35679,1.35076,1.35458,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100\n1/21/2014 12:00:00 AM,1.354585,1.35691,1.351635,1.355745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/22/2014 12:00:00 AM,1.35574,1.35839,1.353465,1.35442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n1/23/2014 12:00:00 AM,1.354415,1.36983,1.35302,1.36881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2014 12:00:00 AM,1.368815,1.37395,1.36627,1.36758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/26/2014 12:00:00 AM,1.367495,1.36907,1.366995,1.36868,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/27/2014 12:00:00 AM,1.368685,1.37166,1.365325,1.36743,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/28/2014 12:00:00 AM,1.36742,1.36884,1.362895,1.36541,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2014 12:00:00 AM,1.365405,1.36847,1.360305,1.365735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/30/2014 12:00:00 AM,1.365725,1.366285,1.354335,1.355755,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2014 12:00:00 AM,1.35576,1.35735,1.34792,1.349085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2014 12:00:00 AM,1.348395,1.34913,1.34795,1.348735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/3/2014 12:00:00 AM,1.34874,1.35356,1.347715,1.35226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/4/2014 12:00:00 AM,1.352255,1.353895,1.34934,1.351595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/5/2014 12:00:00 AM,1.35158,1.355565,1.34988,1.353385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2014 12:00:00 AM,1.353395,1.361895,1.34822,1.35917,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2014 12:00:00 AM,1.35916,1.364445,1.35521,1.36347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2014 12:00:00 AM,1.362975,1.363005,1.360915,1.36187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/10/2014 12:00:00 AM,1.361875,1.365155,1.36185,1.364535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/11/2014 12:00:00 AM,1.36454,1.36832,1.36294,1.363665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2014 12:00:00 AM,1.36366,1.365265,1.35622,1.35878,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2014 12:00:00 AM,1.358775,1.36921,1.35856,1.36762,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2014 12:00:00 AM,1.36764,1.371485,1.36737,1.36931,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/16/2014 12:00:00 AM,1.370075,1.37154,1.369515,1.370405,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n2/17/2014 12:00:00 AM,1.3704,1.37243,1.36921,1.3704,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/18/2014 12:00:00 AM,1.370395,1.377055,1.369465,1.376045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2014 12:00:00 AM,1.37604,1.377315,1.37244,1.372945,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2014 12:00:00 AM,1.37294,1.37626,1.36855,1.372075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/21/2014 12:00:00 AM,1.37208,1.375865,1.3702,1.37381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100\n2/23/2014 12:00:00 AM,1.372895,1.37414,1.37284,1.373745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/24/2014 12:00:00 AM,1.37375,1.377175,1.37084,1.37346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/25/2014 12:00:00 AM,1.373465,1.37671,1.371545,1.374585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/26/2014 12:00:00 AM,1.374575,1.375725,1.366165,1.36811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2014 12:00:00 AM,1.368105,1.372665,1.36432,1.370645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2014 12:00:00 AM,1.37064,1.382475,1.36941,1.379995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2014 12:00:00 AM,1.376455,1.37876,1.375415,1.377425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/3/2014 12:00:00 AM,1.37744,1.379275,1.37263,1.37355,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2014 12:00:00 AM,1.373545,1.378155,1.372085,1.374195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/5/2014 12:00:00 AM,1.374175,1.374955,1.370745,1.373155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2014 12:00:00 AM,1.37315,1.38732,1.372125,1.38634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2014 12:00:00 AM,1.386345,1.39151,1.38521,1.388005,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2014 12:00:00 AM,1.387545,1.38797,1.386725,1.387755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n3/10/2014 12:00:00 AM,1.387745,1.389775,1.38616,1.387595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/11/2014 12:00:00 AM,1.387605,1.387665,1.38338,1.38564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2014 12:00:00 AM,1.385645,1.39144,1.384345,1.390235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2014 12:00:00 AM,1.39024,1.39668,1.38457,1.38651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2014 12:00:00 AM,1.386515,1.393765,1.384765,1.391165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2014 12:00:00 AM,1.389775,1.391715,1.389055,1.390915,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/17/2014 12:00:00 AM,1.39091,1.39478,1.3879,1.392525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/18/2014 12:00:00 AM,1.392515,1.394325,1.387985,1.39291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/19/2014 12:00:00 AM,1.392925,1.393265,1.38097,1.38181,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2014 12:00:00 AM,1.381815,1.3845,1.374925,1.37787,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2014 12:00:00 AM,1.377875,1.381075,1.37657,1.379465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/23/2014 12:00:00 AM,1.379645,1.380645,1.378815,1.379685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/24/2014 12:00:00 AM,1.37968,1.3876,1.37603,1.383635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2014 12:00:00 AM,1.38365,1.384715,1.374915,1.382005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2014 12:00:00 AM,1.382,1.382335,1.377655,1.378565,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2014 12:00:00 AM,1.37856,1.3797,1.372855,1.37407,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2014 12:00:00 AM,1.374075,1.37731,1.37048,1.375265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/30/2014 12:00:00 AM,1.375815,1.376845,1.37451,1.375315,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/31/2014 12:00:00 AM,1.375305,1.38091,1.3722,1.377395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/1/2014 12:00:00 AM,1.3774,1.38155,1.37692,1.37935,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/2/2014 12:00:00 AM,1.379355,1.382025,1.375325,1.37667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2014 12:00:00 AM,1.376665,1.38071,1.36982,1.37228,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2014 12:00:00 AM,1.372275,1.37314,1.367275,1.37027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2014 12:00:00 AM,1.369695,1.370415,1.3695,1.37037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/7/2014 12:00:00 AM,1.370375,1.374865,1.36972,1.374205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2014 12:00:00 AM,1.37421,1.381165,1.373735,1.379295,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2014 12:00:00 AM,1.3793,1.38621,1.377995,1.38525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2014 12:00:00 AM,1.385245,1.389925,1.383595,1.38866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2014 12:00:00 AM,1.388665,1.39059,1.386345,1.388465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/13/2014 12:00:00 AM,1.383845,1.386045,1.383255,1.384715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/14/2014 12:00:00 AM,1.384725,1.386305,1.380835,1.381545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2014 12:00:00 AM,1.38155,1.383335,1.37902,1.381095,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/16/2014 12:00:00 AM,1.38109,1.3851,1.38038,1.38239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2014 12:00:00 AM,1.382385,1.386475,1.381075,1.38108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2014 12:00:00 AM,1.381085,1.38224,1.380845,1.381295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n4/20/2014 12:00:00 AM,1.381475,1.38174,1.380925,1.381435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,-100,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n4/21/2014 12:00:00 AM,1.38143,1.38305,1.378715,1.37917,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2014 12:00:00 AM,1.379145,1.38247,1.3785,1.3807,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2014 12:00:00 AM,1.38071,1.38547,1.380025,1.38171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2014 12:00:00 AM,1.38172,1.38436,1.379145,1.38305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2014 12:00:00 AM,1.383045,1.38483,1.382685,1.38344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/27/2014 12:00:00 AM,1.383695,1.38466,1.3835,1.383905,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n4/28/2014 12:00:00 AM,1.383895,1.38795,1.381475,1.385195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2014 12:00:00 AM,1.385205,1.387925,1.38055,1.381295,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2014 12:00:00 AM,1.38128,1.387655,1.377195,1.38681,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2014 12:00:00 AM,1.386815,1.38891,1.38628,1.387,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/2/2014 12:00:00 AM,1.386985,1.388175,1.38122,1.38727,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/4/2014 12:00:00 AM,1.387445,1.388795,1.387125,1.387185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/5/2014 12:00:00 AM,1.38718,1.388615,1.386465,1.387475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n5/6/2014 12:00:00 AM,1.38748,1.395135,1.38722,1.392925,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2014 12:00:00 AM,1.39293,1.393875,1.39091,1.39105,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2014 12:00:00 AM,1.391055,1.399365,1.3833,1.38427,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2014 12:00:00 AM,1.384275,1.38437,1.37448,1.376135,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2014 12:00:00 AM,1.37547,1.376135,1.37507,1.376045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/12/2014 12:00:00 AM,1.37605,1.37749,1.37494,1.37556,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/13/2014 12:00:00 AM,1.375555,1.37715,1.368905,1.37078,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2014 12:00:00 AM,1.370775,1.37308,1.369805,1.37176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/15/2014 12:00:00 AM,1.371755,1.373245,1.36484,1.371695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/16/2014 12:00:00 AM,1.37169,1.37268,1.368545,1.369575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/18/2014 12:00:00 AM,1.370235,1.370585,1.369065,1.3703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n5/19/2014 12:00:00 AM,1.37029,1.373425,1.36984,1.371235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2014 12:00:00 AM,1.37123,1.37138,1.3678,1.37035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2014 12:00:00 AM,1.37034,1.37235,1.36344,1.368195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2014 12:00:00 AM,1.36819,1.36871,1.364535,1.365325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2014 12:00:00 AM,1.36532,1.36535,1.361575,1.36319,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2014 12:00:00 AM,1.363,1.36438,1.361465,1.362775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/26/2014 12:00:00 AM,1.362765,1.36544,1.361555,1.365205,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2014 12:00:00 AM,1.3652,1.366865,1.361255,1.363365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2014 12:00:00 AM,1.363375,1.36378,1.358855,1.3592,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2014 12:00:00 AM,1.359205,1.36257,1.358615,1.36027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2014 12:00:00 AM,1.360275,1.365015,1.359855,1.363315,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2014 12:00:00 AM,1.3635,1.364355,1.362185,1.36288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/2/2014 12:00:00 AM,1.36287,1.363615,1.358805,1.359645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2014 12:00:00 AM,1.35965,1.36478,1.35865,1.362105,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2014 12:00:00 AM,1.3621,1.36392,1.35965,1.36025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2014 12:00:00 AM,1.360245,1.366995,1.3503,1.36605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2014 12:00:00 AM,1.366045,1.367705,1.362105,1.364305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2014 12:00:00 AM,1.364445,1.364835,1.364095,1.364775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/9/2014 12:00:00 AM,1.36477,1.36688,1.35825,1.35924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2014 12:00:00 AM,1.359245,1.360195,1.353355,1.353925,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2014 12:00:00 AM,1.35393,1.35571,1.35216,1.35357,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/12/2014 12:00:00 AM,1.353575,1.357185,1.351235,1.355065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/13/2014 12:00:00 AM,1.35506,1.357905,1.352105,1.3541,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/15/2014 12:00:00 AM,1.353675,1.354445,1.35311,1.353605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n6/16/2014 12:00:00 AM,1.353615,1.357955,1.351305,1.357565,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2014 12:00:00 AM,1.35757,1.35871,1.35363,1.354875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2014 12:00:00 AM,1.35487,1.35997,1.35418,1.35895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2014 12:00:00 AM,1.358955,1.364345,1.35848,1.361015,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n6/20/2014 12:00:00 AM,1.36101,1.3634,1.356435,1.35994,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/22/2014 12:00:00 AM,1.35842,1.359735,1.358415,1.35911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/23/2014 12:00:00 AM,1.359105,1.36135,1.357415,1.36001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/24/2014 12:00:00 AM,1.360025,1.36278,1.35834,1.36059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/25/2014 12:00:00 AM,1.360585,1.36513,1.36005,1.36279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2014 12:00:00 AM,1.362785,1.36414,1.357585,1.361145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2014 12:00:00 AM,1.36115,1.365085,1.360995,1.364895,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2014 12:00:00 AM,1.364645,1.364785,1.364255,1.36435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/30/2014 12:00:00 AM,1.36434,1.36978,1.36403,1.36915,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2014 12:00:00 AM,1.369145,1.370065,1.367555,1.368025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/2/2014 12:00:00 AM,1.36803,1.36812,1.36419,1.365305,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2014 12:00:00 AM,1.36531,1.366445,1.35961,1.360875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/4/2014 12:00:00 AM,1.36087,1.361115,1.35854,1.359415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/6/2014 12:00:00 AM,1.359745,1.3601,1.3584,1.35881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/7/2014 12:00:00 AM,1.358815,1.36092,1.3576,1.360575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2014 12:00:00 AM,1.361675,1.364855,1.360235,1.364335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2014 12:00:00 AM,1.364325,1.365075,1.358915,1.360425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n7/15/2014 12:00:00 AM,1.362175,1.362805,1.356195,1.357065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2014 12:00:00 AM,1.35706,1.357135,1.352095,1.35281,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2014 12:00:00 AM,1.352815,1.35403,1.351265,1.35187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2014 12:00:00 AM,1.35273,1.353195,1.352495,1.35305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/21/2014 12:00:00 AM,1.353045,1.35491,1.3513,1.352205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/22/2014 12:00:00 AM,1.352215,1.352965,1.34587,1.346675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2014 12:00:00 AM,1.346105,1.3485,1.343805,1.346525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/25/2014 12:00:00 AM,1.34653,1.34756,1.34212,1.34305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2014 12:00:00 AM,1.343245,1.34363,1.342725,1.342875,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/28/2014 12:00:00 AM,1.34287,1.344395,1.342695,1.34373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/29/2014 12:00:00 AM,1.343735,1.34444,1.34042,1.34099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2014 12:00:00 AM,1.340995,1.341525,1.336695,1.339465,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2014 12:00:00 AM,1.33946,1.340055,1.337145,1.338895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/3/2014 12:00:00 AM,1.342745,1.343345,1.342285,1.342795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/4/2014 12:00:00 AM,1.3428,1.34311,1.34095,1.342165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2014 12:00:00 AM,1.34216,1.342475,1.33583,1.33715,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2014 12:00:00 AM,1.337145,1.3388,1.33331,1.337975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2014 12:00:00 AM,1.33798,1.339385,1.333715,1.33573,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2014 12:00:00 AM,1.335735,1.343275,1.33436,1.341085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2014 12:00:00 AM,1.340685,1.341415,1.340105,1.340435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n8/11/2014 12:00:00 AM,1.34044,1.340855,1.338035,1.33822,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2014 12:00:00 AM,1.338215,1.338305,1.333605,1.33649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2014 12:00:00 AM,1.336495,1.34151,1.33423,1.33658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/14/2014 12:00:00 AM,1.336585,1.34077,1.33486,1.33612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/15/2014 12:00:00 AM,1.336125,1.34118,1.33588,1.340005,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2014 12:00:00 AM,1.339405,1.33989,1.338225,1.33896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n8/18/2014 12:00:00 AM,1.338955,1.33992,1.335295,1.33602,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2014 12:00:00 AM,1.336025,1.33606,1.331315,1.33203,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2014 12:00:00 AM,1.332035,1.332165,1.325525,1.32591,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2014 12:00:00 AM,1.32592,1.328845,1.324205,1.327855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2014 12:00:00 AM,1.32165,1.322245,1.318305,1.319715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2014 12:00:00 AM,1.31972,1.321045,1.3179,1.318615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2014 12:00:00 AM,1.31862,1.32148,1.316465,1.316955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2014 12:00:00 AM,1.31695,1.32099,1.31527,1.319195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2014 12:00:00 AM,1.31919,1.322085,1.315965,1.31842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/31/2014 12:00:00 AM,1.313775,1.31388,1.312465,1.312695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/1/2014 12:00:00 AM,1.31271,1.314555,1.311915,1.31312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/2/2014 12:00:00 AM,1.313115,1.31368,1.311015,1.313125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/3/2014 12:00:00 AM,1.31312,1.31601,1.31222,1.31482,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/4/2014 12:00:00 AM,1.314825,1.31541,1.292015,1.293,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2014 12:00:00 AM,1.292995,1.2989,1.2925,1.295255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2014 12:00:00 AM,1.29433,1.29618,1.29305,1.295195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n9/8/2014 12:00:00 AM,1.29519,1.295915,1.288145,1.289125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2014 12:00:00 AM,1.28913,1.29575,1.285945,1.29412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2014 12:00:00 AM,1.294115,1.29629,1.28838,1.29169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2014 12:00:00 AM,1.29168,1.29519,1.28972,1.29225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/12/2014 12:00:00 AM,1.292255,1.297935,1.290885,1.29641,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2014 12:00:00 AM,1.2976,1.297985,1.29588,1.295965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/15/2014 12:00:00 AM,1.29597,1.296925,1.29087,1.293855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2014 12:00:00 AM,1.29386,1.29953,1.29223,1.29581,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2014 12:00:00 AM,1.2958,1.29815,1.28343,1.28489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2014 12:00:00 AM,1.2849,1.293055,1.28487,1.292045,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2014 12:00:00 AM,1.29205,1.2929,1.282675,1.282675,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2014 12:00:00 AM,1.282705,1.28443,1.28258,1.284,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/22/2014 12:00:00 AM,1.28399,1.2868,1.281635,1.28504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2014 12:00:00 AM,1.28503,1.290125,1.283945,1.2849,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/24/2014 12:00:00 AM,1.284905,1.286405,1.27742,1.2777,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2014 12:00:00 AM,1.277705,1.27833,1.26967,1.275525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2014 12:00:00 AM,1.27552,1.276,1.26769,1.26826,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2014 12:00:00 AM,1.26908,1.27002,1.26666,1.267545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/29/2014 12:00:00 AM,1.26755,1.2715,1.266375,1.269005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2014 12:00:00 AM,1.269,1.270245,1.257115,1.262825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2014 12:00:00 AM,1.262815,1.26398,1.258365,1.26216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/2/2014 12:00:00 AM,1.262165,1.2699,1.261385,1.26681,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n10/3/2014 12:00:00 AM,1.2668,1.266905,1.25007,1.251395,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2014 12:00:00 AM,1.25105,1.25156,1.25085,1.251275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/6/2014 12:00:00 AM,1.25128,1.26749,1.25122,1.26434,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2014 12:00:00 AM,1.264355,1.268325,1.258365,1.26649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2014 12:00:00 AM,1.26648,1.27549,1.262265,1.274085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2014 12:00:00 AM,1.274085,1.279155,1.2664,1.26883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2014 12:00:00 AM,1.268835,1.2716,1.26056,1.26295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2014 12:00:00 AM,1.26489,1.26521,1.2621,1.26397,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n10/13/2014 12:00:00 AM,1.263985,1.27686,1.26339,1.27218,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2014 12:00:00 AM,1.272185,1.27316,1.263175,1.26414,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2014 12:00:00 AM,1.264155,1.28874,1.262475,1.28205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2014 12:00:00 AM,1.282045,1.28451,1.270585,1.28044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/17/2014 12:00:00 AM,1.280445,1.2837,1.2744,1.276045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2014 12:00:00 AM,1.27625,1.27639,1.273665,1.274745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/20/2014 12:00:00 AM,1.27476,1.281685,1.273135,1.279445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/21/2014 12:00:00 AM,1.27944,1.284035,1.270655,1.27138,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2014 12:00:00 AM,1.27137,1.273985,1.263735,1.26416,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2014 12:00:00 AM,1.264165,1.26768,1.261375,1.26495,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/24/2014 12:00:00 AM,1.264945,1.269585,1.2635,1.267115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/26/2014 12:00:00 AM,1.2689,1.26965,1.26721,1.267615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/27/2014 12:00:00 AM,1.26762,1.272355,1.266585,1.27025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/28/2014 12:00:00 AM,1.270245,1.2765,1.26847,1.27373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2014 12:00:00 AM,1.27374,1.27708,1.262695,1.26317,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2014 12:00:00 AM,1.26318,1.26331,1.254715,1.26091,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2014 12:00:00 AM,1.260905,1.26091,1.248565,1.252175,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2014 12:00:00 AM,1.25065,1.25146,1.25005,1.2502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/3/2014 12:00:00 AM,1.250205,1.25114,1.24395,1.24924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2014 12:00:00 AM,1.249245,1.257765,1.24902,1.255175,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2014 12:00:00 AM,1.25518,1.25673,1.24573,1.24776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2014 12:00:00 AM,1.247765,1.25334,1.23644,1.238025,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2014 12:00:00 AM,1.23803,1.247,1.23581,1.24548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2014 12:00:00 AM,1.24768,1.24861,1.245975,1.24603,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/10/2014 12:00:00 AM,1.246025,1.250955,1.241555,1.242595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2014 12:00:00 AM,1.24259,1.24996,1.23943,1.24758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2014 12:00:00 AM,1.247575,1.24979,1.24193,1.242985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2014 12:00:00 AM,1.24299,1.24919,1.24277,1.247375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/14/2014 12:00:00 AM,1.24737,1.25463,1.239845,1.252435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2014 12:00:00 AM,1.25368,1.25377,1.251405,1.25214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/17/2014 12:00:00 AM,1.25215,1.25778,1.24436,1.24501,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2014 12:00:00 AM,1.24502,1.254535,1.24492,1.253225,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2014 12:00:00 AM,1.25322,1.26005,1.251235,1.254065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/20/2014 12:00:00 AM,1.25405,1.257545,1.250445,1.254315,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/21/2014 12:00:00 AM,1.25431,1.256835,1.23749,1.238965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2014 12:00:00 AM,1.237025,1.237565,1.23595,1.237185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,-100,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n11/24/2014 12:00:00 AM,1.23719,1.244475,1.23719,1.243395,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2014 12:00:00 AM,1.2434,1.248725,1.240205,1.24797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2014 12:00:00 AM,1.247965,1.25316,1.244375,1.250435,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/27/2014 12:00:00 AM,1.25043,1.252365,1.24561,1.245965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/28/2014 12:00:00 AM,1.245975,1.24904,1.242645,1.24525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/30/2014 12:00:00 AM,1.246505,1.24736,1.243195,1.24368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/1/2014 12:00:00 AM,1.243685,1.250675,1.241935,1.24702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2014 12:00:00 AM,1.24701,1.24762,1.237685,1.238775,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2014 12:00:00 AM,1.23877,1.23906,1.230125,1.23142,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2014 12:00:00 AM,1.231425,1.24565,1.22797,1.23858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2014 12:00:00 AM,1.238575,1.239305,1.2271,1.22868,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2014 12:00:00 AM,1.22788,1.230305,1.22784,1.22938,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/8/2014 12:00:00 AM,1.229385,1.23442,1.224725,1.23148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/9/2014 12:00:00 AM,1.231485,1.24483,1.22921,1.23881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2014 12:00:00 AM,1.238805,1.248705,1.236225,1.24803,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2014 12:00:00 AM,1.248025,1.24953,1.237015,1.23934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2014 12:00:00 AM,1.239345,1.24854,1.238445,1.246125,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2014 12:00:00 AM,1.247005,1.248485,1.24569,1.2464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0\n12/15/2014 12:00:00 AM,1.246405,1.24791,1.24146,1.24405,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2014 12:00:00 AM,1.244045,1.25701,1.24357,1.251095,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2014 12:00:00 AM,1.25109,1.25159,1.23206,1.233695,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2014 12:00:00 AM,1.23369,1.235295,1.226585,1.22884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2014 12:00:00 AM,1.228845,1.230235,1.22203,1.22314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/21/2014 12:00:00 AM,1.2222,1.22267,1.221925,1.222475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/22/2014 12:00:00 AM,1.22247,1.22727,1.22167,1.22234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/23/2014 12:00:00 AM,1.222345,1.224575,1.21648,1.21754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2014 12:00:00 AM,1.217545,1.222025,1.216965,1.220255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/26/2014 12:00:00 AM,1.22177,1.222115,1.216845,1.21813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/28/2014 12:00:00 AM,1.218205,1.218805,1.216735,1.216855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/29/2014 12:00:00 AM,1.21686,1.222125,1.214285,1.215345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2014 12:00:00 AM,1.215355,1.218765,1.2124,1.216135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/31/2014 12:00:00 AM,1.21613,1.21698,1.20975,1.20997,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2015 12:00:00 AM,1.2058,1.20699,1.20003,1.20013,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2015 12:00:00 AM,1.200205,1.20066,1.186835,1.194705,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2015 12:00:00 AM,1.19471,1.197645,1.188725,1.193755,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/6/2015 12:00:00 AM,1.193765,1.196885,1.184215,1.18724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2015 12:00:00 AM,1.187235,1.189655,1.180215,1.18337,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2015 12:00:00 AM,1.183365,1.18476,1.175425,1.17922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2015 12:00:00 AM,1.179225,1.184625,1.176255,1.184315,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n1/11/2015 12:00:00 AM,1.18438,1.187,1.18395,1.186985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/12/2015 12:00:00 AM,1.18698,1.1871,1.178625,1.18321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n1/13/2015 12:00:00 AM,1.183205,1.18597,1.17531,1.17771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2015 12:00:00 AM,1.177715,1.184645,1.17274,1.178415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/15/2015 12:00:00 AM,1.17842,1.17912,1.15678,1.16364,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2015 12:00:00 AM,1.163635,1.1649,1.14599,1.156245,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2015 12:00:00 AM,1.155505,1.15737,1.154645,1.15612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n1/19/2015 12:00:00 AM,1.156125,1.1639,1.155145,1.159505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n1/20/2015 12:00:00 AM,1.1595,1.16155,1.15405,1.154565,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2015 12:00:00 AM,1.15456,1.168075,1.15415,1.161475,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2015 12:00:00 AM,1.16147,1.166155,1.13163,1.134685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2015 12:00:00 AM,1.13469,1.13741,1.11145,1.12061,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2015 12:00:00 AM,1.115545,1.116915,1.109765,1.11421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n1/26/2015 12:00:00 AM,1.1142,1.129565,1.11383,1.12499,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2015 12:00:00 AM,1.124985,1.14228,1.122385,1.1368,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2015 12:00:00 AM,1.136785,1.13825,1.127255,1.12832,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/29/2015 12:00:00 AM,1.128325,1.136805,1.126185,1.133385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2015 12:00:00 AM,1.13339,1.136385,1.127845,1.12853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/1/2015 12:00:00 AM,1.131175,1.13285,1.13008,1.130735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n2/2/2015 12:00:00 AM,1.130725,1.136215,1.12925,1.13388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/3/2015 12:00:00 AM,1.133885,1.15342,1.131245,1.145675,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2015 12:00:00 AM,1.14568,1.148485,1.130415,1.13167,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2015 12:00:00 AM,1.131665,1.14989,1.13161,1.147075,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2015 12:00:00 AM,1.14707,1.14738,1.131195,1.13144,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2015 12:00:00 AM,1.132,1.1326,1.12862,1.131365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/9/2015 12:00:00 AM,1.13137,1.135955,1.127035,1.13244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/10/2015 12:00:00 AM,1.132445,1.13454,1.127295,1.13187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/11/2015 12:00:00 AM,1.131875,1.135225,1.12798,1.1311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/12/2015 12:00:00 AM,1.131095,1.142305,1.130395,1.140375,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2015 12:00:00 AM,1.14038,1.144325,1.137995,1.13867,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2015 12:00:00 AM,1.141405,1.142515,1.13866,1.13977,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/16/2015 12:00:00 AM,1.139775,1.142905,1.131955,1.13326,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2015 12:00:00 AM,1.133255,1.144925,1.132205,1.14041,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2015 12:00:00 AM,1.140405,1.141615,1.133395,1.139965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/19/2015 12:00:00 AM,1.13996,1.145015,1.13554,1.136575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2015 12:00:00 AM,1.136585,1.14301,1.1279,1.137845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/22/2015 12:00:00 AM,1.13965,1.141275,1.137775,1.138045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0\n2/23/2015 12:00:00 AM,1.13802,1.13935,1.12952,1.133395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2015 12:00:00 AM,1.133385,1.135825,1.12883,1.133945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/25/2015 12:00:00 AM,1.13394,1.138885,1.133585,1.136395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/26/2015 12:00:00 AM,1.1364,1.137975,1.11838,1.120265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2015 12:00:00 AM,1.12026,1.12452,1.117585,1.11947,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/1/2015 12:00:00 AM,1.118,1.118745,1.11601,1.11608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/2/2015 12:00:00 AM,1.1161,1.124065,1.1161,1.11766,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2015 12:00:00 AM,1.11767,1.12176,1.115465,1.118275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/4/2015 12:00:00 AM,1.11827,1.118555,1.10616,1.107915,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2015 12:00:00 AM,1.10793,1.111465,1.09878,1.10318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2015 12:00:00 AM,1.10319,1.10326,1.08392,1.08426,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2015 12:00:00 AM,1.083705,1.08464,1.08227,1.08448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/9/2015 12:00:00 AM,1.08446,1.09066,1.08296,1.08348,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2015 12:00:00 AM,1.0835,1.083715,1.06686,1.07068,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2015 12:00:00 AM,1.07066,1.0717,1.05112,1.05478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2015 12:00:00 AM,1.054795,1.068385,1.04942,1.06265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2015 12:00:00 AM,1.06266,1.063485,1.046245,1.04964,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2015 12:00:00 AM,1.04805,1.05059,1.045785,1.048395,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/16/2015 12:00:00 AM,1.04839,1.061955,1.048355,1.057185,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2015 12:00:00 AM,1.057175,1.065095,1.055145,1.0595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2015 12:00:00 AM,1.05949,1.104665,1.058015,1.08488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2015 12:00:00 AM,1.084885,1.091965,1.061305,1.0669,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2015 12:00:00 AM,1.066905,1.08825,1.065565,1.082025,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2015 12:00:00 AM,1.083775,1.08832,1.08154,1.082535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/23/2015 12:00:00 AM,1.08254,1.097135,1.076755,1.09445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2015 12:00:00 AM,1.094445,1.10295,1.089055,1.090475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2015 12:00:00 AM,1.09047,1.10145,1.090425,1.096325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2015 12:00:00 AM,1.09633,1.10524,1.08565,1.0885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2015 12:00:00 AM,1.08851,1.09488,1.080125,1.088975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/29/2015 12:00:00 AM,1.0883,1.089515,1.08804,1.088275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n3/30/2015 12:00:00 AM,1.088285,1.08844,1.081005,1.08293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/31/2015 12:00:00 AM,1.082925,1.08454,1.07131,1.074005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2015 12:00:00 AM,1.07401,1.079995,1.071865,1.076975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/2/2015 12:00:00 AM,1.07697,1.09056,1.07503,1.086995,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2015 12:00:00 AM,1.08699,1.102715,1.086395,1.097385,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2015 12:00:00 AM,1.09763,1.10179,1.09763,1.09948,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n4/6/2015 12:00:00 AM,1.099485,1.10357,1.091015,1.093435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2015 12:00:00 AM,1.09343,1.095495,1.08034,1.08222,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2015 12:00:00 AM,1.082225,1.088765,1.076325,1.078485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2015 12:00:00 AM,1.078475,1.078885,1.063775,1.06667,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2015 12:00:00 AM,1.066665,1.068375,1.05679,1.060195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2015 12:00:00 AM,1.059475,1.06173,1.05844,1.06066,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/13/2015 12:00:00 AM,1.060655,1.061915,1.052035,1.05723,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2015 12:00:00 AM,1.057225,1.07075,1.053145,1.06467,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2015 12:00:00 AM,1.064675,1.070235,1.05707,1.06764,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2015 12:00:00 AM,1.067635,1.081795,1.06248,1.07581,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2015 12:00:00 AM,1.075815,1.084885,1.073365,1.08063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2015 12:00:00 AM,1.08235,1.0825,1.07889,1.080855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/20/2015 12:00:00 AM,1.08085,1.08185,1.07122,1.07487,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2015 12:00:00 AM,1.074865,1.078135,1.065995,1.07385,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/22/2015 12:00:00 AM,1.073845,1.0801,1.07086,1.07245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/23/2015 12:00:00 AM,1.072455,1.084595,1.06662,1.081405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2015 12:00:00 AM,1.0814,1.09001,1.07849,1.08729,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2015 12:00:00 AM,1.086455,1.08747,1.0856,1.086575,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n4/27/2015 12:00:00 AM,1.08658,1.092655,1.08195,1.087665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/28/2015 12:00:00 AM,1.087655,1.099115,1.086025,1.09677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2015 12:00:00 AM,1.096785,1.118815,1.095945,1.111205,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2015 12:00:00 AM,1.11121,1.126635,1.10713,1.12116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2015 12:00:00 AM,1.121165,1.12908,1.117465,1.119615,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/3/2015 12:00:00 AM,1.118865,1.120115,1.11824,1.11885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n5/4/2015 12:00:00 AM,1.118845,1.12247,1.112275,1.11489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2015 12:00:00 AM,1.114885,1.122325,1.106645,1.117975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/7/2015 12:00:00 AM,1.133925,1.13919,1.122825,1.124455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2015 12:00:00 AM,1.12014,1.12066,1.119195,1.119585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/11/2015 12:00:00 AM,1.11958,1.12027,1.11312,1.114565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/12/2015 12:00:00 AM,1.11457,1.1279,1.113445,1.12189,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2015 12:00:00 AM,1.121895,1.13828,1.120255,1.1347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2015 12:00:00 AM,1.134695,1.14449,1.134075,1.140215,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2015 12:00:00 AM,1.145305,1.145305,1.14321,1.14442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/18/2015 12:00:00 AM,1.144415,1.1447,1.129875,1.132435,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2015 12:00:00 AM,1.13243,1.132595,1.11185,1.114265,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2015 12:00:00 AM,1.114255,1.11522,1.106225,1.11014,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2015 12:00:00 AM,1.110145,1.11815,1.107985,1.110935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2015 12:00:00 AM,1.11094,1.120865,1.100225,1.101135,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2015 12:00:00 AM,1.100505,1.10098,1.096585,1.099115,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/25/2015 12:00:00 AM,1.09911,1.10079,1.095905,1.09686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/26/2015 12:00:00 AM,1.096865,1.09711,1.08635,1.088675,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2015 12:00:00 AM,1.088665,1.09293,1.081925,1.08977,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/28/2015 12:00:00 AM,1.089765,1.097445,1.08672,1.096295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2015 12:00:00 AM,1.0963,1.100585,1.09258,1.0992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2015 12:00:00 AM,1.095745,1.09792,1.08873,1.092185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2015 12:00:00 AM,1.09219,1.119335,1.09164,1.114765,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2015 12:00:00 AM,1.11476,1.128515,1.10794,1.126115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2015 12:00:00 AM,1.12611,1.138005,1.118005,1.120745,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"
  },
  {
    "path": "Tests/TestData/ewz_candle_patterns.txt",
    "content": "Date,Open,High,Low,Close,Volume,CDL2CROWS,CDL3BLACKCROWS,CDL3INSIDE,CDL3LINESTRIKE,CDL3OUTSIDE,CDL3STARSINSOUTH,CDL3WHITESOLDIERS,CDLABANDONEDBABY,CDLADVANCEBLOCK,CDLBELTHOLD,CDLBREAKAWAY,CDLCLOSINGMARUBOZU,CDLCONCEALBABYSWALL,CDLCOUNTERATTACK,CDLDARKCLOUDCOVER,CDLDOJI,CDLDOJISTAR,CDLDRAGONFLYDOJI,CDLENGULFING,CDLEVENINGDOJISTAR,CDLEVENINGSTAR,CDLGAPSIDESIDEWHITE,CDLGRAVESTONEDOJI,CDLHAMMER,CDLHANGINGMAN,CDLHARAMI,CDLHARAMICROSS,CDLHIGHWAVE,CDLHIKKAKE,CDLHIKKAKEMOD,CDLHOMINGPIGEON,CDLIDENTICAL3CROWS,CDLINNECK,CDLINVERTEDHAMMER,CDLKICKING,CDLKICKINGBYLENGTH,CDLLADDERBOTTOM,CDLLONGLEGGEDDOJI,CDLLONGLINE,CDLMARUBOZU,CDLMATCHINGLOW,CDLMATHOLD,CDLMORNINGDOJISTAR,CDLMORNINGSTAR,CDLONNECK,CDLPIERCING,CDLRICKSHAWMAN,CDLRISEFALL3METHODS,CDLSEPARATINGLINES,CDLSHOOTINGSTAR,CDLSHORTLINE,CDLSPINNINGTOP,CDLSTALLEDPATTERN,CDLSTICKSANDWICH,CDLTAKURI,CDLTASUKIGAP,CDLTHRUSTING,CDLTRISTAR,CDLUNIQUE3RIVER,CDLUPSIDEGAP2CROWS,CDLXSIDEGAP3METHODS\n7/14/2000 12:00:00 AM,187500,188750,187500,188750,25000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n7/17/2000 12:00:00 AM,199375,200000,199375,200000,10000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n7/18/2000 12:00:00 AM,199375,199375,199375,199375,10000,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n7/19/2000 12:00:00 AM,194375,194375,194375,194375,10000,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n7/20/2000 12:00:00 AM,198750,198750,198750,198750,5000,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n7/21/2000 12:00:00 AM,200000,200000,200000,200000,200,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n7/24/2000 12:00:00 AM,200000,200000,200000,200000,0,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,0\n7/25/2000 12:00:00 AM,200000,200000,200000,200000,0,,,,,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n7/26/2000 12:00:00 AM,200000,200000,200000,200000,0,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n7/27/2000 12:00:00 AM,197500,197500,197500,197500,100,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n7/28/2000 12:00:00 AM,200000,200000,193750,193750,21300,,,,0,0,,,,,-100,,-100,,,,0,,0,-100,,,0,0,,,,,0,0,0,,,,,,,,0,0,-100,0,,,,,,0,,,,0,0,,0,0,0,,,,,0\n7/31/2000 12:00:00 AM,193125,193750,193125,193750,200,,,,0,0,,,,,0,,0,,0,0,0,0,0,0,,,0,0,0,0,0,0,0,0,0,0,,-100,0,0,0,,0,0,0,0,,,,-100,0,0,,0,0,0,0,,0,0,0,0,,,,0\n8/1/2000 12:00:00 AM,190000,192500,190000,192500,7400,0,,0,0,0,0,0,0,0,100,,100,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,100,0,,0,0,0,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2000 12:00:00 AM,190000,190000,190000,190000,100,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2000 12:00:00 AM,188750,188750,188750,188750,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2000 12:00:00 AM,193750,196250,193750,196250,700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2000 12:00:00 AM,195625,196250,194375,196250,1100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2000 12:00:00 AM,196250,196250,196250,196250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/9/2000 12:00:00 AM,196250,196250,196250,196250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/10/2000 12:00:00 AM,190000,190000,190000,190000,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/11/2000 12:00:00 AM,194375,194375,194375,194375,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0\n8/14/2000 12:00:00 AM,194375,194375,194375,194375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/15/2000 12:00:00 AM,202500,202500,200000,200000,5400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2000 12:00:00 AM,200000,200000,200000,200000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/17/2000 12:00:00 AM,203125,203125,203125,203125,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/18/2000 12:00:00 AM,197500,197500,197500,197500,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,-100,0,0,0\n8/21/2000 12:00:00 AM,197500,197500,197500,197500,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/22/2000 12:00:00 AM,197500,197500,197500,197500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2000 12:00:00 AM,197500,197500,197500,197500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2000 12:00:00 AM,192500,192500,192500,192500,15000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2000 12:00:00 AM,195000,196250,195000,196250,2200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2000 12:00:00 AM,197500,197500,196875,196875,500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2000 12:00:00 AM,190000,193750,190000,191875,27300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2000 12:00:00 AM,191875,191875,191875,191875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/31/2000 12:00:00 AM,198125,198750,197500,197500,2600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2000 12:00:00 AM,197500,197500,197500,197500,4900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/5/2000 12:00:00 AM,196250,196250,196250,196250,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/6/2000 12:00:00 AM,201875,202500,201250,202500,2700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2000 12:00:00 AM,203750,203750,202500,203125,4400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2000 12:00:00 AM,200000,200000,195000,195000,1100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2000 12:00:00 AM,195000,200625,195000,200000,1400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2000 12:00:00 AM,196875,196875,196875,196875,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/13/2000 12:00:00 AM,193750,194375,192500,192500,2100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2000 12:00:00 AM,190000,190000,190000,190000,1100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/15/2000 12:00:00 AM,184375,186250,184375,186250,10600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2000 12:00:00 AM,183750,183750,181250,181875,1000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2000 12:00:00 AM,180000,180625,180000,180625,10500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/20/2000 12:00:00 AM,176250,176875,176250,176875,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/21/2000 12:00:00 AM,180000,180000,180000,180000,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/22/2000 12:00:00 AM,180625,180625,180625,180625,1800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/25/2000 12:00:00 AM,184375,184375,184375,184375,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/26/2000 12:00:00 AM,177500,182500,177500,182500,10700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2000 12:00:00 AM,179375,179375,179375,179375,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/28/2000 12:00:00 AM,179375,179375,179375,179375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/29/2000 12:00:00 AM,181250,181250,181250,181250,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/2/2000 12:00:00 AM,180625,180625,176250,178125,500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2000 12:00:00 AM,175625,175625,175625,175625,5100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/4/2000 12:00:00 AM,175625,180000,175625,180000,200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2000 12:00:00 AM,181875,181875,181875,181875,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/6/2000 12:00:00 AM,180000,180000,180000,180000,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/9/2000 12:00:00 AM,171875,171875,171875,171875,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/10/2000 12:00:00 AM,177500,179375,175000,175000,900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2000 12:00:00 AM,176875,176875,176875,176875,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/12/2000 12:00:00 AM,170625,170625,170625,170625,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/13/2000 12:00:00 AM,171875,172500,171250,172500,12200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2000 12:00:00 AM,174375,174375,174375,174375,5800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/17/2000 12:00:00 AM,171875,171875,170000,170000,300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2000 12:00:00 AM,170000,170000,170000,170000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/19/2000 12:00:00 AM,171875,171875,171875,171875,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/20/2000 12:00:00 AM,168750,169375,168750,169375,1500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2000 12:00:00 AM,166875,166875,161250,161250,300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2000 12:00:00 AM,161250,161250,161250,161250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/25/2000 12:00:00 AM,151250,151250,151250,151250,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/26/2000 12:00:00 AM,151875,151875,151875,151875,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0\n10/27/2000 12:00:00 AM,151875,151875,151875,151875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/30/2000 12:00:00 AM,151875,151875,151875,151875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2000 12:00:00 AM,161250,161250,161250,161250,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2000 12:00:00 AM,163125,165000,163125,165000,1200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2000 12:00:00 AM,165000,165000,165000,165000,3100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2000 12:00:00 AM,162500,162500,157500,160000,1800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2000 12:00:00 AM,160000,160000,160000,160000,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/7/2000 12:00:00 AM,160000,160000,160000,160000,12000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/8/2000 12:00:00 AM,166875,166875,160000,160000,7300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2000 12:00:00 AM,155625,155625,155000,155000,1500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/10/2000 12:00:00 AM,155000,155000,155000,155000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/13/2000 12:00:00 AM,157500,157500,153125,153125,4400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2000 12:00:00 AM,160000,160000,159375,159375,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/15/2000 12:00:00 AM,159375,159375,159375,159375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/16/2000 12:00:00 AM,158125,158125,158125,158125,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/17/2000 12:00:00 AM,152500,154375,152500,153750,2800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2000 12:00:00 AM,153750,153750,153750,153750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/21/2000 12:00:00 AM,153750,153750,153750,153750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/22/2000 12:00:00 AM,153750,153750,153750,153750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/24/2000 12:00:00 AM,153750,153750,153750,153750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/27/2000 12:00:00 AM,155625,155625,153125,153125,7800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2000 12:00:00 AM,150000,150000,146875,146875,600,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2000 12:00:00 AM,146875,146875,146875,146875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/30/2000 12:00:00 AM,144375,144375,144375,144375,13900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/1/2000 12:00:00 AM,144375,144375,144375,144375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/4/2000 12:00:00 AM,143750,143750,143750,143750,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/5/2000 12:00:00 AM,143750,143750,143750,143750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2000 12:00:00 AM,151250,151250,151250,151250,1900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2000 12:00:00 AM,150625,153125,150625,153125,4400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2000 12:00:00 AM,158750,158750,158750,158750,43500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2000 12:00:00 AM,161875,161875,161875,161875,3700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2000 12:00:00 AM,163125,163125,162500,162500,3500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2000 12:00:00 AM,159375,160000,158125,160000,39900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2000 12:00:00 AM,162500,162500,162500,162500,5300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/15/2000 12:00:00 AM,160000,160625,160000,160625,700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2000 12:00:00 AM,163750,163750,163750,163750,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/19/2000 12:00:00 AM,163750,163750,163750,163750,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/20/2000 12:00:00 AM,158125,158125,158125,158125,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/21/2000 12:00:00 AM,154375,158125,154375,158125,500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2000 12:00:00 AM,158750,158750,155000,155000,4000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/26/2000 12:00:00 AM,155000,155000,155000,155000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2000 12:00:00 AM,158750,158750,158750,158750,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/28/2000 12:00:00 AM,163750,163750,163750,163750,800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/29/2000 12:00:00 AM,163750,165000,160000,165000,24400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2001 12:00:00 AM,168750,168750,164375,166875,27600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2001 12:00:00 AM,166250,180000,166250,180000,2700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2001 12:00:00 AM,178750,179375,177500,177500,4000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2001 12:00:00 AM,173750,173750,173750,173750,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/8/2001 12:00:00 AM,173750,173750,173750,173750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/9/2001 12:00:00 AM,179375,179375,178750,178750,2700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/10/2001 12:00:00 AM,177500,178125,177500,177500,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2001 12:00:00 AM,177500,178125,177500,178125,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/12/2001 12:00:00 AM,178125,179375,177500,178125,13700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/16/2001 12:00:00 AM,178125,178125,174375,174375,3300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2001 12:00:00 AM,178750,182500,178750,182500,10800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2001 12:00:00 AM,183750,184375,183750,184375,1100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/19/2001 12:00:00 AM,186250,186875,185000,186250,60200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/22/2001 12:00:00 AM,185625,185625,183125,183125,10600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2001 12:00:00 AM,186250,186250,183750,186250,62400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n1/24/2001 12:00:00 AM,188750,190000,186250,186250,1800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2001 12:00:00 AM,185625,185625,185625,185625,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/26/2001 12:00:00 AM,183750,185000,183125,185000,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2001 12:00:00 AM,182500,187000,182500,187000,19100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2001 12:00:00 AM,185000,185499,182999,182999,8200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2001 12:00:00 AM,182999,187500,182999,187500,54600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2001 12:00:00 AM,182199,182199,179500,179599,62500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2001 12:00:00 AM,177000,180700,175000,175000,8100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2001 12:00:00 AM,172500,172500,172500,172500,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/6/2001 12:00:00 AM,176399,179000,176399,177300,100600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/7/2001 12:00:00 AM,173300,176100,173300,175100,61600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2001 12:00:00 AM,180000,181200,178500,180000,62500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/9/2001 12:00:00 AM,180000,181500,180000,180000,2800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2001 12:00:00 AM,180000,181000,178600,179000,17200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2001 12:00:00 AM,180000,180000,179000,179000,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/14/2001 12:00:00 AM,182700,182700,182700,182700,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/15/2001 12:00:00 AM,180000,181800,179500,181000,2900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2001 12:00:00 AM,175100,175100,170100,173400,107900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2001 12:00:00 AM,172500,172500,167999,169500,5300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2001 12:00:00 AM,166500,166500,164200,166000,2400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2001 12:00:00 AM,163400,166500,163400,164500,600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2001 12:00:00 AM,164599,167500,164599,167500,700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2001 12:00:00 AM,170000,171500,169500,171500,3700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2001 12:00:00 AM,166000,166000,162400,164000,9800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2001 12:00:00 AM,170000,170000,165000,165000,2100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2001 12:00:00 AM,165000,165000,165000,165000,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/2/2001 12:00:00 AM,170000,175400,170000,174500,16500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2001 12:00:00 AM,177500,177500,173500,174500,68900,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2001 12:00:00 AM,175499,176000,170300,170300,24500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2001 12:00:00 AM,171000,173500,170000,173500,184300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2001 12:00:00 AM,170499,175000,170499,172500,593500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2001 12:00:00 AM,169000,170000,166800,170000,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2001 12:00:00 AM,169800,169800,163500,164500,2300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2001 12:00:00 AM,164500,164500,164500,164500,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/14/2001 12:00:00 AM,157600,160000,157000,157100,451100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2001 12:00:00 AM,158000,158000,155500,155500,21500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2001 12:00:00 AM,155500,157000,152100,157000,1700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2001 12:00:00 AM,157000,157000,157000,157000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/20/2001 12:00:00 AM,158400,158400,154500,154500,19600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2001 12:00:00 AM,155500,156400,150700,150700,5400,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2001 12:00:00 AM,147700,147700,140500,143500,170700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2001 12:00:00 AM,144500,144500,139700,143000,1700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2001 12:00:00 AM,149500,152100,149500,152100,5600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2001 12:00:00 AM,154300,155900,154300,155900,900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/28/2001 12:00:00 AM,150500,152000,150000,151000,75700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2001 12:00:00 AM,147500,152600,147500,152000,217000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2001 12:00:00 AM,147000,149800,144000,149800,82100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2001 12:00:00 AM,147500,147500,142500,143500,14000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2001 12:00:00 AM,143500,143500,139700,143500,3700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/4/2001 12:00:00 AM,144500,147000,144500,145000,70400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/5/2001 12:00:00 AM,148000,149800,147600,149800,21800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/6/2001 12:00:00 AM,151500,151500,147200,147200,160700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2001 12:00:00 AM,148500,150500,148500,150500,18000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/10/2001 12:00:00 AM,155000,156300,155000,156300,5100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/11/2001 12:00:00 AM,154000,154000,152400,152400,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/12/2001 12:00:00 AM,152400,152400,152400,152400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/16/2001 12:00:00 AM,152400,152400,152400,152400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/17/2001 12:00:00 AM,148500,148500,145500,145500,4900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2001 12:00:00 AM,160000,160000,155000,155000,200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2001 12:00:00 AM,149800,149800,147500,147500,6600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2001 12:00:00 AM,140800,140800,135000,136600,289300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2001 12:00:00 AM,139000,140000,138300,140000,7900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2001 12:00:00 AM,141000,141000,140500,141000,23400,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/25/2001 12:00:00 AM,141000,141000,140000,141000,218300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,100,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/26/2001 12:00:00 AM,144000,147000,144000,147000,31400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2001 12:00:00 AM,152000,152800,151900,152000,3200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,100,0,0,0,0,0,0,0,0,0\n4/30/2001 12:00:00 AM,154000,157500,152500,152500,6200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/1/2001 12:00:00 AM,152600,152600,152600,152600,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/2/2001 12:00:00 AM,152000,152500,149500,150400,6400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2001 12:00:00 AM,150400,153000,149400,151200,23200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/4/2001 12:00:00 AM,155000,155100,155000,155000,46000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n5/7/2001 12:00:00 AM,156300,156500,152800,153000,2100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2001 12:00:00 AM,152500,152500,150000,150000,85100,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2001 12:00:00 AM,150400,150400,150400,150400,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/10/2001 12:00:00 AM,153500,153500,150600,152000,94300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2001 12:00:00 AM,152000,152000,152000,152000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/14/2001 12:00:00 AM,146000,146500,146000,146200,3400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/15/2001 12:00:00 AM,142500,143800,142500,143200,87100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2001 12:00:00 AM,143200,145300,143200,144500,639500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2001 12:00:00 AM,149500,151000,148600,149000,23000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2001 12:00:00 AM,149200,151900,149000,151500,22700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2001 12:00:00 AM,148800,151300,148800,149000,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2001 12:00:00 AM,153500,153500,150100,150100,11600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2001 12:00:00 AM,149500,150300,148000,149000,4400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/24/2001 12:00:00 AM,146500,146500,145300,145300,5100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2001 12:00:00 AM,147000,147000,144600,146900,51600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n5/29/2001 12:00:00 AM,146500,147500,146000,146000,108600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2001 12:00:00 AM,145000,145800,143600,144700,2900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/31/2001 12:00:00 AM,147200,147300,147200,147300,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/1/2001 12:00:00 AM,145500,145500,145000,145000,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/4/2001 12:00:00 AM,150800,150800,150800,150800,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/5/2001 12:00:00 AM,150300,150300,148800,149500,80100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2001 12:00:00 AM,148500,150800,148300,149100,2400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2001 12:00:00 AM,150100,150100,148900,148900,9800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2001 12:00:00 AM,153000,153000,150000,150000,83800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2001 12:00:00 AM,149000,149000,146400,146400,2700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2001 12:00:00 AM,144000,144000,143500,144000,9700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n6/13/2001 12:00:00 AM,144000,144000,144000,144000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/14/2001 12:00:00 AM,146800,146800,145400,145800,1200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2001 12:00:00 AM,146000,146000,146000,146000,1500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/18/2001 12:00:00 AM,142000,142000,130000,139900,3800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2001 12:00:00 AM,137500,137500,134700,134700,7400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2001 12:00:00 AM,135000,137800,135000,137100,1400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2001 12:00:00 AM,141000,144400,140600,144400,2500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2001 12:00:00 AM,149000,149000,146300,147400,1300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2001 12:00:00 AM,149200,149200,143700,146000,2000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0\n6/26/2001 12:00:00 AM,142900,145100,142900,145000,900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2001 12:00:00 AM,143800,144700,143100,143100,111600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2001 12:00:00 AM,143800,145300,143800,145300,8500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/29/2001 12:00:00 AM,144000,144000,143800,143800,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/2/2001 12:00:00 AM,144000,144300,144000,144100,1600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/3/2001 12:00:00 AM,145000,145000,144000,144100,16100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/5/2001 12:00:00 AM,140000,140000,130000,130000,15100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2001 12:00:00 AM,129300,131500,127700,131500,236100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n7/9/2001 12:00:00 AM,132200,132300,130800,130800,6600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/10/2001 12:00:00 AM,130500,130500,126100,126100,5900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2001 12:00:00 AM,121700,123000,120200,123000,15800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2001 12:00:00 AM,123500,127400,120600,127400,7000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2001 12:00:00 AM,125500,127500,124100,124600,6100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2001 12:00:00 AM,122800,124800,122600,122600,2300,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2001 12:00:00 AM,124000,126500,124000,126500,2400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/18/2001 12:00:00 AM,129700,129700,126900,127000,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/19/2001 12:00:00 AM,124100,127300,124100,124900,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2001 12:00:00 AM,127000,128900,126600,126600,1200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/23/2001 12:00:00 AM,134000,134000,132000,132000,4700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2001 12:00:00 AM,128700,131000,128500,129000,3900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2001 12:00:00 AM,126500,128600,126500,127000,3100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2001 12:00:00 AM,128600,130500,128600,130500,93000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2001 12:00:00 AM,129000,129000,127200,127200,1900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n7/30/2001 12:00:00 AM,133400,133400,131600,132500,3100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2001 12:00:00 AM,131900,131900,127000,127000,2800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2001 12:00:00 AM,130000,130000,127000,129000,234700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2001 12:00:00 AM,125000,128000,125000,128000,22000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2001 12:00:00 AM,126500,128200,126500,128200,2300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2001 12:00:00 AM,130600,132600,129800,132600,3200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2001 12:00:00 AM,132000,132900,129100,132300,2200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/8/2001 12:00:00 AM,131700,131700,131700,131700,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/9/2001 12:00:00 AM,128900,131200,128900,131200,400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2001 12:00:00 AM,129000,129000,128100,128200,5200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/13/2001 12:00:00 AM,128300,128500,127000,128400,9100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/14/2001 12:00:00 AM,127500,127500,124700,125700,20400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2001 12:00:00 AM,125700,125700,125700,125700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/16/2001 12:00:00 AM,127000,127000,125600,125600,2400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2001 12:00:00 AM,124000,124400,123400,123400,4000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2001 12:00:00 AM,123000,123200,122200,123200,5000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2001 12:00:00 AM,122500,122500,117600,119000,23100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2001 12:00:00 AM,123200,123400,120100,122300,3900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2001 12:00:00 AM,123000,123000,123000,123000,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/24/2001 12:00:00 AM,113000,116300,112200,116300,22300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2001 12:00:00 AM,113000,114000,111700,113400,15900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/28/2001 12:00:00 AM,112100,112100,112100,112100,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/29/2001 12:00:00 AM,112500,115700,112500,113100,5800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n8/30/2001 12:00:00 AM,113100,113100,110900,111000,238300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2001 12:00:00 AM,111400,111500,110800,110800,1500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/4/2001 12:00:00 AM,112500,112500,110000,110700,32300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2001 12:00:00 AM,109000,109100,109000,109100,15800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/6/2001 12:00:00 AM,109000,109000,109000,109000,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/7/2001 12:00:00 AM,108000,108100,107900,107900,52400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/10/2001 12:00:00 AM,104000,106600,104000,106600,52500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2001 12:00:00 AM,90000,94300,90000,92000,141600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2001 12:00:00 AM,95000,96000,92000,95700,30200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2001 12:00:00 AM,93500,93700,93300,93300,2300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/20/2001 12:00:00 AM,94700,94700,90700,90700,135800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2001 12:00:00 AM,85000,88300,85000,88200,6100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2001 12:00:00 AM,91000,92400,91000,91000,2400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n9/25/2001 12:00:00 AM,91800,92000,88800,88800,1600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2001 12:00:00 AM,90000,90000,84000,84000,9600,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2001 12:00:00 AM,86900,89800,84400,88700,53000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2001 12:00:00 AM,93500,93500,91700,92000,800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/1/2001 12:00:00 AM,90200,90200,90200,90200,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/2/2001 12:00:00 AM,90000,90000,90000,90000,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/3/2001 12:00:00 AM,90000,90000,88200,89700,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2001 12:00:00 AM,89000,89000,87800,88000,102900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/5/2001 12:00:00 AM,87600,88500,87600,88000,23600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2001 12:00:00 AM,85500,88600,85500,88300,23600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2001 12:00:00 AM,88500,88600,86400,88600,2500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n10/10/2001 12:00:00 AM,85700,91400,85700,88800,400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2001 12:00:00 AM,91700,92100,91700,92100,3100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/12/2001 12:00:00 AM,92100,92100,92100,92100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/15/2001 12:00:00 AM,92900,93700,92900,93700,60200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/16/2001 12:00:00 AM,93700,95600,93700,95500,115900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2001 12:00:00 AM,97500,97500,96500,96500,1300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/18/2001 12:00:00 AM,95000,95000,94900,94900,1400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/19/2001 12:00:00 AM,93000,94900,93000,94900,75000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2001 12:00:00 AM,95000,95500,95000,95500,51400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/23/2001 12:00:00 AM,95500,99400,95500,98300,7600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2001 12:00:00 AM,97000,97400,95900,95900,3400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2001 12:00:00 AM,98600,98600,98600,98600,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/26/2001 12:00:00 AM,98600,98600,98500,98600,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n10/29/2001 12:00:00 AM,99000,99000,95100,95100,356900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2001 12:00:00 AM,94100,94100,93500,93500,600,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/31/2001 12:00:00 AM,95900,95900,95000,95000,6700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/1/2001 12:00:00 AM,96400,97900,96400,96700,4700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n11/2/2001 12:00:00 AM,93500,96700,93500,96600,1200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2001 12:00:00 AM,102100,105900,100500,105900,21500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2001 12:00:00 AM,105800,106100,105100,106100,10300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2001 12:00:00 AM,105000,112200,105000,110000,44100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2001 12:00:00 AM,111900,113500,110000,110000,19000,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2001 12:00:00 AM,110400,111500,110300,111500,11300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/12/2001 12:00:00 AM,107000,109900,105900,108700,14800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2001 12:00:00 AM,112500,113400,112500,113400,7600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/14/2001 12:00:00 AM,111500,112000,110000,111000,11900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2001 12:00:00 AM,107500,111000,107500,111000,4300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2001 12:00:00 AM,112000,112000,110500,111500,15200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2001 12:00:00 AM,115400,115400,111100,112900,2400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2001 12:00:00 AM,111500,112400,108100,108100,238000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2001 12:00:00 AM,111500,111500,109500,109500,65900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/23/2001 12:00:00 AM,113000,114900,113000,114900,1600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2001 12:00:00 AM,115600,119900,115600,119900,6400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2001 12:00:00 AM,119000,119900,118400,119800,18900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2001 12:00:00 AM,116600,116600,113400,114900,64800,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2001 12:00:00 AM,113000,113500,111000,111100,49400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2001 12:00:00 AM,110000,113900,108000,112900,29800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2001 12:00:00 AM,113000,118200,113000,116400,757400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2001 12:00:00 AM,120000,120900,118000,118400,13800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2001 12:00:00 AM,120100,120800,117700,120400,26500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/6/2001 12:00:00 AM,120700,122500,120700,122300,7100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/7/2001 12:00:00 AM,122000,124300,122000,122400,156200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2001 12:00:00 AM,123000,123900,121200,123900,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2001 12:00:00 AM,123500,124900,122000,123900,120600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/12/2001 12:00:00 AM,124000,124100,122100,124000,403000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n12/13/2001 12:00:00 AM,118000,122200,118000,119000,146400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2001 12:00:00 AM,119100,119100,118400,118500,1800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/17/2001 12:00:00 AM,118200,120000,118200,119900,8400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2001 12:00:00 AM,119600,121500,119600,121500,11100,0,0,0,0,100,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2001 12:00:00 AM,124800,124900,124200,124700,1100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,100,0,0,0,0,0,0\n12/20/2001 12:00:00 AM,123500,123500,120000,120000,35200,0,0,0,0,0,0,0,-100,0,-100,0,-100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2001 12:00:00 AM,120000,122400,119000,122400,3400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2001 12:00:00 AM,122400,122400,122400,122400,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2001 12:00:00 AM,122500,123400,122500,123400,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2001 12:00:00 AM,125800,126000,124800,126000,22200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2001 12:00:00 AM,129700,129700,127700,127700,27700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2001 12:00:00 AM,127200,127600,127000,127000,9100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2002 12:00:00 AM,131000,131700,129300,129600,51900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2002 12:00:00 AM,133500,134500,132000,132900,72400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/4/2002 12:00:00 AM,133000,133500,131900,131900,16100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2002 12:00:00 AM,128600,130500,128600,130500,38400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2002 12:00:00 AM,130000,131300,129900,129900,36200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2002 12:00:00 AM,127500,128800,126000,128000,21600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/10/2002 12:00:00 AM,125000,125100,119100,119100,65700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2002 12:00:00 AM,125000,125000,120900,123200,95100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2002 12:00:00 AM,118000,119600,117000,117000,42700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2002 12:00:00 AM,120000,120000,117500,117500,5700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2002 12:00:00 AM,118200,120100,118200,118700,34900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2002 12:00:00 AM,122500,122500,119300,121400,1037800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2002 12:00:00 AM,122100,123000,122100,122900,4600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/22/2002 12:00:00 AM,120900,120900,120100,120100,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/23/2002 12:00:00 AM,120000,120000,119400,119700,8200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/24/2002 12:00:00 AM,120000,120300,119400,119400,10900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/25/2002 12:00:00 AM,117500,119900,117100,119800,20300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2002 12:00:00 AM,117400,118000,117200,118000,800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/29/2002 12:00:00 AM,118900,118900,113100,114900,14700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2002 12:00:00 AM,116000,116000,111700,114900,19900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2002 12:00:00 AM,115800,115800,115500,115500,3900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/1/2002 12:00:00 AM,115000,116900,115000,115700,3800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2002 12:00:00 AM,115700,125000,112800,114200,10900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2002 12:00:00 AM,115400,115400,115200,115200,1700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/6/2002 12:00:00 AM,115300,117000,115300,116000,4600,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2002 12:00:00 AM,116000,116000,114200,115000,10800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0\n2/8/2002 12:00:00 AM,115500,115500,114100,114100,1400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2002 12:00:00 AM,116000,116000,115000,115000,1500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/12/2002 12:00:00 AM,115100,116100,115100,115200,47500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/13/2002 12:00:00 AM,116600,120000,116600,120000,13500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2002 12:00:00 AM,117200,121400,117000,121400,12600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2002 12:00:00 AM,120000,122000,120000,121500,48200,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2002 12:00:00 AM,121000,121500,119900,119900,208900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/20/2002 12:00:00 AM,120400,122600,118400,121900,49200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2002 12:00:00 AM,123300,123900,122400,123400,19800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/22/2002 12:00:00 AM,125500,126100,123000,126000,117800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2002 12:00:00 AM,128000,131000,127700,131000,135000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2002 12:00:00 AM,131000,131000,129100,129100,112500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2002 12:00:00 AM,132000,135000,130100,135000,257300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2002 12:00:00 AM,135000,137000,134000,136500,1579300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2002 12:00:00 AM,137000,139400,135800,139400,1123300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2002 12:00:00 AM,139100,140000,135000,140000,898300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2002 12:00:00 AM,142500,142500,133100,135000,208700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2002 12:00:00 AM,131500,131500,128100,129500,1029400,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2002 12:00:00 AM,131600,131900,127600,129800,1023400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2002 12:00:00 AM,131300,132000,129600,131000,230600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/11/2002 12:00:00 AM,132000,132000,128600,129800,243200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2002 12:00:00 AM,130000,135600,130000,135600,986800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2002 12:00:00 AM,137000,137000,134700,135000,296100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/14/2002 12:00:00 AM,136000,136300,134900,136000,5632200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n3/15/2002 12:00:00 AM,135500,137400,134500,136800,236000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2002 12:00:00 AM,141500,141500,136600,137800,683100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2002 12:00:00 AM,136900,137000,135000,136000,492100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2002 12:00:00 AM,136700,136700,132000,133100,1243300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2002 12:00:00 AM,133300,133300,131600,132100,777000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/22/2002 12:00:00 AM,130500,131100,128100,128200,234200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2002 12:00:00 AM,129500,129700,125500,126100,100500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2002 12:00:00 AM,127800,131100,127800,130000,716400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2002 12:00:00 AM,130100,134800,129600,134800,252500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2002 12:00:00 AM,133500,134000,131900,132300,765600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2002 12:00:00 AM,130500,138000,130000,138000,1627300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2002 12:00:00 AM,138500,138500,134300,134300,469700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2002 12:00:00 AM,134100,134100,130900,130900,548000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2002 12:00:00 AM,131500,134400,131500,134000,1012900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2002 12:00:00 AM,135700,136900,134000,134000,481900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2002 12:00:00 AM,135500,135600,132800,133200,754100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2002 12:00:00 AM,134500,135400,133000,134800,301200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/10/2002 12:00:00 AM,135800,137100,133700,136900,412800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2002 12:00:00 AM,136900,138300,133400,134900,122200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2002 12:00:00 AM,137800,137900,134000,137500,308900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/15/2002 12:00:00 AM,138500,138500,134000,136100,2133200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2002 12:00:00 AM,135300,137900,135300,137000,1662500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2002 12:00:00 AM,138600,139000,136900,137100,902800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/18/2002 12:00:00 AM,136300,136400,134800,136400,903000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/19/2002 12:00:00 AM,138500,138500,134500,135000,67300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2002 12:00:00 AM,135100,135100,130000,132600,800400,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2002 12:00:00 AM,133200,134400,131300,133400,1070200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/24/2002 12:00:00 AM,135000,135000,132600,134000,517500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2002 12:00:00 AM,131000,132500,131000,132400,1772100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/26/2002 12:00:00 AM,133500,133500,128600,130000,1529000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2002 12:00:00 AM,129500,131100,129500,129500,759300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2002 12:00:00 AM,129700,132900,129700,130500,969300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/1/2002 12:00:00 AM,132500,132500,129000,130600,577600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2002 12:00:00 AM,129500,130000,124300,125500,1355000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2002 12:00:00 AM,125900,126000,120000,123600,733600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2002 12:00:00 AM,120200,121500,120000,121000,2309000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/7/2002 12:00:00 AM,124900,124900,119500,120800,514100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2002 12:00:00 AM,122100,125000,122000,124900,70600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2002 12:00:00 AM,124000,124000,116000,118500,85100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2002 12:00:00 AM,115400,118000,115400,117100,631300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2002 12:00:00 AM,116000,118000,114100,114500,690200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2002 12:00:00 AM,115000,118100,115000,116400,305700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2002 12:00:00 AM,114700,119000,114700,117500,428300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2002 12:00:00 AM,118000,123200,118000,121800,527200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2002 12:00:00 AM,122000,122000,120100,121200,627500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2002 12:00:00 AM,123000,123000,121000,121200,498200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/21/2002 12:00:00 AM,123200,123200,120600,121000,416900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/22/2002 12:00:00 AM,121100,121900,117500,118700,395500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2002 12:00:00 AM,117500,119900,117300,119700,202400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/24/2002 12:00:00 AM,120800,121100,119300,120700,65800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n5/28/2002 12:00:00 AM,121800,122300,119500,121000,55200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2002 12:00:00 AM,122300,122800,120200,122400,86200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/30/2002 12:00:00 AM,122000,122000,120600,122000,35500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n5/31/2002 12:00:00 AM,125000,125000,120900,121000,30700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2002 12:00:00 AM,121100,121100,118000,118500,287900,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2002 12:00:00 AM,117500,117500,115100,116400,290300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2002 12:00:00 AM,116800,116800,114100,115500,316300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2002 12:00:00 AM,113800,114000,108000,110000,282000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2002 12:00:00 AM,106900,111400,106800,111000,178100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n6/10/2002 12:00:00 AM,112000,113200,111000,113200,411300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2002 12:00:00 AM,114300,114300,107000,107000,196900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2002 12:00:00 AM,105000,108300,102700,105500,1483300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/13/2002 12:00:00 AM,106400,109000,104600,105100,1171800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2002 12:00:00 AM,102600,103400,101000,102500,1547800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/17/2002 12:00:00 AM,101500,106400,101500,106400,982800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2002 12:00:00 AM,106700,106800,103100,104000,87200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2002 12:00:00 AM,104000,104000,100600,100600,193700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2002 12:00:00 AM,100500,100500,94000,94000,297900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2002 12:00:00 AM,93600,93600,86700,87500,445700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2002 12:00:00 AM,90000,90500,85600,90200,2653200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n6/25/2002 12:00:00 AM,91500,93900,88900,90300,946100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/26/2002 12:00:00 AM,90500,90900,85500,89000,513500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2002 12:00:00 AM,92500,93800,90500,93800,557600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2002 12:00:00 AM,94800,97000,94300,97000,550200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/1/2002 12:00:00 AM,97500,97500,91500,91600,184700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2002 12:00:00 AM,91200,92600,90400,92000,159800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0\n7/3/2002 12:00:00 AM,93000,94000,90500,92400,37800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/5/2002 12:00:00 AM,91500,91500,90200,90700,26200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/8/2002 12:00:00 AM,90000,91200,90000,90500,1562300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/9/2002 12:00:00 AM,91800,92000,90100,90700,1285500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/10/2002 12:00:00 AM,93500,93500,90100,90300,96200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2002 12:00:00 AM,91000,92000,89500,92000,288400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2002 12:00:00 AM,94500,94900,92600,94900,2409100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2002 12:00:00 AM,93500,93500,87900,90100,132500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2002 12:00:00 AM,91000,91000,88000,88200,522800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2002 12:00:00 AM,90000,91500,89500,90300,119300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/18/2002 12:00:00 AM,91500,92500,90500,92500,45900,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2002 12:00:00 AM,90400,92400,90300,90300,40700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2002 12:00:00 AM,88200,91000,85200,85900,37500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2002 12:00:00 AM,87000,87000,81100,82000,102100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2002 12:00:00 AM,78200,85000,77600,83500,800000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n7/25/2002 12:00:00 AM,80000,81400,77100,78800,744000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/26/2002 12:00:00 AM,79300,79300,74800,75500,86400,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2002 12:00:00 AM,75500,75900,68500,69500,1986200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2002 12:00:00 AM,69000,70400,66000,67400,1841500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2002 12:00:00 AM,69100,70400,65000,69800,1816500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2002 12:00:00 AM,69800,74900,67700,73900,1432600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2002 12:00:00 AM,77300,79300,74600,78000,2055000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/5/2002 12:00:00 AM,80500,80500,73800,73800,164700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2002 12:00:00 AM,73500,77000,72100,76900,655000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n8/7/2002 12:00:00 AM,79400,79400,76100,78700,777800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2002 12:00:00 AM,87400,89200,85000,86000,1037200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2002 12:00:00 AM,83900,83900,80600,81500,129300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/12/2002 12:00:00 AM,80400,80400,75500,76100,73700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2002 12:00:00 AM,73900,75900,72100,73600,221500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/14/2002 12:00:00 AM,74100,74100,70000,73500,219500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2002 12:00:00 AM,74000,74300,70500,71500,61000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2002 12:00:00 AM,71500,76500,70700,76000,260400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2002 12:00:00 AM,75800,76500,72500,74800,338300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2002 12:00:00 AM,77300,77400,73600,73700,64300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2002 12:00:00 AM,74200,76300,74000,74500,167700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2002 12:00:00 AM,75300,75700,73600,75700,9200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/23/2002 12:00:00 AM,76500,78000,75600,77200,237000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2002 12:00:00 AM,77300,78900,76000,77800,193500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/27/2002 12:00:00 AM,81000,82400,78800,79200,245900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2002 12:00:00 AM,80400,80700,77300,78500,56300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2002 12:00:00 AM,76200,81000,76000,80800,65900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2002 12:00:00 AM,80700,83300,79600,80500,176200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/3/2002 12:00:00 AM,80500,80500,76700,76700,1207600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2002 12:00:00 AM,78400,78400,76200,77700,16200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2002 12:00:00 AM,78800,78800,73700,73700,7900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2002 12:00:00 AM,76200,76200,74400,75300,14300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2002 12:00:00 AM,76000,78800,75300,78400,15400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2002 12:00:00 AM,80400,80400,78000,78000,65300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2002 12:00:00 AM,81200,82000,80200,81700,568300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2002 12:00:00 AM,81300,81300,79000,81000,93900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0\n9/13/2002 12:00:00 AM,79800,81500,78600,80500,5200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/16/2002 12:00:00 AM,78800,78800,77400,77400,135200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/17/2002 12:00:00 AM,77500,78400,74500,74500,182800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2002 12:00:00 AM,72500,74400,71200,71700,278300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2002 12:00:00 AM,72000,72000,68300,68500,365900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2002 12:00:00 AM,69100,71300,67600,70900,125100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2002 12:00:00 AM,67000,67000,65100,65900,66900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2002 12:00:00 AM,65200,65900,63100,63100,101100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2002 12:00:00 AM,63200,65000,61600,63000,448700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/26/2002 12:00:00 AM,62700,64500,61600,62200,111200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/27/2002 12:00:00 AM,61000,61000,57700,57900,669200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2002 12:00:00 AM,55200,58400,54000,57900,534500,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2002 12:00:00 AM,58500,63900,58100,63900,219000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2002 12:00:00 AM,64100,65900,62100,63200,285700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/3/2002 12:00:00 AM,62300,64600,61100,64300,319400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2002 12:00:00 AM,65900,65900,63600,65000,378900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2002 12:00:00 AM,62000,63900,61100,61100,2522300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2002 12:00:00 AM,60200,62400,59600,62400,127100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2002 12:00:00 AM,58500,59500,58000,58200,129600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2002 12:00:00 AM,58900,60000,57000,57000,321300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2002 12:00:00 AM,59400,62400,58100,60400,44300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/14/2002 12:00:00 AM,58000,58800,56500,56500,43500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2002 12:00:00 AM,58500,58900,55200,56600,87500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2002 12:00:00 AM,57000,57000,53500,53500,241800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2002 12:00:00 AM,54500,59400,54500,59300,330800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2002 12:00:00 AM,58600,60500,58600,59900,303500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/21/2002 12:00:00 AM,60800,60800,58000,60000,24900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2002 12:00:00 AM,57600,61900,57500,61500,43600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2002 12:00:00 AM,62000,64500,61900,64100,396700,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2002 12:00:00 AM,65000,68000,65000,67000,377900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2002 12:00:00 AM,68700,70900,66800,70900,875800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2002 12:00:00 AM,72000,73900,66700,66700,811300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2002 12:00:00 AM,67200,67200,64600,66500,394900,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2002 12:00:00 AM,68800,71600,68800,71300,333400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/31/2002 12:00:00 AM,73100,74700,73100,74300,1349100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/1/2002 12:00:00 AM,74400,76100,73900,74000,41900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2002 12:00:00 AM,76000,78900,73100,73200,1225300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2002 12:00:00 AM,73100,74800,72200,72600,98400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2002 12:00:00 AM,70200,71900,68100,68700,795800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2002 12:00:00 AM,70100,72100,69600,71900,36500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0\n11/8/2002 12:00:00 AM,73600,74400,72800,73500,50100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/11/2002 12:00:00 AM,74000,74000,72300,73000,8100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/12/2002 12:00:00 AM,72200,73000,70100,70200,9400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2002 12:00:00 AM,71000,71000,69200,70400,12500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2002 12:00:00 AM,71300,71300,69000,70700,29500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2002 12:00:00 AM,71400,71400,68200,70100,6300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2002 12:00:00 AM,73000,75200,72600,74800,37800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2002 12:00:00 AM,73100,74700,73100,74400,48600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2002 12:00:00 AM,73900,75400,72100,75400,123500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2002 12:00:00 AM,75500,76500,75000,76500,45900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,0,0,0,0,0,0\n11/22/2002 12:00:00 AM,73200,76700,73200,76700,8500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2002 12:00:00 AM,76500,76900,75200,76100,1008500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2002 12:00:00 AM,75500,75500,72500,72600,10400,0,0,-100,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2002 12:00:00 AM,73500,75300,72100,75300,24300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2002 12:00:00 AM,75000,75000,73100,73100,6000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2002 12:00:00 AM,76900,77000,74500,74600,18000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2002 12:00:00 AM,75900,75900,73500,75100,336600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2002 12:00:00 AM,72600,74400,72600,73700,180600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2002 12:00:00 AM,74100,74200,71000,72000,163500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2002 12:00:00 AM,71000,73900,71000,73900,23000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2002 12:00:00 AM,72000,72800,70500,70500,37200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2002 12:00:00 AM,71200,73500,71200,73300,11700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2002 12:00:00 AM,74300,74400,72500,74000,81600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2002 12:00:00 AM,74900,74900,72600,74000,56600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2002 12:00:00 AM,73200,75900,73000,75900,32000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2002 12:00:00 AM,75500,78400,75000,77900,230500,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2002 12:00:00 AM,79000,79900,78000,78300,151200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2002 12:00:00 AM,80000,80500,77300,80500,115300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2002 12:00:00 AM,80900,84000,80900,82900,97000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2002 12:00:00 AM,83500,86900,83500,85000,295500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/23/2002 12:00:00 AM,86000,86900,80100,81000,681600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2002 12:00:00 AM,79500,83400,79500,83300,5800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n12/26/2002 12:00:00 AM,82800,82900,81400,81500,3300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/27/2002 12:00:00 AM,83000,83000,80000,81400,28000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2002 12:00:00 AM,78900,80900,78800,80800,81400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/31/2002 12:00:00 AM,80800,80900,79600,79800,4000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/2/2003 12:00:00 AM,81100,82900,79700,80500,135700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/3/2003 12:00:00 AM,84800,84800,81600,83300,322300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2003 12:00:00 AM,88500,88500,86400,87800,166800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2003 12:00:00 AM,87400,87500,86100,86500,33700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/8/2003 12:00:00 AM,86300,87000,83700,83700,44700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2003 12:00:00 AM,87500,87600,85200,87200,216700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2003 12:00:00 AM,88200,89900,87600,89900,98400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2003 12:00:00 AM,89300,90400,88500,90000,203800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2003 12:00:00 AM,90300,90300,88800,89900,21300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2003 12:00:00 AM,89500,89500,86900,87000,43800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2003 12:00:00 AM,87800,89400,87400,87900,30700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/17/2003 12:00:00 AM,85500,85500,84200,84200,349700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2003 12:00:00 AM,80900,82100,80100,80300,179400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2003 12:00:00 AM,79100,79900,78000,78000,293000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2003 12:00:00 AM,79400,79400,77100,77100,283000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2003 12:00:00 AM,75600,76000,73000,73500,101800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2003 12:00:00 AM,70100,72800,70100,72300,183600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2003 12:00:00 AM,72500,73300,72000,73200,163300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2003 12:00:00 AM,73200,77100,73200,76700,225500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2003 12:00:00 AM,77100,77100,74500,76400,74800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2003 12:00:00 AM,76600,79000,76600,78700,230700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2003 12:00:00 AM,78700,79300,78000,78300,139600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2003 12:00:00 AM,77400,77400,75900,75900,38300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/5/2003 12:00:00 AM,77000,77000,76200,76900,8000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/6/2003 12:00:00 AM,75500,75500,74300,75100,70300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2003 12:00:00 AM,76500,77600,75300,75600,11500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2003 12:00:00 AM,73600,76100,73600,75000,123700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2003 12:00:00 AM,77300,77700,75700,75800,104100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2003 12:00:00 AM,75300,75900,75300,75500,16100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2003 12:00:00 AM,73300,74400,72500,73400,63100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/14/2003 12:00:00 AM,73000,73000,71600,71700,5300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2003 12:00:00 AM,74800,75000,74800,75000,26600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/19/2003 12:00:00 AM,75000,75000,73500,73600,90000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2003 12:00:00 AM,74600,74600,73000,73700,30000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2003 12:00:00 AM,74200,74200,73700,73700,2200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/24/2003 12:00:00 AM,74900,76500,74900,74900,33900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/25/2003 12:00:00 AM,73000,73200,71900,73200,196100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2003 12:00:00 AM,73500,74000,72200,72200,37000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2003 12:00:00 AM,72500,73700,72500,73700,13600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2003 12:00:00 AM,73900,74600,73900,74500,37700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/3/2003 12:00:00 AM,73100,75000,73100,74800,19900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2003 12:00:00 AM,73900,75300,73900,74100,54200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2003 12:00:00 AM,75900,75900,73400,74700,48200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2003 12:00:00 AM,75400,76700,75300,76400,119900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2003 12:00:00 AM,76700,78000,76500,77700,61600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2003 12:00:00 AM,76000,76900,74700,74700,11200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2003 12:00:00 AM,74900,76600,74900,76500,36300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n3/12/2003 12:00:00 AM,77000,78300,76100,78300,58500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2003 12:00:00 AM,78700,80700,78500,80500,147100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2003 12:00:00 AM,81800,81800,79900,80200,144900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2003 12:00:00 AM,79900,81400,79200,80200,402100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/18/2003 12:00:00 AM,81400,81600,80600,81600,121500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2003 12:00:00 AM,81500,82300,80500,80800,76100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2003 12:00:00 AM,79600,81500,79400,81200,75700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2003 12:00:00 AM,83500,83900,82100,83900,593100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2003 12:00:00 AM,82600,82600,81600,81700,160700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/25/2003 12:00:00 AM,82100,83100,81700,83100,285500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n3/26/2003 12:00:00 AM,83700,83700,82700,83400,47800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2003 12:00:00 AM,81600,83300,81200,83300,11900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2003 12:00:00 AM,83500,84100,83100,84100,285800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2003 12:00:00 AM,83700,84000,82100,83500,36200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/1/2003 12:00:00 AM,84900,86500,84200,86500,98100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2003 12:00:00 AM,90600,90600,88300,88900,388200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2003 12:00:00 AM,89900,90500,88700,90100,484500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/4/2003 12:00:00 AM,90400,91100,89200,90900,76500,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2003 12:00:00 AM,95000,95000,92000,92000,167500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2003 12:00:00 AM,92900,92900,89100,89500,144300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2003 12:00:00 AM,89400,90000,88900,89000,242800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2003 12:00:00 AM,88700,89000,87300,87700,15400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2003 12:00:00 AM,88100,89500,87600,88700,83000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2003 12:00:00 AM,89800,90000,88800,89900,242500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/15/2003 12:00:00 AM,90800,92500,90700,92500,296500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2003 12:00:00 AM,92700,94200,92100,92800,260800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/17/2003 12:00:00 AM,94500,95900,94300,95300,93900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2003 12:00:00 AM,98400,98400,95200,96400,71100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2003 12:00:00 AM,94200,96300,93900,96100,70600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2003 12:00:00 AM,96600,97700,96200,97700,71600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/24/2003 12:00:00 AM,97900,97900,95000,95500,82400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2003 12:00:00 AM,95700,95900,94900,95400,26200,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2003 12:00:00 AM,95400,98500,94200,98300,325100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2003 12:00:00 AM,100400,104000,100200,101400,804200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/30/2003 12:00:00 AM,102700,102700,101000,101000,107600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2003 12:00:00 AM,101500,102400,100200,101000,103600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/2/2003 12:00:00 AM,101000,102600,100500,101200,120300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/5/2003 12:00:00 AM,101700,102400,100100,100500,212800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2003 12:00:00 AM,100600,100800,99600,100400,478300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n5/7/2003 12:00:00 AM,102000,103100,101100,103000,355300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2003 12:00:00 AM,103600,104400,102200,103400,84200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/9/2003 12:00:00 AM,106000,106700,104400,106700,120700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2003 12:00:00 AM,106500,108500,106100,108000,238200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2003 12:00:00 AM,109400,109900,108000,108600,132000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/14/2003 12:00:00 AM,109100,109100,106500,107200,46400,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2003 12:00:00 AM,105600,106300,102700,103600,256500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2003 12:00:00 AM,102500,104800,101200,104700,96500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2003 12:00:00 AM,101900,102900,99600,99600,280800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2003 12:00:00 AM,98500,100000,98000,99900,168000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n5/21/2003 12:00:00 AM,101800,102400,99100,102000,41000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2003 12:00:00 AM,102800,104200,102000,103600,1499200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2003 12:00:00 AM,104300,105600,103800,105200,165400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/27/2003 12:00:00 AM,99400,103400,99400,103400,323900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2003 12:00:00 AM,104200,104800,103100,103700,408500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/29/2003 12:00:00 AM,104900,107300,104900,105800,794900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/30/2003 12:00:00 AM,106000,107400,104400,106200,195300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/2/2003 12:00:00 AM,105400,106500,103000,103500,51300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2003 12:00:00 AM,103400,105700,103000,105000,82600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2003 12:00:00 AM,107300,109800,106900,108700,328800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2003 12:00:00 AM,109800,110900,107800,110100,333200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/6/2003 12:00:00 AM,112900,113500,110500,110600,127800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2003 12:00:00 AM,111900,111900,109500,111000,107600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2003 12:00:00 AM,112100,113400,109300,110600,175600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2003 12:00:00 AM,110300,111400,108600,111100,129400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2003 12:00:00 AM,110800,112400,109600,111900,117900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2003 12:00:00 AM,113300,113300,110900,110900,71900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2003 12:00:00 AM,112000,112400,110100,111300,589300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2003 12:00:00 AM,112400,112500,110100,110600,52500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2003 12:00:00 AM,111000,111000,107100,107800,74100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2003 12:00:00 AM,106500,109500,106500,107400,147200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2003 12:00:00 AM,107400,108400,105700,106700,78900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/23/2003 12:00:00 AM,105700,106900,105100,105900,673900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/24/2003 12:00:00 AM,105300,107700,105100,105400,167800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/25/2003 12:00:00 AM,106100,108700,105900,105900,114800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,100,0,0,0\n6/26/2003 12:00:00 AM,106900,106900,105200,106700,32200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n6/27/2003 12:00:00 AM,106700,107200,105400,106100,30800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/30/2003 12:00:00 AM,106000,107500,105600,106100,136800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/1/2003 12:00:00 AM,105700,107900,105400,107900,21000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2003 12:00:00 AM,109300,110900,109300,110000,21000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/3/2003 12:00:00 AM,109700,109700,108300,108400,61400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2003 12:00:00 AM,109000,111000,108900,109900,161800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2003 12:00:00 AM,109200,111400,109200,110800,41300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2003 12:00:00 AM,110400,112300,110100,111300,91600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2003 12:00:00 AM,109800,110700,109300,109600,19000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/11/2003 12:00:00 AM,109900,110400,108300,108500,33400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2003 12:00:00 AM,110500,111300,108000,111100,131400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2003 12:00:00 AM,112400,113200,111300,112100,131400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/16/2003 12:00:00 AM,112100,112100,110500,111400,13900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2003 12:00:00 AM,110700,111400,109400,110000,155300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2003 12:00:00 AM,110200,111400,110200,111200,54100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n7/21/2003 12:00:00 AM,111000,111500,109800,110800,56800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/22/2003 12:00:00 AM,111300,113400,111300,113200,54300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2003 12:00:00 AM,113500,113500,111200,111300,60500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2003 12:00:00 AM,112400,113500,111700,111700,49100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2003 12:00:00 AM,113500,113700,111900,113100,23800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2003 12:00:00 AM,113100,113100,112100,112600,15200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/29/2003 12:00:00 AM,112500,112500,110800,111200,37900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2003 12:00:00 AM,111300,111300,108700,108700,48400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2003 12:00:00 AM,109600,109900,108600,109200,1227000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2003 12:00:00 AM,109500,109500,104800,104800,108700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2003 12:00:00 AM,102200,102300,98700,101900,499200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2003 12:00:00 AM,102000,104100,102000,103300,1351600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2003 12:00:00 AM,104900,104900,101900,102400,22900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2003 12:00:00 AM,105000,107800,103500,107000,90700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2003 12:00:00 AM,108400,109400,106800,109400,55600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2003 12:00:00 AM,110100,110100,108000,108400,14000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2003 12:00:00 AM,109200,109500,109100,109100,24600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/13/2003 12:00:00 AM,109400,109600,107800,108700,55700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2003 12:00:00 AM,108800,112000,107600,111500,35900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2003 12:00:00 AM,113600,113800,112000,112000,279500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/18/2003 12:00:00 AM,113400,113800,112700,113300,63200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n8/19/2003 12:00:00 AM,113900,114900,113300,114900,119400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2003 12:00:00 AM,113400,116200,111500,115500,1105200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2003 12:00:00 AM,115700,117000,114700,117000,921200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2003 12:00:00 AM,117700,117900,115300,117100,1528200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2003 12:00:00 AM,117000,117100,115800,115900,161500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/26/2003 12:00:00 AM,116300,118200,115600,117800,297100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2003 12:00:00 AM,118400,120600,118400,120600,1056200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2003 12:00:00 AM,121800,123100,120100,121500,140900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/29/2003 12:00:00 AM,122000,122700,120300,122600,83600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2003 12:00:00 AM,123300,126200,122800,125500,1124100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2003 12:00:00 AM,125000,127100,125000,125300,93300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2003 12:00:00 AM,127000,129200,126900,128900,1105600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2003 12:00:00 AM,129600,132000,128500,131200,948000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2003 12:00:00 AM,132400,132900,129700,129900,529500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2003 12:00:00 AM,130000,130000,125000,127500,674000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2003 12:00:00 AM,126500,129400,125100,126600,1330400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/11/2003 12:00:00 AM,131200,131200,129200,130000,1127400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/12/2003 12:00:00 AM,132400,133000,128600,132200,202100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/15/2003 12:00:00 AM,131500,132000,128600,130500,148500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2003 12:00:00 AM,132700,132700,128100,128300,120100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2003 12:00:00 AM,130300,130600,127700,129400,326100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2003 12:00:00 AM,130800,132800,129800,132300,1273100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0\n9/19/2003 12:00:00 AM,134400,134400,130600,131700,134400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2003 12:00:00 AM,130800,131000,128100,129700,270500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2003 12:00:00 AM,129800,129800,125600,126300,944900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2003 12:00:00 AM,126700,128200,122000,124300,376300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2003 12:00:00 AM,127100,127100,121300,121300,163900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2003 12:00:00 AM,121900,124900,121700,123000,286600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2003 12:00:00 AM,122900,124500,122900,124400,39500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/30/2003 12:00:00 AM,125800,127700,124400,126900,155800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2003 12:00:00 AM,128700,130500,127200,130500,860600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2003 12:00:00 AM,131500,135200,131500,134500,936200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2003 12:00:00 AM,135700,139000,135300,136800,1138000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2003 12:00:00 AM,136700,139500,136000,138900,776600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/7/2003 12:00:00 AM,138500,140000,138000,140000,184400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/8/2003 12:00:00 AM,145500,145500,141000,141000,373300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2003 12:00:00 AM,142000,144100,139900,141500,263600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/10/2003 12:00:00 AM,141700,142200,139500,142100,93600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0\n10/13/2003 12:00:00 AM,142400,144900,141500,143800,2443500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2003 12:00:00 AM,145600,145600,143300,144000,892700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/15/2003 12:00:00 AM,145000,146100,140500,141400,432100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2003 12:00:00 AM,141700,142900,140000,140500,289700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2003 12:00:00 AM,138700,140500,138200,139500,397400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2003 12:00:00 AM,140000,142100,138100,140900,1334000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/21/2003 12:00:00 AM,142100,143500,141100,142800,640600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2003 12:00:00 AM,142700,142700,140500,140900,214200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2003 12:00:00 AM,138200,138400,135100,136100,870000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2003 12:00:00 AM,136300,138300,135100,137900,523300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2003 12:00:00 AM,138300,138300,136000,137700,116600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2003 12:00:00 AM,139000,144900,139000,141600,517900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2003 12:00:00 AM,140800,141700,140200,140300,691100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/30/2003 12:00:00 AM,140100,141200,138000,141200,532800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2003 12:00:00 AM,141200,141200,138100,139700,147200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2003 12:00:00 AM,141200,143900,140400,143000,1495900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2003 12:00:00 AM,143000,144800,142100,143400,125000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/5/2003 12:00:00 AM,142500,142500,140000,140400,624900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2003 12:00:00 AM,141800,141800,139400,140500,1078700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2003 12:00:00 AM,143200,143400,141000,142600,128100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2003 12:00:00 AM,140800,140800,138600,140000,362200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2003 12:00:00 AM,139100,139300,137200,137500,103900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2003 12:00:00 AM,138500,142500,138500,141200,315500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2003 12:00:00 AM,141300,143300,140000,140700,429300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/14/2003 12:00:00 AM,140800,142000,140200,141100,39800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/17/2003 12:00:00 AM,139400,140000,137500,139200,242500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/18/2003 12:00:00 AM,138500,141900,138100,139200,114600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2003 12:00:00 AM,139400,139400,138500,139000,47400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/20/2003 12:00:00 AM,138700,141800,138500,140100,578400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2003 12:00:00 AM,140700,142500,140700,142000,662400,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2003 12:00:00 AM,143000,146200,142900,145900,1433300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2003 12:00:00 AM,145400,146400,143900,146400,1025200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2003 12:00:00 AM,144900,146100,144500,145800,181100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/28/2003 12:00:00 AM,146000,149300,145200,147700,606900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2003 12:00:00 AM,149300,154300,148000,153600,352400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2003 12:00:00 AM,151800,152500,150700,152300,51100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2003 12:00:00 AM,151700,152100,151500,152000,239400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/4/2003 12:00:00 AM,151000,153500,148900,152000,929700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/5/2003 12:00:00 AM,152500,154200,150800,153900,194200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2003 12:00:00 AM,154300,154600,153000,153700,339000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/9/2003 12:00:00 AM,158200,159000,156400,157600,186000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/10/2003 12:00:00 AM,159200,159200,154100,154600,3276000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2003 12:00:00 AM,157400,158500,155800,157500,217700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/12/2003 12:00:00 AM,158600,158700,155500,155900,536000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2003 12:00:00 AM,162400,162400,155400,155800,314700,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2003 12:00:00 AM,158900,159900,154700,156500,75100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2003 12:00:00 AM,157500,159600,156300,159300,701800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0\n12/18/2003 12:00:00 AM,159700,164000,159200,163600,536900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2003 12:00:00 AM,164000,165599,162099,164500,500800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/22/2003 12:00:00 AM,161700,167099,161600,165900,228300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2003 12:00:00 AM,168899,168899,164599,165900,345200,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2003 12:00:00 AM,167400,169000,167400,167700,225300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/26/2003 12:00:00 AM,167099,167099,165800,166299,97100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/29/2003 12:00:00 AM,168200,171700,167800,170900,239000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2003 12:00:00 AM,170300,170700,168400,168500,400400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/31/2003 12:00:00 AM,170400,170499,168600,170000,81000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2004 12:00:00 AM,169800,174800,169500,173300,385000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2004 12:00:00 AM,176900,184000,176100,183500,1518600,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2004 12:00:00 AM,184000,185499,179200,182000,2891700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2004 12:00:00 AM,185400,185400,179800,180200,685600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2004 12:00:00 AM,181500,182800,178200,182300,676200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2004 12:00:00 AM,183600,184599,180499,182999,1802100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/12/2004 12:00:00 AM,186200,187999,185000,187300,1860200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2004 12:00:00 AM,187999,188099,183300,184300,544000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2004 12:00:00 AM,184300,184300,172999,179400,4543700,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2004 12:00:00 AM,176399,179100,173899,175000,821000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2004 12:00:00 AM,173200,176900,172999,175700,1554400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/20/2004 12:00:00 AM,179400,180499,177999,180200,1581000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2004 12:00:00 AM,178400,178400,175700,177000,568000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/22/2004 12:00:00 AM,175800,176500,173400,173799,2558700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/23/2004 12:00:00 AM,174000,176700,173899,176200,840000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n1/26/2004 12:00:00 AM,179599,181399,177800,181399,1284900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2004 12:00:00 AM,180000,180400,177300,179100,860600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2004 12:00:00 AM,180400,180400,172500,172999,1648000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2004 12:00:00 AM,167500,168500,160000,164100,3543200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2004 12:00:00 AM,161200,165000,158000,159600,1551200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2004 12:00:00 AM,157400,161000,155500,160800,3695500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2004 12:00:00 AM,161100,165000,161100,164500,1547500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2004 12:00:00 AM,166200,167500,160200,162000,2699500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2004 12:00:00 AM,161700,162900,156500,157000,1530900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2004 12:00:00 AM,155300,162900,155300,162500,1764800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2004 12:00:00 AM,165400,168400,162500,163500,658200,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2004 12:00:00 AM,165599,166000,163500,166000,1254000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/11/2004 12:00:00 AM,166200,173099,164800,172500,1498200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2004 12:00:00 AM,172999,175000,171600,173300,2452300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/13/2004 12:00:00 AM,175599,175599,166500,168899,1380000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2004 12:00:00 AM,168500,169000,166399,168400,921300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n2/18/2004 12:00:00 AM,170000,170000,165000,165599,610500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2004 12:00:00 AM,161200,163200,157500,157600,880000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2004 12:00:00 AM,151500,161000,150000,161000,2513300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2004 12:00:00 AM,159700,161399,158900,159500,226800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/24/2004 12:00:00 AM,159500,160100,158400,160100,213000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/25/2004 12:00:00 AM,160100,165000,160000,164500,1000400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2004 12:00:00 AM,164200,164400,161399,163799,403000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/27/2004 12:00:00 AM,165100,167400,165100,167000,1930000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/1/2004 12:00:00 AM,170200,174900,170200,173700,1013100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2004 12:00:00 AM,172500,174800,170000,173500,501100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/3/2004 12:00:00 AM,173799,173799,169300,172700,328700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2004 12:00:00 AM,172000,172999,169599,170000,288700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2004 12:00:00 AM,171000,173099,170000,171900,820700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/8/2004 12:00:00 AM,175000,175200,171600,172000,595000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/9/2004 12:00:00 AM,172500,172600,169000,170000,312700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2004 12:00:00 AM,168899,170000,161200,161299,443300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2004 12:00:00 AM,161800,161800,155300,155900,895400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2004 12:00:00 AM,159400,162600,159400,161900,560400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/15/2004 12:00:00 AM,161700,161700,157800,157800,758500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2004 12:00:00 AM,160700,161000,158400,160000,384800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2004 12:00:00 AM,161000,162700,161000,162500,233800,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/18/2004 12:00:00 AM,163099,166800,161299,166100,747800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2004 12:00:00 AM,166399,166399,164000,164500,230200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/22/2004 12:00:00 AM,161200,162500,159400,159400,572400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2004 12:00:00 AM,161200,162500,158200,159500,573000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2004 12:00:00 AM,158600,159300,155700,156000,358500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2004 12:00:00 AM,156000,160000,156000,156700,350200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2004 12:00:00 AM,157400,160000,157300,157600,103800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/29/2004 12:00:00 AM,161500,162900,160100,161500,630900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/30/2004 12:00:00 AM,163300,165900,162099,165400,428900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2004 12:00:00 AM,166100,170000,165400,167999,858300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2004 12:00:00 AM,169400,172099,169400,169900,815500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/2/2004 12:00:00 AM,172600,173099,170200,172500,978000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/5/2004 12:00:00 AM,171500,174300,170800,173300,1039800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2004 12:00:00 AM,172199,173600,171700,173400,132700,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2004 12:00:00 AM,170800,171000,169400,169400,903500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2004 12:00:00 AM,170599,171600,168600,169800,80800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/12/2004 12:00:00 AM,170599,172500,169400,171000,244800,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0\n4/13/2004 12:00:00 AM,172400,172700,167999,168600,201000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2004 12:00:00 AM,165700,166500,165100,166299,542800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/15/2004 12:00:00 AM,164699,164900,159900,161299,444600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2004 12:00:00 AM,161100,163600,161000,162099,738900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2004 12:00:00 AM,162199,162700,159700,160700,278700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2004 12:00:00 AM,160400,160800,155700,155700,492000,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2004 12:00:00 AM,156000,157200,148200,150800,1243600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2004 12:00:00 AM,155600,155600,151500,154700,1574900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2004 12:00:00 AM,155100,159200,155100,158700,603700,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2004 12:00:00 AM,159500,160200,155400,155600,209000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2004 12:00:00 AM,155900,158600,155300,155600,576800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2004 12:00:00 AM,155200,156000,149000,149900,785900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2004 12:00:00 AM,149900,150000,141900,144500,1087000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2004 12:00:00 AM,144500,145000,141500,143000,830000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2004 12:00:00 AM,142300,143500,137700,142100,1421700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/4/2004 12:00:00 AM,144500,146200,143300,144700,768000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/5/2004 12:00:00 AM,147600,148200,144500,146900,801700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2004 12:00:00 AM,143400,144600,139100,139800,919700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2004 12:00:00 AM,135000,137100,132000,133900,1186000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/10/2004 12:00:00 AM,126500,128800,121300,124900,1289500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/11/2004 12:00:00 AM,128000,134400,127500,134300,1062700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2004 12:00:00 AM,133300,133300,126800,130900,887400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2004 12:00:00 AM,127300,133300,127300,131600,1066300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2004 12:00:00 AM,135900,136200,131800,133000,456100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2004 12:00:00 AM,126400,128800,126400,127000,398600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2004 12:00:00 AM,130800,131900,128600,131400,868400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2004 12:00:00 AM,134600,136300,131800,132100,520800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2004 12:00:00 AM,131700,131700,126900,127500,437400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2004 12:00:00 AM,126400,128600,125600,127300,178800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2004 12:00:00 AM,130200,131400,128600,131400,259200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2004 12:00:00 AM,132300,134900,131500,134900,315500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/26/2004 12:00:00 AM,133800,134800,132900,134800,396000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/27/2004 12:00:00 AM,136500,140300,136000,139600,286700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2004 12:00:00 AM,142200,142200,139400,141400,382000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2004 12:00:00 AM,138100,139300,135500,139300,232900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2004 12:00:00 AM,141000,141400,140000,140100,242100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/3/2004 12:00:00 AM,138200,138300,136000,136400,245600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/4/2004 12:00:00 AM,139300,140800,138500,139500,197100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/7/2004 12:00:00 AM,142200,145000,142100,144900,273000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2004 12:00:00 AM,143400,144500,142600,144100,247000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2004 12:00:00 AM,143400,143400,138900,139800,284400,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2004 12:00:00 AM,139600,141400,139300,140600,53900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2004 12:00:00 AM,136100,136200,134600,135200,437600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/15/2004 12:00:00 AM,138100,140300,138100,139300,642800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2004 12:00:00 AM,139900,140900,137900,140800,296800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2004 12:00:00 AM,140300,142300,139000,140300,161400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/18/2004 12:00:00 AM,138800,140600,138800,140400,154400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2004 12:00:00 AM,140100,141800,139000,139000,146600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2004 12:00:00 AM,139900,139900,138000,138600,270500,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/23/2004 12:00:00 AM,140100,144200,139600,143000,656700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2004 12:00:00 AM,145700,145900,144500,144800,411100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/25/2004 12:00:00 AM,144500,146000,144100,144900,387300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2004 12:00:00 AM,144300,144600,141100,141100,212500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2004 12:00:00 AM,142100,144400,142100,144400,106800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2004 12:00:00 AM,143900,147400,143900,147100,308400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2004 12:00:00 AM,148400,149000,146900,149000,279700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2004 12:00:00 AM,150000,151800,150000,151300,172400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2004 12:00:00 AM,149800,150300,147600,147900,393400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2004 12:00:00 AM,148200,150000,147500,149100,131700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2004 12:00:00 AM,148600,149200,146400,146700,720500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2004 12:00:00 AM,147600,148700,147200,148200,121500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2004 12:00:00 AM,148900,151800,148700,151700,121600,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2004 12:00:00 AM,151600,152200,150300,151800,125400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/14/2004 12:00:00 AM,151800,155100,151500,152900,368000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2004 12:00:00 AM,154900,158100,154800,156600,264200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2004 12:00:00 AM,160300,162000,159500,160900,411200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/19/2004 12:00:00 AM,161200,161399,158000,158400,449200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2004 12:00:00 AM,158000,159600,157500,159200,384600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/21/2004 12:00:00 AM,159200,159200,154300,155000,368600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2004 12:00:00 AM,153200,154100,150900,152000,328800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2004 12:00:00 AM,151500,154000,150200,150600,119100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2004 12:00:00 AM,152200,153000,147300,148700,208000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2004 12:00:00 AM,150600,152600,149100,152100,344300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2004 12:00:00 AM,152100,156000,152100,156000,164100,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2004 12:00:00 AM,156900,157500,155400,156900,162200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/30/2004 12:00:00 AM,156800,159800,156800,157500,74500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2004 12:00:00 AM,155400,158000,155000,157000,1013000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2004 12:00:00 AM,156800,157900,156800,157300,191200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/4/2004 12:00:00 AM,156400,158100,155500,156600,1262500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/5/2004 12:00:00 AM,155100,157400,150500,150500,199600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2004 12:00:00 AM,150600,154800,150600,154700,322200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2004 12:00:00 AM,154500,154500,153000,153400,151000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/10/2004 12:00:00 AM,154700,157400,154700,157400,171900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2004 12:00:00 AM,156700,157200,155300,156100,424200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2004 12:00:00 AM,158000,158200,156800,157800,271100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/13/2004 12:00:00 AM,158100,158300,156500,156500,61300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/16/2004 12:00:00 AM,156500,160400,156400,160300,315200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2004 12:00:00 AM,161600,162999,161200,162700,407600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/18/2004 12:00:00 AM,161900,167900,161600,167500,653000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2004 12:00:00 AM,170000,170900,167300,168700,231300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2004 12:00:00 AM,170900,172199,169500,171399,327000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/23/2004 12:00:00 AM,171000,171000,168200,168600,401100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0\n8/24/2004 12:00:00 AM,171000,174500,167500,168200,300500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2004 12:00:00 AM,168899,170599,167500,169699,302100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2004 12:00:00 AM,167800,168799,166000,166200,137500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2004 12:00:00 AM,167500,167800,166500,166500,290000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/30/2004 12:00:00 AM,166800,168899,165000,168899,106800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2004 12:00:00 AM,169599,170499,168400,170200,1602100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2004 12:00:00 AM,169699,170800,167199,168899,432800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/2/2004 12:00:00 AM,167600,170400,167500,170000,286300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2004 12:00:00 AM,170200,171200,169200,169400,323200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2004 12:00:00 AM,171500,173799,171000,173600,115400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2004 12:00:00 AM,173899,174300,172000,172000,692300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2004 12:00:00 AM,172400,172500,169300,171700,382400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2004 12:00:00 AM,170800,170800,169100,169100,764300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2004 12:00:00 AM,169699,171399,168500,168500,272700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2004 12:00:00 AM,168799,172000,168400,172000,176600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2004 12:00:00 AM,172999,174300,172099,172700,481100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/16/2004 12:00:00 AM,174900,176900,173400,176500,291700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2004 12:00:00 AM,178099,179800,177400,179000,202400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2004 12:00:00 AM,182300,182300,179300,179900,381900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2004 12:00:00 AM,180100,181299,178200,180499,198500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/22/2004 12:00:00 AM,180700,180800,176500,178099,1024200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2004 12:00:00 AM,179599,180100,177600,178200,279400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/24/2004 12:00:00 AM,179000,181000,178600,180200,175800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2004 12:00:00 AM,179599,180300,178600,179400,552100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/28/2004 12:00:00 AM,178600,183700,178200,182500,239200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2004 12:00:00 AM,182999,185700,182500,185700,312200,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2004 12:00:00 AM,185100,185900,184200,185400,280300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2004 12:00:00 AM,187000,191600,187000,191200,1403600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2004 12:00:00 AM,193099,195000,192999,194800,1127200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/5/2004 12:00:00 AM,194500,196700,193500,195700,1055100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2004 12:00:00 AM,194800,195100,192999,194200,281500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2004 12:00:00 AM,192700,194100,191500,192999,278000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/8/2004 12:00:00 AM,196000,196100,193300,194000,436900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2004 12:00:00 AM,194800,195000,193400,194699,109700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n10/12/2004 12:00:00 AM,193500,193500,190499,192199,499500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2004 12:00:00 AM,191600,191600,183600,185900,772100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2004 12:00:00 AM,182400,184400,181900,182999,533900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2004 12:00:00 AM,184200,188099,184200,188099,354800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2004 12:00:00 AM,188200,188899,186000,188700,327000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2004 12:00:00 AM,188200,189800,182300,183300,315500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2004 12:00:00 AM,181100,183300,179500,183300,512300,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2004 12:00:00 AM,184300,187600,184300,186900,323400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2004 12:00:00 AM,189900,190000,184100,185000,372500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2004 12:00:00 AM,182500,184200,181900,183799,314800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/26/2004 12:00:00 AM,184000,186200,183300,186200,239900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/27/2004 12:00:00 AM,187300,188700,186000,187800,288400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/28/2004 12:00:00 AM,186200,187300,185000,185700,155700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/29/2004 12:00:00 AM,186500,188300,186100,187900,504200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/1/2004 12:00:00 AM,186700,189400,186600,189300,988700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2004 12:00:00 AM,189900,192000,189300,189500,588100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n11/3/2004 12:00:00 AM,193500,193700,191700,192000,880400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/4/2004 12:00:00 AM,192999,194800,192700,194300,1057800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/5/2004 12:00:00 AM,194699,195599,192800,194000,487400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/8/2004 12:00:00 AM,191600,192300,189100,190800,261900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2004 12:00:00 AM,189500,192099,189500,192099,950500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2004 12:00:00 AM,194200,194599,192900,194000,152000,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/11/2004 12:00:00 AM,193200,194800,192900,194800,611000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2004 12:00:00 AM,195000,199500,195000,199400,547000,0,0,0,0,100,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2004 12:00:00 AM,200000,201000,198500,200000,422400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,-100,0,0,0,0,0,0,0,0\n11/16/2004 12:00:00 AM,197500,197500,194699,195300,545100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2004 12:00:00 AM,200000,200599,199200,200200,212800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/18/2004 12:00:00 AM,199200,199200,195100,197900,192500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2004 12:00:00 AM,197400,197600,194400,196500,786500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2004 12:00:00 AM,197199,201399,195100,201399,222900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2004 12:00:00 AM,200000,200000,198099,198500,232300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/24/2004 12:00:00 AM,199500,200800,198500,199000,248800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2004 12:00:00 AM,202600,206000,202600,205700,257400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2004 12:00:00 AM,204300,205100,202199,202999,799800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2004 12:00:00 AM,206000,208500,205900,208500,721400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2004 12:00:00 AM,210000,212000,209500,211000,541700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2004 12:00:00 AM,210599,210700,207600,208700,414100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2004 12:00:00 AM,211900,212999,211500,212600,1710300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/6/2004 12:00:00 AM,212000,213099,211100,212999,287800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2004 12:00:00 AM,209100,210200,204800,204800,724900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2004 12:00:00 AM,202800,206399,201800,206399,574400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n12/9/2004 12:00:00 AM,201700,202900,197999,200900,1008900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/10/2004 12:00:00 AM,201299,205400,201299,204800,652400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2004 12:00:00 AM,207099,209200,206600,209200,323000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2004 12:00:00 AM,210599,211299,209100,211000,214200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2004 12:00:00 AM,212300,214000,211000,213500,615600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2004 12:00:00 AM,212600,215100,212600,214000,348900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2004 12:00:00 AM,215300,215400,212999,213899,250300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2004 12:00:00 AM,214800,217099,214699,217000,474400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2004 12:00:00 AM,216100,220000,216000,219900,399300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2004 12:00:00 AM,218899,220400,217500,219500,783600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/23/2004 12:00:00 AM,213500,216600,213300,216399,335600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/27/2004 12:00:00 AM,216800,217999,216500,217199,412500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2004 12:00:00 AM,217900,220000,217000,219900,513700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2004 12:00:00 AM,220100,222000,219300,221000,421100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2004 12:00:00 AM,222199,222199,220499,221800,422500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2004 12:00:00 AM,222099,223500,221900,222400,596100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2005 12:00:00 AM,223200,223600,216500,216600,1406500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2005 12:00:00 AM,217099,217099,206000,207300,4280600,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2005 12:00:00 AM,209300,210000,205300,205499,1184800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2005 12:00:00 AM,205100,206100,201399,203700,2300800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2005 12:00:00 AM,207099,208200,203500,206500,1109000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/10/2005 12:00:00 AM,207500,207999,203500,205400,732900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2005 12:00:00 AM,204100,205499,202000,203700,1313100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/12/2005 12:00:00 AM,204500,207000,200599,206000,1468800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2005 12:00:00 AM,206500,209400,206299,208400,581900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/14/2005 12:00:00 AM,207300,211800,207000,211200,845700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2005 12:00:00 AM,205400,207600,204300,206700,1429200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/19/2005 12:00:00 AM,207700,208300,204300,204300,1173100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2005 12:00:00 AM,202800,202800,197999,197999,1628400,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2005 12:00:00 AM,204200,207300,202700,205900,1252000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2005 12:00:00 AM,209000,210499,207900,209400,383200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n1/25/2005 12:00:00 AM,211000,212500,209300,209300,772200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2005 12:00:00 AM,211100,213600,210800,212999,554600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/27/2005 12:00:00 AM,210499,210900,208099,208899,829200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/28/2005 12:00:00 AM,209599,210200,207600,210100,660700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2005 12:00:00 AM,212800,216200,212600,215400,398100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2005 12:00:00 AM,214100,217199,214100,215700,430100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2005 12:00:00 AM,215100,219500,215100,218899,578200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2005 12:00:00 AM,218799,221299,217900,221100,952800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2005 12:00:00 AM,223400,227400,223099,225000,1481100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0\n2/7/2005 12:00:00 AM,227000,229900,226000,229800,642100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2005 12:00:00 AM,228600,231000,228200,230100,704600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2005 12:00:00 AM,227999,232900,227999,231000,684900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2005 12:00:00 AM,229000,230000,227500,229699,834800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2005 12:00:00 AM,230000,233899,228500,232600,597500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2005 12:00:00 AM,235499,237000,234000,235599,880200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/15/2005 12:00:00 AM,235599,236700,235000,235800,646500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/16/2005 12:00:00 AM,233799,236000,232999,235900,580500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2005 12:00:00 AM,238799,241500,238300,239900,800200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2005 12:00:00 AM,239800,241000,237900,238799,723100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2005 12:00:00 AM,238300,244500,237999,238500,1296300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/23/2005 12:00:00 AM,244200,245900,242199,244100,670900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/24/2005 12:00:00 AM,250200,252300,249100,252000,1235100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2005 12:00:00 AM,252099,254800,250900,253799,901800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2005 12:00:00 AM,259900,259900,249300,250599,1389600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2005 12:00:00 AM,248700,250000,242999,244000,1242200,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2005 12:00:00 AM,240700,247800,240700,247400,1195500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2005 12:00:00 AM,250900,252000,245300,248799,1093100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2005 12:00:00 AM,252600,256000,252099,255400,1135100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/7/2005 12:00:00 AM,257600,258500,253899,254599,1081200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/8/2005 12:00:00 AM,251500,252700,248600,250700,782900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/9/2005 12:00:00 AM,247500,250499,242999,243899,804300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2005 12:00:00 AM,243700,244400,237000,240300,1363000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2005 12:00:00 AM,246500,246500,236500,238500,935400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2005 12:00:00 AM,234300,235499,229000,233200,2336500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/15/2005 12:00:00 AM,233099,234400,227500,228400,1174400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2005 12:00:00 AM,226399,232099,226100,231000,1348400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2005 12:00:00 AM,228500,237999,227999,237800,974600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2005 12:00:00 AM,238200,238300,232999,234500,378500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2005 12:00:00 AM,232500,234000,230599,231200,754300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2005 12:00:00 AM,232600,237199,222500,224500,1717200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2005 12:00:00 AM,225800,226800,218799,218799,1369500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2005 12:00:00 AM,223099,226399,222500,223799,1668900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2005 12:00:00 AM,222999,223700,219300,220800,553600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2005 12:00:00 AM,224400,224400,217099,217999,1272200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2005 12:00:00 AM,219900,226000,219500,225400,2084200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2005 12:00:00 AM,229300,231000,226000,227800,993900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/1/2005 12:00:00 AM,234000,235700,230100,232000,1242600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2005 12:00:00 AM,226700,229599,226700,228400,1241700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/5/2005 12:00:00 AM,232300,232999,226100,226100,830300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2005 12:00:00 AM,228500,230900,226500,227300,545000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2005 12:00:00 AM,227300,231200,226900,231200,359000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2005 12:00:00 AM,229900,232300,228899,229100,316800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2005 12:00:00 AM,230599,230599,228600,230200,171200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/12/2005 12:00:00 AM,229400,232500,225000,232000,1192800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2005 12:00:00 AM,232400,233300,228500,229699,675000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2005 12:00:00 AM,227199,227199,217999,217999,1571000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2005 12:00:00 AM,217400,219300,211700,211700,1237300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2005 12:00:00 AM,210900,215700,210000,215700,1331800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2005 12:00:00 AM,218400,223500,217800,223300,1160800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2005 12:00:00 AM,224000,226500,219000,219500,966900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2005 12:00:00 AM,218799,225000,218799,224500,592000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2005 12:00:00 AM,228600,228600,219000,221399,619200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2005 12:00:00 AM,221299,227199,220900,227199,457300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2005 12:00:00 AM,225200,229000,225100,226100,462400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2005 12:00:00 AM,225800,226700,222999,225800,307900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/28/2005 12:00:00 AM,223400,224100,215499,216000,503600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2005 12:00:00 AM,219400,219900,214000,218500,418700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2005 12:00:00 AM,219500,222199,216399,221200,481500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0\n5/3/2005 12:00:00 AM,221299,224500,220000,222500,623600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/4/2005 12:00:00 AM,225300,231700,224300,231200,569900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2005 12:00:00 AM,231600,234000,227600,231000,890600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/6/2005 12:00:00 AM,234500,236000,232000,233799,625900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/9/2005 12:00:00 AM,234200,235800,232199,235800,744200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2005 12:00:00 AM,234000,234000,226600,227999,515700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2005 12:00:00 AM,226399,228500,222000,228500,722600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n5/12/2005 12:00:00 AM,228200,228200,218700,221000,760400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2005 12:00:00 AM,217800,221000,215000,217000,875700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/16/2005 12:00:00 AM,215700,222000,215700,221600,488900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2005 12:00:00 AM,215200,224000,215200,222700,344100,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2005 12:00:00 AM,226500,230000,225700,229800,481100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/19/2005 12:00:00 AM,230200,231200,227300,231200,567400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2005 12:00:00 AM,230000,230100,227300,228500,349200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/23/2005 12:00:00 AM,227900,229300,227199,227999,1113000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/24/2005 12:00:00 AM,226500,231399,225900,231399,1030000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2005 12:00:00 AM,232000,232400,230000,231000,1269000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/26/2005 12:00:00 AM,231500,234500,231500,234100,546800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/27/2005 12:00:00 AM,235400,239400,234800,238799,698200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2005 12:00:00 AM,243300,243300,235000,237900,1345200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2005 12:00:00 AM,235499,241600,235499,240200,1035700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2005 12:00:00 AM,241200,248099,240800,246500,1207200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2005 12:00:00 AM,249100,249100,243899,246000,521100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2005 12:00:00 AM,236800,239500,233400,238500,580000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2005 12:00:00 AM,234000,237500,232600,232999,976500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2005 12:00:00 AM,235900,237099,231100,231800,751100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2005 12:00:00 AM,226299,229500,225100,228200,1091800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2005 12:00:00 AM,227999,233700,227999,232999,568700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2005 12:00:00 AM,236000,236600,233600,234400,249500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/14/2005 12:00:00 AM,235000,242099,229900,242099,1594500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2005 12:00:00 AM,235400,240800,235000,240100,1154500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2005 12:00:00 AM,243899,246800,242400,246600,789500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2005 12:00:00 AM,249800,252000,249000,250200,1032200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/20/2005 12:00:00 AM,250100,250300,247400,249000,836800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n6/21/2005 12:00:00 AM,250100,251500,246100,247999,1122300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2005 12:00:00 AM,249100,249100,244400,246500,1240600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2005 12:00:00 AM,245499,246700,239900,240100,1946900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2005 12:00:00 AM,240200,241399,238099,239400,1495900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/27/2005 12:00:00 AM,237099,246500,237099,245400,508200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2005 12:00:00 AM,244200,247999,244200,246700,372200,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2005 12:00:00 AM,249599,249800,246500,247900,251300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2005 12:00:00 AM,248300,249800,246600,248200,273400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/1/2005 12:00:00 AM,249500,250400,248500,249000,366900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/5/2005 12:00:00 AM,245499,248400,242700,244000,557800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2005 12:00:00 AM,241399,244000,239699,242199,1374200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/7/2005 12:00:00 AM,239400,244000,239200,243799,504200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2005 12:00:00 AM,245499,247199,243700,245499,1018600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/11/2005 12:00:00 AM,247999,251000,247999,250499,1582100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2005 12:00:00 AM,250499,254599,250499,253899,498800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2005 12:00:00 AM,255100,257700,254400,255100,1375900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/14/2005 12:00:00 AM,258099,258300,253600,255100,751800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2005 12:00:00 AM,251200,252800,250300,250700,489400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2005 12:00:00 AM,248799,252199,248500,251100,252200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2005 12:00:00 AM,247999,251900,247999,251600,916500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2005 12:00:00 AM,248500,255800,247600,255000,432700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2005 12:00:00 AM,257199,257800,253600,256000,639700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2005 12:00:00 AM,254200,255000,249100,250599,525100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2005 12:00:00 AM,241399,244200,236500,236500,2032000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2005 12:00:00 AM,235000,242500,235000,242099,2289400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2005 12:00:00 AM,243099,247999,239500,247300,853400,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2005 12:00:00 AM,249100,255499,249100,253799,1733700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2005 12:00:00 AM,257000,257999,253200,253700,1574200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2005 12:00:00 AM,255900,260800,254500,259300,1097700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2005 12:00:00 AM,263099,267700,262600,267199,1310100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/3/2005 12:00:00 AM,272999,274200,269000,269900,1748000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2005 12:00:00 AM,271299,272600,267099,267500,1122400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2005 12:00:00 AM,272000,272000,265499,267099,431700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2005 12:00:00 AM,270499,272700,267500,269000,351300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/9/2005 12:00:00 AM,270599,278500,270000,278200,798300,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2005 12:00:00 AM,282199,285200,279100,280499,1342400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2005 12:00:00 AM,280700,282600,267600,270700,2891100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2005 12:00:00 AM,263099,271000,261100,270200,1001100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2005 12:00:00 AM,275200,279100,272600,277199,446500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2005 12:00:00 AM,281600,281600,270700,271500,1505100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2005 12:00:00 AM,274800,274800,272400,273500,601100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/18/2005 12:00:00 AM,272999,273500,265800,265800,1018300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2005 12:00:00 AM,267700,269100,251000,258400,2389700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2005 12:00:00 AM,264900,271200,264900,270200,1032000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/23/2005 12:00:00 AM,267000,267300,262300,264400,674100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2005 12:00:00 AM,261000,264800,260400,261100,1498400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/25/2005 12:00:00 AM,269699,270900,263099,270400,747700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/26/2005 12:00:00 AM,270100,270300,263799,266700,1421600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2005 12:00:00 AM,266500,272199,265800,271100,703400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2005 12:00:00 AM,273500,274400,270700,273200,713800,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/31/2005 12:00:00 AM,276000,281299,276000,280900,1417400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2005 12:00:00 AM,284900,284900,279500,282000,1249700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2005 12:00:00 AM,285000,287999,284100,287500,1867600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/6/2005 12:00:00 AM,291000,294000,288600,294000,1366300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2005 12:00:00 AM,292900,295000,292000,293200,938500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/8/2005 12:00:00 AM,293300,295400,292800,294300,609900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n9/9/2005 12:00:00 AM,294800,301600,285200,300700,505000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2005 12:00:00 AM,300499,301700,297500,299300,1299900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/13/2005 12:00:00 AM,299100,299500,293400,293799,846400,0,0,-100,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2005 12:00:00 AM,295800,296700,294000,296600,939700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2005 12:00:00 AM,300599,304900,300599,302999,876100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2005 12:00:00 AM,305200,308500,304500,308500,1046200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2005 12:00:00 AM,307600,312199,307099,310700,869700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2005 12:00:00 AM,313300,314400,310000,310200,963600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2005 12:00:00 AM,314000,325000,313200,323499,1354000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2005 12:00:00 AM,323499,323499,316399,321399,1397400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2005 12:00:00 AM,323899,326399,321600,325999,1195000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2005 12:00:00 AM,324700,328699,322000,327999,1447200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2005 12:00:00 AM,325099,327500,321199,324000,2098000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/28/2005 12:00:00 AM,326600,335000,326600,332599,2058600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2005 12:00:00 AM,333899,334800,328400,334500,1640800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n9/30/2005 12:00:00 AM,334100,334800,330999,333200,930900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n10/3/2005 12:00:00 AM,333499,338499,333499,337200,1024400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2005 12:00:00 AM,335900,337500,325900,325999,1921800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2005 12:00:00 AM,322000,322500,311000,312099,2591700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2005 12:00:00 AM,304400,307500,292500,296500,3449100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2005 12:00:00 AM,302199,313600,302199,310000,2894800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n10/10/2005 12:00:00 AM,314900,317500,309000,312500,1561600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/11/2005 12:00:00 AM,316700,319900,314200,316399,2540300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/12/2005 12:00:00 AM,317300,317999,302800,305200,2505300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2005 12:00:00 AM,295599,306000,295599,305499,2797400,0,0,0,0,0,0,0,0,0,100,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2005 12:00:00 AM,306600,307999,296000,305700,2198500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/17/2005 12:00:00 AM,309900,313600,308799,311200,1219300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2005 12:00:00 AM,314800,315000,300300,302300,966200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2005 12:00:00 AM,305000,306900,292500,306500,2735300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2005 12:00:00 AM,306500,307900,287999,290200,2314300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2005 12:00:00 AM,295000,299500,290200,298400,1509600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2005 12:00:00 AM,302199,307999,300200,307999,2280900,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/25/2005 12:00:00 AM,309699,311500,302600,305000,1239900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/26/2005 12:00:00 AM,301600,309000,300599,306000,899100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2005 12:00:00 AM,304900,305300,295100,297199,1370000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2005 12:00:00 AM,300200,306000,299500,304800,1148200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/31/2005 12:00:00 AM,305400,317000,305400,315800,1527300,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2005 12:00:00 AM,320000,324399,317999,323200,1407000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/2/2005 12:00:00 AM,324199,327000,322000,325400,1272300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/3/2005 12:00:00 AM,328100,332500,326800,327999,2698500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/4/2005 12:00:00 AM,329500,329500,319000,324800,1309200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2005 12:00:00 AM,328300,330000,324800,326800,1533800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/8/2005 12:00:00 AM,324599,330900,323499,330700,1060200,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2005 12:00:00 AM,331600,332500,327400,329000,1187400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/10/2005 12:00:00 AM,327500,330000,322500,327500,2082300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/11/2005 12:00:00 AM,325600,329500,324800,327700,936000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/14/2005 12:00:00 AM,321300,323200,314900,320700,2049100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/15/2005 12:00:00 AM,320099,325999,319000,319699,1075200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/16/2005 12:00:00 AM,321500,326899,320700,326199,673700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2005 12:00:00 AM,329900,335200,329900,333800,917200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2005 12:00:00 AM,330200,331500,325999,328800,1389800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2005 12:00:00 AM,338499,340000,329100,330900,608800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2005 12:00:00 AM,322799,333400,320200,332999,1889400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n11/23/2005 12:00:00 AM,339900,339900,333499,337700,1448700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2005 12:00:00 AM,338699,340999,337500,340499,856700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/28/2005 12:00:00 AM,346100,346300,335499,336600,1336100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2005 12:00:00 AM,338200,342999,338200,340099,867800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2005 12:00:00 AM,335700,340499,335700,337999,788700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2005 12:00:00 AM,342900,349000,342000,349000,2061900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2005 12:00:00 AM,351500,354300,350000,353499,1551100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2005 12:00:00 AM,354000,354399,350999,354000,884900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n12/6/2005 12:00:00 AM,355499,360499,355000,360200,1160800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2005 12:00:00 AM,362300,362300,347999,348300,2238800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2005 12:00:00 AM,349399,349599,341199,342700,2082200,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2005 12:00:00 AM,341199,344199,340000,344000,1337200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2005 12:00:00 AM,345499,346399,340499,343200,1036900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2005 12:00:00 AM,342700,347700,341100,347200,1949000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2005 12:00:00 AM,346399,347099,342200,345400,976600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2005 12:00:00 AM,340499,341699,336399,339599,1603800,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/16/2005 12:00:00 AM,335000,339599,333699,335299,1256000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/19/2005 12:00:00 AM,327999,332200,322500,325900,3141000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/20/2005 12:00:00 AM,327400,332000,327400,331699,785500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2005 12:00:00 AM,338300,344000,336500,342000,1649000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2005 12:00:00 AM,342000,342099,338400,338600,820500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2005 12:00:00 AM,334100,336399,332000,335200,629900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/27/2005 12:00:00 AM,330800,331500,327099,329500,947000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2005 12:00:00 AM,326899,330499,326699,330000,744400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2005 12:00:00 AM,330600,335000,329399,334800,512000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2005 12:00:00 AM,332799,333899,330099,333699,527200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2006 12:00:00 AM,339500,349399,338499,348300,1468700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2006 12:00:00 AM,352000,359000,350999,357500,3158700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2006 12:00:00 AM,359900,359900,356699,359000,2365800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2006 12:00:00 AM,364199,367900,363300,367500,2710400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2006 12:00:00 AM,370200,374500,367700,374000,2219900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2006 12:00:00 AM,364199,370000,362599,369399,2189300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2006 12:00:00 AM,371800,375000,370000,373800,1592500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2006 12:00:00 AM,380999,385000,372999,375400,2074800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2006 12:00:00 AM,375000,377300,373100,377000,1929100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2006 12:00:00 AM,379500,380099,366600,370800,2845900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2006 12:00:00 AM,362099,366699,361300,365499,1974100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/19/2006 12:00:00 AM,375000,383899,371399,383200,3481000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2006 12:00:00 AM,386800,387000,375200,375400,3194300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2006 12:00:00 AM,381500,385099,376699,385099,2639600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2006 12:00:00 AM,394199,397000,392500,395999,3101900,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2006 12:00:00 AM,400499,400999,389000,392500,2502300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2006 12:00:00 AM,396300,409199,395800,407000,3400300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2006 12:00:00 AM,410499,414000,400999,403200,4450900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2006 12:00:00 AM,404199,409800,400000,408899,1966300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2006 12:00:00 AM,407999,415000,403899,413400,2458300,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2006 12:00:00 AM,413400,413400,407300,408600,2960400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/2/2006 12:00:00 AM,412200,412200,394599,398499,4360900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2006 12:00:00 AM,387599,401500,384000,396199,5619400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2006 12:00:00 AM,400499,407099,400499,407099,2045100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/7/2006 12:00:00 AM,401500,402099,388699,390400,2652500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n2/8/2006 12:00:00 AM,399000,399000,386500,395000,3546500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2006 12:00:00 AM,394000,400499,393300,395700,3804800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0\n2/10/2006 12:00:00 AM,406300,406300,392200,395000,2871400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2006 12:00:00 AM,393800,397000,385200,387799,2672000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2006 12:00:00 AM,387000,397300,385999,396600,2842700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2006 12:00:00 AM,397599,405499,396100,402999,4071000,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2006 12:00:00 AM,411899,422500,404599,422000,4260300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2006 12:00:00 AM,430000,430000,418499,420999,2378500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2006 12:00:00 AM,427300,427999,412099,412099,2966600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2006 12:00:00 AM,415800,421199,414000,417000,1821000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/23/2006 12:00:00 AM,419199,419900,413100,419199,2748100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n2/24/2006 12:00:00 AM,419800,423800,419000,422000,1440500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/27/2006 12:00:00 AM,424000,424500,417500,418300,2182600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/28/2006 12:00:00 AM,420099,420099,410000,412099,2375500,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2006 12:00:00 AM,416100,432000,415600,429000,2384000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2006 12:00:00 AM,429599,431800,425700,431399,2135000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2006 12:00:00 AM,424700,431800,423699,429599,2453700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2006 12:00:00 AM,429000,430800,412599,412999,3531800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2006 12:00:00 AM,405200,405800,392500,400299,6137500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2006 12:00:00 AM,392700,397000,380400,394500,7965200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/9/2006 12:00:00 AM,400000,402500,382599,384399,4202700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2006 12:00:00 AM,385499,398100,341899,395000,4104500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2006 12:00:00 AM,397300,402000,392500,395499,3421800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/14/2006 12:00:00 AM,395099,408200,393400,407999,3538700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2006 12:00:00 AM,411500,418499,409500,417900,4308600,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/16/2006 12:00:00 AM,420800,422500,413699,417500,3884900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/17/2006 12:00:00 AM,416100,417400,410000,413800,2851000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/20/2006 12:00:00 AM,414399,417300,407300,411500,1840100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/21/2006 12:00:00 AM,409599,409599,396800,397099,3807000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2006 12:00:00 AM,397400,404800,397400,404399,1516400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2006 12:00:00 AM,407999,409000,395499,399399,3306300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2006 12:00:00 AM,401500,405700,399399,403200,2430400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/27/2006 12:00:00 AM,397599,402200,392599,397000,3987500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/28/2006 12:00:00 AM,380000,392900,378499,378499,7493900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2006 12:00:00 AM,383100,392999,383100,392500,4578800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2006 12:00:00 AM,397000,408600,392900,398400,4176600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/31/2006 12:00:00 AM,402000,403200,395299,399500,4412000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2006 12:00:00 AM,405200,417200,405200,415099,6385800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2006 12:00:00 AM,419900,421100,413499,415400,2626500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/5/2006 12:00:00 AM,418899,421500,413499,419500,3695900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/6/2006 12:00:00 AM,421899,424900,416500,424000,3436900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2006 12:00:00 AM,422000,422999,410600,414700,2999600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2006 12:00:00 AM,412500,414599,407200,409800,1843000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/11/2006 12:00:00 AM,416399,416500,405000,407099,3353900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2006 12:00:00 AM,409700,410200,404599,407999,2556600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2006 12:00:00 AM,405400,409000,402099,406500,1789300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0\n4/17/2006 12:00:00 AM,410900,416800,410299,412999,3424500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/18/2006 12:00:00 AM,420499,434100,418800,430000,5318800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2006 12:00:00 AM,433899,438600,430600,437500,4602500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2006 12:00:00 AM,437500,441600,428499,434199,2953500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/21/2006 12:00:00 AM,435999,448499,435700,443499,2436500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2006 12:00:00 AM,438699,439300,432999,435299,2304000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/25/2006 12:00:00 AM,435600,437000,429399,431600,2294900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/26/2006 12:00:00 AM,432700,440900,432099,439199,2892800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2006 12:00:00 AM,430200,438400,426199,432500,4733700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/28/2006 12:00:00 AM,434399,442700,433899,442500,1572000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2006 12:00:00 AM,444100,452999,443499,447500,2620600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/2/2006 12:00:00 AM,443600,487500,440999,454000,3466200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2006 12:00:00 AM,453699,454900,448100,453300,3188600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n5/4/2006 12:00:00 AM,456899,457799,452599,454300,2161700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/5/2006 12:00:00 AM,460800,465999,458600,464500,2590900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/8/2006 12:00:00 AM,464100,465600,458899,464700,1817600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n5/9/2006 12:00:00 AM,461699,470000,461500,469800,2516100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2006 12:00:00 AM,468899,468899,462400,465999,2838000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/11/2006 12:00:00 AM,465900,465999,446899,448400,4728900,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2006 12:00:00 AM,434300,444100,426500,434000,5761600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/15/2006 12:00:00 AM,417999,426399,408400,415499,8663900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/16/2006 12:00:00 AM,431399,431699,415000,422000,4120200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2006 12:00:00 AM,413300,417400,394199,399599,8931300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2006 12:00:00 AM,402400,407000,391100,391500,6617600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2006 12:00:00 AM,412599,412599,385099,394500,7254500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2006 12:00:00 AM,370000,374399,357400,370000,12990700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/23/2006 12:00:00 AM,381899,388499,362300,363300,10183000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2006 12:00:00 AM,360099,365000,337000,353499,13418700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2006 12:00:00 AM,359800,377000,356100,377000,7536700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n5/26/2006 12:00:00 AM,390900,397999,382500,391600,12433900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/30/2006 12:00:00 AM,380400,380400,362999,365999,6628700,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2006 12:00:00 AM,375999,379700,363499,369500,7255000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2006 12:00:00 AM,367999,385000,357000,385000,7713000,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2006 12:00:00 AM,395499,397300,377999,384100,8714300,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2006 12:00:00 AM,385299,387000,371600,373400,5050100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2006 12:00:00 AM,369100,372000,358499,371500,7971400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2006 12:00:00 AM,366199,373600,356100,356100,8012100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2006 12:00:00 AM,345499,356199,338300,356199,9030700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2006 12:00:00 AM,360099,363499,351399,351500,4809400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/12/2006 12:00:00 AM,351899,353499,330600,331500,5222000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2006 12:00:00 AM,324000,334000,315000,319200,6513300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2006 12:00:00 AM,323699,332799,317300,326500,8263400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0\n6/15/2006 12:00:00 AM,334000,358100,332500,353499,8165800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2006 12:00:00 AM,347500,354900,339700,351500,4457800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2006 12:00:00 AM,349800,354700,338899,339300,3509900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2006 12:00:00 AM,342999,349700,340499,342500,3140100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/21/2006 12:00:00 AM,340400,358600,339900,356899,6005200,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2006 12:00:00 AM,357000,357999,350400,356100,3708100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n6/23/2006 12:00:00 AM,347700,359700,345800,356300,3390800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/26/2006 12:00:00 AM,359399,361600,356300,357500,3058700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0\n6/27/2006 12:00:00 AM,359900,364399,350499,351800,4911300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2006 12:00:00 AM,355900,361500,352799,360499,4063800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/29/2006 12:00:00 AM,366100,386899,365000,385999,7153100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2006 12:00:00 AM,395000,395400,386600,391199,6232000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2006 12:00:00 AM,394800,400800,393100,398499,3814200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/5/2006 12:00:00 AM,389000,391399,380999,384700,5995200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2006 12:00:00 AM,389599,394100,388800,391800,3578700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/7/2006 12:00:00 AM,390600,392000,382000,385900,4305300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2006 12:00:00 AM,388200,390999,380900,386399,2444300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/11/2006 12:00:00 AM,381899,390499,377500,390499,4047500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2006 12:00:00 AM,387500,391199,380600,381800,3639000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2006 12:00:00 AM,374700,377599,366600,367599,5945300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2006 12:00:00 AM,371500,372700,364000,371500,5307500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/17/2006 12:00:00 AM,367099,372000,362000,362599,2663600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2006 12:00:00 AM,368600,370800,358800,367999,4623900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/19/2006 12:00:00 AM,366500,387000,366500,384599,6795400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2006 12:00:00 AM,387000,389399,375000,375000,3893300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2006 12:00:00 AM,378100,378499,367999,371199,3242800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2006 12:00:00 AM,375800,384199,374300,383300,3337700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2006 12:00:00 AM,382500,387999,379100,387099,3364600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2006 12:00:00 AM,382599,390999,381500,386800,2899300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2006 12:00:00 AM,392000,395900,387400,391600,2841700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/28/2006 12:00:00 AM,390999,399800,389900,396800,3800200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2006 12:00:00 AM,396600,396600,392300,394700,2596300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/1/2006 12:00:00 AM,388600,390000,384300,389399,4518800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/2/2006 12:00:00 AM,393300,399100,392200,395000,2503300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2006 12:00:00 AM,391899,400900,389800,397099,2370400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2006 12:00:00 AM,404700,409500,399000,403499,4760400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/7/2006 12:00:00 AM,400499,402900,397999,400999,3268200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/8/2006 12:00:00 AM,402599,405499,398699,400000,2429500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2006 12:00:00 AM,405299,406899,395000,396500,3711600,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2006 12:00:00 AM,394399,401600,392300,400200,4730000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n8/11/2006 12:00:00 AM,400400,400400,394199,395000,1690200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2006 12:00:00 AM,397000,398200,388600,389800,2337600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2006 12:00:00 AM,393699,402999,392900,399000,2506100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2006 12:00:00 AM,405800,408800,402000,408800,5763200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2006 12:00:00 AM,405200,411500,401399,403100,3342000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2006 12:00:00 AM,404599,405499,399300,405000,2104600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n8/21/2006 12:00:00 AM,400700,402700,398899,401899,2589100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/22/2006 12:00:00 AM,399199,402200,395000,398200,3852600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/23/2006 12:00:00 AM,396899,397200,382000,383600,6271500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2006 12:00:00 AM,385299,385299,375000,383699,5145000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2006 12:00:00 AM,384700,388100,380499,385000,2639700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,100,0,0\n8/28/2006 12:00:00 AM,381600,392999,381600,392099,3052300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2006 12:00:00 AM,395000,395000,387400,392900,3617200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2006 12:00:00 AM,395700,395700,390099,392200,2555500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0\n8/31/2006 12:00:00 AM,396600,396600,389599,391699,4281000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2006 12:00:00 AM,393699,402400,393699,400999,3511300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2006 12:00:00 AM,405099,406800,402200,405000,2400500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/6/2006 12:00:00 AM,400400,400400,391100,391600,3291300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2006 12:00:00 AM,390499,391800,382999,387999,3711900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2006 12:00:00 AM,388800,390299,386800,387999,2145200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n9/11/2006 12:00:00 AM,379300,380200,372799,374399,5206800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2006 12:00:00 AM,378300,380900,373300,380900,3842000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2006 12:00:00 AM,379700,390499,378300,387099,2761900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2006 12:00:00 AM,385099,389800,380900,383899,3567200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/15/2006 12:00:00 AM,387300,387300,380099,382500,3041100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2006 12:00:00 AM,384000,392999,384000,388699,2786300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2006 12:00:00 AM,388499,389100,376600,381100,3431800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2006 12:00:00 AM,383300,385000,369300,372099,4705800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2006 12:00:00 AM,368499,374500,360999,362900,6726700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2006 12:00:00 AM,362400,362400,355299,361600,6427500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n9/25/2006 12:00:00 AM,360499,362999,349900,361100,8003500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/26/2006 12:00:00 AM,365800,374199,364500,374199,5301500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2006 12:00:00 AM,374800,379500,373200,378800,4932700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/28/2006 12:00:00 AM,380800,386699,380099,386199,5009400,0,0,0,0,0,0,100,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2006 12:00:00 AM,381899,387000,380800,384700,3912700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/2/2006 12:00:00 AM,393499,395000,389300,391699,3953900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/3/2006 12:00:00 AM,387200,388699,380299,380900,4351600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2006 12:00:00 AM,382000,396199,380900,394500,4210700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2006 12:00:00 AM,396600,402500,394000,397999,3565500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/6/2006 12:00:00 AM,392200,397999,390499,397700,2327500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2006 12:00:00 AM,397599,407000,397500,402500,2748500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2006 12:00:00 AM,405999,408899,405000,408300,2802600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/11/2006 12:00:00 AM,402099,407900,399599,404900,3992900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2006 12:00:00 AM,405800,414500,405800,413400,3865200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2006 12:00:00 AM,414000,418200,413400,415600,2854600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/16/2006 12:00:00 AM,415099,419700,412599,419500,2072200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2006 12:00:00 AM,416199,416199,410000,414399,2398600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2006 12:00:00 AM,419599,420999,412099,413899,5561300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2006 12:00:00 AM,409800,416300,409800,414100,2319600,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2006 12:00:00 AM,412099,412900,408699,412300,2943000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n10/23/2006 12:00:00 AM,407000,416500,407000,416100,2106200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2006 12:00:00 AM,417300,419599,413800,417999,2074700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/25/2006 12:00:00 AM,417799,424399,417099,424199,2921700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2006 12:00:00 AM,425999,426300,419599,423200,2850900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2006 12:00:00 AM,420000,425099,418400,418499,3534300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2006 12:00:00 AM,414000,415499,410499,411399,4705000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/31/2006 12:00:00 AM,416899,420700,413899,419800,6876600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2006 12:00:00 AM,423499,427500,421300,422000,5244100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2006 12:00:00 AM,420600,422900,416100,422000,3749200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2006 12:00:00 AM,427000,430000,425600,429000,3735500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/6/2006 12:00:00 AM,433100,440000,432799,438800,4002400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2006 12:00:00 AM,437900,439700,433300,433300,3099100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2006 12:00:00 AM,430999,439500,428300,439500,3167100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2006 12:00:00 AM,441800,445000,432799,435000,3616700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2006 12:00:00 AM,435999,436199,430299,431699,2859400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2006 12:00:00 AM,425400,429100,423600,428499,4083000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2006 12:00:00 AM,436100,438800,432599,437300,2626200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/15/2006 12:00:00 AM,438100,444700,437300,442700,2286600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2006 12:00:00 AM,442999,443600,432700,432700,2744900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2006 12:00:00 AM,427500,433600,425200,431800,2748200,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2006 12:00:00 AM,433400,435800,429399,432300,2102900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/21/2006 12:00:00 AM,433100,441500,432300,441500,2738300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2006 12:00:00 AM,440999,443499,436199,441800,2781600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/24/2006 12:00:00 AM,436699,442599,436199,442000,1331700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2006 12:00:00 AM,438800,440099,423200,424500,4117900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2006 12:00:00 AM,425400,432900,423200,432900,5074700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2006 12:00:00 AM,435999,445999,435999,445999,4647600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2006 12:00:00 AM,441899,446399,438200,443600,3967300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/1/2006 12:00:00 AM,445700,445700,434399,439199,5268800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2006 12:00:00 AM,437599,451699,437300,451699,4169600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2006 12:00:00 AM,454599,460600,452599,460600,5111600,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2006 12:00:00 AM,457799,462400,455400,458200,3121200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/7/2006 12:00:00 AM,461899,462000,455099,456600,2678900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/8/2006 12:00:00 AM,458800,462900,456500,460999,2839500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2006 12:00:00 AM,460999,462599,459700,461899,1822900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/12/2006 12:00:00 AM,461100,461100,452999,456399,2824100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2006 12:00:00 AM,458899,459900,454399,459900,2315200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2006 12:00:00 AM,462999,466500,462200,463100,2254800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/15/2006 12:00:00 AM,467000,468200,462500,465900,3373500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/18/2006 12:00:00 AM,467700,468800,460600,460900,2674000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2006 12:00:00 AM,455900,462700,453699,462000,2457300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n12/20/2006 12:00:00 AM,454599,456600,451699,453300,3034300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/21/2006 12:00:00 AM,452000,453899,448400,453400,1862900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2006 12:00:00 AM,454900,455299,450999,454399,1234800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/26/2006 12:00:00 AM,456699,458300,455600,457700,546600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2006 12:00:00 AM,460000,469599,459000,466500,2493700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2006 12:00:00 AM,469100,469500,465999,467599,1173000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/29/2006 12:00:00 AM,467400,468499,465499,468499,1015300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2007 12:00:00 AM,475000,475999,463699,467000,5882300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2007 12:00:00 AM,462500,463899,455999,460999,4498700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2007 12:00:00 AM,460800,460999,438499,444700,7855700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2007 12:00:00 AM,449700,452400,442400,450999,6748200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/9/2007 12:00:00 AM,446500,447300,434500,439500,6888800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2007 12:00:00 AM,432900,444599,431100,442700,8647700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n1/11/2007 12:00:00 AM,445400,454399,442700,446699,8105900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/12/2007 12:00:00 AM,449900,455499,447300,455000,5076000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/16/2007 12:00:00 AM,447500,452599,446500,449500,3887700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2007 12:00:00 AM,446300,452400,445400,449800,3523500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/18/2007 12:00:00 AM,455600,457200,443899,446899,5269800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2007 12:00:00 AM,447099,459100,447099,457700,4259100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2007 12:00:00 AM,463499,464199,454900,459300,5317900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2007 12:00:00 AM,459500,471800,459000,471500,6448200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2007 12:00:00 AM,471899,477999,468600,475200,5304200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2007 12:00:00 AM,475999,477500,461300,465900,7539800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2007 12:00:00 AM,470000,471100,462999,470000,5968600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/29/2007 12:00:00 AM,467599,468100,458899,459500,6813700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2007 12:00:00 AM,462599,466800,458899,465200,3535000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2007 12:00:00 AM,467599,475800,464599,472500,6046300,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2007 12:00:00 AM,479700,483699,477200,479900,5851000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/2/2007 12:00:00 AM,481100,481500,475099,480400,6243200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/5/2007 12:00:00 AM,483400,486699,480400,485499,4585900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2007 12:00:00 AM,488100,489300,482400,486699,5376400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2007 12:00:00 AM,483100,484500,475000,478800,6567000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2007 12:00:00 AM,472999,480700,470600,480700,5708000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n2/9/2007 12:00:00 AM,476399,480299,467999,473400,5570800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/12/2007 12:00:00 AM,469599,471899,462999,467099,5180200,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2007 12:00:00 AM,469900,481800,469000,481800,4854700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2007 12:00:00 AM,481800,490999,480099,485700,7634400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2007 12:00:00 AM,489199,491600,486600,489300,3821600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n2/16/2007 12:00:00 AM,484700,490099,483499,490099,2348500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2007 12:00:00 AM,485999,490200,482000,490200,3114800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2007 12:00:00 AM,487999,492599,482999,491100,5520100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2007 12:00:00 AM,497400,499800,490999,493100,7874800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2007 12:00:00 AM,493499,495499,485000,490200,6190600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2007 12:00:00 AM,494900,495000,486399,492400,4763400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2007 12:00:00 AM,467999,470700,434000,450099,19721700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2007 12:00:00 AM,456699,460499,450299,458200,10331000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/1/2007 12:00:00 AM,437599,458400,432700,454300,12371100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2007 12:00:00 AM,449599,454000,437799,438400,11013500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2007 12:00:00 AM,424399,437900,397999,427000,12755600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/6/2007 12:00:00 AM,440099,454300,440099,454300,11685500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2007 12:00:00 AM,451500,458200,446500,449599,7644400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/8/2007 12:00:00 AM,460700,463200,454700,458499,6616200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/9/2007 12:00:00 AM,466199,467200,459500,466399,6769800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n3/12/2007 12:00:00 AM,467900,471800,463300,468200,11320600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/13/2007 12:00:00 AM,462700,466600,448499,450099,7826900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2007 12:00:00 AM,450000,459500,441100,458300,13019300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2007 12:00:00 AM,455499,463400,455499,458899,5367500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/16/2007 12:00:00 AM,461800,463699,450299,453600,4805300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2007 12:00:00 AM,459800,466600,459000,463300,5667500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/20/2007 12:00:00 AM,466899,472500,464800,472400,6179900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2007 12:00:00 AM,474900,490200,472300,490200,8990700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2007 12:00:00 AM,491399,492500,485900,487099,4422300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/23/2007 12:00:00 AM,487099,491899,484000,489500,4424900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2007 12:00:00 AM,491199,492700,481899,492300,4994600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n3/27/2007 12:00:00 AM,487700,488499,483600,485099,4215200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/28/2007 12:00:00 AM,480999,480999,472000,477200,6690500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2007 12:00:00 AM,485800,494700,482099,493200,7083000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2007 12:00:00 AM,494500,496300,482900,492200,6908000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2007 12:00:00 AM,498200,498200,488499,495800,7055500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2007 12:00:00 AM,501399,506600,499100,506600,4941500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2007 12:00:00 AM,504500,511699,502400,509100,6572200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/5/2007 12:00:00 AM,508899,512900,507000,512500,2523700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/9/2007 12:00:00 AM,519700,522799,515000,515000,5964900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2007 12:00:00 AM,513600,518800,512999,517400,4765900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2007 12:00:00 AM,520099,520499,508400,511300,8322700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2007 12:00:00 AM,508800,517799,504399,516100,6607600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2007 12:00:00 AM,522300,527999,516100,527999,4809500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2007 12:00:00 AM,530200,535499,529100,535200,5480500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2007 12:00:00 AM,536500,537700,529300,532500,6922300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2007 12:00:00 AM,529500,535900,526699,530800,6357200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/19/2007 12:00:00 AM,523800,531699,520900,530200,6435300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2007 12:00:00 AM,541600,542000,535099,540299,4278500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2007 12:00:00 AM,537099,545499,532799,533499,4962000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2007 12:00:00 AM,533800,535600,526399,532700,6151900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/25/2007 12:00:00 AM,539000,545099,535299,542000,6719100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/26/2007 12:00:00 AM,542599,542599,533600,535700,6253800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2007 12:00:00 AM,527200,534900,524399,534900,7558000,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2007 12:00:00 AM,535299,535400,522900,525600,7210600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2007 12:00:00 AM,527999,529100,520200,525000,6096800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2007 12:00:00 AM,529000,537999,528699,535900,7815500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2007 12:00:00 AM,542500,545299,538600,545000,6041500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2007 12:00:00 AM,549900,552700,544800,548800,4310200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/7/2007 12:00:00 AM,547000,549800,544300,547000,5214000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/8/2007 12:00:00 AM,543400,548300,535800,548300,8410100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2007 12:00:00 AM,544900,561699,544100,560800,8740500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2007 12:00:00 AM,557700,560600,542799,545099,11638900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2007 12:00:00 AM,547500,557500,547400,556800,7769000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2007 12:00:00 AM,555000,559399,547400,552099,7726500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/15/2007 12:00:00 AM,553600,563800,551500,560200,10197700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2007 12:00:00 AM,567500,580499,563200,577999,11010200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2007 12:00:00 AM,574700,583499,570099,577500,9362000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/18/2007 12:00:00 AM,576800,584900,573899,584199,7718200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2007 12:00:00 AM,586800,596800,585000,590000,16920800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2007 12:00:00 AM,595000,595000,584900,584900,9055200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2007 12:00:00 AM,588899,594800,579900,582200,6504300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2007 12:00:00 AM,577000,584500,557700,561500,12882000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2007 12:00:00 AM,571100,579399,569900,578499,6048600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/29/2007 12:00:00 AM,589900,592500,574000,581399,8494900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2007 12:00:00 AM,567599,592099,561600,591899,8437600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/31/2007 12:00:00 AM,597000,600999,590499,592900,5764500,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2007 12:00:00 AM,602000,614399,602000,612000,8301200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2007 12:00:00 AM,602000,609700,600800,606500,6069400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2007 12:00:00 AM,603800,605700,595400,601500,7286300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2007 12:00:00 AM,592000,593899,578400,585299,12866900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2007 12:00:00 AM,584000,589300,555499,562099,13699300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2007 12:00:00 AM,569599,585999,562599,582400,11916600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2007 12:00:00 AM,584800,596699,581100,592200,7927500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2007 12:00:00 AM,589599,593400,577999,583200,12231600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n6/13/2007 12:00:00 AM,586199,597700,583699,594100,8000600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/14/2007 12:00:00 AM,602500,611199,602200,610499,7141200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/15/2007 12:00:00 AM,620499,627500,620299,626600,8061700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/18/2007 12:00:00 AM,633499,633499,623300,629199,7879800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2007 12:00:00 AM,626500,630800,624199,626800,6120100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/20/2007 12:00:00 AM,630700,632799,610499,612700,9664500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2007 12:00:00 AM,615700,626699,607900,623400,9039900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2007 12:00:00 AM,619399,619700,606899,612099,8107400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2007 12:00:00 AM,605400,617500,598899,605000,8407800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/26/2007 12:00:00 AM,612599,612599,596500,597799,8047000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2007 12:00:00 AM,592000,608400,589500,608400,7327100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2007 12:00:00 AM,612799,618499,609199,609599,7970700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n6/29/2007 12:00:00 AM,614399,619900,606500,614199,8150500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/2/2007 12:00:00 AM,619399,630800,619100,628800,6456200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2007 12:00:00 AM,634000,637500,627700,634199,4510600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/5/2007 12:00:00 AM,634500,640000,630999,638800,7849100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/6/2007 12:00:00 AM,645299,649199,640000,649100,7225700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2007 12:00:00 AM,649899,658499,649300,653799,6119200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/10/2007 12:00:00 AM,645500,650000,640500,644300,10451000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/11/2007 12:00:00 AM,640899,656999,640899,655599,7255200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2007 12:00:00 AM,661299,679400,660999,678399,8324700,0,0,0,0,100,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2007 12:00:00 AM,679800,685700,673399,682099,6238600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/16/2007 12:00:00 AM,681500,681999,670000,675999,7592100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n7/17/2007 12:00:00 AM,679000,683499,675100,682200,6019700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2007 12:00:00 AM,678000,682699,671500,681800,8140100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2007 12:00:00 AM,691600,694800,687799,690000,8179400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/20/2007 12:00:00 AM,687399,688099,674800,682399,8252600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2007 12:00:00 AM,691999,698499,685599,697900,7266900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2007 12:00:00 AM,691299,700000,653399,660899,14445700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2007 12:00:00 AM,664100,672300,640000,664400,17192000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/26/2007 12:00:00 AM,637999,641800,601300,622500,24797100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2007 12:00:00 AM,634800,635999,612400,618699,20848100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2007 12:00:00 AM,627999,645000,620999,640000,14892200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2007 12:00:00 AM,650500,657500,630900,635999,17703800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2007 12:00:00 AM,626600,634399,613600,629800,19478500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/2/2007 12:00:00 AM,640100,641900,630999,641900,13969300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/3/2007 12:00:00 AM,636899,641500,605900,609000,15678100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2007 12:00:00 AM,609000,617700,587700,610999,19314400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/7/2007 12:00:00 AM,609900,627500,605099,621800,19536200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/8/2007 12:00:00 AM,634000,649300,633400,642799,15559400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/9/2007 12:00:00 AM,619500,628899,608899,609000,18366100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2007 12:00:00 AM,590099,603699,578300,595000,20012700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/13/2007 12:00:00 AM,605600,615900,590000,590999,11303100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2007 12:00:00 AM,593400,594700,565000,566199,19591300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2007 12:00:00 AM,555999,570400,526399,529599,24276000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2007 12:00:00 AM,498600,516199,466100,512799,43570100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2007 12:00:00 AM,539000,552000,505099,530800,29339600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/20/2007 12:00:00 AM,535000,545800,522400,537999,17615700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/21/2007 12:00:00 AM,532000,546500,526800,539199,12827800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/22/2007 12:00:00 AM,556100,575000,556100,575000,20740500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2007 12:00:00 AM,578899,585900,564700,577999,16684900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/24/2007 12:00:00 AM,572599,602400,572000,600000,13476400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2007 12:00:00 AM,597500,607200,590000,599199,9776500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/28/2007 12:00:00 AM,589800,593699,562200,568499,15718000,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2007 12:00:00 AM,577300,596800,573100,593400,15403600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2007 12:00:00 AM,582999,605600,579000,592099,13932500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2007 12:00:00 AM,610000,619599,606899,615499,15097700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/4/2007 12:00:00 AM,617999,634399,616100,627400,11540500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2007 12:00:00 AM,616199,620400,609500,617799,9836500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/6/2007 12:00:00 AM,622999,628600,618100,625999,7979600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/7/2007 12:00:00 AM,613400,618400,597799,612000,13508700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/10/2007 12:00:00 AM,613200,613899,593600,605400,12367200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2007 12:00:00 AM,617099,627700,614300,624900,10095000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2007 12:00:00 AM,626699,638699,625800,630999,8412100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n9/13/2007 12:00:00 AM,638499,649599,637400,641800,8306500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n9/14/2007 12:00:00 AM,642300,652699,634300,640999,9673100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/17/2007 12:00:00 AM,633699,655999,623600,629199,7524300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/18/2007 12:00:00 AM,642600,680299,638499,676299,16337600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2007 12:00:00 AM,691900,697300,680000,683200,14367100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2007 12:00:00 AM,686500,693799,671299,677799,11335700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2007 12:00:00 AM,690599,696399,688899,693200,7162000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n9/24/2007 12:00:00 AM,700100,708300,696900,708300,10983900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/25/2007 12:00:00 AM,699300,712500,693000,712500,8492100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2007 12:00:00 AM,723099,731399,718499,726999,10188300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n9/27/2007 12:00:00 AM,737500,745800,730500,745800,10980200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2007 12:00:00 AM,745000,747300,735299,735500,10059400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n10/1/2007 12:00:00 AM,746399,776500,746100,773499,12425400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2007 12:00:00 AM,768700,773300,752900,766800,14533400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/3/2007 12:00:00 AM,765400,767200,731500,733600,13474900,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2007 12:00:00 AM,743000,752399,722600,741500,10443900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/5/2007 12:00:00 AM,760100,782200,756100,776800,13846800,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2007 12:00:00 AM,774000,775000,762399,774199,7924500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n10/9/2007 12:00:00 AM,780899,796200,779100,792799,12653400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2007 12:00:00 AM,789000,793700,781399,791800,11697500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2007 12:00:00 AM,802200,808499,762200,776699,20773400,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2007 12:00:00 AM,778000,797399,775500,797399,12518400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2007 12:00:00 AM,800000,802900,775800,788000,17620400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2007 12:00:00 AM,775700,776900,761699,767500,14381600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/17/2007 12:00:00 AM,785999,788399,759499,788000,14593600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n10/18/2007 12:00:00 AM,772600,802399,771600,798799,13139000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2007 12:00:00 AM,799300,799400,755700,756699,21773500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2007 12:00:00 AM,738499,760199,727200,755999,18611300,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2007 12:00:00 AM,776699,787500,770199,786399,10873100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2007 12:00:00 AM,781500,786900,760899,785000,15868500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2007 12:00:00 AM,792300,797399,779199,797399,15561000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2007 12:00:00 AM,809199,825800,801900,825700,10430300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2007 12:00:00 AM,837500,852500,836200,844400,12236600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/30/2007 12:00:00 AM,840000,845700,830800,831500,8782200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0\n10/31/2007 12:00:00 AM,847099,868000,840500,855999,14505700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2007 12:00:00 AM,834499,843799,824400,831800,15480500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0\n11/2/2007 12:00:00 AM,839599,843000,809700,831999,13920600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2007 12:00:00 AM,810899,821999,805400,814499,12047900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/6/2007 12:00:00 AM,841800,851100,830999,850000,11168700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2007 12:00:00 AM,844000,849199,811299,818700,14871700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2007 12:00:00 AM,840000,876699,825700,861500,28721800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2007 12:00:00 AM,855000,855000,819000,832600,20596400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2007 12:00:00 AM,824800,825299,756500,760500,24290000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2007 12:00:00 AM,797099,830199,797099,825700,17256600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2007 12:00:00 AM,856500,857699,825700,838499,20780800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2007 12:00:00 AM,828600,829100,799199,813499,16285800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2007 12:00:00 AM,844499,847200,826100,841500,18264000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n11/19/2007 12:00:00 AM,833799,833799,795800,801999,13531000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2007 12:00:00 AM,815000,833799,790000,813799,17117400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/21/2007 12:00:00 AM,791999,791999,758000,766500,21621100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/23/2007 12:00:00 AM,766800,779499,766800,774400,9613900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/26/2007 12:00:00 AM,772399,777099,720400,725000,21376100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2007 12:00:00 AM,728600,750299,710000,743000,21997200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2007 12:00:00 AM,774499,801999,770000,796999,18292400,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2007 12:00:00 AM,796999,815400,786399,796500,16360400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/30/2007 12:00:00 AM,821999,826600,798000,809499,16183200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2007 12:00:00 AM,805999,810999,797300,809000,12485200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/4/2007 12:00:00 AM,790000,804599,784199,798799,13362200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/5/2007 12:00:00 AM,824100,839400,819300,834000,14970900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/6/2007 12:00:00 AM,834800,858499,833499,855000,11511100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2007 12:00:00 AM,858499,860599,849100,856699,10581100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n12/10/2007 12:00:00 AM,852699,859599,845899,853000,10849700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/11/2007 12:00:00 AM,858399,870000,809000,820800,17948500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2007 12:00:00 AM,860800,870000,830000,850800,18539100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2007 12:00:00 AM,828399,833700,800000,824000,14733600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/14/2007 12:00:00 AM,802799,817500,792300,800000,12972200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/17/2007 12:00:00 AM,784700,784700,749899,755599,18643100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2007 12:00:00 AM,782500,783499,751200,781399,16271400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/19/2007 12:00:00 AM,782500,790899,775199,784000,12887000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/20/2007 12:00:00 AM,800100,802300,785700,792200,14385700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/21/2007 12:00:00 AM,808399,817500,806399,817500,10317300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/24/2007 12:00:00 AM,814499,825199,811500,824199,3054600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2007 12:00:00 AM,816100,831200,810000,827200,5871200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2007 12:00:00 AM,824000,824499,814899,821100,5819700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/28/2007 12:00:00 AM,823499,825700,811399,817699,5799500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/31/2007 12:00:00 AM,816500,819199,805000,806999,4164500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2008 12:00:00 AM,820000,820999,801100,809499,15429200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2008 12:00:00 AM,810100,816900,806100,806100,8064600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2008 12:00:00 AM,795000,796100,771800,780000,13878100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2008 12:00:00 AM,779100,784000,753499,772600,16179000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2008 12:00:00 AM,789499,803200,769499,772500,16632700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2008 12:00:00 AM,780599,805500,774199,804700,18529900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2008 12:00:00 AM,798099,822799,791800,815199,21958900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2008 12:00:00 AM,802500,808200,785899,791299,14909400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2008 12:00:00 AM,804800,805800,791999,798499,9262200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2008 12:00:00 AM,784499,786299,756600,761800,19775000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2008 12:00:00 AM,751100,757500,716500,727799,25291100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2008 12:00:00 AM,743099,744800,689499,697500,29481000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/18/2008 12:00:00 AM,716100,720800,686299,708399,22734500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2008 12:00:00 AM,653600,702799,650100,695899,29287500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2008 12:00:00 AM,661100,699100,640000,692600,26904800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2008 12:00:00 AM,698700,726399,698700,718499,19010100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2008 12:00:00 AM,737799,747399,708899,736999,18013000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/28/2008 12:00:00 AM,712500,742300,703799,738799,18967600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2008 12:00:00 AM,752399,753300,738000,749000,13988400,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n1/30/2008 12:00:00 AM,741399,773799,735199,745999,18514100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/31/2008 12:00:00 AM,730000,767200,725100,764899,18349700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2008 12:00:00 AM,767500,783300,765199,779499,17810200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/4/2008 12:00:00 AM,783499,784599,774300,782900,10561900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n2/5/2008 12:00:00 AM,761999,767500,733000,738700,18114300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2008 12:00:00 AM,743099,756600,729400,737900,18702000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/7/2008 12:00:00 AM,740899,759899,720999,753899,18039200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2008 12:00:00 AM,746600,758099,743799,751100,13644300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/11/2008 12:00:00 AM,757799,779899,751900,777600,13340900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2008 12:00:00 AM,791600,810400,777500,786999,21728600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/13/2008 12:00:00 AM,798200,804000,789400,803600,12955500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2008 12:00:00 AM,807900,808799,784700,786500,14270300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0\n2/15/2008 12:00:00 AM,779800,786999,770400,786999,12094400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2008 12:00:00 AM,820000,822500,801500,806299,14695700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2008 12:00:00 AM,800100,835199,794300,832600,14686500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2008 12:00:00 AM,846500,849000,826900,831999,16537200,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2008 12:00:00 AM,846800,846800,823200,843899,14575700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2008 12:00:00 AM,841999,853899,832900,850000,14288600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2008 12:00:00 AM,845400,868099,841200,865199,13911400,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2008 12:00:00 AM,862099,885400,860000,882300,17909000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2008 12:00:00 AM,877500,887699,874400,881699,13273000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/29/2008 12:00:00 AM,868000,869300,831500,835299,21531400,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2008 12:00:00 AM,832799,859800,829199,857600,14919500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2008 12:00:00 AM,850199,855599,816600,838200,19154900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2008 12:00:00 AM,848099,862300,841699,861999,16905900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2008 12:00:00 AM,858300,859499,822099,823399,18587200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2008 12:00:00 AM,809599,827699,804599,808099,18916200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/10/2008 12:00:00 AM,809199,809800,776999,780999,20764100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2008 12:00:00 AM,808200,852900,787500,822500,19477300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/12/2008 12:00:00 AM,826399,837300,817799,824199,16117000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/13/2008 12:00:00 AM,799300,821699,781500,815500,23648500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2008 12:00:00 AM,829700,831900,784300,801399,20810000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2008 12:00:00 AM,763200,790000,755199,770000,27635300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/18/2008 12:00:00 AM,793399,810899,785299,808600,18063200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/19/2008 12:00:00 AM,812500,812699,745100,748200,27417100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2008 12:00:00 AM,736999,750800,721100,747799,22579000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2008 12:00:00 AM,756999,775899,749599,755899,16882200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/25/2008 12:00:00 AM,770000,785199,764000,783300,16501100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/26/2008 12:00:00 AM,792200,796399,773600,792300,14386900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/27/2008 12:00:00 AM,798700,799899,773799,777300,12652500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2008 12:00:00 AM,775400,776900,764499,768700,13652400,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/31/2008 12:00:00 AM,764899,778300,761999,770299,9704000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2008 12:00:00 AM,780000,799700,774800,798799,13167000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2008 12:00:00 AM,807600,823000,799400,814000,15630400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/3/2008 12:00:00 AM,807200,837600,807200,827200,14489800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2008 12:00:00 AM,827900,842399,826299,836999,13811000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/7/2008 12:00:00 AM,850000,858799,833399,836900,10201700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2008 12:00:00 AM,829000,851200,825500,845999,10906800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2008 12:00:00 AM,849400,853899,832399,839499,10706200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2008 12:00:00 AM,839499,846399,826200,840800,9370700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/11/2008 12:00:00 AM,830899,837500,822799,826600,8391400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2008 12:00:00 AM,821600,843799,813600,831399,12625000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2008 12:00:00 AM,840400,844599,833399,841500,8194100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/16/2008 12:00:00 AM,857399,871900,855500,869300,14150200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2008 12:00:00 AM,864400,882799,862099,877900,14112200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2008 12:00:00 AM,878000,885599,868799,877699,12362300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/21/2008 12:00:00 AM,880500,899899,875599,894199,8314900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2008 12:00:00 AM,888399,904400,885899,892099,11681500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2008 12:00:00 AM,891200,895000,881200,886500,10554500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/24/2008 12:00:00 AM,882500,884000,861999,863899,12142300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2008 12:00:00 AM,870899,876600,860500,875999,9145500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2008 12:00:00 AM,887500,888099,870999,871299,8493900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2008 12:00:00 AM,863899,863899,835299,839300,11493200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2008 12:00:00 AM,850000,935100,847399,903200,29863000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2008 12:00:00 AM,914899,938000,901299,918200,20814000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/2/2008 12:00:00 AM,952099,955199,927500,934000,17122800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2008 12:00:00 AM,934199,943200,929199,938499,11619300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n5/6/2008 12:00:00 AM,932200,944000,928300,944000,11195200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/7/2008 12:00:00 AM,946699,947200,909300,914199,14216600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2008 12:00:00 AM,920000,929199,910500,924000,10583700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/9/2008 12:00:00 AM,915199,928799,908399,928799,8162300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2008 12:00:00 AM,934000,948899,920599,947099,9493300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2008 12:00:00 AM,955100,958300,944700,950199,11097700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/14/2008 12:00:00 AM,952699,960299,941500,942500,8834700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2008 12:00:00 AM,950999,970000,947699,968300,10369200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2008 12:00:00 AM,981299,996900,980599,995400,12181300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2008 12:00:00 AM,1001699,1020100,990700,1000299,15449000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/20/2008 12:00:00 AM,991999,1005700,981299,1004700,14820000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2008 12:00:00 AM,1009000,1014899,984199,987500,14657300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2008 12:00:00 AM,991999,996200,971600,974800,9773100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2008 12:00:00 AM,982600,984400,959700,974499,11263700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2008 12:00:00 AM,970700,976299,949899,957600,11999700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2008 12:00:00 AM,964700,995000,950299,992099,12813600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2008 12:00:00 AM,994700,1022099,974199,975800,18845100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2008 12:00:00 AM,993000,1001600,982900,992399,10783300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/2/2008 12:00:00 AM,982500,994800,975000,984300,10978300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/3/2008 12:00:00 AM,985000,985000,951600,955999,14107600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2008 12:00:00 AM,946399,948799,930100,930999,16948600,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2008 12:00:00 AM,943099,973499,941100,973200,12947600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n6/6/2008 12:00:00 AM,973499,975500,946999,948000,12576300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2008 12:00:00 AM,950599,955100,933600,946800,8863800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/10/2008 12:00:00 AM,927500,930400,901299,914499,17760300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2008 12:00:00 AM,913300,918099,898799,900100,13812600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/12/2008 12:00:00 AM,905899,918600,903000,908300,11698000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/13/2008 12:00:00 AM,914400,920000,902799,908200,11323900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2008 12:00:00 AM,906399,924499,905599,917600,10477600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2008 12:00:00 AM,936900,950400,929199,940000,9144700,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/18/2008 12:00:00 AM,936900,937500,918799,928899,13741200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2008 12:00:00 AM,930000,930599,913600,920000,15482200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2008 12:00:00 AM,916999,917799,888600,890999,19744500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2008 12:00:00 AM,891699,899300,884700,891500,14142500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/24/2008 12:00:00 AM,889400,903200,880400,889199,15728400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/25/2008 12:00:00 AM,888700,922900,886699,914599,22156700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2008 12:00:00 AM,896500,903200,880500,884400,18149300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2008 12:00:00 AM,880999,892699,878399,886200,14135900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2008 12:00:00 AM,897500,905800,892900,892900,11887600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/1/2008 12:00:00 AM,873899,887399,863600,877799,16154000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/2/2008 12:00:00 AM,888300,889700,838300,839599,18822300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2008 12:00:00 AM,844499,849499,819400,830599,14003700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2008 12:00:00 AM,829199,840999,812500,818499,19531500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2008 12:00:00 AM,812300,818899,794300,817600,20317200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2008 12:00:00 AM,822099,822399,789599,793099,14114000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2008 12:00:00 AM,793099,823600,790299,821500,21395600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2008 12:00:00 AM,815000,833600,806800,816399,18336400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/14/2008 12:00:00 AM,834499,835000,823499,825800,13114200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/15/2008 12:00:00 AM,813200,836299,788499,824599,19423800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/16/2008 12:00:00 AM,825999,835100,817699,833499,13294800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2008 12:00:00 AM,832099,837200,799199,808000,14345000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2008 12:00:00 AM,808000,823300,800299,809199,12705600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/21/2008 12:00:00 AM,818000,828200,817799,825899,9092900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/22/2008 12:00:00 AM,815700,818000,805299,814300,9645800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n7/23/2008 12:00:00 AM,809700,815899,800999,801999,11674500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/24/2008 12:00:00 AM,805100,807200,773700,775000,13685600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2008 12:00:00 AM,766999,781500,763300,774000,9560400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2008 12:00:00 AM,781399,787099,769400,771399,8216400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/29/2008 12:00:00 AM,781999,786299,776299,785500,8327500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/30/2008 12:00:00 AM,805800,825999,802399,824300,13003200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2008 12:00:00 AM,819000,821900,810000,812399,8721900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/1/2008 12:00:00 AM,809899,811699,786800,790800,9320400,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2008 12:00:00 AM,776900,780000,750100,756500,13796400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2008 12:00:00 AM,757900,770199,748000,758700,12141300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/6/2008 12:00:00 AM,763399,779000,761500,775000,8896400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/7/2008 12:00:00 AM,772300,774700,752500,759100,8434700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n8/8/2008 12:00:00 AM,744199,752699,740599,746100,7185800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/11/2008 12:00:00 AM,747600,749700,715299,720500,15223100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2008 12:00:00 AM,718700,727900,707900,708899,10007600,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2008 12:00:00 AM,702799,730599,701999,724499,11483800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2008 12:00:00 AM,729199,738099,717500,722200,8416200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2008 12:00:00 AM,715999,719400,697799,703000,9277600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2008 12:00:00 AM,713899,713899,686999,692200,8939300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2008 12:00:00 AM,677200,711999,676600,705299,11265700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2008 12:00:00 AM,722600,737099,718099,733399,9519400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2008 12:00:00 AM,743099,754899,737699,747300,8462200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/22/2008 12:00:00 AM,752399,753700,729499,736600,7459000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2008 12:00:00 AM,736900,737300,714899,717399,9797800,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2008 12:00:00 AM,714100,724899,710599,714800,7823400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,-100,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/27/2008 12:00:00 AM,726699,738200,721699,735899,7148700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2008 12:00:00 AM,750199,751900,734499,743099,7052600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2008 12:00:00 AM,744300,749400,731100,733799,4970700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2008 12:00:00 AM,707900,718899,697099,700999,11414500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2008 12:00:00 AM,699199,713300,675100,687399,11956700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2008 12:00:00 AM,679400,682399,640999,648899,18460100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2008 12:00:00 AM,631300,647399,617400,644300,18280600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2008 12:00:00 AM,672500,674899,626399,630499,23604200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2008 12:00:00 AM,612200,620499,579900,583899,22174900,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2008 12:00:00 AM,593100,603899,570200,599500,24011700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2008 12:00:00 AM,571500,608100,569000,606500,22481900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2008 12:00:00 AM,611500,641600,607999,637700,22671600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2008 12:00:00 AM,585299,611699,574500,577999,29446100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2008 12:00:00 AM,544100,588899,535900,585999,31477900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2008 12:00:00 AM,568400,569500,528600,532400,32248200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2008 12:00:00 AM,545000,569399,505900,550000,29223100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/19/2008 12:00:00 AM,630000,650000,605200,632999,28347700,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/22/2008 12:00:00 AM,643700,647900,627900,629500,20275500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/23/2008 12:00:00 AM,620999,628499,580000,589300,22246500,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2008 12:00:00 AM,597500,604199,585000,587799,12053300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/25/2008 12:00:00 AM,610000,626699,604800,619399,16532300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/26/2008 12:00:00 AM,598300,603699,587200,602799,14431700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2008 12:00:00 AM,558499,559199,486600,509900,30342700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2008 12:00:00 AM,532999,565700,531600,563100,21988300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2008 12:00:00 AM,560900,566399,534100,562500,17278600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/2/2008 12:00:00 AM,537900,539000,483800,494599,22342400,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2008 12:00:00 AM,505000,526199,468600,474000,28574800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2008 12:00:00 AM,409599,430999,376699,427599,40806400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2008 12:00:00 AM,433100,440400,378400,382500,35136400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2008 12:00:00 AM,340900,398100,337500,370000,42437400,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2008 12:00:00 AM,396399,414900,352400,357099,32847900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2008 12:00:00 AM,322099,362300,312700,344399,34882700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2008 12:00:00 AM,390499,440000,374000,432500,31200800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2008 12:00:00 AM,470000,474000,418300,435099,33349000,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2008 12:00:00 AM,406399,406500,347000,349700,30325800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2008 12:00:00 AM,366100,373800,329000,369000,31944400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n10/17/2008 12:00:00 AM,368100,403899,340000,375200,30717100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/20/2008 12:00:00 AM,387300,410299,385000,407500,21666700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/21/2008 12:00:00 AM,382400,397500,372599,378400,19133100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/22/2008 12:00:00 AM,347799,352599,303700,328400,28418300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2008 12:00:00 AM,314500,345800,308799,328899,27729900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2008 12:00:00 AM,287400,310000,283899,299400,27774800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/27/2008 12:00:00 AM,300599,306900,285599,289900,21522500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/28/2008 12:00:00 AM,313600,339199,298899,335800,28305000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2008 12:00:00 AM,337099,372500,320999,355700,28886100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2008 12:00:00 AM,372599,397000,372599,390900,29306900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2008 12:00:00 AM,372599,389599,370000,376600,19577300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2008 12:00:00 AM,383699,392200,375800,387900,13145800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/4/2008 12:00:00 AM,403100,433499,402400,425999,24932800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2008 12:00:00 AM,410400,418499,372599,380000,25900000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2008 12:00:00 AM,376100,379300,346100,359599,25206400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2008 12:00:00 AM,372000,385200,365000,380200,22419800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100\n11/10/2008 12:00:00 AM,396399,400900,367000,381800,18616300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2008 12:00:00 AM,363600,377700,351699,368699,19791300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/12/2008 12:00:00 AM,348899,351100,324000,331500,25329700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2008 12:00:00 AM,338699,375000,311100,372400,39333500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2008 12:00:00 AM,347799,359300,337300,345499,25909500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/17/2008 12:00:00 AM,335999,354100,330600,337999,22618700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/18/2008 12:00:00 AM,339599,344800,317500,332099,20862200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2008 12:00:00 AM,320999,325999,296100,302000,24725000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2008 12:00:00 AM,294699,300000,266399,268899,28868400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2008 12:00:00 AM,295200,297999,276500,293600,25033300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n11/24/2008 12:00:00 AM,306800,332900,305400,316800,29872700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n11/25/2008 12:00:00 AM,340800,342000,319100,330099,24582000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2008 12:00:00 AM,325700,365999,324300,362900,19280500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2008 12:00:00 AM,352999,356399,345499,351600,8019400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/1/2008 12:00:00 AM,326899,327700,309300,310599,21376900,0,0,-100,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2008 12:00:00 AM,319400,324900,310900,323600,18171300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2008 12:00:00 AM,313300,322900,301299,314900,19486700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/4/2008 12:00:00 AM,311000,318600,294699,302500,16327800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2008 12:00:00 AM,292999,321399,286500,317199,18491000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2008 12:00:00 AM,328300,340600,325400,331500,24356800,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2008 12:00:00 AM,330400,344599,328200,333200,16118000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2008 12:00:00 AM,343100,361199,341199,351600,19204600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/11/2008 12:00:00 AM,355900,382599,348400,353200,22443300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/12/2008 12:00:00 AM,347099,365499,343699,360800,14488400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2008 12:00:00 AM,363300,368499,350000,357200,13770900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2008 12:00:00 AM,391800,394500,361600,391800,22589800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/17/2008 12:00:00 AM,373200,380000,367500,372999,18745600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/18/2008 12:00:00 AM,378300,378800,351199,359500,17463100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2008 12:00:00 AM,367099,372200,358300,363899,12716800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/22/2008 12:00:00 AM,360999,362700,340200,347900,14906700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2008 12:00:00 AM,337599,338800,322799,327900,14086600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2008 12:00:00 AM,324900,329500,324100,327999,2668300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2008 12:00:00 AM,328800,332400,322300,330600,4120300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0\n12/29/2008 12:00:00 AM,329300,329700,319300,327000,6384400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n12/30/2008 12:00:00 AM,338600,342900,334100,341600,7234600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/31/2008 12:00:00 AM,341600,353100,340200,349900,9452700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2009 12:00:00 AM,348499,374000,347099,367000,9887600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2009 12:00:00 AM,364900,392400,363899,380800,20790600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2009 12:00:00 AM,397700,407900,391199,402500,21317800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/7/2009 12:00:00 AM,389800,390499,372000,378600,18219400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2009 12:00:00 AM,374700,383800,368600,381699,16609800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2009 12:00:00 AM,388100,388899,370900,379100,16126900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2009 12:00:00 AM,370900,371399,352999,358300,19883900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2009 12:00:00 AM,352099,367599,351100,360499,19469800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n1/14/2009 12:00:00 AM,349500,349500,330099,336899,26611500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2009 12:00:00 AM,339900,352599,319599,348699,34127700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2009 12:00:00 AM,360099,362200,342000,353800,20525800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2009 12:00:00 AM,346199,349800,325299,327599,23153400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2009 12:00:00 AM,337500,353400,329900,351399,19970600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2009 12:00:00 AM,338400,346399,330999,341399,18919200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/23/2009 12:00:00 AM,329000,350700,326500,346199,17179100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2009 12:00:00 AM,347000,357200,342200,344000,15758900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2009 12:00:00 AM,349000,353699,343899,349399,13718200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n1/28/2009 12:00:00 AM,361699,374300,359500,368499,20554700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2009 12:00:00 AM,364100,366500,357900,359300,16983200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0\n1/30/2009 12:00:00 AM,362300,367200,350600,355000,19176300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/2/2009 12:00:00 AM,345900,357099,341300,351399,12473800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2009 12:00:00 AM,353400,366800,350499,362500,14319900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2009 12:00:00 AM,369700,383899,363200,366199,24204400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2009 12:00:00 AM,365000,382300,360299,380400,22414300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2009 12:00:00 AM,383300,405600,381100,402500,21251600,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2009 12:00:00 AM,403800,410299,391500,397999,23010900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/10/2009 12:00:00 AM,397200,403899,372200,378400,28231000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2009 12:00:00 AM,386699,392999,371399,382300,22099500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/12/2009 12:00:00 AM,370800,386899,367099,385099,19236700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2009 12:00:00 AM,383800,393499,380999,389900,17472400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/17/2009 12:00:00 AM,374100,375000,361800,364000,21714100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/18/2009 12:00:00 AM,367700,368300,353499,357999,22308100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/19/2009 12:00:00 AM,366100,369800,355999,358499,17040400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/20/2009 12:00:00 AM,344300,349900,336399,344500,28957400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/23/2009 12:00:00 AM,350999,352799,316800,319500,28084600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2009 12:00:00 AM,321100,342300,318300,339800,25533900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2009 12:00:00 AM,339700,350800,325400,342900,34259600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/26/2009 12:00:00 AM,351899,357799,345299,347000,26120200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/27/2009 12:00:00 AM,334599,350800,334000,342000,27201600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2009 12:00:00 AM,331100,333499,315800,317500,31270000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2009 12:00:00 AM,323600,329500,311399,321800,27894300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/4/2009 12:00:00 AM,335400,348800,333600,344500,33228400,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,100,0,0\n3/5/2009 12:00:00 AM,334000,343400,329300,335400,24329300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/6/2009 12:00:00 AM,340499,348300,326800,334700,24602400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/9/2009 12:00:00 AM,328200,339800,327900,330200,21054200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2009 12:00:00 AM,341800,356899,340400,355999,31465400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2009 12:00:00 AM,361300,363200,348800,355200,25205000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2009 12:00:00 AM,354700,367300,350600,366600,23513600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2009 12:00:00 AM,370400,372000,357000,364300,23509200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2009 12:00:00 AM,369300,378200,360900,361399,24441600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2009 12:00:00 AM,359700,373400,356600,372900,20582100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2009 12:00:00 AM,369900,385800,361300,382200,32207100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2009 12:00:00 AM,394700,395299,382799,386100,29261000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2009 12:00:00 AM,384500,391399,380000,380499,22908600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2009 12:00:00 AM,390700,409100,390600,408899,24312000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2009 12:00:00 AM,399300,401899,393100,394700,18476100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/25/2009 12:00:00 AM,398300,407999,389800,399100,25494800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/26/2009 12:00:00 AM,405499,409900,400800,408499,18907700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2009 12:00:00 AM,397300,399599,390099,392000,14810500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/30/2009 12:00:00 AM,380000,380000,367900,372200,22152000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2009 12:00:00 AM,381699,385900,375800,377000,18284100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2009 12:00:00 AM,374800,394199,372400,392400,19925400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2009 12:00:00 AM,413200,422900,411500,418300,25395400,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2009 12:00:00 AM,421600,432599,418899,429500,26709000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2009 12:00:00 AM,422300,424599,414800,422300,15780700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/7/2009 12:00:00 AM,416100,424399,414000,419599,16481100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2009 12:00:00 AM,425400,430000,419700,424900,16279400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/9/2009 12:00:00 AM,438899,447200,438100,447000,23564800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2009 12:00:00 AM,442000,451500,431699,448600,20047000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2009 12:00:00 AM,444000,450800,432999,434199,17929200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2009 12:00:00 AM,431199,437000,428400,435999,16143300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0\n4/16/2009 12:00:00 AM,444599,448800,438100,445600,16112700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/17/2009 12:00:00 AM,446100,447799,437500,438499,14053700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/20/2009 12:00:00 AM,426300,426500,413699,413899,18953800,0,0,0,0,-100,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2009 12:00:00 AM,411800,425900,401699,425400,17430800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2009 12:00:00 AM,420900,431699,418800,423899,20639200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2009 12:00:00 AM,429800,434000,423400,433100,17214100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2009 12:00:00 AM,442200,448300,439000,444700,18855900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/27/2009 12:00:00 AM,435000,440299,427200,429500,18905500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2009 12:00:00 AM,423600,438499,422500,434399,16608400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2009 12:00:00 AM,440600,457599,440600,452200,21670800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2009 12:00:00 AM,457999,464100,450999,450999,17300500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2009 12:00:00 AM,453200,472999,450700,467799,17732600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2009 12:00:00 AM,474800,496500,471800,495700,30268500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2009 12:00:00 AM,498100,500600,485200,492400,28851400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2009 12:00:00 AM,501300,512500,499399,505600,30817100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2009 12:00:00 AM,512099,512500,487400,493499,25494500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2009 12:00:00 AM,508100,512500,496100,510999,21555200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2009 12:00:00 AM,502000,512599,496199,509199,17270400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2009 12:00:00 AM,516500,518200,494300,502900,19262700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2009 12:00:00 AM,486399,487799,474300,476899,22099300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/14/2009 12:00:00 AM,477599,489800,475000,488100,18380700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n5/15/2009 12:00:00 AM,489500,491899,475299,478600,15446300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2009 12:00:00 AM,490000,511100,490000,509700,17437900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2009 12:00:00 AM,510900,526300,507799,515800,23104000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2009 12:00:00 AM,527400,537900,518100,519800,31480600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/21/2009 12:00:00 AM,510499,513699,502500,511199,25583700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2009 12:00:00 AM,515499,519000,508699,516600,16470800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/26/2009 12:00:00 AM,508899,532300,507000,531300,25235700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2009 12:00:00 AM,539900,546300,525400,527300,28931500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2009 12:00:00 AM,538499,546300,530200,545700,24168700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2009 12:00:00 AM,557999,560000,546699,552000,24032100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2009 12:00:00 AM,571500,581500,568899,574100,25948300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/2/2009 12:00:00 AM,572099,579700,567300,572999,28768200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/3/2009 12:00:00 AM,562999,563800,536500,542300,32064100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2009 12:00:00 AM,543300,562500,542700,560700,20904500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2009 12:00:00 AM,573800,574399,551600,558800,25675000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2009 12:00:00 AM,545999,561399,541800,556300,15443600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2009 12:00:00 AM,567500,568200,552000,559800,16629500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2009 12:00:00 AM,570700,572500,548600,559199,21247000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2009 12:00:00 AM,563100,586199,561199,579500,23984900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2009 12:00:00 AM,565499,571800,563600,568800,16534400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/15/2009 12:00:00 AM,558800,558800,535700,546100,20097200,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2009 12:00:00 AM,552900,553600,532000,532300,21912400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2009 12:00:00 AM,526399,534300,515600,530000,26580200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/18/2009 12:00:00 AM,530400,534300,522400,526500,22279600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2009 12:00:00 AM,538600,540200,530900,531699,21386100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/22/2009 12:00:00 AM,518600,520499,498400,499300,25371300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2009 12:00:00 AM,500400,510099,493899,507000,26065200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2009 12:00:00 AM,517900,523600,505499,511699,17542800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2009 12:00:00 AM,509100,533100,506699,532200,22912700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2009 12:00:00 AM,534500,540499,530600,536100,18680400,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/29/2009 12:00:00 AM,539900,540900,532900,534399,14100300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/30/2009 12:00:00 AM,541899,542999,524000,529700,19204400,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2009 12:00:00 AM,542900,547799,535099,536199,17543800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2009 12:00:00 AM,526300,527300,520600,522000,13749200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/6/2009 12:00:00 AM,509700,520299,502400,520200,22875800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2009 12:00:00 AM,515000,516399,495099,497799,20182000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2009 12:00:00 AM,500700,503200,480299,491699,27344600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2009 12:00:00 AM,498300,502999,489599,496199,15368500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/10/2009 12:00:00 AM,485800,495200,482700,493699,15986100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/13/2009 12:00:00 AM,495600,503200,481800,502799,17468800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2009 12:00:00 AM,505700,507700,493800,500499,14927300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2009 12:00:00 AM,515000,532799,514599,530299,34928200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2009 12:00:00 AM,526800,542000,525000,537099,16886600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2009 12:00:00 AM,542999,543699,534199,540600,15435800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2009 12:00:00 AM,553499,559500,550400,557200,19766400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/21/2009 12:00:00 AM,565000,565999,547300,558200,21310200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2009 12:00:00 AM,552200,563100,550499,554100,16366200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2009 12:00:00 AM,558300,576800,555900,569199,21015900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2009 12:00:00 AM,569399,573699,563800,570800,11103300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/27/2009 12:00:00 AM,574100,576699,565099,575299,13170800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n7/28/2009 12:00:00 AM,569399,574599,561699,572500,13101900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2009 12:00:00 AM,563499,564000,553699,559199,17782400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2009 12:00:00 AM,574500,580800,571600,575000,17348800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/31/2009 12:00:00 AM,574800,584399,571600,575999,17352400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/3/2009 12:00:00 AM,598699,607000,593499,603899,19445900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2009 12:00:00 AM,600999,613800,599300,608300,16610500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2009 12:00:00 AM,607799,617500,594500,611899,18526500,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2009 12:00:00 AM,614000,616899,593100,601399,21409100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2009 12:00:00 AM,611300,614800,604000,610299,13781300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/10/2009 12:00:00 AM,605999,609500,598699,608100,13581800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2009 12:00:00 AM,597400,597900,588300,595099,14998600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2009 12:00:00 AM,592300,605299,592000,602099,15784500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2009 12:00:00 AM,609900,610600,600600,608699,16977800,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n8/14/2009 12:00:00 AM,611500,612300,591600,597999,17483400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2009 12:00:00 AM,574500,579800,568300,576600,18613700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/18/2009 12:00:00 AM,579399,590800,578800,589599,12973300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2009 12:00:00 AM,576199,598400,574900,593699,15113200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2009 12:00:00 AM,594000,602900,592700,601500,9752000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2009 12:00:00 AM,610299,615200,607999,614000,12189600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,0,0,0,0,0,0\n8/24/2009 12:00:00 AM,620999,624399,609300,612400,12081100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2009 12:00:00 AM,614900,621399,602099,602500,11553400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2009 12:00:00 AM,599599,604800,594000,602200,10581100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2009 12:00:00 AM,599500,604500,585400,602599,13951600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2009 12:00:00 AM,603400,605600,592200,595400,10758800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/31/2009 12:00:00 AM,585600,587700,577700,582099,13986000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2009 12:00:00 AM,583300,593100,566699,568600,22013200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2009 12:00:00 AM,566800,580099,565000,572900,13278500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2009 12:00:00 AM,581100,583499,574500,582099,13048600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n9/4/2009 12:00:00 AM,586699,600099,582300,598400,12096900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2009 12:00:00 AM,613300,616100,610000,615700,14363500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/9/2009 12:00:00 AM,618600,620900,610900,616300,16003800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2009 12:00:00 AM,616100,630000,612700,629100,15362500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2009 12:00:00 AM,631800,633100,622099,625000,12556400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2009 12:00:00 AM,618100,632999,616800,632500,11539600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2009 12:00:00 AM,633499,641399,627200,639500,13936200,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2009 12:00:00 AM,647799,656600,642600,655400,17691100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2009 12:00:00 AM,651600,661900,645800,649000,15996100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/18/2009 12:00:00 AM,656600,657699,649599,651800,13677100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/21/2009 12:00:00 AM,647099,656500,643000,654000,12388700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2009 12:00:00 AM,661999,677300,656600,667399,17403400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2009 12:00:00 AM,667399,673700,656200,656900,18626700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2009 12:00:00 AM,662099,664000,641200,646699,21458800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2009 12:00:00 AM,648000,656100,644400,653099,15126100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/28/2009 12:00:00 AM,655500,667600,654700,664599,10877000,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2009 12:00:00 AM,669599,670800,660000,665800,11784600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2009 12:00:00 AM,675999,685000,664400,676399,19194700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2009 12:00:00 AM,677600,678200,658399,660299,17552600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2009 12:00:00 AM,652399,677399,650700,673000,29566600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2009 12:00:00 AM,677399,693399,673300,692900,19506600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2009 12:00:00 AM,702399,710000,689800,697600,25563800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/7/2009 12:00:00 AM,696100,700700,688700,699700,17068100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2009 12:00:00 AM,706200,717900,700599,716900,18317300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2009 12:00:00 AM,716900,723099,713700,721200,12797100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/12/2009 12:00:00 AM,730599,736800,723600,729400,10457800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/13/2009 12:00:00 AM,724700,729800,717699,728000,15106100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2009 12:00:00 AM,743000,758200,740800,757500,19650700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2009 12:00:00 AM,752300,763300,750000,760400,15501300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/16/2009 12:00:00 AM,747500,758499,743499,754899,19572000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2009 12:00:00 AM,755500,770700,751200,762500,17615000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2009 12:00:00 AM,740800,742500,711299,733399,54516500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2009 12:00:00 AM,736900,762699,736500,745100,26678600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n10/22/2009 12:00:00 AM,746500,754800,734800,751500,16043200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2009 12:00:00 AM,763700,763899,740500,743399,15300900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2009 12:00:00 AM,750000,758499,726399,736600,17793400,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2009 12:00:00 AM,731200,735299,713200,714800,22804400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2009 12:00:00 AM,711500,714800,666999,669100,33833400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2009 12:00:00 AM,689599,727099,689000,720599,28425100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n10/30/2009 12:00:00 AM,728600,728899,679000,688300,35206700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2009 12:00:00 AM,696200,709899,680400,695899,18851500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/3/2009 12:00:00 AM,679199,716900,677399,710100,23801800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2009 12:00:00 AM,725400,735700,710100,725700,23586000,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/5/2009 12:00:00 AM,729899,746999,726999,746800,17723000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/6/2009 12:00:00 AM,734599,747399,733000,743899,14831700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/9/2009 12:00:00 AM,756999,776200,756600,770400,17504000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/10/2009 12:00:00 AM,763099,773700,751900,766900,15904100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/11/2009 12:00:00 AM,775500,775899,753899,760400,14170100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2009 12:00:00 AM,756999,763499,729899,735400,16990500,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2009 12:00:00 AM,733700,755199,730199,749599,18974900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2009 12:00:00 AM,757399,771100,756399,767699,14150100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/17/2009 12:00:00 AM,766200,778399,754100,777600,14116500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2009 12:00:00 AM,781900,782300,756699,765000,19326000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2009 12:00:00 AM,759100,760599,742300,758499,17214200,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n11/20/2009 12:00:00 AM,751200,755000,740999,750899,12805100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/23/2009 12:00:00 AM,768499,771999,758000,761999,13854000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/24/2009 12:00:00 AM,759100,767399,749300,767399,13526700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2009 12:00:00 AM,770000,782600,763899,778600,12283100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2009 12:00:00 AM,741800,766399,741100,755800,17733000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2009 12:00:00 AM,763899,767099,754100,764700,18285900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/1/2009 12:00:00 AM,779000,794000,777699,789199,18720200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2009 12:00:00 AM,791299,801200,790199,797900,16691400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/3/2009 12:00:00 AM,804899,809300,786100,788799,14994300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2009 12:00:00 AM,804100,808499,770999,779000,21124800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2009 12:00:00 AM,777399,791900,773099,777699,17890800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/8/2009 12:00:00 AM,770000,770899,751800,760100,18489000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2009 12:00:00 AM,756100,765400,750199,764899,14976600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2009 12:00:00 AM,769100,774899,759800,770199,10395000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/11/2009 12:00:00 AM,775199,777399,769199,774400,13177600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/14/2009 12:00:00 AM,782900,784100,776200,781399,10448900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/15/2009 12:00:00 AM,775400,783499,772500,774400,12549400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,-100,0,0,0\n12/16/2009 12:00:00 AM,778499,783799,766800,771200,13657200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2009 12:00:00 AM,753799,757200,733499,735500,21065300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2009 12:00:00 AM,732099,743700,728499,738000,17023200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n12/21/2009 12:00:00 AM,744000,748600,730299,733700,13311400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2009 12:00:00 AM,719499,721699,711299,720599,13588700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/23/2009 12:00:00 AM,725299,734199,716500,727300,10581100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/24/2009 12:00:00 AM,735199,739199,732500,737900,3427100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/28/2009 12:00:00 AM,748799,749000,740000,741299,5923700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2009 12:00:00 AM,747900,748399,741399,742500,8633000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/30/2009 12:00:00 AM,744100,748399,741100,745299,7850900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/31/2009 12:00:00 AM,751399,751800,739599,746100,5246700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2010 12:00:00 AM,762399,774199,760000,771900,12115900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2010 12:00:00 AM,774000,779100,766399,772799,12605000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/6/2010 12:00:00 AM,771699,782900,769400,777900,11989600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2010 12:00:00 AM,773000,774400,765000,769300,9750900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2010 12:00:00 AM,773899,779599,770000,774700,9772600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/11/2010 12:00:00 AM,780000,781399,765100,772799,10018500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2010 12:00:00 AM,759599,770999,755000,761100,15398800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/13/2010 12:00:00 AM,769100,770700,750100,758899,18802600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2010 12:00:00 AM,754599,758099,742900,744800,19433900,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2010 12:00:00 AM,746699,747500,730599,735400,21758900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2010 12:00:00 AM,737600,748799,737099,746200,12202000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2010 12:00:00 AM,732799,733099,712099,724599,21743300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2010 12:00:00 AM,719300,723200,689300,691299,31602000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2010 12:00:00 AM,684400,694199,674800,679700,26948300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/25/2010 12:00:00 AM,690299,692500,673099,679000,17155200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2010 12:00:00 AM,669000,681399,661900,668300,21053800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/27/2010 12:00:00 AM,661999,668000,651800,665400,26161600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2010 12:00:00 AM,670899,672200,650199,663600,22456200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2010 12:00:00 AM,670100,675000,643200,646900,26721800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2010 12:00:00 AM,655899,677300,654499,675999,19448900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2010 12:00:00 AM,683300,690100,675000,687099,19502700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2010 12:00:00 AM,682900,686600,675599,677600,15321400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/4/2010 12:00:00 AM,663200,664199,635099,637200,32291900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2010 12:00:00 AM,634399,638800,608499,636899,38632400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2010 12:00:00 AM,634300,646299,626399,628400,22577800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2010 12:00:00 AM,650400,666100,646299,653700,33275200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/10/2010 12:00:00 AM,657699,661100,645000,653300,22129400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2010 12:00:00 AM,654599,673300,647300,669300,24164000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2010 12:00:00 AM,653600,668600,650299,666299,19550500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2010 12:00:00 AM,678300,687699,673899,683399,16904400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/17/2010 12:00:00 AM,690700,692500,679000,685299,21792000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2010 12:00:00 AM,682300,700500,682300,698200,20770300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2010 12:00:00 AM,690599,703200,689800,697500,19053300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2010 12:00:00 AM,702500,702500,689300,691600,17408200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2010 12:00:00 AM,684899,688499,667699,673300,20879800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2010 12:00:00 AM,676600,681500,668099,673399,17222100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/25/2010 12:00:00 AM,655199,679700,651500,675000,21681000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2010 12:00:00 AM,679499,686600,670999,683700,16268400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2010 12:00:00 AM,690599,697699,688300,696800,15988100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/2/2010 12:00:00 AM,705700,714700,702500,705899,18195800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/3/2010 12:00:00 AM,712600,723499,701500,705800,23456600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2010 12:00:00 AM,710000,711800,695299,705599,17721400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2010 12:00:00 AM,717099,722600,713000,721999,19166100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/8/2010 12:00:00 AM,722200,725599,712399,716699,13109600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/9/2010 12:00:00 AM,710899,736600,710000,730599,20653200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2010 12:00:00 AM,733600,743200,729899,736500,16992900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/11/2010 12:00:00 AM,734899,739400,727300,738499,12398100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2010 12:00:00 AM,742600,743000,731299,732300,13590900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2010 12:00:00 AM,730400,734599,722500,731999,14684000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/16/2010 12:00:00 AM,731999,740500,728700,739700,17340700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2010 12:00:00 AM,744499,746999,732799,735700,15831700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2010 12:00:00 AM,729700,735800,720000,724400,18034800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2010 12:00:00 AM,713000,729199,711699,713000,21307000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/22/2010 12:00:00 AM,702600,719700,699100,717399,17466500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2010 12:00:00 AM,727200,729599,720000,727200,16217000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/24/2010 12:00:00 AM,717900,728399,712200,715599,17519500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/25/2010 12:00:00 AM,721600,723600,701699,702799,20617900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2010 12:00:00 AM,705999,709400,695000,704400,17157500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/29/2010 12:00:00 AM,710800,724499,710500,723399,15164000,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2010 12:00:00 AM,729300,731999,721800,727699,12459400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/31/2010 12:00:00 AM,727200,737799,726600,736399,12179800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2010 12:00:00 AM,747200,753399,745700,749499,17455700,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n4/5/2010 12:00:00 AM,757399,758700,750500,753000,11379400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/6/2010 12:00:00 AM,749400,759499,749100,755800,12796700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2010 12:00:00 AM,753700,755100,739100,744100,18544600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2010 12:00:00 AM,737399,754800,735299,753099,14058600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2010 12:00:00 AM,754800,757300,748899,754499,13304200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/12/2010 12:00:00 AM,755299,757399,745999,749899,11675600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2010 12:00:00 AM,747399,752699,738000,749000,16133300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/14/2010 12:00:00 AM,756800,759400,751399,757300,12372200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/15/2010 12:00:00 AM,755100,760899,747399,749599,15094700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2010 12:00:00 AM,745700,748799,727200,733600,26516600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2010 12:00:00 AM,727600,737399,720999,730999,22373400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/20/2010 12:00:00 AM,740400,743399,734700,736900,15262400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/21/2010 12:00:00 AM,735599,762600,717600,729899,16976900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/22/2010 12:00:00 AM,724700,735800,715899,734899,24432700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2010 12:00:00 AM,730500,737900,724599,736299,15516100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2010 12:00:00 AM,741500,743300,733000,735000,13715500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2010 12:00:00 AM,724800,726100,698899,700500,34043500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2010 12:00:00 AM,711200,713300,693099,710100,29270400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/29/2010 12:00:00 AM,719899,732200,718000,731999,25414500,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2010 12:00:00 AM,730700,733000,720700,722600,21305400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/3/2010 12:00:00 AM,726999,731699,712600,718000,18575200,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2010 12:00:00 AM,705299,705599,679000,679700,34456100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2010 12:00:00 AM,666200,685400,657699,671999,27807900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/6/2010 12:00:00 AM,662200,677799,600000,643300,54077600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2010 12:00:00 AM,639399,653799,613600,639000,52557100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/10/2010 12:00:00 AM,692300,693600,665500,691699,37866800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n5/11/2010 12:00:00 AM,677500,692099,674499,674499,27046800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2010 12:00:00 AM,683300,690400,680000,682200,24158100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0\n5/13/2010 12:00:00 AM,683600,688899,676100,676100,20227800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/14/2010 12:00:00 AM,667200,668799,647200,657799,32554000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2010 12:00:00 AM,656999,663499,631800,650899,37060600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/18/2010 12:00:00 AM,664400,665199,628300,630800,35935700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2010 12:00:00 AM,614599,624700,600999,615700,46182700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/20/2010 12:00:00 AM,589100,601899,575299,586100,55560100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/21/2010 12:00:00 AM,576199,612099,575600,611399,44533300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2010 12:00:00 AM,613400,619500,599599,602799,29558400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2010 12:00:00 AM,576500,598499,571800,597799,39479500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/26/2010 12:00:00 AM,608100,623300,594900,600999,35001800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2010 12:00:00 AM,626800,638600,621300,637799,31108100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/28/2010 12:00:00 AM,633300,640000,625700,635200,24356400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/1/2010 12:00:00 AM,633499,646200,625900,626600,30656300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2010 12:00:00 AM,633499,649300,628899,647699,24151600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2010 12:00:00 AM,652399,656399,624700,641399,21990800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2010 12:00:00 AM,629399,637300,616500,619399,25028900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2010 12:00:00 AM,621600,625400,607700,608699,18008200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/8/2010 12:00:00 AM,614399,627500,608699,624000,25710900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2010 12:00:00 AM,634199,640899,622999,624800,27420700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2010 12:00:00 AM,643399,653099,642300,650999,25446000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/11/2010 12:00:00 AM,642699,657900,641999,656500,15284200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2010 12:00:00 AM,664499,665000,649199,649700,19607300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2010 12:00:00 AM,656999,670400,654499,668799,14828400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2010 12:00:00 AM,661500,676900,660299,671399,13448800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2010 12:00:00 AM,675999,677200,661699,668200,15113200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2010 12:00:00 AM,669899,677500,667699,671999,13300500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/21/2010 12:00:00 AM,687399,690000,674700,679199,17699100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2010 12:00:00 AM,682900,689300,667300,668000,23880100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2010 12:00:00 AM,663799,668200,653499,666999,16474400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2010 12:00:00 AM,664400,664700,649499,655400,19057500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2010 12:00:00 AM,658499,669899,652699,669100,15959100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2010 12:00:00 AM,669800,670800,659800,661200,10549300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/29/2010 12:00:00 AM,641600,642099,622500,627500,23149200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2010 12:00:00 AM,629399,640199,618300,618300,17929300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2010 12:00:00 AM,622400,630000,608800,629700,25402300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2010 12:00:00 AM,635900,640999,627700,638699,14267100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2010 12:00:00 AM,649300,652399,632300,641299,17725300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2010 12:00:00 AM,641399,660899,641299,660199,18542600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2010 12:00:00 AM,662900,667900,655000,666100,15450300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2010 12:00:00 AM,667099,678899,665199,673399,11125400,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2010 12:00:00 AM,668399,672699,654800,659199,16361900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2010 12:00:00 AM,666699,672300,664100,669300,12711100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/14/2010 12:00:00 AM,661100,669499,658000,664199,11769500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/15/2010 12:00:00 AM,662900,664499,651500,661500,15070000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n7/16/2010 12:00:00 AM,656699,657200,640500,641500,19281900,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2010 12:00:00 AM,647200,653200,643499,650700,13239500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/20/2010 12:00:00 AM,646999,673300,646299,672300,23189800,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2010 12:00:00 AM,677900,680500,663600,669300,16181100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2010 12:00:00 AM,679800,695899,679100,690299,18502500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2010 12:00:00 AM,686800,695299,682799,694700,15675700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2010 12:00:00 AM,692300,695100,687799,692399,12995000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/27/2010 12:00:00 AM,700000,701200,688600,690000,16256100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2010 12:00:00 AM,690700,700999,690199,695000,13719800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2010 12:00:00 AM,701600,705400,691100,698300,15292600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/30/2010 12:00:00 AM,691699,707300,689100,703799,17765300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2010 12:00:00 AM,715800,723700,714300,720800,19331100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/3/2010 12:00:00 AM,713700,720000,709199,712300,17328000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/4/2010 12:00:00 AM,716900,718899,706200,716600,14626500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/5/2010 12:00:00 AM,713099,718300,712099,717600,9411500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/6/2010 12:00:00 AM,713499,719199,706500,710800,14225400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/9/2010 12:00:00 AM,716500,717500,710899,711200,8171200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2010 12:00:00 AM,703000,708399,698700,705000,15577400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/11/2010 12:00:00 AM,693300,699800,680899,681600,19129900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2010 12:00:00 AM,675000,687600,673300,686200,13805200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n8/13/2010 12:00:00 AM,688099,694800,685999,686100,12573100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2010 12:00:00 AM,689000,699899,686800,699599,10856800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2010 12:00:00 AM,708499,710700,704199,708000,12557200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/18/2010 12:00:00 AM,706999,710199,701900,708000,10974200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/19/2010 12:00:00 AM,704800,706500,693799,698700,19614900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2010 12:00:00 AM,695000,695700,687399,694800,11401200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n8/23/2010 12:00:00 AM,699000,701200,681500,683000,12135100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2010 12:00:00 AM,674100,679300,668899,674000,20366800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/25/2010 12:00:00 AM,669100,673000,660700,670800,17792300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2010 12:00:00 AM,676200,677600,660100,661100,15368700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2010 12:00:00 AM,669800,686900,663399,686900,21871300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2010 12:00:00 AM,681299,683700,668300,669000,10846800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2010 12:00:00 AM,673300,682200,671900,677500,16865600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2010 12:00:00 AM,689899,707799,689599,705500,19287500,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2010 12:00:00 AM,706900,708799,701699,708200,13144400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n9/3/2010 12:00:00 AM,717500,719599,705800,706299,16579800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2010 12:00:00 AM,703799,705299,695199,695400,14888100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/8/2010 12:00:00 AM,704800,709499,702699,704899,12440700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/9/2010 12:00:00 AM,710199,711600,702399,707799,8317800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2010 12:00:00 AM,710999,711600,706500,709100,7420400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2010 12:00:00 AM,719100,729700,718799,728399,15692700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2010 12:00:00 AM,729100,732699,723300,726500,14866500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/15/2010 12:00:00 AM,720000,724199,715400,723300,13902700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2010 12:00:00 AM,722399,725199,720000,724300,10656800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2010 12:00:00 AM,724100,727099,715800,717799,11117500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2010 12:00:00 AM,720299,726200,715500,724599,14795300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2010 12:00:00 AM,722500,728899,716600,728799,20596400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2010 12:00:00 AM,731900,739300,726500,734000,28158400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2010 12:00:00 AM,731299,750700,729100,741800,28527200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2010 12:00:00 AM,746699,752500,735700,739000,19572800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2010 12:00:00 AM,739700,747300,734199,743899,18160300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2010 12:00:00 AM,748099,755000,738499,754000,24462400,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2010 12:00:00 AM,754000,764599,752699,761500,29916600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2010 12:00:00 AM,769499,771299,760999,769499,21116100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2010 12:00:00 AM,769499,783300,769499,781200,16773300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2010 12:00:00 AM,779700,783399,774599,781600,16755500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2010 12:00:00 AM,785599,799499,783000,796800,25495600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2010 12:00:00 AM,794899,796500,783499,786399,19436200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2010 12:00:00 AM,790999,792099,768899,775800,18886900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2010 12:00:00 AM,777600,794100,776500,790299,13632300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2010 12:00:00 AM,794899,799899,791999,793000,8337200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/12/2010 12:00:00 AM,788300,794199,780899,790999,12636400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/13/2010 12:00:00 AM,801900,813000,800599,809199,14763200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2010 12:00:00 AM,805999,812099,801999,805299,16466400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/15/2010 12:00:00 AM,811800,812399,799700,804000,17042300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2010 12:00:00 AM,799000,809899,797900,800700,12727400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/19/2010 12:00:00 AM,781200,787600,770299,776500,25719800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/20/2010 12:00:00 AM,779499,791299,778399,784400,19473500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n10/21/2010 12:00:00 AM,781999,788000,759000,766800,26005400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2010 12:00:00 AM,775000,775299,756999,760999,18335600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2010 12:00:00 AM,769300,775199,765299,768000,12324100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/26/2010 12:00:00 AM,764300,780700,763799,777399,12520900,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2010 12:00:00 AM,772799,773200,757500,762399,19315600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2010 12:00:00 AM,770000,773300,759599,766699,11073000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2010 12:00:00 AM,769300,772399,766800,770400,12639700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/1/2010 12:00:00 AM,774400,787300,774000,780299,15263800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n11/2/2010 12:00:00 AM,791399,794899,783499,792300,11606800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/3/2010 12:00:00 AM,793200,794499,782399,793799,15045100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n11/4/2010 12:00:00 AM,803399,817699,803300,815800,16522800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2010 12:00:00 AM,814100,815700,805299,811600,11470100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2010 12:00:00 AM,803000,811299,800700,808200,8553800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2010 12:00:00 AM,810999,812399,784300,791299,13044600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2010 12:00:00 AM,791800,794400,777300,788799,13580300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2010 12:00:00 AM,779400,783499,776299,779599,10192400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/12/2010 12:00:00 AM,770999,779100,760199,767500,16466000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/15/2010 12:00:00 AM,773300,777799,768000,769100,7385400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2010 12:00:00 AM,758000,760199,739499,748000,24625900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2010 12:00:00 AM,752799,760299,748499,750800,11630500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/18/2010 12:00:00 AM,766200,774300,764199,771999,15276700,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/19/2010 12:00:00 AM,768899,773899,763099,772600,10672000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2010 12:00:00 AM,764100,769800,753600,763099,10858300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/23/2010 12:00:00 AM,745400,748799,736600,741200,17772100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/24/2010 12:00:00 AM,754599,763099,753600,759400,12711700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2010 12:00:00 AM,744199,751999,742699,748099,6878100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/29/2010 12:00:00 AM,743499,753499,731999,753200,18488600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2010 12:00:00 AM,742799,756200,740000,748499,19170900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2010 12:00:00 AM,762099,769000,757699,765599,13935700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2010 12:00:00 AM,768700,775700,767799,774300,16094800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2010 12:00:00 AM,769300,783200,767699,781500,13466000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2010 12:00:00 AM,777699,780500,774899,776900,11803600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/7/2010 12:00:00 AM,790800,791600,767099,769000,14166500,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2010 12:00:00 AM,768600,772099,755899,759000,14904400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2010 12:00:00 AM,761100,761900,745299,749599,17998500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2010 12:00:00 AM,749800,756500,746299,756299,12257800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2010 12:00:00 AM,762500,772099,760100,768399,13668500,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2010 12:00:00 AM,763700,771800,762699,769100,12489100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2010 12:00:00 AM,760999,763799,751999,753099,13276900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2010 12:00:00 AM,755999,758099,749599,753099,11960200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2010 12:00:00 AM,749499,757300,748000,756900,13289400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/20/2010 12:00:00 AM,756200,757300,745000,749300,18893800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2010 12:00:00 AM,734100,744199,734100,738399,13257900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2010 12:00:00 AM,736500,746200,733200,745899,7527400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2010 12:00:00 AM,740000,747099,738499,745000,7217600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2010 12:00:00 AM,740000,742600,737600,740400,5616300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/28/2010 12:00:00 AM,741699,742799,736699,741200,6243500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/29/2010 12:00:00 AM,744199,759899,743799,759199,10437500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2010 12:00:00 AM,763700,770199,754000,769800,11290400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2010 12:00:00 AM,768200,776900,764700,774000,5138800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2011 12:00:00 AM,779199,786500,778799,781200,20403100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n1/4/2011 12:00:00 AM,779599,784800,768200,784700,15588300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2011 12:00:00 AM,776100,786399,775500,775500,23164700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2011 12:00:00 AM,774700,776699,765800,767799,13912700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2011 12:00:00 AM,771500,772399,755599,760800,15535400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2011 12:00:00 AM,756500,757900,751900,753099,17291400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/11/2011 12:00:00 AM,762099,770899,760000,769300,16840000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2011 12:00:00 AM,775999,790899,775599,786399,20668600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2011 12:00:00 AM,787300,789800,770800,774000,10707000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2011 12:00:00 AM,769599,776100,768700,774000,7535600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/18/2011 12:00:00 AM,777900,780199,774100,778399,8851200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/19/2011 12:00:00 AM,778399,778799,763600,768799,13372200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2011 12:00:00 AM,763200,764199,751699,758499,14580300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2011 12:00:00 AM,764000,764400,749300,749899,15494600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2011 12:00:00 AM,750800,759899,748799,759899,11008500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2011 12:00:00 AM,757300,757300,745599,752500,9645700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2011 12:00:00 AM,759700,759800,749599,752699,11373000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2011 12:00:00 AM,753000,755700,740000,741399,14852800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2011 12:00:00 AM,740999,740999,712900,725500,26181200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2011 12:00:00 AM,730000,736399,727300,731999,16662100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/1/2011 12:00:00 AM,740000,749499,739100,746800,13373800,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/2/2011 12:00:00 AM,745199,749300,731600,733799,15492300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2011 12:00:00 AM,733399,735800,725700,733000,13201400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/4/2011 12:00:00 AM,726999,727900,712600,720500,16995200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2011 12:00:00 AM,714100,723099,713000,713200,15379000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2011 12:00:00 AM,723600,724899,715899,723600,15603300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,100,-100,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n2/9/2011 12:00:00 AM,714300,716999,701399,703799,18135500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2011 12:00:00 AM,703300,716299,700999,702200,16355600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/11/2011 12:00:00 AM,705100,720999,701200,719000,18441700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2011 12:00:00 AM,715400,728899,715299,726299,11951800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2011 12:00:00 AM,723600,731900,723600,727200,9700900,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2011 12:00:00 AM,731299,738899,727799,738700,15789700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2011 12:00:00 AM,735899,745400,734000,742699,12753100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2011 12:00:00 AM,741600,748799,740000,748200,11955300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2011 12:00:00 AM,732900,742300,724300,725599,18923800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2011 12:00:00 AM,724400,736299,720999,731999,17127300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2011 12:00:00 AM,739599,739700,730999,738000,15257400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2011 12:00:00 AM,741500,743899,732200,738899,14437800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2011 12:00:00 AM,741399,746600,735700,742699,10625300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/1/2011 12:00:00 AM,746100,746999,730800,731299,9669400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2011 12:00:00 AM,731100,748200,730999,743399,14982200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2011 12:00:00 AM,751900,755800,745100,754700,12848600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2011 12:00:00 AM,755999,760199,749599,757099,12928500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/7/2011 12:00:00 AM,758499,759800,740100,747900,11761000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2011 12:00:00 AM,747600,753099,736999,748399,7300500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/9/2011 12:00:00 AM,746100,752200,743399,744800,8538300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/10/2011 12:00:00 AM,733499,735000,722600,725400,14277500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2011 12:00:00 AM,721800,738099,720199,731399,17805900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2011 12:00:00 AM,728200,741299,727099,739899,9976400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2011 12:00:00 AM,713700,736100,712200,732200,20871400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2011 12:00:00 AM,734800,737600,709700,717699,24898600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2011 12:00:00 AM,725999,728399,713799,719300,17682500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2011 12:00:00 AM,730299,734400,727799,733000,17282800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/21/2011 12:00:00 AM,741500,741900,734800,735899,10741100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/22/2011 12:00:00 AM,738300,749100,736200,747099,11214500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/23/2011 12:00:00 AM,747799,753899,744400,752300,14499700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2011 12:00:00 AM,754700,756299,747900,751999,10079000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2011 12:00:00 AM,752200,759899,749800,752600,12156900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/28/2011 12:00:00 AM,750100,757600,743700,744400,11289700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2011 12:00:00 AM,748099,756500,744000,752300,11115500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2011 12:00:00 AM,760400,769499,758799,767200,12266300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/31/2011 12:00:00 AM,772699,778799,772399,775100,11241600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/1/2011 12:00:00 AM,785000,793700,780700,792200,16069100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2011 12:00:00 AM,795400,798200,790299,797799,11201500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2011 12:00:00 AM,794499,800800,792300,795100,11899700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/6/2011 12:00:00 AM,800899,800999,785400,786600,12432900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2011 12:00:00 AM,794199,799000,789800,793799,14041900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/8/2011 12:00:00 AM,800999,802300,791399,796100,11344600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2011 12:00:00 AM,794599,797099,783099,784700,8453200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2011 12:00:00 AM,778200,779199,763300,766800,18670400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2011 12:00:00 AM,773700,774400,755500,762699,19279400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2011 12:00:00 AM,761500,771999,760199,765000,11838600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2011 12:00:00 AM,769599,772699,761500,771100,11629800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/18/2011 12:00:00 AM,757099,758300,745500,756200,15768200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,-200,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n4/19/2011 12:00:00 AM,763099,770700,761999,766500,12206700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/20/2011 12:00:00 AM,780299,781900,773399,780400,11632900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/21/2011 12:00:00 AM,787399,788700,779499,785999,4345800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2011 12:00:00 AM,782200,785599,776999,781699,8253200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/26/2011 12:00:00 AM,781999,789800,779800,788300,9004800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2011 12:00:00 AM,789300,789499,770999,778899,13077700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2011 12:00:00 AM,763899,769599,760100,768399,19074100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2011 12:00:00 AM,769100,788099,769000,777200,9600000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2011 12:00:00 AM,778499,778899,765400,767799,10637500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2011 12:00:00 AM,758600,762500,749300,752300,15512700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2011 12:00:00 AM,755500,755700,732500,733799,20418400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2011 12:00:00 AM,733600,740899,720899,728499,21986100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/6/2011 12:00:00 AM,743399,749000,731299,740199,20499300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/9/2011 12:00:00 AM,741100,744300,731600,743000,12004800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2011 12:00:00 AM,745599,751600,743300,749899,9495100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/11/2011 12:00:00 AM,740299,740400,727099,730500,16749700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2011 12:00:00 AM,724499,736200,718700,731100,16662600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2011 12:00:00 AM,729499,729800,710700,715800,16618500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2011 12:00:00 AM,712699,728300,711600,715599,12538600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2011 12:00:00 AM,711100,727799,708300,727399,20473000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2011 12:00:00 AM,729499,736100,724000,727500,14880000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/19/2011 12:00:00 AM,728600,731299,716800,719100,13958800,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2011 12:00:00 AM,719899,726800,713499,719300,14074200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/23/2011 12:00:00 AM,703399,713399,701900,709400,16134700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2011 12:00:00 AM,718499,724100,716800,721699,9181700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/25/2011 12:00:00 AM,718099,726900,717399,720700,9944700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/26/2011 12:00:00 AM,726299,734400,720999,734100,10503100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2011 12:00:00 AM,739800,747500,739000,743399,12709400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/31/2011 12:00:00 AM,752600,753399,742099,752200,15201200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n6/1/2011 12:00:00 AM,749300,751200,735199,736500,13138900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2011 12:00:00 AM,739300,748499,734899,746500,16537400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2011 12:00:00 AM,740500,756399,739499,749000,13695200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2011 12:00:00 AM,745000,746999,727799,730899,17476400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2011 12:00:00 AM,736500,741500,732200,733099,12361300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/8/2011 12:00:00 AM,732900,736200,725800,730100,11550100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/9/2011 12:00:00 AM,729499,738700,726299,734000,11226000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2011 12:00:00 AM,730800,730899,719000,721699,11846100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2011 12:00:00 AM,724100,728399,716900,719100,15970000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2011 12:00:00 AM,724000,730800,723399,726800,13493900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2011 12:00:00 AM,717399,721699,711200,714499,19203900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/16/2011 12:00:00 AM,709899,717099,698700,705700,17939700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/17/2011 12:00:00 AM,712799,713700,703600,708899,17667600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2011 12:00:00 AM,708099,715400,706999,712500,12856300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/21/2011 12:00:00 AM,714300,720400,713000,717300,12053600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/22/2011 12:00:00 AM,705899,715199,705899,707500,13128800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2011 12:00:00 AM,696100,702399,690400,698200,15026600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/24/2011 12:00:00 AM,705500,705999,695599,695700,10101000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2011 12:00:00 AM,694400,705899,693300,704300,8316900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/28/2011 12:00:00 AM,705299,722699,704899,722699,12959500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2011 12:00:00 AM,722699,729499,717900,728499,11659300,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n6/30/2011 12:00:00 AM,733600,734599,729199,733499,10405800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n7/1/2011 12:00:00 AM,732600,746500,729000,741600,14815400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2011 12:00:00 AM,743300,744499,736500,738899,11000300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/6/2011 12:00:00 AM,733399,736200,728300,732399,12057400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/7/2011 12:00:00 AM,739199,742200,733000,735000,13649800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2011 12:00:00 AM,726699,728600,717300,721500,23231100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2011 12:00:00 AM,707399,709400,699599,700500,14295200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2011 12:00:00 AM,701500,707200,694199,694499,15521700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2011 12:00:00 AM,700599,712200,696800,706299,15443500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2011 12:00:00 AM,708399,708399,692300,695400,14351700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2011 12:00:00 AM,700000,701100,690500,695999,10383500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2011 12:00:00 AM,687500,690800,682200,687900,11130400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/19/2011 12:00:00 AM,694100,699000,689499,695700,10294400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/20/2011 12:00:00 AM,700400,701699,693799,696800,9178500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/21/2011 12:00:00 AM,703300,714300,702699,710199,17020300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2011 12:00:00 AM,713600,715999,707600,713399,10273400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/25/2011 12:00:00 AM,709700,719800,708200,715700,14143900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2011 12:00:00 AM,717200,721900,711900,717500,14222900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/27/2011 12:00:00 AM,704100,707300,693899,701800,26775400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/28/2011 12:00:00 AM,699000,705000,695500,697399,14961300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/29/2011 12:00:00 AM,696100,705899,691200,705700,11374500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2011 12:00:00 AM,714599,714599,692900,700999,14381300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2011 12:00:00 AM,695000,696500,679400,681200,17072300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2011 12:00:00 AM,677399,679700,657399,669599,22586400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2011 12:00:00 AM,649300,655299,623899,624700,42813600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2011 12:00:00 AM,634599,639900,602400,628300,37179700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2011 12:00:00 AM,594800,602799,559700,570000,39257400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2011 12:00:00 AM,579900,597400,559500,595700,35431100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2011 12:00:00 AM,580999,600700,570700,578400,34505400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/11/2011 12:00:00 AM,594199,613600,580400,606300,24633600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2011 12:00:00 AM,610600,617300,602400,613499,15106400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/15/2011 12:00:00 AM,624100,634900,624000,631199,15653400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/16/2011 12:00:00 AM,623600,630400,617500,626600,16693600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/17/2011 12:00:00 AM,633499,639500,626899,639100,12905300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/18/2011 12:00:00 AM,612700,614100,598899,612000,27834600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n8/19/2011 12:00:00 AM,606300,620999,601300,603100,20106100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2011 12:00:00 AM,616199,617900,598400,601500,11373800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2011 12:00:00 AM,600299,615400,592200,614800,24075400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2011 12:00:00 AM,610700,620099,602900,612099,16512500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/25/2011 12:00:00 AM,612099,615900,599000,605099,19170700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2011 12:00:00 AM,604199,616100,593300,613200,18031400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2011 12:00:00 AM,622999,635200,621399,632500,10220000,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2011 12:00:00 AM,628600,644899,626699,641399,13776500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2011 12:00:00 AM,647600,655199,645000,655000,21493900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/1/2011 12:00:00 AM,660500,667500,657600,659100,27285600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0\n9/2/2011 12:00:00 AM,641900,643300,627300,638600,20652700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2011 12:00:00 AM,605400,629399,604599,629300,19762200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2011 12:00:00 AM,637999,648600,631300,645100,10163700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2011 12:00:00 AM,634599,644499,633200,637200,12788300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2011 12:00:00 AM,620700,621899,605700,609700,20436700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2011 12:00:00 AM,599900,607000,582000,599900,25148900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/13/2011 12:00:00 AM,603200,604100,591899,598600,18264300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2011 12:00:00 AM,600099,608600,583400,603699,18151000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/15/2011 12:00:00 AM,615400,619100,604199,609199,12417700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/16/2011 12:00:00 AM,611899,614000,604599,609500,13198900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/19/2011 12:00:00 AM,588899,595999,580499,594399,13838600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2011 12:00:00 AM,589700,597400,583400,587700,13951100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/21/2011 12:00:00 AM,580700,584000,560700,562000,20864100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2011 12:00:00 AM,529700,544199,516500,523899,41353900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2011 12:00:00 AM,524399,537500,522500,535999,25236800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2011 12:00:00 AM,538100,546500,519900,544900,21423900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2011 12:00:00 AM,560499,567599,554199,555999,16754600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n9/28/2011 12:00:00 AM,554300,562099,539900,541699,16197100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2011 12:00:00 AM,549700,554399,531699,540299,17292100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2011 12:00:00 AM,530800,535000,517000,520099,18107600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2011 12:00:00 AM,518400,523499,507099,508899,20254900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2011 12:00:00 AM,502900,511199,492500,509700,31300000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2011 12:00:00 AM,514000,524599,508800,521899,26889900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/6/2011 12:00:00 AM,531699,549700,530200,547900,23901500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2011 12:00:00 AM,558100,560099,535200,540400,21587000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2011 12:00:00 AM,556399,565700,555200,561500,21319400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/11/2011 12:00:00 AM,557200,574000,555900,567200,16815600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/12/2011 12:00:00 AM,575499,594300,574599,583200,18105400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/13/2011 12:00:00 AM,576899,579800,566100,577900,22618300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/14/2011 12:00:00 AM,587700,590600,580700,587900,16080800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/17/2011 12:00:00 AM,579900,581500,564599,564800,17023200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2011 12:00:00 AM,564900,583800,557200,580000,21598900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n10/19/2011 12:00:00 AM,573800,581199,568499,573800,16335800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/20/2011 12:00:00 AM,568200,569800,549599,562900,21869500,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2011 12:00:00 AM,569399,579500,569399,575499,17034400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/24/2011 12:00:00 AM,577700,600700,576899,598600,25630000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2011 12:00:00 AM,595600,596500,580499,586699,19508000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2011 12:00:00 AM,597999,600700,584900,596399,25748700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/27/2011 12:00:00 AM,625499,641299,621300,631399,29068600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2011 12:00:00 AM,626800,645299,626199,645100,20484900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2011 12:00:00 AM,635299,636199,623300,623699,15610000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2011 12:00:00 AM,590800,611899,588800,605600,30111100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2011 12:00:00 AM,617700,623800,611399,617900,12939200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/3/2011 12:00:00 AM,623699,624000,613200,619700,15554800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2011 12:00:00 AM,615900,622300,607200,620299,10638300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2011 12:00:00 AM,623899,628800,620900,624900,11976300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/8/2011 12:00:00 AM,626600,632799,619900,632400,12193500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2011 12:00:00 AM,610499,612799,596399,599900,17764000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/10/2011 12:00:00 AM,613100,614399,598600,604000,13150300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2011 12:00:00 AM,613100,622300,612000,617599,10263700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2011 12:00:00 AM,612799,614100,605999,610200,11439300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2011 12:00:00 AM,607099,618600,604300,613499,8480700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/16/2011 12:00:00 AM,604800,616300,602999,604300,10491500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/17/2011 12:00:00 AM,608300,611300,588100,591899,19133300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2011 12:00:00 AM,596199,596300,585099,590499,13322000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2011 12:00:00 AM,577000,581199,566600,577799,17152900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/22/2011 12:00:00 AM,575099,579900,565000,571500,13059600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/23/2011 12:00:00 AM,559800,559800,547000,549900,14198600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2011 12:00:00 AM,544000,551800,540099,542999,10864900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/28/2011 12:00:00 AM,561199,565200,558600,563899,20629600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/29/2011 12:00:00 AM,559399,570299,555800,557900,19094900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/30/2011 12:00:00 AM,590900,593600,581600,590200,21725300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/1/2011 12:00:00 AM,597999,606600,597500,598800,16258100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/2/2011 12:00:00 AM,610499,610900,598600,600099,14533600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2011 12:00:00 AM,614300,617300,610200,614800,17715000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/6/2011 12:00:00 AM,609100,618200,605700,613600,12630100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2011 12:00:00 AM,611300,614300,605800,611199,14650500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/8/2011 12:00:00 AM,600000,603600,586300,588600,22448800,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2011 12:00:00 AM,591899,604700,591199,602999,17460600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n12/12/2011 12:00:00 AM,590900,590900,577400,584800,18274300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2011 12:00:00 AM,587200,590900,572000,576500,27362800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2011 12:00:00 AM,572000,574700,563200,565499,22886900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2011 12:00:00 AM,576800,578600,564800,565900,14270400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2011 12:00:00 AM,571699,574599,564300,569399,16766800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/19/2011 12:00:00 AM,566699,568400,555700,556899,15165800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2011 12:00:00 AM,570099,578400,569700,575400,17782600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2011 12:00:00 AM,569700,575000,564000,573800,11505800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/22/2011 12:00:00 AM,572900,582300,571100,579900,12372500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/23/2011 12:00:00 AM,581500,583600,577799,583300,6284100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/27/2011 12:00:00 AM,580999,583699,580299,581199,3671200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/28/2011 12:00:00 AM,576500,576600,563600,565499,14468100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/29/2011 12:00:00 AM,568300,570499,564000,569199,7490200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/30/2011 12:00:00 AM,570000,575999,569500,573899,4083600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/3/2012 12:00:00 AM,590999,601100,590600,597000,20052500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2012 12:00:00 AM,595800,604700,595600,599199,11113200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2012 12:00:00 AM,594399,595200,585800,591100,11539200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2012 12:00:00 AM,595099,595099,584000,585200,9808400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2012 12:00:00 AM,593200,598499,590000,597500,11339600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2012 12:00:00 AM,612700,615700,608899,609800,17726800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2012 12:00:00 AM,608699,615400,607799,613300,13344900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2012 12:00:00 AM,615900,622500,614300,621300,12477500,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2012 12:00:00 AM,608400,614199,603600,613499,14258100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2012 12:00:00 AM,629399,632099,625099,628100,18555000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/18/2012 12:00:00 AM,632700,647099,630999,646100,20712900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/19/2012 12:00:00 AM,645700,650299,644400,648000,20351700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2012 12:00:00 AM,647099,651100,643600,650500,18970900,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2012 12:00:00 AM,648499,658499,648000,655100,24059300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2012 12:00:00 AM,647399,656699,643899,655599,13531300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2012 12:00:00 AM,649899,669599,649199,668499,13578600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2012 12:00:00 AM,668300,672399,656600,659100,23445400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2012 12:00:00 AM,658200,664300,657200,660700,13095800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2012 12:00:00 AM,649199,656299,645299,654100,14083900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2012 12:00:00 AM,661200,663099,651200,655999,12235500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2012 12:00:00 AM,665899,677300,665500,673399,16350800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2012 12:00:00 AM,677500,681100,673799,677900,15096200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/3/2012 12:00:00 AM,685599,688399,682099,682699,15846200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2012 12:00:00 AM,679199,685199,677300,681299,10129200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2012 12:00:00 AM,685000,691100,678499,688899,15713400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2012 12:00:00 AM,693200,696500,687699,689300,12967200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2012 12:00:00 AM,688700,689000,681999,688200,13826300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/10/2012 12:00:00 AM,674100,674100,667399,673899,17663100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/13/2012 12:00:00 AM,683399,689100,679199,687699,11901600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2012 12:00:00 AM,682399,684599,671699,677699,12345100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/15/2012 12:00:00 AM,682200,682600,670000,673099,17903000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/16/2012 12:00:00 AM,670000,685700,667399,684700,15279400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2012 12:00:00 AM,688000,688899,682900,687399,10911800,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n2/21/2012 12:00:00 AM,690599,692699,683200,686399,8691000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0\n2/22/2012 12:00:00 AM,688000,691299,684800,687500,12713400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/23/2012 12:00:00 AM,688899,690000,682200,686800,11376200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2012 12:00:00 AM,691200,696200,690400,693000,11622600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/27/2012 12:00:00 AM,687099,690599,684400,687099,10338600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/28/2012 12:00:00 AM,694100,701200,690400,700700,16569200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/29/2012 12:00:00 AM,700500,705400,688600,691800,23969800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/1/2012 12:00:00 AM,695899,705800,695899,704199,16558000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2012 12:00:00 AM,703099,707399,699400,703000,11226000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/5/2012 12:00:00 AM,700299,700700,689000,689899,20118800,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2012 12:00:00 AM,673700,674199,661100,666100,25283900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2012 12:00:00 AM,663499,673099,663099,670800,14008100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/8/2012 12:00:00 AM,679300,683000,673799,680199,13493200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/9/2012 12:00:00 AM,675500,680800,670700,672600,12194400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2012 12:00:00 AM,661600,665400,654499,662699,15289500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/13/2012 12:00:00 AM,663099,682399,661600,681600,19180900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2012 12:00:00 AM,678099,682500,670800,678200,21256100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/15/2012 12:00:00 AM,680199,680999,674400,676600,13589900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/16/2012 12:00:00 AM,676399,679899,673799,675599,19251700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/19/2012 12:00:00 AM,672200,680599,672200,674899,10718700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2012 12:00:00 AM,662200,666699,659300,665700,12323600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/21/2012 12:00:00 AM,665100,667300,658700,665599,12328900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/22/2012 12:00:00 AM,657399,658600,651399,654100,13797600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/23/2012 12:00:00 AM,655800,660800,651900,658099,11248400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,-100,0,0,0,0,0\n3/26/2012 12:00:00 AM,663600,669800,662200,669100,11109700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2012 12:00:00 AM,668700,672200,662200,663600,11213800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2012 12:00:00 AM,661399,661699,647799,649199,19892100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/29/2012 12:00:00 AM,641800,649300,637500,648799,12808500,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2012 12:00:00 AM,653700,653799,644599,646600,11481400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2012 12:00:00 AM,644700,657799,642600,653799,8464600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2012 12:00:00 AM,655500,656900,641999,647500,12733500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2012 12:00:00 AM,639199,641399,633699,635800,12203000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/5/2012 12:00:00 AM,632900,639900,630900,635700,9563500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2012 12:00:00 AM,625999,632999,624399,630800,10338800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/10/2012 12:00:00 AM,627000,628400,613400,618499,20354800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2012 12:00:00 AM,625400,626699,617200,618800,10210800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/12/2012 12:00:00 AM,622300,636600,621800,636199,14643300,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2012 12:00:00 AM,631300,635000,621899,625000,13628900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2012 12:00:00 AM,631100,631699,617500,620999,17689000,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2012 12:00:00 AM,624100,628100,619100,622599,15308700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/18/2012 12:00:00 AM,616300,623499,615000,619199,13542900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2012 12:00:00 AM,617200,620099,610499,615700,13125700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/20/2012 12:00:00 AM,620999,626399,619599,621300,11930100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/23/2012 12:00:00 AM,608400,610400,601800,608300,17006200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/24/2012 12:00:00 AM,611500,613800,609500,611600,10159100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,100,0,0,0\n4/25/2012 12:00:00 AM,615400,615700,602300,606800,17126500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2012 12:00:00 AM,601399,611199,600499,609700,11612500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n4/27/2012 12:00:00 AM,611800,612599,606199,607999,10251900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/30/2012 12:00:00 AM,608699,608899,600299,602599,9166700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2012 12:00:00 AM,601399,611100,601399,605999,6152400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2012 12:00:00 AM,603200,605800,600200,603100,15467000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/3/2012 12:00:00 AM,602900,603699,593200,600299,12437600,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/4/2012 12:00:00 AM,599599,600099,583499,585900,18236500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2012 12:00:00 AM,582599,590700,580299,588499,12979600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n5/8/2012 12:00:00 AM,582300,582700,572799,576300,17718400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2012 12:00:00 AM,564800,572400,560900,567500,17448200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/10/2012 12:00:00 AM,573600,576899,569100,570999,14057600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/11/2012 12:00:00 AM,565000,577599,564000,565299,15681900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/14/2012 12:00:00 AM,549800,550800,542200,542500,25454700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2012 12:00:00 AM,542200,548300,531199,532000,19615500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2012 12:00:00 AM,545499,545700,525400,530999,25535300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2012 12:00:00 AM,530099,531600,514199,515600,27079400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2012 12:00:00 AM,518200,520299,507599,515400,28953000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2012 12:00:00 AM,514500,527599,514300,526100,17104900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2012 12:00:00 AM,522500,530000,508699,511500,27974700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2012 12:00:00 AM,510000,513499,495600,512200,31080300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2012 12:00:00 AM,514900,515200,502000,511199,20946300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/25/2012 12:00:00 AM,513800,524199,511800,521399,23910500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/29/2012 12:00:00 AM,532599,533400,522300,526600,20035500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2012 12:00:00 AM,511800,517900,511300,515400,18660400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/31/2012 12:00:00 AM,513100,522400,506100,520400,20340500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2012 12:00:00 AM,508499,515999,506600,507400,18611800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2012 12:00:00 AM,508499,512999,505000,506100,15084900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2012 12:00:00 AM,512300,517000,506399,508200,17262500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2012 12:00:00 AM,511100,521800,510000,520400,20603200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2012 12:00:00 AM,529700,537799,525900,527900,16572500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/8/2012 12:00:00 AM,518400,520999,514100,520400,17001400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2012 12:00:00 AM,526899,527599,508100,508200,20008600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2012 12:00:00 AM,512300,516500,508800,515700,16108600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2012 12:00:00 AM,513899,523600,512300,515999,16734900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2012 12:00:00 AM,515800,520700,511600,518100,20770200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/15/2012 12:00:00 AM,521699,525400,518899,524399,18689800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/18/2012 12:00:00 AM,518800,527999,517099,525800,13616500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2012 12:00:00 AM,530800,547000,529399,545000,35087400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2012 12:00:00 AM,545099,548499,534800,540999,23539800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2012 12:00:00 AM,528200,529500,511199,511899,23502400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2012 12:00:00 AM,515499,516500,505000,507500,16880400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2012 12:00:00 AM,497400,499000,490499,493499,23755100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2012 12:00:00 AM,492799,497799,489199,494199,18446000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/27/2012 12:00:00 AM,494599,496600,487900,493100,21906300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/28/2012 12:00:00 AM,488600,492099,482700,490700,26908500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2012 12:00:00 AM,510400,517999,507500,517000,27866800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2012 12:00:00 AM,520900,526500,518499,525800,15748200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/3/2012 12:00:00 AM,529900,535000,527099,534000,14643300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2012 12:00:00 AM,530200,538600,523400,532400,18461100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/6/2012 12:00:00 AM,523899,525400,516800,521699,14337000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2012 12:00:00 AM,520299,520600,513600,517700,6993100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2012 12:00:00 AM,523499,524000,506500,509100,13962500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2012 12:00:00 AM,508600,515299,503400,507900,13003300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/12/2012 12:00:00 AM,498499,507300,495800,504199,12815300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2012 12:00:00 AM,510800,516300,510700,513100,10592200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/16/2012 12:00:00 AM,513400,514300,506600,510400,8647300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2012 12:00:00 AM,512999,516800,506100,515700,11377500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2012 12:00:00 AM,511600,520200,510400,519199,9533000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2012 12:00:00 AM,521199,527799,520200,527000,10304200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2012 12:00:00 AM,520200,522300,515299,517200,12197600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/23/2012 12:00:00 AM,501199,505200,494800,503699,17182500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2012 12:00:00 AM,506699,506800,495999,500900,12262800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2012 12:00:00 AM,504399,505999,497300,500299,8252100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2012 12:00:00 AM,509300,517700,505700,516899,12701400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2012 12:00:00 AM,522999,538400,521100,535600,21005000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2012 12:00:00 AM,532500,535999,527200,534800,11554500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2012 12:00:00 AM,534199,535999,524000,524500,13528900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2012 12:00:00 AM,526399,530400,518699,526500,12950800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/2/2012 12:00:00 AM,519900,527000,515200,519800,13093100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/3/2012 12:00:00 AM,532500,539399,531199,534800,13978600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2012 12:00:00 AM,534100,547700,532999,542099,12260300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2012 12:00:00 AM,546300,551100,542000,542500,11881500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n8/8/2012 12:00:00 AM,543100,551500,542500,550099,11117200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2012 12:00:00 AM,550000,554000,546100,550000,10831600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/10/2012 12:00:00 AM,546899,556100,544199,554900,12237000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2012 12:00:00 AM,550000,554199,545200,550900,12322500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/14/2012 12:00:00 AM,552400,554500,541399,543100,14639800,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2012 12:00:00 AM,544300,547099,540900,545499,11363500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/16/2012 12:00:00 AM,551199,556800,545700,555000,14811100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2012 12:00:00 AM,554700,556800,551800,553699,11907700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n8/20/2012 12:00:00 AM,552099,554599,547400,553800,8953900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2012 12:00:00 AM,556199,559000,545700,548400,13227600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2012 12:00:00 AM,547900,552599,542400,550400,14238700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2012 12:00:00 AM,546699,547099,538499,541600,14973600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2012 12:00:00 AM,538800,546100,535099,542500,11241000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2012 12:00:00 AM,537900,540099,535600,537099,10816400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n8/28/2012 12:00:00 AM,536300,539000,533100,535800,7722800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/29/2012 12:00:00 AM,532700,533200,522099,527099,15173300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2012 12:00:00 AM,522700,525200,520099,523300,8524000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/31/2012 12:00:00 AM,525000,530000,522900,527200,11344500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2012 12:00:00 AM,525800,526600,516800,517599,12148800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2012 12:00:00 AM,520800,524000,517000,522500,11213700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2012 12:00:00 AM,526699,538600,526600,537799,13622900,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/7/2012 12:00:00 AM,544100,559100,543499,552799,19208200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2012 12:00:00 AM,548100,549700,540299,540900,14327700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n9/11/2012 12:00:00 AM,543699,549900,543699,548400,8825300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2012 12:00:00 AM,550299,551500,542900,548300,19162100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2012 12:00:00 AM,546800,564800,545200,564700,26394100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/14/2012 12:00:00 AM,569100,580800,566500,570600,24965900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/17/2012 12:00:00 AM,567400,569599,562200,564800,11229800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2012 12:00:00 AM,563499,568400,561500,564900,11670000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/19/2012 12:00:00 AM,565499,569000,561100,562700,17343500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2012 12:00:00 AM,557799,563600,554399,561300,13700600,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2012 12:00:00 AM,564300,566100,558100,559300,15129300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/24/2012 12:00:00 AM,558100,561899,555999,559599,8558200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n9/25/2012 12:00:00 AM,558699,559100,545999,547700,18343200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2012 12:00:00 AM,544800,547000,539000,546300,13168200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2012 12:00:00 AM,550000,550999,543200,547599,12638600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/28/2012 12:00:00 AM,541899,544000,536199,540600,19531000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/1/2012 12:00:00 AM,543100,550200,542500,545400,13696000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/2/2012 12:00:00 AM,549199,550999,543699,545700,11274600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2012 12:00:00 AM,545999,545999,539100,540000,12053100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2012 12:00:00 AM,540600,545400,536300,543600,11582800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2012 12:00:00 AM,549399,550499,540900,542200,14003800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2012 12:00:00 AM,540200,548600,538699,547500,11085900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2012 12:00:00 AM,546300,546500,539399,542700,12265500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2012 12:00:00 AM,544300,544599,535700,538300,14769500,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2012 12:00:00 AM,542700,545600,541800,542599,11182800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/12/2012 12:00:00 AM,544399,546800,538699,540000,10885200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2012 12:00:00 AM,543200,548300,539900,545999,12447700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2012 12:00:00 AM,549599,554000,546399,548400,10360500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/17/2012 12:00:00 AM,551199,554900,549500,551800,12612100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/18/2012 12:00:00 AM,550000,552900,546300,551199,13125400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/19/2012 12:00:00 AM,550700,555299,543200,543899,11244200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2012 12:00:00 AM,542700,547700,541600,547300,9390100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2012 12:00:00 AM,537999,538200,530700,533300,14711100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2012 12:00:00 AM,536100,538100,530700,532400,8495600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2012 12:00:00 AM,541899,543100,536600,538100,20107600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/26/2012 12:00:00 AM,539199,541100,535800,536199,11300100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/31/2012 12:00:00 AM,537500,538800,530900,533499,14569000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2012 12:00:00 AM,535900,545499,534900,544000,11590200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/2/2012 12:00:00 AM,548600,549300,538100,541600,14675900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2012 12:00:00 AM,540000,544500,538600,544199,8003500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/6/2012 12:00:00 AM,545900,551800,544300,548600,11456800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2012 12:00:00 AM,545000,545099,537999,540600,16088800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2012 12:00:00 AM,540800,546100,528800,531899,18639600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/9/2012 12:00:00 AM,528200,534300,525999,527700,16140800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/12/2012 12:00:00 AM,528499,528600,523400,525000,10479900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/13/2012 12:00:00 AM,520700,526399,519100,520400,15809500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/14/2012 12:00:00 AM,520800,521699,510600,512599,15009100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2012 12:00:00 AM,512200,515400,508300,512099,11372400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/16/2012 12:00:00 AM,514100,514500,504900,510600,14597200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2012 12:00:00 AM,515999,520600,514399,518800,16673800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/20/2012 12:00:00 AM,515999,520700,513600,519199,8509100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/21/2012 12:00:00 AM,515000,522700,510499,515099,17470800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/23/2012 12:00:00 AM,517799,522700,517799,521600,8598300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2012 12:00:00 AM,519900,522599,517000,520600,8358600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/27/2012 12:00:00 AM,524199,525200,512099,514300,14015800,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/28/2012 12:00:00 AM,510600,517099,507900,515200,17961600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n11/29/2012 12:00:00 AM,513699,522300,512200,518800,12515100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/30/2012 12:00:00 AM,516300,516699,510700,515800,19090900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/3/2012 12:00:00 AM,521100,521600,515099,515099,13282300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2012 12:00:00 AM,520299,522000,512599,514599,14528600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2012 12:00:00 AM,519199,525700,515999,523400,15645700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2012 12:00:00 AM,521300,528499,521300,527700,12063000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/7/2012 12:00:00 AM,531100,531500,526500,530700,11155500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/10/2012 12:00:00 AM,530499,536300,530499,535400,10855700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2012 12:00:00 AM,535999,541800,534900,540099,14498900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/12/2012 12:00:00 AM,540299,544599,537300,540499,11589700,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/13/2012 12:00:00 AM,540700,545200,535499,536699,11155700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/14/2012 12:00:00 AM,539700,543600,537400,541899,8319000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2012 12:00:00 AM,541300,542300,538800,540900,9004000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/18/2012 12:00:00 AM,538100,546300,534900,543499,15836000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2012 12:00:00 AM,547400,554300,546399,550900,17092500,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2012 12:00:00 AM,551899,555900,550000,555400,12279200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/21/2012 12:00:00 AM,545999,552099,545200,549700,16617900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/24/2012 12:00:00 AM,548499,549599,546600,548300,3028800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/26/2012 12:00:00 AM,554399,557599,551600,551800,8956300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/27/2012 12:00:00 AM,552099,555400,546800,554399,8778200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/28/2012 12:00:00 AM,549900,555600,549700,552599,6504600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2012 12:00:00 AM,548800,560700,546100,559399,7901800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2013 12:00:00 AM,566600,569900,565000,569599,14852500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/3/2013 12:00:00 AM,567099,576899,565700,573200,16609200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/4/2013 12:00:00 AM,569500,572900,567999,571800,11774200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/7/2013 12:00:00 AM,569199,570000,565299,568600,9654600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/8/2013 12:00:00 AM,564599,564700,559000,560999,10719100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2013 12:00:00 AM,563699,566800,561600,564399,10407400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/10/2013 12:00:00 AM,568200,570000,562300,569800,11638000,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/11/2013 12:00:00 AM,565099,565299,560700,564100,10946500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2013 12:00:00 AM,568899,570700,565099,566800,9612700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/15/2013 12:00:00 AM,563899,565700,562099,565000,6250000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/16/2013 12:00:00 AM,559399,563899,558800,563300,6353200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2013 12:00:00 AM,568800,570600,567500,568499,10297800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/18/2013 12:00:00 AM,565900,568800,565499,568400,10856100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2013 12:00:00 AM,564800,568300,558300,568200,8792200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2013 12:00:00 AM,569100,569800,565999,568400,10626700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2013 12:00:00 AM,570099,573800,563100,567000,11655800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/25/2013 12:00:00 AM,567000,572500,564500,567700,7035800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/28/2013 12:00:00 AM,570000,570000,561800,566100,10092700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2013 12:00:00 AM,569500,572999,565999,572000,9879900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2013 12:00:00 AM,563800,567599,560999,565700,19704100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2013 12:00:00 AM,565200,569300,562200,567700,15402700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/1/2013 12:00:00 AM,572999,573100,570000,570800,8669700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2013 12:00:00 AM,565000,565400,560999,562999,10578900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/5/2013 12:00:00 AM,567999,568400,560999,561199,12801600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2013 12:00:00 AM,559399,561300,556600,561100,13626900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2013 12:00:00 AM,566800,567799,555999,559800,13416100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/8/2013 12:00:00 AM,560900,561699,556600,559399,7287400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2013 12:00:00 AM,560900,560999,555200,558300,6629700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2013 12:00:00 AM,558400,561800,555600,559000,4541900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/13/2013 12:00:00 AM,562200,565400,561500,564100,14653400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/14/2013 12:00:00 AM,559900,562700,558699,561500,8545300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/15/2013 12:00:00 AM,562700,564199,559900,561699,12964200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/19/2013 12:00:00 AM,565400,566500,561699,563200,9158200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/20/2013 12:00:00 AM,562200,562799,550000,550900,15102600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/21/2013 12:00:00 AM,548800,548800,539900,542500,28635100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/22/2013 12:00:00 AM,548800,548899,544000,548200,15373500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n2/25/2013 12:00:00 AM,549800,551699,540400,542000,15582800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/26/2013 12:00:00 AM,543300,547799,537300,546600,13193600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/27/2013 12:00:00 AM,544000,551100,543600,550299,9823900,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2013 12:00:00 AM,551300,555400,550299,551300,9891000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/1/2013 12:00:00 AM,546199,552300,544800,552000,10155200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2013 12:00:00 AM,547000,550200,543899,547799,12680200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/5/2013 12:00:00 AM,552900,557500,548800,550999,15203200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/6/2013 12:00:00 AM,556699,567000,555299,564399,16087800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/7/2013 12:00:00 AM,570000,577599,569500,572900,24135300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/8/2013 12:00:00 AM,572900,577500,571100,576500,15017100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/11/2013 12:00:00 AM,573100,574500,568600,572599,11518300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/12/2013 12:00:00 AM,574500,576100,567999,570400,8164600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2013 12:00:00 AM,570499,570999,560999,562900,13830700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2013 12:00:00 AM,563100,565499,556899,560200,11587800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/15/2013 12:00:00 AM,562500,563200,556500,557300,14692400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2013 12:00:00 AM,550200,557200,549300,553200,9539700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2013 12:00:00 AM,555200,556199,546500,550600,16775400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2013 12:00:00 AM,550600,551300,546500,547400,9797200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/21/2013 12:00:00 AM,544599,545600,537599,538499,13523700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2013 12:00:00 AM,538600,539700,534700,537000,11039400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2013 12:00:00 AM,535600,540299,531699,533899,15891700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/26/2013 12:00:00 AM,535999,541300,535299,537099,12016500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/27/2013 12:00:00 AM,533600,544300,531500,542300,14976900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2013 12:00:00 AM,544800,545600,540000,544800,9867200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/1/2013 12:00:00 AM,543699,544900,539100,539700,8013300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2013 12:00:00 AM,542099,542099,534300,535900,10634500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2013 12:00:00 AM,532799,536100,531100,533499,13228000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/4/2013 12:00:00 AM,536199,537700,530600,532300,12760100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2013 12:00:00 AM,528600,542999,525999,541100,14828900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2013 12:00:00 AM,541399,542000,535400,540700,11353300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/9/2013 12:00:00 AM,545400,554000,542799,551399,14020300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2013 12:00:00 AM,555999,563899,555800,557099,14235800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/11/2013 12:00:00 AM,556600,556899,548800,552000,14856200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2013 12:00:00 AM,549700,554700,541800,549800,12859600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/15/2013 12:00:00 AM,539700,540999,528400,529100,22691300,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2013 12:00:00 AM,533499,538699,530299,537099,13967900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2013 12:00:00 AM,532200,533100,521199,525099,16912800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/18/2013 12:00:00 AM,524800,527999,519399,524399,18593800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/19/2013 12:00:00 AM,528899,533200,526800,532000,14844900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/22/2013 12:00:00 AM,530299,532099,525900,531199,6330500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n4/23/2013 12:00:00 AM,533899,541500,532099,537599,15996000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2013 12:00:00 AM,540600,544700,540099,542900,8633500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/25/2013 12:00:00 AM,541199,547599,540400,545600,11827900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/26/2013 12:00:00 AM,542599,544500,534000,537200,10225800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2013 12:00:00 AM,542099,544199,537900,541600,9600200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/30/2013 12:00:00 AM,539000,553300,538300,551500,14472800,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2013 12:00:00 AM,549500,550200,541699,544700,9538700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2013 12:00:00 AM,549500,550800,545099,546800,12251300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/3/2013 12:00:00 AM,552599,556500,548100,548100,9921600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2013 12:00:00 AM,547999,548499,542799,547400,14050500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n5/7/2013 12:00:00 AM,547900,557500,547500,555700,12381800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2013 12:00:00 AM,559599,561800,554300,556699,10897200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2013 12:00:00 AM,557700,560900,548800,552300,14890100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/10/2013 12:00:00 AM,551600,552799,546300,548100,11574000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/13/2013 12:00:00 AM,548300,550000,543699,547300,8701400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/14/2013 12:00:00 AM,546600,550499,543699,544000,8210100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2013 12:00:00 AM,544000,547599,542599,544300,8663200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/16/2013 12:00:00 AM,545099,549800,542900,544199,10808000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/17/2013 12:00:00 AM,544500,548200,542300,544599,6767100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/20/2013 12:00:00 AM,545900,550400,542900,549300,11591600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2013 12:00:00 AM,550600,555200,546100,552700,8150800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2013 12:00:00 AM,554100,560700,547599,549100,12801300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2013 12:00:00 AM,542900,547799,540000,546500,14081700,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2013 12:00:00 AM,545800,546300,539000,545800,10009000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n5/28/2013 12:00:00 AM,548400,550900,541800,543100,10084900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2013 12:00:00 AM,535099,537999,522099,524000,22687100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2013 12:00:00 AM,522300,530400,520099,523699,12520700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/31/2013 12:00:00 AM,518300,519000,504000,508899,22703700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2013 12:00:00 AM,511300,516199,506699,514800,17652800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2013 12:00:00 AM,517300,517999,506699,511300,10550300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2013 12:00:00 AM,514000,515400,501100,501500,19921000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2013 12:00:00 AM,500000,504900,497799,504100,21756700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,-100,0,0,0,0\n6/7/2013 12:00:00 AM,495600,503800,491500,497300,19374300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/10/2013 12:00:00 AM,490999,494100,486500,491899,13761400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/11/2013 12:00:00 AM,477999,485700,475700,482300,23708100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2013 12:00:00 AM,482799,484399,469900,472900,21269800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2013 12:00:00 AM,476300,484500,473699,482700,16509300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2013 12:00:00 AM,486399,486399,474599,476300,13341800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2013 12:00:00 AM,475900,480600,469000,473800,14426300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/18/2013 12:00:00 AM,469000,473400,465499,470900,17644700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/19/2013 12:00:00 AM,469599,472799,452200,453899,23545100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2013 12:00:00 AM,435700,443600,429300,439399,41857000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/21/2013 12:00:00 AM,438699,440900,429900,439399,26875200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/24/2013 12:00:00 AM,429700,434900,416500,430700,25470400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/25/2013 12:00:00 AM,436899,439800,429000,437700,16910200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,100,0,0,0\n6/26/2013 12:00:00 AM,443600,449199,441500,445800,31061700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/27/2013 12:00:00 AM,439300,446600,439300,442900,13597900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/28/2013 12:00:00 AM,434900,440600,432500,438600,17370000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/1/2013 12:00:00 AM,437000,442300,434000,437900,11768800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/2/2013 12:00:00 AM,433300,436300,417300,423300,22060400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2013 12:00:00 AM,417700,423899,415700,420400,13509800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/5/2013 12:00:00 AM,417000,418699,406800,414700,21821800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2013 12:00:00 AM,417400,420200,413899,414599,17928600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2013 12:00:00 AM,417700,422900,417000,419700,9713000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n7/10/2013 12:00:00 AM,417400,421899,414100,415200,16564400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2013 12:00:00 AM,425700,430000,420400,429399,23020100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2013 12:00:00 AM,426100,427900,421500,422900,12485200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0\n7/15/2013 12:00:00 AM,424100,437599,424100,434800,14324500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2013 12:00:00 AM,438300,438300,429199,432900,16876600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2013 12:00:00 AM,439399,442500,437700,439900,18236700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/18/2013 12:00:00 AM,440000,445800,439700,442000,14568400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n7/19/2013 12:00:00 AM,437700,439199,435700,437200,12882300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/22/2013 12:00:00 AM,438300,447900,436500,445299,15599400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2013 12:00:00 AM,452700,453899,450000,451600,22942700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/24/2013 12:00:00 AM,449000,449900,438300,442900,19743100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2013 12:00:00 AM,440600,448300,439900,447599,13236700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2013 12:00:00 AM,447400,447700,440299,446600,16021500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2013 12:00:00 AM,445000,445400,440099,442000,11405900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/30/2013 12:00:00 AM,443899,444199,435400,436699,12542300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2013 12:00:00 AM,435099,439900,430299,435000,17948900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/1/2013 12:00:00 AM,439500,442000,436699,438899,13793600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/2/2013 12:00:00 AM,438300,444500,437999,439599,9417700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2013 12:00:00 AM,436800,438100,432300,432900,10661900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2013 12:00:00 AM,433699,434800,425999,427799,16171800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2013 12:00:00 AM,424199,429000,423499,424599,11449000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/8/2013 12:00:00 AM,430700,441699,427599,438200,21953200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2013 12:00:00 AM,440999,448899,440200,446100,16067200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2013 12:00:00 AM,451300,456899,444300,447000,20394900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2013 12:00:00 AM,444900,447000,440600,444199,17518100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/14/2013 12:00:00 AM,444100,447200,440200,441300,29348100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/15/2013 12:00:00 AM,434300,442200,432599,439500,24555600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2013 12:00:00 AM,437099,437500,428200,431399,21861500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2013 12:00:00 AM,429500,432000,423800,424900,25516200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2013 12:00:00 AM,424599,427999,420999,421199,19588300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2013 12:00:00 AM,417599,419399,410099,412599,23077400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2013 12:00:00 AM,416300,420900,414700,419599,18572100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/23/2013 12:00:00 AM,426699,438499,424500,437799,24200700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2013 12:00:00 AM,437300,437400,427599,430400,16273000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2013 12:00:00 AM,421899,425299,419399,425000,19183400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2013 12:00:00 AM,423600,430900,421100,424199,12003800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/29/2013 12:00:00 AM,424300,430400,421300,423600,10493600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/30/2013 12:00:00 AM,427000,427000,417799,423899,13682400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2013 12:00:00 AM,428800,431399,425400,429199,15526200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/4/2013 12:00:00 AM,426699,432799,425600,432200,11652100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2013 12:00:00 AM,432500,446100,431800,442599,16891500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/6/2013 12:00:00 AM,450700,455000,446800,452900,21852000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2013 12:00:00 AM,457999,470200,457599,469300,39513000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2013 12:00:00 AM,472500,474399,466300,470299,26020400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2013 12:00:00 AM,467599,471199,463499,468100,14979400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/12/2013 12:00:00 AM,469300,469800,462599,462700,13869600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/13/2013 12:00:00 AM,465000,467200,462000,466699,7708500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2013 12:00:00 AM,475400,475999,467099,467300,12077200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2013 12:00:00 AM,471100,474800,471100,473200,12455600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/18/2013 12:00:00 AM,476500,499399,474500,497200,33022000,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2013 12:00:00 AM,495299,496899,488800,495499,27033800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/20/2013 12:00:00 AM,496600,497599,483699,485200,19729300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2013 12:00:00 AM,487900,491899,486800,490000,15608400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2013 12:00:00 AM,490000,492300,486399,489399,16086500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/25/2013 12:00:00 AM,486899,487799,480600,482500,17682200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2013 12:00:00 AM,484599,486600,478800,482000,10317100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2013 12:00:00 AM,478800,482799,477999,479399,10844500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/30/2013 12:00:00 AM,478400,483100,476399,479100,17928400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2013 12:00:00 AM,480800,483800,478899,483699,14071600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/2/2013 12:00:00 AM,484599,489800,483100,488899,11702700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/3/2013 12:00:00 AM,485999,488100,481100,484000,17706400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/4/2013 12:00:00 AM,480299,486500,479800,485299,8402100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2013 12:00:00 AM,481600,487500,481399,485200,7850300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2013 12:00:00 AM,486699,487400,479900,482099,10732000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2013 12:00:00 AM,484599,486800,480000,484599,12679600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/10/2013 12:00:00 AM,490800,495999,489100,493499,14400500,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2013 12:00:00 AM,494000,498300,492000,497700,9531500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2013 12:00:00 AM,491600,505600,491500,504399,12079800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2013 12:00:00 AM,502400,504700,499300,500700,16047300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2013 12:00:00 AM,505099,512300,504199,505000,17549300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/17/2013 12:00:00 AM,507300,510400,505800,509000,12818300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/18/2013 12:00:00 AM,510700,512300,494000,507000,12140500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2013 12:00:00 AM,509599,511300,504800,510200,12021300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/22/2013 12:00:00 AM,512099,517500,511600,516100,13329500,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2013 12:00:00 AM,511100,511399,502799,503699,12635100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2013 12:00:00 AM,501199,502000,495900,499900,13870700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2013 12:00:00 AM,502999,504599,500499,502400,12462200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n10/28/2013 12:00:00 AM,506399,511199,505499,509399,13368900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/29/2013 12:00:00 AM,510000,510700,506800,509700,10764600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n10/30/2013 12:00:00 AM,505600,510999,504599,509300,11179400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2013 12:00:00 AM,510299,511600,500700,501600,17842100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2013 12:00:00 AM,494100,499700,492400,496199,15166300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2013 12:00:00 AM,500700,502900,499199,500200,13688200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/5/2013 12:00:00 AM,490700,492000,485000,485900,19848900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2013 12:00:00 AM,487500,488200,483899,485900,13726900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2013 12:00:00 AM,488600,489100,472599,473200,16731200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2013 12:00:00 AM,470000,473200,462200,470200,24545200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/11/2013 12:00:00 AM,470200,472300,466199,469500,8429000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/12/2013 12:00:00 AM,467000,468800,461399,463400,17628400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2013 12:00:00 AM,461899,470800,461100,469199,14096200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2013 12:00:00 AM,472700,482099,470299,479599,21231100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/15/2013 12:00:00 AM,483899,488899,481399,485999,18310000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/18/2013 12:00:00 AM,490999,497900,490299,492799,16128800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n11/19/2013 12:00:00 AM,495000,495800,482500,483899,19645300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2013 12:00:00 AM,485299,487200,474500,475999,13036100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2013 12:00:00 AM,475600,478200,473800,474399,12433000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/22/2013 12:00:00 AM,481100,485400,479399,481300,18281800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/25/2013 12:00:00 AM,480099,481100,472900,474599,9988000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0\n11/26/2013 12:00:00 AM,471699,472599,467300,470700,12617100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/27/2013 12:00:00 AM,471100,471300,464300,465000,19891000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2013 12:00:00 AM,467500,470499,466399,469500,6591100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/2/2013 12:00:00 AM,462000,463400,452000,453300,19112000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2013 12:00:00 AM,450600,455099,442999,447200,23813800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/4/2013 12:00:00 AM,442799,446100,438899,445099,16302700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2013 12:00:00 AM,441500,450600,441399,446199,15280200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/6/2013 12:00:00 AM,451500,455900,448499,452200,12864200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/9/2013 12:00:00 AM,455200,457500,454500,455200,8628200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,100,0,0,0,0,0,0,0,0,0\n12/10/2013 12:00:00 AM,456199,457900,455499,456699,7628000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,100,100,0,0,0,0,0,0,0,0,0\n12/11/2013 12:00:00 AM,450900,451500,441500,442599,14996500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2013 12:00:00 AM,441899,445600,438300,444599,14169700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2013 12:00:00 AM,445700,446899,442099,443400,8678700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/16/2013 12:00:00 AM,447000,451300,444800,444800,10306100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2013 12:00:00 AM,448899,448899,443499,445400,22474700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2013 12:00:00 AM,439599,452300,430499,446899,17292700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n12/19/2013 12:00:00 AM,439000,444300,436100,440600,15741800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/20/2013 12:00:00 AM,437099,439199,432500,434100,14712000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2013 12:00:00 AM,439100,441399,437999,440999,9381200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/24/2013 12:00:00 AM,440800,443800,439399,443499,8767600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2013 12:00:00 AM,443800,443800,439199,439800,5553100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/27/2013 12:00:00 AM,441300,447000,441300,446899,8987900,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2013 12:00:00 AM,445600,449900,442300,443699,9402800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/31/2013 12:00:00 AM,444300,448300,443100,446800,6281300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/2/2014 12:00:00 AM,436399,437400,430299,431899,18186900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2014 12:00:00 AM,435099,435400,429800,434300,15316700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2014 12:00:00 AM,430999,432700,428300,429199,10238600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2014 12:00:00 AM,436699,437000,428300,429199,10544400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2014 12:00:00 AM,430299,430900,423699,425099,11738400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2014 12:00:00 AM,422500,422999,415400,419800,16682500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2014 12:00:00 AM,422300,428800,422099,426899,17411000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100\n1/13/2014 12:00:00 AM,427500,429199,420099,422500,13253100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2014 12:00:00 AM,424199,427400,422700,426600,9551900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/15/2014 12:00:00 AM,427400,431199,426399,426600,11674500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2014 12:00:00 AM,428100,429300,422799,423800,11185000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/17/2014 12:00:00 AM,422400,424199,420800,422099,14172600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,-200,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/21/2014 12:00:00 AM,419000,421300,414000,417599,15861700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/22/2014 12:00:00 AM,418699,422999,417799,422500,13901200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2014 12:00:00 AM,420999,421600,406899,411899,18198600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2014 12:00:00 AM,403300,403499,397599,399700,21157300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2014 12:00:00 AM,399399,402700,395499,399900,16482300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/28/2014 12:00:00 AM,400700,403400,398600,400499,14346100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/29/2014 12:00:00 AM,391500,397500,389500,392099,22214600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,-100,0,0,0\n1/30/2014 12:00:00 AM,400099,401300,393499,396399,15455300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/31/2014 12:00:00 AM,389599,398899,388600,392400,17593100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2014 12:00:00 AM,392599,393499,380000,380299,21795900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2014 12:00:00 AM,389000,394700,387599,391600,22638700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2014 12:00:00 AM,391899,393600,387000,390800,21634400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/6/2014 12:00:00 AM,395400,405400,394800,403600,23199600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2014 12:00:00 AM,407599,409300,402099,406399,14110000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/10/2014 12:00:00 AM,404599,404900,397900,399900,13221300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2014 12:00:00 AM,397700,408899,397300,407500,16180400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2014 12:00:00 AM,406500,408300,397700,400200,15620300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2014 12:00:00 AM,393699,405999,393499,405200,14725600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2014 12:00:00 AM,403899,410299,402999,406399,14772000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/18/2014 12:00:00 AM,400900,411500,394500,395299,16765600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/19/2014 12:00:00 AM,390700,399599,390600,397799,19439400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2014 12:00:00 AM,401899,406600,397599,402200,23349300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/21/2014 12:00:00 AM,405700,410600,405099,407599,15073600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n2/24/2014 12:00:00 AM,408899,412599,407099,407500,12801600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2014 12:00:00 AM,408600,409399,402700,404000,12011900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/26/2014 12:00:00 AM,404599,407000,400700,403699,12065800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/27/2014 12:00:00 AM,407500,417000,406300,416300,27270500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2014 12:00:00 AM,412000,412799,406100,410000,16881800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2014 12:00:00 AM,402900,402900,395400,399500,19213000,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2014 12:00:00 AM,407500,410000,402099,405700,17657300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/5/2014 12:00:00 AM,405000,409700,403699,408300,18565400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2014 12:00:00 AM,412999,417400,411699,412799,17351700,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/7/2014 12:00:00 AM,409199,409599,400600,403200,21944800,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2014 12:00:00 AM,402099,402500,393100,396300,21193800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2014 12:00:00 AM,399599,402000,392799,393800,16530400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2014 12:00:00 AM,394300,397700,392099,396800,15523100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2014 12:00:00 AM,401600,402200,390900,392200,21698200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2014 12:00:00 AM,390200,395400,388699,391100,17510000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/17/2014 12:00:00 AM,392500,396399,392300,394100,12921100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/18/2014 12:00:00 AM,393400,404900,392999,403699,23865300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2014 12:00:00 AM,403300,411500,401699,405299,28362900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2014 12:00:00 AM,404399,416899,401100,414800,27938800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2014 12:00:00 AM,411699,421699,411300,416699,26772400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2014 12:00:00 AM,419000,423800,416199,421600,17290900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2014 12:00:00 AM,423600,428899,423400,426800,19094800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2014 12:00:00 AM,427999,431300,424800,425200,13271600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2014 12:00:00 AM,433400,447000,432700,444900,39647900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2014 12:00:00 AM,447000,454100,446199,448699,20374200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/31/2014 12:00:00 AM,449500,453499,449300,450400,17297600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/1/2014 12:00:00 AM,452700,454900,447700,451500,13674500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/2/2014 12:00:00 AM,450499,462400,450200,462400,18649500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/3/2014 12:00:00 AM,460999,460999,452999,456800,18729000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2014 12:00:00 AM,469500,473200,460499,461500,35525300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2014 12:00:00 AM,465000,475900,464399,473899,29758500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2014 12:00:00 AM,484900,487700,469900,472900,35521700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2014 12:00:00 AM,467300,476500,462900,471500,24344300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/10/2014 12:00:00 AM,472099,474500,468600,469199,20018000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2014 12:00:00 AM,465499,475600,464599,473899,18202000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2014 12:00:00 AM,475900,477000,470400,472500,17102200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/15/2014 12:00:00 AM,470000,470200,453100,459399,37216000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2014 12:00:00 AM,464199,466800,459900,466100,18619900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2014 12:00:00 AM,463899,475999,461199,475000,20214500,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2014 12:00:00 AM,476100,477900,469100,472900,8709200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2014 12:00:00 AM,470700,475700,468400,471500,14663400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/23/2014 12:00:00 AM,470499,471699,466199,470800,13121600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,-100,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n4/24/2014 12:00:00 AM,474000,476100,466899,474700,13048300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/25/2014 12:00:00 AM,469300,469800,462999,467099,15731400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2014 12:00:00 AM,464100,471399,461300,469800,15712800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2014 12:00:00 AM,475700,482099,471399,472500,18724300,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/30/2014 12:00:00 AM,469399,471800,465999,470400,11148800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/1/2014 12:00:00 AM,467999,470400,464000,468600,8461500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/2/2014 12:00:00 AM,471500,484800,469900,484800,28782400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/5/2014 12:00:00 AM,481800,485000,476800,481199,12209200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/6/2014 12:00:00 AM,480700,489599,479900,486899,16347400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2014 12:00:00 AM,486300,492599,483899,491899,18307300,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2014 12:00:00 AM,493899,495400,486800,487500,13859700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2014 12:00:00 AM,485299,488200,482999,485400,12373500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/12/2014 12:00:00 AM,487500,492900,487500,492599,14630300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2014 12:00:00 AM,491300,496300,490299,490999,12965000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/14/2014 12:00:00 AM,492400,498100,491199,496800,12949800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2014 12:00:00 AM,494399,494900,486199,490000,12544900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2014 12:00:00 AM,495000,495600,490299,492799,9269700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2014 12:00:00 AM,489000,490499,486899,488600,11984300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/20/2014 12:00:00 AM,487599,491600,476800,478100,17673300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2014 12:00:00 AM,479300,483600,479000,480299,16671700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2014 12:00:00 AM,483499,484500,477599,482200,15576100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2014 12:00:00 AM,481100,482799,477000,478300,10017800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/27/2014 12:00:00 AM,481699,483300,469399,470800,14673600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2014 12:00:00 AM,472099,478200,469500,476500,15374000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2014 12:00:00 AM,478600,480299,473800,475000,9742700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/30/2014 12:00:00 AM,469800,470700,464000,464900,19701600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/2/2014 12:00:00 AM,463400,464800,458600,460000,14216100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/3/2014 12:00:00 AM,461500,464900,459900,462900,12284300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/4/2014 12:00:00 AM,462900,462900,457999,459100,10676500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/5/2014 12:00:00 AM,465200,466500,460900,462700,16816700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2014 12:00:00 AM,477799,480000,474800,478200,22904100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/9/2014 12:00:00 AM,481399,494300,480400,492500,23085400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2014 12:00:00 AM,490700,495499,489100,494500,14414700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2014 12:00:00 AM,499199,500200,495600,497300,14676700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2014 12:00:00 AM,498699,499199,490600,493300,8648600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2014 12:00:00 AM,494399,497300,493200,496399,13538200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/16/2014 12:00:00 AM,495999,496300,492500,493499,8656200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/17/2014 12:00:00 AM,489100,489700,484500,489300,14283300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n6/18/2014 12:00:00 AM,487300,500000,485400,499800,18888100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2014 12:00:00 AM,498100,500700,491899,494599,13592200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2014 12:00:00 AM,494300,496199,492000,495600,17660900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2014 12:00:00 AM,496500,496500,492400,495000,11976900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2014 12:00:00 AM,493300,500900,491300,492700,20242400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/25/2014 12:00:00 AM,487799,489100,477400,481800,15489900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2014 12:00:00 AM,481399,484700,478400,482799,10756200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/27/2014 12:00:00 AM,481300,483600,475999,481100,9592900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/30/2014 12:00:00 AM,480000,480200,474399,477799,10861000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/1/2014 12:00:00 AM,479399,484300,476399,478800,9352600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/2/2014 12:00:00 AM,476899,477700,471100,473200,14156900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/3/2014 12:00:00 AM,469700,479700,469700,478400,7418800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/7/2014 12:00:00 AM,480000,480600,476699,479000,11101700,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/8/2014 12:00:00 AM,482000,482300,477500,477500,11909600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2014 12:00:00 AM,480099,488300,479700,484599,15388900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2014 12:00:00 AM,482500,486800,479000,485800,13745900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2014 12:00:00 AM,484300,489900,477799,487999,14149000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2014 12:00:00 AM,492599,499199,492500,497999,20732100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/15/2014 12:00:00 AM,497599,499000,493699,497200,11111600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/16/2014 12:00:00 AM,500299,502000,492999,495099,11295200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2014 12:00:00 AM,491800,495000,484199,486699,20834700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2014 12:00:00 AM,502099,507099,498699,502999,30700100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/21/2014 12:00:00 AM,504500,512099,501800,510800,23309700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2014 12:00:00 AM,514100,518300,511399,516800,14350100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2014 12:00:00 AM,510600,512500,507400,509800,13928300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/24/2014 12:00:00 AM,510999,515499,509500,514700,11032400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2014 12:00:00 AM,511800,513200,509300,510600,7472800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/28/2014 12:00:00 AM,511500,512300,507300,511199,10148700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/29/2014 12:00:00 AM,508499,512900,503899,505200,12038600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2014 12:00:00 AM,502500,504500,494199,499199,15816000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2014 12:00:00 AM,487999,490700,481300,485000,21250100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2014 12:00:00 AM,484700,489599,480099,487500,13727300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/4/2014 12:00:00 AM,491199,492200,483800,491100,11581800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/5/2014 12:00:00 AM,488300,492599,482099,484100,18615700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2014 12:00:00 AM,484000,490000,480200,487500,19900200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2014 12:00:00 AM,489700,489900,473499,481300,17498600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2014 12:00:00 AM,476600,480200,473699,479900,15504200,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2014 12:00:00 AM,484500,490200,482999,490200,17538600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/12/2014 12:00:00 AM,486399,490600,485499,488300,15590000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/13/2014 12:00:00 AM,492300,493100,475800,481199,49963800,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2014 12:00:00 AM,482900,486699,481399,484100,15098700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/15/2014 12:00:00 AM,490600,495600,485200,494199,21611800,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2014 12:00:00 AM,500000,502500,495700,500999,15185800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/19/2014 12:00:00 AM,500400,511199,499700,509800,15675900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2014 12:00:00 AM,508400,514100,506399,510400,13547500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/21/2014 12:00:00 AM,514000,514000,509500,510400,11933900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/22/2014 12:00:00 AM,508100,508899,501199,504100,13752300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2014 12:00:00 AM,507700,512799,505800,511300,12364300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100\n8/26/2014 12:00:00 AM,516800,520499,513499,519800,21305200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2014 12:00:00 AM,522700,533300,520800,531800,28520300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2014 12:00:00 AM,529199,531199,523499,527599,21379100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/29/2014 12:00:00 AM,531100,537700,526699,537000,20493100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2014 12:00:00 AM,531199,542099,529100,539000,20259900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2014 12:00:00 AM,543300,545600,536300,540000,19053300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2014 12:00:00 AM,535299,540600,529700,530999,21393000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2014 12:00:00 AM,532999,533600,526199,531600,19852700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2014 12:00:00 AM,534900,534900,513300,514199,33286600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2014 12:00:00 AM,509900,513100,500200,502900,35234300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2014 12:00:00 AM,499599,499700,491800,497999,26109700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2014 12:00:00 AM,499800,504800,497900,499599,18717000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/12/2014 12:00:00 AM,486699,488899,475099,478100,50357300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2014 12:00:00 AM,479300,484900,477000,483699,23358400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/16/2014 12:00:00 AM,492000,507400,491399,498100,35946000,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2014 12:00:00 AM,501199,502000,490499,490900,29358200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2014 12:00:00 AM,486600,492000,482500,483699,29676900,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2014 12:00:00 AM,485999,486100,474500,477500,27381300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2014 12:00:00 AM,464500,467000,459300,465099,33109600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2014 12:00:00 AM,465200,470800,456899,462099,27842400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/24/2014 12:00:00 AM,458300,469599,455099,467999,25690600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2014 12:00:00 AM,460900,462700,453300,454199,28195100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2014 12:00:00 AM,454100,467300,454100,464900,22916300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2014 12:00:00 AM,435700,446100,435200,437200,51786500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2014 12:00:00 AM,433200,438300,428899,434500,42316500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/1/2014 12:00:00 AM,427500,431199,417599,419100,34695600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2014 12:00:00 AM,422200,428400,413800,422799,29688200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/3/2014 12:00:00 AM,422200,434399,420999,433800,34178000,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2014 12:00:00 AM,473200,473699,458899,460299,56256300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2014 12:00:00 AM,469100,475200,464399,467200,42199800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/8/2014 12:00:00 AM,475099,475499,454300,469500,43407500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2014 12:00:00 AM,475499,476300,466600,468100,29601600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2014 12:00:00 AM,461500,462400,447300,447599,38594100,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2014 12:00:00 AM,466300,480800,465000,472700,44125400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n10/14/2014 12:00:00 AM,468200,479500,465200,473200,27649900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2014 12:00:00 AM,455600,457000,437999,449000,65953100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2014 12:00:00 AM,430400,442000,429700,432799,45081500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2014 12:00:00 AM,441500,452000,436300,450800,52444400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/20/2014 12:00:00 AM,436800,439599,431500,434100,36083500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/21/2014 12:00:00 AM,413100,424300,413100,416899,43676500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2014 12:00:00 AM,418800,422599,410299,413499,26523200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/23/2014 12:00:00 AM,404900,407900,393899,398400,56206500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2014 12:00:00 AM,406699,422999,405499,415700,54343400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2014 12:00:00 AM,384500,399100,382999,393300,77016100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2014 12:00:00 AM,407999,416100,405000,412900,68774000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/29/2014 12:00:00 AM,420200,421399,405000,410999,39670200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/30/2014 12:00:00 AM,424300,430200,420700,427500,38253100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/31/2014 12:00:00 AM,422400,433699,421600,432400,28049000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/3/2014 12:00:00 AM,423600,425000,417500,421699,26467400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/4/2014 12:00:00 AM,421600,427599,417300,424100,20405700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/5/2014 12:00:00 AM,420499,422500,417500,420299,17696400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n11/6/2014 12:00:00 AM,410400,412000,402000,403800,27797700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2014 12:00:00 AM,407099,410499,405200,409800,19137600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/10/2014 12:00:00 AM,415200,415600,404800,405700,13543200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2014 12:00:00 AM,404199,405999,399800,405200,16037900,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/12/2014 12:00:00 AM,409300,414599,404399,405200,24035400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2014 12:00:00 AM,405999,406500,393400,396500,22892400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2014 12:00:00 AM,385999,394599,385499,392799,20559800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/17/2014 12:00:00 AM,396199,396500,386199,389000,15549300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2014 12:00:00 AM,390099,399599,388499,397599,18391800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2014 12:00:00 AM,405099,410999,398899,409199,27451600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/20/2014 12:00:00 AM,420800,420800,403600,411300,36815400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2014 12:00:00 AM,420600,441300,420400,439500,66396400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2014 12:00:00 AM,432400,436800,425900,426399,28501500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/25/2014 12:00:00 AM,437000,437700,426600,426899,20459700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2014 12:00:00 AM,433200,435499,430200,432500,18631300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/28/2014 12:00:00 AM,422500,423200,416600,418499,28252200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/1/2014 12:00:00 AM,408400,408899,398400,401199,35783300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2014 12:00:00 AM,401100,401899,393600,395200,17541400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/3/2014 12:00:00 AM,400600,403800,398600,398699,15375100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/4/2014 12:00:00 AM,393300,394800,388699,391300,18909900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2014 12:00:00 AM,390000,395900,386899,393300,16289700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/8/2014 12:00:00 AM,390999,391300,376899,379199,26001100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2014 12:00:00 AM,377400,382000,374599,379800,23791000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2014 12:00:00 AM,378499,378600,371600,372200,19260300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2014 12:00:00 AM,367599,372300,365099,366399,18770800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/12/2014 12:00:00 AM,366300,366500,355800,356500,18595200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2014 12:00:00 AM,355700,356199,339100,343499,31776400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2014 12:00:00 AM,336300,344100,329700,338200,44782400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/17/2014 12:00:00 AM,340499,356500,339900,350200,48492400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2014 12:00:00 AM,360400,363300,353400,356500,21106100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2014 12:00:00 AM,359800,364500,358400,360099,26655500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/22/2014 12:00:00 AM,363499,367400,361300,366100,20334000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/23/2014 12:00:00 AM,365499,365999,358899,364700,13441200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/24/2014 12:00:00 AM,365999,366399,360499,365600,5430600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n12/26/2014 12:00:00 AM,367799,370299,363699,364900,7285300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/29/2014 12:00:00 AM,364199,369300,363300,365299,10816200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/30/2014 12:00:00 AM,370800,372000,365099,367599,13443800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/31/2014 12:00:00 AM,367000,367599,360600,365700,9103200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2015 12:00:00 AM,359800,360000,350400,353600,17765400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2015 12:00:00 AM,342200,344100,340499,341500,22200400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n1/6/2015 12:00:00 AM,346199,349900,342099,347599,21194000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/7/2015 12:00:00 AM,357500,360999,355200,357000,16427500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/8/2015 12:00:00 AM,359399,365700,357999,362700,14081000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2015 12:00:00 AM,361100,363600,358600,361699,9498500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/12/2015 12:00:00 AM,353400,354000,350400,353200,12921000,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,100,0,0,0,0,0,0\n1/13/2015 12:00:00 AM,357900,361600,353600,357099,17149800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/14/2015 12:00:00 AM,356899,362099,355200,360700,15871000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2015 12:00:00 AM,364199,365200,355099,355299,14300900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2015 12:00:00 AM,362000,367200,361600,367200,19665400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2015 12:00:00 AM,360099,361699,356300,361100,23278600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2015 12:00:00 AM,363499,374900,362500,373100,16172900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2015 12:00:00 AM,379700,382000,374000,379100,18016200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/23/2015 12:00:00 AM,372500,372599,367200,367999,17658800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/26/2015 12:00:00 AM,365000,368699,363300,365299,12156700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/27/2015 12:00:00 AM,361399,371300,360499,369700,13429600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2015 12:00:00 AM,362999,365499,358899,359700,14606900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2015 12:00:00 AM,361399,361899,355299,360000,14304300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2015 12:00:00 AM,343300,347000,341600,343100,25128300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/2/2015 12:00:00 AM,341199,347799,340800,347099,18088800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2015 12:00:00 AM,352200,357900,350999,356899,17543000,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2015 12:00:00 AM,346600,355299,346100,352200,15882800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/5/2015 12:00:00 AM,349100,357000,349100,355000,11428600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2015 12:00:00 AM,344500,346100,341600,344199,17349000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/9/2015 12:00:00 AM,341500,350299,341500,348600,11747800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2015 12:00:00 AM,343300,343600,335499,338400,14339400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2015 12:00:00 AM,330200,333600,326399,331800,20615100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/12/2015 12:00:00 AM,339500,345099,338699,344800,17716400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2015 12:00:00 AM,345600,350999,345600,350499,15122100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/17/2015 12:00:00 AM,351600,354100,345900,353699,8047900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n2/18/2015 12:00:00 AM,352400,356500,350099,353899,12806100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/19/2015 12:00:00 AM,349199,353200,346699,349800,9627600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/20/2015 12:00:00 AM,346399,349900,344100,348600,12997900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/23/2015 12:00:00 AM,350499,351399,345900,347500,15338700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n2/24/2015 12:00:00 AM,347900,358600,345099,357700,17534700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2015 12:00:00 AM,349500,353400,347000,351399,16186200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/26/2015 12:00:00 AM,349399,351399,347300,349199,12893000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/27/2015 12:00:00 AM,351800,359599,350900,353800,19928900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/2/2015 12:00:00 AM,351500,351899,343100,345000,16440700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n3/3/2015 12:00:00 AM,343400,346899,341699,342300,14316600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/4/2015 12:00:00 AM,333600,334700,329000,332599,20143100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/5/2015 12:00:00 AM,330000,330099,325400,327999,17310900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/6/2015 12:00:00 AM,321100,322300,318099,319300,19746400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n3/9/2015 12:00:00 AM,314500,314900,307400,307700,19967200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2015 12:00:00 AM,308099,309200,302900,304599,24304600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2015 12:00:00 AM,303099,308200,301700,306100,16183300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2015 12:00:00 AM,311500,312199,302400,303600,18716600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2015 12:00:00 AM,294900,295200,288200,293099,25330200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/16/2015 12:00:00 AM,298099,299300,293400,295200,16971300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/17/2015 12:00:00 AM,292600,305100,292199,304599,29042200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2015 12:00:00 AM,302099,315700,300800,313400,27873700,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2015 12:00:00 AM,308099,309800,300499,302199,18311000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2015 12:00:00 AM,310100,316700,310000,315400,20914000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/23/2015 12:00:00 AM,317000,322400,316600,321699,19766600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/24/2015 12:00:00 AM,325999,326300,318300,321500,16585600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2015 12:00:00 AM,324800,325299,316399,316399,13000400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2015 12:00:00 AM,315300,316399,307700,309599,20913200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2015 12:00:00 AM,306500,307700,301600,302900,14138700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/30/2015 12:00:00 AM,304000,312199,303700,310900,20271100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n3/31/2015 12:00:00 AM,311700,315900,308899,313700,20858800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/1/2015 12:00:00 AM,321399,326300,319599,322500,26160700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/2/2015 12:00:00 AM,327300,333699,326300,332400,25610600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/6/2015 12:00:00 AM,338400,341699,335999,336699,22720900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/7/2015 12:00:00 AM,335999,338200,334399,335000,9976900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2015 12:00:00 AM,344199,345999,340299,342700,17403900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/9/2015 12:00:00 AM,343699,346600,340800,341899,20660600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2015 12:00:00 AM,340000,344800,339700,344500,11963100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/13/2015 12:00:00 AM,342500,347000,337599,337900,19350700,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2015 12:00:00 AM,342599,345299,338899,343800,16817800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/15/2015 12:00:00 AM,346100,352700,344599,352400,20192800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2015 12:00:00 AM,352000,355000,349199,352799,13665000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/17/2015 12:00:00 AM,345800,347799,342999,345299,18112100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/20/2015 12:00:00 AM,346300,347200,342400,345000,11383200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2015 12:00:00 AM,345000,348400,344300,344900,7730200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/22/2015 12:00:00 AM,346899,355000,346199,353800,15715900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2015 12:00:00 AM,349399,363699,349100,362700,21138100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2015 12:00:00 AM,366100,372000,365499,371699,17238000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/27/2015 12:00:00 AM,372999,375299,367999,368100,16363900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2015 12:00:00 AM,373300,373600,367200,368400,17506200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/29/2015 12:00:00 AM,366100,369000,361500,364000,11768800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/30/2015 12:00:00 AM,363400,363600,356699,362099,18481800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2015 12:00:00 AM,362999,365099,358800,362099,10869600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/4/2015 12:00:00 AM,360800,362599,359399,361300,12034000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n5/5/2015 12:00:00 AM,362400,369900,361800,365900,17374900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/6/2015 12:00:00 AM,372500,372500,361899,363100,21658800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2015 12:00:00 AM,364399,365400,359800,364700,13959400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0\n5/8/2015 12:00:00 AM,371199,373300,365999,371899,12731700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/11/2015 12:00:00 AM,372099,372400,363100,363699,15874000,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2015 12:00:00 AM,363499,369100,362900,365200,10355400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2015 12:00:00 AM,367900,368300,359399,360999,14341100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2015 12:00:00 AM,364000,369100,363200,368100,13903700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2015 12:00:00 AM,366699,373499,364399,371300,11365800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/18/2015 12:00:00 AM,370700,371199,359900,361300,15804800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2015 12:00:00 AM,358899,358899,354300,355400,14238300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n5/20/2015 12:00:00 AM,355099,359500,352900,355999,12807900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/21/2015 12:00:00 AM,352099,354100,350000,352300,11244600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2015 12:00:00 AM,350700,351300,340900,342000,28441400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/26/2015 12:00:00 AM,338499,338699,330400,330400,32106300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/27/2015 12:00:00 AM,327999,335200,325800,334399,19632300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0\n5/28/2015 12:00:00 AM,330400,331800,326399,331600,17384600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2015 12:00:00 AM,329100,330999,322400,322700,19960300,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/1/2015 12:00:00 AM,324900,326399,322400,324900,12426600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/2/2015 12:00:00 AM,329900,336500,329000,335900,16040500,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2015 12:00:00 AM,335900,337200,331600,332700,13543000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/4/2015 12:00:00 AM,330000,332799,326399,327900,9522200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2015 12:00:00 AM,325400,329700,322700,327200,14139800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/8/2015 12:00:00 AM,332099,332700,330200,330499,10728900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/9/2015 12:00:00 AM,332799,335200,331100,331699,9732200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2015 12:00:00 AM,341500,341699,335099,336300,20744600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2015 12:00:00 AM,334100,336899,330400,336500,16610200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/12/2015 12:00:00 AM,334599,335000,331199,333600,12556200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/15/2015 12:00:00 AM,330800,333699,329100,330900,8784300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/16/2015 12:00:00 AM,334300,340299,333600,338200,11160600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2015 12:00:00 AM,335400,341100,332599,339199,9124800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2015 12:00:00 AM,341500,346300,339599,345400,16166600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2015 12:00:00 AM,339900,341600,336699,337999,17584000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/22/2015 12:00:00 AM,343600,344300,340200,340900,9189200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/23/2015 12:00:00 AM,340000,342300,338800,341199,7516600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/24/2015 12:00:00 AM,340600,343400,337400,338400,7790700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2015 12:00:00 AM,330999,331800,323899,325999,10489600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2015 12:00:00 AM,327500,331699,325999,330800,10564500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/29/2015 12:00:00 AM,325600,327500,322400,325200,8227100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/30/2015 12:00:00 AM,328600,330299,325700,327700,11482000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/1/2015 12:00:00 AM,327999,329399,322400,322599,8727900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2015 12:00:00 AM,325299,329900,325299,329800,7616800,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/6/2015 12:00:00 AM,318600,322999,317099,319000,13197300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/7/2015 12:00:00 AM,315000,318300,308400,317700,17923300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2015 12:00:00 AM,311200,313400,307600,307600,19007500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2015 12:00:00 AM,314200,317600,310800,311000,9521100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2015 12:00:00 AM,316000,320700,313899,320600,13033700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/13/2015 12:00:00 AM,321699,326199,319400,326100,10300500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2015 12:00:00 AM,324500,329199,323300,327099,8355900,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n7/15/2015 12:00:00 AM,324900,326500,322599,324599,10431400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/16/2015 12:00:00 AM,327200,327400,321500,323300,8219900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2015 12:00:00 AM,323400,323600,315100,315200,14652200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/20/2015 12:00:00 AM,313500,313500,309800,311399,11297400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/21/2015 12:00:00 AM,311100,315000,311000,312900,13023100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2015 12:00:00 AM,308899,309100,302900,304599,10818400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/23/2015 12:00:00 AM,297400,301000,291500,292199,27147900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2015 12:00:00 AM,288600,289000,281500,285000,25328900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/27/2015 12:00:00 AM,282400,285499,280000,280499,19563100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2015 12:00:00 AM,283600,285900,275400,285300,33744900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2015 12:00:00 AM,286600,291700,284100,290900,15456300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2015 12:00:00 AM,290599,291700,283500,285100,15131200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n7/31/2015 12:00:00 AM,289300,291100,285000,286900,12596700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/3/2015 12:00:00 AM,283899,284699,280100,280800,15613900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/4/2015 12:00:00 AM,279699,281800,276399,280000,11145900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/5/2015 12:00:00 AM,280900,281900,277199,277700,9852900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/6/2015 12:00:00 AM,274100,275900,270900,272099,20335400,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/7/2015 12:00:00 AM,270000,272199,266700,267800,15011800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/10/2015 12:00:00 AM,268300,277600,267900,277400,16758600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2015 12:00:00 AM,270900,272199,266000,269900,16548100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/12/2015 12:00:00 AM,268500,269500,265200,267800,17034600,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/13/2015 12:00:00 AM,266500,266800,261399,261700,20186300,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/14/2015 12:00:00 AM,263799,265800,262400,262900,7580900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/17/2015 12:00:00 AM,261500,265700,260800,261600,10514800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/18/2015 12:00:00 AM,259699,267600,257500,263600,21053200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/19/2015 12:00:00 AM,259699,260700,252800,257500,23414300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2015 12:00:00 AM,255900,261200,254300,260100,14872800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2015 12:00:00 AM,254300,255400,251000,251299,19181600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/24/2015 12:00:00 AM,233200,246800,229900,240100,28385400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/25/2015 12:00:00 AM,248600,248899,237900,238099,18822800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/26/2015 12:00:00 AM,238099,247700,235599,247600,21776600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2015 12:00:00 AM,252000,261399,251700,259800,30502600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2015 12:00:00 AM,256100,259900,252199,253899,19038200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/31/2015 12:00:00 AM,241100,249200,239500,248799,19046600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/1/2015 12:00:00 AM,239599,242700,235900,237300,22586100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2015 12:00:00 AM,238799,239500,233600,239400,29211100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n9/3/2015 12:00:00 AM,236399,244100,235100,242300,26769900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2015 12:00:00 AM,237999,239200,231000,231000,19424000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2015 12:00:00 AM,238300,239100,234000,235700,13506300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/9/2015 12:00:00 AM,240000,243099,234800,234900,11331800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2015 12:00:00 AM,227000,233600,226399,231500,23668500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2015 12:00:00 AM,231100,231500,227999,229000,9035100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/14/2015 12:00:00 AM,230499,237900,227800,237700,12742100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2015 12:00:00 AM,232900,237099,232900,235900,12381500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/16/2015 12:00:00 AM,239800,244400,239599,244200,19152700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2015 12:00:00 AM,238099,247700,237800,241600,16974500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/18/2015 12:00:00 AM,237500,238099,227300,227300,22265400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/21/2015 12:00:00 AM,228500,229300,223400,225100,12134700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/22/2015 12:00:00 AM,218099,220800,214500,219000,23087600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/23/2015 12:00:00 AM,218200,218300,209699,209900,20955600,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2015 12:00:00 AM,201299,218200,200599,217700,42738300,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2015 12:00:00 AM,220499,220800,216000,216399,25884500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/28/2015 12:00:00 AM,213400,213799,206399,206399,23204500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2015 12:00:00 AM,206500,212099,204900,209800,21827000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2015 12:00:00 AM,218799,219599,214800,219500,21434200,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n10/1/2015 12:00:00 AM,219900,221500,214900,219400,19117800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/2/2015 12:00:00 AM,216100,230200,215200,230200,21204400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/5/2015 12:00:00 AM,232099,236500,232099,236200,24359800,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/6/2015 12:00:00 AM,237199,241200,236399,238500,15294600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n"
  },
  {
    "path": "Tests/TestData/frama.txt",
    "content": "Date,Open,High,Low,Close,Filt,TL\n6/19/06 12:00 AM,125.4,125.48,123.55,123.67,124.52,249.03\n6/20/06 12:00 AM,124.01,124.81,123.72,124.09,124.27,248.53\n6/21/06 12:00 AM,124,125.7,123.96,125.01,124.83,249.66\n6/22/06 12:00 AM,124.95,125.06,124.04,124.46,124.55,249.1\n6/23/06 12:00 AM,124.33,125.3,124.03,124.44,124.66,249.33\n6/26/06 12:00 AM,124.54,125.06,124.25,124.99,124.66,249.31\n6/27/06 12:00 AM,125.01,125.29,123.77,123.91,124.53,249.06\n6/28/06 12:00 AM,124.19,124.77,123.65,124.75,124.21,248.42\n6/29/06 12:00 AM,125.2,127.35,125.17,127.27,126.26,128.01\n6/30/06 12:00 AM,127.47,127.66,126.96,127.23,127.31,130.36\n7/3/06 12:00 AM,127.43,128.01,127.31,127.8,127.66,130.49\n7/5/06 12:00 AM,127.29,127.45,126.52,127.07,126.99,129.42\n7/6/06 12:00 AM,127.2,127.85,127.08,127.44,127.47,130.27\n7/7/06 12:00 AM,127.19,127.56,126.29,126.61,126.93,129.2\n7/10/06 12:00 AM,126.94,127.43,126.41,126.85,126.92,129.31\n7/11/06 12:00 AM,126.61,127.41,125.94,127.41,126.68,129.14\n7/12/06 12:00 AM,127.21,127.4,125.72,126.05,126.66,127.06\n7/13/06 12:00 AM,125.5,125.68,124,124,126.63,125.95\n7/14/06 12:00 AM,124.16,124.26,122.83,123.52,126.57,125.48\n7/17/06 12:00 AM,123.5,124.1,123.15,123.34,126.51,126.04\n7/18/06 12:00 AM,123.75,124.05,122.39,123.97,126.41,125.36\n7/19/06 12:00 AM,124.18,126.26,124.15,125.69,126.37,125.82\n7/20/06 12:00 AM,126.12,126.3,124.66,124.83,126.34,125.77\n7/21/06 12:00 AM,125.15,125.19,123.82,123.95,126.14,125.61\n7/24/06 12:00 AM,124.44,126.32,124.44,126.21,125.75,124.85\n7/25/06 12:00 AM,125.98,127.3,125.72,126.66,125.79,124.95\n7/26/06 12:00 AM,126.59,127.45,126.18,126.83,125.81,125.04\n7/27/06 12:00 AM,127.33,127.69,126.2,126.71,125.82,125.13\n7/28/06 12:00 AM,126.99,128.14,126.86,127.98,125.88,125.35\n7/31/06 12:00 AM,127.68,127.96,127.45,127.85,125.96,125.54\n8/1/06 12:00 AM,127.34,127.38,126.6,127.22,126,125.65\n8/2/06 12:00 AM,127.58,128.46,127.55,128.08,126.14,126.14\n8/3/06 12:00 AM,127.33,128.55,127.15,128.42,127.06,128.37\n8/4/06 12:00 AM,129.06,129.43,127.48,128.2,127.59,129.38\n8/7/06 12:00 AM,127.9,128.08,127.4,127.95,127.64,129.47\n8/8/06 12:00 AM,128.09,128.46,126.95,127.41,127.66,129.5\n8/9/06 12:00 AM,128.2,128.6,126.61,126.98,127.65,129.42\n8/10/06 12:00 AM,126.53,127.5,126.28,127.37,127.54,129.12\n8/11/06 12:00 AM,127.17,127.2,126.39,127.01,127.43,128.86\n8/14/06 12:00 AM,127.63,128.16,126.92,127.11,127.44,128.73\n8/15/06 12:00 AM,128.21,128.87,127.9,128.63,127.48,127.89\n8/16/06 12:00 AM,129.34,129.89,129.04,129.79,127.51,127.44\n8/17/06 12:00 AM,129.58,130.37,129.49,130.03,127.57,127.5\n8/18/06 12:00 AM,130.19,130.69,129.59,130.69,127.66,127.66\n8/21/06 12:00 AM,130.18,130.28,129.8,130.13,127.75,127.85\n8/22/06 12:00 AM,129.94,130.52,129.68,130.12,127.83,128.11\n8/23/06 12:00 AM,130.18,130.44,129.19,129.76,127.93,128.42\n8/24/06 12:00 AM,129.99,130.1,129.4,129.65,128.18,128.92\n8/25/06 12:00 AM,129.64,130.25,129.55,129.81,129.16,130.84\n8/28/06 12:00 AM,129.65,130.82,129.64,130.43,129.57,131.63\n8/29/06 12:00 AM,130.49,130.83,129.81,130.58,129.73,131.9\n8/30/06 12:00 AM,130.87,131.04,130.55,130.66,129.91,132.15\n8/31/06 12:00 AM,130.85,130.99,130.58,130.64,130.05,132.35\n9/1/06 12:00 AM,131.14,131.58,130.84,131.42,130.26,132.7\n9/5/06 12:00 AM,131.51,131.85,131.2,131.67,130.53,133.14\n9/6/06 12:00 AM,131.12,131.16,130.33,130.51,130.57,132.97\n9/7/06 12:00 AM,130.06,130.57,129.62,129.91,130.52,131.87\n9/8/06 12:00 AM,130.08,130.46,129.83,130.28,130.49,131.4\n9/11/06 12:00 AM,129.86,130.69,129.48,130.41,130.46,131.18\n9/12/06 12:00 AM,130.56,131.84,130.37,131.69,130.49,131.07\n9/13/06 12:00 AM,131.64,132.45,131.52,132.22,130.6,131.15\n9/14/06 12:00 AM,131.96,132.24,131.75,132.23,130.65,131.04\n9/15/06 12:00 AM,132.31,132.39,131.68,131.96,130.68,130.83\n9/18/06 12:00 AM,131.79,132.39,131.65,132.14,130.71,130.85\n9/19/06 12:00 AM,132.12,132.13,131.07,131.81,130.73,130.95\n9/20/06 12:00 AM,132.25,132.77,132.06,132.51,130.79,131.09\n9/21/06 12:00 AM,132.61,132.75,131.42,131.87,130.9,131.34\n9/22/06 12:00 AM,131.67,131.68,131,131.47,130.99,131.5\n9/25/06 12:00 AM,131.73,132.85,131.05,132.48,131.08,131.57\n9/26/06 12:00 AM,132.5,133.6,132.4,133.58,131.34,132.03\n9/27/06 12:00 AM,133.49,133.97,133.27,133.74,131.7,132.71\n9/28/06 12:00 AM,133.74,133.99,133.28,133.69,132,133.29\n9/29/06 12:00 AM,133.8,133.94,133.48,133.58,132.27,133.81\n10/2/06 12:00 AM,133.54,133.83,132.95,133.08,132.4,134\n10/3/06 12:00 AM,132.89,133.87,132.65,133.36,132.46,134.02\n10/4/06 12:00 AM,133.23,135,133.08,134.92,132.6,134.21\n10/5/06 12:00 AM,134.92,135.41,134.75,135.18,133.9,136.72\n10/6/06 12:00 AM,134.95,135.1,134.4,135.01,134.14,136.93\n10/9/06 12:00 AM,134.85,135.3,134.64,135.09,134.28,136.87\n10/10/06 12:00 AM,135.11,135.45,134.84,135.27,134.43,136.86\n10/11/06 12:00 AM,134.84,135.43,134.3,135.11,134.51,136.74\n10/12/06 12:00 AM,135.45,136.39,135.4,136.28,134.83,137.26\n10/13/06 12:00 AM,136.16,136.71,136.04,136.63,135.41,138.36\n10/16/06 12:00 AM,136.52,137.05,136.42,136.84,136.05,139.49\n10/17/06 12:00 AM,136.47,136.7,135.67,136.41,136.08,138.25\n10/18/06 12:00 AM,137.05,137.37,136.1,136.59,136.24,138.35\n10/19/06 12:00 AM,136.39,136.88,136.23,136.81,136.32,138.35\n10/20/06 12:00 AM,136.81,136.95,136.33,136.84,136.39,138.35\n10/23/06 12:00 AM,136.56,137.8,136.39,137.47,137.05,139.59\n10/24/06 12:00 AM,137.28,137.93,137.22,137.88,137.28,139.73\n10/25/06 12:00 AM,137.74,138.41,137.51,138.35,137.49,139.56\n10/26/06 12:00 AM,138.66,139,137.98,138.78,137.67,139.29\n10/27/06 12:00 AM,138.61,138.75,137.63,137.91,137.82,139.56\n10/30/06 12:00 AM,137.66,138.2,137.4,137.81,137.82,139.39\n10/31/06 12:00 AM,138.07,138.26,137.25,137.79,137.8,139.28\n11/1/06 12:00 AM,138.22,138.31,136.72,136.86,137.72,139.04\n11/2/06 12:00 AM,136.51,137.01,136.36,136.78,137.61,138.16\n11/3/06 12:00 AM,137.27,137.39,136.2,136.54,137.56,137.84\n11/6/06 12:00 AM,136.96,138.28,136.95,138.08,137.56,137.63\n11/7/06 12:00 AM,138.2,138.98,138,138.61,137.58,137.48\n11/8/06 12:00 AM,138,139.05,137.79,138.91,137.59,137.35\n11/9/06 12:00 AM,139.01,139.14,137.9,138.18,137.6,137.38\n11/10/06 12:00 AM,138.14,138.34,137.72,138.24,137.6,137.41\n11/13/06 12:00 AM,138.18,139.04,138.07,138.58,137.62,137.52\n11/14/06 12:00 AM,138.97,139.74,138.12,139.62,137.65,137.69\n11/15/06 12:00 AM,139.57,140.45,139.53,140.02,137.82,138.09\n11/16/06 12:00 AM,140.44,140.68,140.1,140.38,138.31,139.05\n11/17/06 12:00 AM,139.93,140.43,139.73,140.42,138.65,139.72\n11/20/06 12:00 AM,140.3,140.74,139.94,140.5,138.96,140.33\n11/21/06 12:00 AM,140.49,140.67,140.29,140.64,139.21,140.82\n11/22/06 12:00 AM,140.75,141.16,140.5,140.92,139.65,141.7\n11/24/06 12:00 AM,140.24,140.84,140.2,140.35,139.9,142.19\n11/27/06 12:00 AM,140.28,140.35,138.38,138.42,139.79,141.94\n11/28/06 12:00 AM,138.24,139.16,138.11,139.02,139.73,141.64\n11/29/06 12:00 AM,139.47,140.53,139.08,140.47,139.73,141.16\n11/30/06 12:00 AM,140.44,141.05,139.76,140.53,139.75,140.85\n12/1/06 12:00 AM,140.53,140.66,138.97,140.22,139.75,140.55\n12/4/06 12:00 AM,140.25,141.55,140.23,141.29,139.79,140.37\n12/5/06 12:00 AM,141.56,141.96,141.26,141.9,139.83,140\n12/6/06 12:00 AM,141.87,142.07,141.5,141.78,139.87,139.84\n12/7/06 12:00 AM,142.03,142.3,141.11,141.16,139.93,140.07\n12/8/06 12:00 AM,141.13,141.9,140.78,141.42,140.02,140.31\n12/11/06 12:00 AM,141.42,142.09,141.34,141.83,140.12,140.51\n12/12/06 12:00 AM,141.68,141.87,140.89,141.72,140.2,140.65\n12/13/06 12:00 AM,142.23,142.34,141.56,141.87,140.67,141.59\n12/14/06 12:00 AM,141.86,143.24,141.84,143.12,141.41,143.03\n12/15/06 12:00 AM,142.64,142.89,142.24,142.34,141.7,143.58\n12/18/06 12:00 AM,142.54,142.88,141.75,141.95,141.84,143.81\n12/19/06 12:00 AM,141.55,142.56,141.19,142.22,141.85,143.76\n12/20/06 12:00 AM,142.28,142.66,142.01,142.14,141.92,143.82\n12/21/06 12:00 AM,142.27,142.43,141.32,141.62,141.91,143.7\n12/22/06 12:00 AM,141.64,141.65,140.67,140.75,141.82,143.45\n12/26/06 12:00 AM,140.81,141.61,140.78,141.58,141.79,142.91\n12/27/06 12:00 AM,141.87,142.6,141.83,142.51,141.8,142.19\n12/28/06 12:00 AM,142.41,142.7,141.99,142.21,141.81,141.92\n12/29/06 12:00 AM,142.1,142.54,141.43,141.62,141.81,141.79\n1/3/07 12:00 AM,142.25,142.86,140.57,141.37,141.81,141.78\n1/4/07 12:00 AM,141.23,142.05,140.61,141.67,141.8,141.68\n1/5/07 12:00 AM,141.33,141.4,140.38,140.54,141.77,141.63\n1/8/07 12:00 AM,140.82,141.41,140.25,141.19,141.75,141.67\n1/9/07 12:00 AM,141.31,141.47,140.4,141.07,141.73,141.66\n1/10/07 12:00 AM,140.58,141.57,140.3,141.54,141.71,141.62\n1/11/07 12:00 AM,141.56,142.62,141.5,142.16,141.72,141.63\n1/12/07 12:00 AM,142.12,143.24,142.11,143.24,141.75,141.68\n1/16/07 12:00 AM,143.07,143.44,142.73,142.96,141.79,141.76\n1/17/07 12:00 AM,142.85,143.46,142.73,143.02,141.82,141.84\n1/18/07 12:00 AM,143.17,143.26,142.31,142.54,141.84,141.92\n1/19/07 12:00 AM,142.54,143.1,142.46,142.82,141.86,141.98\n1/22/07 12:00 AM,143.07,143.1,141.93,142.38,141.88,142.03\n1/23/07 12:00 AM,142.26,143.08,142.06,142.8,141.94,142.17\n1/24/07 12:00 AM,142.97,143.98,142.91,143.95,142.29,142.85\n1/25/07 12:00 AM,143.84,143.92,142.01,142.26,142.38,143.01\n1/26/07 12:00 AM,142.57,142.65,141.58,142.16,142.36,142.93\n1/29/07 12:00 AM,142.19,142.63,141.74,142.05,142.35,142.87\n1/30/07 12:00 AM,142.35,142.86,142.06,142.79,142.36,142.87\n1/31/07 12:00 AM,142.63,144.13,142.4,143.75,142.42,142.98\n2/1/07 12:00 AM,144.15,144.66,143.91,144.61,142.59,143.31\n2/2/07 12:00 AM,144.74,144.95,144.38,144.81,142.71,143.47\n2/5/07 12:00 AM,144.7,144.94,144.34,144.85,142.79,143.3\n2/6/07 12:00 AM,144.97,145.03,144.33,144.89,142.88,143.37\n2/7/07 12:00 AM,145.12,145.36,144.57,145.21,142.97,143.58\n2/8/07 12:00 AM,144.78,145.12,144.27,145.02,143.08,143.82\n2/9/07 12:00 AM,145.07,145.33,143.39,143.94,143.21,144.06\n2/12/07 12:00 AM,143.94,144.04,143.19,143.45,143.3,144.19\n2/13/07 12:00 AM,143.77,144.9,143.76,144.66,143.42,144.25\n2/14/07 12:00 AM,144.8,145.9,144.78,145.61,143.62,144.53\n2/15/07 12:00 AM,145.67,145.95,145.43,145.8,143.84,144.88\n2/16/07 12:00 AM,145.44,145.76,145.23,145.73,144,145.12\n2/20/07 12:00 AM,145.56,146.2,145.03,146.04,144.11,145.26\n2/21/07 12:00 AM,145.61,146.07,145.35,145.98,144.21,145.34\n2/22/07 12:00 AM,146.05,146.42,145.17,145.87,144.3,145.39\n2/23/07 12:00 AM,145.74,145.79,144.75,145.3,144.37,145.44\n2/26/07 12:00 AM,145.84,145.95,144.75,145.17,144.68,145.94\n2/27/07 12:00 AM,143.88,144.2,139,139.5,144.29,144.96\n2/28/07 12:00 AM,140.39,141.98,139.8,140.93,143.87,143.91\n3/1/07 12:00 AM,139.34,141.25,138.05,140.51,143.24,142.47\n3/2/07 12:00 AM,140.05,140.66,138.66,138.67,142.77,141.43\n3/5/07 12:00 AM,137.93,139.58,137.33,137.35,142.12,140.04\n3/6/07 12:00 AM,138.78,140.12,137.72,139.7,141.57,138.84\n3/7/07 12:00 AM,139.74,140.46,139.4,139.56,141.18,137.99\n3/8/07 12:00 AM,140.54,141.16,140.07,140.74,140.62,136.55\n3/9/07 12:00 AM,141.31,141.42,140.08,140.78,140.64,136.98\n3/12/07 12:00 AM,140.42,141.34,140.16,140.99,140.66,137.45\n3/13/07 12:00 AM,140.24,140.77,138.04,138.25,140.5,137.77\n3/14/07 12:00 AM,138.43,139.36,136.75,139.28,140.17,137.57\n3/15/07 12:00 AM,139.06,139.99,138.8,139.47,140.09,138.06\n3/16/07 12:00 AM,139.31,139.63,138.12,138.53,139.99,138.4\n3/19/07 12:00 AM,139.26,140.33,139.15,140.2,139.97,138.75\n3/20/07 12:00 AM,140.08,141.05,139.96,140.97,140,139.38\n3/21/07 12:00 AM,141.1,143.65,140.82,143.29,140.07,139.5\n3/22/07 12:00 AM,143.47,143.68,142.79,143.18,140.21,139.77\n3/23/07 12:00 AM,143.28,143.81,143.15,143.39,140.37,140.24\n3/26/07 12:00 AM,143.5,143.65,142.09,143.2,140.57,140.97\n3/27/07 12:00 AM,143.12,143.16,142.39,142.86,140.74,141.39\n3/28/07 12:00 AM,142.23,142.47,141.26,141.82,140.92,141.85\n3/29/07 12:00 AM,142.54,142.61,141.19,141.97,141.2,142.43\n3/30/07 12:00 AM,142.17,142.84,140.56,142,141.43,142.87\n4/2/07 12:00 AM,142.16,142.46,140.89,142.16,141.45,142.84\n4/3/07 12:00 AM,142.97,143.98,142.91,143.69,141.64,143.06\n4/4/07 12:00 AM,143.69,143.95,143.16,143.85,141.8,143.23\n4/5/07 12:00 AM,143.67,144.44,143.61,144.24,141.94,143.32\n4/9/07 12:00 AM,144.59,144.8,144.15,144.44,142.13,143.51\n4/10/07 12:00 AM,144.33,144.85,144.27,144.61,142.25,143.58\n4/11/07 12:00 AM,144.82,144.86,143.54,144.02,142.31,143.43\n4/12/07 12:00 AM,143.74,144.92,143.34,144.66,142.37,143.32\n4/13/07 12:00 AM,144.9,145.32,144.36,145.32,143.16,144.86\n4/16/07 12:00 AM,145.87,146.86,145.82,146.7,144.57,147.5\n4/17/07 12:00 AM,146.97,147.4,146.65,147.09,145.93,150.05\n4/18/07 12:00 AM,146.6,147.7,146.57,147.27,146.39,150.84\n4/19/07 12:00 AM,146.55,147.4,146.36,147.23,146.53,150.94\n4/20/07 12:00 AM,148.22,148.62,147.69,148.62,147.05,151.86\n4/23/07 12:00 AM,148.37,148.73,147.97,148.06,147.47,152.63\n4/24/07 12:00 AM,148.23,148.4,147.32,148.12,147.72,153.06\n4/25/07 12:00 AM,148.73,149.66,148.02,149.48,148.84,154.52\n4/26/07 12:00 AM,149.49,149.8,149.1,149.65,149.22,153.86\n4/27/07 12:00 AM,149.03,149.74,148.84,149.53,149.24,152.56\n4/30/07 12:00 AM,149.64,149.74,148.21,148.29,149.17,151.94\n5/1/07 12:00 AM,148.52,148.73,147.67,148.67,148.51,150.48\n5/2/07 12:00 AM,148.9,149.95,148.75,149.54,148.76,150.47\n5/3/07 12:00 AM,149.97,150.4,149.73,150.35,149.15,150.83\n5/4/07 12:00 AM,150.75,151.12,150.22,150.92,149.73,151.74\n5/7/07 12:00 AM,150.88,151.2,150.81,150.95,149.89,150.93\n5/8/07 12:00 AM,150.56,150.92,150.13,150.75,149.94,150.67\n5/9/07 12:00 AM,150.64,151.52,150.37,151.16,150.04,150.85\n5/10/07 12:00 AM,150.73,151.02,149.27,149.58,150.05,150.94\n5/11/07 12:00 AM,149.75,150.93,149.72,150.86,150.12,151.73\n5/14/07 12:00 AM,150.86,151.3,149.79,150.53,150.27,151.79\n5/15/07 12:00 AM,150.7,151.66,150.19,150.57,150.41,151.68\n5/16/07 12:00 AM,150.8,151.63,150.38,151.6,150.46,151.19\n5/17/07 12:00 AM,151.38,151.96,151.11,151.3,150.55,151.22\n5/18/07 12:00 AM,151.94,152.62,151.81,152.62,150.74,151.54\n5/21/07 12:00 AM,152.58,153.23,152.5,152.54,150.96,151.88\n5/22/07 12:00 AM,152.7,153.16,152.38,152.42,151.24,152.43\n5/23/07 12:00 AM,152.95,153.5,152.36,152.44,151.46,152.8\n5/24/07 12:00 AM,152.53,153.21,150.74,151.06,151.54,152.81\n5/25/07 12:00 AM,151.49,152.02,151.18,151.69,151.55,152.69\n5/29/07 12:00 AM,151.94,152.5,151.45,152.24,151.67,152.87\n5/30/07 12:00 AM,151.46,153.54,151.34,153.48,151.81,153.07\n5/31/07 12:00 AM,153.66,153.89,153.12,153.32,151.99,153.24\n6/1/07 12:00 AM,153.88,154.4,153.51,154.08,152.13,153.3\n6/4/07 12:00 AM,153.54,154.39,153.48,154.1,152.24,153.23\n6/5/07 12:00 AM,153.72,153.9,152.86,153.49,152.29,153.12\n6/6/07 12:00 AM,152.91,152.95,151.75,151.84,152.29,153.04\n6/7/07 12:00 AM,151.56,152.5,149.06,149.1,152.22,152.89\n6/8/07 12:00 AM,149.42,151.19,149.09,151.04,152.09,152.51\n6/11/07 12:00 AM,150.93,151.95,150.7,151.3,152.04,152.27\n6/12/07 12:00 AM,150.67,151.54,149.55,149.65,151.97,151.96\n6/13/07 12:00 AM,150.44,152.07,149.72,151.89,151.94,151.75\n6/14/07 12:00 AM,152.08,153.12,152.03,152.86,151.97,151.7\n6/15/07 12:00 AM,153.24,153.66,152.93,153.07,152.04,151.8\n6/18/07 12:00 AM,153.36,153.39,152.66,152.89,152.12,151.95\n6/19/07 12:00 AM,152.64,153.38,152.36,153.27,152.13,152.04\n6/20/07 12:00 AM,153.58,153.58,150.96,151.14,152.14,152.18\n6/21/07 12:00 AM,151.08,152.11,150.25,151.98,152.11,152.19\n6/22/07 12:00 AM,151.52,151.77,149.85,150.55,152.08,152.19\n6/25/07 12:00 AM,150.24,151.25,149.02,149.83,152.05,152.16\n6/26/07 12:00 AM,150.21,150.46,148.28,148.29,152,152.03\n6/27/07 12:00 AM,148.24,150.57,148.06,150.4,151.95,151.85\n6/28/07 12:00 AM,150.38,151.41,149.67,150.38,151.92,151.71\n6/29/07 12:00 AM,150.83,151.65,149.15,150.43,151.89,151.64\n7/2/07 12:00 AM,150.87,151.92,150.77,151.79,151.84,151.55\n7/3/07 12:00 AM,152.18,152.5,151.99,152.34,151.87,151.62\n7/5/07 12:00 AM,152.43,152.56,151.63,152.18,151.88,151.68\n7/6/07 12:00 AM,152.38,153.17,151.93,152.98,151.9,151.75\n7/9/07 12:00 AM,153.16,153.36,152.62,153,151.91,151.83\n7/10/07 12:00 AM,152.26,152.61,150.77,150.92,151.91,151.87\n7/11/07 12:00 AM,150.75,152.05,150.52,151.99,151.89,151.87\n7/12/07 12:00 AM,152.37,154.75,152.34,154.39,152.03,152.17\n7/13/07 12:00 AM,154.57,155.46,154.39,154.85,152.83,153.81\n7/16/07 12:00 AM,154.99,155.53,154.58,154.83,153.29,154.72\n7/17/07 12:00 AM,155.01,155.48,154.68,154.75,153.65,155.43\n7/18/07 12:00 AM,154.31,154.8,153.3,154.47,153.71,155.51\n7/19/07 12:00 AM,155.2,155.53,154.75,155.07,153.88,155.84\n7/20/07 12:00 AM,154.89,155.25,152.83,153.5,153.89,155.87\n7/23/07 12:00 AM,154.28,154.72,153.3,153.97,153.93,155.98\n7/24/07 12:00 AM,153.12,153.5,150.76,151.3,153.9,155.77\n7/25/07 12:00 AM,152.02,152.39,150.25,151.61,153.87,154.91\n7/26/07 12:00 AM,150.19,150.8,146.39,148.02,153.58,153.86\n7/27/07 12:00 AM,148.21,148.87,145.08,145.11,153.08,152.52\n7/30/07 12:00 AM,145.93,147.81,145.29,147.38,152.6,151.49\n7/31/07 12:00 AM,148.32,149.46,145.04,145.72,152.15,150.42\n8/1/07 12:00 AM,145.21,147.01,143.95,146.43,151.29,148.69\n8/2/07 12:00 AM,146.77,147.76,145.26,147.6,148.75,143.57\n8/3/07 12:00 AM,147.28,147.58,143.2,143.8,147.28,140.66\n8/6/07 12:00 AM,144.21,146.83,142.53,146.21,145.3,136.74\n8/7/07 12:00 AM,145.94,149,145.23,147.77,145.75,137.92\n8/8/07 12:00 AM,148.41,150.59,147.34,149.83,146.06,139.03\n8/9/07 12:00 AM,147.43,148.95,145.29,145.39,146.16,139.72\n8/10/07 12:00 AM,144.24,146.5,143.12,144.71,146.04,139.93\n8/13/07 12:00 AM,146.5,146.89,145.02,145.23,146.03,140.77\n8/14/07 12:00 AM,145.7,146.06,142.72,143.01,145.96,143.17\n8/15/07 12:00 AM,142.72,144.46,140.62,141.04,145.83,144.37\n8/16/07 12:00 AM,139.79,142.94,137.25,142.1,145.57,145.83\n8/17/07 12:00 AM,145.56,145.81,142.32,144.71,145.47,145.2\n8/20/07 12:00 AM,145.17,145.47,143.29,144.64,145.39,144.73\n8/21/07 12:00 AM,144.6,145.97,144.14,144.93,145.34,144.52\n8/22/07 12:00 AM,146.01,146.8,145.33,146.65,145.45,144.87\n8/23/07 12:00 AM,147.34,147.65,145.61,146.52,145.59,145.15\n8/24/07 12:00 AM,146.48,148.33,146.28,148.33,145.74,145.53\n8/27/07 12:00 AM,147.85,148.33,146.73,146.95,145.83,145.84\n8/28/07 12:00 AM,146.16,146.25,143.46,143.72,145.75,145.93\n8/29/07 12:00 AM,144.37,146.74,143.96,146.54,145.7,145.93\n8/30/07 12:00 AM,145.45,147.19,145.31,146.15,145.76,146.12\n8/31/07 12:00 AM,147.65,148.5,146.83,147.59,146.08,146.82\n9/4/07 12:00 AM,147.45,149.98,147.4,149.08,146.62,147.78\n9/5/07 12:00 AM,148.2,148.36,147,147.79,146.78,147.97\n9/6/07 12:00 AM,147.95,148.61,147.12,148.13,146.9,148.06\n9/7/07 12:00 AM,146.48,146.89,145.26,146.07,146.81,147.79\n9/10/07 12:00 AM,146.52,146.72,144.33,145.79,146.74,147.74\n9/11/07 12:00 AM,146.24,147.7,146.13,147.49,146.75,147.8\n9/12/07 12:00 AM,147.29,148.44,146.98,147.87,146.79,147.83\n9/13/07 12:00 AM,148.55,149.45,148.2,148.91,146.87,147.65\n9/14/07 12:00 AM,147.96,149.09,147.74,148.9,146.9,147.18\n9/17/07 12:00 AM,148.31,148.89,147.63,148.1,146.93,147.08\n9/18/07 12:00 AM,148.82,152.5,148.13,152.46,147.07,147.23\n9/19/07 12:00 AM,153.41,154.39,152.71,153.36,147.47,148.14\n9/20/07 12:00 AM,153.34,153.43,152.11,152.28,148.13,149.52\n9/21/07 12:00 AM,152.71,152.89,151.74,151.97,148.87,150.99\n9/24/07 12:00 AM,152.42,152.82,151.36,151.69,149.67,152.55\n9/25/07 12:00 AM,150.81,151.66,150.47,151.39,150.02,153.17\n9/26/07 12:00 AM,152.25,152.77,151.39,152.19,150.7,154.5\n9/27/07 12:00 AM,152.88,153.1,152.19,153.09,151.56,156.19\n9/28/07 12:00 AM,152.85,153.19,151.98,152.58,151.86,156.66\n10/1/07 12:00 AM,152.6,154.75,152.5,154.3,152.07,156.67\n10/2/07 12:00 AM,154.61,154.65,153.81,154.09,152.25,156.37\n10/3/07 12:00 AM,153.81,154.41,153.49,153.78,152.37,155.86\n10/4/07 12:00 AM,154.11,154.26,153.59,154.02,152.45,155.23\n10/5/07 12:00 AM,155.03,156.1,154.63,155.85,152.84,155.66\n10/8/07 12:00 AM,155.39,155.49,154.77,155.02,153.27,155.85\n10/9/07 12:00 AM,155.6,156.5,155.03,156.48,153.74,155.92\n10/10/07 12:00 AM,156.04,156.44,155.41,156.22,154.1,156.33\n10/11/07 12:00 AM,156.93,157.52,154.54,155.47,154.75,157.42\n10/12/07 12:00 AM,155.46,156.35,155.27,156.33,155.1,157.95\n10/15/07 12:00 AM,156.27,156.36,153.94,155.01,155.12,157.88\n10/16/07 12:00 AM,154.41,154.52,153.47,153.77,154.75,157.05\n10/17/07 12:00 AM,154.98,155.09,152.47,154.25,154.7,156.57\n10/18/07 12:00 AM,153.45,154.19,153.08,153.69,154.67,156.06\n10/19/07 12:00 AM,153.1,153.15,149.66,149.66,154.51,155.27\n10/22/07 12:00 AM,148.84,150.76,148.66,150.54,154.1,154.11\n10/23/07 12:00 AM,151.3,151.95,150.25,151.76,153.64,152.52\n10/24/07 12:00 AM,151.21,151.74,148.84,151.48,153.12,151.13\n10/25/07 12:00 AM,151.68,152.29,149.88,151.84,152.4,149.67\n10/26/07 12:00 AM,153.06,153.62,151.9,153.62,152.52,150.28\n10/29/07 12:00 AM,153.93,154.44,153.55,154.13,152.91,151.11\n10/30/07 12:00 AM,153.45,153.75,152.87,153.06,153.01,151.36\n10/31/07 12:00 AM,153.98,155.27,152.84,154.65,153.05,151.6\n11/1/07 12:00 AM,153.3,153.41,150.59,151.03,153.02,151.95\n11/2/07 12:00 AM,151.53,152,149.21,151.2,152.98,152.33\n11/5/07 12:00 AM,149.64,151.16,148.97,150.05,152.93,152.74\n11/6/07 12:00 AM,150.86,152.11,149.9,152.07,152.9,153.41\n11/7/07 12:00 AM,150.44,151.13,147.55,147.91,152.84,153.16\n11/8/07 12:00 AM,147.99,149.3,145.07,147.16,152.55,152.19\n11/9/07 12:00 AM,145.51,147.54,144.89,145.14,152.21,151.42\n11/12/07 12:00 AM,145.21,146.61,143.7,143.7,151.49,149.94\n11/13/07 12:00 AM,145.26,148.31,145.22,148.08,150.59,148.15\n11/14/07 12:00 AM,149.22,149.4,146.78,147.67,150.11,147.24\n11/15/07 12:00 AM,146.79,147.49,144.52,145.54,149.28,145.62\n11/16/07 12:00 AM,146.28,146.47,144.57,145.79,148.07,143.24\n11/19/07 12:00 AM,145.28,145.36,143.19,143.76,146.6,140.35\n11/20/07 12:00 AM,143.64,145.53,142.11,144.64,146.18,139.8\n11/21/07 12:00 AM,143.08,143.91,141.67,141.68,145.67,139.12\n11/23/07 12:00 AM,143.03,144.34,142.7,144.13,145.51,139.53\n11/26/07 12:00 AM,144.39,144.88,140.66,140.95,145.33,140.06\n11/27/07 12:00 AM,141.74,143.23,140.95,142.57,144.84,139.57\n11/28/07 12:00 AM,144.19,147.47,144.14,147.13,144.99,140.7\n11/29/07 12:00 AM,146.62,147.72,146.1,147.18,145.21,142.35\n11/30/07 12:00 AM,149.04,149.25,147.33,148.66,145.3,144.01\n12/3/07 12:00 AM,148.19,148.45,147.29,147.68,145.35,144.53\n12/4/07 12:00 AM,146.66,147.54,146.31,146.36,145.38,145.08\n12/5/07 12:00 AM,147.93,149.2,147.83,148.81,145.43,145.34\n12/6/07 12:00 AM,148.63,151.21,148.57,150.94,145.52,145.71\n12/7/07 12:00 AM,151.42,151.5,150.55,150.91,146.44,148.04\n12/10/07 12:00 AM,151.28,152.25,150.86,152.08,148.88,152.77\n12/11/07 12:00 AM,152.14,152.89,147.83,147.91,149.6,153.98\n12/12/07 12:00 AM,151.54,151.77,147.2,149.37,149.57,153.84\n12/13/07 12:00 AM,148.32,149.39,147.3,149.06,149.28,153.2\n12/14/07 12:00 AM,148.04,149.1,147.1,147.17,148.87,152.37\n12/17/07 12:00 AM,146.61,146.87,144.86,145.07,148.48,151.54\n12/18/07 12:00 AM,146.1,146.48,143.96,145.88,148.34,151.17\n12/19/07 12:00 AM,145.94,146.89,144.94,145.88,148.3,150.15\n12/20/07 12:00 AM,146.84,146.86,145.18,146.8,148.23,147.58\n12/21/07 12:00 AM,147.37,148.42,147.09,148.13,148.21,146.82\n12/24/07 12:00 AM,148.73,149.48,148.48,149.23,148.31,147.05\n12/26/07 12:00 AM,148.8,149.68,148.5,149.55,148.4,147.53\n12/27/07 12:00 AM,149.02,149.03,147.32,147.67,148.36,147.85\n12/28/07 12:00 AM,148.54,148.61,146.9,147.3,148.33,148.17\n12/31/07 12:00 AM,147.1,147.61,146.06,146.21,148.24,148.13\n1/2/08 12:00 AM,146.53,146.99,143.88,144.93,148.13,147.96\n1/3/08 12:00 AM,144.91,145.49,144.07,144.86,148,147.78\n1/4/08 12:00 AM,143.34,143.44,140.91,141.31,147.65,147.09\n1/7/08 12:00 AM,141.81,142.23,140.1,141.19,147.33,146.36\n1/8/08 12:00 AM,142.08,142.9,138.44,138.91,146.77,145.14\n1/9/08 12:00 AM,139.01,140.79,137.7,140.37,145.92,143.47\n1/10/08 12:00 AM,139.68,142.8,139.37,141.29,145.09,141.85\n1/11/08 12:00 AM,140.78,141.57,139,140.15,143.41,138.57\n1/14/08 12:00 AM,141.16,141.7,140.4,141.28,142.39,136.64\n1/15/08 12:00 AM,139.75,140.1,137.9,138.17,139,130\n1/16/08 12:00 AM,137.37,139.12,136.28,136.98,138.48,129.31\n1/17/08 12:00 AM,137.57,137.88,132.93,133.43,137.38,127.42\n1/18/08 12:00 AM,134.19,135.02,131.1,132.06,136.36,125.95\n1/22/08 12:00 AM,126.4,132.43,126,130.72,134.51,123.1\n1/23/08 12:00 AM,127.17,134.19,126.84,133.86,133.21,121.34\n1/24/08 12:00 AM,134.26,135.46,133.31,134.99,133.58,123.76\n1/25/08 12:00 AM,136.49,136.76,132.6,133.04,134.09,125.79\n1/28/08 12:00 AM,133.26,135.52,132.06,135.24,133.91,128.82\n1/29/08 12:00 AM,136.1,136.45,134.88,135.91,134.87,131.27\n1/30/08 12:00 AM,135.58,138.54,134.6,134.91,135.13,132.87\n1/31/08 12:00 AM,133.42,138.54,133.2,137.3,135.19,134.02\n2/1/08 12:00 AM,137.92,139.61,137.52,139.52,135.27,136.03\n2/4/08 12:00 AM,139.21,139.3,137.64,137.76,135.51,137.8\n2/5/08 12:00 AM,135.86,136.25,133.67,134.13,135.47,137.35\n2/6/08 12:00 AM,134.58,135.25,132.41,133.05,135.37,136.65\n2/7/08 12:00 AM,132.1,134.79,131.73,133.93,135.25,136.59\n2/8/08 12:00 AM,133.24,134.22,132.1,133.07,135.08,135.28\n2/11/08 12:00 AM,133.1,134.23,132.04,133.75,134.95,134.76\n2/12/08 12:00 AM,134.91,136.31,133.98,134.99,134.96,134.73\n2/13/08 12:00 AM,136.06,137.1,135.14,136.37,135.01,134.75\n2/14/08 12:00 AM,136.95,137,134.79,135.17,135.04,134.58\n2/15/08 12:00 AM,134.55,135.22,133.91,135.14,135.03,134.59\n2/19/08 12:00 AM,136.69,136.89,134.61,135.52,135.05,134.74\n2/20/08 12:00 AM,133.99,136.55,133.76,135.92,135.06,134.86\n2/21/08 12:00 AM,136.66,137.01,134.07,134.79,135.08,135.07\n2/22/08 12:00 AM,134.97,135.85,132.86,135.62,135.03,135.12\n2/25/08 12:00 AM,135.54,137.65,134.78,137.33,135.08,135.21\n2/26/08 12:00 AM,136.73,138.95,136.5,138.36,135.14,135.26\n2/27/08 12:00 AM,137.56,139.14,137.41,138.22,135.29,135.54\n2/28/08 12:00 AM,137.24,137.96,136.55,136.87,135.39,135.75\n2/29/08 12:00 AM,135.6,135.68,132.78,133.82,135.34,135.62\n3/3/08 12:00 AM,133.14,133.81,132.24,133.5,135.26,135.47\n3/4/08 12:00 AM,132.23,133.4,130.99,132.99,135.14,135.2\n3/5/08 12:00 AM,133.41,134.77,132.34,133.83,135.04,135.05\n3/6/08 12:00 AM,132.98,133.22,130.55,131.06,134.87,134.66\n3/7/08 12:00 AM,129.73,131.74,128.58,129.71,134.64,134.15\n3/10/08 12:00 AM,129.81,129.93,127.59,128,134.12,132.96\n3/11/08 12:00 AM,130.72,132.72,128.95,132.6,133.35,131.31\n3/12/08 12:00 AM,132.73,133.77,131.16,131.36,133.04,130.75\n3/13/08 12:00 AM,129.61,132.64,128.6,131.65,132.39,129.52\n3/14/08 12:00 AM,132.77,132.81,127.78,129.61,132.07,129.01\n3/17/08 12:00 AM,126.35,129.26,126.07,128.3,130.85,126.65\n3/18/08 12:00 AM,130.62,133.69,129.98,133.63,131.08,127.28\n3/19/08 12:00 AM,134.14,134.65,130.04,130.32,131.18,127.71\n3/20/08 12:00 AM,130.04,132.91,129.26,132.08,131.17,128.22\n3/24/08 12:00 AM,133.31,135.81,133.24,134.72,131.23,129.11\n3/25/08 12:00 AM,134.86,135.55,133.77,134.85,131.32,129.6\n3/26/08 12:00 AM,134.46,135.09,133.11,133.2,131.39,130.39\n3/27/08 12:00 AM,134.2,134.44,132.36,132.78,131.44,130.81\n3/28/08 12:00 AM,132.99,133.36,131.06,131.51,131.5,132.16\n3/31/08 12:00 AM,131.29,132.73,131.09,131.97,131.54,132\n4/1/08 12:00 AM,133.61,136.84,133.51,136.61,131.78,132.39\n4/2/08 12:00 AM,137.06,137.67,135.98,136.7,132.63,134.08\n4/3/08 12:00 AM,135.94,137.44,135.71,137.04,133.03,134.83\n4/4/08 12:00 AM,136.95,137.96,136.12,136.89,133.46,135.6\n4/7/08 12:00 AM,137.87,138.57,136.74,136.96,133.96,136.52\n4/8/08 12:00 AM,136.19,136.92,135.95,136.82,134.25,137.05\n4/9/08 12:00 AM,136.61,136.8,134.89,135.83,134.35,137.2\n4/10/08 12:00 AM,135.39,136.67,134.9,136.02,134.68,137.83\n4/11/08 12:00 AM,134.48,135.11,133.01,133.38,134.62,137.46\n4/14/08 12:00 AM,133.19,133.54,132.55,132.93,134.57,136.52\n4/15/08 12:00 AM,133.58,133.69,132.33,133.24,134.53,136.02\n4/16/08 12:00 AM,134.54,136.93,134.4,136.85,134.55,135.65\n4/17/08 12:00 AM,136.02,137.25,135.66,137.05,134.62,135.29\n4/18/08 12:00 AM,138.94,139.56,138.26,138.48,134.73,135.22\n4/21/08 12:00 AM,138.23,138.98,137.85,138.55,134.83,135.3\n4/22/08 12:00 AM,138.19,138.31,136.9,137.94,134.91,135.13\n4/23/08 12:00 AM,138.09,138.78,137.12,137.72,134.98,135.34\n4/24/08 12:00 AM,138.08,139.74,137.04,138.32,135.04,135.52\n4/25/08 12:00 AM,139.41,139.89,137.91,139.6,135.25,135.98\n4/28/08 12:00 AM,139.88,140.25,139.38,139.63,135.82,137.1\n4/29/08 12:00 AM,139.39,139.73,138.61,139.08,138.34,142.05\n4/30/08 12:00 AM,139.29,140.59,138.26,138.26,138.51,142.28\n5/1/08 12:00 AM,138.39,141.12,138.27,141.12,138.71,142.6\n5/2/08 12:00 AM,142.33,142.37,140.56,141.51,139.33,143.76\n5/5/08 12:00 AM,141.05,141.61,140.41,140.83,139.71,144.45\n5/6/08 12:00 AM,140.01,142.2,139.69,142.05,140.12,145.19\n5/7/08 12:00 AM,141.89,142.04,139.13,139.52,140.25,145.26\n5/8/08 12:00 AM,139.74,140.32,138.98,139.16,140.15,144.47\n5/9/08 12:00 AM,138.6,139.39,138.45,138.9,139.99,141.65\n5/12/08 12:00 AM,139.25,140.56,138.73,140.46,139.96,141.41\n5/13/08 12:00 AM,140.8,140.89,139.73,140.48,139.98,141.25\n5/14/08 12:00 AM,141.09,142.2,140.46,140.77,140.02,140.71\n5/15/08 12:00 AM,141.04,142.63,140.83,142.53,140.07,140.43\n5/16/08 12:00 AM,142.86,142.87,141.61,142.66,140.12,140.12\n5/19/08 12:00 AM,142.81,144.3,142.3,143.05,140.23,140.21\n5/20/08 12:00 AM,142.27,142.34,141,141.89,140.28,140.42\n5/21/08 12:00 AM,141.81,142.12,139,139.49,140.3,140.6\n5/22/08 12:00 AM,139.43,140.17,139,139.51,140.26,140.56\n5/23/08 12:00 AM,139.05,139.66,137.52,137.64,140.18,140.37\n5/27/08 12:00 AM,137.8,139,137.53,138.66,140.08,140.13\n5/28/08 12:00 AM,139.17,139.55,138,139.3,140.02,139.97\n5/29/08 12:00 AM,139.13,140.93,139.08,140,140.02,139.92\n5/30/08 12:00 AM,140.47,140.74,139.94,140.35,140.04,139.84\n6/2/08 12:00 AM,139.83,139.86,138,138.9,139.97,139.66\n6/3/08 12:00 AM,139.3,139.62,137.23,138.09,139.72,139.14\n6/4/08 12:00 AM,137.77,139.16,137.46,138.02,139.43,138.61\n6/5/08 12:00 AM,138.58,140.89,138.32,140.78,139.45,138.71\n6/6/08 12:00 AM,139.55,139.8,136.22,136.29,139.31,138.54\n6/9/08 12:00 AM,136.86,137.5,135.41,136.62,138.98,137.93\n6/10/08 12:00 AM,135.67,137.1,135.35,135.94,138.65,137.27\n6/11/08 12:00 AM,135.97,136.26,133.93,133.94,138.27,136.5\n6/12/08 12:00 AM,134.6,135.87,133.52,134.45,137.87,135.76\n6/13/08 12:00 AM,135.17,136.52,134.42,136.15,137.7,135.69\n6/16/08 12:00 AM,135.55,136.93,135.46,136.23,137.6,135.76\n6/17/08 12:00 AM,137.07,137.12,135.37,135.57,137.41,135.37\n6/18/08 12:00 AM,134.69,135.52,133.71,134.25,136.44,133.57\n6/19/08 12:00 AM,134.15,135.24,133.5,134.42,135.92,132.85\n6/20/08 12:00 AM,132.85,133.09,131.22,131.58,134.68,130.72\n6/23/08 12:00 AM,132.04,132.23,131.32,131.45,134.24,130.22\n6/24/08 12:00 AM,131.05,132.44,130.19,131.19,133.82,129.77\n6/25/08 12:00 AM,131.72,133.4,131.24,131.81,133.6,129.5\n6/26/08 12:00 AM,130.57,131.42,128.08,128.23,132.85,128.11\n6/27/08 12:00 AM,128.28,128.86,127.04,127.53,130.99,124.57\n6/30/08 12:00 AM,127.89,128.91,127.3,127.98,129.94,123.44\n7/1/08 12:00 AM,126.52,128.47,125.93,128.38,127.2,118.48\n7/2/08 12:00 AM,128.79,129.16,125.95,126.18,127.31,119.93\n7/3/08 12:00 AM,127.11,127.11,124.99,126.31,126.89,119.53\n7/7/08 12:00 AM,126.79,127.34,123.92,125.02,126.59,119.37\n7/8/08 12:00 AM,124.99,127.39,124.2,127.24,126.15,118.7\n7/9/08 12:00 AM,127.5,127.74,124.39,124.79,126.1,119.34\n7/10/08 12:00 AM,124.43,125.79,123.58,125.3,125.62,120.25\n7/11/08 12:00 AM,123.93,125.75,122.49,123.85,125.08,120.22\n7/14/08 12:00 AM,125.26,125.5,122.4,122.72,124.88,122.55\n7/15/08 12:00 AM,121.8,123.49,120.02,120.99,123.53,119.75\n7/16/08 12:00 AM,121.45,124.57,121.1,123.96,123.33,119.77\n7/17/08 12:00 AM,125.14,126.26,124.09,125.2,123.68,120.76\n7/18/08 12:00 AM,126.17,126.42,125.15,125.98,123.99,121.83\n7/21/08 12:00 AM,126.51,126.8,125.19,126.05,124.31,122.53\n7/22/08 12:00 AM,125.15,127.8,124.85,127.48,124.48,123.33\n7/23/08 12:00 AM,127.89,129.15,127.55,128.17,124.58,124.08\n7/24/08 12:00 AM,128.34,128.41,125.16,125.51,124.63,124.39\n7/25/08 12:00 AM,125.89,126.49,125.17,125.48,124.67,125.8\n7/28/08 12:00 AM,125.51,126.06,123.42,123.64,124.67,126.01\n7/29/08 12:00 AM,123.98,126.38,123.64,126.28,124.7,125.72\n7/30/08 12:00 AM,127.02,128.6,126.28,128.53,124.91,125.83\n7/31/08 12:00 AM,127.4,128.57,126.63,126.83,125.24,126.17\n8/1/08 12:00 AM,127.12,127.28,125.46,126.16,125.32,126.17\n8/4/08 12:00 AM,126.04,126.14,124.76,124.99,125.33,126.08\n8/5/08 12:00 AM,126.01,128.56,125.9,128.36,125.43,126.22\n8/6/08 12:00 AM,128.02,129.3,127.48,128.93,125.51,126.36\n8/7/08 12:00 AM,127.96,129.05,126.54,127.01,125.54,126.41\n8/8/08 12:00 AM,126.58,129.93,126.38,129.37,125.63,126.56\n8/11/08 12:00 AM,129.45,131.51,129.23,130.71,125.9,126.88\n8/12/08 12:00 AM,130.28,130.34,128.73,129.35,126.1,126.96\n8/13/08 12:00 AM,128.79,129.65,127.67,128.57,126.24,127.17\n8/14/08 12:00 AM,127.84,130.28,127.75,129.54,126.65,127.98\n8/15/08 12:00 AM,129.93,130.5,129.3,130.17,127.3,129.18\n8/18/08 12:00 AM,130.43,130.48,127.66,128.39,127.53,129.55\n8/19/08 12:00 AM,127.42,127.69,126.53,126.99,127.48,129.42\n8/20/08 12:00 AM,127.39,127.95,126.34,127.58,127.46,129.29\n8/21/08 12:00 AM,126.75,128.44,126.6,127.8,127.46,129.03\n8/22/08 12:00 AM,128.67,129.65,127.8,129.65,127.51,128.93\n8/25/08 12:00 AM,128.8,128.84,126.75,127.02,127.53,128.81\n8/26/08 12:00 AM,127.02,127.87,126.58,127.39,127.52,128.38\n8/27/08 12:00 AM,127.55,128.83,127.3,128.63,127.53,127.76\n8/28/08 12:00 AM,129.19,130.34,129.11,130.19,127.58,127.63\n8/29/08 12:00 AM,129.68,130.14,128.51,128.79,127.62,127.76\n9/2/08 12:00 AM,130.06,130.71,127.52,127.99,127.65,127.84\n9/3/08 12:00 AM,127.88,128.5,126.93,127.88,127.65,127.84\n9/4/08 12:00 AM,126.97,127.23,123.96,124.03,127.57,127.62\n9/5/08 12:00 AM,123.29,124.95,122,124.42,127.26,126.99\n9/8/08 12:00 AM,128.04,128.24,124.42,126.99,127.19,126.86\n9/9/08 12:00 AM,127.1,127.36,122.8,123.22,127.03,126.53\n9/10/08 12:00 AM,123.89,124.9,122.55,123.72,126.76,125.94\n9/11/08 12:00 AM,122.12,125.74,121.6,125.51,126.49,125.35\n9/12/08 12:00 AM,124.29,126.21,123.83,126.09,126.07,124.5\n9/15/08 12:00 AM,121.81,124.28,119.89,120.09,124.53,121.4\n9/16/08 12:00 AM,117.2,122.32,117,122.1,123.72,119.88\n9/17/08 12:00 AM,119.64,120.38,116,116.61,123.2,119.13\n9/18/08 12:00 AM,118.05,121.79,113.8,120.07,122.33,117.46\n9/19/08 12:00 AM,126.91,127.53,123.33,124.12,122.8,118.57\n9/22/08 12:00 AM,124.45,124.75,120.36,121.31,122.76,118.77\n9/23/08 12:00 AM,120.85,122.02,118.28,118.55,122.41,118.33\n9/24/08 12:00 AM,119.18,120,117.79,118.93,122.04,118\n9/25/08 12:00 AM,119.56,121.91,118.44,120.79,121.93,119.33\n9/26/08 12:00 AM,118.83,121.5,118.51,120.85,121.88,120.03\n9/29/08 12:00 AM,119.18,119.34,110.97,111.38,121.65,120.1\n9/30/08 12:00 AM,113.51,116.74,112.71,115.99,121.52,120.71\n10/1/08 12:00 AM,115.18,116.69,113.95,116.06,121.31,119.81\n10/2/08 12:00 AM,114.95,115.11,111.06,111.85,120.74,118.71\n10/3/08 12:00 AM,112.86,115.45,109.68,110.34,120.06,117.71\n10/6/08 12:00 AM,107.15,107.62,100.64,104.72,117.29,112.54\n10/7/08 12:00 AM,106.84,107.33,99.65,100.03,114.55,107.18\n10/8/08 12:00 AM,97.52,102.18,96.81,97.51,109.54,97.21\n10/9/08 12:00 AM,99.66,100.62,90.25,90.7,104.11,86.58\n10/10/08 12:00 AM,86.76,93.94,83.58,88.5,97.3,73.07\n10/13/08 12:00 AM,93.87,101.35,93.17,101.35,97.28,73.25\n10/14/08 12:00 AM,104.7,105.53,97.11,99.85,99.22,77.71\n10/15/08 12:00 AM,97.46,97.8,89.71,90.02,93.75,67.45\n10/16/08 12:00 AM,91.29,94.77,86.54,93.77,92.69,68.09\n10/17/08 12:00 AM,91.99,98.59,91.65,93.21,93.62,72.69\n10/20/08 12:00 AM,95.35,99.1,94.09,98.81,94.32,79.1\n10/21/08 12:00 AM,96.97,98.64,95.22,95.86,94.53,84.95\n10/22/08 12:00 AM,93.2,95.86,87.53,90.64,94.39,91.49\n10/23/08 12:00 AM,90.29,92.45,85.81,91.69,94.18,91.08\n10/24/08 12:00 AM,84.06,89.92,84,87.04,93.63,88.03\n10/27/08 12:00 AM,85.97,89.51,83.7,83.95,93.36,92.97\n10/28/08 12:00 AM,87.34,94.24,84.53,93.76,93.22,93.75\n10/29/08 12:00 AM,93.77,97.17,92.1,93.08,93.26,92.9\n10/30/08 12:00 AM,95.78,96.54,92.9,96.3,93.31,92.29\n10/31/08 12:00 AM,95.08,98.57,94.48,96.83,93.41,92.29\n11/3/08 12:00 AM,96.78,97.69,95.95,97.11,93.6,92.8\n11/4/08 12:00 AM,99.06,100.86,98.19,100.41,93.78,93.38\n11/5/08 12:00 AM,99.2,100.71,95,96.19,93.84,94.06\n11/6/08 12:00 AM,94.46,95.44,90.06,90.86,93.82,94.28\n11/7/08 12:00 AM,91.65,94,90.86,93.86,93.74,94.26\n11/10/08 12:00 AM,95.21,95.53,90.92,92.63,93.71,94.15\n11/11/08 12:00 AM,90.76,92.14,88.65,89.77,93.55,93.79\n11/12/08 12:00 AM,88.23,90.15,85.12,85.82,93.42,93.43\n11/13/08 12:00 AM,86.13,91.73,82.09,91.17,93.29,92.98\n11/14/08 12:00 AM,89.41,92.06,86.52,86.62,93.23,92.68\n11/17/08 12:00 AM,86.38,88.56,85.16,85.47,92.98,92.13\n11/18/08 12:00 AM,85.15,87.22,82.91,87.08,92.61,91.4\n11/19/08 12:00 AM,85.91,86.87,80.92,81.5,90.87,88\n11/20/08 12:00 AM,80.13,82.51,75.05,75.45,83.64,73.57\n11/21/08 12:00 AM,77.46,80.9,74.34,79.52,80.94,68.34\n11/24/08 12:00 AM,81.89,86.99,81.17,85.03,81.61,69.8\n11/25/08 12:00 AM,87.3,87.51,83.82,85.66,82.1,70.91\n11/26/08 12:00 AM,84.3,89.19,84.24,88.97,83.05,72.87\n11/28/08 12:00 AM,88.63,90.13,88.48,90.09,83.79,74.59\n12/1/08 12:00 AM,87.51,87.55,81.86,82.11,83.9,75.18\n12/2/08 12:00 AM,83.47,85.49,82.04,85.27,83.89,76.9\n12/3/08 12:00 AM,83.4,87.83,83.14,87.32,83.91,84.18\n12/4/08 12:00 AM,86.06,88.05,83.74,85.3,84.04,87.14\n12/5/08 12:00 AM,83.65,88.42,82.24,87.93,84.15,86.68\n12/8/08 12:00 AM,90.34,92.38,89.8,91,84.5,86.9\n12/9/08 12:00 AM,90.37,92.13,88.98,89.5,85.13,87.21\n12/10/08 12:00 AM,90.32,91.36,89,90.11,85.54,87.3\n12/11/08 12:00 AM,89.54,91,87.37,87.94,85.85,87.81\n12/12/08 12:00 AM,85.55,89.07,85.2,88.99,85.97,88.05\n12/15/08 12:00 AM,89.02,89.15,86.29,87.75,86.13,88.34\n12/16/08 12:00 AM,88.3,92.02,88.18,91.88,86.24,88.44\n12/17/08 12:00 AM,90.84,92.43,90.06,90.99,86.64,89.13\n12/18/08 12:00 AM,91.4,91.67,88.21,89.29,86.74,88.99\n12/19/08 12:00 AM,89.1,90.62,88.09,88.19,86.83,88.52\n12/22/08 12:00 AM,88.58,88.67,85.49,87.06,86.83,88.13\n12/23/08 12:00 AM,87.52,87.93,85.8,86.16,86.84,87.82\n12/24/08 12:00 AM,86.45,86.87,86,86.66,86.82,87.68\n12/26/08 12:00 AM,87.24,87.3,86.5,87.16,86.83,87.52\n12/29/08 12:00 AM,87.24,87.33,85.6,86.91,86.81,87.38\n12/30/08 12:00 AM,87.51,89.05,86.88,88.97,86.83,87.03\n12/31/08 12:00 AM,89.08,90.97,88.87,90.24,86.91,87.07\n1/2/09 12:00 AM,90.44,93.44,89.85,92.96,86.99,87.15\n1/5/09 12:00 AM,92.63,93.66,91.89,92.85,87.1,87.37\n1/6/09 12:00 AM,93.64,94.45,92.68,93.47,87.27,87.7\n1/7/09 12:00 AM,92,92.26,90.2,90.67,87.36,87.89\n1/8/09 12:00 AM,90.16,91.09,89.67,91.04,87.43,88.03\n1/9/09 12:00 AM,91.16,91.32,88.67,89.09,87.53,88.25\n1/12/09 12:00 AM,88.84,88.91,86.41,86.95,87.54,88.25\n1/13/09 12:00 AM,86.73,87.88,86.2,87.11,87.51,88.11\n1/14/09 12:00 AM,85.54,85.75,83.69,84.37,87.44,87.89\n1/15/09 12:00 AM,84.12,85.25,81.72,84.4,87.29,87.47\n1/16/09 12:00 AM,85.86,85.99,83.05,85.06,87.12,86.97\n1/20/09 12:00 AM,84.23,85.06,80.05,80.57,86.62,85.88\n1/21/09 12:00 AM,81.94,84.24,80.47,84.05,86.16,84.89\n1/22/09 12:00 AM,82.42,84.04,81.17,82.75,84.68,81.82\n1/23/09 12:00 AM,80.9,83.99,80.57,83.11,83.42,79.3\n1/26/09 12:00 AM,83.59,85.36,82.81,83.68,84.09,80.66\n1/27/09 12:00 AM,84.13,85.15,83.3,84.53,84.14,80.84\n1/28/09 12:00 AM,86.4,87.95,86.07,87.39,84.4,81.52\n1/29/09 12:00 AM,86.11,86.36,84.46,84.55,84.47,81.82\n1/30/09 12:00 AM,84.98,85.4,82.21,82.83,84.44,82.27\n2/2/09 12:00 AM,81.57,83.18,81.31,82.58,84.37,82.58\n2/3/09 12:00 AM,83.1,84.36,82.22,83.74,84.35,84.02\n2/4/09 12:00 AM,84.3,85.37,83.04,83.33,84.34,85.27\n2/5/09 12:00 AM,82.7,85.29,82.12,84.57,84.32,84.55\n2/6/09 12:00 AM,84.86,87.34,84.68,86.98,84.39,84.65\n2/9/09 12:00 AM,86.96,87.74,86.32,87.1,84.44,84.49\n2/10/09 12:00 AM,86.27,87.03,82.45,83.11,84.45,84.43\n2/11/09 12:00 AM,83.45,84.05,82.4,83.6,84.43,84.41\n2/12/09 12:00 AM,82.17,83.82,81.05,83.66,84.4,84.44\n2/13/09 12:00 AM,83.55,84.24,82.74,82.76,84.39,84.43\n2/17/09 12:00 AM,80.16,80.62,79.17,79.22,84.27,84.2\n2/18/09 12:00 AM,79.79,79.94,78.28,79.03,84.1,83.88\n2/19/09 12:00 AM,79.84,80.15,78.02,78.18,83.91,83.44\n2/20/09 12:00 AM,76.73,78.34,75.77,77.42,83.4,82.36\n2/23/09 12:00 AM,78.27,78.27,74.59,74.65,81.57,78.68\n2/24/09 12:00 AM,75.29,77.95,74.7,77.48,80.19,75.94\n2/25/09 12:00 AM,77.14,78.42,75.63,76.87,79.44,74.48\n2/26/09 12:00 AM,77.82,78.38,75.53,75.62,76.95,69.52\n2/27/09 12:00 AM,74.01,75.69,73.81,73.93,75.55,66.83\n3/2/09 12:00 AM,72.52,72.92,70.37,70.6,73.57,63.04\n3/3/09 12:00 AM,71.61,71.7,69.64,70.07,71.06,58.21\n3/4/09 12:00 AM,71.83,72.87,70.07,71.73,71.22,59.04\n3/5/09 12:00 AM,70.1,70.87,68.17,68.8,70.81,60.05\n3/6/09 12:00 AM,69.4,70.45,67.1,68.92,70.28,60.36\n3/9/09 12:00 AM,67.95,70,67.73,68.11,69.9,60.36\n3/10/09 12:00 AM,69.51,72.37,69.37,72.17,70.48,64\n3/11/09 12:00 AM,73,73.75,71.83,72.64,72.79,70.03\n3/12/09 12:00 AM,72.62,75.75,71.97,75.5,72.9,72.23\n3/13/09 12:00 AM,76.01,76.98,74.73,76.09,73.01,74.95\n3/16/09 12:00 AM,76.96,77.97,75.81,75.86,73.11,74.99\n3/17/09 12:00 AM,76.07,78.36,75.45,78.18,73.16,75.51\n3/18/09 12:00 AM,77.81,80.9,77.07,79.93,73.29,76.3\n3/19/09 12:00 AM,80.93,81,78.69,78.94,73.53,77.15\n3/20/09 12:00 AM,78.76,78.91,76.53,76.71,74.35,78.22\n3/23/09 12:00 AM,78.74,82.29,78.31,82.22,77.2,81.62\n3/24/09 12:00 AM,81.24,82.36,80.51,80.6,79.96,87.02\n3/25/09 12:00 AM,81.23,82.7,79.06,81.45,80.45,87.9\n3/26/09 12:00 AM,82.25,83.3,81.32,83.11,81.16,89.22\n3/27/09 12:00 AM,82.05,82.53,81.31,81.61,81.54,89.91\n3/30/09 12:00 AM,79.8,79.87,77.96,78.79,81.03,88.77\n3/31/09 12:00 AM,79.56,81.08,79.05,79.52,80.88,88.23\n4/1/09 12:00 AM,78.53,81.42,78.33,81.06,80.67,86.98\n4/2/09 12:00 AM,83.08,84.61,82.73,83.43,81.09,84.98\n4/3/09 12:00 AM,83.49,84.62,82.67,84.26,81.31,82.67\n4/6/09 12:00 AM,83.34,83.81,82.29,83.6,81.42,82.39\n4/7/09 12:00 AM,82.25,82.65,81.51,81.65,81.45,81.74\n4/8/09 12:00 AM,82.06,82.94,81.54,82.53,81.48,81.43\n4/9/09 12:00 AM,84.67,85.82,84.33,85.81,81.69,82.35\n4/13/09 12:00 AM,84.92,86.54,84.58,85.83,81.96,83.04\n4/14/09 12:00 AM,85.03,85.76,84.08,84.35,82.8,84.93\n4/15/09 12:00 AM,83.84,85.42,83.61,85.25,83.02,84.95\n4/16/09 12:00 AM,85.93,87.15,84.77,86.5,83.45,85.58\n4/17/09 12:00 AM,86.83,87.65,86.14,87.08,83.99,86.56\n4/20/09 12:00 AM,85.54,85.66,83.34,83.43,84.07,86.69\n4/21/09 12:00 AM,82.82,85.13,82.75,85.06,84.03,86.58\n4/22/09 12:00 AM,84.29,86.34,84.07,84.54,84.21,86.73\n4/23/09 12:00 AM,84.71,85.42,83.63,85.37,84.24,86.53\n4/24/09 12:00 AM,86.03,87.31,85.69,86.66,84.33,85.87\n4/27/09 12:00 AM,85.68,87.01,85.54,85.84,84.41,85.81\n4/28/09 12:00 AM,84.97,86.59,84.76,85.57,84.45,85.45\n4/29/09 12:00 AM,86.52,88.36,86.3,87.39,84.53,85.07\n4/30/09 12:00 AM,88.55,89.02,86.92,87.42,84.65,85.23\n5/1/09 12:00 AM,87.44,88.21,86.72,87.89,84.76,85.48\n5/4/09 12:00 AM,88.55,90.97,88.38,90.88,85.11,86\n5/5/09 12:00 AM,90.57,90.93,89.84,90.57,85.82,87.4\n5/6/09 12:00 AM,91.68,92.2,90.61,92.14,86.77,89.21\n5/7/09 12:00 AM,93.01,93.15,90.28,90.86,87.74,91.07\n5/8/09 12:00 AM,92.03,93.22,91.44,92.98,89.79,95.14\n5/11/09 12:00 AM,91.7,92.11,91.04,91.24,90.47,96.41\n5/12/09 12:00 AM,91.63,91.83,89.85,90.97,90.57,96.49\n5/13/09 12:00 AM,89.74,90.01,88.5,88.68,89.71,94.67\n5/14/09 12:00 AM,88.72,90.12,88.5,89.44,89.63,94.14\n5/15/09 12:00 AM,89.37,90,88.15,88.71,89.54,93.27\n5/18/09 12:00 AM,89.55,91.34,89.37,91.23,89.6,92.44\n5/19/09 12:00 AM,91.18,91.97,90.81,91.12,89.69,91.63\n5/20/09 12:00 AM,91.95,92.8,90.41,90.51,89.75,89.71\n5/21/09 12:00 AM,89.46,89.8,88.26,89.21,89.73,88.99\n5/22/09 12:00 AM,89.46,90,88.68,89.02,89.72,88.87\n5/26/09 12:00 AM,88.36,91.56,88.32,91.3,89.72,89.73\n5/27/09 12:00 AM,91.44,91.75,89.53,89.67,89.74,89.85\n5/28/09 12:00 AM,90.46,91.34,89.1,90.92,89.74,89.95\n5/29/09 12:00 AM,91.42,93.17,90.68,92.53,89.77,89.93\n6/1/09 12:00 AM,93.67,95.17,93.43,94.43,89.9,90.11\n6/2/09 12:00 AM,94.4,95.37,94.16,94.85,90.09,90.43\n6/3/09 12:00 AM,94.04,94.13,92.76,93.65,90.23,90.72\n6/4/09 12:00 AM,94,94.67,93.3,94.53,90.38,91.04\n6/5/09 12:00 AM,95.49,95.67,93.8,94.55,90.69,91.65\n6/8/09 12:00 AM,93.84,95.1,93.04,94.16,90.92,92.11\n6/9/09 12:00 AM,94.69,95.14,94.02,94.64,91.61,93.48\n6/10/09 12:00 AM,95.48,95.49,93.19,94.4,93.52,97.27\n6/11/09 12:00 AM,94.58,96.11,94.56,94.82,93.83,97.75\n6/12/09 12:00 AM,94.4,95.14,94,95.08,93.94,97.78\n6/15/09 12:00 AM,93.96,94.02,92.4,92.9,93.85,97.48\n6/16/09 12:00 AM,93.23,93.29,91.58,91.64,93.75,97.12\n6/17/09 12:00 AM,91.6,92.33,90.83,91.55,93.68,96.68\n6/18/09 12:00 AM,91.69,92.67,91.25,92.22,93.63,96.34\n6/19/09 12:00 AM,92.58,92.7,91.52,92.04,93.61,95.61\n6/22/09 12:00 AM,91.14,91.19,89.25,89.28,93.28,93.05\n6/23/09 12:00 AM,89.47,89.88,88.85,89.35,92.69,91.55\n6/24/09 12:00 AM,90.16,91.08,89.6,90.12,91.88,89.81\n6/25/09 12:00 AM,89.67,92.17,89.57,92.08,91.41,88.97\n6/26/09 12:00 AM,91.77,92.24,91.27,91.84,91.54,89.33\n6/29/09 12:00 AM,92.11,92.82,91.6,92.7,91.68,89.67\n6/30/09 12:00 AM,92.72,93.06,91.27,91.95,91.76,89.89\n7/1/09 12:00 AM,92.34,93.23,92.21,92.33,91.9,90.2\n7/2/09 12:00 AM,91.13,91.16,89.76,89.81,91.82,90.36\n7/6/09 12:00 AM,88.94,89.93,88.66,89.8,91.74,90.8\n7/7/09 12:00 AM,89.71,89.82,88,88.06,91.67,91.46\n7/8/09 12:00 AM,88.59,88.8,87,88,91.55,91.7\n7/9/09 12:00 AM,88.61,88.9,87.91,88.17,91.42,91.31\n7/10/09 12:00 AM,87.7,88.49,87.35,87.96,91.29,90.91\n7/13/09 12:00 AM,88.31,90.17,87.59,90.1,91.21,90.67\n7/14/09 12:00 AM,90.38,90.69,89.73,90.61,91.09,90.28\n7/15/09 12:00 AM,91.81,93.51,91.68,93.26,91.14,90.45\n7/16/09 12:00 AM,93,94.51,92.82,94.16,91.25,90.75\n7/17/09 12:00 AM,94.06,94.32,93.54,94.13,91.33,90.99\n7/20/09 12:00 AM,94.68,95.29,94.19,95.13,91.42,91.3\n7/21/09 12:00 AM,95.87,95.9,94.42,95.57,91.55,91.68\n7/22/09 12:00 AM,94.96,96.13,94.89,95.55,91.72,92.14\n7/23/09 12:00 AM,95.61,98.08,95.53,97.66,92.54,93.86\n7/24/09 12:00 AM,97.2,98.14,96.69,98.06,97.41,103.74\n7/27/09 12:00 AM,97.88,98.4,97.34,98.35,97.72,104.31\n7/28/09 12:00 AM,97.66,98.37,97.06,97.89,97.72,104.19\n7/29/09 12:00 AM,97.44,98.09,96.98,97.65,97.57,103.8\n7/30/09 12:00 AM,98.83,99.83,98.6,98.67,98.62,105.82\n7/31/09 12:00 AM,98.65,99.47,98.38,98.81,98.8,106.05\n8/3/09 12:00 AM,99.85,100.53,99.31,100.44,99.63,107.54\n8/4/09 12:00 AM,99.99,100.84,99.78,100.7,99.94,107.34\n8/5/09 12:00 AM,100.77,100.86,99.58,100.41,100.07,102.72\n8/6/09 12:00 AM,100.87,101.02,99.42,99.89,100.12,102.52\n8/7/09 12:00 AM,100.94,102.03,100.39,101.2,100.51,103.3\n8/10/09 12:00 AM,100.74,101.22,100.27,100.99,100.74,103.92\n8/11/09 12:00 AM,100.54,100.61,99.46,99.73,100.52,102.42\n8/12/09 12:00 AM,99.56,101.56,99.51,100.8,100.53,102.26\n8/13/09 12:00 AM,101.26,101.61,100.26,101.57,100.67,101.71\n8/14/09 12:00 AM,101.52,101.6,99.7,100.79,100.67,101.39\n8/17/09 12:00 AM,98.85,98.95,98.11,98.31,100.55,101.03\n8/18/09 12:00 AM,98.53,99.44,98.35,99.09,100.47,100.81\n8/19/09 12:00 AM,98.31,100.3,98.21,99.96,100.43,100.35\n8/20/09 12:00 AM,100.09,101.22,99.87,100.99,100.43,100.12\n8/21/09 12:00 AM,101.82,103.13,101.62,102.97,100.48,100.45\n8/24/09 12:00 AM,103.39,103.95,102.59,102.96,100.7,100.88\n8/25/09 12:00 AM,103.37,104.26,102.94,103.16,100.98,101.29\n8/26/09 12:00 AM,102.84,103.64,102.49,103.17,101.18,101.69\n8/27/09 12:00 AM,103.11,103.72,101.94,103.4,101.25,101.95\n8/28/09 12:00 AM,104.23,104.35,102.67,103.38,101.34,102.22\n8/31/09 12:00 AM,102.37,102.58,101.79,102.46,101.51,102.58\n9/1/09 12:00 AM,101.95,103.24,99.99,100.2,101.53,102.63\n9/2/09 12:00 AM,99.78,100.44,99.57,99.82,101.45,102.42\n9/3/09 12:00 AM,100.4,100.77,99.59,100.65,101.42,102.13\n9/4/09 12:00 AM,100.85,102.09,100.55,102.06,101.41,101.85\n9/8/09 12:00 AM,103,103.05,102.39,102.94,101.45,101.71\n9/9/09 12:00 AM,103.12,104.08,102.8,103.73,101.49,101.74\n9/10/09 12:00 AM,103.8,104.86,103.22,104.79,101.56,101.78\n9/11/09 12:00 AM,104.99,105.3,104.28,104.77,101.63,101.76\n9/14/09 12:00 AM,103.88,105.46,103.7,105.28,101.71,101.88\n9/15/09 12:00 AM,105.45,106.11,104.76,105.72,101.81,102.16\n9/16/09 12:00 AM,106.1,107.34,105.73,107.32,102.14,102.87\n9/17/09 12:00 AM,107.17,108.06,106.57,107.16,103.45,105.48\n9/18/09 12:00 AM,107.15,107.16,106.36,106.72,104.53,107.62\n9/21/09 12:00 AM,105.89,106.72,105.66,106.45,105.26,109.02\n9/22/09 12:00 AM,107.08,107.37,106.6,107.07,106,110.43\n9/23/09 12:00 AM,107.32,108.03,105.99,106.18,106.32,111\n9/24/09 12:00 AM,106.41,106.64,104.55,105.01,105.95,110.19\n9/25/09 12:00 AM,104.78,105.36,104.09,104.45,105.65,109.5\n9/28/09 12:00 AM,104.85,106.55,104.83,106.32,105.66,109.17\n9/29/09 12:00 AM,106.51,107.02,105.78,106,105.68,107.91\n9/30/09 12:00 AM,106.36,106.46,104.62,105.59,105.68,106.82\n10/1/09 12:00 AM,105.34,105.73,102.95,103,105.66,106.06\n10/2/09 12:00 AM,102.02,103.1,101.99,102.49,105.57,105.15\n10/5/09 12:00 AM,102.9,104.32,102.6,104.02,105.46,104.59\n10/6/09 12:00 AM,104.77,106.11,104.71,105.51,105.45,104.95\n10/7/09 12:00 AM,105.27,105.91,105.07,105.8,105.45,105.25\n10/8/09 12:00 AM,106.55,107.17,106.15,106.61,105.53,105.41\n10/9/09 12:00 AM,106.64,107.26,106.36,107.26,105.61,105.54\n10/12/09 12:00 AM,107.76,108.09,107.28,107.68,105.69,105.7\n10/13/09 12:00 AM,107.39,107.71,106.76,107.46,105.71,105.77\n10/14/09 12:00 AM,108.72,109.42,108.26,109.31,105.8,106.02\n10/15/09 12:00 AM,108.78,109.71,108.73,109.71,106.4,107.34\n10/16/09 12:00 AM,108.8,109.27,108.23,108.89,106.93,108.4\n10/19/09 12:00 AM,109.07,110.13,108.73,109.79,108.2,110.95\n10/20/09 12:00 AM,109.95,109.99,108.68,109.21,108.81,112.08\n10/21/09 12:00 AM,109.04,110.31,108.15,108.23,109.09,112.58\n10/22/09 12:00 AM,108.19,109.68,107.5,109.33,108.91,112.12\n10/23/09 12:00 AM,109.69,109.76,107.63,108.08,108.77,111.83\n10/26/09 12:00 AM,108.2,109.31,106.61,106.91,108.67,111.54\n10/27/09 12:00 AM,107.03,107.39,106.16,106.42,108.6,110.79\n10/28/09 12:00 AM,106.15,106.48,104.35,104.41,108.53,110.13\n10/29/09 12:00 AM,105.19,106.86,104.94,106.65,108.44,108.67\n10/30/09 12:00 AM,106.3,106.62,103.44,103.56,108.25,107.7\n11/2/09 12:00 AM,104.13,105.41,103.08,104.32,107.85,106.61\n11/3/09 12:00 AM,103.74,104.8,103.54,104.65,107.48,106.06\n11/4/09 12:00 AM,105.51,106.33,104.65,104.92,107.03,105.29\n11/5/09 12:00 AM,105.66,106.88,105.44,106.85,106.59,104.51\n11/6/09 12:00 AM,106.26,107.4,106.05,107.13,106.64,104.68\n11/9/09 12:00 AM,107.95,109.63,107.87,109.57,106.69,104.86\n11/10/09 12:00 AM,109.31,109.93,108.97,109.59,106.75,105.07\n11/11/09 12:00 AM,110.31,110.82,109.62,110.15,106.81,105.36\n11/12/09 12:00 AM,110,110.57,108.75,109.03,106.86,105.87\n11/13/09 12:00 AM,109.31,110.09,108.75,109.62,106.95,106.42\n11/16/09 12:00 AM,110.38,111.69,110.32,111.21,107.3,107.56\n11/17/09 12:00 AM,110.92,111.39,110.5,111.34,108.69,110.8\n11/18/09 12:00 AM,111.26,111.43,110.57,111.27,111,115.36\n11/19/09 12:00 AM,110.51,110.56,109.13,109.82,110.39,114.1\n11/20/09 12:00 AM,109.26,109.76,109.01,109.43,109.96,113.17\n11/23/09 12:00 AM,110.72,111.74,110.6,110.82,110.25,113.7\n11/24/09 12:00 AM,111,111.2,110.01,110.99,110.33,113.8\n11/25/09 12:00 AM,111.17,111.5,110.82,111.38,110.52,114.08\n11/27/09 12:00 AM,108.4,110.32,108.29,109.46,110.45,113.6\n11/30/09 12:00 AM,109.48,110.2,109.02,109.94,110.41,112.13\n12/1/09 12:00 AM,110.92,111.66,110.73,111.3,110.42,109.84\n12/2/09 12:00 AM,111.28,112.01,110.92,111.25,110.44,110.49\n12/3/09 12:00 AM,111.55,112.18,110.29,110.38,110.46,110.96\n12/4/09 12:00 AM,111.84,112.38,110.04,111.01,110.48,110.71\n12/7/09 12:00 AM,110.91,111.53,110.49,110.84,110.5,110.66\n12/8/09 12:00 AM,110.04,110.04,109.27,109.61,110.47,110.42\n12/9/09 12:00 AM,109.58,110.18,109.02,110.02,110.44,110.43\n12/10/09 12:00 AM,110.7,111.12,110.45,110.64,110.45,110.49\n12/11/09 12:00 AM,111.11,111.36,110.61,111.11,110.47,110.51\n12/14/09 12:00 AM,111.87,112,111.37,111.87,110.5,110.56\n12/15/09 12:00 AM,111.46,111.92,111,111.35,110.52,110.58\n12/16/09 12:00 AM,111.8,112.13,111.27,111.52,110.55,110.62\n12/17/09 12:00 AM,110.72,110.93,110.08,110.18,110.55,110.6\n12/18/09 12:00 AM,110.2,110.3,109.28,110.21,110.53,110.59\n12/21/09 12:00 AM,110.76,111.7,110.76,111.33,110.54,110.65\n12/22/09 12:00 AM,111.57,111.97,111.43,111.73,110.56,110.67\n12/23/09 12:00 AM,112,112.11,111.5,111.95,110.58,110.7\n12/24/09 12:00 AM,112.19,112.61,112.18,112.56,110.61,110.72\n12/28/09 12:00 AM,112.9,112.99,112.32,112.72,110.66,110.79\n12/29/09 12:00 AM,113.01,113.03,112.55,112.56,110.72,110.88\n12/30/09 12:00 AM,112.23,112.65,112.17,112.52,110.76,110.98\n12/31/09 12:00 AM,112.77,112.8,111.39,111.44,110.95,111.38\n1/4/10 12:00 AM,112.37,113.39,112.33,113.33,111.59,112.64\n1/5/10 12:00 AM,113.26,113.68,112.85,113.63,112.19,113.81\n1/6/10 12:00 AM,113.52,113.99,113.43,113.71,112.76,114.95\n1/7/10 12:00 AM,113.5,114.33,113.18,114.19,113,115.39\n1/8/10 12:00 AM,113.89,114.62,113.66,114.57,113.2,115.74\n1/11/10 12:00 AM,115.08,115.13,114.24,114.73,113.49,116.26\n1/12/10 12:00 AM,113.97,114.21,113.22,113.66,113.53,116.3\n1/13/10 12:00 AM,113.95,114.94,113.37,114.62,113.76,116.58\n1/14/10 12:00 AM,114.49,115.14,114.42,114.93,114.18,116.77\n1/15/10 12:00 AM,114.73,114.84,113.2,113.64,114.11,116.03\n1/19/10 12:00 AM,113.62,115.13,113.59,115.06,114.18,115.59\n1/20/10 12:00 AM,114.28,114.45,112.98,113.89,114.12,115.24\n1/21/10 12:00 AM,113.92,114.27,111.56,111.7,114.1,114.99\n1/22/10 12:00 AM,111.2,111.74,109.09,109.21,113.94,114.4\n1/25/10 12:00 AM,110.21,110.41,109.41,109.77,113.78,114.03\n1/26/10 12:00 AM,109.34,110.47,109.04,109.31,113.45,113.14\n1/27/10 12:00 AM,109.17,110.08,108.33,109.83,112.83,111.47\n1/28/10 12:00 AM,110.19,110.25,107.91,108.57,112.06,110.01\n1/29/10 12:00 AM,109.04,109.8,107.22,107.39,110.74,107.29\n2/1/10 12:00 AM,108.15,109.07,107.5,109.06,109.84,105.55\n2/2/10 12:00 AM,109.26,110.59,108.88,110.38,109.75,105.4\n2/3/10 12:00 AM,109.88,110.48,109.51,109.83,109.83,105.71\n2/4/10 12:00 AM,108.98,109.03,106.42,106.44,109.09,104.41\n2/5/10 12:00 AM,106.56,106.88,104.58,106.66,107.74,102.03\n2/8/10 12:00 AM,106.74,107.33,105.81,105.89,107.42,102.01\n2/9/10 12:00 AM,107.13,108.15,106.27,107.22,107.37,102.68\n2/10/10 12:00 AM,107.05,107.6,106.11,107.01,107.3,103.86\n2/11/10 12:00 AM,106.87,108.25,106.25,108.13,107.29,104.75\n2/12/10 12:00 AM,106.99,108.1,106.51,108.04,107.29,104.83\n2/16/10 12:00 AM,108.86,109.85,108.42,109.74,107.46,105.09\n2/17/10 12:00 AM,110.27,110.41,109.74,110.26,107.55,106\n2/18/10 12:00 AM,110.08,111.14,110.04,110.91,107.63,107.52\n2/19/10 12:00 AM,110.62,111.57,110.36,111.14,107.75,108.09\n2/22/10 12:00 AM,111.55,111.58,110.83,111.16,107.88,108.39\n2/23/10 12:00 AM,110.86,111.2,109.52,109.81,107.98,108.67\n2/24/10 12:00 AM,110.14,111,109.86,110.82,108.1,108.91\n2/25/10 12:00 AM,109.24,110.75,108.94,110.67,108.41,109.54\n2/26/10 12:00 AM,110.77,111.12,110.11,110.74,109.39,111.33\n3/1/10 12:00 AM,111.2,112,111.17,111.89,110.05,112.56\n3/2/10 12:00 AM,112.37,112.74,112,112.2,110.42,113.22\n3/3/10 12:00 AM,112.49,112.97,112.02,112.3,110.66,113.58\n3/4/10 12:00 AM,112.45,112.8,112.03,112.64,110.87,113.85\n3/5/10 12:00 AM,113.38,114.34,113.1,114.25,111.3,114.63\n3/8/10 12:00 AM,114.26,114.52,114.07,114.27,111.76,115.41\n3/9/10 12:00 AM,113.93,114.99,113.87,114.46,112.46,116.5\n3/10/10 12:00 AM,114.51,115.28,114.41,114.97,114.03,118.67\n3/11/10 12:00 AM,114.7,115.48,114.35,115.45,114.91,119.78\n3/12/10 12:00 AM,115.95,115.97,115.14,115.46,115.25,120.08\n3/15/10 12:00 AM,115.26,115.57,114.6,115.49,115.18,119.69\n3/16/10 12:00 AM,115.81,116.52,115.49,116.41,116.01,121.14\n3/17/10 12:00 AM,116.76,117.48,116.71,117.1,116.77,122.23\n3/18/10 12:00 AM,117.11,117.27,116.57,117.04,116.86,121.97\n3/19/10 12:00 AM,116.96,117.29,115.52,115.97,116.6,120.74\n3/22/10 12:00 AM,115.31,116.8,115.24,116.59,116.37,118.7\n3/23/10 12:00 AM,116.76,117.51,116.38,117.41,116.58,118.25\n3/24/10 12:00 AM,116.97,117.43,116.6,116.84,116.68,118.11\n3/25/10 12:00 AM,117.63,118.1,116.51,116.65,116.97,118.77\n3/26/10 12:00 AM,116.87,117.42,116.12,116.58,116.93,117.85\n3/29/10 12:00 AM,117.17,117.53,116.97,117.32,116.95,117.13\n3/30/10 12:00 AM,117.46,117.83,116.91,117.4,116.97,117.09\n3/31/10 12:00 AM,116.95,117.52,116.61,117,116.98,117.36\n4/1/10 12:00 AM,117.8,118.25,117.1,117.8,117.07,117.78\n4/5/10 12:00 AM,118.25,118.84,117.92,118.76,117.27,117.96\n4/6/10 12:00 AM,118.42,119.25,118.29,119.04,117.54,118.39\n4/7/10 12:00 AM,118.8,119.36,117.81,118.36,117.61,118.25\n4/8/10 12:00 AM,117.95,118.97,117.6,118.77,117.7,118.47\n4/9/10 12:00 AM,119.02,119.6,118.8,119.55,117.91,118.88\n4/12/10 12:00 AM,119.7,120.05,119.56,119.74,118.23,119.48\n4/13/10 12:00 AM,119.62,120.04,119,119.83,118.6,120.22\n4/14/10 12:00 AM,120.27,121.19,120.08,121.19,119.51,121.95\n4/15/10 12:00 AM,120.99,121.57,120.95,121.29,119.96,122.65\n4/16/10 12:00 AM,120.86,121.29,118.75,119.36,119.97,122.41\n4/19/10 12:00 AM,119.01,119.93,118.47,119.81,119.85,122.09\n4/20/10 12:00 AM,120.56,120.98,120.17,120.88,120.09,122.49\n4/21/10 12:00 AM,120.95,121.23,119.99,120.66,120.23,122.54\n4/22/10 12:00 AM,119.81,121.17,119.12,121.02,120.21,122.2\n4/23/10 12:00 AM,120.94,121.86,120.63,121.81,120.37,122.14\n4/26/10 12:00 AM,121.85,122.12,121.23,121.35,120.42,121.34\n4/27/10 12:00 AM,120.65,121.33,118.25,118.48,120.41,120.85\n4/28/10 12:00 AM,119.05,119.68,118.27,119.38,120.37,120.77\n4/29/10 12:00 AM,120.1,121.11,120.07,120.86,120.38,120.9\n4/30/10 12:00 AM,120.88,121.01,118.78,118.81,120.37,120.64\n5/3/10 12:00 AM,119.38,120.68,119.2,120.35,120.36,120.49\n5/4/10 12:00 AM,119.01,119.03,116.92,117.52,120.25,120.29\n5/5/10 12:00 AM,116.54,117.8,115.97,116.82,120.07,119.77\n5/6/10 12:00 AM,116.26,117,105,112.94,116.82,113.21\n5/7/10 12:00 AM,112.64,113.77,109.58,111.26,114.97,109.54\n5/10/10 12:00 AM,115.81,116.65,114.91,116.16,115.26,110.15\n5/11/10 12:00 AM,115.07,117.36,114.91,115.83,115.59,110.79\n5/12/10 12:00 AM,116.29,117.62,116.09,117.45,116.11,111.86\n5/13/10 12:00 AM,117.13,117.68,115.89,115.99,116.61,112.87\n5/14/10 12:00 AM,115.12,115.33,112.87,113.89,114.81,109.37\n5/17/10 12:00 AM,114.2,114.52,111.77,113.95,113.93,107.78\n5/18/10 12:00 AM,114.88,115.22,112.03,112.4,113.9,110.99\n5/19/10 12:00 AM,111.77,112.77,110.36,111.76,113.71,112.45\n5/20/10 12:00 AM,109.38,109.89,107.47,107.54,113.52,111.77\n5/21/10 12:00 AM,105.91,109.38,105.36,109.11,113.38,111.17\n5/24/10 12:00 AM,108.52,109.39,107.61,107.71,113.27,110.43\n5/25/10 12:00 AM,105.11,107.87,104.38,107.82,113.07,109.52\n5/26/10 12:00 AM,108.48,109.47,106.85,107.17,112.95,111.09\n5/27/10 12:00 AM,109.19,110.8,108.78,110.76,112.88,111.83\n5/28/10 12:00 AM,110.64,110.72,108.85,109.37,112.14,110.37\n6/1/10 12:00 AM,108.35,109.95,107.37,107.53,109.34,104.96\n6/2/10 12:00 AM,108.08,110.34,107.51,110.33,109.24,104.97\n6/3/10 12:00 AM,110.65,111.06,109.58,110.71,109.34,105.31\n6/4/10 12:00 AM,108.61,109.33,106.46,106.82,109.21,105.14\n6/7/10 12:00 AM,107.2,107.61,105.41,105.49,109.04,105.01\n6/8/10 12:00 AM,105.57,106.83,104.65,106.62,108.89,104.82\n6/9/10 12:00 AM,107.24,108.28,105.6,106.05,108.8,104.71\n6/10/10 12:00 AM,107.86,109.28,107.69,109.15,108.79,105.44\n6/11/10 12:00 AM,108.19,109.75,108.12,109.68,108.79,108.25\n6/14/10 12:00 AM,110.52,111.12,109.4,109.51,108.81,108.38\n6/15/10 12:00 AM,110.28,112.1,110.09,112,108.85,108.36\n6/16/10 12:00 AM,111.42,112.42,111.2,111.96,108.91,108.62\n6/17/10 12:00 AM,112.28,112.33,111.05,112.14,108.99,108.94\n6/18/10 12:00 AM,111.83,112.13,111.37,111.73,109.07,109.25\n6/21/10 12:00 AM,113.12,113.2,110.79,111.41,109.39,109.98\n6/22/10 12:00 AM,111.41,111.9,109.41,109.57,109.57,110.35\n6/23/10 12:00 AM,109.64,110.03,108.48,109.23,109.51,110.24\n6/24/10 12:00 AM,108.69,108.83,107.14,107.42,109.39,109.97\n6/25/10 12:00 AM,107.74,108.42,106.77,107.87,109.32,109.79\n6/28/10 12:00 AM,108.03,108.32,107.14,107.53,109.27,109.62\n6/29/10 12:00 AM,106.02,106.07,103.55,104.21,109.18,109.37\n6/30/10 12:00 AM,103.92,104.88,102.88,103.22,108.99,108.92\n7/1/10 12:00 AM,103.15,103.49,101.13,102.76,108.08,106.76\n7/2/10 12:00 AM,103.11,103.42,101.62,102.2,105.98,102.39\n7/6/10 12:00 AM,103.64,104.37,101.88,102.87,103.62,97.72\n7/7/10 12:00 AM,103.13,106.24,103.02,106.11,104.14,98.88\n7/8/10 12:00 AM,107,107.28,105.91,107.16,105.24,101.16\n7/9/10 12:00 AM,107.13,107.97,106.93,107.96,106.42,103.57\n7/12/10 12:00 AM,107.6,108.24,107.15,108.03,106.56,103.95\n7/13/10 12:00 AM,109.15,110.09,108.93,109.66,106.69,104.39\n7/14/10 12:00 AM,109.31,110.08,108.86,109.65,106.75,105.43\n7/15/10 12:00 AM,109.61,110.06,108.17,109.68,106.79,107.59\n7/16/10 12:00 AM,109.09,109.21,106.45,106.66,106.82,110.03\n7/19/10 12:00 AM,107.05,107.63,106.22,107.29,106.84,109.55\n7/20/10 12:00 AM,105.87,108.56,105.82,108.48,106.91,108.58\n7/21/10 12:00 AM,109.04,109.07,106.63,107.07,107.14,107.85\n7/22/10 12:00 AM,108.34,109.94,108.33,109.46,107.55,108.53\n7/23/10 12:00 AM,109.24,110.57,108.93,110.41,107.73,108.77\n7/26/10 12:00 AM,110.6,111.67,110.29,111.56,108.04,109.33\n7/27/10 12:00 AM,112.17,112.29,111.11,111.55,108.41,110.04\n7/28/10 12:00 AM,111.32,111.66,110.46,110.83,108.63,110.43\n7/29/10 12:00 AM,111.52,111.82,109.41,110.29,108.7,110.56\n7/30/10 12:00 AM,109.17,110.86,108.98,110.27,108.77,110.63\n8/2/10 12:00 AM,111.99,112.94,111.54,112.76,109.57,112.01\n8/3/10 12:00 AM,112.48,112.77,111.85,112.22,110.58,113.61\n8/4/10 12:00 AM,112.53,113.11,112.16,112.97,111.13,114.54\n8/5/10 12:00 AM,112.25,112.91,112.08,112.85,111.3,114.57\n8/6/10 12:00 AM,111.74,112.57,110.92,112.39,111.34,114.26\n8/9/10 12:00 AM,112.92,113.18,112.32,112.99,111.46,114.29\n8/10/10 12:00 AM,112.04,112.98,111.37,112.38,111.52,114.34\n8/11/10 12:00 AM,110.65,110.69,109.12,109.3,111.4,114.03\n8/12/10 12:00 AM,107.65,109.02,107.6,108.63,111.35,113.12\n8/13/10 12:00 AM,108.29,108.96,108.18,108.31,111.27,111.96\n8/16/10 12:00 AM,107.57,108.61,107.18,108.26,111.17,111.2\n8/17/10 12:00 AM,109.19,110.39,108.88,109.59,111.12,110.93\n8/18/10 12:00 AM,109.54,110.38,108.91,109.79,111.07,110.8\n8/19/10 12:00 AM,109.22,109.49,107.43,107.88,110.98,110.51\n8/20/10 12:00 AM,107.56,107.94,106.75,107.53,110.22,108.93\n8/23/10 12:00 AM,108.04,108.57,107.07,107.12,109.5,107.59\n8/24/10 12:00 AM,105.95,106.39,104.97,105.53,108.95,106.55\n8/25/10 12:00 AM,104.95,106.34,104.29,105.94,108.36,105.44\n8/26/10 12:00 AM,106.44,106.58,104.88,105.23,108.02,104.87\n8/27/10 12:00 AM,105.89,106.97,104.31,106.86,107.71,104.3\n8/30/10 12:00 AM,106.58,106.91,105.3,105.31,107.36,103.65\n8/31/10 12:00 AM,104.92,105.98,104.49,105.31,106.57,102.15\n9/1/10 12:00 AM,106.73,108.61,106.66,108.46,106.76,103.3\n9/2/10 12:00 AM,108.72,109.49,108.49,109.47,106.95,104.41\n9/3/10 12:00 AM,110.54,110.99,109.95,110.89,107.02,105.1\n9/7/10 12:00 AM,110.37,110.51,109.55,109.64,107.06,105.77\n9/8/10 12:00 AM,109.85,110.85,109.81,110.41,107.11,106.2\n9/9/10 12:00 AM,111.64,111.68,110.62,110.92,107.19,106.68\n9/10/10 12:00 AM,111.12,111.61,110.87,111.48,107.32,107.28\n9/13/10 12:00 AM,112.58,112.95,112.13,112.72,108.71,110.86\n9/14/10 12:00 AM,112.5,113.29,112.08,112.65,112.35,117.94\n9/15/10 12:00 AM,112.32,113.21,111.98,113.08,112.6,118.24\n9/16/10 12:00 AM,112.73,113.12,112.35,113.05,112.65,118.27\n9/17/10 12:00 AM,113.04,113.15,112.18,112.49,112.66,118.25\n9/20/10 12:00 AM,112.88,114.46,112.52,114.21,113.31,119.52\n9/21/10 12:00 AM,114.3,114.84,113.51,113.98,113.84,120.48\n9/22/10 12:00 AM,113.8,114.44,113.1,113.42,113.77,120.22\n9/23/10 12:00 AM,112.49,113.67,112.18,112.5,113.37,118.02\n9/24/10 12:00 AM,113.75,114.9,113.65,114.82,113.63,114.91\n9/27/10 12:00 AM,114.86,114.99,114.16,114.27,113.91,115.22\n9/28/10 12:00 AM,114.42,115.04,113.18,114.67,113.97,115.29\n9/29/10 12:00 AM,114.39,114.91,114.02,114.47,114.11,115.56\n9/30/10 12:00 AM,115.05,115.79,113.59,114.13,114.16,115\n10/1/10 12:00 AM,114.99,115.12,113.93,114.61,114.18,114.52\n10/4/10 12:00 AM,114.37,114.85,113.18,113.75,114.17,114.58\n10/5/10 12:00 AM,114.8,116.32,114.67,116.04,114.33,115.29\n10/6/10 12:00 AM,116.02,116.33,115.56,116.03,114.5,115.38\n10/7/10 12:00 AM,116.5,116.53,115.19,115.89,114.64,115.37\n10/8/10 12:00 AM,116.05,116.86,115.61,116.54,114.81,115.66\n10/11/10 12:00 AM,116.72,116.97,116.25,116.65,115.02,115.93\n10/12/10 12:00 AM,116.27,117.35,115.65,117.01,115.11,116.07\n10/13/10 12:00 AM,117.66,118.55,117.38,117.92,115.41,116.63\n10/14/10 12:00 AM,117.81,118.01,116.72,117.46,116.08,117.98\n10/15/10 12:00 AM,118.28,118.35,116.76,117.7,116.49,118.66\n10/18/10 12:00 AM,117.73,118.67,117.26,118.54,116.91,119.32\n10/19/10 12:00 AM,117.19,117.85,116.02,116.73,116.92,119.2\n10/20/10 12:00 AM,116.94,118.44,116.87,117.87,117.12,119.42\n10/21/10 12:00 AM,118.4,119.09,117.21,118.13,117.39,119.76\n10/22/10 12:00 AM,118.31,118.53,118,118.35,117.62,120.12\n10/25/10 12:00 AM,119.14,119.76,118.61,118.7,117.8,120.19\n10/26/10 12:00 AM,118.1,118.84,117.87,118.72,117.84,119.6\n10/27/10 12:00 AM,117.89,118.51,117.26,118.38,117.84,119.18\n10/28/10 12:00 AM,119.06,119.11,117.83,118.4,117.87,118.82\n10/29/10 12:00 AM,118.28,118.72,118.07,118.49,117.92,118.91\n11/1/10 12:00 AM,119.07,119.75,117.85,118.53,118.03,118.95\n11/2/10 12:00 AM,119.42,119.75,119.1,119.47,118.15,118.92\n11/3/10 12:00 AM,119.68,120.02,118.45,119.95,118.24,118.87\n11/4/10 12:00 AM,121.28,122.32,120.94,122.26,118.61,119.43\n11/5/10 12:00 AM,122.34,122.92,122.18,122.72,119.12,120.4\n11/8/10 12:00 AM,122.34,122.69,121.94,122.49,119.74,121.64\n11/9/10 12:00 AM,122.82,122.95,121.12,121.61,120.2,122.52\n11/10/10 12:00 AM,121.58,122.16,120.66,122.1,120.39,122.87\n11/11/10 12:00 AM,121.05,121.82,120.68,121.64,120.61,123.19\n11/12/10 12:00 AM,120.82,121.35,119.65,120.2,120.58,123.01\n11/15/10 12:00 AM,120.58,121.05,119.98,120.03,120.54,122.83\n11/16/10 12:00 AM,119.29,119.49,117.59,118.16,120.5,122.39\n11/17/10 12:00 AM,118.21,118.71,117.86,118.22,120.48,121.83\n11/18/10 12:00 AM,119.36,120.39,119.35,119.96,120.47,121.2\n11/19/10 12:00 AM,119.9,120.34,119.25,120.29,120.45,120.71\n11/22/10 12:00 AM,119.69,120.24,118.77,120.19,120.43,120.47\n11/23/10 12:00 AM,118.77,119.01,117.99,118.45,120.32,120.03\n11/24/10 12:00 AM,119.2,120.23,119.18,120.2,120.28,119.97\n11/26/10 12:00 AM,119.16,119.81,118.8,118.8,119.86,119.19\n11/29/10 12:00 AM,118.5,119.48,117.74,119.16,119.78,119.05\n11/30/10 12:00 AM,117.98,119.17,117.81,118.49,119.69,118.9\n12/1/10 12:00 AM,120.2,121.24,120.19,121.01,119.72,118.98\n12/2/10 12:00 AM,121.2,122.65,121.13,122.56,119.76,119.06\n12/3/10 12:00 AM,122.14,123.03,122.11,122.89,119.83,119.22\n12/6/10 12:00 AM,122.63,123.04,122.5,122.76,119.93,119.53\n12/7/10 12:00 AM,123.94,124.01,122.76,122.83,120.15,120.02\n12/8/10 12:00 AM,122.98,123.38,122.41,123.28,120.42,120.98\n12/9/10 12:00 AM,123.97,124.02,123.15,123.76,120.75,121.71\n12/10/10 12:00 AM,124.14,124.6,123.73,124.48,123.57,127.45\n12/13/10 12:00 AM,125.05,125.2,124.52,124.56,124.74,129.76\n12/14/10 12:00 AM,124.75,125.23,124.29,124.67,124.75,129.75\n12/15/10 12:00 AM,124.44,124.93,123.89,124.1,124.55,129.27\n12/16/10 12:00 AM,124.18,124.91,123.75,124.82,124.42,128.92\n12/17/10 12:00 AM,124.08,124.46,123.82,124.3,124.34,128.54\n12/20/10 12:00 AM,124.64,124.9,123.98,124.6,124.39,128.36\n12/21/10 12:00 AM,124.99,125.47,124.87,125.39,125,129.25\n12/22/10 12:00 AM,125.48,125.82,125.41,125.78,125.24,126.91\n12/23/10 12:00 AM,125.64,125.78,125.29,125.6,125.29,125.84\n12/27/10 12:00 AM,125.13,125.77,125.04,125.65,125.3,125.85\n12/28/10 12:00 AM,125.9,125.95,125.5,125.83,125.34,126.14\n12/29/10 12:00 AM,125.98,126.2,125.9,125.92,125.43,126.44\n12/30/10 12:00 AM,125.8,126.13,125.53,125.72,125.49,126.64\n12/31/10 12:00 AM,125.53,125.87,125.33,125.75,125.54,126.7\n1/3/11 12:00 AM,126.71,127.6,126.66,127.05,126.33,127.66\n1/4/11 12:00 AM,127.33,127.37,126.19,126.98,126.46,127.69\n1/5/11 12:00 AM,126.58,127.72,126.46,127.64,126.65,128.02\n1/6/11 12:00 AM,127.69,127.83,127.01,127.39,127.01,128.73\n1/7/11 12:00 AM,127.56,127.77,126.15,127.14,126.99,128.64\n1/10/11 12:00 AM,126.58,127.16,126.2,126.98,126.91,128.39\n1/11/11 12:00 AM,127.44,127.74,126.95,127.43,127.02,128.55\n1/12/11 12:00 AM,128.21,128.72,127.99,128.58,128.25,130.95\n1/13/11 12:00 AM,128.63,128.69,127.99,128.37,128.26,130.18\n1/14/11 12:00 AM,128.19,129.33,128.1,129.3,128.32,130.18\n1/18/11 12:00 AM,129.18,129.64,129.03,129.52,128.47,130.28\n1/19/11 12:00 AM,129.41,129.5,127.91,128.25,128.49,129.97\n1/20/11 12:00 AM,127.96,128.4,127.13,128.08,128.41,129.82\n1/21/11 12:00 AM,128.88,129.17,128.23,128.37,128.49,130.08\n1/24/11 12:00 AM,128.29,129.25,128.26,129.1,128.59,130.16\n1/25/11 12:00 AM,128.76,129.28,128.11,129.17,128.6,128.95\n1/26/11 12:00 AM,129.49,130.05,129.23,129.67,128.71,129.16\n1/27/11 12:00 AM,129.7,130.21,129.47,129.99,128.77,129.22\n1/28/11 12:00 AM,130.14,130.35,127.51,127.72,128.78,129.09\n1/31/11 12:00 AM,128.07,128.78,127.75,128.68,128.75,129.01\n2/1/11 12:00 AM,129.46,130.97,129.38,130.74,128.88,129.35\n2/2/11 12:00 AM,130.4,130.84,130.33,130.49,128.98,129.46\n2/3/11 12:00 AM,130.26,130.98,129.57,130.78,129.05,129.51\n2/4/11 12:00 AM,130.83,131.2,130.23,131.15,129.15,129.7\n2/7/11 12:00 AM,131.44,132.4,131.43,131.97,129.35,130\n2/8/11 12:00 AM,132.09,132.64,131.73,132.57,129.55,130.34\n2/9/11 12:00 AM,132.21,132.63,131.61,132.27,129.75,130.73\n2/10/11 12:00 AM,131.6,132.47,131.3,132.32,130.48,132.2\n2/11/11 12:00 AM,131.8,133.28,131.77,133.11,130.96,133.05\n2/14/11 12:00 AM,133.03,133.54,132.88,133.43,131.53,134.07\n2/15/11 12:00 AM,133.02,133.22,132.32,133.01,132.1,135.15\n2/16/11 12:00 AM,133.46,134.01,133.19,133.85,133.6,138.05\n2/17/11 12:00 AM,133.46,134.43,133.34,134.25,133.71,138.06\n2/18/11 12:00 AM,134.37,134.69,134.06,134.53,133.92,138.29\n2/22/11 12:00 AM,133.12,133.86,131.47,131.83,133.53,137.31\n2/23/11 12:00 AM,131.75,132.07,130.21,131.02,133.34,136.19\n2/24/11 12:00 AM,130.88,131.44,129.7,130.93,133.25,135.55\n2/25/11 12:00 AM,131.48,132.41,131.4,132.33,133.22,134.92\n2/28/11 12:00 AM,132.82,133.32,132.38,133.15,133.21,134.32\n3/1/11 12:00 AM,133.57,133.69,130.89,130.93,133.16,132.71\n3/2/11 12:00 AM,130.75,131.82,130.35,131.21,133.07,132.44\n3/3/11 12:00 AM,132.4,133.62,132.39,133.47,133.07,132.22\n3/4/11 12:00 AM,133.37,133.63,131.6,132.47,133.04,132.54\n3/7/11 12:00 AM,132.86,133.16,130.74,131.43,133,132.67\n3/8/11 12:00 AM,131.64,133,131.07,132.58,132.97,132.69\n3/9/11 12:00 AM,132.32,132.8,131.6,132.39,132.95,132.67\n3/10/11 12:00 AM,131,131.18,129.81,129.94,132.89,132.58\n3/11/11 12:00 AM,129.52,131.31,129.49,130.84,132.83,132.51\n3/14/11 12:00 AM,129.99,130.48,129.06,130.05,132.74,132.41\n3/15/11 12:00 AM,126.59,129.33,126.5,128.56,132.46,131.85\n3/16/11 12:00 AM,128.15,128.57,125.28,126.18,131.9,130.76\n3/17/11 12:00 AM,128,128.39,127.1,127.85,131.44,129.87\n3/18/11 12:00 AM,128.84,128.88,127.51,127.76,130.84,128.71\n3/21/11 12:00 AM,129.35,130.01,129.2,129.74,130.24,127.53\n3/22/11 12:00 AM,129.72,129.89,129.17,129.29,130,127.11\n3/23/11 12:00 AM,128.93,130,128.32,129.66,129.6,126.37\n3/24/11 12:00 AM,130.4,131.09,129.67,130.9,129.78,126.83\n3/25/11 12:00 AM,131.24,131.87,130.89,131.3,129.84,127.23\n3/28/11 12:00 AM,131.58,131.92,130.94,130.98,129.91,127.92\n3/29/11 12:00 AM,130.87,131.9,130.44,131.86,129.97,128.51\n3/30/11 12:00 AM,132.55,133.16,132.36,132.77,130.11,129.39\n3/31/11 12:00 AM,132.6,132.96,132.45,132.59,130.42,130.6\n4/1/11 12:00 AM,133.41,133.77,132.83,133.15,130.81,131.62\n4/4/11 12:00 AM,133.43,133.67,132.88,133.26,132.16,134.71\n4/5/11 12:00 AM,133,133.83,132.94,133.24,132.91,136.04\n4/6/11 12:00 AM,133.88,134,133.12,133.66,133.15,136.45\n4/7/11 12:00 AM,133.42,133.98,132.66,133.32,133.2,136.48\n4/8/11 12:00 AM,133.91,133.99,132.31,132.86,133.15,136.33\n4/11/11 12:00 AM,133,133.45,132.14,132.46,133.03,135.95\n4/12/11 12:00 AM,131.72,131.98,130.99,131.47,132.85,135.28\n4/13/11 12:00 AM,132.08,132.18,130.96,131.46,132.76,134.71\n4/14/11 12:00 AM,130.7,131.76,130.27,131.56,132.73,133.3\n4/15/11 12:00 AM,131.8,132.37,131.41,132.04,132.72,132.52\n4/18/11 12:00 AM,130.59,130.81,129.51,130.56,132.66,132.18\n4/19/11 12:00 AM,130.76,131.35,130.44,131.31,132.63,132.06\n4/20/11 12:00 AM,132.88,133.39,132.79,133.1,132.73,132.31\n4/21/11 12:00 AM,133.79,133.84,133.35,133.78,132.83,132.63\n4/25/11 12:00 AM,133.68,133.86,133.2,133.64,132.86,132.87\n4/26/11 12:00 AM,134.05,135.06,133.91,134.79,132.95,133.13\n4/27/11 12:00 AM,135.05,135.87,134.5,135.67,133.05,133.38\n4/28/11 12:00 AM,135.43,136.29,135.41,136.11,133.2,133.69\n4/29/11 12:00 AM,136.17,136.57,135.98,136.43,133.41,134.16\n5/2/11 12:00 AM,137.07,137.18,135.95,136.22,134.61,136.6\n5/3/11 12:00 AM,135.96,136.19,135.04,135.73,135.42,138.12\n5/4/11 12:00 AM,135.67,135.73,134.23,134.83,135.16,137.49\n5/5/11 12:00 AM,134.08,134.95,133.02,133.61,134.57,136.29\n5/6/11 12:00 AM,134.94,135.63,133.68,134.2,134.59,136.23\n5/9/11 12:00 AM,134.19,135.11,133.98,134.72,134.58,136.12\n5/10/11 12:00 AM,135.16,136.11,135,135.87,134.68,136.15\n5/11/11 12:00 AM,135.66,135.69,133.82,134.44,134.68,135.95\n5/12/11 12:00 AM,134.09,135.36,133.39,135.08,134.67,134.73\n5/13/11 12:00 AM,135.15,135.34,133.56,134.04,134.67,133.91\n5/16/11 12:00 AM,133.56,134.61,132.97,133.19,134.64,134.12\n5/17/11 12:00 AM,132.69,133.35,132.12,133.17,134.56,134.54\n5/18/11 12:00 AM,133.24,134.5,132.95,134.36,134.52,134.46\n5/19/11 12:00 AM,134.8,135.03,133.94,134.68,134.52,134.46\n5/20/11 12:00 AM,134.33,134.68,133.36,133.61,134.49,134.31\n5/23/11 12:00 AM,131.98,132.46,131.59,132.06,134.25,133.82\n5/24/11 12:00 AM,132.44,132.73,131.7,131.95,134.11,133.56\n5/25/11 12:00 AM,131.42,132.94,131.38,132.39,133.93,133.19\n5/26/11 12:00 AM,132.03,133.24,131.78,133,133.8,132.96\n5/27/11 12:00 AM,133.37,133.87,132.96,133.51,133.78,133.01\n5/31/11 12:00 AM,134.76,134.92,133.84,134.9,133.81,133.09\n6/1/11 12:00 AM,134.51,134.6,131.76,131.87,133.78,133.04\n6/2/11 12:00 AM,131.96,132.24,130.96,131.73,133.68,132.87\n6/3/11 12:00 AM,130.15,131.42,130.08,130.42,133.57,132.88\n6/6/11 12:00 AM,130.09,130.36,128.87,129.04,133.31,132.51\n6/7/11 12:00 AM,129.7,130.07,128.85,128.96,133.12,132.32\n6/8/11 12:00 AM,128.76,129.19,128.18,128.42,132.84,131.89\n6/9/11 12:00 AM,128.77,129.93,128.46,129.4,132.61,131.44\n6/10/11 12:00 AM,128.84,128.93,127.26,127.6,132.16,130.51\n6/13/11 12:00 AM,127.89,128.24,127.05,127.7,129.89,126.01\n6/14/11 12:00 AM,128.87,129.77,128.82,129.32,129.48,125.29\n6/15/11 12:00 AM,128.25,128.65,126.68,127.02,128.03,122.49\n6/16/11 12:00 AM,127.09,127.97,126.32,127.3,127.66,122\n6/17/11 12:00 AM,127.93,127.94,126.62,127.05,127.48,121.85\n6/20/11 12:00 AM,126.62,127.97,126.58,127.7,127.42,122\n6/21/11 12:00 AM,128.36,129.7,127.75,129.45,127.85,123.08\n6/22/11 12:00 AM,129.05,129.81,128.59,128.67,128.07,123.99\n6/23/11 12:00 AM,127.16,128.64,126.19,128.3,128.02,126.15\n6/24/11 12:00 AM,128.27,128.37,126.62,126.81,127.99,126.49\n6/27/11 12:00 AM,126.9,128.43,126.64,127.94,127.98,127.93\n6/28/11 12:00 AM,128.45,129.63,128.27,129.61,127.99,128.32\n6/29/11 12:00 AM,130.18,130.93,129.63,130.72,128.04,128.6\n6/30/11 12:00 AM,131.14,132.18,130.71,131.97,128.19,128.96\n7/1/11 12:00 AM,132.01,134.1,131.78,133.92,128.62,129.4\n7/5/11 12:00 AM,133.78,134.08,133.39,133.81,129.07,130.08\n7/6/11 12:00 AM,133.48,134.14,133.11,133.97,129.56,131.1\n7/7/11 12:00 AM,135.16,135.7,134.88,135.36,130.41,132.83\n7/8/11 12:00 AM,133.83,134.44,133.39,134.4,131.7,135.43\n7/11/11 12:00 AM,132.75,133.18,131.66,131.97,132.34,136.68\n7/12/11 12:00 AM,131.69,132.78,131.36,131.4,132.11,136.17\n7/13/11 12:00 AM,132.09,133.22,131.52,131.84,132.26,136.33\n7/14/11 12:00 AM,132.17,132.78,130.68,130.93,132.19,135.76\n7/15/11 12:00 AM,131.66,131.87,130.77,131.69,132.08,135.08\n7/18/11 12:00 AM,131.08,131.28,129.63,130.61,131.97,134.37\n7/19/11 12:00 AM,131.34,132.89,131.31,132.73,131.97,133.54\n7/20/11 12:00 AM,133.07,133.15,132.42,132.65,132.03,132.36\n7/21/11 12:00 AM,133.4,134.82,132.67,134.49,132.06,131.79\n7/22/11 12:00 AM,134.52,134.72,133.76,134.58,132.13,132.16\n7/25/11 12:00 AM,133.3,134.49,133.16,133.83,132.22,132.17\n7/26/11 12:00 AM,133.74,133.96,133.03,133.33,132.26,132.32\n7/27/11 12:00 AM,132.59,132.63,130.43,130.6,132.23,132.39\n7/28/11 12:00 AM,130.6,131.77,130.01,130.22,132.21,132.45\n7/29/11 12:00 AM,128.91,130.55,128.36,129.33,132.14,132.3\n8/1/11 12:00 AM,130.84,130.96,127.53,128.78,131.93,131.84\n8/2/11 12:00 AM,127.81,128.5,125.49,125.49,131.66,131.26\n8/3/11 12:00 AM,125.66,126.31,123.53,126.17,131.03,129.94\n8/4/11 12:00 AM,124.42,124.62,120.06,120.26,129.46,126.7\n8/5/11 12:00 AM,121.76,122.07,116.86,120.08,125.87,119.49\n8/8/11 12:00 AM,116.91,118.38,112.02,112.26,119.99,107.74\n8/9/11 12:00 AM,114.07,117.64,110.27,117.48,115.3,98.39\n8/10/11 12:00 AM,115.26,116.28,111.95,112.29,114.69,97.25\n8/11/11 12:00 AM,113.26,118.92,112.32,117.33,115.41,98.88\n8/12/11 12:00 AM,118.4,119.21,117.28,118.12,117.69,103.72\n8/15/11 12:00 AM,119.19,120.74,119,120.62,119.32,107.6\n8/16/11 12:00 AM,119.47,120.69,118.31,119.59,119.42,109.39\n8/17/11 12:00 AM,120.25,121.2,118.72,119.67,119.59,113.31\n8/18/11 12:00 AM,116.5,116.64,113.39,114.51,119.16,118.33\n8/19/11 12:00 AM,112.96,115.88,112.5,112.64,118.73,122.16\n8/22/11 12:00 AM,115.17,115.23,112.41,112.73,118.27,121.85\n8/23/11 12:00 AM,113.15,116.57,112.58,116.44,118,120.59\n8/24/11 12:00 AM,116.19,118.24,115.92,118.08,117.95,118.21\n8/25/11 12:00 AM,118.73,119.4,115.87,116.28,117.94,116.55\n8/26/11 12:00 AM,115.69,118.51,113.85,117.97,117.89,116.36\n8/29/11 12:00 AM,119.56,121.43,119.48,121.36,117.95,116.3\n8/30/11 12:00 AM,120.83,122.43,119.94,121.68,118.03,116.91\n8/31/11 12:00 AM,122.46,123.51,121.3,122.22,118.14,117.54\n9/1/11 12:00 AM,122.29,123.4,120.78,120.94,118.23,118.18\n9/2/11 12:00 AM,118.42,119.08,117.43,117.85,118.23,118.45\n9/6/11 12:00 AM,114.39,117.16,114.38,116.99,118.14,118.34\n9/7/11 12:00 AM,118.76,120.34,118.36,120.29,118.18,118.43\n9/8/11 12:00 AM,119.57,120.94,118.77,119.04,118.25,118.61\n9/9/11 12:00 AM,117.68,118.1,115.28,115.92,118.19,118.44\n9/12/11 12:00 AM,114.47,116.76,114.05,116.67,118.13,118.22\n9/13/11 12:00 AM,117.05,118.18,116.22,117.74,118.11,118.08\n9/14/11 12:00 AM,118.33,120.8,116.72,119.37,118.14,118.05\n9/15/11 12:00 AM,120.64,121.47,119.4,121.43,118.19,118.15\n9/16/11 12:00 AM,121.3,121.97,120.32,121.52,118.24,118.35\n9/19/11 12:00 AM,119.53,120.93,118.72,120.31,118.27,118.36\n9/20/11 12:00 AM,120.82,121.99,120.01,120.17,118.33,118.4\n9/21/11 12:00 AM,120.23,120.6,116.44,116.63,118.33,118.47\n9/22/11 12:00 AM,113.25,114.21,111.3,112.86,118.13,118.14\n9/23/11 12:00 AM,112.11,114.16,112.02,113.54,117.95,117.8\n9/26/11 12:00 AM,114.61,116.4,112.98,116.24,117.83,117.53\n9/27/11 12:00 AM,118.53,119.56,116.84,117.54,117.84,117.5\n9/28/11 12:00 AM,117.78,118.49,114.97,115.14,117.82,117.39\n9/29/11 12:00 AM,117.05,117.63,113.93,116.05,117.77,117.26\n9/30/11 12:00 AM,114.45,115.45,113.07,113.15,117.62,116.91\n10/3/11 12:00 AM,112.49,113.95,109.81,109.93,117.14,115.94\n10/4/11 12:00 AM,108.35,112.58,107.43,112.34,116.77,115.42\n10/5/11 12:00 AM,112.62,114.72,111.58,114.42,116.59,115.23\n10/6/11 12:00 AM,114.36,116.66,113.51,116.49,116.51,115.2\n10/7/11 12:00 AM,117.17,117.25,115.06,115.71,116.49,115.13\n10/10/11 12:00 AM,117.68,119.63,117.67,119.58,116.6,115.38\n10/11/11 12:00 AM,118.87,120.04,118.75,119.7,116.72,115.68\n10/12/11 12:00 AM,120.6,122.14,120.33,120.75,116.9,116.17\n10/13/11 12:00 AM,120.04,120.87,119.12,120.51,117,116.87\n10/14/11 12:00 AM,121.91,122.6,121.23,122.57,117.3,117.82\n10/17/11 12:00 AM,121.99,122.55,119.93,120.23,117.72,118.86\n10/18/11 12:00 AM,120.14,123.5,119.2,122.58,118.43,120.34\n10/19/11 12:00 AM,122.38,123.08,120.71,121.13,120.92,125.35\n10/20/11 12:00 AM,121.43,122.1,119.82,121.66,120.95,125.3\n10/21/11 12:00 AM,123.09,124.12,122.72,123.97,122.68,128.64\n10/24/11 12:00 AM,124.17,125.8,124.06,125.49,123.5,130.1\n10/25/11 12:00 AM,124.89,124.95,122.78,123.05,123.64,130.27\n10/26/11 12:00 AM,124.35,124.77,122.21,124.3,123.6,129.9\n10/27/11 12:00 AM,127.63,129.42,126.61,128.53,124.82,131.92\n10/28/11 12:00 AM,128,128.85,127.8,128.6,125.59,132.76\n10/31/11 12:00 AM,127.16,127.26,125.32,125.5,125.71,130.49\n11/1/11 12:00 AM,122.03,123.51,121.52,122,124.68,128.4\n11/2/11 12:00 AM,123.83,124.4,122.79,123.99,124.43,126.19\n11/3/11 12:00 AM,125.27,126.5,123.6,126.25,124.49,125.49\n11/4/11 12:00 AM,125.23,125.7,124.01,125.48,124.53,125.42\n11/7/11 12:00 AM,125.39,126.39,124.2,126.26,124.6,125.61\n11/8/11 12:00 AM,126.92,128.02,125.71,127.88,124.67,124.51\n11/9/11 12:00 AM,124.89,125.47,122.86,123.16,124.65,123.71\n11/10/11 12:00 AM,124.79,124.94,123.02,124.32,124.63,123.55\n11/11/11 12:00 AM,125.83,126.99,125.79,126.66,124.69,124.7\n11/14/11 12:00 AM,126.19,126.36,124.92,125.46,124.72,125.01\n11/15/11 12:00 AM,125.17,126.75,124.72,126.08,124.76,125.02\n11/16/11 12:00 AM,124.81,126.34,123.9,124.08,124.77,125.02\n11/17/11 12:00 AM,123.85,124.16,121.23,122.11,124.73,124.85\n11/18/11 12:00 AM,122.5,122.75,121.47,121.98,124.66,124.65\n11/21/11 12:00 AM,120.2,120.35,118.65,119.66,124.41,124.18\n11/22/11 12:00 AM,119.4,120.1,118.52,119.19,124.16,123.7\n11/23/11 12:00 AM,118.07,118.21,116.56,116.56,123.22,121.75\n11/25/11 12:00 AM,116.38,117.71,116.2,116.34,122.27,119.82\n11/28/11 12:00 AM,119.54,120.18,118.82,119.71,121.77,118.78\n11/29/11 12:00 AM,120.05,121,119.61,120.05,121.04,117.3\n11/30/11 12:00 AM,123.49,125.22,123.22,124.99,121.5,118.27\n12/1/11 12:00 AM,124.85,125.64,124.43,124.97,121.86,119.07\n12/2/11 12:00 AM,126.12,126.5,124.78,124.86,121.96,119.51\n12/5/11 12:00 AM,126.84,127.18,125.44,126.22,122.06,119.96\n12/6/11 12:00 AM,126.21,127.11,125.76,126.26,122.12,121.02\n12/7/11 12:00 AM,125.84,127.26,124.97,126.73,122.23,122.19\n12/8/11 12:00 AM,125.9,126.18,123.65,123.95,122.34,122.91\n12/9/11 12:00 AM,124.51,126.37,124.4,126.05,124.11,127.19\n12/12/11 12:00 AM,124.95,124.97,123.16,124.21,124.1,126.7\n12/13/11 12:00 AM,124.86,125.57,122.45,123.05,124.08,126.3\n12/14/11 12:00 AM,122.56,123.03,121.47,121.74,123.93,125.9\n12/15/11 12:00 AM,123.03,123.2,121.99,122.18,123.84,125.63\n12/16/11 12:00 AM,122.23,122.95,121.3,121.59,123.74,125.37\n12/19/11 12:00 AM,122.06,122.32,120.03,120.29,123.68,125.13\n12/20/11 12:00 AM,122.18,124.14,122.17,123.93,123.67,125\n12/21/11 12:00 AM,123.93,124.36,122.75,124.17,123.65,123.19\n12/22/11 12:00 AM,124.63,125.4,124.23,125.27,123.83,123.55\n12/23/11 12:00 AM,125.67,126.43,125.41,126.39,123.94,123.8\n12/27/11 12:00 AM,126.17,126.82,126.06,126.49,124,124.08\n12/28/11 12:00 AM,126.51,126.53,124.73,124.83,124.04,124.24\n12/29/11 12:00 AM,125.24,126.25,125.18,126.12,124.08,124.42\n12/30/11 12:00 AM,126.02,126.33,125.5,125.5,124.16,124.63\n1/3/12 12:00 AM,127.76,128.38,127.43,127.5,124.5,125.33\n1/4/12 12:00 AM,127.2,127.81,126.71,127.7,125.53,127.4\n1/5/12 12:00 AM,127.01,128.23,126.43,128.04,126.48,129.14\n1/6/12 12:00 AM,128.2,128.22,127.29,127.71,126.85,129.77\n1/9/12 12:00 AM,128,128.18,127.41,128.02,127.07,130.13\n1/10/12 12:00 AM,129.39,129.65,128.95,129.13,127.85,131.66\n1/11/12 12:00 AM,128.73,129.37,128.52,129.2,128.32,132.55\n1/12/12 12:00 AM,129.57,129.7,128.54,129.51,128.89,133.63\n1/13/12 12:00 AM,128.64,129.05,127.72,128.84,128.79,133.09\n1/17/12 12:00 AM,130.08,130.32,129.06,129.34,128.94,132.34\n1/18/12 12:00 AM,129.31,130.84,129.08,130.77,129.28,132.08\n1/19/12 12:00 AM,131.22,131.57,130.8,131.46,130.07,133.29\n1/20/12 12:00 AM,131.24,131.95,130.92,131.54,130.83,134.6\n1/23/12 12:00 AM,131.51,132.25,130.98,131.61,130.99,134.13\n1/24/12 12:00 AM,130.8,131.5,130.6,131.46,131,133.69\n1/25/12 12:00 AM,131.26,132.87,130.75,132.56,131.14,133.39\n1/26/12 12:00 AM,133.15,133.4,131.36,131.88,131.83,134.87\n1/27/12 12:00 AM,131.24,132.05,131.15,131.82,131.75,134.57\n1/30/12 12:00 AM,130.51,131.44,130.06,131.37,131.3,133.32\n1/31/12 12:00 AM,132.02,132.18,130.68,131.32,131.33,132.59\n2/1/12 12:00 AM,132.29,133.14,132.13,132.47,131.52,132.21\n2/2/12 12:00 AM,132.73,133.02,132.21,132.68,131.65,132.31\n2/3/12 12:00 AM,134,134.62,133.77,134.54,132.06,133.11\n2/6/12 12:00 AM,133.98,134.51,133.83,134.45,132.28,133.42\n2/7/12 12:00 AM,134.17,135.02,133.64,134.79,132.38,132.94\n2/8/12 12:00 AM,134.86,135.22,134.31,135.19,132.52,133.28\n2/9/12 12:00 AM,135.41,135.59,134.56,135.36,132.7,134.09\n2/10/12 12:00 AM,134.16,134.47,133.84,134.36,133.07,134.8\n2/13/12 12:00 AM,135.32,135.52,134.74,135.36,133.63,135.74\n2/14/12 12:00 AM,135,135.27,134.25,135.19,134.76,137.87\n2/15/12 12:00 AM,135.63,135.83,134.29,134.56,134.87,137.67\n2/16/12 12:00 AM,134.57,136.17,134.33,136.05,135.01,137.74\n2/17/12 12:00 AM,136.52,136.63,135.96,136.41,135.44,138.49\n2/21/12 12:00 AM,136.73,137.05,136.05,136.47,135.77,139.03\n2/22/12 12:00 AM,136.26,136.55,135.79,136.03,135.85,139.01\n2/23/12 12:00 AM,135.96,136.73,135.5,136.63,135.91,138.75\n2/24/12 12:00 AM,136.93,137.2,136.63,136.93,136.11,138.6\n2/27/12 12:00 AM,136.02,137.53,135.8,137.16,136.2,137.63\n2/28/12 12:00 AM,137.2,137.72,136.93,137.56,136.34,137.81\n2/29/12 12:00 AM,137.76,138.19,136.54,137.02,136.75,138.49\n3/1/12 12:00 AM,137.31,137.99,137.12,137.73,136.92,138.41\n3/2/12 12:00 AM,137.64,137.82,137,137.31,136.99,138.2\n3/5/12 12:00 AM,137.1,137.2,136.28,136.75,136.96,138.06\n3/6/12 12:00 AM,135.35,135.43,134.36,134.75,136.89,137.87\n3/7/12 12:00 AM,135.06,135.91,134.93,135.69,136.85,137.59\n3/8/12 12:00 AM,136.52,137.32,136.24,137.04,136.85,137.5\n3/9/12 12:00 AM,137.3,137.93,137.13,137.57,136.86,137.38\n3/12/12 12:00 AM,137.55,137.76,137.09,137.58,136.88,137.01\n3/13/12 12:00 AM,138.32,140.13,138.09,140.06,137.06,137.19\n3/14/12 12:00 AM,140.1,140.45,139.48,139.91,137.31,137.64\n3/15/12 12:00 AM,140.12,140.78,139.76,140.72,137.6,138.25\n3/16/12 12:00 AM,140.36,140.48,140,140.3,137.78,138.66\n3/19/12 12:00 AM,140.21,141.28,140.11,140.85,138.34,139.82\n3/20/12 12:00 AM,140.05,140.61,139.64,140.44,139.01,141.17\n3/21/12 12:00 AM,140.52,140.65,139.92,140.21,139.49,142.12\n3/22/12 12:00 AM,139.18,139.55,138.74,139.2,139.15,141.41\n3/23/12 12:00 AM,139.32,139.81,138.55,139.65,139.15,141.25\n3/26/12 12:00 AM,140.65,141.61,140.6,141.61,139.57,141.83\n3/27/12 12:00 AM,141.74,141.83,141.08,141.17,139.9,142.2\n3/28/12 12:00 AM,141.1,141.32,139.64,140.47,139.99,142.21\n3/29/12 12:00 AM,139.64,140.49,139.09,140.23,139.98,141.62\n3/30/12 12:00 AM,140.92,141.05,140.05,140.81,140.01,141\n4/2/12 12:00 AM,140.64,142.21,140.36,141.84,140.08,140.67\n4/3/12 12:00 AM,141.64,141.88,140.43,141.26,140.12,141.09\n4/4/12 12:00 AM,140.22,140.34,139.34,139.86,140.11,141.06\n4/5/12 12:00 AM,139.38,140.2,139.26,139.79,140.09,140.62\n4/9/12 12:00 AM,138.03,138.78,137.84,138.22,140.05,140.2\n4/10/12 12:00 AM,137.95,138.34,135.76,135.9,139.85,139.72\n4/11/12 12:00 AM,137.29,137.54,136.75,137,139.68,139.38\n4/12/12 12:00 AM,137.13,138.9,137.03,138.79,139.57,139.13\n4/13/12 12:00 AM,138.47,138.82,137.01,137.14,139.46,138.84\n4/16/12 12:00 AM,137.84,138.04,136.58,137.05,139.04,137.96\n4/17/12 12:00 AM,137.84,139.36,137.7,139.08,138.86,137.62\n4/18/12 12:00 AM,138.46,139.08,138.38,138.61,138.76,137.43\n4/19/12 12:00 AM,138.63,139.15,137.07,137.72,138.6,137.15\n4/20/12 12:00 AM,138.33,138.83,137.87,137.95,138.58,137.3\n4/23/12 12:00 AM,136.54,136.91,135.94,136.79,138.45,137.22\n4/24/12 12:00 AM,136.91,137.66,136.8,137.31,138.38,137.19\n4/25/12 12:00 AM,138.65,139.25,138.53,139.19,138.4,137.35\n4/26/12 12:00 AM,138.89,140.32,138.81,140.16,138.42,137.8\n4/27/12 12:00 AM,140.58,140.79,139.8,140.39,138.45,138.04\n4/30/12 12:00 AM,140.11,140.21,139.49,139.87,138.49,138.23\n5/1/12 12:00 AM,139.79,141.66,139.63,140.74,138.6,138.6\n5/2/12 12:00 AM,139.92,140.46,139.46,140.32,138.7,138.82\n5/3/12 12:00 AM,140.34,140.45,138.99,139.25,138.78,139.12\n5/4/12 12:00 AM,138.51,138.66,136.92,137,138.69,139\n5/7/12 12:00 AM,136.51,137.56,136.46,137.1,138.58,138.76\n5/8/12 12:00 AM,136.28,136.77,134.92,136.55,138.48,138.54\n5/9/12 12:00 AM,135.1,136.61,134.49,135.74,138.39,138.32\n5/10/12 12:00 AM,136.68,136.85,135.71,136.02,138.32,138.14\n5/11/12 12:00 AM,135.17,136.87,135.11,135.61,138.23,137.86\n5/14/12 12:00 AM,134.31,135.61,133.91,134.11,138.06,137.43\n5/15/12 12:00 AM,134.02,134.81,133.13,133.34,136.96,135.13\n5/16/12 12:00 AM,133.94,134.55,132.8,132.83,134.89,131.09\n5/17/12 12:00 AM,132.86,133.02,130.79,130.86,132.56,126.53\n5/18/12 12:00 AM,131.37,131.6,129.55,129.74,131.82,125.16\n5/21/12 12:00 AM,130.16,132.02,129.95,131.97,131.57,124.75\n5/22/12 12:00 AM,132.31,133.23,131.34,132.2,131.78,125.25\n5/23/12 12:00 AM,131.25,132.46,129.99,132.27,131.49,124.76\n5/24/12 12:00 AM,132.63,132.84,131.42,132.53,131.87,125.68\n5/25/12 12:00 AM,132.48,132.85,131.78,132.1,132.04,127.12\n5/29/12 12:00 AM,133.16,133.93,132.75,133.7,132.58,130.27\n5/30/12 12:00 AM,132.56,132.62,131.49,131.76,132.53,132.51\n5/31/12 12:00 AM,131.71,132.45,130.34,131.47,132.47,133.12\n6/1/12 12:00 AM,129.41,129.86,128.16,128.16,132.24,132.91\n6/4/12 12:00 AM,128.39,128.74,127.14,128.1,131.87,131.96\n6/5/12 12:00 AM,127.85,129.26,127.78,129.07,131.66,131.83\n6/6/12 12:00 AM,129.97,132.03,129.93,131.97,131.63,131.39\n6/7/12 12:00 AM,133.47,133.53,131.78,132.05,131.67,131.31\n6/8/12 12:00 AM,131.71,133.13,131.29,133.1,131.7,130.82\n6/11/12 12:00 AM,134.17,134.25,131.28,131.41,131.74,130.95\n6/12/12 12:00 AM,131.79,133.01,131.16,132.92,131.76,131.05\n6/13/12 12:00 AM,132.53,133.36,131.62,132.07,131.78,131.31\n6/14/12 12:00 AM,132.34,134,131.98,133.47,131.79,131.72\n6/15/12 12:00 AM,133.38,134.26,133.1,134.14,131.89,132.12\n6/18/12 12:00 AM,133.58,134.73,133.28,134.4,132.16,132.69\n6/19/12 12:00 AM,135.08,136.25,134.37,135.7,132.7,133.73\n6/20/12 12:00 AM,135.71,136.1,134.27,135.48,133.24,134.77\n6/21/12 12:00 AM,135.64,135.78,132.33,132.44,133.35,134.97\n6/22/12 12:00 AM,133.13,133.71,132.62,133.46,133.32,134.88\n6/25/12 12:00 AM,132.05,132.1,130.85,131.32,133.09,134.41\n6/26/12 12:00 AM,131.7,132.38,130.93,131.98,132.94,134.09\n6/27/12 12:00 AM,132.42,133.43,131.97,133.17,132.93,133.96\n6/28/12 12:00 AM,132.29,132.99,131.28,132.79,132.9,133.64\n6/29/12 12:00 AM,135.2,136.27,134.85,136.1,132.93,133.16\n7/2/12 12:00 AM,136.48,136.65,135.52,136.51,132.98,132.73\n7/3/12 12:00 AM,136.48,137.51,136.34,137.37,133.07,132.79\n7/5/12 12:00 AM,136.9,137.4,136.29,136.79,133.19,133.05\n7/6/12 12:00 AM,135.47,135.77,134.85,135.49,133.23,133.36\n7/9/12 12:00 AM,135.38,135.57,134.7,135.32,133.28,133.61\n7/10/12 12:00 AM,136.01,136.23,133.68,134.14,133.32,133.71\n7/11/12 12:00 AM,134.21,134.6,133.38,134.16,133.38,133.86\n7/12/12 12:00 AM,133.38,134.23,132.6,133.51,133.38,133.83\n7/13/12 12:00 AM,133.86,135.89,133.84,135.75,133.45,133.91\n7/16/12 12:00 AM,135.44,135.83,134.9,135.43,133.5,133.92\n7/17/12 12:00 AM,135.97,136.64,134.55,136.36,133.59,133.99\n7/18/12 12:00 AM,136.04,137.64,135.96,137.37,133.67,134.11\n7/19/12 12:00 AM,137.65,138.18,137.21,137.73,133.79,134.29\n7/20/12 12:00 AM,136.95,137.16,136.32,136.47,133.87,134.42\n7/23/12 12:00 AM,134.47,135.46,133.84,135.09,133.89,134.4\n7/24/12 12:00 AM,135.19,135.25,133.03,133.93,133.89,134.41\n7/25/12 12:00 AM,134.21,134.56,133.25,133.96,133.89,134.34\n7/26/12 12:00 AM,135.89,136.46,135.26,136.17,133.94,134.37\n7/27/12 12:00 AM,136.89,139.07,136.14,138.68,134.13,134.67\n7/30/12 12:00 AM,138.52,139.34,138.27,138.68,134.28,134.88\n7/31/12 12:00 AM,138.49,138.87,137.71,137.71,134.37,134.95\n8/1/12 12:00 AM,138.7,138.73,137.4,137.59,134.46,135.04\n8/2/12 12:00 AM,136.55,137.57,135.58,136.64,134.5,135.12\n8/3/12 12:00 AM,138.56,139.64,138.49,139.35,134.62,135.34\n8/6/12 12:00 AM,139.72,140.17,139.56,139.62,135.16,136.42\n8/7/12 12:00 AM,140.18,140.92,140.03,140.32,135.96,137.98\n8/8/12 12:00 AM,139.85,140.65,139.81,140.49,136.34,138.54\n8/9/12 12:00 AM,140.29,140.89,140.15,140.61,136.65,139.02\n8/10/12 12:00 AM,140.04,140.89,139.81,140.84,136.93,139.49\n8/13/12 12:00 AM,140.6,140.84,140.04,140.77,137.19,139.93\n8/14/12 12:00 AM,141.29,141.38,140.37,140.79,139.13,143.75\n8/15/12 12:00 AM,140.64,141.19,140.55,140.95,140.76,146.9\n8/16/12 12:00 AM,141.15,142.16,140.8,141.99,141.27,147.39\n8/17/12 12:00 AM,142.23,142.3,141.86,142.18,141.57,147.17\n8/20/12 12:00 AM,141.98,142.22,141.59,142.19,141.69,147.04\n8/21/12 12:00 AM,142.54,143.09,141.45,141.76,141.92,147.19\n8/22/12 12:00 AM,141.4,142.05,141.07,141.82,141.75,146.57\n8/23/12 12:00 AM,141.47,141.48,140.44,140.66,141.26,145.32\n8/24/12 12:00 AM,140.31,141.83,140.22,141.51,141.2,143.28\n8/27/12 12:00 AM,141.89,142.08,141.34,141.54,141.28,141.8\n8/28/12 12:00 AM,141.18,141.84,140.97,141.4,141.29,141.3\n8/29/12 12:00 AM,141.52,141.89,141.12,141.51,141.29,141.02\n8/30/12 12:00 AM,140.9,140.94,140.19,140.49,141.27,140.85\n8/31/12 12:00 AM,141.29,141.82,140.36,141.16,141.26,140.6\n9/4/12 12:00 AM,141.04,141.46,140.13,141.03,141.24,140.73\n9/5/12 12:00 AM,141.09,141.47,140.63,140.91,141.23,141.21\n9/6/12 12:00 AM,141.76,143.78,141.75,143.77,141.26,141.33\n9/7/12 12:00 AM,144.01,144.39,143.88,144.33,141.36,141.44\n9/10/12 12:00 AM,144.19,144.44,143.46,143.51,141.45,141.61\n9/11/12 12:00 AM,143.6,144.37,143.56,143.91,141.53,141.77\n9/12/12 12:00 AM,144.39,144.55,143.9,144.39,141.63,141.98\n9/13/12 12:00 AM,144.37,147.04,143.99,146.59,142.41,143.56\n9/14/12 12:00 AM,146.88,148.11,146.76,147.24,144.07,146.89\n9/17/12 12:00 AM,146.94,147.19,146.37,146.74,146.14,151.05\n9/18/12 12:00 AM,146.49,146.81,146.25,146.62,146.44,151.62\n9/19/12 12:00 AM,146.79,147.17,146.41,146.7,146.61,151.86\n9/20/12 12:00 AM,146.03,146.79,145.63,146.71,146.41,151.37\n9/21/12 12:00 AM,146.64,146.67,145.81,145.87,146.3,151.07\n9/24/12 12:00 AM,145.15,145.98,145.04,145.65,145.8,149.97\n9/25/12 12:00 AM,145.96,146.24,144.06,144.1,145.72,149.03\n9/26/12 12:00 AM,144.07,144.11,142.95,143.29,145.61,147.15\n9/27/12 12:00 AM,143.89,144.97,143.51,144.64,145.56,144.98\n9/28/12 12:00 AM,144.09,144.56,143.46,143.97,145.52,144.59\n10/1/12 12:00 AM,144.52,145.69,144.01,144.35,145.49,144.38\n10/2/12 12:00 AM,144.92,145.15,143.83,144.5,145.45,144.49\n10/3/12 12:00 AM,144.89,145.43,144.13,145.09,145.39,144.49\n10/4/12 12:00 AM,145.64,146.34,145.44,146.13,145.43,145.07\n10/5/12 12:00 AM,146.91,147.16,145.7,146.14,145.48,145.24\n10/8/12 12:00 AM,145.6,145.88,145.31,145.64,145.48,145.35\n10/9/12 12:00 AM,145.53,145.65,144.15,144.2,145.47,145.38\n10/10/12 12:00 AM,144.18,144.32,143.09,143.28,145.45,145.38\n10/11/12 12:00 AM,144.28,144.49,143.33,143.36,145.43,145.36\n10/12/12 12:00 AM,143.46,143.95,142.58,142.89,145.39,145.32\n10/15/12 12:00 AM,143.23,144.23,142.77,144.08,145.33,145.27\n10/16/12 12:00 AM,144.76,145.64,144.66,145.54,145.33,145.22\n10/17/12 12:00 AM,145.64,146.32,145.42,146.2,145.34,145.21\n10/18/12 12:00 AM,145.82,146.52,145.33,145.82,145.36,145.25\n10/19/12 12:00 AM,145.55,145.56,143.05,143.39,145.33,145.18\n10/22/12 12:00 AM,143.15,143.67,142.28,143.41,145.26,145.07\n10/23/12 12:00 AM,141.86,142.06,140.83,141.42,145.04,144.66\n10/24/12 12:00 AM,141.93,142.1,140.8,141.02,144.9,144.41\n10/25/12 12:00 AM,142.02,142.28,140.57,141.43,144.74,144.15\n10/26/12 12:00 AM,141.3,141.84,140.39,141.35,144.57,143.81\n10/31/12 12:00 AM,141.85,142.03,140.68,141.35,144.43,143.52\n11/1/12 12:00 AM,141.65,143.01,141.52,142.83,144.28,143.19\n11/2/12 12:00 AM,143.68,143.72,141.41,141.56,143.72,142.12\n11/5/12 12:00 AM,141.35,142.17,140.93,141.85,143.19,141.12\n11/6/12 12:00 AM,142.28,143.52,142.13,142.96,143.16,141.28\n11/7/12 12:00 AM,141.66,141.68,139.06,139.72,142.85,140.8\n11/8/12 12:00 AM,139.7,140.41,137.93,138.04,142.39,140.03\n11/9/12 12:00 AM,137.62,139.44,137.55,138.16,141.91,139.25\n11/12/12 12:00 AM,138.59,138.81,137.96,138.26,141.47,138.52\n11/13/12 12:00 AM,137.54,139.25,137.36,137.79,141.14,138.01\n11/14/12 12:00 AM,138.21,138.43,135.62,135.93,140.67,137.62\n11/15/12 12:00 AM,135.98,136.49,135.18,135.7,140.06,136.94\n11/16/12 12:00 AM,135.9,136.64,134.7,136.37,138.25,133.35\n11/19/12 12:00 AM,137.9,139.15,137.82,139.13,138.35,133.84\n11/20/12 12:00 AM,138.91,139.42,138.08,139.19,138.49,134.59\n11/21/12 12:00 AM,139.31,139.57,139.03,139.45,138.7,135.5\n11/23/12 12:00 AM,140.13,141.4,140.04,141.35,138.89,136.31\n11/26/12 12:00 AM,140.65,141.11,140.19,141.05,139.04,136.94\n11/27/12 12:00 AM,140.91,141.39,140.24,140.33,139.11,137.54\n11/28/12 12:00 AM,139.76,141.54,139,141.46,139.14,138.21\n11/29/12 12:00 AM,141.99,142.51,141.37,142.12,139.33,140.41\n11/30/12 12:00 AM,142.14,142.42,141.66,142.15,139.81,141.28\n12/3/12 12:00 AM,142.8,142.92,141.34,141.45,141.45,144.41\n12/4/12 12:00 AM,141.44,141.87,140.87,141.25,141.4,144.1\n12/5/12 12:00 AM,141.37,142.16,140.37,141.5,141.37,143.86\n12/6/12 12:00 AM,141.37,142.04,141.16,141.98,141.42,143.79\n12/7/12 12:00 AM,142.53,142.69,141.67,142.41,141.56,144.01\n12/10/12 12:00 AM,142.21,142.81,142.15,142.47,141.94,144.74\n12/11/12 12:00 AM,143.06,144.11,142.99,143.44,142.17,145\n12/12/12 12:00 AM,144,144.55,143.31,143.51,142.43,145.05\n12/13/12 12:00 AM,143.42,143.83,142.27,142.63,142.48,143.51\n12/14/12 12:00 AM,142.32,142.58,141.88,142.11,142.46,143.53\n12/17/12 12:00 AM,142.47,143.85,142.43,143.77,142.57,143.77\n12/18/12 12:00 AM,144,145.5,143.79,145.37,143.22,145.02\n12/19/12 12:00 AM,145.53,145.58,144.24,144.29,143.86,146.16\n12/20/12 12:00 AM,144.38,145.14,143.98,145.12,144.07,146.2\n12/21/12 12:00 AM,142.17,143.1,141.94,142.79,143.92,145.67\n12/24/12 12:00 AM,142.48,142.56,142.19,142.35,143.82,145.21\n12/26/12 12:00 AM,142.64,142.71,141.35,141.75,143.75,145.01\n12/27/12 12:00 AM,141.79,142.08,139.92,141.56,143.68,144.89\n12/28/12 12:00 AM,140.64,141.42,139.87,140.03,143.54,144.51\n12/31/12 12:00 AM,139.66,142.56,139.54,142.41,143.44,143.67\n1/2/13 12:00 AM,145.11,146.15,144.73,146.06,143.55,143.24\n1/3/13 12:00 AM,145.99,146.37,145.34,145.73,143.68,143.29\n1/4/13 12:00 AM,145.97,146.61,145.67,146.37,143.83,143.74\n1/7/13 12:00 AM,145.85,146.11,145.43,145.97,143.95,144.07\n1/8/13 12:00 AM,145.71,145.91,144.98,145.55,144.01,144.28\n1/9/13 12:00 AM,145.87,146.32,145.64,145.92,144.05,144.43\n1/10/13 12:00 AM,146.73,147.09,145.97,147.08,144.11,144.69\n1/11/13 12:00 AM,147.04,147.15,146.61,147.07,145.48,147.52\n1/14/13 12:00 AM,146.89,147.07,146.43,146.97,145.97,148.4\n1/15/13 12:00 AM,146.29,147.21,146.2,147.07,146.22,148.75\n1/16/13 12:00 AM,146.77,147.28,146.61,147.05,146.42,149.01\n1/17/13 12:00 AM,147.7,148.42,147.41,148,146.91,149.87\n1/18/13 12:00 AM,147.97,148.49,147.43,148.33,147.44,150.87\n1/22/13 12:00 AM,148.33,149.13,147.98,149.13,148.17,152.28\n1/23/13 12:00 AM,149.13,149.5,148.86,149.37,148.74,153.37\n1/24/13 12:00 AM,149.15,150.14,149.01,149.41,149.03,152.57\n1/25/13 12:00 AM,149.88,150.25,149.37,150.25,149.29,152.6\n1/28/13 12:00 AM,150.29,150.33,149.51,150.07,149.6,152.98\n1/29/13 12:00 AM,149.77,150.85,149.67,150.66,150.26,154.1\n1/30/13 12:00 AM,150.64,150.94,149.93,150.07,150.32,153.74\n1/31/13 12:00 AM,149.89,150.38,149.6,149.7,150.14,152.84\n2/1/13 12:00 AM,150.65,151.42,150.39,151.24,150.7,153.22\n2/4/13 12:00 AM,150.32,150.58,149.43,149.54,150.31,151.89\n2/5/13 12:00 AM,150.35,151.48,150.29,151.05,150.55,152.07\n2/6/13 12:00 AM,150.52,151.26,150.41,151.16,150.66,152.03\n2/7/13 12:00 AM,151.21,151.35,149.86,150.96,150.64,151.68\n2/8/13 12:00 AM,151.22,151.89,151.22,151.8,150.79,151.31\n2/11/13 12:00 AM,151.74,151.9,151.39,151.77,150.91,151.5\n2/12/13 12:00 AM,151.78,152.3,151.61,152.02,151.05,151.97\n2/13/13 12:00 AM,152.33,152.61,151.72,152.15,151.12,151.54\n2/14/13 12:00 AM,151.69,152.47,151.52,152.29,151.2,152.09\n2/15/13 12:00 AM,152.43,152.59,151.55,152.11,151.26,151.97\n2/19/13 12:00 AM,152.37,153.28,152.16,153.25,151.4,152.15\n2/20/13 12:00 AM,153.14,153.19,151.26,151.34,151.94,153.23\n2/21/13 12:00 AM,150.96,150.96,149.94,150.42,151.84,152.89\n2/22/13 12:00 AM,151.15,151.89,150.49,151.89,151.8,152.68\n2/25/13 12:00 AM,152.63,152.86,149,149,151.77,152.48\n2/26/13 12:00 AM,149.72,150.2,148.73,150.02,151.7,152.28\n2/27/13 12:00 AM,149.89,152.33,149.76,151.91,151.67,152.14\n2/28/13 12:00 AM,151.9,152.87,151.41,151.61,151.69,152.12\n3/1/13 12:00 AM,151.09,152.34,150.41,152.11,151.68,151.96\n3/4/13 12:00 AM,151.76,152.92,151.52,152.92,151.75,151.56\n3/5/13 12:00 AM,153.66,154.7,153.64,154.29,151.87,151.91\n3/6/13 12:00 AM,154.84,154.92,154.16,154.5,152.03,152.26\n3/7/13 12:00 AM,154.7,154.98,154.52,154.78,152.11,152.46\n3/8/13 12:00 AM,155.46,155.65,154.66,155.44,152.31,152.92\n3/11/13 12:00 AM,155.32,156.04,155.13,156.03,152.67,153.68\n3/12/13 12:00 AM,155.92,156.1,155.21,155.68,153.01,154.33\n3/13/13 12:00 AM,155.76,156.12,155.23,155.9,153.7,155.72\n3/14/13 12:00 AM,156.31,156.8,156.22,156.73,156.51,161.27\n3/15/13 12:00 AM,155.85,156.04,155.31,155.83,155.97,160.06\n3/18/13 12:00 AM,154.34,155.64,154.2,154.97,155.37,158.72\n3/19/13 12:00 AM,155.3,155.51,153.59,154.61,155.09,158.06\n3/20/13 12:00 AM,155.52,155.95,155.26,155.69,155.18,158.05\n3/21/13 12:00 AM,154.76,155.64,154.1,154.36,155.14,157.62\n3/22/13 12:00 AM,154.85,155.6,154.73,155.6,155.15,157.28\n3/25/13 12:00 AM,156.01,156.27,154.35,154.95,155.16,156.62\n3/26/13 12:00 AM,155.59,156.23,155.42,156.19,155.17,153.83\n3/27/13 12:00 AM,155.26,156.24,155,156.19,155.19,154.41\n3/28/13 12:00 AM,156.09,156.85,155.75,156.67,155.21,155.05\n4/1/13 12:00 AM,156.59,156.91,155.67,156.05,155.23,155.38\n4/2/13 12:00 AM,156.61,157.21,156.37,156.82,155.27,155.36\n4/3/13 12:00 AM,156.91,157.03,154.82,155.23,155.29,155.44\n4/4/13 12:00 AM,155.43,156.17,155.09,155.86,155.3,155.46\n4/5/13 12:00 AM,153.95,155.35,153.77,155.16,155.29,155.42\n4/8/13 12:00 AM,155.27,156.22,154.75,156.21,155.29,155.42\n4/9/13 12:00 AM,156.5,157.32,155.98,156.75,155.34,155.49\n4/10/13 12:00 AM,157.17,158.87,157.13,158.67,155.47,155.72\n4/11/13 12:00 AM,158.7,159.71,158.54,159.19,155.75,156.26\n4/12/13 12:00 AM,158.68,159.04,157.92,158.8,155.91,156.56\n4/15/13 12:00 AM,158,158.13,155.1,155.12,155.96,156.64\n4/16/13 12:00 AM,156.29,157.49,155.91,157.41,156.02,156.74\n4/17/13 12:00 AM,156.29,156.32,154.28,155.11,155.97,156.65\n4/18/13 12:00 AM,155.37,155.41,153.55,154.14,155.89,156.49\n4/19/13 12:00 AM,154.5,155.55,154.12,155.48,155.84,156.34\n4/22/13 12:00 AM,155.78,156.54,154.75,156.17,155.84,156.2\n4/23/13 12:00 AM,156.95,157.93,156.17,157.78,155.86,155.96\n4/24/13 12:00 AM,157.83,158.3,157.54,157.88,155.91,155.9\n4/25/13 12:00 AM,158.34,159.27,158.1,158.52,155.95,155.93\n4/26/13 12:00 AM,158.33,158.6,157.73,158.24,155.98,155.94\n4/29/13 12:00 AM,158.67,159.65,158.42,159.3,156.03,156.09\n4/30/13 12:00 AM,159.27,159.72,158.61,159.68,156.07,156.25\n5/1/13 12:00 AM,159.33,159.41,158.1,158.28,156.13,156.41\n5/2/13 12:00 AM,158.68,159.89,158.53,159.75,156.29,156.74\n5/3/13 12:00 AM,161.14,161.88,161.04,161.37,158.01,160.17\n5/6/13 12:00 AM,161.31,162.01,161.42,161.79,160.41,164.92\n5/7/13 12:00 AM,162,162.65,161.67,162.6,161.03,166.12\n5/8/13 12:00 AM,162.57,163.39,162.19,163.34,161.87,167.75\n5/9/13 12:00 AM,163.27,163.7,162.47,162.88,162.34,168.65\n5/10/13 12:00 AM,162.99,163.55,162.51,163.41,162.59,169.1\n5/13/13 12:00 AM,163.2,163.81,162.82,163.54,162.91,169.69\n5/14/13 12:00 AM,163.67,165.35,163.67,165.23,164.51,172.73\n5/15/13 12:00 AM,164.96,166.45,164.91,166.12,165.35,172.68\n5/16/13 12:00 AM,165.78,166.36,165.09,165.34,165.64,170.87\n5/17/13 12:00 AM,165.95,167.04,165.73,166.94,166.18,171.33\n5/20/13 12:00 AM,166.78,167.58,166.61,166.93,166.68,171.48\n5/21/13 12:00 AM,167.08,167.8,166.5,167.17,166.9,171.45\n5/22/13 12:00 AM,167.34,169.07,165.17,165.93,167.03,171.47\n5/23/13 12:00 AM,164.16,165.91,163.94,165.45,165.1,167.3\n5/24/13 12:00 AM,164.47,165.38,163.98,165.31,164.96,165.4\n5/28/13 12:00 AM,167.06,167.78,165.81,166.3,165.24,165.13\n5/29/13 12:00 AM,165.42,165.8,164.34,165.22,165.21,164.79\n5/30/13 12:00 AM,165.35,166.59,165.22,165.83,165.27,164.36\n5/31/13 12:00 AM,165.37,166.31,163.13,163.45,165.25,163.83\n6/3/13 12:00 AM,163.83,164.46,162.66,164.35,165.22,163.54\n6/4/13 12:00 AM,164.44,165.1,162.73,163.56,165.19,163.35\n6/5/13 12:00 AM,163.09,163.42,161.13,161.27,165.01,164.91\n6/6/13 12:00 AM,161.2,162.74,160.25,162.73,164.69,164.42\n6/7/13 12:00 AM,163.85,164.95,163.14,164.8,164.57,163.91\n6/10/13 12:00 AM,165.31,165.4,164.37,164.8,164.63,164.04\n6/11/13 12:00 AM,163.3,164.54,162.74,163.1,164.42,163.58\n6/12/13 12:00 AM,164.22,164.39,161.6,161.75,164.11,162.97\n6/13/13 12:00 AM,161.66,164.5,161.3,164.21,163.91,162.6\n6/14/13 12:00 AM,164.03,164.67,162.91,163.18,163.9,162.6\n6/17/13 12:00 AM,164.29,165.22,163.55,164.44,163.92,162.84\n6/18/13 12:00 AM,164.53,165.99,164.52,165.74,163.97,163.26\n6/19/13 12:00 AM,165.6,165.89,163.38,163.45,163.99,163.41\n6/20/13 12:00 AM,161.86,162.1,158.98,159.4,163.91,163.19\n6/21/13 12:00 AM,159.64,159.76,157.47,159.07,163.72,163.01\n6/24/13 12:00 AM,157.41,158.43,155.73,157.06,163.27,162.43\n6/25/13 12:00 AM,158.48,160.1,157.42,158.57,162.97,162.02\n6/26/13 12:00 AM,159.87,160.5,159.25,160.14,162.76,161.62\n6/27/13 12:00 AM,161.1,161.82,160.95,161.08,162.67,161.41\n6/28/13 12:00 AM,160.63,161.4,159.86,160.42,162.49,161.01\n7/1/13 12:00 AM,161.26,162.48,161.08,161.36,162.15,160.3\n7/2/13 12:00 AM,161.12,162.3,160.5,161.21,162.04,160.17\n7/3/13 12:00 AM,160.48,161.77,160.22,161.34,161.97,160.21\n7/5/13 12:00 AM,162.47,163.08,161.3,163.02,161.98,160.68\n7/8/13 12:00 AM,163.86,164.39,163.58,163.95,162.11,161.26\n7/9/13 12:00 AM,164.98,165.33,164.27,165.13,162.27,161.78\n7/10/13 12:00 AM,164.97,165.75,164.63,165.19,162.41,162.16\n7/11/13 12:00 AM,167.11,167.61,166.53,167.44,162.76,163.04\n7/12/13 12:00 AM,167.39,167.93,167.13,167.51,164.31,166.47\n7/15/13 12:00 AM,167.97,168.39,167.68,168.15,165.56,169.08\n7/16/13 12:00 AM,168.26,168.36,167.07,167.52,166.75,171.54\n7/17/13 12:00 AM,168.16,168.48,167.73,167.95,168.1,174.23\n7/18/13 12:00 AM,168.31,169.27,168.2,168.87,168.69,175.26\n7/19/13 12:00 AM,168.52,169.23,168.31,169.17,168.74,175.21\n7/22/13 12:00 AM,169.41,169.74,169.01,169.5,169.38,176.34\n7/23/13 12:00 AM,169.8,169.83,169.05,169.14,169.42,176.08\n7/24/13 12:00 AM,169.79,169.86,168.18,168.52,169.19,174.08\n7/25/13 12:00 AM,168.22,169.08,167.94,168.93,168.9,172.24\n7/26/13 12:00 AM,168.22,169.16,167.52,169.11,168.61,170.46\n7/29/13 12:00 AM,168.68,169.06,168.11,168.59,168.6,169.09\n7/30/13 12:00 AM,169.1,169.28,168.19,168.59,168.62,168.55\n7/31/13 12:00 AM,168.94,169.85,168.49,168.71,168.7,168.66\n8/1/13 12:00 AM,169.99,170.81,169.9,170.66,168.8,168.23\n8/2/13 12:00 AM,170.28,170.97,170.05,170.95,168.88,168.34\n8/5/13 12:00 AM,170.57,170.96,170.35,170.7,168.96,168.73\n8/6/13 12:00 AM,170.37,170.74,169.35,169.73,169.01,169.12\n8/7/13 12:00 AM,169.19,169.43,168.55,169.18,169.01,169.41\n8/8/13 12:00 AM,169.98,170.18,168.93,169.8,169.05,169.5\n8/9/13 12:00 AM,169.58,170.1,168.72,169.31,169.09,169.55\n8/12/13 12:00 AM,168.46,169.31,168.38,169.11,169.06,169.43\n8/13/13 12:00 AM,169.41,169.9,168.41,169.61,169.07,169.33\n8/14/13 12:00 AM,169.53,169.8,168.7,168.74,169.07,169.26\n8/15/13 12:00 AM,167.41,167.43,166.09,166.38,168.99,169.02\n8/16/13 12:00 AM,166.06,166.63,165.5,165.83,168.78,168.55\n8/19/13 12:00 AM,165.64,166.21,164.76,164.77,168.29,167.58\n8/20/13 12:00 AM,165.04,166.2,164.86,165.58,167.83,166.6\n8/21/13 12:00 AM,165.12,166.03,164.19,164.56,167.05,165.01\n8/22/13 12:00 AM,164.9,166.3,164.89,166.06,166.67,164.28\n8/23/13 12:00 AM,166.55,166.83,165.77,166.62,166.57,164.06\n8/26/13 12:00 AM,166.79,167.3,165.89,166,166.6,164.12\n8/27/13 12:00 AM,164.36,166,163.21,163.33,165.85,162.72\n8/28/13 12:00 AM,163.26,164.49,163.05,163.91,165.39,161.99\n8/29/13 12:00 AM,163.55,165.04,163.4,164.17,165.23,162.17\n8/30/13 12:00 AM,164.51,164.53,163.17,163.65,165.05,162.28\n9/3/13 12:00 AM,165.23,165.58,163.7,164.39,165.02,162.99\n9/4/13 12:00 AM,164.43,166.03,164.13,165.75,165.02,163.38\n9/5/13 12:00 AM,165.85,166.4,165.73,165.96,165.11,163.65\n9/6/13 12:00 AM,166.51,166.98,164.48,166.04,165.13,163.67\n9/9/13 12:00 AM,166.45,167.73,166.45,167.63,165.16,164.47\n9/10/13 12:00 AM,168.64,168.9,168.26,168.87,165.26,165.13\n9/11/13 12:00 AM,168.64,169.4,168.35,169.4,165.39,165.55\n9/12/13 12:00 AM,169.34,169.56,168.72,168.95,165.59,166.13\n9/13/13 12:00 AM,169.13,169.46,168.74,169.33,165.84,166.67\n9/16/13 12:00 AM,171.16,171.24,170.04,170.31,166.52,168.01\n9/17/13 12:00 AM,170.46,171.11,170.46,171.07,167.12,169.13\n9/18/13 12:00 AM,171.01,173.52,170.58,173.05,170.67,176.21\n9/19/13 12:00 AM,173.52,173.6,172.59,172.76,173.1,181.03\n9/20/13 12:00 AM,172.33,172.33,170.58,170.72,171.93,178.6\n9/23/13 12:00 AM,170.49,170.65,169.39,169.93,170.67,175.96\n9/24/13 12:00 AM,169.9,170.53,169.21,169.53,170.2,174.81\n9/25/13 12:00 AM,169.64,169.98,168.89,169.04,169.71,173.58\n9/26/13 12:00 AM,169.32,170.17,169.05,169.69,169.69,172.86\n9/27/13 12:00 AM,168.84,169.14,168.47,168.91,169.54,171.96\n9/30/13 12:00 AM,167.48,168.54,167.15,168.01,169.51,168.36\n10/1/13 12:00 AM,168.14,169.5,167.97,169.34,169.48,165.87\n10/2/13 12:00 AM,168.35,169.34,167.83,169.18,169.36,166.8\n10/3/13 12:00 AM,168.79,168.94,166.84,167.62,169.06,167.45\n10/4/13 12:00 AM,167.75,169.06,167.53,168.89,168.85,167.49\n10/7/13 12:00 AM,167.42,168.45,167.25,167.43,168.53,167.35\n10/8/13 12:00 AM,167.4,167.62,165.36,165.48,167.26,164.83\n10/9/13 12:00 AM,165.8,166.2,164.53,165.6,166.33,163.13\n10/10/13 12:00 AM,167.29,169.26,167.23,169.17,166.75,163.98\n10/11/13 12:00 AM,168.91,170.32,168.77,170.26,167.04,164.59\n10/14/13 12:00 AM,169.21,171.08,169.08,170.94,167.22,165.07\n10/15/13 12:00 AM,170.51,171.15,169.47,169.7,167.38,165.7\n10/16/13 12:00 AM,170.72,172.16,170.63,172.07,167.74,166.64\n10/17/13 12:00 AM,171.37,173.32,171.34,173.22,168.29,168.04\n10/18/13 12:00 AM,173.86,174.51,173.51,174.39,168.86,170.46\n10/21/13 12:00 AM,174.45,174.75,174.01,174.4,170.32,174.3\n10/22/13 12:00 AM,174.91,175.93,174.43,175.41,173.54,180.33\n10/23/13 12:00 AM,174.81,174.89,173.96,174.57,173.99,180.93\n10/24/13 12:00 AM,174.92,175.37,174.51,175.15,174.38,181.55\n10/25/13 12:00 AM,175.51,176,175.17,175.95,175.28,183.18\n10/28/13 12:00 AM,175.89,176.47,175.7,176.23,175.8,183.85\n10/29/13 12:00 AM,176.63,177.24,176.38,177.17,176.81,185.33\n10/30/13 12:00 AM,177.38,177.51,175.66,176.29,176.64,184.42\n10/31/13 12:00 AM,176.15,176.89,175.53,175.79,176.38,182.44\n11/1/13 12:00 AM,176.02,176.61,175.22,176.21,176.26,178.98\n11/4/13 12:00 AM,176.69,176.9,176.11,176.83,176.35,178.71\n11/5/13 12:00 AM,176.14,176.75,175.57,176.27,176.24,178.1\n11/6/13 12:00 AM,177.03,177.5,176.54,177.17,176.62,177.97\n11/7/13 12:00 AM,177.5,177.64,174.76,174.93,176.54,177.28\n11/8/13 12:00 AM,174.87,177.31,174.85,177.29,176.52,176.23\n11/11/13 12:00 AM,177.12,177.53,176.91,177.32,176.54,176.43\n11/12/13 12:00 AM,176.94,177.36,176.37,176.96,176.54,176.71\n11/13/13 12:00 AM,176.09,178.43,176.09,178.38,176.57,176.89\n11/14/13 12:00 AM,178.54,179.42,178.25,179.27,176.69,177.04\n11/15/13 12:00 AM,179.56,180.12,179.33,180.05,176.97,177.69\n11/18/13 12:00 AM,180.35,180.5,179.02,179.42,177.27,177.91\n11/19/13 12:00 AM,179.33,179.87,178.72,179.03,177.41,178.29\n11/20/13 12:00 AM,179.39,179.93,177.98,178.47,177.73,178.94\n11/21/13 12:00 AM,178.97,180.05,178.86,179.91,178.08,179.63\n11/22/13 12:00 AM,179.98,180.83,179.77,180.81,178.57,180.6\n11/25/13 12:00 AM,181.13,181.17,180.37,180.63,179.97,183.37\n11/26/13 12:00 AM,180.72,181.22,180.4,180.68,180.19,183.7\n11/27/13 12:00 AM,180.87,181.24,180.65,181.12,180.31,183.65\n11/29/13 12:00 AM,181.32,181.75,180.8,180.95,180.43,183.6\n12/2/13 12:00 AM,181.09,181.43,180.25,180.53,180.48,183.55\n12/3/13 12:00 AM,179.94,180.39,179.17,179.75,180.35,182.98\n12/4/13 12:00 AM,179.1,180.48,178.35,179.73,180.24,182.4\n12/5/13 12:00 AM,179.41,179.74,178.77,178.94,180.15,181.74\n12/6/13 12:00 AM,180.67,181.11,180.15,180.94,180.17,180.36\n12/9/13 12:00 AM,181.47,181.67,181.16,181.4,180.2,180.2\n12/10/13 12:00 AM,180.98,181.36,180.63,180.75,180.21,180.12\n12/11/13 12:00 AM,180.81,180.85,178.5,178.72,180.21,179.98\n12/12/13 12:00 AM,178.62,178.86,177.76,178.13,180.18,179.88\n12/13/13 12:00 AM,178.5,178.66,177.77,178.11,180.12,179.89\n12/16/13 12:00 AM,178.95,179.81,178.9,179.22,180.11,179.98\n12/17/13 12:00 AM,179.36,179.41,178.25,178.65,180.09,180.02\n12/18/13 12:00 AM,178.92,181.73,177.32,181.7,180.07,179.98\n12/19/13 12:00 AM,181.19,181.7,180.71,181.49,180.1,180\n12/20/13 12:00 AM,180.67,181.99,180.57,181.56,180.13,180.05\n12/23/13 12:00 AM,182.41,182.64,182.07,182.53,180.22,180.24\n12/24/13 12:00 AM,182.54,183.01,182.45,182.96,180.3,180.42\n12/26/13 12:00 AM,183.34,183.96,183.32,183.85,180.45,180.78\n12/27/13 12:00 AM,184.1,184.18,183.66,183.85,180.63,181.14\n12/30/13 12:00 AM,183.87,184.02,183.58,183.82,180.79,181.48\n12/31/13 12:00 AM,184.07,184.69,183.93,184.69,182.12,184.17\n1/2/14 12:00 AM,183.98,184.07,182.48,182.92,182.56,185.02\n1/3/14 12:00 AM,183.21,183.6,182.63,182.88,183.12,186.1\n1/6/14 12:00 AM,183.47,183.56,182.08,182.36,182.93,185.65\n1/7/14 12:00 AM,183.09,183.79,182.95,183.48,183.13,185.97\n1/8/14 12:00 AM,183.45,183.83,182.89,183.52,183.18,185.91\n1/9/14 12:00 AM,184.1,184.13,182.79,183.64,183.23,185.84\n1/10/14 12:00 AM,183.96,184.22,183.01,184.14,183.31,185.83\n1/13/14 12:00 AM,183.72,184.18,181.34,181.68,183.29,184.46\n1/14/14 12:00 AM,182.28,183.77,181.95,183.67,183.28,184\n1/15/14 12:00 AM,184.1,184.94,183.71,184.66,183.31,183.5\n1/16/14 12:00 AM,184.28,184.66,183.83,184.42,183.33,183.73\n1/17/14 12:00 AM,184.1,184.45,183.32,183.63,183.35,183.56\n1/21/14 12:00 AM,184.7,184.77,183.05,184.18,183.36,183.54\n1/22/14 12:00 AM,184.49,184.57,183.91,184.3,183.38,183.53\n1/23/14 12:00 AM,183.36,183.4,181.82,182.79,183.36,183.42\n1/24/14 12:00 AM,181.6,181.66,178.83,178.89,183.12,182.96\n1/27/14 12:00 AM,179.06,179.52,177.12,178.01,182.52,181.77\n1/28/14 12:00 AM,178.14,179.3,178.12,179.07,182.18,181.06\n1/29/14 12:00 AM,177.56,178.55,176.88,177.35,181.76,180.18\n1/30/14 12:00 AM,178.86,179.81,178.26,179.23,181.5,179.65\n1/31/14 12:00 AM,177.02,179.29,176.92,178.18,181.14,178.91\n2/3/14 12:00 AM,177.95,178.37,173.83,174.17,179.51,175.63\n2/4/14 12:00 AM,174.95,175.84,174.11,175.38,175.75,168.14\n2/5/14 12:00 AM,174.79,175.56,173.71,175.17,175.11,167.1\n2/6/14 12:00 AM,175.58,177.48,175.22,177.48,175.41,168.29\n2/7/14 12:00 AM,178.31,179.87,177.73,179.68,176.19,170.19\n2/10/14 12:00 AM,179.7,180.07,179.21,180.01,176.83,171.9\n2/11/14 12:00 AM,180.16,182.44,180.04,181.98,177.12,172.75\n2/12/14 12:00 AM,182.22,182.83,181.71,182.07,177.41,173.68\n2/13/14 12:00 AM,180.84,183.2,180.83,183.01,177.46,175.41\n2/14/14 12:00 AM,182.83,184.36,182.67,184.02,177.62,179.48\n2/18/14 12:00 AM,184.19,184.49,183.65,184.24,178.23,181.35\n2/19/14 12:00 AM,183.76,184.95,182.87,183.02,180.07,184.73\n2/20/14 12:00 AM,183.27,184.52,182.6,184.1,182.46,188.73\n2/21/14 12:00 AM,184.49,184.89,183.8,183.89,184.31,191.8\n2/24/14 12:00 AM,184.28,186.15,184.2,184.91,184.7,192.27\n2/25/14 12:00 AM,185.03,185.59,184.23,184.84,184.78,192.14\n2/26/14 12:00 AM,185.11,185.6,184.33,184.85,184.91,192.37\n2/27/14 12:00 AM,184.59,185.87,184.37,185.82,185,192.38\n2/28/14 12:00 AM,185.79,187.15,185.05,186.29,185.41,192.6\n3/3/14 12:00 AM,184.69,185.45,183.75,184.98,185.23,190.39\n3/4/14 12:00 AM,186.75,187.98,186.75,187.58,186.14,189.82\n3/5/14 12:00 AM,187.72,188.07,187.45,187.75,186.78,189.25\n3/6/14 12:00 AM,188.21,188.61,187.78,188.18,187.02,189.34\n3/7/14 12:00 AM,188.87,188.96,187.43,188.26,187.23,189.69\n3/10/14 12:00 AM,187.94,188.23,187.08,188.16,187.28,189.65\n3/11/14 12:00 AM,188.44,188.71,186.8,187.23,187.34,189.68\n3/12/14 12:00 AM,186.32,187.35,185.9,187.28,187.3,189.18\n3/13/14 12:00 AM,187.84,187.99,184.66,185.18,187.19,189.15\n3/14/14 12:00 AM,184.8,185.8,184.44,184.66,187.12,188.1\n3/17/14 12:00 AM,185.59,186.77,185.51,186.33,187.09,187.4\n3/18/14 12:00 AM,186.71,187.91,186.51,187.66,187.1,187.17\n3/19/14 12:00 AM,187.7,187.94,185.47,186.66,187.09,186.94\n3/20/14 12:00 AM,186.26,187.89,185.92,187.75,187.08,186.89\n3/21/14 12:00 AM,187.72,188.17,186.03,186.2,187.08,186.83\n3/24/14 12:00 AM,186.82,187.07,184.62,185.43,187.05,186.8\n3/25/14 12:00 AM,186.37,186.94,185.27,186.31,187.03,186.87\n3/26/14 12:00 AM,187.03,187.34,184.92,184.97,187.01,186.9\n3/27/14 12:00 AM,184.77,185.34,183.9,184.58,186.95,186.81\n3/28/14 12:00 AM,185.1,186.42,185,185.49,186.92,186.74\n3/31/14 12:00 AM,186.65,187.3,185.52,187.01,186.91,186.72\n4/1/14 12:00 AM,187.62,188.36,187,188.25,186.92,186.76\n4/2/14 12:00 AM,188.51,189.13,188.14,188.88,186.97,186.85\n4/3/14 12:00 AM,189.17,189.22,188.05,188.63,187.02,186.99\n4/4/14 12:00 AM,189.64,189.7,186.1,186.4,187.05,187.07\n4/7/14 12:00 AM,185.9,186.26,183.96,184.34,186.97,186.93\n4/8/14 12:00 AM,184.21,185.4,183.59,185.1,186.9,186.84\n4/9/14 12:00 AM,185.6,187.15,185.06,187.09,186.87,186.83\n4/10/14 12:00 AM,187.09,187.17,182.93,183.15,186.8,186.7\n4/11/14 12:00 AM,182.17,183.42,181.31,181.51,186.54,186.16\n4/14/14 12:00 AM,182.93,183.37,181.44,182.94,186.37,185.78\n4/15/14 12:00 AM,183.32,184.33,181.51,184.2,186.24,185.46\n4/16/14 12:00 AM,185.47,186.14,184.65,186.13,186.15,185.24\n4/17/14 12:00 AM,185.88,186.91,185.56,186.39,186.16,185.34\n4/21/14 12:00 AM,186.43,187.1,186.21,187.04,186.2,185.51\n4/22/14 12:00 AM,187.23,188.4,187.13,187.89,186.28,185.69\n4/23/14 12:00 AM,187.81,187.92,187.3,187.45,186.33,185.85\n4/24/14 12:00 AM,188.37,188.39,186.93,187.83,186.35,186.16\n4/25/14 12:00 AM,187.21,187.33,185.87,186.29,186.36,186.34\n4/28/14 12:00 AM,187.05,187.69,184.96,186.88,186.35,186.47\n4/29/14 12:00 AM,187.48,188.04,187.08,187.75,186.55,186.96\n4/30/14 12:00 AM,187.44,188.5,187.18,188.31,186.77,187.39\n5/1/14 12:00 AM,188.22,188.84,187.73,188.32,187.04,187.89\n5/2/14 12:00 AM,188.31,189.14,187.78,188.06,187.17,188.06\n5/5/14 12:00 AM,187.14,188.55,186.62,188.42,187.21,188.09\n5/6/14 12:00 AM,188,188.13,186.74,186.78,187.23,188.1\n5/7/14 12:00 AM,187.43,187.97,186.01,187.88,187.21,188.06\n5/8/14 12:00 AM,187.67,189.05,187.08,187.68,187.26,188.16\n5/9/14 12:00 AM,187.69,188.04,186.83,187.96,187.27,187.98\n5/12/14 12:00 AM,188.76,189.88,188.75,189.79,187.4,188.03\n5/13/14 12:00 AM,190.02,190.42,189.77,189.96,187.57,188.1\n5/14/14 12:00 AM,189.79,189.88,188.79,189.06,187.66,188.14\n5/15/14 12:00 AM,188.67,188.72,186.48,187.4,187.65,188.1\n5/16/14 12:00 AM,187.51,188.13,186.72,188.05,187.64,188.06\n5/19/14 12:00 AM,187.69,188.89,187.52,188.74,187.68,188.16\n5/20/14 12:00 AM,188.65,188.67,187.07,187.55,187.69,188.13\n5/21/14 12:00 AM,188.1,189.22,188.06,189.13,187.73,188.2\n5/22/14 12:00 AM,189.18,189.98,188.86,189.59,187.77,188.14\n5/23/14 12:00 AM,189.75,190.48,189.59,190.35,187.81,188.04\n5/27/14 12:00 AM,191.05,191.58,190.95,191.52,187.9,188.15\n5/28/14 12:00 AM,191.52,191.82,191.06,191.38,188.04,188.42\n5/29/14 12:00 AM,191.82,192.4,191.33,192.37,188.27,188.9\n5/30/14 12:00 AM,192.19,192.8,192.03,192.68,188.52,189.35\n6/2/14 12:00 AM,192.95,192.99,191.97,192.9,189.03,190.36\n6/3/14 12:00 AM,192.4,192.9,192.25,192.8,189.88,192.03\n6/4/14 12:00 AM,192.47,193.3,192.26,193.19,191.23,194.7\n6/5/14 12:00 AM,193.41,194.65,192.7,194.45,193.68,199.54\n6/6/14 12:00 AM,194.87,195.43,194.78,195.38,194.66,201.41\n6/9/14 12:00 AM,195.35,196.05,195.17,195.58,195.34,202.63\n6/10/14 12:00 AM,195.33,195.64,194.92,195.6,195.29,202.32\n6/11/14 12:00 AM,194.9,195.12,194.48,194.92,195.02,201.52\n6/12/14 12:00 AM,194.65,194.8,193.11,193.54,194.43,199.83\n6/13/14 12:00 AM,193.9,194.32,193.3,194.13,194.1,198.33\n6/16/14 12:00 AM,193.9,194.7,193.66,194.29,194.15,197.06\n6/17/14 12:00 AM,194.01,194.97,193.81,194.83,194.19,194.7\n6/18/14 12:00 AM,194.83,196.37,194.4,196.26,194.3,193.93\n6/19/14 12:00 AM,196.43,196.6,195.8,196.48,194.4,193.46\n6/20/14 12:00 AM,196.03,196.1,195.7,195.94,194.45,193.61\n6/23/14 12:00 AM,195.97,196.05,195.52,195.88,194.5,193.99\n6/24/14 12:00 AM,195.53,196.5,194.48,194.7,194.54,194.66\n6/25/14 12:00 AM,194.25,195.78,194.25,195.58,194.57,195.03\n6/26/14 12:00 AM,195.61,195.63,194.13,195.44,194.58,195.02\n6/27/14 12:00 AM,194.98,195.88,194.88,195.82,194.63,195.07\n6/30/14 12:00 AM,195.7,196.16,195.53,195.72,194.67,195.05\n7/1/14 12:00 AM,196.19,197.63,196.13,197.03,194.8,195.19\n7/2/14 12:00 AM,197.05,197.48,196.96,197.23,194.93,195.4\n7/3/14 12:00 AM,197.79,198.29,197.64,198.2,195.16,195.81\n7/7/14 12:00 AM,197.82,197.98,197.22,197.51,195.33,196.11\n7/8/14 12:00 AM,197.15,197.22,195.76,196.24,195.4,196.22\n7/9/14 12:00 AM,196.73,197.29,196.31,197.12,195.56,196.53\n7/10/14 12:00 AM,195.22,196.86,195.06,196.34,195.61,196.59\n7/11/14 12:00 AM,196.22,196.75,195.78,196.61,195.69,196.7\n7/14/14 12:00 AM,197.61,197.86,197.44,197.6,195.77,196.74\n7/15/14 12:00 AM,197.72,198.1,196.36,197.23,195.83,196.73\n7/16/14 12:00 AM,198.11,198.26,197.42,197.96,195.87,196.59\n7/17/14 12:00 AM,197.35,198.1,195.43,195.71,195.9,196.46\n7/18/14 12:00 AM,196.35,197.91,196.24,197.71,195.92,196.45\n7/21/14 12:00 AM,197.09,197.5,196.43,197.34,195.93,196.31\n7/22/14 12:00 AM,198.01,198.56,197.87,198.2,195.98,196.35\n7/23/14 12:00 AM,198.49,198.85,198.1,198.64,196.04,196.39\n7/24/14 12:00 AM,198.83,199.06,198.45,198.65,196.11,196.46\n7/25/14 12:00 AM,198.09,198.26,197.33,197.72,196.16,196.49\n7/28/14 12:00 AM,197.76,198.09,196.62,197.8,196.19,196.51\n7/29/14 12:00 AM,198.17,198.45,196.92,196.95,196.29,196.69\n7/30/14 12:00 AM,197.65,197.91,196.16,196.98,196.34,196.76\n7/31/14 12:00 AM,195.61,195.78,192.97,193.09,196.22,196.5\n8/1/14 12:00 AM,192.57,193.76,191.57,192.5,195.87,195.76\n8/4/14 12:00 AM,192.87,194.3,192.05,193.89,195.65,195.26\n8/5/14 12:00 AM,193.1,193.6,191.31,192.01,195.29,194.46\n8/6/14 12:00 AM,191.1,192.89,191.08,192.07,194.9,193.63\n8/7/14 12:00 AM,192.93,193.13,190.55,191.03,194.49,192.78\n8/8/14 12:00 AM,191.46,193.37,190.95,193.24,193.78,191.26\n8/11/14 12:00 AM,193.96,194.66,193.71,193.79,194.19,192.03\n8/12/14 12:00 AM,193.61,194.15,192.94,193.53,193.99,191.77\n8/13/14 12:00 AM,194.29,195.06,193.96,194.84,194.05,192.22\n8/14/14 12:00 AM,195.16,195.76,194.98,195.76,194.14,192.63\n8/15/14 12:00 AM,196.47,196.65,194.31,195.72,194.18,193.08\n8/18/14 12:00 AM,196.8,197.45,196.69,197.36,194.24,193.58\n8/19/14 12:00 AM,197.84,198.54,197.44,198.39,194.29,194.08\n8/20/14 12:00 AM,198.12,199.16,198.08,198.92,194.5,195.21\n8/21/14 12:00 AM,199.09,199.76,198.93,199.5,195.31,196.44\n8/22/14 12:00 AM,199.34,199.69,198.74,199.19,197.71,201.43\n8/25/14 12:00 AM,200.14,200.59,199.86,200.2,199.27,204.49\n8/26/14 12:00 AM,200.33,200.82,200.28,200.33,199.8,205.47\n8/27/14 12:00 AM,200.43,200.57,199.94,200.25,200.26,206.33\n8/28/14 12:00 AM,199.59,200.27,199.39,200.14,199.83,205.43\n8/29/14 12:00 AM,200.45,200.73,199.82,200.71,200.16,206.03\n9/2/14 12:00 AM,200.97,200.99,199.86,200.61,200.35,206.2\n9/3/14 12:00 AM,201.38,201.41,200.22,200.5,200.57,205.83\n9/4/14 12:00 AM,200.84,201.58,199.66,200.21,200.61,203.5\n9/5/14 12:00 AM,200.17,201.19,199.41,201.11,200.49,201.72\n9/8/14 12:00 AM,200.92,201.21,200,200.59,200.53,201.25\n9/9/14 12:00 AM,200.41,200.55,198.91,199.32,200.44,200.62\n9/10/14 12:00 AM,199.44,200.2,198.77,200.07,200.37,200.91\n9/11/14 12:00 AM,199.27,200.33,199.12,200.3,200.34,200.53\n9/12/14 12:00 AM,200.1,200.12,198.56,199.13,200.32,200.29\n9/15/14 12:00 AM,199.16,199.32,198.38,198.98,200.29,200.01\n9/16/14 12:00 AM,198.61,200.84,198.5,200.48,200.26,199.91\n9/17/14 12:00 AM,200.77,201.68,199.75,200.75,200.28,200.06\n9/18/14 12:00 AM,201.36,201.85,201.1,201.82,200.32,200.12\n9/19/14 12:00 AM,201.52,201.9,200.29,200.7,200.34,200.24\n9/22/14 12:00 AM,200.35,200.38,198.73,199.15,200.32,200.28\n9/23/14 12:00 AM,198.43,199.26,197.95,198.01,200.28,200.21\n9/24/14 12:00 AM,198.04,199.69,197.52,199.56,200.22,200.13\n9/25/14 12:00 AM,199.04,199.05,196.27,196.34,200.09,199.9\n9/26/14 12:00 AM,196.7,198.39,196.42,197.9,199.91,199.57\n9/29/14 12:00 AM,196.2,197.89,196.05,197.54,199.76,199.25\n9/30/14 12:00 AM,197.69,198.3,196.61,197.02,199.66,198.99\n10/1/14 12:00 AM,196.7,196.77,193.91,194.35,198.68,197.02\n10/2/14 12:00 AM,194.18,195.05,192.35,194.38,196.56,192.79\n10/3/14 12:00 AM,195.68,196.94,195.08,196.52,196.38,192.48\n10/6/14 12:00 AM,197.34,197.6,195.58,196.29,196.46,192.69\n10/7/14 12:00 AM,195.28,195.72,193.22,193.26,195.93,191.77\n10/8/14 12:00 AM,193.37,196.92,192.36,196.64,195.57,191.23\n10/9/14 12:00 AM,196.33,196.6,192.58,192.74,195.33,190.9\n10/10/14 12:00 AM,192.69,193.65,190.49,190.54,193.93,188.2\n10/13/14 12:00 AM,190.46,191.15,187.3,187.41,193.03,187.37\n10/14/14 12:00 AM,188.42,189.82,187.04,187.7,192.57,188.58\n10/15/14 12:00 AM,185.16,187.69,181.92,186.43,191.17,185.97\n10/16/14 12:00 AM,183.06,187.58,182.89,186.27,189.94,183.42\n10/17/14 12:00 AM,188.42,189.75,187.62,188.47,189.69,183.45\n10/20/14 12:00 AM,188.13,190.45,188.07,190.3,189.6,183.62\n10/21/14 12:00 AM,191.68,194.2,191.48,194.07,191.19,187.05\n10/22/14 12:00 AM,194.41,194.91,192.61,192.69,191.69,189.44\n10/23/14 12:00 AM,194.62,196.2,194.26,194.93,191.87,190.7\n10/24/14 12:00 AM,195.25,196.49,194.49,196.43,192.02,191.48\n10/27/14 12:00 AM,195.73,196.45,195.03,196.16,192.08,192.99\n10/28/14 12:00 AM,196.82,198.42,196.73,198.41,192.37,194.79\n10/29/14 12:00 AM,198.55,199.12,196.8,198.11,192.72,195.75\n10/30/14 12:00 AM,197.58,199.95,197.4,199.38,193.85,198.11\n10/31/14 12:00 AM,201.78,201.82,200.77,201.66,198.32,205.45\n11/3/14 12:00 AM,201.92,202.45,201.3,201.77,201.21,210.74\n11/4/14 12:00 AM,201.23,201.6,200.06,201.07,200.99,210.11\n11/5/14 12:00 AM,202.54,202.59,201.45,202.34,201.64,211.26\n11/6/14 12:00 AM,202.39,203.26,201.64,203.15,202.45,212.82\n11/7/14 12:00 AM,203.17,203.6,202.61,203.34,202.8,213.22\n11/10/14 12:00 AM,203.38,204.04,203.13,203.98,203.2,213.67\n11/11/14 12:00 AM,204.05,204.31,203.65,204.18,203.98,214.11\n11/12/14 12:00 AM,203.35,204.24,203.31,203.96,203.9,209.48\n11/13/14 12:00 AM,204.16,204.83,203.21,204.19,203.93,206.65\n11/14/14 12:00 AM,204.1,204.49,203.72,204.24,204.03,207.06\n11/17/14 12:00 AM,203.85,204.58,203.65,204.37,204.07,206.5\n11/18/14 12:00 AM,204.44,205.92,204.44,205.55,204.78,207.1\n11/19/14 12:00 AM,205.31,205.55,204.3,205.22,204.88,206.97\n11/20/14 12:00 AM,204.27,205.71,204.18,205.58,204.92,206.64\n11/21/14 12:00 AM,207.63,207.84,205.98,206.68,205.75,207.51\n11/24/14 12:00 AM,207.17,207.39,206.91,207.26,206.33,208.76\n11/25/14 12:00 AM,207.54,207.79,206.8,207.11,206.71,209.48\n11/26/14 12:00 AM,207.29,207.76,207.03,207.64,206.93,209.84\n11/28/14 12:00 AM,207.48,207.87,206.91,207.2,207.17,210.26\n12/1/14 12:00 AM,206.4,206.54,205.38,205.76,206.99,209.2\n12/2/14 12:00 AM,205.81,207.34,205.78,207.09,206.93,208.98\n12/3/14 12:00 AM,207.3,208.15,207.1,207.89,207.28,209.65\n12/4/14 12:00 AM,207.54,208.26,206.7,207.66,207.3,208.85\n12/5/14 12:00 AM,207.87,208.47,207.55,208,207.35,208.37\n12/8/14 12:00 AM,207.54,208.12,205.93,206.61,207.33,207.95\n12/9/14 12:00 AM,204.37,206.6,203.91,206.47,207.29,207.65\n12/10/14 12:00 AM,205.91,205.98,202.93,203.16,207.19,207.22\n12/11/14 12:00 AM,203.88,206.19,203.71,204.19,207.12,207.25\n12/12/14 12:00 AM,202.64,203.82,200.85,200.89,206.77,206.61\n12/15/14 12:00 AM,201.98,202.53,198.78,199.51,205.62,203.95\n12/16/14 12:00 AM,198.58,202.4,197.86,197.91,204.5,201.71\n12/17/14 12:00 AM,198.44,202.34,198.29,201.79,203.59,199.83\n12/18/14 12:00 AM,204.74,212.97,203.92,206.78,205,202.68\n12/19/14 12:00 AM,206.43,207.33,205.61,206.52,205.26,203.23\n12/22/14 12:00 AM,206.75,207.47,206.46,207.47,205.47,203.75\n12/23/14 12:00 AM,208.17,208.23,207.4,207.75,205.77,204.42\n12/24/14 12:00 AM,208.02,208.34,207.72,207.77,205.92,205.07\n12/26/14 12:00 AM,208.31,208.85,208.25,208.44,206.02,206.41\n12/29/14 12:00 AM,208.22,208.97,208.14,208.72,206.1,207.7\n12/30/14 12:00 AM,208.21,208.37,207.51,207.6,206.46,209.33\n12/31/14 12:00 AM,207.99,208.19,205.39,205.54,206.54,208.08\n1/2/15 12:00 AM,206.38,206.88,204.18,205.43,206.38,207.5\n1/5/15 12:00 AM,204.17,204.37,201.35,201.72,206.14,206.82\n1/6/15 12:00 AM,202.11,202.72,198.85,199.82,205.97,206.16\n1/7/15 12:00 AM,201.42,202.72,200.88,202.31,205.83,205.74\n1/8/15 12:00 AM,204.01,206.16,203.99,205.9,205.8,205.59\n1/9/15 12:00 AM,206.4,206.42,203.51,204.25,205.77,205.44\n1/12/15 12:00 AM,204.41,204.6,201.92,202.65,205.34,204.21\n1/13/15 12:00 AM,204.12,205.48,200.51,202.08,204.4,202.25\n1/14/15 12:00 AM,199.65,201.1,198.57,200.86,203.15,199.91\n1/15/15 12:00 AM,201.63,202.01,198.88,199.02,202.95,199.76\n1/16/15 12:00 AM,198.77,201.82,198.55,201.63,202.88,199.79\n1/20/15 12:00 AM,202.4,202.72,200.17,202.05,202.84,199.85\n1/21/15 12:00 AM,201.48,203.66,200.94,203.08,202.83,199.85\n1/22/15 12:00 AM,203.99,206.26,202.33,206.1,202.86,199.95\n1/23/15 12:00 AM,205.79,206.1,204.81,204.97,202.92,200.5\n1/26/15 12:00 AM,204.72,205.56,203.85,205.45,202.95,201.5\n1/27/15 12:00 AM,202.97,204.12,201.74,202.74,202.95,202.75\n1/28/15 12:00 AM,204.17,204.29,199.91,200.14,202.94,202.92\n1/29/15 12:00 AM,200.38,202.3,198.68,201.99,202.91,202.94\n1/30/15 12:00 AM,200.57,202.17,199.13,199.45,202.88,202.93\n2/2/15 12:00 AM,200.05,202.03,197.86,201.92,202.84,202.86\n2/3/15 12:00 AM,203,204.85,202.55,204.84,202.85,202.85\n2/4/15 12:00 AM,203.92,205.38,203.51,204.06,202.88,202.84\n2/5/15 12:00 AM,204.86,206.3,204.77,206.12,202.92,202.89\n2/6/15 12:00 AM,206.56,207.24,204.92,205.55,202.98,203.01\n2/9/15 12:00 AM,204.76,205.64,204.13,204.63,203.01,203.09\n2/10/15 12:00 AM,205.87,207.12,204.68,206.81,203.07,203.23\n2/11/15 12:00 AM,206.61,207.45,205.83,206.93,203.14,203.41\n2/12/15 12:00 AM,207.89,208.99,206.97,208.92,203.86,204.88\n2/13/15 12:00 AM,209.07,209.84,208.76,209.78,205.34,207.84\n2/17/15 12:00 AM,209.4,210.32,209.1,210.11,207.47,212.05\n2/18/15 12:00 AM,209.66,210.22,209.34,210.13,208.26,213.61\n2/19/15 12:00 AM,209.41,210.42,209.24,209.98,208.62,214.27\n2/20/15 12:00 AM,209.48,211.33,208.73,211.24,209.07,215.12\n2/23/15 12:00 AM,210.94,211.21,210.48,211.21,209.99,216.9\n2/24/15 12:00 AM,211.12,212.05,210.76,211.81,211.12,219.1\n2/25/15 12:00 AM,211.66,212.24,211.22,211.63,211.63,219.4\n2/26/15 12:00 AM,211.52,211.71,210.65,211.38,211.43,217.51\n2/27/15 12:00 AM,211.26,211.58,210.6,210.66,211.32,215.18\n3/2/15 12:00 AM,210.78,212.06,210.72,211.99,211.34,214.43\n3/3/15 12:00 AM,211.47,211.59,210.08,211.12,211.2,213.77\n3/4/15 12:00 AM,210.4,210.49,209.06,210.23,210.95,212.83\n3/5/15 12:00 AM,210.61,210.8,209.85,210.46,210.87,211.75\n3/6/15 12:00 AM,209.42,209.94,207.1,207.5,210.84,210.55\n3/9/15 12:00 AM,207.74,208.79,207.55,208.36,210.74,209.85\n3/10/15 12:00 AM,206.71,206.81,204.93,204.98,210.34,209.25\n3/11/15 12:00 AM,205.29,205.5,204.4,204.5,209.82,208.32\n3/12/15 12:00 AM,205.26,207.18,205.2,207.1,209.36,207.38\n3/13/15 12:00 AM,206.77,206.93,204.58,205.83,208.6,206\n3/16/15 12:00 AM,206.71,208.69,206.68,208.58,208.36,205.77\n3/17/15 12:00 AM,207.69,208.42,206.98,207.96,208.03,205.2\n3/18/15 12:00 AM,207.39,211.27,206.62,210.46,208.09,205.34\n3/19/15 12:00 AM,209.96,210.47,209.03,209.5,208.18,205.62\n3/20/15 12:00 AM,209.71,211.02,209.49,210.41,208.22,206.1\n3/23/15 12:00 AM,210.42,211.11,210,210,208.25,206.69\n3/24/15 12:00 AM,209.85,210.4,208.74,208.82,208.27,207.18\n3/25/15 12:00 AM,209.07,209.35,205.71,205.76,208.25,207.9\n3/26/15 12:00 AM,204.96,206.37,204.12,205.27,208.21,208.06\n3/27/15 12:00 AM,205.13,205.95,204.9,205.74,208.15,208.26\n3/30/15 12:00 AM,206.98,208.61,206.96,208.25,208.14,208.2\n3/31/15 12:00 AM,207.26,208.1,206.36,206.43,208.13,208.08\n4/1/15 12:00 AM,206.39,206.42,204.51,205.7,208.1,207.98\n4/2/15 12:00 AM,205.62,206.98,205.4,206.43,208.06,207.87\n4/6/15 12:00 AM,205.37,208.45,205.21,207.83,208.02,207.77\n4/7/15 12:00 AM,207.85,208.76,207.24,207.28,208.02,207.78\n4/8/15 12:00 AM,207.55,208.51,207.08,207.98,208.01,207.81\n4/9/15 12:00 AM,207.78,209.18,207.19,208.9,208.01,207.88\n4/10/15 12:00 AM,209.2,210.09,208.96,210.04,208.05,207.95\n4/13/15 12:00 AM,209.87,210.63,209.03,209.09,208.07,208.01\n4/14/15 12:00 AM,208.85,209.71,208.1,209.49,208.09,208.08\n4/15/15 12:00 AM,210.05,211.04,209.95,210.43,208.15,208.24\n4/16/15 12:00 AM,210.03,210.98,209.79,210.37,208.49,208.96\n4/17/15 12:00 AM,208.94,209.23,207.01,207.95,208.41,208.8\n4/20/15 12:00 AM,209.06,210.25,208.96,209.85,208.65,209.3\n4/21/15 12:00 AM,210.67,210.86,209.24,209.6,208.86,209.71\n4/22/15 12:00 AM,210.01,210.85,208.9,210.63,208.94,209.84\n4/23/15 12:00 AM,210.15,211.94,210.01,211.16,209.09,210.1\n4/24/15 12:00 AM,211.66,211.97,211.11,211.65,209.23,210.37\n4/27/15 12:00 AM,212.33,212.48,210.54,210.77,209.35,210.55\n4/28/15 12:00 AM,210.74,211.5,209.33,211.44,209.38,210.27\n4/29/15 12:00 AM,210.37,211.29,209.6,210.57,209.5,210.59\n4/30/15 12:00 AM,209.88,210.35,207.62,208.46,209.48,210.3\n5/1/15 12:00 AM,209.4,210.77,209.28,210.72,209.5,210.14\n5/4/15 12:00 AM,211.23,212.02,211.1,211.32,209.58,210.22\n5/5/15 12:00 AM,211.03,211.46,208.73,208.9,209.59,210.1\n5/6/15 12:00 AM,209.56,209.93,206.76,208.04,209.57,209.92\n5/7/15 12:00 AM,207.92,209.38,207.52,208.87,209.56,209.76\n5/8/15 12:00 AM,210.88,211.86,210.78,211.62,209.58,209.79\n5/11/15 12:00 AM,211.57,211.89,210.52,210.6,209.67,209.85\n5/12/15 12:00 AM,209.61,210.63,208.62,209.98,209.67,209.87\n5/13/15 12:00 AM,210.47,211.22,209.74,210.02,209.69,209.88\n5/14/15 12:00 AM,211.24,212.32,210.91,212.21,209.73,209.87\n5/15/15 12:00 AM,212.44,212.61,211.86,212.44,209.77,209.95\n5/18/15 12:00 AM,212.24,213.4,212.16,213.1,209.85,210.12\n5/19/15 12:00 AM,213.24,213.57,212.69,213.03,210.07,210.58\n5/20/15 12:00 AM,213.15,213.78,212.5,212.88,210.29,211\n5/21/15 12:00 AM,212.71,213.75,212.51,213.5,210.5,211.32\n5/22/15 12:00 AM,213.04,213.54,212.91,212.99,210.92,212.17\n5/26/15 12:00 AM,212.4,212.5,210.2,210.7,211.01,212.34\n5/27/15 12:00 AM,211.25,212.98,210.76,212.7,211.16,212.6\n5/28/15 12:00 AM,212.33,212.59,211.63,212.46,211.3,212.82\n5/29/15 12:00 AM,212.38,212.43,210.82,211.14,211.32,212.79\n6/1/15 12:00 AM,211.94,212.34,210.62,211.57,211.32,212.58\n6/2/15 12:00 AM,211.02,212.19,210.27,211.36,211.32,212.35\n6/3/15 12:00 AM,212,212.67,211.33,211.92,211.34,212.19\n6/4/15 12:00 AM,211.07,211.86,209.75,210.13,211.33,211.75\n6/5/15 12:00 AM,209.95,210.58,208.98,209.77,211.26,211.5\n6/8/15 12:00 AM,209.64,209.82,208.39,208.48,211.08,211\n6/9/15 12:00 AM,208.45,209.1,207.69,208.45,210.8,210.31\n6/10/15 12:00 AM,209.37,211.41,209.3,210.95,210.76,210.19\n6/11/15 12:00 AM,211.48,212.09,211.2,211.63,210.85,210.37\n6/12/15 12:00 AM,210.64,210.84,209.68,210.01,210.79,210.25\n6/15/15 12:00 AM,208.64,209.45,207.79,209.11,210.45,209.55\n6/16/15 12:00 AM,208.93,210.35,208.72,210.25,210.37,209.4\n6/17/15 12:00 AM,210.59,211.32,209.36,210.59,210.37,209.48\n6/18/15 12:00 AM,211.31,213.34,211.17,212.78,210.41,209.74\n6/19/15 12:00 AM,211.46,211.55,210.36,210.81,210.42,210.04\n6/22/15 12:00 AM,211.9,212.59,211.64,211.89,210.45,210.14\n6/23/15 12:00 AM,212.14,212.44,211.57,212.04,210.47,210.1\n6/24/15 12:00 AM,211.72,212.17,210.47,210.5,210.49,210.19\n6/25/15 12:00 AM,211.1,211.25,209.77,209.86,210.49,210.53\n6/26/15 12:00 AM,210.29,210.58,209.16,209.82,210.45,210.53\n6/29/15 12:00 AM,208.04,208.82,205.33,205.42,210.26,210.16\n6/30/15 12:00 AM,207.26,207.32,205.28,205.85,210.1,209.78\n7/1/15 12:00 AM,207.73,208.03,206.56,207.5,209.97,209.52\n7/2/15 12:00 AM,208.07,208.27,206.81,207.31,209.85,209.25\n7/6/15 12:00 AM,205.77,207.65,205.53,206.72,209.67,208.86\n7/7/15 12:00 AM,206.96,208.17,204.11,208.02,209.24,208\n7/8/15 12:00 AM,206.42,206.76,204.25,204.53,208.14,205.78\n7/9/15 12:00 AM,207.04,207.35,204.77,204.9,206.06,201.67\n7/10/15 12:00 AM,207.29,207.98,206.49,207.48,206.25,202.23\n7/13/15 12:00 AM,208.99,209.9,208.94,209.77,206.42,202.75\n7/14/15 12:00 AM,209.72,211.05,209.65,210.68,206.55,203.13\n7/15/15 12:00 AM,210.73,211.28,210.04,210.61,206.66,203.47\n7/16/15 12:00 AM,211.87,212.3,211.58,212.3,206.75,203.84\n7/17/15 12:00 AM,212.29,212.55,211.8,212.48,206.85,204.46\n7/20/15 12:00 AM,212.75,213.18,212.21,212.59,207.07,206.01\n7/21/15 12:00 AM,212.43,212.74,211.39,211.75,208.17,210.27\n7/22/15 12:00 AM,210.93,211.77,210.89,211.37,211.33,216.41\n7/23/15 12:00 AM,211.53,211.65,209.75,210.18,210.8,215.18\n7/24/15 12:00 AM,210.3,210.37,207.6,208,210.59,214.63\n7/27/15 12:00 AM,206.94,207.55,206.26,206.79,210.39,214.12\n7/28/15 12:00 AM,207.79,209.5,206.8,209.33,210.32,213.88\n7/29/15 12:00 AM,209.48,211.04,209.31,210.77,210.31,213.77\n7/30/15 12:00 AM,210.16,211.02,209.42,210.82,210.31,213.55\n7/31/15 12:00 AM,211.42,211.45,210.16,210.5,210.32,212.48\n8/3/15 12:00 AM,210.46,210.53,208.65,209.79,210.24,209.15\n8/4/15 12:00 AM,209.7,210.25,208.8,209.38,210.09,209.37\n8/5/15 12:00 AM,210.45,211.31,209.73,210.07,210.11,209.63\n8/6/15 12:00 AM,210.29,210.41,207.65,208.35,210.07,209.75\n8/7/15 12:00 AM,208.16,208.34,206.87,207.95,209.99,209.66\n8/10/15 12:00 AM,209.28,210.67,209.28,210.57,209.99,209.66\n8/11/15 12:00 AM,208.97,209.47,207.76,208.67,209.95,209.59\n8/12/15 12:00 AM,207.11,209.14,205.36,208.92,209.89,209.46\n8/13/15 12:00 AM,208.73,209.55,208.01,208.66,209.87,209.5\n8/14/15 12:00 AM,208.43,209.51,208.26,209.42,209.85,209.62\n8/17/15 12:00 AM,208.71,210.59,208.16,210.59,209.84,209.57\n8/18/15 12:00 AM,210.26,210.68,209.7,209.98,209.85,209.63\n8/19/15 12:00 AM,209.09,210.01,207.35,208.32,209.81,209.62\n8/20/15 12:00 AM,206.51,207.17,203.9,203.97,209.52,209.05\n8/21/15 12:00 AM,201.73,202.92,197.52,197.63,207.65,205.36\n8/24/15 12:00 AM,187.28,195.84,182.95,189.55,201.82,193.75\n8/25/15 12:00 AM,195.43,195.45,186.92,187.27,198.42,186.97\n8/26/15 12:00 AM,192.08,194.79,188.37,194.46,196.24,182.62\n8/27/15 12:00 AM,197.02,199.42,195.21,199.27,196.57,183.31\n8/28/15 12:00 AM,198.5,199.84,197.92,199.28,197.4,184.94\n8/31/15 12:00 AM,198.11,199.13,197.01,197.67,197.84,185.87\n9/1/15 12:00 AM,193.12,194.77,190.73,191.77,192.75,175.98\n9/2/15 12:00 AM,194.62,195.46,192.42,195.41,193.45,179.24\n9/3/15 12:00 AM,196.26,198.05,194.96,195.55,193.69,185.56\n9/4/15 12:00 AM,192.85,193.86,191.61,192.59,193.59,188.77\n9/8/15 12:00 AM,195.94,197.61,195.17,197.43,194.02,191.8\n9/9/15 12:00 AM,199.32,199.47,194.35,194.79,194.46,192.34\n9/10/15 12:00 AM,194.56,197.22,194.25,195.85,194.66,191.92\n9/11/15 12:00 AM,195.38,196.82,194.53,196.74,194.79,191.74\n9/14/15 12:00 AM,196.95,197.01,195.43,196.01,194.95,197.14\n9/15/15 12:00 AM,196.61,198.99,195.96,198.46,195.15,196.85\n9/16/15 12:00 AM,198.82,200.41,198.41,200.18,195.33,196.97\n9/17/15 12:00 AM,200.02,202.89,199.28,199.73,195.99,198.39\n9/18/15 12:00 AM,195.71,197.56,194.96,195.45,196.01,198.01\n9/21/15 12:00 AM,196.44,197.68,195.21,196.46,196.05,197.64\n9/22/15 12:00 AM,193.88,194.46,192.56,193.91,195.92,197.18\n9/23/15 12:00 AM,194.11,194.67,192.91,193.6,195.81,196.84\n9/24/15 12:00 AM,192.15,193.45,190.56,192.9,195.67,196.39\n9/25/15 12:00 AM,194.64,195,191.81,192.85,195.58,196.02\n9/28/15 12:00 AM,191.78,191.91,187.64,188.01,195.3,195.27\n9/29/15 12:00 AM,188.27,189.74,186.93,188.12,193.39,190.78\n9/30/15 12:00 AM,190.37,191.82,189.44,191.63,192.63,189.25\n10/1/15 12:00 AM,192.08,192.49,189.82,192.13,191.54,187.04\n10/2/15 12:00 AM,189.77,195.03,189.12,195,191.75,187.57\n10/5/15 12:00 AM,196.46,198.74,196.33,198.47,192.41,189\n10/6/15 12:00 AM,198.31,198.98,197,197.79,192.74,189.82\n10/7/15 12:00 AM,198.9,199.82,197.48,199.41,193.03,190.47\n10/8/15 12:00 AM,198.95,201.55,198.59,201.21,193.14,190.97\n10/9/15 12:00 AM,201.38,201.9,200.58,201.33,193.54,193.69\n10/12/15 12:00 AM,201.42,201.76,200.91,201.52,193.93,195.22\n10/13/15 12:00 AM,200.65,202.16,200.05,200.25,194.75,197.96\n10/14/15 12:00 AM,200.18,200.87,198.94,199.29,199.91,208.06\n10/15/15 12:00 AM,200.08,202.36,199.64,202.35,200.44,208.48\n10/16/15 12:00 AM,202.83,203.29,201.92,203.27,201.65,210.56\n10/19/15 12:00 AM,202.5,203.37,202.13,203.37,202.33,211.64\n10/20/15 12:00 AM,202.85,203.84,202.55,203.09,202.66,212.19\n10/21/15 12:00 AM,203.61,203.79,201.65,201.85,202.68,211.82\n10/22/15 12:00 AM,202.98,205.51,201.85,205.26,203.01,212.1\n10/23/15 12:00 AM,207.25,207.95,206.3,207.51,204.46,214.16\n10/26/15 12:00 AM,207.3,207.37,206.56,207,205.14,210.37\n10/27/15 12:00 AM,206.2,207,205.79,206.6,205.97,211.49\n10/28/15 12:00 AM,207,208.98,206.21,208.95,206.64,211.63\n10/29/15 12:00 AM,208.35,209.27,208.21,208.83,207.42,212.51\n10/30/15 12:00 AM,209.06,209.44,207.74,207.93,207.75,212.84\n11/2/15 12:00 AM,208.32,210.62,208.17,210.39,208.33,213.98\n11/3/15 12:00 AM,209.97,211.66,209.7,211,210.68,218.35\n11/4/15 12:00 AM,211.35,211.5,209.72,210.36,210.66,216.86\n11/5/15 12:00 AM,210.43,210.98,209.09,210.15,210.45,215.76\n11/6/15 12:00 AM,209.74,210.32,208.46,210.04,210.08,214.2\n11/9/15 12:00 AM,209.31,209.49,206.95,208.08,209.54,212.43\n11/10/15 12:00 AM,207.51,208.6,207.19,208.56,209.12,210.83\n11/11/15 12:00 AM,208.88,208.94,207.66,207.74,208.94,210.12\n11/12/15 12:00 AM,206.5,207.06,204.82,204.84,208.8,209.27\n11/13/15 12:00 AM,204.35,204.67,202.43,202.54,208.58,206.49\n11/16/15 12:00 AM,202.32,205.69,202.18,205.62,208.33,206\n11/17/15 12:00 AM,205.99,207.04,204.88,205.47,208.15,205.85\n11/18/15 12:00 AM,206.04,208.9,205.99,208.73,208.05,206.02\n11/19/15 12:00 AM,208.59,209.05,208.2,208.55,208.2,206.87\n11/20/15 12:00 AM,209.45,210.12,208.86,209.31,208.39,207.66\n11/23/15 12:00 AM,209.38,209.98,208.52,209.07,208.52,208.1\n11/24/15 12:00 AM,207.87,209.83,207.41,209.35,208.52,208.25\n11/25/15 12:00 AM,209.5,209.74,209.01,209.32,208.54,208.5\n11/27/15 12:00 AM,209.43,209.8,208.86,209.56,208.58,208.83\n11/30/15 12:00 AM,209.75,209.89,208.56,208.69,208.62,209.09\n12/1/15 12:00 AM,209.44,210.82,209.11,210.68,208.94,209.83\n12/2/15 12:00 AM,210.62,211,208.23,208.53,209.16,210.11\n12/3/15 12:00 AM,208.83,209.15,204.75,205.61,209.06,209.73\n12/4/15 12:00 AM,206.08,209.97,205.93,209.62,209.02,209.51\n12/7/15 12:00 AM,209.23,209.73,207.2,208.35,208.99,209.46\n12/8/15 12:00 AM,206.49,208.29,205.78,206.95,208.91,209.28\n12/9/15 12:00 AM,206.19,208.68,204.18,205.34,208.85,209.13\n12/10/15 12:00 AM,205.42,207.43,205.14,205.87,208.74,208.87\n12/11/15 12:00 AM,203.35,204.14,201.51,201.88,207.97,207\n12/14/15 12:00 AM,202.07,203.05,199.95,202.9,206.35,203.54\n12/15/15 12:00 AM,204.7,206.11,204.54,205.03,206.27,203.47\n12/16/15 12:00 AM,206.37,208.39,204.8,208.03,206.3,203.58\n12/17/15 12:00 AM,208.4,208.48,204.84,204.86,206.34,203.7\n12/18/15 12:00 AM,202.77,202.93,199.83,200.02,205.67,202.44\n12/21/15 12:00 AM,201.41,201.88,200.09,201.67,205.13,201.41\n12/22/15 12:00 AM,202.71,203.85,201.55,203.5,204.85,200.96\n12/23/15 12:00 AM,204.69,206.07,204.58,206.02,204.87,201.77\n12/24/15 12:00 AM,205.72,206.33,205.42,205.68,204.89,203.43\n12/28/15 12:00 AM,204.86,205.26,203.94,205.21,204.88,203.5\n12/29/15 12:00 AM,206.51,207.79,206.47,207.4,204.92,203.54\n12/30/15 12:00 AM,207.11,207.21,205.76,205.93,204.94,203.54\n12/31/15 12:00 AM,205.13,205.89,203.87,203.87,204.94,204.21\n1/4/16 12:00 AM,200.49,201.03,198.59,201.02,204.84,204.55\n1/5/16 12:00 AM,201.4,201.9,200.05,201.36,204.76,204.68\n1/6/16 12:00 AM,198.34,200.06,197.6,198.82,204.61,204.35\n1/7/16 12:00 AM,195.33,197.44,193.59,194.05,204.08,203.27\n1/8/16 12:00 AM,195.19,195.85,191.58,191.92,203.28,201.67\n1/11/16 12:00 AM,193.01,193.41,189.82,192.11,202,199.08\n1/12/16 12:00 AM,193.82,194.55,191.14,193.66,200.67,196.4\n1/13/16 12:00 AM,194.45,194.86,188.38,188.83,195.66,186.38\n1/14/16 12:00 AM,189.55,193.26,187.66,191.93,193.77,182.69\n1/15/16 12:00 AM,186.77,188.76,185.52,187.81,189.43,174.1\n1/19/16 12:00 AM,189.96,190.11,186.2,188.06,188.16,171.7\n1/20/16 12:00 AM,185.03,187.49,181.02,185.65,185.88,167.68\n1/21/16 12:00 AM,186.21,188.87,184.64,186.69,186.28,169.29\n1/22/16 12:00 AM,189.78,190.76,188.88,190.52,187.38,172.77\n1/25/16 12:00 AM,189.92,190.15,187.41,187.64,187.79,174.92\n1/26/16 12:00 AM,188.42,190.53,188.02,190.2,188.16,180.66\n1/27/16 12:00 AM,189.58,191.56,187.06,188.13,188.53,183.29\n1/28/16 12:00 AM,189.96,190.2,187.16,189.11,188.55,187.68\n1/29/16 12:00 AM,190.02,193.88,189.88,193.72,188.77,189.39\n2/1/16 12:00 AM,192.53,194.58,191.84,193.65,188.92,191.96\n2/2/16 12:00 AM,191.96,191.97,189.54,190.16,189.02,191.76\n2/3/16 12:00 AM,191.41,191.78,187.1,191.3,189.05,190.71\n2/4/16 12:00 AM,190.71,192.75,189.96,191.6,189.17,190.56\n2/5/16 12:00 AM,190.99,191.67,187.2,187.95,189.2,190.23\n2/8/16 12:00 AM,185.77,186.12,182.8,185.42,189.02,189.52\n2/9/16 12:00 AM,183.36,186.94,183.2,185.43,188.88,189.2\n2/10/16 12:00 AM,186.41,188.34,185.12,185.27,188.84,188.9\n2/11/16 12:00 AM,182.34,184.1,181.09,182.86,188.56,188.21\n2/12/16 12:00 AM,184.96,186.65,183.96,186.63,188.25,187.47\n2/16/16 12:00 AM,188.77,189.81,187.63,189.78,188.29,187.54\n2/17/16 12:00 AM,191.16,193.32,191.01,192.88,188.6,188.03\n2/18/16 12:00 AM,193.2,193.27,191.72,192.09,188.91,188.63\n2/19/16 12:00 AM,191.17,192.18,190.45,192,188.96,188.91\n2/22/16 12:00 AM,193.87,194.95,193.79,194.78,189.06,189.23\n2/23/16 12:00 AM,194,194.32,192.18,192.32,189.13,189.42\n2/24/16 12:00 AM,190.63,193.53,189.32,193.2,189.21,189.87\n2/25/16 12:00 AM,193.73,195.55,192.83,195.54,189.88,191.51\n2/26/16 12:00 AM,196.57,196.68,194.9,195.09,191.46,194.63\n2/29/16 12:00 AM,195.11,196.23,193.33,193.56,192.19,195.78\n3/1/16 12:00 AM,195.01,198.21,194.45,198.11,193.22,197.52\n3/2/16 12:00 AM,197.74,199.06,197.25,199,194.52,200.07\n3/3/16 12:00 AM,198.79,199.79,198.11,199.77,195.29,201.53\n3/4/16 12:00 AM,200.01,201.35,199.03,200.43,196.25,203.38\n3/7/16 12:00 AM,199.34,201.07,199.25,200.59,198.07,206.93\n3/8/16 12:00 AM,199.32,199.92,198.21,198.4,198.44,207\n3/9/16 12:00 AM,199.36,199.79,198.43,199.38,198.57,205.68\n3/10/16 12:00 AM,199.96,201.07,197.38,199.54,198.78,205.38\n3/11/16 12:00 AM,201.26,202.81,201.12,202.76,200.8,208.38\n3/14/16 12:00 AM,202.16,203.04,201.77,202.5,201.55,208.57\n3/15/16 12:00 AM,201.36,202.53,201.05,202.17,201.63,207.97\n3/16/16 12:00 AM,201.6,203.82,201.55,203.34,201.84,207.43\n3/17/16 12:00 AM,203.24,205.23,202.77,204.63,202.18,206.29\n3/18/16 12:00 AM,204.17,204.78,203.8,204.38,202.49,206.55\n3/21/16 12:00 AM,204.07,204.94,203.8,204.67,202.77,206.97\n3/22/16 12:00 AM,203.76,205.23,203.57,204.56,204.13,209.47\n3/23/16 12:00 AM,204.11,204.33,203.01,203.21,204.01,207.21\n3/24/16 12:00 AM,202,203.16,201.74,203.12,203.66,205.77\n3/28/16 12:00 AM,203.61,203.86,202.71,203.24,203.54,205.45\n3/29/16 12:00 AM,202.76,205.25,202.4,205.12,203.6,205.36\n3/30/16 12:00 AM,206.3,206.87,205.59,206.02,203.93,205.68\n3/31/16 12:00 AM,205.91,206.41,205.33,205.52,204.17,205.85\n4/1/16 12:00 AM,204.35,207.14,203.98,206.92,204.36,205.94\n4/4/16 12:00 AM,206.83,207.07,205.89,206.25,204.46,204.79\n4/5/16 12:00 AM,204.67,205.26,203.89,204.19,204.47,204.93\n4/6/16 12:00 AM,204.29,206.49,203.98,206.42,204.53,205.39\n4/7/16 12:00 AM,205.14,205.56,203.09,203.95,204.51,205.49\n4/8/16 12:00 AM,205.34,205.85,203.87,204.5,204.55,205.5\n4/11/16 12:00 AM,205.25,206.07,203.91,204.02,204.56,205.2\n4/12/16 12:00 AM,204.22,206.25,203.7,205.92,204.58,204.98\n4/13/16 12:00 AM,207,208.1,206.84,208,204.69,205.02\n4/14/16 12:00 AM,208.07,208.6,207.6,208.01,204.84,205.23\n4/15/16 12:00 AM,208.01,208.17,207.4,207.78,204.98,205.49\n4/18/16 12:00 AM,207.14,209.28,207,209.24,205.12,205.72\n4/19/16 12:00 AM,209.74,210.2,208.94,209.9,205.52,206.52\n4/20/16 12:00 AM,209.95,210.92,209.39,210.1,205.93,207.31\n4/21/16 12:00 AM,210.12,210.25,208.65,208.97,206.25,207.93\n4/22/16 12:00 AM,208.55,209.29,207.91,208.97,208.08,211.58\n4/25/16 12:00 AM,208.26,208.66,207.54,208.61,208.09,211.49\n4/26/16 12:00 AM,209.04,209.52,208.36,208.92,208.34,211.83\n4/27/16 12:00 AM,208.47,209.81,208.05,209.35,208.51,212.04\n4/28/16 12:00 AM,208.46,209.76,206.96,207.45,208.48,211.84\n4/29/16 12:00 AM,206.72,207.13,205.03,206.33,208.42,211.31\n5/2/16 12:00 AM,206.92,208.18,206.41,207.97,208.39,210.84\n5/3/16 12:00 AM,206.52,206.8,205.28,206.16,208.3,210.36\n5/4/16 12:00 AM,204.99,205.85,204.42,205.01,208.04,208.01\n5/5/16 12:00 AM,205.56,205.98,204.47,204.97,207.78,207.48\n5/6/16 12:00 AM,204.06,205.77,203.88,205.72,207.47,206.6\n5/9/16 12:00 AM,205.57,206.4,205.36,205.89,207.29,206.07\n5/10/16 12:00 AM,206.72,208.5,206.64,208.45,207.36,206.25\n5/11/16 12:00 AM,207.91,208.54,206.5,206.5,207.38,206.33\n5/12/16 12:00 AM,207.29,207.49,205.37,206.56,207.32,206.26\n5/13/16 12:00 AM,206.21,206.86,204.38,204.76,207.25,206.19\n5/16/16 12:00 AM,204.96,207.34,204.89,206.78,207.21,206.38\n5/17/16 12:00 AM,206.46,206.8,204.23,204.85,207.16,206.54\n5/18/16 12:00 AM,204.44,206.3,203.63,204.91,207.11,206.75\n5/19/16 12:00 AM,204.06,204.54,202.78,204.2,206.99,206.7\n5/20/16 12:00 AM,204.92,206.1,204.86,205.49,206.96,206.56\n5/23/16 12:00 AM,205.51,205.84,204.99,205.21,206.9,206.43\n5/24/16 12:00 AM,206.17,208.24,206.14,207.87,206.91,206.49\n5/25/16 12:00 AM,208.67,209.71,207.87,209.31,206.97,206.69"
  },
  {
    "path": "Tests/TestData/fxVolumeDaily.csv",
    "content": "DateTime,Volume,Transactions\n2016/12/01 22:00,2045901566,97050\n2016/12/04 22:00,4109991784,195875\n2016/12/05 22:00,2301618048,115758\n2016/12/06 22:00,1606659144,74669\n2016/12/07 22:00,4142546458,195041\n2016/12/08 22:00,2552299292,104716\n2016/12/11 22:00,2420655324,105286\n2016/12/12 22:00,1888545800,91233\n2016/12/13 22:00,3151027026,138839\n2016/12/14 22:00,4094667634,178175\n2016/12/15 22:00,3021441784,119145\n2016/12/18 22:00,2552569954,114099\n2016/12/19 22:00,2360646506,102270\n2016/12/20 22:00,1918644342,91534\n2016/12/21 22:00,2573087000,105481\n2016/12/22 22:00,1306376720,52878\n2016/12/25 22:00,2000,2\n2016/12/26 22:00,792686574,35259\n2016/12/27 22:00,2181320664,93452\n2016/12/28 22:00,2191936370,102841\n2016/12/29 22:00,3076418880,135204\n2017/01/01 22:00,6000,6\n2017/01/02 22:00,3209752870,136777\n2017/01/03 22:00,3067769552,117197\n2017/01/04 22:00,4453651325,163380\n2017/01/05 22:00,2931998367,116768\n2017/01/08 22:00,2523705200,98201\n2017/01/09 22:00,2470177042,105402\n2017/01/10 22:00,4176617782,178936\n2017/01/11 22:00,3507820620,138193\n2017/01/12 22:00,2978389400,114335\n2017/01/15 22:00,1752524888,72886\n2017/01/16 22:00,2906935800,125705\n2017/01/17 22:00,2471073600,99500\n2017/01/18 22:00,3190365322,138721\n2017/01/19 22:00,2626045114,111855\n2017/01/22 22:00,2711941134,118567\n2017/01/23 22:00,2171555382,94518\n2017/01/24 22:00,2229093476,95746\n2017/01/25 22:00,2702642830,118931\n2017/01/26 22:00,1805612600,85679\n2017/01/29 22:00,2679778520,122577\n2017/01/30 22:00,3329527204,134306\n"
  },
  {
    "path": "Tests/TestData/fxVolumeHourly.csv",
    "content": "DateTime,Volume,Transactions\n2014/12/24 00:00,57510000,2022\n2014/12/24 01:00,92236000,2313\n2014/12/24 02:00,135359000,3730\n2014/12/24 03:00,43785000,1320\n2014/12/24 04:00,51472000,1541\n2014/12/24 05:00,49319000,992\n2014/12/24 06:00,48097000,1215\n2014/12/24 07:00,32574000,1471\n2014/12/24 08:00,44505000,1418\n2014/12/24 09:00,17730000,784\n2014/12/24 10:00,13004000,545\n2014/12/24 11:00,12294000,427\n2014/12/24 12:00,23261000,513\n2014/12/24 13:00,43089000,1417\n2014/12/24 14:00,62355000,1131\n2014/12/24 15:00,42173000,833\n2014/12/24 16:00,52447000,1154\n2014/12/24 17:00,18347000,325\n2014/12/24 18:00,13406000,328\n2014/12/24 19:00,42000,4\n2014/12/24 20:00,0,0\n2014/12/24 21:00,0,0\n2014/12/24 22:00,555000,2\n2014/12/24 23:00,0,0\n2014/12/25 00:00,0,0\n2014/12/25 01:00,0,0\n2014/12/25 02:00,0,0\n2014/12/25 03:00,0,0\n2014/12/25 04:00,0,0\n2014/12/25 05:00,0,0\n2014/12/25 06:00,0,0\n2014/12/25 07:00,0,0\n2014/12/25 08:00,0,0\n2014/12/25 09:00,0,0\n2014/12/25 10:00,0,0\n2014/12/25 11:00,0,0\n2014/12/25 12:00,0,0\n2014/12/25 13:00,0,0\n2014/12/25 14:00,0,0\n2014/12/25 15:00,0,0\n2014/12/25 16:00,0,0\n2014/12/25 17:00,0,0\n2014/12/25 18:00,0,0\n2014/12/25 19:00,0,0\n2014/12/25 20:00,0,0\n2014/12/25 21:00,0,0\n2014/12/25 22:00,555000,2\n2014/12/25 23:00,0,0\n2014/12/26 00:00,0,0\n2014/12/26 01:00,0,0\n2014/12/26 02:00,0,0\n2014/12/26 03:00,0,0\n2014/12/26 04:00,0,0\n2014/12/26 05:00,0,0\n2014/12/26 06:00,58607000,2284\n2014/12/26 07:00,27117000,1553\n2014/12/26 08:00,31280000,923\n2014/12/26 09:00,20953000,544\n2014/12/26 10:00,15495000,533\n2014/12/26 11:00,17525000,328\n2014/12/26 12:00,8966000,435\n2014/12/26 13:00,30856000,884\n2014/12/26 14:00,57845000,1855\n2014/12/26 15:00,112263000,1110\n2014/12/26 16:00,96142000,576\n2014/12/26 17:00,177952000,350\n2014/12/26 18:00,142543000,681\n2014/12/26 19:00,54000000,382\n2014/12/26 20:00,12439000,288\n2014/12/26 21:00,6548000,292\n2014/12/28 22:00,24512000,906\n2014/12/28 23:00,21384000,827\n2014/12/29 00:00,30190000,1276\n2014/12/29 01:00,86042000,2440\n2014/12/29 02:00,59406000,1424\n2014/12/29 03:00,68449000,1037\n2014/12/29 04:00,81264000,2905\n2014/12/29 05:00,65202000,3392\n2014/12/29 06:00,43757000,988\n2014/12/29 07:00,40518000,1081\n2014/12/29 08:00,51256000,1176\n2014/12/29 09:00,69527000,1189\n2014/12/29 10:00,56028000,1000\n2014/12/29 11:00,50076000,1164\n2014/12/29 12:00,30510000,866\n2014/12/29 13:00,41097000,900\n2014/12/29 14:00,118622000,4072\n2014/12/29 15:00,88847000,1961\n2014/12/29 16:00,57284000,1531\n2014/12/29 17:00,41729000,1194\n2014/12/29 18:00,83071000,1956\n2014/12/29 19:00,180336000,929\n2014/12/29 20:00,108323000,837\n2014/12/29 21:00,48300000,940\n2014/12/29 22:00,20473000,724\n2014/12/29 23:00,17219000,753\n2014/12/30 00:00,63724000,1474\n2014/12/30 01:00,103055000,2735\n2014/12/30 02:00,53410000,1105\n2014/12/30 03:00,27517000,1181\n2014/12/30 04:00,55324000,1961\n2014/12/30 05:00,22109000,774\n2014/12/30 06:00,99006000,4192\n2014/12/30 07:00,333803000,11271\n2014/12/30 08:00,394720000,10838\n2014/12/30 09:00,194015000,2845\n2014/12/30 10:00,116320000,2992\n2014/12/30 11:00,129374000,3028\n2014/12/30 12:00,141488000,3033\n2014/12/30 13:00,124982000,2852\n2014/12/30 14:00,347314000,9765\n2014/12/30 15:00,283659000,8814\n2014/12/30 16:00,108928000,2901\n2014/12/30 17:00,72228000,1867\n2014/12/30 18:00,218609000,2334\n2014/12/30 19:00,54365000,1284\n2014/12/30 20:00,33518000,708\n2014/12/30 21:00,42367000,1027\n2014/12/30 22:00,19024000,766\n2014/12/30 23:00,24628000,696\n2014/12/31 00:00,28587000,967\n2014/12/31 01:00,60514000,1890\n2014/12/31 02:00,47061000,1375\n2014/12/31 03:00,42974000,881\n2014/12/31 04:00,43341000,1088\n2014/12/31 05:00,92559000,3246\n2014/12/31 06:00,58133000,1950\n2014/12/31 07:00,61147000,1844\n2014/12/31 08:00,57544000,985\n2014/12/31 09:00,78122000,1411\n2014/12/31 10:00,112634000,1906\n2014/12/31 11:00,59750000,1344\n2014/12/31 12:00,63721000,1712\n2014/12/31 13:00,56857000,1746\n2014/12/31 14:00,103691000,2193\n2014/12/31 15:00,235197000,4736\n2014/12/31 16:00,132206000,2948\n2014/12/31 17:00,47604000,1051\n2014/12/31 18:00,37837000,673\n2014/12/31 19:00,2249000,15\n2014/12/31 20:00,0,0\n2014/12/31 21:00,0,0\n2014/12/31 22:00,2550000,2\n2014/12/31 23:00,143000,4\n2015/01/01 00:00,0,0\n2015/01/01 01:00,0,0\n2015/01/01 02:00,0,0\n2015/01/01 03:00,0,0\n2015/01/01 04:00,0,0\n2015/01/01 05:00,0,0\n2015/01/01 06:00,0,0\n2015/01/01 07:00,0,0\n2015/01/01 08:00,0,0\n2015/01/01 09:00,0,0\n2015/01/01 10:00,0,0\n2015/01/01 11:00,0,0\n2015/01/01 12:00,0,0\n2015/01/01 13:00,0,0\n2015/01/01 14:00,0,0\n2015/01/01 15:00,0,0\n2015/01/01 16:00,0,0\n2015/01/01 17:00,0,0\n2015/01/01 18:00,0,0\n2015/01/01 19:00,0,0\n2015/01/01 20:00,0,0\n2015/01/01 21:00,0,0\n2015/01/01 22:00,733000,6\n2015/01/01 23:00,0,0\n2015/01/02 00:00,0,0\n2015/01/02 01:00,0,0\n2015/01/02 02:00,0,0\n2015/01/02 03:00,0,0\n2015/01/02 04:00,0,0\n2015/01/02 05:00,0,0\n2015/01/02 06:00,163103000,5430\n2015/01/02 07:00,103836000,2624\n2015/01/02 08:00,73772000,1766\n2015/01/02 09:00,71140000,1597\n2015/01/02 10:00,55444000,1159\n2015/01/02 11:00,31780000,1005\n2015/01/02 12:00,108965000,3277\n2015/01/02 13:00,64658000,1875\n2015/01/02 14:00,111615000,3407\n2015/01/02 15:00,337371000,9001\n2015/01/02 16:00,268716000,5891\n2015/01/02 17:00,117587000,3093\n2015/01/02 18:00,33311000,1210\n2015/01/02 19:00,38195000,947\n2015/01/02 20:00,41136000,1624\n2015/01/02 21:00,23786000,810\n2015/01/04 22:00,66127000,2504\n2015/01/04 23:00,67729000,1968\n2015/01/05 00:00,171614000,5994\n2015/01/05 01:00,101684000,3218\n2015/01/05 02:00,73721000,1777\n2015/01/05 03:00,95610000,3155\n2015/01/05 04:00,87929000,2037\n2015/01/05 05:00,96035000,2059\n2015/01/05 06:00,159846000,1886\n2015/01/05 07:00,190334000,2146\n2015/01/05 08:00,144043000,2061\n2015/01/05 09:00,127659000,2347\n2015/01/05 10:00,88813000,1810\n2015/01/05 11:00,171951000,2162\n2015/01/05 12:00,186379000,3870\n2015/01/05 13:00,271264000,8530\n2015/01/05 14:00,348319000,9228\n2015/01/05 15:00,282171000,5806\n2015/01/05 16:00,197738000,3867\n2015/01/05 17:00,116394000,2232\n2015/01/05 18:00,78600000,1630\n2015/01/05 19:00,87690000,1738\n2015/01/05 20:00,68414000,1214\n2015/01/05 21:00,27858000,591\n2015/01/05 22:00,77419000,2814\n2015/01/05 23:00,58071000,1810"
  },
  {
    "path": "Tests/TestData/fxVolumeMinute.csv",
    "content": "DateTime,Volume,Transactions\n2012/11/23 00:00,754000,35\n2012/11/23 00:01,10117000,28\n2012/11/23 00:02,3690000,20\n2012/11/23 00:03,2871000,68\n2012/11/23 00:04,1222000,69\n2012/11/23 00:05,709000,25\n2012/11/23 00:06,208000,10\n2012/11/23 00:07,387000,15\n2012/11/23 00:08,416000,12\n2012/11/23 00:09,337000,15\n2012/11/23 00:10,271000,14\n2012/11/23 00:11,342000,18\n2012/11/23 00:12,205000,14\n2012/11/23 00:13,431000,19\n2012/11/23 00:14,214000,47\n2012/11/23 00:15,324000,48\n2012/11/23 00:16,1068000,38\n2012/11/23 00:17,741000,28\n2012/11/23 00:18,163000,14\n2012/11/23 00:19,583000,23\n2012/11/23 00:20,283000,20\n2012/11/23 00:21,1573000,19\n2012/11/23 00:22,116000,6\n2012/11/23 00:23,142000,16\n2012/11/23 00:24,202000,21\n2012/11/23 00:25,210000,14\n2012/11/23 00:26,86000,16\n2012/11/23 00:27,187000,18\n2012/11/23 00:28,337000,12\n2012/11/23 00:29,143000,25\n2012/11/23 00:30,439000,34\n2012/11/23 00:31,188000,15\n2012/11/23 00:32,162000,19\n2012/11/23 00:33,250000,20\n2012/11/23 00:34,137000,8\n2012/11/23 00:35,90000,6\n2012/11/23 00:36,1187000,20\n2012/11/23 00:37,64000,8\n2012/11/23 00:38,109000,12\n2012/11/23 00:39,165000,18\n2012/11/23 00:40,488000,15\n2012/11/23 00:41,101000,8\n2012/11/23 00:42,193000,14\n2012/11/23 00:43,41000,6\n2012/11/23 00:44,1000,1\n2012/11/23 00:45,585000,23\n2012/11/23 00:46,175000,12\n2012/11/23 00:47,174000,10\n2012/11/23 00:48,1116000,15\n2012/11/23 00:49,659000,12\n2012/11/23 00:50,769000,13\n2012/11/23 00:51,1737000,39\n2012/11/23 00:52,752000,19\n2012/11/23 00:53,595000,47\n2012/11/23 00:54,317000,36\n2012/11/23 00:55,2185000,75\n2012/11/23 00:56,90000,18\n2012/11/23 00:57,736000,71\n2012/11/23 00:58,145000,9\n2012/11/23 00:59,917000,61\n2012/11/23 01:00,1279000,54\n2012/11/23 01:01,310000,23\n2012/11/23 01:02,412000,28\n2012/11/23 01:03,250000,13\n2012/11/23 01:04,153000,12\n2012/11/23 01:05,27000,10\n2012/11/23 01:06,79000,11\n2012/11/23 01:07,56000,7\n2012/11/23 01:08,238000,18\n2012/11/23 01:09,68000,9\n2012/11/23 01:10,443000,13\n2012/11/23 01:11,57000,9\n2012/11/23 01:12,59000,10\n2012/11/23 01:13,95000,12\n2012/11/23 01:14,82000,6\n2012/11/23 01:15,238000,11\n2012/11/23 01:16,37000,7\n2012/11/23 01:17,111000,10\n2012/11/23 01:18,37000,4\n2012/11/23 01:19,3000,3\n2012/11/23 01:20,139000,9\n2012/11/23 01:21,331000,22\n2012/11/23 01:22,585000,9\n2012/11/23 01:23,75000,15\n2012/11/23 01:24,152000,14\n2012/11/23 01:25,188000,21\n2012/11/23 01:26,551000,63\n2012/11/23 01:27,642000,29\n2012/11/23 01:28,584000,24\n2012/11/23 01:29,433000,41\n2012/11/23 01:30,1188000,45\n2012/11/23 01:31,220000,19\n2012/11/23 01:32,1538000,38\n2012/11/23 01:33,223000,20\n2012/11/23 01:34,460000,32\n2012/11/23 01:35,67000,13\n2012/11/23 01:36,140000,26\n2012/11/23 01:37,320000,4\n2012/11/23 01:38,278000,24\n2012/11/23 01:39,781000,21\n2012/11/23 01:40,430000,43\n2012/11/23 01:41,170000,19\n2012/11/23 01:42,87000,10\n2012/11/23 01:43,128000,11\n2012/11/23 01:44,61000,12\n2012/11/23 01:45,574000,22\n2012/11/23 01:46,99000,8\n2012/11/23 01:47,315000,10\n2012/11/23 01:48,369000,17\n2012/11/23 01:49,63000,9\n2012/11/23 01:50,141000,19\n2012/11/23 01:51,118000,13\n2012/11/23 01:52,89000,12\n2012/11/23 01:53,35000,7\n2012/11/23 01:54,33000,8\n2012/11/23 01:55,102000,8\n2012/11/23 01:56,129000,12\n2012/11/23 01:57,411000,13\n2012/11/23 01:58,167000,8\n2012/11/23 01:59,735000,12\n2012/11/23 02:00,14185000,57\n2012/11/23 02:01,3471000,78\n2012/11/23 02:02,2771000,105\n2012/11/23 02:03,1141000,50\n2012/11/23 02:04,406000,34\n2012/11/23 02:05,361000,24\n2012/11/23 02:06,709000,24\n2012/11/23 02:07,89000,10\n2012/11/23 02:08,226000,20\n2012/11/23 02:09,193000,16\n2012/11/23 02:10,343000,6\n2012/11/23 02:11,103000,3\n2012/11/23 02:12,213000,10\n2012/11/23 02:13,363000,33\n2012/11/23 02:14,2428000,76\n2012/11/23 02:15,611000,23\n2012/11/23 02:16,344000,21\n2012/11/23 02:17,228000,33\n2012/11/23 02:18,280000,24\n2012/11/23 02:19,642000,60\n2012/11/23 02:20,825000,62\n2012/11/23 02:21,933000,43\n2012/11/23 02:22,1282000,31\n2012/11/23 02:23,648000,68\n2012/11/23 02:24,129000,18\n2012/11/23 02:25,677000,30\n2012/11/23 02:26,579000,31\n2012/11/23 02:27,198000,22\n2012/11/23 02:28,230000,20\n2012/11/23 02:29,222000,19\n2012/11/23 02:30,427000,22\n2012/11/23 02:31,46000,8\n2012/11/23 02:32,473000,22\n2012/11/23 02:33,1099000,16\n2012/11/23 02:34,397000,15\n2012/11/23 02:35,663000,8\n2012/11/23 02:36,513000,31\n2012/11/23 02:37,102000,21\n2012/11/23 02:38,378000,19\n2012/11/23 02:39,179000,19\n2012/11/23 02:40,449000,29\n2012/11/23 02:41,213000,69\n2012/11/23 02:42,674000,16\n2012/11/23 02:43,194000,16\n2012/11/23 02:44,160000,18\n2012/11/23 02:45,44000,15\n2012/11/23 02:46,377000,10\n2012/11/23 02:47,168000,9\n2012/11/23 02:48,59000,11\n2012/11/23 02:49,886000,18\n2012/11/23 02:50,161000,15\n2012/11/23 02:51,255000,8\n2012/11/23 02:52,90000,12\n2012/11/23 02:53,129000,19\n2012/11/23 02:54,511000,7\n2012/11/23 02:55,343000,10\n2012/11/23 02:56,94000,10\n2012/11/23 02:57,44000,6\n2012/11/23 02:58,416000,11\n2012/11/23 02:59,1038000,7\n2012/11/23 03:00,959000,18\n2012/11/23 03:01,171000,10\n2012/11/23 03:02,60000,7\n2012/11/23 03:03,205000,7\n2012/11/23 03:04,56000,4\n2012/11/23 03:05,11000,6\n2012/11/23 03:06,655000,14\n2012/11/23 03:07,219000,16\n2012/11/23 03:08,353000,11\n2012/11/23 03:09,110000,8\n2012/11/23 03:10,233000,11\n2012/11/23 03:11,250000,8\n2012/11/23 03:12,88000,14\n2012/11/23 03:13,149000,19\n2012/11/23 03:14,217000,24\n2012/11/23 03:15,55000,7\n2012/11/23 03:16,307000,18\n2012/11/23 03:17,316000,21\n2012/11/23 03:18,101000,4\n2012/11/23 03:19,98000,14\n2012/11/23 03:20,378000,46\n2012/11/23 03:21,132000,13\n2012/11/23 03:22,243000,8\n2012/11/23 03:23,202000,13\n2012/11/23 03:24,86000,11\n2012/11/23 03:25,106000,9\n2012/11/23 03:26,62000,8\n2012/11/23 03:27,425000,4\n2012/11/23 03:28,175000,8\n2012/11/23 03:29,420000,9\n2012/11/23 03:30,50000,9\n2012/11/23 03:31,135000,8\n2012/11/23 03:32,381000,26\n2012/11/23 03:33,703000,17\n2012/11/23 03:34,33000,10\n2012/11/23 03:35,267000,16\n2012/11/23 03:36,205000,17\n2012/11/23 03:37,166000,18\n2012/11/23 03:38,80000,12\n2012/11/23 03:39,20000,6\n2012/11/23 03:40,142000,18\n2012/11/23 03:41,189000,8\n2012/11/23 03:42,439000,28\n2012/11/23 03:43,247000,17\n2012/11/23 03:44,116000,15\n2012/11/23 03:45,1930000,35\n2012/11/23 03:46,537000,35\n2012/11/23 03:47,1434000,35\n2012/11/23 03:48,1149000,22\n2012/11/23 03:49,547000,37\n2012/11/23 03:50,66000,10\n2012/11/23 03:51,355000,21\n2012/11/23 03:52,349000,16\n2012/11/23 03:53,55000,10\n2012/11/23 03:54,312000,14\n2012/11/23 03:55,487000,20\n2012/11/23 03:56,51000,11\n2012/11/23 03:57,220000,16\n2012/11/23 03:58,279000,16\n2012/11/23 03:59,109000,13\n2012/11/23 04:00,286000,10\n2012/11/23 04:01,542000,17\n2012/11/23 04:02,592000,26\n2012/11/23 04:03,320000,5\n2012/11/23 04:04,165000,12\n2012/11/23 04:05,91000,13\n2012/11/23 04:06,157000,19\n2012/11/23 04:07,99000,9\n2012/11/23 04:08,229000,11\n2012/11/23 04:09,231000,22\n2012/11/23 04:10,416000,15\n2012/11/23 04:11,98000,8\n2012/11/23 04:12,30000,3\n2012/11/23 04:13,76000,10\n2012/11/23 04:14,32000,15\n2012/11/23 04:15,432000,14\n2012/11/23 04:16,213000,6\n2012/11/23 04:17,214000,10\n2012/11/23 04:18,416000,11\n2012/11/23 04:19,173000,4\n2012/11/23 04:20,124000,8\n2012/11/23 04:21,334000,15\n2012/11/23 04:22,488000,21\n2012/11/23 04:23,264000,16\n2012/11/23 04:24,196000,12\n2012/11/23 04:25,188000,14\n2012/11/23 04:26,847000,13\n2012/11/23 04:27,2242000,11\n2012/11/23 04:28,61000,5\n2012/11/23 04:29,337000,8\n2012/11/23 04:30,363000,22\n2012/11/23 04:31,4497000,155\n2012/11/23 04:32,259000,20\n2012/11/23 04:33,335000,18\n2012/11/23 04:34,188000,13\n2012/11/23 04:35,65000,8\n2012/11/23 04:36,3312000,20\n2012/11/23 04:37,23000,3\n2012/11/23 04:38,68000,5\n2012/11/23 04:39,129000,8\n2012/11/23 04:40,4065000,16\n2012/11/23 04:41,229000,6\n2012/11/23 04:42,304000,16\n2012/11/23 04:43,19000,4\n2012/11/23 04:44,25000,4\n2012/11/23 04:45,247000,7\n2012/11/23 04:46,56000,6\n2012/11/23 04:47,44000,6\n2012/11/23 04:48,29000,4\n2012/11/23 04:49,164000,6\n2012/11/23 04:50,26000,3\n2012/11/23 04:51,27000,4\n2012/11/23 04:52,243000,6\n2012/11/23 04:53,47000,11\n2012/11/23 04:54,143000,10\n2012/11/23 04:55,39000,8\n2012/11/23 04:56,101000,7\n2012/11/23 04:57,45000,11\n2012/11/23 04:58,26000,7\n2012/11/23 04:59,164000,5\n2012/11/23 05:00,182000,13\n2012/11/23 05:01,244000,13\n2012/11/23 05:02,568000,5\n2012/11/23 05:03,903000,16\n2012/11/23 05:04,271000,8\n2012/11/23 05:05,177000,11\n2012/11/23 05:06,75000,10\n2012/11/23 05:07,4024000,13\n2012/11/23 05:08,96000,12\n2012/11/23 05:09,99000,11\n2012/11/23 05:10,153000,17\n2012/11/23 05:11,125000,6\n2012/11/23 05:12,159000,9\n2012/11/23 05:13,180000,9\n2012/11/23 05:14,34000,5\n2012/11/23 05:15,121000,3\n2012/11/23 05:16,37000,8\n2012/11/23 05:17,156000,6\n2012/11/23 05:18,20000,3\n2012/11/23 05:19,94000,10\n2012/11/23 05:20,243000,8\n2012/11/23 05:21,174000,15\n2012/11/23 05:22,125000,17\n2012/11/23 05:23,152000,9\n2012/11/23 05:24,81000,6\n2012/11/23 05:25,123000,5\n2012/11/23 05:26,33000,6\n2012/11/23 05:27,130000,10\n2012/11/23 05:28,126000,8\n2012/11/23 05:29,1196000,32\n2012/11/23 05:30,601000,31\n2012/11/23 05:31,617000,13\n2012/11/23 05:32,3424000,37\n2012/11/23 05:33,52000,10\n2012/11/23 05:34,183000,18\n2012/11/23 05:35,28000,6\n2012/11/23 05:36,34000,6\n2012/11/23 05:37,35000,5\n2012/11/23 05:38,132000,7\n2012/11/23 05:39,177000,5\n2012/11/23 05:40,14000,3\n2012/11/23 05:41,35000,10\n2012/11/23 05:42,53000,6\n2012/11/23 05:43,116000,13\n2012/11/23 05:44,22000,3\n2012/11/23 05:45,129000,7\n2012/11/23 05:46,162000,13\n2012/11/23 05:47,133000,8\n2012/11/23 05:48,62000,9\n2012/11/23 05:49,203000,5\n2012/11/23 05:50,79000,16\n2012/11/23 05:51,48000,11\n2012/11/23 05:52,1045000,11\n2012/11/23 05:53,1317000,9\n2012/11/23 05:54,1415000,16\n2012/11/23 05:55,588000,25\n2012/11/23 05:56,161000,21\n2012/11/23 05:57,72000,7\n2012/11/23 05:58,38000,10\n2012/11/23 05:59,2576000,124\n2012/11/23 06:00,1332000,51\n2012/11/23 06:01,571000,19\n2012/11/23 06:02,928000,46\n2012/11/23 06:03,3614000,49\n2012/11/23 06:04,569000,27\n2012/11/23 06:05,472000,46\n2012/11/23 06:06,693000,27\n2012/11/23 06:07,404000,32\n2012/11/23 06:08,550000,47\n2012/11/23 06:09,199000,17\n2012/11/23 06:10,1031000,12\n2012/11/23 06:11,545000,15\n2012/11/23 06:12,222000,21\n2012/11/23 06:13,9616000,653\n2012/11/23 06:14,5792000,137\n2012/11/23 06:15,18920000,203\n2012/11/23 06:16,3212000,112\n2012/11/23 06:17,1801000,83\n2012/11/23 06:18,813000,49\n2012/11/23 06:19,1446000,69\n2012/11/23 06:20,3029000,264\n2012/11/23 06:21,3613000,129\n2012/11/23 06:22,1501000,57\n2012/11/23 06:23,2154000,95\n2012/11/23 06:24,359000,28\n2012/11/23 06:25,205000,21\n2012/11/23 06:26,763000,19\n2012/11/23 06:27,789000,19\n2012/11/23 06:28,838000,26\n2012/11/23 06:29,2279000,47\n2012/11/23 06:30,229000,29\n2012/11/23 06:31,2945000,84\n2012/11/23 06:32,29840000,501\n2012/11/23 06:33,6556000,82\n2012/11/23 06:34,725000,56\n2012/11/23 06:35,1624000,90\n2012/11/23 06:36,5260000,71\n2012/11/23 06:37,1219000,61\n2012/11/23 06:38,1602000,58\n2012/11/23 06:39,160000,21\n2012/11/23 06:40,489000,29\n2012/11/23 06:41,881000,38\n2012/11/23 06:42,924000,24\n2012/11/23 06:43,341000,50\n2012/11/23 06:44,128000,22\n2012/11/23 06:45,1075000,54\n2012/11/23 06:46,1053000,35\n2012/11/23 06:47,979000,22\n2012/11/23 06:48,562000,23\n2012/11/23 06:49,538000,23\n2012/11/23 06:50,700000,32\n2012/11/23 06:51,421000,51\n2012/11/23 06:52,1742000,79\n2012/11/23 06:53,525000,52\n2012/11/23 06:54,441000,29\n2012/11/23 06:55,609000,36\n2012/11/23 06:56,95000,16\n2012/11/23 06:57,174000,14\n2012/11/23 06:58,251000,24\n2012/11/23 06:59,473000,22\n2012/11/23 07:00,1246000,44\n2012/11/23 07:01,3476000,137\n2012/11/23 07:02,744000,38\n2012/11/23 07:03,453000,29\n2012/11/23 07:04,485000,30\n2012/11/23 07:05,242000,19\n2012/11/23 07:06,1166000,39\n2012/11/23 07:07,609000,48\n2012/11/23 07:08,2070000,91\n2012/11/23 07:09,2393000,111\n2012/11/23 07:10,1081000,58\n2012/11/23 07:11,597000,47\n2012/11/23 07:12,6530000,49\n2012/11/23 07:13,431000,30\n2012/11/23 07:14,4761000,62\n2012/11/23 07:15,1009000,43\n2012/11/23 07:16,433000,17\n2012/11/23 07:17,376000,23\n2012/11/23 07:18,207000,17\n2012/11/23 07:19,1628000,31\n2012/11/23 07:20,4428000,103\n2012/11/23 07:21,696000,30\n2012/11/23 07:22,93000,18\n2012/11/23 07:23,232000,21\n2012/11/23 07:24,1717000,15\n2012/11/23 07:25,224000,16\n2012/11/23 07:26,698000,30\n2012/11/23 07:27,4145000,109\n2012/11/23 07:28,3551000,26\n2012/11/23 07:29,1641000,28\n2012/11/23 07:30,3771000,135\n2012/11/23 07:31,60880000,2347\n2012/11/23 07:32,25816000,980\n2012/11/23 07:33,8680000,226\n2012/11/23 07:34,8183000,148\n2012/11/23 07:35,8847000,157\n2012/11/23 07:36,7051000,113\n2012/11/23 07:37,3846000,104\n2012/11/23 07:38,4210000,78\n2012/11/23 07:39,3280000,156\n2012/11/23 07:40,5635000,125\n2012/11/23 07:41,6193000,128\n2012/11/23 07:42,1154000,54\n2012/11/23 07:43,2882000,85\n2012/11/23 07:44,14842000,98\n2012/11/23 07:45,11634000,201\n2012/11/23 07:46,23381000,149\n2012/11/23 07:47,3101000,33\n2012/11/23 07:48,880000,29\n2012/11/23 07:49,2953000,88\n2012/11/23 07:50,6669000,87\n2012/11/23 07:51,2412000,112\n2012/11/23 07:52,3437000,64\n2012/11/23 07:53,7430000,98\n2012/11/23 07:54,1627000,104\n2012/11/23 07:55,1593000,124\n2012/11/23 07:56,6245000,72\n2012/11/23 07:57,18378000,796\n2012/11/23 07:58,3242000,116\n2012/11/23 07:59,2322000,98\n2012/11/23 08:00,9724000,144\n2012/11/23 08:01,2034000,55\n2012/11/23 08:02,16023000,71\n2012/11/23 08:03,4180000,120\n2012/11/23 08:04,3289000,89\n2012/11/23 08:05,2342000,71\n2012/11/23 08:06,2169000,64\n2012/11/23 08:07,3069000,64\n2012/11/23 08:08,2440000,85\n2012/11/23 08:09,2701000,146\n2012/11/23 08:10,1512000,81\n2012/11/23 08:11,2055000,95\n2012/11/23 08:12,1219000,49\n2012/11/23 08:13,2498000,107\n2012/11/23 08:14,1119000,35\n2012/11/23 08:15,3573000,45\n2012/11/23 08:16,1357000,67\n2012/11/23 08:17,587000,34\n2012/11/23 08:18,3591000,44\n2012/11/23 08:19,13188000,124\n2012/11/23 08:20,3395000,101\n2012/11/23 08:21,9862000,64\n2012/11/23 08:22,2288000,47\n2012/11/23 08:23,1586000,35\n2012/11/23 08:24,2579000,60\n2012/11/23 08:25,17975000,629\n2012/11/23 08:26,19454000,439\n2012/11/23 08:27,8812000,142\n2012/11/23 08:28,8952000,147\n2012/11/23 08:29,2095000,97\n2012/11/23 08:30,9249000,169\n2012/11/23 08:31,5389000,104\n2012/11/23 08:32,3098000,90\n2012/11/23 08:33,2886000,90\n2012/11/23 08:34,6230000,157\n2012/11/23 08:35,29020000,931\n2012/11/23 08:36,31802000,634\n2012/11/23 08:37,11686000,215\n2012/11/23 08:38,4341000,116\n2012/11/23 08:39,9576000,127\n2012/11/23 08:40,8811000,157\n2012/11/23 08:41,2203000,63\n2012/11/23 08:42,878000,65\n2012/11/23 08:43,6783000,95\n2012/11/23 08:44,2912000,55\n2012/11/23 08:45,3179000,73\n2012/11/23 08:46,2551000,40\n2012/11/23 08:47,644000,44\n2012/11/23 08:48,5845000,86\n2012/11/23 08:49,23653000,197\n2012/11/23 08:50,4634000,157\n2012/11/23 08:51,1296000,81\n2012/11/23 08:52,640000,52\n2012/11/23 08:53,6238000,45\n2012/11/23 08:54,3129000,40\n2012/11/23 08:55,1239000,49\n2012/11/23 08:56,5924000,31\n2012/11/23 08:57,3477000,105\n2012/11/23 08:58,5710000,83\n2012/11/23 08:59,790000,46\n2012/11/23 09:00,8022000,100\n2012/11/23 09:01,6298000,82\n2012/11/23 09:02,61770000,1319\n2012/11/23 09:03,30346000,742\n2012/11/23 09:04,15927000,276\n2012/11/23 09:05,26043000,362\n2012/11/23 09:06,6273000,165\n2012/11/23 09:07,34356000,1232\n2012/11/23 09:08,16921000,370\n2012/11/23 09:09,10527000,362\n2012/11/23 09:10,13069000,318\n2012/11/23 09:11,7902000,195\n2012/11/23 09:12,6571000,268\n2012/11/23 09:13,1540000,75\n2012/11/23 09:14,8360000,271\n2012/11/23 09:15,8210000,312\n2012/11/23 09:16,11829000,345\n2012/11/23 09:17,5157000,115\n2012/11/23 09:18,3432000,111\n2012/11/23 09:19,3806000,89\n2012/11/23 09:20,5390000,77\n2012/11/23 09:21,2536000,65\n2012/11/23 09:22,5829000,86\n2012/11/23 09:23,2391000,103\n2012/11/23 09:24,6029000,108\n2012/11/23 09:25,1445000,48\n2012/11/23 09:26,3038000,44\n2012/11/23 09:27,4073000,128\n2012/11/23 09:28,1485000,43\n2012/11/23 09:29,3684000,61\n2012/11/23 09:30,4223000,79\n2012/11/23 09:31,3967000,62\n2012/11/23 09:32,2084000,57\n2012/11/23 09:33,5466000,62\n2012/11/23 09:34,992000,39\n2012/11/23 09:35,286000,22\n2012/11/23 09:36,7262000,107\n2012/11/23 09:37,3288000,80\n2012/11/23 09:38,4914000,154\n2012/11/23 09:39,4771000,75\n2012/11/23 09:40,3861000,50\n2012/11/23 09:41,605000,30\n2012/11/23 09:42,10546000,259\n2012/11/23 09:43,12446000,229\n2012/11/23 09:44,3586000,80\n2012/11/23 09:45,5430000,150\n2012/11/23 09:46,2757000,67\n2012/11/23 09:47,652000,65\n2012/11/23 09:48,286000,34\n2012/11/23 09:49,214000,18\n2012/11/23 09:50,288000,20\n2012/11/23 09:51,23326000,882\n2012/11/23 09:52,10025000,281\n2012/11/23 09:53,5773000,140\n2012/11/23 09:54,2424000,130\n2012/11/23 09:55,1583000,54\n2012/11/23 09:56,4519000,52\n2012/11/23 09:57,371000,34\n2012/11/23 09:58,1155000,44\n2012/11/23 09:59,4093000,122\n2012/11/23 10:00,14173000,235\n2012/11/23 10:01,3921000,95\n2012/11/23 10:02,2546000,38\n2012/11/23 10:03,2986000,50\n2012/11/23 10:04,4853000,72\n2012/11/23 10:05,3741000,105\n2012/11/23 10:06,8246000,101\n2012/11/23 10:07,3316000,38\n2012/11/23 10:08,1178000,25\n2012/11/23 10:09,536000,81\n2012/11/23 10:10,1454000,88\n2012/11/23 10:11,5813000,154\n2012/11/23 10:12,7987000,86\n2012/11/23 10:13,1591000,66\n2012/11/23 10:14,888000,42\n2012/11/23 10:15,1226000,46\n2012/11/23 10:16,1495000,40\n2012/11/23 10:17,889000,37\n2012/11/23 10:18,981000,38\n2012/11/23 10:19,975000,61\n2012/11/23 10:20,419000,30\n2012/11/23 10:21,605000,31\n2012/11/23 10:22,904000,34\n2012/11/23 10:23,5455000,132\n2012/11/23 10:24,4655000,68\n2012/11/23 10:25,5095000,176\n2012/11/23 10:26,6916000,59\n2012/11/23 10:27,952000,32\n2012/11/23 10:28,548000,25\n2012/11/23 10:29,4511000,97\n2012/11/23 10:30,433000,48\n2012/11/23 10:31,1199000,26\n2012/11/23 10:32,946000,73\n2012/11/23 10:33,574000,22\n2012/11/23 10:34,632000,53\n2012/11/23 10:35,353000,29\n2012/11/23 10:36,275000,12\n2012/11/23 10:37,177000,26\n2012/11/23 10:38,4924000,36\n2012/11/23 10:39,1075000,44\n2012/11/23 10:40,280000,32\n2012/11/23 10:41,565000,34\n2012/11/23 10:42,201000,27\n2012/11/23 10:43,645000,25\n2012/11/23 10:44,1237000,43\n2012/11/23 10:45,823000,18\n2012/11/23 10:46,656000,31\n2012/11/23 10:47,449000,25\n2012/11/23 10:48,139000,16\n2012/11/23 10:49,235000,22\n2012/11/23 10:50,665000,23\n2012/11/23 10:51,1227000,24\n2012/11/23 10:52,1430000,44\n2012/11/23 10:53,3565000,51\n2012/11/23 10:54,1162000,40\n2012/11/23 10:55,2298000,22\n2012/11/23 10:56,943000,33\n2012/11/23 10:57,223000,14\n2012/11/23 10:58,300000,32\n2012/11/23 10:59,699000,34\n2012/11/23 11:00,12975000,75\n2012/11/23 11:01,696000,21\n2012/11/23 11:02,1086000,36\n2012/11/23 11:03,275000,19\n2012/11/23 11:04,353000,25\n2012/11/23 11:05,348000,26\n2012/11/23 11:06,3422000,26\n2012/11/23 11:07,1347000,37\n2012/11/23 11:08,406000,32\n2012/11/23 11:09,147000,19\n2012/11/23 11:10,288000,11\n2012/11/23 11:11,485000,18\n2012/11/23 11:12,125000,12\n2012/11/23 11:13,155000,16\n2012/11/23 11:14,495000,18\n2012/11/23 11:15,391000,16\n2012/11/23 11:16,35000,13\n2012/11/23 11:17,629000,35\n2012/11/23 11:18,251000,17\n2012/11/23 11:19,815000,39\n2012/11/23 11:20,341000,26\n2012/11/23 11:21,554000,28\n2012/11/23 11:22,1633000,92\n2012/11/23 11:23,2477000,73\n2012/11/23 11:24,3022000,157\n2012/11/23 11:25,1943000,61\n2012/11/23 11:26,1591000,54\n2012/11/23 11:27,1322000,43\n2012/11/23 11:28,1908000,93\n2012/11/23 11:29,1297000,41\n2012/11/23 11:30,965000,38\n2012/11/23 11:31,285000,22\n2012/11/23 11:32,417000,23\n2012/11/23 11:33,1055000,51\n2012/11/23 11:34,372000,24\n2012/11/23 11:35,202000,17\n2012/11/23 11:36,1268000,28\n2012/11/23 11:37,1268000,18\n2012/11/23 11:38,171000,9\n2012/11/23 11:39,6186000,19\n2012/11/23 11:40,564000,20\n2012/11/23 11:41,862000,62\n2012/11/23 11:42,2434000,38\n2012/11/23 11:43,835000,45\n2012/11/23 11:44,1192000,38\n2012/11/23 11:45,290000,13\n2012/11/23 11:46,1154000,16\n2012/11/23 11:47,2133000,17\n2012/11/23 11:48,1555000,28\n2012/11/23 11:49,2681000,89\n2012/11/23 11:50,2000000,91\n2012/11/23 11:51,1069000,75\n2012/11/23 11:52,824000,64\n2012/11/23 11:53,1112000,34\n2012/11/23 11:54,3487000,30\n2012/11/23 11:55,606000,38\n2012/11/23 11:56,1821000,38\n2012/11/23 11:57,3712000,40\n2012/11/23 11:58,2616000,98\n2012/11/23 11:59,1023000,47\n2012/11/23 12:00,1340000,52\n2012/11/23 12:01,729000,36\n2012/11/23 12:02,299000,19\n2012/11/23 12:03,499000,35\n2012/11/23 12:04,372000,40\n2012/11/23 12:05,1514000,58\n2012/11/23 12:06,2282000,42\n2012/11/23 12:07,488000,41\n2012/11/23 12:08,635000,38\n2012/11/23 12:09,598000,31\n2012/11/23 12:10,716000,36\n2012/11/23 12:11,691000,5\n2012/11/23 12:12,292000,22\n2012/11/23 12:13,234000,13\n2012/11/23 12:14,900000,26\n2012/11/23 12:15,242000,28\n2012/11/23 12:16,311000,20\n2012/11/23 12:17,208000,16\n2012/11/23 12:18,656000,38\n2012/11/23 12:19,765000,67\n2012/11/23 12:20,477000,21\n2012/11/23 12:21,818000,40\n2012/11/23 12:22,949000,80\n2012/11/23 12:23,2498000,86\n2012/11/23 12:24,1010000,54\n2012/11/23 12:25,1407000,25\n2012/11/23 12:26,986000,17\n2012/11/23 12:27,399000,23\n2012/11/23 12:28,484000,31\n2012/11/23 12:29,863000,23\n2012/11/23 12:30,1031000,35\n2012/11/23 12:31,434000,15\n2012/11/23 12:32,603000,18\n2012/11/23 12:33,866000,51\n2012/11/23 12:34,2198000,72\n2012/11/23 12:35,1381000,30\n2012/11/23 12:36,188000,22\n2012/11/23 12:37,372000,20\n2012/11/23 12:38,277000,17\n2012/11/23 12:39,195000,21\n2012/11/23 12:40,800000,29\n2012/11/23 12:41,313000,25\n2012/11/23 12:42,377000,43\n2012/11/23 12:43,1268000,52\n2012/11/23 12:44,3239000,106\n2012/11/23 12:45,1561000,60\n2012/11/23 12:46,1457000,46\n2012/11/23 12:47,2247000,44\n2012/11/23 12:48,488000,26\n2012/11/23 12:49,98000,12\n2012/11/23 12:50,410000,24\n2012/11/23 12:51,127000,17\n2012/11/23 12:52,597000,17\n2012/11/23 12:53,925000,31\n2012/11/23 12:54,11097000,59\n2012/11/23 12:55,1496000,17\n2012/11/23 12:56,365000,21\n2012/11/23 12:57,754000,13\n2012/11/23 12:58,2801000,21\n2012/11/23 12:59,7290000,239\n2012/11/23 13:00,19141000,424\n2012/11/23 13:01,21287000,426\n2012/11/23 13:02,6550000,149\n2012/11/23 13:03,5068000,74\n2012/11/23 13:04,12829000,304\n2012/11/23 13:05,4267000,122\n2012/11/23 13:06,3187000,97\n2012/11/23 13:07,7779000,100\n2012/11/23 13:08,1282000,53\n2012/11/23 13:09,1512000,58\n2012/11/23 13:10,1261000,60\n2012/11/23 13:11,2695000,105\n2012/11/23 13:12,1563000,47\n2012/11/23 13:13,608000,29\n2012/11/23 13:14,873000,47\n2012/11/23 13:15,1053000,46\n2012/11/23 13:16,1537000,43\n2012/11/23 13:17,1478000,50\n2012/11/23 13:18,582000,25\n2012/11/23 13:19,578000,33\n2012/11/23 13:20,6841000,116\n2012/11/23 13:21,2647000,79\n2012/11/23 13:22,36995000,954\n2012/11/23 13:23,66463000,2229\n2012/11/23 13:24,18273000,391\n2012/11/23 13:25,7661000,217\n2012/11/23 13:26,5755000,116\n2012/11/23 13:27,6323000,139\n2012/11/23 13:28,8564000,136\n2012/11/23 13:29,8167000,198\n2012/11/23 13:30,1524000,97\n2012/11/23 13:31,15566000,181\n2012/11/23 13:32,5626000,179\n2012/11/23 13:33,8321000,305\n2012/11/23 13:34,8319000,120\n2012/11/23 13:35,551000,45\n2012/11/23 13:36,1023000,46\n2012/11/23 13:37,12522000,67\n2012/11/23 13:38,1755000,68\n2012/11/23 13:39,3372000,49\n2012/11/23 13:40,5928000,211\n2012/11/23 13:41,5396000,202\n2012/11/23 13:42,3525000,95\n2012/11/23 13:43,2307000,118\n2012/11/23 13:44,5962000,182\n2012/11/23 13:45,3676000,155\n2012/11/23 13:46,4165000,205\n2012/11/23 13:47,10122000,206\n2012/11/23 13:48,32437000,1229\n2012/11/23 13:49,16874000,368\n2012/11/23 13:50,8928000,232\n2012/11/23 13:51,3253000,144\n2012/11/23 13:52,5711000,164\n2012/11/23 13:53,15168000,570\n2012/11/23 13:54,5135000,173\n2012/11/23 13:55,5013000,121\n2012/11/23 13:56,6334000,106\n2012/11/23 13:57,8502000,138\n2012/11/23 13:58,11971000,506\n2012/11/23 13:59,23515000,521\n2012/11/23 14:00,9705000,286\n2012/11/23 14:01,7476000,150\n2012/11/23 14:02,3125000,336\n2012/11/23 14:03,2312000,103\n2012/11/23 14:04,4337000,79\n2012/11/23 14:05,6306000,160\n2012/11/23 14:06,2686000,150\n2012/11/23 14:07,2476000,152\n2012/11/23 14:08,617000,51\n2012/11/23 14:09,1294000,43\n2012/11/23 14:10,763000,53\n2012/11/23 14:11,1732000,153\n2012/11/23 14:12,1583000,116\n2012/11/23 14:13,1083000,75\n2012/11/23 14:14,2984000,32\n2012/11/23 14:15,537000,58\n2012/11/23 14:16,1249000,63\n2012/11/23 14:17,3988000,64\n2012/11/23 14:18,1421000,49\n2012/11/23 14:19,2971000,71\n2012/11/23 14:20,1083000,60\n2012/11/23 14:21,58563000,1554\n2012/11/23 14:22,15062000,375\n2012/11/23 14:23,3500000,194\n2012/11/23 14:24,5044000,142\n2012/11/23 14:25,3247000,152\n2012/11/23 14:26,11199000,321\n2012/11/23 14:27,5776000,198\n2012/11/23 14:28,6150000,198\n2012/11/23 14:29,9377000,121\n2012/11/23 14:30,15819000,140\n2012/11/23 14:31,12934000,199\n2012/11/23 14:32,2388000,171\n2012/11/23 14:33,2468000,91\n2012/11/23 14:34,2500000,142\n2012/11/23 14:35,2620000,61\n2012/11/23 14:36,1847000,79\n2012/11/23 14:37,892000,66\n2012/11/23 14:38,3175000,114\n2012/11/23 14:39,2064000,118\n2012/11/23 14:40,2023000,59\n2012/11/23 14:41,819000,59\n2012/11/23 14:42,1220000,45\n2012/11/23 14:43,1388000,51\n2012/11/23 14:44,1932000,51\n2012/11/23 14:45,1813000,56\n2012/11/23 14:46,1330000,39\n2012/11/23 14:47,524000,36\n2012/11/23 14:48,1519000,57\n2012/11/23 14:49,736000,47\n2012/11/23 14:50,1225000,40\n2012/11/23 14:51,642000,22\n2012/11/23 14:52,1601000,121\n2012/11/23 14:53,3120000,144\n2012/11/23 14:54,18343000,862\n2012/11/23 14:55,11340000,224\n2012/11/23 14:56,12036000,284\n2012/11/23 14:57,6201000,191\n2012/11/23 14:58,3715000,165\n2012/11/23 14:59,7935000,182\n2012/11/23 15:00,24493000,881\n2012/11/23 15:01,15638000,314\n2012/11/23 15:02,5739000,214\n2012/11/23 15:03,7711000,178\n2012/11/23 15:04,3172000,131\n2012/11/23 15:05,4995000,83\n2012/11/23 15:06,1211000,78\n2012/11/23 15:07,3525000,63\n2012/11/23 15:08,5389000,154\n2012/11/23 15:09,2770000,126\n2012/11/23 15:10,13536000,77\n2012/11/23 15:11,4873000,71\n2012/11/23 15:12,30556000,555\n2012/11/23 15:13,8583000,157\n2012/11/23 15:14,4098000,170\n2012/11/23 15:15,14226000,1052\n2012/11/23 15:16,5041000,139\n2012/11/23 15:17,14008000,513\n2012/11/23 15:18,4322000,186\n2012/11/23 15:19,2581000,107\n2012/11/23 15:20,2809000,112\n2012/11/23 15:21,2007000,82\n2012/11/23 15:22,4656000,297\n2012/11/23 15:23,12400000,337\n2012/11/23 15:24,50738000,1048\n2012/11/23 15:25,32172000,1095\n2012/11/23 15:26,32485000,870\n2012/11/23 15:27,46570000,1236\n2012/11/23 15:28,18864000,544\n2012/11/23 15:29,19336000,513\n2012/11/23 15:30,18978000,411\n2012/11/23 15:31,4952000,222\n2012/11/23 15:32,12007000,328\n2012/11/23 15:33,14550000,297\n2012/11/23 15:34,7866000,307\n2012/11/23 15:35,4089000,171\n2012/11/23 15:36,21247000,167\n2012/11/23 15:37,6601000,127\n2012/11/23 15:38,14579000,301\n2012/11/23 15:39,5016000,92\n2012/11/23 15:40,1830000,86\n2012/11/23 15:41,1796000,90\n2012/11/23 15:42,1526000,93\n2012/11/23 15:43,2567000,99\n2012/11/23 15:44,1068000,81\n2012/11/23 15:45,808000,59\n2012/11/23 15:46,4206000,57\n2012/11/23 15:47,9262000,87\n2012/11/23 15:48,5388000,58\n2012/11/23 15:49,1319000,61\n2012/11/23 15:50,2110000,65\n2012/11/23 15:51,1257000,93\n2012/11/23 15:52,6061000,172\n2012/11/23 15:53,1986000,60\n2012/11/23 15:54,1808000,82\n2012/11/23 15:55,1104000,44\n2012/11/23 15:56,6432000,91\n2012/11/23 15:57,6539000,203\n2012/11/23 15:58,6044000,128\n2012/11/23 15:59,2058000,134\n2012/11/23 16:00,7760000,234\n2012/11/23 16:01,2917000,86\n2012/11/23 16:02,3989000,83\n2012/11/23 16:03,2148000,116\n2012/11/23 16:04,1936000,64\n2012/11/23 16:05,977000,62\n2012/11/23 16:06,737000,49\n2012/11/23 16:07,302000,37\n2012/11/23 16:08,2877000,167\n2012/11/23 16:09,2975000,96\n2012/11/23 16:10,983000,68\n2012/11/23 16:11,1577000,57\n2012/11/23 16:12,1378000,51\n2012/11/23 16:13,918000,48\n2012/11/23 16:14,5088000,130\n2012/11/23 16:15,2185000,152\n2012/11/23 16:16,725000,47\n2012/11/23 16:17,853000,43\n2012/11/23 16:18,5812000,132\n2012/11/23 16:19,14951000,344\n2012/11/23 16:20,3434000,112\n2012/11/23 16:21,5690000,88\n2012/11/23 16:22,2381000,76\n2012/11/23 16:23,1327000,63\n2012/11/23 16:24,5033000,63\n2012/11/23 16:25,5657000,95\n2012/11/23 16:26,1353000,76\n2012/11/23 16:27,2058000,60\n2012/11/23 16:28,3836000,58\n2012/11/23 16:29,4137000,75\n2012/11/23 16:30,2145000,41\n2012/11/23 16:31,2493000,42\n2012/11/23 16:32,821000,64\n2012/11/23 16:33,2120000,40\n2012/11/23 16:34,904000,56\n2012/11/23 16:35,2829000,74\n2012/11/23 16:36,2413000,88\n2012/11/23 16:37,4683000,139\n2012/11/23 16:38,9286000,67\n2012/11/23 16:39,2220000,33\n2012/11/23 16:40,8798000,43\n2012/11/23 16:41,1105000,42\n2012/11/23 16:42,6245000,96\n2012/11/23 16:43,3123000,182\n2012/11/23 16:44,1939000,57\n2012/11/23 16:45,5407000,59\n2012/11/23 16:46,1463000,47\n2012/11/23 16:47,1293000,38\n2012/11/23 16:48,4061000,36\n2012/11/23 16:49,2311000,31\n2012/11/23 16:50,530000,27\n2012/11/23 16:51,1843000,20\n2012/11/23 16:52,985000,23\n2012/11/23 16:53,258000,19\n2012/11/23 16:54,265000,18\n2012/11/23 16:55,2594000,35\n2012/11/23 16:56,332000,28\n2012/11/23 16:57,1067000,26\n2012/11/23 16:58,482000,24\n2012/11/23 16:59,633000,28\n2012/11/23 17:00,1055000,37\n2012/11/23 17:01,1822000,79\n2012/11/23 17:02,2028000,52\n2012/11/23 17:03,6044000,147\n2012/11/23 17:04,4957000,160\n2012/11/23 17:05,5947000,121\n2012/11/23 17:06,58686000,2060\n2012/11/23 17:07,25378000,706\n2012/11/23 17:08,11365000,266\n2012/11/23 17:09,21495000,149\n2012/11/23 17:10,7578000,112\n2012/11/23 17:11,4440000,177\n2012/11/23 17:12,8379000,115\n2012/11/23 17:13,4443000,82\n2012/11/23 17:14,2635000,61\n2012/11/23 17:15,1023000,54\n2012/11/23 17:16,1710000,52\n2012/11/23 17:17,1982000,48\n2012/11/23 17:18,1743000,65\n2012/11/23 17:19,563000,43\n2012/11/23 17:20,3072000,54\n2012/11/23 17:21,1042000,55\n2012/11/23 17:22,501000,49\n2012/11/23 17:23,6290000,160\n2012/11/23 17:24,28224000,1041\n2012/11/23 17:25,6110000,134\n2012/11/23 17:26,2602000,96\n2012/11/23 17:27,3277000,80\n2012/11/23 17:28,4811000,91\n2012/11/23 17:29,54283000,1549\n2012/11/23 17:30,4837000,241\n2012/11/23 17:31,2561000,112\n2012/11/23 17:32,12713000,98\n2012/11/23 17:33,2356000,108\n2012/11/23 17:34,3037000,122\n2012/11/23 17:35,2205000,55\n2012/11/23 17:36,1286000,55\n2012/11/23 17:37,2383000,75\n2012/11/23 17:38,3474000,100\n2012/11/23 17:39,3678000,90\n2012/11/23 17:40,1375000,67\n2012/11/23 17:41,493000,39\n2012/11/23 17:42,359000,36\n2012/11/23 17:43,889000,59\n2012/11/23 17:44,26973000,71\n2012/11/23 17:45,707000,50\n2012/11/23 17:46,1294000,45\n2012/11/23 17:47,4160000,93\n2012/11/23 17:48,6577000,186\n2012/11/23 17:49,1878000,75\n2012/11/23 17:50,1390000,52\n2012/11/23 17:51,1874000,55\n2012/11/23 17:52,1346000,58\n2012/11/23 17:53,12221000,69\n2012/11/23 17:54,1576000,69\n2012/11/23 17:55,1844000,44\n2012/11/23 17:56,923000,40\n2012/11/23 17:57,944000,65\n2012/11/23 17:58,12944000,90\n2012/11/23 17:59,3059000,103\n2012/11/23 18:00,5655000,113\n2012/11/23 18:01,829000,39\n2012/11/23 18:02,1735000,45\n2012/11/23 18:03,1101000,50\n2012/11/23 18:04,1870000,64\n2012/11/23 18:05,891000,45\n2012/11/23 18:06,615000,43\n2012/11/23 18:07,1661000,96\n2012/11/23 18:08,1134000,63\n2012/11/23 18:09,434000,45\n2012/11/23 18:10,931000,45\n2012/11/23 18:11,462000,32\n2012/11/23 18:12,728000,28\n2012/11/23 18:13,335000,32\n2012/11/23 18:14,1822000,24\n2012/11/23 18:15,804000,37\n2012/11/23 18:16,666000,25\n2012/11/23 18:17,377000,28\n2012/11/23 18:18,508000,32\n2012/11/23 18:19,894000,16\n2012/11/23 18:20,334000,22\n2012/11/23 18:21,1638000,92\n2012/11/23 18:22,3685000,111\n2012/11/23 18:23,1408000,57\n2012/11/23 18:24,745000,47\n2012/11/23 18:25,1617000,33\n2012/11/23 18:26,756000,42\n2012/11/23 18:27,413000,27\n2012/11/23 18:28,3944000,86\n2012/11/23 18:29,2442000,81\n2012/11/23 18:30,1310000,53\n2012/11/23 18:31,516000,51\n2012/11/23 18:32,2210000,34\n2012/11/23 18:33,63000,11\n2012/11/23 18:34,88000,11\n2012/11/23 18:35,795000,27\n2012/11/23 18:36,715000,23\n2012/11/23 18:37,853000,22\n2012/11/23 18:38,426000,21\n2012/11/23 18:39,116000,21\n2012/11/23 18:40,267000,16\n2012/11/23 18:41,1164000,26\n2012/11/23 18:42,362000,32\n2012/11/23 18:43,651000,18\n2012/11/23 18:44,932000,14\n2012/11/23 18:45,320000,16\n2012/11/23 18:46,643000,8\n2012/11/23 18:47,427000,13\n2012/11/23 18:48,10554000,22\n2012/11/23 18:49,34000,8\n2012/11/23 18:50,118000,15\n2012/11/23 18:51,955000,19\n2012/11/23 18:52,490000,14\n2012/11/23 18:53,757000,21\n2012/11/23 18:54,558000,17\n2012/11/23 18:55,411000,13\n2012/11/23 18:56,337000,14\n2012/11/23 18:57,309000,19\n2012/11/23 18:58,595000,22\n2012/11/23 18:59,3348000,48\n2012/11/23 19:00,1055000,59\n2012/11/23 19:01,854000,14\n2012/11/23 19:02,187000,13\n2012/11/23 19:03,42000,9\n2012/11/23 19:04,48000,8\n2012/11/23 19:05,161000,18\n2012/11/23 19:06,149000,13\n2012/11/23 19:07,219000,10\n2012/11/23 19:08,599000,16\n2012/11/23 19:09,136000,13\n2012/11/23 19:10,81000,12\n2012/11/23 19:11,298000,11\n2012/11/23 19:12,914000,30\n2012/11/23 19:13,296000,38\n2012/11/23 19:14,54000,7\n2012/11/23 19:15,1011000,13\n2012/11/23 19:16,325000,19\n2012/11/23 19:17,256000,12\n2012/11/23 19:18,717000,20\n2012/11/23 19:19,432000,14\n2012/11/23 19:20,437000,10\n2012/11/23 19:21,371000,24\n2012/11/23 19:22,572000,10\n2012/11/23 19:23,149000,6\n2012/11/23 19:24,33000,5\n2012/11/23 19:25,672000,9\n2012/11/23 19:26,132000,10\n2012/11/23 19:27,94000,8\n2012/11/23 19:28,233000,10\n2012/11/23 19:29,433000,8\n2012/11/23 19:30,281000,16\n2012/11/23 19:31,312000,18\n2012/11/23 19:32,631000,14\n2012/11/23 19:33,59000,11\n2012/11/23 19:34,354000,12\n2012/11/23 19:35,38000,10\n2012/11/23 19:36,58000,8\n2012/11/23 19:37,70000,10\n2012/11/23 19:38,165000,20\n2012/11/23 19:39,39000,6\n2012/11/23 19:40,11000,5\n2012/11/23 19:41,6000,5\n2012/11/23 19:42,1059000,11\n2012/11/23 19:43,2065000,38\n2012/11/23 19:44,1618000,25\n2012/11/23 19:45,117000,22\n2012/11/23 19:46,964000,38\n2012/11/23 19:47,166000,18\n2012/11/23 19:48,28000,7\n2012/11/23 19:49,91000,7\n2012/11/23 19:50,220000,4\n2012/11/23 19:51,169000,23\n2012/11/23 19:52,327000,14\n2012/11/23 19:53,535000,7\n2012/11/23 19:54,277000,11\n2012/11/23 19:55,211000,16\n2012/11/23 19:56,949000,16\n2012/11/23 19:57,178000,13\n2012/11/23 19:58,3324000,51\n2012/11/23 19:59,632000,73\n2012/11/23 20:00,2191000,94\n2012/11/23 20:01,282000,21\n2012/11/23 20:02,992000,17\n2012/11/23 20:03,208000,18\n2012/11/23 20:04,174000,15\n2012/11/23 20:05,1101000,25\n2012/11/23 20:06,307000,21\n2012/11/23 20:07,141000,44\n2012/11/23 20:08,770000,16\n2012/11/23 20:09,107000,6\n2012/11/23 20:10,239000,24\n2012/11/23 20:11,216000,14\n2012/11/23 20:12,948000,30\n2012/11/23 20:13,452000,13\n2012/11/23 20:14,470000,18\n2012/11/23 20:15,1705000,63\n2012/11/23 20:16,448000,30\n2012/11/23 20:17,293000,12\n2012/11/23 20:18,60000,8\n2012/11/23 20:19,160000,7\n2012/11/23 20:20,119000,9\n2012/11/23 20:21,126000,7\n2012/11/23 20:22,346000,19\n2012/11/23 20:23,304000,18\n2012/11/23 20:24,1072000,40\n2012/11/23 20:25,445000,15\n2012/11/23 20:26,147000,19\n2012/11/23 20:27,88000,11\n2012/11/23 20:28,139000,11\n2012/11/23 20:29,41000,9\n2012/11/23 20:30,169000,21\n2012/11/23 20:31,382000,15\n2012/11/23 20:32,65000,11\n2012/11/23 20:33,357000,11\n2012/11/23 20:34,280000,9\n2012/11/23 20:35,140000,2\n2012/11/23 20:36,217000,16\n2012/11/23 20:37,66000,9\n2012/11/23 20:38,3417000,11\n2012/11/23 20:39,162000,12\n2012/11/23 20:40,101000,9\n2012/11/23 20:41,72000,10\n2012/11/23 20:42,74000,10\n2012/11/23 20:43,74000,16\n2012/11/23 20:44,58000,7\n2012/11/23 20:45,758000,53\n2012/11/23 20:46,147000,19\n2012/11/23 20:47,55000,10\n2012/11/23 20:48,2144000,25\n2012/11/23 20:49,59000,11\n2012/11/23 20:50,230000,11\n2012/11/23 20:51,579000,13\n2012/11/23 20:52,83000,10\n2012/11/23 20:53,141000,11\n2012/11/23 20:54,85000,12\n2012/11/23 20:55,397000,18\n2012/11/23 20:56,84000,6\n2012/11/23 20:57,2979000,40\n2012/11/23 20:58,1609000,48\n2012/11/23 20:59,908000,13\n2012/11/23 21:00,696000,18\n2012/11/23 21:01,586000,7\n2012/11/23 21:02,90000,9\n2012/11/23 21:03,862000,20\n2012/11/23 21:04,61000,3\n2012/11/23 21:05,50000,1\n2012/11/23 21:06,62000,7\n2012/11/23 21:07,30000,6\n2012/11/23 21:08,267000,9\n2012/11/23 21:09,222000,6\n2012/11/23 21:10,345000,15\n2012/11/23 21:11,34000,7\n2012/11/23 21:12,23000,4\n2012/11/23 21:13,40000,2\n2012/11/23 21:14,124000,6\n2012/11/23 21:15,115000,4\n2012/11/23 21:16,344000,16\n2012/11/23 21:17,11000,2\n2012/11/23 21:18,31000,3\n2012/11/23 21:19,53000,6\n2012/11/23 21:20,191000,13\n2012/11/23 21:21,155000,5\n2012/11/23 21:22,51000,5\n2012/11/23 21:23,130000,3\n2012/11/23 21:24,131000,6\n2012/11/23 21:25,126000,7\n2012/11/23 21:26,660000,11\n2012/11/23 21:27,258000,30\n2012/11/23 21:28,139000,10\n2012/11/23 21:29,813000,9\n2012/11/23 21:30,8000,6\n2012/11/23 21:31,679000,16\n2012/11/23 21:32,91000,4\n2012/11/23 21:33,6000,2\n2012/11/23 21:34,79000,5\n2012/11/23 21:35,115000,6\n2012/11/23 21:36,148000,8\n2012/11/23 21:37,561000,10\n2012/11/23 21:38,70000,6\n2012/11/23 21:39,27000,4\n2012/11/23 21:40,198000,5\n2012/11/23 21:41,17000,4\n2012/11/23 21:42,320000,11\n2012/11/23 21:43,161000,8\n2012/11/23 21:44,80000,4\n2012/11/23 21:45,344000,11\n2012/11/23 21:46,3545000,31\n2012/11/23 21:47,1499000,20\n2012/11/23 21:48,999000,7\n2012/11/23 21:49,638000,12\n2012/11/23 21:50,165000,9\n2012/11/23 21:51,25298000,44\n2012/11/23 21:52,1501000,17\n2012/11/23 21:53,509000,16\n2012/11/23 21:54,317000,14\n2012/11/23 21:55,10000,1\n2012/11/23 21:56,0,0\n2012/11/23 21:57,0,0\n2012/11/23 21:58,0,0\n2012/11/23 21:59,0,0\n2012/11/25 22:00,3439000,154\n2012/11/25 22:01,2399000,73\n2012/11/25 22:02,3399000,72\n2012/11/25 22:03,861000,58\n2012/11/25 22:04,16221000,47\n2012/11/25 22:05,629000,42\n2012/11/25 22:06,729000,35\n2012/11/25 22:07,837000,20\n2012/11/25 22:08,4060000,43\n2012/11/25 22:09,888000,26\n2012/11/25 22:10,620000,27\n2012/11/25 22:11,382000,21\n2012/11/25 22:12,625000,32\n2012/11/25 22:13,129000,21\n2012/11/25 22:14,776000,35\n2012/11/25 22:15,292000,33\n2012/11/25 22:16,254000,22\n2012/11/25 22:17,262000,10\n2012/11/25 22:18,462000,23\n2012/11/25 22:19,10371000,27\n2012/11/25 22:20,94000,8\n2012/11/25 22:21,210000,16\n2012/11/25 22:22,321000,28\n2012/11/25 22:23,167000,15\n2012/11/25 22:24,291000,13\n2012/11/25 22:25,356000,28\n2012/11/25 22:26,358000,35\n2012/11/25 22:27,1647000,27\n2012/11/25 22:28,249000,21\n2012/11/25 22:29,7775000,76\n2012/11/25 22:30,449000,29\n2012/11/25 22:31,252000,13\n2012/11/25 22:32,684000,14\n2012/11/25 22:33,287000,7\n2012/11/25 22:34,203000,8\n2012/11/25 22:35,512000,31\n2012/11/25 22:36,516000,47\n2012/11/25 22:37,3184000,27\n2012/11/25 22:38,586000,39\n2012/11/25 22:39,276000,20\n2012/11/25 22:40,5233000,15\n2012/11/25 22:41,321000,13\n2012/11/25 22:42,54000,10\n2012/11/25 22:43,219000,19\n2012/11/25 22:44,313000,10\n2012/11/25 22:45,161000,18\n2012/11/25 22:46,147000,14\n2012/11/25 22:47,228000,13\n2012/11/25 22:48,259000,10\n2012/11/25 22:49,191000,17\n2012/11/25 22:50,1045000,14\n2012/11/25 22:51,582000,15\n2012/11/25 22:52,128000,7\n2012/11/25 22:53,344000,9\n2012/11/25 22:54,7320000,14\n2012/11/25 22:55,498000,12\n2012/11/25 22:56,19000,6\n2012/11/25 22:57,204000,9\n2012/11/25 22:58,108000,13\n2012/11/25 22:59,219000,19\n2012/11/25 23:00,3192000,84\n2012/11/25 23:01,597000,42\n2012/11/25 23:02,1688000,57\n2012/11/25 23:03,1277000,68\n2012/11/25 23:04,52809000,94\n2012/11/25 23:05,2680000,31\n2012/11/25 23:06,102000,13\n2012/11/25 23:07,361000,18\n2012/11/25 23:08,304000,21\n2012/11/25 23:09,52000,10\n2012/11/25 23:10,660000,18\n2012/11/25 23:11,133000,20\n2012/11/25 23:12,224000,26\n2012/11/25 23:13,218000,40\n2012/11/25 23:14,216000,19\n2012/11/25 23:15,278000,7\n2012/11/25 23:16,243000,21\n2012/11/25 23:17,147000,19\n2012/11/25 23:18,65000,18\n2012/11/25 23:19,345000,18\n2012/11/25 23:20,66000,10\n2012/11/25 23:21,86000,19\n2012/11/25 23:22,858000,46\n2012/11/25 23:23,692000,34\n2012/11/25 23:24,740000,26\n2012/11/25 23:25,667000,34\n2012/11/25 23:26,107000,8\n2012/11/25 23:27,319000,21\n2012/11/25 23:28,220000,7\n2012/11/25 23:29,286000,23\n2012/11/25 23:30,603000,27\n2012/11/25 23:31,150000,21\n2012/11/25 23:32,199000,17\n2012/11/25 23:33,246000,9\n2012/11/25 23:34,91000,10\n2012/11/25 23:35,92000,14\n2012/11/25 23:36,143000,9\n2012/11/25 23:37,34000,5\n2012/11/25 23:38,322000,6\n2012/11/25 23:39,93000,5\n2012/11/25 23:40,85000,10\n2012/11/25 23:41,38000,5\n2012/11/25 23:42,89000,6\n2012/11/25 23:43,53000,4\n2012/11/25 23:44,102000,8\n2012/11/25 23:45,298000,7\n2012/11/25 23:46,165000,13\n2012/11/25 23:47,193000,19\n2012/11/25 23:48,96000,7\n2012/11/25 23:49,98000,13\n2012/11/25 23:50,301000,12\n2012/11/25 23:51,184000,10\n2012/11/25 23:52,1870000,65\n2012/11/25 23:53,3023000,138\n2012/11/25 23:54,1478000,97\n2012/11/25 23:55,1842000,75\n2012/11/25 23:56,1014000,29\n2012/11/25 23:57,2835000,106\n2012/11/25 23:58,917000,29\n2012/11/25 23:59,13050000,71\n2012/11/26 00:00,2116000,83\n2012/11/26 00:01,11632000,61\n2012/11/26 00:02,722000,33\n2012/11/26 00:03,130000,17\n2012/11/26 00:04,1240000,17\n2012/11/26 00:05,174000,15\n2012/11/26 00:06,77000,13\n2012/11/26 00:07,240000,21\n2012/11/26 00:08,346000,10\n2012/11/26 00:09,1022000,7\n2012/11/26 00:10,15000,9\n2012/11/26 00:11,1283000,20\n2012/11/26 00:12,64000,6\n2012/11/26 00:13,91000,14\n2012/11/26 00:14,29000,10\n2012/11/26 00:15,1525000,11\n2012/11/26 00:16,495000,35\n2012/11/26 00:17,1902000,42\n2012/11/26 00:18,39000,7\n2012/11/26 00:19,334000,19\n2012/11/26 00:20,168000,20\n2012/11/26 00:21,521000,18\n2012/11/26 00:22,123000,9\n2012/11/26 00:23,281000,12\n2012/11/26 00:24,118000,14\n2012/11/26 00:25,268000,24\n2012/11/26 00:26,1504000,57\n2012/11/26 00:27,287000,23\n2012/11/26 00:28,140000,25\n2012/11/26 00:29,563000,24\n2012/11/26 00:30,313000,31\n2012/11/26 00:31,339000,22\n2012/11/26 00:32,2135000,53\n2012/11/26 00:33,4081000,68\n2012/11/26 00:34,1206000,58\n2012/11/26 00:35,883000,23\n2012/11/26 00:36,332000,27\n2012/11/26 00:37,145000,16\n2012/11/26 00:38,968000,17\n2012/11/26 00:39,5710000,204\n2012/11/26 00:40,529000,53\n2012/11/26 00:41,352000,27\n2012/11/26 00:42,1451000,38\n2012/11/26 00:43,402000,32\n2012/11/26 00:44,325000,20\n2012/11/26 00:45,2072000,52\n2012/11/26 00:46,650000,33\n2012/11/26 00:47,811000,22\n2012/11/26 00:48,378000,16\n2012/11/26 00:49,206000,27\n2012/11/26 00:50,258000,20\n2012/11/26 00:51,547000,31\n2012/11/26 00:52,269000,19\n2012/11/26 00:53,561000,16\n2012/11/26 00:54,345000,26\n2012/11/26 00:55,280000,27\n2012/11/26 00:56,465000,16\n2012/11/26 00:57,684000,41\n2012/11/26 00:58,393000,33\n2012/11/26 00:59,609000,27\n2012/11/26 01:00,1348000,57\n2012/11/26 01:01,329000,36\n2012/11/26 01:02,205000,23\n2012/11/26 01:03,1182000,20\n2012/11/26 01:04,221000,11\n2012/11/26 01:05,702000,25\n2012/11/26 01:06,759000,16\n2012/11/26 01:07,381000,14\n2012/11/26 01:08,467000,19\n2012/11/26 01:09,60000,10\n2012/11/26 01:10,288000,20\n2012/11/26 01:11,823000,25\n2012/11/26 01:12,277000,16\n2012/11/26 01:13,95000,10\n2012/11/26 01:14,1142000,17\n2012/11/26 01:15,142000,15\n2012/11/26 01:16,2225000,15\n2012/11/26 01:17,124000,8\n2012/11/26 01:18,238000,16\n2012/11/26 01:19,309000,15\n2012/11/26 01:20,436000,15\n2012/11/26 01:21,255000,18\n2012/11/26 01:22,241000,27\n2012/11/26 01:23,409000,42\n2012/11/26 01:24,172000,24\n2012/11/26 01:25,193000,17\n2012/11/26 01:26,847000,17\n2012/11/26 01:27,464000,58\n2012/11/26 01:28,1413000,65\n2012/11/26 01:29,890000,32\n2012/11/26 01:30,2270000,133\n2012/11/26 01:31,179000,17\n2012/11/26 01:32,142000,12\n2012/11/26 01:33,677000,14\n2012/11/26 01:34,1495000,90\n2012/11/26 01:35,1328000,131\n2012/11/26 01:36,1299000,48\n2012/11/26 01:37,240000,28\n2012/11/26 01:38,181000,20\n2012/11/26 01:39,77000,14\n2012/11/26 01:40,940000,32\n2012/11/26 01:41,381000,33\n2012/11/26 01:42,797000,24\n2012/11/26 01:43,189000,15\n2012/11/26 01:44,720000,29\n2012/11/26 01:45,2158000,47\n2012/11/26 01:46,1606000,49\n2012/11/26 01:47,1616000,80\n2012/11/26 01:48,352000,40\n2012/11/26 01:49,535000,39\n2012/11/26 01:50,3981000,119\n2012/11/26 01:51,1881000,84\n2012/11/26 01:52,3630000,133\n2012/11/26 01:53,3467000,121\n2012/11/26 01:54,3002000,190\n2012/11/26 01:55,1889000,35\n2012/11/26 01:56,462000,39\n2012/11/26 01:57,565000,40\n2012/11/26 01:58,6224000,42\n2012/11/26 01:59,3046000,150\n2012/11/26 02:00,4980000,227\n2012/11/26 02:01,1190000,64\n2012/11/26 02:02,433000,36\n2012/11/26 02:03,198000,18\n2012/11/26 02:04,541000,31\n2012/11/26 02:05,1114000,37\n2012/11/26 02:06,16741000,69\n2012/11/26 02:07,2468000,62\n2012/11/26 02:08,952000,41\n2012/11/26 02:09,2300000,120\n2012/11/26 02:10,1378000,61\n2012/11/26 02:11,2843000,52\n2012/11/26 02:12,1252000,36\n2012/11/26 02:13,681000,22\n2012/11/26 02:14,813000,26\n2012/11/26 02:15,2419000,48\n2012/11/26 02:16,1491000,45\n2012/11/26 02:17,484000,33\n2012/11/26 02:18,178000,22\n2012/11/26 02:19,113000,19\n2012/11/26 02:20,759000,37\n2012/11/26 02:21,2573000,41\n2012/11/26 02:22,411000,39\n2012/11/26 02:23,488000,30\n2012/11/26 02:24,293000,40\n2012/11/26 02:25,1450000,20\n2012/11/26 02:26,1628000,23\n2012/11/26 02:27,436000,52\n2012/11/26 02:28,189000,16\n2012/11/26 02:29,537000,22\n2012/11/26 02:30,471000,40\n2012/11/26 02:31,759000,41\n2012/11/26 02:32,1374000,21\n2012/11/26 02:33,998000,30\n2012/11/26 02:34,594000,33\n2012/11/26 02:35,458000,27\n2012/11/26 02:36,5497000,34\n2012/11/26 02:37,612000,17\n2012/11/26 02:38,118000,19\n2012/11/26 02:39,140000,12\n2012/11/26 02:40,55000,7\n2012/11/26 02:41,180000,10\n2012/11/26 02:42,277000,18\n2012/11/26 02:43,1199000,16\n2012/11/26 02:44,890000,24\n2012/11/26 02:45,308000,25\n2012/11/26 02:46,43000,8\n2012/11/26 02:47,19000,5\n2012/11/26 02:48,364000,10\n2012/11/26 02:49,110000,20\n2012/11/26 02:50,126000,7\n2012/11/26 02:51,394000,10\n2012/11/26 02:52,307000,21\n2012/11/26 02:53,694000,15\n2012/11/26 02:54,2055000,39\n2012/11/26 02:55,658000,18\n2012/11/26 02:56,224000,12\n2012/11/26 02:57,189000,15\n2012/11/26 02:58,264000,9\n2012/11/26 02:59,126000,10\n2012/11/26 03:00,412000,35\n2012/11/26 03:01,515000,24\n2012/11/26 03:02,533000,12\n2012/11/26 03:03,93000,11\n2012/11/26 03:04,1375000,21\n2012/11/26 03:05,1243000,20\n2012/11/26 03:06,75000,6\n2012/11/26 03:07,152000,26\n2012/11/26 03:08,114000,17\n2012/11/26 03:09,310000,15\n2012/11/26 03:10,214000,12\n2012/11/26 03:11,310000,14\n2012/11/26 03:12,184000,18\n2012/11/26 03:13,103000,12\n2012/11/26 03:14,85000,12\n2012/11/26 03:15,3337000,23\n2012/11/26 03:16,181000,11\n2012/11/26 03:17,298000,18\n2012/11/26 03:18,140000,10\n2012/11/26 03:19,1302000,3\n2012/11/26 03:20,73000,8\n2012/11/26 03:21,98000,13\n2012/11/26 03:22,678000,13\n2012/11/26 03:23,141000,15\n2012/11/26 03:24,88000,10\n2012/11/26 03:25,3023000,8\n2012/11/26 03:26,55000,8\n2012/11/26 03:27,1551000,33\n2012/11/26 03:28,2147000,23\n2012/11/26 03:29,456000,35\n2012/11/26 03:30,2783000,34\n2012/11/26 03:31,579000,18\n2012/11/26 03:32,100000,8\n2012/11/26 03:33,1104000,38\n2012/11/26 03:34,797000,30\n2012/11/26 03:35,739000,27\n2012/11/26 03:36,566000,24\n2012/11/26 03:37,126000,13\n2012/11/26 03:38,1414000,42\n2012/11/26 03:39,36000,9\n2012/11/26 03:40,15000,5\n2012/11/26 03:41,334000,14\n2012/11/26 03:42,110000,14\n2012/11/26 03:43,1541000,28\n2012/11/26 03:44,665000,10\n2012/11/26 03:45,992000,30\n2012/11/26 03:46,158000,15\n2012/11/26 03:47,599000,24\n2012/11/26 03:48,1785000,54\n2012/11/26 03:49,1208000,28\n2012/11/26 03:50,153000,16\n2012/11/26 03:51,163000,15\n2012/11/26 03:52,150000,8\n2012/11/26 03:53,2454000,28\n2012/11/26 03:54,1636000,10\n2012/11/26 03:55,14194000,153\n2012/11/26 03:56,3418000,67\n2012/11/26 03:57,752000,42\n2012/11/26 03:58,1066000,36\n2012/11/26 03:59,613000,30\n2012/11/26 04:00,1166000,50\n2012/11/26 04:01,793000,20\n2012/11/26 04:02,102000,15\n2012/11/26 04:03,638000,18\n2012/11/26 04:04,406000,23\n2012/11/26 04:05,525000,30\n2012/11/26 04:06,210000,24\n2012/11/26 04:07,1168000,42\n2012/11/26 04:08,239000,32\n2012/11/26 04:09,289000,23\n2012/11/26 04:10,493000,15\n2012/11/26 04:11,410000,12\n2012/11/26 04:12,240000,16\n2012/11/26 04:13,715000,26\n2012/11/26 04:14,95000,14\n2012/11/26 04:15,164000,13\n2012/11/26 04:16,59000,10\n2012/11/26 04:17,108000,10\n2012/11/26 04:18,304000,12\n2012/11/26 04:19,25000,7\n2012/11/26 04:20,121000,17\n2012/11/26 04:21,143000,26\n2012/11/26 04:22,281000,15\n2012/11/26 04:23,999000,47\n2012/11/26 04:24,457000,40\n2012/11/26 04:25,674000,11\n2012/11/26 04:26,336000,13\n2012/11/26 04:27,244000,17\n2012/11/26 04:28,125000,9\n2012/11/26 04:29,34000,6\n2012/11/26 04:30,272000,29\n2012/11/26 04:31,713000,36\n2012/11/26 04:32,390000,25\n2012/11/26 04:33,83000,13\n2012/11/26 04:34,261000,15\n2012/11/26 04:35,265000,10\n2012/11/26 04:36,302000,11\n2012/11/26 04:37,264000,17\n2012/11/26 04:38,160000,14\n2012/11/26 04:39,97000,9\n2012/11/26 04:40,67000,5\n2012/11/26 04:41,241000,12\n2012/11/26 04:42,227000,24\n2012/11/26 04:43,92000,11\n2012/11/26 04:44,688000,13\n2012/11/26 04:45,302000,18\n2012/11/26 04:46,251000,11\n2012/11/26 04:47,222000,17\n2012/11/26 04:48,106000,9\n2012/11/26 04:49,355000,7\n2012/11/26 04:50,260000,8\n2012/11/26 04:51,318000,11\n2012/11/26 04:52,137000,10\n2012/11/26 04:53,52000,9\n2012/11/26 04:54,558000,5\n2012/11/26 04:55,5066000,17\n2012/11/26 04:56,1208000,42\n2012/11/26 04:57,1060000,35\n2012/11/26 04:58,940000,43\n2012/11/26 04:59,174000,16\n2012/11/26 05:00,294000,36\n2012/11/26 05:01,533000,36\n2012/11/26 05:02,1067000,32\n2012/11/26 05:03,270000,18\n2012/11/26 05:04,855000,39\n2012/11/26 05:05,408000,20\n2012/11/26 05:06,396000,24\n2012/11/26 05:07,420000,30\n2012/11/26 05:08,204000,15\n2012/11/26 05:09,205000,20\n2012/11/26 05:10,167000,6\n2012/11/26 05:11,54000,8\n2012/11/26 05:12,608000,13\n2012/11/26 05:13,268000,11\n2012/11/26 05:14,78000,13\n2012/11/26 05:15,195000,12\n2012/11/26 05:16,50000,11\n2012/11/26 05:17,175000,10\n2012/11/26 05:18,46000,4\n2012/11/26 05:19,146000,12\n2012/11/26 05:20,1060000,14\n2012/11/26 05:21,312000,5\n2012/11/26 05:22,474000,19\n2012/11/26 05:23,110000,12\n2012/11/26 05:24,1301000,40\n2012/11/26 05:25,505000,32\n2012/11/26 05:26,184000,19\n2012/11/26 05:27,535000,36\n2012/11/26 05:28,1023000,33\n2012/11/26 05:29,330000,18\n2012/11/26 05:30,549000,45\n2012/11/26 05:31,2820000,19\n2012/11/26 05:32,1382000,95\n2012/11/26 05:33,350000,45\n2012/11/26 05:34,181000,15\n2012/11/26 05:35,182000,13\n2012/11/26 05:36,532000,111\n2012/11/26 05:37,378000,32\n2012/11/26 05:38,144000,13\n2012/11/26 05:39,291000,19\n2012/11/26 05:40,758000,48\n2012/11/26 05:41,184000,39\n2012/11/26 05:42,132000,20\n2012/11/26 05:43,322000,21\n2012/11/26 05:44,47000,6\n2012/11/26 05:45,260000,9\n2012/11/26 05:46,125000,11\n2012/11/26 05:47,201000,12\n2012/11/26 05:48,105000,16\n2012/11/26 05:49,116000,25\n2012/11/26 05:50,117000,11\n2012/11/26 05:51,63000,10\n2012/11/26 05:52,215000,23\n2012/11/26 05:53,261000,11\n2012/11/26 05:54,705000,10\n2012/11/26 05:55,177000,15\n2012/11/26 05:56,16000,5\n2012/11/26 05:57,113000,8\n2012/11/26 05:58,86000,8\n2012/11/26 05:59,167000,12\n2012/11/26 06:00,55000,17\n2012/11/26 06:01,57000,8\n2012/11/26 06:02,164000,9\n2012/11/26 06:03,45000,8\n2012/11/26 06:04,110000,12\n2012/11/26 06:05,130000,10\n2012/11/26 06:06,592000,18\n2012/11/26 06:07,65000,10\n2012/11/26 06:08,221000,26\n2012/11/26 06:09,97000,11\n2012/11/26 06:10,657000,40\n2012/11/26 06:11,885000,14\n2012/11/26 06:12,240000,13\n2012/11/26 06:13,249000,22\n2012/11/26 06:14,242000,21\n2012/11/26 06:15,506000,54\n2012/11/26 06:16,200000,23\n2012/11/26 06:17,167000,12\n2012/11/26 06:18,622000,30\n2012/11/26 06:19,415000,21\n2012/11/26 06:20,718000,13\n2012/11/26 06:21,274000,10\n2012/11/26 06:22,475000,17\n2012/11/26 06:23,402000,31\n2012/11/26 06:24,172000,26\n2012/11/26 06:25,369000,25\n2012/11/26 06:26,864000,42\n2012/11/26 06:27,1784000,117\n2012/11/26 06:28,6989000,209\n2012/11/26 06:29,5349000,277\n2012/11/26 06:30,15166000,600\n2012/11/26 06:31,2687000,142\n2012/11/26 06:32,1004000,69\n2012/11/26 06:33,1450000,73\n2012/11/26 06:34,673000,28\n2012/11/26 06:35,1253000,58\n2012/11/26 06:36,1847000,87\n2012/11/26 06:37,2922000,158\n2012/11/26 06:38,612000,47\n2012/11/26 06:39,1219000,49\n2012/11/26 06:40,605000,29\n2012/11/26 06:41,420000,36\n2012/11/26 06:42,1132000,35\n2012/11/26 06:43,881000,50\n2012/11/26 06:44,530000,36\n2012/11/26 06:45,646000,47\n2012/11/26 06:46,1406000,55\n2012/11/26 06:47,2250000,97\n2012/11/26 06:48,2158000,33\n2012/11/26 06:49,1423000,27\n2012/11/26 06:50,278000,37\n2012/11/26 06:51,445000,42\n2012/11/26 06:52,337000,45\n2012/11/26 06:53,279000,26\n2012/11/26 06:54,981000,22\n2012/11/26 06:55,1158000,27\n2012/11/26 06:56,12855000,184\n2012/11/26 06:57,3073000,73\n2012/11/26 06:58,1492000,64\n2012/11/26 06:59,1064000,47\n2012/11/26 07:00,1294000,74\n2012/11/26 07:01,2181000,120\n2012/11/26 07:02,2430000,113\n2012/11/26 07:03,535000,40\n2012/11/26 07:04,681000,42\n2012/11/26 07:05,1878000,35\n2012/11/26 07:06,2404000,40\n2012/11/26 07:07,1288000,18\n2012/11/26 07:08,6926000,28\n2012/11/26 07:09,495000,24\n2012/11/26 07:10,1650000,98\n2012/11/26 07:11,6047000,108\n2012/11/26 07:12,2043000,67\n2012/11/26 07:13,1740000,42\n2012/11/26 07:14,3526000,98\n2012/11/26 07:15,3924000,229\n2012/11/26 07:16,2585000,52\n2012/11/26 07:17,773000,55\n2012/11/26 07:18,868000,38\n2012/11/26 07:19,1352000,59\n2012/11/26 07:20,6038000,292\n2012/11/26 07:21,2751000,68\n2012/11/26 07:22,867000,33\n2012/11/26 07:23,662000,43\n2012/11/26 07:24,2530000,43\n2012/11/26 07:25,274000,25\n2012/11/26 07:26,2595000,68\n2012/11/26 07:27,26200000,679\n2012/11/26 07:28,12039000,308\n2012/11/26 07:29,2517000,142\n2012/11/26 07:30,5142000,252\n2012/11/26 07:31,17708000,786\n2012/11/26 07:32,7258000,124\n2012/11/26 07:33,896000,85\n2012/11/26 07:34,4290000,102\n2012/11/26 07:35,11110000,584\n2012/11/26 07:36,3172000,188\n2012/11/26 07:37,6182000,145\n2012/11/26 07:38,5073000,138\n2012/11/26 07:39,1086000,77\n2012/11/26 07:40,2283000,69\n2012/11/26 07:41,7270000,125\n2012/11/26 07:42,1544000,60\n2012/11/26 07:43,9165000,218\n2012/11/26 07:44,2287000,70\n2012/11/26 07:45,1083000,63\n2012/11/26 07:46,1207000,43\n2012/11/26 07:47,2230000,51\n2012/11/26 07:48,891000,27\n2012/11/26 07:49,1024000,38\n2012/11/26 07:50,13217000,163\n2012/11/26 07:51,7402000,117\n2012/11/26 07:52,8001000,87\n2012/11/26 07:53,1134000,53\n2012/11/26 07:54,1113000,63\n2012/11/26 07:55,3100000,65\n2012/11/26 07:56,1413000,44\n2012/11/26 07:57,961000,37\n2012/11/26 07:58,5170000,186\n2012/11/26 07:59,6923000,62\n2012/11/26 08:00,11344000,83\n2012/11/26 08:01,4984000,215\n2012/11/26 08:02,2793000,125\n2012/11/26 08:03,4580000,277\n2012/11/26 08:04,6444000,138\n2012/11/26 08:05,1421000,91\n2012/11/26 08:06,767000,37\n2012/11/26 08:07,1700000,75\n2012/11/26 08:08,1020000,50\n2012/11/26 08:09,1773000,41\n2012/11/26 08:10,1382000,46\n2012/11/26 08:11,1710000,47\n2012/11/26 08:12,1074000,58\n2012/11/26 08:13,801000,37\n2012/11/26 08:14,2345000,200\n2012/11/26 08:15,3682000,140\n2012/11/26 08:16,697000,53\n2012/11/26 08:17,1629000,42\n2012/11/26 08:18,4904000,93\n2012/11/26 08:19,6257000,111\n2012/11/26 08:20,3381000,120\n2012/11/26 08:21,1066000,80\n2012/11/26 08:22,3131000,120\n2012/11/26 08:23,1551000,84\n2012/11/26 08:24,7505000,129\n2012/11/26 08:25,789000,42\n2012/11/26 08:26,643000,40\n2012/11/26 08:27,213000,37\n2012/11/26 08:28,1009000,25\n2012/11/26 08:29,168000,16\n2012/11/26 08:30,336000,43\n2012/11/26 08:31,1827000,29\n2012/11/26 08:32,2813000,99\n2012/11/26 08:33,951000,51\n2012/11/26 08:34,449000,50\n2012/11/26 08:35,1293000,32\n2012/11/26 08:36,656000,26\n2012/11/26 08:37,162000,20\n2012/11/26 08:38,626000,43\n2012/11/26 08:39,1618000,40\n2012/11/26 08:40,3098000,76\n2012/11/26 08:41,1877000,61\n2012/11/26 08:42,1458000,56\n2012/11/26 08:43,6059000,295\n2012/11/26 08:44,3115000,90\n2012/11/26 08:45,1220000,68\n2012/11/26 08:46,1248000,66\n2012/11/26 08:47,2095000,73\n2012/11/26 08:48,6692000,324\n2012/11/26 08:49,2418000,121\n2012/11/26 08:50,2050000,162\n2012/11/26 08:51,1883000,112\n2012/11/26 08:52,2018000,66\n2012/11/26 08:53,232000,36\n2012/11/26 08:54,3044000,51\n2012/11/26 08:55,370000,41\n2012/11/26 08:56,395000,36\n2012/11/26 08:57,756000,53\n2012/11/26 08:58,3628000,204\n2012/11/26 08:59,14467000,202\n2012/11/26 09:00,24914000,495\n2012/11/26 09:01,8751000,102\n2012/11/26 09:02,18140000,115\n2012/11/26 09:03,5045000,76\n2012/11/26 09:04,1385000,71\n2012/11/26 09:05,1343000,124\n2012/11/26 09:06,9557000,94\n2012/11/26 09:07,1635000,52\n2012/11/26 09:08,1667000,41\n2012/11/26 09:09,2078000,80\n2012/11/26 09:10,4610000,240\n2012/11/26 09:11,3907000,86\n2012/11/26 09:12,791000,50\n2012/11/26 09:13,727000,39\n2012/11/26 09:14,786000,41\n2012/11/26 09:15,2088000,50\n2012/11/26 09:16,3403000,88\n2012/11/26 09:17,4399000,158\n2012/11/26 09:18,1382000,61\n2012/11/26 09:19,1554000,87\n2012/11/26 09:20,1077000,69\n2012/11/26 09:21,11719000,125\n2012/11/26 09:22,4664000,223\n2012/11/26 09:23,11963000,211\n2012/11/26 09:24,3773000,58\n2012/11/26 09:25,12905000,404\n2012/11/26 09:26,8046000,188\n2012/11/26 09:27,5071000,66\n2012/11/26 09:28,2531000,95\n2012/11/26 09:29,662000,38\n2012/11/26 09:30,936000,56\n2012/11/26 09:31,1341000,61\n2012/11/26 09:32,1594000,50\n2012/11/26 09:33,1115000,69\n2012/11/26 09:34,1173000,57\n2012/11/26 09:35,1156000,35\n2012/11/26 09:36,317000,15\n2012/11/26 09:37,515000,19\n2012/11/26 09:38,375000,33\n2012/11/26 09:39,315000,35\n2012/11/26 09:40,936000,35\n2012/11/26 09:41,2342000,51\n2012/11/26 09:42,4447000,61\n2012/11/26 09:43,299000,25\n2012/11/26 09:44,578000,34\n2012/11/26 09:45,774000,33\n2012/11/26 09:46,938000,29\n2012/11/26 09:47,846000,35\n2012/11/26 09:48,286000,23\n2012/11/26 09:49,1500000,36\n2012/11/26 09:50,573000,20\n2012/11/26 09:51,322000,37\n2012/11/26 09:52,589000,18\n2012/11/26 09:53,534000,14\n2012/11/26 09:54,676000,21\n2012/11/26 09:55,758000,39\n2012/11/26 09:56,1283000,19\n2012/11/26 09:57,828000,15\n2012/11/26 09:58,3110000,87\n2012/11/26 09:59,10454000,314\n2012/11/26 10:00,7343000,131\n2012/11/26 10:01,2171000,80\n2012/11/26 10:02,987000,42\n2012/11/26 10:03,1221000,23\n2012/11/26 10:04,3880000,31\n2012/11/26 10:05,469000,25\n2012/11/26 10:06,649000,15\n2012/11/26 10:07,1175000,36\n2012/11/26 10:08,2949000,62\n2012/11/26 10:09,8267000,257\n2012/11/26 10:10,4404000,165\n2012/11/26 10:11,1105000,61\n2012/11/26 10:12,857000,70\n2012/11/26 10:13,659000,41\n2012/11/26 10:14,813000,33\n2012/11/26 10:15,454000,27\n2012/11/26 10:16,1710000,66\n2012/11/26 10:17,700000,39\n2012/11/26 10:18,1028000,32\n2012/11/26 10:19,170000,20\n2012/11/26 10:20,211000,24\n2012/11/26 10:21,636000,27\n2012/11/26 10:22,1888000,30\n2012/11/26 10:23,761000,21\n2012/11/26 10:24,529000,40\n2012/11/26 10:25,954000,18\n2012/11/26 10:26,727000,32\n2012/11/26 10:27,270000,16\n2012/11/26 10:28,213000,22\n2012/11/26 10:29,1085000,20\n2012/11/26 10:30,1824000,98\n2012/11/26 10:31,3154000,108\n2012/11/26 10:32,957000,43\n2012/11/26 10:33,138000,19\n2012/11/26 10:34,703000,26\n2012/11/26 10:35,285000,21\n2012/11/26 10:36,654000,33\n2012/11/26 10:37,81000,16\n2012/11/26 10:38,572000,22\n2012/11/26 10:39,540000,19\n2012/11/26 10:40,328000,17\n2012/11/26 10:41,280000,29\n2012/11/26 10:42,406000,15\n2012/11/26 10:43,234000,19\n2012/11/26 10:44,6022000,35\n2012/11/26 10:45,732000,35\n2012/11/26 10:46,222000,14\n2012/11/26 10:47,640000,39\n2012/11/26 10:48,449000,62\n2012/11/26 10:49,617000,30\n2012/11/26 10:50,3134000,27\n2012/11/26 10:51,1807000,122\n2012/11/26 10:52,1171000,53\n2012/11/26 10:53,1590000,26\n2012/11/26 10:54,1424000,47\n2012/11/26 10:55,1932000,50\n2012/11/26 10:56,240000,27\n2012/11/26 10:57,364000,24\n2012/11/26 10:58,555000,28\n2012/11/26 10:59,271000,41\n2012/11/26 11:00,345000,25\n2012/11/26 11:01,432000,19\n2012/11/26 11:02,3745000,22\n2012/11/26 11:03,8948000,32\n2012/11/26 11:04,264000,21\n2012/11/26 11:05,3355000,167\n2012/11/26 11:06,4780000,232\n2012/11/26 11:07,2942000,59\n2012/11/26 11:08,1455000,34\n2012/11/26 11:09,801000,62\n2012/11/26 11:10,1512000,60\n2012/11/26 11:11,979000,48\n2012/11/26 11:12,760000,45\n2012/11/26 11:13,753000,35\n2012/11/26 11:14,980000,34\n2012/11/26 11:15,942000,59\n2012/11/26 11:16,387000,17\n2012/11/26 11:17,1219000,29\n2012/11/26 11:18,1554000,24\n2012/11/26 11:19,1011000,42\n2012/11/26 11:20,1727000,57\n2012/11/26 11:21,1664000,62\n2012/11/26 11:22,1243000,51\n2012/11/26 11:23,5251000,146\n2012/11/26 11:24,1338000,42\n2012/11/26 11:25,1180000,43\n2012/11/26 11:26,431000,21\n2012/11/26 11:27,1666000,15\n2012/11/26 11:28,188000,24\n2012/11/26 11:29,447000,30\n2012/11/26 11:30,175000,16\n2012/11/26 11:31,774000,24\n2012/11/26 11:32,5517000,22\n2012/11/26 11:33,253000,26\n2012/11/26 11:34,334000,20\n2012/11/26 11:35,5401000,31\n2012/11/26 11:36,422000,21\n2012/11/26 11:37,1124000,20\n2012/11/26 11:38,2202000,54\n2012/11/26 11:39,1059000,21\n2012/11/26 11:40,489000,19\n2012/11/26 11:41,1205000,20\n2012/11/26 11:42,2729000,15\n2012/11/26 11:43,12294000,594\n2012/11/26 11:44,9051000,205\n2012/11/26 11:45,5316000,137\n2012/11/26 11:46,1640000,55\n2012/11/26 11:47,1450000,45\n2012/11/26 11:48,7053000,186\n2012/11/26 11:49,1599000,71\n2012/11/26 11:50,1410000,47\n2012/11/26 11:51,11303000,64\n2012/11/26 11:52,4262000,91\n2012/11/26 11:53,1483000,53\n2012/11/26 11:54,2967000,131\n2012/11/26 11:55,1370000,94\n2012/11/26 11:56,1175000,70\n2012/11/26 11:57,3996000,283\n2012/11/26 11:58,2616000,123\n2012/11/26 11:59,1284000,67\n2012/11/26 12:00,2304000,123\n2012/11/26 12:01,639000,56\n2012/11/26 12:02,1887000,59\n2012/11/26 12:03,2044000,61\n2012/11/26 12:04,398000,37\n2012/11/26 12:05,318000,30\n2012/11/26 12:06,859000,62\n2012/11/26 12:07,2093000,47\n2012/11/26 12:08,365000,34\n2012/11/26 12:09,694000,45\n2012/11/26 12:10,459000,43\n2012/11/26 12:11,926000,45\n2012/11/26 12:12,295000,42\n2012/11/26 12:13,289000,27\n2012/11/26 12:14,159000,30\n2012/11/26 12:15,84000,25\n2012/11/26 12:16,360000,17\n2012/11/26 12:17,158000,18\n2012/11/26 12:18,510000,26\n2012/11/26 12:19,940000,19\n2012/11/26 12:20,245000,39\n2012/11/26 12:21,335000,16\n2012/11/26 12:22,158000,21\n2012/11/26 12:23,305000,37\n2012/11/26 12:24,135000,19\n2012/11/26 12:25,232000,14\n2012/11/26 12:26,229000,32\n2012/11/26 12:27,48000,14\n2012/11/26 12:28,222000,28\n2012/11/26 12:29,1167000,121\n2012/11/26 12:30,1894000,68\n2012/11/26 12:31,779000,31\n2012/11/26 12:32,5210000,36\n2012/11/26 12:33,291000,18\n2012/11/26 12:34,592000,33\n2012/11/26 12:35,10426000,205\n2012/11/26 12:36,1494000,128\n2012/11/26 12:37,3143000,109\n2012/11/26 12:38,2638000,103\n2012/11/26 12:39,2683000,51\n2012/11/26 12:40,1987000,65\n2012/11/26 12:41,495000,37\n2012/11/26 12:42,5933000,166\n2012/11/26 12:43,4416000,122\n2012/11/26 12:44,8179000,273\n2012/11/26 12:45,6975000,352\n2012/11/26 12:46,726000,58\n2012/11/26 12:47,1358000,96\n2012/11/26 12:48,2430000,68\n2012/11/26 12:49,3531000,71\n2012/11/26 12:50,1300000,76\n2012/11/26 12:51,728000,55\n2012/11/26 12:52,1483000,78\n2012/11/26 12:53,996000,41\n2012/11/26 12:54,559000,21\n2012/11/26 12:55,587000,66\n2012/11/26 12:56,844000,30\n2012/11/26 12:57,908000,37\n2012/11/26 12:58,5825000,32\n2012/11/26 12:59,1027000,45\n2012/11/26 13:00,17274000,170\n2012/11/26 13:01,4066000,44\n2012/11/26 13:02,607000,36\n2012/11/26 13:03,1670000,78\n2012/11/26 13:04,3724000,126\n2012/11/26 13:05,1731000,45\n2012/11/26 13:06,5248000,51\n2012/11/26 13:07,585000,44\n2012/11/26 13:08,667000,37\n2012/11/26 13:09,695000,21\n2012/11/26 13:10,1064000,56\n2012/11/26 13:11,1947000,93\n2012/11/26 13:12,1228000,59\n2012/11/26 13:13,716000,38\n2012/11/26 13:14,713000,37\n2012/11/26 13:15,482000,37\n2012/11/26 13:16,269000,14\n2012/11/26 13:17,269000,17\n2012/11/26 13:18,55000,15\n2012/11/26 13:19,748000,8\n2012/11/26 13:20,250000,23\n2012/11/26 13:21,468000,20\n2012/11/26 13:22,515000,20\n2012/11/26 13:23,114000,20\n2012/11/26 13:24,595000,20\n2012/11/26 13:25,292000,27\n2012/11/26 13:26,563000,22\n2012/11/26 13:27,5227000,53\n2012/11/26 13:28,3305000,181\n2012/11/26 13:29,1101000,68\n2012/11/26 13:30,1696000,97\n2012/11/26 13:31,581000,46\n2012/11/26 13:32,688000,44\n2012/11/26 13:33,1042000,37\n2012/11/26 13:34,719000,38\n2012/11/26 13:35,399000,24\n2012/11/26 13:36,519000,27\n2012/11/26 13:37,3792000,17\n2012/11/26 13:38,1408000,23\n2012/11/26 13:39,3204000,45\n2012/11/26 13:40,5577000,36\n2012/11/26 13:41,772000,22\n2012/11/26 13:42,169000,14\n2012/11/26 13:43,520000,52\n2012/11/26 13:44,5513000,209\n2012/11/26 13:45,3207000,172\n2012/11/26 13:46,1532000,76\n2012/11/26 13:47,5641000,263\n2012/11/26 13:48,3504000,195\n2012/11/26 13:49,1854000,113\n2012/11/26 13:50,982000,82\n2012/11/26 13:51,1106000,80\n2012/11/26 13:52,2700000,62\n2012/11/26 13:53,2525000,51\n2012/11/26 13:54,521000,31\n2012/11/26 13:55,2318000,59\n2012/11/26 13:56,1011000,82\n2012/11/26 13:57,1034000,51\n2012/11/26 13:58,2105000,53\n2012/11/26 13:59,2142000,95\n2012/11/26 14:00,1186000,105\n2012/11/26 14:01,691000,30\n2012/11/26 14:02,963000,37\n2012/11/26 14:03,865000,52\n2012/11/26 14:04,1113000,66\n2012/11/26 14:05,2908000,138\n2012/11/26 14:06,2604000,128\n2012/11/26 14:07,732000,60\n2012/11/26 14:08,775000,26\n2012/11/26 14:09,2300000,46\n2012/11/26 14:10,377000,26\n2012/11/26 14:11,632000,43\n2012/11/26 14:12,565000,21\n2012/11/26 14:13,424000,30\n2012/11/26 14:14,895000,38\n2012/11/26 14:15,675000,30\n2012/11/26 14:16,87000,17\n2012/11/26 14:17,275000,21\n2012/11/26 14:18,414000,29\n2012/11/26 14:19,170000,20\n2012/11/26 14:20,786000,38\n2012/11/26 14:21,540000,30\n2012/11/26 14:22,884000,68\n2012/11/26 14:23,240000,29\n2012/11/26 14:24,3277000,29\n2012/11/26 14:25,1675000,79\n2012/11/26 14:26,1134000,57\n2012/11/26 14:27,322000,26\n2012/11/26 14:28,353000,21\n2012/11/26 14:29,595000,50\n2012/11/26 14:30,4436000,157\n2012/11/26 14:31,1704000,64\n2012/11/26 14:32,1684000,82\n2012/11/26 14:33,1530000,60\n2012/11/26 14:34,1522000,27\n2012/11/26 14:35,4200000,93\n2012/11/26 14:36,1138000,34\n2012/11/26 14:37,398000,25\n2012/11/26 14:38,22347000,168\n2012/11/26 14:39,1534000,97\n2012/11/26 14:40,857000,43\n2012/11/26 14:41,425000,25\n2012/11/26 14:42,270000,29\n2012/11/26 14:43,595000,18\n2012/11/26 14:44,227000,15\n2012/11/26 14:45,1703000,58\n2012/11/26 14:46,1165000,56\n2012/11/26 14:47,650000,32\n2012/11/26 14:48,1394000,45\n2012/11/26 14:49,1345000,66\n2012/11/26 14:50,3218000,137\n2012/11/26 14:51,568000,41\n2012/11/26 14:52,806000,50\n2012/11/26 14:53,1475000,48\n2012/11/26 14:54,380000,24\n2012/11/26 14:55,816000,40\n2012/11/26 14:56,1385000,44\n2012/11/26 14:57,318000,16\n2012/11/26 14:58,582000,18\n2012/11/26 14:59,382000,15\n2012/11/26 15:00,1291000,60\n2012/11/26 15:01,1349000,53\n2012/11/26 15:02,1703000,60\n2012/11/26 15:03,4022000,269\n2012/11/26 15:04,3772000,113\n2012/11/26 15:05,1797000,64\n2012/11/26 15:06,687000,39\n2012/11/26 15:07,336000,26\n2012/11/26 15:08,1223000,52\n2012/11/26 15:09,706000,38\n2012/11/26 15:10,8068000,224\n2012/11/26 15:11,1310000,71\n2012/11/26 15:12,1747000,107\n2012/11/26 15:13,5561000,71\n2012/11/26 15:14,1902000,70\n2012/11/26 15:15,7830000,171\n2012/11/26 15:16,5770000,114\n2012/11/26 15:17,1642000,89\n2012/11/26 15:18,938000,54\n2012/11/26 15:19,576000,45\n2012/11/26 15:20,649000,49\n2012/11/26 15:21,629000,24\n2012/11/26 15:22,719000,27\n2012/11/26 15:23,315000,20\n2012/11/26 15:24,2219000,40\n2012/11/26 15:25,1024000,56\n2012/11/26 15:26,731000,29\n2012/11/26 15:27,236000,15\n2012/11/26 15:28,642000,24\n2012/11/26 15:29,413000,16\n2012/11/26 15:30,374000,29\n2012/11/26 15:31,1073000,26\n2012/11/26 15:32,238000,31\n2012/11/26 15:33,1813000,49\n2012/11/26 15:34,694000,24\n2012/11/26 15:35,450000,30\n2012/11/26 15:36,116000,14\n2012/11/26 15:37,993000,26\n2012/11/26 15:38,458000,32\n2012/11/26 15:39,362000,22\n2012/11/26 15:40,565000,22\n2012/11/26 15:41,1117000,27\n2012/11/26 15:42,122000,21\n2012/11/26 15:43,144000,14\n2012/11/26 15:44,62000,6\n2012/11/26 15:45,943000,24\n2012/11/26 15:46,3768000,120\n2012/11/26 15:47,1280000,54\n2012/11/26 15:48,626000,29\n2012/11/26 15:49,564000,20\n2012/11/26 15:50,986000,39\n2012/11/26 15:51,189000,24\n2012/11/26 15:52,1163000,26\n2012/11/26 15:53,573000,13\n2012/11/26 15:54,834000,33\n2012/11/26 15:55,381000,23\n2012/11/26 15:56,255000,11\n2012/11/26 15:57,201000,12\n2012/11/26 15:58,873000,35\n2012/11/26 15:59,1276000,25\n2012/11/26 16:00,1292000,31\n2012/11/26 16:01,245000,16\n2012/11/26 16:02,69000,12\n2012/11/26 16:03,166000,5\n2012/11/26 16:04,1069000,58\n2012/11/26 16:05,2442000,60\n2012/11/26 16:06,422000,25\n2012/11/26 16:07,2214000,14\n2012/11/26 16:08,3014000,95\n2012/11/26 16:09,720000,59\n2012/11/26 16:10,696000,46\n2012/11/26 16:11,480000,22\n2012/11/26 16:12,2324000,24\n2012/11/26 16:13,544000,24\n2012/11/26 16:14,227000,12\n2012/11/26 16:15,413000,24\n2012/11/26 16:16,967000,34\n2012/11/26 16:17,2457000,195\n2012/11/26 16:18,480000,12\n2012/11/26 16:19,1218000,14\n2012/11/26 16:20,960000,13\n2012/11/26 16:21,386000,13\n2012/11/26 16:22,208000,16\n2012/11/26 16:23,968000,44\n2012/11/26 16:24,3887000,127\n2012/11/26 16:25,1877000,66\n2012/11/26 16:26,672000,43\n2012/11/26 16:27,666000,31\n2012/11/26 16:28,760000,27\n2012/11/26 16:29,280000,25\n2012/11/26 16:30,2162000,51\n2012/11/26 16:31,1846000,58\n2012/11/26 16:32,1080000,37\n2012/11/26 16:33,347000,24\n2012/11/26 16:34,148000,30\n2012/11/26 16:35,269000,16\n2012/11/26 16:36,3619000,18\n2012/11/26 16:37,5384000,24\n2012/11/26 16:38,3887000,37\n2012/11/26 16:39,423000,29\n2012/11/26 16:40,1601000,40\n2012/11/26 16:41,199000,13\n2012/11/26 16:42,104000,13\n2012/11/26 16:43,375000,22\n2012/11/26 16:44,223000,21\n2012/11/26 16:45,313000,27\n2012/11/26 16:46,233000,21\n2012/11/26 16:47,346000,28\n2012/11/26 16:48,488000,10\n2012/11/26 16:49,1309000,31\n2012/11/26 16:50,2323000,111\n2012/11/26 16:51,529000,24\n2012/11/26 16:52,2157000,43\n2012/11/26 16:53,522000,18\n2012/11/26 16:54,346000,17\n2012/11/26 16:55,366000,8\n2012/11/26 16:56,458000,23\n2012/11/26 16:57,104000,12\n2012/11/26 16:58,59000,9\n2012/11/26 16:59,72000,11\n2012/11/26 17:00,1540000,70\n2012/11/26 17:01,1952000,106\n2012/11/26 17:02,1950000,51\n2012/11/26 17:03,1071000,54\n2012/11/26 17:04,5295000,54\n2012/11/26 17:05,3155000,76\n2012/11/26 17:06,3094000,211\n2012/11/26 17:07,741000,42\n2012/11/26 17:08,859000,56\n2012/11/26 17:09,594000,28\n2012/11/26 17:10,395000,26\n2012/11/26 17:11,439000,39\n2012/11/26 17:12,262000,10\n2012/11/26 17:13,342000,23\n2012/11/26 17:14,453000,33\n2012/11/26 17:15,1189000,33\n2012/11/26 17:16,353000,17\n2012/11/26 17:17,345000,14\n2012/11/26 17:18,774000,28\n2012/11/26 17:19,231000,12\n2012/11/26 17:20,2671000,212\n2012/11/26 17:21,418000,22\n2012/11/26 17:22,136000,14\n2012/11/26 17:23,110000,18\n2012/11/26 17:24,115000,10\n2012/11/26 17:25,153000,12\n2012/11/26 17:26,256000,15\n2012/11/26 17:27,516000,19\n2012/11/26 17:28,232000,6\n2012/11/26 17:29,89000,8\n2012/11/26 17:30,487000,26\n2012/11/26 17:31,654000,13\n2012/11/26 17:32,154000,17\n2012/11/26 17:33,2407000,48\n2012/11/26 17:34,1138000,35\n2012/11/26 17:35,121000,17\n2012/11/26 17:36,168000,10\n2012/11/26 17:37,3044000,8\n2012/11/26 17:38,269000,18\n2012/11/26 17:39,1979000,57\n2012/11/26 17:40,6627000,210\n2012/11/26 17:41,1388000,36\n2012/11/26 17:42,1100000,22\n2012/11/26 17:43,494000,34\n2012/11/26 17:44,809000,28\n2012/11/26 17:45,1027000,31\n2012/11/26 17:46,390000,17\n2012/11/26 17:47,50000,14\n2012/11/26 17:48,524000,29\n2012/11/26 17:49,88000,18\n2012/11/26 17:50,118000,10\n2012/11/26 17:51,2579000,16\n2012/11/26 17:52,615000,13\n2012/11/26 17:53,865000,10\n2012/11/26 17:54,152000,9\n2012/11/26 17:55,482000,18\n2012/11/26 17:56,1046000,14\n2012/11/26 17:57,279000,13\n2012/11/26 17:58,1844000,61\n2012/11/26 17:59,2627000,174\n2012/11/26 18:00,2270000,113\n2012/11/26 18:01,2222000,48\n2012/11/26 18:02,480000,22\n2012/11/26 18:03,1006000,29\n2012/11/26 18:04,369000,15\n2012/11/26 18:05,77000,13\n2012/11/26 18:06,636000,16\n2012/11/26 18:07,1049000,32\n2012/11/26 18:08,39000,6\n2012/11/26 18:09,239000,11\n2012/11/26 18:10,142000,6\n2012/11/26 18:11,17000,4\n2012/11/26 18:12,176000,11\n2012/11/26 18:13,325000,10\n2012/11/26 18:14,290000,18\n2012/11/26 18:15,159000,13\n2012/11/26 18:16,235000,13\n2012/11/26 18:17,133000,12\n2012/11/26 18:18,413000,18\n2012/11/26 18:19,313000,11\n2012/11/26 18:20,101000,10\n2012/11/26 18:21,283000,4\n2012/11/26 18:22,164000,5\n2012/11/26 18:23,178000,12\n2012/11/26 18:24,342000,6\n2012/11/26 18:25,255000,9\n2012/11/26 18:26,86000,9\n2012/11/26 18:27,234000,5\n2012/11/26 18:28,285000,11\n2012/11/26 18:29,13000,4\n2012/11/26 18:30,1270000,18\n2012/11/26 18:31,648000,18\n2012/11/26 18:32,128000,7\n2012/11/26 18:33,49000,8\n2012/11/26 18:34,3067000,10\n2012/11/26 18:35,936000,14\n2012/11/26 18:36,3035000,8\n2012/11/26 18:37,37000,8\n2012/11/26 18:38,23000,4\n2012/11/26 18:39,209000,6\n2012/11/26 18:40,1054000,18\n2012/11/26 18:41,109000,7\n2012/11/26 18:42,337000,17\n2012/11/26 18:43,2136000,13\n2012/11/26 18:44,336000,9\n2012/11/26 18:45,147000,15\n2012/11/26 18:46,175000,11\n2012/11/26 18:47,204000,10\n2012/11/26 18:48,115000,16\n2012/11/26 18:49,11000,7\n2012/11/26 18:50,532000,9\n2012/11/26 18:51,7000,3\n2012/11/26 18:52,6000,3\n2012/11/26 18:53,22000,4\n2012/11/26 18:54,512000,4\n2012/11/26 18:55,10000,5\n2012/11/26 18:56,476000,14\n2012/11/26 18:57,783000,59\n2012/11/26 18:58,199000,44\n2012/11/26 18:59,17000,8\n2012/11/26 19:00,313000,22\n2012/11/26 19:01,6875000,45\n2012/11/26 19:02,439000,23\n2012/11/26 19:03,39000,8\n2012/11/26 19:04,114000,5\n2012/11/26 19:05,60000,5\n2012/11/26 19:06,24000,4\n2012/11/26 19:07,65000,7\n2012/11/26 19:08,80000,6\n2012/11/26 19:09,610000,9\n2012/11/26 19:10,64000,9\n2012/11/26 19:11,114000,10\n2012/11/26 19:12,121000,4\n2012/11/26 19:13,136000,10\n2012/11/26 19:14,353000,6\n2012/11/26 19:15,416000,17\n2012/11/26 19:16,554000,12\n2012/11/26 19:17,565000,9\n2012/11/26 19:18,297000,13\n2012/11/26 19:19,676000,13\n2012/11/26 19:20,294000,6\n2012/11/26 19:21,346000,19\n2012/11/26 19:22,54000,4\n2012/11/26 19:23,4000,4\n2012/11/26 19:24,3000,3\n2012/11/26 19:25,43000,7\n2012/11/26 19:26,81000,2\n2012/11/26 19:27,177000,8\n2012/11/26 19:28,511000,9\n2012/11/26 19:29,579000,11\n2012/11/26 19:30,334000,16\n2012/11/26 19:31,75000,11\n2012/11/26 19:32,335000,10\n2012/11/26 19:33,247000,10\n2012/11/26 19:34,200000,14\n2012/11/26 19:35,482000,16\n2012/11/26 19:36,185000,13\n2012/11/26 19:37,37000,8\n2012/11/26 19:38,453000,11\n2012/11/26 19:39,349000,14\n2012/11/26 19:40,52000,3\n2012/11/26 19:41,383000,10\n2012/11/26 19:42,513000,17\n2012/11/26 19:43,225000,7\n2012/11/26 19:44,61000,7\n2012/11/26 19:45,239000,13\n2012/11/26 19:46,221000,4\n2012/11/26 19:47,70000,7\n2012/11/26 19:48,211000,4\n2012/11/26 19:49,119000,9\n2012/11/26 19:50,253000,12\n2012/11/26 19:51,151000,4\n2012/11/26 19:52,5000,3\n2012/11/26 19:53,12000,6\n2012/11/26 19:54,60000,16\n2012/11/26 19:55,57000,4\n2012/11/26 19:56,19000,9\n2012/11/26 19:57,11000,4\n2012/11/26 19:58,185000,6\n2012/11/26 19:59,110000,11\n2012/11/26 20:00,569000,28\n2012/11/26 20:01,718000,9\n2012/11/26 20:02,169000,6\n2012/11/26 20:03,473000,29\n2012/11/26 20:04,230000,5\n2012/11/26 20:05,272000,12\n2012/11/26 20:06,79000,7\n2012/11/26 20:07,37000,4\n2012/11/26 20:08,321000,9\n2012/11/26 20:09,232000,13\n2012/11/26 20:10,70000,11\n2012/11/26 20:11,10076000,16\n2012/11/26 20:12,116000,6\n2012/11/26 20:13,20000,2\n2012/11/26 20:14,186000,5\n2012/11/26 20:15,150000,12\n2012/11/26 20:16,58000,5\n2012/11/26 20:17,84000,4\n2012/11/26 20:18,153000,11\n2012/11/26 20:19,27000,4\n2012/11/26 20:20,3000,3\n2012/11/26 20:21,110000,2\n2012/11/26 20:22,243000,6\n2012/11/26 20:23,2018000,6\n2012/11/26 20:24,123000,6\n2012/11/26 20:25,43000,5\n2012/11/26 20:26,429000,8\n2012/11/26 20:27,842000,26\n2012/11/26 20:28,379000,11\n2012/11/26 20:29,219000,13\n2012/11/26 20:30,245000,33\n2012/11/26 20:31,310000,20\n2012/11/26 20:32,435000,34\n2012/11/26 20:33,1261000,86\n2012/11/26 20:34,2372000,28\n2012/11/26 20:35,1290000,73\n2012/11/26 20:36,535000,22\n2012/11/26 20:37,2618000,86\n2012/11/26 20:38,390000,21\n2012/11/26 20:39,487000,40\n2012/11/26 20:40,682000,27\n2012/11/26 20:41,342000,27\n2012/11/26 20:42,252000,12\n2012/11/26 20:43,1001000,14\n2012/11/26 20:44,453000,24\n2012/11/26 20:45,835000,35\n2012/11/26 20:46,49000,8\n2012/11/26 20:47,93000,11\n2012/11/26 20:48,77000,10\n2012/11/26 20:49,2400000,24\n2012/11/26 20:50,379000,15\n2012/11/26 20:51,98000,11\n2012/11/26 20:52,1057000,15\n2012/11/26 20:53,4083000,16\n2012/11/26 20:54,178000,11\n2012/11/26 20:55,3029000,15\n2012/11/26 20:56,3000,3\n2012/11/26 20:57,217000,12\n2012/11/26 20:58,149000,12\n2012/11/26 20:59,34000,6\n2012/11/26 21:00,12569000,26\n2012/11/26 21:01,360000,25\n2012/11/26 21:02,88000,19\n2012/11/26 21:03,499000,11\n2012/11/26 21:04,156000,4\n2012/11/26 21:05,73000,7\n2012/11/26 21:06,207000,13\n2012/11/26 21:07,233000,12\n2012/11/26 21:08,646000,14\n2012/11/26 21:09,153000,7\n2012/11/26 21:10,97000,10\n2012/11/26 21:11,55000,5\n2012/11/26 21:12,78000,7\n2012/11/26 21:13,75000,17\n2012/11/26 21:14,56000,6\n2012/11/26 21:15,181000,10\n2012/11/26 21:16,2061000,4\n2012/11/26 21:17,25000,7\n2012/11/26 21:18,139000,13\n2012/11/26 21:19,37000,2\n2012/11/26 21:20,299000,16\n2012/11/26 21:21,112000,6\n2012/11/26 21:22,21000,3\n2012/11/26 21:23,34000,4\n2012/11/26 21:24,138000,10\n2012/11/26 21:25,292000,6\n2012/11/26 21:26,1184000,12\n2012/11/26 21:27,106000,4\n2012/11/26 21:28,12000,3\n2012/11/26 21:29,131000,9\n2012/11/26 21:30,293000,8\n2012/11/26 21:31,167000,7\n2012/11/26 21:32,205000,5\n2012/11/26 21:33,217000,20\n2012/11/26 21:34,691000,20\n2012/11/26 21:35,445000,13\n2012/11/26 21:36,146000,6\n2012/11/26 21:37,227000,9\n2012/11/26 21:38,251000,12\n2012/11/26 21:39,190000,10\n2012/11/26 21:40,1610000,48\n2012/11/26 21:41,104000,9\n2012/11/26 21:42,335000,16\n2012/11/26 21:43,845000,16\n2012/11/26 21:44,41000,4\n2012/11/26 21:45,255000,11\n2012/11/26 21:46,77000,9\n2012/11/26 21:47,237000,15\n2012/11/26 21:48,42000,5\n2012/11/26 21:49,13000,4\n2012/11/26 21:50,157000,14\n2012/11/26 21:51,65000,5\n2012/11/26 21:52,486000,8\n2012/11/26 21:53,30000,1\n2012/11/26 21:54,220000,11\n2012/11/26 21:55,546000,7\n2012/11/26 21:56,141000,9\n2012/11/26 21:57,194000,9\n2012/11/26 21:58,267000,8\n2012/11/26 21:59,34000,4\n2012/11/26 22:00,1164000,54\n2012/11/26 22:01,104000,31\n2012/11/26 22:02,277000,15\n2012/11/26 22:03,191000,25\n2012/11/26 22:04,51322000,2462\n2012/11/26 22:05,11350000,480\n2012/11/26 22:06,2807000,85\n2012/11/26 22:07,17588000,65\n2012/11/26 22:08,8568000,60\n2012/11/26 22:09,5071000,94\n2012/11/26 22:10,3855000,104\n2012/11/26 22:11,6316000,198\n2012/11/26 22:12,45884000,406\n2012/11/26 22:13,37430000,118\n2012/11/26 22:14,2980000,164\n2012/11/26 22:15,5002000,167\n2012/11/26 22:16,3537000,78\n2012/11/26 22:17,1964000,52\n2012/11/26 22:18,30412000,69\n2012/11/26 22:19,1982000,45\n2012/11/26 22:20,6960000,65\n2012/11/26 22:21,1608000,66\n2012/11/26 22:22,5008000,238\n2012/11/26 22:23,13807000,620\n2012/11/26 22:24,2855000,66\n2012/11/26 22:25,476000,61\n2012/11/26 22:26,1615000,55\n2012/11/26 22:27,1482000,56\n2012/11/26 22:28,6249000,185\n2012/11/26 22:29,16462000,774\n2012/11/26 22:30,2353000,120\n2012/11/26 22:31,13979000,88\n2012/11/26 22:32,2313000,62\n2012/11/26 22:33,34002000,1713\n2012/11/26 22:34,39710000,508\n2012/11/26 22:35,13469000,165\n2012/11/26 22:36,5784000,170\n2012/11/26 22:37,8863000,99\n2012/11/26 22:38,2096000,85\n2012/11/26 22:39,53743000,1360\n2012/11/26 22:40,15132000,382\n2012/11/26 22:41,20862000,225\n2012/11/26 22:42,6761000,208\n2012/11/26 22:43,5797000,128\n2012/11/26 22:44,1478000,70\n2012/11/26 22:45,2294000,142\n2012/11/26 22:46,5833000,81\n2012/11/26 22:47,528000,40\n2012/11/26 22:48,1866000,71\n2012/11/26 22:49,561000,67\n2012/11/26 22:50,1202000,88\n2012/11/26 22:51,1039000,59\n2012/11/26 22:52,1575000,82\n2012/11/26 22:53,3597000,139\n2012/11/26 22:54,1373000,65\n2012/11/26 22:55,11393000,53\n2012/11/26 22:56,7557000,39\n2012/11/26 22:57,2015000,31\n2012/11/26 22:58,1006000,28\n2012/11/26 22:59,1259000,37\n2012/11/26 23:00,11027000,419\n2012/11/26 23:01,5094000,208\n2012/11/26 23:02,1321000,75\n2012/11/26 23:03,2589000,46\n2012/11/26 23:04,525000,37\n2012/11/26 23:05,797000,54\n2012/11/26 23:06,813000,41\n2012/11/26 23:07,954000,69\n2012/11/26 23:08,1490000,31\n2012/11/26 23:09,387000,20\n2012/11/26 23:10,201000,20\n2012/11/26 23:11,277000,16\n2012/11/26 23:12,655000,23\n2012/11/26 23:13,151000,49\n2012/11/26 23:14,405000,24\n2012/11/26 23:15,3653000,110\n2012/11/26 23:16,1734000,47\n2012/11/26 23:17,698000,46\n2012/11/26 23:18,619000,27\n2012/11/26 23:19,1543000,79\n2012/11/26 23:20,1396000,62\n2012/11/26 23:21,704000,50\n2012/11/26 23:22,331000,19\n2012/11/26 23:23,586000,24\n2012/11/26 23:24,128000,13\n2012/11/26 23:25,5523000,132\n2012/11/26 23:26,8101000,272\n2012/11/26 23:27,11256000,84\n2012/11/26 23:28,421000,62\n2012/11/26 23:29,1557000,45\n2012/11/26 23:30,1370000,80\n2012/11/26 23:31,450000,25\n2012/11/26 23:32,377000,39\n2012/11/26 23:33,301000,19\n2012/11/26 23:34,931000,19\n2012/11/26 23:35,417000,26\n2012/11/26 23:36,2255000,50\n2012/11/26 23:37,21892000,1303\n2012/11/26 23:38,1271000,59\n2012/11/26 23:39,13166000,67\n2012/11/26 23:40,49354000,256\n2012/11/26 23:41,65069000,141\n2012/11/26 23:42,1294000,45\n2012/11/26 23:43,265000,21\n2012/11/26 23:44,1024000,23\n2012/11/26 23:45,13455000,44\n2012/11/26 23:46,13533000,89\n2012/11/26 23:47,742000,27\n2012/11/26 23:48,7651000,84\n2012/11/26 23:49,12261000,118\n2012/11/26 23:50,1830000,85\n2012/11/26 23:51,585000,44\n2012/11/26 23:52,3296000,229\n2012/11/26 23:53,1312000,67\n2012/11/26 23:54,1162000,48\n2012/11/26 23:55,189000,26\n2012/11/26 23:56,464000,31\n2012/11/26 23:57,339000,28\n2012/11/26 23:58,939000,30\n2012/11/26 23:59,8412000,104\n2012/11/27 00:00,9766000,132\n2012/11/27 00:01,4225000,95\n2012/11/27 00:02,4549000,114\n2012/11/27 00:03,1390000,48\n2012/11/27 00:04,19388000,121\n2012/11/27 00:05,3782000,81\n2012/11/27 00:06,1416000,28\n2012/11/27 00:07,774000,20\n2012/11/27 00:08,597000,25\n2012/11/27 00:09,1114000,27\n2012/11/27 00:10,209000,14\n2012/11/27 00:11,778000,31\n2012/11/27 00:12,338000,34\n2012/11/27 00:13,1105000,27\n2012/11/27 00:14,1813000,32\n2012/11/27 00:15,700000,37\n2012/11/27 00:16,1063000,21\n2012/11/27 00:17,196000,20\n2012/11/27 00:18,588000,56\n2012/11/27 00:19,208000,21\n2012/11/27 00:20,306000,29\n2012/11/27 00:21,1018000,38\n2012/11/27 00:22,2649000,45\n2012/11/27 00:23,4327000,127\n2012/11/27 00:24,3103000,94\n2012/11/27 00:25,4824000,110\n2012/11/27 00:26,6598000,165\n2012/11/27 00:27,1779000,39\n2012/11/27 00:28,2233000,62\n2012/11/27 00:29,2675000,26\n2012/11/27 00:30,3734000,108\n2012/11/27 00:31,4251000,54\n2012/11/27 00:32,5270000,55\n2012/11/27 00:33,1476000,33\n2012/11/27 00:34,1476000,40\n2012/11/27 00:35,3827000,81\n2012/11/27 00:36,1792000,50\n2012/11/27 00:37,5128000,112\n2012/11/27 00:38,28377000,1040\n2012/11/27 00:39,11159000,346\n2012/11/27 00:40,10110000,232\n2012/11/27 00:41,7815000,216\n2012/11/27 00:42,7741000,107\n2012/11/27 00:43,5227000,113\n2012/11/27 00:44,7409000,129\n2012/11/27 00:45,2185000,80\n2012/11/27 00:46,741000,67\n2012/11/27 00:47,1955000,104\n2012/11/27 00:48,546000,45\n2012/11/27 00:49,4802000,85\n2012/11/27 00:50,2710000,147\n2012/11/27 00:51,4285000,231\n2012/11/27 00:52,1855000,56\n2012/11/27 00:53,15993000,381\n2012/11/27 00:54,5300000,128\n2012/11/27 00:55,2343000,72\n2012/11/27 00:56,1897000,119\n2012/11/27 00:57,3238000,85\n2012/11/27 00:58,588000,33\n2012/11/27 00:59,795000,41\n2012/11/27 01:00,1187000,115\n2012/11/27 01:01,2137000,67\n2012/11/27 01:02,1750000,42\n2012/11/27 01:03,2539000,64\n2012/11/27 01:04,1748000,93\n2012/11/27 01:05,2936000,45\n2012/11/27 01:06,491000,33\n2012/11/27 01:07,815000,43\n2012/11/27 01:08,5387000,52\n2012/11/27 01:09,4782000,31\n2012/11/27 01:10,321000,28\n2012/11/27 01:11,269000,27\n2012/11/27 01:12,419000,17\n2012/11/27 01:13,454000,25\n2012/11/27 01:14,959000,47\n2012/11/27 01:15,729000,55\n2012/11/27 01:16,883000,39\n2012/11/27 01:17,380000,37\n2012/11/27 01:18,435000,39\n2012/11/27 01:19,3345000,51\n2012/11/27 01:20,1056000,73\n2012/11/27 01:21,1463000,25\n2012/11/27 01:22,484000,26\n2012/11/27 01:23,71000,10\n2012/11/27 01:24,352000,26\n2012/11/27 01:25,285000,27\n2012/11/27 01:26,164000,18\n2012/11/27 01:27,105000,10\n2012/11/27 01:28,360000,32\n2012/11/27 01:29,9295000,28\n2012/11/27 01:30,713000,37\n2012/11/27 01:31,657000,36\n2012/11/27 01:32,458000,20\n2012/11/27 01:33,894000,39\n2012/11/27 01:34,466000,16\n2012/11/27 01:35,821000,27\n2012/11/27 01:36,802000,36\n2012/11/27 01:37,6743000,91\n2012/11/27 01:38,4112000,318\n2012/11/27 01:39,10759000,213\n2012/11/27 01:40,3356000,78\n2012/11/27 01:41,1222000,75\n2012/11/27 01:42,8220000,271\n2012/11/27 01:43,5124000,186\n2012/11/27 01:44,1278000,80\n2012/11/27 01:45,2109000,92\n2012/11/27 01:46,6033000,138\n2012/11/27 01:47,930000,52\n2012/11/27 01:48,438000,39\n2012/11/27 01:49,4965000,35\n2012/11/27 01:50,1813000,28\n2012/11/27 01:51,288000,21\n2012/11/27 01:52,326000,30\n2012/11/27 01:53,467000,17\n2012/11/27 01:54,717000,29\n2012/11/27 01:55,301000,31\n2012/11/27 01:56,289000,42\n2012/11/27 01:57,324000,35\n2012/11/27 01:58,618000,24\n2012/11/27 01:59,1000000,50\n2012/11/27 02:00,873000,53\n2012/11/27 02:01,467000,31\n2012/11/27 02:02,421000,32\n2012/11/27 02:03,606000,34\n2012/11/27 02:04,185000,19\n2012/11/27 02:05,249000,24\n2012/11/27 02:06,1534000,59\n2012/11/27 02:07,468000,30\n2012/11/27 02:08,593000,31\n2012/11/27 02:09,605000,36\n2012/11/27 02:10,2423000,65\n2012/11/27 02:11,2621000,52\n2012/11/27 02:12,2484000,26\n2012/11/27 02:13,156000,15\n2012/11/27 02:14,217000,10\n2012/11/27 02:15,431000,22\n2012/11/27 02:16,2732000,49\n2012/11/27 02:17,248000,25\n2012/11/27 02:18,732000,29\n2012/11/27 02:19,356000,25\n2012/11/27 02:20,426000,22\n2012/11/27 02:21,827000,32\n2012/11/27 02:22,354000,18\n2012/11/27 02:23,453000,23\n2012/11/27 02:24,702000,37\n2012/11/27 02:25,179000,13\n2012/11/27 02:26,519000,15\n2012/11/27 02:27,1111000,52\n2012/11/27 02:28,129000,14\n2012/11/27 02:29,226000,12\n2012/11/27 02:30,334000,18\n2012/11/27 02:31,303000,12\n2012/11/27 02:32,44000,7\n2012/11/27 02:33,115000,11\n2012/11/27 02:34,131000,7\n2012/11/27 02:35,242000,13\n2012/11/27 02:36,500000,14\n2012/11/27 02:37,351000,16\n2012/11/27 02:38,406000,27\n2012/11/27 02:39,722000,25\n2012/11/27 02:40,2348000,42\n2012/11/27 02:41,1566000,70\n2012/11/27 02:42,625000,26\n2012/11/27 02:43,169000,18\n2012/11/27 02:44,73000,5\n2012/11/27 02:45,758000,100\n2012/11/27 02:46,536000,25\n2012/11/27 02:47,425000,44\n2012/11/27 02:48,122000,14\n2012/11/27 02:49,72000,6\n2012/11/27 02:50,48000,9\n2012/11/27 02:51,127000,14\n2012/11/27 02:52,1070000,38\n2012/11/27 02:53,241000,31\n2012/11/27 02:54,338000,22\n2012/11/27 02:55,41000,10\n2012/11/27 02:56,288000,18\n2012/11/27 02:57,61000,11\n2012/11/27 02:58,199000,12\n2012/11/27 02:59,4423000,24\n2012/11/27 03:00,1351000,22\n2012/11/27 03:01,141000,8\n2012/11/27 03:02,100000,10\n2012/11/27 03:03,255000,10\n2012/11/27 03:04,525000,13\n2012/11/27 03:05,385000,10\n2012/11/27 03:06,74000,7\n2012/11/27 03:07,156000,12\n2012/11/27 03:08,145000,11\n2012/11/27 03:09,53000,3\n2012/11/27 03:10,305000,11\n2012/11/27 03:11,161000,15\n2012/11/27 03:12,75000,9\n2012/11/27 03:13,228000,27\n2012/11/27 03:14,216000,14\n2012/11/27 03:15,67000,9\n2012/11/27 03:16,808000,16\n2012/11/27 03:17,562000,33\n2012/11/27 03:18,773000,48\n2012/11/27 03:19,892000,39\n2012/11/27 03:20,316000,17\n2012/11/27 03:21,127000,14\n2012/11/27 03:22,770000,21\n2012/11/27 03:23,221000,16\n2012/11/27 03:24,255000,11\n2012/11/27 03:25,1280000,9\n2012/11/27 03:26,157000,15\n2012/11/27 03:27,203000,9\n2012/11/27 03:28,64000,12\n2012/11/27 03:29,93000,13\n2012/11/27 03:30,200000,21\n2012/11/27 03:31,107000,9\n2012/11/27 03:32,573000,16\n2012/11/27 03:33,16773000,184\n2012/11/27 03:34,5547000,157\n2012/11/27 03:35,6252000,120\n2012/11/27 03:36,387000,39\n2012/11/27 03:37,1302000,76\n2012/11/27 03:38,3215000,46\n2012/11/27 03:39,266000,22\n2012/11/27 03:40,409000,28\n2012/11/27 03:41,194000,11\n2012/11/27 03:42,1116000,11\n2012/11/27 03:43,438000,31\n2012/11/27 03:44,218000,17\n2012/11/27 03:45,10745000,34\n2012/11/27 03:46,1780000,46\n2012/11/27 03:47,325000,25\n2012/11/27 03:48,3780000,19\n2012/11/27 03:49,6202000,23\n2012/11/27 03:50,944000,20\n2012/11/27 03:51,370000,19\n2012/11/27 03:52,1992000,50\n2012/11/27 03:53,268000,20\n2012/11/27 03:54,70000,17\n2012/11/27 03:55,886000,15\n2012/11/27 03:56,45000,16\n2012/11/27 03:57,119000,7\n2012/11/27 03:58,537000,17\n2012/11/27 03:59,763000,32\n2012/11/27 04:00,6518000,41\n2012/11/27 04:01,43000,10\n2012/11/27 04:02,251000,14\n2012/11/27 04:03,74000,5\n2012/11/27 04:04,1503000,42\n2012/11/27 04:05,2448000,75\n2012/11/27 04:06,388000,29\n2012/11/27 04:07,687000,19\n2012/11/27 04:08,197000,24\n2012/11/27 04:09,398000,34\n2012/11/27 04:10,79000,13\n2012/11/27 04:11,767000,17\n2012/11/27 04:12,191000,14\n2012/11/27 04:13,547000,12\n2012/11/27 04:14,204000,19\n2012/11/27 04:15,725000,41\n2012/11/27 04:16,246000,22\n2012/11/27 04:17,86000,11\n2012/11/27 04:18,916000,19\n2012/11/27 04:19,175000,8\n2012/11/27 04:20,251000,12\n2012/11/27 04:21,586000,16\n2012/11/27 04:22,1179000,25\n2012/11/27 04:23,693000,24\n2012/11/27 04:24,617000,18\n2012/11/27 04:25,558000,29\n2012/11/27 04:26,104000,13\n2012/11/27 04:27,166000,11\n2012/11/27 04:28,264000,10\n2012/11/27 04:29,155000,8\n2012/11/27 04:30,132000,16\n2012/11/27 04:31,103000,25\n2012/11/27 04:32,281000,14\n2012/11/27 04:33,80000,10\n2012/11/27 04:34,155000,17\n2012/11/27 04:35,327000,22\n2012/11/27 04:36,816000,10\n2012/11/27 04:37,311000,16\n2012/11/27 04:38,85000,13\n2012/11/27 04:39,368000,19\n2012/11/27 04:40,1151000,17\n2012/11/27 04:41,358000,27\n2012/11/27 04:42,2211000,125\n2012/11/27 04:43,2061000,78\n2012/11/27 04:44,192000,21\n2012/11/27 04:45,539000,26\n2012/11/27 04:46,239000,16\n2012/11/27 04:47,208000,11\n2012/11/27 04:48,187000,14\n2012/11/27 04:49,2506000,36\n2012/11/27 04:50,130000,12\n2012/11/27 04:51,571000,26\n2012/11/27 04:52,177000,15\n2012/11/27 04:53,218000,23\n2012/11/27 04:54,160000,12\n2012/11/27 04:55,4732000,294\n2012/11/27 04:56,375000,74\n2012/11/27 04:57,1640000,63\n2012/11/27 04:58,562000,31\n2012/11/27 04:59,578000,32\n2012/11/27 05:00,1162000,27\n2012/11/27 05:01,673000,29\n2012/11/27 05:02,591000,22\n2012/11/27 05:03,167000,8\n2012/11/27 05:04,575000,27\n2012/11/27 05:05,737000,29\n2012/11/27 05:06,287000,19\n2012/11/27 05:07,283000,18\n2012/11/27 05:08,54000,10\n2012/11/27 05:09,432000,13\n2012/11/27 05:10,203000,14\n2012/11/27 05:11,533000,20\n2012/11/27 05:12,635000,17\n2012/11/27 05:13,156000,18\n2012/11/27 05:14,221000,14\n2012/11/27 05:15,2533000,103\n2012/11/27 05:16,647000,23\n2012/11/27 05:17,849000,34\n2012/11/27 05:18,1162000,58\n2012/11/27 05:19,826000,36\n2012/11/27 05:20,254000,15\n2012/11/27 05:21,87000,7\n2012/11/27 05:22,1652000,9\n2012/11/27 05:23,145000,6\n2012/11/27 05:24,45000,9\n2012/11/27 05:25,60000,5\n2012/11/27 05:26,236000,10\n2012/11/27 05:27,295000,13\n2012/11/27 05:28,168000,12\n2012/11/27 05:29,362000,21\n2012/11/27 05:30,427000,26\n2012/11/27 05:31,116000,8\n2012/11/27 05:32,100000,11\n2012/11/27 05:33,131000,8\n2012/11/27 05:34,77000,13\n2012/11/27 05:35,297000,24\n2012/11/27 05:36,496000,15\n2012/11/27 05:37,181000,9\n2012/11/27 05:38,396000,21\n2012/11/27 05:39,37000,8\n2012/11/27 05:40,81000,9\n2012/11/27 05:41,58000,7\n2012/11/27 05:42,252000,13\n2012/11/27 05:43,244000,19\n2012/11/27 05:44,2420000,78\n2012/11/27 05:45,833000,39\n2012/11/27 05:46,980000,34\n2012/11/27 05:47,348000,22\n2012/11/27 05:48,424000,19\n2012/11/27 05:49,864000,13\n2012/11/27 05:50,26000,7\n2012/11/27 05:51,779000,8\n2012/11/27 05:52,147000,15\n2012/11/27 05:53,1218000,14\n2012/11/27 05:54,320000,22\n2012/11/27 05:55,203000,23\n2012/11/27 05:56,454000,19\n2012/11/27 05:57,178000,13\n2012/11/27 05:58,259000,19\n2012/11/27 05:59,751000,61\n2012/11/27 06:00,322000,44\n2012/11/27 06:01,13741000,44\n2012/11/27 06:02,295000,29\n2012/11/27 06:03,330000,27\n2012/11/27 06:04,315000,31\n2012/11/27 06:05,12939000,198\n2012/11/27 06:06,1557000,71\n2012/11/27 06:07,538000,66\n2012/11/27 06:08,793000,24\n2012/11/27 06:09,482000,16\n2012/11/27 06:10,307000,19\n2012/11/27 06:11,322000,22\n2012/11/27 06:12,430000,14\n2012/11/27 06:13,137000,16\n2012/11/27 06:14,462000,24\n2012/11/27 06:15,341000,36\n2012/11/27 06:16,97000,14\n2012/11/27 06:17,380000,16\n2012/11/27 06:18,520000,13\n2012/11/27 06:19,170000,14\n2012/11/27 06:20,163000,18\n2012/11/27 06:21,38000,8\n2012/11/27 06:22,435000,13\n2012/11/27 06:23,1077000,9\n2012/11/27 06:24,678000,13\n2012/11/27 06:25,129000,17\n2012/11/27 06:26,5131000,34\n2012/11/27 06:27,166000,13\n2012/11/27 06:28,82000,8\n2012/11/27 06:29,412000,13\n2012/11/27 06:30,367000,21\n2012/11/27 06:31,87000,23\n2012/11/27 06:32,150000,24\n2012/11/27 06:33,3180000,45\n2012/11/27 06:34,790000,26\n2012/11/27 06:35,733000,29\n2012/11/27 06:36,512000,28\n2012/11/27 06:37,671000,17\n2012/11/27 06:38,223000,18\n2012/11/27 06:39,692000,18\n2012/11/27 06:40,877000,29\n2012/11/27 06:41,1811000,40\n2012/11/27 06:42,1292000,40\n2012/11/27 06:43,1703000,70\n2012/11/27 06:44,2147000,52\n2012/11/27 06:45,1242000,50\n2012/11/27 06:46,487000,29\n2012/11/27 06:47,357000,36\n2012/11/27 06:48,300000,16\n2012/11/27 06:49,263000,18\n2012/11/27 06:50,274000,65\n2012/11/27 06:51,437000,16\n2012/11/27 06:52,1407000,24\n2012/11/27 06:53,634000,26\n2012/11/27 06:54,2891000,18\n2012/11/27 06:55,400000,21\n2012/11/27 06:56,119000,9\n2012/11/27 06:57,677000,12\n2012/11/27 06:58,101000,11\n2012/11/27 06:59,1435000,28\n2012/11/27 07:00,5600000,53\n2012/11/27 07:01,6572000,29\n2012/11/27 07:02,261000,23\n2012/11/27 07:03,82000,13\n2012/11/27 07:04,6108000,252\n2012/11/27 07:05,6697000,297\n2012/11/27 07:06,4507000,216\n2012/11/27 07:07,2339000,84\n2012/11/27 07:08,1114000,75\n2012/11/27 07:09,1767000,67\n2012/11/27 07:10,2414000,66\n2012/11/27 07:11,1730000,88\n2012/11/27 07:12,2502000,50\n2012/11/27 07:13,14015000,77\n2012/11/27 07:14,3602000,100\n2012/11/27 07:15,2794000,78\n2012/11/27 07:16,483000,42\n2012/11/27 07:17,379000,22\n2012/11/27 07:18,1212000,32\n2012/11/27 07:19,1199000,28\n2012/11/27 07:20,1411000,69\n2012/11/27 07:21,3289000,58\n2012/11/27 07:22,2274000,43\n2012/11/27 07:23,3334000,137\n2012/11/27 07:24,2382000,96\n2012/11/27 07:25,1768000,46\n2012/11/27 07:26,2681000,100\n2012/11/27 07:27,1926000,75\n2012/11/27 07:28,1677000,65\n2012/11/27 07:29,5375000,184\n2012/11/27 07:30,1084000,70\n2012/11/27 07:31,1816000,66\n2012/11/27 07:32,712000,51\n2012/11/27 07:33,573000,27\n2012/11/27 07:34,1333000,41\n2012/11/27 07:35,591000,29\n2012/11/27 07:36,1552000,27\n2012/11/27 07:37,480000,22\n2012/11/27 07:38,739000,29\n2012/11/27 07:39,488000,38\n2012/11/27 07:40,174000,16\n2012/11/27 07:41,709000,36\n2012/11/27 07:42,696000,72\n2012/11/27 07:43,3393000,123\n2012/11/27 07:44,938000,95\n2012/11/27 07:45,934000,34\n2012/11/27 07:46,950000,74\n2012/11/27 07:47,1412000,43\n2012/11/27 07:48,1033000,29\n2012/11/27 07:49,2404000,60\n2012/11/27 07:50,5436000,92\n2012/11/27 07:51,2332000,58\n2012/11/27 07:52,5385000,42\n2012/11/27 07:53,5985000,57\n2012/11/27 07:54,2657000,53\n2012/11/27 07:55,1391000,43\n2012/11/27 07:56,1448000,42\n2012/11/27 07:57,338000,38\n2012/11/27 07:58,333000,21\n2012/11/27 07:59,384000,27\n2012/11/27 08:00,3298000,71\n2012/11/27 08:01,1163000,35\n2012/11/27 08:02,921000,29\n2012/11/27 08:03,2267000,44\n2012/11/27 08:04,460000,33\n2012/11/27 08:05,1913000,35\n2012/11/27 08:06,531000,27\n2012/11/27 08:07,572000,26\n2012/11/27 08:08,1630000,33\n2012/11/27 08:09,2767000,46\n2012/11/27 08:10,4107000,141\n2012/11/27 08:11,1236000,59\n2012/11/27 08:12,1912000,64\n2012/11/27 08:13,217000,21\n2012/11/27 08:14,1312000,56\n2012/11/27 08:15,1813000,53\n2012/11/27 08:16,13180000,162\n2012/11/27 08:17,1812000,90\n2012/11/27 08:18,4764000,200\n2012/11/27 08:19,3567000,84\n2012/11/27 08:20,3361000,73\n2012/11/27 08:21,1468000,29\n2012/11/27 08:22,2644000,40\n2012/11/27 08:23,21577000,1111\n2012/11/27 08:24,8421000,339\n2012/11/27 08:25,12326000,718\n2012/11/27 08:26,9069000,270\n2012/11/27 08:27,22254000,922\n2012/11/27 08:28,14235000,248\n2012/11/27 08:29,14005000,218\n2012/11/27 08:30,17188000,227\n2012/11/27 08:31,1650000,79\n2012/11/27 08:32,2357000,96\n2012/11/27 08:33,1880000,115\n2012/11/27 08:34,2235000,63\n2012/11/27 08:35,803000,44\n2012/11/27 08:36,305000,37\n2012/11/27 08:37,1504000,70\n2012/11/27 08:38,5358000,53\n2012/11/27 08:39,1307000,48\n2012/11/27 08:40,382000,33\n2012/11/27 08:41,18796000,128\n2012/11/27 08:42,2836000,123\n2012/11/27 08:43,1280000,108\n2012/11/27 08:44,1149000,55\n2012/11/27 08:45,771000,52\n2012/11/27 08:46,1940000,56\n2012/11/27 08:47,2225000,106\n2012/11/27 08:48,634000,46\n2012/11/27 08:49,2136000,182\n2012/11/27 08:50,2507000,145\n2012/11/27 08:51,1076000,77\n2012/11/27 08:52,1242000,62\n2012/11/27 08:53,557000,35\n2012/11/27 08:54,1611000,56\n2012/11/27 08:55,1572000,46\n2012/11/27 08:56,2451000,43\n2012/11/27 08:57,1134000,34\n2012/11/27 08:58,3530000,39\n2012/11/27 08:59,938000,34\n2012/11/27 09:00,1587000,73\n2012/11/27 09:01,2761000,58\n2012/11/27 09:02,10663000,47\n2012/11/27 09:03,309000,34\n2012/11/27 09:04,4094000,37\n2012/11/27 09:05,717000,38\n2012/11/27 09:06,397000,40\n2012/11/27 09:07,761000,43\n2012/11/27 09:08,695000,49\n2012/11/27 09:09,705000,32\n2012/11/27 09:10,808000,33\n2012/11/27 09:11,513000,23\n2012/11/27 09:12,2233000,104\n2012/11/27 09:13,1848000,63\n2012/11/27 09:14,1850000,80\n2012/11/27 09:15,1400000,72\n2012/11/27 09:16,678000,38\n2012/11/27 09:17,905000,41\n2012/11/27 09:18,1007000,39\n2012/11/27 09:19,2193000,81\n2012/11/27 09:20,435000,50\n2012/11/27 09:21,546000,21\n2012/11/27 09:22,1053000,34\n2012/11/27 09:23,2198000,69\n2012/11/27 09:24,10532000,563\n2012/11/27 09:25,13114000,468\n2012/11/27 09:26,8243000,378\n2012/11/27 09:27,9581000,263\n2012/11/27 09:28,1487000,103\n2012/11/27 09:29,1673000,71\n2012/11/27 09:30,8708000,151\n2012/11/27 09:31,20014000,869\n2012/11/27 09:32,27914000,508\n2012/11/27 09:33,7751000,265\n2012/11/27 09:34,5262000,109\n2012/11/27 09:35,3158000,97\n2012/11/27 09:36,1445000,98\n2012/11/27 09:37,2312000,94\n2012/11/27 09:38,4109000,131\n2012/11/27 09:39,1926000,100\n2012/11/27 09:40,3349000,161\n2012/11/27 09:41,1218000,75\n2012/11/27 09:42,26471000,106\n2012/11/27 09:43,1410000,58\n2012/11/27 09:44,1354000,63\n2012/11/27 09:45,4818000,101\n2012/11/27 09:46,9989000,258\n2012/11/27 09:47,1453000,83\n2012/11/27 09:48,2826000,321\n2012/11/27 09:49,1036000,50\n2012/11/27 09:50,1162000,59\n2012/11/27 09:51,673000,54\n2012/11/27 09:52,1254000,60\n2012/11/27 09:53,1160000,56\n2012/11/27 09:54,291000,38\n2012/11/27 09:55,1817000,45\n2012/11/27 09:56,2019000,72\n2012/11/27 09:57,1934000,29\n2012/11/27 09:58,3110000,47\n2012/11/27 09:59,2945000,60\n2012/11/27 10:00,15664000,160\n2012/11/27 10:01,3447000,64\n2012/11/27 10:02,2701000,90\n2012/11/27 10:03,5989000,206\n2012/11/27 10:04,4535000,154\n2012/11/27 10:05,1166000,72\n2012/11/27 10:06,1257000,47\n2012/11/27 10:07,9019000,364\n2012/11/27 10:08,9613000,421\n2012/11/27 10:09,7731000,123\n2012/11/27 10:10,2733000,89\n2012/11/27 10:11,10843000,71\n2012/11/27 10:12,749000,70\n2012/11/27 10:13,1928000,80\n2012/11/27 10:14,2364000,61\n2012/11/27 10:15,2331000,68\n2012/11/27 10:16,2844000,60\n2012/11/27 10:17,1731000,63\n2012/11/27 10:18,2415000,88\n2012/11/27 10:19,1496000,48\n2012/11/27 10:20,1167000,63\n2012/11/27 10:21,3938000,35\n2012/11/27 10:22,813000,39\n2012/11/27 10:23,1432000,80\n2012/11/27 10:24,1148000,64\n2012/11/27 10:25,674000,36\n2012/11/27 10:26,16645000,463\n2012/11/27 10:27,10891000,394\n2012/11/27 10:28,18330000,496\n2012/11/27 10:29,4928000,116\n2012/11/27 10:30,73856000,1091\n2012/11/27 10:31,8141000,204\n2012/11/27 10:32,2687000,109\n2012/11/27 10:33,5687000,109\n2012/11/27 10:34,2080000,72\n2012/11/27 10:35,2509000,68\n2012/11/27 10:36,10289000,117\n2012/11/27 10:37,4131000,125\n2012/11/27 10:38,1286000,64\n2012/11/27 10:39,1032000,36\n2012/11/27 10:40,2279000,75\n2012/11/27 10:41,12969000,129\n2012/11/27 10:42,477000,31\n2012/11/27 10:43,1825000,35\n2012/11/27 10:44,12701000,35\n2012/11/27 10:45,792000,51\n2012/11/27 10:46,2583000,97\n2012/11/27 10:47,1446000,74\n2012/11/27 10:48,1420000,66\n2012/11/27 10:49,4525000,203\n2012/11/27 10:50,23837000,851\n2012/11/27 10:51,4599000,113\n2012/11/27 10:52,2228000,129\n2012/11/27 10:53,1140000,46\n2012/11/27 10:54,1120000,69\n2012/11/27 10:55,1477000,63\n2012/11/27 10:56,8671000,140\n2012/11/27 10:57,1502000,40\n2012/11/27 10:58,1092000,25\n2012/11/27 10:59,1432000,33\n2012/11/27 11:00,6416000,244\n2012/11/27 11:01,2313000,110\n2012/11/27 11:02,1330000,60\n2012/11/27 11:03,1967000,75\n2012/11/27 11:04,1158000,75\n2012/11/27 11:05,1941000,106\n2012/11/27 11:06,5041000,92\n2012/11/27 11:07,1199000,59\n2012/11/27 11:08,2593000,74\n2012/11/27 11:09,1208000,74\n2012/11/27 11:10,13740000,760\n2012/11/27 11:11,21767000,508\n2012/11/27 11:12,3408000,130\n2012/11/27 11:13,1779000,87\n2012/11/27 11:14,3495000,143\n2012/11/27 11:15,3381000,143\n2012/11/27 11:16,2539000,80\n2012/11/27 11:17,1484000,63\n2012/11/27 11:18,3267000,113\n2012/11/27 11:19,915000,68\n2012/11/27 11:20,2451000,104\n2012/11/27 11:21,681000,38\n2012/11/27 11:22,769000,71\n2012/11/27 11:23,572000,30\n2012/11/27 11:24,1252000,48\n2012/11/27 11:25,1814000,51\n2012/11/27 11:26,3499000,218\n2012/11/27 11:27,2710000,77\n2012/11/27 11:28,1522000,51\n2012/11/27 11:29,1236000,69\n2012/11/27 11:30,2263000,95\n2012/11/27 11:31,2693000,151\n2012/11/27 11:32,2013000,102\n2012/11/27 11:33,1381000,48\n2012/11/27 11:34,1448000,42\n2012/11/27 11:35,488000,41\n2012/11/27 11:36,2480000,41\n2012/11/27 11:37,1074000,38\n2012/11/27 11:38,1054000,40\n2012/11/27 11:39,334000,37\n2012/11/27 11:40,1908000,54\n2012/11/27 11:41,1700000,30\n2012/11/27 11:42,550000,24\n2012/11/27 11:43,997000,28\n2012/11/27 11:44,1880000,42\n2012/11/27 11:45,4807000,80\n2012/11/27 11:46,6956000,244\n2012/11/27 11:47,1029000,69\n2012/11/27 11:48,662000,39\n2012/11/27 11:49,936000,61\n2012/11/27 11:50,1816000,35\n2012/11/27 11:51,1780000,46\n2012/11/27 11:52,1681000,41\n2012/11/27 11:53,556000,29\n2012/11/27 11:54,675000,19\n2012/11/27 11:55,395000,34\n2012/11/27 11:56,2068000,78\n2012/11/27 11:57,1084000,57\n2012/11/27 11:58,805000,36\n2012/11/27 11:59,697000,43\n2012/11/27 12:00,4333000,142\n2012/11/27 12:01,1723000,70\n2012/11/27 12:02,7477000,166\n2012/11/27 12:03,7365000,288\n2012/11/27 12:04,2335000,178\n2012/11/27 12:05,6927000,147\n2012/11/27 12:06,1222000,88\n2012/11/27 12:07,1469000,64\n2012/11/27 12:08,1152000,76\n2012/11/27 12:09,6600000,299\n2012/11/27 12:10,6786000,195\n2012/11/27 12:11,6733000,247\n2012/11/27 12:12,1839000,85\n2012/11/27 12:13,9132000,86\n2012/11/27 12:14,664000,41\n2012/11/27 12:15,2287000,76\n2012/11/27 12:16,4462000,87\n2012/11/27 12:17,802000,52\n2012/11/27 12:18,535000,51\n2012/11/27 12:19,769000,42\n2012/11/27 12:20,425000,36\n2012/11/27 12:21,368000,26\n2012/11/27 12:22,800000,33\n2012/11/27 12:23,1481000,53\n2012/11/27 12:24,1696000,34\n2012/11/27 12:25,1605000,48\n2012/11/27 12:26,362000,38\n2012/11/27 12:27,673000,39\n2012/11/27 12:28,575000,29\n2012/11/27 12:29,3359000,55\n2012/11/27 12:30,9491000,364\n2012/11/27 12:31,5487000,95\n2012/11/27 12:32,1630000,77\n2012/11/27 12:33,3662000,93\n2012/11/27 12:34,1326000,47\n2012/11/27 12:35,1372000,72\n2012/11/27 12:36,1486000,48\n2012/11/27 12:37,1869000,122\n2012/11/27 12:38,4205000,157\n2012/11/27 12:39,1022000,73\n2012/11/27 12:40,7359000,104\n2012/11/27 12:41,1229000,78\n2012/11/27 12:42,1830000,79\n2012/11/27 12:43,4395000,121\n2012/11/27 12:44,1843000,88\n2012/11/27 12:45,1140000,83\n2012/11/27 12:46,1077000,57\n2012/11/27 12:47,3567000,116\n2012/11/27 12:48,5447000,56\n2012/11/27 12:49,16060000,380\n2012/11/27 12:50,5492000,106\n2012/11/27 12:51,755000,62\n2012/11/27 12:52,1127000,46\n2012/11/27 12:53,2546000,95\n2012/11/27 12:54,1092000,61\n2012/11/27 12:55,1055000,42\n2012/11/27 12:56,1100000,58\n2012/11/27 12:57,820000,53\n2012/11/27 12:58,5295000,52\n2012/11/27 12:59,401000,29\n2012/11/27 13:00,2668000,204\n2012/11/27 13:01,2688000,108\n2012/11/27 13:02,1290000,46\n2012/11/27 13:03,744000,46\n2012/11/27 13:04,343000,27\n2012/11/27 13:05,1252000,43\n2012/11/27 13:06,3306000,145\n2012/11/27 13:07,11210000,122\n2012/11/27 13:08,1256000,86\n2012/11/27 13:09,1455000,65\n2012/11/27 13:10,2100000,105\n2012/11/27 13:11,4724000,83\n2012/11/27 13:12,919000,71\n2012/11/27 13:13,3399000,86\n2012/11/27 13:14,1424000,69\n2012/11/27 13:15,2913000,114\n2012/11/27 13:16,980000,80\n2012/11/27 13:17,463000,36\n2012/11/27 13:18,1488000,97\n2012/11/27 13:19,1886000,124\n2012/11/27 13:20,4359000,226\n2012/11/27 13:21,3146000,90\n2012/11/27 13:22,1203000,47\n2012/11/27 13:23,3195000,64\n2012/11/27 13:24,789000,49\n2012/11/27 13:25,1668000,49\n2012/11/27 13:26,1239000,40\n2012/11/27 13:27,1687000,87\n2012/11/27 13:28,8941000,217\n2012/11/27 13:29,8925000,186\n2012/11/27 13:30,6300000,158\n2012/11/27 13:31,1865000,72\n2012/11/27 13:32,910000,71\n2012/11/27 13:33,14315000,528\n2012/11/27 13:34,4254000,182\n2012/11/27 13:35,12681000,375\n2012/11/27 13:36,8310000,292\n2012/11/27 13:37,15484000,414\n2012/11/27 13:38,3959000,129\n2012/11/27 13:39,3510000,139\n2012/11/27 13:40,4018000,154\n2012/11/27 13:41,10326000,185\n2012/11/27 13:42,6870000,83\n2012/11/27 13:43,6320000,204\n2012/11/27 13:44,7549000,121\n2012/11/27 13:45,2492000,136\n2012/11/27 13:46,2531000,99\n2012/11/27 13:47,1210000,80\n2012/11/27 13:48,1395000,58\n2012/11/27 13:49,789000,55\n2012/11/27 13:50,3828000,174\n2012/11/27 13:51,4893000,93\n2012/11/27 13:52,1090000,61\n2012/11/27 13:53,634000,51\n2012/11/27 13:54,3983000,87\n2012/11/27 13:55,5249000,43\n2012/11/27 13:56,1455000,46\n2012/11/27 13:57,858000,40\n2012/11/27 13:58,1878000,30\n2012/11/27 13:59,3402000,64\n2012/11/27 14:00,4667000,190\n2012/11/27 14:01,1267000,67\n2012/11/27 14:02,1629000,67\n2012/11/27 14:03,1167000,53\n2012/11/27 14:04,7156000,419\n2012/11/27 14:05,6228000,252\n2012/11/27 14:06,4414000,181\n2012/11/27 14:07,9198000,311\n2012/11/27 14:08,2784000,147\n2012/11/27 14:09,1002000,88\n2012/11/27 14:10,2173000,91\n2012/11/27 14:11,1679000,89\n2012/11/27 14:12,6927000,97\n2012/11/27 14:13,1733000,66\n2012/11/27 14:14,964000,74\n2012/11/27 14:15,26132000,999\n2012/11/27 14:16,18159000,495\n2012/11/27 14:17,8516000,162\n2012/11/27 14:18,2473000,131\n2012/11/27 14:19,10113000,257\n2012/11/27 14:20,10320000,279\n2012/11/27 14:21,19140000,584\n2012/11/27 14:22,3217000,169\n2012/11/27 14:23,13142000,186\n2012/11/27 14:24,1561000,120\n2012/11/27 14:25,8522000,114\n2012/11/27 14:26,1949000,56\n2012/11/27 14:27,5519000,161\n2012/11/27 14:28,2052000,111\n2012/11/27 14:29,736000,59\n2012/11/27 14:30,3075000,110\n2012/11/27 14:31,31179000,652\n2012/11/27 14:32,10515000,242\n2012/11/27 14:33,7069000,139\n2012/11/27 14:34,1339000,84\n2012/11/27 14:35,2868000,131\n2012/11/27 14:36,3813000,91\n2012/11/27 14:37,7742000,172\n2012/11/27 14:38,7217000,225\n2012/11/27 14:39,2377000,71\n2012/11/27 14:40,2014000,77\n2012/11/27 14:41,4501000,77\n2012/11/27 14:42,2574000,87\n2012/11/27 14:43,7200000,280\n2012/11/27 14:44,5480000,240\n2012/11/27 14:45,1938000,123\n2012/11/27 14:46,3611000,108\n2012/11/27 14:47,2859000,73\n2012/11/27 14:48,2247000,75\n2012/11/27 14:49,4188000,105\n2012/11/27 14:50,7735000,190\n2012/11/27 14:51,2908000,58\n2012/11/27 14:52,1926000,65\n2012/11/27 14:53,11787000,61\n2012/11/27 14:54,890000,47\n2012/11/27 14:55,5578000,120\n2012/11/27 14:56,4487000,88\n2012/11/27 14:57,3710000,63\n2012/11/27 14:58,299000,42\n2012/11/27 14:59,1478000,52\n2012/11/27 15:00,9502000,105\n2012/11/27 15:01,4101000,110\n2012/11/27 15:02,4319000,144\n2012/11/27 15:03,13090000,477\n2012/11/27 15:04,39775000,1690\n2012/11/27 15:05,16653000,407\n2012/11/27 15:06,5856000,339\n2012/11/27 15:07,14394000,241\n2012/11/27 15:08,10271000,212\n2012/11/27 15:09,4211000,164\n2012/11/27 15:10,5922000,140\n2012/11/27 15:11,2673000,82\n2012/11/27 15:12,8414000,182\n2012/11/27 15:13,11190000,181\n2012/11/27 15:14,4797000,175\n2012/11/27 15:15,20442000,421\n2012/11/27 15:16,12138000,273\n2012/11/27 15:17,4010000,143\n2012/11/27 15:18,12364000,131\n2012/11/27 15:19,2961000,85\n2012/11/27 15:20,5260000,173\n2012/11/27 15:21,2086000,98\n2012/11/27 15:22,26692000,158\n2012/11/27 15:23,1693000,95\n2012/11/27 15:24,19299000,510\n2012/11/27 15:25,2803000,91\n2012/11/27 15:26,3111000,98\n2012/11/27 15:27,5951000,144\n2012/11/27 15:28,10205000,183\n2012/11/27 15:29,1347000,54\n2012/11/27 15:30,3257000,76\n2012/11/27 15:31,20826000,423\n2012/11/27 15:32,9212000,215\n2012/11/27 15:33,30188000,892\n2012/11/27 15:34,13454000,297\n2012/11/27 15:35,7539000,175\n2012/11/27 15:36,6391000,162\n2012/11/27 15:37,3213000,99\n2012/11/27 15:38,2330000,107\n2012/11/27 15:39,6039000,99\n2012/11/27 15:40,4488000,129\n2012/11/27 15:41,1009000,73\n2012/11/27 15:42,5069000,114\n2012/11/27 15:43,2003000,62\n2012/11/27 15:44,1461000,54\n2012/11/27 15:45,2260000,78\n2012/11/27 15:46,2625000,61\n2012/11/27 15:47,2456000,95\n2012/11/27 15:48,7917000,79\n2012/11/27 15:49,876000,51\n2012/11/27 15:50,2411000,44\n2012/11/27 15:51,719000,39\n2012/11/27 15:52,733000,52\n2012/11/27 15:53,1136000,59\n2012/11/27 15:54,1961000,116\n2012/11/27 15:55,2761000,60\n2012/11/27 15:56,1003000,50\n2012/11/27 15:57,2479000,42\n2012/11/27 15:58,470000,27\n2012/11/27 15:59,12358000,157\n2012/11/27 16:00,5191000,182\n2012/11/27 16:01,6550000,123\n2012/11/27 16:02,3028000,89\n2012/11/27 16:03,5422000,87\n2012/11/27 16:04,6844000,86\n2012/11/27 16:05,13616000,142\n2012/11/27 16:06,10124000,61\n2012/11/27 16:07,4729000,61\n2012/11/27 16:08,1163000,47\n2012/11/27 16:09,5937000,73\n2012/11/27 16:10,747000,40\n2012/11/27 16:11,4910000,39\n2012/11/27 16:12,2257000,58\n2012/11/27 16:13,360000,50\n2012/11/27 16:14,1361000,67\n2012/11/27 16:15,248000,45\n2012/11/27 16:16,3235000,141\n2012/11/27 16:17,1115000,67\n2012/11/27 16:18,1445000,44\n2012/11/27 16:19,1479000,44\n2012/11/27 16:20,1952000,55\n2012/11/27 16:21,2941000,56\n2012/11/27 16:22,295000,24\n2012/11/27 16:23,190000,18\n2012/11/27 16:24,558000,25\n2012/11/27 16:25,1000000,23\n2012/11/27 16:26,1202000,15\n2012/11/27 16:27,510000,28\n2012/11/27 16:28,104000,16\n2012/11/27 16:29,296000,24\n2012/11/27 16:30,318000,24\n2012/11/27 16:31,617000,37\n2012/11/27 16:32,1374000,26\n2012/11/27 16:33,828000,88\n2012/11/27 16:34,10587000,40\n2012/11/27 16:35,609000,49\n2012/11/27 16:36,11550000,224\n2012/11/27 16:37,5244000,141\n2012/11/27 16:38,13984000,244\n2012/11/27 16:39,7889000,171\n2012/11/27 16:40,2274000,70\n2012/11/27 16:41,5907000,65\n2012/11/27 16:42,644000,37\n2012/11/27 16:43,564000,35\n2012/11/27 16:44,409000,32\n2012/11/27 16:45,231000,32\n2012/11/27 16:46,1896000,36\n2012/11/27 16:47,1927000,54\n2012/11/27 16:48,715000,24\n2012/11/27 16:49,489000,26\n2012/11/27 16:50,282000,13\n2012/11/27 16:51,358000,17\n2012/11/27 16:52,711000,49\n2012/11/27 16:53,3486000,207\n2012/11/27 16:54,3069000,68\n2012/11/27 16:55,11854000,143\n2012/11/27 16:56,1401000,41\n2012/11/27 16:57,1426000,41\n2012/11/27 16:58,455000,25\n2012/11/27 16:59,3364000,79\n2012/11/27 17:00,1062000,59\n2012/11/27 17:01,496000,33\n2012/11/27 17:02,6709000,149\n2012/11/27 17:03,3491000,115\n2012/11/27 17:04,1217000,63\n2012/11/27 17:05,800000,48\n2012/11/27 17:06,5460000,71\n2012/11/27 17:07,257000,19\n2012/11/27 17:08,2625000,56\n2012/11/27 17:09,560000,37\n2012/11/27 17:10,107000,18\n2012/11/27 17:11,558000,26\n2012/11/27 17:12,281000,27\n2012/11/27 17:13,1127000,39\n2012/11/27 17:14,1056000,29\n2012/11/27 17:15,292000,22\n2012/11/27 17:16,397000,24\n2012/11/27 17:17,9397000,132\n2012/11/27 17:18,1327000,43\n2012/11/27 17:19,578000,35\n2012/11/27 17:20,290000,22\n2012/11/27 17:21,350000,20\n2012/11/27 17:22,262000,8\n2012/11/27 17:23,173000,10\n2012/11/27 17:24,384000,42\n2012/11/27 17:25,228000,15\n2012/11/27 17:26,137000,11\n2012/11/27 17:27,210000,16\n2012/11/27 17:28,1166000,11\n2012/11/27 17:29,1236000,33\n2012/11/27 17:30,540000,36\n2012/11/27 17:31,2465000,158\n2012/11/27 17:32,462000,33\n2012/11/27 17:33,332000,30\n2012/11/27 17:34,37000,10\n2012/11/27 17:35,139000,9\n2012/11/27 17:36,176000,7\n2012/11/27 17:37,88000,13\n2012/11/27 17:38,164000,7\n2012/11/27 17:39,358000,19\n2012/11/27 17:40,530000,41\n2012/11/27 17:41,894000,29\n2012/11/27 17:42,516000,56\n2012/11/27 17:43,132000,23\n2012/11/27 17:44,322000,21\n2012/11/27 17:45,526000,26\n2012/11/27 17:46,734000,55\n2012/11/27 17:47,375000,24\n2012/11/27 17:48,349000,26\n2012/11/27 17:49,238000,28\n2012/11/27 17:50,226000,25\n2012/11/27 17:51,419000,23\n2012/11/27 17:52,2483000,36\n2012/11/27 17:53,208000,14\n2012/11/27 17:54,236000,17\n2012/11/27 17:55,169000,13\n2012/11/27 17:56,781000,13\n2012/11/27 17:57,270000,16\n2012/11/27 17:58,160000,14\n2012/11/27 17:59,114000,16\n2012/11/27 18:00,903000,42\n2012/11/27 18:01,801000,18\n2012/11/27 18:02,850000,31\n2012/11/27 18:03,2480000,118\n2012/11/27 18:04,1666000,60\n2012/11/27 18:05,695000,34\n2012/11/27 18:06,206000,23\n2012/11/27 18:07,255000,32\n2012/11/27 18:08,2038000,27\n2012/11/27 18:09,234000,17\n2012/11/27 18:10,92000,12\n2012/11/27 18:11,592000,23\n2012/11/27 18:12,559000,34\n2012/11/27 18:13,6455000,65\n2012/11/27 18:14,559000,37\n2012/11/27 18:15,754000,82\n2012/11/27 18:16,277000,22\n2012/11/27 18:17,10258000,25\n2012/11/27 18:18,1460000,23\n2012/11/27 18:19,644000,22\n2012/11/27 18:20,58000,6\n2012/11/27 18:21,528000,22\n2012/11/27 18:22,343000,23\n2012/11/27 18:23,446000,14\n2012/11/27 18:24,53000,10\n2012/11/27 18:25,89000,11\n2012/11/27 18:26,311000,23\n2012/11/27 18:27,6922000,61\n2012/11/27 18:28,428000,23\n2012/11/27 18:29,412000,24\n2012/11/27 18:30,289000,16\n2012/11/27 18:31,86000,11\n2012/11/27 18:32,658000,25\n2012/11/27 18:33,196000,12\n2012/11/27 18:34,325000,17\n2012/11/27 18:35,298000,21\n2012/11/27 18:36,124000,10\n2012/11/27 18:37,185000,18\n2012/11/27 18:38,131000,15\n2012/11/27 18:39,120000,8\n2012/11/27 18:40,83000,6\n2012/11/27 18:41,185000,15\n2012/11/27 18:42,194000,5\n2012/11/27 18:43,1678000,19\n2012/11/27 18:44,403000,17\n2012/11/27 18:45,622000,16\n2012/11/27 18:46,71000,14\n2012/11/27 18:47,12000,3\n2012/11/27 18:48,308000,15\n2012/11/27 18:49,398000,12\n2012/11/27 18:50,17000,5\n2012/11/27 18:51,84000,8\n2012/11/27 18:52,810000,22\n2012/11/27 18:53,1227000,27\n2012/11/27 18:54,843000,11\n2012/11/27 18:55,208000,10\n2012/11/27 18:56,168000,24\n2012/11/27 18:57,420000,13\n2012/11/27 18:58,182000,7\n2012/11/27 18:59,170000,13\n2012/11/27 19:00,720000,43\n2012/11/27 19:01,325000,21\n2012/11/27 19:02,105000,8\n2012/11/27 19:03,273000,22\n2012/11/27 19:04,158000,11\n2012/11/27 19:05,563000,15\n2012/11/27 19:06,2135000,14\n2012/11/27 19:07,2311000,9\n2012/11/27 19:08,314000,7\n2012/11/27 19:09,174000,9\n2012/11/27 19:10,58000,15\n2012/11/27 19:11,50000,4\n2012/11/27 19:12,72000,7\n2012/11/27 19:13,528000,10\n2012/11/27 19:14,286000,14\n2012/11/27 19:15,210000,16\n2012/11/27 19:16,167000,17\n2012/11/27 19:17,218000,31\n2012/11/27 19:18,30000,7\n2012/11/27 19:19,202000,11\n2012/11/27 19:20,86000,11\n2012/11/27 19:21,146000,19\n2012/11/27 19:22,1283000,78\n2012/11/27 19:23,248000,15\n2012/11/27 19:24,137000,21\n2012/11/27 19:25,7141000,165\n2012/11/27 19:26,298000,35\n2012/11/27 19:27,2519000,29\n2012/11/27 19:28,9549000,122\n2012/11/27 19:29,955000,23\n2012/11/27 19:30,501000,55\n2012/11/27 19:31,1077000,19\n2012/11/27 19:32,180000,12\n2012/11/27 19:33,205000,11\n2012/11/27 19:34,9368000,77\n2012/11/27 19:35,347000,48\n2012/11/27 19:36,196000,21\n2012/11/27 19:37,248000,20\n2012/11/27 19:38,748000,30\n2012/11/27 19:39,323000,15\n2012/11/27 19:40,665000,32\n2012/11/27 19:41,678000,25\n2012/11/27 19:42,266000,29\n2012/11/27 19:43,109000,13\n2012/11/27 19:44,142000,23\n2012/11/27 19:45,104000,18\n2012/11/27 19:46,731000,16\n2012/11/27 19:47,190000,10\n2012/11/27 19:48,278000,10\n2012/11/27 19:49,546000,14\n2012/11/27 19:50,153000,17\n2012/11/27 19:51,472000,6\n2012/11/27 19:52,76000,5\n2012/11/27 19:53,27000,8\n2012/11/27 19:54,8000,5\n2012/11/27 19:55,93000,8\n2012/11/27 19:56,2477000,12\n2012/11/27 19:57,514000,15\n2012/11/27 19:58,86000,6\n2012/11/27 19:59,197000,50\n2012/11/27 20:00,775000,34\n2012/11/27 20:01,4135000,27\n2012/11/27 20:02,249000,12\n2012/11/27 20:03,68000,9\n2012/11/27 20:04,113000,14\n2012/11/27 20:05,84000,12\n2012/11/27 20:06,146000,10\n2012/11/27 20:07,84000,7\n2012/11/27 20:08,509000,14\n2012/11/27 20:09,66000,15\n2012/11/27 20:10,28000,4\n2012/11/27 20:11,52000,9\n2012/11/27 20:12,692000,17\n2012/11/27 20:13,357000,14\n2012/11/27 20:14,37000,10\n2012/11/27 20:15,151000,7\n2012/11/27 20:16,592000,8\n2012/11/27 20:17,525000,21\n2012/11/27 20:18,141000,8\n2012/11/27 20:19,1050000,25\n2012/11/27 20:20,74000,13\n2012/11/27 20:21,150000,9\n2012/11/27 20:22,771000,14\n2012/11/27 20:23,4272000,34\n2012/11/27 20:24,195000,23\n2012/11/27 20:25,194000,17\n2012/11/27 20:26,20000,1\n2012/11/27 20:27,58000,7\n2012/11/27 20:28,173000,7\n2012/11/27 20:29,947000,9\n2012/11/27 20:30,196000,20\n2012/11/27 20:31,1036000,10\n2012/11/27 20:32,146000,5\n2012/11/27 20:33,154000,10\n2012/11/27 20:34,160000,10\n2012/11/27 20:35,178000,13\n2012/11/27 20:36,669000,21\n2012/11/27 20:37,23000,3\n2012/11/27 20:38,331000,8\n2012/11/27 20:39,75000,9\n2012/11/27 20:40,126000,9\n2012/11/27 20:41,170000,10\n2012/11/27 20:42,536000,5\n2012/11/27 20:43,547000,11\n2012/11/27 20:44,58000,10\n2012/11/27 20:45,332000,13\n2012/11/27 20:46,95000,11\n2012/11/27 20:47,42000,7\n2012/11/27 20:48,142000,8\n2012/11/27 20:49,27000,3\n2012/11/27 20:50,76000,8\n2012/11/27 20:51,50000,11\n2012/11/27 20:52,169000,9\n2012/11/27 20:53,24000,6\n2012/11/27 20:54,49000,7\n2012/11/27 20:55,366000,43\n2012/11/27 20:56,263000,15\n2012/11/27 20:57,431000,22\n2012/11/27 20:58,713000,25\n2012/11/27 20:59,10000,5\n2012/11/27 21:00,6588000,49\n2012/11/27 21:01,462000,11\n2012/11/27 21:02,41000,5\n2012/11/27 21:03,45000,4\n2012/11/27 21:04,185000,12\n2012/11/27 21:05,531000,48\n2012/11/27 21:06,68000,8\n2012/11/27 21:07,122000,10\n2012/11/27 21:08,661000,10\n2012/11/27 21:09,456000,30\n2012/11/27 21:10,302000,36\n2012/11/27 21:11,901000,26\n2012/11/27 21:12,9090000,61\n2012/11/27 21:13,304000,18\n2012/11/27 21:14,261000,10\n2012/11/27 21:15,1075000,32\n2012/11/27 21:16,11591000,201\n2012/11/27 21:17,1880000,47\n2012/11/27 21:18,439000,22\n2012/11/27 21:19,75000,8\n2012/11/27 21:20,487000,13\n2012/11/27 21:21,2833000,41\n2012/11/27 21:22,46000,7\n2012/11/27 21:23,14000,6\n2012/11/27 21:24,510000,17\n2012/11/27 21:25,394000,17\n2012/11/27 21:26,257000,11\n2012/11/27 21:27,95000,17\n2012/11/27 21:28,169000,11\n2012/11/27 21:29,79000,10\n2012/11/27 21:30,261000,20\n2012/11/27 21:31,353000,18\n2012/11/27 21:32,237000,11\n2012/11/27 21:33,62000,9\n2012/11/27 21:34,582000,12\n2012/11/27 21:35,73000,11\n2012/11/27 21:36,436000,7\n2012/11/27 21:37,199000,7\n2012/11/27 21:38,424000,5\n2012/11/27 21:39,40000,11\n2012/11/27 21:40,90000,8\n2012/11/27 21:41,35000,5\n2012/11/27 21:42,117000,13\n2012/11/27 21:43,100000,4\n2012/11/27 21:44,14000,3\n2012/11/27 21:45,37000,9\n2012/11/27 21:46,90000,10\n2012/11/27 21:47,16000,5\n2012/11/27 21:48,34000,4\n2012/11/27 21:49,93000,7\n2012/11/27 21:50,63000,8\n2012/11/27 21:51,254000,23\n2012/11/27 21:52,386000,17\n2012/11/27 21:53,184000,8\n2012/11/27 21:54,146000,9\n2012/11/27 21:55,265000,12\n2012/11/27 21:56,2976000,143\n2012/11/27 21:57,1455000,43\n2012/11/27 21:58,1815000,135\n2012/11/27 21:59,199000,26\n2012/11/27 22:00,938000,66\n2012/11/27 22:01,570000,33\n2012/11/27 22:02,14126000,479\n2012/11/27 22:03,3023000,64\n2012/11/27 22:04,1159000,31\n2012/11/27 22:05,5399000,76\n2012/11/27 22:06,525000,33\n2012/11/27 22:07,543000,15\n2012/11/27 22:08,130000,21\n2012/11/27 22:09,426000,22\n2012/11/27 22:10,437000,13\n2012/11/27 22:11,3386000,14\n2012/11/27 22:12,286000,25\n2012/11/27 22:13,250000,14\n2012/11/27 22:14,167000,14\n2012/11/27 22:15,480000,18\n2012/11/27 22:16,473000,23\n2012/11/27 22:17,118000,12\n2012/11/27 22:18,739000,12\n2012/11/27 22:19,874000,23\n2012/11/27 22:20,320000,18\n2012/11/27 22:21,59000,5\n2012/11/27 22:22,1212000,10\n2012/11/27 22:23,508000,17\n2012/11/27 22:24,293000,20\n2012/11/27 22:25,643000,8\n2012/11/27 22:26,261000,11\n2012/11/27 22:27,186000,15\n2012/11/27 22:28,239000,15\n2012/11/27 22:29,174000,16\n2012/11/27 22:30,590000,31\n2012/11/27 22:31,1781000,89\n2012/11/27 22:32,2142000,38\n2012/11/27 22:33,301000,18\n2012/11/27 22:34,694000,22\n2012/11/27 22:35,228000,14\n2012/11/27 22:36,151000,14\n2012/11/27 22:37,51000,9\n2012/11/27 22:38,684000,9\n2012/11/27 22:39,243000,24\n2012/11/27 22:40,727000,16\n2012/11/27 22:41,146000,5\n2012/11/27 22:42,57000,6\n2012/11/27 22:43,242000,14\n2012/11/27 22:44,17000,4\n2012/11/27 22:45,258000,19\n2012/11/27 22:46,119000,10\n2012/11/27 22:47,113000,11\n2012/11/27 22:48,96000,12\n2012/11/27 22:49,655000,31\n2012/11/27 22:50,118000,6\n2012/11/27 22:51,771000,29\n2012/11/27 22:52,1421000,54\n2012/11/27 22:53,935000,24\n2012/11/27 22:54,152000,14\n2012/11/27 22:55,76000,8\n2012/11/27 22:56,381000,9\n2012/11/27 22:57,441000,13\n2012/11/27 22:58,66000,13\n2012/11/27 22:59,88000,15\n2012/11/27 23:00,1249000,18\n2012/11/27 23:01,546000,13\n2012/11/27 23:02,190000,14\n2012/11/27 23:03,33000,7\n2012/11/27 23:04,692000,31\n2012/11/27 23:05,37000,4\n2012/11/27 23:06,77000,12\n2012/11/27 23:07,304000,11\n2012/11/27 23:08,115000,14\n2012/11/27 23:09,270000,27\n2012/11/27 23:10,54000,7\n2012/11/27 23:11,466000,46\n2012/11/27 23:12,2265000,39\n2012/11/27 23:13,232000,15\n2012/11/27 23:14,407000,6\n2012/11/27 23:15,200000,10\n2012/11/27 23:16,211000,11\n2012/11/27 23:17,394000,12\n2012/11/27 23:18,401000,23\n2012/11/27 23:19,22000,6\n2012/11/27 23:20,2076000,27\n2012/11/27 23:21,333000,16\n2012/11/27 23:22,193000,10\n2012/11/27 23:23,44000,8\n2012/11/27 23:24,105000,4\n2012/11/27 23:25,68000,8\n2012/11/27 23:26,31000,5\n2012/11/27 23:27,180000,13\n2012/11/27 23:28,184000,15\n2012/11/27 23:29,131000,13\n2012/11/27 23:30,2060000,13\n2012/11/27 23:31,24388000,60\n2012/11/27 23:32,193000,19\n2012/11/27 23:33,267000,16\n2012/11/27 23:34,102000,15\n2012/11/27 23:35,44000,7\n2012/11/27 23:36,21000,3\n2012/11/27 23:37,662000,18\n2012/11/27 23:38,32000,6\n2012/11/27 23:39,42000,7\n2012/11/27 23:40,155000,10\n2012/11/27 23:41,87000,20\n2012/11/27 23:42,39000,8\n2012/11/27 23:43,1061000,10\n2012/11/27 23:44,66000,5\n2012/11/27 23:45,649000,30\n2012/11/27 23:46,687000,16\n2012/11/27 23:47,396000,16\n2012/11/27 23:48,45000,8\n2012/11/27 23:49,291000,30\n2012/11/27 23:50,102000,8\n2012/11/27 23:51,123000,10\n2012/11/27 23:52,1068000,10\n2012/11/27 23:53,78000,13\n2012/11/27 23:54,49000,11\n2012/11/27 23:55,112000,4\n2012/11/27 23:56,117000,13\n2012/11/27 23:57,872000,24\n2012/11/27 23:58,218000,11\n2012/11/27 23:59,280000,15\n"
  },
  {
    "path": "Tests/TestData/generate_reference_data_from_talib.py",
    "content": "import pandas as pd\nimport talib.abstract\n\n\ndef format_number(x):\n    if pd.isnull(x):\n        return \"\"\n    else:\n        return f\"{x:.6f}\"\n\n\ndef write_dataframe(df, fname_stem, format_dict):\n    # format index\n    datetime_output_fmt = \"%m/%d/%Y %I:%M:%S %p\"\n    df.index = df.index.strftime(datetime_output_fmt)\n    # format columns\n    for col in df.columns:\n        if format_dict is not None and col in format_dict:\n            format_function = format_dict[col]\n            df[col] = df[col].map(format_function)\n    df.to_csv(f\"{fname_stem}.csv\", sep=\",\")\n\n\ndef generate_reference_data_for_single_output_indicator(\n    df, indicator_type, parameters, fname_stem, output_name, format_dict=None\n):\n    print(\"* Processing %s\" % indicator_type.info)\n    series_output = indicator_type(df, **parameters)\n    series_output.name = output_name\n    df_output = series_output.to_frame()\n    df.columns = df.columns.str.capitalize()\n    df_all = pd.concat([df, df_output], axis=1)\n    write_dataframe(df_all, fname_stem, format_dict)\n\n\ndef generate_reference_data_for_multi_output_indicator(\n    df, indicator_type, parameters, fname_stem, output_names=None, format_dict=None\n):\n    print(\"* Processing %s\" % indicator_type.info)\n    df_output = indicator_type(df, **parameters)\n    if output_names is not None:\n        df_output.columns = output_names\n    df.columns = df.columns.str.capitalize()\n    df_all = pd.concat([df, df_output], axis=1)\n    write_dataframe(df_all, fname_stem, format_dict)\n\n\ndef main():\n    fname = \"spy_daily_klines_2013-01-16_2015-12-01_no_volume.csv\"\n    datetime_input_fmt = \"%m/%d/%Y %I:%M:%S %p\"\n    df = pd.read_csv(fname)\n    df[\"Date\"] = pd.to_datetime(df[\"Date\"], format=datetime_input_fmt)\n    df = df.set_index(\"Date\")\n    df.columns = df.columns.str.lower()\n\n    generate_reference_data_for_single_output_indicator(\n        df.copy(),\n        talib.abstract.ATR,\n        {\"timeperiod\": 14},\n        \"spy_atr\",\n        \"Average True Range 14\",\n        {\"Average True Range 14\": format_number},\n    )\n\n    generate_reference_data_for_multi_output_indicator(\n        df.copy(),\n        talib.abstract.BBANDS,\n        {\"timeperiod\": 20, \"nbdevup\": 2.0, \"nbdevdn\": 2.0},\n        \"spy_bollinger_bands\",\n        [\n            \"Bollinger Bands® 20 2 Top\",\n            \"Moving Average 20\",\n            \"Bollinger Bands® 20 2 Bottom\",\n        ],\n        {\n            \"Bollinger Bands® 20 2 Top\": format_number,\n            \"Moving Average 20\": format_number,\n            \"Bollinger Bands® 20 2 Bottom\": format_number,\n        },\n    )\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "Tests/TestData/generate_reference_data_from_talipp.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pathlib import Path\nimport talipp\nfrom talipp.indicators import ZLEMA, McGinleyDynamic  # SISO\nfrom talipp.ohlcv import OHLCVFactory\nfrom talipp.indicators import VWMA, ChaikinOsc, CHOP, ForceIndex, IBS, KVO, SOBV, RogersSatchell  # MISO\nfrom talipp.indicators import StochRSI, KST  # SIMO\nfrom talipp.indicators import ChandeKrollStop, SFX, TTM, VTX, ZigZag  # MIMO\n\n\ndef main():\n    fname = \"spy_ppo.txt\"\n    datetime_fmt = \"%m/%d/%Y %I:%M:%S %p\"\n\n    df = pd.read_csv(fname)\n    df[\"Date\"] = pd.to_datetime(df[\"Date\"], format=datetime_fmt)\n    df = df.set_index(\"Date\")\n\n    def generate_reference_data_for_siso_indicator(\n        indicator_type, parameters, output_name, fname_stem\n    ):\n        df_in = df[\"Close\"]\n        indicator = indicator_type(**parameters, input_values=df[\"Close\"].values)\n        output_values = {output_name: list(indicator)}\n        df_out = pd.concat([df_in, pd.DataFrame(output_values, index=df.index)], axis=1)\n        df_out.index = df_out.index.strftime(datetime_fmt)\n        df_out.to_csv(Path(\"out\") / f\"{fname_stem}.csv\")\n\n    def generate_reference_data_for_miso_indicator(\n        indicator_type, parameters, output_name, fname_stem\n    ):\n        df_in = df[[\"Open\", \"High\", \"Low\", \"Close\", \"Volume\"]]\n        input_values = OHLCVFactory.from_dict(\n            {\n                \"open\": df.Open,\n                \"high\": df.High,\n                \"low\": df.Low,\n                \"close\": df.Close,\n                \"volume\": df.Volume,\n            }\n        )\n        indicator = indicator_type(**parameters, input_values=input_values)\n        output_values = {output_name: list(indicator)}\n        df_out = pd.concat([df_in, pd.DataFrame(output_values, index=df.index)], axis=1)\n        df_out.index = df_out.index.strftime(datetime_fmt)\n        df_out.to_csv(Path(\"out\") / f\"{fname_stem}.csv\")\n\n    def generate_reference_data_for_simo_indicator(\n        indicator_type, parameters, output_names, fname_stem\n    ):\n        df_in = df[\"Close\"]\n        indicator = indicator_type(**parameters, input_values=df[\"Close\"].values)\n        output_values = {output_name: [] for output_name in output_names}\n        raw_output_values = list(indicator)\n        for raw_output_value in raw_output_values:\n            if raw_output_value is None:\n                for output_name in output_names:\n                    output_value_for_name = np.nan\n                    output_values[output_name].append(output_value_for_name)\n            else:\n                for output_name in output_names:\n                    output_value_for_name = getattr(raw_output_value, output_name)\n                    output_values[output_name].append(output_value_for_name)\n        df_out = pd.concat([df_in, pd.DataFrame(output_values, index=df.index)], axis=1)\n        df_out.index = df_out.index.strftime(datetime_fmt)\n        df_out.to_csv(Path(\"out\") / f\"{fname_stem}.csv\")\n\n    def generate_reference_data_for_mimo_indicator(\n        indicator_type, parameters, output_names, fname_stem\n    ):\n        df_in = df[[\"Open\", \"High\", \"Low\", \"Close\", \"Volume\"]]\n        input_values = OHLCVFactory.from_dict(\n            {\n                \"open\": df.Open,\n                \"high\": df.High,\n                \"low\": df.Low,\n                \"close\": df.Close,\n                \"volume\": df.Volume,\n            }\n        )\n        indicator = indicator_type(**parameters, input_values=input_values)\n        output_values = {output_name: [] for output_name in output_names}\n        raw_output_values = list(indicator)\n        for raw_output_value in raw_output_values:\n            if raw_output_value is None:\n                for output_name in output_names:\n                    output_value_for_name = np.nan\n                    output_values[output_name].append(output_value_for_name)\n            else:\n                for output_name in output_names:\n                    output_value_for_name = getattr(raw_output_value, output_name)\n                    output_values[output_name].append(output_value_for_name)\n        df_out = pd.concat([df_in, pd.DataFrame(output_values, index=df.index)], axis=1)\n        df_out.index = df_out.index.strftime(datetime_fmt)\n        df_out.to_csv(Path(\"out\") / f\"{fname_stem}.csv\")\n\n    def generate_reference_data_for_zigzag_indicator(\n        indicator_type, parameters, fname_stem\n    ):\n        input_values = OHLCVFactory.from_dict(\n            {\n                \"open\": df.Open,\n                \"high\": df.High,\n                \"low\": df.Low,\n                \"close\": df.Close,\n                \"volume\": df.Volume,\n            }\n        )\n        output_names = [\"ohlcv\", \"type\"]\n        indicator = indicator_type(**parameters, input_values=input_values)\n        output_values = {output_name: [] for output_name in output_names}\n        raw_output_values = list(indicator)\n        for raw_output_value in raw_output_values:\n            if raw_output_value is None:\n                for output_name in output_names:\n                    output_value_for_name = np.nan\n                    output_values[output_name].append(output_value_for_name)\n            else:\n                for output_name in output_names:\n                    output_value_for_name = getattr(raw_output_value, output_name)\n                    output_values[output_name].append(output_value_for_name)\n        df_out = pd.DataFrame(output_values)\n        df_out[\"open\"] = df_out[\"ohlcv\"].map(lambda cdl: cdl.open)\n        df_out[\"high\"] = df_out[\"ohlcv\"].map(lambda cdl: cdl.high)\n        df_out[\"low\"] = df_out[\"ohlcv\"].map(lambda cdl: cdl.low)\n        df_out[\"close\"] = df_out[\"ohlcv\"].map(lambda cdl: cdl.close)\n        df_out.index.name = \"Id\"\n        del df_out[\"ohlcv\"]\n        df_out.to_csv(Path(\"out\") / f\"{fname_stem}.csv\")\n\n    # SISO\n    generate_reference_data_for_siso_indicator(\n        ZLEMA, {\"period\": 5}, \"ZLEMA5\", \"spy_with_zlema\"\n    )\n    generate_reference_data_for_siso_indicator(\n        McGinleyDynamic, {\"period\": 14}, \"McGinleyDynamic14\", \"spy_with_McGinleyDynamic\"\n    )\n\n    # MISO\n    generate_reference_data_for_miso_indicator(\n        VWMA, {\"period\": 20}, \"VWMA20\", \"spy_with_vwma\"\n    )\n    generate_reference_data_for_miso_indicator(\n        ChaikinOsc,\n        {\"fast_period\": 5, \"slow_period\": 7},\n        \"ChaikinOsc5_7\",\n        \"spy_with_ChaikinOsc\",\n    )\n    generate_reference_data_for_miso_indicator(\n        CHOP, {\"period\": 14}, \"CHOP14\", \"spy_with_chop\"\n    )\n    generate_reference_data_for_miso_indicator(\n        ForceIndex, {\"period\": 20}, \"ForceIndex20\", \"spy_with_ForceIndex\"\n    )\n    generate_reference_data_for_miso_indicator(IBS, {}, \"IBS\", \"spy_with_ibs\")\n    generate_reference_data_for_miso_indicator(\n        KVO, {\"fast_period\": 5, \"slow_period\": 10}, \"KVO5_10\", \"spy_with_kvo\"\n    )\n    generate_reference_data_for_miso_indicator(\n        SOBV, {\"period\": 20}, \"SOBV20\", \"spy_with_sobv\"\n    )\n    generate_reference_data_for_miso_indicator(\n        RogersSatchell, {\"period\": 9}, \"RSVolat9\", \"spy_with_rsvolat\"\n    )\n\n    # SIMO\n    generate_reference_data_for_simo_indicator(\n        StochRSI,\n        {\n            \"rsi_period\": 14,\n            \"stoch_period\": 14,\n            \"k_smoothing_period\": 3,\n            \"d_smoothing_period\": 3,\n        },\n        [\"k\", \"d\"],\n        \"spy_with_StochRSI\",\n    )\n    generate_reference_data_for_simo_indicator(\n        KST,\n        {\n            \"roc1_period\": 5,\n            \"roc1_ma_period\": 5,\n            \"roc2_period\": 10,\n            \"roc2_ma_period\": 5,\n            \"roc3_period\": 15,\n            \"roc3_ma_period\": 5,\n            \"roc4_period\": 25,\n            \"roc4_ma_period\": 10,\n            \"signal_period\": 9,\n        },\n        [\"kst\", \"signal\"],\n        \"spy_with_kst\",\n    )\n\n    # MIMO\n    generate_reference_data_for_mimo_indicator(\n        ChandeKrollStop,\n        {\"atr_period\": 5, \"atr_mult\": 2.0, \"period\": 3},\n        [\"short_stop\", \"long_stop\"],\n        \"spy_with_ChandeKrollStop\",\n    )\n    generate_reference_data_for_mimo_indicator(\n        SFX,\n        {\"atr_period\": 12, \"std_dev_period\": 12, \"std_dev_smoothing_period\": 3},\n        [\"atr\", \"std_dev\", \"ma_std_dev\"],\n        \"spy_with_sfx\",\n    )\n    generate_reference_data_for_mimo_indicator(\n        TTM,\n        {\"period\": 20, \"bb_std_dev_mult\": 2.0, \"kc_atr_mult\": 2.0},\n        [\"squeeze\", \"histogram\"],\n        \"spy_with_ttm\",\n    )\n    generate_reference_data_for_mimo_indicator(\n        VTX, {\"period\": 14}, [\"plus_vtx\", \"minus_vtx\"], \"spy_with_vtx\"\n    )\n\n    # Other MIMO (ZigZag)\n    generate_reference_data_for_zigzag_indicator(\n        ZigZag, {\"sensitivity\": 0.05, \"min_trend_length\": 3}, \"spy_with_ZigZag\"\n    )\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "Tests/TestData/generate_reference_data_from_tulip.py",
    "content": "import numpy as np\nimport pandas as pd\nimport tulipy as ti\n\n\ndef write_dataframe(df, output_names, fname_stem):\n    # convert columns to np.int64\n    for col in [\"open\", \"high\", \"low\", \"close\", \"volume\"]:\n        df[col] = df[col].astype(np.int64)\n    df = df.reset_index()\n    df[\"date\"] = df[\"datetime\"].dt.strftime(\"%m/%d/%Y\")\n    df[\"time\"] = df[\"datetime\"].dt.strftime(\"%H:%M\")\n    df = df[[\"date\", \"time\", \"open\", \"high\", \"low\", \"close\", \"volume\", *output_names]]\n    df.to_csv(f\"{fname_stem}.csv\")\n\n\ndef generate_reference_data_for_siso_indicator(\n    df, indicator_type, parameters, output_name, fname_stem\n):\n    # get close column as numpy array\n    input_array = df[\"close\"].values\n    # get output array\n    output_array = indicator_type(input_array, **parameters)\n    # when the size of the output array is less than the input array, insert zeros at the beginning\n    missings = len(input_array) - len(output_array)\n    output_array = np.insert(output_array, 0, np.zeros(missings))\n    df[output_name] = output_array\n    write_dataframe(df, [output_name], fname_stem)\n\n\ndef main():\n    fname = \"../../Data/equity/usa/daily/spy.zip\"\n    df = pd.read_csv(\n        fname,\n        names=[\"datetime\", \"open\", \"high\", \"low\", \"close\", \"volume\"],\n    )\n    # convert datetime string to datetime64[ns]\n    df[\"datetime\"] = pd.to_datetime(df[\"datetime\"], format=\"%Y%m%d %H:%M\")\n    # convert columns to np.float64\n    for col in [\"open\", \"high\", \"low\", \"close\", \"volume\"]:\n        df[col] = df[col].astype(np.float64)\n    df = df.set_index(\"datetime\")\n    df = df[[\"open\", \"high\", \"low\", \"close\", \"volume\"]]\n\n    generate_reference_data_for_siso_indicator(\n        df, ti.tsf, {\"period\": 5}, \"tsf\", \"spy_tsf\"\n    )\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811C04300000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:26.730840,221.23067402896157,0.1904542767001,0.9692448737386012,0.0005723164095711541,0.44260819562702175,-1.2017831278728552,4518.02\n20230804 13:32:38.885826,224.59951965493238,0.1964152497630362,0.9670815307352458,0.0005866138875223854,0.46848313109101564,-1.2534370385915015,4521.22\n20230804 13:33:39.919149,226.56911732415136,0.1907123043444315,0.9721026857602725,0.0005264856429847506,0.4086300353940142,-1.160037307592253,4523.51\n20230804 13:34:31.943513,227.65889321180182,0.19668082715297577,0.9687239419335716,0.0005612453768545516,0.4493694808280108,-1.229662580657548,4524.37\n20230804 13:35:23.969021,231.30434530656603,0.19668063806149327,0.970781098033904,0.0005300567469469218,0.425062960516888,-1.1982230318083948,4528.13\n20230804 13:36:15.993743,230.255366872697,0.1966804456115936,0.9702097592743689,0.0005388013171165898,0.4318274975851683,-1.2070448129675118,4527.05\n20230804 13:37:07.018609,230.6426493548717,0.1966802550415236,0.9704304679663149,0.0005354655028999919,0.4291884326081937,-1.2036780040611565,4527.45\n20230804 13:37:57.039913,230.98607613965456,0.19470358326368728,0.9719116684259959,0.0005182539265604149,0.41125884287040854,-1.1748867408270562,4527.89\n20230804 13:38:48.064378,230.71395394493675,0.19470340131157357,0.9717663538763104,0.0005205178067717828,0.4130038349015602,-1.177125950434515,4527.61\n20230804 13:39:40.087498,232.29780154818158,0.19470321898069032,0.9726096833677087,0.0005073733559091461,0.40282561670823647,-1.1641104644166154,4529.24\n20230804 13:40:31.114216,230.37860032152665,0.1795600835305375,0.9806831513514335,0.0004101407199353069,0.30008544064507087,-0.8163196841053662,4527.82\n20230804 13:41:10.130483,230.98600445074925,0.17955991186823622,0.9809404538855445,0.0004054563076717007,0.2967106718252964,-0.8041703829000539,4528.4400000000005\n20230804 13:41:50.151958,229.47965103794385,0.2016562580068906,0.9664127184135122,0.0005805453783724664,0.4766098341683356,-1.2816764797952742,4526.02\n20230804 13:42:32.167814,229.41110624385078,0.20165611330815186,0.9663783223626108,0.0005810718427173991,0.4769813292520597,-1.2822318594033186,4525.95\n20230804 13:43:13.192380,228.6369762755222,0.1957344339078535,0.9699788156544475,0.0005452618865716189,0.43430130895168295,-1.207807796941145,4525.43\n20230804 13:43:52.209149,228.25872146520717,0.19573432098836055,0.9697656016522,0.0005485179631125441,0.4368191747612418,-1.211056347090668,4525.04\n20230804 13:44:33.225417,226.30006785199245,0.19573417750804506,0.9686464059331714,0.0005655547327619121,0.44994097862552823,-1.2280402903843426,4523.02\n20230804 13:45:15.248010,226.92051029190526,0.19192946595057567,0.9715658608705463,0.0005317815566044546,0.414957165919654,-1.172071025248498,4523.83\n20230804 13:45:57.268535,228.5040506045569,0.19192931439274688,0.972427174898545,0.0005181701658822898,0.40458858894021127,-1.159000575008206,4525.46\n20230804 13:46:35.285275,230.69329989851667,0.19192916290789316,0.9735724993389956,0.0004998942947589547,0.3907069047341169,-1.14142636923574,4527.71\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811C04500000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:38.738161,42.552491619528055,0.1222927482454811,0.6089838887695018,0.004926158146919335,2.447186145503481,-2.4635443887384936,4518.88\n20230804 13:32:50.892065,44.078644453245396,0.12068080611347737,0.6257304685908495,0.004923795146759556,2.4168661727960283,-2.422827838037781,4521.99\n20230804 13:33:42.181535,45.516244798693094,0.12017376147737745,0.6383590750477866,0.004886556046789502,2.390892738673792,-2.401684483564824,4524.46\n20230804 13:34:34.041116,45.27820706622335,0.11883611590037715,0.6404255212410002,0.004931929453410869,2.3861422878703427,-2.3774357187876047,4524.59\n20230804 13:35:26.022939,47.410099908647545,0.11883600036396368,0.656519466043737,0.004847722576186407,2.3485893347134152,-2.3578165230961075,4527.88\n20230804 13:36:18.219022,47.02192873938672,0.11883588507042592,0.6536591819470112,0.004863638387829622,2.3554583023879476,-2.361677343996015,4527.29\n20230804 13:37:08.121829,47.28867350983881,0.11883576930890145,0.655655656085141,0.004852963129031476,2.3504873307671015,-2.3591472158956033,4527.7\n20230804 13:37:58.184216,47.727391095108985,0.11883565573247713,0.6589058656527254,0.004835129861622162,2.3423174138367857,-2.354849764252039,4528.37\n20230804 13:38:50.082571,47.75113718977481,0.11883147507705383,0.6591089427994348,0.0048343915321299395,2.34169490373696,-2.3545943302931898,4528.41\n20230804 13:39:42.157118,48.42686254181536,0.11883543008875078,0.6640208243754593,0.004806167548119441,2.329150763054621,-2.347726457981267,4529.43\n20230804 13:40:32.048297,48.02765438914952,0.11883531553408723,0.6611369724675964,0.004822984086762039,2.3364551327124192,-2.351927560809898,4528.83\n20230804 13:41:12.033336,47.99294335445528,0.11883520206343644,0.6609006243643858,0.004824566099209632,2.336944219884871,-2.352348659018709,4528.78\n20230804 13:41:52.237572,45.817377699393084,0.11883511570453131,0.6446909242101031,0.004912364979751794,2.375743512277286,-2.3732937166032197,4525.45\n20230804 13:42:34.238781,45.998063827046956,0.11883502672586918,0.6460654996040334,0.0049053040968876985,2.3726206770931193,-2.3716681207629526,4525.7300000000005\n20230804 13:43:14.015713,44.994502991223605,0.1188349328084969,0.6383866755011105,0.004944159766675993,2.389534772230727,-2.3804930171258487,4524.17\n20230804 13:43:54.245671,45.872084721098815,0.11883484189748703,0.6451414678897696,0.004910539478310895,2.374495563744242,-2.3729453980035378,4525.5400390625\n20230804 13:44:36.188283,43.600173556218216,0.1178943906772627,0.6301961222107815,0.005023280794772677,2.4063690763176404,-2.3733615956191927,4522.33\n20230804 13:45:18.110849,45.40713502062832,0.11883466178888484,0.6416032565418004,0.004928720094727871,2.38229652869876,-2.377117014577809,4524.82\n20230804 13:45:58.170246,46.2696374747413,0.11883456978070721,0.6481895551427603,0.004895215485769787,2.367276331674167,-2.3694686779013407,4526.16\n20230804 13:46:38.168588,47.23847073809891,0.11745043495085658,0.6595169785491475,0.0048909308344755355,2.3397024385069933,-2.3323186741847843,4528.14\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811C04700000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:50.775041,0.2542901986552758,0.11757995673617389,0.010058192816836198,0.0003573993316989522,0.17075667343740097,-0.14484237059494706,4519.57\n20230804 13:33:02.900024,0.26880748530125026,0.11712791750405802,0.010608138489365536,0.0003756772452157783,0.1789386016868793,-0.1513029648481313,4521.76\n20230804 13:33:53.924939,0.27496491844075227,0.11568578264705336,0.010941598021082398,0.0003904894799931353,0.18394776243066524,-0.1537435734331547,4524.76\n20230804 13:34:45.950673,0.27760310883134626,0.11568567364352868,0.011036149651932508,0.0003934209455808088,0.1853312978202313,-0.15492250939463656,4525.01\n20230804 13:35:37.976452,0.3109501442661588,0.1156855610655333,0.012216919134188532,0.0004294671755978676,0.2025500489913444,-0.16944064767279066,4527.89\n20230804 13:36:30.000383,0.24345174227495342,0.11235401492893206,0.01005981048182081,0.00037351578946839023,0.17103660075181945,-0.13899931051679754,4527.42\n20230804 13:37:20.024346,0.24710018897710673,0.11235390542203812,0.01019557143170544,0.0003778975007090803,0.17305462483253006,-0.14066399868217697,4527.79\n20230804 13:38:10.048071,0.2525603072189932,0.11235380026484564,0.010398103361332805,0.00038440792341331556,0.17606103773564116,-0.14313846260312652,4528.33\n20230804 13:39:02.069809,0.2532919270494195,0.11235369492687963,0.010425580014010446,0.000385305143999711,0.17646117577328863,-0.14347939734305495,4528.41\n20230804 13:39:54.093597,0.26025581396024483,0.1123535858162809,0.01068251582265409,0.0003935081603245524,0.18027036966152424,-0.14659892485316903,4529.07\n20230804 13:40:43.118684,0.23776526672964104,0.11111968176216441,0.009944162109019869,0.000373814193341661,0.16934546654971333,-0.13622808917495946,4528.99\n20230804 13:41:23.138190,0.23568804910548055,0.11111957784352888,0.009866454944081095,0.0003712968729731585,0.16817396757421813,-0.13529159583866732,4528.79\n20230804 13:42:04.157847,0.21098092739376342,0.11135095123328181,0.008915086698282039,0.00033931958027086113,0.15379012187922408,-0.12390019961769273,4525.77\n20230804 13:42:46.177340,0.206825854931538,0.1111194113169503,0.008772509100621892,0.000335261078764042,0.1516300280703776,-0.12190655941293362,4525.7\n20230804 13:43:25.198106,0.19495143968197942,0.11111932390239833,0.00831753860306906,0.00032006892068350514,0.14465673071580898,-0.11627444896580419,4524.32\n20230804 13:44:06.215815,0.2012822899111172,0.11111924117563289,0.00856104759411301,0.00032823995222260206,0.14838524339442039,-0.11930267767309755,4525.08\n20230804 13:44:48.232843,0.18438416556175588,0.11142068612200969,0.007891472568565629,0.0003049248511771017,0.13806161881805085,-0.11123630809205759,4522.5\n20230804 13:45:29.255401,0.2169922640779461,0.1123477638818396,0.009074626721604877,0.0003417010052232826,0.1561405740194686,-0.1269139736005899,4524.75\n20230804 13:46:09.274110,0.22794378876286722,0.11234767778955282,0.00948616694479515,0.0003551472115098607,0.1623546028091811,-0.13201222815023564,4525.9400000000005\n20230804 13:46:49.291502,0.25300804966313756,0.11234759394407698,0.010418567727833157,0.0003852248112871126,0.1763006543063199,-0.14343451595176313,4528.46\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811P04300000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:02.791961,1.411930754346865,0.19044727203794118,-0.029779096979554165,0.0005570581547875253,0.4310773691329993,-0.5443135632502668,4519.7300000000005\n20230804 13:33:14.907596,1.3465143861602364,0.19044701340576328,-0.02855270512868391,0.0005376934971921967,0.4164627089637371,-0.5260509738411996,4521.96\n20230804 13:34:05.930074,1.2975196581437938,0.19119551234465434,-0.027526997294801903,0.000519217132286822,0.4041998610571006,-0.5128080131418389,4524.79\n20230804 13:34:57.954625,1.2352114551584763,0.19119533217894652,-0.02634904684220274,0.000500373014385221,0.38988884201779167,-0.49483118441017493,4527.09\n20230804 13:35:49.981526,1.2205265078078498,0.19119514620549455,-0.0260699848554804,0.0004958773819108824,0.38648114508257964,-0.4905372056450819,4527.650000000001\n20230804 13:36:42.004727,1.2103095462048754,0.19119496098379826,-0.025876734190033557,0.0004927831686411242,0.38409698638153605,-0.4875798271348408,4528.03\n20230804 13:37:32.029285,1.2019670306923156,0.19119477469462892,-0.025718978248511104,0.000490258087694807,0.38214428977412973,-0.48516548043116353,4528.34\n20230804 13:38:22.051215,1.1895914419347806,0.19119459563253646,-0.025484089495052542,0.0004864797514179035,0.3792413337441899,-0.4815526129319734,4528.81\n20230804 13:39:14.075378,1.197428688882077,0.191194416323564,-0.02563480607387114,0.0004889460497073825,0.3810732845353487,-0.4839084495737431,4528.49\n20230804 13:40:06.099565,1.1917139722024472,0.19119423098422036,-0.025526949928439402,0.00048722416563109117,0.3797298590681671,-0.4822610452340734,4528.7\n20230804 13:40:44.137584,1.2019570581121732,0.19119404437279466,-0.02572236010038831,0.0004903885597679858,0.3821281765716665,-0.48528441448066306,4528.3\n20230804 13:41:24.137286,1.2239129543061384,0.19119386932580096,-0.02614161536181514,0.0004971854998692839,0.3872399771713101,-0.49177597647935833,4527.4400000000005\n20230804 13:42:06.019426,1.2617227940528075,0.19119372606233903,-0.026860430816065928,0.0005087696551156046,0.3959721077447768,-0.5028314573299839,4526.0\n20230804 13:42:48.141187,1.2648633532853362,0.19119357896916678,-0.02692113644011207,0.0005097688247381129,0.39668870931086064,-0.503783180586588,4525.87\n20230804 13:43:26.123406,1.311368053526946,0.19119342952655877,-0.027799537602604674,0.0005238007544183392,0.4073013190572402,-0.5171585381988391,4524.17\n20230804 13:44:08.001362,1.3071170641936163,0.1911932892708101,-0.027720690637825007,0.0005225717394857826,0.40633165787360176,-0.5159862647460914,4524.31\n20230804 13:44:50.119205,1.3288121015496923,0.19119314169403384,-0.028130478311161222,0.0005291165869163413,0.4112372698137392,-0.5222186878787398,4523.52\n20230804 13:45:32.210562,1.2397497483443098,0.18961901852157276,-0.02665458592942971,0.0005099564391718347,0.39324603207289677,-0.49527609023758207,4524.46\n20230804 13:46:10.250707,1.1699907196824966,0.18911370470881786,-0.0253798732672208,0.0004905984208246008,0.37759456744938463,-0.4744373446748102,4526.38\n20230804 13:46:52.118366,1.0988170533190718,0.1891135655333095,-0.023999494458159853,0.0004678376076178321,0.360498761619917,-0.45315054661413334,4529.25\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811P04500000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:14.815062,20.501989188396045,0.12068088906134199,-0.3792040789695241,0.004945021916026172,2.426212967037946,-1.7542799024155868,4520.99\n20230804 13:33:16.142884,19.883799530472118,0.12050431911744174,-0.3714877690052799,0.0049189283084088865,2.4112814463598475,-1.7443755926753284,4522.52\n20230804 13:34:08.193335,19.341778708567993,0.12050415673318675,-0.36427738340865745,0.0048859195786453745,2.396426483767342,-1.7371291902875328,4523.99\n20230804 13:35:00.186549,18.084944419936402,0.12050404204826362,-0.34717486099707284,0.004800109519427834,2.3577890909031547,-1.7168651129201258,4527.52\n20230804 13:35:52.048865,17.801859722514568,0.1187781845926255,-0.3469057442627195,0.0048690797462800405,2.3568131395266882,-1.6884991971913965,4527.16\n20230804 13:36:44.089121,17.43342931100438,0.1187780693544282,-0.3417109136748786,0.004840484591342287,2.3440781392691985,-1.6816085377754981,4528.2300000000005\n20230804 13:37:34.064337,17.442487516976325,0.11877795319536208,-0.3418514240788948,0.004841507927158633,2.3443162699536133,-1.6818893762889813,4528.2\n20230804 13:38:24.140127,17.202191216232467,0.11883153314221168,-0.3383374624439076,0.004819676084029658,2.3353382104469467,-1.6779739692632276,4528.9400000000005\n20230804 13:39:16.143005,17.402526192313644,0.11877773022538586,-0.3413095513238542,0.004838945575975595,2.3427371696698525,-1.681328674119838,4528.31\n20230804 13:40:08.101091,17.31615741374643,0.11877761540490384,-0.34009587116633333,0.004832343570217545,2.3395734302606854,-1.6797458074501244,4528.56\n20230804 13:40:46.250084,17.435458980616318,0.11877750009203081,-0.3417887235707444,0.004841872970516341,2.3438222304096463,-1.6820707161689046,4528.21\n20230804 13:41:26.181916,17.8340010429721,0.11877741549350582,-0.3474189157902978,0.004873053852955896,2.3574797884468945,-1.6896059161611872,4527.05\n20230804 13:42:08.220135,18.24615068772056,0.11877732644987671,-0.35318304982210047,0.004903809305311007,2.370892767516784,-1.696853478249323,4525.87\n20230804 13:42:50.035889,18.25908116972735,0.1187772335841671,-0.35337503674085746,0.0049050448359787,2.3712195679417563,-1.697174796195995,4525.83\n20230804 13:43:28.245095,18.87413209056285,0.11877713953420728,-0.36184863548161816,0.004947730291097849,2.3900340393728285,-1.7068231370582665,4524.11\n20230804 13:44:10.179602,18.833154299908703,0.11877705571004685,-0.3613007083885772,0.004945287390159719,2.3887400817531956,-1.7063214499511137,4524.22\n20230804 13:44:52.142591,18.976859445486244,0.11877696203852647,-0.3632770134488077,0.0049551598961280734,2.3928545899426616,-1.7085347641307507,4523.82\n20230804 13:45:34.063965,18.7561623865948,0.11877686843665723,-0.3602587524399439,0.004940399645793137,2.3863688130212175,-1.7052711271540786,4524.43\n20230804 13:46:12.156254,17.743630633391742,0.11743000611229963,-0.34910975652150666,0.004939679422902787,2.36077412933625,-1.670218502784795,4526.38\n20230804 13:46:54.034201,16.804361843322788,0.11742992289140725,-0.3356726302963543,0.004864152595414345,2.3272711392775287,-1.6524041136446874,4529.12\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230811P04700000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:26.878576,176.59510774365555,0.11712799732153831,-0.9894895662555684,0.00037266514217626246,0.17749977487544452,0.5528150568990055,4521.49\n20230804 13:33:27.913507,176.09450735592685,0.13316812192459693,-0.9781418430151226,0.0006145977299559892,0.3329238319527956,0.3832304121901556,4522.41\n20230804 13:34:19.937297,174.31526995159555,0.10847405270177156,-0.993089141869986,0.0002784373526654062,0.12291523849570901,0.6065032602147982,4523.66\n20230804 13:35:11.962027,170.62340347902594,0.10847395135839645,-0.9919854776017882,0.00031701993539938537,0.14016427990631006,0.592874548223864,4527.38\n20230804 13:36:03.988450,171.01725772672262,0.09385746623307034,-0.9974009598745919,0.00013416651054947015,0.05130917276446227,0.667990934642093,4526.85\n20230804 13:36:56.011928,169.69083481851283,0.0938573752705049,-0.997216935681983,0.00014267396884569118,0.054594705942954624,0.66574453881833,4528.18\n20230804 13:37:46.033875,169.71294659278462,0.0714350767442695,-0.9998677553718425,1.1279397701210699e-05,0.0032845801780253692,0.7011755358362206,4528.11\n20230804 13:38:36.058563,168.88354700256716,0.07143500995412778,-0.9998581790938105,1.2041687393255933e-05,0.003507508171283826,0.7010593744914821,4528.9400000000005\n20230804 13:39:28.083555,169.33961069052168,0.10805734576063346,-0.991788784219275,0.00032506536462583634,0.1431963332140661,0.5908475887166027,4528.67\n20230804 13:40:19.107303,169.73582702773226,0.13091797506214334,-0.9758964200444642,0.0006780966747807996,0.36190026922402896,0.36053922013248596,4528.84\n20230804 13:40:58.125994,170.30220981561422,0.1309178696914253,-0.9762928064608472,0.0006688300461365783,0.35682878278618396,0.3653474344238265,4528.26\n20230804 13:41:38.146762,171.80647951540956,0.13091777647476333,-0.9773044070501302,0.0006449415030344614,0.3438495677836059,0.3777300281143816,4526.72\n20230804 13:42:20.163364,172.64746430229988,0.13091777647476333,-0.9778588435360822,0.0006317780421348135,0.3366712416583383,0.38454577057661626,4525.86\n20230804 13:43:01.184142,172.81397721781082,0.13091777647476333,-0.9779714291143685,0.0006291191165976123,0.3351970585357441,0.38592184458911877,4525.6900000000005\n20230804 13:43:40.206537,173.6650478898249,0.13091777647476333,-0.9785131039604058,0.0006161447466924945,0.32815797920449535,0.39263355462650146,4524.82\n20230804 13:44:21.221828,174.39938081224744,0.13091777647476333,-0.9789763083284988,0.0006050215716744906,0.32209610189236854,0.39838351206285777,4524.07\n20230804 13:45:03.240678,172.86618499714368,0.11035777690110844,-0.9917971356768949,0.0003183437398275614,0.14291609883478915,0.5887418924500986,4525.14990234375\n20230804 13:45:45.263900,173.65962519544092,0.11035769022068098,-0.9920483942428172,0.0003098121651348042,0.13903665557160116,0.5918603625803145,4524.35\n20230804 13:46:23.279100,171.00325730134267,0.08039332014600759,-0.999455757560306,3.747230331536326e-05,0.012262904522638398,0.6957228989275714,4526.83\n20230804 13:47:05.297911,168.28536576099094,0.08039326273543597,-0.9993449381243201,4.444654903765557e-05,0.01456133632594877,0.6943745279106067,4529.55\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901C04300000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:40.469130,244.22735353628988,0.1722329692179827,0.867152955254691,0.000993028920510912,2.695994035856979,-1.3703545822349465,4519.37\n20230804 13:32:52.621766,245.94766362533727,0.17132593370183255,0.8705907412809216,0.000979889975707409,2.648899717669128,-1.3541379746029023,4521.63\n20230804 13:34:03.655804,248.937657337717,0.17132593370183255,0.8739249824501336,0.0009615649011025524,2.603186510847076,-1.3425788409014496,4525.06\n20230804 13:35:13.686952,250.43331181778836,0.16933958534880997,0.8787550401164733,0.0009461252101707282,2.534196310758626,-1.3161309869652607,4527.35\n20230804 13:36:13.716456,250.3621001704474,0.16933958534880997,0.8786816646891054,0.000946556211042453,2.5351987026946126,-1.31640038172932,4527.27\n20230804 13:37:12.740868,250.59846552565688,0.16933958534880997,0.8789393693397334,0.0009450967097178576,2.5315299405087894,-1.3154945784780643,4527.54\n20230804 13:38:14.764685,251.53856099965736,0.16933958534880997,0.8799498634824227,0.0009393241402812496,2.517197244848612,-1.311903752213974,4528.61\n20230804 13:39:15.791205,251.5024525669614,0.16933958534880997,0.8799146166219226,0.0009395383516417956,2.5176648736162046,-1.3120386431929325,4528.57\n20230804 13:40:15.819954,251.30798212807875,0.16933958534880997,0.8797101187112937,0.0009407227701854286,2.5205314512065633,-1.3127776475384105,4528.35\n20230804 13:41:14.850128,250.86733126375776,0.16933958534880997,0.8792414150506334,0.0009434184128661664,2.527132773170402,-1.314456751361061,4527.85\n20230804 13:42:15.878489,249.24143512565635,0.16933958534880997,0.8774891792722563,0.0009534203349631337,2.5517719225187023,-1.3206714990311557,4526.0\n20230804 13:43:14.914324,248.40733080708387,0.16933958534880997,0.8765833192510966,0.0009585707894001593,2.5644149674864707,-1.323865492356775,4525.05\n20230804 13:44:15.945077,247.86311198484162,0.16933958534880997,0.8759902975175788,0.0009619372078425258,2.5726513494667063,-1.325951099624718,4524.43\n20230804 13:45:15.977020,247.33676818313631,0.16933958534880997,0.8754144929078406,0.0009651990413563851,2.5806257133303028,-1.3279700221187674,4523.83\n20230804 13:46:15.008556,249.193892773338,0.16933958534880997,0.877450836716137,0.0009536871155061207,2.5521785820819076,-1.3208430966870839,4525.95\n20230804 13:47:15.040329,252.2786767471685,0.16933958534880997,0.8807673081249308,0.0009347360542278717,2.505290103542902,-1.3090574259483423,4529.46\n20230804 13:48:15.065662,251.85508814881442,0.16933958534880997,0.8803203274358854,0.0009373180309424175,2.5116152270081034,-1.3106686328197104,4528.97998046875\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901C04500000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:52.479324,81.00764213657911,0.12948743928619316,0.581616949302842,0.0024023094071109518,4.903747855306072,-1.5037465474085092,4519.53\n20230804 13:33:04.627534,81.7215864438016,0.12828733478950125,0.5876342790975506,0.0024156628342228742,4.889895106349863,-1.4944030016900598,4521.76\n20230804 13:34:14.661783,83.04884469968496,0.12828733478950125,0.5930594135996519,0.002406802093352395,4.876697380345138,-1.4951026616764038,4524.01\n20230804 13:35:25.690235,85.55985865852834,0.12828733478950125,0.6031311779906828,0.0023890902723865876,4.8496987627786,-1.4958161335900375,4528.21\n20230804 13:36:25.720411,85.19736746892188,0.12828733478950125,0.6016968649947135,0.0023917444965746255,4.8536785875482575,-1.4957758756602677,4527.61\n20230804 13:37:24.745985,85.63620918934423,0.12828733478950125,0.6034416227103292,0.0023885764967714615,4.848696483795104,-1.4958531596360862,4528.34\n20230804 13:38:26.770240,85.94928630024252,0.12828733478950125,0.6046830487441004,0.0023863013423407885,4.845073554325005,-1.4958983520088018,4528.86\n20230804 13:39:26.798586,85.83339951432569,0.12828733478950125,0.6042295315604689,0.002387175374950523,4.846321694121009,-1.4959018325558735,4528.67\n20230804 13:40:27.825563,85.02071677955455,0.12737277469051242,0.6033952299750667,0.0024060405422811756,4.84837046413267,-1.4880516246476696,4528.06\n20230804 13:41:26.857564,85.74071328017008,0.12828733478950125,0.6038713168583822,0.002387898926232871,4.84723070336373,-1.4959200591887578,4528.52\n20230804 13:42:27.884124,84.13584638648645,0.12828733478950125,0.5974799981339823,0.0023994490673996086,4.864804943941997,-1.4956116841204408,4525.85\n20230804 13:43:25.918184,83.37199284124834,0.12828733478950125,0.5944051317867021,0.00240479028154276,4.872751962377091,-1.4953632001424992,4524.57\n20230804 13:44:26.951443,82.96138360662404,0.12828733478950125,0.5927446765304201,0.0024076259333863986,4.876887423616737,-1.495206475516644,4523.88\n20230804 13:45:27.982546,83.51859374758003,0.12828733478950125,0.5950058926840345,0.002403823258084542,4.8710923542194084,-1.4954474070215857,4524.82\n20230804 13:46:27.013653,84.3785744149922,0.12722896477924006,0.6012274513005609,0.002412952816541479,4.854073923398111,-1.4868075522022721,4527.12\n20230804 13:47:27.045463,86.01250458944776,0.12828733478950125,0.6049690482333956,0.002386030711926914,4.843709946246029,-1.496026983066184,4528.97998046875\n20230804 13:48:27.072959,85.17471001470838,0.12709678300753163,0.6047654955485788,0.002408978672655163,4.84387070483835,-1.4858354242124947,4528.55\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901C04700000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:04.538116,6.670022977687452,0.10437380978703878,0.10724062377114502,0.0014085807663779609,2.3186456100193893,-0.49948212132835906,4520.57\n20230804 13:33:16.634419,6.838148875343175,0.1044180288481191,0.10940734317433913,0.0014279542982118705,2.3529960452407512,-0.5074805807209775,4522.03\n20230804 13:34:26.666956,7.098862422200759,0.1044180288481191,0.11279559280486856,0.0014587444030746465,2.406176600680054,-0.5196036578875334,4524.38\n20230804 13:35:36.696185,7.111115803959695,0.1028081712963291,0.11432293657423599,0.001494710035259406,2.4312368919081586,-0.518411530262353,4527.92\n20230804 13:36:37.724277,7.092484111859059,0.1028081712963291,0.11408033086340343,0.0014925214918106217,2.427445582862229,-0.5175688229008149,4527.76\n20230804 13:37:36.749721,7.095547610893795,0.1028081712963291,0.11412148592057852,0.0014929134377252118,2.4280556258600807,-0.5177185107070329,4527.79\n20230804 13:38:38.773714,7.221622061842479,0.1028081712963291,0.11576826927477289,0.0015078556450292423,2.453491008753941,-0.5234695801580265,4528.89\n20230804 13:39:38.803870,7.1121198912737995,0.10219715652393467,0.11486970960328992,0.0015083947975280709,2.4400991950447843,-0.5178218241367135,4529.24\n20230804 13:40:39.831081,7.131060405308066,0.1028081712963291,0.1145890184258388,0.0014972147271710284,2.435216507693417,-0.5193699448777179,4528.11\n20230804 13:41:38.861921,6.986381272098494,0.1028081712963291,0.11269489492336207,0.001479963300390845,2.405745496078667,-0.5127392528050408,4526.84\n20230804 13:42:38.890160,6.845206662094178,0.1028081712963291,0.11083729611875616,0.0014628988106708941,2.3766220529136715,-0.506196577534755,4525.58\n20230804 13:43:36.926429,6.683505613908967,0.1028081712963291,0.1086978454724829,0.0014430609698179216,2.342810489304093,-0.49861073379727705,4524.11\n20230804 13:44:37.958031,6.539869353764966,0.1028081712963291,0.1067869172312817,0.0014251773316544783,2.3123569283907766,-0.4917903012273993,4522.78\n20230804 13:45:39.989170,6.594953030113145,0.10234408357909655,0.10790129505502938,0.001441926547586641,2.33048291652058,-0.4939536225067976,4524.3\n20230804 13:46:39.018916,7.091171284394875,0.1028081712963291,0.11407391722596069,0.001492638478470237,2.427060916896927,-0.5176035291050972,4527.78\n20230804 13:47:39.052025,7.145119176931178,0.10213671628981726,0.11536435252489419,0.0015139071152835183,2.4475632299745502,-0.5193339319548733,4529.68\n20230804 13:48:39.077917,7.034709467206476,0.10213671628981726,0.1139137204840441,0.0015006724552501685,2.425076791712608,-0.5142992559486418,4528.72\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901P04300000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:16.586215,14.372663473549677,0.1713427490665943,-0.13048321491610682,0.0009856492872631181,2.663466890404478,-0.7168640157835636,4520.56\n20230804 13:33:27.638891,14.318141260219996,0.17193225059881195,-0.12967431392446338,0.0009777123472066221,2.6529478289885184,-0.716985278161408,4522.18\n20230804 13:34:38.672295,14.007963579808274,0.17193225059881195,-0.12733112243241873,0.0009649122125304147,2.6209476340199296,-0.7088576186779686,4524.59\n20230804 13:35:47.703701,13.623585313469887,0.17193225059881195,-0.12441040761182531,0.0009487927391777385,2.5805815232468055,-0.6985768660312894,4527.64\n20230804 13:36:48.730561,13.52882466727424,0.17193225059881195,-0.12368850763200834,0.0009447897999082679,2.5704952464564186,-0.6960172453481341,4528.400000000001\n20230804 13:37:47.753916,13.53328946818514,0.17193225059881195,-0.123723963902861,0.0009449993880503891,2.570956807596517,-0.6961529044156912,4528.36\n20230804 13:38:50.779235,13.287385910927338,0.1706142448024827,-0.12268813947347801,0.0009468740390294523,2.5553983234493587,-0.6862338971684742,4527.61\n20230804 13:39:49.810174,13.39803023827049,0.17193225059881195,-0.12269236251926574,0.0009392672842424478,2.5564689989131746,-0.6924832707028229,4529.45\n20230804 13:40:50.836238,13.47626270493861,0.17193225059881195,-0.12329222970513287,0.0009426294206964078,2.5648306661861557,-0.6946396547554853,4528.81\n20230804 13:41:50.867430,13.805821287011325,0.17193225059881195,-0.12580634848844918,0.0009565989296033367,2.5997262642753163,-0.7035717016969467,4526.16\n20230804 13:42:49.896491,13.820435920834402,0.17193225059881195,-0.12591883672261528,0.0009572325697617998,2.601246191079085,-0.7039774307198332,4526.04\n20230804 13:43:48.930185,13.983176123322774,0.17193225059881195,-0.1271557251495674,0.0009640597748870247,2.6182387179682785,-0.7083291614076439,4524.75\n20230804 13:44:49.964241,13.850517908113233,0.17044608158263005,-0.12713412241201594,0.0009727977441335115,2.6167262308679597,-0.7010813166408938,4522.7300000000005\n20230804 13:45:50.995845,13.982192330213522,0.17193225059881195,-0.12715104014428258,0.0009640587486497422,2.6181072608385056,-0.7083316289194881,4524.75\n20230804 13:46:51.025960,13.035284665996402,0.1700693610765006,-0.12109643068136544,0.0009411390992133556,2.532319998848002,-0.678076058090564,4528.51\n20230804 13:47:51.056408,12.894978038404208,0.1700693610765006,-0.12000597703733529,0.0009349351254597743,2.5168563830442445,-0.6741797728593456,4529.67\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901P04500000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:28.609405,49.37303027376376,0.12852525480885016,-0.41382613438272253,0.0024134418712387917,4.893387215246092,-0.8253659600854981,4521.21\n20230804 13:33:39.644700,48.55069518244577,0.12835141767476596,-0.4094108276213225,0.0024096663020746743,4.882874959999689,-0.8244989212136066,4523.0\n20230804 13:34:50.674473,47.111888585899784,0.12835141767476596,-0.40088218767151584,0.002395117653913236,4.860909861596002,-0.8253067156844662,4526.55\n20230804 13:35:50.234981,47.02260754391289,0.12835141767476596,-0.4003555577554452,0.002394238468559592,4.859359966867946,-0.8253654860270292,4526.77\n20230804 13:36:50.214775,46.5671910536585,0.12835141767476596,-0.39762898915562794,0.0023893411107573275,4.851748242815439,-0.8255092633634095,4527.91\n20230804 13:37:50.004666,46.11174180045507,0.12744639177417652,-0.3969196718369685,0.002405164344510097,4.8494082824003435,-0.8177872185492704,4527.95\n20230804 13:38:52.070925,46.38735621895979,0.12835141767476596,-0.3965543286945189,0.002387425452004844,4.848585454215245,-0.8255726746831241,4528.36\n20230804 13:39:52.181811,46.1571866449443,0.12835141767476596,-0.3951703991280806,0.002384885179887978,4.844550426600081,-0.825620244952776,4528.9400000000005\n20230804 13:40:52.141263,46.41794102784136,0.12835141767476596,-0.3967454397225084,0.002387836543436548,4.849010397995062,-0.8255941031126703,4528.28\n20230804 13:41:52.237572,47.57393295561667,0.12835141767476596,-0.40366445833993736,0.0024002356844544655,4.867839240804177,-0.8252158956555375,4525.39\n20230804 13:42:52.117357,47.45237034848315,0.12835141767476596,-0.4029447040777686,0.002399013745106132,4.8658877519040145,-0.8252867902599581,4525.6900000000005\n20230804 13:43:52.006212,47.34559897177514,0.12742003293621124,-0.40442939960529567,0.002419299696286228,4.869451302124427,-0.8171631159739676,4524.83\n20230804 13:44:52.142591,48.20891917726888,0.12835141767476596,-0.40743844631795845,0.0024067515237059783,4.877302006248417,-0.8248946108451569,4523.82\n20230804 13:45:52.085282,47.20931933108766,0.12835141767476596,-0.40150638441177344,0.0023965766749259407,4.861877533212542,-0.8254306755298307,4526.29\n20230804 13:46:52.119374,46.05445650382159,0.12835141767476596,-0.39457449101167796,0.002383974333585845,4.84240279260712,-0.825725683084902,4529.1900000000005\n20230804 13:47:52.050297,46.13680259938955,0.12835141767476596,-0.39507530121158974,0.0023849418393423276,4.843798922988638,-0.8257308862335645,4528.97998046875\n"
  },
  {
    "path": "Tests/TestData/greeks/SPX230901P04700000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:32:40.614735,173.95626388086006,0.10437380978703878,-0.8921807628953952,0.0014139250851625033,2.3278657767311133,0.19909765724678521,4520.9800000000005\n20230804 13:33:51.648239,170.71619129507835,0.10377258944879224,-0.8885549580226269,0.0014551892453556286,2.385618482345156,0.1884904362063671,4524.46\n20230804 13:35:01.679130,168.1457908772616,0.10377258944879224,-0.8842862284496098,0.0014937933056153494,2.451930930986033,0.1734097610045912,4527.36\n20230804 13:36:01.710955,167.79988190180197,0.10160206836674521,-0.8896085932562653,0.0014753692788630217,2.370769030525521,0.20092152125924365,4527.16\n20230804 13:37:01.735958,166.86674275853042,0.10160206836674521,-0.8880554467782633,0.0014898751096756693,2.3951322337515784,0.19548150294812197,4528.21\n20230804 13:38:02.759368,167.38607783045552,0.10239571012404347,-0.8867638921153529,0.0014906298648857054,2.4146094154978694,0.1877350474237333,4527.84\n20230804 13:39:03.785589,166.61086784676283,0.10127386490201638,-0.8885309620896489,0.0014901294755045663,2.387896846659456,0.19845725746369014,4528.41\n20230804 13:40:03.815076,166.29122926681592,0.10127386490201638,-0.8879972271177072,0.0014951290807038488,2.3962313541353724,0.1965923666530159,4528.77\n20230804 13:41:03.843798,167.28121934772557,0.1036321205134926,-0.8832224623141565,0.0015053608357036062,2.4682360548380684,0.1702385744744567,4528.3\n20230804 13:42:03.873601,166.86168179578257,0.10242383153691026,-0.8858162729468586,0.001498974106019694,2.429198824711383,0.1842881720165128,4528.43994140625\n20230804 13:43:03.907283,169.23220105776448,0.10242383153691026,-0.8897733630961705,0.0014625408711462105,2.3672988703907434,0.19817109423759394,4525.77\n20230804 13:44:04.939351,169.82148274002412,0.102278808018488,-0.8911310167035617,0.0014518808094659968,2.34593199047775,0.20354741473421395,4525.07\n20230804 13:45:03.972156,169.7845088780918,0.10242383153691026,-0.8906848241450599,0.001454085082443517,2.3528504548243485,0.20138472378462344,4525.14990234375\n20230804 13:46:04.002919,168.8501414120273,0.10242383153691026,-0.8891539979246199,0.0014683415389597707,2.376965171779836,0.19596889849230276,4526.2\n20230804 13:47:04.032171,166.26024861573754,0.10242383153691026,-0.8848119210578222,0.0015082100628686643,2.444601477717182,0.18076313297635346,4529.12\n20230804 13:48:03.061843,166.38428063258732,0.10242383153691026,-0.8850266041461416,0.0015062758871727,2.441255225313615,0.18150400124094895,4528.97998046875\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811C00430000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:30:57.340933,21.047440455347353,0.185803458058534,0.9663230072071693,0.0063454486925474925,0.05419947266648251,-0.1228920644296124,450.42\n20230804 13:31:40.364128,21.500221778491937,0.18580330320493155,0.9694981888690833,0.005855605323979821,0.05282918373941925,-0.11852410834073668,450.89\n20230804 13:32:14.413346,21.69326450968368,0.19687868074223572,0.9618813799611895,0.006608210896864706,0.05454361899040805,-0.13308145375104294,451.03000000000003\n20230804 13:32:45.499187,21.760494486209804,0.19687854622328962,0.962358011451229,0.006539916875573538,0.05453649912005787,-0.1323978184535324,451.1\n20230804 13:33:15.512925,21.80842185337985,0.19687842851777182,0.9627052153915793,0.006490505782491212,0.054528818952242375,-0.13190288659651628,451.15000000000003\n20230804 13:33:47.530680,22.010113295640853,0.19687831143318085,0.9641337632173791,0.006285967215762588,0.05450747018834079,-0.12985219197830697,451.36\n20230804 13:34:18.546744,21.871970640596615,0.18098690030263406,0.974413528832785,0.005165882382524134,0.038877321863488135,-0.10976943290511708,451.29\n20230804 13:34:49.564187,22.086465057544913,0.1809867891300418,0.9755286106710044,0.004972556383758933,0.03742179738676299,-0.10812233409922939,451.51\n20230804 13:35:18.577958,22.14488756927153,0.18098668146370178,0.9758377753265929,0.004919236192616816,0.03741465161139601,-0.10661767753202511,451.57\n20230804 13:35:49.592219,22.06833550703641,0.17875581451001826,0.9768957766247174,0.004798059290618427,0.037349757506554226,-0.10006561529689861,451.5\n20230804 13:36:20.611784,22.05850985537015,0.17875570768232368,0.9768498544574842,0.004806356391023781,0.03734890261364754,-0.10028462049510622,451.49\n20230804 13:36:51.624680,22.195009166088333,0.1787555940930322,0.9775669459347044,0.0046806275428319215,0.03733594789187222,-0.09678393121330231,451.63\n20230804 13:37:23.637753,22.183302773763074,0.1808705619990828,0.976123808310318,0.004873454792224311,0.037403857390248874,-0.10512219650135535,451.61\n20230804 13:37:52.655619,22.16380280081714,0.18087044663748655,0.9760225323524204,0.004891014668649928,0.03740564436958138,-0.10562222355546069,451.59\n20230804 13:38:23.669160,22.261224436625863,0.18087033957228002,0.9765344809842877,0.0048025251775927645,0.0373949087347043,-0.10308851698220778,451.69\n20230804 13:38:55.686791,22.273314066370922,0.19191949452477952,0.9697853639643764,0.005614434828831585,0.05187195715212667,-0.12003000921702167,451.66\n20230804 13:39:26.700491,22.29273353542402,0.19191937198832135,0.9698864398414854,0.005598161750368531,0.051564142720756934,-0.1198743747072923,451.68\n20230804 13:39:57.713380,22.341399356538187,0.191919250543926,0.9701316330553114,0.005558285841216218,0.05082148192117231,-0.11949305645222157,451.73\n20230804 13:40:29.729895,22.177900603451,0.1794798713138514,0.9770213159595911,0.004757021319702006,0.037354172498030636,-0.09985399831298736,451.61\n20230804 13:41:01.742741,22.294823568312363,0.1794797576114709,0.9776388699715698,0.00464942881642841,0.03734141616048703,-0.09682162006201267,451.73\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811C00450000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:00.113008,3.605411003170172,0.1205431957107253,0.5566289768050567,0.0516411448706375,0.25139752254452485,-0.245650877919634,450.54\n20230804 13:31:42.042411,3.8136240869751603,0.12023076939687045,0.5763224836999639,0.05128519141520815,0.2507574587656167,-0.24481782884389147,450.92\n20230804 13:32:16.227140,3.8724450774465953,0.12054301015225863,0.5807619995632608,0.051044365902012334,0.2506078212147087,-0.2452982946801181,451.01\n20230804 13:32:46.196835,3.8871948791550643,0.120230584319338,0.5830107306229445,0.05112369728967385,0.25051728047935207,-0.24473754299421796,451.05\n20230804 13:33:18.119088,3.944051581276872,0.12023051204009261,0.5881514795977151,0.050995829619118124,0.250350839793664,-0.24466072619414878,451.15\n20230804 13:33:50.090112,4.091710939893538,0.1202304405022821,0.6015088306325473,0.050666215392591085,0.24990623484928687,-0.2444709901997367,451.41\n20230804 13:34:20.229864,4.024660649681237,0.11799983438088457,0.6022387224888369,0.05160481908946222,0.2498236924050099,-0.24064318905995757,451.39\n20230804 13:34:50.249767,4.112744606325862,0.11799976212764739,0.6099848800016704,0.05135977313490748,0.2466472318333972,-0.24034731040457685,451.54\n20230804 13:35:20.044502,4.157940209805599,0.11799968960986057,0.6134599740220027,0.051177846174317865,0.24115824160369748,-0.23993588585053238,451.61\n20230804 13:35:52.047864,4.069838450563978,0.11799962146358942,0.6064270395999813,0.051503428187942485,0.2496611586949289,-0.24060293657406415,451.47\n20230804 13:36:22.183200,4.125489974391178,0.117999548945893,0.6109803928074977,0.05131017189562199,0.24506139632895518,-0.24023859723548155,451.56\n20230804 13:36:54.051040,4.125325178726045,0.11799947654740538,0.6109828114855445,0.05131251393864041,0.24504396698747755,-0.24024764974820448,451.56\n20230804 13:37:24.246122,4.151150376946778,0.11799940343711031,0.612968760987096,0.05120855438898397,0.24190736869457297,-0.24001244091246185,451.6\n20230804 13:37:54.226356,4.138072028188247,0.11799932909738313,0.611978330857681,0.05126288272205491,0.2434581979103232,-0.24013901718176509,451.58\n20230804 13:38:26.033833,4.188536779055904,0.11740968236870165,0.6174705217884602,0.05123369783549392,0.2394648412659528,-0.23849925379768955,451.68\n20230804 13:38:58.019751,4.20247264850026,0.11799918730560625,0.6169449724425813,0.051005344387320045,0.2394890771796998,-0.2395601077921515,451.68\n20230804 13:39:28.017477,4.241211142064364,0.11799911309144796,0.6199224538461585,0.05084953884749773,0.23939048407128372,-0.2392072791255888,451.74\n20230804 13:40:00.058861,4.228132689218489,0.11799904038279418,0.6189328827437259,0.050903781767026264,0.23941197403634895,-0.23933379493314863,451.72\n20230804 13:40:32.048297,4.22813096070796,0.11799896808854274,0.6189329483812261,0.05090380979874323,0.23941196961351086,-0.2393336659643857,451.72\n20230804 13:41:04.065545,4.182769078129026,0.11799889329459404,0.6154613824488051,0.05108799597150176,0.23951560608908906,-0.23975418472730015,451.65000000000003\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811C00470000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:02.232135,0.03206728010088957,0.12709100877661092,0.011474474878303956,0.0037050576858501834,0.02313533563513956,-0.017422779300172365,450.72\n20230804 13:31:44.196801,0.03175779102417369,0.1259094919283728,0.01146639455237868,0.003736168056168389,0.023203057479213487,-0.01726404186866556,450.89\n20230804 13:32:18.214228,0.03313055448045833,0.12590938766122245,0.01190881061976221,0.0038597367601864415,0.024084131032561705,-0.017847726709556856,451.0\n20230804 13:32:48.161729,0.033621356911913064,0.12590930249746174,0.01206726521217572,0.0039040980111772353,0.024399088903268022,-0.01805740545360267,451.04\n20230804 13:33:20.241006,0.034755173844111295,0.1259092276002709,0.012432082818431358,0.0040057943074036165,0.02512688367646071,-0.01853835546335314,451.13\n20230804 13:33:52.192801,0.03491853763254533,0.12590914837997416,0.012485151809083115,0.004020770444084121,0.025231665806401606,-0.018609211209264398,451.1440124511719\n20230804 13:34:22.114276,0.02912370441657598,0.12175077957745582,0.0109252487764584,0.0037033366200726055,0.022458270980433456,-0.01605405732859,451.37\n20230804 13:34:52.131497,0.031136209014515633,0.12175070698235643,0.01159481126467366,0.003896390610295193,0.023746497638778803,-0.0169093250338908,451.53\n20230804 13:35:22.212394,0.030867069882271735,0.12113631888654733,0.011555079273246489,0.003903892700877939,0.023714091778275635,-0.016780840918154013,451.61\n20230804 13:35:54.229502,0.0255352073863098,0.11944312064210308,0.009889269783363715,0.0034683763805158007,0.020741835840234403,-0.01448008474617175,451.47\n20230804 13:36:24.066239,0.02693124619305527,0.1194430467226839,0.01036244424916399,0.0036073417027709673,0.021584542345393466,-0.015072550269406217,451.58\n20230804 13:36:56.151429,0.02615710814877774,0.11944297524111444,0.010100495133299983,0.0035305828727468457,0.021089562858777257,-0.014745210453082696,451.52\n20230804 13:37:26.254244,0.026791575864249736,0.11944289882378181,0.010315537352008734,0.0035937369762799585,0.021495113023657034,-0.015014497124194118,451.57\n20230804 13:37:56.100421,0.02703284343415303,0.1194428284654704,0.010397716831337582,0.003618034011539705,0.02164914998994426,-0.015118132382677162,451.59\n20230804 13:38:28.015181,0.028301938882286458,0.11944275720220211,0.010827691292582979,0.0037442608496038744,0.022460335969809127,-0.01565682683010953,451.69\n20230804 13:39:00.051849,0.0279085622370867,0.11944268136679702,0.010694870593171615,0.0037054468660585476,0.022208729696172113,-0.015491118303807238,451.66\n20230804 13:39:30.121805,0.02854302106796808,0.1194426059574415,0.010909799168839114,0.0037685349566911287,0.022614276092931537,-0.015760452514026708,451.71\n20230804 13:40:02.219240,0.029038110721663214,0.11944253494776669,0.01107793023769181,0.0038180515949416444,0.022930553852105587,-0.015971939536345504,451.75\n20230804 13:40:34.203291,0.028911028502105682,0.1194424585513622,0.011034896365143368,0.0038054253548307237,0.02284934359557348,-0.015917984578407356,451.74\n20230804 13:41:06.181176,0.028136888975619775,0.11944238279918397,0.010773110091015038,0.003728762657131168,0.02235436223846653,-0.015590599800888982,451.68\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811P00430000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:14.351073,0.14985015079869174,0.1858033981424996,-0.03204113479832966,0.006106137957688129,0.054218081173874,-0.056464979134870114,450.67\n20230804 13:31:50.134535,0.14288720293708185,0.1859502709661319,-0.03072161979901105,0.005894713687323272,0.053267871964449515,-0.05466824265300532,450.89\n20230804 13:32:20.285395,0.14031009183651602,0.18595011946109494,-0.03021301518811174,0.0058088001274033355,0.05183548603139415,-0.05389992277621465,450.99\n20230804 13:32:50.027398,0.13876068230161626,0.18594999333173476,-0.02990779724826674,0.005757345666203671,0.05095938162166058,-0.05343947559423665,451.05\n20230804 13:33:22.017549,0.13648716937289299,0.18594988327146125,-0.029458044723834675,0.0056811235122225445,0.04966872444297499,-0.052757070234613394,451.14\n20230804 13:33:54.151389,0.1304110639453486,0.18594976533728,-0.028258335225802726,0.005478229175018087,0.046192437051774005,-0.05093819111397793,451.38\n20230804 13:34:24.122308,0.1299073340471449,0.18594964778921316,-0.02815885199533296,0.0054613981409858715,0.04590370375698535,-0.050787082113817175,451.4\n20230804 13:34:54.099838,0.12610503850833116,0.18594953776229312,-0.027409432610824774,0.005334912896761664,0.04371757892607514,-0.04965110076646392,451.55\n20230804 13:35:24.034156,0.1250995336842009,0.18594942610599255,-0.027211010097733728,0.005301368855516026,0.0431388467571559,-0.04934955402286768,451.59000000000003\n20230804 13:35:56.054929,0.13766295712562346,0.18843198018078655,-0.029313913924993402,0.00557910427279584,0.04916942213128117,-0.05330556099952534,451.46000000000004\n20230804 13:36:26.131944,0.13488932475700613,0.18843186053466213,-0.028773137070811264,0.005488759034095007,0.04758398431018945,-0.05247288079029717,451.57\n20230804 13:36:58.016507,0.1361163533184428,0.188431748707356,-0.029013672930603966,0.005529213598227637,0.04828753626256099,-0.05284567833822151,451.52\n20230804 13:37:28.030165,0.13380074720501,0.18821795225494956,-0.028593789635792087,0.0054656182597404256,0.04706299505087663,-0.05213499927878787,451.58\n20230804 13:37:58.184216,0.13381553504350274,0.18843151433165362,-0.028566552048591525,0.00545481829068492,0.046971328455248984,-0.05215959398223881,451.61\n20230804 13:38:30.072663,0.1330595043810986,0.1884314048155913,-0.028419246308185098,0.005430227333590657,0.04653818690003744,-0.05193269444223678,451.64\n20230804 13:39:02.193288,0.1330265452059288,0.18843128536104606,-0.028414143146270058,0.0054296490945177954,0.04652058935756359,-0.051927239391226454,451.64\n20230804 13:39:32.218423,0.13076038381482427,0.18843116529216858,-0.027972698279567387,0.0053559716278795385,0.04522040925099291,-0.05124719690328547,451.73\n20230804 13:40:04.083832,0.13072747783680333,0.18843105304669205,-0.02796758502878301,0.005355388372154037,0.04520277569036402,-0.0512416955062269,451.73\n20230804 13:40:36.011898,0.13022403314576722,0.18843093303622427,-0.02786955562724687,0.0053390345368601495,0.044913188506878476,-0.051090628677176037,451.75\n20230804 13:41:08.035990,0.1306940934915685,0.1884308136980232,-0.027962396396751524,0.005354796296189238,0.04518492755338299,-0.05123604005092195,451.73\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811P00450000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:16.226348,2.4919348396807317,0.12054315495541051,-0.436609782018709,0.05257364791828404,0.25087258201265916,-0.1828175113098898,450.8\n20230804 13:31:52.025186,2.4225179983159855,0.12038996624460192,-0.42866445716704815,0.05242235015391881,0.25065389005193284,-0.1823446756256389,450.95\n20230804 13:32:22.155073,2.3827519137837467,0.1205429971733141,-0.4235135492269169,0.0522107535269213,0.25050724531475277,-0.18246774234762186,451.05\n20230804 13:32:52.048670,2.3569944850008295,0.12038980866301824,-0.4208070871764147,0.05220647269975004,0.2504203128798932,-0.1821436299829567,451.1\n20230804 13:33:24.092249,2.339561652573172,0.12038973827956505,-0.4187147124659086,0.05214859376634287,0.2503621416911508,-0.18208832789687446,451.14\n20230804 13:33:56.223697,2.2567555579902123,0.12038966186758918,-0.408796946508542,0.05187741820618091,0.25006711233137047,-0.18183954665653895,451.33\n20230804 13:34:26.119896,2.1692369557820412,0.11775492181705843,-0.4042673514036411,0.05294145587288214,0.24986282075505084,-0.17723501836248948,451.38\n20230804 13:34:56.103864,2.109330753124801,0.11775485220840337,-0.39683309840336733,0.0527147768810501,0.2486267882030404,-0.17698715430292197,451.52\n20230804 13:35:26.022939,2.0908034810793983,0.11775478194157038,-0.39423972977320204,0.05257907725974611,0.24536824500944698,-0.17668166518249603,451.57\n20230804 13:35:58.092521,2.1255704141403324,0.11775471180809892,-0.398941138525543,0.05279635365206808,0.24967602202025363,-0.17712379444368104,451.48\n20230804 13:36:28.160886,2.098052965115639,0.11775463772053239,-0.39527238667346404,0.05263638827508906,0.24669206280745337,-0.17681536797090813,451.55\n20230804 13:37:00.189290,2.097931484637274,0.11775456697986793,-0.3952694830025525,0.05263871094929007,0.24667546313074062,-0.17682433363100375,451.55\n20230804 13:37:30.243501,2.0832587280740698,0.11775449280517394,-0.3932020473909868,0.052527474915439756,0.24392119338650264,-0.1765689305382089,451.59\n20230804 13:38:00.176149,2.068544889353311,0.11775442214158022,-0.391137040306625,0.052417408177288564,0.24121574808321888,-0.17631778867622694,451.63\n20230804 13:38:32.256617,2.0566160095449986,0.11740966734478385,-0.39033072212873804,0.05253214249455002,0.24088144059649208,-0.17563696043839336,451.64\n20230804 13:39:04.093188,2.053886255325962,0.11775427645663758,-0.3890771514353106,0.05230688353055753,0.24059129360636966,-0.17606413763630924,451.67\n20230804 13:39:34.074776,2.032148106396206,0.11775420286239686,-0.3859990203770753,0.05213716145472329,0.24026621365993472,-0.1756678479278466,451.73\n20230804 13:40:06.031464,2.024791446138224,0.11775413241147158,-0.38497096769080497,0.052082849112378315,0.24016909829091748,-0.17554445047815856,451.75\n20230804 13:40:38.051078,2.017554177682049,0.1177540579097533,-0.3839463413210295,0.05202636840018082,0.24008351868402178,-0.17541235303633682,451.77\n20230804 13:41:10.166742,2.028286305301764,0.11775398303105644,-0.3854799289578528,0.05211343991910054,0.24020013172658317,-0.17561920363445985,451.74\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230811P00470000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:28.359477,19.200000000000045,0.12709096792528587,-0.999999999999999,-1.3377483553175451e-14,1.6484591469634324e-12,0.0,450.8\n20230804 13:32:03.408887,18.979999999999336,0.12709087848320194,-0.9999999999999961,5.417214521503002e-14,-1.1937117960769683e-12,0.0,451.02\n20230804 13:32:33.493602,18.959999999997933,0.12709080260688863,-0.9999999999999798,-1.2616757827832683e-14,2.6716406864579767e-12,3.9040644430570797e-13,451.04\n20230804 13:33:03.509748,18.940000000001532,0.12709072774362434,-0.999999999999999,2.8524956358385314e-14,-5.115907697472721e-13,0.0,451.06\n20230804 13:33:36.524587,18.79999999999876,0.12709064505976536,-0.999999999999945,-5.483870015786057e-14,2.5011104298755527e-12,3.9044368947363614e-13,451.2\n20230804 13:34:07.540042,18.688226178925834,0.1633640949984434,-0.9872254968789541,0.010155240503729053,0.028426399849422523,-0.008226178925827554,451.32\n20230804 13:34:37.559188,18.629065620180466,0.1633640226837231,-0.9864239046911479,0.010372107542839593,0.029114488708412267,-0.009065620180461309,451.38\n20230804 13:35:07.573840,18.46149802743429,0.16336392410505463,-0.9841019509312251,0.010992209233312601,0.03125403087968692,-0.011498027434299729,451.55\n20230804 13:35:37.584810,18.445546778876995,0.1601812186765261,-0.989593666712467,0.009792318636561667,0.02629973373253236,-0.005546778876997394,451.56\n20230804 13:36:09.604125,18.544259837393607,0.16018114080588955,-0.9908470679246708,0.009420786662080342,0.025103820291828782,-0.004259837393586707,451.46\n20230804 13:36:39.619998,18.41593029108728,0.1601810387979312,-0.9892202202850835,0.009901027880017607,0.026644079397147635,-0.005930291087313577,451.59000000000003\n20230804 13:37:11.634285,18.490324951471912,0.16682708323257875,-0.9793794515591275,0.011762142084505016,0.035473278781161355,-0.020324951471941688,451.53000000000003\n20230804 13:37:41.647218,18.451213202446304,0.16682700832512645,-0.9789314315579312,0.011822274001839378,0.035823246385767504,-0.02121320244629743,451.57\n20230804 13:38:11.664470,18.333956774724935,0.16682690735547212,-0.9775660762060941,0.011974131376025477,0.037649859148128684,-0.023956774724933183,451.69\n20230804 13:38:43.680000,18.382792707652104,0.1668268097658245,-0.9781432810098554,0.011913549331123197,0.03674181081992245,-0.022792707652090627,451.64\n20230804 13:39:15.693366,18.333939585193516,0.1668268097658245,-0.97757451942204,0.011973401618428369,0.03763371710250141,-0.02393958519351358,451.69\n20230804 13:39:45.708543,18.27534332254604,0.1668268097658245,-0.9768787724888959,0.012046097454159115,0.038775573678403674,-0.024917197393090805,451.75\n20230804 13:40:17.722263,18.276474285806415,0.1671817833607687,-0.9763680343951404,0.012051820594733177,0.03953906947234387,-0.025395567456994405,451.75\n20230804 13:40:49.737658,18.276474015086514,0.16718170010202899,-0.9763681563770409,0.012051819462803754,0.039538887564265934,-0.025395456608677536,451.75\n20230804 13:41:21.752598,18.25693706914235,0.16718159437622532,-0.976140989599091,0.01207219658252634,0.039910558457062706,-0.025578271502798743,451.77\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901C00430000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:30:59.728527,23.790592054227837,0.1710760051267162,0.8622171107822842,0.010313624359684928,0.2990264840221961,-0.13847547833817425,450.44\n20230804 13:31:41.748275,24.19291535946867,0.171827478215198,0.8661175448208718,0.010073664865491003,0.298868280026074,-0.1376715622295208,450.89\n20230804 13:32:22.877098,24.31946630515754,0.171827478215198,0.8677781152559544,0.009991785031179229,0.2987395837346831,-0.13716565896124436,451.04\n20230804 13:33:03.896475,24.32780886023872,0.171827478215198,0.8678912380148852,0.009986329468626407,0.2987276196544606,-0.1371321064275078,451.05\n20230804 13:33:45.915348,24.56505940236881,0.17065527417083234,0.8720228753099134,0.009813982649814252,0.27939149234040883,-0.13500465845622436,451.35\n20230804 13:34:26.934286,24.584557373817344,0.171827478215198,0.8705046284715618,0.009833077634345724,0.2864927494837204,-0.13615108820033395,451.34\n20230804 13:35:01.949710,24.753072239669777,0.171827478215198,0.8721994646322339,0.009733006612013977,0.278140280707575,-0.13550829707314524,451.53000000000003\n20230804 13:35:32.966867,24.780263171174727,0.17002144342446102,0.875145854813225,0.009666401551598236,0.26434502943685345,-0.13352555160292615,451.61\n20230804 13:36:02.982160,24.642143132037358,0.16981916355733398,0.8740514570069828,0.00974411089783025,0.2697590745904712,-0.13384087676689643,451.46\n20230804 13:36:32.999304,24.73089697211095,0.16981916355733398,0.874951227126756,0.009690326941841325,0.2653719876524967,-0.13350304721439157,451.56\n20230804 13:37:04.012909,24.730807930082904,0.16981916355733398,0.8749533834362655,0.009690321284050231,0.26535706749952226,-0.13350316082542546,451.56\n20230804 13:37:35.030608,24.75743407412332,0.16981916355733398,0.8752232403640621,0.009674194821745117,0.2640409397023262,-0.13340180915770608,451.59\n20230804 13:38:06.043952,24.757345023376228,0.16981916355733398,0.8752254003637027,0.009674188781654146,0.26402601761777333,-0.13340191994324965,451.59\n20230804 13:38:37.061185,24.84609881023824,0.16981916355733398,0.8761246765546458,0.009620462967317351,0.2596389192412971,-0.13306407171046838,451.69\n20230804 13:39:08.073577,24.828258981576518,0.16981916355733398,0.8759470228200461,0.009631197346742816,0.26050141229210766,-0.13313174464450564,451.67\n20230804 13:39:40.088950,24.880916241994157,0.169794588914146,0.8765173570207953,0.009598600328981422,0.25772926200692936,-0.13290577215638144,451.73\n20230804 13:40:11.104364,24.863671401522332,0.16981916355733398,0.8763088330262973,0.009609708281348496,0.2587316412809031,-0.13299670114381448,451.71\n20230804 13:40:42.118239,24.87254677488726,0.16981916355733398,0.8763987331816809,0.009604338944474442,0.25829293029942235,-0.1329629144523308,451.72\n20230804 13:41:14.133220,24.81920546458895,0.16981916355733398,0.8758614411711506,0.009636555023392942,0.26091026970864206,-0.1331657387748868,451.66\n20230804 13:41:45.150169,24.81568760220163,0.16981916355733398,0.8758257986716038,0.009638684329003182,0.2610841584311103,-0.13317913091605676,451.6560363769531\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901C00450000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:02.230248,7.825789755485251,0.12876992576247204,0.571365666650784,0.02440544568366948,0.4920316122592441,-0.14998736831398338,450.72\n20230804 13:31:44.196801,7.939159994931122,0.12890350437793408,0.5756445089663962,0.02430759237376277,0.49154486200450354,-0.1501457838831417,450.90000000000003\n20230804 13:32:24.094747,8.022125252123413,0.12890350437793408,0.579015244499958,0.02425097987236462,0.49115184606307416,-0.15018079020579916,451.04\n20230804 13:33:06.030948,8.08728982102758,0.12890350437793408,0.5816622055746206,0.02420660790125515,0.49084178541952284,-0.1502085912607825,451.15\n20230804 13:33:48.219507,8.154044148945287,0.12711738920104376,0.5889342346028585,0.02442548874283911,0.4899064256331531,-0.14873923047405135,451.41\n20230804 13:34:28.121662,8.147737192513887,0.12723123372341258,0.5883814649020173,0.02441292157869168,0.48997707053909956,-0.14883193116416427,451.39\n20230804 13:35:04.229267,8.2307746180762,0.12723123372341258,0.5917881616631374,0.024354877731607733,0.4895724019739536,-0.14886817249630044,451.53\n20230804 13:35:34.168266,8.27234495223864,0.12723123372341258,0.5934908357360211,0.0243257298208803,0.48937302364069524,-0.1488856094582393,451.6\n20230804 13:36:04.089418,8.224732669980202,0.12723123372341258,0.5915446837485284,0.024359344896180305,0.4895949770235166,-0.1488670482616143,451.52\n20230804 13:36:34.092017,8.26630295826,0.12723123372341258,0.5932474547551069,0.02433019407099142,0.48939560106319036,-0.1488844848472691,451.59000000000003\n20230804 13:37:06.159157,8.24838376259821,0.12723123372341258,0.5925175770349795,0.02434298673947142,0.4894751415135197,-0.1488783786429112,451.56\n20230804 13:37:36.124620,8.284015398937436,0.12723123372341258,0.5939768872533185,0.02431800713403072,0.48930424986730614,-0.1488933239652004,451.62\n20230804 13:38:08.158154,8.27797340131989,0.12723123372341258,0.5937335278302346,0.024322470721381724,0.4893268270373614,-0.14889219947777535,451.61\n20230804 13:38:38.233410,8.283912000821497,0.12723123372341258,0.5939767223456472,0.02431830824468217,0.48929834543533524,-0.14889469031105904,451.62\n20230804 13:39:10.125031,8.337255939988912,0.12723123372341258,0.5961648511985446,0.024281161941645556,0.48903610966060995,-0.14891847370010802,451.71\n20230804 13:39:42.157118,8.361010311775614,0.12723123372341258,0.5971371463199011,0.024264527602841576,0.4889221846085512,-0.14892843681817322,451.75\n20230804 13:40:12.139190,8.360906826526257,0.12723123372341258,0.5971370213797019,0.02426482780857019,0.4889162844310917,-0.148929802565718,451.75\n20230804 13:40:44.136558,8.35496824013472,0.12723123372341258,0.5968939606697998,0.024268985947876413,0.4889447653550487,-0.14892731183997543,451.74\n20230804 13:41:16.232241,8.337049022693957,0.12723123372341258,0.5961645767532211,0.024281762929158256,0.48902430661629026,-0.14892120565287897,451.71000000000004\n20230804 13:41:46.156904,8.304898870469701,0.12723123372341258,0.5948524027216281,0.024304514555634687,0.48917209475643375,-0.14890913141523596,451.6560363769531\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901C00470000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:04.109038,0.6359749711057034,0.1059503892401261,0.10161484107510174,0.013411983355754251,0.24960683879335843,-0.04864094506158787,450.67\n20230804 13:31:46.201673,0.6543264617631345,0.10588241901933133,0.10415723525834189,0.01367364321338096,0.25687375388650724,-0.04961708967487516,450.89\n20230804 13:32:26.088796,0.6746311226541775,0.1059503892401261,0.10674269088319382,0.01390522568727992,0.26066531252817204,-0.050604838284878204,451.07\n20230804 13:33:08.243950,0.6740574764517292,0.10588241901933133,0.10672414557909736,0.013912509025392828,0.260694969084615,-0.05057270957814608,451.08\n20230804 13:33:50.091095,0.7170891021508735,0.10588241901933133,0.11205095844208275,0.014364754912200439,0.25991874632818135,-0.05241232168623858,451.42\n20230804 13:34:30.133155,0.6636031791149761,0.10391242528429809,0.10692936951330322,0.014187524172042745,0.261566215576436,-0.04988073082574431,451.41\n20230804 13:35:06.113452,0.678826960495677,0.10391242528429809,0.10884741519753378,0.014353239755833472,0.26127825555555706,-0.05053241110740623,451.53\n20230804 13:35:36.075269,0.6839145222246051,0.10391242528429809,0.10948785246806648,0.014408497634972175,0.26118331529139927,-0.050749902511938366,451.57\n20230804 13:36:06.203803,0.6724285754487,0.10391242528429809,0.10804277354135994,0.014283965043830572,0.2613937940185146,-0.05025976085205701,451.48\n20230804 13:36:36.205424,0.6876912112049144,0.10391242528429809,0.10996419064305601,0.014449757742382477,0.26110897734658634,-0.05091224875034713,451.6\n20230804 13:37:08.120828,0.6851084636046894,0.10391242528429809,0.1096401065047036,0.014421966981504393,0.2611533132640875,-0.05080272610899239,451.58\n20230804 13:37:38.251525,0.6914678745731528,0.10391242528429809,0.11044047490637997,0.014491008796048876,0.2610346413677386,-0.051074601768933935,451.63\n20230804 13:38:10.051059,0.6914288787564479,0.10391242528429809,0.11043656431483344,0.014490839508010256,0.261031509513619,-0.051073832763653564,451.63\n20230804 13:38:40.231033,0.6914288787564479,0.10391242528429809,0.11043656431483344,0.014490839508010256,0.261031509513619,-0.051073832763653564,451.63\n20230804 13:39:12.147851,0.6706788909219069,0.10284607472989514,0.10866783058317843,0.014483329796871005,0.2617902025132066,-0.050054804700620056,451.69\n20230804 13:39:44.030925,0.673228353053613,0.10284607472989514,0.1089917982281122,0.014511539056763027,0.2617416058663554,-0.050163830602855376,451.71\n20230804 13:40:14.019737,0.6731896636755184,0.10284607472989514,0.10898786040283301,0.014511364183659213,0.2617384659744604,-0.05016305340690586,451.71\n20230804 13:40:46.250084,0.674464390580372,0.10284607472989514,0.10914983516362783,0.014525467275865764,0.26171416800296543,-0.050217567500040104,451.72\n20230804 13:41:18.192443,0.6718762519556736,0.10284607472989514,0.10882193889384728,0.01449708458707262,0.2617596237120724,-0.050107760939161416,451.7\n20230804 13:41:48.142239,0.6361486330326043,0.10284607472989514,0.10409378270386664,0.014052807709144743,0.25618151389939026,-0.04841439789162346,451.37\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901P00430000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:15.738590,1.527715954294484,0.1710760051267162,-0.1379853602888257,0.010420854616437209,0.30016904718727,-0.07529227213314262,450.62\n20230804 13:31:57.777167,1.47498820104765,0.17104211363572586,-0.1342315089799963,0.010234851434412533,0.29981123990286673,-0.07412165874566518,450.95\n20230804 13:32:37.884855,1.4593790523826582,0.17104211363572586,-0.13303033427296673,0.010167058867232733,0.29651152568739203,-0.07369435355292601,451.07\n20230804 13:33:19.903518,1.4617915660302856,0.17104211363572586,-0.1332215029396629,0.010178334100859585,0.29718988636219046,-0.0737660543450318,451.05\n20230804 13:34:01.923092,1.4505067438669326,0.17104211363572586,-0.13232794582126436,0.010125575366455145,0.2936012738021663,-0.07343051088838518,451.1440124511719\n20230804 13:34:36.122034,1.4183282741911423,0.17104211363572586,-0.1297605698365466,0.00997192817144123,0.2823101440147502,-0.07244975028580569,451.42\n20230804 13:35:08.215115,1.4032506647117517,0.17104211363572586,-0.12855844020799145,0.009899971342161544,0.27686558561899366,-0.07198971350149895,451.55\n20230804 13:35:38.120445,1.4055503750463465,0.17104211363572586,-0.12874219617284569,0.009911014504923325,0.27771372035645925,-0.07206039022468065,451.53\n20230804 13:36:08.090175,1.408972495480682,0.17104211363572586,-0.12901679073131844,0.00992760350439384,0.2789526799676427,-0.07216665064826716,451.5\n20230804 13:36:38.192640,1.3928647857999812,0.17104211363572586,-0.12773053691468114,0.009850391142551453,0.2730255988301715,-0.07167249348666228,451.64\n20230804 13:37:10.144461,1.4020092289508992,0.17104211363572586,-0.12846215256948612,0.009894435696242392,0.27641168295801766,-0.07195456686605037,451.56\n20230804 13:37:40.075543,1.398562806140335,0.17104211363572586,-0.12818692406931614,0.009877910917538733,0.27513631876480527,-0.07184881226797396,451.59\n20230804 13:38:12.097557,1.3870288292474624,0.17104211363572586,-0.12726753969138052,0.009822854181034842,0.2708706172979569,-0.07149641146480844,451.69\n20230804 13:38:42.100426,1.3939215998789476,0.17104211363572586,-0.12781777416156387,0.009855874753687105,0.2734212111819554,-0.07170788405355563,451.63\n20230804 13:39:14.011173,1.3904292181278508,0.17104211363572586,-0.12754039670622014,0.009839351516955351,0.27213116995690645,-0.07160221809660355,451.66\n20230804 13:39:46.102946,1.382387633959247,0.17104211363572586,-0.12689854758170147,0.009800838372944974,0.2691554728954104,-0.07135549373026001,451.73\n20230804 13:40:16.164872,1.3938296218983182,0.17104211363572586,-0.127813297569126,0.009855853969182449,0.2733917251506084,-0.0717080309106517,451.63\n20230804 13:40:48.191966,1.3834444039035236,0.17104211363572586,-0.12698572941626068,0.009806315706858741,0.2695510761509383,-0.0713908693956858,451.72\n20230804 13:41:20.121002,1.3914860256633628,0.17104211363572586,-0.1276276240271589,0.009844833999609073,0.27252678087987614,-0.07163760737312146,451.65\n20230804 13:41:50.023018,1.423754899813289,0.17104211363572586,-0.13020554118718455,0.00999960933022177,0.2842702588316959,-0.07262779973147547,451.37\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901P00450000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:18.217760,5.314203535330723,0.12876992576247204,-0.4424110340007907,0.025863654858990504,0.4909578361900344,-0.08871787389543122,450.8\n20230804 13:32:00.117023,5.200402847701474,0.12861034143356936,-0.43591720552569485,0.025765112210906167,0.4905158732872872,-0.08853905748879115,451.05\n20230804 13:32:40.249958,5.200402847701474,0.12861034143356936,-0.43591720552569485,0.025765112210906167,0.4905158732872872,-0.08853905748879115,451.05\n20230804 13:33:22.017549,5.162292324617097,0.12861034143356936,-0.4336051761105865,0.025717979421093273,0.4903371244802699,-0.08852512051612886,451.14\n20230804 13:34:04.227007,5.090637769602309,0.12861034143356936,-0.4292518995167786,0.025628428096663675,0.49000254566740686,-0.08849511696613808,451.31\n20230804 13:34:38.193538,4.935174515143119,0.12697844210915918,-0.4239077278880825,0.025870639970448937,0.4894974268929433,-0.08706783367679687,451.49\n20230804 13:35:10.213328,4.901595530869928,0.12697844210915918,-0.421844897707836,0.025827676201159517,0.4892988383935384,-0.08705504614458233,451.57\n20230804 13:35:40.178521,4.939305602092877,0.12697844210915918,-0.42416573819356357,0.02587635405030116,0.489514916749088,-0.08707097303043887,451.48\n20230804 13:36:10.135203,4.939245240842376,0.12697844210915918,-0.4241656851956846,0.02587664726644583,0.4895090014864545,-0.08707230597591964,451.48\n20230804 13:36:40.161967,4.868038187263439,0.12697844210915918,-0.41978560629363953,0.025784987040301615,0.4891115464540814,-0.08704317276391342,451.65\n20230804 13:37:12.188332,4.888912229584399,0.12697844210915918,-0.4210722141473136,0.025812107513399556,0.4892137156096963,-0.08705262944770434,451.6\n20230804 13:37:42.214866,4.893099736746499,0.12697844210915918,-0.42132971165956307,0.025817491731896878,0.4892381452296659,-0.08705432347678384,451.59\n20230804 13:38:14.242345,4.851171418442611,0.12697844210915918,-0.4187565638789578,0.025764164436054504,0.48902384756714223,-0.08703953108162861,451.69\n20230804 13:38:44.163399,4.872103794207148,0.12697844210915918,-0.4200426396016749,0.02579092426101818,0.489120480095365,-0.08704741471778023,451.64\n20230804 13:39:16.143005,4.846924475956603,0.12697844210915918,-0.41849926444736474,0.025759105528905382,0.48899967696795255,-0.08703928625099701,451.7\n20230804 13:39:48.022173,4.83849120890642,0.12697844210915918,-0.4179848750049341,0.025748722029505476,0.4889570310895355,-0.08703757228174794,451.72\n20230804 13:40:18.233839,4.867796448021773,0.12697844210915918,-0.4197851970035866,0.025786155794255,0.4890879799979899,-0.08704850339004501,451.65000000000003\n20230804 13:40:50.131099,4.838430728497435,0.12697844210915918,-0.41798475083798187,0.02574901384687362,0.48895115672991807,-0.08703890515866478,451.72\n20230804 13:41:22.023116,4.888670579781197,0.12697844210915918,-0.4210718616177113,0.02581327712913803,0.4891900509403859,-0.08705795893702192,451.6\n20230804 13:41:52.236577,4.968267608956536,0.12697844210915918,-0.42597389446599576,0.02591616725112765,0.4895964979277245,-0.08709192790983898,451.41\n"
  },
  {
    "path": "Tests/TestData/greeks/SPY230901P00470000.csv",
    "content": ",model_price,model_impliedVol,model_delta,model_gamma,model_vega,model_theta,model_undPrice\n20230804 13:31:29.743338,19.200000000001808,0.1059503892401261,-0.9998899319704408,0.005622803801461579,0.028614379440536908,-1.0053554681670854e-13,450.8\n20230804 13:32:11.813582,18.920000000000528,0.1059503892401261,-0.9975942826363116,0.007314956505794148,0.03786164234697864,-2.0107603369549606e-13,451.08\n20230804 13:32:51.893624,18.920000000000528,0.1059503892401261,-0.9975942826363116,0.007314956505794148,0.03786164234697864,-2.0107603369549606e-13,451.08\n20230804 13:33:33.909139,18.849999999999966,0.1059503892401261,-0.9968274432885539,0.00788046585761542,0.040214894680566715,-0.0,451.15\n20230804 13:34:15.930329,18.710000000000832,0.10374728657358824,-0.999999999999999,0.005631278235243529,0.028655496540466174,0.0,451.29\n20230804 13:34:49.945330,18.52042415386688,0.11299692774989288,-0.9649778758979511,0.019522687273908015,0.11612121380833429,-0.007579675085027511,451.51\n20230804 13:35:21.959148,18.45274745922551,0.11299692774989288,-0.9633662709195413,0.01980432756094046,0.11948495015177585,-0.007686498906642262,451.58\n20230804 13:35:51.975882,18.561527032259754,0.11463159939790443,-0.9578472631836047,0.020326227262804877,0.13033201652427095,-0.00812783294395016,451.48\n20230804 13:36:21.991665,18.551862744251427,0.11463159939790443,-0.9576175989083131,0.020365404113640226,0.13084790245603983,-0.008140862911075457,451.49\n20230804 13:36:52.006730,18.42689575778121,0.11463159939790443,-0.9549750881347118,0.020883117528424356,0.13737499620319582,-0.009327260808175055,451.62\n20230804 13:37:24.023871,18.470299783421172,0.11849177166615994,-0.9411036121742099,0.020728507378593046,0.16716222545658965,-0.014902970525662302,451.62\n20230804 13:37:54.037420,18.489179948487532,0.11849177166615994,-0.9414819016425057,0.02071918462564772,0.1663204390794597,-0.01483362138387686,451.6\n20230804 13:38:26.054496,18.385390105979113,0.11849177166615994,-0.9393892458741238,0.02076441837927718,0.17091276867767746,-0.015192257355854059,451.71\n20230804 13:38:56.069914,18.423113883395125,0.11849177166615994,-0.9401550365560977,0.020749345428241056,0.16924721509210272,-0.01506688866626268,451.67\n20230804 13:39:28.084558,18.423104664296297,0.11849177166615994,-0.940158089207354,0.020749325700797933,0.16923789933884947,-0.015066606610125726,451.67\n20230804 13:39:59.097606,18.366511194978887,0.11849177166615994,-0.9390120221283318,0.02077189385634183,0.1717297294432889,-0.015254333848520844,451.73\n20230804 13:40:30.114699,18.43000000000177,0.10277581344276693,-0.9998597831344445,0.005973377648567289,0.030761911832868805,-2.0111555741468317e-13,451.57\n20230804 13:41:02.128587,18.288887678783258,0.11039553015908668,-0.9723950779821106,0.018876282149351487,0.10427176221446288,-0.006819048443943425,451.73\n20230804 13:41:33.143821,18.43427321008101,0.11039553015908668,-0.9756721912710296,0.018258342980850627,0.09826862080614518,-0.006455534696359934,451.58\n20230804 13:42:04.161846,18.58956288130517,0.11039553015908668,-0.9790193961557381,0.017597959563773115,0.092816394013294,-0.005950222739985665,451.42\n"
  },
  {
    "path": "Tests/TestData/greeksindicator/american/third_party_1_greeks.csv",
    "content": ",,,,model_price,model_price,model_impliedVol,model_impliedVol,model_delta,model_delta,model_gamma,model_gamma,model_vega,model_vega,model_theta,model_theta,model_undPrice,TTM,interest_rate,dividend_yield\nright,,,,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,,,,\nticker,expiry,strike,time,,,,,,,,,,,,,,,,\nSPY,09/02/2024 23:59:00,417,07/02/2024 16:24:00,0.000309757,80.16749032,0.597711835,0.597711835,-5.63E-05,0.999944979,9.91E-06,9.70E-06,0.000124278,0.000124285,-0.000309757,-0.000302254,496.985,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,491,07/02/2024 15:43:00,0.297982062,6.758549603,0.138673137,0.138673137,-0.113663887,0.887963786,0.036130953,0.035483285,0.081484266,0.081420413,-0.223913912,-0.294928314,497.265,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,491,07/02/2024 16:12:00,0.256497302,6.944466624,0.136607057,0.136607057,-0.100974311,0.900007951,0.033389306,0.033286463,0.073467136,0.07246487,-0.206299766,-0.252322285,497.54,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,492,07/02/2024 15:41:00,0.396706723,5.845943468,0.135483721,0.135483721,-0.145773666,0.852797122,0.043755116,0.043969127,0.096156652,0.09821135,-0.261231754,-0.335888907,497.305,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,493,07/02/2024 15:43:00,0.560824918,4.961262828,0.132818363,0.132818363,-0.195175712,0.80619858,0.053878469,0.053469947,0.111994013,0.11093265,-0.307314615,-0.378625529,497.235,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,493,07/02/2024 16:12:00,0.48471781,5.181632363,0.131632321,0.131632321,-0.175269434,0.823777089,0.050860549,0.050901272,0.100143459,0.099978516,-0.285763817,-0.359528266,497.5469977,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,494,07/02/2024 15:41:00,0.738807498,4.179984529,0.130146761,0.130146761,-0.244994828,0.753766027,0.062576025,0.062515929,0.119181713,0.118855195,-0.34077406,-0.414065684,497.29,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,496,07/02/2024 15:41:00,1.321221463,2.743263655,0.125995629,0.125995629,-0.382650142,0.615605963,0.078308518,0.078261545,0.14728649,0.147198019,-0.396756404,-0.466132621,497.28,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,497,07/02/2024 15:43:00,1.747939698,2.134137931,0.124359382,0.124359382,-0.468856697,0.534437272,0.083492584,0.08254378,0.154242036,0.154307588,-0.402218619,-0.47172902,497.23,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,497,07/02/2024 16:12:00,1.578624079,2.280994195,0.123328477,0.123328477,-0.439569989,0.560434034,0.083092487,0.082796875,0.153288583,0.153336228,-0.400780344,-0.468361806,497.56,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,499,07/02/2024 15:43:00,2.834103167,1.211862566,0.122809013,0.122809013,-0.635627622,0.370120499,0.080895028,0.079480018,0.149392527,0.150555122,-0.365562239,-0.43329683,497.23,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,499,07/02/2024 16:12:00,2.596022485,1.30016115,0.120811152,0.120811152,-0.610855193,0.393676762,0.083864928,0.082436562,0.14892958,0.149645376,-0.369304171,-0.437090037,497.555,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,502,07/02/2024 16:11:00,4.801330207,0.461228968,0.121404016,0.121404016,-0.828032239,0.180747461,0.058534049,0.056115455,0.102905054,0.106861069,-0.230279059,-0.293796791,497.525,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,503,07/02/2024 16:24:00,6.204420457,0.25206334,0.122240092,0.122240092,-0.907564937,0.110439871,0.041582403,0.040043471,0.065465729,0.07626066,-0.134420457,-0.210633977,496.97,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,504,07/02/2024 16:11:00,6.56616635,0.200022191,0.122379991,0.122379991,-0.92112437,0.090862789,0.037892756,0.034617205,0.061875867,0.069746979,-0.10616635,-0.182479013,497.5020099,0.005479452,0.055,0\nSPY,09/02/2024 23:59:00,508,07/02/2024 16:11:00,10.42027714,0.046180201,0.133563833,0.133563833,-0.99623003,0.023782825,0.01038706,0.010876686,0.009998334,0.026799539,-0.00027714,-0.046180201,497.555,0.005479452,0.055,0\n"
  },
  {
    "path": "Tests/TestData/greeksindicator/american/third_party_2_greeks.csv",
    "content": ",,,,pValue,cValue,pMidIv,cMidIv,delta,delta,gamma,gamma,vega,vega,theta,theta,rho,rho,stkPx,yte,iRate,divRate\n,,,,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,,,,\nticker,expirDate,strike,trade_date,,,,,,,,,,,,,,,,,,\nAAPL,23/02/2024 23:59:00,140,07/02/2024 23:59:00,0.03,49.29,0.55092,0.36176,-0.001256,0.998744,0,0,0.00001,0.00001,-0.00698784,-0.00698784,0.06125272,0.06125272,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,150,07/02/2024 23:59:00,0.05,39.32,0.46637,0.29492,-0.001258,0.998742,0.00000091,0.00000091,0.00001294,0.00001294,-0.00855945,-0.00855945,0.06562776,0.06562776,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,180,07/02/2024 23:59:00,0.46,9.84,0.20346,0.20524,-0.116211,0.883789,0.02372605,0.02372605,0.07716411,0.07716411,-0.06128234,-0.06128234,0.0690087,0.0690087,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,185,07/02/2024 23:59:00,1.23,5.65,0.18691,0.18806,-0.268584,0.731416,0.04435876,0.04435876,0.13193254,0.13193254,-0.08657704,-0.08657704,0.05821467,0.05821467,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,190,07/02/2024 23:59:00,3.18,2.58,0.18048,0.18121,-0.525831,0.474169,0.05615005,0.05615005,0.15703993,0.15703993,-0.09531134,-0.09531134,0.03822326,0.03822326,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,195,07/02/2024 23:59:00,6.63,0.95,0.18737,0.18259,-0.768914,0.231086,0.04180302,0.04180302,0.12431055,0.12431055,-0.07294711,-0.07294711,0.01875059,0.01875059,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,200,07/02/2024 23:59:00,11,0.33,0.203,0.19322,-0.905008,0.094992,0.02185074,0.02185074,0.06827779,0.06827779,-0.04230751,-0.04230751,0.00773268,0.00773268,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,250,07/02/2024 23:59:00,60.82,0,0.37607,0.22741,-1,0,0,0,0.00001001,0.00001001,0,0,0,0,189.18,0.04384,0.0548,0\nAAPL,23/02/2024 23:59:00,260,07/02/2024 23:59:00,70.82,0,0.41889,0.25612,-1,0,0,0,0.00001,0.00001,0,0,0,0,189.18,0.04384,0.0548,0\nAAPL,22/03/2024 23:59:00,140,07/02/2024 23:59:00,0.07,49.96,0.38314,0.25685,-0.001829,0.998171,0.0001099,0.0001099,0.0012389,0.0012389,-0.01799274,-0.01799274,0.16728556,0.16728556,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,150,07/02/2024 23:59:00,0.1,40.06,0.328,0.21771,-0.006783,0.993217,0.00086979,0.00086979,0.00986291,0.00986291,-0.02233246,-0.02233246,0.17807984,0.17807984,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,180,07/02/2024 23:59:00,1.66,11.83,0.20254,0.20006,-0.240616,0.759384,0.01970765,0.01970765,0.20960294,0.20960294,-0.07312899,-0.07312899,0.15794174,0.15794174,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,185,07/02/2024 23:59:00,2.87,8.06,0.19239,0.19277,-0.342055,0.657945,0.02573,0.02573,0.24398145,0.24398145,-0.07481209,-0.07481209,0.13954961,0.13954961,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,190,07/02/2024 23:59:00,4.79,4.95,0.18532,0.18547,-0.479944,0.520056,0.03179359,0.03179359,0.26182252,0.26182252,-0.06881485,-0.06881485,0.11233377,0.11233377,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,195,07/02/2024 23:59:00,7.67,2.72,0.18095,0.18103,-0.653345,0.346655,0.03321569,0.03321569,0.238241,0.238241,-0.05470332,-0.05470332,0.07596602,0.07596602,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,200,07/02/2024 23:59:00,11.55,1.38,0.18454,0.17973,-0.809225,0.190775,0.02580298,0.02580298,0.18766034,0.18766034,-0.03704625,-0.03704625,0.04216521,0.04216521,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,250,07/02/2024 23:59:00,60.82,0,0.27137,0.15068,-0.999969,0.000031,0.00001004,0.00001004,0.00010516,0.00010516,-0.00002006,-0.00002006,0.00000701,0.00000701,189.18,0.12055,0.0544,0\nAAPL,22/03/2024 23:59:00,260,07/02/2024 23:59:00,70.82,0,0.30017,0.16295,-0.999998,0.000002,0.00000084,0.00000084,0.0000201,0.0000201,-0.0000017,-0.0000017,0.00000053,0.00000053,189.18,0.12055,0.0544,0\nAAPL,19/04/2024 23:59:00,140,07/02/2024 23:59:00,0.14,50.59,0.33138,0.17584,-0.001931,0.998069,0.00012427,0.00012427,0.00191713,0.00191713,-0.01968982,-0.01968982,0.27253801,0.27253801,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,150,07/02/2024 23:59:00,0.22,40.74,0.28958,0.15817,-0.007273,0.992727,0.00090992,0.00090992,0.01443683,0.01443683,-0.02303406,-0.02303406,0.28996885,0.28996885,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,180,07/02/2024 23:59:00,2.53,13.45,0.20094,0.20003,-0.238045,0.761955,0.01832786,0.01832786,0.2606521,0.2606521,-0.05461663,-0.05461663,0.25769085,0.25769085,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,185,07/02/2024 23:59:00,3.89,9.81,0.19225,0.19234,-0.338088,0.661912,0.02257232,0.02257232,0.30768096,0.30768096,-0.05722268,-0.05722268,0.2275247,0.2275247,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,190,07/02/2024 23:59:00,5.86,6.74,0.18501,0.18604,-0.457843,0.542157,0.02550266,0.02550266,0.33322921,0.33322921,-0.05608724,-0.05608724,0.18894538,0.18894538,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,195,07/02/2024 23:59:00,8.57,4.34,0.18029,0.1809,-0.587369,0.412631,0.02582725,0.02582725,0.33087808,0.33087808,-0.05083925,-0.05083925,0.14539494,0.14539494,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,200,07/02/2024 23:59:00,12.08,2.61,0.17737,0.17719,-0.70912,0.29088,0.02312831,0.02312831,0.2801356,0.2801356,-0.04237469,-0.04237469,0.10334237,0.10334237,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,250,07/02/2024 23:59:00,60.82,0.05,0.21921,0.24308,-0.999663,0.000337,0.00008137,0.00008137,0.00095569,0.00095569,-0.00013533,-0.00013533,0.00012306,0.00012306,189.18,0.19726,0.0544,0\nAAPL,19/04/2024 23:59:00,260,07/02/2024 23:59:00,70.82,0.03,0.24264,0.2571,-0.999955,0.000045,0.00001221,0.00001221,0.00015242,0.00015242,-0.00002018,-0.00002018,0.00001637,0.00001637,189.18,0.19726,0.0544,0\nAAPL,18/10/2024 23:59:00,140,07/02/2024 23:59:00,1.52,55.06,0.29016,0.28946,-0.067078,0.932922,0.00275679,0.00275679,0.20012338,0.20012338,-0.02661806,-0.02661806,0.84486598,0.84486598,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,150,07/02/2024 23:59:00,2.28,46.32,0.27193,0.28524,-0.103844,0.896156,0.00406827,0.00406827,0.26825321,0.26825321,-0.03090147,-0.03090147,0.85727221,0.85727221,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,180,07/02/2024 23:59:00,7.87,22.73,0.22819,0.23228,-0.300632,0.699368,0.00954991,0.00954991,0.54674369,0.54674369,-0.03902539,-0.03902539,0.76276147,0.76276147,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,185,07/02/2024 23:59:00,9.51,19.48,0.22219,0.22924,-0.349373,0.650627,0.01052382,0.01052382,0.57863528,0.57863528,-0.03900466,-0.03900466,0.72206879,0.72206879,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,190,07/02/2024 23:59:00,11.46,16.32,0.21561,0.21548,-0.403004,0.596996,0.01138365,0.01138365,0.60767847,0.60767847,-0.03840557,-0.03840557,0.67316288,0.67316288,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,195,07/02/2024 23:59:00,13.71,13.39,0.20979,0.20859,-0.460772,0.539228,0.01206441,0.01206441,0.62702996,0.62702996,-0.03718453,-0.03718453,0.61690444,0.61690444,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,200,07/02/2024 23:59:00,16.02,10.98,0.20406,0.20457,-0.521418,0.478582,0.01247576,0.01247576,0.62315488,0.62315488,-0.03535327,-0.03535327,0.55466694,0.55466694,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,250,07/02/2024 23:59:00,60.82,0.78,0.17485,0.18106,-0.934789,0.065211,0.00430979,0.00430979,0.2178968,0.2178968,-0.00884357,-0.00884357,0.08028332,0.08028332,189.18,0.69589,0.0482,0\nAAPL,18/10/2024 23:59:00,260,07/02/2024 23:59:00,70.82,0.39,0.18863,0.13295,-0.964401,0.035599,0.00268217,0.00268217,0.12933995,0.12933995,-0.00523372,-0.00523372,0.04411668,0.04411668,189.18,0.69589,0.0482,0\nAAPL,17/01/2025 23:59:00,140,07/02/2024 23:59:00,2.29,57.04,0.28429,0.28584,-0.09265,0.90735,0.00296854,0.00296854,0.29699659,0.29699659,-0.02573248,-0.02573248,1.08171177,1.08171177,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,150,07/02/2024 23:59:00,3.39,48.54,0.27069,0.2707,-0.126731,0.873269,0.00401002,0.00401002,0.37861559,0.37861559,-0.02857809,-0.02857809,1.10145736,1.10145736,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,180,07/02/2024 23:59:00,9.81,26.02,0.2345,0.23373,-0.302047,0.697953,0.00818982,0.00818982,0.63130802,0.63130802,-0.03436464,-0.03436464,1.00412691,1.00412691,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,185,07/02/2024 23:59:00,11.52,22.85,0.22891,0.22878,-0.343543,0.656457,0.0088764,0.0088764,0.66729224,0.66729224,-0.0345474,-0.0345474,0.96026379,0.96026379,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,190,07/02/2024 23:59:00,13.46,19.9,0.22345,0.22325,-0.388161,0.611839,0.00946778,0.00946778,0.69946516,0.69946516,-0.0343591,-0.0343591,0.90846246,0.90846246,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,195,07/02/2024 23:59:00,15.67,17.15,0.21803,0.21813,-0.435153,0.564847,0.00994094,0.00994094,0.71982342,0.71982342,-0.03381438,-0.03381438,0.850137,0.850137,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,200,07/02/2024 23:59:00,18.18,14.64,0.21301,0.21369,-0.483769,0.516231,0.01027287,0.01027287,0.73440266,0.73440266,-0.03291703,-0.03291703,0.78663373,0.78663373,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,250,07/02/2024 23:59:00,60.82,1.71,0.15605,0.18396,-0.879914,0.120086,0.00573524,0.00573524,0.35026443,0.35026443,-0.01291633,-0.01291633,0.19653895,0.19653895,189.18,0.94521,0.0482,0\nAAPL,17/01/2025 23:59:00,260,07/02/2024 23:59:00,70.82,1.04,0.16106,0.18278,-0.918366,0.081634,0.00434122,0.00434122,0.27214953,0.27214953,-0.00951201,-0.00951201,0.1345202,0.1345202,189.18,0.94521,0.0482,0\n"
  },
  {
    "path": "Tests/TestData/mcclellan_data.csv",
    "content": "Date,A/D Difference,MO,MSI\n20220630,-735,0,0\n20220701,1607,0,0\n20220705,-317,0,0\n20220706,-773,0,0\n20220707,1742,0,0\n20220708,-211,0,0\n20220711,-1254,0,0\n20220712,-345,0,0\n20220713,-399,0,0\n20220714,-1509,0,0\n20220715,2083,0,0\n20220718,182,0,0\n20220719,2166,0,0\n20220720,1138,0,0\n20220721,767,0,0\n20220722,-604,0,0\n20220725,675,0,0\n20220726,-736,0,0\n20220727,2130,322.7447368,-283.5052632\n20220728,1670,457.4702632,173.965\n20220729,1405,552.2232368,726.1882368\n20220801,254,522.4009132,1248.58915\n20220802,-304,439.7608218,1688.349972\n20220803,1269,522.6847397,2211.034712\n20220804,-147,455.7162657,2666.750977\n20220805,-157,394.4446391,3061.195616\n20220808,1077,462.7001752,3523.895792\n20220809,-933,323.1301577,3847.025949\n20220810,2239,514.7171419,4361.743091\n20220811,604,523.6454277,4885.388519\n20220812,1963,667.580885,5552.969404\n20220815,42,605.0227965,6157.9922\n20220816,249,569.4205168,6727.412717\n20220817,-1926,319.8784651,7047.291182\n20220818,501,337.9906186,7385.281801\n20220819,-2247,79.49155676,7464.773358\n20220822,-2100,-138.4575989,7326.315759\n20220823,-134,-138.011839,7188.30392\n20220824,844,-304.543732,6883.760188\n20220825,1885,-193.0760127,6690.684175\n20220826,-2321,-307.1057326,6383.578442\n20220829,-1026,-338.3156144,6045.262828\n20220830,-1849,-404.4584853,5640.804343\n20220831,-1190,-426.0383475,5214.765995\n20220901,-1336,-449.6589379,4765.107057\n20220902,-489,-425.2562481,4339.850809\n20220906,-1164,-436.015667,3903.835142\n20220907,1679,-300.8848918,3602.95025\n20220908,320,-251.7936546,3351.156596\n20220909,2162,-116.4616785,3234.694917\n20220912,1659,-25.32053059,3209.374386\n20220913,-2514,-155.9182464,3053.45614\n20220914,136,-134.2997023,2919.156438\n20220915,-1344,-189.1443485,2730.012089\n20220916,-1486,-242.1907992,2487.82129\n20220919,521,-185.9845606,2301.836729\n20220920,-2115,-268.7983038,2033.038426\n20220921,-1385,-301.7600628,1731.278363\n20220922,-2094,-363.8835663,1367.394797\n20220923,-2467,-433.829744,933.5650525\n20220926,-2143,-475.2645773,458.3004752\n20220927,-108,-406.5650368,51.73543841\n20220928,2416,-219.5941045,-167.8586661\n20220929,-2144,-286.6359869,-454.494653\n20220930,-437,-257.1736164,-711.6682693\n20221003,2189,-99.39742149,-811.0656908\n20221004,2386,45.84821223,-765.2174786\n20221005,-1268,-12.896012,-778.1134906\n20221006,-1204,-59.85784366,-837.9713342\n20221007,-2208,-149.9109205,-987.8822547\n20221010,-1108,-171.1567466,-1159.039001\n20221011,-435,-154.8161442,-1313.855146\n20221012,-749,-155.7708484,-1469.625994\n20221013,1366,-50.05826627,-1519.68426\n20221014,-1992,-127.3237172,-1647.007977\n20221017,2118,12.75094082,-1634.257037\n20221018,1387,95.90101874,-1538.356018\n20221019,-1679,13.21483026,-1525.141188\n20221020,-1215,-34.34793504,-1559.489123\n20221021,1318,51.8076403,-1507.681482\n20221024,488,83.71161902,-1423.969863\n20221025,2213,196.8209627,-1227.148901\n20221026,620,212.8953468,-1014.253554\n20221027,323,210.7244684,-803.5290854\n20221028,1661,274.7147451,-528.8143403\n20221031,-207,234.6528579,-294.1614824\n20221101,575,238.3266801,-55.83480237\n20221102,-1760,123.5261646,67.69136224\n20221103,-592,83.15409308,150.8454553\n20221104,1335,144.5702015,295.4156568\n20221107,852,172.2081231,467.6237799\n20221108,715,188.1275055,655.7512854\n20221109,-1948,67.64793994,723.3992253\n20221110,2527,188.0496717,911.448897\n20221111,969,212.1529039,1123.601801\n20221114,-1326,116.950403,1240.552204\n20221115,1651,183.8175127,1424.369717\n20221116,-1000,107.5198039,1531.889521\n20221117,-936,44.94766391,1576.837185\n20221118,652,70.62374587,1647.46093\n20221121,-227,48.27367722,1695.734608\n20221122,1561,118.3230001,1814.057608\n20221123,733,136.2235562,1950.281164\n20221125,855,156.9474139,2107.228578\n20221128,-1770,42.63157515,2149.860153\n20221129,485,57.42837513,2207.288528\n20221130,2274,159.2424972,2366.531025\n20221201,351,149.3473592,2515.878385\n20221202,286,136.8902793,2652.768664\n20221205,-2213,0.6050246475,2653.373689\n20221206,-1325,-71.52189322,2581.851795\n20221207,-104,-71.78279853,2510.068997\n20221208,362,-48.34695858,2461.722038\n20221209,-1292,-110.7675806,2350.954458\n20221212,871,-55.43337457,2295.521083\n20221213,1291,13.15453848,2308.675621\n20221214,-486,-17.11856856,2291.557053\n20221215,-1936,-115.4164822,2176.140571\n20221216,-1179,-161.034116,2015.106455\n20221219,-1290,-204.7820223,1810.324432\n20221220,150,-169.1625721,1641.16186\n20221221,1681,-61.31212929,1579.849731\n20221222,-1744,-140.04344,1439.806291\n20221223,1066,-66.15849355,1373.647797\n20221227,-361,-74.00607182,1299.641726\n20221228,-1737,-149.1457209,1150.496005\n20221229,2104,-20.59439223,1129.901612\n20221230,-314,-31.48003427,1098.421578\n20230103,637,6.92014196,1105.34172\n20230104,1923,104.0176919,1209.359412\n20230105,-538,63.46600869,1272.825421\n20230106,2284,169.5769895,1442.40241\n20230109,713,180.9039931,1623.306403\n20230110,1342,221.1340612,1844.440465\n20230111,1689,271.7750992,2116.215564\n20230112,1626,310.5643111,2426.779875\n20230113,758,298.7762658,2725.556141\n20230117,266,262.6036057,2988.159746\n20230118,-964,168.8629633,3157.02271\n20230119,-577,107.2203992,3264.243109\n20230120,1860,175.8299049,3440.073014\n20230123,1392,210.2118828,3650.284897\n20230124,-117,163.1074145,3813.392311\n20230125,255,140.617557,3954.009868\n20230126,1155,165.685641,4119.695509\n20230127,520,154.5404247,4274.235934\n20230130,-1111,62.68856257,4336.924496\n20230131,2158,147.2917777,4484.216274\n20230201,1372,179.5910677,4663.807342\n20230202,1283,201.8590053,4865.666347\n20230203,-1411,85.18879696,4950.855144\n20230206,-1559,-22.39017517,4928.464969\n20230207,755,1.441754536,4929.906723\n20230208,-1036,-67.73915434,4862.167569\n20230209,-1446,-147.0501357,4715.117433\n20230210,151,-134.275774,4580.841659\n20230213,1601,-50.18231592,4530.659343\n20230214,-91,-62.63149768,4468.027846\n20230215,483,-44.26239059,4423.765455\n20230216,-1464,-125.6854921,4298.079963\n20230217,-404,-141.6738164,4156.406147\n20230221,-2337,-251.2854646,3905.120682\n20230222,299,-211.9469965,3693.173685\n20230223,996,-142.4028713,3550.770814\n20230224,-1297,-196.8806299,3353.890184\n20230227,603,-147.4747103,3206.415474\n20230228,-114,-140.3452755,3066.070199\n20230301,-369,-146.2978824,2919.772316\n"
  },
  {
    "path": "Tests/TestData/nhnl_data.csv",
    "content": "Date,Symbol,Open,High,Low,Close,Volume,NH/NL Difference,NH/NL Ratio,NH/NL Volume Ratio\n20190102,AAPL,1548900,1588500,1542400,1579200,28370261,0.0,0.0,0.0\n20190102,GOOG,10171300,10524000,10141300,10458600,1219740,0.0,0.0,0.0\n20190102,IBM,1120000,1159800,1116900,1151900,3244233,0.0,0.0,0.0\n20190103,AAPL,1439500,1457500,1420000,1420900,83238505,0.0,0.0,0.0\n20190103,GOOG,10410000,10567700,10140300,10151900,1468159,0.0,0.0,0.0\n20190103,IBM,1145300,1148500,1126900,1129300,3401399,0.0,0.0,0.0\n20190104,AAPL,1445800,1485400,1438000,1482600,52261612,0.0,0.0,0.0\n20190104,GOOG,10330000,10708600,10275600,10707100,1722662,0.0,0.0,0.0\n20190104,IBM,1149100,1174900,1144800,1172900,3814850,2.0,2.0,5537512.0\n20190107,AAPL,1486300,1488300,1459000,1478900,50933385,2.0,2.0,5537512.0\n20190107,GOOG,10715000,10740000,10539600,10683900,1709957,2.0,2.0,5537512.0\n20190107,IBM,1175000,1188300,1167100,1181000,3247405,3.0,3.0,55890747.0\n20190108,AAPL,1493400,1518200,1485200,1507700,37363174,3.0,3.0,55890747.0\n20190108,GOOG,10761100,10847800,10603000,10765300,1332941,3.0,3.0,55890747.0\n20190108,IBM,1196600,1205400,1189800,1198600,3942624,3.0,3.0,42638739.0\n20190109,AAPL,1511600,1545300,1496300,1533100,41636996,3.0,3.0,42638739.0\n20190109,GOOG,10813400,10826400,10664000,10745400,1027741,3.0,3.0,42638739.0\n20190109,IBM,1209100,1213900,1198800,1206400,3083182,2.0,2.0,44720178.0\n20190110,AAPL,1524500,1539700,1508600,1538000,33478211,2.0,2.0,44720178.0\n20190110,GOOG,10699900,10711500,10576800,10692200,1110320,2.0,2.0,44720178.0\n20190110,IBM,1201600,1218600,1199500,1217400,3176528,0.0,1.0,2.8609121694646586\n20190111,AAPL,1528100,1537000,1515100,1523000,23450358,0.0,1.0,2.8609121694646586\n20190111,GOOG,10619100,10647300,10484800,10571700,1321465,0.0,1.0,2.8609121694646586\n20190111,IBM,1215800,1215800,1202200,1214300,2901424,-1.0,0.0,0.0\n20190114,AAPL,1508700,1512700,1492200,1499900,27532102,-1.0,0.0,0.0\n20190114,GOOG,10469200,10515300,10413000,10444800,966733,-1.0,0.0,0.0\n20190114,IBM,1205100,1206400,1198000,1203400,4254599,-3.0,0.0,0.0\n20190115,AAPL,1502700,1533900,1500500,1530500,26284167,-3.0,0.0,0.0\n20190115,GOOG,10509100,10800500,10470500,10768600,1231237,-3.0,0.0,0.0\n20190115,IBM,1209600,1219300,1208200,1217000,3088304,2.0,2.0,4319541.0\n20190116,AAPL,1530000,1558800,1530000,1549200,27673320,2.0,2.0,4319541.0\n20190116,GOOG,10787800,10920900,10787800,10807700,1112963,2.0,2.0,4319541.0\n20190116,IBM,1215800,1220000,1208300,1215700,3235296,3.0,3.0,32021579.0\n20190117,AAPL,1542200,1576500,1532600,1558600,27463983,3.0,3.0,32021579.0\n20190117,GOOG,10794700,10918000,10741800,10912900,852114,3.0,3.0,32021579.0\n20190117,IBM,1205600,1224000,1205500,1221800,3936493,1.0,2.0,7.976764089254065\n20190118,AAPL,1575200,1578800,1559900,1568200,28994344,1.0,2.0,7.976764089254065\n20190118,GOOG,10983300,11086000,10906900,10982500,1571248,1.0,2.0,7.976764089254065\n20190118,IBM,1232700,1247000,1227200,1238300,5079604,3.0,3.0,35645196.0\n20190122,AAPL,1564000,1567300,1526200,1536900,25079137,3.0,3.0,35645196.0\n20190122,GOOG,10887700,10913200,10634700,10710800,1113354,3.0,3.0,35645196.0\n20190122,IBM,1232200,1238000,1215400,1223700,6851547,-2.0,0.0,0.0\n20190123,AAPL,1541200,1551400,1517000,1539700,20692626,-2.0,0.0,0.0\n20190123,GOOG,10786700,10849300,10593100,10758500,866412,-2.0,0.0,0.0\n20190123,IBM,1312500,1350000,1303200,1328900,20736688,-1.0,0.5,0.9618559047022414\n20190124,AAPL,1539400,1544800,1517400,1527100,21201995,-1.0,0.5,0.9618559047022414\n20190124,GOOG,10741100,10791700,10606500,10743300,896027,-1.0,0.5,0.9618559047022414\n20190124,IBM,1326100,1332000,1314500,1325100,5563047,0.0,0.0,0.0\n20190125,AAPL,1552800,1581400,1543200,1577200,30695002,0.0,0.0,0.0\n20190125,GOOG,10844400,10940000,10813900,10909900,949640,0.0,0.0,0.0\n20190125,IBM,1328700,1344400,1324300,1339900,5155390,2.0,2.0,31644642.0\n20190128,AAPL,1555300,1563300,1536700,1563000,22548976,2.0,2.0,31644642.0\n20190128,GOOG,10801100,10830500,10634700,10702500,1082572,2.0,2.0,31644642.0\n20190128,IBM,1331000,1348100,1326000,1343100,4265756,1.0,1.0,4265756.0\n20190129,AAPL,1562000,1581300,1541100,1546600,31507605,1.0,1.0,4265756.0\n20190129,GOOG,10722300,10751500,10556600,10602300,834511,1.0,1.0,4265756.0\n20190129,IBM,1342900,1354100,1336000,1343400,4141354,0.0,1.0,4.962611637234261\n20190130,AAPL,1632800,1661500,1602300,1652400,55940805,0.0,1.0,4.962611637234261\n20190130,GOOG,10672400,10911900,10668500,10894200,1072214,0.0,1.0,4.962611637234261\n20190130,IBM,1340000,1350300,1332500,1344100,3939387,2.0,2.0,57013019.0\n20190131,AAPL,1661100,1690000,1645600,1663400,32499436,2.0,2.0,57013019.0\n20190131,GOOG,11044700,11173400,10950000,11161800,1260420,2.0,2.0,57013019.0\n20190131,IBM,1344500,1346500,1337400,1344000,3337118,2.0,2.0,33759856.0\n20190201,AAPL,1669300,1689800,1659300,1665400,26100838,2.0,2.0,33759856.0\n20190201,GOOG,11125600,11250000,11045600,11102300,1143535,2.0,2.0,33759856.0\n20190201,IBM,1349700,1351900,1333500,1340800,3312237,2.0,2.0,4455772.0\n20190204,AAPL,1674800,1716600,1672800,1712700,27747804,2.0,2.0,4455772.0\n20190204,GOOG,11120000,11325000,11090000,11325000,1878894,2.0,2.0,4455772.0\n20190204,IBM,1340200,1351800,1329900,1351800,3316380,1.0,2.0,8.933444900765291\n20190205,AAPL,1728600,1750800,1723500,1741000,32540764,1.0,2.0,8.933444900765291\n20190205,GOOG,11235900,11469200,11170300,11460000,3104755,1.0,2.0,8.933444900765291\n20190205,IBM,1352800,1358100,1349300,1355300,3190321,3.0,3.0,38835840.0\n20190206,AAPL,1747000,1755700,1728600,1742800,26390527,3.0,3.0,38835840.0\n20190206,GOOG,11415000,11470000,11127600,11152300,1845545,3.0,3.0,38835840.0\n20190206,IBM,1352200,1366500,1351700,1363300,4333342,3.0,3.0,32569414.0\n20190207,AAPL,1723900,1739400,1703400,1709900,29006527,3.0,3.0,32569414.0\n20190207,GOOG,11048400,11049300,10860000,10987100,1766403,3.0,3.0,32569414.0\n20190207,IBM,1336200,1344600,1321200,1332000,3937685,-3.0,0.0,0.0\n20190208,AAPL,1688800,1706600,1684200,1705000,21210282,-3.0,0.0,0.0\n20190208,GOOG,10868700,10990000,10864400,10950800,871200,-3.0,0.0,0.0\n20190208,IBM,1325500,1337000,1321900,1337000,2394720,-1.0,0.0,0.0\n20190211,AAPL,1710500,1712100,1692500,1694500,18366473,-1.0,0.0,0.0\n20190211,GOOG,10968000,11060000,10928300,10950100,785879,-1.0,0.0,0.0\n20190211,IBM,1342900,1351200,1340000,1340100,2449210,2.0,2.0,3235089.0\n20190212,AAPL,1701300,1710000,1697000,1708900,19540639,2.0,2.0,3235089.0\n20190212,GOOG,11056000,11253500,11052600,11212200,1471781,2.0,2.0,3235089.0\n20190212,IBM,1351500,1361900,1348700,1360300,2894463,2.0,2.0,4366244.0\n20190213,AAPL,1714300,1724800,1699200,1701700,20022816,2.0,2.0,4366244.0\n20190213,GOOG,11248600,11348000,11185000,11205800,939841,2.0,2.0,4366244.0\n20190213,IBM,1369400,1379100,1365100,1375100,3675941,3.0,3.0,24638598.0\n20190214,AAPL,1697600,1712700,1693900,1707900,18491122,3.0,3.0,24638598.0\n20190214,GOOG,11180500,11283500,11100000,11216300,855272,3.0,3.0,24638598.0\n20190214,IBM,1372300,1375900,1362100,1364800,2394993,-1.0,0.0,0.0\n20190215,AAPL,1712200,1717000,1697500,1703800,21513915,-1.0,0.0,0.0\n20190215,GOOG,11297700,11316700,11105800,11135800,1222931,-1.0,0.0,0.0\n20190215,IBM,1377000,1381900,1373900,1380300,3078927,1.0,1.0,3078927.0\n20190219,AAPL,1697200,1714400,1694300,1709400,16853497,1.0,1.0,3078927.0\n20190219,GOOG,11104400,11218600,11099600,11188100,878344,1.0,1.0,3078927.0\n20190219,IBM,1378100,1387000,1373600,1387000,2740525,0.0,1.0,3.120104423779294\n20190220,AAPL,1711900,1733200,1709900,1720900,22718221,0.0,1.0,3.120104423779294\n20190220,GOOG,11199900,11233600,11053000,11144300,912517,0.0,1.0,3.120104423779294\n20190220,IBM,1387600,1392200,1372300,1380300,2989005,0.0,1.0,6.589025001012425\n20190221,AAPL,1718000,1723700,1703100,1711400,15778960,0.0,1.0,6.589025001012425\n20190221,GOOG,11111100,11119800,10923500,10971200,1103655,0.0,1.0,6.589025001012425\n20190221,IBM,1378200,1383300,1373800,1378400,2378211,-1.0,0.0,0.0\n20190222,AAPL,1716000,1730000,1713800,1729700,15409727,-1.0,0.0,0.0\n20190222,GOOG,11024600,11112500,10950000,11106300,886859,-1.0,0.0,0.0\n20190222,IBM,1387300,1393600,1384500,1392600,2550451,1.0,1.0,2550451.0\n20190225,AAPL,1739900,1758700,1739400,1742500,19691132,1.0,1.0,2550451.0\n20190225,GOOG,11170400,11187700,11072300,11089700,1243148,1.0,1.0,2550451.0\n20190225,IBM,1400000,1404500,1393200,1394300,2577238,3.0,3.0,23511518.0\n20190226,AAPL,1737100,1753000,1731600,1743500,14731642,3.0,3.0,23511518.0\n20190226,GOOG,11057500,11196000,10995800,11149300,1068777,3.0,3.0,23511518.0\n20190226,IBM,1396700,1404600,1394800,1397300,2503496,2.0,2.0,3572273.0\n20190227,AAPL,1732500,1750000,1727300,1748800,23019795,2.0,2.0,3572273.0\n20190227,GOOG,11093100,11179900,11010000,11162500,864775,2.0,2.0,3572273.0\n20190227,IBM,1392500,1395600,1384300,1391500,2069284,-2.0,0.0,0.0\n20190228,AAPL,1743200,1749100,1729100,1732000,19986497,-2.0,0.0,0.0\n20190228,GOOG,11118400,11276800,11108300,11206500,1121226,-2.0,0.0,0.0\n20190228,IBM,1387500,1390000,1377300,1381200,2490995,0.0,1.0,0.4501117023518714\n20190301,AAPL,1742800,1751500,1728900,1749700,21191283,0.0,1.0,0.4501117023518714\n20190301,GOOG,11257300,11429900,11243500,11414700,1283817,0.0,1.0,0.4501117023518714\n20190301,IBM,1393100,1400400,1386400,1391700,2598921,3.0,3.0,25074021.0\n20190304,AAPL,1756800,1777500,1739700,1758600,24418623,3.0,3.0,25074021.0\n20190304,GOOG,11461000,11582500,11306200,11478000,1261341,3.0,3.0,25074021.0\n20190304,IBM,1399900,1400800,1371700,1385000,2661368,2.0,3.0,10.64915937968744\n20190305,AAPL,1759200,1760000,1745400,1755100,15511056,2.0,3.0,10.64915937968744\n20190305,GOOG,11515000,11695200,11460500,11616200,1318441,2.0,3.0,10.64915937968744\n20190305,IBM,1383700,1387200,1375600,1379300,2294783,1.0,1.0,1318441.0\n20190306,AAPL,1747600,1754900,1739400,1745100,17521402,1.0,1.0,1318441.0\n20190306,GOOG,11647800,11672400,11554900,11579600,912091,1.0,1.0,1318441.0\n20190306,IBM,1380600,1383600,1367200,1369800,2351144,-2.0,0.0,0.0\n20190307,AAPL,1739100,1744400,1720200,1724700,20419582,-2.0,0.0,0.0\n20190307,GOOG,11539100,11568600,11347500,11435300,1013586,-2.0,0.0,0.0\n20190307,IBM,1366100,1368900,1346500,1353600,3620161,-3.0,0.0,0.0\n20190308,AAPL,1702800,1730800,1695000,1729200,19651510,-3.0,0.0,0.0\n20190308,GOOG,11259800,11471900,11231500,11427400,1018262,-3.0,0.0,0.0\n20190308,IBM,1342500,1352400,1336100,1350400,3403914,-3.0,0.0,0.0\n20190311,AAPL,1754900,1791300,1753500,1789800,26548756,-3.0,0.0,0.0\n20190311,GOOG,11457500,11761900,11441400,11757600,1384014,-3.0,0.0,0.0\n20190311,IBM,1360300,1377300,1358400,1377200,3259429,3.0,3.0,31192199.0\n20190312,AAPL,1799300,1826700,1793700,1809400,27622968,3.0,3.0,31192199.0\n20190312,GOOG,11782400,12000000,11782400,11927700,1869564,3.0,3.0,31192199.0\n20190312,IBM,1385700,1396900,1378600,1382800,3129203,3.0,3.0,32621735.0\n20190313,AAPL,1822900,1832900,1809200,1817200,24264018,3.0,3.0,32621735.0\n20190313,GOOG,11999900,12019900,11919400,11933100,1313900,3.0,3.0,32621735.0\n20190313,IBM,1382800,1393200,1378600,1385400,2527701,2.0,2.0,25577918.0\n20190314,AAPL,1839100,1841000,1825600,1837300,19549079,2.0,2.0,25577918.0\n20190314,GOOG,11945100,11979600,11844800,11858000,994417,2.0,2.0,25577918.0\n20190314,IBM,1385100,1389300,1380700,1388000,2128787,1.0,1.0,19549079.0\n20190315,AAPL,1847800,1873300,1837400,1862100,32967677,1.0,1.0,19549079.0\n20190315,GOOG,11921900,11966200,11825500,11852400,1784155,1.0,1.0,19549079.0\n20190315,IBM,1395800,1403300,1392500,1394300,3635412,1.0,2.0,20.515644100428496\n20190318,AAPL,1858100,1883900,1857900,1880200,22763260,1.0,2.0,20.515644100428496\n20190318,GOOG,11830100,11901900,11773700,11844500,981951,1.0,2.0,20.515644100428496\n20190318,IBM,1398300,1403700,1387200,1402500,2710158,1.0,2.0,25.941638635736407\n20190319,AAPL,1882400,1889900,1859200,1865400,27185557,1.0,2.0,25.941638635736407\n20190319,GOOG,11873100,12004500,11858000,11995500,1034017,1.0,2.0,25.941638635736407\n20190319,IBM,1409600,1417000,1400100,1405300,2654092,3.0,3.0,30873666.0\n20190320,AAPL,1862800,1894900,1847300,1881700,27274230,3.0,3.0,30873666.0\n20190320,GOOG,11976500,12272500,11960400,12240100,1692662,3.0,3.0,30873666.0\n20190320,IBM,1405300,1407000,1389900,1396200,2813292,1.0,2.0,1.06206085378029\n20190321,AAPL,1900200,1963200,1898100,1950500,43361081,1.0,2.0,1.06206085378029\n20190321,GOOG,12169400,12318200,12136700,12317900,919910,1.0,2.0,1.06206085378029\n20190321,IBM,1390000,1421200,1390000,1414500,2821095,3.0,3.0,47102086.0\n20190322,AAPL,1953400,1976900,1907700,1910600,38667194,3.0,3.0,47102086.0\n20190322,GOOG,12263200,12305300,12026500,12059200,1486536,3.0,3.0,47102086.0\n20190322,IBM,1409700,1414400,1389100,1394600,3148502,0.0,1.0,12.28114004691755\n20190325,AAPL,1917100,1919800,1866000,1887700,40970851,0.0,1.0,12.28114004691755\n20190325,GOOG,11976400,12065400,11869800,11924100,1185757,0.0,1.0,12.28114004691755\n20190325,IBM,1390600,1399000,1383600,1392000,2328678,-3.0,0.0,0.0\n20190326,AAPL,1914900,1928800,1845900,1867900,43987220,-3.0,0.0,0.0\n20190326,GOOG,11996100,12029700,11768000,11848500,1784154,-3.0,0.0,0.0\n20190326,IBM,1399300,1410200,1394200,1402200,2009766,-2.0,0.0,0.0\n20190327,AAPL,1888400,1897600,1865400,1885000,26785493,-2.0,0.0,0.0\n20190327,GOOG,11876300,11876300,11591400,11730600,1251820,-2.0,0.0,0.0\n20190327,IBM,1402600,1404800,1384100,1392400,2381589,-1.0,0.0,0.0\n20190328,AAPL,1889300,1895600,1875300,1887100,19466097,-1.0,0.0,0.0\n20190328,GOOG,11698300,11717000,11595000,11684900,878223,-1.0,0.0,0.0\n20190328,IBM,1399100,1404400,1391100,1399500,1901090,0.0,0.0,0.0\n20190329,AAPL,1899500,1900800,1885400,1899400,18639099,0.0,0.0,0.0\n20190329,GOOG,11756900,11794200,11628000,11731100,971516,0.0,0.0,0.0\n20190329,IBM,1405000,1412100,1401500,1411100,2086371,2.0,2.0,20725470.0\n20190401,AAPL,1916400,1916800,1883800,1912400,23096523,2.0,2.0,20725470.0\n20190401,GOOG,11840700,11968000,11818400,11941500,1030256,2.0,2.0,20725470.0\n20190401,IBM,1415100,1433900,1415100,1432400,3079888,3.0,3.0,27206667.0\n20190402,AAPL,1910500,1944600,1910500,1940400,20026095,3.0,3.0,27206667.0\n20190402,GOOG,11957500,12013500,11858100,12004200,616071,3.0,3.0,27206667.0\n20190402,IBM,1431300,1439500,1426000,1430100,2058194,3.0,3.0,22700360.0\n20190403,AAPL,1932500,1965000,1931500,1953500,20033154,3.0,3.0,22700360.0\n20190403,GOOG,12078400,12163300,12005000,12053300,861858,3.0,3.0,22700360.0\n20190403,IBM,1436500,1442200,1430200,1436000,2321998,3.0,3.0,23217010.0\n20190404,AAPL,1948900,1963700,1931400,1957200,17224373,3.0,3.0,23217010.0\n20190404,GOOG,12060000,12160900,12041300,12146800,786602,3.0,3.0,23217010.0\n20190404,IBM,1436200,1441400,1425500,1427600,2466019,-1.0,0.0,0.0\n20190405,AAPL,1964100,1971000,1959300,1969700,16026098,-1.0,0.0,0.0\n20190405,GOOG,12147000,12162200,12050000,12071400,760551,-1.0,0.0,0.0\n20190405,IBM,1432900,1435000,1424600,1433100,2353774,0.0,1.0,6.80868171710623\n20190408,AAPL,1964200,2002300,1963300,2000800,23831141,0.0,1.0,6.80868171710623\n20190408,GOOG,12071500,12085000,11997800,12038400,730048,0.0,1.0,6.80868171710623\n20190408,IBM,1430200,1434200,1428800,1433700,1804889,0.0,1.0,32.643252224511265\n20190409,AAPL,2003400,2028500,1992300,1995000,33104131,0.0,1.0,32.643252224511265\n20190409,GOOG,11960000,12022900,11935000,11981300,696431,0.0,1.0,32.643252224511265\n20190409,IBM,1427600,1429500,1418400,1422100,2473930,-1.0,0.5,10.44175442481156\n20190410,AAPL,1987400,2007400,1981800,2006600,20023619,-1.0,0.5,10.44175442481156\n20190410,GOOG,12002600,12039200,11962800,12021600,614098,-1.0,0.5,10.44175442481156\n20190410,IBM,1422000,1435000,1420100,1430400,2008464,1.0,1.0,2008464.0\n20190411,AAPL,2008500,2010000,1984500,1989400,18037895,1.0,1.0,2008464.0\n20190411,GOOG,12047100,12079800,12002300,12046200,530110,1.0,1.0,2008464.0\n20190411,IBM,1438000,1441100,1430900,1438100,2467900,2.0,2.0,2998010.0\n20190412,AAPL,1992300,2001400,1962100,1988900,25108070,2.0,2.0,2998010.0\n20190412,GOOG,12093000,12184200,12081200,12178600,822510,2.0,2.0,2998010.0\n20190412,IBM,1442600,1444400,1437000,1443600,2271167,1.0,2.0,0.12321444858167115\n20190415,AAPL,1985700,1998400,1980100,1992300,14628164,1.0,2.0,0.12321444858167115\n20190415,GOOG,12177400,12242500,12091100,12216300,992028,1.0,2.0,0.12321444858167115\n20190415,IBM,1444700,1444700,1432700,1439200,2729623,2.0,2.0,3721651.0\n20190416,AAPL,1994600,2013700,1985600,1992500,24268015,2.0,2.0,3721651.0\n20190416,GOOG,12250000,12304200,12201200,12274600,774879,2.0,2.0,3721651.0\n20190416,IBM,1444000,1453900,1440500,1451400,5459515,3.0,3.0,30502409.0\n20190417,AAPL,1995800,2034600,1986100,2031200,27999611,3.0,3.0,30502409.0\n20190417,GOOG,12320300,12405600,12278600,12365200,1049803,3.0,3.0,30502409.0\n20190417,IBM,1373700,1419600,1362800,1390800,11627349,1.0,2.0,2.4983694907583835\n20190418,AAPL,2031200,2041500,2025200,2038600,20443680,1.0,2.0,2.4983694907583835\n20190418,GOOG,12390800,12420800,12346100,12368100,1018437,1.0,2.0,2.4983694907583835\n20190418,IBM,1390000,1404900,1387800,1403300,3958106,2.0,2.0,21462117.0\n20190422,AAPL,2026600,2049400,2023300,2046400,13775526,2.0,2.0,21462117.0\n20190422,GOOG,12329000,12494300,12283000,12490900,662517,2.0,2.0,21462117.0\n20190422,IBM,1394200,1405500,1384800,1388700,3350803,2.0,2.0,14438043.0\n20190423,AAPL,2044300,2077500,2039000,2075100,19810816,2.0,2.0,14438043.0\n20190423,GOOG,12506900,12691500,12462700,12645000,1114144,2.0,2.0,14438043.0\n20190423,IBM,1391500,1409200,1389500,1404100,3072805,3.0,3.0,23997765.0\n20190424,AAPL,2074400,2084800,2070500,2071200,14932007,3.0,3.0,23997765.0\n20190424,GOOG,12652500,12680300,12549500,12550500,700959,3.0,3.0,23997765.0\n20190424,IBM,1406000,1412900,1398500,1399700,2019400,2.0,2.0,16951407.0\n20190425,AAPL,2068400,2077600,2051200,2052400,15970808,2.0,2.0,16951407.0\n20190425,GOOG,12652600,12676500,12520000,12629800,956135,2.0,2.0,16951407.0\n20190425,IBM,1397000,1397000,1377300,1386500,2373830,-1.0,0.0,0.0\n20190426,AAPL,2048300,2050000,2021200,2042900,16420146,-1.0,0.0,0.0\n20190426,GOOG,12665500,12736800,12602800,12718000,1083643,-1.0,0.0,0.0\n20190426,IBM,1392800,1398900,1388200,1394300,1940500,0.0,1.0,0.06599472379843638\n20190429,AAPL,2044000,2059700,2038600,2046100,19605618,0.0,1.0,0.06599472379843638\n20190429,GOOG,12730100,12892800,12663800,12874300,1717098,0.0,1.0,0.06599472379843638\n20190429,IBM,1391500,1396200,1388200,1390800,1946116,1.0,1.0,1717098.0\n20190430,AAPL,2030600,2033900,1991100,2005100,35906353,1.0,1.0,1717098.0\n20190430,GOOG,11850500,11930000,11748700,11894700,5795501,1.0,1.0,1717098.0\n20190430,IBM,1394200,1404400,1386800,1402600,2712449,-2.0,0.3333333333333333,0.061071520136204774\n20190501,AAPL,2099700,2153100,2092300,2105200,58431082,-2.0,0.3333333333333333,0.061071520136204774\n20190501,GOOG,11880100,11884900,11671500,11676500,2457471,-2.0,0.3333333333333333,0.061071520136204774\n20190501,IBM,1406400,1418000,1401900,1405700,2599938,1.0,2.0,24.83488920113401\n20190502,AAPL,2099500,2126500,2081300,2091700,28925386,1.0,2.0,24.83488920113401\n20190502,GOOG,11676600,11737900,11550100,11623600,1797876,1.0,2.0,24.83488920113401\n20190502,IBM,1404900,1412700,1394100,1396400,2728959,-1.0,0.0,0.0\n20190503,AAPL,2107600,2118400,2102300,2117800,18034291,-1.0,0.0,0.0\n20190503,GOOG,11726700,11868800,11689800,11855600,1770247,-1.0,0.0,0.0\n20190503,IBM,1397000,1410000,1397000,1402800,1967201,0.0,0.0,0.0\n20190506,AAPL,2042900,2088400,2035000,2086000,28839202,0.0,0.0,0.0\n20190506,GOOG,11678200,11908500,11662600,11894900,1420016,0.0,0.0,0.0\n20190506,IBM,1382900,1406900,1379000,1404000,2198109,-1.0,0.5,0.04575190163864389\n20190507,AAPL,2059300,2074000,2008300,2028600,34855750,-1.0,0.5,0.04575190163864389\n20190507,GOOG,11804700,11905400,11610500,11746200,1350758,-1.0,0.5,0.04575190163864389\n20190507,IBM,1391800,1394800,1362000,1376200,4062939,-3.0,0.0,0.0\n20190508,AAPL,2020200,2053400,2017600,2029000,22876206,-3.0,0.0,0.0\n20190508,GOOG,11715200,11805300,11656600,11657400,1150107,-3.0,0.0,0.0\n20190508,IBM,1377700,1386700,1371300,1380000,2823027,0.0,0.0,0.0\n20190509,AAPL,2004600,2016800,1966700,2007200,32813078,0.0,0.0,0.0\n20190509,GOOG,11589000,11697700,11508500,11626100,1076230,0.0,0.0,0.0\n20190509,IBM,1348900,1355700,1330300,1353400,3234443,-3.0,0.0,0.0\n20190510,AAPL,1974300,1988500,1927600,1972500,36509516,-3.0,0.0,0.0\n20190510,GOOG,11603000,11726000,11424900,11644900,1196664,-3.0,0.0,0.0\n20190510,IBM,1348800,1357500,1324400,1353200,3404127,-3.0,0.0,0.0\n20190513,AAPL,1876900,1894800,1828500,1857200,50683171,-3.0,0.0,0.0\n20190513,GOOG,11415000,11480000,11220000,11326100,1634334,-3.0,0.0,0.0\n20190513,IBM,1332800,1335500,1309600,1314100,3593331,-3.0,0.0,0.0\n20190514,AAPL,1864100,1897100,1854100,1886600,31680942,-3.0,0.0,0.0\n20190514,GOOG,11371100,11410000,11195200,11203300,1641019,-3.0,0.0,0.0\n20190514,IBM,1318200,1343200,1318100,1333400,2780832,-1.0,0.0,0.0\n20190515,AAPL,1863000,1917500,1860100,1909200,23820574,-1.0,0.0,0.0\n20190515,GOOG,11178700,11714200,11167500,11640600,2011343,-1.0,0.0,0.0\n20190515,IBM,1325900,1345900,1323700,1344000,2134015,2.0,3.0,13.904108846676076\n20190516,AAPL,1899100,1924800,1888400,1901400,28935602,2.0,3.0,13.904108846676076\n20190516,GOOG,11657800,11883600,11626400,11789800,1375292,2.0,3.0,13.904108846676076\n20190516,IBM,1347400,1361000,1346400,1358700,2367170,3.0,3.0,32678064.0\n20190517,AAPL,1870600,1909000,1867600,1889800,28930584,3.0,3.0,32678064.0\n20190517,GOOG,11699500,11802500,11599900,11623000,1054944,3.0,3.0,32678064.0\n20190517,IBM,1346800,1354000,1339400,1342900,2138590,0.0,0.0,0.0\n20190520,AAPL,1836300,1843400,1802900,1830900,33467674,0.0,0.0,0.0\n20190520,GOOG,11445000,11470900,11313500,11383300,1174301,0.0,0.0,0.0\n20190520,IBM,1335300,1354300,1329400,1351200,2969086,-3.0,0.0,0.0\n20190521,AAPL,1852200,1880000,1847000,1865900,24078878,-3.0,0.0,0.0\n20190521,GOOG,11480400,11527800,11379400,11496300,885148,-3.0,0.0,0.0\n20190521,IBM,1360100,1370400,1358300,1364600,1969099,1.0,1.0,1969099.0\n20190522,AAPL,1848600,1857100,1825500,1827900,26908150,1.0,1.0,1969099.0\n20190522,GOOG,11460000,11587500,11453700,11514200,783717,1.0,1.0,1969099.0\n20190522,IBM,1360000,1367500,1357200,1363600,1460512,1.0,1.0,783717.0\n20190523,AAPL,1798500,1805400,1778100,1796700,31309823,1.0,1.0,783717.0\n20190523,GOOG,11425400,11458900,11294200,11405500,1038778,1.0,1.0,783717.0\n20190523,IBM,1351300,1351300,1304500,1323900,4606839,-3.0,0.0,0.0\n20190524,AAPL,1802900,1821400,1786200,1790300,21640795,-3.0,0.0,0.0\n20190524,GOOG,11479700,11499100,11317300,11340000,1023769,-3.0,0.0,0.0\n20190524,IBM,1335300,1342000,1315900,1323000,2291630,0.0,0.0,0.0\n20190528,AAPL,1788900,1805900,1779200,1781700,22752739,0.0,0.0,0.0\n20190528,GOOG,11352400,11517700,11331200,11331800,1075412,0.0,0.0,0.0\n20190528,IBM,1320100,1326400,1302700,1304600,2419010,0.0,1.0,0.4445669922819666\n20190529,AAPL,1764800,1793500,1760000,1773500,26364270,0.0,1.0,0.4445669922819666\n20190529,GOOG,11290000,11294500,11082500,11163600,1425120,0.0,1.0,0.4445669922819666\n20190529,IBM,1300000,1302600,1283300,1296800,3201934,-3.0,0.0,0.0\n20190530,AAPL,1779900,1792300,1766700,1782500,19994104,-3.0,0.0,0.0\n20190530,GOOG,11180000,11231500,11121200,11177900,865165,-3.0,0.0,0.0\n20190530,IBM,1297400,1299700,1289300,1295600,2351813,0.0,0.0,0.0\n20190531,AAPL,1762200,1779900,1749900,1750000,23031208,0.0,0.0,0.0\n20190531,GOOG,11034100,11096000,11001000,11038500,1272882,0.0,0.0,0.0\n20190531,IBM,1284400,1284400,1268600,1270200,2523395,-3.0,0.0,0.0\n20190603,AAPL,1755800,1779200,1702700,1732800,36949732,-3.0,0.0,0.0\n20190603,GOOG,10660200,10670000,10250100,10363100,4745310,-3.0,0.0,0.0\n20190603,IBM,1270000,1285600,1270000,1282600,3463489,-2.0,0.0,0.0\n20190604,AAPL,1754500,1798400,1745200,1796700,27402677,-2.0,0.0,0.0\n20190604,GOOG,10420100,10562100,10337600,10530600,2550546,-2.0,0.0,0.0\n20190604,IBM,1295600,1327400,1290900,1326900,3074020,2.0,2.0,30476697.0\n20190605,AAPL,1842500,1849900,1811400,1825400,26229032,2.0,2.0,30476697.0\n20190605,GOOG,10522000,10535600,10304300,10429500,1991132,2.0,2.0,30476697.0\n20190605,IBM,1332200,1336100,1304700,1314500,2770367,2.0,2.0,28999399.0\n20190606,AAPL,1830900,1854700,1821500,1852300,18722674,2.0,2.0,28999399.0\n20190606,GOOG,10449900,10474700,10334300,10446000,1392091,2.0,2.0,28999399.0\n20190606,IBM,1321900,1326400,1309200,1322000,1962106,1.0,1.0,18722674.0\n20190607,AAPL,1866000,1919200,1857700,1901400,27840129,1.0,1.0,18722674.0\n20190607,GOOG,10504100,10717000,10482700,10660300,1544742,1.0,1.0,18722674.0\n20190607,IBM,1320800,1347200,1320800,1332900,2144277,3.0,3.0,31529148.0\n20190610,AAPL,1923300,1953700,1916100,1925200,23916792,3.0,3.0,31529148.0\n20190610,GOOG,10733900,10928400,10726600,10803800,1308312,3.0,3.0,31529148.0\n20190610,IBM,1343800,1353400,1339100,1347000,2479503,3.0,3.0,27704607.0\n20190611,AAPL,1948400,1960000,1936000,1948100,22798624,3.0,3.0,27704607.0\n20190611,GOOG,10946900,11019900,10775200,10788100,1285869,3.0,3.0,27704607.0\n20190611,IBM,1353200,1364400,1350500,1359700,2771962,3.0,3.0,26856455.0\n20190612,AAPL,1939900,1959700,1933700,1941900,16452770,3.0,3.0,26856455.0\n20190612,GOOG,10780000,10805900,10676100,10773300,962420,3.0,3.0,26856455.0\n20190612,IBM,1354900,1359400,1344100,1348700,1729989,-1.0,0.0,0.0\n20190613,AAPL,1947200,1968000,1936000,1947400,18162145,-1.0,0.0,0.0\n20190613,GOOG,10830000,10942200,10804400,10887900,885444,-1.0,0.0,0.0\n20190613,IBM,1351300,1362700,1350900,1357700,1920879,1.0,1.0,18162145.0\n20190614,AAPL,1916200,1935800,1903000,1927400,15883266,1.0,1.0,18162145.0\n20190614,GOOG,10860200,10925800,10800000,10853500,994158,1.0,1.0,18162145.0\n20190614,IBM,1353500,1356500,1344300,1351900,1527445,-1.0,0.0,0.0\n20190617,AAPL,1929000,1949600,1921700,1939500,12890733,-1.0,0.0,0.0\n20190617,GOOG,10867400,10993700,10860100,10925000,809378,-1.0,0.0,0.0\n20190617,IBM,1353900,1360300,1347000,1349500,1814647,1.0,1.0,809378.0\n20190618,AAPL,1960200,2002900,1952100,1985000,23830038,1.0,1.0,809378.0\n20190618,GOOG,11087000,11165200,10986700,11034700,1208540,1.0,1.0,809378.0\n20190618,IBM,1352000,1371900,1352000,1364200,2276060,3.0,3.0,27314638.0\n20190619,AAPL,1996800,1998900,1973100,1978200,17677106,3.0,3.0,27314638.0\n20190619,GOOG,11050000,11070000,10934200,11025800,1014357,3.0,3.0,27314638.0\n20190619,IBM,1364300,1376700,1362400,1371000,1893849,1.0,1.0,1893849.0\n20190620,AAPL,2003700,2006000,1980300,1994000,18629038,1.0,1.0,1893849.0\n20190620,GOOG,11179900,11201800,11050000,11109500,1003009,1.0,1.0,1893849.0\n20190620,IBM,1389300,1395200,1382100,1388500,2216468,3.0,3.0,21848515.0\n20190621,AAPL,1984400,2008500,1981400,1988000,26177066,3.0,3.0,21848515.0\n20190621,GOOG,11075800,11249000,11071300,11224400,1469439,3.0,3.0,21848515.0\n20190621,IBM,1386900,1395400,1384000,1391800,3222090,3.0,3.0,30868595.0\n20190624,AAPL,1985600,2001600,1981700,1985500,14854581,3.0,3.0,30868595.0\n20190624,GOOG,11191800,11221600,11110000,11158300,1264074,3.0,3.0,30868595.0\n20190624,IBM,1392000,1401400,1390500,1393600,1762740,1.0,1.0,1762740.0\n20190625,AAPL,1984800,1992900,1952900,1955700,19610359,1.0,1.0,1762740.0\n20190625,GOOG,11129300,11154600,10838000,10863400,1352189,1.0,1.0,1762740.0\n20190625,IBM,1394600,1395000,1381300,1383700,2251465,-3.0,0.0,0.0\n20190626,AAPL,1978500,2009900,1973400,1998000,22885387,-3.0,0.0,0.0\n20190626,GOOG,10876900,10933000,10722900,10798000,1591139,-3.0,0.0,0.0\n20190626,IBM,1388700,1396800,1384200,1385300,1612064,0.0,1.0,14.383021847871241\n20190627,AAPL,2004000,2015700,1995700,1997300,15632774,0.0,1.0,14.383021847871241\n20190627,GOOG,10848400,10870000,10751800,10759300,870095,0.0,1.0,14.383021847871241\n20190627,IBM,1387200,1393000,1379600,1385200,1675796,0.0,1.0,9.328566245533466\n20190628,AAPL,1987200,1994900,1970500,1979200,19956663,0.0,1.0,9.328566245533466\n20190628,GOOG,10763600,10810000,10732500,10806200,1252274,0.0,1.0,9.328566245533466\n20190628,IBM,1385700,1391400,1378600,1379200,2567968,-2.0,0.0,0.0\n20190701,AAPL,2032800,2044900,2006500,2016800,24264641,-2.0,0.0,0.0\n20190701,GOOG,10994600,11075800,10937200,10979500,1288236,-2.0,0.0,0.0\n20190701,IBM,1396000,1414900,1392900,1399200,2717318,3.0,3.0,28270195.0\n20190702,AAPL,2014300,2031300,2013600,2027100,15965830,3.0,3.0,28270195.0\n20190702,GOOG,11013900,11117700,10989000,11117700,871863,3.0,3.0,28270195.0\n20190702,IBM,1396700,1404200,1394800,1402000,2091296,1.0,1.0,871863.0\n20190703,AAPL,2032100,2044400,2027000,2044100,9430155,1.0,1.0,871863.0\n20190703,GOOG,11160500,11267700,11138100,11219200,669181,1.0,1.0,871863.0\n20190703,IBM,1407200,1418100,1404900,1414900,1479573,2.0,2.0,2148754.0\n20190705,AAPL,2033500,2050800,2029000,2042500,15239601,2.0,2.0,2148754.0\n20190705,GOOG,11177900,11329200,11150000,11320300,1000689,2.0,2.0,2148754.0\n20190705,IBM,1408700,1414900,1399100,1413700,1819874,2.0,2.0,16240290.0\n20190708,AAPL,2009400,2014000,1984100,2000200,22281039,2.0,2.0,16240290.0\n20190708,GOOG,11259200,11270000,11113200,11163500,1031603,2.0,2.0,16240290.0\n20190708,IBM,1411000,1412800,1402800,1405800,1963230,-2.0,0.0,0.0\n20190709,AAPL,1992000,2015100,1988100,2012200,17873539,-2.0,0.0,0.0\n20190709,GOOG,11122300,11281000,11070000,11245800,1153922,-2.0,0.0,0.0\n20190709,IBM,1406100,1409900,1391300,1393400,2873887,-2.0,0.0,0.0\n20190710,AAPL,2019000,2037300,2015600,2032100,15735306,-2.0,0.0,0.0\n20190710,GOOG,11310000,11421000,11308800,11404800,1089447,-2.0,0.0,0.0\n20190710,IBM,1400000,1419000,1399300,1404600,2178813,3.0,3.0,19003566.0\n20190711,AAPL,2033500,2043900,2017100,2017400,16252329,3.0,3.0,19003566.0\n20190711,GOOG,11429500,11532200,11393000,11442100,1106386,3.0,3.0,19003566.0\n20190711,IBM,1407900,1415400,1403000,1412400,1873952,2.0,2.0,17358715.0\n20190712,AAPL,2025300,2040000,2022000,2032400,15652854,2.0,2.0,17358715.0\n20190712,GOOG,11439900,11472700,11386500,11445600,766543,2.0,2.0,17358715.0\n20190712,IBM,1419200,1429100,1417300,1426900,2255321,1.0,1.0,2255321.0\n20190715,AAPL,2040500,2058700,2040000,2052000,14611018,1.0,1.0,2255321.0\n20190715,GOOG,11455300,11508800,11396200,11505600,809028,1.0,1.0,2255321.0\n20190715,IBM,1428900,1435000,1421400,1433100,2100010,2.0,2.0,16711028.0\n20190716,AAPL,2047400,2061100,2035000,2044900,14612121,2.0,2.0,16711028.0\n20190716,GOOG,11458000,11585800,11450000,11536000,1156894,2.0,2.0,16711028.0\n20190716,IBM,1431600,1440300,1430600,1435200,2924182,3.0,3.0,18693197.0\n20190717,AAPL,2043100,2050900,2032700,2032800,11705771,3.0,3.0,18693197.0\n20190717,GOOG,11524900,11583200,11457100,11464900,1001430,3.0,3.0,18693197.0\n20190717,IBM,1436800,1438000,1419500,1431000,4677082,-2.0,0.0,0.0\n20190718,AAPL,2040000,2058800,2037000,2056600,15514507,-2.0,0.0,0.0\n20190718,GOOG,11410000,11476900,11327300,11468000,959692,-2.0,0.0,0.0\n20190718,IBM,1424500,1503000,1424100,1496300,11889986,0.0,1.0,12.38937700845688\n20190719,AAPL,2057800,2065000,2023600,2025700,18324264,0.0,1.0,12.38937700845688\n20190719,GOOG,11497700,11512700,11296200,11300100,1227100,0.0,1.0,12.38937700845688\n20190719,IBM,1499600,1515800,1495600,1498100,6056454,0.0,1.0,1.2470085463090963\n20190722,AAPL,2037800,2072300,2036100,2072300,19154085,0.0,1.0,1.2470085463090963\n20190722,GOOG,11340700,11392700,11242400,11382800,1075273,0.0,1.0,1.2470085463090963\n20190722,IBM,1501600,1519400,1497000,1497500,3660075,1.0,2.0,21.217086265534427\n20190723,AAPL,2083700,2089100,2073000,2088300,16514267,1.0,2.0,21.217086265534427\n20190723,GOOG,11434700,11469100,11317700,11465600,988570,1.0,2.0,21.217086265534427\n20190723,IBM,1505700,1507200,1483900,1503800,2908133,0.0,1.0,5.678649153941722\n20190724,AAPL,2076700,2091500,2071800,2086700,13148873,0.0,1.0,5.678649153941722\n20190724,GOOG,11311500,11439800,11270000,11381800,1292101,0.0,1.0,5.678649153941722\n20190724,IBM,1501200,1514500,1492000,1500400,2661472,1.0,1.0,13148873.0\n20190725,AAPL,2087200,2092400,2067300,2070500,11966186,1.0,1.0,13148873.0\n20190725,GOOG,11370100,11419000,11210000,11348600,1579386,1.0,1.0,13148873.0\n20190725,IBM,1498000,1506200,1486100,1504100,2388821,-1.0,0.5,0.8834020445943516\n20190726,AAPL,2074000,2097300,2071400,2077500,15726362,-1.0,0.5,0.8834020445943516\n20190726,GOOG,12240400,12656300,12232400,12477400,4327585,-1.0,0.5,0.8834020445943516\n20190726,IBM,1509200,1514000,1501000,1513400,1955575,2.0,2.0,20053947.0\n20190729,AAPL,2084700,2106400,2084100,2096700,19204268,2.0,2.0,20053947.0\n20190729,GOOG,12410000,12472300,12282700,12387500,2056580,2.0,2.0,20053947.0\n20190729,IBM,1511100,1514600,1503300,1509300,1617308,2.0,2.0,20821576.0\n20190730,AAPL,2088300,2106600,2073100,2088800,24740263,2.0,2.0,20821576.0\n20190730,GOOG,12265800,12348700,12232600,12251400,1360406,2.0,2.0,20821576.0\n20190730,IBM,1500000,1503900,1492400,1497700,2278632,0.0,1.0,10.857507048088502\n20190731,AAPL,2164000,2213700,2113000,2127800,63857734,0.0,1.0,10.857507048088502\n20190731,GOOG,12233300,12512300,12071100,12166800,1526178,0.0,1.0,10.857507048088502\n20190731,IBM,1497000,1501800,1463900,1482400,2748127,0.0,1.0,15.296969214878208\n20190801,AAPL,2140100,2180300,2067300,2084500,51934597,0.0,1.0,15.296969214878208\n20190801,GOOG,12143600,12343300,12055100,12094800,1804644,0.0,1.0,15.296969214878208\n20190801,IBM,1489000,1528100,1485000,1503000,5835516,-1.0,0.5,0.10858947561243003\n20190802,AAPL,2051500,2064300,2016300,2040900,36037467,-1.0,0.5,0.10858947561243003\n20190802,GOOG,12007400,12071000,11889200,11936300,1455908,-1.0,0.5,0.10858947561243003\n20190802,IBM,1490300,1528900,1455900,1472800,7643491,-2.0,0.3333333333333333,0.1693403126393401\n20190805,AAPL,1978800,1986500,1925800,1932200,45466995,-2.0,0.3333333333333333,0.1693403126393401\n20190805,GOOG,11706000,11752400,11401800,11523200,2267696,-2.0,0.3333333333333333,0.1693403126393401\n20190805,IBM,1449800,1451000,1391700,1407500,6186074,-3.0,0.0,0.0\n20190806,AAPL,1964300,1980700,1940400,1969800,32111414,-3.0,0.0,0.0\n20190806,GOOG,11628500,11800000,11598900,11693600,1363456,-3.0,0.0,0.0\n20190806,IBM,1420000,1424700,1393100,1407300,4294639,0.0,0.0,0.0\n20190807,AAPL,1954900,1995600,1938200,1991400,29406192,0.0,0.0,0.0\n20190807,GOOG,11567500,11784400,11491600,11738200,1214158,0.0,0.0,0.0\n20190807,IBM,1390000,1395800,1364800,1391300,5028053,0.0,1.0,5.848425225430201\n20190808,AAPL,2003100,2035300,1993900,2034500,23463801,0.0,1.0,5.848425225430201\n20190808,GOOG,11832200,12050100,11733800,12045100,1254711,0.0,1.0,5.848425225430201\n20190808,IBM,1384500,1404200,1377800,1401300,4344213,2.0,2.0,24718512.0\n20190809,AAPL,2013000,2027600,1992900,2009900,21848205,2.0,2.0,24718512.0\n20190809,GOOG,11980000,12039700,11835200,11881400,917903,2.0,2.0,24718512.0\n20190809,IBM,1393000,1393000,1353500,1361200,4720674,-1.0,0.0,0.0\n20190812,AAPL,1994600,2020600,1991500,2005000,19913300,-1.0,0.0,0.0\n20190812,GOOG,11792300,11848600,11675000,11742300,865880,-1.0,0.0,0.0\n20190812,IBM,1356600,1358700,1331800,1340900,3390677,-3.0,0.0,0.0\n20190813,AAPL,2010000,2121400,2008300,2089800,43883110,-3.0,0.0,0.0\n20190813,GOOG,11714600,12049300,11714600,11972600,1117326,-3.0,0.0,0.0\n20190813,IBM,1338100,1365700,1328500,1357800,3939008,1.0,2.0,11.424306830552261\n20190814,AAPL,2032800,2064400,2025000,2027500,31227195,1.0,2.0,11.424306830552261\n20190814,GOOG,11763700,11823600,11607900,11641300,1330650,1.0,2.0,11.424306830552261\n20190814,IBM,1339100,1341600,1309800,1312400,3912510,-2.0,0.0,0.0\n20190815,AAPL,2034600,2051500,1996700,2016800,24652850,-2.0,0.0,0.0\n20190815,GOOG,11684000,11759200,11620800,11675700,1095137,-2.0,0.0,0.0\n20190815,IBM,1314200,1323600,1302500,1318800,3303365,-2.0,0.0,0.0\n20190816,AAPL,2041700,2071600,2038500,2064400,24842738,-2.0,0.0,0.0\n20190816,GOOG,11795500,11826800,11715800,11776000,1161671,-2.0,0.0,0.0\n20190816,IBM,1330400,1345900,1329800,1337400,2406250,3.0,3.0,28410659.0\n20190819,AAPL,2106900,2127300,2100400,2103400,21632067,3.0,3.0,28410659.0\n20190819,GOOG,11906000,12069900,11900900,11985300,1003576,3.0,3.0,28410659.0\n20190819,IBM,1348800,1363200,1348800,1350300,2773650,3.0,3.0,25409293.0\n20190820,AAPL,2107800,2133500,2103200,2103500,21348212,3.0,3.0,25409293.0\n20190820,GOOG,11953900,11961100,11820000,11826900,682728,3.0,3.0,25409293.0\n20190820,IBM,1351100,1352700,1328200,1331000,2504433,0.0,1.0,8.524169742213108\n20190821,AAPL,2129700,2136500,2116100,2126700,18922195,0.0,1.0,8.524169742213108\n20190821,GOOG,11920600,11990000,11871100,11912400,646709,0.0,1.0,8.524169742213108\n20190821,IBM,1347100,1359000,1338000,1342800,2467302,1.0,1.0,18922195.0\n20190822,AAPL,2131900,2144300,2107500,2124500,19534453,1.0,1.0,18922195.0\n20190822,GOOG,11940700,11980500,11784500,11895000,784498,1.0,1.0,18922195.0\n20190822,IBM,1349900,1356400,1338500,1343400,2191473,0.0,1.0,24.900577184390528\n20190823,AAPL,2093900,2120500,2010000,2026300,41268018,0.0,1.0,24.900577184390528\n20190823,GOOG,11820500,11940800,11476000,11517200,1399418,0.0,1.0,24.900577184390528\n20190823,IBM,1336000,1342000,1288300,1295700,3740545,-3.0,0.0,0.0\n20190826,AAPL,2058900,2071900,2050600,2066000,23135836,-3.0,0.0,0.0\n20190826,GOOG,11605000,11694700,11528000,11694700,1029694,-3.0,0.0,0.0\n20190826,IBM,1310100,1313000,1291800,1299900,2342907,0.0,0.0,0.0\n20190827,AAPL,2078100,2085500,2035400,2041300,19567155,0.0,0.0,0.0\n20190827,GOOG,11805300,11829500,11615600,11682700,884564,0.0,0.0,0.0\n20190827,IBM,1310800,1316900,1303300,1311700,3754502,0.0,0.0,0.0\n20190828,AAPL,2041000,2057200,2033300,2055200,14183557,0.0,0.0,0.0\n20190828,GOOG,11626900,11762100,11572000,11710200,625006,0.0,0.0,0.0\n20190828,IBM,1303300,1328800,1300600,1327200,2210239,0.0,1.0,0.15583107960859183\n20190829,AAPL,2086900,2093200,2066500,2091000,18608188,0.0,1.0,0.15583107960859183\n20190829,GOOG,11820700,11964100,11811200,11930400,978995,0.0,1.0,0.15583107960859183\n20190829,IBM,1341300,1356900,1340400,1349300,2518503,3.0,3.0,22105686.0\n20190830,AAPL,2101500,2104500,2072000,2087400,17065976,3.0,3.0,22105686.0\n20190830,GOOG,11985000,11995000,11838100,11884200,846644,3.0,3.0,22105686.0\n20190830,IBM,1356800,1360600,1343800,1354600,2001659,3.0,3.0,19914279.0\n20190903,AAPL,2064200,2069800,2042200,2056900,17995638,3.0,3.0,19914279.0\n20190903,GOOG,11784700,11867500,11632000,11682400,1293007,3.0,3.0,19914279.0\n20190903,IBM,1346700,1349000,1333600,1341500,2033141,-3.0,0.0,0.0\n20190904,AAPL,2083900,2094800,2073100,2092500,17133945,-3.0,0.0,0.0\n20190904,GOOG,11784500,11834800,11707600,11814100,967215,-3.0,0.0,0.0\n20190904,IBM,1358500,1364300,1351500,1363100,1561819,1.0,1.0,1561819.0\n20190905,AAPL,2118500,2139600,2115100,2132800,20682004,1.0,1.0,1561819.0\n20190905,GOOG,11923200,12130400,11915300,12112300,1284567,1.0,1.0,1561819.0\n20190905,IBM,1383500,1417000,1380500,1409700,4210893,3.0,3.0,26177464.0\n20190906,AAPL,2139800,2144200,2125100,2132700,17454572,3.0,3.0,26177464.0\n20190906,GOOG,12073900,12121000,12026000,12049300,916327,3.0,3.0,26177464.0\n20190906,IBM,1415200,1415200,1404600,1405500,2228125,1.0,1.0,17454572.0\n20190909,AAPL,2148600,2164400,2110700,2141500,23787972,1.0,1.0,17454572.0\n20190909,GOOG,12076600,12200000,11927200,12049200,1345648,1.0,1.0,17454572.0\n20190909,IBM,1405900,1430100,1404600,1426200,3474580,2.0,3.0,1.2026329945234508\n20190910,AAPL,2138100,2167800,2117100,2167700,28051341,2.0,3.0,1.2026329945234508\n20190910,GOOG,11955400,12100000,11944700,12074500,1131329,2.0,3.0,1.2026329945234508\n20190910,IBM,1430000,1454600,1429600,1450200,4363217,2.0,2.0,32414558.0\n20190911,AAPL,2181200,2236400,2177300,2235700,40687303,2.0,2.0,32414558.0\n20190911,GOOG,12041800,12225900,12022000,12201700,1150453,2.0,2.0,32414558.0\n20190911,IBM,1448500,1450800,1427200,1436000,3087123,2.0,2.0,41837756.0\n20190912,AAPL,2248000,2264200,2228600,2230900,27809109,2.0,2.0,41837756.0\n20190912,GOOG,12249800,12416800,12230000,12340000,1554159,2.0,2.0,41837756.0\n20190912,IBM,1440300,1440700,1418800,1436100,1985446,1.0,2.0,14.789255411630435\n20190913,AAPL,2200100,2207900,2170200,2188000,36334641,1.0,2.0,14.789255411630435\n20190913,GOOG,12313500,12408800,12270100,12392200,1136449,1.0,2.0,14.789255411630435\n20190913,IBM,1440000,1446500,1432600,1436400,1660207,-1.0,0.0,0.0\n20190916,AAPL,2177400,2201300,2175600,2199000,18858994,-1.0,0.0,0.0\n20190916,GOOG,12304700,12395600,12256000,12313000,938240,-1.0,0.0,0.0\n20190916,IBM,1425000,1435900,1422700,1424300,1473455,0.0,0.0,0.0\n20190917,AAPL,2198700,2208200,2191200,2206500,15950731,0.0,0.0,0.0\n20190917,GOOG,12316800,12350500,12236700,12291600,801300,0.0,0.0,0.0\n20190917,IBM,1424700,1424800,1406900,1421800,1965391,-1.0,0.5,5.765273751206767\n20190918,AAPL,2211300,2228500,2194500,2227700,22852282,-1.0,0.5,5.765273751206767\n20190918,GOOG,12282800,12356100,12163100,12326500,957556,-1.0,0.5,5.765273751206767\n20190918,IBM,1420000,1422900,1405300,1422100,1732555,-1.0,0.5,8.494921585020098\n20190919,AAPL,2221200,2237600,2203700,2209500,19957797,-1.0,0.5,8.494921585020098\n20190919,GOOG,12320200,12444900,12320200,12386400,898159,-1.0,0.5,8.494921585020098\n20190919,IBM,1425300,1450100,1424600,1429400,2760621,3.0,3.0,23616577.0\n20190920,AAPL,2213900,2225500,2174800,2176900,31800687,3.0,3.0,23616577.0\n20190920,GOOG,12347500,12433200,12228100,12296800,1527184,3.0,3.0,23616577.0\n20190920,IBM,1435100,1438300,1418300,1418300,3679511,-1.0,0.0,0.0\n20190923,AAPL,2189100,2198400,2176500,2186800,16559468,-1.0,0.0,0.0\n20190923,GOOG,12271200,12392300,12240000,12340900,924827,-1.0,0.0,0.0\n20190923,IBM,1411900,1422100,1405600,1420300,1450872,-1.0,0.0,0.0\n20190924,AAPL,2211400,2224800,2171900,2176800,27421294,-1.0,0.0,0.0\n20190924,GOOG,12400000,12467800,12110200,12190900,1369997,-1.0,0.0,0.0\n20190924,IBM,1422800,1428900,1410700,1417800,2612966,-1.0,0.5,0.047583729399282584\n20190925,AAPL,2187500,2215000,2171500,2209900,19455919,-1.0,0.5,0.047583729399282584\n20190925,GOOG,12164300,12484000,12100000,12463100,1342641,-1.0,0.5,0.047583729399282584\n20190925,IBM,1418700,1436000,1408600,1432000,1927961,0.0,1.0,0.15725136740235862\n20190926,AAPL,2198800,2209400,2188300,2198900,16281412,0.0,1.0,0.15725136740235862\n20190926,GOOG,12419900,12459800,12324500,12420000,1336283,0.0,1.0,0.15725136740235862\n20190926,IBM,1431100,1438400,1414100,1436000,1821053,1.0,1.0,1821053.0\n20190927,AAPL,2204300,2209600,2172800,2188500,23029276,1.0,1.0,1821053.0\n20190927,GOOG,12425000,12444600,12144600,12250800,1168550,1.0,1.0,1821053.0\n20190927,IBM,1441100,1450700,1423800,1433100,1905797,1.0,1.0,1905797.0\n20190930,AAPL,2209300,2245800,2208000,2239800,22658210,1.0,1.0,1905797.0\n20190930,GOOG,12214100,12260000,12123400,12186300,1184162,1.0,1.0,1905797.0\n20190930,IBM,1437400,1465700,1437400,1454100,3060246,1.0,2.0,21.718697272839357\n20191001,AAPL,2251300,2282000,2241900,2245800,32509565,1.0,2.0,21.718697272839357\n20191001,GOOG,12207900,12312500,12035800,12051700,1130161,1.0,2.0,21.718697272839357\n20191001,IBM,1456000,1473500,1435400,1436200,2484575,1.0,2.0,30.963853822596956\n20191002,AAPL,2230900,2235900,2179300,2189600,31739723,1.0,2.0,30.963853822596956\n20191002,GOOG,11969300,11969800,11717600,11771900,1373217,1.0,2.0,30.963853822596956\n20191002,IBM,1421000,1422700,1405900,1417700,2622675,-3.0,0.0,0.0\n20191003,AAPL,2185300,2209600,2151500,2208100,26301723,-3.0,0.0,0.0\n20191003,GOOG,11822500,11894900,11620600,11873100,1506514,-3.0,0.0,0.0\n20191003,IBM,1415000,1420600,1391900,1419800,2531777,-3.0,0.0,0.0\n20191004,AAPL,2257100,2274900,2239000,2270100,31236611,-3.0,0.0,0.0\n20191004,GOOG,11924100,12115400,11890400,12088400,1012930,-3.0,0.0,0.0\n20191004,IBM,1421300,1430500,1410300,1429900,1697755,3.0,3.0,33947296.0\n20191007,AAPL,2263100,2299300,2258600,2270600,28675249,3.0,3.0,33947296.0\n20191007,GOOG,12050400,12184000,12040000,12072500,762527,3.0,3.0,33947296.0\n20191007,IBM,1423700,1427000,1412200,1412600,1672475,2.0,2.0,29437776.0\n20191008,AAPL,2258800,2280600,2243300,2243900,25163243,2.0,2.0,29437776.0\n20191008,GOOG,11964300,12060800,11890100,11892400,922604,2.0,2.0,29437776.0\n20191008,IBM,1401500,1404700,1382500,1383800,2699773,-2.0,0.0,0.0\n20191009,AAPL,2270800,2277900,2256500,2270000,17033593,-2.0,0.0,0.0\n20191009,GOOG,12001100,12083500,11974300,12019300,768220,-2.0,0.0,0.0\n20191009,IBM,1397800,1403300,1388000,1396300,2215673,0.0,0.0,0.0\n20191010,AAPL,2279000,2304400,2273000,2300900,26646576,0.0,0.0,0.0\n20191010,GOOG,12002600,12150000,11973400,12089500,725405,0.0,0.0,0.0\n20191010,IBM,1398400,1417800,1395700,1411300,2221612,3.0,3.0,29593593.0\n20191011,AAPL,2329500,2376400,2323000,2362200,38743375,3.0,3.0,29593593.0\n20191011,GOOG,12220100,12285500,12137000,12145700,1141581,3.0,3.0,29593593.0\n20191011,IBM,1427500,1445000,1426100,1426700,2578804,3.0,3.0,42463760.0\n20191014,AAPL,2351000,2381400,2346700,2358900,22169934,3.0,3.0,42463760.0\n20191014,GOOG,12137800,12263300,12119700,12171300,786716,3.0,3.0,42463760.0\n20191014,IBM,1423100,1424300,1413200,1419900,1938501,1.0,1.0,22169934.0\n20191015,AAPL,2363900,2376500,2348800,2353200,18817360,1.0,1.0,22169934.0\n20191015,GOOG,12216800,12472000,12202900,12425100,1267548,1.0,1.0,22169934.0\n20191015,IBM,1425400,1437200,1418100,1429300,2580404,1.0,1.0,1267548.0\n20191016,AAPL,2333700,2352400,2332000,2343900,16250144,1.0,1.0,1267548.0\n20191016,GOOG,12408300,12547400,12382000,12436500,975593,1.0,1.0,1267548.0\n20191016,IBM,1424500,1429500,1414000,1420400,4356894,0.0,1.0,0.060035960296721064\n20191017,AAPL,2350900,2361500,2335300,2352900,15525663,0.0,1.0,0.060035960296721064\n20191017,GOOG,12509400,12634600,12498600,12530600,853693,0.0,1.0,0.060035960296721064\n20191017,IBM,1350000,1360000,1329200,1342500,14363555,0.0,1.0,0.05943465945582413\n20191018,AAPL,2343600,2375800,2342900,2362800,21645988,0.0,1.0,0.05943465945582413\n20191018,GOOG,12542200,12590600,12410700,12454900,1218185,0.0,1.0,0.05943465945582413\n20191018,IBM,1343900,1344900,1322700,1340900,6279388,0.0,1.0,3.4471493081809883\n20191021,AAPL,2376500,2409900,2373200,2405300,19185571,0.0,1.0,3.4471493081809883\n20191021,GOOG,12517900,12549300,12405700,12460400,871520,0.0,1.0,3.4471493081809883\n20191021,IBM,1325400,1330900,1309000,1325800,5444353,-1.0,0.5,3.0376752350783494\n20191022,AAPL,2411700,2422000,2396200,2399700,19151854,-1.0,0.5,3.0376752350783494\n20191022,GOOG,12489900,12506200,12413900,12429400,960662,-1.0,0.5,3.0376752350783494\n20191022,IBM,1325300,1340500,1316100,1339400,3711584,1.0,1.0,19151854.0\n20191023,AAPL,2421000,2432400,2412200,2431400,17279116,1.0,1.0,19151854.0\n20191023,GOOG,12414700,12598900,12414700,12592400,830273,1.0,1.0,19151854.0\n20191023,IBM,1335200,1345600,1327300,1343900,3112861,3.0,3.0,21222250.0\n20191024,AAPL,2445100,2448000,2418100,2436000,15751993,3.0,3.0,21222250.0\n20191024,GOOG,12614500,12640000,12539300,12604600,908331,3.0,3.0,21222250.0\n20191024,IBM,1347900,1350700,1333100,1340800,2249594,3.0,3.0,18909918.0\n20191025,AAPL,2431700,2467300,2428800,2465800,15719212,3.0,3.0,18909918.0\n20191025,GOOG,12531100,12695400,12500000,12650700,1085974,3.0,3.0,18909918.0\n20191025,IBM,1341000,1359200,1341000,1354100,2267458,3.0,3.0,19072644.0\n20191028,AAPL,2475000,2492500,2467300,2490400,21869429,3.0,3.0,19072644.0\n20191028,GOOG,12760000,12993300,12725400,12901800,2032974,3.0,3.0,19072644.0\n20191028,IBM,1360000,1366100,1354500,1359700,2629152,3.0,3.0,26531555.0\n20191029,AAPL,2490100,2497400,2425700,2432900,32432237,3.0,3.0,26531555.0\n20191029,GOOG,12765900,12815900,12571000,12628200,1703363,3.0,3.0,26531555.0\n20191029,IBM,1354400,1355700,1334400,1338200,3793673,-1.0,0.5,0.8952773581119149\n20191030,AAPL,2449000,2453000,2412100,2433000,25182163,-1.0,0.5,0.8952773581119149\n20191030,GOOG,12564400,12693600,12518500,12612000,1257190,-1.0,0.5,0.8952773581119149\n20191030,IBM,1338200,1352800,1332600,1352500,1995841,-3.0,0.0,0.0\n20191031,AAPL,2472000,2491800,2423700,2488400,29358225,-3.0,0.0,0.0\n20191031,GOOG,12612800,12675500,12507900,12602000,1125543,-3.0,0.0,0.0\n20191031,IBM,1351000,1351100,1332300,1337500,2406865,-2.0,0.0,0.0\n20191101,AAPL,2495400,2559300,2491700,2558300,34738822,-2.0,0.0,0.0\n20191101,GOOG,12649200,12746200,12602900,12745000,1437033,-2.0,0.0,0.0\n20191101,IBM,1345000,1355600,1340900,1355300,2494236,3.0,3.0,38670091.0\n20191104,AAPL,2573700,2578500,2553800,2574800,23068018,3.0,3.0,38670091.0\n20191104,GOOG,12771000,12941000,12762700,12909600,1330494,3.0,3.0,38670091.0\n20191104,IBM,1364100,1377400,1362300,1376800,2675125,3.0,3.0,27073637.0\n20191105,AAPL,2570600,2581900,2563200,2571500,17418674,3.0,3.0,27073637.0\n20191105,GOOG,12934500,12989300,12913100,12918200,1092319,3.0,3.0,27073637.0\n20191105,IBM,1378000,1387600,1376500,1378900,2148099,3.0,3.0,20659092.0\n20191106,AAPL,2568700,2574900,2553600,2572400,15127808,3.0,3.0,20659092.0\n20191106,GOOG,12894600,12934200,12827400,12913400,925635,3.0,3.0,20659092.0\n20191106,IBM,1379300,1387700,1375500,1387700,2968964,0.0,1.0,0.19625870449968694\n20191107,AAPL,2587400,2603500,2581100,2594900,21971865,0.0,1.0,0.19625870449968694\n20191107,GOOG,12947300,13238000,12941200,13088600,1894197,0.0,1.0,0.19625870449968694\n20191107,IBM,1378700,1391400,1375900,1376900,2563423,3.0,3.0,26429485.0\n20191108,AAPL,2587000,2604400,2568500,2601400,15707487,3.0,3.0,26429485.0\n20191108,GOOG,13054800,13181900,13035300,13113100,1161270,3.0,3.0,26429485.0\n20191108,IBM,1375800,1376100,1362200,1376000,1881670,0.0,1.0,8.347631093656167\n20191111,AAPL,2583000,2624700,2582700,2622000,19212474,0.0,1.0,8.347631093656167\n20191111,GOOG,13033700,13070000,12974600,12989200,902335,0.0,1.0,8.347631093656167\n20191111,IBM,1371400,1371400,1350000,1354500,2089368,0.0,1.0,9.195351895884306\n20191112,AAPL,2615600,2627900,2609200,2619800,19134367,0.0,1.0,9.195351895884306\n20191112,GOOG,13008900,13100000,12955000,12987900,851300,0.0,1.0,9.195351895884306\n20191112,IBM,1357000,1366400,1350200,1356000,2343046,0.0,1.0,22.476643956302127\n20191113,AAPL,2611300,2647800,2610500,2644700,23793564,0.0,1.0,22.476643956302127\n20191113,GOOG,12940700,13040000,12935100,12974400,739932,0.0,1.0,22.476643956302127\n20191113,IBM,1352800,1355800,1338500,1344700,2444171,-1.0,0.5,7.472611281733035\n20191114,AAPL,2638800,2648800,2620900,2626900,19914659,-1.0,0.5,7.472611281733035\n20191114,GOOG,12968900,13170500,12956200,13115800,1053847,-1.0,0.5,7.472611281733035\n20191114,IBM,1341300,1343300,1333400,1339900,3652342,1.0,2.0,5.741112414992901\n20191115,AAPL,2637000,2657800,2630100,2657500,22034209,1.0,2.0,5.741112414992901\n20191115,GOOG,13162100,13348800,13142200,13348600,1385295,1.0,2.0,5.741112414992901\n20191115,IBM,1343900,1351200,1340300,1343600,2726635,2.0,2.0,23419504.0\n20191118,AAPL,2657900,2674300,2642300,2671200,17721094,2.0,2.0,23419504.0\n20191118,GOOG,13336400,13359400,13175000,13206500,1209170,2.0,2.0,23419504.0\n20191118,IBM,1343000,1344700,1332300,1342600,2344828,1.0,2.0,8.073199398847166\n20191119,AAPL,2678600,2680000,2654000,2662900,14461687,1.0,2.0,8.073199398847166\n20191119,GOOG,13273900,13278700,13128500,13151300,978451,1.0,2.0,8.073199398847166\n20191119,IBM,1348800,1353800,1344600,1345000,2113812,1.0,2.0,16.94055093203441\n20191120,AAPL,2655500,2660800,2604000,2632200,21910862,1.0,2.0,16.94055093203441\n20191120,GOOG,13117400,13152200,12910000,13028600,1045769,1.0,2.0,16.94055093203441\n20191120,IBM,1343300,1344600,1327600,1331700,2656759,-3.0,0.0,0.0\n20191121,AAPL,2639800,2640100,2611800,2620100,25496077,-3.0,0.0,0.0\n20191121,GOOG,13016400,13125900,12927800,13011200,823543,-3.0,0.0,0.0\n20191121,IBM,1334000,1341700,1330000,1338200,1922589,0.0,0.0,0.0\n20191122,AAPL,2625500,2631800,2608400,2618400,14050291,0.0,0.0,0.0\n20191122,GOOG,13050000,13085700,12913200,12953500,1129508,0.0,0.0,0.0\n20191122,IBM,1341900,1346500,1335900,1342800,1854309,1.0,1.0,1854309.0\n20191125,AAPL,2626400,2664400,2625200,2664200,14952237,1.0,1.0,1854309.0\n20191125,GOOG,12993600,13114600,12977200,13069500,824157,1.0,1.0,1854309.0\n20191125,IBM,1345800,1360000,1343500,1359600,1951649,2.0,2.0,16903886.0\n20191126,AAPL,2669300,2672100,2625000,2641000,14612190,2.0,2.0,16903886.0\n20191126,GOOG,13093300,13150000,13052200,13135400,808707,2.0,2.0,16903886.0\n20191126,IBM,1360800,1360800,1347700,1350600,2161558,3.0,3.0,17582455.0\n20191127,AAPL,2656300,2679800,2653100,2679400,14257370,3.0,3.0,17582455.0\n20191127,GOOG,13149200,13183600,13099400,13135000,839355,3.0,3.0,17582455.0\n20191127,IBM,1354200,1357100,1336200,1337400,2736584,1.0,2.0,5.516631318461264\n20191129,AAPL,2666000,2680000,2659000,2671800,8740858,1.0,2.0,5.516631318461264\n20191129,GOOG,13071100,13103600,13039700,13044800,443442,1.0,2.0,5.516631318461264\n20191129,IBM,1335000,1344900,1330300,1344600,1258007,-1.0,0.5,5.137302381675854\n20191202,AAPL,2675900,2682500,2634500,2640900,19883796,-1.0,0.5,5.137302381675854\n20191202,GOOG,13034900,13058300,12810000,12897700,1228578,-1.0,0.5,5.137302381675854\n20191202,IBM,1345000,1345000,1324800,1329500,2379052,-2.0,0.3333333333333333,0.8464277988062539\n20191203,AAPL,2582500,2595300,2562900,2595200,25349659,-2.0,0.3333333333333333,0.8464277988062539\n20191203,GOOG,12798700,12986400,12786700,12952700,1020330,-2.0,0.3333333333333333,0.8464277988062539\n20191203,IBM,1318400,1324400,1307000,1320900,2988726,-3.0,0.0,0.0\n20191204,AAPL,2610700,2633100,2606900,2617400,14277781,-3.0,0.0,0.0\n20191204,GOOG,13071100,13258300,13047000,13203000,1375828,-3.0,0.0,0.0\n20191204,IBM,1328100,1336600,1319600,1320000,2572145,1.0,1.0,1375828.0\n20191205,AAPL,2637500,2658900,2627300,2655800,15167492,1.0,1.0,1375828.0\n20191205,GOOG,13293300,13296000,13163100,13287200,1000657,1.0,1.0,1375828.0\n20191205,IBM,1329500,1332400,1316300,1319000,3036627,2.0,2.0,16168149.0\n20191206,AAPL,2675000,2710000,2673000,2707000,22748535,2.0,2.0,16168149.0\n20191206,GOOG,13338700,13444200,13331200,13406200,1105070,2.0,2.0,16168149.0\n20191206,IBM,1328500,1338900,1327000,1332000,2927403,3.0,3.0,26781008.0\n20191209,AAPL,2700700,2707900,2649100,2669200,27578946,3.0,3.0,26781008.0\n20191209,GOOG,13382400,13595600,13370200,13435500,1182862,3.0,3.0,26781008.0\n20191209,IBM,1334000,1345600,1332600,1339400,2232481,2.0,2.0,3415343.0\n20191210,AAPL,2686000,2700700,2658600,2686200,20123240,2.0,2.0,3415343.0\n20191210,GOOG,13424900,13499500,13355200,13449500,929248,2.0,2.0,3415343.0\n20191210,IBM,1340700,1348400,1335600,1339000,2724122,1.0,1.0,2724122.0\n20191211,AAPL,2688000,2711000,2685000,2707400,16804424,1.0,1.0,2724122.0\n20191211,GOOG,13473400,13517500,13427000,13450200,704154,1.0,1.0,2724122.0\n20191211,IBM,1341000,1345000,1336800,1337600,2712692,1.0,1.0,16804424.0\n20191212,AAPL,2678200,2725500,2673200,2714600,30574418,1.0,1.0,16804424.0\n20191212,GOOG,13459400,13554200,13403500,13499300,1095676,1.0,1.0,16804424.0\n20191212,IBM,1337400,1356600,1336600,1353200,2732737,3.0,3.0,34402831.0\n20191213,AAPL,2714400,2753000,2709300,2752500,29562777,3.0,3.0,34402831.0\n20191213,GOOG,13497800,13531400,13437700,13478300,1184357,3.0,3.0,34402831.0\n20191213,IBM,1345800,1355000,1340100,1342300,2059243,1.0,1.0,29562777.0\n20191216,AAPL,2769900,2807900,2769500,2798600,26440928,1.0,1.0,29562777.0\n20191216,GOOG,13560000,13647500,13521000,13614400,1139317,1.0,1.0,29562777.0\n20191216,IBM,1347000,1354500,1338600,1341200,2164923,2.0,2.0,27580245.0\n20191217,AAPL,2796600,2817700,2788000,2804400,24199828,2.0,2.0,27580245.0\n20191217,GOOG,13635600,13650000,13514300,13548400,1499801,2.0,2.0,27580245.0\n20191217,IBM,1343300,1346900,1334600,1342300,2260885,1.0,2.0,11.367065994068694\n20191218,AAPL,2797100,2819000,2791200,2797100,22958590,1.0,2.0,11.367065994068694\n20191218,GOOG,13574500,13605200,13511400,13519400,1012765,1.0,2.0,11.367065994068694\n20191218,IBM,1345100,1350000,1341700,1344500,2112294,0.0,1.0,22.669217439386234\n20191219,AAPL,2795100,2811800,2789500,2800300,17549156,0.0,1.0,22.669217439386234\n20191219,GOOG,13518200,13584500,13488900,13562000,1083615,0.0,1.0,22.669217439386234\n20191219,IBM,1344600,1347100,1341900,1344800,2381597,-1.0,0.0,0.0\n20191220,AAPL,2821700,2826500,2785600,2792800,28653733,-1.0,0.0,0.0\n20191220,GOOG,13633500,13637000,13490000,13492900,1666550,-1.0,0.0,0.0\n20191220,IBM,1357400,1364100,1350300,1356200,4239216,2.0,3.0,1.206108083718097\n20191223,AAPL,2805800,2842500,2803700,2839700,18669478,2.0,3.0,1.206108083718097\n20191223,GOOG,13574300,13598000,13465900,13483400,710157,2.0,3.0,1.206108083718097\n20191223,IBM,1357000,1361200,1350100,1355600,1898481,0.0,1.0,26.28922618519567\n20191224,AAPL,2845200,2848900,2829300,2842700,9434609,0.0,1.0,26.28922618519567\n20191224,GOOG,13485000,13504800,13428200,13434800,273972,0.0,1.0,26.28922618519567\n20191224,IBM,1356200,1356200,1346100,1349600,1012044,-1.0,0.5,7.336307635363791\n20191226,AAPL,2848200,2899800,2847000,2899100,20594335,-1.0,0.5,7.336307635363791\n20191226,GOOG,13468600,13613800,13444300,13604000,575477,-1.0,0.5,7.336307635363791\n20191226,IBM,1349700,1353000,1346600,1349000,1481367,2.0,2.0,21169812.0\n20191227,AAPL,2910600,2939700,2881100,2898200,32582221,2.0,2.0,21169812.0\n20191227,GOOG,13625800,13647500,13493100,13513400,907153,2.0,2.0,21169812.0\n20191227,IBM,1350000,1357500,1348800,1352800,2180289,3.0,3.0,35669663.0\n20191230,AAPL,2895700,2926900,2852300,2917000,33654017,3.0,3.0,35669663.0\n20191230,GOOG,13516700,13527900,13339900,13363700,922092,3.0,3.0,35669663.0\n20191230,IBM,1352500,1353000,1325000,1327600,3309507,-2.0,0.0,0.0\n20191231,AAPL,2899300,2936800,2895200,2933700,21171424,-2.0,0.0,0.0\n20191231,GOOG,13330900,13383100,13292100,13368700,708707,-2.0,0.0,0.0\n20191231,IBM,1325500,1341200,1324000,1340200,2844027,-2.0,0.0,0.0\n"
  },
  {
    "path": "Tests/TestData/portfolio_targets.csv",
    "content": "Date,Symbol,Weight\n2015-01-13,TLT,0.6403554273566532\n2015-01-13,GLD,0.2966005853128983\n2015-01-13,IWM,0.06304398733044848\n2015-01-14,USO,0.5873635006180897\n2015-01-14,GLD,0.19451676316704644\n2015-01-14,TLT,0.2181197362148639\n2015-01-15,IWM,0.563722959965805\n2015-01-15,SPY,0.3327542780145993\n2015-01-15,TLT,0.10352276201959563\n"
  },
  {
    "path": "Tests/TestData/spx_lwma.csv",
    "content": "Date,Close,LWMA\n5/1/2023 00:00:00,4167.87,0\n5/2/2023 00:00:00,4119.58,0\n5/3/2023 00:00:00,4090.75,0\n5/4/2023 00:00:00,4061.22,0\n5/5/2023 00:00:00,4136.25,0\n5/8/2023 00:00:00,4138.12,4115.91\n5/9/2023 00:00:00,4119.17,4115.97\n5/10/2023 00:00:00,4137.64,4123.6242\n5/11/2023 00:00:00,4130.62,4128.4133\n5/12/2023 00:00:00,4124.08,4129.4352\n5/15/2023 00:00:00,4136.28,4130.95\n5/16/2023 00:00:00,4109.90,4124.9252\n5/17/2023 00:00:00,4158.77,4134.2076\n5/18/2023 00:00:00,4198.05,4152.8271\n5/19/2023 00:00:00,4191.98,4166.8357\n5/22/2023 00:00:00,4192.63,4178.1080\n5/23/2023 00:00:00,4145.58,4172.6733\n5/24/2023 00:00:00,4115.24,4158.1271\n5/25/2023 00:00:00,4151.28,4153.6238\n5/26/2023 00:00:00,4205.45,4164.9542\n5/30/2023 00:00:00,4205.52,4175.9523\n5/31/2023 00:00:00,4179.83,4178.9657"
  },
  {
    "path": "Tests/TestData/spy_10_min.txt",
    "content": "Date,Open,High,Low,Close,Volume \n3/3/2015 10:50:00 AM,211.03,211.16,211.01,211.105,2104200\n3/3/2015 11:00:00 AM,211.105,211.105,210.82,210.9,2143600\n3/3/2015 11:10:00 AM,210.89,210.91,210.72,210.835,3265200\n3/3/2015 11:20:00 AM,210.839,210.97,210.67,210.86,3390800\n3/3/2015 11:30:00 AM,210.86,210.94,210.69,210.77,2267300\n3/3/2015 11:40:00 AM,210.76,210.77,210.31,210.46,3677600\n3/3/2015 11:50:00 AM,210.45,210.46,210.19,210.3599,5640100\n3/3/2015 12:00:00 PM,210.35,210.59,210.3,210.5,1829900\n3/3/2015 12:10:00 PM,210.49,210.49,210.32,210.405,3182400\n3/3/2015 12:20:00 PM,210.405,210.47,210.375,210.4332,833700\n3/3/2015 12:30:00 PM,210.435,210.44,210.08,210.261,2668500\n3/3/2015 12:40:00 PM,210.27,210.51,210.23,210.47,1273200\n3/3/2015 12:50:00 PM,210.46,210.48,210.4,210.468,980400\n3/3/2015 1:00:00 PM,210.46,210.76,210.45,210.73,3072300\n3/3/2015 1:10:00 PM,210.74,210.9,210.73,210.79,2435000\n3/3/2015 1:20:00 PM,210.79,210.81,210.63,210.68,902100\n3/3/2015 1:30:00 PM,210.68,210.83,210.64,210.82,834600\n3/3/2015 1:40:00 PM,210.83,210.92,210.74,210.76,1712500\n3/3/2015 1:50:00 PM,210.76,210.815,210.67,210.81,1410500\n3/3/2015 2:00:00 PM,210.81,210.89,210.72,210.745,1079600\n3/3/2015 2:10:00 PM,210.7465,210.98,210.74,210.9768,1518100\n3/3/2015 2:20:00 PM,210.9768,211.1,210.97,211.1,1441600\n3/3/2015 2:30:00 PM,211.0999,211.21,211.03,211.1962,2578600\n3/3/2015 2:40:00 PM,211.1962,211.23,211.0201,211.05,1316600\n3/3/2015 2:50:00 PM,211.06,211.09,210.81,210.925,1837700\n3/3/2015 3:00:00 PM,210.93,211.07,210.89,211.005,1793600\n3/3/2015 3:10:00 PM,211,211.09,210.95,210.98,1554500\n3/3/2015 3:20:00 PM,210.98,211,210.82,210.91,1152500\n3/3/2015 3:30:00 PM,210.91,211.15,210.891,211.109,1875200\n3/3/2015 3:40:00 PM,211.1,211.21,211.04,211.0725,3044800\n3/3/2015 3:50:00 PM,211.0601,211.08,210.93,211.04,3821700\n3/3/2015 4:00:00 PM,211.045,211.16,211.01,211.12,8205100\n3/4/2015 9:40:00 AM,210.42,210.45,209.67,209.67,6362100\n3/4/2015 9:50:00 AM,209.68,209.76,209.43,209.57,6035200\n3/4/2015 10:00:00 AM,209.56,209.67,209.37,209.62,4741600\n3/4/2015 10:10:00 AM,209.62,209.74,209.35,209.42,6565800\n3/4/2015 10:20:00 AM,209.43,209.45,209.06,209.36,3634300\n3/4/2015 10:30:00 AM,209.35,209.44,209.26,209.37,2229600\n3/4/2015 10:40:00 AM,209.36,209.63,209.26,209.53,2894200\n3/4/2015 10:50:00 AM,209.52,209.73,209.33,209.4,2348400\n3/4/2015 11:00:00 AM,209.41,209.61,209.305,209.595,1756300\n3/4/2015 11:10:00 AM,209.59,209.83,209.55,209.82,2165400\n3/4/2015 11:20:00 AM,209.815,210.09,209.74,210.04,2795600\n3/4/2015 11:30:00 AM,210.04,210.06,209.92,209.96,1951000\n3/4/2015 11:40:00 AM,209.96,210.19,209.94,210.11,2713100\n3/4/2015 11:50:00 AM,210.11,210.18,210.06,210.08,1713900\n3/4/2015 12:00:00 PM,210.08,210.1,209.95,210.01,1231000\n3/4/2015 12:10:00 PM,210.02,210.11,209.94,210.09,990500\n3/4/2015 12:20:00 PM,210.09,210.37,210.071,210.295,2304000\n3/4/2015 12:30:00 PM,210.29,210.34,210.24,210.27,1314800\n3/4/2015 12:40:00 PM,210.27,210.38,210.24,210.31,931300\n3/4/2015 12:50:00 PM,210.31,210.49,210.3,210.41,1414600\n3/4/2015 1:00:00 PM,210.41,210.42,210.19,210.2,1040700\n3/4/2015 1:10:00 PM,210.21,210.24,210.15,210.19,949300\n3/4/2015 1:20:00 PM,210.19,210.27,210.12,210.2,711700\n3/4/2015 1:30:00 PM,210.2,210.4,210.17,210.29,669300\n3/4/2015 1:40:00 PM,210.28,210.35,210.23,210.265,1188900\n3/4/2015 1:50:00 PM,210.28,210.31,210.06,210.1,1614800\n3/4/2015 2:00:00 PM,210.11,210.17,209.86,209.92,1749700\n3/4/2015 2:10:00 PM,209.92,210.1,209.92,210.03,1723800\n3/4/2015 2:20:00 PM,210.03,210.07,209.78,209.86,2009100\n3/4/2015 2:30:00 PM,209.87,209.96,209.83,209.92,1113000\n3/4/2015 2:40:00 PM,209.92,210.02,209.86,209.91,1454500\n3/4/2015 2:50:00 PM,209.92,210.14,209.89,210.1,1284200\n3/4/2015 3:00:00 PM,210.1,210.26,210.09,210.23,2953500\n3/4/2015 3:10:00 PM,210.23,210.28,209.98,210.07,2262600\n3/4/2015 3:20:00 PM,210.08,210.29,210.06,210.16,2840800\n3/4/2015 3:30:00 PM,210.16,210.21,210.05,210.2,2299100\n3/4/2015 3:40:00 PM,210.2,210.35,210.18,210.285,3795000\n3/4/2015 3:50:00 PM,210.285,210.29,210.13,210.26,5769900\n3/4/2015 4:00:00 PM,210.26,210.27,210.14,210.23,8287900\n3/5/2015 9:40:00 AM,210.63,210.65,210.2,210.28,5286700\n3/5/2015 9:50:00 AM,210.28,210.51,210.12,210.51,2548900\n3/5/2015 10:00:00 AM,210.51,210.64,210.51,210.56,2278500\n3/5/2015 10:10:00 AM,210.56,210.72,210.44,210.67,2331600\n3/5/2015 10:20:00 AM,210.67,210.75,210.51,210.52,1973900\n3/5/2015 10:30:00 AM,210.52,210.74,210.52,210.73,1176100\n3/5/2015 10:40:00 AM,210.73,210.78,210.64,210.64,1361600\n3/5/2015 10:50:00 AM,210.645,210.75,210.64,210.74,1411200\n3/5/2015 11:00:00 AM,210.74,210.8,210.64,210.675,1624900\n3/5/2015 11:10:00 AM,210.68,210.685,210.35,210.375,1768000\n3/5/2015 11:20:00 AM,210.375,210.4,210.14,210.34,1933700\n3/5/2015 11:30:00 AM,210.35,210.4,210.28,210.39,1893200\n3/5/2015 11:40:00 AM,210.39,210.55,210.375,210.47,1379700\n3/5/2015 11:50:00 AM,210.475,210.6,210.47,210.545,1025200\n3/5/2015 12:00:00 PM,210.55,210.68,210.53,210.62,1195300\n3/5/2015 12:10:00 PM,210.62,210.63,210.5,210.55,807500\n3/5/2015 12:20:00 PM,210.55,210.6,210.39,210.4466,755500\n3/5/2015 12:30:00 PM,210.44,210.44,210.29,210.318,911700\n3/5/2015 12:40:00 PM,210.32,210.41,210.29,210.37,728700\n3/5/2015 12:50:00 PM,210.37,210.38,210.19,210.22,1314300\n3/5/2015 1:00:00 PM,210.22,210.22,209.85,209.955,4517800\n3/5/2015 1:10:00 PM,209.95,210.11,209.88,210.05,906800\n3/5/2015 1:20:00 PM,210.05,210.18,210.04,210.12,1025900\n3/5/2015 1:30:00 PM,210.13,210.29,209.97,210.21,1075100\n3/5/2015 1:40:00 PM,210.21,210.31,210.19,210.3,968300\n3/5/2015 1:50:00 PM,210.3,210.35,210.2,210.33,1037100\n3/5/2015 2:00:00 PM,210.3201,210.39,210.31,210.38,780900\n3/5/2015 2:10:00 PM,210.38,210.52,210.37,210.52,1358300\n3/5/2015 2:20:00 PM,210.51,210.53,210.45,210.4801,1022500\n3/5/2015 2:30:00 PM,210.4801,210.515,210.415,210.43,1741100\n3/5/2015 2:40:00 PM,210.439,210.47,210.34,210.37,930900\n3/5/2015 2:50:00 PM,210.37,210.45,210.33,210.34,1253000\n3/5/2015 3:00:00 PM,210.34,210.64,210.34,210.53,1829900\n3/5/2015 3:10:00 PM,210.53,210.55,210.28,210.34,2843300\n3/5/2015 3:20:00 PM,210.34,210.5,210.32,210.44,1233100\n3/5/2015 3:30:00 PM,210.44,210.56,210.44,210.555,1475700\n3/5/2015 3:40:00 PM,210.55,210.56,210.32,210.49,3904700\n3/5/2015 3:50:00 PM,210.48,210.62,210.45,210.48,3390400\n3/5/2015 4:00:00 PM,210.48,210.61,210.43,210.51,5450700\n3/6/2015 9:40:00 AM,209.38,209.66,209.27,209.54,1.30762E+07\n3/6/2015 9:50:00 AM,209.53,209.82,209.53,209.67,2417400\n3/6/2015 10:00:00 AM,209.68,209.93,209.46,209.8301,4453100\n3/6/2015 10:10:00 AM,209.8301,209.94,209.66,209.72,3079500\n3/6/2015 10:20:00 AM,209.73,209.92,209.52,209.68,3927100\n3/6/2015 10:30:00 AM,209.68,209.89,209.64,209.845,2812700\n3/6/2015 10:40:00 AM,209.85,209.9,209.66,209.73,2196800\n3/6/2015 10:50:00 AM,209.73,209.82,209.54,209.65,1475400\n3/6/2015 11:00:00 AM,209.65,209.65,209.26,209.365,2668400\n3/6/2015 11:10:00 AM,209.36,209.37,208.89,208.93,4209500\n3/6/2015 11:20:00 AM,208.93,208.94,208.605,208.71,5257000\n3/6/2015 11:30:00 AM,208.71,208.79,208.56,208.63,4260700\n3/6/2015 11:40:00 AM,208.64,208.65,208.35,208.49,4783400\n3/6/2015 11:50:00 AM,208.49,208.57,208.16,208.214,4415600\n3/6/2015 12:00:00 PM,208.22,208.48,208.17,208.45,3493600\n3/6/2015 12:10:00 PM,208.45,208.62,208.4,208.5501,2975900\n3/6/2015 12:20:00 PM,208.56,208.59,208.07,208.1,2353600\n3/6/2015 12:30:00 PM,208.1,208.12,207.84,208.04,3395700\n3/6/2015 12:40:00 PM,208.0305,208.27,207.9,208.26,2837200\n3/6/2015 12:50:00 PM,208.265,208.27,208.13,208.26,3818100\n3/6/2015 1:00:00 PM,208.2525,208.31,207.85,208.09,2698800\n3/6/2015 1:10:00 PM,208.085,208.21,207.85,207.98,3902000\n3/6/2015 1:20:00 PM,207.97,208.14,207.9,207.98,1826600\n3/6/2015 1:30:00 PM,207.99,208.05,207.71,207.99,2134600\n3/6/2015 1:40:00 PM,207.99,208,207.65,207.82,4325100\n3/6/2015 1:50:00 PM,207.82,207.855,207.5801,207.7899,3050800\n3/6/2015 2:00:00 PM,207.79,207.95,207.71,207.94,1497600\n3/6/2015 2:10:00 PM,207.9401,208.22,207.9,208.2,4099700\n3/6/2015 2:20:00 PM,208.194,208.225,208.02,208.0275,1811800\n3/6/2015 2:30:00 PM,208.04,208.04,207.58,207.71,4144600\n3/6/2015 2:40:00 PM,207.72,207.8,207.41,207.42,3373400\n3/6/2015 2:50:00 PM,207.42,207.5,207.3,207.5,3206600\n3/6/2015 3:00:00 PM,207.5,207.58,207.37,207.4,2707900\n3/6/2015 3:10:00 PM,207.4,207.92,207.375,207.77,4219200\n3/6/2015 3:20:00 PM,207.76,207.79,207.46,207.7,2756000\n3/6/2015 3:30:00 PM,207.7,207.82,207.42,207.46,4637000\n3/6/2015 3:40:00 PM,207.46,207.615,207.22,207.29,6291600\n3/6/2015 3:50:00 PM,207.295,207.36,207.1,207.24,8842400\n3/6/2015 4:00:00 PM,207.24,207.56,207.22,207.48,1.37102E+07\n3/9/2015 9:40:00 AM,207.76,207.98,207.65,207.88,7292900\n3/9/2015 9:50:00 AM,207.88,208.04,207.58,207.74,3721300\n3/9/2015 10:00:00 AM,207.7499,207.98,207.61,207.97,2870000\n3/9/2015 10:10:00 AM,207.96,208.18,207.85,208.08,2471900\n3/9/2015 10:20:00 AM,208.08,208.13,207.91,208.01,1986800\n3/9/2015 10:30:00 AM,208.03,208.15,207.79,207.93,1957500\n3/9/2015 10:40:00 AM,207.925,208.09,207.84,207.9301,1836600\n3/9/2015 10:50:00 AM,207.93,208.17,207.88,208.1668,1447200\n3/9/2015 11:00:00 AM,208.1668,208.25,208.03,208.07,2010300\n3/9/2015 11:10:00 AM,208.07,208.14,207.88,208.08,1441800\n3/9/2015 11:20:00 AM,208.08,208.22,208.01,208.12,1030300\n3/9/2015 11:30:00 AM,208.12,208.34,207.98,208.22,1979100\n3/9/2015 11:40:00 AM,208.21,208.29,208.17,208.17,2251400\n3/9/2015 11:50:00 AM,208.17,208.34,208.17,208.21,1549200\n3/9/2015 12:00:00 PM,208.22,208.24,208,208.07,1441700\n3/9/2015 12:10:00 PM,208.07,208.145,207.88,207.88,1448400\n3/9/2015 12:20:00 PM,207.88,208.025,207.86,207.93,2048000\n3/9/2015 12:30:00 PM,207.92,208.065,207.92,207.97,1070700\n3/9/2015 12:40:00 PM,207.97,208.14,207.92,208.09,1392500\n3/9/2015 12:50:00 PM,208.09,208.25,208.07,208.19,1525900\n3/9/2015 1:00:00 PM,208.2,208.32,208.19,208.2664,738200\n3/9/2015 1:10:00 PM,208.27,208.3,208.2,208.26,747400\n3/9/2015 1:20:00 PM,208.26,208.32,208.18,208.23,802400\n3/9/2015 1:30:00 PM,208.23,208.42,208.19,208.42,1126700\n3/9/2015 1:40:00 PM,208.41,208.5668,208.41,208.5354,1530600\n3/9/2015 1:50:00 PM,208.535,208.76,208.53,208.74,2063700\n3/9/2015 2:00:00 PM,208.749,208.79,208.6,208.62,980500\n3/9/2015 2:10:00 PM,208.62,208.65,208.539,208.57,1141200\n3/9/2015 2:20:00 PM,208.57,208.59,208.43,208.435,2136800\n3/9/2015 2:30:00 PM,208.4351,208.53,208.38,208.425,1016600\n3/9/2015 2:40:00 PM,208.42,208.43,208.25,208.295,1568300\n3/9/2015 2:50:00 PM,208.295,208.49,208.2,208.45,2117000\n3/9/2015 3:00:00 PM,208.45,208.65,208.44,208.58,2317500\n3/9/2015 3:10:00 PM,208.57,208.63,208.487,208.63,1612800\n3/9/2015 3:20:00 PM,208.63,208.695,208.5,208.5,1299100\n3/9/2015 3:30:00 PM,208.505,208.55,208.37,208.49,1984800\n3/9/2015 3:40:00 PM,208.485,208.68,208.45,208.49,2464700\n3/9/2015 3:50:00 PM,208.49,208.64,208.42,208.605,3005200\n3/9/2015 4:00:00 PM,208.605,208.65,208.32,208.36,7655500\n3/10/2015 9:40:00 AM,206.71,206.81,206.37,206.485,8650200\n3/10/2015 9:50:00 AM,206.47,206.69,206.1,206.215,4462700\n3/10/2015 10:00:00 AM,206.215,206.48,206.02,206.3201,3478400\n3/10/2015 10:10:00 AM,206.32,206.51,206.23,206.361,4537000\n3/10/2015 10:20:00 AM,206.37,206.37,205.85,206.05,4214200\n3/10/2015 10:30:00 AM,206.0465,206.16,205.79,206.07,3419000\n3/10/2015 10:40:00 AM,206.075,206.08,205.7,205.8,3540400\n3/10/2015 10:50:00 AM,205.76,205.98,205.73,205.95,3659200\n3/10/2015 11:00:00 AM,205.951,206.27,205.95,206.08,3317000\n3/10/2015 11:10:00 AM,206.08,206.43,206.06,206.385,2863000\n3/10/2015 11:20:00 AM,206.38,206.55,206.31,206.52,2775200\n3/10/2015 11:30:00 AM,206.52,206.66,206.37,206.41,2322700\n3/10/2015 11:40:00 AM,206.4,206.5,206.16,206.19,2121300\n3/10/2015 11:50:00 AM,206.19,206.23,205.84,205.86,4220200\n3/10/2015 12:00:00 PM,205.85,205.93,205.57,205.58,3932900\n3/10/2015 12:10:00 PM,205.58,205.61,205.38,205.61,4016200\n3/10/2015 12:20:00 PM,205.61,205.8,205.55,205.6799,3207900\n3/10/2015 12:30:00 PM,205.6769,205.68,205.33,205.42,2287600\n3/10/2015 12:40:00 PM,205.42,205.64,205.32,205.6399,3233300\n3/10/2015 12:50:00 PM,205.64,205.79,205.49,205.61,3868000\n3/10/2015 1:00:00 PM,205.6,205.77,205.5,205.56,2425800\n3/10/2015 1:10:00 PM,205.57,205.7399,205.51,205.54,1224300\n3/10/2015 1:20:00 PM,205.54,205.69,205.48,205.68,1642100\n3/10/2015 1:30:00 PM,205.68,205.98,205.68,205.77,2756900\n3/10/2015 1:40:00 PM,205.78,205.785,205.6001,205.6001,3447700\n3/10/2015 1:50:00 PM,205.6,205.81,205.55,205.735,2975400\n3/10/2015 2:00:00 PM,205.735,205.8,205.59,205.68,1325500\n3/10/2015 2:10:00 PM,205.68,205.89,205.62,205.89,1316200\n3/10/2015 2:20:00 PM,205.89,205.92,205.38,205.4,2665700\n3/10/2015 2:30:00 PM,205.4041,205.41,205.22,205.2801,3460400\n3/10/2015 2:40:00 PM,205.28,205.49,205.28,205.4,1670000\n3/10/2015 2:50:00 PM,205.4,205.575,205.27,205.41,2486800\n3/10/2015 3:00:00 PM,205.41,205.5,205.22,205.2601,3408000\n3/10/2015 3:10:00 PM,205.26,205.56,205.18,205.49,3890300\n3/10/2015 3:20:00 PM,205.49,205.68,205.33,205.625,3253400\n3/10/2015 3:30:00 PM,205.625,205.74,205.35,205.44,3488800\n3/10/2015 3:40:00 PM,205.44,205.46,205.24,205.39,4522600\n3/10/2015 3:50:00 PM,205.39,205.525,205.31,205.42,4846400\n3/10/2015 4:00:00 PM,205.41,205.411,204.94,205,1.31212E+07\n3/11/2015 9:40:00 AM,205.29,205.38,205.02,205.1,7219200\n3/11/2015 9:50:00 AM,205.11,205.46,205.01,205.275,3356600\n3/11/2015 10:00:00 AM,205.28,205.41,205.06,205.27,2925800\n3/11/2015 10:10:00 AM,205.26,205.5,205.18,205.45,2845800\n3/11/2015 10:20:00 AM,205.45,205.45,205.03,205.05,2956000\n3/11/2015 10:30:00 AM,205.05,205.24,205.01,205.239,2342700\n3/11/2015 10:40:00 AM,205.235,205.28,204.72,204.77,4503000\n3/11/2015 10:50:00 AM,204.77,204.8799,204.51,204.72,3488300\n3/11/2015 11:00:00 AM,204.71,204.92,204.59,204.8,2260100\n3/11/2015 11:10:00 AM,204.79,204.98,204.72,204.81,3455700\n3/11/2015 11:20:00 AM,204.815,205.13,204.815,205,2787600\n3/11/2015 11:30:00 AM,204.995,205.25,204.89,205.225,1480700\n3/11/2015 11:40:00 AM,205.22,205.335,205.13,205.14,2058600\n3/11/2015 11:50:00 AM,205.14,205.22,205.09,205.175,1439600\n3/11/2015 12:00:00 PM,205.18,205.25,205.04,205.1799,1594800\n3/11/2015 12:10:00 PM,205.18,205.27,204.97,205.05,1472400\n3/11/2015 12:20:00 PM,205.05,205.32,205.01,205.29,1126000\n3/11/2015 12:30:00 PM,205.29,205.3,204.89,205.03,1718400\n3/11/2015 12:40:00 PM,205.03,205.26,204.93,205.2599,1137800\n3/11/2015 12:50:00 PM,205.25,205.33,205.15,205.22,1388100\n3/11/2015 1:00:00 PM,205.225,205.37,205.15,205.2061,2015700\n3/11/2015 1:10:00 PM,205.2,205.235,205.1,205.23,1167700\n3/11/2015 1:20:00 PM,205.229,205.345,205.17,205.19,936000\n3/11/2015 1:30:00 PM,205.179,205.26,205.09,205.19,988800\n3/11/2015 1:40:00 PM,205.2,205.21,204.86,205.02,2738800\n3/11/2015 1:50:00 PM,205.01,205.02,204.52,204.54,2940100\n3/11/2015 2:00:00 PM,204.54,204.84,204.52,204.8,2283400\n3/11/2015 2:10:00 PM,204.805,205,204.74,204.994,1718800\n3/11/2015 2:20:00 PM,205,205.21,204.86,205.14,1733600\n3/11/2015 2:30:00 PM,205.14,205.19,205,205.06,2838400\n3/11/2015 2:40:00 PM,205.07,205.18,204.93,205.13,1668600\n3/11/2015 2:50:00 PM,205.14,205.15,204.86,205.08,1452800\n3/11/2015 3:00:00 PM,205.08,205.25,205.045,205.191,1413900\n3/11/2015 3:10:00 PM,205.19,205.2,204.955,204.965,2668700\n3/11/2015 3:20:00 PM,204.96,205.009,204.8,204.89,2199400\n3/11/2015 3:30:00 PM,204.89,204.9,204.58,204.6,2307700\n3/11/2015 3:40:00 PM,204.6,204.61,204.4,204.54,3389000\n3/11/2015 3:50:00 PM,204.54,204.68,204.42,204.5,4801100\n3/11/2015 4:00:00 PM,204.5,204.72,204.45,204.5,7807400\n3/12/2015 9:40:00 AM,205.24,205.92,205.2,205.8,8085900\n3/12/2015 9:50:00 AM,205.8,206.39,205.79,206.36,7408200\n3/12/2015 10:00:00 AM,206.37,206.43,206.17,206.17,4261900\n3/12/2015 10:10:00 AM,206.18,206.32,205.93,206.03,3980400\n3/12/2015 10:20:00 AM,206.02,206.2,205.93,205.99,2568700\n3/12/2015 10:30:00 AM,205.99,206.29,205.96,206.2,2317500\n3/12/2015 10:40:00 AM,206.2,206.35,206.145,206.27,1801700\n3/12/2015 10:50:00 AM,206.275,206.35,205.97,206.08,2051600\n3/12/2015 11:00:00 AM,206.08,206.37,206.08,206.26,1533100\n3/12/2015 11:10:00 AM,206.26,206.32,206.13,206.24,1490500\n3/12/2015 11:20:00 AM,206.24,206.62,206.22,206.59,2541200\n3/12/2015 11:30:00 AM,206.59,206.7,206.56,206.615,1910900\n3/12/2015 11:40:00 AM,206.62,206.69,206.51,206.55,1678900\n3/12/2015 11:50:00 AM,206.54,206.56,206.47,206.485,1058700\n3/12/2015 12:00:00 PM,206.489,206.58,206.43,206.46,1250200\n3/12/2015 12:10:00 PM,206.47,206.5,206.35,206.355,1185300\n3/12/2015 12:20:00 PM,206.3599,206.46,206.33,206.455,758800\n3/12/2015 12:30:00 PM,206.46,206.48,206.33,206.45,1454500\n3/12/2015 12:40:00 PM,206.45,206.51,206.34,206.38,691900\n3/12/2015 12:50:00 PM,206.37,206.37,206.21,206.3367,975800\n3/12/2015 1:00:00 PM,206.3367,206.4543,206.31,206.42,899100\n3/12/2015 1:10:00 PM,206.42,206.59,206.34,206.57,1187300\n3/12/2015 1:20:00 PM,206.57,206.62,206.49,206.5901,1000300\n3/12/2015 1:30:00 PM,206.59,206.595,206.46,206.49,713100\n3/12/2015 1:40:00 PM,206.485,206.55,206.34,206.46,1127400\n3/12/2015 1:50:00 PM,206.46,206.585,206.4,206.52,531600\n3/12/2015 2:00:00 PM,206.53,206.69,206.52,206.59,1107000\n3/12/2015 2:10:00 PM,206.59,206.6,206.44,206.555,1519800\n3/12/2015 2:20:00 PM,206.555,206.62,206.545,206.6,670700\n3/12/2015 2:30:00 PM,206.6,206.63,206.56,206.59,600200\n3/12/2015 2:40:00 PM,206.59,206.63,206.51,206.555,579200\n3/12/2015 2:50:00 PM,206.555,206.62,206.42,206.56,1301200\n3/12/2015 3:00:00 PM,206.56,206.88,206.56,206.84,2404400\n3/12/2015 3:10:00 PM,206.84,207.09,206.84,207.03,2955500\n3/12/2015 3:20:00 PM,207.03,207.11,206.96,206.99,2069200\n3/12/2015 3:30:00 PM,206.99,207.06,206.965,207.04,1711500\n3/12/2015 3:40:00 PM,207.04,207.11,206.92,207.06,2347700\n3/12/2015 3:50:00 PM,207.06,207.17,207,207.15,3990000\n3/12/2015 4:00:00 PM,207.15,207.175,207.07,207.13,8936100\n3/13/2015 9:40:00 AM,206.76,206.8,206.22,206.5849,8317200\n3/13/2015 9:50:00 AM,206.59,206.93,206.43,206.86,3154700\n3/13/2015 10:00:00 AM,206.86,206.93,206.47,206.48,2770200\n3/13/2015 10:10:00 AM,206.48,206.59,205.91,205.97,5174700\n3/13/2015 10:20:00 AM,205.98,206.37,205.87,206.29,3734400\n3/13/2015 10:30:00 AM,206.28,206.38,205.83,205.9,3654700\n3/13/2015 10:40:00 AM,205.9,206.15,205.77,206.1,2535200\n3/13/2015 10:50:00 AM,206.1,206.23,205.76,205.815,2683300\n3/13/2015 11:00:00 AM,205.8131,205.82,205.12,205.123,4440700\n3/13/2015 11:10:00 AM,205.13,205.34,205.03,205.335,4271300\n3/13/2015 11:20:00 AM,205.33,206.1649,205.23,205.24,3430400\n3/13/2015 11:30:00 AM,205.24,205.28,204.84,204.8731,3527300\n3/13/2015 11:40:00 AM,204.875,204.98,204.66,204.96,7902100\n3/13/2015 11:50:00 AM,204.95,205,204.58,204.77,4923400\n3/13/2015 12:00:00 PM,204.768,205.12,204.71,205.07,3225300\n3/13/2015 12:10:00 PM,205.08,205.1,204.73,205.075,2808900\n3/13/2015 12:20:00 PM,205.07,205.17,204.78,204.92,2358700\n3/13/2015 12:30:00 PM,204.91,205.2,204.91,205.12,2667800\n3/13/2015 12:40:00 PM,205.125,205.5,205.105,205.3501,2640900\n3/13/2015 12:50:00 PM,205.35,205.5,205.23,205.35,2917300\n3/13/2015 1:00:00 PM,205.35,205.44,205.17,205.37,2450800\n3/13/2015 1:10:00 PM,205.37,205.4,205.14,205.25,1955700\n3/13/2015 1:20:00 PM,205.25,205.277,205.03,205.12,3681500\n3/13/2015 1:30:00 PM,205.12,205.14,204.77,204.77,2550700\n3/13/2015 1:40:00 PM,204.78,205.005,204.76,205,3691200\n3/13/2015 1:50:00 PM,205,205.145,204.99,205.07,2484200\n3/13/2015 2:00:00 PM,205.06,205.23,205.02,205.07,2551600\n3/13/2015 2:10:00 PM,205.06,205.11,204.9,204.9196,1795700\n3/13/2015 2:20:00 PM,204.9196,205.07,204.79,204.99,2399100\n3/13/2015 2:30:00 PM,204.99,205.11,204.84,205.1,1171900\n3/13/2015 2:40:00 PM,205.1,205.14,204.86,204.88,1711600\n3/13/2015 2:50:00 PM,204.87,204.96,204.64,204.82,4558000\n3/13/2015 3:00:00 PM,204.82,205.08,204.72,205.07,2771500\n3/13/2015 3:10:00 PM,205.07,205.17,204.93,204.97,2652600\n3/13/2015 3:20:00 PM,204.97,205.33,204.97,205.18,3471600\n3/13/2015 3:30:00 PM,205.19,205.49,205.1,205.48,3591200\n3/13/2015 3:40:00 PM,205.48,205.54,205.25,205.48,4675400\n3/13/2015 3:50:00 PM,205.49,205.85,205.485,205.66,6461900\n3/13/2015 4:00:00 PM,205.66,206.13,205.66,205.84,1.15006E+07\n3/16/2015 9:40:00 AM,206.68,207.24,206.68,207.02,7639700\n3/16/2015 9:50:00 AM,207.02,207.34,206.95,207.25,4162100\n3/16/2015 10:00:00 AM,207.25,207.72,207.25,207.6,4899700\n3/16/2015 10:10:00 AM,207.6,207.83,207.6,207.729,3436600\n3/16/2015 10:20:00 AM,207.729,207.91,207.69,207.85,2793300\n3/16/2015 10:30:00 AM,207.85,207.945,207.67,207.685,4402300\n3/16/2015 10:40:00 AM,207.69,207.745,207.58,207.586,2327600\n3/16/2015 10:50:00 AM,207.58,207.71,207.56,207.636,4095000\n3/16/2015 11:00:00 AM,207.636,207.81,207.63,207.77,2890700\n3/16/2015 11:10:00 AM,207.77,207.94,207.735,207.85,3897300\n3/16/2015 11:20:00 AM,207.86,208,207.85,207.88,3178500\n3/16/2015 11:30:00 AM,207.88,208.15,207.88,207.94,2550300\n3/16/2015 11:40:00 AM,207.94,208.07,207.91,207.93,3032900\n3/16/2015 11:50:00 AM,207.935,208.08,207.91,208.05,1529100\n3/16/2015 12:00:00 PM,208.05,208.219,208.04,208.08,2112400\n3/16/2015 12:10:00 PM,208.075,208.11,207.97,208,2636000\n3/16/2015 12:20:00 PM,208.01,208.03,207.87,207.87,2086600\n3/16/2015 12:30:00 PM,207.8644,207.93,207.76,207.87,1164100\n3/16/2015 12:40:00 PM,207.87,207.97,207.82,207.93,2007400\n3/16/2015 12:50:00 PM,207.93,207.99,207.82,207.86,3031200\n3/16/2015 1:00:00 PM,207.86,208.06,207.86,207.94,1002500\n3/16/2015 1:10:00 PM,207.94,207.95,207.67,207.78,2563500\n3/16/2015 1:20:00 PM,207.78,207.92,207.715,207.8649,2100300\n3/16/2015 1:30:00 PM,207.8601,207.97,207.855,207.92,769800\n3/16/2015 1:40:00 PM,207.92,208.02,207.87,208.02,1610300\n3/16/2015 1:50:00 PM,208.02,208.16,207.99,208.1,2700300\n3/16/2015 2:00:00 PM,208.11,208.15,208.035,208.055,781000\n3/16/2015 2:10:00 PM,208.055,208.1,208.005,208.09,1757100\n3/16/2015 2:20:00 PM,208.09,208.12,207.94,208.12,2097900\n3/16/2015 2:30:00 PM,208.12,208.29,208.1199,208.26,4090900\n3/16/2015 2:40:00 PM,208.26,208.36,208.2,208.22,2373000\n3/16/2015 2:50:00 PM,208.215,208.52,208.215,208.385,4765700\n3/16/2015 3:00:00 PM,208.38,208.51,208.35,208.47,2503000\n3/16/2015 3:10:00 PM,208.47,208.64,208.47,208.515,3603900\n3/16/2015 3:20:00 PM,208.52,208.58,208.465,208.495,1801600\n3/16/2015 3:30:00 PM,208.495,208.5,208.34,208.47,3071900\n3/16/2015 3:40:00 PM,208.47,208.6,208.37,208.4001,3518800\n3/16/2015 3:50:00 PM,208.41,208.58,208.39,208.51,4877600\n3/16/2015 4:00:00 PM,208.51,208.69,208.4,208.64,1.07936E+07\n3/17/2015 9:40:00 AM,207.65,208.05,207.51,207.89,7560000\n3/17/2015 9:50:00 AM,207.89,207.93,207.37,207.4,4162500\n3/17/2015 10:00:00 AM,207.4,207.61,207.25,207.57,3120700\n3/17/2015 10:10:00 AM,207.575,207.65,207.44,207.54,2495600\n3/17/2015 10:20:00 AM,207.54,207.75,207.435,207.66,2740500\n3/17/2015 10:30:00 AM,207.66,207.74,207.54,207.72,2091900\n3/17/2015 10:40:00 AM,207.72,207.86,207.54,207.74,2169300\n3/17/2015 10:50:00 AM,207.74,207.76,207.58,207.69,1261900\n3/17/2015 11:00:00 AM,207.691,207.8,207.55,207.65,1722600\n3/17/2015 11:10:00 AM,207.65,207.65,207.2,207.39,3150300\n3/17/2015 11:20:00 AM,207.38,207.42,207.03,207.05,3465700\n3/17/2015 11:30:00 AM,207.06,207.31,206.98,207.29,1849800\n3/17/2015 11:40:00 AM,207.3,207.367,207.19,207.21,1516600\n3/17/2015 11:50:00 AM,207.2051,207.34,207.13,207.25,2937500\n3/17/2015 12:00:00 PM,207.245,207.49,207.16,207.47,2421500\n3/17/2015 12:10:00 PM,207.47,207.49,207.23,207.3,1007500\n3/17/2015 12:20:00 PM,207.3,207.34,207.14,207.305,1215800\n3/17/2015 12:30:00 PM,207.305,207.57,207.3,207.495,2334400\n3/17/2015 12:40:00 PM,207.5,207.64,207.38,207.625,1564900\n3/17/2015 12:50:00 PM,207.625,207.76,207.58,207.66,2246300\n3/17/2015 1:00:00 PM,207.67,207.86,207.66,207.85,1341300\n3/17/2015 1:10:00 PM,207.85,207.94,207.72,207.91,1370800\n3/17/2015 1:20:00 PM,207.9,208.05,207.8632,207.94,1754500\n3/17/2015 1:30:00 PM,207.94,207.96,207.87,207.905,829300\n3/17/2015 1:40:00 PM,207.905,207.985,207.79,207.83,1055900\n3/17/2015 1:50:00 PM,207.83,207.9,207.78,207.84,873200\n3/17/2015 2:00:00 PM,207.84,208.15,207.83,208.1,1976200\n3/17/2015 2:10:00 PM,208.1,208.25,207.99,208.02,1694900\n3/17/2015 2:20:00 PM,208.025,208.09,207.86,207.97,1193600\n3/17/2015 2:30:00 PM,207.97,207.99,207.79,207.845,1142400\n3/17/2015 2:40:00 PM,207.84,207.89,207.7,207.82,1071400\n3/17/2015 2:50:00 PM,207.82,207.9,207.77,207.8001,730800\n3/17/2015 3:00:00 PM,207.8001,208.03,207.69,207.99,1845900\n3/17/2015 3:10:00 PM,207.99,208.16,207.97,208.159,1469300\n3/17/2015 3:20:00 PM,208.159,208.32,208.139,208.285,3156500\n3/17/2015 3:30:00 PM,208.285,208.34,208.22,208.29,1588000\n3/17/2015 3:40:00 PM,208.29,208.42,208.24,208.26,2739700\n3/17/2015 3:50:00 PM,208.26,208.26,208.06,208.2275,2856000\n3/17/2015 4:00:00 PM,208.2275,208.235,207.89,207.97,7656700\n3/18/2015 9:40:00 AM,207.43,207.44,207.15,207.37,5726600\n3/18/2015 9:50:00 AM,207.38,207.38,207.05,207.14,2731400\n3/18/2015 10:00:00 AM,207.13,207.27,206.95,207.135,2791900\n3/18/2015 10:10:00 AM,207.135,207.42,207.11,207.4,2248200\n3/18/2015 10:20:00 AM,207.39,207.47,207.34,207.45,2078400\n3/18/2015 10:30:00 AM,207.45,207.57,207.39,207.47,1865300\n3/18/2015 10:40:00 AM,207.47,207.51,207.22,207.36,2173500\n3/18/2015 10:50:00 AM,207.35,207.54,207.27,207.48,1604400\n3/18/2015 11:00:00 AM,207.47,207.53,207.39,207.51,1139600\n3/18/2015 11:10:00 AM,207.51,207.58,207.41,207.52,1356800\n3/18/2015 11:20:00 AM,207.5299,207.549,207.31,207.32,1654800\n3/18/2015 11:30:00 AM,207.33,207.35,207.14,207.17,1474200\n3/18/2015 11:40:00 AM,207.165,207.25,207.13,207.2469,1314700\n3/18/2015 11:50:00 AM,207.24,207.39,207.17,207.2,1793400\n3/18/2015 12:00:00 PM,207.2,207.33,207.12,207.27,1172200\n3/18/2015 12:10:00 PM,207.27,207.32,207.14,207.249,1353700\n3/18/2015 12:20:00 PM,207.25,207.25,207.1,207.105,1914300\n3/18/2015 12:30:00 PM,207.11,207.17,206.95,207.12,1549000\n3/18/2015 12:40:00 PM,207.12,207.34,207.09,207.31,1013500\n3/18/2015 12:50:00 PM,207.31,207.34,207.13,207.15,1730800\n3/18/2015 1:00:00 PM,207.15,207.19,207.01,207.04,3541400\n3/18/2015 1:10:00 PM,207.03,207.13,206.86,206.985,2533700\n3/18/2015 1:20:00 PM,206.99,207.105,206.92,207.05,1774100\n3/18/2015 1:30:00 PM,207.05,207.13,206.93,206.97,3175500\n3/18/2015 1:40:00 PM,206.98,207.01,206.64,206.69,2409700\n3/18/2015 1:50:00 PM,206.69,206.8,206.62,206.79,2540100\n3/18/2015 2:00:00 PM,206.8,207.34,206.78,207.29,4731400\n3/18/2015 2:10:00 PM,207.3,209.59,207.24,209.14,2.12449E+07\n3/18/2015 2:20:00 PM,209.14,210.06,209.11,209.855,1.61413E+07\n3/18/2015 2:30:00 PM,209.85,209.9151,209.44,209.73,9714500\n3/18/2015 2:40:00 PM,209.73,210.34,209.65,210.08,1.15984E+07\n3/18/2015 2:50:00 PM,210.08,210.37,209.78,209.96,9499800\n3/18/2015 3:00:00 PM,209.96,210.24,209.82,210.11,8451400\n3/18/2015 3:10:00 PM,210.1,210.8,209.99,210.71,1.13467E+07\n3/18/2015 3:20:00 PM,210.71,211.27,210.67,211.14,1.06716E+07\n3/18/2015 3:30:00 PM,211.15,211.17,210.67,210.685,9320100\n3/18/2015 3:40:00 PM,210.68,210.81,210.405,210.495,8963500\n3/18/2015 3:50:00 PM,210.49,210.515,210.22,210.22,1.36767E+07\n3/18/2015 4:00:00 PM,210.22,210.5,210.16,210.42,1.32145E+07\n3/19/2015 9:40:00 AM,210.04,210.055,209.71,209.9,7500300\n3/19/2015 9:50:00 AM,209.9,209.94,209.49,209.57,3132200\n3/19/2015 10:00:00 AM,209.565,210.1,209.53,210.02,3308500\n3/19/2015 10:10:00 AM,209.99,210.02,209.86,209.93,3468300\n3/19/2015 10:20:00 AM,209.925,210.27,209.81,210.18,3262800\n3/19/2015 10:30:00 AM,210.179,210.29,209.98,210.05,3536300\n3/19/2015 10:40:00 AM,210.05,210.05,209.77,209.84,1461700\n3/19/2015 10:50:00 AM,209.84,209.92,209.53,209.54,2002300\n3/19/2015 11:00:00 AM,209.53,209.72,209.475,209.72,4174900\n3/19/2015 11:10:00 AM,209.711,209.74,209.55,209.59,1587800\n3/19/2015 11:20:00 AM,209.58,209.81,209.5,209.78,1589900\n3/19/2015 11:30:00 AM,209.78,209.87,209.62,209.66,1414900\n3/19/2015 11:40:00 AM,209.66,209.69,209.26,209.35,3919200\n3/19/2015 11:50:00 AM,209.341,209.385,209.12,209.215,2419400\n3/19/2015 12:00:00 PM,209.2199,209.36,209.03,209.35,2395700\n3/19/2015 12:10:00 PM,209.34,209.46,209.22,209.41,1764800\n3/19/2015 12:20:00 PM,209.41,209.41,209.21,209.32,1709900\n3/19/2015 12:30:00 PM,209.32,209.46,209.21,209.425,1380800\n3/19/2015 12:40:00 PM,209.43,209.45,209.09,209.15,2097600\n3/19/2015 12:50:00 PM,209.14,209.37,209.11,209.3,1860100\n3/19/2015 1:00:00 PM,209.3,209.3,209.07,209.1728,5731300\n3/19/2015 1:10:00 PM,209.1728,209.31,209.07,209.28,1937600\n3/19/2015 1:20:00 PM,209.28,209.56,209.26,209.56,1513300\n3/19/2015 1:30:00 PM,209.56,209.76,209.55,209.7,2251900\n3/19/2015 1:40:00 PM,209.7,209.72,209.525,209.53,1086500\n3/19/2015 1:50:00 PM,209.53,209.58,209.44,209.504,719200\n3/19/2015 2:00:00 PM,209.504,209.54,209.3105,209.36,2016800\n3/19/2015 2:10:00 PM,209.35,209.65,209.32,209.65,2099300\n3/19/2015 2:20:00 PM,209.65,209.81,209.42,209.5,2319600\n3/19/2015 2:30:00 PM,209.5,209.53,209.34,209.5013,1608600\n3/19/2015 2:40:00 PM,209.5013,209.63,209.36,209.545,1508300\n3/19/2015 2:50:00 PM,209.545,209.68,209.51,209.605,2342400\n3/19/2015 3:00:00 PM,209.605,209.74,209.46,209.68,1914200\n3/19/2015 3:10:00 PM,209.68,209.85,209.59,209.6335,2944000\n3/19/2015 3:20:00 PM,209.6335,209.69,209.53,209.56,2133800\n3/19/2015 3:30:00 PM,209.56,209.6,209.31,209.57,4570200\n3/19/2015 3:40:00 PM,209.57,209.77,209.45,209.71,3584100\n3/19/2015 3:50:00 PM,209.71,209.73,209.4,209.55,3245200\n3/19/2015 4:00:00 PM,209.55,209.61,209.45,209.5,7943500"
  },
  {
    "path": "Tests/TestData/spy_acceleration_bands_20_4.txt",
    "content": "Date,Open,High,Low,Close,MiddleBand,UpperBand,LowerBand\n9/3/2015 12:00:00 AM,196.25,198.05,194.96,195.55,,,\n9/4/2015 12:00:00 AM,192.88,193.86,191.61,192.59,,,\n9/8/2015 12:00:00 AM,195.97,197.61,195.17,197.43,,,\n9/9/2015 12:00:00 AM,199.32,199.47,194.35,194.79,,,\n9/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,,,\n9/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,,,\n9/14/2015 12:00:00 AM,196.95,197.01,195.43,196.01,,,\n9/15/2015 12:00:00 AM,196.59,198.99,195.96,198.46,,,\n9/16/2015 12:00:00 AM,198.82,200.41,198.41,200.18,,,\n9/17/2015 12:00:00 AM,199.96,202.89,199.28,199.73,,,\n9/18/2015 12:00:00 AM,195.74,198.68,194.96,195.45,,,\n9/21/2015 12:00:00 AM,196.45,197.68,195.21,196.46,,,\n9/22/2015 12:00:00 AM,193.9,194.46,192.56,193.91,,,\n9/23/2015 12:00:00 AM,194.13,194.67,192.91,193.6,,,\n9/24/2015 12:00:00 AM,192.13,193.45,190.56,192.9,,,\n9/25/2015 12:00:00 AM,194.61,195,191.81,192.85,,,\n9/28/2015 12:00:00 AM,191.75,191.91,187.64,188.01,,,\n9/29/2015 12:00:00 AM,188.24,189.74,186.93,188.12,,,\n9/30/2015 12:00:00 AM,190.4,191.83,189.44,191.63,,,\n10/1/2015 12:00:00 AM,192.03,192.49,189.82,192.13,194.6195,201.8016,187.6891\n10/2/2015 12:00:00 AM,189.75,195.03,189.12,195,194.592,201.9392,187.1217\n10/5/2015 12:00:00 AM,196.47,198.74,196.33,198.47,194.886,202.1994,187.3419\n10/6/2015 12:00:00 AM,198.27,198.98,197,197.79,194.904,202.2214,187.4789\n10/7/2015 12:00:00 AM,198.85,199.83,197.48,199.41,195.135,201.9571,187.9071\n10/8/2015 12:00:00 AM,198.96,201.55,198.59,201.21,195.403,202.1725,188.125\n10/9/2015 12:00:00 AM,201.4,201.9,200.58,201.33,195.6325,202.3286,188.5236\n10/12/2015 12:00:00 AM,201.43,201.76,200.91,201.52,195.908,202.4927,188.8702\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,200.25,195.9975,202.558,189.1655\n10/14/2015 12:00:00 AM,200.16,200.87,198.94,199.29,195.953,202.5739,189.1989\n10/15/2015 12:00:00 AM,200.05,202.36,199.64,202.35,196.084,202.457,189.3045\n10/16/2015 12:00:00 AM,202.82,203.29,201.92,203.27,196.475,202.4494,189.8844\n10/19/2015 12:00:00 AM,202.53,203.37,202.13,203.37,196.8205,202.6098,190.3523\n10/20/2015 12:00:00 AM,202.86,203.84,202.55,203.11,197.2805,203.0172,190.9122\n10/21/2015 12:00:00 AM,203.64,203.79,201.65,201.85,197.693,203.5116,191.3116\n10/22/2015 12:00:00 AM,203,205.51,201.85,205.26,198.311,204.1927,191.8002\n10/23/2015 12:00:00 AM,207.24,207.95,206.3,207.51,199.044,204.6842,192.6767\n10/26/2015 12:00:00 AM,207.27,207.37,206.56,207,199.9935,205.1066,193.9641\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.6,200.9175,205.8078,195.0653\n10/28/2015 12:00:00 AM,207,208.98,206.21,208.95,201.7835,206.7037,195.8662\n10/29/2015 12:00:00 AM,208.36,209.27,208.21,208.83,202.6185,207.3801,196.9451\n10/30/2015 12:00:00 AM,209.07,209.44,207.74,207.93,203.265,207.6712,198.2887\n11/2/2015 12:00:00 AM,208.36,210.62,208.17,210.39,203.861,208.2691,198.8766\n11/3/2015 12:00:00 AM,209.98,211.66,209.7,211,204.5215,208.9011,199.5136\n11/4/2015 12:00:00 AM,211.37,211.5,209.72,210.36,205.069,209.4269,200.1819\n11/5/2015 12:00:00 AM,210.44,210.98,209.09,210.15,205.516,209.7901,200.8126\n11/6/2015 12:00:00 AM,209.74,210.32,208.46,210.04,205.9515,210.2655,201.153\n11/9/2015 12:00:00 AM,209.33,209.49,206.95,208.08,206.2795,210.8223,201.2874\n11/10/2015 12:00:00 AM,207.54,208.6,207.19,208.56,206.695,211.0737,201.7137\n11/11/2015 12:00:00 AM,208.9,208.94,207.66,207.74,207.1175,211.4117,202.2142\n11/12/2015 12:00:00 AM,206.51,207.06,204.82,204.84,207.242,211.5981,202.5206\n11/13/2015 12:00:00 AM,204.36,204.67,202.44,202.54,207.2055,211.7538,202.4613\n11/16/2015 12:00:00 AM,202.3,205.69,202.18,205.62,207.318,212.0995,202.2395\n11/17/2015 12:00:00 AM,205.97,207.04,204.88,205.47,207.436,212.3472,202.2697\n11/18/2015 12:00:00 AM,206.03,208.9,205.99,208.73,207.78,212.6806,202.4106\n11/19/2015 12:00:00 AM,208.55,209.05,208.2,208.55,207.9445,212.5735,203.006\n11/20/2015 12:00:00 AM,209.47,210.12,208.86,209.31,208.0345,212.6427,203.1727\n11/23/2015 12:00:00 AM,209.4,209.98,208.52,209.07,208.138,212.8385,203.2061\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,209.35,208.2755,213.1021,203.1671\n11/25/2015 12:00:00 AM,209.48,209.74,209.01,209.32,208.294,212.9344,203.5094\n11/27/2015 12:00:00 AM,209.4,209.8,208.86,209.56,208.3305,212.9488,203.5538\n11/30/2015 12:00:00 AM,209.79,209.89,208.56,208.69,208.3685,212.9341,203.6316\n12/1/2015 12:00:00 AM,209.42,210.82,209.11,210.68,208.383,212.8693,203.7518\n12/2/2015 12:00:00 AM,210.6,211,208.23,208.53,208.2595,212.9182,203.5982\n12/3/2015 12:00:00 AM,208.9,209.15,204.75,205.61,208.022,213.0667,203.0917\n12/4/2015 12:00:00 AM,206.1,209.97,205.93,209.62,207.9955,213.2342,202.7217\n12/7/2015 12:00:00 AM,209.2,209.73,207.2,208.35,207.911,213.2724,202.5925\n12/8/2015 12:00:00 AM,206.48,208.29,205.78,206.95,207.8545,213.2094,202.5369\n12/9/2015 12:00:00 AM,206.2,208.68,204.18,205.34,207.6935,213.5268,202.0818\n12/10/2015 12:00:00 AM,205.44,207.43,205.14,205.87,207.6,213.5532,201.8557\n12/11/2015 12:00:00 AM,203.38,204.14,201.51,201.88,207.452,213.4467,201.6517\n12/14/2015 12:00:00 AM,202.1,203.05,199.95,202.9,207.47,213.4539,201.4414\n12/15/2015 12:00:00 AM,204.69,206.11,202.87,205.03,207.4405,213.4474,201.5024\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,208.03,207.5685,213.6599,201.3574\n12/17/2015 12:00:00 AM,208.37,208.48,204.84,204.86,207.375,213.7131,201.2281\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,200.02,206.9485,213.6343,200.5868\n12/21/2015 12:00:00 AM,201.43,201.88,200.09,201.67,206.5665,213.2757,200.0957\n12/22/2015 12:00:00 AM,202.7,203.85,201.55,203.5,206.288,213.054,199.664\n12/23/2015 12:00:00 AM,204.7,206.07,204.58,206.02,206.1215,212.7721,199.6146\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.68,205.9395,212.6197,199.4172\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,205.21,205.722,212.4309,199.1334\n12/29/2015 12:00:00 AM,206.53,207.79,206.47,207.4,205.6575,212.3249,199.0299\n12/30/2015 12:00:00 AM,207.09,207.21,205.76,205.93,205.42,212.1182,198.8882\n12/31/2015 12:00:00 AM,205.17,205.89,203.87,203.87,205.187,211.7869,198.7444\n1/4/2016 12:00:00 AM,200.53,201.03,198.59,201.02,204.9575,211.1817,198.6292\n1/5/2016 12:00:00 AM,201.39,201.9,200.05,201.36,204.5445,210.5561,198.5511\n1/6/2016 12:00:00 AM,198.33,200.06,197.6,198.82,204.068,210.0656,198.0781\n1/7/2016 12:00:00 AM,195.32,197.44,193.59,194.05,203.423,209.6594,197.3369\n1/8/2016 12:00:00 AM,195.21,195.85,191.58,191.92,202.752,208.9947,196.7297\n1/11/2016 12:00:00 AM,193.05,193.41,189.82,192.11,202.064,208.4258,195.8358\n1/12/2016 12:00:00 AM,193.85,194.55,191.14,193.66,201.653,208.0256,195.2406\n1/13/2016 12:00:00 AM,194.53,194.86,188.38,188.83,200.9495,207.9627,194.3327\n1/14/2016 12:00:00 AM,189.55,193.26,187.66,191.93,200.2945,207.5618,193.3418\n1/15/2016 12:00:00 AM,186.79,188.76,185.52,187.81,199.2835,206.545,192.4125\n1/19/2016 12:00:00 AM,189.95,190.11,186.2,188.06,198.4435,205.6544,191.4544\n1/20/2016 12:00:00 AM,185,187.5,181.02,185.65,197.725,205.2299,190.1849\n1/21/2016 12:00:00 AM,186.19,188.87,184.64,186.69,196.976,204.8274,189.1724\n1/22/2016 12:00:00 AM,189.78,190.76,188.88,190.52,196.327,204.1305,188.5805\n1/25/2016 12:00:00 AM,189.91,190.15,187.41,187.64,195.408,203.461,187.5984\n1/26/2016 12:00:00 AM,188.44,190.53,188.02,190.2,194.634,202.8324,186.5699\n1/27/2016 12:00:00 AM,189.58,191.56,187.06,188.13,193.78,202.4703,185.4128\n1/28/2016 12:00:00 AM,190,190.2,187.16,189.11,192.8655,201.7649,184.2774\n1/29/2016 12:00:00 AM,190.03,193.88,189.88,193.72,192.255,201.357,183.232\n2/1/2016 12:00:00 AM,192.5,194.58,191.84,193.65,191.744,200.8645,182.5595\n2/2/2016 12:00:00 AM,191.9,191.97,189.54,190.16,191.201,200.4105,182.108\n2/3/2016 12:00:00 AM,191.37,191.78,187.1,191.3,190.698,200.1925,181.1825\n2/4/2016 12:00:00 AM,190.72,192.75,189.96,191.6,190.337,199.8605,180.768\n2/5/2016 12:00:00 AM,190.97,191.67,187.2,187.95,190.032,199.6355,180.388\n2/8/2016 12:00:00 AM,185.75,186.12,182.8,185.42,189.707,199.0522,180.0422\n2/9/2016 12:00:00 AM,183.38,186.94,183.2,185.43,189.373,198.7441,179.6967\n2/10/2016 12:00:00 AM,186.44,188.34,185.12,185.27,188.9535,198.4144,179.4144\n2/11/2016 12:00:00 AM,182.38,184.1,181.09,182.86,188.655,197.5209,179.3884\n2/12/2016 12:00:00 AM,184.93,186.65,183.96,186.63,188.39,196.8932,179.4882\n2/16/2016 12:00:00 AM,188.78,189.81,187.63,189.78,188.4885,196.8381,179.6981\n2/17/2016 12:00:00 AM,191.12,193.32,191.01,192.88,188.7295,196.8359,180.0959\n2/18/2016 12:00:00 AM,193.22,193.27,191.72,192.09,189.0515,196.6207,181.1132\n2/19/2016 12:00:00 AM,191.15,192.18,190.45,192,189.317,196.5322,181.6497\n2/22/2016 12:00:00 AM,193.9,194.95,193.79,194.78,189.53,196.6691,181.9666\n2/23/2016 12:00:00 AM,193.99,194.32,192.18,192.32,189.764,196.8168,182.2643\n2/24/2016 12:00:00 AM,190.62,193.53,189.32,193.2,189.914,197.1397,182.1622\n2/25/2016 12:00:00 AM,193.73,195.55,192.83,195.54,190.2845,197.1578,182.6253\n2/26/2016 12:00:00 AM,196.52,196.68,194.9,195.09,190.5835,197.3542,183.1367\n2/29/2016 12:00:00 AM,195.08,196.23,193.33,193.56,190.5755,197.3596,183.4171\n3/1/2016 12:00:00 AM,195.05,198.21,194.45,198.11,190.7985,197.6448,183.4473\n3/2/2016 12:00:00 AM,197.7,199.06,197.25,199,191.2405,197.9366,183.8941\n3/3/2016 12:00:00 AM,198.7,199.8,198.11,199.78,191.6645,198.0335,184.7385\n3/4/2016 12:00:00 AM,200,201.35,199.03,200.43,192.106,198.4158,185.2383\n3/7/2016 12:00:00 AM,199.34,201.07,199.25,200.59,192.738,198.6164,186.1014\n3/8/2016 12:00:00 AM,199.3,199.92,198.21,198.4,193.387,199.1431,187.0306\n3/9/2016 12:00:00 AM,199.36,199.79,198.43,199.38,194.0845,199.5443,188.0268\n3/10/2016 12:00:00 AM,199.9,201.07,197.38,199.54,194.798,200.2285,188.5935\n3/11/2016 12:00:00 AM,201.25,202.81,199.52,202.76,195.793,201.1922,189.4872\n3/14/2016 12:00:00 AM,202.2,203.04,201.77,202.5,196.5865,201.8681,190.5181\n3/15/2016 12:00:00 AM,201.32,202.53,201.05,202.17,197.206,202.4334,191.2584\n3/16/2016 12:00:00 AM,201.62,203.82,201.55,203.34,197.729,202.9543,191.7893\n3/17/2016 12:00:00 AM,203.26,205.23,202.77,204.63,198.356,203.6441,192.2516\n3/18/2016 12:00:00 AM,204.2,204.78,203.8,204.38,198.975,204.1986,192.9936\n3/21/2016 12:00:00 AM,204.11,204.94,203.8,204.67,199.4695,204.6961,193.4961\n3/22/2016 12:00:00 AM,203.74,205.23,203.57,204.56,200.0815,205.1931,194.1131\n3/23/2016 12:00:00 AM,204.11,204.33,203.01,203.21,200.582,205.4398,195.0824\n3/24/2016 12:00:00 AM,201.98,203.16,201.74,203.12,200.961,205.6889,195.6564\n3/28/2016 12:00:00 AM,203.62,203.86,202.71,203.24,201.3685,205.9845,196.1095\n3/29/2016 12:00:00 AM,202.75,205.25,202.4,205.12,201.9465,206.4303,196.5678\n3/30/2016 12:00:00 AM,206.35,206.87,205.59,206.02,202.342,206.6121,197.3696\n3/31/2016 12:00:00 AM,205.87,206.41,205.33,205.52,202.668,206.9061,197.8461\n4/1/2016 12:00:00 AM,204.35,207.14,203.98,206.92,203.025,207.4218,197.9943\n4/4/2016 12:00:00 AM,206.84,207.07,205.89,206.25,203.316,207.5927,198.4503\n4/5/2016 12:00:00 AM,204.64,206.26,203.89,204.19,203.496,207.9078,198.6278\n4/6/2016 12:00:00 AM,204.27,206.49,203.98,206.42,203.897,208.3171,198.8371\n4/7/2016 12:00:00 AM,205.18,205.56,203.09,203.95,204.1255,208.7176,198.9601\n4/8/2016 12:00:00 AM,205.32,205.85,203.87,204.5,204.3735,208.7832,199.4532\n4/11/2016 12:00:00 AM,205.23,206.07,203.91,204.02,204.4365,208.8316,199.7841\n4/12/2016 12:00:00 AM,204.2,206.25,203.7,205.92,204.6075,209.1213,199.7538\n4/13/2016 12:00:00 AM,207.02,208.1,206.84,208,204.899,209.3776,200.0651\n4/14/2016 12:00:00 AM,208.03,208.6,207.6,208.01,205.1325,209.4886,200.4936\n4/15/2016 12:00:00 AM,208,208.17,207.4,207.78,205.29,209.4653,200.8928\n4/18/2016 12:00:00 AM,207.11,209.28,207,209.24,205.533,209.8213,200.9238\n4/19/2016 12:00:00 AM,209.7,210.2,208.94,209.9,205.7945,210.0963,201.1688\n4/20/2016 12:00:00 AM,209.9,210.92,209.39,210.1,206.0715,210.3677,201.4727\n4/21/2016 12:00:00 AM,210.13,210.25,208.65,208.97,206.3595,210.6919,201.7269\n4/22/2016 12:00:00 AM,208.53,209.29,207.91,208.97,206.652,210.9944,202.0394\n4/25/2016 12:00:00 AM,208.28,208.66,207.54,208.61,206.9205,211.2313,202.2838\n4/26/2016 12:00:00 AM,209.02,209.52,208.36,208.92,207.1105,211.2742,202.7492\n4/27/2016 12:00:00 AM,208.46,209.81,208.05,209.35,207.277,211.4695,202.8245\n4/28/2016 12:00:00 AM,208.49,209.76,206.96,207.45,207.3735,211.8106,202.7356\n4/29/2016 12:00:00 AM,206.71,207.13,205.03,206.33,207.344,211.7027,202.8927\n5/2/2016 12:00:00 AM,206.9,208.18,206.41,207.97,207.43,211.8177,202.8602\n5/3/2016 12:00:00 AM,206.5,206.8,205.28,206.16,207.5285,211.7589,203.0139\n5/4/2016 12:00:00 AM,205,205.85,204.42,205.01,207.458,211.6178,203.1428\n5/5/2016 12:00:00 AM,205.57,205.98,204.47,204.97,207.509,211.5419,203.3069\n5/6/2016 12:00:00 AM,204.04,205.77,203.88,205.72,207.57,211.5288,203.3163\n5/9/2016 12:00:00 AM,205.58,206.4,205.36,205.89,207.6635,211.4324,203.4999\n5/10/2016 12:00:00 AM,206.64,208.5,206.64,208.45,207.79,211.4752,203.7152\n5/11/2016 12:00:00 AM,207.89,208.54,206.5,206.5,207.715,211.5758,203.6208\n5/12/2016 12:00:00 AM,207.29,207.49,205.37,206.56,207.6425,211.6331,203.3981\n5/13/2016 12:00:00 AM,206.23,206.86,204.38,204.76,207.4915,211.74,203.0775\n5/16/2016 12:00:00 AM,204.95,207.34,204.89,206.78,207.3685,211.6602,202.9552\n5/17/2016 12:00:00 AM,206.44,206.8,204.23,204.85,207.116,211.6224,202.5899\n5/18/2016 12:00:00 AM,204.44,206.3,203.63,204.91,206.8565,211.5066,202.1891\n5/19/2016 12:00:00 AM,204,204.54,202.78,204.2,206.618,211.2373,201.8798\n5/20/2016 12:00:00 AM,204.95,206.1,204.86,205.49,206.444,211.0637,201.7412\n5/23/2016 12:00:00 AM,205.48,205.84,204.99,205.21,206.274,210.8956,201.6405\n5/24/2016 12:00:00 AM,206.15,208.24,206.14,207.87,206.2215,210.9263,201.4363\n5/25/2016 12:00:00 AM,208.64,209.77,207.87,209.28,206.218,210.9384,201.4134\n5/26/2016 12:00:00 AM,209.47,209.71,208.97,209.34,206.3125,210.7282,201.7182\n5/27/2016 12:00:00 AM,209.55,210.25,209.47,210.24,206.508,210.7513,202.0712\n5/31/2016 12:00:00 AM,210.53,210.69,209.18,209.84,206.6015,210.8505,202.2355\n6/1/2016 12:00:00 AM,209.15,210.48,208.89,210.27,206.807,211.0416,202.4091\n6/2/2016 12:00:00 AM,209.8,210.93,209.24,210.91,207.102,211.3218,202.6243\n6/3/2016 12:00:00 AM,210.32,210.69,208.86,210.28,207.3675,211.5895,202.812\n6/6/2016 12:00:00 AM,210.71,211.77,210.51,211.35,207.649,211.826,203.206\n6/7/2016 12:00:00 AM,211.56,212.34,211.5,211.68,207.9385,212.1029,203.5329\n6/8/2016 12:00:00 AM,211.8,212.52,211.69,212.37,208.1345,212.2002,203.8877\n6/9/2016 12:00:00 AM,211.49,212.22,211.19,212.08,208.4135,212.2825,204.2225\n6/10/2016 12:00:00 AM,210.43,210.86,209.43,210.07,208.589,212.3814,204.4939\n6/13/2016 12:00:00 AM,209.34,210.37,208.35,208.45,208.7735,212.5104,204.7379\n6/14/2016 12:00:00 AM,207.97,208.74,206.92,208.04,208.8365,212.5167,204.9017\n6/15/2016 12:00:00 AM,208.57,209.36,207.53,207.75,208.9815,212.5699,205.1399\n6/16/2016 12:00:00 AM,206.74,208.57,205.59,208.37,209.1545,212.7148,205.2073\n6/17/2016 12:00:00 AM,207.14,207.2,205.75,206.52,209.2705,212.8165,205.3866\n6/20/2016 12:00:00 AM,208.84,209.61,207.75,207.85,209.3885,213.0545,205.4695\n6/21/2016 12:00:00 AM,208.26,208.92,207.78,208.44,209.55,213.2376,205.5801\n6/22/2016 12:00:00 AM,208.69,209.5,207.93,208.1,209.5615,213.2472,205.7222\n6/23/2016 12:00:00 AM,209.83,210.87,209.27,210.81,209.638,213.2719,205.8219\n6/24/2016 12:00:00 AM,204,206.91,202.72,203.13,209.3275,213.4811,205.1686\n6/27/2016 12:00:00 AM,201.59,201.6,198.65,199.6,208.7955,213.2676,204.4126\n6/28/2016 12:00:00 AM,201.66,203.23,201.12,203.2,208.4635,212.9552,203.9501\n6/29/2016 12:00:00 AM,204.83,206.93,204.72,206.66,208.283,212.8402,203.6802\n6/30/2016 12:00:00 AM,207.18,209.54,206.56,209.48,208.2115,212.9012,203.4187\n7/1/2016 12:00:00 AM,209.29,210.49,209.29,209.92,208.1935,212.8277,203.5027\n7/5/2016 12:00:00 AM,208.9,209.08,207.71,208.41,208.0465,212.7043,203.3518\n7/6/2016 12:00:00 AM,207.87,209.8,207.06,209.66,207.9455,212.769,202.9414\n7/7/2016 12:00:00 AM,209.89,210.65,208.63,209.53,207.8035,212.7953,202.6703\n7/8/2016 12:00:00 AM,211,212.94,210.78,212.65,207.832,212.9451,202.5376\n7/11/2016 12:00:00 AM,213.16,214.07,212.95,213.4,207.9985,213.0744,202.7444\n7/12/2016 12:00:00 AM,214.51,215.3,213.43,214.95,208.3235,213.3058,203.0132\n7/13/2016 12:00:00 AM,215.42,215.45,214.35,214.92,208.6675,213.5687,203.4562\n7/14/2016 12:00:00 AM,216.34,216.67,215.66,216.12,209.086,213.8517,203.9442\n7/15/2016 12:00:00 AM,216.79,217.01,215.31,215.83,209.459,214.1442,204.5567\n7/18/2016 12:00:00 AM,215.95,216.6,215.67,216.41,209.9535,214.5619,205.1044\n7/19/2016 12:00:00 AM,215.88,216.23,215.63,216.19,210.3705,214.7661,205.6236\n7/20/2016 12:00:00 AM,216.75,217.37,216.24,217.09,210.803,215.1876,206.0476\n7/21/2016 12:00:00 AM,216.92,217.22,215.75,216.27,211.2115,215.5635,206.4485\n7/22/2016 12:00:00 AM,216.39,217.3,216.1,217.24,211.533,215.8447,206.8297\n7/25/2016 12:00:00 AM,217,217.06,215.97,216.65,212.209,216.0382,207.7982\n7/26/2016 12:00:00 AM,216.53,217.17,215.76,216.75,213.0665,216.661,208.806\n7/27/2016 12:00:00 AM,217.17,217.27,215.62,216.52,213.7325,217.3165,209.5765\n7/28/2016 12:00:00 AM,216.26,217.11,215.75,216.77,214.238,217.7398,210.2123\n7/29/2016 12:00:00 AM,216.45,217.54,216.13,217.12,214.62,217.9811,210.8461\n8/1/2016 12:00:00 AM,217.15,217.65,216.41,216.94,214.971,218.3431,211.1981\n8/2/2016 12:00:00 AM,216.64,216.83,214.57,215.55,215.328,218.8204,211.4529\n8/3/2016 12:00:00 AM,215.45,216.25,215.13,216.18,215.654,218.9793,212.0168\n8/4/2016 12:00:00 AM,216.3,216.78,214.25,216.41,215.998,219.3374,212.2473\n8/5/2016 12:00:00 AM,217.19,218.23,217.07,218.18,216.2745,219.5011,212.6611\n8/8/2016 12:00:00 AM,218.39,218.52,217.74,218.05,216.507,219.6894,212.9344\n8/9/2016 12:00:00 AM,218.12,218.76,217.8,218.18,216.6685,219.7708,213.2433\n8/10/2016 12:00:00 AM,218.29,218.4,217.23,217.64,216.8045,219.9253,213.3803\n8/11/2016 12:00:00 AM,218.25,218.94,217.95,218.65,216.931,220.0368,213.4968\n8/12/2016 12:00:00 AM,218.26,218.71,217.99,218.46,217.0625,220.0233,213.7283\n8/15/2016 12:00:00 AM,218.89,219.5,218.88,219.09,217.1965,220.1372,213.9197\n8/16/2016 12:00:00 AM,218.56,218.68,217.96,217.96,217.285,220.2717,214.0242\n8/17/2016 12:00:00 AM,217.98,218.53,217.02,218.37,217.349,220.3679,214.0254\n8/18/2016 12:00:00 AM,218.31,218.9,218.21,218.86,217.4785,220.3735,214.226\n8/19/2016 12:00:00 AM,218.34,218.75,217.74,218.54,217.5435,220.4269,214.3269\n8/22/2016 12:00:00 AM,218.25,218.8,217.83,218.53,217.6375,220.5019,214.4319\n8/23/2016 12:00:00 AM,219.23,219.6,218.9,218.97,217.7485,220.552,214.6595\n8/24/2016 12:00:00 AM,218.8,218.91,217.36,217.85,217.815,220.624,214.7565\n8/25/2016 12:00:00 AM,217.4,218.19,217.22,217.7,217.8615,220.6387,214.8687\n8/26/2016 12:00:00 AM,217.9,219.12,216.25,217.29,217.87,220.8652,214.7302\n8/29/2016 12:00:00 AM,217.43,218.67,217.4,218.36,217.941,220.9192,214.7767\n8/30/2016 12:00:00 AM,218.25,218.59,217.35,218,218.0635,220.9044,215.0168\n8/31/2016 12:00:00 AM,217.64,217.75,216.47,217.38,218.1235,220.9954,215.0679\n9/1/2016 12:00:00 AM,217.38,217.73,216.03,217.39,218.1725,220.9591,215.2391\n9/2/2016 12:00:00 AM,218.36,218.87,217.7,218.37,218.182,220.9921,215.2696\n9/6/2016 12:00:00 AM,218.72,219.12,217.86,219.03,218.231,221.0704,215.2278\n9/7/2016 12:00:00 AM,218.84,219.22,218.3,219.01,218.2725,221.0893,215.2568\n9/8/2016 12:00:00 AM,218.6,218.94,218.15,218.51,218.316,221.0782,215.3407\n9/9/2016 12:00:00 AM,217,217.03,213.25,213.28,218.0475,221.2648,214.8298\n9/12/2016 12:00:00 AM,212.39,216.81,212.31,216.34,217.9415,221.5524,214.1724\n9/13/2016 12:00:00 AM,214.85,215.15,212.5,213.23,217.6485,221.5394,213.6519\n9/14/2016 12:00:00 AM,213.29,214.7,212.5,213.15,217.408,221.4894,213.2319\n9/15/2016 12:00:00 AM,213,215.73,212.75,215.28,217.2535,221.498,212.873\n9/16/2016 12:00:00 AM,213.5,213.69,212.57,213.37,216.979,221.2807,212.5482\n9/19/2016 12:00:00 AM,214.1,214.88,213.03,213.41,216.7225,221.1717,212.2292\n9/20/2016 12:00:00 AM,214.43,214.59,213.38,213.42,216.467,220.9854,211.9829\n9/21/2016 12:00:00 AM,214.22,216.03,213.44,215.82,216.3095,220.9973,211.5223\n9/22/2016 12:00:00 AM,216.99,217.53,216.71,217.18,216.276,220.8549,211.5624\n9/23/2016 12:00:00 AM,216.73,216.88,215.88,215.99,216.1905,220.7924,211.4924\n9/26/2016 12:00:00 AM,215.02,215.23,214.01,214.24,216.038,220.4314,211.5439\n9/27/2016 12:00:00 AM,214.03,215.68,213.62,215.57,215.8985,220.3615,211.2765\n9/28/2016 12:00:00 AM,215.81,216.82,214.71,216.64,215.8305,220.3607,211.0582\n9/29/2016 12:00:00 AM,216.39,216.87,214.04,214.68,215.6955,220.4732,210.7832\n9/30/2016 12:00:00 AM,215.67,217.12,215.36,216.3,215.641,220.4487,210.7437\n10/3/2016 12:00:00 AM,215.81,216.04,215.04,215.78,215.5115,220.2901,210.6277\n10/4/2016 12:00:00 AM,215.86,216.17,213.99,214.68,215.294,220.2354,210.3429\n10/5/2016 12:00:00 AM,215.37,216.13,215.33,215.63,215.125,220.0688,210.2063\n10/6/2016 12:00:00 AM,215.39,216.04,214.74,215.78,214.9885,219.9751,209.9851\n10/7/2016 12:00:00 AM,216.06,216.3,214.19,215.04,215.0765,219.7693,210.1968\n10/10/2016 12:00:00 AM,216.14,216.7,215.99,216.16,215.0675,219.3802,210.7552\n10/11/2016 12:00:00 AM,215.64,215.74,212.58,213.43,215.0775,219.4614,210.7089\n10/12/2016 12:00:00 AM,213.61,214.32,213.01,213.71,215.1055,219.3527,210.8227\n10/13/2016 12:00:00 AM,212.15,213.59,211.21,213.01,214.992,219.1849,210.8049\n10/14/2016 12:00:00 AM,214.14,214.69,213.03,213.12,214.9795,219.2893,210.7743\n10/17/2016 12:00:00 AM,213.07,213.39,212.17,212.38,214.928,219.1513,210.7938\n10/18/2016 12:00:00 AM,214.24,214.31,213.27,213.71,214.9425,219.1202,210.8052\n10/19/2016 12:00:00 AM,214,214.64,213.6,214.28,214.8655,218.8944,210.9669\n10/20/2016 12:00:00 AM,213.85,214.53,213.11,213.88,214.7005,218.8047,210.7272\n10/21/2016 12:00:00 AM,212.95,214.08,212.76,213.98,214.6,218.6969,210.5394\n10/24/2016 12:00:00 AM,214.98,215.32,214.48,214.89,214.6325,218.6632,210.6007\n10/25/2016 12:00:00 AM,214.7,214.98,213.98,214.17,214.5625,218.5215,210.724\n10/26/2016 12:00:00 AM,213.22,214.42,212.93,213.74,214.4175,218.339,210.6965\n10/27/2016 12:00:00 AM,214.57,214.62,213.08,213.17,214.342,218.0962,210.7762\n10/28/2016 12:00:00 AM,213.13,213.93,211.71,212.54,214.154,217.9831,210.5481\n10/31/2016 12:00:00 AM,212.95,213.19,212.36,212.55,213.9925,217.8235,210.431\n11/1/2016 12:00:00 AM,212.9,212.99,209.6,211.01,213.809,217.7871,210.0921\n11/2/2016 12:00:00 AM,210.67,211.1,209.23,209.74,213.5145,217.6433,209.6808\n11/3/2016 12:00:00 AM,210.01,210.24,208.46,208.78,213.1645,217.4017,209.3192\n11/4/2016 12:00:00 AM,208.91,209.89,208.38,208.55,212.84,217.0207,209.0882\n11/7/2016 12:00:00 AM,211.47,213.19,211.3,213.15,212.6895,216.9639,208.7364\n11/8/2016 12:00:00 AM,212.72,214.77,212.38,214.11,212.7235,216.8374,208.8024\n11/9/2016 12:00:00 AM,212.47,217.1,212.34,216.38,212.857,217.3263,208.4288\n11/10/2016 12:00:00 AM,217.35,218.31,215.22,216.92,213.0525,217.6342,208.5592\n11/11/2016 12:00:00 AM,216.13,216.7,215.32,216.42,213.2175,217.7065,208.7015\n11/14/2016 12:00:00 AM,216.99,217.27,215.72,216.59,213.428,217.9337,208.8462\n11/15/2016 12:00:00 AM,217,218.28,216.8,218.28,213.6565,218.1764,208.9789\n11/16/2016 12:00:00 AM,217.52,218.14,217.42,217.87,213.836,218.3193,209.2018\n11/17/2016 12:00:00 AM,218.04,219.06,217.92,218.99,214.0915,218.5176,209.4701\n11/18/2016 12:00:00 AM,219.04,219.27,218.29,218.5,214.3175,218.7429,209.7804\n11/21/2016 12:00:00 AM,219.19,220.18,219,220.15,214.5805,219.0201,209.9726\n11/22/2016 12:00:00 AM,220.49,220.79,219.73,220.58,214.901,219.3166,210.2541\n11/23/2016 12:00:00 AM,220,220.76,219.75,220.7,215.249,219.5853,210.6428\n11/25/2016 12:00:00 AM,221.12,221.56,221.01,221.52,215.6665,219.8328,211.1378\n11/28/2016 12:00:00 AM,221.19,221.48,220.36,220.48,216.0635,220.0995,211.6795\n11/29/2016 12:00:00 AM,220.58,221.44,220.17,220.91,216.4815,220.5562,212.0262\n11/30/2016 12:00:00 AM,221.65,221.82,220.31,220.38,216.95,220.8075,212.7475\n12/1/2016 12:00:00 AM,220.73,220.73,219.15,219.57,217.4415,221.2597,213.2722\n12/2/2016 12:00:00 AM,219.7,220.25,219.26,219.68,217.9865,221.6807,213.8907\n12/5/2016 12:00:00 AM,220.67,221.4,220.42,221,218.609,222.2028,214.5453\n12/6/2016 12:00:00 AM,221.24,221.74,220.66,221.7,219.0365,222.5488,215.0938\n12/7/2016 12:00:00 AM,221.5,224.67,221.38,224.6,219.561,223.1348,215.4548\n12/8/2016 12:00:00 AM,224.58,225.7,224.26,225.15,219.9995,223.228,216.378\n12/9/2016 12:00:00 AM,225.44,226.53,225.37,226.51,220.479,223.4441,217.0766\n12/12/2016 12:00:00 AM,226.42,226.96,225.76,226.25,220.9705,223.939,217.6165\n12/13/2016 12:00:00 AM,227.01,228.34,227,227.76,221.529,224.4713,218.2013\n12/14/2016 12:00:00 AM,227.41,228.23,225.37,225.88,221.909,225.1081,218.4931\n12/15/2016 12:00:00 AM,226.13,227.81,225.89,226.81,222.356,225.7123,218.7973\n12/16/2016 12:00:00 AM,225.99,226.08,224.67,225.04,222.6585,226.0905,219.108\n12/19/2016 12:00:00 AM,225.24,226.02,225.08,225.53,223.01,226.424,219.4515\n12/20/2016 12:00:00 AM,226.16,226.57,225.88,226.4,223.3225,226.6942,219.8442\n12/21/2016 12:00:00 AM,226.27,226.45,225.77,225.77,223.582,226.9391,220.1841\n12/22/2016 12:00:00 AM,225.61,225.74,224.92,225.38,223.816,227.169,220.4615\n12/23/2016 12:00:00 AM,225.42,225.72,225.21,225.71,224.0255,227.373,220.6755\n12/27/2016 12:00:00 AM,226,226.73,226,226.27,224.315,227.5963,220.9963\n12/28/2016 12:00:00 AM,226.59,226.59,224.27,224.4,224.4895,227.9597,221.0972\n12/29/2016 12:00:00 AM,224.47,224.89,223.84,224.35,224.688,228.0669,221.3194\n12/30/2016 12:00:00 AM,224.71,224.83,222.73,223.53,224.886,228.3243,221.4468\n1/3/2017 12:00:00 AM,225.07,225.83,223.88,225.24,225.164,228.6999,221.5824\n1/4/2017 12:00:00 AM,225.64,226.75,225.61,226.58,225.443,228.9835,221.826\n1/5/2017 12:00:00 AM,226.28,226.58,225.48,226.4,225.678,229.2275,222.065\n1/6/2017 12:00:00 AM,226.53,227.75,225.9,227.21,225.8085,229.2358,222.4333\n1/9/2017 12:00:00 AM,226.9,227.07,226.42,226.46,225.874,229.225,222.62\n1/10/2017 12:00:00 AM,226.47,227.45,226.01,226.46,225.8715,229.2991,222.6241\n1/11/2017 12:00:00 AM,226.38,227.1,225.59,227.1,225.914,229.3373,222.5848\n1/12/2017 12:00:00 AM,226.5,226.75,224.96,226.53,225.8525,229.3031,222.4381\n1/13/2017 12:00:00 AM,226.75,227.4,226.69,227.05,225.911,229.0449,222.7174\n1/17/2017 12:00:00 AM,226.3,226.78,225.8,226.25,225.883,228.8988,222.8063\n1/18/2017 12:00:00 AM,226.52,226.8,225.9,226.75,225.9685,228.8836,222.9186\n1/19/2017 12:00:00 AM,226.83,227,225.41,225.91,225.9875,228.9979,222.8705\n1/20/2017 12:00:00 AM,226.73,227.31,225.97,226.74,226.0045,229.1002,222.8102\n1/23/2017 12:00:00 AM,226.37,226.81,225.27,226.15,226.0235,229.2047,222.6997\n1/24/2017 12:00:00 AM,226.4,228.08,226.27,227.6,226.1345,229.4212,222.6687\n1/25/2017 12:00:00 AM,228.7,229.57,228.51,229.57,226.3275,229.6689,222.7789\n1/26/2017 12:00:00 AM,229.42,229.71,229.01,229.33,226.4805,229.8149,222.9324\n1/27/2017 12:00:00 AM,229.44,229.59,228.76,228.97,226.709,229.8148,223.3049\n1/30/2017 12:00:00 AM,228.18,228.2,226.41,227.55,226.869,230.0548,223.3598\n1/31/2017 12:00:00 AM,227.01,227.6,226.32,227.53,227.069,230.1107,223.6207\n2/1/2017 12:00:00 AM,228.28,228.59,226.94,227.62,227.188,230.2184,223.8035\n2/2/2017 12:00:00 AM,227.24,228.1,226.82,227.77,227.2475,230.3,223.85\n2/3/2017 12:00:00 AM,228.85,229.55,228.46,229.34,227.3945,230.4475,224\n2/6/2017 12:00:00 AM,228.89,229.33,228.54,228.93,227.4805,230.4199,224.2374\n2/7/2017 12:00:00 AM,229.36,229.66,228.72,228.94,227.6045,230.5785,224.3235\n2/8/2017 12:00:00 AM,228.59,229.39,228.31,229.24,227.7435,230.6393,224.4743\n2/9/2017 12:00:00 AM,229.57,230.95,229.52,230.6,227.9185,230.8237,224.6787\n2/10/2017 12:00:00 AM,231,231.77,230.62,231.51,228.1675,231.0103,225.0253\n2/13/2017 12:00:00 AM,232.09,233.07,232.05,232.77,228.4535,231.3249,225.2624\n2/14/2017 12:00:00 AM,232.55,233.71,232.16,233.7,228.826,231.7287,225.5237\n2/15/2017 12:00:00 AM,233.43,235.14,233.39,234.92,229.2345,232.2312,225.8137\n2/16/2017 12:00:00 AM,234.93,235.16,233.85,234.72,229.675,232.611,226.2635\n2/17/2017 12:00:00 AM,233.97,235.09,233.93,235.09,230.0925,232.9819,226.6794\n2/21/2017 12:00:00 AM,235.51,236.69,235.51,236.49,230.6095,233.4397,227.2272\n2/22/2017 12:00:00 AM,236.02,236.54,235.83,236.28,231.0435,233.752,227.8145\n2/23/2017 12:00:00 AM,236.9,236.9,235.56,236.44,231.387,234.1467,228.1392\n2/24/2017 12:00:00 AM,235.42,236.79,235.41,236.74,231.7575,234.569,228.3915\n2/27/2017 12:00:00 AM,236.61,237.31,236.35,237.11,232.1645,234.968,228.758\n2/28/2017 12:00:00 AM,236.71,236.95,236.02,236.47,232.6105,235.319,229.324\n3/1/2017 12:00:00 AM,238.4,240.32,238.37,239.78,233.223,236.0224,229.8599\n3/2/2017 12:00:00 AM,239.57,239.57,238.21,238.27,233.7555,236.5422,230.4522\n3/3/2017 12:00:00 AM,238.19,238.61,237.73,238.42,234.288,237.0275,231.0375\n3/6/2017 12:00:00 AM,237.48,238.12,237.01,237.71,234.7065,237.458,231.463\n3/7/2017 12:00:00 AM,237.39,237.77,236.76,237,235.11,237.9021,231.8521\n3/8/2017 12:00:00 AM,237.31,237.64,236.4,236.56,235.491,238.3312,232.2062\n3/9/2017 12:00:00 AM,236.71,237.24,235.74,236.86,235.872,238.766,232.5359\n3/10/2017 12:00:00 AM,237.95,238.02,236.59,237.69,236.2265,239.1194,232.8894\n3/13/2017 12:00:00 AM,237.59,237.86,237.24,237.81,236.5415,239.3707,233.2732\n3/14/2017 12:00:00 AM,237.22,237.24,236.19,236.9,236.748,239.5822,233.4772\n3/15/2017 12:00:00 AM,237.56,239.44,237.29,238.95,237.0105,239.9292,233.6742\n3/16/2017 12:00:00 AM,239.12,239.2,238.1,238.48,237.1885,240.0668,233.9743\n3/17/2017 12:00:00 AM,237.75,237.97,237.03,237.03,237.304,240.1701,234.1701\n3/20/2017 12:00:00 AM,237.01,237.36,236.32,236.77,237.388,240.2716,234.3016\n3/21/2017 12:00:00 AM,237.49,237.61,233.58,233.73,237.25,240.6057,233.9232\n3/22/2017 12:00:00 AM,233.73,234.61,233.05,234.28,237.15,240.5946,233.6996\n3/23/2017 12:00:00 AM,233.98,235.34,233.6,234.03,237.0295,240.5569,233.5619\n3/24/2017 12:00:00 AM,234.35,235.04,232.96,233.86,236.8855,240.5399,233.3699\n3/27/2017 12:00:00 AM,231.97,233.92,231.61,233.62,236.711,240.5064,232.9989\n3/28/2017 12:00:00 AM,233.32,235.81,233.14,235.32,236.6535,240.6247,232.6822\n3/29/2017 12:00:00 AM,235,235.81,234.73,235.54,236.4415,240.3117,232.5867\n3/30/2017 12:00:00 AM,235.5,236.52,235.27,236.29,236.3425,240.1481,232.4506\n3/31/2017 12:00:00 AM,235.91,236.51,235.68,235.74,236.2085,240.0381,232.3531\n4/3/2017 12:00:00 AM,235.79,236.03,233.91,235.33,236.0895,240.0353,232.0978\n4/4/2017 12:00:00 AM,235,235.58,234.56,235.48,236.0135,239.9268,231.9868\n4/5/2017 12:00:00 AM,236.26,237.39,234.54,234.78,235.9245,240.0767,231.7342\n4/6/2017 12:00:00 AM,234.96,236.04,234.43,235.44,235.8535,240.0278,231.6577\n4/7/2017 12:00:00 AM,235.18,236,234.64,235.2,235.729,239.9197,231.5672\n4/10/2017 12:00:00 AM,235.36,236.26,234.73,235.34,235.6055,239.9311,231.3511\n4/11/2017 12:00:00 AM,234.9,235.18,233.34,235.06,235.5135,239.9076,231.1301\n4/12/2017 12:00:00 AM,234.8,234.96,233.77,234.03,235.2675,239.587,231.0495\n4/13/2017 12:00:00 AM,233.65,234.49,232.51,232.51,234.969,239.44,230.6825\n4/17/2017 12:00:00 AM,233.12,234.57,232.88,234.57,234.846,239.3455,230.4005\n4/18/2017 12:00:00 AM,233.71,234.49,233.08,233.87,234.701,239.2392,230.2017\n4/19/2017 12:00:00 AM,234.52,234.95,233.18,233.44,234.6865,238.8774,230.4049\n4/20/2017 12:00:00 AM,234.14,235.85,233.78,235.34,234.7395,238.9908,230.3908\n4/21/2017 12:00:00 AM,235.22,235.31,234.13,234.59,234.7675,238.9329,230.4729\n4/24/2017 12:00:00 AM,237.17,237.41,236.61,237.17,234.933,238.9227,230.7826\n4/25/2017 12:00:00 AM,237.93,238.95,237.81,238.55,235.1795,239.0563,231.2088\n4/26/2017 12:00:00 AM,238.53,239.53,238.35,238.4,235.3335,239.092,231.617\n4/27/2017 12:00:00 AM,238.74,238.95,237.98,238.6,235.4865,239.238,231.7905\n4/28/2017 12:00:00 AM,238.93,238.93,237.93,238.08,235.576,239.3334,231.9484\n5/1/2017 12:00:00 AM,238.66,239.17,238.2,238.68,235.723,239.4804,232.0604\n5/2/2017 12:00:00 AM,238.82,238.98,238.3,238.77,235.895,239.4831,232.4231\n5/3/2017 12:00:00 AM,238.29,238.88,237.7,238.48,236.045,239.6641,232.5641\n5/4/2017 12:00:00 AM,238.81,238.92,237.78,238.76,236.244,239.5682,232.8957\n5/5/2017 12:00:00 AM,239.16,239.72,238.68,239.7,236.457,239.6949,233.1649\n5/8/2017 12:00:00 AM,239.77,239.92,239.17,239.66,236.68,239.8296,233.4521\n5/9/2017 12:00:00 AM,239.94,240.19,239.04,239.44,236.885,239.9879,233.7054\n5/10/2017 12:00:00 AM,239.37,239.87,239.15,239.87,237.1255,240.1098,234.1073\n5/11/2017 12:00:00 AM,239.31,239.57,238.13,239.38,237.393,240.3654,234.3004\n5/12/2017 12:00:00 AM,239.05,239.43,238.67,238.98,237.7165,240.4897,234.7297\n5/15/2017 12:00:00 AM,239.49,240.44,239.45,240.3,238.003,240.7128,235.1278\n5/16/2017 12:00:00 AM,240.64,240.67,239.63,240.08,238.3135,240.9846,235.4921\n5/17/2017 12:00:00 AM,238.09,238.64,235.75,235.82,238.4325,241.2822,235.5097\n5/18/2017 12:00:00 AM,235.7,237.75,235.43,236.77,238.504,241.4024,235.5674\n5/19/2017 12:00:00 AM,237.36,239.08,237.27,238.31,238.69,241.6543,235.6618\n5/22/2017 12:00:00 AM,238.87,239.71,238.82,239.52,238.8075,241.7783,235.7633\n5/23/2017 12:00:00 AM,239.98,240.24,239.51,240.05,238.8825,241.8016,235.8891\n5/24/2017 12:00:00 AM,240.33,240.73,239.93,240.61,238.993,241.8235,236.006\n5/25/2017 12:00:00 AM,241.22,242.08,240.96,241.76,239.151,241.995,236.14\n5/26/2017 12:00:00 AM,241.59,241.9,241.45,241.71,239.3325,242.0884,236.3709\n5/30/2017 12:00:00 AM,241.32,241.79,241.16,241.5,239.4735,242.1853,236.5528\n5/31/2017 12:00:00 AM,241.84,241.88,240.64,241.44,239.607,242.3865,236.614\n6/1/2017 12:00:00 AM,241.97,243.38,241.64,243.36,239.851,242.6678,236.7553\n6/2/2017 12:00:00 AM,243.45,244.35,243.08,244.17,240.1215,242.9524,237.0074\n6/5/2017 12:00:00 AM,244.02,244.3,243.76,243.99,240.336,243.1312,237.3112\n6/6/2017 12:00:00 AM,243.34,243.98,243.12,243.21,240.5135,243.3452,237.4977\n6/7/2017 12:00:00 AM,243.61,243.92,242.83,243.66,240.7245,243.5257,237.6932\n6/8/2017 12:00:00 AM,243.8,244.33,243.17,243.78,240.92,243.7929,237.8504\n6/9/2017 12:00:00 AM,244.07,245.01,241.95,243.41,241.1215,244.2284,237.8809\n6/12/2017 12:00:00 AM,243.09,243.42,242.38,243.36,241.3405,244.456,238.0385\n6/13/2017 12:00:00 AM,243.98,244.61,243.58,244.55,241.553,244.6685,238.241\n6/14/2017 12:00:00 AM,244.86,244.87,243.29,244.24,241.761,244.9328,238.3703\n6/15/2017 12:00:00 AM,242.69,243.91,242.36,243.77,242.1585,245.061,238.8335\n6/16/2017 12:00:00 AM,242.83,242.83,241.63,242.64,242.452,245.2021,239.2547\n6/19/2017 12:00:00 AM,243.61,244.73,243.48,244.66,242.7695,245.4283,239.6208\n6/20/2017 12:00:00 AM,244.23,244.26,242.99,243.01,242.944,245.694,239.7915\n6/21/2017 12:00:00 AM,243.46,243.59,242.41,242.95,243.089,245.9066,239.8916\n6/22/2017 12:00:00 AM,242.96,243.53,242.64,242.84,243.2005,246.0557,240.0182\n6/23/2017 12:00:00 AM,242.88,243.51,242.47,243.13,243.269,246.1191,240.1016\n6/26/2017 12:00:00 AM,243.93,244.38,243.05,243.29,243.348,246.3315,240.0939\n6/27/2017 12:00:00 AM,243.01,243.38,241.31,241.33,243.3395,246.5557,239.9582\n6/28/2017 12:00:00 AM,242.51,243.72,242.23,243.49,243.442,246.6729,240.0129\n6/29/2017 12:00:00 AM,243.62,243.72,239.96,241.35,243.3415,246.8942,239.7292\n6/30/2017 12:00:00 AM,242.3,242.71,241.58,241.8,243.223,246.7981,239.6681\n7/3/2017 12:00:00 AM,242.9,243.38,242.21,242.21,243.134,246.8153,239.5278\n7/5/2017 12:00:00 AM,242.61,243.01,241.7,242.77,243.112,246.812,239.412\n7/6/2017 12:00:00 AM,241.86,242.03,240.34,240.55,242.9565,246.7779,239.2279\n7/7/2017 12:00:00 AM,241.18,242.28,240.56,242.11,242.873,246.7317,239.0417\n7/10/2017 12:00:00 AM,241.98,242.8,241.76,242.37,242.821,246.4175,239.2325\n7/11/2017 12:00:00 AM,242.12,242.55,240.85,242.19,242.7625,246.4404,239.0904\n7/12/2017 12:00:00 AM,243.31,244.2,243.3,244.01,242.7355,246.4068,239.0893\n7/13/2017 12:00:00 AM,244.02,244.55,243.76,244.42,242.7445,246.3115,239.1915\n7/14/2017 12:00:00 AM,244.4,245.97,244.31,245.56,242.834,246.4255,239.278\n7/17/2017 12:00:00 AM,245.44,245.91,245.33,245.53,242.9785,246.5173,239.5248\n7/18/2017 12:00:00 AM,245.06,245.72,244.67,245.66,243.0285,246.5467,239.6042\n7/19/2017 12:00:00 AM,246.01,247,246.01,246.99,243.2275,246.6556,239.7831\n7/20/2017 12:00:00 AM,247.25,247.42,246.47,247.1,243.435,246.824,240.009\n7/21/2017 12:00:00 AM,246.43,246.91,246.18,246.88,243.637,246.9769,240.2019\n7/24/2017 12:00:00 AM,246.81,246.98,246.28,246.82,243.8215,247.1163,240.4263\n7/25/2017 12:00:00 AM,247.7,247.8,247.16,247.42,244.028,247.218,240.7005\n7/26/2017 12:00:00 AM,247.78,247.79,247.13,247.43,244.333,247.2967,241.1317\n7/27/2017 12:00:00 AM,247.96,248,245.68,247.2,244.5185,247.5943,241.2218\n7/28/2017 12:00:00 AM,246.7,247.06,246.13,246.91,244.7965,247.4756,241.8106\n7/31/2017 12:00:00 AM,247.38,247.48,246.53,246.77,245.045,247.696,242.076\n8/1/2017 12:00:00 AM,247.45,247.5,246.72,247.32,245.3005,247.8629,242.3403\n8/2/2017 12:00:00 AM,247.47,247.6,246.37,247.44,245.534,248.0843,242.5818\n8/3/2017 12:00:00 AM,247.31,247.34,246.64,246.96,245.8545,248.2503,242.9953\n8/4/2017 12:00:00 AM,247.52,247.79,246.97,247.41,246.1195,248.4353,243.4053\n8/7/2017 12:00:00 AM,247.5,247.87,247.37,247.87,246.3945,248.6347,243.7397\n8/8/2017 12:00:00 AM,247.49,248.91,246.83,247.26,246.648,248.9909,244.0009\n8/9/2017 12:00:00 AM,246.46,247.31,246.06,247.25,246.81,249.1816,244.1041\n8/10/2017 12:00:00 AM,246.3,246.44,243.7,243.76,246.777,249.4725,243.9075\n8/11/2017 12:00:00 AM,244,244.8,243.75,244.12,246.705,249.3527,243.9402\n8/14/2017 12:00:00 AM,245.55,246.79,245.55,246.54,246.7555,249.4629,243.8854\n8/15/2017 12:00:00 AM,247,247,246.16,246.51,246.798,249.5058,243.9808\n8/16/2017 12:00:00 AM,247.09,247.57,246.45,246.94,246.7955,249.5474,243.9899\n8/17/2017 12:00:00 AM,246.26,246.6,243.09,243.09,246.595,249.7647,243.5672\n8/18/2017 12:00:00 AM,242.95,244.19,242.2,242.71,246.3865,249.7554,243.2429\n8/21/2017 12:00:00 AM,242.64,243.2,241.83,242.9,246.1905,249.6337,242.9537\n8/22/2017 12:00:00 AM,243.6,245.62,243.55,245.44,246.0915,249.6685,242.631\n8/23/2017 12:00:00 AM,244.34,245.05,244.16,244.56,245.948,249.5546,242.4596\n8/24/2017 12:00:00 AM,245,245.18,243.75,243.99,245.7875,249.3239,242.4514\n8/25/2017 12:00:00 AM,244.89,245.61,244.39,244.56,245.67,249.2805,242.3355\n8/28/2017 12:00:00 AM,245.17,245.2,244.09,244.57,245.56,249.1826,242.1976\n8/29/2017 12:49:25 PM,243.13,244.67,242.93,244.65,245.4265,,\n"
  },
  {
    "path": "Tests/TestData/spy_ad.txt",
    "content": "Date,Open,High,Low,Close,Volume,AD\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,106292600\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,-139190600\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,1508771.42857686\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,98397253.1406377\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,8570094.23653084\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,138518627.397155\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,235847427.397155\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,263297585.887722\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,253372922.729829\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,264590574.903743\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,335296887.024953\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,416703035.376603\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,422551816.275481\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,468589091.556381\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,562365381.211545\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,618909890.800592\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,627695883.85615\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,638136502.606153\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,666126830.142388\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,581021143.129404\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,692124343.129404\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,635412418.129402\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,713021331.709651\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,804757959.129004\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,873838775.492639\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,835466452.911997\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,842701524.340565\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,745979034.747805\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,801081071.784847\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,918932464.18991\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,1003801556.02665\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,1018815212.74307\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,1122655432.28329\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,1134837110.06107\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,1201137052.91822\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,988476312.654192\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,1120727203.79343\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,1078586042.02873\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,1017572895.79217\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,1152183313.27468\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,1214489081.4311\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,1351855172.34019\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,1341855551.28756\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1304970464.10807\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,1321459946.8667\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,1359474907.84231\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,1466787545.68015\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,1366320767.0542\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,1442740534.70126\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,1411927127.5584\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,1426605868.23637\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,1507338684.5629\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,1595043288.33649\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1559550288.33649\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,1634796280.64418\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,1671031962.46236\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1772542791.03379\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1841411705.3195\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1774942395.08328\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1884689366.07565\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,1855872779.47771\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1858799871.7854\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,1710375870.75976\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1822640484.97296\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1958779074.97296\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,1887039252.63794\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,1919947814.28177\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,1908299361.72703\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,1768198792.54464\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,1915619551.43352\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,1868464287.2985\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,1683363913.93606\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,1881774351.68706\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,2038867243.39977\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,2021955874.46774\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,1926354874.46773\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,1768572409.95161\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,1902122243.07661\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,1804387627.16752\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,1813332998.425\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1888936382.09847\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1694652468.95106\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,1460607911.25875\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,1568078911.25875\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,1564794382.36987\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,1615698359.51272\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,1672726105.11272\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,1582080315.45756\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,1538406097.27573\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,1459396597.27573\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,1426715013.9424\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1454374355.87788\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1568024110.93406\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,1603451745.28521\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,1677645084.90785\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,1677645084.90785\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1770452047.87081\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,1765320202.8708\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,1787794312.72996\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,1761015219.70671\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,1723184390.37337\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,1749539872.61636\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,1839420829.1381\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,1866567644.20659\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,1804443490.36044\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,1737382716.55091\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,1819196653.39302\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,1920065338.75887\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,1920903382.9694\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,1898281573.79509\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1802044094.38332\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,1875758036.14156\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,1961273662.22852\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,1969153560.58917\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,1938585397.34131\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,1975099338.2504\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,2015053663.8504\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,2001796707.32866\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,2040798096.57597\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,2090041983.15315\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,2016874972.24407\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,1930356288.66197\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,1876199394.85667\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,1781231516.92564\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,1787867143.79131\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,1693576160.09566\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,1760373245.20204\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,1815193471.61713\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,1739743758.14196\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,1606387056.44704\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,1626827212.0026\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,1619581602.2465\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,1580115043.42297\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1542135628.52935\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1610599243.34417\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,1590901556.777\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1630428739.17701\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1704178564.17701\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1799138157.92701\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1893463857.92701\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1856116281.73653\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1902280795.62542\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1832952910.62542\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,1905064487.54849\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,2042015507.95665\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1944871743.60021\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,1833724959.60021\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1818791545.3145\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,1767058793.79935\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,1684029721.32229\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,1694969664.17943\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,1725590767.1645\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,1759685156.37314\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,1859577584.37314\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,1948475943.31353\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,1903119980.45639\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,1978253858.23417\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,1911296618.23417\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,1753485816.46425\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,1800795538.02114\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1977582905.01621\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,2074413648.24202\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,2170087272.24202\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,2057599132.9563\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,2199565838.83865\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,2315437006.51542\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,2420359490.51542\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,2425984279.70461\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,2448918883.64162\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,2481674477.19001\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,2515878935.32954\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,2598073329.30544\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,2629897213.72103\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,2702902367.20939\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,2659686748.83102\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,2577322092.94866\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,2637923030.35873\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,2710171465.78108\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,2726105897.98447\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,2753331866.73447\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,2622246523.67891\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,2756527109.85777\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,2777890561.47068\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,2793856990.76361\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,2891071670.07395\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,2967635982.89447\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,3052185020.86915\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,3006946872.2205\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,2964064894.8292\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,2902038170.21381\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,2972241764.33146\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,3050411003.9541\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,3022695273.9541\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,2995205727.61263\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,3029747702.1889\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,2997916191.66259\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,2945761423.86598\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,2940059486.16106\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,2976426842.49909\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,2907364813.63311\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,2989659738.6331\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,2985542832.75075\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,2933570613.57267\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,2827757588.89182\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,2790016039.80091\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,2764594006.09305\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,2736080670.92821\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,2708325850.23856\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,2939591676.76917\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,3018307928.28433\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,3095871359.27024\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,3148314745.23516\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,3178556945.23516\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,3220041920.23516\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,3203404858.6967\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,3208569149.60578\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,3294692749.60578\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,3241326157.78188\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,3201908178.40044\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,3135463416.23828\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,3157998016.23828\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,3190842748.15317\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,3215164079.49645\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,3303664761.31463\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,3189954755.68083\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,3283056956.77973\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,3336640669.78786\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,3367049386.65533\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,3318381621.1686\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,3346167949.07558\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,3357215476.34831\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,3387369737.1078\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,3187618988.6979\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,3141131982.86457\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,3207550030.32219\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,3113461117.14854\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,3142686081.66467\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,3155000879.13302\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,2938730265.47663\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,3015882063.16449\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,3110521596.678\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,3242900596.678\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,3383290450.88361\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,3462433622.97663\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,3537442736.30996\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,3503723200.59568\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,3588122375.27922\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,3645742277.64608\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,3678130718.12228\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,3570307646.00689\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,3629280933.50689\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,3530709399.56193\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,3499747071.3568\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,3487721987.53327\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,3469914300.9191\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,3557387047.58576\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,3584653296.15719\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,3659506277.33366\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,3718810723.67513\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,3715963184.96546\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,3712987474.12208\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,3722968474.77567\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,3788692512.16698\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,3734363313.2141\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,3828955793.2141\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,3722951486.90779\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,3618948869.26073\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,3648580002.59407\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,3713911195.45121\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,3707494038.77105\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,3807816728.11115\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,3663300351.85697\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,3622345848.1835\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,3647754063.75236\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,3533041663.75237\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,3525141413.75237\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,3493682281.358\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,3523690323.52667\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,3591142676.27392\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,3630102279.30423\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,3629441997.25294\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,3488605663.91961\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,3394423950.87613\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,3469688491.20762\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,3563959966.32724\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,3409025900.2895\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,3273671214.98145\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,3346954018.09025\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,3489502715.96259\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,3590858397.17065\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,3615013666.05953\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,3674029234.59886\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,3690896636.17366\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,3652903655.5285\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,3673422329.5011\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,3630825908.95315\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,3685695892.46964\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,3718934571.6363\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,3791187600.42418\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,3797043415.7395\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,3739414415.7395\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,3805027071.69804\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,3724583458.7484\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,3821191142.42187\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,3784647255.11223\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,3857234362.55025\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,3935788288.08216\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,3908199771.15908\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,3871746427.12239\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,3844086194.97953\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,3930419616.96535\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,3980152201.63688\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,3935547161.63689\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,4010735127.15413\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,4029410689.65413\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,4072666914.37323\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,4130921138.18275\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,4120492427.65644\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,4181034848.21719\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,4233522881.98342\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,4286696693.74812\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,4331686447.59428\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,4375442278.36351\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,4448598780.92761\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,4515149034.77376\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,4510715464.31922\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,4561375464.31922\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,4587139089.31922\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,4535018281.62691\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,4586463614.96024\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,4604941372.65255\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,4669254807.13531\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,4762657548.25206\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,4822740718.25206\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,4842733738.25206\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,4867988394.85583\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,4792885050.30137\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,4853959777.75235\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,4916841505.75235\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,4979608473.75235\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,4951673235.65712\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,4969737575.65712\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,4971749737.19558\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,5009996746.42634\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,4995389106.95266\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,4958383867.22664\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,5006027034.57358\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,5047794270.12913\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,5093480948.47965\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,5079537234.19393\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,5079537234.19393\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,5102388262.76536\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,4988264447.78409\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,5082758759.76014\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,5130058035.46107\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,5127118361.54802\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,5155958425.54802\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,5136536007.51524\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,5124151733.32169\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,5165991723.11761\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,5088736401.54898\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,5082192652.40612\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,4914755323.22463\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,4886264539.66299\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,4944168989.44076\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,4884878199.92111\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,4893765931.41282\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,4808679638.38957\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,4913108854.91849\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,4851196804.39218\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,4849371877.11945\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,4890748837.11945\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,4947977037.11945\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,4976668729.42714\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,5034049503.11136\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,5076932848.5659\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,5117335959.67701\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,5142638607.86978\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,5138635044.71189\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,5167879461.37855\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,5129374491.00818\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,5128615433.86533\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,5169667536.13805\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,5232657639.43476\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,5256338490.76219\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,5225965396.64454\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,5189663185.18621\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,5282508388.557\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,5280919070.37518\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,5236677820.37518\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,5291622247.64791\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,5355050355.08593\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,5323440428.16285\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,5344560532.41817\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,5424898132.41816\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,5430380398.22127\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,5517725198.22127\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,5458131965.30202\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,5396555568.93838\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,5295643296.4193\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,5389944045.26723\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,5247488790.59097\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,5299504395.66711\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,5358416311.97146\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,5291421833.27323\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,5168459402.504\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,5247626715.09659\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,5314237211.87079\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,5283126944.54405\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,5140246659.74405\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,5303452712.37563\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,5110188734.76369\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,4895554718.30799\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,4678650244.02228\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,4565575344.7417\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,4779802896.73477\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,4899048579.03754\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,4855795565.42252\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,4969058993.99395\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,5108769267.52336\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,4967829332.74075\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,4919989631.70982\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,5029819325.70982\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,5078772987.68165\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,5184198407.8\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,5202607713.83448\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,5292108494.37747\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,5394209144.85366\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,5377127945.72323\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,5406170221.0479\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,5457521182.45141\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,5549767441.71067\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,5592244142.72077\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,5649469311.95154\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,5682377857.40609\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,5718171378.91146\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,5736009101.13368\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,5764178586.84797\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,5808256461.04152\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,5846202411.04152\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,5885014923.84152\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,5945269202.27289\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,5910107915.17612\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,5940209048.50945\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,5910676395.9842\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,5948524465.84721\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,5925609634.59721\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,5889814151.83859\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,5940406185.17192\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,5975170904.21954\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,5996222896.52724\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,5994244857.3968\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,5953137079.77123\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,6066090525.86788\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,5930869513.081\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,5833645409.85519\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,5636966021.9764\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,5521209941.70973\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,5268001924.96964\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,5451938941.01902\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,5357376029.52731\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,5371525151.62033\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,5519719251.62033\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,5500826680.536\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,5464792861.18116\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,5443815164.51449\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,5475436321.141\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,5417360921.141\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,5301037974.71243\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,5292044752.49021\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,5164122710.1061\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,5059930687.62548\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,5129262748.49505\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,5240319230.06187\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,5162868366.14434\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,5097288722.86076\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,5018354894.69175\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,5174393926.31231\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,5014640044.52317\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,5201753050.33357\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,5263855327.58847\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,5334229852.58847\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,5493793597.88109\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,5405547885.47799\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,5485459025.24407\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,5464120556.33651\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,5314044967.29541\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,5457674110.94182\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,5301746347.78393\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,5455869380.15803\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,5578659672.33194\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,5523496172.33194\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,5598231795.86136\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,5540850112.24067\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,5511437567.86981\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,5583150490.82063\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,5615454056.25273\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,5705942458.23292\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,5789158013.78848\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,5839581620.34586\n"
  },
  {
    "path": "Tests/TestData/spy_ad_osc.txt",
    "content": "time,open,high,low,close,volume,AdOsc_3_10\n725898600,43.9688,43.96899,43.75,43.938,1003200,NaN\n728577000,43.96875,45.125,42.8125,44.40625,5417600,NaN\n730996200,44.5625,45.84375,44.21875,45.1875,3019200,NaN\n733674600,45.25,45.25,43.28125,44.03125,2697200,NaN\n736435800,44.09375,45.65625,43.84375,45.21875,1808000,NaN\n738941400,45.375,45.8125,44.21875,45.0625,3438000,NaN\n741533400,45.125,45.21875,44.15625,44.84375,6117600,NaN\n744298200,44.90625,46.5625,44.84375,46.5625,5440100,NaN\n746890200,46.40625,46.59375,44.8125,45.9375,4369900,NaN\n749482200,45.875,47.15625,45.71875,46.84375,6972900,6883511.035032505\n752164200,46.78125,47,45.53125,46.34375,5351100,6791452.187403276\n754756200,46.59375,47.15625,46.375,46.59375,6128000,5278467.005427383\n757607400,46.59375,48.3125,46.40625,48.21875,6837100,6141120.999788852\n760113000,48.15625,48.28125,46.5625,46.8125,10974400,3459698.865269972\n762532200,46.8125,47.3125,43.53125,44.59375,14705500,-1253.9258218351752\n765210600,43.34375,45.35937,43.34375,45.09375,11429000,1261074.0434857365\n767885400,45.09375,45.9375,44.17187,45.8125,8545100,3996758.042352926\n770477400,45.70312,46.5625,44,44.46875,10352701,2663655.663316399\n773069400,44.6875,46.04687,44.375,45.90625,5452100,3319085.046510728\n775747800,45.9375,47.98437,45.65625,47.65625,7945800,5101049.121922661\n778426200,47.5,47.71875,45.73437,46.17187,6309300,4243994.765961044\n781191000,46.20312,47.70312,45,47.48437,5437600,4957685.309149656\n783700200,47.28125,47.32812,44.60937,45.59375,4807300,4376999.217131186\n786292200,45.64062,46.40625,44.6875,45.5625,8568500,3791106.63082245\n789057000,45.70312,47.23437,45.6875,47.09375,2768000,3927377.4600426517\n791649000,47.15625,49.15625,47,49.01562,5954800,5273654.638374571\n794068200,48.96875,50.89062,48.21875,50.10937,4533300,5943876.555641908\n796915800,50.09375,51.67187,50.0625,51.59375,4388700,6938545.37905011\n799335000,51.54687,53.64062,51.39062,53.64062,6986200,8937560.317803454\n802013400,53.40625,55.15625,52.75,54.40625,5790900,9636784.49939397\n804778200,54.46875,56.70312,54.20312,56.15625,5508200,10032609.061445184\n807283800,56.23437,56.79687,55.42187,56.40625,8100100,10395427.628995918\n809962200,56.39062,58.90625,56.34375,58.48437,7431600,11184817.498681672\n812640600,58.48437,59.1875,57.26562,58.3125,8944800,10745481.698793314\n815236200,58.28125,61.20312,58.23437,60.90625,8841700,11839515.466129549\n817828200,60.98437,62.79687,60.57812,61.48437,9816800,10638841.702453144\n820506600,61.40625,63.6875,59.64062,63.67187,10661300,12546518.1813661\n823185000,63.60937,66.6875,63.4375,63.875,14850400,8733361.102055945\n825690600,64.64062,66,62,64.6875,19022900,8460120.9751058\n828369000,65,65.8125,62.125,65.39062,14999300,11259716.86748714\n830957400,65.375,68.4375,63.07812,66.875,17453200,13696618.900972456\n833808600,66.89062,68.5,66.15625,67.10937,16871800,12446280.624987423\n836227800,67.28125,67.70312,60.375,64.09375,28834400,10940238.956441715\n838906200,64.15625,67.34375,64.0625,65.32812,15593100,8195505.066323772\n841671000,64.46875,69.25,64.375,68.625,17216100,10400886.545805529\n844176600,68.70312,71.625,68.4375,70.84375,14791800,12756935.807311743\n846858600,70.98437,76.6875,70.26562,76.01562,24089700,18622097.92343813\n849537000,75.92187,76.57812,71.875,73.84375,34952800,17518122.74546157\n852129000,74.375,79.6875,72.75,78.40625,43623700,24227262.199887827\n854980200,78.71875,82,77.125,79.15625,30028800,23176995.413072392\n857399400,78.75,81.79687,75.6875,75.6875,37514299,8703973.371823147\n859905000,75.25,80.6875,73.3125,80.09375,57679302,17389362.109281942\n862493400,80.21875,85.5625,79.3125,85.15625,37473400,29734943.03739856\n865258200,85.34375,90.5,84.07812,88.3125,47332501,36882494.057561606\n867763800,88.5,96.03125,88.39062,95.3125,65361199,53337605.82719275\n870442200,95.5,96.625,89.34375,90.375,98208600,32823597.17823541\n873120600,90.6875,96.375,90.25,94.375,78642199,30128821.058887303\n875712600,95.25,98.5,84.375,92.0625,137490492,30158842.606479615\n878567400,93.1875,96.8125,90.09375,95.625,93157295,46592634.870497555\n880986600,96.21875,99,92.375,97.0625,79162298,59535253.6575163\n883665000,97.3125,99.5625,90.90625,98.3125,104582292,83083399.17405283\n886429800,99.90625,105.53125,99.71875,105.125,69737098,104251072.89397812\n888849000,105.25,111.53125,103.15625,109.9375,87316904,120641862.64792782\n891441000,110.3125,113.4375,107.625,111.34375,118629394,126932309.50987375\n894029400,111.75,113.3125,107.57812,109.03125,116264805,99721746.18873155\n896707800,108.96875,114.6875,107.5,113.3125,141993602,107418143.63268793\n899299800,114.0625,119.23437,111.3125,111.78125,155280205,57241072.053997815\n902151000,111.78125,112.42187,95,96,268542813,-44126099.97756797\n904656600,96.0625,107,93.625,101.75,269370500,-63159638.96278387\n907248600,100.03125,110.90625,92.21875,110,249152714,6382598.822337508\n910017000,110.8125,119.71875,110.1875,116.125,136368990,44921164.72226781\n912522600,116.125,124.75,113.75,123.3125,155694400,93194600.2602976\n915201000,123.375,128.29687,120.375,127.65625,141411495,142187978.56523466\n917879400,128.6875,128.84375,121.32812,123.5625,164624903,128069194.30554509\n920298600,123.65625,132.625,121.78125,128.375,148201191,120842660.53346503\n922977000,129.6875,137.5,128.125,133.25,156755704,111555824.2424506\n925738200,133.4375,138,128,130.20312,182568301,65121121.66584802\n928243800,130.125,137.5,128.01562,137,160691686,85943295.88776565\n930835800,137,142.25,132.5625,132.75,115627009,51282164.19491172\n933600600,132.75,138.78125,127,132.0625,142925894,26047358.51480353\n936192600,132.9375,136.625,125.5625,128.75,167972803,-9290477.11376679\n938784600,127.9375,137.6875,123.4375,137,196829408,33682255.180900574\n941466600,136.5,143,134.59375,139.39062,125040502,53820211.42276287\n944058600,139.3125,147.5625,139,146.875,121528096,89624285.54233134\n946909800,148.25,148.25,135,139.625,156696903,81072240.9038639\n949415400,139.75,144.5625,132.71875,137.4375,187179401,58103485.80600572\n951921000,137.625,155.75,135.03125,150.375,247591093,81329258.93238151\n954768600,150.125,153.10937,133.5,145.09375,230445599,96816530.6863898\n957187800,146.5625,148.48437,136.5,142.8125,160575597,97081888.87654579\n959866200,143.6875,149.15625,143,145.28125,125355706,78039025.19675529\n962631000,145.4375,151.98437,141.51562,142.90625,104381801,38765536.949379325\n965136600,143.625,153.09375,142.625,152.34375,101771692,46917077.30298543\n967815000,153.25,153.59375,142.125,143.625,106305804,21009880.481034636\n970493400,144.28125,145.75,130.15625,142.95312,178408898,44904802.164093256\n973089000,142.25,144.29687,129.75,132.28125,156699911,18090282.46235931\n975681000,133.1875,139.5625,125.53125,131.1875,165516296,-4728301.464539409\n978445800,132,138.7,127.5625,137.02,181296391,26649206.44595003\n981037800,137.10001,137.99001,121.8,123.95,178610414,-4673811.985673785\n983457000,124.05,127.75,108.03999,116.69,318192685,-29442121.03539467\n986218200,116.3,127.27,109.3,124.91,251951797,22211899.248792887\n988723800,125.07001,132.09,123.44,125.95,208067296,13541429.625881195\n991402200,126.2,129.23,120.39999,122.60001,203597000,-23736841.41657269\n994080600,122.8,124.32001,116.75,121.35001,196934304,-23336706.922585487\n996672600,121.97,123.25,112.03999,114.14999,269612609,-74543314.35405898\n999610200,113.85001,116.17,93.8,104.44,419269200,-95215038.63165879\n1001943000,103.89999,111.78999,102.83,105.8,512856186,-150016531.76146495\n1004625000,106.60001,116.89999,105.69901,114.05,373884200,-100372542.10161066\n1007389800,113.64999,118,112,114.3,308496493,-93842388.19667554\n1009981800,115.11,117.99001,108.39999,113.17999,349532800,-82987975.83656085\n1012573800,113.09,113.3,107.82001,111.14999,424644622,-41909926.436816216\n1014993000,111.72,117.907,111.50999,114.52,386559470,-28543715.361926317\n1017671400,114.23,115.10001,106.63,107.86,404594438,-111826206.63497221\n1020259800,107.97,111.25,104.89999,107.22,452683820,-174517592.86488026\n1023111000,107.09,107.60001,95.19501,98.96001,535607808,-251271888.36398405\n1025530200,99.187,99.8,77.67999,91.16,1124766080,-181521848.31419575\n1028208600,90.88,97.14999,83.55,91.78,937002640,-73788989.31515348\n1031059800,90.735,93.33,80.00999,81.78999,1014628128,-259561098.49876988\n1033479000,82.438,91.28999,77.07001,88.52,1346309520,-50480787.173305154\n1036161000,88.35001,94.95,87.45,93.98,819210480,232875604.97013998\n1038839400,95.47,96.05,87.11,88.23,729006392,153785914.66200268\n1041517800,88.85001,93.86,84.14999,86.06,919194016,-69959223.45579123\n1044282600,86.14,86.817,81,84.89999,863461696,-61474942.99771023\n1046701800,85.25999,89.88,79.383,84.74001,1158049760,-44797536.92750555\n1049207400,85.25,92.8,84.91,91.91,998705472,212177925.54052806\n1051795800,91.92,97.09,90.5,96.95,884710416,567553623.5338714\n1054560600,97.53,102.179,96.67,97.63,871557632,480674584.8482138\n1057066200,97.25301,101.89999,96.42999,99.39,921051712,425545839.6870476\n1059744600,99.19,101.81799,96.34,101.44,777481327,577548324.8828259\n1062509400,101.64,104.7,99.25,99.95,821365600,393017302.344295\n1065015000,100.24001,105.97,100.2,105.3,833865824,485502441.25055695\n1067869800,105.75,106.95,103.62,106.45,631337401,619756418.381351\n1070289000,106.92999,111.52,105.96001,111.28,679228295,815797390.4932542\n1073053800,111.74001,116.5,110.73,113.48,746542832,810717351.4433017\n1075732200,113.7,116.60001,112.78,115.02,676247904,772112847.5523305\n1078151400,115.42999,116.97,108.85001,113.10001,1126366352,702900393.6970072\n1080829800,113.07001,115.41,110.89999,110.96001,969151488,310527376.9400306\n1083591000,111.37,113.25999,108.06,112.86,984820576,386926494.99739504\n1086096600,112.46001,114.94,111.87,114.53,726798816,552491498.0273185\n1088688600,114.25,114.39999,108.21001,110.84,956346304,524278449.2565503\n1091453400,110.19,113.61,106.59,111.11,924459360,549715418.3157372\n1094045400,110.94,113.74001,110.41,111.75999,792619408,462432231.5110054\n1096637400,112.25999,114.67999,109.35001,113.2,1046489408,532744549.14252853\n1099319400,113.56,119.14,113.2,117.89,964579904,690817516.2766576\n1101911400,118.16,121.66,117.73,120.87,911529680,866111043.9842644\n1104762600,121.56,121.75999,116.37,118.16,1191128848,731815756.8417878\n1107268200,118.25,121.67,118.10001,120.63,1029653952,747084112.4029589\n1109687400,120.78,123.25,116.25,117.96001,1342371888,466974224.38670254\n1112365800,118.63,119.25999,113.55,115.75,1668289744,188150631.394619\n1115040600,116.07001,120.25,114.8,119.48,1346291376,364304558.35589504\n1117632600,119.52,121.94,118.75,119.17999,1106029664,146202784.29996395\n1120224600,119.45,124.64,118.25999,123.74001,1186572224,314717629.4208441\n1122903000,123.83,124.74001,120.38,122.58,1314950080,358882328.3953829\n1125581400,122.50999,124.74001,120.44,123.03999,1286806880,430017424.46435547\n1128346200,122.96001,123.34,116.88,120.13,1793909760,423559952.5685673\n1130855400,120.58,127.41,120.13,125.41,1185290624,552332094.5455256\n1133447400,126.02,128.57001,124.36,124.50999,1073662416,237521516.15624046\n1136298600,125.10001,129.44,124.39,127.5,1231803008,177947785.5941267\n1138804200,127.82001,130.03999,123.64,128.23,1145400544,295706528.8882351\n1141223400,128.60001,131.47,127.17999,129.83,1353312576,418375477.8383579\n1144071000,130.07001,131.86,128.02,131.47,1300735968,760327178.1280994\n1146490200,131.47,132.8,124.75999,127.50999,1752940720,654889559.7800732\n1149168600,127.38,129.42999,122.34,127.23,2165461536,813637741.8065853\n1151933400,127.42999,128.14,122.39,127.85001,1694694704,1289445038.123702\n1154439000,127.34,131.03999,126.28,130.64,1421706336,1743206972.4105692\n1157117400,131.14,133.99001,129.35001,133.58,1363903440,2127638053.0430918\n1159795800,133.53999,139,132.34,137.78999,1447946224,2384787256.717865\n1162391400,138.22,141.16,135.62,140.53,1503703824,2642819608.685623\n1164983400,140.53,143.24001,138.97,141.62,1213057024,2601224330.5769844\n1167834600,142.25,144.13,140.25,143.75,1341399312,2690940275.483839\n1170340200,144.14999,146.42,139,140.92999,1496040016,2254626568.4780655\n1172759400,139.34,143.81,136.75,142,2921814320,2324151347.8724937\n1175520600,142.16,149.8,140.89,148.28999,1795352592,2518932242.9819126\n1178026200,148.42,153.89,147.67,153.32001,2518567104,3024112864.314604\n1180704600,153.88,154.39999,148.06,150.42999,3504277296,2674468773.5017586\n1183383000,150.87,156,145.03999,145.72,3986976272,1177133295.040678\n1185975000,145.17999,150.59,137,147.59,6241314848,1566682671.4018383\n1188912600,147.45,154.39,144.33,152.58,2966242944,2187803117.3744354\n1191245400,152.60001,157.52,148,154.64999,3849026960,2729278207.8726616\n1193923800,153.28999,153.41,140.66,148.66,5472105872,3146490617.5764694\n1196692200,148.19,152.89,143.96001,146.21001,3293357632,2511288209.66066\n1199284200,146.53,146.99001,126,137.37,6108104832,2185167232.2609596\n1201876200,137.94,139.61,131.73,133.82001,4151825440,1232822787.5328903\n1204554600,133.14,135.81,126.07001,131.97,5469219488,1099202950.0150833\n1207056600,133.71001,140.59,132.33,138.25999,4014862304,1501370221.2276802\n1209648600,138.39,144.3,137.52,140.35001,3650158528,1337552407.1503067\n1212413400,139.83,140.89,127.035,127.98,5410561968,-337761582.41156006\n1214919000,126.52,129.16,120.02,126.83,7159685632,124197311.38515472\n1217597400,127.12,131.50999,124.75999,128.78999,4344520064,570167601.4951248\n1220362200,130.03,130.71001,110.5321,115.99001,8107003920,-483269379.9926529\n1222867800,115.27,116.69,83.58,96.83,11889533952,-1625522920.1610603\n1225722600,96.78,100.86,74.34,90.09,8769751872,-1421049090.845501\n1228141800,87.50999,92.42999,81.86,90.24001,6931852880,83429701.20951843\n1230906600,90.44,94.5533,80.05,82.83,6877054976,-657987164.280735\n1233585000,81.57001,87.74001,73.81,73.92999,7275971696,-3176675753.5506973\n1236004200,72.52,83.3,67.10001,79.52,8816279040,-2422164624.3698463\n1238592600,78.53,89.02,78.33,87.42,6209519408,-508981113.9992466\n1241184600,87.44,93.7,86.72,92.53,5197050848,1419201850.4182472\n1243863000,93.67,96.11,87.53,91.95,5054958784,2127724894.209423\n1246455000,92.34,99.83,87,98.81,4295911760,3373689431.564888\n1249306200,99.85001,104.35001,98.11501,102.46001,3957917616,4072560956.1916122\n1251811800,101.95,108.06,99.57001,105.59,3777979120,4490867602.59005\n1254403800,105.34,110.31,101.99001,103.56,4482108064,3365829454.034401\n1257172200,104.13,111.74001,103.08,109.94,3431132192,3237489554.201515\n1259677800,110.92,113.03,105.476,111.44,2883949808,3422000268.6118736\n1262615400,112.37,115.14,107.22,107.39,3706906128,2057554678.1428566\n1265034600,108.14999,111.58,104.58,110.74001,4451911072,2388879054.0862427\n1267453800,111.2,118.1666,111.17,117,3899883248,3134320629.279598\n1270128600,117.8,122.12,117.10001,118.8125,4011095920,2748828192.7900047\n1272893400,119.38,120.67999,104.38,109.369,7414147200,1426271327.179016\n1275399000,108.35001,113.2,102.88,103.22,5706511392,-940504177.5914345\n1277991000,103.14999,112.28999,101.13,110.27,4723083696,-864452717.4243279\n1280755800,111.99001,113.17999,104.28999,105.31,4542294160,-1868377057.3723946\n1283347800,106.73,115.78999,106.66,114.13,4047505280,-1289682417.2472992\n1285939800,114.99001,119.75999,113.17999,118.49001,3767748128,-199633444.95869827\n1288618200,119.07001,122.95,117.59,118.49249,3984612496,-576444900.6536598\n1291213800,120.2,126.2,120.19,125.75,2722825728,58425862.906139374\n1294065000,126.71001,130.35001,125.6969,128.67999,2860494448,569673312.7310257\n1296570600,129.46001,134.69,129.3801,133.14999,2820163184,1103860887.0822906\n1298989800,133.57001,133.69,125.28,132.59,4791180688,2347717453.341522\n1301664600,133.41,136.57001,129.50999,136.42999,2814799696,3503231854.824135\n1304343000,137.07001,137.17999,131.38,134.89999,3339322704,3884622917.002327\n1306935000,134.50999,134.9234,126.19,131.97,4712655888,4172812181.447357\n1309527000,132.09,135.7,127.96671,129.33,3840979200,3120126291.7255287\n1312205400,130.84,130.96001,110.27,122.22,9050591824,2852615858.435814\n1314883800,122.28999,123.39999,111.3,113.14999,6188596240,1116870618.733223\n1317648600,112.49001,129.42,107.42999,125.5,5717906608,1475954255.968235\n1320154200,122.03,128.02,116.2,124.99001,5014599984,2266206263.8010635\n1322749800,124.85001,127.25999,120.03,125.5,3848635120,3011848268.6335907\n1325601000,127.75999,133.39999,126.42999,131.32001,2883820288,3413012417.799057\n1328106600,132.28999,138.19,132.13,137.02,2895247792,3832349611.7342606\n1330612200,137.31,141.83,134.36,140.81,3057517472,4362670747.548256\n1333373400,140.64,142.21001,135.75999,139.87,3035647424,4448070636.547646\n1335879000,139.78999,141.66,129.55,131.47,4004216000,3208566841.2051773\n1338557400,129.41,136.27,127.13499,136.105,3644913504,3527658906.2554474\n1341235800,136.48,139.339,132.60001,137.71001,2864744432,3808338517.405693\n1343827800,138.7,143.09,135.58,141.16,2413591520,3950192734.3419647\n1346765400,141.03999,148.11,140.13,143.97,2391232576,3620512314.033615\n1349098200,144.52,147.16,140.39,141.35001,2719914704,2536519510.527878\n1351776600,141.64999,143.72,134.7,142.155,3032767968,2492595279.335182\n1354545000,142.8,145.58,139.53999,142.41,2890499968,2202347614.2960052\n1357137000,145.11,150.94,144.73,149.7,2587139376,2377835169.1105576\n1359729000,150.64999,153.28,148.73,151.61,2581458448,2451889798.3344345\n1362148200,151.09,156.85001,150.41,156.67,2331212384,2959568705.189331\n1364823000,156.59,159.72,153.55,159.67999,2907033824,3811173072.420807\n1367415000,159.33,169.07001,158.10001,163.44501,2781594944,3790496167.960762\n1370266200,163.83,165.99001,155.73,160.42,3533328608,3341019749.970726\n1372685400,161.25999,169.86,160.22,168.71001,2331129456,3418171405.0214233\n1375363800,169.99001,170.9725,163.05,163.64999,2283239616,2522542225.115074\n1378215000,165.23,173.60001,163.7,168.00999,2246638784,1834400668.861412\n1380634200,168.14,177.51,164.53,175.79,2901740429,2064714746.0550842\n1383312600,176.02,181.75,174.76,181,1930952423,2453782557.618965\n1385994600,181.09,184.69,177.32,184.69,2232670202,3100270585.020653\n1388673000,183.98,184.94,176.88,178.18,2530649614,2537437579.325325\n1391437800,177.95,187.15,173.71,186.29,2394183674,2740806850.543495\n1393857000,184.69,189.0239,183.75,187.01,2554082542,2766852403.22435\n1396359000,187.62,189.7,181.31,188.31,2345900090,3025073298.7229233\n1398951000,188.22,192.8,186.01,192.68,1780157245,3402095612.3560104\n1401715800,192.95,196.6,191.97,195.72,1675360233,3577484396.1734467\n1404221400,196.19,199.06,192.97,193.09,1893838621,2745170675.9591675\n1406899800,192.56,200.82,190.55,200.71,1829884873,2724881386.6431656\n1409664600,200.97,201.899,196.05,197.02,2106580212,2020906617.9896927\n1412170200,196.7,201.82,181.92,201.66,3943067853,2783635981.7867584\n1415025000,201.92,207.87,200.06,207.2,1571225009,3256762705.121628\n1417444200,206.4,212.97,197.86,205.54,3045170843,3170276281.7198486\n1420209000,206.38,206.88,198.55,199.45,3183506003,2052636047.0095139\n1422887400,200.05,212.24,197.86,210.66,1901638015,1880919767.485855\n1425306600,210.78,212.06,204.12,206.43,2749923019,1273820716.6271667\n1427895000,206.39,212.48,204.51,208.46,2036685271,903968469.9982071\n1430487000,209.4,213.78,206.76,211.14,1892519799,819740995.8401413\n1433165400,211.94,213.34,205.28,205.85,2535242753,18188746.890846252\n1435757400,207.73,213.18,204.11,210.5,2452757863,7852311.849143982\n1438608600,210.46,211.31,182.4,197.67,3734926751,69913342.20085144\n1441114200,193.12,202.89,186.93,191.63,3279512870,-339953422.64801025\n1443706200,192.08,209.44,189.12,207.93,2536184532,210313264.82079315\n1446474600,208.32,211.66,202.18,208.69,1924512621,644963423.1551666\n1448980200,209.44,211,199.83,203.87,2924884742,506693872.30713654\n1451917800,200.49,201.9,181.02,193.7208,3712951064,659898780.4706116\n1454337000,192.53,196.68,181.09,193.56,2920730619,1219938303.7748718\n1456842600,195.01,206.87,194.4542,205.52,2323306273,1916618347.9980316\n1459517400,204.35,210.92,203.09,206.3308,1910635495,1922694587.8479767\n1462195800,206.92,210.69,202.78,209.84,1834562512,2208661554.4713593\n1464787800,209.12,212.52,198.65,209.475,2630619705,2594361672.6363373\n1467379800,209.36,217.54,207.06,217.12,1648453879,2998764354.115265\n1470058200,217.19,219.6,214.25,217.38,1519703229,2973834193.4772797\n1472736600,217.37,219.22,212.31,216.3,2303701186,2806789900.878998\n1475501400,215.82,216.7,211.21,212.55,1725687191,2202248762.8105774\n1478007000,212.93,221.82,208.38,220.38,2073824327,2273188127.8225403\n1480602600,220.73,228.34,219.15,223.53,1821910161,2068431215.695465\n1483453800,225.04,229.71,223.8837,227.53,1482408638,1915333991.5344086\n1485959400,228.255,237.31,226.82,236.47,1365136521,2043379546.498581\n1488378600,238.39,240.32,231.61,235.74,1920309810,1878432481.7461395\n1491226200,235.8,239.53,232.51,238.08,1547966288,1929253513.5458221\n1493645400,238.68,242.08,235.43,241.44,1494800517,2158728007.4424896\n1496323800,241.97,245.01,239.955,241.8,1572752876,1921227316.9866486\n1499088600,242.88,248,240.34,246.77,1062993341,1879015457.955902\n1501594200,247.46,248.91,241.83,247.49,1557031716,1987619096.8155975\n1504272600,247.92,251.32,244.95,251.23,1286405280,2249099902.472763\n1506951000,251.49,257.89,251.2926,257.15,1320939683,2477618678.1097717\n1509543000,258.04,266.05,255.63,265.01,1365510885,2693616946.272949\n1512138600,264.76,268.6,260.76,266.86,1715245330,2840614926.071396\n1514903400,267.84,286.6285,267.4,281.9,1996090155,2965266525.912857\n1517495400,281.07,283.06,252.92,271.65,2923721955,2972623465.8977356\n1519914600,271.41,280.41,257.83,263.15,2336204952,2312327531.7154846\n1522675800,262.55,271.3,254.67,264.51,2000511426,1948736028.8760986\n1525181400,263.87,274.25,259.05,270.94,1606397229,1911353626.6855469\n1527859800,272.41,279.48,268.49,271.28,1600959131,1471543185.7632751\n1530538200,269.51,284.37,269.24,281.33,1266961027,1398972424.8393707\n1533130200,281.56,291.74,279.16,290.31,1308405597,1563769754.8694153\n1536067800,289.84,293.94,286.71,290.72,1228220740,1531727206.7859497\n1538400600,292.11,293.21,259.85,270.63,3024380821,1038988012.2035065\n1541079000,271.6,281.22,263.07,275.65,2021061342,991327776.2253265\n1543847400,280.28,280.4,233.76,249.92,3102621849,578607783.861908\n1546439400,245.98,270.47,243.67,269.93,2048691645,982754670.5524597\n1549031400,270.15,281.31,267.83,278.68,1371716235,1324893146.8712616\n1551450600,280.44,285.18,272.42,282.48,1678081316,1652389082.0116577\n1554125400,284.7,294.45,284.4,294.02,1209205254,1987970994.1547394\n1556717400,294.72,294.95,275.24,275.27,1845593139,1359083310.321045\n1559568600,275.31,296.3093,273.09,293,1340435548,1283186938.8893585\n1561987800,296.68,302.23,294.33,297.43,1135591780,1057731657.9615784\n1564666200,297.6,300.87,281.72,292.45,2042337708,947729902.8477173\n1567517400,290.57,302.63,289.27,296.77,1327491505,868421412.2326508\n1569936600,297.74,304.55,284.82,303.33,1413292562,1151101413.0934448\n1572615000,304.92,315.48,304.74,314.31,1040540652,1421043773.291336\n1575297000,314.59,323.8,307.13,321.86,1290527668,1717337591.8412476\n1577975400,323.54,332.95,320.36,321.73,1395481259,1335043055.085083\n1580740200,323.35,339.08,285.54,296.26,2111278757,654521106.7391357\n1583159400,298.21,313.84,218.26,257.75,5926710263,-10890341.895523071\n1585747800,247.98,294.88,243.9,290.48,2820700910,460458894.06484985\n1588339800,285.31,306.84,276.37,304.32,1911784390,1119101486.2374878\n1591018200,303.62,323.41,296.74,308.36,2359695855,1190248520.0936127\n1593610200,309.57,327.23,309.07,326.52,1505575853,1552738066.0942688\n1596461400,328.32,351.3,327.73,349.31,1045783672,1836432959.2535095\n1598967000,350.21,358.75,319.8,334.89,1815146487,1655500848.6620636\n1601559000,337.69,354.02,322.6,326.54,1629406916,1042559862.6348572\n1604327400,330.2,364.38,327.24,362.06,1535878617,1124668572.6528778\n1606833000,365.57,378.46,362.03,373.88,1345460099,1245443402.761612\n1609770600,375.31,385.85,364.82,370.07,1401795392,958298121.6268768\n1612189800,373.72,394.17,370.376,380.36,1308321421,686774420.687973\n1614609000,385.59,398.12,371.88,396.33,2401881132,1173230605.4620972\n1617283800,398.4,420.72,398.18,417.3,1462169842,1589633226.226883\n1620048600,419.43,422.815,404,420.04,1527034281,1958020170.025467\n1622554200,422.57,428.78,414.7,428.06,1282152407,2296956735.436096\n1625146200,428.87,441.8,421.97,438.51,1422104622,2529141461.039963\n1627911000,440.34,453.07,436.1,451.56,1254225343,2722256628.7094574\n1630503000,452.56,454.05,428.78,429.14,1745953627,2014078051.467575\n1633095000,430.98,459.56,426.36,459.25,1508665331,2012336093.486374\n1635773400,460.3,473.54,455.3,455.56,1335351505,1415912196.973297\n1638369000,461.64,479,448.92,474.96,1928105447,1491896063.9402618\n1641220200,476.3,479.98,420.76,449.91,2486044024,1375064824.5619812\n1643725800,450.68,458.12,410.64,436.63,2298151885,1271567948.773117\n1646145000,435.04,462.07,415.12,451.64,2381034599,1534628761.592331\n1648819800,453.31,457.83,411.21,412,1856757204,931968821.2962189\n1651498200,412.07,429.66,380.54,412.93,2418478176,846031834.1801453\n1654090200,415.17,417.44,362.17,377.25,1958752717,450816643.03707886\n1656682200,376.56,413.03,371.04,411.99,1437748370,682958936.1802063\n1659360600,409.15,431.73,395.04,395.18,1443534308,260037891.06254578\n1662039000,392.89,411.73,357.04,357.18,1998908806,-569375255.0028687\n1664803800,361.08,389.52,348.11,386.21,2024731829,-315676526.62306213\n1667309400,390.14,407.68,368.79,407.68,1746114943,372389210.1798706\n1669905000,408.77,410.49,374.77,382.43,1735973711,304562224.9937744\n1672756200,384.37,408.16,377.831,406.48,1575449950,694872595.1522522\n1675261800,405.211,418.31,393.64,396.26,1603224252,389608688.17459106\n1677681000,395.41,409.7,380.65,409.39,2516901521,1013049555.6944733\n1680528600,408.85,411.92,405.678,409.61,392979051,1208489788.6275177\n"
  },
  {
    "path": "Tests/TestData/spy_adr.csv",
    "content": "date,open,high,low,close,adr\n19980102 00:00,973100,975300,965300,973600,\n19980105 00:00,978400,984400,967800,977500,\n19980106 00:00,972500,972800,961900,966300,\n19980107 00:00,960900,965000,952200,964700,\n19980108 00:00,963100,963100,955000,957800,\n19980109 00:00,952500,955000,919100,924700,\n19980112 00:00,911300,941900,909100,940600,\n19980113 00:00,946300,956300,942200,952200,\n19980114 00:00,956900,959700,947200,958100,\n19980115 00:00,955000,957500,948100,949400,\n19980116 00:00,962500,966900,956600,962300,\n19980120 00:00,966900,980000,965000,980000,\n19980121 00:00,972200,976900,961600,971600,\n19980122 00:00,961600,968800,958800,963000,\n19980123 00:00,965000,967800,950000,956600,\n19980126 00:00,963800,967300,937500,957500,\n19980127 00:00,958100,980000,956600,970000,\n19980128 00:00,974100,981100,971700,978800,\n19980129 00:00,978400,995600,975600,987500,\n19980130 00:00,987800,989700,980000,983100,16190.0\n19980202 00:00,999100,1005000,997500,1002500,16065.0\n19980203 00:00,1000000,1008100,997200,1006900,15780.0\n19980204 00:00,1002800,1011600,998800,1005900,15875.0\n19980205 00:00,1013100,1015900,1000300,1003800,16015.0\n19980206 00:00,1010000,1015000,1006900,1012800,16015.0\n19980209 00:00,1017200,1017500,1007200,1011400,14735.0\n19980210 00:00,1014400,1024700,1011900,1020500,13735.0\n19980211 00:00,1020900,1031900,1017000,1021300,13775.0\n19980212 00:00,1017200,1029400,1008800,1026600,14180.0\n19980213 00:00,1021900,1029400,1018800,1021600,14240.0\n19980217 00:00,1028100,1030900,1021600,1023400,14190.0\n19980218 00:00,1023100,1034700,1022800,1034100,14035.0\n19980219 00:00,1032500,1034100,1027500,1030000,13600.0\n19980220 00:00,1030800,1037500,1023800,1035600,13785.0\n19980223 00:00,1042500,1042500,1033400,1040000,13350.0\n19980224 00:00,1039100,1040900,1029400,1031900,12435.0\n19980225 00:00,1037500,1048800,1036300,1044800,11890.0\n19980226 00:00,1044400,1051600,1041900,1050600,11905.0\n19980227 00:00,1049700,1055300,1043100,1052000,11515.0\n19980302 00:00,1052500,1057500,1046300,1048100,11590.0\n19980303 00:00,1045300,1054700,1045000,1054100,11700.0\n19980304 00:00,1050900,1054100,1040600,1049700,11830.0\n19980305 00:00,1035000,1044400,1031600,1037500,11830.0\n19980306 00:00,1045600,1058800,1044400,1057500,11770.0\n19980309 00:00,1055300,1062200,1052500,1054400,11850.0\n19980310 00:00,1062200,1068400,1053800,1066600,12065.0\n19980311 00:00,1069700,1073100,1067300,1072500,11715.0\n19980312 00:00,1070900,1075900,1065000,1072500,11515.0\n19980313 00:00,1078400,1080000,1068800,1072200,11045.0\n19980316 00:00,1078400,1082800,1075300,1082500,10890.0\n19980317 00:00,1083100,1085000,1076600,1084700,10845.0\n19980318 00:00,1082500,1089400,1080000,1087800,10720.0\n19980319 00:00,1089700,1093800,1086600,1093400,10750.0\n19980320 00:00,1095600,1101900,1088800,1100000,10720.0\n19980323 00:00,1097200,1103100,1094100,1095000,10715.0\n19980324 00:00,1100600,1108100,1099400,1105900,10575.0\n19980325 00:00,1114100,1115300,1091900,1101900,11120.0\n19980326 00:00,1098800,1107500,1096300,1101300,11195.0\n19980327 00:00,1107500,1107800,1090000,1095300,11475.0\n19980330 00:00,1096300,1100900,1089700,1093400,11475.0\n19980331 00:00,1101600,1111900,1097500,1100900,11710.0\n19980401 00:00,1103100,1110800,1094100,1109800,11870.0\n19980402 00:00,1109400,1122500,1107500,1120300,11980.0\n19980403 00:00,1123400,1128100,1118400,1121900,11745.0\n19980406 00:00,1132500,1133800,1120600,1122500,11920.0\n19980407 00:00,1117500,1119400,1101600,1110000,12080.0\n19980408 00:00,1112200,1112800,1097500,1101300,12555.0\n19980409 00:00,1105600,1112800,1105300,1110000,12385.0\n19980413 00:00,1113800,1113800,1100000,1110000,12515.0\n19980414 00:00,1111300,1117200,1109100,1116900,12545.0\n19980415 00:00,1119700,1121300,1111600,1120200,12610.0\n19980416 00:00,1113100,1115000,1105000,1109100,12640.0\n19980417 00:00,1107200,1124100,1104400,1122200,13265.0\n19980420 00:00,1120000,1125600,1118800,1124100,12950.0\n19980421 00:00,1124400,1131600,1119100,1126300,13125.0\n19980422 00:00,1128800,1134400,1128100,1130000,13005.0\n19980423 00:00,1126300,1130000,1117500,1120900,12460.0\n19980424 00:00,1117500,1124700,1103400,1108800,12965.0\n19980427 00:00,1093800,1106600,1076300,1085900,13590.0\n19980428 00:00,1097800,1098100,1081300,1086300,13870.0\n19980429 00:00,1090300,1099700,1084400,1095300,13915.0\n19980430 00:00,1105600,1119200,1104100,1114400,13835.0\n19980501 00:00,1117500,1123100,1113100,1121900,13585.0\n19980504 00:00,1127200,1133100,1121600,1122500,13675.0\n19980505 00:00,1120000,1121600,1111300,1116600,13530.0\n19980506 00:00,1121300,1121300,1104700,1105000,13470.0\n19980507 00:00,1105000,1105600,1094100,1095900,13280.0\n19980508 00:00,1100000,1113800,1100000,1110000,13595.0\n19980511 00:00,1115600,1122200,1103800,1108600,13825.0\n19980512 00:00,1108100,1118800,1102500,1116400,14235.0\n19980513 00:00,1120600,1125600,1115900,1120600,14235.0\n19980514 00:00,1115300,1126900,1113400,1119700,14410.0\n19980515 00:00,1120000,1122200,1108100,1110000,14130.0\n19980518 00:00,1107200,1115900,1098300,1108400,14670.0\n19980519 00:00,1110000,1116900,1107800,1110600,14500.0\n19980520 00:00,1120900,1125000,1108800,1122800,14995.0\n19980521 00:00,1123800,1127800,1113100,1116900,15105.0\n19980522 00:00,1117500,1120600,1109400,1111600,14600.0\n19980526 00:00,1120900,1120900,1094400,1095300,14410.0\n19980527 00:00,1093100,1099100,1075800,1096300,14735.0\n19980528 00:00,1098800,1103800,1087300,1100000,14795.0\n19980529 00:00,1106300,1108100,1093800,1093800,14755.0\n19980601 00:00,1089700,1102200,1085600,1095000,15085.0\n19980602 00:00,1100000,1103400,1091600,1095900,15100.0\n19980603 00:00,1098800,1101900,1082200,1085000,15570.0\n19980604 00:00,1082500,1100600,1080600,1099100,15740.0\n19980605 00:00,1103800,1118800,1098800,1118100,16165.0\n19980608 00:00,1119400,1124700,1116600,1118800,15880.0\n19980609 00:00,1117200,1124200,1114100,1122800,15465.0\n19980610 00:00,1116300,1130600,1112500,1113800,15555.0\n19980611 00:00,1114400,1118800,1092800,1096600,16370.0\n19980612 00:00,1098800,1104400,1082500,1102500,16790.0\n19980615 00:00,1088100,1099100,1078800,1080000,17100.0\n19980616 00:00,1084100,1091600,1077500,1090600,16925.0\n19980617 00:00,1101600,1117800,1099400,1112500,17390.0\n19980618 00:00,1111900,1114400,1107500,1111600,16925.0\n19980619 00:00,1110600,1112300,1096300,1100300,16990.0\n19980622 00:00,1102500,1110600,1100600,1103800,16930.0\n19980623 00:00,1110900,1121900,1110000,1119700,16200.0\n19980624 00:00,1121600,1136900,1116100,1134700,16075.0\n19980625 00:00,1139100,1144700,1128100,1130000,16080.0\n19980626 00:00,1133100,1138400,1131300,1134100,15720.0\n19980629 00:00,1142500,1146900,1138000,1138900,15335.0\n19980630 00:00,1139100,1141900,1130600,1133600,15310.0\n19980701 00:00,1140600,1149400,1136300,1149400,14980.0\n19980702 00:00,1147200,1148800,1142500,1146300,14295.0\n19980706 00:00,1147800,1158400,1145600,1157800,13935.0\n19980707 00:00,1159800,1161300,1152800,1155600,13955.0\n19980708 00:00,1158800,1169400,1157500,1168100,14045.0\n19980709 00:00,1162800,1167200,1156300,1160000,13685.0\n19980710 00:00,1160300,1169100,1150600,1165300,13310.0\n19980713 00:00,1165600,1168400,1160600,1167500,12605.0\n19980714 00:00,1169400,1181600,1169400,1178100,12200.0\n19980715 00:00,1180600,1182800,1174400,1175600,11915.0\n19980716 00:00,1176900,1185900,1170600,1184400,11760.0\n19980717 00:00,1186300,1190000,1183100,1187500,11760.0\n19980720 00:00,1187500,1192300,1179400,1185000,11605.0\n19980721 00:00,1190000,1190000,1162800,1165300,12465.0\n19980722 00:00,1163400,1195900,1155300,1166300,13900.0\n19980723 00:00,1163100,1168400,1138800,1141900,14340.0\n19980724 00:00,1149700,1150900,1128800,1141600,14615.0\n19980727 00:00,1136300,1150000,1128400,1149800,15340.0\n19980728 00:00,1144400,1146600,1118800,1133100,16285.0\n19980729 00:00,1137200,1141300,1122500,1126600,16660.0\n19980730 00:00,1136300,1145900,1134100,1143400,16595.0\n19980731 00:00,1143400,1145000,1113100,1120600,17875.0\n19980803 00:00,1117800,1124200,1110300,1113800,17930.0\n19980804 00:00,1122200,1122200,1072500,1076100,19990.0\n19980805 00:00,1079400,1088800,1055900,1081600,21040.0\n19980806 00:00,1081300,1095200,1075600,1090900,21475.0\n19980807 00:00,1096900,1105900,1084700,1090300,21610.0\n19980810 00:00,1087500,1096600,1081900,1085900,21955.0\n19980811 00:00,1067800,1074400,1055000,1070600,22315.0\n19980812 00:00,1077500,1088100,1075000,1085000,22550.0\n19980813 00:00,1088100,1096600,1076300,1076400,22800.0\n19980814 00:00,1083400,1087200,1057800,1064800,23925.0\n19980817 00:00,1060000,1089400,1055000,1085000,25000.0\n19980818 00:00,1090000,1105900,1087800,1102500,24545.0\n19980819 00:00,1110900,1110900,1096300,1100000,23245.0\n19980820 00:00,1096900,1104100,1091600,1092500,22390.0\n19980821 00:00,1081900,1087200,1055000,1083800,22895.0\n19980824 00:00,1092500,1099400,1083100,1090600,22630.0\n19980825 00:00,1103800,1112500,1086400,1095000,22545.0\n19980826 00:00,1082800,1096300,1077500,1085000,22545.0\n19980827 00:00,1070000,1078400,1038900,1042500,23930.0\n19980828 00:00,1049700,1057200,1021600,1030000,24115.0\n19980831 00:00,1037500,1040200,950000,962500,27930.0\n19980901 00:00,960600,1005600,936300,996900,28910.0\n19980902 00:00,998100,1017500,987800,990000,28750.0\n19980903 00:00,976300,993800,966900,985200,29115.0\n19980904 00:00,994400,998100,957800,976300,30070.0\n19980908 00:00,1008800,1029700,998100,1025900,30915.0\n19980909 00:00,1027500,1031300,1004800,1007500,31270.0\n19980910 00:00,984400,993400,968100,982500,31880.0\n19980911 00:00,981900,1015000,970000,1012500,33115.0\n19980914 00:00,1028800,1044500,1020900,1031600,32825.0\n19980915 00:00,1028800,1043100,1022800,1042000,32120.0\n19980916 00:00,1047500,1052500,1031600,1050000,32260.0\n19980917 00:00,1022500,1030300,1017800,1022300,32155.0\n19980918 00:00,1023800,1024100,1010900,1019700,32190.0\n19980921 00:00,996300,1034100,989400,1021900,32815.0\n19980922 00:00,1035000,1036600,1021600,1030000,32750.0\n19980923 00:00,1038800,1070000,1037800,1066300,33055.0\n19980924 00:00,1063100,1068100,1032500,1043800,33895.0\n19980925 00:00,1031300,1054200,1026300,1043000,33315.0\n19980928 00:00,1053100,1063100,1042500,1049100,32565.0\n19980929 00:00,1053800,1059400,1033800,1049400,29335.0\n19980930 00:00,1035000,1043100,1013800,1018400,27335.0\n19981001 00:00,1000300,1015500,980900,986300,27580.0\n19981002 00:00,988800,1008800,972200,1003100,28065.0\n19981005 00:00,995900,1000000,963400,990000,27880.0\n19981006 00:00,1007500,1012800,975300,985300,28175.0\n19981007 00:00,986300,1000300,957500,972200,28990.0\n19981008 00:00,945600,967500,922200,962200,29990.0\n19981009 00:00,970000,995600,940600,986300,30490.0\n19981012 00:00,1006300,1014400,996900,997800,30185.0\n19981013 00:00,995600,1004100,987500,995300,30000.0\n19981014 00:00,989400,1018100,988400,1005000,30440.0\n19981015 00:00,1001300,1072500,999400,1050300,33470.0\n19981016 00:00,1061300,1067500,1050000,1056600,33685.0\n19981019 00:00,1056900,1068100,1055000,1063400,32105.0\n19981020 00:00,1075600,1088000,1060900,1065000,32710.0\n19981021 00:00,1068800,1076300,1058800,1071300,31975.0\n19981022 00:00,1067800,1084700,1061600,1080000,31350.0\n19981023 00:00,1079700,1080000,1067800,1071300,30565.0\n19981026 00:00,1077200,1085600,1067800,1075500,30425.0\n19981027 00:00,1084400,1089700,1062800,1066300,30490.0\n19981028 00:00,1065600,1078100,1060300,1067800,29915.0\n19981029 00:00,1070900,1089700,1066300,1089700,29355.0\n19981030 00:00,1101300,1109100,1095000,1100000,28230.0\n19981102 00:00,1108100,1117500,1101900,1114800,27180.0\n19981103 00:00,1115900,1118100,1107500,1111300,25835.0\n19981104 00:00,1124700,1130900,1110900,1118400,24695.0\n19981105 00:00,1115300,1138100,1111300,1137300,23770.0\n19981106 00:00,1134700,1145000,1133100,1142800,21615.0\n19981109 00:00,1139400,1142500,1125000,1131400,21615.0\n19981110 00:00,1130000,1139400,1125000,1126900,21505.0\n19981111 00:00,1138100,1140600,1118900,1123800,21105.0\n19981112 00:00,1123100,1131300,1116900,1120300,18170.0\n19981113 00:00,1122200,1130600,1121300,1127700,17760.0\n19981116 00:00,1142200,1143600,1128900,1138400,17840.0\n19981117 00:00,1136600,1156300,1130000,1143400,17800.0\n19981118 00:00,1143100,1149400,1135000,1147500,17645.0\n19981119 00:00,1152800,1159100,1146300,1155000,17130.0\n19981120 00:00,1163600,1167500,1158400,1166300,16975.0\n19981123 00:00,1174700,1192200,1171600,1191600,17115.0\n19981124 00:00,1190000,1196600,1184500,1186900,16375.0\n19981125 00:00,1189400,1191900,1181600,1188800,16000.0\n19981127 00:00,1194700,1197200,1190000,1195000,15190.0\n19981130 00:00,1190200,1193800,1166600,1166900,15845.0\n19981201 00:00,1161300,1180300,1152200,1178100,16470.0\n19981202 00:00,1172200,1179100,1160000,1175000,16895.0\n19981203 00:00,1172500,1183100,1151900,1152800,17455.0\n19981204 00:00,1166300,1188800,1155900,1179700,17760.0\n19981207 00:00,1180600,1195300,1180000,1192500,17930.0\n19981208 00:00,1185300,1197500,1175000,1184700,18180.0\n19981209 00:00,1186900,1189700,1178800,1188100,18005.0\n19981210 00:00,1188400,1188400,1167200,1168100,17980.0\n19981211 00:00,1164400,1173400,1155600,1170600,18150.0\n19981214 00:00,1161600,1164100,1139100,1144700,18935.0\n19981215 00:00,1146900,1167500,1145300,1166300,19310.0\n19981216 00:00,1171300,1171300,1157500,1164100,18685.0\n19981217 00:00,1172200,1185600,1170200,1185000,18735.0\n19981218 00:00,1183100,1191300,1178800,1190200,18720.0\n19981221 00:00,1192500,1213400,1190000,1203100,19435.0\n19981222 00:00,1204100,1212200,1191900,1205300,19420.0\n19981223 00:00,1211900,1231900,1208100,1228100,20005.0\n19981224 00:00,1231600,1238800,1222800,1226900,20290.0\n19981228 00:00,1232500,1233100,1220000,1226300,20585.0\n19981229 00:00,1227200,1244400,1221300,1243100,20380.0\n19981230 00:00,1239400,1247500,1230300,1233800,19835.0\n19981231 00:00,1233100,1239400,1224700,1228800,19615.0\n19990104 00:00,1233800,1252200,1217200,1228800,19805.0\n19990105 00:00,1229400,1248800,1229400,1244400,19130.0\n19990106 00:00,1258100,1276300,1257500,1275000,19305.0\n19990107 00:00,1263800,1272200,1257800,1269400,18900.0\n19990108 00:00,1281900,1285000,1259700,1275000,19620.0\n19990111 00:00,1276900,1276900,1252200,1262800,19795.0\n19990112 00:00,1262200,1262200,1238100,1240000,20110.0\n19990113 00:00,1204100,1251300,1203800,1233100,21235.0\n19990114 00:00,1236300,1239100,1209100,1211600,21625.0\n19990115 00:00,1223800,1247800,1220300,1243100,22310.0\n19990119 00:00,1253000,1274700,1235000,1252800,23525.0\n19990120 00:00,1260900,1279400,1250300,1256300,24355.0\n19990121 00:00,1255800,1258400,1232200,1235900,24495.0\n19990122 00:00,1221300,1238400,1217800,1225600,24510.0\n19990125 00:00,1232800,1240000,1219100,1236300,24365.0\n19990126 00:00,1241300,1257200,1236300,1255000,24610.0\n19990127 00:00,1263800,1266300,1244100,1244700,25065.0\n19990128 00:00,1252500,1269700,1251900,1266600,24800.0\n19990129 00:00,1273400,1283000,1254100,1278800,25385.0\n19990201 00:00,1286900,1286900,1270000,1270900,25495.0\n19990202 00:00,1270800,1272200,1247700,1262800,24970.0\n19990203 00:00,1256900,1279400,1256600,1271900,25140.0\n19990204 00:00,1273800,1275000,1248100,1248400,25545.0\n19990205 00:00,1256600,1256600,1232200,1240000,26045.0\n19990208 00:00,1250900,1250900,1233400,1243800,25655.0\n19990209 00:00,1243800,1245000,1215600,1218600,25890.0\n19990210 00:00,1221300,1230000,1213300,1226900,25520.0\n19990211 00:00,1230600,1256900,1225000,1256900,24740.0\n19990212 00:00,1248100,1255000,1226300,1235000,24675.0\n19990216 00:00,1247500,1256300,1233800,1243800,24425.0\n19990217 00:00,1231900,1253600,1222500,1227500,23995.0\n19990218 00:00,1231900,1243800,1222200,1239400,23620.0\n19990219 00:00,1240000,1257500,1233800,1239400,23495.0\n19990222 00:00,1244400,1277200,1242800,1276900,24185.0\n19990223 00:00,1275900,1285000,1265900,1275000,24095.0\n19990224 00:00,1278400,1288400,1254100,1254100,24765.0\n19990225 00:00,1245300,1252800,1225900,1247500,25000.0\n19990226 00:00,1247500,1248400,1228100,1239100,25125.0\n19990301 00:00,1236600,1243100,1208800,1237800,25395.0\n19990302 00:00,1245000,1253100,1223100,1228100,26050.0\n19990303 00:00,1230900,1235600,1217800,1231300,25715.0\n19990304 00:00,1240600,1252300,1232700,1250000,25555.0\n19990305 00:00,1275000,1281300,1259200,1278100,25315.0\n19990308 00:00,1282800,1288000,1272500,1285200,24870.0\n19990309 00:00,1281300,1299400,1274400,1282500,25245.0\n19990310 00:00,1284700,1292200,1277800,1290300,24495.0\n19990311 00:00,1296900,1311900,1288800,1302200,24815.0\n19990312 00:00,1310000,1310300,1292200,1295300,24125.0\n19990315 00:00,1299400,1311900,1295000,1311600,23535.0\n19990316 00:00,1311300,1316600,1304700,1309800,23005.0\n19990317 00:00,1306900,1309400,1296300,1302500,22105.0\n19990318 00:00,1297800,1323400,1297500,1321600,22320.0\n19990319 00:00,1323100,1326300,1298400,1300600,22530.0\n19990322 00:00,1300600,1305900,1294200,1299100,21395.0\n19990323 00:00,1293100,1296300,1257000,1264100,22405.0\n19990324 00:00,1268400,1271600,1256300,1269400,21455.0\n19990325 00:00,1280600,1292500,1277500,1291300,20860.0\n19990326 00:00,1286300,1291300,1277200,1284700,20550.0\n19990329 00:00,1291600,1314400,1291600,1312200,19975.0\n19990330 00:00,1299400,1312200,1295600,1303400,19305.0\n19990331 00:00,1311600,1316100,1284400,1286300,20000.0\n19990401 00:00,1296900,1296900,1281300,1293800,19800.0\n19990405 00:00,1309400,1323800,1302500,1323800,19760.0\n19990406 00:00,1321900,1329800,1311600,1319400,19895.0\n19990407 00:00,1326900,1333800,1313800,1328800,19645.0\n19990408 00:00,1331900,1347800,1322800,1345300,20175.0\n19990409 00:00,1344400,1356900,1335900,1348800,20070.0\n19990412 00:00,1334700,1362500,1332200,1360600,20680.0\n19990413 00:00,1362500,1364700,1340300,1351900,21055.0\n19990414 00:00,1360600,1360600,1326900,1330300,22145.0\n19990415 00:00,1334400,1335600,1310000,1326300,22770.0\n19990416 00:00,1329100,1329100,1311900,1321300,22335.0\n19990419 00:00,1326900,1345300,1283800,1289100,24015.0\n19990420 00:00,1298100,1310300,1288800,1306300,24505.0\n19990421 00:00,1310600,1337800,1257800,1336900,26540.0\n19990422 00:00,1351300,1362500,1343900,1359700,26705.0\n19990423 00:00,1358800,1367500,1350000,1357500,26830.0\n19990426 00:00,1365000,1368100,1354700,1361300,26795.0\n19990427 00:00,1371300,1375000,1358400,1365600,26485.0\n19990428 00:00,1364400,1372500,1350000,1353400,26780.0\n19990429 00:00,1355600,1360600,1338100,1345600,26320.0\n19990430 00:00,1350900,1356300,1315000,1334700,27605.0\n19990503 00:00,1334400,1357200,1330300,1356300,27885.0\n19990504 00:00,1351300,1358100,1331300,1333100,28315.0\n19990505 00:00,1339400,1350000,1318400,1349700,28895.0\n19990506 00:00,1344400,1351300,1323800,1335000,29020.0\n19990507 00:00,1345000,1349800,1334400,1346300,28740.0\n19990510 00:00,1348400,1357200,1335300,1342200,28320.0\n19990511 00:00,1353100,1368800,1257800,1357200,32650.0\n19990512 00:00,1357500,1372200,1315000,1366300,33825.0\n19990513 00:00,1372500,1380000,1368100,1370200,33140.0\n19990514 00:00,1345600,1362500,1333100,1343000,33750.0\n19990517 00:00,1336300,1344800,1323100,1343100,31760.0\n19990518 00:00,1345300,1349800,1326300,1336300,31860.0\n19990519 00:00,1344700,1348800,1332500,1348100,28675.0\n19990520 00:00,1351300,1355900,1300600,1343100,30510.0\n19990521 00:00,1341300,1346900,1195800,1334200,37190.0\n19990524 00:00,1338400,1338400,1303900,1310900,38245.0\n19990525 00:00,1313800,1323400,1286900,1288400,39240.0\n19990526 00:00,1293100,1310000,1280900,1306600,39570.0\n19990527 00:00,1298400,1302800,1280000,1284400,39585.0\n19990528 00:00,1290000,1307500,1285900,1305900,38600.0\n19990601 00:00,1301300,1301600,1283800,1298800,38145.0\n19990602 00:00,1297500,1301900,1206300,1297800,41585.0\n19990603 00:00,1306900,1309100,1297800,1302800,40570.0\n19990604 00:00,1314700,1331900,1309400,1319400,40320.0\n19990607 00:00,1334400,1341900,1329100,1337500,40190.0\n19990608 00:00,1333800,1338000,1315900,1321600,40200.0\n19990609 00:00,1324100,1330900,1318100,1321600,35290.0\n19990610 00:00,1314400,1315000,1295900,1309100,33385.0\n19990611 00:00,1312200,1322200,1290900,1298100,34355.0\n19990614 00:00,1306900,1307500,1295500,1297800,33485.0\n19990615 00:00,1304700,1316600,1300800,1305900,33190.0\n19990616 00:00,1323800,1338800,1321600,1334800,32875.0\n19990617 00:00,1328800,1355600,1326300,1346600,33525.0\n19990618 00:00,1340600,1346900,1333800,1343100,31415.0\n19990621 00:00,1344700,1350000,1336600,1349400,24530.0\n19990622 00:00,1340000,1351900,1333400,1337000,23730.0\n19990623 00:00,1330000,1336300,1321300,1332800,22655.0\n19990624 00:00,1328800,1338100,1306600,1316900,22775.0\n19990625 00:00,1325900,1330200,1312500,1316600,22520.0\n19990628 00:00,1326900,1336300,1324700,1333800,22020.0\n19990629 00:00,1330000,1351300,1327800,1351300,22305.0\n19990630 00:00,1346300,1375000,1338400,1367500,19355.0\n19990701 00:00,1370000,1385000,1360600,1380600,20010.0\n19990702 00:00,1381300,1393000,1379100,1391900,19580.0\n19990706 00:00,1392500,1407500,1385900,1387200,20020.0\n19990707 00:00,1390600,1397200,1385200,1395600,19515.0\n19990708 00:00,1390600,1406300,1387500,1395600,19815.0\n19990709 00:00,1400000,1404700,1393800,1402200,19405.0\n19990712 00:00,1409400,1409400,1395000,1400600,18560.0\n19990713 00:00,1393800,1399200,1386600,1395000,18590.0\n19990714 00:00,1400000,1402200,1387500,1398400,18535.0\n19990715 00:00,1407800,1488800,1403100,1411300,21960.0\n19990716 00:00,1412500,1421600,1407500,1420000,21200.0\n19990719 00:00,1421900,1422500,1405600,1410000,21390.0\n19990720 00:00,1401300,1404100,1375300,1378000,22160.0\n19990721 00:00,1380900,1389100,1370000,1378800,22190.0\n19990722 00:00,1374400,1380000,1354700,1361400,22705.0\n19990723 00:00,1366600,1370000,1351300,1357500,22065.0\n19990726 00:00,1348800,1361300,1346300,1350000,21930.0\n19990727 00:00,1360000,1372000,1353800,1365000,22260.0\n19990728 00:00,1362500,1373100,1355900,1367300,21945.0\n19990729 00:00,1349400,1352500,1333100,1343800,21085.0\n19990730 00:00,1348100,1353400,1328800,1330900,21095.0\n19990802 00:00,1327500,1347500,1325000,1329400,21525.0\n19990803 00:00,1337200,1338400,1313800,1323600,21675.0\n19990804 00:00,1327200,1338800,1305300,1306900,22750.0\n19990805 00:00,1308800,1317200,1288400,1315600,23250.0\n19990806 00:00,1312200,1320000,1295000,1300600,23955.0\n19990809 00:00,1305900,1318000,1297200,1300500,24275.0\n19990810 00:00,1298800,1301600,1270000,1282200,25225.0\n19990811 00:00,1296900,1305300,1286300,1305300,25440.0\n19990812 00:00,1306900,1318100,1300000,1300200,22060.0\n19990813 00:00,1316300,1332500,1311300,1331900,22415.0\n19990816 00:00,1331300,1339700,1322500,1333800,22430.0\n19990817 00:00,1344400,1351600,1331300,1347000,22005.0\n19990818 00:00,1342000,1343800,1334100,1335600,21535.0\n19990819 00:00,1323800,1332300,1316900,1328800,21040.0\n19990820 00:00,1330600,1339100,1326900,1338800,20715.0\n19990823 00:00,1348100,1364500,1346600,1363900,20860.0\n19990824 00:00,1360600,1379700,1353800,1365000,21245.0\n19990825 00:00,1371900,1387800,1279100,1384400,25820.0\n19990826 00:00,1382800,1384200,1365000,1365000,25810.0\n19990827 00:00,1368800,1370600,1351300,1351600,25545.0\n19990830 00:00,1353400,1355000,1323900,1326600,25975.0\n19990831 00:00,1329400,1337500,1307500,1325000,26245.0\n19990901 00:00,1329400,1335600,1323100,1335600,25195.0\n19990902 00:00,1321300,1326700,1306600,1322500,24760.0\n19990903 00:00,1348800,1362800,1346900,1361900,24305.0\n19990907 00:00,1360600,1366300,1342800,1355200,24440.0\n19990908 00:00,1348400,1360600,1335000,1349100,24140.0\n19990909 00:00,1347500,1352500,1336900,1351300,23970.0\n19990910 00:00,1362500,1363600,1349400,1354500,23775.0\n19990913 00:00,1351300,1354700,1345000,1348100,23200.0\n19990914 00:00,1340600,1345600,1333800,1340600,22930.0\n19990915 00:00,1354400,1354400,1320600,1320800,23605.0\n19990916 00:00,1325000,1328100,1303100,1323800,24370.0\n19990917 00:00,1326300,1339400,1321600,1337200,24490.0\n19990920 00:00,1339400,1340000,1330900,1336300,24335.0\n19990921 00:00,1322500,1324700,1301600,1309100,24595.0\n19990922 00:00,1312500,1318400,1297500,1311600,24345.0\n19990923 00:00,1318100,1342500,1237800,1280000,24145.0\n19990924 00:00,1277500,1283800,1263100,1280600,24220.0\n19990927 00:00,1287500,1297500,1282800,1282800,23990.0\n19990928 00:00,1279400,1288100,1255600,1281900,24060.0\n19990929 00:00,1284400,1291300,1267800,1267800,23735.0\n19990930 00:00,1274400,1294400,1269700,1283800,24345.0\n19991001 00:00,1279400,1285600,1266300,1283400,24305.0\n19991004 00:00,1291900,1306300,1287500,1306300,24450.0\n19991005 00:00,1307200,1319700,1286900,1301900,24915.0\n19991006 00:00,1307500,1328100,1306900,1326300,24695.0\n19991007 00:00,1328600,1330000,1315000,1320000,24665.0\n19991008 00:00,1317500,1338800,1312300,1337200,25280.0\n19991011 00:00,1335900,1341300,1333100,1338100,25205.0\n19991012 00:00,1331300,1333100,1311900,1314100,25675.0\n19991013 00:00,1306900,1313100,1282500,1286600,25515.0\n19991014 00:00,1284800,1291900,1267500,1284100,25485.0\n19991015 00:00,1260000,1267500,1245000,1248100,25720.0\n19991018 00:00,1249400,1257500,1234400,1255600,26420.0\n19991019 00:00,1271900,1282500,1259400,1260800,26420.0\n19991020 00:00,1277500,1292500,1271300,1292200,26435.0\n19991021 00:00,1272200,1288800,1266300,1286300,22325.0\n19991022 00:00,1297500,1312200,1295600,1303400,22120.0\n19991025 00:00,1293100,1304700,1287500,1295000,22245.0\n19991026 00:00,1301900,1306900,1281900,1282500,21870.0\n19991027 00:00,1283800,1303100,1282500,1301300,21725.0\n19991028 00:00,1324400,1345000,1321900,1345000,21645.0\n19991029 00:00,1358400,1376900,1357200,1365600,21665.0\n19991101 00:00,1365000,1370000,1356300,1359400,21410.0\n19991102 00:00,1359700,1372500,1347500,1348100,21020.0\n19991103 00:00,1360000,1363800,1351300,1356900,20585.0\n19991104 00:00,1367500,1373600,1357700,1364700,20630.0\n19991105 00:00,1386300,1391100,1367800,1372200,20470.0\n19991108 00:00,1370000,1383800,1367500,1379400,20875.0\n19991109 00:00,1385000,1386900,1362800,1367200,21020.0\n19991110 00:00,1362500,1383900,1360800,1377500,20645.0\n19991111 00:00,1381900,1385600,1374700,1383800,19970.0\n19991112 00:00,1392500,1399700,1371300,1397500,20265.0\n19991115 00:00,1398400,1402500,1394100,1398100,19530.0\n19991116 00:00,1405600,1426300,1400900,1424400,19645.0\n19991117 00:00,1422500,1429400,1413100,1415600,19400.0\n19991118 00:00,1424400,1430000,1416300,1428100,18960.0\n19991119 00:00,1424100,1429700,1420000,1425000,18615.0\n19991122 00:00,1424400,1430000,1415000,1424700,18505.0\n19991123 00:00,1428400,1428400,1400600,1408800,18645.0\n19991124 00:00,1407500,1424400,1400000,1420600,18835.0\n19991126 00:00,1424700,1428800,1412500,1414400,18495.0\n19991129 00:00,1408800,1419200,1404400,1410000,18250.0\n19991130 00:00,1407500,1423100,1390000,1392500,19220.0\n19991201 00:00,1393100,1405000,1390000,1401300,18720.0\n19991202 00:00,1406300,1413600,1403800,1411300,18585.0\n19991203 00:00,1430300,1454100,1430300,1436900,18980.0\n19991206 00:00,1435300,1437200,1422500,1427500,18550.0\n19991207 00:00,1432800,1433100,1413800,1419400,18700.0\n19991208 00:00,1413400,1420600,1406300,1406300,18210.0\n19991209 00:00,1418100,1422200,1393800,1410000,18475.0\n19991210 00:00,1422800,1428100,1408800,1420000,18895.0\n19991213 00:00,1414400,1427200,1412800,1421300,18195.0\n19991214 00:00,1416300,1424800,1406300,1408100,18700.0\n19991215 00:00,1403800,1422000,1400000,1418000,18530.0\n19991216 00:00,1421900,1426600,1411600,1423800,18465.0\n19991217 00:00,1430000,1433100,1420600,1423800,18405.0\n19991220 00:00,1425600,1431900,1410900,1416900,18970.0\n19991221 00:00,1415900,1440600,1413400,1433400,19580.0\n19991222 00:00,1436300,1441900,1429700,1437500,18800.0\n19991223 00:00,1450200,1464400,1449700,1460900,18315.0\n19991227 00:00,1465000,1467800,1450600,1458100,18360.0\n19991228 00:00,1458800,1465000,1454800,1461400,18130.0\n19991229 00:00,1463100,1468100,1452500,1463400,17255.0\n19991230 00:00,1471300,1478800,1461900,1466300,17350.0\n19991231 00:00,1468400,1475000,1462500,1468800,17485.0\n20000103 00:00,1482500,1482500,1438800,1455600,18480.0\n20000104 00:00,1435300,1440600,1396400,1400600,19955.0\n20000105 00:00,1399400,1415300,1372500,1402800,21130.0\n20000106 00:00,1396300,1415000,1392500,1403400,21540.0\n20000107 00:00,1403100,1444400,1400600,1444400,22310.0\n20000110 00:00,1462500,1469100,1450300,1458100,22285.0\n20000111 00:00,1458100,1460900,1435000,1440900,22860.0\n20000112 00:00,1445900,1446300,1428800,1433400,22810.0\n20000113 00:00,1444700,1457500,1432800,1451300,22945.0\n20000114 00:00,1465300,1474700,1459700,1465000,22945.0\n20000118 00:00,1453400,1466300,1451900,1456300,23040.0\n20000119 00:00,1453100,1464700,1450000,1456900,22725.0\n20000120 00:00,1469700,1469700,1438100,1445000,22945.0\n20000121 00:00,1455000,1455000,1440900,1441300,23040.0\n20000124 00:00,1456600,1458400,1394100,1400600,25520.0\n20000125 00:00,1405200,1420000,1390000,1410000,26160.0\n20000126 00:00,1410000,1415500,1400900,1406700,26380.0\n20000127 00:00,1418400,1422200,1381300,1400000,27645.0\n20000128 00:00,1394400,1400600,1355300,1364700,29065.0\n20000131 00:00,1358100,1394400,1350000,1394400,30660.0\n20000201 00:00,1397500,1416900,1385300,1401900,30055.0"
  },
  {
    "path": "Tests/TestData/spy_alma.txt",
    "content": "Date,Open,High,Low,Close,Volume,ALMA\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.062926E+08,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,2.454832E+08,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.863316E+08,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.439326E+08,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.237242E+08,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.706127E+08,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,9.73288E+07,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.212382E+08,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,9.42843E+07,153.0103125\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,8.6002E+07,153.7129632\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.228057E+08,154.3261091\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,8.32355E+07,154.8567064\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.041083E+08,155.2769595\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,9.10515E+07,155.5872882\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.236142E+08,155.8547348\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.331532E+08,156.0149609\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.265183E+08,155.9837527\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.670499E+08,155.702711\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.136078E+08,155.4071973\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.284929E+08,155.1334738\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.111032E+08,155.0737871\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.512318E+08,155.0664572\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,8.6114E+07,155.2145257\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,9.97837E+07,155.4710268\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.026877E+08,155.826227\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,9.91285E+07,156.1015857\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.01291E+08,156.3111052\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.537818E+08,156.2779321\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.2937E+08,156.1359503\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.55171E+08,155.8736587\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,8.60397E+07,155.7274243\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.005915E+08,155.8114836\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.348373E+08,156.3056075\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.096351E+08,157.1093269\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.160249E+08,157.9327267\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,2.155057E+08,158.0937167\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.471524E+08,157.7905353\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,2.262315E+08,157.0635226\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.668889E+08,156.2478143\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.492193E+08,155.6254658\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.062165E+08,155.3414542\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.65592E+08,155.6297745\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,9.49964E+07,156.3075108\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.307744E+08,157.1057808\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,9.5639E+07,157.7226669\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,8.82234E+07,158.2017231\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.156476E+08,158.6251992\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.385384E+08,158.8730608\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62323E+07,159.0659722\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.437959E+08,159.3901716\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66189E+07,159.9773159\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.9907E+07,160.803581\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68405E+07,161.6660303\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06479E+08,162.3282367\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.029682E+08,162.7933684\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97185E+07,163.0869453\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.184293E+08,163.4751077\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.205206E+08,164.09043\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.096312E+08,164.7491986\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.295212E+08,165.4150535\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47033E+07,165.9539775\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51305E+07,166.4178948\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.432158E+08,166.6412687\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.106298E+08,166.5371323\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.512651E+08,166.1764273\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.42755E+08,165.8875152\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60155E+08,165.7073031\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.063892E+08,165.6811555\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.754015E+08,165.4210407\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.679477E+08,165.0254396\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.574056E+08,164.5209698\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.108855E+08,163.8395316\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00017E+08,163.2198525\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.883034E+08,162.985703\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02463E+08,163.2682551\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59335E+08,163.6882494\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.767924E+08,163.6915045\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.631143E+08,163.4717723\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.409942E+08,163.2345227\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.35807E+08,163.3562895\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.145742E+08,163.8314298\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.057606E+08,164.1976858\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.202715E+08,163.828673\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70449E+08,162.663629\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.217057E+08,160.9125121\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.619672E+08,159.4384984\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.344994E+08,158.7834106\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.292817E+08,159.0062457\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.601388E+08,159.6369512\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.316825E+08,160.2990202\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.548075E+08,160.7370931\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.5214E+07,161.0027969\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.218654E+08,161.3591563\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.079307E+08,161.9315874\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19159E+08,162.7881786\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.194101E+08,163.7141521\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35448E+08,164.7224676\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.026369E+08,165.6843414\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.93766E+07,166.597005\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.8577E+07,167.2492706\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15262E+07,167.6221683\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.044458E+08,167.8852347\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.033631E+08,168.1979004\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.92687E+07,168.6095426\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.07614E+07,168.9613843\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.126621E+08,169.0861087\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.110332E+08,169.039961\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.074186E+08,168.9558906\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96142E+07,168.887075\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50268E+07,168.8311709\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.422641E+08,168.7613472\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.099667E+08,168.9261308\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94027E+07,169.3772796\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34082E+07,169.9651931\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72311E+07,170.3237283\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.45586E+07,170.2667503\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.019243E+08,169.99688\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.1473E+07,169.7075914\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84364E+07,169.5094347\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06301E+07,169.4228801\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89056E+07,169.3121326\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.525461E+08,168.904511\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30207E+08,168.1475758\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.62961E+07,167.099043\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89174E+07,166.1933915\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.577231E+08,165.540303\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01273E+08,165.3155259\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.0796E+07,165.4489138\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.93984E+07,165.7387934\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.542754E+08,165.6898121\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.051208E+08,165.2516953\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.18828E+08,164.6424535\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.341863E+08,164.1681844\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.428026E+08,164.0156545\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.72904E+07,164.2110739\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.2845E+07,164.6581637\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.593838E+08,165.2097076\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74072E+07,165.8387381\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.04783E+08,166.5839666\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43257E+07,167.4622077\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.25578E+07,168.257187\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.22575E+07,168.8125643\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.260507E+08,169.2051463\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22325E+07,169.6362226\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01318E+08,170.3698837\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.464406E+08,171.2404075\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.323176E+08,171.7865416\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.045339E+08,171.728505\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.004224E+08,171.1374167\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.145591E+08,170.3659717\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.65796E+07,169.8158827\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.76959E+07,169.4785254\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.436097E+08,169.1814522\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.269819E+08,168.9811253\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.128038E+08,168.8865688\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.763843E+08,168.7728027\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66007E+07,168.6945466\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.56532E+07,168.4533416\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.765606E+08,167.9343307\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.681005E+08,167.2149408\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.939883E+08,166.8685803\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.049564E+08,167.256192\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.112484E+08,168.3279059\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.549017E+08,169.3667899\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.608956E+08,170.1901137\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.288904E+08,170.9144541\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.380559E+08,171.8353835\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.040586E+08,172.8421062\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.266389E+08,173.7735149\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.050438E+08,174.37805\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00377E+07,174.7354207\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.34539E+07,175.0043978\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.44979E+07,175.3157516\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72006E+07,175.7811528\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.355066E+08,176.1891793\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.333523E+08,176.3677244\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.427717E+08,176.3348803\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,8.52578E+07,176.289138\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.54665E+07,176.3065631\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71231E+07,176.4684454\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.486322E+08,176.4182809\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.365001E+08,176.3967099\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62267E+07,176.4652526\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.31935E+07,176.6756623\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.97956E+07,177.0661921\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.029658E+08,177.5834214\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.027596E+08,178.2616571\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.84595E+07,178.9041586\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30458E+07,179.2861802\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.246929E+08,179.2863904\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18047E+07,179.2110581\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12347E+07,179.3580953\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.91878E+07,179.7531209\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.66978E+07,180.2074329\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82279E+07,180.5594817\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.49817E+07,180.7699684\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.92623E+07,180.8471903\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.159394E+08,180.7254112\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.229563E+08,180.4435445\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.063336E+08,180.0298547\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.274244E+08,179.8484153\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,6.99874E+07,180.0150689\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.7428E+07,180.3884213\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.301888E+08,180.4872056\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.153214E+08,180.086808\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.07741E+08,179.3645354\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61005E+07,178.8282932\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94322E+07,178.6223048\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.344557E+08,179.0004025\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.367177E+08,179.7037592\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.966787E+08,180.5063957\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54078E+07,181.230109\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.53633E+07,181.8011843\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32152E+07,182.3688691\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.17948E+07,182.9254268\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68072E+07,183.3825275\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61236E+07,183.7634659\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.195111E+08,183.8746187\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.1352E+07,183.7498724\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.068894E+08,183.387005\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60412E+07,183.0930176\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.64814E+07,183.0236278\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05294E+07,183.1777921\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.019865E+08,183.4484282\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.495076E+08,183.427113\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.045963E+08,183.3148588\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.83701E+07,183.3219733\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21121E+07,183.5840545\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.078325E+08,183.8977693\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85046E+07,184.0776812\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.07614E+07,184.1098608\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.323437E+08,183.9638461\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.085958E+08,183.2471703\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.799497E+08,181.9158801\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.088518E+08,180.4465957\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.152445E+08,179.2067805\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.161505E+08,178.6356378\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.945738E+08,178.4325164\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.543701E+08,177.9349606\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.64781E+08,177.1380057\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.636291E+08,176.1907006\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32379E+08,175.7892279\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.707013E+08,176.2819583\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.19772E+07,177.3874155\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.216364E+08,178.8026618\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44147E+07,180.0961725\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.005156E+08,181.1839722\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64135E+07,182.1122959\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00185E+07,182.9022926\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.259955E+08,183.3921904\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.048414E+08,183.65745\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.180692E+08,183.7374548\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.13918E+08,183.9070838\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.168151E+08,184.1864708\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83294E+07,184.4897451\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37208E+07,184.8181893\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.506819E+08,185.191542\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.674343E+08,185.4484683\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.696383E+08,185.8076101\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.82737E+07,186.2586813\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.2328E+07,186.8680671\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.174687E+08,187.4755332\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48343E+07,187.8925537\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88274E+07,187.98955\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.047016E+08,187.8528714\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54146E+08,187.3718255\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.53743E+08,186.6461494\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.82506E+07,186.0387516\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.016263E+08,185.9203578\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.761153E+08,186.2054488\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.169442E+08,186.7106057\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.630581E+08,186.9491037\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.208898E+08,186.8047184\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03492E+08,186.4934228\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.196569E+08,186.0757122\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.422045E+08,185.6629773\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.015272E+08,185.3644819\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96267E+07,185.3944797\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.89589E+07,185.9137721\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87143E+07,186.7992731\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.7253E+07,187.6748796\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.690036E+08,188.019545\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.40661E+08,187.5633548\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.125858E+08,186.6463679\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.000139E+08,185.9796037\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.728738E+08,185.4664494\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.670166E+08,184.8028415\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32183E+08,183.9390263\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.570263E+08,183.3046842\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.041517E+08,183.4654915\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.051923E+08,184.2743106\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82128E+07,185.2971099\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.56864E+07,186.2235141\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36114E+07,186.8802824\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81096E+07,187.321897\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.003077E+08,187.3986702\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.349505E+08,187.256699\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.39714E+07,187.1310751\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.014617E+08,187.244469\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.28565E+07,187.5797349\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.79693E+07,187.9142018\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58278E+07,188.1350012\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.53562E+07,188.0573357\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06377E+08,187.8895474\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.34954E+07,187.7116078\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.3648E+07,187.6718813\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.68714E+07,187.9571557\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64168E+07,188.4846477\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22439E+07,188.9973247\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.548973E+08,189.0935123\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.73841E+07,188.8046163\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.36763E+07,188.4562201\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.115126E+08,188.2029648\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.8998E+07,188.2349642\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15195E+07,188.4674142\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.1108E+07,188.9208639\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.19611E+07,189.5976087\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60485E+07,190.2985998\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.4139E+07,190.979398\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.62562E+07,191.5731117\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.45682E+07,192.0796195\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.49852E+07,192.4589794\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.54952E+07,192.72989\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20356E+07,193.0552579\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.86503E+07,193.5735826\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50257E+07,194.2419085\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.69925E+07,194.8716521\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.8703E+07,195.2196737\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.061255E+08,195.1172169\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.1991E+07,194.7606004\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73494E+07,194.3932552\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.47768E+07,194.2729764\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.051448E+08,194.550001\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58331E+07,195.0901563\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,9.99651E+07,195.6247468\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04472E+07,195.9485215\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60182E+07,195.8845885\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.26941E+07,195.6687432\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42166E+07,195.4654503\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13261E+07,195.4357981\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.03968E+07,195.5250263\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03217E+07,195.7824836\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23162E+07,196.1619277\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.28948E+07,196.7039075\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.16767E+07,197.1915004\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.080553E+08,197.3560859\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.29536E+07,197.2696766\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89224E+07,196.9980804\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42262E+07,196.7775337\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.85636E+07,196.7667526\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.112974E+08,196.8948369\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,7.99786E+07,197.1648533\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.444126E+08,197.1948385\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.242563E+08,197.1610196\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.74803E+07,197.0971977\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76125E+07,197.2460713\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55456E+07,197.5991362\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64175E+07,198.0049597\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.67825E+07,198.2308329\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91065E+07,198.2315812\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04086E+07,197.9771982\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.041051E+08,197.6304324\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.830735E+08,196.8713823\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.890752E+08,195.7302421\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11084E+07,194.5798542\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.525572E+08,193.6141151\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46282E+07,193.0064522\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.355078E+08,192.4724861\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.169994E+08,192.1970572\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.44512E+07,192.3048384\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36054E+07,192.7272187\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.89616E+07,193.3347219\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72282E+07,193.994646\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.39872E+08,194.6397646\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.51886E+07,195.3741691\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.89646E+07,196.1984377\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27256E+07,197.0897934\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77458E+07,197.9669881\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.60677E+07,198.6328965\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.3806E+07,199.1395042\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.72561E+07,199.5351005\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78206E+07,199.8633203\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.82675E+07,200.0861012\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.58862E+07,200.2427303\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23226E+07,200.3610409\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.73714E+07,200.4638235\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50003E+07,200.4918266\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.020151E+08,200.5379641\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41025E+07,200.582907\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.84825E+07,200.4955872\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.71543E+07,200.3166413\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67374E+07,200.1318153\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.174083E+08,199.9468141\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.63573E+07,199.7419274\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.160432E+08,199.6405058\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.511539E+08,199.747225\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.494E+07,200.1933645\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.214495E+08,200.6545491\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.254334E+08,200.7425931\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.110883E+08,200.2782719\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.071375E+08,199.6646144\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.500097E+08,198.8945392\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.035058E+08,198.3219665\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.50859E+07,197.880987\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.301387E+08,197.5787086\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.776124E+08,197.0837349\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.571704E+08,196.3350866\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.214662E+08,195.7209576\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.047379E+08,195.5208319\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.476036E+08,195.3985549\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.860549E+08,195.4214317\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.099787E+08,195.057944\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.216482E+08,194.2538531\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.300502E+08,192.7341816\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15307E+08,190.8608168\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.803363E+08,189.0750415\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70175E+08,187.7813963\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.142533E+08,187.2397931\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.295995E+08,187.505915\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.544764E+08,188.7601703\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.514775E+08,190.3751981\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.546817E+08,192.017218\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.168401E+08,193.4342758\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.2755E+07,194.5714334\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.06688E+08,195.6867681\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.423653E+08,196.6498126\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.130267E+08,197.5438709\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.468571E+08,198.5483392\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35399E+07,199.6174933\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.31773E+07,200.5299177\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.14689E+07,201.2099445\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.067421E+08,201.7242459\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.94722E+07,202.2325848\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59176E+07,202.800332\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.42991E+07,203.3218118\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,8.99675E+07,203.697087\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.49915E+07,203.9343516\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03352E+07,204.0628418\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.03773E+07,204.1533649\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.58919E+07,204.3703281\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22299E+07,204.6632933\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.25898E+07,205.0013518\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.421739E+08,205.3970745\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.56752E+07,205.8759324\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90198E+07,206.3823743\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.63859E+07,206.8546043\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.78901E+07,207.1480649\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.038069E+08,207.1097222\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.44562E+07,206.9503702\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.88735E+07,206.9002774\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12253E+07,207.0707035\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.09898E+07,207.4002859\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.084651E+08,207.5263288\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25039E+08,207.3736137\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.592371E+08,206.6651547\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.586288E+08,205.7341851\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.021238E+08,204.4862104\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.895569E+08,203.0755563\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.589109E+08,201.5007936\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.525237E+08,200.4589013\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.569953E+08,200.7764186\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.433649E+08,202.3049687\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.481941E+08,204.3494272\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.206218E+08,206.0027029\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.29634E+07,206.976766\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72119E+07,207.5349205\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.9532E+07,207.9269762\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34483E+07,208.1237079\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.302817E+08,207.8861388\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.214085E+08,207.2455691\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.694406E+08,206.0310323\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.089239E+08,204.384335\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.250696E+08,202.9132949\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.460561E+08,202.4244857\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.576098E+08,202.859286\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.440602E+08,203.5024593\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.143722E+08,203.605074\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.92575E+08,203.0106732\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75449E+08,201.976521\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.117161E+08,201.1840724\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.308767E+08,200.895193\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.227043E+08,201.247891\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.737079E+08,202.2589898\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.173577E+08,203.4022533\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17101E+07,204.4061184\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.336462E+08,204.7139825\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.676865E+08,204.0844101\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.733125E+08,203.0623804\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.975085E+08,201.8935898\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.627071E+08,201.2477427\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.238674E+08,201.4410549\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.339685E+08,202.2168112\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77312E+07,203.3977496\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.255901E+08,204.4242316\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.70842E+07,205.0003299\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61426E+07,205.383128\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02272E+07,205.731688\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72269E+07,206.3975979\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36175E+07,207.3481171\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.6896E+07,208.3708701\n"
  },
  {
    "path": "Tests/TestData/spy_ao.txt",
    "content": ",Date,Open,High,Low,Close,Volume,AO\n0,2013/02/22,151.16,151.89,150.49,151.89,106292600,\n1,2013/02/25,152.63,152.86,149.0,149.0,245483200,\n2,2013/02/26,149.72,150.2,148.73,150.02,186331600,\n3,2013/02/27,149.89,152.33,149.76,151.91,143932600,\n4,2013/02/28,151.9,152.87,151.41,151.61,123724200,\n5,2013/03/01,151.09,152.34,150.41,152.11,170612700,\n6,2013/03/04,151.76,152.92,151.52,152.92,97328800,\n7,2013/03/05,153.66,154.7,153.64,154.29,121238200,\n8,2013/03/06,154.84,154.92,154.16,154.5,94284300,\n9,2013/03/07,154.71,154.98,154.52,154.78,86002000,\n10,2013/03/08,155.46,155.65,154.66,155.44,122805700,\n11,2013/03/11,155.33,156.04,155.13,156.03,83235500,\n12,2013/03/12,155.92,156.1,155.21,155.68,104108300,\n13,2013/03/13,155.76,156.12,155.23,155.9,91051500,\n14,2013/03/14,156.31,156.8,156.22,156.73,123614200,\n15,2013/03/15,155.85,156.04,155.31,155.83,133153200,\n16,2013/03/18,154.34,155.64,154.2,154.97,126518300,\n17,2013/03/19,155.3,155.51,153.59,154.61,167049900,\n18,2013/03/20,155.52,155.95,155.26,155.69,113607800,\n19,2013/03/21,154.75,155.64,154.1,154.36,128492900,\n20,2013/03/22,154.84,155.6,154.73,155.6,111103200,\n21,2013/03/25,155.99,156.27,154.35,154.95,151231800,\n22,2013/03/26,155.59,156.23,155.42,156.19,86114000,\n23,2013/03/27,155.26,156.24,155.0,156.19,99783700,\n24,2013/03/28,156.09,156.85,155.75,156.67,102687700,\n25,2013/04/01,156.59,156.91,155.67,156.05,99128500,\n26,2013/04/02,156.61,157.21,156.37,156.82,101291000,\n27,2013/04/03,156.91,157.03,154.82,155.23,153781800,\n28,2013/04/04,155.43,156.17,155.09,155.86,129370000,\n29,2013/04/05,153.95,155.35,153.77,155.16,155171000,\n30,2013/04/08,155.27,156.22,154.75,156.21,86039700,\n31,2013/04/09,156.5,157.32,155.98,156.75,100591500,\n32,2013/04/10,157.17,158.87,157.13,158.67,134837300,\n33,2013/04/11,158.7,159.71,158.54,159.19,109635100,1.978705882352898\n34,2013/04/12,158.68,159.04,157.92,158.8,116024900,2.5482941176470035\n35,2013/04/15,158.0,158.13,155.1,155.12,215505700,2.6070882352940714\n36,2013/04/16,156.29,157.49,155.91,157.41,147152400,2.4042941176470265\n37,2013/04/17,156.29,156.32,154.28,155.11,226231500,1.7391470588235336\n38,2013/04/18,155.37,155.41,153.55,154.14,166888900,0.7413235294117726\n39,2013/04/19,154.5,155.55,154.12,155.48,149219300,-0.08944117647058647\n40,2013/04/22,155.78,156.54,154.75,156.17,106216500,-0.3841764705882156\n41,2013/04/23,156.95,157.93,156.17,157.78,165592000,-0.3988823529412002\n42,2013/04/24,157.83,158.3,157.54,157.88,94996400,0.025705882352951903\n43,2013/04/25,158.25,159.27,158.1,158.52,130774400,0.7509705882352478\n44,2013/04/26,158.32,158.6,157.73,158.24,95639000,1.328441176470534\n45,2013/04/29,158.67,159.65,158.42,159.3,88223400,1.9049705882352441\n46,2013/04/30,159.27,159.72,158.61,159.68,115647600,2.224735294117636\n47,2013/05/01,159.33,159.41,158.1,158.28,138538400,2.301147058823517\n48,2013/05/02,158.68,159.89,158.53,159.75,96232300,2.326735294117668\n49,2013/05/03,161.14,161.88,161.04,161.37,143795900,2.8155882352941433\n50,2013/05/06,161.49,162.01,161.42,161.78,66618900,3.151735294117657\n51,2013/05/07,162.11,162.65,161.67,162.6,89907000,3.5269117647059147\n52,2013/05/08,162.42,163.39,162.33,163.34,96840500,4.134529411764731\n53,2013/05/09,163.27,163.7,162.47,162.88,106479000,4.667911764705906\n54,2013/05/10,163.0,163.55,162.51,163.41,102968200,4.7505882352941455\n55,2013/05/13,163.0,163.81,162.82,163.54,79718500,4.835147058823594\n56,2013/05/14,163.67,165.35,163.67,165.23,118429300,5.04970588235301\n57,2013/05/15,164.98,166.45,164.91,166.12,120520600,5.317823529411811\n58,2013/05/16,165.76,166.36,165.09,165.34,109631200,5.568617647058858\n59,2013/05/17,165.98,167.04,165.73,166.94,129521200,5.9427058823529535\n60,2013/05/20,166.78,167.58,166.61,166.93,84703300,6.3956176470588275\n61,2013/05/21,167.07,167.8,166.5,167.17,95130500,6.593470588235306\n62,2013/05/22,167.34,169.07,165.17,165.93,243215800,6.543529411764723\n63,2013/05/23,164.2,165.91,163.94,165.45,210629800,6.078676470588249\n64,2013/05/24,164.44,165.38,163.98,165.31,151265100,5.467235294117643\n65,2013/05/28,167.04,167.78,165.81,166.3,142755000,5.108852941176451\n66,2013/05/29,165.41,165.8,164.34,165.22,160155000,4.484911764705856\n67,2013/05/30,165.35,166.59,165.22,165.83,106389200,4.04249999999999\n68,2013/05/31,165.36,166.31,163.13,163.45,175401500,3.8179705882352835\n69,2013/06/03,163.86,164.46,162.66,164.35,167947700,3.389705882352871\n70,2013/06/04,164.44,165.1,162.73,163.56,157405600,2.601499999999902\n71,2013/06/05,163.11,163.42,161.13,161.27,210885500,1.8373529411763627\n72,2013/06/06,161.2,162.74,160.25,162.73,200017000,0.7490294117646386\n73,2013/06/07,163.89,164.95,163.14,164.8,188303400,0.34314705882346175\n74,2013/06/10,165.31,165.4,164.37,164.8,102463000,0.33638235294108654\n75,2013/06/11,163.27,164.54,162.74,163.1,159335000,0.08755882352932076\n76,2013/06/12,164.25,164.39,161.6,161.75,176792400,0.08229411764696692\n77,2013/06/13,161.64,164.5,161.3,164.21,163114300,0.2393235294117062\n78,2013/06/14,164.03,164.67,162.91,163.18,140994200,0.022882352941110184\n79,2013/06/17,164.3,165.22,163.55,164.44,135807000,-0.23447058823535372\n80,2013/06/18,164.54,165.99,164.52,165.74,114574200,-0.09058823529417737\n81,2013/06/19,165.61,165.89,163.38,163.45,205760600,0.06447058823522411\n82,2013/06/20,161.83,162.1,158.98,159.4,320271500,-0.4466470588236007\n83,2013/06/21,159.6,159.76,157.47,159.07,270449000,-1.3979705882353528\n84,2013/06/24,157.39,158.43,155.73,157.06,221705700,-2.722647058823611\n85,2013/06/25,158.52,159.17,157.42,158.57,161967200,-4.0009705882353614\n86,2013/06/26,159.89,160.5,159.25,160.14,134499400,-4.865176470588324\n87,2013/06/27,161.12,161.82,160.95,161.08,129281700,-4.64617647058833\n88,2013/06/28,160.62,161.4,159.86,160.42,160138800,-4.172588235294199\n89,2013/07/01,161.27,162.48,161.08,161.36,131682500,-3.1874411764707133\n90,2013/07/02,161.1,162.3,160.5,161.21,154807500,-2.474970588235408\n91,2013/07/03,160.51,161.77,160.22,161.28,75214000,-2.1131764705883427\n92,2013/07/05,162.53,163.08,161.3,163.02,121865400,-1.848205882353028\n93,2013/07/08,163.89,164.39,163.08,163.95,107930700,-1.1492647058824161\n94,2013/07/09,164.97,165.33,164.27,165.13,119159000,-0.47776470588240727\n95,2013/07/10,165.01,165.75,164.63,165.19,119410100,0.3378823529411079\n96,2013/07/11,167.13,167.61,166.53,167.44,135448000,1.554352941176461\n97,2013/07/12,167.4,167.93,167.13,167.51,102636900,2.545735294117634\n98,2013/07/15,167.97,168.39,167.68,168.15,69376600,3.3070588235294167\n99,2013/07/16,168.25,168.36,167.07,167.52,88577000,3.862999999999971\n100,2013/07/17,168.18,168.48,167.73,167.95,91526200,4.3567352941176125\n101,2013/07/18,168.28,169.27,168.2,168.87,104445800,4.606499999999983\n102,2013/07/19,168.51,169.23,168.31,169.17,103363100,4.735382352941173\n103,2013/07/22,169.39,169.74,169.01,169.5,79268700,4.832352941176509\n104,2013/07/23,169.79,169.83,169.05,169.14,80761400,5.0148529411764855\n105,2013/07/24,169.8,169.86,168.18,168.52,112662100,4.999470588235283\n106,2013/07/25,168.2,169.08,167.94,168.93,111033200,4.748147058823491\n107,2013/07/26,168.24,169.16,167.52,169.11,107418600,4.5358235294117435\n108,2013/07/29,168.71,169.06,168.11,168.59,79614200,4.268999999999977\n109,2013/07/30,169.12,169.28,168.19,168.59,85026800,3.9781470588235095\n110,2013/07/31,168.94,169.85,168.49,168.71,142264100,3.82652941176471\n111,2013/08/01,169.98,170.81,169.9,170.66,109966700,3.976264705882329\n112,2013/08/02,170.3,170.97,170.05,170.95,89402700,4.212617647058806\n113,2013/08/05,170.61,170.96,170.35,170.7,53408200,4.4422058823529085\n114,2013/08/06,170.37,170.52,169.35,169.73,87231100,4.5445588235294\n115,2013/08/07,169.2,169.43,168.55,169.18,84558600,4.3804705882352835\n116,2013/08/08,170.0,170.18,168.93,169.8,101924300,3.9553235294117712\n117,2013/08/09,169.56,170.1,168.72,169.31,91473000,3.4178235294117485\n118,2013/08/12,168.44,169.31,168.38,169.11,68436400,2.70979411764705\n119,2013/08/13,169.4,169.9,168.41,169.61,80630100,2.234382352941168\n120,2013/08/14,169.52,169.8,168.7,168.74,78905600,2.0106470588235084\n121,2013/08/15,167.35,167.43,166.09,166.38,152546100,1.2935588235293949\n122,2013/08/16,166.04,166.63,165.5,165.83,130207000,0.46470588235294485\n123,2013/08/19,165.64,166.21,164.76,164.77,96296100,-0.31626470588233246\n124,2013/08/20,165.03,166.2,164.86,165.58,88917400,-1.1627352941176525\n125,2013/08/21,165.15,166.03,164.19,164.56,157723100,-2.1117647058823366\n126,2013/08/22,164.92,166.3,164.89,166.06,101273000,-2.4449117647058927\n127,2013/08/23,166.54,166.83,165.77,166.62,90796000,-2.4733529411765005\n128,2013/08/26,166.77,167.3,165.89,166.0,89398400,-2.3041470588235597\n129,2013/08/27,164.33,164.98,163.21,163.33,154275400,-2.558941176470597\n130,2013/08/28,163.3,164.49,163.05,163.91,105120800,-2.729882352941246\n131,2013/08/29,163.55,165.04,163.4,164.17,118828000,-2.907529411764756\n132,2013/08/30,164.52,164.53,163.17,163.65,134186300,-3.274441176470674\n133,2013/09/03,165.24,165.58,163.7,164.39,142802600,-3.5750000000001023\n134,2013/09/04,164.44,166.03,164.14,165.75,97290400,-3.2881764705883825\n135,2013/09/05,165.85,166.4,165.73,165.96,62845000,-2.7506470588236596\n136,2013/09/06,166.49,166.98,164.48,166.04,159383800,-2.359235294117724\n137,2013/09/09,166.45,167.73,166.45,167.63,87407200,-1.6440294117648193\n138,2013/09/10,168.63,168.9,168.26,168.87,104783000,-0.8307352941177726\n139,2013/09/11,168.64,169.4,168.35,169.4,94325700,-0.06847058823538532\n140,2013/09/12,169.37,169.56,168.72,168.95,82557800,0.5279999999999063\n141,2013/09/13,169.15,169.46,168.74,169.33,72257500,1.1796470588234342\n142,2013/09/16,171.18,171.24,170.04,170.31,126050700,1.829205882352852\n143,2013/09/17,170.47,171.11,170.46,171.07,82232500,2.209911764705822\n144,2013/09/18,170.97,173.52,170.58,173.05,201318000,2.7602058823528637\n145,2013/09/19,173.51,173.6,172.59,172.76,146440600,3.4706176470587593\n146,2013/09/20,172.3,172.33,170.58,170.72,132317600,3.9138235294117294\n147,2013/09/23,170.5,170.65,169.39,169.93,104533900,3.808499999999924\n148,2013/09/24,169.89,170.53,169.21,169.53,100422400,3.6274117647057835\n149,2013/09/25,169.65,169.98,168.89,169.04,114559100,3.0913235294116532\n150,2013/09/26,169.34,170.17,169.05,169.69,76579600,2.392705882352857\n151,2013/09/27,168.81,169.14,168.47,168.91,97695900,1.88049999999987\n152,2013/09/30,167.45,168.54,167.15,168.01,143609700,1.4749117647057517\n153,2013/10/01,168.14,169.5,168.0,169.34,126981900,1.2628235294116337\n154,2013/10/02,168.35,169.34,167.83,169.18,112803800,1.1123823529410686\n155,2013/10/03,168.77,168.94,166.84,167.62,176384300,0.7351470588234008\n156,2013/10/04,167.74,169.06,167.53,168.89,96600700,0.5675588235292821\n157,2013/10/07,167.43,168.45,167.25,167.43,95653200,0.4989999999998531\n158,2013/10/08,167.45,167.62,165.36,165.48,176560600,0.018764705882205135\n159,2013/10/09,165.8,166.2,164.53,165.6,168100500,-0.6327352941177935\n160,2013/10/10,167.29,169.26,167.23,169.17,193988300,-0.6396764705883697\n161,2013/10/11,168.9,170.32,168.77,170.26,104956400,-0.48511764705898486\n162,2013/10/14,169.24,171.08,169.08,170.94,111248400,-0.14161764705897895\n163,2013/10/15,170.52,171.15,169.47,169.7,154901700,0.43958823529396795\n164,2013/10/16,170.75,172.16,170.63,172.07,160895600,1.4213235294115805\n165,2013/10/17,171.37,173.32,171.34,173.22,128890400,1.9997941176468714\n166,2013/10/18,173.86,174.51,173.51,174.39,138055900,2.593970588235095\n167,2013/10/21,174.45,174.75,174.01,174.4,104058600,3.1674999999998192\n168,2013/10/22,174.91,175.93,174.66,175.41,126638900,3.864205882352735\n169,2013/10/23,174.83,174.89,173.96,174.57,105043800,4.224323529411549\n170,2013/10/24,174.9,175.37,174.51,175.15,70037700,4.475441176470383\n171,2013/10/25,175.51,176.0,175.17,175.95,93453900,4.540588235293939\n172,2013/10/28,175.9,176.47,175.7,176.23,84497900,4.660852941176302\n173,2013/10/29,176.6,177.24,176.38,177.17,87200600,4.730470588235107\n174,2013/10/30,177.4,177.51,175.66,176.29,135506600,4.94349999999983\n175,2013/10/31,176.18,176.89,175.53,175.79,133352300,4.9883823529410165\n176,2013/11/01,176.05,176.61,175.22,176.21,142771700,4.89923529411746\n177,2013/11/04,176.71,176.9,175.9825,176.83,85257800,4.804124999999857\n178,2013/11/05,176.16,176.75,175.57,176.27,85466500,4.55324264705871\n179,2013/11/06,177.03,177.5,176.54,177.17,87123100,4.524801470588102\n180,2013/11/07,177.56,177.64,174.76,174.93,148632200,4.383242647058694\n181,2013/11/08,174.85,177.31,174.85,177.29,136500100,4.238007352941054\n182,2013/11/11,177.14,177.53,176.91,177.32,66226700,4.1775808823528\n183,2013/11/12,176.95,177.36,176.37,176.96,83193500,4.10005147058817\n184,2013/11/13,176.1,178.41,176.09,178.38,99795600,3.9213455882352264\n185,2013/11/14,178.53,179.42,178.25,179.27,102965800,4.153345588235226\n186,2013/11/15,179.57,180.12,179.33,180.05,102759600,4.53293382352939\n187,2013/11/18,180.39,180.5,179.02,179.42,98459500,4.717110294117617\n188,2013/11/19,179.31,179.87,178.72,179.03,93045800,4.888110294117638\n189,2013/11/20,179.41,179.93,177.98,178.47,124692900,4.903669117647041\n190,2013/11/21,179.0,180.05,178.86,179.91,91804700,4.699433823529375\n191,2013/11/22,180.01,180.83,179.77,180.81,81234700,4.448257352941113\n192,2013/11/25,181.11,181.17,180.37,180.63,79187800,4.230257352941152\n193,2013/11/26,180.74,181.22,180.4,180.68,86697800,4.0789926470587545\n194,2013/11/27,180.89,181.24,180.65,181.12,58227900,4.103463235294072\n195,2013/11/29,181.34,181.75,180.8,181.0,54981700,4.122463235294106\n196,2013/12/02,181.12,181.43,180.25,180.53,99262300,3.913992647058791\n197,2013/12/03,179.95,180.39,179.17,179.75,115939400,3.4374632352941035\n198,2013/12/04,179.18,180.48,178.35,179.73,122956300,2.922580882352918\n199,2013/12/05,179.42,179.74,178.77,178.94,106333600,2.380904411764675\n200,2013/12/06,180.72,181.11,180.15,180.94,127424400,2.057198529411721\n201,2013/12/09,181.47,181.67,181.16,181.4,69987400,1.9652867647058656\n202,2013/12/10,180.96,181.36,180.63,180.75,77428000,2.0406397058823416\n203,2013/12/11,180.81,180.85,178.5,178.72,130188800,1.93822794117645\n204,2013/12/12,178.61,178.86,177.76,178.13,115321400,1.65011029411761\n205,2013/12/13,178.48,178.66,177.77,178.11,107741000,1.0897573529411204\n206,2013/12/16,178.95,179.81,178.9,179.22,96100500,0.5815808823529096\n207,2013/12/17,179.37,179.41,178.25,178.65,89432200,0.0891691176470033\n208,2013/12/18,178.91,181.73,177.32,181.7,234455700,-0.02730147058827015\n209,2013/12/19,181.18,181.7,180.71,181.49,136717700,0.40478676470584674\n210,2013/12/20,180.67,181.99,180.57,181.56,196678700,0.8599926470587889\n211,2013/12/23,182.41,182.64,182.07,182.53,85407800,1.2860588235293733\n212,2013/12/24,182.57,183.01,182.53,182.93,45363300,1.8796470588234797\n213,2013/12/26,183.37,183.96,183.32,183.85,63215200,2.5079411764705526\n214,2013/12/27,184.14,184.18,183.66,183.85,61794800,2.8238823529411263\n215,2013/12/30,183.92,184.02,183.58,183.82,56807200,3.100823529411713\n216,2013/12/31,184.11,184.69,183.93,184.69,86123600,3.2832941176469888\n217,2014/01/02,183.91,184.07,182.48,182.92,119511100,3.195764705882283\n218,2014/01/03,183.24,183.6,182.63,182.88,81352000,2.918264705882308\n219,2014/01/06,183.52,183.56,182.08,182.36,106889400,2.581058823529361\n220,2014/01/07,183.12,183.79,182.95,183.48,86041200,2.387852941176419\n221,2014/01/08,183.46,183.83,182.89,183.52,96481400,2.091970588235256\n222,2014/01/09,184.1,184.13,182.79,183.64,90529400,2.0064705882352882\n223,2014/01/10,183.96,184.22,183.01,184.14,101986500,1.9694117647058818\n224,2014/01/13,183.64,184.18,181.34,181.68,149507600,1.8602058823529433\n225,2014/01/14,182.27,183.77,181.95,183.67,104596300,1.6829117647058922\n226,2014/01/15,184.1,184.94,183.71,184.66,98370100,1.7713529411764455\n227,2014/01/16,184.3,184.66,183.83,184.42,72112100,1.827323529411757\n228,2014/01/17,184.1,184.45,183.32,183.63,107832500,1.7948529411764298\n229,2014/01/21,184.72,184.77,183.05,184.18,88504600,1.9473529411764616\n230,2014/01/22,184.51,184.57,183.91,184.3,60761400,2.1233529411764493\n231,2014/01/23,183.38,183.4,181.82,182.79,132343700,1.6971176470588034\n232,2014/01/24,181.59,181.66,178.83,178.89,208595800,0.8727058823529603\n233,2014/01/27,179.05,179.52,177.12,178.01,179949700,-0.21279411764703582\n234,2014/01/28,178.23,179.3,178.12,179.07,108851800,-1.1963235294117283\n235,2014/01/29,177.59,178.55,176.88,177.35,215244500,-2.3925000000000125\n236,2014/01/30,178.88,179.81,178.26,179.23,116150500,-3.0498529411764537\n237,2014/01/31,177.0,179.29,176.92,178.18,194573800,-3.431676470588229\n238,2014/02/03,177.95,178.37,173.83,174.17,254370100,-3.81067647058822\n239,2014/02/04,174.98,175.84,174.11,175.38,164781000,-4.46238235294112\n240,2014/02/05,174.77,175.56,173.71,175.17,163629100,-4.939558823529353\n241,2014/02/06,175.61,177.48,175.22,177.48,132379000,-5.4036176470587804\n242,2014/02/07,178.29,179.87,177.73,179.68,170701300,-5.243294117647025\n243,2014/02/10,179.7,180.07,179.21,180.01,91977200,-4.489264705882306\n244,2014/02/11,180.23,182.44,180.04,181.98,121636400,-3.2350882352940857\n245,2014/02/12,182.26,182.83,181.71,182.07,94414700,-1.7055882352941012\n246,2014/02/13,180.85,183.2,180.83,183.01,100515600,-0.550382352941142\n247,2014/02/14,182.9,184.36,182.67,184.02,96413500,0.396294117647102\n248,2014/02/18,184.2,184.49,183.65,184.24,80018500,1.2778823529412193\n249,2014/02/19,183.78,184.95,182.87,183.02,125995500,1.808647058823567\n250,2014/02/20,183.27,184.52,182.6,184.1,104841400,2.0887058823529685\n251,2014/02/21,184.45,184.89,183.8,183.89,118069200,2.5232352941176543\n252,2014/02/24,184.3,186.15,184.2,184.91,113918000,2.794647058823557\n253,2014/02/25,185.03,185.59,184.23,184.84,116815100,2.9011764705882683\n254,2014/02/26,185.1,185.6,184.33,184.85,98329400,3.065264705882356\n255,2014/02/27,184.58,185.87,184.37,185.82,93720800,3.3255000000000052\n256,2014/02/28,185.78,187.15,185.05,186.29,150681900,3.5988529411764887\n257,2014/03/03,184.65,185.45,183.75,184.98,167434300,3.4548823529411834\n258,2014/03/04,186.79,187.98,186.75,187.58,169638300,3.8104411764706185\n259,2014/03/05,187.75,188.07,187.45,187.75,88273700,4.2253235294117815\n260,2014/03/06,188.24,188.61,187.78,188.18,82328000,4.726500000000016\n261,2014/03/07,188.93,188.96,187.43,188.26,117468700,5.029323529411812\n262,2014/03/10,187.94,188.23,187.08,188.16,74834300,5.5294411764706695\n263,2014/03/11,188.48,188.71,186.8,187.23,98827400,5.494352941176544\n264,2014/03/12,186.32,187.35,185.9,187.28,104701600,5.197205882352989\n265,2014/03/13,187.88,187.99,184.66,185.18,154146000,4.713941176470655\n266,2014/03/14,184.8,185.8,184.44,184.66,153743000,3.9555588235295147\n267,2014/03/17,185.62,186.77,185.51,186.33,98250600,3.4225588235295277\n268,2014/03/18,186.74,187.91,186.51,187.66,101626300,3.063558823529519\n269,2014/03/19,187.71,187.94,185.47,186.66,176115300,2.815147058823669\n270,2014/03/20,186.25,187.89,185.92,187.75,116944200,2.699676470588372\n271,2014/03/21,187.71,189.02,186.03,186.2,163058100,2.9036176470589794\n272,2014/03/24,186.84,187.07,184.62,185.43,120889800,2.558000000000135\n273,2014/03/25,186.4,186.94,185.27,186.31,103492000,2.009647058823674\n274,2014/03/26,187.0,187.34,184.92,184.97,119656900,1.556558823529599\n275,2014/03/27,184.77,185.34,183.9,184.58,142204500,0.8563235294119522\n276,2014/03/28,185.14,186.42,185.0,185.49,101527200,0.29008823529431993\n277,2014/03/31,186.66,187.3,186.47,187.01,99626700,0.2850000000001671\n278,2014/04/01,187.65,188.36,187.45,188.25,88958900,0.4489705882354542\n279,2014/04/02,188.5,189.13,188.14,188.88,78714300,0.7627647058825175\n280,2014/04/03,189.13,189.22,188.05,188.63,77253000,1.3710588235295518\n281,2014/04/04,189.64,189.7,186.1,186.4,169003600,1.6800882352942494\n282,2014/04/07,185.9,186.26,183.96,184.34,140661000,1.2945000000001414\n283,2014/04/08,184.18,185.4,183.59,185.1,112585800,0.595294117647228\n284,2014/04/09,185.61,187.15,185.06,187.09,100013900,0.014441176470768369\n285,2014/04/10,187.07,187.17,182.93,183.15,172873800,-0.7232941176468728\n286,2014/04/11,182.16,183.42,181.31,181.51,167016600,-1.7476470588233042\n287,2014/04/14,182.92,183.37,181.44,182.94,132183000,-2.214970588235076\n288,2014/04/15,183.35,184.33,181.51,184.2,157026300,-2.469823529411542\n289,2014/04/16,185.47,186.14,184.65,186.12,104151700,-2.619911764705705\n290,2014/04/17,185.87,186.91,185.56,186.39,105192300,-2.3868823529409156\n291,2014/04/21,186.45,187.1,186.21,187.04,68212800,-1.5893235294115016\n292,2014/04/22,187.24,188.4,187.13,187.89,85686400,-0.5290882352938411\n293,2014/04/23,187.8,187.92,187.3,187.45,73611400,0.41332352941202544\n294,2014/04/24,188.39,188.39,186.93,187.83,88109600,0.8820588235296896\n295,2014/04/25,187.23,187.33,185.87,186.29,100307700,1.0019705882355936\n296,2014/04/28,187.08,187.69,184.96,186.88,134950500,0.975088235294379\n297,2014/04/29,187.48,188.04,187.08,187.75,83971400,0.9398235294120241\n298,2014/04/30,187.46,188.5,187.18,188.31,101461700,0.9500882352943449\n299,2014/05/01,188.25,188.84,187.73,188.32,92856500,1.0174411764708395\n300,2014/05/02,188.33,189.14,187.78,188.06,97969300,1.2912058823531538\n301,2014/05/05,187.16,188.55,186.62,188.42,75827800,1.5007058823531452\n302,2014/05/06,188.03,188.13,186.74,186.78,85356200,1.469088235294322\n303,2014/05/07,187.41,187.97,186.01,187.88,106377000,1.2907058823531656\n304,2014/05/08,187.71,189.05,187.08,187.68,93495400,1.2125882352943336\n305,2014/05/09,187.71,188.04,186.83,187.96,83648000,1.0102352941178196\n306,2014/05/12,188.77,189.88,188.0,189.79,86871400,1.1902058823531547\n307,2014/05/13,190.03,190.42,189.77,189.96,66416800,1.6048529411766594\n308,2014/05/14,189.82,189.88,188.79,189.06,72243900,1.9795882352943295\n309,2014/05/15,188.68,188.72,186.48,187.4,154897300,1.7989411764707484\n310,2014/05/16,187.5,188.13,186.72,188.05,97384100,1.746500000000168\n311,2014/05/19,187.71,188.89,187.52,188.74,63676300,1.560676470588362\n312,2014/05/20,188.67,188.67,187.07,187.55,111512600,1.1167058823531022\n313,2014/05/21,188.07,189.22,188.06,189.13,88998000,0.9775588235295913\n314,2014/05/22,189.2,189.98,188.86,189.59,61519500,1.3184705882354706\n315,2014/05/23,189.76,190.48,189.59,190.35,61108000,1.7776764705884034\n316,2014/05/27,191.06,191.58,190.95,191.52,71961100,2.2086470588237432\n317,2014/05/28,191.55,191.82,191.06,191.38,66048500,2.7183823529413758\n318,2014/05/29,191.85,192.4,191.33,192.37,64139000,3.193970588235487\n319,2014/05/30,192.21,192.8,192.03,192.68,76256200,3.5763529411766513\n320,2014/06/02,192.98,192.99,191.97,192.9,64568200,3.7678529411766988\n321,2014/06/03,192.41,192.9,192.25,192.8,64985200,3.730735294117835\n322,2014/06/04,192.46,193.3,192.26,193.19,55495200,3.7087352941178438\n323,2014/06/05,193.43,194.65,192.7,194.45,92035600,3.827205882353155\n324,2014/06/06,194.88,195.43,194.78,195.38,78650300,4.104323529411971\n325,2014/06/09,195.36,196.05,195.17,195.58,65025700,4.466941176470783\n326,2014/06/10,195.36,195.64,194.92,195.6,56992500,4.786911764706105\n327,2014/06/11,194.87,195.12,194.48,194.92,68703000,4.979441176470772\n328,2014/06/12,194.68,194.8,193.11,193.54,106125500,4.850294117647223\n329,2014/06/13,193.89,194.32,193.3,194.13,81991000,4.379235294117819\n330,2014/06/16,193.88,194.7,193.66,194.29,87349400,3.8622058823531233\n331,2014/06/17,194.0,194.97,193.81,194.83,84776800,3.4833235294119334\n332,2014/06/18,194.83,196.37,194.4,196.26,105144800,3.378411764706044\n333,2014/06/19,196.46,196.6,195.8,196.48,85833100,3.5946176470590103\n334,2014/06/20,196.01,196.1,195.7,195.94,99965100,3.793794117647252\n335,2014/06/23,196.0,196.05,195.52,195.88,70447200,3.873617647059035\n336,2014/06/24,195.54,196.5,194.48,194.7,96018200,3.856705882353168\n337,2014/06/25,194.28,195.78,194.25,195.58,82694100,3.5466764705884657\n338,2014/06/26,195.6,195.63,194.13,195.44,84216600,3.082235294117851\n339,2014/06/27,194.98,195.88,194.88,195.82,71326100,2.7445588235295872\n340,2014/06/30,195.71,196.16,195.53,195.72,70396800,2.5534705882354274\n341,2014/07/01,196.21,197.63,196.13,197.03,90321700,2.6319117647060466\n342,2014/07/02,197.03,197.48,196.96,197.23,52316200,2.8410000000001503\n343,2014/07/03,197.81,198.29,197.64,198.2,52894800,3.15314705882372\n344,2014/07/07,197.84,197.98,197.22,197.51,61676700,3.2978823529413432\n345,2014/07/08,197.12,197.22,195.76,196.24,108055300,3.1832058823531213\n346,2014/07/09,196.75,197.29,196.31,197.12,72953600,2.9045588235296123\n347,2014/07/10,195.24,196.86,195.06,196.34,98922400,2.4372647058825123\n348,2014/07/11,196.24,196.75,195.78,196.61,64226200,1.8959411764707852\n349,2014/07/14,197.63,197.86,197.44,197.6,58563600,1.6819705882355152\n350,2014/07/15,197.71,198.1,196.36,197.23,111297400,1.6545294117649405\n351,2014/07/16,198.12,198.26,197.42,197.96,79978600,1.674294117647264\n352,2014/07/17,197.33,198.1,195.43,195.71,144412600,1.691176470588431\n353,2014/07/18,196.38,197.91,196.24,197.71,124256300,1.7161176470590362\n354,2014/07/21,197.08,197.5,196.43,197.34,67480300,1.4472058823531881\n355,2014/07/22,198.04,198.56,197.87,198.2,67612500,1.4783235294119947\n356,2014/07/23,198.51,198.85,198.1,198.64,65545600,1.4378235294119577\n357,2014/07/24,198.82,199.06,198.45,198.65,56417500,1.6864117647060652\n358,2014/07/25,198.11,198.26,197.33,197.72,76782500,1.7512941176472054\n359,2014/07/28,197.78,198.09,196.62,197.8,69106500,1.777970588235462\n360,2014/07/29,198.21,198.45,196.92,196.95,80408600,1.6012352941177994\n361,2014/07/30,197.66,197.91,196.16,196.98,104105100,1.2475000000001444\n362,2014/07/31,195.63,195.78,192.97,193.09,183073500,0.3591470588237087\n363,2014/08/01,192.58,193.76,191.57,192.5,189075200,-0.6331764705880687\n364,2014/08/04,192.87,194.3,192.05,193.89,91108400,-1.4396176470586681\n365,2014/08/05,193.11,193.6,191.31,192.01,152557200,-2.428705882352773\n366,2014/08/06,191.08,192.89,191.08,192.07,94628200,-3.3387058823527127\n367,2014/08/07,192.96,193.13,190.55,191.03,135507800,-3.7174705882350736\n368,2014/08/08,191.43,193.37,190.95,193.24,116999400,-3.708470588235059\n369,2014/08/11,193.99,194.66,193.71,193.79,74451200,-3.4594117647056635\n370,2014/08/12,193.63,194.15,192.94,193.53,73605400,-3.1842058823526997\n371,2014/08/13,194.3,195.06,193.96,194.84,68961600,-2.664352941176247\n372,2014/08/14,195.19,195.76,194.98,195.76,57228200,-1.9727647058821276\n373,2014/08/15,196.49,196.65,194.31,195.72,139872000,-1.3117058823526406\n374,2014/08/18,196.81,197.45,196.69,197.36,75188600,-0.7707352941173156\n375,2014/08/19,197.85,198.54,197.44,198.39,58964600,0.08561764705913788\n376,2014/08/20,198.15,199.16,198.08,198.92,72725600,0.8664411764708859\n377,2014/08/21,199.06,199.76,198.93,199.5,67745800,1.6208529411767927\n378,2014/08/22,199.32,199.69,198.74,199.19,76067700,2.320352941176793\n379,2014/08/25,200.16,200.59,199.15,200.2,63806000,2.7809411764709466\n380,2014/08/26,200.35,200.82,200.28,200.33,47256100,3.182647058823875\n381,2014/08/27,200.45,200.57,199.94,200.25,47820600,3.383323529412081\n382,2014/08/28,199.59,200.27,199.39,200.14,58267500,3.375470588235629\n383,2014/08/29,200.44,200.73,199.82,200.71,65886200,3.5102647058826335\n384,2014/09/02,200.97,200.99,199.86,200.61,72322600,3.5272941176473864\n385,2014/09/03,201.35,201.41,200.22,200.5,57371400,3.492794117647378\n386,2014/09/04,200.86,201.58,199.66,200.21,85000300,3.4524117647061985\n387,2014/09/05,200.19,201.19,199.41,201.11,102015100,3.4515588235297514\n388,2014/09/08,200.94,201.21,200.0,200.59,64102500,3.4105000000003542\n389,2014/09/09,200.42,200.55,198.91,199.32,88482500,3.2269411764709446\n390,2014/09/10,199.46,200.2,198.77,200.07,67154300,2.9312352941179824\n391,2014/09/11,199.28,200.33,199.12,200.3,66737400,2.723705882353272\n392,2014/09/12,200.12,200.12,198.56,199.13,117408300,2.486264705882661\n393,2014/09/15,199.17,199.32,198.38,198.98,76357300,2.091294117647351\n394,2014/09/16,198.64,200.84,198.5,200.48,116043200,2.0209117647061703\n395,2014/09/17,200.8,201.68,199.75,200.75,151153900,2.1586764705885173\n396,2014/09/18,201.36,201.85,201.1,201.82,94940000,2.299852941176738\n397,2014/09/19,201.53,201.9,200.29,200.7,121449500,2.40291176470609\n398,2014/09/22,200.33,200.38,198.73,199.15,125433400,2.356264705882552\n399,2014/09/23,198.41,199.26,197.95,198.01,111088300,1.9623823529413755\n400,2014/09/24,198.06,199.69,197.52,199.56,107137500,1.3456764705884439\n401,2014/09/25,199.05,199.05,196.27,196.34,150009700,0.4115000000001885\n402,2014/09/26,196.7,198.39,196.42,197.9,103505800,-0.4807647058821374\n403,2014/09/29,196.18,197.89,196.05,197.54,95085900,-1.0796764705880548\n404,2014/09/30,197.7,198.3,196.61,197.02,130138700,-1.4246764705880537\n405,2014/10/01,196.68,196.77,193.91,194.35,177612400,-2.1020882352939623\n406,2014/10/02,194.18,195.05,192.35,194.38,157170400,-2.844970588235128\n407,2014/10/03,195.71,196.94,195.08,196.52,121466200,-3.1395588235292564\n408,2014/10/06,197.36,197.6,195.58,196.29,104737900,-3.2014411764704676\n409,2014/10/07,195.29,195.72,193.22,193.26,147603600,-3.6949117647058074\n410,2014/10/08,193.36,196.92,192.36,196.64,186054900,-3.7178529411763748\n411,2014/10/09,196.36,196.6,192.58,192.74,209978700,-3.3999999999999204\n412,2014/10/10,192.7,193.65,190.49,190.54,221648200,-3.977852941176394\n413,2014/10/13,190.47,191.15,187.3,187.41,230050200,-5.137764705882319\n414,2014/10/14,188.46,189.82,187.04,187.7,215307000,-5.9892941176470345\n415,2014/10/15,185.19,187.69,181.92,186.43,380336300,-7.501882352941124\n416,2014/10/16,183.05,187.58,182.89,186.27,270175000,-8.943617647058772\n417,2014/10/17,188.42,189.75,187.62,188.47,214253300,-9.279735294117614\n418,2014/10/20,188.12,190.45,188.07,190.3,129599500,-8.944352941176447\n419,2014/10/21,191.7,194.2,191.48,194.07,154476400,-7.827794117647045\n420,2014/10/22,194.44,194.91,192.61,192.69,151477500,-5.8350294117647366\n421,2014/10/23,194.64,196.2,194.26,194.93,154681700,-3.686911764705883\n422,2014/10/24,195.23,196.49,194.49,196.43,116840100,-2.1754705882352994\n423,2014/10/27,195.75,196.45,195.03,196.16,82755000,-0.7621176470588011\n424,2014/10/28,196.84,198.42,196.73,198.41,106688000,0.24105882352944263\n425,2014/10/29,198.59,199.12,196.8,198.11,142365300,1.132970588235338\n426,2014/10/30,197.59,199.61,197.4,199.38,113026700,1.8125294117647286\n427,2014/10/31,201.78,201.82,200.77,201.66,146857100,2.901617647058856\n428,2014/11/03,201.92,202.45,201.3,201.77,93539900,4.063764705882392\n429,2014/11/04,201.22,201.6,200.06,201.07,93177300,4.7113823529412\n430,2014/11/05,202.56,202.59,201.45,202.34,91468900,5.507352941176492\n431,2014/11/06,202.41,203.26,201.64,203.15,106742100,6.256500000000045\n432,2014/11/07,203.17,203.6,202.61,203.34,89472200,6.514088235294139\n433,2014/11/10,203.4,204.04,203.13,203.98,65917600,6.709617647058849\n434,2014/11/11,204.07,204.31,203.65,204.18,54299100,7.1815294117647\n435,2014/11/12,203.35,204.24,203.31,203.96,89967500,7.352676470588278\n436,2014/11/13,204.14,204.83,203.21,204.19,84991500,7.4721176470588375\n437,2014/11/14,204.13,204.49,203.72,204.24,80335200,7.4622647058823475\n438,2014/11/17,203.85,204.58,203.65,204.37,80377300,7.372382352941173\n439,2014/11/18,204.46,205.92,204.44,205.55,75891900,7.322970588235279\n440,2014/11/19,205.3,205.55,204.3,205.22,82229900,7.222823529411755\n441,2014/11/20,204.25,205.71,204.18,205.58,72589800,7.14502941176471\n442,2014/11/21,207.6,207.84,205.98,206.68,142173900,7.402500000000032\n443,2014/11/24,207.19,207.39,206.91,207.26,65675200,7.636558823529441\n444,2014/11/25,207.54,207.79,206.8,207.11,79019800,7.687352941176499\n445,2014/11/26,207.27,207.76,207.03,207.64,56385900,7.804735294117705\n446,2014/11/28,207.52,207.87,206.91,207.2,57890100,7.843147058823604\n447,2014/12/01,206.4,206.54,205.38,205.76,103806900,7.160941176470658\n448,2014/12/02,205.8,207.34,205.78,207.09,74456200,6.509705882352989\n449,2014/12/03,207.28,208.15,207.1,207.89,68873500,5.9045294117647416\n450,2014/12/04,207.55,208.26,206.7,207.66,91225300,5.267264705882411\n451,2014/12/05,207.88,208.47,207.55,208.0,90989800,4.822882352941207\n452,2014/12/08,207.55,208.12,205.93,206.61,108465100,4.51338235294125\n453,2014/12/09,204.37,206.6,203.91,206.47,125039000,3.887235294117744\n454,2014/12/10,205.94,205.98,202.93,203.16,159237100,2.9386764705883195\n455,2014/12/11,203.89,206.19,203.71,204.19,158628800,2.146794117647147\n456,2014/12/12,202.65,203.82,200.85,200.89,202123800,0.8104705882353755\n457,2014/12/15,202.0,202.53,198.78,199.51,189556900,-0.6080882352940193\n458,2014/12/16,198.55,202.4,197.86,197.91,258910900,-1.7082352941175714\n459,2014/12/17,198.48,202.34,198.29,201.79,252523700,-2.605499999999921\n460,2014/12/18,204.78,212.97,203.92,206.78,256995300,-2.1988529411763977\n461,2014/12/19,206.46,207.33,205.61,206.52,243364900,-1.5240588235293444\n462,2014/12/22,206.71,207.47,206.46,207.47,148194100,-0.4117647058822911\n463,2014/12/23,208.2,208.23,207.4,207.75,120621800,0.9197941176471147\n464,2014/12/24,208.03,208.34,207.72,207.77,42963400,2.28602941176473\n465,2014/12/26,208.29,208.85,208.25,208.44,57211900,2.1276176470588553\n466,2014/12/29,208.25,208.97,208.14,208.72,79532000,2.3843235294117733\n467,2014/12/30,208.21,208.37,207.51,207.6,73448300,2.4512352941177085\n468,2014/12/31,207.96,208.19,205.39,205.54,130281700,2.1635882352941564\n469,2015/01/02,206.39,206.88,204.18,205.43,121408500,1.6119705882353514\n470,2015/01/05,204.2,204.37,201.35,201.72,169440600,0.508088235294224\n471,2015/01/06,202.13,202.72,198.85,199.82,208923900,-0.9482647058822522\n472,2015/01/07,201.46,202.72,200.88,202.31,125069600,-2.1081764705881767\n473,2015/01/08,204.0,206.16,203.99,205.9,146056100,-2.4480882352940228\n474,2015/01/09,206.39,206.42,203.51,204.25,157609800,-2.5622647058822565\n475,2015/01/12,204.42,204.6,201.92,202.65,144060200,-2.4327058823528773\n476,2015/01/13,204.15,205.48,200.51,202.08,214372200,-1.87555882352936\n477,2015/01/14,199.67,201.1,198.57,200.86,192575000,-2.053411764705828\n478,2015/01/15,201.64,202.01,198.88,199.02,175449000,-2.7779411764705344\n479,2015/01/16,198.75,201.82,198.55,201.63,211716100,-3.5218823529411054\n480,2015/01/20,202.42,202.72,200.17,202.05,130876700,-3.7100294117646513\n481,2015/01/21,201.51,203.66,200.94,203.08,122704300,-3.7413823529411445\n482,2015/01/22,204.02,206.26,202.33,206.1,173707900,-2.7827647058823004\n483,2015/01/23,205.8,206.1,204.81,204.97,117357700,-1.7169411764705274\n484,2015/01/26,204.73,205.56,203.85,205.45,91710100,-0.7313235294117248\n485,2015/01/27,203.0,204.12,201.74,202.74,133646200,-0.2849117647058108\n486,2015/01/28,204.16,204.29,199.91,200.14,167686500,-0.18005882352940716\n487,2015/01/29,200.34,202.3,198.68,201.99,173312500,-0.8009117647058872\n488,2015/01/30,200.56,202.17,199.13,199.45,197508500,-1.6500000000000057\n489,2015/02/02,200.07,202.03,197.86,201.92,162707100,-2.4547941176470545\n490,2015/02/03,203.02,204.85,202.55,204.84,123867400,-2.3409411764705794\n491,2015/02/04,203.94,205.38,203.51,204.06,133968500,-1.9834117647058918\n492,2015/02/05,204.83,206.3,204.77,206.12,97731200,-1.1333823529411688\n493,2015/02/06,206.57,207.24,204.92,205.55,125590100,-0.21694117647061262\n494,2015/02/09,204.77,205.64,204.13,204.63,87084200,0.8757647058823181\n495,2015/02/10,205.89,207.12,204.68,206.81,96142600,1.332529411764682\n496,2015/02/11,206.6,207.45,205.83,206.93,90227200,1.781088235294078\n497,2015/02/12,207.91,208.99,206.97,208.92,97226900,2.2652352941175877\n498,2015/02/13,209.08,209.84,208.76,209.78,93617500,2.8718823529410997\n499,2015/02/17,209.38,210.32,209.1,210.11,76896000,3.802764705882282\n"
  },
  {
    "path": "Tests/TestData/spy_apo.txt",
    "content": "Date,Open,High,Low,Close,Volume,APO_5_10\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,1.41699999999997\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,1.72799999999998\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,1.64699999999999\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,1.35899999999998\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,1.23999999999998\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,1.11799999999994\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0.824000000000012\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.407000000000011\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.16100000000003\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,5.6843418860808E-14\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,-0.431999999999931\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,-0.493999999999943\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-0.389999999999958\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,-0.124999999999972\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,-0.0539999999999736\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.414000000000016\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.482000000000028\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.670999999999992\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.417000000000002\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.333999999999975\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,-0.0480000000000018\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,-0.0770000000000266\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,-0.271000000000015\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.168999999999983\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.534999999999997\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,1.05000000000001\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,0.925000000000011\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.99799999999999\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.298000000000002\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-0.539999999999992\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,-1.23599999999999\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,-1.02199999999999\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,-1.05100000000002\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,-0.418000000000006\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0.525000000000006\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,1.13299999999998\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,1.34100000000001\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,1.49400000000003\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,1.25700000000001\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.942000000000036\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.979000000000042\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.914000000000044\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,1.01600000000005\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,1.48200000000008\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1.67200000000008\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,1.56300000000007\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,1.49100000000007\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1.46200000000007\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1.23400000000007\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1.16700000000009\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1.31600000000009\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,1.4790000000001\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1.41000000000005\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,1.11300000000006\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0.878000000000043\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.362000000000052\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,-0.039999999999992\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-0.428999999999974\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,-0.419999999999959\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-0.630999999999943\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,-0.563999999999908\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-0.77499999999992\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-0.974999999999937\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,-1.27499999999995\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,-0.939999999999912\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,-0.798999999999921\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,-0.570999999999913\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-0.127999999999901\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.330000000000126\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.0330000000001007\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,-0.0479999999998881\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.262000000000086\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0.3840000000001\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-0.244999999999919\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-0.493999999999943\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-1.19599999999997\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,-2.17699999999999\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,-2.678\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,-2.02899999999997\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,-1.483\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,-0.314999999999998\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.666000000000025\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1.11100000000002\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1.13700000000003\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,1.35499999999999\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,1.30199999999999\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,1.43599999999998\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1.93800000000002\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,2.19300000000001\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,2.25999999999999\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,2.12199999999999\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,1.99999999999997\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,1.52699999999999\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,1.24399999999997\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.958999999999975\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.881999999999948\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.662999999999982\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.525999999999954\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.353999999999957\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.127999999999986\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,-0.0890000000000271\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,-0.12700000000001\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.039999999999992\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.230000000000018\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.531999999999982\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.700999999999993\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.728999999999957\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0.469999999999999\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.121999999999957\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,-0.248000000000019\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,-0.374000000000024\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,-0.465000000000032\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-0.721000000000032\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-0.90500000000003\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-1.18000000000001\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,-1.571\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-1.94500000000002\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,-1.63499999999999\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,-1.20799999999997\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,-0.650999999999982\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-0.472999999999956\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,-0.119999999999948\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,-0.276999999999958\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-0.65300000000002\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,-0.937000000000012\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,-0.469999999999999\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,-0.200000000000017\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0.176000000000016\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0.870999999999981\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1.48000000000002\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1.60299999999998\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1.69699999999997\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1.839\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1.709\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,1.48099999999999\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,1.48100000000002\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1.56300000000005\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,1.37300000000002\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1.06700000000004\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.69300000000004\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,-0.0729999999999222\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,-0.760999999999939\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,-1.08099999999993\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,-1.23499999999993\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,-1.09999999999994\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,-0.684999999999945\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-0.584999999999951\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,-0.405999999999949\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,-0.271999999999963\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-0.63900000000001\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-1.01099999999997\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,-0.648999999999972\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,-0.509999999999962\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,-0.100999999999971\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0.707000000000022\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,1.71200000000005\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1.96200000000002\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,2.23800000000006\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,2.23300000000003\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,2.38200000000003\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1.98500000000001\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,1.773\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,1.51599999999999\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,1.35300000000001\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.958000000000027\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0.879999999999995\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.751000000000005\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.621000000000009\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.498000000000019\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.232000000000028\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.148000000000025\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-0.00199999999998113\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.0800000000000409\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.0690000000000168\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.228000000000037\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.261000000000053\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.781000000000063\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.949000000000041\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,1.11000000000001\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,1.24800000000002\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,1.13600000000005\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,0.76600000000002\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.566000000000031\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.477000000000004\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.435000000000002\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.691000000000003\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0.736000000000018\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.632000000000005\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.42300000000003\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.163000000000011\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-0.319999999999993\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,-0.434999999999945\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,-0.319999999999993\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,-0.131999999999977\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-0.137999999999977\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-0.00100000000000477\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-0.277999999999992\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,-0.58299999999997\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-0.893000000000001\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,-0.494000000000028\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,-0.0770000000000266\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.550999999999988\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,1.09999999999997\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,1.73799999999994\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,1.65499999999997\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,1.55499999999998\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,1.43600000000001\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,1.321\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.891999999999967\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.580000000000013\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.195000000000022\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,-0.0649999999999977\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,-0.398000000000025\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,-0.324999999999989\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,-0.102000000000004\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-0.021000000000015\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.0319999999999538\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.262999999999948\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.26899999999992\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.0919999999998993\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.409999999999911\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.453999999999951\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.152999999999963\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-0.478000000000037\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-0.989000000000033\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,-1.75000000000009\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-2.50800000000004\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,-2.67700000000002\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,-2.19499999999999\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-2.01700000000002\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,-1.87500000000003\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,-1.39800000000005\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,-1.21700000000004\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,-0.996000000000038\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,-0.02800000000002\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,1.00099999999998\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,1.90899999999999\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,2.63699999999997\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,2.92099999999999\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,2.75999999999999\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,2.20400000000001\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,1.71700000000001\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,1.25200000000007\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.907000000000039\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.544000000000068\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.623000000000047\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.592000000000041\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.744000000000057\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.662000000000063\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0.876000000000062\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.983000000000061\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,1.04700000000003\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,1.00400000000005\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,1.31500000000005\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,1.00600000000006\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.669000000000011\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.13300000000001\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-0.424000000000007\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,-0.924999999999983\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,-0.847000000000008\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,-0.862000000000023\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,-0.305000000000007\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0.209000000000003\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.301999999999993\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.124000000000024\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,0.0170000000000243\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-0.55699999999996\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,-0.781999999999982\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,-0.533999999999992\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,-0.204999999999956\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.355000000000047\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,1.07700000000003\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,1.239\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.814000000000021\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.305000000000035\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,-0.264999999999958\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-1.21799999999996\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-1.79799999999994\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,-1.67099999999996\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,-1.44599999999997\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,-1.36399999999998\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,-0.491999999999962\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.55000000000004\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,1.185\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,1.60000000000002\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,1.86800000000002\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,1.53400000000005\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.96500000000006\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.456000000000046\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.217000000000098\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.0950000000000841\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.282000000000124\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.452000000000112\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.369000000000085\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.240000000000094\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.127000000000066\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,-0.0599999999999454\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,-0.0769999999999413\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.338000000000079\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.49900000000008\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.535000000000053\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.55400000000003\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.312000000000069\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-0.246999999999957\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,-0.357999999999976\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,-0.110999999999933\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.110000000000042\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.493000000000052\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,1.11700000000002\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,1.43400000000005\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,1.52400000000006\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,1.54900000000004\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,1.39900000000003\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1.197\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1.08099999999996\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,1.04199999999994\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,1.05499999999995\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,1.20699999999994\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,1.19899999999996\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.899999999999949\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.504999999999967\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.107999999999976\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,-0.249000000000024\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,-0.288000000000011\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.09699999999998\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.402999999999963\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0.690999999999974\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.754999999999939\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.552999999999997\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.154999999999944\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,-0.0380000000000962\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,-0.213000000000079\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.0329999999999302\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.265999999999906\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.64599999999993\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.82699999999997\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0.894999999999953\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.670999999999964\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.416999999999973\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,-0.0180000000000007\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,-0.177999999999997\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,-0.130999999999972\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,-0.0559999999999832\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-0.0300000000000011\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.239000000000004\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.204000000000036\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.201999999999998\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.185999999999979\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.54299999999995\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.433999999999941\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.505999999999972\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.283999999999963\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.0499999999999545\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-0.800000000000011\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-1.32300000000004\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,-1.76000000000005\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-2.12900000000005\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,-2.45400000000006\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-2.10400000000007\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,-1.50800000000004\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,-1.12700000000007\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,-0.481000000000051\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.286999999999949\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.965999999999951\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,1.13999999999996\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,1.50699999999998\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,1.84099999999995\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,1.97199999999995\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,1.87299999999993\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,1.97199999999992\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,1.89899999999989\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,1.60699999999989\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,1.33199999999991\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,1.02199999999988\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.826999999999884\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.583999999999861\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.40699999999984\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.269999999999868\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.302999999999827\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0.138999999999839\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-0.031000000000148\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,-0.0910000000001787\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,-0.0780000000002019\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-0.373000000000189\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-0.52200000000019\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,-0.277000000000157\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,-0.166000000000167\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,-0.0230000000001667\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.331999999999823\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.509999999999792\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.146999999999792\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,-0.0400000000002194\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-0.74000000000018\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,-1.17700000000022\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,-1.35500000000022\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,-1.20700000000022\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-1.60900000000018\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,-1.25700000000018\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,-1.11500000000018\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,-1.07900000000015\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-1.35600000000017\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,-0.606000000000194\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-0.574000000000183\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-1.03400000000019\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-1.79700000000017\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-1.97700000000017\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,-3.2270000000002\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,-3.71000000000021\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,-3.31900000000022\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,-2.14200000000019\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,-0.949000000000183\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0.69799999999978\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,2.21099999999979\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,3.2139999999998\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,3.5109999999998\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,3.30799999999977\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,3.22399999999979\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,2.80299999999977\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,2.52999999999977\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,2.50499999999977\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,2.33699999999979\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,2.21799999999982\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,2.14999999999981\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,1.79499999999982\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,1.45499999999984\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,1.49999999999986\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,1.23899999999986\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.965999999999895\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.887999999999892\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.705999999999904\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.531999999999869\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.495999999999867\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.530999999999864\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.68499999999986\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.93499999999986\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.953999999999866\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,1.06999999999988\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,1.0929999999999\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.756999999999863\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.450999999999823\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.37299999999982\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.132999999999811\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.0509999999997888\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.22799999999981\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.182999999999765\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-0.368000000000194\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,-0.71700000000024\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-1.50800000000024\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,-2.30300000000025\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-3.09700000000029\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,-2.76100000000031\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,-2.15500000000029\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,-0.881000000000284\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0.624999999999716\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,2.46499999999975\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,3.19999999999973\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,3.10699999999977\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,2.76399999999978\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,1.98099999999977\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.775999999999755\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,-0.056000000000239\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-0.894000000000233\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-2.00400000000027\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,-2.54600000000028\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,-2.2890000000003\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,-2.17300000000029\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-1.40800000000027\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-0.292000000000286\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.0919999999997003\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-0.632000000000289\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,-0.776000000000295\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,-0.929000000000286\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,-1.05500000000026\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,-0.386000000000251\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0.896999999999736\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,1.54099999999971\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,1.66999999999976\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,1.27599999999975\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.340999999999752\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-0.806000000000267\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,-1.54100000000028\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,-1.40000000000029\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,-0.714000000000254\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0.109999999999729\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,1.27199999999976\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1.89599999999979\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,1.88299999999978\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,1.77799999999982\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,1.64499999999981\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,1.45799999999983\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,1.73499999999981\n"
  },
  {
    "path": "Tests/TestData/spy_aps.txt",
    "content": "Date,APS,Close\n2/23/2021,0,246.87\n2/24/2021,0,246.58\n2/25/2021,0,249.21\n2/26/2021,0,250.05\n2/27/2021,0,250.17\n3/2/2021,0,250.09\n3/3/2021,0,249.19\n3/4/2021,0,249.72\n3/5/2021,0,249.97\n3/6/2021,0,250.06\n3/9/2021,0,249.39\n3/10/2021,0,249.44\n3/11/2021,0,248.93\n3/12/2021,0,249.08\n3/13/2021,0,250.05\n3/16/2021,0,250.35\n3/17/2021,0,251.23\n3/18/2021,0,252.32\n3/19/2021,0,252.86\n3/20/2021,0,253.16\n3/23/2021,0,254.66\n3/24/2021,-0.363539286,254.37\n3/25/2021,-0.527367647,253.95\n3/26/2021,1.09154073,254.62\n3/27/2021,0.658551075,255.02\n3/30/2021,-0.624092923,254.64\n3/31/2021,0.500532575,254.95\n4/1/2021,0.605740487,255.29\n4/2/2021,0.321856048,255.47\n4/6/2021,0.446373351,255.72\n4/7/2021,0.125212784,255.79\n4/8/2021,2.557814253,257.11\n4/9/2021,-1.793041845,256.11\n4/10/2021,0.747397425,256.56\n4/13/2021,-2.111614238,255.29\n4/14/2021,0.485644434,255.62\n4/15/2021,3.071362842,257.71\n4/16/2021,-1.224808525,256.75\n4/17/2021,0.495813068,257.15\n4/20/2021,0.422018867,257.49\n4/21/2021,0.123924302,257.59\n4/22/2021,1.146788343,258.45\n4/23/2021,0.525914853,258.85\n4/24/2021,-0.240455878,258.67\n4/25/2021,0.589332932,259.11\n4/26/2021,-1.256067296,258.17\n4/27/2021,-0.103004752,258.09\n4/28/2021,0.308598145,258.33\n4/29/2021,-0.771685772,257.73\n4/30/2021,-1.62728017,256.44\n5/1/2021,2.581286438,258.62\n5/2/2021,-0.781434683,257.86\n5/3/2021,0.463860021,258.3\n5/4/2021,1.83176844,259.99\n5/5/2021,-0.232555213,259.76\n5/6/2021,0.641461891,260.36\n5/7/2021,-0.138173736,260.23\n5/8/2021,3.15145958,262.87\n5/9/2021,-0.164988121,262.71\n5/10/2021,2.3609751,265.01\n5/11/2021,-0.51039093,264.46\n5/12/2021,-0.29276054,264.14\n5/13/2021,-0.868555339,263.19\n5/14/2021,0.044567061,263.24\n5/15/2021,0.741674942,264.07\n5/16/2021,1.275014935,265.51\n5/17/2021,0.709317764,266.31\n5/18/2021,0.415990455,266.78\n5/19/2021,-0.026520679,266.75\n5/20/2021,-0.981263036,265.66\n5/21/2021,0.781561904,266.51\n5/22/2021,1.662528126,268.2\n5/23/2021,-1.008320996,267.17\n5/24/2021,-0.130531179,267.03\n5/25/2021,0.530602393,267.58\n5/26/2021,-0.067940712,267.51\n5/27/2021,-0.309606959,267.19\n5/28/2021,0.125290428,267.32\n5/29/2021,0.619360294,267.87\n5/30/2021,-1.137547007,266.86\n5/31/2021,2.422983656,268.77\n6/1/2021,1.950055817,270.47\n6/2/2021,1.232950748,271.61\n6/3/2021,2.023598371,273.42\n6/4/2021,0.529473411,273.92\n6/5/2021,0.657622658,274.54\n6/6/2021,-0.457539611,274.12\n6/7/2021,2.146654527,276.12\n6/8/2021,1.796502018,277.92\n6/9/2021,-0.912554158,276.97\n6/10/2021,2.580824462,279.61\n6/11/2021,-0.417378236,279.14\n6/12/2021,1.133077118,280.41\n6/13/2021,2.130853331,282.69\n6/14/2021,0.538159281,283.29\n6/15/2021,-0.098468684,283.18\n6/16/2021,0.107323365,283.3\n6/17/2021,2.983462119,286.58\n6/18/2021,-1.556553619,284.68\n"
  },
  {
    "path": "Tests/TestData/spy_arima.csv",
    "content": ",Date,Open,High,Low,Close,Volume,ARIMA\n0,1999-11-01,136.5,137.0,135.5625,135.5625,4006500.0,\n1,1999-11-02,135.9687,137.25,134.5937,134.5937,6516900.0,\n2,1999-11-03,136.0,136.375,135.125,135.5,7222300.0,\n3,1999-11-04,136.75,137.3593,135.7656,136.5312,7907500.0,\n4,1999-11-05,138.625,139.1093,136.7812,137.875,7431500.0,\n5,1999-11-08,137.0,138.375,136.75,138.0,4649200.0,\n6,1999-11-09,138.5,138.6875,136.2812,136.7031,4533700.0,\n7,1999-11-10,136.25,138.3906,136.0781,137.7187,6405600.0,\n8,1999-11-11,138.1875,138.5,137.4687,138.5,4794100.0,\n9,1999-11-12,139.25,139.9843,137.125,139.75,11802900.0,\n10,1999-11-15,139.8437,140.25,139.4062,140.0781,2187500.0,\n11,1999-11-16,140.5625,143.0,140.0937,141.25,7544800.0,\n12,1999-11-17,142.25,142.9375,141.3125,141.625,9459000.0,\n13,1999-11-18,142.4375,143.0,141.625,142.625,4491000.0,\n14,1999-11-19,142.4062,142.9687,142.0,142.5,4832100.0,\n15,1999-11-22,142.4375,143.0,141.5,142.4687,4155400.0,\n16,1999-11-23,142.8437,142.8437,140.375,141.2187,5918000.0,\n17,1999-11-24,140.75,142.4375,140.0,141.9687,4459700.0,\n18,1999-11-26,142.4687,142.875,141.25,141.4375,1693900.0,\n19,1999-11-29,140.875,141.9218,140.4375,140.9375,7348600.0,\n20,1999-11-30,140.75,142.3125,139.0,139.2812,7682000.0,\n21,1999-12-01,139.3125,140.5,139.0,140.4062,6980200.0,\n22,1999-12-02,140.625,141.375,140.375,141.25,6698300.0,\n23,1999-12-03,143.0312,145.3437,143.0312,143.8437,10045400.0,\n24,1999-12-06,143.5312,143.7187,142.25,142.7812,3138900.0,\n25,1999-12-07,143.2812,143.3125,141.375,141.625,10714200.0,\n26,1999-12-08,141.3437,142.0625,140.5,140.7187,4611400.0,\n27,1999-12-09,141.8125,142.2187,139.375,141.4062,6474700.0,\n28,1999-12-10,142.2812,142.8125,140.875,141.875,5127300.0,\n29,1999-12-13,141.4375,142.7187,141.2812,142.125,4210800.0,\n30,1999-12-14,141.625,142.4843,140.625,140.75,5739000.0,\n31,1999-12-15,140.375,142.2031,140.0312,141.5,6879100.0,\n32,1999-12-16,142.1875,142.6562,141.1562,142.125,5854900.0,\n33,1999-12-17,143.0,143.3125,142.0625,142.6875,4775400.0,\n34,1999-12-20,142.5625,143.1875,141.0937,141.6562,4608700.0,\n35,1999-12-21,141.5937,144.0625,141.3437,143.8125,7981300.0,\n36,1999-12-22,143.625,144.1875,142.9687,144.1875,5377500.0,\n37,1999-12-23,145.0156,146.4843,145.0,146.4843,5721700.0,\n38,1999-12-27,146.5,146.7812,145.0625,146.2812,2691000.0,\n39,1999-12-28,145.875,146.5,145.4843,146.1875,4084500.0,\n40,1999-12-29,146.3125,146.8125,145.3125,146.8125,3001000.0,\n41,1999-12-30,147.125,147.5625,146.1875,146.6406,3641300.0,\n42,1999-12-31,146.8437,147.5,146.25,146.875,3172700.0,\n43,2000-01-03,148.25,148.25,143.875,145.4375,8164300.0,\n44,2000-01-04,143.5312,144.0625,139.6406,139.75,8089800.0,\n45,2000-01-05,139.9375,141.5312,137.25,140.0,12177900.0,\n46,2000-01-06,139.625,141.5,137.75,137.75,6227200.0,\n47,2000-01-07,140.3125,145.75,140.0625,145.75,8066500.0,\n48,2000-01-10,146.25,146.9062,145.0312,146.25,5741700.0,\n49,2000-01-11,145.8125,146.0937,143.5,144.5,7503700.0,\n50,2000-01-12,144.5937,144.5937,142.875,143.0625,6907700.0,144.07965887853265\n51,2000-01-13,144.4687,145.75,143.2812,145.0,5158300.0,143.23356259775124\n52,2000-01-14,146.5312,147.4687,145.9687,146.9687,7437300.0,145.28416250486188\n53,2000-01-18,145.3437,146.625,145.1875,145.8125,6488500.0,146.67341355181682\n54,2000-01-19,145.3125,147.0,145.0,147.0,6157900.0,145.88995622603738\n55,2000-01-20,146.9687,146.9687,143.8125,144.75,5800100.0,147.18477957311137\n56,2000-01-21,145.5,145.5,144.0625,144.4375,6244800.0,145.28780884809714\n57,2000-01-24,145.6562,145.8437,139.4062,140.3437,7896900.0,145.0182423697174\n58,2000-01-25,140.5156,141.9375,139.0,141.9375,9942500.0,142.17436958877101\n59,2000-01-26,141.0,141.5468,140.0937,140.8125,5158100.0,143.06202793308165\n60,2000-01-27,141.8437,142.2187,138.125,140.25,10922700.0,142.12448641222355\n61,2000-01-28,139.4375,140.0625,135.5312,135.875,11916200.0,141.46171937942518\n62,2000-01-31,135.8125,139.6718,135.0,139.5625,10768700.0,136.635794508914\n63,2000-02-01,139.75,141.6875,138.5312,140.9375,8419900.0,140.4389365022193\n64,2000-02-02,141.2812,142.25,140.375,141.0625,6205900.0,141.49855986989564\n65,2000-02-03,140.875,143.25,140.0,143.1875,7997500.0,141.5665941686484\n66,2000-02-04,143.1875,144.0,142.125,142.5937,4925400.0,143.19732154685983\n67,2000-02-07,142.5625,142.7812,141.4375,142.375,5845800.0,142.74694335084928\n68,2000-02-08,143.9687,144.5625,143.625,144.3125,4936400.0,142.57499764950754\n69,2000-02-09,144.4687,144.4687,141.2656,141.2812,8511500.0,144.17461624412812\n70,2000-02-10,141.625,142.5625,140.875,141.5625,6690600.0,141.82182513451698\n71,2000-02-11,141.8437,141.9375,138.0312,138.6875,9849800.0,141.91081879525987\n72,2000-02-14,139.7812,139.7812,138.3125,139.5,8528800.0,139.3406414897422\n73,2000-02-15,139.25,141.2187,137.7968,141.0781,11078300.0,140.08233605594978\n74,2000-02-16,140.375,140.9375,138.7968,139.0,8845400.0,141.2368701574312\n75,2000-02-17,140.4375,140.4375,138.2187,138.2812,7584200.0,139.24552192498044\n76,2000-02-18,138.875,138.875,134.625,135.3125,9409200.0,139.03640349992608\n77,2000-02-22,135.1875,136.3437,133.5312,134.9687,16415400.0,135.65184952201676\n78,2000-02-23,135.625,137.4687,134.5,136.5625,12119000.0,134.59691776556565\n79,2000-02-24,136.6875,137.0312,133.0937,133.8125,17375000.0,136.33422329491475\n80,2000-02-25,135.1875,136.7187,133.125,133.3281,10559900.0,134.87509854034758\n81,2000-02-28,133.375,136.6875,132.7187,136.125,13397800.0,134.29534974003047\n82,2000-02-29,136.0625,137.4375,135.75,137.4375,8242500.0,136.3815179514785\n83,2000-03-01,137.625,139.0,137.2187,138.4375,6868000.0,137.3043300746645\n84,2000-03-02,138.6875,139.125,137.3437,138.5312,7600200.0,137.91160903796705\n85,2000-03-03,140.4375,141.7187,139.7187,141.125,12770300.0,137.80037801314867\n86,2000-03-06,140.8125,141.3437,138.75,139.75,11967100.0,139.59186123797895\n87,2000-03-07,140.0,140.1562,135.2187,137.0468,20062000.0,138.62685397394813\n88,2000-03-08,136.4687,137.8437,135.0312,136.875,11808500.0,136.72093313691224\n89,2000-03-09,137.25,140.875,136.125,140.875,5500900.0,136.52635696655008\n90,2000-03-10,140.1875,142.0,139.5312,140.125,7924600.0,139.26437274716622\n91,2000-03-13,136.6875,140.4687,135.6875,138.5937,10540500.0,138.89077290272866\n92,2000-03-14,139.2812,140.0937,136.1562,136.625,8263900.0,137.8400956378366\n93,2000-03-15,136.875,140.4375,136.0625,139.8125,10300800.0,136.5071075496029\n94,2000-03-16,141.625,146.8437,140.875,146.3437,25601400.0,138.95681488734314\n95,2000-03-17,145.8125,148.0,145.4375,146.9375,10272900.0,144.36658302959975\n96,2000-03-20,146.875,147.3437,144.7812,146.1875,12502300.0,145.82837241767967\n97,2000-03-21,145.5312,149.75,144.5,149.1875,13612600.0,145.3258136194015\n98,2000-03-22,149.5625,150.8437,148.6875,150.0937,8260000.0,148.78769165159582\n99,2000-03-23,149.1562,153.4687,149.1562,152.6562,11654500.0,149.99597367651646\n100,2000-03-24,152.875,155.75,151.7187,153.5625,11462900.0,152.71965862389737\n101,2000-03-27,153.375,153.7812,151.8125,151.9375,8798600.0,153.75850632868662\n102,2000-03-28,151.25,152.9843,150.5937,151.0625,6334400.0,152.00523636819952\n103,2000-03-29,151.5625,152.4843,149.6562,151.2187,6747500.0,151.20499288959596\n104,2000-03-30,150.1562,151.9218,147.125,148.6875,9491900.0,151.14289471065274\n105,2000-03-31,149.625,152.3125,148.4375,150.375,9249100.0,148.622975829615\n106,2000-04-03,150.125,151.25,148.6875,151.25,8508200.0,150.60423707660115\n107,2000-04-04,151.75,153.0,141.3906,150.125,19585500.0,151.32173709214604\n108,2000-04-05,147.875,150.8125,147.625,149.1875,8387200.0,150.14875997503688\n109,2000-04-06,150.25,151.6875,149.0,150.4843,6378500.0,149.28589163497682\n110,2000-04-07,151.5625,152.125,150.5,151.4375,6023600.0,150.93926003574765\n111,2000-04-10,151.75,153.1093,150.3125,150.8437,9624200.0,151.6410863961183\n112,2000-04-11,150.0,151.625,148.375,150.4062,9006400.0,151.04544851125937\n113,2000-04-12,150.375,151.1562,146.1562,146.2812,10779200.0,150.52899389557254\n114,2000-04-13,147.4687,148.1562,143.7812,144.25,12225800.0,145.73294319468715\n115,2000-04-14,142.625,142.8125,133.5,136.0,29604000.0,144.4062112440833\n116,2000-04-17,135.1875,140.75,134.6875,140.75,23918200.0,134.27972716227825\n117,2000-04-18,140.5625,144.4687,139.7812,144.4687,11069200.0,140.81359185836033\n118,2000-04-19,144.5,145.125,142.5312,143.125,6553700.0,144.0036334823255\n119,2000-04-20,143.5625,143.9375,142.375,143.8125,8537600.0,143.3966470685498\n120,2000-04-24,141.5,143.3125,140.5,142.25,12893100.0,143.74737419367696\n121,2000-04-25,144.625,148.1562,144.4375,148.1562,14102000.0,142.26503742241277\n122,2000-04-26,147.9687,148.75,146.0,146.4843,7711100.0,148.8944556648711\n123,2000-04-27,143.0,147.3437,143.0,146.0,15595300.0,146.87336162482515\n124,2000-04-28,147.0,147.8593,145.0625,145.0937,8743400.0,146.4752289433978\n125,2000-05-01,146.5625,148.4843,145.8437,147.0625,7328300.0,145.63031931098394\n126,2000-05-02,145.5,147.125,144.125,144.125,9411900.0,147.9385053191899\n127,2000-05-03,144.0,144.0,139.7812,140.75,12630700.0,143.71123482118568\n128,2000-05-04,142.0,142.3593,140.75,141.8125,5963600.0,141.30620487702487\n129,2000-05-05,141.0625,144.0,140.9375,143.5312,7862400.0,141.52758582145958\n130,2000-05-08,142.75,143.375,141.8437,142.4531,5064100.0,144.01587508260593\n131,2000-05-09,143.0625,143.4062,140.2656,141.3125,5620300.0,142.95176708587468\n132,2000-05-10,140.5,140.9687,137.75,138.125,10293900.0,141.9327766351917\n133,2000-05-11,140.125,141.5,139.125,141.2812,7091100.0,137.6068858156518\n134,2000-05-12,141.8125,143.4687,141.625,142.8125,5960800.0,141.77626954413728\n135,2000-05-15,142.75,145.6093,142.0,145.2812,4441300.0,143.04194086559195\n136,2000-05-16,146.5625,147.7187,145.3125,146.6875,8192200.0,145.855743055952\n137,2000-05-17,145.6875,146.1875,144.4687,145.1562,5907200.0,146.640357584358\n138,2000-05-18,145.625,146.3125,143.375,143.375,4325600.0,145.6223007797908\n139,2000-05-19,142.5625,143.2343,140.4062,141.125,6518400.0,143.55525994781405\n140,2000-05-22,141.25,141.4687,137.0,140.0625,10839400.0,141.04295045465207\n141,2000-05-23,140.4375,140.8125,137.5625,138.0,7979200.0,139.80659819901692\n142,2000-05-24,138.0,140.6875,136.5,140.25,11081500.0,138.41809064060786\n143,2000-05-25,140.6875,141.8125,137.7187,137.8437,8278900.0,140.44590019274088\n144,2000-05-26,138.8125,139.6875,137.3281,138.0,4814000.0,138.33679649687272\n145,2000-05-30,140.0,142.9375,139.4687,142.5,5362700.0,137.7075574774417\n146,2000-05-31,142.5625,144.0,142.0937,142.8125,6056500.0,141.4310609067621\n147,2000-06-01,143.6875,145.4375,143.0,145.3125,8961600.0,141.52957489032687\n148,2000-06-02,148.9375,149.0937,147.4843,147.8437,8962200.0,143.47541878471927\n149,2000-06-05,147.4687,148.2187,146.875,147.125,6998100.0,145.97386824035152\n150,2000-06-06,146.625,147.7812,145.9062,146.4687,4858900.0,145.64710105723867\n151,2000-06-07,146.625,148.0,146.0,147.4843,4919500.0,145.22645539831242\n152,2000-06-08,147.5,147.75,146.0625,146.9062,5723100.0,146.27130591923378\n153,2000-06-09,147.5,147.9687,145.625,146.5937,3085300.0,145.89141197458028\n154,2000-06-12,146.9687,146.9687,144.875,144.875,3678900.0,145.75827450193063\n155,2000-06-13,144.8125,147.75,144.625,147.5937,6558700.0,144.29577809492787\n156,2000-06-14,148.25,148.875,147.1875,147.8437,6420500.0,146.6727862606776\n157,2000-06-15,148.125,148.75,146.8437,148.1562,5881200.0,147.01324332945853\n158,2000-06-16,148.3125,148.3125,145.875,146.5937,5567900.0,147.3759082763759\n159,2000-06-19,146.4687,149.1562,146.25,148.4687,5106900.0,146.17795925835307\n160,2000-06-20,148.1875,148.875,147.0,147.9375,6480000.0,147.72071811793836\n161,2000-06-21,146.9375,148.4375,146.8906,147.875,3115000.0,147.32361839459182\n162,2000-06-22,147.5625,147.6875,145.0,145.625,7490500.0,147.30908916104482\n163,2000-06-23,145.8125,146.125,143.875,144.375,4863300.0,145.74858107663744\n164,2000-06-26,145.375,146.25,144.875,146.2343,5201300.0,144.92096913875375\n165,2000-06-27,145.9843,146.7187,145.0156,145.1562,4159500.0,146.50347289714452\n166,2000-06-28,145.625,146.9843,145.3125,145.5625,5347700.0,145.24637666429751\n167,2000-06-29,144.75,145.75,143.5156,144.1875,6345700.0,145.58392486175367\n168,2000-06-30,143.9375,145.5937,143.8906,145.2812,7420200.0,144.21018418944809\n169,2000-07-03,145.4375,147.4375,145.1875,147.2812,1436600.0,145.3087494630444\n170,2000-07-05,146.375,146.6562,144.375,144.625,2748200.0,147.17052946668656\n171,2000-07-06,144.9375,146.4687,144.2187,145.75,5963200.0,144.75649902995784\n172,2000-07-07,146.6875,148.7812,146.25,148.0937,3034800.0,145.80800496203526\n173,2000-07-10,147.875,148.9062,147.5312,147.8437,2816100.0,148.13392660475944\n174,2000-07-11,147.4687,149.125,147.1562,148.1562,5431600.0,147.93928254392\n175,2000-07-12,149.2812,150.125,148.6875,149.125,5883000.0,148.00632016502314\n176,2000-07-13,149.9843,150.375,149.1875,149.7812,5356000.0,148.93156226254658\n177,2000-07-14,150.4375,151.25,149.6718,151.25,5341900.0,149.6526914984418\n178,2000-07-17,150.9843,151.9843,150.6875,151.0,4208300.0,151.5043405191528\n179,2000-07-18,150.625,150.625,149.3437,149.7656,4262100.0,150.75689838939786\n180,2000-07-19,149.4687,149.9062,148.25,148.5625,8506800.0,149.829849224772\n181,2000-07-20,149.0,150.625,148.8125,150.625,4538900.0,148.77906339167083\n182,2000-07-21,149.75,149.75,147.6875,147.6875,5656900.0,150.9001066124166\n183,2000-07-24,148.125,148.8593,146.5625,146.8437,5628500.0,148.2404080246501\n184,2000-07-25,147.75,147.8437,146.7812,147.3125,4757100.0,147.0170438094329\n185,2000-07-26,146.9687,147.1562,145.6406,145.875,12062500.0,147.31182064529918\n186,2000-07-27,145.9375,146.625,144.6875,145.375,7652600.0,146.32000022719296\n187,2000-07-28,145.7187,145.9062,141.5156,142.0937,6229500.0,145.93391806164772\n188,2000-07-31,142.9375,144.125,142.0625,143.0,5265500.0,142.50216331280993\n189,2000-08-01,143.625,144.7187,143.125,143.875,3946600.0,142.95149963057872\n190,2000-08-02,143.875,145.4062,143.625,144.5937,7439800.0,143.80262115905208\n191,2000-08-03,142.875,145.8125,142.625,145.5937,4607100.0,144.6116633310579\n192,2000-08-04,146.3125,146.7187,145.4062,146.375,3686600.0,145.5898722125812\n193,2000-08-07,146.7187,148.4375,146.375,148.125,4159800.0,146.49316437255857\n194,2000-08-08,147.5,148.8125,147.5,148.6875,3658700.0,148.16602878856008\n195,2000-08-09,149.1406,149.2187,147.375,147.4375,5383800.0,148.59783630497134\n196,2000-08-10,147.5312,147.8593,146.2812,146.7187,4193400.0,147.66701459380258\n197,2000-08-11,146.625,148.0,145.5625,147.4062,5089400.0,146.94107967856468\n198,2000-08-14,147.7812,149.5625,147.0625,149.2812,2966700.0,147.31802830166487\n199,2000-08-15,149.3437,149.8125,148.5625,149.1562,5564600.0,148.9763947908178\n200,2000-08-16,149.3125,149.9375,147.8437,148.625,5191600.0,149.1346609985755\n201,2000-08-17,148.6875,150.4375,148.3437,150.1875,5652200.0,148.7191053764749\n202,2000-08-18,150.375,150.375,149.2187,149.6875,4626400.0,150.01317134914777\n203,2000-08-21,150.0312,150.7187,149.4062,150.5,2380600.0,149.6571856330662\n204,2000-08-22,150.5625,151.3125,150.0937,150.25,3075300.0,150.50779426438132\n205,2000-08-23,149.8125,151.2812,149.2812,150.8437,5483200.0,150.3261962963323\n206,2000-08-24,151.1562,151.5,150.5,151.3125,4529000.0,150.82395572890982\n207,2000-08-25,151.1562,151.625,150.9375,151.25,2822200.0,150.96568427306357\n208,2000-08-28,151.25,152.9062,151.25,151.7656,5518700.0,151.34300666233958\n209,2000-08-29,151.4375,151.875,150.9062,151.7968,3561900.0,151.54892823698327\n210,2000-08-30,151.3125,151.5,150.3437,150.3437,3964800.0,151.87075401553528\n211,2000-08-31,151.0625,153.0937,150.9062,152.3437,4863100.0,150.60785717285003\n212,2000-09-01,153.25,153.5937,152.0,152.5,3191200.0,152.9807650668445\n213,2000-09-05,151.875,152.2031,150.8125,151.2812,3470800.0,152.59893668738792\n214,2000-09-06,151.1875,151.9531,149.5312,149.5625,4322200.0,151.584982873622\n215,2000-09-07,150.25,151.0781,149.8281,150.8437,4265500.0,149.93406131199154\n216,2000-09-08,150.2812,150.5,149.3281,149.8125,3518200.0,150.88623921639802\n217,2000-09-11,149.75,151.1875,148.6875,149.5937,3937500.0,150.05942492706043\n218,2000-09-12,149.75,150.25,148.4375,148.5,4769100.0,149.75493348645156\n219,2000-09-13,148.0,149.3437,147.6562,148.8906,7691600.0,148.64757257793175\n220,2000-09-14,149.875,149.9375,148.1562,149.6406,3397100.0,149.1422077732342\n221,2000-09-15,148.1875,148.25,146.0,146.0,4085700.0,149.65985014359157\n222,2000-09-18,146.375,146.9687,144.2031,144.6562,5109300.0,146.3512839289298\n223,2000-09-19,145.125,146.3125,144.7031,145.9687,6588200.0,144.67234662022173\n224,2000-09-20,145.6875,146.0312,143.1562,144.8906,6508100.0,145.87895617071487\n225,2000-09-21,144.4687,145.5625,142.625,142.6875,5972300.0,144.8815247738114\n226,2000-09-22,142.625,145.3125,142.4218,145.2812,7791300.0,142.76620431845026\n227,2000-09-25,145.9375,146.0625,143.7187,144.25,9726300.0,144.8216992378041\n228,2000-09-26,144.375,145.0,142.4062,142.4062,5302400.0,144.18365550459706\n229,2000-09-27,143.5625,143.9687,142.125,143.1562,7186200.0,142.57962073880833\n230,2000-09-28,143.1875,146.3281,142.8906,145.0,7036400.0,142.98356466791114\n231,2000-09-29,145.4687,145.9687,143.625,143.625,9333600.0,144.67294987773667\n232,2000-10-02,144.2812,144.9062,143.1406,143.8437,5517800.0,143.63968805090335\n233,2000-10-03,144.5312,145.75,142.2812,142.5,9347200.0,143.77365303363058\n234,2000-10-04,142.875,144.25,141.75,143.6875,6148900.0,142.60130275863477\n235,2000-10-05,143.4062,144.8437,143.3125,144.1875,4566900.0,143.50814404770298\n236,2000-10-06,143.875,144.6406,139.75,141.0625,10014900.0,143.99777032132408\n237,2000-10-09,141.3125,141.3125,139.375,140.0,4508000.0,141.10057282229252\n238,2000-10-10,140.0937,141.25,137.6875,137.6875,6104700.0,139.9876894394005\n239,2000-10-11,137.625,138.625,135.125,136.5312,10346000.0,137.61351149603198\n240,2000-10-12,137.2812,137.5937,132.7812,133.125,12336900.0,136.4106883352406\n241,2000-10-13,132.9375,137.6562,132.875,137.5625,11778800.0,132.91525922112774\n242,2000-10-16,137.4062,138.2343,136.6875,138.1875,5659000.0,136.50228107849793\n243,2000-10-17,138.4375,138.5625,134.4062,134.75,7831700.0,137.5389372046562\n244,2000-10-18,132.625,136.125,130.1562,134.25,10897300.0,135.04268083664863\n245,2000-10-19,136.8437,139.4531,136.4375,139.3125,8767300.0,134.26938191295764\n246,2000-10-20,138.375,141.1875,138.375,139.9062,7373500.0,137.81546138007388\n247,2000-10-23,139.9375,141.0312,138.9375,140.5312,5290000.0,139.50073940022523\n248,2000-10-24,140.9687,141.9375,139.0,139.5937,5750700.0,139.82034381363826\n249,2000-10-25,138.75,139.5625,136.125,136.3125,9137600.0,139.24959509709515\n250,2000-10-26,137.125,137.6562,134.0312,136.6875,9345800.0,136.1983184287265\n251,2000-10-27,137.875,139.2812,136.625,139.2812,9762900.0,136.24929746405985\n252,2000-10-30,138.4375,141.0937,138.1562,140.5312,10154100.0,138.09051383695873\n253,2000-10-31,141.0156,143.6875,140.0625,142.9531,7752400.0,139.08126926263802\n254,2000-11-01,142.25,143.25,141.2187,142.4687,6753600.0,141.53966033033893\n255,2000-11-02,143.1562,143.9062,142.5156,142.7031,11395100.0,141.28776312165837\n256,2000-11-03,143.4687,143.75,142.375,142.7812,5187100.0,141.67205736055158\n257,2000-11-06,143.1562,144.2968,143.0312,143.7812,4042500.0,142.3016222289199\n258,2000-11-07,143.1406,144.0,142.5625,143.75,5231300.0,143.29633718319374\n259,2000-11-08,144.0625,144.0625,140.5625,140.5625,6123300.0,143.37963805506192\n260,2000-11-09,140.0,141.2187,137.25,140.0312,10635300.0,140.49296369439134\n261,2000-11-10,139.0,139.4687,136.5312,136.625,8569500.0,139.9362314989257\n262,2000-11-13,135.625,136.9843,133.0156,135.5625,17285300.0,136.35078649267714\n263,2000-11-14,137.4687,139.625,137.0,139.125,7668900.0,135.0476095524761\n264,2000-11-15,139.0625,140.1093,137.75,139.5625,8837700.0,138.54620553296073\n265,2000-11-16,138.5781,139.875,137.3125,137.375,6684100.0,138.97982252452147\n266,2000-11-17,137.3125,139.0,135.75,136.6406,6551100.0,137.07526428114332\n267,2000-11-20,135.75,136.375,134.3125,134.6875,5458500.0,136.42329632045232\n268,2000-11-21,134.875,136.1875,133.5156,135.375,7684300.0,134.7343319345797\n269,2000-11-22,134.3437,134.875,132.125,132.1406,5736900.0,135.3647814972206\n270,2000-11-24,133.625,134.9687,133.625,134.8437,3411600.0,132.37360460241888\n271,2000-11-27,136.4687,136.6875,135.3125,136.0312,5992000.0,134.82888622360935\n272,2000-11-28,135.125,136.5937,133.6406,133.6875,5336100.0,135.86117110351086\n273,2000-11-29,134.375,135.9062,133.2656,133.4375,6914100.0,133.8583984438634\n274,2000-11-30,132.5,133.5,129.75,132.2812,11201600.0,133.08349788837933\n275,2000-12-01,133.1875,134.0625,131.0,132.2187,7587200.0,132.07794307157786\n276,2000-12-04,131.875,133.875,131.5,133.3437,6996600.0,132.36861679700073\n277,2000-12-05,134.875,138.25,134.4062,137.7187,8883400.0,133.18567196243708\n278,2000-12-06,137.7812,138.3437,135.0312,135.5156,12888000.0,137.0239917282082\n279,2000-12-07,134.875,135.875,133.6562,133.6562,6529100.0,134.98073646224887\n280,2000-12-08,137.0625,139.4687,133.875,133.9687,10276300.0,133.59221630794676\n281,2000-12-11,137.375,139.5625,136.7187,138.625,6405600.0,133.8500598729537\n282,2000-12-12,138.1875,138.8125,137.375,138.0312,5022900.0,138.9343330321416\n283,2000-12-13,139.25,139.4062,136.0312,136.1406,6070500.0,137.29992353428523\n284,2000-12-14,135.875,136.5,134.0312,134.4062,7678400.0,136.1675169077839\n285,2000-12-15,133.125,133.125,130.5625,130.9687,9065300.0,134.3222135180099\n286,2000-12-18,132.0625,133.4687,131.7656,132.7187,7235400.0,130.56399218874833\n287,2000-12-19,132.4687,134.9687,130.0156,130.0156,9616600.0,132.96425263760608\n288,2000-12-20,128.625,128.9375,126.0937,126.25,9994300.0,130.7643257908347\n289,2000-12-21,126.0,128.8593,125.5312,127.125,14331500.0,125.68288931002402\n290,2000-12-22,129.0,131.1093,128.8437,130.9375,10182900.0,127.51130567179742\n291,2000-12-26,130.8437,132.3437,130.2812,132.3437,4665300.0,131.36652049785366\n292,2000-12-27,131.75,133.7343,131.25,133.3125,4854100.0,132.11731736950614\n293,2000-12-28,132.8125,133.875,132.5937,133.7187,8358700.0,133.58100843675223\n294,2000-12-29,134.0625,134.2812,131.1875,131.1875,8774600.0,133.48799043326952\n295,2001-01-02,132.0,132.2,127.6,128.8,8737500.0,130.76141810104485\n296,2001-01-03,128.3,136.0,127.7,135.0,19431600.0,128.29692100161566\n297,2001-01-04,134.9,135.5,133.0,133.5,9219000.0,133.46550821436722\n298,2001-01-05,133.5,133.6,129.2,129.2,12911400.0,132.49894026689162\n299,2001-01-08,129.9,130.2,127.7,130.2,6625300.0,129.3915112350543\n300,2001-01-09,131.0,131.5,129.4,129.8,5702400.0,129.90283022317053\n301,2001-01-10,129.0,132.1,128.8,132.1,8746100.0,129.43433815711674\n302,2001-01-11,131.1,133.5,131.1,132.3,7245100.0,130.8783136043098\n303,2001-01-12,132.7,133.7,131.3,132.0,7244000.0,131.05244071963386\n304,2001-01-16,132.0,133.2,131.5,132.8,8542200.0,130.89428077175006\n305,2001-01-17,134.8,135.0,132.6,133.5,7851400.0,131.5190069946642\n306,2001-01-18,133.4,135.7,132.9,134.8,8107000.0,132.1284268578552\n307,2001-01-19,136.1875,136.1875,133.875,134.0156,7782500.0,133.26244841006954\n308,2001-01-22,134.3,135.8,133.6,134.9,7050900.0,132.7264802510647\n309,2001-01-23,134.5,136.7,134.2,136.0,8463100.0,133.45195732714845\n310,2001-01-24,136.3,137.3,135.8,136.4,6199900.0,134.4339247639986\n311,2001-01-25,136.3,137.3,135.7,136.0,10818300.0,135.04159781919142\n312,2001-01-26,135.2,136.1,134.5,135.9,583200.0,134.92280754454552\n313,2001-01-29,135.5,136.9,135.4,136.6,6705900.0,134.96324468307273\n314,2001-01-30,136.3,137.9,135.8,137.8,7069100.0,135.62023117246022\n315,2001-01-31,137.4,138.7,136.6,137.0,9706900.0,136.7235612318095\n316,2001-02-01,137.1,138.0,136.3,137.9,8239100.0,136.19641149106815\n317,2001-02-02,137.4,138.0,134.8,134.8,8276400.0,137.05669658558767\n318,2001-02-05,134.8,135.9,134.8,135.8,4352900.0,133.7419594639669\n319,2001-02-06,135.3,136.7,135.2,135.4,7106700.0,135.54497054558038\n320,2001-02-07,134.7,135.4,133.7,134.7,5748700.0,135.21007688554684\n321,2001-02-08,134.8,135.4,133.1,133.1,5943300.0,134.66324657000925\n322,2001-02-09,133.4,133.4,131.3,131.8,9913000.0,133.5158265027218\n323,2001-02-12,131.7,133.5,131.7,133.4,5804400.0,132.4571494314406\n324,2001-02-13,133.7,134.2,132.0,132.3,6587600.0,133.70450662275502\n325,2001-02-14,132.7,132.7,130.7,132.1,8400100.0,132.8436256258322\n326,2001-02-15,132.8,133.5,132.0,133.3,5929800.0,131.94618265220734\n327,2001-02-16,131.0,131.3,129.3,130.4,6434900.0,133.33380247548772\n328,2001-02-20,131.0,131.1,128.1,128.4,5760000.0,131.08420148932217\n329,2001-02-21,127.9,128.8,125.5,125.6,10910800.0,129.2957712513797\n330,2001-02-22,126.4,126.5,123.0,125.8,21281600.0,126.41710787518788\n331,2001-02-23,125.1,125.5,121.8,125.0,20173000.0,125.95379374771223\n332,2001-02-26,125.8,127.6,124.5,127.6,11503700.0,124.88723072167942\n333,2001-02-27,126.8,127.8,125.5,126.4,11415200.0,127.4016740306841\n334,2001-02-28,126.8,126.8,123.3,124.0,14825800.0,126.03943183056255\n335,2001-03-01,124.1,124.6,121.8,124.6,14672000.0,124.00220732939304\n336,2001-03-02,122.5,125.7,122.3,123.6,12564300.0,124.5963779940328\n337,2001-03-05,124.2,124.8,123.8,124.7,5292900.0,123.7029729564083\n338,2001-03-06,126.4,127.8,125.5,126.1,363400.0,124.79372070766905\n339,2001-03-07,126.9,127.0,125.8,127.0,6371700.0,125.75692177073813\n340,2001-03-08,126.6,127.2,126.1,127.1,6055000.0,126.4945291831459\n341,2001-03-09,126.1,126.1,123.1,123.4,10020300.0,126.73417282407804\n342,2001-03-12,122.3,122.5,117.8,118.1,13973100.0,123.85166595326689\n343,2001-03-13,119.4,120.4,117.5,120.0,12888000.0,118.63366427488982\n344,2001-03-14,117.1,119.3,115.8,117.7,222600.0,120.00075552071287\n345,2001-03-15,118.5,118.9,117.4,117.7,10370300.0,117.81087860683687\n346,2001-03-16,117.1,117.4,114.8,115.0,58514600.0,117.56381252205252\n347,2001-03-19,115.8,117.7,114.8,117.4,10067800.0,115.03318679512152\n348,2001-03-20,117.9,118.5,114.1,114.2,15090700.0,116.56618884740153\n349,2001-03-21,114.2,115.3,111.9,112.3,19676200.0,114.87385422958876\n350,2001-03-22,112.0,112.6,108.0,111.1,28626600.0,112.00698637782584\n351,2001-03-23,113.3,114.7,111.5,114.5,12861700.0,111.06868404807975\n352,2001-03-26,115.7,116.3,114.8,115.9,9998400.0,113.25099778428981\n353,2001-03-27,115.6,118.7,115.3,118.3,12904400.0,115.61349841317427\n354,2001-03-28,116.9,117.0,114.9,115.0,11188500.0,117.80264766893555\n355,2001-03-29,114.7,116.5,109.3,115.5,12061600.0,115.60053998708513\n356,2001-03-30,115.6,116.7,114.5,116.7,9183600.0,114.2172869554824\n357,2001-04-02,116.3,117.4,113.8,114.2,10559100.0,115.83717489290798\n358,2001-04-03,114.0,114.2,110.1,110.4,12838000.0,113.52350773299953\n359,2001-04-04,110.6,112.1,109.3,110.9,14887300.0,110.37711934411651\n360,2001-04-05,113.3,115.5,112.5,115.1,21528500.0,110.47402675910912\n361,2001-04-06,114.0,114.4,112.1,113.3,14937800.0,113.26412278190914\n362,2001-04-09,114.0,115.0,112.8,114.6,9036900.0,111.90418414893131\n363,2001-04-10,115.5,117.8,115.2,116.7,17877100.0,112.76250679385996\n364,2001-04-11,118.8,119.0,116.1,116.7,12735100.0,114.68213439486412\n365,2001-04-12,116.3,118.9,116.0,118.9,9233200.0,116.24102489403688\n366,2001-04-16,118.3,118.9,116.9,117.6,7351000.0,118.40092679754193\n367,2001-04-17,117.3,119.7,117.0,119.3,10927400.0,116.42714874643555\n368,2001-04-18,121.1,126.0,120.7,124.0,32492900.0,118.2991475499575\n369,2001-04-19,124.3,125.8,123.6,125.7,13810800.0,123.46042292478954\n370,2001-04-20,124.7,125.4,123.7,124.5,7626700.0,125.54638238576024\n371,2001-04-23,123.7,123.9,121.9,122.2,8451800.0,124.38283151859234\n372,2001-04-24,122.5,123.7,121.1,121.6,10046800.0,121.94280746414766\n373,2001-04-25,121.4,123.7,121.0,123.2,8249000.0,121.3570796176071\n374,2001-04-26,123.7,125.2,123.5,123.7,10590700.0,123.08712785271555\n375,2001-04-27,124.9,125.8,124.2,125.8,8048900.0,123.55256663636432\n376,2001-04-30,126.5,127.3,124.7,124.9,10766900.0,125.7227720416933\n377,2001-05-01,125.1,127.2,124.6,127.1,10578300.0,124.7504763799875\n378,2001-05-02,127.4,127.7,126.0,126.8,9572900.0,126.87159712458416\n379,2001-05-03,126.1,126.2,124.2,125.2,9926200.0,127.1585120144426\n380,2001-05-04,123.7,127.4,123.4,127.3,12145300.0,124.87571964928222\n381,2001-05-07,126.9,127.4,126.2,126.2,7185200.0,127.38146991526988\n382,2001-05-08,126.9,127.1,125.6,126.2,6952900.0,126.06343944416938\n383,2001-05-09,125.3,126.6,125.1,125.7,9507400.0,126.33479077970628\n384,2001-05-10,127.3,127.5,125.8,126.0,6872400.0,125.7355193663481\n385,2001-05-11,126.0,126.5,124.4,125.2,7739400.0,126.0306064800677\n386,2001-05-14,124.9,125.4,124.5,125.4,7914000.0,125.2653326620309\n387,2001-05-15,125.6,126.5,124.9,126.0,9782500.0,125.42704701894306\n388,2001-05-16,124.8,129.2,124.6,129.0,14916200.0,125.97954421379632\n389,2001-05-17,129.1,130.1,128.6,129.2,11828900.0,129.04696697848885\n390,2001-05-18,129.1,129.7,128.1,129.7,6683300.0,129.1529896198998\n391,2001-05-21,129.8,131.8,129.2,131.7,11532100.0,129.82764540395445\n392,2001-05-22,131.8,132.1,131.1,131.5,8343200.0,131.9793836743505\n393,2001-05-23,131.1,131.1,129.3,129.3,12331000.0,131.46129351533324\n394,2001-05-24,129.5,130.0,128.6,129.6,7906300.0,129.66152804365967\n395,2001-05-25,129.7,129.7,127.9,128.1,7425000.0,129.80047658850856\n396,2001-05-29,128.2,128.4,126.9,127.1,9012300.0,128.30227753250247\n397,2001-05-30,126.6,127.1,125.0,125.3,10041800.0,128.04473106535275\n398,2001-05-31,125.4,126.8,125.3,126.0,9875200.0,126.56985895615945\n399,2001-06-01,126.3,127.1,125.1,126.7,8848300.0,126.6301282626623\n400,2001-06-04,126.8,127.4,126.1,127.3,5634700.0,127.68806061995929\n401,2001-06-05,127.5,129.2,127.3,128.8,9115900.0,128.08412830657454\n402,2001-06-06,128.8,128.8,127.4,127.7,12067600.0,128.63824418958862\n403,2001-06-07,127.1,128.4,127.0,128.2,7358900.0,128.24448737783248\n404,2001-06-08,127.7,127.9,126.1,127.0,8170600.0,128.30513080529937\n405,2001-06-11,126.7,127.0,125.4,126.1,7012200.0,127.39882642958908\n406,2001-06-12,124.9,126.7,124.0,125.9,9369200.0,126.71553531736761\n407,2001-06-13,126.2,126.6,124.7,124.8,7629600.0,126.45992865819913\n408,2001-06-14,124.2,124.3,121.8,122.0,12603300.0,125.17350304253593\n409,2001-06-15,120.9,122.4,120.4,121.9,16821300.0,122.23497834418573\n410,2001-06-18,121.7,122.4,120.9,121.3,11376600.0,122.02412250559347\n411,2001-06-19,122.4,122.9,120.9,121.8,7732300.0,121.49779510832285\n412,2001-06-20,121.2,122.9,121.1,122.4,8787200.0,121.97313251412884\n413,2001-06-21,122.2,124.3,122.2,123.8,12259100.0,122.46984501958006\n414,2001-06-22,123.5,123.6,122.2,122.9,12212000.0,124.10257972956731\n415,2001-06-25,123.3,123.4,121.5,121.7,8406800.0,122.80786620078966\n416,2001-06-26,120.9,122.4,120.6,121.6,8006900.0,121.86116177486149\n417,2001-06-27,121.6,122.2,120.9,121.5,10105100.0,121.64517816921285\n418,2001-06-28,122.0,123.9,121.9,122.2,10271000.0,121.44394464283614\n419,2001-06-29,122.8,124.0,122.3,122.6,9824200.0,122.17626864298259\n420,2001-07-02,122.8,124.3,122.6,124.1,8522400.0,122.59036632735899\n421,2001-07-03,124.0,124.1,123.1,124.1,3303100.0,124.07623319254448\n422,2001-07-05,123.1,123.7,121.7,121.7,5520900.0,124.17467401036753\n423,2001-07-06,121.3,121.5,119.1,119.1,11666200.0,121.80764569396997\n424,2001-07-09,119.5,120.5,119.2,119.7,8340500.0,118.7230079746587\n425,2001-07-10,120.3,120.6,118.2,118.3,8631900.0,119.67951354018493\n426,2001-07-11,118.1,118.9,117.1,118.4,15374000.0,118.05614043315764\n427,2001-07-12,119.5,121.5,119.3,121.2,12004800.0,118.22073730167155\n428,2001-07-13,120.8,122.3,120.6,122.2,10433800.0,121.06269271111937\n429,2001-07-16,121.8,122.3,120.3,120.7,6915300.0,122.32734680855259\n430,2001-07-17,120.2,122.0,119.8,121.8,7470300.0,120.25673464538681\n431,2001-07-18,120.6,121.6,120.1,121.0,7710300.0,122.03272475365529\n432,2001-07-19,122.2,123.0,120.8,122.1,10083000.0,120.67486078526795\n433,2001-07-20,121.2,121.9,120.9,121.3,6705800.0,122.2393401456582\n434,2001-07-23,121.8,121.9,119.0,119.0,8067200.0,121.09164843455869\n435,2001-07-24,119.0,119.2,116.8,117.8,12271000.0,118.63054315385241\n436,2001-07-25,117.9,119.5,117.5,119.1,12090900.0,117.87107053973914\n437,2001-07-26,119.1,120.9,118.6,120.4,12930100.0,119.23256569201405\n438,2001-07-27,120.8,121.4,119.9,120.8,8481800.0,120.36803392561391\n439,2001-07-30,121.2,121.4,120.3,120.9,8547700.0,120.67253853092696\n440,2001-07-31,121.0,122.7,120.8,121.4,11918600.0,120.7549100959416\n441,2001-08-01,122.0,122.7,121.6,122.1,11941800.0,121.29491778113683\n442,2001-08-02,123.1,123.3,121.9,122.6,11070200.0,122.03241283115308\n443,2001-08-03,122.4,122.4,120.9,121.9,10817900.0,122.55387883627665\n444,2001-08-06,121.4,121.5,120.1,120.3,8550400.0,121.5893938819128\n445,2001-08-07,120.3,121.2,119.9,120.8,8865100.0,119.88392862119179\n446,2001-08-08,120.1,121.2,118.4,118.5,15183800.0,120.88709198648864\n447,2001-08-09,118.7,119.0,117.9,118.9,14118500.0,117.92931855003087\n448,2001-08-10,118.8,119.8,117.3,119.3,11173300.0,118.85288635013583\n449,2001-08-13,119.6,119.9,118.8,119.3,7435400.0,119.14142257469065\n450,2001-08-14,120.1,120.4,118.8,119.3,13178100.0,119.15911187064418\n451,2001-08-15,119.2,119.6,118.1,118.2,8520600.0,119.11890748715899\n452,2001-08-16,117.8,118.8,117.0,118.7,10735800.0,117.85036870342272\n453,2001-08-17,117.7,117.9,116.0,116.8,11604600.0,118.68712533460783\n454,2001-08-20,116.8,117.9,116.55,117.83,10417400.0,116.31027512199493\n455,2001-08-21,117.8,118.5,115.8,115.8,14481500.0,117.82511907773898\n456,2001-08-22,116.8,117.4,115.8,117.0,11752900.0,116.28645038527503\n457,2001-08-23,117.0,117.5,116.5,116.6,8750300.0,117.22640251433391\n458,2001-08-24,117.2,119.1,116.7,119.0,11688900.0,116.94438693630661\n459,2001-08-27,119.0,119.2,118.3,118.3,7428100.0,118.4871428537286\n460,2001-08-28,118.3,118.5,116.6,116.6,12046600.0,118.15476337068037\n461,2001-08-29,117.1,117.2,115.2,115.5,16181800.0,116.9058401463353\n462,2001-08-30,115.7,115.7,112.0,113.3,17693300.0,115.49362205530824\n463,2001-08-31,113.4,114.8,113.1,114.2,15985700.0,114.05145688927873\n464,2001-09-04,113.9,116.2,113.4,113.4,24476400.0,113.89309134710949\n465,2001-09-05,113.7,114.2,112.0,113.7,21477200.0,113.36351149581822\n466,2001-09-06,112.7,113.3,110.8,110.8,21655500.0,113.41832395653645\n467,2001-09-07,110.0,111.3,108.6,108.7,33133900.0,111.42248266922637\n468,2001-09-10,107.7,110.4,107.7,110.1,23409000.0,109.04926160489576\n469,2001-09-17,101.0,106.4,100.0,104.3,32393800.0,110.37129635297485\n470,2001-09-18,104.3,105.3,103.4,104.1,22029200.0,104.9629189042423\n471,2001-09-19,104.5,104.5,98.56,102.0,42772100.0,103.38273493199436\n472,2001-09-20,101.8,101.8,98.57,98.71,36212800.0,102.16383874162143\n473,2001-09-21,98.99,98.99,93.8,97.28,49783500.0,98.56889341928223\n474,2001-09-24,101.2,101.2,99.06,100.7,25549900.0,96.85219500560125\n475,2001-09-25,100.75,102.0,99.9,101.75,25466200.0,100.38101256248237\n476,2001-09-26,102.4,102.4,100.4,101.4,18587700.0,101.42705782830092\n477,2001-09-27,101.3,102.3,100.0,102.3,20536800.0,100.96159689961885\n478,2001-09-28,103.0,109.9,102.5,104.4,21787700.0,101.7640090929499\n479,2001-10-01,103.9,104.3,102.8,104.3,20457800.0,103.92375051373654\n480,2001-10-02,104.0,105.6,103.7,105.6,19683600.0,103.98627694233814\n481,2001-10-03,107.9,107.9,104.4,107.4,32070200.0,105.15539015472635\n482,2001-10-04,109.0,109.0,106.8,107.4,32675500.0,107.4181935681773\n483,2001-10-05,107.6,107.6,105.5,107.2,29830200.0,107.33194335301172\n484,2001-10-08,107.3,107.3,105.9,106.5,12971200.0,106.94874607017115\n485,2001-10-09,106.8,106.8,105.6,106.0,15976300.0,106.36368143446168\n486,2001-10-10,105.8,108.6,105.5,108.3,19992400.0,105.77130277352134\n487,2001-10-11,109.0,110.3,109.0,110.0,23011600.0,107.86442810030397\n488,2001-10-12,109.2,109.9,107.3,109.5,31363500.0,110.12929318858428\n489,2001-10-15,108.6,109.5,108.1,109.3,16875000.0,109.47095224317391\n490,2001-10-16,109.8,110.6,109.0,110.0,15885900.0,109.19698750042218\n491,2001-10-17,111.1,111.2,107.7,107.7,28601700.0,109.71336832972169\n492,2001-10-18,107.8,108.2,106.8,107.4,16521100.0,107.54169238583628\n493,2001-10-19,107.0,107.9,106.0,107.4,21916300.0,107.02959024477067\n494,2001-10-22,107.3,109.6,107.2,109.5,17571200.0,107.14914860611385\n495,2001-10-23,110.0,110.3,108.4,108.9,22064500.0,109.15103363159987\n496,2001-10-24,109.5,109.5,108.2,108.6,16065400.0,108.78905657431882\n497,2001-10-25,107.5,110.6,106.7,110.6,27504000.0,108.38990049958663\n498,2001-10-26,110.0,111.8,109.7,110.3,18623700.0,110.35243316382186\n499,2001-10-29,110.2,110.6,107.5,107.5,18743900.0,110.1163596283902\n500,2001-10-30,107.7,107.7,105.6,106.2,26197900.0,107.25849583360582\n501,2001-10-31,106.9,107.9,105.8,105.8,28132000.0,105.95526726611932\n502,2001-11-01,106.6,109.0,105.7,108.5,29807300.0,105.53626642213135\n503,2001-11-02,108.4,109.4,107.9,109.3,17577900.0,108.3314286865143\n504,2001-11-05,110.1,111.1,110.0,110.7,16100900.0,109.0319152464841\n505,2001-11-06,110.4,112.5,109.9,112.4,23248100.0,110.7839736060797\n506,2001-11-07,113.1,113.1,111.6,112.3,19717800.0,112.31963387733317\n507,2001-11-08,112.9,114.1,111.9,112.6,22749200.0,112.19457917386977\n508,2001-11-09,112.3,113.0,111.4,112.7,15897500.0,112.43514002084427\n509,2001-11-12,111.0,112.7,110.0,112.0,26096600.0,112.55095613621424\n510,2001-11-13,113.4,114.6,113.2,114.6,15347100.0,111.86595827947927\n511,2001-11-14,115.2,115.4,113.7,114.7,17595500.0,114.84029463414093\n512,2001-11-15,114.4,115.2,113.9,114.9,19472500.0,114.55173530701207\n513,2001-11-16,115.1,115.1,113.4,114.4,18135900.0,115.02860460503094\n514,2001-11-19,114.9,115.9,114.5,115.8,13683600.0,114.31300736484972\n515,2001-11-20,115.4,115.8,114.6,114.8,16223000.0,115.76364632795585\n516,2001-11-21,114.7,114.7,113.5,114.0,11471100.0,115.28092811159252\n517,2001-11-23,115.8,115.8,114.0,115.7,6716900.0,114.1084101237299\n518,2001-11-26,115.8,116.3,115.1,115.9,13729700.0,116.17197604633668\n519,2001-11-27,115.6,116.9,114.1,115.4,19266400.0,115.95117479808783\n520,2001-11-28,115.2,115.2,113.3,113.3,20247200.0,115.72334314446935\n521,2001-11-29,113.7,114.9,113.0,114.9,17267900.0,113.07656873562554\n522,2001-11-30,114.4,114.9,114.0,114.1,13680400.0,115.41176330960236\n523,2001-12-03,114.1,114.1,113.0,113.4,15220400.0,114.75187286895441\n524,2001-12-04,113.9,115.3,113.4,115.3,17245800.0,113.73385421550141\n525,2001-12-05,115.6,118.0,115.6,117.4,25204000.0,115.64206781661282\n526,2001-12-06,117.9,117.9,116.9,117.3,17972900.0,117.49124173875204\n527,2001-12-07,117.1,117.1,115.7,116.6,18908000.0,117.51007271287803\n528,2001-12-10,115.9,116.4,114.4,114.4,13862800.0,116.80935506834123\n529,2001-12-11,114.9,115.7,113.9,114.2,20833500.0,115.26825883522311\n530,2001-12-12,114.6,114.8,113.1,114.3,16172400.0,114.4662950314116\n531,2001-12-13,113.5,113.7,112.0,112.1,19037900.0,114.39304706041803\n532,2001-12-14,112.3,113.5,112.0,113.1,16723100.0,111.95512628486902\n533,2001-12-17,113.0,114.4,112.9,114.3,13947300.0,113.41853554891044\n534,2001-12-18,114.6,115.2,114.3,115.0,13664000.0,114.41117919035527\n535,2001-12-19,114.1,115.9,114.0,115.8,20147400.0,115.47105318567002\n536,2001-12-20,115.5,115.8,114.6,114.7,14867900.0,115.95104286172506\n537,2001-12-21,115.0,115.1,114.2,115.0,14042700.0,114.69419698072387\n538,2001-12-24,114.8,115.0,114.6,114.7,5728800.0,115.06952397133492\n539,2001-12-26,114.7,116.2,114.7,115.4,10307900.0,114.83566138074389\n540,2001-12-27,115.3,116.1,115.3,116.1,9407300.0,115.63262846301191\n541,2001-12-28,116.3,116.8,115.9,116.0,10593800.0,116.1860648925491\n542,2001-12-31,116.2,116.4,114.2,114.3,14620200.0,116.21821497430203\n543,2002-01-02,115.1,115.8,113.8,115.5,18652200.0,114.23375406880322\n544,2002-01-03,117.0,117.0,115.5,116.8,15743100.0,115.97335033237269\n545,2002-01-04,118.0,118.0,116.6,117.6,20140700.0,116.67345563227056\n546,2002-01-07,117.7,118.0,116.6,116.8,13106500.0,118.09980183054324\n547,2002-01-08,116.8,117.1,116.0,116.5,12687200.0,116.98996681726395\n548,2002-01-09,116.7,117.8,115.3,115.6,16616900.0,116.74803026473076\n549,2002-01-10,115.7,116.4,115.3,116.1,12823400.0,115.97771247010799\n550,2002-01-11,116.2,116.3,114.7,114.9,13708500.0,116.35442018840932\n551,2002-01-14,114.7,114.8,114.0,114.2,12304300.0,115.25443777624386\n552,2002-01-15,114.6,115.4,113.9,115.2,20221400.0,114.72112954716887\n553,2002-01-16,114.3,114.4,112.7,112.8,17077200.0,115.59651612367314\n554,2002-01-17,113.8,114.2,113.4,113.7,17707900.0,113.78071049024066\n555,2002-01-18,113.0,113.85,112.67,113.15,17028000.0,114.37349185157211\n556,2002-01-22,113.8,113.9,112.0,112.4,11691000.0,113.89264778425822\n557,2002-01-23,113.6,113.6,112.0,113.2,12439100.0,113.19754085595225\n558,2002-01-24,113.6,114.3,113.3,113.6,12163100.0,113.31812785079767\n559,2002-01-25,113.1,114.2,113.0,113.6,12810700.0,114.00018088028668\n560,2002-01-28,113.9,114.2,112.9,113.9,10589200.0,113.89074047151189\n561,2002-01-29,113.9,114.1,110.1,110.3,27736100.0,114.06933440205687\n562,2002-01-30,110.4,113.4,108.4,111.9,34712000.0,111.36105036730225\n563,2002-01-31,112.2,113.3,111.6,113.2,19847000.0,112.46616424845435\n564,2002-02-01,113.3,113.3,112.2,112.7,15838500.0,113.31783916038215\n565,2002-02-04,112.2,112.2,109.4,109.9,24247500.0,112.97406972929926\n566,2002-02-05,109.4,110.5,108.5,109.2,33614000.0,110.65920241294857\n567,2002-02-06,109.7,109.7,108.1,108.7,29670400.0,109.92369281173556\n568,2002-02-07,108.7,109.9,108.0,108.0,23450200.0,109.1658797967273\n569,2002-02-08,108.6,110.8,108.3,110.1,19278100.0,108.36599255455558\n570,2002-02-11,110.1,111.6,109.8,111.4,18792400.0,110.31528187421472\n571,2002-02-12,111.0,111.7,110.0,111.1,13942500.0,111.3547178624911\n572,2002-02-13,111.5,112.5,111.4,112.3,16791900.0,111.01573262792918\n573,2002-02-14,112.5,113.0,111.6,112.1,20458200.0,112.08056295226865\n574,2002-02-15,112.2,112.2,110.7,110.9,18394600.0,111.82378552335821\n575,2002-02-19,110.15,110.29,108.61,108.76,15988100.0,110.7809798547759\n576,2002-02-20,110.6,110.6,107.8,110.6,29247100.0,109.02226503339969\n577,2002-02-21,109.9,110.6,108.3,108.3,26292800.0,110.44908239430393\n578,2002-02-22,108.4,109.9,107.9,109.6,26572900.0,108.63281136501165\n579,2002-02-25,109.7,111.8,109.7,111.5,17459600.0,109.61977061550884\n580,2002-02-26,111.6,112.0,110.6,111.2,22362900.0,111.04260079746183\n581,2002-02-27,112.0,112.9,110.7,111.7,28597900.0,110.94640057734941\n582,2002-02-28,111.8,112.8,111.0,111.2,23755500.0,111.18039591176682\n583,2002-03-01,111.7,113.9,111.5,113.7,26186600.0,110.66750379111568\n584,2002-03-04,113.9,116.0,113.7,115.8,27187800.0,112.59178798091564\n585,2002-03-05,115.3,116.4,115.0,115.4,22733500.0,115.01261005449985\n586,2002-03-06,115.1,117.2,115.1,116.8,20169700.0,114.79382780850482\n587,2002-03-07,117.4,117.5,115.6,116.5,19331900.0,116.56517317163026\n588,2002-03-08,117.4,117.9,116.5,117.0,19930800.0,116.43842208940094\n589,2002-03-11,116.9,117.9,116.4,117.2,15622100.0,116.94473395353347\n590,2002-03-12,117.3,117.3,115.9,117.2,17155000.0,117.16885234478461\n591,2002-03-13,116.6,116.8,115.6,116.0,17176600.0,117.21574456269667\n592,2002-03-14,116.4,116.4,115.6,115.9,11169600.0,116.17249747056555\n593,2002-03-15,116.0,117.0,115.9,116.7,21222100.0,115.95832182997859\n594,2002-03-18,117.1,117.6,116.1,116.7,17558000.0,116.58640038186678\n595,2002-03-19,117.3,117.7,116.8,117.5,17913600.0,116.5682613742755\n596,2002-03-20,116.5,116.6,115.2,115.2,17128200.0,117.37760006936998\n597,2002-03-21,115.8,115.8,114.1,115.3,26888800.0,115.12412990407842\n598,2002-03-22,115.5,115.9,114.7,115.0,15235400.0,115.38748199920725\n599,2002-03-25,115.1,115.4,113.3,113.6,17507200.0,114.93623032731402\n600,2002-03-26,113.5,115.0,113.5,114.3,19950600.0,113.57244564050949\n601,2002-03-27,115.0,115.0,113.8,114.6,19021400.0,114.30252678419915\n602,2002-03-28,115.0,115.8,114.5,114.5,17535900.0,114.55450306251294\n603,2002-04-01,115.1,115.1,113.5,114.6,17714000.0,114.62479866476163\n604,2002-04-02,114.0,115.0,113.8,113.9,15596700.0,114.6896031450133\n605,2002-04-03,114.0,114.2,112.2,113.1,25662700.0,114.00025136807541\n606,2002-04-04,112.6,113.4,112.2,112.7,23561200.0,113.37400054149431\n607,2002-04-05,113.2,113.6,112.2,112.7,19404900.0,112.791630149531\n608,2002-04-08,111.3,113.0,111.2,112.9,16475300.0,112.72499585691597\n609,2002-04-09,113.2,113.2,111.9,112.1,15122700.0,112.88967190828924\n610,2002-04-10,112.1,113.5,112.1,113.4,17204500.0,112.1475614800698\n611,2002-04-11,112.9,113.1,110.5,110.6,25473600.0,113.63300432938482\n612,2002-04-12,111.0,111.7,110.0,111.4,14950600.0,110.90854551860355\n613,2002-04-15,111.6,111.9,110.2,110.6,17403600.0,111.5403692887985\n614,2002-04-16,111.7,113.3,111.7,113.2,15098400.0,110.748544284193\n615,2002-04-17,113.4,113.7,112.6,113.0,12928600.0,112.60627682070609\n616,2002-04-18,112.9,113.5,111.2,112.5,25519800.0,113.31176212442534\n617,2002-04-19,113.2,113.2,112.6,112.9,10602500.0,112.66549964090993\n618,2002-04-22,112.4,112.4,110.8,111.0,13922900.0,112.91070887101465\n619,2002-04-23,111.1,111.5,110.2,110.5,16967000.0,111.55286510945513\n620,2002-04-24,110.6,111.8,109.4,109.4,18894900.0,110.4914043784306\n621,2002-04-25,109.2,109.7,108.7,109.5,25446400.0,109.61054974565197\n622,2002-04-26,109.8,110.0,107.3,107.4,19770000.0,109.34261827781962\n623,2002-04-29,107.9,108.3,106.6,106.9,17719400.0,107.81324216356717\n"
  },
  {
    "path": "Tests/TestData/spy_aroon_oscillator.txt",
    "content": "Date,Open,High,Low,Close,Aroon Oscillator 14\n1/16/2013 12:00:00 AM,146.77,147.28,146.61,147.05,\n1/17/2013 12:00:00 AM,147.7,148.42,147.43,148,\n1/18/2013 12:00:00 AM,147.97,148.49,147.43,148.33,\n1/22/2013 12:00:00 AM,148.33,149.13,147.98,149.13,\n1/23/2013 12:00:00 AM,149.13,149.5,148.86,149.37,\n1/24/2013 12:00:00 AM,149.15,150.14,149.01,149.41,\n1/25/2013 12:00:00 AM,149.88,150.25,149.37,150.25,\n1/28/2013 12:00:00 AM,150.29,150.33,149.51,150.07,\n1/29/2013 12:00:00 AM,149.77,150.85,149.67,150.66,\n1/30/2013 12:00:00 AM,150.64,150.94,149.93,150.07,\n1/31/2013 12:00:00 AM,149.89,150.38,149.6,149.7,\n2/1/2013 12:00:00 AM,150.65,151.42,150.39,151.24,\n2/4/2013 12:00:00 AM,150.32,150.58,149.43,149.54,\n2/5/2013 12:00:00 AM,150.35,151.48,150.29,151.05,\n2/6/2013 12:00:00 AM,150.52,151.26,150.41,151.16,92.85714\n2/7/2013 12:00:00 AM,151.21,151.35,149.86,150.96,78.57143\n2/8/2013 12:00:00 AM,151.23,151.89,151.22,151.8,100\n2/11/2013 12:00:00 AM,151.75,151.9,151.39,151.77,100\n2/12/2013 12:00:00 AM,151.78,152.3,151.61,152.02,100\n2/13/2013 12:00:00 AM,152.33,152.61,151.72,152.15,100\n2/14/2013 12:00:00 AM,151.69,152.47,151.52,152.29,92.85714\n2/15/2013 12:00:00 AM,152.43,152.59,151.55,152.11,50\n2/19/2013 12:00:00 AM,152.37,153.28,152.36,153.25,71.42857\n2/20/2013 12:00:00 AM,153.14,153.19,151.3,151.34,71.42857\n2/21/2013 12:00:00 AM,150.92,151.42,149.94,150.42,71.42857\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,71.42857\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,-28.57143\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,-35.71429\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,-35.71428\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,-35.71429\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,-35.71428\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,-35.71429\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,35.71429\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,42.85714\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,50\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,57.14286\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,64.28571\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,71.42857\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,78.57143\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,85.71429\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,85.71428\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,85.71429\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,78.57143\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,64.28571\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,64.28571\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,57.14286\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,-21.42857\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,-21.42857\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,-21.42857\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,50\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,57.14286\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,64.28571\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,64.28571\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,64.28571\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,64.28571\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,64.28571\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,21.42857\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,28.57143\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,28.57143\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,28.57143\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,28.57143\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,28.57143\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,-35.71429\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,-35.71428\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,-35.71429\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,-35.71428\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,-35.71429\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,-35.71429\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,-35.71429\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,-35.71429\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,57.14286\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,57.14285\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,71.42857\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,78.57143\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,85.71429\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,92.85714\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,100\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,100\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,92.85714\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,100\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,100\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,92.85714\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,92.85714\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,85.71429\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,92.85714\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,100\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,100\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,92.85714\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,85.71429\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,78.57143\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,71.42857\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,64.28571\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,57.14286\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,-50\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,-50\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,-64.28571\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,-71.42857\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,-71.42857\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,-71.42857\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,-71.42857\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,-71.42857\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,-50\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,-50\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,-50\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,-35.71429\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,-35.71429\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,-100\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,-21.42857\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,-28.57143\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,-28.57143\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,-28.57143\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,-28.57143\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,-28.57143\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,-28.57143\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,-28.57143\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,-28.57143\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,-28.57143\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,-28.57143\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,-28.57143\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,-21.42857\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,85.71429\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,92.85714\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,100\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,92.85714\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,100\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,92.85714\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,92.85714\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,85.71429\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,92.85714\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,100\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,92.85714\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,85.71429\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,78.57143\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,71.42857\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,64.28571\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,85.71429\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,92.85714\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,92.85714\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,35.71429\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,35.71428\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,35.71429\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,35.71429\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,35.71429\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,35.71429\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,35.71429\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,-64.28571\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,-71.42857\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,-78.57143\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,-78.57143\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,-92.85714\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,-92.85714\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,-85.71429\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,-78.57143\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,-92.85714\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,-100\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,-92.85714\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,-78.57143\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,-78.57143\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,-71.42857\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,-64.28571\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,-14.28571\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,50\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,57.14286\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,64.28571\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,71.42857\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,71.42857\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,85.71429\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,85.71428\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,100\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,92.85714\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,92.85714\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,85.71429\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,78.57143\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,64.28571\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,64.28571\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,57.14286\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,-50\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,-50\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,-50\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,-71.42857\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,-71.42857\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,-71.42857\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,-92.85714\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-100\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,-92.85714\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,-85.71429\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,21.42857\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,28.57143\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,35.71429\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,42.85714\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,50\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,57.14286\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,64.28571\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,64.28571\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,64.28571\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,85.71429\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,92.85714\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,100\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,100\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,92.85714\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,85.71429\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,78.57143\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,71.42857\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,64.28571\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,100\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,78.57143\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,78.57143\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,78.57143\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,100\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,35.71429\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,42.85714\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,50\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,50\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,50\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,50\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,78.57143\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,85.71429\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,92.85714\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,100\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,100\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,78.57143\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,78.57143\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,78.57143\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,42.85715\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,42.85714\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,42.85714\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,42.85714\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,42.85714\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,-64.28571\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,-64.28571\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,-64.28571\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,-64.28571\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,-92.85714\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,-92.85714\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,14.28571\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,21.42857\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,28.57143\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,35.71429\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,42.85714\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,42.85714\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,57.14286\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,57.14285\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,57.14286\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,57.14285\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,57.14286\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,57.14286\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,57.14286\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,42.85714\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,42.85714\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,-57.14285\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,14.28571\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,14.28571\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,14.28571\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,14.28571\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,14.28572\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,14.28571\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,-42.85714\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,-50\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,-50\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,-64.28571\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,-64.28571\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,-64.28571\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-85.71429\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,-85.71428\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,-100\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,-78.57143\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,-78.57143\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,-78.57143\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,-71.42857\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,-64.28571\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,42.85714\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,50\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,57.14286\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,64.28571\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,64.28571\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,64.28571\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,85.71429\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,85.71428\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,85.71429\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,78.57143\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,100\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,92.85714\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,100\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,92.85714\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,100\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,78.57143\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,78.57143\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,78.57143\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,78.57143\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,28.57143\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,28.57143\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,28.57143\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,28.57143\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,28.57143\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,28.57143\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,100\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,35.71428\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,35.71429\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,35.71428\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,-28.57143\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,-28.57143\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,-28.57143\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,-28.57143\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,28.57143\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,35.71429\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,42.85714\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,42.85714\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,-14.28571\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,-14.28571\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,-28.57143\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,-35.71429\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,-35.71428\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,-35.71429\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,-35.71428\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,-35.71429\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,-35.71429\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,-35.71429\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,-35.71429\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,-35.71429\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,-35.71429\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,42.85715\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,42.85714\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,85.71429\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92.85714\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,100\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,92.85714\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85.71429\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,78.57143\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,28.57143\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,28.57143\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,71.42857\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,78.57143\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,78.57143\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,78.57143\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,78.57143\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,28.57143\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,28.57143\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,28.57143\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,28.57143\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,85.71429\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,92.85714\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,100\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64.28571\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,71.42857\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,78.57143\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,78.57143\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,92.85714\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,100\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,100\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,92.85714\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,92.85714\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,85.71429\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,78.57143\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,71.42857\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,64.28571\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,57.14286\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,100\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,92.85714\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,92.85714\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,85.71429\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,78.57143\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,71.42857\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,35.71429\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,35.71429\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,35.71429\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,92.85714\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,92.85714\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,100\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,92.85714\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,85.71429\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,35.71428\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,35.71429\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,35.71429\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,35.71429\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,35.71429\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,35.71429\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,35.71429\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,28.57143\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,-28.57143\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,57.14286\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,64.28571\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,71.42857\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,71.42857\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,71.42857\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,71.42857\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,71.42857\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,-35.71429\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,-42.85714\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,-42.85714\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,-57.14286\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,-64.28571\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,-71.42857\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,-71.42857\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,-71.42857\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,-71.42857\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,-71.42857\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,-50\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,-50\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,-50\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,57.14286\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,64.28571\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,71.42857\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,71.42857\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,85.71429\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,92.85714\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,92.85714\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,85.71429\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,71.42857\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,100\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,100\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,92.85714\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,92.85714\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,85.71429\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,78.57143\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,71.42857\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,57.14286\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,-42.85714\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,-50\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,-50\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,14.28571\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,21.42857\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,28.57143\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,28.57143\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,-14.28571\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,-21.42857\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,-28.57143\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,-28.57143\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,-42.85714\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,-42.85714\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,-57.14286\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,-64.28571\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,-64.28571\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,-64.28571\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,-64.28571\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,-64.28571\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,-64.28571\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,-100\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,-92.85714\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,-100\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,-100\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,-92.85714\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-78.57143\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,-78.57143\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,-50\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,-50\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,-50\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,-50\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,-35.71429\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,64.28571\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,71.42857\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,78.57143\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,85.71429\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,92.85714\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,92.85714\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,100\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,100\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,100\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,100\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,100\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,92.85714\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,100\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,92.85714\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,85.71429\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,100\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,92.85714\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,71.42857\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,92.85714\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,92.85714\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,85.71429\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,78.57143\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,100\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,92.85714\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,71.42857\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,92.85714\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,100\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,92.85714\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,92.85714\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,-14.28571\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,-21.42857\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,-21.42857\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,-35.71429\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,-42.85714\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,-50\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,-50\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,14.28571\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,14.28571\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,14.28571\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,14.28571\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,14.28572\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,14.28571\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,14.28571\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,14.28571\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,14.28572\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,14.28572\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,14.28571\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,14.28572\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,14.28571\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,7.142857\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,-78.57143"
  },
  {
    "path": "Tests/TestData/spy_asi.csv",
    "content": "time,open,high,low,close,Volume,ASI\n1993-01-29T14:30:00Z,43.9688,43.96899,43.75,43.938,1003200,0\n1993-02-01T14:30:00Z,43.96875,44.25,43.96875,44.25,480500,2.850911854\n1993-02-02T14:30:00Z,44.21875,44.375,44.125,44.34375,201300,3.403503318\n1993-02-03T14:30:00Z,44.40625,44.84375,44.375,44.8125,529400,7.664866954\n1993-02-04T14:30:00Z,44.96875,45.09375,44.875,45,531500,9.188304454\n1993-02-05T14:30:00Z,44.96875,45.0625,44.71875,44.96875,492100,9.071116954\n1993-02-08T14:30:00Z,44.96875,45.125,44.90625,44.96875,596100,9.071116954\n1993-02-09T14:30:00Z,44.8125,44.8125,44.5625,44.65625,122100,6.048423502\n1993-02-10T14:30:00Z,44.65625,44.75,44.53125,44.71875,379600,6.214143198\n1993-02-11T14:30:00Z,44.78125,45.125,44.78125,44.9375,19500,8.245393198\n1993-02-12T14:30:00Z,44.875,44.875,44.59375,44.59375,42500,5.524039032\n1993-02-16T14:30:00Z,44.46875,44.46875,43.40625,43.46875,374800,-5.002411132\n1993-02-17T14:30:00Z,43.46875,43.53125,43.28125,43.4375,210900,-5.698211913\n1993-02-18T14:30:00Z,43.9375,43.9375,42.8125,43.40625,378100,-6.748858465\n1993-02-19T14:30:00Z,43.40625,43.5625,43.34375,43.5625,34900,-6.466740409\n1993-02-22T14:30:00Z,43.6875,43.78125,43.5625,43.71875,513600,-5.348132454\n1993-02-23T14:30:00Z,43.84375,43.875,43.46875,43.6875,373700,-5.731387171\n1993-02-24T14:30:00Z,43.71875,44.25,43.71875,44.25,26300,-0.997012171\n1993-02-25T14:30:00Z,44.21875,44.375,44.125,44.34375,44500,-0.407088702\n1993-02-26T14:30:00Z,44.4375,44.4375,44.1875,44.40625,66200,-0.135821341\n1993-03-01T14:30:00Z,44.5625,44.5625,44.21875,44.28125,66500,-1.047279674\n1993-03-02T14:30:00Z,44.3125,44.9375,44.25,44.9375,182400,3.815397516\n1993-03-03T14:30:00Z,45,45.15625,44.9375,45.125,280100,5.296517308\n1993-03-04T14:30:00Z,45.1875,45.1875,44.875,44.875,89500,3.591971854\n1993-03-05T14:30:00Z,44.9375,45.125,44.71875,44.75,40000,2.634310563\n1993-03-08T14:30:00Z,44.84375,45.75,44.84375,45.75,50800,11.42337306\n1993-03-09T14:30:00Z,45.65625,45.6875,45.5,45.59375,169300,11.56043447\n1993-03-10T14:30:00Z,45.59375,45.6875,45.40625,45.6875,194400,12.05385552\n1993-03-11T14:30:00Z,45.71875,45.84375,45.5,45.5625,70900,11.48038477\n1993-03-12T14:30:00Z,45.1875,45.21875,44.8125,45.09375,643600,7.267568319\n1993-03-15T14:30:00Z,45.0625,45.3125,45.0625,45.3125,310800,8.869130819\n1993-03-16T14:30:00Z,45.3125,45.4375,45.3125,45.3125,30800,9.129547486\n1993-03-17T14:30:00Z,45.25,45.25,44.96875,45.03125,21800,6.444000611\n1993-03-18T14:30:00Z,45.21875,45.5,45.21875,45.3125,59300,8.308347202\n1993-03-19T14:30:00Z,45.28125,45.28125,45.03125,45.03125,66900,5.98043335\n1993-03-22T14:30:00Z,44.59375,44.875,44.5625,44.78125,183400,4.566101454\n1993-03-23T14:30:00Z,44.90625,44.9375,44.8125,44.875,55200,5.21714312\n1993-03-24T14:30:00Z,44.8125,45.0625,44.59375,44.875,37200,5.303592915\n1993-03-25T14:30:00Z,44.90625,45.25,44.84375,45.15625,110100,7.647342915\n1993-03-26T14:30:00Z,45.125,45.15625,44.875,44.90625,101500,6.12923212\n1993-03-29T14:30:00Z,44.9375,45.3125,44.9375,45.09375,87100,7.331945936\n1993-03-30T14:30:00Z,45.15625,45.21875,45.09375,45.21875,56000,8.26200546\n1993-03-31T14:30:00Z,45.34375,45.46875,45.1875,45.1875,111600,7.768584407\n1993-04-01T14:30:00Z,45.25,45.25,44.9375,45.03125,129500,6.41441774\n1993-04-02T14:30:00Z,44.65625,44.65625,44.09375,44.09375,59400,-2.858185415\n1993-04-05T13:30:00Z,44.4375,44.4375,44.1875,44.3125,172200,-2.781455504\n1993-04-06T13:30:00Z,44.40625,44.40625,44.0625,44.1875,129700,-3.888226338\n1993-04-07T13:30:00Z,44.25,44.34375,44.15625,44.34375,28000,-3.289688031\n1993-04-08T13:30:00Z,44.53125,44.53125,44.09375,44.28125,180800,-3.845832099\n1993-04-12T13:30:00Z,44.71875,44.9375,44.65625,44.90625,348500,1.22080393\n1993-04-13T13:30:00Z,44.875,45.15625,44.84375,45,146100,2.103956104\n1993-04-14T13:30:00Z,45.03125,45.0625,44.90625,44.9375,119600,1.859815479\n1993-04-15T13:30:00Z,44.90625,45.03125,44.75,44.9375,148600,1.829767402\n1993-04-16T13:30:00Z,44.96875,45.03125,44.875,44.9375,47900,1.801865617\n1993-04-19T13:30:00Z,44.9375,45.0625,44.71875,44.75,157000,0.677733672\n1993-04-20T13:30:00Z,44.6875,44.75,44.25,44.53125,279500,-1.286552042\n1993-04-21T13:30:00Z,44.625,44.625,44.375,44.5,67900,-1.73524292\n1993-04-22T13:30:00Z,44.3125,44.6875,43.9375,43.9375,97700,-5.25086792\n1993-04-23T13:30:00Z,43.84375,43.96875,43.6875,43.75,106000,-6.61805542\n1993-04-26T13:30:00Z,43.78125,43.9375,43.28125,43.40625,62600,-9.008949817\n1993-04-27T13:30:00Z,43.34375,43.875,43.34375,43.875,156800,-6.00602013\n1993-04-28T13:30:00Z,43.8125,43.90625,43.71875,43.78125,85900,-5.934564337\n1993-04-29T13:30:00Z,43.875,43.96875,43.625,43.96875,85000,-5.179356003\n1993-04-30T13:30:00Z,44.125,44.28125,44.03125,44.03125,88500,-4.928955362\n1993-05-03T13:30:00Z,44.09375,44.3125,43.90625,44.3125,80500,-3.426824681\n1993-05-04T13:30:00Z,44.40625,44.625,44.34375,44.46875,149100,-2.08133857\n1993-05-05T13:30:00Z,44.46875,44.75,44.46875,44.59375,109000,-0.878624754\n1993-05-06T13:30:00Z,44.53125,44.5625,44.40625,44.4375,54700,-1.870211292\n1993-05-07T13:30:00Z,44.46875,44.46875,44.28125,44.34375,68000,-2.702097866\n1993-05-10T13:30:00Z,44.40625,44.6875,44.40625,44.4375,113900,-2.213816616\n1993-05-11T13:30:00Z,44.4375,44.625,44.3125,44.625,42600,-1.156270885\n1993-05-12T13:30:00Z,44.4375,44.59375,44.4375,44.5625,31000,-0.905154813\n1993-05-13T13:30:00Z,44.375,44.375,44,44.03125,129100,-5.629275907\n1993-05-14T13:30:00Z,44.03125,44.15625,43.96875,44,63500,-6.008740193\n1993-05-17T13:30:00Z,44.125,44.15625,43.9375,44.15625,34000,-5.301574244\n1993-05-18T13:30:00Z,44.1875,44.21875,43.96875,44.125,105200,-5.55015379\n1993-05-19T13:30:00Z,44.125,45.03125,43.84375,45.03125,50200,0.775941989\n1993-05-20T13:30:00Z,45.03125,45.15625,44.9375,45.15625,98200,1.502367428\n1993-05-21T13:30:00Z,45.1875,45.25,44.71875,44.75,221400,-1.383917294\n1993-05-24T13:30:00Z,44.84375,45.09375,44.84375,44.9375,30500,-0.722859602\n1993-05-25T13:30:00Z,45.125,45.125,45.03125,45.03125,191800,-0.220627459\n1993-05-26T13:30:00Z,45.15625,45.625,45.125,45.59375,102400,4.710344288\n1993-05-27T13:30:00Z,45.65625,45.65625,45.375,45.4375,53800,4.163469288\n1993-05-28T13:30:00Z,45.40625,45.40625,45,45.21875,79100,2.056655763\n1993-06-01T13:30:00Z,45.375,45.8125,45.3125,45.65625,28300,5.376968263\n1993-06-02T13:30:00Z,45.53125,45.75,45.34375,45.59375,20300,5.537060476\n1993-06-03T13:30:00Z,45.5,45.5,45.34375,45.4375,21600,4.309381905\n1993-06-04T13:30:00Z,45.3125,45.3125,45.09375,45.28125,32000,2.95247401\n1993-06-07T13:30:00Z,45.375,45.375,45.125,45.125,121400,1.857540298\n1993-06-08T13:30:00Z,45,45,44.71875,44.71875,104500,-1.951053452\n1993-06-09T13:30:00Z,44.875,45.0625,44.8125,44.875,43300,-1.448227654\n1993-06-10T13:30:00Z,44.84375,44.9375,44.75,44.90625,17900,-1.187810988\n1993-06-11T13:30:00Z,45.0625,45.15625,44.90625,45.09375,647400,0.098953718\n1993-06-14T13:30:00Z,45.15625,45.1875,45.03125,45.03125,64200,-0.319573068\n1993-06-15T13:30:00Z,45.09375,45.125,44.9375,44.9375,142400,-0.863657889\n1993-06-16T13:30:00Z,44.9375,45.03125,44.8125,45.03125,330900,-0.555892737\n1993-06-17T13:30:00Z,45.125,45.1875,45.03125,45.1875,37400,0.590506719\n1993-06-18T13:30:00Z,44.84375,44.84375,44.5,44.5,58500,-6.23394181\n1993-06-21T13:30:00Z,44.625,44.625,44.53125,44.59375,29300,-6.26519181\n1993-06-22T13:30:00Z,44.65625,44.65625,44.5625,44.625,137500,-6.235143733\n1993-06-23T13:30:00Z,44.625,44.625,44.21875,44.21875,227600,-10.01978406\n1993-06-24T13:30:00Z,44.34375,44.8125,44.34375,44.8125,243700,-5.759078045\n1993-06-25T13:30:00Z,44.78125,44.90625,44.75,44.78125,44800,-5.574926259\n1993-06-28T13:30:00Z,45,45.28125,44.9375,45.28125,439900,-0.829555889\n1993-06-29T13:30:00Z,45.21875,45.21875,45,45.0625,207500,-2.072886682\n1993-06-30T13:30:00Z,45.125,45.21875,45,45.0625,437600,-2.339221909\n1993-07-01T13:30:00Z,45.125,45.125,44.875,44.9375,605700,-3.373229262\n1993-07-02T13:30:00Z,44.78125,44.8125,44.53125,44.6875,285400,-5.607604262\n1993-07-06T13:30:00Z,44.625,44.75,44.15625,44.21875,246400,-9.348209483\n1993-07-07T13:30:00Z,44.1875,44.40625,44.1875,44.34375,343700,-8.976639361\n1993-07-08T13:30:00Z,44.375,44.9375,44.3125,44.84375,248200,-4.654488626\n1993-07-09T13:30:00Z,44.84375,44.96875,44.75,44.96875,378200,-3.945913045\n1993-07-12T13:30:00Z,44.90625,44.96875,44.84375,44.9375,373700,-3.867788045\n1993-07-13T13:30:00Z,44.96875,45.09375,44.65625,44.90625,389600,-4.083659755\n1993-07-14T13:30:00Z,44.9375,45.1875,44.90625,45.0625,617300,-2.880945939\n1993-07-15T13:30:00Z,45.03125,45.03125,44.78125,44.875,443800,-4.26869265\n1993-07-16T13:30:00Z,44.90625,44.9375,44.6875,44.75,216400,-5.250533866\n1993-07-19T13:30:00Z,44.75,44.75,44.59375,44.71875,188200,-5.680221366\n1993-07-20T13:30:00Z,44.6875,44.84375,44.46875,44.84375,68500,-4.883027489\n1993-07-21T13:30:00Z,44.78125,44.8125,44.65625,44.8125,142700,-4.752819155\n1993-07-22T13:30:00Z,44.75,44.8125,44.5,44.5,632400,-7.372864887\n1993-07-23T13:30:00Z,44.59375,44.71875,44.5625,44.71875,286200,-6.176575825\n1993-07-26T13:30:00Z,44.84375,45.0625,44.84375,44.96875,121300,-3.813294575\n1993-07-27T13:30:00Z,45,45.03125,44.78125,44.9375,92800,-3.943502908\n1993-07-28T13:30:00Z,44.84375,44.9375,44.78125,44.84375,30800,-4.564951772\n1993-07-29T13:30:00Z,44.9375,45.21875,44.875,45.09375,331000,-2.425006119\n1993-07-30T13:30:00Z,45.09375,45.09375,44.78125,44.84375,75300,-4.291325564\n1993-08-02T13:30:00Z,44.90625,45.125,44.90625,44.96875,41300,-3.763981814\n1993-08-03T13:30:00Z,45.0625,45.1875,44.84375,45,81600,-3.704538879\n1993-08-04T13:30:00Z,45,45.09375,44.875,45,434000,-3.756622212\n1993-08-05T13:30:00Z,45,45,44.84375,44.90625,36800,-4.635528462\n1993-08-06T13:30:00Z,45.03125,45.0625,44.90625,44.96875,402300,-4.593069223\n1993-08-09T13:30:00Z,45.09375,45.34375,45,45.21875,828200,-2.737600473\n1993-08-10T13:30:00Z,45.1875,45.21875,45.125,45.1875,604900,-2.737600473\n1993-08-11T13:30:00Z,45.15625,45.3125,45.15625,45.1875,542200,-2.659475473\n1993-08-12T13:30:00Z,45.3125,45.3125,44.90625,45.0625,303700,-3.687629954\n1993-08-13T13:30:00Z,45.09375,45.15625,45.09375,45.125,103500,-3.622525788\n1993-08-16T13:30:00Z,45.15625,45.5,45.15625,45.375,241800,-1.278775788\n1993-08-17T13:30:00Z,45.34375,45.53125,45.34375,45.53125,369300,-0.050197159\n1993-08-18T13:30:00Z,45.6875,45.875,45.65625,45.78125,414300,2.200546889\n1993-08-19T13:30:00Z,45.8125,45.8125,45.71875,45.78125,28500,2.226588556\n1993-08-20T13:30:00Z,45.6875,45.8125,45.65625,45.8125,80700,2.635814746\n1993-08-23T13:30:00Z,45.625,45.75,45.625,45.71875,15600,2.538158496\n1993-08-24T13:30:00Z,45.71875,46.21875,45.71875,46.21875,273400,7.15569581\n1993-08-25T13:30:00Z,46.21875,46.4375,46.15625,46.25,242300,7.73412129\n1993-08-26T13:30:00Z,46.28125,46.53125,46.09375,46.28125,120000,7.888315369\n1993-08-27T13:30:00Z,46.15625,46.25,46.15625,46.25,25700,7.999922512\n1993-08-30T13:30:00Z,46.28125,46.5,46.28125,46.4375,183500,9.751816452\n1993-08-31T13:30:00Z,46.40625,46.5625,46.34375,46.5625,66500,10.48571797\n1993-09-01T13:30:00Z,46.40625,46.59375,46.40625,46.5,136500,10.58674167\n1993-09-02T13:30:00Z,46.53125,46.59375,46.3125,46.34375,472400,9.715347443\n1993-09-03T13:30:00Z,46.3125,46.4375,46.25,46.375,630500,9.754409943\n1993-09-07T13:30:00Z,46.375,46.4375,46,46.0625,196400,7.410659943\n1993-09-08T13:30:00Z,46.0625,46.0625,45.59375,45.90625,269900,5.7365528\n1993-09-09T13:30:00Z,45.71875,46.03125,45.71875,46,239200,6.387594467\n1993-09-10T13:30:00Z,46.125,46.4375,46.0625,46.40625,106500,9.928834221\n1993-09-13T13:30:00Z,46.5625,46.5625,46.4375,46.4375,66900,10.10967913\n1993-09-14T13:30:00Z,46.3125,46.3125,46.09375,46.25,184500,8.390929128\n1993-09-15T13:30:00Z,46.0625,46.40625,45.90625,46.375,101000,9.497699961\n1993-09-16T13:30:00Z,46.3125,46.34375,46.15625,46.28125,54300,9.345790239\n1993-09-17T13:30:00Z,45.875,45.90625,45.75,45.8125,200900,4.549783295\n1993-09-20T13:30:00Z,45.875,45.96875,45.4375,45.4375,57800,1.938176152\n1993-09-21T13:30:00Z,45.5,45.5625,44.8125,45.28125,318200,0.233630697\n1993-09-22T13:30:00Z,45.4375,45.71875,45.375,45.65625,439700,2.872062715\n1993-09-23T13:30:00Z,45.78125,45.9375,45.71875,45.90625,88500,4.990452138\n1993-09-24T13:30:00Z,45.84375,45.875,45.71875,45.78125,53500,4.269298292\n1993-09-27T13:30:00Z,46.125,46.28125,46.125,46.28125,274600,9.382934655\n1993-09-28T13:30:00Z,46.3125,46.3125,46.15625,46.1875,158300,8.914184655\n1993-09-29T13:30:00Z,46.1875,46.3125,45.96875,46.03125,221000,7.945760176\n1993-09-30T13:30:00Z,46.03125,46.125,45.84375,45.9375,99300,7.288366884\n1993-10-01T13:30:00Z,45.875,46.21875,45.8125,46.15625,22700,8.662656656\n1993-10-04T13:30:00Z,46.21875,46.21875,46.09375,46.21875,1038500,8.928281656\n1993-10-05T13:30:00Z,46.3125,46.3125,46,46.15625,436500,8.313047281\n1993-10-06T13:30:00Z,46.1875,46.375,46.125,46.125,209200,7.832684106\n1993-10-07T13:30:00Z,46.1875,46.1875,45.96875,46,59400,6.856121606\n1993-10-08T13:30:00Z,46.125,46.15625,45.71875,46.0625,54400,6.799417977\n1993-10-11T13:30:00Z,46.15625,46.25,46.15625,46.15625,467100,7.385355477\n1993-10-12T13:30:00Z,46.21875,46.25,46.1875,46.21875,26200,7.854105477\n1993-10-13T13:30:00Z,46.25,46.25,46.15625,46.21875,139100,7.78900131\n1993-10-14T13:30:00Z,46.40625,46.8125,46.28125,46.8125,108100,12.9233121\n1993-10-15T13:30:00Z,47.03125,47.15625,46.90625,47.0625,1502500,14.9032447\n1993-10-18T13:30:00Z,47.03125,47.03125,46.875,46.9375,722400,13.83327187\n1993-10-19T13:30:00Z,46.875,46.96875,46.59375,46.59375,880100,11.09506721\n1993-10-20T13:30:00Z,46.75,46.75,46.5625,46.65625,230400,10.88791759\n1993-10-21T13:30:00Z,46.6875,46.6875,46.53125,46.59375,56200,10.31047194\n1993-10-22T13:30:00Z,46.65625,46.84375,46.375,46.375,390700,9.095194162\n1993-10-25T13:30:00Z,46.40625,46.5625,46.28125,46.5,114500,9.433735828\n1993-10-26T13:30:00Z,46.46875,46.5,46.3125,46.46875,186200,9.39033305\n1993-10-27T13:30:00Z,46.40625,46.53125,46.40625,46.5,118400,9.634473675\n1993-10-28T13:30:00Z,46.5625,46.96875,46.5625,46.84375,129600,12.8620955\n1993-10-29T13:30:00Z,46.8125,46.875,46.78125,46.84375,80700,13.06670859\n1993-11-01T14:30:00Z,46.78125,47,46.78125,46.96875,36400,14.04327109\n1993-11-02T14:30:00Z,46.90625,47,46.65625,46.9375,262100,14.19952109\n1993-11-03T14:30:00Z,46.90625,46.90625,46.125,46.34375,479100,8.726978617\n1993-11-04T14:30:00Z,46.34375,46.34375,45.8125,45.84375,130400,4.32563414\n1993-11-05T14:30:00Z,45.71875,46.0625,45.53125,46.0625,363200,5.116184736\n1993-11-08T14:30:00Z,46.09375,46.25,45.96875,46.125,367600,5.639788459\n1993-11-09T14:30:00Z,46.4375,46.46875,46.125,46.15625,246900,5.019128737\n1993-11-10T14:30:00Z,46.15625,46.5,46.03125,46.5,46500,6.793924932\n1993-11-11T14:30:00Z,46.5,46.625,46.34375,46.375,88900,6.5238119\n1993-11-12T14:30:00Z,46.46875,46.75,46.4375,46.59375,108200,8.0863119\n1993-11-15T14:30:00Z,46.6875,46.6875,46.4375,46.5625,243300,7.869298012\n1993-11-16T14:30:00Z,46.65625,46.8125,46.46875,46.78125,492600,8.910964678\n1993-11-17T14:30:00Z,46.8125,46.8125,46.40625,46.53125,39600,6.985741464\n1993-11-18T14:30:00Z,46.46875,46.5625,46.28125,46.40625,240800,5.978797019\n1993-11-19T14:30:00Z,46.25,46.375,46.21875,46.3125,106000,5.490515769\n1993-11-22T14:30:00Z,46.1875,46.21875,45.875,46.03125,165300,3.176813846\n1993-11-23T14:30:00Z,46.28125,46.3125,46.03125,46.28125,89700,4.334397688\n1993-11-24T14:30:00Z,46.40625,46.5,46.34375,46.46875,77200,5.929449771\n1993-11-26T14:30:00Z,46.59375,46.59375,46.46875,46.5,1019800,5.929449771\n1993-11-29T14:30:00Z,46.625,46.71875,46.3125,46.3125,517500,4.761125908\n1993-11-30T14:30:00Z,46.28125,46.5625,46.25,46.34375,230000,4.698625908\n1993-12-01T14:30:00Z,46.59375,46.625,46.40625,46.40625,379200,4.595225172\n1993-12-02T14:30:00Z,46.5,46.5625,46.40625,46.53125,352000,5.045946326\n1993-12-03T14:30:00Z,46.5,46.71875,46.5,46.71875,306000,6.621916154\n1993-12-06T14:30:00Z,46.78125,46.9375,46.78125,46.875,99500,8.077309299\n1993-12-07T14:30:00Z,46.875,46.90625,46.78125,46.84375,88800,7.984792851\n1993-12-08T14:30:00Z,46.84375,46.84375,46.78125,46.84375,146700,7.941390074\n1993-12-09T14:30:00Z,46.84375,46.90625,46.625,46.6875,416500,6.802067157\n1993-12-10T14:30:00Z,46.71875,46.71875,46.5,46.59375,412900,5.914283066\n1993-12-13T14:30:00Z,46.59375,46.875,46.53125,46.875,273200,7.745337754\n1993-12-14T14:30:00Z,46.90625,46.90625,46.53125,46.53125,41900,5.521516482\n1993-12-15T14:30:00Z,46.59375,46.625,46.46875,46.46875,82600,5.008821169\n1993-12-16T14:30:00Z,46.65625,46.65625,46.5625,46.625,78200,5.754559806\n1993-12-17T14:30:00Z,46.40625,46.59375,46.375,46.5625,104700,5.804963031\n1993-12-20T14:30:00Z,46.53125,46.65625,46.5,46.625,68800,6.250275531\n1993-12-21T14:30:00Z,46.5625,46.5625,46.40625,46.46875,205700,5.085634328\n1993-12-22T14:30:00Z,46.59375,46.8125,46.5,46.78125,410300,7.42504405\n1993-12-23T14:30:00Z,46.75,46.84375,46.6875,46.75,533800,7.470116165\n1993-12-27T14:30:00Z,46.75,47,46.75,47,447100,9.813866165\n1993-12-28T14:30:00Z,46.96875,47.125,46.9375,47.09375,880600,10.49745992\n1993-12-29T14:30:00Z,47.125,47.15625,47,47.03125,266700,10.25331929\n1993-12-30T14:30:00Z,47,47,46.75,46.84375,219900,8.49550679\n1993-12-31T14:30:00Z,46.9375,47,46.5625,46.59375,312900,6.795327487\n1994-01-03T14:30:00Z,46.59375,46.65625,46.40625,46.46875,960900,5.841475743\n1994-01-04T14:30:00Z,46.53125,46.65625,46.46875,46.65625,164300,7.013350743\n1994-01-05T14:30:00Z,46.71875,46.78125,46.53125,46.75,710900,7.403975743\n1994-01-06T14:30:00Z,46.8125,46.84375,46.6875,46.75,201000,7.320270386\n1994-01-07T14:30:00Z,46.84375,47.0625,46.71875,47.03125,775500,9.273395386\n1994-01-10T14:30:00Z,47.09375,47.59375,46.96875,47.59375,593700,13.77012504\n1994-01-11T14:30:00Z,47.5625,47.5625,47.34375,47.5,295200,13.77012504\n1994-01-12T14:30:00Z,47.53125,47.53125,47.1875,47.34375,158400,12.32651091\n1994-01-13T14:30:00Z,47.21875,47.3125,47.15625,47.21875,244300,11.40575198\n1994-01-14T14:30:00Z,47.375,47.5,47.375,47.40625,137200,13.16356448\n1994-01-17T14:30:00Z,47.40625,47.46875,47.3125,47.40625,17700,13.19146626\n1994-01-18T14:30:00Z,47.46875,47.53125,47.375,47.46875,166400,13.50396626\n1994-01-19T14:30:00Z,47.40625,47.46875,47.25,47.34375,200800,12.52740376\n1994-01-20T14:30:00Z,47.40625,47.5,47.375,47.46875,281100,13.40631001\n1994-01-21T14:30:00Z,47.53125,47.53125,47.34375,47.375,85600,12.80534848\n1994-01-24T14:30:00Z,47.34375,47.5625,47.1875,47.1875,373800,11.94302536\n1994-01-25T14:30:00Z,47.21875,47.25,47.09375,47.1875,310400,11.77896286\n1994-01-26T14:30:00Z,47.1875,47.34375,47.125,47.3125,145100,12.55347795\n1994-01-27T14:30:00Z,47.40625,47.8125,47.34375,47.75,344500,16.43605371\n1994-01-28T14:30:00Z,47.9375,48.03125,47.875,47.875,356500,17.47271236\n1994-01-31T14:30:00Z,48.0625,48.3125,48,48.21875,313800,20.31646236\n1994-02-01T14:30:00Z,48.15625,48.15625,47.90625,47.96875,303600,18.45861175\n1994-02-02T14:30:00Z,48.125,48.28125,48.09375,48.28125,307600,20.72012491\n1994-02-03T14:30:00Z,48.1875,48.1875,47.90625,48.0625,466100,19.17424725\n1994-02-04T14:30:00Z,48.0625,48.125,46.96875,46.96875,1403200,9.54996682\n1994-02-07T14:30:00Z,46.84375,47.3125,46.84375,47.1875,516400,9.889193794\n1994-02-08T14:30:00Z,47.28125,47.28125,47.03125,47.21875,188200,10.13901211\n1994-02-09T14:30:00Z,47.25,47.4375,47.1875,47.40625,144600,11.42577681\n1994-02-10T14:30:00Z,47.375,47.40625,47,47,883900,8.263084928\n1994-02-11T14:30:00Z,47.03125,47.28125,46.8125,47.15625,519400,8.653709928\n1994-02-14T14:30:00Z,47.0625,47.375,47,47.21875,2742100,9.232135409\n1994-02-15T14:30:00Z,47.3125,47.5,47.25,47.46875,374700,11.35052483\n1994-02-16T14:30:00Z,47.53125,47.53125,47.34375,47.4375,287600,11.21582656\n1994-02-17T14:30:00Z,47.65625,47.6875,47.03125,47.15625,342400,9.143718079\n1994-02-18T14:30:00Z,47.1875,47.21875,46.75,46.875,313300,6.738290447\n1994-02-22T14:30:00Z,47,47.34375,47,47.34375,154500,10.14050819\n1994-02-23T14:30:00Z,47.40625,47.4375,47.0625,47.21875,391700,9.634019842\n1994-02-24T14:30:00Z,47.0625,47.0625,46.5625,46.59375,770800,3.686754217\n1994-02-25T14:30:00Z,46.65625,46.8125,46.5625,46.8125,531300,4.355803419\n1994-02-28T14:30:00Z,46.9375,47.0625,46.8125,46.8125,333000,4.22911423\n1994-03-01T14:30:00Z,46.8125,46.90625,46.375,46.625,423600,2.710017008\n1994-03-02T14:30:00Z,46.0625,46.6875,45.9375,46.6875,581500,4.479318478\n1994-03-03T14:30:00Z,46.625,46.625,46.4375,46.5625,223200,4.479318478\n1994-03-04T14:30:00Z,46.5625,46.8125,46.40625,46.6875,595800,5.115892552\n1994-03-07T14:30:00Z,46.875,47,46.875,46.9375,539800,7.557298802\n1994-03-08T14:30:00Z,46.96875,46.96875,46.6875,46.75,880300,6.077035644\n1994-03-09T14:30:00Z,46.8125,47,46.59375,46.96875,2500100,6.898010221\n1994-03-10T14:30:00Z,46.96875,46.96875,46.46875,46.59375,207400,3.863589931\n1994-03-11T14:30:00Z,46.6875,46.90625,46.4375,46.84375,576600,4.677392014\n1994-03-14T14:30:00Z,47.03125,47.03125,46.84375,46.90625,345900,4.879439428\n1994-03-15T14:30:00Z,47.03125,47.125,46.84375,46.875,748600,4.264205053\n1994-03-16T14:30:00Z,46.96875,47.25,46.8125,47.25,455500,6.607955053\n1994-03-17T14:30:00Z,47.09375,47.3125,47.09375,47.25,133000,7.109433093\n1994-03-18T14:30:00Z,46.75,47.03125,46.71875,46.96875,365500,6.152732882\n1994-03-21T14:30:00Z,46.8125,46.9375,46.71875,46.84375,324800,5.857124773\n1994-03-22T14:30:00Z,46.84375,47.0625,46.75,46.96875,435700,6.690775688\n1994-03-23T14:30:00Z,46.9375,47.0625,46.90625,46.9375,698500,6.690775688\n1994-03-24T14:30:00Z,46.75,46.84375,46.15625,46.375,1200500,1.70407356\n1994-03-25T14:30:00Z,46.40625,46.53125,45.9375,45.9375,100900,-1.341025871\n1994-03-28T14:30:00Z,46,46.0625,45.59375,46,1117200,-1.541546705\n1994-03-29T14:30:00Z,46,46.03125,45.09375,45.09375,338400,-9.75443733\n1994-03-30T14:30:00Z,45.125,45.25,44.46875,44.46875,1123900,-14.3268695\n1994-03-31T14:30:00Z,44.46875,44.6875,43.53125,44.59375,788800,-14.22285693\n1994-04-04T13:30:00Z,43.34375,44.03125,43.34375,43.90625,2627300,-17.15254443\n1994-04-05T13:30:00Z,44.34375,44.8125,44.34375,44.8125,1179000,-8.389277917\n1994-04-06T13:30:00Z,44.875,44.90625,44.5,44.8125,516500,-8.068615603\n1994-04-07T13:30:00Z,44.78125,45.125,44.53125,45.03125,666100,-7.016932911\n1994-04-08T13:30:00Z,44.9375,44.9375,44.46875,44.6875,242400,-9.4873721\n1994-04-11T13:30:00Z,44.8125,45.0625,44.70312,44.875,203300,-8.635104332\n1994-04-12T13:30:00Z,44.92187,45,44.71875,44.8125,1409200,-8.969183279\n1994-04-13T13:30:00Z,44.79687,44.90625,44.25,44.578,364100,-10.87861391\n1994-04-14T13:30:00Z,44.5,44.82812,44.40625,44.59375,419900,-10.8526766\n1994-04-15T13:30:00Z,44.57812,44.78125,44.51562,44.59375,387300,-10.72597947\n1994-04-18T13:30:00Z,44.64062,44.76562,44.15625,44.29687,369100,-12.79856061\n1994-04-19T13:30:00Z,44.25,44.53125,43.98437,44.35937,472200,-12.70211847\n1994-04-20T13:30:00Z,44.40625,44.51562,44.07812,44.3125,508000,-12.95322104\n1994-04-21T13:30:00Z,44.5,44.96875,44.34375,44.90625,200300,-8.176107068\n1994-04-22T13:30:00Z,45.01562,45.04687,44.73437,44.85937,301800,-8.236926644\n1994-04-25T13:30:00Z,44.84375,45.35937,44.84375,45.32812,394600,-4.45169534\n1994-04-26T13:30:00Z,45.26562,45.34375,45.1875,45.28125,399000,-4.191725419\n1994-04-28T13:30:00Z,45.1875,45.25,44.8125,44.95312,287000,-7.021284988\n1994-04-29T13:30:00Z,44.875,45.15625,44.8125,45.09375,481900,-6.417308405\n1994-05-02T13:30:00Z,45.09375,45.71875,44.9375,45.375,275000,-4.190380835\n1994-05-03T13:30:00Z,45.39062,45.40625,45.0625,45.32812,183400,-4.227255835\n1994-05-04T13:30:00Z,45.42187,45.42187,45.07812,45.25,401900,-5.008473227\n1994-05-05T13:30:00Z,45.29687,45.375,45.1875,45.1875,659800,-5.551366002\n1994-05-06T13:30:00Z,44.96875,44.96875,44.59375,44.75,216300,-9.715548884\n1994-05-09T13:30:00Z,44.625,44.75,44.28125,44.35937,499300,-12.95136511\n1994-05-10T13:30:00Z,44.57812,44.84375,44.54687,44.70312,583400,-10.70027918\n1994-05-11T13:30:00Z,44.65625,44.71875,44.17187,44.29687,210600,-13.88597122\n1994-05-12T13:30:00Z,44.57812,44.625,44.40625,44.51562,305200,-13.33469029\n1994-05-13T13:30:00Z,44.64062,44.64062,44.29687,44.51562,321300,-13.63190496\n1994-05-16T13:30:00Z,44.60937,44.75,44.51562,44.53125,450400,-13.93344983\n1994-05-17T13:30:00Z,44.5625,45.1875,44.5,45.1875,470200,-8.426915237\n1994-05-18T13:30:00Z,45.21875,45.6875,45.01562,45.51562,824800,-6.038986259\n1994-05-19T13:30:00Z,45.42187,45.85937,45.42187,45.73437,531000,-4.15295398\n1994-05-20T13:30:00Z,45.65625,45.6875,45.5,45.5625,370400,-4.865546292\n1994-05-23T13:30:00Z,45.51562,45.53125,45.34375,45.48437,262700,-5.572742413\n1994-05-24T13:30:00Z,45.60937,45.84375,45.60937,45.67187,549600,-4.017758315\n1994-05-25T13:30:00Z,45.5,45.82812,45.34375,45.79687,738200,-2.832166869\n1994-05-26T13:30:00Z,45.78125,45.9375,45.73437,45.82812,369600,-2.42366403\n1994-05-27T13:30:00Z,45.75,45.875,45.67187,45.875,162000,-1.873230456\n1994-05-31T13:30:00Z,45.73437,45.90625,45.65625,45.8125,160000,-1.835240873\n1994-06-01T13:30:00Z,45.70312,46.01562,45.5625,46.01562,200500,-0.582660687\n1994-06-02T13:30:00Z,46.04687,46.04687,45.89062,45.96875,55100,-0.608677353\n1994-06-03T13:30:00Z,46,46.39062,45.85937,46.23437,550400,1.130388429\n1994-06-06T13:30:00Z,46.32812,46.46875,46.1875,46.21875,99300,1.079902252\n1994-06-07T13:30:00Z,46.14062,46.21875,46.03125,46.15625,120600,0.632476922\n1994-06-08T13:30:00Z,46.26562,46.26562,45.78125,45.78125,131900,-2.311277686\n1994-06-09T13:30:00Z,45.98437,46.03125,45.89062,46.03125,80500,-1.558947325\n1994-06-10T13:30:00Z,46.07812,46.20312,46.07812,46.10937,83100,-0.851575188\n1994-06-13T13:30:00Z,46.04687,46.1875,46.03125,46.17187,109700,-0.456274592\n1994-06-14T13:30:00Z,46.3125,46.54687,46.3125,46.53125,161000,3.032158345\n1994-06-15T13:30:00Z,46.54687,46.5625,46.3125,46.34375,142800,1.980486871\n1994-06-16T13:30:00Z,46.34375,46.46875,46.29687,46.4375,44000,2.295727175\n1994-06-17T13:30:00Z,46.15625,46.20312,45.8125,45.875,403800,-2.701998549\n1994-06-20T13:30:00Z,45.54687,45.625,45.4375,45.48437,137400,-6.217659264\n1994-06-21T13:30:00Z,45.45312,45.45312,44.90625,45.09375,139200,-9.879721764\n1994-06-22T13:30:00Z,45.21875,45.42187,45.17187,45.26562,279900,-9.308922622\n1994-06-23T13:30:00Z,45.34375,45.40625,44.9375,45,922500,-11.12624264\n1994-06-24T13:30:00Z,44.78125,44.78125,44,44.0625,353800,-19.97624264\n1994-06-27T13:30:00Z,44.23437,44.82812,44.01562,44.82812,371200,-15.71863585\n1994-06-28T13:30:00Z,44.84375,44.84375,44.25,44.60937,5382301,-16.63146908\n1994-06-29T13:30:00Z,44.67187,45.01562,44.625,44.75,311800,-15.95868946\n1994-06-30T13:30:00Z,44.82812,44.84375,44.3125,44.46875,271900,-18.15004441\n1994-07-01T13:30:00Z,44.6875,44.6875,44.375,44.5625,406900,-18.34914576\n1994-07-05T13:30:00Z,44.65625,44.85937,44.51562,44.79687,112000,-16.99625969\n1994-07-06T13:30:00Z,44.625,44.8125,44.46875,44.73437,174800,-16.84828723\n1994-07-07T13:30:00Z,44.73437,44.92187,44.6875,44.92187,66700,-15.46649677\n1994-07-08T13:30:00Z,44.64062,44.98437,44.625,44.90625,148400,-14.717142\n1994-07-11T13:30:00Z,44.9375,45.01562,44.53125,44.75,124000,-15.498392\n1994-07-12T13:30:00Z,44.76562,44.82812,44.51562,44.8125,257300,-15.33915626\n1994-07-13T13:30:00Z,44.82812,45.03125,44.82812,44.89062,532700,-14.5956337\n1994-07-14T13:30:00Z,45.10937,45.46875,45.07812,45.375,494200,-10.0225266\n1994-07-15T13:30:00Z,45.34375,45.48437,45.32812,45.39062,49100,-9.698754839\n1994-07-18T13:30:00Z,45.39062,45.57812,45.39062,45.46875,72300,-8.940441257\n1994-07-19T13:30:00Z,45.54687,45.5625,45.375,45.375,609500,-9.393700313\n1994-07-20T13:30:00Z,45.40625,45.40625,45.0625,45.17187,185300,-11.2284916\n1994-07-21T13:30:00Z,45.17187,45.29687,45.07812,45.26562,86300,-10.99742222\n1994-07-22T13:30:00Z,45.375,45.40625,45.25,45.34375,151600,-10.57703635\n1994-07-25T13:30:00Z,45.35937,45.45312,45.3125,45.40625,120900,-10.21724298\n1994-07-26T13:30:00Z,45.39062,45.42187,45.3125,45.35937,489600,-10.46298446\n1994-07-27T13:30:00Z,45.35937,45.35937,45.17187,45.35937,83200,-10.50985946\n1994-07-28T13:30:00Z,45.35937,45.57812,45.35937,45.45312,828200,-9.630953208\n1994-07-29T13:30:00Z,45.76562,46.04687,45.75,45.90625,459100,-5.301443659\n1994-08-01T13:30:00Z,45.9375,46.15625,45.89062,46.125,486300,-3.495468199\n1994-08-02T13:30:00Z,46.28125,46.375,46.03125,46.1875,505500,-3.245468199\n1994-08-03T13:30:00Z,46.17187,46.23437,46.09375,46.20312,144100,-3.21758342\n1994-08-04T13:30:00Z,46.17187,46.21875,45.92187,45.9375,231700,-5.380966188\n1994-08-05T13:30:00Z,45.70312,45.84375,45.65625,45.78125,138400,-6.435635688\n1994-08-08T13:30:00Z,45.82812,45.9375,45.78125,45.89062,328600,-5.545905903\n1994-08-09T13:30:00Z,45.71875,45.96875,45.71875,45.96875,105900,-4.661260683\n1994-08-10T13:30:00Z,46,46.1875,45.9375,46.14062,840300,-3.328285683\n1994-08-11T13:30:00Z,46.03125,46.23437,45.73437,45.96875,876200,-4.125201778\n1994-08-12T13:30:00Z,46.04687,46.34375,46.04687,46.32812,184100,-0.896091408\n1994-08-15T13:30:00Z,46.375,46.48437,46.3125,46.3125,325900,-0.801563246\n1994-08-16T13:30:00Z,46.34375,46.6875,46.15625,46.64062,1089500,1.173851039\n1994-08-17T13:30:00Z,46.70312,46.73437,46.57812,46.60937,133700,1.163916663\n1994-08-18T13:30:00Z,46.45312,46.5625,46.40625,46.45312,620000,0.040883611\n1994-08-19T13:30:00Z,46.46875,46.51562,46.3125,46.42187,103200,-0.195753224\n1994-08-22T13:30:00Z,46.4375,46.4375,46.28125,46.375,79700,-0.665826034\n1994-08-23T13:30:00Z,46.57812,46.85937,46.51562,46.64062,268600,1.315663904\n1994-08-24T13:30:00Z,46.6875,47.14062,46.67187,47.14062,254700,5.954320154\n1994-08-25T13:30:00Z,47.09375,47.20312,46.89062,47.01562,147400,5.767952634\n1994-08-26T13:30:00Z,47.125,47.78125,47.125,47.6875,339500,11.88377368\n1994-08-29T13:30:00Z,47.8125,47.98437,47.64062,47.65625,350300,12.00347932\n1994-08-30T13:30:00Z,47.64062,47.85937,47.57812,47.78125,36000,12.62275752\n1994-08-31T13:30:00Z,47.70312,47.89062,47.59375,47.65625,356200,12.22295007\n1994-09-01T13:30:00Z,47.5,47.53125,47.32812,47.5,294600,10.98093473\n1994-09-02T13:30:00Z,47.71875,47.71875,47.21875,47.29687,99600,9.525219887\n1994-09-06T13:30:00Z,47.26562,47.35937,47.125,47.3125,229800,9.315338619\n1994-09-07T13:30:00Z,47.42187,47.42187,47.21875,47.26562,27900,8.954896533\n1994-09-08T13:30:00Z,47.35937,47.5625,47.34375,47.5,284800,10.61511364\n1994-09-09T13:30:00Z,47.03125,47.125,46.8125,47,488400,6.757354401\n1994-09-12T13:30:00Z,47,47.0625,46.78125,46.85937,129400,5.72269055\n1994-09-13T13:30:00Z,46.95312,47.125,46.85937,47,389200,6.434219191\n1994-09-14T13:30:00Z,46.84375,47.10937,46.84375,47.04687,423500,6.998135266\n1994-09-15T13:30:00Z,47.17187,47.64062,47.17187,47.64062,779800,12.60190401\n1994-09-16T13:30:00Z,47,47.14062,46.84375,47.01562,571300,8.851880556\n1994-09-19T13:30:00Z,47.125,47.32812,47.01562,47.0625,167300,8.972467453\n1994-09-20T13:30:00Z,46.8125,46.85937,46.17187,46.17187,355600,0.487677975\n1994-09-21T13:30:00Z,46.3125,46.3125,45.73437,46.17187,397500,-0.36591665\n1994-09-22T13:30:00Z,46.28125,46.28125,46.01562,46.0625,266400,-1.190258287\n1994-09-23T13:30:00Z,46.07812,46.17187,45.82812,45.90625,176600,-2.281724586\n1994-09-26T13:30:00Z,46.07812,46.17187,45.98437,46.14062,223000,-0.910320994\n1994-09-27T13:30:00Z,46.14062,46.26562,46,46.10937,479500,-1.007975508\n1994-09-28T13:30:00Z,46.35937,46.53125,46.32812,46.46875,324000,2.33620476\n1994-09-29T13:30:00Z,46.46875,46.46875,46.09375,46.23437,195900,0.447521308\n1994-09-30T13:30:00Z,46.21875,46.4375,46.17187,46.17187,5200,-0.118432015\n1994-10-03T13:30:00Z,46.20312,46.25,45.98437,46.0625,72600,-0.927146185\n1994-10-04T13:30:00Z,46.29687,46.29687,45.34375,45.375,84200,-6.307134754\n1994-10-05T13:30:00Z,45.29687,45.39062,45,45.39062,461900,-6.940999623\n1994-10-06T13:30:00Z,45.42187,45.45312,45.17187,45.25,345200,-7.852424302\n1994-10-07T13:30:00Z,45.25,45.57812,45.20312,45.45312,188700,-6.568336641\n1994-10-10T13:30:00Z,45.65625,46.01562,45.64062,45.9375,213600,-1.995344436\n1994-10-11T13:30:00Z,46.14062,46.75,46.14062,46.625,461400,4.504651014\n1994-10-12T13:30:00Z,46.6875,46.75,46.57812,46.6875,162400,4.994227237\n1994-10-13T13:30:00Z,47.21875,47.32812,46.79687,46.84375,1564500,4.780686325\n1994-10-14T13:30:00Z,47,47.0625,46.6875,47.04687,72800,5.168034242\n1994-10-17T13:30:00Z,47,47.0625,46.90625,46.95312,282300,4.61615877\n1994-10-18T13:30:00Z,46.90625,46.90625,46.6875,46.84375,132100,3.620103385\n1994-10-19T13:30:00Z,46.67187,47.23437,46.65625,47.0625,136700,5.258418579\n1994-10-20T13:30:00Z,47.0625,47.0625,46.60937,46.75,290300,3.350319442\n1994-10-21T13:30:00Z,46.625,46.6875,46.35937,46.5625,87800,1.693648643\n1994-10-24T13:30:00Z,46.57812,46.76562,46.15625,46.17187,149600,-0.781977412\n1994-10-25T13:30:00Z,46.01562,46.3125,46,46.21875,91800,-0.660351823\n1994-10-26T13:30:00Z,46.39062,46.4375,46.17187,46.39062,201000,0.301707878\n1994-10-27T13:30:00Z,46.5625,46.67187,46.45312,46.67187,210300,2.663750846\n1994-10-28T13:30:00Z,46.76562,47.70312,46.76562,47.65625,192100,11.94604755\n1994-10-31T14:30:00Z,47.54687,47.59375,47.46875,47.48437,36300,12.00644168\n1994-11-01T14:30:00Z,47.28125,47.28125,46.9375,46.95312,435200,6.734660436\n1994-11-02T14:30:00Z,46.8125,47.23437,46.6875,46.6875,115600,5.588264625\n1994-11-03T14:30:00Z,46.84375,47.01562,46.78125,46.9375,87000,7.331430016\n1994-11-04T14:30:00Z,47.15625,47.15625,46.32812,46.32812,124400,2.858908971\n1994-11-07T14:30:00Z,46.3125,46.59375,46.3125,46.46875,115000,2.89876612\n1994-11-08T14:30:00Z,46.625,46.98437,46.54687,46.82812,308300,6.023704093\n1994-11-09T14:30:00Z,47.32812,47.32812,46.5,46.90625,318500,5.732057575\n1994-11-10T14:30:00Z,46.9375,47.03125,46.54687,46.57812,172100,3.396673622\n1994-11-11T14:30:00Z,46.51562,46.5625,46.28125,46.40625,302200,1.847313163\n1994-11-14T14:30:00Z,46.60937,46.85937,46.60937,46.84375,181400,5.788823498\n1994-11-15T14:30:00Z,46.79687,47.09375,46.32812,46.6875,316900,5.193180059\n1994-11-16T14:30:00Z,46.76562,46.84375,46.60937,46.84375,106900,5.819934138\n1994-11-17T14:30:00Z,46.875,46.875,46.34375,46.53125,104700,3.182535869\n1994-11-18T14:30:00Z,46.54687,46.625,46.26562,46.46875,269300,2.483526722\n1994-11-21T14:30:00Z,46.4375,46.57812,46,46,283100,-0.982342856\n1994-11-22T14:30:00Z,45.82812,46,45,45,483600,-9.56507525\n1994-11-23T14:30:00Z,45.03125,45.26562,44.60937,45.25,601600,-9.13422918\n1994-11-25T14:30:00Z,45.28125,45.53125,45.28125,45.46875,77300,-7.119175826\n1994-11-28T14:30:00Z,45.45312,45.6875,45.34375,45.67187,79900,-5.861380826\n1994-11-29T14:30:00Z,45.65625,45.75,45.5,45.65625,105500,-5.723646852\n1994-11-30T14:30:00Z,45.89062,45.95312,45.59375,45.59375,218800,-6.812710238\n1994-12-01T14:30:00Z,45.64062,45.64062,45.04687,45.14062,439000,-10.79040939\n1994-12-02T14:30:00Z,45.04687,45.5625,45.04687,45.5625,318500,-8.507356701\n1994-12-05T14:30:00Z,45.65625,45.8125,45.5,45.60937,139200,-7.96811044\n1994-12-06T14:30:00Z,45.4375,45.65625,45.35937,45.64062,249900,-7.355008933\n1994-12-07T14:30:00Z,45.35937,45.5,45.26562,45.3125,531900,-9.338133828\n1994-12-08T14:30:00Z,45.5,45.5625,44.75,44.875,261500,-12.58717075\n1994-12-09T14:30:00Z,44.875,45.07812,44.6875,45.04687,235900,-12.35142172\n1994-12-12T14:30:00Z,44.95312,45.34375,44.95312,45.34375,151100,-10.06129315\n1994-12-13T14:30:00Z,45.3125,45.53125,45.3125,45.51562,70900,-8.686900436\n1994-12-14T14:30:00Z,45.45312,45.95312,45.45312,45.75,203300,-6.534271437\n1994-12-15T14:30:00Z,45.8125,46.03125,45.8125,45.89062,130100,-5.157710479\n1994-12-16T14:30:00Z,45.67187,45.84375,45.625,45.75,266100,-5.678015976\n1994-12-19T14:30:00Z,45.75,45.84375,45.60937,45.8125,1120200,-5.285879955\n1994-12-20T14:30:00Z,45.85937,45.89062,45.67187,45.67187,675600,-6.106240372\n1994-12-21T14:30:00Z,45.70312,46.26562,45.70312,46.15625,544500,-2.163324747\n1994-12-22T14:30:00Z,46.15625,46.20312,45.96875,46.01562,222000,-2.492527737\n1994-12-23T14:30:00Z,45.98437,46.17187,45.98437,46.0625,125800,-2.269776794\n1994-12-27T14:30:00Z,46.21875,46.40625,46.1875,46.3125,95200,-0.009732615\n1994-12-28T14:30:00Z,46.35937,46.35937,45.96875,46.07812,358200,-1.833925634\n1994-12-29T14:30:00Z,46.25,46.25,46.0625,46.10937,220100,-2.289678475\n1994-12-30T14:30:00Z,46.20312,46.25,45.5625,45.5625,2209500,-6.557444573\n1995-01-03T14:30:00Z,45.70312,45.84375,45.6875,45.78125,324300,-6.104381222\n1995-01-04T14:30:00Z,45.98437,46,45.75,46,351800,-4.85606636\n1995-01-05T14:30:00Z,46.03125,46.10937,45.95312,46,89800,-4.906077402\n1995-01-06T14:30:00Z,46.09375,46.25,45.90625,46.04687,448400,-4.836666291\n1995-01-09T14:30:00Z,46.03125,46.09375,46,46.09375,36800,-4.652176579\n1995-01-10T14:30:00Z,46.20312,46.39062,46.14062,46.14062,229800,-4.4516191\n1995-01-11T14:30:00Z,46.29687,46.29687,45.8125,46.17187,222400,-4.643878835\n1995-01-12T14:30:00Z,46.125,46.21875,46.03125,46.1875,40300,-4.581081961\n1995-01-13T14:30:00Z,46.4375,46.73437,46.375,46.73437,170600,0.602790522\n1995-01-16T14:30:00Z,46.71875,47.03125,46.71875,47.01562,105100,3.020553071\n1995-01-17T14:30:00Z,46.92187,47.0625,46.85937,47.03125,89500,3.529481049\n1995-01-18T14:30:00Z,47,47.07812,46.875,46.98437,84500,3.413589333\n1995-01-19T14:30:00Z,46.82812,46.875,46.6875,46.71875,139100,0.969158761\n1995-01-20T14:30:00Z,46.65625,46.67187,46.45312,46.54687,78700,-0.594817229\n1995-01-23T14:30:00Z,46.23437,46.6875,46.20312,46.6875,53700,0.832016489\n1995-01-24T14:30:00Z,46.67187,46.75,46.64062,46.75,32400,1.208931347\n1995-01-25T14:30:00Z,46.51562,47.04687,46.51562,46.875,15700,2.301149391\n1995-01-26T14:30:00Z,46.84375,46.98437,46.75,46.92187,9800,2.724708507\n1995-01-27T14:30:00Z,47.23437,47.23437,46.92187,47.10937,91200,3.574888179\n1995-01-30T14:30:00Z,47.01562,47.04687,46.84375,46.90625,26600,1.768294429\n1995-01-31T14:30:00Z,47,47.17187,46.92187,47.09375,127500,2.97361379\n1995-02-01T14:30:00Z,47.15625,47.32812,47,47.07812,380200,2.843375132\n1995-02-02T14:30:00Z,47.0625,47.35937,47.0625,47.35937,131700,5.122027139\n1995-02-03T14:30:00Z,47.65625,48.10937,47.57812,48.03125,405100,11.24398866\n1995-02-06T14:30:00Z,48.01562,48.375,47.96875,48.23437,405400,12.98957265\n1995-02-07T14:30:00Z,48.3125,48.3125,48.14062,48.29687,702900,13.27242632\n1995-02-08T14:30:00Z,48.23437,48.46875,48.20312,48.29687,521500,13.38140069\n1995-02-09T14:30:00Z,48.21875,48.29687,48.125,48.29687,390700,13.69469941\n1995-02-10T14:30:00Z,48.23437,48.35937,48.09375,48.35937,148300,14.33815316\n1995-02-13T14:30:00Z,48.32812,48.46875,48.32812,48.375,79700,14.61783962\n1995-02-14T14:30:00Z,48.53125,48.53125,48.25,48.4375,170200,14.70898924\n1995-02-15T14:30:00Z,48.4375,48.76562,48.39062,48.70312,431500,16.63906828\n1995-02-16T14:30:00Z,48.64062,48.6875,48.5,48.64062,99300,16.65801025\n1995-02-17T14:30:00Z,48.59375,48.625,48.4375,48.45312,49100,14.98223255\n1995-02-21T14:30:00Z,48.45312,48.53125,48.42187,48.4375,168000,14.7842977\n1995-02-22T14:30:00Z,48.48437,48.79687,48.45312,48.79687,386400,18.01765083\n1995-02-23T14:30:00Z,48.98437,49.15625,48.85937,48.875,402800,18.57921664\n1995-02-24T14:30:00Z,48.9375,49.01562,48.8125,49,307600,19.07080889\n1995-02-27T14:30:00Z,48.85937,49,48.53125,48.60937,280900,16.0465851\n1995-02-28T14:30:00Z,48.5625,49.01562,48.5625,49.01562,493500,18.85495703\n1995-03-01T14:30:00Z,48.96875,49.03125,48.65625,48.70312,237900,17.32761337\n1995-03-02T14:30:00Z,48.6875,48.76562,48.54687,48.76562,488600,17.44799812\n1995-03-03T14:30:00Z,48.60937,48.78125,48.48437,48.78125,290000,18.12076792\n1995-03-06T14:30:00Z,48.45312,48.8125,48.39062,48.8125,85700,19.45432798\n1995-03-07T14:30:00Z,48.64062,48.75,48.21875,48.4375,180900,17.25445645\n1995-03-08T14:30:00Z,48.51562,48.625,48.34375,48.5625,155900,17.5991401\n1995-03-09T14:30:00Z,48.54687,48.59375,48.42187,48.54687,63500,17.58042199\n1995-03-10T14:30:00Z,48.59375,49.39062,48.53125,49.26562,192100,24.05239032\n1995-03-13T14:30:00Z,49.23437,49.39062,49.17187,49.21875,261300,24.2812547\n1995-03-14T14:30:00Z,49.35937,49.64062,49.35937,49.57812,223300,27.72923922\n1995-03-15T14:30:00Z,49.5,49.57812,49.29687,49.48437,278500,27.48394998\n1995-03-16T14:30:00Z,49.4375,49.8125,49.4375,49.78125,20400,29.99990721\n1995-03-17T14:30:00Z,49.4375,49.625,49.40625,49.5625,89900,29.56942251\n1995-03-20T14:30:00Z,49.625,49.625,49.46875,49.5625,91700,29.56942251\n1995-03-21T14:30:00Z,49.5625,49.875,49.35937,49.4375,104400,28.82264645\n1995-03-22T14:30:00Z,49.53125,49.53125,49.32812,49.48437,74900,28.79983756\n1995-03-23T14:30:00Z,49.42187,49.65625,49.35937,49.51562,220500,29.03099625\n1995-03-24T14:30:00Z,49.67187,50.21875,49.67187,50.21875,134000,35.80815145\n1995-03-27T14:30:00Z,50.29687,50.42187,50.17187,50.42187,132100,37.1289278\n1995-03-28T14:30:00Z,50.29687,50.42187,50.23437,50.42187,121900,37.63115994\n1995-03-29T14:30:00Z,50.375,50.89062,50.125,50.40625,246100,37.74606875\n1995-03-30T14:30:00Z,50.51562,50.51562,50.10937,50.3125,298400,36.90585354\n1995-03-31T14:30:00Z,49.92187,50.17187,49.54687,50.10937,541300,35.87864436\n1995-04-03T13:30:00Z,50.09375,50.23437,50.0625,50.23437,193300,36.74361056\n1995-04-04T13:30:00Z,50.25,50.5625,50.25,50.5625,66900,39.740963\n1995-04-05T13:30:00Z,50.45312,50.60937,50.42187,50.5625,107200,40.18044003\n1995-04-06T13:30:00Z,50.6875,50.79687,50.59375,50.75,352500,41.64528229\n1995-04-07T13:30:00Z,50.85937,50.85937,50.46875,50.70312,361400,41.17199762\n1995-04-10T13:30:00Z,50.625,50.79687,50.59375,50.79687,285400,41.56890601\n1995-04-11T13:30:00Z,50.92187,50.9375,50.59375,50.625,250300,40.65847409\n1995-04-12T13:30:00Z,50.78125,50.79687,50.60937,50.79687,144400,41.09133204\n1995-04-13T13:30:00Z,50.89062,51.09375,50.85937,51.07812,243400,43.69974366\n1995-04-17T13:30:00Z,51.26562,51.3125,50.625,50.78125,178900,41.80173003\n1995-04-18T13:30:00Z,50.82812,50.82812,50.48437,50.60937,329500,40.19568974\n1995-04-19T13:30:00Z,50.60937,50.71875,50.29687,50.5625,223000,39.68343077\n1995-04-20T13:30:00Z,50.70312,50.78125,50.4375,50.64062,207900,39.81863316\n1995-04-21T13:30:00Z,50.65625,50.90625,50.65625,50.89062,145000,41.95312526\n1995-04-24T13:30:00Z,50.85937,51.48437,50.85937,51.48437,169000,47.19085126\n1995-04-25T13:30:00Z,51.40625,51.48437,51.3125,51.34375,293200,47.13971507\n1995-04-26T13:30:00Z,51.25,51.42187,51.125,51.39062,204400,47.5840253\n1995-04-27T13:30:00Z,51.3125,51.54687,51.28125,51.51562,502200,48.43376698\n1995-04-28T13:30:00Z,51.5,51.67187,51.17187,51.59375,130800,49.11945471\n1995-05-01T13:30:00Z,51.54687,51.65625,51.45312,51.45312,518700,48.48297738\n1995-05-02T13:30:00Z,51.5,51.64062,51.39062,51.5625,228400,48.98523095\n1995-05-03T13:30:00Z,51.73437,52.28125,51.73437,52.28125,724700,55.96705493\n1995-05-04T13:30:00Z,52.34375,52.6875,52.125,52.25,311400,56.17982969\n1995-05-05T13:30:00Z,52.46875,52.46875,52.07812,52.1875,314900,55.431755\n1995-05-08T13:30:00Z,52.14062,52.73437,52.09375,52.5625,183100,57.91072813\n1995-05-09T13:30:00Z,52.78125,52.84375,52.4375,52.51562,180600,57.65575738\n1995-05-10T13:30:00Z,52.65625,52.67187,52.32812,52.57812,330300,57.53297918\n1995-05-11T13:30:00Z,52.65625,52.71875,52.48437,52.71875,351700,58.06034168\n1995-05-12T13:30:00Z,52.51562,52.875,52.5,52.75,94600,58.63456918\n1995-05-15T13:30:00Z,52.89062,53,52.78125,53,147200,60.57208092\n1995-05-16T13:30:00Z,52.98437,53.15625,52.89062,53.03125,221600,60.84552508\n1995-05-17T13:30:00Z,53.03125,53.04687,52.78125,52.82812,189200,59.19493939\n1995-05-18T13:30:00Z,52.73437,52.76562,52.0625,52.0625,577800,52.17199928\n1995-05-19T13:30:00Z,51.98437,52.1875,51.90625,52.09375,363900,51.99367813\n1995-05-22T13:30:00Z,52.26562,52.75,52.23437,52.67187,216000,57.40141258\n1995-05-23T13:30:00Z,52.76562,53.15625,52.60937,53.15625,136800,61.04885923\n1995-05-24T13:30:00Z,53.25,53.42187,52.79687,53.125,370800,61.06100431\n1995-05-25T13:30:00Z,52.96875,53.21875,52.71875,53.17187,379900,61.62105578\n1995-05-26T13:30:00Z,52.96875,52.98437,52.35937,52.5625,518600,56.59450193\n1995-05-30T13:30:00Z,52.6875,52.82812,52.375,52.54687,61500,56.03330542\n1995-05-31T13:30:00Z,52.57812,53.64062,52.45312,53.64062,564500,64.92219209\n1995-06-01T13:30:00Z,53.40625,53.90625,53.25,53.5,810100,65.37737695\n1995-06-02T13:30:00Z,53.28125,53.92187,53.09375,53.54687,112900,66.00629205\n1995-06-05T13:30:00Z,53.54687,54.04687,53.5,53.875,257200,68.85269048\n1995-06-06T13:30:00Z,53.82812,54.01562,53.78125,53.78125,165800,68.75504697\n1995-06-07T13:30:00Z,53.67187,53.70312,53.4375,53.5,41900,66.18222172\n1995-06-08T13:30:00Z,53.48437,53.64062,53.375,53.375,141100,65.54809456\n1995-06-09T13:30:00Z,53.26562,53.32812,52.75,53.0625,304900,62.80644777\n1995-06-12T13:30:00Z,53.23437,53.57812,53.20312,53.35937,378500,64.81106357\n1995-06-13T13:30:00Z,53.60937,53.96875,53.5625,53.9375,120000,70.27564013\n1995-06-14T13:30:00Z,53.85937,53.95312,53.6875,53.89062,389400,70.50385607\n1995-06-15T13:30:00Z,53.96875,54.23437,53.875,54.125,274500,72.37807973\n1995-06-16T13:30:00Z,53.70312,53.96875,53.70312,53.96875,325100,72.48571799\n1995-06-19T13:30:00Z,54.125,54.60937,54.09375,54.57812,134600,78.09113678\n1995-06-20T13:30:00Z,54.42187,54.60937,54.39062,54.4375,287800,78.02222476\n1995-06-21T13:30:00Z,54.60937,54.65625,54.40625,54.40625,158200,77.32813779\n1995-06-22T13:30:00Z,54.64062,55.15625,54.64062,55.125,297000,83.56922352\n1995-06-23T13:30:00Z,55,55.03125,54.84375,55.01562,315400,83.66577538\n1995-06-26T13:30:00Z,54.85937,54.95312,54.35937,54.35937,132900,77.78090499\n1995-06-27T13:30:00Z,54.34375,54.70312,54.21875,54.25,127700,76.78932794\n1995-06-28T13:30:00Z,54.25,54.75,54.07812,54.53125,212600,78.5800454\n1995-06-29T13:30:00Z,54.53125,54.67187,54.0625,54.4375,89200,78.27697205\n1995-06-30T13:30:00Z,54.54687,54.73437,54.29687,54.40625,714100,77.77381262\n1995-07-03T13:30:00Z,54.46875,54.60937,54.46875,54.60937,9500,79.23494105\n1995-07-05T13:30:00Z,54.76562,55.0625,54.64062,54.8125,409300,80.80313289\n1995-07-06T13:30:00Z,54.82812,55.51562,54.71875,55.51562,202500,86.55632519\n1995-07-07T13:30:00Z,55.40625,55.78125,55.375,55.76562,481700,88.2838104\n1995-07-10T13:30:00Z,55.8125,55.95312,55.70312,55.79687,400400,88.67442391\n1995-07-11T13:30:00Z,55.75,55.79687,55.45312,55.53125,420500,86.33290003\n1995-07-12T13:30:00Z,55.64062,56.3125,55.53125,56.21875,203400,91.71769851\n1995-07-13T13:30:00Z,56.14062,56.26562,56.03125,56.09375,215600,91.7056288\n1995-07-14T13:30:00Z,55.79687,56.09375,55.75,56.04687,543700,92.106964\n1995-07-17T13:30:00Z,56.125,56.42187,56.07812,56.35937,171500,94.84132511\n1995-07-18T13:30:00Z,56.26562,56.26562,55.82812,55.875,221200,91.04329928\n1995-07-19T13:30:00Z,55.65625,55.71875,54.20312,55.26562,486600,85.46873088\n1995-07-20T13:30:00Z,55.32812,55.57812,55.03125,55.46875,318900,86.00142338\n1995-07-21T13:30:00Z,55.42187,55.625,55.1875,55.40625,94000,85.87069128\n1995-07-24T13:30:00Z,55.48437,55.875,55.48437,55.8125,108400,89.69777485\n1995-07-25T13:30:00Z,55.875,56.3125,55.70312,56.23437,107400,92.78740793\n1995-07-26T13:30:00Z,56.20312,56.46875,56.17187,56.1875,167800,92.92060077\n1995-07-27T13:30:00Z,56.45312,56.70312,56.45312,56.65625,187700,97.64068411\n1995-07-28T13:30:00Z,56.70312,56.70312,56.25,56.29687,415600,95.06221821\n1995-07-31T13:30:00Z,56.34375,56.39062,56.03125,56.15625,342500,93.85230149\n1995-08-01T13:30:00Z,56.23437,56.23437,55.75,56.0625,141000,92.76946776\n1995-08-02T13:30:00Z,56.39062,56.79687,55.84375,55.9375,240400,90.9515479\n1995-08-03T13:30:00Z,55.54687,55.95312,55.45312,55.92187,1193600,91.24076963\n1995-08-04T13:30:00Z,56.03125,56.07812,55.92187,55.98437,240500,91.75955869\n1995-08-07T13:30:00Z,56.10937,56.28125,56.07812,56.10937,193100,92.56265752\n1995-08-08T13:30:00Z,56.14062,56.3125,55.9375,56.10937,951900,92.50975908\n1995-08-09T13:30:00Z,56.29687,56.29687,56.04687,56.09375,107100,91.94161135\n1995-08-10T13:30:00Z,56.15625,56.28125,55.73437,55.96875,280800,90.92866407\n1995-08-11T13:30:00Z,55.92187,55.98437,55.42187,55.65625,257200,88.16798579\n1995-08-14T13:30:00Z,55.79687,56.15625,55.67187,56.15625,254800,91.59894314\n1995-08-15T13:30:00Z,56.14062,56.14062,55.65625,56.04687,44400,91.24237862\n1995-08-16T13:30:00Z,56,56.20312,55.9375,56.20312,374900,92.0341913\n1995-08-17T13:30:00Z,56.23437,56.23437,55.90625,56.10937,353800,91.51771468\n1995-08-18T13:30:00Z,56.39062,56.40625,56.125,56.17187,85400,91.06515724\n1995-08-21T13:30:00Z,56.40625,56.64062,56,56.01562,266700,89.35340686\n1995-08-22T13:30:00Z,56.09375,56.21875,55.8125,56.125,220200,89.42230713\n1995-08-23T13:30:00Z,56.17187,56.20312,55.92187,55.92187,176500,88.01547267\n1995-08-24T13:30:00Z,55.9375,56.09375,55.75,55.98437,167400,88.07744202\n1995-08-25T13:30:00Z,56.07812,56.39062,56.07812,56.29687,195000,91.04413754\n1995-08-28T13:30:00Z,56.45312,56.45312,56,56.09375,293000,89.84525506\n1995-08-29T13:30:00Z,56.15625,56.25,55.76562,56.23437,1133100,90.16610607\n1995-08-30T13:30:00Z,56.28125,56.42187,56.21875,56.35937,437400,91.13239635\n1995-08-31T13:30:00Z,56.34375,56.5,56.29687,56.40625,491900,91.51790357\n1995-09-01T13:30:00Z,56.39062,56.75,56.34375,56.65625,629900,93.54699616\n1995-09-05T13:30:00Z,56.82812,57.21875,56.73437,57.1875,272200,98.18016372\n1995-09-06T13:30:00Z,57.23437,57.35937,57.21875,57.29687,214500,99.1861478\n1995-09-07T13:30:00Z,57.35937,57.39062,57.25,57.32812,258800,99.30333905\n1995-09-08T13:30:00Z,57.54687,57.54687,57.17187,57.54687,107300,100.0566873\n1995-09-11T13:30:00Z,57.64062,57.8125,57.64062,57.70312,260700,101.4796726\n1995-09-12T13:30:00Z,57.71875,57.96875,57.57812,57.96875,139500,103.1398601\n1995-09-13T13:30:00Z,57.90625,58.3125,57.89062,58.23437,239800,105.322894\n1995-09-14T13:30:00Z,58.4375,58.8125,58.28125,58.76562,457600,109.7342088\n1995-09-15T13:30:00Z,58.40625,58.57812,58.20312,58.4375,431200,108.2631523\n1995-09-18T13:30:00Z,58.23437,58.26562,57.9375,58.21875,307500,106.6427908\n1995-09-19T13:30:00Z,58.32812,58.53125,58.125,58.5,549600,108.3727246\n1995-09-20T13:30:00Z,58.59375,58.78125,58.54687,58.78125,290800,110.815376\n1995-09-21T13:30:00Z,58.70312,58.75,58.0625,58.29687,508500,106.9782692\n1995-09-22T13:30:00Z,57.82812,58.375,57.78125,58.3125,449900,107.7024894\n1995-09-25T13:30:00Z,58.375,58.375,58.01562,58.21875,130000,107.506387\n1995-09-26T13:30:00Z,58.39062,58.53125,58.0625,58.20312,466600,106.9354543\n1995-09-27T13:30:00Z,57.95312,58.1875,57.59375,58.15625,654400,106.9813848\n1995-09-28T13:30:00Z,58.20312,58.59375,58.15625,58.59375,456200,110.809521\n1995-09-29T13:30:00Z,58.54687,58.90625,58.40625,58.48437,606600,110.6690883\n1995-10-02T13:30:00Z,58.48437,58.625,58.04687,58.1875,293100,108.5464023\n1995-10-03T13:30:00Z,58.1875,58.34375,57.95312,58.25,839700,108.6079551\n1995-10-04T13:30:00Z,58.28125,58.28125,58.10937,58.1875,248800,108.168498\n1995-10-05T13:30:00Z,58.25,58.35937,58.09375,58.35937,268800,108.9233177\n1995-10-06T13:30:00Z,58.39062,58.57812,58.39062,58.40625,75300,109.4099835\n1995-10-09T13:30:00Z,58.1875,58.21875,57.8125,57.92187,358200,104.8935363\n1995-10-10T13:30:00Z,57.32812,57.89062,57.26562,57.89062,360800,105.9585738\n1995-10-11T13:30:00Z,58.09375,58.09375,57.875,58.07812,228100,107.0901316\n1995-10-12T13:30:00Z,58.125,58.46875,58.125,58.4375,199800,110.456736\n1995-10-13T13:30:00Z,58.70312,58.85937,58.625,58.625,488100,111.9272307\n1995-10-16T13:30:00Z,58.45312,58.5625,58.34375,58.34375,443600,109.6089699\n1995-10-17T13:30:00Z,58.40625,58.79687,58.29687,58.73437,146000,112.4409431\n1995-10-18T13:30:00Z,59.01562,59.09375,58.71875,58.90625,228100,113.4200566\n1995-10-19T13:30:00Z,58.875,59.1875,58.79687,59.1875,500600,115.1450026\n1995-10-20T13:30:00Z,59.14062,59.1875,58.82812,58.82812,748400,112.8988776\n1995-10-23T13:30:00Z,58.54687,58.8125,58.54687,58.70312,533000,112.273882\n1995-10-24T13:30:00Z,58.78125,58.84375,58.625,58.76562,172200,112.5934871\n1995-10-25T13:30:00Z,58.8125,58.89062,58.28125,58.28125,302700,108.8720096\n1995-10-26T13:30:00Z,58.375,58.42187,57.28125,57.75,606800,104.079046\n1995-10-27T13:30:00Z,57.6875,58.1875,57.42187,58.1875,905800,105.6547789\n1995-10-30T14:30:00Z,58.32812,58.59375,58.32812,58.5625,488700,109.0545359\n1995-10-31T14:30:00Z,58.71875,58.84375,58.3125,58.3125,508200,107.8787868\n1995-11-01T14:30:00Z,58.28125,58.78125,58.23437,58.78125,415700,110.667263\n1995-11-02T14:30:00Z,58.6875,59.15625,58.6875,59.15625,326000,113.5661117\n1995-11-03T14:30:00Z,59.23437,59.25,59.0625,59.23437,615000,113.941703\n1995-11-06T14:30:00Z,59.21875,59.21875,59.01562,59.03125,311200,112.0175684\n1995-11-07T14:30:00Z,59,59,58.625,58.8125,358200,109.9319099\n1995-11-08T14:30:00Z,58.89062,59.375,58.89062,59.34375,357200,114.3143976\n1995-11-09T14:30:00Z,59.57812,59.57812,59.28125,59.5625,503700,115.472321\n1995-11-10T14:30:00Z,59.23437,59.60937,59.21875,59.53125,795600,116.0892292\n1995-11-13T14:30:00Z,59.42187,59.65625,59.3125,59.46875,818500,116.2042383\n1995-11-14T14:30:00Z,59.35937,59.48437,59.07812,59.07812,341800,113.1695414\n1995-11-15T14:30:00Z,59.14062,59.6875,59.10937,59.67187,584700,117.69505\n1995-11-16T14:30:00Z,59.67187,60.0625,59.65625,60,577700,120.5257361\n1995-11-17T14:30:00Z,60.09375,60.20312,60.01562,60.1875,267000,121.9740512\n1995-11-20T14:30:00Z,60.28125,60.29687,59.85937,59.875,448800,119.7842006\n1995-11-21T14:30:00Z,59.9375,60.35937,59.92187,60.35937,119200,122.9796709\n1995-11-22T14:30:00Z,60.3125,60.375,60.17187,60.17187,351600,122.4011432\n1995-11-24T14:30:00Z,60.23437,60.32812,60.1875,60.32812,62400,123.2945934\n1995-11-27T14:30:00Z,60.45312,60.64062,60.34375,60.34375,273000,123.2016314\n1995-11-28T14:30:00Z,60.29687,60.98437,60.15625,60.98437,479000,127.6808674\n1995-11-29T14:30:00Z,61.09375,61.09375,60.84375,61.04687,549200,128.1202997\n1995-11-30T14:30:00Z,61.04687,61.20312,60.84375,60.90625,286200,127.3586134\n1995-12-01T14:30:00Z,60.98437,61.07812,60.84375,60.98437,465200,127.5298497\n1995-12-04T14:30:00Z,61.125,61.73437,61.04687,61.73437,631700,134.4082302\n1995-12-05T14:30:00Z,61.67187,62.20312,61.625,62.14062,567700,137.5886083\n1995-12-06T14:30:00Z,62.29687,62.53125,62,62.28125,272800,138.5299136\n1995-12-07T14:30:00Z,62.20312,62.28125,61.90625,61.95312,289700,135.7028837\n1995-12-08T14:30:00Z,62.21875,62.23437,61.76562,62.15625,296900,136.0648028\n1995-12-11T14:30:00Z,62.28125,62.54687,62.15625,62.42187,186500,137.9897117\n1995-12-12T14:30:00Z,62.14062,62.35937,62.14062,62.23437,299400,137.3395513\n1995-12-13T14:30:00Z,62.3125,62.70312,62.3125,62.625,390700,141.0269693\n1995-12-14T14:30:00Z,62.6875,62.79687,62.01562,62.17187,395000,138.2224031\n1995-12-15T14:30:00Z,61.875,61.875,61.59375,61.8125,416700,134.8618447\n1995-12-18T14:30:00Z,61.26562,61.26562,60.60937,60.625,862300,122.7435934\n1995-12-19T14:30:00Z,60.65625,61.34375,60.57812,61.26562,1022600,126.5533776\n1995-12-20T14:30:00Z,61.45312,61.51562,60.67187,60.67187,1349800,123.4536448\n1995-12-21T14:30:00Z,61.03125,61.17187,60.75,60.98437,857600,123.9000631\n1995-12-22T14:30:00Z,61.3125,61.375,61.14062,61.20312,332800,125.0471942\n1995-12-26T14:30:00Z,61.45312,61.53125,61.32812,61.5,432200,127.0980067\n1995-12-27T14:30:00Z,61.65625,61.65625,61.35937,61.46875,151800,126.739533\n1995-12-28T14:30:00Z,61.34375,61.65625,61.25,61.40625,256200,126.503811\n1995-12-29T14:30:00Z,61.46875,61.53125,61.25,61.48437,339200,126.8378735\n1996-01-02T14:30:00Z,61.40625,62.14062,61.34375,62.14062,514400,132.0998999\n1996-01-03T14:30:00Z,62.34375,62.5,62,62.3125,610300,133.2165593\n1996-01-04T14:30:00Z,62.39062,62.625,61.21875,61.71875,1129700,128.6844581\n1996-01-05T14:30:00Z,61.3125,61.75,61.17187,61.59375,302400,127.9865511\n1996-01-08T14:30:00Z,61.8125,61.90625,61.73437,61.82812,179900,129.9396136\n1996-01-09T14:30:00Z,62.0625,62.0625,60.625,60.76562,415500,121.034379\n1996-01-10T14:30:00Z,60.6875,60.8125,59.64062,59.96875,787700,114.0766091\n1996-01-11T14:30:00Z,60.0625,60.32812,59.78125,60.32812,513200,115.042641\n1996-01-12T14:30:00Z,60.48437,60.5,59.67187,60.23437,390400,114.3441188\n1996-01-15T14:30:00Z,60.25,60.45312,59.85937,60.10937,154100,113.423351\n1996-01-16T14:30:00Z,60.40625,60.89062,59.89062,60.84375,454500,117.7534047\n1996-01-17T14:30:00Z,60.70312,61.125,60.45312,60.65625,407600,117.4360277\n1996-01-18T14:30:00Z,60.89062,60.90625,60.375,60.85937,425500,118.0050928\n1996-01-19T14:30:00Z,60.85937,61.42187,60.79687,61.26562,169800,121.3471067\n1996-01-22T14:30:00Z,61.21875,61.42187,61.10937,61.28125,288100,121.6972069\n1996-01-23T14:30:00Z,61.25,61.42187,61.125,61.42187,362100,122.4540316\n1996-01-24T14:30:00Z,61.51562,62.04687,61.48437,61.92187,1506500,127.0312951\n1996-01-25T14:30:00Z,61.96875,62,61.625,61.70312,298400,126.0579411\n1996-01-26T14:30:00Z,61.65625,62.26562,61.57812,62.23437,726300,129.5735428\n1996-01-29T14:30:00Z,62.1875,62.48437,62.14062,62.48437,254800,131.3110353\n1996-01-30T14:30:00Z,62.60937,63.14062,62.53125,63.01562,272100,136.0017901\n1996-01-31T14:30:00Z,63,63.6875,62.96875,63.67187,498000,141.6007773\n1996-02-01T14:30:00Z,63.60937,63.90625,63.5625,63.90625,373900,143.1774966\n1996-02-02T14:30:00Z,63.875,64.01562,63.5,63.64062,496200,141.8490776\n1996-02-05T14:30:00Z,63.53125,64.25,63.4375,64.15625,295300,145.2136592\n1996-02-06T14:30:00Z,64.1875,64.82812,64.09375,64.76562,301600,150.1863738\n1996-02-07T14:30:00Z,64.75,65.14062,64.6875,65.14062,585100,152.9896972\n1996-02-08T14:30:00Z,65.04687,65.90625,64.92187,65.84375,1526600,158.2931453\n1996-02-09T14:30:00Z,65.8125,66.375,65.51562,65.82812,804600,158.8934739\n1996-02-12T14:30:00Z,65.95312,66.625,65.89062,66.32812,626500,163.3683095\n1996-02-13T14:30:00Z,66.04687,66.6875,66,66.1875,1045900,163.4357148\n1996-02-14T14:30:00Z,66.14062,66.35937,65.57812,65.60937,431400,159.6635242\n1996-02-15T14:30:00Z,65.46875,65.90625,65.125,65.20312,889500,157.4383119\n1996-02-16T14:30:00Z,65.07812,65.23437,64.73437,64.9375,606100,155.3572605\n1996-02-20T14:30:00Z,64.4375,64.625,63.875,64.29687,492300,150.0943074\n1996-02-21T14:30:00Z,64.42187,65.14062,64.42187,65.09375,434000,157.184461\n1996-02-22T14:30:00Z,65.45312,66.32812,65.40625,66.125,721400,166.6889684\n1996-02-23T14:30:00Z,66.5,66.60937,65.32812,65.9375,1430400,165.6552849\n1996-02-26T14:30:00Z,65.75,65.89062,64.96875,65,1408400,157.5533103\n1996-02-27T14:30:00Z,65.15625,65.17187,64.5,64.79687,601000,155.4794073\n1996-02-28T14:30:00Z,65.3125,65.73437,64.5,64.5,865900,151.9707027\n1996-02-29T14:30:00Z,64.125,64.95312,63.875,63.875,914300,149.0648225\n1996-03-01T14:30:00Z,64.64062,64.89062,63.60937,64.89062,1452600,154.1576608\n1996-03-04T14:30:00Z,65.03125,65.65625,64.8125,65.26562,652600,157.0865123\n1996-03-05T14:30:00Z,65.10937,65.875,65.07812,65.875,402000,161.7646937\n1996-03-06T14:30:00Z,65.78125,65.96875,65.29687,65.29687,624700,159.1323639\n1996-03-07T14:30:00Z,65.42187,65.65625,65.23437,65.625,534200,160.4089497\n1996-03-08T14:30:00Z,64.1875,64.875,62,63.5,2289900,143.812256\n1996-03-11T14:30:00Z,63.25,64.32812,63.0625,64.23437,1511400,147.6096675\n1996-03-12T14:30:00Z,63.8125,64.04687,62.90625,63.73437,1385300,145.9670109\n1996-03-13T14:30:00Z,64.15625,64.4375,63.79687,64.17187,1019300,148.6732186\n1996-03-14T14:30:00Z,64.26562,64.8125,64.23437,64.45312,725600,151.1469656\n1996-03-15T14:30:00Z,64.0625,64.32812,63.75,64.125,869200,149.548986\n1996-03-18T14:30:00Z,64.71875,65.35937,64.57812,65.35937,917600,161.3861897\n1996-03-19T14:30:00Z,65.9375,66,65,65.21875,858500,160.2133308\n1996-03-20T14:30:00Z,65.53125,65.53125,64.64062,65.14062,744300,158.6835891\n1996-03-21T14:30:00Z,65.21875,65.25,64.76562,64.98437,650800,157.1892528\n1996-03-22T14:30:00Z,65.01562,65.32812,64.9375,65.15625,344500,158.0673471\n1996-03-25T14:30:00Z,65.75,65.8125,64.85937,65.03125,802400,156.2030175\n1996-03-26T14:30:00Z,64.92187,65.51562,64.85937,65.34375,969400,157.4479027\n1996-03-27T14:30:00Z,65.4375,65.48437,64.6875,64.75,809600,153.6659325\n1996-03-28T14:30:00Z,64.51562,65.03125,64.5,65,1001300,154.46672\n1996-03-29T14:30:00Z,65.1875,65.1875,64.375,64.6875,457700,152.6198396\n1996-04-01T14:30:00Z,65,65.45312,64.79687,65.4375,773400,157.4496998\n1996-04-02T14:30:00Z,65.51562,65.5625,65.29687,65.5625,638800,158.0539672\n1996-04-03T14:30:00Z,65.32812,65.60937,65.17187,65.5625,288000,158.754572\n1996-04-04T14:30:00Z,65.5625,65.71875,65.5,65.51562,934900,158.713287\n1996-04-08T13:30:00Z,63.875,64.39062,63.59375,64.39062,2217200,151.0134334\n1996-04-09T13:30:00Z,64.64062,64.64062,64.01562,64.14062,1180900,149.8597683\n1996-04-10T13:30:00Z,64.03125,64.3125,62.75,63,939500,140.6855648\n1996-04-11T13:30:00Z,63.15625,63.46875,62.125,62.92187,1276000,139.1382831\n1996-04-12T13:30:00Z,63.35937,63.8125,63.17187,63.71875,411300,145.3378651\n1996-04-15T13:30:00Z,64.04687,64.32812,63.84375,64.25,484200,149.6605146\n1996-04-16T13:30:00Z,64.375,64.65625,64.23437,64.4375,429700,151.1083973\n1996-04-17T13:30:00Z,64.375,64.5625,63.84375,64.28125,525300,150.1609239\n1996-04-18T13:30:00Z,64.4375,64.57812,64.09375,64.375,818600,150.3036513\n1996-04-19T13:30:00Z,64.6875,64.85937,64.42187,64.53125,885100,150.700678\n1996-04-22T13:30:00Z,65.125,65.28125,64.59375,65.03125,828900,153.2618893\n1996-04-23T13:30:00Z,64.92187,65.28125,64.78125,65.23437,225400,154.2646729\n1996-04-24T13:30:00Z,65.5625,65.5625,64.85937,65,699000,152.9521963\n1996-04-25T13:30:00Z,65.14062,65.5625,64.75,65.29687,475500,153.8166758\n1996-04-26T13:30:00Z,65.46875,65.8125,65.23437,65.4375,563300,154.6733587\n1996-04-29T13:30:00Z,65.15625,65.5625,65.15625,65.4375,219900,155.2371854\n1996-04-30T13:30:00Z,65.4375,65.5625,65.125,65.39062,184400,155.2371565\n1996-05-01T13:30:00Z,65.375,65.79687,65.28125,65.53125,561900,156.2339988\n1996-05-02T13:30:00Z,65.01562,65.375,64.09375,64.40625,1299600,147.2998319\n1996-05-03T13:30:00Z,64.78125,64.98437,63.75,64.3125,1329300,145.8787245\n1996-05-06T13:30:00Z,64.5625,64.5625,63.6875,64.25,647500,144.5561359\n1996-05-07T13:30:00Z,64.25,64.25,63.76562,63.98437,582100,141.9912589\n1996-05-08T13:30:00Z,63.67187,64.78125,63.07812,64.78125,1694700,146.1048992\n1996-05-09T13:30:00Z,64.5625,65.0625,64.5,64.73437,593400,146.7671308\n1996-05-10T13:30:00Z,65.375,65.59375,65.0625,65.375,925100,151.7404135\n1996-05-13T13:30:00Z,65.53125,66.64062,65.46875,66.35937,867500,160.8167635\n1996-05-14T13:30:00Z,66.625,66.9375,66.5625,66.76562,632300,164.4300495\n1996-05-15T13:30:00Z,66.78125,67.3125,66.64062,66.6875,466100,163.9957385\n1996-05-16T13:30:00Z,66.3125,66.9375,66.28125,66.82812,514400,165.3965725\n1996-05-17T13:30:00Z,67,67.29687,67,67.1875,427700,168.7288584\n1996-05-20T13:30:00Z,67.65625,67.75,66.98437,67.64062,788500,170.8584703\n1996-05-21T13:30:00Z,67.75,67.875,67.5,67.54687,352700,170.0882663\n1996-05-22T13:30:00Z,67.625,68.1875,67.39062,68.1875,1218100,174.2028992\n1996-05-23T13:30:00Z,68.28125,68.4375,67.53125,67.90625,967900,172.9173348\n1996-05-24T13:30:00Z,67.96875,68.32812,67.9375,68.17187,659100,174.3592481\n1996-05-28T13:30:00Z,68.375,68.375,67.3125,67.48437,456400,169.1389283\n1996-05-29T13:30:00Z,67.625,67.6875,66.8125,67.03125,649600,165.4179587\n1996-05-30T13:30:00Z,66.9375,67.71875,66.75,67.375,895800,167.0105068\n1996-05-31T13:30:00Z,67.35937,67.64062,66.875,66.875,923500,164.7504582\n1996-06-03T13:30:00Z,66.89062,67.10937,66.70312,67.0625,503100,165.1736376\n1996-06-04T13:30:00Z,67.375,67.59375,67.25,67.53125,627100,169.2497917\n1996-06-05T13:30:00Z,67.5625,68.20312,67.42187,68.125,428000,173.9288863\n1996-06-06T13:30:00Z,68.5,68.5,67.5,67.625,523300,171.1998623\n1996-06-07T13:30:00Z,66.1875,67.64062,66.1875,67.625,1422800,173.8867863\n1996-06-10T13:30:00Z,67.53125,67.73437,67.29687,67.40625,548800,174.0878463\n1996-06-11T13:30:00Z,67.65625,68.03125,67.34375,67.34375,688700,172.7291507\n1996-06-12T13:30:00Z,67.5625,67.73437,67.10937,67.21875,1120600,171.427084\n1996-06-13T13:30:00Z,67.375,67.46875,66.82812,67.21875,1502000,170.8757954\n1996-06-14T13:30:00Z,67.25,67.25,66.71875,66.9375,1468200,168.2644941\n1996-06-17T13:30:00Z,66.96875,67.21875,66.71875,66.89062,1101000,167.7656326\n1996-06-18T13:30:00Z,66.84375,67.03125,66.32812,66.34375,718000,163.7939791\n1996-06-19T13:30:00Z,66.65625,67,66.42187,66.64062,552100,164.7005958\n1996-06-20T13:30:00Z,66.70312,66.92187,66.1875,66.59375,1234400,164.2960463\n1996-06-21T13:30:00Z,66.5625,66.8125,66.375,66.8125,573300,165.2266591\n1996-06-24T13:30:00Z,66.96875,67.21875,66.84375,66.9375,416500,166.1897517\n1996-06-25T13:30:00Z,67.125,67.17187,66.78125,66.85937,454400,165.3855033\n1996-06-26T13:30:00Z,66.78125,66.92187,66.39062,66.40625,838200,161.9196895\n1996-06-27T13:30:00Z,66.40625,67.04687,66.15625,66.875,1090500,164.3982913\n1996-06-28T13:30:00Z,67.15625,67.5,66.96875,67.10937,1060800,166.2416481\n1996-07-01T13:30:00Z,67.28125,67.70312,67.1875,67.6875,471300,171.2834402\n1996-07-02T13:30:00Z,67.625,67.64062,67.32812,67.4375,389400,170.0400567\n1996-07-03T13:30:00Z,67.40625,67.5,67.0625,67.29687,308300,168.8681454\n1996-07-05T13:30:00Z,66.125,66.4375,65.375,65.57812,842900,152.9039833\n1996-07-08T13:30:00Z,65.625,65.98437,65.125,65.3125,942000,151.3158468\n1996-07-09T13:30:00Z,65.60937,65.8125,65.375,65.57812,739200,152.2979611\n1996-07-10T13:30:00Z,65.5625,65.84375,64.92187,65.84375,1132300,154.0557862\n1996-07-11T13:30:00Z,65.5625,65.6875,63.875,64.51562,1587400,142.8785728\n1996-07-12T13:30:00Z,64.625,64.90625,64.07812,64.5625,1312000,142.2611462\n1996-07-15T13:30:00Z,64.71875,64.71875,62.65625,62.65625,1951300,125.3306363\n1996-07-16T13:30:00Z,62.84375,63.5,60.375,62.8125,4141000,123.8620205\n1996-07-17T13:30:00Z,63.75,64,63,63.5625,1340500,128.2309256\n1996-07-18T13:30:00Z,63.75,64.54687,63.32812,64.4375,1432500,133.9275113\n1996-07-19T13:30:00Z,64.28125,64.375,63.625,63.96875,1216000,131.5133207\n1996-07-22T13:30:00Z,63.53125,63.75,63.01562,63.5,519800,127.8785226\n1996-07-23T13:30:00Z,63.59375,63.9375,62.57812,62.6875,1479800,122.5118837\n1996-07-24T13:30:00Z,61.9375,63.1875,61.625,62.8125,2463400,123.7588132\n1996-07-25T13:30:00Z,63.4375,63.5625,63.125,63.375,1989800,128.0857363\n1996-07-26T13:30:00Z,63.5625,63.8125,63.39062,63.71875,642300,130.5802399\n1996-07-29T13:30:00Z,63.625,63.71875,62.9375,63.01562,1297900,124.8138262\n1996-07-30T13:30:00Z,63.4375,63.6875,62.9375,63.625,1868200,127.3770186\n1996-07-31T13:30:00Z,63.67187,64.26562,63.51562,64.09375,767100,131.0276231\n1996-08-01T13:30:00Z,64.15625,65.39062,64.0625,65.15625,1168600,140.458232\n1996-08-02T13:30:00Z,66,66.59375,65.75,66.5625,1098500,152.9757882\n1996-08-05T13:30:00Z,66.57812,66.59375,65.96875,66.17187,710200,150.7794948\n1996-08-06T13:30:00Z,66.15625,66.51562,65.79687,66.375,640000,151.3821877\n1996-08-07T13:30:00Z,66.625,66.75,66.125,66.54687,917800,152.0287135\n1996-08-08T13:30:00Z,66.5625,66.5625,66.1875,66.4375,925100,150.9390644\n1996-08-09T13:30:00Z,66.67187,66.76562,66.0625,66.21875,648800,149.4181179\n1996-08-12T13:30:00Z,66.25,66.85937,66,66.70312,764200,151.8783203\n1996-08-13T13:30:00Z,66.57812,66.625,66,66.17187,805200,148.3671129\n1996-08-14T13:30:00Z,66.1875,66.46875,66,66.40625,533800,149.1550812\n1996-08-15T13:30:00Z,66.23437,66.625,66.20312,66.28125,632600,149.0206124\n1996-08-16T13:30:00Z,66.46875,66.875,66.46875,66.84375,475100,154.5445225\n1996-08-19T13:30:00Z,66.85937,66.92187,66.625,66.875,436400,155.009381\n1996-08-20T13:30:00Z,66.89062,66.90625,66.67187,66.82812,645700,154.6139339\n1996-08-21T13:30:00Z,66.65625,66.8125,66.375,66.59375,266400,152.8859552\n1996-08-22T13:30:00Z,66.75,67.34375,66.71875,67.21875,584800,158.5109552\n1996-08-23T13:30:00Z,67.09375,67.20312,66.64062,66.85937,757100,156.6221457\n1996-08-26T13:30:00Z,66.70312,66.78125,66.42187,66.53125,784700,153.7943484\n1996-08-27T13:30:00Z,66.71875,66.84375,66.5,66.78125,389400,154.9977992\n1996-08-28T13:30:00Z,66.9375,67,66.65625,66.67187,227600,154.1358482\n1996-08-29T13:30:00Z,66.59375,66.59375,65.625,66.01562,680200,147.9735606\n1996-08-30T13:30:00Z,66,66.01562,65.125,65.32812,1500900,141.6929663\n1996-09-03T13:30:00Z,64.46875,65.84375,64.375,65.75,1782000,144.9487126\n1996-09-04T13:30:00Z,65.75,66.75,65.48437,65.8125,930200,146.5804808\n1996-09-05T13:30:00Z,65.5,65.76562,65.01562,65.01562,616600,140.1205975\n1996-09-06T13:30:00Z,65.25,66.17187,65.14062,65.9375,804900,146.9289177\n1996-09-09T13:30:00Z,66.1875,66.73437,66.07812,66.71875,719200,153.6850082\n1996-09-10T13:30:00Z,66.625,66.90625,66.375,66.6875,669900,154.1146957\n1996-09-11T13:30:00Z,66.5625,67.125,66.40625,67.0625,713500,156.5000016\n1996-09-12T13:30:00Z,67.25,67.73437,67.15625,67.53125,713300,160.6117334\n1996-09-13T13:30:00Z,68.3125,68.625,68.125,68.5625,2008800,170.2805819\n1996-09-16T13:30:00Z,68.65625,69.15625,68.5625,68.8125,1220200,172.4894733\n1996-09-17T13:30:00Z,68.875,68.98437,68.23437,68.65625,604700,171.4519875\n1996-09-18T13:30:00Z,68.5625,68.75,68.21875,68.48437,225500,170.2123692\n1996-09-19T13:30:00Z,68.375,68.79687,68.28125,68.75,410000,171.7948529\n1996-09-20T13:30:00Z,68.59375,68.78125,68.375,68.64062,948400,171.8314389\n1996-09-23T13:30:00Z,68.46875,68.75,68.15625,68.625,466800,172.2025483\n1996-09-24T13:30:00Z,68.5625,69.25,68.3125,68.60937,1269800,172.3900183\n1996-09-25T13:30:00Z,68.9375,68.9375,68.5,68.65625,1353300,172.0155382\n1996-09-26T13:30:00Z,68.75,69.1875,68.39062,68.625,773200,171.3873746\n1996-09-27T13:30:00Z,68.71875,68.71875,68.375,68.6875,407600,171.4524787\n1996-09-30T13:30:00Z,68.78125,69.0625,68.57812,68.625,578200,170.7456407\n1996-10-01T13:30:00Z,68.70312,69.04687,68.4375,69,561400,172.7152398\n1996-10-02T13:30:00Z,69.25,69.59375,69.15625,69.46875,609000,176.8193884\n1996-10-03T13:30:00Z,69.5,69.53125,69.20312,69.40625,342200,176.5822219\n1996-10-04T13:30:00Z,69.6875,70.34375,69.5,70.34375,754100,184.5449622\n1996-10-07T13:30:00Z,70.3125,70.625,70.25,70.42187,235100,185.5130084\n1996-10-08T13:30:00Z,70.45312,70.6875,70.01562,70.14062,386200,184.0236177\n1996-10-09T13:30:00Z,70.25,70.375,69.51562,69.59375,528800,180.0523055\n1996-10-10T13:30:00Z,69.59375,69.85937,69.375,69.45312,1562200,179.0922066\n1996-10-11T13:30:00Z,69.71875,70.3125,69.71875,70.3125,331300,186.9973884\n1996-10-14T13:30:00Z,70.3125,70.6875,70.29687,70.40625,201600,188.2541702\n1996-10-15T13:30:00Z,71.125,71.125,69.95312,70.3125,776900,186.4631749\n1996-10-16T13:30:00Z,70.5,70.65625,69.9375,70.65625,590100,187.0193189\n1996-10-17T13:30:00Z,70.875,71.03125,70.54687,70.84375,792500,187.9638062\n1996-10-18T13:30:00Z,70.875,71.3125,70.71875,71.21875,695800,190.5891105\n1996-10-21T13:30:00Z,71.28125,71.625,70.9375,71.125,879200,190.3069925\n1996-10-22T13:30:00Z,71.0625,71.07812,70.59375,70.625,848900,185.705967\n1996-10-23T13:30:00Z,70.46875,70.89062,70.1875,70.85937,735900,186.7839231\n1996-10-24T13:30:00Z,70.85937,70.98437,70.21875,70.25,379300,182.9974547\n1996-10-25T13:30:00Z,70.23437,70.5625,70.125,70.3125,568300,182.8293169\n1996-10-28T14:30:00Z,70.375,70.73437,69.8125,69.84375,975400,180.4563863\n1996-10-29T14:30:00Z,70.0625,70.57812,69.70312,70.40625,815900,183.1960418\n1996-10-30T14:30:00Z,70.625,70.625,70.09375,70.17187,495400,182.0093092\n1996-10-31T14:30:00Z,70.26562,70.875,70.1875,70.84375,726300,186.616182\n1996-11-01T14:30:00Z,70.98437,71.15625,70.26562,70.59375,821300,185.5662956\n1996-11-04T14:30:00Z,70.6875,71.0625,70.53125,71.0625,1608400,188.1684514\n1996-11-05T14:30:00Z,71.29687,71.79687,71.28125,71.46875,764000,191.9101883\n1996-11-06T14:30:00Z,71.59375,72.875,71.53125,72.84375,1665000,204.5732144\n1996-11-07T14:30:00Z,72.625,73.29687,72.53125,73.01562,1446300,206.3585943\n1996-11-08T14:30:00Z,73.03125,73.4375,72.75,73.42187,1355700,208.7067359\n1996-11-11T14:30:00Z,73.25,73.51562,73.21875,73.34375,655900,208.9204296\n1996-11-12T14:30:00Z,73.54687,73.59375,73.01562,73.125,719900,207.5354853\n1996-11-13T14:30:00Z,73.20312,73.5625,73.01562,73.45312,481900,208.992703\n1996-11-14T14:30:00Z,73.1875,73.9375,73.15625,73.9375,558800,212.3004084\n1996-11-15T14:30:00Z,74.125,74.5,73.71875,74.03125,2250900,213.1509629\n1996-11-18T14:30:00Z,74.17187,74.25,73.73437,74.04687,1518200,212.9089262\n1996-11-19T14:30:00Z,74.14062,74.59375,74.03125,74.57812,1029300,217.0465051\n1996-11-20T14:30:00Z,74.5625,75.01562,74.3125,74.70312,730000,218.0718936\n1996-11-21T14:30:00Z,74.79687,74.84375,74.375,74.59375,653000,217.3565394\n1996-11-22T14:30:00Z,74.70312,75.25,74.70312,75.17187,965100,222.1457562\n1996-11-25T14:30:00Z,75.25,76.15625,75.07812,76.125,2058800,229.9065886\n1996-11-26T14:30:00Z,76.28125,76.6875,75.46875,75.875,2861800,229.2378556\n1996-11-27T14:30:00Z,76.0625,76.1875,75.64062,75.73437,872000,228.0141978\n1996-11-29T14:30:00Z,76,76.21875,75.85937,76.01562,1073400,229.2579651\n1996-12-02T14:30:00Z,75.92187,76.125,75.39062,76.04687,1350600,229.7746556\n1996-12-03T14:30:00Z,76.0625,76.57812,74.75,74.75,1777800,221.3967657\n1996-12-04T14:30:00Z,74.875,75.0625,74.09375,74.95312,2365100,221.1249517\n1996-12-05T14:30:00Z,74.84375,75.14062,74.53125,74.75,1697700,220.1587183\n1996-12-06T14:30:00Z,73.25,74.75,72.65625,74.3125,3401800,220.5933066\n1996-12-09T14:30:00Z,74.6875,75.42187,74.57812,75.40625,1864600,230.1869344\n1996-12-10T14:30:00Z,75.5625,75.67187,74.96875,75.04687,1331600,228.831815\n1996-12-11T14:30:00Z,73.625,74.625,73.3125,74.35937,1847900,225.8847942\n1996-12-12T14:30:00Z,74.78125,74.875,72.9375,73.125,2540200,218.012804\n1996-12-13T14:30:00Z,73.0625,73.57812,72.40625,73.3125,1678300,217.7251261\n1996-12-16T14:30:00Z,73.5,73.6875,72.0625,72.375,1831100,211.0700335\n1996-12-17T14:30:00Z,72.15625,73.28125,71.875,72.95312,2023200,213.4038119\n1996-12-18T14:30:00Z,73.375,73.76562,73.26562,73.53125,1666800,218.4819665\n1996-12-19T14:30:00Z,74.1875,75.125,73.89062,75.04687,2269300,232.0844623\n1996-12-20T14:30:00Z,75.125,75.71875,74.75,74.84375,1543200,231.6271311\n1996-12-23T14:30:00Z,75.09375,75.20312,74.32812,74.65625,1263700,230.0024704\n1996-12-24T14:30:00Z,74.84375,75.20312,74.79687,75.20312,633000,233.6026695\n1996-12-26T14:30:00Z,75.4375,75.82812,75.375,75.78125,1384300,238.8191447\n1996-12-27T14:30:00Z,75.78125,76.03125,75.5,75.875,410400,239.4644177\n1996-12-30T14:30:00Z,76.125,76.125,75.15625,75.21875,694100,234.5477715\n1996-12-31T14:30:00Z,75.28125,75.375,73.84375,73.84375,1378100,223.2040215\n1997-01-02T14:30:00Z,74.375,74.375,72.75,74.03125,2031900,222.0198434\n1997-01-03T14:30:00Z,74.375,75.125,74.07812,75.09375,2123200,229.9181054\n1997-01-06T14:30:00Z,75.09375,75.4375,74.3125,74.4375,1374100,226.9065504\n1997-01-07T14:30:00Z,74.4375,75.46875,74.125,75.34375,939000,232.0160468\n1997-01-08T14:30:00Z,75.75,75.78125,74.6875,74.6875,1802200,229.030886\n1997-01-09T14:30:00Z,75.0625,75.875,74.9375,75.3125,1415700,231.7376874\n1997-01-10T14:30:00Z,74.25,76.25,74.25,76.125,2369500,237.5733882\n1997-01-13T14:30:00Z,76.5,76.5,75.64062,76.01562,1364600,237.8404914\n1997-01-14T14:30:00Z,76.6875,77.39062,76.5,76.96875,2111200,244.5067037\n1997-01-15T14:30:00Z,76.71875,77.20312,76.375,76.78125,1583900,244.1517425\n1997-01-16T14:30:00Z,77.03125,77.29687,76.5,77.09375,1308400,245.5771431\n1997-01-17T14:30:00Z,77.20312,77.75,77.10937,77.5625,1604000,249.6787056\n1997-01-20T14:30:00Z,77.75,78.09375,77.46875,77.65625,1889900,250.3137427\n1997-01-21T14:30:00Z,77.375,78.54687,77.10937,78.28125,2785800,254.3322487\n1997-01-22T14:30:00Z,78.3125,78.84375,77.875,78.84375,1201600,257.4342708\n1997-01-23T14:30:00Z,79.0625,79.6875,76.90625,77.75,2601100,250.7140546\n1997-01-24T14:30:00Z,77.875,77.90625,76.75,76.75,2176000,242.7535283\n1997-01-27T14:30:00Z,76.875,77.23437,76.375,76.53125,2108500,240.970309\n1997-01-28T14:30:00Z,77.625,77.84375,76,76.75,4376000,239.6750788\n1997-01-29T14:30:00Z,76.875,77.5,76.59375,77.5,1122700,243.1907038\n1997-01-30T14:30:00Z,77.875,78.53125,77.40625,78.5,2126300,250.5792327\n1997-01-31T14:30:00Z,78.9375,79.40625,78.375,78.40625,3208100,249.6103799\n1997-02-03T14:30:00Z,78.71875,78.89062,78.35937,78.64062,755000,249.8952693\n1997-02-04T14:30:00Z,78.75,79.20312,78.4375,79.125,654100,252.8162422\n1997-02-05T14:30:00Z,79.23437,79.46875,77.125,77.64062,2255400,241.5982678\n1997-02-06T14:30:00Z,77.78125,78.20312,77.40625,78.15625,2483100,242.494426\n1997-02-07T14:30:00Z,78.8125,79.25,77.78125,79.21875,2321000,248.4416916\n1997-02-10T14:30:00Z,79.25,79.53125,78.42187,78.46875,1670000,244.1681189\n1997-02-11T14:30:00Z,78.78125,79.375,78.125,79.375,1664300,248.1176544\n1997-02-12T14:30:00Z,79.375,80.64062,79.26562,80.5,2675400,257.6503691\n1997-02-13T14:30:00Z,80.8125,81.5625,80.6875,81.375,1104800,265.2870879\n1997-02-14T14:30:00Z,81.1875,81.46875,80.90625,81.1875,1112900,265.0917754\n1997-02-18T14:30:00Z,81.34375,81.9375,80.75,81.875,833100,268.8541109\n1997-02-19T14:30:00Z,81.65625,82,81.15625,81.32812,648100,266.1947014\n1997-02-20T14:30:00Z,81.03125,81.35937,80.15625,80.34375,1193900,258.1581289\n1997-02-21T14:30:00Z,80.40625,80.76562,80.14062,80.375,1844400,257.6411313\n1997-02-24T14:30:00Z,79.96875,81.375,79.96875,81.32812,787300,264.8234186\n1997-02-25T14:30:00Z,81.40625,81.53125,80.875,81.39062,1653900,265.9451035\n1997-02-26T14:30:00Z,81.3125,81.4375,79.625,80.59375,1597800,258.89689\n1997-02-27T14:30:00Z,80.8125,80.8125,79.375,79.39062,1813100,249.0349887\n1997-02-28T14:30:00Z,79.25,79.875,79.0625,79.15625,2961200,247.3846252\n1997-03-03T14:30:00Z,78.75,79.75,78.6875,79.6875,1210400,250.7217992\n1997-03-04T14:30:00Z,79.90625,80.125,79.09375,79.25,1478700,249.1641217\n1997-03-05T14:30:00Z,79.71875,80.59375,79.45312,80.59375,1254800,258.8223077\n1997-03-06T14:30:00Z,80.625,80.90625,79.875,80.125,1528500,257.0254327\n1997-03-07T14:30:00Z,80.4375,81.15625,80.25,80.84375,1859300,261.7213032\n1997-03-10T14:30:00Z,80.9375,81.6875,80.54687,81.6875,1074900,267.3263809\n1997-03-11T14:30:00Z,81.75,81.79687,81.25,81.25,624600,265.4646661\n1997-03-12T14:30:00Z,81.3125,81.34375,80.29687,80.53125,1055600,259.1899204\n1997-03-13T14:30:00Z,80.25,80.46875,79.0625,79.28125,2514100,248.3411988\n1997-03-14T14:30:00Z,79.64062,80.03125,79.25,79.6875,1642700,249.1999888\n1997-03-17T14:30:00Z,79.25,80.03125,78.4375,79.90625,3013500,251.9182106\n1997-03-18T14:30:00Z,80,80.10937,78.71875,79.04687,1352500,246.3237786\n1997-03-19T14:30:00Z,78.84375,79.5,78.0625,78.78125,1510000,244.3590694\n1997-03-20T14:30:00Z,78.75,79,77.875,78.375,1808200,241.3330634\n1997-03-21T14:30:00Z,78.6875,78.75,78.34375,78.4375,2810600,240.6006415\n1997-03-24T14:30:00Z,78.5,79.57812,78.09375,79.53125,2145600,247.7295395\n1997-03-25T14:30:00Z,79.34375,79.96875,78.53125,78.75,2125800,244.705346\n1997-03-26T14:30:00Z,79.0625,79.65625,78.6875,79.09375,1335300,245.7747844\n1997-03-27T14:30:00Z,79.375,79.375,76.15625,77,2898500,227.1486872\n1997-03-31T14:30:00Z,75.6875,75.6875,75.6875,75.6875,4270699,214.6389216\n1997-04-01T14:30:00Z,75.25,76.1875,75.04687,75.85937,3210900,216.3117659\n1997-04-02T14:30:00Z,75.625,75.9375,74.4375,74.5,2672700,206.7948299\n1997-04-03T14:30:00Z,74.4375,75.125,74.1875,74.90625,2284200,207.9466728\n1997-04-04T14:30:00Z,74.5,75.85937,74.15625,75.84375,3706700,213.5968901\n1997-04-07T13:30:00Z,76.1875,76.625,76.14062,76.14062,2596200,216.6682909\n1997-04-08T13:30:00Z,76.125,76.78125,75.84375,76.6875,1822700,220.112018\n1997-04-09T13:30:00Z,77,77.04687,75.84375,76.0625,2453200,216.3715426\n1997-04-10T13:30:00Z,76.09375,76.54687,75.6875,75.78125,1996500,214.5118992\n1997-04-11T13:30:00Z,75.0625,75.3125,73.375,73.375,4221602,192.2666193\n1997-04-14T13:30:00Z,73.73437,74.45312,73.3125,74.35937,3988500,196.0400298\n1997-04-15T13:30:00Z,75.25,75.64062,74.5,75.625,2760400,205.4664156\n1997-04-16T13:30:00Z,75.375,76.60937,75.25,76.5,2273300,211.9495199\n1997-04-17T13:30:00Z,76.5,77,76,76.1875,1386000,211.4922028\n1997-04-18T13:30:00Z,76.8125,76.98437,76.25,76.5625,1702100,212.5067424\n1997-04-21T13:30:00Z,76.75,76.90625,75.46875,76.0625,2809400,208.3766968\n1997-04-22T13:30:00Z,76.10937,77.73437,76,77.73437,3215000,221.0527662\n1997-04-23T13:30:00Z,77.65625,78.03125,77.1875,77.8125,2047700,222.5908518\n1997-04-24T13:30:00Z,78.04687,78.28125,76.875,77.42187,2689900,219.8986862\n1997-04-25T13:30:00Z,77.0625,77.20312,76.42187,76.53125,1606200,212.0628952\n1997-04-28T13:30:00Z,76.5,77.8125,76.375,77.28125,1666500,217.2022375\n1997-04-29T13:30:00Z,78.59375,79.78125,78.29687,79.71875,3197400,240.0258722\n1997-04-30T13:30:00Z,79.25,80.6875,79.21875,80.09375,3372200,243.7559921\n1997-05-01T13:30:00Z,80.21875,80.53125,79.3125,80,2149500,243.7826742\n1997-05-02T13:30:00Z,80.28125,81.67187,80.0625,81.4375,1448300,255.8690972\n1997-05-05T13:30:00Z,81.65625,83.5625,81.29687,83.375,3636200,271.912166\n1997-05-06T13:30:00Z,82.96875,83.46875,82.5,83.3125,1721100,274.0202316\n1997-05-07T13:30:00Z,83,83,81.40625,81.5,2327200,257.9489218\n1997-05-08T13:30:00Z,81.3125,83.21875,81.1875,82.0625,2923700,260.4600825\n1997-05-09T13:30:00Z,82.96875,83.125,81.65625,82.625,2558200,262.7780365\n1997-05-12T13:30:00Z,82.9375,84.25,82.875,84,2357900,274.4352101\n1997-05-13T13:30:00Z,83.9375,84.09375,83.01562,83.65625,1195100,273.4336644\n1997-05-14T13:30:00Z,84.23437,84.5,83.4375,83.8125,2772000,272.8517795\n1997-05-15T13:30:00Z,83.8125,84.59375,83.51562,84.375,884100,275.8974898\n1997-05-16T13:30:00Z,84.125,84.3125,83,83.21875,1934200,267.3942003\n1997-05-19T13:30:00Z,83.3125,83.90625,83.0625,83.46875,1375800,267.8019329\n1997-05-20T13:30:00Z,83.28125,84.6875,82.75,84.46875,1756400,274.0943922\n1997-05-21T13:30:00Z,84.6875,84.98437,83.65625,84.28125,1208000,273.8014225\n1997-05-22T13:30:00Z,84.375,84.46875,83.5625,84,907600,271.2593319\n1997-05-23T13:30:00Z,84.375,85.21875,84.15625,84.78125,644400,276.7552773\n1997-05-27T13:30:00Z,84.375,85.53125,84.26562,85.125,1531000,279.5677671\n1997-05-28T13:30:00Z,85.125,85.45312,84.51562,85.10937,716700,280.1231661\n1997-05-29T13:30:00Z,85.09375,85.25,84.5,84.60937,1282700,276.3540579\n1997-05-30T13:30:00Z,83.21875,85.5625,83.125,85.15625,2143300,281.4105585\n1997-06-02T13:30:00Z,85.34375,85.5,84.71875,84.78125,1479100,281.0392236\n1997-06-03T13:30:00Z,84.40625,85.4375,84.34375,84.5,1562100,279.7931793\n1997-06-04T13:30:00Z,84.53125,84.75,84.07812,84.40625,1063100,279.289534\n1997-06-05T13:30:00Z,84.59375,85.3125,84.42187,84.71875,1180800,281.3838036\n1997-06-06T13:30:00Z,84.59375,86.4375,84.59375,86.375,1511100,296.1543114\n1997-06-09T13:30:00Z,86.4375,86.875,86.34375,86.8125,1823400,299.5793114\n1997-06-10T13:30:00Z,86.84375,87.40625,86.5,87.07812,1217500,301.3477772\n1997-06-11T13:30:00Z,87,87.40625,86.82812,87.28125,1673800,302.6436939\n1997-06-12T13:30:00Z,87.875,89,87.5625,88.96875,4273301,317.662392\n1997-06-13T13:30:00Z,89.0625,90,88.90625,89.71875,2132900,324.0340438\n1997-06-16T13:30:00Z,89.75,90,89.46875,89.75,800400,324.5278114\n1997-06-17T13:30:00Z,89.4375,90.23437,88.9375,89.625,2048100,324.4054464\n1997-06-18T13:30:00Z,89.125,89.625,88.96875,89.3125,1971900,323.4028423\n1997-06-19T13:30:00Z,89.60937,90.5,89.375,90.23437,2029900,331.3066264\n1997-06-20T13:30:00Z,89.9375,90.34375,89.5,89.57812,1396900,328.1869767\n1997-06-23T13:30:00Z,89.40625,89.90625,87.34375,87.40625,3991500,311.0137815\n1997-06-24T13:30:00Z,88.25,89.875,88,89.625,4895102,324.9095235\n1997-06-25T13:30:00Z,89.48437,90.25,87.9375,89,4708898,322.8311786\n1997-06-26T13:30:00Z,88.84375,89.625,87.6875,88.5625,2569900,320.0449212\n1997-06-27T13:30:00Z,88.96875,89.71875,88.6875,88.90625,2617900,321.5484342\n1997-06-30T13:30:00Z,88.90625,89.46875,87.875,88.3125,2384900,317.919035\n1997-07-01T13:30:00Z,88.5,89.5625,88.39062,89.34375,1749000,325.4172252\n1997-07-02T13:30:00Z,89.5625,90.8125,89.21875,90.8125,1961800,337.1402027\n1997-07-03T13:30:00Z,91.875,92.15625,91.46875,92.0625,2539100,347.6135483\n1997-07-07T13:30:00Z,92.375,92.5,90.90625,91.125,1158600,340.9375811\n1997-07-08T13:30:00Z,91.25,92.1875,91.1875,92.07812,3396500,346.1496625\n1997-07-09T13:30:00Z,92.3125,92.375,90.03125,91.0625,5390301,338.9597726\n1997-07-10T13:30:00Z,91.125,91.84375,90.48437,91.46875,2072200,339.7355442\n1997-07-11T13:30:00Z,91.59375,92.1875,91.375,91.78125,2260400,342.1964817\n1997-07-14T13:30:00Z,91.89062,92.3125,91.21875,92.0625,3186400,343.4727095\n1997-07-15T13:30:00Z,92.3125,92.76562,91.46875,92.53125,2983100,345.5098199\n1997-07-16T13:30:00Z,93.125,94.09375,92.89062,93.75,2621300,356.283833\n1997-07-17T13:30:00Z,93.625,93.8125,92.78125,93.28125,1794800,353.8141579\n1997-07-18T13:30:00Z,93.01562,93.21875,91.0625,91.29687,3961900,335.9440404\n1997-07-21T13:30:00Z,91.28125,91.59375,90.6875,91.3125,3810300,334.8081676\n1997-07-22T13:30:00Z,91.6875,93.79687,91.625,93.73437,4243398,357.7615854\n1997-07-23T13:30:00Z,93.9375,94.48437,93.53125,93.65625,3204300,358.6991014\n1997-07-24T13:30:00Z,93.9375,94.26562,92.6875,94.09375,4152699,360.3347328\n1997-07-25T13:30:00Z,94.5625,94.8125,93.625,94.03125,2364800,359.2760644\n1997-07-28T13:30:00Z,94.25,94.5625,93.5,93.96875,2794700,358.3429047\n1997-07-29T13:30:00Z,93.625,94.46875,93.42187,94.28125,2737100,360.08775\n1997-07-30T13:30:00Z,94.5,95.625,94.40625,95.40625,4839801,370.211272\n1997-07-31T13:30:00Z,95.40625,96.03125,95.03125,95.3125,2138700,370.4849583\n1997-08-01T13:30:00Z,95.5,95.71875,93.8125,94.9375,7077699,367.1828328\n1997-08-04T13:30:00Z,94.78125,95.54687,94.40625,95.1875,2339500,368.1117541\n1997-08-05T13:30:00Z,95.09375,95.6875,94.90625,95.25,1467000,368.969055\n1997-08-06T13:30:00Z,95.4375,96.53125,95.0625,96.03125,2478200,374.9023046\n1997-08-07T13:30:00Z,96.5,96.625,95.125,95.3125,3641900,370.9025638\n1997-08-08T13:30:00Z,94.3125,94.75,92.40625,93.375,7167602,354.0983777\n1997-08-11T13:30:00Z,93.75,94.28125,92.625,94.0625,6355898,355.9239846\n1997-08-12T13:30:00Z,94.21875,94.54687,92.46875,92.5625,6160801,345.5299387\n1997-08-13T13:30:00Z,93.6875,93.84375,91.46875,92.28125,6982301,341.5148171\n1997-08-14T13:30:00Z,93.09375,93.3125,91.71875,92.625,3462700,340.7123886\n1997-08-15T13:30:00Z,92.125,92.125,89.625,89.78125,4907102,313.6858218\n1997-08-18T13:30:00Z,90.375,91.78125,89.34375,91.78125,5638898,322.4390518\n1997-08-19T13:30:00Z,92.21875,92.90625,91.53125,92.84375,3802800,329.4703018\n1997-08-20T13:30:00Z,92.9375,94.3125,92.60937,94.25,3558200,340.4241852\n1997-08-21T13:30:00Z,94.125,94.25,92.09375,92.59375,5392602,329.0665791\n1997-08-22T13:30:00Z,91,92.73437,90.5625,92.5625,7172898,330.8912911\n1997-08-25T13:30:00Z,92.78125,93.40625,91.84375,92.21875,3888000,330.2584786\n1997-08-26T13:30:00Z,92,92.5625,90.70312,90.85937,4290000,320.452756\n1997-08-27T13:30:00Z,91,91.96875,90.40625,91.40625,5484301,322.1971692\n1997-08-28T13:30:00Z,91.1875,91.9375,90,90.01562,4287898,314.1152404\n1997-08-29T13:30:00Z,90.125,91.10937,89.71875,90.375,2652300,314.8924289\n1997-09-02T13:30:00Z,90.6875,93.35937,90.59375,93.3125,7294000,342.2756576\n1997-09-03T13:30:00Z,93.29687,94,92.75,92.8125,2812500,342.0819517\n1997-09-04T13:30:00Z,93.0625,93.71875,92.75,93.40625,2473700,345.4316764\n1997-09-05T13:30:00Z,93.96875,94.4375,92.59375,93.14062,3663300,343.4484783\n1997-09-08T13:30:00Z,93.71875,94,93.3125,93.54687,803500,344.0690236\n1997-09-09T13:30:00Z,93.21875,94.28125,92.90625,93.59375,1885200,344.6886051\n1997-09-10T13:30:00Z,93.125,93.5,91.65625,91.65625,3623700,328.9559525\n1997-09-11T13:30:00Z,91.78125,91.90625,90.25,91.1875,7055898,324.0354349\n1997-09-12T13:30:00Z,92,92.96875,90.9375,92.65625,6708000,332.4548738\n1997-09-15T13:30:00Z,92.65625,93.3125,92.1875,92.5,2060500,332.2311522\n1997-09-16T13:30:00Z,93.3125,95.28125,93.03125,94.8125,6979000,352.8034716\n1997-09-17T13:30:00Z,95.375,95.5,94.5,94.8125,2220000,353.0964403\n1997-09-18T13:30:00Z,95,96.375,94.96875,95.21875,5045398,355.3500461\n1997-09-19T13:30:00Z,94.65625,95.35937,94.40625,95.03125,1566400,355.6256046\n1997-09-22T13:30:00Z,95.5,96.20312,95.21875,95.5625,3259000,359.7271671\n1997-09-23T13:30:00Z,95.5625,95.70312,94.75,95.125,1872800,356.3690349\n1997-09-24T13:30:00Z,95.375,96.10937,94.28125,94.34375,2793100,351.9036352\n1997-09-25T13:30:00Z,94.25,94.75,93.625,93.6875,6327801,348.0205579\n1997-09-26T13:30:00Z,94.4375,94.8125,94.1875,94.46875,3995800,352.5638271\n1997-09-29T13:30:00Z,94.5,95.5625,94.15625,95.375,2065000,359.0976238\n1997-09-30T13:30:00Z,95,95.6875,94.375,94.375,4137602,354.633338\n1997-10-01T13:30:00Z,95.25,95.8125,94.78125,95.625,3567500,362.9110768\n1997-10-02T13:30:00Z,95.53125,96.1875,95.3125,96.15625,2577500,366.3132945\n1997-10-03T13:30:00Z,97.46875,97.75,95.34375,96.64062,6499898,367.193958\n1997-10-06T13:30:00Z,97.3125,97.60937,96.90625,97.28125,2272100,369.6203931\n1997-10-07T13:30:00Z,97.53125,98.5,97.20312,98.1875,1832800,376.7814341\n1997-10-08T13:30:00Z,98.35937,98.375,96.73437,97.5,4439398,371.9848729\n1997-10-09T13:30:00Z,96.78125,97.60937,96.21875,97.15625,3607800,370.1339177\n1997-10-10T13:30:00Z,96.3125,96.98437,96.25,96.875,2858100,370.7148487\n1997-10-13T13:30:00Z,97.34375,97.54687,96.71875,96.96875,1760300,370.9180363\n1997-10-14T13:30:00Z,97.46875,97.5,96.1875,97,2235700,369.8872203\n1997-10-15T13:30:00Z,96.3125,97.0625,96.28125,96.78125,2601700,369.3794078\n1997-10-16T13:30:00Z,97.3125,97.5,95,95.25,9488102,358.9777054\n1997-10-17T13:30:00Z,95.01562,95.375,93,94.28125,8151301,349.9701162\n1997-10-20T13:30:00Z,94.84375,95.75,94.15625,95.625,3636400,357.9796578\n1997-10-21T13:30:00Z,96.21875,97.5,96.03125,97.48437,5225398,374.8467656\n1997-10-22T13:30:00Z,97.34375,97.39062,96.53125,96.84375,4485199,372.049073\n1997-10-23T13:30:00Z,94.9375,95.75,94.28125,94.9375,8054102,356.8517646\n1997-10-24T13:30:00Z,96.15625,96.15625,93.67187,94,6778699,350.4340783\n1997-10-27T14:30:00Z,93.01562,93.9375,86.84375,87.1875,10840699,290.5251192\n1997-10-28T14:30:00Z,84.375,92.875,84.375,92.21875,19548000,317.2863876\n1997-10-29T14:30:00Z,92.5,93.75,91.28125,91.96875,10184199,320.4089763\n1997-10-30T14:30:00Z,90.625,92.5625,89.75,89.9375,9772898,308.6016363\n1997-10-31T14:30:00Z,91.8125,92.5,90.4375,92.0625,7072699,321.9983541\n1997-11-03T14:30:00Z,93.1875,94.375,92.875,94,5548500,339.6632846\n1997-11-04T14:30:00Z,93.875,94.4375,93.28125,94,3455700,340.5410684\n1997-11-05T14:30:00Z,94.1875,95.28125,93.84375,94.3125,4774898,342.7559953\n1997-11-06T14:30:00Z,94.03125,94.34375,93.5,93.95312,3679800,340.6249528\n1997-11-07T14:30:00Z,92.375,93.25,91.4375,92.9375,10606801,335.1965928\n1997-11-10T14:30:00Z,93.625,93.84375,92,92.375,4347898,332.1054265\n1997-11-11T14:30:00Z,92.6875,93.0625,92.03125,92.40625,3212400,330.7564076\n1997-11-12T14:30:00Z,91.625,92.71875,90.375,90.5,6775301,317.4037326\n1997-11-13T14:30:00Z,91.46875,92.15625,90.09375,91.8125,8589602,322.7175347\n1997-11-14T14:30:00Z,92.3125,93.39062,91.60937,93.0625,5827898,331.7554081\n1997-11-17T14:30:00Z,94.375,95.3125,94.03125,94.78125,5149898,346.9429081\n1997-11-18T14:30:00Z,94.8125,95.09375,93.89062,94.1875,3433600,343.5097293\n1997-11-19T14:30:00Z,93.6875,95.0625,93.6875,94.65625,4387801,346.3557114\n1997-11-20T14:30:00Z,95.3125,96.53125,95.28125,96.09375,4822699,359.7992991\n1997-11-21T14:30:00Z,96.625,96.8125,95.65625,96.75,5436500,362.8373681\n1997-11-24T14:30:00Z,96,96.34375,94.625,95,4337199,347.7498681\n1997-11-25T14:30:00Z,95.625,95.8125,94.65625,95.25,4525000,347.0727848\n1997-11-26T14:30:00Z,95.875,95.98437,95.3125,95.53125,2681100,347.1627816\n1997-11-28T14:30:00Z,95.75,96.25,95.59375,95.625,1564700,346.8451522\n1997-12-01T14:30:00Z,96.21875,98.09375,96.03125,98.09375,4850898,369.5173461\n1997-12-02T14:30:00Z,97.6875,97.98437,97.25,97.5,1974900,368.6002247\n1997-12-03T14:30:00Z,97.625,98.53125,96.875,97.78125,3302500,369.7828509\n1997-12-04T14:30:00Z,98.5,98.71875,97.375,97.6875,2872500,367.8297259\n1997-12-05T14:30:00Z,97.375,99,97.125,98.9375,3458800,375.0460088\n1997-12-08T14:30:00Z,98.96875,99,98.25,98.65625,2289200,374.8694249\n1997-12-09T14:30:00Z,98.21875,98.59375,97.625,98.0625,1703000,370.3857292\n1997-12-10T14:30:00Z,97.5625,97.84375,96.46875,97.21875,3558400,363.4896955\n1997-12-11T14:30:00Z,96.3125,96.59375,95.3125,95.5625,5072801,348.4724354\n1997-12-12T14:30:00Z,96.4375,96.5,94.90625,95.75,4478398,347.3416788\n1997-12-15T14:30:00Z,96.25,97.10937,95.875,96.71875,4674699,353.3070196\n1997-12-16T14:30:00Z,97.21875,97.8125,96.875,97.3125,2885800,357.880026\n1997-12-17T14:30:00Z,97.84375,97.875,96.70312,96.8125,2236300,354.7186316\n1997-12-18T14:30:00Z,96.9375,96.9375,95.21875,95.875,4658301,346.0175755\n1997-12-19T14:30:00Z,94.53125,95.875,92.375,94.78125,8556000,338.8469324\n1997-12-22T14:30:00Z,95.4375,95.90625,94.5625,95.39062,5136801,342.0890824\n1997-12-23T14:30:00Z,95.4375,95.625,93.53125,93.6875,4436500,327.7945579\n1997-12-24T14:30:00Z,94.4375,94.4375,93.25,93.40625,2019200,324.2338607\n1997-12-26T14:30:00Z,94.125,94.125,93.40625,93.78125,941800,323.9822982\n1997-12-29T14:30:00Z,94.59375,95.71875,94.4375,95.625,2080000,340.2211375\n1997-12-30T14:30:00Z,95.9375,97.25,95.84375,97.125,3616000,353.6882355\n1997-12-31T14:30:00Z,96.875,97.625,96.6875,97.0625,4359500,354.5189317\n1998-01-02T14:30:00Z,97.3125,97.65625,96.53125,97.5625,2360900,356.6465359\n1998-01-05T14:30:00Z,97.84375,98.4375,96.78125,97.78125,4191801,357.4419905\n1998-01-06T14:30:00Z,97.25,97.28125,96.1875,96.21875,3154900,342.0998568\n1998-01-07T14:30:00Z,96.09375,96.71875,95.21875,96.46875,4424199,342.7387457\n1998-01-08T14:30:00Z,96.3125,96.3125,95.375,95.625,3831000,335.999089\n1998-01-09T14:30:00Z,95.25,95.5,91.90625,92.3125,10258801,305.9265444\n1998-01-12T14:30:00Z,91.125,94.1875,90.90625,94,12097898,312.9030765\n1998-01-13T14:30:00Z,94.625,95.375,94.21875,95.3125,5224898,323.1885096\n1998-01-14T14:30:00Z,95.6875,95.96875,94.71875,95.75,3770400,325.0364663\n1998-01-15T14:30:00Z,95.5,95.75,94.8125,94.95312,2875400,318.5526856\n1998-01-16T14:30:00Z,96.25,96.6875,95.65625,96.3125,4374801,327.4976771\n1998-01-20T14:30:00Z,96.6875,98.01562,96.5,97.875,5091699,341.7245045\n1998-01-21T14:30:00Z,97.21875,97.6875,96.15625,96.9375,4699398,337.3577616\n1998-01-22T14:30:00Z,96.15625,96.875,95.875,96.07812,4543398,331.5177341\n1998-01-23T14:30:00Z,96.5,96.78125,95,95.9375,6350301,329.8660741\n1998-01-26T14:30:00Z,96.375,96.73437,95.40625,95.875,4362898,328.329551\n1998-01-27T14:30:00Z,95.8125,97.5,95.65625,96.84375,7044199,335.3421998\n1998-01-28T14:30:00Z,97.40625,98.10937,97.1875,97.71875,4268602,342.8865665\n1998-01-29T14:30:00Z,97.84375,99.5625,97.5625,98.25,8007699,347.3919707\n1998-01-30T14:30:00Z,98.78125,98.96875,98,98.3125,3649100,347.0968635\n1998-02-02T14:30:00Z,99.90625,100.5,99.75,99.9375,5756301,360.2299454\n1998-02-03T14:30:00Z,100,100.8125,99.71875,100.6875,2763000,365.6986954\n1998-02-04T14:30:00Z,100.28125,101.15625,99.9375,100.5625,3374000,366.3307178\n1998-02-05T14:30:00Z,101.3125,101.59375,100.03125,100.5,5076199,364.7579382\n1998-02-06T14:30:00Z,101,101.625,100.6875,101.625,5701199,371.7891882\n1998-02-09T14:30:00Z,101.71875,101.75,100.71875,101.28125,2322200,369.8514826\n1998-02-10T14:30:00Z,101.4375,102.46875,101.1875,102.25,3660400,376.6062228\n1998-02-11T14:30:00Z,102.09375,102.34375,101.70312,102.15625,4073200,377.1758861\n1998-02-12T14:30:00Z,101.71875,102.9375,100.875,102.59375,5024699,380.6078057\n1998-02-13T14:30:00Z,102.1875,102.51562,101.875,102,2101300,378.2640492\n1998-02-17T14:30:00Z,102.8125,103.09375,102.15625,102.5,3055500,380.1740906\n1998-02-18T14:30:00Z,102.3125,103.48437,102.28125,103.4375,3007400,387.0016835\n1998-02-19T14:30:00Z,103.25,103.40625,102.75,102.89062,3387800,384.9940934\n1998-02-20T14:30:00Z,103.07812,103.71875,102.375,103.65625,3707000,388.4775616\n1998-02-23T14:30:00Z,104.25,104.25,103.34375,104.0625,3227800,390.091615\n1998-02-24T14:30:00Z,103.90625,104.09375,102.9375,103.25,3386800,383.15168\n1998-02-25T14:30:00Z,103.75,104.875,103.625,104.53125,3481800,392.7134178\n1998-02-26T14:30:00Z,104.4375,105.21875,104.1875,105.125,3187600,396.6818692\n1998-02-27T14:30:00Z,104.96875,105.53125,104.53125,105.125,3442900,397.4735359\n1998-03-02T14:30:00Z,105.25,105.75,104.625,104.90625,4252301,396.2937959\n1998-03-03T14:30:00Z,104.53125,105.625,104.53125,105.5,3349200,400.0719934\n1998-03-04T14:30:00Z,105.09375,105.40625,104.4375,104.8125,4404102,396.9785345\n1998-03-05T14:30:00Z,103.5,104.4375,103.15625,103.84375,7268000,391.1459282\n1998-03-06T14:30:00Z,104.5625,105.9375,104.4375,105.9375,6896301,411.0734762\n1998-03-09T14:30:00Z,105.53125,106.21875,105.25,105.5625,3362800,411.0223229\n1998-03-10T14:30:00Z,106.21875,106.84375,105.9375,106.5625,5481898,419.5980654\n1998-03-11T14:30:00Z,106.96875,107.3125,106.78125,107.0625,3439600,423.6807267\n1998-03-12T14:30:00Z,107.09375,107.59375,106.5,107.5,3191300,425.7704339\n1998-03-13T14:30:00Z,107.84375,108,106.875,107.09375,2879400,423.605824\n1998-03-16T14:30:00Z,107.84375,108.375,107.53125,108.25,3223600,431.1131482\n1998-03-17T14:30:00Z,108.3125,108.5625,107.65625,108.5625,4581898,433.0980683\n1998-03-18T14:30:00Z,108.25,108.96875,108.03125,108.96875,1944100,435.8477021\n1998-03-19T14:30:00Z,108.96875,109.375,108.65625,109.25,2554800,437.54777\n1998-03-20T14:30:00Z,109.5625,110.1875,108.875,109.875,3123300,441.1560857\n1998-03-23T14:30:00Z,109.71875,110.3125,109.40625,109.625,4453102,440.505044\n1998-03-24T14:30:00Z,110.0625,110.8125,109.9375,110.5625,3333600,448.6965949\n1998-03-25T14:30:00Z,111.40625,111.53125,109.1875,110.15625,4597602,445.5419272\n1998-03-26T14:30:00Z,109.875,110.75,109.625,110.09375,3333500,444.8562105\n1998-03-27T14:30:00Z,110.75,110.78125,109,109.625,2611300,441.2200735\n1998-03-30T14:30:00Z,109.625,110.09375,108.96875,109.5625,3108700,440.1263235\n1998-03-31T14:30:00Z,110.15625,111.1875,109.75,109.9375,5926500,441.7677377\n1998-04-01T14:30:00Z,110.3125,111.07812,109.40625,110.82812,2929000,446.2837492\n1998-04-02T14:30:00Z,110.9375,112.25,110.75,112.03125,3920900,456.5344412\n1998-04-03T14:30:00Z,112.34375,112.8125,111.84375,112.59375,3787600,460.3117112\n1998-04-06T13:30:00Z,113.25,113.375,111.6875,111.6875,4550500,455.0522246\n1998-04-07T13:30:00Z,111.75,111.9375,110.15625,110.9375,5583699,448.2359589\n1998-04-08T13:30:00Z,111.21875,111.28125,109.75,110.3125,4854801,442.7531323\n1998-04-09T13:30:00Z,110.5625,111.28125,110.53125,111.1875,4481199,448.1108774\n1998-04-13T13:30:00Z,111.375,111.375,110,110.875,4350199,446.1418085\n1998-04-14T13:30:00Z,111.125,111.8125,110.90625,111.8125,3279100,452.613357\n1998-04-15T13:30:00Z,111.96875,112.125,111.15625,112.125,3867200,454.6360453\n1998-04-16T13:30:00Z,111.3125,111.5,110.5,110.8125,7177898,443.1882491\n1998-04-17T13:30:00Z,110.71875,112.4375,110.4375,112.28125,5688801,453.3444991\n1998-04-20T13:30:00Z,112,112.5625,111.875,112.25,3688300,454.4852373\n1998-04-21T13:30:00Z,112.4375,113.15625,111.90625,112.78125,4573199,457.7892738\n1998-04-22T13:30:00Z,112.875,113.4375,112.8125,113.09375,2386100,460.6559573\n1998-04-23T13:30:00Z,112.625,113,111.75,112,5062000,452.2575198\n1998-04-24T13:30:00Z,111.75,112.46875,110.34375,110.8125,11039699,444.0329906\n1998-04-27T13:30:00Z,109.375,109.6875,107.625,108.71875,14510199,425.5263308\n1998-04-28T13:30:00Z,109.78125,109.8125,108.125,108.5625,6511398,422.0939402\n1998-04-29T13:30:00Z,109.03125,109.96875,108.4375,109.3125,7703102,424.8989602\n1998-04-30T13:30:00Z,110.5625,111.92187,110.40625,111.34375,8684500,443.9555303\n1998-05-01T13:30:00Z,111.75,112.59375,111.3125,112.59375,4008800,453.8348292\n1998-05-04T13:30:00Z,112.71875,113.3125,112.15625,112.3125,4537199,452.9363917\n1998-05-05T13:30:00Z,112,112.15625,111.125,111.53125,5146398,446.0891135\n1998-05-06T13:30:00Z,112.125,112.125,110.1875,110.21875,5526102,436.3494807\n1998-05-07T13:30:00Z,110.5,110.5625,109.34375,109.34375,6940398,430.1246823\n1998-05-08T13:30:00Z,110,111.375,110,111.125,7951000,443.2182791\n1998-05-11T13:30:00Z,111.5625,112.21875,110.375,110.75,6336301,441.6098232\n1998-05-12T13:30:00Z,110.8125,111.96875,110.34375,111.9375,6045199,448.0551357\n1998-05-13T13:30:00Z,112.0625,112.5625,111.59375,112.21875,4441500,450.0570888\n1998-05-14T13:30:00Z,111.53125,112.6875,111.34375,111.65625,4187500,448.2341722\n1998-05-15T13:30:00Z,112,112.21875,110.8125,111.03125,6716102,444.279094\n1998-05-18T13:30:00Z,110.71875,111.59375,109.82812,110.59375,4847199,441.4994961\n1998-05-19T13:30:00Z,111,111.6875,110.78125,111.34375,5918699,447.4032603\n1998-05-20T13:30:00Z,112.09375,112.5,110.875,112.40625,5716602,452.9139267\n1998-05-21T13:30:00Z,112.375,112.78125,111.3125,111.6875,6301500,448.5637847\n1998-05-22T13:30:00Z,111.75,112.0625,110.9375,111.25,4862199,445.45761\n1998-05-26T13:30:00Z,112.09375,112.09375,109.1875,109.46875,6899301,431.7696267\n1998-05-27T13:30:00Z,109.3125,109.90625,107.57812,109.625,10202602,430.4085734\n1998-05-28T13:30:00Z,109.875,110.375,109.0625,110.125,4907602,432.7786577\n1998-05-29T13:30:00Z,110.625,110.8125,109.03125,109.03125,4772602,426.0006518\n1998-06-01T13:30:00Z,108.96875,110.21875,108.5625,109.53125,6092199,427.3834346\n1998-06-02T13:30:00Z,110,110.34375,109.15625,109.625,6701102,427.5626626\n1998-06-03T13:30:00Z,109.875,110.1875,107.875,107.875,6445102,414.6365262\n1998-06-04T13:30:00Z,108.25,110.0625,108.0625,109.875,6566301,426.8259087\n1998-06-05T13:30:00Z,110.375,112,109.875,112,8463199,444.370276\n1998-06-08T13:30:00Z,111.9375,112.46875,111.65625,111.875,4159898,444.9712376\n1998-06-09T13:30:00Z,111.71875,112.42187,111.40625,112.21875,2725300,446.8873633\n1998-06-10T13:30:00Z,111.625,113.0625,111.25,111.5,6186898,444.8365821\n1998-06-11T13:30:00Z,111.4375,111.875,109.375,109.40625,8056602,428.3579941\n1998-06-12T13:30:00Z,109.875,110.4375,108.25,110.4375,9779000,430.5154896\n1998-06-15T13:30:00Z,108.8125,109.90625,107.5,107.53125,10234199,408.2802465\n1998-06-16T13:30:00Z,108.40625,109.21875,107.75,109.1875,7471500,417.8722604\n1998-06-17T13:30:00Z,110.15625,111.78125,109.9375,111.46875,12057699,438.9097554\n1998-06-18T13:30:00Z,111.1875,111.4375,110.75,110.96875,3844600,437.6846133\n1998-06-19T13:30:00Z,111.0625,111.23437,109.625,110.0625,3549100,430.311315\n1998-06-22T13:30:00Z,110.25,111.0625,110.0625,110.59375,5438301,432.57694\n1998-06-23T13:30:00Z,111.09375,112.0625,111,111.90625,5004602,444.8342106\n1998-06-24T13:30:00Z,112.15625,113.6875,111.60937,113.40625,8291898,456.1957547\n1998-06-25T13:30:00Z,113.90625,114.4375,112.8125,113.21875,5854801,455.4680581\n1998-06-26T13:30:00Z,113.3125,113.84375,113.125,113.6875,4833102,457.5925098\n1998-06-29T13:30:00Z,114.25,114.6875,113.79687,114.09375,5953398,460.1300977\n1998-06-30T13:30:00Z,113.90625,114.1875,113.0625,113.3125,4284801,453.944328\n1998-07-01T13:30:00Z,114.0625,114.9375,113.625,114.625,3489500,463.0211698\n1998-07-02T13:30:00Z,114.71875,114.875,114.25,114.84375,3503900,464.3126239\n1998-07-06T13:30:00Z,114.78125,116,114.5625,116,3144400,473.1536312\n1998-07-07T13:30:00Z,115.98437,116.125,115.28125,115.78125,4920699,473.0925228\n1998-07-08T13:30:00Z,115.875,116.9375,115.75,116.625,6875000,479.9087584\n1998-07-09T13:30:00Z,116.28125,116.71875,115.625,115.84375,6942500,475.9453437\n1998-07-10T13:30:00Z,116.03125,116.9375,115.0625,116.46875,7849699,478.4751789\n1998-07-13T13:30:00Z,116.5625,116.84375,116.0625,116.5,6555102,478.7869935\n1998-07-14T13:30:00Z,116.9375,118.15625,116.9375,117.8125,6983602,491.1420843\n1998-07-15T13:30:00Z,118.0625,118.28125,117.53125,117.59375,4977500,490.4332889\n1998-07-16T13:30:00Z,117.6875,118.59375,117.0625,118.40625,6315602,494.4321041\n1998-07-17T13:30:00Z,118.625,119,118.3125,118.5625,3539500,495.735947\n1998-07-20T13:30:00Z,118.75,119.23437,117.9375,118.5625,2338400,495.3860134\n1998-07-21T13:30:00Z,119,119,116.28125,116.5,5518602,478.0672016\n1998-07-22T13:30:00Z,116.34375,116.98437,115.53125,116.5,10417301,476.4738589\n1998-07-23T13:30:00Z,116.3125,116.59375,113.90625,114.1875,15110898,456.6398466\n1998-07-24T13:30:00Z,114.96875,115.09375,112.875,114.09375,11540500,453.4704574\n1998-07-27T13:30:00Z,113.625,115,112.84375,114.90625,9600000,457.5309014\n1998-07-28T13:30:00Z,114.4375,114.65625,111.875,112.96875,13693000,443.7233008\n1998-07-29T13:30:00Z,113.71875,114.125,112.25,112.53125,7462398,439.2161416\n1998-07-30T13:30:00Z,113.625,114.59375,113.40625,114.21875,6821602,450.5347392\n1998-07-31T13:30:00Z,114.34375,114.5,111.3125,111.78125,7680500,431.094513\n1998-08-03T13:30:00Z,111.78125,112.42187,111.03125,111.3125,10486500,427.9935439\n1998-08-04T13:30:00Z,112.21875,112.21875,107,107,15091602,392.4375181\n1998-08-05T13:30:00Z,107.9375,108.875,105.59375,108.46875,21718400,393.535527\n1998-08-06T13:30:00Z,108.125,109.5,107.5625,108.9375,13084398,396.6730565\n1998-08-07T13:30:00Z,109.6875,110.59375,108.46875,109.125,12083801,397.1593715\n1998-08-10T13:30:00Z,108.75,109.65625,108.1875,108.5,6273000,393.9168047\n1998-08-11T13:30:00Z,106.78125,107.4375,105.5,106.875,14287102,381.764027\n1998-08-12T13:30:00Z,107.75,108.875,107.5,108.6875,11158398,398.6019265\n1998-08-13T13:30:00Z,108.8125,109.65625,107.375,107.375,9073898,392.7425515\n1998-08-14T13:30:00Z,108.34375,108.71875,105.78125,106.125,8628500,384.5283187\n1998-08-17T13:30:00Z,106,108.9375,105.5,108.375,11290000,397.2217201\n1998-08-18T13:30:00Z,109,110.59375,108.78125,110.375,7603898,414.6595008\n1998-08-19T13:30:00Z,111.09375,111.09375,109.625,110.09375,6258602,413.5280353\n1998-08-20T13:30:00Z,109.6875,110.40625,109.15625,109.4375,7402801,409.499715\n1998-08-21T13:30:00Z,108.1875,108.71875,105.5,108.5625,16685398,404.4299725\n1998-08-24T13:30:00Z,109.25,109.9375,108.3125,109.25,7201699,408.3362225\n1998-08-25T13:30:00Z,110.375,111.25,108.64062,109.5,9688301,407.4380206\n1998-08-26T13:30:00Z,108.28125,109.625,107.75,108.875,9339699,404.5812109\n1998-08-27T13:30:00Z,107,107.5625,103.46875,103.75,24887808,359.0441171\n1998-08-28T13:30:00Z,104.96875,105.71875,102.15625,103.375,23735904,353.4630624\n1998-08-31T13:30:00Z,103.75,104.01562,95,96,22563104,288.6957822\n1998-09-01T13:30:00Z,96.0625,100.5625,93.625,100.0625,24748496,301.9495234\n1998-09-02T13:30:00Z,99.8125,101.75,98.78125,99.34375,13843199,302.0740928\n1998-09-03T13:30:00Z,97.625,99.375,96.75,98.5625,17311296,299.5339174\n1998-09-04T13:30:00Z,99.4375,99.8125,95.75,97.75,17783808,293.717156\n1998-09-08T13:30:00Z,100.875,103,99.8125,103,14746500,335.3680398\n1998-09-09T13:30:00Z,102.75,103.125,100.4375,100.5,12109699,319.9743809\n1998-09-10T13:30:00Z,98.4375,99.34375,96.8125,98.5,19889296,304.0867479\n1998-09-11T13:30:00Z,98.1875,101.6875,97,101.6875,20379808,325.067593\n1998-09-14T13:30:00Z,102.875,104.45312,102.09375,103.4375,10686801,339.6814017\n1998-09-15T13:30:00Z,102.875,104.3125,102.28125,104.0625,8337898,344.204502\n1998-09-16T13:30:00Z,104.75,105.25,103.15625,105,11024898,348.4247839\n1998-09-17T13:30:00Z,102.25,103.03125,101.78125,102,12945199,321.6018672\n1998-09-18T13:30:00Z,102.375,102.40625,101.09375,102.09375,7019199,321.1513168\n1998-09-21T13:30:00Z,99.625,103.40625,98.9375,102.03125,8834602,325.802847\n1998-09-22T13:30:00Z,103.5,103.65625,102.15625,102.875,7270102,331.1192956\n1998-09-23T13:30:00Z,103.875,107,103.78125,107,13688500,368.3705711\n1998-09-24T13:30:00Z,106.3125,106.8125,103.25,104.375,11129500,353.5158175\n1998-09-25T13:30:00Z,103.125,105.42187,102.625,104.25,10247398,353.3595673\n1998-09-28T13:30:00Z,105.3125,106.3125,104.25,105.1875,8847801,359.7189423\n1998-09-29T13:30:00Z,105.375,105.9375,103.375,104.9375,10618102,357.5352074\n1998-09-30T13:30:00Z,103.5,104.3125,101.375,101.75,7908398,329.884408\n1998-10-01T13:30:00Z,100.03125,101.54687,98.09375,98.8125,13335602,307.0775505\n1998-10-02T13:30:00Z,98.875,100.875,97.21875,100.71875,14351801,315.289921\n1998-10-05T13:30:00Z,99.59375,99.96875,96.34375,98.6875,12807199,302.8870642\n1998-10-06T13:30:00Z,100.75,101.28125,97.53125,98.59375,12621000,297.1861648\n1998-10-07T13:30:00Z,98.625,100.03125,95.75,97.125,14348500,287.0175692\n1998-10-08T13:30:00Z,94.5625,96.75,92.21875,96.59375,20625008,287.676\n1998-10-09T13:30:00Z,97,98.78125,94.0625,98.53125,12708500,297.3952055\n1998-10-12T13:30:00Z,100.625,101.4375,99.6875,99.96875,9508500,307.3932917\n1998-10-13T13:30:00Z,99.5625,100.40625,98.75,99.625,6256801,305.3990924\n1998-10-14T13:30:00Z,98.9375,101.8125,98.84375,100.5625,8176898,313.4876886\n1998-10-15T13:30:00Z,100.125,107.25,99.9375,105.96875,20541104,360.7841525\n1998-10-16T13:30:00Z,106.125,106.75,105,106,16573898,363.4800352\n1998-10-19T13:30:00Z,105.6875,106.8125,105.5,106.375,7915898,366.0781457\n1998-10-20T13:30:00Z,107.5625,108.79687,106.09375,107,14611602,368.7928824\n1998-10-21T13:30:00Z,106.875,107.625,105.875,106.625,9178398,366.4103927\n1998-10-22T13:30:00Z,106.78125,108.46875,106.15625,108.21875,8277500,377.3273335\n1998-10-23T13:30:00Z,107.96875,108,106.78125,106.84375,6237199,368.9252791\n1998-10-26T14:30:00Z,107.71875,108.46875,106.78125,107.625,5838602,371.2628287\n1998-10-27T14:30:00Z,108.4375,108.96875,106.28125,107,10089699,367.0273055\n1998-10-28T14:30:00Z,106.5625,107.53125,106.03125,106.8125,5650602,365.6535529\n1998-10-29T14:30:00Z,107.09375,109.4375,106.625,109.40625,9625602,387.409667\n1998-10-30T14:30:00Z,110.125,110.90625,109.5,110,9872801,392.5298593\n1998-11-02T14:30:00Z,110.8125,111.875,110.1875,111.875,6501398,407.8854628\n1998-11-03T14:30:00Z,111.59375,111.8125,110.75,111.0625,6866000,403.6828765\n1998-11-04T14:30:00Z,112.46875,113.09375,111.09375,112.25,8233602,409.268814\n1998-11-05T14:30:00Z,111.53125,113.9375,111.125,113.78125,6841500,418.8385944\n1998-11-06T14:30:00Z,113.46875,114.5625,113.3125,114.125,5224801,422.163958\n1998-11-09T14:30:00Z,113.9375,114.25,112.5,113.3125,6188699,417.065106\n1998-11-10T14:30:00Z,113,113.9375,112.25,113,14015199,415.3768115\n1998-11-11T14:30:00Z,113.8125,114,111.89062,112.25,10922398,410.3435253\n1998-11-12T14:30:00Z,112.3125,113.125,111.6875,112.125,5457398,408.5206086\n1998-11-13T14:30:00Z,112.21875,113.21875,112.125,113.21875,5524602,417.7912636\n1998-11-16T14:30:00Z,114.21875,114.35937,112.89062,114.0625,6023699,422.0037806\n1998-11-17T14:30:00Z,113.65625,115.625,113,114.0625,9058898,422.6051828\n1998-11-18T14:30:00Z,114.3125,115,113.5,114.75,4567699,426.2923017\n1998-11-19T14:30:00Z,115.28125,115.90625,114.625,115.75,5249301,433.2752722\n1998-11-20T14:30:00Z,116.35937,116.75,115.84375,116.625,5562000,439.8446298\n1998-11-23T14:30:00Z,117.46875,119.625,117.15625,119.375,7151301,465.0799826\n1998-11-24T14:30:00Z,119,119.65625,118.45312,118.625,5323699,463.4988559\n1998-11-25T14:30:00Z,118.9375,119.1875,118.21875,118.625,4393500,462.67165\n1998-11-27T14:30:00Z,119.46875,119.71875,119.01562,119.5,4557898,468.3591355\n1998-11-30T14:30:00Z,119.01562,119.375,116.125,116.125,8705398,437.7856219\n1998-12-01T14:30:00Z,116.125,118.03125,115.21875,117.625,8950602,442.9330296\n1998-12-02T14:30:00Z,117.21875,117.90625,116,117.28125,7495500,443.211283\n1998-12-03T14:30:00Z,117.25,118.3125,115.09375,115.34375,12145301,431.0585052\n1998-12-04T14:30:00Z,116.625,118.5,116.5,118.375,10007199,453.2067429\n1998-12-07T14:30:00Z,118.0625,119.46875,118,118.9375,4290000,458.3617122\n1998-12-08T14:30:00Z,118.53125,119.75,117.5,118.40625,10102602,456.996997\n1998-12-09T14:30:00Z,118.6875,118.96875,117.875,118.625,5327898,457.4852782\n1998-12-10T14:30:00Z,118.84375,118.84375,116.71875,116.89062,5966602,442.3100255\n1998-12-11T14:30:00Z,116.4375,117.34375,115.5625,117.125,8198199,442.6386401\n1998-12-14T14:30:00Z,116.15625,116.40625,113.75,113.75,9521398,413.4796328\n1998-12-15T14:30:00Z,114.6875,116.75,114.53125,116.6875,9631500,432.9595598\n1998-12-16T14:30:00Z,117.125,117.125,115.75,116.53125,7260000,433.1060442\n1998-12-17T14:30:00Z,117.21875,118.59375,117.03125,118.39062,6914699,448.2049739\n1998-12-18T14:30:00Z,118.3125,119.125,117.875,118.5,4802398,449.6807183\n1998-12-21T14:30:00Z,119.25,121.34375,119,120.15625,8580699,464.1939394\n1998-12-22T14:30:00Z,120.40625,121.21875,119.1875,120.6875,5461102,466.8364026\n1998-12-23T14:30:00Z,121.1875,123.21875,120.8125,123.21875,7791000,489.3742632\n1998-12-24T14:30:00Z,123.15625,123.25,122.5,122.6875,1507100,488.4535043\n1998-12-28T14:30:00Z,123.25,123.3125,122,122.375,4203602,485.8472031\n1998-12-29T14:30:00Z,122.71875,124.48437,122.125,124.3125,3935800,498.711189\n1998-12-30T14:30:00Z,123.9375,124.75,123.03125,123.3125,6810699,495.2539415\n1998-12-31T14:30:00Z,123.3125,123.9375,122.46875,123.3125,6790500,494.7468802\n1999-01-04T14:30:00Z,123.375,125.21875,121.71875,123.03125,9450398,493.2044346\n1999-01-05T14:30:00Z,122.9375,124.875,122.9375,124.4375,8031000,504.9948244\n1999-01-06T14:30:00Z,125.8125,127.75,125.75,127.4375,7737699,533.5950177\n1999-01-07T14:30:00Z,126.375,127.21875,125.78125,126.8125,5504898,533.5950177\n1999-01-08T14:30:00Z,128.1875,128.29687,126.1875,127.75,6221898,537.0576844\n1999-01-11T14:30:00Z,127.6875,127.6875,125.21875,126.53125,7578301,525.5003303\n1999-01-12T14:30:00Z,126.21875,126.21875,123.75,124.25,7768801,504.2960952\n1999-01-13T14:30:00Z,120.40625,125.125,120.375,123.375,10810602,504.837498\n1999-01-14T14:30:00Z,123.625,123.90625,120.90625,121.21875,11400699,494.0463804\n1999-01-15T14:30:00Z,122.375,124.40625,122.0625,124.375,7812699,515.0775942\n1999-01-19T14:30:00Z,125.29687,125.625,123.5,125.1875,6535102,518.8210912\n1999-01-20T14:30:00Z,126.09375,127.9375,125.03125,126.1875,6534398,524.7943867\n1999-01-21T14:30:00Z,125.57812,125.84375,122.59375,122.84375,6937500,494.2353043\n1999-01-22T14:30:00Z,122.125,123.84375,121.78125,122.5625,7522301,492.4310969\n1999-01-25T14:30:00Z,123.28125,124,121.90625,123.8125,5700301,499.05787\n1999-01-26T14:30:00Z,124.125,126.0625,123.625,126.0625,6047000,517.3946861\n1999-01-27T14:30:00Z,126.375,126.625,124.15625,124.59375,7399398,509.8302019\n1999-01-28T14:30:00Z,125.25,126.96875,125.1875,126.6875,5961699,523.7548343\n1999-01-29T14:30:00Z,127.34375,128.29687,125.40625,127.65625,6456801,528.3488963\n1999-02-01T14:30:00Z,128.6875,128.6875,126.90625,126.90625,9426801,522.9326674\n1999-02-02T14:30:00Z,127.07812,127.21875,124.76562,126.125,9194500,515.0712144\n1999-02-03T14:30:00Z,125.6875,127.9375,125.65625,127.40625,10290699,523.6243977\n1999-02-04T14:30:00Z,127.375,127.5,124.78125,125.5,7761102,511.0449157\n1999-02-05T14:30:00Z,125.65625,125.65625,123.21875,124.0625,7516102,497.7836169\n1999-02-08T14:30:00Z,125.09375,125.09375,123.34375,124.3125,8528398,496.1664294\n1999-02-09T14:30:00Z,124.375,124.5,121.51562,121.53125,8985699,471.9858249\n1999-02-10T14:30:00Z,122.125,123,121.32812,122.3125,6936699,472.6178677\n1999-02-11T14:30:00Z,123.0625,126.09375,122.5,125.125,9181801,497.2395008\n1999-02-12T14:30:00Z,124.8125,125.5,122.625,123.625,10676602,489.9670353\n1999-02-16T14:30:00Z,124.75,125.625,122.875,122.875,6915500,481.8260097\n1999-02-17T14:30:00Z,123.1875,125.35937,122.25,122.75,7858102,478.3001522\n1999-02-18T14:30:00Z,123.1875,124.375,122.21875,123.71875,9048898,483.3432556\n1999-02-19T14:30:00Z,124,125.75,123.375,124.25,5312199,487.3377309\n1999-02-22T14:30:00Z,124.4375,127.71875,124.28125,127.5625,10695801,517.7856475\n1999-02-23T14:30:00Z,127.59375,128.5,126.59375,127.5,7770699,519.2993194\n1999-02-24T14:30:00Z,127.84375,128.84375,125,125.25,7271000,504.8738144\n1999-02-25T14:30:00Z,124.53125,125.28125,122.6875,124.0625,11633000,494.6469695\n1999-02-26T14:30:00Z,124.75,124.84375,122.8125,123.5625,9621301,490.2435604\n1999-03-01T14:30:00Z,123.65625,124.3125,122.375,123.90625,7607199,490.8144739\n1999-03-02T14:30:00Z,124.5,125.3125,122.3125,122.8125,9651500,484.7159407\n1999-03-03T14:30:00Z,123.09375,123.5625,121.78125,123.46875,7881398,485.9501495\n1999-03-04T14:30:00Z,124.0625,125.48437,123.26562,125.03125,8256398,497.6114645\n1999-03-05T14:30:00Z,127.5,128.125,126.5625,127.54687,10703102,518.5341854\n1999-03-08T14:30:00Z,128.28125,128.79687,127.25,128.375,4802199,522.9789276\n1999-03-09T14:30:00Z,128.125,129.9375,127.75,128.0625,7893398,521.5641197\n1999-03-10T14:30:00Z,128.46875,129.25,127.78125,129.1875,3960100,528.9078697\n1999-03-11T14:30:00Z,129.6875,131.1875,128.875,130.625,6583699,539.3702522\n1999-03-12T14:30:00Z,131,131.03125,129.21875,129.375,5286500,531.5204788\n1999-03-15T14:30:00Z,129.9375,131.25,129.5,131.21875,5394398,542.4964911\n1999-03-16T14:30:00Z,131.125,131.65625,130.46875,130.71875,4547500,541.3064004\n1999-03-17T14:30:00Z,130.6875,130.9375,129.625,130.15625,4524102,536.8120548\n1999-03-18T14:30:00Z,129.78125,132.375,129.75,132.25,3506300,552.8791361\n1999-03-19T14:30:00Z,132.3125,132.625,129.6875,129.6875,5526699,538.2010797\n1999-03-22T14:30:00Z,130.0625,130.59375,129.42187,129.9375,4603801,536.74876\n1999-03-23T14:30:00Z,129.3125,129.53125,125.70312,126.1875,9713801,501.9373134\n1999-03-24T14:30:00Z,126.84375,127.17187,125.625,126.90625,6280898,501.8547319\n1999-03-25T14:30:00Z,128.0625,129.5,127.75,129.5,6639602,526.5185153\n1999-03-26T14:30:00Z,128.625,129.125,127.71875,128.5625,6159699,523.0450778\n1999-03-29T14:30:00Z,129.15625,131.4375,129.15625,131.15625,5863898,547.8332932\n1999-03-30T14:30:00Z,129.9375,131.21875,129.5625,130.46875,5401398,548.1941967\n1999-03-31T14:30:00Z,131.15625,131.60937,128.3125,128.375,7413602,535.0245982\n1999-04-01T14:30:00Z,129.6875,129.6875,128.125,129.34375,7683602,535.3935969\n1999-04-05T13:30:00Z,130.9375,132.59375,130.25,132.40625,5791102,561.541124\n1999-04-06T13:30:00Z,132.1875,132.98437,131.15625,132.09375,5381301,561.5689266\n1999-04-07T13:30:00Z,132.6875,133.375,131.375,133.15625,6248602,566.6085924\n1999-04-08T13:30:00Z,133.1875,134.9375,132.28125,134.84375,5909102,577.1769242\n1999-04-09T13:30:00Z,134.4375,135.5,133.59375,134.875,4365801,579.4128249\n1999-04-12T13:30:00Z,133.46875,136.40625,133.21875,136.3125,8213199,588.7341371\n1999-04-13T13:30:00Z,136.25,136.46875,134.5,135.4375,10071398,586.3231951\n1999-04-14T13:30:00Z,136.0625,136.0625,132.6875,133.15625,11551699,567.4094396\n1999-04-15T13:30:00Z,133.4375,133.5625,131,132.65625,11150000,560.7831963\n1999-04-16T13:30:00Z,132.90625,132.90625,131.1875,131.53125,6476199,551.1538914\n1999-04-19T13:30:00Z,132.6875,134.53125,128.375,129.5,12487199,539.1093076\n1999-04-20T13:30:00Z,129.8125,131.1875,129,131.125,9049602,544.3551355\n1999-04-21T13:30:00Z,131.0625,135.625,130.40625,134.875,5772199,574.6984453\n1999-04-22T13:30:00Z,135.125,136.375,134.39062,136.15625,6897398,583.4750261\n1999-04-23T13:30:00Z,135.875,136.75,135,135.8125,4593102,583.0532423\n1999-04-26T13:30:00Z,136.5,136.8125,135.46875,136.59375,3606500,586.7888745\n1999-04-27T13:30:00Z,137.125,137.5,135.84375,137.25,5147199,589.2915998\n1999-04-28T13:30:00Z,136.4375,137.25,135,135.375,5544301,574.6511889\n1999-04-29T13:30:00Z,135.5625,136.0625,133.8125,134.34375,9824301,567.25115\n1999-04-30T13:30:00Z,135.09375,135.625,131.5,133.25,10991898,557.9412542\n1999-05-03T13:30:00Z,133.4375,135.84375,133.09375,135.6875,10709699,573.5999943\n1999-05-04T13:30:00Z,135.125,135.8125,133.125,133.75,10509301,563.4362323\n1999-05-05T13:30:00Z,133.9375,135.0625,131.84375,134.8125,10032301,567.3030772\n1999-05-06T13:30:00Z,134.4375,135.125,132.375,133.98437,13507199,563.0133594\n1999-05-07T13:30:00Z,134.5,135.125,133.4375,135,8680699,567.5752725\n1999-05-10T13:30:00Z,134.84375,135.71875,133.53125,134.32812,5580102,564.3809596\n1999-05-11T13:30:00Z,135.3125,136.875,134.71875,135.6875,7000602,573.480551\n1999-05-12T13:30:00Z,135.75,137.21875,131.5,136.75,13865801,580.9381283\n1999-05-13T13:30:00Z,137.25,138,136.8125,137.34375,4485699,585.6754953\n1999-05-14T13:30:00Z,134.5625,135.875,133.5,133.78125,8370102,555.541358\n1999-05-17T13:30:00Z,133.625,134.48437,132.375,134.1875,6268102,557.4183483\n1999-05-18T13:30:00Z,134.53125,134.98437,132.625,133.9375,8218602,555.831431\n1999-05-19T13:30:00Z,134.46875,135,133.25,134.90625,5052398,559.4660118\n1999-05-20T13:30:00Z,135.125,135.59375,130.0625,134.09375,4675398,552.9249367\n1999-05-21T13:30:00Z,134.125,134.6875,132.59375,133.34375,6414602,547.3497706\n1999-05-24T13:30:00Z,133.84375,133.84375,130.39062,131.125,7952000,528.2603723\n1999-05-25T13:30:00Z,131.375,132.34375,128.4375,129,15406398,513.6382205\n1999-05-26T13:30:00Z,129.3125,131,128.09375,130.4375,12575898,518.6605419\n1999-05-27T13:30:00Z,129.84375,130.28125,128,128.5625,14515398,505.7699169\n1999-05-28T13:30:00Z,129,130.75,128.59375,130.20312,8748000,516.3130772\n1999-06-01T13:30:00Z,130.125,130.15625,128.375,129.75,6705301,514.4688637\n1999-06-02T13:30:00Z,129.75,130.1875,128.01562,129.875,6981898,514.9174093\n1999-06-03T13:30:00Z,130.6875,130.875,129.78125,130.59375,6076602,518.8236593\n1999-06-04T13:30:00Z,131.46875,133.35937,130.9375,133.21875,9787199,541.7845409\n1999-06-07T13:30:00Z,133.4375,134.1875,132.90625,133.5625,5299102,544.756842\n1999-06-08T13:30:00Z,133.375,133.79687,131.59375,132.25,4895699,534.6033009\n1999-06-09T13:30:00Z,132.40625,133.09375,131.8125,132.125,7409699,532.7575978\n1999-06-10T13:30:00Z,131.4375,131.46875,129.59375,130.90625,7040699,521.9388961\n1999-06-11T13:30:00Z,131.21875,131.73437,129.09375,129.8125,12824301,514.0570597\n1999-06-14T13:30:00Z,130.6875,130.75,129.54687,129.9375,6823500,511.7898717\n1999-06-15T13:30:00Z,130.46875,131.65625,130.07812,130.8125,5700898,516.8181228\n1999-06-16T13:30:00Z,132.375,133.875,132.375,133.3125,7865801,541.5177412\n1999-06-17T13:30:00Z,132.875,135.5625,132.625,134.5625,8162801,551.8394776\n1999-06-18T13:30:00Z,134.0625,134.6875,133.375,134.3125,2875100,553.1098887\n1999-06-21T13:30:00Z,134.46875,135.25,133.65625,134.625,4646398,554.7129252\n1999-06-22T13:30:00Z,134,135.1875,133.5,133.6875,5862398,550.4178178\n1999-06-23T13:30:00Z,133,133.625,132.125,133.03125,9629199,546.0564707\n1999-06-24T13:30:00Z,132.875,132.9375,130.65625,132.03125,9176898,537.0707893\n1999-06-25T13:30:00Z,132.59375,133.01562,131.25,131.70312,4087000,534.0067606\n1999-06-28T13:30:00Z,132.6875,133.625,132.5,133.3125,5028898,545.6960482\n1999-06-29T13:30:00Z,133,135.1875,132.78125,134.5625,6956199,555.6998592\n1999-06-30T13:30:00Z,134.625,137.5,133.84375,137,16856096,573.917463\n1999-07-01T13:30:00Z,137,138.5,136.0625,138.03125,9939500,580.5379527\n1999-07-02T13:30:00Z,138.125,139.5,137.90625,139.40625,3772800,591.8092145\n1999-07-06T13:30:00Z,139.25,140.75,138.59375,139.375,11221102,593.0014217\n1999-07-07T13:30:00Z,139.0625,139.71875,138.51562,139.5625,3230700,595.0410812\n1999-07-08T13:30:00Z,139.0625,140.625,138.75,139.67187,7101500,596.8309123\n1999-07-09T13:30:00Z,140,140.59375,139.5625,140.5,2934700,602.820875\n1999-07-12T13:30:00Z,140.9375,140.9375,139.5,139.875,4436301,598.695875\n1999-07-13T13:30:00Z,139.375,139.92187,138.65625,139.375,6477602,594.8872688\n1999-07-14T13:30:00Z,140,140.21875,138.75,140.15625,4382500,597.9727907\n1999-07-15T13:30:00Z,140.78125,141.375,140.3125,141.04687,3348600,604.8332555\n1999-07-16T13:30:00Z,141.25,142.15625,140.75,141.8125,2281500,610.0748774\n1999-07-19T13:30:00Z,142.1875,142.25,140.5625,140.875,4287000,603.8649415\n1999-07-20T13:30:00Z,140.125,140.40625,137.53125,137.98437,7060102,577.7893455\n1999-07-21T13:30:00Z,138.09375,138.90625,137.3125,137.82812,4793699,575.5586408\n1999-07-22T13:30:00Z,137.4375,138,135.46875,136.01562,7804102,560.8569132\n1999-07-23T13:30:00Z,136.65625,137,135.125,135.75,4603000,557.8938724\n1999-07-26T13:30:00Z,134.875,136.125,134.625,134.75,4333398,552.6442966\n1999-07-27T13:30:00Z,136,137.20312,135.375,135.875,5908500,559.9242558\n1999-07-28T13:30:00Z,136.25,137.3125,135.59375,136.3125,3955500,562.1703496\n1999-07-29T13:30:00Z,134.9375,135.25,133.3125,134.40625,7760602,545.8967647\n1999-07-30T13:30:00Z,134.8125,135.34375,132.5625,132.75,5994301,534.7440544\n1999-08-02T13:30:00Z,132.75,134.75,132.5,133.0625,6065500,534.53219\n1999-08-03T13:30:00Z,133.71875,133.84375,131.375,132.4375,5445398,529.6146286\n1999-08-04T13:30:00Z,132.71875,133.875,130.4375,130.625,6497898,519.0377055\n1999-08-05T13:30:00Z,130.875,131.9375,128.84375,131.8125,10322000,522.5242235\n1999-08-06T13:30:00Z,131.21875,132,129.5,130.375,7537699,513.9349378\n1999-08-09T13:30:00Z,130.59375,131.79687,129.75,130.09375,5565898,511.0137019\n1999-08-10T13:30:00Z,129.875,130.15625,127,128.65625,9793301,498.2151527\n1999-08-11T13:30:00Z,129.6875,130.53125,128.625,130.21875,8003398,506.2899098\n1999-08-12T13:30:00Z,130.6875,131.8125,129.90625,130.14062,7036801,505.2212669\n1999-08-13T13:30:00Z,131.625,133.25,131.125,133.15625,5857699,530.9398003\n1999-08-16T13:30:00Z,133.125,133.96875,132.25,133.75,3927000,534.4140394\n1999-08-17T13:30:00Z,134.4375,134.84375,133.125,134.625,4808000,538.5156019\n1999-08-18T13:30:00Z,134.20312,134.375,133.25,133.65625,4355500,530.594873\n1999-08-19T13:30:00Z,132.375,133.23437,131.6875,132.5625,6448102,523.212054\n1999-08-20T13:30:00Z,133.0625,134.125,132.6875,133.90625,3663700,534.6546045\n1999-08-23T13:30:00Z,134.8125,136.54687,134.65625,136.46875,5637801,558.6555563\n1999-08-24T13:30:00Z,136.0625,137.96875,135.375,136.96875,9279500,562.91692\n1999-08-25T13:30:00Z,137.1875,138.78125,136.15625,138.375,6005301,571.7621683\n1999-08-26T13:30:00Z,138.28125,138.42187,136.5,136.71875,4322301,560.4560248\n1999-08-27T13:30:00Z,136.875,137.0625,135.0625,135.0625,6247398,547.6688006\n1999-08-30T13:30:00Z,135.34375,135.5,132,132.5625,4652000,526.6368095\n1999-08-31T13:30:00Z,132.9375,133.75,130.875,132.0625,11453699,521.8134027\n1999-09-01T13:30:00Z,132.9375,133.73437,132.3125,133.6875,6863898,532.3550908\n1999-09-02T13:30:00Z,132.125,132.67187,130.65625,132.10937,10896301,522.5820872\n1999-09-03T13:30:00Z,134.875,136.5,134.6875,135.96875,9160801,561.4833313\n1999-09-07T13:30:00Z,136.0625,136.625,135.21875,135.46875,4560801,560.0225754\n1999-09-08T13:30:00Z,134.84375,136.0625,134.03125,134.8125,6159602,556.641359\n1999-09-09T13:30:00Z,134.75,135.25,133.6875,134.75,6177801,556.326527\n1999-09-10T13:30:00Z,136.25,136.35937,134.9375,135.875,2934500,562.5483387\n1999-09-13T13:30:00Z,135.125,135.46875,134.5,134.95312,2320500,555.0685424\n1999-09-14T13:30:00Z,134.0625,134.5625,133.375,134.0625,3736000,548.6101606\n1999-09-15T13:30:00Z,135.4375,135.4375,131.875,131.9375,6984500,533.7389984\n1999-09-16T13:30:00Z,132.5,132.8125,130.3125,132.45312,15377602,532.5869937\n1999-09-17T13:30:00Z,132.625,133.9375,132.15625,133.75,8542301,542.1473515\n1999-09-20T13:30:00Z,133.9375,134,133.09375,133.5625,2803900,541.823544\n1999-09-21T13:30:00Z,132.25,132.46875,130.15625,130.75,9335199,515.465657\n1999-09-22T13:30:00Z,131.25,131.84375,129.75,130.60156,13009102,513.1184972\n1999-09-23T13:30:00Z,131.8125,131.8125,127.625,127.875,12204199,492.3430684\n1999-09-24T13:30:00Z,127.75,128.375,126.3125,127.75,13792898,488.7873793\n1999-09-27T13:30:00Z,128.75,129.75,128.28125,128.59375,6970301,494.3053973\n1999-09-28T13:30:00Z,127.9375,128.8125,125.5625,128.34375,11063398,493.8103892\n1999-09-29T13:30:00Z,128.4375,129.125,126.75,126.8125,7580301,484.7921271\n1999-09-30T13:30:00Z,127.4375,129.4375,126.96875,128.75,7498898,496.9449049\n1999-10-01T13:30:00Z,127.9375,128.5625,126.625,128.46875,11127102,498.7040109\n1999-10-04T13:30:00Z,129.1875,130.875,128.75,130.75,6341602,518.7397651\n1999-10-05T13:30:00Z,130.71875,131.96875,128.6875,130.625,11976000,519.5077173\n1999-10-06T13:30:00Z,130.75,132.8125,130.6875,132.625,10308199,537.7858871\n1999-10-07T13:30:00Z,132.85937,133,131.5,131.875,6535602,535.0236192\n1999-10-08T13:30:00Z,131.75,133.875,131.23437,133.875,9674301,547.2191433\n1999-10-11T13:30:00Z,133.59375,134.125,133.3125,133.65625,4282000,548.1184892\n1999-10-12T13:30:00Z,133.125,133.3125,131.1875,131.59375,8686102,529.3526531\n1999-10-13T13:30:00Z,130.6875,131.3125,128.1875,128.1875,10469301,499.9491299\n1999-10-14T13:30:00Z,128.48437,129.1875,126.75,128.15625,10562199,497.5426082\n1999-10-15T13:30:00Z,126,126.75,124.5,124.875,14238699,467.9855652\n1999-10-18T13:30:00Z,124.9375,125.9375,123.4375,125.78125,9758801,471.3673243\n1999-10-19T13:30:00Z,127.1875,128.25,125.9375,127,14392898,479.2906774\n1999-10-20T13:30:00Z,127.75,129.46875,127.125,128.25,9759398,488.4305559\n1999-10-21T13:30:00Z,127.21875,129,126.625,129,9105398,495.6034075\n1999-10-22T13:30:00Z,129.75,131.21875,129.5625,130.09375,8309602,505.5605028\n1999-10-25T13:30:00Z,129.3125,130.46875,128.75,129.4375,8114301,503.1973061\n1999-10-26T13:30:00Z,130.1875,130.6875,127.8125,127.8125,6256301,493.477884\n1999-10-27T13:30:00Z,128.375,130.3125,128.25,130.125,5433301,507.5743514\n1999-10-28T13:30:00Z,132.4375,134.85937,132.1875,134.5625,10509699,550.0050772\n1999-10-29T13:30:00Z,135.84375,137.6875,135.71875,137,10988602,572.5106292\n1999-11-01T14:30:00Z,136.5,137,135.5625,135.5625,4006500,564.0954002\n1999-11-02T14:30:00Z,135.96875,137.25,134.59375,134.59375,6516898,557.1971738\n1999-11-03T14:30:00Z,136,136.375,135.125,135.5,7221301,559.0682347\n1999-11-04T14:30:00Z,136.75,137.35937,135.76562,136.53125,7910000,564.0697114\n1999-11-05T14:30:00Z,138.625,139.10937,136.78125,137.875,7431500,569.9427769\n1999-11-08T14:30:00Z,137,138.375,136.75,138,4649199,571.6399751\n1999-11-09T14:30:00Z,138.5,138.6875,136.28125,136.70312,4533699,563.7728722\n1999-11-10T14:30:00Z,136.25,138.39062,136.07812,137.71875,6405602,568.7405072\n1999-11-11T14:30:00Z,138.1875,138.5,137.46875,138.5,4794102,573.2959803\n1999-11-12T14:30:00Z,139.25,139.98437,137.125,139.75,11802898,578.2800768\n1999-11-15T14:30:00Z,139.84375,140.25,139.40625,140.07812,2187500,580.1197704\n1999-11-16T14:30:00Z,140.5625,143,140.09375,141.25,7544801,589.7905978\n1999-11-17T14:30:00Z,142.25,142.9375,141.3125,141.5625,9458102,590.6018959\n1999-11-18T14:30:00Z,142.4375,143,141.625,142.625,4491000,596.206011\n1999-11-19T14:30:00Z,142.40625,142.96875,142,142.49609,4832102,596.063261\n1999-11-22T14:30:00Z,142.4375,143,141.5,142.46875,4155398,596.1071989\n1999-11-23T14:30:00Z,142.84375,142.84375,140.375,141.21875,5917898,585.2504116\n1999-11-24T14:30:00Z,140.75,142.4375,140,142.0625,4458102,588.1800991\n1999-11-26T14:30:00Z,142.46875,142.875,141.25,141.375,1693400,585.8238491\n1999-11-29T14:30:00Z,140.875,141.92187,140.4375,140.9375,7348602,583.5582177\n1999-11-30T14:30:00Z,140.75,142.3125,139,139.39062,7681898,575.5136995\n1999-12-01T14:30:00Z,139.3125,140.5,139,140.40625,6980199,580.1214061\n1999-12-02T14:30:00Z,140.625,141.375,140.375,141.25,6698301,586.919\n1999-12-03T14:30:00Z,143.03125,145.34375,143.03125,143.84375,10044898,610.9578809\n1999-12-06T14:30:00Z,143.53125,143.71875,142.25,142.78125,3138800,603.868565\n1999-12-07T14:30:00Z,143.28125,143.3125,141.375,141.625,10714000,594.8856261\n1999-12-08T14:30:00Z,141.34375,142.0625,140.5,140.71875,4611199,589.0772022\n1999-12-09T14:30:00Z,141.8125,142.21875,139.375,141.40625,6474699,590.1025928\n1999-12-10T14:30:00Z,142.28125,142.8125,140.875,141.875,5127301,590.8097588\n1999-12-13T14:30:00Z,141.4375,142.71875,141.28125,142.125,4210801,592.496188\n1999-12-14T14:30:00Z,141.625,142.48437,140.625,140.75,5739000,584.924054\n1999-12-15T14:30:00Z,140.375,142.20312,140.03125,141.48437,6879000,588.9901582\n1999-12-16T14:30:00Z,142.1875,142.65625,141.15625,142.125,5854801,592.6442526\n1999-12-17T14:30:00Z,143,143.3125,142.0625,142.6875,4775398,594.9349547\n1999-12-20T14:30:00Z,142.5625,143.1875,141.09375,141.65625,4608699,587.7688127\n1999-12-21T14:30:00Z,141.59375,144.0625,141.34375,143.8125,7981301,603.2865721\n1999-12-22T14:30:00Z,143.625,144.1875,142.96875,144.1875,5377500,606.8873774\n1999-12-23T14:30:00Z,145.01562,146.48437,145,146.48437,5721699,629.3039651\n1999-12-27T14:30:00Z,146.5,146.78125,145.0625,146.28125,2691000,629.5369707\n1999-12-28T14:30:00Z,145.875,146.5,145.48437,146.1875,4084500,629.5733245\n1999-12-29T14:30:00Z,146.3125,146.8125,145.3125,146.8125,3001000,632.876233\n1999-12-30T14:30:00Z,147.125,147.5625,146.1875,146.64062,3641300,631.9728892\n1999-12-31T14:30:00Z,146.84375,147.5,146.25,146.875,3172700,632.477881\n2000-01-03T14:30:00Z,148.25,148.25,143.875,145.4375,8164301,620.3455281\n2000-01-04T14:30:00Z,143.53125,144.0625,139.64062,139.75,8089801,568.7268493\n2000-01-05T14:30:00Z,139.9375,141.53125,137.25,140,12177898,566.7416102\n2000-01-06T14:30:00Z,139.625,141.5,137.75,137.75,6227199,554.8964338\n2000-01-07T14:30:00Z,140.3125,145.75,140.0625,145.75,8066602,624.9819039\n2000-01-10T14:30:00Z,146.25,146.90625,145.03125,146.25,5741602,629.1363046\n2000-01-11T14:30:00Z,145.8125,146.09375,143.5,144.3125,7433699,611.8482929\n2000-01-12T14:30:00Z,144.59375,144.59375,142.875,143.0625,6911699,601.590014\n2000-01-13T14:30:00Z,144.46875,145.75,143.28125,145,5158301,611.916325\n2000-01-14T14:30:00Z,146.53125,147.46875,145.96875,146.96875,7437301,628.8263515\n2000-01-18T14:30:00Z,145.34375,146.625,145.1875,145.8125,6488500,623.5635674\n2000-01-19T14:30:00Z,145.3125,146.46875,145,146.25,6152898,626.840584\n2000-01-20T14:30:00Z,146.96875,146.96875,143.8125,144.75,5800102,616.1695011\n2000-01-21T14:30:00Z,145.5,145.5,144.0625,144.4375,6244801,612.8790599\n2000-01-24T14:30:00Z,145.65625,145.84375,139.40625,140.34375,7896898,579.9677655\n2000-01-25T14:30:00Z,140.51562,141.9375,139,141.9375,9942500,582.2482057\n2000-01-26T14:30:00Z,141,141.54687,140.09375,140.8125,5158102,577.2839219\n2000-01-27T14:30:00Z,141.84375,142.21875,138.125,140.25,10919898,571.5793229\n2000-01-28T14:30:00Z,139.4375,140.0625,135.53125,135.875,11916199,533.0972928\n2000-01-31T14:30:00Z,135.8125,139.67187,135,139.625,10768602,553.4281635\n2000-02-01T14:30:00Z,139.75,141.6875,138.53125,140.9375,8419801,562.3976858\n2000-02-02T14:30:00Z,141.28125,142.25,140.375,141.0625,6205898,563.5779916\n2000-02-03T14:30:00Z,140.875,143.25,140,143.1875,7997500,576.9266544\n2000-02-04T14:30:00Z,143.1875,144,142.125,142.59375,4925398,576.0807149\n2000-02-07T14:30:00Z,142.5625,142.78125,141.4375,142.375,5845801,573.8484259\n2000-02-08T14:30:00Z,143.96875,144.5625,143.625,144.3125,4936500,591.3696638\n2000-02-09T14:30:00Z,144.46875,144.46875,141.26562,141.28125,8511500,565.0894591\n2000-02-10T14:30:00Z,141.625,142.5625,140.875,141.5625,6690602,563.3267331\n2000-02-11T14:30:00Z,141.84375,141.9375,138.03125,138.6875,9849199,538.178887\n2000-02-14T14:30:00Z,139.78125,139.78125,138.3125,139.5,8528801,537.8240805\n2000-02-15T14:30:00Z,139.25,141.21875,137.79687,141.09375,11078301,545.3460042\n2000-02-16T14:30:00Z,140.375,140.9375,138.79687,139.1875,8845398,534.4224517\n2000-02-17T14:30:00Z,140.4375,140.4375,138.21875,138.28125,7584199,527.3378243\n2000-02-18T14:30:00Z,138.875,138.875,134.625,135.3125,9650898,502.1004543\n2000-02-22T14:30:00Z,135.1875,136.34375,133.53125,134.96875,16415398,498.0606996\n2000-02-23T14:30:00Z,135.625,137.46875,134.5,136.5625,12119000,508.4369916\n2000-02-24T14:30:00Z,136.6875,137.03125,133.09375,133.8125,17375008,487.8940667\n2000-02-25T14:30:00Z,135.1875,136.71875,133.125,133.32812,10559898,478.9107216\n2000-02-28T14:30:00Z,133.375,136.6875,132.71875,136.125,13397801,496.4660848\n2000-02-29T14:30:00Z,136.0625,137.4375,135.75,137.4375,8242500,505.7485683\n2000-03-01T14:30:00Z,137.625,139,137.21875,138.4375,6866000,513.7908477\n2000-03-02T14:30:00Z,138.6875,139.125,137.34375,138.53125,7600199,514.5444156\n2000-03-03T14:30:00Z,140.4375,141.71875,139.71875,141.125,12770301,536.4762127\n2000-03-06T14:30:00Z,140.8125,141.34375,138.75,139.8125,11966898,527.6705983\n2000-03-07T14:30:00Z,140,140.15625,135.21875,137.04687,20061808,502.8079227\n2000-03-08T14:30:00Z,136.46875,137.84375,135.03125,136.875,11808398,500.2994989\n2000-03-09T14:30:00Z,137.25,140.875,136.125,140.875,5500898,530.7745392\n2000-03-10T14:30:00Z,140.1875,142,139.53125,140.1875,7924500,531.3188823\n2000-03-13T14:30:00Z,136.6875,140.46875,136.5,138.59375,10540398,527.5987175\n2000-03-14T14:30:00Z,139.28125,140.09375,136.15625,136.625,8263699,517.8648956\n2000-03-15T14:30:00Z,136.875,140.4375,136.0625,139.8125,10300801,536.7426814\n2000-03-16T14:30:00Z,141.625,146.84375,140.875,146.34375,25601392,595.209879\n2000-03-17T14:30:00Z,145.8125,148,145.4375,146.9375,10272898,601.6715016\n2000-03-20T14:30:00Z,146.875,147.34375,144.78125,146.78125,12502102,602.0417368\n2000-03-21T14:30:00Z,145.53125,149.75,144.5,149.1875,13612801,616.8579984\n2000-03-22T14:30:00Z,149.5625,150.84375,148.6875,150.09375,8259801,623.8907393\n2000-03-23T14:30:00Z,149.15625,153.46875,149.15625,152.5,11653898,643.8723408\n2000-03-24T14:30:00Z,152.875,155.75,151.71875,153.5625,11462898,653.2297846\n2000-03-27T14:30:00Z,153.375,153.78125,151.8125,151.9375,8798602,642.1326131\n2000-03-28T14:30:00Z,151.25,152.98437,150.59375,151.0625,6334301,638.0765421\n2000-03-29T14:30:00Z,151.5625,152.48437,149.65625,151.21875,6747500,637.883353\n2000-03-30T14:30:00Z,150.15625,151.92187,147.125,148.6875,9491898,620.3211475\n2000-03-31T14:30:00Z,149.625,152.3125,148.4375,150.375,9249102,629.3753026\n2000-04-03T13:30:00Z,150.125,151.25,148.6875,151.25,8508199,635.6075469\n2000-04-04T13:30:00Z,151.75,153,141.39062,145.75,21056400,593.0153024\n2000-04-05T13:30:00Z,147.875,150.8125,147.625,149.1875,8227898,607.6051461\n2000-04-06T13:30:00Z,150.25,151.6875,149,150.48437,6378500,616.6319855\n2000-04-07T13:30:00Z,151.5625,152.125,150.5,151.4375,6023602,622.3865232\n2000-04-10T13:30:00Z,151.75,153.10937,150.3125,150.84375,9624199,618.4031242\n2000-04-11T13:30:00Z,150,151.625,148.375,150.40625,9006398,616.3573904\n2000-04-12T13:30:00Z,150.375,151.15625,146.15625,146.28125,10779699,584.7508628\n2000-04-13T13:30:00Z,147.46875,148.15625,141.125,144.25,12226801,566.090089\n2000-04-14T13:30:00Z,142.625,142.8125,133.5,138.375,29603808,511.4972177\n2000-04-17T13:30:00Z,135.1875,140.75,134.6875,140.75,23918192,524.7390625\n2000-04-18T13:30:00Z,140.5625,144.46875,139.78125,144.46875,10955699,551.7454089\n2000-04-19T13:30:00Z,144.5,145.125,142.53125,143.125,6553699,548.1682413\n2000-04-20T13:30:00Z,143.5625,143.9375,142.375,143.8125,8537602,549.4169605\n2000-04-24T13:30:00Z,141.5,143.3125,140.5,142.25,12893102,541.9638355\n2000-04-25T13:30:00Z,144.625,148.15625,144.4375,148.15625,14102000,599.9881275\n2000-04-26T13:30:00Z,147.96875,148.75,146,146.48437,7711102,594.3076561\n2000-04-27T13:30:00Z,143,147.34375,143,146,15595301,597.2846872\n2000-04-28T13:30:00Z,147,147.85937,145.0625,145.09375,8743398,593.6499004\n2000-05-01T13:30:00Z,146.5625,148.48437,145.84375,147.0625,7328301,604.2218991\n2000-05-02T13:30:00Z,145.5,147.125,144.125,144.125,9411898,583.6593991\n2000-05-03T13:30:00Z,144,144,139.78125,141.625,12180699,559.9962339\n2000-05-04T13:30:00Z,142,142.35937,140.75,141.8125,5963602,558.7550964\n2000-05-05T13:30:00Z,141.0625,144,140.9375,143.53125,7862398,571.5338338\n2000-05-08T13:30:00Z,142.75,143.375,141.84375,142.45312,5064102,568.6472851\n2000-05-09T13:30:00Z,143.0625,143.40625,140.26562,141.3125,5619801,559.759769\n2000-05-10T13:30:00Z,140.5,140.96875,137.75,138.125,10293898,531.7686976\n2000-05-11T13:30:00Z,140.125,141.5,139.125,141.28125,7091102,550.8670928\n2000-05-12T13:30:00Z,141.8125,143.46875,141.625,142.8125,5960801,564.6316585\n2000-05-15T13:30:00Z,142.75,145.60937,142,145.28125,4441301,582.6782874\n2000-05-16T13:30:00Z,146.5625,147.71875,145.3125,146.5625,8192000,592.2241234\n2000-05-17T13:30:00Z,145.6875,146.1875,144.46875,145.15625,5906898,580.7471127\n2000-05-18T13:30:00Z,145.625,146.3125,143.8125,143.8125,4325301,573.1461529\n2000-05-19T13:30:00Z,142.5625,143.23437,140.40625,141.125,6518398,550.1334522\n2000-05-22T13:30:00Z,141.25,141.46875,137,140.0625,10839398,539.370406\n2000-05-23T13:30:00Z,140.4375,140.8125,137.5625,138,7979199,523.6077408\n2000-05-24T13:30:00Z,138,140.6875,136.5,140.25,11084500,533.2919326\n2000-05-25T13:30:00Z,140.6875,141.8125,137.71875,137.84375,8278898,522.1964785\n2000-05-26T13:30:00Z,138.8125,139.6875,137.32812,138,4814000,518.5899124\n2000-05-30T13:30:00Z,140,142.9375,139.46875,142.71875,5362602,559.7357457\n2000-05-31T13:30:00Z,142.5625,144,142.09375,142.8125,6056500,562.5179162\n2000-06-01T13:30:00Z,143.6875,145.4375,143,145.3125,8961602,583.8658078\n2000-06-02T13:30:00Z,148.9375,149.09375,147.48437,147.84375,8962199,602.0815126\n2000-06-05T13:30:00Z,147.46875,148.21875,146.875,147.125,6998102,597.7233075\n2000-06-06T13:30:00Z,146.625,147.78125,145.90625,146.46875,4858898,594.5368347\n2000-06-07T13:30:00Z,146.625,148,146,147.48437,4919500,601.137015\n2000-06-08T13:30:00Z,147.5,147.75,146.0625,146.90625,5723102,598.0531492\n2000-06-09T13:30:00Z,147.5,147.96875,145.625,146.59375,3085300,595.1161145\n2000-06-12T13:30:00Z,146.96875,146.96875,144.875,144.875,3436800,581.2633946\n2000-06-13T13:30:00Z,144.8125,147.75,144.625,147.59375,6551500,598.9243288\n2000-06-14T13:30:00Z,148.25,148.875,147.1875,147.84375,6407102,601.4185655\n2000-06-15T13:30:00Z,148.125,148.75,146.84375,148.15625,5776199,602.1238184\n2000-06-16T13:30:00Z,148.3125,148.3125,145.875,146.59375,5526199,588.0482143\n2000-06-19T13:30:00Z,146.46875,149.15625,146.25,148.46875,5090500,599.788005\n2000-06-20T13:30:00Z,148.1875,148.875,147,147.9375,5662301,599.1840782\n2000-06-21T13:30:00Z,146.9375,148.4375,146.89062,147.84375,3112700,600.3910356\n2000-06-22T13:30:00Z,147.5625,147.6875,145,145.625,7486500,582.8032215\n2000-06-23T13:30:00Z,145.8125,146.125,143.875,144.375,4469898,572.9907215\n2000-06-26T13:30:00Z,145.375,146.25,144.875,146.23437,5194801,584.3864695\n2000-06-27T13:30:00Z,145.98437,146.71875,145.01562,145.15625,4076600,579.3135505\n2000-06-28T13:30:00Z,145.625,146.98437,145.3125,145.5625,5320102,580.2942141\n2000-06-29T13:30:00Z,144.75,145.75,143.51562,144.1875,6339199,570.7883255\n2000-06-30T13:30:00Z,143.9375,145.59375,143.89062,145.28125,7396602,578.5345969\n2000-07-03T13:30:00Z,145.4375,147.4375,145.1875,147.28125,1431900,595.5126227\n2000-07-05T13:30:00Z,146.375,146.65625,144.375,144.625,2714800,577.2556494\n2000-07-06T13:30:00Z,144.9375,146.46875,144.21875,145.75,5382898,581.9454205\n2000-07-07T13:30:00Z,146.6875,148.78125,146.25,148.09375,3021300,602.576965\n2000-07-10T13:30:00Z,147.875,148.90625,147.53125,147.84375,2814500,602.8297224\n2000-07-11T13:30:00Z,147.46875,149.125,147.15625,148.15625,5420699,605.4567913\n2000-07-12T13:30:00Z,149.28125,150.125,148.6875,149.125,5800699,612.4294475\n2000-07-13T13:30:00Z,149.98437,150.375,149.1875,149.78125,5354102,615.6321028\n2000-07-14T13:30:00Z,150.4375,151.25,149.67187,151.25,5335199,625.9124557\n2000-07-17T13:30:00Z,150.98437,151.98437,150.6875,151,3933000,625.7929365\n2000-07-18T13:30:00Z,150.625,150.625,149.34375,149.76562,4245602,614.1233692\n2000-07-19T13:30:00Z,149.46875,149.90625,148.25,148.6875,8294199,605.600009\n2000-07-20T13:30:00Z,149,150.625,148.8125,150.625,4283000,620.5425207\n2000-07-21T13:30:00Z,149.75,149.75,147.6875,147.6875,5370398,598.0374804\n2000-07-24T13:30:00Z,148.125,148.85937,146.5625,146.84375,5625301,592.8291601\n2000-07-25T13:30:00Z,147.75,147.84375,146.78125,147.3125,4488801,592.5113634\n2000-07-26T13:30:00Z,146.96875,147.15625,145.64062,145.875,11773301,579.6655342\n2000-07-27T13:30:00Z,145.9375,146.625,144.6875,145.375,7640000,576.1250638\n2000-07-28T13:30:00Z,145.71875,145.90625,141.51562,142.09375,6217102,548.2610363\n2000-07-31T13:30:00Z,142.9375,144.125,142.0625,142.90625,5235000,547.7933143\n2000-08-01T13:30:00Z,143.625,144.71875,143.125,143.875,3939600,554.9833114\n2000-08-02T13:30:00Z,143.875,145.40625,143.625,144.59375,7432898,560.9039285\n2000-08-03T13:30:00Z,142.875,145.8125,142.625,145.59375,4544801,570.1824051\n2000-08-04T13:30:00Z,146.3125,146.71875,145.40625,146.375,3679600,575.4489493\n2000-08-07T13:30:00Z,146.71875,148.4375,146.375,148.125,4134500,590.7626241\n2000-08-08T13:30:00Z,147.5,148.8125,147.5,148.6875,3591700,594.6560366\n2000-08-09T13:30:00Z,149.14062,149.21875,147.375,147.4375,5350898,587.7402729\n2000-08-10T13:30:00Z,147.53125,147.85937,146.28125,146.71875,4188398,582.147774\n2000-08-11T13:30:00Z,146.625,148,145.5625,147.32812,5080898,584.4458513\n2000-08-14T13:30:00Z,147.78125,149.5625,147.0625,149.28125,2917200,599.4708602\n2000-08-15T13:30:00Z,149.34375,149.8125,148.5625,149.15625,5547602,599.9028013\n2000-08-16T13:30:00Z,149.3125,149.9375,147.84375,148.625,5136898,596.3700686\n2000-08-17T13:30:00Z,148.6875,150.4375,148.34375,150.1875,5612801,607.0731936\n2000-08-18T13:30:00Z,150.375,150.375,149.21875,149.6875,4620801,605.2197179\n2000-08-21T13:30:00Z,150.03125,150.71875,149.40625,150.5625,2359900,609.4261324\n2000-08-22T13:30:00Z,150.5625,151.3125,150.09375,150.3125,3017900,608.5861757\n2000-08-23T13:30:00Z,149.8125,151.28125,149.28125,150.84375,5477500,611.6623476\n2000-08-24T13:30:00Z,151.15625,151.54687,150.5,151.3125,4522398,614.3727382\n2000-08-25T13:30:00Z,151.15625,151.625,150.9375,151.25,2820400,614.448343\n2000-08-28T13:30:00Z,151.25,152.90625,151.25,151.76562,5497398,619.3592707\n2000-08-29T13:30:00Z,151.4375,151.875,150.90625,151.79687,3528200,621.022181\n2000-08-30T13:30:00Z,151.3125,151.5,150.34375,150.34375,3948600,608.9891591\n2000-08-31T13:30:00Z,151.0625,153.09375,150.90625,152.34375,4820801,624.1953911\n2000-09-01T13:30:00Z,153.25,153.59375,152,152.375,3152900,623.8446258\n2000-09-05T13:30:00Z,151.875,152.20312,150.8125,151.28125,3450400,614.5740188\n2000-09-06T13:30:00Z,151.1875,151.78125,149.53125,149.78125,4164102,603.850281\n2000-09-07T13:30:00Z,150.25,151.07812,149.82812,150.84375,4078800,608.8772187\n2000-09-08T13:30:00Z,150.28125,150.5,149.32812,149.8125,3476100,601.7851257\n2000-09-11T13:30:00Z,149.75,151.1875,148.6875,149.59375,3933800,600.4255175\n2000-09-12T13:30:00Z,149.75,150.25,148.4375,148.46875,4742500,593.3819059\n2000-09-13T13:30:00Z,148,149.34375,147.65625,148.89062,4555102,594.8714283\n2000-09-14T13:30:00Z,149.875,149.9375,148.15625,148.46875,3391400,591.9251755\n2000-09-15T13:30:00Z,148.1875,148.25,146.03125,146.09375,4075700,570.4726883\n2000-09-18T13:30:00Z,146.375,146.96875,144.20312,144.65625,5104301,560.340319\n2000-09-19T13:30:00Z,145.125,146.3125,144.70312,145.96875,6547801,566.8884586\n2000-09-20T13:30:00Z,145.6875,146.03125,143.15625,144.89062,6498500,559.6791595\n2000-09-21T13:30:00Z,144.46875,145.5625,143.75,145.1875,5346602,561.2987415\n2000-09-22T13:30:00Z,142.625,145.3125,142.42187,145.28125,7587398,570.3151732\n2000-09-25T13:30:00Z,145.9375,146.0625,143.71875,144.15625,9715398,565.9269833\n2000-09-26T13:30:00Z,144.375,145,142.40625,142.40625,5281199,554.4833779\n2000-09-27T13:30:00Z,143.5625,143.96875,142.125,143.15625,6049301,554.7120045\n2000-09-28T13:30:00Z,143.1875,146.32812,142.89062,146.125,6842801,578.9999164\n2000-09-29T13:30:00Z,145.46875,145.96875,143.625,143.625,8311699,565.6954609\n2000-10-02T13:30:00Z,144.28125,144.90625,143.14062,143.84375,5517801,564.037707\n2000-10-03T13:30:00Z,144.53125,145.75,142.28125,142.5,9347199,555.8175241\n2000-10-04T13:30:00Z,142.875,144.25,141.75,143.6875,6149000,559.7663878\n2000-10-05T13:30:00Z,143.40625,144.84375,143.3125,144.1875,4566898,564.3236794\n2000-10-06T13:30:00Z,143.875,144.64062,139.75,141.0625,10014898,540.6791429\n2000-10-09T13:30:00Z,141.3125,141.3125,139.375,140,4508000,531.0059736\n2000-10-10T13:30:00Z,140.09375,141.25,137.6875,137.6875,6104699,516.7269826\n2000-10-11T13:30:00Z,137.625,138.625,135.125,136.53125,10366000,507.7277266\n2000-10-12T13:30:00Z,137.28125,137.59375,132.78125,133.125,12336801,481.1940285\n2000-10-13T13:30:00Z,132.9375,137.65625,132.875,137.5625,11776801,508.9821472\n2000-10-16T13:30:00Z,137.40625,138.23437,136.6875,138.1875,5659000,513.3761221\n2000-10-17T13:30:00Z,138.4375,138.5625,134.40625,134.75,7831699,485.7550073\n2000-10-18T13:30:00Z,132.625,136.125,130.15625,134.25,10897301,483.2159448\n2000-10-19T13:30:00Z,136.84375,139.45312,136.4375,139.28125,8767301,531.1513162\n2000-10-20T13:30:00Z,138.375,141.1875,138.375,139.90625,7373500,538.1147865\n2000-10-23T13:30:00Z,139.9375,141.03125,138.9375,140.53125,5290000,541.8189466\n2000-10-24T13:30:00Z,140.96875,141.9375,139,139.59375,5750699,537.2397338\n2000-10-25T13:30:00Z,138.75,139.5625,136.125,136.3125,9136102,509.5825193\n2000-10-26T13:30:00Z,137.125,137.65625,134.03125,136.6875,9345801,508.0567755\n2000-10-27T13:30:00Z,137.875,139.28125,136.625,139.28125,9762898,526.7405679\n2000-10-30T14:30:00Z,138.4375,141.09375,138.15625,140.53125,10154102,535.8622648\n2000-10-31T14:30:00Z,141.01562,143.6875,140.0625,142.95312,7752398,554.4743084\n2000-11-01T14:30:00Z,142.25,143.25,141.21875,142.46875,6753602,554.9456262\n2000-11-02T14:30:00Z,143.15625,143.90625,142.51562,142.70312,11395102,555.3278935\n2000-11-03T14:30:00Z,143.46875,143.75,142.375,142.78125,5187102,553.6621082\n2000-11-06T14:30:00Z,143.15625,144.29687,143.03125,143.78125,4042500,560.5771466\n2000-11-07T14:30:00Z,143.14062,144,142.5625,143.75,5231301,562.630812\n2000-11-08T14:30:00Z,144.0625,144.0625,140.5625,140.5625,6123301,536.5299755\n2000-11-09T14:30:00Z,140,141.21875,137.25,140.03125,10635301,530.5861751\n2000-11-10T14:30:00Z,139,139.46875,136.53125,136.625,8569500,499.4950734\n2000-11-13T14:30:00Z,135.625,136.98437,133.01562,135.5625,17285296,491.1514724\n2000-11-14T14:30:00Z,137.46875,139.625,137,139.125,7668898,524.2183328\n2000-11-15T14:30:00Z,139.0625,140.10937,137.75,139.5625,8837699,527.6316312\n2000-11-16T14:30:00Z,139.5625,139.875,137.3125,137.375,6684102,511.1163696\n2000-11-17T14:30:00Z,137.3125,139,135.75,136.64062,6551102,506.7905394\n2000-11-20T14:30:00Z,135.75,136.375,134.3125,134.6875,5458500,490.4600427\n2000-11-21T14:30:00Z,134.875,136.1875,133.51562,135.375,7684301,492.6043209\n2000-11-22T14:30:00Z,134.34375,134.875,132.125,132.14062,5736898,465.2331784\n2000-11-24T14:30:00Z,133.625,134.96875,133.625,134.84375,3411600,483.7469542\n2000-11-27T14:30:00Z,136.46875,136.6875,135.3125,136.03125,5992000,491.4135677\n2000-11-28T14:30:00Z,135.125,136.59375,133.64062,133.6875,5336102,475.9385327\n2000-11-29T14:30:00Z,134.375,135.90625,133.26562,133.4375,6914102,470.9550205\n2000-11-30T14:30:00Z,132.5,133.5,129.75,132.28125,11201602,462.2785499\n2000-12-01T14:30:00Z,133.1875,134.0625,131,132.21875,7587199,460.1301124\n2000-12-04T14:30:00Z,131.875,133.875,131.5,133.34375,6996398,466.526451\n2000-12-05T14:30:00Z,134.875,138.25,134.40625,137.71875,8883398,506.3846805\n2000-12-06T14:30:00Z,137.78125,138.34375,135.03125,135.51562,12888000,495.4259114\n2000-12-07T14:30:00Z,134.875,135.875,133.65625,133.65625,6529102,482.7617454\n2000-12-08T14:30:00Z,137.0625,139.125,133.875,133.96875,10276102,473.4742992\n2000-12-11T14:30:00Z,137.375,139.5625,136.71875,138.625,6405602,505.0430957\n2000-12-12T14:30:00Z,138.1875,138.8125,137.375,138.03125,5022898,503.438743\n2000-12-13T14:30:00Z,139.25,139.40625,136.03125,136.14062,6070500,490.6812785\n2000-12-14T14:30:00Z,135.875,136.5,134.03125,134.40625,7778398,477.4977363\n2000-12-15T14:30:00Z,133.125,133.125,130.5625,130.96875,9065301,444.6429257\n2000-12-18T14:30:00Z,132.0625,133.46875,131.76562,132.71875,7235398,453.7497958\n2000-12-19T14:30:00Z,132.46875,134.96875,130.01562,130.01562,9616699,441.3174486\n2000-12-20T14:30:00Z,128.625,128.9375,126.09375,126.25,9994199,407.1736147\n2000-12-21T14:30:00Z,126,128.85937,125.53125,127.125,14331500,410.6822342\n2000-12-22T14:30:00Z,129,131.10937,128.84375,130.9375,10182898,447.693065\n2000-12-26T14:30:00Z,130.84375,132.34375,130.28125,132.34375,4665301,456.8056512\n2000-12-27T14:30:00Z,132,133.73437,131.25,133.3125,4854102,462.884875\n2000-12-28T14:30:00Z,132.8125,133.875,132.59375,133.71875,8358699,466.1994988\n2000-12-29T14:30:00Z,134.0625,134.28125,131.1875,131.1875,8774602,448.369076\n2001-01-02T14:30:00Z,132,132.15625,127.5625,128.8125,8737398,428.3782671\n2001-01-03T14:30:00Z,128.3125,136,127.65625,135,19431600,471.3036144\n2001-01-04T14:30:00Z,134.9375,135.46875,133,133.54687,9219000,469.8649125\n2001-01-05T14:30:00Z,133.46875,133.625,129.1875,129.1875,12911398,430.8752725\n2001-01-08T14:30:00Z,129.875,130.1875,127.6875,130.1875,6625301,431.100929\n2001-01-09T14:30:00Z,131.04687,131.5,129.42187,129.84375,5702398,427.8018633\n2001-01-10T14:30:00Z,129,132.125,128.8125,132.125,8746102,441.7822362\n2001-01-11T14:30:00Z,131.09375,133.48437,131.09375,132.25,7245301,445.7582323\n2001-01-12T14:30:00Z,132.6875,133.71875,131.28125,132,7244000,444.732422\n2001-01-16T14:30:00Z,132,133.1875,131.51562,132.84375,8542199,449.1352172\n2001-01-17T14:30:00Z,134.84375,135.04687,132.64062,133.45312,7851398,449.7928255\n2001-01-18T14:30:00Z,133.4375,135.70312,132.9375,134.78125,8106898,457.2563866\n2001-01-19T14:30:00Z,136.1875,136.1875,133.875,134.01562,7782500,452.2266327\n2001-01-22T14:30:00Z,134.25,135.78125,133.5625,134.90625,7050898,454.9269116\n2001-01-23T14:30:00Z,134.46875,136.65625,134.15625,135.96875,8463102,463.041831\n2001-01-24T14:30:00Z,136.25,137.3125,135.84375,136.375,6199898,466.8851837\n2001-01-25T14:30:00Z,136.25,137.25,135.65625,136.03125,10818301,465.4654121\n2001-01-26T14:30:00Z,135.15625,136.125,134.45312,135.875,7136801,466.3133867\n2001-01-29T14:30:00Z,135.5,136.89999,135.37,136.60001,6705898,471.764179\n2001-01-30T14:30:00Z,136.3,137.92,135.78999,137.8,7069102,479.3965922\n2001-01-31T14:30:00Z,137.39999,138.7,136.60001,137.02,9706898,477.5935848\n2001-02-01T14:30:00Z,137.10001,137.95,136.25,137.92999,8239602,481.5764724\n2001-02-02T14:30:00Z,137.39999,137.99001,134.75,134.8,8276500,457.2337304\n2001-02-05T14:30:00Z,134.8,135.94,134.75,135.78999,4352898,460.4670423\n2001-02-06T14:30:00Z,135.3,136.7,135.22,135.39,7106699,460.1131371\n2001-02-07T14:30:00Z,134.72,135.39999,133.67999,134.69,5748699,455.8657127\n2001-02-08T14:30:00Z,134.8,135.39999,133.10001,133.12,5943301,445.454461\n2001-02-09T14:30:00Z,133.35001,133.35001,131.25999,131.84,9913000,434.0841984\n2001-02-12T14:30:00Z,131.7,133.5,131.7,133.35001,5804398,443.4110268\n2001-02-13T14:30:00Z,133.7,134.17,132,132.25999,6587602,438.8450357\n2001-02-14T14:30:00Z,132.64999,132.64999,130.66,132.06,8400102,435.2068021\n2001-02-15T14:30:00Z,132.84,133.52,132.5,133.34,5928602,444.2989521\n2001-02-16T14:30:00Z,131,131.28999,129.3,130.39999,6434898,419.2498266\n2001-02-20T14:30:00Z,131.03999,131.14,128.10001,128.39,5760000,403.545633\n2001-02-21T14:30:00Z,127.89999,128.84,125.5,125.62,10910801,382.9108554\n2001-02-22T14:30:00Z,126.35001,126.53999,123.02,125.81,21281600,380.3283193\n2001-02-23T14:30:00Z,125.08,125.53999,121.8,124.96001,20173008,373.7971433\n2001-02-26T14:30:00Z,125.8,127.62,124.5,127.62,11502602,392.4803817\n2001-02-27T14:30:00Z,126.8,127.84,125.50999,126.44,11415000,388.1950311\n2001-02-28T14:30:00Z,126.75,126.84,123.27,123.95,14831102,366.6502907\n2001-03-01T14:30:00Z,124.05,124.60001,121.75,124.60001,14672000,367.5218252\n2001-03-02T14:30:00Z,122.5,125.64999,122.3,123.61,12564301,366.2955319\n2001-03-05T14:30:00Z,124.14999,124.78,123.81,124.74001,5293199,375.5346246\n2001-03-06T14:30:00Z,126.35001,127.75,125.49001,126.08,6917000,384.6788041\n2001-03-07T14:30:00Z,126.89999,127.03999,125.75999,126.98,6371699,388.5637397\n2001-03-08T14:30:00Z,126.60001,127.24001,126.14,127.12,6055000,390.532456\n2001-03-09T14:30:00Z,126.10001,126.10001,123.11,123.36,10020301,356.0110781\n2001-03-12T14:30:00Z,122.34,122.5,117.75,118.08,13972898,307.6170621\n2001-03-13T14:30:00Z,119.39999,120.44,117.53,120.02,12887199,312.0142504\n2001-03-14T14:30:00Z,117.05,119.28999,115.75,117.64999,19883392,299.4263373\n2001-03-15T14:30:00Z,118.45,118.86,117.36,117.67999,10370301,298.4867104\n2001-03-16T14:30:00Z,117.13,117.39999,114.81,115.00999,58515392,274.4114619\n2001-03-19T14:30:00Z,115.75999,117.69,114.82001,117.35001,10067801,287.2451294\n2001-03-20T14:30:00Z,117.89999,118.46001,114.11,114.2,15086898,267.6136143\n2001-03-21T14:30:00Z,114.17999,115.25999,111.89999,112.25999,19004704,254.7816997\n2001-03-22T14:30:00Z,112.02,112.60001,108.03999,111.12,28625600,243.9492057\n2001-03-23T14:30:00Z,113.25,114.66,111.5,114.48,12861699,267.1572477\n2001-03-26T14:30:00Z,115.7,116.27,114.77,115.94,9943801,277.9723085\n2001-03-27T14:30:00Z,115.62,118.64999,115.28,118.31,12881199,296.6134202\n2001-03-28T14:30:00Z,116.89999,116.95,114.89999,115.03999,10953301,274.5178856\n2001-03-29T14:30:00Z,114.7,116.5,109.34,115.48,12061398,276.2232572\n2001-03-30T14:30:00Z,115.55,116.69,114.5,116.69,9183602,282.4857048\n2001-04-02T13:30:00Z,116.3,117.38,113.8,114.2,10561000,267.2739486\n2001-04-03T13:30:00Z,113.98,114.14999,110.06,110.39,12836000,233.089914\n2001-04-04T13:30:00Z,110.578,112.10001,109.3,110.85001,14884500,232.2184789\n2001-04-05T13:30:00Z,113.3,115.49001,112.5,115.05,21517600,270.6285985\n2001-04-06T13:30:00Z,113.991,114.39999,112.06,113.3,14937801,260.6418379\n2001-04-09T13:30:00Z,114,114.99001,112.78,114.56,9034301,266.7027351\n2001-04-10T13:30:00Z,115.45,117.75,115.17,116.64999,17873296,285.354909\n2001-04-11T13:30:00Z,118.78,118.99001,116.14,116.73,12722301,282.3602825\n2001-04-12T13:30:00Z,116.3,118.94,115.96001,118.85001,9233199,293.7603834\n2001-04-16T13:30:00Z,118.28999,118.89,116.91,117.60001,7348699,289.325012\n2001-04-17T13:30:00Z,117.31,119.66,117.02,119.25999,10924699,300.5976635\n2001-04-18T13:30:00Z,121.06,126,120.69,124,32491008,343.9194008\n2001-04-19T13:30:00Z,124.25,125.84,123.58,125.64999,13810398,355.7649191\n2001-04-20T13:30:00Z,124.89999,125.39999,123.66,124.5,7626699,350.1498617\n2001-04-23T13:30:00Z,123.64999,123.89,121.91,122.24001,8451801,329.3471886\n2001-04-24T13:30:00Z,122.52,123.64999,121.10001,121.58,10045301,324.846068\n2001-04-25T13:30:00Z,121.42,123.67,120.95,123.17,8249000,334.7037245\n2001-04-26T13:30:00Z,123.73,125.22,123.5,123.72,10590398,340.1238672\n2001-04-27T13:30:00Z,124.92,125.84,124.2,125.78,8048898,357.6321673\n2001-04-30T13:30:00Z,126.45,127.27,124.67,124.91,10764898,352.9180243\n2001-05-01T13:30:00Z,125.07001,127.14999,124.60001,127.05,10578102,366.011728\n2001-05-02T13:30:00Z,127.41,127.69,126,126.82001,9572898,365.9216625\n2001-05-03T13:30:00Z,126.13,126.14999,124.22,125.21001,9926199,350.9851115\n2001-05-04T13:30:00Z,123.64999,127.35001,123.44,127.34,12145301,363.0839644\n2001-05-07T13:30:00Z,126.86,127.38,126.23,126.24001,7185199,361.4521643\n2001-05-08T13:30:00Z,126.86,127.10001,125.56,126.17999,6952602,359.692145\n2001-05-09T13:30:00Z,125.25,126.55,125.06,125.64999,9507398,357.5837016\n2001-05-10T13:30:00Z,127.25999,127.5,125.77,126.02,6872398,356.6661156\n2001-05-11T13:30:00Z,126,126.49001,124.39999,125.14999,7736602,349.8949767\n2001-05-14T13:30:00Z,124.89999,125.44,124.46001,125.39999,7914000,350.9346453\n2001-05-15T13:30:00Z,125.55,126.5,124.85001,125.98,9782199,354.4981168\n2001-05-16T13:30:00Z,124.84,129.2,124.62,128.95,14916199,376.5336501\n2001-05-17T13:30:00Z,129.005,130.08,128.56,129.14999,11828898,380.1376321\n2001-05-18T13:30:00Z,129.09,129.74001,128.10001,129.74001,6683301,383.8617879\n2001-05-21T13:30:00Z,129.84,131.84,129.14999,131.64999,11532102,397.5617125\n2001-05-22T13:30:00Z,131.83,132.09,131.07001,131.48,8343199,397.8263675\n2001-05-23T13:30:00Z,131.05,131.05,129.25,129.25,12331000,376.4975179\n2001-05-24T13:30:00Z,129.47,130,128.55,129.63,7905398,376.522189\n2001-05-25T13:30:00Z,129.64999,129.7,127.89999,128.10001,7425000,363.2123495\n2001-05-29T13:30:00Z,128.226,128.35001,126.89999,127.08,9012301,355.1285869\n2001-05-30T13:30:00Z,126.59,127.09,125,125.3,10041801,340.29606\n2001-05-31T13:30:00Z,125.42999,126.75999,125.25999,125.95,9875199,343.2375944\n2001-06-01T13:30:00Z,126.2,127.10001,125.12,126.73,8848301,347.2401318\n2001-06-04T13:30:00Z,126.8,127.42999,126.08,127.34,5634699,350.2280941\n2001-06-05T13:30:00Z,127.49001,129.23,127.27,128.8,9115602,362.9145217\n2001-06-06T13:30:00Z,128.83,128.83,127.36,127.73,12064898,356.443012\n2001-06-07T13:30:00Z,127.05,128.35001,127,128.19,7355301,358.5628067\n2001-06-08T13:30:00Z,127.7,127.87,126.14,127,8170602,351.1698469\n2001-06-11T13:30:00Z,126.71001,126.99001,125.41,126.10001,7012199,343.3780221\n2001-06-12T13:30:00Z,124.86,126.74001,124.03999,125.88,9368500,343.9985965\n2001-06-13T13:30:00Z,126.17,126.58,124.64999,124.8,7629398,338.6859346\n2001-06-14T13:30:00Z,124.17999,124.3,121.75,122,12603301,313.011492\n2001-06-15T13:30:00Z,120.91,122.39999,120.39999,121.85001,16821296,312.1274679\n2001-06-18T13:30:00Z,121.64999,122.44,120.91,121.25999,11368801,310.2966563\n2001-06-19T13:30:00Z,122.38,122.89,120.89,121.78999,7732301,310.9644698\n2001-06-20T13:30:00Z,121.19,122.86,121.10001,122.42999,8787199,314.8648066\n2001-06-21T13:30:00Z,122.22,124.31,122.14999,123.82001,12259102,326.7576533\n2001-06-22T13:30:00Z,123.49001,123.599,122.16,122.85001,12212000,322.0211854\n2001-06-25T13:30:00Z,123.28,123.44,121.5,121.72,8406801,313.7041193\n2001-06-26T13:30:00Z,120.89999,122.39,120.571,121.55,8006398,312.9401728\n2001-06-27T13:30:00Z,121.60001,122.24001,120.91,121.48,10105102,313.0340732\n2001-06-28T13:30:00Z,122,123.94,121.92999,122.14999,10271000,317.8874152\n2001-06-29T13:30:00Z,122.8,124.00999,122.25999,122.60001,9824199,320.3324383\n2001-07-02T13:30:00Z,122.8,124.32001,122.62,124.13,8522301,333.4339364\n2001-07-03T13:30:00Z,123.98,124.10001,123.05,124.10001,3303100,335.184897\n2001-07-05T13:30:00Z,123.07001,123.64999,121.66,121.67999,5517801,314.2286343\n2001-07-06T13:30:00Z,121.31,121.49001,119.05,119.05,11666199,290.8057114\n2001-07-09T13:30:00Z,119.491,120.53999,119.2,119.7,8339301,291.6969821\n2001-07-10T13:30:00Z,120.28999,120.64,118.21001,118.25999,8630699,282.6827238\n2001-07-11T13:30:00Z,118.10001,118.89,117.09,118.38,15329699,281.8984154\n2001-07-12T13:30:00Z,119.5,121.47,119.31,121.19,12004801,308.5919519\n2001-07-13T13:30:00Z,120.84,122.32001,120.62,122.24001,10433602,315.820904\n2001-07-16T13:30:00Z,121.77,122.28,120.28999,120.71001,6915301,306.9146492\n2001-07-17T13:30:00Z,120.2,121.95,119.83,121.84,7470301,312.3899533\n2001-07-18T13:30:00Z,120.56,121.64,120.06,121.00999,7709301,311.351895\n2001-07-19T13:30:00Z,122.17999,122.98,120.75999,122.07001,10082898,317.250966\n2001-07-20T13:30:00Z,121.14999,121.94,120.92,121.34,6705801,312.9707321\n2001-07-23T13:30:00Z,121.8,121.88,118.95,118.95,8065199,294.0699944\n2001-07-24T13:30:00Z,119,119.2,116.75,117.8,12271000,283.3634726\n2001-07-25T13:30:00Z,117.92,119.48,117.46001,119.10001,12088898,290.5596922\n2001-07-26T13:30:00Z,119.06,120.85001,118.56,120.35001,12930000,299.8258784\n2001-07-27T13:30:00Z,120.83,121.35001,119.91,120.81,8481801,302.565194\n2001-07-30T13:30:00Z,121.19,121.35001,120.3,120.85001,8547699,302.1333661\n2001-07-31T13:30:00Z,121,122.67999,120.8,121.35001,11918602,305.5675544\n2001-08-01T13:30:00Z,121.97,122.7,121.55,122.11,11940801,311.3554423\n2001-08-02T13:30:00Z,123.23,123.25,121.89,122.61,11070199,312.5046358\n2001-08-03T13:30:00Z,122.36,122.36,120.89999,121.94,10816500,306.1474154\n2001-08-06T13:30:00Z,121.35001,121.50999,120.10001,120.3,8550398,291.0577379\n2001-08-07T13:30:00Z,120.27,121.2,119.911,120.77,8865102,292.7164033\n2001-08-08T13:30:00Z,120.12,121.16,118.42999,118.53,15183801,277.8096492\n2001-08-09T13:30:00Z,118.7,118.97,117.86,118.88,14118500,277.9277048\n2001-08-10T13:30:00Z,118.8,119.84,117.34,119.28999,11173301,280.5749958\n2001-08-13T13:30:00Z,119.60001,119.85001,118.819,119.32001,7435398,280.612978\n2001-08-14T13:30:00Z,120.14,120.35001,118.8,119.27,13178102,278.4075121\n2001-08-15T13:30:00Z,119.23,119.61,118.08,118.24001,8520602,270.9913564\n2001-08-16T13:30:00Z,117.8,118.75,117,118.64999,10734699,273.2707021\n2001-08-17T13:30:00Z,117.64999,117.87,116.00999,116.75,11604602,258.9484653\n2001-08-20T13:30:00Z,116.8,117.89999,116.55,117.83,10417398,265.2004561\n2001-08-21T13:30:00Z,117.8,118.53999,115.8,115.82001,14481398,253.5923178\n2001-08-22T13:30:00Z,116.75,117.42999,115.78,117.02,11752898,257.5328161\n2001-08-23T13:30:00Z,116.96001,117.52,116.49001,116.60001,8745301,255.9256581\n2001-08-24T13:30:00Z,117.21001,119.13,116.74001,119.02,11688301,275.985736\n2001-08-27T13:30:00Z,118.97,119.2,118.25999,118.31,7428102,273.9816724\n2001-08-28T13:30:00Z,118.28,118.49001,116.58,116.58,12046602,259.6779763\n2001-08-29T13:30:00Z,117.13,117.17999,115.17,115.53999,16181801,251.4987303\n2001-08-30T13:30:00Z,114.85001,115.74001,112.03999,113.32001,17693104,233.441037\n2001-08-31T13:30:00Z,113.39999,114.77,113.13,114.14999,15985699,237.1264133\n2001-09-04T13:30:00Z,113.85001,116.17,113.37,113.42,24475392,233.9252679\n2001-09-05T13:30:00Z,113.7,114.19,111.95,113.7,21477696,234.6003773\n2001-09-06T13:30:00Z,112.64999,113.3,110.77,110.77,21654096,208.6409328\n2001-09-07T13:30:00Z,110.02,111.25,108.63,108.72,33133904,194.9196542\n2001-09-10T13:30:00Z,107.7,110.35001,107.7,110.05,23408704,202.3848009\n2001-09-17T13:30:00Z,101,106.39999,100,104.3,32393808,177.3488825\n2001-09-18T13:30:00Z,104.33,105.3,103.36,104.05,22029200,178.3321555\n2001-09-19T13:30:00Z,104.10001,104.5,98.56,101.95,42772096,159.8056607\n2001-09-20T13:30:00Z,100.39999,101.81,98.569,98.71001,36212800,134.4246629\n2001-09-21T13:30:00Z,94.05,98.99001,93.8,97.28,49783504,133.1260539\n2001-09-24T13:30:00Z,99.729,101.16,99.06,100.7,25549808,163.2222356\n2001-09-25T13:30:00Z,100.75101,102,99.89999,101.75,25466192,169.4379771\n2001-09-26T13:30:00Z,102.35001,102.39999,100.42999,101.39,18587504,167.2441865\n2001-09-27T13:30:00Z,101.25,102.28999,100,102.27,20536800,171.1930533\n2001-09-28T13:30:00Z,102.98,109.92,102.5,104.44,21787696,190.5574226\n2001-10-01T13:30:00Z,103.89999,104.32001,102.83,104.27,20457600,192.55418\n2001-10-02T13:30:00Z,104,105.58,103.64999,105.58,19833600,201.4298306\n2001-10-03T13:30:00Z,104.60001,107.881,104.35001,107.35001,32070192,214.3972016\n2001-10-04T13:30:00Z,108.28999,108.97,106.75,107.44,32675504,215.6247131\n2001-10-05T13:30:00Z,107.25,107.62,105.521,107.23,29830192,213.3805978\n2001-10-08T13:30:00Z,106.27901,107.3,105.87,106.53,12971199,209.9479898\n2001-10-09T13:30:00Z,106.61,106.75,105.60001,105.96001,15976301,205.9592219\n2001-10-10T13:30:00Z,105.8,108.55,105.52,108.32001,19987392,223.4903825\n2001-10-11T13:30:00Z,108.95,110.3,108.95,110,23008608,238.7770462\n2001-10-12T13:30:00Z,109.14999,109.89,107.3,109.5,31361504,238.414328\n2001-10-15T13:30:00Z,108.63,109.45,108.06,109.3,16875008,239.7471195\n2001-10-16T13:30:00Z,109.8,110.619,108.95,109.99001,15883602,244.0228045\n2001-10-17T13:30:00Z,111.07001,111.14999,107.64999,107.64999,28601696,227.5217689\n2001-10-18T13:30:00Z,107.82001,108.16,106.75,107.42,16517398,224.3305863\n2001-10-19T13:30:00Z,107,107.91,106.00999,107.35001,21916096,224.3526726\n2001-10-22T13:30:00Z,107.3,109.57001,107.21001,109.47,17570896,243.0179583\n2001-10-23T13:30:00Z,109.96001,110.28,108.379,108.91,22064496,241.5040619\n2001-10-24T13:30:00Z,108.98,109.45,108.22,108.62,16065398,239.3875381\n2001-10-25T13:30:00Z,107.45,110.60001,106.74001,110.57001,27504000,250.1021962\n2001-10-26T13:30:00Z,109.95,111.78999,109.67,110.32001,18623296,251.9821468\n2001-10-29T14:30:00Z,110.16,110.55,107.45,107.45,18733808,228.7630228\n2001-10-30T14:30:00Z,107.35001,107.7,105.56,106.16,26197904,218.0196012\n2001-10-31T14:30:00Z,106.89999,107.86,105.8,105.8,28130496,212.5775451\n2001-11-01T14:30:00Z,106.60001,109.00999,105.69901,108.50999,29807296,231.543451\n2001-11-02T14:30:00Z,108.44,109.38,107.87,109.25,17577904,235.982442\n2001-11-05T14:30:00Z,110.12,111.09,109.95,110.67999,15991301,248.9771702\n2001-11-06T14:30:00Z,110.35001,112.48,109.85001,112.39999,23245904,260.6942952\n2001-11-07T14:30:00Z,111.77,113.12,111.64,112.25,19716800,262.1306155\n2001-11-08T14:30:00Z,112.87,114.08,111.89999,112.60001,22747808,263.7965796\n2001-11-09T14:30:00Z,112.25,112.96001,111.44,112.72,15897500,265.1095426\n2001-11-12T14:30:00Z,111,112.64999,110,112.03,26071600,264.7607462\n2001-11-13T14:30:00Z,113.44,114.55,113.17999,114.55,15347102,288.5912824\n2001-11-14T14:30:00Z,115.17,115.39999,113.71001,114.66,17591392,288.9490486\n2001-11-15T14:30:00Z,114.37,115.17999,113.92999,114.87,19472400,290.0503568\n2001-11-16T14:30:00Z,115.08,115.10001,113.39999,114.36,18135392,286.2998587\n2001-11-19T14:30:00Z,114.92,115.85001,114.45,115.77,13682500,295.7842871\n2001-11-20T14:30:00Z,115.37,115.8,114.64,114.8,16223000,290.4198745\n2001-11-21T14:30:00Z,114.50101,114.67,113.50999,114.03999,11471102,283.7398177\n2001-11-23T14:30:00Z,114.03999,115.75,114,115.67999,6716898,297.1747682\n2001-11-26T14:30:00Z,115.75,116.34,115.07001,115.92999,13729199,299.0163127\n2001-11-27T14:30:00Z,115.62,116.89999,114.09,115.42999,19266400,296.8008732\n2001-11-28T14:30:00Z,114.74001,115.17,113.25,113.34,20247200,278.3690391\n2001-11-29T14:30:00Z,113.662,114.92,113,114.87,17265104,286.1298126\n2001-11-30T14:30:00Z,114.39999,114.912,114.02,114.05,13680398,283.0464492\n2001-12-03T14:30:00Z,113.64999,114.08,113.00999,113.37,15220398,277.950363\n2001-12-04T14:30:00Z,113.918,115.3,113.35001,115.28999,17245808,293.0941939\n2001-12-05T14:30:00Z,115.61,118,115.56,117.39999,25204000,312.5276359\n2001-12-06T14:30:00Z,117.349,117.94,116.92999,117.34,17969200,313.4145433\n2001-12-07T14:30:00Z,116.89999,117.09,115.7,116.56,18908000,306.9815157\n2001-12-10T14:30:00Z,115.85001,116.39,114.35001,114.38,13862801,288.2314788\n2001-12-11T14:30:00Z,114.89999,115.72,113.89999,114.14999,20833296,284.5081665\n2001-12-12T14:30:00Z,114.55,114.78,113.11,114.28,16172398,283.8345875\n2001-12-13T14:30:00Z,113.45,113.7,112.03999,112.06,19031904,263.1381913\n2001-12-14T14:30:00Z,112.33,113.49001,112,113.13,16722699,268.5979787\n2001-12-17T14:30:00Z,112.99001,114.36,112.89999,114.3,13947301,277.9757228\n2001-12-18T14:30:00Z,114.63,115.14999,114.34,114.98,13663898,283.4029469\n2001-12-19T14:30:00Z,114.09,115.92,114,115.78999,20147392,288.7346259\n2001-12-20T14:30:00Z,115.5,115.8,114.55,114.64999,14867898,283.459999\n2001-12-21T14:30:00Z,115.03,115.07001,114.2,114.95,14042199,283.5834266\n2001-12-24T14:30:00Z,114.83,115.03999,114.61,114.73,5728801,282.2139517\n2001-12-26T14:30:00Z,114.64999,116.21001,114.64999,115.36,10307898,287.8164717\n2001-12-27T14:30:00Z,115.30099,116.08,115.259,116.06,9407301,293.4814888\n2001-12-28T14:30:00Z,116.28999,116.75,115.92,116,10593801,293.4170288\n2001-12-31T14:30:00Z,116.14999,116.39,114.23,114.3,14619500,280.0503797\n2002-01-02T14:30:00Z,115.11,115.75,113.81,115.53,18651904,283.7376328\n2002-01-03T14:30:00Z,115.64999,116.95,115.53999,116.84,15731801,295.4736431\n2002-01-04T14:30:00Z,117.17,117.98,116.55,117.62,20140608,300.8457513\n2002-01-07T14:30:00Z,117.7,117.99001,116.56,116.78999,13106500,295.8098605\n2002-01-08T14:30:00Z,116.798,117.06,115.97,116.52,12687000,293.3339758\n2002-01-09T14:30:00Z,116.67999,117.78,115.34,115.57001,16616898,288.393139\n2002-01-10T14:30:00Z,115.69501,116.35001,115.3,116.08,12823398,289.9538309\n2002-01-11T14:30:00Z,116.21001,116.28,114.7,114.94,13708398,281.3159159\n2002-01-14T14:30:00Z,114.64999,114.84,113.96001,114.22,12301301,275.1664048\n2002-01-15T14:30:00Z,114.55,115.39,113.89999,115.14999,20221392,280.3045277\n2002-01-16T14:30:00Z,114.3,114.39999,112.69,112.82001,17076704,260.2174035\n2002-01-17T14:30:00Z,113.75999,114.24001,113.39999,113.67,17391104,262.7911258\n2002-01-18T14:30:00Z,113,113.85001,112.67,113.14999,17028192,260.3612423\n2002-01-22T14:30:00Z,113.75,113.92999,112.02,112.37,11689801,255.1664009\n2002-01-23T14:30:00Z,112.63,113.55,112.02,113.23,12438898,258.3720675\n2002-01-24T14:30:00Z,113.64,114.25,113.32001,113.58,12162398,261.0354127\n2002-01-25T14:30:00Z,113.12,114.17999,113.03999,113.55,12810699,261.5873516\n2002-01-28T14:30:00Z,113.89999,114.19,112.92,113.86,10589500,262.7416311\n2002-01-29T14:30:00Z,113.851,114.13,110.05,110.28,27735296,231.444782\n2002-01-30T14:30:00Z,110.39,113.39,108.39999,111.87,34711808,236.1936664\n2002-01-31T14:30:00Z,112.14999,113.3,111.62,113.17999,19909200,245.7632874\n2002-02-01T14:30:00Z,113.09,113.3,112.17,112.64999,15838500,243.5226337\n2002-02-04T14:30:00Z,112.23,112.23,109.44901,109.85001,24243904,217.0714912\n2002-02-05T14:30:00Z,109.39999,110.49899,108.53,109.17,33614000,212.5989235\n2002-02-06T14:30:00Z,109.64999,109.74001,108.06,108.7,29581008,208.596183\n2002-02-07T14:30:00Z,108.72,109.86,108,108.02,23450000,204.215078\n2002-02-08T14:30:00Z,108.63,110.75,108.3,110.09,19278096,220.4136539\n2002-02-11T14:30:00Z,110.05,111.64,109.82001,111.44,18792096,231.0987715\n2002-02-12T14:30:00Z,110.96001,111.71001,110.03,111.09,13942500,231.3704038\n2002-02-13T14:30:00Z,111.481,112.53999,111.35001,112.27,16783808,242.1382432\n2002-02-14T14:30:00Z,112.50999,112.97,111.591,112.06,20458000,241.4783641\n2002-02-15T14:30:00Z,112.14999,112.24001,110.71001,110.89,18392096,231.6539742\n2002-02-19T14:30:00Z,110.14999,110.298,108.61,108.75999,15988102,212.1910966\n2002-02-20T14:30:00Z,109.05,110.59,107.82001,110.59,29242896,220.4551885\n2002-02-21T14:30:00Z,109.931,110.63,108.25999,108.3,26292608,206.0750406\n2002-02-22T14:30:00Z,108.35001,109.94,107.87,109.64,26572896,212.5998156\n2002-02-25T14:30:00Z,109.748,111.81,109.7,111.45,17458704,229.0317855\n2002-02-26T14:30:00Z,111.60001,112.03999,110.57001,111.22,22362000,229.0477299\n2002-02-27T14:30:00Z,111.961,112.86,110.64999,111.64999,28597904,229.8458581\n2002-02-28T14:30:00Z,111.834,112.75,111.03,111.14999,23755504,226.3284717\n2002-03-01T14:30:00Z,111.72,113.85001,111.50999,113.74001,26179504,247.8315187\n2002-03-04T14:30:00Z,113.901,115.99001,113.64999,115.75,27184800,264.8323906\n2002-03-05T14:30:00Z,115.33,116.39999,114.97,115.38,22733008,265.1344632\n2002-03-06T14:30:00Z,115.10001,117.14999,115.07899,116.75,20143808,276.8552577\n2002-03-07T14:30:00Z,117.36099,117.5,115.57001,116.5,19331808,276.0115116\n2002-03-08T14:30:00Z,117.381,117.907,116.48,116.99001,19930304,276.4359656\n2002-03-11T14:30:00Z,116.89101,117.89999,116.42999,117.24001,15622102,277.6213376\n2002-03-12T14:30:00Z,116.10899,117.25,115.94,117.17,17154896,280.8064959\n2002-03-13T14:30:00Z,116.631,116.75,115.64,116.03999,17175504,273.8076044\n2002-03-14T14:30:00Z,116.03999,116.42999,115.63,115.88,11169602,272.7592679\n2002-03-15T14:30:00Z,115.97,116.95,115.89999,116.64999,21221904,279.2642907\n2002-03-18T14:30:00Z,117.10001,117.567,116.10001,116.67,17557504,279.1767711\n2002-03-19T14:30:00Z,117.30099,117.74001,116.82001,117.45,17913008,283.7079203\n2002-03-20T14:30:00Z,116.5,116.58,115.19,115.24001,17115008,262.449473\n2002-03-21T14:30:00Z,115.3,115.83,114.12,115.28999,26886704,261.5160524\n2002-03-22T14:30:00Z,115.5,115.94,114.7,115.03999,15235398,259.9384163\n2002-03-25T14:30:00Z,115.091,115.36,113.3,113.61,17499600,248.5110326\n2002-03-26T14:30:00Z,113.521,115.02,113.47,114.27,19948608,251.5594394\n2002-03-27T14:30:00Z,114.033,115.00999,113.75999,114.57001,19020496,253.9914212\n2002-03-28T14:30:00Z,114.97,115.77,114.5,114.52,17535904,253.2396529\n2002-04-01T14:30:00Z,114.23,115.10001,113.5,114.57001,17711808,253.6398889\n2002-04-02T14:30:00Z,113.98,114.95,113.77,113.94,15594500,251.4066342\n2002-04-03T14:30:00Z,114.011,114.217,112.16,113.14,25660704,244.7031085\n2002-04-04T14:30:00Z,112.60001,113.39999,112.23,112.67,23561008,242.0278639\n2002-04-05T14:30:00Z,113.19,113.63,112.17999,112.69,19404896,241.1590335\n2002-04-08T13:30:00Z,111.32001,113.03,111.23,112.92999,16471102,245.5199777\n2002-04-09T13:30:00Z,113.189,113.189,111.92999,112.14,15122699,242.0893719\n2002-04-10T13:30:00Z,112.101,113.53999,112.092,113.41,17204096,250.5937827\n2002-04-11T13:30:00Z,112.89301,113.052,110.5,110.59,25459104,228.9212943\n2002-04-12T13:30:00Z,111.02901,111.64999,110.03999,111.42,14950602,230.2844477\n2002-04-15T13:30:00Z,111.62,111.86,110.2,110.57001,17402896,224.7438703\n2002-04-16T13:30:00Z,111.702,113.32001,111.67,113.2,15097000,246.4960167\n2002-04-17T13:30:00Z,113.39,113.67,112.60001,112.96001,12920398,246.2870754\n2002-04-18T13:30:00Z,112.89999,113.46001,111.14999,112.47,25211008,242.4850197\n2002-04-19T13:30:00Z,113.2,113.24001,112.56,112.88,10602500,243.3087987\n2002-04-22T13:30:00Z,112.38,112.42999,110.84,111,13923301,225.4789363\n2002-04-23T13:30:00Z,111.09,111.48,110.17,110.52,16968608,221.9997067\n2002-04-24T13:30:00Z,110.56,111.81,109.39999,109.41,18903296,216.2272636\n2002-04-25T13:30:00Z,109.21001,109.741,108.72,109.47,25455504,215.9059107\n2002-04-26T13:30:00Z,109.78999,110.00999,107.28999,107.39,19769904,200.1771562\n2002-04-29T13:30:00Z,107.931,108.25999,106.63,106.86,17725008,196.1161296\n2002-04-30T13:30:00Z,107.02,108.64,106.64,107.86,19474496,201.7687727\n2002-05-01T13:30:00Z,107.97,109.25,106.8,109.17999,24580496,208.7415855\n2002-05-02T13:30:00Z,109.10001,109.91,107.78,108.75999,15667301,207.7073742\n2002-05-03T13:30:00Z,108.60001,108.75999,107.2,107.58,18186000,197.1868929\n2002-05-06T13:30:00Z,107.647,107.998,105.31,105.47,23636000,180.5383965\n2002-05-07T13:30:00Z,106.10899,106.32201,104.89999,105.10001,21921200,176.6961846\n2002-05-08T13:30:00Z,107.05299,109.36,106.78999,109.00999,27918496,210.3561847\n2002-05-09T13:30:00Z,108.64999,109.10001,107.58,107.75,18087008,204.9262042\n2002-05-10T13:30:00Z,107.97,108.05,105.60001,105.72,18959504,187.9472444\n2002-05-13T13:30:00Z,106.22,107.95,105.799,107.87,14686898,200.160909\n2002-05-14T13:30:00Z,109.62,110.37,109,110.22,34212304,220.5449612\n2002-05-15T13:30:00Z,109.5,110.91,109.28999,109.78999,29537808,220.1015834\n2002-05-16T13:30:00Z,109.7,110.48,109.33,110.36,28095008,223.5322648\n2002-05-17T13:30:00Z,110.66,111.25,110.10001,110.89999,27823696,227.0220092\n2002-05-20T13:30:00Z,110.64,110.69,109.492,109.7,13833801,216.6273567\n2002-05-21T13:30:00Z,110.11,110.487,108.32001,108.7,16877296,209.6613083\n2002-05-22T13:30:00Z,108.22,109.12,108,108.94,15844301,210.3966648\n2002-05-23T13:30:00Z,109.261,110.36,108.48,110.10001,13880199,217.9770996\n2002-05-24T13:30:00Z,109.98,110.2,108.61,108.69,11875898,208.429078\n2002-05-28T13:30:00Z,109.05,109.13,107.45,108.10001,24237104,203.0592858\n2002-05-29T13:30:00Z,107.629,108.02,107.13,107.3,14779102,196.8175471\n2002-05-30T13:30:00Z,106.55099,107.50999,105.89999,107,18218096,196.0019001\n2002-05-31T13:30:00Z,107.39999,108.56,106.85001,107.22,19826304,197.298111\n2002-06-03T13:30:00Z,107.09,107.60001,104.13,104.37,26073904,173.9198851\n2002-06-04T13:30:00Z,104.14999,105.2,103.55,104.63,25859808,173.5191452\n2002-06-05T13:30:00Z,104.95,105.67,104.35001,105.61,19718304,179.9740512\n2002-06-06T13:30:00Z,105.543,105.60001,103.14999,103.46001,23364704,162.2136964\n2002-06-07T13:30:00Z,101.789,103.92,101.72,103.34,24011600,162.7522738\n2002-06-10T13:30:00Z,103.243,104.46001,103.02,103.74001,18760192,166.7210223\n2002-06-11T13:30:00Z,104.131,104.53999,101.73,101.96001,19990800,154.9847632\n2002-06-12T13:30:00Z,101.71001,102.81,100.78,102.58,31268304,156.4531481\n2002-06-13T13:30:00Z,102.13,103,101.34,101.55,21050896,151.9021996\n2002-06-14T13:30:00Z,100.31,101.56,98.5,101.39999,39267504,153.3890449\n2002-06-17T13:30:00Z,101.92101,104.34,101.85001,104.12,17648496,178.5575351\n2002-06-18T13:30:00Z,103.74001,105.03,103.631,104.97,21775104,184.4376443\n2002-06-19T13:30:00Z,103.5,104.42999,102.24001,102.52,21541392,168.2074028\n2002-06-20T13:30:00Z,102.265,103.05,100.96001,101.21001,25692000,159.5118201\n2002-06-21T13:30:00Z,100.47,100.92999,98.687,99.28,31190704,142.8969393\n2002-06-24T13:30:00Z,98.61,100.69,97.25,99.8,37173296,145.6720647\n2002-06-25T13:30:00Z,100.30299,100.89,97.53999,97.56,33389200,132.8385464\n2002-06-26T13:30:00Z,95.2,98.14999,95.19501,97.72,37918496,135.819578\n2002-06-27T13:30:00Z,98.5,99.49001,96.57001,99.42999,31728800,144.5605138\n2002-06-28T13:30:00Z,99.243,100.5,98.88,98.96001,28184304,143.1923955\n2002-07-01T13:30:00Z,99.187,99.8,96.89,97.03,20282896,129.8272626\n2002-07-02T13:30:00Z,96.869,97.2,94.77,94.97,34218400,112.9455269\n2002-07-03T13:30:00Z,94.62,95.84,93.72701,95.50999,30566896,114.47731\n2002-07-05T13:30:00Z,96.78,99.53,96.668,99.31,19014800,150.7401367\n2002-07-08T13:30:00Z,98.98,99.7,97.56,98.07001,19120896,146.5486382\n2002-07-09T13:30:00Z,97.73,98.34,95.00999,95.60001,28623296,126.3215158\n2002-07-10T13:30:00Z,96,96.07001,92.03999,92.12,50525392,97.29279738\n2002-07-11T13:30:00Z,91.763,93.35001,90.32001,92.87,59532896,98.23076092\n2002-07-12T13:30:00Z,93.33299,93.89,91.52,91.85001,39026096,93.49763185\n2002-07-15T13:30:00Z,91.64301,92.39999,87.89,92.34,77320192,95.86952752\n2002-07-16T13:30:00Z,91.127,92.38,89.87,90.56,53282400,85.00416005\n2002-07-17T13:30:00Z,92.46001,93.3,89.75,90.74001,48996096,81.19233707\n2002-07-18T13:30:00Z,90.703,91.10001,87.75,87.8,32701808,57.3558209\n2002-07-19T13:30:00Z,86.767,87.55299,84.3,84.71001,77690624,31.52419928\n2002-07-22T13:30:00Z,84.10699,85.91299,81.45,82.2,78249376,15.24067739\n2002-07-23T13:30:00Z,82.55,83.24001,79.75,79.95,74499632,-0.30339635\n2002-07-24T13:30:00Z,78.13699,85.12,77.67999,84.72,106946000,29.29907081\n2002-07-25T13:30:00Z,84.27499,85.85001,81.60001,84,87194880,31.9061972\n2002-07-26T13:30:00Z,84.653,85.92999,83.8,85.60001,41210496,42.90450085\n2002-07-29T13:30:00Z,87.508,90.34,87.3,89.77,53496304,82.65863542\n2002-07-30T13:30:00Z,89.323,91.39999,88.72,90.94,47559008,90.64412945\n2002-07-31T13:30:00Z,90.49699,91.55,89.25,91.16,44707696,94.37720227\n2002-08-01T13:30:00Z,90.88,91.35001,88.33,88.78,66576320,76.25394994\n2002-08-02T13:30:00Z,88.5,88.91701,85.62,86.78999,51775696,58.83960611\n2002-08-05T13:30:00Z,86.498,86.933,83.55,83.77,47196400,33.27016418\n2002-08-06T13:30:00Z,85.233,87.89999,85.05,86.59,65087696,50.69607609\n2002-08-07T13:30:00Z,87.879,88.5,85.77,88.10001,43696496,58.31835993\n2002-08-08T13:30:00Z,88.423,91.10001,87.8,90.95,48373600,81.61427847\n2002-08-09T13:30:00Z,90.10001,91.94,89.35001,91.28999,41880400,86.47724137\n2002-08-12T13:30:00Z,89.99699,91.27,89.55,90.62,25855696,86.15010662\n2002-08-13T13:30:00Z,90.14999,91.66,88.64999,88.97,49637104,78.04388701\n2002-08-14T13:30:00Z,89.02,92.63,88.02,92.22,57431904,99.2866465\n2002-08-15T13:30:00Z,92.847,93.99001,92.2,93.5,45552096,109.5653932\n2002-08-16T13:30:00Z,92.82001,94.08,92,93.22,36517296,109.913291\n2002-08-19T13:30:00Z,93.46001,95.75,93.10001,95.39999,33672304,128.6007466\n2002-08-20T13:30:00Z,94.82201,95.39999,93.62,94.39,30512096,124.9611734\n2002-08-21T13:30:00Z,95.063,95.78,93.57001,95.75,39632608,130.9408668\n2002-08-22T13:30:00Z,95.493,97.14999,95.07001,96.67999,38403808,137.5283353\n2002-08-23T13:30:00Z,96.017,96.14999,94.14999,94.60001,33717504,122.1480368\n2002-08-26T13:30:00Z,94.91,95.64,93.5,95.25999,33831104,123.4730984\n2002-08-27T13:30:00Z,95.7,96.25,93.505,94.16,35340704,116.5704963\n2002-08-28T13:30:00Z,93.287,93.49001,91.8,92.10001,38973808,97.97399809\n2002-08-29T13:30:00Z,91.27,93.058,90.81,92.14,42967104,98.53872653\n2002-08-30T13:30:00Z,91.686,93.39,91.39999,91.78,30370896,98.20074675\n2002-09-03T13:30:00Z,90.735,91,88.14999,88.28,76682192,65.49905624\n2002-09-04T13:30:00Z,88.61501,90.25,88.06,89.53999,51099504,70.36797755\n2002-09-05T13:30:00Z,88.49001,89.42999,87.5,88.78,67318320,68.16027461\n2002-09-06T13:30:00Z,89.75,90.57001,89.347,90,38622896,78.20350865\n2002-09-09T13:30:00Z,89.10001,91.351,88.8,90.66,34074896,83.05780066\n2002-09-10T13:30:00Z,91.14,91.78,90.56,91.7,41426704,90.49258394\n2002-09-11T13:30:00Z,92.47,93.33,91.10001,91.13,27745600,85.76418846\n2002-09-12T13:30:00Z,90.75301,90.843,88.99001,89.45,43631504,70.46738783\n2002-09-13T13:30:00Z,88.698,89.89999,88.25,89.67,41131008,71.91082301\n2002-09-16T13:30:00Z,89.317,89.89,88.466,89.89,28167600,75.29413885\n2002-09-17T13:30:00Z,90.89,91.19,87.75,87.83,47762096,62.42864489\n2002-09-18T13:30:00Z,87.017,88.5,86.283,86.95,54829504,56.98632534\n2002-09-19T13:30:00Z,85.995,86.8,84.7,84.7,48514000,38.28818887\n2002-09-20T13:30:00Z,84.92,85.2,84.05,84.35001,46325696,35.6453655\n2002-09-23T13:30:00Z,83.64999,84.06599,82.69,83.66,46904896,30.47499327\n2002-09-24T13:30:00Z,82.44,83.64999,81.85001,82.31,69554496,21.63466122\n2002-09-25T13:30:00Z,83.373,84.77,82.03999,84.35001,59294496,35.52645912\n2002-09-26T13:30:00Z,85.02,85.97,84.45,85.73,53670800,46.57219936\n2002-09-27T13:30:00Z,85,85.63,82.75,82.75,64776608,23.03247691\n2002-09-30T13:30:00Z,82,82.8,80.00999,81.78999,73095312,14.718916\n2002-10-01T13:30:00Z,82.438,85.77,81.47,85.72,67274816,46.25783389\n2002-10-02T13:30:00Z,84.69,85.53,82.60001,83.14999,56846800,33.48172863\n2002-10-03T13:30:00Z,83.14,84.60001,81.95,82.31,55548896,28.58466905\n2002-10-04T13:30:00Z,82.8,82.92,79.58,80.8,68628368,15.51424093\n2002-10-07T13:30:00Z,80.065,81.2,78.55,79.13,53211104,3.739687359\n2002-10-08T13:30:00Z,79.81,81.31,78.2,80.37,79531632,8.980855583\n2002-10-09T13:30:00Z,79.09,79.7,77.78,78.10001,79893872,-8.761083744\n2002-10-10T13:30:00Z,77.94,81.07001,77.07001,80.63,76752128,7.09185779\n2002-10-11T13:30:00Z,82.10001,84.73,81.82001,84.16,82321680,39.18828983\n2002-10-14T13:30:00Z,83.2,84.85001,83.03999,84.63,40638400,44.30656905\n2002-10-15T13:30:00Z,86.991,88.72,86.856,88.7,82538320,84.79873429\n2002-10-16T13:30:00Z,87.41701,87.8,85.924,86.55,63526896,71.21078396\n2002-10-17T13:30:00Z,88.87,89.3,87.85001,88.27,68584368,80.1374436\n2002-10-18T13:30:00Z,87.64999,89.11,86.92999,88.64,47559104,82.70748045\n2002-10-21T13:30:00Z,88.121,90.5,87.57001,90.17,45970704,92.95873331\n2002-10-22T13:30:00Z,89.05,90.00999,88.52,89.52,41214704,93.44037241\n2002-10-23T13:30:00Z,88.77,90.27,87.67999,90.2,55112496,99.864668\n2002-10-24T13:30:00Z,90.75,90.89999,88.10001,88.36,55149808,88.7348999\n2002-10-25T13:30:00Z,88.215,90.39,87.944,90.2,43724496,98.0519896\n2002-10-28T14:30:00Z,91.14999,91.28999,88.85001,89.61,39427008,95.56996522\n2002-10-29T14:30:00Z,89.08,89.49001,87,88.57001,59529808,86.23276209\n2002-10-30T14:30:00Z,88.67999,89.96001,88.23,89.42999,41703008,91.41242043\n2002-10-31T14:30:00Z,89.66,90.3,88.19,88.52,41621104,87.05258726\n2002-11-01T14:30:00Z,88.35001,90.82001,88.05,90.27,51889504,98.46317337\n2002-11-04T14:30:00Z,91.8,92.94,90.89999,91.13,49081808,104.378828\n2002-11-05T14:30:00Z,90.84,92.07001,90.84,91.85001,37282192,108.8245685\n2002-11-06T14:30:00Z,92.48,93.07001,90.78999,93.03999,65270000,114.010659\n2002-11-07T14:30:00Z,92.02699,92.22,90.22,90.75999,51574096,94.84087391\n2002-11-08T14:30:00Z,90.53,91.57001,89.52,89.64999,37911104,88.72819896\n2002-11-11T14:30:00Z,89.515,89.56,87.8,88.25999,33580800,75.95236065\n2002-11-12T14:30:00Z,88.66,89.92999,88.37,88.96001,37769392,78.85442234\n2002-11-13T14:30:00Z,88.32001,89.74899,87.45,89.05,63905008,80.96133302\n2002-11-14T14:30:00Z,90.07001,91,89.759,90.73,31938704,95.99003938\n2002-11-15T14:30:00Z,90,91.55,89.95,91.39999,39166192,100.4471479\n2002-11-18T14:30:00Z,92.14999,92.14999,90.35001,90.48,29019392,96.15870537\n2002-11-19T14:30:00Z,90.02,91.10001,89.75999,90.36,32813696,95.21774079\n2002-11-20T14:30:00Z,89.98,92.42,89.95,92.37,36815296,111.7965079\n2002-11-21T14:30:00Z,92.60001,94.19,92.42999,94.09,55170800,126.3874221\n2002-11-22T14:30:00Z,93.48,94.27,93.27299,93.42,32514096,125.1663042\n2002-11-25T14:30:00Z,93.42999,94.25999,92.77,93.48,34059296,125.4105064\n2002-11-26T14:30:00Z,93.07401,93.45,91.62,91.7,42290400,110.0492396\n2002-11-27T14:30:00Z,92.52,94.64999,92.42999,94.28,37773008,129.6703005\n2002-11-29T14:30:00Z,94.8,94.95,93.77,93.98,19385696,128.9723839\n2002-12-02T14:30:00Z,95.47,96.05,93.22,94.13,49794400,125.8818773\n2002-12-03T14:30:00Z,93.25,93.39999,92.35001,92.87,34433296,114.5343438\n2002-12-04T14:30:00Z,91.77,93.14,91.42999,92.45,64137200,113.6617663\n2002-12-05T14:30:00Z,92.7,92.80099,91.10001,91.42999,36778192,106.9648902\n2002-12-06T14:30:00Z,90.12,92.17,89.98,92.03,50132096,111.437402\n2002-12-09T14:30:00Z,91.07001,91.46001,89.48,89.5,36804096,94.94782916\n2002-12-10T14:30:00Z,90.02,91.10001,89.75999,90.7,33449104,101.1088702\n2002-12-11T14:30:00Z,90.42,91.62,90.16,90.78,39206096,102.6257413\n2002-12-12T14:30:00Z,91.2,91.49001,90.2,90.77,34480496,102.1916351\n2002-12-13T14:30:00Z,89.91,90.48,89.27,89.34,36873392,90.50894281\n2002-12-16T14:30:00Z,89.82001,91.78999,89.66,91.64999,37112304,109.9130441\n2002-12-17T14:30:00Z,91.37199,91.74001,90.74001,90.85001,32399904,107.5581896\n2002-12-18T14:30:00Z,90.32001,90.39999,89.33,89.8,35643104,97.95806122\n2002-12-19T14:30:00Z,89.35001,90.7,88.60001,89.16,39287200,95.04885763\n2002-12-20T14:30:00Z,89.2,90.02,89.10001,89.99001,31181104,101.5906445\n2002-12-23T14:30:00Z,89.59,90.47,89.31,90.02,22645504,102.9759979\n2002-12-24T14:30:00Z,89.59,89.86,89.25,89.355,10937000,98.90272205\n2002-12-26T14:30:00Z,89.7,90.61,88.84,89.39,17489200,98.13603971\n2002-12-27T14:30:00Z,88.96001,89.28999,87.38,87.38,22213008,80.39432424\n2002-12-30T14:30:00Z,87.797,88.47,87.22,88.11,29972192,82.42977812\n2002-12-31T14:30:00Z,87.99001,88.42999,87.11,88.23,34037504,83.85230305\n2003-01-02T14:30:00Z,88.85001,91.3,88.53999,91.07001,44641392,109.7151448\n2003-01-03T14:30:00Z,90.91,91.38699,90.5,91.35001,32226000,112.321627\n2003-01-06T14:30:00Z,91.24001,93.49001,91.17599,92.96001,41005696,126.557276\n2003-01-07T14:30:00Z,92.89999,93.37,92.2,92.73,38655104,126.8986719\n2003-01-08T14:30:00Z,92.2,92.39999,91.05,91.39,38736704,114.8480689\n2003-01-09T14:30:00Z,91.821,93.17999,91.41,92.81,34851200,124.5090977\n2003-01-10T14:30:00Z,91.95,93.64,91.8,93.06,37771600,127.6914324\n2003-01-13T14:30:00Z,93.53999,93.86,92.44,93.03,31676096,127.6693558\n2003-01-14T14:30:00Z,92.69,93.83,92.41,93.33,30902800,129.2606427\n2003-01-15T14:30:00Z,93.53999,93.57001,91.91,92.39999,33542000,122.7262892\n2003-01-16T14:30:00Z,92.5,92.92999,91.455,92.02,45374496,119.6893171\n2003-01-17T14:30:00Z,90.99001,92.3,90.14999,90.66,35621008,111.2197074\n2003-01-21T14:30:00Z,90.87,90.92,88.95,89.25,42370304,99.2304428\n2003-01-22T14:30:00Z,88.77,89.8,88,88.17,42808608,92.90603804\n2003-01-23T14:30:00Z,88.75,89.38,87.95,88.71001,56080800,94.67707502\n2003-01-24T14:30:00Z,88.59,88.67999,86.17,86.38,68700816,73.10320389\n2003-01-27T14:30:00Z,85.73,86.8,84.5,85.2,58287504,64.8751145\n2003-01-28T14:30:00Z,85.63,86.39999,85.13,85.83,46956704,68.07029782\n2003-01-29T14:30:00Z,85.44,87.17999,84.77,86.48,53780192,72.25473505\n2003-01-30T14:30:00Z,86.78999,86.88,84.39999,84.42999,49883392,58.16343041\n2003-01-31T14:30:00Z,84.14999,86.215,84.14999,86.06,55321600,66.54645375\n2003-02-03T14:30:00Z,86.14,86.817,85.92,86.23,39799200,68.93015436\n2003-02-04T14:30:00Z,85.31,85.75,84.3,85.38,43757296,63.34794633\n2003-02-05T14:30:00Z,85.754,86.53999,84.489,84.85001,55297904,59.96748234\n2003-02-06T14:30:00Z,84.37,84.89,83.64999,84.45,53655904,56.96945572\n2003-02-07T14:30:00Z,84.91,84.99001,82.97,83.42,43168192,49.01177414\n2003-02-10T14:30:00Z,83.466,84.13,82.64999,84.00999,45470400,50.28338788\n2003-02-11T14:30:00Z,84.37,84.707,82.834,83.42999,46468704,46.93948227\n2003-02-12T14:30:00Z,83.16,83.62,82.09,82.10001,35906304,36.99881328\n2003-02-13T14:30:00Z,82.14999,82.66,81,82.35001,58064496,37.3024325\n2003-02-14T14:30:00Z,82.37,84.2,81.82899,84.14999,59588304,50.38820335\n2003-02-18T14:30:00Z,84.53,85.8,84.39,85.63,39512896,63.31156397\n2003-02-19T14:30:00Z,85.32001,85.47,84.28,85.17999,31440304,61.97346931\n2003-02-20T14:30:00Z,85.21001,85.42,84.05,84.33,29299296,55.31318718\n2003-02-21T14:30:00Z,84.38,85.74001,83.46001,85.17999,60965200,58.94389761\n2003-02-24T14:30:00Z,84.92999,85,83.59,83.8,30648800,48.74343836\n2003-02-25T14:30:00Z,82.95,84.49001,82.22,84.47,56901296,53.18283264\n2003-02-26T14:30:00Z,84.024,84.53,83.08,83.24001,37799392,47.28679729\n2003-02-27T14:30:00Z,83.7,84.75,83.16,84.34,51829008,53.75452903\n2003-02-28T14:30:00Z,84.47,85.23,84.16,84.89999,43888800,57.98286567\n2003-03-03T14:30:00Z,85.25999,85.78,83.72,84.09,42935392,53.60217326\n2003-03-04T14:30:00Z,83.95,84.00999,82.64999,82.75,31475392,41.73062977\n2003-03-05T14:30:00Z,82.61,83.53999,82.36,83.45,44105200,44.46625552\n2003-03-06T14:30:00Z,82.87,83.52,82.47,82.75,41412400,41.79264441\n2003-03-07T14:30:00Z,81.61,83.99001,81.42999,83.32001,63582704,46.23622436\n2003-03-10T14:30:00Z,82.60001,82.86,81.10001,81.32001,41027504,33.53780262\n2003-03-11T14:30:00Z,81.48,82,80.48,80.52,48114496,28.97250235\n2003-03-12T14:30:00Z,80.38,81.10001,79.383,81.06,62475392,31.29645572\n2003-03-13T14:30:00Z,82.17999,83.91,81.53,83.86,72161184,55.66475521\n2003-03-14T14:30:00Z,84.2,84.77,83.35001,84.13,63963808,57.68939755\n2003-03-17T14:30:00Z,83.46001,86.95,83.22,86.78,88287008,77.87758284\n2003-03-18T14:30:00Z,87.15401,87.35001,86.28,87.28999,51081008,80.51757654\n2003-03-19T14:30:00Z,87.28,88.16,86.67999,87.96001,49659200,84.26718371\n2003-03-20T14:30:00Z,87.33,88.59,86.35001,88.14999,67461632,87.4820894\n2003-03-21T14:30:00Z,88.8,89.88,87.92999,89.67,71263632,98.31973896\n2003-03-24T14:30:00Z,88.02,88.14,86.35001,86.69,65430400,72.66755959\n2003-03-25T14:30:00Z,86.74001,88.25999,86.44,87.52,61177600,76.71333412\n2003-03-26T14:30:00Z,87.56,87.85001,86.8,87.08,45757808,74.9603236\n2003-03-27T14:30:00Z,86.39999,87.66,85.99001,87.14999,53291392,76.19718753\n2003-03-28T14:30:00Z,86.47,87.28,86.25,86.71001,32600704,75.58514351\n2003-03-31T14:30:00Z,85.35001,86.59,84.39999,84.74001,60785904,61.74139415\n2003-04-01T14:30:00Z,85.25,86.39,84.91,86.03999,53780096,71.00295068\n2003-04-02T14:30:00Z,87.53999,88.77,87.5,88.12,50498096,90.93846497\n2003-04-03T14:30:00Z,88.87,88.99001,87.64999,87.7,49009392,87.78949575\n2003-04-04T14:30:00Z,88.42999,88.59,87.62,88.22,36261808,88.3292455\n2003-04-07T13:30:00Z,90.34,90.85001,87.97,88.05,69821184,80.66402192\n2003-04-08T13:30:00Z,88.3,88.64999,87.71001,88.19,39741392,79.4553484\n2003-04-09T13:30:00Z,88.36,89.10001,86.77,87.03,55678000,72.48149145\n2003-04-10T13:30:00Z,87.095,87.63,85.71001,87.50999,42126000,73.78165441\n2003-04-11T13:30:00Z,88.16,88.701,86.86,87.14999,47735504,70.86782724\n2003-04-14T13:30:00Z,87.47,89,87,88.95,36947504,82.61007767\n2003-04-15T13:30:00Z,88.84,89.78,88.42,89.78,49957008,87.61766437\n2003-04-16T13:30:00Z,89.91,90.06599,88.03,88.25,51809296,77.38327871\n2003-04-17T13:30:00Z,88.3,89.72,88.194,89.56,37483392,84.60169061\n2003-04-21T13:30:00Z,89.86,90.16,89.06,89.64999,32082800,85.39670386\n2003-04-22T13:30:00Z,89.10001,91.56,88.89,91.34,59860608,97.48773351\n2003-04-23T13:30:00Z,91.62,92.35001,91.24001,92.17999,44250608,103.8380391\n2003-04-24T13:30:00Z,91.53,92.08,90.96001,91.36,50017296,99.38532913\n2003-04-25T13:30:00Z,91.3,91.47,90.02,90.23,43923696,89.80388022\n2003-04-28T13:30:00Z,90.44,92.19,90.3,91.78999,46469104,100.7966698\n2003-04-29T13:30:00Z,92.14,92.8,91.39999,91.78999,52340192,101.3870236\n2003-04-30T13:30:00Z,91.91,92.57001,91.41,91.91,48912496,101.5140589\n2003-05-01T13:30:00Z,91.92,92.731,90.5,91.89999,50405808,101.4349992\n2003-05-02T13:30:00Z,91.56,93.47,91.491,93.21001,50236608,111.9697535\n2003-05-05T13:30:00Z,93.47,93.78,92.5,93.03,35453296,112.0025075\n2003-05-06T13:30:00Z,93.03999,94.38,93,93.91,44584096,118.8261516\n2003-05-07T13:30:00Z,93.42,94.14,92.972,93.39,41442000,117.4827191\n2003-05-08T13:30:00Z,92.52,93.33701,92.28,92.45,40754800,111.2351824\n2003-05-09T13:30:00Z,92.83,93.8,92.61,93.73,33639696,122.4578766\n2003-05-12T13:30:00Z,93.5,95.12,93.28,94.88,35680704,131.1453766\n2003-05-13T13:30:00Z,94.534,95.189,94.25999,94.71001,39295904,131.94537\n2003-05-14T13:30:00Z,95.09,95.24001,93.91,94.50999,32232096,130.322284\n2003-05-15T13:30:00Z,94.89,95.33,94.25,95.11,43932096,132.6861149\n2003-05-16T13:30:00Z,94.89,95.45,94.25999,94.87,38905904,131.8540335\n2003-05-19T13:30:00Z,94.14999,94.8905,92.33,92.64999,43235296,113.4450358\n2003-05-20T13:30:00Z,92.82001,93.03,91.597,92.46001,55450896,110.7332807\n2003-05-21T13:30:00Z,92.11,92.88,91.91,92.64999,49848400,111.9331036\n2003-05-22T13:30:00Z,92.95,94.05,92.67999,93.57001,38456704,119.7909807\n2003-05-23T13:30:00Z,93.53,93.98,93.14,93.75999,26157696,121.033408\n2003-05-27T13:30:00Z,93.3,95.84,93.17999,95.39999,43732608,134.1769133\n2003-05-28T13:30:00Z,95.85001,96.47,95.42999,95.67,37749808,137.160917\n2003-05-29T13:30:00Z,95.88,96.82001,95.08,95.42,50978400,135.0469328\n2003-05-30T13:30:00Z,95.901,97.09,95.56,96.95,52537600,146.8507411\n2003-06-02T13:30:00Z,97.53,98.45,96.67,97.35001,50700608,149.477738\n2003-06-03T13:30:00Z,97.14999,97.84,96.85001,97.75,39551808,151.4554113\n2003-06-04T13:30:00Z,97.66,99.35001,97.569,99.16,49432704,163.4181352\n2003-06-05T13:30:00Z,98.584,99.64999,98.27,99.64999,46407104,167.8490958\n2003-06-06T13:30:00Z,100.39999,101.39999,99.13,99.25999,60397600,164.8586677\n2003-06-09T13:30:00Z,98.769,99.10001,97.77,98.25,38388800,156.3182011\n2003-06-10T13:30:00Z,98.46001,99.25999,98.19,99.25,30105504,162.9752934\n2003-06-11T13:30:00Z,99.16,100.39,98.71001,100.3,37617296,169.8726334\n2003-06-12T13:30:00Z,100.754,100.89999,99.62,100.61,36488608,171.2929301\n2003-06-13T13:30:00Z,100.61,100.74899,98.95,99.56,48635296,162.1843654\n2003-06-16T13:30:00Z,99.96001,101.7,99.8,101.66,36338608,177.9325563\n2003-06-17T13:30:00Z,102.07001,102.179,101.23,101.66,36818192,178.4519173\n2003-06-18T13:30:00Z,101.28999,102.14,101,101.57001,35550096,178.2776799\n2003-06-19T13:30:00Z,101.64,101.73,99.84,100.02,43559904,165.6446396\n2003-06-20T13:30:00Z,100.39,100.5,99.42,99.44,41551696,161.9577709\n2003-06-23T13:30:00Z,99.45,99.66,97.92,98.42,34317808,153.4426003\n2003-06-24T13:30:00Z,98.22301,99.09,98.02,98.52,36220896,153.4141946\n2003-06-25T13:30:00Z,98.53,99.44,97.53,97.53,47856800,148.9994386\n2003-06-26T13:30:00Z,97.78,98.979,96.96001,98.8,33543504,155.106148\n2003-06-27T13:30:00Z,98.74699,99.19,97.58,97.66,54211104,149.2657864\n2003-06-30T13:30:00Z,98.22,98.67,97.47,97.63,33863696,146.7062654\n2003-07-01T13:30:00Z,97.25301,98.85001,96.42999,98.53,51416400,150.8372649\n2003-07-02T13:30:00Z,98.77,99.78999,98.57001,99.77,34678000,161.237539\n2003-07-03T13:30:00Z,99.07001,99.85001,97.90401,98.74001,30868400,156.2189202\n2003-07-07T13:30:00Z,99.653,100.89999,99.64999,100.7,31426608,174.3522048\n2003-07-08T13:30:00Z,100.5,101.28999,100.17,101.14999,33158192,177.1189305\n2003-07-09T13:30:00Z,100.92,101.39999,100.03,100.58,36629296,174.4811201\n2003-07-10T13:30:00Z,99.84,100.03999,98.63,99.3,49815600,163.191251\n2003-07-11T13:30:00Z,99.39,100.45,99.39,100.24001,40076400,170.3208743\n2003-07-14T13:30:00Z,101.2,101.89999,99.91499,100.73,42141504,172.5280054\n2003-07-15T13:30:00Z,101.38,101.46001,99.95,100.50999,63620400,170.2140346\n2003-07-16T13:30:00Z,100.81,100.87,99.23,99.92,40194192,164.8197691\n2003-07-17T13:30:00Z,99.14999,99.88,98.16,98.5,48913600,153.7917716\n2003-07-18T13:30:00Z,99.02,99.8,98.46001,99.50999,35701696,159.6996151\n2003-07-21T13:30:00Z,99.45,99.494,97.85001,98.28,35092304,149.8041114\n2003-07-22T13:30:00Z,98.69,99.41,97.91,99.17,50006704,153.1038848\n2003-07-23T13:30:00Z,99.21001,99.45,98.28,99.24001,37298304,153.9878911\n2003-07-24T13:30:00Z,99.99001,100.34,98.37,98.49001,41173296,148.799095\n2003-07-25T13:30:00Z,98.66,100.28999,98.03999,100.23,43325104,158.0132355\n2003-07-28T13:30:00Z,100.37,100.98,99.67,99.86,34416304,157.3730923\n2003-07-29T13:30:00Z,100.14,100.27,98.67999,99.39999,53569808,153.2614813\n2003-07-30T13:30:00Z,99.60001,99.78999,98.92999,99.16,28417600,151.4483946\n2003-07-31T13:30:00Z,99.98,100.94,99.05,99.39,59112000,150.4749444\n2003-08-01T13:30:00Z,99.19,99.53,98.24001,98.50999,49324496,143.6373813\n2003-08-04T13:30:00Z,98.31,99,97,98.50999,55544400,143.3329156\n2003-08-05T13:30:00Z,98.411,98.75999,96.34,96.42,61736704,126.6653505\n2003-08-06T13:30:00Z,96.69,98.06,96.423,96.98,51180000,127.6597625\n2003-08-07T13:30:00Z,97.17,98.07001,96.758,98,43546800,135.0775045\n2003-08-08T13:30:00Z,98.32001,98.547,97.75999,98.28,27359504,136.6845758\n2003-08-11T13:30:00Z,98.25999,99.03999,97.84,98.64999,34633904,138.8632306\n2003-08-12T13:30:00Z,98.71001,99.59,98.42,99.55,43347008,145.4335899\n2003-08-13T13:30:00Z,99.82001,99.849,98.53,99.03999,36155504,142.5566111\n2003-08-14T13:30:00Z,99.10001,99.75,98.45,99.31,36247392,143.0908978\n2003-08-15T13:30:00Z,99.36,99.78999,99.12,99.62,12567199,145.1358629\n2003-08-18T13:30:00Z,99.92999,100.60001,99.74001,100.48,22882096,152.5978612\n2003-08-19T13:30:00Z,100.687,100.94,100,100.86,37456800,154.2795348\n2003-08-20T13:30:00Z,100.28999,100.89,100.164,100.45,23206192,152.6580323\n2003-08-21T13:30:00Z,101.05,101.52,100.39999,100.77,46550496,153.926352\n2003-08-22T13:30:00Z,101.75,101.81799,99.73,99.77,52045008,147.6738341\n2003-08-25T13:30:00Z,99.71001,100,99.28,99.92999,23485808,147.106654\n2003-08-26T13:30:00Z,99.5,100.39,98.83,100.11,45076608,149.4054231\n2003-08-27T13:30:00Z,100.05,100.36,99.57001,100.14,18987808,150.2200719\n2003-08-28T13:30:00Z,100.39999,101,99.66,100.75999,27426400,153.4647572\n2003-08-29T13:30:00Z,100.61,101.48,100.48,101.44,28721200,158.3570683\n2003-09-02T13:30:00Z,101.64,102.88,101.05,102.8,50860608,167.8429578\n2003-09-03T13:30:00Z,103.03,103.7,102.78,103.36,44923904,172.5614496\n2003-09-04T13:30:00Z,103.10001,103.55,102.75999,103.41,28404400,173.7971079\n2003-09-05T13:30:00Z,102.94,103.549,102.39999,102.83,31654496,170.9277659\n2003-09-08T13:30:00Z,103.03999,103.88,102.92999,103.67999,32655392,178.2246556\n2003-09-09T13:30:00Z,103.37,103.46001,102.67999,103,35083504,174.0283265\n2003-09-10T13:30:00Z,102.53999,102.8,101.55,101.96001,45944704,165.0916021\n2003-09-11T13:30:00Z,102.10001,102.75999,101.84,102.25999,38797008,166.1947591\n2003-09-12T13:30:00Z,101.91,102.64,101.35001,102.45,42441200,168.3329155\n2003-09-15T13:30:00Z,102.52,102.63,101.95,102.09,21321904,166.6457989\n2003-09-16T13:30:00Z,102.23199,103.64,102.17,103.58,37946496,178.9625792\n2003-09-17T13:30:00Z,103.48,103.785,103.05,103.38,32072400,179.231418\n2003-09-18T13:30:00Z,103.39999,104.7,103.17,104.60001,30295008,188.754836\n2003-09-19T13:30:00Z,104.27,104.60001,103.39999,103.67,34381600,184.104811\n2003-09-22T13:30:00Z,102.85001,102.96001,102.03,102.55,36700608,173.9619534\n2003-09-23T13:30:00Z,102.59,103.28999,102.36,102.94,32513200,176.2169034\n2003-09-24T13:30:00Z,103.118,103.22,101.07001,101.11,41717504,161.870673\n2003-09-25T13:30:00Z,101.41,101.88,100.2,100.28,53174496,156.9260408\n2003-09-26T13:30:00Z,100.44,100.66,99.84599,99.95,42916096,154.8047447\n2003-09-29T13:30:00Z,100.3,100.99001,99.78999,100.92999,36785200,160.5673992\n2003-09-30T13:30:00Z,100.48,100.75999,99.25,99.95,70775872,154.0517446\n2003-10-01T13:30:00Z,100.24001,102.17999,100.2,102.08,65802816,172.2249673\n2003-10-02T13:30:00Z,101.92999,102.56,101.63,102.45,44638800,174.577495\n2003-10-03T13:30:00Z,103.67,104.28,103.08,103.39,48820496,181.0436879\n2003-10-06T13:30:00Z,103.48199,103.99001,103.2,103.86,20242496,183.6120366\n2003-10-07T13:30:00Z,103.25999,104.31,102.91,104.25999,42619392,187.5630499\n2003-10-08T13:30:00Z,104.33,104.39,103.41,104,30943808,186.8072585\n2003-10-09T13:30:00Z,104.88,105.22,103.83,104.28,40094800,186.276486\n2003-10-10T13:30:00Z,104.27,104.60001,103.91,104.57001,22686000,187.0748809\n2003-10-13T13:30:00Z,104.715,105.28999,104.50999,104.89999,23829504,189.6931031\n2003-10-14T13:30:00Z,104.8,105.42999,104.36,105.27,38504400,191.6621763\n2003-10-15T13:30:00Z,105.86,105.89,104.64,104.99001,39881200,189.9418127\n2003-10-16T13:30:00Z,104.67999,105.73,104.64999,105.41,32793504,191.9646453\n2003-10-17T13:30:00Z,105.47,105.63,103.98,104.25999,32801200,184.2951712\n2003-10-20T13:30:00Z,104.44701,105.03999,103.94,105.03999,27778096,186.9855165\n2003-10-21T13:30:00Z,104.82001,105.28,104.32001,104.86,26763696,186.9378068\n2003-10-22T13:30:00Z,104.03,104.19,103.19,103.53999,34121696,174.8705018\n2003-10-23T13:30:00Z,102.89,103.95,102.84,103.35001,46399808,174.5777365\n2003-10-24T13:30:00Z,102.83,103.58,102.17999,103.58,51735104,178.0529786\n2003-10-27T14:30:00Z,103.74001,104.17999,103.27,103.63,32499008,178.6765331\n2003-10-28T14:30:00Z,103.98,105.14999,103.82001,105.03999,35035200,191.1850498\n2003-10-29T14:30:00Z,104.77,105.42999,103.87,105.17999,30965296,193.6291937\n2003-10-30T14:30:00Z,105.78999,105.97,104.8,105.39999,39144800,194.1239113\n2003-10-31T14:30:00Z,105.39999,105.74001,105.22,105.3,25764704,193.272206\n2003-11-03T14:30:00Z,105.75,106.61,105.71001,105.99001,37599200,198.960147\n2003-11-04T14:30:00Z,105.99001,106.27,105.58,105.75999,31433760,197.9862826\n2003-11-05T14:30:00Z,105.53999,105.97,104.89999,105.84,33637008,198.8086586\n2003-11-06T14:30:00Z,105.60001,106.44,105.10001,106.39999,28409392,202.1915241\n2003-11-07T14:30:00Z,106.64,106.72,105.57001,105.61,31737008,197.9455336\n2003-11-10T14:30:00Z,105.74001,105.84,105.00999,105.17999,25538304,194.6092329\n2003-11-11T14:30:00Z,105.09,105.33,104.8,105.14999,26809008,194.1129455\n2003-11-12T14:30:00Z,105.23,106.47,105.16,106.33,28053696,204.9373018\n2003-11-13T14:30:00Z,106.00999,106.53999,105.78,106.36,29723600,206.5315367\n2003-11-14T14:30:00Z,106.39999,106.95,105.28999,105.46001,49162704,201.6236185\n2003-11-17T14:30:00Z,104.91,105.14,104.03999,104.92999,44438704,197.1414432\n2003-11-18T14:30:00Z,105.24001,105.45,103.7,103.84,41167600,189.3225963\n2003-11-19T14:30:00Z,104.03,105.00999,103.92,104.72,29836704,193.6458375\n2003-11-20T14:30:00Z,103.91,105.24001,103.75,103.78,53631696,190.6100475\n2003-11-21T14:30:00Z,104.24001,104.33,103.62,104.21001,30025504,192.3809271\n2003-11-24T14:30:00Z,104.69,105.78,104.67999,105.59,28967104,205.7016491\n2003-11-25T14:30:00Z,105.71001,106.42,105.45,105.99001,37582304,209.0225607\n2003-11-26T14:30:00Z,106.42,106.45,105.39,106.37,33076304,210.4329493\n2003-11-28T14:30:00Z,106.31,106.66,106.201,106.45,10507801,210.961515\n2003-12-01T14:30:00Z,106.92999,107.67999,106.8,107.60001,38710704,221.6818507\n2003-12-02T14:30:00Z,107.42999,107.77,107.07001,107.33,35369904,221.0995347\n2003-12-03T14:30:00Z,107.64999,108.08,107.07001,107.16,39108096,219.106791\n2003-12-04T14:30:00Z,107.17,107.72,106.94,107.60001,36094896,221.1719615\n2003-12-05T14:30:00Z,107.12,107.8,106.62,106.85001,28842704,217.4731802\n2003-12-08T14:30:00Z,106.74001,107.64,106.67999,107.57001,32493104,222.602804\n2003-12-09T14:30:00Z,107.89999,107.92999,106.53999,106.74001,43621504,217.7569951\n2003-12-10T14:30:00Z,106.8,106.98,105.96001,106.73,36924800,216.5103019\n2003-12-11T14:30:00Z,106.67999,108.10001,106.67,107.92999,45474304,227.2022806\n2003-12-12T14:30:00Z,107.99001,108.2,106.64999,108.14,34144896,229.7687313\n2003-12-15T14:30:00Z,109.17,109.23,107.48,107.60001,38688192,224.8618665\n2003-12-16T14:30:00Z,107.67999,108.5,107.52,108.16,32905296,226.5319227\n2003-12-17T14:30:00Z,108.06,108.5,107.8,108.5,23204896,228.3977775\n2003-12-18T14:30:00Z,108.55,109.73,108.39,109.72,29790496,238.5505792\n2003-12-19T14:30:00Z,109.3,109.37,108.58,108.89999,41466608,234.4284763\n2003-12-22T14:30:00Z,108.83,109.66,108.78,109.66,27635200,239.6390271\n2003-12-23T14:30:00Z,109.48,109.95,109.38,109.73,24755808,240.577331\n2003-12-24T14:30:00Z,109.52,109.88,109.42999,109.62,8055801,240.5864775\n2003-12-26T14:30:00Z,109.71001,110.08,109.63,109.7,8308398,241.1854058\n2003-12-29T14:30:00Z,110.10001,111.27,109.7843,111.16,22547600,253.9290516\n2003-12-30T14:30:00Z,111.09,111.27,110.85001,111.17999,19581696,254.8623832\n2003-12-31T14:30:00Z,111.22,111.52,110.84,111.28,31503392,255.32372\n2004-01-02T14:30:00Z,111.74001,112.19,110.73,111.23,38075600,254.2054804\n2004-01-05T14:30:00Z,111.78,112.52,111.59,112.44,27967392,263.408097\n2004-01-06T14:30:00Z,112.16,112.73,112,112.55,20501200,264.8522311\n2004-01-07T14:30:00Z,112.35001,113.06,111.89,112.92999,30180000,267.3499471\n2004-01-08T14:30:00Z,113.25,113.41,112.77,113.38,37044608,269.8723278\n2004-01-09T14:30:00Z,112.83,113.5,112.27,112.39,54092304,263.401907\n2004-01-12T14:30:00Z,112.55,113.25,112.36,113.22,33566496,269.072532\n2004-01-13T14:30:00Z,113.09,113.23,111.75999,112.56,54286400,264.8513457\n2004-01-14T14:30:00Z,112.75999,113.66,112.67,113.5,30141392,271.7263749\n2004-01-15T14:30:00Z,113.57001,114.06,112.58,113.78,38432608,273.6948318\n2004-01-16T14:30:00Z,114.03999,114.31,113.63,114.23,31925808,276.3968574\n2004-01-20T14:30:00Z,114.53,114.64999,113.82001,114.2,29879504,275.9556273\n2004-01-21T14:30:00Z,114.13,115.3,113.72,115.10001,30743008,281.3419675\n2004-01-22T14:30:00Z,115.14,115.38,114.58,114.8,29914000,280.6326996\n2004-01-23T14:30:00Z,115,115.37,113.95,114.42999,49968608,278.0205204\n2004-01-26T14:30:00Z,114.44,115.92999,114.38,115.87,30474096,289.1681372\n2004-01-27T14:30:00Z,115.85001,116.5,114.64999,114.67999,35353008,284.2718157\n2004-01-28T14:30:00Z,114.98,115.28,112.94,113.37,52884096,274.3263996\n2004-01-29T14:30:00Z,113.56,113.85001,112.56,113.48,60119904,273.3318523\n2004-01-30T14:30:00Z,113.52,113.72,113.09,113.48,30992800,273.1818523\n2004-02-02T14:30:00Z,113.7,114.67999,113.12,113.97,38850192,276.1197446\n2004-02-03T14:30:00Z,113.74001,114.14,113.44,113.78,25155904,275.677337\n2004-02-04T14:30:00Z,113.19,113.73,112.78999,112.85001,39597600,268.760092\n2004-02-05T14:30:00Z,113.08,113.53999,112.78,113.17999,35990704,270.2655031\n2004-02-06T14:30:00Z,113.42,114.7,113.2,114.45,37237296,281.4675594\n2004-02-09T14:30:00Z,114.67,114.87,114.28999,114.48,24859904,282.0709104\n2004-02-10T14:30:00Z,114.28,115.14,114.25999,114.85001,27933296,284.7727674\n2004-02-11T14:30:00Z,114.8,116.39,114.17,116.07001,42976896,292.9106995\n2004-02-12T14:30:00Z,115.98,116.27,115.58,115.64999,27828496,292.0974961\n2004-02-13T14:30:00Z,115.82001,116.2,114.75,115.13,44741904,288.6197764\n2004-02-17T14:30:00Z,115.85001,116.42999,115.77,116.17,23988000,295.8634785\n2004-02-18T14:30:00Z,116.2,116.60001,115.35001,115.66,28660400,293.1661283\n2004-02-19T14:30:00Z,116.33,116.39,115.06,115.23,51183104,289.6936453\n2004-02-20T14:30:00Z,115.48,115.5616,114.32001,114.88,46728800,286.2247581\n2004-02-23T14:30:00Z,115.22,115.25999,114.17,114.59,36361600,283.5228714\n2004-02-24T14:30:00Z,114.27,114.99001,113.89999,114.39,43958896,282.4944411\n2004-02-25T14:30:00Z,114.46001,115.06,114.32001,114.87,31234304,286.3828573\n2004-02-26T14:30:00Z,114.61,115.28999,114.34,114.94,29685600,287.4450651\n2004-02-27T14:30:00Z,115.19,115.74001,114.63,115.02,39275008,287.770014\n2004-03-01T14:30:00Z,115.42999,116.34,115.25,116.16,33192800,297.4418908\n2004-03-02T14:30:00Z,115.94,116.97,115.23,115.48,38607392,295.2423726\n2004-03-03T14:30:00Z,115.25,115.87,114.92,115.69,31355392,296.2775839\n2004-03-04T14:30:00Z,115.72,116.10001,115.52,115.99001,21073296,298.3016632\n2004-03-05T14:30:00Z,115.42,116.95,115.28,116.38,55923008,301.539009\n2004-03-08T14:30:00Z,116.34,116.62,114.91,114.96001,39289600,292.7285028\n2004-03-09T14:30:00Z,115.10001,115.21001,114.24001,114.5,39749504,288.947084\n2004-03-10T14:30:00Z,114.72,114.77,112.56,112.58,67802816,272.814673\n2004-03-11T14:30:00Z,112.39999,113.27,111.10001,111.12,89377632,263.8040892\n2004-03-12T14:30:00Z,111.73,112.71001,111.58,112.58,54026608,273.0613753\n2004-03-15T14:30:00Z,112.27,112.35001,110.89999,111.2,57687296,263.0044383\n2004-03-16T14:30:00Z,111.78,112.06,110.84,111.78999,60105504,264.1877875\n2004-03-17T14:30:00Z,112.17999,113.25999,112.10001,113.03999,41879200,275.9206849\n2004-03-18T14:30:00Z,112.71001,113.27,111.92999,113.07001,60025008,277.8168633\n2004-03-19T14:30:00Z,112.41,112.57001,111.03999,111.06,48643296,260.2103597\n2004-03-22T14:30:00Z,110.53999,110.57001,109.10001,109.64999,62759008,247.1247685\n2004-03-23T14:30:00Z,110.25,110.39999,109.36,109.46001,54104304,244.1266941\n2004-03-24T14:30:00Z,109.58,110.14,108.85001,109.55,51594800,243.7766748\n2004-03-25T14:30:00Z,110.08,111.3,109.78999,111,49982096,256.4841742\n2004-03-26T14:30:00Z,110.955,111.78999,110.8,111.03,37413104,257.6881903\n2004-03-29T14:30:00Z,111.63,112.74001,111.58,112.59,44116800,272.8234391\n2004-03-30T14:30:00Z,112.3,113.07001,112.22,112.97,39061392,275.4519102\n2004-03-31T14:30:00Z,112.99001,113.39999,112.38,113.10001,48596496,276.5465557\n2004-04-01T14:30:00Z,113.07001,113.87,113.05,113.78,45114304,282.5797624\n2004-04-02T14:30:00Z,114.81,114.84,113.89999,114.64,50997696,287.9388134\n2004-04-05T13:30:00Z,114.46001,115.38,114.44,115.27,30280096,292.6108636\n2004-04-06T13:30:00Z,114.83,115.17999,114.62,114.89999,28480096,291.9441672\n2004-04-07T13:30:00Z,114.98,114.98,114.11,114.63,45898400,289.5658873\n2004-04-08T13:30:00Z,115.41,115.41,113.74001,114.37,46937808,286.8202588\n2004-04-12T13:30:00Z,114.58,115.08,114.57001,114.82001,23087200,288.4015226\n2004-04-13T13:30:00Z,115.25999,115.3,113.02,113.21001,56235504,276.0217194\n2004-04-14T13:30:00Z,112.61,113.64,112.55,113.39,62334304,276.1697202\n2004-04-15T13:30:00Z,113.45,113.78,112.36,112.96001,61621008,274.2564673\n2004-04-16T13:30:00Z,113.36,114.05,112.98,113.83,47059296,279.8225467\n2004-04-19T13:30:00Z,113.57001,113.99001,113.27,113.83,28278000,280.8568418\n2004-04-20T13:30:00Z,114.08,114.32001,111.78,111.92,53345104,266.4704746\n2004-04-21T13:30:00Z,112.2,112.95,111.87,112.67,50301296,268.2388002\n2004-04-22T13:30:00Z,112.48,114.67,112.44,114.25,62142800,281.9901314\n2004-04-23T13:30:00Z,114.42,114.57001,113.78999,114.36,29422096,283.2189213\n2004-04-26T13:30:00Z,114.5,114.94,113.60001,114.2,35565200,282.0796289\n2004-04-27T13:30:00Z,114.23,115.12,113.96001,114.3,43490496,282.3589834\n2004-04-28T13:30:00Z,113.89,114.00999,112.5,112.82001,50173504,268.9229455\n2004-04-29T13:30:00Z,112.72,113.32001,111.16,111.83,69703376,261.6465018\n2004-04-30T13:30:00Z,112.12,112.38,110.89999,110.96001,48683904,255.936448\n2004-05-03T13:30:00Z,111.37,112.28999,111.35001,112.14999,33764608,263.4613224\n2004-05-04T13:30:00Z,112.25,113.25999,111.66,112.06,51193904,263.5000007\n2004-05-05T13:30:00Z,112.41,112.96001,112.16,112.78,34430304,268.8743042\n2004-05-06T13:30:00Z,112.02,112.58949,111,111.81,55006896,262.7241603\n2004-05-07T13:30:00Z,111.22,112.23,109.96001,109.96001,60957104,250.1162698\n2004-05-10T13:30:00Z,109.44,109.75,108.36,108.83,75336320,240.447673\n2004-05-11T13:30:00Z,109.46001,110.05,109.33,109.75,48348704,246.6461357\n2004-05-12T13:30:00Z,109.61,110.53999,108.06,110.45,90896000,251.5808337\n2004-05-13T13:30:00Z,109.75999,110.81,109.63,109.99001,57500704,251.0831556\n2004-05-14T13:30:00Z,109.98,110.74001,109.27,110.03999,54131808,251.5050418\n2004-05-17T13:30:00Z,108.89,109.5,108.41,109.10001,55069504,245.4297581\n2004-05-18T13:30:00Z,109.49001,109.94,109.33,109.64999,30203104,250.0380533\n2004-05-19T13:30:00Z,110.5,111.17999,109.14999,109.27,55014304,245.6263809\n2004-05-20T13:30:00Z,109.45,109.87,109.03999,109.62,38126192,246.0467069\n2004-05-21T13:30:00Z,109.97,110.55,109.47,109.81,47486608,246.8363784\n2004-05-24T13:30:00Z,110.53,110.75999,109.67999,110.27,40976800,248.3737506\n2004-05-25T13:30:00Z,109.89999,111.98,109.60001,111.85001,51714096,259.258085\n2004-05-26T13:30:00Z,111.66,112.28999,111.50999,112.24001,35982704,261.791019\n2004-05-27T13:30:00Z,112.53999,113.03,112.06,112.87,45311904,265.953502\n2004-05-28T13:30:00Z,112.73,112.88,112.36,112.86,23369008,266.68095\n2004-06-01T13:30:00Z,112.46001,112.86,111.87,112.71001,41059200,266.7263956\n2004-06-02T13:30:00Z,113.03,113.48,112.46001,113.13,39780496,269.0936921\n2004-06-03T13:30:00Z,112.81,113.19,112.07001,112.09,38719008,261.1379117\n2004-06-04T13:30:00Z,112.98,113.58,112.71001,112.98,32759904,265.9996023\n2004-06-07T13:30:00Z,113.5,114.81,113.42,114.7,31673600,282.4809688\n2004-06-08T13:30:00Z,114.37,114.92,114.17,114.86,32852400,284.7050759\n2004-06-09T13:30:00Z,114.50999,114.7,113.72,113.78999,36802496,276.8268444\n2004-06-10T13:30:00Z,114.03999,114.35001,113.92999,114.35001,21718608,279.6217937\n2004-06-14T13:30:00Z,113.82001,113.85001,112.87,113.22,34634896,270.0534124\n2004-06-15T13:30:00Z,113.89999,114.44501,113.50999,114.02,37446000,274.4728625\n2004-06-16T13:30:00Z,114,114.2,113.7,114,26638704,274.5106076\n2004-06-17T13:30:00Z,113.78999,114.07001,113.33,113.83,28473904,273.6618298\n2004-06-18T13:30:00Z,113.27,114.22,113.17999,113.63,31803104,273.6231489\n2004-06-21T13:30:00Z,113.75,114.14,113.13,113.2,24740800,271.8410466\n2004-06-22T13:30:00Z,113.13,113.88,112.67,113.77,37337392,274.2144232\n2004-06-23T13:30:00Z,113.58,114.84,113.42,114.75,35760304,281.5156495\n2004-06-24T13:30:00Z,114.5,114.92999,114.25999,114.39,39410608,281.1258688\n2004-06-25T13:30:00Z,114.41,114.94,113.67999,113.84,32872704,278.1531559\n2004-06-28T13:30:00Z,114.53,114.61,113.41,113.45,41277392,274.308533\n2004-06-29T13:30:00Z,113.5,114.17,113.42,113.92,28426896,276.1173565\n2004-06-30T13:30:00Z,114.07001,114.78999,113.64999,114.53,52610400,280.2445463\n2004-07-01T13:30:00Z,114.25,114.39999,112.58,112.94,57778192,267.2647948\n2004-07-02T13:30:00Z,113.16,113.28999,112.60001,112.88,34620496,266.1307448\n2004-07-06T13:30:00Z,112.37,112.45,111.63,111.89,38710608,256.9395683\n2004-07-07T13:30:00Z,111.81,112.57001,111.75,112.22,30039296,258.8159057\n2004-07-08T13:30:00Z,111.75,112.32001,111.2,111.42,45292000,254.3182431\n2004-07-09T13:30:00Z,111.67,111.94,111.38,111.73,27411392,255.6207723\n2004-07-12T13:30:00Z,111.52,112.03999,111,111.78,35691296,256.464086\n2004-07-13T13:30:00Z,111.92,112.02,111.60001,111.86,26816096,256.8197634\n2004-07-14T13:30:00Z,111.25999,112.39,111.12,111.52,54236096,256.0099565\n2004-07-15T13:30:00Z,111.74001,111.91,110.7,110.8,38432800,251.4878965\n2004-07-16T13:30:00Z,111.57001,111.67,110.44,110.71001,40873200,248.685668\n2004-07-19T13:30:00Z,110.75,110.96001,109.99001,110.24001,39598096,245.1160668\n2004-07-20T13:30:00Z,110.53,111.89999,110.25,111.64,47290096,255.7529208\n2004-07-21T13:30:00Z,111.82001,112.06,109.45,109.58,56264192,241.9942932\n2004-07-22T13:30:00Z,109.36,110.39,108.77,109.88,72660128,241.9942874\n2004-07-23T13:30:00Z,109.62,109.71001,108.69,108.96001,49610608,235.2494658\n2004-07-26T13:30:00Z,109.21001,109.42999,108.21001,108.75,49687904,233.2017819\n2004-07-27T13:30:00Z,109.05,110.11,108.97,109.77,51311392,241.0790413\n2004-07-28T13:30:00Z,109.55,110.37,108.59,110.10001,66079120,244.0328605\n2004-07-29T13:30:00Z,110.53999,110.87,110,110.57001,52353600,247.0063544\n2004-07-30T13:30:00Z,110.32001,110.89999,110.10001,110.84,41589696,248.9616562\n2004-08-02T13:30:00Z,110.19,113.61,110.05,111.07001,38802608,252.7151049\n2004-08-03T13:30:00Z,110.92999,111.06,110.16,110.21001,40988096,247.6595907\n2004-08-04T13:30:00Z,109.89,110.75,109.64,110.2,40787008,247.5629178\n2004-08-05T13:30:00Z,110.28999,110.38,108.27,108.39999,50819296,232.8535055\n2004-08-06T13:30:00Z,107.63,107.965,106.62,106.85001,74748624,219.6649554\n2004-08-09T13:30:00Z,107.02,107.48,106.87,107,37481104,219.3992001\n2004-08-10T13:30:00Z,107.31,108.41,107.25999,108.22,56101696,230.8519765\n2004-08-11T13:30:00Z,107.66,108.33,107.10001,108.16,53001200,232.8571182\n2004-08-12T13:30:00Z,107.62,107.95,106.63,106.98,50037808,224.3742553\n2004-08-13T13:30:00Z,107.12,107.35001,106.59,107.19,41640800,224.5994566\n2004-08-16T13:30:00Z,107.14,108.64,107.10001,108.3,45747008,234.5348134\n2004-08-17T13:30:00Z,108.75,109.28,108.53,108.91,40775104,239.7317831\n2004-08-18T13:30:00Z,108.53999,110.17,108.49001,110.03,43204192,248.453877\n2004-08-19T13:30:00Z,109.81,110.02,109.17999,109.71001,39968800,248.464862\n2004-08-20T13:30:00Z,109.61,110.63,109.50999,110.48,44893696,254.3904853\n2004-08-23T13:30:00Z,110.55,110.77,110.05,110.2,33850304,253.709652\n2004-08-24T13:30:00Z,110.69,110.73,109.85001,110.35001,30553600,253.341644\n2004-08-25T13:30:00Z,110.33,111.27,109.89999,111.10001,38582000,257.4910917\n2004-08-26T13:30:00Z,110.99001,111.31,110.85001,111.10001,26634096,258.0837769\n2004-08-27T13:30:00Z,111.23,111.63,111.05,111.45,24904704,260.7418512\n2004-08-30T13:30:00Z,111.23,111.34,110.45,110.53,26729808,253.1481012\n2004-08-31T13:30:00Z,110.66,111.16,110.10001,111.11,44207808,255.1567207\n2004-09-01T13:30:00Z,110.94,111.64,110.48,111.32001,52792608,256.7425972\n2004-09-02T13:30:00Z,111.24001,112.7,111.24001,112.58,42831392,267.9744138\n2004-09-03T13:30:00Z,112.27,112.82001,112.00999,112.12,30491600,267.3521339\n2004-09-07T13:30:00Z,112.53999,113.13,112.32001,112.86,37352496,273.0984046\n2004-09-08T13:30:00Z,112.62,113.06,112.31,112.58,33004800,272.1872732\n2004-09-09T13:30:00Z,112.57001,112.88,112.03,112.48,34332400,271.5677038\n2004-09-10T13:30:00Z,112.52,113.27,112.08,113.06,27914608,274.9374031\n2004-09-13T13:30:00Z,113.31,113.74001,113.00999,113.42999,44537904,277.7133176\n2004-09-14T13:30:00Z,113.3,113.69,113.19,113.66,28067296,279.0624555\n2004-09-15T13:30:00Z,113.3,113.36,112.67999,112.8,38458800,272.2716991\n2004-09-16T13:30:00Z,112.94,113.37,112.8,113.14,23917504,273.8863574\n2004-09-17T13:30:00Z,112.91,113.36,112.69,113.14999,33694496,274.5894238\n2004-09-20T13:30:00Z,112.67,112.99001,112.28,112.47,37189808,269.9836288\n2004-09-21T13:30:00Z,112.75,113.47,112.53999,112.96001,40929392,273.339616\n2004-09-22T13:30:00Z,112.5,112.52,111.47,111.55,49169200,260.4358399\n2004-09-23T13:30:00Z,111.60001,111.7,110.95,110.95,44090304,256.021264\n2004-09-24T13:30:00Z,111.17,111.73,111.13,111.46001,35011600,258.8376762\n2004-09-27T13:30:00Z,111.10001,111.2,110.58,110.75,39672096,253.4044497\n2004-09-28T13:30:00Z,110.91,111.50999,110.41,111.28,41702304,255.9144225\n2004-09-29T13:30:00Z,111.21001,111.85001,111,111.84,33866704,259.571425\n2004-09-30T13:30:00Z,111.55,111.98,111.25999,111.75999,43592096,260.3252766\n2004-10-01T13:30:00Z,112.25999,113.64999,112.21001,113.64999,62844304,278.4654024\n2004-10-04T13:30:00Z,114.09,114.44,113.8,113.84,33587104,280.3823759\n2004-10-05T13:30:00Z,113.85001,114.16,113.53999,113.89999,37162704,280.4482504\n2004-10-06T13:30:00Z,113.77,114.67999,113.67999,114.62,42297808,286.0214501\n2004-10-07T13:30:00Z,114.38,114.39999,113.36,113.45,39410304,277.7996309\n2004-10-08T13:30:00Z,113.14999,113.7,112.35001,112.50999,51882800,271.3156007\n2004-10-11T13:30:00Z,112.78,113.02,112.64,112.97,20246192,273.3967721\n2004-10-12T13:30:00Z,112.2,112.83,111.94,112.53,41855296,271.943143\n2004-10-13T13:30:00Z,113,113.07001,111.32001,111.53999,54434304,265.1853778\n2004-10-14T13:30:00Z,111.75,111.92999,110.58,110.64,64549392,258.8180955\n2004-10-15T13:30:00Z,111.03999,111.74001,110.57001,111.25999,63483392,260.9672472\n2004-10-18T13:30:00Z,110.89,111.89999,110.7,111.67999,43762608,263.7401617\n2004-10-19T13:30:00Z,112.02,112.23,110.59,110.74001,56057808,258.61469\n2004-10-20T13:30:00Z,110.38,110.82001,109.75,110.52,57174896,256.5224705\n2004-10-21T13:30:00Z,110.78999,111.32001,110.21001,111.24001,53261696,260.8020873\n2004-10-22T13:30:00Z,111.19,111.25,109.86,109.99001,48759808,250.8281039\n2004-10-25T13:30:00Z,109.75,110.12,109.35001,109.86,44055392,249.4261904\n2004-10-26T13:30:00Z,110.10001,111.60001,109.88,111.53999,54483296,264.4468712\n2004-10-27T13:30:00Z,111.38,113.10001,111.12,112.88,73928496,274.6553344\n2004-10-28T13:30:00Z,112.78,113.56,112.49001,113.22,54427008,277.4053534\n2004-10-29T13:30:00Z,113.17999,113.64,112.89999,113.2,48824800,277.7141888\n2004-11-01T14:30:00Z,113.56,113.84,113.2,113.50999,36770896,279.5125539\n2004-11-02T14:30:00Z,113.67,114.57001,113.22,113.55,56258496,279.3545613\n2004-11-03T14:30:00Z,115.03,115.36,114.24001,114.98,77030000,289.7590693\n2004-11-04T14:30:00Z,114.78,116.67,114.67999,116.55,55456704,302.642354\n2004-11-05T14:30:00Z,117.05,117.64,116.49001,117.28,63308496,308.1501397\n2004-11-08T14:30:00Z,116.98,117.23,116.72,117.11,34161200,307.869549\n2004-11-09T14:30:00Z,117.08,117.5,116.75999,116.88,44713200,306.9308476\n2004-11-10T14:30:00Z,117.06,117.55,116.75999,116.97,45270192,306.9059223\n2004-11-11T14:30:00Z,117.17999,118.12,117.10001,117.86,38408000,314.7424743\n2004-11-12T14:30:00Z,117.97,119,117.67999,118.78999,55641808,321.9629915\n2004-11-15T14:30:00Z,118.5,118.77,118.23,118.73,35299392,323.1683148\n2004-11-16T14:30:00Z,118.36,118.41,117.73,117.88,40136704,315.9782033\n2004-11-17T14:30:00Z,118.37,119.14,118.07001,118.58,54935008,320.1761769\n2004-11-18T14:30:00Z,118.49001,118.8,118.23,118.74001,31910704,321.362206\n2004-11-19T14:30:00Z,118.7,118.72,117.14,117.42,54280096,309.8795063\n2004-11-22T14:30:00Z,117.17,118.12,117.03,117.98,37566496,311.8808361\n2004-11-23T14:30:00Z,117.92999,118.25999,117.37,118.16,41973008,313.6169965\n2004-11-24T14:30:00Z,118.27,118.59,118.05,118.44,29732800,315.5173659\n2004-11-26T14:30:00Z,118.50999,118.98,118.3,118.35001,15490000,314.921871\n2004-11-29T14:30:00Z,118.78999,119.00999,117.48,117.81,61760608,311.2159809\n2004-11-30T14:30:00Z,118,118.24001,117.64,117.89,54476096,310.5162747\n2004-12-01T14:30:00Z,118.16,119.5,118.10001,119.23,49909904,322.6471259\n2004-12-02T14:30:00Z,119.10001,119.87,119.00999,119.33,60177104,324.3588446\n2004-12-03T14:30:00Z,119.27,120.14,119.09,119.25,49073696,324.2102719\n2004-12-06T14:30:00Z,119.21001,119.64,118.84,119.21001,33045104,324.0670584\n2004-12-07T14:30:00Z,119.49001,119.62,118.03999,118.10001,52105696,315.7131314\n2004-12-08T14:30:00Z,118.21001,118.82001,118.00999,118.78999,43901104,318.1719356\n2004-12-09T14:30:00Z,118.14,119.46001,117.73,119.21001,60953104,322.0586259\n2004-12-10T14:30:00Z,118.88,119.56,118.85001,119.33,47852800,323.468466\n2004-12-13T14:30:00Z,119.75999,120.39999,119.35001,120.37,38708896,331.7815562\n2004-12-14T14:30:00Z,120.17999,120.96001,120.17999,120.78999,41736096,335.2515083\n2004-12-15T14:30:00Z,120.7,121.11,120.31,120.88,46759296,336.2987621\n2004-12-16T14:30:00Z,120.72,121.24001,120.03999,120.81,51650192,336.3830991\n2004-12-17T14:30:00Z,119.46001,119.97,119.16,119.44,71183008,325.206037\n2004-12-20T14:30:00Z,119.75,120.28999,119.17,119.47,47201392,324.6629724\n2004-12-21T14:30:00Z,119.60001,120.48,119.07001,120.39,33197600,329.9731643\n2004-12-22T14:30:00Z,120.38,121.08,120.05,120.67999,31507904,332.2127968\n2004-12-23T14:30:00Z,120.87,121.28,120.09,120.77,25647696,332.5537345\n2004-12-27T14:30:00Z,121.2,121.36,120.39,120.52,29984304,330.2745259\n2004-12-28T14:30:00Z,120.64,121.33,120.60001,121.17999,23429296,334.367552\n2004-12-29T14:30:00Z,121.08,121.39999,120.95,121.36,23770192,335.4856013\n2004-12-30T14:30:00Z,121.39999,121.57001,121.03999,121.13,21079696,334.5022867\n2004-12-31T14:30:00Z,121.3,121.66,120.8,120.87,28655600,332.5647904\n2005-01-03T14:30:00Z,121.56,121.75999,119.89999,120.3,55997600,328.535921\n2005-01-04T14:30:00Z,120.46001,120.53999,118.44,118.73,69258880,315.2982645\n2005-01-05T14:30:00Z,118.74001,119.25,118,118.00999,65871680,311.1831465\n2005-01-06T14:30:00Z,118.44,119.14999,118.25999,118.61,48281808,314.1729863\n2005-01-07T14:30:00Z,118.97,119.23,118.13,118.44,55853600,312.8417499\n2005-01-10T14:30:00Z,118.34,119.46001,118.34,119,56796496,316.6972959\n2005-01-11T14:30:00Z,118.64,118.74001,117.99001,118.17999,63353392,311.3512398\n2005-01-12T14:30:00Z,118.39999,118.84,117.52,118.57001,74303376,312.3861759\n2005-01-13T14:30:00Z,118.64,118.73,117.5,117.62,55780000,304.9365759\n2005-01-14T14:30:00Z,117.97,118.53,117.75999,118.24001,42033600,307.5336739\n2005-01-18T14:30:00Z,118.05,119.62,117.95,119.47,57437008,317.4988379\n2005-01-19T14:30:00Z,119.42999,119.52,118.21001,118.22,54907808,310.4042807\n2005-01-20T14:30:00Z,117.89,118.2,117.28999,117.5,72090000,304.6155388\n2005-01-21T14:30:00Z,117.78999,118,116.64999,116.78,63274704,299.7617987\n2005-01-24T14:30:00Z,117.09,117.34,116.37,116.55,58554800,297.6074047\n2005-01-25T14:30:00Z,116.91,117.47,116.72,116.88,68335312,298.6744151\n2005-01-26T14:30:00Z,117.32001,117.60001,117.03999,117.23,57442896,300.7419287\n2005-01-27T14:30:00Z,117.19,117.75,116.98,117.42999,56600496,301.9618846\n2005-01-28T14:30:00Z,117.49001,117.55,116.61,117.42999,60814096,302.1155691\n2005-01-31T14:30:00Z,117.97,118.25,117.71001,118.16,54141296,308.0886574\n2005-02-01T14:30:00Z,118.25,119.08,118.10001,118.91,52014000,314.3983295\n2005-02-02T14:30:00Z,119.06,119.59,118.89999,119.27,52606304,317.5298718\n2005-02-03T14:30:00Z,119.06,119.16,118.57001,118.96001,49143104,315.6012024\n2005-02-04T14:30:00Z,119,120.42999,118.98,120.23,50015008,327.1087108\n2005-02-07T14:30:00Z,120.25,120.52,119.96001,120.07001,46212800,327.2288804\n2005-02-08T14:30:00Z,120.17,120.64999,120.07001,120.21001,39454800,327.8959249\n2005-02-09T14:30:00Z,120.42,120.49001,119.25,119.31,55382896,320.959886\n2005-02-10T14:30:00Z,119.66,120.02,119.25999,119.74001,46020608,321.7832856\n2005-02-11T14:30:00Z,119.7,121.03999,119.46001,120.77,53271104,329.8320399\n2005-02-14T14:30:00Z,120.69,120.86,120.48,120.67999,32548896,330.3148647\n2005-02-15T14:30:00Z,120.8,121.42999,120.67999,121.13,44440096,334.1303057\n2005-02-16T14:30:00Z,120.92999,121.46001,120.67,121.21001,51789008,335.1271367\n2005-02-17T14:30:00Z,121.23,121.33,120.22,120.23,58153808,327.733529\n2005-02-18T14:30:00Z,120.17,120.48,119.89999,120.39,49544192,327.7832287\n2005-02-22T14:30:00Z,119.89999,120.47,118.58,118.60001,80842192,313.911719\n2005-02-23T14:30:00Z,118.92999,119.57001,118.62469,119.45,68308688,317.6220406\n2005-02-24T14:30:00Z,119.24001,120.32001,118.98,120.24001,69306368,322.8746535\n2005-02-25T14:30:00Z,120.27,121.67,120.17999,121.42999,61173392,333.2501113\n2005-02-28T14:30:00Z,121.14999,121.3,120.03999,120.63,69426688,329.1081571\n2005-03-01T14:30:00Z,120.78,121.52,120.78,121.23,47569296,333.1991218\n2005-03-02T14:30:00Z,120.75999,121.92999,120.64999,121.17,64233296,334.0081475\n2005-03-03T14:30:00Z,121.66,121.89999,120.7,121.22,62098608,333.7717138\n2005-03-04T14:30:00Z,122.05,122.83,121.78999,122.73,56172608,345.9728908\n2005-03-07T14:30:00Z,122.66,123.25,122.59,122.78999,43808192,347.1279526\n2005-03-08T14:30:00Z,122.67,123,122.11,122.33,44665808,344.3753101\n2005-03-09T14:30:00Z,121.97,122.28999,120.96001,120.97,73601376,332.769655\n2005-03-10T14:30:00Z,121.2,121.5,120.39999,121.24001,65303392,332.8752512\n2005-03-11T14:30:00Z,121.31,121.72,120.16,120.39,58132704,327.2860042\n2005-03-14T14:30:00Z,120.61,121.16,120.28,121.14,36338704,330.6894389\n2005-03-15T14:30:00Z,121.42,121.46001,120.08,120.14,62465808,324.0863833\n2005-03-16T14:30:00Z,119.7,119.88,118.89999,119.12,76723872,315.2524578\n2005-03-17T14:30:00Z,119.31,119.74001,118.98,119.36,62726400,315.7662726\n2005-03-18T14:30:00Z,119.11,119.53,118.14999,118.53999,61884192,309.8329486\n2005-03-21T14:30:00Z,118.71001,118.78,117.75999,118.10001,61430608,306.1112878\n2005-03-22T14:30:00Z,118.37,118.92999,116.89999,116.89999,93324624,298.9375428\n2005-03-23T14:30:00Z,116.94501,117.72,116.75,117,71946000,298.0179167\n2005-03-24T14:30:00Z,117.46001,117.99001,117.06,117.14,52019200,297.9781546\n2005-03-28T14:30:00Z,117.42,117.94,117.31,117.31,46941504,298.198264\n2005-03-29T14:30:00Z,117.14,117.89999,116.25,116.53,73040192,293.8046088\n2005-03-30T14:30:00Z,116.78,118.2,116.77,118.17999,62896704,307.2767085\n2005-03-31T14:30:00Z,118.19,118.46001,117.87,117.96001,65048800,307.3076712\n2005-04-01T14:30:00Z,118.63,118.99001,116.91,117.42999,97394816,303.6617469\n2005-04-04T13:30:00Z,117.36,117.86,116.74001,117.63,71609504,303.7680611\n2005-04-05T13:30:00Z,117.78,118.38,117.67,118.19,50079904,308.6612821\n2005-04-06T13:30:00Z,118.45,118.95,118.17999,118.60001,53311696,311.8597512\n2005-04-07T13:30:00Z,118.41,119.25999,118.32001,119.24001,47225504,316.4700198\n2005-04-08T13:30:00Z,119.17,119.21001,118,118,64288800,307.7191124\n2005-04-11T13:30:00Z,118.28999,118.42,117.83,118.09,45858000,306.8193398\n2005-04-12T13:30:00Z,117.89,119.06,117.07001,118.7,86547680,309.8349615\n2005-04-13T13:30:00Z,118.56,118.8,117.13,117.3,66058192,300.2582759\n2005-04-14T13:30:00Z,117.44,117.5,115.77,115.77,99638816,287.7264911\n2005-04-15T13:30:00Z,115.74001,116.2,114.10001,114.14999,134028816,275.9829487\n2005-04-18T13:30:00Z,114.12,114.96001,113.96001,114.5,100314816,276.4991897\n2005-04-19T13:30:00Z,115.10001,115.71001,114.83,115.41,68397120,284.1943281\n2005-04-20T13:30:00Z,115.39999,115.63,113.55,113.8,114822128,271.6263953\n2005-04-21T13:30:00Z,114.78999,116.21001,114.38,116.00999,87459504,286.0911492\n2005-04-22T13:30:00Z,115.74001,116.5,114.27,115.57001,89839504,285.1474535\n2005-04-25T13:30:00Z,115.86,116.5,115.72,116.33,52363504,291.3160545\n2005-04-26T13:30:00Z,115.96001,116.77,115.14999,115.2,75363808,285.4054057\n2005-04-27T13:30:00Z,114.86,116.07001,114.44,115.64999,85186128,287.3622649\n2005-04-28T13:30:00Z,115.27,115.67999,114.2,114.2,74218192,277.7055378\n2005-04-29T13:30:00Z,115.07001,115.87,113.97,115.75,104283312,285.5185904\n2005-05-02T13:30:00Z,116.07001,116.41,115.52,116.39999,56057104,289.3516487\n2005-05-03T13:30:00Z,116.07001,116.85001,115.69,116.60001,86824192,291.307024\n2005-05-04T13:30:00Z,116.64999,117.75,116.28,117.5,82477632,297.8440937\n2005-05-05T13:30:00Z,117.67,118,116.74001,117.46001,97322816,298.0618903\n2005-05-06T13:30:00Z,117.92999,117.99001,117.06,117.09,69602880,295.2214138\n2005-05-09T13:30:00Z,117.21001,118.08,117.05,117.82001,43971808,299.3381679\n2005-05-10T13:30:00Z,117.36,117.5,116.39,116.60001,75030624,290.2435939\n2005-05-11T13:30:00Z,116.92999,117.39999,115.85001,117.24001,92009312,291.9821146\n2005-05-12T13:30:00Z,117.32001,117.59,115.41,115.95,95571312,282.3684529\n2005-05-13T13:30:00Z,116.3,116.62,114.8,115.72,85440496,279.5017572\n2005-05-16T13:30:00Z,115.7,116.84,115.66,116.8,49351008,287.3470402\n2005-05-17T13:30:00Z,116.42999,117.7,116.16,117.58,61411904,292.3987086\n2005-05-18T13:30:00Z,118.07001,119.08,118.00999,118.78999,78052688,303.472677\n2005-05-19T13:30:00Z,119.02,119.41,118.7,119.28999,62850096,307.0211657\n2005-05-20T13:30:00Z,119.34,119.39,118.74001,119.12,46424800,306.003146\n2005-05-23T13:30:00Z,119.21001,120.03999,119.19,119.78,51291600,311.4472631\n2005-05-24T13:30:00Z,119.44,119.83,119.2,119.5,50997600,310.9427999\n2005-05-25T13:30:00Z,119.35001,119.87,118.83,119.41,48481008,310.7641663\n2005-05-26T13:30:00Z,119.78999,120.21001,119.62,120.05,43554192,316.2923637\n2005-05-27T13:30:00Z,120.06,120.25,119.8,120.25,24641504,317.3845989\n2005-05-31T13:30:00Z,120.08,120.17,119.39999,119.48,44926800,311.049868\n2005-06-01T13:30:00Z,119.52,120.92,119.45,120.5,69917680,318.6054235\n2005-06-02T13:30:00Z,120.23,120.84,120.10001,120.75999,40481008,320.5596712\n2005-06-03T13:30:00Z,120.55,120.89,119.73,120.14999,61052000,317.1852645\n2005-06-06T13:30:00Z,120.02,120.2,119.55,120.03999,36332000,316.185247\n2005-06-07T13:30:00Z,120.39,121.25,120.00999,120.13,66684192,315.9726917\n2005-06-08T13:30:00Z,120.42999,120.59,119.67,119.91,50022192,314.3819702\n2005-06-09T13:30:00Z,119.74001,120.58,119.44,120.48,57162896,317.052735\n2005-06-10T13:30:00Z,120.56,120.64999,119.60001,120.2,36504096,315.8280191\n2005-06-13T13:30:00Z,119.94,121.08,119.81,120.58,49501696,318.2949308\n2005-06-14T13:30:00Z,120.45,121.2,120.38,120.86,34001600,320.8453135\n2005-06-15T13:30:00Z,121.16,121.24001,120.23,121.09,53889904,321.8982535\n2005-06-16T13:30:00Z,121.09,121.64,120.92,121.39999,46642304,323.9839886\n2005-06-17T13:30:00Z,121.53999,121.89999,120.49001,121.36,53732800,323.7833025\n2005-06-20T13:30:00Z,121.08,121.84,120.94,121.39999,42228096,324.2753276\n2005-06-21T13:30:00Z,121.5,121.64999,121.03,121.47,40059200,324.7213304\n2005-06-22T13:30:00Z,121.67999,121.94,121.07001,121.57001,46678400,324.846933\n2005-06-23T13:30:00Z,121.32001,121.60001,119.83,119.86,62813392,309.9182817\n2005-06-24T13:30:00Z,119.88,120.0078,118.84,118.98,59186608,302.868684\n2005-06-27T13:30:00Z,118.97,119.41,118.75,119.14999,51163600,302.9749237\n2005-06-28T13:30:00Z,119.39999,120.24001,119.37,120.14999,42615392,312.4127701\n2005-06-29T13:30:00Z,120.37,120.39999,119.75999,119.83,43059008,311.2271878\n2005-06-30T13:30:00Z,120.22,120.32001,118.95,119.17999,62301600,306.4580616\n2005-07-01T13:30:00Z,119.45,119.8,119.21001,119.53,49786400,307.0404729\n2005-07-05T13:30:00Z,119.25,120.64999,119.19,120.49001,51550192,314.608095\n2005-07-06T13:30:00Z,120.39,120.64999,119.41,119.48,54068800,309.5781527\n2005-07-07T13:30:00Z,118.28999,119.95,118.25999,119.95,103262368,313.8430158\n2005-07-08T13:30:00Z,119.97,121.32001,119.72,121.32001,64550608,324.2965756\n2005-07-11T13:30:00Z,121.33,122.10001,121.31,121.94,49762496,329.7551855\n2005-07-12T13:30:00Z,121.89,122.63,121.64,122.25999,52165008,332.2369396\n2005-07-13T13:30:00Z,122.27,122.52,121.99001,122.42999,41266000,333.165333\n2005-07-14T13:30:00Z,122.98,123.44,122.49001,122.91,64775808,336.1669483\n2005-07-15T13:30:00Z,122.78999,123.03999,122.36,122.84,56137808,335.8589489\n2005-07-18T13:30:00Z,122.5,122.63,122.05,122.35001,56816304,331.9480204\n2005-07-19T13:30:00Z,122.71001,123.11,122.41,123.02,59507296,336.8217051\n2005-07-20T13:30:00Z,122.59,123.73,122.3,123.44,69602496,339.5754335\n2005-07-21T13:30:00Z,123.55,123.61,122.47,122.72,100791120,335.4403827\n2005-07-22T13:30:00Z,122.88,123.56,122.63,123.53999,55933008,339.7903135\n2005-07-25T13:30:00Z,123.41,123.95,122.85001,123.19,57591504,338.7846764\n2005-07-26T13:30:00Z,123.23,123.53,122.37,123.34,42847504,339.4173925\n2005-07-27T13:30:00Z,123.5,123.89,123.05,123.78999,45262704,341.8840117\n2005-07-28T13:30:00Z,123.99001,124.64,123.64,124.57001,48448496,347.5434148\n2005-07-29T13:30:00Z,124.41,124.63,123.5,123.74001,62446304,342.193391\n2005-08-01T13:30:00Z,123.83,124.03999,123.45,123.64999,42940704,341.3332299\n2005-08-02T13:30:00Z,123.87,124.60001,123.74001,124.39,46241200,347.3020739\n2005-08-03T13:30:00Z,124.25,124.74001,124.12,124.72,37197600,349.3291882\n2005-08-04T13:30:00Z,124.23,124.31,123.57001,123.72,51043696,341.6343297\n2005-08-05T13:30:00Z,123.45,123.98,122.67,122.88,53711104,335.9163949\n2005-08-08T13:30:00Z,123.17,123.41,122.38,122.64999,48227008,334.1294389\n2005-08-09T13:30:00Z,123.06,123.59,122.87,123.39,47522304,338.8723367\n2005-08-10T13:30:00Z,123.82001,124.5,122.82001,123.33,73115632,337.9965142\n2005-08-11T13:30:00Z,123.27,124.03,123.00999,123.82001,58860304,340.4568743\n2005-08-12T13:30:00Z,123.57001,123.69,122.75,123.06,54814608,335.3204357\n2005-08-15T13:30:00Z,123.22,123.87,122.83,123.82001,36227504,339.3639769\n2005-08-16T13:30:00Z,123.44,123.52,122.09,122.21001,72265008,326.3952551\n2005-08-17T13:30:00Z,122.19,122.87,122.03,122.2,62507696,325.2718767\n2005-08-18T13:30:00Z,122.05,122.56,121.84,122.19,53546096,325.4665134\n2005-08-19T13:30:00Z,122.63,122.82001,122.2,122.47,39955808,326.868503\n2005-08-22T13:30:00Z,122.58,123.23,121.88,122.47,69948320,326.5438627\n2005-08-23T13:30:00Z,122.5,122.61,121.14999,122.24001,56743296,324.3947844\n2005-08-24T13:30:00Z,121.94,122.73,121.09,121.14999,79135312,317.8605322\n2005-08-25T13:30:00Z,121.35001,121.67,121.21001,121.59,35642000,319.5742072\n2005-08-26T13:30:00Z,121.48,121.49001,120.67999,120.75999,61962304,312.5883834\n2005-08-29T13:30:00Z,120.41,121.78,120.38,121.69,56183392,318.1968459\n2005-08-30T13:30:00Z,121.25,121.3,120.39,121.05,74179872,315.802109\n2005-08-31T13:30:00Z,121.19,122.66,120.74001,122.58,102979312,326.9117784\n2005-09-01T13:30:00Z,122.50999,123.14999,121.14,122.49001,74582624,327.8567156\n2005-09-02T13:30:00Z,122.85001,122.88,122.03999,122.27,47656304,326.142489\n2005-09-06T13:30:00Z,122.66,123.8,122.64999,123.7,57253808,337.7655203\n2005-09-07T13:30:00Z,123.63,124.13,123.46001,123.91,41754304,339.5283081\n2005-09-08T13:30:00Z,123.66,124,123.31,123.5,39070800,337.4559396\n2005-09-09T13:30:00Z,123.83,124.74001,123.8,124.60001,44112304,347.366433\n2005-09-12T13:30:00Z,124.45,124.67,124.27,124.35001,33024608,346.9922404\n2005-09-13T13:30:00Z,124.13,124.42,123.52,123.66,58479008,341.6644171\n2005-09-14T13:30:00Z,123.75,123.92,123.02,123.21001,55195392,338.3720928\n2005-09-15T13:30:00Z,123.50999,123.64999,122.89999,123.14999,73655808,337.2068338\n2005-09-16T13:30:00Z,123.28,123.74001,122.87,123.5,75425808,338.6281296\n2005-09-19T13:30:00Z,123.47,123.55,122.64,123.09,53373696,335.5925078\n2005-09-20T13:30:00Z,123.21001,123.61,121.87,122.05,84997120,328.4661246\n2005-09-21T13:30:00Z,121.78999,121.87,120.78,120.91,94497808,318.3687914\n2005-09-22T13:30:00Z,120.95,121.66,120.44,121.34,84600368,319.6871612\n2005-09-23T13:30:00Z,121.24001,121.89,120.89999,121.44,59368704,320.6275103\n2005-09-26T13:30:00Z,122.02,122.24001,121.08,121.58,70425808,320.5035322\n2005-09-27T13:30:00Z,121.52,121.99001,121.02,121.55,66151376,320.0984434\n2005-09-28T13:30:00Z,121.91,122.12,121.2,121.67,58708496,320.1272507\n2005-09-29T13:30:00Z,121.55,122.86,121.08,122.66,66645632,326.1297982\n2005-09-30T13:30:00Z,122.62,123.03999,122.45,123.03999,47827104,328.504722\n2005-10-03T13:30:00Z,122.96001,123.34,122.45,122.60001,51015104,326.5962089\n2005-10-04T13:30:00Z,122.78999,123.03,121.16,121.22,60779696,316.2415222\n2005-10-05T13:30:00Z,121.25,121.31,119.57001,119.63,106061184,302.7373605\n2005-10-06T13:30:00Z,119.78,120.25999,118.17,119.2,141120816,298.6228651\n2005-10-07T13:30:00Z,119.7,120.05,119.13,119.61,75663120,299.7202829\n2005-10-10T13:30:00Z,119.67999,119.71001,118.3,118.60001,52678608,290.7327855\n2005-10-11T13:30:00Z,118.99001,119.39,118.32001,118.42999,75640688,288.0797122\n2005-10-12T13:30:00Z,118.39,119.13,117.41,117.5,100520496,282.8872538\n2005-10-13T13:30:00Z,117.46001,118.08,116.88,117.42999,99073120,282.0495456\n2005-10-14T13:30:00Z,118.12,118.81,117.56,118.67,88654368,291.8810968\n2005-10-17T13:30:00Z,118.77,119.27,118.45,119.11,68967808,294.8086425\n2005-10-18T13:30:00Z,118.94,118.96001,117.8,117.82001,75013312,283.8610971\n2005-10-19T13:30:00Z,117.56,119.8,117.12,119.78,116569184,295.5252903\n2005-10-20T13:30:00Z,119.49001,119.81,117.3,117.67,132087632,283.0595228\n2005-10-21T13:30:00Z,118.28999,118.78,117.50999,118.13,96580624,282.7579046\n2005-10-24T13:30:00Z,118.44,120.09,118.41,119.96001,72345120,299.5523973\n2005-10-25T13:30:00Z,119.72,120.24001,118.94,119.72,77054816,300.0836201\n2005-10-26T13:30:00Z,119.50999,120.53999,119.19,119.37,82692496,298.4892022\n2005-10-27T13:30:00Z,119.2,119.37,117.92999,118.10001,68286816,287.1706439\n2005-10-28T13:30:00Z,118.42999,119.95,118.10001,119.8,72959872,298.6515181\n2005-10-31T14:30:00Z,120.28999,121.3,120.13,120.13,80144880,301.9628442\n2005-11-01T14:30:00Z,120.58,120.89999,120.22,120.49001,66996128,303.6929438\n2005-11-02T14:30:00Z,120.17,121.75,120.13,121.75,74690880,313.4137359\n2005-11-03T14:30:00Z,122.14999,122.66,121.75,122.27,84900880,317.6630393\n2005-11-04T14:30:00Z,122.39999,122.46001,121.55,122.11,59156400,316.3466033\n2005-11-07T14:30:00Z,122.39999,122.62,121.85001,122.23,46765696,316.2047527\n2005-11-08T14:30:00Z,121.95,122.42,121.78999,122.23,42153696,316.6034665\n2005-11-09T14:30:00Z,122.08,122.95,121.86,122.39,57668704,318.0970009\n2005-11-10T14:30:00Z,122.34,123.86,121.75,123.34,79143376,324.5125009\n2005-11-11T14:30:00Z,123.35001,123.84,122.42999,123.75999,34867008,327.5103765\n2005-11-14T14:30:00Z,123.75999,124.02,123.38,123.69,45092800,327.502412\n2005-11-15T14:30:00Z,123.58,124.09,122.86,123.24001,69592496,324.8515526\n2005-11-16T14:30:00Z,123.37,123.55,122.98,123.49001,51133904,325.5171093\n2005-11-17T14:30:00Z,123.75,124.64999,123.14,124.64,55717504,333.1671417\n2005-11-18T14:30:00Z,125.03999,125.756,124.33,125.13,72437184,336.3722357\n2005-11-21T14:30:00Z,125.14999,125.91,124.98,125.75999,50021200,341.272775\n2005-11-22T14:30:00Z,125.56,126.52,125.42,126.3,66439872,345.302307\n2005-11-23T14:30:00Z,126.25,127.41,126.21001,127.03,50854704,351.8391322\n2005-11-25T14:30:00Z,126.98,127.22,126.81,127.13,15270000,352.6800413\n2005-11-28T14:30:00Z,127.25,127.27,126.03999,126.23,54503296,345.3031827\n2005-11-29T14:30:00Z,126.64999,126.98,126.09,126.09,51809504,342.5398298\n2005-11-30T14:30:00Z,126.16,126.52,125.28999,125.41,56075392,338.1784944\n2005-12-01T14:30:00Z,126.02,127.03,125.98,126.69,65510800,347.671721\n2005-12-02T14:30:00Z,126.77,127.08,126.5,126.85001,46724704,348.8701395\n2005-12-05T14:30:00Z,126.64,126.73,126.17999,126.58,59367104,347.0089747\n2005-12-06T14:30:00Z,127.05,127.74001,126.63,126.82001,57942800,347.7025475\n2005-12-07T14:30:00Z,126.78999,126.87,125.67999,126.08,66826000,341.1200424\n2005-12-08T14:30:00Z,126.22,126.82001,125.48,126,62586704,339.9999828\n2005-12-09T14:30:00Z,126.16,126.78,125.82001,126.33,50744704,341.7290639\n2005-12-12T14:30:00Z,126.71001,126.86,125.96001,126.45,48393808,341.8432717\n2005-12-13T14:30:00Z,126.39999,127.7,126.28999,127.31,88650880,348.4639915\n2005-12-14T14:30:00Z,127.19,128.09,127.14,127.81,64374896,352.7593749\n2005-12-15T14:30:00Z,127.84,128,127.17999,127.44,55903104,351.0834039\n2005-12-16T14:30:00Z,127.27,128.57001,126.36,126.36,46239008,346.0845989\n2005-12-19T14:30:00Z,126.73,126.87,125.69,125.71001,48819504,341.9566462\n2005-12-20T14:30:00Z,125.86,126.59,125.48,125.83,46604704,341.3522261\n2005-12-21T14:30:00Z,126.17,126.75999,125.8,126.03,51801200,342.0881754\n2005-12-22T14:30:00Z,126.31,126.69,126.08,126.69,32250496,347.1058993\n2005-12-23T14:30:00Z,126.78999,126.86,126.42,126.75999,27977296,347.5789986\n2005-12-27T14:30:00Z,126.92,127.05,125.38,125.47,44500704,337.1802804\n2005-12-28T14:30:00Z,125.73,125.99001,125.5,125.75,30764304,336.9086644\n2005-12-29T14:30:00Z,125.72,125.96001,125.06,125.19,33033600,333.001249\n2005-12-30T14:30:00Z,124.8,125.06,124.36,124.50999,44646096,327.4668657\n2006-01-03T14:30:00Z,125.10001,127,124.39,126.7,73388816,344.3927828\n2006-01-04T14:30:00Z,126.86,127.49001,126.7,127.3,52243200,349.4547794\n2006-01-05T14:30:00Z,127.17,127.59,126.88,127.38,47310496,350.3991392\n2006-01-06T14:30:00Z,128.03999,128.58,127.36,128.44,62892608,358.134925\n2006-01-09T14:30:00Z,128.42,129.06,128.38,128.77,43532704,361.1405368\n2006-01-10T14:30:00Z,128.39,128.98,128.25999,128.89999,44961392,363.0056226\n2006-01-11T14:30:00Z,129.02,129.44,128.73,129.31,49603904,365.7560851\n2006-01-12T14:30:00Z,129.08,129.28,128.44,128.8,40509296,362.3704719\n2006-01-13T14:30:00Z,128.57001,128.89999,128.2,128.67999,44858896,361.7128984\n2006-01-17T14:30:00Z,128.2,128.42,127.81,128.33,52181600,359.8886232\n2006-01-18T14:30:00Z,127.58,128.89999,127.16,127.82001,75066496,358.4138002\n2006-01-19T14:30:00Z,128.09,128.77,127.81,128.31,78049184,362.2556185\n2006-01-20T14:30:00Z,128.28,128.31,125.97,125.97,115312000,341.2493554\n2006-01-23T14:30:00Z,126.21001,126.82001,126.13,126.42,67094816,341.1606294\n2006-01-24T14:30:00Z,126.63,127.14999,126.42,126.55,53013904,341.9914873\n2006-01-25T14:30:00Z,127.03999,127.17999,125.84,126.66,87790624,341.6652145\n2006-01-26T14:30:00Z,127.28,127.67,126.75999,127.36,71360816,345.5245212\n2006-01-27T14:30:00Z,127.66,128.66,127.45,128.53999,65790880,355.975406\n2006-01-30T14:30:00Z,128.44,128.81,128.35001,128.44,33710192,356.2732353\n2006-01-31T14:30:00Z,128.32001,128.53999,127.49001,127.5,73131184,348.6392134\n2006-02-01T14:30:00Z,127.82001,128.42999,127.72,128.39,63562896,354.1397617\n2006-02-02T14:30:00Z,128.10001,128.14,126.8,126.89999,83628624,342.1002376\n2006-02-03T14:30:00Z,126.58,128.39,126.14,126.27,86042496,338.1378596\n2006-02-06T14:30:00Z,126.44,126.8,126.17,126.60001,45513392,339.6946878\n2006-02-07T14:30:00Z,126.38,126.66,125.39999,125.48,71227632,330.8676592\n2006-02-08T14:30:00Z,125.88,128.10001,125.60001,126.62,59426304,338.4231053\n2006-02-09T14:30:00Z,126.92,127.60001,126.37,126.41,62024304,337.2110874\n2006-02-10T14:30:00Z,126.42999,127.13,125.45,126.64,64509696,337.8999007\n2006-02-13T14:30:00Z,126.57001,126.78999,125.95,126.41,52309200,336.6556555\n2006-02-14T14:30:00Z,126.46001,128.03,123.64,127.75,90992496,344.2567082\n2006-02-15T14:30:00Z,127.66,128.32001,127.24001,128.2,85473504,346.9048145\n2006-02-16T14:30:00Z,128.34,129.21001,128.17999,129.16,61035392,355.0595299\n2006-02-17T14:30:00Z,129.09,129.16,128.58,128.81,40344400,353.7434471\n2006-02-21T14:30:00Z,129.12,129.39999,128.28999,128.49001,46461808,351.5404064\n2006-02-22T14:30:00Z,128.77,129.64999,128.64999,129.27,42338400,356.6519421\n2006-02-23T14:30:00Z,129.27,129.64,128.28,129.08,43450192,355.9852754\n2006-02-24T14:30:00Z,129.11,129.48,128.75999,129.41,36782704,357.3940519\n2006-02-27T14:30:00Z,129.39999,130.03999,129.28,129.46001,35880096,358.1250565\n2006-02-28T14:30:00Z,129.2,129.91,128.13,128.23,74397008,350.2524334\n2006-03-01T14:30:00Z,128.60001,129.49001,128.5,129.37,48646304,357.6379211\n2006-03-02T14:30:00Z,128.89999,129.42,128.61,129.36,60644496,359.5924266\n2006-03-03T14:30:00Z,128.66,130.07001,128.64999,128.75999,73429808,358.3348586\n2006-03-06T14:30:00Z,129.14,129.17999,127.85001,128.17,57479104,353.9276259\n2006-03-07T14:30:00Z,127.92,128.06,127.39999,127.97,61784704,351.8292198\n2006-03-08T14:30:00Z,127.7,128.44,127.17999,128.24001,66705120,353.9730752\n2006-03-09T14:30:00Z,128.33,128.67999,127.38,127.38,56523600,349.4781978\n2006-03-10T14:30:00Z,127.72,128.84,127.44,128.59,60491104,357.1804092\n2006-03-13T14:30:00Z,128.84,129.16,128.53,128.83,45713296,359.0825109\n2006-03-14T14:30:00Z,128.71001,130.23,128.61,130.17999,69879184,370.3131427\n2006-03-15T14:30:00Z,130.14999,130.86,129.85001,130.75999,53407504,374.1775637\n2006-03-16T14:30:00Z,130.98,131.47,130.84,131.03,67083632,376.5919607\n2006-03-17T14:30:00Z,130.67999,130.89999,130.38,130.62,47286800,373.6853281\n2006-03-20T14:30:00Z,130.64,130.89999,130.21001,130.41,45541200,372.4495123\n2006-03-21T14:30:00Z,130.34,130.99001,129.45,129.59,87404128,367.7453164\n2006-03-22T14:30:00Z,129.50999,130.50999,129.45,130.38,51606896,372.5273899\n2006-03-23T14:30:00Z,130.24001,130.39349,129.66,130.11,46836400,371.97138\n2006-03-24T14:30:00Z,129.99001,130.57001,129.74001,130.21001,43213696,372.5630829\n2006-03-27T14:30:00Z,130.03,130.28,129.74001,130.02,32523200,371.8718454\n2006-03-28T14:30:00Z,129.92999,130.53,129.05,129.22,82081680,367.1384131\n2006-03-29T14:30:00Z,129.41,130.5,129.28999,130.03,61532704,372.438945\n2006-03-30T14:30:00Z,130.11,130.98,129.55,129.8,70572320,371.577352\n2006-03-31T14:30:00Z,130.02,130.24001,129.37,129.83,62925696,371.1637586\n2006-04-03T13:30:00Z,130.07001,130.87,129.49001,129.73,61627696,369.7180164\n2006-04-04T13:30:00Z,129.72,130.73,129.36,130.56,54810192,374.7222926\n2006-04-05T13:30:00Z,130.61,131.28,130.38,131.00999,50610704,378.2087183\n2006-04-06T13:30:00Z,130.85001,131.21001,130.19,130.87,57911008,378.0714555\n2006-04-07T13:30:00Z,131.06,131.39999,129.35001,129.53999,80183312,368.4326464\n2006-04-10T13:30:00Z,129.71001,130.08,129.25999,129.74001,41537008,367.9686293\n2006-04-11T13:30:00Z,129.85001,130.06,128.25,128.64,72805312,359.2708496\n2006-04-12T13:30:00Z,128.77,129.13,128.61,128.88,43051904,359.2429149\n2006-04-13T13:30:00Z,128.59,129.25,128.31,128.71001,51076896,358.9391911\n2006-04-17T13:30:00Z,128.78999,129.31,128.02,128.66,64169600,358.6614805\n2006-04-18T13:30:00Z,128.95,130.94,128.84,130.7,92662192,377.1432384\n2006-04-19T13:30:00Z,130.72,131.07001,130.24001,130.95,87273312,378.9634651\n2006-04-20T13:30:00Z,131,131.86,130.60001,131.13,86022496,380.2693336\n2006-04-21T13:30:00Z,131.73,131.78999,130.62,131.14999,72359312,379.4545788\n2006-04-24T13:30:00Z,130.92999,131.07001,130.38,130.91,52547296,377.282182\n2006-04-25T13:30:00Z,131.03999,131.12,129.92,130.37,84360368,372.7635389\n2006-04-26T13:30:00Z,130.5,131.14,130.3,130.39999,67266880,371.8678504\n2006-04-27T13:30:00Z,129.89999,131.63,129.59,131.03,124605376,376.2235566\n2006-04-28T13:30:00Z,130.78999,131.75,130.71001,131.47,55855104,379.8389146\n2006-05-01T13:30:00Z,131.47,131.8,130.32001,130.39999,65006608,373.5879391\n2006-05-02T13:30:00Z,131.00999,131.46001,130.74001,131.38,49087696,378.7249311\n2006-05-03T13:30:00Z,131.22,131.32001,130.45,130.89,60824608,375.4307326\n2006-05-04T13:30:00Z,131.08,131.62,130.34,131.36,42930496,377.1971317\n2006-05-05T13:30:00Z,132.05,132.8,131.85001,132.52,62589504,387.6200978\n2006-05-08T13:30:00Z,132.50999,132.77,132.36,132.36,30017296,387.2720676\n2006-05-09T13:30:00Z,132.42,132.77,132.31,132.62,29865008,388.9332069\n2006-05-10T13:30:00Z,132.41,132.75,131.89,132.55,64406896,389.1838937\n2006-05-11T13:30:00Z,132.50999,132.55,130.52,130.95,80654688,374.7760855\n2006-05-12T13:30:00Z,130.48,130.72,129.19,129.24001,91733376,360.0734593\n2006-05-15T13:30:00Z,128.78999,129.74001,128.61,129.5,84040368,360.9074457\n2006-05-16T13:30:00Z,129.75999,130,129.00999,129.31,62136400,360.271766\n2006-05-17T13:30:00Z,128.67,129.10001,126.77,126.85001,144779632,338.5703507\n2006-05-18T13:30:00Z,127.38,127.75,126.11,126.21001,87923872,334.0596757\n2006-05-19T13:30:00Z,126.87,127.49001,125.8,127.10001,124320880,336.9348527\n2006-05-22T13:30:00Z,126.28,127.17,125.5,126.13,110877376,331.2184287\n2006-05-23T13:30:00Z,127.17999,127.63,125.17,125.17,91990624,323.7015556\n2006-05-24T13:30:00Z,125.67999,126.89,124.75999,126.17,168394368,326.7336289\n2006-05-25T13:30:00Z,126.92,127.73,126.42999,127.73,78992128,339.8434846\n2006-05-26T13:30:00Z,128,128.38,127.50999,128.38,62990704,343.7923115\n2006-05-30T13:30:00Z,127.97,128,126.05,126.10001,72445504,323.4635501\n2006-05-31T13:30:00Z,126.58,127.50999,126.2,127.50999,86932688,330.2506026\n2006-06-01T13:30:00Z,127.38,128.94,127.27,128.73,73728000,340.2452182\n2006-06-02T13:30:00Z,129.25,129.42999,128.32001,129,91702688,341.7035508\n2006-06-05T13:30:00Z,128.78999,128.86,126.77,127.12,86119184,324.2856266\n2006-06-06T13:30:00Z,127.21001,127.38,125.75999,126.81,130874816,320.4162768\n2006-06-07T13:30:00Z,126.91,127.64999,125.78999,125.86,108703120,315.2934572\n2006-06-08T13:30:00Z,125.58,126.5,123.87,125.75,204960320,314.057232\n2006-06-09T13:30:00Z,126.36,126.96001,125.28999,125.35001,94976320,310.2484609\n2006-06-12T13:30:00Z,125.88,125.92999,123.82001,123.99001,95878192,299.8966069\n2006-06-13T13:30:00Z,123.78,124.84,122.55,122.55,185695872,291.6621287\n2006-06-14T13:30:00Z,122.84,123.63,122.34,123.5,163652000,295.7712837\n2006-06-15T13:30:00Z,123.92,126.36,123.86,126.12,134446320,320.1805543\n2006-06-16T13:30:00Z,125.19,125.56,124.46001,124.64999,94263008,313.7834583\n2006-06-19T13:30:00Z,125.39999,125.48,123.55,123.67,95817376,307.1915582\n2006-06-20T13:30:00Z,124.00999,124.81,123.72,124.09,65518304,307.3182084\n2006-06-21T13:30:00Z,124,125.7,123.96001,125.00999,75038688,315.5797134\n2006-06-22T13:30:00Z,124.95,125.06,124.03999,124.46001,74994128,312.9952336\n2006-06-23T13:30:00Z,124.33,125.3,124.03,124.44,54112496,312.6653164\n2006-06-26T13:30:00Z,124.53999,125.06,124.25,124.99001,37905200,316.3784686\n2006-06-27T13:30:00Z,125.00999,125.28999,123.77,123.91,69780880,309.2905251\n2006-06-28T13:30:00Z,124.19,124.77,123.64999,124.75,62368096,312.5463416\n2006-06-29T13:30:00Z,125.2,127.35001,125.17,127.27,110696624,336.2790466\n2006-06-30T13:30:00Z,127.47,127.66,126.96001,127.23,54229904,336.9947866\n2006-07-03T13:30:00Z,127.42999,128.00999,127.31,127.8,23936192,341.2299719\n2006-07-05T13:30:00Z,127.28999,127.45,126.52,127.07001,69653504,336.2363957\n2006-07-06T13:30:00Z,127.2,127.85001,127.08,127.44,51289504,338.7913362\n2006-07-07T13:30:00Z,127.19,127.56,126.28999,126.61,81628368,333.062946\n2006-07-10T13:30:00Z,126.94,127.42999,126.41,126.85001,60956400,333.2829683\n2006-07-11T13:30:00Z,126.61,127.41,125.94,127.41,73640816,336.8555352\n2006-07-12T13:30:00Z,127.21001,127.39999,125.72,126.05,82561376,327.1054813\n2006-07-13T13:30:00Z,125.5,125.67999,124,124,102454192,308.7339254\n2006-07-14T13:30:00Z,124.16,124.25999,122.83,123.52,103243184,303.9736844\n2006-07-17T13:30:00Z,123.5,124.10001,123.14999,123.34,81289632,302.6020638\n2006-07-18T13:30:00Z,123.74001,124.05,122.39,123.97,123697008,305.0643626\n2006-07-19T13:30:00Z,124.17999,126.25999,123.724,125.69,134399184,319.0402478\n2006-07-20T13:30:00Z,126.12,126.3,124.66,124.83,112337808,315.4425992\n2006-07-21T13:30:00Z,125.14999,125.19,123.82001,123.95,101722192,308.7198788\n2006-07-24T13:30:00Z,124.44,126.32001,124.44,126.21001,92889872,326.0979692\n2006-07-25T13:30:00Z,125.98,127.3,125.72,126.66,95483872,330.2493995\n2006-07-26T13:30:00Z,126.59,127.45,126.17999,126.83,84528128,331.8266454\n2006-07-27T13:30:00Z,127.33,127.69,126.2,126.71001,87257184,330.5436329\n2006-07-28T13:30:00Z,126.99001,128.14,126.86,127.98,82137184,340.0729271\n2006-07-31T13:30:00Z,127.66,127.96001,126.55,127.85001,49589104,341.2119541\n2006-08-01T13:30:00Z,127.34,127.38,126.60001,127.22,65220896,336.4876232\n2006-08-02T13:30:00Z,127.58,128.46001,127.55,128.08,64787504,344.0622763\n2006-08-03T13:30:00Z,127.33,128.55,127.14999,128.42,63704496,347.9118826\n2006-08-04T13:30:00Z,129.06,129.42999,127.48,128.2,96296624,346.8396865\n2006-08-07T13:30:00Z,127.89999,128.08,127.39999,127.95,45434400,344.5360431\n2006-08-08T13:30:00Z,128.09,128.46001,126.95,127.41,90898128,340.9749168\n2006-08-09T13:30:00Z,128.2,128.60001,126.61,126.98,78916128,336.8085237\n2006-08-10T13:30:00Z,126.53,127.5,126.28,127.37,69324320,338.2572942\n2006-08-11T13:30:00Z,127.17,127.2,126.39,127.00999,47489392,336.9823242\n2006-08-14T13:30:00Z,127.63,128.16,126.92,127.11,58044496,335.8593119\n2006-08-15T13:30:00Z,128.21001,128.87,127.89999,128.63,68149808,347.6318109\n2006-08-16T13:30:00Z,129.32001,129.89,129.03999,129.78999,71759184,357.8148259\n2006-08-17T13:30:00Z,129.58,130.37,129.49001,130.03,70994816,359.931767\n2006-08-18T13:30:00Z,130.19,130.69,129.59,130.69,58288400,363.4103753\n2006-08-21T13:30:00Z,130.17999,130.28,129.8,130.13,42133696,360.251459\n2006-08-22T13:30:00Z,129.94,130.52,129.67999,130.12,60840496,360.4741609\n2006-08-23T13:30:00Z,130.17999,130.44,129.19,129.75999,66610128,358.1176971\n2006-08-24T13:30:00Z,129.99001,130.10001,129.39999,129.64999,57982896,357.0416089\n2006-08-25T13:30:00Z,129.64,130.25,129.55,129.81,41757904,357.8059719\n2006-08-28T13:30:00Z,129.64999,130.82001,129.64,130.42999,52679504,363.2406177\n2006-08-29T13:30:00Z,130.49001,130.83,129.81,130.58,61817008,364.4844408\n2006-08-30T13:30:00Z,130.87,131.03999,130.55,130.66,50053104,364.4704023\n2006-08-31T13:30:00Z,130.85001,130.99001,130.58,130.64,38523008,363.6788191\n2006-09-01T13:30:00Z,131.14,131.58,130.84,131.42,48800000,369.3892208\n2006-09-05T13:30:00Z,131.50999,131.85001,131.2,131.67,52348896,370.882309\n2006-09-06T13:30:00Z,131.11,131.16,130.33,130.50999,53795600,360.3111283\n2006-09-07T13:30:00Z,130.06,130.57001,129.35001,129.91,86300624,355.9453754\n2006-09-08T13:30:00Z,130.08,130.46001,129.83,130.28,45107696,358.1726765\n2006-09-11T13:30:00Z,129.86,130.69,129.48,130.41,68497184,359.978232\n2006-09-12T13:30:00Z,130.56,131.84,130.3681,131.69,69888128,370.9876727\n2006-09-13T13:30:00Z,131.64,132.45,131.52,132.22,62913008,375.3067448\n2006-09-14T13:30:00Z,131.96001,132.24001,131.75,132.23,57812192,376.648236\n2006-09-15T13:30:00Z,132.31,132.39,131.67999,131.96001,76715680,374.9792658\n2006-09-18T13:30:00Z,131.78999,132.39,131.64999,132.14,64155504,375.8479985\n2006-09-19T13:30:00Z,132.12,132.13,131.07001,131.81,92097808,373.5414848\n2006-09-20T13:30:00Z,132.25,132.77,132.06,132.50999,75212816,378.4893314\n2006-09-21T13:30:00Z,132.61,132.75,131.42,131.87,88947008,373.8744827\n2006-09-22T13:30:00Z,131.67,131.67999,131,131.47,65969184,369.9945797\n2006-09-25T13:30:00Z,131.73,132.85001,131.05,132.48,92298320,376.2185777\n2006-09-26T13:30:00Z,132.5,133.60001,132.39999,133.58,74016624,385.4383469\n2006-09-27T13:30:00Z,133.49001,133.97,133.27,133.74001,82433872,386.8330241\n2006-09-28T13:30:00Z,133.74001,133.99001,133.28,133.69,58601600,386.7864468\n2006-09-29T13:30:00Z,133.8,133.94,133.48,133.58,47991696,386.0175934\n2006-10-02T13:30:00Z,133.53999,133.83,132.34,133.08,52444496,382.0799162\n2006-10-03T13:30:00Z,132.89,133.87,132.64999,133.36,73108688,383.5593179\n2006-10-04T13:30:00Z,133.23,135,133.08,134.92,80893312,396.2491952\n2006-10-05T13:30:00Z,134.92,135.41,134.75,135.17999,60640000,398.547796\n2006-10-06T13:30:00Z,134.95,135.10001,134.39999,135.00999,65001808,398.0935622\n2006-10-09T13:30:00Z,134.85001,135.3,134.64,135.09,41177904,398.8301277\n2006-10-10T13:30:00Z,135.11,135.45,134.84,135.27,56428496,399.9047502\n2006-10-11T13:30:00Z,134.84,135.42999,134.3,135.11,104076320,399.9824752\n2006-10-12T13:30:00Z,135.45,136.39,135.39999,136.28,59172896,410.9761925\n2006-10-13T13:30:00Z,136.16,136.71001,136.03999,136.63,53945296,413.403366\n2006-10-16T13:30:00Z,136.52,137.05,136.42,136.84,42275904,415.1153225\n2006-10-17T13:30:00Z,136.47,136.7,135.67,136.41,90785376,412.7604496\n2006-10-18T13:30:00Z,137.03999,137.37,136.10001,136.59,87371184,412.4803151\n2006-10-19T13:30:00Z,136.39,136.88,136.23,136.81,64081808,413.4172108\n2006-10-20T13:30:00Z,136.81,136.95,136.33,136.84,48099504,414.0379005\n2006-10-23T13:30:00Z,136.56,137.8,136.39,137.47,66234000,418.6622391\n2006-10-24T13:30:00Z,137.28,137.92999,137.22,137.88,53355392,421.5372073\n2006-10-25T13:30:00Z,137.74001,138.41,137.50999,138.35001,80750816,424.4553658\n2006-10-26T13:30:00Z,138.66,139,137.98,138.78,66848368,426.6814429\n2006-10-27T13:30:00Z,138.61,138.75,137.63,137.91,80239376,419.3397047\n2006-10-30T14:30:00Z,137.66,138.2,137.39999,137.81,49718096,418.6858525\n2006-10-31T14:30:00Z,138.07001,138.25999,137.25,137.78999,71297184,418.2764739\n2006-11-01T14:30:00Z,138.22,138.31,136.72,136.86,83006496,411.5085054\n2006-11-02T14:30:00Z,136.50999,137.00999,136.36,136.78,60703904,410.6088908\n2006-11-03T14:30:00Z,137.27,137.39,135.62,136.53999,71346368,408.4880961\n2006-11-06T14:30:00Z,136.96001,138.28,136.95,138.08,63312704,420.6295042\n2006-11-07T14:30:00Z,138.2,138.98,138,138.61,63363200,425.1607521\n2006-11-08T14:30:00Z,138,139.05,136.86,138.91,87519632,429.251878\n2006-11-09T14:30:00Z,139.00999,139.14,137.89999,138.17999,95917680,425.3051661\n2006-11-10T14:30:00Z,138.14,138.34,137.72,138.24001,48992000,424.9665141\n2006-11-13T14:30:00Z,138.17999,139.03999,138.07001,138.58,59403504,427.8056765\n2006-11-14T14:30:00Z,138.97,139.74001,138.12,139.62,96704192,433.9808407\n2006-11-15T14:30:00Z,139.57001,140.45,139.53,140.02,76518192,437.7546331\n2006-11-16T14:30:00Z,140.44,140.67999,139.49001,140.38,76740128,439.1560198\n2006-11-17T14:30:00Z,139.92999,140.42999,139.73,140.42,56357296,440.6901605\n2006-11-20T14:30:00Z,140.3,140.74001,139.94099,140.5,69185504,441.6729209\n2006-11-21T14:30:00Z,140.49001,140.67,140.28999,140.64,51371392,442.4817916\n2006-11-22T14:30:00Z,140.75,141.16,140.5,140.92,45508704,444.3572347\n2006-11-24T14:30:00Z,140.24001,140.84,140.2,140.35001,30998192,441.4143904\n2006-11-27T14:30:00Z,140.28,140.35001,138.38,138.42,84547376,423.9549252\n2006-11-28T14:30:00Z,138.24001,139.16,138.11,139.02,106667680,425.5576327\n2006-11-29T14:30:00Z,139.47,140.53,139.08279,140.47,91542000,437.6533447\n2006-11-30T14:30:00Z,140.44,141.05,139.75999,140.53,83997680,438.6762827\n2006-12-01T14:30:00Z,140.53,140.66,138.97,140.22,126156688,436.1569396\n2006-12-04T14:30:00Z,140.25,141.55,140.23,141.28999,87814496,445.1213115\n2006-12-05T14:30:00Z,141.56,141.96001,141.25999,141.89999,73380688,449.6577898\n2006-12-06T14:30:00Z,141.87,142.07001,141.5,141.78,53324000,449.3524861\n2006-12-07T14:30:00Z,142.03,142.3,141.11,141.16,62850304,445.6312232\n2006-12-08T14:30:00Z,141.13,141.89999,140.78,141.42,79624624,446.2795838\n2006-12-11T14:30:00Z,141.42,142.09,141.34,141.83,39779296,449.7797737\n2006-12-12T14:30:00Z,141.69,141.87,140.89,141.72,77453504,449.8204781\n2006-12-13T14:30:00Z,142.23,142.34,141.56,141.87,55568400,449.7097638\n2006-12-14T14:30:00Z,141.86,143.24001,141.84,143.12,64779200,459.9962632\n2006-12-15T14:30:00Z,142.64,142.89,142.24001,142.34,70858816,456.8643253\n2006-12-18T14:30:00Z,142.53999,142.88,141.75,141.95,48956800,454.5386145\n2006-12-19T14:30:00Z,141.55,142.56,141.19,142.22,65077504,455.9706675\n2006-12-20T14:30:00Z,142.28,142.66,142.00999,142.14,41473200,456.0295353\n2006-12-21T14:30:00Z,142.27,142.42999,141.32001,141.62,48698400,452.0906499\n2006-12-22T14:30:00Z,141.64,141.64999,140.67,140.75,62073200,444.4121089\n2006-12-26T14:30:00Z,140.81,141.61,140.78,141.58,32697600,449.4094743\n2006-12-27T14:30:00Z,141.87,142.60001,141.83,142.50999,39732496,457.865426\n2006-12-28T14:30:00Z,142.41,142.7,141.99001,142.21001,37291104,456.9689799\n2006-12-29T14:30:00Z,142.10001,142.53999,141.42999,141.62,45466704,453.2705487\n2007-01-03T14:30:00Z,142.25,142.86,140.57001,141.37,94808496,450.6657608\n2007-01-04T14:30:00Z,141.23,142.05,140.61,141.67,69634624,451.5241945\n2007-01-05T14:30:00Z,141.33,141.39999,140.38,140.53999,76688880,442.5055356\n2007-01-08T14:30:00Z,140.82001,141.41,140.25,141.19,69655808,445.0590923\n2007-01-09T14:30:00Z,141.31,141.60001,140.39999,141.07001,75681120,444.4956735\n2007-01-10T14:30:00Z,140.58,141.57001,140.3,141.53999,72447376,447.7160105\n2007-01-11T14:30:00Z,141.56,142.62,141.5,142.16,55532496,453.4734645\n2007-01-12T14:30:00Z,142.12,143.24001,142.11,143.24001,57631200,462.9130104\n2007-01-16T14:30:00Z,143.07001,143.44,142.73,142.96001,44988304,462.7359321\n2007-01-17T14:30:00Z,142.85001,143.46001,142.73,143.02,51597008,463.2205998\n2007-01-18T14:30:00Z,143.17,143.25999,142.31,142.53999,68234368,459.856027\n2007-01-19T14:30:00Z,142.53999,143.10001,142.46001,142.82001,56983904,461.0082229\n2007-01-22T14:30:00Z,143.07001,143.10001,141.92999,142.38,60261696,457.8007613\n2007-01-23T14:30:00Z,142.25999,143.08,142.06,142.8,54077200,459.6993514\n2007-01-24T14:30:00Z,142.97,143.98,142.91,143.95,56469392,470.0887304\n2007-01-25T14:30:00Z,143.84,143.92,142.00999,142.25999,73607312,457.6004485\n2007-01-26T14:30:00Z,142.57001,142.64999,141.58,142.16,74585632,455.5697585\n2007-01-29T14:30:00Z,142.19,142.8,141.74001,142.05,66216000,454.5977006\n2007-01-30T14:30:00Z,142.35001,142.86,142.06,142.78999,70410624,460.1723568\n2007-01-31T14:30:00Z,142.63,144.13,142.39999,143.75,91887872,467.5915724\n2007-02-01T14:30:00Z,144.14999,144.66,143.91,144.61,69316128,474.6113052\n2007-02-02T14:30:00Z,144.73,144.95,144.38,144.81,49607696,475.7125864\n2007-02-05T14:30:00Z,144.7,144.94,144.34,144.85001,45735200,476.3522744\n2007-02-06T14:30:00Z,144.97,145.03,144.33,144.89,57082192,476.5174982\n2007-02-07T14:30:00Z,145.12,145.36,144.57001,145.21001,55694192,477.7687254\n2007-02-08T14:30:00Z,144.78,145.12,144.27,145.02,70646000,477.4645213\n2007-02-09T14:30:00Z,145.06,145.33,143.39,143.94,79084880,469.4163963\n2007-02-12T14:30:00Z,143.94,144.03999,143.19,143.45,65657056,465.2059055\n2007-02-13T14:30:00Z,143.77,144.89999,143.75999,144.66,64107072,475.0036018\n2007-02-14T14:30:00Z,144.8,145.89999,144.78,145.61,66062368,483.7206168\n2007-02-15T14:30:00Z,145.67,145.95,145.42999,145.8,38721696,485.0661864\n2007-02-16T14:30:00Z,145.44,145.75999,145.23,145.73,39842800,485.7236492\n2007-02-20T14:30:00Z,145.56,146.2,144.06,146.03999,56923904,488.6602309\n2007-02-21T14:30:00Z,145.61,146.07001,145.35001,145.98,63973392,489.9180492\n2007-02-22T14:30:00Z,146.05,146.42,145.17,145.87,79079680,489.5126721\n2007-02-23T14:30:00Z,145.74001,145.78999,144.75,145.3,71971376,484.3170624\n2007-02-26T14:30:00Z,145.83,145.95,144.75,145.17,70074752,482.5494053\n2007-02-27T14:30:00Z,143.88,144.2,139,139.5,274909952,429.6495656\n2007-02-28T14:30:00Z,140.39,141.98,139.8,140.92999,177549680,432.3874539\n2007-03-01T14:30:00Z,139.34,141.25,138.05,140.50999,212841120,434.0065994\n2007-03-02T14:30:00Z,140.05,140.66,138.66,138.67,162600320,422.7215851\n2007-03-05T14:30:00Z,137.92999,139.58,137.33,137.35001,144137008,416.4121602\n2007-03-06T14:30:00Z,138.78,140.12,137.717,139.7,143379312,433.3031462\n2007-03-07T14:30:00Z,139.59,140.46001,139.39999,139.56,115224496,433.5793084\n2007-03-08T14:30:00Z,140.53999,141.16,140.07001,140.74001,117892256,442.9879938\n2007-03-09T14:30:00Z,141.31,141.42,140.08,140.78,107765632,442.4529164\n2007-03-12T13:30:00Z,140.42,141.34,140.16,140.99001,80371808,443.5231987\n2007-03-13T13:30:00Z,140.17999,140.77,138.03999,138.25,190080624,421.5001645\n2007-03-14T13:30:00Z,138.42999,139.36,136.75,139.28,231826880,424.4483504\n2007-03-15T13:30:00Z,138.97,139.99001,138.8,139.47,132413680,426.5128744\n2007-03-16T13:30:00Z,139.31,139.63,138.12,138.53,122046192,420.2944111\n2007-03-19T13:30:00Z,139.25999,140.33,138.5466,140.2,96213120,431.3083066\n2007-03-20T13:30:00Z,140.08,141.05,139.96001,140.97,83351248,437.1220288\n2007-03-21T13:30:00Z,141.10001,143.64999,140.82001,143.28999,153296944,457.082049\n2007-03-22T13:30:00Z,143.48,143.67999,142.78999,143.17999,118950624,457.7070295\n2007-03-23T13:30:00Z,143.28,143.81,143.14999,143.39,74425744,458.7249256\n2007-03-26T13:30:00Z,143.5,143.64999,142.09,143.2,113811504,457.1255061\n2007-03-27T13:30:00Z,143.12,143.16,142.39,142.86,100535184,453.9358385\n2007-03-28T13:30:00Z,142.14,142.47,141.25999,141.82001,152962064,445.3305031\n2007-03-29T13:30:00Z,142.53999,142.61,141.19,141.97,139480064,444.6227943\n2007-03-30T13:30:00Z,142.24001,142.84,140.56,142,128208496,443.7770026\n2007-04-02T13:30:00Z,142.16,142.46001,140.89,142.16,79428368,444.2026022\n2007-04-03T13:30:00Z,142.97,143.98,142.91,143.69,82499312,459.0806299\n2007-04-04T13:30:00Z,143.69,143.95,143.16,143.85001,64006528,460.5149595\n2007-04-05T13:30:00Z,143.67,144.44,143.61,144.24001,46843232,463.5454628\n2007-04-09T13:30:00Z,144.64999,144.8,144.14999,144.44,51137744,464.5943124\n2007-04-10T13:30:00Z,144.33,144.85001,144.27,144.61,56632064,465.6375668\n2007-04-11T13:30:00Z,144.82001,144.86,143.53999,144.02,106552256,461.2112742\n2007-04-12T13:30:00Z,143.74001,144.92,143.34,144.66,116447120,464.0553477\n2007-04-13T13:30:00Z,144.89999,145.32001,144.36,145.32001,85181568,467.8684673\n2007-04-16T13:30:00Z,145.83,146.86,145.82001,146.7,83206816,481.1157061\n2007-04-17T13:30:00Z,146.97,147.39999,146.64999,147.09,108442368,484.1340738\n2007-04-18T13:30:00Z,146.60001,147.7,146.57001,147.27,88348256,485.9252905\n2007-04-19T13:30:00Z,146.55,147.39999,146.36,147.23,103342944,488.1272943\n2007-04-20T13:30:00Z,148.22,148.62,147.0439,148.62,124128320,496.883952\n2007-04-23T13:30:00Z,148.37,148.73,147.97,148.06,77569312,493.9787921\n2007-04-24T13:30:00Z,148.23,148.39999,147.32001,148.12,114473504,493.6891042\n2007-04-25T13:30:00Z,148.73,149.66,148.0233,149.48,109158944,503.5645323\n2007-04-26T13:30:00Z,149.49001,149.8,149.10001,149.64999,88749440,504.7352358\n2007-04-27T13:30:00Z,149.09,149.74001,148.84,149.53,108191744,505.4892388\n2007-04-30T13:30:00Z,149.64,149.74001,148.21001,148.28999,101012752,496.4092016\n2007-05-01T13:30:00Z,148.42,149.47,147.67,148.67,134434624,496.9871557\n2007-05-02T13:30:00Z,148.89999,149.95,148.75,149.53999,87181808,504.6799925\n2007-05-03T13:30:00Z,149.97,150.39999,149.05,150.35001,87844064,508.809248\n2007-05-04T13:30:00Z,150.75,151.12,150.22,150.92,96412256,512.436668\n2007-05-07T13:30:00Z,150.88,151.2,150.81,150.95,63688656,512.8716391\n2007-05-08T13:30:00Z,150.58,150.92,150.13,150.75,81533936,512.2641163\n2007-05-09T13:30:00Z,150.64,152.82001,150.37,151.16,102947872,515.9624017\n2007-05-10T13:30:00Z,150.73,151.02,149.27,149.58,153698560,503.6955748\n2007-05-11T13:30:00Z,149.75,150.92999,149.72,150.86,113413120,512.0254107\n2007-05-14T13:30:00Z,150.86,151.3,149.78999,150.53,108062320,511.2116839\n2007-05-15T13:30:00Z,150.7,151.66499,150.19,150.57001,180931808,510.7221366\n2007-05-16T13:30:00Z,150.8,151.63,150.38,151.60001,114667008,517.9411759\n2007-05-17T13:30:00Z,151.38,151.96001,151.11,151.3,101566000,517.5328172\n2007-05-18T13:30:00Z,152.00999,152.62,151.81,152.62,99182256,529.7367723\n2007-05-21T13:30:00Z,152.58,153.23,152.4993,152.53999,174706432,529.9633439\n2007-05-22T13:30:00Z,152.7,153.16,152.38,152.42,82254320,528.6389964\n2007-05-23T13:30:00Z,152.95,153.5,152.36,152.44,133950624,526.9375501\n2007-05-24T13:30:00Z,152.53,153.21001,150.74001,151.06,187770320,517.7647215\n2007-05-25T13:30:00Z,151.49001,152.02,151.17999,151.69,83309120,519.4806674\n2007-05-29T13:30:00Z,151.94,152.5,151.45,152.24001,83960816,522.9324373\n2007-05-30T13:30:00Z,151.46001,153.53999,151.34,153.48,131273376,531.2358637\n2007-05-31T13:30:00Z,153.66,153.89,153.12,153.32001,115777808,531.5876052\n2007-06-01T13:30:00Z,153.88,154.39999,153.50999,154.08,107774432,536.4765432\n2007-06-04T13:30:00Z,153.53999,154.39,153.48,154.10001,78047568,537.8438088\n2007-06-05T13:30:00Z,153.74001,153.89999,152.86,153.49001,127943056,534.241285\n2007-06-06T13:30:00Z,152.91,152.95,151.75,151.84,164138128,518.2923571\n2007-06-07T13:30:00Z,151.56,152.5,149.06,149.10001,232486192,498.4336109\n2007-06-08T13:30:00Z,149.5,151.19,149.09,151.03999,176982320,508.5129986\n2007-06-11T13:30:00Z,150.92999,151.95,150.7,151.3,102527504,511.4003107\n2007-06-12T13:30:00Z,150.67,151.53999,149.55,149.64999,235736560,500.5414874\n2007-06-13T13:30:00Z,150.5,152.07001,149.722,151.89,193250624,515.9015404\n2007-06-14T13:30:00Z,152.06,153.12,152.03,152.86,146645312,524.6599359\n2007-06-15T13:30:00Z,153.14,153.66,152.92999,153.07001,154416368,526.6030087\n2007-06-18T13:30:00Z,153.38,153.39,152.66,152.89,88635680,525.0860095\n2007-06-19T13:30:00Z,152.55,153.38,152.36,153.27,111117440,526.8763541\n2007-06-20T13:30:00Z,153.58,153.58,150.96001,151.14,177234432,510.531054\n2007-06-21T13:30:00Z,151.08,152.11,150.25,151.98,205265680,512.2000824\n2007-06-22T13:30:00Z,151.52,151.77,149.85001,150.55,205153120,502.2009182\n2007-06-25T13:30:00Z,150.24001,151.25,149.02,149.83,232036432,497.6855424\n2007-06-26T13:30:00Z,150.21001,150.46001,148.28,148.28999,198318256,486.6398475\n2007-06-27T13:30:00Z,148.13,150.57001,148.06,150.39999,209169056,499.8175249\n2007-06-28T13:30:00Z,150.38,151.41,149.67,150.38,157701504,501.3153273\n2007-06-29T13:30:00Z,150.89999,151.64999,149.14999,150.42999,199697632,500.7279252\n2007-07-02T13:30:00Z,150.87,151.92,150.77,151.78999,103352000,511.7571676\n2007-07-03T13:30:00Z,152.17999,152.5,151.99001,152.34,54047488,516.3004659\n2007-07-05T13:30:00Z,152.39999,152.56,151.63,152.17999,89254432,515.2482436\n2007-07-06T13:30:00Z,152.38,153.17,151.92999,152.98,81106368,520.2413052\n2007-07-09T13:30:00Z,153.16,153.36,152.62,153,72343568,520.4814737\n2007-07-10T13:30:00Z,152.28999,152.61,150.77,150.92,180356128,501.6406941\n2007-07-11T13:30:00Z,150.75,152.05,150.52,151.99001,175533632,506.7231267\n2007-07-12T13:30:00Z,152.37,154.75,152.34,154.39,133863120,528.8888239\n2007-07-13T13:30:00Z,154.57001,155.46001,154.39,154.85001,111793872,533.5807455\n2007-07-16T13:30:00Z,154.99001,155.53,154.58,154.83,98370368,533.4556848\n2007-07-17T13:30:00Z,154.92999,156,154.67999,154.75,126120752,532.3265726\n2007-07-18T13:30:00Z,154.23,154.8,153.3,154.47,237719120,531.1241177\n2007-07-19T13:30:00Z,155.2,155.53,154.75,155.07001,145213120,535.1465405\n2007-07-20T13:30:00Z,154.89,155.2484,152.28999,153.5,245501872,521.7995948\n2007-07-23T13:30:00Z,154.17999,154.72,153.3,153.97,121181808,521.8751115\n2007-07-24T13:30:00Z,153.12,154.28,150.75999,151.3,256825632,501.4756559\n2007-07-25T13:30:00Z,152.02,152.39,150.25,151.61,265201056,500.5568216\n2007-07-26T13:30:00Z,150.19,150.8,146.39,148.02,467454208,468.8606472\n2007-07-27T13:30:00Z,148.21001,148.87,145.05,145.11,422916864,447.5749167\n2007-07-30T13:30:00Z,145.92999,147.81,145.28999,147.38,282213376,458.642113\n2007-07-31T13:30:00Z,148.33,149.46001,145.03999,145.72,316607488,450.6836165\n2007-08-01T13:30:00Z,145.17999,147.00999,143.95,146.42999,467658496,452.7173043\n2007-08-02T13:30:00Z,146.75999,147.75999,145.25999,147.60001,294674176,458.3403374\n2007-08-03T13:30:00Z,147.28,147.58,143.2,143.8,359378688,426.4761739\n2007-08-06T13:30:00Z,144.21001,146.83,142.53,146.21001,324726272,435.7801274\n2007-08-07T13:30:00Z,145.94,149,145.23,147.77,280677376,447.9291208\n2007-08-08T13:30:00Z,148.41,150.59,147.34,149.83,274739968,463.2722597\n2007-08-09T13:30:00Z,147.42999,149.95,145.28999,145.39,357626368,434.3880597\n2007-08-10T13:30:00Z,144.39,146.5,143.12,144.71001,411013376,430.6315337\n2007-08-13T13:30:00Z,146.5,146.89,145.02,145.23,181944192,430.404942\n2007-08-14T13:30:00Z,145.7,146.06,142.72,143.00999,264096560,413.7523229\n2007-08-15T13:30:00Z,142.72,144.46001,140.62,141.03999,323735040,402.2244351\n2007-08-16T13:30:00Z,139.78999,142.94,137,142.10001,546451200,409.3508996\n2007-08-17T13:30:00Z,145.5,148.35001,141.386,144.71001,388157184,423.815158\n2007-08-20T13:30:00Z,145.17,145.47,143.28999,144.64,187079936,421.8273323\n2007-08-21T13:30:00Z,144.60001,145.97,144.14,144.92999,157000816,423.1932507\n2007-08-22T13:30:00Z,146.00999,146.8,145.33,146.64999,172226192,437.3483395\n2007-08-23T13:30:00Z,147.34,147.64999,145.61,146.52,203853744,436.2256474\n2007-08-24T13:30:00Z,146.48,148.33,146.28,148.33,128886256,448.9177206\n2007-08-27T13:30:00Z,147.85001,148.33,146.73,146.95,112992128,442.2873933\n2007-08-28T13:30:00Z,146.16,146.25,143.46001,143.72,219626128,411.9832545\n2007-08-29T13:30:00Z,144.37,146.74001,143.96001,146.53999,207614496,429.7020463\n2007-08-30T13:30:00Z,145.45,147.19,145.31,146.14999,191681632,431.2966319\n2007-08-31T13:30:00Z,147.64999,148.5,146.83,147.59,185474624,441.9510683\n2007-09-04T13:30:00Z,147.45,149.98,147.39999,149.08,120054688,455.1328847\n2007-09-05T13:30:00Z,148.2,148.36,147,147.78999,166256624,448.4876697\n2007-09-06T13:30:00Z,147.95,148.61,147.12,148.13,127860432,449.5416689\n2007-09-07T13:30:00Z,146.48,146.89,145.25999,146.07001,235429056,432.1904941\n2007-09-10T13:30:00Z,146.52,146.72,144.33,145.78999,192354688,428.9289647\n2007-09-11T13:30:00Z,146.24001,147.7,146.13,147.49001,162048256,442.2326509\n2007-09-12T13:30:00Z,147.28999,148.44,146.98,147.87,149577680,445.5237666\n2007-09-13T13:30:00Z,148.55,149.45,148.2,148.91,153905248,454.1643936\n2007-09-14T13:30:00Z,147.96001,149.09,147.74001,148.89999,121903056,456.9572563\n2007-09-17T13:30:00Z,148.31,148.8905,147.63,148.10001,109853056,453.4125406\n2007-09-18T13:30:00Z,148.83,152.5,148.13409,152.46001,263372816,491.3723121\n2007-09-19T13:30:00Z,153.41,154.39,148.10001,153.36,193766752,498.1209013\n2007-09-20T13:30:00Z,153.34,153.42999,152.11,152.28,175178752,488.6080485\n2007-09-21T13:30:00Z,152.71001,153.11771,151.74001,151.97,141459312,485.596086\n2007-09-24T13:30:00Z,152.42,152.82001,151.36,151.69,139314944,482.9155956\n2007-09-25T13:30:00Z,150.81,151.66,150.47,151.39,142289568,481.8577127\n2007-09-26T13:30:00Z,152.25,152.77,151.39,152.19,135546944,487.0327127\n2007-09-27T13:30:00Z,152.91,153.10001,152.19,153.09,102704064,493.0276462\n2007-09-28T13:30:00Z,152.85001,153.19,151.98,152.58,133367008,489.7108855\n2007-10-01T13:30:00Z,152.60001,154.75,152.5,154.3,148120256,504.3559849\n2007-10-02T13:30:00Z,154.61,154.64999,153.81,154.09,112689008,504.2470351\n2007-10-03T13:30:00Z,153.81,154.41,153.00999,153.78,119037872,502.2396767\n2007-10-04T13:30:00Z,154.11,154.25999,153.59,154.02,76764944,503.06993\n2007-10-05T13:30:00Z,155.03,156.10001,154.63,155.85001,134583008,519.1075785\n2007-10-08T13:30:00Z,155.39,155.49001,154.77,155.02,71270128,514.159579\n2007-10-09T13:30:00Z,155.60001,156.5,155.03,156.48,94001120,524.8258175\n2007-10-10T13:30:00Z,156.03999,156.44,155.41,156.22,101668560,525.0891186\n2007-10-11T13:30:00Z,156.92999,157.52,154.53999,155.47,233513568,520.1081438\n2007-10-12T13:30:00Z,155.46001,156.35001,155.27,156.33,124539376,523.6479485\n2007-10-15T13:30:00Z,156.27,156.36,153.94,155.00999,161094752,513.835814\n2007-10-16T13:30:00Z,154.41,156.48,153.47,153.78,166428752,508.4516642\n2007-10-17T13:30:00Z,154.98,155.09,152.47,154.25,216672560,508.296905\n2007-10-18T13:30:00Z,153.45,154.19,153.08,153.69,148428368,504.8549154\n2007-10-19T13:30:00Z,153.09,156.48,149.66,149.67,297148672,484.0971938\n2007-10-22T13:30:00Z,148.86,150.75999,148.66,150.53999,261945376,486.0682772\n2007-10-23T13:30:00Z,151.46001,151.95,150.25,151.75999,179986432,493.5090297\n2007-10-24T13:30:00Z,151.21001,151.74001,148,151.48,326582016,493.0789649\n2007-10-25T13:30:00Z,151.64999,152.28999,149.88,151.84,237346064,495.1879665\n2007-10-26T13:30:00Z,153.06,153.62,151.89999,153.62,176488496,508.2315645\n2007-10-29T13:30:00Z,153.92999,154.44,153.55,154.13,106819248,511.9633855\n2007-10-30T13:30:00Z,153.45,153.75,152.87,153.06,132970816,503.4204534\n2007-10-31T13:30:00Z,153.98,155.27,152.84,154.64999,220927568,513.4074511\n2007-11-01T13:30:00Z,153.28999,153.41,150.59,151.03,332966400,481.1744433\n2007-11-02T13:30:00Z,151.53,152,149.21001,151.2,331219456,479.2757964\n2007-11-05T14:30:00Z,149.64,151.16,148,150.05,226765936,472.9769458\n2007-11-06T14:30:00Z,150.86,152.11,149.89999,152.07001,177729632,488.1625042\n2007-11-07T14:30:00Z,150.44,152.10719,147.55,147.91,306449152,458.3846619\n2007-11-08T14:30:00Z,147.99001,149.3,145.07001,147.16,374404352,451.8230851\n2007-11-09T14:30:00Z,145.69,147.53999,144.89,145.14,277731328,439.3981166\n2007-11-12T14:30:00Z,145.21001,146.61,143.7,143.7,243016816,432.3661594\n2007-11-13T14:30:00Z,145.37,148.31,145.22,148.08,191073376,468.8801287\n2007-11-14T14:30:00Z,149.22,149.39999,146.78,147.67,230524880,467.6104226\n2007-11-15T14:30:00Z,146.57001,147.49001,144.52,145.53999,263051680,450.2927574\n2007-11-16T14:30:00Z,146.31,146.47,144.57001,145.78999,308757248,449.5410773\n2007-11-19T14:30:00Z,145.28,145.36,143.19,143.75999,267712624,430.6742835\n2007-11-20T14:30:00Z,144.02,145.53,142.11,144.64,414724608,433.0323763\n2007-11-21T14:30:00Z,143.08,143.91,141.67,141.67999,259160320,409.4592455\n2007-11-23T14:30:00Z,143.07001,144.34,142.7,144.13,77684624,426.9487754\n2007-11-26T14:30:00Z,144.42999,144.88,140.66,140.95,214165440,404.4392293\n2007-11-27T14:30:00Z,141.74001,143.23,140.95,142.57001,293832192,409.7095281\n2007-11-28T14:30:00Z,144.19,147.47,144.14,147.13,259068752,453.9022319\n2007-11-29T14:30:00Z,146.62,147.72,146.10001,147.17999,199180560,456.8134011\n2007-11-30T14:30:00Z,149.03999,149.87,147.33,148.66,222886496,465.5401353\n2007-12-03T14:30:00Z,148.19,148.45,147.28999,147.67999,145927872,457.1664204\n2007-12-04T14:30:00Z,146.66,147.54089,146.31,146.36,136528560,447.5873024\n2007-12-05T14:30:00Z,147.92999,149.2,147.83,148.81,171036688,470.5076413\n2007-12-06T14:30:00Z,148.63,151.21001,148.57001,150.94,154542560,488.890582\n2007-12-07T14:30:00Z,151.42,151.5,150.55,150.91,148980064,489.5607948\n2007-12-10T14:30:00Z,151.28,152.25,150.86,152.08,123914368,497.5218739\n2007-12-11T14:30:00Z,152.14,152.89,147.83,147.91,250346368,466.7932023\n2007-12-12T14:30:00Z,151.06,151.77,147.2,149.37,322435584,464.8962121\n2007-12-13T14:30:00Z,148.32001,149.39,147.3,149.06,237607056,463.0295818\n2007-12-14T14:30:00Z,147.92999,149.10001,147.10001,147.17,159152880,451.3402829\n2007-12-17T14:30:00Z,146.61,146.87,144.86,145.07001,177269312,432.5409023\n2007-12-18T14:30:00Z,146.10001,146.48,143.96001,145.88,245569248,433.496434\n2007-12-19T14:30:00Z,145.94,146.89,144.94,145.88,198917120,433.2288142\n2007-12-20T14:30:00Z,146.84,146.86,145.17999,146.8,214813744,436.4268042\n2007-12-21T14:30:00Z,147.37,148.42,147.09,148.13,146090320,448.0177133\n2007-12-24T14:30:00Z,148.82001,149.48,148.48,149.23,45601328,457.2587538\n2007-12-26T14:30:00Z,148.64999,149.67999,148.5,149.55,67118064,460.362716\n2007-12-27T14:30:00Z,149.02,149.03,147.32001,147.67,122981680,445.5680438\n2007-12-28T14:30:00Z,148.53999,148.61,146.89999,147.3,116398064,441.7590108\n2007-12-31T14:30:00Z,147.10001,147.6062,146.06,146.21001,108126752,434.0558148\n2008-01-02T14:30:00Z,146.53,146.99001,143.88,144.92999,204935504,423.9941303\n2008-01-03T14:30:00Z,144.91,145.49001,144.07001,144.86,125133248,422.5323066\n2008-01-04T14:30:00Z,143.34,143.44,140.91,141.31,232330816,387.787639\n2008-01-07T14:30:00Z,141.81,142.23,140.10001,141.19,234990944,385.0995586\n2008-01-08T14:30:00Z,142.08,142.89999,138.44,138.91,326366720,370.1279661\n2008-01-09T14:30:00Z,139.09,140.78999,137.7,140.37,301910784,374.0849739\n2008-01-10T14:30:00Z,139.67999,142.8,139.37,141.28999,335701248,382.3671834\n2008-01-11T14:30:00Z,140.78,141.8985,139,140.14999,267076560,377.8037444\n2008-01-14T14:30:00Z,141.16,141.86,140.39999,141.28,170365632,384.1365474\n2008-01-15T14:30:00Z,139.78999,141.4903,137.89999,138.17,240456496,361.4378317\n2008-01-16T14:30:00Z,137.36,139.12,136.28,136.98,378956032,354.9400508\n2008-01-17T14:30:00Z,137.81,137.88,132.92999,133.42999,398404864,325.6637596\n2008-01-18T14:30:00Z,134.74001,135.02,131.10001,132.06,348561408,314.6149294\n2008-01-22T14:30:00Z,127.21001,132.42661,126,130.72,435925248,313.2539407\n2008-01-23T14:30:00Z,127.09,134.19,126.84,133.86,511912960,335.0723083\n2008-01-24T14:30:00Z,134.48,135.46001,133.31,134.99001,259949248,343.0814852\n2008-01-25T14:30:00Z,136.50999,136.75999,132.60001,133.03999,269603840,330.6871681\n2008-01-28T14:30:00Z,133.25999,135.52,132.06,135.24001,217934560,339.005911\n2008-01-29T14:30:00Z,136.10001,136.45,134.88,135.91,168968816,342.9244161\n2008-01-30T14:30:00Z,135.58,138.53999,134.60001,134.91,334939136,337.2253821\n2008-01-31T14:30:00Z,133.39999,138.53999,133.2,137.37,343680768,354.8460454\n2008-02-01T14:30:00Z,137.94,139.61,137.52,139.58,206843680,372.6813551\n2008-02-04T14:30:00Z,139.21001,139.3,137.64,137.82001,124694256,361.4616702\n2008-02-05T14:30:00Z,135.94,136.25,133.67,134.13,286882560,326.9306293\n2008-02-06T14:30:00Z,134.58,135.25,132.41,133.05,250792880,319.4293005\n2008-02-07T14:30:00Z,131.8,134.78999,131.73,133.92999,297541632,324.3652413\n2008-02-08T14:30:00Z,133.09,134.22,132.10001,133.07001,221643504,322.9100575\n2008-02-11T14:30:00Z,133.10001,134.23,132.03999,133.75,188576256,326.2129377\n2008-02-12T14:30:00Z,134.91,136.31,133.98,134.99001,256654368,335.0644132\n2008-02-13T14:30:00Z,136.00999,137.10001,135.14,136.37,181967744,345.2036545\n2008-02-14T14:30:00Z,136.95,137,134.78999,135.17,215207120,336.616701\n2008-02-15T14:30:00Z,134.55,136.10001,133.36,135.14,154110256,335.9773781\n2008-02-19T14:30:00Z,136.69,136.89,134.61,135.52,145190000,335.7183024\n2008-02-20T14:30:00Z,133.99001,137.60001,133.75999,135.92,220709376,339.0921523\n2008-02-21T14:30:00Z,136.66,137.00999,134.07001,134.78999,201051184,333.7458031\n2008-02-22T14:30:00Z,134.97,135.85001,132.86,135.62,205491008,336.144353\n2008-02-25T14:30:00Z,135.53999,137.64999,134.78,137.33,190107008,347.723137\n2008-02-26T14:30:00Z,136.75,138.95,136.5,138.36,212420624,355.699088\n2008-02-27T14:30:00Z,137.56,139.14,137.41,138.22,168395808,357.3487802\n2008-02-28T14:30:00Z,137.24001,137.96001,136.55,136.87,170831056,348.962044\n2008-02-29T14:30:00Z,135.60001,137.0249,132.78,133.82001,252715120,325.1965324\n2008-03-03T14:30:00Z,133.14,133.81,132.24001,133.5,195613632,322.3366373\n2008-03-04T14:30:00Z,132.23,133.39999,130.99001,132.99001,282513152,322.0906507\n2008-03-05T14:30:00Z,133.41,134.77,132.34,133.83,270681344,327.3558514\n2008-03-06T14:30:00Z,132.98,133.22,130.55,131.06,247912128,303.2284163\n2008-03-07T14:30:00Z,129.63,131.74001,128.58,129.71001,326434560,295.6062484\n2008-03-10T13:30:00Z,129.81,129.92999,127.59,128,235683376,281.0367057\n2008-03-11T13:30:00Z,130.72,132.72,127.71519,132.60001,341875712,308.5377442\n2008-03-12T13:30:00Z,132.73,133.77,131.16,131.36,229161120,304.2860728\n2008-03-13T13:30:00Z,129.61,132.64,128.60001,131.64999,351881472,308.0941946\n2008-03-14T13:30:00Z,132.77,132.81,127.78,129.61,484687872,294.5160749\n2008-03-17T13:30:00Z,126.57001,129.25999,126.07001,128.3,405310976,287.9397796\n2008-03-18T13:30:00Z,130.62,133.69,129.98,133.63,334416384,337.0765473\n2008-03-19T13:30:00Z,134.14,134.64999,130.03999,130.32001,345971456,318.3838715\n2008-03-20T13:30:00Z,130.05,132.91,129.25999,132.08,245320624,324.7814756\n2008-03-24T13:30:00Z,133.31,135.81,133.24001,134.72,209110368,349.3369176\n2008-03-25T13:30:00Z,134.86,135.55,133.77,134.85001,192947184,350.6664582\n2008-03-26T13:30:00Z,134.46001,135.08839,133.11,133.2,196934192,338.1354759\n2008-03-27T13:30:00Z,134.2,134.44,132.36,132.78,225153120,333.4595854\n2008-03-28T13:30:00Z,132.99001,133.36,131.06,131.50999,180918688,323.8837041\n2008-03-31T13:30:00Z,131.28999,132.73,131.09,131.97,166692128,325.5149702\n2008-04-01T13:30:00Z,133.71001,136.84,133.50999,136.61,254547248,370.1375321\n2008-04-02T13:30:00Z,137.06,137.67,135.98,136.7,210910816,371.8795043\n2008-04-03T13:30:00Z,135.94,137.44,135.71001,137.03999,175884752,374.599221\n2008-04-04T13:30:00Z,137.12,137.96001,136.12,136.89,204473056,374.6264286\n2008-04-07T13:30:00Z,137.87,138.57001,136.74001,136.96001,154381312,372.164908\n2008-04-08T13:30:00Z,136.19,137.1554,135.95,136.82001,148937248,371.9336548\n2008-04-09T13:30:00Z,136.61,136.8,134.89,135.83,195610560,364.8354503\n2008-04-10T13:30:00Z,135.39,136.67,134.89999,136.02,192967808,365.7524402\n2008-04-11T13:30:00Z,134.45,135.9837,133.00999,133.38,222973312,347.7275376\n2008-04-14T13:30:00Z,133.19,133.53999,132.55,132.92999,160521936,344.2312998\n2008-04-15T13:30:00Z,133.58,133.69,132.33,133.24001,172389120,344.4813776\n2008-04-16T13:30:00Z,134.53999,136.92999,134.39999,136.85001,189268816,378.263107\n2008-04-17T13:30:00Z,136.02,137.25,135.66,137.05,179707504,382.6981659\n2008-04-18T13:30:00Z,138.94,139.56,138.25999,138.48,218530560,393.2713351\n2008-04-21T13:30:00Z,138.23,138.98,136.87,138.55,118587376,393.7914194\n2008-04-22T13:30:00Z,138.19,138.37,136.64,137.94,162166064,389.6761234\n2008-04-23T13:30:00Z,138.09,138.78,137.12,137.72,193309008,388.2512322\n2008-04-24T13:30:00Z,138.08,139.74001,137.03999,138.32001,229381376,391.0882454\n2008-04-25T13:30:00Z,139.41,139.89,137.91,139.60001,190788064,397.9906494\n2008-04-28T13:30:00Z,139.88,140.25,139.38,139.63,105616496,397.7802998\n2008-04-29T13:30:00Z,139.39,139.73,138.61,139.08,125514064,393.6426149\n2008-04-30T13:30:00Z,139.28999,140.59,138.25999,138.25999,208395808,388.10554\n2008-05-01T13:30:00Z,138.39,141.12,138.27,141.12,187279504,410.8908814\n2008-05-02T13:30:00Z,142.33,142.37,140.56,141.50999,181585504,412.9673766\n2008-05-05T13:30:00Z,141.05,141.61,140.41,140.83,118510368,408.0986939\n2008-05-06T13:30:00Z,140.00999,142.2,139.69,142.05,179339808,415.3926921\n2008-05-07T13:30:00Z,141.89,142.03999,139.13,139.52,199267248,398.3149557\n2008-05-08T13:30:00Z,139.74001,140.32001,138.98,139.16,178321184,395.1001715\n2008-05-09T13:30:00Z,138.60001,139.39,138.45,138.89999,152589632,394.0571672\n2008-05-12T13:30:00Z,139.25,140.56,138.73,140.46001,150911440,406.2568567\n2008-05-13T13:30:00Z,140.8,140.89,139.73,140.48,159141872,406.7637838\n2008-05-14T13:30:00Z,141.07001,142.2,140.46201,140.77,181910752,407.1185416\n2008-05-15T13:30:00Z,141.03999,142.63,140.83,142.53,166927008,421.9472776\n2008-05-16T13:30:00Z,142.86,142.87,141.61,142.66,204236816,423.3649718\n2008-05-19T13:30:00Z,142.81,144.3,142.3,143.05,165704064,425.6649718\n2008-05-20T13:30:00Z,142.27,142.34,141,141.89,178552000,416.2472368\n2008-05-21T13:30:00Z,141.81,142.12,139,139.49001,252724816,395.7128148\n2008-05-22T13:30:00Z,139.42999,140.17,139,139.50999,170820320,394.449932\n2008-05-23T13:30:00Z,139.05,139.6631,137.52,137.64,181436192,379.7591972\n2008-05-27T13:30:00Z,137.8,139,137.53,138.66,168322816,384.8778529\n2008-05-28T13:30:00Z,139.17,140,138,139.3,181288064,388.3564082\n2008-05-29T13:30:00Z,139.13,140.92999,139.08,140,173927184,394.6745471\n2008-05-30T13:30:00Z,140.47,140.74001,139.94,140.35001,117361936,396.9814419\n2008-06-02T13:30:00Z,139.83,139.86,138,138.89999,181069872,383.6008302\n2008-06-03T13:30:00Z,139.3,139.62,137.23,138.09,272049920,377.0438869\n2008-06-04T13:30:00Z,137.7,139.16,137.46001,138.02,246726368,376.3342236\n2008-06-05T13:30:00Z,138.58,140.89,138.32001,140.78,237867008,401.5748937\n2008-06-06T13:30:00Z,139.55,139.8,136.22,136.28999,384276224,367.2144115\n2008-06-09T13:30:00Z,136.86,137.5,135.41,136.62,228263872,365.6394409\n2008-06-10T13:30:00Z,135.67,137.10001,135.35001,135.94,260234816,362.9863195\n2008-06-11T13:30:00Z,135.97,136.2592,133.92999,133.94,284064256,347.5367437\n2008-06-12T13:30:00Z,134.60001,135.87,133.52,134.45,252791744,347.2306749\n2008-06-13T13:30:00Z,135.17,136.52,134.418,136.14999,244727056,360.2466645\n2008-06-16T13:30:00Z,135.55,136.92999,135.46001,136.23,185833376,362.1370167\n2008-06-17T13:30:00Z,137.07001,137.12,135.37,135.57001,191743808,358.5445978\n2008-06-18T13:30:00Z,134.69,135.5235,133.71001,134.25,266970560,348.4792461\n2008-06-19T13:30:00Z,134.14999,135.24001,132,134.42,304310784,349.2978281\n2008-06-20T13:30:00Z,132.84,133.09,131.22,131.58,289275648,323.1499378\n2008-06-23T13:30:00Z,132.09,132.23,131.32001,131.45,165115680,320.6129272\n2008-06-24T13:30:00Z,131.05,132.44,130.19,131.19,267300624,319.469255\n2008-06-25T13:30:00Z,131.72,133.39999,131.239,131.81,287853824,323.823567\n2008-06-26T13:30:00Z,130.57001,131.42,128.08,128.23,297775104,292.8439577\n2008-06-27T13:30:00Z,128.28,128.86,127.035,127.53,303423232,287.6995051\n2008-06-30T13:30:00Z,127.89,128.91,127.3,127.98,258888192,289.1749919\n2008-07-01T13:30:00Z,126.52,128.47,125.92999,128.38,388621824,295.9374984\n2008-07-02T13:30:00Z,128.78999,129.16,125.95,126.17999,291223296,283.3741918\n2008-07-03T13:30:00Z,127.11,127.11,124.99001,126.31,239359632,280.8995556\n2008-07-07T13:30:00Z,126.78999,127.34,123.92,125.02,372427264,271.0994209\n2008-07-08T13:30:00Z,124.99001,127.39,124.2,127.24001,376225280,282.9352078\n2008-07-09T13:30:00Z,127.5,127.74001,124.39,124.78999,336789760,268.1728994\n2008-07-10T13:30:00Z,124.42999,125.78999,123.58,125.3,436475648,268.8735234\n2008-07-11T13:30:00Z,123.97,125.89999,122.49001,123.84,481124608,262.5432811\n2008-07-14T13:30:00Z,125.25999,125.5,122.39999,122.72,322720768,254.5198796\n2008-07-15T13:30:00Z,121.8,123.49001,120.02,120.99001,502502400,243.1329443\n2008-07-16T13:30:00Z,121.45,124.57001,121.10001,123.96001,371642880,267.2787969\n2008-07-17T13:30:00Z,125.14,126.25999,124.09,125.2,375490560,276.8076481\n2008-07-18T13:30:00Z,126.17,126.41589,125.14999,125.98,267030000,280.9606021\n2008-07-21T13:30:00Z,126.50999,126.8,125.19,126.05,222863008,280.3190263\n2008-07-22T13:30:00Z,125.14999,127.8,124.85001,127.48,296904192,289.1690076\n2008-07-23T13:30:00Z,127.89,129.14999,127.55,128.17,311698432,295.817466\n2008-07-24T13:30:00Z,128.34,128.41,125.16,125.50999,248634496,273.1233863\n2008-07-25T13:30:00Z,125.89,126.49001,125.17,125.48,219131008,270.2761119\n2008-07-28T13:30:00Z,125.50999,126.06,123.42,123.64,205202880,256.7673614\n2008-07-29T13:30:00Z,123.98,126.38,123.64,126.28,261505568,274.5063793\n2008-07-30T13:30:00Z,127.11,128.60001,126.28,128.53,354710016,292.2119212\n2008-07-31T13:30:00Z,127.39999,128.57001,126.63,126.83,277402112,283.7778879\n2008-08-01T13:30:00Z,127.12,127.28,125.46001,126.16,248703568,278.1386525\n2008-08-04T13:30:00Z,126.03999,126.14,124.75999,124.99001,188251744,267.7514795\n2008-08-05T13:30:00Z,126.02,128.56,124.9736,128.36,251624320,292.5485549\n2008-08-06T13:30:00Z,128.02,129.3,127.48,128.92999,209555376,296.4814705\n2008-08-07T13:30:00Z,127.96001,129.0549,126.53999,127.00999,246312432,284.675341\n2008-08-08T13:30:00Z,126.58,129.92999,126.38,129.37,260811632,301.6243974\n2008-08-11T13:30:00Z,129.47,131.50999,129.23,130.71001,249425808,313.5620016\n2008-08-12T13:30:00Z,130.28011,130.7028,128.73,129.35001,213200816,305.3618852\n2008-08-13T13:30:00Z,128.78999,129.64999,127.67,128.57001,256467184,300.0346998\n2008-08-14T13:30:00Z,127.84,130.28,127.75,129.53999,239556064,307.3318564\n2008-08-15T13:30:00Z,129.92999,130.5,129.3,130.17,181005376,311.670416\n2008-08-18T13:30:00Z,130.42999,130.48,127.66,128.39,172275056,296.7455566\n2008-08-19T13:30:00Z,127.42,128.1181,126.53,126.99001,194673632,285.6880829\n2008-08-20T13:30:00Z,127.39,127.95,126.34,127.58,225498128,287.7055058\n2008-08-21T13:30:00Z,126.75,128.44,126.60001,127.8,180609808,290.277182\n2008-08-22T13:30:00Z,128.67,129.64999,127.8,129.64999,167715248,304.521543\n2008-08-25T13:30:00Z,128.8,129.64999,126.75,127.02,171936880,285.6473712\n2008-08-26T13:30:00Z,127.02,127.87,126.58,127.39,159117184,285.9841867\n2008-08-27T13:30:00Z,127.55,128.83,127.3,128.63,171032752,296.3709356\n2008-08-28T13:30:00Z,129.28,130.34,128.63,130.19,167537056,308.7047424\n2008-08-29T13:30:00Z,129.73,130.14,128.50999,128.78999,189210000,299.5432983\n2008-09-02T13:30:00Z,130.03,130.71001,127.52,127.99001,252469568,292.3433284\n2008-09-03T13:30:00Z,127.88,128.5,126.92999,127.88,251949680,290.3685147\n2008-09-04T13:30:00Z,126.97,127.23,123.96001,124.03,340438528,254.1125954\n2008-09-05T13:30:00Z,123.28999,124.95,122,124.42,289514752,254.8700753\n2008-09-08T13:30:00Z,128.03999,128.24001,124.42,126.99001,364148736,268.4153711\n2008-09-09T13:30:00Z,127.10001,127.36,122.8,123.22,377326848,235.9828898\n2008-09-10T13:30:00Z,123.89,124.89999,122.55,123.72,298916608,234.2276172\n2008-09-11T13:30:00Z,122.12,125.74001,121.60001,125.50999,375369216,245.1332266\n2008-09-12T13:30:00Z,124.28999,126.21001,123.83,126.09,297851136,252.7052418\n2008-09-15T13:30:00Z,121.63,125.65199,119.89,120.09,483607040,214.6240727\n2008-09-16T13:30:00Z,117.2,122.32001,117,122.10001,581744128,228.4187421\n2008-09-17T13:30:00Z,119.64,121.8517,116,116.61,624095488,197.8163941\n2008-09-18T13:30:00Z,118.05,121.78999,113.8,120.07001,776114688,211.5566146\n2008-09-19T13:30:00Z,126.7,128,116.52,124.12,501146880,225.0585715\n2008-09-22T13:30:00Z,124.4505,124.75,120.36,121.31,249966432,201.6040779\n2008-09-23T13:30:00Z,120.85001,122.02,118.28,118.55,328230144,181.9551126\n2008-09-24T13:30:00Z,119.35001,120,117.78999,118.92999,311871232,180.6371593\n2008-09-25T13:30:00Z,119.39999,121.91,118.4369,120.78999,328252928,193.3900857\n2008-09-26T13:30:00Z,118.83,121.5,118.50999,120.85001,285917440,199.4424215\n2008-09-29T13:30:00Z,119.17999,121.17999,110.97,111.38,459562240,125.3019395\n2008-09-30T13:30:00Z,113.50999,116.8,110.5321,115.99001,328510208,141.3782245\n2008-10-01T13:30:00Z,115.27,116.69,113.95,116.06,333084928,145.4954071\n2008-10-02T13:30:00Z,114.95,115.11,111.06,111.85001,365632512,108.6870098\n2008-10-03T13:30:00Z,112.86,115.45,109.67999,110.34,461832448,96.50024805\n2008-10-06T13:30:00Z,107.14999,107.62,100.64,104.72,610790912,46.04703491\n2008-10-07T13:30:00Z,106.84,107.33,99.64999,100.03,540213504,12.77274424\n2008-10-08T13:30:00Z,97.52,102.17999,96.81,97.50999,725787904,0.743213004\n2008-10-09T13:30:00Z,99.66,100.62,90.25,90.7,534758400,-48.65625847\n2008-10-10T13:30:00Z,86.75999,93.94,83.58,88.5,871546880,-61.26457415\n2008-10-13T13:30:00Z,93.87,101.35001,89.94791,101.35001,456904704,47.58953961\n2008-10-14T13:30:00Z,104.7,105.53,97.11,99.85001,546688512,42.29727368\n2008-10-15T13:30:00Z,97.46001,97.8,89.71001,90.02,484627456,-48.29337354\n2008-10-16T13:30:00Z,91.28999,94.77,86.53999,93.77,708811264,-39.08407383\n2008-10-17T13:30:00Z,91.99001,98.59,91.64999,93.21001,476770048,-36.41422023\n2008-10-20T13:30:00Z,95.35001,99.10001,94.08949,98.81,321294080,12.4216074\n2008-10-21T13:30:00Z,96.97,98.64,95.22,95.86,356502016,-1.133333101\n2008-10-22T13:30:00Z,93.2,95.86,87.53,90.64,516167936,-42.12707039\n2008-10-23T13:30:00Z,90.28999,92.45,85.81,91.69,634666496,-37.52428524\n2008-10-24T13:30:00Z,84.06,89.92,84,87.03999,545812480,-56.40006142\n2008-10-27T13:30:00Z,85.97,89.50999,83.7,83.95,400238592,-67.0843318\n2008-10-28T13:30:00Z,87.34,94.24001,84.53,93.75999,639939328,9.533468187\n2008-10-29T13:30:00Z,93.77,97.17,92.10001,93.08,531381504,11.38537369\n2008-10-30T13:30:00Z,95.78,96.53999,92.89999,96.3,414582016,30.14589324\n2008-10-31T13:30:00Z,95.08,98.57001,94.48,96.83,411500032,35.30652282\n2008-11-03T14:30:00Z,96.78,97.69,95.95,97.11,205566752,37.53556989\n2008-11-04T14:30:00Z,99.06,100.86,96.7142,100.41,346977536,60.02632416\n2008-11-05T14:30:00Z,99.2,100.7114,95,96.19,390404096,29.91095711\n2008-11-06T14:30:00Z,94.46001,95.44,90.06,90.86,477982720,-16.49679899\n2008-11-07T14:30:00Z,91.64999,94,90.5,93.86,380518656,-2.201767554\n2008-11-10T14:30:00Z,95.21001,95.53,90.92,92.63,301903104,-9.204739163\n2008-11-11T14:30:00Z,90.75999,92.1377,88.64999,89.77,418596608,-31.92757821\n2008-11-12T14:30:00Z,88.23,90.1516,85.12,85.82001,454330624,-61.66933761\n2008-11-13T14:30:00Z,86.13,91.73,82.09,91.17,753800960,-35.46063704\n2008-11-14T14:30:00Z,89.41,92.06,86.52,86.62,540352256,-55.48384476\n2008-11-17T14:30:00Z,86.38,88.56,85.16,85.47,415543808,-62.29722182\n2008-11-18T14:30:00Z,85.14999,87.22,82.91,87.08,524140544,-54.01951824\n2008-11-19T14:30:00Z,85.91,86.87,80.92,81.5,558809344,-97.0246496\n2008-11-20T14:30:00Z,80.13,82.50999,75.05,75.45,814180352,-141.7156689\n2008-11-21T14:30:00Z,77.46001,80.89999,74.34,79.52,718768640,-124.3980257\n2008-11-24T14:30:00Z,81.92,86.985,80.3614,85.03,523461888,-77.61401458\n2008-11-25T14:30:00Z,87.3,87.50999,83.82001,85.66,454188288,-75.57568127\n2008-11-26T14:30:00Z,84.3,89.19,84.24001,88.97,370320384,-54.02765833\n2008-11-28T14:30:00Z,88.63,90.13,88.48,90.09,119905312,-46.26301769\n2008-12-01T14:30:00Z,87.50999,87.55,81.86,82.11,370826752,-118.6968136\n2008-12-02T14:30:00Z,83.47,85.49001,82.03799,85.27,469785344,-106.7749553\n2008-12-03T14:30:00Z,83.39999,87.83,83.14,87.32001,520103680,-92.8916246\n2008-12-04T14:30:00Z,86.06,88.05,83.74001,85.3,444341504,-98.89779509\n2008-12-05T14:30:00Z,83.64999,88.42,82.24001,87.92999,472064256,-84.87739553\n2008-12-08T14:30:00Z,90.34,92.38,88.0815,91,413016832,-62.04186844\n2008-12-09T14:30:00Z,90.37,92.13,88.98,89.5,370862592,-68.78281867\n2008-12-10T14:30:00Z,90.32001,91.36,89,90.11,396381184,-67.48616324\n2008-12-11T14:30:00Z,89.53999,91,87.37,87.94,366329600,-81.54189563\n2008-12-12T14:30:00Z,85.55,89.07001,85.2,88.99001,415140864,-72.03686556\n2008-12-15T14:30:00Z,89.02,89.14999,86.28999,87.75,256846128,-76.64126528\n2008-12-16T14:30:00Z,88.3,92.02,88.17999,91.88,377699840,-42.4465145\n2008-12-17T14:30:00Z,90.84,92.42999,90.06,90.99001,288101888,-42.16774776\n2008-12-18T14:30:00Z,91.39999,91.67,88.21001,89.28999,374829312,-55.66795299\n2008-12-19T14:30:00Z,89.10001,90.62,88.09,88.19,301523456,-61.32972563\n2008-12-22T14:30:00Z,88.58,88.67,85.49001,87.06,244192192,-71.81624096\n2008-12-23T14:30:00Z,87.53,87.92999,85.8,86.16,221772560,-77.98135517\n2008-12-24T14:30:00Z,86.45,86.87,86,86.66,62142416,-77.02065929\n2008-12-26T14:30:00Z,87.24001,87.3,86.5,87.16,74775808,-74.61599067\n2008-12-29T14:30:00Z,87.24001,87.33,85.60001,86.91,128419184,-77.03959873\n2008-12-30T14:30:00Z,87.50999,89.05,86.8766,88.97,168555680,-60.98711156\n2008-12-31T14:30:00Z,89.08,90.97,88.87,90.24001,194141808,-49.75478269\n2009-01-02T14:30:00Z,90.44,93.44,89.85001,92.96001,227638496,-27.74446099\n2009-01-05T14:30:00Z,92.63,94.5533,91.89,92.85001,240697632,-25.83948747\n2009-01-06T14:30:00Z,93.64,94.45,92.67999,93.47,328481792,-22.6066942\n2009-01-07T14:30:00Z,92,92.25999,90.2,90.67,281047552,-49.08302426\n2009-01-08T14:30:00Z,90.16,91.09,89.67,91.04201,263834368,-47.36934737\n2009-01-09T14:30:00Z,91.16,91.32001,85.36,89.09,331160832,-63.26540299\n2009-01-12T14:30:00Z,88.84,88.91,86.41,86.95,278008320,-82.68354459\n2009-01-13T14:30:00Z,86.73,87.88,86.2,87.11,356731648,-83.01433727\n2009-01-14T14:30:00Z,85.53999,85.75,83.16,84.37,435967232,-106.711366\n2009-01-15T14:30:00Z,84.12,85.25,81.72,84.39999,533808896,-107.2422004\n2009-01-16T14:30:00Z,85.86,85.98759,83.05,85.06,399307008,-106.1534542\n2009-01-20T14:30:00Z,84.23,85.05901,80.05,80.57001,420108544,-145.342788\n2009-01-21T14:30:00Z,81.94,84.24001,80.47,84.05,364767232,-127.619534\n2009-01-22T14:30:00Z,82.42,84.03999,81.17,82.75,427940352,-130.8333521\n2009-01-23T14:30:00Z,80.89999,83.99001,80.57001,83.11,386800640,-124.8134637\n2009-01-26T14:30:00Z,83.59,85.36,82.81,83.67999,318269440,-119.5216733\n2009-01-27T14:30:00Z,84.13,85.14999,83.3,84.53,274112000,-114.2593351\n2009-01-28T14:30:00Z,86.39999,87.95,86.07001,87.39,330317312,-87.40447463\n2009-01-29T14:30:00Z,86.11,87.4901,84.47,84.55,294591488,-106.2403273\n2009-01-30T14:30:00Z,84.98,85.39999,82.21001,82.83,383464192,-119.2516922\n2009-02-02T14:30:00Z,81.57001,83.17999,81.31,82.58,288488960,-120.3664621\n2009-02-03T14:30:00Z,83.10001,84.36,82.22,83.74001,278480640,-112.3103844\n2009-02-04T14:30:00Z,84.3,85.37,83.03999,83.33,322993920,-115.3175484\n2009-02-05T14:30:00Z,82.7,85.28999,77.73,84.57001,417679872,-106.648774\n2009-02-06T14:30:00Z,84.86,87.34,84.67999,86.979,366101504,-85.23743998\n2009-02-09T14:30:00Z,86.96001,87.74001,86.32001,87.10001,240075120,-83.4791839\n2009-02-10T14:30:00Z,86.27,87.03,82.45,83.11,536212736,-118.0730336\n2009-02-11T14:30:00Z,83.45,84.05,82.39999,83.60001,324674560,-118.6147473\n2009-02-12T14:30:00Z,82.17,83.82001,81.05,83.66,469302272,-113.8321232\n2009-02-13T14:30:00Z,83.55,84.24001,82.74001,82.75999,293998336,-116.6649155\n2009-02-17T14:30:00Z,80.16,82.95799,79.17,79.22,478910720,-140.3521637\n2009-02-18T14:30:00Z,79.78999,79.94,78.28,79.03,362970112,-142.8478606\n2009-02-19T14:30:00Z,79.84,80.14999,78.02,78.181,316869632,-148.4855486\n2009-02-20T14:30:00Z,76.73,78.34,75.77,77.42,477176576,-152.6796567\n2009-02-23T14:30:00Z,78.27,78.27,74.59,74.64999,379644672,-172.9153275\n2009-02-24T14:30:00Z,75.28999,77.95,74.7003,77.48,426412288,-158.0133968\n2009-02-25T14:30:00Z,77.14,78.42,75.63,76.87199,462039552,-158.6872692\n2009-02-26T14:30:00Z,77.82001,79.6667,75.53,75.62,363371264,-168.7385224\n2009-02-27T14:30:00Z,74.00999,75.68719,73.81,73.92999,470568960,-179.3650555\n2009-03-02T14:30:00Z,72.52,73.9169,70.37,70.60001,426453248,-206.2009727\n2009-03-03T14:30:00Z,71.61,71.7,69.64,70.07001,443761152,-211.0188268\n2009-03-04T14:30:00Z,71.23,72.87,70.07291,71.73,462763264,-202.6359277\n2009-03-05T14:30:00Z,70.10001,71.73,68.17,68.8,485551104,-223.4972198\n2009-03-06T14:30:00Z,69.39999,70.45,67.10001,68.92,490495232,-224.7837723\n2009-03-09T13:30:00Z,67.95,70,67.73,68.11,379907328,-227.4289032\n2009-03-10T13:30:00Z,69.50999,72.37,69.37,72.17,406230784,-188.0354746\n2009-03-11T13:30:00Z,73,73.75,71.83,72.64,356809984,-184.3872577\n2009-03-12T13:30:00Z,72.62,75.75,71.97,75.5,409818624,-163.2420704\n2009-03-13T13:30:00Z,76.00999,76.98,74.73,76.09,337474560,-159.0375094\n2009-03-16T13:30:00Z,76.96001,77.97,75.81,75.86,360821248,-163.1338484\n2009-03-17T13:30:00Z,76.07001,78.36,75.45,78.17999,357075200,-147.9259644\n2009-03-18T13:30:00Z,77.81,80.89999,77.07001,79.92999,473552384,-134.9052747\n2009-03-19T13:30:00Z,80.92999,81,78.69,78.94,428597248,-138.8757226\n2009-03-20T13:30:00Z,78.75999,78.91,76.53,76.71001,371165696,-158.4165148\n2009-03-23T13:30:00Z,78.74001,82.28999,78.31,82.22,420247296,-114.0197251\n2009-03-24T13:30:00Z,81.24001,82.36,80.50999,80.60001,330843904,-118.2239825\n2009-03-25T13:30:00Z,81.23,82.7,79.06,81.45,441995008,-115.4608723\n2009-03-26T13:30:00Z,82.25,83.3,81.32001,83.11,422025216,-103.2733124\n2009-03-27T13:30:00Z,82.05,82.53,81.31,81.61,322343680,-113.0885298\n2009-03-30T13:30:00Z,79.8,79.87,77.96001,78.78999,324108544,-140.203179\n2009-03-31T13:30:00Z,79.56,81.08,79.05,79.52,364238336,-137.4889471\n2009-04-01T13:30:00Z,78.53,81.42,78.33,81.06,377018368,-126.7822939\n2009-04-02T13:30:00Z,83.08,84.61,81.12959,83.42999,476230912,-109.7848342\n2009-04-03T13:30:00Z,83.49001,84.28,82.67,84.25999,284646144,-105.7085123\n2009-04-06T13:30:00Z,83.34,84.2747,82.28999,83.60001,264866560,-107.6170246\n2009-04-07T13:30:00Z,82.25,82.64999,81.50999,81.64999,259071936,-124.606261\n2009-04-08T13:30:00Z,82.06,82.94,81.53999,82.53,230402752,-119.5866671\n2009-04-09T13:30:00Z,84.67,85.82001,84.33,85.81,269653504,-87.05161573\n2009-04-13T13:30:00Z,84.92,86.53999,84.58,85.83,224847440,-84.44915425\n2009-04-14T13:30:00Z,85.03,85.75999,84.08,84.35001,276598784,-93.41587215\n2009-04-15T13:30:00Z,83.84,85.42,83.61,85.25,250726064,-88.56918792\n2009-04-16T13:30:00Z,85.92999,87.14999,84.77,86.5,335202816,-80.36641173\n2009-04-17T13:30:00Z,86.83,87.64999,86.14,87.08,262648944,-76.68023994\n2009-04-20T13:30:00Z,85.53999,87.0489,83.34,83.42999,293690112,-105.3361956\n2009-04-21T13:30:00Z,82.82001,85.13,82.75,85.06,300478464,-97.21435396\n2009-04-22T13:30:00Z,84.28999,86.34,84.07001,84.53999,340395008,-96.74795614\n2009-04-23T13:30:00Z,84.71001,85.42,83.63,85.37,324903680,-92.99469256\n2009-04-24T13:30:00Z,86.03,87.31,85.69,86.66,287703040,-81.96063227\n2009-04-27T13:30:00Z,85.67999,87.00999,85.53999,85.84,289581568,-84.46600947\n2009-04-28T13:30:00Z,84.97,86.59,84.75999,85.57001,247927872,-84.21327186\n2009-04-29T13:30:00Z,86.52,88.36,86.3,87.39,311505664,-67.9270788\n2009-04-30T13:30:00Z,88.55,89.02,86.92,87.42,301419776,-69.32277729\n2009-05-01T13:30:00Z,87.44,88.21001,86.72,87.89,236110320,-68.17370364\n2009-05-04T13:30:00Z,88.55,90.94,88.38,90.88,287119872,-40.29050955\n2009-05-05T13:30:00Z,90.57001,90.92999,89.84,90.57001,243036256,-39.23142101\n2009-05-06T13:30:00Z,91.67999,92.2,90.61,92.14101,291941120,-27.83214925\n2009-05-07T13:30:00Z,93.00999,93.14999,90.28,90.86,317800448,-36.56271022\n2009-05-08T13:30:00Z,92.03,93.22,90.911,92.98,299081728,-25.9957923\n2009-05-11T13:30:00Z,91.7,92.11,91.03999,91.24001,247923568,-38.05109695\n2009-05-12T13:30:00Z,91.63,91.83,89.85001,90.97,282431232,-41.01609204\n2009-05-13T13:30:00Z,89.74001,90.00999,88.5,88.67999,269618944,-62.39955058\n2009-05-14T13:30:00Z,88.72,90.12,88.5,89.44,260098624,-58.31728107\n2009-05-15T13:30:00Z,89.37,90,88.14999,88.71001,271502592,-61.81230527\n2009-05-18T13:30:00Z,89.55,91.34,88.57021,91.23,242217248,-43.91748681\n2009-05-19T13:30:00Z,91.17999,91.97,90.81,91.12,206102192,-43.09785192\n2009-05-20T13:30:00Z,91.95,92.8,90.41,90.50999,285898240,-48.97005397\n2009-05-21T13:30:00Z,89.46001,89.8,88.25999,89.21001,258988368,-60.10142112\n2009-05-22T13:30:00Z,89.46001,90,88.67999,89.02,166811872,-61.78894112\n2009-05-26T13:30:00Z,88.36,91.56,88.32001,91.3,236318432,-44.53966062\n2009-05-27T13:30:00Z,91.44,91.75,89.53,89.67,246313504,-51.2033662\n2009-05-28T13:30:00Z,90.46001,91.34,89.10001,90.92,289094912,-47.16649969\n2009-05-29T13:30:00Z,91.42,93.7,90.67999,92.53,258641376,-34.53018014\n2009-06-01T13:30:00Z,93.67,95.17,93.42999,94.77,276246784,-14.01806364\n2009-06-02T13:30:00Z,94.39999,95.37,87.53,94.85001,230874432,-10.7838178\n2009-06-03T13:30:00Z,94.03999,94.13,92.75999,93.64999,235403936,-19.87626321\n2009-06-04T13:30:00Z,94,94.67,93.3,94.53,210102256,-15.32570667\n2009-06-05T13:30:00Z,95.49001,95.67,93.8,94.55,284257792,-16.45540611\n2009-06-08T13:30:00Z,93.84,95.10001,93.03999,94.16,238565120,-18.36758351\n2009-06-09T13:30:00Z,94.69,95.145,94.02,94.64,225125440,-15.63431068\n2009-06-10T13:30:00Z,95.48,95.49001,93.19,94.39999,296100352,-18.74009928\n2009-06-11T13:30:00Z,94.58,96.11,94.56,94.82001,275414016,-17.22121983\n2009-06-12T13:30:00Z,94.39999,95.14,94,95.08,184373008,-14.40245201\n2009-06-15T13:30:00Z,93.96001,94.02,92.39999,92.89999,224190432,-32.74091004\n2009-06-16T13:30:00Z,93.23,93.28999,91.58,91.64,227319008,-42.43197951\n2009-06-17T13:30:00Z,91.60001,92.33,90.83,91.55,223445312,-43.79933475\n2009-06-18T13:30:00Z,91.69,92.67,91.25,92.21899,211725056,-39.29890456\n2009-06-19T13:30:00Z,92.58,92.7,91.52,92.03999,215655568,-40.35344231\n2009-06-22T13:30:00Z,91.14,91.19,89.25,89.28,251913568,-67.03269606\n2009-06-23T13:30:00Z,89.47,89.88,88.85001,89.35001,188309680,-68.17397041\n2009-06-24T13:30:00Z,90.16,91.08,89.60001,90.118,211577632,-63.43238273\n2009-06-25T13:30:00Z,89.67,92.17,89.57001,92.08,279410944,-47.92490616\n2009-06-26T13:30:00Z,91.77,92.24001,91.27,91.84,167579008,-46.64520444\n2009-06-29T13:30:00Z,92.11,92.82001,91.60001,92.7,168481248,-40.8418624\n2009-06-30T13:30:00Z,92.72,93.06,91.27,91.95,228888192,-45.39710433\n2009-07-01T13:30:00Z,92.34,93.23,92.21001,92.33,173041056,-44.30957701\n2009-07-02T13:30:00Z,91.13,92.3624,89.75999,89.81,212309808,-63.93371187\n2009-07-06T13:30:00Z,88.94,89.92999,88.66,89.8,174499568,-63.52941247\n2009-07-07T13:30:00Z,89.71001,89.82001,88,88.06,197088880,-76.52077676\n2009-07-08T13:30:00Z,88.59,88.8,87,88,248050496,-78.81894549\n2009-07-09T13:30:00Z,88.61,88.89999,87.91,88.17,163777568,-79.79559158\n2009-07-10T13:30:00Z,87.7,88.49001,87.35001,87.96001,173520256,-80.57452058\n2009-07-13T13:30:00Z,88.31,90.17,87.59,90.10201,217413376,-64.37034037\n2009-07-14T13:30:00Z,90.38,90.69,89.73,90.61,181555376,-61.57501118\n2009-07-15T13:30:00Z,91.81,93.50999,90.6795,93.25999,220877808,-40.28896586\n2009-07-16T13:30:00Z,93,94.50999,92.82001,94.14999,231174496,-33.33284324\n2009-07-17T13:30:00Z,94.06,94.32001,93.53999,94.13,138561680,-32.25247702\n2009-07-20T13:30:00Z,94.67999,95.28999,94.19,95.131,164179376,-24.39274971\n2009-07-21T13:30:00Z,95.87,95.89999,94.42,95.57001,217718256,-23.18039433\n2009-07-22T13:30:00Z,94.96001,96.13,94.89,95.55,196067568,-22.53403616\n2009-07-23T13:30:00Z,95.61,98.08,95.53,97.661,258795504,-3.283523242\n2009-07-24T13:30:00Z,97.2,98.14,96.69,98.06,154003008,0.865117854\n2009-07-27T13:30:00Z,97.88,98.39999,97.34,98.35001,159259376,3.476955986\n2009-07-28T13:30:00Z,97.66,98.37,97.06,97.89,186685680,2.191989103\n2009-07-29T13:30:00Z,97.44,98.088,96.98,97.65199,194399312,1.828364854\n2009-07-30T13:30:00Z,98.83,99.83,98.60001,98.67,225575376,9.506322012\n2009-07-31T13:30:00Z,98.64999,99.47,98.38,98.81,207357936,10.30280431\n2009-08-03T13:30:00Z,99.85001,100.53,99.31,100.44,175776880,24.29200176\n2009-08-04T13:30:00Z,99.99001,100.84,99.78,100.7,176714496,26.8967952\n2009-08-05T13:30:00Z,100.77,100.855,99.58,100.41,184726368,25.48714217\n2009-08-06T13:30:00Z,100.87,101.02,99.42,99.89,193203744,21.45977531\n2009-08-07T13:30:00Z,100.94,102.03,100.39,101.202,220684368,28.96481044\n2009-08-10T13:30:00Z,100.74001,101.22,100.27,100.99001,130898624,28.84154185\n2009-08-11T13:30:00Z,100.53999,100.61,99.46001,99.73,157301008,17.91533244\n2009-08-12T13:30:00Z,99.56,101.56,99.50999,100.8,219052368,25.46838603\n2009-08-13T13:30:00Z,101.25999,101.61,100.25999,101.57001,176449504,29.23480234\n2009-08-14T13:30:00Z,101.52,101.60001,99.7,100.78999,199691248,22.92551684\n2009-08-17T13:30:00Z,98.85001,98.95,98.11501,98.31,237892624,-2.379072746\n2009-08-18T13:30:00Z,98.53,99.44,98.35001,99.09,173461440,2.868162565\n2009-08-19T13:30:00Z,98.31,100.3,98.21001,99.96001,192812752,9.091195376\n2009-08-20T13:30:00Z,100.09,101.22,99.87,100.99001,174131248,17.54700085\n2009-08-21T13:30:00Z,101.82001,103.13,101.62,102.97,224604944,35.68466153\n2009-08-24T13:30:00Z,103.39,103.95,102.59,102.96001,191278880,35.91706799\n2009-08-25T13:30:00Z,103.37,104.25999,102.94,103.16,215310560,35.84587867\n2009-08-26T13:30:00Z,102.84,103.64,102.49001,103.17,194620624,36.27246109\n2009-08-27T13:30:00Z,103.11,103.72,101.94,103.39999,196230000,38.1607381\n2009-08-28T13:30:00Z,104.23,104.35001,102.67,103.38,147024368,36.89870597\n2009-08-31T13:30:00Z,102.37,102.58,101.78999,102.46001,176051568,29.1932706\n2009-09-01T13:30:00Z,101.95,103.24001,99.99001,100.2,321276672,14.51052107\n2009-09-02T13:30:00Z,99.78,100.44,99.57001,99.82001,171805008,12.10893686\n2009-09-03T13:30:00Z,100.39999,100.77,99.59,100.64999,143572256,16.92365219\n2009-09-04T13:30:00Z,100.85001,102.09,100.55,102.06,142687808,28.59146801\n2009-09-08T13:30:00Z,103,103.05,102.39,102.94,132909008,34.91616343\n2009-09-09T13:30:00Z,103.12,104.08,102.8,103.73,154612496,40.85824837\n2009-09-10T13:30:00Z,103.8,104.86,103.22,104.78999,162902368,47.5857869\n2009-09-11T13:30:00Z,104.99001,105.3,104.28,104.77,152383632,47.88128773\n2009-09-14T13:30:00Z,103.88,105.46001,103.14999,105.28,149593744,52.82602795\n2009-09-15T13:30:00Z,105.45,106.11,104.75999,105.72,196795872,55.64862164\n2009-09-16T13:30:00Z,106.10001,107.34,105.72881,107.32001,206406256,69.34944587\n2009-09-17T13:30:00Z,107.17,108.06,106.57001,107.16,229170880,69.71502068\n2009-09-18T13:30:00Z,107.14999,107.16,106.36,106.72,153799056,65.61847862\n2009-09-21T13:30:00Z,105.89,107,105.66,106.45,151892000,65.17224577\n2009-09-22T13:30:00Z,107.08,107.37,106.60001,107.07001,143126624,69.57971611\n2009-09-23T13:30:00Z,107.32001,108.03,105.99001,106.17999,225947312,64.74636432\n2009-09-24T13:30:00Z,106.41,106.64,104.55,105.00999,228636688,55.5025818\n2009-09-25T13:30:00Z,104.78,105.36,104.09,104.45,204058944,51.68706936\n2009-09-28T13:30:00Z,104.85001,106.55,104.83,106.32001,118285744,68.3033523\n2009-09-29T13:30:00Z,106.50999,107.02,105.78,106,133733808,67.73861115\n2009-09-30T13:30:00Z,106.36,106.46001,104.62,105.59,254382944,63.69464133\n2009-10-01T13:30:00Z,105.34,105.73309,102.95,103,281840640,41.77755934\n2009-10-02T13:30:00Z,102.02,103.10001,101.99001,102.49001,224748752,38.57484456\n2009-10-05T13:30:00Z,102.89999,104.32001,102.60001,104.02,149874944,51.91604366\n2009-10-06T13:30:00Z,104.77,106.11,104.71001,105.50999,202491008,65.72030106\n2009-10-07T13:30:00Z,105.27,105.91,105.07001,105.8,159200256,67.705621\n2009-10-08T13:30:00Z,106.55,107.17,105.84489,106.61,183305744,73.33178438\n2009-10-09T13:30:00Z,106.64,107.25999,106.36,107.25999,135008256,77.66059194\n2009-10-12T13:30:00Z,107.75999,108.09,107.28,107.67999,118031008,80.50707999\n2009-10-13T13:30:00Z,107.39,107.7132,106.75999,107.46001,157692688,79.29602971\n2009-10-14T13:30:00Z,108.72,109.42,107.4174,109.31,191421504,92.4094227\n2009-10-15T13:30:00Z,108.78,109.71001,108.73,109.71001,173873568,95.66470813\n2009-10-16T13:30:00Z,108.8,109.27,108.23,108.89,192069376,92.30242802\n2009-10-19T13:30:00Z,109.07001,110.13,108.73,109.78999,159530368,99.2895774\n2009-10-20T13:30:00Z,109.95,109.985,108.67999,109.211,180921008,95.6993982\n2009-10-21T13:30:00Z,109.03999,110.31,108.14999,108.23,225787440,91.09805107\n2009-10-22T13:30:00Z,108.19,109.67999,107.5,109.33,238443936,96.68009491\n2009-10-23T13:30:00Z,109.69,109.75999,107.63,108.08,240033184,88.89279559\n2009-10-26T13:30:00Z,108.2,109.31,106.61,106.91,242028192,82.32606513\n2009-10-27T13:30:00Z,107.03,107.39,106.16,106.42,253266320,78.95197092\n2009-10-28T13:30:00Z,106.14999,106.4783,104.35001,104.41,248821376,61.75060011\n2009-10-29T13:30:00Z,105.19,106.86,104.94,106.64999,198110560,76.56626161\n2009-10-30T13:30:00Z,106.3,106.62,103.44,103.56,325607936,53.48881662\n2009-11-02T14:30:00Z,104.13,105.41,103.08,104.32001,254489744,54.14082274\n2009-11-03T14:30:00Z,103.74001,104.8,103.53999,104.64999,228362496,57.24473761\n2009-11-04T14:30:00Z,105.50999,106.33,104.64999,104.92,247996688,58.35947527\n2009-11-05T14:30:00Z,105.66,106.88,105.44,106.8501,180015184,74.12471615\n2009-11-06T14:30:00Z,106.25999,107.39999,106.05,107.13,170954064,77.19769744\n2009-11-09T14:30:00Z,107.95,109.63,107.87,109.57001,159495632,100.2775284\n2009-11-10T14:30:00Z,109.31,109.92999,108.97,109.59,171899744,101.82974\n2009-11-11T14:30:00Z,110.31,110.82001,109.62,110.14999,169466192,105.1200211\n2009-11-12T14:30:00Z,110,110.57001,108.75,109.03,157144496,97.38158838\n2009-11-13T14:30:00Z,109.31,110.09,108.75,109.62,150962944,99.48526136\n2009-11-16T14:30:00Z,110.38,111.69,110.32001,111.21001,210922128,114.4741975\n2009-11-17T14:30:00Z,110.92,111.39,110.5,111.339,147134064,116.6818242\n2009-11-18T14:30:00Z,111.25999,111.42999,110.57001,111.27,156486752,116.8848615\n2009-11-19T14:30:00Z,110.50999,111.30589,109.13,109.82001,208734496,105.8793212\n2009-11-20T14:30:00Z,109.25,109.75999,109.00999,109.42999,134196000,103.3678472\n2009-11-23T14:30:00Z,110.72,111.74001,110.60001,110.82001,148010128,115.480902\n2009-11-24T14:30:00Z,111,111.20219,110.00999,110.99001,138420064,116.2711869\n2009-11-25T14:30:00Z,111.17,111.5,110.82001,111.38,109564752,118.5712863\n2009-11-27T14:30:00Z,108.39999,110.32001,108.28999,109.57001,126001808,109.9039319\n2009-11-30T14:30:00Z,109.48,110.2,108.12,109.94,160874816,113.3131099\n2009-12-01T14:30:00Z,110.92,111.66,110.73,111.3,159613632,125.7427974\n2009-12-02T14:30:00Z,111.28,112.00999,110.92,111.25,132315056,125.8551385\n2009-12-03T14:30:00Z,111.55,112.17999,110.28999,110.38,167324816,121.2305844\n2009-12-04T14:30:00Z,111.84,112.38,110.03999,111.00999,274907904,120.8625184\n2009-12-07T14:30:00Z,110.91,111.53,110.49001,110.84,127973808,119.7878615\n2009-12-08T14:30:00Z,110.03999,110.77251,109.27,109.61,169863632,110.5516999\n2009-12-09T14:30:00Z,109.58,110.17999,109.02,110.021,155063376,112.0761798\n2009-12-10T14:30:00Z,110.7,111.12,110.45,110.64,138014624,116.904502\n2009-12-11T14:30:00Z,111.11,111.36,110.61,111.11,124854000,119.5809725\n2009-12-14T14:30:00Z,111.87,112,105.476,111.87,107141504,123.6829805\n2009-12-15T14:30:00Z,111.46001,111.92,111,111.35001,120408752,120.2846021\n2009-12-16T14:30:00Z,111.8,112.13,111.27,111.52,155358128,120.2982794\n2009-12-17T14:30:00Z,110.72,110.92999,110.08,110.17999,183390064,107.8536726\n2009-12-18T14:30:00Z,110.2,110.3,109.28,110.21001,174591120,107.3667757\n2009-12-21T14:30:00Z,110.75999,111.7,110.75999,111.33,118104256,118.1324476\n2009-12-22T14:30:00Z,111.57001,111.97,111.425,111.73,91707440,121.5201776\n2009-12-23T14:30:00Z,112,112.11,111.5,111.95,111783056,122.3788256\n2009-12-24T14:30:00Z,112.19,112.60001,111.9948,112.48,39677472,126.5834899\n2009-12-28T14:30:00Z,112.89999,112.99001,112.32001,112.72,87508432,127.5387069\n2009-12-29T14:30:00Z,113.00999,113.03,112.55,112.562,80572496,125.9628937\n2009-12-30T14:30:00Z,112.23,112.64999,112.17,112.52,73138368,125.9256567\n2009-12-31T14:30:00Z,112.77,112.8,111.39,111.44,90637872,117.9580133\n2010-01-04T14:30:00Z,112.37,113.39,111.50999,113.33,118944560,129.0067234\n2010-01-05T14:30:00Z,113.25999,113.67999,112.85001,113.63,111579872,131.0394434\n2010-01-06T14:30:00Z,113.52,113.99001,113.42999,113.71001,116074368,131.9619113\n2010-01-07T14:30:00Z,113.5,114.33,113.17999,114.19,131091056,134.7851419\n2010-01-08T14:30:00Z,113.89,114.62,113.66,114.57001,126402752,137.395699\n2010-01-11T14:30:00Z,115.08,115.13,114.235,114.73,106375680,137.9050538\n2010-01-12T14:30:00Z,113.97,114.21001,113.22,113.66,163333440,128.6439903\n2010-01-13T14:30:00Z,113.95,114.94,113.37,114.62,161821936,134.5559781\n2010-01-14T14:30:00Z,114.49001,115.14,114.42,114.92999,115783744,137.1101302\n2010-01-15T14:30:00Z,114.73,114.84,113.2,113.64,212283120,126.7193199\n2010-01-19T14:30:00Z,113.62,115.13,113.59,115.06,139172624,136.3144061\n2010-01-20T14:30:00Z,114.28,114.45,112.98,113.89,216490128,130.1949682\n2010-01-21T14:30:00Z,113.92,114.27,111.56,111.7,344859392,112.5721387\n2010-01-22T14:30:00Z,111.2,111.74159,109.09,109.21001,345942272,92.02000845\n2010-01-25T14:30:00Z,110.21001,110.41,109.41,109.77,186937440,91.28051584\n2010-01-26T14:30:00Z,109.34,110.47,109.03999,109.31,211168752,89.54734129\n2010-01-27T14:30:00Z,109.17,110.08,108.33,109.83,271863552,92.48350772\n2010-01-28T14:30:00Z,110.19,110.25,107.91,108.57001,316103936,83.35783107\n2010-01-29T14:30:00Z,109.03999,109.8,107.22,107.39,310677504,76.54558191\n2010-02-01T14:30:00Z,108.14999,109.07001,107.50079,109.06,187864880,85.37250521\n2010-02-02T14:30:00Z,109.25999,110.59,108.88,110.38,216327872,95.77406106\n2010-02-03T14:30:00Z,109.88,110.48151,109.50999,109.83,172730624,94.49236829\n2010-02-04T14:30:00Z,108.98,109.03,106.42,106.44,356715520,61.5452529\n2010-02-05T14:30:00Z,106.56,106.88,104.58,106.66,493585664,60.09955443\n2010-02-08T14:30:00Z,106.74001,107.33,105.80991,105.89,224166816,56.07628738\n2010-02-09T14:30:00Z,107.13,108.14999,106.27,107.22,337820416,63.270267\n2010-02-10T14:30:00Z,107.05,107.60001,106.11,107.00999,240511504,62.3184483\n2010-02-11T14:30:00Z,106.87,108.25,106.25,108.13,223591568,69.0274782\n2010-02-12T14:30:00Z,106.99001,108.1012,106.50999,108.03999,304622080,72.98121913\n2010-02-16T14:30:00Z,108.86,109.85001,107.821,109.74001,159317440,84.84189926\n2010-02-17T14:30:00Z,110.27,110.41,109.74001,110.25999,168845056,88.29998721\n2010-02-18T14:30:00Z,110.08,111.14,110.035,110.91,193708496,93.57659621\n2010-02-19T14:30:00Z,110.62,111.57001,110.36,111.14,222684816,95.60637455\n2010-02-22T14:30:00Z,111.55,111.58,110.83,111.16,132346816,95.46574955\n2010-02-23T14:30:00Z,110.86,111.2,109.52,109.81,207496944,84.09127698\n2010-02-24T14:30:00Z,110.14,111,109.86,110.82001,176350624,89.75740154\n2010-02-25T14:30:00Z,109.24001,110.75,108.94,110.67,259634688,94.04331564\n2010-02-26T14:30:00Z,110.77,111.12,110.11,110.74001,173589248,95.09910825\n2010-03-01T14:30:00Z,111.2,112,111.17,111.89,147709632,106.2287937\n2010-03-02T14:30:00Z,112.37,112.74001,112,112.2,160992368,108.4114519\n2010-03-03T14:30:00Z,112.49001,112.97,112.02,112.3,150784944,108.2295951\n2010-03-04T14:30:00Z,112.45,112.8,112.03,112.64101,135770368,109.7166414\n2010-03-05T14:30:00Z,113.37,114.34,113.10001,114.25,176118752,124.3910612\n2010-03-08T14:30:00Z,114.25999,114.52,114.07001,114.27,114631120,125.0081539\n2010-03-09T14:30:00Z,113.92999,114.99001,113.87,114.46001,154556688,126.8423249\n2010-03-10T14:30:00Z,114.50999,115.27499,114.41,114.97,186088816,131.2976733\n2010-03-11T14:30:00Z,114.7,115.48,114.35001,115.45,160875872,134.3167269\n2010-03-12T14:30:00Z,115.95,115.97,115.14,115.46001,162074752,134.1650549\n2010-03-15T13:30:00Z,115.25999,115.575,114.60001,115.49001,146816816,134.275311\n2010-03-16T13:30:00Z,115.81,116.52,115.49001,116.41,168673008,141.8374554\n2010-03-17T13:30:00Z,116.75999,117.48,116.4198,117.10001,177468064,147.3962644\n2010-03-18T13:30:00Z,117.11,117.27,116.57001,117.03751,196509056,147.3382847\n2010-03-19T13:30:00Z,116.96001,117.293,115.52,115.97,226641120,138.9684174\n2010-03-22T13:30:00Z,115.31,116.8,115.24001,116.5925,184477680,141.8850458\n2010-03-23T13:30:00Z,116.75999,117.50999,116.38,117.41,182941568,147.6688304\n2010-03-24T13:30:00Z,116.97,117.42641,115.58,116.84,196183312,144.9787231\n2010-03-25T13:30:00Z,117.63,118.1666,116.50999,116.64999,223396256,141.4812362\n2010-03-26T13:30:00Z,116.87,117.42,116.12,116.582,205808496,140.0577402\n2010-03-29T13:30:00Z,117.16991,117.53,116.6886,117.32001,134513504,144.5997703\n2010-03-30T13:30:00Z,117.46001,117.83,116.91,117.39999,145772368,144.8910262\n2010-03-31T13:30:00Z,116.95,117.52,116.61,117,161078688,142.8093338\n2010-04-01T13:30:00Z,117.8,118.25,117.10001,117.8,161215184,148.0445358\n2010-04-05T13:30:00Z,118.25,118.84,117.92,118.75999,105847632,156.1031098\n2010-04-06T13:30:00Z,118.42,119.25,118.28999,119.03999,110384128,158.1236619\n2010-04-07T13:30:00Z,118.8,119.3567,117.81,118.36,184576320,154.75815\n2010-04-08T13:30:00Z,117.95,118.97,117.60001,118.77251,158704000,157.0489351\n2010-04-09T13:30:00Z,119.02,119.60001,118.8,119.55,133006496,163.3813056\n2010-04-12T13:30:00Z,119.7,120.05,119.56,119.74001,110278944,165.0870576\n2010-04-13T13:30:00Z,119.62,120.03999,119,119.83,125125056,165.9900194\n2010-04-14T13:30:00Z,120.27,121.19,120.08,121.19,161609008,178.3521554\n2010-04-15T13:30:00Z,120.99001,121.5654,120.95,121.28999,144615248,179.6842503\n2010-04-16T13:30:00Z,120.86,121.285,118.75,119.36,366879744,163.8548566\n2010-04-19T13:30:00Z,119.00999,119.92999,118.47,119.81,217947744,165.2947638\n2010-04-20T13:30:00Z,120.56,120.98,119.871,120.88,157707936,173.1013138\n2010-04-21T13:30:00Z,120.95,121.23,119.99001,120.66,192910064,171.9003239\n2010-04-22T13:30:00Z,119.81,121.17,119.12,121.02,239188560,175.9475854\n2010-04-23T13:30:00Z,120.94,121.86,120.63,121.8125,177335440,181.1933032\n2010-04-26T13:30:00Z,121.85001,122.12,121.23,121.35001,143457184,179.5691204\n2010-04-27T13:30:00Z,120.64999,121.33459,118.25,118.48,355853824,154.9987191\n2010-04-28T13:30:00Z,119.05,119.67999,118.27,119.38,300677632,157.0057671\n2010-04-29T13:30:00Z,120.10001,121.11,120.07001,120.8575,193774880,171.2904361\n2010-04-30T13:30:00Z,120.88,121.00999,118.78,118.8125,270000896,155.7835573\n2010-05-03T13:30:00Z,119.38,120.67999,119.2,120.35001,182747808,163.8057556\n2010-05-04T13:30:00Z,119.00999,119.03,116.92,117.52,360353280,140.0910492\n2010-05-05T13:30:00Z,116.56,117.8,115.97,116.82001,328973312,135.9456192\n2010-05-06T13:30:00Z,116.25999,117,105,112.942,647356416,102.4400707\n2010-05-07T13:30:00Z,112.64,113.77,109.41,111.25999,637558784,88.82152895\n2010-05-10T13:30:00Z,115.81,116.64999,114.91,116.16,396159488,129.5740173\n2010-05-11T13:30:00Z,115.07001,117.36,114.91,115.83,317849600,129.9973394\n2010-05-12T13:30:00Z,116.28999,117.62,116.09,117.45,235607008,144.4504146\n2010-05-13T13:30:00Z,117.13,117.67999,115.89,115.99001,234456064,136.2942172\n2010-05-14T13:30:00Z,115.12,115.33,112.87,113.89,345602048,117.2697339\n2010-05-17T13:30:00Z,114.2,114.52,111.77,113.95,325944064,115.6554657\n2010-05-18T13:30:00Z,114.88,115.22,112.03,112.39999,360595968,105.1311982\n2010-05-19T13:30:00Z,111.77,112.77,110.36,111.75999,394759424,99.80817731\n2010-05-20T13:30:00Z,109.38,109.89,107.47,107.53999,530423552,58.74093573\n2010-05-21T13:30:00Z,105.91,109.38,105.36121,109.11501,500909312,67.00332408\n2010-05-24T13:30:00Z,108.52,109.39,107.61,107.71001,269822976,63.32737715\n2010-05-25T13:30:00Z,105.11,107.87,104.38,107.81799,396505088,70.42635398\n2010-05-26T13:30:00Z,108.48,109.47,106.85001,107.17,349719296,68.46595477\n2010-05-27T13:30:00Z,109.19,110.8,108.78011,110.75999,300870400,97.59487405\n2010-05-28T13:30:00Z,110.64,110.724,108.85001,109.369,297933312,89.05658093\n2010-06-01T13:30:00Z,108.35001,109.95,107.37,107.53,277909248,77.98992739\n2010-06-02T13:30:00Z,108.08,110.34,107.50909,110.33,240243632,99.50980193\n2010-06-03T13:30:00Z,110.64999,111.06,109.58,110.71001,226618256,101.7417175\n2010-06-04T13:30:00Z,108.61,109.33,106.465,106.82001,398475520,66.29249035\n2010-06-07T13:30:00Z,107.2,107.61,105.41,105.49001,264609056,57.52987407\n2010-06-08T13:30:00Z,105.57001,106.83,104.64999,106.62,357774336,61.47238664\n2010-06-09T13:30:00Z,107.24001,108.28,105.60001,106.05,268023248,58.29020989\n2010-06-10T13:30:00Z,107.86,109.28,106.0426,109.14999,317890560,77.97846239\n2010-06-11T13:30:00Z,108.19,109.75,108.12,109.67999,214128128,83.24543872\n2010-06-14T13:30:00Z,110.52,111.12,109.39999,109.509,207196000,81.93793971\n2010-06-15T13:30:00Z,110.28,112.10001,110.09,112,238268624,101.5883003\n2010-06-16T13:30:00Z,111.42,112.42,111.2,111.96001,216373936,103.5883457\n2010-06-17T13:30:00Z,112.28,112.33,111.05,112.14,263185744,104.5730861\n2010-06-18T13:30:00Z,111.83,112.13,111.37,111.729,174006560,101.5863283\n2010-06-21T13:30:00Z,113.12,113.2,110.78999,111.41,213140624,97.05884267\n2010-06-22T13:30:00Z,111.41,111.89999,109.41,109.57001,239355312,83.40204779\n2010-06-23T13:30:00Z,109.64,110.03,108.48,109.23,254698752,79.99573689\n2010-06-24T13:30:00Z,108.69,108.83,107.14,107.42,268691968,63.2947488\n2010-06-25T13:30:00Z,107.74001,108.42,106.77,107.86749,238726496,63.91015541\n2010-06-28T13:30:00Z,108.03,108.32001,107.14,107.53,169333248,61.82554311\n2010-06-29T13:30:00Z,106.02,107.5114,103.55,104.21001,373760512,35.40615768\n2010-06-30T13:30:00Z,103.92,104.88,102.88,103.22,284101632,29.33058345\n2010-07-01T13:30:00Z,103.14999,103.49001,101.13,102.75999,382924800,25.05367502\n2010-07-02T13:30:00Z,103.11,103.42,101.62,102.2,233385120,20.87637767\n2010-07-06T13:30:00Z,103.64,104.37,101.88,102.87,256936432,21.1633487\n2010-07-07T13:30:00Z,103.13,106.24001,103.02,106.1075,253769680,48.54460143\n2010-07-08T13:30:00Z,107,107.28,105.91,107.16,210842064,55.04958499\n2010-07-09T13:30:00Z,107.13,107.97,106.92999,107.96001,144999872,60.93241333\n2010-07-12T13:30:00Z,107.60001,108.24001,107.14999,108.03,131283568,62.85398273\n2010-07-13T13:30:00Z,109.14999,110.09,108.92999,109.66,213025872,77.790479\n2010-07-14T13:30:00Z,109.31,110.08,108.86,109.651,184426752,78.8628425\n2010-07-15T13:30:00Z,109.61,110.06,108.17,109.67999,232337872,79.56217498\n2010-07-16T13:30:00Z,109.09,109.2059,106.45,106.66,282693376,51.2804967\n2010-07-19T13:30:00Z,107.05,107.63,106.22,107.28999,186709008,51.70865795\n2010-07-20T13:30:00Z,105.87,108.56,105.82001,108.48,258162320,60.09219967\n2010-07-21T13:30:00Z,109.03999,109.07001,106.63,107.07001,264526944,53.57728945\n2010-07-22T13:30:00Z,108.34,109.94,108.33,109.461,274781440,69.71936834\n2010-07-23T13:30:00Z,109.24001,110.57001,108.92999,110.41,222020816,76.26797819\n2010-07-26T13:30:00Z,110.60001,111.67,110.28999,111.56,182126496,85.32003233\n2010-07-27T13:30:00Z,112.17,112.28999,111.11,111.55,204855568,85.0629833\n2010-07-28T13:30:00Z,111.32001,111.66,110.46001,110.83,163056192,79.43197196\n2010-07-29T13:30:00Z,111.52,111.82001,109.41,110.28999,220149008,74.95500775\n2010-07-30T13:30:00Z,109.17,110.86,108.98,110.27,220070496,75.78781423\n2010-08-02T13:30:00Z,111.99001,112.94,111.53999,112.75999,188263184,98.54330231\n2010-08-03T13:30:00Z,112.48,112.77,111.85001,112.22,146657248,96.10219692\n2010-08-04T13:30:00Z,112.53,113.11,112.16,112.97,158171632,101.0618644\n2010-08-05T13:30:00Z,112.25,112.91,112.08,112.85001,140473744,102.7249659\n2010-08-06T13:30:00Z,111.74001,112.57001,110.92,112.392,239728256,102.8368081\n2010-08-09T13:30:00Z,112.92,113.17999,112.32001,112.992,120800368,106.683435\n2010-08-10T13:30:00Z,112.03,112.98,111.3701,112.375,242916192,104.0373874\n2010-08-11T13:30:00Z,110.64999,110.69,109.12,109.3,273408256,74.20874815\n2010-08-12T13:30:00Z,107.64999,109.02,107.60001,108.63,239542560,71.31106083\n2010-08-13T13:30:00Z,108.28999,108.96001,108.17999,108.31,158698496,71.1327277\n2010-08-16T13:30:00Z,107.57001,108.61,107.17999,108.25999,147895248,72.60912261\n2010-08-17T13:30:00Z,109.19,110.39,108.88,109.59,172270256,83.98413101\n2010-08-18T13:30:00Z,109.53999,110.38,108.91,109.78999,182922064,85.32068395\n2010-08-19T13:30:00Z,109.22,109.49001,107.42999,107.88,265847568,68.98061174\n2010-08-20T13:30:00Z,107.56,107.93761,106.74989,107.53,209714128,65.7336384\n2010-08-23T13:30:00Z,108.03999,108.57001,107.07001,107.1236,163490256,61.97332529\n2010-08-24T13:30:00Z,105.95,106.39,104.97,105.53,280795648,48.40115292\n2010-08-25T13:30:00Z,104.95,106.34,104.28999,105.94,272330752,51.27819294\n2010-08-26T13:30:00Z,106.44,106.58,104.88,105.23,224492688,47.64677445\n2010-08-27T13:30:00Z,105.89,106.97,104.31,106.86,272704000,54.30025546\n2010-08-30T13:30:00Z,106.58,106.91,105.3,105.311,167238560,44.08446599\n2010-08-31T13:30:00Z,104.92,105.98,104.49001,105.31,273933056,43.7345297\n2010-09-01T13:30:00Z,106.73,108.61,106.66,108.46001,267834944,74.88994637\n2010-09-02T13:30:00Z,108.72,109.49001,108.49001,109.47,156112128,82.97290855\n2010-09-03T13:30:00Z,110.53999,110.99001,109.95,110.89,212197248,94.51212049\n2010-09-07T13:30:00Z,110.37,110.50999,109.55,109.64,141973680,84.17449026\n2010-09-08T13:30:00Z,109.86,110.85001,109.81,110.41,150268944,89.16314056\n2010-09-09T13:30:00Z,111.64999,111.67999,110.62,110.92,147017872,90.88473979\n2010-09-10T13:30:00Z,111.12,111.61,110.87,111.48199,127818944,93.50491203\n2010-09-13T13:30:00Z,112.58,112.95,112.13,112.72,178503440,103.8988916\n2010-09-14T13:30:00Z,112.5,113.28999,112.08,112.64999,209823568,104.0273585\n2010-09-15T13:30:00Z,112.32001,113.21001,111.98,113.08,168608320,106.8272344\n2010-09-16T13:30:00Z,112.73,113.12,112.35001,113.05,199962880,108.3480548\n2010-09-17T13:30:00Z,113.03999,113.14999,112.17999,112.49001,195836816,104.438292\n2010-09-20T13:30:00Z,112.88,114.46001,112.52161,114.21001,214786688,117.6679775\n2010-09-21T13:30:00Z,114.3,114.84,113.50999,113.98,268632320,117.5166387\n2010-09-22T13:30:00Z,113.8,114.44,113.10001,113.42,191322368,114.3018639\n2010-09-23T13:30:00Z,112.49001,113.67,112.17999,112.498,202354256,109.3486762\n2010-09-24T13:30:00Z,113.75,114.89999,113.64999,114.82001,209671680,132.8283931\n2010-09-27T13:30:00Z,114.86,114.99001,114.16,114.27,128799440,130.6577987\n2010-09-28T13:30:00Z,114.42,115.03999,113.17999,114.67,209207440,131.9388659\n2010-09-29T13:30:00Z,114.38,114.91,114.02,114.47,179665744,131.5443449\n2010-09-30T13:30:00Z,115.05,115.78999,113.59,114.13,287106560,128.6582458\n2010-10-01T13:30:00Z,114.99001,115.12,113.92999,114.61,174638624,128.9196658\n2010-10-04T13:30:00Z,114.37,114.85001,113.17999,113.75,166153184,122.5140597\n2010-10-05T13:30:00Z,114.8,116.32001,114.67,116.03999,229634064,142.0513327\n2010-10-06T13:30:00Z,116.02,116.33,115.56,116.03,148626496,142.8985601\n2010-10-07T13:30:00Z,116.5,116.53,115.19,115.89,164860000,141.1681131\n2010-10-08T13:30:00Z,116.05,116.86,115.61,116.53751,177760064,144.3615269\n2010-10-11T13:30:00Z,116.72,116.97,116.25,116.64999,103098320,145.001599\n2010-10-12T13:30:00Z,116.27,117.35001,115.64999,117.00999,182210000,147.5943325\n2010-10-13T13:30:00Z,117.66,118.55,117.38,117.92,194347120,155.2506666\n2010-10-14T13:30:00Z,117.80991,118.00999,116.72,117.46001,217764256,152.0959939\n2010-10-15T13:30:00Z,118.28,118.35001,116.75999,117.7,243704944,151.6400997\n2010-10-18T13:30:00Z,117.74001,118.67,117.31,118.28,141502192,154.4799882\n2010-10-19T13:30:00Z,117.19,117.85001,116.02,116.73,280604672,143.8214406\n2010-10-20T13:30:00Z,116.94,118.44,116.87,117.87,200051744,152.8951585\n2010-10-21T13:30:00Z,118.39999,119.09,117.21001,118.13,221546128,154.1855673\n2010-10-22T13:30:00Z,118.31,118.53,118,118.347,108212320,154.8885096\n2010-10-25T13:30:00Z,119.14,119.75999,118.61,118.7,151145680,155.861778\n2010-10-26T13:30:00Z,118.10001,118.84,117.87,118.72,158982880,156.9184669\n2010-10-27T13:30:00Z,117.89,118.50999,117.25999,118.38,190023936,157.2810365\n2010-10-28T13:30:00Z,119.06,119.11,117.83,118.39999,168576000,156.6710278\n2010-10-29T13:30:00Z,118.28,118.72,118.07001,118.49001,144305504,156.7470011\n2010-11-01T13:30:00Z,119.07001,119.75,117.85001,118.53,174074688,156.0310445\n2010-11-02T13:30:00Z,119.42,119.75,119.10001,119.47501,158345872,161.9993134\n2010-11-03T13:30:00Z,119.675,120.02,118.45,119.95,226702752,164.5324776\n2010-11-04T13:30:00Z,121.28,122.32001,119.9724,122.25999,215039312,182.0370157\n2010-11-05T13:30:00Z,122.34,122.92,122.17999,122.72501,180654128,185.8166435\n2010-11-08T14:30:00Z,122.34,122.69,121.94,122.49001,155901632,185.4545735\n2010-11-09T14:30:00Z,122.82001,122.95,121.12,121.61,186621568,178.8176795\n2010-11-10T14:30:00Z,121.58,122.16,120.66,122.10001,221387376,180.2917998\n2010-11-11T14:30:00Z,121.05,121.82001,120.67999,121.63499,158017568,180.0241498\n2010-11-12T14:30:00Z,120.82001,121.35001,119.64999,120.198,239068816,170.0321422\n2010-11-15T14:30:00Z,120.58,121.05,119.98,120.03,163940688,167.4315553\n2010-11-16T14:30:00Z,119.28999,119.49001,117.59,118.16,300332032,150.4302709\n2010-11-17T14:30:00Z,118.21001,118.71001,117.86,118.218,172308816,149.7609675\n2010-11-18T14:30:00Z,119.36,120.39,119.35001,119.9575,197723680,166.9851522\n2010-11-19T14:30:00Z,119.89999,120.34,119.25,120.28999,156852816,169.4000891\n2010-11-22T14:30:00Z,119.69,120.24001,118.77,120.19,181592192,170.8765911\n2010-11-23T14:30:00Z,118.77,119.015,117.99001,118.44749,222308944,156.8000166\n2010-11-24T14:30:00Z,119.2,120.23,119.17999,120.2,140159056,172.9644005\n2010-11-26T14:30:00Z,119.16,119.81,118.8,118.8,76007680,164.9661187\n2010-11-29T14:30:00Z,118.5,119.48,117.74001,119.162,223642256,167.1491018\n2010-11-30T14:30:00Z,117.98,119.17,117.81,118.49249,233930624,165.77669\n2010-12-01T14:30:00Z,120.2,121.24001,120.19,121.00999,221037120,191.6218362\n2010-12-02T14:30:00Z,121.2,122.64999,121.13,122.56,191213568,205.609666\n2010-12-03T14:30:00Z,122.14,123.03,122.11,122.89,151288816,208.045926\n2010-12-06T14:30:00Z,122.63,123.03999,122.5,122.75999,103050432,208.4563195\n2010-12-07T14:30:00Z,123.94,124.00999,122.75999,122.83,206580944,205.6999027\n2010-12-08T14:30:00Z,122.98,123.38,122.41,123.28,138019184,206.588555\n2010-12-09T14:30:00Z,123.97,124.02,123.14999,123.75999,123705056,208.7908392\n2010-12-10T14:30:00Z,124.14,124.60001,123.73,124.48,117571632,213.557191\n2010-12-13T14:30:00Z,125.05,125.2,124.52,124.56,133812624,213.0985923\n2010-12-14T14:30:00Z,124.75,125.23,124.28999,124.67,147249568,212.8916824\n2010-12-15T14:30:00Z,124.44,124.92999,123.89,124.09801,160823008,209.3826381\n2010-12-16T14:30:00Z,124.17999,124.91,123.75,124.82001,185035184,213.2800696\n2010-12-17T14:30:00Z,124.08,124.46001,123.82001,124.3,141075248,211.6856581\n2010-12-20T14:30:00Z,124.64,124.89999,123.98,124.60001,119085440,212.9741691\n2010-12-21T14:30:00Z,124.99001,125.47,124.87,125.39,94965440,220.1267522\n2010-12-22T14:30:00Z,125.48,125.82001,125.41,125.78,78878064,223.4344608\n2010-12-23T14:30:00Z,125.64,125.78,125.28999,125.60001,70079248,222.756996\n2010-12-27T14:30:00Z,125.13,125.77,125.03999,125.64999,58125968,224.1758448\n2010-12-28T14:30:00Z,125.89999,125.95,125.5,125.83,55309008,225.0649273\n2010-12-29T14:30:00Z,125.98,126.2,125.89999,125.92,58033040,225.3437538\n2010-12-30T14:30:00Z,125.8,126.13,125.53,125.72,76616880,224.333083\n2010-12-31T14:30:00Z,125.53,125.87,125.33,125.75,91270256,224.8554045\n2011-01-03T14:30:00Z,126.71001,127.60001,125.6969,127.05,138725184,233.8604399\n2011-01-04T14:30:00Z,127.33,127.37,126.19,126.98,137409680,233.1805861\n2011-01-05T14:30:00Z,126.58,127.72501,126.46001,127.64,133975248,236.9762124\n2011-01-06T14:30:00Z,127.69,127.83,127.00999,127.39,122519008,236.4862897\n2011-01-07T14:30:00Z,127.56,127.77,126.14999,127.14,156034560,234.0401192\n2011-01-10T14:30:00Z,126.58,127.16,126.2,126.98,122401632,233.6815512\n2011-01-11T14:30:00Z,127.44,127.74001,126.95,127.42999,110286944,236.5901846\n2011-01-12T14:30:00Z,128.21001,128.72,127.4621,128.58,107929120,245.0067474\n2011-01-13T14:30:00Z,128.63,128.69,128.05,128.36749,129229120,243.8704655\n2011-01-14T14:30:00Z,128.19,129.33,128.10001,129.3,117677872,250.4724146\n2011-01-18T14:30:00Z,129.17999,129.64,129.03,129.52,114401248,252.070666\n2011-01-19T14:30:00Z,129.41,129.53571,127.91,128.25,151958320,241.6888588\n2011-01-20T14:30:00Z,127.96001,128.39999,127.13,128.08,175745632,239.8939531\n2011-01-21T14:30:00Z,128.88,129.17,128.23,128.37,151462880,240.3176818\n2011-01-24T14:30:00Z,128.285,129.25,128.25999,129.10001,113715440,245.2886284\n2011-01-25T14:30:00Z,128.75999,129.28,128.11,129.17,167552128,247.4449703\n2011-01-26T14:30:00Z,129.49001,130.05,129.23,129.67,141281440,251.443633\n2011-01-27T14:30:00Z,129.7,130.21001,129.47,129.99001,123302624,253.6363816\n2011-01-28T14:30:00Z,130.14,130.35001,127.50999,127.72,295637248,235.5020008\n2011-01-31T14:30:00Z,128.07001,128.78,127.75,128.67999,149249120,238.1519205\n2011-02-01T14:30:00Z,129.46001,130.97,129.3801,130.74001,167194192,257.6634019\n2011-02-02T14:30:00Z,130.39999,130.84,130.33,130.485,118323632,257.9952846\n2011-02-03T14:30:00Z,130.25999,130.98,129.57001,130.78,145886624,260.2977851\n2011-02-04T14:30:00Z,130.83,131.2,130.23,131.14999,134634688,262.3602413\n2011-02-07T14:30:00Z,131.44,132.39999,131.42999,131.97,112439008,270.0086785\n2011-02-08T14:30:00Z,132.09,132.64,131.73,132.57001,99072688,273.9150637\n2011-02-09T14:30:00Z,132.21001,132.63,131.61,132.269,146436624,273.1176229\n2011-02-10T14:30:00Z,131.60001,132.47,131.3,132.321,162708496,275.3016219\n2011-02-11T14:30:00Z,131.8,133.28,131.77,133.11,137716432,281.0613308\n2011-02-14T14:30:00Z,133.03,133.53999,132.88,133.42999,101691120,283.367747\n2011-02-15T14:30:00Z,133.02,133.22,132.3167,133.00999,119575376,281.3272906\n2011-02-16T14:30:00Z,133.46001,134.00999,133.19,133.85001,130183440,288.3993477\n2011-02-17T14:30:00Z,133.46001,134.42999,133.34,134.25,109810432,291.1237046\n2011-02-18T14:30:00Z,134.37,134.69,134.06,134.53,130002320,292.9764209\n2011-02-22T14:30:00Z,133.12,134.56149,131.47,131.83,233116368,272.7917404\n2011-02-23T14:30:00Z,131.75,132.07001,130.21001,131.02,227610128,265.8446184\n2011-02-24T14:30:00Z,130.88,131.44,129.7,130.92999,260467056,264.7824604\n2011-02-25T14:30:00Z,131.48,132.41,131.39999,132.33,141693808,278.2989278\n2011-02-28T14:30:00Z,132.82001,133.32001,132.38,133.14999,141600752,284.5914284\n2011-03-01T14:30:00Z,133.57001,133.69,130.89,130.92999,258582256,267.6487509\n2011-03-02T14:30:00Z,130.75,131.82001,130.35001,131.21001,200277808,267.2570699\n2011-03-03T14:30:00Z,132.39999,133.62,132.39,133.47,176485184,289.9091175\n2011-03-04T14:30:00Z,133.37,133.63,131.60001,132.47,277371392,283.8937047\n2011-03-07T14:30:00Z,132.86,133.15939,130.735,131.42999,216888944,275.7896552\n2011-03-08T14:30:00Z,131.64,133,131.07001,132.58,174706432,281.2053817\n2011-03-09T14:30:00Z,132.32001,132.8,131.60001,132.39,153903440,281.5468227\n2011-03-10T14:30:00Z,131,131.17999,129.81,129.9375,301665792,257.5413012\n2011-03-11T14:30:00Z,129.52,131.31,129.49001,130.84,225758496,262.8753422\n2011-03-14T13:30:00Z,129.99001,130.48,129.06,130.05,235607744,260.3966864\n2011-03-15T13:30:00Z,126.59,129.33,126.5,128.56,359794688,257.0045058\n2011-03-16T13:30:00Z,128.14999,128.57001,125.28,126.175,469160704,241.3958497\n2011-03-17T13:30:00Z,128,128.39,127.10001,127.85001,254521632,248.2138539\n2011-03-18T13:30:00Z,128.84,128.88,127.50999,127.75999,230654368,245.160844\n2011-03-21T13:30:00Z,129.35001,130.00999,129.2,129.74001,154065312,260.0438139\n2011-03-22T13:30:00Z,129.72,129.89,129.17,129.28999,129743440,257.5706111\n2011-03-23T13:30:00Z,128.92999,130,128.32001,129.66,148648752,259.6988528\n2011-03-24T13:30:00Z,130.39999,131.09,129.67,130.89999,159238320,268.9976885\n2011-03-25T13:30:00Z,131.24001,131.87,130.89211,131.3,155770000,272.048539\n2011-03-28T13:30:00Z,131.58,131.92,130.94,130.98,109839056,269.6923676\n2011-03-29T13:30:00Z,130.87,131.89999,130.44,131.86,129844560,274.0673472\n2011-03-30T13:30:00Z,132.55,133.16,132.36,132.77,135895872,282.0044859\n2011-03-31T13:30:00Z,132.60001,132.96001,132.45,132.59,132756496,281.5442994\n2011-04-01T13:30:00Z,133.41,133.77,132.83,133.14999,154038944,284.5115239\n2011-04-04T13:30:00Z,133.42999,133.67,132.88,133.25999,100773312,284.3594651\n2011-04-05T13:30:00Z,133,133.83,132.94,133.24001,121083808,284.5792361\n2011-04-06T13:30:00Z,133.88,134,133.12,133.66,120453632,286.4488494\n2011-04-07T13:30:00Z,133.42,133.97749,132.66,133.32001,170973184,284.4224913\n2011-04-08T13:30:00Z,133.91,133.99001,132.31,132.86,148014816,280.6830735\n2011-04-11T13:30:00Z,133,133.45,132.14,132.46001,121518496,278.0145949\n2011-04-12T13:30:00Z,131.72,131.98,130.99001,131.47,161480688,269.6010367\n2011-04-13T13:30:00Z,132.08,132.17999,130.96001,131.46001,162172944,268.2776217\n2011-04-14T13:30:00Z,130.7,131.75999,130.27,131.56,161271248,269.9730936\n2011-04-15T13:30:00Z,131.8,132.37,131.41,132.03999,170146624,273.4844652\n2011-04-18T13:30:00Z,130.59,132.03011,129.50999,130.56,210908192,264.7067808\n2011-04-19T13:30:00Z,130.75999,131.35001,130.44,131.31,124321872,270.1824644\n2011-04-20T13:30:00Z,132.88,133.39,132.78999,133.10001,156473008,288.1097694\n2011-04-21T13:30:00Z,133.78999,133.84,133.1046,133.78,136214496,292.3688882\n2011-04-25T13:30:00Z,133.67999,133.86,133.2,133.64,65231072,291.4797749\n2011-04-26T13:30:00Z,134.05,135.06,133.91,134.791,146658432,301.8385476\n2011-04-27T13:30:00Z,135.05,135.87,134.5,135.67,143104816,307.7974599\n2011-04-28T13:30:00Z,135.42999,136.28999,135.41,136.11,124865744,311.2980599\n2011-04-29T13:30:00Z,136.16,136.57001,135.98,136.42999,115094368,313.6623343\n2011-05-02T13:30:00Z,137.07001,137.17999,135.95,136.22,126310064,311.6121068\n2011-05-03T13:30:00Z,135.96001,136.19,135.045,135.73,138445808,307.2379285\n2011-05-04T13:30:00Z,135.67,135.73,134.23,134.83,182821184,298.9463938\n2011-05-05T13:30:00Z,134.08,134.95,133.02,133.61,227065680,290.1448459\n2011-05-06T13:30:00Z,134.94,135.63,133.22,134.2,222951248,290.656839\n2011-05-09T13:30:00Z,134.19,135.11,133.98,134.72,114134432,293.251896\n2011-05-10T13:30:00Z,135.17,136.11,135,135.87,114887008,303.5103725\n2011-05-11T13:30:00Z,135.67,135.69,133.82001,134.44,193745632,292.288185\n2011-05-12T13:30:00Z,134.08,135.36,133.39,135.08,171648128,294.6869913\n2011-05-13T13:30:00Z,135.14999,135.34,133.56,134.03999,157499056,288.3926095\n2011-05-16T13:30:00Z,133.56,134.61,132.97,133.19,141770624,283.8151937\n2011-05-17T13:30:00Z,132.69,133.35001,132.12,133.17,192852320,284.4599194\n2011-05-18T13:30:00Z,133.24001,134.5,132.95,134.36,135228128,293.7679035\n2011-05-19T13:30:00Z,134.8,135.03,133.94,134.67999,119584880,295.4184005\n2011-05-20T13:30:00Z,134.33,134.6781,133.36,133.61,182638320,286.4899922\n2011-05-23T13:30:00Z,131.98,133.64751,131.59,132.06,168800000,276.9542806\n2011-05-24T13:30:00Z,132.44,132.73,131.7,131.95,147200320,275.6182687\n2011-05-25T13:30:00Z,131.42,132.94,131.38,132.39,151102192,278.5695132\n2011-05-26T13:30:00Z,132.03,133.24001,131.78,133,164984624,282.7430877\n2011-05-27T13:30:00Z,133.37,133.87,132.9588,133.50999,120921872,286.6195392\n2011-05-31T13:30:00Z,134.77,134.92,133.84,134.89999,164731184,296.8778411\n2011-06-01T13:30:00Z,134.50999,134.9234,131.75999,131.87,233094256,270.3655931\n2011-06-02T13:30:00Z,131.96001,132.24001,130.96001,131.73,200466752,267.6831054\n2011-06-03T13:30:00Z,130.14999,131.42,130.08,130.42,234690128,259.496239\n2011-06-06T13:30:00Z,130.09,130.36,128.87,129.045,179951120,248.328949\n2011-06-07T13:30:00Z,129.7,130.07001,128.85001,128.96001,161805936,245.231278\n2011-06-08T13:30:00Z,128.75999,129.19,128.17999,128.42,198696320,241.5800465\n2011-06-09T13:30:00Z,128.77,129.92999,128.46001,129.39999,160964368,248.8304009\n2011-06-10T13:30:00Z,128.85001,128.92999,127.25999,127.60001,238629312,234.1261026\n2011-06-13T13:30:00Z,127.89,128.24001,127.05,127.7,207599744,233.3074459\n2011-06-14T13:30:00Z,128.87,129.77,128.82001,129.32001,160570368,248.2386979\n2011-06-15T13:30:00Z,128.24001,129.2991,126.67999,127.02,300957952,231.4049379\n2011-06-16T13:30:00Z,127.06,127.97,126.32001,127.3,308038400,231.6934545\n2011-06-17T13:30:00Z,127.92999,127.94,126.62,127.05,234996064,229.7532525\n2011-06-20T13:30:00Z,126.62,127.97,126.58,127.7,159478944,233.2175525\n2011-06-21T13:30:00Z,128.36,129.7,127.75349,129.45,193157248,247.5103993\n2011-06-22T13:30:00Z,129.05,129.81,128.59,128.67,176886432,244.9984646\n2011-06-23T13:30:00Z,127.16,128.63609,126.19,128.30099,334286848,245.6436908\n2011-06-24T13:30:00Z,128.27,128.37,126.62,126.81,226129376,235.6511598\n2011-06-27T13:30:00Z,126.89,128.42999,126.64,127.94,168908192,241.7120554\n2011-06-28T13:30:00Z,128.45,129.63,128.27,129.61,165556256,256.5586463\n2011-06-29T13:30:00Z,130.2,130.92999,129.6321,130.72,244295376,265.1236307\n2011-06-30T13:30:00Z,131.14,132.17999,130.705,131.97,223496496,275.3288425\n2011-07-01T13:30:00Z,132.09,134.10001,131.78,133.92,202385632,291.5119034\n2011-07-05T13:30:00Z,133.78,134.08,133.39,133.81,165935936,292.5583359\n2011-07-06T13:30:00Z,133.49001,134.14,133.11,133.97,143332688,294.2766883\n2011-07-07T13:30:00Z,135.16,135.7,134.88,135.36,170464192,306.7556339\n2011-07-08T13:30:00Z,133.83,135.3558,133.39,134.39999,194171504,302.9420172\n2011-07-11T13:30:00Z,132.75,133.17999,131.66,131.97,195918560,282.7650562\n2011-07-12T13:30:00Z,131.69,132.78,131.36,131.39999,214675632,279.912455\n2011-07-13T13:30:00Z,132.09,133.22,131.519,131.84,204062560,281.4173795\n2011-07-14T13:30:00Z,132.17,132.78,130.67999,130.92999,226111744,276.0782905\n2011-07-15T13:30:00Z,131.66,131.87,130.77,131.69,220124624,278.015839\n2011-07-18T13:30:00Z,131.08,131.28,129.63,130.61,196872064,268.9774161\n2011-07-19T13:30:00Z,131.34,132.89,131.31,132.73,166554880,287.7512257\n2011-07-20T13:30:00Z,133.07001,133.14999,132.42,132.64999,137145312,287.8912561\n2011-07-21T13:30:00Z,133.39999,134.82001,132.6693,134.49001,245270320,301.5416197\n2011-07-22T13:30:00Z,134.52,134.72,133.75999,134.58,126019312,302.9945898\n2011-07-25T13:30:00Z,133.3,134.49001,133.16,133.83,136653680,299.9937013\n2011-07-26T13:30:00Z,133.74001,133.96001,133.03,133.33,131278128,297.2995855\n2011-07-27T13:30:00Z,132.59,132.63,130.42999,130.60001,249020000,271.1457219\n2011-07-28T13:30:00Z,130.60001,131.77,130.00999,130.22,207939872,267.6878736\n2011-07-29T13:30:00Z,128.91,130.55,127.96671,129.33,307042560,263.6127367\n2011-08-01T13:30:00Z,130.84,130.96001,127.53,128.78,325790720,258.9186198\n2011-08-02T13:30:00Z,127.81,128.5,125.49001,125.49001,346653696,231.0625565\n2011-08-03T13:30:00Z,125.66,126.31,123.53,126.17,371029504,232.3568075\n2011-08-04T13:30:00Z,124.42,124.62,120.06,120.25999,520721920,177.3911706\n2011-08-05T13:30:00Z,121.75999,122.07001,116.86,120.08,655561472,170.3872477\n2011-08-08T13:30:00Z,116.91,120.1218,112.02,112.25999,702263808,107.9341673\n2011-08-09T13:30:00Z,114.07001,117.64,110.27,117.48,717828608,130.6431564\n2011-08-10T13:30:00Z,115.25999,116.28,111.95,112.28999,662607360,95.84148324\n2011-08-11T13:30:00Z,113.25999,118.92,112.317,117.33,487979776,131.4990193\n2011-08-12T13:30:00Z,118.39999,119.215,117.28,118.12,313731584,138.1528063\n2011-08-15T13:30:00Z,119.19,120.74001,119,120.62,258810560,161.0414467\n2011-08-16T13:30:00Z,119.47,120.69,118.31,119.59,294095104,157.8111384\n2011-08-17T13:30:00Z,120.25,121.2,118.72,119.67,238201056,157.0895249\n2011-08-18T13:30:00Z,116.5,119.714,113.39,114.50999,512956160,118.8648242\n2011-08-19T13:30:00Z,112.96001,115.88,112.5,112.64,428281344,110.6761694\n2011-08-22T13:30:00Z,115.17,115.23,112.41,112.73,275090688,103.9220665\n2011-08-23T13:30:00Z,113.14999,116.5665,112.58,116.44,331136512,128.6748834\n2011-08-24T13:30:00Z,116.19,118.24001,115.92,118.08,246869680,140.8735989\n2011-08-25T13:30:00Z,118.73,119.39999,115.87,116.28,312365312,132.0649807\n2011-08-26T13:30:00Z,115.69,118.50999,113.85001,117.97,314495744,138.4525143\n2011-08-29T13:30:00Z,119.56,121.42999,118.0569,121.36,190977184,164.8155248\n2011-08-30T13:30:00Z,120.83,122.42999,119.25999,121.67999,241315680,169.1481914\n2011-08-31T13:30:00Z,122.46001,123.50999,121.3,122.22,301828352,172.1344802\n2011-09-01T13:30:00Z,122.28999,123.39999,120.78,120.94,254585872,165.3676786\n2011-09-02T13:30:00Z,118.42,120.8726,117.42999,117.85001,255517184,144.0129519\n2011-09-06T13:30:00Z,114.39,117.16,114.38,116.99001,285142784,145.9876137\n2011-09-07T13:30:00Z,118.75999,120.34,118.36,120.28999,209803120,175.7673199\n2011-09-08T13:30:00Z,119.57001,120.94,118.77,119.03999,250568192,171.5523251\n2011-09-09T13:30:00Z,117.67999,119.05701,115.28,115.92,380195072,146.7120938\n2011-09-12T13:30:00Z,114.47,116.75999,114.05,116.67,305793536,151.9436715\n2011-09-13T13:30:00Z,117.05,118.17999,116.22,117.74001,272514560,159.3320301\n2011-09-14T13:30:00Z,118.34,120.8,116.72,119.37,319389440,169.7545752\n2011-09-15T13:30:00Z,120.64999,121.47,119.4034,121.42999,326777088,184.9356271\n2011-09-16T13:30:00Z,121.28999,121.97,120.32001,121.521,284528128,186.4453698\n2011-09-19T13:30:00Z,119.53,120.92999,118.72,120.31,241516944,181.2326068\n2011-09-20T13:30:00Z,120.82001,121.99001,120.00999,120.17,218932128,179.9291387\n2011-09-21T13:30:00Z,120.23,120.60001,116.44,116.63,316251136,150.2526277\n2011-09-22T13:30:00Z,113.25,114.21001,111.3,112.86,513920000,117.9687331\n2011-09-23T13:30:00Z,112.11,114.16,112.02,113.53999,307242496,122.6802708\n2011-09-26T13:30:00Z,114.61,116.39999,112.98,116.24001,260673632,141.0049746\n2011-09-27T13:30:00Z,118.53,119.56,116.84,117.53999,311753728,148.3452666\n2011-09-28T13:30:00Z,117.78,118.49001,114.97,115.145,286696704,131.4622086\n2011-09-29T13:30:00Z,117.05,117.63,113.92999,116.05,298108928,130.5580398\n2011-09-30T13:30:00Z,114.45,115.45,113.07001,113.14999,288685568,106.402653\n2011-10-03T13:30:00Z,112.49001,113.95,109.81,109.92999,365136640,83.844584\n2011-10-04T13:30:00Z,108.35001,112.58,107.42999,112.34,459177472,94.61451254\n2011-10-05T13:30:00Z,112.62,114.72,111.58,114.42,284108032,108.9142856\n2011-10-06T13:30:00Z,114.36,116.66,113.50999,116.49001,257800752,122.8559719\n2011-10-07T13:30:00Z,117.17,117.245,115.06,115.71001,312657920,119.6411081\n2011-10-10T13:30:00Z,117.67999,119.63,117.67,119.58,230666192,152.6660425\n2011-10-11T13:30:00Z,118.87,120.03999,118.75,119.7,209087936,155.6345468\n2011-10-12T13:30:00Z,120.60001,122.14,120.33,120.75,281544704,164.3464648\n2011-10-13T13:30:00Z,120.03999,120.87,119.12,120.50999,212538816,164.5316211\n2011-10-14T13:30:00Z,121.91,122.60001,121.23,122.57001,211397568,182.2607647\n2011-10-17T13:30:00Z,121.99001,122.54919,119.92999,120.23,202311568,164.2231699\n2011-10-18T13:30:00Z,120.14,123.5,119.2,122.58,318857984,177.7188007\n2011-10-19T13:30:00Z,122.38,123.08,120.71001,121.13,226601248,171.9731116\n2011-10-20T13:30:00Z,121.42999,122.10001,119.82001,121.66,262075632,173.0232038\n2011-10-21T13:30:00Z,123.09,124.12,122.72,123.97,278999296,194.741592\n2011-10-24T13:30:00Z,124.17,125.8,124.06,125.49001,203215568,208.4324507\n2011-10-25T13:30:00Z,124.89,124.95,122.78,123.049,268596736,189.8959132\n2011-10-26T13:30:00Z,124.35001,124.77,122.21001,124.3,289053696,192.6230292\n2011-10-27T13:30:00Z,127.63,129.42,124.3187,128.63,390025728,222.7138609\n2011-10-28T13:30:00Z,128,128.85001,127.8,128.60001,225906496,224.7889048\n2011-10-31T13:30:00Z,127.16,128.6239,125.32001,125.5,228146624,202.3533039\n2011-11-01T13:30:00Z,122.03,123.50999,121.52,122.002,416565760,173.6226367\n2011-11-02T13:30:00Z,123.83,124.39999,122.7905,123.99001,245529376,188.9848086\n2011-11-03T13:30:00Z,125.27,126.5,123.595,126.25,291174912,203.8465389\n2011-11-04T13:30:00Z,125.23,125.7,124.00999,125.481,249401504,201.3221046\n2011-11-07T14:30:00Z,125.39,126.39,124.2,126.25999,196617184,205.8596075\n2011-11-08T14:30:00Z,126.92,128.02,125.71001,127.88,224426192,215.9458008\n2011-11-09T14:30:00Z,124.89,125.8,122.86,123.161,337981952,176.2177646\n2011-11-10T14:30:00Z,124.78999,124.94,123.02,124.32001,231866496,178.5422912\n2011-11-11T14:30:00Z,125.83,126.99001,125.78999,126.66,189924320,199.9859407\n2011-11-14T14:30:00Z,126.19,127.45,124.92,125.46001,159258256,194.5931921\n2011-11-15T14:30:00Z,125.17,126.75,124.72,126.08299,184709376,197.8618173\n2011-11-16T14:30:00Z,124.81,126.34,123.89999,124.08,235782432,186.9205525\n2011-11-17T14:30:00Z,123.85001,124.16,121.23,122.105,331219712,169.5801625\n2011-11-18T14:30:00Z,122.5,122.75,121.47,121.979,215580368,167.6476257\n2011-11-21T14:30:00Z,120.2,120.35001,118.64999,119.661,229611632,146.2671417\n2011-11-22T14:30:00Z,119.39999,120.10001,118.52,119.19,216494816,143.3113343\n2011-11-23T14:30:00Z,118.07001,119.19,116.56,116.56,224531632,122.2474014\n2011-11-25T14:30:00Z,116.38,117.7,116.2,116.34,99557008,119.9040195\n2011-11-28T14:30:00Z,119.53999,120.17999,118.82001,119.71001,210686000,151.5824639\n2011-11-29T14:30:00Z,120.05,121,119.61,120.05,199241504,153.7352257\n2011-11-30T14:30:00Z,123.49001,125.22,119.9971,124.99001,324439552,188.9375938\n2011-12-01T14:30:00Z,124.85001,125.64,124.42999,124.97,176954752,190.0012152\n2011-12-02T14:30:00Z,126.12,126.5,124.78,124.86,221109680,186.1215532\n2011-12-05T14:30:00Z,126.84,127.17999,125.44,126.22,225263872,190.6663291\n2011-12-06T14:30:00Z,126.21001,127.11,125.75999,126.25999,178842064,190.3336162\n2011-12-07T14:30:00Z,125.84,127.25999,124.97,126.73,237802496,193.5813902\n2011-12-08T14:30:00Z,125.89999,126.17999,123.64999,123.95,240862752,171.1204035\n2011-12-09T14:30:00Z,124.50999,126.37,124.39999,126.05,209111312,184.5539142\n2011-12-12T14:30:00Z,124.95,124.97,123.16,124.21001,215826064,172.5013671\n2011-12-13T14:30:00Z,124.86,125.57001,122.45,123.05,245159680,165.0126631\n2011-12-14T14:30:00Z,122.56,123.03,121.47,121.74001,238618816,154.4053506\n2011-12-15T14:30:00Z,123.03,123.2,121.99001,122.185,199109120,153.3239331\n2011-12-16T14:30:00Z,122.23,122.95,121.3,121.59,220481312,149.976951\n2011-12-19T14:30:00Z,122.06,122.32001,120.03,120.28999,183902944,140.6447866\n2011-12-20T14:30:00Z,122.17999,124.14,120.37019,123.92999,225418064,163.6892879\n2011-12-21T14:30:00Z,123.92999,124.36,122.75,124.17,194230880,166.5618756\n2011-12-22T14:30:00Z,124.63,125.39999,124.23241,125.27,119465312,175.600277\n2011-12-23T14:30:00Z,125.67,126.42999,125.41,126.39,92187184,185.1122711\n2011-12-27T14:30:00Z,126.17,126.82001,126.06,126.49001,86075680,186.3703086\n2011-12-28T14:30:00Z,126.50999,126.53,124.73,124.83,119107008,172.2106579\n2011-12-29T14:30:00Z,125.24001,126.25,124.8566,126.12,123507120,178.5752737\n2011-12-30T14:30:00Z,126.02,126.33,125.5,125.5,95599008,176.1395444\n2012-01-03T14:30:00Z,127.75999,128.38,127.42999,127.495,193697808,191.3889399\n2012-01-04T14:30:00Z,127.2,127.81,126.71001,127.7,127186432,193.0243638\n2012-01-05T14:30:00Z,127.00999,128.23,126.42999,128.03999,173894944,197.0652424\n2012-01-06T14:30:00Z,128.2,128.22,127.28999,127.71001,148049936,195.8120622\n2012-01-09T14:30:00Z,128,128.17999,127.41,128.02,99530128,196.462054\n2012-01-10T14:30:00Z,129.39,129.64999,128.95,129.13,115281936,205.0387306\n2012-01-11T14:30:00Z,128.73,129.37,128.52,129.2,111540688,206.0387306\n2012-01-12T14:30:00Z,129.57001,129.7,128.53999,129.50999,118983632,207.3221882\n2012-01-13T14:30:00Z,128.64,129.05,127.72,128.84,179836128,203.1668898\n2012-01-17T14:30:00Z,130.08,130.32001,128.89571,129.34,132209184,204.2753048\n2012-01-18T14:30:00Z,129.31,130.84,129.08,130.77,163395120,213.7949064\n2012-01-19T14:30:00Z,131.22,131.57001,130.8,131.46001,126328816,218.9036867\n2012-01-20T14:30:00Z,131.24001,131.95,130.92,131.53999,138230128,219.8015519\n2012-01-23T14:30:00Z,131.50999,132.25,130.98,131.61,129295744,220.4449514\n2012-01-24T14:30:00Z,130.8,131.5,130.60001,131.46001,103083248,221.7655331\n2012-01-25T14:30:00Z,131.25999,132.87,130.75,132.56,198613184,229.1509936\n2012-01-26T14:30:00Z,133.14999,133.39999,131.36,131.88,184880496,226.0114725\n2012-01-27T14:30:00Z,131.24001,132.05,131.14999,131.82001,135259056,225.6836165\n2012-01-30T14:30:00Z,130.50999,131.44,130.06,131.37,147311744,226.4853359\n2012-01-31T14:30:00Z,132.02,132.17999,130.67999,131.32001,157211936,225.9392945\n2012-02-01T14:30:00Z,132.28999,133.14,132.13,132.47,166234432,233.5583745\n2012-02-02T14:30:00Z,132.73,133.02,132.21001,132.67999,113090368,234.4830399\n2012-02-03T14:30:00Z,134,134.62,133.77,134.53999,160598496,252.7243132\n2012-02-06T14:30:00Z,133.98,134.5134,133.83,134.45,107694432,254.2182737\n2012-02-07T14:30:00Z,134.17,135.02,133.64,134.78999,135528064,256.8128599\n2012-02-08T14:30:00Z,134.86,135.22,134.31,135.19,139361376,258.8410126\n2012-02-09T14:30:00Z,135.41,135.59,134.56,135.36,148602816,259.6462092\n2012-02-10T14:30:00Z,134.16,134.47,133.84,134.36099,167907504,251.6879172\n2012-02-13T14:30:00Z,135.32001,135.52,134.74001,135.36,115841808,259.2833903\n2012-02-14T14:30:00Z,135,135.27,134.25,135.19,165996128,258.8638964\n2012-02-15T14:30:00Z,135.63,135.83,134.28999,134.56,195195120,254.9042317\n2012-02-16T14:30:00Z,134.57001,136.17,134.33,136.049,186567744,264.2672268\n2012-02-17T14:30:00Z,136.52,136.6275,135.96001,136.41,129869376,266.6227621\n2012-02-21T14:30:00Z,136.73,137.05,136.05,136.47,134042256,266.2432001\n2012-02-22T14:30:00Z,136.25999,136.55,135.78999,136.032,124455248,263.0647328\n2012-02-23T14:30:00Z,135.96001,136.73,135.5,136.631,137704256,266.0391619\n2012-02-24T14:30:00Z,136.92999,137.2,136.63,136.92999,105539056,268.2890309\n2012-02-27T14:30:00Z,136.02,137.53,135.8,137.16,145728816,271.5549388\n2012-02-28T14:30:00Z,137.2,137.72,136.92999,137.55901,129355808,274.3663568\n2012-02-29T14:30:00Z,137.75999,138.19,136.53999,137.02,185934688,271.3672596\n2012-03-01T14:30:00Z,137.31,137.99001,136.9312,137.73,145026128,274.9498064\n2012-03-02T14:30:00Z,137.64,137.82001,137,137.312,120638256,272.5970616\n2012-03-05T14:30:00Z,137.10001,137.2,136.28,136.75,140765008,267.6040727\n2012-03-06T14:30:00Z,135.35001,135.42999,134.36,134.75,202129808,247.9818211\n2012-03-07T14:30:00Z,135.06,135.91,134.92999,135.69,143692128,254.5483642\n2012-03-08T14:30:00Z,136.52,137.32001,136.24001,137.03999,116968816,266.4533589\n2012-03-09T14:30:00Z,137.3,137.92999,137.13,137.57001,122836752,270.989099\n2012-03-12T13:30:00Z,137.55,137.75999,137.09,137.58,104003504,271.3653514\n2012-03-13T13:30:00Z,138.32001,140.13,138.09,140.062,184090432,294.6261067\n2012-03-14T13:30:00Z,140.10001,140.44501,139.48,139.91,145163504,295.1156731\n2012-03-15T13:30:00Z,140.12,140.78,139.75999,140.72,165118432,300.5276286\n2012-03-16T13:30:00Z,140.36,140.48,140,140.3,152893376,298.7276286\n2012-03-19T13:30:00Z,140.21001,141.28,140.11,140.85001,125291008,303.1469841\n2012-03-20T13:30:00Z,140.05,140.61,139.64,140.44,121729632,302.8141722\n2012-03-21T13:30:00Z,140.52,140.64999,139.92,140.21001,122388368,301.6850634\n2012-03-22T13:30:00Z,139.17999,139.55,138.74001,139.2,135216688,293.5539626\n2012-03-23T13:30:00Z,139.32001,139.81,138.55,139.64999,120520944,295.5450092\n2012-03-26T13:30:00Z,140.64999,141.61,140.60001,141.61,120163936,315.2585682\n2012-03-27T13:30:00Z,141.74001,141.83,141.08,141.17,119868432,313.6357735\n2012-03-28T13:30:00Z,141.10001,141.32001,139.64,140.47,148562000,307.5624733\n2012-03-29T13:30:00Z,139.64,140.49339,139.09,140.23,164963632,306.9960768\n2012-03-30T13:30:00Z,140.92,141.05,140.05,140.81,135486688,309.9996171\n2012-04-02T13:30:00Z,140.64,142.21001,140.36,141.84,151741056,317.4680062\n2012-04-03T13:30:00Z,141.64,141.8826,140.42999,141.25999,155806624,315.1046529\n2012-04-04T13:30:00Z,140.22,140.339,139.34,139.86,146895936,302.1745547\n2012-04-05T13:30:00Z,139.38,140.2,139.25999,139.78999,137439376,302.3383362\n2012-04-09T13:30:00Z,138.03,139.84441,137.84,138.22,127555872,294.3991331\n2012-04-10T13:30:00Z,137.95,138.34,135.75999,135.89999,235360256,275.1034885\n2012-04-11T13:30:00Z,137.28999,137.53999,136.75,137,154132944,277.7291091\n2012-04-12T13:30:00Z,137.13,138.89999,137.03,138.78999,154321504,293.1832333\n2012-04-13T13:30:00Z,138.47,138.8168,137.00999,137.14,169246624,283.6696204\n2012-04-16T13:30:00Z,137.84,138.03999,136.58,137.05,147825184,281.104258\n2012-04-17T13:30:00Z,137.84,139.36,137.698,139.082,147877568,297.3402467\n2012-04-18T13:30:00Z,138.46001,139.08,138.38,138.61,123884192,296.9650211\n2012-04-19T13:30:00Z,138.63,139.14999,137.07001,137.72,198666752,291.0218033\n2012-04-20T13:30:00Z,138.33,138.83,137.87,137.95,143199568,289.9914815\n2012-04-23T13:30:00Z,136.53999,136.91,135.94,136.78999,171844880,281.035172\n2012-04-24T13:30:00Z,136.91,137.66,136.8,137.31,137484192,285.6226912\n2012-04-25T13:30:00Z,138.64999,139.25,138.53,139.19,150255008,304.7005308\n2012-04-26T13:30:00Z,138.89,140.32001,138.81,140.16,136292688,312.1709157\n2012-04-27T13:30:00Z,140.58,140.78999,139.8,140.39,130725008,313.5335956\n2012-04-30T13:30:00Z,140.11,140.21001,139.49001,139.87,115092192,309.0237798\n2012-05-01T13:30:00Z,139.78999,141.66,139.63,140.74001,138837312,315.9023259\n2012-05-02T13:30:00Z,139.92,140.46001,139.46001,140.325,121080944,316.0474869\n2012-05-03T13:30:00Z,140.34,140.45,138.99001,139.25,143762688,307.9308774\n2012-05-04T13:30:00Z,138.515,139.30119,136.92,137,193931312,289.9314125\n2012-05-07T13:30:00Z,136.50999,137.56,136.46001,137.10001,127765872,289.9699216\n2012-05-08T13:30:00Z,136.28,136.77,134.92,136.55,213383872,288.2844856\n2012-05-09T13:30:00Z,135.10001,136.61,134.49001,135.74001,220778192,285.7978308\n2012-05-10T13:30:00Z,136.67999,136.85001,135.71001,136.02,150600944,286.3848234\n2012-05-11T13:30:00Z,135.17,136.87,135.11,135.61,153032368,285.3359658\n2012-05-14T13:30:00Z,134.31,135.6144,133.91,134.11,163909936,276.6106296\n2012-05-15T13:30:00Z,134.02,134.81,133.13,133.34,207629248,272.5036931\n2012-05-16T13:30:00Z,133.94,134.55,132.8,132.82899,207265568,267.6333053\n2012-05-17T13:30:00Z,132.86,133.02,130.78999,130.86,247992944,251.1342649\n2012-05-18T13:30:00Z,131.37,131.60001,129.55,129.74001,319631104,243.3160839\n2012-05-21T13:30:00Z,130.16,132.02,129.95,131.97,177861056,258.3661171\n2012-05-22T13:30:00Z,132.31,133.23,131.34,132.2,197531120,260.4756421\n2012-05-23T13:30:00Z,131.25,132.46001,129.99001,132.27,204958320,263.5312464\n2012-05-24T13:30:00Z,132.63,132.84,131.42,132.53,167357632,265.0060599\n2012-05-25T13:30:00Z,132.48,132.85001,131.78,132.10001,135465568,262.2450192\n2012-05-29T13:30:00Z,133.16,133.92999,131.17,133.7,152883440,269.3558226\n2012-05-30T13:30:00Z,132.56,133.6924,131.49001,131.75999,162370368,256.3467836\n2012-05-31T13:30:00Z,131.71001,132.45,130.34,131.47,196186192,254.0031975\n2012-06-01T13:30:00Z,129.41,131.5042,128.16,128.16,253245008,229.7253779\n2012-06-04T13:30:00Z,128.39,128.74001,127.13499,128.10001,202548256,227.9964934\n2012-06-05T13:30:00Z,127.85001,129.25999,127.78,129.07001,164149376,235.0362955\n2012-06-06T13:30:00Z,129.97,132.03,129.92999,131.97,184202752,262.4761728\n2012-06-07T13:30:00Z,133.47,133.53,131.78,132.05,184772688,261.9128395\n2012-06-08T13:30:00Z,131.71001,133.125,131.28999,133.10001,143915632,266.1772628\n2012-06-11T13:30:00Z,134.17,134.25,131.28,131.41499,169756064,256.8679699\n2012-06-12T13:30:00Z,131.78999,133.00999,131.16,132.92,181931744,262.2917025\n2012-06-13T13:30:00Z,132.53,133.36,131.62,132.07001,172223872,259.0879758\n2012-06-14T13:30:00Z,132.34,134,131.98,133.47,230616256,269.5401749\n2012-06-15T13:30:00Z,133.38,134.25999,133.10001,134.14,169444432,274.1011639\n2012-06-18T13:30:00Z,133.58,134.73,133.28,134.39999,131365440,276.9197123\n2012-06-19T13:30:00Z,135.08,136.25,134.3714,135.7,137382560,286.9917813\n2012-06-20T13:30:00Z,135.71001,136.10001,134.27,135.48,206466624,286.1813094\n2012-06-21T13:30:00Z,135.64,135.78,132.33,132.44,205272320,259.8143773\n2012-06-22T13:30:00Z,133.13,133.71001,132.62,133.46001,130029184,261.3578445\n2012-06-25T13:30:00Z,132.05,132.10001,130.85001,131.32001,146375680,241.7221378\n2012-06-26T13:30:00Z,131.7,132.38,130.92999,131.98,141633936,244.2280064\n2012-06-27T13:30:00Z,132.42,133.42999,131.96671,133.173,108087936,253.9182562\n2012-06-28T13:30:00Z,132.28999,132.99001,131.28,132.78999,169242688,254.2467179\n2012-06-29T13:30:00Z,135.2,136.27,134.85001,136.105,212251056,287.1252949\n2012-07-02T13:30:00Z,136.48,136.64999,135.52,136.50999,129524432,288.867462\n2012-07-03T13:30:00Z,136.48,137.50999,136.34,137.412,80450192,296.1685347\n2012-07-05T13:30:00Z,136.89999,137.8,136.28999,136.78999,126177440,294.3821721\n2012-07-06T13:30:00Z,135.47,135.77,134.85001,135.49001,151192000,283.4220458\n2012-07-09T13:30:00Z,135.38,135.57001,134.7,135.32001,103780432,282.3217328\n2012-07-10T13:30:00Z,136.00999,136.23,133.67999,134.14,167884816,273.809948\n2012-07-11T13:30:00Z,134.21001,134.60001,133.38,134.16,141734000,272.4799468\n2012-07-12T13:30:00Z,133.38,134.2269,132.60001,133.50999,143583120,268.9263389\n2012-07-13T13:30:00Z,133.86,135.89,133.84,135.75,129644128,290.2213653\n2012-07-16T13:30:00Z,135.44,135.83,134.89999,135.42999,97525184,290.7800232\n2012-07-17T13:30:00Z,135.97,136.64,134.55,136.36,138860192,294.8369039\n2012-07-18T13:30:00Z,136.03999,137.64,135.96001,137.37,113349632,302.8144678\n2012-07-19T13:30:00Z,137.64999,138.17999,137.21001,137.73,129847184,305.661549\n2012-07-20T13:30:00Z,136.95,137.16,136.32001,136.47,142904432,294.2707447\n2012-07-23T13:30:00Z,134.47,136.38519,133.84,135.09,145210816,287.0463906\n2012-07-24T13:30:00Z,135.19,135.25,133.03,133.925,173301120,278.1423117\n2012-07-25T13:30:00Z,134.21001,134.56,133.25,133.96001,129122256,277.0884608\n2012-07-26T13:30:00Z,135.89,136.46001,135.25999,136.17,156526432,295.7770069\n2012-07-27T13:30:00Z,136.89,139.07001,136.1364,138.675,236768880,316.7013793\n2012-07-30T13:30:00Z,138.52,139.339,138.27,138.67999,106781936,318.1563374\n2012-07-31T13:30:00Z,138.49001,138.87,137.71001,137.71001,120575808,311.4877438\n2012-08-01T13:30:00Z,138.7,138.73,137.39999,137.59,138293744,307.8508763\n2012-08-02T13:30:00Z,136.55,137.57001,135.58,136.64,199556560,301.3283193\n2012-08-03T13:30:00Z,138.56,139.64,136.6794,139.349,157825008,320.8476013\n2012-08-06T13:30:00Z,139.72,140.17,139.56,139.62,86327744,323.1988971\n2012-08-07T13:30:00Z,140.17999,140.92,140.03,140.32001,109545056,328.6036181\n2012-08-08T13:30:00Z,139.85001,140.64999,139.81,140.49001,89754624,330.5161848\n2012-08-09T13:30:00Z,140.28999,140.89,140.14999,140.61,90291632,331.738349\n2012-08-10T13:30:00Z,140.03999,140.89,139.81,140.84,99792624,334.7987195\n2012-08-13T13:30:00Z,140.60001,140.84,140.03999,140.77,79426880,335.873707\n2012-08-14T13:30:00Z,141.28999,141.38,140.37,140.78999,102379376,335.1944737\n2012-08-15T13:30:00Z,140.64,141.19,140.55,140.95,71085808,335.8154369\n2012-08-16T13:30:00Z,141.14999,142.16,140.8,141.99001,112014192,343.9041291\n2012-08-17T13:30:00Z,142.23,142.3,141.86,142.17999,90813680,345.0218133\n2012-08-20T13:30:00Z,141.98,142.22,141.59,142.19,78255680,345.6101223\n2012-08-21T13:30:00Z,142.53999,143.09,141.45,141.75999,105581008,343.0593136\n2012-08-22T13:30:00Z,141.39999,142.05,141.07001,141.82001,133243440,343.334684\n2012-08-23T13:30:00Z,141.47,141.48,140.44,140.66499,111466368,333.8077026\n2012-08-24T13:30:00Z,140.31,141.83,140.22,141.50999,99481184,338.8076006\n2012-08-27T13:30:00Z,141.89,142.08,141.34,141.53999,68785872,339.3385351\n2012-08-28T13:30:00Z,141.17999,141.84,140.97,141.39999,75689568,338.9013609\n2012-08-29T13:30:00Z,141.52,141.89,141.12,141.50999,65421296,339.4952939\n2012-08-30T13:30:00Z,140.89999,140.94,140.19,140.49001,96589808,329.7347196\n2012-08-31T13:30:00Z,141.28999,141.82001,140.36,141.16,151970368,332.4080111\n2012-09-04T13:30:00Z,141.03999,141.46001,140.13,141.03,120226192,331.6166518\n2012-09-05T13:30:00Z,141.09,141.47,140.63,140.91,100660256,330.9230377\n2012-09-06T13:30:00Z,141.75999,143.78,141.75,143.77,158272432,358.3865005\n2012-09-07T13:30:00Z,144.00999,144.39,143.88,144.33,107272000,362.8241637\n2012-09-10T13:30:00Z,144.19,144.44,143.46001,143.50999,86458432,357.2840297\n2012-09-11T13:30:00Z,143.60001,144.37,143.56,143.91,88760000,359.3431313\n2012-09-12T13:30:00Z,144.39,144.55,143.89999,144.39,87640880,362.408378\n2012-09-13T13:30:00Z,144.37,147.03999,143.99001,146.59,225470128,380.3828133\n2012-09-14T13:30:00Z,146.88,148.11,146.75999,147.24001,169777008,386.9946773\n2012-09-17T13:30:00Z,146.94,147.19,146.37,146.74001,119427744,384.0288016\n2012-09-18T13:30:00Z,146.49001,146.81,146.25,146.62,98326496,383.5015743\n2012-09-19T13:30:00Z,146.78999,147.17,146.41,146.7,128318256,383.7943699\n2012-09-20T13:30:00Z,146.03,146.78999,145.63,146.71001,154009744,385.6466291\n2012-09-21T13:30:00Z,146.64,146.67,145.81,145.87,108737440,379.9947808\n2012-09-24T13:30:00Z,145.14999,145.98,145.03999,145.645,95682000,379.2161036\n2012-09-25T13:30:00Z,145.96001,146.24001,144.06,144.10001,133165120,369.1057096\n2012-09-26T13:30:00Z,144.065,144.11,142.95,143.295,146502128,361.7854094\n2012-09-27T13:30:00Z,143.89,144.97,143.50999,144.64,111830256,370.8711879\n2012-09-28T13:30:00Z,144.09,144.56,143.46001,143.97,150696064,367.8573019\n2012-10-01T13:30:00Z,144.52,145.69,144.00819,144.345,135911120,369.4565375\n2012-10-02T13:30:00Z,144.92,145.14999,143.83,144.5,113422128,369.0922234\n2012-10-03T13:30:00Z,144.89,145.42999,144.13,145.09,121283008,371.5123659\n2012-10-04T13:30:00Z,145.64,146.34,145.44,146.125,124311632,380.7311159\n2012-10-05T13:30:00Z,146.91,147.16,145.7,146.14,124842064,379.7135022\n2012-10-08T13:30:00Z,145.60001,146.12309,145.31,145.642,78415568,376.2885485\n2012-10-09T13:30:00Z,145.53,145.64999,144.14999,144.2,148872816,363.3457817\n2012-10-10T13:30:00Z,144.17999,144.32001,143.09,143.28,124247440,355.7867523\n2012-10-11T13:30:00Z,144.28,144.49001,143.327,143.36,123601440,352.545302\n2012-10-12T13:30:00Z,143.46001,143.95,142.58,142.89,124181872,349.5441149\n2012-10-15T13:30:00Z,143.23,144.23,142.77,144.08,107689056,357.2396827\n2012-10-16T13:30:00Z,144.75999,145.64,144.66,145.53999,108815440,370.8041194\n2012-10-17T13:30:00Z,145.64,146.32001,145.42,146.2,128834064,375.8573296\n2012-10-18T13:30:00Z,145.82001,146.52,145.33,145.82001,148108432,374.8761674\n2012-10-19T13:30:00Z,145.55,145.56,143.05,143.3896,185645120,351.854372\n2012-10-22T13:30:00Z,143.14999,143.67,142.28,143.41,125578624,350.4541674\n2012-10-23T13:30:00Z,141.86,142.06,140.83,141.42,192056320,332.8967863\n2012-10-24T13:30:00Z,141.92999,142.10001,140.8,141.02,120179312,329.9880913\n2012-10-25T13:30:00Z,142.02,142.28,140.57001,141.42999,134457312,329.5307795\n2012-10-26T13:30:00Z,141.3,141.84,140.39,141.35001,146023440,328.7069366\n2012-10-31T13:30:00Z,141.85001,142.03,140.67999,141.35001,103438496,327.9661364\n2012-11-01T13:30:00Z,141.64999,143.00999,141.52,142.83,100995568,339.8362882\n2012-11-02T13:30:00Z,143.67999,143.72,141.41,141.56,137702128,332.903259\n2012-11-05T14:30:00Z,141.35001,142.17,140.92999,141.8486,98378432,332.9208278\n2012-11-06T14:30:00Z,142.28,143.52,142.13,142.96001,107068064,342.8667412\n2012-11-07T14:30:00Z,141.66,141.67999,139.06,139.72,264304432,314.1567226\n2012-11-08T14:30:00Z,139.7,140.41,137.92999,138.03999,181517248,302.8559454\n2012-11-09T14:30:00Z,137.62,139.44,137.55,138.16,201055184,302.7610709\n2012-11-12T14:30:00Z,138.59,138.81,137.96001,138.265,97677440,303.0807125\n2012-11-13T14:30:00Z,137.53999,139.25,137.36,137.78999,123018192,301.7338796\n2012-11-14T14:30:00Z,138.21001,138.42999,135.62,135.9299,191504944,287.8638133\n2012-11-15T14:30:00Z,135.98,136.4901,135.17999,135.7,178128368,285.5206967\n2012-11-16T14:30:00Z,135.89999,136.64,134.7,136.37,239483808,288.1171052\n2012-11-19T14:30:00Z,137.89999,139.14999,136.4057,139.13,151495744,309.1898945\n2012-11-20T14:30:00Z,138.91,139.42,138.08,139.19,119807376,311.2114302\n2012-11-21T14:30:00Z,139.31,139.57001,139.03,139.45,81710752,312.7688227\n2012-11-23T14:30:00Z,140.13,141.39999,140.03999,141.35001,65409152,331.1222565\n2012-11-26T14:30:00Z,140.64999,141.35629,140.19,141.05,100124320,332.1324191\n2012-11-27T14:30:00Z,140.91,141.39,140.24001,140.33,128646192,328.4469526\n2012-11-28T14:30:00Z,139.75999,141.53999,139,141.46001,177086432,334.128018\n2012-11-29T14:30:00Z,141.99001,142.50999,141.37,142.12,151085872,338.9501839\n2012-11-30T14:30:00Z,142.14,142.42,141.66,142.155,136568320,339.2222578\n2012-12-03T14:30:00Z,142.8,142.92,141.34,141.45,124656320,334.7958815\n2012-12-04T14:30:00Z,141.44,141.87,140.87,141.25,127622496,333.0816291\n2012-12-05T14:30:00Z,141.37,142.16,140.37,141.5,147300432,333.9096053\n2012-12-06T14:30:00Z,141.37,142.03999,141.16,141.98,103220560,336.9332126\n2012-12-07T14:30:00Z,142.53,142.69,141.67,142.41499,108726320,338.9390194\n2012-12-10T14:30:00Z,142.21001,142.81,142.14999,142.47301,98840688,339.5152772\n2012-12-11T14:30:00Z,143.06,144.11,142.99001,143.44,152570368,348.1773294\n2012-12-12T14:30:00Z,144,144.55,143.31,143.50999,145880000,347.7615211\n2012-12-13T14:30:00Z,143.42,143.83,142.27499,142.63,135714944,341.3312291\n2012-12-14T14:30:00Z,142.32001,142.58,141.88,142.1051,137701680,337.1144862\n2012-12-17T14:30:00Z,142.47,143.85001,142.42999,143.77,143735744,352.1858428\n2012-12-18T14:30:00Z,144,145.5,143.78999,145.37,177762752,365.9856257\n2012-12-19T14:30:00Z,145.53,145.58,144.24001,144.28999,150895312,360.2873067\n2012-12-20T14:30:00Z,144.38,145.14,143.98,145.12,168486944,363.5037777\n2012-12-21T14:30:00Z,142.17,144.0881,141.94,142.78999,245883808,350.7026955\n2012-12-24T14:30:00Z,142.48,142.56,142.19,142.35001,53874544,348.6520563\n2012-12-26T14:30:00Z,142.64,142.71001,141.35001,141.75,106947680,343.815838\n2012-12-27T14:30:00Z,141.78999,142.08,139.92,141.5616,167920560,341.2950514\n2012-12-28T14:30:00Z,140.64,141.42,139.87,140.03,148806624,329.3627869\n2012-12-31T14:30:00Z,139.66,142.56,139.53999,142.41,243952192,347.3184533\n2013-01-02T14:30:00Z,145.11,146.14999,144.73,146.06,192058944,381.746068\n2013-01-03T14:30:00Z,145.99001,146.37,145.34,145.7341,144761744,380.9779437\n2013-01-04T14:30:00Z,145.97,146.61,145.67,146.37,116817680,385.1869954\n2013-01-07T14:30:00Z,145.85001,146.4442,145.42999,145.9695,110002432,383.9175304\n2013-01-08T14:30:00Z,145.71001,145.91,144.98,145.54961,121265056,380.9790348\n2013-01-09T14:30:00Z,145.87,146.32001,145.64,145.92,90745568,383.2143806\n2013-01-10T14:30:00Z,146.73,147.09,145.97,147.08,130735376,391.7272046\n2013-01-11T14:30:00Z,147.03999,147.14999,146.61,147.07001,113917312,392.160323\n2013-01-14T14:30:00Z,146.89,147.07001,146.42999,146.97,89567120,391.8359702\n2013-01-15T14:30:00Z,146.28999,147.21001,146.2,147.07001,93172560,394.2189289\n2013-01-16T14:30:00Z,146.77,147.28,146.61,147.05,104849504,395.2658943\n2013-01-17T14:30:00Z,147.7,148.42,147.14461,148,133833440,402.4592317\n2013-01-18T14:30:00Z,147.97,148.49001,147.42999,148.33,169905936,404.2954099\n2013-01-22T14:30:00Z,148.33,149.13,147.98,149.13,111797312,409.4970228\n2013-01-23T14:30:00Z,149.13,149.5,148.86,149.37,104596064,411.0386895\n2013-01-24T14:30:00Z,149.14999,150.14,149.00999,149.41,146426320,411.968849\n2013-01-25T14:30:00Z,149.88,150.25,149.3726,150.25,147211568,418.0411091\n2013-01-28T14:30:00Z,150.28999,150.33,149.50999,150.07001,113357632,417.0401805\n2013-01-29T14:30:00Z,149.77,150.85001,149.67,150.66,105694368,420.9085662\n2013-01-30T14:30:00Z,150.64,150.94,149.92999,150.07001,137447632,418.493167\n2013-01-31T14:30:00Z,149.89,150.38,149.60001,149.7,108975808,416.5586657\n2013-02-01T14:30:00Z,150.64999,151.42,150.39,151.24001,131173008,430.0671648\n2013-02-04T14:30:00Z,150.32001,151.2679,149.42999,149.535,159073568,418.9562727\n2013-02-05T14:30:00Z,150.35001,151.48,150.28999,151.05,113912320,430.457656\n2013-02-06T14:30:00Z,150.52,151.25999,150.41,151.16,138762752,432.8186506\n2013-02-07T14:30:00Z,151.205,151.35001,149.86,150.96001,162490000,432.01854\n2013-02-08T14:30:00Z,151.22,151.89,151.22,151.8,103133680,439.2313737\n2013-02-11T14:30:00Z,151.74001,151.89999,151.3938,151.77,73774944,439.7381764\n2013-02-12T14:30:00Z,151.78,152.3,151.61,152.02,65392608,441.5309577\n2013-02-13T14:30:00Z,152.33,152.61,151.72,152.151,82322560,441.9249379\n2013-02-14T14:30:00Z,151.69,152.47,151.52,152.28999,80834192,443.4879078\n2013-02-15T14:30:00Z,152.42999,152.59,151.55,152.11,215226432,442.7495194\n2013-02-19T14:30:00Z,152.37,153.28,152.1629,153.25,95105376,451.7142456\n2013-02-20T14:30:00Z,153.14,153.19,151.25999,151.34,160574816,436.9375763\n2013-02-21T14:30:00Z,150.96001,151.4218,149.94,150.42,183256944,429.5092484\n2013-02-22T14:30:00Z,151.14999,151.89,150.4913,151.89,106356496,439.4908876\n2013-02-25T14:30:00Z,152.63,152.86,149,149,245824752,419.3073513\n2013-02-26T14:30:00Z,149.72,150.2,148.73,150.02,186596192,420.135427\n2013-02-27T14:30:00Z,149.89,152.33,149.75999,151.91,150781872,436.3741416\n2013-02-28T14:30:00Z,151.89999,152.87,151.41,151.61,126865936,436.557363\n2013-03-01T14:30:00Z,151.09,152.34,150.41,152.11,170634752,440.0686127\n2013-03-04T14:30:00Z,151.75999,152.92,151.52,152.92,99010192,445.1005389\n2013-03-05T14:30:00Z,153.66,154.7,153.64,154.28999,121663056,457.9494885\n2013-03-06T14:30:00Z,154.84,154.92,154.16,154.5,94469872,458.7971182\n2013-03-07T14:30:00Z,154.7,154.98,154.52,154.776,86101312,460.034956\n2013-03-08T14:30:00Z,155.46001,155.64999,154.66,155.44,123487632,463.6783946\n2013-03-11T13:30:00Z,155.325,156.03999,155.13,156.03,83746688,467.5205649\n2013-03-12T13:30:00Z,155.92,156.10001,155.21001,155.67999,105755680,466.1085816\n2013-03-13T13:30:00Z,155.75999,156.12,155.23,155.905,92550880,466.8117261\n2013-03-14T13:30:00Z,156.31,156.8,155.90781,156.73,126329872,473.2561363\n2013-03-15T13:30:00Z,155.85001,156.03999,155.31,155.83,138601056,467.2015179\n2013-03-18T13:30:00Z,154.34,155.64,154.2,154.97,126704256,463.5631144\n2013-03-19T13:30:00Z,155.3,155.50999,153.59,154.61,167567248,461.290089\n2013-03-20T13:30:00Z,155.52,155.95,155.25999,155.69,113759248,468.2897964\n2013-03-21T13:30:00Z,154.75999,155.6389,154.10001,154.35899,128604944,459.0816469\n2013-03-22T13:30:00Z,154.85001,155.60001,154.73,155.60001,111163504,469.2540267\n2013-03-25T13:30:00Z,156.00999,156.27,154.35001,154.95,151322256,465.5747944\n2013-03-26T13:30:00Z,155.59,156.23,155.42,156.19,86856560,473.361084\n2013-03-27T13:30:00Z,155.25999,156.245,155,156.19,99950560,476.6400085\n2013-03-28T13:30:00Z,156.09,156.85001,155.75,156.67,102932816,479.7434582\n2013-04-01T13:30:00Z,156.59,156.91,155.67,156.05,99194064,476.3815448\n2013-04-02T13:30:00Z,156.61,157.21001,156.37,156.82001,101504320,481.108512\n2013-04-03T13:30:00Z,156.91,157.03,154.82001,155.23,154167312,467.9730679\n2013-04-04T13:30:00Z,155.42999,156.17,155.09,155.86,131884944,469.6376708\n2013-04-05T13:30:00Z,153.95,155.35001,153.77,155.158,159665936,469.7015709\n2013-04-08T13:30:00Z,155.27,156.22,154.75,156.21001,86571120,476.533907\n2013-04-09T13:30:00Z,156.5,157.32001,155.98,156.75,101922128,480.4981282\n2013-04-10T13:30:00Z,157.17,158.87,157.13,158.67,135711008,498.6690818\n2013-04-11T13:30:00Z,158.7,159.71001,158.53999,159.19,110142496,503.4651823\n2013-04-12T13:30:00Z,158.67999,159.03999,157.92,158.8,116359808,502.2150891\n2013-04-15T13:30:00Z,158,158.13,155.10001,155.118,217258944,467.5242175\n2013-04-16T13:30:00Z,156.28999,157.49001,155.91,157.41,147507808,479.2429558\n2013-04-17T13:30:00Z,156.28999,156.32001,154.28,155.11,226834752,461.4217186\n2013-04-18T13:30:00Z,155.37,155.41,153.55,154.14,167583120,452.9159195\n2013-04-19T13:30:00Z,154.5,155.55,154.12,155.48,149687568,460.6379519\n2013-04-22T13:30:00Z,155.78,156.53999,154.75,156.17,106553440,464.3166822\n2013-04-23T13:30:00Z,156.95,157.92999,156.17,157.78,166141248,476.8859921\n2013-04-24T13:30:00Z,157.83,158.3,157.53999,157.88,96781184,478.0029056\n2013-04-25T13:30:00Z,158.34,159.27,158.10001,158.52,131060560,482.9936164\n2013-04-26T13:30:00Z,158.33,158.60001,157.73,158.24001,95918752,481.4827849\n2013-04-29T13:30:00Z,158.67,159.64999,158.42,159.3,88572688,490.3608679\n2013-04-30T13:30:00Z,159.27,159.72,158.61,159.67999,116010624,492.8870743\n2013-05-01T13:30:00Z,159.33,159.41,158.10001,158.28,138874128,481.2572913\n2013-05-02T13:30:00Z,158.67999,159.89,158.53,159.75,96407568,491.2910289\n2013-05-03T13:30:00Z,161.14,161.88,159.782,161.368,144202256,502.4681648\n2013-05-06T13:30:00Z,161.49001,162.00999,161.42,161.78,66882064,506.1288679\n2013-05-07T13:30:00Z,162.13,162.64999,161.67,162.5999,90359184,511.9530526\n2013-05-08T13:30:00Z,162.42,163.39,162.33,163.34,97419184,517.4787326\n2013-05-09T13:30:00Z,163.27,163.7,162.47,162.881,106738560,515.9014851\n2013-05-10T13:30:00Z,162.99001,163.5498,162.50999,163.41,103202880,518.2606343\n2013-05-13T13:30:00Z,163.2,163.81,162.82001,163.53999,81843184,519.6244376\n2013-05-14T13:30:00Z,163.67,165.35001,163.67,165.23,119000816,535.4187788\n2013-05-15T13:30:00Z,164.96001,166.45,164.91,166.11501,120718432,542.7376331\n2013-05-16T13:30:00Z,165.78,166.36,165.09,165.34,109913568,539.8349724\n2013-05-17T13:30:00Z,165.95,167.03999,165.73,166.94,129801008,552.894187\n2013-05-20T13:30:00Z,166.78,167.58,166.61,166.92999,85071184,553.9208317\n2013-05-21T13:30:00Z,167.08,167.8,166.5,167.17,95804192,555.2319779\n2013-05-22T13:30:00Z,167.34,169.07001,165.17,165.92999,244031744,549.105432\n2013-05-23T13:30:00Z,164.16,165.91,163.94,165.45,211064320,548.1056769\n2013-05-24T13:30:00Z,164.47,165.38049,163.98,165.308,151573872,551.2391839\n2013-05-28T13:30:00Z,167.03999,167.78,165.81,166.3,143679744,556.5248257\n2013-05-29T13:30:00Z,165.42,165.8,164.34,165.22,160363312,547.7009515\n2013-05-30T13:30:00Z,165.35001,166.59,165.22,165.83,107793744,552.5248651\n2013-05-31T13:30:00Z,165.37,166.31,163.13,163.44501,176850000,536.0206551\n2013-06-03T13:30:00Z,163.83,164.46001,162.6599,164.35001,168390688,537.9219734\n2013-06-04T13:30:00Z,164.44,165.10001,162.73,163.56,157631440,533.4669378\n2013-06-05T13:30:00Z,163.09,163.42,161.13,161.272,211737680,513.3523302\n2013-06-06T13:30:00Z,161.2,162.74001,160.25,162.73,200225440,518.8629578\n2013-06-07T13:30:00Z,163.85001,164.95,163.14,164.8,188337744,535.8051864\n2013-06-10T13:30:00Z,165.31,165.39999,164.37,164.8,105667056,535.7534042\n2013-06-11T13:30:00Z,163.3,164.53999,162.739,163.09801,159505376,523.6731903\n2013-06-12T13:30:00Z,164.22,164.39,161.60001,161.75,177363504,514.9929148\n2013-06-13T13:30:00Z,161.66,164.5,161.3,164.21001,163587744,529.0288779\n2013-06-14T13:30:00Z,164.03,164.67,162.91,163.175,141197440,526.2329528\n2013-06-17T13:30:00Z,164.28999,165.22,163.21919,164.44,136295568,532.6688791\n2013-06-18T13:30:00Z,164.53,165.99001,164.52,165.735,114695504,544.7821626\n2013-06-19T13:30:00Z,165.60001,165.89,163.38,163.45,206149440,528.7675605\n2013-06-20T13:30:00Z,161.86,163.4668,158.98,159.39999,321255936,496.4194097\n2013-06-21T13:30:00Z,159.64,159.75999,157.47,159.07001,271956736,491.3121584\n2013-06-24T13:30:00Z,157.41,158.42999,155.73,157.06,222334752,475.9487108\n2013-06-25T13:30:00Z,158.48,160.10001,157.42,158.575,162262128,485.4567675\n2013-06-26T13:30:00Z,159.87,160.5,159.25,160.14,134847936,498.3280582\n2013-06-27T13:30:00Z,161.10001,161.82001,160.95,161.08,129483680,506.1296834\n2013-06-28T13:30:00Z,160.63,161.39999,159.86,160.42,160402816,502.3294908\n2013-07-01T13:30:00Z,161.25999,162.48,161.08,161.36,131954816,509.1010907\n2013-07-02T13:30:00Z,161.12,162.3,160.5,161.21001,154863632,508.8436132\n2013-07-03T13:30:00Z,160.48,161.77,160.22,161.28,75216320,510.7814976\n2013-07-05T13:30:00Z,162.47,163.08,161.3,163.02,122416880,523.3034825\n2013-07-08T13:30:00Z,163.86,164.39,163.0838,163.94501,108092432,529.71558\n2013-07-09T13:30:00Z,164.98,165.33,164.27,165.13,119297872,538.6327238\n2013-07-10T13:30:00Z,164.97,165.75,164.63,165.192,121410368,539.3374214\n2013-07-11T13:30:00Z,167.11,167.61,165.1774,167.44,135592192,554.3308727\n2013-07-12T13:30:00Z,167.39,167.9332,167.13,167.50999,104212624,555.0703838\n2013-07-15T13:30:00Z,167.97,168.39,167.67999,168.155,69450560,560.1871121\n2013-07-16T13:30:00Z,168.25999,168.36,167.07001,167.52499,88702064,555.3596317\n2013-07-17T13:30:00Z,168.16,168.48,167.73,167.9501,92873872,556.1453512\n2013-07-18T13:30:00Z,168.31,169.27,168.2,168.87,103620256,563.7334139\n2013-07-19T13:30:00Z,168.52,169.23,168.31,169.17,103831632,566.2593573\n2013-07-22T13:30:00Z,169.41,169.74001,169.00999,169.5,79428560,568.40483\n2013-07-23T13:30:00Z,169.8,169.83,169.05,169.14,80829632,566.0654609\n2013-07-24T13:30:00Z,169.78999,169.86,168.17999,168.52,112914000,561.4475679\n2013-07-25T13:30:00Z,168.22,169.08,167.94,168.92999,111156560,562.5605318\n2013-07-26T13:30:00Z,168.22,169.16,167.52,169.11,107814496,566.4516223\n2013-07-29T13:30:00Z,168.67999,169.06,168.11,168.59,79845120,564.6640701\n2013-07-30T13:30:00Z,169.10001,169.28,168.19,168.588,85216944,563.5767265\n2013-07-31T13:30:00Z,168.94,169.85001,168.49001,168.71001,142388624,562.9353993\n2013-08-01T13:30:00Z,169.99001,170.81,169.89999,170.66,110438368,581.6462352\n2013-08-02T13:30:00Z,170.28,170.9725,170.05,170.95,91116624,584.4181651\n2013-08-05T13:30:00Z,170.57001,170.96001,170.35001,170.7,54072640,584.3337373\n2013-08-06T13:30:00Z,170.37,170.7402,169.35001,169.73,87494944,576.8759514\n2013-08-07T13:30:00Z,169.19,169.42999,168.55,169.17999,84854624,572.4446423\n2013-08-08T13:30:00Z,169.98,170.17999,168.92999,169.8,102181248,575.07691\n2013-08-09T13:30:00Z,169.58,170.10001,168.72,169.31,91856432,571.9032481\n2013-08-12T13:30:00Z,168.46001,169.31,168.38,169.11099,68593184,572.2469285\n2013-08-13T13:30:00Z,169.41,169.89999,168.41,169.61,80806000,574.5197698\n2013-08-14T13:30:00Z,169.53,169.8,168.7,168.74001,79829184,568.5108766\n2013-08-15T13:30:00Z,167.41,167.42999,166.09,166.38,152931744,545.3005434\n2013-08-16T13:30:00Z,166.06,166.63,165.5,165.83,130868128,541.6437867\n2013-08-19T13:30:00Z,165.64,166.21001,164.75999,164.77,96437568,534.7566868\n2013-08-20T13:30:00Z,165.03999,166.2,164.86,165.58,89294368,539.5670696\n2013-08-21T13:30:00Z,165.12,166.03,164.19,164.56,159530496,534.4425618\n2013-08-22T13:30:00Z,164.89999,166.3,164.89,166.06,101471376,546.7443427\n2013-08-23T13:30:00Z,166.55,166.83,165.77,166.62,90893568,549.8992069\n2013-08-26T13:30:00Z,166.78999,167.3,165.89,166,89705056,546.7110662\n2013-08-27T13:30:00Z,164.36,166.0024,163.21001,163.33,158621744,526.9838728\n2013-08-28T13:30:00Z,163.25999,164.49001,163.05,163.91,108112944,529.7493657\n2013-08-29T13:30:00Z,163.55,165.03999,163.39999,164.17,119200432,532.619405\n2013-08-30T13:30:00Z,164.50999,164.53,163.17,163.64999,134928944,529.3396608\n2013-09-03T13:30:00Z,165.23,165.58,163.7,164.39,142375056,529.9371545\n2013-09-04T13:30:00Z,164.42999,166.03,164.13499,165.75,97389376,538.7506762\n2013-09-05T13:30:00Z,165.85001,166.39999,165.73,165.96001,63090432,541.1678954\n2013-09-06T13:30:00Z,166.50999,166.98,164.48,166.03999,159756432,540.7012019\n2013-09-09T13:30:00Z,166.45,167.73,166.45,167.634,87559248,554.3353348\n2013-09-10T13:30:00Z,168.64,168.89999,168.25999,168.87,105847744,564.7691512\n2013-09-11T13:30:00Z,168.64,169.39999,168.35001,169.39999,94545808,567.6628681\n2013-09-12T13:30:00Z,169.34,169.56,168.72,168.95,83209008,565.7854949\n2013-09-13T13:30:00Z,169.13,169.46001,168.74001,169.33,72727744,567.2769232\n2013-09-16T13:30:00Z,171.16,171.24001,170.03999,170.31,126187504,571.77671\n2013-09-17T13:30:00Z,170.46001,171.11,170.46001,171.07001,82523184,576.3234543\n2013-09-18T13:30:00Z,171.00999,173.52,170.58,173.05099,203460624,591.9403085\n2013-09-19T13:30:00Z,173.52,173.60001,172.58501,172.75999,146616816,591.5786559\n2013-09-20T13:30:00Z,172.33,172.33,170.58,170.72,132867936,572.3899639\n2013-09-23T13:30:00Z,170.49001,170.64999,169.39,169.92999,104616432,565.1791489\n2013-09-24T13:30:00Z,169.89999,170.53,169.21001,169.53,106333008,562.9446451\n2013-09-25T13:30:00Z,169.64,169.98,168.89,169.03999,117306496,559.9593956\n2013-09-26T13:30:00Z,169.32001,170.17,169.05,169.69,77146880,563.7537835\n2013-09-27T13:30:00Z,168.84,169.14,168.47,168.909,99141680,558.9472475\n2013-09-30T13:30:00Z,167.48,168.53999,167.14999,168.00999,143937376,554.6874219\n2013-10-01T13:30:00Z,168.14,169.5,167.9671,169.34,127160432,566.2205423\n2013-10-02T13:30:00Z,168.35001,169.34219,167.83,169.17999,113349744,569.1107601\n2013-10-03T13:30:00Z,168.78999,168.94,166.84,167.62,176698432,557.4379334\n2013-10-04T13:30:00Z,167.75,169.06,167.53,168.89,96878368,565.0799315\n2013-10-07T13:30:00Z,167.42,168.45,167.25,167.42999,96295120,558.046117\n2013-10-08T13:30:00Z,167.39999,167.62,165.36,165.48,178014944,541.4204908\n2013-10-09T13:30:00Z,165.8,166.2,164.53,165.60001,168972816,540.1501888\n2013-10-10T13:30:00Z,167.28999,169.25999,167.23,169.17,195954752,575.3911221\n2013-10-11T13:30:00Z,168.91,170.32001,168.77,170.25999,105039744,583.3436038\n2013-10-14T13:30:00Z,169.21001,171.08,169.08,170.94,112106368,589.2830062\n2013-10-15T13:30:00Z,170.50999,171.14999,169.47,169.7,155484496,584.009687\n2013-10-16T13:30:00Z,170.72,172.16,170.63499,172.07001,161676064,603.9202368\n2013-10-17T13:30:00Z,171.37,173.32001,171.34,173.22,129389184,612.0529212\n2013-10-18T13:30:00Z,173.86,174.50999,173.50999,174.388,138315680,621.5548405\n2013-10-21T13:30:00Z,174.45,174.75,174.00999,174.39999,104103568,621.8772101\n2013-10-22T13:30:00Z,174.91,175.92999,174.42619,175.41,126663248,629.677178\n2013-10-23T13:30:00Z,174.81,174.89,173.96001,174.57001,105484368,623.9227621\n2013-10-24T13:30:00Z,174.92,175.37,174.50999,175.14999,70350432,627.3736555\n2013-10-25T13:30:00Z,175.50999,176,175.17,175.95,93625056,633.7517464\n2013-10-28T13:30:00Z,175.89,176.47,175.7,176.23,84979018,635.8199316\n2013-10-29T13:30:00Z,176.63,177.24,176.38,177.17,87401344,643.8343311\n2013-10-30T13:30:00Z,177.38,177.51,175.66,176.29,140001834,637.7011447\n2013-10-31T13:30:00Z,176.15,176.89,175.53,175.79,133795417,634.9297052\n2013-11-01T13:30:00Z,176.02,176.61,175.22,176.21,142805050,636.4014113\n2013-11-04T14:30:00Z,176.69,176.9,175.9825,176.83,85676773,639.6972338\n2013-11-05T14:30:00Z,176.14,176.75,175.57,176.27,85824778,636.8107796\n2013-11-06T14:30:00Z,177.03,177.5,176.54,177.17,87347728,643.6460069\n2013-11-07T14:30:00Z,177.5,177.64,174.76,174.93,157000422,625.6123448\n2013-11-08T14:30:00Z,174.87,177.31,174.85,177.29,136712623,639.6483037\n2013-11-11T14:30:00Z,177.12,177.53,176.91,177.32,62614326,641.0733037\n2013-11-12T14:30:00Z,176.94,177.36,176.37,176.96,83989617,639.3605633\n2013-11-13T14:30:00Z,176.09,178.4261,176.09,178.38,103844266,649.4196088\n2013-11-14T14:30:00Z,178.54,179.42,178.25,179.27,103435238,656.2366819\n2013-11-15T14:30:00Z,179.56,180.12,179.33,180.05,102818190,662.6355286\n2013-11-18T14:30:00Z,180.35,180.5,179.02,179.42,104796009,658.7288398\n2013-11-19T14:30:00Z,179.33,179.87,178.72,179.03,93891416,656.2842195\n2013-11-20T14:30:00Z,179.39,179.93,177.98,178.47,124908601,652.7356084\n2013-11-21T14:30:00Z,178.97,180.05,178.86,179.91,92841271,663.0080542\n2013-11-22T14:30:00Z,179.98,180.83,179.77,180.81,81295887,669.8902936\n2013-11-25T14:30:00Z,181.13,181.17,180.37,180.63,79485709,669.2829735\n2013-11-26T14:30:00Z,180.72,181.22,180.405,180.68,86993560,668.9103007\n2013-11-27T14:30:00Z,180.87,181.24,180.65,181.12,58800056,672.1478007\n2013-11-29T14:30:00Z,181.32,181.75,180.8,181,55870903,671.3019673\n2013-12-02T14:30:00Z,181.09,181.43,180.25,180.53,99725781,668.2141697\n2013-12-03T14:30:00Z,179.94,180.39,179.17,179.75,116563302,662.1809529\n2013-12-04T14:30:00Z,179.1,180.48,178.35,179.73,123032637,663.1754994\n2013-12-05T14:30:00Z,179.41,179.74,178.7701,178.94,106934067,658.5591629\n2013-12-06T14:30:00Z,180.67,181.11,180.15,180.94,127727518,674.8220715\n2013-12-09T14:30:00Z,181.47,181.67,181.16,181.4,70123608,678.0904806\n2013-12-10T14:30:00Z,180.98,181.36,180.635,180.75,80976207,673.1838208\n2013-12-11T14:30:00Z,180.81,180.85,178.5,178.72,130590810,654.8865077\n2013-12-12T14:30:00Z,178.64,178.86,177.76,178.13,115564840,649.8294969\n2013-12-13T14:30:00Z,178.5,178.66,177.77,178.11,107807610,648.7144785\n2013-12-16T14:30:00Z,178.95,179.81,178.9,179.216,96194790,657.3622057\n2013-12-17T14:30:00Z,179.36,179.41,178.25,178.65,89886224,653.155892\n2013-12-18T14:30:00Z,178.92,181.73,177.32,181.7,234906482,671.0421318\n2013-12-19T14:30:00Z,181.19,181.7,180.71,181.49,136298872,673.3739196\n2013-12-20T14:30:00Z,180.67,181.99,180.5683,181.56,197086908,675.6447613\n2013-12-23T14:30:00Z,182.41,182.64,182.065,182.53,85597541,683.696547\n2013-12-24T14:30:00Z,182.54,183.01,182.53,182.93,45368841,687.3730176\n2013-12-26T14:30:00Z,183.34,183.96,183.32,183.855,63365227,696.2094788\n2013-12-27T14:30:00Z,184.1,184.18,183.66,183.845,61813841,696.1820823\n2013-12-30T14:30:00Z,183.87,184.02,183.58,183.82,56857458,695.8080904\n2013-12-31T14:30:00Z,184.07,184.69,183.93,184.69,86247638,703.4797294\n2014-01-02T14:30:00Z,183.98,184.07,182.48,182.92,119636836,689.0623024\n2014-01-03T14:30:00Z,183.21,183.6,182.63,182.885,81390502,687.4707032\n2014-01-06T14:30:00Z,183.47,183.56,182.08,182.36,108028139,683.7284844\n2014-01-07T14:30:00Z,183.09,183.79,182.95,183.48,86144169,690.2931968\n2014-01-08T14:30:00Z,183.45,183.83,182.89,183.52,96582234,690.9062992\n2014-01-09T14:30:00Z,184.1,184.13,182.795,183.64,90683302,690.5963985\n2014-01-10T14:30:00Z,183.95,184.22,183.01,184.14,102026318,692.0228136\n2014-01-13T14:30:00Z,183.71,184.18,181.34,181.685,149891938,671.2955409\n2014-01-14T14:30:00Z,182.28,183.77,181.95,183.67,105016055,682.8163054\n2014-01-15T14:30:00Z,184.1,184.94,183.7102,184.66,98525721,690.8536825\n2014-01-16T14:30:00Z,184.28,184.6618,183.83,184.42,72290520,690.6935416\n2014-01-17T14:30:00Z,184.1,184.45,183.32,183.635,107848616,684.8955265\n2014-01-21T14:30:00Z,184.7,184.77,183.05,184.18,88621138,685.5474369\n2014-01-22T14:30:00Z,184.49,184.57,183.91,184.3,61270816,685.2234653\n2014-01-23T14:30:00Z,183.36,183.4,181.82,182.79,132496880,671.4767746\n2014-01-24T14:30:00Z,181.6,181.66,178.83,178.89,208677093,633.713347\n2014-01-27T14:30:00Z,179.06,179.52,177.12,178.01,180843004,626.2275124\n2014-01-28T14:30:00Z,178.14,179.3,178.12,179.07,110463152,633.0247786\n2014-01-29T14:30:00Z,177.56,178.55,176.88,177.35,216597269,622.9450821\n2014-01-30T14:30:00Z,178.86,179.81,178.26,179.23,118938051,637.9838124\n2014-01-31T14:30:00Z,177.02,179.29,176.92,178.18,194677861,635.7705509\n2014-02-03T14:30:00Z,177.95,178.37,173.83,174.17,254837004,604.192523\n2014-02-04T14:30:00Z,174.95,175.84,174.1055,175.385,165012351,606.0914897\n2014-02-05T14:30:00Z,174.79,175.56,173.71,175.17,164230470,606.5391006\n2014-02-06T14:30:00Z,175.58,177.48,175.2209,177.48,132877526,626.8949714\n2014-02-07T14:30:00Z,178.31,179.87,177.73,179.68,170787197,645.2124897\n2014-02-10T14:30:00Z,179.7,180.07,179.21,180.01,92218729,647.2339294\n2014-02-11T14:30:00Z,180.16,182.439,180.0389,181.98,117814009,665.2506413\n2014-02-12T14:30:00Z,182.22,182.83,181.705,182.07,94717638,666.8309419\n2014-02-13T14:30:00Z,180.84,183.2,180.83,183.01,100542155,673.228917\n2014-02-14T14:30:00Z,182.84,184.36,182.67,184.02,96498305,681.3262714\n2014-02-18T14:30:00Z,184.19,184.49,183.65,184.24,80460878,682.7238485\n2014-02-19T14:30:00Z,183.76,184.95,182.87,183.02,126524261,676.268726\n2014-02-20T14:30:00Z,183.27,184.52,182.6,184.1,104998099,682.1030491\n2014-02-21T14:30:00Z,184.49,184.89,183.8,183.89,118116359,680.9519171\n2014-02-24T14:30:00Z,184.28,186.15,184.2,184.91,114063868,688.3745889\n2014-02-25T14:30:00Z,185.03,185.59,184.23,184.84,117084901,688.353584\n2014-02-26T14:30:00Z,185.11,185.6,184.33,184.85,98677144,687.749694\n2014-02-27T14:30:00Z,184.59,185.87,184.37,185.82,93880780,693.9413873\n2014-02-28T14:30:00Z,185.79,187.15,185.05,186.29,150842000,697.4890898\n2014-03-03T14:30:00Z,184.69,185.45,183.75,184.98,167748455,690.1349696\n2014-03-04T14:30:00Z,186.75,187.98,186.75,187.58,167545852,716.5992553\n2014-03-05T14:30:00Z,187.72,188.07,187.45,187.75,88376859,718.051861\n2014-03-06T14:30:00Z,188.21,188.61,187.7796,188.18,82516500,720.7150925\n2014-03-07T14:30:00Z,188.87,188.96,187.43,188.26,114513432,719.9778974\n2014-03-10T13:30:00Z,187.94,188.23,187.08,188.16,74939176,719.1802219\n2014-03-11T13:30:00Z,188.44,188.71,186.8,187.23,99009013,712.7781862\n2014-03-12T13:30:00Z,186.32,187.35,185.9,187.28,104824323,713.8572697\n2014-03-13T13:30:00Z,187.84,187.99,184.66,185.18,155014237,699.2252669\n2014-03-14T13:30:00Z,184.8,185.8,184.44,184.66,153919598,696.3589089\n2014-03-17T13:30:00Z,185.59,186.77,185.51,186.33,98359454,711.731547\n2014-03-18T13:30:00Z,186.71,187.91,186.51,187.66,101804519,723.4636365\n2014-03-19T13:30:00Z,187.7,187.94,185.47,186.66,176267253,716.9800839\n2014-03-20T13:30:00Z,186.25,187.89,185.92,187.747,117240972,722.4113199\n2014-03-21T13:30:00Z,187.72,189.0239,186.03,186.2,163127905,716.2533924\n2014-03-24T13:30:00Z,186.82,187.07,184.62,185.43,121411145,709.8154507\n2014-03-25T13:30:00Z,186.37,186.94,185.27,186.31,103851737,712.1660548\n2014-03-26T13:30:00Z,187.03,187.34,184.92,184.97,119842897,703.6569429\n2014-03-27T13:30:00Z,184.77,185.34,183.9,184.58,142382757,700.2362268\n2014-03-28T13:30:00Z,185.105,186.42,185,185.49,101641547,707.4687156\n2014-03-31T13:30:00Z,186.65,187.3,185.5216,187.01,99744911,718.2175204\n2014-04-01T13:30:00Z,187.62,188.36,187.0015,188.25,89193125,727.7996312\n2014-04-02T13:30:00Z,188.5,189.13,188.14,188.88,78773818,732.4848164\n2014-04-03T13:30:00Z,189.17,189.22,188.05,188.63,77435320,730.7419804\n2014-04-04T13:30:00Z,189.64,189.7,186.1,186.4,169380705,713.8710802\n2014-04-07T13:30:00Z,185.9,186.26,183.96,184.34,140802699,696.3671494\n2014-04-08T13:30:00Z,184.21,185.4,183.59,185.1,112659755,698.8214107\n2014-04-09T13:30:00Z,185.6,187.15,185.06,187.09,100253612,715.2075594\n2014-04-10T13:30:00Z,187.09,187.17,182.93,183.155,172959331,684.0357437\n2014-04-11T13:30:00Z,182.17,183.42,181.31,181.51,167250792,673.0076755\n2014-04-14T13:30:00Z,182.93,183.37,181.44,182.9401,132381601,680.0556439\n2014-04-15T13:30:00Z,183.32,184.33,181.51,184.2,157092533,685.4467343\n2014-04-16T13:30:00Z,185.47,186.14,184.65,186.125,105196633,700.9397898\n2014-04-17T13:30:00Z,185.88,186.91,185.56,186.39,105254649,703.1559077\n2014-04-21T13:30:00Z,186.44,187.1,186.21,187.04,68329343,707.8550785\n2014-04-22T13:30:00Z,187.23,188.4,187.13,187.89,85790307,715.571802\n2014-04-23T13:30:00Z,187.81,187.92,187.3,187.45,73869384,713.4344612\n2014-04-24T13:30:00Z,188.37,188.39,186.93,187.83,88169916,713.5102677\n2014-04-25T13:30:00Z,187.21,187.33,185.87,186.29,100380205,699.3347934\n2014-04-28T13:30:00Z,187.05,187.69,184.96,186.875,135121094,700.1255451\n2014-04-29T13:30:00Z,187.48,188.04,187.08,187.75,84097551,706.4853262\n2014-04-30T13:30:00Z,187.44,188.5,187.18,188.31,101507717,710.0748532\n2014-05-01T13:30:00Z,188.22,188.84,187.73,188.325,93019095,710.8531018\n2014-05-02T13:30:00Z,188.31,189.14,187.78,188.06,98121662,709.5165092\n2014-05-05T13:30:00Z,187.14,188.55,186.62,188.42,75882739,713.751139\n2014-05-06T13:30:00Z,188,188.13,186.74,186.78,85454226,702.8266107\n2014-05-07T13:30:00Z,187.43,187.97,186.01,187.88,106500480,706.1759485\n2014-05-08T13:30:00Z,187.67,189.05,187.08,187.675,93617513,705.8599221\n2014-05-09T13:30:00Z,187.69,188.04,186.83,187.96,83678568,707.6966416\n2014-05-12T13:30:00Z,188.76,189.88,187.9992,189.785,86940045,722.362021\n2014-05-13T13:30:00Z,190.03,190.42,189.77,189.96,66453965,724.0973227\n2014-05-14T13:30:00Z,189.79,189.88,188.79,189.06,72366848,715.9245286\n2014-05-15T13:30:00Z,188.67,188.72,186.48,187.4,154956399,700.514813\n2014-05-16T13:30:00Z,187.51,188.13,186.72,188.05,97457678,702.1060757\n2014-05-19T13:30:00Z,187.69,188.89,187.52,188.74,63839398,706.815378\n2014-05-20T13:30:00Z,188.645,188.67,187.07,187.55,111644478,698.7019063\n2014-05-21T13:30:00Z,188.1,189.22,188.06,189.13,89093285,709.9583368\n2014-05-22T13:30:00Z,189.18,189.98,188.86,189.59,61549345,713.5160727\n2014-05-23T13:30:00Z,189.75,190.48,189.5858,190.35,60156088,720.0038887\n2014-05-27T13:30:00Z,191.05,191.58,190.95,191.52,72010355,731.0724651\n2014-05-28T13:30:00Z,191.52,191.82,191.06,191.38,66722865,730.7694025\n2014-05-29T13:30:00Z,191.82,192.4,191.33,192.37,64376573,737.8655563\n2014-05-30T13:30:00Z,192.19,192.8,192.03,192.68,76315640,739.9163483\n2014-06-02T13:30:00Z,192.95,192.99,191.97,192.895,64655648,741.1203965\n2014-06-03T13:30:00Z,192.4,192.9,192.25,192.8,65047193,741.6745984\n2014-06-04T13:30:00Z,192.47,193.3,192.265,193.19,55529372,744.1787284\n2014-06-05T13:30:00Z,193.41,194.65,192.7,194.45,92102592,752.575442\n2014-06-06T13:30:00Z,194.87,195.43,194.78,195.375,78696219,760.765849\n2014-06-09T13:30:00Z,195.35,196.05,195.17,195.58,65118828,762.6367729\n2014-06-10T13:30:00Z,195.33,195.64,194.92,195.6,57129440,763.7641845\n2014-06-11T13:30:00Z,194.9,195.12,194.48,194.92,68772479,759.3129971\n2014-06-12T13:30:00Z,194.65,194.8,193.11,193.54,106350200,746.8724701\n2014-06-13T13:30:00Z,193.9,194.32,193.3,194.13,82017278,748.4786839\n2014-06-16T13:30:00Z,193.89,194.7,193.66,194.29,87424332,749.8338946\n2014-06-17T13:30:00Z,194.02,194.97,193.81,194.83,84833876,753.3586962\n2014-06-18T13:30:00Z,194.83,196.37,194.4,196.255,105266767,763.7257848\n2014-06-19T13:30:00Z,196.43,196.6,195.8,196.48,85928920,765.2168321\n2014-06-20T13:30:00Z,196.03,196.1039,195.7,195.94,100587108,760.5995147\n2014-06-23T13:30:00Z,195.97,196.05,195.52,195.88,70611486,759.9937455\n2014-06-24T13:30:00Z,195.53,196.5,194.48,194.7,96236917,753.0644309\n2014-06-25T13:30:00Z,194.25,195.781,194.25,195.58,82781912,758.2622937\n2014-06-26T13:30:00Z,195.61,195.63,194.13,195.44,84311822,758.7939274\n2014-06-27T13:30:00Z,194.98,195.88,194.885,195.82,71453616,761.3265328\n2014-06-30T13:30:00Z,195.7,196.165,195.53,195.72,70504228,761.6327458\n2014-07-01T13:30:00Z,196.19,197.63,196.13,197.03,90470121,773.7447707\n2014-07-02T13:30:00Z,197.05,197.48,196.96,197.23,52474832,775.6711405\n2014-07-03T13:30:00Z,197.79,198.29,197.64,198.2,52938832,784.6516961\n2014-07-07T13:30:00Z,197.82,197.98,197.22,197.51,61696447,779.9752822\n2014-07-08T13:30:00Z,197.15,197.22,195.76,196.24,108142552,768.2576931\n2014-07-09T13:30:00Z,196.73,197.295,196.31,197.12,72992322,772.7372146\n2014-07-10T13:30:00Z,195.22,196.86,195.06,196.34,99040407,771.959317\n2014-07-11T13:30:00Z,196.22,196.75,195.78,196.61,64243410,774.045317\n2014-07-14T13:30:00Z,197.61,197.86,197.44,197.6,58657919,783.1145194\n2014-07-15T13:30:00Z,197.72,198.1,196.36,197.23,111346230,780.3681062\n2014-07-16T13:30:00Z,198.11,198.26,197.42,197.96,80073242,783.6096842\n2014-07-17T13:30:00Z,197.35,198.1,195.43,195.71,145398459,765.4610808\n2014-07-18T13:30:00Z,196.35,197.91,196.24,197.7099,124330419,778.7704358\n2014-07-21T13:30:00Z,197.09,197.5,196.43,197.34,67591618,779.2724676\n2014-07-22T13:30:00Z,198.01,198.56,197.87,198.2,67677602,786.8974676\n2014-07-23T13:30:00Z,198.495,198.85,198.1,198.64,65611830,789.7501322\n2014-07-24T13:30:00Z,198.83,199.06,198.45,198.65,56888093,789.5724243\n2014-07-25T13:30:00Z,198.09,198.26,197.33,197.72,76837257,781.3929371\n2014-07-28T13:30:00Z,197.76,198.09,196.62,197.8,69258785,781.4259371\n2014-07-29T13:30:00Z,198.17,198.45,196.92,196.95,80466351,776.2473656\n2014-07-30T13:30:00Z,197.65,197.91,196.16,196.98,104222452,774.4663437\n2014-07-31T13:30:00Z,195.61,195.78,192.97,193.09,183479441,737.2141163\n2014-08-01T13:30:00Z,192.56,193.76,191.57,192.5,189260864,733.0031234\n2014-08-04T13:30:00Z,192.87,194.3,192.05,193.89,91340487,742.3657062\n2014-08-05T13:30:00Z,193.1,193.6,191.31,192.01,152690379,729.3578065\n2014-08-06T13:30:00Z,191.11,192.89,191.08,192.07,94818317,730.1044302\n2014-08-07T13:30:00Z,192.935,193.13,190.55,191.03,135733421,724.2006181\n2014-08-08T13:30:00Z,191.46,193.37,190.95,193.24,117014384,737.4495931\n2014-08-11T13:30:00Z,193.965,194.66,193.71,193.795,74543691,742.4315716\n2014-08-12T13:30:00Z,193.61,194.15,192.94,193.53,73631640,740.9489743\n2014-08-13T13:30:00Z,194.29,195.06,193.96,194.84,69046544,752.1589462\n2014-08-14T13:30:00Z,195.16,195.76,194.98,195.76,57370793,760.0633766\n2014-08-15T13:30:00Z,196.47,196.65,194.31,195.72,139950669,759.0988937\n2014-08-18T13:30:00Z,196.8,197.45,196.69,197.36,75424360,772.1757916\n2014-08-19T13:30:00Z,197.84,198.54,197.4426,198.39,59134709,780.5099395\n2014-08-20T13:30:00Z,198.12,199.16,198.08,198.92,72762541,784.7295237\n2014-08-21T13:30:00Z,199.09,199.76,198.93,199.5,67790690,789.7259005\n2014-08-22T13:30:00Z,199.34,199.69,198.74,199.19,76107359,788.4509599\n2014-08-25T13:30:00Z,200.14,200.5949,199.1502,200.2,63855022,794.3898188\n2014-08-26T13:30:00Z,200.33,200.82,200.28,200.33,47298324,795.3341465\n2014-08-27T13:30:00Z,200.43,200.57,199.94,200.25,47873708,794.6764084\n2014-08-28T13:30:00Z,199.59,200.27,199.39,200.14,58330373,795.3737057\n2014-08-29T13:30:00Z,200.45,200.73,199.82,200.71,65906598,798.3219455\n2014-09-02T13:30:00Z,200.97,200.995,199.86,200.61,72425793,797.3701226\n2014-09-03T13:30:00Z,201.38,201.41,200.22,200.5,57461742,794.8701226\n2014-09-04T13:30:00Z,200.84,201.58,199.66,200.2101,85236442,792.2683761\n2014-09-05T13:30:00Z,200.17,201.19,199.41,201.11,102176784,796.1008619\n2014-09-08T13:30:00Z,200.92,201.21,200,200.59,64145745,793.9403948\n2014-09-09T13:30:00Z,200.41,200.55,198.91,199.32,88590876,782.5063919\n2014-09-10T13:30:00Z,199.43,200.2,198.77,200.07,67251103,785.0827502\n2014-09-11T13:30:00Z,199.27,200.33,199.12,200.3,66823558,789.0049674\n2014-09-12T13:30:00Z,200.1,200.12,198.56,199.13,117478516,781.0375689\n2014-09-15T13:30:00Z,199.16,199.32,198.38,198.981,76401421,779.1308565\n2014-09-16T13:30:00Z,198.61,200.84,198.5,200.48,116200722,790.7715309\n2014-09-17T13:30:00Z,200.77,201.68,199.75,200.75,151265896,793.0473391\n2014-09-18T13:30:00Z,201.36,201.85,201.1,201.82,94990300,802.6205917\n2014-09-19T13:30:00Z,201.52,201.899,200.29,200.7,121649147,794.7720201\n2014-09-22T13:30:00Z,200.35,200.38,198.73,199.15,125552758,780.3819767\n2014-09-23T13:30:00Z,198.43,199.26,197.95,198.01,111393319,772.6956413\n2014-09-24T13:30:00Z,198.04,199.69,197.52,199.56,107275635,782.8725644\n2014-09-25T13:30:00Z,199.04,199.05,196.27,196.34,150300028,757.6436112\n2014-09-26T13:30:00Z,196.7,198.39,196.42,197.9,103546740,764.7298542\n2014-09-29T13:30:00Z,196.2,197.89,196.05,197.54,95111605,768.0180244\n2014-09-30T13:30:00Z,197.69,198.3,196.61,197.02,131302082,766.5254318\n2014-10-01T13:30:00Z,196.7,196.77,193.91,194.35,177797862,741.7853941\n2014-10-02T13:30:00Z,194.18,195.055,192.35,194.38,157285182,740.0484921\n2014-10-03T13:30:00Z,195.68,196.94,195.08,196.52,121568769,758.5263682\n2014-10-06T13:30:00Z,197.34,197.6,195.582,196.29,104778335,756.8752237\n2014-10-07T13:30:00Z,195.28,195.72,193.22,193.26,147913498,729.7860625\n2014-10-08T13:30:00Z,193.37,196.92,192.36,196.64,186461453,750.1545225\n2014-10-09T13:30:00Z,196.33,196.6,192.58,192.74,210704601,724.6750449\n2014-10-10T13:30:00Z,192.69,193.65,190.49,190.54,221908954,710.2139774\n2014-10-13T13:30:00Z,190.46,191.15,187.3,187.4099,230938833,686.2479005\n2014-10-14T13:30:00Z,188.42,189.82,187.04,187.7,215846527,682.7083568\n2014-10-15T13:30:00Z,185.16,187.694,181.92,186.43,380714600,677.7659571\n2014-10-16T13:30:00Z,183.06,187.58,182.89,186.27,270391490,685.5533386\n2014-10-17T13:30:00Z,188.42,189.75,187.62,188.47,214624921,703.8064571\n2014-10-20T13:30:00Z,188.13,190.45,188.07,190.3,130010813,718.9486984\n2014-10-21T13:30:00Z,191.68,194.2,191.48,194.07,154948579,753.7949833\n2014-10-22T13:30:00Z,194.41,194.91,192.61,192.69,151822409,748.6223129\n2014-10-23T13:30:00Z,194.62,196.2,194.26,194.93,154944169,762.2854468\n2014-10-24T13:30:00Z,195.25,196.49,194.49,196.43,117927286,772.4578295\n2014-10-27T13:30:00Z,195.73,196.45,195.03,196.16,82953689,773.6823193\n2014-10-28T13:30:00Z,196.82,198.42,196.73,198.41,106735936,795.0648223\n2014-10-29T13:30:00Z,198.55,199.12,196.8,198.11,142557417,794.611223\n2014-10-30T13:30:00Z,197.58,199.95,197.4,199.38,113329976,803.517238\n2014-10-31T13:30:00Z,201.78,201.82,200.77,201.66,146902554,822.0673519\n2014-11-03T14:30:00Z,201.92,202.45,201.305,201.77,93734143,822.0883625\n2014-11-04T14:30:00Z,201.23,201.6,200.06,201.07,93342777,816.8330054\n2014-11-05T14:30:00Z,202.54,202.59,201.45,202.34,91708574,824.6687718\n2014-11-06T14:30:00Z,202.39,203.26,201.64,203.15,107089076,828.5939215\n2014-11-07T14:30:00Z,203.17,203.5999,202.61,203.34,89539712,829.924013\n2014-11-10T14:30:00Z,203.38,204.04,203.13,203.98,66318964,834.4368083\n2014-11-11T14:30:00Z,204.055,204.31,203.65,204.175,54499375,835.4680583\n2014-11-12T14:30:00Z,203.35,204.24,203.31,203.96,90120295,836.1438396\n2014-11-13T14:30:00Z,204.16,204.83,203.21,204.19,85357918,837.3632507\n2014-11-14T14:30:00Z,204.1,204.49,203.72,204.24,80417514,837.8449629\n2014-11-17T14:30:00Z,203.85,204.58,203.65,204.37,80440954,839.4689914\n2014-11-18T14:30:00Z,204.44,205.92,204.44,205.55,76068107,850.4520841\n2014-11-19T14:30:00Z,205.31,205.55,204.3,205.22,82373009,849.9534139\n2014-11-20T14:30:00Z,204.26,205.71,204.18,205.58,72840326,854.1297424\n2014-11-21T14:30:00Z,207.64,207.8445,205.98,206.68,142327285,859.7448891\n2014-11-24T14:30:00Z,207.17,207.39,206.91,207.26,65880759,861.790922\n2014-11-25T14:30:00Z,207.54,207.79,206.8,207.11,79108301,860.6703973\n2014-11-26T14:30:00Z,207.29,207.76,207.03,207.64,62167832,863.5687182\n2014-11-28T14:30:00Z,207.49,207.87,206.91,207.2,57890088,861.401803\n2014-12-01T14:30:00Z,206.4,206.54,205.38,205.76,103968354,848.061203\n2014-12-02T14:30:00Z,205.81,207.34,205.782,207.085,74507192,858.3559904\n2014-12-03T14:30:00Z,207.3,208.15,207.1,207.89,68951968,865.2177922\n2014-12-04T14:30:00Z,207.54,208.265,206.7,207.66,91316591,865.1200732\n2014-12-05T14:30:00Z,207.87,208.47,207.55,208,91025470,867.4381653\n2014-12-08T14:30:00Z,207.52,208.12,205.93,206.61,108588152,856.8873357\n2014-12-09T14:30:00Z,204.37,206.6,203.91,206.47,125180054,860.828204\n2014-12-10T14:30:00Z,205.91,205.98,202.93,203.1601,159856394,836.7348319\n2014-12-11T14:30:00Z,203.88,206.19,203.71,204.19,159012805,839.4711806\n2014-12-12T14:30:00Z,202.64,203.819,200.85,200.89,202330191,813.0060468\n2014-12-15T14:30:00Z,201.98,202.53,198.78,199.51,189965750,803.3929498\n2014-12-16T14:30:00Z,198.58,202.395,197.86,197.91,259543848,794.4604382\n2014-12-17T14:30:00Z,198.44,202.34,198.29,201.79,253910092,828.304206\n2014-12-18T14:30:00Z,204.74,212.97,203.92,206.78,257633887,871.9900368\n2014-12-19T14:30:00Z,206.43,207.33,205.6109,206.52,245084590,872.9570316\n2014-12-22T14:30:00Z,206.75,207.47,206.46,207.47,148318934,880.6197132\n2014-12-23T14:30:00Z,208.17,208.23,207.3991,207.75,122167931,881.7944091\n2014-12-24T14:30:00Z,208.02,208.34,207.72,207.77,42963399,880.7263056\n2014-12-26T14:30:00Z,208.31,208.85,208.25,208.44,57326703,885.756084\n2014-12-29T14:30:00Z,208.22,208.97,208.14,208.72,79643948,887.9164101\n2014-12-30T14:30:00Z,208.21,208.37,207.51,207.6,73540761,879.4411946\n2014-12-31T14:30:00Z,207.99,208.19,205.39,205.54,130333829,863.3597488\n2015-01-02T14:30:00Z,206.38,206.88,204.18,205.43,121465865,860.2869186\n2015-01-05T14:30:00Z,204.17,204.37,201.35,201.72,169632646,825.4621661\n2015-01-06T14:30:00Z,202.09,202.72,198.855,199.82,209151408,810.875221\n2015-01-07T14:30:00Z,201.42,202.72,200.88,202.31,125346709,825.4831997\n2015-01-08T14:30:00Z,204.01,206.16,203.99,205.9,147217784,860.8976912\n2015-01-09T14:30:00Z,206.4,206.42,203.51,204.25,158567288,850.9503981\n2015-01-12T14:30:00Z,204.41,204.6,201.92,202.65,144396067,837.293104\n2015-01-13T14:30:00Z,204.12,205.48,200.51,202.08,214553306,830.6562048\n2015-01-14T14:30:00Z,199.65,201.1,198.57,200.86,192991092,823.6647919\n2015-01-15T14:30:00Z,201.63,202.01,198.88,199.0199,176613906,813.416345\n2015-01-16T14:30:00Z,198.77,201.82,198.55,201.63,211879605,828.5302525\n2015-01-20T14:30:00Z,202.4,202.72,200.17,202.055,130991069,831.234215\n2015-01-21T14:30:00Z,201.5,203.66,200.94,203.08,122942707,837.4138224\n2015-01-22T14:30:00Z,203.99,206.26,202.33,206.1,174356029,857.9551519\n2015-01-23T14:30:00Z,205.79,206.1,204.81,204.97,117516753,853.4636629\n2015-01-26T14:30:00Z,204.71,205.56,203.85,205.45,92009711,855.8213652\n2015-01-27T14:30:00Z,202.97,204.12,201.74,202.74,134044598,836.8693529\n2015-01-28T14:30:00Z,204.17,204.29,199.91,200.14,168514312,818.2451627\n2015-01-29T14:30:00Z,200.38,202.3,198.68,201.9902,173585424,823.0523588\n2015-01-30T14:30:00Z,200.57,202.17,199.13,199.45,197729724,809.0441772\n2015-02-02T14:30:00Z,200.05,202.03,197.86,201.92,163106969,820.3679131\n2015-02-03T14:30:00Z,203,204.85,202.55,204.84,124212881,845.9578868\n2015-02-04T14:30:00Z,203.92,205.38,203.51,204.06,134306728,845.0659876\n2015-02-05T14:30:00Z,204.86,206.3,204.77,206.12,97953181,864.9357793\n2015-02-06T14:30:00Z,206.56,207.24,204.92,205.55,125672026,862.7725914\n2015-02-09T14:30:00Z,204.77,205.64,204.135,204.63,87219016,856.5203244\n2015-02-10T14:30:00Z,205.88,207.12,204.6801,206.81,96164183,872.7678993\n2015-02-11T14:30:00Z,206.61,207.45,205.83,206.93,91087785,874.4624\n2015-02-12T14:30:00Z,207.89,208.99,206.9727,208.92,97545949,890.171401\n2015-02-13T14:30:00Z,209.07,209.84,208.76,209.78,93670430,896.5017748\n2015-02-17T14:30:00Z,209.4,210.32,209.1,210.11,76968199,899.1247623\n2015-02-18T14:30:00Z,209.66,210.22,209.3401,210.13,80652941,901.0929257\n2015-02-19T14:30:00Z,209.41,210.42,209.24,209.98,91462491,902.175416\n2015-02-20T14:30:00Z,209.48,211.33,208.73,211.239,140896392,909.1930778\n2015-02-23T14:30:00Z,210.94,211.21,210.48,211.209,74411054,911.37318\n2015-02-24T14:30:00Z,211.12,212.05,210.76,211.81,72472263,915.2972141\n2015-02-25T14:30:00Z,211.66,212.24,211.22,211.63,73061687,915.2276386\n2015-02-26T14:30:00Z,211.52,211.71,210.65,211.38,72697868,913.3485403\n2015-02-27T14:30:00Z,211.26,211.58,210.6,210.66,108075972,908.281422\n2015-03-02T14:30:00Z,210.78,212.06,210.72,211.99,87491428,918.5569154\n2015-03-03T14:30:00Z,211.47,212.054,210.08,211.12,110325809,914.6633974\n2015-03-04T14:30:00Z,210.4,210.49,209.06,210.2301,114497192,907.1994104\n2015-03-05T14:30:00Z,210.62,210.8,209.85,210.46,76872957,907.584946\n2015-03-06T14:30:00Z,209.42,209.94,207.1,207.5,188127982,881.1008695\n2015-03-09T13:30:00Z,207.74,208.79,207.5459,208.36,89818893,884.2851659\n2015-03-10T13:30:00Z,206.71,206.81,204.93,204.98,157121263,853.0825414\n2015-03-11T13:30:00Z,205.29,205.5,204.4,204.5,110145718,849.98976\n2015-03-12T13:30:00Z,205.26,207.175,205.2,207.1,93993523,872.0107895\n2015-03-13T13:30:00Z,206.77,207.9338,204.58,205.8272,162410893,866.7073782\n2015-03-16T13:30:00Z,206.71,208.69,205.8641,208.58,136099192,886.7611757\n2015-03-17T13:30:00Z,207.69,208.42,206.98,207.96,94510422,886.6731254\n2015-03-18T13:30:00Z,207.39,211.27,206.62,210.46,228808524,904.6636858\n2015-03-19T13:30:00Z,209.96,210.4697,209.03,209.5,117917302,902.9528786\n2015-03-20T13:30:00Z,209.71,211.02,209.4903,210.41,177715081,909.5665467\n2015-03-23T13:30:00Z,210.42,211.11,210,210,71784536,908.0514689\n2015-03-24T13:30:00Z,209.85,210.4,208.74,208.82,77805321,900.0203074\n2015-03-25T13:30:00Z,209.07,209.35,205.71,205.76,159521708,875.2215983\n2015-03-26T13:30:00Z,204.96,206.37,204.12,205.27,153067241,871.3497462\n2015-03-27T13:30:00Z,205.13,205.95,204.9,205.74,118938966,874.5631608\n2015-03-30T13:30:00Z,206.98,208.61,206.96,208.25,96180365,899.0808422\n2015-03-31T13:30:00Z,207.26,208.1,206.36,206.43,126768703,888.4592859\n2015-04-01T13:30:00Z,206.39,206.42,204.51,205.7,137303584,881.2084025\n2015-04-02T13:30:00Z,205.62,206.98,205.4,206.435,86900906,885.6363626\n2015-04-06T13:30:00Z,205.37,208.45,205.21,207.83,114368155,895.9810654\n2015-04-07T13:30:00Z,207.855,208.76,207.24,207.28,81236337,895.375313\n2015-04-08T13:30:00Z,207.55,208.51,207.08,207.975,89351939,899.1061014\n2015-04-09T13:30:00Z,207.78,209.18,207.19,208.9,85548854,904.8230252\n2015-04-10T13:30:00Z,209.2,210.09,208.96,210.04,72722915,914.3264974\n2015-04-13T13:30:00Z,209.87,210.63,209.03,209.09,74436594,910.3855444\n2015-04-14T13:30:00Z,208.85,209.71,208.1,209.49,75099866,912.1852327\n2015-04-15T13:30:00Z,210.05,211.04,209.95,210.43,99529320,920.6290672\n2015-04-16T13:30:00Z,210.03,210.98,209.7928,210.37,68934864,921.2657951\n2015-04-17T13:30:00Z,208.94,209.23,207.01,207.95,191113230,900.5944907\n2015-04-20T13:30:00Z,209.06,210.25,208.96,209.85,92189481,915.0046804\n2015-04-21T13:30:00Z,210.67,210.86,209.24,209.6,72559831,912.9641887\n2015-04-22T13:30:00Z,210.01,210.85,208.9,210.63,78264616,916.7427259\n2015-04-23T13:30:00Z,210.15,211.94,210.01,211.16,102585942,921.4156875\n2015-04-24T13:30:00Z,211.66,211.97,211.11,211.6499,61327387,924.7710443\n2015-04-27T13:30:00Z,212.33,212.48,210.54,210.77,79358126,918.8344234\n2015-04-28T13:30:00Z,210.74,211.5,209.3301,211.44,86863531,921.0491999\n2015-04-29T13:30:00Z,210.37,211.29,209.6,210.57,125684903,917.522138\n2015-04-30T13:30:00Z,209.88,210.35,207.62,208.46,161304890,899.850209\n2015-05-01T13:30:00Z,209.4,210.77,209.28,210.72,103399711,916.2724651\n2015-05-04T13:30:00Z,211.23,212.02,211.1,211.32,70927235,921.7737671\n2015-05-05T13:30:00Z,211.03,211.46,208.73,208.9,113326156,901.4107449\n2015-05-06T13:30:00Z,209.56,209.93,206.76,208.04,135060151,893.6350021\n2015-05-07T13:30:00Z,207.92,209.38,207.52,208.87,88244940,897.0934285\n2015-05-08T13:30:00Z,210.88,211.86,210.78,211.62,155877260,924.7032332\n2015-05-11T13:30:00Z,211.57,211.89,210.52,210.605,75708065,918.9003795\n2015-05-12T13:30:00Z,209.61,210.63,208.62,209.98,119727592,915.1461284\n2015-05-13T13:30:00Z,210.47,211.22,209.74,210.02,94667943,914.6902461\n2015-05-14T13:30:00Z,211.24,212.32,210.91,212.21,95934006,933.4124506\n2015-05-15T13:30:00Z,212.44,212.61,211.86,212.44,76510099,934.6026269\n2015-05-18T13:30:00Z,212.24,213.4,212.16,213.1,74549685,939.8768205\n2015-05-19T13:30:00Z,213.24,213.57,212.69,213.03,72114610,939.9841264\n2015-05-20T13:30:00Z,213.15,213.78,212.504,212.88,76857530,938.7932862\n2015-05-21T13:30:00Z,212.71,213.75,212.51,213.5,64764585,942.7336543\n2015-05-22T13:30:00Z,213.04,213.54,212.91,212.99,57433495,941.229689\n2015-05-26T13:30:00Z,212.4,212.9089,210.2,210.7,124308584,921.3264617\n2015-05-27T13:30:00Z,211.25,212.98,210.7612,212.7,93213981,933.5815469\n2015-05-28T13:30:00Z,212.33,212.59,211.63,212.46,74974560,934.4918237\n2015-05-29T13:30:00Z,212.38,212.43,210.82,211.14,124919611,922.6958207\n2015-06-01T13:30:00Z,211.94,212.34,210.62,211.57,93338750,922.4556729\n2015-06-02T13:30:00Z,211.02,212.19,210.27,211.36,91531012,921.920735\n2015-06-03T13:30:00Z,212,212.67,211.3301,211.92,87820909,925.3970755\n2015-06-04T13:30:00Z,211.07,211.859,209.75,210.1292,151882820,911.0702521\n2015-06-05T13:30:00Z,209.95,210.58,208.98,209.77,121704676,908.3916868\n2015-06-08T13:30:00Z,209.64,209.82,208.39,208.48,89063330,897.1938055\n2015-06-09T13:30:00Z,208.45,209.1,207.69,208.45,105034690,896.2643937\n2015-06-10T13:30:00Z,209.37,211.41,209.2987,210.95,134551285,920.2681008\n2015-06-11T13:30:00Z,211.48,212.09,211.2,211.63,73876447,926.0792711\n2015-06-12T13:30:00Z,210.64,211.482,209.68,210.01,135382369,913.9936786\n2015-06-15T13:30:00Z,208.64,209.45,207.79,209.11,124384184,908.5528264\n2015-06-16T13:30:00Z,208.93,210.35,208.72,210.25,85308227,917.0567605\n2015-06-17T13:30:00Z,210.59,211.32,209.36,210.59,126708635,919.0133654\n2015-06-18T13:30:00Z,211.31,213.34,210.6315,212.78,165867949,937.4336044\n2015-06-19T13:30:00Z,211.46,211.55,210.36,210.81,130478689,924.0143006\n2015-06-22T13:30:00Z,211.905,212.59,211.64,211.89,70696027,930.6419602\n2015-06-23T13:30:00Z,212.14,212.44,211.57,212.04,68476797,931.0206262\n2015-06-24T13:30:00Z,211.72,212.17,210.47,210.5,92307318,918.6483435\n2015-06-25T13:30:00Z,211.1,211.25,209.77,209.86,97107361,914.5385746\n2015-06-26T13:30:00Z,210.29,210.58,209.16,209.82,104174840,913.0168983\n2015-06-29T13:30:00Z,208.045,209.828,205.33,205.42,202621332,877.5701699\n2015-06-30T13:30:00Z,207.26,207.32,205.28,205.85,182925106,873.468698\n2015-07-01T13:30:00Z,207.73,208.03,206.56,207.5,135979873,880.8678082\n2015-07-02T13:30:00Z,208.07,208.27,206.81,207.31,104373652,878.8777958\n2015-07-06T13:30:00Z,205.77,207.65,205.53,206.72,117975369,877.4089106\n2015-07-07T13:30:00Z,206.96,208.17,204.11,208.02,173820249,885.2567509\n2015-07-08T13:30:00Z,206.42,206.7645,204.25,204.53,164020059,856.4195288\n2015-07-09T13:30:00Z,207.04,207.35,204.77,204.9,144113107,849.9056399\n2015-07-10T13:30:00Z,207.29,207.98,206.49,207.48,129456890,864.5137959\n2015-07-13T13:30:00Z,208.99,209.9,208.94,209.77,106069400,888.2567815\n2015-07-14T13:30:00Z,209.72,211.05,209.65,210.68,81709575,896.2066248\n2015-07-15T13:30:00Z,210.73,211.28,210.04,210.61,97914141,896.5039221\n2015-07-16T13:30:00Z,211.87,212.3,211.58,212.3,106683266,912.5401063\n2015-07-17T13:30:00Z,212.29,212.55,211.8,212.48,89029973,913.9340567\n2015-07-20T13:30:00Z,212.75,213.18,212.21,212.59,70446821,914.2672877\n2015-07-21T13:30:00Z,212.43,212.74,211.39,211.75,77965048,907.6845539\n2015-07-22T13:30:00Z,210.93,211.77,210.89,211.37,88667920,905.9952682\n2015-07-23T13:30:00Z,211.53,211.65,209.75,210.18,90509128,897.1547831\n2015-07-24T13:30:00Z,210.3,210.37,207.6,208,117754979,878.1239102\n2015-07-27T13:30:00Z,206.94,207.55,206.26,206.79,132361082,868.4456805\n2015-07-28T13:30:00Z,207.79,209.5,206.8,209.33,123544845,888.6564257\n2015-07-29T13:30:00Z,209.48,211.04,209.31,210.77,105791255,901.1378087\n2015-07-30T13:30:00Z,210.16,211.02,209.42,210.82,91304374,904.2209524\n2015-07-31T13:30:00Z,211.42,211.45,210.16,210.5,103266857,902.4773957\n2015-08-03T13:30:00Z,210.46,210.53,208.65,209.79,113965728,895.490577\n2015-08-04T13:30:00Z,209.7,210.2483,208.8,209.38,81820823,892.6664148\n2015-08-05T13:30:00Z,210.45,211.31,209.73,210.07,85786817,895.427314\n2015-08-06T13:30:00Z,210.29,210.415,207.65,208.35,116030803,880.6989486\n2015-08-07T13:30:00Z,208.16,208.34,206.87,207.95,117857956,876.0267547\n2015-08-10T13:30:00Z,209.28,210.67,209.28,210.57,80270676,901.9401592\n2015-08-11T13:30:00Z,208.97,209.47,207.76,208.67,126081377,890.1921559\n2015-08-12T13:30:00Z,207.11,209.14,205.36,208.92,172123672,895.9878757\n2015-08-13T13:30:00Z,208.73,209.55,208.01,208.66,89383253,896.4374522\n2015-08-14T13:30:00Z,208.43,209.5087,208.26,209.42,72786528,901.621597\n2015-08-17T13:30:00Z,208.71,210.59,208.16,210.59,79072643,908.5554205\n2015-08-18T13:30:00Z,210.26,210.68,209.699,209.98,71692678,907.4808168\n2015-08-19T13:30:00Z,209.09,210.01,207.35,208.32,172945975,894.7462701\n2015-08-20T13:30:00Z,206.51,207.17,203.9,203.97,194327884,854.9765332\n2015-08-21T13:30:00Z,201.73,203.9404,197.52,197.63,346588470,803.5182559\n2015-08-24T13:30:00Z,187.49,195.84,182.4,189.55,507244330,753.4766503\n2015-08-25T13:30:00Z,195.43,195.45,186.92,187.27,369833070,729.647532\n2015-08-26T13:30:00Z,192.08,194.79,188.37,194.46,339256990,762.719674\n2015-08-27T13:30:00Z,197.02,199.42,195.21,199.27,274143910,801.7988246\n2015-08-28T13:30:00Z,198.5,199.835,197.92,199.28,160414352,805.0767635\n2015-08-31T13:30:00Z,198.11,199.125,197.01,197.67,163298816,795.3609259\n2015-09-01T13:30:00Z,193.12,194.77,190.73,191.77,256000392,743.5820196\n2015-09-02T13:30:00Z,194.62,195.46,192.42,195.41,160269331,766.6133751\n2015-09-03T13:30:00Z,196.26,198.05,194.96,195.55,152087836,766.5255424\n2015-09-04T13:30:00Z,192.85,193.86,191.61,192.59,207080961,741.9381665\n2015-09-08T13:30:00Z,195.94,197.61,195.17,197.43,116025739,787.5745302\n2015-09-09T13:30:00Z,199.32,199.47,194.35,194.79,149347735,771.6891183\n2015-09-10T13:30:00Z,194.56,197.22,194.25,195.85,158611063,773.8085195\n2015-09-11T13:30:00Z,195.375,196.82,194.53,196.74,119691212,779.7927301\n2015-09-14T13:30:00Z,196.95,197.01,195.43,196.01,79451983,776.1331253\n2015-09-15T13:30:00Z,196.61,198.99,195.9612,198.46,113806176,794.0516559\n2015-09-16T13:30:00Z,198.82,200.41,198.41,200.18,99581557,808.2188513\n2015-09-17T13:30:00Z,200.02,202.89,199.28,199.73,276046620,807.1254177\n2015-09-18T13:30:00Z,195.71,197.56,194.96,195.45,223657456,771.5606722\n2015-09-21T13:30:00Z,196.44,197.68,195.21,196.46,105726209,776.8112886\n2015-09-22T13:30:00Z,193.88,194.46,192.56,193.91,153890876,755.5828032\n2015-09-23T13:30:00Z,194.11,194.67,192.91,193.6,92790620,753.6114454\n2015-09-24T13:30:00Z,192.15,193.45,190.56,192.9,159378840,750.8313322\n2015-09-25T13:30:00Z,194.64,195,191.81,192.85,155054777,747.8876794\n2015-09-28T13:30:00Z,191.78,191.91,187.64,188.01,178515871,702.8651191\n2015-09-29T13:30:00Z,188.27,189.74,186.93,188.12,159045572,700.2502374\n2015-09-30T13:30:00Z,190.37,191.825,189.44,191.63,163452044,731.0688961\n2015-10-01T13:30:00Z,192.08,192.49,189.82,192.13,131078964,734.2523132\n2015-10-02T13:30:00Z,189.77,195.03,189.12,195,211003342,751.7148238\n2015-10-05T13:30:00Z,196.46,198.74,196.33,198.47,126320842,782.5570229\n2015-10-06T13:30:00Z,198.31,198.98,197,197.79,110274530,780.9378763\n2015-10-07T13:30:00Z,198.9,199.825,197.48,199.41,124307295,789.9052374\n2015-10-08T13:30:00Z,198.95,201.55,198.59,201.21,153055231,803.1502779\n2015-10-09T13:30:00Z,201.38,201.9,200.58,201.33,107069240,804.6602249\n2015-10-12T13:30:00Z,201.42,201.76,200.91,201.52,56395585,805.3691017\n2015-10-13T13:30:00Z,200.65,202.16,200.05,200.25,88038718,799.150864\n2015-10-14T13:30:00Z,200.18,200.87,198.94,199.29,99106161,793.0808209\n2015-10-15T13:30:00Z,200.08,202.36,199.64,202.35,134142195,817.5306505\n2015-10-16T13:30:00Z,202.83,203.29,201.92,203.27,114580052,822.7082311\n2015-10-19T13:30:00Z,202.5,203.37,202.13,203.37,76523897,826.1123978\n2015-10-20T13:30:00Z,202.85,203.84,202.5471,203.09,78448484,826.3081934\n2015-10-21T13:30:00Z,203.61,203.79,201.65,201.85,102038033,817.8809207\n2015-10-22T13:30:00Z,202.98,205.51,201.85,205.26,174911723,840.8117134\n2015-10-23T13:30:00Z,207.25,207.95,206.3,207.51,144442340,858.9127626\n2015-10-26T13:30:00Z,207.3,207.37,206.56,207,69032965,855.1743367\n2015-10-27T13:30:00Z,206.2,207,205.79,206.6,77905770,853.5559028\n2015-10-28T13:30:00Z,207,208.98,206.21,208.95,135906725,871.3074272\n2015-10-29T13:30:00Z,208.35,209.27,208.21,208.83,90525498,873.1230573\n2015-10-30T13:30:00Z,209.06,209.44,207.74,207.93,131076942,868.0885449\n2015-11-02T14:30:00Z,208.32,210.62,208.17,210.39,86270811,887.0228679\n2015-11-03T14:30:00Z,209.97,211.66,209.7,211,95246052,892.2851661\n2015-11-04T14:30:00Z,211.35,211.5,209.7201,210.36,96224477,888.8398674\n2015-11-05T14:30:00Z,210.43,210.98,209.09,210.15,78408744,886.6210808\n2015-11-06T14:30:00Z,209.74,210.32,208.46,210.04,110471473,886.4568969\n2015-11-09T14:30:00Z,209.31,209.49,206.95,208.08,131008660,869.750582\n2015-11-10T14:30:00Z,207.51,208.6,207.19,208.56,75874602,872.0095886\n2015-11-11T14:30:00Z,208.88,208.94,207.66,207.74,67845971,867.8979597\n2015-11-12T14:30:00Z,206.5,207.06,204.82,204.84,121315200,842.3224798\n2015-11-13T14:30:00Z,204.35,204.67,202.435,202.54,153577050,822.4273701\n2015-11-16T14:30:00Z,202.32,205.69,202.18,205.62,117645231,843.6799332\n2015-11-17T14:30:00Z,205.99,207.04,204.88,205.47,121123744,844.9138109\n2015-11-18T14:30:00Z,206.04,208.9,205.99,208.73,121342544,873.9843601\n2015-11-19T14:30:00Z,208.59,209.05,208.2,208.55,88220465,875.0123774\n2015-11-20T14:30:00Z,209.45,210.12,208.86,209.3108,94011519,879.7030967\n2015-11-23T14:30:00Z,209.38,209.98,208.52,209.07,64931172,878.279334\n2015-11-24T14:30:00Z,207.87,209.83,207.41,209.35,98874365,882.1946243\n2015-11-25T14:30:00Z,209.5,209.74,209.01,209.32,51980062,882.7486015\n2015-11-27T14:30:00Z,209.43,209.8,208.86,209.56,37317779,883.5404797\n2015-11-30T14:30:00Z,209.75,209.89,208.56,208.69,112822700,877.2675439\n2015-12-01T14:30:00Z,209.44,210.82,209.11,210.68,97858418,891.5548723\n2015-12-02T14:30:00Z,210.615,211,208.23,208.529,108441259,877.2168041\n2015-12-03T14:30:00Z,208.83,209.15,204.7511,205.61,166224154,852.980609\n2015-12-04T14:30:00Z,206.08,209.97,205.93,209.62,192913879,880.0672723\n2015-12-07T14:30:00Z,209.23,209.7295,207.2,208.35,102027111,876.4128207\n2015-12-08T14:30:00Z,206.49,208.289,205.78,206.949,103372367,868.3131763\n2015-12-09T14:30:00Z,206.19,208.68,204.18,205.34,162401537,861.1155989\n2015-12-10T14:30:00Z,205.42,207.43,205.14,205.87,116128884,863.9473296\n2015-12-11T14:30:00Z,203.35,204.14,201.51,201.88,211173305,829.1058536\n2015-12-14T14:30:00Z,202.07,203.05,199.95,202.9008,182385177,832.8235735\n2015-12-15T14:30:00Z,204.7,206.11,204.58,205.0308,154069569,852.3036217\n2015-12-16T14:30:00Z,206.365,208.39,204.8,208.03,197017008,874.6803004\n2015-12-17T14:30:00Z,208.4,208.48,204.84,204.86,173092476,852.444919\n2015-12-18T14:30:00Z,202.77,202.93,199.83,200.0208,251393535,807.3603685\n2015-12-21T14:30:00Z,201.41,201.88,200.09,201.67,99094290,812.4114765\n2015-12-22T14:30:00Z,202.715,203.85,201.55,203.5,111026246,825.5899913\n2015-12-23T14:30:00Z,204.69,206.07,204.58,206.02,110987228,849.9858714\n2015-12-24T14:30:00Z,205.72,206.33,205.42,205.68,48542150,849.9028734\n2015-12-28T14:30:00Z,204.86,205.26,203.94,205.21,65899939,847.7490585\n2015-12-29T14:30:00Z,206.51,207.79,206.47,207.4,92640672,869.2952241\n2015-12-30T14:30:00Z,207.11,207.21,205.76,205.93,63317679,858.6392835\n2015-12-31T14:30:00Z,205.13,205.89,203.87,203.87,114877859,842.1802364\n2016-01-04T14:30:00Z,200.49,201.03,198.59,201.0192,222353534,819.2485957\n2016-01-05T14:30:00Z,201.4,201.9,200.05,201.36,110845849,820.6331758\n2016-01-06T14:30:00Z,198.34,200.06,197.6,198.82,152112604,803.2341374\n2016-01-07T14:30:00Z,195.33,197.44,193.59,194.05,213436073,766.1275119\n2016-01-08T14:30:00Z,195.19,195.85,191.58,191.923,209817228,752.403608\n2016-01-11T14:30:00Z,193.01,193.41,189.82,192.11,187941323,749.1831022\n2016-01-12T14:30:00Z,193.82,194.55,191.14,193.6608,172330490,754.411314\n2016-01-13T14:30:00Z,194.45,194.86,188.38,188.83,221168886,715.5300288\n2016-01-14T14:30:00Z,189.55,193.26,187.66,191.93,240795609,726.9330891\n2016-01-15T14:30:00Z,186.77,188.76,185.52,187.81,324846450,704.7213156\n2016-01-19T14:30:00Z,189.96,190.11,186.2,188.06,195244373,703.204529\n2016-01-20T14:30:00Z,185.03,187.495,181.02,185.65,286547840,687.5391298\n2016-01-21T14:30:00Z,186.21,188.87,184.64,186.69,195772941,694.1250762\n2016-01-22T14:30:00Z,189.78,190.76,188.88,190.52,168319598,729.6307305\n2016-01-25T14:30:00Z,189.92,190.15,187.41,187.64,130371686,705.6619805\n2016-01-26T14:30:00Z,188.42,190.53,188.02,190.2,141036757,721.5702374\n2016-01-27T14:30:00Z,189.58,191.56,187.06,188.13,185681707,712.2438976\n2016-01-28T14:30:00Z,189.96,190.2,187.16,189.11,143798780,712.9758502\n2016-01-29T14:30:00Z,190.02,193.88,189.88,193.7208,210529336,753.4955607\n2016-02-01T14:30:00Z,192.53,194.58,191.84,193.65,136061564,758.031813\n2016-02-02T14:30:00Z,191.96,191.97,189.54,190.16,182564890,728.2922003\n2016-02-03T14:30:00Z,191.41,191.78,187.1,191.3,205054934,730.6595249\n2016-02-04T14:30:00Z,190.71,192.75,189.96,191.6,139531794,732.9673665\n2016-02-05T14:30:00Z,190.99,191.6696,187.2,187.95,180788308,703.9704888\n2016-02-08T14:30:00Z,185.77,186.12,182.8,185.42,191526694,681.642223\n2016-02-09T14:30:00Z,183.36,186.94,183.2,185.43,184513136,685.1132387\n2016-02-10T14:30:00Z,186.41,188.34,185.12,185.27,148214057,684.0791668\n2016-02-11T14:30:00Z,182.34,184.1,181.09,182.86,219058885,667.6837093\n2016-02-12T14:30:00Z,184.96,186.65,183.96,186.63,127632393,700.9657011\n2016-02-16T14:30:00Z,188.77,189.81,187.63,189.78,120250668,727.0967544\n2016-02-17T14:30:00Z,191.16,193.32,191.01,192.88,136009496,756.4284814\n2016-02-18T14:30:00Z,193.2,193.27,191.72,192.09,102342997,753.0781026\n2016-02-19T14:30:00Z,191.17,192.18,190.45,192,114792988,753.3206306\n2016-02-22T14:30:00Z,193.87,194.95,193.79,194.78,103640292,781.3741527\n2016-02-23T14:30:00Z,194,194.32,192.18,192.32,111455289,762.1525454\n2016-02-24T14:30:00Z,190.63,193.53,189.32,193.2,150812152,769.2192301\n2016-02-25T14:30:00Z,193.73,195.55,192.83,195.54,110728317,786.1999457\n2016-02-26T14:30:00Z,196.57,196.68,194.9,195.0892,129833663,783.8423925\n2016-02-29T14:30:00Z,195.11,196.23,193.33,193.56,125918102,774.8505792\n2016-03-01T14:30:00Z,195.01,198.21,194.4542,198.11,141799687,811.0172599\n2016-03-02T14:30:00Z,197.74,199.06,197.25,199,102414960,816.2886574\n2016-03-03T14:30:00Z,198.79,199.795,198.11,199.775,95172197,820.6899855\n2016-03-04T14:30:00Z,200.01,201.35,199.03,200.43,129293601,824.9525738\n2016-03-07T14:30:00Z,199.34,201.07,199.25,200.59,100218998,828.362314\n2016-03-08T14:30:00Z,199.32,199.92,198.21,198.4,123974866,813.613507\n2016-03-09T14:30:00Z,199.36,199.79,198.43,199.38,94801213,817.7272142\n2016-03-10T14:30:00Z,199.96,201.07,197.38,199.54,156838697,817.5749815\n2016-03-11T14:30:00Z,201.26,202.81,201.12,202.76,137964528,848.1324041\n2016-03-14T13:30:00Z,202.16,203.04,201.77,202.5,73611974,849.2044026\n2016-03-15T13:30:00Z,201.36,202.2,201.05,202.17,93169090,850.251334\n2016-03-16T13:30:00Z,201.6,203.82,201.55,203.34,129303179,859.6045317\n2016-03-17T13:30:00Z,203.24,205.23,202.77,204.63,134278505,869.478884\n2016-03-18T13:30:00Z,204.17,204.78,203.8,204.38,138372404,870.2701976\n2016-03-21T13:30:00Z,204.07,204.94,203.8,204.67,72926659,872.2232898\n2016-03-22T13:30:00Z,203.76,205.23,203.57,204.56,97471939,873.8945605\n2016-03-23T13:30:00Z,204.11,204.33,203.01,203.2092,81052455,864.4073281\n2016-03-24T13:30:00Z,202,203.16,201.74,203.12,84360853,865.7579222\n2016-03-28T13:30:00Z,203.61,203.86,202.705,203.24,62408185,866.4508664\n2016-03-29T13:30:00Z,202.76,205.25,202.4,205.1208,92922863,879.1252228\n2016-03-30T13:30:00Z,206.3,206.87,205.59,206.02,86365310,886.1341147\n2016-03-31T13:30:00Z,205.91,206.41,205.33,205.52,94584110,883.2653647\n2016-04-01T13:30:00Z,204.35,207.14,203.98,206.92,114423478,891.3078627\n2016-04-04T13:30:00Z,206.83,207.07,205.89,206.25,63496969,890.1863778\n2016-04-05T13:30:00Z,204.67,206.2642,203.89,204.1892,99662158,875.8637953\n2016-04-06T13:30:00Z,204.29,206.49,203.98,206.42,91839761,893.2256415\n2016-04-07T13:30:00Z,205.14,205.56,203.09,203.95,113859037,877.8701699\n2016-04-08T13:30:00Z,205.34,205.85,203.87,204.4992,95040598,876.9905596\n2016-04-11T13:30:00Z,205.25,206.07,203.91,204.0201,83757486,871.5882837\n2016-04-12T13:30:00Z,204.22,206.25,203.7,205.92,115350567,883.500819\n2016-04-13T13:30:00Z,207,208.1,206.84,208.0008,96336433,902.5961454\n2016-04-14T13:30:00Z,208.07,208.6,207.6,208.01,65212883,903.2833178\n2016-04-15T13:30:00Z,208.01,208.1721,207.4,207.78,75761615,901.539575\n2016-04-18T13:30:00Z,207.14,209.28,207,209.2392,82530960,911.3709921\n2016-04-19T13:30:00Z,209.74,210.2,208.94,209.9,88316060,915.6291319\n2016-04-20T13:30:00Z,209.95,210.92,209.39,210.1,81100314,916.9081924\n2016-04-21T13:30:00Z,210.12,210.25,208.65,208.97,85695041,907.6796619\n2016-04-22T13:30:00Z,208.55,209.29,207.91,208.97,99251724,907.3717534\n2016-04-25T13:30:00Z,208.26,208.66,207.54,208.61,66166494,906.8536374\n2016-04-26T13:30:00Z,209.04,209.52,208.36,208.9192,75864174,908.3868689\n2016-04-27T13:30:00Z,208.47,209.81,208.05,209.35,77329437,911.0011245\n2016-04-28T13:30:00Z,208.46,209.76,206.96,207.4475,97216169,900.1751467\n2016-04-29T13:30:00Z,206.72,207.13,205.03,206.3308,142424137,890.764852\n2016-05-02T13:30:00Z,206.92,208.18,206.41,207.97,62188015,903.2920935\n2016-05-03T13:30:00Z,206.52,206.8,205.28,206.1592,106422142,891.0159504\n2016-05-04T13:30:00Z,204.99,205.85,204.42,205.01,92243810,883.0367421\n2016-05-05T13:30:00Z,205.56,205.98,204.47,204.97,67619222,881.7161976\n2016-05-06T13:30:00Z,204.06,205.77,203.88,205.72,89315004,886.5058448\n2016-05-09T13:30:00Z,205.57,206.4,205.36,205.8892,74374922,888.6784565\n2016-05-10T13:30:00Z,206.72,208.5,206.64,208.45,77472207,913.3858805\n2016-05-11T13:30:00Z,207.91,208.54,206.5,206.5,81726989,902.4306858\n2016-05-12T13:30:00Z,207.29,207.4899,205.37,206.56,89586308,900.5525133\n2016-05-13T13:30:00Z,206.21,206.86,204.38,204.76,96474630,886.6972316\n2016-05-16T13:30:00Z,204.96,207.34,204.89,206.78,77486827,901.0850466\n2016-05-17T13:30:00Z,206.46,206.8,204.23,204.8508,114924940,889.0789722\n2016-05-18T13:30:00Z,204.44,206.3,203.63,204.91,123493379,888.7602807\n2016-05-19T13:30:00Z,204.06,204.54,202.78,204.2,115430507,885.3877807\n2016-05-20T13:30:00Z,204.92,206.1,204.86,205.49,104990408,897.2997745\n2016-05-23T13:30:00Z,205.51,205.84,204.985,205.21,58682576,896.3900784\n2016-05-24T13:30:00Z,206.17,208.24,206.14,207.87,93537808,921.0303483\n2016-05-25T13:30:00Z,208.67,209.77,207.8691,209.28,79221525,931.9562264\n2016-05-26T13:30:00Z,209.44,209.71,208.97,209.34,55280699,932.4455471\n2016-05-27T13:30:00Z,209.53,210.25,209.47,210.24,64211214,940.4864954\n2016-05-31T13:30:00Z,210.56,210.69,209.18,209.84,109879380,938.1996436\n2016-06-01T13:30:00Z,209.12,210.48,208.89,210.27,69936215,940.9671224\n2016-06-02T13:30:00Z,209.8,210.93,209.2399,210.91,63044749,945.7934373\n2016-06-03T13:30:00Z,210.25,210.69,208.86,210.28,101757126,943.843395\n2016-06-06T13:30:00Z,210.7,211.77,210.51,211.35,64887045,953.2906147\n2016-06-07T13:30:00Z,211.525,212.34,211.5,211.68,60974761,956.5638166\n2016-06-08T13:30:00Z,211.84,212.52,211.6899,212.37,66170920,962.5345049\n2016-06-09T13:30:00Z,211.51,212.22,211.19,212.08,73786869,963.2943534\n2016-06-10T13:30:00Z,210.46,210.86,209.43,210.07,113829158,947.6425063\n2016-06-13T13:30:00Z,209.36,210.37,208.35,208.4492,117751153,936.6071935\n2016-06-14T13:30:00Z,208,208.74,206.9199,208.04,125059286,933.7278071\n2016-06-15T13:30:00Z,208.54,209.36,207.53,207.75,109124496,930.7013126\n2016-06-16T13:30:00Z,206.73,208.57,205.59,208.37,149533065,935.9802268\n2016-06-17T13:30:00Z,207.17,207.2,205.75,206.52,117055748,924.159419\n2016-06-20T13:30:00Z,208.82,209.61,207.75,207.85,82789603,929.1568716\n2016-06-21T13:30:00Z,208.3,208.92,207.78,208.44,72461663,931.1764241\n2016-06-22T13:30:00Z,208.65,209.5,207.93,208.1,95560471,928.7823431\n2016-06-23T13:30:00Z,209.81,210.87,209.27,210.81,102731356,951.685532\n2016-06-24T13:30:00Z,203.63,206.905,202.72,203.13,333444400,890.8917942\n2016-06-27T13:30:00Z,201.59,201.6,198.65,199.6,248988660,856.9855442\n2016-06-28T13:30:00Z,201.48,203.23,201.12,203.1997,159382399,883.6786428\n2016-06-29T13:30:00Z,204.84,206.93,204.72,206.66,137328614,916.5938713\n2016-06-30T13:30:00Z,207.21,209.54,206.56,209.475,165021948,939.6637403\n2016-07-01T13:30:00Z,209.36,210.49,209.29,209.9208,106055333,944.3057671\n2016-07-05T13:30:00Z,208.95,209.08,207.71,208.41,109803713,932.5638265\n2016-07-06T13:30:00Z,207.83,209.8,207.06,209.66,96021491,938.6979569\n2016-07-07T13:30:00Z,209.87,210.6495,208.63,209.526,85593827,939.0916918\n2016-07-08T13:30:00Z,211.05,212.94,210.7785,212.65,133970972,967.5887166\n2016-07-11T13:30:00Z,213.19,214.07,212.95,213.4,73633937,974.2582525\n2016-07-12T13:30:00Z,214.53,215.3,213.4308,214.95,101275629,985.3694174\n2016-07-13T13:30:00Z,215.44,215.45,214.35,214.92,87324129,984.7936912\n2016-07-14T13:30:00Z,216.4,216.67,215.66,216.12,91230870,991.5300323\n2016-07-15T13:30:00Z,216.78,217.0125,215.308,215.83,107155401,988.9052172\n2016-07-18T13:30:00Z,215.97,216.6,215.67,216.4092,58725918,991.2189271\n2016-07-19T13:30:00Z,215.92,216.23,215.63,216.19,54345728,991.374884\n2016-07-20T13:30:00Z,216.75,217.37,216.24,217.085,58159457,998.1918574\n2016-07-21T13:30:00Z,216.96,217.22,215.75,216.265,67777310,992.3720415\n2016-07-22T13:30:00Z,216.41,217.3,216.1,217.24,62787477,998.0991513\n2016-07-25T13:30:00Z,217,217.06,215.97,216.65,55873147,994.9098495\n2016-07-26T13:30:00Z,216.53,217.17,215.76,216.75,70080493,995.3648788\n2016-07-27T13:30:00Z,217.19,217.27,215.62,216.52,84083893,993.2523421\n2016-07-28T13:30:00Z,216.29,217.11,215.75,216.77,65035718,994.2684018\n2016-07-29T13:30:00Z,216.46,217.54,216.13,217.12,79519436,996.7847417\n2016-08-01T13:30:00Z,217.19,217.65,216.405,216.94,73311422,996.341036\n2016-08-02T13:30:00Z,216.65,216.83,214.57,215.5492,92295506,983.8574162\n2016-08-03T13:30:00Z,215.48,216.245,215.13,216.18,53993626,986.0646367\n2016-08-04T13:30:00Z,216.31,216.78,214.25,216.4097,46585528,988.0916272\n2016-08-05T13:30:00Z,217.21,218.23,217.07,218.18,71892161,1005.214103\n2016-08-08T13:30:00Z,218.4,218.52,217.74,218.05,39906479,1005.04601\n2016-08-09T13:30:00Z,218.13,218.76,217.8,218.18,51251728,1005.331959\n2016-08-10T13:30:00Z,218.31,218.4038,217.23,217.64,57941092,1001.015096\n2016-08-11T13:30:00Z,218.26,218.94,217.95,218.65,72504270,1007.437715\n2016-08-12T13:30:00Z,218.29,218.71,217.99,218.46,61313544,1007.399871\n2016-08-15T13:30:00Z,218.89,219.5,218.88,219.09,49813482,1013.154886\n2016-08-16T13:30:00Z,218.6,218.68,217.96,217.96,53213621,1003.01386\n2016-08-17T13:30:00Z,218,218.53,217.02,218.37,75134339,1004.544174\n2016-08-18T13:30:00Z,218.34,218.9,218.21,218.86,52989266,1008.110668\n2016-08-19T13:30:00Z,218.31,218.75,217.74,218.54,75443004,1007.671337\n2016-08-22T13:30:00Z,218.26,218.8,217.83,218.53,61368766,1008.459507\n2016-08-23T13:30:00Z,219.25,219.6,218.9,218.97,53399159,1011.039723\n2016-08-24T13:30:00Z,218.8,218.91,217.36,217.85,71728949,1000.885746\n2016-08-25T13:30:00Z,217.4,218.19,217.22,217.7,69224776,1000.111289\n2016-08-26T13:30:00Z,217.92,219.12,216.25,217.29,122506348,998.1110771\n2016-08-29T13:30:00Z,217.44,218.665,217.4,218.3608,70502167,1006.101083\n2016-08-30T13:30:00Z,218.26,218.59,217.35,218,58114543,1004.981276\n2016-08-31T13:30:00Z,217.61,217.75,216.465,217.38,85269453,999.7778864\n2016-09-01T13:30:00Z,217.37,217.73,216.03,217.39,97844207,999.5978544\n2016-09-02T13:30:00Z,218.39,218.87,217.7,218.37,79293856,1006.378869\n2016-09-06T13:30:00Z,218.7,219.12,217.86,219.0308,56702089,1009.421854\n2016-09-07T13:30:00Z,218.84,219.22,218.3,219.01,76554855,1010.091013\n2016-09-08T13:30:00Z,218.62,218.94,218.15,218.51,74102880,1006.91558\n2016-09-09T13:30:00Z,216.97,217.03,213.25,213.28,221589073,955.5698547\n2016-09-12T13:30:00Z,212.39,216.81,212.31,216.34,168110913,972.302364\n2016-09-13T13:30:00Z,214.84,215.1499,212.5,213.23,182828839,955.7020497\n2016-09-14T13:30:00Z,213.29,214.7,212.5,213.15,134185491,953.7515814\n2016-09-15T13:30:00Z,212.96,215.73,212.75,215.28,145736123,971.1601635\n2016-09-16T13:30:00Z,213.48,213.69,212.57,213.37,155236354,961.7579842\n2016-09-19T13:30:00Z,214.13,214.88,213.03,213.41,80250490,960.0112298\n2016-09-20T13:30:00Z,214.41,214.59,213.38,213.42,69665279,956.4829025\n2016-09-21T13:30:00Z,214.24,216.03,213.44,215.82,110284425,973.3396299\n2016-09-22T13:30:00Z,217,217.53,216.71,217.18,76678713,985.2182067\n2016-09-23T13:30:00Z,216.72,216.88,215.88,215.99,73630921,974.9514703\n2016-09-26T13:30:00Z,215.02,215.23,214.01,214.24,89827305,958.8275222\n2016-09-27T13:30:00Z,214.05,215.68,213.62,215.57,78494829,966.3907151\n2016-09-28T13:30:00Z,215.83,216.82,214.71,216.64,87411015,972.2108707\n2016-09-29T13:30:00Z,216.4,216.87,214.04,214.68,128070615,958.1846959\n2016-09-30T13:30:00Z,215.65,217.12,215.36,216.3,117202914,967.3166129\n2016-10-03T13:30:00Z,215.82,216.04,215.04,215.78,83512057,965.0165646\n2016-10-04T13:30:00Z,215.91,216.17,213.99,214.68,119948052,956.2044927\n2016-10-05T13:30:00Z,215.41,216.13,215.33,215.63,72815963,960.9650729\n2016-10-06T13:30:00Z,215.37,216.04,214.735,215.78,62927376,962.651424\n2016-10-07T13:30:00Z,216.1,216.3,214.19,215.04,89788255,957.4075681\n2016-10-10T13:30:00Z,216.155,216.7,215.985,216.16,51855023,963.5325681\n2016-10-11T13:30:00Z,215.66,215.74,212.58,213.43,130367373,938.0215837\n2016-10-12T13:30:00Z,213.59,214.32,213.01,213.71,73866117,937.3737423\n2016-10-13T13:30:00Z,212.16,213.59,211.21,213.01,101356960,935.8238941\n2016-10-14T13:30:00Z,214.15,214.69,213.03,213.12,93346237,934.750189\n2016-10-17T13:30:00Z,213.09,213.39,212.17,212.38,58275674,929.3150155\n2016-10-18T13:30:00Z,214.24,214.31,213.27,213.71,76869656,935.7543952\n2016-10-19T13:30:00Z,214.02,214.64,213.6,214.28,66519224,938.5676948\n2016-10-20T13:30:00Z,213.87,214.53,213.11,213.88,73639830,936.9426948\n2016-10-21T13:30:00Z,212.96,214.08,212.76,213.98,89089092,940.1846608\n2016-10-24T13:30:00Z,215,215.32,214.48,214.89,60146592,947.0963708\n2016-10-25T13:30:00Z,214.68,214.98,213.98,214.17,66542329,941.5472528\n2016-10-26T13:30:00Z,213.21,214.42,212.93,213.74,75705478,940.1457845\n2016-10-27T13:30:00Z,214.58,214.62,213.08,213.17,77220213,936.3886843\n2016-10-28T13:30:00Z,213.14,213.93,211.71,212.54,140623183,931.8394861\n2016-10-31T13:30:00Z,212.93,213.19,212.36,212.55,61272507,930.4715014\n2016-11-01T13:30:00Z,212.93,212.99,209.6,211.01,122781818,916.7425738\n2016-11-02T13:30:00Z,210.65,211.1,209.23,209.74,103330806,906.30401\n2016-11-03T13:30:00Z,209.99,210.24,208.46,208.78,88939346,899.1607971\n2016-11-04T13:30:00Z,208.91,209.89,208.38,208.55,109122059,896.4336419\n2016-11-07T14:30:00Z,211.45,213.19,211.3,213.15,109794861,942.7644914\n2016-11-08T14:30:00Z,212.69,214.77,212.38,214.11,106772138,950.2997933\n2016-11-09T14:30:00Z,212.37,217.1,212.34,216.3792,258428972,967.2109761\n2016-11-10T14:30:00Z,217.3,218.31,215.22,216.92,172113313,971.201039\n2016-11-11T14:30:00Z,216.08,216.7,215.32,216.42,100552732,968.519651\n2016-11-14T14:30:00Z,217.03,217.27,215.72,216.59,94579982,968.6333742\n2016-11-15T14:30:00Z,217.04,218.28,216.8,218.28,91652580,982.3428137\n2016-11-16T14:30:00Z,217.56,218.14,217.42,217.87,65617697,982.6115637\n2016-11-17T14:30:00Z,218.05,219.06,217.92,218.99,69797191,992.5930778\n2016-11-18T14:30:00Z,219.07,219.27,218.29,218.5,86265751,990.6486334\n2016-11-21T14:30:00Z,219.17,220.18,219,220.15,72402638,1003.986471\n2016-11-22T14:30:00Z,220.51,220.79,219.73,220.58,67428957,1006.162716\n2016-11-23T14:30:00Z,219.98,220.76,219.75,220.7,56620237,1008.674426\n2016-11-25T14:30:00Z,221.1,221.56,221.01,221.52,37872255,1016.023296\n2016-11-28T14:30:00Z,221.16,221.48,220.36,220.48,76572511,1008.598597\n2016-11-29T14:30:00Z,220.52,221.44,220.17,220.91,69886690,1010.49443\n2016-11-30T14:30:00Z,221.63,221.82,220.31,220.38,113291793,1006.752887\n2016-12-01T14:30:00Z,220.73,220.73,219.15,219.57,79040487,999.8371833\n2016-12-02T14:30:00Z,219.67,220.25,219.26,219.68,74840347,999.2561286\n2016-12-05T14:30:00Z,220.65,221.4,220.42,221,67837821,1011.158624\n2016-12-06T14:30:00Z,221.22,221.7441,220.662,221.7,59877377,1015.244223\n2016-12-07T14:30:00Z,221.52,224.67,221.38,224.6,110738050,1040.066804\n2016-12-08T14:30:00Z,224.57,225.7,224.26,225.15,99714387,1045.075288\n2016-12-09T14:30:00Z,225.41,226.53,225.37,226.51,88005766,1057.601348\n2016-12-12T14:30:00Z,226.4,226.96,225.76,226.25,102016125,1057.41067\n2016-12-13T14:30:00Z,227.02,228.34,227,227.76,110477485,1071.143998\n2016-12-14T14:30:00Z,227.41,228.23,225.365,225.88,142501812,1059.070842\n2016-12-15T14:30:00Z,226.16,227.81,225.8904,226.81,124972554,1063.632248\n2016-12-16T14:30:00Z,226.01,226.08,224.67,225.04,156420152,1049.187248\n2016-12-19T14:30:00Z,225.25,226.02,225.08,225.53,90341147,1051.161\n2016-12-20T14:30:00Z,226.15,226.57,225.88,226.4,89838810,1058.564744\n2016-12-21T14:30:00Z,226.25,226.45,225.77,225.77,67909039,1054.282547\n2016-12-22T14:30:00Z,225.6,225.74,224.92,225.38,56219071,1050.833594\n2016-12-23T14:30:00Z,225.43,225.72,225.21,225.71,36697822,1052.394434\n2016-12-27T14:30:00Z,226.02,226.73,226,226.27,42672487,1057.487688\n2016-12-28T14:30:00Z,226.57,226.59,224.27,224.4,64095014,1042.311928\n2016-12-29T14:30:00Z,224.48,224.89,223.84,224.35,48696080,1040.866873\n2016-12-30T14:30:00Z,224.73,224.83,222.73,223.53,108998328,1033.970478\n2017-01-03T14:30:00Z,225.04,225.83,223.8837,225.24,91366522,1042.928342\n2017-01-04T14:30:00Z,225.62,226.75,225.61,226.58,78744433,1055.763342\n2017-01-05T14:30:00Z,226.27,226.58,225.48,226.4,78379012,1056.404667\n2017-01-06T14:30:00Z,226.53,227.75,225.9,227.21,71559922,1061.704717\n2017-01-09T14:30:00Z,226.91,227.0701,226.4163,226.46,46939676,1057.236685\n2017-01-10T14:30:00Z,226.48,227.45,226.01,226.46,63771939,1056.748461\n2017-01-11T14:30:00Z,226.36,227.1,225.59,227.1,74650016,1060.355515\n2017-01-12T14:30:00Z,226.5,226.75,224.955,226.53,72113181,1058.053746\n2017-01-13T14:30:00Z,226.73,227.4,226.69,227.05,62717865,1062.741246\n2017-01-17T14:30:00Z,226.31,226.78,225.8,226.25,61240814,1057.838003\n2017-01-18T14:30:00Z,226.535,226.8,225.9,226.75,54793302,1060.063926\n2017-01-19T14:30:00Z,226.84,227,225.41,225.91,66608787,1053.688735\n2017-01-20T14:30:00Z,226.7,227.31,225.9719,226.74,129168623,1057.06242\n2017-01-23T14:30:00Z,226.35,226.805,225.27,226.15,75061645,1053.018731\n2017-01-24T14:30:00Z,226.4,228.08,226.27,227.6,95555295,1065.583835\n2017-01-25T14:30:00Z,228.7,229.57,228.51,229.57,84437712,1083.93387\n2017-01-26T14:30:00Z,229.4,229.71,229.01,229.33,59970719,1083.714524\n2017-01-27T14:30:00Z,229.42,229.59,228.76,228.97,59711118,1081.181891\n2017-01-30T14:30:00Z,228.17,228.2,226.41,227.55,79737252,1068.294459\n2017-01-31T14:30:00Z,226.98,227.6,226.32,227.53,75880805,1068.830173\n2017-02-01T14:30:00Z,228.255,228.59,226.94,227.62,79117651,1068.496607\n2017-02-02T14:30:00Z,227.2,228.1,226.82,227.77,69657560,1069.456642\n2017-02-03T14:30:00Z,228.82,229.55,228.46,229.34,80563168,1083.367299\n2017-02-06T14:30:00Z,228.87,229.326,228.54,228.93,57790108,1082.01302\n2017-02-07T14:30:00Z,229.38,229.6556,228.72,228.94,57931151,1081.082739\n2017-02-08T14:30:00Z,228.61,229.39,228.31,229.24,51566218,1082.753695\n2017-02-09T14:30:00Z,229.56,230.95,229.52,230.6,65955245,1095.359067\n2017-02-10T14:30:00Z,231,231.77,230.6216,231.51,66015892,1102.701452\n2017-02-13T14:30:00Z,232.08,233.07,232.05,232.77,55182050,1114.618119\n2017-02-14T14:30:00Z,232.56,233.71,232.16,233.7,71108983,1120.322582\n2017-02-15T14:30:00Z,233.45,235.14,233.39,234.92,86785826,1130.229216\n2017-02-16T14:30:00Z,234.96,235.155,233.85,234.72,84722437,1130.419145\n2017-02-17T14:30:00Z,233.95,235.09,233.93,235.09,77204104,1133.98062\n2017-02-21T14:30:00Z,235.52,236.69,235.51,236.49,88946051,1146.935844\n2017-02-22T14:30:00Z,236.02,236.54,235.83,236.28,62115185,1147.639584\n2017-02-23T14:30:00Z,236.88,236.9,235.56,236.44,74615902,1147.655599\n2017-02-24T14:30:00Z,235.46,236.7932,235.41,236.74,82381612,1151.233904\n2017-02-27T14:30:00Z,236.64,237.31,236.35,237.11,56515440,1153.808366\n2017-02-28T14:30:00Z,236.67,236.95,236.015,236.47,96961938,1150.04657\n2017-03-01T14:30:00Z,238.39,240.32,238.37,239.78,149158170,1182.306634\n2017-03-02T14:30:00Z,239.56,239.57,238.21,238.27,70245978,1172.521203\n2017-03-03T14:30:00Z,238.17,238.61,237.73,238.42,81974300,1172.387887\n2017-03-06T14:30:00Z,237.5,238.12,237.01,237.71,55391533,1168.772929\n2017-03-07T14:30:00Z,237.36,237.77,236.76,237,65103737,1164.092782\n2017-03-08T14:30:00Z,237.34,237.64,236.4,236.56,78168795,1161.325865\n2017-03-09T14:30:00Z,236.7,237.24,235.74,236.86,90683918,1161.885231\n2017-03-10T14:30:00Z,237.97,238.02,236.59,237.69,81991652,1165.485571\n2017-03-13T13:30:00Z,237.62,237.86,237.24,237.81,57256824,1166.076603\n2017-03-14T13:30:00Z,237.18,237.24,236.19,236.9,59880778,1158.734605\n2017-03-15T13:30:00Z,237.56,239.44,237.29,238.95,96081750,1176.318715\n2017-03-16T13:30:00Z,239.11,239.2,238.1,238.48,78343951,1174.713037\n2017-03-17T13:30:00Z,237.75,237.97,237.03,237.03,89002111,1161.529696\n2017-03-20T13:30:00Z,237.03,237.36,236.32,236.77,52536979,1159.456438\n2017-03-21T13:30:00Z,237.47,237.61,233.58,233.73,131809275,1135.234444\n2017-03-22T13:30:00Z,233.77,234.61,233.05,234.28,97569204,1134.947871\n2017-03-23T13:30:00Z,234,235.34,233.6,234.03,100410277,1134.566512\n2017-03-24T13:30:00Z,234.38,235.04,232.96,233.86,112504853,1133.212995\n2017-03-27T13:30:00Z,231.93,233.92,231.61,233.62,87454452,1135.950571\n2017-03-28T13:30:00Z,233.27,235.81,233.14,235.32,93483915,1149.881503\n2017-03-29T13:30:00Z,234.99,235.81,234.725,235.54,60786374,1152.226818\n2017-03-30T13:30:00Z,235.47,236.52,235.27,236.29,56737890,1157.954521\n2017-03-31T13:30:00Z,235.9,236.51,235.68,235.74,73733094,1156.389001\n2017-04-03T13:30:00Z,235.8,236.03,233.91,235.33,85546486,1152.761831\n2017-04-04T13:30:00Z,235,235.58,234.555,235.48,56466195,1153.917124\n2017-04-05T13:30:00Z,236.26,237.39,234.54,234.78,108800604,1148.611568\n2017-04-06T13:30:00Z,234.94,236.04,234.425,235.44,69135757,1150.753886\n2017-04-07T13:30:00Z,235.15,236,234.64,235.2,74412311,1150.450855\n2017-04-10T13:30:00Z,235.36,236.255,234.73,235.34,67615302,1151.061983\n2017-04-11T13:30:00Z,234.9,235.18,233.34,235.06,88045276,1149.730815\n2017-04-12T13:30:00Z,234.74,234.96,233.77,234.03,81864436,1141.258891\n2017-04-13T13:30:00Z,233.64,234.49,232.51,232.51,92880394,1131.29655\n2017-04-17T13:30:00Z,233.11,234.57,232.88,234.57,68405367,1146.260194\n2017-04-18T13:30:00Z,233.72,234.49,233.08,233.87,83225821,1144.926172\n2017-04-19T13:30:00Z,234.52,234.95,233.18,233.44,68699868,1141.443807\n2017-04-20T13:30:00Z,234.15,235.845,233.78,235.34,92572186,1154.794918\n2017-04-21T13:30:00Z,235.25,235.31,234.13,234.59,110389847,1150.829989\n2017-04-24T13:30:00Z,237.18,237.41,236.61,237.17,119209877,1172.336951\n2017-04-25T13:30:00Z,237.91,238.95,237.81,238.55,75050935,1185.249558\n2017-04-26T13:30:00Z,238.51,239.53,238.35,238.4,84702455,1185.043867\n2017-04-27T13:30:00Z,238.77,238.95,237.98,238.6,57410326,1185.345402\n2017-04-28T13:30:00Z,238.9,238.93,237.93,238.08,63532845,1181.439077\n2017-05-01T13:30:00Z,238.68,239.17,238.195,238.68,66882521,1183.613572\n2017-05-02T13:30:00Z,238.84,238.98,238.3,238.77,57375732,1183.805668\n2017-05-03T13:30:00Z,238.29,238.8775,237.7,238.48,73137731,1182.616468\n2017-05-04T13:30:00Z,238.83,238.9225,237.78,238.76,61462732,1183.691836\n2017-05-05T13:30:00Z,239.19,239.72,238.68,239.7,62001269,1190.372687\n2017-05-08T13:30:00Z,239.75,239.92,239.17,239.66,48385730,1190.533121\n2017-05-09T13:30:00Z,239.96,240.19,239.04,239.44,51363200,1188.872407\n2017-05-10T13:30:00Z,239.39,239.87,239.15,239.87,54293799,1190.57976\n2017-05-11T13:30:00Z,239.35,239.57,238.13,239.38,62358346,1188.322085\n2017-05-12T13:30:00Z,239.09,239.4273,238.67,238.98,53912730,1185.725613\n2017-05-15T13:30:00Z,239.47,240.44,239.45,240.3,61918937,1198.165484\n2017-05-16T13:30:00Z,240.64,240.67,239.63,240.08,51241791,1197.183645\n2017-05-17T13:30:00Z,238.1,238.64,235.75,235.82,172174107,1157.203312\n2017-05-18T13:30:00Z,235.73,237.75,235.43,236.77,107047656,1160.959799\n2017-05-19T13:30:00Z,237.33,239.08,237.27,238.31,115011373,1175.210608\n2017-05-22T13:30:00Z,238.9,239.71,238.82,239.52,61010602,1186.321219\n2017-05-23T13:30:00Z,239.95,240.24,239.51,240.05,48341683,1190.058507\n2017-05-24T13:30:00Z,240.32,240.73,239.93,240.61,49181099,1193.819113\n2017-05-25T13:30:00Z,241.2,242.08,240.96,241.76,64071661,1203.913606\n2017-05-26T13:30:00Z,241.54,241.9,241.45,241.71,46629905,1204.488288\n2017-05-30T13:30:00Z,241.34,241.79,241.16,241.5,35201897,1204.04103\n2017-05-31T13:30:00Z,241.84,241.88,240.64,241.44,91796016,1203.117202\n2017-06-01T13:30:00Z,241.97,243.38,241.64,243.36,68962024,1218.835952\n2017-06-02T13:30:00Z,243.42,244.35,243.08,244.17,88666128,1224.698297\n2017-06-05T13:30:00Z,243.97,244.3,243.76,243.99,44698825,1224.759938\n2017-06-06T13:30:00Z,243.34,243.98,243.12,243.21,50375430,1219.509938\n2017-06-07T13:30:00Z,243.6,243.92,242.83,243.66,54144311,1221.279008\n2017-06-08T13:30:00Z,243.77,244.33,243.17,243.78,65950691,1221.777944\n2017-06-09T13:30:00Z,244.09,245.01,241.95,243.41,132256362,1219.135648\n2017-06-12T13:30:00Z,243.13,243.42,242.38,243.36,86108102,1218.577022\n2017-06-13T13:30:00Z,243.98,244.61,243.5799,244.55,60066953,1228.574648\n2017-06-14T13:30:00Z,244.86,244.87,243.29,244.24,78602311,1226.391593\n2017-06-15T13:30:00Z,242.68,243.91,242.36,243.77,66464888,1225.888919\n2017-06-16T13:30:00Z,242.77,242.83,241.6337,242.64,84553097,1219.535966\n2017-06-19T13:30:00Z,243.59,244.73,243.48,244.66,65123802,1238.889949\n2017-06-20T13:30:00Z,244.25,244.26,242.99,243.01,56906368,1226.860543\n2017-06-21T13:30:00Z,243.42,243.59,242.41,242.95,55977569,1225.337892\n2017-06-22T13:30:00Z,242.96,243.53,242.64,242.84,44148059,1224.303462\n2017-06-23T13:30:00Z,242.91,243.51,242.47,243.13,66986801,1225.751476\n2017-06-26T13:30:00Z,243.9,244.38,243.045,243.29,56700477,1225.245631\n2017-06-27T13:30:00Z,243.04,243.38,241.31,241.33,82247666,1208.722431\n2017-06-28T13:30:00Z,242.5,243.715,242.23,243.49,70042599,1222.776895\n2017-06-29T13:30:00Z,243.66,243.72,239.955,241.35,106949719,1205.996658\n2017-06-30T13:30:00Z,242.28,242.71,241.575,241.8,86820694,1204.285014\n2017-07-03T13:30:00Z,242.88,243.38,242.21,242.21,39153806,1203.987773\n2017-07-05T13:30:00Z,242.63,243.01,241.7,242.77,54427596,1205.552917\n2017-07-06T13:30:00Z,241.89,242.03,240.34,240.55,66115317,1184.85587\n2017-07-07T13:30:00Z,241.21,242.28,240.5645,242.11,57972268,1193.657201\n2017-07-10T13:30:00Z,241.95,242.8,241.76,242.37,36663274,1196.026519\n2017-07-11T13:30:00Z,242.16,242.55,240.85,242.19,50354614,1195.710729\n2017-07-12T13:30:00Z,243.3,244.2,243.3,244.01,59610405,1214.457845\n2017-07-13T13:30:00Z,244.02,244.55,243.76,244.42,39471637,1217.204938\n2017-07-14T13:30:00Z,244.43,245.97,244.31,245.56,60262692,1227.14013\n2017-07-17T13:30:00Z,245.47,245.91,245.33,245.53,33531917,1227.856615\n2017-07-18T13:30:00Z,245.06,245.72,244.67,245.66,42742498,1230.102507\n2017-07-19T13:30:00Z,246.02,247,246.01,246.99,51034260,1242.617241\n2017-07-20T13:30:00Z,247.28,247.42,246.47,247.1,47135183,1243.33265\n2017-07-21T13:30:00Z,246.44,246.91,246.18,246.88,88711019,1243.035236\n2017-07-24T13:30:00Z,246.79,246.98,246.28,246.82,46622256,1243.336162\n2017-07-25T13:30:00Z,247.68,247.8,247.16,247.42,54915591,1246.913761\n2017-07-26T13:30:00Z,247.75,247.79,247.13,247.43,47575422,1246.227985\n2017-07-27T13:30:00Z,247.96,248,245.68,247.2,70766568,1243.083454\n2017-07-28T13:30:00Z,246.65,247.06,246.13,246.91,50088359,1241.116542\n2017-07-31T13:30:00Z,247.37,247.48,246.53,246.77,65838659,1239.800348\n2017-08-01T13:30:00Z,247.46,247.5,246.716,247.32,55050401,1241.412366\n2017-08-02T13:30:00Z,247.47,247.6,246.37,247.44,47211216,1241.740923\n2017-08-03T13:30:00Z,247.31,247.34,246.64,246.96,40855997,1237.367986\n2017-08-04T13:30:00Z,247.52,247.79,246.97,247.41,60191838,1239.116102\n2017-08-07T13:30:00Z,247.49,247.87,247.37,247.87,31995021,1242.508875\n2017-08-08T13:30:00Z,247.51,248.91,246.83,247.26,61719353,1240.596231\n2017-08-09T13:30:00Z,246.47,247.31,246.06,247.25,62632619,1242.410517\n2017-08-10T13:30:00Z,246.29,246.44,243.7,243.76,120479470,1212.118601\n2017-08-11T13:30:00Z,244.02,244.8,243.75,244.12,74869947,1211.259017\n2017-08-14T13:30:00Z,245.59,246.79,245.55,246.54,73291919,1235.868865\n2017-08-15T13:30:00Z,246.98,247,246.16,246.51,55242746,1235.795489\n2017-08-16T13:30:00Z,247.11,247.57,246.45,246.94,56715544,1237.013419\n2017-08-17T13:30:00Z,246.24,246.6,243.09,243.09,128490396,1201.671117\n2017-08-18T13:30:00Z,242.9,244.189,242.2,242.71,136747986,1198.547833\n2017-08-21T13:30:00Z,242.64,243.2,241.83,242.9,65469736,1199.605153\n2017-08-22T13:30:00Z,243.57,245.62,243.55,245.44,63140101,1224.068567\n2017-08-23T13:30:00Z,244.33,245.05,244.16,244.56,50203837,1222.535556\n2017-08-24T13:30:00Z,245,245.18,243.75,243.99,50741671,1219.072636\n2017-08-25T13:30:00Z,244.9,245.61,244.39,244.56,64445912,1219.965573\n2017-08-28T13:30:00Z,245.17,245.2,244.09,244.57,40565606,1218.710343\n2017-08-29T13:30:00Z,243.06,245.15,242.93,244.85,51135715,1223.14336\n2017-08-30T13:30:00Z,244.83,246.32,244.62,246.01,62030805,1232.544771\n2017-08-31T13:30:00Z,246.72,247.77,246.0473,247.49,103803880,1244.212706\n2017-09-01T13:30:00Z,247.92,248.33,247.67,247.84,62006989,1247.011778\n2017-09-05T13:30:00Z,247.26,247.52,244.95,246.06,91398777,1231.248142\n2017-09-06T13:30:00Z,246.84,247.28,246.23,246.9,57916867,1234.276887\n2017-09-07T13:30:00Z,247.25,247.27,246.4,246.87,58034730,1233.553017\n2017-09-08T13:30:00Z,246.54,247.11,246.3,246.58,63832825,1232.116208\n2017-09-11T13:30:00Z,248.04,249.3,248.02,249.21,71364848,1259.392327\n2017-09-12T13:30:00Z,249.63,250.09,249.42,250.05,56896027,1266.309189\n2017-09-13T13:30:00Z,249.72,250.21,249.59,250.17,59228002,1268.093672\n2017-09-14T13:30:00Z,249.8,250.32,249.6,250.09,95446349,1268.853244\n2017-09-15T13:30:00Z,248.69,249.29,248.57,249.19,95432382,1264.252615\n2017-09-18T13:30:00Z,249.61,250.12,249.28,249.72,46235238,1268.33863\n2017-09-19T13:30:00Z,250,250.07,249.6,249.97,47108148,1269.492838\n2017-09-20T13:30:00Z,250.07,250.19,248.92,250.06,59574083,1269.890955\n2017-09-21T13:30:00Z,249.88,249.98,249.185,249.39,48211398,1263.899817\n2017-09-22T13:30:00Z,249.05,249.63,249.02,249.44,51214032,1264.286549\n2017-09-25T13:30:00Z,249.15,249.5532,248.08,248.93,57064357,1261.458988\n2017-09-26T13:30:00Z,249.42,249.7,248.805,249.08,54081959,1261.079054\n2017-09-27T13:30:00Z,249.88,250.49,248.87,250.05,81001426,1266.092617\n2017-09-28T13:30:00Z,249.73,250.44,249.63,250.35,44778841,1268.101781\n2017-09-29T13:30:00Z,250.34,251.32,250.13,251.23,85578002,1274.772785\n2017-10-02T13:30:00Z,251.49,252.32,251.2926,252.32,59022985,1283.958387\n2017-10-03T13:30:00Z,252.46,252.89,252.23,252.86,66810169,1287.849417\n2017-10-04T13:30:00Z,252.69,253.44,252.56,253.16,55953619,1290.198269\n2017-10-05T13:30:00Z,253.54,254.68,253.196,254.66,63522757,1302.971502\n2017-10-06T13:30:00Z,254.15,254.7008,253.85,254.37,80645998,1303.419194\n2017-10-09T13:30:00Z,254.63,254.7,253.65,253.95,35803138,1300.548153\n2017-10-10T13:30:00Z,254.6,255.05,253.98,254.62,43057363,1303.341978\n2017-10-11T13:30:00Z,254.51,255.02,254.32,255.02,47674325,1305.682403\n2017-10-12T13:30:00Z,254.66,255.06,254.365,254.64,47080269,1304.375887\n2017-10-13T13:30:00Z,255.14,255.27,254.64,254.95,54800435,1305.678053\n2017-10-16T13:30:00Z,255.21,255.51,254.82,255.29,38521675,1307.256019\n2017-10-17T13:30:00Z,255.23,255.52,254.98,255.47,31560964,1308.363162\n2017-10-18T13:30:00Z,255.9,255.95,255.5,255.72,40888330,1309.620305\n2017-10-19T13:30:00Z,254.83,255.83,254.35,255.79,61903788,1312.455755\n2017-10-20T13:30:00Z,256.7,257.14,255.7744,257.11,89176377,1321.730909\n2017-10-23T13:30:00Z,257.48,257.51,256.02,256.11,63915306,1314.961188\n2017-10-24T13:30:00Z,256.6,256.83,256.15,256.56,66935910,1315.338886\n2017-10-25T13:30:00Z,256.18,256.31,254,255.29,103715291,1304.050542\n2017-10-26T13:30:00Z,255.99,256.3,255.48,255.62,69797972,1303.62046\n2017-10-27T13:30:00Z,256.47,257.89,255.6254,257.71,85562544,1319.357294\n2017-10-30T13:30:00Z,257.07,257.6,256.41,256.75,54285687,1315.124979\n2017-10-31T13:30:00Z,257.18,257.44,256.805,257.15,60304781,1316.896444\n2017-11-01T13:30:00Z,258.04,258.43,257.07,257.49,54202736,1317.232824\n2017-11-02T13:30:00Z,257.41,257.75,256.19,257.59,56449535,1317.484113\n2017-11-03T13:30:00Z,257.77,258.5,257.3,258.45,59589730,1323.171613\n2017-11-06T14:30:00Z,258.3,259,258.22,258.85,49652598,1326.229178\n2017-11-07T14:30:00Z,258.97,259.35,258.09,258.67,57502161,1325.574885\n2017-11-08T14:30:00Z,258.47,259.22,258.15,259.11,50469579,1327.631381\n2017-11-09T14:30:00Z,257.73,258.39,256.36,258.17,95085497,1323.856871\n2017-11-10T14:30:00Z,257.73,258.2926,257.37,258.09,59984662,1324.873722\n2017-11-13T14:30:00Z,257.31,258.59,257.27,258.33,50228648,1327.926913\n2017-11-14T14:30:00Z,257.41,257.85,256.52,257.73,61315152,1326.780166\n2017-11-15T14:30:00Z,256.62,257.22,255.63,256.44,80811525,1317.91653\n2017-11-16T14:30:00Z,257.52,259.04,257.4748,258.62,67777027,1338.423792\n2017-11-17T14:30:00Z,258.22,258.5882,257.77,257.86,75756833,1335.238495\n2017-11-20T14:30:00Z,258.14,258.525,257.86,258.3,48075514,1337.605631\n2017-11-21T14:30:00Z,259.18,260.2,259.18,259.99,69176799,1354.507714\n2017-11-22T14:30:00Z,260,260.15,259.57,259.76,45033392,1354.012906\n2017-11-24T14:30:00Z,260.32,260.48,260.16,260.36,27746365,1358.357734\n2017-11-27T14:30:00Z,260.41,260.75,260,260.23,52274922,1357.684214\n2017-11-28T14:30:00Z,260.76,262.9,260.655,262.87,98971719,1382.023624\n2017-11-29T14:30:00Z,263.02,263.63,262.2,262.71,77512102,1382.539269\n2017-11-30T14:30:00Z,263.76,266.05,263.67,265.01,127894389,1402.774695\n2017-12-01T14:30:00Z,264.76,265.31,260.76,264.46,164390902,1400.657889\n2017-12-04T14:30:00Z,266.31,266.8,264.08,264.14,94040560,1392.913703\n2017-12-05T14:30:00Z,264.43,265.15,263.04,263.19,77994544,1387.438326\n2017-12-06T14:30:00Z,262.87,263.73,262.71,263.24,75898566,1387.248006\n2017-12-07T14:30:00Z,263.09,264.43,262.94,264.07,77218569,1393.886533\n2017-12-08T14:30:00Z,264.99,265.52,264.72,265.51,76563873,1406.752637\n2017-12-11T14:30:00Z,265.58,266.38,265.4793,266.31,83077533,1413.584463\n2017-12-12T14:30:00Z,266.57,267.32,266.345,266.78,85195750,1417.654011\n2017-12-13T14:30:00Z,267.06,267.56,266.65,266.75,102905409,1416.982907\n2017-12-14T14:30:00Z,267.09,267.22,265.6,265.66,100666692,1409.012086\n2017-12-15T14:30:00Z,265.45,267.04,265.39,266.51,144610290,1413.405143\n2017-12-18T14:30:00Z,268.1,268.6,267.98,268.2,83676072,1429.572002\n2017-12-19T14:30:00Z,268.48,268.53,267.09,267.17,82382876,1421.711081\n2017-12-20T14:30:00Z,268.27,268.33,266.69,267.03,76751500,1417.703775\n2017-12-21T14:30:00Z,267.74,268.385,267.3,267.58,67032339,1418.589396\n2017-12-22T14:30:00Z,267.6,267.635,266.9,267.51,78720873,1417.739396\n2017-12-26T14:30:00Z,267.05,267.4377,266.885,267.19,45244433,1415.998244\n2017-12-27T14:30:00Z,267.38,267.73,267.01,267.32,57750986,1416.601721\n2017-12-28T14:30:00Z,267.89,267.92,267.45,267.87,45116139,1420.181266\n2017-12-29T14:30:00Z,268.53,268.55,266.64,266.86,96007424,1412.7547\n2018-01-02T14:30:00Z,267.84,268.81,267.4,268.77,86655749,1424.128731\n2018-01-03T14:30:00Z,268.96,270.64,268.96,270.47,90070416,1439.775135\n2018-01-04T14:30:00Z,271.2,272.16,270.5447,271.61,80636408,1448.736988\n2018-01-05T14:30:00Z,272.51,273.56,271.95,273.42,83523995,1464.064429\n2018-01-08T14:30:00Z,273.31,274.1,272.98,273.92,57319192,1467.320922\n2018-01-09T14:30:00Z,274.4,275.25,274.081,274.54,57253957,1472.31613\n2018-01-10T14:30:00Z,273.68,274.42,272.92,274.12,69574318,1471.268716\n2018-01-11T14:30:00Z,274.75,276.12,274.56,276.12,62361455,1489.754166\n2018-01-12T14:30:00Z,276.42,278.11,276.0819,277.92,90816076,1504.929847\n2018-01-16T14:30:00Z,279.35,280.09,276.18,276.97,106555142,1499.343426\n2018-01-17T14:30:00Z,278.03,280.05,276.97,279.61,113258799,1514.193426\n2018-01-18T14:30:00Z,279.48,279.96,278.58,279.14,100728006,1513.30487\n2018-01-19T14:30:00Z,279.8,280.41,279.14,280.41,140920098,1522.033191\n2018-01-22T14:30:00Z,280.17,282.69,280.11,282.69,91322408,1541.289595\n2018-01-23T14:30:00Z,282.74,283.62,282.37,283.29,97084700,1545.942687\n2018-01-24T14:30:00Z,284.02,284.7,281.84,283.18,134816117,1544.756021\n2018-01-25T14:30:00Z,284.16,284.27,282.405,283.3,84587313,1543.048792\n2018-01-26T14:30:00Z,284.25,286.6285,283.96,286.58,107743119,1570.432398\n2018-01-29T14:30:00Z,285.93,286.43,284.5,284.68,90118337,1560.672978\n2018-01-30T14:30:00Z,282.6,284.736,281.22,281.76,131796419,1540.042101\n2018-01-31T14:30:00Z,282.73,283.3,280.68,281.9,118948131,1538.392587\n2018-02-01T14:30:00Z,281.07,283.06,280.68,281.58,90102470,1537.589567\n2018-02-02T14:30:00Z,280.08,280.23,275.41,275.45,173174790,1480.54313\n2018-02-05T14:30:00Z,273.45,275.85,263.31,263.93,294681820,1383.951028\n2018-02-06T14:30:00Z,259.94,269.7,258.7,269.13,355026780,1403.936338\n2018-02-07T14:30:00Z,268.5,272.36,267.58,267.67,167376100,1405.141455\n2018-02-08T14:30:00Z,268.01,268.17,257.59,257.63,246449505,1314.985024\n2018-02-09T14:30:00Z,260.8,263.61,252.92,261.5,283565310,1319.556674\n2018-02-12T14:30:00Z,263.83,267.01,261.6644,265.34,143735976,1348.875386\n2018-02-13T14:30:00Z,263.97,266.62,263.31,266,81223640,1355.937377\n2018-02-14T14:30:00Z,264.31,270,264.3,269.59,120735685,1383.071892\n2018-02-15T14:30:00Z,271.57,273.04,268.77,273.03,111200286,1404.248658\n2018-02-16T14:30:00Z,272.32,275.32,272.27,273.11,160420135,1407.769156\n2018-02-20T14:30:00Z,272.03,273.67,270.5,271.4,86369662,1398.916567\n2018-02-21T14:30:00Z,271.9,274.72,269.94,270.05,98883740,1388.693909\n2018-02-22T14:30:00Z,271.1,273.05,269.64,270.4,110511290,1386.454561\n2018-02-23T14:30:00Z,271.79,274.71,271.25,274.71,92766428,1423.576559\n2018-02-26T14:30:00Z,275.93,278.01,275.26,277.9,86491406,1450.518137\n2018-02-27T14:30:00Z,278.11,278.92,274.36,274.43,99099165,1429.422207\n2018-02-28T14:30:00Z,275.68,276.19,271.29,271.65,121907767,1410.151266\n2018-03-01T14:30:00Z,271.41,273.17,266,267.7,176855077,1380.733179\n2018-03-02T14:30:00Z,265.8,269.72,264.82,269.08,139083217,1387.1965\n2018-03-05T14:30:00Z,267.73,272.89,267.61,272.19,97307387,1411.243221\n2018-03-06T14:30:00Z,273.3,273.39,271.18,272.88,79213163,1414.840965\n2018-03-07T14:30:00Z,270.42,273.18,270.2,272.78,87063502,1420.134725\n2018-03-08T14:30:00Z,273.55,274.24,272.42,274.1,66901150,1428.407806\n2018-03-09T14:30:00Z,275.7,278.87,275.34,278.87,113625335,1473.552449\n2018-03-12T13:30:00Z,279.2,279.91,278.0801,278.52,71924793,1473.80651\n2018-03-13T13:30:00Z,279.84,280.41,276.03,276.72,91968937,1461.732747\n2018-03-14T13:30:00Z,277.81,278.02,274.67,275.3,105895079,1451.014299\n2018-03-15T13:30:00Z,275.88,276.61,274.43,275,83433038,1447.026265\n2018-03-16T13:30:00Z,274.5,275.39,274.14,274.2,100343673,1442.748204\n2018-03-19T13:30:00Z,273.35,273.38,268.62,270.49,109208442,1408.072679\n2018-03-20T13:30:00Z,270.94,271.67,270.18,270.95,59757271,1407.236512\n2018-03-21T13:30:00Z,270.9,273.27,270.19,270.43,78709578,1403.696771\n2018-03-22T13:30:00Z,267.91,268.87,263.36,263.67,148785916,1341.648073\n2018-03-23T13:30:00Z,264.17,265.02,257.83,258.05,183534751,1298.555952\n2018-03-26T13:30:00Z,262.13,265.43,259.41,265.11,141956102,1337.899512\n2018-03-27T13:30:00Z,266.17,266.77,258.84,260.6,129941445,1308.311256\n2018-03-28T13:30:00Z,260.75,262.64,258.58,259.83,146452306,1302.178862\n2018-03-29T13:30:00Z,261.12,265.26,259.8389,263.15,124244790,1326.811911\n2018-04-02T13:30:00Z,262.55,263.13,254.67,257.47,186286343,1281.280026\n2018-04-03T13:30:00Z,258.87,261.31,256.84,260.77,119956861,1293.739956\n2018-04-04T13:30:00Z,256.75,264.355,256.6,263.56,123715339,1314.862298\n2018-04-05T13:30:00Z,265.55,266.64,264.32,265.64,82652618,1331.598101\n2018-04-06T13:30:00Z,263.42,265.11,258,259.72,179521209,1281.588892\n2018-04-09T13:30:00Z,261.37,264.84,259.9356,261,105442932,1282.505149\n2018-04-10T13:30:00Z,264.27,266.04,262.98,265.15,105573736,1316.704606\n2018-04-11T13:30:00Z,263.47,265.64,263.39,263.76,91140243,1312.139829\n2018-04-12T13:30:00Z,265.26,267,265.06,265.93,68890480,1331.74335\n2018-04-13T13:30:00Z,267.41,267.54,264.01,265.15,85079176,1326.088177\n2018-04-16T13:30:00Z,267,268.2,266.07,267.33,63405287,1336.842932\n2018-04-17T13:30:00Z,269.33,270.87,268.75,270.19,64682036,1362.462352\n2018-04-18T13:30:00Z,270.69,271.3,269.87,270.39,57303857,1363.579943\n2018-04-19T13:30:00Z,269.65,269.88,267.72,268.89,77655909,1350.47791\n2018-04-20T13:30:00Z,268.81,269.06,265.61,266.61,99953133,1330.372141\n2018-04-23T13:30:00Z,267.26,267.89,265.35,266.57,65557954,1327.951429\n2018-04-24T13:30:00Z,267.73,267.9762,261.28,262.98,112885452,1298.408562\n2018-04-25T13:30:00Z,262.91,264.13,260.85,263.63,103840948,1297.879637\n2018-04-26T13:30:00Z,264.79,267.2452,264.29,266.31,67731942,1321.484018\n2018-04-27T13:30:00Z,267,267.34,265.5,266.56,57053647,1322.672926\n2018-04-30T13:30:00Z,267.26,267.89,264.43,264.51,82182324,1309.490941\n2018-05-01T13:30:00Z,263.87,265.1,262.11,264.98,74203365,1310.867555\n2018-05-02T13:30:00Z,264.76,265.68,262.76,263.2,86368943,1300.96304\n2018-05-03T13:30:00Z,262.26,263.36,259.05,262.62,136311479,1296.603332\n2018-05-04T13:30:00Z,261.52,266.7892,261.15,266.02,91222075,1322.709953\n2018-05-07T13:30:00Z,266.89,268.02,266.11,266.92,55304907,1330.989174\n2018-05-08T13:30:00Z,266.5,267.325,265.15,266.92,67499247,1332.091622\n2018-05-09T13:30:00Z,267.68,269.865,267.09,269.5,59666143,1354.408812\n2018-05-10T13:30:00Z,270.34,272.39,270.22,272.02,72063931,1377.493716\n2018-05-11T13:30:00Z,272.16,273.15,271.58,272.85,59871511,1383.154363\n2018-05-14T13:30:00Z,273.34,274.08,272.36,272.98,54790606,1383.651969\n2018-05-15T13:30:00Z,271.59,271.61,270.03,271.1,87036036,1366.310541\n2018-05-16T13:30:00Z,271.14,272.76,271.11,272.24,53942631,1375.459802\n2018-05-17T13:30:00Z,271.94,273.23,271.13,272.01,56536400,1375.693487\n2018-05-18T13:30:00Z,271.62,272.03,270.93,271.33,64367959,1370.81597\n2018-05-21T13:30:00Z,273.01,273.98,271.3512,273.37,58025875,1383.931486\n2018-05-22T13:30:00Z,273.96,274.25,272.24,272.61,52966358,1379.408123\n2018-05-23T13:30:00Z,271.17,273.39,270.99,273.36,64694184,1384.983808\n2018-05-24T13:30:00Z,272.91,273.22,270.78,272.8,76043827,1384.627819\n2018-05-25T13:30:00Z,272.15,272.86,271.58,272.15,56374755,1380.676815\n2018-05-29T13:30:00Z,270.31,271.17,267.76,269.02,115908607,1354.118722\n2018-05-30T13:30:00Z,270.5,273.11,270.42,272.61,69678449,1383.88139\n2018-05-31T13:30:00Z,272.15,272.49,270.255,270.94,93519941,1374.768541\n2018-06-01T13:30:00Z,272.41,273.94,272.33,273.6,71258411,1395.999366\n2018-06-04T13:30:00Z,274.53,275.185,274.26,274.9,45392351,1407.373209\n2018-06-05T13:30:00Z,275.05,275.53,274.18,275.1,51135038,1408.363677\n2018-06-06T13:30:00Z,275.79,277.52,275.09,277.4,62732215,1427.668564\n2018-06-07T13:30:00Z,277.95,278.28,276.34,277.37,72969402,1427.901888\n2018-06-08T13:30:00Z,276.85,278.25,276.66,278.19,72139719,1432.165577\n2018-06-11T13:30:00Z,278.44,279.37,278.31,278.56,58892515,1436.043154\n2018-06-12T13:30:00Z,279.03,279.33,278.19,278.92,72329028,1437.421092\n2018-06-13T13:30:00Z,279.19,279.48,277.8,278.03,79070610,1431.282\n2018-06-14T13:30:00Z,279.01,279.33,278.0599,278.73,77097620,1432.674813\n2018-06-15T13:30:00Z,276.6,277.51,275.35,277.13,120143175,1422.223889\n2018-06-18T13:30:00Z,275.49,276.7,274.95,276.56,52917581,1422.857232\n2018-06-19T13:30:00Z,274,275.75,273.53,275.5,97531510,1422.57898\n2018-06-20T13:30:00Z,276.27,276.72,275.59,275.97,53785486,1425.997932\n2018-06-21T13:30:00Z,275.96,275.98,273.68,274.24,71061404,1409.9378\n2018-06-22T13:30:00Z,275.66,275.785,274.49,274.74,56612003,1407.902158\n2018-06-25T13:30:00Z,273.44,273.6162,269.1,271,137854162,1373.436436\n2018-06-26T13:30:00Z,271.64,272.56,270.79,271.6,68683211,1373.313537\n2018-06-27T13:30:00Z,272.26,273.865,269.18,269.35,105110674,1361.345619\n2018-06-28T13:30:00Z,269.29,271.75,268.49,270.89,76650517,1367.41145\n2018-06-29T13:30:00Z,272.12,273.66,271.1495,271.28,97592499,1369.51839\n2018-07-02T13:30:00Z,269.51,272.04,269.24,271.86,63554774,1376.062825\n2018-07-03T13:30:00Z,272.87,272.98,270.42,270.9,42187071,1372.181173\n2018-07-05T13:30:00Z,272.17,273.18,270.96,273.11,56925919,1383.547399\n2018-07-06T13:30:00Z,273.14,275.84,272.715,275.42,66493696,1402.26029\n2018-07-09T13:30:00Z,276.55,277.96,276.5,277.9,50550399,1425.269774\n2018-07-10T13:30:00Z,278.41,279.01,278.08,278.9,51966829,1433.357136\n2018-07-11T13:30:00Z,277.15,278.04,276.52,276.86,77054739,1418.553909\n2018-07-12T13:30:00Z,278.28,279.43,277.6,279.37,60124687,1439.634836\n2018-07-13T13:30:00Z,279.17,279.93,278.66,279.59,48234964,1441.655804\n2018-07-16T13:30:00Z,279.64,279.803,278.84,279.34,48201038,1440.361036\n2018-07-17T13:30:00Z,278.47,280.91,278.41,280.47,52315500,1448.191983\n2018-07-18T13:30:00Z,280.56,281.18,280.06,281.06,44593465,1451.862508\n2018-07-19T13:30:00Z,280.31,280.74,279.46,280,61412117,1444.897651\n2018-07-20T13:30:00Z,279.77,280.48,279.5,279.68,82372729,1443.590027\n2018-07-23T13:30:00Z,279.45,280.43,279.06,280.2,47047565,1446.527078\n2018-07-24T13:30:00Z,281.79,282.56,280.63,281.61,68026935,1456.060037\n2018-07-25T13:30:00Z,281.33,284.37,281.28,284.01,78882927,1476.391376\n2018-07-26T13:30:00Z,283.2,284.11,283.09,283.34,57919495,1476.629542\n2018-07-27T13:30:00Z,283.71,283.82,280.38,281.42,76783177,1460.498607\n2018-07-30T13:30:00Z,281.51,281.69,279.36,279.95,63742508,1447.978473\n2018-07-31T13:30:00Z,280.81,282.02,280.38,281.33,68570493,1455.181981\n2018-08-01T13:30:00Z,281.56,282.13,280.1315,280.86,53853326,1452.75373\n2018-08-02T13:30:00Z,279.39,282.58,279.16,282.39,63426363,1461.290935\n2018-08-03T13:30:00Z,282.53,283.6577,282.33,283.6,53935386,1470.805397\n2018-08-06T13:30:00Z,283.64,284.99,283.2015,284.64,39400887,1478.442875\n2018-08-07T13:30:00Z,285.39,286.01,285.24,285.58,43196646,1486.778339\n2018-08-08T13:30:00Z,285.39,285.91,284.94,285.46,42114551,1486.630919\n2018-08-09T13:30:00Z,285.53,285.97,284.915,285.07,35716976,1484.717385\n2018-08-10T13:30:00Z,283.45,284.055,282.36,283.16,77076044,1468.857892\n2018-08-13T13:30:00Z,283.47,284.16,281.77,282.1,65732909,1462.445899\n2018-08-14T13:30:00Z,282.92,284.17,282.4833,283.9,43842031,1473.791007\n2018-08-15T13:30:00Z,282.38,282.54,280.16,281.78,102887320,1458.408064\n2018-08-16T13:30:00Z,283.4,285.04,283.36,284.06,69967919,1477.538789\n2018-08-17T13:30:00Z,283.83,285.5601,283.37,285.06,65618481,1484.624948\n2018-08-20T13:30:00Z,285.57,285.97,285.06,285.67,39807490,1489.144583\n2018-08-21T13:30:00Z,286.25,287.31,285.7135,286.34,67271983,1493.760436\n2018-08-22T13:30:00Z,285.88,286.76,285.575,286.17,44993333,1493.750537\n2018-08-23T13:30:00Z,285.97,286.94,285.43,285.79,49204851,1492.54171\n2018-08-24T13:30:00Z,286.44,287.67,286.38,287.51,57487399,1508.472692\n2018-08-27T13:30:00Z,288.86,289.9,288.68,289.78,57072377,1530.07711\n2018-08-28T13:30:00Z,290.3,290.4175,289.4,289.92,46943472,1530.652009\n2018-08-29T13:30:00Z,290.16,291.74,289.8854,291.48,61485514,1543.050386\n2018-08-30T13:30:00Z,290.94,291.36,289.63,290.3,61229501,1536.669195\n2018-08-31T13:30:00Z,289.84,290.81,289.29,290.31,66140838,1536.988577\n2018-09-04T13:30:00Z,289.84,290.21,288.68,289.81,57594367,1534.602992\n2018-09-05T13:30:00Z,289.41,289.64,287.89,289.03,72452437,1528.236642\n2018-09-06T13:30:00Z,289.15,289.49,287,288.16,65909863,1521.070781\n2018-09-07T13:30:00Z,286.98,288.7,286.71,287.6,73524824,1519.055767\n2018-09-10T13:30:00Z,288.74,289.04,287.88,288.1,50210903,1521.127932\n2018-09-11T13:30:00Z,287.37,289.55,286.975,289.05,50530492,1526.528983\n2018-09-12T13:30:00Z,289.06,289.8,288.23,289.12,59810758,1527.868179\n2018-09-13T13:30:00Z,290.32,291.0384,289.995,290.83,51034222,1543.738358\n2018-09-14T13:30:00Z,291.06,291.27,290,290.88,55079875,1544.063157\n2018-09-17T13:30:00Z,290.82,290.86,289.03,289.34,68244043,1529.801718\n2018-09-18T13:30:00Z,289.58,291.58,289.55,290.91,61930407,1540.224871\n2018-09-19T13:30:00Z,290.97,291.69,290.825,291.22,49080562,1543.349349\n2018-09-20T13:30:00Z,292.64,293.94,291.2363,293.58,100360646,1561.073321\n2018-09-21T13:30:00Z,293.09,293.22,291.81,291.99,105597145,1549.525889\n2018-09-24T13:30:00Z,291.34,291.5,290.37,291.02,53409645,1540.904298\n2018-09-25T13:30:00Z,291.53,291.65,290.4833,290.75,44370037,1538.567128\n2018-09-26T13:30:00Z,290.91,292.24,289.41,289.88,79739674,1533.703079\n2018-09-27T13:30:00Z,290.41,291.91,290.1,290.69,59249455,1537.738024\n2018-09-28T13:30:00Z,289.99,291.28,289.95,290.72,70091385,1539.274185\n2018-10-01T13:30:00Z,292.11,292.93,290.98,291.73,62078937,1545.39442\n2018-10-02T13:30:00Z,291.56,292.355,291.14,291.56,47258227,1544.604224\n2018-10-03T13:30:00Z,292.74,293.21,291.32,291.72,64694594,1542.694502\n2018-10-04T13:30:00Z,291.18,291.24,287.66,289.44,111545910,1521.491588\n2018-10-05T13:30:00Z,289.69,290.27,286.22,287.82,105961360,1508.074921\n2018-10-08T13:30:00Z,287.05,288.22,285.5,287.82,87742172,1507.699627\n2018-10-09T13:30:00Z,287.39,288.86,286.77,287.4,74338982,1507.059909\n2018-10-10T13:30:00Z,286.83,286.91,277.88,278.3,214756170,1421.36131\n2018-10-11T13:30:00Z,277.08,278.9,270.36,272.17,274840490,1371.527069\n2018-10-12T13:30:00Z,276.77,277.09,272.37,275.95,183186492,1382.421137\n2018-10-15T13:30:00Z,275.55,277.04,274.3,274.4,102263717,1374.262181\n2018-10-16T13:30:00Z,276.6,280.82,276.07,280.4,118255834,1426.27607\n2018-10-17T13:30:00Z,280.44,281.15,277.56,280.45,110625987,1430.20531\n2018-10-18T13:30:00Z,279.4,280.07,274.97,276.4,134557525,1394.305098\n2018-10-19T13:30:00Z,277.13,279.3,275.47,276.25,139901634,1389.00215\n2018-10-22T13:30:00Z,277,277.36,274.41,275.01,82415812,1380.095999\n2018-10-23T13:30:00Z,270.95,274.87,268.61,273.61,146352719,1376.771209\n2018-10-24T13:30:00Z,273.33,273.76,264.7,265.32,177806697,1310.175258\n2018-10-25T13:30:00Z,267.38,271.81,266.23,270.08,138061545,1330.904399\n2018-10-26T13:30:00Z,265.92,271,262.29,265.33,201574596,1308.233714\n2018-10-29T13:30:00Z,268.8,270.25,259.85,263.86,160749101,1294.960723\n2018-10-30T13:30:00Z,263.67,268.12,263.12,267.77,157115995,1315.137647\n2018-10-31T13:30:00Z,270.65,273.23,270.12,270.63,128296325,1340.040543\n2018-11-01T13:30:00Z,271.6,273.73,270.38,273.51,99495037,1362.15865\n2018-11-02T13:30:00Z,274.75,275.23,269.59,271.89,122634107,1351.856035\n2018-11-05T14:30:00Z,272.44,274.01,271.35,273.39,65622482,1356.802701\n2018-11-06T14:30:00Z,273.32,275.3,273.25,275.12,60085894,1371.766977\n2018-11-07T14:30:00Z,277.56,281.1,277.08,281.01,102752099,1427.07512\n2018-11-08T14:30:00Z,280.11,281.22,279.22,280.5,65584886,1429.214912\n2018-11-09T14:30:00Z,279.03,279.24,276.18,277.76,98812561,1405.850556\n2018-11-12T14:30:00Z,277.19,277.46,271.99,272.57,99673574,1358.369529\n2018-11-13T14:30:00Z,273.09,275.325,271.25,272.06,98176610,1351.192307\n2018-11-14T14:30:00Z,274.16,274.61,268.45,270.2,125335931,1336.78641\n2018-11-15T14:30:00Z,268.78,273.54,267.0102,273.02,135101437,1347.751628\n2018-11-16T14:30:00Z,271.79,274.75,271.21,273.73,126668040,1354.489943\n2018-11-19T14:30:00Z,273.05,273.38,268.07,269.1,103061706,1318.226124\n2018-11-20T14:30:00Z,265.36,267,263.15,264.12,136021311,1276.617181\n2018-11-21T14:30:00Z,265.86,267.15,265.01,265.02,75563743,1277.729227\n2018-11-23T14:30:00Z,263.18,264.8234,263.07,263.25,42807878,1266.231586\n2018-11-26T14:30:00Z,265.78,267.75,265.34,267.5,79981362,1307.761013\n2018-11-27T14:30:00Z,266.34,268.4,265.66,268.4,75502441,1316.322528\n2018-11-28T14:30:00Z,269.6,274.58,268.3272,274.58,127629633,1368.742904\n2018-11-29T14:30:00Z,273.71,275.55,272.43,273.98,82346420,1371.144107\n2018-11-30T14:30:00Z,273.81,276.28,273.45,275.65,98204190,1384.328425\n2018-12-03T14:30:00Z,280.28,280.4,277.505,279.3,103017719,1409.423288\n2018-12-04T14:30:00Z,278.37,278.85,269.9,270.25,177986013,1326.131754\n2018-12-06T14:30:00Z,265.92,269.97,262.44,269.84,204185411,1323.71629\n2018-12-07T14:30:00Z,269.46,271.22,262.63,263.57,161018923,1284.939938\n2018-12-10T14:30:00Z,263.37,265.1613,258.62,264.07,151445885,1282.53676\n2018-12-11T14:30:00Z,267.66,267.87,262.48,264.13,121504431,1276.00711\n2018-12-12T14:30:00Z,267.47,269,265.37,265.46,97976706,1272.700942\n2018-12-13T14:30:00Z,266.52,267.49,264.12,265.37,96662717,1268.875853\n2018-12-14T14:30:00Z,262.96,264.03,259.85,260.47,116961071,1225.679503\n2018-12-17T14:30:00Z,259.4,260.65,253.525,255.36,165492257,1182.24524\n2018-12-18T14:30:00Z,257.2,257.95,253.28,255.08,134515094,1175.547947\n2018-12-19T14:30:00Z,255.17,259.4,249.35,251.26,214992763,1154.205999\n2018-12-20T14:30:00Z,249.86,251.62,244.65,247.17,252053377,1120.872698\n2018-12-21T14:30:00Z,246.74,249.71,239.98,240.7,255345633,1076.971968\n2018-12-24T14:30:00Z,239.04,240.8355,234.27,234.34,147311588,1026.112424\n2018-12-26T14:30:00Z,235.97,246.18,233.76,246.18,218485360,1111.951335\n2018-12-27T14:30:00Z,242.57,248.29,238.96,248.07,186267342,1139.265584\n2018-12-28T14:30:00Z,249.58,251.4,246.45,247.75,153100189,1139.726256\n2018-12-31T14:30:00Z,249.56,250.19,247.47,249.92,144299370,1148.809065\n2019-01-02T14:30:00Z,245.98,251.21,245.95,250.18,126925199,1160.171798\n2019-01-03T14:30:00Z,248.23,248.57,243.67,244.21,144140692,1118.430218\n2019-01-04T14:30:00Z,247.59,253.11,247.17,252.39,142628834,1181.647948\n2019-01-07T14:30:00Z,252.69,255.95,251.69,254.38,103139100,1198.090943\n2019-01-08T14:30:00Z,256.82,257.31,254,256.77,102512587,1211.767056\n2019-01-09T14:30:00Z,257.56,258.91,256.19,257.97,95006554,1218.583044\n2019-01-10T14:30:00Z,256.26,259.16,255.5,258.88,96823923,1228.112239\n2019-01-11T14:30:00Z,257.68,259.0098,257.03,258.98,73858110,1234.277911\n2019-01-14T14:30:00Z,256.86,258.3,256.41,257.4,70908227,1228.085518\n2019-01-15T14:30:00Z,257.82,260.7,257.81,260.35,85208271,1255.862221\n2019-01-16T14:30:00Z,260.83,261.9666,260.6,260.98,77636710,1262.224335\n2019-01-17T14:30:00Z,260.01,263.92,259.96,262.96,96118435,1278.27804\n2019-01-18T14:30:00Z,264.98,266.98,262.998,266.46,127900303,1304.670292\n2019-01-22T14:30:00Z,264.82,265.06,261.06,262.86,115531183,1276.645144\n2019-01-23T14:30:00Z,264.01,264.79,260.66,263.41,86030287,1275.930859\n2019-01-24T14:30:00Z,263.21,264.2,262.08,263.55,59204139,1276.516762\n2019-01-25T14:30:00Z,265.61,266.7,263.6595,265.78,96883358,1291.374084\n2019-01-28T14:30:00Z,263.39,263.83,261.79,263.76,85613655,1276.754144\n2019-01-29T14:30:00Z,263.92,264.55,262.48,263.41,66136334,1274.85819\n2019-01-30T14:30:00Z,265.1,268.52,264.25,267.58,92473671,1309.878396\n2019-01-31T14:30:00Z,267.51,270.47,267.27,269.93,104012073,1329.643121\n2019-02-01T14:30:00Z,270.15,271.2,269.18,270.06,85782524,1331.72955\n2019-02-04T14:30:00Z,270.11,272.03,269.36,271.96,60744844,1344.545067\n2019-02-05T14:30:00Z,272.44,273.44,271.88,273.1,79552774,1353.383448\n2019-02-06T14:30:00Z,272.79,273.34,271.92,272.74,58347791,1352.359789\n2019-02-07T14:30:00Z,270.94,271.55,268.29,270.14,95481961,1330.695883\n2019-02-08T14:30:00Z,268.75,270.58,267.83,270.47,75788861,1335.54101\n2019-02-11T14:30:00Z,271.2,271.49,270.03,270.62,68021423,1336.519185\n2019-02-12T14:30:00Z,272.42,274.52,272.34,274.1,72270221,1368.470715\n2019-02-13T14:30:00Z,275.03,275.93,274.56,274.99,65277204,1375.774861\n2019-02-14T14:30:00Z,273.78,275.64,272.87,274.38,83234396,1374.249681\n2019-02-15T14:30:00Z,276.36,277.41,276.13,277.37,97088659,1404.196401\n2019-02-19T14:30:00Z,276.4813,278.58,276.47,277.85,59120804,1408.73182\n2019-02-20T14:30:00Z,277.81,278.92,277.25,278.41,76610767,1412.72727\n2019-02-21T14:30:00Z,277.7,278.1,276.345,277.42,64214727,1406.587404\n2019-02-22T14:30:00Z,278.11,279.36,277.4029,279.14,78114616,1419.537246\n2019-02-25T14:30:00Z,280.73,281.31,279.43,279.52,69030699,1419.730359\n2019-02-26T14:30:00Z,279.13,280.3,278.9,279.32,56844101,1418.563509\n2019-02-27T14:30:00Z,278.52,279.59,277.48,279.2,56921570,1419.989349\n2019-02-28T14:30:00Z,278.96,279.45,278.32,278.68,69268293,1417.916272\n2019-03-01T14:30:00Z,280.44,280.88,278.82,280.42,78880548,1428.291272\n2019-03-04T14:30:00Z,281.6,281.87,276.84,279.4,106494637,1418.848\n2019-03-05T14:30:00Z,279.54,279.76,278.41,279.02,59114559,1414.972671\n2019-03-06T14:30:00Z,279.15,279.16,276.97,277.33,75039771,1399.895893\n2019-03-07T14:30:00Z,276.83,276.99,274.07,275.01,94885089,1378.716239\n2019-03-08T14:30:00Z,272.94,274.65,272.42,274.46,85795799,1377.331967\n2019-03-11T13:30:00Z,275.26,278.62,275.23,278.44,65098897,1414.564218\n2019-03-12T13:30:00Z,279.06,280.07,278.85,279.49,79667530,1424.017483\n2019-03-13T13:30:00Z,280.48,282.38,280.3,281.34,80639153,1440.651705\n2019-03-14T13:30:00Z,281.37,281.84,280.6662,281.16,67518366,1440.439444\n2019-03-15T13:30:00Z,280.54,282.21,280.33,281.31,81308979,1442.077947\n2019-03-18T13:30:00Z,281.55,282.66,281.3,282.33,62199806,1450.787186\n2019-03-19T13:30:00Z,283.51,284.36,281.41,282.4,90268121,1449.617273\n2019-03-20T13:30:00Z,282.16,283.5,280.32,281.55,84609210,1444.231156\n2019-03-21T13:30:00Z,280.64,285.18,280.59,284.73,79550375,1468.497333\n2019-03-22T13:30:00Z,283.22,283.8034,279.18,279.25,122659286,1431.917385\n2019-03-25T13:30:00Z,278.87,280.1853,277.64,279.04,85575197,1428.7389\n2019-03-26T13:30:00Z,280.99,282.18,279.56,281.12,68125920,1443.428271\n2019-03-27T13:30:00Z,281.11,281.76,277.93,279.65,72224722,1432.240043\n2019-03-28T13:30:00Z,280.35,281.21,279.07,280.71,56238545,1435.645732\n2019-03-29T13:30:00Z,282.39,282.84,281.14,282.48,82186806,1448.294267\n2019-04-01T13:30:00Z,284.7,286.16,284.4,285.83,77617945,1481.316145\n2019-04-02T13:30:00Z,286.04,286.23,285.09,285.97,40070351,1482.57603\n2019-04-03T13:30:00Z,287.32,287.76,285.75,286.42,68243202,1482.479467\n2019-04-04T13:30:00Z,286.78,287.459,286.01,287.18,48997505,1485.330666\n2019-04-05T13:30:00Z,287.92,288.63,287.6,288.57,58621729,1497.605619\n2019-04-08T13:30:00Z,288.1,288.91,287.37,288.79,53566335,1500.810465\n2019-04-09T13:30:00Z,287.72,288.08,286.7,287.31,66142316,1490.452913\n2019-04-10T13:30:00Z,287.77,288.3899,287.31,288.29,52601499,1496.945989\n2019-04-11T13:30:00Z,288.83,288.84,287.578,288.21,55093100,1496.114811\n2019-04-12T13:30:00Z,290,290.47,288.261,290.16,69727782,1507.198458\n2019-04-15T13:30:00Z,290.24,290.35,289.075,289.97,49596685,1505.728758\n2019-04-16T13:30:00Z,290.95,291.01,289.5,290.16,52153197,1504.605937\n2019-04-17T13:30:00Z,291.4,291.425,288.99,289.45,58268295,1498.95218\n2019-04-18T13:30:00Z,290.1,290.32,288.66,290.02,68708513,1499.05979\n2019-04-22T13:30:00Z,289.17,290.435,289.07,290.27,40160140,1502.403653\n2019-04-23T13:30:00Z,290.68,293.14,290.42,292.88,52246633,1525.687346\n2019-04-24T13:30:00Z,292.79,293.16,292.07,292.23,50392914,1524.514328\n2019-04-25T13:30:00Z,292.12,292.78,290.73,292.05,57770862,1522.994636\n2019-04-26T13:30:00Z,292.1,293.49,291.2401,293.41,50916423,1530.923321\n2019-04-29T13:30:00Z,293.51,294.45,293.41,293.87,57197747,1535.522041\n2019-04-30T13:30:00Z,293.49,294.34,291.92,294.02,81112081,1537.974108\n2019-05-01T13:30:00Z,294.72,294.95,291.8,291.81,71671870,1523.042368\n2019-05-02T13:30:00Z,291.68,292.7,289.52,291.18,65030170,1517.154372\n2019-05-03T13:30:00Z,292.82,294.34,291.2998,294.03,56543653,1537.546763\n2019-05-06T13:30:00Z,289.25,293.31,288.9,292.82,107198069,1543.093307\n2019-05-07T13:30:00Z,290.15,290.81,285.81,287.93,144729908,1510.650778\n2019-05-08T13:30:00Z,287.53,289.43,286.87,287.53,91568287,1507.77658\n2019-05-09T13:30:00Z,285.23,287.33,283.3,286.66,103471104,1506.784374\n2019-05-10T13:30:00Z,285.62,288.94,282.3,288.1,112429293,1518.613152\n2019-05-13T13:30:00Z,282.42,283.49,279.93,280.86,127290527,1460.345997\n2019-05-14T13:30:00Z,281.99,285.1,281.85,283.4,77003230,1478.642853\n2019-05-15T13:30:00Z,281.59,285.77,281.36,285.06,73956407,1490.298463\n2019-05-16T13:30:00Z,285.84,289.21,285.76,287.7,76749643,1514.957843\n2019-05-17T13:30:00Z,285.14,288.6,285.1207,285.84,100353024,1510.686857\n2019-05-20T13:30:00Z,284.06,285.43,283.12,283.95,62877610,1499.500983\n2019-05-21T13:30:00Z,285.83,286.93,285.55,286.51,46847085,1523.736685\n2019-05-22T13:30:00Z,285.45,286.69,285.1,285.63,49482472,1520.632282\n2019-05-23T13:30:00Z,283.16,283.21,280.57,282.14,98733847,1488.520119\n2019-05-24T13:30:00Z,283.74,284.2,282.09,282.78,55268095,1488.002941\n2019-05-28T13:30:00Z,283.09,284.15,280.13,280.15,70029356,1471.129408\n2019-05-29T13:30:00Z,278.91,279.36,276.71,278.27,104972927,1454.435625\n2019-05-30T13:30:00Z,279.11,280.04,277.805,279.03,62523780,1457.022264\n2019-05-31T13:30:00Z,276.2,277.12,275.24,275.27,86862782,1421.802146\n2019-06-03T13:30:00Z,275.31,276.5521,273.09,274.57,96427952,1416.998767\n2019-06-04T13:30:00Z,277.12,280.68,276.62,280.53,77231889,1471.20038\n2019-06-05T13:30:00Z,282.33,282.99,280.32,282.96,71169717,1486.90274\n2019-06-06T13:30:00Z,283.29,285.55,282.57,284.8,69430381,1501.103885\n2019-06-07T13:30:00Z,285.93,288.85,285.74,287.65,74272199,1527.247876\n2019-06-10T13:30:00Z,289.37,290.82,288.8734,288.97,60799053,1537.524413\n2019-06-11T13:30:00Z,290.99,291.4,288.1805,288.9,58641325,1531.9655\n2019-06-12T13:30:00Z,288.64,289.26,287.815,288.39,47096312,1527.976022\n2019-06-13T13:30:00Z,289.4,289.98,288.62,289.58,48945156,1535.84523\n2019-06-14T13:30:00Z,289.26,289.93,288.41,289.26,52324716,1534.560286\n2019-06-17T13:30:00Z,289.52,290.22,289.18,289.37,39205709,1534.762209\n2019-06-18T13:30:00Z,291.39,293.57,290.99,292.4,85434823,1561.548314\n2019-06-19T13:30:00Z,292.55,293.65,291.47,293.06,78674377,1565.297993\n2019-06-20T13:30:00Z,296.04,296.3093,293.1255,295.86,116570017,1582.529883\n2019-06-21T13:30:00Z,294.13,295.52,293.76,294,83309466,1569.438111\n2019-06-24T13:30:00Z,294.23,294.58,293.47,293.64,47582730,1567.256766\n2019-06-25T13:30:00Z,293.7,293.73,290.64,290.76,82028656,1541.209468\n2019-06-26T13:30:00Z,291.75,292.31,290.345,290.47,51584902,1535.23551\n2019-06-27T13:30:00Z,291.31,292.06,290.89,291.5,40355239,1539.941208\n2019-06-28T13:30:00Z,292.58,293.55,292.01,293,59350929,1552.16263\n2019-07-01T13:30:00Z,296.68,296.92,294.33,295.66,79107474,1568.605338\n2019-07-02T13:30:00Z,295.61,296.49,294.68,296.43,61504544,1571.348982\n2019-07-03T13:30:00Z,297.18,298.82,297.02,298.8,40898896,1593.333085\n2019-07-05T13:30:00Z,297.44,298.64,296.01,298.46,51677326,1596.551886\n2019-07-08T13:30:00Z,297.01,298.2579,296.22,296.82,45841772,1587.896734\n2019-07-09T13:30:00Z,295.54,297.52,295.48,297.19,41101279,1592.500477\n2019-07-10T13:30:00Z,298.37,299.66,297.78,298.61,58595558,1604.14945\n2019-07-11T13:30:00Z,299.32,299.58,298.2,299.31,50889481,1607.328052\n2019-07-12T13:30:00Z,299.85,300.73,299.51,300.65,40354410,1618.988024\n2019-07-15T13:30:00Z,301.13,301.13,300.19,300.75,33910261,1619.277498\n2019-07-16T13:30:00Z,300.65,300.88,299.44,299.71,40567964,1610.716626\n2019-07-17T13:30:00Z,299.75,299.93,297.74,297.74,44102443,1594.418431\n2019-07-18T13:30:00Z,297.19,299.25,296.7,298.83,51701687,1598.770038\n2019-07-19T13:30:00Z,300.04,300.07,296.96,297.17,71081238,1589.854999\n2019-07-22T13:30:00Z,297.61,298.5,297.04,297.9,43687404,1590.456247\n2019-07-23T13:30:00Z,299.14,300.03,298.22,300.03,44657973,1607.711985\n2019-07-24T13:30:00Z,299.19,301.44,299.09,301.44,47213232,1617.158231\n2019-07-25T13:30:00Z,300.94,301,299.11,300,55394092,1609.81568\n2019-07-26T13:30:00Z,300.76,302.23,300.62,302.01,45084077,1625.337721\n2019-07-29T13:30:00Z,301.88,301.93,300.85,301.46,38126462,1623.072887\n2019-07-30T13:30:00Z,299.91,301.17,299.49,300.72,45849045,1620.265892\n2019-07-31T13:30:00Z,300.99,301.2,295.2,297.43,104245162,1593.191527\n2019-08-01T13:30:00Z,297.6,300.87,293.96,294.84,142646576,1579.678547\n2019-08-02T13:30:00Z,293.85,294.12,290.9,292.62,116749695,1559.349946\n2019-08-05T13:30:00Z,288.09,288.21,281.72,283.82,178745449,1474.274099\n2019-08-06T13:30:00Z,285.91,288.04,284.28,287.8,120711682,1494.391066\n2019-08-07T13:30:00Z,284.4,288.82,282.04,287.97,140572265,1506.440704\n2019-08-08T13:30:00Z,289.62,293.62,289.01,293.62,87713904,1556.529045\n2019-08-09T13:30:00Z,292.58,293.24,289.65,291.62,93729958,1548.846513\n2019-08-12T13:30:00Z,289.96,291.6052,287.02,288.07,65527632,1520.677153\n2019-08-13T13:30:00Z,287.74,294.15,287.36,292.55,94792972,1554.229649\n2019-08-14T13:30:00Z,288.07,288.74,283.76,283.9,135622053,1489.476423\n2019-08-15T13:30:00Z,284.88,285.64,282.39,284.65,101929845,1488.444026\n2019-08-16T13:30:00Z,286.48,289.33,284.7138,288.85,85825286,1521.559755\n2019-08-19T13:30:00Z,292.19,293.08,291.44,292.33,53640153,1552.606486\n2019-08-20T13:30:00Z,291.77,292.36,289.95,290.09,51652752,1534.081179\n2019-08-21T13:30:00Z,292.48,292.86,291.72,292.45,49723430,1548.113416\n2019-08-22T13:30:00Z,293.23,293.93,290.4,292.36,51739292,1546.18475\n2019-08-23T13:30:00Z,290.92,292.76,283.47,284.85,149318151,1483.287942\n2019-08-26T13:30:00Z,287.27,288,285.58,288,72620598,1492.428158\n2019-08-27T13:30:00Z,289.54,289.95,286.03,286.87,68262998,1485.577876\n2019-08-28T13:30:00Z,286.14,289.07,285.25,288.89,59852324,1493.935119\n2019-08-29T13:30:00Z,291.72,293.16,290.61,292.58,57998913,1525.246932\n2019-08-30T13:30:00Z,294.22,294.2399,291.42,292.45,62961780,1522.512246\n2019-09-03T13:30:00Z,290.57,291.58,289.27,290.74,69252354,1509.620775\n2019-09-04T13:30:00Z,293.14,294.055,292.31,294.04,47003957,1540.165327\n2019-09-05T13:30:00Z,296.79,298.83,296.64,297.82,83356779,1576.589957\n2019-09-06T13:30:00Z,298.17,298.76,297.42,298.05,49584290,1578.16214\n2019-09-09T13:30:00Z,299.14,299.24,297.16,298.2,51260290,1576.928431\n2019-09-10T13:30:00Z,297.36,298.2,295.97,298.13,57947101,1577.380764\n2019-09-11T13:30:00Z,298.47,300.34,297.75,300.25,68821066,1593.27817\n2019-09-12T13:30:00Z,301.25,302.46,300.41,301.29,72908745,1601.351107\n2019-09-13T13:30:00Z,301.78,302.17,300.68,301.09,62104838,1599.38944\n2019-09-16T13:30:00Z,299.84,301.1378,299.45,300.16,58191175,1594.196393\n2019-09-17T13:30:00Z,299.94,301.02,299.75,300.92,42904427,1599.491763\n2019-09-18T13:30:00Z,300.49,301.22,298.24,301.1,74192091,1603.283236\n2019-09-19T13:30:00Z,301.53,302.63,300.7103,301.08,78099215,1602.85638\n2019-09-20T13:30:00Z,300.36,300.67,297.41,298.28,97455979,1577.51453\n2019-09-23T13:30:00Z,297.55,299,297.27,298.21,47541321,1576.785086\n2019-09-24T13:30:00Z,299.41,299.84,294.81,295.87,97367568,1560.648175\n2019-09-25T13:30:00Z,295.96,298.11,294.33,297.62,73434081,1565.734992\n2019-09-26T13:30:00Z,297.63,297.86,295.45,297,58722357,1563.238532\n2019-09-27T13:30:00Z,297.83,297.9465,293.69,295.4,84781110,1549.307042\n2019-09-30T13:30:00Z,295.97,297.55,295.92,296.77,52562761,1555.561735\n2019-10-01T13:30:00Z,297.74,298.455,293,293.24,89900420,1532.311735\n2019-10-02T13:30:00Z,291.5,291.51,286.64,288.06,124523974,1484.05645\n2019-10-03T13:30:00Z,287.81,290.45,284.82,290.42,85906799,1492.808569\n2019-10-04T13:30:00Z,291.14,294.63,290.82,294.35,66700681,1527.727302\n2019-10-07T13:30:00Z,293.47,295.26,292.77,293.08,60656561,1525.740305\n2019-10-08T13:30:00Z,291.04,291.85,288.49,288.53,101575470,1484.161921\n2019-10-09T13:30:00Z,290.75,292.3,288.6559,291.27,65707329,1497.058769\n2019-10-10T13:30:00Z,291.18,294.21,291,293.24,57255974,1514.278455\n2019-10-11T13:30:00Z,296.27,298.74,296.1448,296.28,101228577,1541.099785\n2019-10-14T13:30:00Z,295.93,296.67,295.57,295.95,40546668,1539.821865\n2019-10-15T13:30:00Z,297.1,299.7,296.97,298.88,47832356,1567.448502\n2019-10-16T13:30:00Z,298.37,299.16,297.92,298.4,50563596,1567.377286\n2019-10-17T13:30:00Z,299.68,300.24,298.515,299.28,46784885,1571.794185\n2019-10-18T13:30:00Z,298.69,299.395,296.99,297.97,64338028,1561.681161\n2019-10-21T13:30:00Z,299.42,300.21,298.935,299.99,39460901,1577.036\n2019-10-22T13:30:00Z,300.58,300.9,298.91,299.01,49126038,1571.900302\n2019-10-23T13:30:00Z,298.73,299.94,298.495,299.88,34991829,1575.229639\n2019-10-24T13:30:00Z,300.91,301.07,299.4601,300.37,35857459,1577.218957\n2019-10-25T13:30:00Z,299.74,302.2,299.6806,301.6,45205412,1585.944445\n2019-10-28T13:30:00Z,302.94,303.85,302.91,303.3,42146965,1601.952485\n2019-10-29T13:30:00Z,303,304.23,302.86,303.21,44284921,1602.370508\n2019-10-30T13:30:00Z,303.43,304.55,301.99,304.14,49643928,1606.658187\n2019-10-31T13:30:00Z,304.13,304.13,301.73,303.33,69053791,1600.636103\n2019-11-01T13:30:00Z,304.92,306.19,304.74,306.14,71141515,1625.076655\n2019-11-04T14:30:00Z,307.85,308,306.96,307.37,60606916,1633.654647\n2019-11-05T14:30:00Z,307.59,307.9195,306.71,307.03,43033885,1631.358671\n2019-11-06T14:30:00Z,307.03,307.4,306.06,307.1,46487108,1631.215301\n2019-11-07T14:30:00Z,308.57,309.65,307.66,308.18,54272274,1637.503211\n2019-11-08T14:30:00Z,307.8,309.0036,307.03,308.94,49068797,1641.780452\n2019-11-11T14:30:00Z,307.42,308.54,307.27,308.35,35934909,1642.732019\n2019-11-12T14:30:00Z,308.75,309.99,308.15,309,46484624,1647.714829\n2019-11-13T14:30:00Z,307.91,309.54,307.66,309.1,54459018,1650.980756\n2019-11-14T14:30:00Z,308.79,309.64,308.09,309.55,52001874,1654.833175\n2019-11-15T14:30:00Z,311.02,311.84,310.26,311.79,62706192,1673.793028\n2019-11-18T14:30:00Z,311.53,312.28,311.03,312.02,49327980,1675.991035\n2019-11-19T14:30:00Z,312.68,312.69,311.22,311.93,67927818,1674.915681\n2019-11-20T14:30:00Z,311.28,311.85,309.06,310.77,79696276,1665.389636\n2019-11-21T14:30:00Z,310.89,311.01,309.39,310.27,54664690,1660.76249\n2019-11-22T14:30:00Z,311.09,311.24,309.85,310.96,44850228,1662.606745\n2019-11-25T14:30:00Z,311.98,313.37,311.98,313.37,48762676,1686.554756\n2019-11-26T14:30:00Z,313.41,314.28,313.06,314.08,37727953,1691.607288\n2019-11-27T14:30:00Z,314.61,315.48,314.37,315.48,44793179,1703.924951\n2019-11-29T14:30:00Z,314.86,315.13,314.06,314.31,36592740,1696.476019\n2019-12-02T14:30:00Z,314.59,314.66,311.17,311.64,76110027,1673.307428\n2019-12-03T14:30:00Z,308.65,309.64,307.13,309.55,75172709,1657.529728\n2019-12-04T14:30:00Z,310.7,312.12,310.32,311.46,49190402,1674.292047\n2019-12-05T14:30:00Z,312.23,312.25,310.58,312.02,40781669,1676.199305\n2019-12-06T14:30:00Z,314.12,315.31,314.11,314.87,48956767,1704.593007\n2019-12-09T14:30:00Z,314.44,315.18,313.8,313.88,34904315,1699.974686\n2019-12-10T14:30:00Z,313.82,314.55,312.81,313.53,53109165,1697.715876\n2019-12-11T14:30:00Z,314.03,314.7,313.4393,314.42,53521450,1703.269361\n2019-12-12T14:30:00Z,314.43,317.99,314.17,317.13,96585802,1726.948804\n2019-12-13T14:30:00Z,316.87,318.67,316.02,317.32,81546487,1730.104067\n2019-12-16T14:30:00Z,319.22,320.15,317.2542,319.5,82836128,1744.406113\n2019-12-17T14:30:00Z,319.92,320.25,319.48,319.57,61131769,1744.210801\n2019-12-18T14:30:00Z,320,320.25,319.53,319.59,48199955,1742.77659\n2019-12-19T14:30:00Z,319.8,320.98,319.5246,320.9,85388424,1752.577143\n2019-12-20T14:30:00Z,320.46,321.9742,319.3873,320.73,149338215,1753.36999\n2019-12-23T14:30:00Z,321.59,321.65,321.06,321.22,53015641,1755.974094\n2019-12-24T14:30:00Z,321.47,321.52,320.9,321.23,20270007,1755.405673\n2019-12-26T14:30:00Z,321.65,322.95,321.64,322.94,31024188,1771.069958\n2019-12-27T14:30:00Z,323.74,323.8,322.28,322.86,42554820,1770.493805\n2019-12-30T14:30:00Z,322.95,323.1,320.55,321.08,49782730,1755.196309\n2019-12-31T14:30:00Z,320.53,322.13,320.15,321.86,57106998,1757.817287\n2020-01-02T14:30:00Z,323.54,324.89,322.53,324.87,59253833,1782.884845\n2020-01-03T14:30:00Z,321.16,323.64,321.1,322.41,77783566,1772.733546\n2020-01-06T14:30:00Z,320.49,323.73,320.36,323.64,55761948,1783.580245\n2020-01-07T14:30:00Z,323.02,323.54,322.24,322.73,42854811,1782.485216\n2020-01-08T14:30:00Z,322.94,325.78,322.67,324.45,68434153,1796.875681\n2020-01-09T14:30:00Z,326.16,326.73,325.52,326.65,48569601,1815.825328\n2020-01-10T14:30:00Z,327.2899,327.46,325.2,325.71,53057389,1809.710946\n2020-01-13T14:30:00Z,326.39,327.96,325.92,327.95,47262010,1824.244322\n2020-01-14T14:30:00Z,327.47,328.62,326.844,327.45,63036384,1823.861358\n2020-01-15T14:30:00Z,327.35,329.02,327.26,328.19,72056598,1830.28257\n2020-01-16T14:30:00Z,329.7,330.92,329.45,330.92,54050328,1856.50416\n2020-01-17T14:30:00Z,331.7,332.18,330.8539,331.95,95846017,1863.553084\n2020-01-21T14:30:00Z,330.9,332.18,330.82,331.3,77742415,1861.629205\n2020-01-22T14:30:00Z,332.24,332.95,331.17,331.34,48914899,1859.928739\n2020-01-23T14:30:00Z,330.63,332.1682,329.41,331.72,52004140,1862.759173\n2020-01-24T14:30:00Z,332.44,332.53,327.36,328.77,87578442,1840.165581\n2020-01-27T14:30:00Z,323.03,325.12,322.66,323.5,84062463,1796.472915\n2020-01-28T14:30:00Z,325.06,327.85,323.6038,326.89,63833953,1823.7029\n2020-01-29T14:30:00Z,328.38,328.63,326.4,326.62,54040889,1820.90069\n2020-01-30T14:30:00Z,324.36,327.91,323.54,327.68,75491844,1830.02543\n2020-01-31T14:30:00Z,327,327.17,320.73,321.73,113845576,1785.260273\n2020-02-03T14:30:00Z,323.35,326.16,323.22,324.12,69242293,1793.327145\n2020-02-04T14:30:00Z,328.07,330.01,327.72,329.06,62573190,1841.701306\n2020-02-05T14:30:00Z,332.27,333.09,330.67,332.86,65951146,1873.199281\n2020-02-06T14:30:00Z,333.91,334.19,332.8,333.98,50359688,1880.241253\n2020-02-07T14:30:00Z,332.82,333.9941,331.6,332.2,64139443,1867.457857\n2020-02-10T14:30:00Z,331.23,334.75,331.19,334.68,42070006,1884.832521\n2020-02-11T14:30:00Z,336.16,337.02,334.684,335.26,54864533,1889.367847\n2020-02-12T14:30:00Z,336.83,337.65,336.43,337.42,43992662,1905.777022\n2020-02-13T14:30:00Z,335.8621,338.12,335.56,337.06,54501922,1907.436295\n2020-02-14T14:30:00Z,337.51,337.73,336.2,337.6,64582210,1910.034884\n2020-02-18T14:30:00Z,336.51,337.6677,335.21,336.73,57342526,1905.593143\n2020-02-19T14:30:00Z,337.79,339.08,337.48,338.34,48814692,1919.629473\n2020-02-20T14:30:00Z,337.7423,338.64,333.6817,336.95,74163362,1910.210066\n2020-02-21T14:30:00Z,335.47,335.81,332.58,333.48,113788208,1878.354676\n2020-02-24T14:30:00Z,323.14,325.85,321.24,322.42,161088409,1776.176055\n2020-02-25T14:30:00Z,323.94,324.61,311.69,312.65,218913168,1696.340964\n2020-02-26T14:30:00Z,314.18,318.11,310.7,311.5,194773819,1678.623978\n2020-02-27T14:30:00Z,305.46,311.5637,297.51,297.51,284353460,1567.959008\n2020-02-28T14:30:00Z,288.7,297.892,285.54,296.26,385764020,1570.789357\n2020-03-02T14:30:00Z,298.21,309.16,294.46,309.09,238703625,1668.76404\n2020-03-03T14:30:00Z,309.5,313.84,297.57,300.24,300139150,1627.967832\n2020-03-04T14:30:00Z,306.12,313.1,303.33,312.86,176613448,1708.608193\n2020-03-05T14:30:00Z,304.98,308.47,300.01,302.46,186366809,1643.687837\n2020-03-06T14:30:00Z,293.15,298.78,290.23,297.46,228667168,1619.584361\n2020-03-09T13:30:00Z,275.3,284.19,273.45,274.23,309417350,1435.081287\n2020-03-10T13:30:00Z,284.64,288.52,273.5,288.42,276444060,1527.460937\n2020-03-11T13:30:00Z,280.7,281.94,270.88,274.36,256416563,1410.35742\n2020-03-12T13:30:00Z,256,266.66,247.68,248.11,392220670,1193.305812\n2020-03-13T13:30:00Z,263.09,271.4754,248.5237,269.32,329566100,1323.193716\n2020-03-16T13:30:00Z,241.18,256.9,237.36,239.85,297240030,1114.153869\n2020-03-17T13:30:00Z,245.04,256.17,237.07,252.8,262070471,1200.748234\n2020-03-18T13:30:00Z,236.25,248.37,228.02,240,327597130,1143.961787\n2020-03-19T13:30:00Z,239.25,247.38,232.22,240.51,289322040,1150.237199\n2020-03-20T13:30:00Z,242.53,244.47,228.5,228.8,347158790,1066.071325\n2020-03-23T13:30:00Z,228.19,229.6833,218.26,222.95,326025170,1013.292129\n2020-03-24T13:30:00Z,234.42,244.1,233.8,243.15,235494475,1193.745332\n2020-03-25T13:30:00Z,244.87,256.35,239.75,246.79,299430255,1223.536693\n2020-03-26T13:30:00Z,249.52,262.8,249.05,261.2,257632816,1358.581981\n2020-03-27T13:30:00Z,253.27,260.81,251.05,253.42,224341217,1335.005404\n2020-03-30T13:30:00Z,255.7,262.43,253.53,261.65,170961866,1405.40777\n2020-03-31T13:30:00Z,260.56,263.33,256.22,257.75,194881060,1390.338691\n2020-04-01T13:30:00Z,247.98,257.6591,243.9,246.15,189554623,1311.470841\n2020-04-02T13:30:00Z,245.19,252.68,244.59,251.83,177660430,1352.259467\n2020-04-03T13:30:00Z,250.76,253.32,245.22,248.19,135561171,1338.439251\n2020-04-06T13:30:00Z,257.84,267,248.1698,264.86,188061238,1456.392968\n2020-04-07T13:30:00Z,274.21,275.03,264.89,265.13,201427189,1442.97066\n2020-04-08T13:30:00Z,267.96,276,265.2542,274.03,153774487,1493.178716\n2020-04-09T13:30:00Z,277.58,281.2,275.47,278.2,190282705,1526.911125\n2020-04-13T13:30:00Z,277.14,277.51,271.41,275.66,115139268,1506.817612\n2020-04-14T13:30:00Z,280.98,284.9,275.5106,283.79,134143350,1561.050326\n2020-04-15T13:30:00Z,277.57,279.26,275.46,277.76,121775006,1520.796609\n2020-04-16T13:30:00Z,279.15,280.03,275.76,279.1,131798325,1525.273845\n2020-04-17T13:30:00Z,285.38,287.3,282.4,286.64,146684784,1588.980036\n2020-04-20T13:30:00Z,282.61,286.7912,281.35,281.59,100224647,1558.85377\n2020-04-21T13:30:00Z,276.73,278.04,272.02,273.04,126385698,1479.722947\n2020-04-22T13:30:00Z,278.35,281,276.91,279.1,93524584,1519.197128\n2020-04-23T13:30:00Z,280.49,283.94,278.75,279.08,104709693,1516.173534\n2020-04-24T13:30:00Z,280.73,283.7,278.5,282.97,85165953,1540.394212\n2020-04-27T13:30:00Z,285.12,288.27,284.62,287.05,77896608,1577.269212\n2020-04-28T13:30:00Z,291.02,291.4,285.4,285.73,105283871,1562.663663\n2020-04-29T13:30:00Z,291.53,294.88,290.41,293.21,118745579,1611.869877\n2020-04-30T13:30:00Z,291.71,293.3239,288.59,290.48,122901701,1595.482408\n2020-05-01T13:30:00Z,285.31,290.6572,281.52,282.79,125180028,1540.592364\n2020-05-04T13:30:00Z,280.74,283.9,279.13,283.57,80873213,1547.221878\n2020-05-05T13:30:00Z,286.64,289.25,283.7134,286.19,79569938,1564.660484\n2020-05-06T13:30:00Z,288.04,288.46,283.78,284.25,73632628,1552.253761\n2020-05-07T13:30:00Z,287.75,289.78,287.13,287.68,75250412,1569.046162\n2020-05-08T13:30:00Z,291.09,292.95,289.86,292.44,76622128,1611.55692\n2020-05-11T13:30:00Z,290.34,294,289.88,292.5,79514231,1616.860341\n2020-05-12T13:30:00Z,293.79,294.24,286.52,286.67,95870786,1576.815698\n2020-05-13T13:30:00Z,286.06,287.19,278.965,281.6,144721099,1533.111675\n2020-05-14T13:30:00Z,278.95,285.11,276.37,284.97,121977890,1550.57486\n2020-05-15T13:30:00Z,282.37,286.33,281.34,286.28,111146276,1567.236812\n2020-05-18T13:30:00Z,293.05,296.75,292.7,295,120320229,1652.017597\n2020-05-19T13:30:00Z,294.35,296.205,291.95,291.97,95189316,1637.014797\n2020-05-20T13:30:00Z,295.82,297.87,295.57,296.93,85861691,1675.656969\n2020-05-21T13:30:00Z,296.79,297.67,293.6886,294.88,78293925,1662.682788\n2020-05-22T13:30:00Z,294.57,295.63,293.22,295.44,63958200,1664.542204\n2020-05-26T13:30:00Z,301.93,302.19,298.69,299.08,88951442,1683.750644\n2020-05-27T13:30:00Z,302.12,303.57,296.87,303.53,104817449,1700.569215\n2020-05-28T13:30:00Z,304.65,306.84,302.24,302.97,90767807,1696.193615\n2020-05-29T13:30:00Z,302.46,304.96,299.47,304.32,119265702,1703.078133\n2020-06-01T13:30:00Z,303.62,306.205,303.06,305.55,56779836,1711.759054\n2020-06-02T13:30:00Z,306.55,308.13,305.1,308.08,74267162,1729.100602\n2020-06-03T13:30:00Z,310.24,313.22,309.94,312.18,92567574,1767.241389\n2020-06-04T13:30:00Z,311.11,313,309.08,311.36,75794363,1766.317723\n2020-06-05T13:30:00Z,317.23,321.275,317.16,319.34,150524674,1845.973068\n2020-06-08T13:30:00Z,320.22,323.41,319.63,323.2,73641217,1879.55171\n2020-06-09T13:30:00Z,320.3,323.2849,319.36,320.79,77479228,1872.253909\n2020-06-10T13:30:00Z,321.42,322.39,318.2209,319,95000766,1861.487841\n2020-06-11T13:30:00Z,311.46,312.15,300.01,300.61,209243560,1682.245494\n2020-06-12T13:30:00Z,308.24,309.08,298.6,304.21,194678879,1677.721179\n2020-06-15T13:30:00Z,298.02,308.28,296.74,307.05,135782724,1701.339342\n2020-06-16T13:30:00Z,315.48,315.64,307.67,312.96,137627502,1736.532358\n2020-06-17T13:30:00Z,314.07,314.39,310.86,311.66,83398944,1726.641283\n2020-06-18T13:30:00Z,310.005,312.3,309.51,311.78,80828658,1728.245465\n2020-06-19T13:30:00Z,314.17,314.38,306.53,308.64,135549624,1706.639163\n2020-06-22T13:30:00Z,307.99,311.05,306.75,310.62,74649389,1711.708592\n2020-06-23T13:30:00Z,313.49,314.5,311.6101,312.05,68471246,1719.912002\n2020-06-24T13:30:00Z,309.84,310.51,302.1,304.09,132813492,1646.936209\n2020-06-25T13:30:00Z,303.47,307.64,301.28,307.35,89467968,1657.642265\n2020-06-26T13:30:00Z,306.16,306.39,299.42,300.05,127961017,1602.399502\n2020-06-29T13:30:00Z,301.41,304.61,298.93,304.46,79773260,1619.827702\n2020-06-30T13:30:00Z,303.99,310.2,303.82,308.36,113394772,1654.22099\n2020-07-01T13:30:00Z,309.57,311.89,309.07,310.52,72396542,1673.491751\n2020-07-02T13:30:00Z,314.24,315.7,311.51,312.23,69344217,1679.690519\n2020-07-06T13:30:00Z,316.37,317.68,315.56,317.05,61713828,1716.692523\n2020-07-07T13:30:00Z,315.38,317.52,313.37,313.78,82909963,1695.928634\n2020-07-08T13:30:00Z,314.61,316.3,312.7,316.18,54638596,1706.894572\n2020-07-09T13:30:00Z,316.84,317.1,310.68,314.38,83354158,1693.586086\n2020-07-10T13:30:00Z,314.31,317.88,312.76,317.59,57550365,1709.739638\n2020-07-13T13:30:00Z,320.13,322.71,314.13,314.84,102997484,1694.16517\n2020-07-14T13:30:00Z,313.3,319.76,312,318.92,93656951,1713.014675\n2020-07-15T13:30:00Z,322.41,323.04,319.265,321.85,87196524,1732.522615\n2020-07-16T13:30:00Z,319.79,321.28,319.09,320.79,54622520,1727.905024\n2020-07-17T13:30:00Z,321.88,322.57,319.735,321.72,62774911,1731.871799\n2020-07-20T13:30:00Z,321.43,325.13,320.62,324.32,56308749,1750.631483\n2020-07-21T13:30:00Z,326.45,326.93,323.94,325.01,57498967,1753.674286\n2020-07-22T13:30:00Z,324.62,327.2,324.5,326.86,57792915,1765.348918\n2020-07-23T13:30:00Z,326.47,327.23,321.48,322.96,75737989,1738.198463\n2020-07-24T13:30:00Z,320.95,321.99,319.246,320.88,73766597,1721.282986\n2020-07-27T13:30:00Z,321.63,323.41,320.775,323.22,48292970,1739.867517\n2020-07-28T13:30:00Z,322.43,323.64,320.85,321.17,57494979,1729.260605\n2020-07-29T13:30:00Z,322.12,325.73,322.075,325.12,48454159,1762.352182\n2020-07-30T13:30:00Z,321.9,324.41,319.64,323.96,61861714,1765.96665\n2020-07-31T13:30:00Z,325.9,326.63,321.33,326.52,85210755,1775.680698\n2020-08-03T13:30:00Z,328.32,329.62,327.73,328.79,53077948,1795.128811\n2020-08-04T13:30:00Z,327.86,330.06,327.86,330.06,41917893,1803.648566\n2020-08-05T13:30:00Z,331.47,332.39,331.18,332.11,42866354,1821.97723\n2020-08-06T13:30:00Z,331.4799,334.46,331.13,334.33,43679447,1837.990603\n2020-08-07T13:30:00Z,333.28,334.88,332.3,334.57,57308270,1844.146546\n2020-08-10T13:30:00Z,335.06,335.77,332.955,335.57,44282089,1849.221571\n2020-08-11T13:30:00Z,336.85,337.54,332.01,332.8,69600882,1830.865076\n2020-08-12T13:30:00Z,335.44,338.28,332.8377,337.44,53826128,1855.34769\n2020-08-13T13:30:00Z,336.61,338.2514,335.83,336.83,41816146,1855.34769\n2020-08-14T13:30:00Z,336.41,337.42,335.62,336.84,47260390,1856.489199\n2020-08-17T13:30:00Z,337.94,338.34,336.8517,337.91,35480974,1863.293705\n2020-08-18T13:30:00Z,338.34,339.1,336.61,338.64,38733908,1866.132169\n2020-08-19T13:30:00Z,339.05,339.61,336.62,337.23,68054244,1856.88482\n2020-08-20T13:30:00Z,335.36,338.8,335.22,338.28,42207826,1863.282822\n2020-08-21T13:30:00Z,337.92,339.72,337.55,339.48,55106628,1871.693166\n2020-08-24T13:30:00Z,342.12,343,339.4504,342.92,48588662,1895.314854\n2020-08-25T13:30:00Z,343.53,344.21,342.27,344.12,38463381,1901.700806\n2020-08-26T13:30:00Z,344.76,347.86,344.17,347.57,50790237,1931.974835\n2020-08-27T13:30:00Z,348.51,349.9,346.53,348.33,58034142,1936.882639\n2020-08-28T13:30:00Z,349.44,350.72,348.15,350.58,48588940,1952.734097\n2020-08-31T13:30:00Z,350.35,351.3,349.06,349.31,66099183,1947.071721\n2020-09-01T13:30:00Z,350.21,352.71,349.24,352.6,54999325,1971.141761\n2020-09-02T13:30:00Z,354.67,358.75,353.43,357.7,69540035,2014.920753\n2020-09-03T13:30:00Z,355.87,356.38,342.59,345.39,148011129,1910.640515\n2020-09-04T13:30:00Z,346.13,347.83,334.87,342.57,139156281,1880.171003\n2020-09-08T13:30:00Z,336.71,342.64,332.88,333.21,114465322,1811.931566\n2020-09-09T13:30:00Z,337.55,342.46,336.61,339.79,91462290,1858.764838\n2020-09-10T13:30:00Z,341.82,342.53,332.85,333.89,90569548,1819.350348\n2020-09-11T13:30:00Z,335.82,336.97,331,334.06,84680194,1812.832822\n2020-09-14T13:30:00Z,337.49,340.38,334.2208,338.46,65605686,1839.118453\n2020-09-15T13:30:00Z,341.12,342.02,338.4683,340.17,52920862,1847.773363\n2020-09-16T13:30:00Z,341.51,343.06,338.52,338.82,82211256,1836.686334\n2020-09-17T13:30:00Z,333.56,337.6996,332.991,335.84,91523339,1821.280022\n2020-09-18T13:30:00Z,335.37,335.49,327.97,330.65,105877942,1779.739944\n2020-09-21T13:30:00Z,325.7,327.13,321.73,326.97,99450829,1751.497288\n2020-09-22T13:30:00Z,328.57,330.9,325.86,330.3,63612107,1772.185721\n2020-09-23T13:30:00Z,330.9,331.2,322.1,322.64,93112240,1711.123893\n2020-09-24T13:30:00Z,321.22,326.797,319.8,323.5,76681332,1710.937535\n2020-09-25T13:30:00Z,322.58,329.58,321.64,328.73,71069426,1750.567382\n2020-09-28T13:30:00Z,333.22,334.96,332.15,334.19,64584614,1798.664756\n2020-09-29T13:30:00Z,333.97,334.77,331.6209,332.37,51531594,1787.408942\n2020-09-30T13:30:00Z,333.09,338.29,332.88,334.89,104081136,1805.832684\n2020-10-01T13:30:00Z,337.69,338.74,335.01,337.04,88698745,1818.743578\n2020-10-02T13:30:00Z,331.7,337.0126,331.19,333.84,89431112,1804.770861\n2020-10-05T13:30:00Z,336.06,339.96,336.01,339.76,45713108,1861.802504\n2020-10-06T13:30:00Z,339.91,342.17,334.38,334.93,90128883,1837.128738\n2020-10-07T13:30:00Z,338.12,341.63,338.09,340.76,56999597,1875.977422\n2020-10-08T13:30:00Z,342.85,343.85,341.86,343.78,45242476,1900.993144\n2020-10-09T13:30:00Z,345.56,347.35,344.89,346.85,59528606,1928.115113\n2020-10-12T13:30:00Z,349.59,354.02,349.06,352.43,80388533,1979.487251\n2020-10-13T13:30:00Z,352.28,352.4651,349.09,350.13,73255513,1965.86901\n2020-10-14T13:30:00Z,350.75,351.93,347.14,347.93,57958749,1951.320647\n2020-10-15T13:30:00Z,343.71,348.02,343.13,347.5,60357659,1955.395714\n2020-10-16T13:30:00Z,348.96,350.75,347.1,347.29,89501868,1954.964943\n2020-10-19T13:30:00Z,348.65,349.33,341.04,342.01,68425614,1914.51176\n2020-10-20T13:30:00Z,343.46,346.88,342.64,343.38,60051880,1912.89561\n2020-10-21T13:30:00Z,343.33,348.6847,342.4,342.73,63574979,1907.794694\n2020-10-22T13:30:00Z,342.96,345.24,340.65,344.61,55399292,1916.25072\n2020-10-23T13:30:00Z,345.93,345.99,343.13,345.78,49143511,1920.511797\n2020-10-26T13:30:00Z,342.13,342.98,335.62,339.39,91473002,1864.229756\n2020-10-27T13:30:00Z,339.76,340.12,337.99,338.22,65994108,1856.070343\n2020-10-28T13:30:00Z,332.1,332.84,326.13,326.66,127094307,1742.823121\n2020-10-29T13:30:00Z,326.91,333.395,325.09,329.98,90596689,1758.044813\n2020-10-30T13:30:00Z,328.28,329.69,322.6,326.54,120448685,1737.626467\n2020-11-02T14:30:00Z,330.2,332.36,327.24,330.2,86068299,1757.492577\n2020-11-03T14:30:00Z,333.69,338.25,330.2935,336.03,93294192,1801.498137\n2020-11-04T14:30:00Z,340.86,347.94,339.59,343.54,126959700,1867.04343\n2020-11-05T14:30:00Z,349.24,352.19,348.86,350.24,82039749,1930.928096\n2020-11-06T14:30:00Z,349.93,351.51,347.65,350.16,74972973,1932.050587\n2020-11-09T14:30:00Z,363.97,364.38,354.06,354.56,172304203,1930.266238\n2020-11-10T14:30:00Z,353.49,355.18,350.51,354.04,85552022,1920.903586\n2020-11-11T14:30:00Z,356.4,357.56,355.06,356.67,58649048,1941.191116\n2020-11-12T14:30:00Z,355.58,356.7182,351.26,353.21,68118563,1913.180779\n2020-11-13T14:30:00Z,355.27,358.9,354.71,358.1,62959429,1949.900306\n2020-11-16T14:30:00Z,360.98,362.78,359.59,362.57,74541138,1987.52995\n2020-11-17T14:30:00Z,359.97,361.92,358.34,360.62,66111009,1979.987352\n2020-11-18T14:30:00Z,360.91,361.5,356.24,356.28,70591299,1947.210554\n2020-11-19T14:30:00Z,355.6,358.18,354.15,357.78,59940947,1950.886728\n2020-11-20T14:30:00Z,357.5,357.72,355.25,355.33,70411890,1935.35984\n2020-11-23T14:30:00Z,357.28,358.82,354.865,357.46,63230608,1943.495575\n2020-11-24T14:30:00Z,360.21,363.81,359.29,363.22,62415877,1996.436382\n2020-11-25T14:30:00Z,363.13,363.16,361.48,362.66,45330890,1996.248692\n2020-11-27T14:30:00Z,363.84,364.18,362.58,363.67,28514072,2000.715213\n2020-11-30T14:30:00Z,362.83,363.12,359.17,362.06,83872709,1987.28705\n2020-12-01T14:30:00Z,365.57,367.68,364.93,366.02,74504969,2019.322815\n2020-12-02T14:30:00Z,364.82,366.96,364.2,366.79,45927000,2026.71805\n2020-12-03T14:30:00Z,366.68,368.19,365.5,366.69,62881998,2027.810941\n2020-12-04T14:30:00Z,367.32,369.85,367.22,369.85,50749859,2057.989759\n2020-12-07T14:30:00Z,369.02,369.62,367.72,369.09,48944269,2057.524638\n2020-12-08T14:30:00Z,367.72,370.78,367.67,370.17,42458859,2065.368413\n2020-12-09T14:30:00Z,370.88,371.05,365.95,366.85,74098312,2043.564311\n2020-12-10T14:30:00Z,365.37,367.86,364.43,366.73,57735353,2042.039029\n2020-12-11T14:30:00Z,364.9,366.7402,363.26,366.3,57698614,2045.502035\n2020-12-14T14:30:00Z,368.64,369.8,364.47,364.66,69216174,2032.869992\n2020-12-15T14:30:00Z,367.4,369.59,365.92,369.59,64071099,2062.140413\n2020-12-16T14:30:00Z,369.82,371.16,368.8676,370.17,58420517,2066.640846\n2020-12-17T14:30:00Z,371.94,372.46,371.05,372.24,64119472,2083.686572\n2020-12-18T14:30:00Z,370.97,371.15,367.02,369.18,136542328,2057.037098\n2020-12-21T14:30:00Z,364.97,378.46,362.03,367.86,96386745,2055.928818\n2020-12-22T14:30:00Z,368.21,368.3317,366.03,367.24,48388462,2054.482206\n2020-12-23T14:30:00Z,368.28,369.62,367.2172,367.57,46201402,2052.978005\n2020-12-24T14:30:00Z,368.08,369.03,367.45,369,26457853,2061.869364\n2020-12-28T14:30:00Z,371.74,372.59,371.07,372.17,39000402,2090.993803\n2020-12-29T14:30:00Z,373.81,374,370.83,371.46,53680451,2084.790857\n2020-12-30T14:30:00Z,372.34,373.1,371.57,371.99,49455259,2083.693906\n2020-12-31T14:30:00Z,371.78,374.66,371.232,373.88,78520702,2097.234254\n2021-01-04T14:30:00Z,375.31,375.45,364.82,368.79,110210810,2057.512997\n2021-01-05T14:30:00Z,368.1,372.5,368.05,371.33,66426229,2067.142674\n2021-01-06T14:30:00Z,369.71,376.98,369.12,373.55,107997675,2087.29942\n2021-01-07T14:30:00Z,376.1,379.9,375.91,379.1,68766812,2139.158616\n2021-01-08T14:30:00Z,380.59,381.49,377.1,381.26,71677208,2148.589003\n2021-01-11T14:30:00Z,377.85,380.58,377.7189,378.69,51176719,2135.563876\n2021-01-12T14:30:00Z,378.89,379.86,376.36,378.77,52547716,2136.466673\n2021-01-13T14:30:00Z,378.69,380.86,377.85,379.79,45303619,2143.08386\n2021-01-14T14:30:00Z,380.59,381.13,378.1,378.46,49989113,2136.30852\n2021-01-15T14:30:00Z,376.72,377.58,373.7,375.7,107159962,2112.995923\n2021-01-19T14:30:00Z,378.34,379.23,376.75,378.65,51229172,2132.283692\n2021-01-20T14:30:00Z,381.11,384.79,380.69,383.89,61836062,2181.807561\n2021-01-21T14:30:00Z,384.49,384.95,383.25,384.24,47955809,2184.352446\n2021-01-22T14:30:00Z,382.25,384.1256,381.835,382.88,52136931,2177.445792\n2021-01-25T14:30:00Z,383.67,384.77,378.46,384.39,70401971,2186.105968\n2021-01-26T14:30:00Z,385.41,385.85,383.54,383.79,42665281,2181.598438\n2021-01-27T14:30:00Z,380.22,380.32,372.01,374.41,123351078,2092.19162\n2021-01-28T14:30:00Z,376.36,381.93,375.89,377.63,94198104,2105.907684\n2021-01-29T14:30:00Z,375.63,376.67,368.27,370.07,126765121,2042.160334\n2021-02-01T14:30:00Z,373.72,377.34,370.376,376.23,75817597,2074.341001\n2021-02-02T14:30:00Z,379.65,383.22,376.3181,381.55,64450662,2114.129279\n2021-02-03T14:30:00Z,382.435,383.7,380.48,381.85,52427090,2115.883973\n2021-02-04T14:30:00Z,382.96,386.24,381.9655,386.19,47142555,2151.471241\n2021-02-05T14:30:00Z,388.2,388.47,386.1444,387.71,48669773,2160.94289\n2021-02-08T14:30:00Z,389.27,390.56,388.35,390.51,38365185,2183.086799\n2021-02-09T14:30:00Z,389.61,390.89,389.17,390.25,35551059,2184.613277\n2021-02-10T14:30:00Z,392.12,392.28,387.5,390.08,59154370,2181.029648\n2021-02-11T14:30:00Z,391.24,391.69,388.1,390.71,42913288,2180.591996\n2021-02-12T14:30:00Z,389.85,392.9,389.77,392.64,50593270,2193.985818\n2021-02-16T14:30:00Z,393.96,394.17,391.53,392.3,50972366,2192.632026\n2021-02-17T14:30:00Z,390.42,392.66,389.33,392.39,52806681,2195.903387\n2021-02-18T14:30:00Z,389.59,391.515,387.74,390.72,59712773,2192.120012\n2021-02-19T14:30:00Z,392.07,392.38,389.55,390.03,83240971,2187.361679\n2021-02-22T14:30:00Z,387.06,389.62,386.74,387.03,67413570,2167.199561\n2021-02-23T14:30:00Z,384.66,388.945,380.2,387.5,107284127,2176.380849\n2021-02-24T14:30:00Z,386.33,392.23,385.27,391.77,72433946,2206.058978\n2021-02-25T14:30:00Z,390.41,391.88,380.7789,382.33,146670499,2139.244987\n2021-02-26T14:30:00Z,384.35,385.58,378.23,380.36,152701639,2122.877257\n2021-03-01T14:30:00Z,385.59,390.92,380.572,389.58,105348798,2181.765176\n2021-03-02T14:30:00Z,389.82,390.07,386,386.54,79595332,2165.505494\n2021-03-03T14:30:00Z,385.79,386.83,381.31,381.42,119940211,2123.614968\n2021-03-04T14:30:00Z,381.22,384,371.88,376.7,183433020,2087.185616\n2021-03-05T14:30:00Z,380.46,384.76,372.64,383.63,152039624,2115.26255\n2021-03-08T14:30:00Z,384.66,387.68,381.42,381.72,123149245,2105.975617\n2021-03-09T14:30:00Z,385.85,389.91,381.7299,387.17,113633556,2136.81993\n2021-03-10T14:30:00Z,389.69,391.4,388.1702,389.58,109899410,2154.304273\n2021-03-11T14:30:00Z,392.23,395.65,391.74,393.53,86245040,2188.877112\n2021-03-12T14:30:00Z,392.07,394.21,391.2,394.06,64653565,2196.955261\n2021-03-15T13:30:00Z,394.33,396.685,392.03,396.41,73592302,2209.333581\n2021-03-16T13:30:00Z,397.07,397.83,395.08,395.91,73722506,2207.813704\n2021-03-17T13:30:00Z,394.53,398.12,393.3,397.26,97959265,2215.554958\n2021-03-18T13:30:00Z,394.475,396.72,390.75,391.48,115349101,2176.792364\n2021-03-19T13:30:00Z,389.88,391.569,387.15,389.48,113624490,2161.350334\n2021-03-22T13:30:00Z,390.03,394.07,389.97,392.59,73778646,2189.037483\n2021-03-23T13:30:00Z,391.91,393.46,388.66,389.5,90686552,2172.534553\n2021-03-24T13:30:00Z,391,392.75,387.47,387.52,97588644,2157.608794\n2021-03-25T13:30:00Z,385.98,390.55,383.9,389.7,116128622,2167.146194\n2021-03-26T13:30:00Z,390.93,396.41,390.29,395.98,114409114,2222.729797\n2021-03-29T13:30:00Z,394.4,396.75,392.81,395.78,108107626,2229.403781\n2021-03-30T13:30:00Z,394.42,395.45,393.02,394.73,76262249,2226.176741\n2021-03-31T13:30:00Z,395.34,398,395.31,396.33,112734214,2240.698562\n2021-04-01T13:30:00Z,398.4,400.67,398.18,400.61,99682876,2282.413664\n2021-04-05T13:30:00Z,403.46,406.94,403.38,406.36,91684764,2338.204166\n2021-04-06T13:30:00Z,405.76,407.24,405.4,406.12,62020953,2339.759721\n2021-04-07T13:30:00Z,405.94,406.96,405.45,406.59,55836280,2342.663628\n2021-04-08T13:30:00Z,407.93,408.58,406.93,408.52,57863114,2357.641954\n2021-04-09T13:30:00Z,408.39,411.67,408.26,411.49,61104559,2383.472286\n2021-04-12T13:30:00Z,410.85,411.93,410.2,411.64,56704899,2387.720789\n2021-04-13T13:30:00Z,411.53,413.529,411.12,412.86,55222003,2397.153559"
  },
  {
    "path": "Tests/TestData/spy_atr.txt",
    "content": "Date,Open,High,Low,Close,Average True Range 14\n1/16/2013 12:00:00 AM,146.77,147.28,146.61,147.05,\n1/17/2013 12:00:00 AM,147.7,148.42,147.43,148,\n1/18/2013 12:00:00 AM,147.97,148.49,147.43,148.33,\n1/22/2013 12:00:00 AM,148.33,149.13,147.98,149.13,\n1/23/2013 12:00:00 AM,149.13,149.5,148.86,149.37,\n1/24/2013 12:00:00 AM,149.15,150.14,149.01,149.41,\n1/25/2013 12:00:00 AM,149.88,150.25,149.37,150.25,\n1/28/2013 12:00:00 AM,150.29,150.33,149.51,150.07,\n1/29/2013 12:00:00 AM,149.77,150.85,149.67,150.66,\n1/30/2013 12:00:00 AM,150.64,150.94,149.93,150.07,\n1/31/2013 12:00:00 AM,149.89,150.38,149.6,149.7,\n2/1/2013 12:00:00 AM,150.65,151.42,150.39,151.24,\n2/4/2013 12:00:00 AM,150.32,150.58,149.43,149.54,\n2/5/2013 12:00:00 AM,150.35,151.48,150.29,151.05,\n2/6/2013 12:00:00 AM,150.52,151.26,150.41,151.16,1.167147\n2/7/2013 12:00:00 AM,151.21,151.35,149.86,150.96,1.175719\n2/8/2013 12:00:00 AM,151.23,151.89,151.22,151.8,1.166432\n2/11/2013 12:00:00 AM,151.75,151.9,151.39,151.77,1.120717\n2/12/2013 12:00:00 AM,151.78,152.3,151.61,152.02,1.124288\n2/13/2013 12:00:00 AM,152.33,152.61,151.72,152.15,1.107145\n2/14/2013 12:00:00 AM,151.69,152.47,151.52,152.29,1.112144\n2/15/2013 12:00:00 AM,152.43,152.59,151.55,152.11,1.127858\n2/19/2013 12:00:00 AM,152.37,153.28,152.36,153.25,1.127143\n2/20/2013 12:00:00 AM,153.14,153.19,151.3,151.34,1.194285\n2/21/2013 12:00:00 AM,150.92,151.42,149.94,150.42,1.244285\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.226427\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,1.372855\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.339284\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.462142\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.459998\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.531427\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,1.594998\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.672855\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,1.663569\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,1.629997\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.626426\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,1.607854\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.532139\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,1.489997\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.449283\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.274997\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.286426\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.239997\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.231426\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.20714\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.195712\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.205712\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,1.242856\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,1.297142\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.305\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,1.328573\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.347859\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.442144\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.455001\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.502858\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,1.491429\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.450001\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.505715\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.475717\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.477859\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,1.605002\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.68286\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,1.81786\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.872146\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.885717\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.930716\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.898574\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,1.875717\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.825717\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,1.782861\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,1.787859\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.715717\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.745001\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,1.769286\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.657144\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,1.533571\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,1.379999\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,1.322856\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.30857\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.254999\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,1.199999\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.274999\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.285713\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.314284\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.334999\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,1.324999\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,1.305\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,1.468572\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,1.458571\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.517857\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.624286\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.688573\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.698572\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.851428\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.909286\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.949286\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.012858\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.100001\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,2.137144\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,2.141429\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,2.195715\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,2.116428\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,2.202857\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,2.223571\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,2.192857\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,2.163571\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.244999\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,2.337143\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.372142\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.441428\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,2.418571\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,2.378571\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,2.34\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,2.376428\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,2.376428\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,2.305714\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,2.187857\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,2.190715\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,2.142857\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,2.130714\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,2.031429\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.885\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.778571\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,1.602856\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,1.544284\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,1.474998\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.449284\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.404999\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,1.31\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,1.237142\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.246428\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.199285\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.218571\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,1.191428\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,1.189285\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.113571\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.206429\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,1.209285\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,1.160714\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,1.188571\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,1.17857\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.202142\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,1.24857\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,1.259284\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,1.245711\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,1.242854\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.314998\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.324284\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,1.35\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,1.354999\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.336428\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.395\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,1.427143\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,1.431429\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.546429\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.560001\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.578572\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.609287\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.640717\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,1.697145\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,1.555715\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.653572\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,1.670714\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.659285\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,1.602856\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,1.53857\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,1.514284\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.549999\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,1.407857\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,1.514999\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.47\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.528571\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.485713\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.444999\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.474998\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,1.377142\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,1.34357\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.378572\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.410715\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.458572\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.574286\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,1.547143\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,1.607143\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.558571\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.605713\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.711427\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.727141\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.775713\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.817856\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.912856\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.967142\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.93357\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.879285\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.880713\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.817142\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,1.769285\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,1.712857\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,1.606429\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,1.559287\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.430001\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.41643\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.372858\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,1.318573\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,1.232858\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,1.179285\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.292858\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.415714\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,1.350713\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,1.317857\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,1.422143\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.445\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.450713\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,1.484283\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,1.434284\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.476426\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,1.489998\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,1.499998\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,1.467141\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,1.437856\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,1.274285\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,1.166429\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,1.206429\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.232857\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.219284\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.204999\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.299285\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,1.245713\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,1.21857\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.247142\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.212857\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.200714\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,1.264999\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,1.289285\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,1.56214\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.564997\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.58214\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,1.56214\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,1.444284\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,1.44857\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,1.330712\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,1.309999\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,1.317142\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.307142\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,1.297856\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.339998\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,1.320712\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,1.304998\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,1.085714\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.10143\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.202858\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.275002\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,1.331431\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,1.317144\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.360716\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,1.452144\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,1.437145\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.45643\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,1.67\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.735716\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.725717\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,1.815002\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.895001\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.977857\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.099286\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,2.07357\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,2.114998\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,2.220712\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,2.310713\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,2.249284\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,2.375713\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,2.27857\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,2.164999\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,2.114284\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,2.082141\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,2.074284\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,2.035713\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.944285\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.781428\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.754999\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,1.713572\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,1.655715\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.635\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.754999\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.795713\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,1.76\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,1.652143\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.640715\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,1.665\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,1.652857\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.619287\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.779287\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.715002\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,1.768573\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.790716\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.860002\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.850717\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.88286\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.843576\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.918575\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,2.030003\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,2.023574\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,2.070717\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,2.063574\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,2.05643\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,1.889288\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,1.875716\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.982144\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,2.043571\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.996428\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,2.004999\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,2.094285\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,2.069999\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,2.08857\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,2.117142\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,2.152856\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,2.117857\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,2.052143\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,2.052856\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,2.026427\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,2.047142\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.93\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.950715\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,1.904286\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.849287\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,1.625715\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,1.572144\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,1.572145\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,1.490715\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.492144\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,1.536429\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,1.559286\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,1.599286\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,1.601428\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,1.580715\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.625\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,1.530715\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,1.545715\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.570715\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,1.610715\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,1.593571\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,1.519285\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,1.487142\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,1.401428\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,1.337142\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,1.305714\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,1.241429\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,1.241429\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,1.232143\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,1.187142\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,1.156428\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,1.121428\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,1.053571\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,1.014287\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.063573\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,1.072859\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,1.059287\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,1.087858\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.152144\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,1.154287\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,1.137144\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,1.128573\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,1.198572\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,1.168573\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,1.205716\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,1.214287\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,1.207858\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,1.264287\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,1.172143\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,1.175\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,1.170714\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.212857\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,1.147142\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,1.237141\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,1.250713\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,1.302141\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.282142\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,1.246427\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.33\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.415714\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,1.462143\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,1.412857\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,1.429286\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,1.397144\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,1.421429\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,1.401429\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,1.435716\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.413573\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.630715\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.697857\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,1.734286\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.845\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,1.78357\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.810714\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.892141\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,1.906427\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,1.939283\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,2.004997\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,1.976426\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,2.038569\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,2.052854\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,2.01214\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,1.802854\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,1.706426\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,1.613569\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,1.53214\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,1.447141\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,1.307856\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,1.197856\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,1.161427\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,1.155714\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,1.131428\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,1.202857\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.162857\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,1.125715\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,1.161429\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,1.186429\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,1.212858\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.269287\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,1.233573\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.356429\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.449285\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,1.465\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.515\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.575\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.583571\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.601428\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.709285\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.769285\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,1.781428\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.8\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.935714\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,2.004284\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,2.119998\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,2.097142\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,2.17857\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,2.425713\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.600712\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.685711\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.86714\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.910712\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.08857\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,3.277141\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,3.39357\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,3.442855\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,3.499283\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,3.470712\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,3.538569\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,3.53714\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,3.419283\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,3.254997\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,3.130711\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,3.062855\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,2.962142\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,2.845712\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,2.554998\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,2.328569\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,2.195711\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,2.096427\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,1.882855\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,1.765712\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,1.581427\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,1.554284\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,1.507856\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,1.412857\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,1.357858\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,1.289286\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,1.224287\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.303573\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,1.232144\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,1.194287\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,1.130715\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,1.128572\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.193572\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,1.259286\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,1.268571\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,1.264285\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,1.274999\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.364999\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.447141\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.610713\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.717855\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,1.794998\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,2.012141\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.265712\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.529998\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,3.259999\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,3.252857\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,3.212142\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,3.195714\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,3.128571\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,3.139999\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,3.042856\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,2.936429\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,2.883571\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,2.860001\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,2.912857\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.921428\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,2.804285\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,2.762858\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,2.172143\n1/12/2015 1:02:41 PM,204.42,204.6,201.92,202.75,2.240715"
  },
  {
    "path": "Tests/TestData/spy_atr_wilder.txt",
    "content": "Date,Open,High,Low,Close,Average True Range 14\n1/16/2013 12:00:00 AM,146.77,147.28,146.61,147.05,\n1/17/2013 12:00:00 AM,147.7,148.42,147.43,148,\n1/18/2013 12:00:00 AM,147.97,148.49,147.43,148.33,\n1/22/2013 12:00:00 AM,148.33,149.13,147.98,149.13,\n1/23/2013 12:00:00 AM,149.13,149.5,148.86,149.37,\n1/24/2013 12:00:00 AM,149.15,150.14,149.01,149.41,\n1/25/2013 12:00:00 AM,149.88,150.25,149.37,150.25,\n1/28/2013 12:00:00 AM,150.29,150.33,149.51,150.07,\n1/29/2013 12:00:00 AM,149.77,150.85,149.67,150.66,\n1/30/2013 12:00:00 AM,150.64,150.94,149.93,150.07,\n1/31/2013 12:00:00 AM,149.89,150.38,149.6,149.7,\n2/1/2013 12:00:00 AM,150.65,151.42,150.39,151.24,\n2/4/2013 12:00:00 AM,150.32,150.58,149.43,149.54,\n2/5/2013 12:00:00 AM,150.35,151.48,150.29,151.05,1.15429\n2/6/2013 12:00:00 AM,150.52,151.26,150.41,151.16,1.13255\n2/7/2013 12:00:00 AM,151.21,151.35,149.86,150.96,1.15808\n2/8/2013 12:00:00 AM,151.23,151.89,151.22,151.8,1.14179\n2/11/2013 12:00:00 AM,151.75,151.9,151.39,151.77,1.09666\n2/12/2013 12:00:00 AM,151.78,152.3,151.61,152.02,1.06762\n2/13/2013 12:00:00 AM,152.33,152.61,151.72,152.15,1.05493\n2/14/2013 12:00:00 AM,151.69,152.47,151.52,152.29,1.04743\n2/15/2013 12:00:00 AM,152.43,152.59,151.55,152.11,1.04690\n2/19/2013 12:00:00 AM,152.37,153.28,152.36,153.25,1.05570\n2/20/2013 12:00:00 AM,153.14,153.19,151.3,151.34,1.11957\n2/21/2013 12:00:00 AM,150.92,151.42,149.94,150.42,1.14532\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.16851\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,1.36076\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.36856\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.45438\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.45478\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.48873\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,1.48239\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.50365\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,1.45053\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,1.38120\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.35326\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,1.32160\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.29077\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,1.26215\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.23628\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.24940\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.27659\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.32254\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.32379\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.34281\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.33546\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.37722\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,1.37027\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,1.36097\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.34233\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,1.33502\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.32252\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.38591\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.36406\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.41591\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,1.41977\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.41408\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.46450\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.44346\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.43107\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,1.59314\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.64863\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,1.75444\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.76198\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.73827\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.74196\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.74325\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,1.67302\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.65280\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,1.59689\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,1.58354\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.54972\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.55188\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,1.55603\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.59703\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,1.52867\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,1.48948\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,1.45880\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.44246\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.41371\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,1.38345\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.41391\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.42292\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.41200\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.43257\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,1.39953\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,1.39242\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,1.57153\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,1.60142\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.59204\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.65475\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.67655\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.65465\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.76361\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.76621\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.80934\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,1.85367\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,1.89912\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.92204\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.85832\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.87273\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.93825\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,2.02837\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,2.00920\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,2.01140\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.97845\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.01641\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,2.19167\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.19869\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.28022\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,2.26806\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,2.24391\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,2.20363\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,2.15623\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,2.14936\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,2.12440\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,2.08337\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,2.06313\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,2.01362\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.96836\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.90777\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.94435\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.86261\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,1.79243\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,1.75654\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,1.69964\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.67253\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.61878\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,1.55529\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,1.49991\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.51278\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.48615\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.49714\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,1.46163\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,1.43508\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.42972\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.47760\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,1.43777\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,1.37864\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,1.37660\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,1.36255\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.35452\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,1.35634\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,1.32588\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,1.33761\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,1.32063\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.41559\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.39519\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,1.39910\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,1.40131\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.43265\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.45460\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,1.42641\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,1.42524\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.52272\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.51682\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.52561\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.51378\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.54351\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,1.56826\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,1.50410\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.57524\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,1.58343\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.56105\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,1.52454\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,1.47565\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,1.42167\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.45655\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,1.40966\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,1.51897\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.48261\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.53243\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.51797\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.50383\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.47427\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,1.44968\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,1.43327\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.45661\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.45971\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.46330\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.52592\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,1.52621\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,1.53434\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.58617\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.59216\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.73986\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.72630\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.74585\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.74115\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.79249\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.80589\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.76904\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.69554\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.68371\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.66702\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,1.60937\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,1.55513\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,1.49905\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,1.46412\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.49168\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.48228\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.47569\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,1.43599\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,1.42342\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,1.40961\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.51464\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.58216\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,1.51344\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,1.47605\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,1.53633\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.51016\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.46301\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,1.46422\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,1.44178\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.47808\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,1.48536\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,1.45498\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,1.40819\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,1.36618\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,1.31074\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,1.28497\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,1.27747\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.28337\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.34384\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.31714\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.37806\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,1.33177\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,1.29164\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.36724\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.34815\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.31542\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,1.34289\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,1.32983\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,1.54984\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.50985\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.50344\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,1.47319\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,1.40225\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,1.37566\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,1.31454\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,1.25207\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,1.22478\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.29516\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,1.27193\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.28679\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,1.29702\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,1.27152\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,1.27641\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.27167\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.38369\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.43414\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,1.42242\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,1.38010\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.36224\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,1.38779\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,1.33581\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.41753\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,1.59914\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.65634\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.63018\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,1.67016\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.72658\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.77254\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,1.97021\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.95306\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.94570\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.97172\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,2.00159\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,1.92005\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.95648\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,1.89673\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.93053\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,1.91335\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,1.83668\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.85406\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.85877\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.80386\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.83644\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.80241\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,1.76438\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,1.74550\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.77082\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.82576\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.90963\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,1.81752\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,1.74912\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.73347\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,1.69394\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,1.70937\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.69084\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.80793\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.77593\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,1.79979\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.78409\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.83309\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.84287\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.92481\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.96232\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.94144\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.97562\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.93736\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.93041\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,1.92181\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,1.88097\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,1.81732\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,1.77109\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.90172\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.94017\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.93087\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.94224\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,2.10637\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,2.10663\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,2.09401\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,2.14587\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,2.13116\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,2.07536\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,1.99070\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,1.94565\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,1.85096\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,1.82303\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.83281\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.89690\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,1.84426\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.80682\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,1.75704\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,1.72868\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,1.74306\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,1.73856\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.75438\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,1.76978\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,1.72979\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,1.74338\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,1.66528\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,1.62990\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.69777\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,1.67721\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,1.65527\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.65632\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,1.65730\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,1.61892\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,1.56685\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,1.54279\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,1.48688\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,1.45710\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,1.40802\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,1.38031\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,1.32814\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,1.30756\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,1.35345\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,1.32677\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,1.29486\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,1.25380\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,1.24424\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.28465\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,1.26575\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,1.24963\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,1.24322\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.29514\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,1.25977\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,1.22550\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,1.17582\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,1.23612\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,1.25711\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,1.27446\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,1.25486\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,1.21022\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,1.26021\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,1.20734\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,1.19681\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,1.18133\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.22194\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,1.20966\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,1.27040\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,1.24894\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,1.24902\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.28409\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,1.26594\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.36623\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.42579\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,1.41537\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,1.40142\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,1.35489\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,1.30168\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,1.30299\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,1.31492\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,1.33028\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.36026\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.54953\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.59528\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,1.64204\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.70904\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,1.71625\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.77795\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.82381\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,1.79496\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,1.75318\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,1.73724\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,1.67887\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.72609\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,1.72637\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,1.68734\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,1.64396\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,1.58654\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,1.54107\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,1.53385\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,1.46857\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,1.40868\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,1.37091\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,1.33799\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,1.32313\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,1.31363\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,1.35694\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.38716\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,1.37450\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,1.39632\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,1.39873\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,1.38525\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.41059\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,1.37697\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.44576\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.48035\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,1.45318\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.46438\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.50050\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.48689\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.53569\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.66099\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.68878\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,1.70030\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.69956\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.80031\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.86457\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.91424\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.92180\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,2.00381\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,2.18640\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.32023\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.38021\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.48519\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.50625\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,2.74009\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.87937\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.92227\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,2.88354\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,2.95614\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,2.90928\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,2.95218\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,2.88417\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,2.77959\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,2.74247\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,2.71230\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,2.67642\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,2.65953\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,2.55171\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,2.49159\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,2.42219\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,2.36489\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,2.26668\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,2.16978\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,2.06193\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,1.98108\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,1.95529\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,1.87063\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,1.80344\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,1.78534\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,1.74710\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,1.73159\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.76933\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,1.69367\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,1.64341\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,1.57816\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,1.53401\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.55444\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,1.55626\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,1.52081\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,1.52361\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,1.48050\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.53118\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.61466\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.75219\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.84346\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,1.95036\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,2.07890\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.25470\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.41007\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,3.03650\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.94246\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,2.80443\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,2.66340\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,2.51744\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,2.41477\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,2.30157\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,2.22360\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,2.26477\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,2.29586\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,2.42330\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.52663\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,2.55330\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,2.64592\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,2.66479\n1/12/2015 1:02:41 PM,204.42,204.6,201.92,202.75,2.66587"
  },
  {
    "path": "Tests/TestData/spy_bollinger_bands.txt",
    "content": "Date,Open,High,Low,Close,Moving Average 20,Bollinger Bands® 20 2 Top,Bollinger Bands® 20 2 Bottom,BandWidth,%B\n2/6/2013 12:00:00 AM,150.52,151.26,150.41,151.16,,,,,\n2/7/2013 12:00:00 AM,151.21,151.35,149.86,150.96,,,,,\n2/8/2013 12:00:00 AM,151.23,151.89,151.22,151.8,,,,,\n2/11/2013 12:00:00 AM,151.75,151.9,151.39,151.77,,,,,\n2/12/2013 12:00:00 AM,151.78,152.3,151.61,152.02,,,,,\n2/13/2013 12:00:00 AM,152.33,152.61,151.72,152.15,,,,,\n2/14/2013 12:00:00 AM,151.69,152.47,151.52,152.29,,,,,\n2/15/2013 12:00:00 AM,152.43,152.59,151.55,152.11,,,,,\n2/19/2013 12:00:00 AM,152.37,153.28,152.36,153.25,,,,,\n2/20/2013 12:00:00 AM,153.14,153.19,151.3,151.34,,,,,\n2/21/2013 12:00:00 AM,150.92,151.42,149.94,150.42,,,,,\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,,,,,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,,,,,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,,,,,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,,,,,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,,,,,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,,,,,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,,,,,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,,,,,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,151.876,154.3912,149.3608,3.3122,1.0216\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,152.057,154.8462,149.2679,3.6686,0.9881\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,152.281,155.3837,149.1783,4.0750,1.0091\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,152.4925,155.9872,148.9978,4.5834,1.0061\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,152.688,156.428,148.948,4.8989,0.9000\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,152.882,156.8583,148.9057,5.2018,0.8795\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,153.111,157.407,148.815,5.6116,0.9212\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,153.288,157.7235,148.8525,5.7871,0.7866\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,153.431,157.8898,148.9722,5.8121,0.6726\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,153.499,157.986,149.012,5.8463,0.6238\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,153.7165,158.1855,149.2475,5.8146,0.7208\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,153.9135,158.1237,149.7032,5.4709,0.5530\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,154.099,158.263,149.935,5.4043,0.6802\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,154.3965,157.8504,150.9426,4.4741,0.5801\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,154.705,157.5966,151.8134,3.7382,0.7568\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,154.919,157.5755,152.2625,3.4295,0.7392\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,155.172,157.4576,152.8864,2.9459,0.8277\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,155.369,157.1987,153.5393,2.3553,0.6861\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,155.564,157.1188,154.0092,1.9989,0.9039\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,155.611,157.0623,154.1597,1.8653,0.3687\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,155.679,157.0403,154.3177,1.7489,0.5665\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155.698,157.0186,154.3774,1.6964,0.2963\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,155.7365,157.0696,154.4034,1.7120,0.6776\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,155.7725,157.1726,154.3724,1.7976,0.8491\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,155.922,157.8057,154.0383,2.4162,1.2294\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,156.0865,158.4478,153.7252,3.0256,1.1572\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,156.19,158.8211,153.5589,3.3691,0.9960\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,156.1545,158.823,153.486,3.4178,0.3062\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,156.2765,158.9403,153.6127,3.4091,0.7128\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,156.3015,158.9111,153.6919,3.3392,0.2717\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,156.224,158.9891,153.4589,3.5399,0.1232\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,156.28,158.935,153.625,3.3977,0.3493\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,156.3085,158.9459,153.6711,3.3746,0.4737\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,156.45,159.0843,153.8157,3.3676,0.7524\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,156.5345,159.2375,153.8315,3.4536,0.7489\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,156.651,159.4824,153.8196,3.6149,0.8300\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,156.7295,159.6445,153.8145,3.7198,0.7591\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,156.892,159.9937,153.7903,3.9539,0.8882\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,157.035,160.3655,153.7045,4.2417,0.8971\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,157.1875,160.4521,153.9229,4.1538,0.6673\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,157.382,160.7683,153.9957,4.3033,0.8496\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,157.6925,161.336,154.049,4.6210,1.0047\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,157.971,161.9543,153.9877,5.0431,0.9781\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,158.2635,162.6807,153.8463,5.5821,0.9909\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,158.497,163.4381,153.5558,6.2350,0.9901\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,158.6815,163.9754,153.3876,6.6724,0.8965\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,158.912,164.5937,153.2303,7.1508,0.8958\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,159.333,165.0758,153.5902,7.2086,0.8663\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,159.724,165.9356,153.5124,7.7779,0.9432\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,160.2745,166.7007,153.8483,8.0190,0.9548\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,160.8345,166.9702,154.6988,7.6298,0.8672\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,161.4075,167.5763,155.2387,7.6438,0.9484\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,161.9455,168.0701,155.8209,7.5638,0.9069\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,162.415,168.6293,156.2007,7.6524,0.8826\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,162.8175,168.8447,156.7903,7.4036,0.7582\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,163.164,168.9553,157.3727,7.0987,0.6974\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,163.5175,168.913,158.122,6.5993,0.6661\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,163.8675,169.0262,158.7088,6.2962,0.7358\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,164.1445,168.9574,159.3316,5.8642,0.6117\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,164.522,168.5573,160.4867,4.9055,0.6621\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,164.707,168.1454,161.2686,4.1752,0.3172\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,164.856,167.9434,161.7686,3.7456,0.4181\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,164.945,167.7635,162.1265,3.4175,0.2543\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,164.8785,167.9651,161.7918,3.7442,-0.0845\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,164.848,168.0061,161.6899,3.8315,0.1647\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,164.944,167.971,161.917,3.6703,0.4762\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,165.0135,167.9591,162.0679,3.5701,0.4638\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,164.9915,167.987,161.996,3.6311,0.1843\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,164.8175,168.1253,161.5097,4.0139,0.0363\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,164.722,167.9839,161.4601,3.9605,0.4215\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,164.614,167.9295,161.2985,4.0282,0.2837\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,164.489,167.6281,161.3499,3.8168,0.4922\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,164.4295,167.423,161.436,3.6411,0.7189\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,164.2435,166.9844,161.5026,3.3376,0.3552\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,163.917,167.265,160.569,4.0850,-0.1746\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,163.598,167.4749,159.7211,4.7395,-0.0840\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,163.1855,167.9092,158.4618,5.7894,-0.1484\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,162.799,167.7016,157.8963,6.0229,0.0687\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,162.545,167.446,157.644,6.0303,0.2546\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,162.3075,167.0048,157.6102,5.7881,0.3693\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,162.156,166.8915,157.4205,5.8407,0.3167\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,162.0065,166.6432,157.3698,5.7241,0.4303\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,161.889,166.4812,157.2968,5.6733,0.4261\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,161.8895,166.4814,157.2976,5.6729,0.4336\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,161.904,166.5083,157.2997,5.6877,0.6212\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,161.8615,166.3728,157.3502,5.5743,0.7315\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,161.878,166.4344,157.3216,5.6294,0.8569\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,161.9825,166.7377,157.2273,5.8713,0.8373\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,162.267,167.5806,156.9534,6.5492,0.9868\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,162.432,168.1651,156.6989,7.0591,0.9429\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,162.6805,168.9294,156.4316,7.6824,0.9376\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,162.8345,169.3934,156.2757,8.0558,0.8572\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,162.945,169.7652,156.1248,8.3712,0.8669\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,163.216,170.5092,155.9228,8.9369,0.8876\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,163.7045,171.2155,156.1935,9.1763,0.8638\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,164.226,171.8252,156.6268,9.2546,0.8470\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,164.83,171.9608,157.6992,8.6523,0.8022\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,165.3275,172.0166,158.6384,8.0919,0.7386\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,165.767,172.1845,159.3495,7.7428,0.7464\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,166.1685,172.3638,159.9732,7.4566,0.7374\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,166.577,172.2584,160.8956,6.8213,0.6772\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,166.9385,172.1464,161.7306,6.2393,0.6586\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,167.3135,171.8549,162.7721,5.4286,0.6538\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,167.7825,171.617,163.948,4.5708,0.8752\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,168.179,171.5768,164.7812,4.0407,0.9078\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,168.5165,171.4802,165.5528,3.5174,0.8684\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,168.7465,171.3103,166.1828,3.0386,0.6918\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,168.946,170.9263,166.9657,2.3443,0.5591\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,169.064,170.9503,167.1777,2.2315,0.6951\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,169.154,170.9018,167.4062,2.0665,0.5446\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,169.202,170.8885,167.5155,1.9935,0.4727\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,169.3065,170.8125,167.8005,1.7790,0.6008\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,169.346,170.7453,167.9467,1.6526,0.2835\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,169.2215,171.1215,167.3215,2.2456,-0.2478\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,169.0545,171.4625,166.6465,2.8488,-0.1695\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,168.818,171.8522,165.7838,3.5946,-0.1671\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,168.64,171.98,165.3,3.9611,0.0419\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,168.442,172.2269,164.6571,4.4940,-0.0128\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,168.2985,172.2139,164.3831,4.6529,0.2141\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,168.174,172.1363,164.2117,4.7121,0.3039\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,168.0445,172.1119,163.9771,4.8409,0.2487\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,167.7815,172.326,163.237,5.4172,0.0102\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,167.5415,172.3631,162.7199,5.7557,0.1234\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,167.217,172.0289,162.4051,5.7553,0.1834\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,166.852,171.5827,162.1213,5.6705,0.1616\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,166.5365,171.0345,162.0385,5.4018,0.2614\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,166.3375,170.5987,162.0763,5.1236,0.4311\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,166.1765,170.2344,162.1186,4.8838,0.4733\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,165.9885,169.6903,162.2867,4.4603,0.5070\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,165.9045,169.3697,162.4393,4.1773,0.7490\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,165.8925,169.3146,162.4704,4.1257,0.9350\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,165.882,169.2594,162.5046,4.0721,1.0208\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,165.8925,169.3065,162.4785,4.1159,0.9478\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,166.04,169.7661,162.3139,4.4882,0.9415\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,166.264,170.4258,162.1022,5.0063,0.9861\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,166.579,171.1721,161.9858,5.5147,0.9889\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,166.9525,172.3111,161.5939,6.4193,1.0689\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,167.3625,173.1627,161.5623,6.9313,0.9653\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,167.5955,173.5403,161.6507,7.0942,0.7628\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,167.761,173.7719,161.7501,7.1660,0.6804\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,167.9375,173.9385,161.9365,7.1467,0.6327\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,168.223,173.8518,162.5942,6.6921,0.5726\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,168.512,173.8091,163.2149,6.2869,0.6112\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,168.749,173.6577,163.8403,5.8178,0.5164\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,168.967,173.3046,164.6294,5.1343,0.3897\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,169.2145,173.0102,165.4188,4.4863,0.5165\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,169.386,172.8341,165.9379,4.0713,0.4701\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,169.469,172.6531,166.2849,3.7577,0.2097\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,169.6115,172.3994,166.8236,3.2874,0.3706\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,169.6015,172.4191,166.784,3.3226,0.1146\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,169.432,172.7658,166.0982,3.9353,-0.0927\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,169.242,172.9711,165.5129,4.4068,0.0117\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,169.253,172.9799,165.5261,4.4039,0.4889\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,169.2995,173.0522,165.5468,4.4332,0.6280\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,169.331,173.1274,165.5346,4.4840,0.7119\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,169.2625,172.9795,165.5455,4.3920,0.5589\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,169.2135,172.751,165.676,4.1811,0.9037\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,169.2365,172.8706,165.6024,4.2947,1.0481\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,169.42,173.656,165.184,5.0006,1.0866\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,169.6435,174.4029,164.8841,5.6111,0.9997\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,169.9375,175.3184,164.5566,6.3328,1.0085\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,170.214,175.9393,164.4887,6.7272,0.8804\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,170.487,176.5943,164.3797,7.1645,0.8818\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,170.839,177.3409,164.3371,7.6117,0.8930\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,171.25,178.0184,164.4816,7.9047,0.8679\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,171.6415,178.8163,164.4667,8.3602,0.8853\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,171.997,179.3511,164.6429,8.5514,0.7919\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,172.4055,179.6485,165.1626,8.4022,0.7336\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,172.7715,180.0067,165.5363,8.3755,0.7376\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,173.2415,180.2452,166.2378,8.0855,0.7562\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,173.781,179.9189,167.6431,7.0639,0.7028\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,174.3595,179.3841,169.3349,5.7635,0.7797\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,174.6475,179.074,170.221,5.0691,0.5319\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,174.999,179.079,170.919,4.6629,0.7808\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,175.318,179.0625,171.5735,4.2717,0.7673\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,175.681,178.4597,172.9023,3.1633,0.7301\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,175.9965,178.4809,173.5121,2.8232,0.9797\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,176.299,178.8303,173.7677,2.8716,1.0869\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,176.582,179.4407,173.7233,3.2378,1.1066\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,176.833,179.762,173.904,3.3127,0.9416\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,177.014,180.0154,174.0126,3.3911,0.8358\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,177.209,180.0525,174.3655,3.2092,0.7217\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,177.447,180.3573,174.5367,3.2802,0.9232\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,177.69,180.8598,174.5202,3.5678,0.9921\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,177.91,181.2501,174.5699,3.7548,0.9072\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,178.0855,181.6151,174.5559,3.9639,0.8675\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,178.327,181.9906,174.6634,4.1089,0.8812\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,178.5875,182.2333,174.9417,4.0829,0.8309\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,178.8035,182.3714,175.2356,3.9909,0.7419\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,178.9495,182.42,175.479,3.8787,0.6153\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,179.1225,182.3799,175.8651,3.6371,0.5932\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,179.211,182.3453,176.0767,3.4979,0.4568\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,179.5115,182.0403,176.9827,2.8174,0.7824\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,179.717,182.1567,177.2773,2.7150,0.8449\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,179.8885,182.1019,177.6751,2.4609,0.6946\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,179.9765,181.8274,178.1256,2.0568,0.1606\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,179.964,181.8607,178.0673,2.1079,0.0165\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,179.906,181.9493,177.8627,2.2715,0.0605\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,179.8645,181.928,177.801,2.2945,0.3438\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,179.826,181.9491,177.7029,2.3613,0.2230\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,179.9595,182.1983,177.7207,2.4881,0.8887\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,180.1105,182.3344,177.8866,2.4695,0.8102\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,180.193,182.5018,177.8842,2.5626,0.7960\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,180.279,182.7924,177.7656,2.7883,0.9478\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,180.394,183.159,177.629,3.0655,0.9586\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,180.5525,183.7016,177.4034,3.4883,1.0236\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,180.689,184.1463,177.2317,3.8268,0.9571\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,180.83,184.5468,177.1132,4.1108,0.9022\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,181.038,185.1127,176.9633,4.5015,0.9481\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,181.1965,185.305,177.088,4.5349,0.7097\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,181.354,185.467,177.241,4.5359,0.6855\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,181.525,185.5046,177.5454,4.3846,0.6049\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,181.652,185.7101,177.5939,4.4680,0.7252\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,181.758,185.8943,177.6217,4.5514,0.7130\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,181.9025,186.0894,177.7156,4.6035,0.7075\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,182.1735,186.2,178.1471,4.4205,0.7442\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,182.351,185.9378,178.7642,3.9340,0.4065\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,182.629,185.6797,179.5783,3.3409,0.6706\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,182.901,185.6417,180.1603,2.9969,0.8209\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,183.1895,185.1959,181.1831,2.1905,0.8066\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,183.286,185.179,181.393,2.0656,0.5909\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,183.4205,185.16,181.681,1.8967,0.7183\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,183.5575,185.111,182.004,1.6927,0.7390\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,183.5705,185.0934,182.0476,1.6592,0.2437\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,183.3685,185.9092,180.8278,2.7711,-0.3814\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,183.0765,186.5132,179.6398,3.7544,-0.2371\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,182.8375,186.668,179.007,4.1901,0.0082\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,182.514,186.9955,178.0325,4.9109,-0.0761\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,182.241,186.8231,177.6589,5.0286,0.1714\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,182.004,186.9006,177.1074,5.3808,0.1095\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,181.5685,187.5132,175.6238,6.5482,-0.1223\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,181.2195,187.73,174.709,7.1852,0.0515\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,180.804,187.7317,173.8763,7.6632,0.0934\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,180.502,187.4563,173.5477,7.7055,0.2827\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,180.304,187.1137,173.4943,7.5536,0.4542\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,180.0975,186.6759,173.5191,7.3054,0.4933\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,180.1125,186.7066,173.5184,7.3222,0.6416\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,180.0325,186.4894,173.5756,7.1730,0.6578\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,179.95,186.2074,173.6926,6.9546,0.7445\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,179.93,186.1324,173.7276,6.8942,0.8297\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,179.9605,186.2409,173.6801,6.9798,0.8407\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,179.9025,186.0459,173.7591,6.8297,0.7537\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,179.8925,186.0078,173.7772,6.7988,0.8440\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,179.9475,186.1847,173.7103,6.9322,0.8160\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,180.2485,186.8243,173.6727,7.2964,0.8544\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,180.59,187.3715,173.8085,7.5104,0.8134\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,180.879,187.8663,173.8917,7.7259,0.7842\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,181.3025,188.4086,174.1964,7.8389,0.8179\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,181.6555,189.0118,174.2992,8.0992,0.8150\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,181.9955,189.3062,174.6848,8.0339,0.7041\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,182.666,189.4216,175.9104,7.3967,0.8637\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,183.2845,189.5022,177.0668,6.7848,0.8591\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,183.935,189.2821,178.5879,5.8141,0.8969\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,184.474,189.2528,179.6952,5.1810,0.8961\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,184.898,189.3968,180.3992,4.8663,0.8625\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,185.259,189.2624,181.2556,4.3219,0.7462\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,185.524,189.3204,181.7276,4.0926,0.7313\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,185.6795,189.1369,182.2221,3.7241,0.4278\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,185.762,189.0344,182.4895,3.5233,0.3316\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,185.8775,189.0576,182.6974,3.4217,0.5711\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,186.0485,189.2258,182.8712,3.4156,0.7536\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,186.2305,189.0946,183.3664,3.0759,0.5750\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,186.413,189.1742,183.6518,2.9625,0.7421\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,186.5285,189.0398,184.0172,2.6927,0.4346\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,186.5545,189.0083,184.1007,2.6307,0.2709\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,186.628,188.9569,184.2991,2.4958,0.4317\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,186.634,188.9451,184.3229,2.4766,0.1400\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,186.572,189.029,184.1149,2.6339,0.0946\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,186.532,189.0318,184.0322,2.6803,0.2916\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,186.6335,189.0359,184.2311,2.5745,0.5784\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,186.667,189.139,184.195,2.6486,0.8202\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,186.7235,189.3394,184.1076,2.8019,0.9122\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,186.746,189.4187,184.0733,2.8624,0.8525\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,186.653,189.2365,184.0695,2.7682,0.4510\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,186.462,189.1349,183.7891,2.8670,0.1031\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,186.3555,189.0669,183.6441,2.9099,0.2685\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,186.346,189.0457,183.6463,2.8975,0.6378\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,186.2445,189.2475,183.2415,3.2248,-0.0152\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,186.087,189.6787,182.4953,3.8602,-0.1372\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,185.9175,189.7586,182.0764,4.1320,0.1124\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,185.7445,189.5677,181.9213,4.1166,0.2980\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,185.7175,189.522,181.9129,4.0971,0.5529\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,185.6495,189.3536,181.9454,3.9904,0.6000\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,185.6915,189.4384,181.9446,4.0356,0.6799\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,185.8145,189.6787,181.9503,4.1592,0.7686\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,185.8715,189.7964,181.9466,4.2232,0.7011\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,186.0145,190.0054,182.0236,4.2910,0.7275\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,186.1,190.0373,182.1628,4.2313,0.5241\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,186.1695,190.1103,182.2287,4.2336,0.5901\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,186.2065,190.1918,182.2212,4.2805,0.6936\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,186.2095,190.201,182.218,4.2871,0.7631\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,186.1815,190.105,182.258,4.2147,0.7725\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,186.153,190.0127,182.2933,4.1468,0.7470\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,186.254,190.238,182.27,4.2780,0.7718\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,186.376,190.2664,182.4856,4.1748,0.5519\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,186.515,190.4118,182.6182,4.1785,0.6751\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,186.5445,190.4671,182.6219,4.2055,0.6447\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,186.785,190.4253,183.1447,3.8979,0.6614\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,187.199,190.1666,184.2314,3.1705,0.9365\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,187.55,190.0421,185.0579,2.6575,0.9835\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,187.793,189.839,185.747,2.1790,0.8096\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,187.857,189.7651,185.9489,2.0314,0.3802\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,187.94,189.7261,186.1539,1.9007,0.5308\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,188.025,189.7934,186.2566,1.8810,0.7022\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,188.008,189.7878,186.2282,1.8933,0.3713\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,188.092,189.9165,186.2675,1.9400,0.7845\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,188.18,190.1121,186.2479,2.0535,0.8649\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,188.383,190.3312,186.4348,2.0683,1.0048\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,188.615,190.8726,186.3574,2.3939,1.1434\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,188.7965,191.3153,186.2777,2.6683,1.0128\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,188.9995,191.9467,186.0523,3.1187,1.0718\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,189.2175,192.5511,185.8839,3.5236,1.0193\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,189.4595,193.1095,185.8095,3.8531,0.9713\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,189.6785,193.5704,185.7866,4.1037,0.9010\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,189.999,193.9387,186.0592,4.1471,0.9050\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,190.3275,194.5883,186.0667,4.4773,0.9838\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,190.7125,195.3239,186.1011,4.8360,1.0061\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,191.0935,195.983,186.204,5.1174,0.9588\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,191.384,196.6082,186.1598,5.4594,0.9035\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,191.632,197.0302,186.2338,5.6339,0.8045\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,191.856,197.18,186.532,5.5500,0.6582\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,192.1925,197.188,187.197,5.1984,0.6939\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,192.5045,197.1964,187.8126,4.8746,0.6903\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,192.809,197.2689,188.3492,4.6262,0.7266\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,193.2445,197.2423,189.2467,4.1376,0.8771\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,193.612,197.3736,189.8504,3.8857,0.8812\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,193.9295,197.3347,190.5243,3.5118,0.7952\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,194.206,197.2862,191.1258,3.1721,0.7717\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,194.365,197.1921,191.5379,2.9091,0.5592\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,194.575,197.0908,192.0592,2.5859,0.6997\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,194.7285,197.0549,192.4021,2.3894,0.6529\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,194.8855,197.0564,192.7146,2.2279,0.7152\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,195.0265,197.0225,193.0305,2.0469,0.6737\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,195.238,197.1397,193.3363,1.9481,0.9712\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,195.44,197.2861,193.5939,1.8892,0.9848\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,195.6275,197.7711,193.4839,2.1915,1.1000\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,195.734,198.0244,193.4436,2.3403,0.8877\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,195.767,198.0666,193.4674,2.3493,0.6028\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,195.843,198.2148,193.4712,2.4221,0.7692\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,195.914,198.2559,193.5721,2.3907,0.5910\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,196.0675,198.1555,193.9795,2.1299,0.6299\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,196.241,198.2306,194.2514,2.0277,0.8415\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,196.388,198.2063,194.5697,1.8517,0.7315\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,196.5445,198.3381,194.7509,1.8251,0.8946\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,196.517,198.3438,194.6902,1.8592,0.2791\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,196.5785,198.4776,194.6795,1.9321,0.7979\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,196.6485,198.5514,194.7456,1.9353,0.6817\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,196.7645,198.7471,194.7819,2.0152,0.8620\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,196.9615,198.8658,195.0572,1.9337,0.9407\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,197.115,199.0439,195.1861,1.9571,0.8979\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,197.229,199.0125,195.4455,1.8086,0.6377\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,197.328,199.0043,195.6517,1.6990,0.6408\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,197.3895,198.9081,195.8709,1.5387,0.3553\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,197.387,198.9081,195.8659,1.5412,0.3662\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,197.18,199.5946,194.7654,2.4491,-0.3469\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,196.895,200.0059,193.7841,3.1600,-0.2064\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,196.714,200.0721,193.3559,3.4142,0.0795\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,196.5025,200.4368,192.5682,4.0043,-0.0709\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,196.25,200.6177,191.8823,4.4512,0.0215\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,195.9845,200.9082,191.0608,5.0246,-0.0031\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,195.816,200.8715,190.7605,5.1635,0.2452\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,195.6255,200.6848,190.5662,5.1724,0.3186\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,195.4405,200.5222,190.3588,5.2003,0.3120\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,195.2845,200.2371,190.3319,5.0722,0.4551\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,195.287,200.2405,190.3335,5.0730,0.5477\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,195.1875,200.0208,190.3542,4.9525,0.5551\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,195.1885,200.0236,190.3534,4.9543,0.7246\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,195.198,200.0574,190.3385,4.9790,0.8284\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,195.212,200.1125,190.3115,5.0207,0.8783\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,195.2545,200.2865,190.2225,5.1543,0.9219\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,195.328,200.5415,190.1145,5.3382,0.8704\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,195.448,200.9841,189.9119,5.6650,0.9292\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,195.617,201.5204,189.7136,6.0357,0.8992\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,195.7805,201.9986,189.5624,6.3521,0.8594\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,196.133,202.4986,189.7674,6.4911,0.8147\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,196.5435,202.9775,190.1095,6.5472,0.8238\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,196.8795,203.425,190.334,6.6492,0.7850\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,197.304,203.6288,190.9792,6.4112,0.7527\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,197.711,203.6734,191.7486,6.0314,0.7096\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,198.215,203.4987,192.9313,5.3313,0.7740\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,198.5825,203.4359,193.7291,4.8880,0.7068\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,198.859,203.1908,194.5272,4.3567,0.5532\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,199.186,202.7847,195.5873,3.6134,0.6228\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,199.459,202.4794,196.4386,3.0286,0.6392\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,199.6275,202.1364,197.1186,2.5136,0.4009\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,199.7905,201.5845,197.9965,1.7959,0.2741\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,199.9465,201.373,198.5201,1.4268,0.6870\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,200.0645,201.3387,198.7903,1.2738,0.7690\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,200.2095,201.5857,198.8333,1.3748,1.0851\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,200.2695,201.6212,198.9178,1.3499,0.6592\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,200.2675,201.6256,198.9094,1.3563,0.0886\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,200.158,201.8358,198.4802,1.6765,-0.1401\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,200.1195,201.815,198.424,1.6945,0.3350\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,199.924,202.2852,197.5628,2.3621,-0.2589\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,199.812,202.3289,197.295,2.5193,0.1202\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,199.6535,202.3192,196.9879,2.6703,0.1036\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,199.474,202.3342,196.6138,2.8677,0.0710\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,199.1665,202.7502,195.5828,3.5987,-0.1720\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,198.875,202.982,194.768,4.1302,-0.0472\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,198.6455,202.7403,194.5507,4.1227,0.2405\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,198.4305,202.5458,194.3152,4.1479,0.2399\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,198.1275,202.7919,193.4631,4.7085,-0.0218\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,197.956,202.5741,193.3378,4.6658,0.3575\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,197.578,202.5878,192.5682,5.0712,0.0171\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,197.1485,202.961,191.336,5.8966,-0.0685\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,196.57,203.6934,189.4465,7.2477,-0.1429\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,195.931,203.7915,188.0705,8.0237,-0.0236\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,195.215,203.7676,186.6624,8.7622,-0.0136\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,194.4375,203.2696,185.6054,9.0848,0.0376\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,193.826,202.5317,185.1203,8.9830,0.1924\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,193.3835,201.8583,184.9087,8.7648,0.3181\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,193.1865,201.4012,184.9718,8.5044,0.5538\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,192.843,200.5199,185.1662,7.9618,0.4900\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,192.7725,200.3448,185.2002,7.8562,0.6425\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,192.699,200.0973,185.3007,7.6786,0.7522\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,192.63,199.8705,185.3895,7.5175,0.7438\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,192.6995,200.1314,185.2676,7.7135,0.8842\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,192.8875,200.6593,185.1157,8.0584,0.8360\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,193.1375,201.392,184.883,8.5478,0.8781\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,193.3945,202.3449,184.4441,9.2561,0.9617\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,193.6685,203.2687,184.0683,9.9141,0.9219\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,194.059,204.1821,183.936,10.4330,0.8463\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,194.344,205.0461,183.6419,11.0136,0.8736\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,194.8645,206.1978,183.5312,11.6320,0.8655\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,195.5045,207.2277,183.7813,11.9928,0.8342\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,196.333,207.9928,184.6732,11.8776,0.8279\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,197.157,208.5869,185.7271,11.5947,0.8072\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,198.0335,208.7018,187.3652,10.7742,0.7778\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,198.9295,208.443,189.416,9.5647,0.7765\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,199.718,208.1903,191.2457,8.4843,0.7669\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,200.4215,207.9307,192.9123,7.4934,0.7629\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,200.9955,208.2247,193.7663,7.1934,0.8150\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,201.622,207.9832,195.2608,6.3100,0.7828\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,202.1545,207.9431,196.3659,5.7269,0.7959\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,202.667,208.1441,197.1899,5.4050,0.8663\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,203.222,208.1735,198.2705,4.8730,0.9078\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,203.657,208.3637,198.9503,4.6222,0.8668\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,204.1335,208.4071,199.8599,4.1871,0.9103\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,204.5245,208.3993,200.6497,3.7891,0.8452\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,204.7295,208.4051,201.0539,3.5907,0.6402\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,204.9955,208.5437,201.4473,3.4617,0.7951\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,205.3365,208.6104,202.0626,3.1888,0.8900\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,205.6025,208.72,202.485,3.0326,0.8300\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,205.845,208.9159,202.7741,2.9837,0.8509\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,206.0085,208.8696,203.1474,2.7777,0.6051\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,206.133,208.8428,203.4232,2.6292,0.5622\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,206.082,208.9695,203.1945,2.8023,-0.0060\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,206.0935,208.9488,203.2382,2.7709,0.1667\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,205.9285,209.497,202.36,3.4658,-0.2060\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,205.692,210.1842,201.1998,4.3679,-0.1881\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,205.369,210.9837,199.7543,5.4679,-0.1642\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,205.181,211.0067,199.3553,5.6786,0.2090\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,205.259,211.1263,199.3917,5.7170,0.6296\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,205.306,211.1979,199.4141,5.7396,0.6030\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,205.3455,211.2841,199.4069,5.7840,0.6789\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,205.37,211.3439,199.3961,5.8177,0.6992\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,205.403,211.4221,199.3839,5.8608,0.6966\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,205.443,211.5313,199.3547,5.9270,0.7461\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,205.519,211.7298,199.3082,6.0440,0.7577\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,205.611,211.8876,199.3345,6.1053,0.6584\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,205.5335,211.7733,199.2937,6.0718,0.5005\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,205.4105,211.5559,199.2651,5.9835,0.5016\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,205.1135,211.3685,198.8585,6.0991,0.2287\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,204.7045,211.2155,198.1935,6.3614,0.1249\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,204.4895,211.0186,197.9604,6.3858,0.3331\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,204.461,210.9602,197.9618,6.3574,0.6107\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,204.5155,210.9883,198.0427,6.3299,0.4795\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,204.4385,210.9615,197.9156,6.3813,0.3629\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,204.498,210.9112,198.0848,6.2721,0.3115\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,204.5655,210.793,198.338,6.0885,0.2025\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,204.621,210.6261,198.616,5.8694,0.0336\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,204.613,210.6335,198.5925,5.8848,0.2523\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,204.3765,210.4095,198.3435,5.9038,0.3072\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,204.2045,210.1792,198.2298,5.8517,0.4059\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,204.136,209.9895,198.2825,5.7349,0.6678\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,203.997,209.6284,198.3655,5.5211,0.5864\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,203.881,209.2879,198.4741,5.3040,0.6451\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,203.596,208.5973,198.5947,4.9130,0.4144\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,203.167,207.7946,198.5394,4.5555,0.1729\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,202.8865,207.0634,198.7096,4.1175,0.3927\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,202.582,206.8281,198.3359,4.1920,0.1312"
  },
  {
    "path": "Tests/TestData/spy_bop.txt",
    "content": "Date,Open,High,Low,Close,Volume,BOP\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,0.521428571428573\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,-0.940414507772016\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,0.204081632653069\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,0.78599221789883\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,-0.198630136986295\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,0.528497409326428\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,0.82857142857144\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,0.594339622641504\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,-0.447368421052641\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.15217391304347\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,-0.0202020202020304\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,0.76923076923076\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,-0.269662921348297\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.157303370786531\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.724137931034446\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,-0.0273972602739481\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.437499999999998\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,-0.359375000000001\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.246376811594186\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,-0.253246753246746\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0.87356321839079\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-0.541666666666673\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.740740740740732\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,0.75\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.527272727272716\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,-0.435483870967732\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.249999999999975\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,-0.760180995475113\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.39814814814816\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.765822784810139\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.639455782312924\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.186567164179104\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.862068965517237\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.418803418803421\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0.107142857142861\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,-0.950495049504949\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.708860759493668\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,-0.578431372549011\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-0.66129032258066\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0.685314685314675\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,0.21787709497206\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,0.471590909090911\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0.0657894736841864\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0.230769230769236\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,-0.091954022988487\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.512195121951231\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.369369369369371\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,-0.801526717557259\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.786764705882356\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.273809523809544\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.491525423728797\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.499999999999971\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0.867924528301923\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,-0.317073170731722\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,0.394230769230758\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,0.545454545454532\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0.928571428571426\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0.740259740259754\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,-0.33070866141731\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0.732824427480921\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.154639175257738\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0.0769230769230719\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,-0.36153846153846\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0.634517766497462\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.621428571428572\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,-0.375634517766488\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-0.130136986301368\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0.350364963503662\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-0.600628930817617\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0.27222222222221\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-0.371308016877634\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-0.803493449781664\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0.614457831325299\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,0.50276243093924\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,-0.495145631067952\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,-0.0944444444444542\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-0.896057347670253\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.80312500000001\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,-0.482954545454545\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0.0838323353293338\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.816326530612257\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,-0.860557768924316\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-0.778846153846155\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-0.231441048034936\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-0.122222222222216\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0.0285714285714188\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0.2\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,-0.0459770114942435\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,-0.129870129870142\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,0.0642857142857178\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.0611111111111183\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0.49677419354839\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0.275280898876409\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0.0458015267175599\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0.150943396226412\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.160714285714291\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,0.287037037037036\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0.13749999999998\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0.25352112676058\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,-0.5658914728682\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,-0.306666666666691\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0.551401869158871\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.717391304347832\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.150684931506864\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,-0.833333333333339\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,-0.76190476190476\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.64035087719299\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.530487804878056\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,-0.126315789473691\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,-0.486238532110091\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,-0.169117647058818\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.747252747252758\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.70652173913042\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.147540983606513\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,-0.547008547008552\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,-0.0227272727272522\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,-0.159999999999991\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,-0.181159420289856\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.720430107526894\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.140939597315441\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,-0.709090909090895\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-0.723880597014923\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-0.185840707964584\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-0.599999999999976\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.410447761194046\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-0.320652173913045\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.808510638297869\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0.0754716981132192\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,-0.546099290780139\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-0.564971751412435\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0.423611111111102\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0.378048780487793\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-0.639705882352938\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,-0.452127659574474\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,0.693121693121689\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.164179104477628\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,-0.180000000000007\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0.921875000000005\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0.375000000000006\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,0.723809523809534\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,-0.500000000000017\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0.25000000000001\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,-0.724999999999994\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.923076923076906\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0.707482993197284\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,-0.742574257425749\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,-0.90285714285715\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,-0.45238095238094\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,-0.272727272727263\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,-0.559633027522947\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0.312500000000002\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.149253731343278\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.402877697841732\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,0.800000000000011\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0.549668874172197\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-0.547619047619052\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.751633986928089\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-0.871681415929207\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-0.119760479041927\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,0.926108374384234\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,0.87741935483871\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,0.849999999999994\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,-0.488095238095249\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,0.862745098039211\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,0.934343434343436\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,0.529999999999973\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,-0.0675675675675437\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,0.393700787401572\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,-0.279569892473146\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0.2906976744186\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,0.5301204819277\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.428571428571402\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.6627906976744\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,-0.600000000000009\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,-0.286764705882367\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.115107913669061\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.130790190735697\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.0932203389830619\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.145833333333318\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-0.913194444444444\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.991869918699183\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.29032258064517\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.0101010101010295\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.982758620689659\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.632478632478647\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.60759493670889\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,-0.655405405405409\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,-0.243478260869565\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,-0.482051282051277\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,0.76470588235294\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.754716981132085\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,-0.600000000000036\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,-0.0731707317073205\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.389830508474605\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,-0.357894736842113\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,-0.5\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,-0.163934426229499\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.258215962441307\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-0.494845360824732\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.229166666666664\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,-0.137254901960773\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,-0.287671232876716\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-0.889361702127663\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-0.436363636363644\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-0.415730337078631\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.296703296703309\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-0.620689655172415\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,0.632653061224489\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.313131313131322\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.626760563380285\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0.210526315789484\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.750000000000044\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0.749999999999967\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,-0.557692307692281\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,-0.227272727272716\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0.76315789473683\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,-0.622641509433967\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,-0.371134020618571\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,-0.783783783783787\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.428571428571409\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.0638297872340432\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,-0.343283582089557\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0.148760330578494\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-0.690140845070415\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.769230769230748\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.455284552845534\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.144578313252986\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,-0.415929203539824\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,-0.313953488372089\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,-0.318181818181789\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,-0.373417721518987\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-0.954063604240294\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-0.433333333333341\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0.71186440677966\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-0.143712574850303\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0.225806451612898\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,0.497890295358652\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-0.832599118942733\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0.231213872832375\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0.216216216216205\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0.827433628318577\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,0.649532710280376\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0.360465116279079\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0.729166666666665\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,-0.169642857142854\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,0.911392405063299\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,0.662721893491117\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0.0476190476190718\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,-0.365384615384614\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0.432291666666655\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,-0.513761467889922\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.312820512820502\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,-0.139705882352938\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,-0.19685039370079\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.826666666666654\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.242857142857139\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.194117647058815\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0.64227642276425\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,-0.0722891566265077\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,-0.437908496732036\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0.19130434782609\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,-0.654450261780106\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.662068965517252\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,-0.810810810810804\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-0.102941176470598\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0.563492063492061\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0.657142857142846\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,-0.425101214574904\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,0.761421319796955\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,-0.505016722408032\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,-0.575510204081634\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,-0.0538922155688647\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,-0.838842975206607\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-0.131944444444443\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,0.246478873239455\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,0.421686746987939\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0.659340659340635\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.383838383838376\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,-0.427350427350432\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,-0.899999999999996\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,-0.678260869565223\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.508287292817672\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0.70813397129186\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-0.924528301886794\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-0.30805687203792\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0.0103626943005234\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0.301418439716308\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0.436241610738265\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,0.385185185185173\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.662921348314621\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.511811023622025\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,-0.564516129032317\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,-0.383561643835604\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,-0.643835616438351\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,-0.0732600732600798\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.281250000000017\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.643939393939393\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.0630630630630561\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,-0.198529411764716\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.652849740932635\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,-0.899280575539577\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.239795918367345\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,-0.0152284263959397\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.206611570247937\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,0.542553191489353\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,-0.107692307692301\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,-0.697247706422008\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,-0.57142857142857\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.390070921985825\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.751824817518262\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-0.699999999999988\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.91379310344828\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.348214285714306\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.662921348314621\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.730158730158715\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,-0.223684210526339\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0.485981308411228\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.610389610389601\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,-0.0784313725490032\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.600000000000018\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0.701923076923053\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0.523076923076909\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.769230769230763\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.249999999999992\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.333333333333307\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0.0781249999999716\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,-0.674556213017761\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.235294117647072\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.394230769230769\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,0.715517241379323\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0.725888324873086\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.0249999999999778\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,-0.17499999999998\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,-0.226415094339631\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,-0.415841584158415\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.849673202614386\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,-0.106666666666664\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.840000000000003\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.0158730158730016\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.546666666666662\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.384615384615376\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.599999999999974\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,-0.434210526315811\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,-0.602739726027391\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.377551020408172\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.611111111111104\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.381443298969077\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,-0.0714285714285714\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,-0.275862068965531\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,-0.190476190476186\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-0.606741573033712\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.796407185628756\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.242990654205601\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.23188405797101\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.173333333333327\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,-0.278688524590137\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,-0.419354838709703\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.0136054421768777\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,-0.823529411764718\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,-0.388571428571432\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-0.903914590747327\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-0.0365296803653026\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0.453333333333325\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-0.480349344978178\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0.546961325966848\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-0.748062015503883\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,0.747933884297517\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,-0.210526315789494\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,-0.0826446280991683\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.490909090909086\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.730769230769221\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,-0.329059829059833\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.723684210526339\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.490909090909086\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,0.712962962962957\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.530120481927718\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,-0.136842105263155\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0.0277777777777723\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,-0.0370370370370039\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,-0.317460317460302\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.624999999999964\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.296703296703309\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,-0.318584070796448\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,-0.714285714285711\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,-0.338541666666667\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.516853932584278\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,-0.289256198347101\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-0.670731707317064\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.426573426573423\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0.842975206611573\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-0.634615384615389\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-0.202127659574466\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.786324786324787\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,-0.0259067357513011\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0.613333333333306\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,-0.515527950310562\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,-0.715151515151517\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,-0.305343511450385\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.69124423963134\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-0.974820143884895\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0.609137055837572\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0.739130434782611\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,-0.402366863905313\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-0.814685314685315\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0.0740740740740694\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0.435483870967747\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,-0.529702970297045\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-0.812000000000001\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,0.719298245614033\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-0.900497512437816\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-0.683544303797468\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-0.794805194805197\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-0.273381294964036\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0.214904679376084\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0.6865671641791\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0.0234741784037613\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,0.915966386554626\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,0.871323529411767\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,-0.760869565217397\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,0.149484536082485\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,0.600000000000009\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,0.288732394366197\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,0.928994082840234\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,-0.206896551724134\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,0.809954751131215\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,-0.11428571428572\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,-0.130434782608678\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,-0.0974025974026016\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,-0.192982456140347\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,0.456790123456794\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.171717171717191\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.637362637362622\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.166666666666688\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.655913978494634\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.0308641975308711\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.142857142857159\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.559139784946244\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.736486486486494\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,-0.06400000000001\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.869281045751642\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,-0.494623655913968\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.145833333333322\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,-0.434343434343421\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.506849315068468\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,-0.333333333333353\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,-0.551724137931049\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.826923076923071\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.580952380952361\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.0705128205128109\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.130434782608702\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,-0.429223744292237\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.780669144981411\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-0.911475409836071\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0.120967741935489\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-0.592592592592599\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,-0.664000000000002\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-0.140969162995598\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0.817283950617282\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,0.220994475138121\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,0.0348837209302339\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0.75247524752475\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,-0.542168674698792\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,-0.41935483870966\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,0.250000000000012\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.566265060240954\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,-0.7093023255814\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,-0.864285714285716\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,-0.355555555555549\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-0.821192052980126\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-0.596899224806201\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0.461956521739126\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,0.875576036866367\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,-0.735395189003433\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-0.660447761194021\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-0.416498993963781\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.470355731225307\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-0.837060702875393\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0.880733944954132\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,-0.145098039215676\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,0.577205882352949\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,0.529262086513994\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,-0.643410852713192\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0.421052631578945\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,-0.109243697478988\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,-0.917808219178086\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.455801104972377\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-0.365131578947374\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0.443645083932854\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,0.79130434782609\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,0.0641711229946547\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0.843137254901955\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,-0.439655172413781\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,-0.0927152317880898\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,0.377049180327876\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,0.203703703703714\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0.499999999999993\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0.64814814814813\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0.59836065573772\n"
  },
  {
    "path": "Tests/TestData/spy_candle_patterns.txt",
    "content": "Date,Open,High,Low,Close,Volume,CDL2CROWS,CDL3BLACKCROWS,CDL3INSIDE,CDL3LINESTRIKE,CDL3OUTSIDE,CDL3STARSINSOUTH,CDL3WHITESOLDIERS,CDLABANDONEDBABY,CDLADVANCEBLOCK,CDLBELTHOLD,CDLBREAKAWAY,CDLCLOSINGMARUBOZU,CDLCONCEALBABYSWALL,CDLCOUNTERATTACK,CDLDARKCLOUDCOVER,CDLDOJI,CDLDOJISTAR,CDLDRAGONFLYDOJI,CDLENGULFING,CDLEVENINGDOJISTAR,CDLEVENINGSTAR,CDLGAPSIDESIDEWHITE,CDLGRAVESTONEDOJI,CDLHAMMER,CDLHANGINGMAN,CDLHARAMI,CDLHARAMICROSS,CDLHIGHWAVE,CDLHIKKAKE,CDLHIKKAKEMOD,CDLHOMINGPIGEON,CDLIDENTICAL3CROWS,CDLINNECK,CDLINVERTEDHAMMER,CDLKICKING,CDLKICKINGBYLENGTH,CDLLADDERBOTTOM,CDLLONGLEGGEDDOJI,CDLLONGLINE,CDLMARUBOZU,CDLMATCHINGLOW,CDLMATHOLD,CDLMORNINGDOJISTAR,CDLMORNINGSTAR,CDLONNECK,CDLPIERCING,CDLRICKSHAWMAN,CDLRISEFALL3METHODS,CDLSEPARATINGLINES,CDLSHOOTINGSTAR,CDLSHORTLINE,CDLSPINNINGTOP,CDLSTALLEDPATTERN,CDLSTICKSANDWICH,CDLTAKURI,CDLTASUKIGAP,CDLTHRUSTING,CDLTRISTAR,CDLUNIQUE3RIVER,CDLUPSIDEGAP2CROWS,CDLXSIDEGAP3METHODS\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,,,,,0,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,,,,,0,,,,,,,,,,,,,,100,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,,,,,100,,,,,,,,,,,,,,0,,,,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,0\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,,,,,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,,,,0,0,,,,,,,,,,,,,,0,,,0,,,,,,,0,,,,,,,,,,,,0,,,,,,,,,,,,,0,,0,,,,,0\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,,,,0,0,,,,,0,,0,,,,100,,0,0,,,0,0,,,,,-100,0,0,,,,,,,,100,0,0,0,,,,,,0,,,,0,-100,,0,0,0,,,,,0\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,,,,0,0,,,,,0,,0,,0,0,0,0,0,100,,,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,,,,0,0,0,,0,0,100,0,,0,0,0,0,,,,0\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0,,0,0,0,0,0,0,0,0,,0,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,,0,0,0,0,0,,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,100,0,0,0,0,0,0,0\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,100,0,0,0,0,0\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,100,0,0,0,0,0,100,0,0,0\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,200,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,100,0,0,0,0,0,0,0,0,0\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,0,0,100,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,0,0,0,0,0,0,100,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,-100,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,-100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,100,0,0\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,100,0,0,0,0,0,0\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0,0,0,0,0,0,0,0,0,100,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,100,-100,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,100,0,0,0,0,0,0\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,-100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,100,100,0,0,0,0,0,0,0,0,0\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,100,0,0,0,0,0,0,0,0,0,0\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0,0,0,0,0,0,0,0,0,100,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,100,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,0,0,0,0,100,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0,0,0,0,0,0,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,-100,-100,100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0\n"
  },
  {
    "path": "Tests/TestData/spy_cmf.txt",
    "content": "Date,Open,High,Low,Close,Volume,CMF_20\n2019-09-27 12:00:00 AM,297.83,297.9465,293.69,295.4,84781110,0.101462918915507\n2019-09-30 12:00:00 AM,295.97,297.55,295.92,296.77,52562761,0.116739252647704\n2019-10-01 12:00:00 AM,297.74,298.455,293,293.24,89900420,0.040124568303099\n2019-10-02 12:00:00 AM,291.5,291.51,286.64,288.06,124523974,-0.030868971310452\n2019-10-03 12:00:00 AM,287.81,290.45,284.82,290.42,85906799,0.024164528056182\n2019-10-04 12:00:00 AM,291.14,294.63,290.82,294.35,66700681,0.065292656253434\n2019-10-07 12:00:00 AM,293.47,295.26,292.77,293.08,60656561,0.033556819553751\n2019-10-08 12:00:00 AM,291.04,291.85,288.49,288.53,101575470,-0.06984367837376\n2019-10-09 12:00:00 AM,290.75,292.3,288.6559,291.27,65707329,-0.093714449761624\n2019-10-10 12:00:00 AM,291.18,294.21,291,293.24,57255974,-0.072424883582483\n2019-10-11 12:00:00 AM,296.27,298.74,296.1448,296.28,101228577,-0.111880440209373\n2019-10-14 12:00:00 AM,295.93,296.67,295.57,295.95,40546668,-0.115393682421806\n2019-10-15 12:00:00 AM,297.1,299.7,296.97,298.88,47832356,-0.12633748545401\n2019-10-16 12:00:00 AM,298.37,299.16,297.92,298.4,50563596,-0.182072586229871\n2019-10-17 12:00:00 AM,299.68,300.24,298.515,299.28,46784885,-0.156554503690822\n2019-10-18 12:00:00 AM,298.69,299.395,296.99,297.97,64338028,-0.136560370476833\n2019-10-21 12:00:00 AM,299.42,300.21,298.935,299.99,39460901,-0.121936492028043\n2019-10-22 12:00:00 AM,300.58,300.9,298.91,299.01,49126038,-0.117339874192467\n2019-10-23 12:00:00 AM,298.73,299.94,298.495,299.88,34991829,-0.137609806338593\n2019-10-24 12:00:00 AM,300.91,301.07,299.4601,300.37,35857459,-0.149363954993933\n2019-10-25 12:00:00 AM,299.74,302.2,299.6806,301.6,45205412,-0.122058926930384\n2019-10-28 12:00:00 AM,302.94,303.85,302.91,303.3,42146965,-0.130618875682761\n2019-10-29 12:00:00 AM,303,304.23,302.86,303.21,44284921,-0.085483771774729\n2019-10-30 12:00:00 AM,303.43,304.55,301.99,304.14,49643928,-0.015341607421492\n2019-10-31 12:00:00 AM,304.13,304.13,301.73,303.33,69053791,-0.071257200939535\n2019-11-01 12:00:00 AM,304.92,306.19,304.74,306.14,71141515,-0.062616857623033\n2019-11-04 12:00:00 AM,307.85,308,306.96,307.37,60606916,-0.033324833101153\n2019-11-05 12:00:00 AM,307.59,307.9195,306.71,307.03,43033885,0.039344763926092\n2019-11-06 12:00:00 AM,307.03,307.4,306.06,307.1,46487108,0.037291118025009\n2019-11-07 12:00:00 AM,308.57,309.65,307.66,308.18,54272274,-0.009448178212592\n2019-11-08 12:00:00 AM,307.8,309.0036,307.03,308.94,49068797,0.128796701292715\n2019-11-11 12:00:00 AM,307.42,308.54,307.27,308.35,35934909,0.167894403728229\n2019-11-12 12:00:00 AM,308.75,309.99,308.15,309,46484624,0.144993251847985\n2019-11-13 12:00:00 AM,307.91,309.54,307.66,309.1,54459018,0.185527677655354\n2019-11-14 12:00:00 AM,308.79,309.64,308.09,309.55,52001874,0.236442792274619\n2019-11-15 12:00:00 AM,311.02,311.84,310.26,311.79,62706192,0.308481435971894\n2019-11-18 12:00:00 AM,311.53,312.28,311.03,312.02,49327980,0.308401812557023\n2019-11-19 12:00:00 AM,312.68,312.69,311.22,311.93,67927818,0.343961098362882\n2019-11-20 12:00:00 AM,311.28,311.85,309.06,310.77,79696276,0.316145152266736\n2019-11-21 12:00:00 AM,310.89,311.01,309.39,310.27,54664690,0.310675750950586\n2019-11-22 12:00:00 AM,311.09,311.24,309.85,310.96,44850228,0.313661034351455\n2019-11-25 12:00:00 AM,311.98,313.37,311.98,313.37,48762676,0.363330039194785\n2019-11-26 12:00:00 AM,313.41,314.28,313.06,314.08,37727953,0.409160119921728\n2019-11-27 12:00:00 AM,314.61,315.48,314.37,315.48,44793179,0.421308800295305\n2019-11-29 12:00:00 AM,314.86,315.13,314.06,314.31,36592740,0.393597117325667\n2019-12-02 12:00:00 AM,314.59,314.66,311.17,311.64,76110027,0.275184693920258\n2019-12-03 12:00:00 AM,308.65,309.64,307.13,309.55,75172709,0.349324968058501\n2019-12-04 12:00:00 AM,310.7,312.12,310.32,311.46,49190402,0.378614636703184\n2019-12-05 12:00:00 AM,312.23,312.25,310.58,312.02,40781669,0.384306691781756\n2019-12-06 12:00:00 AM,314.12,315.31,314.11,314.87,48956767,0.423167939098266\n2019-12-09 12:00:00 AM,314.44,315.18,313.8,313.88,34904315,0.355188468112463\n2019-12-10 12:00:00 AM,313.82,314.55,312.81,313.53,53109165,0.316973758289444\n2019-12-11 12:00:00 AM,314.03,314.7,313.4393,314.42,53521450,0.346125153092983\n2019-12-12 12:00:00 AM,314.43,317.99,314.17,317.13,96585802,0.354747460522139\n2019-12-13 12:00:00 AM,316.87,318.67,316.02,317.32,81546487,0.30374826856071\n2019-12-16 12:00:00 AM,319.22,320.15,317.2542,319.5,82836128,0.287151834003134\n2019-12-17 12:00:00 AM,319.92,320.25,319.48,319.57,61131769,0.219532022021917\n2019-12-18 12:00:00 AM,320,320.25,319.53,319.59,48199955,0.190357660962522\n2019-12-19 12:00:00 AM,319.8,320.98,319.5246,320.9,85388424,0.239647951194195\n2019-12-20 12:00:00 AM,320.46,321.9742,319.3873,320.73,149338215,0.222260073344695\n2019-12-23 12:00:00 AM,321.59,321.65,321.06,321.22,53015641,0.180231956284472\n2019-12-24 12:00:00 AM,321.47,321.52,320.9,321.23,20270007,0.145802587198574\n2019-12-26 12:00:00 AM,321.65,322.95,321.64,322.94,31024188,0.150849610897894\n2019-12-27 12:00:00 AM,323.74,323.8,322.28,322.86,42554820,0.106157818216781\n2019-12-30 12:00:00 AM,322.95,323.1,320.55,321.08,49782730,0.097243078522149\n2019-12-31 12:00:00 AM,320.53,322.13,320.15,321.86,57106998,0.178756019426095\n2020-01-02 12:00:00 AM,323.54,324.89,322.53,324.87,59253833,0.171508025486788\n2020-01-03 12:00:00 AM,321.16,323.64,321.1,322.41,77783566,0.158818249626562\n2020-01-06 12:00:00 AM,320.49,323.73,320.36,323.64,55761948,0.175609566824186\n2020-01-07 12:00:00 AM,323.02,323.54,322.24,322.73,42854811,0.15737898843113\n2020-01-08 12:00:00 AM,322.94,325.78,322.67,324.45,68434153,0.185329040623397\n2020-01-09 12:00:00 AM,326.16,326.73,325.52,326.65,48569601,0.226551860606209\n2020-01-10 12:00:00 AM,327.2899,327.46,325.2,325.71,53057389,0.180088032311782\n2020-01-13 12:00:00 AM,326.39,327.96,325.92,327.95,47262010,0.182214787469304\n2020-01-14 12:00:00 AM,327.47,328.62,326.844,327.45,63036384,0.1695906074645\n2020-01-15 12:00:00 AM,327.35,329.02,327.26,328.19,72056598,0.136091012156513\n2020-01-16 12:00:00 AM,329.7,330.92,329.45,330.92,54050328,0.222496794229619\n2020-01-17 12:00:00 AM,331.7,332.18,330.8539,331.95,95846017,0.297644157538353\n2020-01-21 12:00:00 AM,330.9,332.18,330.82,331.3,77742415,0.218393494842357\n2020-01-22 12:00:00 AM,332.24,332.95,331.17,331.34,48914899,0.197536442372413\n2020-01-23 12:00:00 AM,330.63,332.1682,329.41,331.72,52004140,0.250844164413877\n2020-01-24 12:00:00 AM,332.44,332.53,327.36,328.77,87578442,0.201885555486425\n2020-01-27 12:00:00 AM,323.03,325.12,322.66,323.5,84062463,0.147016519074486\n2020-01-28 12:00:00 AM,325.06,327.85,323.6038,326.89,63833953,0.180313462139402\n2020-01-29 12:00:00 AM,328.38,328.63,326.4,326.62,54040889,0.168394068766126\n2020-01-30 12:00:00 AM,324.36,327.91,323.54,327.68,75491844,0.186275182101096\n2020-01-31 12:00:00 AM,327,327.17,320.73,321.73,113845576,0.076332501826993\n2020-02-03 12:00:00 AM,323.35,326.16,323.22,324.12,69242293,0.05475590280874\n2020-02-04 12:00:00 AM,328.07,330.01,327.72,329.06,62573190,0.022908743414512\n2020-02-05 12:00:00 AM,332.27,333.09,330.67,332.86,65951146,0.069634612053861\n2020-02-06 12:00:00 AM,333.91,334.19,332.8,333.98,50359688,0.089417569130272\n2020-02-07 12:00:00 AM,332.82,333.9941,331.6,332.2,64139443,0.033679477368277\n2020-02-10 12:00:00 AM,331.23,334.75,331.19,334.68,42070006,0.085682052335954\n2020-02-11 12:00:00 AM,336.16,337.02,334.684,335.26,54864533,0.0300055921384\n2020-02-12 12:00:00 AM,336.83,337.65,336.43,337.42,43992662,0.066020010846215\n2020-02-13 12:00:00 AM,335.8621,338.12,335.56,337.06,54501922,0.07091114022732\n2020-02-14 12:00:00 AM,337.51,337.73,336.2,337.6,64582210,0.070013685082478\n2020-02-18 12:00:00 AM,336.51,337.6677,335.21,336.73,57342526,0.034029166777754\n2020-02-19 12:00:00 AM,337.79,339.08,337.48,338.34,48814692,0.055894340749775\n2020-02-20 12:00:00 AM,337.7423,338.64,333.6817,336.95,74163362,0.104020414601186\n2020-02-21 12:00:00 AM,335.47,335.81,332.58,333.48,113788208,0.035700434923054\n2020-02-24 12:00:00 AM,323.14,325.85,321.24,322.42,161088409,0.006492816054931\n2020-02-25 12:00:00 AM,323.94,324.61,311.69,312.65,218913168,-0.096881809505168\n2020-02-26 12:00:00 AM,314.18,318.11,310.7,311.5,194773819,-0.200768902790467\n2020-02-27 12:00:00 AM,305.46,311.5637,297.51,297.51,284353460,-0.302466438244851\n2020-02-28 12:00:00 AM,288.7,297.892,285.54,296.26,385764020,-0.163090872274955\n2020-03-02 12:00:00 AM,298.21,309.16,294.46,309.09,238703625,-0.020416069736493\n2020-03-03 12:00:00 AM,309.5,313.84,297.57,300.24,300139150,-0.086311051749614\n2020-03-04 12:00:00 AM,306.12,313.1,303.33,312.86,176613448,-0.024297030021949\n2020-03-05 12:00:00 AM,304.98,308.47,300.01,302.46,186366809,-0.070086637868782\n2020-03-06 12:00:00 AM,293.15,298.78,290.23,297.46,228667168,-0.024852432692149\n2020-03-09 12:00:00 AM,275.3,284.19,273.45,274.23,309417350,-0.094748437444004\n2020-03-10 12:00:00 AM,284.64,288.52,273.5,288.42,276444060,-0.021459504516785\n2020-03-11 12:00:00 AM,280.7,281.94,270.88,274.36,256416563,-0.038581771983007\n2020-03-12 12:00:00 AM,256,266.66,247.68,248.11,392220670,-0.135129527809987\n2020-03-13 12:00:00 AM,263.09,271.4754,248.5237,269.32,329566100,-0.066386145095498\n2020-03-16 12:00:00 AM,241.18,256.9,237.36,239.85,297240030,-0.123693306457466\n2020-03-17 12:00:00 AM,245.04,256.17,237.07,252.8,262070471,-0.085402188265652\n2020-03-18 12:00:00 AM,236.25,248.37,228.02,240,327597130,-0.06979448613003\n2020-03-19 12:00:00 AM,239.25,247.38,232.22,240.51,289322040,-0.066254988155308\n2020-03-20 12:00:00 AM,242.53,244.47,228.5,228.8,347158790,-0.115364476026607\n2020-03-23 12:00:00 AM,228.19,229.6833,218.26,222.95,326025170,-0.108375274961681\n2020-03-24 12:00:00 AM,234.42,244.1,233.8,243.15,235494475,-0.041010274990023\n2020-03-25 12:00:00 AM,244.87,256.35,239.75,246.79,299430255,-0.0216062922892\n2020-03-26 12:00:00 AM,249.52,262.8,249.05,261.2,257632816,0.062529734990754\n2020-03-27 12:00:00 AM,253.27,260.81,251.05,253.42,224341217,-0.007445189152364\n2020-03-30 12:00:00 AM,255.7,262.43,253.53,261.65,170961866,-0.024910490015397\n2020-03-31 12:00:00 AM,260.56,263.33,256.22,257.75,194881060,-0.008577530710815\n2020-04-01 12:00:00 AM,247.98,257.6591,243.9,246.15,189554623,-0.063270270301113\n2020-04-02 12:00:00 AM,245.19,252.68,244.59,251.83,177660430,-0.022803570140845\n2020-04-03 12:00:00 AM,250.76,253.32,245.22,248.19,135561171,-0.059854730275437\n2020-04-06 12:00:00 AM,257.84,267,248.1698,264.86,188061238,0.017888461347821\n2020-04-07 12:00:00 AM,274.21,275.03,264.89,265.13,201427189,-0.072910576196774\n2020-04-08 12:00:00 AM,267.96,276,265.2542,274.03,153774487,-0.03591771876302\n2020-04-09 12:00:00 AM,277.58,281.2,275.47,278.2,190282705,0.038743855808232\n2020-04-13 12:00:00 AM,277.14,277.51,271.41,275.66,115139268,-0.007956912540422\n2020-04-14 12:00:00 AM,280.98,284.9,275.5106,283.79,134143350,0.065024114062795\n2020-04-15 12:00:00 AM,277.57,279.26,275.46,277.76,121775006,0.033523026207376\n2020-04-16 12:00:00 AM,279.15,280.03,275.76,279.1,131798325,0.039114224179174\n2020-04-17 12:00:00 AM,285.38,287.3,282.4,286.64,146684784,0.060842626241464\n2020-04-20 12:00:00 AM,282.61,286.7912,281.35,281.59,100224647,0.130603637059174\n2020-04-21 12:00:00 AM,276.73,278.04,272.02,273.04,126385698,0.130841920087818\n2020-04-22 12:00:00 AM,278.35,281,276.91,279.1,93524584,0.081085096480051\n2020-04-23 12:00:00 AM,280.49,283.94,278.75,279.08,104709693,0.071539690088647\n2020-04-24 12:00:00 AM,280.73,283.7,278.5,282.97,85165953,0.029985754134856\n2020-04-27 12:00:00 AM,285.12,288.27,284.62,287.05,77896608,0.08126145439484\n2020-04-28 12:00:00 AM,291.02,291.4,285.4,285.73,105283871,-0.001422926414607\n2020-04-29 12:00:00 AM,291.53,294.88,290.41,293.21,118745579,0.05081162106697\n2020-04-30 12:00:00 AM,291.71,293.3239,288.59,290.48,122901701,0.091167091842859\n2020-05-01 12:00:00 AM,285.31,290.6572,281.52,282.79,125180028,0.003553950885294\n2020-05-04 12:00:00 AM,280.74,283.9,279.13,283.57,80873213,0.045561930221432\n2020-05-05 12:00:00 AM,286.64,289.25,283.7134,286.19,79569938,-0.016022883822339\n2020-05-06 12:00:00 AM,288.04,288.46,283.78,284.25,73632628,0.041240665826284\n2020-05-07 12:00:00 AM,287.75,289.78,287.13,287.68,75250412,-0.021302485445589\n2020-05-08 12:00:00 AM,291.09,292.95,289.86,292.44,76622128,0.006315806097393\n2020-05-11 12:00:00 AM,290.34,294,289.88,292.5,79514231,-0.005073278995915\n2020-05-12 12:00:00 AM,293.79,294.24,286.52,286.67,95870786,-0.101415473527502\n2020-05-13 12:00:00 AM,286.06,287.19,278.965,281.6,144721099,-0.13824683542759\n2020-05-14 12:00:00 AM,278.95,285.11,276.37,284.97,121977890,-0.117445535686743\n2020-05-15 12:00:00 AM,282.37,286.33,281.34,286.28,111146276,-0.118658344012093\n2020-05-18 12:00:00 AM,293.05,296.75,292.7,295,120320229,-0.064130564447391\n2020-05-19 12:00:00 AM,294.35,296.205,291.95,291.97,95189316,-0.070537593043885\n2020-05-20 12:00:00 AM,295.82,297.87,295.57,296.93,85861691,-0.066241946212954\n2020-05-21 12:00:00 AM,296.79,297.67,293.6886,294.88,78293925,-0.036453148815428\n2020-05-22 12:00:00 AM,294.57,295.63,293.22,295.44,63958200,-0.040671649215954\n2020-05-26 12:00:00 AM,301.93,302.19,298.69,299.08,88951442,-0.089286979403634\n2020-05-27 12:00:00 AM,302.12,303.57,296.87,303.53,104817449,0.012198604511478\n2020-05-28 12:00:00 AM,304.65,306.84,302.24,302.97,90767807,-0.035642622628572\n2020-05-29 12:00:00 AM,302.46,304.96,299.47,304.32,119265702,0.02508303051682\n2020-06-01 12:00:00 AM,303.62,306.205,303.06,305.55,56779836,0.093016073385456\n2020-06-02 12:00:00 AM,306.55,308.13,305.1,308.08,74267162,0.094511823316611\n2020-06-03 12:00:00 AM,310.24,313.22,309.94,312.18,92567574,0.116688652331164\n2020-06-04 12:00:00 AM,311.11,313,309.08,311.36,75794363,0.155008254247463\n2020-06-05 12:00:00 AM,317.23,321.275,317.16,319.34,150524674,0.176442452495045\n2020-06-08 12:00:00 AM,320.22,323.41,319.63,323.2,73641217,0.184058707031193\n2020-06-09 12:00:00 AM,320.3,323.2849,319.36,320.79,77479228,0.16207210950577\n2020-06-10 12:00:00 AM,321.42,322.39,318.2209,319,95000766,0.179139484112472\n2020-06-11 12:00:00 AM,311.46,312.15,300.01,300.61,209243560,0.10454919333815\n2020-06-12 12:00:00 AM,308.24,309.08,298.6,304.21,194678879,0.050178597459014\n2020-06-15 12:00:00 AM,298.02,308.28,296.74,307.05,135782724,0.048586127100983\n2020-06-16 12:00:00 AM,315.48,315.64,307.67,312.96,137627502,0.061863632522086\n2020-06-17 12:00:00 AM,314.07,314.39,310.86,311.66,83398944,0.085527193130681\n2020-06-18 12:00:00 AM,310.005,312.3,309.51,311.78,80828658,0.102540614362876\n2020-06-19 12:00:00 AM,314.17,314.38,306.53,308.64,135549624,0.085204373272522\n2020-06-22 12:00:00 AM,307.99,311.05,306.75,310.62,74649389,0.087498030426295\n2020-06-23 12:00:00 AM,313.49,314.5,311.6101,312.05,68471246,0.098428381194885\n2020-06-24 12:00:00 AM,309.84,310.51,302.1,304.09,132813492,0.016783769196391\n2020-06-25 12:00:00 AM,303.47,307.64,301.28,307.35,89467968,0.083188204889017\n2020-06-26 12:00:00 AM,306.16,306.39,299.42,300.05,127961017,-0.007745779067094\n2020-06-29 12:00:00 AM,301.41,304.61,298.93,304.46,79773260,0.011714590240321\n2020-06-30 12:00:00 AM,303.99,310.2,303.82,308.36,113394772,0.000817368250859\n2020-07-01 12:00:00 AM,309.57,311.89,309.07,310.52,72396542,-0.013579831249518\n2020-07-02 12:00:00 AM,314.24,315.7,311.51,312.23,69344217,-0.039907609317338\n2020-07-06 12:00:00 AM,316.37,317.68,315.56,317.05,61713828,-0.033978900706699\n2020-07-07 12:00:00 AM,315.38,317.52,313.37,313.78,82909963,-0.096015445266383\n2020-07-08 12:00:00 AM,314.61,316.3,312.7,316.18,54638596,-0.062760033504306\n2020-07-09 12:00:00 AM,316.84,317.1,310.68,314.38,83354158,-0.028522861983517\n2020-07-10 12:00:00 AM,314.31,317.88,312.76,317.59,57550365,0.092979046262854\n2020-07-13 12:00:00 AM,320.13,322.71,314.13,314.84,102997484,0.04355257588827\n2020-07-14 12:00:00 AM,313.3,319.76,312,318.92,93656951,0.026008968517732\n2020-07-15 12:00:00 AM,322.41,323.04,319.265,321.85,87196524,0.01942472509847\n2020-07-16 12:00:00 AM,319.79,321.28,319.09,320.79,54622520,0.063721527997236\n2020-07-17 12:00:00 AM,321.88,322.57,319.735,321.72,62774911,0.049403012776951\n2020-07-20 12:00:00 AM,321.43,325.13,320.62,324.32,56308749,0.112550890385741\n2020-07-21 12:00:00 AM,326.45,326.93,323.94,325.01,57498967,0.066471217269233\n2020-07-22 12:00:00 AM,324.62,327.2,324.5,326.86,57792915,0.123770197818835\n2020-07-23 12:00:00 AM,326.47,327.23,321.48,322.96,75737989,0.149904189143265\n2020-07-24 12:00:00 AM,320.95,321.99,319.246,320.88,73766597,0.107378277635958\n2020-07-27 12:00:00 AM,321.63,323.41,320.775,323.22,48292970,0.214391938020084\n2020-07-28 12:00:00 AM,322.43,323.64,320.85,321.17,57494979,0.133538903683879\n2020-07-29 12:00:00 AM,322.12,325.73,322.075,325.12,48454159,0.128359963972607\n2020-07-30 12:00:00 AM,321.9,324.41,319.64,323.96,61861714,0.165073090404892\n2020-07-31 12:00:00 AM,325.9,326.63,321.33,326.52,85210755,0.256408825303431\n2020-08-03 12:00:00 AM,328.32,329.62,327.73,328.79,53077948,0.244335827065056\n2020-08-04 12:00:00 AM,327.86,330.06,327.86,330.06,41917893,0.334474948824337\n2020-08-05 12:00:00 AM,331.47,332.39,331.18,332.11,42866354,0.316024028468933\n2020-08-06 12:00:00 AM,331.4799,334.46,331.13,334.33,43679447,0.347766681252851\n2020-08-07 12:00:00 AM,333.28,334.88,332.3,334.57,57308270,0.341897236711957\n2020-08-10 12:00:00 AM,335.06,335.77,332.955,335.57,44282089,0.461531207124607\n2020-08-11 12:00:00 AM,336.85,337.54,332.01,332.8,69600882,0.366601507824282\n2020-08-12 12:00:00 AM,335.44,338.28,332.8377,337.44,53826128,0.381624258224091\n2020-08-13 12:00:00 AM,336.61,338.2514,335.83,336.83,41816146,0.352892309056163\n2020-08-14 12:00:00 AM,336.41,337.42,335.62,336.84,47260390,0.350340147495549\n2020-08-17 12:00:00 AM,337.94,338.34,336.8517,337.91,35480974,0.337756513515973\n2020-08-18 12:00:00 AM,338.34,339.1,336.61,338.64,38733908,0.381435793365019\n2020-08-19 12:00:00 AM,339.05,339.61,336.62,337.23,68054244,0.301123422854845\n2020-08-20 12:00:00 AM,335.36,338.8,335.22,338.28,42207826,0.373899107081965\n2020-08-21 12:00:00 AM,337.92,339.72,337.55,339.48,55106628,0.408444500894128\n2020-08-24 12:00:00 AM,342.12,343,339.4504,342.92,48588662,0.413217910120533\n2020-08-25 12:00:00 AM,343.53,344.21,342.27,344.12,38463381,0.498760419277583\n2020-08-26 12:00:00 AM,344.76,347.86,344.17,347.57,50790237,0.50793679009127\n2020-08-27 12:00:00 AM,348.51,349.9,346.53,348.33,58034142,0.464362583632765\n2020-08-28 12:00:00 AM,349.44,350.72,348.15,350.58,48588940,0.442546681620021\n2020-08-31 12:00:00 AM,350.35,351.3,349.06,349.31,66099183,0.37851297548881\n2020-09-01 12:00:00 AM,350.21,352.71,349.24,352.6,54999325,0.383129211953384\n2020-09-02 12:00:00 AM,354.67,358.75,353.43,357.7,69540035,0.391694354802331\n2020-09-03 12:00:00 AM,355.87,356.38,342.59,345.39,148011129,0.242995049929745\n2020-09-04 12:00:00 AM,346.13,347.83,334.87,342.57,139156281,0.212447895591884\n2020-09-08 12:00:00 AM,336.71,342.64,332.88,333.21,114465322,0.088594728885988\n2020-09-09 12:00:00 AM,337.55,342.46,336.61,339.79,91462290,0.13113106558337\n2020-09-10 12:00:00 AM,341.82,342.53,332.85,333.89,90569548,0.047166018677641\n2020-09-11 12:00:00 AM,335.82,336.97,331,334.06,84680194,0.052476587946632\n2020-09-14 12:00:00 AM,337.49,340.38,334.2208,338.46,65605686,0.057401153768896\n2020-09-15 12:00:00 AM,341.12,342.02,338.4683,340.17,52920862,0.04464631511894\n2020-09-16 12:00:00 AM,341.51,343.06,338.52,338.82,82211256,-0.021843206451497\n2020-09-17 12:00:00 AM,333.56,337.6996,332.991,335.84,91523339,0.018364029498213\n2020-09-18 12:00:00 AM,335.37,335.49,327.97,330.65,105877942,-0.021160314230225\n2020-09-21 12:00:00 AM,325.7,327.13,321.73,326.97,99450829,0.011055424260041\n2020-09-22 12:00:00 AM,328.57,330.9,325.86,330.3,63612107,0.012232218808755\n2020-09-23 12:00:00 AM,330.9,331.2,322.1,322.64,93112240,-0.058171731975513\n2020-09-24 12:00:00 AM,321.22,326.797,319.8,323.5,76681332,-0.07991181694192\n2020-09-25 12:00:00 AM,322.58,329.58,321.64,328.73,71069426,-0.048949730832656\n2020-09-28 12:00:00 AM,333.22,334.96,332.15,334.19,64584614,-0.056670220882713\n2020-09-29 12:00:00 AM,333.97,334.77,331.6209,332.37,51531594,-0.042933649728329\n2020-09-30 12:00:00 AM,333.09,338.29,332.88,334.89,104081136,-0.086195264499149\n2020-10-01 12:00:00 AM,337.69,338.74,335.01,337.04,88698745,-0.104512120285571\n2020-10-02 12:00:00 AM,331.7,337.0126,331.19,333.84,89431112,-0.061648819348872\n2020-10-05 12:00:00 AM,336.06,339.96,336.01,339.76,45713108,-0.056041867984809\n2020-10-06 12:00:00 AM,339.91,342.17,334.38,334.93,90128883,-0.038599675715159\n2020-10-07 12:00:00 AM,338.12,341.63,338.09,340.76,56999597,-0.026053186706925\n2020-10-08 12:00:00 AM,342.85,343.85,341.86,343.78,45242476,0.047469788771256\n2020-10-09 12:00:00 AM,345.56,347.35,344.89,346.85,59528606,0.070431184564225\n2020-10-12 12:00:00 AM,349.59,354.02,349.06,352.43,80388533,0.072483431644151\n2020-10-13 12:00:00 AM,352.28,352.4651,349.09,350.13,73255513,0.054628378066156\n2020-10-14 12:00:00 AM,350.75,351.93,347.14,347.93,57958749,0.077049380734238\n2020-10-15 12:00:00 AM,343.71,348.02,343.13,347.5,60357659,0.097818561423823\n2020-10-16 12:00:00 AM,348.96,350.75,347.1,347.29,89501868,0.064855237776124\n2020-10-19 12:00:00 AM,348.65,349.33,341.04,342.01,68425614,-0.03579348663173\n2020-10-20 12:00:00 AM,343.46,346.88,342.64,343.38,60051880,-0.097251082184503\n2020-10-21 12:00:00 AM,343.33,348.6847,342.4,342.73,63574979,-0.08129745308831\n2020-10-22 12:00:00 AM,342.96,345.24,340.65,344.61,55399292,-0.056554127021353\n2020-10-23 12:00:00 AM,345.93,345.99,343.13,345.78,49143511,-0.067755343953542\n2020-10-26 12:00:00 AM,342.13,342.98,335.62,339.39,91473002,-0.085954200795727\n2020-10-27 12:00:00 AM,339.76,340.12,337.99,338.22,65994108,-0.102784093838538\n2020-10-28 12:00:00 AM,332.1,332.84,326.13,326.66,127094307,-0.157713455637955\n2020-10-29 12:00:00 AM,326.91,333.395,325.09,329.98,90596689,-0.151698843248695\n2020-10-30 12:00:00 AM,328.28,329.69,322.6,326.54,120448685,-0.133678132367382\n2020-11-02 12:00:00 AM,330.2,332.36,327.24,330.2,86068299,-0.148588747382156\n2020-11-03 12:00:00 AM,333.69,338.25,330.2935,336.03,93294192,-0.068908898116946\n2020-11-04 12:00:00 AM,340.86,347.94,339.59,343.54,126959700,-0.088722900371873\n2020-11-05 12:00:00 AM,349.24,352.19,348.86,350.24,82039749,-0.121714380226285\n2020-11-06 12:00:00 AM,349.93,351.51,347.65,350.16,74972973,-0.12846728735735\n2020-11-09 12:00:00 AM,363.97,364.38,354.06,354.56,172304203,-0.229495727022154\n2020-11-10 12:00:00 AM,353.49,355.18,350.51,354.04,85552022,-0.186087157303557\n2020-11-11 12:00:00 AM,356.4,357.56,355.06,356.67,58649048,-0.153646158609706\n2020-11-12 12:00:00 AM,355.58,356.7182,351.26,353.21,68118563,-0.191673702704326\n2020-11-13 12:00:00 AM,355.27,358.9,354.71,358.1,62959429,-0.124729504050949\n2020-11-16 12:00:00 AM,360.98,362.78,359.59,362.57,74541138,-0.055749789572226\n2020-11-17 12:00:00 AM,359.97,361.92,358.34,360.62,66111009,-0.022212934192146\n2020-11-18 12:00:00 AM,360.91,361.5,356.24,356.28,70591299,-0.029449306470647\n2020-11-19 12:00:00 AM,355.6,358.18,354.15,357.78,59940947,-0.024825805995395\n2020-11-20 12:00:00 AM,357.5,357.72,355.25,355.33,70411890,-0.086177055457969\n2020-11-23 12:00:00 AM,357.28,358.82,354.865,357.46,63230608,-0.077412706258669\n2020-11-24 12:00:00 AM,360.21,363.81,359.29,363.22,62415877,-0.020554179333853\n2020-11-25 12:00:00 AM,363.13,363.16,361.48,362.66,45330890,0.055115222725381\n2020-11-27 12:00:00 AM,363.84,364.18,362.58,363.67,28514072,0.053632017619425\n2020-11-30 12:00:00 AM,362.83,363.12,359.17,362.06,83872709,0.071470788519949\n2020-12-01 12:00:00 AM,365.57,367.68,364.93,366.02,74504969,0.053059519037133\n2020-12-02 12:00:00 AM,364.82,366.96,364.2,366.79,45927000,0.05410882789503\n2020-12-03 12:00:00 AM,366.68,368.19,365.5,366.69,62869773,0.056276531727402"
  },
  {
    "path": "Tests/TestData/spy_cmo.txt",
    "content": "Date,Open,High,Low,Close,Volume,CMO_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,3.33333333333376\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,16.1904761904763\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,34.5850688881771\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,37.2249980782538\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,41.1812157879577\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,50.3927955838025\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,57.7810753414314\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,42.0888471576541\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,46.286242593133\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,59.9691388160003\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,18.9117236556634\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,-8.9889887299814\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,-18.9408992362486\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,15.6481374038956\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,-20.1135651872407\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,11.705814363461\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-4.81624465007721\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,22.5133698436042\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,22.5133698436042\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,33.0687404438309\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,9.07796869856167\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,28.9606946808915\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,-17.5678752011546\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.25601484242523\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,-17.182299315145\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,11.6361176472599\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,23.6990411740758\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,52.5116402875117\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,57.894393804793\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,42.7275121943281\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,-33.0854423864371\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,5.82518154193095\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,-22.5893606526912\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-32.1880470779673\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,-8.87573595247637\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,2.22324415700837\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,24.6323187312978\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,25.9499616221133\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,35.0360137076931\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,26.5445702926906\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,43.3900244798155\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,48.6654371015415\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,4.02304328195323\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,31.1562575999822\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,50.4522110273415\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,54.4878130519331\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,62.1872994497967\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,68.246947646484\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,49.6164221154533\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,56.5463982970056\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,58.3047541516308\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,74.8453841563603\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,80.0541170702947\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,46.7619239572343\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,63.8844804754416\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,63.4737241660405\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,66.0281148208109\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,14.3719708681865\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,-0.593329563227948\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,-5.11958661410102\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,25.0471835921177\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-10.124028907302\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,8.12104284373583\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-40.1991079748021\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,-15.7476015187902\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-29.2805869189041\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-55.2977192531279\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,-20.0889269278288\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,14.3325439488322\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,14.3325439488322\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,-16.4120486987037\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-34.02311152808\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,9.4378926720938\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,-6.44092338631133\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,12.8866905646015\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,29.4161229069002\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,-8.72090811316836\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-44.7282601417834\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-46.8631931711047\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-58.9387124246744\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,-30.9858839165496\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,-6.61610450016225\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,6.41474543070483\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,-3.89444407708575\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,11.3884912369784\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,8.21330977550903\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,9.71459283389935\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,40.1374179339457\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,51.1376127013386\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,62.1645106723437\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,62.69953335616\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,77.5683280794243\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,77.9107550057608\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,81.192013946905\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,53.1915607015326\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,58.6441288451799\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,68.467572035654\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,71.2510745702353\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,74.3628398026931\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,51.9370624009051\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,18.9907996161162\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,31.3041229951805\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,36.593149945522\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,6.87819533424984\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,6.87819533424984\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,13.6514749263379\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,65.1461228736336\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,68.6244607643959\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,52.2512598616945\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,3.50692396715975\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,-15.6364713433582\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,8.26932291113066\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,-10.0926010242375\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,-17.2525709935771\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,6.11277824183617\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,-25.9723163556638\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-63.4479992743511\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-68.1456888282802\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-75.676641113576\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,-43.3130574390285\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-56.0559457031781\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,-10.4254550096378\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,2.83320080730289\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,-11.8194667306232\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-50.0967824697639\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,-34.2705915306522\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,-26.7800811328179\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-35.7419404910289\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,-11.4718002959393\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,20.9839020866452\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,25.1881360096291\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,27.0367912385148\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,54.7909464782615\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,67.0203382714102\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,71.1848536562467\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,50.9541910864433\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,56.3938716275222\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,67.8785556497376\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,74.4115589708527\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,84.6069530734776\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,72.056104301169\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,7.68207989671158\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,-8.8299254876556\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,-16.8953058703696\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,-26.8098205175679\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,-5.86705521017372\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,-24.5564249944973\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,-41.3510759049731\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,-0.162752350578628\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,-4.35378588881881\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-36.7258052818811\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,-1.69856221088988\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,-28.1496484494166\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-50.4219412648409\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-46.9187023081311\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,21.268601757884\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,33.1158605390703\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,40.1400857665432\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,13.0722212528674\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,40.5196559647985\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,50.0800691255729\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,58.5523628030094\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,58.6273805808772\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,66.3227925827602\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,39.372479756944\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,46.8110907437911\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,56.0981262310464\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,59.2137689722898\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,68.5731193814935\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,32.888286609163\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,15.5202471506889\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,25.7145421873158\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,39.2431275369067\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,15.4955105773212\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,37.0599378686749\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-23.5972801292299\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,21.9140052873649\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,22.368228109771\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,12.5479320019903\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,37.3412027274382\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,48.729160383843\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,57.2423486861995\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,34.666800185908\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,21.2016447056458\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,2.75968643868123\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,34.6978766321699\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,48.0326234817924\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,40.8425810050312\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,41.8237132082065\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,50.7996395933029\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,43.2641842942587\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,15.1044822677479\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,-18.2353147098563\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,-18.987402740386\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-44.2891214560145\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,27.432703242889\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,36.5064234102243\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,11.8120232957901\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-34.4678713813506\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-43.0340167501357\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-43.3478044443087\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,-3.71433487938357\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-18.2268777954994\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,41.1259075384226\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,35.2808256813173\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,36.378755967202\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,50.8279550356982\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,55.9811713102178\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,66.1731680215714\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,66.1731680215714\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,64.2356679498211\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,74.8609024161893\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,-0.394309321232087\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,-1.5907101425331\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,-17.6618605556766\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,18.2721467279796\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,19.3714331458127\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,23.2430277298089\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,38.5989386111981\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-37.8580935723929\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,11.5051370640022\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,27.6216814111247\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,20.9469346606015\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,-0.471334583450061\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,12.9448650540695\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,16.0038360766029\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,-25.2887869900233\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-65.2377569222222\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-69.7934002719283\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,-41.8109953824447\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-56.3888688558587\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,-16.5091082999794\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,-29.1265606965746\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-58.8288792462065\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,-37.1492741440453\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,-38.9568752159523\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0.421680497298468\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,25.5414232961128\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,28.9041821298534\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,46.8247828396075\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,47.5793488122427\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,55.7728935336988\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,63.4465349613122\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,65.095479219251\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,25.7680944819651\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,41.2533091902271\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,34.4369745275345\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,49.2932234380017\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,46.4465528410765\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,46.6282801899137\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,62.1865401390573\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,67.860931081931\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,10.2299599675908\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,51.5218321031431\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,53.278288935215\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,58.0804571347003\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,59.059063299621\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,53.461352505979\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,8.90622416950763\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,10.6496048294961\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,-44.8065889393965\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-52.2188521353948\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,1.10017849416408\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,26.670566373271\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,1.90741256481743\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,22.5396455616673\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,-10.8072165513829\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,-23.7006410906455\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,-2.52767771933307\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,-26.4799878063913\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-32.5132784191462\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,-6.92149767549297\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,23.8033225578288\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,41.0712328161877\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,48.4854087017783\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,39.7629851974872\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,-15.5500626697343\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,-42.0381261759945\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,-24.089099780914\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,12.217962847103\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-34.9129106915387\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-46.5853392034194\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,-22.6178624039818\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,-3.90600324532444\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,19.4946774272168\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,22.5603364993508\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,30.5220387671593\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,40.5183755319245\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,28.5506441315759\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,34.5667838439691\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,-5.6695653269465\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,7.5662999266338\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,24.9041618220498\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,34.7514146564961\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,34.9418392280955\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,23.2514914471578\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,33.2587337228606\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,-23.52435245381\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,8.98978851993228\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,2.83774275484775\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,11.5726519937119\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,49.0171484693409\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,51.4065386490804\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,15.5646074706832\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,-25.2389333241506\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,-6.78465257038965\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,10.6797401375399\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-18.1711384028862\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,17.5142241758261\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,25.6816552895864\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,38.2989137650117\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,53.4928679678884\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,48.0401903055713\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,60.4569648772541\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,63.8392854038374\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,66.3895764499608\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,59.9789153000428\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,66.3072296930488\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,79.4378208944627\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,84.8758446951379\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,85.8797039533474\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,85.9958935161968\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,37.803993516954\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,-16.8493342475054\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,3.58584862204361\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,8.98168839734439\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,26.366743137575\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,54.8889253976307\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,58.0163415659612\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,30.300415349422\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,27.201657305405\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,-19.7279548439235\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,10.9117879913442\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,5.54066903220884\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,18.8706791494818\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,13.5974039500033\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,49.9526984739321\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,53.6727274394887\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,68.0639709490217\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,31.6892754207062\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,-12.087247745306\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,12.9706916297426\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,-9.45623001291912\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,-0.797892623111658\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,26.0229524354011\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,12.0893932804009\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,30.9244835344829\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-28.2786396165553\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,14.6195969281949\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,6.39195074355936\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,22.5455666341006\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,30.2440001452168\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,30.4404132279553\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,-1.72699338293809\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.900799222700185\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,-24.8735052783602\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,-23.4819255805681\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-72.732910685348\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-75.6984110582904\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,-33.0764661377766\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-52.5407796456806\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,-50.7911764266581\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-60.5859928410127\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,-5.04633750536374\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,5.15782683936852\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,-0.550636407464952\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,25.0678629278302\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,38.7641063854949\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,37.3992097594295\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,58.3798946737202\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,67.0495935243363\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,70.9427669615897\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,74.9856753001362\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,60.1029430939709\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,70.3671129099415\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,71.54492157972\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,66.4556461062673\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,58.3797546992104\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,68.3317155764222\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,59.944670898037\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,49.6896294854932\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,23.5784885552487\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,54.421157476796\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,19.5692419774748\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-29.2078125555584\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.696202757004998\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,8.78841595197013\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-28.3422459522521\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-32.058460927318\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,19.8799647683989\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,26.3935615785718\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,47.5261500692959\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,7.24120098717412\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,-27.1650484894363\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,-43.754930255943\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,-3.63589255969433\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-44.1272314400348\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,-14.891526317975\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,-19.5962257143965\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,-26.892969201901\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-53.8018313614854\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,-53.0108279439275\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,-4.90364218873504\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,-8.75761367637663\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-45.2777991664725\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,6.76028980628789\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-29.6069196053947\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-43.2404229928914\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-57.7818833919007\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-53.2352368636913\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,-59.6069528435188\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,-60.4554503655825\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,-17.8916988600393\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,7.59526361471139\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,40.6413064142261\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,20.8638904707334\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,38.4309178998325\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,48.0786046256853\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,43.035624591465\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,57.9521455484328\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,51.3469362119329\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,60.1624255402403\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,71.6782955805071\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,72.1635676452681\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,51.5130344545804\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,61.8820072088389\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,67.4341918318308\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,68.7680556511998\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,73.3620171698927\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,74.8094109077951\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,62.65704256896\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,65.767011810274\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,66.5245866008508\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,68.7706741207466\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,82.2690479083307\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,58.3435414323718\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,64.6678969744642\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,77.6361353349818\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,81.9923870399197\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,71.211083717711\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,77.1814471104321\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,45.8031616082094\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,-15.4513001452055\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,22.2566660792459\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,37.5843387222901\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,28.4810171598556\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,36.272479861001\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,-12.4622773616553\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,-16.2338497916208\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-63.1524856296487\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,-33.9655116304214\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-61.528312264083\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,-68.4188827035864\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-74.9271876936064\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,-7.668267887274\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,33.4608067337766\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,30.2209566938392\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,37.1854811963013\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,39.413341224924\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,39.6045966345483\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,46.6560224405783\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,49.7225011979536\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,16.2960940928432\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,-23.1501020819597\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,-24.8514613026838\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-61.1303766388288\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-70.3069133142301\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,-22.810585508902\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,18.2685989968885\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,-0.795522395899095\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-17.0105058989162\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-22.6411747765213\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,-34.5261837656943\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-49.2309123526933\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,-6.72927828202013\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,-0.946243656340545\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,13.4326164571606\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,43.1245676526085\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,23.3382984775403\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,28.5807881693194\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,-13.2740887522417\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,-37.6241691398263\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,-10.1236689423346\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-33.0749365144385\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,-1.55219917734325\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,24.7786421313531\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,14.8365601032979\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,32.5725829933262\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,23.6648542427891\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,8.90194688470872\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,32.6991061039562\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,33.887429988082\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,51.6017801411802\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,57.7213104553223\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,60.1387998336019\n"
  },
  {
    "path": "Tests/TestData/spy_coppock_curve.csv",
    "content": "Date,Open,High,Low,Close,Volume ,roc_11,roc_14,roc_sum,CoppockCurve\n2015-03-03 10:50:00,211.03,211.16,211.01,211.105,2104200.0,,,,\n2015-03-03 11:00:00,211.105,211.105,210.82,210.9,2143600.0,,,,\n2015-03-03 11:10:00,210.89,210.91,210.72,210.835,3265200.0,,,,\n2015-03-03 11:20:00,210.83900000000003,210.97,210.67,210.86,3390800.0,,,,\n2015-03-03 11:30:00,210.86,210.94,210.69,210.77,2267300.0,,,,\n2015-03-03 11:40:00,210.76,210.77,210.31,210.46,3677600.0,,,,\n2015-03-03 11:50:00,210.45,210.46,210.19,210.3599,5640100.0,,,,\n2015-03-03 12:00:00,210.35,210.59,210.3,210.5,1829900.0,,,,\n2015-03-03 12:10:00,210.49,210.49,210.32,210.405,3182400.0,,,,\n2015-03-03 12:20:00,210.405,210.47,210.375,210.4332,833700.0,,,,\n2015-03-03 12:30:00,210.435,210.44,210.08,210.261,2668500.0,,,,\n2015-03-03 12:40:00,210.27,210.51,210.23,210.47,1273200.0,-0.3007981809999727,,,\n2015-03-03 12:50:00,210.46,210.48,210.4,210.468,980400.0,-0.20483641536274133,,,\n2015-03-03 13:00:00,210.46,210.76,210.45,210.73,3072300.0,-0.049801977849983636,,,\n2015-03-03 13:10:00,210.74,210.9,210.73,210.79,2435000.0,-0.03319738214930812,-0.1492148456929021,-0.18241222784221023,\n2015-03-03 13:20:00,210.79,210.81,210.63,210.68,902100.0,-0.04270057408549688,-0.10431484115694944,-0.14701541524244632,\n2015-03-03 13:30:00,210.68,210.83,210.64,210.82,834600.0,0.1710538819728047,-0.007114568264288135,0.16393931370851655,\n2015-03-03 13:40:00,210.83,210.92,210.74,210.76,1712500.0,0.19019784664282557,-0.0474248316418624,0.14277301500096318,\n2015-03-03 13:50:00,210.76,210.815,210.67,210.81,1410500.0,0.14726840855106005,0.018978032926875166,0.16624644147793521,\n2015-03-03 14:00:00,210.81,210.89,210.72,210.745,1079600.0,0.16159311803427556,0.13541765656182037,0.29701077459609593,\n2015-03-03 14:10:00,210.7465,210.98,210.74,210.9768,1518100.0,0.2583242568187982,0.29325931415635775,0.551583570975156,\n2015-03-03 14:20:00,210.9768,211.1,210.97,211.1,1441600.0,0.3990278748793097,0.2850356294536782,0.6840635043329879,\n2015-03-03 14:30:00,211.0999,211.21,211.03,211.1962,2578600.0,0.3450372974770799,0.37603669114327776,0.7210739886203577,\n2015-03-03 14:40:00,211.1962,211.23,211.0201,211.05,1316600.0,0.27652659786761014,0.29310964239483983,0.56963624026245,0.4494433659902958\n2015-03-03 14:50:00,211.06,211.09,210.81,210.925,1837700.0,0.09253547193091016,0.3157979844098602,0.40833345634077034,0.4697421906724393\n2015-03-03 15:00:00,210.93,211.07,210.89,211.005,1793600.0,0.10199724844632829,0.2541929966265899,0.3561902450729182,0.469819600866192\n2015-03-03 15:10:00,211.0,211.09,210.95,210.98,1554500.0,0.14239605088284257,0.2432673850656597,0.3856634359485023,0.46610657921340776\n2015-03-03 15:20:00,210.98,211.0,210.82,210.91,1152500.0,0.04269044682667644,0.08541735870546407,0.12810780553214052,0.41153391344419454\n2015-03-03 15:30:00,210.91,211.15,210.891,211.109,1875200.0,0.1655911937749277,0.15133545234593537,0.3169266461208631,0.3915585861360003\n2015-03-03 15:40:00,211.1,211.21,211.04,211.0725,3044800.0,0.12451970969118431,0.18630149990506162,0.31082120959624593,0.367733539375277\n2015-03-03 15:50:00,211.0601,211.08,210.93,211.04,3821700.0,0.13997959619445055,0.10435442557632513,0.24433402177077568,0.33156881419173817\n2015-03-03 16:00:00,211.045,211.16,211.01,211.12,8205100.0,0.0678747615851627,0.1708104004555011,0.2386851620406638,0.2999633790428041\n2015-03-04 09:40:00,210.42,210.45,209.67,209.67,6362100.0,-0.6774040738986242,-0.540771310658894,-1.2181753845575183,0.011571996190424597\n2015-03-04 09:50:00,209.68,209.76,209.43,209.57,6035200.0,-0.7699949146812379,-0.557545849249097,-1.327540763930335,-0.26144492158105104\n2015-03-04 10:00:00,209.56,209.67,209.37,209.62,4741600.0,-0.6775645581615808,-0.6431038863040861,-1.320668444465667,-0.49871819937362727\n2015-03-04 10:10:00,209.62,209.74,209.35,209.42,6565800.0,-0.7135237643712378,-0.7958313595452404,-1.5093551239164782,-0.7388617479607794\n2015-03-04 10:20:00,209.43,209.45,209.06,209.36,3634300.0,-0.7796023790905382,-0.8694285219146947,-1.6490309010052329,-0.9704818856733527\n2015-03-04 10:30:00,209.35,209.44,209.26,209.37,2229600.0,-0.7631055076310456,-0.7960199004975133,-1.5591254081285588,-1.1487611276455536\n2015-03-04 10:40:00,209.36,209.63,209.26,209.53,2894200.0,-0.6543075245365348,-0.6613725257793135,-1.3156800503158483,-1.252100609767067\n2015-03-04 10:50:00,209.52,209.73,209.33,209.4,2348400.0,-0.8095344111335834,-0.7606454823345321,-1.5701798934681155,-1.3720290325265068\n2015-03-04 11:00:00,209.41,209.61,209.305,209.595,1756300.0,-0.6999964467185427,-0.6564603279931691,-1.3564567747117118,-1.418898686365431\n2015-03-04 11:10:00,209.59,209.83,209.55,209.82,2165400.0,-0.5780894617134158,-0.516808117206391,-1.0948975789198068,-1.3891068355788718\n2015-03-04 11:20:00,209.815,210.09,209.74,210.04,2795600.0,-0.5115574081091423,-0.5063734847874923,-1.0179308928966346,-1.321074082952455\n2015-03-04 11:30:00,210.04,210.06,209.92,209.96,1951000.0,0.13831258644536604,-0.5270700825545593,-0.3887574961091933,-1.142286976213065\n2015-03-04 11:40:00,209.96,210.19,209.94,210.11,2713100.0,0.2576704681013675,-0.4406747536012001,-0.1830042854998326,-0.9431589815050846\n2015-03-04 11:50:00,210.11,210.18,210.06,210.08,1713900.0,0.2194447094742813,-0.49261083743842304,-0.27316612796414175,-0.7811088519536301\n2015-03-04 12:00:00,210.08,210.1,209.95,210.01,1231000.0,0.2817304937446252,0.16215958410836784,0.44389007785299306,-0.51116103036183\n2015-03-04 12:10:00,210.02,210.11,209.94,210.09,990500.0,0.34868169659916237,0.24812711743094074,0.5968088140301031,-0.2514629108988867\n2015-03-04 12:20:00,210.09,210.37,210.071,210.295,2304000.0,0.44180159526197027,0.3220112584676915,0.7638128537296618,-0.0005992246207265885\n2015-03-04 12:30:00,210.29,210.34,210.24,210.27,1314800.0,0.353171383572759,0.40588291471683746,0.7590542982895965,0.2115903078675033\n2015-03-04 12:40:00,210.27,210.38,210.24,210.31,931300.0,0.4345749761222484,0.4537638517386311,0.8883388278608795,0.4049364058821899\n2015-03-04 12:50:00,210.31,210.49,210.3,210.41,1414600.0,0.3888451537488846,0.49672828007831793,0.8855734338272025,0.5569652394803427\n2015-03-04 13:00:00,210.41,210.42,210.19,210.2,1040700.0,0.18110761605185655,0.3197632797212746,0.5008708957731312,0.6030395932005367\n2015-03-04 13:10:00,210.21,210.24,210.15,210.19,949300.0,0.07141496857741014,0.37726838586435996,0.4486833544417701,0.6120107250664877\n2015-03-04 13:20:00,210.19,210.27,210.12,210.2,711700.0,0.11430748714040817,0.28865192394855743,0.4029594110889656,0.5974422154037294\n2015-03-04 13:30:00,210.2,210.4,210.17,210.29,669300.0,0.08566941126075811,0.22400152511676819,0.3096709363775263,0.555258279491822\n2015-03-04 13:40:00,210.28,210.35,210.23,210.265,1188900.0,0.0880616907844578,0.10712245286612632,0.19518414365058412,0.4816615255506223\n2015-03-04 13:50:00,210.28,210.31,210.06,210.1,1614800.0,0.04285510213799526,0.06667936749855663,0.10953446963655189,0.39701402968327865\n2015-03-04 14:00:00,210.11,210.17,209.86,209.92,1749700.0,-0.08091770193727754,-0.09042882299749033,-0.17134652493476787,0.2701567956101232\n2015-03-04 14:10:00,209.92,210.1,209.92,210.03,1723800.0,-0.1260134572861893,-0.02380045696878108,-0.14981391425497037,0.16421747945446605\n2015-03-04 14:20:00,210.03,210.07,209.78,209.86,2009100.0,-0.1949873971560323,-0.0714251702299773,-0.2664125673860096,0.0536032847757939\n2015-03-04 14:30:00,209.87,209.96,209.83,209.92,1113000.0,-0.185440540155013,-0.08091770193727754,-0.26635824209229053,-0.03600555266316772\n2015-03-04 14:40:00,209.92,210.02,209.86,209.91,1454500.0,-0.23763129128843152,-0.18307615492522133,-0.42070744621365286,-0.13273366947111354\n2015-03-04 14:50:00,209.92,210.14,209.89,210.1,1284200.0,-0.04757373929590303,-0.08084843296713995,-0.12842217226304298,-0.1595630393428251\n2015-03-04 15:00:00,210.1,210.26,210.09,210.23,2953500.0,0.01903040106570053,-0.0380390851600132,-0.019008684094312667,-0.15600621997104366\n2015-03-04 15:10:00,210.23,210.28,209.98,210.07,2262600.0,-0.06184586108467505,-0.1615892780761352,-0.22343513916081026,-0.18194569978983854\n2015-03-04 15:20:00,210.08,210.29,210.06,210.16,2840800.0,-0.06181939226781452,-0.01902949571835899,-0.08084888798617351,-0.17226756893072967\n2015-03-04 15:30:00,210.16,210.21,210.05,210.2,2299100.0,-0.030913371222029973,0.0047576002664140304,-0.026155770955615942,-0.14762645258176024\n2015-03-04 15:40:00,210.2,210.35,210.18,210.285,3795000.0,0.0880533079485879,0.04043767840151702,0.12849098635010492,-0.09240064871189305\n2015-03-04 15:50:00,210.285,210.29,210.13,210.26,5769900.0,0.16196646341464227,-0.014266013600261473,0.1477004498143808,-0.039133806235518834\n2015-03-04 16:00:00,210.26,210.27,210.14,210.23,8287900.0,0.09522449173926528,-0.016645661427250324,0.07857883031201496,-0.0038438830153811583\n2015-03-05 09:40:00,210.63,210.65,210.2,210.28,5286700.0,0.2001334222815121,0.08567348881485248,0.2858069110963646,0.06285130220740145\n2015-03-05 09:50:00,210.28,210.51,210.12,210.51,2548900.0,0.281059451219523,0.281059451219523,0.562118902439046,0.1697456648890597\n2015-03-05 10:00:00,210.51,210.64,210.51,210.56,2278500.0,0.3096565194607326,0.25234490310908075,0.5620014225698133,0.2587490976189902\n2015-03-05 10:10:00,210.56,210.72,210.44,210.67,2331600.0,0.27129938124701436,0.3859716001143543,0.6572709813613686,0.3525211120413334\n2015-03-05 10:20:00,210.67,210.75,210.51,210.52,1973900.0,0.13794415640013824,0.2858231707317138,0.42376732713185206,0.39154192268638843\n2015-03-05 10:30:00,210.52,210.74,210.52,210.73,1176100.0,0.31418098728994703,0.3906436091658305,0.7048245964557776,0.4698967374577451\n2015-03-05 10:40:00,210.73,210.78,210.64,210.64,1361600.0,0.22839741149600634,0.25702046644455745,0.4854178779405638,0.49407444914557297\n2015-03-05 10:50:00,210.645,210.75,210.64,210.74,1411200.0,0.25689819219791854,0.24259144746230366,0.4994896396602222,0.5115093238934082\n2015-03-05 11:00:00,210.74,210.8,210.64,210.675,1624900.0,0.18546258648977076,0.28799923834912367,0.47346182483889443,0.5174664386135452\n2015-03-05 11:10:00,210.68,210.685,210.35,210.375,1768000.0,0.05469418814800786,0.10230300723259589,0.15699719538060375,0.45996159570445655\n2015-03-05 11:20:00,210.375,210.4,210.14,210.34,1933700.0,0.05232364553109381,0.06660323501428422,0.11892688054537803,0.3941090889149888\n2015-03-05 11:30:00,210.35,210.4,210.28,210.39,1893200.0,0.05231120410880141,0.0499322348241682,0.10224343893296961,0.3282574114787375\n2015-03-05 11:40:00,210.39,210.55,210.375,210.47,1379700.0,-0.019001472614121884,0.09987634357462305,0.08087487096050117,0.2668819119294205\n2015-03-05 11:50:00,210.475,210.6,210.47,210.545,1025200.0,-0.00712386018237865,0.1498358940208222,0.14271203383844355,0.22549728838717148\n2015-03-05 12:00:00,210.55,210.68,210.53,210.62,1195300.0,-0.023733801680347888,0.16168917633632152,0.13795537465597363,0.19260343494852658\n2015-03-05 12:10:00,210.62,210.63,210.5,210.55,807500.0,0.014250427512818575,0.019001472614132986,0.03325190012695156,0.14586916709507544\n2015-03-05 12:20:00,210.55,210.6,210.39,210.4466,755500.0,-0.13448488587292085,-0.053856382978734185,-0.18834126885165503,0.07105564481512903\n2015-03-05 12:30:00,210.44,210.44,210.29,210.31799999999998,911700.0,-0.15286745157615522,-0.16708596382968288,-0.3199534154058381,-0.015437192351173941\n2015-03-05 12:40:00,210.32,210.41,210.29,210.37,728700.0,-0.17557179462845962,-0.07125213756412618,-0.2468239321925858,-0.0737347952047754\n2015-03-05 12:50:00,210.37,210.38,210.19,210.22,1314300.0,-0.2159724694434595,-0.24201584966544454,-0.45798831910890403,-0.1573298182789533\n2015-03-05 13:00:00,210.22,210.22,209.85,209.955,4517800.0,-0.19964349376113688,-0.3251993923281349,-0.5248428860892718,-0.2418986623588433\n2015-03-05 13:10:00,209.95,210.11,209.88,210.05,906800.0,-0.13787201673480798,-0.32741767106386765,-0.46528968779867563,-0.3039347473561768\n2015-03-05 13:20:00,210.05,210.18,210.04,210.12,1025900.0,-0.12833309567944484,-0.26343894624422104,-0.3917720419236659,-0.34228520352656955\n2015-03-05 13:30:00,210.13,210.29,209.97,210.21,1075100.0,-0.12353304508955221,-0.07843137254901489,-0.2019644176385671,-0.3375316023199594\n2015-03-05 13:40:00,210.21,210.31,210.19,210.3,968300.0,-0.11636467263529404,-0.019016829894458187,-0.13538150252975223,-0.31440517197580087\n2015-03-05 13:50:00,210.3,210.35,210.2,210.33,1037100.0,-0.13768872851580571,-0.028518465706528495,-0.1662071942223342,-0.2919136514450987\n2015-03-05 14:00:00,210.3201,210.39,210.31,210.38,780900.0,-0.08074091664688199,-0.042761438684846276,-0.12350235533172826,-0.2580310857642993\n2015-03-05 14:10:00,210.38,210.52,210.37,210.52,1358300.0,0.03487820663294894,-0.011873946187268558,0.02300426044568038,-0.19868984291524244\n2015-03-05 14:20:00,210.51,210.53,210.45,210.4801,1022500.0,0.0770737644899766,-0.06642294179091124,0.010650822699065365,-0.14783027376287047\n2015-03-05 14:30:00,210.4801,210.515,210.415,210.43,1741100.0,0.02852117697389467,-0.05699358822133238,-0.028472411247437712,-0.10876537905334725\n2015-03-05 14:40:00,210.43900000000002,210.47,210.34,210.37,930900.0,0.07135381980782896,-0.03639878239894978,0.034955037408879175,-0.06597760109470219\n2015-03-05 14:50:00,210.37,210.45,210.33,210.34,1253000.0,0.1833726274677927,0.010460350516838801,0.1938329779846315,-0.004481068913159439\n2015-03-05 15:00:00,210.34,210.64,210.34,210.53,1829900.0,0.22851701975719063,0.07605647193040799,0.3045734916875986,0.06516605365468084\n2015-03-05 15:10:00,210.53,210.55,210.28,210.34,2843300.0,0.10470207500474782,0.057083055846263164,0.16178513085101098,0.09619082818657308\n2015-03-05 15:20:00,210.34,210.5,210.32,210.44,1233100.0,0.1094143951286819,0.23100188135551925,0.34041627648420114,0.1530803646792349\n2015-03-05 15:30:00,210.44,210.56,210.44,210.555,1475700.0,0.12125534950071515,0.24041894786954732,0.36167429737026247,0.20518412716910864\n2015-03-05 15:40:00,210.55,210.56,210.32,210.49,3904700.0,0.07607093614796501,0.17608985341710515,0.25216078956507015,0.22777849748362752\n2015-03-05 15:50:00,210.48,210.62,210.45,210.48,3390400.0,0.04753303545963483,0.12844298558583045,0.17597602104546528,0.22969085270554918\n2015-03-05 16:00:00,210.48,210.61,210.43,210.51,5450700.0,-0.004750142504283961,0.09985734664763601,0.09510720414335205,0.21411848193436323\n2015-03-06 09:40:00,209.38,209.66,209.27,209.54,13076200.0,-0.4466455498643329,-0.3756002472305564,-0.8222457970948893,0.030219085820873657\n2015-03-06 09:50:00,209.53,209.82,209.53,209.67,2417400.0,-0.3611652330941517,-0.33748455176347836,-0.6986497848576301,-0.11677606468861512\n2015-03-06 10:00:00,209.68,209.93,209.46,209.8301,4453100.0,-0.256643057470185,-0.3277123313699559,-0.5843553888401409,-0.22965214642644208\n2015-03-06 10:10:00,209.8301,209.94,209.66,209.72,3079500.0,-0.29476086336407414,-0.3611267763555803,-0.6558876397196545,-0.34138521256373017\n2015-03-06 10:20:00,209.73,209.92,209.52,209.68,3927100.0,-0.40374293449864096,-0.3564130589744807,-0.7601559934731217,-0.4546132315396986\n2015-03-06 10:30:00,209.68,209.89,209.64,209.845,2812700.0,-0.2353332699439048,-0.24956029852165607,-0.48489356846556086,-0.5010309709811264\n2015-03-06 10:40:00,209.85,209.9,209.66,209.73,2196800.0,-0.33738832921498263,-0.2900066558904735,-0.6273949851054561,-0.5583524253579938\n2015-03-06 10:50:00,209.73,209.82,209.54,209.65,1475400.0,-0.42981643751038856,-0.41799268512801024,-0.8478091226383988,-0.6377660996049288\n2015-03-06 11:00:00,209.65,209.65,209.26,209.365,2668400.0,-0.5344671955912372,-0.46353522867738084,-0.9980024242686181,-0.724488193926386\n2015-03-06 11:10:00,209.36,209.37,208.89,208.93,4209500.0,-0.7364120106423289,-0.7175441931191795,-1.4539562037615084,-0.8727659127862945\n2015-03-06 11:20:00,208.93,208.94,208.605,208.71,5257000.0,-0.855066267635729,-0.8762556101731156,-1.7313218778088446,-1.0433089649656304\n2015-03-06 11:30:00,208.71,208.79,208.56,208.63,4260700.0,-0.4342846234609121,-0.8836524300441906,-1.3179370535051027,-1.1221624839858502\n2015-03-06 11:40:00,208.64,208.65,208.35,208.49,4783400.0,-0.5627891448466538,-0.9454580007601576,-1.5082471456068114,-1.22435806941279\n2015-03-06 11:50:00,208.49,208.57,208.16,208.21400000000003,4415600.0,-0.7701945526404241,-1.0906845280509114,-1.8608790806913356,-1.3738705201866135\n2015-03-06 12:00:00,208.22,208.48,208.17,208.45,3493600.0,-0.60556933053596,-0.5201870764531824,-1.1257564069891424,-1.367815367724189\n2015-03-06 12:10:00,208.45,208.62,208.4,208.5501,2975900.0,-0.5388687523845914,-0.5341250536557429,-1.0729938060403343,-1.3455197348435086\n2015-03-06 12:20:00,208.56,208.59,208.07,208.1,2353600.0,-0.8315661559722631,-0.8245242222159721,-1.6560903781882352,-1.418548928942905\n2015-03-06 12:30:00,208.1,208.12,207.84,208.04,3395700.0,-0.8057979306727692,-0.8010680907877155,-1.6068660214604846,-1.4639246873993872\n2015-03-06 12:40:00,208.0305,208.27,207.9,208.26,2837200.0,-0.663009778201773,-0.6772224341854316,-1.3402322123872046,-1.4470205369548712\n2015-03-06 12:50:00,208.265,208.27,208.13,208.26,3818100.0,-0.5277864017385947,-0.755319402416077,-1.2831058041546717,-1.413507407047739\n2015-03-06 13:00:00,208.2525,208.31,207.85,208.09,2698800.0,-0.4020485330014867,-0.7819577552090728,-1.1840062882105595,-1.3650825542345282\n2015-03-06 13:10:00,208.085,208.21,207.85,207.98,3902000.0,-0.3497676201427935,-0.7965657047460106,-1.1463333248888041,-1.3197592642646039\n2015-03-06 13:20:00,207.97,208.14,207.9,207.98,1826600.0,-0.31155634376648367,-0.6615241324958943,-0.9730804762623779,-1.2460555241556257\n2015-03-06 13:30:00,207.99,208.05,207.71,207.99,2134600.0,-0.239819655618978,-0.4499114535968962,-0.6897311092158742,-1.130564020389909\n2015-03-06 13:40:00,207.99,208.0,207.65,207.82,4325100.0,-0.1892283900218228,-0.42642901633846986,-0.6156574063602926,-1.0228981701318225\n2015-03-06 13:50:00,207.82,207.855,207.5801,207.7899,3050800.0,-0.31667066442792047,-0.40267459138187967,-0.7193452558098001,-0.9433591834214436\n2015-03-06 14:00:00,207.79,207.95,207.71,207.94,1497600.0,-0.2925436142202753,-0.26380162118088135,-0.5563452354011567,-0.8406138030045939\n2015-03-06 14:10:00,207.9401,208.22,207.9,208.2,4099700.0,0.048053820278703974,-0.006723851422107963,0.04132996885659601,-0.6491955698642815\n2015-03-06 14:20:00,208.19400000000002,208.225,208.02,208.0275,1811800.0,-0.006008459911555075,-0.2026864955624763,-0.20869495547403139,-0.533203613698939\n2015-03-06 14:30:00,208.04,208.04,207.58,207.71,4144600.0,-0.26409296072216204,-0.40282886462292833,-0.6669218253450904,-0.5210990385449378\n2015-03-06 14:40:00,207.72,207.8,207.41,207.42,3373400.0,-0.4033419763756818,-0.3267659778952492,-0.730107954270931,-0.5316861955376272\n2015-03-06 14:50:00,207.42,207.5,207.3,207.5,3206600.0,-0.28353116440001935,-0.25956546817919035,-0.5430966325792097,-0.5165239910216333\n2015-03-06 15:00:00,207.5,207.58,207.37,207.4,2707900.0,-0.2788729685546665,-0.41294535676557054,-0.691818325320237,-0.5393700341369096\n2015-03-06 15:10:00,207.4,207.92,207.375,207.77,4219200.0,-0.10097124723530415,-0.23528281955247365,-0.3362540667877778,-0.5026818875361415\n2015-03-06 15:20:00,207.76,207.79,207.46,207.7,2756000.0,-0.13942978027791098,-0.18741890528137795,-0.3268486855592889,-0.47071052693797716\n2015-03-06 15:30:00,207.7,207.82,207.42,207.46,4637000.0,-0.17322683091135493,-0.25002404077314466,-0.4232508716844996,-0.4615179041953239\n2015-03-06 15:40:00,207.46,207.615,207.22,207.29,6291600.0,-0.24057954693659234,-0.33176266948744537,-0.5723422164240377,-0.48481633293486487\n2015-03-06 15:50:00,207.295,207.36,207.1,207.24,8842400.0,-0.33663556795229255,-0.36059425933938627,-0.6972298272916788,-0.5305307458135607\n2015-03-06 16:00:00,207.24,207.56,207.22,207.48,13710200.0,-0.34582132564840995,-0.16360311808295558,-0.5094244437313655,-0.5286703653876857\n2015-03-09 09:40:00,207.76,207.98,207.65,207.88,7292900.0,-0.07090408720001884,0.04336110657929826,-0.02754298062072058,-0.4337273646097419\n2015-03-09 09:50:00,207.88,208.04,207.58,207.74,3721300.0,0.014443214096582224,-0.09618159084350264,-0.08173837674692042,-0.3602631421224593\n2015-03-09 10:00:00,207.7499,207.98,207.61,207.97,2870000.0,0.26516247227847956,-0.11047070124879932,0.15469177102968024,-0.25560015781259493\n2015-03-09 10:10:00,207.96,208.18,207.85,208.08,2471900.0,0.27951807228916437,0.025237047986448324,0.3047551202756127,-0.13633999006908637\n2015-03-09 10:20:00,208.08,208.13,207.91,208.01,1986800.0,0.2941176470588225,0.14443214096575563,0.4385497880245781,-0.01087303629114497\n2015-03-09 10:30:00,208.03,208.15,207.79,207.93,1957500.0,0.0770082302546049,0.24587792884005477,0.3228861590946597,0.0794768239574957\n2015-03-09 10:40:00,207.925,208.09,207.84,207.9301,1836600.0,0.11078478574868544,0.20727710843373437,0.3180618941824198,0.15713618431929371\n2015-03-09 10:50:00,207.93,208.17,207.88,208.1668,1447200.0,0.3406921816253572,0.3697203471552557,0.7104125287806129,0.2926536097740919\n2015-03-09 11:00:00,208.1668,208.25,208.03,208.07,2010300.0,0.37628443243764575,0.14439043172738142,0.5206748641650272,0.37035046447688086\n2015-03-09 11:10:00,208.07,208.14,207.88,208.08,1441800.0,0.4053271569195216,0.18295618680790326,0.5882833437274249,0.43819604834634757\n2015-03-09 11:20:00,208.08,208.22,208.01,208.12,1030300.0,0.30846346635819977,0.31813361611876534,0.6265970824769651,0.4930494431255707\n2015-03-09 11:30:00,208.12,208.34,207.98,208.22,1979100.0,0.16355589763326073,0.44864682329104344,0.6122027209243042,0.5333922255661704\n2015-03-09 11:40:00,208.21,208.29,208.17,208.17,2251400.0,0.2069895061133975,0.44875506658945685,0.6557445727028544,0.5690345974633932\n2015-03-09 11:50:00,208.17,208.34,208.17,208.21,1549200.0,0.11540125979709881,0.3518411413148348,0.4672424011119336,0.5612937963136638\n2015-03-09 12:00:00,208.22,208.24,208.0,208.07,1441700.0,-0.004805843906197094,0.0913988839715163,0.0865930400653192,0.4813897062311622\n2015-03-09 12:10:00,208.07,208.145,207.88,207.88,1448400.0,-0.06249699533675823,0.06739193222295992,0.004894936886201684,0.39303062916989845\n2015-03-09 12:20:00,207.88,208.025,207.86,207.93,2048000.0,0.0,-0.019233543299512768,-0.019233543299512768,0.30606621429684044\n2015-03-09 12:30:00,207.92,208.065,207.92,207.97,1070700.0,0.019189140966124896,-0.052864282968090315,-0.03367514200196542,0.22260869852300802\n2015-03-09 12:40:00,207.97,208.14,207.92,208.09,1392500.0,-0.036893491181111404,0.03845968943800848,0.0015661982568970778,0.15908756590137926\n2015-03-09 12:50:00,208.09,208.25,208.07,208.19,1525900.0,0.057672898543770224,0.1250420814697284,0.18271498001349862,0.13794091479746226\n2015-03-09 13:00:00,208.2,208.32,208.19,208.2664,738200.0,0.08958093041138149,0.1617370452858813,0.2513179756972628,0.13664150588539192\n2015-03-09 13:10:00,208.27,208.3,208.2,208.26,747400.0,0.06726888333652425,0.04477178877706489,0.11204067211358915,0.1168422073541028\n2015-03-09 13:20:00,208.26,208.32,208.18,208.23,802400.0,0.004802612621257474,0.0768971980583455,0.08169981067960297,0.10062024399501102\n2015-03-09 13:30:00,208.23,208.42,208.19,208.42,1126700.0,0.12009415381659672,0.16339869281043473,0.28349284662703145,0.13152510102678353\n2015-03-09 13:40:00,208.41,208.5668,208.41,208.5354,1530600.0,0.15628452043610075,0.19959638669997393,0.3558809071360747,0.17893232459628938\n2015-03-09 13:50:00,208.535,208.76,208.53,208.74,2063700.0,0.3220070168693301,0.24973585630583273,0.5717428731751628,0.2606910353170702\n2015-03-09 14:00:00,208.74900000000002,208.79,208.6,208.62,980500.0,0.35597460073120146,0.2161694768698652,0.5721440776010667,0.33221636618276157\n2015-03-09 14:10:00,208.62,208.65,208.53900000000002,208.57,1141200.0,0.30779589284855025,0.1729023581960476,0.48069825104459785,0.3763628627490845\n2015-03-09 14:20:00,208.57,208.59,208.43,208.435,2136800.0,0.2235899408568498,0.17542173307061315,0.39901167392746295,0.3963050108750817\n2015-03-09 14:30:00,208.4351,208.53,208.38,208.425,1016600.0,0.16098803402373463,0.262170482970947,0.42315851699468165,0.4134112127283811\n2015-03-09 14:40:00,208.42,208.43,208.25,208.295,1568300.0,0.05043469907295428,0.1755398451401824,0.22597454421313667,0.3902940824944689\n2015-03-09 14:50:00,208.295,208.49,208.2,208.45,2117000.0,0.08815632286340858,0.23080251959417541,0.318958842457584,0.3845439779683496\n2015-03-09 15:00:00,208.45,208.65,208.44,208.58,2317500.0,0.15365408623837506,0.2354750348406931,0.38912912107906816,0.38778995736715466\n2015-03-09 15:10:00,208.57,208.63,208.487,208.63,1612800.0,0.19209527925851955,0.211345405639074,0.40344068489759355,0.3880484154529741\n2015-03-09 15:20:00,208.63,208.695,208.5,208.5,1299100.0,0.038384032242588795,0.11216403606151282,0.1505480683041016,0.34014552800778475\n2015-03-09 15:30:00,208.505,208.55,208.37,208.49,1984800.0,-0.02177088398420679,0.11043887448383138,0.0886679904996246,0.2847250416678173\n2015-03-09 15:40:00,208.485,208.68,208.45,208.49,2464700.0,-0.11976621634569584,0.12486193151803882,0.005095715172342974,0.22289277586244477\n2015-03-09 15:50:00,208.49,208.64,208.42,208.605,3005200.0,-0.007190106413579311,0.08876307456098242,0.08157296814740311,0.18527543536942365\n2015-03-09 16:00:00,208.605,208.65,208.32,208.36,7655500.0,-0.10068562113437762,-0.08411041962179677,-0.1847960407561744,0.1064841893102465\n2015-03-10 09:40:00,206.71,206.81,206.37,206.485,8650200.0,-0.9355434547940522,-1.0802912714381496,-2.015834726232202,-0.294608495659415\n2015-03-10 09:50:00,206.47,206.69,206.1,206.215,4462700.0,-1.0603334532805597,-1.1528137283098427,-2.2131471815904025,-0.6872308408173513\n2015-03-10 10:00:00,206.215,206.48,206.02,206.3201,3478400.0,-0.9481264552677615,-1.0787265666203139,-2.0268530218880754,-1.0016338528329822\n2015-03-10 10:10:00,206.32,206.51,206.23,206.361,4537000.0,-1.0021587910770013,-0.9950344232014796,-1.997193214278481,-1.2679930477496748\n2015-03-10 10:20:00,206.37,206.37,205.85,206.05,4214200.0,-1.2129638508006524,-1.139498620606938,-2.3524624714075903,-1.5555589742287954\n2015-03-10 10:30:00,206.0465,206.16,205.79,206.07,3419000.0,-1.227052676987972,-1.068196548164857,-2.295249225152829,-1.7826151621833195\n2015-03-10 10:40:00,206.075,206.08,205.7,205.8,3540400.0,-1.2949640287769681,-1.2712880786759362,-2.5662521074529043,-2.014475559765913\n2015-03-10 10:50:00,205.76,205.98,205.73,205.95,3659200.0,-1.2182838505443994,-1.2609070860101768,-2.479190936554576,-2.1822353790405837\n2015-03-10 11:00:00,205.951,206.27,205.95,206.08,3317000.0,-1.155930740083455,-1.2222595024684813,-2.3781902425519363,-2.286462587556102\n2015-03-10 11:10:00,206.08,206.43,206.06,206.385,2863000.0,-1.064212267203568,-1.0143884892086397,-2.0786007564122078,-2.2914960129425914\n2015-03-10 11:20:00,206.38,206.55,206.31,206.52,2775200.0,-0.8830869648684958,-0.9448894431387633,-1.8279764080072591,-2.2165285619707986\n2015-03-10 11:30:00,206.52,206.66,206.37,206.41,2322700.0,-0.03632225101097841,-0.9976497673749418,-1.0339720183859202,-2.0006122823083063\n2015-03-10 11:40:00,206.4,206.5,206.16,206.19,2121300.0,-0.012123269403296888,-1.1576903717552267,-1.1698136411585236,-1.8308340279354602\n2015-03-10 11:50:00,206.19,206.23,205.84,205.86,4220200.0,-0.223002993891519,-1.1998464196582792,-1.4228494135497982,-1.7226448118288378\n2015-03-10 12:00:00,205.85,205.93,205.57,205.58,3932900.0,-0.378462984769401,-0.4382884955323685,-0.8167514803017695,-1.5146985860540036\n2015-03-10 12:10:00,205.58,205.61,205.38,205.61,4016200.0,-0.2135404028148491,-0.2933831195596759,-0.506923522374525,-1.2783420223125042\n2015-03-10 12:20:00,205.61,205.8,205.55,205.6799,3207900.0,-0.18930460523122195,-0.3102945374687138,-0.49959914269993577,-1.0731687659534122\n2015-03-10 12:30:00,205.6769,205.68,205.33,205.42,2287600.0,-0.18464528668611369,-0.45599701493983513,-0.6406423016259488,-0.9312152287581947\n2015-03-10 12:40:00,205.42,205.64,205.32,205.6399,3233300.0,-0.15057052682688754,-0.19902936180539177,-0.3495998886322793,-0.7697730461991942\n2015-03-10 12:50:00,205.64,205.79,205.49,205.61,3868000.0,-0.22806677018633037,-0.22322511767844944,-0.4512918878647798,-0.6637037790264603\n2015-03-10 13:00:00,205.6,205.77,205.5,205.56,2425800.0,-0.399738353077983,-0.11661807580175543,-0.5163564288797384,-0.5990518623754901\n2015-03-10 13:10:00,205.57,205.7399,205.51,205.54,1224300.0,-0.47453031183420924,-0.19907744598203214,-0.6736077578162414,-0.5868387324243846\n2015-03-10 13:20:00,205.54,205.69,205.48,205.68,1642100.0,-0.3536650356087301,-0.19409937888199558,-0.5477644144907257,-0.5582970720608159\n2015-03-10 13:30:00,205.68,205.98,205.68,205.77,2756900.0,-0.20369562054415313,-0.29798677229448955,-0.5016823928386427,-0.5326868482453737\n2015-03-10 13:40:00,205.78,205.785,205.6001,205.6001,3447700.0,-0.12625085009230208,-0.445429014139076,-0.5716798642313781,-0.5365519286960864\n2015-03-10 13:50:00,205.6,205.81,205.55,205.735,2975400.0,0.07539643934235674,-0.3270190397752004,-0.2516226004328437,-0.4866806269301635\n2015-03-10 14:00:00,205.735,205.8,205.59,205.68,1325500.0,0.03404503671999848,-0.24734468208933436,-0.21329964536933588,-0.43448335009708794\n2015-03-10 14:10:00,205.68,205.89,205.62,205.89,1316200.0,0.10214901893670358,0.014573010784024731,0.11672202972072832,-0.3274875777445571\n2015-03-10 14:20:00,205.89,205.92,205.38,205.4,2665700.0,-0.009736150326156157,-0.08755715536531428,-0.09729330569147043,-0.2731739451278202\n2015-03-10 14:30:00,205.4041,205.41,205.22,205.2801,3460400.0,-0.17496604501363588,-0.1604493944847074,-0.3354154394983433,-0.26674263834762024\n2015-03-10 14:40:00,205.28,205.49,205.28,205.4,1670000.0,-0.10213511016001764,-0.13608524702705127,-0.2382203571870689,-0.24474634293566927\n2015-03-10 14:50:00,205.4,205.575,205.27,205.41,2486800.0,-0.07297139521308393,-0.004868075163078078,-0.07783947037616201,-0.19864690577069288\n2015-03-10 15:00:00,205.41,205.5,205.22,205.2601,3408000.0,-0.13617787292010686,-0.184691784036084,-0.32086965695619085,-0.20756692593735954\n2015-03-10 15:10:00,205.26,205.56,205.18,205.49,3890300.0,-0.09237650719564616,-0.058362920091437065,-0.15073942728708323,-0.18967953630118\n2015-03-10 15:20:00,205.49,205.68,205.33,205.625,3253400.0,-0.07046702629149859,0.03162093792565823,-0.03884608836584036,-0.157828684416621\n2015-03-10 15:30:00,205.625,205.74,205.35,205.44,3488800.0,-0.07786961193112507,-0.0486523304466302,-0.12652194237775527,-0.15160678373178357\n2015-03-10 15:40:00,205.44,205.46,205.24,205.39,4522600.0,-0.1676914477361735,-0.14099572150915174,-0.30868716924532524,-0.1807803908056878\n2015-03-10 15:50:00,205.39,205.525,205.31,205.42,4846400.0,-0.12640995721510118,-0.17009282208292342,-0.2965027792980246,-0.20600433563688295\n2015-03-10 16:00:00,205.41,205.41099999999997,204.94,205.0,13121200.0,-0.43226965855552857,-0.2918772899429545,-0.724146948498483,-0.30146858743145694\n2015-03-11 09:40:00,205.29,205.38,205.02,205.1,7219200.0,-0.14605647517040854,-0.3086494762680192,-0.45470595143842774,-0.33654622807316603\n2015-03-11 09:50:00,205.11,205.46,205.01,205.275,3356600.0,-0.0024844103252097405,-0.1969078179696604,-0.19939222829487013,-0.3230342733807722\n2015-03-11 10:00:00,205.28,205.41,205.06,205.27,2925800.0,-0.06329113924050667,-0.301131672252164,-0.36442281149267064,-0.34023384524965483\n2015-03-11 10:10:00,205.26,205.5,205.18,205.45,2845800.0,0.01947324862470179,0.024342745861716253,0.04381599448641804,-0.2779975734656757\n2015-03-11 10:20:00,205.45,205.45,205.03,205.05,2956000.0,-0.10235793512718416,-0.1120907482020872,-0.21444868332927136,-0.2693491640380512\n2015-03-11 10:30:00,205.05,205.24,205.01,205.239,2342700.0,-0.12214706311742818,-0.07838364167478407,-0.20053070479221224,-0.2570118629483761\n2015-03-11 10:40:00,205.235,205.28,204.72,204.77,4503000.0,-0.4158054711246195,-0.3115719779952175,-0.727377449119837,-0.33752515871051697\n2015-03-11 10:50:00,204.77,204.8799,204.51,204.72,3488300.0,-0.3504672897196248,-0.26312956098140106,-0.6135968507010259,-0.3864264273648362\n2015-03-11 11:00:00,204.71,204.92,204.59,204.8,2260100.0,-0.28725838648423485,-0.33578276315149314,-0.623041149635728,-0.43150102888990666\n2015-03-11 11:10:00,204.79,204.98,204.72,204.81,3455700.0,-0.2969525849479071,-0.3963525835866233,-0.6933051685345304,-0.4834138452995284\n2015-03-11 11:20:00,204.815,205.13,204.815,205.0,2787600.0,0.0,-0.21417445482866393,-0.21417445482866393,-0.4487727461256099\n2015-03-11 11:30:00,204.995,205.25,204.89,205.225,1480700.0,0.06094588005851609,-0.08033497249135824,-0.019389092432842148,-0.3830894264544468\n2015-03-11 11:40:00,205.22,205.335,205.13,205.14,2058600.0,-0.0657654366094329,-0.1363061045662528,-0.2020715411756857,-0.35389388175220116\n2015-03-11 11:50:00,205.14,205.22,205.09,205.175,1439600.0,-0.04628050859842858,0.08536585365854776,0.03908534506011918,-0.28380347174011816\n2015-03-11 12:00:00,205.18,205.25,205.04,205.1799,1594800.0,-0.13146751034314175,0.038956606533413485,-0.09251090380972826,-0.23755364062389278\n2015-03-11 12:10:00,205.18,205.27,204.97,205.05,1472400.0,0.0,-0.109609061015703,-0.109609061015703,-0.19662961590001812\n2015-03-11 12:20:00,205.05,205.32,205.01,205.29,1126000.0,0.024849078391531165,0.009743264968076204,0.03459234335960737,-0.13114027481293272\n2015-03-11 12:30:00,205.29,205.3,204.89,205.03,1718400.0,0.1269717243736812,-0.20442930153321548,-0.07745757715953427,-0.09987764277440837\n2015-03-11 12:40:00,205.03,205.26,204.93,205.2599,1137800.0,0.26372606486908534,0.10236527676175111,0.36609134163083645,0.002282260434338051\n2015-03-11 12:50:00,205.25,205.33,205.15,205.22,1388100.0,0.20507812499999112,-0.009257499792925117,0.195820625207066,0.05549962445209777\n2015-03-11 13:00:00,205.225,205.37,205.15,205.2061,2015700.0,0.19339875982617993,0.2129706499975459,0.4063694098237258,0.13083266215031206\n2015-03-11 13:10:00,205.2,205.235,205.1,205.23,1167700.0,0.11219512195121961,0.2491207502930859,0.3613158722443055,0.1866915318404065\n2015-03-11 13:20:00,205.229,205.345,205.17,205.19,936000.0,-0.017054452430254052,0.19042968749998224,0.17337523506972818,0.2014574681409933\n2015-03-11 13:30:00,205.179,205.26,205.09,205.19,988800.0,0.024373598518101502,0.18553781553634074,0.20991141405444225,0.21604004105252053\n2015-03-11 13:40:00,205.2,205.21,204.86,205.02,2738800.0,-0.07554526623614333,0.009756097560975618,-0.06578916867516771,0.17738930675876738\n2015-03-11 13:50:00,205.01,205.02,204.52,204.54,2940100.0,-0.31187265419274635,-0.3337799975636546,-0.645652651756401,0.0328229985387071\n2015-03-11 14:00:00,204.54,204.84,204.52,204.8,2283400.0,-0.12192148256522373,-0.1657404699229703,-0.28766195248819404,-0.03690784452821197\n2015-03-11 14:10:00,204.805,205.0,204.74,204.99400000000003,1718800.0,-0.14418627307709597,-0.08821737541122587,-0.23240364848832185,-0.09073255421610335\n2015-03-11 14:20:00,205.0,205.21,204.86,205.14,1733600.0,0.053650685265571596,-0.019446349276908137,0.03420433598866346,-0.09326588361129218\n2015-03-11 14:30:00,205.14,205.19,205.0,205.06,2838400.0,-0.09738872522103703,0.00487685930259385,-0.09251186591844318,-0.11280421325064269\n2015-03-11 14:40:00,205.07,205.18,204.93,205.13,1668600.0,-0.04385537471981449,-0.07793852598763085,-0.12179390070744534,-0.13242414028571162\n2015-03-11 14:50:00,205.14,205.15,204.86,205.08,1452800.0,-0.06145041497302994,0.024386675120724455,-0.03706373985230549,-0.127035614246552\n2015-03-11 15:00:00,205.08,205.25,205.045,205.19099999999997,1413900.0,-0.019003069726653,-0.03356719943837794,-0.052570269165030936,-0.11722319149885863\n2015-03-11 15:10:00,205.19,205.2,204.955,204.965,2668700.0,-0.10965446659193523,-0.12425689503946513,-0.23391136163140036,-0.1362737763953277\n2015-03-11 15:20:00,204.96,205.00900000000001,204.8,204.89,2199400.0,-0.14620595545592474,-0.15404025513862107,-0.3002462105945458,-0.15931573790898976\n2015-03-11 15:30:00,204.89,204.9,204.58,204.6,2307700.0,-0.20485806262804385,-0.3069726648150861,-0.51183072744313,-0.21656475626931476\n2015-03-11 15:40:00,204.6,204.61,204.4,204.54,3389000.0,0.0,-0.31677957015449065,-0.31677957015449065,-0.24078305374649206\n2015-03-11 15:50:00,204.54,204.68,204.42,204.5,4801100.0,-0.146484375,-0.3362736975486169,-0.4827580725486169,-0.2946498495195779\n2015-03-11 16:00:00,204.5,204.72,204.45,204.5,7807400.0,-0.2409826629072187,-0.25363379182519186,-0.49461645473241056,-0.34612081616134804\n2015-03-12 09:40:00,205.24,205.92,205.2,205.8,8085900.0,0.32173150043872667,0.6160164271047375,0.9377479275434641,-0.12754697164893966\n2015-03-12 09:50:00,205.8,206.39,205.79,206.36,7408200.0,0.6339607919633394,0.7617187499999956,1.395679541963335,0.1555551701495924\n2015-03-12 10:00:00,206.37,206.43,206.17,206.17,4261900.0,0.5069955637888146,0.5736753270827233,1.080670890871538,0.35379258551923803\n2015-03-12 10:10:00,206.18,206.32,205.93,206.03,3980400.0,0.46323385995707955,0.4338500536219314,0.897083913579011,0.498328102640718\n2015-03-12 10:20:00,206.02,206.2,205.93,205.99,2568700.0,0.3893932969769809,0.4535257973276252,0.8429190943046061,0.6157490311169599\n2015-03-12 10:30:00,205.99,206.29,205.96,206.2,2317500.0,0.602541897397102,0.5216204358211796,1.1241623332182815,0.76472635837867\n2015-03-12 10:40:00,206.2,206.35,206.145,206.27,1801700.0,0.6735321391966531,0.5802613614199315,1.2537935006165846,0.9113746516434746\n2015-03-12 10:50:00,206.275,206.35,205.97,206.08,2051600.0,0.723362658846538,0.4332548698529948,1.1566175286995328,1.0082523276859114\n2015-03-12 11:00:00,206.08,206.37,206.08,206.26,1533100.0,0.8409113131905732,0.6318151879589173,1.4727265011494906,1.1358153241946312\n2015-03-12 11:10:00,206.26,206.32,206.13,206.24,1490500.0,0.8508557457212795,0.6588901361706423,1.5097458818919218,1.2345548522256453\n2015-03-12 11:20:00,206.24,206.62,206.22,206.59,2541200.0,1.0220048899755474,0.9726295210166214,1.9946344109921688,1.3850129794271715\n2015-03-12 11:30:00,206.59,206.7,206.56,206.615,1910900.0,0.39601554907677805,1.0144714970176993,1.4104870460944774,1.4100463769482314\n2015-03-12 11:40:00,206.62,206.69,206.51,206.55,1678900.0,0.09207210699748725,1.002444987775064,1.0945170947725513,1.3773614650629202\n2015-03-12 11:50:00,206.54,206.56,206.47,206.485,1058700.0,0.15278653538344233,0.9706601466992648,1.1234466820827071,1.349684728981256\n2015-03-12 12:00:00,206.489,206.58,206.43,206.46,1250200.0,0.20870746978596255,0.320699708454808,0.5294071782407705,1.2098851236828083\n2015-03-12 12:10:00,206.47,206.5,206.35,206.355,1185300.0,0.17719306762462583,-0.0024229501841555035,0.17477011744047033,1.0113062694400123\n2015-03-12 12:20:00,206.3599,206.46,206.33,206.455,758800.0,0.12366634335596594,0.13823543677549122,0.26190178013145715,0.8458312123369922\n2015-03-12 12:30:00,206.46,206.48,206.33,206.45,1454500.0,0.08726426528335995,0.20385380769789574,0.2911180729812557,0.7037026033973014\n2015-03-12 12:40:00,206.45,206.51,206.34,206.38,691900.0,0.14557453416148558,0.1893295791057792,0.33490411326726477,0.5852714464317628\n2015-03-12 12:50:00,206.37,206.37,206.21,206.3367,975800.0,0.037186075826634024,0.06629485935985002,0.10348093518648405,0.4454510277766682\n2015-03-12 13:00:00,206.3367,206.4543,206.31,206.42,899100.0,0.08727695888284259,0.07272022106945553,0.15999717995229812,0.3414747435645477\n2015-03-12 13:10:00,206.42,206.59,206.34,206.57,1187300.0,-0.009681010697526471,0.23777173913042127,0.2280907284328948,0.28323614509507883\n2015-03-12 13:20:00,206.57,206.62,206.49,206.5901,1000300.0,-0.012051399946766406,0.1600407252981828,0.1479893253514164,0.23193177002282445\n2015-03-12 13:30:00,206.59,206.595,206.46,206.49,713100.0,-0.029048656499641723,0.12121799844841963,0.0921693419487779,0.18768790286683829\n2015-03-12 13:40:00,206.485,206.55,206.34,206.46,1127400.0,-0.01210741700365947,-0.062926569533861,-0.07503398653752047,0.1317939276248693\n2015-03-12 13:50:00,206.46,206.585,206.4,206.52,531600.0,0.029061319383894002,-0.04597923674466431,-0.016917917360770307,0.09745634977464199\n2015-03-12 14:00:00,206.53,206.69,206.52,206.59,1107000.0,0.11388141794481665,0.019365770999746346,0.133247188944563,0.09390675552177057\n2015-03-12 14:10:00,206.59,206.6,206.44,206.555,1519800.0,0.048436705335297425,0.033900767610228755,0.08233747294552618,0.08344002365429051\n2015-03-12 14:20:00,206.555,206.62,206.545,206.6,670700.0,0.0726568176314002,0.067809745229086,0.1404665628604862,0.08733822813563466\n2015-03-12 14:30:00,206.6,206.63,206.56,206.59,600200.0,0.10175404593468773,0.11388141794481665,0.21563546387950439,0.10843873371874173\n2015-03-12 14:40:00,206.59,206.63,206.51,206.555,579200.0,0.10579795063117015,0.048436705335297425,0.15423465596646757,0.11633628279596898\n2015-03-12 14:50:00,206.555,206.62,206.42,206.56,1301200.0,0.06782288537932057,0.05328166626301645,0.12110455164233702,0.11831494970491489\n2015-03-12 15:00:00,206.56,206.88,206.56,206.84,2404400.0,0.13070629810718604,0.22288981490454773,0.35359611301173377,0.16451001280448851\n2015-03-12 15:10:00,206.84,207.09,206.84,207.03,2955500.0,0.2129337272211984,0.3360042105936545,0.5489379378148529,0.2424834660926235\n2015-03-12 15:20:00,207.03,207.11,206.96,206.99,2069200.0,0.24214247663325583,0.27613603333012104,0.5182785099633769,0.306577594392016\n2015-03-12 15:30:00,206.99,207.06,206.965,207.04,1711500.0,0.28092608737768643,0.22752577818656583,0.5084518655642523,0.3580975601370059\n2015-03-12 15:40:00,207.04,207.11,206.92,207.06,2347700.0,0.26147588611271644,0.22745523623832753,0.48893112235104397,0.39651612197186664\n2015-03-12 15:50:00,207.06,207.17,207.0,207.15,3990000.0,0.27106829953047473,0.31962806915588615,0.5906963686863609,0.4469704752603035\n2015-03-12 16:00:00,207.15,207.175,207.07,207.13,8936100.0,0.27837621940887125,0.32451806645354964,0.6028942858624209,0.49039974265819064\n2015-03-13 09:40:00,206.76,206.8,206.22,206.5849,8317200.0,-0.00730880929331601,0.03142552779391572,0.02411671850059971,0.4201889482993479\n2015-03-13 09:50:00,206.59,206.93,206.43,206.86,3154700.0,0.13069364441649078,0.13069364441649078,0.26138728883298157,0.39660041664419093\n2015-03-13 10:00:00,206.86,206.93,206.47,206.48,2770200.0,-0.03630994166203827,-0.03630994166203827,-0.07261988332407654,0.3103350785447232\n2015-03-13 10:10:00,206.48,206.59,205.91,205.97,5174700.0,-0.285631293570876,-0.304937076476286,-0.590568370047162,0.1334195507677202\n2015-03-13 10:20:00,205.98,206.37,205.87,206.29,3734400.0,-0.2659060143105796,-0.14521516046275273,-0.4111211747733323,0.006297412732484308\n2015-03-13 10:30:00,206.28,206.38,205.83,205.9,3654700.0,-0.545814616239193,-0.31710682384836764,-0.8629214400875607,-0.18551460785828064\n2015-03-13 10:40:00,205.9,206.15,205.77,206.1,2535200.0,-0.42997246243781095,-0.2226955848179779,-0.6526680472557889,-0.31398601247870644\n2015-03-13 10:50:00,206.1,206.23,205.76,205.815,2683300.0,-0.5916731066460512,-0.49555211757881246,-1.0872252242248637,-0.5003565417695086\n2015-03-13 11:00:00,205.8131,205.82,205.12,205.123,4440700.0,-0.9354776393316055,-0.9211225426266734,-1.856600181958279,-0.797956038892279\n2015-03-13 11:10:00,205.13,205.34,205.03,205.335,4271300.0,-0.876176683562635,-0.7995555340837734,-1.6757322176464085,-1.0181741506738975\n2015-03-13 11:20:00,205.33,206.1649,205.23,205.24,3430400.0,-0.9124704291990526,-0.8693972179288911,-1.7818676471279438,-1.2162600404792714\n2015-03-13 11:30:00,205.24,205.28,204.84,204.8731,3527300.0,-0.8286181613467392,-1.056167294504018,-1.884785455850757,-1.4002221797682737\n2015-03-13 11:40:00,204.875,204.98,204.66,204.96,7902100.0,-0.9184956008894907,-1.0572049239681358,-1.9757005248576265,-1.561693008973366\n2015-03-13 11:50:00,204.95,205.0,204.58,204.77,4923400.0,-0.8281673769856557,-1.1393810650316194,-1.967548442017275,-1.687080175088694\n2015-03-13 12:00:00,204.768,205.12,204.71,205.07,3225300.0,-0.4369568383745248,-0.7333062581050265,-1.1702630964795513,-1.6424703679795245\n2015-03-13 12:10:00,205.08,205.1,204.73,205.075,2808900.0,-0.5889766833099053,-0.8629024460988233,-1.4518791294087285,-1.6352608955537289\n2015-03-13 12:20:00,205.07,205.17,204.78,204.92,2358700.0,-0.4759592034968563,-0.7555211158465691,-1.2314803193434254,-1.5772705905829474\n2015-03-13 12:30:00,204.91,205.2,204.91,205.12,2667800.0,-0.47549733139252703,-0.4126814584648253,-0.8881787898573523,-1.4463379662131048\n2015-03-13 12:40:00,205.125,205.5,205.105,205.3501,2640900.0,-0.2258824672642934,-0.4556207281012137,-0.6815031953655071,-1.2814469871059724\n2015-03-13 12:50:00,205.35,205.5,205.23,205.35,2917300.0,0.11066530813219622,-0.2671199611461894,-0.1564546530139932,-1.0424580364184337\n2015-03-13 13:00:00,205.35,205.44,205.17,205.37,2450800.0,0.01704531619062255,-0.3541969917515764,-0.3371516755609538,-0.8639463182782042\n2015-03-13 13:10:00,205.37,205.4,205.14,205.25,1955700.0,0.004872344572204312,-0.2745183781551419,-0.2696460335829376,-0.6994284101704625\n2015-03-13 13:20:00,205.25,205.27700000000002,205.03,205.12,3681500.0,0.12051362526364073,-0.0014625371118737185,0.11905108815176701,-0.4936044694249167\n2015-03-13 13:30:00,205.12,205.14,204.77,204.77,2550700.0,-0.09270101483216386,-0.2751601042199292,-0.36786111905209307,-0.4143964138620617\n2015-03-13 13:40:00,204.78,205.005,204.76,205.0,3691200.0,0.11232114079209321,-0.11693626973300342,-0.004615128940910207,-0.29822885687835854\n2015-03-13 13:50:00,205.0,205.145,204.99,205.07,2484200.0,0.0,0.09610827385342358,0.09610827385342358,-0.18494155334184273\n2015-03-13 14:00:00,205.06,205.23,205.02,205.07,2551600.0,-0.002438132390591985,0.05366900858703172,0.051230876196439734,-0.10795900216590856\n2015-03-13 14:10:00,205.06,205.11,204.9,204.9196,1795700.0,-0.00019519812609614107,0.07305757679347824,0.0728623786673821,-0.050365472277800596\n2015-03-13 14:20:00,204.9196,205.07,204.79,204.99,2399100.0,-0.06337753510140542,-0.03901106939093735,-0.10238860449234277,-0.04210923330100142\n2015-03-13 14:30:00,204.99,205.11,204.84,205.1,1171900.0,-0.12179200302313564,0.012190661952948822,-0.10960134107018682,-0.04569375717241324\n2015-03-13 14:40:00,205.1,205.14,204.86,204.88,1711600.0,-0.22887752617481993,-0.019519812609791742,-0.24839733878461168,-0.0753657953908806\n2015-03-13 14:50:00,204.87,204.96,204.64,204.82,4558000.0,-0.26780931976433386,-0.14625585023401166,-0.41406516999834553,-0.13677297268050578\n2015-03-13 15:00:00,204.82,205.08,204.72,205.07,2771500.0,-0.08769792935444665,-0.13640119970723674,-0.2240991290616834,-0.16101506731954862\n2015-03-13 15:10:00,205.07,205.17,204.93,204.97,2652600.0,-0.07312792511701138,-0.18504991477964472,-0.2581778398966561,-0.18521419634288744\n2015-03-13 15:20:00,204.97,205.33,204.97,205.18,3471600.0,0.20022464228157677,-0.09251594682767594,0.10770869545390083,-0.1448827421962238\n2015-03-13 15:30:00,205.19,205.49,205.1,205.48,3591200.0,0.23414634146341484,0.11205846528623553,0.3462048067496504,-0.06323061007569317\n2015-03-13 15:40:00,205.48,205.54,205.25,205.48,4675400.0,0.1999317306285553,0.17550702028079623,0.3754387509093515,0.019189574930306253\n2015-03-13 15:50:00,205.49,205.85,205.485,205.66,6461900.0,0.2877066367581893,0.43463397958685146,0.7223406163450408,0.1587881377480144\n2015-03-13 16:00:00,205.66,206.13,205.66,205.84,11500600.0,0.44915176488731223,0.409756097560976,0.8589078624482882,0.31140841371762834\n2015-03-16 09:40:00,206.68,207.24,206.68,207.02,7639700.0,0.9902922093760758,0.9508948164041575,1.9411870257802333,0.6433286018032207\n2015-03-16 09:50:00,207.02,207.34,206.95,207.25,4162100.0,1.0482691370063302,1.063051640903101,2.111320777909431,0.9688951381513871\n2015-03-16 10:00:00,207.25,207.72,207.25,207.6,4899700.0,1.327606403748538,1.3080251962233058,2.635631599971844,1.346886949116464\n2015-03-16 10:10:00,207.6,207.83,207.6,207.729,3436600.0,1.4202714578654518,1.3361627396458298,2.7564341975112816,1.6913938365437986\n2015-03-16 10:20:00,207.729,207.91,207.69,207.85,2793300.0,1.3556346613351478,1.3408093612871763,2.696444022622324,1.9708019044172689\n2015-03-16 10:30:00,207.85,207.945,207.67,207.685,4402300.0,1.3245840854759328,1.3690941038656756,2.6936781893416084,2.1959866960120826\n2015-03-16 10:40:00,207.69,207.745,207.58,207.58599999999998,2327600.0,1.1726289111999133,1.3504540572209622,2.5230829684208755,2.3431365475506225\n2015-03-16 10:50:00,207.58,207.71,207.56,207.636,4095000.0,1.0492505353319137,1.2512800507143984,2.300530586046312,2.410242726627038\n2015-03-16 11:00:00,207.636,207.81,207.63,207.77,2890700.0,1.11446369476349,1.3660535688149622,2.4805172635784523,2.4750720864340794\n2015-03-16 11:10:00,207.77,207.94,207.735,207.85,3897300.0,1.0648643392006107,1.3012964226532642,2.366160761853875,2.487142506886954\n2015-03-16 11:20:00,207.86,208.0,207.85,207.88,3178500.0,0.9910610182666035,1.1679968853416378,2.1590579036082413,2.4341532640332475\n2015-03-16 11:30:00,207.88,208.15,207.88,207.94,2550300.0,0.44440150710076676,1.197196807475187,1.6415983145759538,2.283119170849526\n2015-03-16 11:40:00,207.94,208.07,207.91,207.93,3032900.0,0.3281061519903483,1.1037634931440277,1.431869645134376,2.102493000737035\n2015-03-16 11:50:00,207.935,208.08,207.91,208.05,1529100.0,0.21676300578035157,1.0736494364554927,1.2904124422358443,1.9180339201854921\n2015-03-16 12:00:00,208.05,208.21900000000002,208.04,208.08,2112400.0,0.16897014860708381,0.5120278233986975,0.6809979720057813,1.649427149688037\n2015-03-16 12:10:00,208.075,208.11,207.97,208.0,2636000.0,0.07216742843396684,0.3618817852834688,0.43404921371743566,1.3725650786039103\n2015-03-16 12:20:00,208.01,208.03,207.87,207.87,2086600.0,0.08907720827213694,0.13005780346821982,0.21913501174035677,1.0977118612625725\n2015-03-16 12:30:00,207.8644,207.93,207.76,207.87,1164100.0,0.1368107675854935,0.06787689730369806,0.20468766488919155,0.8621218164333957\n2015-03-16 12:40:00,207.87,207.97,207.82,207.93,2007400.0,0.1415939432468427,0.038489295164789716,0.18008323841163243,0.6601644744475197\n2015-03-16 12:50:00,207.93,207.99,207.82,207.86,3031200.0,0.043317129518216646,0.08426222404123163,0.12757935355944827,0.4904870447642796\n2015-03-16 13:00:00,207.86,208.06,207.86,207.94,1002500.0,0.043300457060380104,0.17053173142698164,0.21383218848736174,0.37719342885510426\n2015-03-16 13:10:00,207.94,207.95,207.67,207.78,2563500.0,-0.048104675774485184,0.06935213546783725,0.021247459693352067,0.2642521479855795\n2015-03-16 13:20:00,207.78,207.92,207.715,207.8649,2100300.0,-0.036116187361734386,0.04567550656975339,0.009559319208019001,0.17864667529840517\n2015-03-16 13:30:00,207.8601,207.97,207.855,207.92,769800.0,-0.004809310825770741,0.033678133269177124,0.028868822443406383,0.1224122091254168\n2015-03-16 13:40:00,207.92,208.02,207.87,208.02,1610300.0,-0.014419610670513006,0.06734654608429036,0.052926935413777354,0.0934891020341766\n2015-03-16 13:50:00,208.02,208.16,207.99,208.1,2700300.0,0.009611687812371983,0.076945272674811,0.08655696048718298,0.08210001834886475\n2015-03-16 14:00:00,208.11,208.15,208.035,208.055,781000.0,0.026442307692309264,0.060116385321973276,0.08655869301428254,0.07702929063630287\n2015-03-16 14:10:00,208.055,208.1,208.005,208.09,1757100.0,0.10583537788040331,0.019226147560669204,0.12506152544107252,0.08136955643272235\n2015-03-16 14:20:00,208.09,208.12,207.94,208.12,2097900.0,0.12026747486408862,0.01922337562476617,0.1394908504888548,0.08978108386415894\n2015-03-16 14:30:00,208.12,208.29,208.1199,208.26,4090900.0,0.15870725725002366,0.12499999999999734,0.283707257250021,0.1251518195780399\n2015-03-16 14:40:00,208.26,208.36,208.2,208.22,2373000.0,0.17319349562203712,0.1683744648097285,0.3415679604317656,0.16820399398513672\n2015-03-16 14:50:00,208.215,208.52,208.215,208.385,4765700.0,0.2140040396268139,0.247750998220031,0.4617550378468449,0.230785895705077\n2015-03-16 15:00:00,208.38,208.51,208.35,208.47,2503000.0,0.3320820098180688,0.25970278459095386,0.5917847944090227,0.30900034265171333\n2015-03-16 15:10:00,208.47,208.64,208.47,208.515,3603900.0,0.31275121485156987,0.3151159434234385,0.6278671582750084,0.38318930166123794\n2015-03-16 15:20:00,208.52,208.58,208.465,208.495,1801600.0,0.27654867256639015,0.2669039145907437,0.5434525871571338,0.43113927799784707\n2015-03-16 15:30:00,208.495,208.5,208.34,208.47,3071900.0,0.21632535333140357,0.3320820098180688,0.5484073631494724,0.47107147448318415\n2015-03-16 15:40:00,208.47,208.6,208.37,208.4001,3518800.0,0.14420951465641263,0.25747492722436593,0.40168444188077856,0.4759294961439897\n2015-03-16 15:50:00,208.41,208.58,208.39,208.51,4877600.0,0.21869217274277375,0.283762985763758,0.5024551585065318,0.493379907211905\n2015-03-16 16:00:00,208.51,208.69,208.4,208.64,10793600.0,0.26430871257627775,0.29804826458992295,0.5623569771662007,0.5148598556167518\n2015-03-17 09:40:00,207.65,208.05,207.51,207.89,7560000.0,-0.11051316548146284,-0.10091302258530277,-0.2114261880667656,0.3879634807669257\n2015-03-17 09:50:00,207.89,207.93,207.37,207.4,4162500.0,-0.41294535676557054,-0.31482060032202996,-0.7277659570876005,0.17618957419179848\n2015-03-17 10:00:00,207.4,207.61,207.25,207.57,3120700.0,-0.3121698203822909,-0.24989187370849653,-0.5620616940907874,0.0139861502982621\n2015-03-17 10:10:00,207.575,207.65,207.44,207.54,2495600.0,-0.4054994361398334,-0.2786853738227957,-0.6841848099626291,-0.1518066268094704\n2015-03-17 10:20:00,207.54,207.75,207.435,207.66,2740500.0,-0.3885451144049479,-0.28810141169691716,-0.676646526101865,-0.2930293594993975\n2015-03-17 10:30:00,207.66,207.74,207.54,207.72,2091900.0,-0.3812675347097283,-0.24013063106329557,-0.6213981657730239,-0.400488505140865\n2015-03-17 10:40:00,207.72,207.86,207.54,207.74,2169300.0,-0.3621189956593662,-0.3095232382369084,-0.6716422338962746,-0.4959038312969205\n2015-03-17 10:50:00,207.74,207.76,207.58,207.69,1261900.0,-0.3741545546121716,-0.3741545546121716,-0.7483091092243432,-0.5830758693845205\n2015-03-17 11:00:00,207.69099999999997,207.8,207.55,207.65,1722600.0,-0.3599326487847221,-0.41483826103636545,-0.7747709098210875,-0.6541501702877991\n2015-03-17 11:10:00,207.65,207.65,207.2,207.39,3150300.0,-0.5371445014627607,-0.5299887287464999,-1.0671332302092607,-0.7551589645647888\n2015-03-17 11:20:00,207.38,207.42,207.03,207.05,3465700.0,-0.7620782208588861,-0.681153163524717,-1.443231384383603,-0.8949221467393776\n2015-03-17 11:30:00,207.06,207.31,206.98,207.29,1849800.0,-0.2886141709557921,-0.5326772875828834,-0.8212914585386755,-0.8992088842818554\n2015-03-17 11:40:00,207.3,207.36700000000002,207.19,207.21,1516600.0,-0.09161041465766129,-0.6234712963406941,-0.7150817109983554,-0.8824842949724373\n2015-03-17 11:50:00,207.2051,207.34,207.13,207.25,2937500.0,-0.1541648600472123,-0.6662193251533721,-0.8203841852005844,-0.8821234279378323\n2015-03-17 12:00:00,207.245,207.49,207.16,207.47,2421500.0,-0.03372843789148927,-0.2020299196690445,-0.23575835756053376,-0.7729906036007099\n2015-03-17 12:10:00,207.47,207.49,207.23,207.3,1007500.0,-0.17336030049117657,-0.04821600771456325,-0.2215763082057398,-0.6692953733543763\n2015-03-17 12:20:00,207.3,207.34,207.14,207.305,1215800.0,-0.1997881763912912,-0.12766777472659196,-0.32745595111788317,-0.5921204755932922\n2015-03-17 12:30:00,207.305,207.57,207.3,207.495,2334400.0,-0.1179358813901965,-0.02168256721595263,-0.13961844860614914,-0.48705123706240905\n2015-03-17 12:40:00,207.5,207.64,207.38,207.625,1564900.0,-0.03129664403678234,-0.016854473658867164,-0.048151117695649504,-0.3764186776499477\n2015-03-17 12:50:00,207.625,207.76,207.58,207.66,2246300.0,0.004815795810242385,-0.028885037550552273,-0.024069241740309888,-0.27461886428425064\n2015-03-17 13:00:00,207.67,207.86,207.66,207.85,1341300.0,0.22180433000626998,0.052950803889473264,0.27475513389574324,-0.13745214604779762\n2015-03-17 13:10:00,207.85,207.94,207.72,207.91,1370800.0,0.41535860903163524,0.10592710289374363,0.5212857119253789,0.013302195134419215\n2015-03-17 13:20:00,207.9,208.05,207.8632,207.94,1754500.0,0.3135703603647011,0.13965807849747325,0.45322843886217434,0.12727199266034334\n2015-03-17 13:30:00,207.94,207.96,207.87,207.905,829300.0,0.3354085227546877,0.24832441294180274,0.5837329356964904,0.24372787779504257\n2015-03-17 13:40:00,207.905,207.985,207.79,207.83,1055900.0,0.2798552472858873,0.37672059888915754,0.6565758461750448,0.34789852627316853\n2015-03-17 13:50:00,207.83,207.9,207.78,207.84,873200.0,0.1783390369691995,0.2653287664624582,0.4436678034316577,0.39713436327548624\n2015-03-17 14:00:00,207.84,208.15,207.83,208.1,1976200.0,0.3859141341051586,0.4295159500024015,0.8154300841075601,0.5018679947345609\n2015-03-17 14:10:00,208.1,208.25,207.99,208.02,1694900.0,0.3449024384361232,0.3715319662243699,0.7164344046604931,0.5678226656537061\n2015-03-17 14:20:00,208.025,208.09,207.86,207.97,1193600.0,0.22892117882358232,0.24099869860703116,0.4699198774306135,0.5733919161080253\n2015-03-17 14:30:00,207.97,207.99,207.79,207.845,1142400.0,0.1059602649006619,0.2629040038591324,0.3688642687597943,0.551167946892627\n2015-03-17 14:40:00,207.84,207.89,207.7,207.82,1071400.0,0.07704902244052292,0.24842623188054969,0.3254752543210726,0.5139108203156411\n2015-03-17 14:50:00,207.82,207.9,207.77,207.8001,730800.0,-0.02400769785904089,0.14703968770330977,0.12303198984426889,0.43892364346241225\n2015-03-17 15:00:00,207.8001,208.03,207.69,207.99,1845900.0,0.03847818767737099,0.17579771222155927,0.21427589989893026,0.3877672452024146\n2015-03-17 15:10:00,207.99,208.16,207.97,208.15900000000002,1469300.0,0.10531884197366725,0.2402966387364147,0.34561548071008197,0.36483536234377634\n2015-03-17 15:20:00,208.15900000000002,208.32,208.139,208.285,3156500.0,0.18277578701810793,0.20928554245851494,0.39206132947662287,0.3546775875333529\n2015-03-17 15:30:00,208.285,208.34,208.22,208.29,1588000.0,0.22133474474328452,0.18277139146745114,0.40410613621073566,0.35151913243273947\n2015-03-17 15:40:00,208.29,208.42,208.24,208.26,2739700.0,0.20207852193994125,0.153890545349622,0.35596906728956323,0.34032778602320235\n2015-03-17 15:50:00,208.26,208.26,208.06,208.2275,2856000.0,0.061268620855359224,0.15511892450879028,0.2163875453641495,0.31211181775118996\n2015-03-17 16:00:00,208.2275,208.235,207.89,207.97,7656700.0,-0.02403615037016582,0.0673627484001349,0.04332659802996908,0.2615219837692601\n2015-03-18 09:40:00,207.43,207.44,207.15,207.37,5726600.0,-0.2885031494927137,-0.2261354888375644,-0.5146386383302781,0.11724016643820612\n2015-03-18 09:50:00,207.38,207.38,207.05,207.14,2731400.0,-0.33919507325170795,-0.4613166746756381,-0.800511747927346,-0.06295489069067708\n2015-03-18 10:00:00,207.13,207.27,206.95,207.135,2791900.0,-0.32961216437301655,-0.4254398615517796,-0.7550520259247961,-0.2144120528691254\n2015-03-18 10:10:00,207.135,207.42,207.11,207.4,2248200.0,-0.19254081205927198,-0.2740779920180736,-0.4666188040773456,-0.2974616471522361\n2015-03-18 10:20:00,207.39,207.47,207.34,207.45,2078400.0,-0.25962786672437677,-0.19004546657365173,-0.4496733332980285,-0.36505034303953865\n2015-03-18 10:30:00,207.45,207.57,207.39,207.47,1865300.0,-0.33099697827142505,-0.16841497449715526,-0.4994119527685803,-0.42722262766679414\n2015-03-18 10:40:00,207.47,207.51,207.22,207.36,2173500.0,-0.44410303190339784,-0.21179008094797114,-0.655893112851369,-0.5016374271773711\n2015-03-18 10:50:00,207.35,207.54,207.27,207.48,1604400.0,-0.38888088722454084,-0.24520409635079288,-0.6340849835753337,-0.5528143986548125\n2015-03-18 11:00:00,207.47,207.53,207.39,207.51,1139600.0,-0.36012676462114923,-0.3117808982556758,-0.671907662876825,-0.592867238171345\n2015-03-18 11:10:00,207.51,207.58,207.41,207.52,1356800.0,-0.33977260448306845,-0.36728521016875515,-0.7070578146518236,-0.6231601924062232\n2015-03-18 11:20:00,207.5299,207.549,207.31,207.32,1654800.0,-0.31254507861711023,-0.4656968649479065,-0.7782419435650167,-0.6527523625765586\n2015-03-18 11:30:00,207.33,207.35,207.14,207.17,1474200.0,-0.0964459661474737,-0.5233842312494019,-0.6198301973968756,-0.6487496097120548\n2015-03-18 11:40:00,207.165,207.25,207.13,207.2469,1314700.0,0.051607608380810355,-0.4709272310333579,-0.4193196226525475,-0.6115755078127726\n2015-03-18 11:50:00,207.24,207.39,207.17,207.2,1793400.0,0.031380500639688336,-0.37024570851565963,-0.3388652078759713,-0.5658775560136083\n2015-03-18 12:00:00,207.2,207.33,207.12,207.27,1172200.0,-0.06268081002892556,-0.048222983073731296,-0.11090379310265686,-0.4810548669138665\n2015-03-18 12:10:00,207.27,207.32,207.14,207.24900000000002,1353700.0,-0.09689081706433234,0.05262141546782395,-0.044269401596508384,-0.3902762800892863\n2015-03-18 12:20:00,207.25,207.25,207.1,207.105,1914300.0,-0.17592904998313674,-0.014483307987545047,-0.1904123579706818,-0.3343444589904115\n2015-03-18 12:30:00,207.11,207.17,206.95,207.12,1549000.0,-0.11574074074074403,-0.13500482160077043,-0.25074556234151446,-0.2978455978658825\n2015-03-18 12:40:00,207.12,207.34,207.09,207.31,1013500.0,-0.08193560825139334,-0.06748614123884833,-0.14942174949024167,-0.249894032972646\n2015-03-18 12:50:00,207.31,207.34,207.13,207.15,1730800.0,-0.17348561515106997,-0.15423916710849417,-0.32772478225956414,-0.24386094518995155\n2015-03-18 13:00:00,207.15,207.19,207.01,207.04,3541400.0,-0.23130300693909867,-0.15432098765433278,-0.38562399459343144,-0.25525195114781946\n2015-03-18 13:10:00,207.03,207.13,206.86,206.985,2533700.0,-0.16158595408063414,-0.23857721226141493,-0.40016316634204907,-0.27642495104128306\n2015-03-18 13:20:00,206.99,207.105,206.92,207.05,1774100.0,-0.05792344451415188,-0.22167606380414373,-0.2795995083182956,-0.2796712318586974\n2015-03-18 13:30:00,207.05,207.13,206.93,206.97,3175500.0,-0.13360875361706492,-0.26503469545104963,-0.39864344906811455,-0.3071022312548834\n2015-03-18 13:40:00,206.98,207.01,206.64,206.69,2409700.0,-0.24613899613898926,-0.3038780628979332,-0.5500170590369224,-0.36096882807826824\n2015-03-18 13:50:00,206.69,206.8,206.62,206.79,2540100.0,-0.23158199449994088,-0.1834242409615272,-0.4150062354614681,-0.3823041248709475\n2015-03-18 14:00:00,206.8,207.34,206.78,207.29,4731400.0,0.01978296638340815,0.02079645099635208,0.04057941737976023,-0.3140649968949496\n2015-03-18 14:10:00,207.3,209.59,207.24,209.14,21244900.0,0.9825933705125411,0.936293436293445,1.9188868068059861,0.09148471506126318\n2015-03-18 14:20:00,209.14,210.06,209.11,209.855,16141300.0,1.3204905368868314,1.2471655328798015,2.567656069766633,0.5755446135712753\n2015-03-18 14:30:00,209.85,209.9151,209.44,209.73,9714500.0,1.1673339443345698,1.1971107218852417,2.3644446662198115,0.973255569268104\n2015-03-18 14:40:00,209.73,210.34,209.65,210.08,11598400.0,1.4144339850350018,1.4364694237222864,2.850903408757288,1.410465033635758\n2015-03-18 14:50:00,210.08,210.37,209.78,209.96,9499800.0,1.410355486862458,1.371185786017759,2.781541272880217,1.7762172477830223\n2015-03-18 15:00:00,209.96,210.24,209.82,210.11,8451400.0,1.509771239461788,1.350634315759014,2.860405555220802,2.0984592507336246\n2015-03-18 15:10:00,210.1,210.8,209.99,210.71,11346700.0,1.7676889640183546,1.7185614289162432,3.486250392934598,2.4774002230223884\n2015-03-18 15:20:00,210.71,211.27,210.67,211.14,10671600.0,2.0147847514132344,1.980293663060273,3.9950784144735074,2.8782209475545404\n2015-03-18 15:30:00,211.15,211.17,210.67,210.685,9320100.0,1.9328462915477296,1.7875691475227606,3.72041543907049,3.1464648497677725\n2015-03-18 15:40:00,210.68,210.81,210.405,210.495,8963500.0,1.7916727114464015,1.6638493117604458,3.4555220232068473,3.2913568277415792\n2015-03-18 15:50:00,210.49,210.515,210.22,210.22,13676700.0,1.4134787013363015,1.5702758853940235,2.983754586730325,3.2883830426137077\n2015-03-18 16:00:00,210.22,210.5,210.16,210.42,13214500.0,0.6120302189920546,1.8046349605689738,2.4166651795610283,3.1629408601837037\n2015-03-19 09:40:00,210.04,210.055,209.71,209.9,7500300.0,0.021443377570240507,1.5039411963828186,1.5253845739530592,2.8781929474650796\n2015-03-19 09:50:00,209.9,209.94,209.49,209.57,3132200.0,-0.07628856148380603,1.0999083409715782,1.0236197794877722,2.5174707101576175\n2015-03-19 10:00:00,209.565,210.1,209.53,210.02,3308500.0,-0.028560548362532856,0.42077077555704445,0.3922102271945116,2.075170074783553\n2015-03-19 10:10:00,209.99,210.02,209.86,209.93,3468300.0,-0.014288435892551021,0.03573896261706011,0.02145052672450909,1.6089009674274102\n2015-03-19 10:20:00,209.925,210.27,209.81,210.18,3262800.0,0.03331588215695902,0.2145615791732336,0.24787746133019262,1.2354177577904153\n2015-03-19 10:30:00,210.179,210.29,209.98,210.05,3536300.0,-0.3132267096957908,-0.014280274181266428,-0.32750698387705723,0.8161987023267276\n2015-03-19 10:40:00,210.05,210.05,209.77,209.84,1461700.0,-0.6157052192857781,-0.057153743570204085,-0.6728589628559822,0.41278083974597307\n2015-03-19 10:50:00,209.84,209.92,209.53,209.54,2002300.0,-0.5434653629826536,-0.2712864689924377,-0.8147518319750913,0.06344199008767996\n2015-03-19 11:00:00,209.53,209.72,209.475,209.72,4174900.0,-0.3681797667403064,-0.46984006454369176,-0.8380198312839982,-0.21248606207801546\n2015-03-19 11:10:00,209.71099999999998,209.74,209.55,209.59,1587800.0,-0.2996860431928483,-0.7341100691484193,-1.0337961123412676,-0.4545229941084085\n2015-03-19 11:20:00,209.58,209.81,209.5,209.78,1589900.0,-0.30415359756676974,-0.4295512257635803,-0.73370482333035,-0.5792622137385931\n2015-03-19 11:30:00,209.78,209.87,209.62,209.66,1414900.0,-0.11434016198189623,-0.39668400674600646,-0.5110241687279027,-0.6224396889449979\n2015-03-19 11:40:00,209.66,209.69,209.26,209.35,3919200.0,-0.10497685737462792,-0.41385215488536353,-0.5188290122599915,-0.6391336093714975\n2015-03-19 11:50:00,209.34099999999998,209.385,209.12,209.215,2419400.0,-0.3832968288734473,-0.5726641954186817,-0.955961024292129,-0.7187417276319403\n2015-03-19 12:00:00,209.2199,209.36,209.03,209.35,2395700.0,-0.2762825703806038,-0.2620295378751858,-0.5383121082557896,-0.704642560230928\n2015-03-19 12:10:00,209.34,209.46,209.22,209.41,1764800.0,-0.3663526501094361,-0.0763468053633587,-0.44269945547279477,-0.6588649183314441\n2015-03-19 12:20:00,209.41,209.41,209.21,209.32,1709900.0,-0.3475363008807464,-0.3333015903247416,-0.680837891205488,-0.6542907652634364\n2015-03-19 12:30:00,209.32,209.46,209.21,209.425,1380800.0,-0.1977697293175762,-0.2405563759348306,-0.4383261052524068,-0.6054784887794231\n2015-03-19 12:40:00,209.43,209.45,209.09,209.15,2097600.0,-0.18612198148324488,-0.49005614235417827,-0.6761781238374232,-0.6067561379785524\n2015-03-19 12:50:00,209.14,209.37,209.11,209.3,1860100.0,-0.20026702269692054,-0.35705784337062285,-0.5573248660675434,-0.5893666804458232\n2015-03-19 13:00:00,209.3,209.3,209.07,209.1728,5731300.0,-0.19905529843980974,-0.3179565383149119,-0.5170118367547216,-0.5733106947884667\n2015-03-19 13:10:00,209.1728,209.31,209.07,209.28,1937600.0,-0.23834493278672708,-0.12408132098883362,-0.3624262537755607,-0.5330881119817289\n2015-03-19 13:20:00,209.28,209.56,209.26,209.56,1513300.0,-0.04769627015167588,-0.07629219912264062,-0.1239884692743165,-0.45221498499208\n2015-03-19 13:30:00,209.56,209.76,209.55,209.7,2251900.0,0.1671841413900088,0.05248342001049622,0.21966756140050503,-0.3160378622976579\n2015-03-19 13:40:00,209.7,209.72,209.525,209.53,1086500.0,0.15056281815357675,-0.11917246639336909,0.03139035176020766,-0.23546802473224662\n2015-03-19 13:50:00,209.53,209.58,209.44,209.50400000000002,719200.0,0.0735610222116101,-0.07440618143660371,-0.0008451592249936191,-0.17111741570989017\n2015-03-19 14:00:00,209.50400000000002,209.54,209.3105,209.36,2016800.0,-0.023876605701722564,0.004776689754004693,-0.01909991594771787,-0.1181195678416254\n2015-03-19 14:10:00,209.35,209.65,209.32,209.65,2099300.0,0.15765335371680234,0.20792008221208746,0.3655734359288898,-0.00721271009139142\n2015-03-19 14:20:00,209.65,209.81,209.42,209.5,2319600.0,0.03581234332099559,0.07165034631000378,0.10746268963099936,0.042148565765020726\n2015-03-19 14:30:00,209.5,209.53,209.34,209.5013,1608600.0,0.167965574946205,0.04359868201135875,0.21156425695756376,0.0961893845268369\n2015-03-19 14:40:00,209.5013,209.63,209.36,209.545,1508300.0,0.1170568561872809,0.10749092298871776,0.22454777917599866,0.13861104145518474\n2015-03-19 14:50:00,209.545,209.68,209.51,209.605,2342400.0,0.20662342331316808,0.08594962397039385,0.2925730472835619,0.1799180268407128\n2015-03-19 15:00:00,209.605,209.74,209.46,209.68,1914200.0,0.19113149847094224,0.25340664594788453,0.4445381444188268,0.23694595168612315\n2015-03-19 15:10:00,209.68,209.85,209.59,209.6335,2944000.0,0.035073487306735984,0.15934065934064545,0.19441414664738144,0.23815993850594083\n2015-03-19 15:20:00,209.6335,209.69,209.53,209.56,2133800.0,-0.06676204101095928,0.1851101099186847,0.11834806890772542,0.22600288236860516\n2015-03-19 15:30:00,209.56,209.6,209.31,209.57,4570200.0,0.019090345057981573,0.13857033639144145,0.15766068144942302,0.2194125245634414\n2015-03-19 15:40:00,209.57,209.77,209.45,209.71,3584100.0,0.09832747823430577,0.07157854552395371,0.16990602375825947,0.2121666682567131\n2015-03-19 15:50:00,209.71,209.73,209.4,209.55,3245200.0,0.0907527703477351,-0.07153075822602384,0.019222012121711263,0.17408724729414005\n2015-03-19 16:00:00,209.55,209.61,209.45,209.5,7943500.0,-0.07154781779156183,-0.01431775879349173,-0.08586557658505356,0.12319829063592212\n"
  },
  {
    "path": "Tests/TestData/spy_crsi.csv",
    "content": "date,close,crsi\n19980102 00:00,973600,\n19980105 00:00,977500,\n19980106 00:00,966300,\n19980107 00:00,964700,\n19980108 00:00,957800,\n19980109 00:00,924700,\n19980112 00:00,940600,\n19980113 00:00,952200,\n19980114 00:00,958100,\n19980115 00:00,949400,\n19980116 00:00,962300,\n19980120 00:00,980000,\n19980121 00:00,971600,\n19980122 00:00,963000,\n19980123 00:00,956600,\n19980126 00:00,957500,\n19980127 00:00,970000,\n19980128 00:00,978800,\n19980129 00:00,987500,\n19980130 00:00,983100,\n19980202 00:00,1002500,\n19980203 00:00,1006900,\n19980204 00:00,1005900,\n19980205 00:00,1003800,\n19980206 00:00,1012800,\n19980209 00:00,1011400,\n19980210 00:00,1020500,\n19980211 00:00,1021300,\n19980212 00:00,1026600,\n19980213 00:00,1021600,\n19980217 00:00,1023400,\n19980218 00:00,1034100,\n19980219 00:00,1030000,\n19980220 00:00,1035600,\n19980223 00:00,1040000,\n19980224 00:00,1031900,\n19980225 00:00,1044800,\n19980226 00:00,1050600,\n19980227 00:00,1052000,\n19980302 00:00,1048100,\n19980303 00:00,1054100,\n19980304 00:00,1049700,\n19980305 00:00,1037500,\n19980306 00:00,1057500,\n19980309 00:00,1054400,\n19980310 00:00,1066600,\n19980311 00:00,1072500,\n19980312 00:00,1072500,\n19980313 00:00,1072200,\n19980316 00:00,1082500,\n19980317 00:00,1084700,\n19980318 00:00,1087800,\n19980319 00:00,1093400,\n19980320 00:00,1100000,\n19980323 00:00,1095000,\n19980324 00:00,1105900,\n19980325 00:00,1101900,\n19980326 00:00,1101300,\n19980327 00:00,1095300,\n19980330 00:00,1093400,\n19980331 00:00,1100900,\n19980401 00:00,1109800,\n19980402 00:00,1120300,\n19980403 00:00,1121900,\n19980406 00:00,1122500,\n19980407 00:00,1110000,\n19980408 00:00,1101300,\n19980409 00:00,1110000,\n19980413 00:00,1110000,\n19980414 00:00,1116900,\n19980415 00:00,1120200,\n19980416 00:00,1109100,\n19980417 00:00,1122200,\n19980420 00:00,1124100,\n19980421 00:00,1126300,\n19980422 00:00,1130000,\n19980423 00:00,1120900,\n19980424 00:00,1108800,\n19980427 00:00,1085900,\n19980428 00:00,1086300,\n19980429 00:00,1095300,\n19980430 00:00,1114400,\n19980501 00:00,1121900,\n19980504 00:00,1122500,\n19980505 00:00,1116600,\n19980506 00:00,1105000,\n19980507 00:00,1095900,\n19980508 00:00,1110000,\n19980511 00:00,1108600,\n19980512 00:00,1116400,\n19980513 00:00,1120600,\n19980514 00:00,1119700,\n19980515 00:00,1110000,\n19980518 00:00,1108400,\n19980519 00:00,1110600,\n19980520 00:00,1122800,\n19980521 00:00,1116900,\n19980522 00:00,1111600,\n19980526 00:00,1095300,\n19980527 00:00,1096300,\n19980528 00:00,1100000,\n19980529 00:00,1093800,25.14166629930232\n19980601 00:00,1095000,48.08095459720564\n19980602 00:00,1095900,53.11453344938877\n19980603 00:00,1085000,15.620279092992893\n19980604 00:00,1099100,71.57642234927708\n19980605 00:00,1118100,83.55501158740513\n19980608 00:00,1118800,69.8965693096311\n19980609 00:00,1122800,79.13068661293984\n19980610 00:00,1113800,27.5177955236821\n19980611 00:00,1096600,12.632850792368851\n19980612 00:00,1102500,57.72992606193529\n19980615 00:00,1080000,18.40590561985652\n19980616 00:00,1090600,64.73176161830064\n19980617 00:00,1112500,81.80577284067607\n19980618 00:00,1111600,42.65060363137787\n19980619 00:00,1100300,23.333975803886585\n19980622 00:00,1103800,60.518247535189516\n19980623 00:00,1119700,83.25888163707144\n19980624 00:00,1134700,88.84900544974278\n19980625 00:00,1130000,39.430461331623654\n19980626 00:00,1134100,64.9204493793427\n19980629 00:00,1138900,71.89009485468635\n19980630 00:00,1133600,35.54141686973649\n19980701 00:00,1149400,78.7211453823743\n19980702 00:00,1146300,44.05992723195848\n19980706 00:00,1157800,78.02078146222608\n19980707 00:00,1155600,46.238081297471865\n19980708 00:00,1168100,79.95625086566322\n19980709 00:00,1160000,36.32621969661826\n19980710 00:00,1165300,67.07795315277377\n19980713 00:00,1167500,67.48211883700642\n19980714 00:00,1178100,84.5207086595233\n19980715 00:00,1175600,41.66971020582601\n19980716 00:00,1184400,72.31015480400742\n19980717 00:00,1187500,70.78041948989292\n19980720 00:00,1185000,42.322610971205926\n19980721 00:00,1165300,13.850699310411558\n19980722 00:00,1166300,48.24934152689136\n19980723 00:00,1141900,15.751692650459217\n19980724 00:00,1141600,25.391229632506594\n19980727 00:00,1149800,63.39102300251515\n19980728 00:00,1133100,21.725880306881944\n19980729 00:00,1126600,20.38810297928751\n19980730 00:00,1143400,75.53209378362027\n19980731 00:00,1120600,23.670880539859073\n19980803 00:00,1113800,23.426742517389233\n19980804 00:00,1076100,8.637175066987302\n19980805 00:00,1081600,56.49457159166487\n19980806 00:00,1090900,68.41901018543746\n19980807 00:00,1090300,36.79048711081137\n19980810 00:00,1085900,27.940740878773095\n19980811 00:00,1070600,12.800493421002413\n19980812 00:00,1085000,74.17548679999821\n19980813 00:00,1076400,33.818275348392895\n19980814 00:00,1064800,22.359514002498234\n19980817 00:00,1085000,78.26507651434684\n19980818 00:00,1102500,84.79840045208037\n19980819 00:00,1100000,44.80136823316024\n19980820 00:00,1092500,32.24164968978854\n19980821 00:00,1083800,23.324205014354618\n19980824 00:00,1090600,68.06910545155927\n19980825 00:00,1095000,71.58697563425693\n19980826 00:00,1085000,28.601751116035995\n19980827 00:00,1042500,10.924442004579328\n19980828 00:00,1030000,10.989651157397276\n19980831 00:00,962500,3.6010563415664634\n19980901 00:00,996900,72.61537883752656\n19980902 00:00,990000,36.39091485828205\n19980903 00:00,985200,33.079004082562356\n19980904 00:00,976300,22.17985572433992\n19980908 00:00,1025900,83.7245533149801\n19980909 00:00,1007500,35.26058624696653\n19980910 00:00,982500,23.302906440197972\n19980911 00:00,1012500,77.78680191191098\n19980914 00:00,1031600,82.80834903957383\n19980915 00:00,1042000,82.36436686110221\n19980916 00:00,1050000,83.2680697787876\n19980917 00:00,1022300,21.012951184517505\n19980918 00:00,1019700,31.019382079387356\n19980921 00:00,1021900,55.99646227587538\n19980922 00:00,1030000,70.6817595253694\n19980923 00:00,1066300,89.46954104635563\n19980924 00:00,1043800,26.708881547623164\n19980925 00:00,1043000,39.40777644018062\n19980928 00:00,1049100,66.73563986749659\n19980929 00:00,1049400,63.36904793507539\n19980930 00:00,1018400,17.029942303092678\n19981001 00:00,986300,10.823114189205816\n19981002 00:00,1003100,66.2816869977747\n19981005 00:00,990000,27.357250720178488\n19981006 00:00,985300,28.594534862665668\n19981007 00:00,972200,16.26807851547348\n19981008 00:00,962200,13.81681409286911\n19981009 00:00,986300,78.21788685953709\n19981012 00:00,997800,79.16711623139729\n19981013 00:00,995300,47.078985693447265\n19981014 00:00,1005000,71.95822827702945\n19981015 00:00,1050300,88.62309088210559\n19981016 00:00,1056600,82.13333775462718\n19981019 00:00,1063400,85.09843194505844\n19981020 00:00,1065000,81.56932298751055\n19981021 00:00,1071300,86.78970964159133\n19981022 00:00,1080000,89.99829762228721\n19981023 00:00,1071300,33.507103950475056\n19981026 00:00,1075500,56.27524517653644\n19981027 00:00,1066300,30.389957716218262\n19981028 00:00,1067800,52.68593181054543\n19981029 00:00,1089700,82.02947885101884\n19981030 00:00,1100000,82.02226385764911\n19981102 00:00,1114800,89.0216902118867\n19981103 00:00,1111300,44.99648351768422\n19981104 00:00,1118400,67.64439692953806\n19981105 00:00,1137300,82.1121936507292\n19981106 00:00,1142800,77.53498498266349\n19981109 00:00,1131400,33.24684495546481\n19981110 00:00,1126900,33.560439749481226\n19981111 00:00,1123800,29.647936505098844\n19981112 00:00,1120300,25.468038836050557\n19981113 00:00,1127700,70.39871030067157\n19981116 00:00,1138400,81.13195088587685\n19981117 00:00,1143400,78.09147036264115\n19981118 00:00,1147500,79.25801721668387\n19981119 00:00,1155000,86.05309641627197\n19981120 00:00,1166300,91.41117022268757\n19981123 00:00,1191600,97.18121920208455\n19981124 00:00,1186900,43.47622509977766\n19981125 00:00,1188800,58.643538471746346\n19981127 00:00,1195000,68.17148813470817\n19981130 00:00,1166900,19.845582343421217\n19981201 00:00,1178100,62.114671411196774\n19981202 00:00,1175000,37.947026189286014\n19981203 00:00,1152800,17.5027819518685\n19981204 00:00,1179700,75.48858590363069\n19981207 00:00,1192500,77.73800105581402\n19981208 00:00,1184700,38.47592659993083\n19981209 00:00,1188100,59.42105676957391\n19981210 00:00,1168100,25.36434206506434\n19981211 00:00,1170600,51.75718695908952\n19981214 00:00,1144700,18.968356316540746\n19981215 00:00,1166300,69.07119840843477\n19981216 00:00,1164100,42.03036756758785\n19981217 00:00,1185000,75.47000822656192\n19981218 00:00,1190200,70.22221714377183\n19981221 00:00,1203100,83.35340460911357\n19981222 00:00,1205300,76.0973859009614\n19981223 00:00,1228100,93.27402416893342\n19981224 00:00,1226900,48.74129019067134\n19981228 00:00,1226300,47.419620733169324\n19981229 00:00,1243100,79.72038771926255\n19981230 00:00,1233800,41.44997027974609\n19981231 00:00,1228800,35.53547542338017\n19990104 00:00,1228800,40.202142090046834\n19990105 00:00,1244400,81.19530723014189\n19990106 00:00,1275000,91.97579598709899\n19990107 00:00,1269400,45.70082739711277\n19990108 00:00,1275000,67.47743044054597\n19990111 00:00,1262800,33.70085628211276\n19990112 00:00,1240000,19.01470813277367\n19990113 00:00,1233100,20.564930457237775\n19990114 00:00,1211600,10.089372313825745\n19990115 00:00,1243100,77.99894974951134\n19990119 00:00,1252800,73.51166614398585\n19990120 00:00,1256300,70.367258237065\n19990121 00:00,1235900,25.484605966342738\n19990122 00:00,1225600,22.766173244577015\n19990125 00:00,1236300,62.62965762868257\n19990126 00:00,1255000,77.01814129424396\n19990127 00:00,1244700,33.77938181009994\n19990128 00:00,1266600,73.66331409388711\n19990129 00:00,1278800,75.79890465596266\n19990201 00:00,1270900,37.78394745871963\n19990202 00:00,1262800,29.99574987476863\n19990203 00:00,1271900,66.40376070581071\n19990204 00:00,1248400,24.93524648819026\n19990205 00:00,1240000,23.725998128176816\n19990208 00:00,1243800,53.221717899891104\n19990209 00:00,1218600,20.06289250391409\n19990210 00:00,1226900,56.64450745289624\n19990211 00:00,1256900,81.11182358540704\n19990212 00:00,1235000,26.758280696794206\n19990216 00:00,1243800,60.65141753103097\n19990217 00:00,1227500,27.07491080329356\n19990218 00:00,1239400,65.08288256348241\n19990219 00:00,1239400,53.41621589681574\n19990222 00:00,1276900,88.4462779720515\n19990223 00:00,1275000,46.54642282293207\n19990224 00:00,1254100,23.204347612579937\n19990225 00:00,1247500,24.455285674170977\n19990226 00:00,1239100,18.167025918228884\n19990301 00:00,1237800,23.271160536323226\n19990302 00:00,1228100,12.551778627258495\n19990303 00:00,1231300,55.63195539725694\n19990304 00:00,1250000,82.09391472522431\n19990305 00:00,1278100,90.97670177298112\n19990308 00:00,1285200,81.27691122907761\n19990309 00:00,1282500,45.95097511140593\n19990310 00:00,1290300,66.59569952781136\n19990311 00:00,1302200,76.55004486124626\n19990312 00:00,1295300,39.56297155438269\n19990315 00:00,1311600,74.70709793835623\n19990316 00:00,1309800,49.02634171951968\n19990317 00:00,1302500,33.13140138171645\n19990318 00:00,1321600,78.99460343345619\n19990319 00:00,1300600,30.460616059409944\n19990322 00:00,1299100,35.66256651403743\n19990323 00:00,1264100,10.282056835397531\n19990324 00:00,1269400,53.653801112074575\n19990325 00:00,1291300,77.046515154316\n19990326 00:00,1284700,36.52226054362891\n19990329 00:00,1312200,76.83562898119585\n19990330 00:00,1303400,38.32345385378658\n19990331 00:00,1286300,24.513962350641894\n19990401 00:00,1293800,62.54737203375978\n19990405 00:00,1323800,84.49722635295562\n19990406 00:00,1319400,44.52706809323055\n19990407 00:00,1328800,68.81322246261793\n19990408 00:00,1345300,79.95473104971579\n19990409 00:00,1348800,73.85685088134436\n19990412 00:00,1360600,84.69085472114062\n19990413 00:00,1351900,35.54843057467427\n19990414 00:00,1330300,18.85555273049879\n19990415 00:00,1326300,24.45617582981978\n19990416 00:00,1321300,21.223614402224726\n19990419 00:00,1289100,3.935572693214278\n19990420 00:00,1306300,68.66643250534669\n19990421 00:00,1336900,84.09315555579211\n19990422 00:00,1359700,85.65470234808386\n19990423 00:00,1357500,48.06028097201389\n19990426 00:00,1361300,63.77041114582391\n19990427 00:00,1365600,69.77724760835893\n19990428 00:00,1353400,30.364815635155107\n19990429 00:00,1345600,27.32522858578116\n19990430 00:00,1334700,17.456331226332157\n19990503 00:00,1356300,75.53651763064907\n19990504 00:00,1333100,28.856645167747036\n19990505 00:00,1349700,67.9626848875356\n19990506 00:00,1335000,30.426587445392173\n19990507 00:00,1346300,64.09691834727893\n19990510 00:00,1342200,40.35986626019237\n19990511 00:00,1357200,70.63419276899951\n19990512 00:00,1366300,73.07981247920762\n19990513 00:00,1370200,74.1349942007203\n19990514 00:00,1343000,18.47019002311327\n19990517 00:00,1343100,45.97639915631996\n19990518 00:00,1336300,29.442576714554303\n19990519 00:00,1348100,63.8518307839063\n19990520 00:00,1343100,38.176811733361596\n19990521 00:00,1334200,25.254829498896836\n19990524 00:00,1310900,10.300037943636992\n19990525 00:00,1288400,7.573509942144206\n19990526 00:00,1306600,69.22564677490445\n19990527 00:00,1284400,28.4151942748051\n19990528 00:00,1305900,70.96615759709213\n19990601 00:00,1298800,39.05323830460129\n19990602 00:00,1297800,40.18469569857777\n19990603 00:00,1302800,63.01408004640916\n19990604 00:00,1319400,80.47570200770114\n19990607 00:00,1337500,86.56920860189969\n19990608 00:00,1321600,31.27511453654762\n19990609 00:00,1321600,42.27511453654762\n19990610 00:00,1309100,21.24769089798053\n19990611 00:00,1298100,16.189749320044836\n19990614 00:00,1297800,25.33593875202261\n19990615 00:00,1305900,66.34215887665032\n19990616 00:00,1334800,88.42285430340185\n19990617 00:00,1346600,84.45596700863251\n19990618 00:00,1343100,48.27842655996644\n19990621 00:00,1349400,67.19231327301098\n19990622 00:00,1337000,32.59665511210776\n19990623 00:00,1332800,33.904603011489236\n19990624 00:00,1316900,16.170929219498188\n19990625 00:00,1316600,26.528923259148396\n19990628 00:00,1333800,76.73773540063657\n19990629 00:00,1351300,83.66121398360305\n19990630 00:00,1367500,85.66298147035876\n19990701 00:00,1380600,87.12495080387309\n19990702 00:00,1391900,86.71674891542945\n19990706 00:00,1387200,43.32223441889426\n19990707 00:00,1395600,64.78293360517135\n19990708 00:00,1395600,60.449600271838015\n19990709 00:00,1402200,73.31358729381193\n19990712 00:00,1400600,48.337440290844256\n19990713 00:00,1395000,31.733091781292828\n19990714 00:00,1398400,62.56833971466699\n19990715 00:00,1411300,80.10632006642929\n19990716 00:00,1420000,81.58399409981189\n19990719 00:00,1410000,32.24008598875538\n19990720 00:00,1378000,12.287146366916778\n19990721 00:00,1378800,47.047885525084546\n19990722 00:00,1361400,20.02562707291871\n19990723 00:00,1357500,24.982694422315546\n19990726 00:00,1350000,16.43899493383621\n19990727 00:00,1365000,68.75051542944013\n19990728 00:00,1367300,63.89444295625005\n19990729 00:00,1343800,19.746800068577354\n19990730 00:00,1330900,17.86946879574457\n19990802 00:00,1329400,25.13614674315492\n19990803 00:00,1323600,17.32234873125385\n19990804 00:00,1306900,7.581076092685801\n19990805 00:00,1315600,62.49768704443022\n19990806 00:00,1300600,29.69945554793314\n19990809 00:00,1300500,36.85302935599441\n19990810 00:00,1282200,15.253749435664917\n19990811 00:00,1305300,77.02316288648775\n19990812 00:00,1300200,42.72839537541146\n19990813 00:00,1331900,82.72397568529787\n19990816 00:00,1333800,71.13857250778194\n19990817 00:00,1347000,84.1384033693984\n19990818 00:00,1335600,34.019891189925\n19990819 00:00,1328800,31.142079908947323\n19990820 00:00,1338800,68.32287510948457\n19990823 00:00,1363900,85.69153409690665\n19990824 00:00,1365000,74.66012582066914\n19990825 00:00,1384400,91.52867535522773\n19990826 00:00,1365000,26.968211635739653\n19990827 00:00,1351600,22.495546000495924\n19990830 00:00,1326600,10.689422907695208\n19990831 00:00,1325000,23.56657224906998\n19990901 00:00,1335600,65.69524706082082\n19990902 00:00,1322500,32.092040419309065\n19990903 00:00,1361900,81.25844405474285\n19990907 00:00,1355200,44.52284386004778\n19990908 00:00,1349100,37.55867058148794\n19990909 00:00,1351300,62.97811270914718\n19990910 00:00,1354500,68.0049383550748\n19990913 00:00,1348100,35.26411093816437\n19990914 00:00,1340600,25.609781572936924\n19990915 00:00,1320800,10.893117410478517\n19990916 00:00,1323800,53.810424212642346\n19990917 00:00,1337200,74.48389698348386\n19990920 00:00,1336300,45.27612816962139\n19990921 00:00,1309100,14.019824891643944\n19990922 00:00,1311600,52.722368894467365\n19990923 00:00,1280000,16.22913292154148\n19990924 00:00,1280600,45.16577005107655\n19990927 00:00,1282800,52.81371762787189\n19990928 00:00,1281900,30.897622773882944\n19990929 00:00,1267800,14.596409816546782\n19990930 00:00,1283800,70.49776625108937\n19991001 00:00,1283400,46.19078615949825\n19991004 00:00,1306300,81.20046561107584\n19991005 00:00,1301900,47.78538338103183\n19991006 00:00,1326300,82.99179819467336\n19991007 00:00,1320000,45.50167435777549\n19991008 00:00,1337200,78.93575960506774\n19991011 00:00,1338100,72.80395876478441\n19991012 00:00,1314100,22.245935814360433\n19991013 00:00,1286600,12.904856579620537\n19991014 00:00,1284100,23.897364439825704\n19991015 00:00,1248100,4.592633394677423\n19991018 00:00,1255600,57.98750152870837\n19991019 00:00,1260800,62.33568766266912\n19991020 00:00,1292200,86.61549974044642\n19991021 00:00,1286300,39.14104960962678\n19991022 00:00,1303400,73.85508724173582\n19991025 00:00,1295000,38.226750046724476\n19991026 00:00,1282500,26.661593444744028\n19991027 00:00,1301300,76.6181674240292\n19991028 00:00,1345000,88.94993079673576\n19991029 00:00,1365600,89.74042426039614\n19991101 00:00,1359400,44.79690202463496\n19991102 00:00,1348100,33.00894090804147\n19991103 00:00,1356900,69.69238536699322\n19991104 00:00,1364700,73.49227107496631\n19991105 00:00,1372200,78.24284159648197\n19991108 00:00,1379400,81.83564871626905\n19991109 00:00,1367200,30.16277386855944\n19991110 00:00,1377500,64.68771983474892\n19991111 00:00,1383800,68.23511107715079\n19991112 00:00,1397500,81.41948492539676\n19991115 00:00,1398100,74.4238153218803\n19991116 00:00,1424400,94.66774840531257\n19991117 00:00,1415600,36.75544166674017\n19991118 00:00,1428100,67.92337478079533\n19991119 00:00,1425000,46.201409457338485\n19991122 00:00,1424700,45.893115881057014\n19991123 00:00,1408800,18.931476057401774\n19991124 00:00,1420600,71.46654570230511\n19991126 00:00,1414400,41.23604117336518\n19991129 00:00,1410000,35.53178136411952\n19991130 00:00,1392500,16.233114008490663\n19991201 00:00,1401300,64.46804200349504\n19991202 00:00,1411300,73.52577774721712\n19991203 00:00,1436900,88.66936850536338\n19991206 00:00,1427500,37.24225003586577\n19991207 00:00,1419400,31.207484647807558\n19991208 00:00,1406300,21.029618862460435\n19991209 00:00,1410000,60.566233497352435\n19991210 00:00,1420000,72.657291237698\n19991213 00:00,1421300,69.47747858606705\n19991214 00:00,1408100,24.86243696485319\n19991215 00:00,1418000,61.761398942663796\n19991216 00:00,1423800,66.27775578502649\n19991217 00:00,1423800,61.94442245169315\n19991220 00:00,1416900,28.9490010688444\n19991221 00:00,1433400,72.57174624485492\n19991222 00:00,1437500,71.39151008858686\n19991223 00:00,1460900,88.51439272137316\n19991227 00:00,1458100,47.91586066818619\n19991228 00:00,1461400,65.66295150470742\n19991229 00:00,1463400,69.48337008266599\n19991230 00:00,1466300,75.67574708990138\n19991231 00:00,1468800,78.22015184359776\n20000103 00:00,1455600,22.452697859388262\n20000104 00:00,1400600,6.570832278106548\n20000105 00:00,1402800,42.978183067563954\n20000106 00:00,1403400,44.53470230400226\n20000107 00:00,1444400,83.85862407242871\n20000110 00:00,1458100,82.93999713308953\n20000111 00:00,1440900,26.715330094894256\n20000112 00:00,1433400,27.612769860885393\n20000113 00:00,1451300,71.29698259607248\n20000114 00:00,1465000,76.83225192510805\n20000118 00:00,1456300,36.79327062407191\n20000119 00:00,1456900,55.779869087405444\n20000120 00:00,1445000,29.107726715725704\n20000121 00:00,1441300,29.479749198592774\n20000124 00:00,1400600,7.447263908146994\n20000125 00:00,1410000,59.55499622457092\n20000126 00:00,1406700,35.68229481265398\n20000127 00:00,1400000,26.0257822891263\n20000128 00:00,1364700,9.769327362136114\n20000131 00:00,1394400,75.11581293712904\n20000201 00:00,1401900,69.7635406487042\n20000202 00:00,1413000,78.3908106462469\n20000203 00:00,1428400,85.43319609430478\n20000204 00:00,1427800,45.57186469782945\n20000207 00:00,1427200,43.03089877578574\n20000208 00:00,1442800,78.90340765012256\n20000209 00:00,1414100,26.397257885867457\n20000210 00:00,1418800,57.067004703534394\n20000211 00:00,1391300,20.995740222833874\n20000214 00:00,1392500,46.673224238246185\n20000215 00:00,1407500,70.8241226767322\n20000216 00:00,1390900,22.778887686531444\n20000217 00:00,1390600,31.001795253957056\n20000218 00:00,1351900,8.252865245167404\n20000222 00:00,1354200,49.212916167509185\n20000223 00:00,1365200,66.64080209783897\n20000224 00:00,1356900,28.30458091284832\n20000225 00:00,1337500,15.890332819714743\n20000228 00:00,1350600,65.60421838274102\n20000229 00:00,1369100,78.73873668501183\n20000301 00:00,1383100,82.42709452585915\n20000302 00:00,1387200,76.79918684459425\n20000303 00:00,1413100,93.87787423772834\n20000306 00:00,1393900,27.149988437215153\n20000307 00:00,1359400,14.92551349419987\n20000308 00:00,1370500,60.04044434676455\n20000309 00:00,1405900,80.15408043947973\n20000310 00:00,1400000,40.62157564283656\n20000313 00:00,1388800,29.06068362934693\n20000314 00:00,1365000,15.520533186017339\n20000315 00:00,1395000,78.22433699557767\n20000316 00:00,1463100,89.3114032180166\n20000317 00:00,1466900,76.46397991595062\n20000320 00:00,1459800,42.40765117456335\n20000321 00:00,1497200,79.64816776044876\n20000322 00:00,1500000,69.58138181132901\n20000323 00:00,1526300,88.16127997655796\n20000324 00:00,1532800,81.24335810348974\n20000327 00:00,1525000,39.77820032931251\n20000328 00:00,1510000,24.998926750725776\n20000329 00:00,1510300,52.158158043577934\n20000330 00:00,1488800,22.586062694023056\n20000331 00:00,1505600,68.18768671523667\n20000403 00:00,1507700,61.20119226097599"
  },
  {
    "path": "Tests/TestData/spy_dema.txt",
    "content": "time,open,high,low,close,DEMA_5\n725898600,43.9688,43.96899,43.75,43.938,NaN\n728577000,43.96875,45.125,42.8125,44.40625,NaN\n730996200,44.5625,45.84375,44.21875,45.1875,NaN\n733674600,45.25,45.25,43.28125,44.03125,NaN\n736435800,44.09375,45.65625,43.84375,45.21875,NaN\n738941400,45.375,45.8125,44.21875,45.0625,NaN\n741533400,45.125,45.21875,44.15625,44.84375,NaN\n744298200,44.90625,46.5625,44.84375,46.5625,NaN\n746890200,46.40625,46.59375,44.8125,45.9375,46.117209629629635\n749482200,45.875,47.15625,45.71875,46.84375,46.64575367626886\n752164200,46.78125,47,45.53125,46.34375,46.62488395518976\n754756200,46.59375,47.15625,46.375,46.59375,46.72326030635574\n757607400,46.59375,48.3125,46.40625,48.21875,47.655370872834425\n760113000,48.15625,48.28125,46.5625,46.8125,47.35098991651002\n762532200,46.8125,47.3125,43.53125,44.59375,45.923238389642506\n765210600,43.34375,45.35937,43.34375,45.09375,45.41873900107444\n767885400,45.09375,45.9375,44.17187,45.8125,45.557712717147034\n770477400,45.70312,46.5625,44,44.46875,44.901260733496294\n773069400,44.6875,46.04687,44.375,45.90625,45.360058659263046\n775747800,45.9375,47.98437,45.65625,47.65625,46.596878997463484\n778426200,47.5,47.71875,45.73437,46.17187,46.43962925916774\n781191000,46.20312,47.70312,45,47.48437,47.0691561244621\n783700200,47.28125,47.32812,44.60937,45.59375,46.344736272986026\n786292200,45.64062,46.40625,44.6875,45.5625,45.921967864220434\n789057000,45.70312,47.23437,45.6875,47.09375,46.544824364300126\n791649000,47.15625,49.15625,47,49.01562,47.9503467683022\n794068200,48.96875,50.89062,48.21875,50.10937,49.30102597360287\n796915800,50.09375,51.67187,50.0625,51.59375,50.81579940111396\n799335000,51.54687,53.64062,51.39062,53.64062,52.71262099099512\n802013400,53.40625,55.15625,52.75,54.40625,54.08411380972062\n804778200,54.46875,56.70312,54.20312,56.15625,55.70168130585188\n807283800,56.23437,56.79687,55.42187,56.40625,56.60999671459335\n809962200,56.39062,58.90625,56.34375,58.48437,58.14556503907918\n812640600,58.48437,59.1875,57.26562,58.3125,58.77020151228631\n815236200,58.28125,61.20312,58.23437,60.90625,60.43793422123545\n817828200,60.98437,62.79687,60.57812,61.48437,61.55236162285334\n820506600,61.40625,63.6875,59.64062,63.67187,63.25538584325537\n823185000,63.60937,66.6875,63.4375,63.875,64.17141151418346\n825690600,64.64062,66,62,64.6875,64.99698831079778\n828369000,65,65.8125,62.125,65.39062,65.72014596364883\n830957400,65.375,68.4375,63.07812,66.875,66.82959092451054\n833808600,66.89062,68.5,66.15625,67.10937,67.45792858217014\n836227800,67.28125,67.70312,60.375,64.09375,66.0231165875555\n838906200,64.15625,67.34375,64.0625,65.32812,65.85680941355393\n841671000,64.46875,69.25,64.375,68.625,67.55575184582501\n844176600,68.70312,71.625,68.4375,70.84375,69.66228161063162\n846858600,70.98437,76.6875,70.26562,76.01562,73.60305243825327\n849537000,75.92187,76.57812,71.875,73.84375,74.4159747573903\n852129000,74.375,79.6875,72.75,78.40625,77.24841525951895\n854980200,78.71875,82,77.125,79.15625,79.05259267607401\n857399400,78.75,81.79687,75.6875,75.6875,77.93888345275694\n859905000,75.25,80.6875,73.3125,80.09375,79.6416645254208\n862493400,80.21875,85.5625,79.3125,85.15625,83.26118783266908\n865258200,85.34375,90.5,84.07812,88.3125,86.83389954337176\n867763800,88.5,96.03125,88.39062,95.3125,92.47494924330942\n870442200,95.5,96.625,89.34375,90.375,92.55431030513623\n873120600,90.6875,96.375,90.25,94.375,94.56965852093299\n875712600,95.25,98.5,84.375,92.0625,94.15901789229456\n878567400,93.1875,96.8125,90.09375,95.625,95.72273118042253\n880986600,96.21875,99,92.375,97.0625,97.20546695509913\n883665000,97.3125,99.5625,90.90625,98.3125,98.54301985994438\n886429800,99.90625,105.53125,99.71875,105.125,102.89659672210401\n888849000,105.25,111.53125,103.15625,109.9375,107.7527312472745\n891441000,110.3125,113.4375,107.625,111.34375,110.93501534209756\n894029400,111.75,113.3125,107.57812,109.03125,111.1100565684525\n896707800,108.96875,114.6875,107.5,113.3125,113.33534638367111\n899299800,114.0625,119.23437,111.3125,111.78125,113.4711311478048\n902151000,111.78125,112.42187,95,96,104.57635424877479\n904656600,96.0625,107,93.625,101.75,102.8646362660087\n907248600,100.03125,110.90625,92.21875,110,106.56335757744503\n910017000,110.8125,119.71875,110.1875,116.125,111.99186065170062\n912522600,116.125,124.75,113.75,123.3125,118.85682194562526\n915201000,123.375,128.29687,120.375,127.65625,124.81618563785563\n917879400,128.6875,128.84375,121.32812,123.5625,125.50604887464071\n920298600,123.65625,132.625,121.78125,128.375,128.27031599380734\n922977000,129.6875,137.5,128.125,133.25,132.21884404745836\n925738200,133.4375,138,128,130.20312,132.39560717714124\n928243800,130.125,137.5,128.01562,137,136.0066033262068\n930835800,137,142.25,132.5625,132.75,135.36075680065738\n933600600,132.75,138.78125,127,132.0625,134.40168536700688\n936192600,132.9375,136.625,125.5625,128.75,131.87524413349476\n938784600,127.9375,137.6875,123.4375,137,134.98846534821217\n941466600,136.5,143,134.59375,139.39062,137.9237452938408\n944058600,139.3125,147.5625,139,146.875,143.54928912591566\n946909800,148.25,148.25,135,139.625,142.39127648173604\n949415400,139.75,144.5625,132.71875,137.4375,140.35396236413\n951921000,137.625,155.75,135.03125,150.375,146.31193804917953\n954768600,150.125,153.10937,133.5,145.09375,146.47735079262605\n957187800,146.5625,148.48437,136.5,142.8125,145.12977303497715\n959866200,143.6875,149.15625,143,145.28125,145.64490258324685\n962631000,145.4375,151.98437,141.51562,142.90625,144.51399876211707\n965136600,143.625,153.09375,142.625,152.34375,149.07579164582415\n967815000,153.25,153.59375,142.125,143.625,146.62261163349132\n970493400,144.28125,145.75,130.15625,142.95312,144.82597477984436\n973089000,142.25,144.29687,129.75,132.28125,137.89055786935188\n975681000,133.1875,139.5625,125.53125,131.1875,133.57725503476055\n978445800,132,138.7,127.5625,137.02,134.63498099330212\n981037800,137.10001,137.99001,121.8,123.95,128.10897242006482\n983457000,124.05,127.75,108.03999,116.69,120.71308278528548\n986218200,116.3,127.27,109.3,124.91,121.54567819368515\n988723800,125.07001,132.09,123.44,125.95,122.86731190923109\n991402200,126.2,129.23,120.39999,122.60001,121.93612001511471\n994080600,122.8,124.32001,116.75,121.35001,120.9015780604947\n996672600,121.97,123.25,112.03999,114.14999,116.49159629616418\n999610200,113.85001,116.17,93.8,104.44,108.8769870346657\n1001943000,103.89999,111.78999,102.83,105.8,105.75527324792576\n1004625000,106.60001,116.89999,105.69901,114.05,108.95614787071625\n1007389800,113.64999,118,112,114.3,111.08363127298799\n1009981800,115.11,117.99001,108.39999,113.17999,111.76432597699898\n1012573800,113.09,113.3,107.82001,111.14999,111.09637518133731\n1014993000,111.72,117.907,111.50999,114.52,112.67769314089465\n1017671400,114.23,115.10001,106.63,107.86,109.88520188504295\n1020259800,107.97,111.25,104.89999,107.22,108.06351667299299\n1023111000,107.09,107.60001,95.19501,98.96001,102.57127139286044\n1025530200,99.187,99.8,77.67999,91.16,95.39568333581704\n1028208600,90.88,97.14999,83.55,91.78,92.0803460509292\n1031059800,90.735,93.33,80.00999,81.78999,85.02348547420912\n1033479000,82.438,91.28999,77.07001,88.52,85.2667201651992\n1036161000,88.35001,94.95,87.45,93.98,88.76963334283931\n1038839400,95.47,96.05,87.11,88.23,87.71096882814166\n1041517800,88.85001,93.86,84.14999,86.06,86.09256584070475\n1044282600,86.14,86.817,81,84.89999,84.72520719732115\n1046701800,85.25999,89.88,79.383,84.74001,84.0480347783372\n1049207400,85.25,92.8,84.91,91.91,87.80728317230687\n1051795800,91.92,97.09,90.5,96.95,92.73391766159263\n1054560600,97.53,102.179,96.67,97.63,95.76976436109823\n1057066200,97.25301,101.89999,96.42999,99.39,98.30350018742314\n1059744600,99.19,101.81799,96.34,101.44,100.6892160894094\n1062509400,101.64,104.7,99.25,99.95,101.00517692480226\n1065015000,100.24001,105.97,100.2,105.3,104.00058430444328\n1067869800,105.75,106.95,103.62,106.45,106.11514488379002\n1070289000,106.92999,111.52,105.96001,111.28,109.77548904307858\n1073053800,111.74001,116.5,110.73,113.48,112.79169877575366\n1075732200,113.7,116.60001,112.78,115.02,115.06426990408106\n1078151400,115.42999,116.97,108.85001,113.10001,115.00272152732867\n1080829800,113.07001,115.41,110.89999,110.96001,113.57506541240221\n1083591000,111.37,113.25999,108.06,112.86,113.70553987105687\n1086096600,112.46001,114.94,111.87,114.53,114.59735742256373\n1088688600,114.25,114.39999,108.21001,110.84,112.93623662072638\n1091453400,110.19,113.61,106.59,111.11,112.11504552871794\n1094045400,110.94,113.74001,110.41,111.75999,111.99950554018999\n1096637400,112.25999,114.67999,109.35001,113.2,112.72154715193423\n1099319400,113.56,119.14,113.2,117.89,115.70117151805009\n1101911400,118.16,121.66,117.73,120.87,118.92420773431824\n1104762600,121.56,121.75999,116.37,118.16,119.06731185995761\n1107268200,118.25,121.67,118.10001,120.63,120.40232348691315\n1109687400,120.78,123.25,116.25,117.96001,119.5376316003475\n1112365800,118.63,119.25999,113.55,115.75,117.75024947294636\n1115040600,116.07001,120.25,114.8,119.48,118.80582969710738\n1117632600,119.52,121.94,118.75,119.17999,119.18321205261147\n1120224600,119.45,124.64,118.25999,123.74001,121.88392398254533\n1122903000,123.83,124.74001,120.38,122.58,122.64602217556646\n1125581400,122.50999,124.74001,120.44,123.03999,123.23294668629067\n1128346200,122.96001,123.34,116.88,120.13,121.85570128146914\n1130855400,120.58,127.41,120.13,125.41,123.98518095916299\n1133447400,126.02,128.57001,124.36,124.50999,124.58992404267549\n1136298600,125.10001,129.44,124.39,127.5,126.5109338528282\n1138804200,127.82001,130.03999,123.64,128.23,127.88016778480406\n1141223400,128.60001,131.47,127.17999,129.83,129.41647533403733\n1144071000,130.07001,131.86,128.02,131.47,131.05633698547018\n1146490200,131.47,132.8,124.75999,127.50999,129.6311213877214\n1149168600,127.38,129.42999,122.34,127.23,128.60646096786405\n1151933400,127.42999,128.14,122.39,127.85001,128.3425662292759\n1154439000,127.34,131.03999,126.28,130.64,129.72054565331715\n1157117400,131.14,133.99001,129.35001,133.58,132.06847588030024\n1159795800,133.53999,139,132.34,137.78999,135.61883088337046\n1162391400,138.22,141.16,135.62,140.53,138.9602341199161\n1164983400,140.53,143.24001,138.97,141.62,141.2252762117235\n1167834600,142.25,144.13,140.25,143.75,143.45915311789082\n1170340200,144.14999,146.42,139,140.92999,142.91763139642174\n1172759400,139.34,143.81,136.75,142,143.05055603172198\n1175520600,142.16,149.8,140.89,148.28999,146.48734408833073\n1178026200,148.42,153.89,147.67,153.32001,151.00955499256455\n1180704600,153.88,154.39999,148.06,150.42999,151.67057706193907\n1183383000,150.87,156,145.03999,145.72,149.20986053033454\n1185975000,145.17999,150.59,137,147.59,148.7673353462509\n1188912600,147.45,154.39,144.33,152.58,151.21206467040807\n1191245400,152.60001,157.52,148,154.64999,153.60059829554368\n1193923800,153.28999,153.41,140.66,148.66,151.45099565165467\n1196692200,148.19,152.89,143.96001,146.21001,148.8244005152979\n1199284200,146.53,146.99001,126,137.37,142.45542039743958\n1201876200,137.94,139.61,131.73,133.82001,137.08749918978702\n1204554600,133.14,135.81,126.07001,131.97,133.31091874307626\n1207056600,133.71001,140.59,132.33,138.25999,134.9778864619741\n1209648600,138.39,144.3,137.52,140.35001,137.24456139682044\n1212413400,139.83,140.89,127.035,127.98,131.7247945459943\n1214919000,126.52,129.16,120.02,126.83,128.2165876627389\n1217597400,127.12,131.50999,124.75999,128.78999,127.59220264098775\n1220362200,130.03,130.71001,110.5321,115.99001,120.3366856712108\n1222867800,115.27,116.69,83.58,96.83,105.98459749895318\n1225722600,96.78,100.86,74.34,90.09,94.84426970028834\n1228141800,87.50999,92.42999,81.86,90.24001,89.4480996008497\n1230906600,90.44,94.5533,80.05,82.83,83.02111960100477\n1233585000,81.57001,87.74001,73.81,73.92999,75.1989985342954\n1236004200,72.52,83.3,67.10001,79.52,74.68706044528062\n1238592600,78.53,89.02,78.33,87.42,79.3854145784651\n1241184600,87.44,93.7,86.72,92.53,85.20519257338431\n1243863000,93.67,96.11,87.53,91.95,88.28340584075013\n1246455000,92.34,99.83,87,98.81,93.87001108838494\n1249306200,99.85001,104.35001,98.11501,102.46001,98.92961774417986\n1251811800,101.95,108.06,99.57001,105.59,103.30948095295763\n1254403800,105.34,110.31,101.99001,103.56,104.38170005097467\n1257172200,104.13,111.74001,103.08,109.94,108.31138631109617\n1259677800,110.92,113.03,105.476,111.44,111.07220394769503\n1262615400,112.37,115.14,107.22,107.39,110.09010023643954\n1265034600,108.14999,111.58,104.58,110.74001,111.21471522738825\n1267453800,111.2,118.1666,111.17,117,115.13957130921122\n1270128600,117.8,122.12,117.10001,118.8125,118.0976105334424\n1272893400,119.38,120.67999,104.38,109.369,114.24533790716266\n1275399000,108.35001,113.2,102.88,103.22,108.57529030579803\n1277991000,103.14999,112.28999,101.13,110.27,109.37690356010286\n1280755800,111.99001,113.17999,104.28999,105.31,107.07685349978247\n1283347800,106.73,115.78999,106.66,114.13,110.75829197299757\n1285939800,114.99001,119.75999,113.17999,118.49001,115.19134885298233\n1288618200,119.07001,122.95,117.59,118.49249,117.52949203819975\n1291213800,120.2,126.2,120.19,125.75,122.70761656071862\n1294065000,126.71001,130.35001,125.6969,128.67999,126.9748200639805\n1296570600,129.46001,134.69,129.3801,133.14999,131.54415161387683\n1298989800,133.57001,133.69,125.28,132.59,133.44228656784443\n1301664600,133.41,136.57001,129.50999,136.42999,136.32453137318066\n1304343000,137.07001,137.17999,131.38,134.89999,136.76724668964337\n1306935000,134.50999,134.9234,126.19,131.97,135.1287638647775\n1309527000,132.09,135.7,127.96671,129.33,132.58290884652854\n1312205400,130.84,130.96001,110.27,122.22,127.13998341102584\n1314883800,122.28999,123.39999,111.3,113.14999,119.13534617179954\n1317648600,112.49001,129.42,107.42999,125.5,121.77380671305455\n1320154200,122.03,128.02,116.2,124.99001,123.07714954105072\n1322749800,124.85001,127.25999,120.03,125.5,124.15228084893228\n1325601000,127.75999,133.39999,126.42999,131.32001,128.01320244699826\n1328106600,132.28999,138.19,132.13,137.02,133.26325177425002\n1330612200,137.31,141.83,134.36,140.81,138.11957905588972\n1333373400,140.64,142.21001,135.75999,139.87,140.05466017485293\n1335879000,139.78999,141.66,129.55,131.47,136.2275117638529\n1338557400,129.41,136.27,127.13499,136.105,136.57294449631368\n1341235800,136.48,139.339,132.60001,137.71001,137.56614854448364\n1343827800,138.7,143.09,135.58,141.16,139.9402182831721\n1346765400,141.03999,148.11,140.13,143.97,142.69200280223674\n1349098200,144.52,147.16,140.39,141.35001,142.6014678326836\n1351776600,141.64999,143.72,134.7,142.155,142.86939586480625\n1354545000,142.8,145.58,139.53999,142.41,143.05076433854893\n1357137000,145.11,150.94,144.73,149.7,147.11017651148472\n1359729000,150.64999,153.28,148.73,151.61,150.26322897595787\n1362148200,151.09,156.85001,150.41,156.67,154.6253379628395\n1364823000,156.59,159.72,153.55,159.67999,158.46345440558252\n1367415000,159.33,169.07001,158.10001,163.44501,162.39613233507023\n1370266200,163.83,165.99001,155.73,160.42,162.5799700442792\n1372685400,161.25999,169.86,160.22,168.71001,167.02724013234103\n1375363800,169.99001,170.9725,163.05,163.64999,166.37965682344176\n1378215000,165.23,173.60001,163.7,168.00999,168.21076792799298\n1380634200,168.14,177.51,164.53,175.79,173.3245142046832\n1383312600,176.02,181.75,174.76,181,178.76567763824738\n1385994600,181.09,184.69,177.32,184.69,183.48223053780399\n1388673000,183.98,184.94,176.88,178.18,182.09600621118426\n1391437800,177.95,187.15,173.71,186.29,185.55035026477722\n1393857000,184.69,189.0239,183.75,187.01,187.56779759250995\n1396359000,187.62,189.7,181.31,188.31,189.12468556122343\n1398951000,188.22,192.8,186.01,192.68,192.1538929294046\n1401715800,192.95,196.6,191.97,195.72,195.24755254532903\n1404221400,196.19,199.06,192.97,193.09,195.21389542514777\n1406899800,192.56,200.82,190.55,200.71,199.1962816578286\n1409664600,200.97,201.899,196.05,197.02,199.08442202148353\n1412170200,196.7,201.82,181.92,201.66,201.3831041807209\n1415025000,201.92,207.87,200.06,207.2,205.5132846758574\n1417444200,206.4,212.97,197.86,205.54,206.61411104304503\n1420209000,206.38,206.88,198.55,199.45,203.60068820145673\n1422887400,200.05,212.24,197.86,210.66,208.027979360589\n1425306600,210.78,212.06,204.12,206.43,207.93811105791568\n1427895000,206.39,212.48,204.51,208.46,208.85837947251468\n1430487000,209.4,213.78,206.76,211.14,210.71201215983479\n1433165400,211.94,213.34,205.28,205.85,208.64451422532875\n1435757400,207.73,213.18,204.11,210.5,209.99845800717844\n1438608600,210.46,211.31,182.4,197.67,203.5281599094251\n1441114200,193.12,202.89,186.93,191.63,196.64600965382084\n1443706200,192.08,209.44,189.12,207.93,202.0854973564611\n1446474600,208.32,211.66,202.18,208.69,205.57465885136108\n1448980200,209.44,211,199.83,203.87,204.7937685322765\n1451917800,200.49,201.9,181.02,193.7208,198.70562077576375\n1454337000,192.53,196.68,181.09,193.56,195.35657502000655\n1456842600,195.01,206.87,194.4542,205.52,200.31293523744708\n1459517400,204.35,210.92,203.09,206.3308,203.54476919659317\n1462195800,206.92,210.69,202.78,209.84,207.2402543788144\n1464787800,209.12,212.52,198.65,209.475,208.9687750843778\n1467379800,209.36,217.54,207.06,217.12,214.04047594414178\n1470058200,217.19,219.6,214.25,217.38,216.78117899913224\n1472736600,217.37,219.22,212.31,216.3,217.46580491255776\n1475501400,215.82,216.7,211.21,212.55,215.55721588379603\n1478007000,212.93,221.82,208.38,220.38,218.72481899503566\n1480602600,220.73,228.34,219.15,223.53,222.06655160058264\n1483453800,225.04,229.71,223.8837,227.53,225.93659369187216\n1485959400,228.255,237.31,226.82,236.47,232.80032421112614\n1488378600,238.39,240.32,231.61,235.74,235.8530573073361\n1491226200,235.8,239.53,232.51,238.08,238.497265649281\n1493645400,238.68,242.08,235.43,241.44,241.4927731735586\n1496323800,241.97,245.01,239.955,241.8,243.01824616506437\n1499088600,242.88,248,240.34,246.77,246.32198458739313\n1501594200,247.46,248.91,241.83,247.49,248.24009226538445\n1504272600,247.92,251.32,244.95,251.23,251.08701875944897\n1506951000,251.49,257.89,251.2926,257.15,255.6570951168722\n1509543000,258.04,266.05,255.63,265.01,262.2207851516301\n1512138600,264.76,268.6,260.76,266.86,266.47567126134135\n1514903400,267.84,286.6285,267.4,281.9,276.7649905032862\n1517495400,281.07,283.06,252.92,271.65,276.21413344378544\n1519914600,271.41,280.41,257.83,263.15,270.7399599235867\n1522675800,262.55,271.3,254.67,264.51,268.2192205897665\n1525181400,263.87,274.25,259.05,270.94,270.2589785980946\n1527859800,272.41,279.48,268.49,271.28,271.43009564645206\n1530538200,269.51,284.37,269.24,281.33,277.5172481516719\n1533130200,281.56,291.74,279.16,290.31,285.63517724825044\n1536067800,289.84,293.94,286.71,290.72,289.9903482635909\n1538400600,292.11,293.21,259.85,270.63,280.8459411300099\n1541079000,271.6,281.22,263.07,275.65,278.4355445006394\n1543847400,280.28,280.4,233.76,249.92,262.76030772084823\n1546439400,245.98,270.47,243.67,269.93,265.4835016275135\n1549031400,270.15,281.31,267.83,278.68,272.0489765163076\n1551450600,280.44,285.18,272.42,282.48,277.81485685395967\n1554125400,284.7,294.45,284.4,294.02,287.3069306869206\n1556717400,294.72,294.95,275.24,275.27,281.8548600919121\n1559568600,275.31,296.3093,273.09,293,288.5500664839181\n1561987800,296.68,302.23,294.33,297.43,294.48126193770764\n1564666200,297.6,300.87,281.72,292.45,294.6783197018688\n1567517400,290.57,302.63,289.27,296.77,296.91830985239943\n1569936600,297.74,304.55,284.82,303.33,301.5418266023687\n1572615000,304.92,315.48,304.74,314.31,309.8954088687585\n1575297000,314.59,323.8,307.13,321.86,318.293066668403\n1577975400,323.54,332.95,320.36,321.73,322.3494627273114\n1580740200,323.35,339.08,285.54,296.26,309.93347622823603\n1583159400,298.21,313.84,218.26,257.75,281.50154042550963\n1585747800,247.98,294.88,243.9,290.48,284.4093977992413\n1588339800,285.31,306.84,276.37,304.32,294.06517909876186\n1591018200,303.62,323.41,296.74,308.36,301.7405064431308\n1593610200,309.57,327.23,309.07,326.52,315.9761512136136\n1596461400,328.32,351.3,327.73,349.31,336.1357543100933\n1598967000,350.21,358.75,319.8,334.89,338.5482718740739\n1601559000,337.69,354.02,322.6,326.54,334.57513836094597\n1604327400,330.2,364.38,327.24,362.06,351.64984142611735\n1606833000,365.57,378.46,362.03,373.88,366.96194929662494\n1609770600,375.31,385.85,364.82,370.07,372.4193362061144\n1612189800,373.72,394.17,370.376,380.36,380.3004708096526\n1614609000,385.59,398.12,371.88,396.33,392.6820338768193\n1617283800,398.4,420.72,398.18,417.3,410.2402803648023\n1620048600,419.43,422.815,404,420.04,420.35058098559455\n1622554200,422.57,428.78,414.7,428.06,429.265094485325\n1625146200,428.87,441.8,421.97,438.51,438.8987566535024\n1627911000,440.34,453.07,436.1,451.56,450.387189100081\n1630503000,452.56,454.05,428.78,429.14,443.1679158429958\n1633095000,430.98,459.56,426.36,459.25,455.1284704128473\n1635773400,460.3,473.54,455.3,455.56,458.85222017579827\n1638369000,461.64,479,448.92,474.96,470.91919560646556\n1641220200,476.3,479.98,420.76,449.91,462.8146073971548\n1643725800,450.68,458.12,410.64,436.63,450.40094514888847\n1646145000,435.04,462.07,415.12,451.64,451.6925457997824\n1648819800,453.31,457.83,411.21,412,430.23852988909283\n1651498200,412.07,429.66,380.54,412.93,419.1935750522205\n1654090200,415.17,417.44,362.17,377.25,393.7665312300305\n1656682200,376.56,413.03,371.04,411.99,399.9304527279427\n1659360600,409.15,431.73,395.04,395.18,394.6710342016878\n1662039000,392.89,411.73,357.04,357.18,371.2789555009425\n1664803800,361.08,389.52,348.11,386.21,375.443703244951\n1667309400,390.14,407.68,368.79,407.68,390.41873521507137\n1669905000,408.77,410.49,374.77,382.43,384.964445511228\n1672756200,384.37,408.16,377.831,406.48,395.61982280827226\n1675261800,405.211,418.31,393.64,396.26,395.8844546282617\n1677681000,395.41,409.7,380.65,409.39,403.33824047845013\n1680528600,408.85,411.92,405.678,409.61,407.44567413648394\n"
  },
  {
    "path": "Tests/TestData/spy_do.csv",
    "content": "Date,Close,DO\n1998-01-03,63.932476016,\n1998-01-06,64.18857365,\n1998-01-07,63.453113778,\n1998-01-08,63.348048082,\n1998-01-09,62.894952268,\n1998-01-10,60.721405682,\n1998-01-13,61.765496036,\n1998-01-14,62.527222332,\n1998-01-15,62.914652086,\n1998-01-16,62.343357364,\n1998-01-17,63.190449538,\n1998-01-21,64.3527388,\n1998-01-22,63.801143896,\n1998-01-23,63.23641578,\n1998-01-24,62.816152996,\n1998-01-27,62.87525245,\n1998-01-28,63.6960782,\n1998-01-29,64.273939528,\n1998-01-30,64.84523425,\n1998-01-31,64.556303586,\n1998-02-03,65.83022515,\n1998-02-04,66.119155814,\n1998-02-05,66.053489754,\n1998-02-06,65.915591028,\n1998-02-07,66.506585568,\n1998-02-10,66.414653084,\n1998-02-11,67.01221423,\n1998-02-12,67.064747078,\n1998-02-13,67.412777196,5.085946977438411\n1998-02-14,67.084446896,4.229558814323077\n1998-02-18,67.202645804,3.406105274202872\n1998-02-19,67.905272646,3.2182087977446585\n1998-02-20,67.6360418,2.702834140750582\n1998-02-21,68.003771736,2.411958565313924\n1998-02-24,68.2927024,2.3705129153748246\n1998-02-25,67.760807314,1.4921912702967148\n1998-02-26,68.607899488,1.212567299315765\n1998-02-27,68.988762636,1.4401727984523944\n1998-02-28,69.08069512,1.7569473317292221\n1998-03-03,68.824597486,1.5080608531944222\n1998-03-04,69.218593846,1.4520199742687083\n1998-03-05,68.929663182,0.8933361493281637\n1998-03-06,68.12853725,-0.9590859645846876\n1998-03-07,69.44185845,-1.5568859476034334\n1998-03-10,69.238293664,-1.9667448678103199\n1998-03-11,70.039419596,-1.5529312568437206\n1998-03-12,70.42684935,-0.6274383975203648\n1998-03-13,70.42684935,0.3281314619636646\n1998-03-14,70.407149532,1.0602025328459916\n1998-03-17,71.08350995,2.092467227090637\n1998-03-18,71.227975282,3.030293435162676\n1998-03-19,71.431540068,3.6321218302570912\n1998-03-20,71.799270004,4.108422357331037\n1998-03-21,72.440291,4.624182439819762\n1998-03-24,72.11101695,4.21636327278442\n1998-03-25,72.828834379,3.9345825650537307\n1998-03-26,72.565415139,3.09853006510221\n1998-03-27,72.525902253,2.0562833099614437\n1998-03-28,72.130773393,0.34308546815931606\n1998-03-31,72.005649254,-1.4493761618643504\n1998-04-01,72.499560329,-2.372275725847004\n1998-04-02,73.085668138,-2.261501198141076\n1998-04-03,73.777143643,-1.2426278597667988\n1998-04-04,73.882511339,-0.058094431872859786\n1998-04-07,73.922024225,1.0239423541471524\n1998-04-08,73.0988391,0.20329836303980642\n1998-04-09,72.525902253,-1.918768806050906\n1998-04-10,73.0988391,-3.3760233422840713\n1998-04-14,73.0988391,-4.306047094581714\n1998-04-15,73.553237289,-4.341823262082983\n1998-04-16,73.770558162,-3.7483949608913463\n1998-04-17,73.039569771,-4.141896315379867\n1998-04-18,73.902267782,-3.6304331719960174\n1998-04-21,74.027391921,-2.5704869504887142\n1998-04-22,74.172272503,-1.3695520879422673\n1998-04-23,74.4159353,-0.2308398943353609\n1998-04-24,73.816656529,-0.44422948655480354\n1998-04-25,73.019813328,-2.202076657825131\n1998-04-28,71.511738179,-5.575783887469164\n1998-04-29,71.538080103,-8.415374672545646\n1998-04-30,72.130773393,-9.534393326256357\n1998-05-01,73.388600264,-8.255415757520254\n1998-05-02,73.882511339,-5.781927941633938\n1998-05-05,73.922024225,-3.149014178863581\n1998-05-06,73.533480846,-1.2293295147273895\n1998-05-07,72.76956505,-0.6502813539574959\n1998-05-08,72.170286279,-1.165844085304137\n1998-05-09,73.0988391,-1.0572286056776576\n1998-05-12,73.006642366,-1.0495835602185082\n1998-05-13,73.520309884,-0.6501237493788778\n1998-05-14,73.796900086,0.09258466165462664\n1998-05-15,73.737630757,0.7848117022869161\n1998-05-16,73.0988391,0.6015977731189679\n1998-05-19,72.993471404,0.11850599648401783\n1998-05-20,73.138351986,-0.21296153490706615\n1998-05-21,73.941780668,0.3644861711537075\n1998-05-22,73.553237289,0.5312868417600356\n1998-05-23,73.204206796,0.04321723076031958\n1998-05-27,72.130773393,-1.6829660647455071\n1998-05-28,72.196628203,-3.1909918295198167\n1998-05-29,72.440291,-3.8102457123039812\n1998-05-30,72.031991178,-4.380459872028062\n1998-06-02,72.11101695,-4.587666480811436\n1998-06-03,72.170286279,-4.404341817978917\n1998-06-04,71.45246885,-4.683359955927017\n1998-06-05,72.381021671,-3.4471019447422293\n1998-06-06,73.632263061,-0.48609154385540165\n1998-06-09,73.678361428,2.3413135643725838\n1998-06-10,73.941780668,4.65894369305839\n1998-06-11,73.349087378,5.3875201023546\n1998-06-12,72.216384646,4.018864394913244\n1998-06-13,72.604928025,2.590513941393226\n1998-06-16,71.1231948,-0.006202285955524189\n1998-06-17,71.821255786,-1.8089015283737737\n1998-06-18,73.263476125,-1.6795020940909637\n1998-06-19,73.204206796,-0.9184572877555297\n1998-06-20,72.687611489,-0.48055051715310526\n1998-06-23,72.918827194,0.1616621206055271\n1998-06-24,73.969207111,1.7049374000804676\n1998-06-25,74.960131561,3.776775486609786\n1998-06-26,74.6496419,5.090464273815414\n1998-06-27,74.920494583,5.751690096128669\n1998-06-30,75.237590407,6.00904753285041\n1998-07-01,74.887463768,5.496808616317864\n1998-07-02,75.931237522,5.444509884359057\n1998-07-03,75.726446469,5.021855544520612\n1998-07-07,76.486155214,4.839069533605915\n1998-07-08,76.340819628,4.402602232222172\n1998-07-09,77.166590003,4.427747391038622\n1998-07-10,76.6314908,3.734461820811042\n1998-07-11,76.981617439,3.0988087882137165\n1998-07-14,77.126953025,2.6275847899763463\n1998-07-15,77.827206303,2.628497949373049\n1998-07-16,77.662052228,2.454304995232775\n1998-07-17,78.243394572,2.543054281400586\n1998-07-18,78.448185625,2.759095619898204\n1998-07-21,78.28303155,2.597271849029724\n1998-07-22,76.981617439,0.4907556868055849\n1998-07-23,77.047679069,-1.7250945601799685\n1998-07-24,75.435775297,-5.182630852493496\n1998-07-25,75.415956808,-8.117728413129655\n1998-07-28,75.957662174,-9.371227501208587\n1998-07-29,74.854432953,-10.535910442446209\n1998-07-30,74.425032358,-11.3133059530293\n1998-07-31,75.534867742,-10.107279576410242\n1998-08-01,74.028662578,-9.208316540856082\n1998-08-04,73.579443494,-8.549505809287808\n1998-08-05,71.088920043,-9.030379038058243\n1998-08-06,71.452259008,-9.151953994146403\n1998-08-07,72.066632167,-8.287346566864166\n1998-08-08,72.026995189,-7.007327718274794\n1998-08-11,71.736324017,-5.8413681284762475\n1998-08-12,70.725581078,-5.346215586202753\n1998-08-13,71.67686855,-3.8629982828688156\n1998-08-14,71.108738532,-2.5737036459880116\n1998-08-15,70.342423624,-1.9218327292902373\n1998-08-18,71.67686855,-0.38185785312926157\n1998-08-19,72.832947075,1.948357851924463\n1998-08-20,72.667793,3.828785639505149\n1998-08-21,72.172330775,4.702458215402622\n1998-08-22,71.597594594,4.53280590436237\n1998-08-25,72.046813678,4.246640575832686\n1998-08-26,72.33748485,4.101439253423692\n1998-08-27,71.67686855,3.3358444203640687\n1998-08-28,68.869249275,0.7245605472706558\n1998-08-29,68.0434789,-2.2491758777310906\n1998-09-01,63.584318875,-5.847627950137927\n1998-09-02,65.856838947,-6.944247991766616\n1998-09-03,65.4010137,-6.93460465000765\n1998-09-04,65.083917876,-6.458377186484967\n1998-09-05,64.495969369,-5.831142680735063\n1998-09-09,67.772626217,-2.866891124261258\n1998-09-10,66.557092225,-0.09258963917943674\n1998-09-11,64.905551475,1.4370144820004782\n1998-09-12,66.887400375,3.2342864993739227\n1998-09-15,68.149177508,5.005760095340413\n1998-09-16,68.83621846,6.503990865759135\n1998-09-17,69.3647115,7.5640099281302895\n1998-09-18,67.534804349,7.114280945964111\n1998-09-19,67.600103967,5.967323062781716\n1998-09-22,67.745951009,4.810405691360501\n1998-09-23,68.2829333,4.022374510036222\n1998-09-24,70.689409493,4.425793827698939\n1998-09-25,69.197792018,4.153835417952045\n1998-09-26,69.14475673,3.607639867709011\n1998-09-29,69.549150801,3.2394709823092853\n1998-09-30,69.569039034,2.981288327652301\n1998-10-01,67.513921624,1.5811885418811684\n1998-10-02,65.385880693,-0.8560263330072218\n1998-10-03,66.499621741,-2.4442026514067905\n1998-10-06,65.6311689,-3.7493096023513957\n1998-10-07,65.319586583,-4.584142665922499\n1998-10-08,64.451133742,-5.2715476409610105\n1998-10-09,63.788192642,-5.80850100330543\n1998-10-10,65.385880693,-4.8577679164764405\n1998-10-13,66.148262958,-2.940128575435807\n1998-10-14,65.982527683,-1.1184496565135618\n1998-10-15,66.62558055,0.6458723835838427\n1998-10-16,69.628703733,3.533242170061513\n1998-10-17,70.046356626,6.168938125220691\n1998-10-20,70.497156574,8.114776095604249\n1998-10-21,70.60322715,9.123764407814193\n1998-10-22,71.020880043,9.375999244511902\n1998-10-23,71.5976388,9.234849585957576\n1998-10-24,71.020880043,8.188859055219304\n1998-10-27,71.299315305,6.865148693464754\n1998-10-28,70.689409493,4.908238391461033\n1998-10-29,70.788850658,3.117582396288654\n1998-10-30,72.240691667,2.479304173213194\n1998-10-31,72.923521,2.5916859273111967\n1998-11-03,73.904673828,3.2670830373774464\n1998-11-04,73.672644443,3.6622740966701173\n1998-11-05,74.143332624,4.042784960436393\n1998-11-06,75.396291303,4.721976992929626\n1998-11-07,75.760908908,5.324493206843641\n1998-11-10,75.005156054,4.730208793312016\n1998-11-11,74.706832559,3.3573047279679997\n1998-11-12,74.501320818,1.7006533450514496\n1998-11-13,74.269291433,0.006098626124327211\n1998-11-14,74.759867847,-1.0084575398642528\n1998-11-17,75.469214824,-1.176184484413497\n1998-11-18,75.800685374,-0.8304393074379135\n1998-11-19,76.072491225,-0.1573541415592814\n1998-11-20,76.56969705,0.84260965318704\n1998-11-21,77.318820493,2.086290217041565\n1998-11-24,78.996061476,3.7190882598383155\n1998-11-25,78.684479159,4.547916020334895\n1998-11-26,78.810437968,4.7805784116484915\n1998-11-28,79.22146145,4.734251148193948\n1998-12-01,77.358596959,2.1933932896144626\n1998-12-02,78.101090991,-0.2140216182465764\n1998-12-03,77.89557925,-2.306875441666321\n1998-12-04,76.423850008,-5.19642382129291\n1998-12-05,78.207161567,-6.426429236868444\n1998-12-08,79.055726175,-6.154912459450401\n1998-12-09,78.538632117,-5.673879525335366\n1998-12-10,78.764032091,-4.804140676266172\n1998-12-11,77.438149891,-4.797433298402154\n1998-12-12,77.603885166,-4.8284691610472805\n1998-12-15,75.886867717,-5.942391543317399\n1998-12-16,77.318820493,-5.9789663502255195\n1998-12-17,77.172973451,-5.732444734956253\n1998-12-18,78.55852035,-4.444017966066831\n1998-12-19,79.164998506,-2.580054180817818\n1998-12-22,80.023029493,-0.3807707496517807\n1998-12-23,80.169360359,1.6199399551320042\n1998-12-24,81.685880243,3.7483818221529717\n1998-12-25,81.606063407,5.250247222187127\n1998-12-29,81.566154989,5.865441297967337\n1998-12-30,82.683590693,6.32016727771358\n1998-12-31,82.065010214,5.67604933658324\n1999-01-01,81.732440064,4.282014727626958\n1999-01-05,81.732440064,2.791914980422739\n1999-01-06,82.770058932,2.0525618938730474\n1999-01-07,84.80538825,2.4602340111199936\n1999-01-08,84.432909682,2.6884071957234\n1999-01-09,84.80538825,2.9042690969162948\n1999-01-12,83.993917084,2.1378517813382416\n1999-01-13,82.4773972,-0.11193942983281602\n1999-01-14,82.018450393,-2.6776719649716654\n1999-01-15,80.588398748,-5.776662198438309\n1999-01-16,82.683590693,-6.972624668751408\n1999-01-20,83.328776784,-6.788148023105201\n1999-01-21,83.561575889,-5.772897166774882\n1999-01-22,82.204689677,-5.4141153643307405\n1999-01-23,81.519595168,-5.421981022627882\n1999-01-26,82.231295289,-4.802644567874829\n1999-01-27,83.47510765,-3.295293126760768\n1999-01-28,82.790013141,-2.2768353447507224\n1999-01-29,84.246670398,-0.9402554675931896\n1999-01-30,85.058141564,0.6063757977749589\n1999-02-02,84.532680727,1.5070943963799124\n1999-02-03,83.993917084,1.645239803665902\n1999-02-04,84.599194757,1.7666125996030928\n1999-02-05,83.036115052,0.5872876147288082\n1999-02-06,82.4773972,-1.1575946580128047\n1999-02-09,82.730150514,-2.47632386895539\n1999-02-10,81.053996958,-4.37545988321699\n1999-02-11,81.606063407,-5.466763183048549\n1999-02-12,83.601484307,-4.597326939724226\n1999-02-13,82.14482705,-3.9805614613683886\n1999-02-17,82.730150514,-3.0577673524237525\n1999-02-18,81.645971825,-2.6408006117125638\n1999-02-19,82.437488782,-1.896269332297699\n1999-02-20,82.437488782,-1.1759330506637085\n1999-02-23,84.931764907,0.7572238006454342\n1999-02-24,84.80538825,2.4054703804893265\n1999-02-25,83.415245023,2.5693707288495133\n1999-02-26,82.976252425,1.987351755163516\n1999-02-27,82.417534573,0.8853476862477407\n1999-03-02,82.331066334,-0.21138973062613786\n1999-03-03,81.685880243,-1.5416093023541322\n1999-03-04,81.898725139,-2.48474138153955\n1999-03-05,83.1425375,-2.211264698291153\n1999-03-06,85.011581743,-0.3936302153063167\n1999-03-09,85.483831356,1.8530439501889262\n1999-03-10,85.304243475,3.5667519089836475\n1999-03-11,85.823052909,4.920279780174425\n1999-03-12,86.614569866,6.081023640811061\n1999-03-13,86.155623059,6.2685653969164505\n1999-03-16,87.239801748,6.348344984262958\n1999-03-17,87.120076494,5.911823062696968\n1999-03-18,86.634524075,4.6830541086272675\n1999-03-19,87.904942048,4.025614121609102\n1999-03-20,86.718051252,2.5215851693994793\n1999-03-23,86.618038122,0.9168597476916389\n1999-03-24,84.284398422,-2.0812985607226153\n1999-03-25,84.637778148,-4.482613729418382\n1999-03-26,86.097969846,-5.133091070947835\n1999-03-27,85.657912074,-5.201839722005701\n1999-03-30,87.491486124,-3.8394990434249294\n1999-03-31,86.904742428,-2.609263680771072\n1999-04-01,85.764592746,-2.2145080305841702\n1999-04-02,86.264658396,-1.7347341856926661\n1999-04-06,88.264920996,-0.19064730731034985\n1999-04-07,87.971549148,0.9947066504423319\n1999-04-08,88.598298096,1.9746161875395956\n1999-04-09,89.698442526,3.104728427837756\n1999-04-10,89.931806496,3.98106115967483\n1999-04-13,90.718576452,4.861367451626457\n1999-04-14,90.138500298,4.897084109887068\n1999-04-15,88.698311226,3.293018817218538\n1999-04-16,88.431609546,1.1617800310031328\n1999-04-17,88.098232446,-0.9387852236021814\n1999-04-20,85.951283922,-3.946606557631071\n1999-04-21,87.098101146,-5.704739393735117\n1999-04-22,89.138368998,-5.372273173451887\n1999-04-23,90.658568574,-3.5687775394788943\n1999-04-24,90.51188265,-1.5599974575127646\n1999-04-27,90.765249246,0.36147810075069486\n1999-04-28,91.051953552,1.9773645318829765\n1999-04-29,90.238513428,2.4697984646315874\n1999-04-30,89.718445152,2.040162642267134\n1999-05-01,88.991683074,0.6527186532494298\n1999-05-04,90.431872146,-0.04326325447700441\n1999-05-05,88.885002402,-1.4344948497996555\n1999-05-06,89.991814374,-2.0174012044698344\n1999-05-07,89.0116857,-2.7349888343096325\n1999-05-08,89.765117946,-2.759762014105405\n1999-05-11,89.491748724,-2.5657858322442095\n1999-05-12,90.491880024,-1.6622296150507907\n1999-05-13,91.098626346,-0.3639575978482341\n1999-05-14,91.358660484,0.8697845669132818\n1999-05-15,89.54508906,0.5696629018437633\n1999-05-18,89.551756602,-0.18739985098104484\n1999-05-19,89.098363746,-1.1979497773030658\n1999-05-20,89.885133702,-1.5572128287544942\n1999-05-21,89.551756602,-1.854992172902044\n1999-05-22,88.958345364,-2.471361805812535\n1999-05-25,87.404808078,-3.904282476616487\n1999-05-26,85.904611128,-5.815672371522972\n1999-05-27,87.118103772,-6.217852300021455\n1999-05-28,85.637909448,-6.610340951560957\n1999-05-29,87.071430978,-5.711219378299155\n1999-06-02,86.598035496,-4.684389415820704\n1999-06-03,86.531360076,-3.639546795186959\n1999-06-04,86.864737176,-2.3631849088753114\n1999-06-05,87.971549148,-0.38092206603059253\n1999-06-08,89.17837425,2.099979968450036\n1999-06-09,88.118235072,3.3163634425200215\n1999-06-10,88.118235072,3.776495180537758\n1999-06-11,87.284792322,3.1564060070842856\n1999-06-12,86.551362702,1.810247795209861\n1999-06-15,86.531360076,0.42614150213579194\n1999-06-16,87.071430978,-0.3154089300690117\n1999-06-17,88.998350616,0.57036741725463\n1999-06-18,89.785120572,2.1994558345741595\n1999-06-19,89.821894305,3.757172107002539\n1999-06-22,90.24321657,5.124414559475056\n1999-06-23,89.41394735,5.314127506496206\n1999-06-24,89.13306584,4.684445051799962\n1999-06-25,88.069728695,2.8820789756606757\n1999-06-26,88.04966573,0.8810133304935661\n1999-06-29,89.19994239,-0.016327332714794807\n1999-06-30,90.370282015,0.3778669666669998\n1999-07-01,91.453682125,1.7212828521051904\n1999-07-02,92.32976493,3.501298281314604\n1999-07-03,93.085469945,5.362397789444032\n1999-07-07,92.77115016,6.392628525704993\n1999-07-08,93.33291318,7.010343026835251\n1999-07-09,93.33291318,7.016697362401267\n1999-07-10,93.77429841,6.668496928918287\n1999-07-13,93.66729593,5.842983655139015\n1999-07-14,93.29278725,4.367015718998111\n1999-07-15,93.52016752,3.0116931308001256\n1999-07-16,94.382875015,2.4137182269869726\n1999-07-17,94.964701,2.440958932764403\n1999-07-20,94.2959355,1.7188048075535676\n1999-07-21,92.1558859,-1.208938818499064\n1999-07-22,92.20938714,-4.049917753550645\n1999-07-23,91.04573517,-6.992522986566101\n1999-07-24,90.784916625,-9.25333347315798\n1999-07-27,90.2833425,-10.889197385316429\n1999-07-28,91.28649075,-10.706869583621831\n1999-07-29,91.440306815,-9.421099292011569\n1999-07-30,89.86870789,-8.717187286703947\n1999-07-31,89.006000395,-8.391656182248695\n1999-08-03,88.90568557,-8.044256615501169\n1999-08-04,88.51780158,-7.708540963649604\n1999-08-05,87.400963195,-7.862555067715121\n1999-08-06,87.98278918,-7.298353779658498\n1999-08-07,86.97964093,-7.011721923872635\n1999-08-10,86.972953275,-6.5693023864696585\n1999-08-11,85.74911241,-6.435548874864182\n1999-08-12,87.293960715,-4.632465228561799\n1999-08-13,86.95289031,-2.7781465480536554\n1999-08-14,89.072876945,0.4847546025003595\n1999-08-17,89.19994239,3.5247710771000555\n1999-08-18,90.08271285,6.259431325590157\n1999-08-19,89.32032018,7.560266890274875\n1999-08-20,88.86555964,7.527627931489754\n1999-08-21,89.53432514,7.263632365552461\n1999-08-24,91.212926545,7.607762681229083\n1999-08-25,91.28649075,7.780065657462956\n1999-08-26,92.58389582,8.186153775410368\n1999-08-27,91.28649075,7.301143211023309\n1999-08-28,90.39034498,5.374865598917005\n1999-08-31,88.71843123,2.4315566652911684\n1999-09-01,88.61142875,-0.3330356745876557\n1999-09-02,89.32032018,-2.0254977159033416\n1999-09-03,88.444237375,-3.5549662769291857\n1999-09-04,91.079173445,-2.9202461871650627\n1999-09-08,90.63110056,-1.89245560108602\n1999-09-09,90.223153605,-0.9798951965367806\n1999-09-10,90.370282015,-0.08204910135199128\n1999-09-11,90.584286975,0.7930429925592506\n1999-09-14,90.156277055,1.0525003708721457\n1999-09-15,89.65470293,0.5846948296005081\n1999-09-16,88.33054724,-0.919368670066298\n1999-09-17,88.53117689,-2.324565585923061\n1999-09-18,89.679465092,-2.373954803096403\n1999-09-21,89.619106493,-1.9408285710895399\n1999-09-22,87.794935501,-2.5684122996306726\n1999-09-23,87.962598276,-3.1089639116519834\n1999-09-24,85.8433408,-4.442855333145054\n1999-09-25,85.883579866,-5.48525753603942\n1999-09-28,86.031123108,-5.8726532448357105\n1999-09-29,85.970764509,-5.885213796454934\n1999-09-30,85.025146458,-6.12023978886026\n1999-10-01,86.098188218,-5.039270474921757\n1999-10-02,86.071362174,-3.5289884084191314\n1999-10-05,87.607153193,-0.7780417987451784\n1999-10-06,87.312066709,1.6131986423703637\n1999-10-07,88.948455393,4.440082557937757\n1999-10-08,88.5259452,6.258220530242262\n1999-10-09,89.679465092,7.868516047506411\n1999-10-12,89.739823691,8.777736598935384\n1999-10-13,88.130261051,7.603716378549578\n1999-10-14,86.285970526,4.642289204602896\n1999-10-15,86.118307751,1.4394777123351403\n1999-10-16,83.703963791,-2.311433155988304\n1999-10-19,84.206952116,-4.989297493976636\n1999-10-20,84.555690688,-6.252877512563643\n1999-10-21,86.661535142,-5.1262587473110415\n1999-10-22,86.265850993,-3.4336374523397453\n1999-10-23,87.412664374,-0.9279369725724322\n1999-10-26,86.84931745,1.0615568366472985\n1999-10-27,86.011003575,1.9371792470648614\n1999-10-28,87.271827643,2.9995506012900606\n1999-10-29,90.20257295,5.052513575963481\n1999-10-30,91.584114216,7.174536260913115\n1999-11-02,91.168310534,8.215659447536225\n1999-11-03,90.410474791,7.968996728847117\n1999-11-04,91.000647759,7.3604216146842205\n1999-11-05,91.523755617,6.7824147561109385\n1999-11-06,92.026743942,6.2803518440580675\n1999-11-09,92.509612734,5.7596718845418025\n1999-11-10,91.691418392,4.42229005171599\n1999-11-11,92.382189025,3.3572452611123396\n1999-11-12,92.804699218,2.776168882103768\n1999-11-13,93.723491225,2.823095838104628\n1999-11-16,93.763730291,2.9383483269200212\n1999-11-17,95.527542684,3.647460536240679\n1999-11-18,94.937369716,3.7195845488725467\n1999-11-19,95.775683591,3.8133119571734966\n1999-11-20,95.56778175,3.5999842170167113\n1999-11-23,95.547662217,3.1419923682934865\n1999-11-24,94.481326968,1.5405648558089382\n1999-11-25,95.272695266,0.2753394977774235\n1999-11-27,95.084912958,-0.8081529098716516\n1999-11-30,94.5618051,-2.0869243922714276\n1999-12-01,93.388165675,-4.016633768198531\n1999-12-02,93.978338643,-5.173668161558211\n1999-12-03,94.648989743,-5.189448666416439\n1999-12-04,96.365856559,-3.706796443641366\n1999-12-07,95.735444525,-2.458644536082417\n1999-12-08,95.192217134,-1.9479142039235313\n1999-12-09,94.313664193,-2.3502407463570876\n1999-12-10,94.5618051,-2.64082754982811\n1999-12-11,95.2324562,-2.3082563809428294\n1999-12-14,95.319640843,-1.8454990261461788\n1999-12-15,94.434381391,-2.231020288232564\n1999-12-16,95.09832598,-2.249083656213685\n1999-12-17,95.487303618,-1.7042900517330821\n1999-12-18,95.721262434,-0.8331000371978305\n1999-12-21,95.257379367,-0.4664961709151214\n1999-12-22,96.366664962,0.4056285329655225\n1999-12-23,96.642305625,1.3619727580540584\n1999-12-24,98.215474287,2.9895544841980666\n1999-12-28,98.027231883,4.178309905660456\n1999-12-29,98.249089002,4.885019068229525\n1999-12-30,98.383547862,5.173971768121653\n1999-12-31,98.578513209,5.197942803336737\n2000-01-01,98.746586784,5.04484571838227\n2000-01-04,97.859158308,3.4465631020721617\n2000-01-05,94.161539658,-1.4505310889426255\n2000-01-06,94.309444404,-6.116556818652427\n2000-01-07,94.349782062,-9.405742940391647\n2000-01-08,97.106188692,-9.235732474837334\n2000-01-11,98.027231883,-7.21111385449656\n2000-01-12,96.870885687,-5.571446986281437\n2000-01-13,96.366664962,-4.385725679389452\n2000-01-14,97.570071759,-2.494453819002949\n2000-01-15,98.49111495,-0.08540031322191766\n2000-01-19,97.906218909,1.326645132894626\n2000-01-20,97.946556567,1.927547793248415\n2000-01-21,97.14652635,1.2884450604313926\n2000-01-22,96.897777459,0.2188426064849196\n2000-01-25,94.161539658,-2.3289201597242766\n2000-01-26,94.7934963,-4.240438374975639\n2000-01-27,94.571639181,-5.5937304610021386\n2000-01-28,94.121202,-6.532944963386107\n2000-01-29,91.748003121,-7.948009779425249\n2000-02-01,93.744717192,-7.433153224607587\n2000-02-02,94.248937917,-5.7846823500919555\n2000-02-03,94.99518459,-3.429885573153861\n2000-02-04,96.030517812,-0.5712229375912585\n2000-02-05,95.990180154,1.7334764696512863\n2000-02-08,95.949842496,3.2822248761024753\n2000-02-09,96.998621604,4.785562573524139\n2000-02-10,95.069136963,4.493688634705094\n2000-02-11,95.385115284,3.584898618170108\n2000-02-12,93.536305959,1.4929187107423374\n2000-02-15,93.616981275,-0.5368701687121629\n2000-02-16,94.625422725,-1.4175150401518266\n2000-02-17,93.509414187,-2.290154053882631\n2000-02-18,93.489245358,-2.86048299174702\n2000-02-19,90.887466417,-4.2907877262585075\n2000-02-23,91.042094106,-5.2572009965004725\n2000-02-24,91.781617836,-5.1223490990543326\n2000-02-25,91.223613567,-4.728530450099761\n2000-02-26,89.919362625,-4.799694982048145\n2000-02-29,90.800068158,-4.165786908890993\n2000-03-01,92.043812613,-2.3626201008120304\n2000-03-02,92.985024633,0.10674241917410399\n2000-03-03,93.260665296,2.460259469931472\n2000-03-04,95.001907533,5.099981967802023\n2000-03-07,93.711102477,6.224755550840662\n2000-03-08,91.391687142,5.27738805310554\n2000-03-09,92.137933815,4.1320396004509945\n2000-03-10,94.517855637,4.088434839666192\n2000-03-11,94.121202,3.9224956808521156\n2000-03-14,93.368232384,3.1965998707398597\n2000-03-15,91.76817195,1.6094395873427914\n2000-03-16,93.78505485,1.102325041026731\n2000-03-17,98.363379033,2.7935809457542433\n2000-03-18,98.869558746,4.861702198913754\n2000-03-21,98.391016332,6.072008079243709\n2000-03-22,100.911789048,7.231792124879824\n2000-03-23,101.10051,7.988826332998151\n2000-03-24,102.873138942,8.672518447753497\n2000-03-25,103.311241152,8.943162223269283\n2000-03-28,102.7855185,8.209672296750973\n2000-03-29,101.7745134,6.319495291664019\n2000-03-30,101.794733502,4.3267034959405635\n2000-03-31,100.345626192,1.7324466179683071\n2000-04-01,101.477951904,-0.13840699234806664\n2000-04-04,101.619492618,-1.3073253269932792\n2000-04-05,101.10051,-2.2866418277403255\n2000-04-06,100.345626192,-3.3222451291042745\n2000-04-07,101.309451054,-3.495651262525641\n2000-04-08,102.300236052,-2.759047210819375\n2000-04-11,101.626232652,-2.257219605908439\n2000-04-12,101.140950204,-2.142210705783924\n2000-04-13,98.829118542,-3.4934820370643536\n2000-04-14,97.0564896,-5.68323727907233\n2000-04-15,91.536401754,-9.19185254785701\n2000-04-18,94.400916204,-10.623598670907676\n2000-04-19,97.204770348,-9.707001346273309\n2000-04-20,96.3824862,-8.201781397120328\n2000-04-21,96.638607492,-6.338380110718575\n2000-04-25,96.3824862,-4.515800027384309\n2000-04-26,99.671622792,-1.5464000978603067\n2000-04-27,98.660617692,0.8042874934791939\n2000-04-28,98.7414981,2.421040604176639\n2000-04-29,97.878773748,2.7790672276425923\n2000-05-02,99.206560446,3.0171004835235564\n2000-05-03,97.481111742,2.3649217713132344\n2000-05-04,95.459101542,0.7478805866924958\n2000-05-05,95.243420454,-0.9374051447467266\n2000-05-06,96.611647356,-1.6845248403295159\n2000-05-09,96.065704602,-2.0730457093034502\n2000-05-10,95.459101542,-2.4038952336305215\n2000-05-11,93.410131206,-3.2566607275775254\n2000-05-12,95.108619774,-3.1112698119714963\n2000-05-13,95.984824194,-2.1003087301253984\n2000-05-16,97.986614292,-0.11433185084900543\n2000-05-17,99.0784998,2.100169178435216\n2000-05-18,97.89899385,3.2498469303628923\n2000-05-19,97.096929804,3.4096024580610234\n2000-05-20,94.953598992,2.2875256660779613\n2000-05-23,94.636817394,0.8057080938140544\n2000-05-24,92.715907704,-1.3020269080704026\n2000-05-25,94.636817394,-2.2371449243599955\n2000-05-26,93.605592192,-2.9516829607667887\n2000-05-27,93.221410254,-3.416571743407154\n2000-05-31,96.133104942,-2.151514556083413\n2000-06-01,95.984824194,-0.5490347759808145\n2000-06-02,97.845073578,1.6358848749486796\n2000-06-03,99.813163506,4.130972437257725\n2000-06-06,99.24700065,5.741954092258197\n2000-06-07,98.633657556,6.142979178789204\n2000-06-08,99.455941704,6.185970190209176\n2000-06-09,98.781938304,5.4733277696887725\n2000-06-10,98.633657556,4.291398207350049\n2000-06-13,97.919213952,2.684179789144558\n2000-06-14,99.395281398,1.821228554442925\n2000-06-15,99.4155015,1.3229366057530925\n2000-06-16,99.92100405,1.3068270267898328\n2000-06-17,99.230556384,1.0039441337648114\n2000-06-20,100.433105338,1.2265205602118456\n2000-06-21,99.858854433,1.184879450814023\n2000-06-22,99.953436935,1.0844965941942775\n2000-06-23,98.318510829,-0.09410443320703621\n2000-06-24,97.541583134,-1.8323283511534214\n2000-06-27,98.467140475,-2.740730865295106\n2000-06-28,98.338778508,-3.188451757980687\n2000-06-29,98.386069759,-3.2284694077266707\n2000-06-30,97.582118492,-3.5580393256184095\n2000-07-01,98.217172434,-3.262423540850911\n2000-07-04,99.3116271,-1.9846827696496732\n2000-07-06,98.021251537,-1.4143542014920953\n2000-07-07,98.554967084,-0.8072026494994589\n2000-07-08,100.048019437,0.5069600574643971\n2000-07-11,99.966948721,1.664694507656563\n2000-07-12,100.243940334,2.6218279831924036\n2000-07-13,101.061403387,3.6814607247213686\n2000-07-14,101.257324284,4.451142380524097\n2000-07-15,101.932913584,5.1504308895675095\n2000-07-18,102.054519658,5.602337714340209\n2000-07-19,101.128962317,4.722145087517099\n2000-07-20,100.284475692,2.6851964162154474\n2000-07-21,101.210033033,1.2782794269284423\n2000-07-22,100.156113725,-0.5533291670951286\n2000-07-25,99.081926738,-2.8730142603410727\n2000-07-26,99.608886392,-4.326047757340433\n2000-07-27,98.744132088,-5.614036645321022\n2000-07-28,98.29824315,-6.578291598203506\n2000-07-29,96.102577925,-8.07993701200953\n2000-08-01,96.906529192,-8.441501540965817\n2000-08-02,97.2848592,-7.814852221502328\n2000-08-03,97.467268311,-6.524558295758517\n2000-08-04,98.29824315,-4.4117057871589935\n2000-08-05,98.994100129,-1.878962686134237\n2000-08-08,100.075043009,1.062385900845456\n2000-08-09,100.365546408,3.647045013967116\n2000-08-10,99.777783717,4.964827834800715\n2000-08-11,99.014367808,4.727849577269204\n2000-08-12,99.608886392,4.265083881964735\n2000-08-15,100.919529634,4.457025006095307\n2000-08-16,100.676317486,4.348310415324107\n2000-08-17,100.243940334,3.616402427303065\n2000-08-18,101.297859642,3.416661308448667\n2000-08-19,101.115450531,3.1992193873209516\n2000-08-22,101.581607148,3.2929459224458313\n2000-08-23,101.493780539,3.2679681389453066\n2000-08-24,101.953181263,3.3400636148956195\n2000-08-25,102.311243592,3.504956897454811\n2000-08-26,102.074787337,3.310894223571786\n2000-08-29,102.540943954,3.2796719716431895\n2000-08-30,102.35177895,2.9056540557672363\n2000-08-31,101.764016259,1.7228718857764562\n2000-09-01,102.858470925,1.3220024831479833\n2000-09-02,103.067903608,1.340883948604926\n2000-09-06,102.182881625,0.3880449071753205\n2000-09-07,101.128962317,-1.6753743345108205\n2000-09-08,101.845086975,-2.916752374153681\n2000-09-09,101.169497675,-4.1603096180749475\n2000-09-12,100.980332671,-5.113234885542617\n2000-09-13,100.493908375,-5.993940592887803\n2000-09-14,100.581734984,-6.403921553202885\n2000-09-15,100.345278729,-6.50547055732234\n2000-09-16,99.393672275,-6.948940117322842\n2000-09-19,97.998435717,-8.0544315075377\n2000-09-20,98.939881744,-7.85203358700285\n2000-09-21,98.357404346,-7.3781412332638965\n2000-09-22,98.228717479,-6.7486563408805935\n2000-09-23,98.316766388,-5.8497518775998145\n2000-09-26,97.619148109,-5.343062328116645\n2000-09-27,96.779296977,-5.343145337198308\n2000-09-28,96.725113033,-5.28271656705796\n2000-09-29,99.014384667,-2.580151792918379\n2000-09-30,97.382093354,-0.8062234290492043\n2000-10-03,97.402412333,0.3849324705845447\n2000-10-04,96.603199159,0.6529596254996264\n2000-10-05,97.246633494,1.1862779680602102\n2000-10-06,97.449823284,1.8491281426597226\n2000-10-07,95.4992013,1.141589390495703\n2000-10-10,95.119913692,-0.16049833434541938\n2000-10-11,94.063326784,-1.983857536054117\n2000-10-12,92.491992408,-3.9661804246959136\n2000-10-13,90.189174788,-6.091598286439144\n2000-10-14,93.169291708,-5.221780965116146\n2000-10-17,93.108334771,-3.5226597368587917\n2000-10-18,91.760509164,-2.265556645034934\n2000-10-19,91.035798913,-1.4533241616171964\n2000-10-20,94.178467665,1.109313830144636\n2000-10-21,94.740626084,3.9081342338226577\n2000-10-24,94.821902,6.048684306109543\n2000-10-25,94.909950909,7.267012072953264\n2000-10-26,92.735820156,6.447688836500831\n2000-10-27,92.620679275,4.968608589742267\n2000-10-28,93.724677134,4.154563029185546\n2000-10-31,94.991226825,4.209510768406368\n2000-11-01,96.833480921,5.1168764490680445\n2000-11-02,96.454193313,5.732281351982742\n2000-11-03,96.874118879,6.212937284339461\n2000-11-04,96.928302823,6.435018165669241\n2000-11-07,97.32790941,6.587120237288616\n2000-11-08,97.300817438,6.355837954552975\n2000-11-09,95.668526125,4.584510239350735\n2000-11-10,95.099594713,2.1552094636808334\n2000-11-11,92.769685121,-1.2607858756064303\n2000-11-14,91.692779234,-4.5855918879735\n2000-11-15,93.975277875,-5.527800031204144\n2000-11-16,94.232651609,-5.185880342912782\n2000-11-17,93.311524561,-4.75948929959457\n2000-11-18,93.108334771,-4.221245409269287\n2000-11-21,91.225442717,-4.322133466533089\n2000-11-22,91.543773388,-4.169595515554327\n2000-11-23,89.74215725,-4.526056154087236\n2000-11-25,91.056117892,-4.012945868804032\n2000-11-28,91.77405515,-2.917887893378797\n2000-11-29,90.629419333,-2.2632838800010404\n2000-11-30,91.191577752,-1.3660185247655434\n2000-12-01,89.152906859,-1.3510443659185114\n2000-12-02,89.322231684,-1.3916793512866548\n2000-12-05,90.0808069,-0.9247652995172189\n2000-12-06,93.555352309,1.4843252963588327\n2000-12-07,91.794374129,2.9623926790786754\n2000-12-08,91.421859514,3.577126125125332\n2000-12-09,93.237021638,4.595195391781644\n2000-12-12,93.894001959,5.627478945200494\n2000-12-13,93.297978575,5.958145810951905\n2000-12-14,92.471673429,5.287974051021621\n2000-12-15,90.886793067,3.434404642985456\n2000-12-16,89.30471132,0.7822086451326058\n2000-12-19,89.936536208,-1.096589671393339\n2000-12-20,88.700061696,-2.8009721284280786\n2000-12-21,86.070854904,-4.907395134097378\n2000-12-22,86.750236504,-6.043958523663477\n2000-12-23,88.903876176,-5.177927513105821\n2000-12-27,89.603639224,-3.2926926581884715\n2000-12-28,90.446072408,-0.9188533767336438\n2000-12-29,90.772175576,1.2980876610638603\n2000-12-30,89.8482166,2.480432118022115\n2001-01-03,87.1306902,1.9505473243780074\n2001-01-04,91.716516,2.9229437695964577\n2001-01-05,90.636299256,3.4517329397183687\n2001-01-06,88.4894534,2.72222452913892\n2001-01-09,88.1497626,1.5575319033425714\n2001-01-10,88.407927608,0.5900324438220252\n2001-01-11,89.447381456,0.38072209401456547\n2001-01-12,90.201495032,0.8161445398346103\n2001-01-13,89.617226856,1.0757869251467937\n2001-01-17,90.072412528,1.2776245796145247\n2001-01-18,90.316989904,1.598140271562336\n2001-01-19,91.75048508,2.555308671004859\n2001-01-20,91.363237568,3.163162345322256\n2001-01-23,91.465144808,3.424203217689005\n2001-01-24,92.484217208,3.847533501051352\n2001-01-25,92.864670904,4.258313772819307\n2001-01-26,92.436660496,4.152053261661777\n2001-01-27,92.246433648,3.6080942386503665\n2001-01-30,92.83749564,3.225052091924127\n2001-01-31,93.5848154,3.2185789467064723\n2001-02-01,93.116042096,2.8684614030429145\n2001-02-02,93.401382368,2.5431645337913764\n2001-02-03,91.770866528,0.9645642823413709\n2001-02-06,92.321165624,-0.3016642307839206\n2001-02-07,92.001856272,-1.385892767134436\n2001-02-08,91.186598352,-2.708676875631255\n2001-02-09,90.683855968,-4.079434459817477\n2001-02-10,89.562876328,-5.697341795109914\n2001-02-13,90.452866224,-6.069819717018028\n2001-02-14,89.759896992,-6.1609318057688185\n2001-02-15,89.78027844,-5.823194832023027\n2001-02-16,90.330577536,-4.790927972099816\n2001-02-17,88.632123536,-4.613191278161402\n2001-02-21,87.178246912,-5.230230768968852\n2001-02-22,85.33032896,-6.489614671184306\n2001-02-23,85.275978432,-7.467755335054406\n2001-02-24,84.847968024,-8.128397757544967\n2001-02-27,86.424133336,-6.8707626933940205\n2001-02-28,85.83986516,-5.349917004877305\n2001-03-01,84.34522564,-4.479760454986327\n2001-03-02,84.576215384,-3.498662408082488\n2001-03-03,84.087060632,-2.728960231726859\n2001-03-06,84.51507104,-1.7114570248893557\n2001-03-07,85.513761992,-0.004646332412065135\n2001-03-08,86.036885824,1.874487729531566\n2001-03-09,86.21352504,3.3735697668197204\n2001-03-10,84.019122472,3.1931794919090777\n2001-03-13,80.465956704,1.204167487531663\n2001-03-14,81.66166832,-0.09620080973184031\n2001-03-15,79.62352352,-1.5820940020725942\n2001-03-16,79.970008136,-2.5869962693173107\n2001-03-17,78.550371224,-3.6104687503919735\n2001-03-20,79.90597992,-3.305694813118791\n2001-03-21,77.8282882,-3.0727833682626233\n2001-03-22,76.527176336,-2.983770279212436\n2001-03-23,76.22744376,-2.880084740621964\n2001-03-24,77.8282882,-1.7144675408209444\n2001-03-27,78.6798012,0.11375591103787741\n2001-03-28,80.730244504,2.821960349423403\n2001-03-29,78.64574068,4.312832772604413\n2001-03-30,78.325571792,4.808512566157255\n2001-03-31,79.102151648,5.221337061130335\n2001-04-03,78.025839216,4.897648684766516\n2001-04-04,75.389554968,3.300594496903308\n2001-04-05,75.144319224,1.3500079942011354\n2001-04-06,78.489062288,1.3909171284531112\n2001-04-07,77.01083572,1.4383087367234708\n2001-04-10,77.6579856,1.8582662593957053\n2001-04-11,79.762925736,3.192100106304572\n2001-04-12,79.674368384,4.3757278440509\n2001-04-13,80.75749292,5.6355626656183375\n2001-04-17,80.539505592,6.361913861981975\n2001-04-18,81.350145968,6.805206501879034\n2001-04-19,84.565459056,7.880174791911905\n2001-04-20,85.641771488,8.996154219196178\n2001-04-21,84.715325344,9.00873985765768\n2001-04-24,83.58451608,7.738679355557188\n2001-04-25,82.515015752,5.590393909322174\n2001-04-26,83.85700024,3.9551418013656345\n2001-04-27,84.292974896,2.841115387534032\n2001-04-28,85.52596572,2.4206264258085994\n2001-05-01,85.294354184,2.0333594847973018\n2001-05-02,86.47966028,2.192837154441115\n2001-05-03,86.438787656,2.5007145852897708\n2001-05-04,85.260293664,2.021547339894404\n2001-05-05,86.47966028,1.842403859003042\n2001-05-08,86.220800328,1.4780745967213704\n2001-05-09,86.186739808,1.0280592539307705\n2001-05-10,85.743953048,0.2748463998684443\n2001-05-11,85.825698296,-0.3533006664185834\n2001-05-12,85.028682128,-1.383660516517324\n2001-05-15,85.307978392,-2.0456375097538526\n2001-05-16,85.35566312,-2.304878295421112\n2001-05-17,87.848893184,-1.014783857939662\n2001-05-18,88.087316824,0.6232712510070755\n2001-05-19,88.298492048,2.107720005830629\n2001-05-22,89.763094408,3.8107108288128373\n2001-05-23,89.490610248,4.819700409133432\n2001-05-24,88.073692616,4.0092003233935145\n2001-05-25,88.35298888,2.7648571949503165\n2001-05-26,87.351609592,0.6756896233574707\n2001-05-30,86.71808392,-1.8189780037155145\n2001-05-31,85.348851016,-4.722090490625192\n2001-06-01,85.90063144,-6.548382512259295\n2001-06-02,86.268485056,-7.146128570764674\n2001-06-05,86.629526568,-6.625773514902264\n2001-06-06,87.787584248,-4.782437139451865\n2001-06-07,86.874762312,-3.4530965557001423\n2001-06-08,87.358421696,-2.046271389047128\n2001-06-09,86.5137208,-1.461015894770206\n2001-06-12,85.791637776,-1.7086476690076537\n2001-06-13,85.921067752,-2.1052865970473675\n2001-06-14,84.974185296,-3.1095413575684603\n2001-06-15,83.434649792,-4.902231348071808\n2001-06-16,83.083511124,-6.563533362033617\n2001-06-19,82.714615416,-7.703785046868319\n2001-06-20,82.974208692,-7.898595531630598\n2001-06-21,83.75298852,-6.676859700248585\n2001-06-22,84.613745172,-4.285567328033146\n2001-06-23,83.85545955,-2.4096135950746103\n2001-06-26,83.431912626,-1.2054161556071321\n2001-06-27,83.233801968,-0.5138463899210635\n2001-06-28,82.871737662,-0.4017943933968837\n2001-06-29,83.951099178,0.4859403343779505\n2001-06-30,84.16287264,1.474581797896576\n2001-07-03,84.64107078,2.565592847330933\n2001-07-04,84.456622926,3.1940226669396807\n2001-07-06,83.431912626,2.681477162482338\n2001-07-07,81.423480438,0.6132867699271785\n2001-07-10,82.04513802,-0.9083664653815546\n2001-07-11,80.84964267,-2.6104462059308773\n2001-07-12,80.794991454,-4.032928872872233\n2001-07-13,82.769266632,-3.1777037609857928\n2001-07-14,83.27479038,-1.3073618958744362\n2001-07-17,82.38670812,0.03929099750997267\n2001-07-18,83.117668134,1.621458177364687\n2001-07-19,82.72827822,2.662541870847839\n2001-07-20,83.226970566,3.5195278590617534\n2001-07-21,82.96737729,3.7898363681148055\n2001-07-24,81.539614272,2.6133736072633127\n2001-07-25,80.193828078,0.28051381047844615\n2001-07-26,81.49862586,-0.8102134799599554\n2001-07-27,82.48917915,-0.5077782017320018\n2001-07-28,82.6599642,0.2581129784953049\n2001-07-31,82.536998964,0.9510747835410527\n2001-08-01,82.974208692,1.7976015589456011\n2001-08-02,83.315778792,2.7809272930776032\n2001-08-03,83.602697676,3.7770876449613695\n2001-08-04,83.254296174,4.070952088174124\n2001-08-07,82.28423709,2.999987018055485\n2001-08-08,82.543830366,1.828564972057535\n2001-08-09,81.05458473,-0.2560717702616273\n2001-08-10,81.116067348,-2.084444553026252\n2001-08-11,81.594265488,-2.9210708871491633\n2001-08-14,81.628422498,-3.134773930273205\n2001-08-15,81.368829222,-3.1707575284075844\n2001-08-16,80.801822856,-3.390387720749608\n2001-08-17,81.034090524,-3.1471537016163893\n2001-08-18,79.681472928,-3.6899520505987766\n2001-08-21,80.309961912,-3.456582038382237\n2001-08-22,79.333071426,-3.6396256724132527\n2001-08-23,79.96156041,-3.1517025027072947\n2001-08-24,79.72246134,-2.612911737326236\n2001-08-25,81.2936838,-0.5406430157418285\n2001-08-28,80.945282298,1.305826818297085\n2001-08-29,79.681472928,1.7256931602087349\n2001-08-30,78.83437908,1.0904125336348187\n2001-08-31,77.386121856,-0.5950657082524771\n2001-09-01,77.823331584,-1.7872950976612216\n2001-09-05,77.63888373,-2.7119905729477836\n2001-09-06,77.63888373,-3.2930619581345155\n2001-09-07,75.89687622,-4.4640123817146105\n2001-09-08,74.551090026,-5.789892244148881\n2001-09-11,75.029288166,-6.030855821495621\n2001-09-18,71.25152286,-6.819325404038796\n2001-09-19,70.97826678,-7.4087897722988245\n2001-09-20,69.693963204,-7.895551242811017\n2001-09-21,67.603554192,-8.341439426153784\n2001-09-22,66.4104324,-8.53402482722008\n2001-09-25,68.89953792,-6.250046159182229\n2001-09-26,69.5303856,-3.0631598296799645\n2001-09-27,69.256104,-0.29245083662947735\n2001-09-28,69.9760932,2.37300039574734\n2001-09-29,71.484642,5.324092293444885\n2001-10-02,71.313216,7.430986246259074\n2001-10-03,72.25948752,9.113577025399323\n2001-10-04,73.60346736,10.634191078229986\n2001-10-05,73.4388984,11.109491891033997\n2001-10-06,73.54861104,10.83485327918062\n2001-10-09,73.04804712,9.713110575017303\n2001-10-10,72.59548248,7.910794687413201\n2001-10-11,74.3303136,7.082254131297574\n2001-10-12,75.43429704,7.088896719177605\n2001-10-13,75.0503028,6.794141968715699\n2001-10-16,74.9474472,6.168851214343512\n2001-10-17,75.46858224,5.751848295851907\n2001-10-18,73.9874616,4.277973251002855\n2001-10-19,73.51432584,2.385151907048467\n2001-10-20,73.7474652,0.8241284137182845\n2001-10-23,74.92001904,0.35753787995396635\n2001-10-24,74.6045952,0.0770954220746205\n2001-10-25,74.58402408,-0.029009779625624788\n2001-10-26,75.64000824,0.7080066105102034\n2001-10-27,75.95543208,1.7556288526080763\n2001-10-30,74.21374392,1.3258900418365585\n2001-10-31,72.8217648,-0.39304671141758263\n2001-11-01,72.86976408,-2.139915825851176\n2001-11-02,74.51545368,-2.3357827486802307\n2001-11-03,74.78287824,-1.7637288773294983\n2001-11-06,75.82514832,-0.3941846140493652\n2001-11-07,76.99770216,1.5615920106505357\n2001-11-08,76.77141984,3.125101957390598\n2001-11-09,77.0388444,4.417683532237561\n2001-11-10,77.10055776,5.2214817838494625\n2001-11-13,76.90856064,5.209787053478763\n2001-11-14,78.43768056,5.505886732171746\n2001-11-15,78.59539248,5.668880751793793\n2001-11-16,78.5816784,5.488203585675556\n2001-11-17,78.38282424,4.819078070452591\n2001-11-20,79.21938312,4.526786769905954\n2001-11-21,78.72567624,3.679264955259981\n2001-11-22,78.2731116,2.2178950442104934\n2001-11-24,79.17138384,1.3950521139410839\n2001-11-27,79.69251888,1.1442979838890537\n2001-11-28,79.1302416,0.45846149192874464\n2001-11-29,77.71769136,-1.5797143627030152\n2001-11-30,78.49939392,-2.91544147781039\n2001-12-01,78.3759672,-3.7657958457685083\n2001-12-04,77.73140544,-4.6908617373436385\n2001-12-05,78.85596,-4.420764870537681\n2001-12-06,80.66621856,-2.676302043206256\n2001-12-07,80.4330792,-0.9583446808004084\n2001-12-08,79.8502308,-0.025693300161279353\n2001-12-11,78.48567984,-0.6029895237667802\n2001-12-12,78.30053976,-1.7100875876340709\n2001-12-13,78.36911016,-2.647151836085719\n2001-12-14,77.04570144,-4.292358505992716\n2001-12-15,77.4159816,-5.446958086725466\n2001-12-18,78.16339896,-5.435736591065286\n2001-12-19,78.80796072,-4.291079325322521\n2001-12-20,79.198812,-2.502360928091825\n2001-12-21,78.64339176,-1.2256921451648992\n2001-12-22,78.89301693,-0.1460122882399162\n2001-12-25,78.968703585,0.6966897831650698\n2001-12-27,79.298972625,1.5424562192314966\n2001-12-28,79.766853765,2.4143701139375793\n2001-12-29,79.959510705,3.080936418194817\n2002-01-01,79.051270845,2.38131950620037\n2002-01-03,79.532913195,1.7898781745619843\n2002-01-04,80.33794398,1.9844243886225001\n2002-01-05,80.785183305,2.5973417323087773\n2002-01-08,80.29666035,2.5142410851363834\n2002-01-09,80.06271978,1.8651144300397107\n2002-01-10,79.60859985,0.6125666868310802\n2002-01-11,79.78749558,-0.356678550213374\n2002-01-12,78.968703585,-1.863326820256674\n2002-01-15,78.52146426,-3.6528757292799554\n2002-01-16,79.04439024,-4.471882483384178\n2002-01-17,77.785239525,-5.773636533488222\n2002-01-18,78.528344865,-5.855251483847034\n2002-01-19,77.80588134,-5.901307608781956\n2002-01-23,77.234791125,-6.105500305322572\n2002-01-24,77.84716497,-5.429175615037195\n2002-01-25,78.12238917,-4.101394560612434\n2002-01-26,78.156792195,-2.699410570565675\n2002-01-29,78.184314615,-1.4927472541970346\n2002-01-30,75.87931194,-2.3181574323836003\n2002-01-31,76.794432405,-2.5716711737451945\n2002-02-01,77.91597102,-1.4590219262536763\n2002-02-02,77.4756123,-0.5065753697556943\n2002-02-05,75.48023685,-1.1433045712707823\n2002-02-06,75.184370835,-2.229640057129245\n2002-02-07,74.79217635,-3.3085048254877663\n2002-02-08,74.57199699,-4.105298558034363\n2002-02-09,75.666013185,-3.3401526595052005\n2002-02-12,76.780671195,-1.3552410688375645\n2002-02-13,76.450402155,0.34642531032228874\n2002-02-14,77.24167173,2.3457222176037433\n2002-02-15,77.04901479,3.872382439772821\n2002-02-16,76.257745215,4.1533200041307055\n2002-02-20,74.81969877,2.8641784665603467\n2002-02-21,75.90683436,2.1154484289983557\n2002-02-22,74.7233703,0.7454288989580817\n2002-02-23,75.253176885,-0.15150212236469685\n2002-02-26,76.71874575,0.41435864688020274\n2002-02-27,76.62241728,1.2244153734535388\n2002-02-28,76.753148775,2.0826874577982792\n2002-03-01,76.505446995,2.5961422489663875\n2002-03-02,78.20495643,4.028633477893841\n2002-03-05,79.766853765,6.044396007804792\n2002-03-06,79.271450205,7.166127805318304\n2002-03-07,80.372347005,7.994161778578956\n2002-03-08,80.042077965,7.910130379930749\n2002-03-09,80.427391845,7.520985520497732\n2002-03-12,80.73701907,7.0069486432361\n2002-03-13,80.57188455,6.109532893777576\n2002-03-14,79.74621195,4.1656465347649245\n2002-03-15,79.71868953,2.1557779327438453\n2002-03-16,80.588825601,1.1386492294007269\n2002-03-19,80.568124644,0.5706479098420729\n2002-03-20,80.975243465,0.5646184727580703\n2002-03-21,79.650382217,-0.6487422880600207\n2002-03-22,79.76768764,-1.7996284470991242\n2002-03-23,79.415771371,-2.902783719142789\n2002-03-26,78.270318417,-4.611995588753523\n2002-03-27,78.718839152,-5.597931589660895\n2002-03-28,79.125957973,-5.6413656818186055\n2002-03-29,79.291565629,-5.014382317785156\n2002-04-02,79.236363077,-4.146343291865016\n2002-04-03,78.615334367,-3.7493187427133705\n2002-04-04,77.794196406,-4.18252865189514\n2002-04-05,77.897701191,-4.471280111013243\n2002-04-06,77.649289707,-4.714875094979469\n2002-04-09,77.842498639,-4.584687993849208\n2002-04-10,77.318074395,-4.749035988506243\n2002-04-11,78.215115865,-3.688909802120257\n2002-04-12,76.400331968,-3.806838941121377\n2002-04-13,76.821251427,-3.5678220970641377\n2002-04-16,76.338229097,-3.4736661321259987\n2002-04-17,78.056408528,-1.6897319394830888\n2002-04-18,78.008106295,0.20591440785802462\n2002-04-19,77.807997044,1.5109008782773827\n2002-04-20,77.870099915,2.3783240729877306\n2002-04-23,76.690145366,1.7949381093919072\n2002-04-24,76.165721122,0.5455531472375341\n2002-04-25,75.620595921,-1.1278272166715695\n2002-04-26,75.510190817,-2.6639181718670883\n2002-04-27,74.488943605,-4.515017496679995\n2002-04-30,73.778210748,-6.225473434977182\n2002-05-01,74.509644562,-6.323453835894085\n2002-05-02,75.185875824,-4.867517585861343\n2002-05-03,75.054769763,-3.0764591044500094\n2002-05-04,74.295734673,-1.9654242896658758\n2002-05-07,72.881169278,-2.0303389515380843\n2002-05-08,72.612056837,-2.4988891110617217\n2002-05-09,75.323882204,-0.27816008830220085\n2002-05-10,74.281934035,1.5273027561537802\n2002-05-11,73.129580762,2.0035296355115833\n2002-05-14,74.399239458,2.8696820293281746\n2002-05-15,75.965611871,4.645237741041406\n2002-05-16,75.592994645,5.964119383194493\n2002-05-17,76.145020165,6.992052022826456\n2002-05-18,76.669444409,7.662420957002105\n2002-05-21,75.655097516,6.92830680974226\n2002-05-22,74.854660512,5.286318797119094\n2002-05-23,75.247978695,3.8230079627211637\n2002-05-24,76.013914104,3.0030013107610856\n2002-05-25,75.109972315,1.7875621642530461\n2002-05-29,74.45444201,0.3001370930772467\n2002-05-30,74.005921275,-1.2102084727424298\n2002-05-31,73.840313619,-2.4054174881088812\n2002-06-01,73.992120637,-2.9329819700740245\n2002-06-04,71.97032717,-4.212865784057982\n2002-06-05,72.046230679,-5.251184528627839\n2002-06-06,72.79836545,-5.10324518935397\n2002-06-07,71.363099098,-5.158321012458721\n2002-06-08,71.252693994,-5.094736446494842\n2002-06-11,71.459703564,-4.609076494423348\n2002-06-12,70.307350291,-4.540965171639904\n2002-06-13,70.824874216,-3.9120385839307943\n2002-06-14,70.03823785,-3.4710438387502904\n2002-06-15,69.893331151,-3.195102227108869\n2002-06-18,71.894423661,-1.1013825866595965\n2002-06-19,71.928925256,1.1962227235269651\n2002-06-20,70.755871026,2.253013682399242\n2002-06-21,69.83122828,2.1110938237646337\n2002-06-22,68.683837768,1.0255234974762502\n2002-06-25,69.030061368,0.11760630068737044\n2002-06-26,67.79058088,-1.1452335333077954\n2002-06-27,67.596695664,-2.3682554367895534\n2002-06-28,68.86387404,-2.1578668517912547\n2002-06-29,68.7253846,-1.462848776962467\n2002-07-02,67.222774176,-1.3493143177037226\n2002-07-03,65.796332944,-1.9050762636858778\n2002-07-04,66.260272568,-2.019970498194894\n2002-07-06,68.773855904,-0.009967047908190807\n2002-07-09,67.880599016,1.7354666429883778\n2002-07-10,66.204876792,2.1515051000315637\n2002-07-11,63.905952088,1.1125366653568065\n2002-07-12,64.50145668,0.3131014827165828\n2002-07-13,64.023668112,-0.3694570620660471\n2002-07-16,63.77438712,-0.9890855480794869\n2002-07-17,62.721867376,-1.919606040054454\n2002-07-18,63.0126952,-2.521488392349063\n2002-07-19,61.163861176,-3.2870530619169998\n2002-07-20,58.71952256,-4.35219669129139\n2002-07-23,56.926084312,-5.4591626205252375\n2002-07-24,55.395776,-6.471654770570542\n2002-07-25,58.6849002,-4.824812690875234\n2002-07-26,58.30405424,-2.6733364198620713\n2002-07-27,59.27348032,-0.14390526701816242\n2002-07-30,62.479510856,3.5611014826810745\n2002-07-31,62.80496104,6.8966795589981515\n2002-08-01,63.275825136,9.382795558717362\n2002-08-02,61.378519808,9.914380077860535\n2002-08-03,60.007474352,8.771583579558907\n2002-08-06,57.978604056,6.198731733686039\n2002-08-07,59.82743808,4.423114400038074\n2002-08-08,61.03922068,3.5630156384686984\n2002-08-09,62.998846256,3.7626651781959026\n2002-08-10,63.192731472,4.272026465023309\n2002-08-13,62.80496104,4.552711519897102\n2002-08-14,61.454689,4.1064822391997\n2002-08-15,63.989045752,4.492880573847685\n2002-08-16,64.67456848,5.100730476765797\n2002-08-17,64.549927984,5.259987240627787\n2002-08-20,66.142556544,5.607813159024474\n2002-08-21,65.276997544,5.267091463811802\n2002-08-22,66.1287076,4.9906614150464605\n2002-08-23,67.001191072,4.98408331067278\n2002-08-24,65.450109344,4.049443698720125\n2002-08-27,65.976369216,3.024209397647688\n2002-08-28,65.02079208,1.5862088437641049\n2002-08-29,63.91287656,-0.25434974110420683\n2002-08-30,63.91287656,-1.8157064495445\n2002-08-31,63.77438712,-2.9149758677644613\n2002-09-04,61.080767512,-4.799913621652777\n2002-09-05,62.1471362,-5.691448107800632\n2002-09-06,61.260803784,-6.187434699705307\n2002-09-07,62.223305392,-5.679602791710657\n2002-09-10,62.87420576,-4.363770485486725\n2002-09-11,63.39354116,-2.621701831198976\n2002-09-12,63.3589188,-1.0567132895802729\n2002-09-13,61.807837072,-0.6482747945646139\n2002-09-14,62.001722288,-0.4828604248514523\n2002-09-17,62.133287256,-0.42356448882355124\n2002-09-18,60.914580184,-1.0862055231747973\n2002-09-19,60.582205528,-2.034427308022927\n2002-09-20,58.75414492,-3.653975511832499\n2002-09-21,58.884907428,-4.870561554384686\n2002-09-24,58.140673422,-5.79710976874761\n2002-09-25,57.13908747,-6.561628263464634\n2002-09-26,58.502357238,-5.775511422377406\n2002-09-27,59.726517846,-3.5999677826567833\n2002-09-28,57.62596953,-2.2438964350567048\n2002-10-01,56.75653728,-1.6525035586508139\n2002-10-02,59.121393,0.1651707109462066\n2002-10-03,57.76507869,1.3197243274793564\n2002-10-04,57.06953289,1.6757201641177986\n2002-10-05,55.914926862,1.1554714084713709\n2002-10-08,54.822919956,-0.061462307544069006\n2002-10-09,55.720174038,-0.6452637273184791\n2002-10-10,54.2525724,-1.3343250848506898\n2002-10-11,56.102724228,-0.7693252933506045\n2002-10-12,58.35629262,1.1241244634352086\n2002-10-15,58.752753726,3.2477607197997926\n2002-10-16,61.500159636,6.04091319942161\n2002-10-17,60.074290746,7.571793048086377\n2002-10-18,61.333228644,8.587767712846237\n2002-10-19,61.66013517,8.959057261408894\n2002-10-22,62.800830282,9.106295972849992\n2002-10-23,62.126150856,8.303603968957717\n2002-10-24,62.578255626,7.194854147069222\n2002-10-25,61.611446964,5.445742650840366\n2002-10-26,62.626943832,4.113360449015865\n2002-10-29,62.195705436,2.8844630993582285\n2002-10-30,61.62535788,1.5025067428220567\n2002-10-31,62.21657181,0.628223966478707\n2002-11-01,61.806199788,-0.16620128862135175\n2002-11-02,62.967761274,-0.11938947209150541\n2002-11-05,63.39899967,0.39193743134318026\n2002-11-06,63.969347226,1.2258809716414092\n2002-11-07,64.525783866,2.1691432094611116\n2002-11-08,62.995583106,1.7901297315870153\n2002-11-09,62.508701046,0.7248467787375432\n2002-11-12,61.24280769,-1.1607537846152027\n2002-11-13,61.72968975,-2.5621195988417043\n2002-11-14,61.681001544,-3.5240278039714923\n2002-11-15,63.204246846,-3.115798968256719\n2002-11-16,63.558975204,-2.061279324682353\n2002-11-19,62.9468949,-1.347135131788093\n2002-11-20,62.759097534,-0.8434740355397281\n2002-11-21,63.948480852,0.26588173610481647\n2002-11-22,65.31175062,2.006134123597647\n2002-11-23,65.116997796,3.228415659793768\n2002-11-26,65.24219604,3.9227426563481416\n2002-11-27,63.88588173,2.9665846375920495\n2002-11-28,65.62474623,2.601381001218961\n2002-11-30,65.45085978,2.2846668755234987\n2002-12-03,65.304795162,1.8051738348714395\n2002-12-04,64.37276379,0.48296365677637\n2002-12-05,64.247565546,-0.9259569000206582\n2002-12-06,63.405955128,-2.605482642548516\n2002-12-07,63.858059898,-3.5262195571647013\n2002-12-10,62.383502802,-4.88643383599878\n2002-12-11,63.239024136,-5.335112257991661\n2002-12-12,63.322489632,-5.114128421037094\n2002-12-13,63.12078135,-4.655193877618714\n2002-12-14,62.2513491,-4.618604965662264\n2002-12-17,63.767638944,-3.3625945869643274\n2002-12-18,63.245979594,-2.261896361007146\n2002-12-19,62.348725512,-2.017616737001916\n2002-12-20,61.959219864,-2.235011127028656\n2002-12-21,62.690341261,-1.950802983307014\n2002-12-24,62.858093317,-1.3848084680231807\n2002-12-25,62.522589205,-1.0605041545073135\n2002-12-27,62.229023107,-1.0672545175353747\n2002-12-28,61.285417792,-1.887469527365326\n2002-12-31,61.571994221,-2.344845311618542\n2003-01-01,61.634901242,-2.411268667392747\n2003-01-03,63.696853597,-0.5097526996781667\n2003-01-04,63.696853597,1.5193519506541904\n2003-01-07,65.094787397,4.064509272450124\n2003-01-08,64.696376264,5.737838161285175\n2003-01-09,63.74578128,5.771191565988985\n2003-01-10,65.0039217,5.950608918827726\n2003-01-11,64.982952693,5.792794556632309\n2003-01-14,64.920045672,5.1889579820500344\n2003-01-15,65.311467136,4.529911597259719\n2003-01-16,64.388830828,2.9581820523128712\n2003-01-17,64.186130427,1.1741121202011229\n2003-01-18,63.242525112,-1.048401667089422\n2003-01-22,62.229023107,-3.5915917337310646\n2003-01-23,61.537045876,-6.074109409443942\n2003-01-24,62.249992114,-7.0664905018815105\n2003-01-25,60.341812477,-8.276303873673072\n2003-01-28,59.433155507,-9.385952702790725\n2003-01-29,60.195029428,-9.063623487694883\n2003-01-30,60.656347582,-7.602716883882174\n2003-01-31,59.27239312,-6.518023052054303\n2003-02-01,59.999318696,-4.885423874897519\n2003-02-04,60.299874463,-3.039392717797476\n2003-02-05,59.510041866,-1.9283138686982966\n2003-02-06,59.160558416,-1.3410071494831257\n2003-02-07,58.832043973,-1.2297599387765032\n2003-02-08,58.216953101,-1.6835605252140482\n2003-02-11,58.671281586,-1.6984191684284866\n2003-02-12,58.161035749,-1.7932151383158583\n2003-02-13,57.469058518,-2.2660061647469973\n2003-02-14,57.38518249,-2.6920306245528565\n2003-02-15,58.629343572,-1.5078600886445983\n2003-02-19,59.796618295,1.0072514507796129\n2003-02-20,59.363258817,3.0243104123792364\n2003-02-21,58.776126621,3.9355345819485663\n2003-02-22,59.649835246,4.9161860806622855\n2003-02-25,58.454601847,4.711712219576981\n2003-02-26,58.936889008,4.416614167694384\n2003-02-27,58.147056411,3.3700212347727003\n2003-02-28,58.832043973,2.6576070723840033\n2003-03-01,59.146579078,2.3505046599169717\n2003-03-04,58.664291917,1.876905673845073\n2003-03-05,57.825531637,0.8552728863286418\n2003-03-06,58.36373615,0.3546837493231365\n2003-03-07,57.80456263,-0.2174076562403613\n2003-03-08,58.272870453,-0.26178905452091783\n2003-03-11,56.777081287,-1.1102916860029666\n2003-03-12,56.301783795,-2.2940938476380595\n2003-03-13,56.595349893,-2.9188007788791026\n2003-03-14,58.559446882,-1.3854148528902286\n2003-03-15,58.64332291,0.5886386970932378\n2003-03-18,60.691295927,3.558800759490161\n2003-03-19,60.942924011,6.235484438989381\n2003-03-20,61.502097531,8.34308313620415\n2003-03-21,61.599952897,9.641616022870409\n2003-03-22,62.978257692,10.724864724775756\n2003-03-25,60.760614564,9.12920312817596\n2003-03-26,61.525561086,7.022769451905042\n2003-03-27,61.19572176,4.695197033919854\n2003-03-28,61.12554318,2.51225195260141\n2003-03-29,60.767632422,0.5126538705811186\n2003-04-01,59.637757284,-1.825857235005735\n2003-04-02,60.402703806,-3.076147305129389\n2003-04-03,62.030846862,-2.5496963733190015\n2003-04-04,61.672936104,-1.638166983149702\n2003-04-05,61.841364696,-0.6801741305733771\n2003-04-08,61.89750756,0.17719359629951725\n2003-04-09,61.834346838,0.7704719254531156\n2003-04-10,60.957114588,0.3508344802272205\n2003-04-11,61.37116821,0.02401790136358528\n2003-04-12,61.174668186,-0.5106669742273695\n2003-04-15,62.35366833,-0.1492632527609885\n2003-04-16,62.753686236,0.7182323204009506\n2003-04-17,61.918561134,0.712439355504273\n2003-04-18,62.922114828,1.1604791990950147\n2003-04-22,62.8098291,1.5319617831008898\n2003-04-23,64.220418558,2.660938589429634\n2003-04-24,64.70465076,3.8734461234123927\n2003-04-25,64.157257836,4.094636609672676\n2003-04-26,63.26598987,2.8926678514819315\n2003-04-29,64.473061446,2.2087966461980812\n2003-04-30,64.66956147,1.8988220381966059\n2003-05-01,64.45902573,1.4043257764769592\n2003-05-02,64.508150736,0.9336071715586485\n2003-05-03,65.47661514,1.1195991630295765\n2003-05-06,65.23099011,1.1947326476672515\n2003-05-07,65.820490182,1.644334362373094\n2003-05-08,65.497668714,1.6884983086212486\n2003-05-09,64.802900772,0.6701583881574393\n2003-05-10,65.771365176,0.22145953926154505\n2003-05-13,66.59947242,0.5428771895064841\n2003-05-14,66.417008112,0.7597616103313811\n2003-05-15,66.220508088,0.6059838620722076\n2003-05-16,66.760883154,0.7631847961422409\n2003-05-17,66.571400988,0.7169032169354921\n2003-05-20,64.922204358,-1.1566818687660998\n2003-05-21,64.88009721,-3.1501518232470076\n2003-05-22,65.111686524,-4.516698394357249\n2003-05-23,65.743293744,-4.7092720789066576\n2003-05-24,65.771365176,-4.27788314494817\n2003-05-28,67.104758196,-2.5268033093117026\n2003-05-29,67.252133214,-0.5392556424751689\n2003-05-30,66.929311746,0.8001580744343215\n2003-05-31,68.024097594,2.505619311981441\n2003-06-03,68.192526186,3.876021156976975\n2003-06-04,68.571490518,4.848649801962743\n2003-06-05,69.575044212,5.793362718136848\n2003-06-06,69.869794248,6.419034119154091\n2003-06-07,69.631187076,6.1566633171429075\n2003-06-10,68.852204838,4.403314271736846\n2003-06-11,69.504865632,2.891995825444681\n2003-06-12,70.410169314,2.1474214904265807\n2003-06-13,70.543508616,1.782636778568559\n2003-06-14,69.785579952,0.5064129557563888\n2003-06-17,71.343544428,0.1446678231441041\n2003-06-18,71.357580144,0.20035691609902528\n2003-06-19,71.259330132,0.31497340568400034\n2003-06-20,70.192615716,-0.8806950552404231\n2003-06-21,70.256009775,-2.200194645462034\n2003-06-24,69.277003724,-4.31926881233764\n2003-06-25,69.481256785,-5.853278276656496\n2003-06-26,68.88258402,-7.257563445303539\n2003-06-27,69.650293801,-7.434298868970487\n2003-06-28,68.924843274,-7.620756944410928\n2003-07-01,68.805108721,-7.5195015670935135\n2003-07-02,69.417867904,-6.380717655870043\n2003-07-03,70.171491267,-4.3074315895905855\n2003-07-04,69.65733701,-2.770434109730296\n2003-07-08,70.960330675,-0.6616215093356743\n2003-07-09,71.150497318,1.3061671973827131\n2003-07-10,70.819466495,2.308448964072859\n2003-07-11,69.875676489,1.7492295922385352\n2003-07-12,70.530694926,1.2669878895965212\n2003-07-15,70.939201048,1.0887214944944716\n2003-07-16,70.699731942,0.6874561267526573\n2003-07-17,70.263052984,-0.17263023488174412\n2003-07-18,69.382651859,-1.8971071716155095\n2003-07-19,70.136275222,-2.666838785107103\n2003-07-22,69.192485216,-3.6680616879987156\n2003-07-23,69.812287608,-3.7755438210494248\n2003-07-24,69.889762907,-3.455874115360544\n2003-07-25,69.37560865,-3.4335512232378704\n2003-07-26,70.594083807,-2.2254230825925276\n2003-07-29,70.460262836,-0.9252402152040275\n2003-07-30,69.953151788,-0.3259442967227031\n2003-07-31,69.805244399,-0.2619356230946508\n2003-08-01,70.016540669,-0.12279980189261863\n2003-08-02,69.291090142,-0.798718151543568\n2003-08-05,69.530559248,-1.2916693992082173\n2003-08-06,68.213479165,-2.75757413341163\n2003-08-07,68.38955939,-3.9589010926138357\n2003-08-08,68.938929692,-3.9992324799604333\n2003-08-09,69.178398798,-3.2273873888743694\n2003-08-12,69.382651859,-2.0267640166009855\n2003-08-13,70.108102386,-0.11396098433122859\n2003-08-14,69.650293801,1.1513200129372905\n2003-08-15,70.108102386,2.3774581881504133\n2003-08-16,70.108102386,3.279496306190005\n2003-08-19,70.78425045,4.346604627909002\n2003-08-20,71.009633138,5.189992614080822\n2003-08-21,70.78425045,5.24031292500748\n2003-08-22,71.073022019,5.122887457426607\n2003-08-23,70.270096193,3.680443146899705\n2003-08-26,70.305312238,2.1115069338788928\n2003-08-27,70.558867762,1.0276900548329309\n2003-08-28,70.601127016,0.32325722353889574\n2003-08-29,71.030762765,0.35641148898051256\n2003-08-30,71.41813926,1.0581906497608315\n2003-09-03,72.383058893,2.7392893192464243\n2003-09-04,72.678873671,4.524931432613236\n2003-09-05,72.847910687,6.010046656079616\n2003-09-06,72.312626803,5.870935763415922\n2003-09-09,73.10850942,5.700202819817591\n2003-09-10,72.495750237,4.326736551112958\n2003-09-11,71.622392321,1.484830882561674\n2003-09-12,72.016812025,-0.8835130211392226\n2003-09-13,72.206978668,-2.417742320498867\n2003-09-16,71.925250308,-3.6245236912556535\n2003-09-17,72.932429195,-3.2818739483507073\n2003-09-18,72.700003298,-2.6525264906740844\n2003-09-19,73.664922931,-1.1406395410775687\n2003-09-20,73.431606114,0.13912300277177536\n2003-09-23,72.462982001,-0.13622675155442465\n2003-09-24,72.887196941,-0.4989281016947942\n2003-09-25,71.55091988,-2.2598861267857373\n2003-09-26,71.119634691,-4.393009356099817\n2003-09-27,70.716630498,-6.455780075353196\n2003-09-30,71.317601663,-7.1382223870512505\n2003-10-01,70.603506514,-7.645512305849337\n2003-10-02,72.1165398,-6.151566944497674\n2003-10-03,72.342787768,-3.861173774812656\n2003-10-04,73.007391174,-1.1421021586537208\n2003-10-07,73.332622628,1.5103714427412172\n2003-10-08,73.664924331,3.737247016810173\n2003-10-09,73.325552379,4.762542180419587\n2003-10-10,73.650783833,5.19676633787406\n2003-10-11,73.67199458,5.140820289703122\n2003-10-14,74.138631014,5.006554319354954\n2003-10-15,74.442651721,4.927351452100865\n2003-10-16,74.251754998,4.402371727882958\n2003-10-17,74.470932717,3.9170142765609626\n2003-10-18,73.693205327,2.3176561737805628\n2003-10-21,74.082069022,1.0854896872118616\n2003-10-22,74.209333504,0.29325825686199636\n2003-10-23,73.10637466,-1.6497315405922777\n2003-10-24,73.346763126,-3.1965041435408494\n2003-10-25,73.021531672,-4.541729325100832\n2003-10-28,73.134655656,-5.175036672074185\n2003-10-29,74.251754998,-4.020021161061145\n2003-10-30,74.414370725,-2.205747454240729\n2003-10-31,74.301246741,-0.6969109259635218\n2003-11-01,74.534564958,0.7123191583431705\n2003-11-04,75.170887368,2.464798584725024\n2003-11-05,74.789093922,3.178325411394752\n2003-11-06,74.683040187,3.109138770821275\n2003-11-07,75.128465874,3.078823957019509\n2003-11-08,74.810304669,2.327678498258578\n2003-11-11,74.364878982,0.7779913616244301\n2003-11-12,74.294176492,-0.7856680026365694\n2003-11-13,75.213308862,-0.9281747301954724\n2003-11-14,75.192098115,-0.6192462105855299\n2003-11-15,74.619407946,-1.0431709346895985\n2003-11-18,74.138631014,-2.2050785343371757\n2003-11-19,73.466957359,-4.071633440258772\n2003-11-20,74.082069022,-4.711194636673397\n2003-11-21,73.45988711,-5.388286389013096\n2003-11-22,73.558870596,-5.660503977823218\n2003-11-25,74.746672428,-4.207327647848494\n2003-11-26,74.951709649,-2.113389101452867\n2003-11-27,75.22744936,0.19378668000880594\n2003-11-29,75.29815185,2.181661694927051\n2003-12-02,76.054668493,4.290767219012473\n2003-12-03,75.842561023,5.3889139711098295\n2003-12-04,75.729437039,5.563553226667331\n2003-12-05,76.132441232,5.523997470667844\n2003-12-06,75.517329569,4.119712487151105\n2003-12-09,76.019317248,3.0039077455712047\n2003-12-10,75.382994838,1.1850341216423885\n2003-12-11,75.326432846,-0.5611581331097639\n2003-12-12,76.245565216,-0.8932932312352193\n2003-12-13,76.450602437,-0.4332903576019973\n2003-12-16,76.019317248,-0.4345250736591666\n2003-12-17,76.478883433,-0.05364594118270816\n2003-12-18,76.599077666,0.5641186127476487\n2003-12-19,77.48992904,1.8862610292933155\n2003-12-20,77.458668472,3.0495670372932295\n2003-12-23,77.757023578,3.99612134732147\n2003-12-24,77.991445447,4.640782582723311\n2003-12-25,77.884890052,4.698043397691784\n2003-12-27,78.005652833,4.5439980571712795\n2003-12-30,78.957547695,4.911597187808475\n2003-12-31,78.971755081,5.149023400889604\n2004-01-01,78.957547695,5.031972057326485\n2004-01-03,78.8509923,4.429339371485554\n2004-01-06,79.824198241,4.413827882270709\n2004-01-07,80.008894259,4.547287542395097\n2004-01-08,80.20069397,4.672767183262877\n2004-01-09,80.499049076,4.761671756670253\n2004-01-10,79.923649943,3.260011175402667\n2004-01-13,80.349871523,1.884688580440809\n2004-01-14,79.895235171,-0.1577652830542462\n2004-01-15,80.491945383,-1.4257973820278238\n2004-01-16,80.648226629,-2.067153538520344\n2004-01-17,81.159692525,-1.8866165623698237\n2004-01-21,81.131277753,-1.453204005051532\n2004-01-22,81.735091658,-0.46977397296231516\n2004-01-23,81.500669789,0.07312476227686204\n2004-01-24,81.237833148,-0.2326332123629129\n2004-01-27,82.26076494,0.11716190999432285\n2004-01-28,81.47935871,-0.954858968942375\n2004-01-29,80.435115839,-3.7397183255918947\n2004-01-30,80.804507875,-5.949296905392856\n2004-01-31,80.584293392,-7.586576688129028\n2004-02-03,80.861337419,-8.123311413775824\n2004-02-04,80.946581735,-7.752870271873107\n2004-02-05,80.293041979,-7.797773186129554\n2004-02-06,80.456426918,-7.444457748173889\n2004-02-07,81.450943938,-5.528757531545516\n2004-02-10,81.223625762,-3.6577726243217725\n2004-02-11,81.62143257,-1.769916191777952\n2004-02-12,82.537808967,0.550322406496278\n2004-02-13,82.168416931,1.862154699001941\n2004-02-14,81.777713816,1.9563714586728906\n2004-02-18,82.502290502,2.2803701385741206\n2004-02-19,82.161313238,1.9243986021467805\n2004-02-20,81.848750746,0.8393704936311437\n2004-02-21,81.6924695,-0.4603876990614353\n2004-02-24,81.372803315,-2.006812365509006\n2004-02-25,81.301766385,-3.320055357990313\n2004-02-26,81.628536263,-3.6465765966516983\n2004-02-27,81.720884272,-3.3249194053375035\n2004-02-28,81.749299044,-2.741833396405184\n2004-03-02,82.452564651,-1.1520066106478808\n2004-03-03,82.040550457,-0.23947310046429493\n2004-03-04,82.18972801,0.486125956522244\n2004-03-05,82.438357265,1.2918443591977748\n2004-03-06,82.608845897,2.0581176222321957\n2004-03-09,81.884269211,1.2112232278595414\n2004-03-10,81.450943938,-0.6543062978008649\n2004-03-11,80.257523514,-3.8467133278186694\n2004-03-12,79.099621555,-7.6278736879990205\n2004-03-13,80.051516417,-9.107461276420345\n2004-03-16,78.872303379,-10.195448951229487\n2004-03-17,79.369561889,-9.930643976391707\n2004-03-18,80.2717309,-7.871857956739163\n2004-03-19,80.207797663,-5.321437719041143\n2004-03-20,79.334545528,-3.6318709648370913\n2004-03-23,78.229607568,-3.141180748942787\n2004-03-24,78.16544988,-3.1049624481990037\n2004-03-25,77.994362712,-3.3930890310254753\n2004-03-26,79.206230152,-2.1770016010582864\n2004-03-27,79.249001944,-0.7791496953645805\n2004-03-30,80.189981368,1.3161825990436924\n2004-03-31,80.532155704,3.524891316240584\n2004-04-01,80.467998016,5.199650895671013\n2004-04-02,80.902844568,6.620614479299007\n2004-04-03,81.580064608,7.955972462716915\n2004-04-06,82.214512856,9.097985981553741\n2004-04-07,82.036297056,9.225395966144795\n2004-04-08,81.615707768,8.133947874682825\n2004-04-09,81.430363336,6.336860878270741\n2004-04-13,81.893724416,4.955099830499577\n2004-04-14,80.774529192,2.501200828912914\n2004-04-15,80.688985608,0.05070678339031076\n2004-04-16,80.674728344,-1.8988804507306511\n2004-04-17,81.066803104,-2.7100886843521366\n2004-04-20,81.187989848,-2.674329782806012\n2004-04-21,79.940479248,-3.6552740930747376\n2004-04-22,80.418097592,-3.973059272543651\n2004-04-23,81.580064608,-2.6631039734127384\n2004-04-24,81.580064608,-0.9677532882356346\n2004-04-27,81.202247112,0.014621878122589749\n2004-04-28,81.423234704,0.7713504689728197\n2004-04-29,80.254139056,-0.051687897527465054\n2004-04-30,79.726620288,-1.6237593366094885\n2004-05-01,79.220487416,-3.4118861584881373\n2004-05-04,79.940479248,-4.027936471735018\n2004-05-05,80.097309152,-3.925640688228306\n2004-05-06,80.254139056,-3.243383298892347\n2004-05-07,79.73374892,-2.871684772664956\n2004-05-08,78.62881096,-3.4752570886807774\n2004-05-11,77.794761016,-4.590678485780273\n2004-05-12,78.422080632,-4.670814900160735\n2004-05-13,78.62881096,-4.075285346605909\n2004-05-14,78.52188148,-3.4657853061244666\n2004-05-15,78.429209264,-2.937119804751255\n2004-05-18,77.59515932,-3.0876068612620458\n2004-05-19,78.20109304,-2.36810926811107\n2004-05-20,77.994362712,-1.5895969151577418\n2004-05-21,78.072777664,-0.8382331510666958\n2004-05-22,78.365051576,0.0821613760564972\n2004-05-25,78.479109688,1.0002778987901166\n2004-05-26,79.783649344,3.314946291750239\n2004-05-27,79.904836088,5.564811106263548\n2004-05-28,80.353939904,7.584046439152743\n2004-05-29,80.346811272,8.73612580999508\n2004-06-02,80.325425376,9.035410538790835\n2004-06-03,80.639085184,8.999389689287561\n2004-06-04,80.0188942,7.4918096382949315\n2004-06-05,80.48225528,6.0818378180861075\n2004-06-08,81.72976588,5.865881176475817\n2004-06-09,81.87233852,5.991923652917706\n2004-06-10,81.102446264,4.851997733923618\n2004-06-11,81.48026376,3.832097951569068\n2004-06-15,80.688985608,1.9209676268108566\n2004-06-16,81.23076164,0.6456446641827114\n2004-06-17,81.259276168,-0.12263986813012906\n2004-06-18,81.166603952,-0.7964245962668102\n2004-06-19,81.355479666,-1.1048169517130901\n2004-06-22,81.069293826,-1.5398216099675182\n2004-06-23,81.412716834,-1.3348457163022474\n2004-06-24,82.06378962,-0.2510931902286515\n2004-06-25,81.877768824,0.6066389426942465\n2004-06-26,81.655974798,0.7560395581745922\n2004-06-29,81.334015728,0.11719780505896438\n2004-06-30,81.555809754,-0.33597008791630145\n2004-07-01,81.88492347,-0.2385186750107806\n2004-07-02,80.99059272,-1.3754968538290626\n2004-07-03,80.70440688,-3.017130201402118\n2004-07-07,80.103416616,-5.08922491471121\n2004-07-08,80.232200244,-6.386268527262388\n2004-07-09,79.573972812,-7.641777859105872\n2004-07-10,79.874467944,-7.835271824607496\n2004-07-13,79.974632988,-7.248929197697578\n2004-07-14,80.053334094,-6.120540452445255\n2004-07-15,79.767148254,-5.092745979798565\n2004-07-16,79.445189184,-4.5139928795099\n2004-07-17,79.080302238,-4.445795486572216\n2004-07-20,79.02306507,-4.502952297389896\n2004-07-21,79.59543675,-3.3210063929148887\n2004-07-22,78.550858434,-3.194411048328547\n2004-07-23,78.708260646,-3.0256250551224184\n2004-07-24,77.928404232,-3.4978844978960026\n2004-07-27,77.87832171,-3.9233560059593344\n2004-07-28,78.615250248,-2.7773058635133765\n2004-07-29,78.722569938,-1.152742245720944\n2004-07-30,79.09461153,0.8511176647729854\n2004-07-31,79.180467282,2.596679936733061\n2004-08-03,79.48811706,4.383663288895875\n2004-08-04,78.972982548,4.88511246099938\n2004-08-05,78.901436088,4.6314488492084465\n2004-08-06,77.642218392,2.5244078135447054\n2004-08-07,76.433083218,-0.8429910615461438\n2004-08-10,76.561866846,-3.6266925889684174\n2004-08-11,77.527744056,-4.052746358300112\n2004-08-12,77.334568614,-3.6889265609307174\n2004-08-13,76.44739251,-3.7084637676690306\n2004-08-14,76.604794722,-3.318631487033862\n2004-08-17,77.649373038,-1.2784909981794428\n2004-08-18,77.778156666,1.1187097477494845\n2004-08-19,78.758343168,4.113776025174246\n2004-08-20,78.422074806,5.977942940331793\n2004-08-21,79.015910424,7.376673757741457\n2004-08-24,78.858508212,7.9253038523252926\n2004-08-25,78.837044274,7.798806071896884\n2004-08-26,79.502426352,7.809250440630123\n2004-08-27,79.531044936,7.472345639646875\n2004-08-28,79.745684316,7.05242702104637\n2004-08-31,79.116075468,5.506658817481842\n2004-09-01,79.466653122,4.235664263890904\n2004-09-02,79.638364626,3.3561781200890195\n2004-09-03,80.52554073,3.5950200353338175\n2004-09-04,80.196427014,3.4722894158296853\n2004-09-08,80.711561526,3.611243814706775\n2004-09-09,80.38244781,3.2039884662464644\n2004-09-10,80.4897675,2.757848385482596\n2004-09-11,80.911891614,2.7776181017514574\n2004-09-14,81.054984534,2.9019235681771107\n2004-09-15,81.283933206,3.110421164733687\n2004-09-16,80.661479004,2.0608258413824316\n2004-09-17,80.91904626,1.1458170904972604\n2004-09-18,81.263178218,0.7897868759277031\n2004-09-21,80.839296376,-0.04612819670560242\n2004-09-22,81.356575912,-0.2949324474869073\n2004-09-23,80.199881394,-2.0165354553613\n2004-09-24,79.847843932,-4.12947879966643\n2004-09-25,79.99871713,-5.51534137372218\n2004-09-28,79.510175346,-6.709771182892858\n2004-09-29,79.99871713,-6.736036812084777\n2004-09-30,80.278910212,-5.809694164687002\n2004-10-01,80.278910212,-4.513463684383254\n2004-10-02,81.536186862,-1.7863356159007395\n2004-10-05,81.79482663,1.2141929832466474\n2004-10-06,81.780457754,3.5530901709028058\n2004-10-07,82.304921728,5.494450672538989\n2004-10-08,81.457158044,5.335504156846014\n2004-10-09,80.882403004,3.515069689375217\n2004-10-12,81.090751706,1.63661960618402\n2004-10-13,80.846480814,-0.308328552981429\n2004-10-14,80.228619146,-2.7120325848767877\n2004-10-15,79.53172866,-5.33651666076311\n2004-10-16,79.869397246,-6.72734592048068\n2004-10-19,80.32201684,-6.541676581284143\n2004-10-20,79.546097536,-6.374801213252546\n2004-10-21,79.538913098,-5.9804544136872835\n2004-10-22,79.775999552,-5.063600334417039\n2004-10-23,78.99289581,-4.791968752594791\n2004-10-26,78.935420306,-4.612528902039273\n2004-10-27,80.03463932,-2.8522991863673397\n2004-10-28,81.162596086,0.16620065519403227\n2004-10-29,81.306284846,3.0001266904160246\n2004-10-30,81.457158044,5.267465726187645\n2004-11-02,81.536186862,6.746532386278929\n2004-11-03,81.5433713,7.413560526499957\n2004-11-04,82.455794926,8.308343021611634\n2004-11-05,83.73462489,9.573877521458996\n2004-11-06,84.12976898,10.384741405675939\n2004-11-09,84.0579246,10.34220899482122\n2004-11-10,84.0579246,9.736648717455452\n2004-11-11,84.014817972,8.693480801493614\n2004-11-12,84.769183962,7.957459026692689\n2004-11-13,85.430152258,7.534107571123656\n2004-11-16,85.510136836,6.986491001975281\n2004-11-17,84.854417408,5.004394408194315\n2004-11-18,85.31558272,3.2409138027365856\n2004-11-19,85.502931128,1.9956557401577868\n2004-11-20,84.537366256,-0.5061111616006571\n2004-11-23,84.99132586,-2.421256283603853\n2004-11-24,85.005737276,-3.676208301006511\n2004-11-25,85.416462632,-3.9478321815624184\n2004-11-27,85.416462632,-3.6468098652578504\n2004-11-30,85.121028604,-3.5416785741912804\n2004-12-01,84.861623116,-3.862987629176871\n2004-12-02,86.086593476,-2.8940776499290592\n2004-12-03,86.021742104,-1.6827501439736494\n2004-12-04,86.057770644,-0.662098658293317\n2004-12-07,85.992919272,-0.059422792843164984\n2004-12-08,85.077794356,-1.3466633843248843\n2004-12-09,85.474108296,-2.383914920334192\n2004-12-10,85.96409644,-2.4964949251724846\n2004-12-11,85.870422236,-2.4250979090687963\n2004-12-14,86.677461532,-1.5356321522535765\n2004-12-15,87.04495264,-0.18262989563282872\n2004-12-16,87.167449676,1.1760256714879063\n2004-12-17,86.97289556,1.8954441909790063\n2004-12-18,86.457428876,1.3334326612422558\n2004-12-21,86.348832206,0.16151777400878586\n2004-12-22,87.16692712,-0.1468929098307683\n2004-12-23,87.536155798,0.173394788308741\n2004-12-24,87.594074022,0.5899245357333882\n2004-12-28,87.181406676,0.15780998406246738\n2004-12-29,87.78230825,0.2356310864178539\n2004-12-30,87.796787806,0.538354561349152\n2004-12-31,87.767828694,0.8102230484114727\n2005-01-01,87.630272912,0.6242265411725327\n2005-01-04,86.920774668,-1.1440238804215497\n2005-01-05,85.965123972,-4.364921024389233\n2005-01-06,85.661053296,-7.504027099015133\n2005-01-07,85.943404638,-9.1890846601979\n2005-01-08,85.834807968,-9.948866875779565\n2005-01-11,86.109919532,-9.426821233187766\n2005-01-12,85.639333962,-8.87715150983336\n2005-01-13,86.00856264,-7.38815049338406\n2005-01-14,85.197707504,-6.560148134387049\n2005-01-15,85.733451076,-5.0002741690084775\n2005-01-19,86.566025546,-2.3897861804595664\n2005-01-20,85.71897152,-1.0905173570616\n2005-01-21,85.118069946,-1.0791749699234643\n2005-01-22,84.56060704,-1.9699142181680642\n2005-01-25,84.285495476,-3.0853712034142546\n2005-01-26,84.611285486,-3.4988211119894856\n2005-01-27,85.002233498,-2.931008841256144\n2005-01-28,85.038432388,-2.142509121352795\n2005-01-29,84.799519714,-1.6527214122347544\n2005-02-01,85.480058846,-0.17882189153293382\n2005-02-02,86.088200198,2.0717873223033436\n2005-02-03,86.399510652,4.338962882972432\n2005-02-04,86.18955709,5.6072864438238454\n2005-02-05,87.116248674,6.998282275618216\n2005-02-08,87.043850894,7.70676477365501\n2005-02-09,87.123488452,7.85300364435448\n2005-02-10,86.37055154,6.343318531960058\n2005-02-11,86.754259774,4.785697374770734\n2005-02-12,87.398600016,4.018656243026115\n2005-02-15,87.442038684,3.562851246467922\n2005-02-16,87.74610936,3.510776804899038\n2005-02-17,87.738869582,3.4268292195658105\n2005-02-18,87.087289562,2.2043632882054283\n2005-02-19,87.13072823,0.9479630568331814\n2005-02-23,85.914445526,-1.6997989390996224\n2005-02-24,86.392270874,-3.568062613954929\n2005-02-25,87.065570228,-3.9273735185529404\n2005-02-26,87.876425364,-2.7876541817207325\n2005-03-01,87.268284012,-2.113725028794512\n2005-03-02,87.81850714,-1.0107178958720269\n2005-03-03,87.811267362,0.13164767467668526\n2005-03-04,87.861945808,1.102313797120722\n2005-03-05,88.730719168,2.6371502956821473\n2005-03-08,88.889994284,3.881991107822863\n2005-03-09,88.47008716,3.8614625800419518\n2005-03-10,87.608553578,2.1228342743329733\n2005-03-11,87.74610936,0.3942341585195237\n2005-03-12,87.174166898,-1.74383650206898\n2005-03-15,87.630272912,-2.9408091541640573\n2005-03-16,87.000412226,-4.271733989846901\n2005-03-17,86.283674204,-5.964059367414947\n2005-03-18,86.450189098,-6.8707688700568355\n2005-03-19,86.353519843,-7.074547696599808\n2005-03-22,85.953768678,-7.110103892242918\n2005-03-23,85.132461739,-7.618856213010382\n2005-03-24,85.081584318,-7.901884453962822\n2005-03-25,85.139729942,-7.7050603975618515\n2005-03-29,85.299630408,-6.784952415621298\n2005-03-30,84.616419326,-6.25718648740208\n2005-03-31,85.852013836,-3.896901971025301\n2005-04-01,85.728454385,-1.4865551178389609\n2005-04-02,85.197875566,-0.049844645130221465\n2005-04-05,85.466799077,1.1969847862783354\n2005-04-06,85.830209227,2.5217143806851965\n2005-04-07,86.05552352,3.732158884833275\n2005-04-08,86.600638745,5.1453102118321254\n2005-04-09,85.83747743,5.125163115935834\n2005-04-12,85.895623054,4.445086221840427\n2005-04-13,86.317178828,4.1743053493066995\n2005-04-14,85.343239626,2.810907430318977\n2005-04-15,84.507396281,0.46832990816281495\n2005-04-16,83.061023884,-2.767879322266694\n2005-04-19,83.300874583,-5.143290969274922\n2005-04-20,83.795112387,-5.890583500813243\n2005-04-21,82.726686546,-6.42889583198739\n2005-04-22,84.303886597,-4.790826130679584\n2005-04-23,83.787844184,-3.027649698193457\n2005-04-26,84.507396281,-0.6496054241686906\n2005-04-27,83.744234966,0.8998400488384561\n2005-04-28,84.078572304,2.1576099017894848\n2005-04-29,83.14824232,2.171050653899755\n2005-04-30,84.09310871,2.533464332015626\n2005-05-03,84.551005499,3.192855107940325\n2005-05-04,84.492859875,3.4910490890365296\n2005-05-05,85.488603686,4.390562352991225\n2005-05-06,85.299630408,4.931056804475034\n2005-05-07,85.18333916,5.026079731350194\n2005-05-10,85.772063603,5.295218331487142\n2005-05-11,84.812660807,4.427596903275834\n2005-05-12,85.18333916,3.494005603714754\n2005-05-13,84.376568627,1.854483910663717\n2005-05-14,84.02042668,-0.009931377201930047\n2005-05-17,84.885342837,-0.7275390729118882\n2005-05-18,85.466799077,-0.3627129078109448\n2005-05-19,86.338983437,0.9757638425747075\n2005-05-20,86.767807414,2.613295249287276\n2005-05-21,86.600638745,3.8043232812239296\n2005-05-24,86.964048895,4.745313675363057\n2005-05-25,86.964048895,5.271797995251568\n2005-05-26,86.724198196,4.994983831688046\n2005-05-27,87.254777015,4.687791372955658\n2005-05-28,87.349263654,4.283659171677975\n2005-06-01,86.818684835,3.011746804649462\n2005-06-02,87.610918962,2.384677183655093\n2005-06-03,87.734478413,2.144526027474356\n2005-06-04,87.174826782,1.21902915163853\n2005-06-07,87.320190842,0.4216608696750299\n2005-06-08,87.269313421,-0.23196789023838704\n2005-06-09,87.109412955,-0.9584865839410668\n2005-06-10,87.574577947,-0.9708047401758861\n2005-06-11,87.371068263,-1.0245328722780158\n2005-06-14,87.574577947,-0.8527737756593226\n2005-06-15,87.814428646,-0.3061791945568615\n2005-06-16,87.988865518,0.5045558401331576\n2005-06-17,88.294130044,1.5161466662788996\n2005-06-18,88.73781888,2.76453292609407\n2005-06-21,88.6648437,3.548145784812789\n2005-06-22,88.51889334,3.5366470151342\n2005-06-23,88.569975966,3.2360572660903983\n2005-06-24,87.570216,0.8104307522541632\n2005-06-25,86.906141862,-2.7549738998712314\n2005-06-28,86.869654272,-5.864098431749362\n2005-06-29,87.701571324,-6.741834209508596\n2005-06-30,87.526430892,-6.7863859540070095\n2005-07-01,86.884249308,-7.146091788935955\n2005-07-02,87.2053401,-6.682087763975048\n2005-07-06,87.920496864,-4.787667858574409\n2005-07-07,87.198042582,-3.526450351474118\n2005-07-08,87.402373086,-2.356092226515436\n2005-07-09,88.460513196,-0.3048977328595299\n2005-07-12,89.044314636,1.9941554454172419\n2005-07-13,89.190264996,3.963801528893846\n2005-07-14,89.277835212,5.367744374529579\n2005-07-15,89.569735932,6.289206772721194\n2005-07-16,89.591628486,6.611386288637469\n2005-07-19,89.17566996,5.741542743771042\n2005-07-20,89.7594714,5.004936371040294\n2005-07-21,90.153537372,4.539856373183774\n2005-07-22,89.54054586,3.034845505244917\n2005-07-23,90.073264674,2.003731963912621\n2005-07-26,89.708388774,0.7066033088573249\n2005-07-27,89.927314314,-0.1595451787103528\n2005-07-28,90.335975322,-0.24670656841064442\n2005-07-29,90.8540991,0.44575294945848754\n2005-07-30,90.168132408,0.03160544424810752\n2005-08-02,90.16083489,-0.600017016724216\n2005-08-03,90.824909028,-0.38478824225173724\n2005-08-04,90.956264352,0.12688234298313006\n2005-08-05,90.241107588,-0.5342033346530712\n2005-08-06,89.591628486,-2.3218559872092115\n2005-08-09,89.336215356,-4.322353193869674\n2005-08-10,90.007587012,-4.961917635437601\n2005-08-11,89.847041616,-5.021442737879681\n2005-08-12,90.467330646,-4.047893514180437\n2005-08-13,89.934611832,-3.5898819935617396\n2005-08-16,90.23381007,-2.8250450455386797\n2005-08-17,89.124587334,-3.244110808054664\n2005-08-18,89.241347622,-3.6363038434413397\n2005-08-19,89.109992298,-4.02974064145166\n2005-08-20,89.226752586,-4.141654014670507\n2005-08-23,89.372702946,-3.7967472001204285\n2005-08-24,89.06620719,-3.6832114724671072\n2005-08-25,88.475108232,-4.159951460900658\n2005-08-26,88.686736254,-4.192482319590283\n2005-08-27,88.168612476,-4.450708808271578\n2005-08-30,88.73781888,-3.7177294896953725\n2005-08-31,88.431323124,-3.109467358492026\n2005-09-01,89.314322802,-1.3569558627565996\n2005-09-02,89.423785572,0.5492120152345592\n2005-09-03,89.124587334,1.717228531474241\n2005-09-07,90.30678525,3.760873932918443\n2005-09-08,90.503818236,5.6251941019137846\n2005-09-09,90.182727444,6.340155752928311\n2005-09-10,90.839504064,6.89934781846042\n2005-09-13,90.803016474,6.961002217000832\n2005-09-14,90.16083489,5.5608297167947285\n2005-09-15,89.890826724,3.4766992585917293\n2005-09-16,89.920016796,1.5502434847042466\n2005-09-17,90.65433668,0.8280450681934823\n2005-09-20,90.112022944,-0.14561409120208424\n2005-09-21,89.48176644,-1.7095973691003792\n2005-09-22,88.595010196,-3.980602422315755\n2005-09-23,88.998081216,-5.202789394796731\n2005-09-24,89.086023984,-5.457947522120811\n2005-09-27,89.020066908,-5.260813916136847\n2005-09-28,89.0420526,-4.785037713354704\n2005-09-29,89.173966752,-3.960321247403435\n2005-09-30,90.002094484,-1.7804037733868228\n2005-10-01,90.009423048,0.46750868810882906\n2005-10-04,89.906823152,2.065215535211671\n2005-10-05,88.954109832,1.5938153860013244\n2005-10-06,87.671611132,-0.7864616911396212\n2005-10-07,87.31984006,-3.5112183143636173\n2005-10-08,87.700925388,-5.083198144104188\n2005-10-11,87.041354628,-6.432612702440423\n2005-10-12,86.872797656,-7.3792618589957115\n2005-10-13,86.36712674,-8.025130747081064\n2005-10-14,86.308498228,-8.054999757850261\n2005-10-15,87.0266975,-6.224869166070334\n2005-10-18,87.261211548,-3.601931961146761\n2005-10-19,86.40376956,-2.049813935619838\n2005-10-20,87.678939696,0.5620281243183882\n2005-10-21,86.271855408,1.7270785747603767\n2005-10-22,86.491712328,2.3874146461594563\n2005-10-25,87.972082256,4.146187855089217\n2005-10-26,87.752225336,5.404112337494887\n2005-10-27,87.385797136,5.598194609229061\n2005-10-28,86.455069508,4.473249734508791\n2005-10-29,87.86948236,4.401622869622415\n2005-11-01,88.463096044,4.879595391505688\n2005-11-02,88.16262492,5.054104623903832\n2005-11-03,89.137323932,5.606559781803433\n2005-11-04,89.51840926,6.153170225007855\n2005-11-05,89.489095004,6.4179758682764145\n2005-11-08,89.730937616,6.552730873445697\n2005-11-09,89.459780748,6.062024696541378\n2005-11-10,89.5916949,5.258724279468915\n2005-11-11,90.39783694,4.995306302512084\n2005-11-12,90.61769386,4.951652407442857\n2005-11-15,90.632350988,4.773695836439671\n2005-11-16,90.258594224,3.9068455395110675\n2005-11-17,90.485779708,3.1324732503897366\n2005-11-18,91.262607492,3.112158611850873\n2005-11-19,91.673007076,3.53561569381187\n2005-11-22,92.178677992,4.193511837965033\n2005-11-23,92.611063268,4.874006809733061\n2005-11-24,92.984820032,5.498887447081316\n2005-11-26,93.14604844,5.910599387677635\n2005-11-29,92.44983486,4.781060564791758\n2005-11-30,92.427849168,3.1722616880995815\n2005-12-01,91.848892612,0.6554684492540162\n2005-12-02,93.006805724,-0.6464641464829555\n2005-12-03,92.977491468,-1.3452656306015314\n2005-12-06,92.808934496,-1.9222678825558575\n2005-12-07,92.874891572,-2.156939012769996\n2005-12-08,92.44983486,-2.7846977549281604\n2005-12-09,92.361892092,-3.314693041160936\n2005-12-10,92.640377524,-3.273936669220241\n2005-12-13,92.7063346,-2.8816950012737976\n2005-12-14,93.197348388,-1.935707636955101\n2005-12-15,93.629733664,-0.5181409179721612\n2005-12-16,93.461176692,0.4445833932260257\n2005-12-17,93.27110676,0.6845698820643804\n2005-12-20,92.666981108,-0.44373159578521637\n2005-12-21,92.659613722,-1.7718889228603345\n2005-12-22,92.917472232,-2.520925806103392\n2005-12-23,93.315311076,-2.3761514057478124\n2005-12-24,93.38161755,-1.8704006972318936\n2005-12-28,92.468061686,-2.945257331093842\n2005-12-29,92.541735546,-3.934398737258263\n2005-12-30,92.320713966,-4.831656862875249\n2005-12-31,91.76079263,-6.129200514141083\n2006-01-04,93.38161755,-4.921539217945579\n2006-01-05,93.764721622,-2.7422941854780447\n2006-01-06,93.735252078,-0.7001771438444351\n2006-01-07,94.604603626,1.7940301259103606\n2006-01-10,94.980340312,4.258045993284242\n2006-01-11,94.950870768,5.928713833297124\n2006-01-12,95.29713791,7.047592970157609\n2006-01-13,94.737216574,6.407713381164513\n2006-01-14,94.832992592,5.022403191802887\n2006-01-18,94.48672545,2.914940519964844\n2006-01-19,94.147825694,0.38315994054354974\n2006-01-20,94.575134082,-1.265571844557556\n2006-01-21,92.917472232,-4.406572538721164\n2006-01-24,93.072187338,-6.883213409998227\n2006-01-25,93.285841532,-8.0391674222791\n2006-01-26,93.175330742,-8.288469738786851\n2006-01-27,93.867865026,-6.999863208067268\n2006-01-28,94.530929766,-4.48220418945607\n2006-01-31,94.693012258,-1.7733092550937002\n2006-02-01,94.26570387,-0.13272320647382685\n2006-02-02,94.471990678,1.2008411925827076\n2006-02-03,93.646843446,0.8755463935368084\n2006-02-04,93.131126426,-0.6001282692394412\n2006-02-07,93.241637216,-2.006257936198651\n2006-02-08,92.512266002,-3.9327047681546645\n2006-02-09,93.293208918,-4.43686179626323\n2006-02-10,93.1974329,-4.300337585399937\n2006-02-11,93.433189252,-3.43781836912391\n2006-02-14,93.167963356,-2.6978741910507935\n2006-02-15,94.088886606,-0.7965715052866287\n2006-02-16,94.405684204,1.4171085989345826\n2006-02-17,95.098218488,3.832315199504862\n2006-02-18,94.950870768,5.407100174750504\n2006-02-22,94.685644872,5.685148458007532\n2006-02-23,95.356076998,5.988053581016345\n2006-02-24,95.046646786,5.50350148482508\n2006-02-25,95.208729278,4.827171473899469\n2006-02-28,95.547629034,4.30751589896451\n2006-03-01,94.494092836,2.255796088295547\n2006-03-02,95.326607454,1.0020560454178806\n2006-03-03,95.201361892,0.12115257193036655\n2006-03-04,95.031912014,-0.662493629841407\n2006-03-07,94.41305159,-2.048955704855871\n2006-03-08,94.199397396,-3.4402530284388106\n2006-03-09,94.427786362,-4.101096737942058\n2006-03-10,93.985743202,-4.7833628807744475\n2006-03-11,94.685644872,-4.15713651363172\n2006-03-14,94.906666452,-2.9435737967711475\n2006-03-15,95.864426632,-0.6616485541721602\n2006-03-16,96.343306722,1.9461612471791696\n2006-03-17,96.520123986,4.221209936368332\n2006-03-18,96.585951904,5.785695330685321\n2006-03-21,96.445414832,6.28834411430649\n2006-03-22,95.853679792,5.130973447424616\n2006-03-23,96.467604896,4.070546362146125\n2006-03-24,96.216117504,2.6539041908609278\n2006-03-25,96.26789432,1.3270828052815702\n2006-03-28,96.216117504,0.1943125777413286\n2006-03-29,95.580002336,-1.620223112263595\n2006-03-30,96.312274448,-2.1942174071539498\n2006-03-31,96.11996056,-2.422045733712423\n2006-04-01,95.779712912,-2.8699545247680334\n2006-04-04,95.927646672,-3.0277443435279636\n2006-04-05,96.548968464,-2.134888672065621\n2006-04-06,96.93359624,-0.6137422499818612\n2006-04-07,96.763472416,0.515395436943912\n2006-04-08,95.764919536,-0.211817603580279\n2006-04-11,95.86107648,-1.2696284838317453\n2006-04-12,95.15839112,-3.0267591242832026\n2006-04-13,95.298928192,-4.3048925305236025\n2006-04-14,95.313721568,-5.0670915692261715\n2006-04-18,95.062234176,-5.726493408611027\n2006-04-19,96.696902224,-3.80525212819866\n2006-04-20,96.889216112,-1.0806919956884826\n2006-04-21,97.00756312,1.5862240893003445\n2006-04-22,96.97057968,3.528744429400575\n2006-04-25,96.770869104,4.389282190826229\n2006-04-26,96.327067824,3.7808455020558966\n2006-04-27,96.585951904,3.006126734116336\n2006-04-28,97.014959808,2.6811413332843728\n2006-04-29,97.000166432,2.252664716818586\n2006-05-02,96.571158528,1.0971058726861287\n2006-05-03,97.177686944,0.8054748725476344\n2006-05-04,96.763472416,0.18406903653445283\n2006-05-05,97.111116752,0.1120061383752855\n2006-05-06,98.161446448,1.3664228775160154\n2006-05-09,98.050496128,2.4368067182292847\n2006-05-10,98.028306064,3.0694682844733094\n2006-05-11,97.954339184,3.2246422672747386\n2006-05-12,96.733885664,1.168380399215991\n2006-05-13,95.6021924,-2.4743711234187344\n2006-05-16,95.875869856,-5.317699078085376\n2006-05-17,95.683555968,-7.419170138174138\n2006-05-18,94.08587136,-10.010539485698153\n2006-05-19,93.464549568,-12.143532293150486\n2006-05-20,93.908350848,-12.503664140671177\n2006-05-23,93.923144224,-11.648875697516146\n2006-05-24,93.12430192,-10.584603563003107\n2006-05-25,93.257442304,-9.072999527101949\n2006-05-26,94.403928944,-5.923548475371895\n2006-05-27,94.89950704,-2.160292500462873\n2006-05-31,93.405376064,-0.1380311439763915\n2006-06-01,94.15983824,1.687247956734602\n2006-06-02,95.284134816,3.937682847722357\n2006-06-03,95.513432144,5.846161683066441\n2006-06-06,93.86397072,5.675130972896021\n2006-06-07,93.7530204,4.527957133793812\n2006-06-08,93.131698608,2.614754136830122\n2006-06-09,93.301822432,0.9972451538126919\n2006-06-10,92.850624464,-0.4740082268926713\n2006-06-13,91.7189312,-2.387384519260465\n2006-06-14,90.779551824,-4.4550042662690785\n2006-06-15,91.341700112,-5.21447232365982\n2006-06-16,93.176078736,-3.3610719836505254\n2006-06-17,92.86775,-1.2184720175517043\n2006-06-20,91.99107844,0.04257297847130559\n2006-06-21,92.03565496,0.8171784328823577\n2006-06-22,92.96433246,2.1349462471600873\n2006-06-23,92.4591319,2.8905249343345503\n2006-06-24,92.41455538,3.1024191427254166\n2006-06-27,92.89746768,3.302774822767603\n2006-06-28,92.02822554,2.5500540115668358\n2006-06-29,92.55571436,2.181024021268179\n2006-06-30,94.52451066,3.5288796780629355\n2006-07-01,94.36106342,4.791699932599592\n2006-07-04,95.07428774,6.037389121450431\n2006-07-06,94.37592226,6.214676494395576\n2006-07-07,94.62852254,6.001081487942514\n2006-07-08,94.00445126,4.912012157772843\n2006-07-11,94.16046908,3.751363092770326\n2006-07-12,94.55422834,2.8956534509672665\n2006-07-13,93.58097432,1.2150359637442634\n2006-07-14,92.28082582,-1.316895924631929\n2006-07-15,91.84991946,-3.7572386104682565\n2006-07-18,91.70133106,-5.5187835669839345\n2006-07-19,91.88706656,-6.282939428591362\n2006-07-20,93.58840374,-4.7281932873491\n2006-07-21,92.83803232,-3.259208567150395\n2006-07-22,92.20653162,-2.437284439849769\n2006-07-25,93.70727446,-0.5640792305832747\n2006-07-26,94.33134574,1.714629792826159\n2006-07-27,94.2793398,3.459746243463755\n2006-07-28,93.88558054,4.111435212311044\n2006-07-29,94.9851347,4.8448325202253955\n2006-08-01,94.85140514,5.037817860640921\n2006-08-02,94.47250472,4.548752735750732\n2006-08-03,95.02971122,4.2057173077429155\n2006-08-04,95.18572904,3.8396118304312026\n2006-08-05,95.096576,3.316217250448517\n2006-08-08,94.91826992,2.5762970555906435\n2006-08-09,94.59880486,1.4911852896011126\n2006-08-10,94.19018676,-0.01106996405098215\n2006-08-11,94.56165776,-0.8764870362716195\n2006-08-12,94.23476328,-1.69622097354587\n2006-08-15,94.3907811,-2.114624906820225\n2006-08-16,95.62406482,-1.0118557338809353\n2006-08-17,96.3967245,0.9904991899063731\n2006-08-18,96.60474826,2.991931169516704\n2006-08-19,96.92421332,4.729099789078774\n2006-08-22,96.66418362,5.463212252014472\n2006-08-23,96.67904246,5.501874513070511\n2006-08-24,96.26299494,4.459856110318647\n2006-08-25,96.48587754,3.2782002510520343\n2006-08-26,96.46358928,2.0331096533137583\n2006-08-29,96.93907216,1.4322850364883308\n2006-08-30,97.1396665,1.3333618599394086\n2006-08-31,97.13223708,1.3939947044337373\n2006-09-01,97.10994882,1.4731234810358913\n2006-09-02,97.68201416,2.111073162471783\n2006-09-06,97.86032024,2.904035579413744\n2006-09-07,96.90192506,1.571503372260338\n2006-09-08,96.44873044,-0.8940589438194522\n2006-09-09,96.8053426,-2.7240172547648243\n2006-09-12,96.86477796,-3.8090908934986274\n2006-09-13,97.80088488,-3.246260803075323\n2006-09-14,98.2540795,-1.7718328224334456\n2006-09-15,98.1054911,-0.5320082722025887\n2006-09-16,98.36592948,0.7585496959528868\n2006-09-19,98.51517228,2.067249501082131\n2006-09-20,98.3136945,2.578434149079925\n2006-09-21,98.80619574,3.0265767755143003\n2006-09-22,98.2763838,2.1367781950697164\n2006-09-23,98.04505746,0.45290717054216145\n2006-09-26,98.90320356,-0.1781910431199023\n2006-09-27,99.64941756,0.3315385167620093\n2006-09-28,99.72403896,1.1161676981597424\n2006-09-29,99.82850892,1.892968416748488\n2006-09-30,99.60464472,2.0343574645091564\n2006-10-03,99.29869698,1.2961652705079274\n2006-10-04,99.57479616,0.7819379588318327\n2006-10-05,100.7015793,1.3605848439731716\n2006-10-06,100.9627542,2.1507940599766613\n2006-10-07,100.76127642,2.3202214925892406\n2006-10-10,100.80604926,2.2693520950362256\n2006-10-11,100.98514062,2.290579295449163\n2006-10-12,100.73142786,1.7388822647584021\n2006-10-13,101.68658178,1.9053560894017636\n2006-10-14,101.8955217,2.2438685575173594\n2006-10-17,102.14923446,2.591836995903421\n2006-10-18,101.8209003,2.081579910198542\n2006-10-19,101.91790812,1.4975191149554519\n2006-10-20,102.0447645,1.0815786643858871\n2006-10-21,102.12684804,0.8379600611093991\n2006-10-24,102.73874352,1.1983405312006994\n2006-10-25,102.79844064,1.591286051693885\n2006-10-26,103.1267748,2.127512161624651\n2006-10-27,103.61927604,2.892768714334366\n2006-10-28,102.91037274,1.800676254587387\n2006-10-31,102.88052418,0.23869126232914084\n2006-11-01,102.82082706,-1.3069147863743353\n2006-11-02,102.14923446,-3.9381335089934595\n2006-11-03,102.08953734,-6.335568560741336\n2006-11-04,101.9328324,-8.213961084034068\n2006-11-07,103.03722912,-7.771256828065468\n2006-11-08,103.29840402,-6.1066193886910085\n2006-11-09,103.52973036,-3.8191625583351225\n2006-11-10,103.04469126,-2.675804228757329\n2006-11-11,103.17900978,-1.8145024325613974\n2006-11-14,103.48495752,-0.7425144566609561\n2006-11-15,104.1341637,0.7519153580748821\n2006-11-16,104.44757358,2.1914451953908127\n2006-11-17,104.64158922,3.2397073917576478\n2006-11-18,104.76098346,3.9442993329490292\n2006-11-21,104.74605918,4.257073510081966\n2006-11-22,104.90276412,4.448798321156914\n2006-11-23,105.15647688,4.573862151141341\n2006-11-25,104.81321844,3.487319901405513\n2006-11-28,103.34317686,-0.7465901551482403\n2006-11-29,103.74613242,-4.4110776725978695\n2006-11-30,104.73859704,-5.8180786814122385\n2006-12-01,104.81321844,-5.958109200638397\n2006-12-02,104.51473284,-5.944363312521922\n2006-12-05,105.46242462,-4.663450966314599\n2006-12-06,105.87284232,-2.65875361025806\n2006-12-07,105.7758345,-0.7659260447808904\n2006-12-08,105.38034108,0.14600782991664119\n2006-12-09,105.52212174,0.5130611678622259\n2006-12-12,105.76837236,0.7307857611093311\n2006-12-13,105.67882668,0.6377984885522423\n2006-12-14,105.84299376,0.6194045600292739\n2006-12-15,106.69367772,1.358034279491683\n2006-12-16,106.838193168,2.2573950059242947\n2006-12-19,106.508028784,2.304573717905413\n2006-12-20,106.763155808,2.3153291836351286\n2006-12-21,106.650599768,1.951851128914555\n2006-12-22,106.267909232,0.6588460657845303\n2006-12-23,105.69012156,-1.7183567436180525\n2006-12-27,106.207879344,-3.20547729383005\n2006-12-28,106.995771624,-3.173805232857376\n2006-12-29,106.695622184,-3.059851681133928\n2006-12-30,106.192871872,-3.564483246671898\n2007-01-04,106.14034572,-4.070370556746532\n2007-01-05,106.305427912,-4.027729012104196\n2007-01-06,105.622587936,-4.689283351468205\n2007-01-09,105.930241112,-4.815042845892499\n2007-01-10,105.900226168,-4.752558267670992\n2007-01-11,106.10282704,-4.208719397083591\n2007-01-12,106.755652072,-2.523009531834589\n2007-01-13,107.280913592,-0.12060800194098675\n2007-01-17,107.325936008,2.015412846093575\n2007-01-18,107.258402384,3.397876705093907\n2007-01-19,106.89071932,3.4359073311364767\n2007-01-20,107.250898648,3.3259020085350173\n2007-01-23,106.710629656,2.010262333241421\n2007-01-24,107.1158314,1.0082026258806707\n2007-01-25,107.986264776,1.1742589189382286\n2007-01-26,106.81568196,-0.19621985336518577\n2007-01-27,106.695622184,-1.8050251075999668\n2007-01-30,106.523036256,-3.228386863489945\n2007-01-31,107.123335136,-3.357004368821471\n2007-02-01,107.911227416,-2.1412785198318076\n2007-02-02,108.481511352,-0.1516479017527672\n2007-02-03,108.646593544,1.7273325413397984\n2007-02-06,108.57905992,3.0121339802635774\n2007-02-07,108.646593544,3.957845148786511\n2007-02-08,108.826683208,4.586898218655001\n2007-02-09,108.714127168,4.511659528458118\n2007-02-10,107.993768512,2.634965099181244\n2007-02-13,107.618581712,-0.1304048276022769\n2007-02-14,108.436488936,-1.5468155282396197\n2007-02-15,109.284411104,-1.3337976267774536\n2007-02-16,109.426982088,-0.4683870999637634\n2007-02-17,109.314426048,0.2605119906422857\n2007-02-21,109.62958296,1.148460537584512\n2007-02-22,109.472004504,1.650324232072883\n2007-02-23,109.426982088,1.864875280372054\n2007-02-24,109.074306496,1.1314346770944752\n2007-02-27,108.961750456,-0.13600892578374157\n2007-02-28,105.052304,-5.38723039597086\n2007-03-01,105.750151448,-9.59499901271969\n2007-03-02,105.495024424,-12.381915199460131\n2007-03-03,104.286922928,-14.415062834143171\n2007-03-06,103.318940984,-15.669720636138898\n2007-03-07,104.90222928,-14.039159398440873\n2007-03-08,104.647102256,-11.408124640718086\n2007-03-09,105.457505744,-7.702962803424747\n2007-03-10,105.517535632,-3.9259908421773773\n2007-03-13,105.810181336,-0.7067001938905264\n2007-03-14,103.66411284,0.21721332467862453\n2007-03-15,104.406982704,0.9077135288435016\n2007-03-16,104.729643352,1.5092089753735962\n2007-03-17,104.323589496,1.4287296877777393\n2007-03-20,105.521412339,2.155610293256899\n2007-03-21,106.169291361,3.3503908740853845\n2007-03-22,107.977325841,5.539712537466343\n2007-03-23,107.962258887,7.388842995728744\n2007-03-24,108.10539495,8.649745457247818\n2007-03-27,108.173196243,9.105432136576638\n2007-03-28,107.510250267,8.206674025446262\n2007-03-29,106.628833458,5.983146786135919\n2007-03-30,107.065775124,3.8627255755678718\n2007-03-31,106.930172538,1.913175244830228\n2007-04-03,107.20137771,0.5664655516760959\n2007-04-04,108.225930582,0.5674561285059809\n2007-04-05,108.323865783,1.0914861569440788\n2007-04-06,108.693006156,1.9856562454330842\n2007-04-10,108.798474834,2.908570519879156\n2007-04-11,109.08474696,3.793893604582628\n2007-04-12,108.353999691,3.3541127528840917\n2007-04-13,109.039546098,3.0367813451607404\n2007-04-14,109.431286902,2.9470573195148617\n2007-04-17,110.576375406,3.5479887934652226\n2007-04-18,110.794846239,4.237982576657323\n2007-04-19,110.855114055,4.698927394910328\n2007-04-20,110.764712331,4.717927286527704\n2007-04-21,111.849533019,5.147599042359964\n2007-04-24,111.585861324,5.059209331502956\n2007-04-25,111.525593508,4.471514319613732\n2007-04-26,112.595347242,4.310892918272444\n2007-04-27,112.542612903,4.026254805597418\n2007-04-28,112.55014638,3.6526009423296415\n2007-05-01,111.668729571,1.8021175566878185\n2007-05-02,111.955001697,0.09958198482117098\n2007-05-03,112.715882874,-0.6510905823666207\n2007-05-04,113.198025402,-0.5723304811904768\n2007-05-05,113.484297528,-0.07077005500043754\n2007-05-08,113.717835315,0.5786538030130117\n2007-05-09,113.650034022,1.0533200963398883\n2007-05-10,114.041774826,1.6655141706747827\n2007-05-11,112.497412041,-0.2116855409715157\n2007-05-12,113.612366637,-1.611116728579475\n2007-05-15,113.416496235,-2.851621787267561\n2007-05-16,113.288427126,-3.8799928880587373\n2007-05-17,114.215044797,-3.7668039678227245\n2007-05-18,114.086975688,-3.354055947117544\n2007-05-19,114.877990773,-2.190140967934056\n2007-05-22,115.043727267,-0.7858096554384986\n2007-05-23,114.96085902,0.4260317678032237\n2007-05-24,114.795122526,0.9071696024034992\n2007-05-25,113.763036177,-0.49008306506677\n2007-05-26,114.403381722,-1.581627163278526\n2007-05-30,114.569118216,-2.2291968659219137\n2007-05-31,115.540936749,-1.762279037394137\n2007-06-01,115.525869795,-1.057492550421017\n2007-06-02,115.985411892,-0.009965233587578837\n2007-06-05,116.196349248,1.139737167215344\n2007-06-06,115.593671088,1.143041642375806\n2007-06-07,114.58418517,-0.5263646486924216\n2007-06-08,112.520012472,-4.371359777115757\n2007-06-09,113.793170085,-6.750752873763211\n2007-06-12,113.98150701,-7.857316518986302\n2007-06-13,112.753550259,-9.031256354989125\n2007-06-14,114.471183015,-8.242497845671963\n2007-06-15,115.043727267,-6.248557518374476\n2007-06-16,115.789727312,-3.443711921438485\n2007-06-19,115.68380362,-0.8456580962356384\n2007-06-20,115.91078296,1.3322113440094157\n2007-06-21,114.261399756,1.249367572053572\n2007-06-22,114.987733644,0.952876951879972\n2007-06-23,113.671253472,-0.3829296562037783\n2007-06-26,113.194596858,-2.211112724377152\n2007-06-27,112.786034046,-4.008359891477113\n2007-06-28,113.90579879,-4.357391771452683\n2007-06-29,113.79230912,-4.062744926002608\n2007-06-30,113.474538044,-3.658029365513812\n2007-07-03,114.85154604,-1.9867553161435083\n2007-07-04,115.282806786,0.04726836943984836\n2007-07-06,115.328202654,1.8467167038586467\n2007-07-07,115.729199488,3.384428570427623\n2007-07-10,115.819991224,4.396375045911213\n2007-07-11,114.163042042,3.2575480429697876\n2007-07-12,114.881809952,2.1798743660546336\n2007-07-13,117.08350955,2.640154664054286\n2007-07-14,117.355884758,3.4054036535723\n2007-07-17,117.19699922,3.833393780685391\n2007-07-18,117.166735308,3.940677993577175\n2007-07-19,116.962453902,3.612234872942686\n2007-07-20,117.439110516,3.4821369656521526\n2007-07-21,116.009140674,1.9755252254425528\n2007-07-24,116.561457068,0.5897088974349103\n2007-07-25,114.337059536,-2.272706051972797\n2007-07-26,114.81371615,-4.455991691886297\n2007-07-27,112.39260319,-7.124058633311705\n2007-07-28,110.493542712,-9.85726800235345\n2007-07-31,111.424158006,-10.908489541209725\n2007-08-01,110.001754142,-11.361780346414925\n2007-08-02,110.932369436,-10.326231390208228\n2007-08-03,111.439289962,-8.33098256023576\n2007-08-04,108.45829463,-7.219224646206889\n2007-08-07,111.038293128,-4.8168481227157045\n2007-08-08,111.734363104,-1.9440239970601851\n2007-08-09,113.383746308,1.2679693783665584\n2007-08-10,110.251431416,2.461852612378408\n2007-08-11,110.115243812,2.640988272297541\n2007-08-14,110.092545878,2.2840950903384893\n2007-08-15,108.019467906,0.988057697106342\n2007-08-16,106.60463002,-0.7842493115689493\n2007-08-17,107.232606194,-2.07737960162752\n2007-08-18,109.509965572,-1.6652563529225688\n2007-08-21,109.51753155,-0.7342272386275042\n2007-08-22,109.66885111,0.41006417262787664\n2007-08-23,110.962633348,2.0553605774449295\n2007-08-24,110.894539546,3.417271651157023\n2007-08-25,112.097530048,4.93022519013514\n2007-08-28,111.159348776,5.428341631023272\n2007-08-29,108.68527397,4.0691560701577885\n2007-08-30,111.000463238,3.350803370873237\n2007-08-31,110.57676847,2.6701335344527592\n2007-09-01,111.575477566,2.500518275454823\n2007-09-05,112.88439176,2.9686010628347006\n2007-09-06,111.63600539,2.831584871499281\n2007-09-07,112.173189828,2.716803089943241\n2007-09-08,110.342223152,1.7626681605775474\n2007-09-11,110.092545878,0.6253700540862397\n2007-09-12,111.704099192,0.3302295791866072\n2007-09-13,111.704099192,0.3307374568469612\n2007-09-14,112.589318618,0.7986934493650537\n2007-09-15,112.680110354,1.3353123839902281\n2007-09-18,112.074832114,1.4507200892912238\n2007-09-19,115.297938742,2.8296733261664073\n2007-09-20,116.031838608,4.497994163410397\n2007-09-21,115.260108852,5.184217294010558\n2007-09-22,115.753476539,5.362685346910908\n2007-09-25,115.206142835,4.790016878350862\n2007-09-26,115.274559548,3.948375424435497\n2007-09-27,115.829495109,3.322293758686733\n2007-09-28,116.262800958,2.9516175094502017\n2007-09-29,115.905513679,2.2473204151853707\n2007-10-02,117.463894364,2.296667007115289\n2007-10-03,117.395477651,2.4958281316929387\n2007-10-04,116.91656066,2.2075959039173156\n2007-10-05,117.190227512,1.93357890420031\n2007-10-06,118.28489492,2.168099640535388\n2007-10-09,117.973218783,2.1000828961323847\n2007-10-10,118.89304348,2.314667437051675\n2007-10-11,118.611774771,2.2109266589157244\n2007-10-12,118.094848495,1.4108095624294634\n2007-10-13,118.634580342,0.8673166527538996\n2007-10-16,117.699551931,-0.38478228508870416\n2007-10-17,116.893755089,-2.287912421629585\n2007-10-18,117.091403371,-3.7775640393689542\n2007-10-19,116.931764374,-4.800988180748838\n2007-10-20,114.005049429,-7.362925276369047\n2007-10-23,114.48396642,-9.108799717482633\n2007-10-24,115.502615258,-9.09173747372369\n2007-10-25,115.213744692,-8.404307933945056\n2007-10-26,115.031300124,-7.394019866640839\n2007-10-27,116.650495665,-5.030598193235626\n2007-10-30,117.0685978,-2.333924269082395\n2007-10-31,116.354023242,-0.5365402127699497\n2007-11-01,117.669144503,1.5419858710519776\n2007-11-02,114.620799846,1.1149729602875098\n2007-11-03,114.871661127,0.056227376362308235\n2007-11-06,114.172290283,-1.368257846291904\n2007-11-07,115.616643113,-1.6766337299716625\n2007-11-08,112.195807463,-3.231872182063732\n2007-11-09,112.150196321,-4.677173365486638\n2007-11-10,110.424574782,-6.171139203323669\n2007-11-13,109.459138943,-7.423779578157074\n2007-11-14,112.651918883,-6.034688687974906\n2007-11-15,111.82331647,-4.32179156986313\n2007-11-16,110.500593352,-3.2156107462874175\n2007-11-17,111.017519628,-2.1326998370095254\n2007-11-20,109.132259092,-1.7571532828350485\n2007-11-21,109.61877794,-1.358130285249544\n2007-11-22,107.801934117,-1.6268452338071597\n2007-11-24,109.603574226,-1.0707669937942015\n2007-11-27,107.049350274,-1.3265613533414111\n2007-11-28,108.774971813,-0.7796936738071736\n2007-11-29,111.944946182,1.2808787629914704\n2007-11-30,111.952548039,3.2999816150594867\n2007-12-01,112.857169022,5.1509414216451646\n2007-12-04,112.173001892,6.048684611844699\n2007-12-05,111.405214335,5.9291597221971415\n2007-12-06,113.161243302,5.963712139724684\n2007-12-07,114.871661127,6.448718532176464\n2007-12-08,114.597994275,6.45928537487908\n2007-12-11,115.571031971,6.383401735498758\n2007-12-12,112.689928168,4.793502370316027\n2007-12-13,113.366493441,3.236511778858521\n2007-12-14,113.49572501,2.012957332114148\n2007-12-15,111.884131326,0.3565023511274319\n2007-12-18,110.280139499,-1.785675237872681\n2007-12-19,110.850278774,-3.267171917288266\n2007-12-20,110.705843491,-4.111228363488458\n2007-12-21,111.397612478,-4.018091683443117\n2007-12-22,113.25850068,-2.5171153507751995\n2007-12-25,114.21378493,-0.44330662950985555\n2007-12-27,114.236711752,1.4121456626590856\n2007-12-28,112.738826048,2.0121107711180244\n2007-12-29,112.754110596,2.044609112363389\n2008-01-01,111.898175908,1.2928895345176556\n2008-01-03,110.476712944,-0.3271017808069061\n2008-01-04,110.400290204,-1.9691566835380527\n2008-01-05,107.702567482,-4.3742145834391835\n2008-01-08,108.107608004,-6.034451419922874\n2008-01-09,106.082405394,-7.52839498719738\n2008-01-10,107.587933372,-7.333230259755041\n2008-01-11,108.36744532,-5.932003260984473\n2008-01-12,107.014762822,-4.720222816331656\n2008-01-15,108.107608004,-2.9652821113530763\n2008-01-16,105.42516983,-2.277979317931589\n2008-01-17,104.806145636,-2.1293873755368082\n2008-01-18,101.818016502,-2.9948317974551912\n2008-01-19,101.252488226,-4.041272185481617\n2008-01-23,100.129073948,-5.160573545007942\n2008-01-24,102.116065188,-4.708522019807958\n2008-01-25,103.163056726,-3.1076471986609846\n2008-01-26,101.626959652,-1.8606722164437173\n2008-01-29,103.415251768,0.11611374491407389\n2008-01-30,103.988422318,2.1876497062365488\n2008-01-31,103.453463138,3.5937089739879227\n2008-02-01,105.035413856,5.085517852982875\n2008-02-02,106.57151093,6.684736892149601\n2008-02-05,105.478665748,7.119426759178737\n2008-02-06,102.192487928,5.6471011605086545\n2008-02-07,101.428260528,3.506410037130891\n2008-02-08,102.238341572,1.8277007635160984\n2008-02-09,101.733951488,0.40465000196840606\n2008-02-12,102.337691134,-0.3300712944546902\n2008-02-13,103.109560808,-0.32710824495514146\n2008-02-14,104.477527854,0.6213662127875992\n2008-02-15,103.178341274,1.2016746612307543\n2008-02-16,103.224194918,1.6345777396578072\n2008-02-20,103.193625822,1.8292343935479494\n2008-02-21,104.018991414,2.2418724065001143\n2008-02-22,102.773300752,1.905262676491155\n2008-02-23,103.659804536,1.7936171037578035\n2008-02-26,104.936064294,2.3360583823297887\n2008-02-27,105.73086079,3.2516520184701534\n2008-02-28,105.555088488,3.927345035754115\n2008-02-29,104.6991538,3.735949972553513\n2008-03-01,101.83330105,1.785976968801144\n2008-03-04,101.940292886,-0.2834351697684667\n2008-03-05,101.581106008,-2.083225205979005\n2008-03-06,102.17720338,-3.03121592587965\n2008-03-07,99.976228468,-4.423634822669342\n2008-03-08,99.127936054,-5.765090912509265\n2008-03-11,97.714115364,-6.980269022517334\n2008-03-12,101.176065486,-5.4787374130038415\n2008-03-13,100.350699894,-3.544999469240949\n2008-03-14,100.816878608,-1.5725779704120981\n2008-03-15,98.784033724,-0.7604902841292045\n2008-03-18,97.74468446,-0.8032112644337133\n2008-03-19,101.886796968,0.9635545135645387\n2008-03-20,99.624683864,1.9775334658503922\n2008-03-21,101.937927481,3.2749381810798255\n2008-03-25,103.504667269,4.62981139398142\n2008-03-26,103.719709985,5.684087646063908\n2008-03-27,102.782738151,5.859145339107471\n2008-03-28,101.722884765,5.150397208156548\n2008-03-29,100.91647458,3.7671889547927506\n2008-04-01,101.331199818,2.382651422349028\n2008-04-02,105.06372696,2.671913272667254\n2008-04-03,104.956205602,3.176971276752518\n2008-04-04,105.06372696,3.5797429186709664\n2008-04-05,105.194288609,3.864368684481633\n2008-04-08,105.255729385,4.023497837420763\n2008-04-09,104.810283759,3.738987602200325\n2008-04-10,103.980833283,2.741104552612562\n2008-04-11,104.403238618,1.7668044731143837\n2008-04-12,102.368012913,-0.25784909938111156\n2008-04-15,101.999368257,-2.2802978503848053\n2008-04-16,102.544655144,-3.4365390445158113\n2008-04-17,104.625961431,-2.860519467741824\n2008-04-18,104.817963856,-1.6629090564727846\n2008-04-19,106.722627912,0.41519634461219823\n2008-04-22,106.584386166,2.2552345967503413\n2008-04-23,105.747255593,3.0184440274001076\n2008-04-24,105.969978406,3.3544838034789137\n2008-04-25,106.592066263,3.5950767311421856\n2008-04-26,107.337035672,3.8529099330867354\n2008-04-29,107.229514314,3.7244384223427716\n2008-04-30,106.807108979,3.028021828187967\n2008-05-01,106.315582771,1.7995525995760744\n2008-05-02,108.235607021,1.6900096526180164\n2008-05-03,108.550490998,2.0671329353754615\n2008-05-06,108.066644887,1.9958233155686358\n2008-05-07,108.934495848,2.1464083039249147\n2008-05-08,106.968391016,0.746801693108857\n2008-05-09,107.398476448,-0.5514313873728227\n2008-05-10,106.699587621,-1.9858227980316983\n2008-05-13,107.882322559,-2.428600207123182\n2008-05-14,107.82856188,-2.517643578634157\n2008-05-15,108.258647312,-2.1062973069963746\n2008-05-16,109.479782735,-0.8398451172143169\n2008-05-17,109.556583705,0.5144776729486296\n2008-05-20,109.694825451,1.7703437236503348\n2008-05-21,108.773213811,1.7588236228723773\n2008-05-22,106.991431307,-0.07035225088318242\n2008-05-23,107.191113829,-1.9894644206205143\n2008-05-24,105.877817242,-4.346406364890036\n2008-05-28,106.553665778,-5.7146002178473765\n2008-05-29,107.037511889,-5.969498903114214\n2008-05-30,107.544398291,-5.208278438133377\n2008-05-31,107.59815897,-3.9895760630412127\n2008-06-03,106.622786651,-3.3608374746915075\n2008-06-04,105.993018697,-3.276706089547737\n2008-06-05,106.016058988,-3.2833962520552973\n2008-06-06,108.012884208,-1.6873311735316747\n2008-06-07,104.741162886,-2.0482193873613497\n2008-06-10,104.925485214,-2.756896176689814\n2008-06-11,104.556840558,-3.514480345245211\n2008-06-12,102.874899315,-4.751896776634325\n2008-06-13,103.258904165,-5.326245860675023\n2008-06-14,104.75652308,-4.319765039107672\n2008-06-17,104.748842983,-2.9634328415036393\n2008-06-18,104.06531435,-2.104617816788938\n2008-06-19,103.159062904,-1.7963846296800412\n2008-06-20,103.458586687,-1.438418694999342\n2008-06-21,101.566807211,-2.0131906714997996\n2008-06-24,101.597680927,-2.6554955917338887\n2008-06-25,101.296662196,-3.3354215303661334\n2008-06-26,101.8832628,-3.306982454585267\n2008-06-27,98.957978209,-4.15213016580968\n2008-06-28,98.64152262,-4.960636605716324\n2008-07-01,98.672396336,-5.331639104231584\n2008-07-02,99.081473073,-4.9041643723890616\n2008-07-03,97.306234403,-4.776712306064418\n2008-07-04,97.360263406,-4.56954969014771\n2008-07-08,96.549828361,-4.510000841866912\n2008-07-09,98.240164312,-2.795854032957802\n2008-07-10,96.040412047,-1.6321537296422903\n2008-07-11,96.773662802,-0.2807333515411834\n2008-07-12,95.723956458,0.420162853817164\n2008-07-15,94.797744978,0.4238838617946925\n2008-07-16,93.724883347,-0.1018391010984665\n2008-07-17,96.071285763,1.0096937537789117\n2008-07-18,97.17502111,2.9541371108316525\n2008-07-19,97.190457968,4.531873930965006\n2008-07-22,97.244486971,5.622847869192135\n2008-07-23,98.556619901,6.956771311770233\n2008-07-24,98.965696638,8.113626323431774\n2008-07-25,96.812254947,7.514219038631403\n2008-07-26,97.036089388,6.317563876181353\n2008-07-29,95.368908724,4.034830545326869\n2008-07-30,97.460602983,3.0388501680090982\n2008-07-31,99.143220505,3.406493825788644\n2008-08-01,97.908271865,3.3741231504002087\n2008-08-02,97.337108119,2.841844021054527\n2008-08-05,96.418615068,1.8454778245369425\n2008-08-06,99.120065218,2.329752279629652\n2008-08-07,99.637199961,3.2596905068242137\n2008-08-08,97.915990294,3.142852653657478\n2008-08-09,100.046276698,3.425082320521156\n2008-08-12,100.841274885,3.9530898019129097\n2008-08-13,99.752976396,3.8475168146889445\n2008-08-14,99.428802378,3.2962863988729225\n2008-08-15,99.969092408,2.8295691869454274\n2008-08-16,100.378169145,2.4683269249285473\n2008-08-19,98.981133496,1.3998422075324441\n2008-08-20,98.0240483,-0.12284295343167884\n2008-08-21,98.572056759,-1.2117104078915517\n2008-08-22,98.780454342,-1.7473403530972718\n2008-08-23,99.961373979,-1.2378206133110226\n2008-08-26,98.085795732,-1.4964734084441744\n2008-08-27,98.363659176,-1.716063430220288\n2008-08-28,99.150938934,-1.3388844739766768\n2008-08-29,100.578848299,-0.02139677466381329\n2008-08-30,99.328462801,0.5597136797911944\n2008-09-03,98.87307549,0.4698481197005435\n2008-09-04,98.765017484,0.09952196285863835\n2008-09-05,95.762548603,-1.743928626100086\n2008-09-06,96.202499056,-3.224136813531679\n2008-09-09,98.217009025,-3.0853280580539746\n2008-09-10,94.890366126,-3.8093736255525528\n2008-09-11,95.39978244,-4.216885905960702\n2008-09-12,96.874002379,-3.4343815106712583\n2008-09-13,97.051526246,-2.210715935023856\n2008-09-16,92.899011444,-2.5157245572340514\n2008-09-17,94.049057365,-2.4823237181769713\n2008-09-18,89.803921415,-3.5424518470933393\n2008-09-19,93.045661595,-3.2585677896844203\n2008-09-20,97.07538963,-1.1078333447592001\n2008-09-23,93.69851682,0.16001850795620953\n2008-09-24,92.14593162,0.47850680612545204\n2008-09-25,92.231323806,0.5360958458349145\n2008-09-26,93.9314046,1.1637711257148808\n2008-09-27,94.187581158,1.7882940870466086\n2008-09-30,87.736589652,0.6064635207587941\n2008-10-01,90.469139604,-0.15262303784445663\n2008-10-02,90.0499416,-0.7432088458924753\n2008-10-03,86.447943936,-1.7682811161147711\n2008-10-04,85.368897222,-2.8199104822185745\n2008-10-07,82.504377528,-4.086349146155932\n2008-10-08,77.427423924,-5.755779501098409\n2008-10-09,76.379428914,-7.04854068174339\n2008-10-10,71.201557272,-8.189430555128048\n2008-10-11,70.21566567,-8.918356104091586\n2008-10-14,78.157138968,-6.539540885596036\n2008-10-15,77.559393666,-3.540247151097155\n2008-10-16,70.44855345,-1.8094796686277803\n2008-10-17,73.289784366,0.02207484247808722\n2008-10-18,73.041370734,1.4768798280510893\n2008-10-21,76.457058174,3.2604625880083518\n2008-10-22,74.1359433,4.202934754139903\n2008-10-23,70.169088114,3.8229759596808464\n2008-10-24,70.673678304,2.948163480799437\n2008-10-25,67.956654204,1.7094286128261444\n2008-10-28,65.845138332,0.3513507477054745\n2008-10-29,72.792957102,0.914662524440601\n2008-10-30,71.698384536,1.711406336887542\n2008-10-31,74.089365744,2.872716055449054\n2008-11-01,75.401300238,4.171346183202061\n2008-11-04,75.098546124,5.078474847338626\n2008-11-05,77.846621928,6.0993259937259126\n2008-11-06,74.29120182,5.961386933771124\n2008-11-07,70.495131006,4.529128407407008\n2008-11-08,72.296129838,3.1450101577476417\n2008-11-11,71.550888942,1.8413004346286854\n2008-11-12,69.990540816,0.4555582863541261\n2008-11-13,66.551564598,-1.255942186387749\n2008-11-14,70.68144123,-1.5464958822103014\n2008-11-15,68.065335168,-1.7404599195410313\n2008-11-18,66.21775878,-2.0034423185006887\n2008-11-19,66.893133342,-1.936364133023865\n2008-11-20,63.143640084,-2.385769193011228\n2008-11-21,58.95942297,-3.3837025648793357\n2008-11-22,62.313007002,-3.2837752564985863\n2008-11-25,65.899478814,-1.9146045308803892\n2008-11-26,66.807741156,-0.26580352361851567\n2008-11-27,69.105567252,1.7011860302330604\n2008-11-29,69.726601332,3.4451390498948626\n2008-12-02,63.756911238,3.4713132681779513\n2008-12-03,66.194470002,3.4528770349339055\n2008-12-04,67.855736166,3.612017702990862\n2008-12-05,65.984871,3.1331335598418235\n2008-12-06,68.290460022,2.9057494531804053\n2008-12-09,70.689204156,3.214150354970883\n2008-12-10,69.51700233,3.245927190393047\n2008-12-11,70.06040715,3.265296501575598\n2008-12-12,68.337037578,2.8246689303205272\n2008-12-13,68.678606322,2.262391738743105\n2008-12-16,67.910076648,1.4851682129370403\n2008-12-17,71.318001162,1.6519977557856862\n2008-12-18,70.658152452,1.7626545016089565\n2008-12-19,69.24529992,1.3699688029666959\n2008-12-20,69.087998624,0.8760501420928009\n2008-12-23,67.749751256,0.06045321824730365\n2008-12-24,67.452362952,-0.7310205719486973\n2008-12-25,67.820185328,-1.211295996331259\n2008-12-27,68.16452968,-1.34501553861746\n2008-12-30,68.000183512,-1.4045471714299396\n2008-12-31,69.549733096,-0.715864883961693\n2009-01-01,70.692330264,0.5367021181678382\n2009-01-03,72.805352424,2.378514219271807\n2009-01-06,72.656658272,3.8623062768232543\n2009-01-07,73.126218752,4.917642776537619\n2009-01-08,70.919284496,4.380101449033383\n2009-01-09,71.224498808,3.413621606119989\n2009-01-10,69.659297208,1.6807526781854278\n2009-01-13,68.039313552,-0.6785497528340727\n2009-01-14,68.12539964,-2.6854563348178075\n2009-01-15,65.902813368,-4.875696514458511\n2009-01-16,66.082811552,-6.306207686629243\n2009-01-17,66.536720016,-6.659038102509143\n2009-01-21,63.030668432,-7.422659997004118\n2009-01-22,65.754119216,-6.530593779419291\n2009-01-23,64.830650272,-5.336200676239841\n2009-01-24,65.041952488,-3.9890263400607253\n2009-01-27,65.527164984,-2.5183130803642086\n2009-01-28,66.200201672,-0.8850897978040848\n2009-01-29,68.383657904,1.4003247614206344\n2009-01-30,66.184549656,2.4060444906739136\n2009-01-31,64.713260152,2.214287162518346\n2009-02-03,64.580218016,1.4533399768278557\n2009-02-04,65.519338976,1.1049704860294796\n2009-02-05,65.214124664,0.7489084062791207\n2009-02-06,66.184549656,0.8871145719717788\n2009-02-07,68.0862696,1.946545421068052\n2009-02-10,68.188007704,3.031186708860716\n2009-02-11,64.893258336,2.457982952661645\n2009-02-12,65.448904904,1.7298355802392962\n2009-02-13,65.433252888,1.0027927980337452\n2009-02-14,64.752390192,0.035198478427467705\n2009-02-18,61.974157352,-1.8652674669372118\n2009-02-19,61.801985176,-3.6757059300230424\n2009-02-20,61.261990624,-5.130363479078575\n2009-02-21,60.557649904,-6.123539445003395\n2009-02-24,58.42114972,-7.072489883009517\n2009-02-25,60.628083976,-6.233918575565163\n2009-02-26,60.127219464,-4.967244496680799\n2009-02-27,59.117664432,-3.9430160631571596\n2009-02-28,57.857677144,-3.394724176105264\n2009-03-03,55.235964464,-3.703415291301738\n2009-03-04,54.836838056,-4.174130296029663\n2009-03-05,56.088999336,-3.6696646838461326\n2009-03-06,53.835109032,-3.489664864941439\n2009-03-07,53.874239072,-3.40444588569871\n2009-03-10,53.302940488,-3.329689473729914\n2009-03-11,56.472473728,-1.2198463035449016\n2009-03-12,56.824644088,1.3017955766859615\n2009-03-13,59.109838424,4.458624966777812\n2009-03-14,59.59505092,7.121927347790212\n2009-03-17,59.446356768,8.681062416885268\n2009-03-18,61.230686592,10.075899541080936\n2009-03-19,62.521977912,11.196517621911262\n2009-03-20,61.700247072,11.061744572612767\n2009-03-21,60.416258175,9.385828723294125\n2009-03-24,64.80658509,8.86121173376722\n2009-03-25,63.5296857,7.835242984813753\n2009-03-26,64.09719654,6.826407309043162\n2009-03-27,65.508091545,6.270033629584461\n2009-03-28,64.325777295,5.145384036947014\n2009-03-31,62.07938022,2.973308732677026\n2009-04-01,62.61536268,1.1387611711185244\n2009-04-02,63.8449695,0.2216015639177229\n2009-04-03,65.728790205,0.30546597520240226\n2009-04-04,66.422414565,0.954906178410674\n2009-04-07,65.79972906,1.2923610585520464\n2009-04-08,64.325777295,0.7391835416527499\n2009-04-09,65.019401655,0.38172354384006724\n2009-04-10,67.64413929,1.072415589688788\n2009-04-14,67.652021385,1.7956531728825311\n2009-04-15,66.50911761,1.6214976468073203\n2009-04-16,67.242152445,1.3972400301200096\n2009-04-17,68.27470689,1.5559937618837836\n2009-04-18,68.68457583,1.9397124198301796\n2009-04-21,65.744554395,0.6956037821462075\n2009-04-22,67.06086426,-0.3410121164167066\n2009-04-23,66.658877415,-1.3356480553341115\n2009-04-24,67.289445015,-1.759483742460965\n2009-04-25,68.32199946,-1.413019043431241\n2009-04-28,67.65990348,-1.2628381249858478\n2009-04-29,67.43920482,-1.2720390176283516\n2009-04-30,68.85798192,-0.6108187338154139\n2009-05-01,69.007741725,0.285893207340564\n2009-05-02,69.23632248,1.0675883784646913\n2009-05-05,71.66400774,2.5163950799528862\n2009-05-06,71.38025232,3.513151192650369\n2009-05-07,72.601977045,4.441856570045246\n2009-05-08,71.64824355,4.330959485195123\n2009-05-09,73.295601405,4.332766836039788\n2009-05-12,71.83741383,3.178237351812818\n2009-05-13,71.734946595,1.7358251069627713\n2009-05-14,69.9930036,-0.6327958126987738\n2009-05-15,70.505339775,-2.545169149779383\n2009-05-16,69.937828935,-4.106061912168514\n2009-05-19,71.91623478,-4.151705649685482\n2009-05-20,71.82164964,-3.5704821778931617\n2009-05-21,71.340841845,-3.0955006577315842\n2009-05-22,70.33981578,-3.1567706279835477\n2009-05-23,70.18217388,-3.319076595264818\n2009-05-27,71.96352735,-2.395974012871129\n2009-05-28,70.710274245,-2.129097805937768\n2009-05-29,71.671889835,-1.5962996172823622\n2009-05-30,72.838439895,-0.5816165834605229\n2009-06-02,74.70649641,1.1573179204435249\n2009-06-03,74.78531736,2.77085122200819\n2009-06-04,73.80793758,3.242322989431379\n2009-06-05,74.5646187,3.4337288810388173\n2009-06-06,74.509444035,3.2645366764711454\n2009-06-09,74.32815585,2.788537710079545\n2009-06-10,74.58038289,2.2597776001559495\n2009-06-11,74.35968423,1.501216851544946\n2009-06-12,74.761671075,0.9927548412235794\n2009-06-13,74.950841355,0.8023024229720761\n2009-06-16,73.20889836,-0.7177874284124854\n2009-06-17,72.23151858,-2.986103802644344\n2009-06-18,72.13693344,-4.926686362716225\n2009-06-19,72.57833076,-5.832240270998753\n2009-06-20,72.957227148,-5.749131500341207\n2009-06-23,70.761534849,-6.675945598484624\n2009-06-24,70.832875032,-7.3728512946640805\n2009-06-25,71.459083305,-6.9909374009225544\n2009-06-26,72.9255204,-4.936603259581773\n2009-06-27,72.838326843,-2.728816286214915\n2009-06-30,73.464535116,-0.4866705013992956\n2009-07-01,72.862106904,0.7694554784491032\n2009-07-02,73.195027758,1.6951147601071028\n2009-07-03,71.221282695,0.9019042169503706\n2009-07-07,71.18164926,-0.3958022696158281\n2009-07-08,69.842039157,-2.476511406483702\n2009-07-09,69.7548456,-4.384150962207158\n2009-07-10,69.91337934,-5.49211685701205\n2009-07-11,69.715212165,-6.028257019184515\n2009-07-14,71.443229931,-4.429916888256088\n2009-07-15,71.839564281,-2.020665387661076\n2009-07-16,73.916356275,1.6515743283733642\n2009-07-17,74.605978044,5.208306220878924\n2009-07-18,74.645611479,7.815026911219775\n2009-07-21,75.359013309,9.608849274015753\n2009-07-22,75.755347659,10.539973464177962\n2009-07-23,75.739494285,10.50811864767762\n2009-07-24,77.44373199,10.460938520293922\n2009-07-25,77.76079947,10.121977067103543\n2009-07-28,77.958966645,9.421078058694597\n2009-07-29,77.768726157,8.236002451814677\n2009-07-30,77.427878616,6.492994948148755\n2009-07-31,78.23640069,5.1552786502616925\n2009-08-01,78.323594247,4.095700542562696\n2009-08-04,79.623570915,3.7972364442046427\n2009-08-05,79.805884716,3.697279573857273\n2009-08-06,79.560157419,3.251036957986855\n2009-08-07,79.179676443,2.2093509929902098\n2009-08-08,80.21807244,1.7223461047602626\n2009-08-11,80.043685326,1.2141075530594634\n2009-08-12,78.997362642,-0.6164807738860816\n2009-08-13,79.877224899,-1.8955229960331934\n2009-08-14,80.511359859,-2.3417330630753384\n2009-08-15,79.845518151,-3.0999424109891436\n2009-08-18,77.895553149,-5.45154825610021\n2009-08-19,78.601028292,-7.0346582115044285\n2009-08-20,79.274796687,-7.370835332145205\n2009-08-21,80.067465387,-6.457606382191017\n2009-08-22,81.621096039,-4.269949681663576\n2009-08-25,81.613169352,-2.090627195804032\n2009-08-26,81.755849718,-0.19737647186123297\n2009-08-27,81.779629779,1.3397178382199755\n2009-08-28,81.985723641,2.5606180060625903\n2009-08-29,81.906456771,3.0699257394641606\n2009-09-01,81.288175185,2.256754541502211\n2009-09-02,79.42540374,-0.7892094496825024\n2009-09-03,79.10833626,-4.11782835483303\n2009-09-04,79.782104655,-6.063061683439578\n2009-09-05,80.915620896,-6.0997246437300205\n2009-09-09,81.557682543,-4.8903842376683855\n2009-09-10,82.247304312,-2.9151001263953873\n2009-09-11,83.087533134,-0.4531868261637939\n2009-09-12,83.063753073,1.752887906131086\n2009-09-15,83.499720858,3.6774682792549456\n2009-09-16,83.816788338,5.0267958964335335\n2009-09-17,85.077131571,6.194036874246535\n2009-09-18,84.942377892,6.53649914273187\n2009-09-19,84.996535696,6.303118946533459\n2009-09-22,84.773531292,5.382531850922973\n2009-09-23,85.283255644,4.547189735220087\n2009-09-24,84.534598002,2.7473255263625163\n2009-09-25,83.586829285,-0.1750519940992774\n2009-09-26,83.188607135,-3.22202798802239\n2009-09-29,84.677957976,-4.435882355131454\n2009-09-30,84.446989129,-4.883091638133777\n2009-10-01,84.072660308,-5.192810851918338\n2009-10-02,82.073585115,-6.910328498823951\n2009-10-03,81.667398522,-8.655080353230105\n2009-10-06,82.838171643,-8.62020704657882\n2009-10-07,84.064695865,-6.868392002732556\n2009-10-08,84.239913611,-4.6948246325762995\n2009-10-09,84.932820152,-2.3393446230602137\n2009-10-10,85.418651175,0.02230581195809833\n2009-10-13,85.824837768,2.20834143327874\n2009-10-14,85.61776225,3.6438407122493572\n2009-10-15,87.059326433,5.113858399703304\n2009-10-16,87.330117495,6.047150376941957\n2009-10-17,86.700926498,5.613909757241437\n2009-10-20,87.497370798,5.103237328286063\n2009-10-21,86.97171756,3.8997076104424977\n2009-10-22,86.135451045,1.772025801452621\n2009-10-23,87.083219762,0.3844500122809009\n2009-10-24,86.079699944,-1.4093333076563965\n2009-10-27,85.084144569,-3.7146738589106576\n2009-10-28,84.74167352,-5.7368733944512655\n2009-10-29,83.132856034,-8.024002397954376\n2009-10-30,84.940784595,-8.266534701748853\n2009-10-31,82.479771708,-8.837066386688939\n2009-11-03,83.116927148,-8.583902815925363\n2009-11-04,83.347895995,-7.686903825282322\n2009-11-05,83.554971513,-6.266998131120204\n2009-11-06,85.108037898,-3.7305619721123264\n2009-11-07,85.346971188,-1.1466271372751606\n2009-11-10,87.314188609,1.9729699429721563\n2009-11-11,87.266401951,4.357036950962609\n2009-11-12,87.728339645,6.142495978341877\n2009-11-13,86.804464257,6.319787794648832\n2009-11-14,87.298259723,5.9619396483355445\n2009-11-17,88.580535046,5.881754237153942\n2009-11-18,88.660179476,5.622887736745774\n2009-11-19,88.620357261,5.107700763218347\n2009-11-20,87.425690811,3.371502344874621\n2009-11-21,87.154899749,1.3770290685678077\n2009-11-24,88.341601756,0.4674445271506471\n2009-11-25,88.397352857,0.1432777270194734\n2009-11-26,88.700001691,0.19854926380334348\n2009-11-28,87.21065085,-0.9727433806616332\n2009-12-01,87.513299684,-1.944722339612504\n2009-12-02,88.604428375,-1.793366591788562\n2009-12-03,88.660179476,-1.173243730895834\n2009-12-04,87.911521834,-1.2240273433931321\n2009-12-05,88.413281743,-1.1294804533231257\n2009-12-08,88.24602844,-1.104004889701379\n2009-12-09,87.298259723,-1.8691922943575818\n2009-12-10,87.584979671,-2.3275647251977247\n2009-12-11,88.126561795,-2.156068635685699\n2009-12-12,88.548677274,-1.4892778687853792\n2009-12-15,89.12211717,-0.30822685334550926\n2009-12-16,88.64425059,0.3333074343295266\n2009-12-17,88.795575007,0.7749858399776031\n2009-12-18,87.712410759,-0.008800230257577368\n2009-12-19,88.23287946,-0.5039908039328793\n2009-12-22,89.14571622,-0.14800571147270603\n2009-12-23,89.47401716,0.5601536851755498\n2009-12-24,89.65818598,1.315153737689883\n2009-12-25,90.1626484,2.2643001802442697\n2009-12-29,90.21869978,3.1020006436140974\n2009-12-30,90.17866308,3.5819951431652584\n2009-12-31,90.0425383,3.565205431659969\n2010-01-01,89.23379696,2.10374533492633\n2010-01-05,90.74718422,1.6627247302332293\n2010-01-06,91.0034191,1.7233153681657996\n2010-01-07,91.06747782,1.9003723396829315\n2010-01-08,91.45183014,2.2960417849771986\n2010-01-09,91.78013108,2.8692914719409686\n2010-01-12,91.87621916,3.3856626938472374\n2010-01-13,91.01943378,2.419357272519541\n2010-01-14,91.79614576,1.7910938086057584\n2010-01-15,92.03636596,1.3795506942978193\n2010-01-16,91.01943378,-0.27583580975563393\n2010-01-20,92.18049808,-0.9991764576567377\n2010-01-21,91.17157324,-2.369333227051605\n2010-01-22,89.4019511,-5.028058077989499\n2010-01-23,87.44816014,-8.449419863917647\n2010-01-26,87.90457852,-10.568357287490073\n2010-01-27,87.51221886,-11.751480299903832\n2010-01-28,87.92860054,-11.557190533729319\n2010-01-29,86.91166836,-11.080933965688843\n2010-01-30,85.97480958,-10.713658744206548\n2010-02-02,87.32805004,-8.69076763034198\n2010-02-03,88.40904094,-5.373514853818513\n2010-02-04,87.93660788,-2.5158747461705957\n2010-02-05,85.27016366,-1.8258218014492087\n2010-02-06,85.40628844,-1.7921241204867613\n2010-02-09,84.77370858,-2.239611300067523\n2010-02-10,85.8386848,-1.801767917996571\n2010-02-11,85.68654534,-1.287639114868675\n2010-02-12,86.58336742,-0.2525833914047766\n2010-02-13,86.51130136,0.6858829254127841\n2010-02-17,87.8805565,2.4913074842730154\n2010-02-18,88.28893084,4.4493372052514175\n2010-02-19,88.80940794,6.158623021970456\n2010-02-20,89.02560612,7.2982372221378355\n2010-02-23,89.0015841,7.638819613847403\n2010-02-24,87.92860054,6.460635488617456\n2010-02-25,88.75335656,5.404536647101558\n2010-02-26,88.61723178,4.2737830270545984\n2010-02-27,88.68929784,3.197618854072452\n2010-03-02,89.57010524,2.942324933113319\n2010-03-03,89.83434746,3.0948922667560765\n2010-03-04,89.9224282,3.3442148107505574\n2010-03-05,90.21069244,3.7340497465268783\n2010-03-06,91.46784482,4.851696890158962\n2010-03-09,91.51588886,5.7365383804459995\n2010-03-10,91.65201364,6.238933906351292\n2010-03-11,92.07640266,6.532283317942387\n2010-03-12,92.4447403,6.637603534031797\n2010-03-13,92.45274764,6.42548938362733\n2010-03-16,92.484777,5.945413104708045\n2010-03-17,93.21344494,5.712200646698108\n2010-03-18,93.78997342,5.680329988203468\n2010-03-19,93.70990002,5.3958409009198505\n2010-03-20,93.211719585,4.032614359623025\n2010-03-23,93.742382355,2.8704144218401524\n2010-03-24,94.3936503,2.3244538487118263\n2010-03-25,93.951431325,1.255778379869085\n2010-03-26,93.76650339,-0.0908624592772469\n2010-03-27,93.79866477,-1.2156918201378204\n2010-03-30,94.32932754,-1.5406763314699532\n2010-03-31,94.3936503,-1.387829687270056\n2010-04-01,94.063996155,-1.6452074867752202\n2010-04-02,94.73134479,-1.3850204756439126\n2010-04-06,95.48713722,-0.43751721867397464\n2010-04-07,95.71226688,0.7368034958374352\n2010-04-08,95.16552342,0.6851078344404726\n2010-04-09,95.50321791,0.4848442487200373\n2010-04-10,96.122324475,0.6681213986960586\n2010-04-13,96.27509103,1.0072013552310466\n2010-04-14,96.379615515,1.3631444550331793\n2010-04-15,97.440941055,2.1706947601102797\n2010-04-16,97.54546554,2.9009820958213766\n2010-04-17,96.0017193,0.8084403107083631\n2010-04-20,96.331373445,-1.351600354601885\n2010-04-21,97.19169036,-2.439273845663294\n2010-04-22,97.01480277,-3.203135392050271\n2010-04-23,97.30425519,-3.382707175538741\n2010-04-24,97.923361755,-2.7849575294821705\n2010-04-27,97.569586575,-2.5096659340856178\n2010-04-28,95.221805835,-4.88647186876932\n2010-04-29,95.961517575,-6.532179004723517\n2010-04-30,97.167569325,-6.587239368636858\n2010-05-01,95.56754067,-7.389301437621981\n2010-05-04,96.77359242,-7.1296700765622845\n2010-05-05,94.53837651,-7.8708084034108055\n2010-05-06,93.92731029,-8.750929868868681\n2010-05-07,90.64684953,-10.473944984118354\n2010-05-08,89.2478295,-12.031708825259052\n2010-05-11,93.404687865,-10.508524041400122\n2010-05-12,93.131316135,-8.201447794226276\n2010-05-13,94.449932715,-5.139404563325165\n2010-05-14,93.28408269,-2.8455184248866345\n2010-05-15,91.59561024,-1.6890883746802388\n2010-05-18,91.587569895,-1.0445574226571281\n2010-05-19,90.397598835,-1.1135573387873592\n2010-05-20,89.84281503,-1.718005033172794\n2010-05-21,86.473910475,-3.5835528393434544\n2010-05-22,87.663881535,-4.569954177192422\n2010-05-25,86.59451565,-5.219017322029892\n2010-05-26,86.6749191,-5.284887679293746\n2010-05-27,86.168377365,-5.0598962921249395\n2010-05-28,89.078982255,-2.922181061641247\n2010-05-29,87.99353568,-0.9349610537391442\n2010-06-02,86.44978944,0.10760905721175362\n2010-06-03,88.66892466,1.777470064077825\n2010-06-04,89.00661915,3.2702809460145303\n2010-06-05,85.98344943,3.200860872474152\n2010-06-08,84.817599405,2.16888028241042\n2010-06-09,85.685956665,1.371730052971337\n2010-06-10,85.219616655,0.5025863523520258\n2010-06-11,87.792527055,1.086250987831832\n2010-06-12,88.18650396,2.1217490570037754\n2010-06-15,88.098060165,2.9033864550303434\n2010-06-16,90.011662275,4.264900452392119\n2010-06-17,90.01970262,5.458651051971053\n2010-06-18,90.16442883,6.193006766393857\n2010-06-19,90.205636434,6.3500381960951415\n2010-06-22,90.003671459,5.900044293730318\n2010-06-23,88.517209243,4.217066800942277\n2010-06-24,88.266772674,2.256318065660402\n2010-06-25,86.820703453,-0.16995731918883905\n2010-06-26,87.208476205,-1.9825567653705178\n2010-06-29,86.836860651,-3.2947742020353274\n2010-06-30,84.17900158,-5.166431334728735\n2010-07-01,83.387298878,-6.837665330906425\n2010-07-02,83.056076319,-7.884307359062632\n2010-07-03,82.56328178,-8.328571426825278\n2010-07-07,83.096469314,-7.744986261834306\n2010-07-08,85.754328385,-4.838261690134701\n2010-07-09,86.578345483,-1.2477887336342448\n2010-07-10,87.192319007,2.208576217626266\n2010-07-13,87.273104997,4.921065756665811\n2010-07-14,88.589916634,7.331592860893707\n2010-07-15,88.597995233,8.800481593886424\n2010-07-16,88.606073832,9.25650266406791\n2010-07-17,86.142101137,7.2465809984744\n2010-07-20,86.675288671,4.857815110456258\n2010-07-21,87.636641952,3.2795931827200917\n2010-07-22,86.497559493,1.5015892984450048\n2010-07-23,88.444501852,1.1091590348922011\n2010-07-24,89.195811559,1.5506215305224629\n2010-07-27,90.132929043,2.6139253829248617\n2010-07-28,90.116771845,3.6250798380901514\n2010-07-29,89.51087692,3.947996215464144\n2010-07-30,89.098868371,3.485071273608227\n2010-07-31,89.082711173,2.693124898837823\n2010-08-03,91.094282324,2.952296024361125\n2010-08-04,90.658037978,2.901161051341475\n2010-08-05,91.263932903,2.9626972076969267\n2010-08-06,91.166989715,2.876938436827949\n2010-08-07,90.811531359,2.4187772040254174\n2010-08-10,91.296247299,2.2063558955304927\n2010-08-11,90.795374161,1.574338149796823\n2010-08-12,88.29908707,-0.9850858895372525\n2010-08-13,87.73358514,-3.9279025849826965\n2010-08-14,87.475069972,-6.315905531897123\n2010-08-17,87.458912774,-7.809011894190824\n2010-08-18,88.533366441,-7.524881701070711\n2010-08-19,88.686859822,-6.334640546002866\n2010-08-20,87.151926012,-5.893814966192913\n2010-08-21,86.869175047,-5.593259314845469\n2010-08-24,86.546031087,-5.269195398382955\n2010-08-25,85.277691044,-5.59211443996783\n2010-08-26,85.536206212,-5.662306607711173\n2010-08-27,85.011097277,-5.815583275203551\n2010-08-28,86.295594518,-4.618926116699413\n2010-08-31,85.099961866,-3.7669123673261\n2010-09-01,85.204983653,-2.8678262093429225\n2010-09-02,87.604327556,-0.1887573227861239\n2010-09-03,88.436423253,2.9620853914526393\n2010-09-04,89.607820108,6.120632236200102\n2010-09-08,88.606073832,7.5957133425308925\n2010-09-09,89.195811559,8.27336575992792\n2010-09-10,89.623977306,8.408383915500877\n2010-09-11,90.108693246,8.326180789110587\n2010-09-14,91.061967928,8.28050503888862\n2010-09-15,91.005417735,7.749927996262066\n2010-09-16,91.401269086,7.141229714884744\n2010-09-17,91.36895469,6.39542653494685\n2010-09-18,91.378698079,5.6391513243399345\n2010-09-21,92.775652667,5.591251156946427\n2010-09-22,92.5888506,5.337989082138229\n2010-09-23,92.125906347,4.354506025637924\n2010-09-24,91.37057625,2.4117123284451907\n2010-09-25,93.230475091,1.6494708806877796\n2010-09-28,92.848749128,0.962794085174778\n2010-09-29,93.133013143,0.5836133454425081\n2010-09-30,92.921845589,0.12867234914341452\n2010-10-01,92.686312548,-0.5200332017090261\n2010-10-02,93.084282169,-0.7155789598873881\n2010-10-05,92.385804875,-1.4197361507375277\n2010-10-06,94.253825545,-0.8813171113324927\n2010-10-07,94.261947374,-0.14845535896478168\n2010-10-08,94.123876281,0.3709876437474975\n2010-10-09,94.668038824,1.0373355640573152\n2010-10-12,94.749257114,1.6443010586924274\n2010-10-13,95.017277471,2.216346051772149\n2010-10-14,95.740120252,2.9720037034820876\n2010-10-15,95.472099895,3.1323108672467583\n2010-10-16,95.610170988,2.9528866923753014\n2010-10-19,96.284282795,3.0362111377688024\n2010-10-20,94.789866259,1.1359322520579411\n2010-10-21,95.731998423,-0.34851406648802197\n2010-10-22,95.935044148,-1.249505984595487\n2010-10-23,96.146211702,-1.6104617864933033\n2010-10-26,96.397988401,-1.5034188392650094\n2010-10-27,96.430475717,-1.1452715035378844\n2010-10-28,96.146211702,-1.137418440749002\n2010-10-29,96.16245536,-1.130985751677727\n2010-10-30,96.268039137,-0.8802319411033324\n2010-11-02,96.268039137,-0.6911360242346802\n2010-11-03,97.047734721,0.10611961945996029\n2010-11-04,97.470069829,1.2053022694608728\n2010-11-05,99.297481354,3.1524893280758164\n2010-11-06,99.687329146,5.008368643684491\n2010-11-09,99.524892566,6.006356502914869\n2010-11-10,98.76144064,5.060512765683029\n2010-11-11,99.159410261,3.780630354309949\n2010-11-12,98.810171614,1.9465551391519398\n2010-11-13,97.608140922,-1.4095058966908027\n2010-11-16,97.494435316,-4.615225746530015\n2010-11-17,95.935044148,-8.527619928892648\n2010-11-18,96.008140609,-11.329607521655191\n2010-11-19,97.478191658,-11.29899088101827\n2010-11-20,97.673115554,-9.748446330277758\n2010-11-23,97.616262751,-7.763050848045424\n2010-11-24,96.178699018,-7.066087054371565\n2010-11-25,97.616262751,-5.304211632862774\n2010-11-27,96.869054483,-4.077178309743296\n2010-11-30,96.779714364,-3.2011494834978507\n2010-12-01,96.227429992,-3.1333260490323482\n2010-12-02,98.2741309,-1.7767269758630135\n2010-12-03,99.549258053,0.4911700368352996\n2010-12-04,99.784791094,2.698527145239396\n2010-12-07,99.687329146,4.284181808593097\n2010-12-08,99.760425607,5.143169759095898\n2010-12-09,100.134029741,5.698281450382268\n2010-12-10,100.564486678,6.061712028611154\n2010-12-11,101.11677105,6.320287704072115\n2010-12-14,101.165502024,6.125072203174426\n2010-12-15,101.238598485,5.646625514263441\n2010-12-16,100.808141548,4.429272872718158\n2010-12-17,101.376669578,3.538141890124031\n2010-12-18,101.550573396,2.930006573754156\n2010-12-21,101.705699694,2.52398043057768\n2010-12-22,102.375192138,2.611746345924672\n2010-12-23,102.701773818,2.9413203972238335\n2010-12-24,102.554812062,2.951475162589915\n2010-12-28,102.58747023,2.8181171662455142\n2010-12-29,102.70993836,2.6937155331679605\n2010-12-30,102.807912864,2.5255801776540494\n2010-12-31,102.644622024,1.9239370387007426\n2011-01-01,102.693609276,1.279163174248069\n2011-01-04,103.697847942,1.479491069771555\n2011-01-05,103.632531606,1.7064759189490388\n2011-01-06,104.212214088,2.264018969826793\n2011-01-07,104.008100538,2.266744627595372\n2011-01-08,103.795822446,1.5581352593827376\n2011-01-11,103.697847942,0.5258289802198419\n2011-01-12,104.040758706,-0.0745322238603876\n2011-01-13,105.028668288,0.28216350375522836\n2011-01-14,104.87354199,0.43518848129804155\n2011-01-15,105.551198976,0.971319890427381\n2011-01-19,105.755312526,1.6176519076313554\n2011-01-20,104.726580234,0.14670222845272463\n2011-01-21,104.620441188,-1.789758740999801\n2011-01-22,104.800061112,-3.24038673538044\n2011-01-25,105.453224472,-3.604148787887283\n2011-01-26,105.453224472,-3.4868066227496115\n2011-01-27,105.885945198,-2.708482680938758\n2011-01-28,106.163539626,-1.5557639580261053\n2011-01-29,104.277530424,-3.422895676083499\n2011-02-01,105.053161914,-4.726808889655345\n2011-02-02,106.718728482,-4.223869967697567\n2011-02-03,106.530944016,-3.4837774628689857\n2011-02-04,106.759551192,-2.62103071349307\n2011-02-05,107.094297414,-1.5674212359681121\n2011-02-08,107.7719544,-0.15467229256360326\n2011-02-09,108.253662378,1.451538402731714\n2011-02-10,108.033219744,2.536216412448624\n2011-02-11,108.041384286,2.9495083983829886\n2011-02-12,108.71087673,3.2793023635053657\n2011-02-15,108.939483906,3.542747058687027\n2011-02-16,108.621066768,3.0214022334811403\n2011-02-17,109.257901044,2.6696870305766254\n2011-02-18,109.584482724,2.5288995636477836\n2011-02-19,109.870241694,2.5776871471147444\n2011-02-23,107.60866356,-0.5339160311888378\n2011-02-24,106.963664742,-4.531388361652191\n2011-02-25,106.890183864,-7.858481413249891\n2011-02-26,108.033219744,-8.936801463750108\n2011-03-01,108.71087673,-8.240243067914022\n2011-03-02,106.865690238,-8.60235907343138\n2011-03-03,107.086132872,-8.615496934010082\n2011-03-04,108.972142074,-6.6951989659857105\n2011-03-05,108.155687874,-4.824820329417115\n2011-03-08,107.257588254,-3.9649079277459407\n2011-03-09,108.229168752,-2.9063658378617845\n2011-03-10,108.090371538,-2.152633025811319\n2011-03-11,106.081894206,-2.960821736264762\n2011-03-12,106.824867528,-3.315581238801073\n2011-03-15,106.17986871,-3.8528215672190527\n2011-03-16,104.963351952,-4.971162767607524\n2011-03-17,103.044684582,-6.6531021580051615\n2011-03-18,104.38366947,-6.875909253624421\n2011-03-19,104.76332776,-6.147567930878722\n2011-03-22,106.38692974,-3.9733686041933467\n2011-03-23,106.0261293,-1.817641015560497\n2011-03-24,106.30492964,0.07235317449607948\n2011-03-25,107.3381309,2.1582882464572464\n2011-03-26,107.65793129,3.987858085131343\n2011-03-29,107.37093094,4.945050076801024\n2011-03-30,108.12533186,5.560117547128627\n2011-03-31,108.8141327,6.066861319942909\n2011-04-01,108.65833251,6.010686093846431\n2011-04-02,109.18313315,5.929443197671681\n2011-04-05,109.25693324,5.668814984526385\n2011-04-06,109.25693324,5.178502021444231\n2011-04-07,109.60133366,4.791842638776927\n2011-04-08,109.32253332,4.049078244583512\n2011-04-09,108.94533286,2.7620019000068226\n2011-04-12,108.62553247,1.1398450807896552\n2011-04-13,107.78913145,-1.0975577083502444\n2011-04-14,107.78913145,-2.998826480361025\n2011-04-15,107.87933156,-4.166958501084473\n2011-04-16,108.33853212,-4.207845517573382\n2011-04-19,107.03473053,-5.051795511804059\n2011-04-20,107.64973128,-5.041452144738777\n2011-04-21,109.19133316,-3.2070632142968165\n2011-04-22,109.66693374,-0.7298235023115112\n2011-04-26,109.56853362,1.3514483875847176\n2011-04-27,110.52793479,3.448782352431202\n2011-04-28,111.21673563,5.362115701501807\n2011-04-29,111.55293604,6.784653966471112\n2011-04-30,111.96293654,7.771009290920382\n2011-05-03,111.72513625,7.663712898259469\n2011-05-04,111.28233571,6.2836746324819615\n2011-05-05,110.58533486,3.75825037879099\n2011-05-06,109.57673363,0.2614185827202036\n2011-05-07,110.0441342,-2.405359298070067\n2011-05-10,110.47053472,-3.7984955983520763\n2011-05-11,111.41353587,-3.6094191864425156\n2011-05-12,110.24913445,-3.9763875190487354\n2011-05-13,110.7821351,-3.7428535975446877\n2011-05-14,109.91293404,-3.928938260568998\n2011-05-17,109.21593319,-4.55563256745441\n2011-05-18,109.19953317,-5.029514548475149\n2011-05-19,110.19173438,-4.411054240823219\n2011-05-20,110.42133466,-3.3204497276963636\n2011-05-21,109.60953367,-2.959521439267199\n2011-05-24,108.27293204,-3.705590970662719\n2011-05-25,108.19913195,-4.5396562298112855\n2011-05-26,108.54353237,-4.646234326381482\n2011-05-27,109.06833301,-3.8510807267049287\n2011-05-28,109.50293354,-2.490163923443788\n2011-06-01,110.60993489,-0.3019500334256122\n2011-06-02,108.11713185,-0.23365571409634356\n2011-06-03,107.98593169,-0.769321178957469\n2011-06-04,106.9281304,-1.9480245520831758\n2011-06-07,105.82112905,-3.6639650526447056\n2011-06-08,105.65712885,-5.221877067527593\n2011-06-09,105.2881284,-6.46900599392157\n2011-06-10,106.1081294,-6.300014777791077\n2011-06-11,104.59932756,-6.260686295466115\n2011-06-14,104.68952767,-5.741848545718213\n2011-06-15,106.04252932,-3.712716256768097\n2011-06-16,104.15652702,-2.493997898231406\n2011-06-17,104.36972728,-1.505421129024775\n2011-06-18,104.67299034,-0.5269638744765928\n2011-06-21,105.2333559,0.6951068941388527\n2011-06-22,106.65075114,2.7330631044196565\n2011-06-23,106.0574229,4.109501796483251\n2011-06-24,105.71955543,4.564497173475871\n2011-06-25,104.49993627,3.6860331481009467\n2011-06-28,105.43113198,3.294669268355662\n2011-06-29,106.80732387,3.912797984982525\n2011-06-30,107.74676025,5.061210694114571\n2011-07-01,108.75212199,6.437155735526602\n2011-07-02,110.39201532,8.117563843809336\n2011-07-06,110.18599857,9.172590959996576\n2011-07-07,110.37553398,9.621630454390797\n2011-07-08,111.62811582,10.01139504680178\n2011-07-09,110.7546048,9.061982780109567\n2011-07-12,108.74388132,6.060209995590675\n2011-07-13,108.30712581,2.571111977330389\n2011-07-14,108.65323395,-0.21295450629872192\n2011-07-15,107.90333298,-2.6700877721416987\n2011-07-16,108.56258658,-3.904388105103237\n2011-07-19,107.60666886,-4.944942138761419\n2011-07-20,109.41961626,-4.3547825705657885\n2011-07-21,109.31248755,-3.163621573746539\n2011-07-22,110.85349284,-1.0079897036759746\n2011-07-23,110.92765887,1.0112080696077612\n2011-07-26,110.28488661,1.9778002951235365\n2011-07-27,109.89757512,2.0525999563735127\n2011-07-28,107.6231502,0.23654533622520546\n2011-07-29,107.26056072,-1.982042212569965\n2011-07-30,106.34584635,-4.381613694297059\n2011-08-02,106.06566357,-6.316056281340984\n2011-08-03,103.41216783,-8.6554536503415\n2011-08-04,104.00549607,-9.752128656333788\n2011-08-05,99.03637206,-11.28113740129831\n2011-08-06,98.87155866,-12.136334704328256\n2011-08-09,92.50976142,-13.141833947172632\n2011-08-10,96.72074379,-11.34883973291491\n2011-08-11,92.58392745,-9.433798689872706\n2011-08-12,96.64657776,-5.995461703807614\n2011-08-13,97.36351605,-2.331848427428568\n2011-08-16,99.34127685,1.3234111865894036\n2011-08-17,98.52545052,4.011138849692088\n2011-08-18,98.61609789,5.642137947066985\n2011-08-19,94.44631887,5.3499478251855095\n2011-08-20,92.85586956,3.807257830419367\n2011-08-23,92.89707291,2.0897043771820165\n2011-08-24,95.97084282,1.6416978038796088\n2011-08-25,97.34703471,2.0821441875509805\n2011-08-26,95.84723277,2.2442691150224405\n2011-08-27,97.27286868,2.806726540623849\n2011-08-30,100.02525246,4.213551097717094\n2011-08-31,100.22302854,5.560235650706865\n2011-09-01,100.58561802,6.4814382591880175\n2011-09-02,99.67914432,6.438988427302974\n2011-09-03,97.10805528,4.945244520360475\n2011-09-07,96.40759833,2.9494938009118172\n2011-09-08,99.11053809,2.1273920413285055\n2011-09-09,98.08045434,1.3522539023506752\n2011-09-10,95.47640262,-0.09633173262204764\n2011-09-13,96.13565622,-1.1131965307541165\n2011-09-14,96.89379786,-1.385662733042885\n2011-09-15,98.36063712,-0.7017212139139062\n2011-09-16,100.09941849,0.7937289829382692\n2011-09-17,100.70823982,2.34381222693262\n2011-09-20,99.65626199,3.015792285647244\n2011-09-21,99.54029593,3.1926043096676153\n2011-09-22,96.50861179,1.9738511405815515\n2011-09-23,93.4355112,-0.44506703633414446\n2011-09-24,94.04847466,-2.490574875534726\n2011-09-27,96.29324625,-3.054790707422562\n2011-09-28,97.4114904,-2.552009822034499\n2011-09-29,95.39036764,-2.3507295107985016\n2011-09-30,96.10273058,-1.8107395359994314\n2011-10-01,93.74199293,-1.8711586765416968\n2011-10-04,91.05820697,-2.6349190977495525\n2011-10-05,92.88053077,-2.628343741470289\n2011-10-06,94.8436705,-1.7071991349341218\n2011-10-07,96.50861179,-0.19255669369805162\n2011-10-08,95.87908175,0.9849039449858665\n2011-10-11,99.05986511,2.857706679143533\n2011-10-12,99.13441472,4.46624547787826\n2011-10-13,99.95446043,5.793239980129066\n2011-10-14,99.78879463,6.43943013380791\n2011-10-15,101.52000224,6.912387839923596\n2011-10-18,99.59827896,6.07900225155926\n2011-10-19,101.56141869,5.399099624665901\n2011-10-20,100.34377506,4.215185562363537\n2011-10-21,100.79935601,3.080591590095416\n2011-10-22,102.63824639,2.7046932787089446\n2011-10-25,103.94700621,2.9287047019439925\n2011-10-26,101.95073332,2.316179803281017\n2011-10-27,102.98614457,1.844719931025054\n2011-10-28,106.46512637,2.4567322801655322\n2011-10-29,106.58937572,3.161672596577368\n2011-11-01,103.91387305,2.480476987113782\n2011-11-02,101.12240432,0.38807977713057795\n2011-11-03,102.70451271,-1.2253280556447805\n2011-11-04,104.56825296,-1.755592183732432\n2011-11-05,103.91387305,-1.989823763622283\n2011-11-08,104.60138612,-1.8631610242413927\n2011-11-09,105.91014594,-1.2210654460453014\n2011-11-10,102.04184951,-1.8727481733946476\n2011-11-11,102.97786128,-2.2614267382043067\n2011-11-12,104.88301798,-1.8171368383008542\n2011-11-15,103.92215634,-1.6254125424921284\n2011-11-16,104.46885348,-1.3689310331002673\n2011-11-17,102.75421245,-1.7289162024383273\n2011-11-18,101.20523722,-2.670916649728589\n2011-11-19,101.04785471,-3.5092930636693254\n2011-11-22,99.08471498,-4.578136697586935\n2011-11-23,98.72853351,-5.509862739244944\n2011-11-24,96.55002824,-6.696099910328684\n2011-11-26,96.2518298,-7.498731844642748\n2011-11-29,99.1509813,-6.40419342145924\n2011-11-30,99.46574632,-4.5501104036051245\n2011-12-01,103.63224119,-1.185610781026483\n2011-12-02,103.52455842,1.9082414170926754\n2011-12-03,103.42515894,4.18215227773252\n2011-12-06,104.54340309,5.937680987423782\n2011-12-07,104.58481954,6.93184743985411\n2011-12-08,104.99070075,7.259569721676613\n2011-12-09,102.69622942,5.77169778073759\n2011-12-10,104.39430387,4.462401585830463\n2011-12-13,102.91159496,2.5832124323866665\n2011-12-14,101.97558319,0.5170052784048664\n2011-12-15,100.81592259,-1.6063146424494832\n2011-12-16,101.18038735,-3.045288166634272\n2011-12-17,101.338855508,-3.732977123447995\n2011-12-20,100.296875008,-4.316660691306517\n2011-12-21,103.264435472,-3.1266309261375227\n2011-12-22,103.506174948,-1.4812144703812962\n2011-12-23,104.473132852,0.46931396607791953\n2011-12-24,105.356732316,2.443223527243717\n2011-12-28,105.440090756,3.938101728387494\n2011-12-29,104.131363248,4.020495488841185\n2011-12-30,105.11499284,3.91288369107977\n2011-12-31,104.6148422,3.28740861284831\n2012-01-04,106.273675156,3.103216071336206\n2012-01-05,106.390376972,3.022527259152959\n2012-01-06,106.78216164,3.0405684714087045\n2012-01-07,106.548758008,2.836225084124699\n2012-01-10,106.690467356,2.636057905432615\n2012-01-11,107.640753572,2.8890528197629592\n2012-01-12,107.7407837,3.1197173116101666\n2012-01-13,107.957515644,3.2801926406105153\n2012-01-14,107.540723444,2.8292038166383406\n2012-01-18,107.790798764,2.346436541627085\n2012-01-19,109.03283952,2.517243003204726\n2012-01-20,109.599676912,3.026762628634259\n2012-01-21,109.99146158,3.5758564873714676\n2012-01-24,109.683035352,3.5313881983256437\n2012-01-25,109.583005224,3.103416266632692\n2012-01-26,110.508283908,3.0338889537372182\n2012-01-27,109.94978236,2.349671751312229\n2012-01-28,109.808073012,1.3384150911564774\n2012-01-31,109.516318472,0.009787506787404254\n2012-02-01,109.374609124,-1.2869229963316542\n2012-02-02,110.424925468,-1.5155555504411495\n2012-02-03,110.599978192,-1.1697570545826892\n2012-02-04,112.175452708,0.17007760660418114\n2012-02-07,112.083758424,1.396845268213326\n2012-02-08,112.358841276,2.4914530126255556\n2012-02-09,112.692275036,3.401117518093031\n2012-02-10,112.817312696,3.994325004496403\n2012-02-11,112.058750892,3.0626678617953758\n2012-02-14,112.833984384,2.151395341348305\n2012-02-15,112.692275036,1.1277813955396994\n2012-02-16,112.150445176,-0.5428358851887793\n2012-02-17,113.400821776,-1.1774710895131477\n2012-02-18,113.709248004,-1.1364954350177925\n2012-02-22,113.750927224,-0.8074858053784055\n2012-02-23,113.384150088,-0.9097472385054743\n2012-02-24,113.875964884,-0.671736979854046\n2012-02-25,114.142711892,-0.22877109453226296\n2012-02-28,114.334436304,0.3298969177218112\n2012-02-29,114.667870064,1.0049976062673807\n2012-03-01,114.092696828,0.49911101603511554\n2012-03-02,114.842922788,0.27391236039417777\n2012-03-03,114.467809808,-0.3882379163397758\n2012-03-06,113.9926667,-1.6929107819629081\n2012-03-07,112.258811148,-4.8723474715321515\n2012-03-08,113.109067236,-6.970449215685008\n2012-03-09,114.217734488,-7.178848364855831\n2012-03-10,114.676205908,-6.1794916404888625\n2012-03-13,114.684541752,-4.725761880384724\n2012-03-14,116.751831064,-2.0396562066569928\n2012-03-15,116.626793404,0.4718146072449798\n2012-03-16,117.301996768,2.8027325225818274\n2012-03-17,117.439304125,4.5767583398384915\n2012-03-20,117.950019,5.689721982046038\n2012-03-21,117.556517375,5.506398776859385\n2012-03-22,117.347208,4.449949925309426\n2012-03-23,116.5099705,2.114893775462974\n2012-03-24,116.953706375,0.0757479141968389\n2012-03-27,118.561202375,-0.4281501769094689\n2012-03-28,118.159328375,-0.8249855594581561\n2012-03-29,117.573262125,-1.695218391253377\n2012-03-30,117.39744225,-2.5941249249759437\n2012-03-31,117.816061,-2.8170724247004273\n2012-04-03,118.711905125,-2.05908829298815\n2012-04-04,118.26816925,-1.6070853284585809\n2012-04-05,117.079292,-2.628384979451205\n2012-04-06,117.02905775,-3.861505421039979\n2012-04-10,115.731339625,-5.838340919527944\n2012-04-11,113.730342,-8.695811291545112\n2012-04-12,114.61781375,-10.132003140407761\n2012-04-13,116.250426875,-9.305777056883898\n2012-04-14,114.810378375,-8.551138054180214\n2012-04-17,114.642930875,-7.638934787277314\n2012-04-18,116.451363875,-5.261559445587828\n2012-04-19,116.032745125,-3.023642428098789\n2012-04-20,115.329465625,-1.584410167104636\n2012-04-21,115.496913125,-0.5518004494201278\n2012-04-24,114.525717625,-0.6465082454645668\n2012-04-25,114.961081125,-0.7940349593967113\n2012-04-26,116.5769495,0.24838181765829148\n2012-04-27,117.355580375,1.806905331408366\n2012-04-28,117.56488975,3.1648543092927994\n2012-05-01,117.020685375,3.7000947879678847\n2012-05-02,117.83280575,4.296640523134947\n2012-05-03,117.4476765,4.298736510573825\n2012-05-04,116.585321875,3.2809070568376626\n2012-05-05,114.668048,0.7094229763619353\n2012-05-08,114.78526125,-1.7991150091905013\n2012-05-09,114.28291875,-3.98372579597131\n2012-05-10,113.64661825,-5.783570306304924\n2012-05-11,113.822438125,-6.651775390948927\n2012-05-12,113.4959155,-6.9958872330320645\n2012-05-15,112.298665875,-7.4286875751300485\n2012-05-16,111.645620625,-7.743887821890631\n2012-05-17,111.252119,-7.7984774294582095\n2012-05-18,109.569271625,-8.242673717527445\n2012-05-19,108.62319325,-8.746486821196019\n2012-05-22,110.53209475,-7.057819083698803\n2012-05-23,110.6827975,-4.731112159007331\n2012-05-24,110.741404125,-2.461515745439897\n2012-05-25,110.959085875,-0.3524200479517745\n2012-05-26,110.59907375,1.0642363143059015\n2012-05-30,111.93865375,3.1360479198910767\n2012-05-31,110.289295875,3.8339581802316687\n2012-06-01,110.088358875,3.616703282557964\n2012-06-02,107.300358,1.638224362947895\n2012-06-05,107.25012375,-0.49913044955116703\n2012-06-06,108.028754625,-1.5036615585656108\n2012-06-07,110.53209475,-0.08256562918462151\n2012-06-08,110.557211875,1.778222643041289\n2012-06-09,111.453056,3.8687498106693354\n2012-06-12,110.054869375,4.789622893583676\n2012-06-13,111.360959875,5.847080278214939\n2012-06-14,110.59907375,6.111678239434106\n2012-06-15,111.829812875,6.449431600906962\n2012-06-16,112.85484543,6.869312771385744\n2012-06-19,113.132564289,6.984838227860713\n2012-06-20,114.192945387,7.310245908004077\n2012-06-21,113.982552312,7.24178503595995\n2012-06-22,111.457835412,5.294857726803194\n2012-06-23,112.282576266,3.437003414263536\n2012-06-26,110.464780098,0.941110033510526\n2012-06-27,111.0875436,-0.9535135768266088\n2012-06-28,112.072183191,-1.7056601066312425\n2012-06-29,111.752385717,-2.047515974709725\n2012-06-30,114.681057321,-0.6631322490545912\n2012-07-03,114.840956058,1.1465744915469998\n2012-07-04,115.690944081,3.136362163022106\n2012-07-06,115.160753532,4.243447115769477\n2012-07-07,114.108788157,4.043395142329587\n2012-07-10,113.881563636,3.1090948147551813\n2012-07-11,112.888508322,1.350153348292217\n2012-07-12,112.905339768,-0.363783187101248\n2012-07-13,112.358317773,-2.1271706626464066\n2012-07-14,114.243439725,-2.2810376939060077\n2012-07-17,113.940473697,-1.9955967247610928\n2012-07-18,114.756798828,-1.0107918884597638\n2012-07-19,115.640449743,0.5471314748553837\n2012-07-20,115.918168602,2.0834918945521252\n2012-07-21,114.849371781,2.412849354272943\n2012-07-24,113.688002007,1.3966433533074678\n2012-07-25,112.795935369,-0.44683252296280784\n2012-07-26,112.728609585,-2.2767491762060956\n2012-07-27,114.596900091,-2.4436570495949113\n2012-07-28,116.81023524,-0.9541102271510411\n2012-07-31,116.709246564,0.6837511548629607\n2012-08-01,115.892921433,1.500735827211301\n2012-08-02,115.791932757,1.9081152063413924\n2012-08-03,114.992439072,1.5246984292591534\n2012-08-04,117.306762897,2.091405527812263\n2012-08-07,117.500324526,2.7014326485978586\n2012-08-08,118.089425136,3.2115157920972592\n2012-08-09,118.232492427,3.501146984271081\n2012-08-10,118.350312549,3.684671027711886\n2012-08-11,118.527042732,3.834587405020791\n2012-08-14,118.468132671,3.7473063990012534\n2012-08-15,118.484964117,3.4619767155876673\n2012-08-16,118.619615685,3.026290476163396\n2012-08-17,119.511682323,3.0626412753995993\n2012-08-18,119.688412506,3.21822573548841\n2012-08-21,119.688412506,3.278571038506783\n2012-08-22,119.301289248,2.6659531033239006\n2012-08-23,119.351783586,1.940068949301434\n2012-08-24,118.392391164,0.020536985547266795\n2012-08-25,119.099311896,-1.2700655842793935\n2012-08-28,119.116143342,-2.0642961849766124\n2012-08-29,118.99832322,-2.653580150463256\n2012-08-30,119.090896173,-2.8387436319202237\n2012-08-31,118.232492427,-3.85634790356535\n2012-09-01,118.863671652,-4.052954981477988\n2012-09-05,118.552289901,-4.185803848960333\n2012-09-06,118.611199962,-4.00574119852719\n2012-09-07,121.001265294,-1.79475159966168\n2012-09-08,121.514624397,0.8946516435193743\n2012-09-11,120.774040773,2.2080958152911805\n2012-09-12,121.093838247,2.9914417552374957\n2012-09-13,121.514624397,3.6601027476515213\n2012-09-14,123.45865641,4.9349251233094975\n2012-09-15,123.913105452,6.08527155811376\n2012-09-18,123.492319302,6.090955834137162\n2012-09-19,123.391330626,5.279947013278004\n2012-09-20,123.492319302,4.338057133444792\n2012-09-21,123.500735025,3.4950510002387034\n2012-09-22,123.432204015,2.5831987159591137\n2012-09-25,123.178384965,1.3002686594966946\n2012-09-26,121.993896065,-1.5390792070251536\n2012-09-27,121.232438915,-4.956971966770055\n2012-09-28,122.44230972,-6.482707324822975\n2012-09-29,121.773919555,-7.570655641542942\n2012-10-02,122.03619924,-7.784174115598049\n2012-10-03,122.25617575,-7.179084063549638\n2012-10-04,122.738431945,-5.713992311497471\n2012-10-05,123.753708145,-3.231745841737947\n2012-10-06,123.635259255,-0.9076200201784559\n2012-10-09,123.23760941,0.35364722139400584\n2012-10-10,122.044659875,-0.4243059925252979\n2012-10-11,121.22397828,-2.3654120946735446\n2012-10-12,121.29166336,-4.161800209328668\n2012-10-13,120.85171034,-5.846299141486448\n2012-10-16,121.841604635,-5.968757373464875\n2012-10-17,123.16992433,-4.300977975598563\n2012-10-18,123.66064116,-1.8492553391982867\n2012-10-19,123.40682211,0.23765815686100922\n2012-10-20,121.24089955,-0.01407658978214954\n2012-10-23,121.333966535,-0.8247697085453325\n2012-10-24,119.591075725,-2.844267689787827\n2012-10-25,119.337256675,-4.928832368935879\n2012-10-26,119.658760805,-6.258726583261044\n2012-10-27,119.591075725,-6.955906645953334\n2012-11-01,119.44724493,-7.07958445881048\n2012-11-02,120.910934785,-5.157726660244158\n2012-11-03,119.76874906,-3.524778278538278\n2012-11-06,120.05641065,-1.9417710561353019\n2012-11-07,120.927856055,0.14565876764537933\n2012-11-08,118.26275603,0.15321912784812497\n2012-11-09,116.714459825,-1.2562287928574847\n2012-11-10,116.89213316,-2.632187436139347\n2012-11-13,116.95981824,-3.6122093396076735\n2012-11-14,116.5875503,-4.406719188957545\n2012-11-15,115.04771473,-5.41298861884416\n2012-11-16,114.81081695,-6.160813738187791\n2012-11-17,115.360758225,-5.836025914451795\n2012-11-20,117.729736025,-2.90364395472524\n2012-11-21,117.83972428,0.35325251184870865\n2012-11-22,117.983555075,3.0501242608840613\n2012-11-24,119.574154455,5.978672120361132\n2012-11-27,119.438784295,8.038174634305342\n2012-11-28,118.77039413,8.601831290962437\n2012-11-29,119.70106398,8.816281494177936\n2012-11-30,120.27638716,8.761301503896632\n2012-12-01,120.19178081,8.095857640353387\n2012-12-04,119.692603345,6.709091409123275\n2012-12-05,119.48108747,4.9935589338969635\n2012-12-06,119.71798525,3.541047253824125\n2012-12-07,120.064871285,2.7078616357001835\n2012-12-08,120.4794424,2.510584705211869\n2012-12-11,120.58097002,2.4994446920078914\n2012-12-12,121.34242717,3.0669108714759687\n2012-12-13,121.44395479,3.7097614643635097\n2012-12-14,120.69941891,3.26889163616962\n2012-12-15,120.24254462,1.9834783856059701\n2012-12-18,121.655470665,1.7545761269444355\n2012-12-19,123.026093535,2.6279254995220995\n2012-12-20,122.061581145,2.522196846661913\n2012-12-21,122.79765639,2.5136316099262643\n2012-12-22,121.649077341,1.3877676784940505\n2012-12-25,121.274169489,-0.12618710228656482\n2012-12-27,120.694766445,-1.8316303570178363\n2012-12-28,120.643642647,-3.24664656251349\n2012-12-29,119.178093771,-5.382259055070726\n2013-01-01,121.436061516,-5.3851813859802675\n2013-01-03,124.529051295,-2.9056807225666503\n2013-01-04,124.171184709,-0.3566022471990209\n2013-01-05,124.784670285,2.0631706517045956\n2013-01-08,124.333076736,3.525622737422843\n2013-01-09,124.000772049,4.009347531314241\n2013-01-10,124.392721167,4.107713498942964\n2013-01-11,125.312949531,4.305403365612719\n2013-01-12,125.312949531,4.09443433199155\n2013-01-15,125.219222568,3.492856016156729\n2013-01-16,125.312949531,2.919412375775174\n2013-01-17,125.295908265,2.397419105079287\n2013-01-18,126.079806501,2.4480070003409438\n2013-01-19,126.386549289,2.7526103661001855\n2013-01-23,127.04263803,3.2901686558798886\n2013-01-24,127.272695121,3.761441056815187\n2013-01-25,127.315298286,4.022832192169901\n2013-01-26,128.022510825,4.409826943777546\n2013-01-29,127.869139431,4.35109869863679\n2013-01-30,128.371856778,4.267269793602381\n2013-01-31,127.877660064,3.246102423903423\n2013-02-01,127.55387601,1.5701008065170328\n2013-02-02,128.900136024,0.8256495305262774\n2013-02-05,127.409025249,-1.3037098554114266\n2013-02-06,128.729723364,-2.509056298960232\n2013-02-07,128.814929694,-3.037939464403607\n2013-02-08,128.627475768,-3.3081967362567752\n2013-02-09,129.34320894,-2.853742678445883\n2013-02-12,129.317647041,-2.1273728618599392\n2013-02-13,129.5136216,-1.2592264700678442\n2013-02-14,129.641431095,-0.43117795679422954\n2013-02-15,129.777761223,0.40530998832215914\n2013-02-16,129.658472361,0.7478772649249947\n2013-02-20,130.53609756,1.4269986128644518\n2013-02-21,128.883094758,-0.197263753719227\n2013-02-22,128.15032032,-2.941377169181095\n2013-02-23,129.419894637,-4.308746072097414\n2013-02-26,126.965952333,-6.837880933231389\n2013-02-27,127.826536266,-8.271721439741697\n2013-02-28,129.436935903,-7.725939874951806\n2013-03-01,129.113151849,-6.623441030375481\n2013-03-02,129.607348563,-4.977036862254707\n2013-03-05,130.297519836,-2.740296230053346\n2013-03-06,131.464846557,-0.1065633200540077\n2013-03-07,131.64377985,2.0904244372760843\n2013-03-08,131.916440106,3.8118247948291426\n2013-03-09,132.444719352,4.986523125029301\n2013-03-12,132.947436699,5.706286119320474\n2013-03-13,132.615132012,5.558326384148906\n2013-03-14,132.785544672,5.026155834929909\n2013-03-15,133.543881009,4.675420703235183\n2013-03-16,133.415494092,4.096109329610279\n2013-03-19,132.636637923,2.5194281183213434\n2013-03-20,132.328518999,0.5627609922291725\n2013-03-21,133.201522617,-0.5031681468112339\n2013-03-22,132.097429806,-2.2019648347240732\n2013-03-23,133.17584604,-2.867824759069862\n2013-03-26,132.722226513,-3.4289542920406006\n2013-03-27,133.646583285,-3.103853003667794\n2013-03-28,133.655142144,-2.3921444067996305\n2013-03-29,133.988937645,-1.3348668543027529\n2013-04-02,133.560994695,-0.8463069184715124\n2013-04-03,134.220026838,-0.1813036946985136\n2013-04-04,132.790697385,-1.0151738809523891\n2013-04-05,133.389817515,-1.7174071847077599\n2013-04-06,132.816373962,-2.704964677996152\n2013-04-09,133.697936439,-2.87742899136628\n2013-04-10,134.160114825,-2.3453701605459827\n2013-04-11,135.854768907,-0.6306873686538239\n2013-04-12,136.274152998,1.3555090643795182\n2013-04-13,135.897563202,2.570081463984266\n2013-04-16,132.807815103,0.7963139442873484\n2013-04-17,134.733558378,-0.446571659838348\n2013-04-18,132.696549936,-2.4852555192595887\n2013-04-19,131.926252626,-4.743025957446797\n2013-04-20,133.073139732,-5.8054211030683405\n2013-04-23,133.68937758,-5.768912001050502\n2013-04-24,135.050236161,-4.414851590898721\n2013-04-25,135.14438361,-2.5916720193278593\n2013-04-26,135.752062599,-0.4596309373673435\n2013-04-27,135.452502534,1.008881479051034\n2013-04-30,136.34262387,2.4409816160698696\n2013-05-01,136.667860512,3.549471062291488\n2013-05-02,135.503855688,3.172370258049021\n2013-05-03,136.702095948,2.8879216422530476\n2013-05-04,138.071513388,3.1644689311301732\n2013-05-07,138.465220902,3.6093895962445117\n2013-05-08,139.192723917,4.185426369892284\n2013-05-09,139.800402906,4.797357152384379\n2013-05-10,139.449489687,4.788441195761699\n2013-05-11,139.860314919,4.63806829160481\n2013-05-14,139.971580086,4.395453544970039\n2013-05-15,141.460821552,4.54916635682045\n2013-05-16,142.205442285,4.84412188573215\n2013-05-17,141.512174706,4.243168150145763\n2013-05-18,142.907268723,3.8986248814444338\n2013-05-21,142.907268723,3.5851428672091004\n2013-05-22,143.027092749,3.2996633923305154\n2013-05-23,142.008588528,1.86942386752159\n2013-05-24,141.606322155,-0.06916135887783526\n2013-05-25,141.503615847,-1.8708677251062227\n2013-05-29,142.33382517,-2.6774968489224023\n2013-05-30,141.409468398,-3.7925623289279145\n2013-05-31,141.982911951,-4.294969225161594\n2013-06-01,139.714814316,-6.17116748343139\n2013-06-04,140.690524242,-7.122599575336707\n2013-06-05,139.988697804,-7.74094101426072\n2013-06-06,137.951689362,-9.07631670119168\n2013-06-07,139.201282776,-9.209160992260145\n2013-06-08,141.058555179,-7.608726560899861\n2013-06-11,141.04999632,-5.49276719359456\n2013-06-12,139.612108008,-4.340142747323455\n2013-06-13,138.439544325,-4.0810299396183325\n2013-06-14,140.553582498,-2.8993840833921922\n2013-06-15,139.654902303,-2.063413892781867\n2013-06-18,140.79323055,-0.8786685302838606\n2013-06-19,141.811734771,0.5026990002864622\n2013-06-20,139.971580086,0.5599808107880833\n2013-06-21,136.316947293,-1.2410437844924758\n2013-06-22,136.85040539,-2.802555973817185\n2013-06-25,135.077932362,-4.500526063426577\n2013-06-26,136.50623587,-5.086986960996754\n2013-06-27,137.814080046,-4.393774906412361\n2013-06-28,138.640086894,-2.9633709389198657\n2013-06-29,137.676412238,-1.8540127265099855\n2013-07-02,138.87240132,-0.29427174015400936\n2013-07-03,138.665899608,1.0568202409352807\n2013-07-04,138.820775892,2.009610345276947\n2013-07-06,140.29210059,3.2158334373324706\n2013-07-09,141.057877772,4.3234520440691\n2013-07-10,142.038760904,5.357364405520137\n2013-07-11,142.150615998,5.997862027220485\n2013-07-12,144.129590738,6.970848514737227\n2013-07-13,144.129590738,7.541954690850972\n2013-07-16,144.740491636,7.832180269166926\n2013-07-17,144.1209865,7.195847146049218\n2013-07-18,144.525385686,6.27217529401792\n2013-07-19,145.308371344,5.540469111993097\n2013-07-20,145.609519674,4.930100906188358\n2013-07-23,145.8418341,4.4084728634802275\n2013-07-24,145.532081532,3.5575324033647107\n2013-07-25,145.02443149,2.2425984143598328\n2013-07-26,145.351392534,1.2013033329057237\n2013-07-27,145.506268818,0.5515393448562236\n2013-07-30,145.007223014,-0.3971233050466907\n2013-07-31,145.06745268,-1.1893528222733778\n2013-08-01,145.119078108,-1.667437517243286\n2013-08-02,146.83132147,-0.8321980982740769\n2013-08-03,147.08944861,0.4231389369501386\n2013-08-06,146.96038504,1.3875693875423138\n2013-08-07,146.039731574,0.9173918948604438\n2013-08-08,145.566498484,-0.40177214513101944\n2013-08-09,146.108565478,-1.2643578005816494\n2013-08-10,145.66974934,-2.2908410339278618\n2013-08-13,145.49766458,-3.3080250433630454\n2013-08-14,146.005314622,-3.63125329299136\n2013-08-15,145.187912012,-4.370823997062537\n2013-08-16,143.062665226,-6.553459493744391\n2013-08-17,142.718495706,-8.57464595675961\n2013-08-20,141.763425288,-10.394788806215693\n2013-08-21,142.477577042,-10.732443196257357\n2013-08-22,141.591340528,-10.691935640444392\n2013-08-23,142.881976228,-8.998630251410589\n2013-08-24,143.406834746,-6.402909473621179\n2013-08-27,142.804538086,-4.147994784561561\n2013-08-28,140.498602302,-3.5415629755517486\n2013-08-29,141.032065058,-3.0374638393639586\n2013-08-30,141.298796436,-2.409365391994612\n2013-08-31,140.80835487,-2.2061533551179267\n2013-09-04,141.436464244,-1.5898801659624198\n2013-09-05,142.623849088,-0.10097019049255351\n2013-09-06,142.709891468,1.4261940830416222\n2013-09-07,142.864767752,2.8088203726635044\n2013-09-10,144.267258546,4.829140852495264\n2013-09-11,145.273954392,6.951976993081118\n2013-09-12,145.729979006,8.608719507585747\n2013-09-13,145.446039152,9.158269182017094\n2013-09-14,145.695562054,8.992252678176222\n2013-09-17,146.599007044,8.786636927979337\n2013-09-18,147.192699466,8.611638802065286\n2013-09-19,148.973776732,8.93985497945792\n2013-09-20,148.689836878,8.65104264334289\n2013-09-21,147.522590492,6.782467470001301\n2013-09-24,146.934644404,4.128564593685631\n2013-09-25,146.614732562,1.428418569911031\n2013-09-26,146.217004326,-1.1306311263159543\n2013-09-27,146.718487754,-2.7455192673418054\n2013-09-28,146.07866407,-4.211359846842541\n2013-10-01,145.34373146,-5.7429124093453865\n2013-10-02,146.46774604,-5.765024838204418\n2013-10-03,146.217004326,-5.206513344379175\n2013-10-04,144.928710692,-5.391918644856503\n2013-10-05,146.026786474,-4.7380495781535\n2013-10-08,144.755785372,-4.7169222610812795\n2013-10-09,143.078409768,-5.717045184993836\n2013-10-10,143.156226162,-6.499873576446504\n2013-10-11,146.329405784,-4.753673575742354\n2013-10-12,147.24590998,-2.082752129322756\n2013-10-15,147.885733664,0.7181314182158971\n2013-10-16,146.744426552,2.235206558225329\n2013-10-17,148.75900653,3.8775966996426945\n2013-10-18,149.813850982,5.559081684464594\n2013-10-19,150.756293976,7.008180990901593\n2013-10-22,150.83411037,7.683112142054881\n2013-10-23,151.61227431,7.801584941636186\n2013-10-24,150.981096892,6.962712974780985\n2013-10-25,151.517165384,6.029246285521246\n2013-10-26,152.113757738,5.335374090781279\n2013-10-29,152.381791984,4.694110634209004\n2013-10-30,153.229126052,4.366353563914842\n2013-10-31,152.459608378,3.360671544953476\n2013-11-01,151.940832418,1.8388637311274039\n2013-11-02,152.295329324,0.6322093179981039\n2013-11-05,152.917860476,0.10861378236941732\n2013-11-06,152.416377048,-0.6059532603705122\n2013-11-07,153.194540988,-0.8035527796301096\n2013-11-08,151.283716202,-2.371759238340168\n2013-11-09,153.306942446,-2.834445505808148\n2013-11-12,153.289649914,-2.7022842541555576\n2013-11-13,153.021615668,-2.5352878796167317\n2013-11-14,154.180215312,-1.7592310140218501\n2013-11-15,155.044841912,-0.5246116816758217\n2013-11-16,155.736543192,0.9351587066826497\n2013-11-19,155.2004747,1.630670006270357\n2013-11-20,154.794100198,1.5937638482624266\n2013-11-21,154.344494366,0.765429644421161\n2013-11-22,155.606849202,0.5045692478782513\n2013-11-23,156.333135546,0.7608992321316066\n2013-11-26,156.246672886,0.9369557880690849\n2013-11-27,156.186149024,0.9513162167736198\n2013-11-28,156.601169792,1.1427137807918797\n2013-11-30,156.436890738,1.1958185626036624\n2013-12-03,156.099686364,0.7880462964499912\n2013-12-04,155.50309401,-0.38217490387967246\n2013-12-05,155.347461222,-1.7613706893307324\n2013-12-06,154.776807666,-3.4682303928389473\n2013-12-07,156.45418327,-3.51929276311067\n2013-12-10,156.84326524,-2.6897613779821654\n2013-12-11,156.28125795,-2.270602397365728\n2013-12-12,154.526065952,-3.487104110598203\n2013-12-13,154.015936258,-5.113121579629102\n2013-12-14,153.998643726,-6.301319437423118\n2013-12-17,154.958379252,-6.1065548123145845\n2013-12-18,154.370433164,-5.859905116118263\n2013-12-19,157.10265322,-3.725445371040415\n2013-12-20,156.9297279,-1.4376690640130931\n2013-12-21,157.859950388,1.096514733889272\n2013-12-24,158.694544244,3.636329360830878\n2013-12-25,159.033597998,5.603144631445716\n2013-12-27,159.824723424,7.031791070919347\n2013-12-28,159.824723424,7.616235756152555\n2013-12-31,159.807336052,7.475861594060561\n2014-01-01,160.546299362,7.091047995542823\n2014-01-03,159.024904312,4.867656020754474\n2014-01-04,158.990129568,2.349058506840663\n2014-01-07,158.538057896,-0.24708115879877823\n2014-01-08,159.468282298,-1.6698456723732278\n2014-01-09,159.546525472,-2.316471689089596\n2014-01-10,159.650849704,-2.3897730065742024\n2014-01-11,160.085534004,-1.8393223749199592\n2014-01-14,157.929499876,-3.2168881778868865\n2014-01-15,159.720399192,-3.395657624615531\n2014-01-16,160.563686734,-2.624717376673736\n2014-01-17,160.302876154,-1.9120787706301385\n2014-01-18,159.65954339,-1.9403403193770714\n2014-01-22,160.120308748,-1.8112164551591121\n2014-01-23,160.22463298,-1.5101241276530786\n2014-01-24,158.911886394,-2.2733825551642397\n2014-01-25,155.469186738,-5.063578292273945\n2014-01-28,154.756304486,-8.137103839931669\n2014-01-29,155.70391626,-9.640401770404026\n2014-01-30,154.121665408,-10.676534784518978\n2014-01-31,155.816934178,-9.76733041790228\n2014-02-01,154.904097148,-8.532383025712392\n2014-02-04,151.40054169,-8.331686536835363\n2014-02-05,152.452477696,-7.353498324580883\n2014-02-06,152.287297662,-6.0562569044056005\n2014-02-07,154.295539128,-3.661930544329607\n2014-02-08,156.260312164,-0.49552419947467286\n2014-02-11,156.495041686,2.3231371122849254\n2014-02-12,158.207697828,5.017103811799615\n2014-02-13,158.364184176,7.0494801041365065\n2014-02-14,159.0944538,8.535296870886086\n2014-02-15,159.972516086,9.45572921628527\n2014-02-19,160.189858236,9.6645401217732\n2014-02-20,159.13792223,8.448571666953029\n2014-02-21,160.05075926,7.127509904273701\n2014-02-22,159.929047656,5.732984682704938\n2014-02-25,160.754947826,4.77410768296037\n2014-02-26,160.694092024,3.9672161054826915\n2014-02-27,160.70278571,3.2562774855630963\n2014-02-28,161.589541682,3.0826787367313884\n2014-03-01,161.96337018,3.2302774954676607\n2014-03-04,160.815803628,2.3988408365447285\n2014-03-05,163.076161988,2.412013901427514\n2014-03-06,163.102243046,2.59474906011269\n2014-03-07,163.623864206,2.8956326746350243\n2014-03-08,163.667332636,3.092208719243594\n2014-03-11,163.623864206,3.056964802801602\n2014-03-12,162.771882978,1.9976585708587606\n2014-03-13,162.815351408,0.8444236266999781\n2014-03-14,160.989677348,-1.662348726747922\n2014-03-15,160.537605676,-4.397545891762235\n2014-03-18,161.989451238,-5.453993567585478\n2014-03-19,163.145711476,-4.922701356279205\n2014-03-20,162.276342876,-4.490377051147561\n2014-03-21,163.22395465,-3.4042363145472763\n2014-03-22,162.58650751,-2.6198508849125304\n2014-03-25,161.8966566,-2.4650383608978004\n2014-03-26,162.69129499,-1.875964156708136\n2014-03-27,161.52116813,-2.1570551922387793\n2014-03-28,161.18060882,-2.929344977280408\n2014-03-29,161.9839795,-3.0598496093655427\n2014-04-01,163.32875216,-2.0014536276470807\n2014-04-02,164.40282383,-0.20348199793432542\n2014-04-03,164.91802894,1.749746325912298\n2014-04-04,164.6909894,3.0994182655796294\n2014-04-05,162.75242102,2.3795439538093177\n2014-04-08,160.97103386,0.10500466005822773\n2014-04-09,161.66088477,-1.7737661826008235\n2014-04-10,163.42480735,-2.200797722605607\n2014-04-11,159.94935593,-3.8578162521324586\n2014-04-12,158.47359892,-5.9410696016597555\n2014-04-15,159.74851326,-6.707758300688191\n2014-04-16,160.88371096,-5.973108483321717\n2014-04-17,162.54284606,-3.83691600994522\n2014-04-18,162.76115331,-1.5042008284601422\n2014-04-22,163.32875216,0.6050568294316605\n2014-04-23,164.07099681,2.4845237642054343\n2014-04-24,163.67804376,3.694656512062174\n2014-04-25,164.00113849,4.397908143629422\n2014-04-26,162.67383041,3.6920378684767527\n2014-04-29,163.18903552,2.766274150619111\n2014-04-30,163.9050833,2.1899275756074985\n2014-05-01,164.54254047,2.091261070650461\n2014-05-02,164.42028841,1.9977829176272337\n2014-05-03,164.21944574,1.7314596454365656\n2014-05-06,164.55127276,1.663903049241128\n2014-05-07,163.12790949,0.5944524874470574\n2014-05-08,164.07099681,0.06891616909904741\n2014-05-09,163.9050833,-0.3673049230012495\n2014-05-10,164.167052,-0.5406463216400823\n2014-05-13,165.74759649,0.34461296152566945\n2014-05-14,165.87858084,1.4459464184935058\n2014-05-15,165.07521016,1.6735936096223796\n2014-05-16,163.6431146,0.49882133615180635\n2014-05-17,164.26310719,-0.39274642205022303\n2014-05-20,164.7783123,-0.7479348869656448\n2014-05-21,163.77409895,-1.6026732371633727\n2014-05-22,165.15380077,-1.5388213219232085\n2014-05-23,165.5642184,-0.9585275240633706\n2014-05-24,166.24533702,0.1507565585483519\n2014-05-28,167.28447953,1.8204214849494846\n2014-05-29,167.11856602,3.13095730035527\n2014-05-30,168.0092596,4.318436603255471\n2014-05-31,168.21010227,5.123755701304198\n2014-06-03,168.45460639,5.578249147712491\n2014-06-04,168.36728349,5.425501009240804\n2014-06-05,168.69911051,5.08122381693147\n2014-06-06,169.80811134,5.10205717585557\n2014-06-07,170.63767889,5.39162927024438\n2014-06-10,170.77739553,5.588424971148626\n2014-06-11,170.79486011,5.510046476513608\n2014-06-12,170.20979668,4.414299250482642\n2014-06-13,169.00474066,1.724308761034763\n2014-06-14,169.54614264,-0.5528875468844774\n2014-06-17,169.65966241,-2.160552295044525\n2014-06-18,170.13120607,-2.8718405883335834\n2014-06-19,171.37992354,-2.316831869500845\n2014-06-20,171.57203392,-1.2547416094963921\n2014-06-21,171.923007192,0.05667804376815866\n2014-06-24,171.870361584,1.2080529758636516\n2014-06-25,170.843772228,0.7383727811921545\n2014-06-26,171.607133544,0.2730253158490257\n2014-06-27,171.49306806,-0.318771096152318\n2014-06-28,171.791393172,-0.6854107092359101\n2014-07-01,171.729973296,-1.0232585907782266\n2014-07-02,172.905725208,-0.4468688502673501\n2014-07-03,173.046113496,0.4163061135898545\n2014-07-04,173.9498631,1.7342331361326586\n2014-07-08,173.300567268,2.0020365755120935\n2014-07-09,172.221332304,0.4462155418977858\n2014-07-10,172.958370816,-0.826061704954796\n2014-07-11,172.28275218,-2.5002227432442936\n2014-07-12,172.50210888,-3.7135928513466467\n2014-07-15,173.37953568,-3.82843734992435\n2014-07-16,173.054887764,-3.795782917356888\n2014-07-17,173.695409328,-3.0774380363210625\n2014-07-18,171.721199028,-3.9996883544363797\n2014-07-19,173.502375432,-3.779254314928181\n2014-07-22,173.151404712,-3.5010142238851003\n2014-07-23,173.90599176,-2.6708433300069174\n2014-07-24,174.292059552,-1.6033751652769794\n2014-07-25,174.30083382,-0.6737164055815796\n2014-07-26,173.502375432,-0.6893693558393608\n2014-07-29,173.55502104,-0.895430766157304\n2014-07-30,172.791659724,-1.7161444817260758\n2014-07-31,172.835531064,-2.586153088489418\n2014-08-01,169.422340812,-5.568317462666656\n2014-08-02,168.887110464,-8.634899030927485\n2014-08-05,170.115507984,-9.688140825062625\n2014-08-06,168.474719868,-10.350190091668154\n2014-08-07,168.527365476,-10.248605156446693\n2014-08-08,167.579744532,-9.976049681515462\n2014-08-09,169.553954832,-7.710809917177791\n2014-08-12,170.04531384,-4.6703207688016874\n2014-08-13,169.817182872,-1.8961907182580262\n2014-08-14,171.001709052,0.9714426130478984\n2014-08-15,171.765070368,3.5675978101362134\n2014-08-16,171.721199028,5.384257800007759\n2014-08-19,173.133856176,7.148341568462627\n2014-08-20,174.072702852,8.660701884343872\n2014-08-21,174.537739056,9.52551176023961\n2014-08-22,175.0466466,9.901292252464046\n2014-08-23,174.774644292,9.438472338339238\n2014-08-26,175.66084536,8.867766983157843\n2014-08-27,175.774910844,8.108795045560989\n2014-08-28,175.7047167,7.088216598903891\n2014-08-29,175.608199752,5.796814532372139\n2014-08-30,176.108333028,4.79208821879358\n2014-09-03,176.020590348,3.8385596416483097\n2014-09-04,175.9240734,2.8741637621265923\n2014-09-05,175.678393896,1.7240185713169467\n2014-09-06,176.459303748,1.2412413482543485\n2014-09-09,176.003041812,0.43530394085118473\n2014-09-10,174.888709776,-1.5752233658512296\n2014-09-11,175.546779876,-2.899220492195994\n2014-09-12,175.74858804,-3.478222115509922\n2014-09-13,174.713224416,-4.662931265382909\n2014-09-16,174.625481736,-5.661363474610688\n2014-09-17,175.941621936,-5.0543536482016265\n2014-09-18,176.1434301,-3.7687441332428904\n2014-09-19,177.082276776,-1.6743624651259665\n2014-09-20,176.92359282,0.13779100467255034\n2014-09-23,175.55721729,-0.04708004074097971\n2014-09-24,174.552270126,-1.6355234073539293\n2014-09-25,175.927460982,-2.1293454307647153\n2014-09-26,173.071295358,-4.1481752150131115\n2014-09-27,174.45530154,-5.213050995270869\n2014-09-30,174.093873174,-5.796951454229905\n2014-10-01,173.679552852,-6.12528935725733\n2014-10-02,171.343491462,-7.147045558947866\n2014-10-03,171.387568092,-7.712575195444522\n2014-10-04,173.238786552,-6.432131572216882\n2014-10-07,173.04484938,-4.8285856423236595\n2014-10-08,170.40025158,-4.461508780235349\n2014-10-09,173.318124486,-2.7850808564741385\n2014-10-10,169.87133202,-2.295347885284002\n2014-10-11,167.967221604,-2.727476962755155\n2014-10-14,165.24328587,-3.914729424212922\n2014-10-15,165.578268258,-4.857068104280444\n2014-10-16,164.344122618,-5.763815343394597\n2014-10-17,164.203077402,-6.239871909806702\n2014-10-18,166.142449122,-5.108021982984937\n2014-10-21,167.75565378,-2.827767540991424\n2014-10-22,171.079031682,0.9316500757316959\n2014-10-23,169.862516694,3.8789963281572\n2014-10-24,171.837149718,6.537616435090186\n2014-10-25,173.159448618,8.675218679280341\n2014-10-28,172.921434816,9.72937877747087\n2014-10-29,174.904883166,10.414964321185487\n2014-10-30,174.640423386,10.177017544460007\n2014-10-31,175.759969788,9.620883454031144\n2014-11-01,177.769864116,9.283827725447217\n2014-11-04,177.866832702,8.844134145236701\n2014-11-05,177.249759882,7.78069095563\n2014-11-06,178.369306284,6.84996170100672\n2014-11-07,179.08334769,6.158363624459099\n2014-11-08,179.250838884,5.4981602035936845\n2014-11-11,179.815019748,4.995752925098181\n2014-11-12,179.973695616,4.502545652750904\n2014-11-13,179.797389096,3.820615713185383\n2014-11-14,180.000141594,3.215230719283511\n2014-11-15,180.044218224,2.698082046701316\n2014-11-18,180.158817462,2.2436400558248835\n2014-11-19,181.19902593,2.2420302565525105\n2014-11-20,180.908120172,2.0168964159187226\n2014-11-21,181.225471908,1.844577576513231\n2014-11-22,182.230419072,2.084384441396324\n2014-11-25,182.706446676,2.5156395179322573\n2014-11-26,182.69763135,2.804400297419292\n2014-11-27,183.041429064,3.0220419716778224\n2014-11-29,182.65355472,2.5673650392365914\n2014-12-02,181.41940908,0.5202277492236078\n2014-12-03,182.556586134,-0.936324676284471\n2014-12-04,183.279442866,-1.55557176711784\n2014-12-05,183.041429064,-2.025946757131976\n2014-12-06,183.3587808,-2.098443265151417\n2014-12-09,182.133450486,-3.2010217765853355\n2014-12-10,182.010035922,-4.3159873718497295\n2014-12-11,179.092163016,-7.1980173866756445\n2014-12-12,180.035402898,-8.99815615649024\n2014-12-13,177.135160644,-11.414073705355392\n2014-12-16,175.874569026,-13.615751160817567\n2014-12-17,174.45530154,-15.251030790896756\n2014-12-18,177.884463354,-13.679385956374318\n2014-12-19,182.336202984,-9.073696247270377\n2014-12-20,182.894646573,-3.9910597418832268\n2014-12-23,183.905163207,0.7432428479294444\n2014-12-24,184.153360275,4.343753847286642\n2014-12-25,184.206545361,6.748891641886232\n2014-12-27,184.764988764,8.123409525928743\n2014-12-30,185.013185832,8.495830604879615\n2014-12-31,184.02039756,7.247691908142372\n2015-01-01,182.15891955,4.364573340350667\n2015-01-03,182.096870283,1.4809865056311793\n2015-01-06,178.843715856,-2.2921624767020887\n2015-01-07,177.124064742,-5.999731729364335\n2015-01-08,179.331245811,-7.522297347892575\n2015-01-09,182.51348679,-6.486886312444199\n2015-01-10,180.997711839,-5.201047996528537\n2015-01-13,179.632627965,-4.291894266543231\n2015-01-14,179.127369648,-3.6022698960116912\n2015-01-15,178.116853014,-3.329689741052917\n2015-01-16,176.370609357,-3.6461724881166546\n2015-01-17,178.728481503,-2.999420092177772\n2015-01-21,179.127369648,-2.1254895839720973\n2015-01-22,179.996059386,-0.9930186217530164\n2015-01-23,182.646449505,1.1021770342634198\n2015-01-24,181.689117957,2.6419964086706003\n2015-01-27,182.105734464,3.7644671267399943\n2015-01-28,179.756726499,3.4185784192435733\n2015-01-29,177.407718534,1.730866042665042\n2015-01-30,179.065320381,0.491368382472281\n2015-01-31,176.813818407,-1.1432188180117038\n2015-02-03,178.96781439,-1.711178979904119\n2015-02-04,181.573883604,-0.9254357300989042\n2015-02-05,180.882477486,-0.018724323082906835\n2015-02-06,182.761683858,1.399392783265725\n2015-02-07,182.185512093,2.5022804585107608\n2015-02-10,181.387735803,2.8853255471342365\n2015-02-11,183.284670537,3.4139778470354614\n2015-02-12,183.426497433,3.772400951735051\n2015-02-13,185.190469452,4.298387481540928\n2015-02-14,185.952789018,4.780653512795475\n2015-02-18,186.289627896,5.110809002061195\n2015-02-19,186.280763715,5.127293362610708\n2015-02-20,186.130072638,4.820360992023637\n2015-02-21,187.282416168,4.711967966145693\n2015-02-24,187.202638539,4.4022043763609275\n2015-02-25,187.752217761,4.1268235402213165\n2015-02-26,187.574934141,3.613191483558495\n2015-02-27,187.362193797,2.8633581291983603\n2015-02-28,186.732836946,1.6491801722406194\n2015-03-03,187.911773019,1.0531830667619104\n2015-03-04,187.140589272,0.1528402393092989\n2015-03-05,186.333948801,-1.2411820165074374\n2015-03-06,186.599874231,-2.269364383443225\n2015-03-07,183.93175575,-4.529799534882727\n2015-03-10,184.694075316,-6.01510940534348\n2015-03-11,181.7157105,-8.10785981174245\n2015-03-12,181.27250145,-9.784040042046016\n2015-03-13,183.603781053,-9.325150062208621\n2015-03-14,182.460301704,-8.41892207139454\n2015-03-17,184.942272384,-6.040093092550386\n2015-03-18,184.366100619,-3.7484244298721094\n2015-03-19,186.520096602,-0.8418706882086653\n2015-03-20,185.70459195,1.2073631356158288\n2015-03-21,187.387478985,3.1998601964007065\n2015-03-24,186.986793,4.301325280510007\n2015-03-25,185.936105306,4.061807564506907\n2015-03-26,183.211440608,2.1362233425984414\n2015-03-27,182.775138091,-0.2167708428559365\n2015-03-28,183.202536475,-1.9571125777603058\n2015-03-31,185.419665592,-2.0981419681869653\n2015-04-01,183.808017519,-2.3052809582701457\n2015-04-02,183.15801581,-2.65309863656384\n2015-04-03,183.78130512,-2.464780940101967\n2015-04-07,185.063500272,-1.377222604162803\n2015-04-08,184.564868824,-0.38553742290794446\n2015-04-09,185.223774666,0.6262103140999997\n2015-04-10,186.025146636,1.6921015351383986\n2015-04-11,187.040217798,2.8712265369202967\n2015-04-14,186.149804498,3.2814659404286743\n2015-04-15,186.532682217,3.4220819672170038\n2015-04-16,187.405287251,3.6724991831854155\n2015-04-17,187.34295832,3.6830640607720113\n2015-04-18,185.188158134,2.21119578794179\n2015-04-21,186.853231005,1.3330554365119127\n2015-04-22,186.63062768,0.6225961307818935\n2015-04-23,187.574465778,0.5524382747827445\n2015-04-24,188.064193093,0.9473729479133794\n2015-04-25,188.473783211,1.5432895893176095\n2015-04-28,187.645698842,1.457035332871044\n2015-04-29,188.268988152,1.517561150208266\n2015-04-30,187.458712049,1.0544251029926741\n2015-05-01,185.668981316,-0.6780042460253952\n2015-05-02,187.627890576,-1.3452655246853809\n2015-05-05,188.224467487,-1.2649566414353899\n2015-05-06,186.025146636,-2.142198475830128\n2015-05-07,185.241582932,-3.373610201378\n2015-05-08,185.980625971,-3.8449983968434154\n2015-05-09,188.455974945,-2.661684574207399\n2015-05-12,187.52104098,-1.5825426933618445\n2015-05-13,186.968984734,-0.9750568388041003\n2015-05-14,187.040217798,-0.6606417489939886\n2015-05-15,188.990222925,0.486624817839143\n2015-05-16,189.159401452,1.7716543271126\n2015-05-19,189.74707423,2.9685886992447124\n2015-05-20,189.684745299,3.6302495480651302\n2015-05-21,189.551183304,3.6984507925746755\n2015-05-22,190.10323955,3.7943549326875825\n2015-05-23,189.6580329,3.3857085598434367\n2015-05-27,187.618986443,1.33838487566873\n2015-05-28,189.364196511,0.10750075358358657\n2015-05-29,189.21282625,-0.70795690354106\n2015-05-30,187.992960029,-1.9574771298331228\n2015-06-02,188.358029482,-2.7373943380915478\n2015-06-03,188.224467487,-3.1633045990276614\n2015-06-04,188.696386536,-2.9418352897808404\n2015-06-05,187.227204591,-3.3519722728086805\n2015-06-06,186.773093808,-3.947097008820606\n2015-06-09,185.633364784,-5.05231657986554\n2015-06-10,185.624460651,-5.861570371538953\n2015-06-11,187.832685635,-4.5905648149154175\n2015-06-12,188.438166679,-2.492642821124498\n2015-06-13,186.995697133,-1.397286042364776\n2015-06-16,186.194325163,-1.1971916195677892\n2015-06-17,187.209396325,-0.5117744835103579\n2015-06-18,187.512136847,0.36730146624438476\n2015-06-19,189.462141974,2.1573697816371578\n2015-06-20,188.629984227,3.096710289372787\n2015-06-23,189.596353863,3.850547322354622\n2015-06-24,189.730571868,4.369391758890664\n2015-06-25,188.35260035,3.7276308221681376\n2015-06-26,187.779936862,2.3797423617519797\n2015-06-27,187.744145394,0.9097985662057084\n2015-06-30,183.807083914,-2.293952230062274\n2015-07-01,184.191842195,-5.020034345136146\n2015-07-02,185.66824025,-5.827591156491835\n2015-07-03,185.498230777,-5.760889611176296\n2015-07-07,184.970306624,-5.416112107572069\n2015-07-08,186.133529334,-3.9928429445542335\n2015-07-09,183.010723751,-3.744359678841697\n2015-07-10,183.34179483,-3.505217862574284\n2015-07-11,185.650344516,-1.8177669679399884\n2015-07-14,187.699406059,0.7923803342700495\n2015-07-15,188.513661956,3.3088643265754385\n2015-07-16,188.451026887,5.1144988059660434\n2015-07-17,189.96321641,6.772557473423888\n2015-07-18,190.124278016,7.826699983952601\n2015-07-21,190.222704553,8.288413151135217\n2015-07-22,189.471083725,7.545726988843391\n2015-07-23,189.131064779,5.956252664337498\n2015-07-24,188.066268606,3.5228061972023212\n2015-07-25,186.1156336,0.20999356931634594\n2015-07-28,185.032941693,-3.125540975894367\n2015-07-29,187.305699911,-4.356377430853321\n2015-07-30,188.594192759,-3.8744198702473795\n2015-07-31,188.638932094,-2.7558121111939613\n2015-08-01,188.35260035,-1.648885782989126\n2015-08-04,187.717301793,-1.0121116800014107\n2015-08-05,187.350439246,-0.7455020653197977\n2015-08-06,187.967842069,-0.2284294342344495\n2015-08-07,186.428808945,-0.7293441250441646\n2015-08-08,186.070894265,-1.758283844571082\n2015-08-11,188.415235419,-1.3131457666304271\n2015-08-12,186.715140689,-1.3545156202040616\n2015-08-13,186.938837364,-1.3030123503856146\n2015-08-14,186.706192822,-1.2682423800854679\n2015-08-15,187.386230714,-0.777672785176577\n2015-08-18,188.433131153,0.35506753232576216\n2015-08-19,187.887311266,1.118581518052821\n2015-08-20,186.401965344,0.6554462023845034\n2015-08-21,182.509643199,-1.8084522242851406\n2015-08-22,177.015652861,-5.568628591622485\n2015-08-25,169.56207965,-9.795842938400831\n2015-08-26,167.566705309,-13.127003433573837\n2015-08-27,174.000221682,-12.503496787297301\n2015-08-28,178.304145709,-9.1069899196604\n2015-08-29,178.313093576,-5.138680663413197\n2015-09-01,176.872486989,-1.7761792767739877\n2015-09-02,171.593245459,-0.03459034295901375\n2015-09-03,174.850269047,1.8204695499785188\n2015-09-04,174.975539185,3.1627266269164878\n2015-09-05,172.326970553,3.2004491540492523\n2015-09-09,176.657738181,3.5948997799042246\n2015-09-10,174.295501293,3.3717741313698752\n2015-09-11,175.243975195,3.2386318316016514\n2015-09-12,176.040335358,3.3495086881949803\n2015-09-15,175.387141067,3.289258916028359\n2015-09-16,177.579368482,3.606410732168193\n2015-09-17,179.118401606,4.254932438931164\n2015-09-18,178.715747591,4.601362874426471\n2015-09-19,175.801470135,3.780496656994771\n2015-09-22,176.709935138,2.980063311102569\n2015-09-23,174.416285873,1.6499331772216195\n2015-09-24,174.13745008,0.3094465353342315\n2015-09-25,173.50782087,-0.923833714989243\n2015-09-26,173.462847355,-1.8776930715558748\n2015-09-29,169.109411103,-3.494002610047872\n2015-09-30,169.208352836,-4.7124840211721235\n2015-10-01,172.365493589,-4.10138820730581\n2015-10-02,172.815228739,-2.7799263646155623\n2015-10-03,175.3967085,-0.5216849322516879\n2015-10-06,178.517870441,2.436569833146173\n2015-10-07,177.906230637,4.690893226725194\n2015-10-08,179.363372523,6.498131307427293\n2015-10-09,180.982419063,7.987445133494383\n2015-10-10,181.090355499,8.679358404079295\n2015-10-13,181.261254856,8.567646390771095\n2015-10-14,180.118927575,7.394845199666037\n2015-10-15,179.255436087,5.4605569936075895\n2015-10-16,182.007815205,4.355778893332953\n2015-10-17,182.835327881,3.855494300595474\n2015-10-20,182.925274911,3.5241046750071803\n2015-10-21,182.691412633,3.0918880699304694\n2015-10-22,181.558080055,2.103771887353993\n2015-10-23,184.625273778,2.107242584830864\n2015-10-24,186.649081953,2.8959414201039237\n2015-10-27,186.1903521,3.3852286735648534\n2015-10-28,185.83056398,3.2929397506524936\n2015-10-29,187.944319185,3.514131993709505\n2015-10-30,187.836382749,3.619842921149761\n2015-10-31,187.026859479,3.092135869309743\n2015-11-03,189.239556417,2.9920542870268036\n2015-11-04,189.7882333,2.9761674698951452\n2015-11-05,189.212572308,2.5270456185658787\n2015-11-06,189.023683545,1.8863601731920028\n2015-11-07,188.924741812,1.2048768572282569\n2015-11-10,187.161780024,-0.5199737762247167\n2015-11-11,187.593525768,-1.9539622959310066\n2015-11-12,186.855960122,-3.354457570718772\n2015-11-13,184.30146447,-5.705786662561039\n2015-11-14,182.169719859,-8.480291624662655\n2015-11-17,184.976067195,-9.130724045243909\n2015-11-18,184.75119962,-8.746872818842853\n2015-11-19,187.701462204,-6.643096507514386\n2015-11-20,187.575536362,-4.214286648196222\n2015-11-21,188.331091414,-1.7788328333790062\n2015-11-24,188.070245027,0.1330457274131902\n2015-11-25,188.322096711,1.6313322208521015\n2015-11-26,188.25913379,2.5040258499827956\n2015-11-28,188.466011959,2.808537388141133\n2015-12-01,187.710456907,2.2228394502364637\n2015-12-02,189.500402804,2.144703146670558\n2015-12-03,187.575536362,1.0269181235349976\n2015-12-04,184.913104274,-1.4456688522041503\n2015-12-05,188.582943098,-2.1519268637719904\n2015-12-08,187.332679381,-2.6412619523863796\n2015-12-09,186.181357397,-3.3167241021099443\n2015-12-10,184.688236699,-4.325724347422721\n2015-12-11,185.164955958,-4.798894407828065\n2015-12-12,181.585064164,-6.042276222001227\n2015-12-15,182.5924709,-6.445758002475976\n2015-12-16,184.445379718,-5.487468008324171\n2015-12-17,187.107811806,-3.29254150082879\n2015-12-18,184.265485658,-1.9866968966322958\n2015-12-19,180.98989718,-2.0187818344243595\n2015-12-22,182.5100603,-1.7853204227224637\n2015-12-23,184.19309804,-0.9135959958877322\n2015-12-24,186.44619695,0.695300117045619\n2015-12-25,186.08425335,1.8933375113619917\n2015-12-29,185.69516398,2.4244551719725536\n2015-12-30,187.6677566,3.201029272990816\n2015-12-31,186.33761387,3.4016252883771543\n2016-01-01,184.49170151,2.6452370898530546\n2016-01-05,181.88570759,0.7758558474075272\n2016-01-06,182.19335965,-1.0021888749933083\n2016-01-07,179.93121215,-3.0004571229735717\n2016-01-08,175.53359741,-5.4762339597020855\n2016-01-09,173.68768505,-7.678531459165029\n2016-01-12,173.83246249,-8.968707167692372\n2016-01-13,175.23499394,-8.663923507823561\n2016-01-14,170.90071933,-8.397648154097055\n2016-01-15,173.63339351,-6.774045122173213\n2016-01-16,169.95966597,-5.527603748568865\n2016-01-20,170.16778354,-4.316599422589739\n2016-01-21,168.13185079,-3.544245339816854\n2016-01-22,168.9371753,-2.672389812515746\n2016-01-23,172.42088245,-0.6684785433293285\n2016-01-26,169.77869417,0.6355677262742816\n2016-01-27,172.14037616,2.2265403748251273\n2016-01-28,170.24017226,2.993906508042926\n2016-01-29,171.17217703,3.610470990932207\n2016-01-30,175.42501433,5.145889322701166\n2016-02-02,175.22594535,6.352967135797279\n2016-02-03,172.02274449,6.079811599594535\n2016-02-04,173.03618657,5.438708026195002\n2016-02-05,173.30764427,4.764157884202696\n2016-02-06,170.09539482,3.2086146922141268\n2016-02-09,167.71561565,1.118141679347147\n2016-02-10,167.71561565,-0.7733528732893404\n2016-02-11,167.67942129,-2.2242507808411673\n2016-02-12,165.61634277,-3.5287492608119493\n2016-02-13,168.89193235,-3.0629313737261015\n2016-02-17,171.75128679,-1.1604552482239967\n2016-02-18,174.52015533,1.6085536721148443\n2016-02-19,173.77817095,3.846167119600537\n2016-02-20,173.732928,5.310512660783608\n2016-02-23,176.29367897,6.712473634184448\n2016-02-24,174.03153147,6.764581856078564\n2016-02-25,174.84590457,6.32051838821431\n2016-02-26,176.94517745,5.999936633878185\n2016-02-27,176.5379909,5.353270120248851\n2016-03-01,175.14450804,4.066271470461331\n2016-03-02,179.35210239,3.914052030044516\n2016-03-03,180.09408677,4.182677135395778\n2016-03-04,180.76368243,4.526109189393736\n2016-03-05,181.29754924,4.856170741864908\n2016-03-08,181.54186117,4.969811975551323\n2016-03-09,179.48783124,3.900248636794508\n2016-03-10,180.43793319,2.878425092942088\n2016-03-11,180.55556486,2.0113397036977716\n2016-03-12,183.46921084,2.012203238919078\n2016-03-15,183.26109327,2.1077488835402534\n2016-03-16,182.9624898,2.0076434783016595\n2016-03-17,184.03927201,2.1479267600725365\n2016-03-18,185.30607461,2.646065958598207\n2016-03-19,186.015500796,3.2881785387992295\n2016-03-22,186.170119587,3.6999511980866586\n2016-03-23,186.106453026,3.741024887894419\n2016-03-24,184.833121806,2.64771519379714\n2016-03-25,184.733074353,1.3251881231000624\n2016-03-29,184.878597921,0.22947343729451575\n2016-03-30,186.661261629,0.040765963700536645\n2016-03-31,187.45254603,0.40092675223293384\n2016-04-01,186.961403988,0.48482453424621497\n2016-04-02,188.189259093,0.9177712565156639\n2016-04-05,187.625355267,0.9549012715577732\n2016-04-06,185.669882322,-0.44264283360435286\n2016-04-07,187.779974058,-1.1575741644499544\n2016-04-08,185.442501747,-2.8459291125276565\n2016-04-09,185.979119904,-4.196446170370379\n2016-04-12,185.533453977,-5.234602774402987\n2016-04-13,187.352498577,-4.972584418836405\n2016-04-14,189.217019292,-3.5319541073512255\n2016-04-15,189.198828846,-1.8397967154235317\n2016-04-16,188.99873394,-0.4172203973874389\n2016-04-19,190.317541275,1.056722999359593\n2016-04-20,190.917825993,2.4552679239570523\n2016-04-21,191.063349561,3.4072721759983224\n2016-04-22,189.99920847,3.0525403677829246\n2016-04-23,190.053779808,2.1947627768824276\n2016-04-26,189.717256557,0.9958361594660659\n2016-04-27,190.0901607,0.11701955002234854\n2016-04-28,190.435779174,-0.309871780993781\n2016-04-29,188.653115466,-1.8993214794262556\n2016-04-30,187.63445049,-4.052254308153273\n2016-05-03,189.207924069,-4.814472025861072\n2016-05-04,187.479831699,-5.793667563025394\n2016-05-05,186.415690608,-6.977914805269158\n2016-05-06,186.406595385,-7.706210545014891\n2016-05-07,187.08873711,-7.42727915305214\n2016-05-10,187.261546347,-6.4803034513230315\n2016-05-11,189.599018658,-3.883080707822252\n2016-05-12,187.81635495,-2.298685097428617\n2016-05-13,187.861831065,-1.3005137488272993\n2016-05-14,186.197405256,-1.4594305664089404\n2016-05-17,188.098306863,-0.8557882602070919\n2016-05-18,186.288357486,-1.1044712873513731\n2016-05-19,186.370214493,-1.5596284596985441\n2016-05-20,185.760834552,-2.261294481978595\n2016-05-21,186.897737427,-2.181183421102922\n2016-05-24,186.597595068,-1.8407293401813973\n2016-05-25,189.062400501,-0.14254100158079552\n2016-05-26,190.326636498,2.1659595076949785\n2016-05-27,190.399398282,4.047212413229893\n2016-05-28,191.190682683,5.657152914171874\n2016-06-01,191.072444784,6.522732637758651\n2016-06-02,191.27253969,6.800801572491345\n2016-06-03,191.836443516,6.762656903009955\n2016-06-04,191.254349244,5.872378696719871\n2016-06-07,192.263918997,5.088552436819747\n2016-06-08,192.54587091,4.4528960184123605\n2016-06-09,193.173441297,4.163974978177869\n2016-06-10,192.855108492,3.6134160929759744\n2016-06-11,191.026968669,1.5217935822917212\n2016-06-14,189.562637766,-1.570889107057738\n2016-06-15,189.262495407,-4.40841157976147\n2016-06-16,188.980543494,-6.552127837269545\n2016-06-17,189.498971205,-7.455394596962947\n2016-06-18,188.822406942,-7.95435708965902\n2016-06-21,190.084087674,-6.978652541638162\n2016-06-22,190.541218374,-5.091174166068896\n2016-06-23,190.193799042,-3.264705065741879\n2016-06-24,192.790301418,-0.21335765987253552\n2016-06-25,185.713918182,-1.0038312452916713\n2016-06-28,182.422577142,-3.6891290491489173\n2016-06-29,185.796201708,-4.794650835696842\n2016-06-30,188.986973994,-3.9426556889356803\n2016-07-01,191.565191142,-1.8970945062771918\n2016-07-02,191.802899106,0.20621875120565392\n2016-07-06,190.522933146,1.4809650537970498\n2016-07-07,191.784613878,2.6462339035267988\n2016-07-08,191.574333756,3.6240847621934904\n2016-07-09,194.46339978,4.934176501625281\n2016-07-12,195.14909583,5.799086247386342\n2016-07-13,196.566201,6.3871347243847865\n2016-07-14,196.502202702,6.491524430043583\n2016-07-15,197.581031154,6.545761082287164\n2016-07-16,197.334180576,6.252488286054849\n2016-07-19,197.855309574,5.811494054990938\n2016-07-20,197.645029452,5.068576762930256\n2016-07-21,198.513577782,4.424505675738537\n2016-07-22,197.681599908,3.27984731640575\n2016-07-23,198.62328915,2.4434983986222747\n2016-07-26,198.065589696,1.4628798671049879\n2016-07-27,198.16615845,0.647167491718605\n2016-07-28,197.946735714,-0.08847585531376012\n2016-07-29,198.21187152,-0.5138322158406297\n2016-07-30,198.53186301,-0.5717563076521799\n2016-08-02,198.330725502,-0.6470829586219367\n2016-08-03,197.041616928,-1.6529902986538758\n2016-08-04,197.690742522,-2.311406411086395\n2016-08-05,197.873594802,-2.514432362427854\n2016-08-06,199.436981796,-1.6700754012930048\n2016-08-09,199.35469827,-0.7101403267294017\n2016-08-10,199.510122708,0.17469260098678063\n2016-08-11,198.970708482,0.3541545479299799\n2016-08-12,199.930682952,0.8443218307700775\n2016-08-13,199.683832374,1.0857282832925748\n2016-08-16,200.305530126,1.4156079601366756\n2016-08-17,199.272414744,0.6089974466484094\n2016-08-18,199.656404532,-0.197683019853109\n2016-08-19,200.13182046,-0.504923555385318\n2016-08-20,199.820971584,-0.8726440068545287\n2016-08-23,199.775258514,-1.1650043148800506\n2016-08-24,200.159248302,-1.0900349354478749\n2016-08-25,199.199273832,-1.8538778458543987\n2016-08-26,198.998136324,-2.815274391135169\n2016-08-27,198.650716992,-3.8056544409615256\n2016-08-30,199.619834076,-3.6830160266624006\n2016-08-31,199.290699972,-3.482862864108945\n2016-09-01,198.796998816,-3.6396979396143223\n2016-09-02,198.733000518,-3.786555312862774\n2016-09-03,199.638119304,-2.9125270395171086\n2016-09-07,200.305530126,-1.2121335840085834\n2016-09-08,200.232389214,0.3017378721803894\n2016-09-09,199.775258514,0.8551318345156318\n2016-09-10,195.030241848,-2.4512260612602077\n2016-09-13,197.84616696,-4.014681473891827\n2016-09-14,194.957100936,-5.882894195740555\n2016-09-15,194.87481741,-7.3291081581440665\n2016-09-16,196.822194192,-6.997727939196196\n2016-09-17,196.06868018,-6.269132396294154\n2016-09-20,196.10543674,-5.200048233862077\n2016-09-21,196.11462588,-3.8956229655926364\n2016-09-22,198.32001948,-1.223364919439561\n2016-09-23,199.56974252,1.7092908728044378\n2016-09-24,198.47623486,3.438111833553336\n2016-09-27,196.86813536,3.3984253044505053\n2016-09-28,198.09029098,3.244746013773387\n2016-09-29,199.07352896,3.4533417807438695\n2016-09-30,197.27245752,2.6448903087885114\n2016-10-01,198.7610982,2.2567246647258514\n2016-10-04,198.28326292,1.6668279738532519\n2016-10-05,197.27245752,0.6365222930071468\n2016-10-06,198.14542582,0.23402496543534568\n2016-10-07,198.28326292,0.2051656189470208\n2016-10-08,197.60326656,-0.14859832926556038\n2016-10-11,198.63245024,0.04697291471414644\n2016-10-12,196.12381502,-0.8371676975774776\n2016-10-13,196.38111094,-1.7146179178321646\n2016-10-14,195.73787114,-2.6012325777143843\n2016-10-15,195.83895168,-3.127905096230492\n2016-10-18,195.15895532,-3.7004480912947173\n2016-10-19,196.38111094,-3.216438070631881\n2016-10-20,196.90489192,-2.0523556585544114\n2016-10-21,196.53732632,-1.0689700531546436\n2016-10-22,196.62921772,-0.1499252485277509\n2016-10-25,197.46542946,1.0864679770224654\n2016-10-26,196.80381138,1.6615119845248714\n2016-10-27,196.40867836,1.5605507295621734\n2016-10-28,195.88489738,0.8518503611399098\n2016-10-29,195.30598156,-0.3638572247910119\n2016-11-01,195.3151707,-1.4539535696490873\n2016-11-02,193.90004314,-3.036144449513422\n2016-11-03,192.73302236,-4.893433922593502\n2016-11-04,191.85086492,-6.637322267419094\n2016-11-05,191.6395147,-7.7434726459782866\n2016-11-08,195.8665191,-4.92242987262388\n2016-11-09,196.74867654,-0.8713157249151209\n2016-11-10,198.88974616,3.7161485445633886\n2016-11-11,199.33082488,7.55576709490078\n2016-11-12,198.87136788,9.838001319828756\n2016-11-15,199.02758326,10.862610209260467\n2016-11-16,200.58054792,11.461282739218994\n2016-11-17,200.20379318,10.896461182759111\n2016-11-18,201.23297686,9.850817045893088\n2016-11-19,200.782709,8.193885782236066\n2016-11-22,202.2989171,7.0555281012427145\n2016-11-23,202.69405012,6.298003347383606\n2016-11-24,202.8043198,5.709174969368988\n2016-11-26,203.55782928,5.398266276500202\n2016-11-29,202.60215872,4.189285060747821\n2016-11-30,202.99729174,3.051385688156813\n2016-12-01,202.51026732,1.6295857435450074\n2016-12-02,201.76594698,-0.24078026475056902\n2016-12-03,201.86702752,-1.8125944375281833\n2016-12-06,203.079994,-2.205787626160216\n2016-12-07,203.7232338,-1.7385809316199712\n2016-12-08,206.3880844,0.04144706924473951\n2016-12-09,206.8934871,2.078719382441122\n2016-12-10,208.14321014,4.064502304931878\n2016-12-13,207.9042925,5.276599779982789\n2016-12-14,209.29185264,6.210425668220836\n2016-12-15,207.56429432,5.039397307828835\n2016-12-16,208.41888434,3.5113991185357065\n2016-12-17,208.012190872,1.6744773097908734\n2016-12-20,208.465114679,0.18745569205376\n2016-12-21,209.26928552,-0.5516110661758233\n2016-12-22,208.686954911,-1.372472703087297\n2016-12-23,208.326464534,-2.226969198566451\n2016-12-24,208.631494853,-2.621479880457315\n2016-12-28,209.149122061,-2.336617156871924\n2016-12-29,207.42061692,-3.3784815130090777\n2016-12-30,207.374400205,-4.499720137770026\n2016-12-31,206.616446079,-5.872031701281983\n2017-01-04,208.197057732,-5.877147124376819\n2017-01-05,209.435665694,-4.606828953554427\n2017-01-06,209.26928552,-3.1969550118555077\n2017-01-07,210.017996303,-1.5688599069822757\n2017-01-10,209.324745578,-0.7276879082166872\n2017-01-11,209.324745578,-0.16718108944776588\n2017-01-12,209.91631953,0.4706708934726862\n2017-01-13,209.389448979,0.4182799376608273\n2017-01-14,209.870102815,0.3082784208165421\n2017-01-18,209.130635375,-0.5429103423727284\n2017-01-19,209.592802525,-1.0768447238570147\n2017-01-20,208.816361713,-2.0624100260130547\n2017-01-21,209.583559182,-2.309582230011138\n2017-01-24,209.038201945,-2.704878755516205\n2017-01-25,210.37848668,-2.0953311869221594\n2017-01-26,212.199425251,-0.2728578887173043\n2017-01-27,211.977585019,1.3172517580319578\n2017-01-28,211.644824671,2.184564368054147\n2017-01-31,210.332269965,1.4149135594325557\n2017-02-01,210.313783279,0.27981618911891104\n2017-02-02,210.396973366,-0.750515384630134\n2017-02-03,210.535623511,-1.4351502778687788\n2017-02-04,211.986828362,-0.9789437877959557\n2017-02-07,211.607851299,-0.6403159737387298\n2017-02-08,211.617094642,-0.2728444564913275\n2017-02-09,211.894394932,0.3254657910493606\n2017-02-10,213.15148958,1.7049657384412669\n2017-02-11,213.992633793,3.3421265496787314\n2017-02-14,215.157295011,5.04797150950975\n2017-02-15,216.01692591,6.501484147747163\n2017-02-16,217.144613756,7.658607965785087\n2017-02-17,216.959746896,8.019736165423993\n2017-02-18,217.301750587,7.873384923975138\n2017-02-22,218.595818607,7.681191436529886\n2017-02-23,218.401708404,6.915090778228887\n2017-02-24,218.549601892,5.916500029549155\n2017-02-25,218.826902182,4.932905596494493\n2017-02-28,219.168905873,4.120121586314042\n2017-03-01,218.577331921,2.5588409123725597\n2017-03-02,221.636878454,2.1051373627863086\n2017-03-03,220.241133661,0.5158298868244344\n2017-03-04,220.379783806,-1.0262699795921577\n2017-03-07,219.723506453,-2.80499948848788\n2017-03-08,219.0672291,-4.788495488512467\n2017-03-09,218.660522008,-6.596471073007905\n2017-03-10,218.937822298,-7.5318069920794954\n2017-03-11,219.705019767,-7.241308769061391\n2017-03-14,219.815939883,-6.344980085363986\n2017-03-15,218.97479567,-5.96193757918482\n2017-03-16,220.869680985,-4.527489508432268\n2017-03-17,220.435243864,-3.297464446888867\n2017-03-18,220.054598787,-2.632174882254688\n2017-03-21,219.813219233,-2.459632783870717\n2017-03-22,216.990935217,-4.623779202618536\n2017-03-23,217.501545812,-6.529978194731129\n2017-03-24,217.269450087,-7.865370704117474\n2017-03-25,217.111624994,-8.548490605872942\n2017-03-28,216.888813098,-8.806404628938566\n2017-03-29,218.467064028,-7.256518227515308\n2017-03-30,218.671308266,-5.020876609890919\n2017-03-31,219.367595441,-2.319552216977243\n2017-04-01,218.856984846,-0.31113551498464176\n2017-04-04,218.476347857,0.6394356078891548\n2017-04-05,218.615605292,1.1095682269198903\n2017-04-06,217.965737262,0.6548210090939719\n2017-04-07,218.578469976,0.4310967410063995\n2017-04-08,218.35565808,-0.02299132925663372\n2017-04-11,218.485631686,-0.32253675928859593\n2017-04-12,218.225684474,-0.7400646475961636\n2017-04-13,217.269450087,-1.8752291835410304\n2017-04-14,215.858308079,-3.912730660799099\n2017-04-18,217.770776853,-3.896869019859338\n2017-04-19,217.120908823,-3.5928472009288726\n2017-04-20,216.721704176,-3.4606508448223963\n2017-04-21,218.485631686,-1.9040162172131474\n2017-04-22,217.789344511,-0.6746058051984463\n2017-04-25,220.184572393,1.7217314647288902\n2017-04-26,221.465740795,4.540711515869134\n2017-04-27,221.32648336,6.568574126314324\n2017-04-28,221.51215994,7.615278180985072\n2017-04-29,221.029400832,7.485732435007733\n2017-05-02,221.586430572,7.016040433355499\n2017-05-03,221.669985033,6.213940263053075\n2017-05-04,221.400753992,4.993966077307732\n2017-05-05,221.660701204,3.7881556070492834\n2017-05-06,222.53338113,3.2520154264367918\n2017-05-09,222.496245814,2.94540987790387\n2017-05-10,222.292001576,2.4794836570674548\n2017-05-11,222.691206223,2.289556856981399\n2017-05-12,222.236298602,1.5800213776675776\n2017-05-13,221.864945442,0.39394797722502517\n2017-05-16,223.09041087,0.19362774434293328\n2017-05-17,222.886166632,0.04400497290540528\n2017-05-18,218.931255478,-3.3110072644127015\n2017-05-19,219.813219233,-6.063440222025264\n2017-05-20,221.242928899,-6.852429007062497\n2017-05-23,222.366272208,-6.001335298990902\n2017-05-24,222.858315145,-4.31510629406656\n2017-05-25,223.378209569,-2.2916228945325727\n2017-05-26,224.445849904,0.011783654573775948\n2017-05-27,224.399430759,2.0052795299654917\n2017-05-31,224.20447035,3.3833442246324097\n2017-06-01,224.148767376,3.88723678329238\n2017-06-02,225.931262544,4.638864572582172\n2017-06-03,226.683252693,5.3785488066111\n2017-06-06,226.516143771,5.56534716732282\n2017-06-07,225.792005109,4.6099430401643104\n2017-06-08,226.209777414,3.5783594998908796\n2017-06-09,226.321183362,2.7153560751168087\n2017-06-10,225.977681689,1.6273057978047376\n2017-06-13,225.931262544,0.5676857121536045\n2017-06-14,227.036038195,0.3395718693806913\n2017-06-15,226.748239496,0.09392220806618923\n2017-06-16,226.311899533,-0.5340423405350947\n2017-06-17,226.358540568,-1.0212513931517435\n2017-06-20,228.242995942,-0.20204757702443032\n2017-06-21,226.703713087,-0.7563234674768466\n2017-06-22,226.647739165,-1.6015981962825663\n2017-06-23,226.545120308,-2.418116427193148\n2017-06-24,226.815660931,-2.7989631354619533\n2017-06-27,226.964924723,-2.707668173973218\n2017-06-28,225.136443271,-4.147019055964115\n2017-06-29,227.151504463,-4.155711942287034\n2017-06-30,225.155101245,-5.0637181696502935\n2017-07-01,225.57490566,-5.437870947992771\n2017-07-04,225.957394127,-5.148156822949559\n2017-07-06,226.479817399,-4.21074189280521\n2017-07-07,224.408782285,-4.528187552672662\n2017-07-08,225.864104257,-4.001926204209923\n2017-07-11,226.106657919,-2.968078038109411\n2017-07-12,225.938736153,-2.12399760533507\n2017-07-13,227.636611787,-0.3599373177562768\n2017-07-14,228.019100254,1.4359900163347348\n2017-07-15,229.082604772,3.3029266859173205\n2017-07-18,229.054617811,4.6512430004976295\n2017-07-19,229.175894642,5.504149278165741\n2017-07-20,230.416649913,6.320097771670426\n2017-07-21,230.51926877,6.73345634523146\n2017-07-22,230.314031056,6.44082714810876\n2017-07-25,230.258057134,5.623026028838389\n2017-07-26,230.817796354,4.933138802029781\n2017-07-27,230.827125341,4.247174596747271\n2017-07-28,230.61255864,3.3114039501826227\n2017-07-29,230.342018017,2.039134061261052\n2017-08-01,230.211412199,0.6851209217889931\n2017-08-02,230.724506484,0.004821029487388273\n2017-08-03,230.836454328,-0.20928034302177423\n2017-08-04,230.388662952,-0.8695621626482364\n2017-08-05,230.808467367,-1.1352090067052103\n2017-08-08,231.237600769,-0.808757258387871\n2017-08-09,230.668532562,-1.1325138817124554\n2017-08-10,230.659203575,-1.5290609669007296\n2017-08-11,227.403387112,-5.043198038900577\n2017-08-12,227.739230644,-8.223328450622915\n2017-08-15,229.996845498,-8.433816638604213\n2017-08-16,229.968858537,-7.418791218028282\n2017-08-17,230.370004978,-5.727804597383432\n2017-08-18,226.778344983,-6.3516338541782105\n2017-08-19,226.423843477,-7.321711842899489\n2017-08-22,226.60109423,-7.6841430097333046\n2017-08-23,228.970656928,-5.714481082612217\n2017-08-24,228.149706072,-3.999347888875448\n2017-08-25,227.617953813,-3.070725231249419\n2017-08-26,228.149706072,-2.03571244630281\n2017-08-29,228.159035059,-1.0172957939930427\n2017-08-30,228.420246695,0.16678283233321167\n2017-08-31,229.502409187,1.782954532977861\n2017-09-01,230.883099263,3.798507765825761\n2017-09-02,231.209613808,5.413046329628038\n2017-09-06,229.549054122,5.172594062478069\n2017-09-07,230.33268903,4.730725930209985\n2017-09-08,230.304702069,4.0857874778397445\n2017-09-09,230.034161446,3.127706559868429\n2017-09-12,232.487685027,3.486084903689644\n2017-09-13,233.271319935,4.31521753271636\n2017-09-14,233.383267779,5.001633030792888\n2017-09-15,233.308635883,5.341305868311288\n2017-09-16,233.618017224,5.579352532181488\n2017-09-19,234.114897312,5.729364351469101\n2017-09-20,234.349274712,5.706785791407\n2017-09-21,234.433650576,5.421954930676613\n2017-09-22,233.805519144,4.084578672672684\n2017-09-23,233.852394624,2.627851504759498\n2017-09-26,233.374264728,0.8322446508797441\n2017-09-27,233.514891168,-0.5757163758960075\n2017-09-28,234.42427548,-0.9040144051343333\n2017-09-29,234.70552836,-0.6219212216584538\n2017-09-30,235.530536808,0.33746827626660547\n2017-10-03,236.552422272,1.8622441432673469\n2017-10-04,237.058677456,3.46630354443505\n2017-10-05,237.339930336,4.748147346148002\n2017-10-06,238.746194736,6.040955573753919\n2017-10-07,238.474316952,6.385605696281132\n2017-10-10,238.08056292,5.515093835062345\n2017-10-11,238.708694352,4.525237126904486\n2017-10-12,239.083698192,3.6621887473321237\n2017-10-13,238.727444544,2.35041484188109\n2017-10-14,239.01807252,1.2658188966035482\n2017-10-17,239.336825784,0.6192350829525566\n2017-10-18,239.505577512,0.32757365817795403\n2017-10-19,239.739954912,0.397470622716412\n2017-10-20,239.805580584,0.621717457984218\n2017-10-21,241.043093256,1.381044505024093\n2017-10-24,240.105583656,0.6038445917890556\n2017-10-25,240.527462976,-0.20591213158347443\n2017-10-26,239.336825784,-2.4607960713481702\n2017-10-27,239.646203952,-4.369771997684538\n2017-10-28,241.605599016,-4.478991587145785\n2017-10-31,240.7055898,-4.882380856087522\n2017-11-01,241.08059364,-4.870631670467347\n2017-11-02,241.399346904,-4.331909228354419\n2017-11-03,241.493097864,-3.3933764711470786\n2017-11-04,242.29935612,-1.9574695611460413\n2017-11-07,242.67435996,-0.3588576148762712\n2017-11-08,242.505608232,0.6155818031751608\n2017-11-09,242.918112456,1.327072754902204\n2017-11-10,242.036853432,0.6499834958881365\n2017-11-11,241.961852664,-0.46387126859360706\n2017-11-14,242.186854968,-1.3229851281938636\n2017-11-15,241.624349208,-2.6463334050973373\n2017-11-16,240.414961824,-5.0979433905433496\n2017-11-17,242.458732752,-5.559922557795332\n2017-11-18,241.746225456,-5.765823800174559\n2017-11-21,242.15872968,-5.309618729106184\n2017-11-22,243.743120904,-3.502261078376911\n2017-11-23,243.527493696,-1.7791344723597078\n2017-11-25,244.089999456,-0.05471146599377619\n2017-11-28,243.968123208,1.2288434181059813\n2017-11-29,246.443148552,3.248497323133435\n2017-11-30,246.293147016,4.60335187963851\n2017-12-01,248.449419096,6.090031608326328\n2017-12-02,247.933788816,6.47263947360301\n2017-12-05,247.633785744,5.842974400976544\n2017-12-06,246.743151624,3.9954296421198165\n2017-12-07,246.790027104,2.0352278013796337\n2017-12-08,247.568160072,0.7484933614420441\n2017-12-09,248.918173896,0.41725275876083856\n2017-12-12,249.668181576,0.7541775515109919\n2017-12-13,250.108811088,1.372939648577315\n2017-12-14,250.0806858,1.98236358880348\n2017-12-15,249.058800336,1.3298709760317138\n2017-12-16,251.141354387,1.3142625553868044\n2017-12-19,252.73389834,1.8824313325524002\n2017-12-20,251.763294629,1.4480430835729408\n2017-12-21,251.631367911,0.5876740149556099\n2017-12-22,252.149651446,-0.023818565834588412\n2017-12-23,252.083688087,-0.4635661813758247\n2017-12-27,251.782141303,-1.005965093927088\n2017-12-28,251.904644684,-1.3157261117005987\n2017-12-29,252.422928219,-1.2745892514445671\n2017-12-30,251.471171182,-2.11891496224483\n2018-01-03,253.271028549,-1.979981169968113\n2018-01-04,254.872995839,-0.9040027830982211\n2018-01-05,255.947256257,0.5775157269204669\n2018-01-06,257.652880254,2.322025908290371\n2018-01-09,258.124047104,3.818482949670525\n2018-01-10,258.708293998,4.909704131303982\n2018-01-11,258.312513844,5.043331362876515\n2018-01-12,260.197181244,5.1701459979017415\n2018-01-13,261.893381904,5.284707684414826\n2018-01-17,260.998164889,4.274892044395628\n2018-01-18,263.485925857,3.5141320413733723\n2018-01-19,263.043029018,2.4811219868360297\n2018-01-20,264.239792817,1.784615479683353\n2018-01-23,266.388313653,1.6874321335809412\n2018-01-24,266.953713873,1.8520218985648995\n2018-01-25,266.850057166,1.8758850584018063\n2018-01-26,266.96313721,1.832644346194499\n2018-01-27,270.053991746,2.258952105752144\n2018-01-30,268.263557716,1.160985262952849\n2018-01-31,265.511943312,-1.9707890462533015\n2018-02-01,265.64387003,-4.954201717876984\n2018-02-02,265.342323246,-7.28938282968943\n2018-02-03,259.565817665,-11.376199565770477\n2018-02-06,248.710133441,-17.14605447788169\n2018-02-07,253.610268681,-19.917295039798326\n2018-02-08,252.234461479,-20.668311482519442\n2018-02-09,242.773431131,-21.09141752609152\n2018-02-10,246.42026255,-19.462453581839306\n2018-02-13,250.038823958,-16.00801945988615\n2018-02-14,250.6607642,-11.92600766833457\n2018-02-15,254.043742183,-7.155612537973148\n2018-02-16,257.285370111,-2.3262633268776867\n2018-02-17,257.360756807,1.318267695575578\n2018-02-21,255.74936618,3.395528415589162\n2018-02-22,254.477215685,4.126166227737109\n2018-02-23,254.80703248,4.020551639487309\n2018-02-24,258.868490727,4.342739933313474\n2018-02-27,261.87453523,5.102847600705324\n2018-02-28,258.604637291,4.785218511626326\n2018-03-01,255.984949605,3.4773800072188195\n2018-03-02,252.26273149,1.3687888479103734\n2018-03-03,253.563151996,-0.2067260488798084\n2018-03-06,256.493809803,-0.6242645808246863\n2018-03-07,257.144020056,-0.5001889217539741\n2018-03-08,257.049786686,-0.302003050169219\n2018-03-09,258.29366717,0.23809900807968631\n2018-03-10,262.788598919,1.8445471737028285\n2018-03-13,262.458782124,3.3176794720046914\n2018-03-14,260.762581464,3.8242164773285694\n2018-03-15,259.42446761,3.3314226064282835\n2018-03-16,259.1417675,2.3744091374146734\n2018-03-17,259.42561044,1.4585243093060356\n2018-03-20,255.915511918,-0.32473508854499045\n2018-03-21,256.35072629,-1.877305657735846\n2018-03-22,255.858744826,-3.123561185266624\n2018-03-23,249.462985794,-5.310737539984579\n2018-03-24,244.14580151,-7.902105607240443\n2018-03-27,250.825396002,-7.8571335644302\n2018-03-28,246.55840292,-7.455463122633191\n2018-03-29,245.829891906,-6.847118773094529\n2018-03-30,248.97100433,-5.193631436713993\n2018-04-03,243.597052954,-4.254669107946135\n2018-04-04,246.719243014,-2.7908388521313015\n2018-04-05,249.358912792,-0.7423607477146561\n2018-04-06,251.326838648,1.3902174304436272\n2018-04-07,245.725818904,1.8967512717578217\n2018-04-10,246.9368502,2.055060472811057\n2018-04-11,250.86324073,2.7654355307891834\n2018-04-12,249.548136432,3.0824986166465536\n2018-04-13,251.601212926,3.5408582167330493\n2018-04-14,250.86324073,3.5736817996381305\n2018-04-17,252.925778406,3.75220422182111\n2018-04-18,255.631676458,4.360157315757888\n2018-04-19,255.820900098,4.912248243374464\n2018-04-20,254.401722798,4.736096946934168\n2018-04-21,252.244573302,3.6404946060581125\n2018-04-24,252.206728574,2.394989209363942\n2018-04-25,248.810164236,0.46543733587726166\n2018-04-26,249.425141066,-1.0966953931591732\n2018-04-27,251.960737842,-1.5383814246766008\n2018-04-28,252.197267392,-1.4365751690615909\n2018-05-01,250.257725082,-1.5910799587543707\n2018-05-02,250.702400636,-1.5127703725630823\n2018-05-03,249.01831024,-1.7208997935757253\n2018-05-04,248.469561684,-2.042859255916369\n2018-05-05,251.686363564,-1.236544346337304\n2018-05-08,252.537869944,-0.0610095269400972\n2018-05-09,252.537869944,0.916909455943582\n2018-05-10,254.9788549,2.328240845888473\n2018-05-11,257.363072764,4.130336449127917\n2018-05-12,258.14835087,5.6889255962824095\n2018-05-15,258.271346236,6.669320469235267\n2018-05-16,256.49264402,6.2363994219322905\n2018-05-17,257.571218768,5.454294656207772\n2018-05-18,257.353611582,4.425525946782031\n2018-05-19,256.710251206,3.076944130372418\n2018-05-22,258.640332334,2.3536143871131685\n2018-05-23,257.921282502,1.5502750594641768\n2018-05-24,258.630871152,1.1202107545287916\n2018-05-25,258.10104496,0.6590753759794623\n2018-05-26,257.48606813,0.029045607601958068\n2018-05-30,254.524718164,-1.8318256548758782\n2018-05-31,257.921282502,-2.3417751815286962\n2018-06-01,256.341265108,-2.8828425652322807\n2018-06-02,258.85793952,-2.4484414128264262\n2018-06-05,260.08789318,-1.3386310698756532\n2018-06-06,260.27711682,-0.14960960770159204\n2018-06-07,262.45318868,1.4753762429455577\n2018-06-08,262.424805134,2.859024398682614\n2018-06-09,263.200622058,4.007424660215676\n2018-06-12,263.550685792,4.656261828399835\n2018-06-13,263.891288344,4.943146977409413\n2018-06-14,263.049243146,4.286868734864257\n2018-06-15,263.711525886,3.5313712077371804\n2018-06-16,263.378892539,2.5634321287049175\n2018-06-19,262.837175768,1.2774129126361515\n2018-06-20,261.82977265,-0.46568264476139376\n2018-06-21,262.276451391,-1.741216696896835\n2018-06-22,260.632293472,-3.47971437755443\n2018-06-23,261.107483622,-4.581260539733009\n2018-06-26,257.5530613,-6.7255734226796235\n2018-06-27,258.12328948,-8.162466494481862\n2018-06-28,255.984933805,-9.558935424121515\n2018-06-29,257.448519467,-9.483529604645092\n2018-06-30,257.819167784,-8.420120541565694\n2018-07-03,258.370388358,-6.700128519880238\n2018-07-04,257.45802327,-5.242590816119609\n2018-07-06,259.558363733,-2.9323345749434395\n2018-07-07,261.753742226,0.21535942606681147\n2018-07-10,264.11068537,3.630047541718497\n2018-07-11,265.06106567,6.508347792015101\n2018-07-12,263.122289858,7.268525553394305\n2018-07-13,265.507744411,7.673713708889352\n2018-07-14,265.716828077,7.622780933579939\n2018-07-17,265.479233002,6.998391511842399\n2018-07-18,266.553162741,6.287844611155677\n2018-07-19,267.113887118,5.589243787382216\n2018-07-20,266.106484,4.256300265292467\n2018-07-21,265.802362304,2.7688655527928603\n2018-07-24,266.29656006,1.7379543984550097\n2018-07-25,267.636596283,1.4440060637525747\n2018-07-26,269.917509003,2.10522570632822\n2018-07-27,269.280754202,2.4358476425510247\n2018-07-28,267.456024026,1.4194125513896836\n2018-07-31,266.058964985,-0.5224985525683863\n2018-08-01,267.370489799,-1.7318298206550224\n2018-08-02,266.923811058,-2.6685798000865617\n2018-08-03,268.377892917,-2.7238331134730345\n2018-08-04,269.52785308,-2.043689419965915\n2018-08-07,270.516248592,-0.8665427860738859\n2018-08-08,271.409606074,0.6475868442718564\n2018-08-09,271.295560438,1.9426850932231758\n2018-08-10,270.924912121,2.561281345186565\n2018-08-11,269.109685748,1.4969030168392123\n2018-08-14,268.10228263,-0.5023858102005008\n2018-08-15,269.81296717,-1.668361082426479\n2018-08-16,267.798160934,-3.382819261239298\n2018-08-17,269.965028018,-3.887021965819649\n2018-08-18,270.915408318,-3.40598845865582\n2018-08-21,271.495140301,-2.325928988088201\n2018-08-22,272.131895102,-0.8909231439100083\n2018-08-23,271.970330451,0.3702558972666594\n2018-08-24,271.609185937,1.0452380297994353\n2018-08-25,273.243840053,1.922173421193996\n2018-08-28,275.401203334,3.305147347698494\n2018-08-29,275.534256576,4.331805036561583\n2018-08-30,277.016849844,5.268546681722924\n2018-08-31,275.89540109,4.998104871425973\n2018-09-01,275.904904893,4.258548636377498\n2018-09-05,275.429714743,3.0547817720018173\n2018-09-06,274.688418109,1.3127072697374587\n2018-09-07,273.861587248,-0.9002866856924925\n2018-09-08,273.32937428,-3.12158120555371\n2018-09-11,273.80456443,-4.463476175392479\n2018-09-12,274.707425715,-4.596200034524379\n2018-09-13,274.773952336,-4.038069046421313\n2018-09-14,276.399102649,-2.4513898364891133\n2018-09-15,276.446621664,-0.730004726827147\n2018-09-18,274.983036002,-0.42024722698841543\n2018-09-19,276.475133073,0.15703037611867643\n2018-09-20,276.769750966,0.7680500446054026\n2018-09-21,279.012648474,2.0212007254739675\n2018-09-22,278.764429746,2.8500466851278077\n2018-09-25,277.838365508,2.5247317647949004\n2018-09-26,277.58059505,1.616785748535925\n2018-09-27,276.750001352,0.10571749403775499\n2018-09-28,277.523312726,-0.8099002116779133\n2018-09-29,277.551953888,-1.4083200483267788\n2018-10-02,278.516206342,-1.2701307581918257\n2018-10-03,278.353906424,-1.0575008532338543\n2018-10-04,278.506659288,-0.6501073035738116\n2018-10-05,276.329930976,-1.922458854576412\n2018-10-06,274.783308228,-4.28442140029162\n2018-10-09,274.783308228,-6.302802875649839\n2018-10-10,274.38233196,-7.8785007331565\n2018-10-11,265.69451282,-11.6877616861385\n2018-10-12,259.842168718,-15.791249204211347\n2018-10-13,263.45095513,-16.71655096303987\n2018-10-16,261.97116176,-16.062983146586873\n2018-10-17,267.69939416,-12.20799739127321\n2018-10-18,267.74712943,-7.733598039662468\n2018-10-19,263.88057256,-4.574431184119064\n2018-10-20,263.73736675,-2.246960096804422\n2018-10-23,262.553532054,-0.6918022805030475\n2018-10-24,261.216944494,-0.12440015700557439\n2018-10-25,253.302436728,-1.4712177809744063\n2018-10-26,257.846834432,-1.6532386651940385\n2018-10-27,253.311983782,-2.1916789407973027\n2018-10-30,251.908566844,-2.7244728294670537\n2018-10-31,255.641464958,-1.8444555025246459\n2018-11-01,258.371922402,0.06723668707491015\n2018-11-02,261.121473954,2.5682796475617735\n2018-11-03,259.574851206,4.349623510625136\n2018-11-06,261.006909306,5.741557186805657\n2018-11-07,262.658549648,6.770108746237689\n2018-11-08,268.281764454,8.410986538194344\n2018-11-09,267.7948647,9.380252124719028\n2018-11-10,265.178971904,8.850861390260974\n2018-11-13,260.224050878,6.615324454497298\n2018-11-14,259.737151124,4.027700685458427\n2018-11-15,257.96139908,1.445988280340174\n2018-11-16,260.653668308,0.0029135716136607925\n2018-11-17,261.331509142,-0.6613733825562917\n2018-11-20,256.91122314,-1.822834942054918\n2018-11-21,252.156790248,-3.4620946129752284\n2018-11-22,253.016025108,-4.394081858713072\n2018-11-24,251.32619655,-4.951411853129947\n2018-11-27,255.3836945,-4.0579919894649095\n2018-11-28,256.24292936,-2.6000379769644084\n2018-11-29,262.143008732,0.03728505001941329\n2018-11-30,261.570185492,2.3757064566405433\n2018-12-01,263.16454351,4.459512372101386\n2018-12-04,266.64921822,6.52731247061385\n2018-12-05,258.00913435,6.020800375315098\n2018-12-07,257.617705136,4.503455284953375\n2018-12-08,251.631702278,1.741236416767137\n2018-12-11,252.109054978,-0.8077214249573075\n2018-12-12,252.166337302,-2.7731941993375457\n2018-12-13,253.436095484,-3.670556214731043\n2018-12-14,253.350171998,-3.900893364090699\n2018-12-15,248.672115538,-4.479982550704932\n2018-12-18,243.793570944,-5.3775228032613285\n2018-12-19,243.526253432,-5.998382160157107\n2018-12-20,239.879278804,-6.6306736925645\n2018-12-21,235.974533718,-7.397780952870832\n2018-12-22,231.13990147,-8.27255967629813\n2018-12-25,225.032507314,-9.181009423489755\n2018-12-27,236.402247378,-6.8865672400428295\n2018-12-28,238.217180547,-3.46877043420972\n2018-12-29,237.909890275,-0.3328911496322817\n2019-01-01,239.993702432,2.4700699959277586\n2019-01-03,240.243375778,4.558066532602368\n2019-01-04,234.510491641,5.0046871086896445\n2019-01-05,242.365599219,6.101065909067778\n2019-01-08,244.276560598,7.094076850609227\n2019-01-09,246.571634817,7.708099285985419\n2019-01-10,247.723973337,8.012845831720831\n2019-01-11,248.597830048,8.061529703812681\n2019-01-12,248.693858258,7.7640666140839585\n2019-01-15,247.17661254,6.862867866118691\n2019-01-16,250.009444735,6.26694664600037\n2019-01-17,250.614422458,5.643094283591708\n2019-01-18,252.515781016,5.2942613566066825\n2019-01-19,255.876768366,5.4926026043382805\n2019-01-23,252.419752806,4.78134375721455\n2019-01-24,252.947907961,3.914833997030385\n2019-01-25,253.082347455,3.105150141123751\n2019-01-26,255.223776538,2.8034956345372564\n2019-01-29,253.284006696,2.0268335074366632\n2019-01-30,252.947907961,1.1062769850933307\n2019-01-31,256.952284318,1.1142482548366957\n2019-02-01,259.208947253,1.7797727009101152\n2019-02-02,259.333783926,2.5420329258668986\n2019-02-05,261.158319916,3.39286407027204\n2019-02-06,262.25304151,4.149380994932599\n2019-02-07,261.907339954,4.425170874154887\n2019-02-08,259.410606494,3.464741223845941\n2019-02-09,259.727499587,2.244400393236525\n2019-02-12,259.871541902,1.0751145797763684\n2019-02-13,263.21332361,0.8582814636102256\n2019-02-14,264.067974679,1.1224642616689309\n2019-02-15,263.482202598,1.1899231251461728\n2019-02-16,266.353446077,1.7753516671864702\n2019-02-20,266.814381485,2.4834260311376397\n2019-02-21,267.352139461,3.152460675955794\n2019-02-22,266.401460182,3.039002695006147\n2019-02-23,268.053145394,2.9159694469333317\n2019-02-26,268.418052592,2.720570508621023\n2019-02-27,268.225996172,2.3445590182981135\n2019-02-28,268.11076232,1.8548025895274947\n2019-03-01,267.611415628,1.0358986706399094\n2019-03-02,269.282306482,0.7323102769290841\n2019-03-05,268.30281874,0.051741176160646773\n2019-03-06,267.937911542,-0.7800870533493764\n2019-03-07,266.315034793,-2.4028389451611076\n2019-03-08,264.087180321,-4.895722760671745\n2019-03-09,263.559025166,-7.142655619630219\n2019-03-12,267.380947924,-7.137677874579097\n2019-03-13,268.389244129,-5.887227357172762\n2019-03-14,270.165766014,-3.813508949029199\n2019-03-15,269.992915236,-1.798056005429416\n2019-03-16,271.326955113,0.2779945668469779\n2019-03-19,272.310757659,2.256130191230959\n2019-03-20,272.37827352,3.7074050583644578\n2019-03-21,271.558438065,3.9136162388113505\n2019-03-22,274.625587179,4.225883901701273\n2019-03-23,269.340059775,1.813243520432465\n2019-03-26,269.137512192,-1.0477540232601044\n2019-03-27,271.143697776,-2.738993088369071\n2019-03-28,269.725864695,-4.2125218138524545\n2019-03-29,270.748247733,-4.801518266645111\n2019-03-30,272.455434504,-4.2510354093613145\n2019-04-02,275.686550709,-2.4131692409742556\n2019-04-03,275.821582431,-0.4221797317051781\n2019-04-04,276.255612966,1.49536624145356\n2019-04-05,276.988642314,3.027834669302848\n2019-04-06,278.329314411,4.243954810026466\n2019-04-09,278.541507117,4.983182468722717\n2019-04-10,277.114028913,4.332515756243268\n2019-04-11,278.059250967,3.4421874248600943\n2019-04-12,277.982089983,2.4505290089043115\n2019-04-13,279.862888968,2.106443073545222\n2019-04-16,279.679631631,1.8428439752676269\n2019-04-17,279.862888968,1.6547606272353192\n2019-04-18,279.178085235,1.0199187469631\n2019-04-19,279.727857246,0.5962508616494233\n2019-04-23,279.968985321,0.44717727542294483\n2019-04-24,282.486362424,1.1239922810898406\n2019-04-25,281.859429429,1.376674890779185\n2019-04-26,281.685817215,1.2432875810548865\n2019-04-27,282.997553943,1.428324589610682\n2019-04-30,283.441229601,1.7654061125112719\n2019-05-01,283.585906446,2.075811955277402\n2019-05-02,281.454334263,0.5393754147702907\n2019-05-03,280.846691514,-1.6683456218433719\n2019-05-04,283.595551569,-2.504947854419214\n2019-05-07,282.428491686,-3.366057180338345\n2019-05-08,277.712026539,-6.193021516343279\n2019-05-09,277.326221619,-8.92339640849788\n2019-05-10,276.487095918,-10.989464189068386\n2019-05-11,277.87599363,-11.280763084301327\n2019-05-14,270.892924578,-12.558726282061812\n2019-05-15,273.34278582,-12.425716020788776\n2019-05-16,274.943876238,-10.89941330399489\n2019-05-17,277.49018871,-7.902461815476116\n2019-05-18,275.696195832,-5.22653351644032\n2019-05-21,273.873267585,-3.60066825187522\n2019-05-22,276.342419073,-1.7364242401051087\n2019-05-23,275.493648249,-0.4438371309737832\n2019-05-24,272.127500322,-0.4254352407191888\n2019-05-25,272.744788194,-0.7520902363475415\n2019-05-29,270.208120845,-1.79144828733385\n2019-05-30,268.394837721,-3.1785283811564895\n2019-05-31,269.127867069,-3.8970468109614416\n2019-06-01,265.501300821,-4.862622141778374\n2019-06-04,264.826142211,-5.67813626823812\n2019-06-05,270.574635519,-3.993355849045251\n2019-06-06,272.918400408,-1.0713410927406102\n2019-06-07,274.69310304,2.0772683028808885\n2019-06-08,277.441963095,5.240799517172853\n2019-06-11,278.715119331,7.818980829991382\n2019-06-12,278.64760347,9.321001607694782\n2019-06-13,278.155702197,9.655734837183303\n2019-06-14,279.303471834,9.372156537121683\n2019-06-15,278.994827898,8.296338065592977\n2019-06-18,279.100924251,6.912392964129367\n2019-06-19,282.02339652,6.2506740692677525\n2019-06-20,282.659974638,5.8784319587125395\n2019-06-21,285.360609078,6.113578237753444\n2019-06-22,284.9454174,6.126586386606668\n2019-06-25,284.596504644,5.723789457338782\n2019-06-26,281.805202596,3.8331958656258465\n2019-06-27,281.524133987,1.6662586205664027\n2019-06-28,282.52241215,0.09905129085598219\n2019-06-29,283.9762153,-0.5921794526169109\n2019-07-02,286.554292886,-0.17842776943361116\n2019-07-03,287.300578503,0.6757328560637603\n2019-07-04,289.59758748,2.05640794921608\n2019-07-06,289.268058766,3.140382856037192\n2019-07-09,287.678567322,3.064257316801296\n2019-07-10,288.037172099,2.5868773697192324\n2019-07-11,289.413439081,2.26858566259223\n2019-07-12,290.091880551,2.072026745408806\n2019-07-13,291.390611365,2.142932132965143\n2019-07-16,291.487531575,2.233547334899285\n2019-07-17,290.479561391,1.63028260123221\n2019-07-18,288.570233254,-0.09306199272171511\n2019-07-19,289.626663543,-1.3564783091614458\n2019-07-20,288.017788057,-3.0403344010567963\n2019-07-23,288.72530559,-4.162668486657807\n2019-07-24,290.789706063,-4.041537419087163\n2019-07-25,292.156281024,-3.011068744788588\n2019-07-26,290.76063,-2.4958846255920406\n2019-07-27,292.708726221,-1.4528075210745897\n2019-07-30,292.175665066,-0.6488204981969261\n2019-07-31,291.458455512,-0.49658875440965744\n2019-08-01,288.269780603,-2.0168375904410496\n2019-08-02,285.759547164,-4.639250161893415\n2019-08-03,283.607918502,-7.595956674291614\n2019-08-06,275.078940022,-11.524479698562693\n2019-08-07,278.93636438,-13.051387183898555\n2019-08-08,279.101128737,-13.026992124662712\n2019-08-09,284.577120602,-10.3785061960251\n2019-08-10,282.638716402,-7.466763227720968\n2019-08-13,279.22712501,-5.3770497663491525\n2019-08-14,283.540074355,-2.6223957194004015\n2019-08-15,275.15647619,-1.6471609670844884\n2019-08-16,275.883377765,-1.217195294068219\n2019-08-17,279.954026585,-0.3237294226816019\n2019-08-20,283.326849893,1.1002018193976753\n2019-08-21,281.155837189,1.823174279585352\n2019-08-22,283.443154145,2.6702266378256567\n2019-08-23,283.355925956,3.305930153307699\n2019-08-24,276.077218185,2.2599080923310026\n2019-08-27,279.1302048,1.59808067317514\n2019-08-28,278.035006427,0.84387741192959\n2019-08-29,279.992794669,0.5087207305011887\n2019-08-30,283.569150418,1.0491353835941126\n2019-08-31,283.443154145,1.7275531554886356\n2019-09-04,281.785818554,1.8957553282496136\n2019-09-05,284.984185484,2.5439492467333835\n2019-09-06,288.647769422,3.8467318438512095\n2019-09-07,288.870685905,4.87283406631299\n2019-09-10,289.01606622,5.421839785699198\n2019-09-11,288.948222073,5.432488263960664\n2019-09-12,291.002930525,5.464736983754413\n2019-09-13,292.010900709,5.5203675471680285\n2019-09-14,291.817060289,5.303694522473201\n2019-09-17,290.915702336,4.471970299142171\n2019-09-18,291.652295932,3.629197415629406\n2019-09-19,291.82675231,2.9098079998381223\n2019-09-20,291.807368268,2.2868533866107015\n2019-09-21,290.428286076,1.1623824700494154\n2019-09-24,290.360128707,0.0478447032488134\n2019-09-25,288.081725229,-1.7324967508340166\n2019-09-26,289.785659454,-2.640718539312118\n2019-09-27,289.1819799,-3.2169721021775928\n2019-09-28,287.62409718,-4.069982453935694\n2019-10-01,288.958034259,-4.156575164060094\n2019-10-02,285.520955508,-5.018120741693707\n2019-10-03,280.477310202,-6.977533765277649\n2019-10-04,282.775187214,-7.735004390606889\n2019-10-05,286.601736645,-6.487378077625827\n2019-10-08,285.365167236,-5.07724435471507\n2019-10-09,280.934938251,-4.740267334359821\n2019-10-10,283.602812409,-3.7906442583148916\n2019-10-11,285.520955508,-2.205883098130947\n2019-10-12,288.480932676,0.12257400908989524\n2019-10-15,288.159619365,2.052125414208639\n2019-10-16,291.012492096,3.8686524845179733\n2019-10-17,290.54512728,4.90243891929579\n2019-10-18,291.401962776,5.57153502529119\n2019-10-19,290.126446299,5.388506915310906\n2019-10-22,292.093273233,5.165141555607562\n2019-10-23,291.139070067,4.396275237982358\n2019-10-24,291.986168796,3.657809480358125\n2019-10-25,292.463270379,3.1042383068513217\n2019-10-26,293.66089272,2.9221712525543424\n2019-10-29,295.31614311,3.2534628560758208\n2019-10-30,295.228512207,3.5310379166391357\n2019-10-31,296.134031538,3.8809074108464117\n2019-11-01,295.345353411,3.63312352110232\n2019-11-02,298.081384938,3.8677313690100874\n2019-11-05,299.279007279,4.297586412449796\n2019-11-06,298.947957201,4.339930424812479\n2019-11-07,299.01611457,4.091685247013373\n2019-11-08,300.067685406,3.926529040865674\n2019-11-09,300.807679698,3.8874579537810234\n2019-11-12,300.233210445,3.3948202226140722\n2019-11-13,300.8661003,2.9421645173191706\n2019-11-14,300.96346797,2.467263670554331\n2019-11-15,301.401622485,2.1423090136189984\n2019-11-16,303.582658293,2.47664649391254\n2019-11-19,303.806603934,2.899581479830175\n2019-11-20,303.718973031,3.0753364442009428\n2019-11-21,302.589508059,2.15134292070222\n2019-11-22,302.102669709,0.6888662490911059\n2019-11-23,302.774506632,-0.41363754693470867\n2019-11-26,305.121067479,-0.4225551438013895\n2019-11-27,305.812377936,0.06959739524970132\n2019-11-28,307.175525316,0.9336542400228893\n2019-11-30,306.036323577,0.860413927096431\n2019-12-03,303.436606788,-1.1121675934411996\n2019-12-04,301.401622485,-4.154132588439609\n2019-12-05,303.261344982,-6.005844337090551\n2019-12-06,303.806603934,-6.784549689838755\n2019-12-07,306.581582529,-5.994709180116587\n2019-12-10,305.617642596,-5.169300372435174\n2019-12-11,305.276855751,-4.408409011093191\n2019-12-12,306.143428014,-3.1874298252991764\n2019-12-13,308.782091871,-1.0557683754667195\n2019-12-14,308.967090444,0.9244525807830613\n2019-12-17,311.08970565,2.788418127647212\n2019-12-18,311.157863019,4.053963014791741\n2019-12-19,311.177336553,4.671490313889791\n2019-12-20,312.45285303,5.173514824626167\n2019-12-21,313.822694574,5.642448868822683\n2019-12-24,314.302141836,5.83231511539509\n2019-12-25,314.311926474,5.625662024512849\n2019-12-27,315.985099572,5.523861173838384\n2019-12-28,315.906822468,5.192835569064101\n2019-12-31,314.165156904,3.313108399278647\n2020-01-01,314.928358668,1.5040048538504465\n2020-01-03,317.873534706,0.7889189906259162\n2020-01-04,315.466513758,-1.0401693379808563\n2020-01-07,316.670024232,-2.400887063147593\n2020-01-08,315.779622174,-3.7432132210568483\n2020-01-09,317.46257991,-4.132406785668763\n2020-01-10,319.61520027,-3.380432239232533\n2020-01-11,318.695444298,-2.778386408835857\n2020-01-14,320.88720321,-1.7557066217181898\n2020-01-15,320.39797131,-1.0587488710652622\n2020-01-16,321.122034522,-0.2808529090302727\n2020-01-17,323.793240696,0.8987338578427\n2020-01-18,324.80105841,2.0871862353188817\n2020-01-22,324.16505694,2.461532164743346\n2020-01-23,324.204195492,2.4067776893859048\n2020-01-24,324.576011736,2.271038055534575\n2020-01-25,321.689543526,0.20597482390328992\n2020-01-28,316.5330393,-4.193851996826396\n2020-01-29,319.850031582,-7.112604896603486\n2020-01-30,319.585846356,-8.846702972718276\n2020-01-31,320.623017984,-9.1785231625948\n2020-02-01,314.801158374,-10.51144478055781\n2020-02-04,317.139686856,-10.650397202993773\n2020-02-05,321.973298028,-8.639755731412798\n2020-02-06,325.691460468,-5.160099844602975\n2020-02-07,326.787339924,-1.5648168309232702\n2020-02-08,325.04567436,0.6059514638787604\n2020-02-11,327.472264584,2.331968290554265\n2020-02-12,328.039773588,3.565503710653111\n2020-02-13,330.153255396,4.689895260053639\n2020-02-14,329.801008428,5.03296777292789\n2020-02-15,330.32937888,4.847980972773264\n2020-02-19,329.478115374,3.9988117138867523\n2020-02-20,331.053442092,3.383534843752841\n2020-02-21,329.69337741,2.3319953856349613\n2020-02-22,326.298108024,0.0178802023368263\n2020-02-25,315.476298396,-4.697610822201099\n2020-02-26,305.91670707,-10.20302929308911\n2020-02-27,304.7914737,-14.470488293975926\n2020-02-28,291.102765138,-18.029326162336744\n2020-02-29,289.879685388,-19.97937776839828\n2020-03-03,302.433375942,-17.640939920105502\n2020-03-04,293.773971312,-14.498442313404432\n2020-03-05,306.122184468,-9.26610115137688\n2020-03-06,295.946160948,-4.908795746814391\n2020-03-07,291.053841948,-1.9575600231503287\n2020-03-10,268.324127874,-1.4026377716362575\n2020-03-11,282.208529196,-0.20327250181459533\n2020-03-12,268.451328168,-0.012983385204883291\n2020-03-13,242.766653418,-1.411329801880477\n2020-03-14,263.519870616,-1.2039395711423992\n2020-03-17,234.68454243,-1.6025864621991417\n2020-03-18,247.35564864,-1.0378690448112664\n2020-03-19,234.831312,-0.6207302948254636\n2020-03-20,235.330328538,-0.237490364107245\n2020-03-21,225.18852928,-0.3848096740375979\n2020-03-24,219.43086802,-0.7539821336572814\n2020-03-25,239.31202314,0.2800351463408859\n2020-03-26,242.894567924,1.5891377311716042\n2020-03-27,257.07711472,3.5540054322105235\n2020-03-28,249.419917352,4.7555974949803\n2020-03-31,257.52001174,5.829340842963035\n2020-04-01,253.6815709,6.229601045849904\n2020-04-02,242.26466994,5.554128997559381\n2020-04-03,247.855014548,4.790671418779979\n2020-04-04,244.272469764,3.6723520380946795\n2020-04-07,260.679343816,3.5705533649024446\n2020-04-08,260.945082028,3.663989223714559\n2020-04-09,269.704600868,4.250887877041592\n2020-04-10,273.80877992,4.956680186587214\n2020-04-14,271.308872296,5.254666086833325\n2020-04-15,279.310545124,5.690685431676158\n2020-04-16,273.375725056,5.369880486610455\n2020-04-17,274.69457396,4.75258006585954\n2020-04-18,282.115559584,4.396303150065492\n2020-04-21,277.145270804,3.6255532313607404\n2020-04-22,268.730227424,2.091920730086244\n2020-04-23,274.69457396,1.039162425681667\n2020-04-24,274.674889648,0.3498632749456476\n2020-04-25,278.503488332,0.19040338446996685\n2020-04-28,282.51908798,0.56166025697798\n2020-04-29,281.219923388,0.8558424238670952\n2020-04-30,288.581856076,1.593508153895101\n2020-05-01,285.894947488,2.020788144504621\n2020-05-02,278.326329524,1.4371160766372313\n2020-05-05,279.094017692,0.6362023985542322\n2020-05-06,281.672662564,0.13037461295156305\n2020-05-07,279.7632843,-0.4381140922355229\n2020-05-08,283.139143808,-0.5708895624355534\n2020-05-09,287.824010064,-0.07061089798643394\n2020-05-12,287.883063,0.5204638205479668\n2020-05-13,282.145086052,0.3154345478868521\n2020-05-14,277.15511296,-0.6334384679466467\n2020-05-15,280.471919532,-1.230916633426041\n2020-05-16,281.761241968,-1.4414974098662654\n2020-05-19,290.343602,-0.5528560926130552\n2020-05-20,287.361428732,0.039467013375819704\n2020-05-21,292.243138108,0.9071451461640336\n2020-05-22,290.225496128,1.412579464282615\n2020-05-23,290.776656864,1.78868829342683\n2020-05-27,294.359201648,2.358831178197512\n2020-05-28,298.738961068,3.129992119465591\n2020-05-29,298.187800332,3.5280149447539486\n2020-05-30,299.516491392,3.6906914413189114\n2020-06-02,300.72707658,3.788902026050188\n2020-06-03,303.217142048,3.960090250150472\n2020-06-04,307.252426008,4.404017975556847\n2020-06-05,306.445369216,4.467601856869244\n2020-06-06,314.299409704,4.93394606190099\n2020-06-09,318.09848192,5.523431678081373\n2020-06-10,315.726522324,5.310386304093669\n2020-06-11,313.9647764,4.317017872329728\n2020-06-12,295.865051516,0.17493472768906315\n2020-06-13,299.408227676,-3.5949778259213048\n2020-06-16,302.20339998,-6.004876392671754\n2020-06-17,308.020114176,-6.632730814972263\n2020-06-18,306.740633896,-6.569752307582576\n2020-06-19,306.858739768,-5.9763139010628805\n2020-06-20,305.1053004,-5.258253393641375\n2020-06-23,307.06262445,-4.060816351609631\n2020-06-24,308.476247375,-2.4969904264888356\n2020-06-25,300.607409275,-2.5385170103842967\n2020-06-26,303.830074125,-2.604890795539923\n2020-06-27,296.613677375,-3.657219822309173\n2020-06-30,300.97317185,-4.005976943243404\n2020-07-01,304.8285071,-3.4206781904170853\n2020-07-02,306.9637697,-2.2800879131498135\n2020-07-03,308.654185925,-0.9291916167064258\n2020-07-07,313.418984875,0.8471959045822999\n2020-07-08,310.18643455,1.8698452036330053\n2020-07-09,312.55894855,2.6314086327927555\n2020-07-10,310.77956305,2.7471084763923272\n2020-07-11,313.952800525,2.8413433257626295\n2020-07-14,311.2342949,2.235676116411476\n2020-07-15,315.2675687,1.9844952270241905\n2020-07-16,318.164012875,2.1679196601745545\n2020-07-17,317.116152525,2.1525352295834566\n2020-07-18,318.0355017,2.1936195853276104\n2020-07-21,320.6057252,2.4995244642802206\n2020-07-22,321.287822975,2.839542883232518\n2020-07-23,323.11663585,3.2337097034179507\n2020-07-24,319.2613006,2.5208229941636233\n2020-07-25,317.2051218,1.0283684879960902\n2020-07-28,319.51832295,-0.03961252097074208\n2020-07-29,317.491800575,-1.1993542278155473\n2020-07-30,321.3965632,-1.469146636051164\n2020-07-31,320.2498481,-1.6482971150786696\n2020-08-01,322.7805297,-1.2583872976240755\n2020-08-04,325.024532525,-0.34195003246122724\n2020-08-05,326.27998785,0.8304143893662186\n2020-08-06,328.306510225,2.0944041782591967\n2020-08-07,330.501085675,3.2941010128245694\n2020-08-08,330.738337075,4.12441258010729\n2020-08-11,331.726884575,4.592715267011606\n2020-08-12,328.988608,3.7840537284913793\n2020-08-13,333.5754684,3.2915324912082013\n2020-08-14,332.972454425,2.6547983787138065\n2020-08-15,332.9823399,2.0040232010307193\n2020-08-18,334.040085725,1.5809433525985384\n2020-08-19,334.7617254,1.3893969352067188\n2020-08-20,333.367873425,0.7612128136073011\n2020-08-21,334.4058483,0.3502504613357331\n2020-08-22,335.5921053,0.3564775721440583\n2020-08-25,338.9927087,0.9894250468699255\n2020-08-26,340.1789657,1.8352794520183693\n2020-08-27,343.589454575,2.9623302292104654\n2020-08-28,344.340750675,3.9138643056296587\n2020-08-29,346.56498255,4.751558154364204\n2020-09-01,345.309527225,4.660764137354903\n2020-09-02,348.5618485,4.513509449274665\n2020-09-03,353.60344075,4.679047441851381\n2020-09-04,341.434421025,1.0269458142509933\n2020-09-05,338.646717075,-3.59318716748173\n2020-09-09,329.393912475,-8.956314557116315\n2020-09-10,335.898555025,-11.943748859938019\n2020-09-11,330.066124775,-13.966442693938887\n2020-09-12,330.23417785,-14.655195249261695\n2020-09-15,334.58378685,-13.498063290087153\n2020-09-16,336.274203075,-11.119658158348145\n2020-09-17,334.93966395,-8.386527169926346\n2020-09-18,331.9937924,-6.333716421679512\n2020-09-19,328.171877445,-5.301391853647068\n2020-09-22,324.519457941,-5.281234015273263\n2020-09-23,327.82450059,-4.76126253026267\n2020-09-24,320.221909992,-5.120698983083578\n2020-09-25,321.07546455,-5.404171236804089\n2020-09-26,326.266267269,-4.4488291538536515\n2020-09-29,331.685346207,-2.25468023994582\n2020-09-30,329.878986561,-0.29636564720699\n2020-10-01,332.380099917,1.611324026648866\n2020-10-02,334.513986312,3.3520244992312342\n2020-10-03,331.337969352,3.9499702562565417\n2020-10-06,337.213600728,4.831543234387951\n2020-10-07,332.419800129,4.5333713130817515\n2020-10-08,338.206106028,4.463033795918506\n2020-10-09,341.203472034,4.6469116781118345\n2020-10-10,344.250463305,5.101229152261745\n2020-10-13,349.788642879,5.942884700714345\n2020-10-14,347.505880689,6.096529314886297\n2020-10-15,345.322369029,5.436687642217031\n2020-10-16,344.89559175,4.3602193279045025\n2020-10-17,344.687165637,3.226942581479257\n2020-10-20,339.446737653,1.1262855064331276\n2020-10-21,340.806469914,-0.6529987840546809\n2020-10-22,340.161341469,-2.0571732136380376\n2020-10-23,342.027251433,-2.624608108562626\n2020-10-24,343.188482634,-2.428911793517834\n2020-10-27,336.846373767,-3.146275285067624\n2020-10-28,335.685142566,-4.0342422788178425\n2020-10-29,324.211781298,-6.2059129710499334\n2020-10-30,327.506898894,-7.371744942272052\n2020-10-31,324.092680662,-8.197447055790128\n2020-11-03,327.72525006,-7.777491465804033\n2020-11-04,333.511555959,-5.836814142710693\n2020-11-05,340.965270762,-2.556337028323888\n2020-11-06,347.615056272,1.4012349747960755\n2020-11-07,347.535655848,4.676346697629846\n2020-11-10,351.902679168,7.391391458324769\n2020-11-11,351.386576412,8.852682268538985\n2020-11-12,353.996865351,9.513298625712473\n2020-11-13,350.562797013,8.618795366813444\n2020-11-14,355.41614793,7.568030729268884\n2020-11-17,359.852646621,6.801877699679153\n2020-11-18,357.917261286,5.6530032748776335\n2020-11-19,353.609788284,3.679030414492942\n2020-11-20,355.098546234,1.9673033930615844\n2020-11-21,352.666908249,0.2301448728970783\n2020-11-24,354.780944538,-0.8331866265872279\n2020-11-25,360.497775066,-0.6826934240698108\n2020-11-26,359.941972098,-0.3352414421426104\n2020-11-28,360.944402451,0.16195545897602415\n2020-12-01,359.346468918,0.3228263638088009\n2020-12-02,363.276789906,0.919133061043027\n2020-12-03,364.041018987,1.5465524039232434\n2020-12-04,363.941768457,1.9535930956930088\n2020-12-05,367.078085205,2.4815576404811566\n2020-12-08,366.323781177,2.5804263503352587\n2020-12-09,367.395686901,2.6144952463651805\n2020-12-10,364.100569305,1.5985477316490773\n2020-12-11,363.981468669,0.41252881449651113\n2020-12-12,363.55469139,-0.7547222644404599\n2020-12-15,361.926982698,-2.11633045299795\n2020-12-16,366.820033827,-2.2360486770537875\n2020-12-17,367.395686901,-1.7876774084625424\n2020-12-18,369.450172872,-0.8027594347014926\n2020-12-19,367.97499648,-0.2740410000042459\n2020-12-22,366.65930496,-0.317663285119977\n2020-12-23,366.04132864,-0.7218257546454794\n2020-12-24,366.37025152,-1.0635048801853202\n2020-12-25,367.795584,-0.9862356486926132\n2020-12-29,370.95523712,-0.2173272614106807\n2020-12-30,370.24755456,0.3366234024715169\n2020-12-31,370.77582464,0.833629343175744\n2021-01-01,372.65965568,1.641637693373582\n2021-01-05,367.58626944,0.5202092326597239\n2021-01-06,370.11797888,-0.38806428296482665\n2021-01-07,372.3307328,-0.6214995947507518\n2021-01-08,377.8626176,0.2992780406068647\n2021-01-09,380.01556736,1.6262933727139526\n2021-01-12,377.45395584,1.9462789438472186\n2021-01-13,377.53369472,1.8733870847321583\n2021-01-14,378.55036544,1.8546064868015861\n2021-01-15,377.22470656,1.414257220194031\n2021-01-16,374.4737152,-0.135530545911152\n2021-01-20,377.4140864,-1.1440648655729646\n2021-01-21,382.63698304,-0.8927060813391421\n2021-01-22,382.98584064,-0.18678850223149368\n2021-01-23,381.63027968,0.15242164443657202\n2021-01-26,383.13535104,0.583428717006683\n2021-01-27,382.53730944,0.7370703050517022\n2021-01-28,373.18792576,-1.7724533943023744\n2021-01-29,376.39741568,-3.7792485311174246\n2021-01-30,368.86209152,-6.6321629054116755\n2021-02-02,375.00198528,-7.772578035000599\n2021-02-03,380.3046208,-7.00836877350833\n2021-02-04,380.6036416,-5.476537108537869\n2021-02-05,384.92947584,-3.1709650224524992\n2021-02-06,386.44451456,-0.6793576677580475\n2021-02-09,389.23537536,1.8799492822601138\n2021-02-10,388.976224,3.6627100933803547\n2021-02-11,388.80677888,4.629285297614196\n2021-02-12,389.43472256,4.866463681900598\n2021-02-13,391.35842304,4.8545737364720125\n2021-02-17,391.0195328,4.46932730598671\n2021-02-18,391.10923904,3.8684026239721447\n2021-02-19,389.44468992,2.651192839440796\n2021-02-20,388.75694208,1.2055573049913875\n2021-02-23,385.76673408,-0.9261551025100943\n2021-02-24,386.2352,-2.6367156587751595\n2021-02-25,390.49126272,-2.8223290113746913\n2021-02-26,381.08207488,-4.7320702986057555\n2021-02-27,379.11850496,-6.884704035025663\n2021-03-02,388.30841088,-6.564703884972516\n2021-03-03,385.27833344,-5.860906346670532\n2021-03-04,380.17504512,-5.817405782856639\n2021-03-05,375.4704512,-6.410318366376096\n2021-03-06,382.37783168,-5.668414477483431\n2021-03-09,380.47406592,-4.7790992072480805\n2021-03-10,385.90627712,-2.882937332574535\n2021-03-11,388.30841088,-0.7560107487853998\n2021-03-12,392.24551808,1.401187112843104\n2021-03-13,392.77378816,3.2184515501554714\n2021-03-16,395.11611776,4.787602621050432\n2021-03-17,394.61774976,5.61866472058567\n2021-03-18,395.96334336,5.894525195587711\n2021-03-19,390.20220928,4.500563828758999\n2021-03-20,389.48,2.5234712399354393\n2021-03-23,392.59,1.2032693978061246\n2021-03-24,389.5,-0.31673564748989236\n2021-03-25,387.52,-1.9035742247865741\n2021-03-26,389.7,-2.6652668495517133\n2021-03-27,395.98,-1.842745536612263\n2021-03-30,395.78,-0.6467202112996446\n2021-03-31,394.73,0.292269150523083\n2021-04-01,396.33,1.1916179449302788\n2021-04-02,400.61,2.4704083927756244\n2021-04-06,406.36,4.2619547670526785\n2021-04-07,406.12,5.560573005128639\n2021-04-08,406.59,6.195718405762001\n2021-04-09,408.52,6.451395635365721\n2021-04-10,411.49,6.690786568945498\n2021-04-13,411.64,6.649510801998758\n2021-04-14,412.86,6.385400932360305\n2021-04-15,411.45,5.339411452055259\n2021-04-16,415.87,4.643087685710853\n2021-04-17,417.26,4.232423647342216\n2021-04-20,415.21,3.1527429262546605\n2021-04-21,412.17,1.0396202055783021\n2021-04-22,416.07,-0.36636532433477953\n2021-04-23,412.27,-2.279884192567522\n2021-04-24,416.74,-3.1536399104662394\n2021-04-27,417.61,-3.2626462641913605\n2021-04-28,417.52,-3.0493420813626244\n2021-04-29,417.4,-2.652422481126166\n2021-04-30,420.06,-1.6684169212472568\n2021-05-01,417.3,-1.4882440578199976\n2021-05-04,418.2,-1.4233087580087584\n2021-05-05,415.62,-2.11168416116179\n2021-05-06,415.75,-2.866543372517775\n2021-05-07,419.07,-2.733193511189036\n2021-05-08,422.12,-1.7437952749451497\n2021-05-11,417.94,-1.8938474043002742\n2021-05-12,414.21,-3.1954752757823712\n2021-05-13,405.41,-6.021255389702873\n2021-05-14,410.28,-7.486673431316007\n2021-05-15,416.58,-6.895076540150754\n2021-05-18,415.52,-5.839460635681618\n2021-05-19,411.94,-5.344486279061428\n2021-05-20,410.86,-5.041430258826978\n2021-05-21,415.28,-3.7200610099495464\n2021-05-22,414.94,-2.2455128438424268\n2021-05-25,419.17,-0.2740467781094438\n2021-05-26,418.24,1.0320371230383074\n2021-05-27,419.07,1.8837572182943845\n2021-05-28,419.29,2.439378608720787\n2021-05-29,420.04,2.8723160979157925\n2021-06-02,419.67,2.922461948721505\n2021-06-03,420.33,2.794263788719718\n2021-06-04,418.77,2.0701165578410112\n2021-06-05,422.6,2.024981500933059\n2021-06-08,422.19,2.0243990089663626\n2021-06-09,422.28,1.9856546872399505\n2021-06-10,421.65,1.6679305645792013\n2021-06-11,423.61,1.7414692701696595\n2021-06-12,424.31,2.026147831718191\n2021-06-15,425.26,2.4520248935429834\n2021-06-16,424.48,2.4266104750411515\n2021-06-17,422.11,1.2180633427039425\n2021-06-18,421.97,-0.14486768386915827\n2021-06-19,414.92,-3.3423825157707654\n2021-06-22,420.86,-4.6566741686851785\n2021-06-23,423.11,-4.50976695216476\n2021-06-24,422.6,-3.9300310592643157\n2021-06-25,425.1,-2.604602468966668\n2021-06-26,426.61,-0.8335093663542352\n2021-06-29,427.47,0.994386654183046\n2021-06-30,427.7,2.476812371515436\n2021-07-01,428.06,3.5561760611147903\n2021-07-02,430.43,4.437431517590895\n2021-07-03,433.72,5.458278069936775\n2021-07-07,432.93,5.771148159115299\n2021-07-08,434.46,5.831338158163888\n2021-07-09,430.92,4.241925699153697\n2021-07-10,435.52,3.24756562280691\n2021-07-13,437.08,2.7827435513328425\n2021-07-14,435.59,1.925171472750577\n2021-07-15,436.24,1.157730158439307\n2021-07-16,434.75,0.01135408587563802\n2021-07-17,431.34,-2.031214668805461\n2021-07-20,424.97,-5.366486609131968\n2021-07-21,431.06,-6.719111262697382\n2021-07-22,434.55,-6.403744257622748\n2021-07-23,435.46,-5.256187352040136\n2021-07-24,439.94,-3.115209358290585\n2021-07-27,441.02,-0.8137536140892152\n2021-07-28,439.01,0.6320827411415024\n2021-07-29,438.83,1.5233987170256285\n2021-07-30,440.65,2.294230964910888\n2021-07-31,438.51,1.9283749199823887\n2021-08-03,437.59,0.8852656444443738\n2021-08-04,441.15,0.5028260166998209\n2021-08-05,438.98,-0.26891408021524654\n2021-08-06,441.76,-0.3947278214263932\n2021-08-07,442.49,-0.08263657405713332\n2021-08-10,442.13,0.19141141104284287\n2021-08-11,442.68,0.5104714651708804\n2021-08-12,443.78,1.0374237490236453\n2021-08-13,445.11,1.7284335934863932\n2021-08-14,445.92,2.366692763586485\n2021-08-17,446.97,3.003743124857003\n2021-08-18,444.04,2.183966558232491\n2021-08-19,439.18,-0.48571970697647515\n2021-08-20,439.86,-2.9179571057497853\n2021-08-21,443.36,-3.802143735053143\n2021-08-24,447.26,-3.1248704367714026\n2021-08-25,447.97,-1.8854692612541015\n2021-08-26,448.91,-0.4471432938087787\n2021-08-27,446.26,-0.03484715580295017\n2021-08-28,450.25,0.934395185088917\n2021-08-31,452.23,2.201821493495707\n2021-09-01,451.56,2.8245276583161925\n2021-09-02,451.8,2.921759376978798\n2021-09-03,453.19,2.9479879211161446\n2021-09-04,453.08,2.820099557187987\n2021-09-08,451.46,1.950752073878725\n2021-09-09,450.91,0.80629612882759\n2021-09-10,448.98,-1.0151517728571733\n2021-09-11,445.44,-3.7575348727807665\n2021-09-14,446.58,-5.658089972313263\n2021-09-15,444.17,-7.403994232842521\n2021-09-16,447.88,-7.356920279499953\n2021-09-17,447.17,-6.675546319283484\n2021-09-18,441.4,-7.089088436182564\n2021-09-21,434.04,-8.70884477187105\n2021-09-22,433.63,-10.00442290039338\n2021-09-23,437.86,-9.336889862535699\n2021-09-24,443.18,-6.7539502456581175\n2021-09-25,443.91,-3.782111922173769\n2021-09-28,442.64,-1.5295875500116765\n2021-09-29,433.72,-1.3593496561782246\n2021-09-30,434.45,-1.4805880917266308\n2021-10-01,429.14,-2.36838667891233\n2021-10-02,434.24,-2.233337580169305\n2021-10-05,428.64,-2.700372873519484\n2021-10-06,433.1,-2.325402541748346\n2021-10-07,434.9,-1.2764219471642662\n2021-10-08,438.66,0.5859249142224741\n2021-10-09,437.86,2.254787229326652\n2021-10-12,434.69,2.861725544580011\n2021-10-13,433.62,2.7313093502555645\n2021-10-14,435.18,2.5177709834840556\n2021-10-15,442.5,3.545153308788059\n2021-10-16,445.87,4.980702219379239\n2021-10-19,447.19,6.2141042340784125\n2021-10-20,450.64,7.381177171104618\n2021-10-21,452.41,8.31685143880302\n2021-10-22,453.59,8.881464953472985\n2021-10-23,453.12,8.72998277081021\n2021-10-26,455.55,8.321100522847416\n2021-10-27,455.96,7.565370535676742\n2021-10-28,453.94,6.011495397110657\n2021-10-29,458.32,5.005897029775383\n2021-10-30,459.25,4.326331891195792\n2021-11-02,460.04,3.8715303519445143\n2021-11-03,461.9,3.7332104885614896\n2021-11-04,464.72,3.9820396892124563\n2021-11-05,466.91,4.412573590745126\n2021-11-06,468.53,4.859700559342912\n2021-11-09,468.93,5.111791816725969\n2021-11-10,467.38,4.4143036458520015\n2021-11-11,463.62,2.130086892875454\n2021-11-12,463.77,-0.19242894054907822\n2021-11-13,467.27,-1.4445136532592073\n2021-11-16,467.43,-2.0549171336745076\n2021-11-17,469.28,-1.9545760443774611\n2021-11-18,468.14,-1.9791476961282228\n2021-11-19,469.73,-1.5973128504110718\n2021-11-20,468.89,-1.34055811417619\n2021-11-23,467.57,-1.581264096208983\n2021-11-24,468.19,-1.8063451800239818\n2021-11-25,469.44,-1.7239181931936258\n2021-11-27,458.97,-4.686237191447816\n2021-11-30,464.6,-6.466791751158368\n2021-12-01,455.56,-8.945901074528464\n2021-12-02,450.5,-11.490140421159353\n2021-12-03,457.4,-11.71269759215295\n2021-12-04,453.42,-11.300995745320762\n2021-12-07,458.79,-9.45314047666497\n2021-12-08,468.28,-5.862477360865228\n2021-12-09,469.52,-1.9724820949012951\n2021-12-10,466.35,0.6089362741420103\n2021-12-11,470.74,2.8519565788459573\n2021-12-14,466.57,3.63743832074654\n2021-12-15,463.36,3.018288300778323\n2021-12-16,470.6,2.8846742482104233\n2021-12-17,466.45,2.0515099330163267\n2021-12-18,459.87,0.17875780188460766\n2021-12-21,454.98,-2.1047241308054723\n2021-12-22,463.06,-2.7982128718169292\n2021-12-23,467.69,-2.2305894070327383\n2021-12-24,470.6,-0.9337330540154767\n2021-12-28,477.26,1.0226433675096303\n2021-12-29,476.87,2.6314010965626835\n2021-12-30,477.48,3.8600370170130986\n2021-12-31,476.16,4.39188810765156\n2022-01-01,474.96,4.171391160154144\n2022-01-04,477.71,3.8076759030672775\n2022-01-05,477.55,3.2459289410901135\n2022-01-06,468.38,1.05560996014038\n2022-01-07,467.94,-1.2548758957807848\n2022-01-08,466.09,-3.287249915345164\n2022-01-11,465.51,-4.735411236135761\n2022-01-12,469.75,-4.753158260002394\n2022-01-13,471.02,-3.9397672672089428\n2022-01-14,464.53,-3.9700222819089888\n2022-01-15,464.72,-3.972819049249459\n2022-01-19,456.49,-4.8432585250461955\n2022-01-20,451.75,-6.180408199909181\n2022-01-21,446.75,-7.677039266799184\n2022-01-22,437.98,-9.396848578585164\n2022-01-25,439.84,-10.16065479777636\n2022-01-26,434.47,-10.470889001613429\n2022-01-27,433.38,-10.162612513174878\n2022-01-28,431.24,-9.486810134021336\n2022-01-29,441.95,-6.3623939206423294\n2022-02-01,449.91,-1.7796201153254074\n2022-02-02,452.95,2.707319565298512\n2022-02-03,457.35,6.633483962673829\n2022-02-04,446.6,7.990112893330561\n2022-02-05,448.7,8.249658503957129\n2022-02-08,447.26,7.572771594950623\n2022-02-09,450.94,6.83282881798835\n2022-02-10,457.54,6.5585051264319745\n2022-02-11,449.32,5.22148710531134\n2022-02-12,440.46,2.864958140505344\n2022-02-15,439.02,0.5735984956283602\n2022-02-16,446.1,-0.1855667804821124\n2022-02-17,446.6,-0.28685895008228357\n2022-02-18,437.06,-1.1124337501473534\n2022-02-19,434.23,-2.208149219049872\n2022-02-23,429.57,-3.4301446251205974\n2022-02-24,421.95,-4.742434095523528\n2022-02-25,428.3,-4.699484215296231\n2022-02-26,437.75,-3.0171367437574546\n2022-03-01,436.63,-1.277421026304573\n2022-03-02,429.98,-0.39235410304956986\n2022-03-03,437.89,1.0772372555305694\n2022-03-04,435.71,2.161853209979597\n2022-03-05,432.17,2.4691829751506873\n2022-03-08,419.43,1.285806184854259\n2022-03-09,416.25,-0.5018404990196785\n2022-03-10,427.41,-0.8203110070758015\n2022-03-11,425.48,-0.7181512082265655\n2022-03-12,420.07,-0.8872360622333062\n2022-03-15,417.0,-1.3342036852760515\n2022-03-16,426.17,-0.5695827233510329\n2022-03-17,435.62,1.4036523820846298\n2022-03-18,441.07,3.7766683437911936\n2022-03-19,444.52,5.83810119904615\n2022-03-22,444.39,7.034692868307239\n2022-03-23,449.59,7.956771697841901\n2022-03-24,443.8,7.637130903871565\n2022-03-25,450.49,7.259814322226553\n2022-03-26,452.69,6.723812162597447\n2022-03-29,455.91,6.215969939112902\n2022-03-30,461.55,6.052162878524818\n2022-03-31,458.7,5.443835171768214\n2022-04-01,451.64,3.7708192627515587\n2022-04-02,452.92,2.1525973988980027\n2022-04-05,456.8,1.2422209415595447\n2022-04-06,451.03,-0.11576743006828139\n2022-04-07,446.52,-1.852862546234931\n2022-04-08,448.77,-2.9988420554498063\n2022-04-09,447.57,-3.732690515999522\n2022-04-12,439.92,-4.858925491044971\n2022-04-13,438.29,-5.791945371050112\n2022-04-14,443.31,-5.615425764791638\n2022-04-15,437.79,-5.573055022141411\n2022-04-19,437.97,-5.27821451730177\n2022-04-20,445.04,-3.827486393395219\n2022-04-21,444.71,-2.279318170046004\n2022-04-22,438.06,-1.7504308657216257\n2022-04-23,426.04,-2.710976762847821\n2022-04-26,428.51,-3.5036046212448397\n2022-04-27,416.1,-5.010322973855523\n2022-04-28,417.27,-6.041414515379806\n2022-04-29,427.81,-5.168510099229906\n2022-04-30,412.0,-4.967619921159901\n2022-05-03,414.48,-4.4417110953988725\n2022-05-04,416.38,-3.4184013603164516\n2022-05-05,429.06,-0.9260398424786587\n2022-05-06,413.81,0.29133267099982874\n2022-05-07,411.34,0.7052934377998312\n2022-05-10,398.17,-0.12088939050372005\n2022-05-11,399.09,-1.1188277890099556\n2022-05-12,392.75,-2.200349490623907\n2022-05-13,392.34,-3.092144831032037\n2022-05-14,401.72,-2.592476361965133\n2022-05-17,400.09,-1.8327472948251682\n2022-05-18,408.32,-0.055675278997526334\n2022-05-19,391.86,0.5604827946336002\n2022-05-20,389.46,0.5877758918983318\n2022-05-21,389.63,0.39611861942250925\n2022-05-24,396.92,0.9404510230578609\n2022-05-25,393.89,1.244325666523821\n2022-05-26,397.37,1.6555418450570158\n2022-05-27,405.31,2.79271212818999\n2022-05-28,415.26,4.690265285226204\n2022-06-01,412.93,6.123488000837767\n2022-06-02,409.59,6.550537059081705\n2022-06-03,417.39,7.001746784007636\n2022-06-04,410.54,6.365208971210848\n2022-06-07,411.79,5.420086194255298\n2022-06-08,415.74,4.689376974443391\n2022-06-09,411.22,3.4697937747081795\n2022-06-10,401.44,1.332722644285539\n2022-06-11,389.8,-1.4637583125164255\n2022-06-14,375.0,-4.640868096687882\n2022-06-15,373.87,-7.146638986618761\n2022-06-16,379.2,-7.97772785592732\n2022-06-17,366.65,-8.557234334156568\n2022-06-18,365.86,-8.62958300369882\n2022-06-22,375.07,-7.0711866061519615\n2022-06-23,374.39,-5.041821772296252\n2022-06-24,378.06,-2.6621429223384325\n2022-06-25,390.08,0.5894261068890643\n2022-06-28,388.59,3.1653971091755864\n2022-06-29,380.65,4.148579395707102\n2022-06-30,380.34,4.280304304760612\n2022-07-01,377.25,3.635196669266705\n2022-07-02,381.24,3.1029086920609075\n2022-07-06,381.96,2.6606572075801083\n2022-07-07,383.25,2.3424000080586325\n2022-07-08,388.99,2.6846624461400808\n2022-07-09,388.67,3.1138780368460033\n2022-07-12,384.23,2.932631590040401\n2022-07-13,380.83,2.135911708643121\n2022-07-14,378.83,1.0267101513978076\n2022-07-15,377.91,-0.1312111620210885\n2022-07-16,385.13,-0.03660150254376049\n2022-07-19,381.95,-0.008538435117017684\n2022-07-20,392.27,1.2462051741664553\n2022-07-21,394.77,2.8852222895280732\n2022-07-22,398.79,4.673409270657082\n2022-07-23,395.09,5.448583171729062\n2022-07-26,395.57,5.594861622856492\n2022-07-27,390.89,4.586913212576462\n2022-07-28,401.04,4.311577484564268\n2022-07-29,406.07,4.602717736908232\n2022-07-30,411.99,5.2329736383106535\n2022-08-02,410.77,5.477038082791495\n2022-08-03,408.06,4.978041993072338\n2022-08-04,414.45,4.84988846899148\n2022-08-05,414.17,4.640487326695428\n2022-08-06,413.47,4.148824847928886\n2022-08-09,412.99,3.320707852268498\n2022-08-10,411.35,2.1221793796927813\n2022-08-11,419.99,1.9087644807539093\n2022-08-12,419.99,2.0239670011379687\n2022-08-13,427.1,2.7950709326904715\n2022-08-16,428.86,3.605501372929808\n2022-08-17,429.7,4.226236389055785\n2022-08-18,426.65,3.850001552799\n2022-08-19,427.89,3.2463787438545353\n2022-08-20,422.14,1.3485993768678668\n2022-08-23,413.35,-2.134659732593306\n2022-08-24,412.35,-5.412978020804928\n2022-08-25,413.67,-7.559333126837046\n2022-08-26,419.51,-7.786627817570334\n2022-08-27,405.31,-8.9949871739924\n2022-08-30,402.63,-10.078871040853052\n2022-08-31,398.21,-10.906007940736288\n2022-09-01,395.18,-11.241481189072303\n2022-09-02,396.42,-10.699473928195602\n2022-09-03,392.24,-10.138151185145347\n2022-09-07,390.76,-9.533762261307182\n2022-09-08,397.78,-7.502131551723686\n2022-09-09,400.38,-4.66460766552445\n2022-09-10,406.6,-1.1818434460861127\n2022-09-13,410.97,2.311680606791299\n2022-09-14,393.1,2.9016937634961124\n2022-09-15,394.6,2.5405134847891446\n2022-09-16,390.12,1.4298576747680585\n2022-09-17,385.56,-0.2198690188928225\n2022-09-20,388.55,-1.393309396049439\n2022-09-21,384.09,-2.5642525308775532\n2022-09-22,377.39,-3.9351191632764184\n2022-09-23,374.22,-5.053816358220281\n2022-09-24,367.95,-5.914394171118801\n2022-09-27,364.31,-6.552507255039842\n2022-09-28,363.38,-6.788301579980761\n2022-09-29,370.53,-5.42278225631156\n2022-09-30,362.79,-4.300302480370718\n2022-10-01,357.18,-3.654080406443846\n2022-10-04,366.61,-1.7504152000226973\n2022-10-05,377.97,1.4981443877387477\n2022-10-06,377.09,4.300563695162403\n2022-10-07,373.2,5.808657569609373\n2022-10-08,362.79,5.476527047186487\n2022-10-11,360.02,4.17994505285494\n2022-10-12,357.74,2.581471719139678\n2022-10-13,356.56,0.9795915015737222\n2022-10-14,365.97,0.7768471013768732\n2022-10-15,357.63,0.2748259709816949\n2022-10-18,366.82,0.9593609328614079\n2022-10-19,371.13,2.379605245464738\n2022-10-20,368.5,3.4681530676028345\n2022-10-21,365.41,3.8062464337493864\n2022-10-22,374.29,4.627840733910688\n2022-10-25,378.87,5.615462621636574\n2022-10-26,384.92,6.670691955201171\n2022-10-27,382.02,6.965929922936901\n2022-10-28,379.98,6.404733437927845\n2022-10-29,389.02,6.322137631055689\n2022-11-01,386.21,5.866269040598908\n2022-11-02,384.52,4.961598832566764\n2022-11-03,374.87,2.771076715736015\n2022-11-04,371.01,0.18390140060630955\n2022-11-05,376.35,-1.3579403022962993\n2022-11-08,379.95,-1.769525735726397\n2022-11-09,382.0,-1.4649382374334792\n2022-11-10,374.13,-1.8582970112665862\n2022-11-11,394.69,-0.36155632790576675\n2022-11-12,398.51,1.7257358388935558\n2022-11-15,395.12,3.1611244238252\n2022-11-16,398.49,4.191325769686081\n2022-11-17,395.45,4.268197192643342\n2022-11-18,394.24,3.70238652823506\n2022-11-19,396.03,3.0793449920064973\n2022-11-22,394.59,2.2545048162929504\n2022-11-23,399.9,1.8256138290498143\n2022-11-24,402.42,1.8149854167912167\n2022-11-26,402.33,1.922630636855068\n2022-11-29,395.91,1.0295526854282429\n2022-11-30,395.23,-0.047929346373969395\n2022-12-01,407.68,0.306982378245479\n2022-12-02,407.38,0.9247955870527989\n2022-12-03,406.91,1.3674084925345085\n2022-12-06,399.59,0.46016136738017366\n2022-12-07,393.83,-1.3980992776735093\n2022-12-08,393.16,-3.1201084586414254\n2022-12-09,396.24,-3.871830686717061\n2022-12-10,393.28,-4.515941913818054\n2022-12-13,398.95,-4.180269126479779\n2022-12-14,401.97,-3.045541538464093\n2022-12-15,399.4,-2.105732470321847\n2022-12-16,389.63,-2.51358499795419\n2022-12-17,383.27,-3.8036650044441984\n2022-12-20,380.02,-5.321873126668201\n2022-12-21,380.54,-6.382487354463336\n2022-12-22,386.23,-6.016508816531079\n2022-12-23,380.72,-5.762041301346514\n2022-12-24,382.91,-5.012952063281432\n2022-12-28,381.4,-4.144637682884422\n2022-12-29,376.66,-3.678184986098451\n2022-12-30,383.44,-2.2562546155122405\n2022-12-31,382.43,-0.9594799885933512\n2023-01-04,380.82,-0.22910415822381935\n2023-01-05,383.76,0.5815072704790225\n2023-01-06,379.38,0.6925745812059176\n2023-01-07,388.08,1.7843230559464587\n2023-01-10,387.86,2.8419929802579276\n2023-01-11,390.58,3.915941054125227\n2023-01-12,395.52,5.163092306204369\n2023-01-13,396.96,6.207456646179551\n2023-01-14,398.5,6.935411223582754\n2023-01-18,397.77,6.98668289978896\n2023-01-19,391.49,5.461788780323232\n2023-01-20,388.64,3.052483638640389\n2023-01-21,395.88,1.833091086731386\n2023-01-24,400.63,1.7026375491891201\n2023-01-25,400.2,1.767806955014855\n2023-01-26,400.35,1.8804166391967598\n2023-01-27,404.75,2.534620981663167\n2023-01-28,405.68,3.3196511436878495\n2023-01-31,400.59,2.917590320204539\n2023-02-01,406.48,2.8445097114704225\n2023-02-02,410.8,3.1281018814705206\n2023-02-03,416.78,3.8884523429266196\n2023-02-04,412.35,3.65883118134181\n2023-02-07,409.83,2.6055268229259525\n2023-02-08,415.19,2.0155279920142135\n2023-02-09,410.65,0.8621500473538006\n2023-02-10,407.09,-0.7708684627021682\n2023-02-11,408.04,-2.1348691713722516\n2023-02-14,412.83,-2.4741600983312892\n2023-02-15,412.64,-2.35172572235129\n2023-02-16,413.98,-1.7500699996511813\n2023-02-17,408.28,-2.0881369146105087\n2023-02-18,407.26,-2.735548167536564\n2023-02-22,399.09,-4.399910743994781\n2023-02-23,399.09,-5.853519490320693\n"
  },
  {
    "path": "Tests/TestData/spy_dpo.csv",
    "content": "Date,Open,High,Low,Close,Lag(11),Sma(21),DPO\n8/21/2015 12:00:00 AM,201.81,203.94,197.52,197.63,,,\n8/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,,,\n8/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,,,\n8/26/2015 12:00:00 AM,192.21,194.79,188.37,194.68,,,\n8/27/2015 12:00:00 AM,197.05,199.42,195.21,199.27,,,\n8/28/2015 12:00:00 AM,198.5,199.84,197.92,199.28,,,\n8/31/2015 12:00:00 AM,198.14,199.13,197.01,197.67,,,\n9/1/2015 12:00:00 AM,193.07,194.77,190.73,191.77,,,\n9/2/2015 12:00:00 AM,194.69,195.46,192.42,195.41,,,\n9/3/2015 12:00:00 AM,196.25,198.05,194.96,195.55,,,\n9/4/2015 12:00:00 AM,192.88,193.86,191.61,192.59,,,\n9/8/2015 12:00:00 AM,195.97,197.61,195.17,197.43,197.63,,\n9/9/2015 12:00:00 AM,199.32,199.47,194.35,194.79,189.55,,\n9/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,187.27,,\n9/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,194.68,,\n9/14/2015 12:00:00 AM,196.95,197.01,195.43,196.01,199.27,,\n9/15/2015 12:00:00 AM,196.59,198.99,195.96,198.46,199.28,,\n9/16/2015 12:00:00 AM,198.82,200.41,198.41,200.18,197.67,,\n9/17/2015 12:00:00 AM,199.96,202.89,199.28,199.73,191.77,,\n9/18/2015 12:00:00 AM,195.74,198.68,194.96,195.45,195.41,,\n9/21/2015 12:00:00 AM,196.45,197.68,195.21,196.46,195.55,195.7985714,-0.248571429\n9/22/2015 12:00:00 AM,193.9,194.46,192.56,193.91,192.59,195.6214286,-3.031428571\n9/23/2015 12:00:00 AM,194.13,194.67,192.91,193.6,197.43,195.8142857,1.615714286\n9/24/2015 12:00:00 AM,192.13,193.45,190.56,192.9,194.79,196.082381,-1.292380952\n9/25/2015 12:00:00 AM,194.61,195,191.81,192.85,195.85,195.9952381,-0.145238095\n9/28/2015 12:00:00 AM,191.75,191.91,187.64,188.01,196.74,195.4590476,1.280952381\n9/29/2015 12:00:00 AM,188.24,189.74,186.93,188.12,196.01,194.927619,1.082380952\n9/30/2015 12:00:00 AM,190.4,191.83,189.44,191.63,198.46,194.64,3.82\n10/1/2015 12:00:00 AM,192.03,192.49,189.82,192.13,200.18,194.6571429,5.522857143\n10/2/2015 12:00:00 AM,189.75,195.03,189.12,195,199.73,194.637619,5.092380952\n10/5/2015 12:00:00 AM,196.47,198.74,196.33,198.47,195.45,194.7766667,0.673333333\n10/6/2015 12:00:00 AM,198.27,198.98,197,197.79,196.46,195.0242857,1.435714286\n10/7/2015 12:00:00 AM,198.85,199.83,197.48,199.41,193.91,195.1185714,-1.208571429\n10/8/2015 12:00:00 AM,198.96,201.55,198.59,201.21,193.6,195.4242857,-1.824285714\n10/9/2015 12:00:00 AM,201.4,201.9,200.58,201.33,192.9,195.6852381,-2.785238095\n10/12/2015 12:00:00 AM,201.43,201.76,200.91,201.52,192.85,195.9128571,-3.062857143\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,200.25,188.01,196.1147619,-8.104761905\n10/14/2015 12:00:00 AM,200.16,200.87,198.94,199.29,188.12,196.1542857,-8.034285714\n10/15/2015 12:00:00 AM,200.05,202.36,199.64,202.35,191.63,196.257619,-4.627619048\n10/16/2015 12:00:00 AM,202.82,203.29,201.92,203.27,192.13,196.4261905,-4.296190476\n10/19/2015 12:00:00 AM,202.53,203.37,202.13,203.37,195,196.8033333,-1.803333333\n10/20/2015 12:00:00 AM,202.86,203.84,202.55,203.11,198.47,197.12,1.35\n10/21/2015 12:00:00 AM,203.64,203.79,201.65,201.85,197.79,197.4980952,0.291904762\n10/22/2015 12:00:00 AM,203,205.51,201.85,205.26,199.41,198.0533333,1.356666667\n10/23/2015 12:00:00 AM,207.24,207.95,206.3,207.51,201.21,198.7490476,2.460952381\n10/26/2015 12:00:00 AM,207.27,207.37,206.56,207,201.33,199.4228571,1.907142857\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.6,201.52,200.3080952,1.211904762\n10/28/2015 12:00:00 AM,207,208.98,206.21,208.95,200.25,201.3,-1.05\n10/29/2015 12:00:00 AM,208.36,209.27,208.21,208.83,199.29,202.1190476,-2.829047619\n10/30/2015 12:00:00 AM,209.07,209.44,207.74,207.93,202.35,202.8714286,-0.521428571\n11/2/2015 12:00:00 AM,208.36,210.62,208.17,210.39,203.27,203.6042857,-0.334285714\n11/3/2015 12:00:00 AM,209.98,211.66,209.7,211,203.37,204.2009524,-0.830952381\n11/4/2015 12:00:00 AM,211.37,211.5,209.72,210.36,203.11,204.7995238,-1.68952381\n11/5/2015 12:00:00 AM,210.44,210.98,209.09,210.15,201.85,205.3109524,-3.460952381\n11/6/2015 12:00:00 AM,209.74,210.32,208.46,210.04,205.26,205.7314286,-0.471428571\n11/9/2015 12:00:00 AM,209.33,209.49,206.95,208.08,207.51,206.0528571,1.457142857\n11/10/2015 12:00:00 AM,207.54,208.6,207.19,208.56,207,206.3880952,0.611904762\n11/11/2015 12:00:00 AM,208.9,208.94,207.66,207.74,206.6,206.7447619,-0.144761905\n11/12/2015 12:00:00 AM,206.51,207.06,204.82,204.84,208.95,207.0090476,1.940952381\n11/13/2015 12:00:00 AM,204.36,204.67,202.44,202.54,208.83,207.0180952,1.811904762\n11/16/2015 12:00:00 AM,202.3,205.69,202.18,205.62,207.93,207.13,0.8\n11/17/2015 12:00:00 AM,205.97,207.04,204.88,205.47,210.39,207.23,3.16\n11/18/2015 12:00:00 AM,206.03,208.9,205.99,208.73,211,207.497619,3.502380952\n11/19/2015 12:00:00 AM,208.55,209.05,208.2,208.55,210.36,207.8166667,2.543333333\n11/20/2015 12:00:00 AM,209.47,210.12,208.86,209.31,210.15,208.0095238,2.14047619\n11/23/2015 12:00:00 AM,209.4,209.98,208.52,209.07,210.04,208.0838095,1.956190476\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,209.35,208.08,208.1957143,-0.115714286\n11/25/2015 12:00:00 AM,209.48,209.74,209.01,209.32,208.56,208.3252381,0.234761905\n11/27/2015 12:00:00 AM,209.4,209.8,208.86,209.56,207.74,208.3542857,-0.614285714\n11/30/2015 12:00:00 AM,209.79,209.89,208.56,208.69,204.84,208.347619,-3.507619048\n12/1/2015 12:00:00 AM,209.42,210.82,209.11,210.68,202.54,208.4785714,-5.938571429\n12/2/2015 12:00:00 AM,210.6,211,208.23,208.53,205.62,208.39,-2.77\n12/3/2015 12:00:00 AM,208.9,209.15,204.75,205.61,205.47,208.1333333,-2.663333333\n12/4/2015 12:00:00 AM,206.1,209.97,205.93,209.62,208.73,208.0980952,0.631904762\n12/7/2015 12:00:00 AM,209.2,209.73,207.2,208.35,208.55,208.012381,0.537619048\n12/8/2015 12:00:00 AM,206.48,208.29,205.78,206.95,209.31,207.8652381,1.444761905\n12/9/2015 12:00:00 AM,206.2,208.68,204.18,205.34,209.07,207.7347619,1.335238095\n12/10/2015 12:00:00 AM,205.44,207.43,205.14,205.87,209.35,207.6066667,1.743333333\n12/11/2015 12:00:00 AM,203.38,204.14,201.51,201.88,209.32,207.327619,1.992380952\n12/14/2015 12:00:00 AM,202.1,203.05,199.95,202.9,209.56,207.2352381,2.324761905\n12/15/2015 12:00:00 AM,204.69,206.11,202.87,205.03,208.69,207.3538095,1.336190476\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,208.03,210.68,207.4685714,3.211428571\n12/17/2015 12:00:00 AM,208.37,208.48,204.84,204.86,208.53,207.4395238,1.09047619\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,200.02,205.61,207.0247619,-1.414761905\n12/21/2015 12:00:00 AM,201.43,201.88,200.09,201.67,209.62,206.6971429,2.922857143\n12/22/2015 12:00:00 AM,202.7,203.85,201.55,203.5,208.35,206.4204762,1.92952381\n12/23/2015 12:00:00 AM,204.7,206.07,204.58,206.02,206.95,206.2752381,0.674761905\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.68,205.34,206.1004762,-0.76047619\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,205.21,205.87,205.9047619,-0.034761905\n12/29/2015 12:00:00 AM,206.53,207.79,206.47,207.4,201.88,205.8019048,-3.921904762\n12/30/2015 12:00:00 AM,207.09,207.21,205.76,205.93,202.9,205.6704762,-2.77047619\n12/31/2015 12:00:00 AM,205.17,205.89,203.87,203.87,205.03,205.3461905,-0.316190476\n1/4/2016 12:00:00 AM,200.53,201.03,198.59,201.02,208.03,204.9885714,3.041428571\n1/5/2016 12:00:00 AM,201.39,201.9,200.05,201.36,204.86,204.7861905,0.073809524\n1/6/2016 12:00:00 AM,198.33,200.06,197.6,198.82,200.02,204.2719048,-4.251904762\n1/7/2016 12:00:00 AM,195.32,197.44,193.59,194.05,201.67,203.5909524,-1.920952381\n1/8/2016 12:00:00 AM,195.21,195.85,191.58,191.92,203.5,202.8752381,0.624761905\n1/11/2016 12:00:00 AM,193.05,193.41,189.82,192.11,206.02,202.2452381,3.774761905\n1/12/2016 12:00:00 AM,193.85,194.55,191.14,193.66,205.68,201.6638095,4.016190476\n1/13/2016 12:00:00 AM,194.53,194.86,188.38,188.83,205.21,201.042381,4.167619048\n1/14/2016 12:00:00 AM,189.55,193.26,187.66,191.93,207.4,200.52,6.88\n1/15/2016 12:00:00 AM,186.79,188.76,185.52,187.81,205.93,199.7,6.23\n1/19/2016 12:00:00 AM,189.95,190.11,186.2,188.06,203.87,198.7490476,5.120952381\n1/20/2016 12:00:00 AM,185,187.5,181.02,185.65,201.02,197.8342857,3.185714286\n1/21/2016 12:00:00 AM,186.19,188.87,184.64,186.69,201.36,197.1995238,4.16047619\n1/22/2016 12:00:00 AM,189.78,190.76,188.88,190.52,198.82,196.6685714,2.151428571\n1/25/2016 12:00:00 AM,189.91,190.15,187.41,187.64,194.05,195.9133333,-1.863333333\n1/26/2016 12:00:00 AM,188.44,190.53,188.02,190.2,191.92,195.16,-3.24\n1/27/2016 12:00:00 AM,189.58,191.56,187.06,188.13,192.11,194.3242857,-2.214285714\n1/28/2016 12:00:00 AM,190,190.2,187.16,189.11,193.66,193.557619,0.102380952\n1/29/2016 12:00:00 AM,190.03,193.88,189.88,193.72,188.83,192.9061905,-4.076190476\n2/1/2016 12:00:00 AM,192.5,194.58,191.84,193.65,191.93,192.3214286,-0.391428571\n2/2/2016 12:00:00 AM,191.9,191.97,189.54,190.16,187.81,191.6685714,-3.858571429\n2/3/2016 12:00:00 AM,191.37,191.78,187.1,191.3,188.06,191.2057143,-3.145714286\n2/4/2016 12:00:00 AM,190.72,192.75,189.96,191.6,185.65,190.7409524,-5.090952381\n2/5/2016 12:00:00 AM,190.97,191.67,187.2,187.95,186.69,190.2233333,-3.533333333\n2/8/2016 12:00:00 AM,185.75,186.12,182.8,185.42,190.52,189.812381,0.707619048\n2/9/2016 12:00:00 AM,183.38,186.94,183.2,185.43,187.64,189.5033333,-1.863333333\n2/10/2016 12:00:00 AM,186.44,188.34,185.12,185.27,190.2,189.177619,1.022380952\n2/11/2016 12:00:00 AM,182.38,184.1,181.09,182.86,188.13,188.6633333,-0.533333333\n2/12/2016 12:00:00 AM,184.93,186.65,183.96,186.63,189.11,188.5585714,0.551428571\n2/16/2016 12:00:00 AM,188.78,189.81,187.63,189.78,193.72,188.4561905,5.263809524\n2/17/2016 12:00:00 AM,191.12,193.32,191.01,192.88,193.65,188.697619,4.952380952\n2/18/2016 12:00:00 AM,193.22,193.27,191.72,192.09,190.16,188.8895238,1.27047619\n2/19/2016 12:00:00 AM,191.15,192.18,190.45,192,191.3,189.1919048,2.108095238\n2/22/2016 12:00:00 AM,193.9,194.95,193.79,194.78,191.6,189.5771429,2.022857143\n2/23/2016 12:00:00 AM,193.99,194.32,192.18,192.32,187.95,189.6628571,-1.712857143\n2/24/2016 12:00:00 AM,190.62,193.53,189.32,193.2,185.42,189.927619,-4.507619048\n2/25/2016 12:00:00 AM,193.73,195.55,192.83,195.54,185.43,190.1819048,-4.751904762\n2/26/2016 12:00:00 AM,196.52,196.68,194.9,195.09,185.27,190.5133333,-5.243333333\n2/29/2016 12:00:00 AM,195.08,196.23,193.33,193.56,182.86,190.7252381,-7.865238095\n3/1/2016 12:00:00 AM,195.05,198.21,194.45,198.11,186.63,190.9342857,-4.304285714\n3/2/2016 12:00:00 AM,197.7,199.06,197.25,199,189.78,191.1890476,-1.409047619\n3/3/2016 12:00:00 AM,198.7,199.8,198.11,199.78,192.88,191.6471429,1.232857143\n3/4/2016 12:00:00 AM,200,201.35,199.03,200.43,192.09,192.0819048,0.008095238\n3/7/2016 12:00:00 AM,199.34,201.07,199.25,200.59,192,192.51,-0.51\n3/8/2016 12:00:00 AM,199.3,199.92,198.21,198.4,194.78,193.007619,1.772380952\n3/9/2016 12:00:00 AM,199.36,199.79,198.43,199.38,192.32,193.672381,-1.352380952\n3/10/2016 12:00:00 AM,199.9,201.07,197.38,199.54,193.2,194.3442857,-1.144285714\n3/11/2016 12:00:00 AM,201.25,202.81,199.52,202.76,195.54,195.1771429,0.362857143\n3/14/2016 12:00:00 AM,202.2,203.04,201.77,202.5,195.09,196.112381,-1.022380952\n3/15/2016 12:00:00 AM,201.32,202.53,201.05,202.17,193.56,196.852381,-3.292380952\n3/16/2016 12:00:00 AM,201.62,203.82,201.55,203.34,198.11,197.4980952,0.611904762\n3/17/2016 12:00:00 AM,203.26,205.23,202.77,204.63,199,198.057619,0.942380952\n3/18/2016 12:00:00 AM,204.2,204.78,203.8,204.38,199.78,198.6428571,1.137142857\n3/21/2016 12:00:00 AM,204.11,204.94,203.8,204.67,200.43,199.2461905,1.183809524\n3/22/2016 12:00:00 AM,203.74,205.23,203.57,204.56,200.59,199.7119048,0.878095238\n3/23/2016 12:00:00 AM,204.11,204.33,203.01,203.21,198.4,200.2304762,-1.83047619\n3/24/2016 12:00:00 AM,201.98,203.16,201.74,203.12,199.38,200.7028571,-1.322857143\n3/28/2016 12:00:00 AM,203.62,203.86,202.71,203.24,199.54,201.0695238,-1.52952381\n3/29/2016 12:00:00 AM,202.75,205.25,202.4,205.12,202.76,201.5471429,1.212857143\n3/30/2016 12:00:00 AM,206.35,206.87,205.59,206.02,202.5,202.1404762,0.35952381\n3/31/2016 12:00:00 AM,205.87,206.41,205.33,205.52,202.17,202.4933333,-0.323333333\n4/1/2016 12:00:00 AM,204.35,207.14,203.98,206.92,203.34,202.8704762,0.46952381\n4/4/2016 12:00:00 AM,206.84,207.07,205.89,206.25,204.63,203.1785714,1.451428571\n4/5/2016 12:00:00 AM,204.64,206.26,203.89,204.19,204.38,203.357619,1.022380952\n4/6/2016 12:00:00 AM,204.27,206.49,203.98,206.42,204.67,203.6352381,1.034761905\n4/7/2016 12:00:00 AM,205.18,205.56,203.09,203.95,204.56,203.8995238,0.66047619\n4/8/2016 12:00:00 AM,205.32,205.85,203.87,204.5,203.21,204.1433333,-0.933333333\n4/11/2016 12:00:00 AM,205.23,206.07,203.91,204.02,203.12,204.3566667,-1.236666667\n4/12/2016 12:00:00 AM,204.2,206.25,203.7,205.92,203.24,204.5071429,-1.267142857\n4/13/2016 12:00:00 AM,207.02,208.1,206.84,208,205.12,204.7690476,0.350952381\n4/14/2016 12:00:00 AM,208.03,208.6,207.6,208.01,206.02,205.0471429,0.972857143\n4/15/2016 12:00:00 AM,208,208.17,207.4,207.78,205.52,205.2585714,0.261428571\n4/18/2016 12:00:00 AM,207.11,209.28,207,209.24,206.92,205.4780952,1.441904762\n4/19/2016 12:00:00 AM,209.7,210.2,208.94,209.9,206.25,205.7409524,0.509047619\n4/20/2016 12:00:00 AM,209.9,210.92,209.39,210.1,204.19,205.9995238,-1.80952381\n4/21/2016 12:00:00 AM,210.13,210.25,208.65,208.97,206.42,206.2095238,0.21047619\n4/22/2016 12:00:00 AM,208.53,209.29,207.91,208.97,203.95,206.4838095,-2.533809524\n4/25/2016 12:00:00 AM,208.28,208.66,207.54,208.61,204.5,206.7452381,-2.245238095\n4/26/2016 12:00:00 AM,209.02,209.52,208.36,208.92,204.02,207.0157143,-2.995714286\n4/27/2016 12:00:00 AM,208.46,209.81,208.05,209.35,205.92,207.2171429,-1.297142857\n4/28/2016 12:00:00 AM,208.49,209.76,206.96,207.45,208,207.2852381,0.714761905\n4/29/2016 12:00:00 AM,206.71,207.13,205.03,206.33,208.01,207.3238095,0.686190476\n5/2/2016 12:00:00 AM,206.9,208.18,206.41,207.97,207.78,207.3738095,0.406190476\n5/3/2016 12:00:00 AM,206.5,206.8,205.28,206.16,209.24,207.3695238,1.87047619\n5/4/2016 12:00:00 AM,205,205.85,204.42,205.01,209.9,207.4085714,2.491428571\n5/5/2016 12:00:00 AM,205.57,205.98,204.47,204.97,210.1,207.3395238,2.76047619\n5/6/2016 12:00:00 AM,204.04,205.77,203.88,205.72,208.97,207.4238095,1.546190476\n5/9/2016 12:00:00 AM,205.58,206.4,205.36,205.89,208.97,207.49,1.48\n5/10/2016 12:00:00 AM,206.64,208.5,206.64,208.45,208.61,207.7009524,0.909047619\n5/11/2016 12:00:00 AM,207.89,208.54,206.5,206.5,208.92,207.7285714,1.191428571\n5/12/2016 12:00:00 AM,207.29,207.49,205.37,206.56,209.35,207.66,1.69\n5/13/2016 12:00:00 AM,206.23,206.86,204.38,204.76,207.45,207.5052381,-0.055238095\n5/16/2016 12:00:00 AM,204.95,207.34,204.89,206.78,206.33,207.457619,-1.127619048\n5/17/2016 12:00:00 AM,206.44,206.8,204.23,204.85,207.97,207.2485714,0.721428571\n5/18/2016 12:00:00 AM,204.44,206.3,203.63,204.91,206.16,207.0109524,-0.850952381\n5/19/2016 12:00:00 AM,204,204.54,202.78,204.2,205.01,206.73,-1.72\n5/20/2016 12:00:00 AM,204.95,206.1,204.86,205.49,204.97,206.5642857,-1.594285714\n5/23/2016 12:00:00 AM,205.48,205.84,204.99,205.21,205.72,206.3852381,-0.665238095\n5/24/2016 12:00:00 AM,206.15,208.24,206.14,207.87,205.89,206.35,-0.46\n5/25/2016 12:00:00 AM,208.64,209.77,207.87,209.28,208.45,206.3671429,2.082857143\n5/26/2016 12:00:00 AM,209.47,209.71,208.97,209.34,206.5,206.3666667,0.133333333\n5/27/2016 12:00:00 AM,209.55,210.25,209.47,210.24,206.56,206.4995238,0.06047619\n5/31/2016 12:00:00 AM,210.53,210.69,209.18,209.84,204.76,206.6666667,-1.906666667\n6/1/2016 12:00:00 AM,209.15,210.48,208.89,210.27,206.78,206.7761905,0.003809524\n6/2/2016 12:00:00 AM,209.8,210.93,209.24,210.91,204.85,207.002381,-2.152380952\n6/3/2016 12:00:00 AM,210.32,210.69,208.86,210.28,204.91,207.2533333,-2.343333333\n6/6/2016 12:00:00 AM,210.71,211.77,210.51,211.35,204.2,207.5571429,-3.357142857\n6/7/2016 12:00:00 AM,211.56,212.34,211.5,211.68,205.49,207.8409524,-2.350952381\n6/8/2016 12:00:00 AM,211.8,212.52,211.69,212.37,205.21,208.1495238,-2.93952381\n6/9/2016 12:00:00 AM,211.49,212.22,211.19,212.08,207.87,208.322381,-0.452380952\n6/10/2016 12:00:00 AM,210.43,210.86,209.43,210.07,209.28,208.492381,0.787619048\n6/13/2016 12:00:00 AM,209.34,210.37,208.35,208.45,209.34,208.582381,0.757619048\n6/14/2016 12:00:00 AM,207.97,208.74,206.92,208.04,210.24,208.7385714,1.501428571\n6/15/2016 12:00:00 AM,208.57,209.36,207.53,207.75,209.84,208.7847619,1.055238095\n6/16/2016 12:00:00 AM,206.74,208.57,205.59,208.37,210.27,208.952381,1.317619048\n6/17/2016 12:00:00 AM,207.14,207.2,205.75,206.52,210.91,209.0290476,1.880952381\n6/20/2016 12:00:00 AM,208.84,209.61,207.75,207.85,210.28,209.2028571,1.077142857\n6/21/2016 12:00:00 AM,208.26,208.92,207.78,208.44,211.35,209.3433333,2.006666667\n6/22/2016 12:00:00 AM,208.69,209.5,207.93,208.1,211.68,209.4809524,2.199047619\n6/23/2016 12:00:00 AM,209.83,210.87,209.27,210.81,212.37,209.6209524,2.749047619\n6/24/2016 12:00:00 AM,204,206.91,202.72,203.13,212.08,209.3280952,2.751904762\n6/27/2016 12:00:00 AM,201.59,201.6,198.65,199.6,210.07,208.8642857,1.205714286\n6/28/2016 12:00:00 AM,201.66,203.23,201.12,203.2,208.45,208.5290476,-0.079047619\n6/29/2016 12:00:00 AM,204.83,206.93,204.72,206.66,208.04,208.377619,-0.337619048\n6/30/2016 12:00:00 AM,207.18,209.54,206.56,209.48,207.75,208.34,-0.59\n7/1/2016 12:00:00 AM,209.29,210.49,209.29,209.92,208.37,208.2928571,0.077142857\n7/5/2016 12:00:00 AM,208.9,209.08,207.71,208.41,206.52,208.2038095,-1.683809524\n7/6/2016 12:00:00 AM,207.87,209.8,207.06,209.66,207.85,208.1233333,-0.273333333\n7/7/2016 12:00:00 AM,209.89,210.65,208.63,209.53,208.44,208.0209524,0.419047619\n7/8/2016 12:00:00 AM,211,212.94,210.78,212.65,208.1,208.0342857,0.065714286\n7/11/2016 12:00:00 AM,213.16,214.07,212.95,213.4,210.81,208.0971429,2.712857143\n7/12/2016 12:00:00 AM,214.51,215.3,213.43,214.95,203.13,208.3295238,-5.19952381\n7/13/2016 12:00:00 AM,215.42,215.45,214.35,214.92,199.6,208.637619,-9.037619048\n7/14/2016 12:00:00 AM,216.34,216.67,215.66,216.12,203.2,209.022381,-5.822380952\n7/15/2016 12:00:00 AM,216.79,217.01,215.31,215.83,206.66,209.4071429,-2.747142857\n7/18/2016 12:00:00 AM,215.95,216.6,215.67,216.41,209.48,209.79,-0.31\n7/19/2016 12:00:00 AM,215.88,216.23,215.63,216.19,209.92,210.2504762,-0.33047619\n7/20/2016 12:00:00 AM,216.75,217.37,216.24,217.09,208.41,210.6904762,-2.28047619\n7/21/2016 12:00:00 AM,216.92,217.22,215.75,216.27,209.66,211.0633333,-1.403333333\n7/22/2016 12:00:00 AM,216.39,217.3,216.1,217.24,209.53,211.4985714,-1.968571429\n7/25/2016 12:00:00 AM,217,217.06,215.97,216.65,212.65,211.7766667,0.873333333\n7/26/2016 12:00:00 AM,216.53,217.17,215.76,216.75,213.4,212.4252381,0.974761905\n7/27/2016 12:00:00 AM,217.17,217.27,215.62,216.52,214.95,213.2309524,1.719047619\n7/28/2016 12:00:00 AM,216.26,217.11,215.75,216.77,214.92,213.8771429,1.042857143\n7/29/2016 12:00:00 AM,216.45,217.54,216.13,217.12,216.12,214.3752381,1.744761905\n8/1/2016 12:00:00 AM,217.15,217.65,216.41,216.94,215.83,214.7304762,1.09952381\n8/2/2016 12:00:00 AM,216.64,216.83,214.57,215.55,216.41,214.9985714,1.411428571\n8/3/2016 12:00:00 AM,215.45,216.25,215.13,216.18,216.19,215.3685714,0.821428571\n8/4/2016 12:00:00 AM,216.3,216.78,214.25,216.41,217.09,215.69,1.4\n8/5/2016 12:00:00 AM,217.19,218.23,217.07,218.18,216.27,216.1019048,0.168095238\n8/8/2016 12:00:00 AM,218.39,218.52,217.74,218.05,217.24,216.3590476,0.880952381\n8/9/2016 12:00:00 AM,218.12,218.76,217.8,218.18,216.65,216.5866667,0.063333333\n8/10/2016 12:00:00 AM,218.29,218.4,217.23,217.64,216.75,216.7147619,0.035238095\n8/11/2016 12:00:00 AM,218.25,218.94,217.95,218.65,216.52,216.892381,-0.372380952\n8/12/2016 12:00:00 AM,218.26,218.71,217.99,218.46,216.77,217.0038095,-0.233809524\n8/15/2016 12:00:00 AM,218.89,219.5,218.88,219.09,217.12,217.1590476,-0.039047619\n8/16/2016 12:00:00 AM,218.56,218.68,217.96,217.96,216.94,217.2328571,-0.292857143\n8/17/2016 12:00:00 AM,217.98,218.53,217.02,218.37,215.55,217.3366667,-1.786666667\n8/18/2016 12:00:00 AM,218.31,218.9,218.21,218.86,216.18,217.4209524,-1.240952381\n8/19/2016 12:00:00 AM,218.34,218.75,217.74,218.54,216.41,217.5290476,-1.119047619\n8/22/2016 12:00:00 AM,218.25,218.8,217.83,218.53,218.18,217.5904762,0.58952381\n8/23/2016 12:00:00 AM,219.23,219.6,218.9,218.97,218.05,217.7009524,0.349047619\n8/24/2016 12:00:00 AM,218.8,218.91,217.36,217.85,218.18,217.7533333,0.426666667\n8/25/2016 12:00:00 AM,217.4,218.19,217.22,217.7,217.64,217.8095238,-0.16952381\n8/26/2016 12:00:00 AM,217.9,219.12,216.25,217.29,218.65,217.8342857,0.815714286\n8/29/2016 12:00:00 AM,217.43,218.67,217.4,218.36,218.46,217.8933333,0.566666667\n8/30/2016 12:00:00 AM,218.25,218.59,217.35,218,219.09,217.9438095,1.146190476\n8/31/2016 12:00:00 AM,217.64,217.75,216.47,217.38,217.96,218.0309524,-0.070952381\n9/1/2016 12:00:00 AM,217.38,217.73,216.03,217.39,218.37,218.0885714,0.281428571\n9/2/2016 12:00:00 AM,218.36,218.87,217.7,218.37,218.86,218.1819048,0.678095238\n9/6/2016 12:00:00 AM,218.72,219.12,217.86,219.03,218.54,218.222381,0.317619048\n9/7/2016 12:00:00 AM,218.84,219.22,218.3,219.01,218.53,218.2680952,0.261904762\n9/8/2016 12:00:00 AM,218.6,218.94,218.15,218.51,218.97,218.2838095,0.686190476\n9/9/2016 12:00:00 AM,217,217.03,213.25,213.28,217.85,218.0761905,-0.226190476\n9/12/2016 12:00:00 AM,212.39,216.81,212.31,216.34,217.7,217.9661905,-0.266190476\n9/13/2016 12:00:00 AM,214.85,215.15,212.5,213.23,217.29,217.7171429,-0.427142857\n9/14/2016 12:00:00 AM,213.29,214.7,212.5,213.15,218.36,217.4342857,0.925714286\n9/15/2016 12:00:00 AM,213,215.73,212.75,215.28,218,217.3066667,0.693333333\n9/16/2016 12:00:00 AM,213.5,213.69,212.57,213.37,217.38,217.0685714,0.311428571\n9/19/2016 12:00:00 AM,214.1,214.88,213.03,213.41,217.39,216.8090476,0.580952381\n9/20/2016 12:00:00 AM,214.43,214.59,213.38,213.42,218.37,216.5652381,1.804761905\n9/21/2016 12:00:00 AM,214.22,216.03,213.44,215.82,219.03,216.4361905,2.593809524\n9/22/2016 12:00:00 AM,216.99,217.53,216.71,217.18,219.01,216.3509524,2.659047619\n9/23/2016 12:00:00 AM,216.73,216.88,215.88,215.99,218.51,216.262381,2.247619048\n9/26/2016 12:00:00 AM,215.02,215.23,214.01,214.24,213.28,216.097619,-2.817619048\n9/27/2016 12:00:00 AM,214.03,215.68,213.62,215.57,216.34,216.0157143,0.324285714\n9/28/2016 12:00:00 AM,215.81,216.82,214.71,216.64,213.23,215.9338095,-2.703809524\n9/29/2016 12:00:00 AM,216.39,216.87,214.04,214.68,213.15,215.7757143,-2.625714286\n9/30/2016 12:00:00 AM,215.67,217.12,215.36,216.3,215.28,215.7242857,-0.444285714\n10/3/2016 12:00:00 AM,215.81,216.04,215.04,215.78,213.37,215.647619,-2.277619048\n10/4/2016 12:00:00 AM,215.86,216.17,213.99,214.68,213.41,215.4719048,-2.061904762\n10/5/2016 12:00:00 AM,215.37,216.13,215.33,215.63,213.42,215.31,-1.89\n10/6/2016 12:00:00 AM,215.39,216.04,214.74,215.78,215.82,215.1561905,0.663809524\n10/7/2016 12:00:00 AM,216.06,216.3,214.19,215.04,217.18,214.9909524,2.189047619\n10/10/2016 12:00:00 AM,216.14,216.7,215.99,216.16,215.99,215.1280952,0.861904762\n10/11/2016 12:00:00 AM,215.64,215.74,212.58,213.43,214.24,214.9895238,-0.74952381\n10/12/2016 12:00:00 AM,213.61,214.32,213.01,213.71,215.57,215.012381,0.557619048\n10/13/2016 12:00:00 AM,212.15,213.59,211.21,213.01,216.64,215.0057143,1.634285714\n10/14/2016 12:00:00 AM,214.14,214.69,213.03,213.12,214.68,214.9028571,-0.222857143\n10/17/2016 12:00:00 AM,213.07,213.39,212.17,212.38,216.3,214.8557143,1.444285714\n10/18/2016 12:00:00 AM,214.24,214.31,213.27,213.71,215.78,214.87,0.91\n10/19/2016 12:00:00 AM,214,214.64,213.6,214.28,214.68,214.9109524,-0.230952381\n10/20/2016 12:00:00 AM,213.85,214.53,213.11,213.88,215.63,214.8185714,0.811428571\n10/21/2016 12:00:00 AM,212.95,214.08,212.76,213.98,215.78,214.6661905,1.113809524\n10/24/2016 12:00:00 AM,214.98,215.32,214.48,214.89,215.04,214.6138095,0.426190476\n10/25/2016 12:00:00 AM,214.7,214.98,213.98,214.17,216.16,214.6104762,1.54952381\n10/26/2016 12:00:00 AM,213.22,214.42,212.93,213.74,213.43,214.5233333,-1.093333333\n10/27/2016 12:00:00 AM,214.57,214.62,213.08,213.17,213.71,214.3580952,-0.648095238\n10/28/2016 12:00:00 AM,213.13,213.93,211.71,212.54,213.01,214.2561905,-1.246190476\n10/31/2016 12:00:00 AM,212.95,213.19,212.36,212.55,213.12,214.077619,-0.957619048\n11/1/2016 12:00:00 AM,212.9,212.99,209.6,211.01,212.38,213.8504762,-1.47047619\n11/2/2016 12:00:00 AM,210.67,211.1,209.23,209.74,213.71,213.6152381,0.094761905\n11/3/2016 12:00:00 AM,210.01,210.24,208.46,208.78,214.28,213.2890476,0.990952381\n11/4/2016 12:00:00 AM,208.91,209.89,208.38,208.55,213.88,212.9447619,0.935238095\n11/7/2016 12:00:00 AM,211.47,213.19,211.3,213.15,213.98,212.8547619,1.125238095\n11/8/2016 12:00:00 AM,212.72,214.77,212.38,214.11,214.89,212.7571429,2.132857143\n11/9/2016 12:00:00 AM,212.47,217.1,212.34,216.38,214.17,212.897619,1.272380952\n11/10/2016 12:00:00 AM,217.35,218.31,215.22,216.92,213.74,213.0504762,0.68952381\n11/11/2016 12:00:00 AM,216.13,216.7,215.32,216.42,213.17,213.2128571,-0.042857143\n11/14/2016 12:00:00 AM,216.99,217.27,215.72,216.59,212.54,213.3780952,-0.838095238\n11/15/2016 12:00:00 AM,217,218.28,216.8,218.28,212.55,213.6590476,-1.109047619\n11/16/2016 12:00:00 AM,217.52,218.14,217.42,217.87,211.01,213.8571429,-2.847142857\n11/17/2016 12:00:00 AM,218.04,219.06,217.92,218.99,209.74,214.0814286,-4.341428571\n11/18/2016 12:00:00 AM,219.04,219.27,218.29,218.5,208.78,214.3014286,-5.521428571\n11/21/2016 12:00:00 AM,219.19,220.18,219,220.15,208.55,214.5952381,-6.045238095\n11/22/2016 12:00:00 AM,220.49,220.79,219.73,220.58,213.15,214.8661905,-1.716190476\n11/23/2016 12:00:00 AM,220,220.76,219.75,220.7,214.11,215.1771429,-1.067142857\n11/25/2016 12:00:00 AM,221.12,221.56,221.01,221.52,216.38,215.547619,0.832380952\n11/28/2016 12:00:00 AM,221.19,221.48,220.36,220.48,216.92,215.8957143,1.024285714\n11/29/2016 12:00:00 AM,220.58,221.44,220.17,220.91,216.42,216.2942857,0.125714286\n11/30/2016 12:00:00 AM,221.65,221.82,220.31,220.38,216.59,216.6671429,-0.077142857\n12/1/2016 12:00:00 AM,220.73,220.73,219.15,219.57,218.28,217.0747619,1.205238095\n12/2/2016 12:00:00 AM,219.7,220.25,219.26,219.68,217.87,217.5480952,0.321904762\n12/5/2016 12:00:00 AM,220.67,221.4,220.42,221,218.99,218.13,0.86\n12/6/2016 12:00:00 AM,221.24,221.74,220.66,221.7,218.5,218.7561905,-0.256190476\n12/7/2016 12:00:00 AM,221.5,224.67,221.38,224.6,220.15,219.3014286,0.848571429\n12/8/2016 12:00:00 AM,224.58,225.7,224.26,225.15,220.58,219.8271429,0.752857143\n12/9/2016 12:00:00 AM,225.44,226.53,225.37,226.51,220.7,220.3095238,0.39047619\n12/12/2016 12:00:00 AM,226.42,226.96,225.76,226.25,221.52,220.7538095,0.766190476\n12/13/2016 12:00:00 AM,227.01,228.34,227,227.76,220.48,221.2938095,-0.813809524\n12/14/2016 12:00:00 AM,227.41,228.23,225.37,225.88,220.91,221.7361905,-0.826190476\n12/15/2016 12:00:00 AM,226.13,227.81,225.89,226.81,220.38,222.142381,-1.762380952\n12/16/2016 12:00:00 AM,225.99,226.08,224.67,225.04,219.57,222.4838095,-2.913809524\n12/19/2016 12:00:00 AM,225.24,226.02,225.08,225.53,219.68,222.7952381,-3.115238095\n12/20/2016 12:00:00 AM,226.16,226.57,225.88,226.4,221,223.1714286,-2.171428571\n12/21/2016 12:00:00 AM,226.27,226.45,225.77,225.77,221.7,223.4390476,-1.739047619\n12/22/2016 12:00:00 AM,225.61,225.74,224.92,225.38,224.6,223.667619,0.932380952\n12/23/2016 12:00:00 AM,225.42,225.72,225.21,225.71,225.15,223.9061905,1.243809524\n12/27/2016 12:00:00 AM,226,226.73,226,226.27,226.51,224.132381,2.377619048\n12/28/2016 12:00:00 AM,226.59,226.59,224.27,224.4,226.25,224.3190476,1.930952381\n12/29/2016 12:00:00 AM,224.47,224.89,223.84,224.35,227.76,224.4828571,3.277142857\n12/30/2016 12:00:00 AM,224.71,224.83,222.73,223.53,225.88,224.6328571,1.247142857\n1/3/2017 12:00:00 AM,225.07,225.83,223.88,225.24,226.81,224.9028571,1.907142857\n1/4/2017 12:00:00 AM,225.64,226.75,225.61,226.58,225.04,225.2314286,-0.191428571\n1/5/2017 12:00:00 AM,226.28,226.58,225.48,226.4,225.53,225.4885714,0.041428571\n1/6/2017 12:00:00 AM,226.53,227.75,225.9,227.21,226.4,225.7509524,0.649047619\n1/9/2017 12:00:00 AM,226.9,227.07,226.42,226.46,225.77,225.8395238,-0.06952381\n1/10/2017 12:00:00 AM,226.47,227.45,226.01,226.46,225.38,225.9019048,-0.521904762\n1/11/2017 12:00:00 AM,226.38,227.1,225.59,227.1,225.71,225.93,-0.22\n1/12/2017 12:00:00 AM,226.5,226.75,224.96,226.53,226.27,225.9433333,0.326666667\n1/13/2017 12:00:00 AM,226.75,227.4,226.69,227.05,224.4,225.9095238,-1.50952381\n1/17/2017 12:00:00 AM,226.3,226.78,225.8,226.25,224.35,225.9271429,-1.577142857\n1/18/2017 12:00:00 AM,226.52,226.8,225.9,226.75,223.53,225.9242857,-2.394285714\n1/19/2017 12:00:00 AM,226.83,227,225.41,225.91,225.24,225.9657143,-0.725714286\n1/20/2017 12:00:00 AM,226.73,227.31,225.97,226.74,226.58,226.0233333,0.556666667\n1/23/2017 12:00:00 AM,226.37,226.81,225.27,226.15,226.4,226.0114286,0.388571429\n1/24/2017 12:00:00 AM,226.4,228.08,226.27,227.6,227.21,226.0985714,1.111428571\n1/25/2017 12:00:00 AM,228.7,229.57,228.51,229.57,226.46,226.2980952,0.161904762\n1/26/2017 12:00:00 AM,229.42,229.71,229.01,229.33,226.46,226.4704762,-0.01047619\n1/27/2017 12:00:00 AM,229.44,229.59,228.76,228.97,227.1,226.5990476,0.500952381\n1/30/2017 12:00:00 AM,228.18,228.2,226.41,227.55,226.53,226.7490476,-0.219047619\n1/31/2017 12:00:00 AM,227.01,227.6,226.32,227.53,227.05,226.9004762,0.14952381\n2/1/2017 12:00:00 AM,228.28,228.59,226.94,227.62,226.25,227.0952381,-0.845238095\n2/2/2017 12:00:00 AM,227.24,228.1,226.82,227.77,226.75,227.2157143,-0.465714286\n2/3/2017 12:00:00 AM,228.85,229.55,228.46,229.34,225.91,227.3471429,-1.437142857\n2/6/2017 12:00:00 AM,228.89,229.33,228.54,228.93,226.74,227.467619,-0.727619048\n2/7/2017 12:00:00 AM,229.36,229.66,228.72,228.94,226.15,227.55,-1.4\n2/8/2017 12:00:00 AM,228.59,229.39,228.31,229.24,227.6,227.682381,-0.082380952\n2/9/2017 12:00:00 AM,229.57,230.95,229.52,230.6,229.57,227.8795238,1.69047619\n2/10/2017 12:00:00 AM,231,231.77,230.62,231.51,229.33,228.0895238,1.24047619\n2/13/2017 12:00:00 AM,232.09,233.07,232.05,232.77,228.97,228.3866667,0.583333333\n2/14/2017 12:00:00 AM,232.55,233.71,232.16,233.7,227.55,228.7033333,-1.153333333\n2/15/2017 12:00:00 AM,233.43,235.14,233.39,234.92,227.53,229.1161905,-1.586190476\n2/16/2017 12:00:00 AM,234.93,235.16,233.85,234.72,227.62,229.4957143,-1.875714286\n2/17/2017 12:00:00 AM,233.97,235.09,233.93,235.09,227.77,229.9328571,-2.162857143\n2/21/2017 12:00:00 AM,235.51,236.69,235.51,236.49,229.34,230.3971429,-1.057142857\n2/22/2017 12:00:00 AM,236.02,236.54,235.83,236.28,228.93,230.8795238,-1.94952381\n2/23/2017 12:00:00 AM,236.9,236.9,235.56,236.44,228.94,231.3004762,-2.36047619\n2/24/2017 12:00:00 AM,235.42,236.79,235.41,236.74,229.24,231.6419048,-2.401904762\n2/27/2017 12:00:00 AM,236.61,237.31,236.35,237.11,230.6,232.012381,-1.412380952\n2/28/2017 12:00:00 AM,236.71,236.95,236.02,236.47,231.51,232.3695238,-0.85952381\n3/1/2017 12:00:00 AM,238.4,240.32,238.37,239.78,232.77,232.9519048,-0.181904762\n3/2/2017 12:00:00 AM,239.57,239.57,238.21,238.27,233.7,233.4633333,0.236666667\n3/3/2017 12:00:00 AM,238.19,238.61,237.73,238.42,234.92,233.977619,0.942380952\n3/6/2017 12:00:00 AM,237.48,238.12,237.01,237.71,234.72,234.4509524,0.269047619\n3/7/2017 12:00:00 AM,237.39,237.77,236.76,237,235.09,234.8157143,0.274285714\n3/8/2017 12:00:00 AM,237.31,237.64,236.4,236.56,236.49,235.1790476,1.310952381\n3/9/2017 12:00:00 AM,236.71,237.24,235.74,236.86,236.28,235.5561905,0.723809524\n3/10/2017 12:00:00 AM,237.95,238.02,236.59,237.69,236.44,235.9585714,0.481428571\n3/13/2017 12:00:00 AM,237.59,237.86,237.24,237.81,236.74,236.3019048,0.438095238\n3/14/2017 12:00:00 AM,237.22,237.24,236.19,236.9,237.11,236.5585714,0.551428571\n3/15/2017 12:00:00 AM,237.56,239.44,237.29,238.95,236.47,236.8528571,-0.382857143\n3/16/2017 12:00:00 AM,239.12,239.2,238.1,238.48,239.78,237.0804762,2.69952381\n3/17/2017 12:00:00 AM,237.75,237.97,237.03,237.03,238.27,237.1809524,1.089047619\n3/20/2017 12:00:00 AM,237.01,237.36,236.32,236.77,238.42,237.2785714,1.141428571\n3/21/2017 12:00:00 AM,237.49,237.61,233.58,233.73,237.71,237.2138095,0.496190476\n3/22/2017 12:00:00 AM,233.73,234.61,233.05,234.28,237,237.1085714,-0.108571429\n3/23/2017 12:00:00 AM,233.98,235.34,233.6,234.03,236.56,237.0014286,-0.441428571\n3/24/2017 12:00:00 AM,234.35,235.04,232.96,233.86,236.86,236.8785714,-0.018571429\n3/27/2017 12:00:00 AM,231.97,233.92,231.61,233.62,237.69,236.73,0.96\n3/28/2017 12:00:00 AM,233.32,235.81,233.14,235.32,237.81,236.6447619,1.165238095\n3/29/2017 12:00:00 AM,235,235.81,234.73,235.54,236.9,236.6004762,0.29952381\n3/30/2017 12:00:00 AM,235.5,236.52,235.27,236.29,238.95,236.4342857,2.515714286\n3/31/2017 12:00:00 AM,235.91,236.51,235.68,235.74,238.48,236.3138095,2.166190476\n4/3/2017 12:00:00 AM,235.79,236.03,233.91,235.33,237.03,236.1666667,0.863333333\n4/4/2017 12:00:00 AM,235,235.58,234.56,235.48,236.77,236.0604762,0.70952381\n4/5/2017 12:00:00 AM,236.26,237.39,234.54,234.78,233.73,235.9547619,-2.224761905\n4/6/2017 12:00:00 AM,234.96,236.04,234.43,235.44,234.28,235.9014286,-1.621428571\n4/7/2017 12:00:00 AM,235.18,236,234.64,235.2,234.03,235.822381,-1.792380952\n4/10/2017 12:00:00 AM,235.36,236.26,234.73,235.34,233.86,235.7104762,-1.85047619\n4/11/2017 12:00:00 AM,234.9,235.18,233.34,235.06,233.62,235.5795238,-1.95952381\n4/12/2017 12:00:00 AM,234.8,234.96,233.77,234.03,235.32,235.4428571,-0.122857143\n4/13/2017 12:00:00 AM,233.65,234.49,232.51,232.51,235.54,235.1361905,0.403809524\n4/17/2017 12:00:00 AM,233.12,234.57,232.88,234.57,236.29,234.95,1.34\n4/18/2017 12:00:00 AM,233.71,234.49,233.08,233.87,235.74,234.7995238,0.94047619\n4/19/2017 12:00:00 AM,234.52,234.95,233.18,233.44,235.33,234.6409524,0.689047619\n4/20/2017 12:00:00 AM,234.14,235.85,233.78,235.34,235.48,234.717619,0.762380952\n4/21/2017 12:00:00 AM,235.22,235.31,234.13,234.59,234.78,234.732381,0.047619048\n4/24/2017 12:00:00 AM,237.17,237.41,236.61,237.17,235.44,234.8819048,0.558095238\n4/25/2017 12:00:00 AM,237.93,238.95,237.81,238.55,235.2,235.1052381,0.094761905\n4/26/2017 12:00:00 AM,238.53,239.53,238.35,238.4,235.34,235.3328571,0.007142857\n4/27/2017 12:00:00 AM,238.74,238.95,237.98,238.6,235.06,235.4890476,-0.429047619\n4/28/2017 12:00:00 AM,238.93,238.93,237.93,238.08,234.03,235.61,-1.58\n5/1/2017 12:00:00 AM,238.66,239.17,238.2,238.68,232.51,235.7238095,-3.213809524\n5/2/2017 12:00:00 AM,238.82,238.98,238.3,238.77,234.57,235.8680952,-1.298095238\n5/3/2017 12:00:00 AM,238.29,238.88,237.7,238.48,233.87,236.0180952,-2.148095238\n5/4/2017 12:00:00 AM,238.81,238.92,237.78,238.76,233.44,236.1742857,-2.734285714\n5/5/2017 12:00:00 AM,239.16,239.72,238.68,239.7,235.34,236.4085714,-1.068571429\n5/8/2017 12:00:00 AM,239.77,239.92,239.17,239.66,234.59,236.6095238,-2.01952381\n5/9/2017 12:00:00 AM,239.94,240.19,239.04,239.44,237.17,236.8114286,0.358571429\n5/10/2017 12:00:00 AM,239.37,239.87,239.15,239.87,238.55,237.0271429,1.522857143\n5/11/2017 12:00:00 AM,239.31,239.57,238.13,239.38,238.4,237.2328571,1.167142857\n5/12/2017 12:00:00 AM,239.05,239.43,238.67,238.98,238.6,237.4685714,1.131428571\n5/15/2017 12:00:00 AM,239.49,240.44,239.45,240.3,238.08,237.8395238,0.24047619\n5/16/2017 12:00:00 AM,240.64,240.67,239.63,240.08,238.68,238.1019048,0.578095238\n5/17/2017 12:00:00 AM,238.09,238.64,235.75,235.82,238.77,238.1947619,0.575238095\n5/18/2017 12:00:00 AM,235.7,237.75,235.43,236.77,238.48,238.3533333,0.126666667\n5/19/2017 12:00:00 AM,237.36,239.08,237.27,238.31,238.76,238.4947619,0.265238095\n5/22/2017 12:00:00 AM,238.87,239.71,238.82,239.52,239.7,238.7295238,0.97047619\n5/23/2017 12:00:00 AM,239.98,240.24,239.51,240.05,239.66,238.8666667,0.793333333\n5/24/2017 12:00:00 AM,240.33,240.73,239.93,240.61,239.44,238.9647619,0.475238095\n5/25/2017 12:00:00 AM,241.22,242.08,240.96,241.76,239.87,239.1247619,0.745238095\n5/26/2017 12:00:00 AM,241.59,241.9,241.45,241.71,239.38,239.2728571,0.107142857\n5/30/2017 12:00:00 AM,241.32,241.79,241.16,241.5,238.98,239.4357143,-0.455714286\n5/31/2017 12:00:00 AM,241.84,241.88,240.64,241.44,240.3,239.5671429,0.732857143\n6/1/2017 12:00:00 AM,241.97,243.38,241.64,243.36,240.08,239.7857143,0.294285714\n6/2/2017 12:00:00 AM,243.45,244.35,243.08,244.17,235.82,240.0566667,-4.236666667\n6/5/2017 12:00:00 AM,244.02,244.3,243.76,243.99,236.77,240.3057143,-3.535714286\n6/6/2017 12:00:00 AM,243.34,243.98,243.12,243.21,238.31,240.4728571,-2.162857143\n6/7/2017 12:00:00 AM,243.61,243.92,242.83,243.66,239.52,240.6633333,-1.143333333\n6/8/2017 12:00:00 AM,243.8,244.33,243.17,243.78,240.05,240.87,-0.82\n6/9/2017 12:00:00 AM,244.07,245.01,241.95,243.41,240.61,241.0385714,-0.428571429\n6/12/2017 12:00:00 AM,243.09,243.42,242.38,243.36,241.76,241.2280952,0.531904762\n6/13/2017 12:00:00 AM,243.98,244.61,243.58,244.55,241.71,241.4933333,0.216666667\n6/14/2017 12:00:00 AM,244.86,244.87,243.29,244.24,241.5,241.6809524,-0.180952381\n6/15/2017 12:00:00 AM,242.69,243.91,242.36,243.77,241.44,241.8566667,-0.416666667\n6/16/2017 12:00:00 AM,242.83,242.83,241.63,242.64,243.36,242.1814286,1.178571429\n6/19/2017 12:00:00 AM,243.61,244.73,243.48,244.66,244.17,242.5571429,1.612857143\n6/20/2017 12:00:00 AM,244.23,244.26,242.99,243.01,243.99,242.7809524,1.209047619\n6/21/2017 12:00:00 AM,243.46,243.59,242.41,242.95,243.21,242.9442857,0.265714286\n6/22/2017 12:00:00 AM,242.96,243.53,242.64,242.84,243.66,243.0771429,0.582857143\n6/23/2017 12:00:00 AM,242.88,243.51,242.47,243.13,243.78,243.1971429,0.582857143\n6/26/2017 12:00:00 AM,243.93,244.38,243.05,243.29,243.41,243.27,0.14\n6/27/2017 12:00:00 AM,243.01,243.38,241.31,241.33,243.36,243.2519048,0.108095238\n6/28/2017 12:00:00 AM,242.51,243.72,242.23,243.49,244.55,243.3466667,1.203333333\n6/29/2017 12:00:00 AM,243.62,243.72,239.96,241.35,244.24,243.342381,0.897619048\n6/30/2017 12:00:00 AM,242.3,242.71,241.58,241.8,243.77,243.2680952,0.501904762\n7/3/2017 12:00:00 AM,242.9,243.38,242.21,242.21,242.64,243.1747619,-0.534761905\n7/5/2017 12:00:00 AM,242.61,243.01,241.7,242.77,244.66,243.1166667,1.543333333\n7/6/2017 12:00:00 AM,241.86,242.03,240.34,240.55,243.01,242.99,0.02\n7/7/2017 12:00:00 AM,241.18,242.28,240.56,242.11,242.95,242.9161905,0.033809524\n7/10/2017 12:00:00 AM,241.98,242.8,241.76,242.37,242.84,242.8490476,-0.009047619\n7/11/2017 12:00:00 AM,242.12,242.55,240.85,242.19,243.13,242.7909524,0.339047619\n7/12/2017 12:00:00 AM,243.31,244.2,243.3,244.01,243.29,242.8219048,0.468095238\n7/13/2017 12:00:00 AM,244.02,244.55,243.76,244.42,241.33,242.8157143,-1.485714286\n7/14/2017 12:00:00 AM,244.4,245.97,244.31,245.56,243.49,242.8785714,0.611428571\n7/17/2017 12:00:00 AM,245.44,245.91,245.33,245.53,241.35,242.962381,-1.612380952\n7/18/2017 12:00:00 AM,245.06,245.72,244.67,245.66,241.8,243.1061905,-1.306190476\n7/19/2017 12:00:00 AM,246.01,247,246.01,246.99,242.21,243.2171429,-1.007142857\n7/20/2017 12:00:00 AM,247.25,247.42,246.47,247.1,242.77,243.4119048,-0.641904762\n7/21/2017 12:00:00 AM,246.43,246.91,246.18,246.88,240.55,243.5990476,-3.049047619\n7/24/2017 12:00:00 AM,246.81,246.98,246.28,246.82,242.11,243.7885714,-1.678571429\n7/25/2017 12:00:00 AM,247.7,247.8,247.16,247.42,242.37,243.9928571,-1.622857143\n7/26/2017 12:00:00 AM,247.78,247.79,247.13,247.43,242.19,244.19,-2\n7/27/2017 12:00:00 AM,247.96,248,245.68,247.2,244.01,244.4695238,-0.45952381\n7/28/2017 12:00:00 AM,246.7,247.06,246.13,246.91,244.42,244.632381,-0.212380952\n7/31/2017 12:00:00 AM,247.38,247.48,246.53,246.77,245.56,244.8904762,0.66952381\n8/1/2017 12:00:00 AM,247.45,247.5,246.72,247.32,245.53,245.1533333,0.376666667\n8/2/2017 12:00:00 AM,247.47,247.6,246.37,247.44,245.66,245.402381,0.257619048\n8/3/2017 12:00:00 AM,247.31,247.34,246.64,246.96,246.99,245.6019048,1.388095238\n8/4/2017 12:00:00 AM,247.52,247.79,246.97,247.41,247.1,245.9285714,1.171428571\n8/7/2017 12:00:00 AM,247.5,247.87,247.37,247.87,246.88,246.2028571,0.677142857\n8/8/2017 12:00:00 AM,247.49,248.91,246.83,247.26,246.82,246.4357143,0.384285714\n8/9/2017 12:00:00 AM,246.46,247.31,246.06,247.25,247.42,246.6766667,0.743333333\n8/10/2017 12:00:00 AM,246.3,246.44,243.7,243.76,247.43,246.6647619,0.765238095\n8/11/2017 12:00:00 AM,244,244.8,243.75,244.12,247.2,246.6504762,0.54952381\n8/14/2017 12:00:00 AM,245.55,246.79,245.55,246.54,246.91,246.6971429,0.212857143\n8/15/2017 12:00:00 AM,247,247,246.16,246.51,246.77,246.7438095,0.026190476\n8/16/2017 2:46:32 PM,247.09,247.57,246.45,246.74,247.32,246.7952381,0.524761905\n"
  },
  {
    "path": "Tests/TestData/spy_ema.csv",
    "content": "time,close,EMA14\n725898600,43.938,NaN\n728577000,44.40625,NaN\n730996200,45.1875,NaN\n733674600,44.03125,NaN\n736435800,45.21875,NaN\n738941400,45.0625,NaN\n741533400,44.84375,NaN\n744298200,46.5625,NaN\n746890200,45.9375,NaN\n749482200,46.84375,NaN\n752164200,46.34375,NaN\n754756200,46.59375,NaN\n757607400,48.21875,NaN\n760113000,46.8125,45.71432142857143\n762532200,44.59375,45.56491190476191\n765210600,45.09375,45.50209031746032\n767885400,45.8125,45.54347827513228\n770477400,44.46875,45.40018117178131\n773069400,45.90625,45.46765701554381\n775747800,47.65625,45.7594694134713\n778426200,46.17187,45.81445615834179\n781191000,47.48437,46.037111337229554\n783700200,45.59375,45.97799649226561\n786292200,45.5625,45.92259695996353\n789057000,47.09375,46.078750698635055\n791649000,49.01562,46.470333272150384\n794068200,50.10937,46.955538169197\n796915800,51.59375,47.57396641330406\n799335000,53.64062,48.38285355819686\n802013400,54.40625,49.18597308377061\n804778200,56.15625,50.115343339267866\n807283800,56.40625,50.954130894032154\n809962200,58.48437,51.95816277482787\n812640600,58.3125,52.80540773818415\n815236200,60.90625,53.8855200397596\n817828200,61.48437,54.898700034458315\n820506600,63.67187,56.068456029863874\n823185000,63.875,57.109328559215356\n825690600,64.6875,58.11975141798664\n828369000,65.39062,59.08920056225509\n830957400,66.875,60.12730715395441\n833808600,67.10937,61.05824886676049\n836227800,64.09375,61.46298235119243\n838906200,65.32812,61.97833403770011\n841671000,68.625,62.86455616600676\n844176600,70.84375,63.92844867720586\n846858600,76.01562,65.54007152024508\n849537000,73.84375,66.64722865087907\n852129000,78.40625,68.2150981640952\n854980200,79.15625,69.6739184088825\n857399400,75.6875,70.47572928769817\n859905000,80.09375,71.75813204933841\n862493400,85.15625,73.5445477760933\n865258200,88.3125,75.51360807261419\n867763800,95.3125,78.15346032959897\n870442200,90.375,79.7829989523191\n873120600,94.375,81.72859909200989\n875712600,92.0625,83.10645254640856\n878567400,95.625,84.77559220688742\n880986600,97.0625,86.41384657930243\n883665000,98.3125,88.00033370206211\n886429800,105.125,90.28362254178715\n888849000,109.9375,92.90413953621554\n891441000,111.34375,95.36275426472014\n894029400,109.03125,97.18522036275745\n896707800,113.3125,99.33552431438979\n899299800,111.78125,100.99495440580448\n902151000,96,100.32896048503055\n904656600,101.75,100.51843242035982\n907248600,110,101.7826414309785\n910017000,116.125,103.69495590684804\n912522600,123.3125,106.31062845260163\n915201000,127.65625,109.15671132558808\n917879400,123.5625,111.077483148843\n920298600,128.375,113.38381872899727\n922977000,133.25,116.0326428984643\n925738200,130.20312,117.92203984533573\n928243800,137,120.46576786595763\n930835800,132.75,122.10366548382994\n933600600,132.0625,123.43151008598595\n936192600,128.75,124.14064207452115\n938784600,137,125.85522313125166\n941466600,139.39062,127.65994271375145\n944058600,146.875,130.2219503519179\n946909800,139.625,131.4756903049955\n949415400,137.4375,132.27059826432944\n951921000,150.375,134.68451849575217\n954768600,145.09375,136.0724160296519\n957187800,142.8125,136.97109389236496\n959866200,145.28125,138.0791147067163\n962631000,142.90625,138.7227327458208\n965136600,152.34375,140.53886837971135\n967815000,143.625,140.95035259574982\n970493400,142.95312,141.21738824964984\n973089000,132.28125,140.02590314969652\n975681000,131.1875,138.84744939640365\n978445800,137.02,138.60378947688315\n981037800,123.95,136.6499508799654\n983457000,116.69,133.98862409597\n986218200,124.91,132.77814088317402\n988723800,125.95,131.86772209875082\n991402200,122.60001,130.6320271522507\n994080600,121.35001,129.39442486528395\n996672600,114.14999,127.36183354991276\n999610200,104.44,124.30558907659106\n1001943000,105.8,121.83817719971225\n1004625000,114.05,120.79975357308395\n1007389800,114.3,119.93311976333942\n1009981800,113.17999,119.03270246156083\n1012573800,111.14999,117.98167413335273\n1014993000,114.52,117.52011758223902\n1017671400,107.86,116.23210190460715\n1020259800,107.22,115.03048831732619\n1023111000,98.96001,112.88775787501604\n1025530200,91.16,109.99072349168057\n1028208600,91.78,107.56262702612317\n1031059800,81.78999,104.12627542264008\n1033479000,88.52,102.0454386996214\n1036161000,93.98,100.97004687300522\n1038839400,88.23,99.27137395660452\n1041517800,86.06,97.50985742905725\n1044282600,84.89999,95.82854177184961\n1046701800,84.74001,94.35007086893633\n1049207400,91.91,94.02472808641149\n1051795800,96.95,94.41476434155662\n1054560600,97.63,94.84346242934907\n1057066200,99.39,95.4496674387692\n1059744600,101.44,96.2483784469333\n1062509400,99.95,96.7419279873422\n1065015000,105.3,97.88300425569656\n1067869800,106.45,99.02527035493702\n1070289000,111.28,100.65923430761208\n1073053800,113.48,102.3686697332638\n1075732200,115.02,104.05551376882863\n1078151400,113.10001,105.26144659965148\n1080829800,110.96001,106.02125505303128\n1083591000,112.86,106.93308771262711\n1086096600,114.53,107.9460093509435\n1088688600,110.84,108.3318747708177\n1091453400,111.11,108.702291468042\n1094045400,111.75999,109.1099846056364\n1096637400,113.2,109.65531999155155\n1099319400,117.89,110.75327732601134\n1101911400,120.87,112.10217368254317\n1104762600,118.16,112.90988385820408\n1107268200,120.63,113.9392326771102\n1109687400,117.96001,114.47533632016217\n1112365800,115.75,114.64529147747388\n1115040600,119.48,115.28991928047736\n1117632600,119.17999,115.80859537641372\n1120224600,123.74001,116.86611732622522\n1122903000,122.58,117.62796834939519\n1125581400,123.03999,118.3495712361425\n1128346200,120.13,118.58696173799017\n1130855400,125.41,119.4967001729248\n1133447400,124.50999,120.16513881653484\n1136298600,127.5,121.14312030766352\n1138804200,128.23,122.08803759997505\n1141223400,129.83,123.12029925331171\n1144071000,131.47,124.23359268620348\n1146490200,127.50999,124.67044566137635\n1149168600,127.23,125.01171957319283\n1151933400,127.85001,125.39015829676713\n1154439000,130.64,126.09013719053151\n1157117400,133.58,127.08878556512731\n1159795800,137.78999,128.51561282311033\n1162391400,140.53,130.11753111336228\n1164983400,141.62,131.65119363158064\n1167834600,143.75,133.26436781403655\n1170340200,140.92999,134.286450772165\n1172759400,142,135.31492400254302\n1175520600,148.28999,137.04493280220396\n1178026200,153.32001,139.21494309524343\n1180704600,150.42999,140.71028268254432\n1183383000,145.72,141.3782449915384\n1185975000,147.59,142.2064789926666\n1188912600,152.58,143.58961512697772\n1191245400,154.64999,145.06433177671403\n1193923800,148.66,145.5437542064855\n1196692200,146.21001,145.63258831228742\n1199284200,137.37,144.5309098706491\n1201876200,133.82001,143.1027898878959\n1204554600,131.97,141.61841790284313\n1207056600,138.25999,141.17062751579738\n1209648600,140.35001,141.0612118470244\n1212413400,127.98,139.31705026742114\n1214919000,126.83,137.652110231765\n1217597400,128.78999,136.470494200863\n1220362200,115.99001,133.73976297408126\n1222867800,96.83,128.81846124420375\n1225722600,90.09,123.65466641164325\n1228141800,90.24001,119.19937889009081\n1230906600,82.83,114.35012837141204\n1233585000,73.92999,108.96077658855711\n1236004200,79.52,105.03533971008282\n1238592600,87.42,102.68662774873845\n1241184600,92.53,101.33241071557332\n1243863000,91.95,100.08142262016354\n1246455000,98.81,99.91189960414174\n1249306200,102.46001,100.25164765692284\n1251811800,105.59,100.96342796933313\n1254403800,103.56,101.30963757342204\n1257172200,109.94,102.46035256363243\n1259677800,111.44,103.65763888848143\n1262615400,107.39,104.1552870366839\n1265034600,110.74001,105.03325009845938\n1267453800,117,106.62881675199813\n1270128600,118.8125,108.25330785173172\n1272893400,109.369,108.40206680483416\n1275399000,103.22,107.7111245641896\n1277991000,110.27,108.052307955631\n1280755800,105.31,107.68666689488019\n1283347800,114.13,108.54577797556283\n1285939800,118.49001,109.87167557882111\n1288618200,118.49249,111.02111750164497\n1291213800,125.75,112.98496850142564\n1294065000,128.67999,115.07763803456889\n1296570600,133.14999,117.48728496329304\n1298989800,132.59,119.50098030152063\n1301664600,136.42999,121.7581815946512\n1304343000,134.89999,123.51042271536438\n1306935000,131.97,124.6383663533158\n1309527000,129.33,125.26391750620704\n1312205400,122.22,124.85806183871277\n1314883800,113.14999,123.29698559355107\n1317648600,125.5,123.59072084774427\n1320154200,124.99001,123.7772927347117\n1322749800,125.5,124.00698703675013\n1325601000,131.32001,124.98205676518344\n1328106600,137.02,126.58711586315899\n1330612200,140.81,128.4835004147378\n1333373400,139.87,130.0017003594394\n1335879000,131.47,130.1974736448475\n1338557400,136.105,130.9851438255345\n1341235800,137.71001,131.88179264879656\n1343827800,141.16,133.11888696229036\n1346765400,143.97,134.565702033985\n1349098200,141.35001,135.47027642945366\n1351776600,142.155,136.36157290552651\n1354545000,142.41,137.1680298514563\n1357137000,149.7,138.83895920459545\n1359729000,151.61,140.54176464398273\n1362148200,156.67,142.69219602478503\n1364823000,159.67999,144.95723522148037\n1367415000,163.44501,147.4222718586163\n1370266200,160.42,149.15530227746746\n1372685400,168.71001,151.7625966404718\n1375363800,163.64999,153.34758242174223\n1378215000,168.00999,155.30257009884326\n1380634200,175.79,158.0342274189975\n1383312600,181,161.09633042979783\n1385994600,184.69,164.24215303915813\n1388673000,178.18,166.10053263393704\n1391437800,186.29,168.79246161607875\n1393857000,187.01,171.22146673393493\n1396359000,188.31,173.49993783607695\n1398951000,192.68,176.05727945793336\n1401715800,195.72,178.6789755302089\n1404221400,193.09,180.6004454595144\n1406899800,200.71,183.2817193982458\n1409664600,197.02,185.11349014514636\n1412170200,201.66,187.31969145912683\n1415025000,207.2,189.97039926457657\n1417444200,205.54,192.04634602929968\n1420209000,199.45,193.03349989205972\n1422887400,210.66,195.38369990645177\n1425306600,206.43,196.85653991892485\n1427895000,208.46,198.40366792973487\n1430487000,211.14,200.10184553910355\n1433165400,205.85,200.86826613388973\n1435757400,210.5,202.15249731603777\n1438608600,197.67,201.55483100723274\n1441114200,191.63,200.23152020626836\n1443706200,207.93,201.25798417876592\n1446474600,208.69,202.24891962159714\n1448980200,203.87,202.46506367205086\n1451917800,193.7208,201.29916184911073\n1454337000,193.56,200.26727360256263\n1456842600,205.52,200.96763712222094\n1459517400,206.3308,201.68272550592482\n1462195800,209.84,202.77036210513484\n1464787800,209.475,203.6643138244502\n1467379800,217.12,205.4584053145235\n1470058200,217.38,207.04795127258703\n1472736600,216.3,208.28155776957541\n1475501400,212.55,208.8506834002987\n1478007000,220.38,210.3879256135922\n1480602600,223.53,212.14020219844656\n1483453800,227.53,214.19217523865368\n1485959400,236.47,217.16255187349986\n1488378600,235.74,219.63954495703322\n1491226200,238.08,222.09827229609547\n1493645400,241.44,224.67716932328275\n1496323800,241.8,226.96021341351172\n1499088600,246.77,229.60151829171016\n1501594200,247.49,231.9866491861488\n1504272600,251.23,234.5524292946623\n1506951000,257.15,237.56543872204065\n1509543000,265.01,241.2247135591019\n1512138600,266.86,244.64275175122165\n1514903400,281.9,249.61038485105877\n1517495400,271.65,252.54900020425092\n1519914600,263.15,253.96246684368413\n1522675800,264.51,255.36880459785957\n1525181400,270.94,257.44496398481164\n1527859800,271.28,259.2896354535034\n1530538200,281.33,262.2283507263696\n1533130200,290.31,265.97257062952036\n1536067800,290.72,269.27222787891765\n1538400600,270.63,269.4532641617286\n1541079000,275.65,270.27949560683146\n1543847400,249.92,267.56489619258724\n1546439400,269.93,267.8802433669089\n1549031400,278.68,269.32021091798777\n1551450600,282.48,271.07484946225605\n1554125400,294.02,274.1342028672886\n1556717400,275.27,274.28564248498344\n1559568600,293,276.7808901536523\n1561987800,297.43,279.534104799832\n1564666200,292.45,281.2562241598544\n1567517400,296.77,283.32472760520716\n1569936600,303.33,285.9920972578462\n1572615000,314.31,289.76781762346667\n1575297000,321.86,294.04677527367113\n1577975400,321.73,297.7378719038483\n1580740200,296.26,297.54082231666854\n1583159400,257.75,292.2353793411127\n1585747800,290.48,292.0013287622977\n1588339800,304.32,293.643818260658\n1591018200,308.36,295.6059758259036\n1593610200,326.52,299.72784571578313\n1596461400,349.31,306.33879962034536\n1598967000,334.89,310.1456263376326\n1601559000,326.54,312.33154282594825\n1604327400,362.06,318.96200378248847\n1606833000,373.88,326.2844032781567\n1609770600,370.07,332.12248284106914\n1612189800,380.36,338.55415179559327\n1614609000,396.33,346.2575982228475\n1617283800,417.3,355.7299184598012\n1620048600,420.04,364.30459599849434\n1622554200,428.06,372.8053165320284\n1625146200,438.51,381.56594099442464\n1627911000,451.56,390.898482195168\n1630503000,429.14,395.9973512358123\n1633095000,459.25,404.431037737704\n1635773400,455.56,411.2482327060101\n1638369000,474.96,419.74313501187544\n1641220200,449.91,423.7653836769587\n1643725800,436.63,425.4806658533642\n1646145000,451.64,428.96857707291565\n1648819800,412,426.7061001298602\n1651498200,412.93,424.8692867792122\n1654090200,377.25,418.5200485419839\n1656682200,411.99,417.6493754030527\n1659360600,395.18,414.6534586826457\n1662039000,357.18,406.9903308582929\n1664803800,386.21,404.2196200771872\n1667309400,407.68,404.6810040668956\n1669905000,382.43,401.7142035246428\n1672756200,406.48,402.34964305469043\n1675261800,396.26,401.5376906473984\n1677681000,409.39,402.5846652277453\n1680528600,408.76,403.40804319737924\n"
  },
  {
    "path": "Tests/TestData/spy_emv.txt",
    "content": "Date,Open,High,Low,Close,Volume,EMV\n6/18/2012,62.75,63.74,62.63,63.58,32178836,\n6/19/2012,63.9,64.51,63.85,64.24,36461672,0.000180107\n6/20/2012,64.36,64.57,63.81,64.29,51372680,0.000001479\n6/21/2012,64.21,64.31,62.62,62.69,42476356,-0.000288455\n6/22/2012,62.88,63.43,62.73,63.35,29504176,-0.000091343\n6/25/2012,62.84,62.85,61.95,62.13,33098600,-0.000184902\n6/26/2012,62.33,62.7,62.06,62.52,30577960,-0.000004186\n6/27/2012,62.76,63.18,62.69,62.9,35693928,0.000076189\n6/28/2012,62.42,62.47,61.54,62.2,49768136,-0.000173786\n6/29/2012,63.37,64.16,63.21,64.16,44759968,0.000356569\n7/2/2012,64.23,64.38,63.87,64.35,33425504,0.000067134\n7/3/2012,64.38,64.89,64.29,64.89,15895085,0.000175526\n7/5/2012,64.78,65.25,64.48,64.93,37015388,0.000057206\n7/6/2012,64.65,64.69,63.65,64.12,40672116,-0.000177714\n7/9/2012,64.03,64.26,63.68,64,35627200,-0.000032559\n7/10/2012,64.33,64.51,63.12,63.37,47337336,-0.000045514\n7/11/2012,63.29,63.46,62.5,63.02,43373576,-0.000184813\n7/12/2012,62.55,62.69,61.86,62.43,57651752,-0.000101497\n7/13/2012,62.56,63.52,62.56,63.38,32357184,0.000226967\n7/16/2012,63.24,63.52,62.95,63.2,27620876,0.000040241\n7/17/2012,63.58,63.74,62.63,63.53,42467704,-0.000013069\n7/18/2012,63.4,64.58,63.39,64.39,44460240,0.000214124\n7/19/2012,64.84,65.31,64.72,65.1,52992592,0.000114676\n7/20/2012,65.09,65.1,64.21,64.24,40561552,-0.000078991\n7/23/2012,63,63.68,62.51,63.46,48636228,-0.000375276\n7/24/2012,63.58,63.66,62.55,62.96,57230032,0.000001940\n7/25/2012,62.49,62.95,62.15,62.54,46260856,-0.000095977\n7/26/2012,63.44,63.73,62.97,63.37,41926492,0.000145016\n7/27/2012,63.83,64.99,63.64,64.87,42620976,0.000305659\n7/30/2012,65.01,65.31,64.6,64.82,37809176,0.000120182\n"
  },
  {
    "path": "Tests/TestData/spy_heikin_ashi.txt",
    "content": "Date,Open,High,Low,Close,Volume,HA_Open,HA_High,HA_Low,HA_Close\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.06E+08,151.525,151.89,150.49,151.3575\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,2.45E+08,151.44125,152.86,149,150.8725\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.86E+08,151.156875,151.156875,148.73,149.6675\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.44E+08,150.4121875,152.33,149.76,150.9725\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.24E+08,150.6923438,152.87,150.6923438,151.9475\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.71E+08,151.3199219,152.34,150.41,151.4875\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,9.73E+07,151.4037109,152.92,151.4037109,152.28\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.21E+08,151.8418555,154.7,151.8418555,154.0725\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,9.43E+07,152.9571777,154.92,152.9571777,154.605\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,8.60E+07,153.7810889,154.98,153.7810889,154.7475\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.23E+08,154.2642944,155.65,154.2642944,155.3025\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,8.32E+07,154.7833972,156.04,154.7833972,155.6325\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.04E+08,155.2079486,156.1,155.2079486,155.7275\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,9.11E+07,155.4677243,156.12,155.23,155.7525\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.24E+08,155.6101122,156.8,155.6101122,156.515\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.33E+08,156.0625561,156.0625561,155.31,155.7575\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.27E+08,155.910028,155.910028,154.2,154.7875\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.67E+08,155.348764,155.51,153.59,154.7525\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.14E+08,155.050632,155.95,155.050632,155.605\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.28E+08,155.327816,155.64,154.1,154.7125\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.11E+08,155.020158,155.6,154.73,155.1925\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.51E+08,155.106329,156.27,154.35,155.39\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,8.61E+07,155.2481645,156.23,155.2481645,155.8575\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,9.98E+07,155.5528323,156.24,155,155.6725\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.03E+08,155.6126661,156.85,155.6126661,156.34\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,9.91E+07,155.9763331,156.91,155.67,156.305\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.01E+08,156.1406665,157.21,156.1406665,156.7525\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.54E+08,156.4465833,157.03,154.82,155.9975\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.29E+08,156.2220416,156.2220416,155.09,155.6375\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.55E+08,155.9297708,155.9297708,153.77,154.5575\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,8.60E+07,155.2436354,156.22,154.75,155.6125\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.01E+08,155.4280677,157.32,155.4280677,156.6375\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.35E+08,156.0327839,158.87,156.0327839,157.96\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.10E+08,156.9963919,159.71,156.9963919,159.035\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.16E+08,158.015696,159.04,157.92,158.61\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,2.16E+08,158.312848,158.312848,155.1,156.5875\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.47E+08,157.450174,157.49,155.91,156.775\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,2.26E+08,157.112587,157.112587,154.28,155.5\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.67E+08,156.3062935,156.3062935,153.55,154.6175\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.49E+08,155.4618967,155.55,154.12,154.9125\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.06E+08,155.1871984,156.54,154.75,155.81\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.66E+08,155.4985992,157.93,155.4985992,157.2075\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,9.50E+07,156.3530496,158.3,156.3530496,157.8875\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.31E+08,157.1202748,159.27,157.1202748,158.535\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,9.56E+07,157.8276374,158.6,157.73,158.2225\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,8.82E+07,158.0250687,159.65,158.0250687,159.01\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.16E+08,158.5175343,159.72,158.5175343,159.32\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.39E+08,158.9187672,159.41,158.1,158.78\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62E+07,158.8493836,159.89,158.53,159.2125\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.44E+08,159.0309418,161.88,159.0309418,161.3575\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66E+07,160.1942209,162.01,160.1942209,161.675\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.99E+07,160.9346104,162.65,160.9346104,162.2575\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68E+07,161.5960552,163.39,161.5960552,162.87\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06E+08,162.2330276,163.7,162.2330276,163.08\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.03E+08,162.6565138,163.55,162.51,163.1175\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97E+07,162.8870069,163.81,162.82,163.2925\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.18E+08,163.0897535,165.35,163.0897535,164.48\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.21E+08,163.7848767,166.45,163.7848767,165.615\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.10E+08,164.6999384,166.36,164.6999384,165.6375\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.30E+08,165.1687192,167.04,165.1687192,166.4225\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47E+07,165.7956096,167.58,165.7956096,166.975\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51E+07,166.3853048,167.8,166.3853048,167.135\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.43E+08,166.7601524,169.07,165.17,166.8775\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.11E+08,166.8188262,166.8188262,163.94,164.875\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.51E+08,165.8469131,165.8469131,163.98,164.7775\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.43E+08,165.3122065,167.78,165.3122065,166.7325\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60E+08,166.0223533,166.0223533,164.34,165.1925\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.06E+08,165.6074266,166.59,165.22,165.7475\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.75E+08,165.6774633,166.31,163.13,164.5625\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.68E+08,165.1199817,165.1199817,162.66,163.8325\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.57E+08,164.4762408,165.1,162.73,163.9575\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.11E+08,164.2168704,164.2168704,161.13,162.2325\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00E+08,163.2246852,163.2246852,160.25,161.73\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.88E+08,162.4773426,164.95,162.4773426,164.195\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02E+08,163.3361713,165.4,163.3361713,164.97\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59E+08,164.1530857,164.54,162.74,163.4125\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.77E+08,163.7827928,164.39,161.6,162.9975\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.63E+08,163.3901464,164.5,161.3,162.9125\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.41E+08,163.1513232,164.67,162.91,163.6975\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.36E+08,163.4244116,165.22,163.4244116,164.3775\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.15E+08,163.9009558,165.99,163.9009558,165.1975\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.06E+08,164.5492279,165.89,163.38,164.5825\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.20E+08,164.565864,164.565864,158.98,160.5775\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70E+08,162.571682,162.571682,157.47,158.975\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.22E+08,160.773341,160.773341,155.73,157.1525\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.62E+08,158.9629205,159.17,157.42,158.42\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.34E+08,158.6914602,160.5,158.6914602,159.945\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.29E+08,159.3182301,161.82,159.3182301,161.2425\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.60E+08,160.2803651,161.4,159.86,160.575\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.32E+08,160.4276825,162.48,160.4276825,161.5475\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.55E+08,160.9875913,162.3,160.5,161.2775\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.52E+07,161.1325456,161.77,160.22,160.945\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.22E+08,161.0387728,163.08,161.0387728,162.4825\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.08E+08,161.7606364,164.39,161.7606364,163.8275\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19E+08,162.7940682,165.33,162.7940682,164.925\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.19E+08,163.8595341,165.75,163.8595341,165.145\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35E+08,164.5022671,167.61,164.5022671,167.1775\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.03E+08,165.8398835,167.93,165.8398835,167.4925\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.94E+07,166.6661918,168.39,166.6661918,168.0475\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.86E+07,167.3568459,168.36,167.07,167.8\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15E+07,167.5784229,168.48,167.5784229,168.085\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.04E+08,167.8317115,169.27,167.8317115,168.655\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.03E+08,168.2433557,169.23,168.2433557,168.805\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.93E+07,168.5241779,169.74,168.5241779,169.41\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.08E+07,168.9670889,169.83,168.9670889,169.4525\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.13E+08,169.2097945,169.86,168.18,169.09\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.11E+08,169.1498972,169.1498972,167.94,168.5375\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.07E+08,168.8436986,169.16,167.52,168.5075\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96E+07,168.6755993,169.06,168.11,168.6175\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50E+07,168.6465497,169.28,168.19,168.795\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.42E+08,168.7207748,169.85,168.49,168.9975\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.10E+08,168.8591374,170.81,168.8591374,170.3375\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94E+07,169.5983187,170.97,169.5983187,170.5675\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34E+07,170.0829094,170.96,170.0829094,170.655\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72E+07,170.3689547,170.52,169.35,169.9925\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.46E+07,170.1807273,170.1807273,168.55,169.09\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.02E+08,169.6353637,170.18,168.93,169.7275\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.15E+07,169.6814318,170.1,168.72,169.4225\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84E+07,169.5519659,169.5519659,168.38,168.81\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06E+07,169.180983,169.9,168.41,169.33\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89E+07,169.2554915,169.8,168.7,169.19\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.53E+08,169.2227457,169.2227457,166.09,166.8125\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30E+08,168.0176229,168.0176229,165.5,166\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.63E+07,167.0088114,167.0088114,164.76,165.345\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89E+07,166.1769057,166.2,164.86,165.4175\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.58E+08,165.7972029,166.03,164.19,164.9825\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01E+08,165.3898514,166.3,164.89,165.5425\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.08E+07,165.4661757,166.83,165.4661757,166.44\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.94E+07,165.9530879,167.3,165.89,166.49\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.54E+08,166.2215439,166.2215439,163.21,163.9625\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.05E+08,165.092022,165.092022,163.05,163.6875\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.19E+08,164.389761,165.04,163.4,164.04\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.34E+08,164.2148805,164.53,163.17,163.9675\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.43E+08,164.0911902,165.58,163.7,164.7275\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.73E+07,164.4093451,166.03,164.14,165.09\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.28E+07,164.7496726,166.4,164.7496726,165.985\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.59E+08,165.3673363,166.98,164.48,165.9975\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74E+07,165.6824181,167.73,165.6824181,167.065\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.05E+08,166.3737091,168.9,166.3737091,168.665\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43E+07,167.5193545,169.4,167.5193545,168.9475\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.26E+07,168.2334273,169.56,168.2334273,169.15\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.23E+07,168.6917136,169.46,168.6917136,169.17\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.26E+08,168.9308568,171.24,168.9308568,170.6925\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22E+07,169.8116784,171.11,169.8116784,170.7775\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01E+08,170.2945892,173.52,170.2945892,172.03\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.46E+08,171.1622946,173.6,171.1622946,173.115\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.32E+08,172.1386473,172.33,170.58,171.4825\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.05E+08,171.8105737,171.8105737,169.39,170.1175\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.00E+08,170.9640368,170.9640368,169.21,169.79\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.15E+08,170.3770184,170.3770184,168.89,169.39\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.66E+07,169.8835092,170.17,169.05,169.5625\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.77E+07,169.7230046,169.7230046,168.47,168.8325\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.44E+08,169.2777523,169.2777523,167.15,167.7875\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.27E+08,168.5326262,169.5,168,168.745\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.13E+08,168.6388131,169.34,167.83,168.675\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.76E+08,168.6569065,168.94,166.84,168.0425\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66E+07,168.3497033,169.06,167.53,168.305\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.57E+07,168.3273516,168.45,167.25,167.64\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.77E+08,167.9836758,167.9836758,165.36,166.4775\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.68E+08,167.2305879,167.2305879,164.53,165.5325\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.94E+08,166.381544,169.26,166.381544,168.2375\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.05E+08,167.309522,170.32,167.309522,169.5625\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.11E+08,168.436011,171.08,168.436011,170.085\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.55E+08,169.2605055,171.15,169.2605055,170.21\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.61E+08,169.7352527,172.16,169.7352527,171.4025\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.29E+08,170.5688764,173.32,170.5688764,172.3125\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.38E+08,171.4406882,174.51,171.4406882,174.0675\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.04E+08,172.7540941,174.75,172.7540941,174.4025\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.27E+08,173.578297,175.93,173.578297,175.2275\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.05E+08,174.4028985,174.89,173.96,174.5625\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00E+07,174.4826993,175.37,174.4826993,174.9825\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.35E+07,174.7325996,176,174.7325996,175.6575\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.45E+07,175.1950498,176.47,175.1950498,176.075\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72E+07,175.6350249,177.24,175.6350249,176.8475\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.36E+08,176.2412625,177.51,175.66,176.715\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.33E+08,176.4781312,176.89,175.53,176.0975\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.43E+08,176.2878156,176.61,175.22,176.0225\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,8.53E+07,176.1551578,176.9,175.9825,176.605625\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.55E+07,176.3803914,176.75,175.57,176.1875\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71E+07,176.2839457,177.5,176.2839457,177.06\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.49E+08,176.6719729,177.64,174.76,176.2225\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.37E+08,176.4472364,177.31,174.85,176.075\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62E+07,176.2611182,177.53,176.2611182,177.225\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.32E+07,176.7430591,177.36,176.37,176.91\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.98E+07,176.8265296,178.41,176.09,177.245\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.03E+08,177.0357648,179.42,177.0357648,178.8675\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.03E+08,177.9516324,180.12,177.9516324,179.7675\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.85E+07,178.8595662,180.5,178.8595662,179.8325\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30E+07,179.3460331,179.87,178.72,179.2325\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.25E+08,179.2892665,179.93,177.98,178.9475\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18E+07,179.1183833,180.05,178.86,179.455\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12E+07,179.2866916,180.83,179.2866916,180.355\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.92E+07,179.8208458,181.17,179.8208458,180.82\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.67E+07,180.3204229,181.22,180.3204229,180.76\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82E+07,180.5402115,181.24,180.5402115,180.975\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.50E+07,180.7576057,181.75,180.7576057,181.2225\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.93E+07,180.9900529,181.43,180.25,180.8325\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.16E+08,180.9112764,180.9112764,179.17,179.815\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.23E+08,180.3631382,180.48,178.35,179.435\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.06E+08,179.8990691,179.8990691,178.77,179.2175\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.27E+08,179.5582846,181.11,179.5582846,180.73\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,7.00E+07,180.1441423,181.67,180.1441423,181.425\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.74E+07,180.7845711,181.36,180.63,180.925\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.30E+08,180.8547856,180.8547856,178.5,179.72\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.15E+08,180.2873928,180.2873928,177.76,178.34\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.08E+08,179.3136964,179.3136964,177.77,178.255\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61E+07,178.7843482,179.81,178.7843482,179.22\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94E+07,179.0021741,179.41,178.25,178.92\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.34E+08,178.961087,181.73,177.32,179.915\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.37E+08,179.4380435,181.7,179.4380435,181.27\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.97E+08,180.3540218,181.99,180.3540218,181.1975\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54E+07,180.7757609,182.64,180.7757609,182.4125\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.54E+07,181.5941304,183.01,181.5941304,182.76\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32E+07,182.1770652,183.96,182.1770652,183.625\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.18E+07,182.9010326,184.18,182.9010326,183.9575\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68E+07,183.4292663,184.02,183.4292663,183.835\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61E+07,183.6321332,184.69,183.6321332,184.355\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.20E+08,183.9935666,184.07,182.48,183.345\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.14E+07,183.6692833,183.6692833,182.63,183.0875\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.07E+08,183.3783916,183.56,182.08,182.88\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60E+07,183.1291958,183.79,182.95,183.335\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.65E+07,183.2320979,183.83,182.89,183.425\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05E+07,183.328549,184.13,182.79,183.665\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.02E+08,183.4967745,184.22,183.01,183.8325\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.50E+08,183.6646372,184.18,181.34,182.71\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.05E+08,183.1873186,183.77,181.95,182.915\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.84E+07,183.0511593,184.94,183.0511593,184.3525\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21E+07,183.7018297,184.66,183.7018297,184.3025\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.08E+08,184.0021648,184.45,183.32,183.875\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85E+07,183.9385824,184.77,183.05,184.18\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.08E+07,184.0592912,184.57,183.91,184.3225\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.32E+08,184.1908956,184.1908956,181.82,182.8475\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.09E+08,183.5191978,183.5191978,178.83,180.2425\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.80E+08,181.8808489,181.8808489,177.12,178.425\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.09E+08,180.1529245,180.1529245,178.12,178.68\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.15E+08,179.4164622,179.4164622,176.88,177.5925\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.16E+08,178.5044811,179.81,178.26,179.045\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.95E+08,178.7747406,179.29,176.92,177.8475\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.54E+08,178.3111203,178.37,173.83,176.08\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.65E+08,177.1955601,177.1955601,174.11,175.0775\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.64E+08,176.1365301,176.1365301,173.71,174.8025\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32E+08,175.469515,177.48,175.22,176.4475\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.71E+08,175.9585075,179.87,175.9585075,178.8925\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.20E+07,177.4255038,180.07,177.4255038,179.7475\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.22E+08,178.5865019,182.44,178.5865019,181.1725\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44E+07,179.8795009,182.83,179.8795009,182.2175\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.01E+08,181.0485005,183.2,180.83,181.9725\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64E+07,181.5105002,184.36,181.5105002,183.4875\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00E+07,182.4990001,184.49,182.4990001,184.145\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.26E+08,183.3220001,184.95,182.87,183.655\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.05E+08,183.4885,184.52,182.6,183.6225\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.18E+08,183.5555,184.89,183.5555,184.2575\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.14E+08,183.9065,186.15,183.9065,184.89\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.17E+08,184.39825,185.59,184.23,184.9225\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83E+07,184.660375,185.6,184.33,184.97\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37E+07,184.8151875,185.87,184.37,185.16\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.51E+08,184.9875938,187.15,184.9875938,186.0675\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.67E+08,185.5275469,185.5275469,183.75,184.7075\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.70E+08,185.1175234,187.98,185.1175234,187.275\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.83E+07,186.1962617,188.07,186.1962617,187.755\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.23E+07,186.9756309,188.61,186.9756309,188.2025\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.17E+08,187.5890654,188.96,187.43,188.395\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48E+07,187.9920327,188.23,187.08,187.8525\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88E+07,187.9222664,188.71,186.8,187.805\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.05E+08,187.8636332,187.8636332,185.9,186.7125\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54E+08,187.2880666,187.99,184.66,186.4275\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.54E+08,186.8577833,186.8577833,184.44,184.925\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.83E+07,185.8913916,186.77,185.51,186.0575\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.02E+08,185.9744458,187.91,185.9744458,187.205\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.76E+08,186.5897229,187.94,185.47,186.945\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.17E+08,186.7673615,187.89,185.92,186.9525\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.63E+08,186.8599307,189.02,186.03,187.24\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.21E+08,187.0499654,187.07,184.62,185.99\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03E+08,186.5199827,186.94,185.27,186.23\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.20E+08,186.3749913,187.34,184.92,186.0575\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.42E+08,186.2162457,186.2162457,183.9,184.6475\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.02E+08,185.4318728,186.42,185,185.5125\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96E+07,185.4721864,187.3,185.4721864,186.86\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.90E+07,186.1660932,188.36,186.1660932,187.9275\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87E+07,187.0467966,189.13,187.0467966,188.6625\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.73E+07,187.8546483,189.22,187.8546483,188.7575\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.69E+08,188.3060742,189.7,186.1,187.96\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.41E+08,188.1330371,188.1330371,183.96,185.115\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.13E+08,186.6240185,186.6240185,183.59,184.5675\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.00E+08,185.5957593,187.15,185.06,186.2275\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.73E+08,185.9116296,187.17,182.93,185.08\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.67E+08,185.4958148,185.4958148,181.31,182.1\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32E+08,183.7979074,183.7979074,181.44,182.6675\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.57E+08,183.2327037,184.33,181.51,183.3475\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.04E+08,183.2901019,186.14,183.2901019,185.595\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.05E+08,184.4425509,186.91,184.4425509,186.1825\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82E+07,185.3125255,187.1,185.3125255,186.7\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.57E+07,186.0062627,188.4,186.0062627,187.665\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36E+07,186.8356314,187.92,186.8356314,187.6175\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81E+07,187.2265657,188.39,186.93,187.885\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.00E+08,187.5557828,187.5557828,185.87,186.68\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.35E+08,187.1178914,187.69,184.96,186.6525\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.40E+07,186.8851957,188.04,186.8851957,187.5875\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.01E+08,187.2363479,188.5,187.18,187.8625\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.29E+07,187.5494239,188.84,187.5494239,188.285\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.80E+07,187.917212,189.14,187.78,188.3275\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58E+07,188.122356,188.55,186.62,187.6875\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.54E+07,187.904928,188.13,186.74,187.42\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06E+08,187.662464,187.97,186.01,187.3175\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.35E+07,187.489982,189.05,187.08,187.88\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.36E+07,187.684991,188.04,186.83,187.635\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.69E+07,187.6599955,189.88,187.6599955,189.11\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64E+07,188.3849977,190.42,188.3849977,190.045\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22E+07,189.2149989,189.88,188.79,189.3875\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.55E+08,189.3012494,189.3012494,186.48,187.82\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.74E+07,188.5606247,188.5606247,186.72,187.6\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.37E+07,188.0803124,188.89,187.52,188.215\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.12E+08,188.1476562,188.67,187.07,187.99\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.90E+07,188.0688281,189.22,188.06,188.62\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15E+07,188.344414,189.98,188.344414,189.4075\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.11E+07,188.875957,190.48,188.875957,190.045\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.20E+07,189.4604785,191.58,189.4604785,191.2775\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60E+07,190.3689893,191.82,190.3689893,191.4525\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.41E+07,190.9107446,192.4,190.9107446,191.9875\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.63E+07,191.4491223,192.8,191.4491223,192.43\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.46E+07,191.9395612,192.99,191.9395612,192.71\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.50E+07,192.3247806,192.9,192.25,192.59\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.55E+07,192.4573903,193.3,192.26,192.8025\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20E+07,192.6299451,194.65,192.6299451,193.8075\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.87E+07,193.2187226,195.43,193.2187226,195.1175\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50E+07,194.1681113,196.05,194.1681113,195.54\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.70E+07,194.8540556,195.64,194.8540556,195.38\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.87E+07,195.1170278,195.12,194.48,194.8475\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.06E+08,194.9822639,194.9822639,193.11,194.0325\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.20E+07,194.507382,194.507382,193.3,193.91\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73E+07,194.208691,194.7,193.66,194.1325\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.48E+07,194.1705955,194.97,193.81,194.4025\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.05E+08,194.2865477,196.37,194.2865477,195.465\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58E+07,194.8757739,196.6,194.8757739,196.335\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,1.00E+08,195.6053869,196.1,195.6053869,195.9375\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04E+07,195.7714435,196.05,195.52,195.8625\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60E+07,195.8169717,196.5,194.48,195.305\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.27E+07,195.5609859,195.78,194.25,194.9725\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42E+07,195.2667429,195.63,194.13,195.2\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13E+07,195.2333715,195.88,194.88,195.39\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.04E+07,195.3116857,196.16,195.3116857,195.78\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03E+07,195.5458429,197.63,195.5458429,196.75\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23E+07,196.1479214,197.48,196.1479214,197.175\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.29E+07,196.6614607,198.29,196.6614607,197.985\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.17E+07,197.3232304,197.98,197.22,197.6375\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.08E+08,197.4803652,197.4803652,195.76,196.585\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.30E+07,197.0326826,197.29,196.31,196.8675\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89E+07,196.9500913,196.9500913,195.06,195.875\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42E+07,196.4125456,196.75,195.78,196.345\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.86E+07,196.3787728,197.86,196.3787728,197.6325\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.11E+08,197.0056364,198.1,196.36,197.35\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,8.00E+07,197.1778182,198.26,197.1778182,197.94\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.44E+08,197.5589091,198.1,195.43,196.6425\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.24E+08,197.1007046,197.91,196.24,197.06\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.75E+07,197.0803523,197.5,196.43,197.0875\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76E+07,197.0839261,198.56,197.0839261,198.1675\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55E+07,197.6257131,198.85,197.6257131,198.525\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64E+07,198.0753565,199.06,198.0753565,198.745\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.68E+07,198.4101783,198.4101783,197.33,197.855\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91E+07,198.1325891,198.1325891,196.62,197.5725\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04E+07,197.8525446,198.45,196.92,197.6325\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.04E+08,197.7425223,197.91,196.16,197.1775\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.83E+08,197.4600111,197.4600111,192.97,194.3675\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.89E+08,195.9137556,195.9137556,191.57,192.6025\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11E+07,194.2581278,194.3,192.05,193.2775\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.53E+08,193.7678139,193.7678139,191.31,192.5075\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46E+07,193.1376569,193.1376569,191.08,191.78\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.36E+08,192.4588285,193.13,190.55,191.9175\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.17E+08,192.1881642,193.37,190.95,192.2475\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.45E+07,192.2178321,194.66,192.2178321,194.0375\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36E+07,193.1276661,194.15,192.94,193.5625\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.90E+07,193.345083,195.06,193.345083,194.54\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72E+07,193.9425415,195.76,193.9425415,195.4225\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.40E+08,194.6825208,196.65,194.31,195.7925\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.52E+07,195.2375104,197.45,195.2375104,197.0775\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.90E+07,196.1575052,198.54,196.1575052,198.055\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27E+07,197.1062526,199.16,197.1062526,198.5775\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77E+07,197.8418763,199.76,197.8418763,199.3125\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.61E+07,198.5771881,199.69,198.5771881,199.235\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.38E+07,198.9060941,200.59,198.9060941,200.025\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.73E+07,199.465547,200.82,199.465547,200.445\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78E+07,199.9552735,200.57,199.94,200.3025\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.83E+07,200.1288868,200.27,199.39,199.8475\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.59E+07,199.9881934,200.73,199.82,200.425\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23E+07,200.2065967,200.99,199.86,200.6075\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.74E+07,200.4070483,201.41,200.22,200.87\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50E+07,200.6385242,201.58,199.66,200.5775\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.02E+08,200.6080121,201.19,199.41,200.475\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41E+07,200.541506,201.21,200,200.685\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.85E+07,200.613253,200.613253,198.91,199.8\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.72E+07,200.2066265,200.2066265,198.77,199.625\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67E+07,199.9158133,200.33,199.12,199.7575\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.17E+08,199.8366566,200.12,198.56,199.4825\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.64E+07,199.6595783,199.6595783,198.38,198.9625\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.16E+08,199.3110392,200.84,198.5,199.615\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.51E+08,199.4630196,201.68,199.4630196,200.745\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.49E+07,200.1040098,201.85,200.1040098,201.5325\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.21E+08,200.8182549,201.9,200.29,201.105\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.25E+08,200.9616274,200.9616274,198.73,199.6475\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.11E+08,200.3045637,200.3045637,197.95,198.4075\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.07E+08,199.3560319,199.69,197.52,198.7075\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.50E+08,199.0317659,199.05,196.27,197.6775\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.04E+08,198.354633,198.39,196.42,197.3525\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.51E+07,197.8535665,197.89,196.05,196.915\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.30E+08,197.3842832,198.3,196.61,197.4075\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.78E+08,197.3958916,197.3958916,193.91,195.4275\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.57E+08,196.4116958,196.4116958,192.35,193.99\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.21E+08,195.2008479,196.94,195.08,196.0625\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.05E+08,195.631674,197.6,195.58,196.7075\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.48E+08,196.169587,196.169587,193.22,194.3725\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.86E+08,195.2710435,196.92,192.36,194.82\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.10E+08,195.0455217,196.6,192.58,194.57\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.22E+08,194.8077609,194.8077609,190.49,191.845\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.30E+08,193.3263804,193.3263804,187.3,189.0825\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15E+08,191.2044402,191.2044402,187.04,188.255\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.80E+08,189.7297201,189.7297201,181.92,185.3075\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70E+08,187.5186101,187.58,182.89,184.9475\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.14E+08,186.233055,189.75,186.233055,188.565\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.30E+08,187.3990275,190.45,187.3990275,189.235\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.54E+08,188.3170138,194.2,188.3170138,192.8625\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.51E+08,190.5897569,194.91,190.5897569,193.6625\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.55E+08,192.1261284,196.2,192.1261284,195.0075\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.17E+08,193.5668142,196.49,193.5668142,195.66\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.28E+07,194.6134071,196.45,194.6134071,195.8475\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.07E+08,195.2304536,198.42,195.2304536,197.6\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.42E+08,196.4152268,199.12,196.4152268,198.155\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.13E+08,197.2851134,199.61,197.2851134,198.495\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.47E+08,197.8900567,201.82,197.8900567,201.5075\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35E+07,199.6987783,202.45,199.6987783,201.86\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.32E+07,200.7793892,201.6,200.06,200.9875\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.15E+07,200.8834446,202.59,200.8834446,202.235\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.07E+08,201.5592223,203.26,201.5592223,202.615\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.95E+07,202.0871111,203.6,202.0871111,203.18\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59E+07,202.6335556,204.04,202.6335556,203.6375\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.43E+07,203.1355278,204.31,203.1355278,204.0525\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,9.00E+07,203.5940139,204.24,203.31,203.715\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.50E+07,203.6545069,204.83,203.21,204.0925\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03E+07,203.8735035,204.49,203.72,204.145\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.04E+07,204.0092517,204.58,203.65,204.1125\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.59E+07,204.0608759,205.92,204.0608759,205.0925\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22E+07,204.5766879,205.55,204.3,205.0925\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.26E+07,204.834594,205.71,204.18,204.93\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.42E+08,204.882297,207.84,204.882297,207.025\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.57E+07,205.9536485,207.39,205.9536485,207.1875\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90E+07,206.5705742,207.79,206.5705742,207.31\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.64E+07,206.9402871,207.76,206.9402871,207.425\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.79E+07,207.1826436,207.87,206.91,207.375\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.04E+08,207.2788218,207.2788218,205.38,206.02\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.45E+07,206.6494109,207.34,205.78,206.5025\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.89E+07,206.5759554,208.15,206.5759554,207.605\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12E+07,207.0904777,208.26,206.7,207.5425\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.10E+07,207.3164889,208.47,207.3164889,207.975\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.08E+08,207.6457444,208.12,205.93,207.0525\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25E+08,207.3491222,207.3491222,203.91,205.3375\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.59E+08,206.3433111,206.3433111,202.93,204.5025\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.59E+08,205.4229056,206.19,203.71,204.495\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.02E+08,204.9589528,204.9589528,200.85,202.0525\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.90E+08,203.5057264,203.5057264,198.78,200.705\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.59E+08,202.1053632,202.4,197.86,199.18\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.53E+08,200.6426816,202.34,198.29,200.225\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.57E+08,200.4338408,212.97,200.4338408,207.1125\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.43E+08,203.7731704,207.33,203.7731704,206.48\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.48E+08,205.1265852,207.47,205.1265852,207.0275\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.21E+08,206.0770426,208.23,206.0770426,207.895\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.30E+07,206.9860213,208.34,206.9860213,207.965\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72E+07,207.4755106,208.85,207.4755106,208.4575\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.95E+07,207.9665053,208.97,207.9665053,208.52\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34E+07,208.2432527,208.37,207.51,207.9225\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.30E+08,208.0828763,208.19,205.39,206.77\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.21E+08,207.4264382,207.4264382,204.18,205.72\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.69E+08,206.5732191,206.5732191,201.35,202.91\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.09E+08,204.7416095,204.7416095,198.85,200.88\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.25E+08,202.8108048,202.8108048,200.88,201.8425\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.46E+08,202.3266524,206.16,202.3266524,205.0125\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.58E+08,203.6695762,206.42,203.51,205.1425\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.44E+08,204.4060381,204.6,201.92,203.3975\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.14E+08,203.901769,205.48,200.51,203.055\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.93E+08,203.4783845,203.4783845,198.57,200.05\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75E+08,201.7641923,202.01,198.88,200.3875\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.12E+08,201.0758461,201.82,198.55,200.1875\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.31E+08,200.6316731,202.72,200.17,201.84\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.23E+08,201.2358365,203.66,200.94,202.2975\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.74E+08,201.7666683,206.26,201.7666683,204.6775\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.17E+08,203.2220841,206.1,203.2220841,205.42\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17E+07,204.3210421,205.56,203.85,204.8975\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.34E+08,204.609271,204.609271,201.74,202.9\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.68E+08,203.7546355,204.29,199.91,202.125\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.73E+08,202.9398178,202.9398178,198.68,200.8275\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.98E+08,201.8836589,202.17,199.13,200.3275\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.63E+08,201.1055794,202.03,197.86,200.47\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.24E+08,200.7877897,204.85,200.7877897,203.815\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.34E+08,202.3013949,205.38,202.3013949,204.2225\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77E+07,203.2619474,206.3,203.2619474,205.505\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.26E+08,204.3834737,207.24,204.3834737,206.07\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.71E+07,205.2267369,205.64,204.13,204.7925\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61E+07,205.0096184,207.12,204.68,206.125\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02E+07,205.5673092,207.45,205.5673092,206.7025\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72E+07,206.1349046,208.99,206.1349046,208.1975\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36E+07,207.1662023,209.84,207.1662023,209.365\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.69E+07,208.2656012,210.32,208.2656012,209.7275"
  },
  {
    "path": "Tests/TestData/spy_hma.txt",
    "content": "Date,Open,High,Low,Close,Volume,HMA_16\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.06E+08,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,2.45E+08,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.86E+08,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.44E+08,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.24E+08,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.71E+08,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,9.73E+07,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.21E+08,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,9.43E+07,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,8.60E+07,\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.23E+08,\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,8.32E+07,\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.04E+08,\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,9.11E+07,\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.24E+08,\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.33E+08,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.27E+08,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.67E+08,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.14E+08,156.1212141\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.28E+08,155.6934943\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.11E+08,155.4187475\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.51E+08,155.1863489\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,8.61E+07,155.1544355\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,9.98E+07,155.3036814\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.03E+08,155.6073881\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,9.91E+07,155.9026013\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.01E+08,156.2214436\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.54E+08,156.3245449\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.29E+08,156.3247255\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.55E+08,156.1773039\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,8.60E+07,156.0608399\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.01E+08,156.0775899\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.35E+08,156.4280605\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.10E+08,157.0607843\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.16E+08,157.7498039\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,2.16E+08,157.9199755\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.47E+08,157.9622083\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,2.26E+08,157.617915\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.67E+08,156.9241136\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.49E+08,156.2626536\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.06E+08,155.7338227\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.66E+08,155.6330449\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,9.50E+07,155.892116\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.31E+08,156.4568832\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,9.56E+07,157.090469\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,8.82E+07,157.8402966\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.16E+08,158.6297663\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.39E+08,159.137817\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62E+07,159.5745172\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.44E+08,160.0916577\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66E+07,160.6838056\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.99E+07,161.3917141\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68E+07,162.1736144\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06E+08,162.8302418\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.03E+08,163.4037851\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97E+07,163.8771364\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.18E+08,164.4165302\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.21E+08,165.0567614\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.10E+08,165.5841209\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.30E+08,166.1687582\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47E+07,166.7082026\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51E+07,167.2003039\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.43E+08,167.4424943\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.11E+08,167.3789436\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.51E+08,167.0776136\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.43E+08,166.781777\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60E+08,166.418335\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.06E+08,166.1114877\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.75E+08,165.5677467\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.68E+08,165.0251936\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.57E+08,164.4774992\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.11E+08,163.6847737\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00E+08,163.0151185\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.88E+08,162.7416397\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02E+08,162.8150098\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59E+08,162.9255408\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.77E+08,162.8429837\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.63E+08,162.9093382\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.41E+08,162.9763725\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.36E+08,163.2435735\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.15E+08,163.7470008\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.06E+08,164.0053194\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.20E+08,163.5716413\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70E+08,162.6585074\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.22E+08,161.2519706\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.62E+08,159.8863676\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.34E+08,158.9648374\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.29E+08,158.5519902\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.60E+08,158.4897402\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.32E+08,158.8212459\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.55E+08,159.3842083\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.52E+07,160.0321895\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.22E+08,160.8888701\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.08E+08,161.8515147\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19E+08,162.9188178\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.19E+08,163.953933\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35E+08,165.1362345\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.03E+08,166.2902557\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.94E+07,167.3749918\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.86E+07,168.1984118\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15E+07,168.7501021\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.04E+08,169.1856381\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.03E+08,169.5318897\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.93E+07,169.8351585\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.08E+07,169.9960662\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.13E+08,169.9552467\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.11E+08,169.8326977\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.07E+08,169.7021013\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96E+07,169.5157141\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50E+07,169.2987819\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.42E+08,169.0861119\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.10E+08,169.1567729\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94E+07,169.4807108\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34E+07,169.9099502\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72E+07,170.2094191\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.46E+07,170.2752328\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.02E+08,170.2630752\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.15E+07,170.144719\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84E+07,169.9423178\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06E+07,169.7439167\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89E+07,169.4558676\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.53E+08,168.8576397\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30E+08,168.0508399\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.63E+07,167.0435866\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89E+07,166.1254559\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.58E+08,165.276201\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01E+08,164.7607263\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.08E+07,164.6193489\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.94E+07,164.6841658\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.54E+08,164.565469\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.05E+08,164.3617279\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.19E+08,164.1509959\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.34E+08,163.9008268\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.43E+08,163.780406\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.73E+07,163.8984158\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.28E+07,164.2096193\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.59E+08,164.6674804\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74E+07,165.3891462\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.05E+08,166.3435931\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43E+07,167.4218031\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.26E+07,168.3994444\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.23E+07,169.199375\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.26E+08,169.8993031\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22E+07,170.564558\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01E+08,171.3976838\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.46E+08,172.1899714\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.32E+08,172.5814208\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.05E+08,172.5369355\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.00E+08,172.1323603\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.15E+08,171.4823873\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.66E+07,170.8381176\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.77E+07,170.1544649\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.44E+08,169.3900278\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.27E+08,168.8594877\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.13E+08,168.5581658\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.76E+08,168.2637247\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66E+07,168.1577737\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.57E+07,167.9647369\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.77E+08,167.4782435\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.68E+08,166.8828775\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.94E+08,166.7263652\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.05E+08,167.0595874\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.11E+08,167.8186977\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.55E+08,168.6067516\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.61E+08,169.5641634\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.29E+08,170.7208799\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.38E+08,172.0608268\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.04E+08,173.3546225\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.27E+08,174.503951\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.05E+08,175.3087443\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00E+07,175.8695212\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.35E+07,176.3302443\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.45E+07,176.6756479\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72E+07,177.027875\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.36E+08,177.2132042\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.33E+08,177.1986863\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.43E+08,177.1072345\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,8.53E+07,177.0588096\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.55E+07,176.9773088\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71E+07,176.9816495\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.49E+08,176.738308\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.37E+08,176.6454926\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62E+07,176.703384\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.32E+07,176.8082753\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.98E+07,177.1273815\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.03E+08,177.6213448\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.03E+08,178.3027525\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.85E+07,178.9586046\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30E+07,179.4597206\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.25E+08,179.6760972\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18E+07,179.8578791\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12E+07,180.1340441\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.92E+07,180.4128415\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.67E+07,180.6672631\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82E+07,180.9068676\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.50E+07,181.1105907\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.93E+07,181.2212672\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.16E+08,181.1459338\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.23E+08,180.9087173\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.06E+08,180.4807206\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.27E+08,180.2507884\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,7.00E+07,180.2611944\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.74E+07,180.3538399\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.30E+08,180.2279698\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.15E+08,179.850116\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.08E+08,179.347732\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61E+07,178.9838578\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94E+07,178.7070474\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.34E+08,178.8823766\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.37E+08,179.3281193\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.97E+08,179.9355907\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54E+07,180.7394028\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.54E+07,181.5923725\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32E+07,182.5025155\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.18E+07,183.3262353\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68E+07,183.9719967\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61E+07,184.5073431\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.20E+08,184.6895735\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.14E+07,184.6070989\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.07E+08,184.2690833\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60E+07,183.93571\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.65E+07,183.6780899\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05E+07,183.5236413\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.02E+08,183.5260106\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.50E+08,183.299768\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.05E+08,183.2173325\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.84E+07,183.3637647\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21E+07,183.6231013\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.08E+08,183.8339118\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85E+07,184.0066119\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.08E+07,184.1470719\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.32E+08,184.0777345\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.09E+08,183.3861675\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.80E+08,182.1575172\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.09E+08,180.832098\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.15E+08,179.4265286\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.16E+08,178.4326479\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.95E+08,177.6844502\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.54E+08,176.6568227\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.65E+08,175.75075\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.64E+08,175.0064273\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32E+08,174.7872484\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.71E+08,175.2679158\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.20E+07,176.1849861\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.22E+08,177.5306389\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44E+07,179.038924\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.01E+08,180.6332361\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64E+07,182.2012639\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00E+07,183.5600711\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.26E+08,184.4273129\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.05E+08,184.9715172\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.18E+08,185.2168881\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.14E+08,185.3755221\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.17E+08,185.4791209\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83E+07,185.5043464\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37E+07,185.6042059\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.51E+08,185.8094804\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.67E+08,185.9182663\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.70E+08,186.2627582\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.83E+07,186.7351438\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.23E+07,187.289982\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.17E+08,187.8593987\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48E+07,188.313598\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88E+07,188.5109828\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.05E+08,188.5116021\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54E+08,188.1054306\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.54E+08,187.3648448\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.83E+07,186.7119232\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.02E+08,186.3802925\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.76E+08,186.2229297\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.17E+08,186.343156\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.63E+08,186.4135621\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.21E+08,186.332518\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03E+08,186.3009641\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.20E+08,186.1036912\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.42E+08,185.7512459\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.02E+08,185.4383832\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96E+07,185.3940498\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.90E+07,185.7374796\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87E+07,186.4220253\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.73E+07,187.2078881\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.69E+08,187.6429828\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.41E+08,187.5155874\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.13E+08,187.0986601\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.00E+08,186.7874869\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.73E+08,186.0970466\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.67E+08,185.0040629\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32E+08,183.9103456\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.57E+08,183.134982\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.04E+08,183.0452092\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.05E+08,183.4788962\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82E+07,184.2315727\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.57E+07,185.1991062\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36E+07,186.1868644\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81E+07,187.1273725\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.00E+08,187.6761438\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.35E+08,187.923384\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.40E+07,188.0333031\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.01E+08,188.1327247\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.29E+07,188.2564534\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.80E+07,188.3376904\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58E+07,188.4207369\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.54E+07,188.2840482\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06E+08,188.1744845\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.35E+07,188.0562574\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.36E+07,187.9680817\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.69E+07,188.1638431\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64E+07,188.541701\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22E+07,188.9008007\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.55E+08,188.9746552\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.74E+07,188.9062475\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.37E+07,188.8268129\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.12E+08,188.621683\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.90E+07,188.5605351\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15E+07,188.6280482\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.11E+07,188.8955915\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.20E+07,189.4659902\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60E+07,190.149607\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.41E+07,190.9378154\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.63E+07,191.7304085\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.46E+07,192.4581838\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.50E+07,193.0287418\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.55E+07,193.4634052\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20E+07,193.9110458\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.87E+07,194.4360572\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50E+07,194.9960384\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.70E+07,195.5040833\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.87E+07,195.8140654\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.06E+08,195.7646168\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.20E+07,195.5507974\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73E+07,195.2628211\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.48E+07,195.0266225\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.05E+08,195.0502222\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58E+07,195.2722108\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,1.00E+08,195.5467908\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04E+07,195.819268\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60E+07,195.889893\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.27E+07,195.9090931\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42E+07,195.872549\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13E+07,195.8407124\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.04E+07,195.8033489\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03E+07,195.9317263\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23E+07,196.208634\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.29E+07,196.6864665\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.17E+07,197.1645417\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.08E+08,197.3827663\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.30E+07,197.504656\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89E+07,197.4340874\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42E+07,197.2925613\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.86E+07,197.243991\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.11E+08,197.202027\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,8.00E+07,197.2783546\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.44E+08,197.1452263\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.24E+08,197.1396814\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.75E+07,197.1711462\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76E+07,197.3411904\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55E+07,197.6579739\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64E+07,197.9947958\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.68E+07,198.2049395\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91E+07,198.2991781\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04E+07,198.2065694\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.04E+08,197.9726013\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.83E+08,197.1754608\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.89E+08,195.9763905\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11E+07,194.8271234\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.53E+08,193.6326732\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46E+07,192.6159363\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.36E+08,191.6780188\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.17E+08,191.1723056\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.45E+07,191.1498358\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36E+07,191.4661283\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.90E+07,192.1299837\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72E+07,193.0143668\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.40E+08,193.9687516\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.52E+07,195.0717663\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.90E+07,196.2702623\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27E+07,197.4360833\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77E+07,198.5267312\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.61E+07,199.3816577\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.38E+07,200.0953333\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.73E+07,200.6565278\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78E+07,201.0371422\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.83E+07,201.2234542\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.59E+07,201.3117222\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23E+07,201.3225106\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.74E+07,201.2714542\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50E+07,201.1483472\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.02E+08,201.0854028\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41E+07,201.0109118\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.85E+07,200.7737345\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.72E+07,200.541442\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67E+07,200.3494804\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.17E+08,200.0742508\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.64E+07,199.7613799\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.16E+08,199.6280515\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.51E+08,199.6714526\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.49E+07,200.0067949\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.21E+08,200.3585221\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.25E+08,200.43429\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.11E+08,200.1572966\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.07E+08,199.8689322\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.50E+08,199.2074477\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.04E+08,198.5610564\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.51E+07,197.9505212\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.30E+08,197.3522426\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.78E+08,196.5600842\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.57E+08,195.7060008\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.21E+08,195.1905204\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.05E+08,194.9457149\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.48E+08,194.5801961\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.86E+08,194.5475196\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.10E+08,194.223933\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.22E+08,193.4898333\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.30E+08,192.1808652\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15E+08,190.575683\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.80E+08,188.8337557\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70E+08,187.2245825\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.14E+08,186.2261438\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.30E+08,185.9754011\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.54E+08,186.8557819\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.51E+08,188.2535654\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.55E+08,190.1048325\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.17E+08,192.2037557\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.28E+07,194.1635294\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.07E+08,196.1061021\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.42E+08,197.6995801\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.13E+08,199.0146471\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.47E+08,200.276406\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35E+07,201.3956912\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.32E+07,202.2023595\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.15E+07,202.8456381\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.07E+08,203.3966944\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.95E+07,203.8494461\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59E+07,204.2917582\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.43E+07,204.6573619\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,9.00E+07,204.8761773\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.50E+07,205.0088203\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03E+07,205.0721054\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.04E+07,205.0796291\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.59E+07,205.195393\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22E+07,205.3252827\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.26E+07,205.4885711\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.42E+08,205.7997443\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.57E+07,206.2457459\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90E+07,206.7180065\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.64E+07,207.2064297\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.79E+07,207.5683758\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.04E+08,207.5991119\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.45E+07,207.5772418\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.89E+07,207.6152181\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12E+07,207.668058\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.10E+07,207.7826168\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.08E+08,207.7191536\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25E+08,207.5148987\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.59E+08,206.8255637\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.59E+08,206.0103962\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.02E+08,204.7603113\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.90E+08,203.1649134\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.59E+08,201.3421953\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.53E+08,200.0591577\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.57E+08,200.0396381\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.43E+08,200.9008685\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.48E+08,202.4144404\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.21E+08,204.1336454\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.30E+07,205.788625\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72E+07,207.3280678\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.95E+07,208.6098873\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34E+07,209.3387132\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.30E+08,209.2843987\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.21E+08,208.7086258\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.69E+08,207.3809093\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.09E+08,205.4856389\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.25E+08,203.7562157\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.46E+08,202.8098652\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.58E+08,202.382384\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.44E+08,202.1780074\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.14E+08,202.0217467\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.93E+08,201.7168922\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75E+08,201.1803317\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.12E+08,200.864683\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.31E+08,200.7260466\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.23E+08,200.8577729\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.74E+08,201.6162892\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.17E+08,202.5704984\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17E+07,203.6325\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.34E+08,204.279844\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.68E+08,204.1681724\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.73E+08,203.7627884\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.98E+08,202.8808513\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.63E+08,202.1296806\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.24E+08,201.9397141\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.34E+08,202.0770605\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77E+07,202.7448342\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.26E+08,203.6181593\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.71E+07,204.3932042\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61E+07,205.2779093\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02E+07,206.133857\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72E+07,207.0995408\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36E+07,208.1327876\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.69E+07,209.1258301\n"
  },
  {
    "path": "Tests/TestData/spy_hurst_exponent.csv",
    "content": "date,close,hurst_exponent\n19980102 00:00,973600,\n19980105 00:00,977500,\n19980106 00:00,966300,\n19980107 00:00,964700,\n19980108 00:00,957800,\n19980109 00:00,924700,\n19980112 00:00,940600,\n19980113 00:00,952200,\n19980114 00:00,958100,\n19980115 00:00,949400,\n19980116 00:00,962300,\n19980120 00:00,980000,\n19980121 00:00,971600,\n19980122 00:00,963000,\n19980123 00:00,956600,\n19980126 00:00,957500,\n19980127 00:00,970000,\n19980128 00:00,978800,\n19980129 00:00,987500,\n19980130 00:00,983100,\n19980202 00:00,1002500,\n19980203 00:00,1006900,\n19980204 00:00,1005900,\n19980205 00:00,1003800,\n19980206 00:00,1012800,\n19980209 00:00,1011400,\n19980210 00:00,1020500,\n19980211 00:00,1021300,\n19980212 00:00,1026600,\n19980213 00:00,1021600,\n19980217 00:00,1023400,\n19980218 00:00,1034100,\n19980219 00:00,1030000,\n19980220 00:00,1035600,\n19980223 00:00,1040000,\n19980224 00:00,1031900,\n19980225 00:00,1044800,\n19980226 00:00,1050600,\n19980227 00:00,1052000,\n19980302 00:00,1048100,\n19980303 00:00,1054100,\n19980304 00:00,1049700,\n19980305 00:00,1037500,\n19980306 00:00,1057500,\n19980309 00:00,1054400,\n19980310 00:00,1066600,\n19980311 00:00,1072500,\n19980312 00:00,1072500,\n19980313 00:00,1072200,\n19980316 00:00,1082500,\n19980317 00:00,1084700,\n19980318 00:00,1087800,\n19980319 00:00,1093400,\n19980320 00:00,1100000,\n19980323 00:00,1095000,\n19980324 00:00,1105900,\n19980325 00:00,1101900,\n19980326 00:00,1101300,\n19980327 00:00,1095300,\n19980330 00:00,1093400,\n19980331 00:00,1100900,\n19980401 00:00,1109800,\n19980402 00:00,1120300,\n19980403 00:00,1121900,\n19980406 00:00,1122500,\n19980407 00:00,1110000,\n19980408 00:00,1101300,\n19980409 00:00,1110000,\n19980413 00:00,1110000,\n19980414 00:00,1116900,\n19980415 00:00,1120200,\n19980416 00:00,1109100,\n19980417 00:00,1122200,\n19980420 00:00,1124100,\n19980421 00:00,1126300,\n19980422 00:00,1130000,\n19980423 00:00,1120900,\n19980424 00:00,1108800,\n19980427 00:00,1085900,\n19980428 00:00,1086300,\n19980429 00:00,1095300,\n19980430 00:00,1114400,\n19980501 00:00,1121900,\n19980504 00:00,1122500,\n19980505 00:00,1116600,\n19980506 00:00,1105000,\n19980507 00:00,1095900,\n19980508 00:00,1110000,\n19980511 00:00,1108600,\n19980512 00:00,1116400,\n19980513 00:00,1120600,\n19980514 00:00,1119700,\n19980515 00:00,1110000,\n19980518 00:00,1108400,\n19980519 00:00,1110600,\n19980520 00:00,1122800,\n19980521 00:00,1116900,\n19980522 00:00,1111600,\n19980526 00:00,1095300,\n19980527 00:00,1096300,\n19980528 00:00,1100000,\n19980529 00:00,1093800,\n19980601 00:00,1095000,\n19980602 00:00,1095900,\n19980603 00:00,1085000,\n19980604 00:00,1099100,\n19980605 00:00,1118100,\n19980608 00:00,1118800,\n19980609 00:00,1122800,\n19980610 00:00,1113800,\n19980611 00:00,1096600,\n19980612 00:00,1102500,\n19980615 00:00,1080000,\n19980616 00:00,1090600,\n19980617 00:00,1112500,\n19980618 00:00,1111600,\n19980619 00:00,1100300,\n19980622 00:00,1103800,\n19980623 00:00,1119700,\n19980624 00:00,1134700,\n19980625 00:00,1130000,\n19980626 00:00,1134100,\n19980629 00:00,1138900,\n19980630 00:00,1133600,\n19980701 00:00,1149400,\n19980702 00:00,1146300,\n19980706 00:00,1157800,\n19980707 00:00,1155600,\n19980708 00:00,1168100,\n19980709 00:00,1160000,\n19980710 00:00,1165300,\n19980713 00:00,1167500,\n19980714 00:00,1178100,\n19980715 00:00,1175600,\n19980716 00:00,1184400,\n19980717 00:00,1187500,\n19980720 00:00,1185000,\n19980721 00:00,1165300,\n19980722 00:00,1166300,\n19980723 00:00,1141900,\n19980724 00:00,1141600,\n19980727 00:00,1149800,\n19980728 00:00,1133100,\n19980729 00:00,1126600,\n19980730 00:00,1143400,\n19980731 00:00,1120600,\n19980803 00:00,1113800,\n19980804 00:00,1076100,\n19980805 00:00,1081600,\n19980806 00:00,1090900,\n19980807 00:00,1090300,\n19980810 00:00,1085900,\n19980811 00:00,1070600,\n19980812 00:00,1085000,\n19980813 00:00,1076400,\n19980814 00:00,1064800,\n19980817 00:00,1085000,\n19980818 00:00,1102500,\n19980819 00:00,1100000,\n19980820 00:00,1092500,\n19980821 00:00,1083800,\n19980824 00:00,1090600,\n19980825 00:00,1095000,\n19980826 00:00,1085000,\n19980827 00:00,1042500,\n19980828 00:00,1030000,\n19980831 00:00,962500,\n19980901 00:00,996900,\n19980902 00:00,990000,\n19980903 00:00,985200,\n19980904 00:00,976300,\n19980908 00:00,1025900,\n19980909 00:00,1007500,\n19980910 00:00,982500,\n19980911 00:00,1012500,\n19980914 00:00,1031600,\n19980915 00:00,1042000,\n19980916 00:00,1050000,\n19980917 00:00,1022300,\n19980918 00:00,1019700,\n19980921 00:00,1021900,\n19980922 00:00,1030000,\n19980923 00:00,1066300,\n19980924 00:00,1043800,\n19980925 00:00,1043000,\n19980928 00:00,1049100,\n19980929 00:00,1049400,\n19980930 00:00,1018400,\n19981001 00:00,986300,\n19981002 00:00,1003100,\n19981005 00:00,990000,\n19981006 00:00,985300,\n19981007 00:00,972200,\n19981008 00:00,962200,\n19981009 00:00,986300,\n19981012 00:00,997800,\n19981013 00:00,995300,\n19981014 00:00,1005000,\n19981015 00:00,1050300,\n19981016 00:00,1056600,\n19981019 00:00,1063400,\n19981020 00:00,1065000,\n19981021 00:00,1071300,\n19981022 00:00,1080000,\n19981023 00:00,1071300,\n19981026 00:00,1075500,\n19981027 00:00,1066300,\n19981028 00:00,1067800,\n19981029 00:00,1089700,\n19981030 00:00,1100000,\n19981102 00:00,1114800,\n19981103 00:00,1111300,\n19981104 00:00,1118400,\n19981105 00:00,1137300,\n19981106 00:00,1142800,\n19981109 00:00,1131400,\n19981110 00:00,1126900,\n19981111 00:00,1123800,\n19981112 00:00,1120300,\n19981113 00:00,1127700,\n19981116 00:00,1138400,\n19981117 00:00,1143400,\n19981118 00:00,1147500,\n19981119 00:00,1155000,\n19981120 00:00,1166300,\n19981123 00:00,1191600,\n19981124 00:00,1186900,\n19981125 00:00,1188800,\n19981127 00:00,1195000,\n19981130 00:00,1166900,\n19981201 00:00,1178100,\n19981202 00:00,1175000,\n19981203 00:00,1152800,\n19981204 00:00,1179700,\n19981207 00:00,1192500,\n19981208 00:00,1184700,\n19981209 00:00,1188100,\n19981210 00:00,1168100,\n19981211 00:00,1170600,\n19981214 00:00,1144700,\n19981215 00:00,1166300,\n19981216 00:00,1164100,\n19981217 00:00,1185000,\n19981218 00:00,1190200,\n19981221 00:00,1203100,\n19981222 00:00,1205300,\n19981223 00:00,1228100,\n19981224 00:00,1226900,\n19981228 00:00,1226300,\n19981229 00:00,1243100,\n19981230 00:00,1233800,\n19981231 00:00,1228800,0.4712910520523543\n19990104 00:00,1228800,0.4728670561542627\n19990105 00:00,1244400,0.475950496057797\n19990106 00:00,1275000,0.47712727616774975\n19990107 00:00,1269400,0.4806961665069667\n19990108 00:00,1275000,0.48300980030733176\n19990111 00:00,1262800,0.4850552892025323\n19990112 00:00,1240000,0.4829739721935275\n19990113 00:00,1233100,0.47996467686269106\n19990114 00:00,1211600,0.4744520721553315\n19990115 00:00,1243100,0.4741231329837287\n19990119 00:00,1252800,0.47193012934351225\n19990120 00:00,1256300,0.4717566768361204\n19990121 00:00,1235900,0.4710780794623569\n19990122 00:00,1225600,0.46877612737790114\n19990125 00:00,1236300,0.46794031258499236\n19990126 00:00,1255000,0.46699207752469607\n19990127 00:00,1244700,0.46678006945434036\n19990128 00:00,1266600,0.46562082029786156\n19990129 00:00,1278800,0.46343199543052493\n19990201 00:00,1270900,0.46305648873597693\n19990202 00:00,1262800,0.4624422976076848\n19990203 00:00,1271900,0.4621976999383761\n19990204 00:00,1248400,0.461364555435642\n19990205 00:00,1240000,0.45938336071248725\n19990208 00:00,1243800,0.4584778168587569\n19990209 00:00,1218600,0.4560342181259994\n19990210 00:00,1226900,0.4547618765871354\n19990211 00:00,1256900,0.4530881960316191\n19990212 00:00,1235000,0.4528551805526957\n19990216 00:00,1243800,0.4523534462209105\n19990217 00:00,1227500,0.45205923506980444\n19990218 00:00,1239400,0.45196456307179433\n19990219 00:00,1239400,0.451764365956601\n19990222 00:00,1276900,0.448418217351059\n19990223 00:00,1275000,0.44553679173658073\n19990224 00:00,1254100,0.44451744002886967\n19990225 00:00,1247500,0.44299463435100045\n19990226 00:00,1239100,0.44175409662164355\n19990301 00:00,1237800,0.4408998099808091\n19990302 00:00,1228100,0.43973341302610197\n19990303 00:00,1231300,0.4393329961090751\n19990304 00:00,1250000,0.438359737755776\n19990305 00:00,1278100,0.4348533991377446\n19990308 00:00,1285200,0.43148760640011696\n19990309 00:00,1282500,0.4300601500534214\n19990310 00:00,1290300,0.42915080533176386\n19990311 00:00,1302200,0.42844656654650254\n19990312 00:00,1295300,0.42855806955615716\n19990315 00:00,1311600,0.4292906281052388\n19990316 00:00,1309800,0.43019127625206977\n19990317 00:00,1302500,0.4311416585512466\n19990318 00:00,1321600,0.4327711026287231\n19990319 00:00,1300600,0.43352612807083796\n19990322 00:00,1299100,0.433669951895955\n19990323 00:00,1264100,0.429629198898721\n19990324 00:00,1269400,0.4272484439506795\n19990325 00:00,1291300,0.4269972742147061\n19990326 00:00,1284700,0.4268438767602945\n19990329 00:00,1312200,0.4264515269137314\n19990330 00:00,1303400,0.42682583165463805\n19990331 00:00,1286300,0.42667724808301016\n19990401 00:00,1293800,0.42638873644615144\n19990405 00:00,1323800,0.42462741097689183\n19990406 00:00,1319400,0.4236512076272837\n19990407 00:00,1328800,0.42301594736393167\n19990408 00:00,1345300,0.4214753872177995\n19990409 00:00,1348800,0.4207881384315672\n19990412 00:00,1360600,0.42028612820917216\n19990413 00:00,1351900,0.4206961333159151\n19990414 00:00,1330300,0.4197148291430789\n19990415 00:00,1326300,0.4183409930739607\n19990416 00:00,1321300,0.41766476034257166\n19990419 00:00,1289100,0.4132951399150537\n19990420 00:00,1306300,0.41218644766468016\n19990421 00:00,1336900,0.4114669302134066\n19990422 00:00,1359700,0.4097270163991815\n19990423 00:00,1357500,0.40975081421616466\n19990426 00:00,1361300,0.4094986527823426\n19990427 00:00,1365600,0.4097276503301416\n19990428 00:00,1353400,0.41087700863505866\n19990429 00:00,1345600,0.41111221063744185\n19990430 00:00,1334700,0.4098841852798828\n19990503 00:00,1356300,0.40972202166880173\n19990504 00:00,1333100,0.409494685147687\n19990505 00:00,1349700,0.4093709677361191\n19990506 00:00,1335000,0.4090400314471041\n19990507 00:00,1346300,0.409430505729772\n19990510 00:00,1342200,0.40928699182985656\n19990511 00:00,1357200,0.40912263733637233\n19990512 00:00,1366300,0.4084041111952369\n19990513 00:00,1370200,0.40799105118714973\n19990514 00:00,1343000,0.40743675412450764\n19990517 00:00,1343100,0.4064768548381979\n19990518 00:00,1336300,0.4058410851304908\n19990519 00:00,1348100,0.40568480389192124\n19990520 00:00,1343100,0.4061868026317747\n19990521 00:00,1334200,0.4068005693544095\n19990524 00:00,1310900,0.4061374244599704\n19990525 00:00,1288400,0.4037340262337524\n19990526 00:00,1306600,0.40390991550811883\n19990527 00:00,1284400,0.40463563114575\n19990528 00:00,1305900,0.4057097354008404\n19990601 00:00,1298800,0.40741362545006365\n19990602 00:00,1297800,0.40931783611469325\n19990603 00:00,1302800,0.4121294350966899\n19990604 00:00,1319400,0.4127417864234357\n19990607 00:00,1337500,0.41140282226998315\n19990608 00:00,1321600,0.41266120253901306\n19990609 00:00,1321600,0.4146457162238674\n19990610 00:00,1309100,0.415927505691807\n19990611 00:00,1298100,0.4155537874132969\n19990614 00:00,1297800,0.415143213219923\n19990615 00:00,1305900,0.4148124708292455\n19990616 00:00,1334800,0.4123125671661425\n19990617 00:00,1346600,0.409380445726191\n19990618 00:00,1343100,0.40769284286624774\n19990621 00:00,1349400,0.4065131457311868\n19990622 00:00,1337000,0.40609037193650227\n19990623 00:00,1332800,0.40515599722178247\n19990624 00:00,1316900,0.40362634602670455\n19990625 00:00,1316600,0.402452972722789\n19990628 00:00,1333800,0.4021780794432048\n19990629 00:00,1351300,0.40129486056195923\n19990630 00:00,1367500,0.4001697828013303\n19990701 00:00,1380600,0.3986209417943816\n19990702 00:00,1391900,0.39768717162964873\n19990706 00:00,1387200,0.397409639619978\n19990707 00:00,1395600,0.3974472905730589\n19990708 00:00,1395600,0.39669505185022275\n19990709 00:00,1402200,0.3967000244733249\n19990712 00:00,1400600,0.3959980471019314\n19990713 00:00,1395000,0.3942110610303234\n19990714 00:00,1398400,0.3908279342203257\n19990715 00:00,1411300,0.38762029059864017\n19990716 00:00,1420000,0.3835482644282193\n19990719 00:00,1410000,0.3793552518397153\n19990720 00:00,1378000,0.37215447499667437\n19990721 00:00,1378800,0.36645851001860125\n19990722 00:00,1361400,0.36028625047074403\n19990723 00:00,1357500,0.3559007263901399\n19990726 00:00,1350000,0.3525803078347946\n19990727 00:00,1365000,0.3508405507276472\n19990728 00:00,1367300,0.35011099587472944\n19990729 00:00,1343800,0.35113907146549683\n19990730 00:00,1330900,0.35367891821774267\n19990802 00:00,1329400,0.3567772724615287\n19990803 00:00,1323600,0.35789988662663286\n19990804 00:00,1306900,0.36005730175374673\n19990805 00:00,1315600,0.36133416042604766\n19990806 00:00,1300600,0.3625291593591411\n19990809 00:00,1300500,0.3630880726377724\n19990810 00:00,1282200,0.36490883830148824\n19990811 00:00,1305300,0.36660708096729194\n19990812 00:00,1300200,0.3666578807070677\n19990813 00:00,1331900,0.3630053126478859\n19990816 00:00,1333800,0.36110708765722815\n19990817 00:00,1347000,0.3551941529880093\n19990818 00:00,1335600,0.3502760331316931\n19990819 00:00,1328800,0.34655656574890487\n19990820 00:00,1338800,0.3441475316798097\n19990823 00:00,1363900,0.342218980267551\n19990824 00:00,1365000,0.3434224611872218\n19990825 00:00,1384400,0.3505276394936448\n19990826 00:00,1365000,0.3622818087151258\n19990827 00:00,1351600,0.36957673124841567\n19990830 00:00,1326600,0.3689393862168969\n19990831 00:00,1325000,0.36531677994089645\n19990901 00:00,1335600,0.36453953970343606\n19990902 00:00,1322500,0.36362617987178536\n19990903 00:00,1361900,0.36413954854384634\n19990907 00:00,1355200,0.36435099872726884\n19990908 00:00,1349100,0.36493550070033665\n19990909 00:00,1351300,0.36446618687111143\n19990910 00:00,1354500,0.36824260787734764\n19990913 00:00,1348100,0.36808576937081494\n19990914 00:00,1340600,0.36598671523980203\n19990915 00:00,1320800,0.36290299873116216\n19990916 00:00,1323800,0.3604252873778396\n19990917 00:00,1337200,0.3598131168988562\n19990920 00:00,1336300,0.3604709688114378\n19990921 00:00,1309100,0.3626223907088779\n19990922 00:00,1311600,0.3631684678438024\n19990923 00:00,1280000,0.36418594997976617\n19990924 00:00,1280600,0.3658451031094933\n19990927 00:00,1282800,0.36979499635393664\n19990928 00:00,1281900,0.3772625361104586\n19990929 00:00,1267800,0.3887715801625025\n19990930 00:00,1283800,0.39372406149872363\n19991001 00:00,1283400,0.3950482829113537\n19991004 00:00,1306300,0.3959259842016034\n19991005 00:00,1301900,0.3952751511500452\n19991006 00:00,1326300,0.3909609588238364\n19991007 00:00,1320000,0.38629690655634746\n19991008 00:00,1337200,0.3807496601607845\n19991011 00:00,1338100,0.37578606371195933\n19991012 00:00,1314100,0.37238987396825185\n19991013 00:00,1286600,0.3683627669378771\n19991014 00:00,1284100,0.36509027728352605\n19991015 00:00,1248100,0.3582479941649377\n19991018 00:00,1255600,0.35399771727176826\n19991019 00:00,1260800,0.35139755069824363\n19991020 00:00,1292200,0.3478557121333766\n19991021 00:00,1286300,0.3452733884377442\n19991022 00:00,1303400,0.34279508266285663\n19991025 00:00,1295000,0.34077175991792386\n19991026 00:00,1282500,0.33897053642620883\n19991027 00:00,1301300,0.3370306079127502\n19991028 00:00,1345000,0.3301735154459785\n19991029 00:00,1365600,0.3210238850308604\n19991101 00:00,1359400,0.31656724193022845\n19991102 00:00,1348100,0.31443525707988057\n19991103 00:00,1356900,0.3137210513998113\n19991104 00:00,1364700,0.314230213706212\n19991105 00:00,1372200,0.3165506957595849\n19991108 00:00,1379400,0.32066637730248415\n19991109 00:00,1367200,0.3236691736239906\n19991110 00:00,1377500,0.32773019111044144\n19991111 00:00,1383800,0.33236489993983315\n19991112 00:00,1397500,0.33841859282662107\n19991115 00:00,1398100,0.3440938510393393\n19991116 00:00,1424400,0.3502007857444094\n19991117 00:00,1415600,0.3556112207169644\n19991118 00:00,1428100,0.3618566555188021\n19991119 00:00,1425000,0.36758756435621104\n19991122 00:00,1424700,0.3716891878942301\n19991123 00:00,1408800,0.37303292661920223\n19991124 00:00,1420600,0.37481593369712607\n19991126 00:00,1414400,0.37598582701905114\n19991129 00:00,1410000,0.3769077449124121\n19991130 00:00,1392500,0.3751417115951892\n19991201 00:00,1401300,0.3750473452526881\n19991202 00:00,1411300,0.374529965053748\n19991203 00:00,1436900,0.37357361274900597\n19991206 00:00,1427500,0.37295395871532494\n19991207 00:00,1419400,0.37317601731085\n19991208 00:00,1406300,0.3722793630863831\n19991209 00:00,1410000,0.37206701077783133\n19991210 00:00,1420000,0.3697302207309045\n19991213 00:00,1421300,0.36715403293733756\n19991214 00:00,1408100,0.36440769959097086\n19991215 00:00,1418000,0.36294637588959855\n19991216 00:00,1423800,0.36223564745117126\n19991217 00:00,1423800,0.36178968040205833\n19991220 00:00,1416900,0.3618056260743898\n19991221 00:00,1433400,0.3620394065626814\n19991222 00:00,1437500,0.3621603089883878\n19991223 00:00,1460900,0.36097098471747774\n19991227 00:00,1458100,0.360761890881554\n19991228 00:00,1461400,0.3611303861218349\n19991229 00:00,1463400,0.3619126379205118\n19991230 00:00,1466300,0.36301422718518395\n19991231 00:00,1468800,0.3650738181880914\n20000103 00:00,1455600,0.36790997833281885\n20000104 00:00,1400600,0.3608633272812466\n20000105 00:00,1402800,0.3553141229838069\n20000106 00:00,1403400,0.35314334991282886\n20000107 00:00,1444400,0.3534942923727392\n20000110 00:00,1458100,0.3513086122923103\n20000111 00:00,1440900,0.35085355767318843\n20000112 00:00,1433400,0.35000655429007355\n20000113 00:00,1451300,0.35128899710659955\n20000114 00:00,1465000,0.34999061880679444\n20000118 00:00,1456300,0.349936044377353\n20000119 00:00,1456900,0.3502969634070193\n20000120 00:00,1445000,0.3505830831360565\n20000121 00:00,1441300,0.3521561930566994\n20000124 00:00,1400600,0.3506496144005466\n20000125 00:00,1410000,0.34975880913132334\n20000126 00:00,1406700,0.3509607520415373\n20000127 00:00,1400000,0.3512319992085345\n20000128 00:00,1364700,0.3509555858956619\n20000131 00:00,1394400,0.3523366661541953\n20000201 00:00,1401900,0.35274066782606756\n20000202 00:00,1413000,0.35384775178434197\n20000203 00:00,1428400,0.35278798765595926\n20000204 00:00,1427800,0.3526167513610221\n20000207 00:00,1427200,0.35287157238823297\n20000208 00:00,1442800,0.35273183284862136\n20000209 00:00,1414100,0.352942077143746\n20000210 00:00,1418800,0.3536183847119388\n20000211 00:00,1391300,0.35297270775074024\n20000214 00:00,1392500,0.3524711443295658\n20000215 00:00,1407500,0.35238142730470623\n20000216 00:00,1390900,0.35283273883151256\n20000217 00:00,1390600,0.35236579426287146\n20000218 00:00,1351900,0.3523549079839841\n20000222 00:00,1354200,0.3530345139220729\n20000223 00:00,1365200,0.35326362054567145\n20000224 00:00,1356900,0.35390475249456876\n20000225 00:00,1337500,0.35496979644618815\n20000228 00:00,1350600,0.3568056705083418\n20000229 00:00,1369100,0.3585899436596429\n20000301 00:00,1383100,0.36061101275292157\n20000302 00:00,1387200,0.3617232299103371\n20000303 00:00,1413100,0.3586675035333211\n20000306 00:00,1393900,0.35858937813583885\n20000307 00:00,1359400,0.3579826611386207\n20000308 00:00,1370500,0.3577295201644814\n20000309 00:00,1405900,0.355965150091393\n20000310 00:00,1400000,0.35472742113882616\n20000313 00:00,1388800,0.35449621690749233\n20000314 00:00,1365000,0.35327462153775147\n20000315 00:00,1395000,0.35346537378886395\n20000316 00:00,1463100,0.3491925383937738\n20000317 00:00,1466900,0.34549799187597263\n20000320 00:00,1459800,0.34596841834358116\n20000321 00:00,1497200,0.34697233124914323\n20000322 00:00,1500000,0.34942580120230593\n20000323 00:00,1526300,0.35446862510583144\n20000324 00:00,1532800,0.3609157396234462\n20000327 00:00,1525000,0.3685894739195692\n20000328 00:00,1510000,0.373882619444316\n20000329 00:00,1510300,0.38032424154442457\n20000330 00:00,1488800,0.38357290519551324\n20000331 00:00,1505600,0.3884460060649471\n20000403 00:00,1507700,0.39397797725213257\n20000404 00:00,1500000,0.39835233216935784\n20000405 00:00,1488800,0.40069765423267306\n20000406 00:00,1503100,0.4040120796062559\n20000407 00:00,1517800,0.4086259338381824\n20000410 00:00,1507800,0.41259156603465613\n20000411 00:00,1500600,0.41461687073922376\n20000412 00:00,1466300,0.4139360942090703\n20000413 00:00,1440000,0.40993389594106755\n20000414 00:00,1358100,0.3984325535057672\n20000417 00:00,1400600,0.3996271078282339\n20000418 00:00,1442200,0.3970347303845736\n20000419 00:00,1430000,0.3971970324136626\n20000420 00:00,1433800,0.39836910386045155\n20000424 00:00,1430000,0.4003952124472069\n20000425 00:00,1478800,0.39714812451590437\n20000426 00:00,1463800,0.3959824434107445\n20000427 00:00,1465000,0.3951384985977798\n20000428 00:00,1452200,0.39542156299351267\n20000501 00:00,1471900,0.3947022864192429\n20000502 00:00,1446300,0.3954299402280534\n20000503 00:00,1416300,0.3936597101960254\n20000504 00:00,1413100,0.39330182047222584\n20000505 00:00,1433400,0.3935285255096049\n20000508 00:00,1425300,0.39429735831147394\n20000509 00:00,1416300,0.3941463313627641\n20000510 00:00,1385900,0.39298616543813775\n20000511 00:00,1411100,0.39302936356591023\n20000512 00:00,1424100,0.3922170203369584\n20000515 00:00,1453800,0.3898337222997657\n20000516 00:00,1470000,0.386546605469682\n20000517 00:00,1452500,0.38682619155718034\n20000518 00:00,1440600,0.38815413661941295\n20000519 00:00,1408800,0.38853875849556724\n20000522 00:00,1404100,0.38733314232339267\n20000523 00:00,1375600,0.3852775308484594\n20000524 00:00,1404100,0.3852511208085664\n20000525 00:00,1388800,0.3853732392359998\n20000526 00:00,1383100,0.3856708789423696\n20000530 00:00,1426300,0.384561735691355\n20000531 00:00,1424100,0.3834185973723606\n20000601 00:00,1451700,0.38109605439150407\n20000602 00:00,1480900,0.37624397041655294\n20000605 00:00,1472500,0.3750381908932384\n20000606 00:00,1463400,0.3741458394354995\n20000607 00:00,1475600,0.3739648602972704\n20000608 00:00,1465600,0.3731138662436768\n20000609 00:00,1463400,0.37198260673492867\n20000612 00:00,1452800,0.37119162548061263\n20000613 00:00,1474700,0.3713040207752373\n20000614 00:00,1475000,0.37120778185624204\n20000615 00:00,1482500,0.372007520096833\n20000616 00:00,1468800,0.3723907795258845\n20000619 00:00,1486600,0.37431125258685705\n20000620 00:00,1478100,0.37519894476138793\n20000621 00:00,1479500,0.37597699668576007\n20000622 00:00,1455300,0.3757071934619908\n20000623 00:00,1443800,0.37595647627754597\n20000626 00:00,1457500,0.3775278714060973\n20000627 00:00,1455600,0.3785497631994831\n20000628 00:00,1456300,0.3790564760822265\n20000629 00:00,1444400,0.3788726647679579\n20000630 00:00,1453800,0.3782196271682743\n20000703 00:00,1472800,0.3769024240809561\n20000705 00:00,1450900,0.3756348095020284\n20000706 00:00,1458800,0.373909605980938\n20000707 00:00,1480900,0.37069338004186275\n20000710 00:00,1479700,0.3674351916362647\n20000711 00:00,1483800,0.36441370143114804\n20000712 00:00,1495900,0.36081914875490767\n20000713 00:00,1498800,0.3565956876871952\n20000714 00:00,1508800,0.35359495129795676\n20000717 00:00,1510600,0.3513572783010122\n20000718 00:00,1496900,0.3498273630745259\n20000719 00:00,1484400,0.3479364708577593\n20000720 00:00,1498100,0.3473553097445989\n20000721 00:00,1482500,0.34657369806219634\n20000724 00:00,1466600,0.3452694910758662\n20000725 00:00,1474400,0.3456116916576705\n20000726 00:00,1461600,0.34688932246584847\n20000727 00:00,1455000,0.3470673898417632\n20000728 00:00,1422500,0.34577649404299127\n20000731 00:00,1434400,0.34630385436364863\n20000801 00:00,1440000,0.3470965495273747\n20000802 00:00,1442700,0.34752377621815184\n20000803 00:00,1455000,0.3481972461073051\n20000804 00:00,1465300,0.3477854526088391\n20000807 00:00,1481300,0.34632222715098504\n20000808 00:00,1485600,0.3458648200959142\n20000809 00:00,1476900,0.3463672439697071\n20000810 00:00,1465600,0.3476395284050239\n20000811 00:00,1474400,0.3480388161202911\n20000814 00:00,1493800,0.34782381776080107\n20000815 00:00,1490200,0.3480102163254541\n20000816 00:00,1483800,0.3486373342526018\n20000817 00:00,1499400,0.3504944244312464\n20000818 00:00,1496700,0.3518649530136886\n20000821 00:00,1503600,0.3524276933560454\n20000822 00:00,1502300,0.35295404735639574\n20000823 00:00,1509100,0.35454594376421694\n20000824 00:00,1514400,0.3557250975157037\n20000825 00:00,1510900,0.3560467187581129\n20000828 00:00,1517800,0.35660043810814673\n20000829 00:00,1515000,0.35696203718224895\n20000830 00:00,1506300,0.35617896854316305\n20000831 00:00,1522500,0.35663850535328256\n20000901 00:00,1525600,0.3540421735653227\n20000905 00:00,1512500,0.3515571996613849\n20000906 00:00,1496900,0.34875050422846293\n20000907 00:00,1507500,0.3469334016126925\n20000908 00:00,1497500,0.34556309380439976\n20000911 00:00,1494700,0.34492401506420334\n20000912 00:00,1487500,0.34444721485182106\n20000913 00:00,1488800,0.3445616131426756\n20000914 00:00,1485300,0.3449783111061253\n20000915 00:00,1467500,0.3461312447191946\n20000918 00:00,1446900,0.34723590746374466\n20000919 00:00,1460800,0.34858266629956897\n20000920 00:00,1452200,0.35059960416117075\n20000921 00:00,1450300,0.35227463377470025\n20000922 00:00,1451600,0.35426416917709935\n20000925 00:00,1441300,0.35693227437875935\n20000926 00:00,1428900,0.3599659107137651\n20000927 00:00,1428100,0.3642769906877474\n20000928 00:00,1461900,0.3657322615006483\n20000929 00:00,1437800,0.3691577820419001\n20001002 00:00,1438100,0.371098014721694\n20001003 00:00,1426300,0.3734817240529839\n20001004 00:00,1435800,0.3754386586829943\n20001005 00:00,1438800,0.37748181423337734\n20001006 00:00,1410000,0.3821087742980694\n20001009 00:00,1404400,0.3883403793036399\n20001010 00:00,1388800,0.3917341872111138\n20001011 00:00,1365600,0.39162178244415147\n20001012 00:00,1331600,0.3892205110883509\n20001013 00:00,1375600,0.38684062392177004\n20001016 00:00,1374700,0.38421786737175706\n20001017 00:00,1354800,0.3828251726874806\n20001018 00:00,1344100,0.3825518635495294\n20001019 00:00,1390500,0.37881568239374763\n20001020 00:00,1398800,0.3742315520338868\n20001023 00:00,1400000,0.3705854939001256\n20001024 00:00,1401300,0.36991027145676303\n20001025 00:00,1369200,0.36997841073255533\n20001026 00:00,1367500,0.36848823084414\n20001027 00:00,1383800,0.36794834274143473\n20001030 00:00,1402500,0.36600521761976146\n20001031 00:00,1429700,0.36237234378431854\n20001101 00:00,1424100,0.36068112860643253\n20001102 00:00,1430300,0.3599116177752071\n20001103 00:00,1431100,0.3600704712925024\n20001106 00:00,1437000,0.36112157834733694\n20001107 00:00,1436600,0.3631513018513261\n20001108 00:00,1412500,0.3641310466897837\n20001109 00:00,1404100,0.36434403287659795\n20001110 00:00,1369700,0.3610594733668761\n20001113 00:00,1353800,0.3568314561952019\n20001114 00:00,1387500,0.3561761975580211\n20001115 00:00,1391300,0.3552132916891955\n20001116 00:00,1377700,0.35503262138110603\n20001117 00:00,1374700,0.3551841877975029\n20001120 00:00,1346900,0.3551010879685249\n20001121 00:00,1351600,0.35543753265699174\n20001122 00:00,1325000,0.35633037813379564\n20001124 00:00,1348400,0.35782407042526315\n20001127 00:00,1355000,0.3584859574692314\n20001128 00:00,1338100,0.36067328208104865\n20001129 00:00,1346400,0.36251561803953986\n20001130 00:00,1316300,0.3645773775894932\n20001201 00:00,1318800,0.36733770754266354\n20001204 00:00,1330000,0.36914370264332147\n20001205 00:00,1381300,0.36486335746969717\n20001206 00:00,1355300,0.36371510580115285\n20001207 00:00,1349800,0.36256045361058065\n20001208 00:00,1376600,0.36099317992010266\n20001211 00:00,1386300,0.3591281146014992\n20001212 00:00,1377500,0.3586240812409477\n20001213 00:00,1365300,0.358287999247884\n20001214 00:00,1341900,0.3570461825052945\n20001215 00:00,1314500,0.35397521362472695\n20001218 00:00,1323800,0.3535265472761571\n20001219 00:00,1305600,0.352669383873644\n20001220 00:00,1266900,0.34973155736261063\n20001221 00:00,1276900,0.348621419876965\n20001222 00:00,1308600,0.3479871892216133\n20001226 00:00,1318900,0.3467444293841328\n20001227 00:00,1331300,0.34563073986623916\n20001228 00:00,1336100,0.34542734955753623\n20001229 00:00,1322500,0.3482938848158094\n20010102 00:00,1282500,0.34913184344082865\n20010103 00:00,1350000,0.34959145213895376\n20010104 00:00,1334100,0.35072409910672125\n20010105 00:00,1302500,0.3529764998027673\n20010108 00:00,1297500,0.352219630022492\n20010109 00:00,1301300,0.35209781169149135\n20010110 00:00,1316600,0.3522671994737829\n20010111 00:00,1327700,0.35256593938318825\n20010112 00:00,1319100,0.3524377678975281\n20010116 00:00,1325800,0.3526300284224165\n20010117 00:00,1329400,0.35342281974062434\n20010118 00:00,1350500,0.35478162889190396\n20010119 00:00,1344800,0.35694036483823033\n20010122 00:00,1346300,0.35873072885915464\n20010123 00:00,1361300,0.3592994114934427\n20010124 00:00,1366900,0.3600293236524521\n20010125 00:00,1360600,0.36134706376305176\n20010126 00:00,1357800,0.36188098234290494\n20010129 00:00,1366500,0.3658990828147158\n20010130 00:00,1377500,0.36790398616344533\n20010131 00:00,1370600,0.36964961502063975\n20010201 00:00,1374800,0.3704022619261164\n20010202 00:00,1350800,0.3694401809664333\n20010205 00:00,1358900,0.3693102246899551\n20010206 00:00,1354200,0.36901057981221724\n20010207 00:00,1342200,0.3688759893555646\n20010208 00:00,1334800,0.3683809361062821\n20010209 00:00,1318300,0.36776487803073654\n20010212 00:00,1331400,0.3679285640658797\n20010213 00:00,1321200,0.3683158863745959\n20010214 00:00,1321500,0.37031133534385713\n20010215 00:00,1329600,0.3717807306749443\n20010216 00:00,1304600,0.3732268174481928\n20010220 00:00,1283200,0.3712157802105863\n20010221 00:00,1256000,0.3680880608097035\n20010222 00:00,1255200,0.36654726925504927\n20010223 00:00,1248900,0.36421357536103915\n20010226 00:00,1272100,0.35986544430105327\n20010227 00:00,1263500,0.35560272305397855\n20010228 00:00,1241500,0.3524956778243806\n20010301 00:00,1244900,0.34954195857212794\n20010302 00:00,1237700,0.3466573084775881\n20010305 00:00,1244000,0.3469780397371272\n20010306 00:00,1258700,0.34217703252928927\n20010307 00:00,1266400,0.3341358345266069\n20010308 00:00,1269000,0.3265119633981919\n20010309 00:00,1236700,0.323762820132828\n20010312 00:00,1184400,0.31823620334233005\n20010313 00:00,1202000,0.31612185149979616\n20010314 00:00,1172000,0.3213426708746613\n20010315 00:00,1177100,0.3264712659091759\n20010316 00:00,1153100,0.32951446441573906\n20010319 00:00,1173000,0.33280080529678724\n20010320 00:00,1142500,0.33899588945080994\n20010321 00:00,1123400,0.34183668424479136\n20010322 00:00,1119000,0.34559695903563453\n20010323 00:00,1142500,0.3463096212889737\n20010326 00:00,1155000,0.3450864720565337\n20010327 00:00,1185100,0.3399234702957086\n20010328 00:00,1154500,0.34005555847720276\n20010329 00:00,1149800,0.34001221567187606\n20010330 00:00,1161200,0.3409070680951246\n20010402 00:00,1145400,0.3420267746386051\n20010403 00:00,1106700,0.3429847851495268\n20010404 00:00,1103100,0.34410043161413667\n20010405 00:00,1152200,0.3447332982436529\n20010406 00:00,1130500,0.34593120923443343\n20010409 00:00,1140000,0.34930638165019945\n20010410 00:00,1170900,0.3535103734293222\n20010411 00:00,1169600,0.3610538154425925\n20010412 00:00,1185500,0.3673558176075101\n20010416 00:00,1182300,0.3680465473934625\n20010417 00:00,1194200,0.375473171050988\n20010418 00:00,1241400,0.376017317842077\n20010419 00:00,1257200,0.3756569430859598\n20010420 00:00,1243600,0.379359272051169\n20010423 00:00,1227000,0.3836171186460805\n20010424 00:00,1211300,0.38624678657497585\n20010425 00:00,1231000,0.39003877012339044\n20010426 00:00,1237400,0.39452709251833773\n20010427 00:00,1255500,0.4001604909864036\n20010430 00:00,1252100,0.4058227010306005\n20010501 00:00,1269500,0.4147970710280987\n20010502 00:00,1268900,0.4215935442407319\n20010503 00:00,1251600,0.42590036586403346\n20010504 00:00,1269500,0.4300800614613408\n20010507 00:00,1265700,0.4341473239961622\n20010508 00:00,1265200,0.4375956196768061\n20010509 00:00,1258700,0.4393149544344534\n20010510 00:00,1259900,0.4433984538705123\n20010511 00:00,1248200,0.4456745510166548\n20010514 00:00,1252300,0.4473870757175146\n20010515 00:00,1253000,0.4487755083154229\n20010516 00:00,1289600,0.4521171280671783\n20010517 00:00,1293100,0.45447180095211387\n20010518 00:00,1296200,0.4567590627698502\n20010521 00:00,1317700,0.4556018921672155\n20010522 00:00,1313700,0.45448772941277327\n20010523 00:00,1292900,0.45264710949260367\n20010524 00:00,1297000,0.4524277798947498\n20010525 00:00,1282300,0.45341424559016474\n20010529 00:00,1273000,0.45626077306338847\n20010530 00:00,1252900,0.45564639651000316\n20010531 00:00,1261000,0.4580243625130304\n20010601 00:00,1266400,0.45817806728029825\n20010604 00:00,1271700,0.45824284263566073\n20010605 00:00,1288700,0.45774781869196957\n20010606 00:00,1275300,0.4578845323108694\n20010607 00:00,1282400,0.45815079830419464\n20010608 00:00,1270000,0.4584532488941017\n20010611 00:00,1259400,0.4584754448588922\n20010612 00:00,1261300,0.4592851923119714\n20010613 00:00,1247400,0.45915216035551193\n20010614 00:00,1224800,0.45808202061606834\n20010615 00:00,1216200,0.4572268716663765\n20010618 00:00,1210800,0.45687047865515706\n20010619 00:00,1214600,0.45801313000253563\n20010620 00:00,1226000,0.4586851075622402\n20010621 00:00,1238600,0.45868306650152796\n20010622 00:00,1227500,0.4578351221259764\n20010625 00:00,1221300,0.45694937946141906\n20010626 00:00,1218400,0.45651738326388774\n20010627 00:00,1213100,0.4563326447949\n20010628 00:00,1228900,0.4559992484760625\n20010629 00:00,1232000,0.4560967455410535\n20010702 00:00,1239000,0.45579678865375356\n20010703 00:00,1240800,0.45565647546079296\n20010705 00:00,1221300,0.4575179895495662\n20010706 00:00,1191900,0.45713593972473904\n20010709 00:00,1201000,0.4567469915736868\n20010710 00:00,1183500,0.4564287575717794\n20010711 00:00,1182700,0.45634519948541763\n20010712 00:00,1211600,0.4555096397695216\n20010713 00:00,1219000,0.4537280992022657\n20010716 00:00,1206000,0.4533139512663997\n20010717 00:00,1216700,0.45336801629004453\n20010718 00:00,1211000,0.45342017160590165\n20010719 00:00,1218300,0.4533405280531469\n20010720 00:00,1214500,0.4548235427826541\n20010723 00:00,1193600,0.455044326887496\n20010724 00:00,1173900,0.45324961321751145\n20010725 00:00,1193000,0.45406348547786174\n20010726 00:00,1207500,0.4534801890915506\n20010727 00:00,1210000,0.45177590806149326\n20010730 00:00,1208200,0.4496178794589562\n20010731 00:00,1214600,0.44770490259517376\n20010801 00:00,1219600,0.4462335270016085\n20010802 00:00,1223800,0.445449783662297\n20010803 00:00,1218700,0.4449185623701507\n20010806 00:00,1204500,0.4437142732903246\n20010807 00:00,1208300,0.44296658795180216\n20010808 00:00,1186500,0.4416500678316965\n20010809 00:00,1187400,0.4402185010654198\n20010810 00:00,1194400,0.43988851719158867\n20010813 00:00,1194900,0.43942145661153753\n20010814 00:00,1191100,0.43916854061313604\n20010815 00:00,1182800,0.4390242506203501\n20010816 00:00,1186200,0.4393632422935433\n20010817 00:00,1166400,0.4391701251158019\n20010820 00:00,1175600,0.439490490312665\n20010821 00:00,1161300,0.439638944028183\n20010822 00:00,1170500,0.4400515887743164\n20010823 00:00,1167000,0.4401421162545722\n20010824 00:00,1190000,0.43896434217304936\n20010827 00:00,1184900,0.43808903091235424\n20010828 00:00,1166400,0.43732403381808005\n20010829 00:00,1154000,0.43611492775543365\n20010830 00:00,1132800,0.4346448791090069\n20010831 00:00,1139200,0.4333387858642098\n20010904 00:00,1136500,0.4325121474853045\n20010905 00:00,1136500,0.43170645829367743\n20010906 00:00,1111000,0.4311061143825131\n20010907 00:00,1091300,0.4297440711772497\n20010910 00:00,1098300,0.4298009375057405\n20010917 00:00,1043000,0.4283585921833417\n20010918 00:00,1039000,0.42759299393211264\n20010919 00:00,1020200,0.42879946658954626\n20010920 00:00,989600,0.43063895326247714\n20010921 00:00,968500,0.4334210639303417\n20010924 00:00,1004800,0.43821210466911753\n20010925 00:00,1014000,0.4404278220221373\n20010926 00:00,1010000,0.4437860537000726\n20010927 00:00,1020500,0.44602809495542145\n20010928 00:00,1042500,0.4451885708220026\n20011001 00:00,1040000,0.4450498613477131\n20011002 00:00,1053800,0.4445973823418414\n20011003 00:00,1073400,0.4416894265109373\n20011004 00:00,1071000,0.43994484702601333\n20011005 00:00,1072600,0.4393089037570454\n20011008 00:00,1065300,0.439861690121946\n20011009 00:00,1058700,0.4410961149098062\n20011010 00:00,1084000,0.4439731972985753\n20011011 00:00,1100100,0.44811127590935673\n20011012 00:00,1094500,0.4517873132740209\n20011015 00:00,1093000,0.4567329088787868\n20011016 00:00,1100600,0.4611655251960067\n20011017 00:00,1079000,0.4619636615980831\n20011018 00:00,1072100,0.46230448762543724\n20011019 00:00,1075500,0.4635548840626379\n20011022 00:00,1092600,0.46513712310611977\n20011023 00:00,1088000,0.467156255986571\n20011024 00:00,1087700,0.4704840824846891\n20011025 00:00,1103100,0.47135404504220585\n20011026 00:00,1107700,0.47220201262332556\n20011029 00:00,1082300,0.47330117633857854\n20011030 00:00,1062000,0.47246764041168654\n20011031 00:00,1062700,0.4737416756872727\n20011101 00:00,1086700,0.47761170387176216\n20011102 00:00,1090600,0.48031581590847466\n20011105 00:00,1105800,0.4803475859411885\n20011106 00:00,1122900,0.47771011049968665\n20011107 00:00,1119600,0.47615889669351374\n20011108 00:00,1123500,0.4748397134789196\n20011109 00:00,1124400,0.4742135382291572\n20011112 00:00,1121600,0.4749887472878162\n20011113 00:00,1143900,0.4772878713044744\n20011114 00:00,1146200,0.47954353498554203\n20011115 00:00,1146000,0.48206179467770544\n20011116 00:00,1143100,0.4838297806313143\n20011119 00:00,1155300,0.4865961602897201\n20011120 00:00,1148100,0.4887722332811323\n20011121 00:00,1141500,0.4915036786350203\n20011123 00:00,1155200,0.4945335054329569\n20011126 00:00,1162200,0.49743917524912196\n20011127 00:00,1154000,0.4992606015181109\n20011128 00:00,1133400,0.4993190846009758\n20011129 00:00,1144800,0.5006506694237282\n20011130 00:00,1143000,0.5010672005146094\n20011203 00:00,1133600,0.5015009612691267\n20011204 00:00,1150000,0.5022706286326776\n20011205 00:00,1176400,0.501612097522608\n20011206 00:00,1173000,0.5035978252290206\n20011207 00:00,1164500,0.5078616766601908\n20011210 00:00,1144600,0.5087788041575417\n20011211 00:00,1141900,0.507790141975557\n20011212 00:00,1142900,0.508063191066643\n20011213 00:00,1123600,0.5084255191629118\n20011214 00:00,1129000,0.5083489549075211\n20011217 00:00,1139900,0.5102429407282801\n20011218 00:00,1149300,0.5131944101929952\n20011219 00:00,1155000,0.516648179624221\n20011220 00:00,1146900,0.5185953440242989\n20011221 00:00,1146600,0.5194532020682503\n20011224 00:00,1147300,0.5223255078034078\n20011226 00:00,1152500,0.5227668307845923\n20011227 00:00,1159300,0.5253684595373205\n20011228 00:00,1162100,0.5276908492429967\n20011231 00:00,1148900,0.5280917735948246\n20020102 00:00,1155900,0.5283505684822303\n20020103 00:00,1167600,0.5289155600005553\n20020104 00:00,1174100,0.5306907762160703\n20020107 00:00,1167000,0.5309455822531264\n20020108 00:00,1163600,0.5312867383441316\n20020109 00:00,1157000,0.5344375844958744\n20020110 00:00,1159600,0.5355459465725559\n20020111 00:00,1147700,0.5341433655737415\n20020114 00:00,1141200,0.5330230477622709\n20020115 00:00,1148800,0.5327973955089194\n20020116 00:00,1130500,0.531847466176232\n20020117 00:00,1141300,0.5316058249711698\n20020118 00:00,1130800,0.5320075791637981\n20020122 00:00,1122500,0.5326238632718917\n20020123 00:00,1131400,0.5335011938669129\n20020124 00:00,1135400,0.5335501745780542\n20020125 00:00,1135900,0.5341839485278996\n20020128 00:00,1136300,0.5348248162402853\n20020129 00:00,1102800,0.5335625865233811\n20020130 00:00,1116100,0.5324532309695581\n20020131 00:00,1132400,0.5307989606671135\n20020201 00:00,1126000,0.5298230931744103\n20020204 00:00,1097000,0.5274655689357373\n20020205 00:00,1092700,0.5241456299927438\n20020206 00:00,1087000,0.5214122284841026\n20020207 00:00,1083800,0.5187114696689312\n20020208 00:00,1099700,0.5164548397082056\n20020211 00:00,1115900,0.5127959788394719\n20020212 00:00,1111100,0.5103627479500571\n20020213 00:00,1122600,0.5079781607634163\n20020214 00:00,1119800,0.5059654063439286\n20020215 00:00,1108300,0.5045851467985333\n20020219 00:00,1087400,0.5021576794381496\n20020220 00:00,1103200,0.5008595268171178\n20020221 00:00,1086000,0.4999174268788774\n20020222 00:00,1093700,0.5011658585437677\n20020225 00:00,1115000,0.5004262948973013\n20020226 00:00,1113600,0.49790878546692074\n20020227 00:00,1115500,0.49540591273810486\n20020228 00:00,1111900,0.4927034674563734\n20020301 00:00,1136600,0.48921675739096493\n20020304 00:00,1159300,0.48288434663300245\n20020305 00:00,1152100,0.47872092248136683\n20020306 00:00,1168100,0.47605520754202524\n20020307 00:00,1163300,0.4740194857376955\n20020308 00:00,1168900,0.4737189601568981\n20020311 00:00,1173400,0.4734687933281145\n20020312 00:00,1171000,0.4731910103142252\n20020313 00:00,1159000,0.4750455295044654\n20020314 00:00,1158600,0.48275534786825247\n20020315 00:00,1167900,0.48634173131104574\n20020318 00:00,1167600,0.4877644654738496\n20020319 00:00,1173500,0.4910557920021573\n20020320 00:00,1154300,0.4921978823324494\n20020321 00:00,1156000,0.49385340353304336\n20020322 00:00,1150900,0.49446069848310714\n20020325 00:00,1134300,0.4967717760398412\n20020326 00:00,1140800,0.49642938557955185\n20020327 00:00,1146700,0.4960831523210252\n20020328 00:00,1149100,0.4966393837358927\n20020401 00:00,1148300,0.49627449601837315\n20020402 00:00,1139300,0.4949985247994713\n20020403 00:00,1127400,0.4974798648632128\n20020404 00:00,1128900,0.4964099579256078\n20020405 00:00,1125300,0.4951462768831866\n20020408 00:00,1128100,0.4974959887478343\n20020409 00:00,1120500,0.4955970777961908\n20020410 00:00,1133500,0.490935585429635\n20020411 00:00,1107200,0.486037671034891\n20020412 00:00,1113300,0.48226575249401304\n20020415 00:00,1106300,0.4801506926752321\n20020416 00:00,1131200,0.4775188338520822\n20020417 00:00,1130500,0.47481637492880985\n20020418 00:00,1127600,0.4739733686245501\n20020419 00:00,1128500,0.47459262086524484\n20020422 00:00,1111400,0.4792890963560287\n20020423 00:00,1103800,0.4824166511259182\n20020424 00:00,1095900,0.48155774940277124\n20020425 00:00,1094300,0.48316826242481875\n20020426 00:00,1079500,0.4830306703247548\n20020429 00:00,1069200,0.48100114793109533\n20020430 00:00,1079800,0.4812928304589372\n20020501 00:00,1089600,0.4804704420125911\n20020502 00:00,1087700,0.4796617006048627\n20020503 00:00,1076700,0.4792089923066894\n20020506 00:00,1056200,0.47804099425307717\n20020507 00:00,1052300,0.47765223117480854\n20020508 00:00,1091600,0.47553768409335057\n20020509 00:00,1076500,0.47435986804242725\n20020510 00:00,1059800,0.47399121452165766\n20020513 00:00,1078200,0.47368263403566\n20020514 00:00,1100900,0.47072990332853026\n20020515 00:00,1095500,0.4694555586528393\n20020516 00:00,1103500,0.4689140283937119\n20020517 00:00,1111100,0.4702638093439894\n20020520 00:00,1096400,0.47436872963683385\n20020521 00:00,1084800,0.4786864167940398\n20020522 00:00,1090500,0.479337338018811\n20020523 00:00,1101600,0.48018705778591925\n20020524 00:00,1088500,0.48013811410171536\n20020528 00:00,1079000,0.4793312703549468\n20020529 00:00,1072500,0.47836291492500344\n20020530 00:00,1070100,0.4774834534319146\n20020531 00:00,1072300,0.4777823495650566\n20020603 00:00,1043000,0.47597704637479593\n20020604 00:00,1044100,0.4740737650541012\n20020605 00:00,1055000,0.47494507397912344\n20020606 00:00,1034200,0.47558779995396244\n20020607 00:00,1032600,0.4760925106013069\n20020610 00:00,1035600,0.4764403284326482\n20020611 00:00,1018900,0.4774591882758671\n20020612 00:00,1026400,0.4790558393343356\n20020613 00:00,1015000,0.4820181222912359\n20020614 00:00,1012900,0.48492907386782397\n20020617 00:00,1041900,0.4853418444176453\n20020618 00:00,1042400,0.48653708264636625\n20020619 00:00,1025400,0.4885266295781319\n20020620 00:00,1012000,0.4887257146521494\n20020621 00:00,991900,0.4880171297588215\n20020624 00:00,996900,0.48898009625834576\n20020625 00:00,979000,0.4897172582632933\n20020626 00:00,976200,0.4898761176303978\n20020627 00:00,994500,0.49047581446471944\n20020628 00:00,992500,0.49066027457983896\n20020701 00:00,970800,0.4914262598728151\n20020702 00:00,950200,0.4911605124724784\n20020703 00:00,956900,0.4930210338183921\n20020705 00:00,993000,0.49124260324801\n20020708 00:00,980300,0.49124935136296183\n20020709 00:00,956100,0.4934546409620828\n20020710 00:00,922900,0.49453165509366764\n20020711 00:00,931500,0.495386310002453\n20020712 00:00,924600,0.49585745472962484\n20020715 00:00,921000,0.49747074163179195\n20020716 00:00,905800,0.5008608264628162\n20020717 00:00,910000,0.5048002943846435\n20020718 00:00,883300,0.5064163154339761\n20020719 00:00,848000,0.5045421158962283\n20020722 00:00,822100,0.5015838513583214\n20020723 00:00,800000,0.5008324019364483\n20020724 00:00,847500,0.504083003579501\n20020725 00:00,842000,0.5075363426949331\n20020726 00:00,856000,0.5100744055114959\n20020729 00:00,902300,0.5012784958900088\n20020730 00:00,907000,0.4956160793284352\n20020731 00:00,913800,0.4906380040129506\n20020801 00:00,886400,0.489775185697547\n20020802 00:00,866600,0.48843167214543065\n20020805 00:00,837300,0.48517258659611273\n20020806 00:00,864000,0.48494647828396004\n20020807 00:00,881500,0.48318558975316234\n20020808 00:00,909800,0.47947868423400075\n20020809 00:00,912600,0.4772040548689554\n20020812 00:00,907000,0.47701874096627633\n20020813 00:00,887500,0.4770989169121885\n20020814 00:00,924100,0.47850231638711455\n20020815 00:00,934000,0.47879058049295076\n20020816 00:00,932200,0.48030121167694306\n20020819 00:00,955200,0.4814623976126945\n20020820 00:00,942700,0.48232598266363697\n20020821 00:00,955000,0.48232752492432146\n20020822 00:00,967600,0.48064713661805203\n20020823 00:00,945200,0.4781333239035837\n20020826 00:00,952800,0.47386712481178256\n20020827 00:00,939000,0.4698979875497447\n20020828 00:00,923000,0.46263674056991294\n20020829 00:00,923000,0.4556667869443181\n20020830 00:00,921000,0.44746363764762515\n20020903 00:00,882100,0.43636764480625334\n20020904 00:00,897500,0.4290431154691078\n20020905 00:00,884700,0.42291893352752663\n20020906 00:00,898600,0.4199069059074863\n20020909 00:00,908000,0.41807581812683453\n20020910 00:00,915500,0.4188408792928038\n20020911 00:00,915000,0.4239056813916693\n20020912 00:00,892600,0.43015888250596535\n20020913 00:00,895400,0.4376981507389242\n20020916 00:00,897300,0.4501390740210451\n20020917 00:00,879700,0.45318579014694854\n20020918 00:00,874900,0.45685100162697845\n20020919 00:00,848500,0.4562696152595217\n20020920 00:00,846600,0.45271008149040076\n20020923 00:00,835900,0.45146275316868506\n20020924 00:00,821500,0.44954695160500424\n20020925 00:00,841100,0.4489826312776775\n20020926 00:00,858700,0.4476404667186945\n20020927 00:00,828500,0.4488181727683703\n20020930 00:00,816000,0.4488217069616519\n20021001 00:00,850000,0.449066670137509\n20021002 00:00,830500,0.4498904870519263\n20021003 00:00,820500,0.450754826942132\n20021004 00:00,803900,0.4519156136459352\n20021007 00:00,788200,0.453132027959924\n20021008 00:00,801100,0.45572999567761985\n20021009 00:00,780000,0.4594583689963302\n20021010 00:00,806600,0.45994606108897185\n20021011 00:00,839000,0.45483483493155336\n20021014 00:00,844700,0.4497227021954654\n20021015 00:00,884200,0.4402080031225553\n20021016 00:00,863700,0.4372685048978307\n20021017 00:00,881800,0.433493452730736\n20021018 00:00,886500,0.43103779277440435\n20021021 00:00,902900,0.4295081694256715\n20021022 00:00,893200,0.42997349137282137\n20021023 00:00,899700,0.43127884864702315\n20021024 00:00,885800,0.43237477066998115\n20021025 00:00,900400,0.4366286553380299\n20021028 00:00,894200,0.4418123762636326\n20021029 00:00,886000,0.4427015045889344\n20021030 00:00,894500,0.4451133327764688\n20021031 00:00,888600,0.448217039898239\n20021101 00:00,905300,0.4521711343101167\n20021104 00:00,911500,0.45630592695761196\n20021105 00:00,919700,0.4592825187781317\n20021106 00:00,927700,0.4616646752090258\n20021107 00:00,905700,0.4626793466858892\n20021108 00:00,898700,0.46237264472457645\n20021111 00:00,880500,0.46093698730033933\n20021112 00:00,887500,0.4608813077798339\n20021113 00:00,886800,0.4603904091074478\n20021114 00:00,908700,0.4598127418595214\n20021115 00:00,913800,0.4589033723600644\n20021118 00:00,905000,0.4587438552470711\n20021119 00:00,902300,0.45879657643836785\n20021120 00:00,919400,0.4588085635313276\n20021121 00:00,939000,0.4578410243951601\n20021122 00:00,936200,0.4576115537860082\n20021125 00:00,938000,0.4587245569605745\n20021126 00:00,918500,0.4590098797342135\n20021127 00:00,943500,0.46028361302308496\n20021129 00:00,939800,0.4612528566727345\n20021202 00:00,938900,0.46276713905187794\n20021203 00:00,925500,0.46536140989226155\n20021204 00:00,923700,0.46614491320368306\n20021205 00:00,911600,0.46689753386515154\n20021206 00:00,918100,0.4688308473990235\n20021209 00:00,896900,0.46897514333071144\n20021210 00:00,909200,0.46886527241007575\n20021211 00:00,910400,0.46865165594252517\n20021212 00:00,907500,0.46843705077541814\n20021213 00:00,895000,0.4683867472935085\n20021216 00:00,916800,0.46853695843843934\n20021217 00:00,909300,0.46840586036952675\n20021218 00:00,896400,0.4681660905579234\n20021219 00:00,890800,0.46797910603534393\n20021220 00:00,896900,0.46816319123757805\n20021223 00:00,899300,0.4684373660036696\n20021224 00:00,893300,0.46901283677690436\n20021226 00:00,890300,0.46941013593726255\n20021227 00:00,876800,0.46953245625013934\n20021230 00:00,880900,0.4696268382491776\n20021231 00:00,881800,0.4706056572054782\n20030102 00:00,911300,0.469279786616708\n20030103 00:00,911300,0.46729003006445136\n20030106 00:00,931300,0.4645366152304626\n20030107 00:00,925600,0.46312666917888534\n20030108 00:00,912000,0.46237008857687434\n20030109 00:00,930000,0.46201541677074404\n20030110 00:00,929700,0.46189660856506287\n20030113 00:00,928800,0.46213547745387423\n20030114 00:00,934400,0.46277283899170996\n20030115 00:00,921200,0.46320142548905274\n20030116 00:00,918300,0.4635405512771811\n20030117 00:00,904800,0.46322173096651703\n20030121 00:00,890300,0.4616335466581803\n20030122 00:00,880400,0.4601288367996835\n20030123 00:00,890600,0.4598810232564715\n20030124 00:00,863300,0.4588852057248079\n20030127 00:00,850300,0.45775405449712536\n20030128 00:00,861200,0.4581507930769849\n20030129 00:00,867800,0.4591224628002077\n20030130 00:00,848000,0.4604004241794707\n20030131 00:00,858400,0.4634183990422338\n20030203 00:00,862700,0.4656094913960348\n20030204 00:00,851400,0.46629722528502876\n20030205 00:00,846400,0.4665809644968064\n20030206 00:00,841700,0.4669957448202002\n20030207 00:00,832900,0.4678939857178279\n20030210 00:00,839400,0.4675973573696311\n20030211 00:00,832100,0.46746875176026254\n20030212 00:00,822200,0.4668383669153368\n20030213 00:00,821000,0.4670577243217864\n20030214 00:00,838800,0.46646990053303716\n20030218 00:00,855500,0.46223261966017404\n20030219 00:00,849300,0.457822418853509\n20030220 00:00,840900,0.45496371020918913\n20030221 00:00,853400,0.45270314071423234\n20030224 00:00,836300,0.4510240633313309\n20030225 00:00,843200,0.4500641635597651\n20030226 00:00,831900,0.4499298321524148\n20030227 00:00,841700,0.45135999200552124\n20030228 00:00,846200,0.45476102511218536\n20030303 00:00,839300,0.4559044220792057\n20030304 00:00,827300,0.45589989754041405\n20030305 00:00,835000,0.45663748347937283\n20030306 00:00,827000,0.4566926948139149\n20030307 00:00,833700,0.4570720357241611\n20030310 00:00,812300,0.4566865392331958\n20030311 00:00,805500,0.4558188538041952\n20030312 00:00,809700,0.455582391284727\n20030313 00:00,837800,0.45452199901023704\n20030314 00:00,839000,0.4530860570881442\n20030317 00:00,868300,0.4491387377227596\n20030318 00:00,871900,0.44598098598507013\n20030319 00:00,879900,0.4444365255107751\n20030320 00:00,881300,0.44397094911328305\n20030321 00:00,897400,0.44430477299116966\n20030324 00:00,865800,0.4448793683426587\n20030325 00:00,876700,0.44640246850965687\n20030326 00:00,872000,0.44772806887434136\n20030327 00:00,871000,0.44908556303454855\n20030328 00:00,865900,0.4503672889735138\n20030331 00:00,849800,0.45049192312460157\n20030401 00:00,860700,0.45144685195114936\n20030402 00:00,883900,0.45220859418131343\n20030403 00:00,878800,0.4531162242582544\n20030404 00:00,881200,0.45426712462501584\n20030407 00:00,882000,0.45540786041189907\n20030408 00:00,881100,0.4563229913559627\n20030409 00:00,868600,0.4564343708316259\n20030410 00:00,874500,0.4572104123376479\n20030411 00:00,871700,0.4576664874821656\n20030414 00:00,888500,0.45832713005288467\n20030415 00:00,894200,0.45735631414114297\n20030416 00:00,882300,0.4573257811084075\n20030417 00:00,896600,0.4578951994200367\n20030421 00:00,895000,0.4592674089587698\n20030422 00:00,915100,0.45983099487736817\n20030423 00:00,922000,0.4601659559373968\n20030424 00:00,914200,0.46134343150766294\n20030425 00:00,901500,0.46222932005038686\n20030428 00:00,918700,0.4632656144989907\n20030429 00:00,921500,0.46434647675079965\n20030430 00:00,918500,0.4653899115256849\n20030501 00:00,919200,0.4671723817953573\n20030502 00:00,933000,0.46962938680725047\n20030505 00:00,929500,0.4713449024030694\n20030506 00:00,937900,0.4741208466076838\n20030507 00:00,933300,0.476690230795579\n20030508 00:00,923400,0.4782366730564677\n20030509 00:00,937200,0.48006352182460366\n20030512 00:00,949000,0.484057092693444\n20030513 00:00,946400,0.48561408650133164\n20030514 00:00,943600,0.4854714578651075\n20030515 00:00,951300,0.4855997318163737\n20030516 00:00,948600,0.4848870577259545\n20030519 00:00,925100,0.48303325591174523\n20030520 00:00,924500,0.4810216185229555\n20030521 00:00,927800,0.4802230512934892\n20030522 00:00,936800,0.4791662377546194\n20030523 00:00,937200,0.478406613388488\n20030527 00:00,956200,0.47690383749518217\n20030528 00:00,958300,0.4752900153876861\n20030529 00:00,953700,0.4743090879083209\n20030530 00:00,969300,0.4736543798938888\n20030602 00:00,971700,0.473019698344815\n20030603 00:00,977100,0.4723927874256593\n20030604 00:00,991400,0.47125933947373183\n20030605 00:00,995600,0.47049203279802854\n20030606 00:00,992200,0.4703478491738195\n20030609 00:00,981100,0.46999460768523854\n20030610 00:00,990400,0.4699253413832504\n20030611 00:00,1003300,0.47014174052441104\n20030612 00:00,1005200,0.4700105326526098\n20030613 00:00,994400,0.47059533380356366\n20030616 00:00,1016600,0.47149873214553534\n20030617 00:00,1016800,0.470648741068326\n20030618 00:00,1015400,0.47064496749256635\n20030619 00:00,1000200,0.4690310064193704\n20030620 00:00,997500,0.4654197768569914\n20030623 00:00,983600,0.4598869075824044\n20030624 00:00,986500,0.4525756625589673\n20030625 00:00,978000,0.4456756137257201\n20030626 00:00,988900,0.43873658108895053\n20030627 00:00,978600,0.4301420330821925\n20030630 00:00,976900,0.42254538174049844\n20030701 00:00,985600,0.4161059935321177\n20030702 00:00,996300,0.4131411252986047\n20030703 00:00,988000,0.4092419717813057\n20030707 00:00,1007500,0.405581869681141\n20030708 00:00,1010200,0.4034317723210549\n20030709 00:00,1005500,0.4008593811719145\n20030710 00:00,992100,0.399584525966152\n20030711 00:00,1001400,0.4002589835406623\n20030714 00:00,1007200,0.40276217546844084\n20030715 00:00,1003800,0.40776925456226937\n20030716 00:00,997600,0.414090743888227\n20030717 00:00,985100,0.4258131944205883\n20030718 00:00,995800,0.4340778278417491\n20030721 00:00,982400,0.43510555025478675\n20030722 00:00,991200,0.4339220923781075\n20030723 00:00,992300,0.43631491939185063\n20030724 00:00,985000,0.43630396695050033\n20030725 00:00,1002300,0.43943942300760863\n20030728 00:00,1000400,0.4403840528568109\n20030729 00:00,993200,0.441314437614836\n20030730 00:00,991100,0.4443406443447556\n20030731 00:00,994100,0.45168423356957627\n20030801 00:00,983800,0.4536139175021087\n20030804 00:00,987200,0.45201195201680655\n20030805 00:00,968500,0.45561928257399464\n20030806 00:00,971000,0.45855086245307247\n20030807 00:00,978800,0.4600837004114564\n20030808 00:00,982200,0.4604050065947054\n20030811 00:00,985100,0.46154342882143695\n20030812 00:00,995400,0.46259759013456125\n20030813 00:00,988900,0.4699789589653871\n20030814 00:00,995400,0.4705190944278114\n20030815 00:00,995400,0.47042124105898153\n20030818 00:00,1005000,0.4700566311953115\n20030819 00:00,1008200,0.46720170522384397\n20030820 00:00,1005000,0.46618743896178744\n20030821 00:00,1009100,0.46348624490496687\n20030822 00:00,997700,0.46070407534465413\n20030825 00:00,998200,0.4576304637198813\n20030826 00:00,1001800,0.45533140502283403\n20030827 00:00,1002400,0.4524488812128432\n20030828 00:00,1008500,0.45013023610521136\n20030829 00:00,1014000,0.4488219770607041\n20030902 00:00,1027700,0.44456765644631485\n20030903 00:00,1031900,0.4429150169383276\n20030904 00:00,1034300,0.43941471886321315\n20030905 00:00,1026700,0.4384405811623186\n20030908 00:00,1038000,0.4345053268329709\n20030909 00:00,1029300,0.42802100530941795\n20030910 00:00,1016900,0.41982413922335654\n20030911 00:00,1022500,0.4114575788214976\n20030912 00:00,1025200,0.404856816988657\n20030915 00:00,1021200,0.39977063664916185\n20030916 00:00,1035500,0.39747751220431293\n20030917 00:00,1032200,0.3970868307335868\n20030918 00:00,1045900,0.3975734477435324\n20030919 00:00,1038600,0.39724951489295696\n20030922 00:00,1024900,0.396581096205821\n20030923 00:00,1030900,0.3956435139131449\n20030924 00:00,1012000,0.3945438285967613\n20030925 00:00,1005900,0.3929074372863557\n20030926 00:00,1000200,0.39684328059488655\n20030929 00:00,1008700,0.39625382416806404\n20030930 00:00,998600,0.39403960193903736\n20031001 00:00,1020000,0.4003642194453275\n20031002 00:00,1023200,0.4013505752289999\n20031003 00:00,1032600,0.39981450798491636\n20031006 00:00,1037200,0.3938108699281065\n20031007 00:00,1041900,0.3871564032278085\n20031008 00:00,1037100,0.3834685059602341\n20031009 00:00,1041700,0.38838855036984565\n20031010 00:00,1042000,0.39230873263466537\n20031013 00:00,1048600,0.395214054326334\n20031014 00:00,1052900,0.39668850895988134\n20031015 00:00,1050200,0.397125150314807\n20031016 00:00,1053300,0.40004138501384756\n20031017 00:00,1042300,0.40085731873975283\n20031020 00:00,1047800,0.40145864090675915\n20031021 00:00,1049600,0.40248352243360414\n20031022 00:00,1034000,0.40171426955410683\n20031023 00:00,1037400,0.40136337952135803\n20031024 00:00,1032800,0.40067303662085524\n20031027 00:00,1034400,0.4008527138468529\n20031028 00:00,1050200,0.40026551455587017\n20031029 00:00,1052500,0.3996718737606057\n20031030 00:00,1050900,0.39960035019953727\n20031031 00:00,1054200,0.4006348311004959\n20031103 00:00,1063200,0.40047977235922677\n20031104 00:00,1057800,0.4013159583729495\n20031105 00:00,1056300,0.4037716892578071\n20031106 00:00,1062600,0.40979589774239117\n20031107 00:00,1058100,0.41159296304275916\n20031110 00:00,1051800,0.41125326508557447\n20031111 00:00,1050800,0.4113106142257134\n20031112 00:00,1063800,0.4126381284042634\n20031113 00:00,1063500,0.41473848247549716\n20031114 00:00,1055400,0.4149553346112927\n20031117 00:00,1048600,0.41471259975001185\n20031118 00:00,1039100,0.41543669229397906\n20031119 00:00,1047800,0.4201393403752404\n20031120 00:00,1039000,0.42008134582979806\n20031121 00:00,1040400,0.41798403366477377\n20031124 00:00,1057200,0.4156052821478034\n20031125 00:00,1060100,0.4117486742720512\n20031126 00:00,1064000,0.41079814180116553\n20031128 00:00,1065400,0.4074150783650476\n20031201 00:00,1075700,0.4040638032109565\n20031202 00:00,1072700,0.40187384594591685\n20031203 00:00,1071100,0.4004594644770274\n20031204 00:00,1076800,0.3995991333711271\n20031205 00:00,1068100,0.3991499145538435\n20031208 00:00,1075200,0.3988217981599648\n20031209 00:00,1066200,0.39878510915067195\n20031210 00:00,1065400,0.39832253130750245\n20031211 00:00,1078400,0.39895168591300567\n20031212 00:00,1081300,0.39906210959612964\n20031215 00:00,1075200,0.3991343041813177\n20031216 00:00,1081700,0.4023325184513202\n20031217 00:00,1083400,0.4044311370334552\n20031218 00:00,1096000,0.4043064688693114\n20031219 00:00,1090400,0.40435432413309313\n20031222 00:00,1094600,0.4048613106738446\n20031223 00:00,1097900,0.40598594374349894\n20031224 00:00,1095800,0.40680997007597336\n20031226 00:00,1096700,0.4069934893240492\n20031229 00:00,1111500,0.40960973074402685\n20031230 00:00,1111700,0.41416231201614123\n20031231 00:00,1111500,0.4200845945430117\n20040102 00:00,1110000,0.41715406312181114\n20040105 00:00,1123700,0.4137116511090816\n20040106 00:00,1126300,0.4058785094864769\n20040107 00:00,1129000,0.39766218181932395\n20040108 00:00,1133200,0.3928843693433323\n20040109 00:00,1125100,0.38141498577615696\n20040112 00:00,1131100,0.36970129388513934\n20040113 00:00,1124700,0.35701222022277707\n20040114 00:00,1133100,0.34432769413539704\n20040115 00:00,1135300,0.33267201750555525\n20040116 00:00,1142500,0.3231911104947508\n20040120 00:00,1142100,0.3156910012381875\n20040121 00:00,1150600,0.31035379154571585\n20040122 00:00,1147300,0.3069312070101045\n20040123 00:00,1143600,0.30529029721388984\n20040126 00:00,1158000,0.3027985729966101\n20040127 00:00,1147000,0.30183236937471347\n20040128 00:00,1132300,0.29614679197963106\n20040129 00:00,1137500,0.29148308071295637\n20040130 00:00,1134400,0.28949243618686193\n20040202 00:00,1138300,0.2878291566107029\n20040203 00:00,1139500,0.28722725128144333\n20040204 00:00,1130300,0.2867954977868908\n20040205 00:00,1132600,0.2866462030843548\n20040206 00:00,1146600,0.2855043247262497\n20040209 00:00,1143400,0.2847293537670333\n20040210 00:00,1149000,0.2831872131435027\n20040211 00:00,1161900,0.2795458855439995\n20040212 00:00,1156700,0.2802178001552094\n20040213 00:00,1151200,0.2833526632650929\n20040217 00:00,1161400,0.2808265935803238\n20040218 00:00,1156600,0.27805238726679593\n20040219 00:00,1152200,0.2759419492120124\n20040220 00:00,1150000,0.2744358475111804\n20040223 00:00,1145500,0.2740118571492461\n20040224 00:00,1144500,0.2728265457464601\n20040225 00:00,1149100,0.2724325273864639\n20040226 00:00,1150400,0.2715939503734513\n20040227 00:00,1150800,0.2725538948531793\n20040301 00:00,1160700,0.2752904507735151\n20040302 00:00,1154900,0.2767403086452971\n20040303 00:00,1157000,0.27621980019775105\n20040304 00:00,1160500,0.27807866118739377\n20040305 00:00,1162900,0.27906940240278977\n20040308 00:00,1152700,0.2830225345525563\n20040309 00:00,1146600,0.282788802565141\n20040310 00:00,1129800,0.2869577926187593\n20040311 00:00,1113500,0.2938958895664111\n20040312 00:00,1126900,0.30168649564802513\n20040315 00:00,1110300,0.3128379586029141\n20040316 00:00,1117300,0.3180870218484271\n20040317 00:00,1130000,0.32111757997455587\n20040318 00:00,1129100,0.32480896603296283\n20040319 00:00,1112900,0.3318426197516974\n20040322 00:00,1097400,0.34087274192682265\n20040323 00:00,1096500,0.34838133984222064\n20040324 00:00,1094100,0.3590299806829111\n20040325 00:00,1111100,0.36632205108119026\n20040326 00:00,1111700,0.37335910818857554\n20040329 00:00,1124900,0.3744010725165093\n20040330 00:00,1129700,0.3761360163519722\n20040331 00:00,1128800,0.3765381219179557\n20040401 00:00,1134900,0.3768806117903196\n20040402 00:00,1144400,0.3746652659192817\n20040405 00:00,1153300,0.3718036958737588\n20040406 00:00,1150800,0.371054120798304\n20040407 00:00,1144900,0.36984575382158047\n20040408 00:00,1142300,0.36726223710351075\n20040412 00:00,1148800,0.36648107175114314\n20040413 00:00,1133100,0.36370785759665847\n20040414 00:00,1131900,0.3605102236622644\n20040415 00:00,1131700,0.35842417611931826\n20040416 00:00,1137200,0.3581387419146296\n20040419 00:00,1138900,0.3583881965971341\n20040420 00:00,1121400,0.3573778230681812\n20040421 00:00,1128100,0.35693678914286514\n20040422 00:00,1144400,0.3573609702086613\n20040423 00:00,1144400,0.35601223958516437\n20040426 00:00,1139100,0.3570274078019959\n20040427 00:00,1142200,0.3569122754134164\n20040428 00:00,1125800,0.35675778798208835\n20040429 00:00,1118400,0.3561037552355608\n20040430 00:00,1111300,0.35615367031445005\n20040503 00:00,1121400,0.35755151748479846\n20040504 00:00,1123600,0.35851568811887\n20040505 00:00,1125800,0.3597410609147631\n20040506 00:00,1118500,0.3603758627847321\n20040507 00:00,1103000,0.3609538498364763\n20040510 00:00,1091300,0.3596203273470227\n20040511 00:00,1100100,0.36180764267018106\n20040512 00:00,1103000,0.3636515796481189\n20040513 00:00,1101500,0.3655858659101678\n20040514 00:00,1100200,0.3717374419249682\n20040517 00:00,1088500,0.37632445053483565\n20040518 00:00,1097000,0.3726602760118826\n20040519 00:00,1094100,0.3696743090043419\n20040520 00:00,1095200,0.36796241760372056\n20040521 00:00,1099300,0.367038174789377\n20040524 00:00,1100900,0.36651634081337425\n20040525 00:00,1119200,0.3623615466755667\n20040526 00:00,1120900,0.359114391661461\n20040527 00:00,1127200,0.35802415416225664\n20040528 00:00,1127100,0.35769410471267343\n20040601 00:00,1126800,0.3593251938791091\n20040602 00:00,1131200,0.36094638181790595\n20040603 00:00,1122500,0.3610664976821575\n20040604 00:00,1129000,0.3622471278018869\n20040607 00:00,1146500,0.3632903546154395\n20040608 00:00,1148500,0.3678243812117517\n20040609 00:00,1137700,0.37057894534828656\n20040610 00:00,1143000,0.37267528930341876\n20040614 00:00,1131900,0.3729817795672346\n20040615 00:00,1139500,0.37667587646149786\n20040616 00:00,1139900,0.3792455752572123\n20040617 00:00,1138600,0.38340569833319293\n20040618 00:00,1137100,0.388301166129321\n20040621 00:00,1133100,0.390423999997583\n20040622 00:00,1137900,0.3922412263085118\n20040623 00:00,1147000,0.39223616919768417\n20040624 00:00,1144400,0.39234970958944926\n20040625 00:00,1141300,0.39245542761982505\n20040628 00:00,1136800,0.3926785576103564\n20040629 00:00,1139900,0.39382445089600987\n20040630 00:00,1144500,0.39643070585746654\n20040701 00:00,1132000,0.3975301473392928\n20040702 00:00,1128000,0.39679511424710795\n20040706 00:00,1119600,0.3976363680952978\n20040707 00:00,1121400,0.39707093594717624\n20040708 00:00,1112200,0.3969519823503672\n20040709 00:00,1116400,0.3963588443445593\n20040712 00:00,1117800,0.3977672654757753\n20040713 00:00,1118900,0.3980347620445661\n20040714 00:00,1114900,0.39976076928304455\n20040715 00:00,1110400,0.40246720711552036\n20040716 00:00,1105300,0.40459014310275504\n20040719 00:00,1104500,0.40753641502387183\n20040720 00:00,1112500,0.40946289787992995\n20040721 00:00,1097900,0.414042239439367\n20040722 00:00,1100100,0.4175203404882553\n20040723 00:00,1089200,0.42131718069381185\n20040726 00:00,1088500,0.42548838578060344\n20040727 00:00,1098800,0.4291533386735999\n20040728 00:00,1100300,0.4323760738313159\n20040729 00:00,1105500,0.43405337168863956\n20040730 00:00,1106700,0.43561768944000506\n20040802 00:00,1111000,0.43770551683607495\n20040803 00:00,1103800,0.4392679976740763\n20040804 00:00,1102800,0.44042170353714644\n20040805 00:00,1085200,0.4379212337202226\n20040806 00:00,1068300,0.4312170723393829\n20040809 00:00,1070100,0.42813959728190204\n20040810 00:00,1083600,0.4268376288326769\n20040811 00:00,1080900,0.425632243951692\n20040812 00:00,1068500,0.42562181440518915\n20040813 00:00,1070700,0.4260044582186465\n20040816 00:00,1085300,0.4251274957568939\n20040817 00:00,1087100,0.4238425160313541\n20040818 00:00,1100800,0.41999424602255586\n20040819 00:00,1096100,0.41873287246020363\n20040820 00:00,1104400,0.416643568495363\n20040823 00:00,1102200,0.4160517372406891\n20040824 00:00,1101900,0.41511416023487935\n20040825 00:00,1111200,0.4146344690800703\n20040826 00:00,1111600,0.4153666229707771\n20040827 00:00,1114600,0.4179185586022578\n20040830 00:00,1105800,0.42082217772068453\n20040831 00:00,1110700,0.42355617554970454\n20040901 00:00,1113100,0.4243166837766497\n20040902 00:00,1125500,0.42526165177039993\n20040903 00:00,1120900,0.42651987723534657\n20040907 00:00,1128100,0.42827322354377834\n20040908 00:00,1123500,0.43099852919241155\n20040909 00:00,1125000,0.4324567462612014\n20040910 00:00,1130900,0.43499888177248647\n20040913 00:00,1132900,0.4368547999818814\n20040914 00:00,1136100,0.4386297111130636\n20040915 00:00,1127400,0.44039542227022144\n20040916 00:00,1131000,0.4418123695237224\n20040917 00:00,1131100,0.44331986598765927\n20040920 00:00,1125200,0.4485392518949246\n20040921 00:00,1132400,0.4533602386994369\n20040922 00:00,1116300,0.4541389491099306\n20040923 00:00,1111400,0.45648059426013154\n20040924 00:00,1113500,0.4548359843036387\n20040927 00:00,1106700,0.4526155980082966\n20040928 00:00,1113500,0.452411906973412\n20040929 00:00,1117400,0.4529093688403138\n20040930 00:00,1117400,0.45759099193643865\n20041001 00:00,1134900,0.4558948373926424\n20041004 00:00,1138500,0.45364283134527705\n20041005 00:00,1138300,0.452133062188053\n20041006 00:00,1145600,0.45027952462140935\n20041007 00:00,1133800,0.44980609048194464\n20041008 00:00,1125800,0.44831831484705\n20041011 00:00,1128700,0.4478036012850383\n20041012 00:00,1125300,0.44753964283837094\n20041013 00:00,1116700,0.4460931320177815\n20041014 00:00,1107000,0.443592663631756\n20041015 00:00,1111700,0.4431615737356601\n20041018 00:00,1118000,0.4436089191826884\n20041019 00:00,1107200,0.44368583095713776\n20041020 00:00,1107100,0.44469299796657735\n20041021 00:00,1110400,0.4462893649564573\n20041022 00:00,1099500,0.4471056038790801\n20041025 00:00,1098700,0.44848284220452034\n20041026 00:00,1114000,0.45071020099306003\n20041027 00:00,1129700,0.44775949182271735\n20041028 00:00,1131700,0.4438001397832831\n20041029 00:00,1133800,0.44130098779102994\n20041101 00:00,1134900,0.4402946031959754\n20041102 00:00,1135000,0.4395233548029319\n20041103 00:00,1147700,0.4383803366914821\n20041104 00:00,1165500,0.4345003384920841\n20041105 00:00,1171000,0.43243215748953073\n20041108 00:00,1170000,0.43454588166361\n20041109 00:00,1170000,0.4379970888461961\n20041110 00:00,1169400,0.44242364052414357\n20041111 00:00,1179900,0.4483334792586989\n20041112 00:00,1189100,0.45590195628663865\n20041115 00:00,1186700,0.46486714549383895\n20041116 00:00,1177600,0.47083463296205885\n20041117 00:00,1184000,0.4761602964426654\n20041118 00:00,1186600,0.480732404376183\n20041119 00:00,1173200,0.4825476074492387\n20041122 00:00,1179500,0.48611569237605856\n20041123 00:00,1179700,0.48928025498288685\n20041124 00:00,1185400,0.4907368156651465\n20041126 00:00,1184000,0.4918955103842551\n20041129 00:00,1181300,0.492652005862597\n20041130 00:00,1177700,0.49232771009466647\n20041201 00:00,1194700,0.49231059357529994\n20041202 00:00,1193800,0.4911849826266715\n20041203 00:00,1194300,0.4900790222645795\n20041206 00:00,1193400,0.4895589492032785\n20041207 00:00,1180700,0.4866615499420487\n20041208 00:00,1186200,0.48497767508919815\n20041209 00:00,1193000,0.4825464565287959\n20041210 00:00,1191700,0.4802702518519654\n20041213 00:00,1202900,0.47752039540782465\n20041214 00:00,1208000,0.4744923584475706\n20041215 00:00,1209700,0.47219253133256633\n20041216 00:00,1207000,0.4707049868531139\n20041217 00:00,1194200,0.4674021429772401\n20041220 00:00,1192700,0.46440961248177615\n20041221 00:00,1204000,0.4623709390441705\n20041222 00:00,1209100,0.4599798092946844\n20041223 00:00,1209900,0.4583434915753169\n20041227 00:00,1204200,0.4571988739236617\n20041228 00:00,1212500,0.45642330174933543\n20041229 00:00,1212700,0.4556812868288672\n20041230 00:00,1212300,0.4552993139488374\n20041231 00:00,1210400,0.455552336354296\n20050103 00:00,1200600,0.4553389733408691\n20050104 00:00,1187400,0.45144787517957824\n20050105 00:00,1183200,0.4479563095725735\n20050106 00:00,1187100,0.44682266824287786\n20050107 00:00,1185600,0.44653629181230853\n20050110 00:00,1189400,0.4469344167611488\n20050111 00:00,1182900,0.44784240924294394\n20050112 00:00,1188000,0.44969095354812444\n20050113 00:00,1176800,0.45132115593200706\n20050114 00:00,1184200,0.452788524482838\n20050118 00:00,1195700,0.4519898964780577\n20050119 00:00,1184000,0.4531605740873205\n20050120 00:00,1175700,0.45409975747333237\n20050121 00:00,1168000,0.455000403111448\n20050124 00:00,1164200,0.45594191612626245\n20050125 00:00,1168700,0.46088412262213657\n20050126 00:00,1174100,0.4625854328493216\n20050127 00:00,1174600,0.4630951312646129\n20050128 00:00,1171300,0.4640124998737122\n20050131 00:00,1180700,0.46383794570809506\n20050201 00:00,1189100,0.46226433360046415\n20050202 00:00,1193400,0.4606101283668211\n20050203 00:00,1190500,0.4613258794617885\n20050204 00:00,1203300,0.46109012631748575\n20050207 00:00,1202300,0.460624560341717\n20050208 00:00,1203400,0.4618043210228978\n20050209 00:00,1193000,0.4617194636271456\n20050210 00:00,1198300,0.461788314945406\n20050211 00:00,1207200,0.46166855135462065\n20050214 00:00,1207800,0.46149671031400286\n20050215 00:00,1212000,0.46157095406041376\n20050216 00:00,1211900,0.4619201228053138\n20050217 00:00,1202900,0.4614920403824699\n20050218 00:00,1203500,0.4607568304491817\n20050222 00:00,1186700,0.4566685775725914\n20050223 00:00,1193300,0.45427943168880247\n20050224 00:00,1202600,0.45113848522675404\n20050225 00:00,1213800,0.44672993793688337\n20050228 00:00,1205400,0.443307343731068\n20050301 00:00,1213000,0.4384483204788672\n20050302 00:00,1212900,0.4351046586994116\n20050303 00:00,1213600,0.4326731516243029\n20050304 00:00,1225600,0.4313656578967382\n20050307 00:00,1227800,0.43351693702135097\n20050308 00:00,1222000,0.4379568727640033\n20050309 00:00,1210100,0.4417888008042727\n20050310 00:00,1212000,0.4416692000695828\n20050311 00:00,1204100,0.43979081811008003\n20050314 00:00,1210400,0.44029437656054304\n20050315 00:00,1201700,0.44016102380712663\n20050316 00:00,1191800,0.438703867361872\n20050317 00:00,1194100,0.4425610477144033\n20050318 00:00,1188100,0.4484308834637406\n20050321 00:00,1182600,0.44870953376369804\n20050322 00:00,1171300,0.4471547267468265\n20050323 00:00,1170600,0.4490071427214891\n20050324 00:00,1171400,0.4545588246609957\n20050328 00:00,1173600,0.45923836694008013\n20050329 00:00,1164200,0.46597790594340766\n20050330 00:00,1181200,0.46909988245620354\n20050331 00:00,1179500,0.4720065999441082\n20050401 00:00,1172200,0.47737305307018885\n20050404 00:00,1175900,0.4812379083662893\n20050405 00:00,1180900,0.4820465217662786\n20050406 00:00,1184000,0.4820894800715852\n20050407 00:00,1191500,0.480907369397233\n20050408 00:00,1181000,0.48132061026896705\n20050411 00:00,1181800,0.48114171455788646\n20050412 00:00,1187600,0.4809752897614574\n20050413 00:00,1174200,0.47975301210492827\n20050414 00:00,1162700,0.4758363075180687\n20050415 00:00,1142800,0.467177668394993\n20050418 00:00,1146100,0.462380400208868\n20050419 00:00,1152900,0.4590416896493274\n20050420 00:00,1138200,0.4605084269249155\n20050421 00:00,1159900,0.4595793179253266\n20050422 00:00,1152800,0.4569001079994781\n20050425 00:00,1162700,0.45403531695268096\n20050426 00:00,1152200,0.4542364079592892\n20050427 00:00,1156800,0.4560849311564753\n20050428 00:00,1144000,0.4573749071103859\n20050429 00:00,1157000,0.45822222458009304\n20050502 00:00,1163300,0.45836549939800164\n20050503 00:00,1162500,0.45929304060010867\n20050504 00:00,1176200,0.45944113431081157\n20050505 00:00,1173600,0.4635846414572896\n20050506 00:00,1172000,0.46733485097969224\n20050509 00:00,1180100,0.46650137305464445\n20050510 00:00,1166900,0.46483880435259295\n20050511 00:00,1172000,0.46361780639989975\n20050512 00:00,1160900,0.4616525331437089\n20050513 00:00,1156000,0.45867023244010896\n20050516 00:00,1167900,0.4569876827491389\n20050517 00:00,1175900,0.45326219690859954\n20050518 00:00,1187900,0.4493244222513816\n20050519 00:00,1193800,0.44583595176439816\n20050520 00:00,1191500,0.4454148314368768\n20050523 00:00,1196500,0.44694327733162953\n20050524 00:00,1196500,0.4494817416267366\n20050525 00:00,1193200,0.45042133080451885\n20050526 00:00,1200500,0.4519800057832658\n20050527 00:00,1201800,0.4533332349515584\n20050531 00:00,1194500,0.4543437330376399\n20050601 00:00,1205400,0.45644634619368624\n20050602 00:00,1207100,0.4582425233467063\n20050603 00:00,1199400,0.46229052618941013\n20050606 00:00,1201400,0.4647786744339199\n20050607 00:00,1200700,0.46582704120130985\n20050608 00:00,1198500,0.4664572383653884\n20050609 00:00,1204900,0.4672102798887821\n20050610 00:00,1202100,0.46725767467425067\n20050613 00:00,1204900,0.4678529509423129\n20050614 00:00,1208200,0.4672436305488693\n20050615 00:00,1210600,0.4662396047387364\n20050616 00:00,1214800,0.46489510562119185\n20050617 00:00,1216000,0.4635269932670099\n20050620 00:00,1215000,0.46332576036694806\n20050621 00:00,1213000,0.46161362835038366\n20050622 00:00,1213700,0.4589634909243272\n20050623 00:00,1200000,0.4545480617861692\n20050624 00:00,1190900,0.4478109963775549\n20050627 00:00,1190400,0.44320463038326907\n20050628 00:00,1201800,0.4402143934202614\n20050629 00:00,1199400,0.4388029117561883\n20050630 00:00,1190600,0.4373465955177008\n20050701 00:00,1195000,0.4363523267352585\n20050705 00:00,1204800,0.43478579713203164\n20050706 00:00,1194900,0.4343403379880317\n20050707 00:00,1197700,0.4340468394440987\n20050708 00:00,1212200,0.43113118031755765\n20050711 00:00,1220200,0.4260222099902483\n20050712 00:00,1222200,0.42232336762701717\n20050713 00:00,1223400,0.41968005386746443\n20050714 00:00,1227400,0.41710887281750675\n20050715 00:00,1227700,0.4153006694818845\n20050718 00:00,1222000,0.4138712018537642\n20050719 00:00,1230000,0.41374700127382996\n20050720 00:00,1235400,0.4137114569738565\n20050721 00:00,1227000,0.4137131273430337\n20050722 00:00,1234300,0.4156533078097317\n20050725 00:00,1229300,0.4177041782063538\n20050726 00:00,1232300,0.4186853462915242\n20050727 00:00,1237900,0.420096048002073\n20050728 00:00,1245000,0.42197563638351765\n20050729 00:00,1235600,0.4250021891799985\n20050801 00:00,1235500,0.43042095195277397\n20050802 00:00,1244600,0.4372634781110062\n20050803 00:00,1246400,0.4461323512689004\n20050804 00:00,1236600,0.44683196481223375\n20050805 00:00,1227700,0.44310305706385794\n20050808 00:00,1224200,0.4388058513674934\n20050809 00:00,1233400,0.43849094914075\n20050810 00:00,1231200,0.43716263068549144\n20050811 00:00,1239700,0.436125388789246\n20050812 00:00,1232400,0.4362375390439456\n20050815 00:00,1236500,0.43552318657043126\n20050816 00:00,1221300,0.4339357813658251\n20050817 00:00,1222900,0.43255559240222996\n20050818 00:00,1221100,0.4316943916605907\n20050819 00:00,1222700,0.4317129156180393\n20050822 00:00,1224700,0.43200114259255085\n20050823 00:00,1220500,0.43289538763660557\n20050824 00:00,1212400,0.43368571136646544\n20050825 00:00,1215300,0.43499468214615955\n20050826 00:00,1208200,0.43636728283765464\n20050829 00:00,1216000,0.4388673472161096\n20050830 00:00,1211800,0.44173503695951977\n20050831 00:00,1223900,0.44241401325609564\n20050901 00:00,1225400,0.4412654168900633\n20050902 00:00,1221300,0.44146857935876416\n20050906 00:00,1237500,0.439176191370546\n20050907 00:00,1240200,0.4368342053222892\n20050908 00:00,1235800,0.43629042640543547\n20050909 00:00,1244800,0.4353347961625032\n20050912 00:00,1244300,0.4350948552201046\n20050913 00:00,1235500,0.43519422160495563\n20050914 00:00,1231800,0.43436708728726825\n20050915 00:00,1232200,0.43438992631617085\n20050916 00:00,1237000,0.43539773546167015\n20050919 00:00,1229600,0.435903607801968\n20050920 00:00,1221000,0.43655367161830033\n20050921 00:00,1208900,0.4321062402995166\n20050922 00:00,1214400,0.4308434569553007\n20050923 00:00,1215600,0.430538257260164\n20050926 00:00,1214700,0.4328453281423362\n20050927 00:00,1215000,0.4351046912344528\n20050928 00:00,1216800,0.43803789849063995\n20050929 00:00,1228100,0.4399358255685874\n20050930 00:00,1228200,0.43820758427733725\n20051003 00:00,1226800,0.437616043531429\n20051004 00:00,1213800,0.4381951392235041\n20051005 00:00,1196300,0.4380217115137215\n20051006 00:00,1191500,0.43677575459872253\n20051007 00:00,1196700,0.4377850662426435\n20051010 00:00,1187700,0.4406315837647452\n20051011 00:00,1185400,0.44325489916897315\n20051012 00:00,1178500,0.4434631345738071\n20051013 00:00,1177700,0.4421457829635606\n20051014 00:00,1187500,0.43981114704184116\n20051017 00:00,1190700,0.4375129557114372\n20051018 00:00,1179000,0.4333972765369236\n20051019 00:00,1196400,0.4263519468046276\n20051020 00:00,1177200,0.4224655169160579\n20051021 00:00,1180200,0.41734284469006866\n20051024 00:00,1200400,0.4113633080608916\n20051025 00:00,1197400,0.40533815848822907\n20051026 00:00,1192400,0.40185140626940535\n20051027 00:00,1179700,0.3991186216563552\n20051028 00:00,1199000,0.3975631608867801\n20051031 00:00,1207100,0.395508941570265\n20051101 00:00,1203000,0.39847175906868815\n20051102 00:00,1216300,0.3987946330766084\n20051103 00:00,1221500,0.3973207700356042\n20051104 00:00,1221100,0.3977838176257425\n20051107 00:00,1224400,0.3997954536650815\n20051108 00:00,1220700,0.40278920742792795\n20051109 00:00,1222500,0.40689692074577827\n20051110 00:00,1233500,0.4103207948402126\n20051111 00:00,1236500,0.41429101200701396\n20051114 00:00,1236700,0.41824770183368243\n20051115 00:00,1231600,0.4211289995985986\n20051116 00:00,1234700,0.42462533618602544\n20051117 00:00,1245300,0.4288962792887269\n20051118 00:00,1250900,0.43185519529970096\n20051121 00:00,1257800,0.4347550026135496\n20051122 00:00,1263700,0.4381682404117505\n20051123 00:00,1268800,0.4425552846298828\n20051125 00:00,1270500,0.4473674727364385\n20051128 00:00,1261500,0.4506507763871514\n20051129 00:00,1261200,0.4533839256837405\n20051130 00:00,1253300,0.4538775576875906\n20051201 00:00,1269100,0.4568568909706893\n20051202 00:00,1268700,0.4593552056781118\n20051205 00:00,1266400,0.4612599407500504\n20051206 00:00,1267300,0.4640924640453716\n20051207 00:00,1261500,0.4658664846509469\n20051208 00:00,1260300,0.46695190010407406\n20051209 00:00,1264100,0.46905218696149403\n20051212 00:00,1265000,0.4693466981052231\n20051213 00:00,1271700,0.46944146403688297\n20051214 00:00,1277600,0.46941395966453514\n20051215 00:00,1275300,0.46911885387207747\n20051216 00:00,1266000,0.469404192596969\n20051219 00:00,1257800,0.4690257548717988\n20051220 00:00,1257700,0.46685814459927943\n20051221 00:00,1261200,0.4647472611344348\n20051222 00:00,1266600,0.46216853185580575\n20051223 00:00,1267500,0.46043977976183464\n20051227 00:00,1255100,0.45789875967681404\n20051228 00:00,1256100,0.4561021419484696\n20051229 00:00,1253100,0.4559626976153216\n20051230 00:00,1245500,0.4572567478514695\n20060103 00:00,1267500,0.4565889428374885\n20060104 00:00,1272700,0.45245232642202854\n20060105 00:00,1272300,0.45041300984830906\n20060106 00:00,1284100,0.4472240602041209\n20060109 00:00,1289200,0.4441340407714647\n20060110 00:00,1288800,0.44310137697204377\n20060111 00:00,1293500,0.442695336001116\n20060112 00:00,1285900,0.44332920995665176\n20060113 00:00,1287200,0.4445438161361339\n20060117 00:00,1282500,0.44531607903407344\n20060118 00:00,1277900,0.4497588697301147\n20060119 00:00,1283700,0.45220849985240935\n20060120 00:00,1261200,0.4479178758036385\n20060123 00:00,1263300,0.4428999961458585\n20060124 00:00,1266200,0.4404021959244617\n20060125 00:00,1264700,0.43897377991819925\n20060126 00:00,1274100,0.4384026772926684\n20060127 00:00,1283100,0.43693436963979027\n20060130 00:00,1285300,0.4373833956055901\n20060131 00:00,1279500,0.4380408752657149\n20060201 00:00,1282300,0.4380138640762705\n20060202 00:00,1271100,0.4380830988708539\n20060203 00:00,1264100,0.4372332887716388\n20060206 00:00,1265600,0.43717280128230246\n20060207 00:00,1255700,0.4370491988436849\n20060208 00:00,1266300,0.43754861691189156\n20060209 00:00,1265000,0.43872260767202886\n20060210 00:00,1268200,0.4392601863712973\n20060213 00:00,1264600,0.43995292707080835\n20060214 00:00,1277100,0.43960397805788753\n20060215 00:00,1281400,0.43911709375308655\n20060216 00:00,1290800,0.43814991830889466\n20060217 00:00,1288800,0.438087087725272\n20060221 00:00,1285200,0.4378261452462551\n20060222 00:00,1294300,0.44041590682768006\n20060223 00:00,1290100,0.44259325974372615\n20060224 00:00,1292300,0.44221405459011376\n20060227 00:00,1296900,0.44001762968987923\n20060228 00:00,1282600,0.43824227105008545\n20060301 00:00,1293900,0.43603466887432474\n20060302 00:00,1292200,0.433825979986289\n20060303 00:00,1289900,0.43108409587040664\n20060306 00:00,1281500,0.4250248047505116\n20060307 00:00,1278600,0.41980084742417667\n20060308 00:00,1281700,0.4159417846186203\n20060309 00:00,1275700,0.41304830774960155\n20060310 00:00,1285200,0.4112787630172109\n20060313 00:00,1288200,0.4099730601611268\n20060314 00:00,1301200,0.4090746297005319\n20060315 00:00,1307700,0.40647769618554824\n20060316 00:00,1310100,0.4046793992254779\n20060317 00:00,1305800,0.4049927211058005\n20060320 00:00,1303900,0.40507034850753415\n20060321 00:00,1295900,0.40335677177952983\n20060322 00:00,1304200,0.4019207124914866\n20060323 00:00,1300800,0.40047045712715046\n20060324 00:00,1301500,0.39916294693157295\n20060327 00:00,1300800,0.3974990410897397\n20060328 00:00,1292200,0.3968612734512187\n20060329 00:00,1302100,0.3943404732792585\n20060330 00:00,1299500,0.39123810262394737\n20060331 00:00,1294900,0.3898143703022636\n20060403 00:00,1296900,0.38823501406698196\n20060404 00:00,1305300,0.38594725924851625\n20060405 00:00,1310500,0.38318332442088965\n20060406 00:00,1308200,0.3824554078228963\n20060407 00:00,1294700,0.3826188512803749\n20060410 00:00,1296000,0.38523874010746256\n20060411 00:00,1286500,0.39346830685472095\n20060412 00:00,1288400,0.4005832291015771\n20060413 00:00,1288600,0.4032784698641305\n20060417 00:00,1285200,0.40393161897615715\n20060418 00:00,1307300,0.40190667634305005\n20060419 00:00,1309900,0.3982122683956985\n20060420 00:00,1311500,0.3965952925610673\n20060421 00:00,1311000,0.39563863558963513\n20060424 00:00,1308300,0.39450659203406235\n20060425 00:00,1302300,0.39441832953677375\n20060426 00:00,1305800,0.3934214578541215\n20060427 00:00,1311600,0.3923226317512526\n20060428 00:00,1311400,0.39266750705871495\n20060501 00:00,1305600,0.3918010813813301\n20060502 00:00,1313800,0.3916064126265968\n20060503 00:00,1308200,0.39086444351842137\n20060504 00:00,1312900,0.39123095781755834\n20060505 00:00,1327100,0.3903173130664278\n20060508 00:00,1325600,0.3898700789247364\n20060509 00:00,1325300,0.39223425508886944\n20060510 00:00,1324300,0.39212689361901976\n20060511 00:00,1307800,0.3900179924714444\n20060512 00:00,1292500,0.381462117268908\n20060515 00:00,1296200,0.380281794913448\n20060516 00:00,1293600,0.3803824349029417\n20060517 00:00,1272000,0.3772752397042636\n20060518 00:00,1263600,0.37294900591918717\n20060519 00:00,1269600,0.37401296714061505\n20060522 00:00,1269800,0.37703343607329093\n20060523 00:00,1259000,0.3825506699954249\n20060524 00:00,1260800,0.3891270445020412\n20060525 00:00,1276300,0.39257636561846776\n20060526 00:00,1283000,0.39293777996570434\n20060530 00:00,1262800,0.39959589005150503\n20060531 00:00,1273000,0.4044520787196297\n20060601 00:00,1288200,0.40370315616318814\n20060602 00:00,1291300,0.40241486735260995\n20060605 00:00,1269000,0.405689143851858\n20060606 00:00,1267500,0.406812885069779\n20060607 00:00,1259100,0.40773667791309753\n20060608 00:00,1261400,0.4091532937343392\n20060609 00:00,1255300,0.4095953485521299\n20060612 00:00,1240000,0.40866027235119684\n20060613 00:00,1227300,0.4059671462291558\n20060614 00:00,1234900,0.40662781193510134\n20060615 00:00,1259700,0.4031256030163047\n20060616 00:00,1250000,0.40282631397661633\n20060619 00:00,1238200,0.4046017747507139\n20060620 00:00,1238800,0.40747876525784854\n20060621 00:00,1251300,0.4099215617978349\n20060622 00:00,1244500,0.4147149713508283\n20060623 00:00,1243900,0.4159012266446626\n20060626 00:00,1250400,0.4152590791297335\n20060627 00:00,1238700,0.41514477378834447\n20060628 00:00,1245800,0.41584253861591225\n20060629 00:00,1272300,0.40931269833367645\n20060630 00:00,1270100,0.40390845695746486\n20060703 00:00,1279000,0.3992553758857906\n20060705 00:00,1270300,0.39793681987777774\n20060706 00:00,1273700,0.3983666012966395\n20060707 00:00,1265300,0.39937105973814463\n20060710 00:00,1267400,0.3997646393330449\n20060711 00:00,1272700,0.40094966003581833\n20060712 00:00,1259600,0.4006342797462624\n20060713 00:00,1242100,0.39500724309248403\n20060714 00:00,1236300,0.3893614873831618\n20060717 00:00,1234300,0.3858964914942214\n20060718 00:00,1236800,0.3850983625465647\n20060719 00:00,1259700,0.38250108012256895\n20060720 00:00,1249600,0.3816884260528389\n20060721 00:00,1241100,0.38167261517407314\n20060724 00:00,1261300,0.3804574852481237\n20060725 00:00,1269700,0.3773763900534629\n20060726 00:00,1269000,0.3758050637727316\n20060727 00:00,1263700,0.3747425415421464\n20060728 00:00,1278500,0.37246234505593706\n20060731 00:00,1276700,0.3713889417315336\n20060801 00:00,1271600,0.3710661046922044\n20060802 00:00,1279100,0.37098507491412347\n20060803 00:00,1281200,0.3719878691025221\n20060804 00:00,1280000,0.37289428437758043\n20060807 00:00,1277600,0.37412472317417067\n20060808 00:00,1273300,0.3753859925101803\n20060809 00:00,1267800,0.3751555880835786\n20060810 00:00,1272800,0.3761293454809552\n20060811 00:00,1268400,0.3772639513123224\n20060814 00:00,1270500,0.37840273434850275\n20060815 00:00,1287100,0.3796072340929676\n20060816 00:00,1297500,0.3771943927427556\n20060817 00:00,1300300,0.376079758526013\n20060818 00:00,1304600,0.3757075816089884\n20060821 00:00,1301100,0.37615467881074394\n20060822 00:00,1301300,0.3774963548870732\n20060823 00:00,1295700,0.377822453359472\n20060824 00:00,1298700,0.3781436160437866\n20060825 00:00,1298400,0.3786120057822566\n20060828 00:00,1304800,0.3803097434834517\n20060829 00:00,1307500,0.3819955563098818\n20060830 00:00,1307400,0.38489751698546715\n20060831 00:00,1307100,0.38658098025381266\n20060901 00:00,1314800,0.3889039395647992\n20060905 00:00,1317200,0.3922928915214898\n20060906 00:00,1304300,0.39190974576105625\n20060907 00:00,1298200,0.38926933450416484\n20060908 00:00,1303000,0.3878493587413004\n20060911 00:00,1303800,0.3858501631585707\n20060912 00:00,1316400,0.3831719507061881\n20060913 00:00,1322500,0.37924811514626405\n20060914 00:00,1320500,0.37601178732548146\n20060915 00:00,1318200,0.3727319539714927\n20060918 00:00,1320200,0.37019157259486385\n20060919 00:00,1317500,0.3677292187495568\n20060920 00:00,1324100,0.36470077200823536\n20060921 00:00,1317000,0.3631955763611852\n20060922 00:00,1313900,0.3600665955490542\n20060925 00:00,1325400,0.35722974593734963\n20060926 00:00,1335400,0.3538860586890574\n20060927 00:00,1336400,0.3516882698609928\n20060928 00:00,1337800,0.3500312952473235\n20060929 00:00,1334800,0.3484094171310767\n20061002 00:00,1330700,0.349139729412264\n20061003 00:00,1334400,0.35349875867728464\n20061004 00:00,1349500,0.356236827998582\n20061005 00:00,1353000,0.35679909597570136\n20061006 00:00,1350300,0.3578323265672618\n20061009 00:00,1350900,0.3600873213345758\n20061010 00:00,1353300,0.36104601295941063\n20061011 00:00,1349900,0.3612144389377232\n20061012 00:00,1362700,0.361506145693202\n20061013 00:00,1365500,0.3612890827451303\n20061016 00:00,1368900,0.3621514959579735\n20061017 00:00,1364500,0.36299666756810023\n20061018 00:00,1365800,0.36183495259722376\n20061019 00:00,1367500,0.3633724070603223\n20061020 00:00,1368600,0.3627203238798556\n20061023 00:00,1376800,0.3610718285033033\n20061024 00:00,1377600,0.3615939394501544\n20061025 00:00,1382000,0.36140124725322953\n20061026 00:00,1388600,0.3592979365960313\n20061027 00:00,1379100,0.3569928098376569\n20061030 00:00,1378700,0.35371760068549785\n20061031 00:00,1377900,0.350822419768947\n20061101 00:00,1368900,0.34654834779202387\n20061102 00:00,1368100,0.34248097137931816\n20061103 00:00,1366000,0.3390439281044756\n20061106 00:00,1380800,0.3362714806865111\n20061107 00:00,1384300,0.3332068072871481\n20061108 00:00,1387400,0.33068048122688326\n20061109 00:00,1380900,0.32896860329227146\n20061110 00:00,1382700,0.3278697924841526\n20061113 00:00,1386800,0.32742031860752047\n20061114 00:00,1395500,0.32684571124142037\n20061115 00:00,1399700,0.327169717992105\n20061116 00:00,1402300,0.32855779127545837\n20061117 00:00,1403900,0.32984830371946133\n20061120 00:00,1403700,0.3312846532442104\n20061121 00:00,1405800,0.33249515197358165\n20061122 00:00,1409200,0.3336380679075048\n20061124 00:00,1404600,0.3348076091982659\n20061127 00:00,1384900,0.33160636835417073\n20061128 00:00,1390300,0.329867210322653\n20061129 00:00,1403600,0.32967933299617586\n20061130 00:00,1404600,0.330315670430612\n20061201 00:00,1400600,0.329421764703622\n20061204 00:00,1413300,0.3286995866008885\n20061205 00:00,1418800,0.3273820563408616\n20061206 00:00,1417500,0.3268320093827368\n20061207 00:00,1412200,0.326617184667729\n20061208 00:00,1414100,0.32683612069179735\n20061211 00:00,1417400,0.3271079615977955\n20061212 00:00,1416200,0.3274250278883159\n20061213 00:00,1418400,0.32786144452049537\n20061214 00:00,1429800,0.3296235113969766\n20061215 00:00,1423800,0.33205962577985776\n20061218 00:00,1419400,0.3322034361460551\n20061219 00:00,1422800,0.33194753473799293\n20061220 00:00,1421300,0.33183811928929585\n20061221 00:00,1416200,0.33151019635828155\n20061222 00:00,1408500,0.3310610624739439\n20061226 00:00,1415400,0.3320686001410932\n20061227 00:00,1425900,0.3318084312574536\n20061228 00:00,1421900,0.33254048875120573\n20061229 00:00,1415200,0.33418685521775543\n20070103 00:00,1414500,0.3393525431222735\n20070104 00:00,1416700,0.34050562564953546\n20070105 00:00,1407600,0.34147609990983335\n20070108 00:00,1411700,0.3431199488419841\n20070109 00:00,1411300,0.34263137041052216\n20070110 00:00,1414000,0.34140645152776683\n20070111 00:00,1422700,0.33934955596705\n20070112 00:00,1429700,0.3363641512186513\n20070116 00:00,1430300,0.33444083590188517\n20070117 00:00,1429400,0.3336637669102569\n20070118 00:00,1424500,0.3336043862150179\n20070119 00:00,1429300,0.3343210482591996\n20070122 00:00,1422100,0.3353461112177138\n20070123 00:00,1427500,0.335687760195897\n20070124 00:00,1439100,0.3356559651360878\n20070125 00:00,1423500,0.3362063017725671\n20070126 00:00,1421900,0.3365696487461804\n20070129 00:00,1419600,0.33611876127615953\n20070130 00:00,1427600,0.3367959585920988\n20070131 00:00,1438100,0.3375850719359614\n20070201 00:00,1445700,0.3376182113974675\n20070202 00:00,1447900,0.3398617658232254\n20070205 00:00,1447000,0.34034803898995136\n20070206 00:00,1447900,0.34016660773073143\n20070207 00:00,1450300,0.3401211117451608\n20070208 00:00,1448800,0.34023737129513115\n20070209 00:00,1439200,0.33940127142760335\n20070212 00:00,1434200,0.3381087154749618\n20070213 00:00,1445100,0.33909466142826866\n20070214 00:00,1456400,0.3407447294801958\n20070215 00:00,1458300,0.340947193584611\n20070216 00:00,1456800,0.34114801314187254\n20070220 00:00,1461000,0.341487424964774\n20070221 00:00,1458900,0.34188013769225023\n20070222 00:00,1458300,0.3423655348863487\n20070223 00:00,1453600,0.3424889227863353\n20070226 00:00,1452100,0.3424459892422015\n20070227 00:00,1400000,0.3256575366832844\n20070228 00:00,1409300,0.31640227012918226\n20070301 00:00,1405900,0.31272824882623557\n20070302 00:00,1389800,0.31333368516664595\n20070305 00:00,1376900,0.31710004683021226\n20070306 00:00,1398000,0.3230837173639851\n20070307 00:00,1394600,0.32967696171980615\n20070308 00:00,1405400,0.3344112080390245\n20070309 00:00,1406200,0.339647022863087\n20070312 00:00,1410100,0.3457832732546493\n20070313 00:00,1381500,0.3567839586649968\n20070314 00:00,1391400,0.3662849175441561\n20070315 00:00,1395700,0.37306341222999423\n20070316 00:00,1384800,0.38093428755397246\n20070319 00:00,1400700,0.385373857277609\n20070320 00:00,1409300,0.38625164082525376\n20070321 00:00,1433300,0.3792719825706735\n20070322 00:00,1433100,0.3750263931337338\n20070323 00:00,1435000,0.3729641966618282\n20070326 00:00,1435900,0.3725297312481858\n20070327 00:00,1427100,0.37266014793539265\n20070328 00:00,1415400,0.37065581332627273\n20070329 00:00,1421200,0.3706104168790062\n20070330 00:00,1419400,0.3707701865549113\n20070402 00:00,1423000,0.37148633623363114\n20070403 00:00,1436600,0.3725801168246603\n20070404 00:00,1437900,0.3737813466929734\n20070405 00:00,1442800,0.37547299111313087\n20070409 00:00,1444200,0.3789034879232472\n20070410 00:00,1448000,0.3826227327236739\n20070411 00:00,1438300,0.3841474231102194\n20070412 00:00,1447400,0.386061503952774\n20070413 00:00,1452600,0.3871660308058571\n20070416 00:00,1467800,0.3880686879131135\n20070417 00:00,1470700,0.3894046654419144\n20070418 00:00,1471500,0.3922337620763949\n20070419 00:00,1470300,0.3929948065677283\n20070420 00:00,1484700,0.394044006052427\n20070423 00:00,1481200,0.3948691299235927\n20070424 00:00,1480400,0.3955200157966814\n20070425 00:00,1494600,0.3969212198363034\n20070426 00:00,1493900,0.3984827974293043\n20070427 00:00,1494000,0.39883463922022655\n20070430 00:00,1482300,0.39607204853395744\n20070501 00:00,1486100,0.39340678483334107\n20070502 00:00,1496200,0.3921980583636359\n20070503 00:00,1502600,0.38916946538750885\n20070504 00:00,1506400,0.388354508803283\n20070507 00:00,1509500,0.3867831016394912\n20070508 00:00,1508600,0.3834836417714289\n20070509 00:00,1513800,0.3817105678976879\n20070510 00:00,1493300,0.37894278027348755\n20070511 00:00,1508100,0.3801451507762659\n20070514 00:00,1505500,0.37910926427203745\n20070515 00:00,1503800,0.37777263834511327\n20070516 00:00,1516100,0.3776686717254885\n20070517 00:00,1514400,0.37691537175441964\n20070518 00:00,1524900,0.3742299448409176\n20070521 00:00,1527100,0.37228183758769606\n20070522 00:00,1526000,0.37003447490025465\n20070523 00:00,1523800,0.3671453128908966\n20070524 00:00,1510100,0.3650116621957367\n20070525 00:00,1518600,0.3639173115947294\n20070529 00:00,1520800,0.3597803277948991\n20070530 00:00,1533700,0.35407693331229645\n20070531 00:00,1533500,0.35328280759395286\n20070601 00:00,1539600,0.3499787997176933\n20070604 00:00,1542400,0.347840425883093\n20070605 00:00,1534400,0.3485262961385503\n20070606 00:00,1521000,0.3463675660986085\n20070607 00:00,1493600,0.3376534995414513\n20070608 00:00,1510500,0.33665332845550017\n20070611 00:00,1513000,0.3386130634100285\n20070612 00:00,1496700,0.3409630147314997\n20070613 00:00,1519500,0.3410386587579873\n20070614 00:00,1527100,0.3405262378169691\n20070615 00:00,1530400,0.33864869903537786\n20070618 00:00,1529000,0.34001610064636245\n20070619 00:00,1532000,0.33948306421613106\n20070620 00:00,1510200,0.3391687286268923\n20070621 00:00,1519800,0.33910593835893105\n20070622 00:00,1502400,0.3387834853673506\n20070625 00:00,1496100,0.33878612146803816\n20070626 00:00,1490700,0.3409908537216888\n20070627 00:00,1505500,0.34374434779293317\n20070628 00:00,1504000,0.3513723409257996\n20070629 00:00,1499800,0.3573821304739499\n20070702 00:00,1518000,0.35569995494077006\n20070703 00:00,1522400,0.35315255610848517\n20070705 00:00,1524300,0.3518047059778952\n20070706 00:00,1529600,0.3511631056405606\n20070709 00:00,1530800,0.35207984690354827\n20070710 00:00,1508900,0.353390829047224\n20070711 00:00,1518400,0.35677003366189985\n20070712 00:00,1547500,0.3604534131042751\n20070713 00:00,1551100,0.36006601178632064\n20070716 00:00,1549000,0.358994428013735\n20070717 00:00,1548600,0.3589765998443025\n20070718 00:00,1545900,0.36054315026058337\n20070719 00:00,1552200,0.3621680578451077\n20070720 00:00,1533300,0.36170552150402824\n20070723 00:00,1540600,0.36187125770886197\n20070724 00:00,1511200,0.35720008951073895\n20070725 00:00,1517500,0.352760776031337\n20070726 00:00,1485500,0.3435705907065648\n20070727 00:00,1460400,0.32965870792903135\n20070730 00:00,1472700,0.3285617041307121\n20070731 00:00,1453900,0.33306600013823956\n20070801 00:00,1466200,0.34040888597813485\n20070802 00:00,1472900,0.3477252332464872\n20070803 00:00,1433500,0.3621253753206556\n20070806 00:00,1467600,0.3726054265650415\n20070807 00:00,1476800,0.3773092264911073\n20070808 00:00,1498600,0.37495178181814776\n20070809 00:00,1457200,0.3868687356685357\n20070810 00:00,1455400,0.3943971252435598\n20070813 00:00,1455100,0.40305442646509554\n20070814 00:00,1427700,0.41296036890144167\n20070815 00:00,1409000,0.4201816044350085\n20070816 00:00,1417300,0.42788326549303235\n20070817 00:00,1447400,0.42941740341381973\n20070820 00:00,1447500,0.42989697715909336\n20070821 00:00,1449500,0.4304546767626207\n20070822 00:00,1466600,0.4280432075789495\n20070823 00:00,1465700,0.4262791448821654\n20070824 00:00,1481600,0.42310433734675373\n20070827 00:00,1469200,0.42266221520607333\n20070828 00:00,1436500,0.4189951056727334\n20070829 00:00,1467100,0.41909361780849946\n20070830 00:00,1461500,0.4184008738388425\n20070831 00:00,1474700,0.41794664340263327\n20070904 00:00,1492000,0.41590701556517107\n20070905 00:00,1475500,0.41695932665838736\n20070906 00:00,1482600,0.41850328230273426\n20070907 00:00,1458400,0.41656447204878905\n20070910 00:00,1455100,0.413814704514469\n20070911 00:00,1476400,0.41404618141435434\n20070912 00:00,1476400,0.41401976059798573\n20070913 00:00,1488100,0.4137081659447466\n20070914 00:00,1489300,0.41355760725692203\n20070917 00:00,1481300,0.4131720030956866\n20070918 00:00,1523900,0.40987791644226496\n20070919 00:00,1533600,0.4041617277443548\n20070920 00:00,1523400,0.40275172001771326\n20070921 00:00,1522700,0.40281330593737447\n20070924 00:00,1515500,0.4026723201098062\n20070925 00:00,1516400,0.4035812335637537\n20070926 00:00,1523700,0.4049990182966494\n20070927 00:00,1529400,0.4064027317275259\n20070928 00:00,1524700,0.40761827740640216\n20071001 00:00,1545200,0.40945056853228146\n20071002 00:00,1544300,0.4110086218680119\n20071003 00:00,1538000,0.4131316770201858\n20071004 00:00,1541600,0.41542287318444054\n20071005 00:00,1556000,0.4181416076423554\n20071008 00:00,1551900,0.4204145758846591\n20071009 00:00,1564000,0.42246505351469926\n20071010 00:00,1560300,0.42431810032334605\n20071011 00:00,1553500,0.42537866197159396\n20071012 00:00,1560600,0.4270665037098132\n20071015 00:00,1548300,0.42710408269940625\n20071016 00:00,1537700,0.4252573314780817\n20071017 00:00,1540300,0.4243299577651525\n20071018 00:00,1538200,0.4236952728969983\n20071019 00:00,1499700,0.417730309723928\n20071022 00:00,1506000,0.4143574435143764\n20071023 00:00,1519400,0.41362256268983544\n20071024 00:00,1515600,0.4137510475781365\n20071025 00:00,1513200,0.4147382028428531\n20071026 00:00,1534500,0.4141857632509984\n20071029 00:00,1540000,0.4133612050436554\n20071030 00:00,1530600,0.4138895533315895\n20071031 00:00,1547900,0.4131787593046079\n20071101 00:00,1507800,0.4138277404117251\n20071102 00:00,1511100,0.4129208976738837\n20071105 00:00,1501900,0.41304432822703535\n20071106 00:00,1520900,0.41396459812445513\n20071107 00:00,1475900,0.4136823602500991\n20071108 00:00,1475300,0.41197352958338757\n20071109 00:00,1452600,0.4105723556306537\n20071112 00:00,1439900,0.4100791740166549\n20071113 00:00,1481900,0.41084577171244496\n20071114 00:00,1471000,0.4121245746793081\n20071115 00:00,1453600,0.41483689889460273\n20071116 00:00,1460400,0.4174477989778497\n20071119 00:00,1435600,0.42166812228488165\n20071120 00:00,1442000,0.4262826148523249\n20071121 00:00,1418100,0.4319786917375351\n20071123 00:00,1441800,0.4372354470366978\n20071126 00:00,1408200,0.4452554189765709\n20071127 00:00,1430900,0.4503884166045911\n20071128 00:00,1472600,0.4450454849409667\n20071129 00:00,1472700,0.44048251163453256\n20071130 00:00,1484600,0.43575207960047213\n20071203 00:00,1475600,0.43431790828788736\n20071204 00:00,1465500,0.4340494558876088\n20071205 00:00,1488600,0.43332306651857927\n20071206 00:00,1511100,0.43041912796358606\n20071207 00:00,1507500,0.42988959138191046\n20071210 00:00,1520300,0.4306875863030995\n20071211 00:00,1482400,0.4302598802766972\n20071212 00:00,1491300,0.43020566477136607\n20071213 00:00,1493000,0.431165142240248\n20071214 00:00,1471800,0.429923769355552\n20071217 00:00,1450700,0.42513188340412256\n20071218 00:00,1458200,0.4233051046231324\n20071219 00:00,1456300,0.42233766292505903\n20071220 00:00,1465400,0.42251446305744583\n20071221 00:00,1482000,0.42206929799637194\n20071224 00:00,1492000,0.42077376432049257\n20071226 00:00,1494800,0.41988097462424295\n20071227 00:00,1475200,0.41966643811612236\n20071228 00:00,1475400,0.41967168815231565\n20071231 00:00,1464200,0.4195817894201045\n20080102 00:00,1445600,0.41831833056983453\n20080103 00:00,1444600,0.41787779668020614\n20080104 00:00,1409300,0.415750991498078\n20080107 00:00,1414600,0.4156019620920266\n20080108 00:00,1388100,0.41572334352328666\n20080109 00:00,1407800,0.4178722255193322\n20080110 00:00,1418000,0.41870967030861544\n20080111 00:00,1400300,0.42142842153444754\n20080114 00:00,1414600,0.4231947183237039\n20080115 00:00,1379500,0.4263781041523256\n20080116 00:00,1371400,0.4286164279901285\n20080117 00:00,1332300,0.43011858503941197\n20080118 00:00,1324900,0.4334687942435496\n20080122 00:00,1310200,0.439622708215354\n20080123 00:00,1336200,0.44610203554124905\n20080124 00:00,1349900,0.4499286468780922\n20080125 00:00,1329800,0.45596581601634684\n20080128 00:00,1353200,0.458598961573891\n20080129 00:00,1360700,0.45974379276672767\n20080130 00:00,1353700,0.4617086935221553\n20080131 00:00,1374400,0.4607973526086931\n20080201 00:00,1394500,0.4566199014500716\n20080204 00:00,1380200,0.45526107446450303\n20080205 00:00,1337200,0.4522985374764312\n20080206 00:00,1327200,0.4479484324194854\n20080207 00:00,1337800,0.4465962685383184\n20080208 00:00,1331200,0.4456750000443871\n20080211 00:00,1339100,0.4455561747453884\n20080212 00:00,1349200,0.44591218697255547\n20080213 00:00,1367100,0.4439481583148266\n20080214 00:00,1350100,0.4424857208983356\n20080215 00:00,1350700,0.4409094685668368\n20080219 00:00,1350300,0.43988409385887045\n20080220 00:00,1361100,0.4392838367306876\n20080221 00:00,1344800,0.43979423184097843\n20080222 00:00,1356400,0.4419839040521509\n20080225 00:00,1373100,0.44566262718032335\n20080226 00:00,1383500,0.44855754836885464\n20080227 00:00,1381200,0.4480186188645262\n20080228 00:00,1370000,0.448706344806775\n20080229 00:00,1332500,0.4457688676894551\n20080303 00:00,1333900,0.44252929268706126\n20080304 00:00,1329200,0.4404493472721358\n20080305 00:00,1337000,0.43929663882656506\n20080306 00:00,1308200,0.43717923708007195\n20080307 00:00,1297100,0.4348239672958495\n20080310 00:00,1278600,0.43301901106990237\n20080311 00:00,1323900,0.432581530972185\n20080312 00:00,1313100,0.43126274299204764\n20080313 00:00,1319200,0.430432435763014\n20080314 00:00,1292600,0.43108832952556164\n20080317 00:00,1279000,0.4322964038873394\n20080318 00:00,1333200,0.4309472091966389\n20080319 00:00,1303600,0.43118320072831684\n20080320 00:00,1327300,0.42950094492172075\n20080324 00:00,1347700,0.42528838892416354\n20080325 00:00,1350500,0.4222445165761114\n20080326 00:00,1338300,0.42125187555333715\n20080327 00:00,1324500,0.41908716283055414\n20080328 00:00,1314000,0.41574097728321935\n20080331 00:00,1319400,0.41328903648246024\n20080401 00:00,1368000,0.4095966492986472\n20080402 00:00,1366600,0.4062132494185292\n20080403 00:00,1368000,0.4049012650379992\n20080404 00:00,1369700,0.40466692531298515\n20080407 00:00,1370500,0.4050637603939913\n20080408 00:00,1364700,0.40534318001221953\n20080409 00:00,1353900,0.40468647597895174\n20080410 00:00,1359400,0.40479876718914176\n20080411 00:00,1332900,0.4030897068627506\n20080414 00:00,1328100,0.40093545398237107\n20080415 00:00,1335200,0.40003709831158607\n20080416 00:00,1362300,0.39890398319772163\n20080417 00:00,1364800,0.3977221866513132\n20080418 00:00,1389600,0.39547521649499345\n20080421 00:00,1387800,0.39418184708887166\n20080422 00:00,1376900,0.39378664245109646\n20080423 00:00,1379800,0.393684002431829\n20080424 00:00,1387900,0.39413074445433643\n20080425 00:00,1397600,0.39464011766379725\n20080428 00:00,1396200,0.3950901090055741\n20080429 00:00,1390700,0.3954532713109904\n20080430 00:00,1384300,0.395691959635081\n20080501 00:00,1409300,0.3966047815567324\n20080502 00:00,1413400,0.39724468026430837\n20080505 00:00,1407100,0.39834820916741703\n20080506 00:00,1418400,0.400126052845651\n20080507 00:00,1392800,0.40073045598483964\n20080508 00:00,1398400,0.4015556670321243\n20080509 00:00,1389300,0.4018554130720716\n20080512 00:00,1404700,0.4028599033234768\n20080513 00:00,1404000,0.40353717675912903\n20080514 00:00,1409600,0.40420564826318833\n20080515 00:00,1425500,0.4042919005683373\n20080516 00:00,1426500,0.40445618570480074\n20080519 00:00,1428300,0.4048324802786871\n20080520 00:00,1416300,0.4052235247587584\n20080521 00:00,1393100,0.4039107059477642\n20080522 00:00,1395700,0.4030519419542195\n20080523 00:00,1378600,0.40212827106193194\n20080527 00:00,1387400,0.4020866722373052\n20080528 00:00,1393700,0.4021575084311629\n20080529 00:00,1400300,0.40185070981515036\n20080530 00:00,1401000,0.4017467122286171\n20080602 00:00,1388300,0.40213573375213535\n20080603 00:00,1380100,0.4031233915578133\n20080604 00:00,1380400,0.40455391757612874\n20080605 00:00,1406400,0.4040068891425883\n20080606 00:00,1363800,0.40458169548204986\n20080609 00:00,1366200,0.4040197442492276\n20080610 00:00,1361400,0.4041064106221758\n20080611 00:00,1339500,0.40519112324823603\n20080612 00:00,1344500,0.405764658940147\n20080613 00:00,1364000,0.4057891979201919\n20080616 00:00,1363900,0.4058703122930147\n20080617 00:00,1355000,0.40669751652243513\n20080618 00:00,1343200,0.4077805194010453\n20080619 00:00,1347100,0.40745335189468235\n20080620 00:00,1315900,0.4076939837988514\n20080623 00:00,1316300,0.40678437597729383\n20080624 00:00,1312400,0.4066197641882509\n20080625 00:00,1320000,0.4068909917134861\n20080626 00:00,1282100,0.40776983418030094\n20080627 00:00,1278000,0.4086392537024618\n20080630 00:00,1278400,0.411018863941973\n20080701 00:00,1283700,0.4127562668755475\n20080702 00:00,1260700,0.4153226835303262\n20080703 00:00,1263800,0.4177960955761165\n20080707 00:00,1250900,0.4201098907557518\n20080708 00:00,1272800,0.4211882755560779\n20080709 00:00,1244300,0.42688785883204433\n20080710 00:00,1253800,0.4304440278051394\n20080711 00:00,1240200,0.43136807457843834\n20080714 00:00,1228200,0.43215027175920934\n20080715 00:00,1214300,0.4330271973436198\n20080716 00:00,1244700,0.43256089634510964\n20080717 00:00,1259000,0.42929556668940516\n20080718 00:00,1259200,0.42709444499580557\n20080721 00:00,1259900,0.42599425279080283\n20080722 00:00,1276900,0.4254600274037004\n20080723 00:00,1282200,0.42472527483225636\n20080724 00:00,1254300,0.4272636959323138\n20080725 00:00,1257200,0.42692127718308714\n20080728 00:00,1235600,0.42571115106733376\n20080729 00:00,1262700,0.4258738944289097\n20080730 00:00,1284500,0.4247921787321297\n20080731 00:00,1268500,0.4255010238372946\n20080801 00:00,1261100,0.42551910724519193\n20080804 00:00,1249200,0.4276765696723178\n20080805 00:00,1284200,0.42885138442521675\n20080806 00:00,1290900,0.4293411888435352\n20080807 00:00,1268600,0.4342133004274845\n20080808 00:00,1296200,0.43551992620399904\n20080811 00:00,1306500,0.43671038174953863\n20080812 00:00,1292400,0.43910395259763674\n20080813 00:00,1288200,0.4387683293192042\n20080814 00:00,1295200,0.4402846414926305\n20080815 00:00,1300500,0.4416369102014598\n20080818 00:00,1282400,0.4416547180091745\n20080819 00:00,1270000,0.44054294262022853\n20080820 00:00,1277100,0.4400359794483068\n20080821 00:00,1279800,0.4396664622717538\n20080822 00:00,1295100,0.43899024560003796\n20080825 00:00,1270800,0.4398712821426417\n20080826 00:00,1274400,0.4384125696916494\n20080827 00:00,1284600,0.43718891881498156\n20080828 00:00,1303100,0.43496175113066876\n20080829 00:00,1286900,0.43365156103810387\n20080902 00:00,1281000,0.4316168246648793\n20080903 00:00,1279600,0.43093936384679365\n20080904 00:00,1240700,0.42643936929406234\n20080905 00:00,1246400,0.423385327108996\n20080908 00:00,1272500,0.41976667255627337\n20080909 00:00,1229400,0.41670261434797756\n20080910 00:00,1236000,0.4135460676501161\n20080911 00:00,1255100,0.4108640259938568\n20080912 00:00,1257400,0.4086211002173783\n20080915 00:00,1203600,0.4067718255454195\n20080916 00:00,1218500,0.4062258967531865\n20080917 00:00,1163500,0.4021548445801324\n20080918 00:00,1205500,0.40224895187786985\n20080919 00:00,1250500,0.394472389178527\n20080922 00:00,1207000,0.39404888683605793\n20080923 00:00,1187000,0.3927910854651157\n20080924 00:00,1188100,0.39318244993934165\n20080925 00:00,1210000,0.39327118525932886\n20080926 00:00,1213300,0.3931605044154412\n20080929 00:00,1130200,0.3918706195321056\n20080930 00:00,1165400,0.391775637606386\n20081001 00:00,1160000,0.39177369769200243\n20081002 00:00,1113600,0.3919656177714921\n20081003 00:00,1099700,0.3921060221141945\n20081006 00:00,1062800,0.3920842990145483\n20081007 00:00,997400,0.3877039233259547\n20081008 00:00,983900,0.388968770017307\n20081009 00:00,917200,0.39263644602500913\n20081010 00:00,904500,0.4021404809321984\n20081013 00:00,1006800,0.40552336752602786\n20081014 00:00,999100,0.40734773005009944\n20081015 00:00,907500,0.42167074819228445\n20081016 00:00,944100,0.43367370095043895\n20081017 00:00,940900,0.44481581236253287\n20081020 00:00,984900,0.4490996400482152\n20081021 00:00,955000,0.4569824314916611\n20081022 00:00,903900,0.4654446629737539\n20081023 00:00,910400,0.473128332496967\n20081024 00:00,875400,0.4802355066864464\n20081027 00:00,848200,0.4839342972235428\n20081028 00:00,937700,0.4838406631599877\n20081029 00:00,923600,0.48239281619107716\n20081030 00:00,954400,0.47898284817805925\n20081031 00:00,971300,0.47435331677420495\n20081103 00:00,967400,0.4722353767675458\n20081104 00:00,1002800,0.4694787887368228\n20081105 00:00,957000,0.47154200512143307\n20081106 00:00,908100,0.467244012503272\n20081107 00:00,931300,0.4661777167099468\n20081110 00:00,921700,0.4646640019720404\n20081111 00:00,901600,0.4624508147565249\n20081112 00:00,857300,0.45844063946715824\n20081113 00:00,910500,0.4580750299792017\n20081114 00:00,876800,0.4563897585175124\n20081117 00:00,853000,0.4546417245112745\n20081118 00:00,861700,0.45309087675839627\n20081119 00:00,813400,0.45097101986290594\n20081120 00:00,759500,0.445260481897099\n20081121 00:00,802700,0.44578860627940925\n20081124 00:00,848900,0.445597485179451\n20081125 00:00,860600,0.4428930025611936\n20081126 00:00,890200,0.4369943728451589\n20081128 00:00,898200,0.43214051267640313\n20081201 00:00,821300,0.4318121708418621\n20081202 00:00,852700,0.4316519265494009\n20081203 00:00,874100,0.43175978229062006\n20081204 00:00,850000,0.4317771041831165\n20081205 00:00,879700,0.4314155958085318\n20081208 00:00,910600,0.4296372627891424\n20081209 00:00,895500,0.4300025601092295\n20081210 00:00,902500,0.43087274913675544\n20081211 00:00,880300,0.43209184723772887\n20081212 00:00,884700,0.43391658923327453\n20081215 00:00,874800,0.4352817591366467\n20081216 00:00,918700,0.43821764080077913\n20081217 00:00,910200,0.4406922141064356\n20081218 00:00,892000,0.4433121336837468\n20081219 00:00,882800,0.4444254523833637\n20081222 00:00,865700,0.4429319865242585\n20081223 00:00,861900,0.44091686170386596\n20081224 00:00,865600,0.4392617052379197\n20081226 00:00,871000,0.4381144839427341\n20081229 00:00,868900,0.43753488410991537\n20081230 00:00,888700,0.4371811436602667\n20081231 00:00,903300,0.4363310821901084\n20090102 00:00,930300,0.43459325285488154\n20090105 00:00,928400,0.4336529112825866\n20090106 00:00,934400,0.43312490718460284\n20090107 00:00,906200,0.43367721230739265\n20090108 00:00,910100,0.4342644903489336\n20090109 00:00,890100,0.4351098314100199\n20090112 00:00,869400,0.4350616096551233\n20090113 00:00,870500,0.43764977583626036\n20090114 00:00,842100,0.43763485739334573\n20090115 00:00,844400,0.4380279226385272\n20090116 00:00,850200,0.4374814963068282\n20090120 00:00,805400,0.4361180426198194\n20090121 00:00,840200,0.4368820798752336\n20090122 00:00,828400,0.4369457094766479\n20090123 00:00,831100,0.4371938431101387\n20090126 00:00,837300,0.43810985088861354\n20090127 00:00,845900,0.4380700003128364\n20090128 00:00,873800,0.4364512351304504\n20090129 00:00,845700,0.43688216706272454\n20090130 00:00,826900,0.43705798567106857\n20090202 00:00,825200,0.43937639028283054\n20090203 00:00,837200,0.4407548016606931\n20090204 00:00,833300,0.44034844347733565\n20090205 00:00,845700,0.43997420049575936\n20090206 00:00,870000,0.43894705446035653\n20090209 00:00,871300,0.438758774966102\n20090210 00:00,829200,0.4387532868114814\n20090211 00:00,836300,0.43848894069864414\n20090212 00:00,836100,0.4384467912547005\n20090213 00:00,827400,0.43857677273306683\n20090217 00:00,791900,0.43737156810579864\n20090218 00:00,789700,0.43650006607733244\n20090219 00:00,782800,0.43583683536727835\n20090220 00:00,773800,0.43642757603833576\n20090223 00:00,746500,0.4361625814283167\n20090224 00:00,774700,0.4363950682192838\n20090225 00:00,768300,0.4371816486560365\n20090226 00:00,755400,0.4391442260401738\n20090227 00:00,739300,0.44072600328343325\n20090302 00:00,705800,0.44072362530228776\n20090303 00:00,700700,0.44135309281168195\n20090304 00:00,716700,0.4424452463789434\n20090305 00:00,687900,0.44487353132552465\n20090306 00:00,688400,0.4458200059046906\n20090309 00:00,681100,0.44664630074141826\n20090310 00:00,721600,0.444882868544419\n20090311 00:00,726100,0.44268144767980744\n20090312 00:00,755300,0.4382207439027302\n20090313 00:00,761500,0.43465212979605394\n20090316 00:00,759600,0.43235449434539236\n20090317 00:00,782400,0.4302935186424364\n20090318 00:00,798900,0.4282143357135178\n20090319 00:00,788400,0.428452173511587\n20090320 00:00,766500,0.4282667564497683\n20090323 00:00,822200,0.4296027538370976\n20090324 00:00,806000,0.4313315963706304\n20090325 00:00,813200,0.43368256646622044\n20090326 00:00,831100,0.4371155196393823\n20090327 00:00,816100,0.4419041125588491\n20090330 00:00,787600,0.44448456311496704\n20090331 00:00,794400,0.4466635169388531\n20090401 00:00,810000,0.4493414222283597\n20090402 00:00,833900,0.4518604305773145\n20090403 00:00,842700,0.4539150525044478\n20090406 00:00,834800,0.45594077181158454\n20090407 00:00,816100,0.45661015807502386\n20090408 00:00,824900,0.4570796101461311\n20090409 00:00,858200,0.45756514541630583\n20090413 00:00,858300,0.4575501738821205\n20090414 00:00,843800,0.4584926792374459\n20090415 00:00,853100,0.4597759097292812\n20090416 00:00,866200,0.46074507274309545\n20090417 00:00,871400,0.46160352998854465\n20090420 00:00,834100,0.46158015652038065\n20090421 00:00,850800,0.4618588265897382\n20090422 00:00,845700,0.4620288894666223\n20090423 00:00,853700,0.46253526528297717\n20090424 00:00,866800,0.463031945326023\n20090427 00:00,858400,0.46379205018250563\n20090428 00:00,855600,0.46463112927744105\n20090429 00:00,873600,0.46563260619785396\n20090430 00:00,875500,0.4665632308068453\n20090501 00:00,878400,0.46712112658678717\n20090504 00:00,909200,0.4673184871807252\n20090505 00:00,905600,0.4678752515480407\n20090506 00:00,921100,0.46891562854878294\n20090507 00:00,909000,0.4701498882225479\n20090508 00:00,929900,0.47168283597804656\n20090511 00:00,911400,0.47368391637972024\n20090512 00:00,910100,0.475414003756324\n20090513 00:00,888000,0.47633168500777445\n20090514 00:00,894500,0.4774390483875628\n20090515 00:00,887300,0.47811902897940534\n20090518 00:00,912400,0.47944083511162205\n20090519 00:00,911200,0.48076392738085616\n20090520 00:00,905100,0.481765506978951\n20090521 00:00,892400,0.48224930337891936\n20090522 00:00,890400,0.4825477924899124\n20090526 00:00,913000,0.48337339399218776\n20090527 00:00,897100,0.48378989989522136\n20090528 00:00,909300,0.48387543036438824\n20090529 00:00,924100,0.48342419688439586\n20090601 00:00,947800,0.48205908159222577\n20090602 00:00,948800,0.4810978182096302\n20090603 00:00,936400,0.48109662102147344\n20090604 00:00,946000,0.4809844996654758\n20090605 00:00,945300,0.4814936914587885\n20090608 00:00,943000,0.48166445683230147\n20090609 00:00,946200,0.4820535878559471\n20090610 00:00,943400,0.48225317104208026\n20090611 00:00,948500,0.4833413573000665\n20090612 00:00,950900,0.48390964317174934\n20090615 00:00,928800,0.4832828635442786\n20090616 00:00,916400,0.4819943214136032\n20090617 00:00,915200,0.48111313426121355\n20090618 00:00,920800,0.4808223193694246\n20090619 00:00,920400,0.480810285044726\n20090622 00:00,892700,0.48018459304411915\n20090623 00:00,893600,0.47991109418540845\n20090624 00:00,901500,0.4802267598690591\n20090625 00:00,920000,0.48062526780737325\n20090626 00:00,918900,0.480183531363679\n20090629 00:00,926800,0.4797082437222795\n20090630 00:00,919200,0.479668822786341\n20090701 00:00,923400,0.4798742873197535\n20090702 00:00,898500,0.4796250110802036\n20090706 00:00,898000,0.47942668990945586\n20090707 00:00,881100,0.47879242359668434\n20090708 00:00,880000,0.4790611545431479\n20090709 00:00,882000,0.47866038465515104\n20090710 00:00,879500,0.4787955839681312\n20090713 00:00,901300,0.478220535636355\n20090714 00:00,906300,0.47740176584343696\n20090715 00:00,932500,0.47650915353820184\n20090716 00:00,941200,0.47468728076741473\n20090717 00:00,941700,0.47359166820231835\n20090720 00:00,950700,0.4729598454876584\n20090721 00:00,955700,0.4727353995474732\n20090722 00:00,955500,0.4732789749335224\n20090723 00:00,977000,0.47424660251796186\n20090724 00:00,981000,0.4747648242794776\n20090727 00:00,983500,0.47583584380201543\n20090728 00:00,981100,0.4780787384827436\n20090729 00:00,976800,0.47968709181653285\n20090730 00:00,987000,0.4821773848370002\n20090731 00:00,988100,0.4845152684014697\n20090803 00:00,1004500,0.48729448562750227\n20090804 00:00,1006800,0.49062859457438607\n20090805 00:00,1003700,0.4929630562829718\n20090806 00:00,998900,0.49485182352501017\n20090807 00:00,1012000,0.4974300743880598\n20090810 00:00,1009800,0.49879174486588634\n20090811 00:00,996600,0.49968650685790084\n20090812 00:00,1007700,0.5005602323908563\n20090813 00:00,1015700,0.5013266837513697\n20090814 00:00,1007300,0.502001458285917\n20090817 00:00,982700,0.5018560664545801\n20090818 00:00,991600,0.5018143535554006\n20090819 00:00,1000100,0.5019948265571049\n20090820 00:00,1010100,0.501816395404155\n20090821 00:00,1029700,0.5010179394779897\n20090824 00:00,1029600,0.5002225881892824\n20090825 00:00,1031400,0.5002160121163788\n20090826 00:00,1031700,0.5002558238725888\n20090827 00:00,1034300,0.49987332812449525\n20090828 00:00,1033300,0.49984967085566995\n20090831 00:00,1025500,0.4995817828086632\n20090901 00:00,1002000,0.4988110335408181\n20090902 00:00,998000,0.4976962086914535\n20090903 00:00,1006500,0.497396627253196\n20090904 00:00,1020800,0.49638183965172084\n20090908 00:00,1028900,0.4946210694027273\n20090909 00:00,1037600,0.49273254924498455\n20090910 00:00,1048200,0.48937831902984147\n20090911 00:00,1047900,0.4845402008463093\n20090914 00:00,1053400,0.4775058512164966\n20090915 00:00,1057400,0.4715731371666618\n20090916 00:00,1073300,0.46314026431371225\n20090917 00:00,1071600,0.4602377174975727\n20090918 00:00,1067200,0.44958772912987455\n20090921 00:00,1064400,0.4355897251164088\n20090922 00:00,1070800,0.42320328199389295\n20090923 00:00,1061400,0.4122149273763248\n20090924 00:00,1049500,0.3998234475453089\n20090925 00:00,1044500,0.38658849510789056\n20090928 00:00,1063200,0.37174844801709167\n20090929 00:00,1060300,0.3613961446611649\n20090930 00:00,1055600,0.3519529854239404\n20091001 00:00,1030500,0.3461795578223385\n20091002 00:00,1025400,0.3446375767578203\n20091005 00:00,1040100,0.3501031809488852\n20091006 00:00,1055500,0.3558405223821822\n20091007 00:00,1057700,0.35909689841383474\n20091008 00:00,1066400,0.36097637329337995\n20091009 00:00,1072500,0.365441955897827\n20091012 00:00,1077600,0.3691390214360634\n20091013 00:00,1075000,0.37461148520477017\n20091014 00:00,1093100,0.37635139310476734\n20091015 00:00,1096500,0.3779664364456414\n20091016 00:00,1088600,0.37913617742980277\n20091019 00:00,1098600,0.3801830587970102\n20091020 00:00,1092000,0.3866515236425088\n20091021 00:00,1081500,0.3895398062247909\n20091022 00:00,1093400,0.39104357546773\n20091023 00:00,1080800,0.39163302087607416\n20091026 00:00,1068300,0.3952064591480169\n20091027 00:00,1064000,0.4066304753245894\n20091028 00:00,1043800,0.4007210292670186\n20091029 00:00,1066500,0.3998135290537873\n20091030 00:00,1035600,0.3943100638770016\n20091102 00:00,1043600,0.38795271441250734\n20091103 00:00,1046500,0.3829668599878599\n20091104 00:00,1049100,0.383963508590101\n20091105 00:00,1068600,0.38068287182906935\n20091106 00:00,1071600,0.3792088070848622\n20091109 00:00,1096300,0.378438186967678\n20091110 00:00,1095700,0.3805795753114455\n20091111 00:00,1101500,0.38164660570105674\n20091112 00:00,1089900,0.38275101213012924\n20091113 00:00,1096100,0.391532822445531\n20091116 00:00,1112200,0.3971202049310909\n20091117 00:00,1113200,0.4023759031811159\n20091118 00:00,1112700,0.4122558923855508\n20091119 00:00,1097700,0.4123014007847687\n20091120 00:00,1094300,0.4221704135458266\n20091123 00:00,1109200,0.42829564398456677\n20091124 00:00,1109900,0.4310325031619946\n20091125 00:00,1113700,0.4335802638351896\n20091127 00:00,1095000,0.43841642974120976\n20091130 00:00,1098800,0.4407327480285591\n20091201 00:00,1112500,0.4452584866598473\n20091202 00:00,1113200,0.44665158452016224\n20091203 00:00,1103800,0.4471335076134949\n20091204 00:00,1110100,0.45151005003512995\n20091207 00:00,1108000,0.4516351791513114\n20091208 00:00,1096100,0.451914611943191\n20091209 00:00,1099700,0.4521677042533108\n20091210 00:00,1106500,0.45284061078822885\n20091211 00:00,1111800,0.45331571070704657\n20091214 00:00,1119000,0.45404588038206073\n20091215 00:00,1113000,0.454838382356815\n20091216 00:00,1114900,0.456602372943038\n20091217 00:00,1101300,0.45805521105567765\n20091218 00:00,1101900,0.4578997901259887\n20091221 00:00,1113300,0.4573202869604839\n20091222 00:00,1117400,0.45657679951276064\n20091223 00:00,1119700,0.4566218144275824\n20091224 00:00,1126000,0.45698900372693835\n20091228 00:00,1126700,0.457948464073822\n20091229 00:00,1126200,0.46127129777535714\n20091230 00:00,1124500,0.46203251595209516\n20091231 00:00,1114400,0.4595804372508623\n20100104 00:00,1133300,0.4552165115063358\n20100105 00:00,1136500,0.4518893577062969\n20100106 00:00,1137300,0.4507113601573017\n20100107 00:00,1142100,0.4502095286698972\n20100108 00:00,1146200,0.4529083363218821\n20100111 00:00,1147400,0.45507471897595336\n20100112 00:00,1136700,0.4565210857612217\n20100113 00:00,1146400,0.4587563320594986\n20100114 00:00,1149400,0.4595240763136708\n20100115 00:00,1136700,0.46091718552808636\n20100119 00:00,1151200,0.46085448159500936\n20100120 00:00,1138600,0.4618272395149851\n20100121 00:00,1116500,0.4583759211318545\n20100122 00:00,1092100,0.4523398378987334\n20100125 00:00,1097800,0.44892758426697205\n20100126 00:00,1092900,0.44657569691525756\n20100127 00:00,1098100,0.44338309388606506\n20100128 00:00,1085400,0.4416444939635766\n20100129 00:00,1073700,0.4382930425725124\n20100201 00:00,1090600,0.43587882720948146\n20100202 00:00,1104100,0.43128900962356786\n20100203 00:00,1098200,0.4252469102627382\n20100204 00:00,1064900,0.4201902922427448\n20100205 00:00,1066600,0.41063034230401685\n20100208 00:00,1058700,0.39863129223221166\n20100209 00:00,1072000,0.3860784816705776\n20100210 00:00,1070100,0.37815864577742103\n20100211 00:00,1081300,0.3705363139926512\n20100212 00:00,1080400,0.3667614730523323\n20100216 00:00,1097500,0.3621658673366373\n20100217 00:00,1102600,0.35858260172634454\n20100218 00:00,1109100,0.35656374901802407\n20100219 00:00,1111800,0.356635822653588\n20100222 00:00,1111500,0.3568736056998496\n20100223 00:00,1098100,0.3577747545301931\n20100224 00:00,1108400,0.3637372186021978\n20100225 00:00,1106700,0.3721172686503415\n20100226 00:00,1107600,0.3805641804713894\n20100301 00:00,1118600,0.38463646272849006\n20100302 00:00,1121900,0.3810287266794932\n20100303 00:00,1123000,0.37701784737171057\n20100304 00:00,1126600,0.3763897997602319\n20100305 00:00,1142300,0.37156708629916974\n20100308 00:00,1142900,0.36839308984243924\n20100309 00:00,1144600,0.3686277923180988\n20100310 00:00,1149900,0.36847847380015253\n20100311 00:00,1154500,0.3694458199346765\n20100312 00:00,1154600,0.3693763949682516\n20100315 00:00,1155000,0.3697155401038246\n20100316 00:00,1164100,0.37128382077257327\n20100317 00:00,1171300,0.3720425814036883\n20100318 00:00,1170300,0.37460506258972787\n20100319 00:00,1159300,0.37518532068755356\n20100322 00:00,1165900,0.377569304435085\n20100323 00:00,1174000,0.3794704354752373\n20100324 00:00,1168500,0.38061758661032646\n20100325 00:00,1166200,0.3814654125180331\n20100326 00:00,1166600,0.38626691286653936\n20100329 00:00,1173200,0.38738045443685737\n20100330 00:00,1174000,0.3892808502326847\n20100331 00:00,1169900,0.392189271622002\n20100401 00:00,1178200,0.3935824704503644\n20100405 00:00,1187600,0.39371969018280023\n20100406 00:00,1190400,0.395001839710307\n20100407 00:00,1183600,0.3950291172153444\n20100408 00:00,1187800,0.3969804350313986\n20100409 00:00,1195500,0.3971371677303849\n20100412 00:00,1197400,0.39711304334538905\n20100413 00:00,1198700,0.3968170296009757\n20100414 00:00,1211900,0.39590935229665114\n20100415 00:00,1213200,0.39557627526488226\n20100416 00:00,1194000,0.3970647594786071\n20100419 00:00,1198100,0.39802190538473015\n20100420 00:00,1208800,0.39615305027048153\n20100421 00:00,1206600,0.39497378276282846\n20100422 00:00,1210200,0.3944678085638652\n20100423 00:00,1217900,0.3941973742177665\n20100426 00:00,1213500,0.3947945425682864\n20100427 00:00,1184300,0.39243334547550607\n20100428 00:00,1193500,0.39339296445395905\n20100429 00:00,1208500,0.39442683893963026\n20100430 00:00,1188600,0.39741716111510045\n20100503 00:00,1203600,0.40019916330229954\n20100504 00:00,1175800,0.39938132845884616\n20100505 00:00,1168200,0.39747985685259957\n20100506 00:00,1127400,0.3915801155607409\n20100507 00:00,1110000,0.3858131641114567\n20100510 00:00,1161700,0.38992799077232526\n20100511 00:00,1158300,0.3909281490103697\n20100512 00:00,1174700,0.39025631692758284\n20100513 00:00,1160200,0.39193348681002743\n20100514 00:00,1139200,0.39461530376934434\n20100517 00:00,1139100,0.39795872132157034\n20100518 00:00,1124300,0.40357508580629914\n20100519 00:00,1117400,0.4097490053941671\n20100520 00:00,1075500,0.4132341077319723\n20100521 00:00,1090300,0.42002333947034676\n20100524 00:00,1077000,0.4285609946230842\n20100525 00:00,1078000,0.43650019769141124\n20100526 00:00,1071700,0.4489882774232124\n20100527 00:00,1107900,0.45505974633002194\n20100528 00:00,1094400,0.4599480584116717\n20100601 00:00,1075200,0.46375782128438525\n20100602 00:00,1102800,0.46445898598617774\n20100603 00:00,1107000,0.4641525450425972\n20100604 00:00,1069400,0.4655515513173969\n20100607 00:00,1054900,0.46450775345803297\n20100608 00:00,1065700,0.46646753371256877\n20100609 00:00,1059900,0.4686034281879422\n20100610 00:00,1091900,0.4677050730722598\n20100611 00:00,1096800,0.46570169553376906\n20100614 00:00,1095700,0.46611294555804067\n20100615 00:00,1119500,0.4626736847889329\n20100616 00:00,1119600,0.46023802898238175\n20100617 00:00,1121400,0.459256187581085\n20100618 00:00,1116600,0.4601545413774333\n20100621 00:00,1114100,0.4608140711134149\n20100622 00:00,1095700,0.4596721363025226\n20100623 00:00,1092600,0.458918593018801\n20100624 00:00,1074700,0.45590520291875697\n20100625 00:00,1079500,0.45450465586487127\n20100628 00:00,1074900,0.45363171445841544\n20100629 00:00,1042000,0.45124528735436625\n20100630 00:00,1032200,0.448523837171796\n20100701 00:00,1028100,0.44979163553329693\n20100702 00:00,1022000,0.44814609537923117\n20100706 00:00,1028600,0.44771751324775005\n20100707 00:00,1061500,0.44116248601522046\n20100708 00:00,1071700,0.43272997085182624\n20100709 00:00,1079300,0.4259352865457023\n20100712 00:00,1080300,0.4218894566021486\n20100713 00:00,1096600,0.4170782837979976\n20100714 00:00,1096700,0.4141104844689195\n20100715 00:00,1096800,0.4116084715236064\n20100716 00:00,1066300,0.409091086240003\n20100719 00:00,1072900,0.40719502569619337\n20100720 00:00,1084800,0.4066073331995649\n20100721 00:00,1070700,0.40660578771727895\n20100722 00:00,1094800,0.40761050973886004\n20100723 00:00,1104100,0.4072215021637396\n20100726 00:00,1115700,0.4072824432502115\n20100727 00:00,1115500,0.408541110017359\n20100728 00:00,1108000,0.4101641661664582\n20100729 00:00,1102900,0.411646603030168\n20100730 00:00,1102700,0.41291844859720017\n20100802 00:00,1127600,0.41441503619890024\n20100803 00:00,1122200,0.41510289550053314\n20100804 00:00,1129700,0.4157517931222832\n20100805 00:00,1128500,0.41643663875217823\n20100806 00:00,1124100,0.4170235045270033\n20100809 00:00,1130100,0.41835651780114336\n20100810 00:00,1123900,0.41913578209982943\n20100811 00:00,1093000,0.41613207006048614\n20100812 00:00,1086000,0.41233334885016687\n20100813 00:00,1082800,0.41136640135368563\n20100816 00:00,1082600,0.41020525594043755\n20100817 00:00,1095900,0.410370521555769\n20100818 00:00,1097800,0.4106343129666439\n20100819 00:00,1078800,0.4116101333338966\n20100820 00:00,1075300,0.41170119626209273\n20100823 00:00,1071300,0.41227171876682284\n20100824 00:00,1055600,0.41301222207532756\n20100825 00:00,1058800,0.4145826837328041\n20100826 00:00,1052300,0.4171048077034937\n20100827 00:00,1068200,0.4198632292703496\n20100830 00:00,1053400,0.4246987694473759\n20100831 00:00,1054700,0.42771897520908414\n20100901 00:00,1084400,0.42585163649027913\n20100902 00:00,1094700,0.42324276121901216\n20100903 00:00,1109200,0.4203651023682504\n20100907 00:00,1096800,0.42034004935506114\n20100908 00:00,1104100,0.42048749076242153\n20100909 00:00,1109400,0.4206325471449141\n20100910 00:00,1115400,0.4208762689438211\n20100913 00:00,1127200,0.42165229984238295\n20100914 00:00,1126500,0.4231202199915913\n20100915 00:00,1131400,0.42481003704641174\n20100916 00:00,1131000,0.42684395442084794\n20100917 00:00,1125100,0.4289292143477097\n20100920 00:00,1142300,0.43212951537717115\n20100921 00:00,1140000,0.43515504342217765\n20100922 00:00,1134300,0.43885548055192236\n20100923 00:00,1125000,0.4403821744853757\n20100924 00:00,1147900,0.44272409358838355\n20100927 00:00,1143200,0.4439635947343269\n20100928 00:00,1146700,0.4468737465002369\n20100929 00:00,1144100,0.4498723848961866\n20100930 00:00,1141200,0.4514263677187686\n20101001 00:00,1146100,0.45215707303011743\n20101004 00:00,1137500,0.4543413001859609\n20101005 00:00,1160500,0.45601754054058197\n20101006 00:00,1160600,0.4564539120983223\n20101007 00:00,1158900,0.45748173776950096\n20101008 00:00,1165600,0.4581042890088608\n20101011 00:00,1166600,0.45851132293512603\n20101012 00:00,1169900,0.45896228615457163\n20101013 00:00,1178800,0.45976086339606653\n20101014 00:00,1175500,0.4596104970397832\n20101015 00:00,1177200,0.45974150460750995\n20101018 00:00,1185500,0.4602493374796193\n20101019 00:00,1167100,0.46107998089107205\n20101020 00:00,1178700,0.4624373727115323\n20101021 00:00,1181200,0.4635076465282117\n20101022 00:00,1183800,0.46713627047478046\n20101025 00:00,1186900,0.46970683229068083\n20101026 00:00,1187300,0.47121094069801395\n20101027 00:00,1183800,0.4717498939568619\n20101028 00:00,1184000,0.47041755608063535\n20101029 00:00,1185300,0.47126780295920717\n20101101 00:00,1185300,0.470618661485957\n20101102 00:00,1194900,0.47054759898011256\n20101103 00:00,1200100,0.47146210002907823\n20101104 00:00,1222600,0.47207811729701665\n20101105 00:00,1227400,0.4720358566689212\n20101108 00:00,1225400,0.47310073765764393\n20101109 00:00,1216000,0.4732895729724599\n20101110 00:00,1220900,0.47391098594043046\n20101111 00:00,1216600,0.474422036217167\n20101112 00:00,1201800,0.47443523364914675\n20101115 00:00,1200400,0.473912477371741\n20101116 00:00,1181200,0.4712725413926135\n20101117 00:00,1182100,0.46988484345856035\n20101118 00:00,1200200,0.4697592913909836\n20101119 00:00,1202600,0.469288061580876\n20101122 00:00,1201900,0.4694773445631051\n20101123 00:00,1184200,0.4692310805552804\n20101124 00:00,1201900,0.4696590073052201\n20101126 00:00,1192700,0.47008803483834555\n20101129 00:00,1191600,0.47069231408759715\n20101130 00:00,1184800,0.4711414385039641\n20101201 00:00,1210000,0.4707633731746229\n20101202 00:00,1225700,0.46767320811726476\n20101203 00:00,1228600,0.46539136912275714\n20101206 00:00,1227400,0.4647095103805409\n20101207 00:00,1228300,0.4642863856450674\n20101208 00:00,1232900,0.4641675381609452\n20101209 00:00,1238200,0.46430204371653355\n20101210 00:00,1245000,0.4646278249666642\n20101213 00:00,1245600,0.4653833625154527\n20101214 00:00,1246500,0.4668479699871981\n20101215 00:00,1241200,0.4678923811649702\n20101216 00:00,1248200,0.46919529437584123\n20101217 00:00,1243800,0.46992278096197043\n20101220 00:00,1245700,0.4709418250870123\n20101221 00:00,1253900,0.472024273078195\n20101222 00:00,1257900,0.4730449155788699\n20101223 00:00,1256100,0.47384979176319336\n20101227 00:00,1256500,0.4744399806789099\n20101228 00:00,1258000,0.47488256753355224\n20101229 00:00,1259200,0.4751172216271694\n20101230 00:00,1257200,0.47479739316260333\n20101231 00:00,1257800,0.47577711814938023\n20110103 00:00,1270100,0.4745893734402771\n20110104 00:00,1269300,0.4731093783221038\n20110105 00:00,1276400,0.47119363605948766\n20110106 00:00,1273900,0.4685971660335564\n20110107 00:00,1271300,0.4652889803338159\n20110110 00:00,1270100,0.46160037672435095\n20110111 00:00,1274300,0.45900316294556964\n20110112 00:00,1286400,0.45580744253556166\n20110113 00:00,1284500,0.4532923299304455\n20110114 00:00,1292800,0.4520992367842383\n20110118 00:00,1295300,0.454732975240783\n20110119 00:00,1282700,0.45798405997222624\n20110120 00:00,1281400,0.45812678909909144\n20110121 00:00,1283600,0.457923572556302\n20110124 00:00,1291600,0.4582237340989068\n20110125 00:00,1291600,0.4587391062187326\n20110126 00:00,1296900,0.46006746999556725\n20110127 00:00,1300300,0.4606158981728892\n20110128 00:00,1277200,0.46094931440062564\n20110131 00:00,1286700,0.46178695264497754\n20110201 00:00,1307100,0.4656853369931788\n20110202 00:00,1304800,0.46846799746645335\n20110203 00:00,1307600,0.467199454176312\n20110204 00:00,1311700,0.4659899154787504\n20110207 00:00,1320000,0.46485312910683296\n20110208 00:00,1325900,0.46374874125019605\n20110209 00:00,1323200,0.463259664488317\n20110210 00:00,1323300,0.46291645939595316\n20110211 00:00,1331500,0.4630497158976905\n20110214 00:00,1334300,0.46272177991529934\n20110215 00:00,1330400,0.46235402396019737\n20110216 00:00,1338200,0.4624441726464149\n20110217 00:00,1342200,0.46282318009557294\n20110218 00:00,1345700,0.46285591987110786\n20110222 00:00,1318000,0.4598849356652244\n20110223 00:00,1310100,0.45533346464053304\n20110224 00:00,1309200,0.4523205464539835\n20110225 00:00,1323200,0.4511828766590629\n20110228 00:00,1331500,0.4499125368724845\n20110301 00:00,1308900,0.44906726728286234\n20110302 00:00,1311600,0.44859771118772107\n20110303 00:00,1334700,0.4478180244360034\n20110304 00:00,1324700,0.44738514328109513\n20110307 00:00,1313700,0.446911375052694\n20110308 00:00,1325600,0.4468532703102865\n20110309 00:00,1323900,0.44678657491329543\n20110310 00:00,1299300,0.4460336821950913\n20110311 00:00,1308400,0.4459895511638207\n20110314 00:00,1300500,0.44625981009083665\n20110315 00:00,1285600,0.4458065453273576\n20110316 00:00,1262100,0.4437464399221421\n20110317 00:00,1278500,0.4443748460718058\n20110318 00:00,1277600,0.4450948150188167\n20110321 00:00,1297400,0.444154895557342\n20110322 00:00,1293000,0.44408188829250334\n20110323 00:00,1296400,0.44373275321742184\n20110324 00:00,1309000,0.44231181994297575\n20110325 00:00,1312900,0.4408193234015642\n20110328 00:00,1309400,0.4403503486814266\n20110329 00:00,1318600,0.43971570285660855\n20110330 00:00,1327000,0.43916848085528615\n20110331 00:00,1325100,0.4390648958250244\n20110401 00:00,1331500,0.4390850941033353\n20110404 00:00,1332400,0.439416518476721\n20110405 00:00,1332400,0.44039534037833533\n20110406 00:00,1336600,0.4411616205804777\n20110407 00:00,1333200,0.4408418981798566\n20110408 00:00,1328600,0.44015239960620545\n20110411 00:00,1324700,0.438856580634957\n20110412 00:00,1314500,0.4360063680369128\n20110413 00:00,1314500,0.4328886206328763\n20110414 00:00,1315600,0.4312523717084801\n20110415 00:00,1321200,0.4290696385628946\n20110418 00:00,1305300,0.4249410893768713\n20110419 00:00,1312800,0.42098739563193005\n20110420 00:00,1331600,0.4144313616125813\n20110421 00:00,1337400,0.40676189433710264\n20110425 00:00,1336200,0.39783241841328637\n20110426 00:00,1347900,0.3911349006291517\n20110427 00:00,1356300,0.38142274853745045\n20110428 00:00,1360400,0.371645925193515\n20110429 00:00,1365400,0.36439087014958116\n20110502 00:00,1362500,0.35975372262353195\n20110503 00:00,1357100,0.35696456933635756\n20110504 00:00,1348600,0.3532448608990777\n20110505 00:00,1336300,0.35122846350545234\n20110506 00:00,1342000,0.3555969866288967\n20110509 00:00,1347200,0.3469565542615172\n20110510 00:00,1358700,0.3386408692729019\n20110511 00:00,1344500,0.33247889470687175\n20110512 00:00,1351000,0.3283985886814914\n20110513 00:00,1340400,0.3263766084377881\n20110516 00:00,1331900,0.3275240666787633\n20110517 00:00,1331700,0.33156092008809573\n20110518 00:00,1343800,0.3343116157743393\n20110519 00:00,1346600,0.3342029861069868\n20110520 00:00,1336700,0.33580865987867786\n20110523 00:00,1320400,0.3370782116035944\n20110524 00:00,1319500,0.3397777743873582\n20110525 00:00,1323700,0.34266881711209185\n20110526 00:00,1330100,0.34663880076249115\n20110527 00:00,1335400,0.3483733272310969\n20110531 00:00,1348900,0.3485471409548116\n20110601 00:00,1318500,0.35244673545579724\n20110602 00:00,1316900,0.35508051368283144\n20110603 00:00,1304000,0.35388146637390727\n20110606 00:00,1290500,0.35608896245133265\n20110607 00:00,1288500,0.35981761976619436\n20110608 00:00,1284000,0.3685413681646516\n20110609 00:00,1294000,0.36905511560583887\n20110610 00:00,1275600,0.37160465486952154\n20110613 00:00,1276700,0.37466839131900054\n20110614 00:00,1293200,0.37278973458858644\n20110615 00:00,1270200,0.37578705291897424\n20110616 00:00,1272800,0.37965847585372287\n20110617 00:00,1270200,0.3862065480672913\n20110620 00:00,1277000,0.39401064915128253\n20110621 00:00,1294200,0.3980818483276897\n20110622 00:00,1287000,0.40527127376435257\n20110623 00:00,1282900,0.412130448823726\n20110624 00:00,1268100,0.4236419475036608\n20110627 00:00,1279400,0.4346424556061528\n20110628 00:00,1296100,0.4340210214199563\n20110629 00:00,1307500,0.4302589198179435\n20110630 00:00,1319700,0.4266164699467723\n20110701 00:00,1339600,0.4246414660635448\n20110705 00:00,1337100,0.4266720583719602\n20110706 00:00,1339400,0.4263410154460461\n20110707 00:00,1354600,0.4268240743669267\n20110708 00:00,1344000,0.42886237523043386\n20110711 00:00,1319600,0.42612825834416196\n20110712 00:00,1314300,0.42371332386500893\n20110713 00:00,1318500,0.42510030198748766\n20110714 00:00,1309400,0.42467688457925207\n20110715 00:00,1317400,0.42482489346573316\n20110718 00:00,1305800,0.4245160286202308\n20110719 00:00,1327800,0.4254500663008815\n20110720 00:00,1326500,0.4299244797124112\n20110721 00:00,1345200,0.4294438677250993\n20110722 00:00,1346100,0.42789904001236784\n20110725 00:00,1338300,0.4263506739171585\n20110726 00:00,1333600,0.42379085483915413\n20110727 00:00,1306000,0.41795531647275214\n20110728 00:00,1301600,0.41347878553113865\n20110729 00:00,1290500,0.4101317250463633\n20110801 00:00,1287100,0.4037142762591532\n20110802 00:00,1254900,0.39624403887211074\n20110803 00:00,1262100,0.3922839827987087\n20110804 00:00,1201800,0.3855485557503893\n20110805 00:00,1199800,0.3837438779455399\n20110808 00:00,1122600,0.37991434055942364\n20110809 00:00,1173700,0.3941875452551859\n20110810 00:00,1123500,0.41410307779748057\n20110811 00:00,1172800,0.429555397021859\n20110812 00:00,1181500,0.4396947737348605\n20110815 00:00,1205500,0.44416990572766174\n20110816 00:00,1195600,0.45535796872431694\n20110817 00:00,1196700,0.4673831259846576\n20110818 00:00,1146100,0.48001312241115324\n20110819 00:00,1126800,0.48703495737820185\n20110822 00:00,1127300,0.495545023104354\n20110823 00:00,1164600,0.4986323192474119\n20110824 00:00,1181300,0.4960509723875047\n20110825 00:00,1163100,0.49773085683079976\n20110826 00:00,1180400,0.4978942573332629\n20110829 00:00,1213800,0.49337881822462626\n20110830 00:00,1216200,0.4912129859799415\n20110831 00:00,1220600,0.48927170362091194\n20110901 00:00,1209600,0.4885761924332078\n20110902 00:00,1178400,0.4853507531150334\n20110906 00:00,1169900,0.4814179977650251\n20110907 00:00,1202700,0.4813502917206976\n20110908 00:00,1190200,0.48114673872230646\n20110909 00:00,1158600,0.47781037066422566\n20110912 00:00,1166600,0.4761252551599523\n20110913 00:00,1175800,0.4754294133759176\n20110914 00:00,1193600,0.47434013584812\n20110915 00:00,1214700,0.4715718668814069\n20110916 00:00,1215800,0.4700709473617686\n20110919 00:00,1203100,0.4700148616879974\n20110920 00:00,1201700,0.4697617369302062\n20110921 00:00,1165100,0.4661806353048344\n20110922 00:00,1128000,0.45581248619558945\n20110923 00:00,1135400,0.4513896043931011\n20110926 00:00,1162500,0.44931677613133403\n20110927 00:00,1176000,0.4463656209457524\n20110928 00:00,1151600,0.44603209511846753\n20110929 00:00,1160200,0.44555556361509374\n20110930 00:00,1131700,0.44527213429453283\n20111003 00:00,1099300,0.4420121583891737\n20111004 00:00,1121300,0.44239028512182627\n20111005 00:00,1145000,0.44104191456315045\n20111006 00:00,1165100,0.43718543169487983\n20111007 00:00,1157500,0.43558691112430165\n20111010 00:00,1195900,0.4301500319556243\n20111011 00:00,1196800,0.425439792088314\n20111012 00:00,1206700,0.42206778722958993\n20111013 00:00,1204700,0.42033840292114377\n20111014 00:00,1225600,0.4190874924712365\n20111017 00:00,1202400,0.4194557647091559\n20111018 00:00,1226100,0.4209339316312711\n20111019 00:00,1211400,0.4225176888312061\n20111020 00:00,1216900,0.424788454092757\n20111021 00:00,1239100,0.4276825611485431\n20111024 00:00,1254900,0.4303624932076133\n20111025 00:00,1230800,0.4334924389158132\n20111026 00:00,1243300,0.437598188884223\n20111027 00:00,1285300,0.4416395219404002\n20111028 00:00,1286800,0.44639712510641566\n20111031 00:00,1254500,0.4507627665944558\n20111101 00:00,1220800,0.44780303883060474\n20111102 00:00,1239900,0.4485184434238825\n20111103 00:00,1262400,0.4486437547101286\n20111104 00:00,1254500,0.4491691284609811\n20111107 00:00,1262800,0.4498831541534135\n20111108 00:00,1278600,0.45044103087133125\n20111109 00:00,1231900,0.45024801114304985\n20111110 00:00,1243200,0.4501850935135249\n20111111 00:00,1266200,0.4499403572327144\n20111114 00:00,1254600,0.44972887966013714\n20111115 00:00,1261200,0.44909360483378385\n20111116 00:00,1240500,0.44799005043834067\n20111117 00:00,1221800,0.4456420888993334\n20111118 00:00,1219900,0.4443331514557091\n20111121 00:00,1196200,0.4421226016330498\n20111122 00:00,1191900,0.4400628255103308\n20111123 00:00,1165600,0.43864800700585094\n20111125 00:00,1162000,0.4386209334465985\n20111128 00:00,1197000,0.4389861578518808\n20111129 00:00,1200800,0.43945704101032285\n20111130 00:00,1251100,0.43199604624776267\n20111201 00:00,1249800,0.4260841428407616\n20111202 00:00,1248600,0.4228339273344396\n20111205 00:00,1262100,0.4199249570064067\n20111206 00:00,1262600,0.41820934575374913\n20111207 00:00,1267500,0.41732620807981263\n20111208 00:00,1239800,0.4165422669831497\n20111209 00:00,1260300,0.4168432495777033\n20111212 00:00,1242400,0.41678575750014885\n20111213 00:00,1231100,0.41585203828379314\n20111214 00:00,1217100,0.41407303810622403\n20111215 00:00,1221500,0.4132974423180994\n20111216 00:00,1215700,0.41258655136326106\n20111219 00:00,1203200,0.4115407360044418\n20111220 00:00,1238800,0.41151221271587995\n20111221 00:00,1241700,0.4107418058780081\n20111222 00:00,1253300,0.4100467247690646\n20111223 00:00,1263900,0.40893402904419185\n20111227 00:00,1264900,0.40795906266286586\n20111228 00:00,1249200,0.40736572211909355\n20111229 00:00,1261000,0.40696522217439773\n20111230 00:00,1255000,0.4067422281610387\n20120103 00:00,1274900,0.40645462938974164\n20120104 00:00,1276300,0.4061591232053514\n20120105 00:00,1281000,0.4063642543433135\n20120106 00:00,1278200,0.4068056125009516\n20120109 00:00,1279900,0.40745612524114744\n20120110 00:00,1291300,0.4084465639040606\n20120111 00:00,1292500,0.4095233609679668\n20120112 00:00,1295100,0.41084665679014026\n20120113 00:00,1290100,0.41190356637297054\n20120117 00:00,1293100,0.41307093888570645\n20120118 00:00,1308000,0.41442398458623025\n20120119 00:00,1314800,0.4149285062277897\n20120120 00:00,1319500,0.4151866527327607\n20120123 00:00,1315800,0.4154204191864172\n20120124 00:00,1314600,0.4157863574175614\n20120125 00:00,1325700,0.416500694625318\n20120126 00:00,1319000,0.41743453706410627\n20120127 00:00,1317300,0.4181476349832166\n20120130 00:00,1313800,0.4190974810435455\n20120131 00:00,1312100,0.4196925693107238\n20120201 00:00,1324700,0.42024780963363884\n20120202 00:00,1326800,0.4208097574470332\n20120203 00:00,1345700,0.42127255463061514\n20120206 00:00,1344600,0.42187179191176716\n20120207 00:00,1347900,0.42246027164968913\n20120208 00:00,1351900,0.42307467377426594\n20120209 00:00,1353400,0.42386812061026174\n20120210 00:00,1344300,0.4244922384685948\n20120213 00:00,1353600,0.42512706306768905\n20120214 00:00,1351900,0.42550270007887925\n20120215 00:00,1345400,0.4255759990027547\n20120216 00:00,1360400,0.4257777848084316\n20120217 00:00,1364100,0.4261431515318716\n20120221 00:00,1364600,0.4269924742661082\n20120222 00:00,1360200,0.42712394521826846\n20120223 00:00,1366100,0.42767815219400535\n20120224 00:00,1369300,0.4283894698170914\n20120227 00:00,1371600,0.428646160772998\n20120228 00:00,1375600,0.4288540527486496\n20120229 00:00,1368700,0.4296110470063111\n20120301 00:00,1377700,0.4300050178693241\n20120302 00:00,1373200,0.4305259664418538\n20120305 00:00,1367500,0.4307373654654615\n20120306 00:00,1346700,0.4299808342228059\n20120307 00:00,1356900,0.43098367182971525\n20120308 00:00,1370200,0.43203302761694995\n20120309 00:00,1375700,0.43185423244856935\n20120312 00:00,1375800,0.43303862187830955\n20120313 00:00,1400600,0.43327161261242586\n20120314 00:00,1399100,0.432204330494213\n20120315 00:00,1407200,0.43154505723274106\n20120316 00:00,1402700,0.4313947001664552\n20120319 00:00,1408800,0.43160415930106705\n20120320 00:00,1404100,0.43186310384894977\n20120321 00:00,1401600,0.43242759459598656\n20120322 00:00,1391600,0.4326233581643306\n20120323 00:00,1396900,0.43287238513982595\n20120326 00:00,1416100,0.4332205604516727\n20120327 00:00,1411300,0.433894124694741\n20120328 00:00,1404300,0.4341674145206227\n20120329 00:00,1402200,0.4342465457075165\n20120330 00:00,1407200,0.43450928294566715\n20120402 00:00,1417900,0.434762386455386\n20120403 00:00,1412600,0.4350712057068198\n20120404 00:00,1398400,0.4348296157555257\n20120405 00:00,1397800,0.434816306354326\n20120409 00:00,1382300,0.43430641157117716\n20120410 00:00,1358400,0.4322555756495453\n20120411 00:00,1369000,0.43164872114484637\n20120412 00:00,1388500,0.43069470262274184\n20120413 00:00,1371300,0.43061992384090897\n20120416 00:00,1369300,0.4306604566778498\n20120417 00:00,1390900,0.430415144497682\n20120418 00:00,1385900,0.43134552905919227\n20120419 00:00,1377500,0.4325635552372335\n20120420 00:00,1379500,0.4331517823613193\n20120423 00:00,1367900,0.4339126940656806\n20120424 00:00,1373100,0.4350165269757599\n20120425 00:00,1392400,0.43473887046474263\n20120426 00:00,1401700,0.43352836220363344\n20120427 00:00,1404200,0.4326141787278921\n20120430 00:00,1397700,0.4323830879929554\n20120501 00:00,1407400,0.4323651829029662\n20120502 00:00,1402800,0.4324919538710165\n20120503 00:00,1392500,0.43216319817194593\n20120504 00:00,1369600,0.4307183692831222\n20120507 00:00,1371000,0.4294940531094621\n20120508 00:00,1365000,0.42811523527545753\n20120509 00:00,1357400,0.42662280179717127\n20120510 00:00,1359500,0.4256883468549849\n20120511 00:00,1355600,0.4248579952908905\n20120514 00:00,1341300,0.4239295761704031\n20120515 00:00,1333500,0.4235214362020704\n20120516 00:00,1328800,0.4234256356502712\n20120517 00:00,1308700,0.4230029367701079\n20120518 00:00,1297400,0.42315285908154765\n20120521 00:00,1320200,0.4237477343118476\n20120522 00:00,1322000,0.4247010678052244\n20120523 00:00,1322700,0.42617803688482897\n20120524 00:00,1325300,0.42743557110546276\n20120525 00:00,1321000,0.42874933079878613\n20120529 00:00,1337000,0.4290571863608874\n20120530 00:00,1317300,0.43170157330027853\n20120531 00:00,1314900,0.4329989505085544\n20120601 00:00,1281600,0.43380899685953667\n20120604 00:00,1281000,0.43401041909986166\n20120605 00:00,1290300,0.434547642535012\n20120606 00:00,1320200,0.433133694099539\n20120607 00:00,1320500,0.4314689181245577\n20120608 00:00,1331200,0.4301369117098218\n20120611 00:00,1314500,0.42910779934265963\n20120612 00:00,1330100,0.4277172309922732\n20120613 00:00,1321000,0.4275544934196767\n20120614 00:00,1335700,0.42622683498380987\n20120615 00:00,1341000,0.42502913965121897\n20120618 00:00,1344300,0.42442244981484983\n20120619 00:00,1356900,0.4236723925864687\n20120620 00:00,1354400,0.42405818456637445\n20120621 00:00,1324400,0.4232885523718411\n20120622 00:00,1334200,0.42307631329893763\n20120625 00:00,1312600,0.42332985192187855\n20120626 00:00,1320000,0.42457026024023387\n20120627 00:00,1331700,0.42594147837588187\n20120628 00:00,1327900,0.42732137595372766\n20120629 00:00,1362700,0.4270959853013297\n20120702 00:00,1364600,0.4258626663733169\n20120703 00:00,1374700,0.42483566486837654\n20120705 00:00,1368400,0.42409160642425997\n20120706 00:00,1355900,0.4233093303419841\n20120709 00:00,1353200,0.42123353564058985\n20120710 00:00,1341400,0.41683628514140103\n20120711 00:00,1341600,0.41201917660482806\n20120712 00:00,1335100,0.40497354724673196\n20120713 00:00,1357500,0.3984411200117994\n20120716 00:00,1353900,0.3901818622616075\n20120717 00:00,1363600,0.38376592877428334\n20120718 00:00,1374100,0.37333544891426745\n20120719 00:00,1377400,0.3630521907854351\n20120720 00:00,1364700,0.3494078838340491\n20120723 00:00,1350900,0.33384023895984405\n20120724 00:00,1340300,0.3181800548861909\n20120725 00:00,1339500,0.3040257488159888\n20120726 00:00,1361700,0.29379970608812517\n20120727 00:00,1388000,0.28386766601815705\n20120730 00:00,1386800,0.2786091704483309\n20120731 00:00,1377100,0.27854699947046924\n20120801 00:00,1375900,0.2824954874890487\n20120802 00:00,1366400,0.2917901674550316\n20120803 00:00,1393900,0.29764027892852885\n20120806 00:00,1396200,0.2998788755712674\n20120807 00:00,1403200,0.3009188747318304\n20120808 00:00,1404900,0.30154747416502853\n20120809 00:00,1406300,0.3063148439978748\n20120810 00:00,1408400,0.3082163080698924\n20120813 00:00,1407700,0.3100519454882752\n20120814 00:00,1407900,0.31439323474333786\n20120815 00:00,1409500,0.32034194755671247\n20120816 00:00,1420100,0.32785796605946993\n20120817 00:00,1422200,0.3295353664860568\n20120820 00:00,1422200,0.3331488700734497\n20120821 00:00,1417600,0.33791063460755905\n20120822 00:00,1418200,0.3395585192113033\n20120823 00:00,1406800,0.33951345839754116\n20120824 00:00,1415200,0.3431710414525233\n20120827 00:00,1415400,0.34414286081494094\n20120828 00:00,1414000,0.3425454774917691\n20120829 00:00,1415100,0.34130595606229863\n20120830 00:00,1404900,0.34129075292642086\n20120831 00:00,1412400,0.34029606650625316\n20120904 00:00,1408700,0.3389374381031516\n20120905 00:00,1409400,0.3377429372226301\n20120906 00:00,1437800,0.3346061812048985\n20120907 00:00,1443900,0.33023197161627293\n20120910 00:00,1435100,0.33079819278487943\n20120911 00:00,1438900,0.3315377069349565\n20120912 00:00,1443900,0.3321651139705695\n20120913 00:00,1467000,0.3303454898588091\n20120914 00:00,1472400,0.3297729911317997\n20120917 00:00,1467400,0.33333279083695344\n20120918 00:00,1466200,0.3394656178881064\n20120919 00:00,1467400,0.3492288704217566\n20120920 00:00,1467500,0.35109416448913283\n20120921 00:00,1458900,0.3507542783855511\n20120924 00:00,1455900,0.34972973022439396\n20120925 00:00,1441900,0.34868800398245214\n20120926 00:00,1432900,0.3501842962584601\n20120927 00:00,1447200,0.3497354670834061\n20120928 00:00,1439300,0.3517580217112787\n20121001 00:00,1442400,0.3452216810037476\n20121002 00:00,1445000,0.3393937999243087\n20121003 00:00,1450700,0.33544089464030874\n20121004 00:00,1462700,0.3314296300871755\n20121005 00:00,1461300,0.32901798740694027\n20121008 00:00,1456600,0.3279175614996866\n20121009 00:00,1442500,0.3264725217439407\n20121010 00:00,1432800,0.32480285858000485\n20121011 00:00,1433600,0.3246415301739243\n20121012 00:00,1428400,0.32476125563147684\n20121015 00:00,1440100,0.3254068070526389\n20121016 00:00,1455800,0.3245491029452542\n20121017 00:00,1461600,0.3237905139414576\n20121018 00:00,1458600,0.3254847735658664\n20121019 00:00,1433000,0.32744440710207223\n20121022 00:00,1434100,0.32739067737143274\n20121023 00:00,1413500,0.3257482986316875\n20121024 00:00,1410500,0.32926348914624065\n20121025 00:00,1414300,0.329957052927132\n20121026 00:00,1413500,0.32741090459962124\n20121031 00:00,1411800,0.3271177441540538\n20121101 00:00,1429100,0.32281420223795165\n20121102 00:00,1415600,0.32714575747768304\n20121105 00:00,1419000,0.3269272042147996\n20121106 00:00,1429300,0.32332163501283523\n20121107 00:00,1397800,0.3232163234981947\n20121108 00:00,1379500,0.32143090647355976\n20121109 00:00,1381600,0.32235917747471976\n20121112 00:00,1382400,0.3269654650867611\n20121113 00:00,1378000,0.33147352631922866\n20121114 00:00,1359800,0.3392110033014757\n20121115 00:00,1357000,0.34824857691857936\n20121116 00:00,1363500,0.36095968230378483\n20121119 00:00,1391500,0.3660242119408952\n20121120 00:00,1392800,0.3689384130851475\n20121121 00:00,1394500,0.37333853073178574\n20121123 00:00,1413300,0.37311996622790905\n20121126 00:00,1411700,0.37382442457217246\n20121127 00:00,1403800,0.3788171841199447\n20121128 00:00,1414800,0.38901040083663596\n20121129 00:00,1421600,0.3961594761876742\n20121130 00:00,1420600,0.4033538912853997\n20121203 00:00,1414700,0.40348841990117906\n20121204 00:00,1412200,0.4040004334641321\n20121205 00:00,1415000,0.4051359421504031\n20121206 00:00,1419100,0.40687129722909404\n20121207 00:00,1424000,0.4100140430732784\n20121210 00:00,1425200,0.41405453076000714\n20121211 00:00,1434200,0.4158217349020097\n20121212 00:00,1435400,0.4222472016346304\n20121213 00:00,1426600,0.4250624954621557\n20121214 00:00,1421200,0.4246030975876898\n20121217 00:00,1437900,0.42339417707369187\n20121218 00:00,1454100,0.4212877564485335\n20121219 00:00,1442700,0.4204451499343224\n20121220 00:00,1451400,0.4216665801986055\n20121221 00:00,1427700,0.4191909914205089\n20121224 00:00,1423300,0.4156467089311015\n20121226 00:00,1416500,0.4120668903786436\n20121227 00:00,1415900,0.4099280818687353\n20121228 00:00,1398700,0.40644840196571724\n20121231 00:00,1425200,0.40436978918337524\n20130102 00:00,1461500,0.3955637842486624\n20130103 00:00,1457300,0.39024904247464304\n20130104 00:00,1464500,0.38630451123945714\n20130107 00:00,1459200,0.384022869549504\n20130108 00:00,1455300,0.38225870224342146\n20130109 00:00,1459900,0.3809813616136636\n20130110 00:00,1470700,0.37983426130812536\n20130111 00:00,1470700,0.37924754314319037\n20130114 00:00,1469600,0.37898517102299506\n20130115 00:00,1470700,0.37906318885162105\n20130116 00:00,1470500,0.3794655967013563\n20130117 00:00,1479700,0.38048204718964884\n20130118 00:00,1483300,0.38150591131826805\n20130122 00:00,1491000,0.3829881570784535\n20130123 00:00,1493700,0.38507041438433615\n20130124 00:00,1494200,0.3869583661800578\n20130125 00:00,1502500,0.388875266521846\n20130128 00:00,1500700,0.3912316845074713\n20130129 00:00,1506600,0.3928665972356864\n20130130 00:00,1500800,0.3932845350941581\n20130131 00:00,1497000,0.39307608383656506\n20130201 00:00,1512800,0.39439505784723644\n20130204 00:00,1495300,0.39476931347247257\n20130205 00:00,1510800,0.39578863442007506\n20130206 00:00,1511800,0.39619774833254234\n20130207 00:00,1509600,0.3965939114958245\n20130208 00:00,1518000,0.3971588538084574\n20130211 00:00,1517700,0.39779309927721684\n20130212 00:00,1520000,0.3983731695031989\n20130213 00:00,1521500,0.39894135003744585\n20130214 00:00,1523100,0.39940448815610635\n20130215 00:00,1521700,0.3995789803608174\n20130219 00:00,1532000,0.40004466176432846\n20130220 00:00,1512600,0.39927122082704947\n20130221 00:00,1504000,0.3969121910578907\n20130222 00:00,1518900,0.3962175762599008\n20130225 00:00,1490100,0.39389968248406226\n20130226 00:00,1500200,0.39246544018467283\n20130227 00:00,1519100,0.39093275651633047\n20130228 00:00,1515300,0.3899404887499053\n20130301 00:00,1521100,0.38935446085627884\n20130304 00:00,1529200,0.38808257397706347\n20130305 00:00,1542900,0.38724137957335725\n20130306 00:00,1545000,0.3869009523670553\n20130307 00:00,1548200,0.3858520159997756\n20130308 00:00,1554400,0.38597721899692794\n20130311 00:00,1560300,0.38673599175820894\n20130312 00:00,1556400,0.38807401265584596\n20130313 00:00,1558400,0.3904099242394119\n20130314 00:00,1567300,0.3933482522478568\n20130315 00:00,1558800,0.3940326142398616\n20130318 00:00,1549700,0.39358134301986136\n20130319 00:00,1546100,0.39232331555173067\n20130320 00:00,1556300,0.39235394586808464\n20130321 00:00,1543400,0.39128363919294246\n20130322 00:00,1556000,0.3912144287272794\n20130325 00:00,1550700,0.3907117960270233\n20130326 00:00,1561500,0.39166705132629803\n20130327 00:00,1561600,0.3911580617423345\n20130328 00:00,1565500,0.38933544475732823\n20130401 00:00,1560500,0.38788206134366715\n20130402 00:00,1568200,0.38703916966617735\n20130403 00:00,1551500,0.3866774670468572\n20130404 00:00,1558500,0.3865539868825346\n20130405 00:00,1551800,0.3882465025875748\n20130408 00:00,1562100,0.39078276969162834\n20130409 00:00,1567500,0.39265528500598745\n20130410 00:00,1587300,0.39410555434052985\n20130411 00:00,1592200,0.39253286602398935\n20130412 00:00,1587800,0.3931446080745989\n20130415 00:00,1551700,0.3891588987251409\n20130416 00:00,1574200,0.38841498047721784\n20130417 00:00,1550400,0.386293928716199\n20130418 00:00,1541400,0.3826639467332004\n20130419 00:00,1554800,0.38039112972048217\n20130422 00:00,1562000,0.3776221741985923\n20130423 00:00,1577900,0.37381018579046815\n20130424 00:00,1579000,0.3692341543982774\n20130425 00:00,1586100,0.3674410152922805\n20130426 00:00,1582600,0.36526798329216936\n20130429 00:00,1593000,0.3578755423244994\n20130430 00:00,1596800,0.34856342524944894\n20130501 00:00,1583200,0.3389467116731542\n20130502 00:00,1597200,0.3311029407237395\n20130503 00:00,1613200,0.3221978472305208\n20130506 00:00,1617800,0.3153269792262614\n20130507 00:00,1626300,0.3081793910702698\n20130508 00:00,1633400,0.3026717006330966\n20130509 00:00,1629300,0.2977267908490764\n20130510 00:00,1634100,0.29488240322325376\n20130513 00:00,1635400,0.2941712988336914\n20130514 00:00,1652800,0.29639430044740783\n20130515 00:00,1661500,0.30044566236393766\n20130516 00:00,1653400,0.3045269800442623\n20130517 00:00,1669700,0.31029294074402025\n20130520 00:00,1669700,0.3153396719306077\n20130521 00:00,1671100,0.31946220579664625\n20130522 00:00,1659200,0.3228282248347565\n20130523 00:00,1654500,0.3233187357483823\n20130524 00:00,1653300,0.32406895623780907\n20130528 00:00,1663000,0.3262505582278664\n20130529 00:00,1652200,0.3279214032590558\n20130530 00:00,1658900,0.3300271504975316\n20130531 00:00,1632400,0.33295492770714097\n20130603 00:00,1643800,0.3358117880758452\n20130604 00:00,1635600,0.3377702524761519\n20130605 00:00,1611800,0.3367672581367799\n20130606 00:00,1626400,0.34054613066457834\n20130607 00:00,1648100,0.3409706566171537\n20130610 00:00,1648000,0.3403047463728288\n20130611 00:00,1631200,0.34215804723672855\n20130612 00:00,1617500,0.3441070013072912\n20130613 00:00,1642200,0.3461704414359421\n20130614 00:00,1631700,0.3487115519840954\n20130617 00:00,1645000,0.3509649798630461\n20130618 00:00,1656900,0.3504730404204838\n20130619 00:00,1635400,0.3528386619762827\n20130620 00:00,1592700,0.349287048725428\n20130621 00:00,1590500,0.34960099883171797\n20130624 00:00,1569900,0.35093807338519195\n20130625 00:00,1586500,0.3535917670278171\n20130626 00:00,1601700,0.35513365855188833\n20130627 00:00,1611300,0.35690969759470537\n20130628 00:00,1600100,0.36150618360907794\n20130701 00:00,1614000,0.36491949225200426\n20130702 00:00,1611600,0.3696640196043348\n20130703 00:00,1613400,0.37100450049237527\n20130705 00:00,1630500,0.3706562283886259\n20130708 00:00,1639400,0.3707808388145485\n20130709 00:00,1650800,0.37008150979123583\n20130710 00:00,1652100,0.36982884675966154\n20130711 00:00,1675100,0.3681996103036631\n20130712 00:00,1675100,0.36755657381889884\n20130715 00:00,1682200,0.368608019906954\n20130716 00:00,1675000,0.3710398532677169\n20130717 00:00,1679700,0.37422418182922595\n20130718 00:00,1688800,0.37908211584748386\n20130719 00:00,1692300,0.384926819460412\n20130722 00:00,1695000,0.39229377274675203\n20130723 00:00,1691400,0.4003567120654416\n20130724 00:00,1685500,0.4042533647607006\n20130725 00:00,1689300,0.4062035487062784\n20130726 00:00,1691100,0.40902605451172186\n20130729 00:00,1685300,0.41328415378648653\n20130730 00:00,1686000,0.4143051540480621\n20130731 00:00,1686600,0.41578679927763335\n20130801 00:00,1706500,0.41707367206463636\n20130802 00:00,1709500,0.4172569904693447\n20130805 00:00,1708000,0.4180680805297438\n20130806 00:00,1697300,0.42017165132118917\n20130807 00:00,1691800,0.4193093317823358\n20130808 00:00,1698100,0.4191089983186205\n20130809 00:00,1693000,0.4186589223189264\n20130812 00:00,1691000,0.4182111171241025\n20130813 00:00,1696900,0.4180380652133477\n20130814 00:00,1687400,0.41790442933579774\n20130815 00:00,1662700,0.41543672159048833\n20130816 00:00,1658700,0.41351619483905383\n20130819 00:00,1647600,0.4124259426532007\n20130820 00:00,1655900,0.41319647246393104\n20130821 00:00,1645600,0.4151579711275943\n20130822 00:00,1660600,0.41717417427272435\n20130823 00:00,1666700,0.4180712651610311\n20130826 00:00,1659700,0.42002327254799154\n20130827 00:00,1632900,0.42139614665568126\n20130828 00:00,1639100,0.4238061454798565\n20130829 00:00,1642200,0.4268795549356348\n20130830 00:00,1636500,0.43039604422954464\n20130903 00:00,1643800,0.433158285710493\n20130904 00:00,1657600,0.4339153600207033\n20130905 00:00,1658600,0.43518702200011544\n20130906 00:00,1660400,0.4381809220239426\n20130909 00:00,1676700,0.4399409259327639\n20130910 00:00,1688400,0.4376954995334133\n20130911 00:00,1693700,0.4361416316581057\n20130912 00:00,1690400,0.4371546058814573\n20130913 00:00,1693300,0.4393812724039492\n20130916 00:00,1703800,0.44129040487706117\n20130917 00:00,1710700,0.44099817998613483\n20130918 00:00,1731400,0.4401936978663213\n20130919 00:00,1728100,0.44099960158669227\n20130920 00:00,1706200,0.44076823156755585\n20130923 00:00,1699400,0.4395271521926871\n20130924 00:00,1695700,0.4392418239175092\n20130925 00:00,1691100,0.4387509757833908\n20130926 00:00,1696900,0.43920393261111945\n20130927 00:00,1689500,0.4382015963439662\n20130930 00:00,1681000,0.436768523064135\n20131001 00:00,1694000,0.4357739294769932\n20131002 00:00,1691100,0.4351574838982187\n20131003 00:00,1676200,0.4340579829888515\n20131004 00:00,1688900,0.4336866234306194\n20131007 00:00,1674200,0.4329868760282894\n20131008 00:00,1654800,0.4310836950242725\n20131009 00:00,1655700,0.43139421171389375\n20131010 00:00,1692400,0.42938848280274455\n20131011 00:00,1703000,0.4233826003834735\n20131014 00:00,1710400,0.41853384605844096\n20131015 00:00,1697200,0.416636272516739\n20131016 00:00,1720500,0.4143639495324986\n20131017 00:00,1732700,0.40781412587984317\n20131018 00:00,1743600,0.3994750968326648\n20131021 00:00,1744500,0.393708844365464\n20131022 00:00,1753500,0.3897315047837944\n20131023 00:00,1746200,0.38712162300269687\n20131024 00:00,1752400,0.385443597878605\n20131025 00:00,1759300,0.3854171667299061\n20131028 00:00,1762400,0.38653821292091717\n20131029 00:00,1772200,0.3884431078698084\n20131030 00:00,1763300,0.39064165747055546\n20131031 00:00,1757300,0.3922055137703445\n20131101 00:00,1761400,0.39526157220521774\n20131104 00:00,1768600,0.3998061719292095\n20131105 00:00,1762800,0.40562395193475653\n20131106 00:00,1771800,0.41629715455056826\n20131107 00:00,1749700,0.4176482320986669\n20131108 00:00,1773100,0.41884616148325127\n20131111 00:00,1772900,0.4197932366548846\n20131112 00:00,1769800,0.42164351593950905\n20131113 00:00,1783200,0.4223499218878452\n20131114 00:00,1793200,0.4216020047477074\n20131115 00:00,1801200,0.42277124197289295\n20131118 00:00,1795000,0.4245535731516845\n20131119 00:00,1790300,0.42430622878625224\n20131120 00:00,1785100,0.42409877758130965\n20131121 00:00,1799700,0.4243628227140097\n20131122 00:00,1808100,0.4241250229328217\n20131125 00:00,1807100,0.4240520233912292\n20131126 00:00,1806400,0.42444228710776855\n20131127 00:00,1811200,0.4245553263132354\n20131129 00:00,1809300,0.4245325459386839\n20131202 00:00,1805400,0.4241178014874323\n20131203 00:00,1798500,0.4229809435918825\n20131204 00:00,1796700,0.4220060785063755\n20131205 00:00,1790100,0.42078523190428885\n20131206 00:00,1809500,0.42052231187543326\n20131209 00:00,1814000,0.41958197845085793\n20131210 00:00,1807500,0.419387109209453\n20131211 00:00,1787200,0.4181469907244757\n20131212 00:00,1781300,0.41675752415418343\n20131213 00:00,1781100,0.4168651801162339\n20131216 00:00,1792200,0.41877424098194577\n20131217 00:00,1785400,0.4202152610430177\n20131218 00:00,1817000,0.4209536351225766\n20131219 00:00,1815000,0.4214382659116902\n20131220 00:00,1815800,0.4253182587306797\n20131223 00:00,1825400,0.4249039516020875\n20131224 00:00,1829300,0.42428810311251725\n20131226 00:00,1838400,0.4235243209055406\n20131227 00:00,1838400,0.42371018872066146\n20131230 00:00,1838200,0.4305365633420866\n20131231 00:00,1846700,0.4320609531540627\n20140102 00:00,1829200,0.43171699837664623\n20140103 00:00,1828800,0.4305241537581938\n20140106 00:00,1823600,0.42961227985602674\n20140107 00:00,1834300,0.4293664527849425\n20140108 00:00,1835200,0.4292672995157574\n20140109 00:00,1836400,0.4292223333722247\n20140110 00:00,1841400,0.4295213004045854\n20140113 00:00,1816600,0.427853776531247\n20140114 00:00,1837200,0.42787648458933947\n20140115 00:00,1846900,0.42691229628177546\n20140116 00:00,1843900,0.42692909045084826\n20140117 00:00,1836500,0.4268330374183068\n20140121 00:00,1841800,0.42686555209589927\n20140122 00:00,1843000,0.42689392267840315\n20140123 00:00,1827900,0.42662214859239056\n20140124 00:00,1788300,0.419540723068517\n20140127 00:00,1780100,0.4128327438650864\n20140128 00:00,1791000,0.41192463304490085\n20140129 00:00,1772800,0.41268012885515715\n20140130 00:00,1792300,0.41464511426332795\n20140131 00:00,1781800,0.4177741943803197\n20140203 00:00,1741500,0.41957791533663513\n20140204 00:00,1753600,0.42458337084530645\n20140205 00:00,1751700,0.43070222746376874\n20140206 00:00,1774800,0.4343926572340447\n20140207 00:00,1797400,0.4321292319854091\n20140210 00:00,1800100,0.430771237963219\n20140211 00:00,1819800,0.42661110598414814\n20140212 00:00,1821600,0.4242368372891661\n20140213 00:00,1830000,0.42247525592516694\n20140214 00:00,1840100,0.4211783042861865\n20140218 00:00,1842600,0.42131983758704855\n20140219 00:00,1830500,0.424442934964376\n20140220 00:00,1841000,0.4256696801325528\n20140221 00:00,1839600,0.4267087394974418\n20140224 00:00,1849100,0.4292863208424477\n20140225 00:00,1848400,0.43237213603254554\n20140226 00:00,1848500,0.43514072527153275\n20140227 00:00,1858700,0.4384078617859928\n20140228 00:00,1863000,0.44234565958403316\n20140303 00:00,1849800,0.44565557889289076\n20140304 00:00,1875800,0.4500923814311613\n20140305 00:00,1876100,0.4523869569951819\n20140306 00:00,1882100,0.45450404509325676\n20140307 00:00,1882600,0.4559373735732945\n20140310 00:00,1882100,0.4567448746544837\n20140311 00:00,1872300,0.45667516740869335\n20140312 00:00,1872800,0.45656985995379706\n20140313 00:00,1851800,0.454242301534212\n20140314 00:00,1846600,0.4523467729889968\n20140317 00:00,1863300,0.4520663939200621\n20140318 00:00,1876600,0.4507690462155674\n20140319 00:00,1866600,0.45038523471299585\n20140320 00:00,1877500,0.44973817890035467\n20140321 00:00,1861900,0.4496256764293282\n20140324 00:00,1854000,0.44841669250527044\n20140325 00:00,1863100,0.4484211768897147\n20140326 00:00,1849700,0.44826615736776304\n20140327 00:00,1845800,0.44821939156372886\n20140328 00:00,1855000,0.44893737987173815\n20140331 00:00,1870400,0.4486273298099643\n20140401 00:00,1882700,0.44723517240552046\n20140402 00:00,1888600,0.44597540583983536\n20140403 00:00,1886000,0.4457929896866241\n20140404 00:00,1863800,0.44630197780800207\n20140407 00:00,1843400,0.4437843995070965\n20140408 00:00,1851300,0.4432823444173739\n20140409 00:00,1871500,0.44419617344295753\n20140410 00:00,1831700,0.44728433675886414\n20140411 00:00,1814800,0.44498480533662366\n20140414 00:00,1829400,0.4429816117635872\n20140415 00:00,1842400,0.44368807074484595\n20140416 00:00,1861400,0.4390032843788201\n20140417 00:00,1863900,0.43512118041745534\n20140421 00:00,1870400,0.43126550231686706\n20140422 00:00,1878900,0.42696383335303945\n20140423 00:00,1874400,0.42398019714098995\n20140424 00:00,1878100,0.42118644557006013\n20140425 00:00,1862900,0.41897833319778294\n20140428 00:00,1868800,0.4170104078198248\n20140429 00:00,1877000,0.4157664795211903\n20140430 00:00,1884300,0.41467662397505434\n20140501 00:00,1882900,0.41526405279266415\n20140502 00:00,1880600,0.4158444731353491\n20140505 00:00,1884400,0.4163975221469004\n20140506 00:00,1868100,0.41625783916961395\n20140507 00:00,1878900,0.4166427279949608\n20140508 00:00,1877000,0.4168970317356285\n20140509 00:00,1880000,0.4180084370995435\n20140512 00:00,1898100,0.41901043571326674\n20140513 00:00,1899600,0.41992686322251677\n20140514 00:00,1890400,0.4190184685669673\n20140515 00:00,1874000,0.4163525048067025\n20140516 00:00,1881100,0.41519719649522335\n20140519 00:00,1887000,0.41333314868132076\n20140520 00:00,1875500,0.41200759098104617\n20140521 00:00,1891300,0.41110744212285605\n20140522 00:00,1896000,0.4092241681045977\n20140523 00:00,1903800,0.40699394044739134\n20140527 00:00,1915700,0.4034947891903994\n20140528 00:00,1913800,0.4003333035502738\n20140529 00:00,1924000,0.39763158899244205\n20140530 00:00,1926300,0.3952573474042521\n20140602 00:00,1929100,0.3937024592772636\n20140603 00:00,1928100,0.39288243897346276\n20140604 00:00,1931900,0.3915304090872234\n20140605 00:00,1944600,0.3938508978663136\n20140606 00:00,1954100,0.39376305730803457\n20140609 00:00,1955700,0.39373887447072886\n20140610 00:00,1955900,0.3949008904898434\n20140611 00:00,1949200,0.3957590869730262\n20140612 00:00,1935400,0.3960678110438111\n20140613 00:00,1941600,0.3976472681610452\n20140616 00:00,1942900,0.4004563339719136\n20140617 00:00,1948300,0.4067367295543991\n20140618 00:00,1962600,0.42194598858207427\n20140619 00:00,1964800,0.4304460405392509\n20140620 00:00,1959400,0.4286661461762063\n20140623 00:00,1958800,0.4251281888793745\n20140624 00:00,1947100,0.4204668831110883\n20140625 00:00,1955800,0.4165448095884578\n20140626 00:00,1954500,0.4131420998879333\n20140627 00:00,1957900,0.41063053609446215\n20140630 00:00,1957200,0.4079932442581432\n20140701 00:00,1970600,0.40620270970657146\n20140702 00:00,1972200,0.405503020737678\n20140703 00:00,1982500,0.40567878405763635\n20140707 00:00,1975100,0.40613568277128687\n20140708 00:00,1962800,0.4060045589206647\n20140709 00:00,1971200,0.40673642373718166\n20140710 00:00,1963500,0.4073741368579319\n20140711 00:00,1966000,0.40711873407093857\n20140714 00:00,1976000,0.40699966822670625\n20140715 00:00,1972300,0.4069264368117499\n20140716 00:00,1979600,0.4072251386590449\n20140717 00:00,1957100,0.4067852032412959\n20140718 00:00,1977400,0.4063803091000502\n20140721 00:00,1973400,0.4053086705682237\n20140722 00:00,1982000,0.40380934994624296\n20140723 00:00,1986400,0.401861064377412\n20140724 00:00,1986500,0.40002499794619695\n20140725 00:00,1977400,0.3978486708124419\n20140728 00:00,1978000,0.39549369559985914\n20140729 00:00,1969300,0.393583343068889\n20140730 00:00,1969800,0.3917482945208303\n20140731 00:00,1930900,0.3857218880822718\n20140801 00:00,1924800,0.37628743177458673\n20140804 00:00,1938800,0.37052302781664015\n20140805 00:00,1920100,0.36623469915553636\n20140806 00:00,1920700,0.36413822079861385\n20140807 00:00,1909900,0.3646210083008701\n20140808 00:00,1932400,0.3645442353665117\n20140811 00:00,1938000,0.36462600218941577\n20140812 00:00,1935400,0.3673789718666711\n20140813 00:00,1948900,0.3713962036752055\n20140814 00:00,1957600,0.37388209846387993\n20140815 00:00,1957100,0.37529072515589307\n20140818 00:00,1973200,0.37445771344701745\n20140819 00:00,1983900,0.3721020808574375\n20140820 00:00,1989200,0.37049690181156947\n20140821 00:00,1995000,0.3690391513146392\n20140822 00:00,1991900,0.37012934363323574\n20140825 00:00,2002000,0.37433623090750967\n20140826 00:00,2003300,0.37701468850191655\n20140827 00:00,2002500,0.3769144107928369\n20140828 00:00,2001400,0.37775166565393437\n20140829 00:00,2007100,0.37969504201649706\n20140902 00:00,2006100,0.3823491344363124\n20140903 00:00,2005000,0.385185318623101\n20140904 00:00,2002200,0.3874633055726189\n20140905 00:00,2011100,0.39112188787998053\n20140908 00:00,2005900,0.3946386548168618\n20140909 00:00,1993200,0.3946813961537108\n20140910 00:00,2000700,0.39424117102280115\n20140911 00:00,2003000,0.39313929077444704\n20140912 00:00,1991200,0.39263492482752604\n20140915 00:00,1990200,0.39254797306503075\n20140916 00:00,2005200,0.3919809297831323\n20140917 00:00,2007500,0.3902063646443497\n20140918 00:00,2018200,0.38947744971840714\n20140919 00:00,2007000,0.39101593277421237\n20140922 00:00,1991500,0.3902856938365424\n20140923 00:00,1980100,0.38876710134013737\n20140924 00:00,1995700,0.38884440644377977\n20140925 00:00,1963300,0.3881410084858394\n20140926 00:00,1979000,0.38913981358681293\n20140929 00:00,1974900,0.3895510520446024\n20140930 00:00,1970200,0.38950017465313513\n20141001 00:00,1943700,0.3907474424860226\n20141002 00:00,1944200,0.3920582441385266\n20141003 00:00,1965200,0.39130226295977344\n20141006 00:00,1963000,0.3938365309572802\n20141007 00:00,1933000,0.3943996912074991\n20141008 00:00,1966100,0.3952927109835416\n20141009 00:00,1927000,0.4005874219362082\n20141010 00:00,1905400,0.4002656021725263\n20141013 00:00,1874500,0.399779836474422\n20141014 00:00,1878300,0.4053152521385729\n20141015 00:00,1864300,0.4163664873161096\n20141016 00:00,1862700,0.4271005597382253\n20141017 00:00,1884700,0.4343521846658086\n20141020 00:00,1903000,0.4357280901041597\n20141021 00:00,1940700,0.4254469933684812\n20141022 00:00,1926900,0.42294265094701367\n20141023 00:00,1949300,0.4178098444121572\n20141024 00:00,1964300,0.41137408344754406\n20141027 00:00,1961600,0.4083497233151643\n20141028 00:00,1984100,0.404860672659636\n20141029 00:00,1981100,0.40455351149333124\n20141030 00:00,1993800,0.40486955940743286\n20141031 00:00,2016600,0.4055122570854498\n20141103 00:00,2017700,0.40886958691021236\n20141104 00:00,2010700,0.41447559048259414\n20141105 00:00,2023400,0.4220959421355604\n20141106 00:00,2031500,0.43130488831693947\n20141107 00:00,2033400,0.4419784530184286\n20141110 00:00,2039800,0.45261090208430693\n20141111 00:00,2041600,0.46248044085983614\n20141112 00:00,2039600,0.47163982663330284\n20141113 00:00,2041900,0.47854967109483093\n20141114 00:00,2042400,0.48321935919162673\n20141117 00:00,2043700,0.48681793692887315\n20141118 00:00,2055500,0.4897948231373316\n20141119 00:00,2052200,0.4923291601358207\n20141120 00:00,2055800,0.49501883972045957\n20141121 00:00,2067200,0.49635334541981047\n20141124 00:00,2072600,0.4972380332286098\n20141125 00:00,2072500,0.49806350136915384\n20141126 00:00,2076400,0.4989413020537806\n20141128 00:00,2072000,0.49983735362527043\n20141201 00:00,2058000,0.4995692809962756\n20141202 00:00,2070900,0.5001494572150675\n20141203 00:00,2079100,0.5002988895055329\n20141204 00:00,2076400,0.5006007752337185\n20141205 00:00,2080000,0.5011858691356684\n20141208 00:00,2066100,0.5018529449052571\n20141209 00:00,2064700,0.5037553414048912\n20141210 00:00,2031600,0.5010805782075191\n20141211 00:00,2042300,0.49889437806909653\n20141212 00:00,2009400,0.49494952293711675\n20141215 00:00,1995100,0.4907837503413891\n20141216 00:00,1979000,0.4886600636923441\n20141217 00:00,2017900,0.4910700387706814\n20141218 00:00,2068400,0.47847948544655594\n20141219 00:00,2063300,0.4716486843392069\n20141222 00:00,2074700,0.4668128183841822\n20141223 00:00,2077500,0.4636982223972677\n20141224 00:00,2078100,0.4617451503955234\n20141226 00:00,2084400,0.4599365356104374\n20141229 00:00,2087200,0.45864740068714976\n20141230 00:00,2076000,0.45756809411104027\n20141231 00:00,2055000,0.4548682926838082\n20150102 00:00,2054300,0.4523684337741706\n20150105 00:00,2017600,0.4453837486686303\n20150106 00:00,1998200,0.43610554359157155\n20150107 00:00,2023100,0.4316306028177001\n20150108 00:00,2059000,0.4244855420197193\n20150109 00:00,2041900,0.4204237200165304\n20150112 00:00,2026500,0.41599041857214447\n20150113 00:00,2020800,0.41531557278920417\n20150114 00:00,2009400,0.4132911022888801\n20150115 00:00,1989700,0.4119752505614996\n20150116 00:00,2016300,0.4132947815857406\n20150120 00:00,2020800,0.4153173913101808\n20150121 00:00,2030600,0.41908705058073475\n20150122 00:00,2060500,0.4226389458654152\n20150123 00:00,2049700,0.42716852457834953\n20150126 00:00,2054400,0.4268831617981832\n20150127 00:00,2027900,0.42671396001462036\n20150128 00:00,2001400,0.42436123419090777\n20150129 00:00,2020100,0.42314831332733865\n20150130 00:00,1994700,0.4251294574210466\n20150202 00:00,2019000,0.42507260836595434\n20150203 00:00,2048400,0.4194755559856413\n20150204 00:00,2040600,0.4168219673063777\n20150205 00:00,2061800,0.4153388591293218\n20150206 00:00,2055300,0.41400436301226795\n20150209 00:00,2046300,0.4128475692364566\n20150210 00:00,2067700,0.41228613677591297\n20150211 00:00,2069300,0.41164356187611795\n20150212 00:00,2089200,0.41120832226034904\n20150213 00:00,2097800,0.4108885260920006\n20150217 00:00,2101600,0.41142088756997836\n20150218 00:00,2101500,0.41252117198621846\n20150219 00:00,2099800,0.4139273435832907\n20150220 00:00,2112800,0.41599600709933476\n20150223 00:00,2111900,0.41849222162161526\n20150224 00:00,2118100,0.42150457231176075\n20150225 00:00,2116100,0.4247766084656513\n20150226 00:00,2113700,0.42785846411674505\n20150227 00:00,2106600,0.4295063352737921\n20150302 00:00,2119900,0.4316696816472718\n20150303 00:00,2111200,0.4339272354760045\n20150304 00:00,2102100,0.4333842216790366\n20150305 00:00,2105100,0.43325083209816595\n20150306 00:00,2075000,0.4307753167874444\n20150309 00:00,2083600,0.4298845700492487\n20150310 00:00,2050000,0.4273207769382083\n20150311 00:00,2045000,0.4254197907230755\n20150312 00:00,2071300,0.4258899539785983\n20150313 00:00,2058400,0.42714186399610415\n20150316 00:00,2086400,0.42737324805988847\n20150317 00:00,2079900,0.42698042261431646\n20150318 00:00,2104200,0.4244293234408182\n20150319 00:00,2095000,0.42363650303546624\n20150320 00:00,2104500,0.4231824885026619\n20150323 00:00,2100000,0.4229782741533931\n20150324 00:00,2088200,0.4231681058144232\n20150325 00:00,2057600,0.4214395802086919\n20150326 00:00,2052700,0.42018528517427917\n20150327 00:00,2057500,0.42156490291663434\n20150330 00:00,2082400,0.4222070082833738\n20150331 00:00,2064300,0.42300903941136725\n20150401 00:00,2057000,0.4237088255856681\n20150402 00:00,2064000,0.4264120286728299\n20150406 00:00,2078400,0.42956838896851346\n20150407 00:00,2072800,0.430790684623976\n20150408 00:00,2080200,0.431666127285856\n20150409 00:00,2089200,0.43259069177494874\n20150410 00:00,2100600,0.4362604921208278\n20150413 00:00,2090600,0.43630845119563244\n20150414 00:00,2094900,0.43787572751637494\n20150415 00:00,2104700,0.4391587928152896\n20150416 00:00,2104000,0.43995337593667133\n20150417 00:00,2079800,0.4393475982964127\n20150420 00:00,2098500,0.4396858778158931\n20150421 00:00,2096000,0.4396060581774579\n20150422 00:00,2106600,0.43981894164173624\n20150423 00:00,2112100,0.4400828468301675\n20150424 00:00,2116700,0.44037331144255776\n20150427 00:00,2107400,0.4408581609151497\n20150428 00:00,2114400,0.44128462403055135\n20150429 00:00,2105300,0.4412708890042627\n20150430 00:00,2085200,0.4396607234315854\n20150501 00:00,2107200,0.4397106378128835\n20150504 00:00,2113900,0.4391021575437906\n20150505 00:00,2089200,0.43845305978929205\n20150506 00:00,2080400,0.4365199058555475\n20150507 00:00,2088700,0.43585331167465596\n20150508 00:00,2116500,0.4341460976272008\n20150511 00:00,2106000,0.43306347066396783\n20150512 00:00,2099800,0.43290387129942764\n20150513 00:00,2100600,0.43341044730026607\n20150514 00:00,2122500,0.432087609482673\n20150515 00:00,2124400,0.4299524987146536\n20150518 00:00,2131000,0.4282545736543077\n20150519 00:00,2130300,0.4271499984750562\n20150520 00:00,2128800,0.4266540042654043\n20150521 00:00,2135000,0.4262332874713242\n20150522 00:00,2130000,0.4261458306283718\n20150526 00:00,2107100,0.42447547899501037\n20150527 00:00,2126700,0.42438374997877926\n20150528 00:00,2125000,0.4241960608610356\n20150529 00:00,2111300,0.42363865494163033\n20150601 00:00,2115400,0.4234469930808693\n20150602 00:00,2113900,0.42351456623617406\n20150603 00:00,2119200,0.4241002866450867\n20150604 00:00,2102700,0.4244579898794284\n20150605 00:00,2097600,0.42401781363507046\n20150608 00:00,2084800,0.42357252421822056\n20150609 00:00,2084700,0.4239109172743796\n20150610 00:00,2109500,0.42421028164145225\n20150611 00:00,2116300,0.42313809275002484\n20150612 00:00,2100100,0.42371094407077714\n20150615 00:00,2091100,0.4240682404123437\n20150616 00:00,2102500,0.42490747992059313\n20150617 00:00,2105900,0.4252598543825196\n20150618 00:00,2127800,0.4240144536089612\n20150619 00:00,2108100,0.4245008080505719\n20150622 00:00,2118900,0.42446472496592136\n20150623 00:00,2120400,0.4242783624927957\n20150624 00:00,2105000,0.42417643237286057\n20150625 00:00,2098600,0.42357260986225576\n20150626 00:00,2098200,0.42337534361843066\n20150629 00:00,2054200,0.4198682256804212\n20150630 00:00,2058500,0.41772884218724604\n20150701 00:00,2075000,0.41723704751741425\n20150702 00:00,2073100,0.41687140396787054\n20150706 00:00,2067200,0.4172081608341203\n20150707 00:00,2080200,0.4169545133924091\n20150708 00:00,2045300,0.4174849788422242\n20150709 00:00,2049000,0.4175162570551655\n20150710 00:00,2074800,0.41698238652168346\n20150713 00:00,2097700,0.41286654231965025\n20150714 00:00,2106800,0.40831432238144133\n20150715 00:00,2106100,0.4056370441677983\n20150716 00:00,2123000,0.40199647571362185\n20150717 00:00,2124800,0.40094852133425224\n20150720 00:00,2125900,0.3993817982026988\n20150721 00:00,2117500,0.39886881455241247\n20150722 00:00,2113700,0.39833677279848395\n20150723 00:00,2101800,0.3978008830483864\n20150724 00:00,2080000,0.3959271305852023\n20150727 00:00,2067900,0.39373885499002587\n20150728 00:00,2093300,0.39581650559479464\n20150729 00:00,2107700,0.39786233986056657\n20150730 00:00,2108200,0.4009735285119839\n20150731 00:00,2105000,0.3997344599382264\n20150803 00:00,2097900,0.39789607849966024\n20150804 00:00,2093800,0.39730435749163956\n20150805 00:00,2100700,0.3953160404094861\n20150806 00:00,2083500,0.39315504308321864\n20150807 00:00,2079500,0.39114257602115604\n20150810 00:00,2105700,0.38934083038947354\n20150811 00:00,2086700,0.38883740005183526\n20150812 00:00,2089200,0.38873789968627936\n20150813 00:00,2086600,0.3890179186570365\n20150814 00:00,2094200,0.3896026953251068\n20150817 00:00,2105900,0.39028147898747445\n20150818 00:00,2099800,0.3907186383377151\n20150819 00:00,2083200,0.3906273553298049\n20150820 00:00,2039700,0.38612918858761797\n20150821 00:00,1978300,0.3712609362507523\n20150824 00:00,1895000,0.34495787868084077\n20150825 00:00,1872700,0.3336629495395435\n20150826 00:00,1944600,0.33635280948845536\n20150827 00:00,1992700,0.32860962575729963\n20150828 00:00,1992800,0.32562571662540857\n20150831 00:00,1976700,0.3280551979864661\n20150901 00:00,1917700,0.3351368425352622\n20150902 00:00,1954100,0.34091962486902044\n20150903 00:00,1955500,0.3459390432667169\n20150904 00:00,1925900,0.35387070537159054\n20150908 00:00,1974300,0.3572019807388343\n20150909 00:00,1947900,0.3626873511913588\n20150910 00:00,1958500,0.36661481371554083\n20150911 00:00,1967400,0.36922474771196967\n20150914 00:00,1960100,0.372337412302802\n20150915 00:00,1984600,0.37308613073543306\n20150916 00:00,2001800,0.3706352559775904\n20150917 00:00,1997300,0.3681164921241339\n20150918 00:00,1954500,0.36377078845531186\n20150921 00:00,1964600,0.35969566895825833\n20150922 00:00,1939100,0.3551005047925955\n20150923 00:00,1936000,0.3514923102900605\n20150924 00:00,1929000,0.34779490817684894\n20150925 00:00,1928500,0.3462136279452027\n20150928 00:00,1880100,0.3431210479252099\n20150929 00:00,1881200,0.3414159667301145\n20150930 00:00,1916300,0.34075350634471296\n20151001 00:00,1921300,0.34024116736346094\n20151002 00:00,1950000,0.33815537409329116\n20151005 00:00,1984700,0.33415032328382843\n20151006 00:00,1977900,0.3331332196354541\n20151007 00:00,1994100,0.33068125641803825\n20151008 00:00,2012100,0.33445808638906027\n20151009 00:00,2013300,0.33417632127875524\n20151012 00:00,2015200,0.3312838337418771\n20151013 00:00,2002500,0.32466376638168376\n20151014 00:00,1992900,0.31787640632126957\n20151015 00:00,2023500,0.3122895046396142\n20151016 00:00,2032700,0.3083675497498994\n20151019 00:00,2033700,0.307045570419501\n20151020 00:00,2031100,0.3065069330425598\n20151021 00:00,2018500,0.3067007829357269\n20151022 00:00,2052600,0.30969102941336457\n20151023 00:00,2075100,0.31321871797557505\n20151026 00:00,2070000,0.3176942359308838\n20151027 00:00,2066000,0.3209295196918131\n20151028 00:00,2089500,0.32449161183405834\n20151029 00:00,2088300,0.32744919779535747\n20151030 00:00,2079300,0.3290555548935453\n20151102 00:00,2103900,0.33172019492659527\n20151103 00:00,2110000,0.3342201131204436\n20151104 00:00,2103600,0.33645742854953065\n20151105 00:00,2101500,0.33842267594952385\n20151106 00:00,2100400,0.3403298240134889\n20151109 00:00,2080800,0.3406758824420409\n20151110 00:00,2085600,0.34145849033207876\n20151111 00:00,2077400,0.3417038297068166\n20151112 00:00,2049000,0.33977606977660235\n20151113 00:00,2025300,0.33622072393060515\n20151116 00:00,2056500,0.3358612402133303\n20151117 00:00,2054000,0.3352000834995278\n20151118 00:00,2086800,0.33336551458557007\n20151119 00:00,2085400,0.33190143267754424\n20151120 00:00,2093800,0.33051278322131883\n20151123 00:00,2090900,0.3291997839883187\n20151124 00:00,2093700,0.3280210085559036\n20151125 00:00,2093000,0.3271695894831905\n20151127 00:00,2095300,0.32664454858850894\n20151130 00:00,2086900,0.32632964924982133\n20151201 00:00,2106800,0.32650870986602376\n20151202 00:00,2085400,0.32677565069019043\n20151203 00:00,2055800,0.32581305828471724\n20151204 00:00,2096600,0.3269596990116562\n20151207 00:00,2082700,0.3282961104654361\n20151208 00:00,2069900,0.32952979677042255\n20151209 00:00,2053300,0.3306360367721004\n20151210 00:00,2058600,0.3311180354685685\n20151211 00:00,2018800,0.3316006657522583\n20151214 00:00,2030000,0.33250010423840487\n20151215 00:00,2050600,0.3353832963194532\n20151216 00:00,2080200,0.3414473421685897\n20151217 00:00,2048600,0.34499470949375394\n20151218 00:00,2000200,0.3429195726980135\n20151221 00:00,2017000,0.34284729783655543\n20151222 00:00,2035600,0.34213589868005706\n20151223 00:00,2060500,0.33982266163857316\n20151224 00:00,2056500,0.33877569706840494\n20151228 00:00,2052200,0.3388618025968405\n20151229 00:00,2074000,0.339024302603491\n20151230 00:00,2059300,0.34034366125177057\n20151231 00:00,2038900,0.34121603377152604\n20160104 00:00,2010100,0.340991843525749\n20160105 00:00,2013500,0.3407165572363091\n20160106 00:00,1988500,0.34167456786879224\n20160107 00:00,1939900,0.33789571593916745\n20160108 00:00,1919500,0.3359550274667347\n20160111 00:00,1921100,0.33713543521427397\n20160112 00:00,1936600,0.33932575816731797\n20160113 00:00,1888700,0.3443339910453126\n20160114 00:00,1918900,0.34864120479666627\n20160115 00:00,1878300,0.35604880752736556\n20160119 00:00,1880600,0.36233357317032205\n20160120 00:00,1858100,0.37030954735524124\n20160121 00:00,1867000,0.37797781515146556\n20160122 00:00,1905500,0.38251250862064107\n20160125 00:00,1876300,0.38995967106922946\n20160126 00:00,1902400,0.3949513580745669\n20160127 00:00,1881400,0.3981819128033524\n20160128 00:00,1891700,0.39865944170400036\n20160129 00:00,1938700,0.39426238923870716\n20160201 00:00,1936500,0.3909131888713631\n20160202 00:00,1901100,0.38908706222704476\n20160203 00:00,1912300,0.38757443051615764\n20160204 00:00,1915300,0.3860390742703759\n20160205 00:00,1879800,0.38437397853922933\n20160208 00:00,1853500,0.3808412121203064\n20160209 00:00,1853500,0.3795912860535746\n20160210 00:00,1853100,0.3792111096370655\n20160211 00:00,1830300,0.3789457733615744\n20160212 00:00,1866500,0.3789122600965135\n20160216 00:00,1898100,0.3760443812858868\n20160217 00:00,1928700,0.3711942242928762\n20160218 00:00,1920500,0.36901346268516644\n20160219 00:00,1920000,0.36790951207551786\n20160222 00:00,1948300,0.3662261257669923\n20160223 00:00,1923300,0.3659512820524435\n20160224 00:00,1932300,0.36593866303683575\n20160225 00:00,1955500,0.36631206324875776\n20160226 00:00,1951000,0.36715509859759854\n20160229 00:00,1935600,0.3680791728644738\n20160301 00:00,1982100,0.37070406389444893\n20160302 00:00,1990300,0.37335692174940804\n20160303 00:00,1997700,0.37742488570697474\n20160304 00:00,2003600,0.3828885521927551\n20160307 00:00,2006300,0.38832762137479987\n20160308 00:00,1983600,0.39267634925403333\n20160309 00:00,1994100,0.39711778348201404\n20160310 00:00,1995400,0.40143750520010546\n20160311 00:00,2027600,0.4054772257915406\n20160314 00:00,2025300,0.4089976263613926\n20160315 00:00,2022000,0.41143374477751066\n20160316 00:00,2033900,0.41399647602986517\n20160317 00:00,2047900,0.4166912101481014\n20160318 00:00,2045200,0.41937951561147047\n20160321 00:00,2046900,0.42271735522774334\n20160322 00:00,2046200,0.4264337693652907\n20160323 00:00,2032200,0.4283908452520722\n20160324 00:00,2031100,0.4288319732187141\n20160328 00:00,2032700,0.4294130359514306\n20160329 00:00,2052300,0.4298566858035894\n20160330 00:00,2061000,0.43046675346952823\n20160331 00:00,2055600,0.43069391086068715\n20160401 00:00,2069100,0.4312819621513601\n20160404 00:00,2062900,0.43182511997705364\n20160405 00:00,2041400,0.43162323153308635\n20160406 00:00,2064600,0.4324366988914503\n20160407 00:00,2038900,0.43246676569774956\n20160408 00:00,2044800,0.43234926728577117\n20160411 00:00,2039900,0.4321790818537867\n20160412 00:00,2059900,0.43223064814766615\n20160413 00:00,2080400,0.4314643510134747\n20160414 00:00,2080200,0.4312426903795903\n20160415 00:00,2078000,0.431136449479509\n20160418 00:00,2092500,0.43145902273261494\n20160419 00:00,2099100,0.4315356942245856\n20160420 00:00,2100700,0.43198618375346565\n20160421 00:00,2089000,0.4323511530539117\n20160422 00:00,2089600,0.4327199806680212\n20160425 00:00,2085900,0.43312747493865955\n20160426 00:00,2090000,0.43350616550878635\n20160427 00:00,2093800,0.4343268889772218\n20160428 00:00,2074200,0.43421344362860254\n20160429 00:00,2063000,0.4335162886982156\n20160502 00:00,2080300,0.4339056024722345\n20160503 00:00,2061300,0.43430201147569114\n20160504 00:00,2049600,0.4336351158783685\n20160505 00:00,2049500,0.43392912361125635\n20160506 00:00,2057000,0.4341355970384154\n20160509 00:00,2058900,0.4343274988228331\n20160510 00:00,2084600,0.4337103049648624\n20160511 00:00,2065000,0.43434439069469366\n20160512 00:00,2065500,0.4349398907388993\n20160513 00:00,2047200,0.4348650836669247\n20160516 00:00,2068100,0.43482247907510174\n20160517 00:00,2048200,0.43482293235297476\n20160518 00:00,2049100,0.4347488904020228\n20160519 00:00,2042400,0.4347831583638491\n20160520 00:00,2054900,0.4350488905419259\n20160523 00:00,2051600,0.43507121103400864\n20160524 00:00,2078700,0.4344958455089454\n20160525 00:00,2092600,0.43318313770027833\n20160526 00:00,2093400,0.4325329252888931\n20160527 00:00,2102100,0.4320983733575489\n20160531 00:00,2100800,0.4320763870463577\n20160601 00:00,2103000,0.43236880974766667\n20160602 00:00,2109200,0.4331208190929704\n20160603 00:00,2102800,0.4336322617480466\n20160606 00:00,2113900,0.4342706240670525\n20160607 00:00,2117000,0.4354156461314335\n20160608 00:00,2123900,0.4366986385535521\n20160609 00:00,2120400,0.4372704884272828\n20160610 00:00,2100300,0.43712070154088306\n20160613 00:00,2084200,0.4360191477921313\n20160614 00:00,2080900,0.43563654911208394\n20160615 00:00,2077800,0.43526526927443004\n20160616 00:00,2083500,0.4350275848409678\n20160617 00:00,2065300,0.4346159111792372\n20160620 00:00,2079100,0.4347268721644974\n20160621 00:00,2084100,0.43520902319758126\n20160622 00:00,2080300,0.4364670890040262\n20160623 00:00,2108700,0.4366396392471952\n20160624 00:00,2031300,0.43712259093571687\n20160627 00:00,1995300,0.4321087045198552\n20160628 00:00,2032200,0.4312897142424866\n20160629 00:00,2067100,0.428731265480197\n20160630 00:00,2095300,0.4245486869484699\n20160701 00:00,2097900,0.42181804795990047\n20160705 00:00,2083900,0.42099438340331896\n20160706 00:00,2097700,0.4205278261395149\n20160707 00:00,2095400,0.4214415944897047\n20160708 00:00,2127000,0.4226825876599186\n20160711 00:00,2134500,0.4228785194089664\n20160712 00:00,2150000,0.42277801973349166\n20160713 00:00,2149300,0.4234668549930117\n20160714 00:00,2161100,0.4248262630705571\n20160715 00:00,2158400,0.42644828992379147\n20160718 00:00,2164100,0.42871737710055546\n20160719 00:00,2161800,0.43136112017656847\n20160720 00:00,2171300,0.434518945571671\n20160721 00:00,2162200,0.43766905253764776\n20160722 00:00,2172500,0.4406914214337875\n20160725 00:00,2166400,0.44312940926848504\n20160726 00:00,2167500,0.445187622804552\n20160727 00:00,2165100,0.4434575980998226\n20160728 00:00,2168000,0.44007057708798225\n20160729 00:00,2171500,0.4362662805024043\n20160801 00:00,2169300,0.43223236220915534\n20160802 00:00,2155200,0.42772716032013175\n20160803 00:00,2162300,0.4227665692986706\n20160804 00:00,2164300,0.4170167424362542\n20160805 00:00,2181400,0.41194836737796203\n20160808 00:00,2180500,0.4066735981185908\n20160809 00:00,2182200,0.39993687391146027\n20160810 00:00,2176300,0.3947886421757262\n20160811 00:00,2186800,0.3902440913006139\n20160812 00:00,2184100,0.3873372250657166\n20160815 00:00,2190900,0.38631345217013896\n20160816 00:00,2179600,0.3900953245082443\n20160817 00:00,2183800,0.40110888544403595\n20160818 00:00,2189000,0.41951777537689117\n20160819 00:00,2185600,0.43708831952226185\n20160822 00:00,2185100,0.44316769956340873\n20160823 00:00,2189300,0.4479059053483466\n20160824 00:00,2178800,0.45987037013760207\n20160825 00:00,2176600,0.46115136420820296\n20160826 00:00,2172800,0.4628048285876786\n20160829 00:00,2183400,0.46608138406053506\n20160830 00:00,2179800,0.46572469917699266\n20160831 00:00,2174400,0.4668311504946301\n20160901 00:00,2173700,0.4665653028109266\n20160902 00:00,2183600,0.46590725139626143\n20160906 00:00,2190900,0.466655640854712\n20160907 00:00,2190100,0.4656249376764585\n20160908 00:00,2185100,0.46590732547995417\n20160909 00:00,2133200,0.46311479824673885\n20160912 00:00,2164000,0.46279655996782215\n20160913 00:00,2132400,0.4628650939098775\n20160914 00:00,2131500,0.4629291350653599\n20160915 00:00,2152800,0.4665647227184432\n20160916 00:00,2133700,0.47128561435799493\n20160919 00:00,2134100,0.47258164257911917\n20160920 00:00,2134200,0.47578007225030106\n20160921 00:00,2158200,0.4757065425934741\n20160922 00:00,2171800,0.4747514466339635\n20160923 00:00,2159900,0.47525468050489744\n20160926 00:00,2142400,0.4745712405835864\n20160927 00:00,2155700,0.4724625569716201\n20160928 00:00,2166400,0.4717991347963988\n20160929 00:00,2146800,0.4712603555292471\n20160930 00:00,2163000,0.4720625435730002\n20161003 00:00,2157800,0.47097502698001165\n20161004 00:00,2146800,0.46927977377403\n20161005 00:00,2156300,0.4678016834638595\n20161006 00:00,2157800,0.46577990373437045\n20161007 00:00,2150400,0.4641215530168369\n20161010 00:00,2161600,0.4626040550177928\n20161011 00:00,2134300,0.4607492068017521\n20161012 00:00,2137100,0.45862671122151766\n20161013 00:00,2130100,0.4575480655850156\n20161014 00:00,2131200,0.4565650666703076\n20161017 00:00,2123800,0.4562531363315825\n20161018 00:00,2137100,0.4566752404863429\n20161019 00:00,2142800,0.4576870983814765\n20161020 00:00,2138800,0.461542978169565\n20161021 00:00,2139800,0.46229452698773754\n20161024 00:00,2148900,0.4622355704562236\n20161025 00:00,2141700,0.4628599092893251\n20161026 00:00,2137400,0.46384696532151726\n20161027 00:00,2131700,0.4639005024566158\n20161028 00:00,2125400,0.46411014457199823\n20161031 00:00,2125500,0.46507185790767325\n20161101 00:00,2110100,0.46493569966647763\n20161102 00:00,2097400,0.4648587401853339\n20161103 00:00,2087800,0.4649978467984111\n20161104 00:00,2085500,0.46625027190477486\n20161107 00:00,2131500,0.46627739641388055\n20161108 00:00,2141100,0.46388083900509663\n20161109 00:00,2164400,0.46165877737956756\n20161110 00:00,2169200,0.4603295443197449\n20161111 00:00,2164200,0.4591873149065651\n20161114 00:00,2165900,0.4613615543348281\n20161115 00:00,2182800,0.46191461129872496\n20161116 00:00,2178700,0.4635334179820459\n20161117 00:00,2189900,0.4634493374108312\n20161118 00:00,2185000,0.4634936455426966\n20161121 00:00,2201500,0.46347924565558024\n20161122 00:00,2205800,0.46380507946454713\n20161123 00:00,2207000,0.464591839966524\n20161125 00:00,2215200,0.4660141945229392\n20161128 00:00,2204800,0.46740173045234545\n20161129 00:00,2209100,0.4692945876710263\n20161130 00:00,2203800,0.4722914753027517\n20161201 00:00,2195700,0.47314432814767154\n20161202 00:00,2196800,0.47440710024706734\n20161205 00:00,2210000,0.4765717870178484\n20161206 00:00,2217000,0.4778034005741834\n20161207 00:00,2246000,0.47676436620798296\n20161208 00:00,2251500,0.4749623660080097\n20161209 00:00,2265100,0.47210340981149596\n20161212 00:00,2262500,0.47239543252128413\n20161213 00:00,2277600,0.471430614736254\n20161214 00:00,2258800,0.4678291606752023\n20161215 00:00,2268100,0.46563151317858165\n20161216 00:00,2250400,0.45827288865638705\n20161219 00:00,2255300,0.45674186808576234\n20161220 00:00,2264000,0.4521061090092731\n20161221 00:00,2257700,0.4429798236058366\n20161222 00:00,2253800,0.42901518211053097\n20161223 00:00,2257100,0.41574554652956835\n20161227 00:00,2262700,0.4029303025308131\n20161228 00:00,2244000,0.3901690023807658\n20161229 00:00,2243500,0.38152106362969546\n20161230 00:00,2235300,0.3761034153635748\n20170103 00:00,2252400,0.374470206212259\n20170104 00:00,2265800,0.3786164032518369\n20170105 00:00,2264000,0.3829381138532142\n20170106 00:00,2272100,0.3827593654816183\n20170109 00:00,2264600,0.38307996958190055\n20170110 00:00,2264600,0.38394776259162106\n20170111 00:00,2271000,0.38541611650703606\n20170112 00:00,2265300,0.38478918598275536\n20170113 00:00,2270500,0.3860478249088275\n20170117 00:00,2262500,0.38578953261746296\n20170118 00:00,2267500,0.3853644222594341\n20170119 00:00,2259100,0.3875658356800722\n20170120 00:00,2267400,0.3882949052944976\n20170123 00:00,2261500,0.3876644485692027\n20170124 00:00,2276000,0.38850699264778393\n20170125 00:00,2295700,0.38737045669061876\n20170126 00:00,2293300,0.39030537699424867\n20170127 00:00,2289700,0.39169677798205027\n20170130 00:00,2275500,0.39528721806719336\n20170131 00:00,2275300,0.3998873027959254\n20170201 00:00,2276200,0.40170858767115103\n20170202 00:00,2277700,0.40745504044599956\n20170203 00:00,2293400,0.4162902773108664\n20170206 00:00,2289300,0.4153441974908169\n20170207 00:00,2289400,0.41012456665177277\n20170208 00:00,2292400,0.40556379271314424\n20170209 00:00,2306000,0.40121489316660097\n20170210 00:00,2315100,0.4018869471822714\n20170213 00:00,2327700,0.3997875213117846\n20170214 00:00,2337000,0.39532637979385166\n20170215 00:00,2349200,0.39257705071328386\n20170216 00:00,2347200,0.3899980483587177\n20170217 00:00,2350900,0.38695371397306555\n20170221 00:00,2364900,0.38675543819246117\n20170222 00:00,2362800,0.3855729242646695\n20170223 00:00,2364400,0.38507165066548354\n20170224 00:00,2367400,0.3867731121336627\n20170227 00:00,2371100,0.3895675305466921\n20170228 00:00,2364700,0.3945403569046178\n20170301 00:00,2397800,0.397679815641135\n20170302 00:00,2382700,0.4000206279250569\n20170303 00:00,2384200,0.40201825351225495\n20170306 00:00,2377100,0.40366120304059\n20170307 00:00,2370000,0.4039412254376418\n20170308 00:00,2365600,0.40398621073451946\n20170309 00:00,2368600,0.4052523177681069\n20170310 00:00,2376900,0.4068666703244862\n20170313 00:00,2378100,0.40698169039818877\n20170314 00:00,2369000,0.4070447632096508\n20170315 00:00,2389500,0.40770400377619326\n20170316 00:00,2384800,0.4075441791600607\n20170317 00:00,2370300,0.40730885936893924\n20170320 00:00,2367700,0.4069721122083582\n20170321 00:00,2337300,0.4047211145911146\n20170322 00:00,2342800,0.40378023129598684\n20170323 00:00,2340300,0.40374103270661\n20170324 00:00,2338600,0.40516306849902745\n20170327 00:00,2336200,0.40754806066499927\n20170328 00:00,2353200,0.40861296099652566\n20170329 00:00,2355400,0.4098552011842544\n20170330 00:00,2362900,0.4102975928889405\n20170331 00:00,2357400,0.412973586368282\n20170403 00:00,2353300,0.41462314502618436\n20170404 00:00,2354800,0.4154008980294165\n20170405 00:00,2347800,0.41728847327821644\n20170406 00:00,2354400,0.4192157695990229\n20170407 00:00,2352000,0.42177371077996045\n20170410 00:00,2353400,0.4265687675470576\n20170411 00:00,2350600,0.4284460378893651\n20170412 00:00,2340300,0.42839281167717835\n20170413 00:00,2325100,0.427328278868156\n20170417 00:00,2345700,0.427418527900409\n20170418 00:00,2338700,0.42600408572582843\n20170419 00:00,2334400,0.42430740539938117\n20170420 00:00,2353400,0.42218383777298146\n20170421 00:00,2345900,0.42072404957211906\n20170424 00:00,2371700,0.4176168332101834\n20170425 00:00,2385500,0.41298698754507096\n20170426 00:00,2384000,0.410989755698687\n20170427 00:00,2386000,0.4110302119967934\n20170428 00:00,2380800,0.4107051938030396\n20170501 00:00,2386800,0.410680656672924\n20170502 00:00,2387700,0.41275296471445205\n20170503 00:00,2384800,0.4130904317293896\n20170504 00:00,2387600,0.4133780659397841\n20170505 00:00,2397000,0.41416540668140245\n20170508 00:00,2396600,0.4153064376127786\n20170509 00:00,2394400,0.4157126930799978\n20170510 00:00,2398700,0.4192440609336908\n20170511 00:00,2393800,0.4203181569477251\n20170512 00:00,2389800,0.4207197368852982\n20170515 00:00,2403000,0.4201521502726709\n20170516 00:00,2400800,0.421538981643198\n20170517 00:00,2358200,0.4167665437026796\n20170518 00:00,2367700,0.4141458959257612\n20170519 00:00,2383100,0.41473566077524326\n20170522 00:00,2395200,0.415286555090092\n20170523 00:00,2400500,0.41799637272072887\n20170524 00:00,2406100,0.4172586752980854\n20170525 00:00,2417600,0.41513743620311216\n20170526 00:00,2417100,0.41306278682967834\n20170530 00:00,2415000,0.40931273804291923\n20170531 00:00,2414400,0.4053380500592987\n20170601 00:00,2433600,0.4008776559452782\n20170602 00:00,2441700,0.3957420989119079\n20170605 00:00,2439900,0.3927998009180312\n20170606 00:00,2432100,0.38943384414095006\n20170607 00:00,2436600,0.3872382255866636\n20170608 00:00,2437800,0.38730417281625074\n20170609 00:00,2434100,0.3891460611513466\n20170612 00:00,2433600,0.38976020508144193\n20170613 00:00,2445500,0.39031738817552764\n20170614 00:00,2442400,0.39097875694723555\n20170615 00:00,2437700,0.3915349774486191\n20170616 00:00,2426400,0.39155086033544145\n20170619 00:00,2446600,0.3918126927722988\n20170620 00:00,2430100,0.39390429556232764\n20170621 00:00,2429500,0.3987153300126855\n20170622 00:00,2428400,0.40602538934345755\n20170623 00:00,2431300,0.4301669097222278\n20170626 00:00,2432900,0.42402599647057065\n20170627 00:00,2413300,0.42795586290886634\n20170628 00:00,2434900,0.4296347065451267\n20170629 00:00,2413500,0.4275403270858473\n20170630 00:00,2418000,0.42640211222022895\n20170703 00:00,2422100,0.42593047144571405\n20170705 00:00,2427700,0.4273383913042641\n20170706 00:00,2405500,0.4308779845052366\n20170707 00:00,2421100,0.4374021211562267\n20170710 00:00,2423700,0.4393845332551629\n20170711 00:00,2421900,0.44126591342990723\n20170712 00:00,2440100,0.44062217245992374\n20170713 00:00,2444200,0.4394717072348803\n20170714 00:00,2455600,0.4373458309236386\n20170717 00:00,2455300,0.436327733840984\n20170718 00:00,2456600,0.43587514865338617\n20170719 00:00,2469900,0.43526522806172147\n20170720 00:00,2471000,0.4352664586637311\n20170721 00:00,2468800,0.43573803018806345\n20170724 00:00,2468200,0.43670014284162867\n20170725 00:00,2474200,0.43790540551986906\n20170726 00:00,2474300,0.43924627721242304\n20170727 00:00,2472000,0.44033428214805254\n20170728 00:00,2469100,0.44122673598663853\n20170731 00:00,2467700,0.4422910676003471\n20170801 00:00,2473200,0.4431722683062559\n20170802 00:00,2474400,0.4446949314035271\n20170803 00:00,2469600,0.4458605570896495\n20170804 00:00,2474100,0.44679418270657434\n20170807 00:00,2478700,0.446612899213164\n20170808 00:00,2472600,0.44639017434821376\n20170809 00:00,2472500,0.4459140109950486\n20170810 00:00,2437600,0.4415692488698669\n20170811 00:00,2441200,0.43751776893035177\n20170814 00:00,2465400,0.4354154372216637\n20170815 00:00,2465100,0.43249408154344837\n20170816 00:00,2469400,0.43008183398151895\n20170817 00:00,2430900,0.4266827719530398\n20170818 00:00,2427100,0.4213603441535651\n20170821 00:00,2429000,0.41877643499099915\n20170822 00:00,2454400,0.4150706781712061\n20170823 00:00,2445600,0.41277737186133345\n20170824 00:00,2439900,0.4117665894095761\n20170825 00:00,2445600,0.4110143007594072\n20170828 00:00,2445700,0.41074169337501354\n20170829 00:00,2448500,0.4098947910479236\n20170830 00:00,2460100,0.40842661977902595\n20170831 00:00,2474900,0.4056167844717315\n20170901 00:00,2478400,0.4041006489327751\n20170905 00:00,2460600,0.4047009659395747\n20170906 00:00,2469000,0.4076819619566303\n20170907 00:00,2468700,0.4153645153837544\n20170908 00:00,2465800,0.4198792626917471\n20170911 00:00,2492100,0.41929454205097894\n20170912 00:00,2500500,0.4201195517248773\n20170913 00:00,2501700,0.42037514945403476\n20170914 00:00,2500900,0.4211646828779036\n20170915 00:00,2491900,0.4218212642769155\n20170918 00:00,2497200,0.4231936548309998\n20170919 00:00,2499700,0.4254397238029162\n20170920 00:00,2500600,0.4282205411257861\n20170921 00:00,2493900,0.42680115860675577\n20170922 00:00,2494400,0.42613030954621056\n20170925 00:00,2489300,0.42378699999016295\n20170926 00:00,2490800,0.4236387717007277\n20170927 00:00,2500500,0.42229034306088353\n20170928 00:00,2503500,0.42017996741410113\n20170929 00:00,2512300,0.4188399840050315\n20171002 00:00,2523200,0.41633008867583676\n20171003 00:00,2528600,0.41364228814233517\n20171004 00:00,2531600,0.41181446726658066\n20171005 00:00,2546600,0.40858749184774446\n20171006 00:00,2543700,0.40557705052484194\n20171009 00:00,2539500,0.402444529897867\n20171010 00:00,2546200,0.40058274002622923\n20171011 00:00,2550200,0.3987645399123355\n20171012 00:00,2546400,0.3971841526265967\n20171013 00:00,2549500,0.3963600253668573\n20171016 00:00,2552900,0.3957574166765762\n20171017 00:00,2554700,0.3963638715868593\n20171018 00:00,2557200,0.39627241252754514\n20171019 00:00,2557900,0.396628871996276\n20171020 00:00,2571100,0.3976884987237689\n20171023 00:00,2561100,0.39898626005094834\n20171024 00:00,2565600,0.40230186105431703\n20171025 00:00,2552900,0.4041689608437239\n20171026 00:00,2556200,0.4062513160091197\n20171027 00:00,2577100,0.40766316616493664\n20171030 00:00,2567500,0.4088579419137817\n20171031 00:00,2571500,0.4109743070671174\n20171101 00:00,2574900,0.40911943493395375\n20171102 00:00,2575900,0.40640458101288984\n20171103 00:00,2584500,0.40885300701648314\n20171106 00:00,2588500,0.4171354886972391\n20171107 00:00,2586700,0.41840140031955114\n20171108 00:00,2591100,0.4184445190465005\n20171109 00:00,2581700,0.41705586202030637\n20171110 00:00,2580900,0.41502205465271813\n20171113 00:00,2583300,0.4131130416056829\n20171114 00:00,2577300,0.41011849804551637\n20171115 00:00,2564400,0.4059097036487831\n20171116 00:00,2586200,0.40334239030006125\n20171117 00:00,2578600,0.40113746154167224\n20171120 00:00,2583000,0.39915055518175635\n20171121 00:00,2599900,0.3962728988613614\n20171122 00:00,2597600,0.39446886963245453\n20171124 00:00,2603600,0.392867942613163\n20171127 00:00,2602300,0.3931422941429022\n20171128 00:00,2628700,0.3899263511536772\n20171129 00:00,2627100,0.38872627528081366\n20171130 00:00,2650100,0.3864225906531704\n20171201 00:00,2644600,0.3886759669671884\n20171204 00:00,2641400,0.39498907953285534\n20171205 00:00,2631900,0.401312572704553\n20171206 00:00,2632400,0.40785801870148\n20171207 00:00,2640700,0.41000883204198585\n20171208 00:00,2655100,0.4120742048236556\n20171211 00:00,2663100,0.41333429749852885\n20171212 00:00,2667800,0.41545624124270075\n20171213 00:00,2667500,0.41900977573653897\n20171214 00:00,2656600,0.42037145956730876\n20171215 00:00,2665100,0.42248623619132475\n20171218 00:00,2682000,0.42469614465530436\n20171219 00:00,2671700,0.42618981189766436\n20171220 00:00,2670300,0.4273415022301709\n20171221 00:00,2675800,0.42858723802113563\n20171222 00:00,2675100,0.42970809940030974\n20171226 00:00,2671900,0.43099390813178295\n20171227 00:00,2673200,0.432960064479484\n20171228 00:00,2678700,0.4335631585587379\n20171229 00:00,2668600,0.4337359643325314\n20180102 00:00,2687700,0.43666593551609634\n20180103 00:00,2704700,0.4343508616205391\n20180104 00:00,2716100,0.4308532388561839\n20180105 00:00,2734200,0.42610729624819627\n20180108 00:00,2739200,0.42356732933376867\n20180109 00:00,2745400,0.4226803014057935\n20180110 00:00,2741200,0.4235942459685528\n20180111 00:00,2761200,0.4261615210678364\n20180112 00:00,2779200,0.4281551733953743\n20180116 00:00,2769700,0.4328847590491007\n20180117 00:00,2796100,0.43845032060595335\n20180118 00:00,2791400,0.4443153967531632\n20180119 00:00,2804100,0.4518086558524357\n20180122 00:00,2826900,0.4597691955793496\n20180123 00:00,2832900,0.46947859921260665\n20180124 00:00,2831800,0.4788765339882664\n20180125 00:00,2833000,0.4903795195900768\n20180126 00:00,2865800,0.5027344077171101\n20180129 00:00,2846800,0.5122427548334437\n20180130 00:00,2817600,0.5076085397341243\n20180131 00:00,2819000,0.5021695130332375\n20180201 00:00,2815800,0.4971151505332598\n20180202 00:00,2754500,0.46897938878520457\n20180205 00:00,2639300,0.37416716736006855\n20180206 00:00,2691300,0.34968524799124073\n20180207 00:00,2676700,0.33995340666846136\n20180208 00:00,2576300,0.33364387743866303\n20180209 00:00,2615000,0.3453455963784946\n20180212 00:00,2653400,0.35687252063364716\n20180213 00:00,2660000,0.3695478115296583\n20180214 00:00,2695900,0.374449535141845\n20180215 00:00,2730300,0.37010360233743883\n20180216 00:00,2731100,0.3711065580347135\n20180220 00:00,2714000,0.378922098446965\n20180221 00:00,2700500,0.3878387268840923\n20180222 00:00,2704000,0.396193442419223\n20180223 00:00,2747100,0.3985467004272135\n20180226 00:00,2779000,0.39426513044281597\n20180227 00:00,2744300,0.39694477244244625\n20180228 00:00,2716500,0.3969547300277524\n20180301 00:00,2677000,0.39072620898957733\n20180302 00:00,2690800,0.38804670395291574\n20180305 00:00,2721900,0.38679735284762035\n20180306 00:00,2728800,0.3856102541556193\n20180307 00:00,2727800,0.3853543837511078\n20180308 00:00,2741000,0.385943475856231\n20180309 00:00,2788700,0.3844563556358885\n20180312 00:00,2785200,0.38268157716768214\n20180313 00:00,2767200,0.38177599578391813\n20180314 00:00,2753000,0.3803624443321429\n20180315 00:00,2750000,0.3795420377342773\n20180316 00:00,2742000,0.37910630195278217\n20180319 00:00,2704900,0.3759430677508201\n20180320 00:00,2709500,0.3738232084041157\n20180321 00:00,2704300,0.37252227129912463\n20180322 00:00,2636700,0.36685682186896296\n20180323 00:00,2580500,0.35501063455300097\n20180326 00:00,2651100,0.35650455248436114\n20180327 00:00,2606000,0.3598973603544458\n20180328 00:00,2598300,0.3640147390802005\n20180329 00:00,2631500,0.368263772749594\n20180402 00:00,2574700,0.3785631042865622\n20180403 00:00,2607700,0.38727772701353813\n20180404 00:00,2635600,0.3917837259115684\n20180405 00:00,2656400,0.39322553202172067\n20180406 00:00,2597200,0.40253528775507486\n20180409 00:00,2610000,0.4095918722231212\n20180410 00:00,2651500,0.4118854866154796\n20180411 00:00,2637600,0.41521120431952147\n20180412 00:00,2659300,0.41635483785335453\n20180413 00:00,2651500,0.4174103449884104\n20180416 00:00,2673300,0.4171139772032268\n20180417 00:00,2701900,0.4152270312086025\n20180418 00:00,2703900,0.4145607347607603\n20180419 00:00,2688900,0.41557605476071935\n20180420 00:00,2666100,0.4151816462107815\n20180423 00:00,2665700,0.4158096557550284\n20180424 00:00,2629800,0.4124782860860269\n20180425 00:00,2636300,0.4104063318105537\n20180426 00:00,2663100,0.40995698470991115\n20180427 00:00,2665600,0.40943280065943033\n20180430 00:00,2645100,0.4091378119750605\n20180501 00:00,2649800,0.40889717946656057\n20180502 00:00,2632000,0.40850548318119234\n20180503 00:00,2626200,0.4082570479457568\n20180504 00:00,2660200,0.40810066393464217\n20180507 00:00,2669200,0.4071009363880843\n20180508 00:00,2669200,0.4066666413994745\n20180509 00:00,2695000,0.40530732585699736\n20180510 00:00,2720200,0.4026148489264686\n20180511 00:00,2728500,0.4006509779838673\n20180514 00:00,2729800,0.4000485989391262\n20180515 00:00,2711000,0.40140502651654114\n20180516 00:00,2722400,0.402411568159418\n20180517 00:00,2720100,0.4029145170572323\n20180518 00:00,2713300,0.40358108362192413\n20180521 00:00,2733700,0.40490177631724267\n20180522 00:00,2726100,0.40605707697350557\n20180523 00:00,2733600,0.4073819374593088\n20180524 00:00,2728000,0.4083877694670709\n20180525 00:00,2721500,0.40902488436545487\n20180529 00:00,2690200,0.4074485916592942\n20180530 00:00,2726100,0.40845916183672887\n20180531 00:00,2709400,0.40890575359716586\n20180601 00:00,2736000,0.40873700000375646\n20180604 00:00,2749000,0.40767494073636706\n20180605 00:00,2751000,0.40685881862546797\n20180606 00:00,2774000,0.40565380972265946\n20180607 00:00,2773700,0.4046545481164373\n20180608 00:00,2781900,0.40389236377851456\n20180611 00:00,2785600,0.40357906122787335\n20180612 00:00,2789200,0.4035769618227112\n20180613 00:00,2780300,0.40361216685638257\n20180614 00:00,2787300,0.4039652456740903\n20180615 00:00,2771300,0.40376661621680326\n20180618 00:00,2765600,0.40325147522895394\n20180619 00:00,2755000,0.402635657694961\n20180620 00:00,2759700,0.40232064822388697\n20180621 00:00,2742400,0.401573356732038\n20180622 00:00,2747400,0.40133676540205304\n20180625 00:00,2710000,0.39990647723846984\n20180626 00:00,2716000,0.39933039614983895\n20180627 00:00,2693500,0.39864708373303204\n20180628 00:00,2708900,0.3998148784301327\n20180629 00:00,2712800,0.40075738085378054\n20180702 00:00,2718600,0.40192611774762904\n20180703 00:00,2709000,0.40393424474242207\n20180705 00:00,2731100,0.4049354955591692\n20180706 00:00,2754200,0.40383303712867646\n20180709 00:00,2779000,0.40078276132044616\n20180710 00:00,2789000,0.39828384173797354\n20180711 00:00,2768600,0.3982983694526397\n20180712 00:00,2793700,0.39780945609864987\n20180713 00:00,2795900,0.3975296514596333\n20180716 00:00,2793400,0.39759920359990353\n20180717 00:00,2804700,0.39814643171265496\n20180718 00:00,2810600,0.3989997744355403\n20180719 00:00,2800000,0.3996674183993745\n20180720 00:00,2796800,0.40007566197522426\n20180723 00:00,2802000,0.40070697490554713\n20180724 00:00,2816100,0.4016910080947189\n20180725 00:00,2840100,0.40244812925820583\n20180726 00:00,2833400,0.4033671877861605\n20180727 00:00,2814200,0.4032495531425342\n20180730 00:00,2799500,0.40184980375026585\n20180731 00:00,2813300,0.4014771881041887\n20180801 00:00,2808600,0.4008055711684451\n20180802 00:00,2823900,0.40026286898041225\n20180803 00:00,2836000,0.3996396180448337\n20180806 00:00,2846400,0.3990751397055962\n20180807 00:00,2855800,0.3990143155666848\n20180808 00:00,2854600,0.3997098412658931\n20180809 00:00,2850700,0.40018424342734804\n20180810 00:00,2831600,0.4001283714814824\n20180813 00:00,2821000,0.3994181087084836\n20180814 00:00,2839000,0.39999984119151993\n20180815 00:00,2817800,0.40089212585252704\n20180816 00:00,2840600,0.4024481034982002\n20180817 00:00,2850600,0.4018498907423368\n20180820 00:00,2856700,0.4014240564104415\n20180821 00:00,2863400,0.40086568417904306\n20180822 00:00,2861700,0.40097147035713654\n20180823 00:00,2857900,0.4008207388844664\n20180824 00:00,2875100,0.40072262337072695\n20180827 00:00,2897800,0.40010837124378074\n20180828 00:00,2899200,0.3999446404698594\n20180829 00:00,2914800,0.40004115682061897\n20180830 00:00,2903000,0.40032788294286104\n20180831 00:00,2903100,0.4007266693382564\n20180904 00:00,2898100,0.4010021774006359\n20180905 00:00,2890300,0.40091915032685715\n20180906 00:00,2881600,0.4005349546124856\n20180907 00:00,2876000,0.4002165707898657\n20180910 00:00,2881000,0.4005661043473552\n20180911 00:00,2890500,0.4005635175660143\n20180912 00:00,2891200,0.4006355786273303\n20180913 00:00,2908300,0.4006720222479599\n20180914 00:00,2908800,0.40059296646070586\n20180917 00:00,2893400,0.4003674006487443\n20180918 00:00,2909100,0.40031558685014107\n20180919 00:00,2912200,0.4002461605997896\n20180920 00:00,2935800,0.39969183931598307\n20180921 00:00,2919900,0.39947199950561196\n20180924 00:00,2910200,0.3988766738658387\n20180925 00:00,2907500,0.3983128121311407\n20180926 00:00,2898800,0.3978188813857458\n20180927 00:00,2906900,0.3977515447744931\n20180928 00:00,2907200,0.39788069677758836\n20181001 00:00,2917300,0.39794742622657286\n20181002 00:00,2915600,0.3979959914432661\n20181003 00:00,2917200,0.3980892644396697\n20181004 00:00,2894400,0.3977193114964458\n20181005 00:00,2878200,0.39659926022540615\n20181008 00:00,2878200,0.39608787524783473\n20181009 00:00,2874000,0.39610557020670717\n20181010 00:00,2783000,0.3907770372003722\n20181011 00:00,2721700,0.3785181245059716\n20181012 00:00,2759500,0.3785199957968187\n20181015 00:00,2744000,0.38194301866288416\n20181016 00:00,2804000,0.3832133894818773\n20181017 00:00,2804500,0.3845083984574005\n20181018 00:00,2764000,0.39011470319880065\n20181019 00:00,2762500,0.3951653177433827\n20181022 00:00,2750100,0.4010845242276275\n20181023 00:00,2736100,0.40749074439451466\n20181024 00:00,2653200,0.4126201771612015\n20181025 00:00,2700800,0.4198854145286346\n20181026 00:00,2653300,0.4283051287679317\n20181029 00:00,2638600,0.4363675725199025\n20181030 00:00,2677700,0.4430143443498946\n20181031 00:00,2706300,0.4453853630698216\n20181101 00:00,2735100,0.444101890730828\n20181102 00:00,2718900,0.445111208927959\n20181105 00:00,2733900,0.4451645164103646\n20181106 00:00,2751200,0.4442000603678329\n20181107 00:00,2810100,0.43876974352976783\n20181108 00:00,2805000,0.4357490944002649\n20181109 00:00,2777600,0.4346735277524409\n20181112 00:00,2725700,0.43125345697736284\n20181113 00:00,2720600,0.4282398845158552\n20181114 00:00,2702000,0.4251530543486474\n20181115 00:00,2730200,0.423890386661155\n20181116 00:00,2737300,0.4229465859512902\n20181119 00:00,2691000,0.42127495639693774\n20181120 00:00,2641200,0.4156155941686855\n20181121 00:00,2650200,0.4128232022125267\n20181123 00:00,2632500,0.4113544289077703\n20181126 00:00,2675000,0.41125070741335534\n20181127 00:00,2684000,0.4108048984775117\n20181128 00:00,2745800,0.4060117529292234\n20181129 00:00,2739800,0.4027956449311933\n20181130 00:00,2756500,0.40034642161974004\n20181203 00:00,2793000,0.3967604726857067\n20181204 00:00,2702500,0.3959738973870938\n20181206 00:00,2698400,0.39314862947204754\n20181207 00:00,2635700,0.38841766043653086\n20181210 00:00,2640700,0.3853806772590088\n20181211 00:00,2641300,0.38358776959792157\n20181212 00:00,2654600,0.38244140039658353\n20181213 00:00,2653700,0.3816420603610431\n20181214 00:00,2604700,0.38052253139788433\n20181217 00:00,2553600,0.37700210509384524\n20181218 00:00,2550800,0.3751403007076973\n20181219 00:00,2512600,0.3745336210452515\n20181220 00:00,2471700,0.3741597700018981\n20181221 00:00,2407000,0.37440866555364943\n20181224 00:00,2343400,0.3764693760885597\n20181226 00:00,2461800,0.3809562455455577\n20181227 00:00,2480700,0.3799671705136851\n20181228 00:00,2477500,0.38155313240975663\n20181231 00:00,2499200,0.3815678520260124\n20190102 00:00,2501800,0.38173904213673016\n20190103 00:00,2442100,0.38501386860429065\n20190104 00:00,2523900,0.38348938540696015\n20190107 00:00,2543800,0.3792161296403848\n20190108 00:00,2567700,0.375108651499533\n20190109 00:00,2579700,0.37243234396383723\n20190110 00:00,2588800,0.37133310444939266\n20190111 00:00,2589800,0.3717387236030668\n20190114 00:00,2574000,0.3722028810446952\n20190115 00:00,2603500,0.37322301987644685\n20190116 00:00,2609800,0.37555780858518806\n20190117 00:00,2629600,0.37783847869043036\n20190118 00:00,2664600,0.38202091655753423\n20190122 00:00,2628600,0.3856597832475728\n20190123 00:00,2634100,0.3882542512486222\n20190124 00:00,2635500,0.390332616412787\n20190125 00:00,2657800,0.3922059848888072\n20190128 00:00,2637600,0.3936178842399588\n20190129 00:00,2634100,0.39610126179548955\n20190130 00:00,2675800,0.4007557834227845\n20190131 00:00,2699300,0.4063143546400584\n20190201 00:00,2700600,0.4160463262987339\n20190204 00:00,2719600,0.43082143557821084\n20190205 00:00,2731000,0.43743569104294705\n20190206 00:00,2727400,0.43922854570001063\n20190207 00:00,2701400,0.4442586278501796\n20190208 00:00,2704700,0.4460729207386116\n20190211 00:00,2706200,0.449094817273796\n20190212 00:00,2741000,0.4515530825233749\n20190213 00:00,2749900,0.4532365219900829\n20190214 00:00,2743800,0.45569745351179713\n20190215 00:00,2773700,0.45697120260636537\n20190219 00:00,2778500,0.45836986380692674\n20190220 00:00,2784100,0.46036478484237\n20190221 00:00,2774200,0.46218400301934365\n20190222 00:00,2791400,0.4650996462099421\n20190225 00:00,2795200,0.46806877387006385\n20190226 00:00,2793200,0.46941785939977404\n20190227 00:00,2792000,0.47241311765324173\n20190228 00:00,2786800,0.4737340245004686\n20190301 00:00,2804200,0.4740068638875637\n20190304 00:00,2794000,0.4759676417149699\n20190305 00:00,2790200,0.477105169850747\n20190306 00:00,2773300,0.476077071706703\n20190307 00:00,2750100,0.47409164456114716\n20190308 00:00,2744600,0.4731217000287888\n20190311 00:00,2784400,0.4713440451275292\n20190312 00:00,2794900,0.4670754058668368\n20190313 00:00,2813400,0.4633821678793502\n20190314 00:00,2811600,0.4608797839780099\n20190315 00:00,2813100,0.4596513051685625\n20190318 00:00,2823300,0.45985318228420374\n20190319 00:00,2824000,0.4612776319616392\n20190320 00:00,2815500,0.46318821743326655\n20190321 00:00,2847300,0.46787956080963616\n20190322 00:00,2792500,0.4739044376941864\n20190325 00:00,2790400,0.4729682190378624\n20190326 00:00,2811200,0.47224058542908176\n20190327 00:00,2796500,0.47348010694134995\n20190328 00:00,2807100,0.47340542524366563\n20190329 00:00,2824800,0.47315181558448854\n20190401 00:00,2858300,0.4722678521071329\n20190402 00:00,2859700,0.4730440165542531\n20190403 00:00,2864200,0.47348059739997234\n20190404 00:00,2871800,0.47418026468032515\n20190405 00:00,2885700,0.47496058005005964\n20190408 00:00,2887900,0.47671759490210064\n20190409 00:00,2873100,0.4779667708099417\n20190410 00:00,2882900,0.47851894115284466\n20190411 00:00,2882100,0.4796276600771342\n20190412 00:00,2901600,0.4805425038414313\n20190415 00:00,2899700,0.4821655334231564\n20190416 00:00,2901600,0.48308093371604655\n20190417 00:00,2894500,0.48433715105400676\n20190418 00:00,2900200,0.486434956530706\n20190422 00:00,2902700,0.48820177450113106\n20190423 00:00,2928800,0.48929229015516174\n20190424 00:00,2922300,0.49000762267223985\n20190425 00:00,2920500,0.49015870017859126\n20190426 00:00,2934100,0.49012327972067365\n20190429 00:00,2938700,0.49045452263221145\n20190430 00:00,2940200,0.49091182907363634\n20190501 00:00,2918100,0.49049862452924226\n20190502 00:00,2911800,0.48995849980166667\n20190503 00:00,2940300,0.49031980800970854\n20190506 00:00,2928200,0.4913638286657495\n20190507 00:00,2879300,0.48989515412659573\n20190508 00:00,2875300,0.4886689274742688\n20190509 00:00,2866600,0.48872856797145087\n20190510 00:00,2881000,0.48873638107181805\n20190513 00:00,2808600,0.4865850778387602\n20190514 00:00,2834000,0.48603191242031885\n20190515 00:00,2850600,0.4858276615499238\n20190516 00:00,2877000,0.4847301772244368\n20190517 00:00,2858400,0.48495945114338457\n20190520 00:00,2839500,0.48538342395047496\n20190521 00:00,2865100,0.4856391136024261\n20190522 00:00,2856300,0.48629931475262067\n20190523 00:00,2821400,0.4868829266578711\n20190524 00:00,2827800,0.48788929112735524\n20190528 00:00,2801500,0.4889779258616817\n20190529 00:00,2782700,0.4892977335660211\n20190530 00:00,2790300,0.4909315505217516\n20190531 00:00,2752700,0.4919509749738551\n20190603 00:00,2745700,0.4941177551903061\n20190604 00:00,2805300,0.4944116833026182\n20190605 00:00,2829600,0.49180399758161697\n20190606 00:00,2848000,0.48914894419817895\n20190607 00:00,2876500,0.48508247489768785\n20190610 00:00,2889700,0.4817231863548301\n20190611 00:00,2889000,0.4797647978658522\n20190612 00:00,2883900,0.4787601853920949\n20190613 00:00,2895800,0.47837218553778776\n20190614 00:00,2892600,0.478585617558804\n20190617 00:00,2893700,0.47955374734330564\n20190618 00:00,2924000,0.4807096236866025\n20190619 00:00,2930600,0.4820874554488437\n20190620 00:00,2958600,0.483775816135986\n20190621 00:00,2940000,0.48657870553798865\n20190624 00:00,2936400,0.4889513429148858\n20190625 00:00,2907600,0.4902939762141579\n20190626 00:00,2904700,0.489939022313054\n20190627 00:00,2915000,0.49012006106675443\n20190628 00:00,2930000,0.49017188198029954\n20190701 00:00,2956600,0.4899322135925954\n20190702 00:00,2964300,0.4895613213990204\n20190703 00:00,2988000,0.48923227198440594\n20190705 00:00,2984600,0.49028574438248995\n20190708 00:00,2968200,0.4911862946499308\n20190709 00:00,2971900,0.4916157604171401\n20190710 00:00,2986100,0.49198940689733245\n20190711 00:00,2993100,0.4923095744634785\n20190712 00:00,3006500,0.49280064229689374\n20190715 00:00,3007500,0.493202321639989\n20190716 00:00,2997100,0.4935483449949965\n20190717 00:00,2977400,0.4932517615371759\n20190718 00:00,2988300,0.4933867801061672\n20190719 00:00,2971700,0.4932736031724163\n20190722 00:00,2979000,0.4933883744847629\n20190723 00:00,3000300,0.49379910235691665\n20190724 00:00,3014400,0.49408186733840637\n20190725 00:00,3000000,0.49428416064954994\n20190726 00:00,3020100,0.49490172818042605\n20190729 00:00,3014600,0.49538687880086135\n20190730 00:00,3007200,0.49530622982029976\n20190731 00:00,2974300,0.4944280808051563\n20190801 00:00,2948400,0.4923477042727878\n20190802 00:00,2926200,0.49020745384481335\n20190805 00:00,2838200,0.4823436738420572\n20190806 00:00,2878000,0.4803844960021247\n20190807 00:00,2879700,0.4797069601451996\n20190808 00:00,2936200,0.478038167419224\n20190809 00:00,2916200,0.4780686760178211\n20190812 00:00,2881000,0.47887067775072123\n20190813 00:00,2925500,0.4787944424588867\n20190814 00:00,2839000,0.47947401571907733\n20190815 00:00,2846500,0.4795566063246195\n20190816 00:00,2888500,0.4803051834184784\n20190819 00:00,2923300,0.4785334001204223\n20190820 00:00,2900900,0.47893849172301295\n20190821 00:00,2924500,0.4787433656803003\n20190822 00:00,2923600,0.4787961732739045\n20190823 00:00,2848500,0.47842928764609527\n20190826 00:00,2880000,0.4790110746624722\n20190827 00:00,2868700,0.4791353122635835\n20190828 00:00,2888900,0.47906202037367446\n20190829 00:00,2925800,0.47782759462859287\n20190830 00:00,2924500,0.4772451199585628\n20190903 00:00,2907400,0.47717404332267777\n20190904 00:00,2940400,0.47703450993168905\n20190905 00:00,2978200,0.475500222547592\n20190906 00:00,2980500,0.47465082836595474\n20190909 00:00,2982000,0.4746757627057577\n20190910 00:00,2981300,0.4753481299464227\n20190911 00:00,3002500,0.4763657159546009\n20190912 00:00,3012900,0.4776555905409795\n20190913 00:00,3010900,0.47890048864186663\n20190916 00:00,3001600,0.47929901257153484\n20190917 00:00,3009200,0.47949994194392476\n20190918 00:00,3011000,0.4799601513418345\n20190919 00:00,3010800,0.47980085979322606\n20190920 00:00,2982800,0.478356670300187\n20190923 00:00,2982100,0.47624907722195353\n20190924 00:00,2958700,0.47316320799774286\n20190925 00:00,2976200,0.47078445235908883\n20190926 00:00,2970000,0.46802291486992165\n20190927 00:00,2954000,0.464683261015573\n20190930 00:00,2967700,0.46095712503388786\n20191001 00:00,2932400,0.4564315707276284\n20191002 00:00,2880600,0.4491689197100949\n20191003 00:00,2904200,0.4442894655854198\n20191004 00:00,2943500,0.43972341884161015\n20191007 00:00,2930800,0.43721781841058754\n20191008 00:00,2885300,0.43700286024616264\n20191009 00:00,2912700,0.44037549574761936\n20191010 00:00,2932400,0.4454184137837573\n20191011 00:00,2962800,0.4436126251200592\n20191014 00:00,2959500,0.4442386192598264\n20191015 00:00,2988800,0.4432804629417962\n20191016 00:00,2984000,0.4434628985340053\n20191017 00:00,2992800,0.44433939390261085\n20191018 00:00,2979700,0.44660477064026227\n20191021 00:00,2999900,0.44834801314487605\n20191022 00:00,2990100,0.4515526264788037\n20191023 00:00,2998800,0.4560723838235683\n20191024 00:00,3003700,0.45848196344402803\n20191025 00:00,3016000,0.4589999844679\n20191028 00:00,3033000,0.4605880020799757\n20191029 00:00,3032100,0.4627525396766791\n20191030 00:00,3041400,0.46757972247717544\n20191031 00:00,3033300,0.4703676376897976\n20191101 00:00,3061400,0.471966861206098\n20191104 00:00,3073700,0.4727914446513172\n20191105 00:00,3070300,0.4753277704257861\n20191106 00:00,3071000,0.4779175889161361\n20191107 00:00,3081800,0.4790800486893762\n20191108 00:00,3089400,0.48071245783078864\n20191111 00:00,3083500,0.48386419538169545\n20191112 00:00,3090000,0.48571180150414944\n20191113 00:00,3091000,0.486196722120877\n20191114 00:00,3095500,0.4867675470853881\n20191115 00:00,3117900,0.48757347799209066\n20191118 00:00,3120200,0.48912970525097893\n20191119 00:00,3119300,0.4922635215506241\n20191120 00:00,3107700,0.4916457375087581\n20191121 00:00,3102700,0.4911761746782857\n20191122 00:00,3109600,0.48986124313831847\n20191125 00:00,3133700,0.4901251046177716\n20191126 00:00,3140800,0.48572251018530294\n20191127 00:00,3154800,0.479502386491877\n20191129 00:00,3143100,0.46670852079142783\n20191202 00:00,3116400,0.45385601746684606\n20191203 00:00,3095500,0.4397153879288845\n20191204 00:00,3114600,0.42828944747729686\n20191205 00:00,3120200,0.4178119268562126\n20191206 00:00,3148700,0.40769466964799106\n20191209 00:00,3138800,0.4015560153288581\n20191210 00:00,3135300,0.39725194729570784\n20191211 00:00,3144200,0.39594669558509654\n20191212 00:00,3171300,0.39954547751153985\n20191213 00:00,3173200,0.41026368820299863\n20191216 00:00,3195000,0.41982471819716294\n20191217 00:00,3195700,0.4283846214520303\n20191218 00:00,3195900,0.442037784911203\n20191219 00:00,3209000,0.4533626050287748\n20191220 00:00,3207300,0.4587060770036187\n20191223 00:00,3212200,0.4562214442656677\n20191224 00:00,3212300,0.46059206688471255\n20191226 00:00,3229400,0.4584112696358338\n20191227 00:00,3228600,0.45713884123093107\n20191230 00:00,3210800,0.4556153602273493\n20191231 00:00,3218600,0.45603391021171535\n20200102 00:00,3248700,0.4553724112335664\n20200103 00:00,3224100,0.46063777163729147\n20200106 00:00,3236400,0.46020399630726033\n20200107 00:00,3227300,0.45897281276973667\n20200108 00:00,3244500,0.4578122580728861\n20200109 00:00,3266500,0.45634227613021305\n20200110 00:00,3257100,0.45551382358177317\n20200113 00:00,3279500,0.45445764860943855\n20200114 00:00,3274500,0.45421377128561286\n20200115 00:00,3281900,0.45374537767677564\n20200116 00:00,3309200,0.45327469487871386\n20200117 00:00,3319500,0.45195980461720553\n20200121 00:00,3313000,0.45311039334883896\n20200122 00:00,3313400,0.45219199919401937\n20200123 00:00,3317200,0.4516170931087195\n20200124 00:00,3287700,0.4494083009419213\n20200127 00:00,3235000,0.441463695173858\n20200128 00:00,3268900,0.43940559783539057\n20200129 00:00,3266200,0.4390178777082742\n20200130 00:00,3276800,0.4378644782842939\n20200131 00:00,3217300,0.4348248014544441\n20200203 00:00,3241200,0.43358624689306047\n20200204 00:00,3290600,0.4313721421645854\n20200205 00:00,3328600,0.4260968971540161\n20200206 00:00,3339800,0.4215987798042648\n20200207 00:00,3322000,0.4201933616395961\n20200210 00:00,3346800,0.4194807384093762\n20200211 00:00,3352600,0.41971306949798753\n20200212 00:00,3374200,0.41890222148935935\n20200213 00:00,3370600,0.41909251246254253\n20200214 00:00,3376000,0.4203103150382767\n20200218 00:00,3367300,0.4208782259056242\n20200219 00:00,3383400,0.4221148626242737\n20200220 00:00,3369500,0.42303685519351875\n20200221 00:00,3334800,0.421327950808956\n20200224 00:00,3224200,0.4010092451663003\n20200225 00:00,3126500,0.3635084502877722\n20200226 00:00,3115000,0.3441499628164823\n20200227 00:00,2975100,0.3244614297144498\n20200228 00:00,2962600,0.3214081742829969\n20200302 00:00,3090900,0.32604300572787487\n20200303 00:00,3002400,0.34360813632749504\n20200304 00:00,3128600,0.34882981422955384\n20200305 00:00,3024600,0.36816614733564346\n20200306 00:00,2974600,0.3864099959668354\n20200309 00:00,2742300,0.3960612404721433\n20200310 00:00,2884200,0.41654261482589017\n20200311 00:00,2743600,0.4409796620923254\n20200312 00:00,2481100,0.4427468614602597\n20200313 00:00,2693200,0.4643337340251805\n20200316 00:00,2398500,0.48667310630094524\n20200317 00:00,2528000,0.5065766563761009\n20200318 00:00,2400000,0.5291531157965972\n20200319 00:00,2405100,0.5492641126681045\n20200320 00:00,2288000,0.5692646369545031\n20200323 00:00,2229500,0.5853519802381408\n20200324 00:00,2431500,0.5951759083986754\n20200325 00:00,2467900,0.5956083501007029\n20200326 00:00,2612000,0.5833291884643541\n20200327 00:00,2534200,0.5844737488411558\n20200330 00:00,2616500,0.5820505067613976\n20200331 00:00,2577500,0.5827791740559275\n20200401 00:00,2461500,0.5837817244464738\n20200402 00:00,2518300,0.5850046897269279\n20200403 00:00,2481900,0.5857486438968912\n20200406 00:00,2648600,0.5828429545787412\n20200407 00:00,2651300,0.5792648514150706\n20200408 00:00,2740300,0.5754686963414578\n20200409 00:00,2782000,0.5729824219360083\n20200413 00:00,2756600,0.5742171779268797\n20200414 00:00,2837900,0.5766815232135293\n20200415 00:00,2777600,0.5802013829499557\n20200416 00:00,2791000,0.5842747386771335\n20200417 00:00,2866400,0.5889193441335782\n20200420 00:00,2815900,0.5934052345936573\n20200421 00:00,2730400,0.5935766102976916\n20200422 00:00,2791000,0.5954808812173378\n20200423 00:00,2790800,0.5968410938045855\n20200424 00:00,2829700,0.5983313732655583\n20200427 00:00,2870500,0.5994243398949627\n20200428 00:00,2857300,0.6008707159119914\n20200429 00:00,2932100,0.6019679152425318\n20200430 00:00,2904800,0.6034773155926253\n20200501 00:00,2827900,0.6032232478807619\n20200504 00:00,2835700,0.6034052362573551\n20200505 00:00,2861900,0.6038303721696571\n20200506 00:00,2842500,0.6037976395101348\n20200507 00:00,2876800,0.6039317523906933\n20200508 00:00,2924400,0.6035268681875272\n20200511 00:00,2925000,0.603315546481276\n20200512 00:00,2866700,0.6034721745340339\n20200513 00:00,2816000,0.6018815375303378\n20200514 00:00,2849700,0.6015187508651334\n20200515 00:00,2862800,0.6014671710669154\n20200518 00:00,2950000,0.6000655094816671\n20200519 00:00,2919700,0.5996038364912326\n20200520 00:00,2969300,0.5993487434155573\n20200521 00:00,2948800,0.5995767978271533\n20200522 00:00,2954400,0.5994800802153512\n20200526 00:00,2990800,0.5996018174288944\n20200527 00:00,3035300,0.5987545571555472\n20200528 00:00,3029700,0.598486395348782\n20200529 00:00,3043200,0.5987592339624102\n20200601 00:00,3055500,0.5996798891577478\n20200602 00:00,3080800,0.6014109069394857\n20200603 00:00,3121800,0.602097920355146\n20200604 00:00,3113600,0.6031647584715636\n20200605 00:00,3193400,0.6035967813488985\n20200608 00:00,3232000,0.6033003099058887\n20200609 00:00,3207900,0.6046661315848879\n20200610 00:00,3190000,0.6061568630434594\n20200611 00:00,3006100,0.5991916984981415\n20200612 00:00,3042100,0.5950771878422424\n20200615 00:00,3070500,0.5935990257347075\n20200616 00:00,3129600,0.592760145758789\n20200617 00:00,3116600,0.5923279710081505\n20200618 00:00,3117800,0.5921162219557141\n20200619 00:00,3086400,0.5921906981719535\n20200622 00:00,3106200,0.5923562955412162\n20200623 00:00,3120500,0.5924294301459334\n20200624 00:00,3040900,0.5919235465583488\n20200625 00:00,3073500,0.5919953959251613\n20200626 00:00,3000500,0.5915815658130635\n20200629 00:00,3044600,0.5918590539850099\n20200630 00:00,3083600,0.5915101083853915\n20200701 00:00,3105200,0.5909029752617767\n20200702 00:00,3122300,0.5903584696660882\n20200706 00:00,3170500,0.5890607550478475\n20200707 00:00,3137800,0.588829367268937\n20200708 00:00,3161800,0.5885551334310182\n20200709 00:00,3143800,0.5883822908982157\n20200710 00:00,3175900,0.5882280607006041\n20200713 00:00,3148400,0.5880782921452252\n20200714 00:00,3189200,0.5879663215798773\n20200715 00:00,3218500,0.5874508599450269\n20200716 00:00,3207900,0.5873543521116009\n20200717 00:00,3217200,0.5872788116078268\n20200720 00:00,3243200,0.5874630091116526\n20200721 00:00,3250100,0.5876797670469309\n20200722 00:00,3268600,0.5877712986257059\n20200723 00:00,3229600,0.5878501175745382\n20200724 00:00,3208800,0.5875869696395903\n20200727 00:00,3232200,0.5880411242168883\n20200728 00:00,3211700,0.5886944372979273\n20200729 00:00,3251200,0.5899512959733351\n20200730 00:00,3239600,0.5910755627855682\n20200731 00:00,3265200,0.5924207911402326\n20200803 00:00,3287900,0.5925548625117998\n20200804 00:00,3300600,0.5930206537381436\n20200805 00:00,3321100,0.5932101568028219\n20200806 00:00,3343300,0.5931650677593893\n20200807 00:00,3345700,0.5937908811935904\n20200810 00:00,3355700,0.5942999307471876\n20200811 00:00,3328000,0.5945811117629061\n20200812 00:00,3374400,0.5954968774871695\n20200813 00:00,3368300,0.595975889372349\n20200814 00:00,3368400,0.5966362800679267\n20200817 00:00,3379100,0.5968801983745644\n20200818 00:00,3386400,0.5973627081530744\n20200819 00:00,3372300,0.5976992895045481\n20200820 00:00,3382800,0.5987268228087353\n20200821 00:00,3394800,0.5993593427314479\n20200824 00:00,3429200,0.5993821195928603\n20200825 00:00,3441200,0.5993962572611925\n20200826 00:00,3475700,0.5995576561941489\n20200827 00:00,3483300,0.5997096327296637\n20200828 00:00,3505800,0.5998565403099723\n20200831 00:00,3493100,0.6002926809176156\n20200901 00:00,3526000,0.6013418062372802\n20200902 00:00,3577000,0.6013089984467399\n20200903 00:00,3453900,0.6005872512396854\n20200904 00:00,3425700,0.5976446520587982\n20200908 00:00,3332100,0.5922076916459376\n20200909 00:00,3397900,0.590761810641453\n20200910 00:00,3338900,0.5887531613859676\n20200911 00:00,3340600,0.5872914853641331\n20200914 00:00,3384600,0.5865567971768758\n20200915 00:00,3401700,0.5858381455829254\n20200916 00:00,3388200,0.585680336619199\n20200917 00:00,3358400,0.5858305194346286\n20200918 00:00,3306500,0.5856702314271219\n20200921 00:00,3269700,0.5852154047887749\n20200922 00:00,3303000,0.5859125360528944\n20200923 00:00,3226400,0.5865492586103971\n20200924 00:00,3235000,0.5876151470469702\n20200925 00:00,3287300,0.5887299880704033\n20200928 00:00,3341900,0.5882967472882215\n20200929 00:00,3323700,0.5893943548661711\n20200930 00:00,3348900,0.5893597899140205\n20201001 00:00,3370400,0.5890925669322336\n20201002 00:00,3338400,0.5890172551235984\n20201005 00:00,3397600,0.5889090705900625\n20201006 00:00,3349300,0.5888232700748126\n20201007 00:00,3407600,0.5888347250668715\n20201008 00:00,3437800,0.5882165596501358\n20201009 00:00,3468500,0.5874770967111309\n20201012 00:00,3524300,0.5861796988085134\n20201013 00:00,3501300,0.5860755107885234\n20201014 00:00,3479300,0.5862145113028414\n20201015 00:00,3475000,0.5864610841070127\n20201016 00:00,3472900,0.5868391500509004\n20201019 00:00,3420100,0.5862099501217287\n20201020 00:00,3433800,0.5859781071310147\n20201021 00:00,3427300,0.5858372772965225\n20201022 00:00,3446100,0.585912443822824\n20201023 00:00,3457800,0.5859755051304226\n20201026 00:00,3393900,0.5855212828737139\n20201027 00:00,3382200,0.5847311078031907\n20201028 00:00,3266600,0.581291744006088\n20201029 00:00,3299800,0.579933986901129\n20201030 00:00,3265400,0.5792759393816377\n20201102 00:00,3302000,0.5793949772419303\n20201103 00:00,3360300,0.5787013316783116\n20201104 00:00,3435400,0.5757859383267204\n20201105 00:00,3502400,0.5711107344762709\n20201106 00:00,3501600,0.5684263574971338\n20201109 00:00,3545600,0.5660260429179645\n20201110 00:00,3540400,0.5648376867021986\n20201111 00:00,3566700,0.5641796210934297\n20201112 00:00,3532100,0.5642134999020338\n20201113 00:00,3581000,0.5646062006590629\n20201116 00:00,3625700,0.5647759423949351\n20201117 00:00,3606200,0.565639286446392\n20201118 00:00,3562800,0.5661116331755581\n20201119 00:00,3577800,0.5669031216494207\n20201120 00:00,3553300,0.5675161320016873\n20201123 00:00,3574600,0.5685101578247057\n20201124 00:00,3632200,0.5694969922023613\n20201125 00:00,3626600,0.5705588684132795\n20201127 00:00,3636700,0.5718154708703058\n20201130 00:00,3620600,0.572756283418908\n20201201 00:00,3660200,0.5732254932286042\n20201202 00:00,3667900,0.5734178410307154\n20201203 00:00,3666900,0.5735776497039404\n20201204 00:00,3698500,0.5736157805930095\n20201207 00:00,3690900,0.5737671131763243\n20201208 00:00,3701700,0.5739399041833362\n20201209 00:00,3668500,0.5740525276982021\n20201210 00:00,3667300,0.5740702436190002\n20201211 00:00,3663000,0.5740371112042708\n20201214 00:00,3646600,0.5738687913727714\n20201215 00:00,3695900,0.5738786685724372\n20201216 00:00,3701700,0.5737351290212614\n20201217 00:00,3722400,0.573610770694959\n20201218 00:00,3691800,0.5735890223898134\n20201221 00:00,3678600,0.5733557688002386\n20201222 00:00,3672400,0.5731407592732727\n20201223 00:00,3675700,0.5730010188610763\n20201224 00:00,3690000,0.5729762579177274\n20201228 00:00,3721700,0.5727560243576453\n20201229 00:00,3714600,0.5727000289909213\n20201230 00:00,3719900,0.5726078590754782\n20201231 00:00,3738800,0.5725320309196944\n20210104 00:00,3687900,0.5724041260413882\n20210105 00:00,3713300,0.5723615637395947\n20210106 00:00,3735500,0.5723993547381461\n20210107 00:00,3791000,0.571767382946368\n20210108 00:00,3812600,0.5709815351067049\n20210111 00:00,3786900,0.5709431855655897\n20210112 00:00,3787700,0.5708904254221592\n20210113 00:00,3797900,0.5710439874767561\n20210114 00:00,3784600,0.5711644287134439\n20210115 00:00,3757000,0.5709586169582948\n20210119 00:00,3786500,0.5711879531570336\n20210120 00:00,3838900,0.5711416404024924\n20210121 00:00,3842400,0.5714139659954879\n20210122 00:00,3828800,0.5723259416977756\n20210125 00:00,3843900,0.5725323277087295\n20210126 00:00,3837900,0.5725394730790694\n20210127 00:00,3744100,0.5710164418194464\n20210128 00:00,3776300,0.5700987306618831\n20210129 00:00,3700700,0.56784646899851\n20210201 00:00,3762300,0.568041585135663\n20210202 00:00,3815500,0.5671367281104945\n20210203 00:00,3818500,0.5652856760451395\n20210204 00:00,3861900,0.5622535443447124\n20210205 00:00,3877100,0.5587373826027323\n20210208 00:00,3905100,0.5546664220289743\n20210209 00:00,3902500,0.5499152394212625\n20210210 00:00,3900800,0.544252172385425\n20210211 00:00,3907100,0.5358705544240716\n20210212 00:00,3926400,0.5266089988589662\n20210216 00:00,3923000,0.5145842623669022\n20210217 00:00,3923900,0.5012810100278636\n20210218 00:00,3907200,0.485846257555784\n20210219 00:00,3900300,0.4698477604498517\n20210222 00:00,3870300,0.45114405964672344\n20210223 00:00,3875000,0.42759049024971163\n20210224 00:00,3917700,0.4048651576472696\n20210225 00:00,3823300,0.37889210905911047\n20210226 00:00,3803600,0.3597088518882273\n20210301 00:00,3895800,0.34209484691630876\n20210302 00:00,3865400,0.31808606060527156\n20210303 00:00,3814200,0.30066291703393283\n20210304 00:00,3767000,0.28426159489297687\n20210305 00:00,3836300,0.2770239013196848\n20210308 00:00,3817200,0.2711009524133687\n20210309 00:00,3871700,0.2718822562642916\n20210310 00:00,3895800,0.29035842837021014\n20210311 00:00,3935300,0.298652566076316\n20210312 00:00,3940600,0.2999219468971442\n20210315 00:00,3964100,0.31529009687327986\n20210316 00:00,3959100,0.31250597267623526\n20210317 00:00,3972600,0.32008915377034963\n20210318 00:00,3914800,0.318405827779393\n20210319 00:00,3894800,0.31534224408575356\n20210322 00:00,3925900,0.3085773185533856\n20210323 00:00,3895000,0.307839097747215\n20210324 00:00,3875200,0.3046323064335909\n20210325 00:00,3897000,0.3000920678700258\n20210326 00:00,3959800,0.3001520770437371\n20210329 00:00,3957800,0.29675447473389954\n20210330 00:00,3947300,0.3005158626108986\n20210331 00:00,3963300,0.2992306870606738\n"
  },
  {
    "path": "Tests/TestData/spy_kama.txt",
    "content": "Date,Open,High,Low,Close,Volume,KAMA_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,151.613577549107\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,152.063324152226\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,152.844959173542\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,153.351835433195\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,153.986575240664\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,154.632541800369\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,155.253634333538\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,155.345821067761\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,155.466138432065\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,155.791792481001\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,155.792604406384\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,155.734179728483\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,155.653577774124\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,155.65391269841\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,155.467515405204\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,155.468660142293\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,155.466324889239\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,155.506715655941\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,155.518625134156\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.751598018024\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,155.758780155455\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,155.951891691908\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,155.913174875295\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,155.91249467819\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.855389106846\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.857941647668\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.862808376066\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,156.543685063363\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,157.175026788024\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,157.68535539033\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,157.621625918128\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,157.619080241111\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,157.396219246351\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.92531408574\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,156.832456390307\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,156.817981692363\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,156.826988331873\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,157.011544858843\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,157.681969366024\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,157.860169194428\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,158.336682604285\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,158.713439367229\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.706273984842\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,158.759525196577\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,159.141146513803\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,159.459519279834\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,159.893895841761\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,161.425497689867\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,161.833885253573\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,162.196283740353\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,162.480562519712\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,163.197420863378\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,163.978421118935\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,164.233697829365\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,164.862743570197\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,165.329636863289\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,165.618794039689\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,165.621548483938\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,165.620364698267\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,165.533287001194\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,165.560179883872\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,165.515282301147\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.51743803342\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,165.336159677804\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,165.310436242239\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,165.094835063328\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,164.46509865106\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,164.305569249317\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,164.320325850645\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,164.325665729282\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,164.31307595678\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,164.28293503381\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,164.280516838931\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,164.230271624542\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,164.23205865922\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,164.349722393316\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,164.318173581185\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,163.694190470723\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,163.182508251557\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,161.591331423349\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,160.871206222297\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,160.815915715207\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,160.829116146183\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,160.814958356937\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,160.965320718254\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,161.012192373206\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,161.038467872491\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,161.343975410032\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,162.344118852854\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,163.422909593579\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,164.208283107544\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,165.644601726413\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,166.473667625785\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,167.218704236547\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,167.282126500354\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.434682079828\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,167.647010610855\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,167.899087255109\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,168.125385757124\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,168.360508328194\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,168.366899388053\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,168.370722872043\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,168.375881175481\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,168.398734207691\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,168.411264231178\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,168.418677686572\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,168.853759171976\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,169.276784089297\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,169.709363584556\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,169.710718786467\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,169.701033195038\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,169.707607731361\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.641612483769\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.555348005014\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.5558426312\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.534066212974\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,168.646639051376\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,167.848689018351\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,166.904116202458\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,166.580965009696\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,166.078791373203\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,166.078589990384\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,166.09255717515\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,166.087714441998\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,165.875801916487\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,165.842313997919\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,165.68452155883\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,165.274148923808\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,165.210760579339\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,165.33795566843\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,165.471879967644\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,165.587674611045\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,166.495374783914\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,167.550763768841\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,168.372646538245\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,168.533208388179\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,168.763257839255\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,169.173951546307\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,169.632634508459\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,170.657235582479\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,171.382058221959\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,171.354812691155\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,171.339531026828\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,171.24119363336\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,170.262885351866\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,170.126714779117\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,169.917202561836\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.575040662803\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,169.573047623975\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,169.570100996632\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,169.360254565347\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,169.358154717591\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,169.328056437436\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,168.624180834259\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,168.131898661183\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,168.164064202488\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,168.221293673213\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,168.553850715547\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,168.779575258074\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,169.601568815623\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,170.295675171627\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,171.09102782058\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,171.661640155883\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,173.327577864379\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,173.55162512598\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,173.79032166952\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,174.06163782754\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,174.372213108144\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,174.76061770358\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,174.961178893224\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,174.987398591826\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,175.003951305561\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,175.058000151182\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,175.131568526514\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,175.250107094189\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,175.240441462152\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,175.294143656765\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,175.319995804835\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,175.349909986467\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,175.446112444374\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,176.736841845129\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,177.710429413785\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,177.950128683348\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,178.096201546798\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,178.098665622224\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,178.14853724072\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,178.235979713626\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,178.416353877697\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,178.746576864662\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,179.585835973841\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,179.875888362509\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,179.901617020618\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,179.883107077507\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,179.861333659224\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,179.451852032903\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.459872775941\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,179.532791309055\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,179.590704801577\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,179.566400000473\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.534237284301\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.150693379056\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.159818516045\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,179.094759563747\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.512740332357\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,179.954034957661\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,180.322771840121\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,180.818224187781\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,181.611395099588\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,182.334286001044\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,183.007936667247\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.352189110612\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,183.91809673584\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,183.913723505138\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,183.832652936223\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,183.660114973809\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,183.657859337724\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,183.648076836764\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183.647349241619\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,183.723977812959\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,183.670938297756\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,183.670931211235\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,183.702195661378\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,183.716368467698\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.715285432005\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,183.787661342297\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,183.809306004561\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.633500736506\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,182.202676336697\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,180.930997923088\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,180.508580044707\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,179.634937749785\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,179.600506062121\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,179.576723823092\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,179.082292824903\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,178.771710623611\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,178.594944760356\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,178.557033630698\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,178.584146712051\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,179.143380762269\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,180.271525574821\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,181.070847541567\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,181.932693078649\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,182.860385043694\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,183.473547246496\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,183.446440917395\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,183.521095515117\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,183.536780546622\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,183.595864360776\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,183.629684468593\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,183.966773672592\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,184.465518311578\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,185.197670858678\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,185.196298226756\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,185.52675327196\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,185.849250500221\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,186.134559509746\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,186.356243448883\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,187.074511952757\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,187.07999369358\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,187.091756314862\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,186.360091982471\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,185.64093576682\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,185.69252156278\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,185.716406836978\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,185.730201644284\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,185.964195523857\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,185.974025271971\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,185.960283880489\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,185.976931862253\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,185.91635835397\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,185.643697120513\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,185.639554569649\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,185.727473531838\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,185.926434054753\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.874373467013\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,187.507444985696\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,187.47984600511\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,187.167633939323\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.862150167575\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,186.87242635693\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,186.376389275688\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,185.787337323192\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,185.722509582968\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,185.701547945974\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,185.707759418164\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,185.798026617208\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,186.350014787338\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,187.034452659632\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,187.154892887524\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,187.299037225161\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.292560664384\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,187.28922858212\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,187.292682926011\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,187.331744242942\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,187.353147208319\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,187.55165255445\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,187.781662716039\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,187.708150113145\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,187.711583565334\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,187.710640835353\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,187.712290481147\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,187.820176724094\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,188.588940564015\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,188.624495645428\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,188.612409043624\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,188.609252409828\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,188.615572661911\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,188.485322700216\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,188.488648133776\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.625944068776\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.849934212804\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,189.253827014584\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,190.086076441504\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,190.960531947974\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,191.614343157937\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,192.088182515596\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.267880672178\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.607356142732\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,193.30167808855\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,194.113883846524\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,194.686311809143\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,195.092395449524\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,195.064585187408\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,194.980232798946\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,194.889442315516\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,194.8205559825\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.820944857707\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,194.919212664415\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,195.612895924675\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,195.676696678524\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,195.710485830773\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,195.702777890955\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,195.697532698122\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.676146377726\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.677360955255\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.677791323907\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,196.107631011846\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,196.424060455231\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,197.119965893608\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,197.175025058813\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,197.157974565724\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,197.157743346387\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,197.130872385193\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,197.080609861707\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,197.083725436828\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,197.092556556288\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,197.136705788638\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,197.1059575564\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,197.123207611262\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,197.125038021645\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,197.152067974259\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,197.178658652176\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,197.616617780475\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,197.617079417506\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,197.62326618843\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,197.520675802422\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.33208002046\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,195.574116376398\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,194.305832649565\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,194.234795427449\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,193.790542669686\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,193.452770748699\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,193.212977135915\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,193.213449661622\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,193.216693324325\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,193.242440545744\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,193.467244317204\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,194.312077691762\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.736990726683\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,195.619451075492\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,196.815047202702\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,197.718364076524\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,198.480529203325\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,198.715413942185\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,199.178931999596\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,199.491179178525\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,199.640817746223\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,199.685595028905\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,199.99125122553\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.052215267158\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.065163504036\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.066208175958\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.20224106526\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.206287225956\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,200.117842489796\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,200.116984289573\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,200.11813468178\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.98495697909\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.871451230996\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.908979240251\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,199.938656284119\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.090967691302\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.143801665531\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.136939804163\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,199.87143142893\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,199.861789338719\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,199.151456393925\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,199.072338945126\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,199.017989675954\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,198.974699323808\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,198.074747559981\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,197.7551059737\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,197.70074657342\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,197.644786817379\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,197.125809363482\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,197.102074591282\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,197.013625467556\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,196.233431710625\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,194.7761301119\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,194.033087639025\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,190.974097858943\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,189.182556213058\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,189.141061022772\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,189.297295383979\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,190.397315143696\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,190.899680244473\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,191.994254584861\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,193.155403004073\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,193.763116711541\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,194.531263291751\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,195.661684975507\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,196.761529193209\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,198.291679606319\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,199.579553780741\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,199.827942827406\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,200.499209348403\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,201.171506890015\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,201.506363507028\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,201.970455268614\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,202.95247514923\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,203.244153535667\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,203.46907723227\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,203.638610835535\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,203.726907436844\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,204.220416979046\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,204.43163219985\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,204.688342027288\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,205.265816435523\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,205.879449777442\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,206.11474363945\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,206.664299102816\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,206.755630252655\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,206.697830689951\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,206.701066206478\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,206.734610412934\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,206.738808806419\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,206.780069058323\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,206.773951683802\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,206.762600230294\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,205.504363614726\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.293030025108\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,204.049693910105\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,202.768478780662\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,201.29950853766\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,201.308881686082\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,201.46230384649\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,202.062409439758\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,203.281910690765\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,205.09175297133\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,206.116277804028\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,206.75196689729\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.626648276272\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,207.62639471469\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,207.316850536544\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,207.01971296866\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,204.980219710643\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,202.686788728135\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,202.6338933857\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,202.656332274626\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,202.67843977028\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,202.678067682253\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,202.653669744226\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,202.604428654988\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,201.011349252771\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,201.055038621635\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,201.069072422465\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,201.11376967607\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,201.986008770085\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,202.734725215521\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,203.267212669759\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,203.260342275763\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,203.076669552967\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,202.946043502695\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,202.411493662777\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,202.383378061192\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,202.451610447322\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,202.58505535226\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,202.893569613522\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,203.510506888077\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,203.604394022832\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,203.79954340253\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,204.205093163751\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,204.803364752856\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,205.969829975851\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,207.80990554214\n"
  },
  {
    "path": "Tests/TestData/spy_ker.txt",
    "content": "Date,Open,High,Low,Close,KER\n2021-09-09T14:30:00Z,452.23,452.57,450.82,450.84,0.170138889\n2021-09-09T15:30:00Z,450.85,451.26,450.47,450.73,0.14028777\n2021-09-09T16:30:00Z,450.73,451.09,449.34,449.79,0.174438687\n2021-09-09T17:30:00Z,449.78,449.78,448.73,449.4,0.116451017\n2021-09-09T18:30:00Z,449.41,449.99,448.95,449.51,0.250517598\n2021-09-09T19:30:00Z,449.5,450.14,448.75,448.96,0.301158301\n2021-09-10T13:30:00Z,451.04,451.48,448.69,448.99,0.339960239\n2021-09-10T14:30:00Z,448.98,448.98,447.43,447.51,0.494607088\n2021-09-10T15:30:00Z,447.5,448.86,447.34,448.82,0.283068783\n2021-09-10T16:30:00Z,448.85,449.38,448.75,448.77,0.543307087\n2021-09-10T17:30:00Z,448.79,449.15,448.09,448.1,0.485815603\n2021-09-10T18:30:00Z,448.1,448.2,446.8,446.86,0.571639586\n2021-09-10T19:30:00Z,446.83,447.01,445.315,445.51,0.596100279\n2021-09-13T13:30:00Z,448.64,448.91,445.47,446.03,0.461012312\n2021-09-13T14:30:00Z,446.01,447.09,444.89,445.82,0.497975709\n2021-09-13T15:30:00Z,445.9,446.28,445.11,445.84,0.453488372\n2021-09-13T16:30:00Z,445.84,446.36,445.17,445.29,0.5\n2021-09-13T17:30:00Z,445.3,445.38,444.28,444.45,0.452662722\n2021-09-13T18:30:00Z,444.5,446.03,444.11,445.99,0.404864092\n2021-09-13T19:30:00Z,445.99,446.58,445.42,446.56,0.294274301\n2021-09-14T13:30:00Z,448.12,448.34,445.14,445.85,0.298013245\n2021-09-14T14:30:00Z,445.83,445.91,444.61,445.7,0.179566563\n2021-09-14T15:30:00Z,445.69,446.28,445.49,445.88,0.069943289\n2021-09-14T16:30:00Z,445.87,445.87,444.07,444.91,0.195121951\n2021-09-14T17:30:00Z,444.88,445.21,443.81,444,0.282608696\n2021-09-14T18:30:00Z,443.98,444.29,443.23,443.44,0.343839542\n2021-09-14T19:30:00Z,443.44,444.255,443.255,444.16,0.158041958\n2021-09-15T13:30:00Z,444.62,445.5,443.44,444.41,0.006097561\n2021-09-15T14:30:00Z,444.41,445.57,444.22,445.3,0.116751269\n2021-09-15T15:30:00Z,445.29,446.15,444.82,445.93,0.105527638\n2021-09-15T16:30:00Z,445.96,447.52,445.96,447.41,0.231454006\n2021-09-15T17:30:00Z,447.44,447.93,447.17,447.33,0.244377811\n2021-09-15T18:30:00Z,447.35,448.16,447.19,447.92,0.288135593\n2021-09-15T19:30:00Z,447.94,448.41,447.63,447.86,0.478119935\n2021-09-16T13:30:00Z,447.32,448.27,444.56,445.33,0.170731707\n2021-09-16T14:30:00Z,445.27,445.7,444.02,444.94,0.196850394\n2021-09-16T15:30:00Z,444.88,445.94,444.62,445.65,0.195795007\n2021-09-16T16:30:00Z,445.67,446.35,445.59,446.01,0.207253886\n2021-09-16T17:30:00Z,445.99,447.24,445.43,446.85,0.20208605\n2021-09-16T18:30:00Z,446.88,448.35,446.79,447.42,0.195795007\n2021-09-16T19:30:00Z,447.43,447.8,447,447.15,0.040625\n2021-09-17T13:30:00Z,444.92,445.36,442.45,443.2,0.402142162\n2021-09-17T14:30:00Z,443.2,443.2,441.8,442.34,0.529411765\n2021-09-17T15:30:00Z,442.33,442.97,441.64,442.58,0.492537313\n2021-09-17T16:30:00Z,442.57,443.23,441.64,442.06,0.37543054\n2021-09-17T17:30:00Z,442.07,442.2,441.02,441.37,0.396226415\n2021-09-17T18:30:00Z,441.35,442.14,441.03,441.5,0.492289442\n2021-09-17T19:30:00Z,441.47,442.22,441.12,441.42,0.563190184\n2021-09-20T13:30:00Z,434.88,436.54,433.88,434.83,0.864748201\n2021-09-20T14:30:00Z,434.78,435.42,433.64,434.9,0.934328358\n2021-09-20T15:30:00Z,434.87,434.94,431.815,432.53,0.943225806\n2021-09-20T16:30:00Z,432.49,432.69,430.7,431.96,0.927392739\n2021-09-20T17:30:00Z,431.95,432.4,430,430.14,0.932721713\n2021-09-20T18:30:00Z,430.12,430.91,428.86,430.91,0.857457752\n2021-09-20T19:30:00Z,430.91,434.42,430.73,434.1,0.488943489\n2021-09-21T13:30:00Z,436.54,437.91,434.43,435.34,0.35828877\n2021-09-21T14:30:00Z,435.34,435.45,433.08,434.54,0.397714286\n2021-09-21T15:30:00Z,434.55,436.96,434.55,436.08,0.28164557\n2021-09-21T16:30:00Z,436.08,436.26,434.24,434.36,0.033356991\n2021-09-21T17:30:00Z,434.34,434.96,433.55,433.65,0.084860828\n2021-09-21T18:30:00Z,433.68,436.05,433.61,435.72,0.221067221\n2021-09-21T19:30:00Z,435.69,436.02,433.54,433.67,0.107479573\n2021-09-22T13:30:00Z,436.04,437.725,435.07,437.4,0.407407407\n2021-09-22T14:30:00Z,437.4,438.3,437.27,438.17,0.407407407\n2021-09-22T15:30:00Z,438.17,439.57,438.17,438.8,0.307994758\n2021-09-22T16:30:00Z,438.81,439.03,437.81,438.3,0.203856749\n2021-09-22T17:30:00Z,438.28,440.03,436.97,439.48,0.331543624\n2021-09-22T18:30:00Z,439.46,439.72,436.61,438.98,0.209235209\n2021-09-22T19:30:00Z,438.97,439.24,437.55,437.84,0.262048193\n2021-09-23T13:30:00Z,439.85,443.64,439.6,443.27,0.534444444\n2021-09-23T14:30:00Z,443.26,443.92,442.82,443.36,0.47690387\n2021-09-23T15:30:00Z,443.37,443.76,443.14,443.7,0.700908456\n2021-09-23T16:30:00Z,443.7,444.45,443.67,444.41,0.620903454\n2021-09-23T17:30:00Z,444.44,444.88,444.24,444.29,0.57518797\n2021-09-23T18:30:00Z,444.32,444.59,443.61,443.73,0.46641438\n2021-09-23T19:30:00Z,443.77,444,443.03,443.05,0.441860465\n2021-09-24T13:30:00Z,441.44,443.91,441.21,443.12,0.377593361\n2021-09-24T14:30:00Z,443.1,443.27,442.22,442.29,0.331995988\n2021-09-24T15:30:00Z,442.3,443.61,442.14,443.38,0.558467742\n2021-09-24T16:30:00Z,443.47,443.66,443.2,443.49,0.047826087\n2021-09-24T17:30:00Z,443.48,443.48,442.8,443.17,0.039337474\n2021-09-24T18:30:00Z,443.14,444.27,443.12,444.07,0.06864564\n2021-09-24T19:30:00Z,444.08,444.665,443.88,443.93,0.099585062\n2021-09-27T13:30:00Z,442.81,443.82,441.9,443.82,0.097713098\n2021-09-27T14:30:00Z,443.82,444.04,442.89,443.06,0.133732535\n2021-09-27T15:30:00Z,443.07,443.3,442.33,443.075,0.00575374\n2021-09-27T16:30:00Z,443.05,443.16,442.08,443.09,0.006993007\n2021-09-27T17:30:00Z,443.07,443.71,442.76,443.65,0.338308458\n2021-09-27T18:30:00Z,443.66,443.69,443.05,443.25,0.039039039\n2021-09-27T19:30:00Z,443.28,443.46,442.32,442.68,0.213720317\n2021-09-28T13:30:00Z,439.69,440.03,434.96,435.85,0.710679612\n2021-09-28T14:30:00Z,435.84,436.6,433.805,434.63,0.888888889\n2021-09-28T15:30:00Z,434.64,435.13,433.66,434.62,0.887511916\n2021-09-28T16:30:00Z,434.6,435.02,432.95,434.67,0.877277085\n2021-09-28T17:30:00Z,434.665,435.22,433.02,435.22,0.767123288\n2021-09-28T18:30:00Z,435.14,436.67,434.25,434.8,0.778823529\n2021-09-28T19:30:00Z,434.8,435.57,433.17,433.74,0.801199657\n2021-09-29T13:30:00Z,435.19,436.96,434.03,436.27,0.541055718\n2021-09-29T14:30:00Z,436.27,437.04,435.5,435.79,0.543731778\n"
  },
  {
    "path": "Tests/TestData/spy_logr14.txt",
    "content": "﻿Date,Open,High,Low,Close,LOGR14\n8/30/2013 12:00:00 AM,164.51,164.53,163.17,163.65,\n9/3/2013 12:00:00 AM,165.23,165.58,163.7,164.39,\n9/4/2013 12:00:00 AM,164.43,166.03,164.135,165.75,\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,\n9/6/2013 12:00:00 AM,166.51,166.98,164.48,166.04,\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.634,\n9/10/2013 12:00:00 AM,168.64,168.9,168.26,168.87,\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,\n9/12/2013 12:00:00 AM,169.34,169.56,168.72,168.95,\n9/13/2013 12:00:00 AM,169.13,169.46,168.74,169.33,\n9/16/2013 12:00:00 AM,171.16,171.24,170.04,170.31,\n9/17/2013 12:00:00 AM,170.46,171.11,170.46,171.07,\n9/18/2013 12:00:00 AM,171.01,173.52,170.58,173.051,\n9/19/2013 12:00:00 AM,173.52,173.6,172.585,172.76,\n9/20/2013 12:00:00 AM,172.33,172.33,170.58,170.72,0.04229483\n9/23/2013 12:00:00 AM,170.49,170.65,169.39,169.93,0.03314489\n9/24/2013 12:00:00 AM,169.9,170.53,169.21,169.53,0.02254927\n9/25/2013 12:00:00 AM,169.64,169.98,168.89,169.04,0.0183885\n9/26/2013 12:00:00 AM,169.32,170.17,169.05,169.69,0.02174458\n9/27/2013 12:00:00 AM,168.84,169.14,168.47,168.909,0.007577041\n9/30/2013 12:00:00 AM,167.48,168.54,167.15,168.01,-0.005105691\n10/1/2013 12:00:00 AM,168.14,169.5,167.9671,169.34,-0.0003542396\n10/2/2013 12:00:00 AM,168.35,169.3422,167.83,169.18,0.001360398\n10/3/2013 12:00:00 AM,168.79,168.94,166.84,167.62,-0.01015\n10/4/2013 12:00:00 AM,167.75,169.06,167.53,168.89,-0.008372679\n10/7/2013 12:00:00 AM,167.42,168.45,167.25,167.43,-0.02150756\n10/8/2013 12:00:00 AM,167.4,167.62,165.36,165.48,-0.044736\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-0.04232804\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,-0.009120679\n10/11/2013 12:00:00 AM,168.91,170.32,168.77,170.26,0.001940104\n10/14/2013 12:00:00 AM,169.21,171.08,169.08,170.94,0.008282737\n10/15/2013 12:00:00 AM,170.51,171.15,169.47,169.7,0.003896821\n10/16/2013 12:00:00 AM,170.72,172.16,170.635,172.07,0.01392816\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,0.02520238\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.388,0.03725924\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,0.02944297\n10/22/2013 12:00:00 AM,174.91,175.93,174.4262,175.41,0.03616292\n10/23/2013 12:00:00 AM,174.81,174.89,173.96,174.57,0.04062637\n10/24/2013 12:00:00 AM,174.92,175.37,174.51,175.15,0.0363951\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,0.04963453\n10/28/2013 12:00:00 AM,175.89,176.47,175.7,176.23,0.06293962\n10/29/2013 12:00:00 AM,176.63,177.24,176.38,177.17,0.06753443\n10/30/2013 12:00:00 AM,177.38,177.51,175.66,176.29,0.04122621\n10/31/2013 12:00:00 AM,176.15,176.89,175.53,175.79,0.03196342\n11/1/2013 12:00:00 AM,176.02,176.61,175.22,176.21,0.03036387\n11/4/2013 12:00:00 AM,176.69,176.9,175.9825,176.83,0.04115668\n11/5/2013 12:00:00 AM,176.14,176.75,175.57,176.27,0.02411552\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,0.02254724\n11/7/2013 12:00:00 AM,177.5,177.64,174.76,174.93,0.003103147\n11/8/2013 12:00:00 AM,174.87,177.31,174.85,177.29,0.0164353\n11/11/2013 12:00:00 AM,177.12,177.53,176.91,177.32,0.01082994\n11/12/2013 12:00:00 AM,176.94,177.36,176.37,176.96,0.01359791\n11/13/2013 12:00:00 AM,176.09,178.4261,176.09,178.38,0.01827342\n11/14/2013 12:00:00 AM,178.54,179.42,178.25,179.27,0.01869323\n11/15/2013 12:00:00 AM,179.56,180.12,179.33,180.05,0.02144467\n11/18/2013 12:00:00 AM,180.35,180.5,179.02,179.42,0.0126197\n11/19/2013 12:00:00 AM,179.33,179.87,178.72,179.03,0.01542305\n11/20/2013 12:00:00 AM,179.39,179.93,177.98,178.47,0.01513046\n11/21/2013 12:00:00 AM,178.97,180.05,178.86,179.91,0.02078024\n11/22/2013 12:00:00 AM,179.98,180.83,179.77,180.81,0.02225791\n11/25/2013 12:00:00 AM,181.13,181.17,180.37,180.63,0.02443383\n11/26/2013 12:00:00 AM,180.72,181.22,180.405,180.68,0.01961776\n11/27/2013 12:00:00 AM,180.87,181.24,180.65,181.12,0.03477392\n11/29/2013 12:00:00 AM,181.32,181.75,180.8,181,0.02071026\n12/2/2013 12:00:00 AM,181.09,181.43,180.25,180.53,0.01794091\n12/3/2013 12:00:00 AM,179.94,180.39,179.17,179.75,0.01564324\n12/4/2013 12:00:00 AM,179.1,180.48,178.35,179.73,0.007539568\n12/5/2013 12:00:00 AM,179.41,179.74,178.7701,178.94,-0.001842505\n12/6/2013 12:00:00 AM,180.67,181.11,180.15,180.94,0.004930891\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,0.01097509\n12/10/2013 12:00:00 AM,180.98,181.36,180.635,180.75,0.009561478\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,0.001399815\n12/12/2013 12:00:00 AM,178.64,178.86,177.76,178.13,-0.009943098\n12/13/2013 12:00:00 AM,178.5,178.66,177.77,178.11,-0.0150454\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.216,-0.007858966\n12/17/2013 12:00:00 AM,179.36,179.41,178.25,178.65,-0.01129892\n12/18/2013 12:00:00 AM,178.92,181.73,177.32,181.7,0.003197191\n12/19/2013 12:00:00 AM,181.19,181.7,180.71,181.49,0.002703555\n12/20/2013 12:00:00 AM,180.67,181.99,180.5683,181.56,0.005689202\n12/23/2013 12:00:00 AM,182.41,182.64,182.065,182.53,0.01534754\n12/24/2013 12:00:00 AM,182.54,183.01,182.53,182.93,0.01764783\n12/26/2013 12:00:00 AM,183.34,183.96,183.32,183.855,0.02709681\n12/27/2013 12:00:00 AM,184.1,184.18,183.66,183.845,0.01592752\n12/30/2013 12:00:00 AM,183.87,184.02,183.58,183.82,0.01325255\n12/31/2013 12:00:00 AM,184.07,184.69,183.93,184.69,0.0215639\n1/2/2014 12:00:00 AM,183.98,184.07,182.48,182.92,0.02322855\n1/3/2014 12:00:00 AM,183.21,183.6,182.63,182.885,0.02634386\n1/6/2014 12:00:00 AM,183.47,183.56,182.08,182.36,0.02358142\n1/7/2014 12:00:00 AM,183.09,183.79,182.95,183.48,0.02351384\n1/8/2014 12:00:00 AM,183.45,183.83,182.89,183.52,0.02689513\n1/9/2014 12:00:00 AM,184.1,184.13,182.795,183.64,0.01062036\n1/10/2014 12:00:00 AM,183.95,184.22,183.01,184.14,0.01449575\n1/13/2014 12:00:00 AM,183.71,184.18,181.34,181.685,0.0006882407\n1/14/2014 12:00:00 AM,182.28,183.77,181.95,183.67,0.006226123\n1/15/2014 12:00:00 AM,184.1,184.94,183.7102,184.66,0.009412791\n1/16/2014 12:00:00 AM,184.28,184.6618,183.83,184.42,0.003068375\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.635,-0.001142956\n1/21/2014 12:00:00 AM,184.7,184.77,183.05,184.18,0.001956443\n1/22/2014 12:00:00 AM,184.49,184.57,183.91,184.3,-0.002113876\n1/23/2014 12:00:00 AM,183.36,183.4,181.82,182.79,-0.0007109726\n1/24/2014 12:00:00 AM,181.6,181.66,178.83,178.89,-0.02208642\n1/27/2014 12:00:00 AM,179.06,179.52,177.12,178.01,-0.02414306\n1/28/2014 12:00:00 AM,178.14,179.3,178.12,179.07,-0.02432881\n1/29/2014 12:00:00 AM,177.56,178.55,176.88,177.35,-0.03419846\n1/30/2014 12:00:00 AM,178.86,179.81,178.26,179.23,-0.02430744\n1/31/2014 12:00:00 AM,177.02,179.29,176.92,178.18,-0.0329021\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-0.04224258\n2/4/2014 12:00:00 AM,174.95,175.84,174.1055,175.385,-0.04615713\n2/5/2014 12:00:00 AM,174.79,175.56,173.71,175.17,-0.05275939\n2/6/2014 12:00:00 AM,175.58,177.48,175.2209,177.48,-0.03835785\n2/7/2014 12:00:00 AM,178.31,179.87,177.73,179.68,-0.02177261\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,-0.02290113\n2/11/2014 12:00:00 AM,180.16,182.439,180.0389,181.98,-0.01266811\n2/12/2014 12:00:00 AM,182.22,182.83,181.705,182.07,-0.003946648\n2/13/2014 12:00:00 AM,180.84,183.2,180.83,183.01,0.02276968\n2/14/2014 12:00:00 AM,182.84,184.36,182.67,184.02,0.03320477\n2/18/2014 12:00:00 AM,184.19,184.49,183.65,184.24,0.02846245\n2/19/2014 12:00:00 AM,183.76,184.95,182.87,183.02,0.03147024\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,0.02680925\n2/21/2014 12:00:00 AM,184.49,184.89,183.8,183.89,0.03154352\n2/24/2014 12:00:00 AM,184.28,186.15,184.2,184.91,0.05983742\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,0.05250704\n2/26/2014 12:00:00 AM,185.11,185.6,184.33,184.85,0.0537878\n2/27/2014 12:00:00 AM,184.59,185.87,184.37,185.82,0.0459206\n2/28/2014 12:00:00 AM,185.79,187.15,185.05,186.29,0.03612711\n3/3/2014 12:00:00 AM,184.69,185.45,183.75,184.98,0.02723531\n3/4/2014 12:00:00 AM,186.75,187.98,186.75,187.58,0.03030866\n3/5/2014 12:00:00 AM,187.72,188.07,187.45,187.75,0.03072002\n3/6/2014 12:00:00 AM,188.21,188.61,187.7796,188.18,0.02785815\n3/7/2014 12:00:00 AM,188.87,188.96,187.43,188.26,0.02277949\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,0.0210534\n3/11/2014 12:00:00 AM,188.44,188.71,186.8,187.23,0.02274233\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,0.0171257\n3/13/2014 12:00:00 AM,187.84,187.99,184.66,185.18,0.006990536\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,-0.001352924\n3/17/2014 12:00:00 AM,185.59,186.77,185.51,186.33,0.008028739\n3/18/2014 12:00:00 AM,186.71,187.91,186.51,187.66,0.01508712\n3/19/2014 12:00:00 AM,187.7,187.94,185.47,186.66,0.004510297\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.747,0.007790717\n3/21/2014 12:00:00 AM,187.72,189.0239,186.03,186.2,0.00657366\n3/24/2014 12:00:00 AM,186.82,187.07,184.62,185.43,-0.01152802\n3/25/2014 12:00:00 AM,186.37,186.94,185.27,186.31,-0.007699351\n3/26/2014 12:00:00 AM,187.03,187.34,184.92,184.97,-0.01720526\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,-0.01974097\n3/28/2014 12:00:00 AM,185.105,186.42,185,185.49,-0.01429168\n3/31/2014 12:00:00 AM,186.65,187.3,185.5216,187.01,-0.001175723\n4/1/2014 12:00:00 AM,187.62,188.36,187.0015,188.25,0.00516605\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,0.01978363\n4/3/2014 12:00:00 AM,189.17,189.22,188.05,188.63,0.02127113\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,0.0003755644\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,-0.01784998\n4/8/2014 12:00:00 AM,184.21,185.4,183.59,185.1,-0.008392547\n4/9/2014 12:00:00 AM,185.6,187.15,185.06,187.09,-0.003505515\n4/10/2014 12:00:00 AM,187.09,187.17,182.93,183.155,-0.01648857\n4/11/2014 12:00:00 AM,182.17,183.42,181.31,181.51,-0.02136669\n4/14/2014 12:00:00 AM,182.93,183.37,181.44,182.9401,-0.0182532\n4/15/2014 12:00:00 AM,183.32,184.33,181.51,184.2,-0.004171549\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.125,0.008335507\n4/17/2014 12:00:00 AM,185.88,186.91,185.56,186.39,0.004840248\n4/21/2014 12:00:00 AM,186.44,187.1,186.21,187.04,0.0001603998\n4/22/2014 12:00:00 AM,187.23,188.4,187.13,187.89,-0.001914185\n4/23/2014 12:00:00 AM,187.81,187.92,187.3,187.45,-0.007599792\n4/24/2014 12:00:00 AM,188.37,188.39,186.93,187.83,-0.004250142\n4/25/2014 12:00:00 AM,187.21,187.33,185.87,186.29,-0.0005903062\n4/28/2014 12:00:00 AM,187.05,187.69,184.96,186.875,0.01365809\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,0.01421504\n4/30/2014 12:00:00 AM,187.44,188.5,187.18,188.31,0.006499763\n5/1/2014 12:00:00 AM,188.22,188.84,187.73,188.325,0.0278364\n5/2/2014 12:00:00 AM,188.31,189.14,187.78,188.06,0.03545033\n5/5/2014 12:00:00 AM,187.14,188.55,186.62,188.42,0.02951476\n5/6/2014 12:00:00 AM,188,188.13,186.74,186.78,0.01390934\n5/7/2014 12:00:00 AM,187.43,187.97,186.01,187.88,0.009384996\n5/8/2014 12:00:00 AM,187.67,189.05,187.08,187.675,0.00687051\n5/9/2014 12:00:00 AM,187.69,188.04,186.83,187.96,0.004906748\n5/12/2014 12:00:00 AM,188.76,189.88,187.9992,189.785,0.01003519\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,0.01330143\n5/14/2014 12:00:00 AM,189.79,189.88,188.79,189.06,0.006527104\n5/15/2014 12:00:00 AM,188.67,188.72,186.48,187.4,0.005940774\n5/16/2014 12:00:00 AM,187.51,188.13,186.72,188.05,0.006267957\n5/19/2014 12:00:00 AM,187.69,188.89,187.52,188.74,0.005259145\n5/20/2014 12:00:00 AM,188.645,188.67,187.07,187.55,-0.004044035\n5/21/2014 12:00:00 AM,188.1,189.22,188.06,189.13,0.004265457\n5/22/2014 12:00:00 AM,189.18,189.98,188.86,189.59,0.008102778\n5/23/2014 12:00:00 AM,189.75,190.48,189.5858,190.35,0.01019101\n5/27/2014 12:00:00 AM,191.05,191.58,190.95,191.52,0.02506082\n5/28/2014 12:00:00 AM,191.52,191.82,191.06,191.38,0.01845752\n5/29/2014 12:00:00 AM,191.82,192.4,191.33,192.37,0.02470881\n5/30/2014 12:00:00 AM,192.19,192.8,192.03,192.68,0.02480153\n6/2/2014 12:00:00 AM,192.95,192.99,191.97,192.895,0.01625415\n6/3/2014 12:00:00 AM,192.4,192.9,192.25,192.8,0.01483984\n6/4/2014 12:00:00 AM,192.47,193.3,192.265,193.19,0.02160976\n6/5/2014 12:00:00 AM,193.41,194.65,192.7,194.45,0.03692971\n6/6/2014 12:00:00 AM,194.87,195.43,194.78,195.375,0.03821289\n6/9/2014 12:00:00 AM,195.35,196.05,195.17,195.58,0.03559908\n6/10/2014 12:00:00 AM,195.33,195.64,194.92,195.6,0.0420263\n6/11/2014 12:00:00 AM,194.9,195.12,194.48,194.92,0.03015457\n6/12/2014 12:00:00 AM,194.65,194.8,193.11,193.54,0.02062035\n6/13/2014 12:00:00 AM,193.9,194.32,193.3,194.13,0.01966355\n6/16/2014 12:00:00 AM,193.89,194.7,193.66,194.29,0.01435959\n6/17/2014 12:00:00 AM,194.02,194.97,193.81,194.83,0.01786639\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.255,0.01999428\n6/19/2014 12:00:00 AM,196.43,196.6,195.8,196.48,0.01952988\n6/20/2014 12:00:00 AM,196.03,196.1039,195.7,195.94,0.01566248\n6/23/2014 12:00:00 AM,195.97,196.05,195.52,195.88,0.01584885\n6/24/2014 12:00:00 AM,195.53,196.5,194.48,194.7,0.007785724\n6/25/2014 12:00:00 AM,194.25,195.781,194.25,195.58,0.005794467\n6/26/2014 12:00:00 AM,195.61,195.63,194.13,195.44,0.0003326507\n6/27/2014 12:00:00 AM,194.98,195.88,194.885,195.82,0.001226395\n6/30/2014 12:00:00 AM,195.7,196.165,195.53,195.72,0.0006132838\n7/1/2014 12:00:00 AM,196.19,197.63,196.13,197.03,0.01076679\n7/2/2014 12:00:00 AM,197.05,197.48,196.96,197.23,0.01888636\n7/3/2014 12:00:00 AM,197.79,198.29,197.64,198.2,0.02074854\n7/7/2014 12:00:00 AM,197.82,197.98,197.22,197.51,0.01643733\n7/8/2014 12:00:00 AM,197.15,197.22,195.76,196.24,0.007211035\n7/9/2014 12:00:00 AM,196.73,197.295,196.31,197.12,0.004397796\n7/10/2014 12:00:00 AM,195.22,196.86,195.06,196.34,-0.0007127916\n7/11/2014 12:00:00 AM,196.22,196.75,195.78,196.61,0.003413572\n7/14/2014 12:00:00 AM,197.61,197.86,197.44,197.6,0.008742564\n7/15/2014 12:00:00 AM,197.72,198.1,196.36,197.23,0.01291064\n7/16/2014 12:00:00 AM,198.11,198.26,197.42,197.96,0.01209551\n7/17/2014 12:00:00 AM,197.35,198.1,195.43,195.71,0.001380567\n7/18/2014 12:00:00 AM,196.35,197.91,196.24,197.7099,0.009604897\n7/21/2014 12:00:00 AM,197.09,197.5,196.43,197.34,0.008243038\n7/22/2014 12:00:00 AM,198.01,198.56,197.87,198.2,0.005920611\n7/23/2014 12:00:00 AM,198.495,198.85,198.1,198.64,0.007123599\n7/24/2014 12:00:00 AM,198.83,199.06,198.45,198.65,0.002267845\n7/25/2014 12:00:00 AM,198.09,198.26,197.33,197.72,0.001062706\n7/28/2014 12:00:00 AM,197.76,198.09,196.62,197.8,0.007918007\n7/29/2014 12:00:00 AM,198.17,198.45,196.92,196.95,-0.0008627817\n7/30/2014 12:00:00 AM,197.65,197.91,196.16,196.98,0.003254347\n7/31/2014 12:00:00 AM,195.61,195.78,192.97,193.09,-0.01806569\n8/1/2014 12:00:00 AM,192.56,193.76,191.57,192.5,-0.02614866\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,-0.01707955\n8/5/2014 12:00:00 AM,193.1,193.6,191.31,192.01,-0.0305176\n8/6/2014 12:00:00 AM,191.11,192.89,191.08,192.07,-0.01877408\n8/7/2014 12:00:00 AM,192.935,193.13,190.55,191.03,-0.03437033\n8/8/2014 12:00:00 AM,191.46,193.37,190.95,193.24,-0.02099514\n8/11/2014 12:00:00 AM,193.965,194.66,193.71,193.795,-0.02247572\n8/12/2014 12:00:00 AM,193.61,194.15,192.94,193.53,-0.02606161\n8/13/2014 12:00:00 AM,194.29,195.06,193.96,194.84,-0.01936576\n8/14/2014 12:00:00 AM,195.16,195.76,194.98,195.76,-0.009962504\n8/15/2014 12:00:00 AM,196.47,196.65,194.31,195.72,-0.01057136\n8/18/2014 12:00:00 AM,196.8,197.45,196.69,197.36,0.002079601\n8/19/2014 12:00:00 AM,197.84,198.54,197.4426,198.39,0.007132608\n8/20/2014 12:00:00 AM,198.12,199.16,198.08,198.92,0.02974634\n8/21/2014 12:00:00 AM,199.09,199.76,198.93,199.5,0.03571808\n8/22/2014 12:00:00 AM,199.34,199.69,198.74,199.19,0.02696817\n8/25/2014 12:00:00 AM,200.14,200.5949,199.1502,200.2,0.04176943\n8/26/2014 12:00:00 AM,200.33,200.82,200.28,200.33,0.04210609\n8/27/2014 12:00:00 AM,200.43,200.57,199.94,200.25,0.04713611\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,0.03508415\n8/29/2014 12:00:00 AM,200.45,200.73,199.82,200.71,0.03506022\n9/2/2014 12:00:00 AM,200.97,200.995,199.86,200.61,0.03593019\n9/3/2014 12:00:00 AM,201.38,201.41,200.22,200.5,0.02863556\n9/4/2014 12:00:00 AM,200.84,201.58,199.66,200.2101,0.02247792\n9/5/2014 12:00:00 AM,200.17,201.19,199.41,201.11,0.02716695\n9/8/2014 12:00:00 AM,200.92,201.21,200,200.59,0.01623353\n9/9/2014 12:00:00 AM,200.41,200.55,198.91,199.32,0.004676823\n9/10/2014 12:00:00 AM,199.43,200.2,198.77,200.07,0.005764617\n9/11/2014 12:00:00 AM,199.27,200.33,199.12,200.3,0.004002022\n9/12/2014 12:00:00 AM,200.1,200.12,198.56,199.13,-0.0003012531\n9/15/2014 12:00:00 AM,199.16,199.32,198.38,198.981,-0.006107495\n9/16/2014 12:00:00 AM,198.61,200.84,198.5,200.48,0.0007484539\n9/17/2014 12:00:00 AM,200.77,201.68,199.75,200.75,0.002493767\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,0.008359129\n9/19/2014 12:00:00 AM,201.52,201.899,200.29,200.7,-4.987303E-05\n9/22/2014 12:00:00 AM,200.35,200.38,198.73,199.15,-0.007304449\n9/23/2014 12:00:00 AM,198.43,199.26,197.95,198.01,-0.01249674\n9/24/2014 12:00:00 AM,198.04,199.69,197.52,199.56,-0.003252376\n9/25/2014 12:00:00 AM,199.04,199.05,196.27,196.34,-0.02400419\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,-0.01350118\n9/29/2014 12:00:00 AM,196.2,197.89,196.05,197.54,-0.008970548\n9/30/2014 12:00:00 AM,197.69,198.3,196.61,197.02,-0.01536207\n10/1/2014 12:00:00 AM,196.7,196.77,193.91,194.35,-0.03015557\n10/2/2014 12:00:00 AM,194.18,195.055,192.35,194.38,-0.02414287\n10/3/2014 12:00:00 AM,195.68,196.94,195.08,196.52,-0.01244513\n10/6/2014 12:00:00 AM,197.34,197.6,195.582,196.29,-0.02112135\n10/7/2014 12:00:00 AM,195.28,195.72,193.22,193.26,-0.03802395\n10/8/2014 12:00:00 AM,193.37,196.92,192.36,196.64,-0.0260016\n10/9/2014 12:00:00 AM,196.33,196.6,192.58,192.74,-0.04046908\n10/10/2014 12:00:00 AM,192.69,193.65,190.49,190.54,-0.04419617\n10/13/2014 12:00:00 AM,190.46,191.15,187.3,187.4099,-0.05501933\n10/14/2014 12:00:00 AM,188.42,189.82,187.04,187.7,-0.06127\n10/15/2014 12:00:00 AM,185.16,187.694,181.92,186.43,-0.05179204\n10/16/2014 12:00:00 AM,183.06,187.58,182.89,186.27,-0.06056457\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-0.04700221\n10/20/2014 12:00:00 AM,188.13,190.45,188.07,190.3,-0.03470348\n10/21/2014 12:00:00 AM,191.68,194.2,191.48,194.07,-0.001441732\n10/22/2014 12:00:00 AM,194.41,194.91,192.61,192.69,-0.008732338\n10/23/2014 12:00:00 AM,194.62,196.2,194.26,194.93,-0.008123747\n10/24/2014 12:00:00 AM,195.25,196.49,194.49,196.43,0.0007129731\n10/27/2014 12:00:00 AM,195.73,196.45,195.03,196.16,0.01489427\n10/28/2014 12:00:00 AM,196.82,198.42,196.73,198.41,0.008960973\n10/29/2014 12:00:00 AM,198.55,199.12,196.8,198.11,0.02748028\n10/30/2014 12:00:00 AM,197.58,199.95,197.4,199.38,0.04535047\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,0.07328495\n11/3/2014 12:00:00 AM,201.92,202.45,201.305,201.77,0.07228353\n11/4/2014 12:00:00 AM,201.23,201.6,200.06,201.07,0.07559735\n11/5/2014 12:00:00 AM,202.54,202.59,201.45,202.34,0.08275218\n11/6/2014 12:00:00 AM,202.39,203.26,201.64,203.15,0.07500574\n11/7/2014 12:00:00 AM,203.17,203.5999,202.61,203.34,0.06627765\n11/10/2014 12:00:00 AM,203.38,204.04,203.13,203.98,0.04980297\n11/11/2014 12:00:00 AM,204.055,204.31,203.65,204.175,0.05789479\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,0.04528345\n11/13/2014 12:00:00 AM,204.16,204.83,203.21,204.19,0.03874485\n11/14/2014 12:00:00 AM,204.1,204.49,203.72,204.24,0.04036513\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,0.02959644\n11/18/2014 12:00:00 AM,204.44,205.92,204.44,205.55,0.03686689\n11/19/2014 12:00:00 AM,205.31,205.55,204.3,205.22,0.02887001\n11/20/2014 12:00:00 AM,204.26,205.71,204.18,205.58,0.01925213\n11/21/2014 12:00:00 AM,207.64,207.8445,205.98,206.68,0.02404321\n11/24/2014 12:00:00 AM,207.17,207.39,206.91,207.26,0.03032088\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,0.02330062\n11/26/2014 12:00:00 AM,207.29,207.76,207.03,207.64,0.02186122\n11/28/2014 12:00:00 AM,207.49,207.87,206.91,207.2,0.01880506\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,0.008688485\n12/2/2014 12:00:00 AM,205.81,207.34,205.782,207.085,0.01415189\n12/3/2014 12:00:00 AM,207.3,208.15,207.1,207.89,0.01908516\n12/4/2014 12:00:00 AM,207.54,208.265,206.7,207.66,0.0168512\n12/5/2014 12:00:00 AM,207.87,208.47,207.55,208,0.01824228\n12/8/2014 12:00:00 AM,207.52,208.12,205.93,206.61,0.01090091\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,0.004465801\n12/10/2014 12:00:00 AM,205.91,205.98,202.93,203.1601,-0.01008827\n12/11/2014 12:00:00 AM,203.88,206.19,203.71,204.19,-0.006784317\n12/12/2014 12:00:00 AM,202.64,203.819,200.85,200.89,-0.02841418\n12/15/2014 12:00:00 AM,201.98,202.53,198.78,199.51,-0.03810969\n12/16/2014 12:00:00 AM,198.58,202.395,197.86,197.91,-0.04543766\n12/17/2014 12:00:00 AM,198.44,202.34,198.29,201.79,-0.02857829\n12/18/2014 12:00:00 AM,204.74,212.97,203.92,206.78,-0.002029075\n12/19/2014 12:00:00 AM,206.43,207.33,205.6109,206.52,0.003686866\n12/22/2014 12:00:00 AM,206.75,207.47,206.46,207.47,0.001857387\n12/23/2014 12:00:00 AM,208.17,208.23,207.3991,207.75,-0.000673657\n12/24/2014 12:00:00 AM,208.02,208.34,207.72,207.77,0.0005295747\n12/26/2014 12:00:00 AM,208.31,208.85,208.25,208.44,0.002113162\n12/29/2014 12:00:00 AM,208.22,208.97,208.14,208.72,0.01016069\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,0.005458051\n12/31/2014 12:00:00 AM,207.99,208.19,205.39,205.54,0.01164631\n1/2/2015 12:00:00 AM,206.38,206.88,204.18,205.43,0.006054363\n1/5/2015 12:00:00 AM,204.17,204.37,201.35,201.72,0.004123112\n1/6/2015 12:00:00 AM,202.09,202.72,198.855,199.82,0.001552665\n1/7/2015 12:00:00 AM,201.42,202.72,200.88,202.31,0.02198876\n1/8/2015 12:00:00 AM,204.01,206.16,203.99,205.9,0.02016306\n1/9/2015 12:00:00 AM,206.4,206.42,203.51,204.25,-0.01231069\n1/12/2015 12:00:00 AM,204.41,204.6,201.92,202.65,-0.01891696\n1/13/2015 12:00:00 AM,204.12,205.48,200.51,202.08,-0.02632309\n1/14/2015 12:00:00 AM,199.65,201.1,198.57,200.86,-0.03372728\n1/15/2015 12:00:00 AM,201.63,202.01,198.88,199.0199,-0.04302691\n1/16/2015 12:00:00 AM,198.77,201.82,198.55,201.63,-0.03321688\n1/20/2015 12:00:00 AM,202.4,202.72,200.17,202.055,-0.03245375\n1/21/2015 12:00:00 AM,201.5,203.66,200.94,203.08,-0.02201318\n1/22/2015 12:00:00 AM,203.99,206.26,202.33,206.1,0.002720888\n1/23/2015 12:00:00 AM,205.79,206.1,204.81,204.97,-0.002241675\n1/26/2015 12:00:00 AM,204.71,205.56,203.85,205.45,0.01832208\n1/27/2015 12:00:00 AM,202.97,204.12,201.74,202.74,0.0145074\n1/28/2015 12:00:00 AM,204.17,204.29,199.91,200.14,-0.01078404\n1/29/2015 12:00:00 AM,200.38,202.3,198.68,201.9902,-0.01917138\n1/30/2015 12:00:00 AM,200.57,202.17,199.13,199.45,-0.02378117\n2/2/2015 12:00:00 AM,200.05,202.03,197.86,201.92,-0.003608753\n2/3/2015 12:00:00 AM,203,204.85,202.55,204.84,0.0135655\n2/4/2015 12:00:00 AM,203.92,205.38,203.51,204.06,0.01580591\n2/5/2015 12:00:00 AM,204.86,206.3,204.77,206.12,0.03505369\n2/6/2015 12:00:00 AM,206.56,207.24,204.92,205.55,0.01925497\n2/9/2015 12:00:00 AM,204.77,205.64,204.135,204.63,0.01266359\n2/10/2015 12:00:00 AM,205.88,207.12,204.6801,206.81,0.01820049\n2/11/2015 12:00:00 AM,206.61,207.45,205.83,206.93,0.004019019\n2/12/2015 12:00:00 AM,207.89,208.99,206.9727,208.92,0.01908776\n2/13/2015 12:00:00 AM,209.07,209.84,208.76,209.78,0.02085668\n2/17/2015 12:00:00 AM,209.4,210.32,209.1,210.11,0.03570681\n2/18/2015 12:00:00 AM,209.66,210.22,209.3401,210.13,0.04870929\n2/19/2015 12:00:00 AM,209.41,210.42,209.24,209.98,0.03879307\n2/20/2015 12:00:00 AM,209.48,211.33,208.73,211.239,0.05742662\n2/23/2015 12:00:00 AM,210.94,211.21,210.48,211.209,0.04497659\n2/24/2015 12:00:00 AM,211.12,212.05,210.76,211.81,0.03346046\n2/25/2015 12:00:00 AM,211.66,212.24,211.22,211.63,0.03642543\n2/26/2015 12:00:00 AM,211.52,211.71,210.65,211.38,0.02519898\n2/27/2015 12:00:00 AM,211.26,211.58,210.6,210.66,0.02455615\n3/2/2015 12:00:00 AM,210.78,212.06,210.72,211.99,0.03533563\n3/3/2015 12:00:00 AM,211.47,212.054,210.08,211.12,0.02062618\n3/4/2015 12:00:00 AM,210.4,210.49,209.06,210.2301,0.01582212\n3/5/2015 12:00:00 AM,210.62,210.8,209.85,210.46,0.007344248\n3/6/2015 12:00:00 AM,209.42,209.94,207.1,207.5,-0.01092802\n3/9/2015 12:00:00 AM,207.74,208.79,207.5459,208.36,-0.00836385\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,-0.02481402\n3/11/2015 12:00:00 AM,205.29,205.5,204.4,204.5,-0.02644429\n3/12/2015 12:00:00 AM,205.26,207.175,205.2,207.1,-0.01978839\n3/13/2015 12:00:00 AM,206.77,207.9338,204.58,205.8272,-0.02581121\n3/16/2015 12:00:00 AM,206.71,208.69,205.8641,208.58,-0.01536696\n3/17/2015 12:00:00 AM,207.69,208.42,206.98,207.96,-0.0174937\n3/18/2015 12:00:00 AM,207.39,211.27,206.62,210.46,-0.004361841\n3/19/2015 12:00:00 AM,209.96,210.4697,209.03,209.5,-0.005521738\n3/20/2015 12:00:00 AM,209.71,211.02,209.4903,210.41,-0.007481104\n3/23/2015 12:00:00 AM,210.42,211.11,210,210,-0.005319139\n3/24/2015 12:00:00 AM,209.85,210.4,208.74,208.82,-0.006729985\n3/25/2015 12:00:00 AM,209.07,209.35,205.71,205.76,-0.02258523\n3/26/2015 12:00:00 AM,204.96,206.37,204.12,205.27,-0.01080513\n3/27/2015 12:00:00 AM,205.13,205.95,204.9,205.74,-0.01265409\n3/30/2015 12:00:00 AM,206.98,208.61,206.96,208.25,0.01582689\n3/31/2015 12:00:00 AM,207.26,208.1,206.36,206.43,0.00939336\n4/1/2015 12:00:00 AM,206.39,206.42,204.51,205.7,-0.006783016\n4/2/2015 12:00:00 AM,205.62,206.98,205.4,206.435,0.002948627\n4/6/2015 12:00:00 AM,205.37,208.45,205.21,207.83,-0.003602223\n4/7/2015 12:00:00 AM,207.855,208.76,207.24,207.28,-0.003275255\n4/8/2015 12:00:00 AM,207.55,208.51,207.08,207.975,-0.01187773\n4/9/2015 12:00:00 AM,207.78,209.18,207.19,208.9,-0.0028681\n4/10/2015 12:00:00 AM,209.2,210.09,208.96,210.04,-0.001760069\n4/13/2015 12:00:00 AM,209.87,210.63,209.03,209.09,-0.004342767\n4/14/2015 12:00:00 AM,208.85,209.71,208.1,209.49,0.00320336\n4/15/2015 12:00:00 AM,210.05,211.04,209.95,210.43,0.02244261\n4/16/2015 12:00:00 AM,210.03,210.98,209.7928,210.37,0.02454166\n4/17/2015 12:00:00 AM,208.94,209.23,207.01,207.95,0.01068439\n4/20/2015 12:00:00 AM,209.06,210.25,208.96,209.85,0.007653738\n4/21/2015 12:00:00 AM,210.67,210.86,209.24,209.6,0.01523964\n4/22/2015 12:00:00 AM,210.01,210.85,208.9,210.63,0.02368428\n4/23/2015 12:00:00 AM,210.15,211.94,210.01,211.16,0.02263058\n4/24/2015 12:00:00 AM,211.66,211.97,211.11,211.6499,0.01821306\n4/27/2015 12:00:00 AM,212.33,212.48,210.54,210.77,0.01669698\n4/28/2015 12:00:00 AM,210.74,211.5,209.3301,211.44,0.01652337\n4/29/2015 12:00:00 AM,210.32,211.29,209.6,210.57,0.007962535\n4/30/2015 12:00:00 AM,209.9,210.35,207.62,208.46,-0.007550748\n5/1/2015 12:00:00 AM,209.41,210.77,209.28,210.72,0.00776548\n5/4/2015 12:00:00 AM,211.22,212.02,211.1,211.32,0.008697575\n5/5/2015 12:00:00 AM,211.01,211.46,208.73,208.9,-0.007297382\n5/6/2015 12:00:00 AM,209.54,209.93,206.76,208.04,-0.01113753\n5/7/2015 12:00:00 AM,207.91,209.38,207.52,208.87,0.004414374\n5/8/2015 12:00:00 AM,210.84,211.86,210.78,211.62,0.008399172\n5/11/2015 12:00:00 AM,211.54,211.89,210.52,210.6,0.004759647\n5/12/2015 12:00:00 AM,209.59,210.63,208.62,209.98,-0.003090795\n5/13/2015 12:00:00 AM,210.49,211.22,209.74,210.02,-0.005413373\n5/14/2015 12:00:00 AM,211.24,212.32,210.91,212.21,0.002642876\n5/15/2015 12:00:00 AM,212.43,212.61,211.86,212.44,0.007892095\n5/18/2015 12:00:00 AM,212.24,213.4,212.16,213.1,0.007820286\n5/19/2015 12:00:00 AM,213.26,213.57,212.69,213.03,0.01161482\n5/20/2015 12:00:00 AM,213.16,213.78,212.5,212.88,0.02098144\n5/21/2015 12:00:00 AM,212.74,213.75,212.51,213.5,0.01310659\n5/22/2015 12:00:00 AM,213.02,213.54,212.91,212.99,0.007871635\n5/26/2015 12:00:00 AM,212.39,212.91,210.2,210.7,0.008579667\n5/27/2015 12:00:00 AM,211.23,212.98,210.76,212.7,0.02215237\n5/28/2015 12:00:00 AM,212.34,212.59,211.63,212.46,0.01704174\n5/29/2015 12:00:00 AM,212.4,212.43,210.82,211.14,-0.002270773\n6/1/2015 12:00:00 AM,211.95,212.34,210.62,211.57,0.004595319\n6/2/2015 12:00:00 AM,211.02,212.19,210.27,211.36,0.006550576\n6/3/2015 12:00:00 AM,211.97,212.67,211.33,211.92,0.009006051\n6/4/2015 12:00:00 AM,211.12,211.86,209.75,210.13,-0.009849972\n6/5/2015 12:00:00 AM,209.93,210.58,208.98,209.77,-0.01264789\n6/8/2015 12:00:00 AM,209.63,209.82,208.39,208.48,-0.02191848\n6/9/2015 12:00:00 AM,208.44,209.1,207.69,208.45,-0.02173381\n6/10/2015 12:00:00 AM,209.38,211.41,209.3,210.95,-0.009107525\n6/11/2015 12:00:00 AM,211.49,212.09,211.2,211.63,-0.008797343\n6/12/2015 12:00:00 AM,210.62,211.48,209.68,210.01,-0.01409012\n6/15/2015 12:00:00 AM,208.62,209.45,207.79,209.11,-0.007574874\n6/16/2015 12:00:00 AM,208.9,210.35,208.72,210.25,-0.01158541\n6/17/2015 12:00:00 AM,210.58,211.32,209.36,210.59,-0.008840669\n6/18/2015 12:00:00 AM,211.23,213.34,210.63,212.78,0.007737345\n6/19/2015 12:00:00 AM,211.42,211.55,210.36,210.81,-0.003598705\n6/22/2015 12:00:00 AM,211.95,212.59,211.64,211.89,0.002504426\n6/23/2015 12:00:00 AM,212.18,212.44,211.57,212.05,0.000613274\n6/24/2015 12:00:00 AM,211.71,212.17,210.47,210.5,0.001759243\n6/25/2015 12:00:00 AM,211.13,211.25,209.77,209.86,0.0004289318\n6/26/2015 12:00:00 AM,210.28,210.58,209.16,209.82,0.006406962\n6/29/2015 12:00:00 AM,208.02,209.83,205.33,205.42,-0.01464253\n6/30/2015 12:00:00 AM,207.32,207.32,205.28,205.85,-0.02447335\n7/1/2015 12:00:00 AM,207.79,208.03,206.56,207.5,-0.01970815\n7/2/2015 12:00:00 AM,208.07,208.27,206.81,207.31,-0.01293988\n7/6/2015 12:00:00 AM,205.74,207.65,205.53,206.72,-0.01149521\n7/7/2015 12:00:00 AM,206.93,208.17,204.11,208.02,-0.01066305\n7/8/2015 12:00:00 AM,206.34,206.76,204.25,204.53,-0.02919844\n7/9/2015 12:00:00 AM,207.03,207.35,204.77,204.9,-0.03773674\n7/10/2015 12:00:00 AM,207.28,207.98,204.95,207.48,-0.01592231\n7/13/2015 12:00:00 AM,209,209.9,208.94,209.77,-0.01005556\n7/14/2015 12:00:00 AM,209.69,211.05,209.65,210.68,-0.00648175\n7/15/2015 12:00:00 AM,210.71,211.28,210.04,210.61,0.0005224317\n7/16/2015 12:00:00 AM,211.82,212.3,211.58,212.3,0.01155974\n7/17/2015 12:00:00 AM,212.34,212.55,211.8,212.48,0.01259779\n7/20/2015 12:00:00 AM,212.77,213.18,212.21,212.59,0.03430876\n7/21/2015 12:00:00 AM,212.45,212.74,211.39,211.75,0.02825856\n7/22/2015 12:00:00 AM,210.91,211.77,210.89,211.37,0.01847879\n7/23/2015 12:00:00 AM,211.54,211.65,209.75,210.18,0.01374903\n7/24/2015 12:00:00 AM,210.25,210.37,207.6,208,0.006172853\n7/27/2015 12:00:00 AM,206.98,207.55,206.26,206.79,-0.005930496\n7/28/2015 12:00:00 AM,207.8,209.5,206.8,209.33,0.0231973\n7/29/2015 12:00:00 AM,209.44,211.04,209.31,210.77,0.02824549\n7/30/2015 12:00:00 AM,210.2,211.02,209.42,210.82,0.01596979\n7/31/2015 12:00:00 AM,211.44,211.45,210.16,210.5,0.00347394\n8/3/2015 12:00:00 AM,210.53,210.53,208.65,209.79,-0.004233362\n8/4/2015 12:00:00 AM,209.7,210.25,208.8,209.38,-0.005857279\n8/5/2015 12:00:00 AM,210.4,211.31,209.73,210.07,-0.01055954\n8/6/2015 12:00:00 AM,210.27,210.41,207.65,208.35,-0.01962846\n8/7/2015 12:00:00 AM,208.16,208.34,206.87,207.95,-0.02206776\n8/10/2015 12:00:00 AM,209.29,210.67,209.28,210.57,-0.005588159\n8/11/2015 12:00:00 AM,208.96,209.47,207.76,208.67,-0.01285608\n8/12/2015 12:00:00 AM,207.14,209.14,205.36,208.92,-0.006012877\n8/13/2015 12:00:00 AM,208.75,209.55,208.01,208.66,0.003168071\n8/14/2015 12:00:00 AM,208.43,209.51,208.26,209.42,0.01263804\n8/17/2015 12:00:00 AM,208.73,210.59,208.16,210.59,0.006001135\n8/18/2015 12:00:00 AM,210.29,210.68,209.7,209.98,-0.003755244\n8/19/2015 12:00:00 AM,209.1,210.01,207.35,208.32,-0.01192933\n8/20/2015 12:00:00 AM,206.54,208.29,203.9,203.97,-0.03151272\n8/21/2015 12:00:00 AM,201.81,203.94,197.52,197.63,-0.05971038\n8/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,-0.09949795\n8/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,-0.1148894"
  },
  {
    "path": "Tests/TestData/spy_mama.csv",
    "content": "date,open,high,low,close,fama,mama\n19980102 00:00,973100,975300,965300,973600,,\n19980105 00:00,978400,984400,967800,977500,,\n19980106 00:00,972500,972800,961900,966300,,\n19980107 00:00,960900,965000,952200,964700,,\n19980108 00:00,963100,963100,955000,957800,,\n19980109 00:00,952500,955000,919100,924700,,\n19980112 00:00,911300,941900,909100,940600,,\n19980113 00:00,946300,956300,942200,952200,,\n19980114 00:00,956900,959700,947200,958100,,\n19980115 00:00,955000,957500,948100,949400,,\n19980116 00:00,962500,966900,956600,962300,,\n19980120 00:00,966900,980000,965000,980000,,\n19980121 00:00,972200,976900,961600,971600,,\n19980122 00:00,961600,968800,958800,963000,,\n19980123 00:00,965000,967800,950000,956600,,\n19980126 00:00,963800,967300,937500,957500,,\n19980127 00:00,958100,980000,956600,970000,,\n19980128 00:00,974100,981100,971700,978800,,\n19980129 00:00,978400,995600,975600,987500,,\n19980130 00:00,987800,989700,980000,983100,,\n19980202 00:00,999100,1005000,997500,1002500,,\n19980203 00:00,1000000,1008100,997200,1006900,,\n19980204 00:00,1002800,1011600,998800,1005900,,\n19980205 00:00,1013100,1015900,1000300,1003800,,\n19980206 00:00,1010000,1015000,1006900,1012800,,\n19980209 00:00,1017200,1017500,1007200,1011400,,\n19980210 00:00,1014400,1024700,1011900,1020500,,\n19980211 00:00,1020900,1031900,1017000,1021300,,\n19980212 00:00,1017200,1029400,1008800,1026600,,\n19980213 00:00,1021900,1029400,1018800,1021600,,\n19980217 00:00,1028100,1030900,1021600,1023400,,\n19980218 00:00,1023100,1034700,1022800,1034100,,\n19980219 00:00,1032500,1034100,1027500,1030000,973769.4362792717,1025593.7168990783\n19980220 00:00,1030800,1037500,1023800,1035600,975071.363648643,1025846.5310541244\n19980223 00:00,1042500,1042500,1033400,1040000,989278.0891182479,1031898.2655270621\n19980224 00:00,1039100,1040900,1029400,1031900,1000339.6000295687,1033524.1327635311\n19980225 00:00,1037500,1048800,1036300,1044800,1009763.9666176179,1038037.0663817655\n19980226 00:00,1044400,1051600,1041900,1050600,1016725.4934703605,1041821.2498905819\n19980227 00:00,1049700,1055300,1043100,1052000,1023921.7763390931,1045510.624945291\n19980302 00:00,1052500,1057500,1046300,1048100,1030117.6603724812,1048705.3124726454\n19980303 00:00,1045300,1054700,1045000,1054100,1030583.7825343945,1048762.546849013\n19980304 00:00,1050900,1054100,1040600,1049700,1034951.9052569226,1048056.2734245065\n19980305 00:00,1035000,1044400,1031600,1037500,1035266.9441193315,1047553.4597532812\n19980306 00:00,1045600,1058800,1044400,1057500,1035579.1651854886,1047755.7867656171\n19980309 00:00,1055300,1062200,1052500,1054400,1035895.5734915348,1048235.4974273362\n19980310 00:00,1062200,1068400,1053800,1066600,1036220.1522181456,1048878.7225559694\n19980311 00:00,1069700,1073100,1067300,1072500,1036563.2680733962,1049944.7864281707\n19980312 00:00,1070900,1075900,1065000,1072500,1042471.7993585684,1060197.3932140854\n19980313 00:00,1078400,1080000,1068800,1072200,1042932.6924634387,1060907.5235533812\n19980316 00:00,1078400,1082800,1075300,1082500,1049694.2097917516,1069978.7617766906\n19980317 00:00,1083100,1085000,1076600,1084700,1050214.8501391541,1070519.823687856\n19980318 00:00,1082500,1089400,1080000,1087800,1050740.1996982617,1071228.8325034631\n19980319 00:00,1089700,1093800,1086600,1093400,1051276.1294777624,1072177.39087829\n19980320 00:00,1095600,1101900,1088800,1100000,1051827.6267741777,1073336.0213343753\n19980323 00:00,1097200,1103100,1094100,1095000,1060362.7227474302,1085968.0106671876\n19980324 00:00,1100600,1108100,1099400,1105900,1068986.7933939712,1094859.0053335938\n19980325 00:00,1114100,1115300,1091900,1101900,1076547.4707121775,1099229.502666797\n19980326 00:00,1098800,1107500,1096300,1101300,1082551.7908674828,1100564.7513333985\n19980327 00:00,1107500,1107800,1090000,1095300,1083000.033939964,1100481.5137667286\n19980330 00:00,1096300,1100900,1089700,1093400,1083430.5940434246,1100222.438078392\n19980331 00:00,1101600,1111900,1097500,1100900,1083855.9870967008,1100446.3161744724\n19980401 00:00,1103100,1110800,1094100,1109800,1084273.2499284272,1100546.5003657488\n19980402 00:00,1109400,1122500,1107500,1120300,1084698.148063903,1101269.1753474614\n19980403 00:00,1123400,1128100,1118400,1121900,1085139.8997768075,1102368.2165800883\n19980406 00:00,1132500,1133800,1120600,1122500,1092550.9519051167,1114784.1082900441\n19980407 00:00,1117500,1119400,1101600,1110000,1097573.7274650931,1112642.054145022\n19980408 00:00,1112200,1112800,1097500,1101300,1097941.07056441,1112267.4514377709\n19980409 00:00,1105600,1112800,1105300,1110000,1098306.0726524377,1112101.5850786446\n19980413 00:00,1113800,1113800,1100000,1110000,1098644.4584817444,1111841.5058247123\n19980414 00:00,1111300,1117200,1109100,1116900,1098976.0202830378,1111906.9305334766\n19980415 00:00,1119700,1121300,1111600,1120200,1099304.9718761318,1112134.0840068026\n19980416 00:00,1113100,1115000,1105000,1109100,1102245.4894079491,1111067.0420034013\n19980417 00:00,1107200,1124100,1104400,1122200,1102470.0069203312,1111226.189903231\n19980420 00:00,1120000,1125600,1118800,1124100,1102702.6287575245,1111774.8804080696\n19980421 00:00,1124400,1131600,1119100,1126300,1102946.4039482782,1112453.636387666\n19980422 00:00,1128800,1134400,1128100,1130000,1107672.757509667,1121851.8181938329\n19980423 00:00,1126300,1130000,1117500,1120900,1108029.6067540287,1121946.7272841411\n19980424 00:00,1117500,1124700,1103400,1108800,1110521.795976039,1117998.3636420704\n19980427 00:00,1093800,1106600,1076300,1085900,1110675.5247131372,1116670.9454599668\n19980428 00:00,1097800,1098100,1081300,1086300,1110791.696549983,1115322.3981869684\n19980429 00:00,1090300,1099700,1084400,1095300,1110875.873593174,1114158.77827762\n19980430 00:00,1105600,1119200,1104100,1114400,1110954.810237438,1114033.339363739\n19980501 00:00,1117500,1123100,1113100,1121900,1112232.775098546,1116066.6696818694\n19980504 00:00,1127200,1133100,1121600,1122500,1112342.7266260267,1116630.836197776\n19980505 00:00,1120000,1121600,1111300,1116600,1112449.7033200732,1116621.7943878872\n19980506 00:00,1121300,1121300,1104700,1105000,1112549.4783537835,1116440.7046684928\n19980507 00:00,1105000,1105600,1094100,1095900,1111448.4468488991,1108145.3523342465\n19980508 00:00,1100000,1113800,1100000,1110000,1111364.3127956148,1108083.084717534\n19980511 00:00,1115600,1122200,1103800,1108600,1111288.4282377658,1108328.9304816572\n19980512 00:00,1108100,1118800,1102500,1116400,1111217.3421307611,1108444.9839575742\n19980513 00:00,1120600,1125600,1115900,1120600,1111163.4144464843,1109060.2347596954\n19980514 00:00,1115300,1126900,1113400,1119700,1112023.8401798252,1114605.1173798477\n19980515 00:00,1120000,1122200,1108100,1110000,1112089.0532131009,1114632.3615108551\n19980518 00:00,1107200,1115900,1098300,1108400,1112143.2204686562,1114255.7434353123\n19980519 00:00,1110000,1116900,1107800,1110600,1112433.1332809061,1113302.871717656\n19980520 00:00,1120900,1125000,1108800,1122800,1112459.3731521778,1113482.7281317732\n19980521 00:00,1123800,1127800,1113100,1116900,1112493.6661165028,1113831.0917251846\n19980522 00:00,1117500,1120600,1109400,1111600,1112528.5628920635,1113889.5371389254\n19980526 00:00,1120900,1120900,1094400,1095300,1112088.8643114134,1110769.7685694627\n19980527 00:00,1093100,1099100,1075800,1096300,1112026.7372071526,1109603.7801409895\n19980528 00:00,1098800,1103800,1087300,1100000,1111948.5960553223,1108901.09113394\n19980529 00:00,1106300,1108100,1093800,1093800,1110192.8334332341,1104925.54556697\n19980601 00:00,1089700,1102200,1085600,1095000,1110047.3693046188,1104374.2682886214\n19980602 00:00,1100000,1103400,1091600,1095900,1107769.8105145418,1100937.1341443108\n19980603 00:00,1098800,1101900,1082200,1085000,1107587.8846876055,1100492.7774370953\n19980604 00:00,1082500,1100600,1080600,1099100,1107398.1410345465,1099998.1385652404\n19980605 00:00,1103800,1118800,1098800,1118100,1107224.1432996073,1100438.2316369782\n19980608 00:00,1119400,1124700,1116600,1118800,1108054.1364293278,1110544.115818489\n19980609 00:00,1117200,1124200,1114100,1122800,1108127.1432692837,1110974.4100275645\n19980610 00:00,1116300,1130600,1112500,1113800,1108302.8373812027,1111947.2051941259\n19980611 00:00,1114400,1118800,1092800,1096600,1108445.528685168,1108873.602597063\n19980612 00:00,1098800,1104400,1082500,1102500,1106624.5968385087,1101161.8012985315\n19980615 00:00,1088100,1099100,1078800,1080000,1106472.762198386,1100551.2112336047\n19980616 00:00,1084100,1091600,1077500,1090600,1106304.7219102245,1099751.1506719245\n19980617 00:00,1101600,1117800,1099400,1112500,1106151.943690927,1100193.5931383283\n19980618 00:00,1111900,1114400,1107500,1111600,1106006.9069104863,1105571.7965691641\n19980619 00:00,1110600,1112300,1096300,1100300,1105994.4394062418,1105508.206740706\n19980622 00:00,1102500,1110600,1100600,1103800,1105982.3983311774,1105512.7964036707\n19980623 00:00,1110900,1121900,1110000,1119700,1105983.7047874853,1106034.656583487\n19980624 00:00,1121600,1136900,1116100,1134700,1106010.560261656,1107057.9237543126\n19980625 00:00,1139100,1144700,1128100,1130000,1109940.1606655312,1121728.9618771563\n19980626 00:00,1133100,1138400,1131300,1134100,1110251.2819934753,1122385.0137832984\n19980629 00:00,1142500,1146900,1138000,1138900,1115792.8382180189,1132417.5068916492\n19980630 00:00,1139100,1141900,1130600,1133600,1120428.0670249704,1134333.7534458246\n19980701 00:00,1140600,1149400,1136300,1149400,1124969.019449456,1138591.8767229123\n19980702 00:00,1147200,1148800,1142500,1146300,1125318.4135353887,1138944.7828867666\n19980706 00:00,1147800,1158400,1145600,1157800,1125675.3917905644,1139597.5437424283\n19980707 00:00,1159800,1161300,1152800,1155600,1126045.2611596829,1140470.1665553069\n19980708 00:00,1158800,1169400,1157500,1168100,1126434.6085863793,1141619.1582275415\n19980709 00:00,1162800,1167200,1156300,1160000,1132747.1012182273,1151684.5791137707\n19980710 00:00,1160300,1169100,1150600,1165300,1138502.1483028918,1155767.2895568854\n19980713 00:00,1165600,1168400,1160600,1167500,1143910.0224217796,1160133.6447784426\n19980714 00:00,1169400,1181600,1169400,1178100,1144531.8085378201,1161236.531275821\n19980715 00:00,1180600,1182800,1174400,1175600,1144971.1309421754,1162104.7047120298\n19980716 00:00,1176900,1185900,1170600,1184400,1145419.6519055315,1162911.9694764283\n19980717 00:00,1186300,1190000,1183100,1187500,1146010.2500885848,1164384.2474235056\n19980720 00:00,1187500,1192300,1179400,1185000,1153286.9684943769,1175117.1237117527\n19980721 00:00,1190000,1190000,1162800,1165300,1158904.8668347518,1175758.5618558764\n19980722 00:00,1163400,1195900,1155300,1166300,1159326.0110079602,1175750.6337630826\n19980723 00:00,1163100,1168400,1138800,1141900,1159708.9382846344,1174643.1020749283\n19980724 00:00,1149700,1150900,1128800,1141600,1160038.801001798,1172903.4469711818\n19980727 00:00,1136300,1150000,1128400,1149800,1160318.2878423186,1171218.2746226226\n19980728 00:00,1144400,1146600,1118800,1133100,1158228.500209567,1151959.1373113114\n19980729 00:00,1137200,1141300,1122500,1126600,1158046.6922154713,1150956.1804457458\n19980730 00:00,1136300,1145900,1134100,1143400,1157855.168567589,1150406.8576488872\n19980731 00:00,1143400,1145000,1113100,1120600,1157642.2647225603,1149339.0147664428\n19980803 00:00,1117800,1124200,1110300,1113800,1157394.5722051994,1147734.5640281206\n19980804 00:00,1122200,1122200,1072500,1076100,1157090.0912957373,1145215.3358267145\n19980805 00:00,1079400,1088800,1055900,1081600,1156702.1407392283,1141572.0690353788\n19980806 00:00,1081300,1095200,1075600,1090900,1156238.561771019,1138681.9555793249\n19980807 00:00,1096900,1105900,1084700,1090300,1146426.6657756798,1116990.9777896623\n19980810 00:00,1087500,1096600,1081900,1085900,1145295.0316634234,1114993.553153337\n19980811 00:00,1067800,1074400,1055000,1070600,1144474.6277592296,1112478.8754956701\n19980812 00:00,1077500,1088100,1075000,1085000,1143636.072858271,1110932.4317208866\n19980813 00:00,1088100,1096600,1076300,1076400,1142787.878790185,1109708.3101348423\n19980814 00:00,1083400,1087200,1057800,1064800,1141914.379186133,1107847.8946281\n19980817 00:00,1060000,1089400,1055000,1085000,1128941.7712181122,1090023.94731405\n19980818 00:00,1090000,1105900,1087800,1102500,1120065.5718278405,1093436.973657025\n19980819 00:00,1110900,1110900,1096300,1100000,1119412.560656499,1093945.1249741737\n19980820 00:00,1096900,1104100,1091600,1092500,1118780.755858223,1094140.3687254651\n19980821 00:00,1081900,1087200,1055000,1083800,1109740.6129843504,1082620.1843627326\n19980824 00:00,1092500,1099400,1083100,1090600,1109073.3895383563,1083051.675144596\n19980825 00:00,1103800,1112500,1086400,1095000,1104617.7515468418,1091250.837572298\n19980826 00:00,1082800,1096300,1077500,1085000,1104278.1401505128,1091033.295693683\n19980827 00:00,1070000,1078400,1038900,1042500,1103906.5399194749,1089414.1309089987\n19980828 00:00,1049700,1057200,1021600,1030000,1094031.6713032308,1064407.0654544993\n19980831 00:00,1037500,1040200,950000,962500,1093204.4223251943,1060941.7121817744\n19980901 00:00,960600,1005600,936300,996900,1092285.3649313815,1056442.1265726858\n19980902 00:00,998100,1017500,987800,990000,1076600.5395201219,1029546.0632863429\n19980903 00:00,976300,993800,966900,985200,1075362.6825351694,1027086.2601220257\n19980904 00:00,994400,998100,957800,976300,1074094.3516496883,1024629.4471159244\n19980908 00:00,1008800,1029700,998100,1025900,1072844.3172274493,1024092.9747601282\n19980909 00:00,1027500,1031300,1004800,1007500,1071617.979947316,1023790.8260221217\n19980910 00:00,984400,993400,968100,982500,1070368.5000666585,1021638.7847210156\n19980911 00:00,981900,1015000,970000,1012500,1068957.0828651935,1020005.5606687004\n19980914 00:00,1028800,1044500,1020900,1031600,1066304.132520313,1021422.539341711\n19980915 00:00,1028800,1043100,1022800,1042000,1056524.6668079486,1027186.2696708555\n19980916 00:00,1047500,1052500,1031600,1050000,1055809.7865424326,1027929.4561873127\n19980917 00:00,1022500,1030300,1017800,1022300,1055107.9289633203,1027735.483377947\n19980918 00:00,1023800,1024100,1010900,1019700,1054085.6052345808,1026991.1604638406\n19980921 00:00,996300,1034100,989400,1021900,1045406.8489839156,1019370.5802319204\n19980922 00:00,1035000,1036600,1021600,1030000,1044768.1040398257,1019857.0512203242\n19980923 00:00,1038800,1070000,1037800,1066300,1044187.8814053128,1021559.198659308\n19980924 00:00,1063100,1068100,1032500,1043800,1043658.0903383386,1022996.2387263426\n19980925 00:00,1031300,1054200,1026300,1043000,1040649.3475945469,1031623.1193631713\n19980928 00:00,1053100,1063100,1042500,1049100,1040450.1629895584,1032681.9633950127\n19980929 00:00,1053800,1059400,1033800,1049400,1040273.355545451,1033377.865225262\n19980930 00:00,1035000,1043100,1013800,1018400,1037933.4998122461,1030913.932612631\n19981001 00:00,1000300,1015500,980900,986300,1037717.1182164899,1029278.2359819994\n19981002 00:00,988800,1008800,972200,1003100,1037457.6733656501,1027339.3241828994\n19981005 00:00,995900,1000000,963400,990000,1037147.6654808527,1025057.3579737544\n19981006 00:00,1007500,1012800,975300,985300,1036806.648595708,1023506.9900750667\n19981007 00:00,986300,1000300,957500,972200,1027905.8602061643,1001203.4950375333\n19981008 00:00,945600,967500,922200,962200,1027167.8592081516,998385.8202856566\n19981009 00:00,970000,995600,940600,986300,1026410.4509597322,996871.5292713738\n19981012 00:00,1006300,1014400,996900,997800,1025682.951005934,997310.452807805\n19981013 00:00,995600,1004100,987500,995300,1024971.7504849711,997234.9301674147\n19981014 00:00,989400,1018100,988400,1005000,1018789.429134655,1000242.4650837074\n19981015 00:00,1001300,1072500,999400,1050300,1018616.1299864547,1018096.2325418537\n19981016 00:00,1061300,1067500,1050000,1056600,1018653.9497596623,1020128.9209147609\n19981019 00:00,1056900,1068100,1055000,1063400,1024200.3274340918,1040839.4604573804\n19981020 00:00,1075600,1088000,1060900,1065000,1024658.3189341023,1042519.9874345113\n19981021 00:00,1068800,1076300,1058800,1071300,1025300.2513572142,1044167.1942902014\n19981022 00:00,1067800,1084700,1061600,1080000,1025938.0370693903,1045956.9141109545\n19981023 00:00,1079700,1080000,1067800,1071300,1026473.4378527906,1047354.0684054068\n19981026 00:00,1077200,1085600,1067800,1075500,1027032.1360310992,1048821.3649851363\n19981027 00:00,1084400,1089700,1062800,1066300,1027611.1525487187,1050192.7967358795\n19981028 00:00,1065600,1078100,1060300,1067800,1028199.4526574778,1051143.1568990855\n19981029 00:00,1070900,1089700,1066300,1089700,1028839.6207796567,1052554.9836283894\n19981030 00:00,1101300,1109100,1095000,1100000,1040955.3385382912,1077302.4918141947\n19981102 00:00,1108100,1117500,1101900,1114800,1052020.5540372725,1091490.1529033044\n19981103 00:00,1115900,1118100,1107500,1111300,1064551.6846408674,1102145.0764516522\n19981104 00:00,1124700,1130900,1110900,1118400,1076294.398037107,1111522.538225826\n19981105 00:00,1115300,1138100,1111300,1137300,1086748.6158060585,1118111.269112913\n19981106 00:00,1134700,1145000,1133100,1142800,1087558.8555523388,1119158.2056572672\n19981109 00:00,1139400,1142500,1125000,1131400,1088367.0790478904,1119887.795374404\n19981110 00:00,1130000,1139400,1125000,1126900,1089170.487211835,1120503.4056056838\n19981111 00:00,1138100,1140600,1118900,1123800,1089965.3684146742,1120965.7353253996\n19981112 00:00,1123100,1131300,1116900,1120300,1090744.2954182855,1121122.4485591296\n19981113 00:00,1122200,1130600,1121300,1127700,1098942.2776336053,1123536.2242795648\n19981116 00:00,1142200,1143600,1128900,1138400,1099573.0185194048,1124171.9130655865\n19981117 00:00,1136600,1156300,1130000,1143400,1100211.7134917274,1125120.817412307\n19981118 00:00,1143100,1149400,1135000,1147500,1100855.7900679766,1125974.7765416915\n19981119 00:00,1152800,1159100,1146300,1155000,1110476.189618694,1139337.3882708456\n19981120 00:00,1163600,1167500,1158400,1166300,1111227.235349659,1140518.0188573033\n19981123 00:00,1174700,1192200,1171600,1191600,1123722.6788694072,1161209.0094286515\n19981124 00:00,1190000,1196600,1184500,1186900,1124696.5133716026,1162676.058957219\n19981125 00:00,1189400,1191900,1181600,1188800,1125676.0944375463,1163879.756009358\n19981127 00:00,1194700,1197200,1190000,1195000,1133373.7508636597,1173456.0073359963\n19981130 00:00,1190200,1193800,1166600,1166900,1134504.8629557383,1173833.0877450746\n19981201 00:00,1161300,1180300,1152200,1178100,1135478.5897157902,1173453.9333578208\n19981202 00:00,1172200,1179100,1160000,1175000,1136423.0933901437,1173258.7366899299\n19981203 00:00,1172500,1183100,1151900,1152800,1137336.7860517758,1172970.7998554334\n19981204 00:00,1166300,1188800,1155900,1179700,1138226.860397048,1172939.7598626616\n19981207 00:00,1180600,1195300,1180000,1192500,1139113.07068386,1173675.2718695286\n19981208 00:00,1185300,1197500,1175000,1184700,1149325.461996586,1179962.6359347643\n19981209 00:00,1186900,1189700,1178800,1188100,1150096.750550122,1180177.004138026\n19981210 00:00,1188400,1188400,1167200,1168100,1150845.7856346471,1180058.1539311246\n19981211 00:00,1164400,1173400,1155600,1170600,1151556.647149645,1179280.2462345683\n19981214 00:00,1161600,1164100,1139100,1144700,1155027.5161415548,1165440.1231172842\n19981215 00:00,1146900,1167500,1145300,1166300,1155276.5311620515,1164988.1169614198\n19981216 00:00,1171300,1171300,1157500,1164100,1155518.5856608339,1164958.7111133488\n19981217 00:00,1172200,1185600,1170200,1185000,1159496.278134794,1171429.3555566743\n19981218 00:00,1183100,1191300,1178800,1190200,1159811.630875895,1172110.3877788405\n19981221 00:00,1192500,1213400,1190000,1203100,1160156.086813745,1173589.8683898984\n19981222 00:00,1204100,1212200,1191900,1205300,1160527.5065176617,1175012.8749704035\n19981223 00:00,1211900,1231900,1208100,1228100,1160945.874635267,1177262.2312218833\n19981224 00:00,1231600,1238800,1222800,1226900,1171717.1848791856,1204031.1156109418\n19981228 00:00,1232500,1233100,1220000,1226300,1172553.1817529658,1205157.0598303946\n19981229 00:00,1227200,1244400,1221300,1243100,1173402.8948801137,1206541.7068388748\n19981230 00:00,1239400,1247500,1230300,1233800,1174271.813045534,1208159.621496931\n19981231 00:00,1233100,1239400,1224700,1228800,1176965.3973077955,1211606.8277245723\n19990104 00:00,1233800,1252200,1217200,1228800,1177860.299533559,1212761.4863383437\n19990105 00:00,1229400,1248800,1229400,1244400,1178765.7523457557,1214078.4120214265\n19990106 00:00,1258100,1276300,1257500,1275000,1183719.1038735907,1225319.0330672937\n19990107 00:00,1263800,1272200,1257800,1269400,1187596.1952176862,1231728.1109760238\n19990108 00:00,1281900,1285000,1259700,1275000,1188750.2704729247,1233759.2054272227\n19990111 00:00,1276900,1276900,1252200,1262800,1203851.3535330964,1249154.6027136114\n19990112 00:00,1262200,1262200,1238100,1240000,1215301.5904890236,1249652.3013568057\n19990113 00:00,1204100,1251300,1203800,1233100,1216132.730384022,1248547.1862889654\n19990114 00:00,1236300,1239100,1209100,1211600,1216912.5327987843,1247324.826974517\n19990115 00:00,1223800,1247800,1220300,1243100,1217656.2466194595,1246661.085625791\n19990119 00:00,1253000,1274700,1235000,1252800,1218391.6037375855,1247070.5313445013\n19990120 00:00,1260900,1279400,1250300,1256300,1227783.7692212518,1255960.2656722507\n19990121 00:00,1255800,1258400,1232200,1235900,1228474.8563004364,1255427.252388638\n19990122 00:00,1221300,1238400,1217800,1225600,1229114.5071371556,1254060.889769206\n19990125 00:00,1232800,1240000,1219100,1236300,1229707.5280907454,1252835.3452807458\n19990126 00:00,1241300,1257200,1236300,1255000,1234728.8142281524,1249792.672640373\n19990127 00:00,1263800,1266300,1244100,1244700,1235112.1698476574,1250063.0390083543\n19990128 00:00,1252500,1269700,1251900,1266600,1235499.3627779144,1250599.8870579365\n19990129 00:00,1273400,1283000,1254100,1278800,1241518.2579656779,1259574.9435289684\n19990201 00:00,1286900,1286900,1270000,1270900,1241993.268925349,1260518.6963525198\n19990202 00:00,1270800,1272200,1247700,1262800,1242455.6937405874,1260490.2615348937\n19990203 00:00,1256900,1279400,1256600,1271900,1247903.0529973023,1264245.130767447\n19990204 00:00,1273800,1275000,1248100,1248400,1248308.2360280966,1264110.3742290745\n19990205 00:00,1256600,1256600,1232200,1240000,1248678.6515153348,1263124.8555176207\n19990208 00:00,1250900,1250900,1233400,1243800,1249013.5880459948,1262076.1127417395\n19990209 00:00,1243800,1245000,1215600,1218600,1249300.4310224613,1260487.3071046525\n19990210 00:00,1221300,1230000,1213300,1226900,1247242.4866549275,1241068.6535523264\n19990211 00:00,1230600,1256900,1225000,1256900,1246933.856185563,1241056.8132564726\n19990212 00:00,1248100,1255000,1226300,1235000,1246786.421595765,1241036.4725936488\n19990216 00:00,1247500,1256300,1233800,1243800,1246647.68977997,1241237.1489639664\n19990217 00:00,1231900,1253600,1222500,1227500,1246508.442323365,1241077.791515768\n19990218 00:00,1231900,1243800,1222200,1239400,1246362.5788137803,1240673.9019399795\n19990219 00:00,1240000,1257500,1233800,1239400,1246226.5820145104,1240922.7068429806\n19990222 00:00,1244400,1277200,1242800,1276900,1247285.2748662555,1250461.3534214902\n19990223 00:00,1275900,1285000,1265900,1275000,1247395.9126383592,1251710.7857504156\n19990224 00:00,1278400,1288400,1254100,1254100,1247528.2084839726,1252687.7464628948\n19990225 00:00,1245300,1252800,1225900,1247500,1247150.8746708413,1246018.8732314473\n19990226 00:00,1247500,1248400,1228100,1239100,1245896.7651570619,1242134.4366157237\n19990301 00:00,1236600,1243100,1208800,1237800,1245782.4763977588,1241325.2147849374\n19990302 00:00,1245000,1253100,1223100,1228100,1245667.013338957,1241163.9540456906\n19990303 00:00,1230900,1235600,1217800,1231300,1245536.356914068,1240440.756343406\n19990304 00:00,1240600,1252300,1232700,1250000,1244519.862228477,1241470.3781717028\n19990305 00:00,1275000,1281300,1259200,1278100,1244479.599654343,1242909.3592631177\n19990308 00:00,1282800,1288000,1272500,1285200,1244487.0194454833,1244776.3912999618\n19990309 00:00,1281300,1299400,1274400,1282500,1244546.9082527203,1246882.5717349637\n19990310 00:00,1284700,1292200,1277800,1290300,1244652.9466251077,1248788.4431482155\n19990311 00:00,1296900,1311900,1288800,1302200,1252132.0153623577,1274569.2215741077\n19990312 00:00,1310000,1310300,1292200,1295300,1252726.2964906837,1275903.2604954022\n19990315 00:00,1299400,1311900,1295000,1311600,1253340.1540151825,1277280.597470632\n19990316 00:00,1311300,1316600,1304700,1309800,1253980.3768547305,1278949.0675971005\n19990317 00:00,1306900,1309400,1296300,1302500,1254634.4702887933,1280144.1142172455\n19990318 00:00,1297800,1323400,1297500,1321600,1264800.1169937507,1295297.0571086227\n19990319 00:00,1323100,1326300,1298400,1300600,1270848.9933494087,1300996.5732358443\n19990322 00:00,1300600,1305900,1294200,1299100,1272693.184248557,1300880.3171721941\n19990323 00:00,1293100,1296300,1257000,1264100,1276711.177832942,1288765.158586097\n19990324 00:00,1268400,1271600,1256300,1269400,1276981.5084035383,1287524.400656792\n19990325 00:00,1280600,1292500,1277500,1291300,1277241.9252090484,1287398.1806239525\n19990326 00:00,1286300,1291300,1277200,1284700,1277558.461333513,1287197.9987162761\n19990329 00:00,1291600,1314400,1291600,1312200,1281943.5958396692,1295098.999358138\n19990330 00:00,1299400,1312200,1295600,1303400,1282283.482178433,1295539.049390231\n19990331 00:00,1311600,1316100,1284400,1286300,1282620.7600469904,1295774.5969207194\n19990401 00:00,1296900,1296900,1281300,1293800,1282941.2627226827,1295440.8670746833\n19990405 00:00,1309400,1323800,1302500,1323800,1283275.8892476393,1296326.323720949\n19990406 00:00,1321900,1329800,1311600,1319400,1289585.2074008482,1308513.1618604744\n19990407 00:00,1326900,1333800,1313800,1328800,1290077.5148100131,1309277.5037674506\n19990408 00:00,1331900,1347800,1322800,1345300,1290590.0426542398,1310578.628579078\n19990409 00:00,1344400,1356900,1335900,1348800,1291134.534016637,1312369.697150124\n19990412 00:00,1334700,1362500,1332200,1360600,1300815.8626562431,1329859.8485750621\n19990413 00:00,1362500,1364700,1340300,1351900,1301570.2624934947,1330991.856146309\n19990414 00:00,1360600,1360600,1326900,1330300,1302321.7500146322,1331629.7633389935\n19990415 00:00,1334400,1335600,1310000,1326300,1303120.2741063992,1331140.4435336997\n19990416 00:00,1329100,1329100,1311900,1321300,1303807.4777876644,1330608.4213570147\n19990419 00:00,1326900,1345300,1283800,1289100,1304457.4283502018,1329805.5002891638\n19990420 00:00,1298100,1310300,1288800,1306300,1305053.3107733142,1328292.7252747056\n19990421 00:00,1310600,1337800,1257800,1336900,1305596.1802292555,1326768.0890109702\n19990422 00:00,1351300,1362500,1343900,1359700,1314193.1462983128,1339984.044505485\n19990423 00:00,1358800,1367500,1350000,1357500,1314861.3761978603,1340922.3422802107\n19990426 00:00,1365000,1368100,1354700,1361300,1315538.4974220688,1341946.2251662002\n19990427 00:00,1371300,1375000,1358400,1365600,1316229.6328342145,1343183.9139078902\n19990428 00:00,1364400,1372500,1350000,1353400,1316926.0724686715,1344087.2182124956\n19990429 00:00,1355600,1360600,1338100,1345600,1324374.2066280656,1346718.6091062478\n19990430 00:00,1350900,1356300,1315000,1334700,1324918.9809286373,1346165.1786509354\n19990503 00:00,1334400,1357200,1330300,1356300,1325447.116898381,1346044.4197183885\n19990504 00:00,1351300,1358100,1331300,1333100,1325960.368944233,1345977.198732469\n19990505 00:00,1339400,1350000,1318400,1349700,1326446.0681905232,1345388.3387958454\n19990506 00:00,1344400,1351300,1323800,1335000,1330201.843492373,1341469.1693979227\n19990507 00:00,1345000,1349800,1334400,1346300,1330484.3151782644,1341500.7109280266\n19990510 00:00,1348400,1357200,1335300,1342200,1330765.6616833485,1341738.1753816253\n19990511 00:00,1353100,1368800,1257800,1357200,1331004.4268065782,1340316.266612544\n19990512 00:00,1357500,1372200,1315000,1366300,1333742.8534315014,1341958.1333062719\n19990513 00:00,1372500,1380000,1368100,1370200,1333988.3502617378,1343562.726640958\n19990514 00:00,1345600,1362500,1333100,1343000,1334233.006262917,1343774.5903089102\n19990517 00:00,1336300,1344800,1323100,1343100,1335390.3284858016,1338862.2951544551\n19990518 00:00,1345300,1349800,1326300,1336300,1336156.783258658,1338456.1475772276\n19990519 00:00,1344700,1348800,1332500,1348100,1336217.0096821506,1338565.8401983662\n19990520 00:00,1351300,1355900,1300600,1343100,1335514.7372864087,1333407.920099183\n19990521 00:00,1341300,1346900,1195800,1334200,1335384.4944566041,1330305.0240942237\n19990524 00:00,1338400,1338400,1303900,1310900,1332970.248854231,1325727.512047112\n19990525 00:00,1313800,1323400,1286900,1288400,1332763.4585439942,1324698.6364447563\n19990526 00:00,1293100,1310000,1280900,1306600,1332525.2771959573,1323236.2046225185\n19990527 00:00,1298400,1302800,1280000,1284400,1326223.4834747827,1307318.1023112591\n19990528 00:00,1290000,1307500,1285900,1305900,1325737.5763178053,1306787.1971956962\n19990601 00:00,1301300,1301600,1283800,1298800,1325246.207843258,1306082.8373359113\n19990602 00:00,1297500,1301900,1206300,1297800,1324702.1450339046,1303483.6954691156\n19990603 00:00,1306900,1309100,1297800,1302800,1319393.3207090679,1303466.847734558\n19990604 00:00,1314700,1331900,1309400,1319400,1319016.637825037,1304326.00534783\n19990607 00:00,1334400,1341900,1329100,1337500,1319240.7290372564,1319913.0026739151\n19990608 00:00,1333800,1338000,1315900,1321600,1320288.4221121818,1323431.5013369576\n19990609 00:00,1324100,1330900,1318100,1321600,1320368.3347161298,1323484.9262701096\n19990610 00:00,1314400,1315000,1295900,1309100,1320423.7058471416,1322583.179956604\n19990611 00:00,1312200,1322200,1290900,1298100,1318959.4268799317,1314566.589978302\n19990614 00:00,1306900,1307500,1295500,1297800,1318833.272719918,1313913.2604793867\n19990615 00:00,1304700,1316600,1300800,1305900,1318703.7558383055,1313652.5974554173\n19990616 00:00,1323800,1338800,1321600,1334800,1318598.161131914,1314479.9675826463\n19990617 00:00,1328800,1355600,1326300,1346600,1320877.3667967664,1327714.9837913231\n19990618 00:00,1340600,1346900,1333800,1343100,1321064.100991891,1328346.734601757\n19990621 00:00,1344700,1350000,1336600,1349400,1321264.8584138856,1329094.3978716691\n19990622 00:00,1340000,1351900,1333400,1337000,1321477.5414029905,1329772.1779780856\n19990623 00:00,1330000,1336300,1321300,1332800,1323429.6782995034,1329286.0889890427\n19990624 00:00,1328800,1338100,1306600,1316900,1323567.4184555057,1328939.2845395906\n19990625 00:00,1325900,1330200,1312500,1316600,1323692.2285019334,1328559.820312611\n19990628 00:00,1326900,1336300,1324700,1333800,1323816.3435218097,1328656.8292969805\n19990629 00:00,1330000,1351300,1327800,1351300,1323950.9721295678,1329201.4878321313\n19990630 00:00,1346300,1375000,1338400,1367500,1328700.9150761922,1342950.7439160657\n19990701 00:00,1370000,1385000,1360600,1380600,1329094.472367294,1344443.2067202623\n19990702 00:00,1381300,1393000,1379100,1391900,1329530.1992177176,1346523.546384249\n19990706 00:00,1392500,1407500,1385900,1387200,1330017.7534639004,1349032.3690650365\n19990707 00:00,1390600,1397200,1385200,1395600,1340042.3612310549,1370116.1845325183\n19990708 00:00,1390600,1406300,1387500,1395600,1340827.6865829257,1371455.3753058922\n19990709 00:00,1400000,1404700,1393800,1402200,1341628.1220818677,1372845.1065405975\n19990712 00:00,1409400,1409400,1395000,1400600,1342445.2403101602,1374312.8512135677\n19990713 00:00,1393800,1399200,1386600,1395000,1343265.1645187284,1375242.2086528891\n19990714 00:00,1400000,1402200,1387500,1398400,1344089.1003612662,1376222.5982202445\n19990715 00:00,1407800,1488800,1403100,1411300,1345041.2629961572,1379927.649268721\n19990716 00:00,1412500,1421600,1407500,1420000,1353043.4162539092,1391782.4372946338\n19990719 00:00,1421900,1422500,1405600,1410000,1365511.6168522611,1402916.218647317\n19990720 00:00,1401300,1404100,1375300,1378000,1373210.7399701104,1396308.1093236585\n19990721 00:00,1380900,1389100,1370000,1378800,1376890.31864304,1387929.0546618293\n19990722 00:00,1374400,1380000,1354700,1361400,1377140.5632251825,1386900.1019287377\n19990723 00:00,1366600,1370000,1351300,1357500,1377351.7390653603,1385587.5968323008\n19990726 00:00,1348800,1361300,1346300,1350000,1377517.9010134935,1383998.2169906856\n19990727 00:00,1360000,1372000,1353800,1365000,1376500.7028839558,1373449.1084953428\n19990728 00:00,1362500,1373100,1355900,1367300,1376413.2266386212,1373001.6530705756\n19990729 00:00,1349400,1352500,1333100,1343800,1376290.1852330817,1371491.5704170468\n19990730 00:00,1348100,1353400,1328800,1330900,1376132.2303996594,1369971.9918961944\n19990802 00:00,1327500,1347500,1325000,1329400,1375936.0719472026,1368285.8923013846\n19990803 00:00,1337200,1338400,1313800,1323600,1375692.0850906803,1366176.5976863152\n19990804 00:00,1327200,1338800,1305300,1306900,1367797.3885287996,1344113.2988431575\n19990805 00:00,1308800,1317200,1288400,1315600,1356712.2037519943,1323456.6494215787\n19990806 00:00,1312200,1320000,1295000,1300600,1355860.8690819568,1322658.8169504998\n19990809 00:00,1305900,1318000,1297200,1300500,1354179.9481151006,1321198.297436426\n19990810 00:00,1298800,1301600,1270000,1282200,1352977.9036906837,1318793.4097035571\n19990811 00:00,1296900,1305300,1286300,1305300,1352023.407923504,1317554.2865421341\n19990812 00:00,1306900,1318100,1300000,1300200,1342343.0917603949,1313302.1432710672\n19990813 00:00,1316300,1332500,1311300,1331900,1341627.8153690728,1313732.0361075138\n19990816 00:00,1331300,1339700,1322500,1333800,1340952.1308423996,1314600.4343021382\n19990817 00:00,1344400,1351600,1331300,1347000,1337720.4024195669,1328025.217151069\n19990818 00:00,1342000,1343800,1334100,1335600,1337491.6787664157,1328571.4562935156\n19990819 00:00,1323800,1332300,1316900,1328800,1334765.1911115013,1326585.728146758\n19990820 00:00,1330600,1339100,1326900,1338800,1334568.7223771992,1326906.44173942\n19990823 00:00,1348100,1364500,1346600,1363900,1334412.9698090805,1328338.619652449\n19990824 00:00,1360600,1379700,1353800,1365000,1334309.125280599,1330259.1886698264\n19990825 00:00,1371900,1387800,1279100,1384400,1334211.8653794923,1330418.729236335\n19990826 00:00,1382800,1384200,1365000,1365000,1334172.263564368,1332627.7927745183\n19990827 00:00,1368800,1370600,1351300,1351600,1337326.4217700907,1346788.896387259\n19990830 00:00,1353400,1355000,1323900,1326600,1338774.6783759755,1343119.4481936295\n19990831 00:00,1329400,1337500,1307500,1325000,1338857.523311175,1342088.4757839479\n19990901 00:00,1329400,1335600,1323100,1335600,1338922.3740282643,1341451.5519947505\n19990902 00:00,1321300,1326700,1306600,1322500,1336454.474520542,1329050.7759973751\n19990903 00:00,1348800,1362800,1346900,1361900,1336301.6310874661,1330340.7371975062\n19990907 00:00,1360600,1366300,1342800,1355200,1337837.5654652878,1342445.3685987531\n19990908 00:00,1348400,1360600,1335000,1349100,1337959.453832876,1342713.1001688153\n19990909 00:00,1347500,1352500,1336900,1351300,1338080.7786160633,1342812.4451603745\n19990910 00:00,1362500,1363600,1349400,1354500,1338216.1797232206,1343496.8229023558\n19990913 00:00,1351300,1354700,1345000,1348100,1340330.4876552098,1346673.411451178\n19990914 00:00,1340600,1345600,1333800,1340600,1340480.343985795,1346324.740878619\n19990915 00:00,1354400,1354400,1320600,1320800,1340615.4229820173,1345883.503834688\n19990916 00:00,1325000,1328100,1303100,1323800,1340709.2706235407,1344369.3286429537\n19990917 00:00,1326300,1339400,1321600,1337200,1340783.4354132223,1343675.862210806\n19990920 00:00,1339400,1340000,1330900,1336300,1340845.4637553983,1343264.5691002656\n19990921 00:00,1322500,1324700,1301600,1309100,1337685.9189540818,1328207.2845501327\n19990922 00:00,1312500,1318400,1297500,1311600,1337423.6314882955,1327194.420322626\n19990923 00:00,1318100,1342500,1237800,1280000,1337121.5956837505,1325342.1993064946\n19990924 00:00,1277500,1283800,1263100,1280600,1336762.245525186,1322747.5893411697\n19990927 00:00,1287500,1297500,1282800,1282800,1336371.132133909,1321117.7098741112\n19990928 00:00,1279400,1288100,1255600,1281900,1326399.3128346957,1296483.8549370556\n19990929 00:00,1284400,1291300,1267800,1267800,1325630.2590685834,1295637.1621902029\n19990930 00:00,1274400,1294400,1269700,1283800,1322348.13288979,1292911.2382700145\n19991001 00:00,1279400,1285600,1266300,1283400,1321591.008976458,1292063.1763565138\n19991004 00:00,1291900,1306300,1287500,1306300,1320858.8591905138,1292305.017538688\n19991005 00:00,1307200,1319700,1286900,1301900,1318842.7621854907,1293952.7433843846\n19991006 00:00,1307500,1328100,1306900,1326300,1318249.9457862326,1295130.1062151652\n19991007 00:00,1328600,1330000,1315000,1320000,1315891.22261657,1308815.0531075825\n19991008 00:00,1317500,1338800,1312300,1337200,1315799.5010692694,1315426.9194554961\n19991011 00:00,1335900,1341300,1333100,1338100,1315817.4028796055,1316515.5734827213\n19991012 00:00,1331300,1333100,1311900,1314100,1315842.3376778301,1316814.7948085852\n19991013 00:00,1306900,1313100,1282500,1286600,1315842.8806125883,1315864.055068156\n19991014 00:00,1284800,1291900,1267500,1284100,1315798.204905142,1314055.852314748\n19991015 00:00,1260000,1267500,1245000,1248100,1315682.388774989,1311165.5596990106\n19991018 00:00,1249400,1257500,1234400,1255600,1315487.9485984656,1307904.7817140599\n19991019 00:00,1271900,1282500,1259400,1260800,1315252.1759492129,1306057.0426283567\n19991020 00:00,1277500,1292500,1271300,1292200,1309933.7622904542,1293978.5213141784\n19991021 00:00,1272200,1288800,1266300,1286300,1309514.3456144044,1293157.0952484694\n19991022 00:00,1297500,1312200,1295600,1303400,1309118.8429861953,1293694.2404860458\n19991025 00:00,1293100,1304700,1287500,1295000,1308736.235123084,1293814.5284617434\n19991026 00:00,1301900,1306900,1281900,1282500,1308363.9242959733,1293843.802038656\n19991027 00:00,1283800,1303100,1282500,1301300,1304603.418476812,1293321.901019328\n19991028 00:00,1324400,1345000,1321900,1345000,1304371.5406641008,1295328.3059683617\n19991029 00:00,1358400,1376900,1357200,1365600,1304235.1119142468,1298914.3906699435\n19991101 00:00,1365000,1370000,1356300,1359400,1304182.3883948016,1302126.1711364463\n19991102 00:00,1359700,1372500,1347500,1348100,1304207.9188516217,1305157.3019649587\n19991103 00:00,1360000,1363800,1351300,1356900,1310994.3518843362,1331353.6509824793\n19991104 00:00,1367500,1373600,1357700,1364700,1320371.220286062,1348501.8254912398\n19991105 00:00,1386300,1391100,1367800,1372200,1321113.1706343275,1350049.2342166777\n19991108 00:00,1370000,1383800,1367500,1379400,1321868.5731811153,1351329.2725058438\n19991109 00:00,1385000,1386900,1362800,1367200,1322634.4915736013,1352505.3088805515\n19991110 00:00,1362500,1383900,1360800,1377500,1323406.0678701743,1353497.5434365238\n19991111 00:00,1381900,1385600,1374700,1383800,1334260.493832196,1366823.7717182618\n19991112 00:00,1392500,1399700,1371300,1397500,1344735.8418389298,1376161.8858591309\n19991115 00:00,1398400,1402500,1394100,1398100,1345549.1655821109,1377268.7915661742\n19991116 00:00,1405600,1426300,1400900,1424400,1346387.5702422545,1379085.3519878655\n19991117 00:00,1422500,1429400,1413100,1415600,1359832.596680174,1400167.6759939329\n19991118 00:00,1424400,1430000,1416300,1428100,1372789.1570093723,1411658.8379969664\n19991119 00:00,1424100,1429700,1420000,1425000,1377991.4483595167,1414916.7620106684\n19991122 00:00,1424400,1430000,1415000,1424700,1379217.0279917866,1415413.4675454607\n19991123 00:00,1428400,1428400,1400600,1408800,1380120.7971461967,1415367.7941681875\n19991124 00:00,1407500,1424400,1400000,1420600,1380998.0123290364,1415209.404459778\n19991126 00:00,1424700,1428800,1412500,1414400,1381860.0978767301,1415481.4342367891\n19991129 00:00,1408800,1419200,1404400,1410000,1382696.0294929356,1415297.3625249497\n19991130 00:00,1407500,1423100,1390000,1392500,1383500.1286155798,1414859.9943987022\n19991201 00:00,1393100,1405000,1390000,1401300,1389170.0957615227,1406179.997199351\n19991202 00:00,1406300,1413600,1403800,1411300,1389598.4933009692,1406305.9973393835\n19991203 00:00,1430300,1454100,1430300,1436900,1390061.0484052552,1408100.6974724142\n19991206 00:00,1435300,1437200,1422500,1427500,1397289.6234879931,1418975.348736207\n19991207 00:00,1432800,1433100,1413800,1419400,1397837.3599332783,1419199.0812993967\n19991208 00:00,1413400,1420600,1406300,1406300,1398364.216615807,1418911.6272344268\n19991209 00:00,1418100,1422200,1393800,1410000,1398864.2623472295,1418366.0458727053\n19991210 00:00,1422800,1428100,1408800,1420000,1403750.2024945102,1418408.0229363525\n19991213 00:00,1414400,1427200,1412800,1421300,1404118.6379768858,1418487.6217895348\n19991214 00:00,1416300,1424800,1406300,1408100,1404474.190544965,1418340.740700058\n19991215 00:00,1403800,1422000,1400000,1418000,1407023.235496231,1414670.3703500289\n19991216 00:00,1421900,1426600,1411600,1423800,1407219.9509046383,1414891.8518325274\n19991217 00:00,1430000,1433100,1420600,1423800,1407426.6961130449,1415489.759240901\n19991220 00:00,1425600,1431900,1410900,1416900,1407635.66049219,1415785.271278856\n19991221 00:00,1415900,1440600,1413400,1433400,1411074.9042789994,1421392.6356394282\n19991222 00:00,1436300,1441900,1429700,1437500,1411350.8567684607,1422113.0038574566\n19991223 00:00,1450200,1464400,1449700,1460900,1418408.5180585275,1439581.5019287283\n19991227 00:00,1465000,1467800,1450600,1458100,1418962.3657778716,1440562.4268322918\n19991228 00:00,1458800,1465000,1454800,1461400,1419526.5392706916,1441529.305490677\n19991229 00:00,1463100,1468100,1452500,1463400,1427373.5676393532,1450914.6527453386\n19991230 00:00,1471300,1478800,1461900,1466300,1435688.2573226823,1460632.3263726693\n19991231 00:00,1468400,1475000,1462500,1468800,1436322.0061409662,1461038.2100540358\n20000103 00:00,1482500,1482500,1438800,1455600,1436939.4259762254,1461018.799551334\n20000104 00:00,1435300,1440600,1396400,1400600,1437488.2618161638,1458892.8595737673\n20000105 00:00,1399400,1415300,1372500,1402800,1437942.1356856367,1455643.2165950788\n20000106 00:00,1396300,1415000,1392500,1403400,1438319.796187629,1453048.5557653247\n20000107 00:00,1403100,1444400,1400600,1444400,1438649.8294823647,1451521.1279770585\n20000110 00:00,1462500,1469100,1450300,1458100,1442890.0131089059,1455610.5639885291\n20000111 00:00,1458100,1460900,1435000,1440900,1443198.451175911,1455227.5357891025\n20000112 00:00,1445900,1446300,1428800,1433400,1443477.0813715043,1454343.6589996472\n20000113 00:00,1444700,1457500,1432800,1451300,1443737.2537384583,1453883.976049665\n20000114 00:00,1465300,1474700,1459700,1465000,1444007.5668261764,1454549.7772471816\n20000118 00:00,1453400,1466300,1451900,1456300,1447211.89727553,1456824.8886235908\n20000119 00:00,1453100,1464700,1450000,1456900,1447452.878448452,1456851.144192411\n20000120 00:00,1469700,1469700,1438100,1445000,1447684.1461618105,1456703.5869827904\n20000121 00:00,1455000,1455000,1440900,1441300,1448844.8079942067,1452326.7934913952\n20000124 00:00,1456600,1458400,1394100,1400600,1446455.7051820795,1439288.3967456976\n20000125 00:00,1405200,1420000,1390000,1410000,1446233.6619752378,1437573.9769084128\n20000126 00:00,1410000,1415500,1400900,1406700,1445980.4523774316,1436105.278062992\n20000127 00:00,1418400,1422200,1381300,1400000,1445690.6289219917,1434387.5141598424\n20000128 00:00,1394400,1400600,1355300,1364700,1435810.1609614743,1406168.7570799212\n20000131 00:00,1358100,1394400,1350000,1394400,1435026.6649180856,1404470.319225925\n20000201 00:00,1397500,1416900,1385300,1401900,1434258.5433767491,1404301.8032646286\n20000202 00:00,1412800,1422500,1403800,1413000,1433520.6851198652,1404744.213101397\n20000203 00:00,1408800,1429700,1400000,1428400,1432813.9055530266,1405249.5024463271\n20000204 00:00,1431900,1440000,1421300,1427800,1429097.866970561,1417949.7512231637\n20000207 00:00,1425600,1427800,1414400,1427200,1428823.101887847,1418107.2636620055\n20000208 00:00,1439700,1445600,1436300,1442800,1428583.7593526235,1419249.4004789053\n20000209 00:00,1444700,1444700,1413800,1414100,1427500.2445743307,1424249.7002394525\n20000210 00:00,1416300,1425600,1408800,1418800,1427410.1688406593,1423897.2152274798\n20000211 00:00,1418400,1419400,1380300,1391300,1427292.2859812954,1422694.8544661058\n20000214 00:00,1397800,1397800,1383100,1392500,1427137.044125333,1421082.6117428006\n20000215 00:00,1392500,1412200,1378000,1407500,1426953.2050510913,1419783.4811556605\n20000216 00:00,1403800,1409400,1388000,1390900,1426747.6076022608,1418729.3070978774\n20000217 00:00,1404400,1404400,1382200,1390600,1421564.36908893,1406014.6535489387\n20000218 00:00,1388800,1388800,1346300,1351900,1421127.545383494,1404091.4208714918\n20000222 00:00,1351900,1441900,1333400,1354200,1420681.0904946045,1403269.349827917\n20000223 00:00,1356300,1374700,1345000,1365200,1420191.5227906525,1401098.382336521\n20000224 00:00,1366900,1370300,1330900,1356900,1419651.0713013785,1398573.463219695\n20000225 00:00,1351900,1375300,1331300,1337500,1408722.4863784958,1375936.7316098474\n20000228 00:00,1333800,1366900,1327200,1350600,1396915.2062351028,1361493.3658049237\n20000229 00:00,1360600,1374400,1357500,1369100,1396035.231017092,1361716.1975146774\n20000301 00:00,1376300,1390000,1372200,1383100,1389878.4479521536,1371408.0987573387\n20000302 00:00,1386900,1391300,1373400,1387200,1389430.3665988364,1371955.1938194716\n20000303 00:00,1404400,1417200,1397200,1413100,1389037.543287078,1373717.434128498\n20000306 00:00,1408100,1413400,1387500,1393900,1388687.9562654528,1375054.062422073\n20000307 00:00,1400000,1401600,1352200,1359400,1388349.4163413406,1375146.3593009692\n20000308 00:00,1364700,1378400,1350300,1370500,1383699.1071686265,1369748.1796504846\n20000309 00:00,1372500,1405900,1361300,1405900,1383367.6487561099,1370440.7706679604\n20000310 00:00,1401900,1420000,1395300,1400000,1383090.988340571,1372301.2321345622\n20000313 00:00,1366900,1404700,1356900,1388800,1382831.8678952525,1372726.170527834\n20000314 00:00,1392800,1400900,1361600,1365000,1382589.8802479072,1373152.3620014421\n20000315 00:00,1368800,1404400,1325000,1395000,1379173.9554361107,1368926.1810007212\n20000316 00:00,1416300,1466900,1408800,1463100,1379003.915848975,1372372.371950685\n20000317 00:00,1458100,1480000,1454400,1466900,1389199.4833805668,1419786.1859753425\n20000320 00:00,1468800,1473400,1447800,1459800,1390015.168212967,1421826.8766765753\n20000321 00:00,1455300,1497200,1445000,1497200,1404127.235744297,1446463.4383382876\n20000322 00:00,1495600,1508400,1486900,1500000,1405249.624011224,1449022.7664213732\n20000323 00:00,1491600,1534700,1491600,1526300,1424208.8138110894,1481086.3832106865\n20000324 00:00,1528800,1557500,1517200,1532800,1425701.082567066,1483899.5640501522\n20000327 00:00,1533800,1537800,1520000,1525000,1427212.2951490802,1486149.5858476446\n20000328 00:00,1512500,1529800,1507500,1510000,1428726.3529342348,1487774.6065552623\n20000329 00:00,1515600,1524800,1496600,1510300,1440869.533594897,1496045.3001908856\n20000330 00:00,1501600,1519400,1471300,1488800,1454576.5627200333,1495697.6500954428\n20000331 00:00,1496300,1523100,1484400,1505600,1456749.5714811317,1496531.7695393248\n20000403 00:00,1501300,1510300,1486900,1507700,1457746.7117206624,1496635.1810623584\n20000404 00:00,1517500,1530000,1413900,1500000,1458688.0669778767,1495400.9220092404\n20000405 00:00,1478800,1508100,1476300,1488800,1467466.1654845625,1493800.4610046202\n20000406 00:00,1502500,1516900,1490000,1503100,1468136.584796308,1494282.937954389\n20000407 00:00,1515600,1521300,1505000,1517800,1468813.827452817,1495226.2910566696\n20000410 00:00,1517500,1531100,1503100,1507800,1469501.4811790925,1496319.976503836\n20000411 00:00,1500000,1516300,1483800,1500600,1470799.0977913563,1496676.2002745948\n20000412 00:00,1503800,1511600,1465600,1466300,1471435.9301030939,1496272.390260865\n20000413 00:00,1474700,1481600,1437800,1440000,1473073.4963599285,1477986.1951304325\n20000414 00:00,1426300,1428100,1335000,1358100,1473075.768585278,1473164.385373911\n20000417 00:00,1351900,1401300,1266900,1400600,1472904.1535232763,1466211.1661052152\n20000418 00:00,1405600,1442200,1397800,1442200,1472679.0648801932,1463900.6077999545\n20000419 00:00,1445000,1451300,1425300,1430000,1467284.3746351392,1451100.3038999774\n20000420 00:00,1435600,1439400,1423800,1433800,1466855.397486885,1450125.2887049785\n20000424 00:00,1415000,1432800,1405000,1430000,1466398.1131564563,1448564.0242697296\n20000425 00:00,1446300,1479700,1444400,1478800,1465969.118403951,1449238.3230562431\n20000426 00:00,1479700,1487500,1460000,1463800,1465581.488116438,1450463.9069034308\n20000427 00:00,1430000,1473400,1430000,1465000,1461956.6044502575,1451081.9534517154\n20000428 00:00,1470000,1478600,1450600,1452200,1461701.6357334792,1451757.8557791295\n20000501 00:00,1465600,1484800,1436300,1471900,1461464.0314148965,1452197.462990173\n20000502 00:00,1455000,1471300,1445000,1446300,1461239.8078755406,1452495.0898406643\n20000503 00:00,1440000,1440000,1397800,1416300,1460979.1960623679,1450815.335348631\n20000504 00:00,1420000,1423600,1407500,1413100,1460681.0178753387,1449052.0685811995\n20000505 00:00,1410600,1440000,1409400,1433400,1460277.9531155052,1447556.3423575894\n20000508 00:00,1427500,1433800,1418400,1425300,1459933.0924186104,1446483.5252397098\n20000509 00:00,1430600,1434100,1402700,1416300,1453060.2599689215,1432441.7626198549\n20000510 00:00,1405000,1409700,1377500,1385900,1452496.24533192,1430499.674488862\n20000511 00:00,1401300,1415000,1391300,1411100,1451912.1439677323,1429132.1907644188\n20000512 00:00,1418100,1434700,1415600,1424100,1451337.667399194,1428933.0812261978\n20000515 00:00,1427500,1455900,1420000,1453800,1450788.8238933363,1429383.9271648878\n20000516 00:00,1465600,1477200,1453100,1470000,1449908.3588156132,1447266.963582444\n20000517 00:00,1456900,1461900,1444700,1452500,1450002.1395595153,1450283.481791222"
  },
  {
    "path": "Tests/TestData/spy_mass_index_25.txt",
    "content": "Date,Open,High,Low,Close,MassIndex\n8/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,\n8/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,\n8/26/2015 12:00:00 AM,192.21,194.79,188.37,194.68,\n8/27/2015 12:00:00 AM,197.05,199.42,195.21,199.27,\n8/28/2015 12:00:00 AM,198.5,199.84,197.92,199.28,\n8/31/2015 12:00:00 AM,198.14,199.13,197.01,197.67,\n9/1/2015 12:00:00 AM,193.07,194.77,190.73,191.77,\n9/2/2015 12:00:00 AM,194.69,195.46,192.42,195.41,\n9/3/2015 12:00:00 AM,196.25,198.05,194.96,195.55,\n9/4/2015 12:00:00 AM,192.88,193.86,191.61,192.59,\n9/8/2015 12:00:00 AM,195.97,197.61,195.17,197.43,\n9/9/2015 12:00:00 AM,199.32,199.47,194.35,194.79,\n9/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,\n9/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,\n9/14/2015 12:00:00 AM,196.95,197.01,195.43,196.01,\n9/15/2015 12:00:00 AM,196.59,198.99,195.96,198.46,\n9/16/2015 12:00:00 AM,198.82,200.41,198.41,200.18,\n9/17/2015 12:00:00 AM,199.96,202.89,199.28,199.73,\n9/18/2015 12:00:00 AM,195.74,198.68,194.96,195.45,\n9/21/2015 12:00:00 AM,196.45,197.68,195.21,196.46,\n9/22/2015 12:00:00 AM,193.9,194.46,192.56,193.91,\n9/23/2015 12:00:00 AM,194.13,194.67,192.91,193.6,\n9/24/2015 12:00:00 AM,192.13,193.45,190.56,192.9,\n9/25/2015 12:00:00 AM,194.61,195,191.81,192.85,\n9/28/2015 12:00:00 AM,191.75,191.91,187.64,188.01,\n9/29/2015 12:00:00 AM,188.24,189.74,186.93,188.12,\n9/30/2015 12:00:00 AM,190.4,191.83,189.44,191.63,\n10/1/2015 12:00:00 AM,192.03,192.49,189.82,192.13,\n10/2/2015 12:00:00 AM,189.75,195.03,189.12,195,\n10/5/2015 12:00:00 AM,196.47,198.74,196.33,198.47,\n10/6/2015 12:00:00 AM,198.27,198.98,197,197.79,\n10/7/2015 12:00:00 AM,198.85,199.83,197.48,199.41,\n10/8/2015 12:00:00 AM,198.96,201.55,198.59,201.21,\n10/9/2015 12:00:00 AM,201.4,201.9,200.58,201.33,\n10/12/2015 12:00:00 AM,201.43,201.76,200.91,201.52,\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,200.25,\n10/14/2015 12:00:00 AM,200.16,200.87,198.94,199.29,\n10/15/2015 12:00:00 AM,200.05,202.36,199.64,202.35,\n10/16/2015 12:00:00 AM,202.82,203.29,201.92,203.27,\n10/19/2015 12:00:00 AM,202.53,203.37,202.13,203.37,\n10/20/2015 12:00:00 AM,202.86,203.84,202.55,203.11,\n10/21/2015 12:00:00 AM,203.64,203.79,201.65,201.85,\n10/22/2015 12:00:00 AM,203,205.51,201.85,205.26,\n10/23/2015 12:00:00 AM,207.24,207.95,206.3,207.51,\n10/26/2015 12:00:00 AM,207.27,207.37,206.56,207,\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.6,\n10/28/2015 12:00:00 AM,207,208.98,206.21,208.95,\n10/29/2015 12:00:00 AM,208.36,209.27,208.21,208.83,\n10/30/2015 12:00:00 AM,209.07,209.44,207.74,207.93,\n11/2/2015 12:00:00 AM,208.36,210.62,208.17,210.39,\n11/3/2015 12:00:00 AM,209.98,211.66,209.7,211,\n11/4/2015 12:00:00 AM,211.37,211.5,209.72,210.36,\n11/5/2015 12:00:00 AM,210.44,210.98,209.09,210.15,\n11/6/2015 12:00:00 AM,209.74,210.32,208.46,210.04,\n11/9/2015 12:00:00 AM,209.33,209.49,206.95,208.08,\n11/10/2015 12:00:00 AM,207.54,208.6,207.19,208.56,\n11/11/2015 12:00:00 AM,208.9,208.94,207.66,207.74,\n11/12/2015 12:00:00 AM,206.51,207.06,204.82,204.84,\n11/13/2015 12:00:00 AM,204.36,204.67,202.44,202.54,\n11/16/2015 12:00:00 AM,202.3,205.69,202.18,205.62,\n11/17/2015 12:00:00 AM,205.97,207.04,204.88,205.47,\n11/18/2015 12:00:00 AM,206.03,208.9,205.99,208.73,\n11/19/2015 12:00:00 AM,208.55,209.05,208.2,208.55,\n11/20/2015 12:00:00 AM,209.47,210.12,208.86,209.31,\n11/23/2015 12:00:00 AM,209.4,209.98,208.52,209.07,\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,209.35,\n11/25/2015 12:00:00 AM,209.48,209.74,209.01,209.32,\n11/27/2015 12:00:00 AM,209.4,209.8,208.86,209.56,\n11/30/2015 12:00:00 AM,209.79,209.89,208.56,208.69,\n12/1/2015 12:00:00 AM,209.42,210.82,209.11,210.68,\n12/2/2015 12:00:00 AM,210.6,211,208.23,208.53,\n12/3/2015 12:00:00 AM,208.9,209.15,204.75,205.61,\n12/4/2015 12:00:00 AM,206.1,209.97,205.93,209.62,\n12/7/2015 12:00:00 AM,209.2,209.73,207.2,208.35,\n12/8/2015 12:00:00 AM,206.48,208.29,205.78,206.95,\n12/9/2015 12:00:00 AM,206.2,208.68,204.18,205.34,\n12/10/2015 12:00:00 AM,205.44,207.43,205.14,205.87,\n12/11/2015 12:00:00 AM,203.38,204.14,201.51,201.88,\n12/14/2015 12:00:00 AM,202.1,203.05,199.95,202.9,\n12/15/2015 12:00:00 AM,204.69,206.11,202.87,205.03,\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,208.03,\n12/17/2015 12:00:00 AM,208.37,208.48,204.84,204.86,\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,200.02,\n12/21/2015 12:00:00 AM,201.43,201.88,200.09,201.67,\n12/22/2015 12:00:00 AM,202.7,203.85,201.55,203.5,\n12/23/2015 12:00:00 AM,204.7,206.07,204.58,206.02,\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.68,\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,205.21,\n12/29/2015 12:00:00 AM,206.53,207.79,206.47,207.4,\n12/30/2015 12:00:00 AM,207.09,207.21,205.76,205.93,\n12/31/2015 12:00:00 AM,205.17,205.89,203.87,203.87,\n1/4/2016 12:00:00 AM,200.53,201.03,198.59,201.02,\n1/5/2016 12:00:00 AM,201.39,201.9,200.05,201.36,\n1/6/2016 12:00:00 AM,198.33,200.06,197.6,198.82,\n1/7/2016 12:00:00 AM,195.32,197.44,193.59,194.05,25.79493132\n1/8/2016 12:00:00 AM,195.21,195.85,191.58,191.92,25.98705149\n1/11/2016 12:00:00 AM,193.05,193.41,189.82,192.11,25.96145865\n1/12/2016 12:00:00 AM,193.85,194.55,191.14,193.66,25.84040077\n1/13/2016 12:00:00 AM,194.53,194.86,188.38,188.83,25.95292136\n1/14/2016 12:00:00 AM,189.55,193.26,187.66,191.93,26.13427841\n1/15/2016 12:00:00 AM,186.79,188.76,185.52,187.81,26.10266525\n1/19/2016 12:00:00 AM,189.95,190.11,186.2,188.06,26.12162745\n1/20/2016 12:00:00 AM,185,187.5,181.02,185.65,26.25985671\n1/21/2016 12:00:00 AM,186.19,188.87,184.64,186.69,26.33701059\n1/22/2016 12:00:00 AM,189.78,190.76,188.88,190.52,26.27020795\n1/25/2016 12:00:00 AM,189.91,190.15,187.41,187.64,26.13214008\n1/26/2016 12:00:00 AM,188.44,190.53,188.02,190.2,25.94195603\n1/27/2016 12:00:00 AM,189.58,191.56,187.06,188.13,25.84300072\n1/28/2016 12:00:00 AM,190,190.2,187.16,189.11,25.81308625\n1/29/2016 12:00:00 AM,190.03,193.88,189.88,193.72,25.84296528\n2/1/2016 12:00:00 AM,192.5,194.58,191.84,193.65,25.90170291\n2/2/2016 12:00:00 AM,191.9,191.97,189.54,190.16,26.00158979\n2/3/2016 12:00:00 AM,191.37,191.78,187.1,191.3,26.20922495\n2/4/2016 12:00:00 AM,190.72,192.75,189.96,191.6,26.39714164\n2/5/2016 12:00:00 AM,190.97,191.67,187.2,187.95,26.63680628\n2/8/2016 12:00:00 AM,185.75,186.12,182.8,185.42,26.80656493\n2/9/2016 12:00:00 AM,183.38,186.94,183.2,185.43,26.90956954\n2/10/2016 12:00:00 AM,186.44,188.34,185.12,185.27,26.98532666\n2/11/2016 12:00:00 AM,182.38,184.1,181.09,182.86,26.98362517\n2/12/2016 12:00:00 AM,184.93,186.65,183.96,186.63,26.81398338\n2/16/2016 12:00:00 AM,188.78,189.81,187.63,189.78,26.49978864\n2/17/2016 12:00:00 AM,191.12,193.32,191.01,192.88,26.16572363\n2/18/2016 12:00:00 AM,193.22,193.27,191.72,192.09,25.80491541\n2/19/2016 12:00:00 AM,191.15,192.18,190.45,192,25.27687511\n2/22/2016 12:00:00 AM,193.9,194.95,193.79,194.78,24.69836684\n2/23/2016 12:00:00 AM,193.99,194.32,192.18,192.32,24.28152719\n2/24/2016 12:00:00 AM,190.62,193.53,189.32,193.2,24.0754772\n2/25/2016 12:00:00 AM,193.73,195.55,192.83,195.54,23.81202816\n2/26/2016 12:00:00 AM,196.52,196.68,194.9,195.09,23.56741892\n2/29/2016 12:00:00 AM,195.08,196.23,193.33,193.56,23.50697941\n3/1/2016 12:00:00 AM,195.05,198.21,194.45,198.11,23.58185745\n3/2/2016 12:00:00 AM,197.7,199.06,197.25,199,23.6331702\n3/3/2016 12:00:00 AM,198.7,199.8,198.11,199.78,23.57204865\n3/4/2016 12:00:00 AM,200,201.35,199.03,200.43,23.54333805\n3/7/2016 12:00:00 AM,199.34,201.07,199.25,200.59,23.46178231\n3/8/2016 12:00:00 AM,199.3,199.92,198.21,198.4,23.39640958\n3/9/2016 12:00:00 AM,199.36,199.79,198.43,199.38,23.33274512\n3/10/2016 12:00:00 AM,199.9,201.07,197.38,199.54,23.33177358\n3/11/2016 12:00:00 AM,201.25,202.81,199.52,202.76,23.42863928\n3/14/2016 12:00:00 AM,202.2,203.04,201.77,202.5,23.37144385\n3/15/2016 12:00:00 AM,201.32,202.53,201.05,202.17,23.28254171\n3/16/2016 12:00:00 AM,201.62,203.82,201.55,203.34,23.21220246\n3/17/2016 12:00:00 AM,203.26,205.23,202.77,204.63,23.19404726\n3/18/2016 12:00:00 AM,204.2,204.78,203.8,204.38,23.1125244\n3/21/2016 12:00:00 AM,204.11,204.94,203.8,204.67,23.01546151\n3/22/2016 12:00:00 AM,203.74,205.23,203.57,204.56,22.97526644\n3/23/2016 12:00:00 AM,204.11,204.33,203.01,203.21,22.94072355\n3/24/2016 12:00:00 AM,201.98,203.16,201.74,203.12,22.9591861\n3/28/2016 12:00:00 AM,203.62,203.86,202.71,203.24,22.98135479\n3/29/2016 12:00:00 AM,202.75,205.25,202.4,205.12,23.19497083\n3/30/2016 12:00:00 AM,206.35,206.87,205.59,206.02,23.33185448\n3/31/2016 12:00:00 AM,205.87,206.41,205.33,205.52,23.26498055\n4/1/2016 12:00:00 AM,204.35,207.14,203.98,206.92,23.34777348\n4/4/2016 12:00:00 AM,206.84,207.07,205.89,206.25,23.40137238\n4/5/2016 12:00:00 AM,204.64,206.26,203.89,204.19,23.47260987\n4/6/2016 12:00:00 AM,204.27,206.49,203.98,206.42,23.51027947\n4/7/2016 12:00:00 AM,205.18,205.56,203.09,203.95,23.63727409\n4/8/2016 12:00:00 AM,205.32,205.85,203.87,204.5,23.78349849\n4/11/2016 12:00:00 AM,205.23,206.07,203.91,204.02,23.91315134\n4/12/2016 12:00:00 AM,204.2,206.25,203.7,205.92,24.09024006\n4/13/2016 12:00:00 AM,207.02,208.1,206.84,208,24.19752308\n4/14/2016 12:00:00 AM,208.03,208.6,207.6,208.01,24.25996625\n4/15/2016 12:00:00 AM,208,208.17,207.4,207.78,24.10495404\n4/18/2016 12:00:00 AM,207.11,209.28,207,209.24,23.97431764\n4/19/2016 12:00:00 AM,209.7,210.2,208.94,209.9,23.91202617\n4/20/2016 12:00:00 AM,209.9,210.92,209.39,210.1,23.90675762\n4/21/2016 12:00:00 AM,210.13,210.25,208.65,208.97,23.89021485\n4/22/2016 12:00:00 AM,208.53,209.29,207.91,208.97,23.83232884\n4/25/2016 12:00:00 AM,208.28,208.66,207.54,208.61,23.83111425\n4/26/2016 12:00:00 AM,209.02,209.52,208.36,208.92,23.86147552\n4/27/2016 12:00:00 AM,208.46,209.81,208.05,209.35,23.93431962\n4/28/2016 12:00:00 AM,208.49,209.76,206.96,207.45,24.16468535\n4/29/2016 12:00:00 AM,206.71,207.13,205.03,206.33,24.40795859\n5/2/2016 12:00:00 AM,206.9,208.18,206.41,207.97,24.64337816\n5/3/2016 12:00:00 AM,206.5,206.8,205.28,206.16,24.6894367\n5/4/2016 12:00:00 AM,205,205.85,204.42,205.01,24.74227817\n5/5/2016 12:00:00 AM,205.57,205.98,204.47,204.97,24.82502936\n5/6/2016 12:00:00 AM,204.04,205.77,203.88,205.72,24.76986292\n5/9/2016 12:00:00 AM,205.58,206.4,205.36,205.89,24.72622369\n5/10/2016 12:00:00 AM,206.64,208.5,206.64,208.45,24.66366308\n5/11/2016 12:00:00 AM,207.89,208.54,206.5,206.5,24.59857561\n5/12/2016 12:00:00 AM,207.29,207.49,205.37,206.56,24.54717174\n5/13/2016 12:00:00 AM,206.23,206.86,204.38,204.76,24.57929465\n5/16/2016 12:00:00 AM,204.95,207.34,204.89,206.78,24.64228099\n5/17/2016 12:00:00 AM,206.44,206.8,204.23,204.85,24.69920281\n5/18/2016 12:00:00 AM,204.44,206.3,203.63,204.91,24.85740699\n5/19/2016 12:00:00 AM,204,204.54,202.78,204.2,25.02355133\n5/20/2016 12:00:00 AM,204.95,206.1,204.86,205.49,25.17287524\n5/23/2016 12:00:00 AM,205.48,205.84,204.99,205.21,25.1424846\n5/24/2016 12:00:00 AM,206.15,208.24,206.14,207.87,25.18984184\n5/25/2016 12:00:00 AM,208.64,209.77,207.87,209.28,25.24583899\n5/26/2016 12:00:00 AM,209.47,209.71,208.97,209.34,25.19741128\n5/27/2016 12:00:00 AM,209.55,210.25,209.47,210.24,25.10147501\n5/31/2016 12:00:00 AM,210.53,210.69,209.18,209.84,25.07038911\n6/1/2016 12:00:00 AM,209.15,210.48,208.89,210.27,25.08932472\n6/2/2016 12:00:00 AM,209.8,210.93,209.24,210.91,25.08973342\n6/3/2016 12:00:00 AM,210.32,210.69,208.86,210.28,24.98829062\n6/6/2016 12:00:00 AM,210.71,211.77,210.51,211.35,24.84158914\n6/7/2016 12:00:00 AM,211.56,212.34,211.5,211.68,24.65894448\n6/8/2016 12:00:00 AM,211.8,212.52,211.69,212.37,24.47777026\n6/9/2016 12:00:00 AM,211.49,212.22,211.19,212.08,24.33130534\n6/10/2016 12:00:00 AM,210.43,210.86,209.43,210.07,24.25091962\n6/13/2016 12:00:00 AM,209.34,210.37,208.35,208.45,24.2494176\n6/14/2016 12:00:00 AM,207.97,208.74,206.92,208.04,24.35651226\n6/15/2016 12:00:00 AM,208.57,209.36,207.53,207.75,24.44991869\n6/16/2016 12:00:00 AM,206.74,208.57,205.59,208.37,24.62939766\n6/17/2016 12:00:00 AM,207.14,207.2,205.75,206.52,24.68931591\n6/20/2016 12:00:00 AM,208.84,209.61,207.75,207.85,24.68181073\n6/21/2016 12:00:00 AM,208.26,208.92,207.78,208.44,24.568425\n6/22/2016 12:00:00 AM,208.69,209.5,207.93,208.1,24.42694838\n6/23/2016 12:00:00 AM,209.83,210.87,209.27,210.81,24.27083584\n6/24/2016 12:00:00 AM,204,206.91,202.72,203.13,24.42385791\n6/27/2016 12:00:00 AM,201.59,201.6,198.65,199.6,24.67776107\n6/28/2016 12:00:00 AM,201.66,203.23,201.12,203.2,24.94879763\n6/29/2016 12:00:00 AM,204.83,206.93,204.72,206.66,25.12779394\n6/30/2016 12:00:00 AM,207.18,209.54,206.56,209.48,25.31599346\n7/1/2016 12:00:00 AM,209.29,210.49,209.29,209.92,25.46973812\n7/5/2016 12:00:00 AM,208.9,209.08,207.71,208.41,25.61219774\n7/6/2016 12:00:00 AM,207.87,209.8,207.06,209.66,25.78196334\n7/7/2016 12:00:00 AM,209.89,210.65,208.63,209.53,25.89814454\n7/8/2016 12:00:00 AM,211,212.94,210.78,212.65,25.97509701\n7/11/2016 12:00:00 AM,213.16,214.07,212.95,213.4,25.92898301\n7/12/2016 12:00:00 AM,214.51,215.3,213.43,214.95,25.91957467\n7/13/2016 12:00:00 AM,215.42,215.45,214.35,214.92,25.91580378\n7/14/2016 12:00:00 AM,216.34,216.67,215.66,216.12,25.90927625\n7/15/2016 12:00:00 AM,216.79,217.01,215.31,215.83,25.94008417\n7/18/2016 12:00:00 AM,215.95,216.6,215.67,216.41,25.87815916\n7/19/2016 12:00:00 AM,215.88,216.23,215.63,216.19,25.65167593\n7/20/2016 12:00:00 AM,216.75,217.37,216.24,217.09,25.39847564\n7/21/2016 12:00:00 AM,216.92,217.22,215.75,216.27,25.17444801\n7/22/2016 12:00:00 AM,216.39,217.3,216.1,217.24,24.83452986\n7/25/2016 12:00:00 AM,217,217.06,215.97,216.65,24.58185553\n7/26/2016 12:00:00 AM,216.53,217.17,215.76,216.75,24.38872441\n7/27/2016 12:00:00 AM,217.17,217.27,215.62,216.52,24.33953657\n7/28/2016 12:00:00 AM,216.26,217.11,215.75,216.77,24.30910952\n7/29/2016 12:00:00 AM,216.45,217.54,216.13,217.12,24.29477899\n8/1/2016 12:00:00 AM,217.15,217.65,216.41,216.94,24.03239428\n8/2/2016 12:00:00 AM,216.64,216.83,214.57,215.55,23.86918892\n8/3/2016 12:00:00 AM,215.45,216.25,215.13,216.18,23.71711153\n8/4/2016 12:00:00 AM,216.3,216.78,214.25,216.41,23.72250319\n8/5/2016 12:00:00 AM,217.19,218.23,217.07,218.18,23.61946042\n8/8/2016 12:00:00 AM,218.39,218.52,217.74,218.05,23.54499767\n8/9/2016 12:00:00 AM,218.12,218.76,217.8,218.18,23.49584977\n8/10/2016 12:00:00 AM,218.29,218.4,217.23,217.64,23.3817787\n8/11/2016 12:00:00 AM,218.25,218.94,217.95,218.65,23.26405249\n8/12/2016 12:00:00 AM,218.26,218.71,217.99,218.46,23.10261742\n8/15/2016 12:00:00 AM,218.89,219.5,218.88,219.09,22.98178076\n8/16/2016 12:00:00 AM,218.56,218.68,217.96,217.96,22.84249718\n8/17/2016 12:00:00 AM,217.98,218.53,217.02,218.37,22.8691577\n8/18/2016 12:00:00 AM,218.31,218.9,218.21,218.86,22.90058218\n8/19/2016 12:00:00 AM,218.34,218.75,217.74,218.54,22.92071953\n8/22/2016 12:00:00 AM,218.25,218.8,217.83,218.53,22.99725507\n8/23/2016 12:00:00 AM,219.23,219.6,218.9,218.97,23.10353874\n8/24/2016 12:00:00 AM,218.8,218.91,217.36,217.85,23.30857491\n8/25/2016 12:00:00 AM,217.4,218.19,217.22,217.7,23.44495379\n8/26/2016 12:00:00 AM,217.9,219.12,216.25,217.29,23.83112213\n8/29/2016 12:00:00 AM,217.43,218.67,217.4,218.36,24.13863701\n8/30/2016 12:00:00 AM,218.25,218.59,217.35,218,24.34656919\n8/31/2016 12:00:00 AM,217.64,217.75,216.47,217.38,24.4603158\n9/1/2016 12:00:00 AM,217.38,217.73,216.03,217.39,24.59487898\n9/2/2016 12:00:00 AM,218.36,218.87,217.7,218.37,24.66543401\n9/6/2016 12:00:00 AM,218.72,219.12,217.86,219.03,24.72382879\n9/7/2016 12:00:00 AM,218.84,219.22,218.3,219.01,24.61363174\n9/8/2016 12:00:00 AM,218.6,218.94,218.15,218.51,24.51219769\n9/9/2016 12:00:00 AM,217,217.03,213.25,213.28,24.62712262\n9/12/2016 12:00:00 AM,212.39,216.81,212.31,216.34,25.04528951\n9/13/2016 12:00:00 AM,214.85,215.15,212.5,213.23,25.46680521\n9/14/2016 12:00:00 AM,213.29,214.7,212.5,213.15,25.82229285\n9/15/2016 12:00:00 AM,213,215.73,212.75,215.28,26.16654211\n9/16/2016 12:00:00 AM,213.5,213.69,212.57,213.37,26.367112\n9/19/2016 12:00:00 AM,214.1,214.88,213.03,213.41,26.56525091\n9/20/2016 12:00:00 AM,214.43,214.59,213.38,213.42,26.72156218\n9/21/2016 12:00:00 AM,214.22,216.03,213.44,215.82,26.94739677\n9/22/2016 12:00:00 AM,216.99,217.53,216.71,217.18,26.95681045\n9/23/2016 12:00:00 AM,216.73,216.88,215.88,215.99,26.94986222\n9/26/2016 12:00:00 AM,215.02,215.23,214.01,214.24,26.90344025\n9/27/2016 12:00:00 AM,214.03,215.68,213.62,215.57,26.91404672\n9/28/2016 12:00:00 AM,215.81,216.82,214.71,216.64,27.00841999\n9/29/2016 12:00:00 AM,216.39,216.87,214.04,214.68,27.08546035\n9/30/2016 12:00:00 AM,215.67,217.12,215.36,216.3,27.14169577\n10/3/2016 12:00:00 AM,215.81,216.04,215.04,215.78,26.84490369\n10/4/2016 12:00:00 AM,215.86,216.17,213.99,214.68,26.67308531\n10/5/2016 12:00:00 AM,215.37,216.13,215.33,215.63,26.46584277\n10/6/2016 12:00:00 AM,215.39,216.04,214.74,215.78,26.27953024\n10/7/2016 12:00:00 AM,216.06,216.3,214.19,215.04,26.13695147\n10/10/2016 12:00:00 AM,216.14,216.7,215.99,216.16,25.96155186\n10/11/2016 12:00:00 AM,215.64,215.74,212.58,213.43,25.9936662\n10/12/2016 12:00:00 AM,213.61,214.32,213.01,213.71,26.02410482\n10/13/2016 12:00:00 AM,212.15,213.59,211.21,213.01,26.16942888\n10/14/2016 12:00:00 AM,214.14,214.69,213.03,213.12,25.95401728\n10/17/2016 12:00:00 AM,213.07,213.39,212.17,212.38,25.45688939\n10/18/2016 12:00:00 AM,214.24,214.31,213.27,213.71,24.99525101\n10/19/2016 12:00:00 AM,214,214.64,213.6,214.28,24.60551482\n10/20/2016 12:00:00 AM,213.85,214.53,213.11,213.88,24.24585166\n10/21/2016 12:00:00 AM,212.95,214.08,212.76,213.98,24.05427838\n10/24/2016 12:00:00 AM,214.98,215.32,214.48,214.89,23.86376453\n10/25/2016 12:00:00 AM,214.7,214.98,213.98,214.17,23.74552737\n10/26/2016 12:00:00 AM,213.22,214.42,212.93,213.74,23.62262174\n10/27/2016 12:00:00 AM,214.57,214.62,213.08,213.17,23.65164104\n10/28/2016 12:00:00 AM,213.13,213.93,211.71,212.54,23.84360268\n10/31/2016 12:00:00 AM,212.95,213.19,212.36,212.55,23.96163114\n11/1/2016 12:00:00 AM,212.9,212.99,209.6,211.01,24.23041353\n11/2/2016 12:00:00 AM,210.67,211.1,209.23,209.74,24.40891266\n11/3/2016 12:00:00 AM,210.01,210.24,208.46,208.78,24.45134305\n11/4/2016 12:00:00 AM,208.91,209.89,208.38,208.55,24.47435591\n11/7/2016 12:00:00 AM,211.47,213.19,211.3,213.15,24.58724735\n11/8/2016 12:00:00 AM,212.72,214.77,212.38,214.11,24.69590556\n11/9/2016 12:00:00 AM,212.47,217.1,212.34,216.38,25.11464815\n11/10/2016 12:00:00 AM,217.35,218.31,215.22,216.92,25.51184553\n11/11/2016 12:00:00 AM,216.13,216.7,215.32,216.42,25.67795404\n11/14/2016 12:00:00 AM,216.99,217.27,215.72,216.59,25.84099868\n11/15/2016 12:00:00 AM,217,218.28,216.8,218.28,25.75766687\n11/16/2016 12:00:00 AM,217.52,218.14,217.42,217.87,25.63301232\n11/17/2016 12:00:00 AM,218.04,219.06,217.92,218.99,25.4154806\n11/18/2016 12:00:00 AM,219.04,219.27,218.29,218.5,25.19549999\n11/21/2016 12:00:00 AM,219.19,220.18,219,220.15,25.03626932\n11/22/2016 12:00:00 AM,220.49,220.79,219.73,220.58,24.92659047\n11/23/2016 12:00:00 AM,220,220.76,219.75,220.7,24.84780798\n11/25/2016 12:00:00 AM,221.12,221.56,221.01,221.52,24.70244942\n11/28/2016 12:00:00 AM,221.19,221.48,220.36,220.48,24.58753042\n11/29/2016 12:00:00 AM,220.58,221.44,220.17,220.91,24.56733723\n11/30/2016 12:00:00 AM,221.65,221.82,220.31,220.38,24.62595845\n12/1/2016 12:00:00 AM,220.73,220.73,219.15,219.57,24.68835606\n12/2/2016 12:00:00 AM,219.7,220.25,219.26,219.68,24.67297397\n12/5/2016 12:00:00 AM,220.67,221.4,220.42,221,24.52893685\n12/6/2016 12:00:00 AM,221.24,221.74,220.66,221.7,24.47547101\n12/7/2016 12:00:00 AM,221.5,224.67,221.38,224.6,24.47348087\n12/8/2016 12:00:00 AM,224.58,225.7,224.26,225.15,24.44637593\n12/9/2016 12:00:00 AM,225.44,226.53,225.37,226.51,24.38314246\n12/12/2016 12:00:00 AM,226.42,226.96,225.76,226.25,24.33003538\n12/13/2016 12:00:00 AM,227.01,228.34,227,227.76,24.26416073\n12/14/2016 12:00:00 AM,227.41,228.23,225.37,225.88,24.31314851\n12/15/2016 12:00:00 AM,226.13,227.81,225.89,226.81,24.13134276\n12/16/2016 12:00:00 AM,225.99,226.08,224.67,225.04,23.91867574\n12/19/2016 12:00:00 AM,225.24,226.02,225.08,225.53,23.77385184\n12/20/2016 12:00:00 AM,226.16,226.57,225.88,226.4,23.6310185\n12/21/2016 12:00:00 AM,226.27,226.45,225.77,225.77,23.49286036\n12/22/2016 12:00:00 AM,225.61,225.74,224.92,225.38,23.43546939\n12/23/2016 12:00:00 AM,225.42,225.72,225.21,225.71,23.36073093\n12/27/2016 12:00:00 AM,226,226.73,226,226.27,23.3170651\n12/28/2016 12:00:00 AM,226.59,226.59,224.27,224.4,23.49421308\n12/29/2016 12:00:00 AM,224.47,224.89,223.84,224.35,23.65624404\n12/30/2016 12:00:00 AM,224.71,224.83,222.73,223.53,23.94456627\n1/3/2017 12:00:00 AM,225.07,225.83,223.88,225.24,24.33125119\n1/4/2017 12:00:00 AM,225.64,226.75,225.61,226.58,24.61018509\n1/5/2017 12:00:00 AM,226.28,226.58,225.48,226.4,24.78702158\n1/6/2017 12:00:00 AM,226.53,227.75,225.9,227.21,24.94927538\n1/9/2017 12:00:00 AM,226.9,227.07,226.42,226.46,24.94397919\n1/10/2017 12:00:00 AM,226.47,227.45,226.01,226.46,24.9954739\n1/11/2017 12:00:00 AM,226.38,227.1,225.59,227.1,25.09230302\n1/12/2017 12:00:00 AM,226.5,226.75,224.96,226.53,25.23518585\n1/13/2017 12:00:00 AM,226.75,227.4,226.69,227.05,25.00600081\n1/17/2017 12:00:00 AM,226.3,226.78,225.8,226.25,24.80621729\n1/18/2017 12:00:00 AM,226.52,226.8,225.9,226.75,24.6509175\n1/19/2017 12:00:00 AM,226.83,227,225.41,225.91,24.61067029\n1/20/2017 12:00:00 AM,226.73,227.31,225.97,226.74,24.59898724\n1/23/2017 12:00:00 AM,226.37,226.81,225.27,226.15,24.46464783\n1/24/2017 12:00:00 AM,226.4,228.08,226.27,227.6,24.39711213\n1/25/2017 12:00:00 AM,228.7,229.57,228.51,229.57,24.33578723\n1/26/2017 12:00:00 AM,229.42,229.71,229.01,229.33,24.28322473\n1/27/2017 12:00:00 AM,229.44,229.59,228.76,228.97,24.27998288\n1/30/2017 12:00:00 AM,228.18,228.2,226.41,227.55,24.43714836\n1/31/2017 12:00:00 AM,227.01,227.6,226.32,227.53,24.61615644\n2/1/2017 12:00:00 AM,228.28,228.59,226.94,227.62,24.89137855\n2/2/2017 12:00:00 AM,227.24,228.1,226.82,227.77,25.15016972\n2/3/2017 12:00:00 AM,228.85,229.55,228.46,229.34,25.15223066\n2/6/2017 12:00:00 AM,228.89,229.33,228.54,228.93,25.11511197\n2/7/2017 12:00:00 AM,229.36,229.66,228.72,228.94,24.93730712\n2/8/2017 12:00:00 AM,228.59,229.39,228.31,229.24,24.71855685\n2/9/2017 12:00:00 AM,229.57,230.95,229.52,230.6,24.62740366\n2/10/2017 12:00:00 AM,231,231.77,230.62,231.51,24.5881735\n2/13/2017 12:00:00 AM,232.09,233.07,232.05,232.77,24.4774461\n2/14/2017 12:00:00 AM,232.55,233.71,232.16,233.7,24.53777344\n2/15/2017 12:00:00 AM,233.43,235.14,233.39,234.92,24.636413\n2/16/2017 12:00:00 AM,234.93,235.16,233.85,234.72,24.68915566\n2/17/2017 12:00:00 AM,233.97,235.09,233.93,235.09,24.6594547\n2/21/2017 12:00:00 AM,235.51,236.69,235.51,236.49,24.70779824\n2/22/2017 12:00:00 AM,236.02,236.54,235.83,236.28,24.71313114\n2/23/2017 12:00:00 AM,236.9,236.9,235.56,236.44,24.78330124\n2/24/2017 12:00:00 AM,235.42,236.79,235.41,236.74,24.81160767\n2/27/2017 12:00:00 AM,236.61,237.31,236.35,237.11,24.78775191\n2/28/2017 12:00:00 AM,236.71,236.95,236.02,236.47,24.70178948\n3/1/2017 12:00:00 AM,238.4,240.32,238.37,239.78,24.68290746\n3/2/2017 12:00:00 AM,239.57,239.57,238.21,238.27,24.71979782\n3/3/2017 12:00:00 AM,238.19,238.61,237.73,238.42,24.77362308\n3/6/2017 12:00:00 AM,237.48,238.12,237.01,237.71,24.85249277\n3/7/2017 12:00:00 AM,237.39,237.77,236.76,237,24.80885923\n3/8/2017 12:00:00 AM,237.31,237.64,236.4,236.56,24.78310278\n3/9/2017 12:00:00 AM,236.71,237.24,235.74,236.86,24.7583527\n3/10/2017 12:00:00 AM,237.95,238.02,236.59,237.69,24.77166946\n3/13/2017 12:00:00 AM,237.59,237.86,237.24,237.81,24.72587041\n3/14/2017 12:00:00 AM,237.22,237.24,236.19,236.9,24.73802217\n3/15/2017 12:00:00 AM,237.56,239.44,237.29,238.95,24.91545898\n3/16/2017 12:00:00 AM,239.12,239.2,238.1,238.48,25.03541833\n3/17/2017 12:00:00 AM,237.75,237.97,237.03,237.03,25.04682505\n3/20/2017 12:00:00 AM,237.01,237.36,236.32,236.77,25.03768999\n3/21/2017 12:00:00 AM,237.49,237.61,233.58,233.73,25.39742947\n3/22/2017 12:00:00 AM,233.73,234.61,233.05,234.28,25.59565024\n3/23/2017 12:00:00 AM,233.98,235.34,233.6,234.03,25.68201347\n3/24/2017 12:00:00 AM,234.35,235.04,232.96,233.86,25.78705305\n3/27/2017 12:00:00 AM,231.97,233.92,231.61,233.62,25.93851128\n3/28/2017 12:00:00 AM,233.32,235.81,233.14,235.32,26.1399093\n3/29/2017 12:00:00 AM,235,235.81,234.73,235.54,26.28030266\n3/30/2017 12:00:00 AM,235.5,236.52,235.27,236.29,26.31333482\n3/31/2017 12:00:00 AM,235.91,236.51,235.68,235.74,26.23032832\n4/3/2017 12:00:00 AM,235.79,236.03,233.91,235.33,26.25310223\n4/4/2017 12:00:00 AM,235,235.58,234.56,235.48,26.24211451\n4/5/2017 12:00:00 AM,236.26,237.39,234.54,234.78,26.25036931\n4/6/2017 12:00:00 AM,234.96,236.04,234.43,235.44,26.23056292\n4/7/2017 12:00:00 AM,235.18,236,234.64,235.2,26.23201048\n4/10/2017 12:00:00 AM,235.36,236.26,234.73,235.34,26.23326418\n4/11/2017 12:00:00 AM,234.9,235.18,233.34,235.06,26.2772267\n4/12/2017 12:00:00 AM,234.8,234.96,233.77,234.03,26.25427598\n4/13/2017 12:00:00 AM,233.65,234.49,232.51,232.51,26.23065247\n4/17/2017 12:00:00 AM,233.12,234.57,232.88,234.57,26.18951897\n4/18/2017 12:00:00 AM,233.71,234.49,233.08,233.87,26.21802165\n4/19/2017 12:00:00 AM,234.52,234.95,233.18,233.44,26.26894887\n4/20/2017 12:00:00 AM,234.14,235.85,233.78,235.34,26.21507434\n4/21/2017 12:00:00 AM,235.22,235.31,234.13,234.59,26.14971803\n4/24/2017 12:00:00 AM,237.17,237.41,236.61,237.17,26.06061257\n4/25/2017 12:00:00 AM,237.93,238.95,237.81,238.55,25.97791565\n4/26/2017 12:00:00 AM,238.53,239.53,238.35,238.4,25.54108565\n4/27/2017 12:00:00 AM,238.74,238.95,237.98,238.6,25.18292542\n4/28/2017 12:00:00 AM,238.93,238.93,237.93,238.08,24.86608361\n5/1/2017 12:00:00 AM,238.66,239.17,238.2,238.68,24.54715667\n5/2/2017 12:00:00 AM,238.82,238.98,238.3,238.77,24.18116387\n5/3/2017 12:00:00 AM,238.29,238.88,237.7,238.48,23.83110044\n5/4/2017 12:00:00 AM,238.81,238.92,237.78,238.76,23.64704365\n5/5/2017 12:00:00 AM,239.16,239.72,238.68,239.7,23.54548792\n5/8/2017 12:00:00 AM,239.77,239.92,239.17,239.66,23.50068669\n5/9/2017 12:00:00 AM,239.94,240.19,239.04,239.44,23.42698596\n5/10/2017 12:00:00 AM,239.37,239.87,239.15,239.87,23.381512\n5/11/2017 12:00:00 AM,239.31,239.57,238.13,239.38,23.28516493\n5/12/2017 12:00:00 AM,239.05,239.43,238.67,238.98,23.17983445\n5/15/2017 12:00:00 AM,239.49,240.44,239.45,240.3,23.12942155\n5/16/2017 12:00:00 AM,240.64,240.67,239.63,240.08,23.10799209\n5/17/2017 12:00:00 AM,238.09,238.64,235.75,235.82,23.34182578\n5/18/2017 12:00:00 AM,235.7,237.75,235.43,236.77,23.68548091\n5/19/2017 12:00:00 AM,237.36,239.08,237.27,238.31,23.9370593\n5/22/2017 12:00:00 AM,238.87,239.71,238.82,239.52,24.04284683\n5/23/2017 12:00:00 AM,239.98,240.24,239.51,240.05,24.06318272\n5/24/2017 12:00:00 AM,240.33,240.73,239.93,240.61,24.00055292\n5/25/2017 12:00:00 AM,241.22,242.08,240.96,241.76,23.89672056\n5/26/2017 12:00:00 AM,241.59,241.9,241.45,241.71,23.76782772\n5/30/2017 12:00:00 AM,241.32,241.79,241.16,241.5,23.6839567\n5/31/2017 12:00:00 AM,241.84,241.88,240.64,241.44,23.68523837\n6/1/2017 12:00:00 AM,241.97,243.38,241.64,243.36,23.81114574\n6/2/2017 12:00:00 AM,243.45,244.35,243.08,244.17,23.97080857\n6/5/2017 12:00:00 AM,244.02,244.3,243.76,243.99,24.04309344\n6/6/2017 12:00:00 AM,243.34,243.98,243.12,243.21,24.10486509\n6/7/2017 12:00:00 AM,243.61,243.92,242.83,243.66,24.22893442\n6/8/2017 12:00:00 AM,243.8,244.33,243.17,243.78,24.33820528\n6/9/2017 12:00:00 AM,244.07,245.01,241.95,243.41,24.69941852\n6/12/2017 12:00:00 AM,243.09,243.42,242.38,243.36,24.93636534\n6/13/2017 12:00:00 AM,243.98,244.61,243.58,244.55,25.12815504\n6/14/2017 12:00:00 AM,244.86,244.87,243.29,244.24,25.29988539\n6/15/2017 12:00:00 AM,242.69,243.91,242.36,243.77,25.50850422\n6/16/2017 12:00:00 AM,242.83,242.83,241.63,242.64,25.58452146\n6/19/2017 12:00:00 AM,243.61,244.73,243.48,244.66,25.67839026\n6/20/2017 12:00:00 AM,244.23,244.26,242.99,243.01,25.7492264\n6/21/2017 12:00:00 AM,243.46,243.59,242.41,242.95,25.78383819\n6/22/2017 12:00:00 AM,242.96,243.53,242.64,242.84,25.49226147\n6/23/2017 12:00:00 AM,242.88,243.51,242.47,243.13,25.12750044\n6/26/2017 12:00:00 AM,243.93,244.38,243.05,243.29,24.84031187\n6/27/2017 12:00:00 AM,243.01,243.38,241.31,241.33,24.8120314\n6/28/2017 12:00:00 AM,242.51,243.72,242.23,243.49,24.89106913\n6/29/2017 12:00:00 AM,243.62,243.72,239.96,241.35,25.27966181\n6/30/2017 12:00:00 AM,242.3,242.71,241.58,241.8,25.51286036\n7/3/2017 12:00:00 AM,242.9,243.38,242.21,242.21,25.73699307\n7/5/2017 12:00:00 AM,242.61,243.01,241.7,242.77,25.94624564\n7/6/2017 12:00:00 AM,241.86,242.03,240.34,240.55,26.09401169\n7/7/2017 12:00:00 AM,241.18,242.28,240.56,242.11,26.12660584\n7/10/2017 12:00:00 AM,241.98,242.8,241.76,242.37,26.07919448\n7/11/2017 12:00:00 AM,242.12,242.55,240.85,242.19,26.15296339\n7/12/2017 12:00:00 AM,243.31,244.2,243.3,244.01,26.17410985\n7/13/2017 12:00:00 AM,244.02,244.55,243.76,244.42,26.11231468\n7/14/2017 12:00:00 AM,244.4,245.97,244.31,245.56,26.08459047\n7/17/2017 12:00:00 AM,245.44,245.91,245.33,245.53,25.69467701\n7/18/2017 12:00:00 AM,245.06,245.72,244.67,245.66,25.42337575\n7/19/2017 12:00:00 AM,246.01,247,246.01,246.99,25.22722152\n7/20/2017 12:00:00 AM,247.25,247.42,246.47,247.1,25.00932548\n7/21/2017 12:00:00 AM,246.43,246.91,246.18,246.88,24.76023142\n7/24/2017 12:00:00 AM,246.81,246.98,246.28,246.82,24.53604806\n7/25/2017 12:00:00 AM,247.7,247.8,247.16,247.42,24.31730828\n7/26/2017 12:00:00 AM,247.78,247.79,247.13,247.43,24.10714943\n7/27/2017 12:00:00 AM,247.96,248,245.68,247.2,24.17766804\n7/28/2017 12:00:00 AM,246.7,247.06,246.13,246.91,24.25272086\n7/31/2017 12:00:00 AM,247.38,247.48,246.53,246.77,24.31323157\n8/1/2017 12:00:00 AM,247.45,247.5,246.72,247.32,24.29920911\n8/2/2017 12:00:00 AM,247.47,247.6,246.37,247.44,24.21248492\n8/3/2017 12:00:00 AM,247.31,247.34,246.64,246.96,24.07656306\n8/4/2017 12:00:00 AM,247.52,247.79,246.97,247.41,23.68033417\n8/7/2017 12:00:00 AM,247.5,247.87,247.37,247.87,23.37986774\n8/8/2017 12:00:00 AM,247.49,248.91,246.83,247.26,23.39484694\n8/9/2017 12:00:00 AM,246.46,247.31,246.06,247.25,23.4600351\n8/10/2017 12:00:00 AM,246.3,246.44,243.7,243.76,23.72146156\n8/11/2017 12:00:00 AM,244,244.8,243.75,244.12,23.85113603\n8/14/2017 12:00:00 AM,245.55,246.79,245.55,246.54,23.99223537\n8/15/2017 12:00:00 AM,247,247,246.16,246.51,24.01641133\n8/16/2017 12:00:00 AM,247.09,247.57,246.45,246.96,24.08656555\n"
  },
  {
    "path": "Tests/TestData/spy_max.txt",
    "content": "Date,Open,High,Low,Close,Volume,MAX_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,151.91\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,152.11\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,152.92\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,154.29\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,154.5\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,154.78\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,155.44\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,156.03\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,156.03\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,156.03\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,156.73\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,156.73\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,156.73\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,156.73\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,156.73\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,155.83\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,155.69\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,155.69\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,156.19\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,156.19\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,156.67\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,156.67\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.82\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,156.82\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,156.82\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,156.82\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,156.82\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,156.75\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,158.67\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,159.19\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,159.19\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,159.19\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,159.19\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,159.19\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,158.8\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,157.41\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,157.41\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,157.78\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,157.88\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,158.52\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,158.52\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,159.3\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,159.68\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,159.68\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,159.75\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,161.37\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,161.78\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,162.6\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,163.34\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,163.34\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,163.41\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,163.54\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,165.23\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,166.12\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,166.12\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,166.94\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,166.94\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,167.17\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,167.17\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,167.17\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,167.17\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,167.17\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,166.3\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,166.3\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,166.3\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,166.3\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,165.83\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,165.83\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,164.35\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,164.8\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,164.8\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,164.8\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,164.8\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,164.8\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,164.8\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,164.44\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,165.74\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,165.74\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,165.74\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,165.74\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,165.74\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,163.45\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,160.14\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,161.08\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,161.08\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,161.36\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,161.36\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,161.36\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,163.02\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,163.95\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,165.13\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,165.19\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,167.44\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,167.51\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,168.15\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,168.15\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,168.15\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,168.87\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,169.17\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,169.5\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,169.5\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,169.5\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,169.5\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,169.5\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,169.14\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,169.11\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,169.11\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,170.66\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,170.95\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,170.95\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,170.95\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,170.95\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,170.95\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,170.7\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.8\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.8\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.8\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,169.61\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,169.61\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,169.61\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,168.74\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,166.38\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,166.06\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,166.62\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,166.62\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,166.62\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,166.62\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,166.62\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,166\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,164.39\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,165.75\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,165.96\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,166.04\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,167.63\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,168.87\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,169.4\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,169.4\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,169.4\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,170.31\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,171.07\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,173.05\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,173.05\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,173.05\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,173.05\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,173.05\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,172.76\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,170.72\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,169.93\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.69\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,169.69\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,169.69\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,169.34\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,169.34\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,169.34\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,169.18\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,168.89\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,169.17\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,170.26\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,170.94\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,170.94\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,172.07\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,173.22\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,174.39\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,174.4\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,175.41\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,175.41\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,175.41\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,175.95\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,176.23\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,177.17\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,177.17\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,177.17\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,177.17\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,177.17\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,176.83\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,177.17\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,177.17\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,177.29\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,177.32\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,177.32\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,178.38\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,179.27\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,180.05\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,180.05\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,180.05\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,180.05\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,180.05\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,180.81\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,180.81\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,180.81\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,181.12\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,181.12\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,181.12\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,181.12\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,181.12\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,181\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,180.94\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,181.4\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,181.4\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,181.4\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,181.4\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,181.4\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,180.75\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,179.22\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,181.7\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,181.7\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,181.7\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,182.53\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,182.93\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,183.85\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,183.85\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.85\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,184.69\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,184.69\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,184.69\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,184.69\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,184.69\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,183.52\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183.64\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,184.14\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,184.14\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,184.14\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,184.66\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,184.66\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,184.66\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,184.66\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,184.66\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,184.42\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,184.3\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,184.3\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,184.3\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,182.79\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,179.23\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,179.23\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,179.23\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,179.23\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,179.23\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,178.18\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,179.68\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,180.01\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,181.98\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,182.07\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,183.01\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,184.02\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,184.24\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,184.24\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,184.24\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,184.24\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,184.91\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,184.91\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,184.91\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,185.82\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,186.29\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,186.29\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,187.58\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,187.75\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,188.18\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,188.26\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,188.26\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,188.26\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,188.26\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,188.26\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,188.16\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,187.28\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,187.66\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,187.66\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,187.75\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,187.75\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,187.75\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,187.75\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,187.75\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,186.31\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,186.31\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,187.01\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,188.25\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,188.88\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,188.88\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,188.88\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,188.88\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,188.88\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,188.63\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,187.09\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,187.09\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,187.09\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,187.09\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,186.12\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,186.39\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,187.04\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,187.89\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,187.89\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,187.89\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.89\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,187.89\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,187.83\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,188.31\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,188.32\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,188.32\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,188.42\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,188.42\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,188.42\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,188.42\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,188.42\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,189.79\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,189.96\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,189.96\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,189.96\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,189.96\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,189.96\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,189.06\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,189.13\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,189.59\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,190.35\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,191.52\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,191.52\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,192.37\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,192.68\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,192.9\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.9\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,193.19\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,194.45\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,195.38\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,195.58\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,195.6\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,195.6\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,195.6\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,195.6\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,195.6\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.92\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,196.26\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,196.48\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,196.48\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,196.48\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,196.48\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,196.48\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.94\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.88\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.82\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,197.03\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,197.23\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,198.2\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,198.2\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,198.2\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,198.2\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,198.2\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,197.51\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,197.6\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,197.6\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,197.96\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,197.96\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,197.96\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,197.96\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,198.2\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,198.64\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,198.65\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,198.65\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,198.65\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,198.65\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,198.65\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,197.8\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,197.8\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,196.98\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,196.98\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,193.89\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,193.89\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,193.89\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,193.79\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,193.79\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,194.84\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,195.76\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,195.76\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,197.36\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,198.39\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,198.92\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,199.5\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,199.5\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,200.2\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,200.33\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,200.33\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,200.33\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,200.71\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.71\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.71\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.71\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,201.11\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,201.11\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,201.11\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,201.11\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,201.11\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,200.59\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,200.3\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,200.48\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,200.75\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,201.82\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,201.82\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,201.82\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,201.82\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,201.82\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,200.7\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,199.56\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,199.56\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,199.56\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,197.9\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,197.9\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,197.54\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,197.02\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,196.52\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,196.64\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,196.64\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,196.64\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,196.64\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,196.64\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,192.74\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,190.54\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,188.47\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,190.3\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,194.07\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,194.07\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,194.93\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,196.43\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,196.43\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,198.41\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,198.41\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,199.38\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,201.66\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,201.77\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,201.77\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,202.34\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,203.15\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,203.34\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,203.98\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,204.18\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,204.18\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,204.19\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,204.24\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,204.37\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,205.55\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,205.55\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,205.58\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,206.68\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,207.26\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,207.26\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,207.64\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,207.64\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,207.64\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,207.64\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,207.89\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,207.89\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,208\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,208\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,208\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,208\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,208\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,206.61\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,206.47\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,204.19\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,204.19\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,206.78\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,206.78\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,207.47\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,207.75\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,207.77\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,208.44\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,208.72\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,208.72\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,208.72\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,208.72\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,208.72\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,207.6\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,205.54\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,205.9\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,205.9\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,205.9\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,205.9\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,205.9\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,204.25\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,202.65\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,202.08\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,203.08\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,206.1\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,206.1\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,206.1\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,206.1\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,206.1\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,205.45\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,205.45\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,202.74\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,204.84\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,204.84\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,206.12\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,206.12\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,206.12\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,206.81\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,206.93\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,208.92\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,209.78\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,210.11\n"
  },
  {
    "path": "Tests/TestData/spy_mfi.txt",
    "content": "Date,Open,High,Low,Close,Volume,Money Flow Index 20\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.228057E+08,\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,8.32355E+07,\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.041083E+08,\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,9.10515E+07,\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.236142E+08,\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.331532E+08,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.265183E+08,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.670499E+08,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.136078E+08,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.284929E+08,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.111032E+08,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.512318E+08,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,8.6114E+07,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,9.97837E+07,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.026877E+08,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,9.91285E+07,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.01291E+08,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.537818E+08,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.2937E+08,\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.55171E+08,\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,8.60397E+07,43.92582\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.005915E+08,44.35241\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.348373E+08,49.46251\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.096351E+08,49.90131\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.160249E+08,44.87086\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,2.155057E+08,43.3788\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.471524E+08,48.88801\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,2.262315E+08,47.75435\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.668889E+08,42.48873\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.492193E+08,47.7641\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.062165E+08,47.67466\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.65592E+08,53.66642\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,9.49964E+07,53.84153\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.307744E+08,58.10461\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,9.5639E+07,54.40964\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,8.82234E+07,57.95138\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.156476E+08,58.20544\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.385384E+08,58.47914\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62323E+07,57.99763\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.437959E+08,63.723\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66189E+07,63.49135\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.9907E+07,63.38724\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68405E+07,62.88477\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06479E+08,58.58134\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.029682E+08,62.98782\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97185E+07,69.79902\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.184293E+08,69.51305\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.205206E+08,77.91232\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.096312E+08,79.57921\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.295212E+08,79.48911\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47033E+07,79.349\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51305E+07,78.73548\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.432158E+08,69.16753\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.106298E+08,61.1768\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.512651E+08,59.64093\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.42755E+08,60.62305\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60155E+08,54.92418\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.063892E+08,59.87648\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.754015E+08,54.27332\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.679477E+08,48.22081\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.574056E+08,44.10011\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.108855E+08,39.01583\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00017E+08,34.31171\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.883034E+08,39.70948\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02463E+08,39.72084\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59335E+08,36.0811\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.767924E+08,31.59502\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.631143E+08,32.47781\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.409942E+08,36.60075\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.35807E+08,36.69227\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.145742E+08,37.27009\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.057606E+08,33.12263\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.202715E+08,32.4813\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70449E+08,32.01042\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.217057E+08,31.45835\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.619672E+08,31.68086\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.344994E+08,35.72999\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.292817E+08,36.08919\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.601388E+08,36.28584\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.316825E+08,40.46209\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.548075E+08,40.52004\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.5214E+07,42.17056\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.218654E+08,46.92226\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.079307E+08,45.55614\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19159E+08,45.84617\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.194101E+08,50.26859\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35448E+08,55.35534\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.026369E+08,54.50488\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.93766E+07,53.4342\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.8577E+07,49.59201\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15262E+07,49.21187\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.044458E+08,54.80542\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.033631E+08,63.30572\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.92687E+07,71.45479\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.07614E+07,75.50727\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.126621E+08,69.86991\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.110332E+08,64.48673\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.074186E+08,59.1964\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96142E+07,61.28436\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50268E+07,60.49731\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.422641E+08,67.72305\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.099667E+08,71.82903\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94027E+07,71.45562\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34082E+07,70.72386\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72311E+07,65.79375\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.45586E+07,60.8057\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.019243E+08,60.14654\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.1473E+07,55.04145\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84364E+07,51.37648\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06301E+07,55.89898\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89056E+07,51.35537\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.525461E+08,44.62183\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30207E+08,38.68648\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.62961E+07,34.29734\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89174E+07,38.664\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.577231E+08,37.85946\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01273E+08,43.10586\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.0796E+07,48.06216\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.93984E+07,47.85197\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.542754E+08,42.15061\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.051208E+08,35.86005\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.18828E+08,36.00599\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.341863E+08,30.86735\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.428026E+08,33.64203\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.72904E+07,37.99549\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.2845E+07,41.34049\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.593838E+08,35.56702\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74072E+07,39.66832\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.04783E+08,43.7879\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43257E+07,44.13419\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.25578E+07,47.80261\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.22575E+07,52.95197\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.260507E+08,58.94402\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22325E+07,63.17657\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01318E+08,65.12389\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.464406E+08,71.95701\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.323176E+08,66.47289\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.045339E+08,62.09748\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.004224E+08,61.74982\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.145591E+08,62.70044\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.65796E+07,66.84094\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.76959E+07,62.17281\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.436097E+08,61.82071\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.269819E+08,61.61234\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.128038E+08,56.87357\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.763843E+08,51.49994\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66007E+07,57.05942\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.56532E+07,53.08485\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.765606E+08,47.1174\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.681005E+08,41.8874\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.939883E+08,44.41677\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.049564E+08,45.12992\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.112484E+08,44.80818\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.549017E+08,40.42077\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.608956E+08,39.45795\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.288904E+08,39.02971\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.380559E+08,44.40606\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.040586E+08,48.5159\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.266389E+08,52.96715\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.050438E+08,53.09525\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00377E+07,53.01721\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.34539E+07,56.75178\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.44979E+07,61.41454\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72006E+07,60.86818\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.355066E+08,60.1786\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.333523E+08,61.04641\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.427717E+08,56.04043\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,8.52578E+07,59.65234\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.54665E+07,61.69062\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71231E+07,67.37974\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.486322E+08,60.29254\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.365001E+08,60.90705\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62267E+07,60.19835\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.31935E+07,62.01115\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.97956E+07,61.01338\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.029658E+08,60.61356\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.027596E+08,60.01682\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.84595E+07,55.14167\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30458E+07,49.83633\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.246929E+08,49.29472\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18047E+07,49.87578\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12347E+07,49.63571\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.91878E+07,49.55722\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.66978E+07,49.5907\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82279E+07,54.44466\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.49817E+07,59.5352\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.92623E+07,60.82026\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.159394E+08,55.33886\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.229563E+08,54.21663\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.063336E+08,49.24068\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.274244E+08,56.32903\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,6.99874E+07,54.8438\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.7428E+07,50.99442\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.301888E+08,49.72167\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.153214E+08,44.23532\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.07741E+08,38.86535\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61005E+07,38.6463\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94322E+07,38.83589\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.344557E+08,47.52161\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.367177E+08,53.82156\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.966787E+08,56.07093\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54078E+07,56.17321\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.53633E+07,55.49477\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32152E+07,55.02517\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.17948E+07,55.12136\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68072E+07,52.4719\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61236E+07,56.89033\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.195111E+08,56.73563\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.1352E+07,57.81433\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.068894E+08,57.74166\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60412E+07,56.91596\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.64814E+07,57.48882\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05294E+07,61.48119\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.019865E+08,67.25005\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.495076E+08,66.06408\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.045963E+08,71.10318\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.83701E+07,71.17219\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21121E+07,71.67886\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.078325E+08,64.33562\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85046E+07,63.46417\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.07614E+07,60.6996\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.323437E+08,54.43674\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.085958E+08,47.73978\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.799497E+08,42.13926\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.088518E+08,43.34179\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.152445E+08,40.45827\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.161505E+08,41.15131\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.945738E+08,39.94411\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.543701E+08,37.38965\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.64781E+08,36.65431\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.636291E+08,32.45053\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32379E+08,33.23153\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.707013E+08,35.07013\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.19772E+07,34.78579\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.216364E+08,39.56746\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44147E+07,39.33035\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.005156E+08,39.35298\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64135E+07,42.53365\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00185E+07,45.93325\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.259955E+08,42.07691\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.048414E+08,42.98972\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.180692E+08,47.46284\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.13918E+08,53.31929\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.168151E+08,54.47627\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83294E+07,54.355\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37208E+07,60.58906\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.506819E+08,61.19984\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.674343E+08,61.69179\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.696383E+08,70.49429\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.82737E+07,76.24318\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.2328E+07,82.2298\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.174687E+08,82.176\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48343E+07,78.00924\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88274E+07,73.59505\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.047016E+08,68.63116\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54146E+08,62.6474\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.53743E+08,56.8993\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.82506E+07,56.95799\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.016263E+08,57.38522\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.761153E+08,56.12486\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.169442E+08,56.3831\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.630581E+08,50.51889\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.208898E+08,45.74822\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03492E+08,50.22603\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.196569E+08,45.81385\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.422045E+08,41.22301\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.015272E+08,40.04131\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96267E+07,45.32759\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.89589E+07,43.4134\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87143E+07,43.18647\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.7253E+07,39.65776\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.690036E+08,33.73545\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.40661E+08,32.8385\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.125858E+08,32.67442\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.000139E+08,36.87854\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.728738E+08,36.61703\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.670166E+08,36.45854\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32183E+08,37.26229\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.570263E+08,38.55978\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.041517E+08,43.92304\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.051923E+08,43.64061\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82128E+07,48.32144\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.56864E+07,52.76322\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36114E+07,48.91674\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81096E+07,53.51354\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.003077E+08,54.4917\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.349505E+08,55.17823\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.39714E+07,54.8694\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.014617E+08,55.12261\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.28565E+07,55.40281\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.79693E+07,59.23782\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58278E+07,61.77007\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.53562E+07,63.32686\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06377E+08,68.48733\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.34954E+07,68.40174\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.3648E+07,71.31944\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.68714E+07,78.54273\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64168E+07,77.84499\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22439E+07,72.82243\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.548973E+08,65.2471\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.73841E+07,65.11466\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.36763E+07,65.03962\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.115126E+08,59.56303\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.8998E+07,63.80086\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15195E+07,63.29509\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.1108E+07,67.99861\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.19611E+07,66.8965\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60485E+07,66.58233\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.4139E+07,65.87914\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.62562E+07,65.57848\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.45682E+07,64.91577\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.49852E+07,69.30721\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.54952E+07,74.01084\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20356E+07,73.83308\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.86503E+07,73.6402\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50257E+07,78.64233\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.69925E+07,74.45177\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.8703E+07,69.95766\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.061255E+08,68.35151\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.1991E+07,77.01488\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73494E+07,76.90976\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.47768E+07,77.26723\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.051448E+08,84.45644\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58331E+07,84.45888\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,9.99651E+07,78.3017\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04472E+07,73.86437\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60182E+07,68.14877\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.26941E+07,63.28098\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42166E+07,58.5121\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13261E+07,58.4146\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.03968E+07,58.59329\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03217E+07,59.27766\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23162E+07,59.22803\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.28948E+07,58.26123\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.16767E+07,53.87261\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.080553E+08,48.40276\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.29536E+07,52.40945\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89224E+07,51.44164\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42262E+07,56.7021\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.85636E+07,56.10423\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.112974E+08,49.89413\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,7.99786E+07,49.78904\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.444126E+08,42.27319\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.242563E+08,43.60199\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.74803E+07,44.44068\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76125E+07,48.60083\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55456E+07,53.5286\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64175E+07,57.91622\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.67825E+07,58.14509\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91065E+07,53.76062\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04086E+07,49.04614\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.041051E+08,43.05065\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.830735E+08,36.90149\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.890752E+08,31.48418\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11084E+07,35.72099\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.525572E+08,34.96539\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46282E+07,30.91432\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.355078E+08,30.39946\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.169994E+08,32.10745\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.44512E+07,32.58702\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36054E+07,33.21622\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.89616E+07,32.81134\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72282E+07,37.24453\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.39872E+08,37.71056\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.51886E+07,41.42271\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.89646E+07,41.15918\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27256E+07,41.37996\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77458E+07,41.7289\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.60677E+07,41.73237\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.3806E+07,45.14333\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.72561E+07,48.40938\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78206E+07,49.84922\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.82675E+07,53.30867\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.58862E+07,61.28842\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23226E+07,60.9077\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.73714E+07,68.37424\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50003E+07,68.6328\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.020151E+08,76.9045\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41025E+07,76.11657\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.84825E+07,70.22079\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.71543E+07,75.11995\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67374E+07,75.11304\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.174083E+08,68.27748\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.63573E+07,61.60985\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.160432E+08,62.70359\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.511539E+08,64.92908\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.494E+07,65.44699\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.214495E+08,59.15927\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.254334E+08,57.43407\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.110883E+08,52.22702\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.071375E+08,53.80126\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.500097E+08,50.9629\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.035058E+08,55.07687\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.50859E+07,50.94651\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.301387E+08,52.3011\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.776124E+08,46.78409\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.571704E+08,45.35957\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.214662E+08,45.7734\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.047379E+08,46.6988\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.476036E+08,45.5919\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.860549E+08,48.15692\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.099787E+08,42.99252\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.216482E+08,41.4543\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.300502E+08,39.37013\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15307E+08,34.17938\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.803363E+08,27.0546\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70175E+08,30.53638\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.142533E+08,35.87449\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.295995E+08,39.59326\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.544764E+08,43.57032\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.514775E+08,44.23207\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.546817E+08,48.62261\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.168401E+08,48.80503\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.2755E+07,51.36597\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.06688E+08,51.03762\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.423653E+08,55.73397\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.130267E+08,59.80069\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.468571E+08,60.14671\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35399E+07,60.04504\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.31773E+07,60.95289\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.14689E+07,59.86143\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.067421E+08,65.19911\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.94722E+07,70.91309\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59176E+07,77.04801\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.42991E+07,83.34916\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,8.99675E+07,92.33749\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.49915E+07,91.78011\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03352E+07,91.31773\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.03773E+07,91.14851\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.58919E+07,90.83614\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22299E+07,86.2442\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.25898E+07,85.6858\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.421739E+08,85.92967\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.56752E+07,85.83344\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90198E+07,85.65505\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.63859E+07,84.9968\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.78901E+07,81.1068\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.038069E+08,74.37847\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.44562E+07,74.11351\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.88735E+07,79.3952\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12253E+07,73.74133\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.09898E+07,73.52618\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.084651E+08,67.16055\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25039E+08,60.91409\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.592371E+08,54.36843\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.586288E+08,60.84666\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.021238E+08,53.06098\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.895569E+08,46.55045\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.589109E+08,39.46312\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.525237E+08,43.73338\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.569953E+08,50.73637\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.433649E+08,44.9754\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.481941E+08,45.09963\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.206218E+08,46.1792\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.29634E+07,45.48291\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72119E+07,45.50476\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.9532E+07,48.00513\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34483E+07,48.51608\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.302817E+08,44.93417\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.214085E+08,41.73176\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.694406E+08,40.68236\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.089239E+08,36.22689\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.250696E+08,40.03074\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.460561E+08,44.43929\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.576098E+08,44.45462\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.440602E+08,39.58979\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.143722E+08,39.42594\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.92575E+08,39.38992\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75449E+08,40.43274\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.117161E+08,39.63815\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.308767E+08,36.86975\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.227043E+08,42.9359\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.737079E+08,43.42694\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.173577E+08,43.33017\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17101E+07,41.04469\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.336462E+08,37.98241\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.676865E+08,34.19382\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.733125E+08,33.13136\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.975085E+08,32.47829\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.627071E+08,37.11425\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.238674E+08,41.5797\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.339685E+08,46.91055\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77312E+07,46.47027\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.255901E+08,46.11189\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.70842E+07,47.21567\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61426E+07,51.30608\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02272E+07,56.82332\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72269E+07,62.39185\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36175E+07,67.86269\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.6896E+07,66.1977\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,8.00594E+07,65.54828\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,9.13855E+07,61.26392\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,1.4003E+08,60.77691\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,7.42576E+07,60.08652\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,7.22159E+07,63.74605\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,7.29441E+07,68.68199\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,7.25793E+07,71.52849\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,1.079803E+08,73.51976\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,8.7369E+07,81.76569\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,1.102066E+08,75.56319"
  },
  {
    "path": "Tests/TestData/spy_midpoint.txt",
    "content": "Date,Open,High,Low,Close,Volume,MIDPOINT_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,150.455\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,150.555\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,151.47\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,152.95\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,153.055\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,153.445\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,154.18\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,155.16\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,155.265\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,155.405\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,156.085\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,156.205\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,155.85\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,155.67\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,155.67\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,155.095\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,155.025\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,155.025\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,155.275\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,155.275\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.81\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,155.81\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.435\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,156.025\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,156.025\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.99\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.99\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.955\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,156.915\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,157.175\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,157.7\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,157.155\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,157.155\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,157.15\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.47\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,155.775\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,155.775\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,155.96\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,156.01\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,157\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,157.345\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,158.54\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,158.78\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.96\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,158.995\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,159.825\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,160.03\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,160.44\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,161.545\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,162.355\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,162.595\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,163.07\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,164.055\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,164.5\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,164.765\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,165.24\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,166.085\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,166.255\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,166.255\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,166.31\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,166.24\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,166.24\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,165.76\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.76\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,164.875\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,164.875\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,164.64\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,163.55\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,162.81\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,163.035\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,163.035\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,163.035\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,163.275\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,163.275\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,163.275\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,163.095\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,163.745\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,164.46\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,162.57\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,162.405\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,161.4\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,160.255\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,158.6\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,159.07\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,159.07\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,159.965\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,160.75\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,160.89\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,161.72\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,162.58\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,163.17\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,163.235\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,165.23\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,165.73\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,166.64\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,166.67\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.795\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,168.19\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,168.345\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,168.51\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,168.725\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,169.01\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,169.01\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,169.01\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,168.83\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,168.815\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,168.85\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,169.625\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,169.77\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,169.77\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,169.83\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,170.065\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,170.065\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.94\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.455\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.455\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.27\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,167.995\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,167.72\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,167.19\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,166.755\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,165.47\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,165.31\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,165.59\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,165.59\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,164.975\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,164.975\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,164.975\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,164.665\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,163.86\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,164.7\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,164.805\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,164.845\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,166.01\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,167.31\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,167.68\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,167.72\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,168.515\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,169.59\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,170.01\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,171\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,171.19\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,171.68\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,171.49\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,171.29\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,170.9\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,169.88\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,169.42\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,168.85\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,168.85\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,168.85\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,168.48\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,168.48\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,168.385\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,167.33\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,167.185\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,167.325\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,167.87\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,168.21\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,168.27\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,170.62\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,171.46\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,172.045\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,172.05\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,173.74\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,174.315\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,174.9\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,175.175\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,175.4\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,175.87\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,176.16\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,176.48\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,176.48\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,176.48\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,176.31\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,176.48\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,176.05\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,176.11\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,176.125\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,176.125\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,176.655\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,178.115\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,178.505\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,178.505\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,179.215\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,179.26\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,179.26\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,179.64\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,179.64\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,179.64\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,180.515\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,180.875\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,180.825\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,180.435\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,180.425\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,179.97\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.94\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,180.17\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,180.17\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,180.06\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.765\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.755\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.43\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,178.665\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.905\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,179.905\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,180.175\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,180.59\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,182.21\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,182.67\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,182.705\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.19\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,183.81\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,183.805\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,183.785\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,183.525\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,183.525\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,182.94\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,183.25\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,182.91\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,182.91\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,183.17\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,183.17\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.17\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,184.145\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,184.145\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.605\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,181.595\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,181.155\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,181.155\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,180.07\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,178.29\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,178.29\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,176.7\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,176.7\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,176.7\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,176.175\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,176.925\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,177.59\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,178.575\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,179.775\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,181.345\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,182.015\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,183.11\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,183.155\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,183.625\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,183.63\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,183.965\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,183.965\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,184.4\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,184.855\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,185.565\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,185.565\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,186.215\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,186.365\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,186.58\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,186.62\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,187.92\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,187.745\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,187.745\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,186.72\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,186.41\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,185.97\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,186.16\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,186.16\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,186.205\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,186.975\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,186.59\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,186.59\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,186.36\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,185.445\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,185.445\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,185.795\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,186.415\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.73\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,187.185\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,187.64\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,186.61\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.61\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,186.485\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,185.12\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,184.3\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,184.3\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,184.3\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,183.815\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,183.95\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,184.99\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,186.045\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,187.005\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,187.14\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.09\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,187.09\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,187.06\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,187.3\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,187.305\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,187.6\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,188.085\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,187.6\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,187.6\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,187.6\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,187.6\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,188.285\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,188.82\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,188.82\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,188.68\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,188.68\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,188.68\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,188.23\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,188.265\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.57\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.95\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,189.535\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,190.325\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,190.98\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,191.515\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,192.14\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.14\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.78\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,193.565\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,194.09\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,194.19\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,194.395\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,195.025\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,194.57\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,194.57\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,194.57\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.23\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,194.9\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,195.305\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,195.385\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,195.655\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,195.59\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,195.59\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.32\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.29\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.26\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,196.235\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,196.335\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,196.96\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,196.96\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,197.22\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,197.22\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,197.22\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,196.875\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,196.92\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,196.97\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,197.15\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,196.835\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,196.835\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,196.835\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,196.955\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,197.175\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,197.995\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,197.995\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,198.185\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,197.8\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.8\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,195.445\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,195.15\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,194.74\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,194.495\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,192.95\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,192.46\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,192.46\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,192.41\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,192.41\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,192.935\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,194.5\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.645\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,195.445\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,196.615\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,197.32\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,197.61\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,198.43\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,199.295\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,199.625\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,199.76\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,199.76\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,200.425\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.425\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.425\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.425\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.66\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.66\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,200.215\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,200.215\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,200.215\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.86\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.64\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.73\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,199.865\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.4\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.4\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.485\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,199.915\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,199.915\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,198.52\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,197.95\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,197.95\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,197.95\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,196.125\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,196.125\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,195.945\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,195.685\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,194.89\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,194.95\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,194.69\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,193.59\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,192.025\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,192.025\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,189.585\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,188.405\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,187.37\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,188.285\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,190.17\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,190.17\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,191.7\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,193.365\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,194.56\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,195.55\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,196.67\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,197.77\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,198.91\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,199.94\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,199.94\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,200.86\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,202.11\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,202.205\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,202.525\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,203.26\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,203.665\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,203.765\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,204.1\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,204.165\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,204.755\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,204.87\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,204.91\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,205.525\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,206.24\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,206.24\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,206.61\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,207.16\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,206.7\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,206.7\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,206.825\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,206.825\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,206.88\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,207.305\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,207.235\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,205.58\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.58\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,203.75\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,202.99\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,201.05\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,201.05\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,202.345\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,202.345\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,202.69\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,204.77\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,207.145\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,207.48\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,208.095\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,208.16\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,207.13\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,207.075\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,205.22\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,203.71\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,202.68\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,202.86\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,202.86\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,202.86\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,203.99\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,203.38\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,201.635\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,200.835\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,200.55\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,201.05\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,202.56\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,203.865\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,204.075\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,204.42\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,203.12\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,202.795\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,202.45\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,201.095\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,202.145\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,202.145\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,202.785\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,204.02\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,205.09\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,205.435\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,205.78\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,206.775\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,207.205\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,208.46\n"
  },
  {
    "path": "Tests/TestData/spy_midprice.txt",
    "content": "Date,Open,High,Low,Close,Volume,MIDPRICE_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,150.8\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,150.8\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,150.825\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,152.23\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,152.665\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,152.695\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,153.585\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,154.84\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,155.13\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,155.32\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,155.73\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,155.965\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,155.5\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,155.195\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,155.195\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,154.815\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,154.77\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,154.93\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,155.185\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,155.185\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.6\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,155.63\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.105\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,156.015\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,156.015\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.49\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.49\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.545\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,156.32\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,156.74\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,157.23\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,157.405\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,157.405\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,156.995\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.295\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,155.84\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,155.52\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,155.74\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,155.925\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,156.695\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,157.01\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,157.91\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,158.63\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.725\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,158.81\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,159.99\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,160.055\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,160.375\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,160.96\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,162.37\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,162.56\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,162.74\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,163.84\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,164.46\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,164.48\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,164.93\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,165.625\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,166.355\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,167.08\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,166.505\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,166.505\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,166.505\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,166.505\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.86\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,165.455\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,165.22\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,164.625\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,163.86\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,163.28\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,162.675\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,162.825\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,162.825\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,162.825\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,163.35\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,163.35\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,163.26\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,163.645\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,163.645\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,162.485\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,161.73\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,160.86\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,160.81\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,158.915\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,158.775\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,158.775\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,159.95\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,160.865\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,161.17\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,161.47\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,162.305\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,162.775\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,162.985\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,164.455\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,165.505\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,166.33\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,166.51\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.505\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,168.17\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,168.17\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,168.405\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,168.78\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,169.02\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,168.9\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,168.69\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,168.69\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,168.69\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,168.685\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,169.165\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,169.54\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,169.58\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,169.73\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,169.76\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,169.76\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.755\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.45\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.28\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.28\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,168.095\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,167.7\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,167.33\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,167.28\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,165.81\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,165.41\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,165.51\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,165.745\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,165.255\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,165.175\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,165.175\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,165.175\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,164.315\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,164.54\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,164.785\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,165.075\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,165.715\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,166.52\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,166.94\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,167.02\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,168.005\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,169.75\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,169.795\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,171.12\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,171.17\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,171.82\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,171.495\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,171.405\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,171.245\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,170.61\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,169.56\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,168.84\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,168.66\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,168.66\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,168.17\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,168.17\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,168.17\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,167.35\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,166.795\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,166.895\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,167.425\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,167.805\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,167.84\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,169.695\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,171.045\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,171.795\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,172.11\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,173.28\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,173.635\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,174.72\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,174.98\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,175.215\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,175.6\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,176.01\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,176.34\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,176.365\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,176.365\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,176.365\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,176.36\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,176.2\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,176.2\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,176.2\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,176.2\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,176.585\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,177.135\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,178.105\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,178.295\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,178.295\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,179.24\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,179.24\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,179.405\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,179.575\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,179.6\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,180.05\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,180.76\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,181\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,180.46\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,180.05\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,180.05\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.89\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,180.01\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,180.01\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,180.085\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.715\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.715\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.56\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,179.305\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.525\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,179.525\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,179.655\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,179.98\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,180.165\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,182.265\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,182.375\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.125\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,183.61\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,183.585\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,183.585\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,183.385\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,183.385\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,183.075\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183.105\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,183.15\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,182.78\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,182.78\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,183.14\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,183.14\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.14\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,183.445\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,183.995\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.295\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,181.8\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,180.945\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,180.845\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,180.14\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,179.27\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,178.345\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,176.82\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,176.82\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,176.76\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,176.5\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,176.79\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,176.89\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,178.075\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,179.025\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,180.465\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,181.785\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,182.265\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,182.89\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,182.89\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,183.775\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,184.375\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,184.375\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,184.375\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,184.975\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,185.675\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,185.45\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,185.865\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,185.91\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,186.18\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,186.355\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,187.855\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,187.88\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,187.43\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,186.81\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,186.575\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,186.575\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,186.215\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,186.215\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,186.19\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,187.245\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,186.82\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,186.82\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,186.82\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,186.46\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,185.62\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,185.62\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,186.13\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.515\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,187.11\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,187.9\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,186.83\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.645\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,186.645\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,186.315\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,184.24\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,184.24\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,184.24\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,184.24\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,184.11\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,184.27\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,184.955\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,186.525\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,186.98\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.135\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,186.68\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,186.675\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,186.73\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,186.9\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,187.05\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,187.88\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,187.88\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,187.575\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,187.575\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,187.53\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,187.945\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,188.215\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,188.625\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,188.45\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,188.45\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,188.45\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,188.18\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,187.85\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.35\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.775\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,189.325\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,189.94\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,190.63\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,191.195\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,191.97\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.025\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.315\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,193.31\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,193.7\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,194.15\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,194.155\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,194.375\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,194.58\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,194.58\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,194.375\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.115\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,194.74\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,194.95\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,195.13\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,195.205\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,195.5\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,195.425\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.315\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.315\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.315\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.88\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,195.88\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,196.585\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,196.91\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,197.025\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,197.025\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,196.675\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,196.52\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,196.46\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,196.58\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,196.66\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,196.845\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,196.845\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,196.845\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,196.995\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,197.14\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,197.65\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,197.745\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,197.84\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,197.84\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.61\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,195.71\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,195.01\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,195.01\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,194.61\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,193.43\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,192.425\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,192.425\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,192.605\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,192.605\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,192.805\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,193.355\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.795\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,195.195\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,196.25\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,196.735\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,197.035\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,198.225\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,199.015\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,199.45\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,199.78\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,199.78\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,199.985\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.19\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.4\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.485\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.495\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.495\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,200.245\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,200.175\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,199.99\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.885\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.465\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.61\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,200.03\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.115\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.14\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.2\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,199.925\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,199.71\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,199.085\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,198.325\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,197.87\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,197.87\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,196.48\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,195.37\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,195.325\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,195.325\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,194.975\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,194.975\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,194.98\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,194.045\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,192.11\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,191.98\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,189.26\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,187.785\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,186.535\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,186.185\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,188.06\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,188.9\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,191.91\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,192.28\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,193.985\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,195.515\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,196.69\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,197.05\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,198.425\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,199.59\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,199.625\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,199.995\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,201.66\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,201.83\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,202.05\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,202.88\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,202.975\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,203.72\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,203.98\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,204.02\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,204.565\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,204.565\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,204.785\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,205.745\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,206.01\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,206.01\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,206.01\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,206.925\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,206.625\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,206.625\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,206.765\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,206.82\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,206.925\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,207.125\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,206.19\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,205.7\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.7\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,204.485\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,202.69\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,202.025\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,202.025\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,205.415\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,205.415\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,205.415\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,205.63\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,208.445\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,207.23\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.715\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,208.185\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,207.18\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,206.575\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,205.16\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,203.61\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,203.52\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,202.865\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,202.635\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,202.635\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,203.465\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,202.495\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,202.495\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,202.015\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,202.015\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,201.105\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,202.405\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,202.405\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,203.215\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,203.6\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,203.085\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,202.39\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,202.12\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,201.075\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,201.355\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,201.62\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,202.08\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,202.55\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,204.895\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,205.375\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,205.79\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,206.56\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,206.985\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,207.5\n"
  },
  {
    "path": "Tests/TestData/spy_min.txt",
    "content": "Date,Open,High,Low,Close,Volume,MIN_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,149\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,149\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,150.02\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,151.61\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,151.61\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,152.11\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,152.92\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,154.29\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,154.5\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,154.78\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,155.44\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,155.68\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,154.97\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,154.61\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,154.61\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,154.36\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,154.36\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,154.36\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,154.36\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,154.36\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,154.95\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,154.95\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.05\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,155.23\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,155.23\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.16\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.16\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.16\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,155.16\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,155.16\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,156.21\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,155.12\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,155.12\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,155.11\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,154.14\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,154.14\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,154.14\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,154.14\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,154.14\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,155.48\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,156.17\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,157.78\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,157.88\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.24\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,158.24\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,158.28\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,158.28\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,158.28\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,159.75\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,161.37\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,161.78\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,162.6\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,162.88\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,162.88\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,163.41\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,163.54\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,165.23\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,165.34\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,165.34\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,165.45\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,165.31\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,165.31\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,165.22\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.22\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,163.45\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,163.45\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,163.45\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,161.27\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,161.27\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,161.27\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,161.27\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,161.27\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,161.75\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,161.75\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,161.75\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,161.75\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,161.75\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,163.18\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,159.4\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,159.07\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,157.06\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,157.06\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,157.06\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,157.06\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,157.06\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,158.57\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,160.14\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,160.42\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,160.42\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,161.21\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,161.21\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,161.28\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,163.02\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,163.95\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,165.13\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,165.19\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.44\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,167.51\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,167.52\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,167.52\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,167.95\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,168.52\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,168.52\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,168.52\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,168.52\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,168.52\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,168.59\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,168.59\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,168.59\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,168.59\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,168.71\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,169.18\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,169.18\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.18\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.11\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.11\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,168.74\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,166.38\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,165.83\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,164.77\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,164.77\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,164.56\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,164.56\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,164.56\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,164.56\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,163.33\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,163.33\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,163.33\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,163.33\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,163.33\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,163.65\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,163.65\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,163.65\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,164.39\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,165.75\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,165.96\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,166.04\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,167.63\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,168.87\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,168.95\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,168.95\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,169.33\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,170.31\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,169.93\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,169.53\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,169.04\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,169.04\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,168.91\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,168.01\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,168.01\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,168.01\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,167.62\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,167.62\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,167.43\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,165.48\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,165.48\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,165.48\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,165.48\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,165.48\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,165.6\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,169.17\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,169.7\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,169.7\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,169.7\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,172.07\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,173.22\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,174.39\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,174.4\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,174.57\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,174.57\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,175.15\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,175.79\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,175.79\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,175.79\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,175.79\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,175.79\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,174.93\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,174.93\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,174.93\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,174.93\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,174.93\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,176.96\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,176.96\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,176.96\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,178.38\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,178.47\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,178.47\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,178.47\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,178.47\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,178.47\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,179.91\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,180.63\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,180.53\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,179.75\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,179.73\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,178.94\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,178.94\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,178.94\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,178.94\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,178.72\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,178.13\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,178.11\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,178.11\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,178.11\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,178.11\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,178.11\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,178.65\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,178.65\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,181.49\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,181.49\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,181.56\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,182.53\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,182.93\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,182.92\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,182.88\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,182.36\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,182.36\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,182.36\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,182.36\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,182.36\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,181.68\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,181.68\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,181.68\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,181.68\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,181.68\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,183.63\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,183.63\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,182.79\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,178.89\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,178.01\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,178.01\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,177.35\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,177.35\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,177.35\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,174.17\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,174.17\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,174.17\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,174.17\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,174.17\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,175.17\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,175.17\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,177.48\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,179.68\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,180.01\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,181.98\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,182.07\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,183.01\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,183.02\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,183.02\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,183.02\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,183.89\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,183.89\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,184.84\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,184.84\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,184.85\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,184.98\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,184.98\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,184.98\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,187.58\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,187.23\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,187.23\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,185.18\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,184.66\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,184.66\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,184.66\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,184.66\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,184.66\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,186.2\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,185.43\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,185.43\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,184.97\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,184.58\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,184.58\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,184.58\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,184.58\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,184.58\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,185.49\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,186.4\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,184.34\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,184.34\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,184.34\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,183.15\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,181.51\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,181.51\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,181.51\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,181.51\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,181.51\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,182.94\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,184.2\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,186.12\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,186.39\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,186.29\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,186.29\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,186.29\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,186.29\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,186.29\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,186.88\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,187.75\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,186.78\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,186.78\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,186.78\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,186.78\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,186.78\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,187.68\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,187.68\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,187.4\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,187.4\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,187.4\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,187.4\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,187.4\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,187.55\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,187.55\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,187.55\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,189.13\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,189.59\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,190.35\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,191.38\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,191.38\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.37\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,192.68\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,192.8\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,192.8\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,193.19\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,194.45\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,193.54\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,193.54\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,193.54\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,193.54\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,193.54\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,194.13\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,194.29\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,194.83\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,194.7\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,194.7\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,194.7\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,194.7\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,194.7\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.44\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,195.44\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,195.72\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,195.72\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,196.24\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,196.24\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,196.24\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,196.24\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,196.24\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,196.34\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,196.34\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,195.71\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,195.71\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,195.71\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,195.71\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,195.71\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,197.34\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,197.34\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,197.72\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,196.95\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,196.95\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,193.09\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,192.5\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,192.5\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,192.01\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,192.01\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,191.03\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,191.03\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,191.03\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,191.03\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,191.03\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,193.24\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,193.53\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,193.53\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,194.84\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,195.72\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,195.72\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,197.36\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,198.39\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,198.92\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,199.19\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,199.19\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,200.14\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.14\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.14\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.14\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.21\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.21\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,199.32\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,199.32\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,199.32\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.13\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,198.98\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,198.98\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,198.98\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,198.98\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,198.98\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,199.15\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,198.01\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,198.01\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,196.34\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,196.34\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,196.34\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,196.34\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,194.35\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,194.35\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,194.35\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,194.35\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,193.26\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,193.26\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,192.74\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,190.54\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,187.41\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,187.41\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,186.43\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,186.27\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,186.27\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,186.27\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,186.27\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,186.27\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,188.47\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,190.3\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,192.69\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,192.69\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,194.93\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,196.16\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,196.16\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,198.11\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,198.11\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,199.38\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,201.07\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,201.07\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,201.07\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,202.34\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,203.15\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,203.34\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,203.96\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,203.96\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,203.96\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,204.19\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,204.24\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,204.37\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,205.22\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,205.22\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,205.58\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,206.68\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,205.76\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,205.76\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,205.76\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,205.76\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,205.76\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,206.61\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,206.47\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,203.16\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,203.16\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,200.89\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,199.51\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,197.91\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,197.91\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,197.91\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,197.91\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,197.91\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,201.79\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,206.52\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,206.52\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.47\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,207.6\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,205.54\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,205.43\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,201.72\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,199.82\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,199.82\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,199.82\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,199.82\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,199.82\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,202.08\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,200.86\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,199.02\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,199.02\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,199.02\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,199.02\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,199.02\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,201.63\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,202.05\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,202.74\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,200.14\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,200.14\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,199.45\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,199.45\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,199.45\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,199.45\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,199.45\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,201.92\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,204.06\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,204.06\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,204.63\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,204.63\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,204.63\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,206.81\n"
  },
  {
    "path": "Tests/TestData/spy_natr.txt",
    "content": "Date,Open,High,Low,Close,Volume,NATR_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,1.48445204128592\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,1.36437352864243\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,1.31254131829672\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,1.14698770226537\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.977953740793383\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,0.906421410190428\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,0.839039384733705\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0.787077673175743\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.742949337575369\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.70605909131883\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0.750359450079702\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.813982128700629\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.901068807889456\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.887991513329248\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0.922526036331851\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0.891522462561358\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.964031727264525\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.929005524756454\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,0.901985391698371\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.859800080829098\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.849496334064697\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.824200499583196\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.950852914228626\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.896193496089871\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.989588648108107\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.974557708932611\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.947933191514453\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,1.01639139229793\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.957451207819149\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0.927791726814764\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,1.23689183196588\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,1.27624248001803\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,1.43971802606995\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,1.40036155714914\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,1.29458055270887\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,1.26032597469514\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,1.22106785381235\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,1.07251120331651\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1.029917076859\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.935351137632399\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.920326247427248\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.873536929935672\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0.904656947041337\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.918630868620732\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.991516545886655\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.870322784075802\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.813288167319969\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0.777473520294974\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,0.774766821242538\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,0.745090360903177\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,0.716669760915682\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0.786560177692432\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0.811285038093525\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,0.805712691559679\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0.842058399053442\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.789903452407507\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0.786545831478785\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,1.10401671378682\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1.12633178999648\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1.07967621876435\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,1.15565255910491\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,1.1678248182019\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,1.09605266339417\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,1.27871967290623\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,1.23641852405975\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,1.28371427942881\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,1.34291217234886\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,1.37071933157845\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,1.35221920790175\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,1.2067753663214\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,1.22808868360401\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,1.33564767503339\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,1.44225570397248\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,1.37680014290634\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,1.34111528737269\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1.25151682324395\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1.32236842231607\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,1.64562669323745\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,1.60715606916225\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,1.72749428713429\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,1.63496375222204\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,1.53618684745772\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,1.43036981252485\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,1.34099972273534\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,1.32187989846903\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,1.28179909641815\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1.21720650959112\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1.18420348848905\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,1.10911303540584\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,1.04809099330122\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.973769674793054\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1.05760636683739\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0.941248212349124\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0.854801013621655\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,0.840424023115959\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,0.784937575956582\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0.780862276932118\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.732348348787735\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.670873723489896\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.630072584280654\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.705295404249846\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.697834044985186\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.751629614898455\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.721789354886899\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0.706739272034556\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,0.726212667286138\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.820435200271155\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.762868540641241\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.68265906044579\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.708324523033506\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.707998209218472\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0.711562483088721\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.733912041242525\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.697811591048534\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.732300775483605\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.719239229725138\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0.902100866084\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0.860358401249742\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0.868717527118991\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.864300456303397\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0.919352793168286\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.938401520625188\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0.875433712711649\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,0.872842241985618\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,1.05132829079587\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,1.01379268982095\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,1.00954259505903\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0.976408715335614\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1.01241820677498\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1.03134324711548\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.904772924605407\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1.02460185289093\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1.01354121173542\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0.955290641668544\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,0.885808409249432\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,0.809971918446186\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0.731564427432744\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,0.80618075038312\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.735608317520311\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0.921539508249405\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,0.855394359354292\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,0.947881581640332\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0.918365649938859\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.892150651302354\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,0.844752957478884\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0.806397736730416\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.79255287168686\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.846950088954835\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,0.849396879392001\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0.858668247103635\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.972530695835786\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.953357073768699\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.965239090670944\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,1.05443548924842\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,1.04462794570449\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1.25076733609346\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,1.17628243978353\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,1.17128278084729\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,1.14186955124589\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,1.18684378611694\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1.17178252061952\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1.07908099419331\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,0.948077681547574\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,0.928543401912762\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,0.912531583339714\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0.825809367986819\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,0.754262055369781\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.689836729920278\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.662956152458547\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0.74289382962655\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.750735551395935\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.756923228329342\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.707187432285987\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.710509802694192\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.704370098418039\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.899986281766301\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.987916296550869\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.860129394159727\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.801393056837265\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.896129679730563\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.843873987930329\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.766592790075068\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,0.780403664487864\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,0.75415304913104\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,0.823739655453266\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,0.829360530526351\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.777435996004627\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.711147439240863\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.659528722382452\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.591491384982604\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0.578479202864305\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.594714388604395\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.629157334407797\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.74040407660291\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.703354530849854\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.796322580967274\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0.715927708049474\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.660002373400498\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.796980434163562\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0.76320145149593\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.710567961619087\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.754644613967081\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0.735504764467642\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,1.06394243774197\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.961235730619714\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.925114222296419\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0.854495099765024\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.734580399322625\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0.696771465643025\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0.613985026743412\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0.539141103979007\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0.523493065064362\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.664482546191722\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.637782796803979\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.673997446279936\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.691781880547672\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.655746030701341\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,0.670191729707297\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0.666119297245349\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.852748601474059\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.902389572236324\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.855591433911604\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.775375834231065\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.746042852905922\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.781825818564944\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.696675764572073\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.833294352691651\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,1.12389904289119\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,1.17321184105525\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,1.07709137131287\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,1.11699916260951\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,1.15873370078133\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,1.19847274078365\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,1.50218234117393\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,1.39074055587759\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,1.32514964292886\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,1.30663269304417\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,1.29853593215262\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,1.13247457936418\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,1.1632344171067\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,1.05315713395981\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,1.09720045628135\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,1.05661843497033\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0.935470796366652\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,0.980662832576075\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0.988510208009011\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,0.910260391731832\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.968634615480254\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.922355450112331\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.875253151847499\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.857993951647875\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.910118357808613\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,1.00787522489422\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,1.11498777737897\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.957227833952582\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0.855434268570932\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,0.846597771846077\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0.803063335577134\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0.849668951438096\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.834402040913091\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,1.03474161020501\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0.977422078967891\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,1.00140937520404\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0.963839321674383\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,1.03985465383227\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,1.03690767375481\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,1.15759147474744\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,1.19416936891753\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,1.13009425614676\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,1.17228895869688\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,1.09584262082636\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,1.07076664381747\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,1.04322337740956\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0.972507639030494\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.88023957241631\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,0.829177333141037\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,1.05754386416478\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,1.12021775536645\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,1.08806457492924\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,1.08461490328463\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,1.34936654001865\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,1.32174087071529\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,1.26012544197456\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,1.30739347819686\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,1.24359285916124\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,1.13829069347965\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,1.00263474062306\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.943244672462131\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.822517968562963\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,0.81214286623916\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.865509880576313\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.982387995088018\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.905837202757065\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.862709085306734\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.808015071597754\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.791940437236153\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.837203348377587\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.855534232364512\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.889064014992734\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.921940951137404\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.865204842347169\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,0.887818756172922\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.778054839899172\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.749177181369923\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.879997600468721\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.851524808626805\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.823902682048405\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.841390102734487\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.844086982574326\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.791780878798593\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.724407614652692\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.704431869044029\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0.643380882262774\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0.623299821167332\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.57776286733635\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,0.567437425726773\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.52161277768753\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0.524113850771391\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0.617139850164157\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.591679164149538\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.562848042096481\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.523852024839386\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0.535462573603874\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.618465908223071\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.598353234955927\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.585344849460061\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,0.586056154808172\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0.666182902848369\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.613782803391777\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.571995693418052\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0.511851485269892\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.619461608360213\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.64979721913379\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.673709947270515\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.640056672840565\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.576684642042262\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.652159440249755\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.573928812097181\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.563858646256012\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.55189826819074\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0.622729013250522\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.602493269319327\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.693749509007745\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.652909937840722\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0.646229242424552\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0.694396991545266\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,0.657530485522218\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.804924571719291\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.859973852333952\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.81899434618403\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.775460521800026\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.69450775441307\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.616992782629197\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.62943805894918\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.651981771548764\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.679205867123008\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.720964952908423\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,1.003741991502\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,1.03298718395479\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,1.05255570854112\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,1.11902516047721\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,1.08341342661833\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,1.14156401340348\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,1.15327250457655\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,1.06654988919706\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,0.979431418498418\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.935328936243067\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.83873923145729\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0.910245624157282\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.897459560438034\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.833197717014164\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,0.773368570594971\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.701106670928327\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,0.657144558864204\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0.666919579141502\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0.595087304923391\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0.539181382453145\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.519520622908935\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.505114274202558\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.51694924869227\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.532489531292394\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.618407276456222\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.669529395134206\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0.657656141005795\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0.698050352495896\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.699296831147024\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0.679613847259452\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.72164577353917\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.672233683324373\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.76720294616075\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0.805215827233105\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0.749765443730238\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.763598054224761\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.813473781503026\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.786842295182375\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.842063110318949\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,1.01983137127534\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,1.01660916194522\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,1.00207331436249\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0.975330677166449\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,1.11102505794838\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,1.16648922733725\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,1.18356269493106\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,1.15377753653411\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,1.25520021792934\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,1.45069159526861\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,1.60532943984069\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,1.63078071264782\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,1.73727744298774\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,1.68389202169561\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,1.97636231281346\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,2.08601804253101\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,2.01862399652889\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,1.84950105990878\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,1.8527749851111\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,1.7315607093695\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,1.72945953147657\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,1.57663715917417\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,1.40782560023076\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,1.34129961087149\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,1.30887791951143\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,1.26211978988629\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,1.24027152120412\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,1.10566746281815\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,1.05770338279333\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,0.99109387833648\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,0.949201812818522\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.856025762856624\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.77189637658306\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.681561065316534\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.637031332874408\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.667726766846816\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.609452128955941\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.578262965476191\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.610769553896838\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.611221837261456\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.636968364404304\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.725558182133681\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.647335192833692\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.613844592986183\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.560136211340274\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0.541724644489169\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.613317831796872\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.640093783651648\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.612081472534205\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.64045311499619\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.599986514846571\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.695212022992446\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.818085943993683\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,1.01362553595738\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,1.10359239486792\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,1.22989708241557\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,1.36664437827263\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,1.56094879453962\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,1.6638183296589\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,2.38027623848291\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,2.07318814872553\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,1.74831953140135\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,1.47667428420635\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,1.24090708973911\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,1.09316164281365\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.952888512181205\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0.882993796772491\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.985927847465095\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,1.0520278820736\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,1.26162239862931\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,1.40624350015616\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,1.39783728417262\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,1.47274001344716\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,1.47265476139543\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,1.45192098698255\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,1.65669749806814\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,1.68290522915309\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,1.67331260909532\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,1.64567842270357\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,1.56621881858835\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,1.51449482881929\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,1.57521051853128\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,1.3929878045345\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,1.27825051465734\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,1.40225537431725\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,1.57407116853834\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,1.60615715103228\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,1.60612758260019\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,1.68221928030748\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,1.61266829556605\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,1.47834548138292\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,1.3882056236406\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,1.33937997818458\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1.22390482144687\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,1.20960357279695\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,1.12369637999376\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,1.08759905001765\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0.969477332556729\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0.890493378987199\n"
  },
  {
    "path": "Tests/TestData/spy_ohlcv.txt",
    "content": "Date,Open,High,Low,Close,Volume \n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,1.062926E+08\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,2.454832E+08\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,1.863316E+08\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,1.439326E+08\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,1.237242E+08\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,1.706127E+08\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,9.73288E+07\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,1.212382E+08\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,9.42843E+07\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,8.6002E+07\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,1.228057E+08\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,8.32355E+07\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,1.041083E+08\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,9.10515E+07\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,1.236142E+08\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,1.331532E+08\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,1.265183E+08\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,1.670499E+08\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,1.136078E+08\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,1.284929E+08\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,1.111032E+08\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,1.512318E+08\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,8.6114E+07\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,9.97837E+07\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,1.026877E+08\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,9.91285E+07\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,1.01291E+08\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.537818E+08\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,1.2937E+08\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,1.55171E+08\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,8.60397E+07\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,1.005915E+08\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,1.348373E+08\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,1.096351E+08\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,1.160249E+08\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,2.155057E+08\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,1.471524E+08\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,2.262315E+08\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,1.668889E+08\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,1.492193E+08\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,1.062165E+08\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,1.65592E+08\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,9.49964E+07\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,1.307744E+08\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,9.5639E+07\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,8.82234E+07\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.156476E+08\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.385384E+08\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62323E+07\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.437959E+08\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66189E+07\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.9907E+07\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68405E+07\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06479E+08\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.029682E+08\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97185E+07\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.184293E+08\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.205206E+08\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.096312E+08\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.295212E+08\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47033E+07\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51305E+07\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.432158E+08\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.106298E+08\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.512651E+08\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.42755E+08\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60155E+08\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.063892E+08\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.754015E+08\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.679477E+08\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.574056E+08\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.108855E+08\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00017E+08\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.883034E+08\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02463E+08\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59335E+08\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.767924E+08\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.631143E+08\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.409942E+08\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.35807E+08\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.145742E+08\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.057606E+08\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.202715E+08\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70449E+08\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.217057E+08\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.619672E+08\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.344994E+08\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.292817E+08\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.601388E+08\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.316825E+08\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.548075E+08\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.5214E+07\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.218654E+08\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.079307E+08\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19159E+08\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.194101E+08\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35448E+08\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.026369E+08\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.93766E+07\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.8577E+07\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15262E+07\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.044458E+08\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.033631E+08\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.92687E+07\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.07614E+07\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.126621E+08\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.110332E+08\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.074186E+08\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96142E+07\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50268E+07\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.422641E+08\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.099667E+08\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94027E+07\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34082E+07\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72311E+07\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.45586E+07\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.019243E+08\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.1473E+07\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84364E+07\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06301E+07\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89056E+07\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.525461E+08\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30207E+08\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.62961E+07\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89174E+07\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.577231E+08\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01273E+08\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.0796E+07\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.93984E+07\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.542754E+08\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.051208E+08\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.18828E+08\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.341863E+08\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.428026E+08\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.72904E+07\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.2845E+07\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.593838E+08\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74072E+07\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.04783E+08\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43257E+07\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.25578E+07\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.22575E+07\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.260507E+08\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22325E+07\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01318E+08\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.464406E+08\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.323176E+08\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.045339E+08\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.004224E+08\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.145591E+08\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.65796E+07\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.76959E+07\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.436097E+08\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.269819E+08\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.128038E+08\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.763843E+08\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66007E+07\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.56532E+07\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.765606E+08\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.681005E+08\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.939883E+08\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.049564E+08\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.112484E+08\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.549017E+08\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.608956E+08\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.288904E+08\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.380559E+08\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.040586E+08\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.266389E+08\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.050438E+08\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00377E+07\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.34539E+07\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.44979E+07\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72006E+07\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.355066E+08\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.333523E+08\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.427717E+08\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,8.52578E+07\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.54665E+07\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71231E+07\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.486322E+08\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.365001E+08\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62267E+07\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.31935E+07\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.97956E+07\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.029658E+08\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.027596E+08\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.84595E+07\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30458E+07\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.246929E+08\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18047E+07\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12347E+07\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.91878E+07\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.66978E+07\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82279E+07\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.49817E+07\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.92623E+07\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.159394E+08\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.229563E+08\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.063336E+08\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.274244E+08\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,6.99874E+07\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.7428E+07\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.301888E+08\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.153214E+08\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.07741E+08\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61005E+07\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94322E+07\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.344557E+08\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.367177E+08\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.966787E+08\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54078E+07\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.53633E+07\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32152E+07\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.17948E+07\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68072E+07\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61236E+07\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.195111E+08\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.1352E+07\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.068894E+08\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60412E+07\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.64814E+07\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05294E+07\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.019865E+08\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.495076E+08\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.045963E+08\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.83701E+07\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21121E+07\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.078325E+08\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85046E+07\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.07614E+07\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.323437E+08\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.085958E+08\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.799497E+08\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.088518E+08\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.152445E+08\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.161505E+08\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.945738E+08\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.543701E+08\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.64781E+08\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.636291E+08\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32379E+08\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.707013E+08\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.19772E+07\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.216364E+08\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44147E+07\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.005156E+08\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64135E+07\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00185E+07\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.259955E+08\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.048414E+08\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.180692E+08\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.13918E+08\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.168151E+08\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83294E+07\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37208E+07\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.506819E+08\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.674343E+08\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.696383E+08\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.82737E+07\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.2328E+07\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.174687E+08\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48343E+07\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88274E+07\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.047016E+08\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54146E+08\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.53743E+08\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.82506E+07\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.016263E+08\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.761153E+08\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.169442E+08\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.630581E+08\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.208898E+08\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03492E+08\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.196569E+08\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.422045E+08\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.015272E+08\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96267E+07\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.89589E+07\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87143E+07\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.7253E+07\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.690036E+08\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.40661E+08\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.125858E+08\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.000139E+08\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.728738E+08\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.670166E+08\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32183E+08\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.570263E+08\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.041517E+08\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.051923E+08\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82128E+07\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.56864E+07\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36114E+07\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81096E+07\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.003077E+08\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.349505E+08\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.39714E+07\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.014617E+08\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.28565E+07\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.79693E+07\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58278E+07\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.53562E+07\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06377E+08\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.34954E+07\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.3648E+07\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.68714E+07\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64168E+07\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22439E+07\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.548973E+08\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.73841E+07\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.36763E+07\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.115126E+08\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.8998E+07\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15195E+07\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.1108E+07\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.19611E+07\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60485E+07\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.4139E+07\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.62562E+07\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.45682E+07\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.49852E+07\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.54952E+07\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20356E+07\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.86503E+07\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50257E+07\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.69925E+07\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.8703E+07\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.061255E+08\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.1991E+07\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73494E+07\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.47768E+07\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.051448E+08\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58331E+07\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,9.99651E+07\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04472E+07\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60182E+07\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.26941E+07\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42166E+07\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13261E+07\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.03968E+07\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03217E+07\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23162E+07\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.28948E+07\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.16767E+07\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.080553E+08\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.29536E+07\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89224E+07\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42262E+07\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.85636E+07\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.112974E+08\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,7.99786E+07\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.444126E+08\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.242563E+08\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.74803E+07\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76125E+07\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55456E+07\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64175E+07\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.67825E+07\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91065E+07\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04086E+07\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.041051E+08\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.830735E+08\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.890752E+08\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11084E+07\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.525572E+08\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46282E+07\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.355078E+08\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.169994E+08\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.44512E+07\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36054E+07\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.89616E+07\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72282E+07\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.39872E+08\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.51886E+07\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.89646E+07\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27256E+07\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77458E+07\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.60677E+07\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.3806E+07\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.72561E+07\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78206E+07\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.82675E+07\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.58862E+07\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23226E+07\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.73714E+07\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50003E+07\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.020151E+08\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41025E+07\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.84825E+07\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.71543E+07\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67374E+07\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.174083E+08\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.63573E+07\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.160432E+08\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.511539E+08\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.494E+07\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.214495E+08\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.254334E+08\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.110883E+08\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.071375E+08\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.500097E+08\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.035058E+08\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.50859E+07\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.301387E+08\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.776124E+08\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.571704E+08\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.214662E+08\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.047379E+08\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.476036E+08\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.860549E+08\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.099787E+08\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.216482E+08\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.300502E+08\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15307E+08\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.803363E+08\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70175E+08\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.142533E+08\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.295995E+08\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.544764E+08\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.514775E+08\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.546817E+08\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.168401E+08\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.2755E+07\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.06688E+08\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.423653E+08\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.130267E+08\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.468571E+08\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35399E+07\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.31773E+07\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.14689E+07\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.067421E+08\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.94722E+07\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59176E+07\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.42991E+07\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,8.99675E+07\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.49915E+07\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03352E+07\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.03773E+07\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.58919E+07\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22299E+07\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.25898E+07\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.421739E+08\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.56752E+07\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90198E+07\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.63859E+07\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.78901E+07\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.038069E+08\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.44562E+07\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.88735E+07\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12253E+07\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.09898E+07\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.084651E+08\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25039E+08\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.592371E+08\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.586288E+08\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.021238E+08\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.895569E+08\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.589109E+08\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.525237E+08\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.569953E+08\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.433649E+08\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.481941E+08\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.206218E+08\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.29634E+07\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72119E+07\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.9532E+07\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34483E+07\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.302817E+08\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.214085E+08\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.694406E+08\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.089239E+08\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.250696E+08\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.460561E+08\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.576098E+08\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.440602E+08\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.143722E+08\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.92575E+08\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75449E+08\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.117161E+08\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.308767E+08\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.227043E+08\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.737079E+08\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.173577E+08\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17101E+07\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.336462E+08\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.676865E+08\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.733125E+08\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.975085E+08\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.627071E+08\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.238674E+08\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.339685E+08\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77312E+07\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.255901E+08\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.70842E+07\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61426E+07\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02272E+07\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72269E+07\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36175E+07\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.6896E+07"
  },
  {
    "path": "Tests/TestData/spy_pivot_pnt_hl.txt",
    "content": "Date,Open,High,Low,Close,Volume,PPHL\n2020-01-02T14:30:00Z,323.54,324.89,322.53,324.87,59253833,0\n2020-01-03T14:30:00Z,321.16,323.64,321.1,322.41,77783566,0\n2020-01-06T14:30:00Z,320.49,323.73,320.36,323.64,55761948,0\n2020-01-07T14:30:00Z,323.02,323.54,322.24,322.73,42854811,0\n2020-01-08T14:30:00Z,322.94,325.78,322.67,324.45,68434153,0\n2020-01-09T14:30:00Z,326.16,326.73,325.52,326.65,48569601,0\n2020-01-10T14:30:00Z,327.2899,327.46,325.2,325.71,53057389,0\n2020-01-13T14:30:00Z,326.39,327.96,325.92,327.95,47262010,0\n2020-01-14T14:30:00Z,327.47,328.62,326.844,327.45,63036384,0\n2020-01-15T14:30:00Z,327.35,329.02,327.26,328.19,72056598,0\n2020-01-16T14:30:00Z,329.7,330.92,329.45,330.92,54050328,0\n2020-01-17T14:30:00Z,331.7,332.18,330.8539,331.95,95846017,0\n2020-01-21T14:30:00Z,330.9,332.18,330.82,331.3,77742415,0\n2020-01-22T14:30:00Z,332.24,332.95,331.17,331.34,48914899,0\n2020-01-23T14:30:00Z,330.63,332.1682,329.41,331.72,52004140,0\n2020-01-24T14:30:00Z,332.44,332.53,327.36,328.77,87578442,0\n2020-01-27T14:30:00Z,323.03,325.12,322.66,323.5,84062463,0\n2020-01-28T14:30:00Z,325.06,327.85,323.6038,326.89,63833953,0\n2020-01-29T14:30:00Z,328.38,328.63,326.4,326.62,54040889,0\n2020-01-30T14:30:00Z,324.36,327.91,323.54,327.68,75491844,0\n2020-01-31T14:30:00Z,327,327.17,320.73,321.73,113845576,0\n2020-02-03T14:30:00Z,323.35,326.16,323.22,324.12,69242293,0\n2020-02-04T14:30:00Z,328.07,330.01,327.72,329.06,62573190,0\n2020-02-05T14:30:00Z,332.27,333.09,330.67,332.86,65951146,0\n2020-02-06T14:30:00Z,333.91,334.19,332.8,333.98,50359688,0\n2020-02-07T14:30:00Z,332.82,333.9941,331.6,332.2,64139443,0\n2020-02-10T14:30:00Z,331.23,334.75,331.19,334.68,42070006,0\n2020-02-11T14:30:00Z,336.16,337.02,334.684,335.26,54864533,0\n2020-02-12T14:30:00Z,336.83,337.65,336.43,337.42,43992662,0\n2020-02-13T14:30:00Z,335.8621,338.12,335.56,337.06,54501922,0\n2020-02-14T14:30:00Z,337.51,337.73,336.2,337.6,64582210,-1\n2020-02-18T14:30:00Z,336.51,337.6677,335.21,336.73,57342526,0\n2020-02-19T14:30:00Z,337.79,339.08,337.48,338.34,48814692,0\n2020-02-20T14:30:00Z,337.7423,338.64,333.6817,336.95,74163362,0\n2020-02-21T14:30:00Z,335.47,335.81,332.58,333.48,113788208,0\n2020-02-24T14:30:00Z,323.14,325.85,321.24,322.42,161088409,0\n2020-02-25T14:30:00Z,323.94,324.61,311.69,312.65,218913168,0\n2020-02-26T14:30:00Z,314.18,318.11,310.7,311.5,194773819,0\n2020-02-27T14:30:00Z,305.46,311.5637,297.51,297.51,284353460,0\n2020-02-28T14:30:00Z,288.7,297.892,285.54,296.26,385764020,0\n2020-03-02T14:30:00Z,298.21,309.16,294.46,309.09,238703625,0\n2020-03-03T14:30:00Z,309.5,313.84,297.57,300.24,300139150,0\n2020-03-04T14:30:00Z,306.12,313.1,303.33,312.86,176613448,1\n2020-03-05T14:30:00Z,304.98,308.47,300.01,302.46,186366809,0\n2020-03-06T14:30:00Z,293.15,298.78,290.23,297.46,228667168,0\n2020-03-09T13:30:00Z,275.3,284.19,273.45,274.23,309417350,0\n2020-03-10T13:30:00Z,284.64,288.52,273.5,288.42,276444060,0\n2020-03-11T13:30:00Z,280.7,281.94,270.88,274.36,256416563,0\n2020-03-12T13:30:00Z,256,266.66,247.68,248.11,392220670,0\n2020-03-13T13:30:00Z,263.09,271.4754,248.5237,269.32,329566100,0\n2020-03-16T13:30:00Z,241.18,256.9,237.36,239.85,297240030,0\n2020-03-17T13:30:00Z,245.04,256.17,237.07,252.8,262070471,0\n2020-03-18T13:30:00Z,236.25,248.37,228.02,240,327597130,0\n2020-03-19T13:30:00Z,239.25,247.38,232.22,240.51,289322040,0\n2020-03-20T13:30:00Z,242.53,244.47,228.5,228.8,347158790,0\n2020-03-23T13:30:00Z,228.19,229.6833,218.26,222.95,326025170,0\n2020-03-24T13:30:00Z,234.42,244.1,233.8,243.15,235494475,0\n2020-03-25T13:30:00Z,244.87,256.35,239.75,246.79,299430255,0\n2020-03-26T13:30:00Z,249.52,262.8,249.05,261.2,257632816,0\n2020-03-27T13:30:00Z,253.27,260.81,251.05,253.42,224341217,0\n2020-03-30T13:30:00Z,255.7,262.43,253.53,261.65,170961866,0\n2020-03-31T13:30:00Z,260.56,263.33,256.22,257.75,194881060,0\n2020-04-01T13:30:00Z,247.98,257.6591,243.9,246.15,189554623,0\n2020-04-02T13:30:00Z,245.19,252.68,244.59,251.83,177660430,0\n2020-04-03T13:30:00Z,250.76,253.32,245.22,248.19,135561171,0\n2020-04-06T13:30:00Z,257.84,267,248.1698,264.86,188061238,-1\n2020-04-07T13:30:00Z,274.21,275.03,264.89,265.13,201427189,0\n2020-04-08T13:30:00Z,267.96,276,265.2542,274.03,153774487,0\n2020-04-09T13:30:00Z,277.58,281.2,275.47,278.2,190282705,0\n2020-04-13T13:30:00Z,277.14,277.51,271.41,275.66,115139268,0\n2020-04-14T13:30:00Z,280.98,284.9,275.5106,283.79,134143350,0\n2020-04-15T13:30:00Z,277.57,279.26,275.46,277.76,121775006,0\n2020-04-16T13:30:00Z,279.15,280.03,275.76,279.1,131798325,0\n2020-04-17T13:30:00Z,285.38,287.3,282.4,286.64,146684784,0\n2020-04-20T13:30:00Z,282.61,286.7912,281.35,281.59,100224647,0\n2020-04-21T13:30:00Z,276.73,278.04,272.02,273.04,126385698,0\n2020-04-22T13:30:00Z,278.35,281,276.91,279.1,93524584,0\n2020-04-23T13:30:00Z,280.49,283.94,278.75,279.08,104709693,0\n2020-04-24T13:30:00Z,280.73,283.7,278.5,282.97,85165953,0\n2020-04-27T13:30:00Z,285.12,288.27,284.62,287.05,77896608,0\n2020-04-28T13:30:00Z,291.02,291.4,285.4,285.73,105283871,0\n2020-04-29T13:30:00Z,291.53,294.88,290.41,293.21,118745579,0\n2020-04-30T13:30:00Z,291.71,293.3239,288.59,290.48,122901701,0\n2020-05-01T13:30:00Z,285.31,290.6572,281.52,282.79,125180028,0\n2020-05-04T13:30:00Z,280.74,283.9,279.13,283.57,80873213,0\n2020-05-05T13:30:00Z,286.64,289.25,283.7134,286.19,79569938,0\n2020-05-06T13:30:00Z,288.04,288.46,283.78,284.25,73632628,0\n2020-05-07T13:30:00Z,287.75,289.78,287.13,287.68,75250412,0\n2020-05-08T13:30:00Z,291.09,292.95,289.86,292.44,76622128,0\n2020-05-11T13:30:00Z,290.34,294,289.88,292.5,79514231,0\n2020-05-12T13:30:00Z,293.79,294.24,286.52,286.67,95870786,0\n2020-05-13T13:30:00Z,286.06,287.19,278.965,281.6,144721099,1\n2020-05-14T13:30:00Z,278.95,285.11,276.37,284.97,121977890,0\n2020-05-15T13:30:00Z,282.37,286.33,281.34,286.28,111146276,0\n2020-05-18T13:30:00Z,293.05,296.75,292.7,295,120320229,0\n2020-05-19T13:30:00Z,294.35,296.205,291.95,291.97,95189316,0\n2020-05-20T13:30:00Z,295.82,297.87,295.57,296.93,85861691,0\n2020-05-21T13:30:00Z,296.79,297.67,293.6886,294.88,78293925,0\n2020-05-22T13:30:00Z,294.57,295.63,293.22,295.44,63958200,0\n2020-05-26T13:30:00Z,301.93,302.19,298.69,299.08,88951442,0\n2020-05-27T13:30:00Z,302.12,303.57,296.87,303.53,104817449,0\n2020-05-28T13:30:00Z,304.65,306.84,302.24,302.97,90767807,0\n2020-05-29T13:30:00Z,302.46,304.96,299.47,304.32,119265702,-1\n2020-06-01T13:30:00Z,303.62,306.205,303.06,305.55,56779836,0\n2020-06-02T13:30:00Z,306.55,308.13,305.1,308.08,74267162,0\n2020-06-03T13:30:00Z,310.24,313.22,309.94,312.18,92567574,0\n2020-06-04T13:30:00Z,311.11,313,309.08,311.36,75794363,0\n2020-06-05T13:30:00Z,317.23,321.275,317.16,319.34,150524674,0\n2020-06-08T13:30:00Z,320.22,323.41,319.63,323.2,73641217,0\n2020-06-09T13:30:00Z,320.3,323.2849,319.36,320.79,77479228,0\n2020-06-10T13:30:00Z,321.42,322.39,318.2209,319,95000766,0\n2020-06-11T13:30:00Z,311.46,312.15,300.01,300.61,209243560,0\n2020-06-12T13:30:00Z,308.24,309.08,298.6,304.21,194678879,0\n2020-06-15T13:30:00Z,298.02,308.28,296.74,307.05,135782724,0\n2020-06-16T13:30:00Z,315.48,315.64,307.67,312.96,137627502,0\n2020-06-17T13:30:00Z,314.07,314.39,310.86,311.66,83398944,0\n2020-06-18T13:30:00Z,310.005,312.3,309.51,311.78,80828658,0\n2020-06-19T13:30:00Z,314.17,314.38,306.53,308.64,135549624,0\n2020-06-22T13:30:00Z,307.99,311.05,306.75,310.62,74649389,1\n2020-06-23T13:30:00Z,313.49,314.5,311.6101,312.05,68471246,0\n2020-06-24T13:30:00Z,309.84,310.51,302.1,304.09,132813492,0\n2020-06-25T13:30:00Z,303.47,307.64,301.28,307.35,89467968,0\n2020-06-26T13:30:00Z,306.16,306.39,299.42,300.05,127961017,0\n2020-06-29T13:30:00Z,301.41,304.61,298.93,304.46,79773260,-1\n2020-06-30T13:30:00Z,303.99,310.2,303.82,308.36,113394772,0\n2020-07-01T13:30:00Z,309.57,311.89,309.07,310.52,72396542,0\n2020-07-02T13:30:00Z,314.24,315.7,311.51,312.23,69344217,0\n2020-07-06T13:30:00Z,316.37,317.68,315.56,317.05,61713828,0\n2020-07-07T13:30:00Z,315.38,317.52,313.37,313.78,82909963,0\n2020-07-08T13:30:00Z,314.61,316.3,312.7,316.18,54638596,0\n2020-07-09T13:30:00Z,316.84,317.1,310.68,314.38,83354158,0\n2020-07-10T13:30:00Z,314.31,317.88,312.76,317.59,57550365,0\n2020-07-13T13:30:00Z,320.13,322.71,314.13,314.84,102997484,0\n2020-07-14T13:30:00Z,313.3,319.76,312,318.92,93656951,0\n2020-07-15T13:30:00Z,322.41,323.04,319.265,321.85,87196524,0\n2020-07-16T13:30:00Z,319.79,321.28,319.09,320.79,54622520,0\n2020-07-17T13:30:00Z,321.88,322.57,319.735,321.72,62774911,0\n2020-07-20T13:30:00Z,321.43,325.13,320.62,324.32,56308749,0\n2020-07-21T13:30:00Z,326.45,326.93,323.94,325.01,57498967,0\n2020-07-22T13:30:00Z,324.62,327.2,324.5,326.86,57792915,0\n2020-07-23T13:30:00Z,326.47,327.23,321.48,322.96,75737989,0\n2020-07-24T13:30:00Z,320.95,321.99,319.246,320.88,73766597,0\n2020-07-27T13:30:00Z,321.63,323.41,320.775,323.22,48292970,0\n2020-07-28T13:30:00Z,322.43,323.64,320.85,321.17,57494979,0\n2020-07-29T13:30:00Z,322.12,325.73,322.075,325.12,48454159,0\n2020-07-30T13:30:00Z,321.9,324.41,319.64,323.96,61861714,0\n2020-07-31T13:30:00Z,325.9,326.63,321.33,326.52,85210755,0\n2020-08-03T13:30:00Z,328.32,329.62,327.73,328.79,53077948,0\n2020-08-04T13:30:00Z,327.86,330.06,327.86,330.06,41917893,0\n2020-08-05T13:30:00Z,331.47,332.39,331.18,332.11,42866354,0\n2020-08-06T13:30:00Z,331.4799,334.46,331.13,334.33,43679447,0\n2020-08-07T13:30:00Z,333.28,334.88,332.3,334.57,57308270,0\n2020-08-10T13:30:00Z,335.06,335.77,332.955,335.57,44282089,0\n2020-08-11T13:30:00Z,336.85,337.54,332.01,332.8,69600882,0\n2020-08-12T13:30:00Z,335.44,338.28,332.8377,337.44,53826128,0\n2020-08-13T13:30:00Z,336.61,338.2514,335.83,336.83,41816146,0\n2020-08-14T13:30:00Z,336.41,337.42,335.62,336.84,47260390,0\n2020-08-17T13:30:00Z,337.94,338.34,336.8517,337.91,35480974,0\n2020-08-18T13:30:00Z,338.34,339.1,336.61,338.64,38733908,0\n2020-08-19T13:30:00Z,339.05,339.61,336.62,337.23,68054244,0\n2020-08-20T13:30:00Z,335.36,338.8,335.22,338.28,42207826,0\n2020-08-21T13:30:00Z,337.92,339.72,337.55,339.48,55106628,0\n2020-08-24T13:30:00Z,342.12,343,339.4504,342.92,48588662,0\n2020-08-25T13:30:00Z,343.53,344.21,342.27,344.12,38463381,0\n2020-08-26T13:30:00Z,344.76,347.86,344.17,347.57,50790237,0\n2020-08-27T13:30:00Z,348.51,349.9,346.53,348.33,58034142,0\n2020-08-28T13:30:00Z,349.44,350.72,348.15,350.58,48588940,0\n2020-08-31T13:30:00Z,350.35,351.3,349.06,349.31,66099183,0\n2020-09-01T13:30:00Z,350.21,352.71,349.24,352.6,54999325,0\n2020-09-02T13:30:00Z,354.67,358.75,353.43,357.7,69540035,0\n2020-09-03T13:30:00Z,355.87,356.38,342.59,345.39,148011129,0\n2020-09-04T13:30:00Z,346.13,347.83,334.87,342.57,139156281,0\n2020-09-08T13:30:00Z,336.71,342.64,332.88,333.21,114465322,0\n2020-09-09T13:30:00Z,337.55,342.46,336.61,339.79,91462290,0\n2020-09-10T13:30:00Z,341.82,342.53,332.85,333.89,90569548,0\n2020-09-11T13:30:00Z,335.82,336.97,331,334.06,84680194,0\n2020-09-14T13:30:00Z,337.49,340.38,334.2208,338.46,65605686,0\n2020-09-15T13:30:00Z,341.12,342.02,338.4683,340.17,52920862,0\n2020-09-16T13:30:00Z,341.51,343.06,338.52,338.82,82211256,0\n2020-09-17T13:30:00Z,333.56,337.6996,332.991,335.84,91523339,1\n2020-09-18T13:30:00Z,335.37,335.49,327.97,330.65,105877942,0\n2020-09-21T13:30:00Z,325.7,327.13,321.73,326.97,99450829,0\n2020-09-22T13:30:00Z,328.57,330.9,325.86,330.3,63612107,0\n2020-09-23T13:30:00Z,330.9,331.2,322.1,322.64,93112240,0\n2020-09-24T13:30:00Z,321.22,326.797,319.8,323.5,76681332,0\n2020-09-25T13:30:00Z,322.58,329.58,321.64,328.73,71069426,0\n2020-09-28T13:30:00Z,333.22,334.96,332.15,334.19,64584614,0\n2020-09-29T13:30:00Z,333.97,334.77,331.6209,332.37,51531594,0\n2020-09-30T13:30:00Z,333.09,338.29,332.88,334.89,104081136,0\n2020-10-01T13:30:00Z,337.69,338.74,335.01,337.04,88698745,0\n2020-10-02T13:30:00Z,331.7,337.0126,331.19,333.84,89431112,0\n2020-10-05T13:30:00Z,336.06,339.96,336.01,339.76,45713108,0\n2020-10-06T13:30:00Z,339.91,342.17,334.38,334.93,90128883,0\n2020-10-07T13:30:00Z,338.12,341.63,338.09,340.76,56999597,0\n2020-10-08T13:30:00Z,342.85,343.85,341.86,343.78,45242476,-1\n2020-10-09T13:30:00Z,345.56,347.35,344.89,346.85,59528606,0\n2020-10-12T13:30:00Z,349.59,354.02,349.06,352.43,80388533,0\n2020-10-13T13:30:00Z,352.28,352.4651,349.09,350.13,73255513,0\n2020-10-14T13:30:00Z,350.75,351.93,347.14,347.93,57958749,0\n2020-10-15T13:30:00Z,343.71,348.02,343.13,347.5,60357659,0\n2020-10-16T13:30:00Z,348.96,350.75,347.1,347.29,89501868,0\n2020-10-19T13:30:00Z,348.65,349.33,341.04,342.01,68425614,0\n2020-10-20T13:30:00Z,343.46,346.88,342.64,343.38,60051880,0\n2020-10-21T13:30:00Z,343.33,348.6847,342.4,342.73,63574979,0\n2020-10-22T13:30:00Z,342.96,345.24,340.65,344.61,55399292,0\n2020-10-23T13:30:00Z,345.93,345.99,343.13,345.78,49143511,0\n2020-10-26T13:30:00Z,342.13,342.98,335.62,339.39,91473002,1\n2020-10-27T13:30:00Z,339.76,340.12,337.99,338.22,65994108,0\n2020-10-28T13:30:00Z,332.1,332.84,326.13,326.66,127094307,0\n2020-10-29T13:30:00Z,326.91,333.395,325.09,329.98,90596689,0\n2020-10-30T13:30:00Z,328.28,329.69,322.6,326.54,120448685,0\n2020-11-02T14:30:00Z,330.2,332.36,327.24,330.2,86068299,0\n2020-11-03T14:30:00Z,333.69,338.25,330.2935,336.03,93294192,0\n2020-11-04T14:30:00Z,340.86,347.94,339.59,343.54,126959700,0\n2020-11-05T14:30:00Z,349.24,352.19,348.86,350.24,82039749,0\n2020-11-06T14:30:00Z,349.93,351.51,347.65,350.16,74972973,0\n2020-11-09T14:30:00Z,363.97,364.38,354.06,354.56,172304203,0\n2020-11-10T14:30:00Z,353.49,355.18,350.51,354.04,85552022,0\n2020-11-11T14:30:00Z,356.4,357.56,355.06,356.67,58649048,0\n2020-11-12T14:30:00Z,355.58,356.7182,351.26,353.21,68118563,0\n2020-11-13T14:30:00Z,355.27,358.9,354.71,358.1,62959429,-1\n2020-11-16T14:30:00Z,360.98,362.78,359.59,362.57,74541138,0\n2020-11-17T14:30:00Z,359.97,361.92,358.34,360.62,66111009,0\n2020-11-18T14:30:00Z,360.91,361.5,356.24,356.28,70591299,0\n2020-11-19T14:30:00Z,355.6,358.18,354.15,357.78,59940947,0\n2020-11-20T14:30:00Z,357.5,357.72,355.25,355.33,70411890,0\n2020-11-23T14:30:00Z,357.28,358.82,354.865,357.46,63230608,1\n2020-11-24T14:30:00Z,360.21,363.81,359.29,363.22,62415877,0\n2020-11-25T14:30:00Z,363.13,363.16,361.48,362.66,45330890,0\n2020-11-27T14:30:00Z,363.84,364.18,362.58,363.67,28514072,0\n2020-11-30T14:30:00Z,362.83,363.12,359.17,362.06,83872709,0\n2020-12-01T14:30:00Z,365.57,367.68,364.93,366.02,74504969,0\n2020-12-02T14:30:00Z,364.82,366.96,364.2,366.79,45927000,0\n2020-12-03T14:30:00Z,366.68,368.19,365.5,366.69,62881998,0\n2020-12-04T14:30:00Z,367.32,369.85,367.22,369.85,50749859,0\n2020-12-07T14:30:00Z,369.02,369.62,367.72,369.09,48944269,0\n2020-12-08T14:30:00Z,367.72,370.78,367.67,370.17,42458859,0\n2020-12-09T14:30:00Z,370.88,371.05,365.95,366.85,74098312,0\n2020-12-10T14:30:00Z,365.37,367.86,364.43,366.73,57735353,0\n2020-12-11T14:30:00Z,364.9,366.7402,363.26,366.3,57698614,0\n2020-12-14T14:30:00Z,368.64,369.8,364.47,364.66,69216174,0\n2020-12-15T14:30:00Z,367.4,369.59,365.92,369.59,64071099,0\n2020-12-16T14:30:00Z,369.82,371.16,368.8676,370.17,58420517,0\n2020-12-17T14:30:00Z,371.94,372.46,371.05,372.24,64119472,0\n2020-12-18T14:30:00Z,370.97,371.15,367.02,369.18,136542328,0\n2020-12-21T14:30:00Z,364.97,378.46,362.03,367.86,96386745,0\n2020-12-22T14:30:00Z,368.21,368.3317,366.03,367.24,48388462,0\n2020-12-23T14:30:00Z,368.28,369.62,367.2172,367.57,46201402,0\n2020-12-24T14:30:00Z,368.08,369.03,367.45,369,26457853,0\n2020-12-28T14:30:00Z,371.74,372.59,371.07,372.17,39000402,0\n2020-12-29T14:30:00Z,373.81,374,370.83,371.46,53680451,0\n2020-12-30T14:30:00Z,372.34,373.1,371.57,371.99,49455259,0\n2020-12-31T14:30:00Z,371.78,374.66,371.232,373.88,78520702,0\n2021-01-04T14:30:00Z,375.31,375.45,364.82,368.79,110210810,0\n2021-01-05T14:30:00Z,368.1,372.5,368.05,371.33,66426229,0\n2021-01-06T14:30:00Z,369.71,376.98,369.12,373.55,107997675,2\n2021-01-07T14:30:00Z,376.1,379.9,375.91,379.1,68766812,0\n2021-01-08T14:30:00Z,380.59,381.49,377.1,381.26,71677208,0\n2021-01-11T14:30:00Z,377.85,380.58,377.7189,378.69,51176719,0\n2021-01-12T14:30:00Z,378.89,379.86,376.36,378.77,52547716,0\n2021-01-13T14:30:00Z,378.69,380.86,377.85,379.79,45303619,0\n2021-01-14T14:30:00Z,380.59,381.13,378.1,378.46,49989113,0\n2021-01-15T14:30:00Z,376.72,377.58,373.7,375.7,107159962,0\n2021-01-19T14:30:00Z,378.34,379.23,376.75,378.65,51229172,0\n2021-01-20T14:30:00Z,381.11,384.79,380.69,383.89,61836062,0\n2021-01-21T14:30:00Z,384.49,384.95,383.25,384.24,47955809,0\n2021-01-22T14:30:00Z,382.25,384.1256,381.835,382.88,52136931,0\n2021-01-25T14:30:00Z,383.67,384.77,378.46,384.39,70401971,0\n2021-01-26T14:30:00Z,385.41,385.85,383.54,383.79,42665281,0\n2021-01-27T14:30:00Z,380.22,380.32,372.01,374.41,123351078,0\n2021-01-28T14:30:00Z,376.36,381.93,375.89,377.63,94198104,0\n2021-01-29T14:30:00Z,375.63,376.67,368.27,370.07,126765121,0\n2021-02-01T14:30:00Z,373.72,377.34,370.376,376.23,75817597,0\n2021-02-02T14:30:00Z,379.65,383.22,376.3181,381.55,64450662,0\n2021-02-03T14:30:00Z,382.435,383.7,380.48,381.85,52427090,0\n2021-02-04T14:30:00Z,382.96,386.24,381.9655,386.19,47142555,0\n2021-02-05T14:30:00Z,388.2,388.47,386.1444,387.71,48669773,0\n2021-02-08T14:30:00Z,389.27,390.56,388.35,390.51,38365185,0\n2021-02-09T14:30:00Z,389.61,390.89,389.17,390.25,35551059,0\n2021-02-10T14:30:00Z,392.12,392.28,387.5,390.08,59154370,0\n2021-02-11T14:30:00Z,391.24,391.69,388.1,390.71,42913288,0\n2021-02-12T14:30:00Z,389.85,392.9,389.77,392.64,50593270,-1\n2021-02-16T14:30:00Z,393.96,394.17,391.53,392.3,50972366,0\n2021-02-17T14:30:00Z,390.42,392.66,389.33,392.39,52806681,0\n2021-02-18T14:30:00Z,389.59,391.515,387.74,390.72,59712773,0\n2021-02-19T14:30:00Z,392.07,392.38,389.55,390.03,83240971,0\n2021-02-22T14:30:00Z,387.06,389.62,386.74,387.03,67414170,0\n2021-02-23T14:30:00Z,384.66,388.945,380.2,387.5,107284127,0\n2021-02-24T14:30:00Z,386.33,392.23,385.27,391.77,72433946,0\n2021-02-25T14:30:00Z,390.41,391.88,380.7789,382.33,146670499,0\n2021-02-26T14:30:00Z,384.35,385.58,378.23,380.36,152701639,0\n2021-03-01T14:30:00Z,385.59,390.92,380.572,389.58,105348798,0\n"
  },
  {
    "path": "Tests/TestData/spy_ppo.txt",
    "content": "Date,Open,High,Low,Close,Volume,PPO_5_10\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.930382198643476\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,1.1319419879731\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,1.07393665925495\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0.882886043384189\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.803493902518034\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.722044976039433\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0.530893627987895\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.261879483962301\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.10357227865448\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,3.65397444562488E-14\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,-0.277770633471317\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,-0.317603188890281\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-0.250913582788588\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,-0.0803946412147769\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,-0.034724008436631\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.26622766967192\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.309912041561666\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.43092098925587\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.267693789118923\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.214388415322979\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,-0.030794498049683\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,-0.0493801825143021\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,-0.17359220564592\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.108083217682148\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.341501713891777\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0.669326975789495\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,0.589994961124123\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.636317266003565\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.190017088785167\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-0.344704320294143\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,-0.788828755233324\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,-0.652268259681902\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,-0.670336188587074\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,-0.266738137172325\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0.335161292381947\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.723568668774137\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.854123806551473\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.950200343445926\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0.797857147390941\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.595795279176282\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.616898870174006\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.573911514649214\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.636033554526135\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0.924597282357839\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1.04030562088581\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,0.969368453041804\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,0.922288959131076\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0.901256334069015\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0.757045925816902\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,0.713495270877585\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0.801862074848639\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.898361810815632\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0.854079592949333\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,0.673121700161511\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0.530174027511107\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.218340611353743\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,-0.0240859386290236\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-0.258323247285784\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,-0.25294804928871\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-0.380457392992556\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,-0.340592050436554\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-0.468966518816099\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-0.592104064566633\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,-0.775797550305116\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,-0.572186849441761\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,-0.486509855021234\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,-0.348359780612597\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-0.078256829131044\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.20195591241241\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.0201989288447441\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,-0.0293786417273957\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.16014474150688\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0.234403613722439\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-0.14985901019648\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-0.303227469707909\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-0.737634143332904\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,-1.3464285935171\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,-1.65793742183921\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,-1.2585833648651\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,-0.921478591001451\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,-0.196104065890965\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.415792628109096\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0.694552979200932\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0.709202163160178\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0.842614530281259\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0.805613305613301\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.884901218895956\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1.18889870435808\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,1.3400468069245\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,1.37449520751228\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,1.2857489093553\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,1.20689863258383\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0.917265862932721\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.744517858852803\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.572048937325135\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.524862536002445\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.393759242651896\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.312118011464079\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.209857368127738\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.0758608427665418\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,-0.0527135639699989\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,-0.07518663453968\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.0236557613606747\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.135877592012772\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.314068126807948\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.413693795773356\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.43005043801431\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0.277119373592292\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.0719246324179395\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,-0.146162641300387\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,-0.220290264819541\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,-0.273885462866451\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-0.425742983507645\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-0.53601359875386\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-0.701353969782347\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,-0.936060680088899\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-1.16210289838621\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,-0.979071229677531\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,-0.724542063025546\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,-0.3911906979539\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-0.285305844245904\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,-0.072593524657569\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,-0.167794382219828\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-0.396081642556043\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,-0.568474825119679\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,-0.285118051005799\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,-0.121223876254678\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0.106678304299873\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0.527613382359166\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0.894962810667001\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,0.965796465775367\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1.01933553979131\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1.10121738713869\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1.01930658523348\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.879814175642036\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0.876015166123485\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,0.920814652912406\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,0.80665534724957\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0.626030427308325\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.406439693850644\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,-0.0428230352732299\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,-0.44622177398072\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,-0.634013876751417\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,-0.72531435182734\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,-0.64668602805438\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,-0.403627342953578\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-0.345750811184567\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,-0.24021678677503\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,-0.161171813893937\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-0.379546089012177\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-0.601731988215319\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,-0.386394622625205\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,-0.303394448476462\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,-0.059979452583553\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0.41976642699806\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,1.01472296640511\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1.15905385287933\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1.31781941516615\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,1.30950077115699\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,1.38879171622475\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1.15130529600437\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,1.02479033125061\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,0.873372508353492\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.777099403247397\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.547879397904577\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0.502059585344422\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.427834904719859\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.353409174980229\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.283018867924539\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.131783738341131\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.0839449593320844\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-0.0011345329127891\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.0453468466936713\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.0390875050275691\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.129174079068155\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.147695441813119\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.441085941162221\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.534807576346764\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,0.624627193229275\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,0.701194502814903\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,0.637800934243652\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,0.428867364649247\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.316268258065976\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.266044965503396\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.242117273815157\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.384019028670829\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0.408634627342997\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.350799289520429\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.234748297658639\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.0904234368672501\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-0.177472131329374\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,-0.241113445261675\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,-0.177312824150003\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,-0.0731366769353387\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-0.0765441959531288\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-0.000555589508250379\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-0.154702281580407\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,-0.32466628426954\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-0.497606695679794\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,-0.274969942556902\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,-0.0427989394756444\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.306157034666304\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0.610819275235147\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.963927588960835\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0.915290044630745\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0.85727359431938\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0.789184436139815\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0.723807853945327\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.487607552450593\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.316849856871279\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.106476501455191\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,-0.0354549966999568\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,-0.216976503298274\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,-0.177110751440041\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,-0.0555767449463325\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-0.0114558160086928\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.0174579100699156\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.143484546768842\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.146637956880766\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.0501307759371727\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.223187553755491\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.247029121142184\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.0832829825105537\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-0.260865768735422\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-0.541552816457967\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,-0.959629747425498\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-1.38006933362683\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,-1.47747906858661\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,-1.21564218582987\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-1.12294493282931\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,-1.04902734184865\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,-0.786170595645163\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,-0.686434320587977\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,-0.561531696096362\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,-0.0157682517514135\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0.562792711244035\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,1.07045728544593\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,1.47555018381426\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,1.62914047641622\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,1.53074806992634\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,1.21722225904081\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0.943608795291307\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,0.685644187905975\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.4952901023891\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.296283386344859\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.338780282226296\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.321267704998123\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.403037952740581\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.35843070159294\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0.473441857448636\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.5299162807748\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0.56317875950063\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,0.538782694557462\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0.704447932458741\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0.538226954149087\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.357461542160698\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.0710891607737547\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-0.226827728619885\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,-0.494491101833083\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,-0.452774110087727\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,-0.461061189559277\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,-0.163174029114531\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0.111937700510416\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.161984144863168\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.0665428825947559\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,0.0091341374956475\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-0.29937384106848\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,-0.42011840677346\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,-0.286779158566315\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,-0.110058250342231\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.190361794655953\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,0.57724775559428\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,0.664004930464378\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.436493892302919\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.16365733909266\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,-0.142032512045943\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-0.653314309621615\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-0.966479606097716\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,-0.900182622327312\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,-0.780676370232783\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,-0.737504595886399\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,-0.266343301357681\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.297638374786263\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.640045802433796\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.863101338885965\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,1.00726872721784\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.825770054800152\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.517973408909176\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.244132259722485\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.11592189962344\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.050689645972886\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.150334253819729\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.240784146601381\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.196685660069658\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.127896318717677\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.0676838789791281\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,-0.0319482013162369\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,-0.0409367606794128\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.179485545572378\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.264874649001322\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.284122592260211\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.294214489798102\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.165666648967275\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-0.131099162982245\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,-0.189888188742482\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,-0.0588163604859679\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.0582127623543581\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.260660374864542\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0.590140376273937\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0.756297202649707\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.801531535322116\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,0.812607215364538\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.732357206049423\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0.624768386824018\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0.562660379027998\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.540731284574081\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.545995600983284\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.623344161377419\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0.618082655023252\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.463668960969351\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.259975598329962\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.055558985122526\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,-0.127960697051777\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,-0.147769602561345\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.0497178384528937\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.206500407364308\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0.354019478756257\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.386986985960799\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.283352889635842\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.0793435473219988\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,-0.0194351530774523\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,-0.10885953031972\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.0168466191897951\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.135726750415807\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.329333075032847\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.421270331260077\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0.455825655599502\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.341321233639707\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.212035695217743\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,-0.00914717809555787\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,-0.0903736799350109\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,-0.0664600149154395\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,-0.0283969899190601\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-0.0152244077705383\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.121317949472853\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.103560659133155\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.102443427899097\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.0942564383228328\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.274846253131855\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.219551184766963\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.255948527031388\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.14367525345527\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.0253074859543223\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-0.405457457376291\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-0.672300507655504\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,-0.895938750369091\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-1.08720630365179\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,-1.25739114394929\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-1.08228225756675\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,-0.777495926911279\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,-0.582263439332524\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,-0.248948052149727\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.148705433706884\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.499829250877005\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0.588879476000557\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.777064480367122\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.946174443525028\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,1.00994581528027\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.955100583870852\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,1.00254194204368\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0.96229369467059\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0.811530090242897\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0.670823218944163\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.513567839195919\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.414538418738883\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.292257186323896\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.203464393731017\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.13488939069956\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.151254211905567\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0.0693387873194021\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-0.0154708374714403\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,-0.0454202873957099\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,-0.0389307033481413\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-0.186262515293096\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-0.260893033856214\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,-0.138452233979356\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,-0.0829610083261704\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,-0.0114853561709654\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.165822569850172\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.254910781226467\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.0735224243393197\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,-0.0200112062756241\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-0.370942193170744\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,-0.59036259398413\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,-0.680135525160104\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,-0.606901683938586\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-0.811646547853944\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,-0.636471809412986\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,-0.565768709692242\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,-0.54829743230135\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-0.690723119868052\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,-0.30914581887942\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-0.293360045792881\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-0.530452269556037\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-0.926694685816037\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-1.02444256748013\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,-1.67905885291205\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,-1.93855157278723\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,-1.74157155975349\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,-1.12751084347507\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,-0.499323887044509\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0.368023114804115\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,1.16441350108741\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,1.68740484065722\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,1.83490553711871\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,1.7191917512056\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,1.66542689478458\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,1.43821031837644\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,1.28940850296094\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,1.26924772371429\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,1.17993951358409\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,1.11442726075981\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,1.07581762139216\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.895087738544531\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.722726392179575\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.742949410098098\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.611903221504947\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.475946473266143\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.436960565293074\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.346959436215441\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.260873829255072\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.242877709114705\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.259707230229659\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.334480822285632\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.45582406653562\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.464423413950163\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.519962679314174\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0.530363684887257\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.367053438519695\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.21839241873227\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.180417232989664\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.0642552430828075\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.0246104551002943\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.110026927642726\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.0883447666586684\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-0.177994466693847\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,-0.347378671821747\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-0.732849950430689\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,-1.12260964089178\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-1.51643498229943\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,-1.35596383441639\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,-1.05880676653693\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,-0.433172880722718\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0.307172099926631\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,1.21072510891602\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,1.56818159542862\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,1.519441713981\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,1.34654545808842\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0.961300497391614\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.375172840580433\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,-0.0270267661510212\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-0.432519255331614\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-0.972692766932463\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,-1.23886915478579\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,-1.11481797150873\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,-1.06013962814629\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-0.688865622278673\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-0.14332695233902\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.0453076983687753\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-0.312246793541773\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,-0.384112778679907\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,-0.459771252666469\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,-0.521288843430655\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,-0.190370976810375\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0.442593588560528\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0.759903150565225\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,0.823479521494177\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0.629800003948469\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.168214801915849\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-0.397514302623924\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,-0.759903150565505\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,-0.689424232277016\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,-0.351436756150269\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0.0541423846273672\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,0.625904165805441\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,0.933328082542329\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,0.925075288256891\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,0.870587083190433\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0.802740541569181\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0.707918196119476\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0.839076290654004\n"
  },
  {
    "path": "Tests/TestData/spy_pso.csv",
    "content": "date,open,high,low,close,pso\n19980102 00:00,973100,975300,965300,973600,\n19980105 00:00,978400,984400,967800,977500,\n19980106 00:00,972500,972800,961900,966300,\n19980107 00:00,960900,965000,952200,964700,\n19980108 00:00,963100,963100,955000,957800,\n19980109 00:00,952500,955000,919100,924700,\n19980112 00:00,911300,941900,909100,940600,\n19980113 00:00,946300,956300,942200,952200,\n19980114 00:00,956900,959700,947200,958100,\n19980115 00:00,955000,957500,948100,949400,\n19980116 00:00,962500,966900,956600,962300,\n19980120 00:00,966900,980000,965000,980000,\n19980121 00:00,972200,976900,961600,971600,\n19980122 00:00,961600,968800,958800,963000,\n19980123 00:00,965000,967800,950000,956600,\n19980126 00:00,963800,967300,937500,957500,0.7925353988718385\n19980127 00:00,958100,980000,956600,970000,0.7470747052812595\n19980128 00:00,974100,981100,971700,978800,0.7847696381891478\n19980129 00:00,978400,995600,975600,987500,0.8277922952186313\n19980130 00:00,987800,989700,980000,983100,0.851876080276924\n19980202 00:00,999100,1005000,997500,1002500,0.888806329322955\n19980203 00:00,1000000,1008100,997200,1006900,0.9209590984188212\n19980204 00:00,1002800,1011600,998800,1005900,0.9393731154208779\n19980205 00:00,1013100,1015900,1000300,1003800,0.94313038795941\n19980206 00:00,1010000,1015000,1006900,1012800,0.9491292488348635\n19980209 00:00,1017200,1017500,1007200,1011400,0.9510566919742418\n19980210 00:00,1014400,1024700,1011900,1020500,0.9538080381885667\n19980211 00:00,1020900,1031900,1017000,1021300,0.9452904075012198\n19980212 00:00,1017200,1029400,1008800,1026600,0.9404018546629442\n19980213 00:00,1021900,1029400,1018800,1021600,0.9265349644967393\n19980217 00:00,1028100,1030900,1021600,1023400,0.9107856197909855\n19980218 00:00,1023100,1034700,1022800,1034100,0.9190192970363728\n19980219 00:00,1032500,1034100,1027500,1030000,0.9234738697967785\n19980220 00:00,1030800,1037500,1023800,1035600,0.933775522224476\n19980223 00:00,1042500,1042500,1033400,1040000,0.9435563656785467\n19980224 00:00,1039100,1040900,1029400,1031900,0.9369621592944862\n19980225 00:00,1037500,1048800,1036300,1044800,0.9354939466372294\n19980226 00:00,1044400,1051600,1041900,1050600,0.9431350441352726\n19980227 00:00,1049700,1055300,1043100,1052000,0.9488147354823768\n19980302 00:00,1052500,1057500,1046300,1048100,0.9429940469059206\n19980303 00:00,1045300,1054700,1045000,1054100,0.9431138380232696\n19980304 00:00,1050900,1054100,1040600,1049700,0.9345762178093867\n19980305 00:00,1035000,1044400,1031600,1037500,0.8753540056001912\n19980306 00:00,1045600,1058800,1044400,1057500,0.8632587824692641\n19980309 00:00,1055300,1062200,1052500,1054400,0.8551557596640295\n19980310 00:00,1062200,1068400,1053800,1066600,0.8787387918683361\n19980311 00:00,1069700,1073100,1067300,1072500,0.9104252585503991\n19980312 00:00,1070900,1075900,1065000,1072500,0.9310427851388111\n19980313 00:00,1078400,1080000,1068800,1072200,0.9390319599232716\n19980316 00:00,1078400,1082800,1075300,1082500,0.9508336389914562\n19980317 00:00,1083100,1085000,1076600,1084700,0.9609937373309294\n19980318 00:00,1082500,1089400,1080000,1087800,0.9672270795176107\n19980319 00:00,1089700,1093800,1086600,1093400,0.9722321897922122\n19980320 00:00,1095600,1101900,1088800,1100000,0.9748279204762864\n19980323 00:00,1097200,1103100,1094100,1095000,0.9716309356436192\n19980324 00:00,1100600,1108100,1099400,1105900,0.9707288410290368\n19980325 00:00,1114100,1115300,1091900,1101900,0.9607466904019146\n19980326 00:00,1098800,1107500,1096300,1101300,0.9412283106161239\n19980327 00:00,1107500,1107800,1090000,1095300,0.8907417271522462\n19980330 00:00,1096300,1100900,1089700,1093400,0.7519042163509915\n19980331 00:00,1101600,1111900,1097500,1100900,0.5685847761993026\n19980401 00:00,1103100,1110800,1094100,1109800,0.5260202250434717\n19980402 00:00,1109400,1122500,1107500,1120300,0.6249948617282508\n19980403 00:00,1123400,1128100,1118400,1121900,0.7191060866796668\n19980406 00:00,1132500,1133800,1120600,1122500,0.7687634489520232\n19980407 00:00,1117500,1119400,1101600,1110000,0.7314211863061103\n19980408 00:00,1112200,1112800,1097500,1101300,0.5774253278615473\n19980409 00:00,1105600,1112800,1105300,1110000,0.3873881898656826\n19980413 00:00,1113800,1113800,1100000,1110000,0.1944726839903422\n19980414 00:00,1111300,1117200,1109100,1116900,0.09978467190982643\n19980415 00:00,1119700,1121300,1111600,1120200,0.1150669698416504\n19980416 00:00,1113100,1115000,1105000,1109100,0.009363214609990298\n19980417 00:00,1107200,1124100,1104400,1122200,0.1966174149521463\n19980420 00:00,1120000,1125600,1118800,1124100,0.4696144324158633\n19980421 00:00,1124400,1131600,1119100,1126300,0.6501132287578122\n19980422 00:00,1128800,1134400,1128100,1130000,0.7675073131379784\n19980423 00:00,1126300,1130000,1117500,1120900,0.7760748451813433\n19980424 00:00,1117500,1124700,1103400,1108800,0.6344278172198702\n19980427 00:00,1093800,1106600,1076300,1085900,0.3383418264669521\n19980428 00:00,1097800,1098100,1081300,1086300,-0.04529761746406932\n19980429 00:00,1090300,1099700,1084400,1095300,-0.30323517818200074\n19980430 00:00,1105600,1119200,1104100,1114400,-0.3011241484157056\n19980501 00:00,1117500,1123100,1113100,1121900,-0.11641225690146922\n19980504 00:00,1127200,1133100,1121600,1122500,0.1550301691189953\n19980505 00:00,1120000,1121600,1111300,1116600,0.35988556392275356\n19980506 00:00,1121300,1121300,1104700,1105000,0.4101662728599696\n19980507 00:00,1105000,1105600,1094100,1095900,0.2843812869891342\n19980508 00:00,1100000,1113800,1100000,1110000,0.207434576113485\n19980511 00:00,1115600,1122200,1103800,1108600,0.07928584007957075\n19980512 00:00,1108100,1118800,1102500,1116400,0.05222459186871393\n19980513 00:00,1120600,1125600,1115900,1120600,0.13330095482732104\n19980514 00:00,1115300,1126900,1113400,1119700,0.30170400989676716\n19980515 00:00,1120000,1122200,1108100,1110000,0.3338211873993718\n19980518 00:00,1107200,1115900,1098300,1108400,0.2810888604554041\n19980519 00:00,1110000,1116900,1107800,1110600,0.18969929458917503\n19980520 00:00,1120900,1125000,1108800,1122800,0.314728203857088\n19980521 00:00,1123800,1127800,1113100,1116900,0.39822697226849213\n19980522 00:00,1117500,1120600,1109400,1111600,0.37131974993091704\n19980526 00:00,1120900,1120900,1094400,1095300,0.06966555375887856\n19980527 00:00,1093100,1099100,1075800,1096300,-0.13814602547320246\n19980528 00:00,1098800,1103800,1087300,1100000,-0.23135774413538943\n19980529 00:00,1106300,1108100,1093800,1093800,-0.32554895388055205\n19980601 00:00,1089700,1102200,1085600,1095000,-0.3955675330644149\n19980602 00:00,1100000,1103400,1091600,1095900,-0.43878634703321984\n19980603 00:00,1098800,1101900,1082200,1085000,-0.5414020903900182\n19980604 00:00,1082500,1100600,1080600,1099100,-0.5297028198647895\n19980605 00:00,1103800,1118800,1098800,1118100,-0.24320825737003243\n19980608 00:00,1119400,1124700,1116600,1118800,0.1338386699711904\n19980609 00:00,1117200,1124200,1114100,1122800,0.49576381227237143\n19980610 00:00,1116300,1130600,1112500,1113800,0.6388134226340337\n19980611 00:00,1114400,1118800,1092800,1096600,0.5827318378781411\n19980612 00:00,1098800,1104400,1082500,1102500,0.4763615580040264\n19980615 00:00,1088100,1099100,1078800,1080000,0.12912835492097288\n19980616 00:00,1084100,1091600,1077500,1090600,-0.19537846465042374\n19980617 00:00,1101600,1117800,1099400,1112500,-0.22906490773770935\n19980618 00:00,1111900,1114400,1107500,1111600,-0.14299255480006337\n19980619 00:00,1110600,1112300,1096300,1100300,-0.12687360554469906\n19980622 00:00,1102500,1110600,1100600,1103800,-0.030079336598161154\n19980623 00:00,1110900,1121900,1110000,1119700,0.26066909909181185\n19980624 00:00,1121600,1136900,1116100,1134700,0.5555285853963119\n19980625 00:00,1139100,1144700,1128100,1130000,0.702785798749754\n19980626 00:00,1133100,1138400,1131300,1134100,0.7784576290238738\n19980629 00:00,1142500,1146900,1138000,1138900,0.8307744290354252\n19980630 00:00,1139100,1141900,1130600,1133600,0.85006752017721\n19980701 00:00,1140600,1149400,1136300,1149400,0.8903896862811136\n19980702 00:00,1147200,1148800,1142500,1146300,0.9176711795199095\n19980706 00:00,1147800,1158400,1145600,1157800,0.9397446068507271\n19980707 00:00,1159800,1161300,1152800,1155600,0.94652444286253\n19980708 00:00,1158800,1169400,1157500,1168100,0.9548513573838407\n19980709 00:00,1162800,1167200,1156300,1160000,0.9523508694637515\n19980710 00:00,1160300,1169100,1150600,1165300,0.9524006523621517\n19980713 00:00,1165600,1168400,1160600,1167500,0.9559618659298514\n19980714 00:00,1169400,1181600,1169400,1178100,0.958876199089053\n19980715 00:00,1180600,1182800,1174400,1175600,0.9564872176705944\n19980716 00:00,1176900,1185900,1170600,1184400,0.9589623759133784\n19980717 00:00,1186300,1190000,1183100,1187500,0.9621366396371891\n19980720 00:00,1187500,1192300,1179400,1185000,0.9605793151861517\n19980721 00:00,1190000,1190000,1162800,1165300,0.9282022613982183\n19980722 00:00,1163400,1195900,1155300,1166300,0.8331187843444426\n19980723 00:00,1163100,1168400,1138800,1141900,0.5503092744964129\n19980724 00:00,1149700,1150900,1128800,1141600,0.12016266554601546\n19980727 00:00,1136300,1150000,1128400,1149800,-0.21240112890761223\n19980728 00:00,1144400,1146600,1118800,1133100,-0.47459246415031\n19980729 00:00,1137200,1141300,1122500,1126600,-0.6716202924232038\n19980730 00:00,1136300,1145900,1134100,1143400,-0.7425378098729815\n19980731 00:00,1143400,1145000,1113100,1120600,-0.8146270618146941\n19980803 00:00,1117800,1124200,1110300,1113800,-0.8717239760079188\n19980804 00:00,1122200,1122200,1072500,1076100,-0.9108128550493623\n19980805 00:00,1079400,1088800,1055900,1081600,-0.9175693279258269\n19980806 00:00,1081300,1095200,1075600,1090900,-0.9015221948209686\n19980807 00:00,1096900,1105900,1084700,1090300,-0.8716362022240393\n19980810 00:00,1087500,1096600,1081900,1085900,-0.8399938979123718\n19980811 00:00,1067800,1074400,1055000,1070600,-0.8379338418802202\n19980812 00:00,1077500,1088100,1075000,1085000,-0.8051638575327225\n19980813 00:00,1088100,1096600,1076300,1076400,-0.7800045351823115\n19980814 00:00,1083400,1087200,1057800,1064800,-0.7894368639646451\n19980817 00:00,1060000,1089400,1055000,1085000,-0.722236525490938\n19980818 00:00,1090000,1105900,1087800,1102500,-0.4622832860570952\n19980819 00:00,1110900,1110900,1096300,1100000,-0.09177130488857878\n19980820 00:00,1096900,1104100,1091600,1092500,0.1921037990645044\n19980821 00:00,1081900,1087200,1055000,1083800,0.2992638535385256\n19980824 00:00,1092500,1099400,1083100,1090600,0.3809662468701872\n19980825 00:00,1103800,1112500,1086400,1095000,0.4671434126235203\n19980826 00:00,1082800,1096300,1077500,1085000,0.46915347137136304\n19980827 00:00,1070000,1078400,1038900,1042500,0.20022867557190693\n19980828 00:00,1049700,1057200,1021600,1030000,-0.18004276158723423\n19980831 00:00,1037500,1040200,950000,962500,-0.5138554518653118\n19980901 00:00,960600,1005600,936300,996900,-0.6428868721246802\n19980902 00:00,998100,1017500,987800,990000,-0.7031363117380467\n19980903 00:00,976300,993800,966900,985200,-0.7393692313946676\n19980904 00:00,994400,998100,957800,976300,-0.7682837966065383\n19980908 00:00,1008800,1029700,998100,1025900,-0.696512494505202\n19980909 00:00,1027500,1031300,1004800,1007500,-0.5691852973549009\n19980910 00:00,984400,993400,968100,982500,-0.46999125301586403\n19980911 00:00,981900,1015000,970000,1012500,-0.2212695341765524\n19980914 00:00,1028800,1044500,1020900,1031600,0.12122363328654535\n19980915 00:00,1028800,1043100,1022800,1042000,0.48092309987895215\n19980916 00:00,1047500,1052500,1031600,1050000,0.7201135073677988\n19980917 00:00,1022500,1030300,1017800,1022300,0.7843304987251367\n19980918 00:00,1023800,1024100,1010900,1019700,0.7883559458103366\n19980921 00:00,996300,1034100,989400,1021900,0.7737290372642176\n19980922 00:00,1035000,1036600,1021600,1030000,0.7717923061781241\n19980923 00:00,1038800,1070000,1037800,1066300,0.8213728707386141\n19980924 00:00,1063100,1068100,1032500,1043800,0.8305092425858454\n19980925 00:00,1031300,1054200,1026300,1043000,0.8217006327841022\n19980928 00:00,1053100,1063100,1042500,1049100,0.819175126435531\n19980929 00:00,1053800,1059400,1033800,1049400,0.8205183988501443\n19980930 00:00,1035000,1043100,1013800,1018400,0.7414191083504644\n19981001 00:00,1000300,1015500,980900,986300,0.4719257632420518\n19981002 00:00,988800,1008800,972200,1003100,0.15602622585125114\n19981005 00:00,995900,1000000,963400,990000,-0.15346132935258758\n19981006 00:00,1007500,1012800,975300,985300,-0.4069125560135292\n19981007 00:00,986300,1000300,957500,972200,-0.6091494038055488\n19981008 00:00,945600,967500,922200,962200,-0.6999864504385656\n19981009 00:00,970000,995600,940600,986300,-0.6778460734909934\n19981012 00:00,1006300,1014400,996900,997800,-0.4947418873346607\n19981013 00:00,995600,1004100,987500,995300,-0.19129775183295364\n19981014 00:00,989400,1018100,988400,1005000,0.18260319468992323\n19981015 00:00,1001300,1072500,999400,1050300,0.48387673923268343\n19981016 00:00,1061300,1067500,1050000,1056600,0.6863246661702297\n19981019 00:00,1056900,1068100,1055000,1063400,0.8112786727790503\n19981020 00:00,1075600,1088000,1060900,1065000,0.8680223856066904\n19981021 00:00,1068800,1076300,1058800,1071300,0.8956080398354884\n19981022 00:00,1067800,1084700,1061600,1080000,0.9181990120066074\n19981023 00:00,1079700,1080000,1067800,1071300,0.9279753572920455\n19981026 00:00,1077200,1085600,1067800,1075500,0.9341214664730917\n19981027 00:00,1084400,1089700,1062800,1066300,0.9001278891483222\n19981028 00:00,1065600,1078100,1060300,1067800,0.8144105287392972\n19981029 00:00,1070900,1089700,1066300,1089700,0.8154702492348446\n19981030 00:00,1101300,1109100,1095000,1100000,0.8320617621048181\n19981102 00:00,1108100,1117500,1101900,1114800,0.8708428136844542\n19981103 00:00,1115900,1118100,1107500,1111300,0.8983248240130867\n19981104 00:00,1124700,1130900,1110900,1118400,0.9115616619356371\n19981105 00:00,1115300,1138100,1111300,1137300,0.931623919830015\n19981106 00:00,1134700,1145000,1133100,1142800,0.947604985141062\n19981109 00:00,1139400,1142500,1125000,1131400,0.9517149537935488\n19981110 00:00,1130000,1139400,1125000,1126900,0.9401616923248719\n19981111 00:00,1138100,1140600,1118900,1123800,0.9054530383673395\n19981112 00:00,1123100,1131300,1116900,1120300,0.8147571261298765\n19981113 00:00,1122200,1130600,1121300,1127700,0.6910010286095508\n19981116 00:00,1142200,1143600,1128900,1138400,0.661239791843827\n19981117 00:00,1136600,1156300,1130000,1143400,0.651661464708041\n19981118 00:00,1143100,1149400,1135000,1147500,0.6847109790747938\n19981119 00:00,1152800,1159100,1146300,1155000,0.7595638922960545\n19981120 00:00,1163600,1167500,1158400,1166300,0.8393886590680555\n19981123 00:00,1174700,1192200,1171600,1191600,0.8969735639921287\n19981124 00:00,1190000,1196600,1184500,1186900,0.9226276529208779\n19981125 00:00,1189400,1191900,1181600,1188800,0.9364397594653724\n19981127 00:00,1194700,1197200,1190000,1195000,0.9491739293641225\n19981130 00:00,1190200,1193800,1166600,1166900,0.9327400586504142\n19981201 00:00,1161300,1180300,1152200,1178100,0.9047266011891336\n19981202 00:00,1172200,1179100,1160000,1175000,0.8494984493388072\n19981203 00:00,1172500,1183100,1151900,1152800,0.6292008645788638\n19981204 00:00,1166300,1188800,1155900,1179700,0.4561672773446352\n19981207 00:00,1180600,1195300,1180000,1192500,0.49888588486351026\n19981208 00:00,1185300,1197500,1175000,1184700,0.5603820411410926\n19981209 00:00,1186900,1189700,1178800,1188100,0.6436021568102646\n19981210 00:00,1188400,1188400,1167200,1168100,0.5764631366180567\n19981211 00:00,1164400,1173400,1155600,1170600,0.45148135787696525\n19981214 00:00,1161600,1164100,1139100,1144700,0.13140975976015318\n19981215 00:00,1146900,1167500,1145300,1166300,-0.05897380753255144\n19981216 00:00,1171300,1171300,1157500,1164100,-0.17558297881671717\n19981217 00:00,1172200,1185600,1170200,1185000,-0.051409522198949745\n19981218 00:00,1183100,1191300,1178800,1190200,0.2694940289730043\n19981221 00:00,1192500,1213400,1190000,1203100,0.5313724827921621\n19981222 00:00,1204100,1212200,1191900,1205300,0.7083239094956819\n19981223 00:00,1211900,1231900,1208100,1228100,0.8243711795122192\n19981224 00:00,1231600,1238800,1222800,1226900,0.8797537694796651\n19981228 00:00,1232500,1233100,1220000,1226300,0.9060702634152462\n19981229 00:00,1227200,1244400,1221300,1243100,0.9307421033736878\n19981230 00:00,1239400,1247500,1230300,1233800,0.9374515473066827\n19981231 00:00,1233100,1239400,1224700,1228800,0.9283587606061808\n19990104 00:00,1233800,1252200,1217200,1228800,0.9041362007693661\n19990105 00:00,1229400,1248800,1229400,1244400,0.8937708633524578\n19990106 00:00,1258100,1276300,1257500,1275000,0.9090198502186133\n19990107 00:00,1263800,1272200,1257800,1269400,0.9219526084983118\n19990108 00:00,1281900,1285000,1259700,1275000,0.9295830480262794\n19990111 00:00,1276900,1276900,1252200,1262800,0.920302883564378\n19990112 00:00,1262200,1262200,1238100,1240000,0.860349466356441\n19990113 00:00,1204100,1251300,1203800,1233100,0.7360602179618632\n19990114 00:00,1236300,1239100,1209100,1211600,0.42676926121128067\n19990115 00:00,1223800,1247800,1220300,1243100,0.17850290753887554\n19990119 00:00,1253000,1274700,1235000,1252800,0.09512406942190252\n19990120 00:00,1260900,1279400,1250300,1256300,0.12773896159873926\n19990121 00:00,1255800,1258400,1232200,1235900,0.08674291734227287\n19990122 00:00,1221300,1238400,1217800,1225600,-0.058646621295886\n19990125 00:00,1232800,1240000,1219100,1236300,-0.1546320848411014\n19990126 00:00,1241300,1257200,1236300,1255000,-0.09649374275912155\n19990127 00:00,1263800,1266300,1244100,1244700,-0.09466757905536587\n19990128 00:00,1252500,1269700,1251900,1266600,0.07859265527927026\n19990129 00:00,1273400,1283000,1254100,1278800,0.3706686873451353\n19990201 00:00,1286900,1286900,1270000,1270900,0.560161320233229\n19990202 00:00,1270800,1272200,1247700,1262800,0.6381999395490012\n19990203 00:00,1256900,1279400,1256600,1271900,0.7065919369132387\n19990204 00:00,1273800,1275000,1248100,1248400,0.6000668513451014\n19990205 00:00,1256600,1256600,1232200,1240000,0.32257045914088045\n19990208 00:00,1250900,1250900,1233400,1243800,-0.02205377421005381\n19990209 00:00,1243800,1245000,1215600,1218600,-0.40739580888489146\n19990210 00:00,1221300,1230000,1213300,1226900,-0.6303302508804753\n19990211 00:00,1230600,1256900,1225000,1256900,-0.6096721526678639\n19990212 00:00,1248100,1255000,1226300,1235000,-0.610780267141944\n19990216 00:00,1247500,1256300,1233800,1243800,-0.5616182472951785\n19990217 00:00,1231900,1253600,1222500,1227500,-0.5567675637864092\n19990218 00:00,1231900,1243800,1222200,1239400,-0.46244395076915595\n19990219 00:00,1240000,1257500,1233800,1239400,-0.32548742906129485\n19990222 00:00,1244400,1277200,1242800,1276900,0.047177938979292025\n19990223 00:00,1275900,1285000,1265900,1275000,0.38198809118796234\n19990224 00:00,1278400,1288400,1254100,1254100,0.4664001006981024\n19990225 00:00,1245300,1252800,1225900,1247500,0.4050289127901042\n19990226 00:00,1247500,1248400,1228100,1239100,0.20913486309687299\n19990301 00:00,1236600,1243100,1208800,1237800,0.016687891459501066\n19990302 00:00,1245000,1253100,1223100,1228100,-0.2119045116470833\n19990303 00:00,1230900,1235600,1217800,1231300,-0.3927489417426721\n19990304 00:00,1240600,1252300,1232700,1250000,-0.4202496440477068\n19990305 00:00,1275000,1281300,1259200,1278100,-0.20406577741836554\n19990308 00:00,1282800,1288000,1272500,1285200,0.17932394666418178\n19990309 00:00,1281300,1299400,1274400,1282500,0.46826602072024176\n19990310 00:00,1284700,1292200,1277800,1290300,0.6742720563579394\n19990311 00:00,1296900,1311900,1288800,1302200,0.795480067073511\n19990312 00:00,1310000,1310300,1292200,1295300,0.8522236770494327\n19990315 00:00,1299400,1311900,1295000,1311600,0.9011968097211815\n19990316 00:00,1311300,1316600,1304700,1309800,0.924840470753229\n19990317 00:00,1306900,1309400,1296300,1302500,0.9224186484595527\n19990318 00:00,1297800,1323400,1297500,1321600,0.9324338714723691\n19990319 00:00,1323100,1326300,1298400,1300600,0.906168282023455\n19990322 00:00,1300600,1305900,1294200,1299100,0.8134600916723527\n19990323 00:00,1293100,1296300,1257000,1264100,0.5554186363551287\n19990324 00:00,1268400,1271600,1256300,1269400,0.1544454728334035\n19990325 00:00,1280600,1292500,1277500,1291300,-0.07059762868018553\n19990326 00:00,1286300,1291300,1277200,1284700,-0.21257258042089605\n19990329 00:00,1291600,1314400,1291600,1312200,-0.09027042701790725\n19990330 00:00,1299400,1312200,1295600,1303400,0.07116177001539457\n19990331 00:00,1311600,1316100,1284400,1286300,0.1353657154854592\n19990401 00:00,1296900,1296900,1281300,1293800,0.2170203291688122\n19990405 00:00,1309400,1323800,1302500,1323800,0.47094169225127414\n19990406 00:00,1321900,1329800,1311600,1319400,0.636119409223233\n19990407 00:00,1326900,1333800,1313800,1328800,0.7631170258726239\n19990408 00:00,1331900,1347800,1322800,1345300,0.8513441679244769\n19990409 00:00,1344400,1356900,1335900,1348800,0.8963924229737471\n19990412 00:00,1334700,1362500,1332200,1360600,0.9278062005559121\n19990413 00:00,1362500,1364700,1340300,1351900,0.9398014946899841\n19990414 00:00,1360600,1360600,1326900,1330300,0.9147214385866915\n19990415 00:00,1334400,1335600,1310000,1326300,0.8306816813330493\n19990416 00:00,1329100,1329100,1311900,1321300,0.6246993125429589\n19990419 00:00,1326900,1345300,1283800,1289100,0.2035971283811662\n19990420 00:00,1298100,1310300,1288800,1306300,-0.1718667759838752\n19990421 00:00,1310600,1337800,1257800,1336900,-0.18766963624932503\n19990422 00:00,1351300,1362500,1343900,1359700,0.07557202343556259\n19990423 00:00,1358800,1367500,1350000,1357500,0.39059245829356587\n19990426 00:00,1365000,1368100,1354700,1361300,0.641003115914504\n19990427 00:00,1371300,1375000,1358400,1365600,0.7868294966363654\n19990428 00:00,1364400,1372500,1350000,1353400,0.8496993767846498\n19990429 00:00,1355600,1360600,1338100,1345600,0.8715218620027239\n19990430 00:00,1350900,1356300,1315000,1334700,0.8654772667611342\n19990503 00:00,1334400,1357200,1330300,1356300,0.8517184289139207\n19990504 00:00,1351300,1358100,1331300,1333100,0.7567834191216243\n19990505 00:00,1339400,1350000,1318400,1349700,0.6644017869546797\n19990506 00:00,1344400,1351300,1323800,1335000,0.4896104168992753\n19990507 00:00,1345000,1349800,1334400,1346300,0.36518476296316293\n19990510 00:00,1348400,1357200,1335300,1342200,0.314975218042331\n19990511 00:00,1353100,1368800,1257800,1357200,0.44968637992394644\n19990512 00:00,1357500,1372200,1315000,1366300,0.635121232232193\n19990513 00:00,1372500,1380000,1368100,1370200,0.7690158066357953\n19990514 00:00,1345600,1362500,1333100,1343000,0.8122042927419258\n19990517 00:00,1336300,1344800,1323100,1343100,0.8239223731589682\n19990518 00:00,1345300,1349800,1326300,1336300,0.8123451464864742\n19990519 00:00,1344700,1348800,1332500,1348100,0.8093301551933905\n19990520 00:00,1351300,1355900,1300600,1343100,0.8027089791967075\n19990521 00:00,1341300,1346900,1195800,1334200,0.8056529486099622\n19990524 00:00,1338400,1338400,1303900,1310900,0.7870962341272607\n19990525 00:00,1313800,1323400,1286900,1288400,0.7415097155012662\n19990526 00:00,1293100,1310000,1280900,1306600,0.7190577140320087\n19990527 00:00,1298400,1302800,1280000,1284400,0.6714259274610301\n19990528 00:00,1290000,1307500,1285900,1305900,0.6562466455011452\n19990601 00:00,1301300,1301600,1283800,1298800,0.6448382792853558\n19990602 00:00,1297500,1301900,1206300,1297800,0.6467629303248056\n19990603 00:00,1306900,1309100,1297800,1302800,0.671635572007809\n19990604 00:00,1314700,1331900,1309400,1319400,0.7466530873467895\n19990607 00:00,1334400,1341900,1329100,1337500,0.8290937172995583\n19990608 00:00,1333800,1338000,1315900,1321600,0.8730753294684642\n19990609 00:00,1324100,1330900,1318100,1321600,0.8981051045047341\n19990610 00:00,1314400,1315000,1295900,1309100,0.9042424683269839\n19990611 00:00,1312200,1322200,1290900,1298100,0.8940491996635429\n19990614 00:00,1306900,1307500,1295500,1297800,0.783846132955838\n19990615 00:00,1304700,1316600,1300800,1305900,0.5729262059998009\n19990616 00:00,1323800,1338800,1321600,1334800,0.5374657468110153\n19990617 00:00,1328800,1355600,1326300,1346600,0.6116534767389061\n19990618 00:00,1340600,1346900,1333800,1343100,0.6922500523516041\n19990621 00:00,1344700,1350000,1336600,1349400,0.7797150637495922\n19990622 00:00,1340000,1351900,1333400,1337000,0.811750525229926\n19990623 00:00,1330000,1336300,1321300,1332800,0.8048571672288161\n19990624 00:00,1328800,1338100,1306600,1316900,0.6989638946882368\n19990625 00:00,1325900,1330200,1312500,1316600,0.4581460139777322\n19990628 00:00,1326900,1336300,1324700,1333800,0.2967907287103757\n19990629 00:00,1330000,1351300,1327800,1351300,0.42880516927909523\n19990630 00:00,1346300,1375000,1338400,1367500,0.5993328441454968\n19990701 00:00,1370000,1385000,1360600,1380600,0.746790197677324\n19990702 00:00,1381300,1393000,1379100,1391900,0.8484649324157051\n19990706 00:00,1392500,1407500,1385900,1387200,0.8862890690481818\n19990707 00:00,1390600,1397200,1385200,1395600,0.9095331929724689\n19990708 00:00,1390600,1406300,1387500,1395600,0.9226952124008402\n19990709 00:00,1400000,1404700,1393800,1402200,0.936108289274342\n19990712 00:00,1409400,1409400,1395000,1400600,0.9434911831350593\n19990713 00:00,1393800,1399200,1386600,1395000,0.9371793013426769\n19990714 00:00,1400000,1402200,1387500,1398400,0.9179285937085288\n19990715 00:00,1407800,1488800,1403100,1411300,0.8340173352372321\n19990716 00:00,1412500,1421600,1407500,1420000,0.6696514568143946\n19990719 00:00,1421900,1422500,1405600,1410000,0.3762717203986889\n19990720 00:00,1401300,1404100,1375300,1378000,-0.096695723738732\n19990721 00:00,1380900,1389100,1370000,1378800,-0.4943704873388563\n19990722 00:00,1374400,1380000,1354700,1361400,-0.7302895538930816\n19990723 00:00,1366600,1370000,1351300,1357500,-0.8485763748782511\n19990726 00:00,1348800,1361300,1346300,1350000,-0.9084130552608964\n19990727 00:00,1360000,1372000,1353800,1365000,-0.9231471863127644\n19990728 00:00,1362500,1373100,1355900,1367300,-0.9211236311249901\n19990729 00:00,1349400,1352500,1333100,1343800,-0.9227242148558109\n19990730 00:00,1348100,1353400,1328800,1330900,-0.9343592888253299\n19990802 00:00,1327500,1347500,1325000,1329400,-0.9441159543902341\n19990803 00:00,1337200,1338400,1313800,1323600,-0.9468373547040879\n19990804 00:00,1327200,1338800,1305300,1306900,-0.954165548067882\n19990805 00:00,1308800,1317200,1288400,1315600,-0.9469119665317463\n19990806 00:00,1312200,1320000,1295000,1300600,-0.9430801562290222\n19990809 00:00,1305900,1318000,1297200,1300500,-0.9387591222526724\n19990810 00:00,1298800,1301600,1270000,1282200,-0.9372951951912785\n19990811 00:00,1296900,1305300,1286300,1305300,-0.9127949509496993\n19990812 00:00,1306900,1318100,1300000,1300200,-0.8693135125243524\n19990813 00:00,1316300,1332500,1311300,1331900,-0.6990230909661006\n19990816 00:00,1331300,1339700,1322500,1333800,-0.32020133356279507\n19990817 00:00,1344400,1351600,1331300,1347000,0.18637701656813097\n19990818 00:00,1342000,1343800,1334100,1335600,0.5137309194144734\n19990819 00:00,1323800,1332300,1316900,1328800,0.6616721824521963\n19990820 00:00,1330600,1339100,1326900,1338800,0.7520131852595313\n19990823 00:00,1348100,1364500,1346600,1363900,0.8403486540318758\n19990824 00:00,1360600,1379700,1353800,1365000,0.8749278468663668\n19990825 00:00,1371900,1387800,1279100,1384400,0.9090605769088999\n19990826 00:00,1382800,1384200,1365000,1365000,0.9200028688438728\n19990827 00:00,1368800,1370600,1351300,1351600,0.9112776226161748\n19990830 00:00,1353400,1355000,1323900,1326600,0.8631130993303897\n19990831 00:00,1329400,1337500,1307500,1325000,0.7678850663789236\n19990901 00:00,1329400,1335600,1323100,1335600,0.655189271455168\n19990902 00:00,1321300,1326700,1306600,1322500,0.49195754875958037\n19990903 00:00,1348800,1362800,1346900,1361900,0.47382951531378104\n19990907 00:00,1360600,1366300,1342800,1355200,0.4757122777914894\n19990908 00:00,1348400,1360600,1335000,1349100,0.5021387342158797\n19990909 00:00,1347500,1352500,1336900,1351300,0.5679143741547138\n19990910 00:00,1362500,1363600,1349400,1354500,0.6537478521770856\n19990913 00:00,1351300,1354700,1345000,1348100,0.6985262144181154\n19990914 00:00,1340600,1345600,1333800,1340600,0.6877641972144082\n19990915 00:00,1354400,1354400,1320600,1320800,0.43447721781540266\n19990916 00:00,1325000,1328100,1303100,1323800,0.14863368588664488\n19990917 00:00,1326300,1339400,1321600,1337200,0.02815778190901785\n19990920 00:00,1339400,1340000,1330900,1336300,-0.0019097174353743087\n19990921 00:00,1322500,1324700,1301600,1309100,-0.221884808801603\n19990922 00:00,1312500,1318400,1297500,1311600,-0.4143345310403107\n19990923 00:00,1318100,1342500,1237800,1280000,-0.5110901115981852\n19990924 00:00,1277500,1283800,1263100,1280600,-0.5581887407870756\n19990927 00:00,1287500,1297500,1282800,1282800,-0.5570235102487918\n19990928 00:00,1279400,1288100,1255600,1281900,-0.5382563353703095\n19990929 00:00,1284400,1291300,1267800,1267800,-0.5659332770798451\n19990930 00:00,1274400,1294400,1269700,1283800,-0.55226357750173\n19991001 00:00,1279400,1285600,1266300,1283400,-0.5223310408149984\n19991004 00:00,1291900,1306300,1287500,1306300,-0.38910456724133213\n19991005 00:00,1307200,1319700,1286900,1301900,-0.16505700477631252\n19991006 00:00,1307500,1328100,1306900,1326300,0.22073616657707537\n19991007 00:00,1328600,1330000,1315000,1320000,0.5200308923094478\n19991008 00:00,1317500,1338800,1312300,1337200,0.7325831874417635\n19991011 00:00,1335900,1341300,1333100,1338100,0.8464823480735265\n19991012 00:00,1331300,1333100,1311900,1314100,0.8665870270549108\n19991013 00:00,1306900,1313100,1282500,1286600,0.7474663890802744\n19991014 00:00,1284800,1291900,1267500,1284100,0.500861020323525\n19991015 00:00,1260000,1267500,1245000,1248100,0.04415544170205246\n19991018 00:00,1249400,1257500,1234400,1255600,-0.33933118092180736\n19991019 00:00,1271900,1282500,1259400,1260800,-0.5589677722429872\n19991020 00:00,1277500,1292500,1271300,1292200,-0.5797784618283307\n19991021 00:00,1272200,1288800,1266300,1286300,-0.5283792060637464\n19991022 00:00,1297500,1312200,1295600,1303400,-0.27315965027285033\n19991025 00:00,1293100,1304700,1287500,1295000,0.04251616942349542\n19991026 00:00,1301900,1306900,1281900,1282500,0.24208208908717638\n19991027 00:00,1283800,1303100,1282500,1301300,0.47021649245126274\n19991028 00:00,1324400,1345000,1321900,1345000,0.6902699240872665\n19991029 00:00,1358400,1376900,1357200,1365600,0.8094701073545028\n19991101 00:00,1365000,1370000,1356300,1359400,0.8651403800545168\n19991102 00:00,1359700,1372500,1347500,1348100,0.8764804876238679\n19991103 00:00,1360000,1363800,1351300,1356900,0.8833706553159197\n19991104 00:00,1367500,1373600,1357700,1364700,0.8969444361214778\n19991105 00:00,1386300,1391100,1367800,1372200,0.9059996974504546\n19991108 00:00,1370000,1383800,1367500,1379400,0.9126035103376413\n19991109 00:00,1385000,1386900,1362800,1367200,0.8767749475430758\n19991110 00:00,1362500,1383900,1360800,1377500,0.8438195889125814\n19991111 00:00,1381900,1385600,1374700,1383800,0.8412120945827063\n19991112 00:00,1392500,1399700,1371300,1397500,0.8711166110520221\n19991115 00:00,1398400,1402500,1394100,1398100,0.898083429646591\n19991116 00:00,1405600,1426300,1400900,1424400,0.9241532510012487\n19991117 00:00,1422500,1429400,1413100,1415600,0.9317927353610831\n19991118 00:00,1424400,1430000,1416300,1428100,0.9439443190526041\n19991119 00:00,1424100,1429700,1420000,1425000,0.9525575012651658\n19991122 00:00,1424400,1430000,1415000,1424700,0.9577389258420661\n19991123 00:00,1428400,1428400,1400600,1408800,0.9476455525764663\n19991124 00:00,1407500,1424400,1400000,1420600,0.9342530912789353\n19991126 00:00,1424700,1428800,1412500,1414400,0.8936374095756314\n19991129 00:00,1408800,1419200,1404400,1410000,0.7915345088305472\n19991130 00:00,1407500,1423100,1390000,1392500,0.5013544914233005\n19991201 00:00,1393100,1405000,1390000,1401300,0.13514112623538443\n19991202 00:00,1406300,1413600,1403800,1411300,-0.04555506389852679\n19991203 00:00,1430300,1454100,1430300,1436900,0.007490426490947418\n19991206 00:00,1435300,1437200,1422500,1427500,0.07732867304691979\n19991207 00:00,1432800,1433100,1413800,1419400,0.07686252193518885\n19991208 00:00,1413400,1420600,1406300,1406300,-0.06815080626458293\n19991209 00:00,1418100,1422200,1393800,1410000,-0.22571989409196944\n19991210 00:00,1422800,1428100,1408800,1420000,-0.2855040130535194\n19991213 00:00,1414400,1427200,1412800,1421300,-0.3039715684264247\n19991214 00:00,1416300,1424800,1406300,1408100,-0.40868475218681\n19991215 00:00,1403800,1422000,1400000,1418000,-0.3860924083751294\n19991216 00:00,1421900,1426600,1411600,1423800,-0.20094752640626665\n19991217 00:00,1430000,1433100,1420600,1423800,0.05560433056859628\n19991220 00:00,1425600,1431900,1410900,1416900,0.21034081938895624\n19991221 00:00,1415900,1440600,1413400,1433400,0.41299847748127044\n19991222 00:00,1436300,1441900,1429700,1437500,0.610779942590395\n19991223 00:00,1450200,1464400,1449700,1460900,0.7612836877047282\n19991227 00:00,1465000,1467800,1450600,1458100,0.8381775905436846\n19991228 00:00,1458800,1465000,1454800,1461400,0.8834333455496929\n19991229 00:00,1463100,1468100,1452500,1463400,0.9132970746450568"
  },
  {
    "path": "Tests/TestData/spy_qqq_corr.csv",
    "content": "Symbol,Date,Open,High,Low,Close,Volume,Correlation_Pearson,Correlation_Spearman\nSPY,19990310,341900.0,341900.0,324400.0,325600.0,4892000.0,,\nQQQ,19990310,1022500.0,1023100.0,1005600.0,1019400.0,2632800.0,0.0,0.0\nSPY,19990311,322500.0,338800.0,320000.0,321900.0,4207600.0,,\nQQQ,19990311,1028800.0,1053100.0,1006300.0,1023100.0,4863000.0,0.0,0.0\nSPY,19990312,323100.0,335000.0,323100.0,331300.0,2403400.0,,\nQQQ,19990312,1022500.0,1023100.0,993100.0,1003800.0,4428400.0,0.0,0.0\nSPY,19990315,333100.0,350000.0,332500.0,340600.0,3032000.0,,\nQQQ,19990315,1008800.0,1030600.0,998100.0,1030500.0,3189100.0,0.0,0.0\nSPY,19990316,350000.0,355600.0,349400.0,354400.0,3437100.0,,\nQQQ,19990316,1034400.0,1043100.0,1023100.0,1036300.0,2437000.0,0.0,0.0\nSPY,19990317,359400.0,360600.0,339400.0,340600.0,3093400.0,,\nQQQ,19990317,1038800.0,1040000.0,1028100.0,1031300.0,2022500.0,0.0,0.0\nSPY,19990318,343800.0,356300.0,342500.0,355000.0,1945500.0,,\nQQQ,19990318,1030000.0,1051300.0,1029700.0,1050600.0,2424200.0,0.0,0.0\nSPY,19990319,359400.0,370000.0,328800.0,334400.0,4816700.0,,\nQQQ,19990319,1065000.0,1065000.0,1025000.0,1026300.0,3471300.0,0.0,0.0\nSPY,19990322,340000.0,351900.0,329400.0,350600.0,4773400.0,,\nQQQ,19990322,1028800.0,1031300.0,1010000.0,1012500.0,2508100.0,0.0,0.0\nSPY,19990323,344400.0,344400.0,327500.0,330000.0,3469500.0,,\nQQQ,19990323,1006300.0,1010000.0,975000.0,976900.0,5544300.0,0.0,0.0\nSPY,19990324,332500.0,337500.0,325000.0,336300.0,3306700.0,,\nQQQ,19990324,985000.0,1006900.0,970000.0,1006400.0,4176900.0,0.0,0.0\nSPY,19990325,343800.0,348800.0,333800.0,338100.0,3542700.0,,\nQQQ,19990325,1025000.0,1043800.0,1018300.0,1042500.0,4236300.0,0.0,0.0\nSPY,19990326,337500.0,338100.0,322500.0,332500.0,2199900.0,,\nQQQ,19990326,1037500.0,1049400.0,1030600.0,1033100.0,4086000.0,0.0,0.0\nSPY,19990329,335000.0,354400.0,331900.0,353800.0,4850500.0,,\nQQQ,19990329,1047500.0,1072500.0,1041300.0,1072500.0,2497300.0,0.0,0.0\nSPY,19990330,350000.0,363800.0,350000.0,359400.0,4888200.0,,\nQQQ,19990330,1071300.0,1080000.0,1060600.0,1066900.0,2359200.0,0.0,0.0\nSPY,19990331,363800.0,371300.0,358800.0,359400.0,3747000.0,,\nQQQ,19990331,1082500.0,1083800.0,1046300.0,1050600.0,3999900.0,0.0,0.0\nSPY,19990401,360600.0,368000.0,357500.0,360000.0,2083900.0,,\nQQQ,19990401,1080000.0,1081300.0,1053800.0,1072500.0,4302300.0,0.0,0.0\nSPY,19990405,360000.0,378800.0,360000.0,370000.0,4079600.0,,\nQQQ,19990405,1088600.0,1111300.0,1081900.0,1111300.0,2756200.0,0.0,0.0\nSPY,19990406,368100.0,383100.0,368100.0,380600.0,5560500.0,,\nQQQ,19990406,1108800.0,1124400.0,1014400.0,1108100.0,3690900.0,0.0,0.0\nSPY,19990407,380600.0,382500.0,363800.0,371300.0,3681900.0,,\nQQQ,19990407,1122500.0,1125000.0,1076900.0,1093900.0,6326600.0,0.0,0.0\nSPY,19990408,368800.0,370600.0,360000.0,366900.0,2563500.0,,\nQQQ,19990408,1098800.0,1114700.0,1076300.0,1110600.0,3958600.0,0.0,0.0\nSPY,19990409,362500.0,372500.0,359400.0,368800.0,2422600.0,,\nQQQ,19990409,1107500.0,1118800.0,1104400.0,1112500.0,2469700.0,0.0,0.0\nSPY,19990412,350000.0,368800.0,348800.0,361900.0,3355700.0,,\nQQQ,19990412,1090000.0,1116300.0,1088800.0,1110000.0,5933200.0,0.0,0.0\nSPY,19990413,363100.0,368100.0,345000.0,345600.0,3534300.0,,\nQQQ,19990413,1115600.0,1118100.0,1085000.0,1088800.0,5054800.0,0.0,0.0\nSPY,19990414,353800.0,370600.0,350000.0,355000.0,5809900.0,,\nQQQ,19990414,1107500.0,1108800.0,1050200.0,1053100.0,10557300.0,0.0,0.0\nSPY,19990415,353800.0,362500.0,343100.0,356900.0,14430300.0,,\nQQQ,19990415,1060000.0,1068100.0,1022500.0,1065800.0,9386900.0,0.0,0.0\nSPY,19990416,358800.0,360600.0,352500.0,353800.0,4685600.0,,\nQQQ,19990416,1068100.0,1068100.0,1036900.0,1043100.0,9067800.0,0.0,0.0\nSPY,19990419,356900.0,367500.0,335000.0,338800.0,8024800.0,,\nQQQ,19990419,1046300.0,1055000.0,980200.0,987500.0,9598300.0,0.0,0.0\nSPY,19990420,338800.0,347500.0,335000.0,340000.0,4631100.0,,\nQQQ,19990420,986300.0,1021300.0,976900.0,1012500.0,8738300.0,0.0,0.0\nSPY,19990421,340000.0,343800.0,335000.0,343100.0,3072300.0,,\nQQQ,19990421,1022500.0,1052500.0,1008800.0,1052500.0,5176900.0,0.0,0.0\nSPY,19990422,350600.0,366300.0,350600.0,363800.0,9116400.0,,\nQQQ,19990422,1073100.0,1095000.0,1066100.0,1091300.0,7139700.0,0.0,0.0\nSPY,19990423,362500.0,394400.0,362500.0,391300.0,8415000.0,,\nQQQ,19990423,1086300.0,1114400.0,1075000.0,1102500.0,3424200.0,0.0,0.0\nSPY,19990426,395000.0,412500.0,392500.0,408800.0,8309500.0,,\nQQQ,19990426,1113800.0,1140000.0,1110200.0,1130600.0,2671200.0,0.0,0.0\nSPY,19990427,431300.0,458100.0,430000.0,456900.0,18385800.0,,\nQQQ,19990427,1140000.0,1145600.0,1100200.0,1105600.0,8186300.0,0.0,0.0\nSPY,19990428,446300.0,456900.0,436300.0,440000.0,8350400.0,,\nQQQ,19990428,1105000.0,1108800.0,1071400.0,1075000.0,3888700.0,0.0,0.0\nSPY,19990429,432500.0,447500.0,417800.0,430000.0,6857700.0,,\nQQQ,19990429,1071300.0,1077500.0,1045000.0,1062500.0,9350400.0,0.0,0.0\nSPY,19990430,440000.0,471300.0,440000.0,459400.0,13252300.0,,\nQQQ,19990430,1082500.0,1088100.0,1036300.0,1065000.0,7386400.0,0.0,0.0\nSPY,19990503,460600.0,500000.0,448800.0,495600.0,12938300.0,,\nQQQ,19990503,1071300.0,1075600.0,1050800.0,1069200.0,5469800.0,0.0,0.0\nSPY,19990504,482500.0,488800.0,461900.0,465600.0,7054500.0,,\nQQQ,19990504,1070600.0,1087500.0,1045600.0,1049400.0,7836300.0,0.0,0.0\nSPY,19990505,463100.0,470000.0,446300.0,470000.0,5131300.0,,\nQQQ,19990505,1052500.0,1080000.0,1020600.0,1080000.0,6339300.0,0.0,0.0\nSPY,19990506,465600.0,468800.0,440000.0,445000.0,3626700.0,,\nQQQ,19990506,1073800.0,1083100.0,1034400.0,1042300.0,7409700.0,0.0,0.0\nSPY,19990507,446300.0,458800.0,427500.0,458800.0,3787600.0,,\nQQQ,19990507,1053800.0,1062500.0,1031300.0,1057500.0,8454000.0,0.0,0.0\nSPY,19990510,467500.0,469400.0,446300.0,452500.0,3476000.0,,\nQQQ,19990510,1066300.0,1077200.0,1053800.0,1065000.0,5185000.0,0.0,0.0\nSPY,19990511,448800.0,461900.0,435600.0,446900.0,4084800.0,,\nQQQ,19990511,1078800.0,1092500.0,1072500.0,1086400.0,4340800.0,0.0,0.0\nSPY,19990512,448800.0,465000.0,441300.0,463800.0,3508400.0,,\nQQQ,19990512,1091900.0,1113100.0,1060000.0,1106900.0,6221700.0,0.0,0.0\nSPY,19990513,464400.0,468100.0,446900.0,461900.0,2606600.0,,\nQQQ,19990513,1118100.0,1120000.0,1083800.0,1086300.0,4814600.0,0.0,0.0\nSPY,19990514,451300.0,458100.0,443800.0,443800.0,1964100.0,,\nQQQ,19990514,1067500.0,1080000.0,1060000.0,1062700.0,6594800.0,0.0,0.0\nSPY,19990517,437500.0,446900.0,430000.0,444400.0,1804300.0,,\nQQQ,19990517,1058800.0,1087500.0,1048300.0,1087500.0,4911200.0,0.0,0.0\nSPY,19990518,448100.0,460600.0,437500.0,453100.0,3678000.0,,\nQQQ,19990518,1086300.0,1092500.0,1070000.0,1080000.0,4549000.0,0.0,0.0\nSPY,19990519,455000.0,457500.0,435000.0,451300.0,2557500.0,,\nQQQ,19990519,1086900.0,1095000.0,1070000.0,1095000.0,3853700.0,0.0,0.0\nSPY,19990520,454400.0,457500.0,425000.0,425600.0,3574600.0,,\nQQQ,19990520,1099800.0,1099800.0,1067500.0,1067500.0,2876500.0,0.0,0.0\nSPY,19990521,430000.0,443100.0,418800.0,438800.0,4227900.0,,\nQQQ,19990521,1070600.0,1073800.0,1051900.0,1055600.0,5718400.0,0.0,0.0\nSPY,19990524,436300.0,443100.0,418800.0,420000.0,2264500.0,,\nQQQ,19990524,1059400.0,1085000.0,1023800.0,1028100.0,4758700.0,0.0,0.0\nSPY,19990525,415600.0,424400.0,409400.0,414400.0,3237700.0,,\nQQQ,19990525,1029400.0,1044400.0,992500.0,997500.0,8078400.0,0.0,0.0\nSPY,19990526,417500.0,443800.0,360000.0,440000.0,3732300.0,,\nQQQ,19990526,1010000.0,1023800.0,978800.0,1023800.0,13137100.0,0.0,0.0\nSPY,19990527,431900.0,437500.0,426900.0,435600.0,3864200.0,,\nQQQ,19990527,1020600.0,1038600.0,1005000.0,1022700.0,12089300.0,0.0,0.0\nSPY,19990528,433100.0,443100.0,431300.0,440000.0,1693800.0,,\nQQQ,19990528,1030000.0,1046300.0,1016900.0,1041300.0,6397800.0,0.0,0.0\nSPY,19990601,450000.0,453100.0,443800.0,448100.0,4000400.0,,\nQQQ,19990601,1038800.0,1043800.0,1011900.0,1015000.0,3396800.0,0.0,0.0\nSPY,19990602,445000.0,479400.0,440000.0,465600.0,4564200.0,,\nQQQ,19990602,1016900.0,1040000.0,991400.0,1035600.0,5931100.0,0.0,0.0\nSPY,19990603,468800.0,480000.0,468100.0,474400.0,4060200.0,,\nQQQ,19990603,1042500.0,1042500.0,1013800.0,1017500.0,6057600.0,0.0,0.0\nSPY,19990604,476300.0,481900.0,472500.0,481300.0,3122600.0,,\nQQQ,19990604,1027500.0,1054400.0,1027500.0,1054400.0,6895500.0,0.0,0.0\nSPY,19990607,481300.0,490000.0,475000.0,488100.0,3672700.0,,\nQQQ,19990607,1058600.0,1079800.0,1056300.0,1075000.0,5692600.0,0.0,0.0\nSPY,19990608,487500.0,488100.0,475600.0,476300.0,2685300.0,,\nQQQ,19990608,1075600.0,1080600.0,1040800.0,1045000.0,4001000.0,0.0,0.0\nSPY,19990609,474400.0,485000.0,471900.0,484400.0,3131000.0,,\nQQQ,19990609,1050000.0,1066300.0,1049400.0,1065600.0,4129400.0,0.0,0.0\nSPY,19990610,478800.0,482500.0,473100.0,481300.0,2687900.0,,\nQQQ,19990610,1052500.0,1058800.0,1038900.0,1049400.0,4558600.0,0.0,0.0\nSPY,19990611,481300.0,485000.0,462500.0,465000.0,1569700.0,,\nQQQ,19990611,1058800.0,1059800.0,1026300.0,1033100.0,8281900.0,0.0,0.0\nSPY,19990614,465000.0,467500.0,451300.0,454400.0,1373900.0,,\nQQQ,19990614,1039400.0,1039400.0,1013800.0,1016300.0,7044100.0,0.0,0.0\nSPY,19990615,451900.0,467500.0,451300.0,459400.0,1091200.0,,\nQQQ,19990615,1018600.0,1037300.0,1015600.0,1027500.0,4454500.0,0.0,0.0\nSPY,19990616,463800.0,480600.0,463800.0,478800.0,1917700.0,,\nQQQ,19990616,1056900.0,1083100.0,1055600.0,1082500.0,7494700.0,0.0,0.0\nSPY,19990617,476300.0,480000.0,457500.0,463800.0,1920100.0,,\nQQQ,19990617,1070000.0,1101300.0,1070000.0,1092700.0,7839200.0,0.0,0.0\nSPY,19990618,453800.0,472500.0,451900.0,471300.0,1609200.0,,\nQQQ,19990618,1086300.0,1104400.0,1084400.0,1100600.0,2612700.0,0.0,0.0\nSPY,19990621,470000.0,472500.0,460000.0,465000.0,1166000.0,,\nQQQ,19990621,1108800.0,1134400.0,1106900.0,1134400.0,5339700.0,0.0,0.0\nSPY,19990622,463100.0,469400.0,453800.0,454400.0,1259600.0,,\nQQQ,19990622,1127500.0,1141900.0,1103800.0,1103800.0,5362100.0,0.0,0.0\nSPY,19990623,450600.0,450900.0,435600.0,436900.0,4667200.0,,\nQQQ,19990623,1100200.0,1120000.0,1093100.0,1118100.0,4767000.0,0.0,0.0\nSPY,19990624,436300.0,436300.0,422500.0,422500.0,3783100.0,,\nQQQ,19990624,1116900.0,1117500.0,1090000.0,1092500.0,7404000.0,0.0,0.0\nSPY,19990625,425000.0,426900.0,420600.0,421300.0,2409700.0,,\nQQQ,19990625,1102500.0,1111300.0,1059100.0,1091300.0,4267900.0,0.0,0.0\nSPY,19990628,424400.0,429400.0,423800.0,425600.0,2291200.0,,\nQQQ,19990628,1103100.0,1119400.0,1094100.0,1118800.0,3660400.0,0.0,0.0\nSPY,19990629,427200.0,455600.0,426300.0,453800.0,3185000.0,,\nQQQ,19990629,1118800.0,1139400.0,1113100.0,1137500.0,4435900.0,0.0,0.0\nSPY,19990630,456900.0,469400.0,449400.0,463100.0,2799700.0,,\nQQQ,19990630,1136100.0,1200000.0,1122700.0,1151300.0,10196900.0,0.0,0.0\nSPY,19990701,463100.0,465600.0,452500.0,452500.0,1281400.0,,\nQQQ,19990701,1156300.0,1166900.0,1128800.0,1159400.0,3648400.0,0.0,0.0\nSPY,19990702,455300.0,468800.0,451900.0,463100.0,1037600.0,,\nQQQ,19990702,1160000.0,1173100.0,1160000.0,1172500.0,1588400.0,0.0,0.0\nSPY,19990706,459400.0,476300.0,458100.0,473400.0,3948300.0,,\nQQQ,19990706,1181300.0,1193100.0,1161300.0,1162500.0,4112000.0,0.0,0.0\nSPY,19990707,473800.0,507500.0,470000.0,499400.0,9673400.0,,\nQQQ,19990707,1166900.0,1174400.0,1158800.0,1172300.0,5181200.0,0.0,0.0\nSPY,19990708,511300.0,550600.0,508800.0,545000.0,14620700.0,,\nQQQ,19990708,1169400.0,1189800.0,1163800.0,1186900.0,5414300.0,0.0,0.0\nSPY,19990709,545000.0,560000.0,530000.0,556300.0,5279400.0,,\nQQQ,19990709,1189400.0,1197500.0,1180600.0,1196300.0,2028200.0,0.0,0.0\nSPY,19990712,555000.0,556300.0,541900.0,544400.0,2640200.0,,\nQQQ,19990712,1201300.0,1207500.0,1183800.0,1193100.0,3933800.0,0.0,0.0\nSPY,19990713,535000.0,541900.0,528800.0,536300.0,2580100.0,,\nQQQ,19990713,1185000.0,1189400.0,1175600.0,1186300.0,3033400.0,0.0,0.0\nSPY,19990714,545000.0,566300.0,545000.0,559400.0,5218000.0,,\nQQQ,19990714,1196900.0,1207500.0,1180000.0,1205000.0,3358500.0,0.0,0.0\nSPY,19990715,558800.0,559400.0,513100.0,535000.0,15262600.0,,\nQQQ,19990715,1209400.0,1219800.0,1202700.0,1215600.0,3210000.0,0.0,0.0\nSPY,19990716,536300.0,545000.0,530000.0,530600.0,3642200.0,,\nQQQ,19990716,1216900.0,1234400.0,1216400.0,1228800.0,2354600.0,0.0,0.0\nSPY,19990719,539400.0,558100.0,523100.0,543800.0,4899000.0,,\nQQQ,19990719,1232500.0,1232500.0,1210200.0,1212500.0,3365700.0,0.0,0.0\nSPY,19990720,545600.0,555000.0,527500.0,528100.0,3897700.0,,\nQQQ,19990720,1200200.0,1201900.0,1165000.0,1166900.0,7305500.0,0.0,0.0\nSPY,19990721,541300.0,554400.0,528800.0,540600.0,6362500.0,,\nQQQ,19990721,1170600.0,1183900.0,1161300.0,1177500.0,5386300.0,0.0,0.0\nSPY,19990722,536300.0,538800.0,511300.0,523800.0,3539900.0,,\nQQQ,19990722,1173800.0,1173800.0,1140600.0,1140600.0,7564900.0,0.0,0.0\nSPY,19990723,528100.0,537500.0,526900.0,532500.0,1993500.0,,\nQQQ,19990723,1152500.0,1157300.0,1133800.0,1150000.0,6008800.0,0.0,0.0\nSPY,19990726,528800.0,536300.0,508800.0,508800.0,3040500.0,,\nQQQ,19990726,1130000.0,1142500.0,1115600.0,1118800.0,5321900.0,0.0,0.0\nSPY,19990727,526300.0,539400.0,525000.0,537500.0,3451400.0,,\nQQQ,19990727,1140000.0,1157500.0,1130300.0,1151300.0,6724800.0,0.0,0.0\nSPY,19990728,538800.0,555000.0,530000.0,543100.0,2894800.0,,\nQQQ,19990728,1153800.0,1168800.0,1138900.0,1166300.0,4888000.0,0.0,0.0\nSPY,19990729,533800.0,552500.0,529400.0,539400.0,2369400.0,,\nQQQ,19990729,1140600.0,1150000.0,1125000.0,1133800.0,6429000.0,0.0,0.0\nSPY,19990730,545000.0,580000.0,545000.0,557500.0,3372700.0,,\nQQQ,19990730,1142500.0,1155000.0,1132500.0,1133800.0,5127400.0,0.0,0.0\nSPY,19990802,556300.0,580000.0,555000.0,557500.0,3198200.0,,\nQQQ,19990802,1133800.0,1156300.0,1124400.0,1128800.0,4911000.0,0.0,0.0\nSPY,19990803,567500.0,574400.0,536300.0,550600.0,3306400.0,,\nQQQ,19990803,1144200.0,1144400.0,1105000.0,1118300.0,6403800.0,0.0,0.0\nSPY,19990804,551900.0,558800.0,532500.0,537500.0,3170300.0,,\nQQQ,19990804,1121400.0,1129800.0,1100200.0,1100600.0,6658400.0,0.0,0.0\nSPY,19990805,535000.0,549400.0,521300.0,547500.0,2849600.0,,\nQQQ,19990805,1101300.0,1121300.0,1075000.0,1115500.0,9478800.0,0.0,0.0\nSPY,19990806,540600.0,553100.0,523800.0,541900.0,3922000.0,,\nQQQ,19990806,1110600.0,1131300.0,1098800.0,1105000.0,6137900.0,0.0,0.0\nSPY,19990809,543400.0,551900.0,542500.0,543800.0,2052100.0,,\nQQQ,19990809,1110600.0,1113800.0,1090200.0,1091900.0,4033800.0,0.0,0.0\nSPY,19990810,540000.0,560000.0,536300.0,552500.0,3672500.0,,\nQQQ,19990810,1089400.0,1099400.0,1058800.0,1081300.0,8231100.0,0.0,0.0\nSPY,19990811,560000.0,597500.0,559400.0,596900.0,7444200.0,,\nQQQ,19990811,1101900.0,1120000.0,1085300.0,1118100.0,6496300.0,0.0,0.0\nSPY,19990812,590600.0,613800.0,586300.0,600000.0,5564900.0,,\nQQQ,19990812,1122500.0,1130000.0,1103800.0,1105000.0,6105300.0,0.0,0.0\nSPY,19990813,606300.0,620000.0,598800.0,600600.0,2650100.0,,\nQQQ,19990813,1128100.0,1154400.0,1126300.0,1153600.0,7546200.0,0.0,0.0\nSPY,19990816,598100.0,606900.0,595000.0,604400.0,2379500.0,,\nQQQ,19990816,1152500.0,1166300.0,1144400.0,1156900.0,5652600.0,0.0,0.0\nSPY,19990817,603100.0,603800.0,589400.0,603000.0,3102700.0,,\nQQQ,19990817,1172500.0,1173800.0,1146900.0,1168100.0,5852800.0,0.0,0.0\nSPY,19990818,600600.0,620000.0,596300.0,601300.0,3821500.0,,\nQQQ,19990818,1162500.0,1176900.0,1150600.0,1160600.0,3426300.0,0.0,0.0\nSPY,19990819,598100.0,605000.0,585600.0,587500.0,4765600.0,,\nQQQ,19990819,1144400.0,1152500.0,1133900.0,1140600.0,5003200.0,0.0,0.0\nSPY,19990820,592500.0,596300.0,566300.0,591300.0,2896500.0,,\nQQQ,19990820,1142500.0,1155000.0,1136300.0,1154800.0,3235700.0,0.0,0.0\nSPY,19990823,593800.0,613800.0,593100.0,607500.0,3113800.0,,\nQQQ,19990823,1170000.0,1193100.0,1167300.0,1191300.0,4719400.0,0.0,0.0\nSPY,19990824,603800.0,607500.0,599400.0,603800.0,4227600.0,,\nQQQ,19990824,1187500.0,1271900.0,1185200.0,1202500.0,6837000.0,0.0,0.0\nSPY,19990825,606900.0,615000.0,601300.0,613800.0,2610400.0,,\nQQQ,19990825,1211900.0,1235000.0,1198800.0,1231100.0,5692900.0,0.0,0.0\nSPY,19990826,611300.0,631300.0,611300.0,621300.0,3566300.0,,\nQQQ,19990826,1230000.0,1234400.0,1208100.0,1210000.0,4954800.0,0.0,0.0\nSPY,19990827,627500.0,726900.0,626900.0,646900.0,4012600.0,,\nQQQ,19990827,1218600.0,1218800.0,1194400.0,1201900.0,4702300.0,0.0,0.0\nSPY,19990830,650000.0,650000.0,620000.0,620000.0,2908200.0,,\nQQQ,19990830,1202500.0,1206300.0,1177500.0,1179500.0,4907200.0,0.0,0.0\nSPY,19990831,625900.0,660000.0,620600.0,651300.0,5522900.0,,\nQQQ,19990831,1188800.0,1201300.0,1162500.0,1195600.0,7425600.0,0.0,0.0\nSPY,19990901,670000.0,688100.0,660000.0,687500.0,6657100.0,,\nQQQ,19990901,1201300.0,1212500.0,1193800.0,1200000.0,5194400.0,0.0,0.0\nSPY,19990902,676300.0,714400.0,668800.0,706300.0,7588400.0,,\nQQQ,19990902,1180000.0,1204400.0,1177500.0,1196300.0,7232900.0,0.0,0.0\nSPY,19990903,719400.0,752500.0,700600.0,735000.0,14515400.0,,\nQQQ,19990903,1232500.0,1253100.0,1228100.0,1251100.0,6898000.0,0.0,0.0\nSPY,19990907,737500.0,779400.0,735000.0,763800.0,8841500.0,,\nQQQ,19990907,1250600.0,1263800.0,1240000.0,1246900.0,4395100.0,0.0,0.0\nSPY,19990908,761900.0,776900.0,745000.0,745000.0,6678600.0,,\nQQQ,19990908,1240000.0,1252500.0,1220600.0,1227000.0,6676700.0,0.0,0.0\nSPY,19990909,755000.0,759400.0,738800.0,755600.0,4620900.0,,\nQQQ,19990909,1231300.0,1251300.0,1223100.0,1249400.0,6333700.0,0.0,0.0\nSPY,19990910,760000.0,776900.0,732500.0,773100.0,3921200.0,,\nQQQ,19990910,1265000.0,1274800.0,1250600.0,1264400.0,5028400.0,0.0,0.0\nSPY,19990913,770600.0,775000.0,748100.0,750600.0,2160900.0,,\nQQQ,19990913,1261300.0,1263800.0,1240600.0,1242500.0,3461400.0,0.0,0.0\nSPY,19990914,747200.0,789400.0,746900.0,778100.0,3422300.0,,\nQQQ,19990914,1242500.0,1263000.0,1240000.0,1256900.0,4738700.0,0.0,0.0\nSPY,19990915,788800.0,791300.0,752500.0,753800.0,3193700.0,,\nQQQ,19990915,1269800.0,1269800.0,1230000.0,1232500.0,7703900.0,0.0,0.0\nSPY,19990916,760600.0,780600.0,738800.0,768100.0,3959400.0,,\nQQQ,19990916,1229400.0,1245000.0,1203900.0,1233800.0,7734800.0,0.0,0.0\nSPY,19990917,773100.0,777500.0,762500.0,769400.0,2315800.0,,\nQQQ,19990917,1240600.0,1266900.0,1238800.0,1266300.0,7225900.0,0.0,0.0\nSPY,19990920,770000.0,801300.0,763800.0,791300.0,3974900.0,,\nQQQ,19990920,1270000.0,1275000.0,1223800.0,1270600.0,3285100.0,0.0,0.0\nSPY,19990921,731900.0,753800.0,690000.0,691900.0,28843000.0,,\nQQQ,19990921,1258100.0,1260600.0,1235200.0,1238800.0,6038000.0,0.0,0.0\nSPY,19990922,697500.0,716300.0,690200.0,702500.0,10023500.0,,\nQQQ,19990922,1240600.0,1272500.0,1225600.0,1253300.0,6175500.0,0.0,0.0\nSPY,19990923,711300.0,712500.0,630000.0,633100.0,10143900.0,,\nQQQ,19990923,1265000.0,1267500.0,1192700.0,1198800.0,9566300.0,0.0,0.0\nSPY,19990924,633800.0,670200.0,630000.0,647500.0,10594300.0,,\nQQQ,19990924,1192500.0,1206300.0,1172500.0,1202500.0,12039300.0,0.0,0.0\nSPY,19990927,663800.0,667500.0,612500.0,613100.0,8382300.0,,\nQQQ,19990927,1218800.0,1227500.0,1207500.0,1208800.0,6130400.0,0.0,0.0\nSPY,19990928,615000.0,620000.0,574400.0,595600.0,12791600.0,,\nQQQ,19990928,1203900.0,1220000.0,1178100.0,1216900.0,10516300.0,0.0,0.0\nSPY,19990929,602500.0,612500.0,580000.0,590600.0,5882700.0,,\nQQQ,19990929,1215600.0,1224400.0,1196300.0,1196400.0,7690200.0,0.0,0.0\nSPY,19990930,595600.0,641900.0,592500.0,633100.0,7934500.0,,\nQQQ,19990930,1202500.0,1216300.0,1187500.0,1202500.0,8963000.0,0.0,0.0\nSPY,19991001,621300.0,630000.0,595000.0,617300.0,5431200.0,,\nQQQ,19991001,1187500.0,1203800.0,1175000.0,1201900.0,9798300.0,0.0,0.0\nSPY,19991004,623100.0,648800.0,623100.0,645000.0,4038600.0,,\nQQQ,19991004,1210600.0,1232500.0,1203800.0,1232500.0,5905500.0,0.0,0.0\nSPY,19991005,656300.0,681300.0,647500.0,678800.0,7288900.0,,\nQQQ,19991005,1235600.0,1255000.0,1213800.0,1237500.0,9692000.0,0.0,0.0\nSPY,19991006,693800.0,696300.0,670000.0,671300.0,7193400.0,,\nQQQ,19991006,1247500.0,1266700.0,1228600.0,1260300.0,9816200.0,0.0,0.0\nSPY,19991007,684400.0,686300.0,648800.0,663800.0,5284500.0,,\nQQQ,19991007,1271900.0,1278000.0,1252500.0,1263800.0,10628300.0,0.0,0.0\nSPY,19991008,661900.0,670600.0,635000.0,655000.0,3568000.0,,\nQQQ,19991008,1256900.0,1278800.0,1240000.0,1275000.0,11421500.0,0.0,0.0\nSPY,19991011,660000.0,682500.0,660000.0,668800.0,2249100.0,,\nQQQ,19991011,1278800.0,1298100.0,1275600.0,1288100.0,6798500.0,0.0,0.0\nSPY,19991012,678800.0,700000.0,670000.0,676300.0,5030900.0,,\nQQQ,19991012,1288800.0,1299100.0,1260000.0,1265000.0,10409100.0,0.0,0.0\nSPY,19991013,666300.0,695000.0,637500.0,640000.0,5472100.0,,\nQQQ,19991013,1249400.0,1264400.0,1221300.0,1228800.0,11135000.0,0.0,0.0\nSPY,19991014,692500.0,733100.0,690000.0,731300.0,16528100.0,,\nQQQ,19991014,1230600.0,1242500.0,1210600.0,1234200.0,11078800.0,0.0,0.0\nSPY,19991015,711300.0,758100.0,701900.0,745600.0,10489200.0,,\nQQQ,19991015,1202500.0,1220000.0,1190200.0,1199400.0,15669200.0,0.0,0.0\nSPY,19991018,738800.0,742500.0,711300.0,731900.0,6959000.0,,\nQQQ,19991018,1198800.0,1203100.0,1148300.0,1181300.0,12238000.0,0.0,0.0\nSPY,19991019,716300.0,750000.0,684400.0,685000.0,8823600.0,,\nQQQ,19991019,1195200.0,1210000.0,1168800.0,1180000.0,13276200.0,0.0,0.0\nSPY,19991020,700000.0,757500.0,700000.0,750600.0,9425400.0,,\nQQQ,19991020,1206900.0,1232300.0,1187500.0,1231900.0,10182300.0,0.0,0.0\nSPY,19991021,723800.0,770600.0,723800.0,761300.0,7083700.0,,\nQQQ,19991021,1205000.0,1242500.0,1196300.0,1239400.0,10852900.0,0.0,0.0\nSPY,19991022,771300.0,772500.0,733800.0,738800.0,3681500.0,,\nQQQ,19991022,1252300.0,1265000.0,1235000.0,1241300.0,8120400.0,0.0,0.0\nSPY,19991025,742500.0,761300.0,737500.0,744400.0,2980800.0,,\nQQQ,19991025,1233800.0,1253600.0,1228800.0,1240000.0,6935900.0,0.0,0.0\nSPY,19991026,749400.0,755000.0,733100.0,750600.0,3153600.0,,\nQQQ,19991026,1255000.0,1261900.0,1230600.0,1233100.0,6628800.0,0.0,0.0\nSPY,19991027,743800.0,766300.0,734400.0,763800.0,3924600.0,,\nQQQ,19991027,1226900.0,1232500.0,1208900.0,1229800.0,7492800.0,0.0,0.0\nSPY,19991028,770600.0,790000.0,760600.0,778100.0,4455600.0,,\nQQQ,19991028,1247500.0,1269400.0,1232500.0,1268800.0,6651100.0,0.0,0.0\nSPY,19991029,788100.0,810600.0,788100.0,801300.0,4622700.0,,\nQQQ,19991029,1300000.0,1325000.0,1295600.0,1316300.0,10257800.0,0.0,0.0\nSPY,19991101,800000.0,806900.0,773800.0,776900.0,2440700.0,,\nQQQ,19991101,1315000.0,1330600.0,1308800.0,1309400.0,4754100.0,0.0,0.0\nSPY,19991102,780000.0,816900.0,772500.0,802500.0,3572100.0,,\nQQQ,19991102,1315000.0,1331300.0,1300000.0,1310200.0,6375000.0,0.0,0.0\nSPY,19991103,816300.0,832500.0,802500.0,814400.0,2923500.0,,\nQQQ,19991103,1327500.0,1342500.0,1321900.0,1333800.0,9305600.0,0.0,0.0\nSPY,19991104,820600.0,853800.0,805000.0,836900.0,3385600.0,,\nQQQ,19991104,1353600.0,1356300.0,1335600.0,1349400.0,10234000.0,0.0,0.0\nSPY,19991105,846300.0,883800.0,840000.0,882500.0,3650100.0,,\nQQQ,19991105,1377500.0,1384400.0,1363800.0,1377500.0,7248200.0,0.0,0.0\nSPY,19991108,877500.0,977300.0,867500.0,963100.0,8403900.0,,\nQQQ,19991108,1368800.0,1396100.0,1316300.0,1391900.0,5312300.0,0.0,0.0\nSPY,19991109,943800.0,945000.0,880000.0,895600.0,7113100.0,,\nQQQ,19991109,1402500.0,1405000.0,1367500.0,1378100.0,7191700.0,0.0,0.0\nSPY,19991110,881900.0,932500.0,881300.0,911900.0,5252700.0,,\nQQQ,19991110,1382500.0,1411900.0,1325600.0,1395200.0,8195400.0,0.0,0.0\nSPY,19991111,915900.0,926300.0,898800.0,921900.0,2323000.0,,\nQQQ,19991111,1415000.0,1426900.0,1402500.0,1423800.0,9551700.0,0.0,0.0\nSPY,19991112,919400.0,920000.0,873800.0,906300.0,2419000.0,,\nQQQ,19991112,1432500.0,1445000.0,1387500.0,1443800.0,14104300.0,0.0,0.0\nSPY,19991115,896300.0,928800.0,885000.0,894400.0,2292900.0,,\nQQQ,19991115,1445000.0,1458800.0,1433800.0,1439400.0,5314500.0,0.0,0.0\nSPY,19991116,900000.0,917500.0,885000.0,912500.0,1899300.0,,\nQQQ,19991116,1446300.0,1481900.0,1437500.0,1481300.0,9597900.0,0.0,0.0\nSPY,19991117,906900.0,947500.0,900000.0,903800.0,3229500.0,,\nQQQ,19991117,1477500.0,1483900.0,1450000.0,1456900.0,12567600.0,0.0,0.0\nSPY,19991118,910600.0,911300.0,884400.0,895600.0,3079400.0,,\nQQQ,19991118,1467500.0,1500000.0,1423800.0,1498100.0,8782900.0,0.0,0.0\nSPY,19991119,895000.0,928800.0,880600.0,923800.0,2766300.0,,\nQQQ,19991119,1495600.0,1518100.0,1403100.0,1511300.0,8673300.0,0.0,0.0\nSPY,19991122,917500.0,917500.0,892500.0,905600.0,1746200.0,,\nQQQ,19991122,1518800.0,1528800.0,1502500.0,1522500.0,9348100.0,0.0,0.0\nSPY,19991123,917500.0,952500.0,885000.0,930300.0,4671200.0,,\nQQQ,19991123,1528800.0,1530000.0,1485000.0,1498100.0,11988200.0,0.0,0.0\nSPY,19991124,930000.0,950000.0,916900.0,947500.0,1862500.0,,\nQQQ,19991124,1503800.0,1551300.0,1488100.0,1548800.0,9162800.0,0.0,0.0\nSPY,19991126,947500.0,955000.0,941300.0,948100.0,1186700.0,,\nQQQ,19991126,1568100.0,1575600.0,1547500.0,1553800.0,4086900.0,0.0,0.0\nSPY,19991129,942500.0,997500.0,932500.0,945000.0,4070400.0,,\nQQQ,19991129,1550600.0,1563800.0,1530000.0,1531400.0,9801500.0,0.0,0.0\nSPY,19991130,981300.0,1037500.0,973800.0,978300.0,7313000.0,,\nQQQ,19991130,1531300.0,1533800.0,1480000.0,1483800.0,11648800.0,0.0,0.0\nSPY,19991201,1010000.0,1045000.0,1000600.0,1030000.0,5469000.0,,\nQQQ,19991201,1486300.0,1509400.0,1475000.0,1496300.0,11521200.0,0.0,0.0\nSPY,19991202,1031300.0,1106300.0,1017500.0,1101900.0,4942700.0,,\nQQQ,19991202,1507500.0,1552500.0,1506600.0,1551300.0,8178900.0,0.0,0.0\nSPY,19991203,1121900.0,1155600.0,1118800.0,1150000.0,5746500.0,,\nQQQ,19991203,1586300.0,1603800.0,1576300.0,1585000.0,10523700.0,0.0,0.0\nSPY,19991206,1145600.0,1173100.0,1114400.0,1160600.0,4146500.0,,\nQQQ,19991206,1588600.0,1610000.0,1573800.0,1595600.0,8245400.0,0.0,0.0\nSPY,19991207,1165600.0,1180000.0,1140000.0,1178100.0,3845900.0,,\nQQQ,19991207,1601900.0,1614400.0,1546900.0,1603000.0,11465100.0,0.0,0.0\nSPY,19991208,1160000.0,1178800.0,1095000.0,1101300.0,3647200.0,,\nQQQ,19991208,1597300.0,1609800.0,1577500.0,1580000.0,9651100.0,0.0,0.0\nSPY,19991209,1110000.0,1110000.0,990000.0,1052500.0,7442000.0,,\nQQQ,19991209,1600000.0,1608800.0,1545000.0,1580000.0,14046400.0,0.0,0.0\nSPY,19991210,1053100.0,1092500.0,990000.0,1030000.0,5631000.0,,\nQQQ,19991210,1598100.0,1603800.0,1562500.0,1596400.0,9910300.0,0.0,0.0\nSPY,19991213,1023900.0,1025000.0,989400.0,990000.0,4871000.0,,\nQQQ,19991213,1592700.0,1626700.0,1585600.0,1620000.0,7949800.0,0.0,0.0\nSPY,19991214,983800.0,997500.0,947500.0,949400.0,3815400.0,,\nQQQ,19991214,1615000.0,1624400.0,1580000.0,1581300.0,13754100.0,0.0,0.0\nSPY,19991215,932500.0,972500.0,910600.0,970000.0,5437500.0,,\nQQQ,19991215,1572500.0,1618800.0,1558800.0,1618600.0,15983600.0,0.0,0.0\nSPY,19991216,980000.0,983800.0,940000.0,982500.0,4035400.0,,\nQQQ,19991216,1642500.0,1665000.0,1630000.0,1663100.0,13345400.0,0.0,0.0\nSPY,19991217,1008800.0,1020000.0,985000.0,999400.0,3894800.0,,\nQQQ,19991217,1690000.0,1697500.0,1668600.0,1677500.0,11985300.0,0.0,0.0\nSPY,19991220,995600.0,1031300.0,966300.0,981300.0,2385700.0,,\nQQQ,19991220,1688100.0,1705000.0,1673800.0,1693100.0,7663000.0,0.0,0.0\nSPY,19991221,982500.0,1030600.0,979400.0,1021900.0,2648300.0,,\nQQQ,19991221,1702500.0,1765000.0,1692800.0,1760000.0,13193900.0,0.0,0.0\nSPY,19991222,1028800.0,1045600.0,987500.0,998800.0,2898100.0,,\nQQQ,19991222,1783800.0,1786300.0,1748800.0,1780000.0,11021900.0,0.0,0.0\nSPY,19991223,1018100.0,1042500.0,1010600.0,1033800.0,1998100.0,,\nQQQ,19991223,1797300.0,1815000.0,1780000.0,1790000.0,8666100.0,0.0,0.0\nSPY,19991227,1043800.0,1044400.0,992500.0,992500.0,1437300.0,,\nQQQ,19991227,1806300.0,1871400.0,1758100.0,1797500.0,9306000.0,0.0,0.0\nSPY,19991228,991300.0,996300.0,950000.0,981400.0,2182500.0,,\nQQQ,19991228,1795000.0,1810000.0,1771300.0,1787500.0,7502000.0,0.0,0.0\nSPY,19991229,968100.0,1021900.0,955000.0,1006900.0,2487600.0,,\nQQQ,19991229,1800000.0,1840000.0,1797500.0,1840000.0,8094300.0,0.0,0.0\nSPY,19991230,1021900.0,1041300.0,996300.0,1003100.0,1820900.0,,\nQQQ,19991230,1872500.0,1878800.0,1837500.0,1841900.0,10786900.0,0.0,0.0\nSPY,19991231,1009400.0,1030000.0,995000.0,1027500.0,1454700.0,,\nQQQ,19991231,1852500.0,1863800.0,1827500.0,1841900.0,7459900.0,0.0,0.0\nSPY,20000103,1048800.0,1125000.0,1016900.0,1120000.0,4739900.0,,\nQQQ,20000103,1923800.0,1923800.0,1800000.0,1895000.0,18066500.0,0.0,0.0\nSPY,20000104,1082500.0,1106300.0,1011900.0,1026300.0,4456000.0,,\nQQQ,20000104,1840000.0,1987500.0,1770000.0,1776300.0,16670600.0,0.0,0.0\nSPY,20000105,1037500.0,1105600.0,1030000.0,1040600.0,6887200.0,,\nQQQ,20000105,1750000.0,1800600.0,1685000.0,1748800.0,20743200.0,0.0,0.0\nSPY,20000106,1061300.0,1070000.0,950000.0,950200.0,6908500.0,,\nQQQ,20000106,1737500.0,1760000.0,1660000.0,1671300.0,17081700.0,0.0,0.0\nSPY,20000107,965000.0,1010000.0,955000.0,993800.0,3963100.0,,\nQQQ,20000107,1658800.0,1768800.0,1407200.0,1768800.0,13512600.0,0.0,0.0\nSPY,20000110,1020000.0,1022500.0,947500.0,978000.0,4361100.0,,\nQQQ,20000110,1820000.0,1878800.0,1798800.0,1849400.0,15021600.0,0.0,0.0\nSPY,20000111,959400.0,993800.0,905000.0,927500.0,3884900.0,,\nQQQ,20000111,1835000.0,1857500.0,1752500.0,1765600.0,15716800.0,0.0,0.0\nSPY,20000112,950000.0,955000.0,865000.0,872500.0,8718300.0,,\nQQQ,20000112,1780000.0,1784800.0,1719400.0,1738800.0,14226600.0,0.0,0.0\nSPY,20000113,944800.0,987500.0,925000.0,968100.0,8542800.0,,\nQQQ,20000113,1770000.0,1806300.0,1741600.0,1802500.0,12478700.0,0.0,0.0\nSPY,20000114,1000000.0,1022500.0,993800.0,1004400.0,3403100.0,,\nQQQ,20000114,1860000.0,1872500.0,1840000.0,1850000.0,10868800.0,0.0,0.0\nSPY,20000118,1010000.0,1060000.0,1001900.0,1040000.0,3833700.0,,\nQQQ,20000118,1841300.0,1888800.0,1828800.0,1877500.0,8253500.0,0.0,0.0\nSPY,20000119,1056300.0,1087500.0,1033800.0,1064400.0,5130800.0,,\nQQQ,20000119,1869800.0,1902500.0,1847500.0,1895000.0,9183000.0,0.0,0.0\nSPY,20000120,1155000.0,1215000.0,1135000.0,1135000.0,16018000.0,,\nQQQ,20000120,1910000.0,1937500.0,1880200.0,1916100.0,13148800.0,0.0,0.0\nSPY,20000121,1142500.0,1142500.0,1101900.0,1113000.0,4257000.0,,\nQQQ,20000121,1930000.0,1931300.0,1900000.0,1921300.0,9353200.0,0.0,0.0\nSPY,20000124,1084400.0,1127500.0,1051300.0,1062500.0,3796200.0,,\nQQQ,20000124,1948800.0,1952500.0,1827500.0,1831300.0,13799400.0,0.0,0.0\nSPY,20000125,1050000.0,1131300.0,1023800.0,1122500.0,4380500.0,,\nQQQ,20000125,1837500.0,1877500.0,1788100.0,1872500.0,16310600.0,0.0,0.0\nSPY,20000126,1100000.0,1141900.0,1097500.0,1101300.0,3144500.0,,\nQQQ,20000126,1865000.0,1866300.0,1805000.0,1809800.0,11354400.0,0.0,0.0\nSPY,20000127,1088100.0,1130000.0,1070000.0,1100500.0,2948700.0,,\nQQQ,20000127,1835000.0,1975000.0,1752500.0,1799400.0,15128800.0,0.0,0.0\nSPY,20000128,1081900.0,1108800.0,1006300.0,1016900.0,3686600.0,,\nQQQ,20000128,1800000.0,1809400.0,1662500.0,1722500.0,17975900.0,0.0,0.0\nSPY,20000131,1010000.0,1037500.0,945000.0,1036900.0,6061100.0,,\nQQQ,20000131,1717500.0,1782500.0,1670000.0,1780000.0,18619500.0,0.0,0.0\nSPY,20000201,1040000.0,1050000.0,1000000.0,1002500.0,2673800.0,,\nQQQ,20000201,1790600.0,1850000.0,1768800.0,1843100.0,13023900.0,0.0,0.0\nSPY,20000202,1007500.0,1021300.0,970000.0,987500.0,4145600.0,,\nQQQ,20000202,1845000.0,1894400.0,1840800.0,1858800.0,13146500.0,0.0,0.0\nSPY,20000203,1003100.0,1042500.0,1002500.0,1033100.0,4198700.0,,\nQQQ,20000203,1886300.0,1928800.0,1845600.0,1922500.0,14924200.0,0.0,0.0\nSPY,20000204,1039400.0,1100000.0,1005600.0,1079500.0,3884300.0,,\nQQQ,20000204,1940000.0,1965000.0,1924400.0,1935000.0,13038900.0,0.0,0.0\nSPY,20000207,1080000.0,1198100.0,1059400.0,1140000.0,3861300.0,,\nQQQ,20000207,1945000.0,1965000.0,1925000.0,1965000.0,8646300.0,0.0,0.0\nSPY,20000208,1140000.0,1161300.0,1112500.0,1148800.0,3544900.0,,\nQQQ,20000208,1987500.0,2028100.0,1987500.0,2028100.0,10733000.0,0.0,0.0\nSPY,20000209,1141300.0,1171300.0,1100000.0,1126300.0,2573300.0,,\nQQQ,20000209,2041300.0,2043900.0,1987500.0,1987500.0,13380600.0,0.0,0.0\nSPY,20000210,1128800.0,1138800.0,1080000.0,1135600.0,2658700.0,,\nQQQ,20000210,1996300.0,2043100.0,1971100.0,2040600.0,13353800.0,0.0,0.0\nSPY,20000211,1136300.0,1141300.0,1082500.0,1087200.0,1804700.0,,\nQQQ,20000211,2041300.0,2041300.0,1960000.0,1984400.0,12099500.0,0.0,0.0\nSPY,20000214,1093100.0,1158800.0,1086300.0,1158100.0,3125200.0,,\nQQQ,20000214,1999800.0,2000000.0,1955000.0,1990000.0,11324600.0,0.0,0.0\nSPY,20000215,1152500.0,1199400.0,1151900.0,1190000.0,4288900.0,,\nQQQ,20000215,1978800.0,2012500.0,1917500.0,1996900.0,15458400.0,0.0,0.0\nSPY,20000216,1177500.0,1181300.0,1121300.0,1139400.0,3265200.0,,\nQQQ,20000216,1998100.0,2035000.0,1898100.0,1995200.0,13354700.0,0.0,0.0\nSPY,20000217,1151900.0,1155000.0,1131300.0,1148800.0,2518100.0,,\nQQQ,20000217,2023800.0,2065000.0,1992500.0,2062500.0,14979000.0,0.0,0.0\nSPY,20000218,1146300.0,1153800.0,1108800.0,1113100.0,1922100.0,,\nQQQ,20000218,2052500.0,2060000.0,1968800.0,1982500.0,12092400.0,0.0,0.0\nSPY,20000222,1101300.0,1169400.0,1066900.0,1140000.0,3713000.0,,\nQQQ,20000222,1980000.0,1998800.0,1925000.0,1977000.0,18573100.0,0.0,0.0\nSPY,20000223,1132300.0,1190000.0,1110000.0,1162500.0,4340500.0,,\nQQQ,20000223,1993600.0,2100000.0,1983100.0,2084500.0,15665300.0,0.0,0.0\nSPY,20000224,1173100.0,1191300.0,1117500.0,1152500.0,3299300.0,,\nQQQ,20000224,2097500.0,2130000.0,2040000.0,2121400.0,24323400.0,0.0,0.0\nSPY,20000225,1148100.0,1170000.0,1101300.0,1103800.0,2099100.0,,\nQQQ,20000225,2123800.0,2150000.0,2077500.0,2087500.0,16356100.0,0.0,0.0\nSPY,20000228,1101300.0,1150000.0,1083800.0,1132000.0,2857600.0,,\nQQQ,20000228,2065000.0,2113800.0,2010000.0,2073800.0,19028600.0,0.0,0.0\nSPY,20000229,1135600.0,1172500.0,1125600.0,1146400.0,3112000.0,,\nQQQ,20000229,2115000.0,2135000.0,2098800.0,2131900.0,11887000.0,0.0,0.0\nSPY,20000301,1185600.0,1320600.0,1185000.0,1303100.0,9505200.0,,\nQQQ,20000301,2145000.0,2171300.0,2130000.0,2151300.0,12171200.0,0.0,0.0\nSPY,20000302,1270000.0,1279400.0,1206900.0,1220000.0,2681800.0,,\nQQQ,20000302,2161300.0,2163800.0,2070000.0,2117500.0,15865100.0,0.0,0.0\nSPY,20000303,1248800.0,1282300.0,1200000.0,1280000.0,2808800.0,,\nQQQ,20000303,2160000.0,2220000.0,2140000.0,2220000.0,15460700.0,0.0,0.0\nSPY,20000306,1260000.0,1291300.0,1250000.0,1255000.0,1828300.0,,\nQQQ,20000306,2235000.0,2264400.0,2205000.0,2229800.0,11745200.0,0.0,0.0\nSPY,20000307,1264400.0,1274400.0,1211300.0,1228800.0,2339000.0,,\nQQQ,20000307,2276300.0,2277500.0,2175000.0,2195000.0,19390800.0,0.9354495394044532,0.9546424190661349\nSPY,20000308,1228800.0,1239400.0,1185600.0,1220000.0,2349700.0,,\nQQQ,20000308,2220000.0,2240000.0,2125600.0,2222300.0,21500300.0,0.9357349793810836,0.9548274433421816\nSPY,20000309,1208800.0,1250000.0,1182500.0,1221900.0,2354700.0,,\nQQQ,20000309,2224400.0,2335200.0,2181900.0,2293800.0,15018800.0,0.9356200705851181,0.9550310356401688\nSPY,20000310,1216900.0,1279400.0,1210000.0,1253100.0,2169800.0,,\nQQQ,20000310,2297500.0,2328800.0,2270200.0,2292500.0,14530700.0,0.9358454316643047,0.9550467831107313\nSPY,20000313,1221300.0,1290600.0,1195000.0,1212500.0,2709300.0,,\nQQQ,20000313,2200000.0,2282500.0,2190600.0,2215000.0,18525700.0,0.9361797504197966,0.9553053124645905\nSPY,20000314,1212300.0,1242500.0,1140000.0,1144400.0,3882200.0,,\nQQQ,20000314,2255000.0,2267500.0,2110000.0,2114400.0,19050900.0,0.9363259139208406,0.9555415244787459\nSPY,20000315,1156300.0,1202500.0,1141300.0,1162300.0,3893600.0,,\nQQQ,20000315,2130000.0,2140000.0,2037500.0,2060000.0,25181900.0,0.9368513594600303,0.9557001239739646\nSPY,20000316,1173100.0,1220000.0,1145000.0,1215600.0,3279700.0,,\nQQQ,20000316,2107500.0,2185000.0,2020000.0,2175000.0,27753800.0,0.9374460185718962,0.9562224313969905\nSPY,20000317,1201300.0,1250000.0,1196300.0,1249400.0,2526500.0,,\nQQQ,20000317,2160000.0,2219800.0,2099400.0,2217300.0,15175600.0,0.9381326834400051,0.9564125257561558\nSPY,20000320,1235000.0,1262500.0,1223800.0,1229400.0,1749300.0,,\nQQQ,20000320,1110000.0,1130000.0,1060800.0,1068100.0,20882300.0,0.9243738585770824,0.9394519584404708\nSPY,20000321,1225600.0,1367500.0,1216300.0,1349400.0,4580700.0,,\nQQQ,20000321,1061300.0,1115000.0,1035600.0,1111900.0,32973700.0,0.9075591129580654,0.9264104380158256\nSPY,20000322,1327800.0,1443800.0,1315600.0,1442000.0,4926900.0,,\nQQQ,20000322,1135000.0,1159700.0,1111300.0,1146400.0,24162100.0,0.888701146494366,0.9153452236647884\nSPY,20000323,1420000.0,1503800.0,1375000.0,1412500.0,4929900.0,,\nQQQ,20000323,1144800.0,1177500.0,1135600.0,1165000.0,18691200.0,0.8722816936473308,0.9056481635278654\nSPY,20000324,1424400.0,1439400.0,1355000.0,1385600.0,3956800.0,,\nQQQ,20000324,1174800.0,1205000.0,1150200.0,1172500.0,21882800.0,0.857394759532944,0.8962851744802203\nSPY,20000327,1376300.0,1447500.0,1368800.0,1395000.0,2483800.0,,\nQQQ,20000327,1180000.0,1195000.0,1171300.0,1176900.0,11821900.0,0.8428257125032722,0.8876074294985282\nSPY,20000328,1372500.0,1420000.0,1371300.0,1391700.0,1730900.0,,\nQQQ,20000328,1169800.0,1178100.0,1145300.0,1149400.0,18001000.0,0.8278069558975685,0.8767145270414161\nSPY,20000329,1393800.0,1394400.0,1338300.0,1358900.0,2104700.0,,\nQQQ,20000329,1153800.0,1154400.0,1100000.0,1100200.0,27132300.0,0.812615065532878,0.8615606060294975\nSPY,20000330,1335600.0,1398800.0,1254400.0,1257500.0,3631200.0,,\nQQQ,20000330,1072500.0,1127500.0,1035000.0,1064400.0,42153000.0,0.8000769554378024,0.8434645364617602\nSPY,20000331,1274400.0,1372500.0,1260000.0,1358100.0,3446200.0,,\nQQQ,20000331,1081400.0,1106300.0,1040000.0,1099800.0,31164500.0,0.7858265986410454,0.8296349009983509\nSPY,20000403,1355000.0,1395000.0,1294400.0,1333800.0,2823800.0,,\nQQQ,20000403,1077700.0,1091300.0,1007500.0,1021900.0,30483400.0,0.7702983852015175,0.809403927151675\nSPY,20000404,1326300.0,1330000.0,1150000.0,1275000.0,5969400.0,,\nQQQ,20000404,1036300.0,1060000.0,883100.0,1010600.0,66719600.0,0.7565459267721806,0.7884335730383908\nSPY,20000405,1264700.0,1328800.0,1240000.0,1302500.0,4017200.0,,\nQQQ,20000405,975000.0,1039400.0,962500.0,1001300.0,36884700.0,0.7420424280903952,0.7680410003606256\nSPY,20000406,1306300.0,1345000.0,1232500.0,1252500.0,2232500.0,,\nQQQ,20000406,1023800.0,1038800.0,997500.0,1018100.0,29610300.0,0.7297682000067613,0.7491590580551547\nSPY,20000407,1272500.0,1318800.0,1250000.0,1317500.0,2063500.0,,\nQQQ,20000407,1041300.0,1070000.0,1026300.0,1070000.0,20359300.0,0.7171389706297099,0.7335323386070329\nSPY,20000410,1316900.0,1327500.0,1247500.0,1250600.0,1756100.0,,\nQQQ,20000410,1076300.0,1076900.0,1000000.0,1000000.0,26572700.0,0.7046553994645385,0.7135252035124692\nSPY,20000411,1235000.0,1248800.0,1180600.0,1193800.0,4812500.0,,\nQQQ,20000411,971300.0,1015000.0,951300.0,975000.0,34431600.0,0.6929512694636889,0.6936245511743541\nSPY,20000412,1190000.0,1190000.0,1048800.0,1091900.0,8289800.0,,\nQQQ,20000412,976300.0,987500.0,905000.0,907500.0,34016500.0,0.6827664688474285,0.6788256976636919\nSPY,20000413,1115000.0,1200000.0,1085000.0,1137500.0,4671200.0,,\nQQQ,20000413,928100.0,965000.0,883600.0,888800.0,46695000.0,0.6707959266626783,0.6616306071936524\nSPY,20000414,1093100.0,1180000.0,1090000.0,1119400.0,5867500.0,,\nQQQ,20000414,860600.0,885000.0,780000.0,802500.0,59724100.0,0.65698447802997,0.6444981315839187\nSPY,20000417,1095000.0,1239400.0,1090600.0,1238100.0,3510300.0,,\nQQQ,20000417,780200.0,880000.0,780000.0,876300.0,55296400.0,0.6416430629468479,0.6234344175891003\nSPY,20000418,1235000.0,1268800.0,1193800.0,1265600.0,3393500.0,,\nQQQ,20000418,894800.0,926300.0,873800.0,925000.0,36234200.0,0.6272949230581968,0.6026759041708637\nSPY,20000419,1261900.0,1302500.0,1197500.0,1211100.0,4260700.0,,\nQQQ,20000419,925000.0,942500.0,891900.0,896900.0,27710800.0,0.614452607487761,0.5847229517916053\nSPY,20000420,1236900.0,1247500.0,1170600.0,1189400.0,5888800.0,,\nQQQ,20000420,903800.0,909700.0,861900.0,873100.0,21119200.0,0.6019412696560683,0.56762722343656\nSPY,20000424,1150000.0,1205000.0,1147500.0,1205000.0,3867200.0,,\nQQQ,20000424,834400.0,850000.0,798800.0,843800.0,30763800.0,0.5887520275458776,0.5511156503753379\nSPY,20000425,1221300.0,1287500.0,1220600.0,1283100.0,3366200.0,,\nQQQ,20000425,865000.0,902500.0,860000.0,901900.0,28058500.0,0.5745605935431621,0.5319945003917735\nSPY,20000426,1266300.0,1280000.0,1200000.0,1210000.0,3222800.0,,\nQQQ,20000426,906300.0,924200.0,872500.0,872500.0,25610400.0,0.5617322733404848,0.5144120901308561\nSPY,20000427,1171900.0,1270000.0,1165800.0,1267500.0,2859700.0,,\nQQQ,20000427,835000.0,975000.0,822500.0,922500.0,36393500.0,0.5484633414166534,0.4947709141873866\nSPY,20000428,1271300.0,1275000.0,1213100.0,1241300.0,2080100.0,,\nQQQ,20000428,935600.0,947500.0,828900.0,942500.0,23397200.0,0.5365821741254131,0.47610140144624746\nSPY,20000501,1248800.0,1251300.0,1218800.0,1243100.0,1966700.0,,\nQQQ,20000501,957500.0,968800.0,942500.0,957500.0,23529300.0,0.525239631610238,0.45784938108856954\nSPY,20000502,1232500.0,1274400.0,1175000.0,1180000.0,2057300.0,,\nQQQ,20000502,948800.0,956300.0,905000.0,905000.0,19892700.0,0.5142892063368476,0.44073775928416814\nSPY,20000503,1189400.0,1212500.0,1116300.0,1147500.0,4258700.0,,\nQQQ,20000503,895000.0,902500.0,855200.0,889400.0,26339900.0,0.5042543469886679,0.4256190282829967\nSPY,20000504,1151300.0,1152500.0,1105600.0,1108800.0,3487000.0,,\nQQQ,20000504,890000.0,907500.0,873800.0,891300.0,16999400.0,0.49486467191019273,0.41209724332039377\nSPY,20000505,1108100.0,1147500.0,1107200.0,1132300.0,2523100.0,,\nQQQ,20000505,881300.0,923100.0,880300.0,920000.0,20170400.0,0.4856616751536129,0.3978409536788384\nSPY,20000508,1120900.0,1136900.0,1100000.0,1101900.0,1621800.0,,\nQQQ,20000508,905000.0,907500.0,880600.0,880600.0,13131400.0,0.4766593757691461,0.3851039151649579\nSPY,20000509,1103100.0,1112500.0,1048800.0,1054400.0,2886800.0,,\nQQQ,20000509,885000.0,891300.0,843100.0,861600.0,19798000.0,0.46877897152032033,0.3741489597235944\nSPY,20000510,1040600.0,1050000.0,987500.0,992500.0,4626700.0,,\nQQQ,20000510,843800.0,923000.0,807500.0,809800.0,33201800.0,0.46199087226210567,0.3666993050701462\nSPY,20000511,1013800.0,1042500.0,990000.0,1028100.0,4396700.0,,\nQQQ,20000511,827500.0,845000.0,808800.0,845000.0,24141600.0,0.45468897586051543,0.35717811476013234\nSPY,20000512,1060000.0,1105000.0,1045000.0,1071300.0,2654700.0,,\nQQQ,20000512,853800.0,875600.0,840000.0,848100.0,17512200.0,0.44620661173937975,0.3457387386729258\nSPY,20000515,1080600.0,1080600.0,1001300.0,1010000.0,5915900.0,,\nQQQ,20000515,848100.0,879400.0,826300.0,879400.0,18046800.0,0.43985176586417596,0.33690706041221946\nSPY,20000516,1045200.0,1090600.0,1027500.0,1061300.0,3862400.0,,\nQQQ,20000516,900000.0,915000.0,880600.0,911300.0,23360000.0,0.4327892561302374,0.3263184199638813\nSPY,20000517,1036300.0,1036900.0,1003800.0,1011300.0,3513300.0,,\nQQQ,20000517,892500.0,905000.0,877500.0,887500.0,19724600.0,0.42671175836493075,0.31772445276313194\nSPY,20000518,1030000.0,1049400.0,1006300.0,1007500.0,3313000.0,,\nQQQ,20000518,890000.0,898800.0,855600.0,856300.0,18813400.0,0.42004861610229605,0.3090387551441781\nSPY,20000519,992500.0,992500.0,933800.0,941900.0,6459000.0,,\nQQQ,20000519,837500.0,850000.0,813100.0,815900.0,27104000.0,0.41434669210509334,0.30366963567976984\nSPY,20000522,937500.0,937500.0,860000.0,900000.0,6794700.0,,\nQQQ,20000522,816300.0,818800.0,755800.0,816300.0,44383800.0,0.40919401332543387,0.2994242069300845\nSPY,20000523,906300.0,933800.0,856300.0,858100.0,4536200.0,,\nQQQ,20000523,813800.0,857800.0,753100.0,757500.0,30734700.0,0.4041900619046817,0.29507604502863605\nSPY,20000524,861900.0,897500.0,830000.0,877500.0,6032900.0,,\nQQQ,20000524,750000.0,800000.0,722500.0,794400.0,49939800.0,0.39948100843131346,0.2916827968308004\nSPY,20000525,885000.0,926600.0,860000.0,872500.0,3681200.0,,\nQQQ,20000525,802500.0,822500.0,765000.0,775600.0,29384200.0,0.3947886981675551,0.2884467572318342\nSPY,20000526,879400.0,898800.0,852500.0,864400.0,1585500.0,,\nQQQ,20000526,777500.0,792500.0,722700.0,775200.0,17858000.0,0.39058231494741336,0.2854322516107559\nSPY,20000530,876300.0,881300.0,817500.0,875800.0,5831100.0,,\nQQQ,20000530,800000.0,852500.0,790000.0,850000.0,31747000.0,0.38627814042438485,0.28174060704046516\nSPY,20000531,868800.0,912500.0,838100.0,840000.0,3757700.0,,\nQQQ,20000531,844700.0,866700.0,827500.0,827500.0,29489300.0,0.3829126059805194,0.27897731022114336\nSPY,20000601,818800.0,895600.0,803800.0,891400.0,7875300.0,,\nQQQ,20000601,851900.0,883800.0,831900.0,876300.0,28593900.0,0.3786518502203941,0.2753877005523081\nSPY,20000602,937500.0,997500.0,890000.0,922500.0,6950400.0,,\nQQQ,20000602,926300.0,1083100.0,825000.0,933800.0,31332700.0,0.3746418999087595,0.2704455844241544\nSPY,20000605,933100.0,952500.0,896900.0,912500.0,2881600.0,,\nQQQ,20000605,922500.0,953100.0,918800.0,930600.0,23338800.0,0.3710747131638216,0.26622645127945443\nSPY,20000606,919700.0,967500.0,903100.0,928900.0,4600600.0,,\nQQQ,20000606,931900.0,950000.0,910000.0,911300.0,22103400.0,0.3667344990719051,0.2614591562455594\nSPY,20000607,936300.0,970000.0,916300.0,970000.0,2983100.0,,\nQQQ,20000607,915600.0,931300.0,895600.0,929400.0,22159300.0,0.3620857159785278,0.25581675244952606\nSPY,20000608,976300.0,985000.0,931300.0,948100.0,2007600.0,,\nQQQ,20000608,946300.0,948800.0,916300.0,927500.0,19062800.0,0.35761416548197217,0.2506718903139239\nSPY,20000609,967500.0,979400.0,943800.0,957500.0,2201500.0,,\nQQQ,20000609,947500.0,949200.0,925600.0,936900.0,16509900.0,0.35277572634949306,0.24530834491738193\nSPY,20000612,963800.0,964400.0,908800.0,912500.0,2506200.0,,\nQQQ,20000612,943100.0,943100.0,908800.0,909800.0,15911800.0,0.3483074295873797,0.24087665954974033\nSPY,20000613,911900.0,946900.0,881900.0,945000.0,3097800.0,,\nQQQ,20000613,905000.0,938800.0,893600.0,938800.0,24877300.0,0.34360608249178476,0.23611198076119994\nSPY,20000614,946900.0,962500.0,901300.0,904400.0,2463400.0,,\nQQQ,20000614,948800.0,948800.0,913800.0,917500.0,19879200.0,0.3403376621580425,0.23318108313115057\nSPY,20000615,912500.0,933800.0,890000.0,923100.0,2161000.0,,\nQQQ,20000615,918800.0,938100.0,817700.0,935600.0,18513300.0,0.33697607540594404,0.22954305067568578\nSPY,20000616,935000.0,937500.0,890600.0,911700.0,2613700.0,,\nQQQ,20000616,947500.0,959400.0,930600.0,946300.0,21969800.0,0.3339992344961633,0.22652643703296088\nSPY,20000619,905600.0,978800.0,898100.0,966900.0,3472400.0,,\nQQQ,20000619,940200.0,989400.0,926900.0,981300.0,19736000.0,0.3308384891242473,0.2226754399861651\nSPY,20000620,985000.0,1039400.0,983800.0,1010000.0,4353700.0,,\nQQQ,20000620,982500.0,996900.0,971900.0,982500.0,20659300.0,0.3265310133178893,0.21673869868458887\nSPY,20000621,505000.0,569400.0,503100.0,555600.0,8735600.0,,\nQQQ,20000621,968100.0,997200.0,966900.0,989400.0,20680400.0,0.3278941416234574,0.21805356864015138\nSPY,20000622,558800.0,576300.0,535600.0,536900.0,8037100.0,,\nQQQ,20000622,986300.0,996300.0,950000.0,952500.0,21247800.0,0.32939902288460193,0.21958406907292588\nSPY,20000623,537800.0,546300.0,508100.0,516900.0,3596400.0,,\nQQQ,20000623,950000.0,955000.0,914400.0,918100.0,24185800.0,0.3314770896950872,0.22270431027859694\nSPY,20000626,525000.0,547500.0,521300.0,545000.0,3208100.0,,\nQQQ,20000626,930600.0,944200.0,920000.0,939400.0,22647600.0,0.3335524803044635,0.22490745102908677\nSPY,20000627,537800.0,556300.0,516300.0,518100.0,3569700.0,,\nQQQ,20000627,937700.0,950600.0,921300.0,926600.0,14657300.0,0.33631184185074,0.22839175786930757\nSPY,20000628,533100.0,553800.0,515000.0,544400.0,4975600.0,,\nQQQ,20000628,929800.0,955000.0,925000.0,941300.0,18793000.0,0.3389013588346737,0.23120694296696703\nSPY,20000629,530600.0,539400.0,510600.0,513100.0,3515200.0,,\nQQQ,20000629,929400.0,933800.0,906300.0,916300.0,21115000.0,0.3422145206780752,0.23584793532497272\nSPY,20000630,528100.0,549400.0,516900.0,523800.0,5274900.0,,\nQQQ,20000630,918100.0,939500.0,913100.0,937500.0,14225300.0,0.3453826418082104,0.23978797961293505\nSPY,20000703,521300.0,543100.0,521300.0,535600.0,1322400.0,,\nQQQ,20000703,935000.0,952500.0,932500.0,952500.0,5219200.0,0.348107457080726,0.2428928932781064\nSPY,20000705,532500.0,551900.0,507500.0,516300.0,4558400.0,,\nQQQ,20000705,936300.0,939700.0,908800.0,912500.0,15877900.0,0.3515479548650895,0.2479436946818132\nSPY,20000706,525000.0,529400.0,496300.0,518100.0,5454400.0,,\nQQQ,20000706,915600.0,947500.0,900600.0,945000.0,22878900.0,0.35467853411005396,0.25163609259018715\nSPY,20000707,525900.0,548100.0,521300.0,545000.0,4664600.0,,\nQQQ,20000707,950000.0,979700.0,930000.0,958800.0,16126000.0,0.35754888318505024,0.25453961913411094\nSPY,20000710,540600.0,582500.0,537500.0,570600.0,7046300.0,,\nQQQ,20000710,946900.0,958800.0,921300.0,941900.0,12520300.0,0.3603894708172598,0.25778616640898616\nSPY,20000711,570000.0,592500.0,554400.0,569400.0,6293000.0,,\nQQQ,20000711,940600.0,957500.0,928100.0,935000.0,14307200.0,0.3632390709676115,0.26138857831525153\nSPY,20000712,581300.0,589400.0,563800.0,588300.0,3838500.0,,\nQQQ,20000712,954400.0,978800.0,942500.0,971400.0,17877700.0,0.365775285665757,0.2643790901142079\nSPY,20000713,585000.0,606300.0,547500.0,565600.0,7962200.0,,\nQQQ,20000713,979400.0,999700.0,943100.0,987500.0,19184000.0,0.3685199581390127,0.26775878837847483\nSPY,20000714,571300.0,590000.0,568800.0,577000.0,3254600.0,,\nQQQ,20000714,1002500.0,1015600.0,988100.0,1008600.0,16775700.0,0.3711907521081928,0.271010206770136\nSPY,20000717,582500.0,588100.0,571300.0,583300.0,4537900.0,,\nQQQ,20000717,1009400.0,1020600.0,916100.0,1015200.0,12798100.0,0.3734883351490448,0.273771954064709\nSPY,20000718,585000.0,590000.0,568800.0,571300.0,5011500.0,,\nQQQ,20000718,1003800.0,1009700.0,983600.0,990000.0,20309800.0,0.3755441884419788,0.2763372843125537\nSPY,20000719,551900.0,568100.0,517500.0,526900.0,7648500.0,,\nQQQ,20000719,983100.0,989400.0,878300.0,960600.0,21249600.0,0.3782734562496254,0.2797391026900303\nSPY,20000720,550000.0,570600.0,541300.0,550600.0,8303400.0,,\nQQQ,20000720,978800.0,998800.0,873900.0,995000.0,19233600.0,0.380033726393952,0.28174553406053854\nSPY,20000721,545000.0,556300.0,529400.0,535000.0,3357800.0,,\nQQQ,20000721,984400.0,995200.0,971400.0,976900.0,13855200.0,0.38218094551883386,0.2844293444188622\nSPY,20000724,525600.0,535600.0,475000.0,486300.0,7198700.0,,\nQQQ,20000724,979400.0,990000.0,943100.0,946300.0,18282200.0,0.3845507499543511,0.2873093015162665\nSPY,20000725,503100.0,506300.0,490600.0,500300.0,3757200.0,,\nQQQ,20000725,956300.0,967300.0,938100.0,962500.0,19678200.0,0.38702159102014344,0.28998780887267567\nSPY,20000726,498400.0,512500.0,492500.0,500000.0,3407400.0,,\nQQQ,20000726,955000.0,961300.0,932500.0,953100.0,20265800.0,0.3897805878756042,0.29306005560026516\nSPY,20000727,500000.0,532500.0,498800.0,520000.0,5072300.0,,\nQQQ,20000727,939400.0,950600.0,916300.0,919800.0,25065100.0,0.3924136864192236,0.2969370523241703\nSPY,20000728,522800.0,525000.0,468800.0,483100.0,4051600.0,,\nQQQ,20000728,921900.0,928800.0,860000.0,867500.0,36466800.0,0.3958719989303838,0.30310210942305366\nSPY,20000731,491600.0,516300.0,487500.0,507500.0,2579000.0,,\nQQQ,20000731,876300.0,901300.0,857200.0,901300.0,28653800.0,0.39867641584713326,0.3076167431766339\nSPY,20000801,503100.0,511600.0,493100.0,493100.0,2258600.0,,\nQQQ,20000801,898100.0,998300.0,874800.0,879800.0,15374700.0,0.4016917288400086,0.31303117050189894\nSPY,20000802,490000.0,499400.0,471900.0,471900.0,2758800.0,,\nQQQ,20000802,878800.0,903900.0,868800.0,870900.0,22761400.0,0.404729364484697,0.3190148119408479\nSPY,20000803,455600.0,480600.0,442500.0,479400.0,5770200.0,,\nQQQ,20000803,842500.0,905000.0,793100.0,905000.0,35322400.0,0.40744289237623643,0.323258799946244\nSPY,20000804,494700.0,512500.0,463100.0,473800.0,4145300.0,,\nQQQ,20000804,920000.0,927700.0,891300.0,902500.0,21894100.0,0.41007693778194004,0.32745429970006235\nSPY,20000807,478800.0,490600.0,455600.0,479400.0,3176100.0,,\nQQQ,20000807,908800.0,930300.0,902500.0,927000.0,14571900.0,0.4122017275690959,0.33006824442082106\nSPY,20000808,479400.0,480000.0,463100.0,467500.0,3085500.0,,\nQQQ,20000808,920600.0,934400.0,915000.0,920600.0,14047000.0,0.4143161967875283,0.3329001544565981\nSPY,20000809,481300.0,484400.0,472500.0,475000.0,6447300.0,,\nQQQ,20000809,936900.0,944400.0,920000.0,924700.0,17560500.0,0.41671244677266794,0.3359772742320015\nSPY,20000810,480000.0,492500.0,473800.0,475600.0,4737500.0,,\nQQQ,20000810,918100.0,922300.0,896900.0,897500.0,15177500.0,0.41929265901204266,0.340061853595136\nSPY,20000811,468400.0,480000.0,455600.0,476300.0,4188400.0,,\nQQQ,20000811,892500.0,911100.0,878800.0,909400.0,20686000.0,0.42216927242964464,0.3441138133140083\nSPY,20000814,475900.0,476900.0,463100.0,470500.0,2831200.0,,\nQQQ,20000814,913800.0,929700.0,902000.0,928800.0,11959600.0,0.4248239261133755,0.3470893247722271\nSPY,20000815,472500.0,479400.0,465000.0,466900.0,1984000.0,,\nQQQ,20000815,927500.0,939800.0,920000.0,929800.0,13981800.0,0.42756148611488504,0.3500622116613673\nSPY,20000816,468800.0,490000.0,468100.0,485000.0,2422300.0,,\nQQQ,20000816,934400.0,946900.0,920000.0,928900.0,15201600.0,0.430153350744707,0.35308384054768094\nSPY,20000817,483800.0,542500.0,483100.0,515000.0,4551100.0,,\nQQQ,20000817,929400.0,958800.0,928800.0,955600.0,14138600.0,0.4321494971091102,0.3550215224045452\nSPY,20000818,513800.0,518100.0,498800.0,500600.0,3306000.0,,\nQQQ,20000818,959400.0,966300.0,946900.0,949400.0,14175900.0,0.4343796757551987,0.3572014144935175\nSPY,20000821,502500.0,517500.0,496300.0,505000.0,2408700.0,,\nQQQ,20000821,960000.0,968600.0,943800.0,955200.0,13089000.0,0.43683009500895337,0.3598619776623079\nSPY,20000822,506300.0,528100.0,503800.0,516900.0,4896300.0,,\nQQQ,20000822,960000.0,973600.0,954400.0,955000.0,14501500.0,0.4393509559822266,0.36266431905442975\nSPY,20000823,514700.0,547500.0,510600.0,543800.0,4214200.0,,\nQQQ,20000823,946900.0,974400.0,938100.0,972200.0,21260400.0,0.44183784165137646,0.36543661283884477\nSPY,20000824,546700.0,566300.0,533800.0,560600.0,5458800.0,,\nQQQ,20000824,974400.0,986900.0,960600.0,985900.0,13294500.0,0.4438990293076801,0.3678515904241055\nSPY,20000825,565000.0,575000.0,563800.0,568100.0,5699400.0,,\nQQQ,20000825,984800.0,999500.0,968800.0,981300.0,11603100.0,0.4458155465211514,0.37036892616505257\nSPY,20000828,572500.0,590000.0,570600.0,580600.0,6157100.0,,\nQQQ,20000828,982500.0,998400.0,979400.0,986900.0,12159300.0,0.4475130120770783,0.372702542139383\nSPY,20000829,578800.0,594400.0,576900.0,592500.0,4442200.0,,\nQQQ,20000829,986300.0,995500.0,978400.0,986400.0,11256200.0,0.4492235693456686,0.37505078070738296\nSPY,20000830,590000.0,600000.0,587000.0,595000.0,4902000.0,,\nQQQ,20000830,983100.0,995000.0,977700.0,991700.0,9802300.0,0.4508303818540175,0.3775306226184083\nSPY,20000831,589700.0,615000.0,589400.0,609400.0,7052300.0,,\nQQQ,20000831,996300.0,1018100.0,988800.0,1017000.0,15360900.0,0.4521357642600484,0.3796186540067512\nSPY,20000901,613100.0,635600.0,610600.0,635000.0,4376200.0,,\nQQQ,20000901,1030000.0,1039700.0,1011900.0,1023100.0,13990200.0,0.4535766422948583,0.3813238733915929\nSPY,20000905,626600.0,641300.0,548100.0,625000.0,5199300.0,,\nQQQ,20000905,1016300.0,1035600.0,994200.0,996100.0,16152400.0,0.45514986844848143,0.38362179831004994\nSPY,20000906,613800.0,623800.0,577500.0,584400.0,6134600.0,,\nQQQ,20000906,992500.0,994800.0,957500.0,958800.0,21246800.0,0.4570743958847455,0.38619900862679\nSPY,20000907,591300.0,625600.0,582500.0,620600.0,3766600.0,,\nQQQ,20000907,968100.0,994200.0,965600.0,986300.0,16257200.0,0.4587256393585403,0.38839389743040775\nSPY,20000908,616300.0,616300.0,585000.0,588100.0,3332600.0,,\nQQQ,20000908,977700.0,980000.0,926300.0,953100.0,23168400.0,0.4607629725462631,0.3908708131110841\nSPY,20000911,586900.0,603800.0,581300.0,585000.0,3278400.0,,\nQQQ,20000911,945000.0,977500.0,920000.0,926300.0,26901000.0,0.4629357694906115,0.39366500737840593\nSPY,20000912,573400.0,600600.0,570000.0,576700.0,3316400.0,,\nQQQ,20000912,935000.0,946900.0,908400.0,915900.0,33512800.0,0.4652165562193124,0.396860905843369\nSPY,20000913,567500.0,595000.0,567500.0,579800.0,5320000.0,,\nQQQ,20000913,902500.0,937500.0,850000.0,933100.0,33216900.0,0.4672637289917376,0.39962749907962736\nSPY,20000914,585600.0,596300.0,568100.0,570000.0,7075400.0,,\nQQQ,20000914,952500.0,962500.0,926400.0,932300.0,27741100.0,0.46932316044215067,0.4023975411570504\nSPY,20000915,577500.0,581900.0,537500.0,551900.0,6315200.0,,\nQQQ,20000915,931300.0,936300.0,906900.0,915800.0,23981000.0,0.471689657327232,0.40566625079849244\nSPY,20000918,552500.0,607500.0,550600.0,606300.0,7305700.0,,\nQQQ,20000918,918100.0,942500.0,880000.0,895000.0,28672900.0,0.4738621405445317,0.4085255281242136\nSPY,20000919,597500.0,605000.0,585600.0,598800.0,4622400.0,,\nQQQ,20000919,907500.0,966300.0,898800.0,935600.0,27215200.0,0.47590158516966274,0.4107654848497763\nSPY,20000920,594100.0,614400.0,585600.0,610000.0,3850400.0,,\nQQQ,20000920,933800.0,972500.0,913100.0,945000.0,32819400.0,0.4778709301423251,0.41280953722730906\nSPY,20000921,585000.0,596300.0,552500.0,566300.0,8579900.0,,\nQQQ,20000921,937500.0,949700.0,920600.0,926300.0,23885500.0,0.4800052397506366,0.4154267930435049\nSPY,20000922,503100.0,524400.0,498100.0,521900.0,12301600.0,,\nQQQ,20000922,876300.0,977500.0,875000.0,922000.0,33321300.0,0.48228368455183745,0.41866093111401464\nSPY,20000925,527500.0,555000.0,520600.0,534400.0,7454300.0,,\nQQQ,20000925,936300.0,942500.0,900600.0,905000.0,19947900.0,0.4848419074287707,0.4224066127118625\nSPY,20000926,533100.0,547500.0,513800.0,514200.0,5162200.0,,\nQQQ,20000926,907700.0,927500.0,889800.0,893800.0,25171000.0,0.4877101100253986,0.4269227445259215\nSPY,20000927,517500.0,527500.0,481300.0,489400.0,7086300.0,,\nQQQ,20000927,906300.0,911900.0,880000.0,891300.0,28443400.0,0.49048794715527244,0.43166579493498786\nSPY,20000928,493100.0,538100.0,481300.0,533800.0,5841700.0,,\nQQQ,20000928,887200.0,930000.0,887200.0,928100.0,28626400.0,0.49265956211954276,0.4343282322968467\nSPY,20000929,280600.0,291300.0,231900.0,258100.0,134102300.0,,\nQQQ,20000929,920000.0,921300.0,888800.0,891300.0,26376000.0,0.4951766089350858,0.4389900879362277\nSPY,20001002,266900.0,267500.0,235000.0,243100.0,43003400.0,,\nQQQ,20001002,902500.0,902500.0,860000.0,863000.0,24413800.0,0.4982007877771567,0.4449238659092235\nSPY,20001003,248800.0,250000.0,221900.0,222500.0,36151100.0,,\nQQQ,20001003,880600.0,888100.0,835000.0,836300.0,35169700.0,0.5014545416885309,0.4515883991753681\nSPY,20001004,223800.0,237500.0,218800.0,236900.0,26035100.0,,\nQQQ,20001004,835000.0,868600.0,821300.0,860000.0,37322200.0,0.5044685118388155,0.4576102877147517\nSPY,20001005,235000.0,249400.0,220000.0,221900.0,15284500.0,,\nQQQ,20001005,852500.0,871900.0,845600.0,855000.0,23416600.0,0.5075232380432363,0.4636921664269953\nSPY,20001006,226900.0,229400.0,210000.0,221900.0,10630300.0,,\nQQQ,20001006,855600.0,865600.0,811300.0,827300.0,35636600.0,0.5110943310178434,0.47029642274782796\nSPY,20001009,226300.0,228800.0,211300.0,217500.0,10395700.0,,\nQQQ,20001009,825600.0,838100.0,793800.0,828100.0,28668200.0,0.5145816054426948,0.4767791120177962\nSPY,20001010,216300.0,224400.0,205000.0,209800.0,12005800.0,,\nQQQ,20001010,818100.0,833100.0,791300.0,795000.0,33051500.0,0.5183119740567808,0.48369747999983514\nSPY,20001011,200600.0,210000.0,191300.0,196900.0,21620400.0,,\nQQQ,20001011,768800.0,804500.0,731900.0,774800.0,48166600.0,0.5221809336889501,0.49075644997587275\nSPY,20001012,203000.0,208100.0,195000.0,199400.0,21286500.0,,\nQQQ,20001012,792500.0,795600.0,744100.0,748800.0,51753500.0,0.5260817579862535,0.4978484145531688\nSPY,20001013,202500.0,221300.0,197500.0,220000.0,21714700.0,,\nQQQ,20001013,746900.0,815000.0,746300.0,814400.0,40653500.0,0.5288119478898116,0.5043449765532115\nSPY,20001016,223100.0,232500.0,213800.0,215000.0,14209900.0,,\nQQQ,20001016,811300.0,823100.0,797500.0,810000.0,27298100.0,0.53150192213054,0.5107927965286682\nSPY,20001017,216900.0,219400.0,196900.0,201300.0,10605900.0,,\nQQQ,20001017,831300.0,831700.0,780000.0,793100.0,50132700.0,0.5344140559143223,0.5175161964123621\nSPY,20001018,194400.0,210600.0,187500.0,201300.0,13878700.0,,\nQQQ,20001018,767500.0,811900.0,745600.0,784200.0,64129700.0,0.5374788758076567,0.5242021024309899\nSPY,20001019,191600.0,198100.0,178800.0,189400.0,28857500.0,,\nQQQ,20001019,823900.0,850000.0,814400.0,848300.0,46974100.0,0.5395423635052543,0.5298081851357073\nSPY,20001020,190600.0,205000.0,189400.0,195000.0,14289100.0,,\nQQQ,20001020,845000.0,878800.0,843900.0,860600.0,40117600.0,0.5414631136759012,0.5351596844966243\nSPY,20001023,195000.0,205600.0,192500.0,203100.0,9166100.0,,\nQQQ,20001023,861900.0,875000.0,841300.0,855000.0,28581000.0,0.5434464312312178,0.5406513247991127\nSPY,20001024,206900.0,208800.0,188100.0,188800.0,13561500.0,,\nQQQ,20001024,864400.0,870000.0,828900.0,838100.0,27862200.0,0.5455652230233333,0.5465296140662107\nSPY,20001025,190600.0,191900.0,180000.0,185000.0,11759100.0,,\nQQQ,20001025,812500.0,820000.0,768900.0,776900.0,47678700.0,0.5484415445304451,0.5529905581056693\nSPY,20001026,188100.0,188800.0,166900.0,185600.0,12648000.0,,\nQQQ,20001026,781900.0,800000.0,736300.0,790600.0,67672500.0,0.5511442162263541,0.5593993856629156\nSPY,20001027,188800.0,191900.0,178800.0,185200.0,12724600.0,,\nQQQ,20001027,808600.0,818600.0,774800.0,791300.0,50978000.0,0.5538267853517785,0.565758721308996\nSPY,20001030,191300.0,199400.0,187500.0,193100.0,10813300.0,,\nQQQ,20001030,781900.0,798800.0,757000.0,770500.0,36014700.0,0.5567704534151985,0.5721802967827546\nSPY,20001031,197500.0,202500.0,192500.0,195000.0,15498200.0,,\nQQQ,20001031,780000.0,825600.0,778800.0,819400.0,44479100.0,0.5589836072357555,0.5779139680447167\nSPY,20001101,194400.0,208800.0,156300.0,204400.0,10084700.0,,\nQQQ,20001101,803100.0,828100.0,791900.0,806300.0,46031900.0,0.5613356583400163,0.5838811189073384\nSPY,20001102,211300.0,224400.0,210600.0,223100.0,10140200.0,,\nQQQ,20001102,821900.0,832500.0,810600.0,823900.0,26099400.0,0.5634188957473525,0.589547943798175\nSPY,20001103,230000.0,230000.0,219400.0,223100.0,8744200.0,,\nQQQ,20001103,828800.0,839400.0,816400.0,830000.0,29681300.0,0.5652898380642482,0.5944788752884088\nSPY,20001106,224400.0,226300.0,208800.0,213800.0,6786000.0,,\nQQQ,20001106,836300.0,849400.0,820000.0,822300.0,21860400.0,0.5670242275303088,0.598725432834119\nSPY,20001107,215000.0,218100.0,208100.0,213100.0,5302000.0,,\nQQQ,20001107,814400.0,824700.0,800600.0,819100.0,23864100.0,0.5688869259665079,0.603540472017943\nSPY,20001108,213800.0,214400.0,198100.0,200000.0,7603600.0,,\nQQQ,20001108,821300.0,822500.0,763100.0,763100.0,37279500.0,0.5712599909370039,0.60869738015269\nSPY,20001109,198800.0,210000.0,190600.0,202500.0,8461800.0,,\nQQQ,20001109,747500.0,769400.0,730000.0,763100.0,64666200.0,0.5735379030710602,0.6136718081407958\nSPY,20001110,193600.0,198800.0,190600.0,190800.0,7408300.0,,\nQQQ,20001110,742500.0,756900.0,720000.0,720000.0,46913100.0,0.5762487271686274,0.6188838332549508\nSPY,20001113,187500.0,200000.0,181900.0,193800.0,7544700.0,,\nQQQ,20001113,709500.0,741900.0,682700.0,710000.0,73766200.0,0.5790238620785928,0.6242064653332575\nSPY,20001114,199400.0,205000.0,195600.0,201300.0,7055100.0,,\nQQQ,20001114,730000.0,760000.0,727500.0,757000.0,44479400.0,0.5812108289435765,0.6291541585500325\nSPY,20001115,200300.0,201900.0,192500.0,199400.0,4959600.0,,\nQQQ,20001115,755600.0,780600.0,748000.0,768100.0,37421900.0,0.5832543150164151,0.6341447136797594\nSPY,20001116,195000.0,198100.0,188800.0,190600.0,4141400.0,,\nQQQ,20001116,753800.0,770000.0,723800.0,731300.0,32917600.0,0.5856680535147766,0.6393926140418841\nSPY,20001117,191900.0,192500.0,182500.0,185000.0,7634500.0,,\nQQQ,20001117,731900.0,751900.0,710000.0,736100.0,48455800.0,0.5878411473006044,0.6442324456404617\nSPY,20001120,185900.0,195000.0,182500.0,189400.0,6953200.0,,\nQQQ,20001120,709400.0,720600.0,690000.0,697300.0,46531500.0,0.5904112487801518,0.6492293784955888\nSPY,20001121,191900.0,195000.0,187500.0,188100.0,5256300.0,,\nQQQ,20001121,701900.0,715000.0,684400.0,696600.0,41578500.0,0.5927790982920698,0.6539041179739107\nSPY,20001122,188100.0,191300.0,183800.0,185000.0,4975700.0,,\nQQQ,20001122,684400.0,701300.0,666300.0,667500.0,56425200.0,0.5952619469427701,0.6584187538599471\nSPY,20001124,188600.0,195000.0,188100.0,192500.0,2873700.0,,\nQQQ,20001124,683800.0,706300.0,681700.0,704400.0,23193800.0,0.5973488315944315,0.662801669004391\nSPY,20001127,198800.0,199400.0,185000.0,186300.0,4415400.0,,\nQQQ,20001127,725600.0,729400.0,687500.0,691400.0,35971200.0,0.5994977236185783,0.6672194518392638\nSPY,20001128,186900.0,190000.0,179400.0,180600.0,4084800.0,,\nQQQ,20001128,689400.0,716900.0,653100.0,654800.0,48160300.0,0.6017712551245467,0.6714885081176196\nSPY,20001129,180900.0,183100.0,172500.0,176300.0,8301300.0,,\nQQQ,20001129,658100.0,667500.0,625000.0,650000.0,61390400.0,0.6038438001297117,0.6755264752866587\nSPY,20001130,166900.0,170000.0,161300.0,165600.0,13490900.0,,\nQQQ,20001130,617500.0,642500.0,600600.0,624700.0,75005000.0,0.6057245054409932,0.6794189646361827\nSPY,20001201,170000.0,175000.0,168100.0,170600.0,6625100.0,,\nQQQ,20001201,640600.0,667700.0,621300.0,636700.0,57421900.0,0.6071812815824894,0.6832909589851034\nSPY,20001204,171900.0,171900.0,164400.0,167500.0,6551700.0,,\nQQQ,20001204,641300.0,654400.0,617500.0,640000.0,46778200.0,0.6084769218751422,0.6871794506470242\nSPY,20001205,169400.0,174400.0,163800.0,170000.0,9477600.0,,\nQQQ,20001205,660600.0,710000.0,583100.0,709400.0,77330700.0,0.6090723341667375,0.6910068272630582\nSPY,20001206,146300.0,150000.0,140000.0,143100.0,23394700.0,,\nQQQ,20001206,705900.0,723000.0,675600.0,688100.0,62158200.0,0.6101087126895322,0.6947141504149937\nSPY,20001207,144400.0,148800.0,140000.0,143100.0,6910400.0,,\nQQQ,20001207,670000.0,689800.0,661300.0,678900.0,38431000.0,0.6113506553156971,0.6985671523938234\nSPY,20001208,148100.0,153100.0,144400.0,151300.0,7484500.0,,\nQQQ,20001208,710900.0,872500.0,697000.0,718900.0,59582400.0,0.6122796232125577,0.702194685879145\nSPY,20001211,151900.0,153800.0,148800.0,151300.0,5853300.0,,\nQQQ,20001211,720600.0,747800.0,709500.0,741300.0,51124900.0,0.6131773387583841,0.7060818094254885\nSPY,20001212,152500.0,160000.0,150000.0,154400.0,6418300.0,,\nQQQ,20001212,735000.0,738800.0,708800.0,715000.0,29755000.0,0.6144911277035136,0.7100077949805923\nSPY,20001213,155600.0,160000.0,135600.0,149400.0,5720200.0,,\nQQQ,20001213,734400.0,735000.0,683100.0,685200.0,51205100.0,0.6158843283433778,0.7138879041537419\nSPY,20001214,150300.0,152500.0,144400.0,144400.0,4489600.0,,\nQQQ,20001214,685200.0,696900.0,656300.0,658800.0,38315600.0,0.6173687989014031,0.7177385262616751\nSPY,20001215,145600.0,146900.0,140000.0,141900.0,7256700.0,,\nQQQ,20001215,642500.0,656300.0,605000.0,638100.0,57821200.0,0.6188396216871579,0.7215010377371482\nSPY,20001218,145600.0,146300.0,139400.0,142700.0,23599100.0,,\nQQQ,20001218,651600.0,659700.0,625600.0,633800.0,42454900.0,0.6204298864816182,0.7252961688935746\nSPY,20001219,143800.0,152500.0,140000.0,140000.0,6447300.0,,\nQQQ,20001219,634500.0,658600.0,597800.0,600000.0,78288100.0,0.6219281659642716,0.7287392324590225\nSPY,20001220,137800.0,146300.0,136300.0,143300.0,9706200.0,,\nQQQ,20001220,573100.0,583800.0,547500.0,554200.0,78896600.0,0.6238858510698058,0.7323730026075302\nSPY,20001221,142500.0,150000.0,138800.0,141300.0,6146500.0,,\nQQQ,20001221,550200.0,587500.0,542500.0,558100.0,84496400.0,0.6254480176456569,0.7356113489474913\nSPY,20001222,141300.0,150000.0,141300.0,150000.0,5312700.0,,\nQQQ,20001222,576300.0,607500.0,560600.0,606300.0,56301600.0,0.6270344190006595,0.7392229957417504\nSPY,20001226,148800.0,150000.0,140000.0,146900.0,3759100.0,,\nQQQ,20001226,605900.0,619200.0,580000.0,601900.0,35626800.0,0.6286942708650402,0.7428516526831321\nSPY,20001227,143400.0,148100.0,141900.0,148100.0,5752200.0,,\nQQQ,20001227,596900.0,621900.0,589400.0,612500.0,33769600.0,0.6300851531186107,0.7463802009860194\nSPY,20001228,143800.0,149400.0,143100.0,147500.0,5356800.0,,\nQQQ,20001228,607800.0,624800.0,602500.0,612800.0,30069700.0,0.6314754567892729,0.7498617413727787\nSPY,20001229,146900.0,150000.0,145000.0,148100.0,10068900.0,,\nQQQ,20001229,615600.0,622300.0,580000.0,584400.0,46732700.0,0.632731042703772,0.7529573760291861\nSPY,20010102,148800.0,152500.0,145600.0,149400.0,7772900.0,,\nQQQ,20010102,585600.0,586900.0,524400.0,532300.0,61819700.0,0.6333190292096754,0.7551683896669642\nSPY,20010103,144400.0,166900.0,144400.0,163100.0,14144800.0,,\nQQQ,20010103,521900.0,640000.0,520600.0,628100.0,115085400.0,0.6340918122171674,0.7581352797658663\nSPY,20010104,181900.0,185000.0,168100.0,170600.0,12722700.0,,\nQQQ,20010104,616300.0,636300.0,602300.0,614800.0,56326000.0,0.6347281131847305,0.7609823321351349\nSPY,20010105,169400.0,173800.0,160600.0,163800.0,7075400.0,,\nQQQ,20010105,613100.0,613100.0,560000.0,566900.0,70772600.0,0.6362744969326328,0.7643444082762086\nSPY,20010108,169200.0,169800.0,159400.0,166300.0,6486100.0,,\nQQQ,20010108,563100.0,569400.0,535200.0,568900.0,53219400.0,0.6375297687191868,0.7674222808135204\nSPY,20010109,168100.0,176400.0,165600.0,171300.0,10200500.0,,\nQQQ,20010109,577500.0,591300.0,566300.0,574400.0,52452400.0,0.6390795847643882,0.7705683922108384\nSPY,20010110,166900.0,170000.0,160600.0,165600.0,10143600.0,,\nQQQ,20010110,561300.0,603800.0,557500.0,601900.0,71989200.0,0.640763130505708,0.7740887952883381\nSPY,20010111,162500.0,185000.0,162500.0,180000.0,14242200.0,,\nQQQ,20010111,592700.0,636900.0,584400.0,627500.0,61255400.0,0.6427602521018638,0.7783712018465692\nSPY,20010112,178800.0,180000.0,170600.0,171300.0,7276700.0,,\nQQQ,20010112,627500.0,646300.0,605000.0,624800.0,59666900.0,0.6439195447406141,0.781490839680366\nSPY,20010116,174400.0,182500.0,170000.0,170600.0,5444700.0,,\nQQQ,20010116,625600.0,629200.0,603800.0,615600.0,29908700.0,0.6448267004712563,0.7844191789636825\nSPY,20010117,175600.0,175600.0,165000.0,167500.0,13014800.0,,\nQQQ,20010117,645000.0,656100.0,631400.0,636900.0,59521200.0,0.6452467435783958,0.7869235450222547\nSPY,20010118,178100.0,187500.0,176300.0,187300.0,20751700.0,,\nQQQ,20010118,641300.0,669800.0,621300.0,665000.0,53229400.0,0.6452100774770908,0.7892039253156053\nSPY,20010119,194400.0,195600.0,186900.0,194400.0,13851700.0,,\nQQQ,20010119,681400.0,683100.0,655600.0,663600.0,56472600.0,0.644338310676011,0.7907929177002191\nSPY,20010122,190600.0,196300.0,184400.0,191900.0,9124900.0,,\nQQQ,20010122,658800.0,670000.0,640000.0,659800.0,34900100.0,0.6437084837680956,0.7925371349190068\nSPY,20010123,193100.0,209400.0,190600.0,205600.0,14691100.0,,\nQQQ,20010123,659100.0,689500.0,653100.0,678100.0,48097800.0,0.6433558139642459,0.7943102224571942\nSPY,20010124,206700.0,207500.0,195600.0,205000.0,12179100.0,,\nQQQ,20010124,680600.0,691300.0,666300.0,679400.0,51456100.0,0.6423359019095326,0.7956067622556828\nSPY,20010125,205600.0,205600.0,197500.0,198800.0,8337500.0,,\nQQQ,20010125,668800.0,679500.0,642300.0,647700.0,56402000.0,0.6416081278803701,0.7971957546402965\nSPY,20010126,195000.0,198100.0,190600.0,195000.0,8447800.0,,\nQQQ,20010126,635600.0,665600.0,625600.0,655600.0,46583400.0,0.6407931533750651,0.7988316887584438\nSPY,20010129,195600.0,217500.0,195600.0,217300.0,15160200.0,,\nQQQ,20010129,647500.0,672500.0,638000.0,671000.0,31339200.0,0.6405986808298684,0.8005429122888988\nSPY,20010130,215600.0,220000.0,208800.0,217300.0,12206500.0,,\nQQQ,20010130,671500.0,692100.0,604000.0,668600.0,41285400.0,0.640260871351758,0.8020979364491143\nSPY,20010131,215000.0,228800.0,214400.0,216900.0,12279500.0,,\nQQQ,20010131,672500.0,699400.0,646200.0,646500.0,58744000.0,0.6405793740722392,0.80375366925524\nSPY,20010201,207500.0,215000.0,205000.0,211300.0,6386300.0,,\nQQQ,20010201,645500.0,688400.0,632900.0,650000.0,45100700.0,0.6411367603713526,0.8055917736791656\nSPY,20010202,211300.0,219400.0,205000.0,206900.0,7439700.0,,\nQQQ,20010202,649400.0,659000.0,600000.0,616800.0,46227700.0,0.6414530890003807,0.8065602425740894\nSPY,20010205,205000.0,205600.0,197500.0,201900.0,5939400.0,,\nQQQ,20010205,611900.0,619000.0,601200.0,615600.0,35503900.0,0.6411334673327385,0.8073650142354892\nSPY,20010206,201600.0,214400.0,200000.0,210600.0,7985700.0,,\nQQQ,20010206,614900.0,631200.0,611200.0,617000.0,41770200.0,0.6399567098186326,0.8074492242805597\nSPY,20010207,206600.0,208800.0,198100.0,207500.0,6385100.0,,\nQQQ,20010207,605100.0,635000.0,585800.0,602000.0,61065000.0,0.6388571566521308,0.8072241092114191\nSPY,20010208,205600.0,210600.0,201900.0,207300.0,10119500.0,,\nQQQ,20010208,609000.0,615000.0,586500.0,587000.0,49388600.0,0.6380031874098621,0.8070013951519\nSPY,20010209,205000.0,208100.0,186900.0,191900.0,10287400.0,,\nQQQ,20010209,582500.0,593200.0,559500.0,564600.0,53923600.0,0.6373057496190297,0.8074462247640443\nSPY,20010212,190600.0,200000.0,188100.0,196900.0,4838700.0,,\nQQQ,20010212,562500.0,599600.0,555000.0,569900.0,50717500.0,0.637145736237956,0.8079364222388027\nSPY,20010213,199400.0,204400.0,190000.0,190600.0,4113900.0,,\nQQQ,20010213,576500.0,591800.0,550000.0,551000.0,56703000.0,0.6358746167291703,0.8081195442789815\nSPY,20010214,191900.0,196300.0,185000.0,195600.0,5509500.0,,\nQQQ,20010214,554000.0,576100.0,541300.0,575000.0,63183900.0,0.6339224951865555,0.8078143433591032\nSPY,20010215,196900.0,205600.0,196900.0,200600.0,5541000.0,,\nQQQ,20010215,588000.0,604900.0,559900.0,591000.0,64075400.0,0.632708949256894,0.8075203906303753\nSPY,20010216,190000.0,195000.0,187500.0,190000.0,4444200.0,,\nQQQ,20010216,559600.0,580900.0,544400.0,552600.0,66033400.0,0.6318105220640344,0.8075515106258911\nSPY,20010220,191900.0,194400.0,180000.0,182700.0,5259200.0,,\nQQQ,20010220,557400.0,558400.0,523900.0,524000.0,54283000.0,0.6313099146694741,0.808402998695969\nSPY,20010221,182500.0,199400.0,182500.0,188800.0,6407600.0,,\nQQQ,20010221,515500.0,540700.0,509200.0,514000.0,71588600.0,0.6302645924099998,0.8085287550723543\nSPY,20010222,190600.0,193800.0,180000.0,187500.0,7571800.0,,\nQQQ,20010222,514500.0,521600.0,488900.0,506500.0,103011300.0,0.6293837579415749,0.8086048678467405\nSPY,20010223,186300.0,188800.0,182500.0,188100.0,5087500.0,,\nQQQ,20010223,500900.0,551000.0,478000.0,512600.0,92596000.0,0.6290329192402214,0.8086031447370734\nSPY,20010226,190600.0,196900.0,185600.0,195000.0,3513100.0,,\nQQQ,20010226,520800.0,526000.0,502500.0,522500.0,77513400.0,0.6296253826999362,0.8083457204299295\nSPY,20010227,192800.0,194400.0,186900.0,193100.0,4770100.0,,\nQQQ,20010227,515400.0,520800.0,489000.0,491500.0,64978600.0,0.6296452575698672,0.8079949278152911\nSPY,20010228,193800.0,194400.0,181300.0,183000.0,8610000.0,,\nQQQ,20010228,494500.0,502100.0,467400.0,475000.0,103002500.0,0.6301151542052205,0.8083001292501159\nSPY,20010301,178100.0,187500.0,171900.0,187500.0,5864600.0,,\nQQQ,20010301,469700.0,492000.0,456300.0,489500.0,99562100.0,0.626709235854276,0.8072343252033051\nSPY,20010302,183100.0,204400.0,182500.0,192500.0,7002300.0,,\nQQQ,20010302,472000.0,572500.0,456500.0,467500.0,96432700.0,0.6252717232601633,0.8060697602963273\nSPY,20010305,193800.0,205000.0,187500.0,203800.0,5328600.0,,\nQQQ,20010305,475000.0,483600.0,470900.0,477800.0,42975900.0,0.6232258189017174,0.8034732979715296\nSPY,20010306,207200.0,220600.0,206900.0,214400.0,12945200.0,,\nQQQ,20010306,493000.0,506600.0,491000.0,493200.0,62538000.0,0.6223499643978587,0.800531515531044\nSPY,20010307,213100.0,216300.0,207500.0,212500.0,7489600.0,,\nQQQ,20010307,504000.0,504300.0,489700.0,497200.0,54750000.0,0.6224032938361335,0.7978758126217959\nSPY,20010308,206900.0,211300.0,204400.0,208100.0,3827200.0,,\nQQQ,20010308,493500.0,498500.0,481000.0,482500.0,48622000.0,0.6240744659634514,0.7952092364407183\nSPY,20010309,206300.0,206900.0,200000.0,201900.0,4672800.0,,\nQQQ,20010309,472500.0,495600.0,449000.0,452000.0,79218100.0,0.6286649149986886,0.7928050797030164\nSPY,20010312,196900.0,198800.0,181300.0,186900.0,6718600.0,,\nQQQ,20010312,440000.0,449500.0,418000.0,419500.0,78427100.0,0.6341230009572658,0.7916600114825828\nSPY,20010313,188800.0,195600.0,181900.0,195000.0,7811100.0,,\nQQQ,20010313,427800.0,447400.0,421000.0,446800.0,79151000.0,0.6417982823349031,0.789800662539054\nSPY,20010314,185000.0,205000.0,183800.0,203100.0,8516700.0,,\nQQQ,20010314,427000.0,451900.0,421000.0,435100.0,95895400.0,0.6521129156847122,0.7876109662256799\nSPY,20010315,208800.0,219400.0,196900.0,197500.0,9131500.0,,\nQQQ,20010315,452000.0,459500.0,422500.0,423200.0,68653700.0,0.6627589795305728,0.7858528666978574\nSPY,20010316,188800.0,203100.0,188800.0,195800.0,6447700.0,,\nQQQ,20010316,418800.0,442500.0,400500.0,411000.0,76209500.0,0.6811183230965979,0.7836358390783194\nSPY,20010319,197500.0,206300.0,195000.0,205600.0,6164700.0,,\nQQQ,20010319,414400.0,432500.0,407500.0,431900.0,52692800.0,0.7108700911050828,0.7803211297629957\nSPY,20010320,207500.0,209400.0,196900.0,197300.0,8244500.0,,\nQQQ,20010320,434400.0,452000.0,402000.0,402000.0,105692400.0,0.7069156173064445,0.7777636550077299\nSPY,20010321,197800.0,208800.0,193800.0,200600.0,6530700.0,,\nQQQ,20010321,405200.0,442500.0,388300.0,401000.0,93462300.0,0.7017626750273419,0.7745543025012958\nSPY,20010322,203800.0,217500.0,201900.0,216300.0,12540500.0,,\nQQQ,20010322,406000.0,426600.0,387500.0,425000.0,137815500.0,0.6956580556469942,0.7702552245008109\nSPY,20010323,220000.0,235600.0,220000.0,229400.0,16460400.0,,\nQQQ,20010323,435500.0,438300.0,415000.0,425200.0,97528100.0,0.6888666200136493,0.7651473979178172\nSPY,20010326,231300.0,237500.0,211000.0,217900.0,12710300.0,,\nQQQ,20010326,434700.0,439000.0,415500.0,419300.0,56139500.0,0.6819770089636177,0.7603826427084883\nSPY,20010327,219400.0,230500.0,219000.0,228600.0,9367700.0,,\nQQQ,20010327,418000.0,445600.0,412700.0,432500.0,66475700.0,0.6747550604560582,0.755128214041229\nSPY,20010328,220800.0,228000.0,215000.0,221600.0,9942300.0,,\nQQQ,20010328,419000.0,422000.0,399000.0,399000.0,77522400.0,0.6675658312637414,0.7500331354655627\nSPY,20010329,217700.0,236300.0,215000.0,225300.0,10635600.0,,\nQQQ,20010329,393800.0,406100.0,373300.0,389700.0,79643600.0,0.6614226883948485,0.7443857682195043\nSPY,20010330,225500.0,227200.0,213400.0,220800.0,7157900.0,,\nQQQ,20010330,393000.0,399800.0,380000.0,391300.0,63067100.0,0.6564926917736376,0.7392996882372456\nSPY,20010402,220900.0,226600.0,214000.0,215700.0,5547200.0,,\nQQQ,20010402,391700.0,399100.0,366700.0,377500.0,69169900.0,0.650222039797058,0.7343073436029829\nSPY,20010403,213600.0,214000.0,201300.0,202300.0,6406000.0,,\nQQQ,20010403,372000.0,392500.0,346200.0,348600.0,86663600.0,0.6462314033344653,0.7303029695365969\nSPY,20010404,197600.0,202500.0,187500.0,197000.0,11674800.0,,\nQQQ,20010404,347100.0,358100.0,330500.0,341000.0,74655900.0,0.6425410602148928,0.7270117339977642\nSPY,20010405,206000.0,270000.0,200000.0,208700.0,7732000.0,,\nQQQ,20010405,360000.0,379600.0,357000.0,377700.0,89159500.0,0.639629554828793,0.7224801923342492\nSPY,20010406,208000.0,210400.0,199000.0,205800.0,5531600.0,,\nQQQ,20010406,369000.0,371000.0,355000.0,361500.0,86475100.0,0.635876211336617,0.7180243888319151\nSPY,20010409,206900.0,213400.0,200000.0,205500.0,4314600.0,,\nQQQ,20010409,367900.0,379500.0,350500.0,369500.0,50189400.0,0.6305779193424329,0.7133698663918296\nSPY,20010410,209000.0,227000.0,207800.0,220500.0,7863700.0,,\nQQQ,20010410,379000.0,404600.0,377800.0,399000.0,97463700.0,0.627610953404365,0.7079269749190071\nSPY,20010411,229800.0,230000.0,212800.0,217400.0,5567700.0,,\nQQQ,20010411,421600.0,425000.0,404500.0,411000.0,92204700.0,0.6255050528930903,0.7035215446260622\nSPY,20010412,214200.0,230200.0,211500.0,224100.0,5166000.0,,\nQQQ,20010412,403000.0,434000.0,400000.0,427000.0,78626700.0,0.6252009218619045,0.7012943919226333\nSPY,20010416,220800.0,224000.0,208600.0,214500.0,4840700.0,,\nQQQ,20010416,419400.0,424300.0,406300.0,411200.0,61071600.0,0.6258723168844696,0.7001466958914555\nSPY,20010417,212000.0,212100.0,196000.0,203300.0,11454500.0,,\nQQQ,20010417,399500.0,424500.0,399000.0,416500.0,85919400.0,0.6300197980101636,0.7016269650620173\nSPY,20010418,215700.0,240800.0,210800.0,227400.0,18293300.0,,\nQQQ,20010418,437200.0,510000.0,431200.0,455900.0,123366600.0,0.6325277213530348,0.6997502515097419\nSPY,20010419,254700.0,263500.0,227000.0,257100.0,31835400.0,,\nQQQ,20010419,461000.0,487300.0,438000.0,487000.0,118045800.0,0.6331016718308243,0.6963634052810234\nSPY,20010420,249500.0,256500.0,246000.0,250000.0,11065500.0,,\nQQQ,20010420,481800.0,495500.0,430500.0,481800.0,78204100.0,0.6344851082538303,0.6938407991228458\nSPY,20010423,243400.0,255600.0,240000.0,242500.0,8252400.0,,\nQQQ,20010423,469900.0,495000.0,448900.0,451300.0,78734700.0,0.636627084972641,0.6914475477691527\nSPY,20010424,243300.0,255500.0,235100.0,240300.0,6662400.0,,\nQQQ,20010424,451000.0,466000.0,437500.0,439200.0,87153500.0,0.6403913497431868,0.6896950713744854\nSPY,20010425,242100.0,248600.0,235700.0,247300.0,5714200.0,,\nQQQ,20010425,439000.0,462400.0,430200.0,452500.0,66242700.0,0.6427031616315843,0.6865324401402065\nSPY,20010426,251700.0,266700.0,244900.0,247100.0,14075400.0,,\nQQQ,20010426,459000.0,465000.0,437000.0,439700.0,70252600.0,0.6454795802429814,0.6835377826810264\nSPY,20010427,252000.0,262900.0,247500.0,262000.0,7687700.0,,\nQQQ,20010427,451500.0,466300.0,442400.0,451100.0,56644300.0,0.6467398230613788,0.6790981008262432\nSPY,20010430,266600.0,271200.0,248700.0,254900.0,8578000.0,,\nQQQ,20010430,462500.0,475900.0,451000.0,462300.0,71109700.0,0.6471042789404736,0.6736404529013871\nSPY,20010501,254000.0,265000.0,252000.0,259300.0,7368100.0,,\nQQQ,20010501,462000.0,479000.0,451500.0,478500.0,53341000.0,0.6469960458222533,0.6675262824760895\nSPY,20010502,263400.0,267000.0,257600.0,265800.0,6323200.0,,\nQQQ,20010502,488000.0,498000.0,468200.0,489000.0,76506000.0,0.6486676680037249,0.6636450776315055\nSPY,20010503,262500.0,299300.0,241000.0,249300.0,5129500.0,,\nQQQ,20010503,479000.0,489300.0,462000.0,468100.0,66584000.0,0.650858626883009,0.6600763868006446\nSPY,20010504,242400.0,258500.0,239600.0,257100.0,4724700.0,,\nQQQ,20010504,453000.0,481600.0,451100.0,479500.0,72450800.0,0.6525323808697823,0.65639046819545\nSPY,20010507,256200.0,266500.0,248400.0,249600.0,4771800.0,,\nQQQ,20010507,480000.0,487500.0,427900.0,472100.0,44587600.0,0.6534565247986986,0.6515451042202569\nSPY,20010508,253500.0,254500.0,239500.0,246000.0,5406400.0,,\nQQQ,20010508,483000.0,494800.0,469900.0,481500.0,54614100.0,0.6560036256127983,0.6476333436110184\nSPY,20010509,241400.0,245500.0,230000.0,239500.0,8202100.0,,\nQQQ,20010509,470500.0,479600.0,464200.0,467300.0,60699300.0,0.6588196912254318,0.643809319221713\nSPY,20010510,242100.0,245000.0,229500.0,229900.0,4735300.0,,\nQQQ,20010510,479200.0,481200.0,450900.0,458200.0,59892700.0,0.6630767048157318,0.6416129141944994\nSPY,20010511,230100.0,234900.0,227600.0,228600.0,3430100.0,,\nQQQ,20010511,458400.0,464200.0,450000.0,453800.0,49665800.0,0.6666048236728102,0.6381946957308413\nSPY,20010514,228900.0,236800.0,227500.0,233100.0,4542000.0,,\nQQQ,20010514,453000.0,473300.0,433500.0,446900.0,43110100.0,0.6709354544791349,0.6346376287455923\nSPY,20010515,233700.0,280000.0,230400.0,231700.0,4189100.0,,\nQQQ,20010515,449000.0,463000.0,442000.0,447500.0,69238500.0,0.6729534904064304,0.630050855159985\nSPY,20010516,232600.0,245000.0,228500.0,241100.0,5454800.0,,\nQQQ,20010516,443100.0,475200.0,440600.0,472600.0,80099100.0,0.6746241186294545,0.624695454163065\nSPY,20010517,242300.0,243300.0,232200.0,235500.0,5697300.0,,\nQQQ,20010517,474500.0,487900.0,470000.0,480300.0,73045600.0,0.6768190750491672,0.6199464509436444\nSPY,20010518,233600.0,236400.0,231200.0,235300.0,2856000.0,,\nQQQ,20010518,476400.0,488000.0,470000.0,481000.0,39510500.0,0.6805639431470133,0.6154951509104092\nSPY,20010521,236300.0,239100.0,230500.0,235500.0,7902800.0,,\nQQQ,20010521,481700.0,511200.0,476500.0,511000.0,85177700.0,0.6851112930820276,0.6122767718032996\nSPY,20010522,240000.0,241300.0,234000.0,235000.0,7130400.0,,\nQQQ,20010522,513100.0,519600.0,500200.0,509100.0,79936700.0,0.6889429596904579,0.6086492165560549\nSPY,20010523,237500.0,252500.0,228600.0,233000.0,4477300.0,,\nQQQ,20010523,504500.0,510100.0,487700.0,488000.0,63701400.0,0.6943802862371946,0.6062732147367483\nSPY,20010524,232900.0,233000.0,226200.0,232900.0,4302900.0,,\nQQQ,20010524,489700.0,499800.0,458500.0,499100.0,61504700.0,0.6989555108386005,0.6026677810150423\nSPY,20010525,232000.0,232900.0,225000.0,227600.0,2767000.0,,\nQQQ,20010525,499600.0,500200.0,480200.0,489000.0,35867000.0,0.7044180316775249,0.5993350418376007\nSPY,20010529,223200.0,225000.0,208100.0,214400.0,9877700.0,,\nQQQ,20010529,485000.0,489500.0,464500.0,467000.0,65791600.0,0.7099674947414869,0.5965504655220939\nSPY,20010530,207400.0,215000.0,193000.0,197600.0,13040100.0,,\nQQQ,20010530,454400.0,458500.0,421800.0,443000.0,80711900.0,0.7130057824298703,0.5933177220524608\nSPY,20010531,198000.0,202400.0,194900.0,199500.0,7583400.0,,\nQQQ,20010531,445400.0,459500.0,441500.0,448500.0,69693600.0,0.716326968621741,0.590182838249445\nSPY,20010601,201300.0,215000.0,199800.0,208900.0,7055400.0,,\nQQQ,20010601,455400.0,462300.0,443300.0,459200.0,60100500.0,0.7188638635472363,0.5848189287068132\nSPY,20010604,211000.0,211100.0,204600.0,206500.0,4877200.0,,\nQQQ,20010604,463400.0,469000.0,445500.0,457600.0,41102300.0,0.7198901466349465,0.5784235557815601\nSPY,20010605,208000.0,211000.0,203500.0,209400.0,8040600.0,,\nQQQ,20010605,463000.0,483600.0,462000.0,479600.0,66255700.0,0.7210827503436712,0.5716400114944559\nSPY,20010606,209300.0,209300.0,203300.0,207400.0,3801700.0,,\nQQQ,20010606,480800.0,488900.0,455500.0,474300.0,60944800.0,0.7236429875049096,0.5653781188286349\nSPY,20010607,207100.0,217000.0,204500.0,216700.0,5600800.0,,\nQQQ,20010607,471400.0,494900.0,466400.0,488900.0,59904000.0,0.7266196629561236,0.5579741553251342\nSPY,20010608,216500.0,216500.0,207100.0,213200.0,5864900.0,,\nQQQ,20010608,487200.0,489000.0,469500.0,472700.0,56323600.0,0.7294854350470493,0.550756162647467\nSPY,20010611,210500.0,210700.0,199500.0,200500.0,4782900.0,,\nQQQ,20010611,469000.0,484700.0,454900.0,460400.0,48320700.0,0.7326863654123216,0.5442835530378587\nSPY,20010612,197700.0,206900.0,197600.0,203100.0,5749300.0,,\nQQQ,20010612,448700.0,468000.0,442300.0,461700.0,78438100.0,0.7363468192785022,0.5379842813547229\nSPY,20010613,214200.0,220100.0,200600.0,204700.0,8722600.0,,\nQQQ,20010613,462700.0,467500.0,445500.0,445800.0,68349600.0,0.7398900104729919,0.531058738903285\nSPY,20010614,200400.0,221800.0,197700.0,198900.0,5204900.0,,\nQQQ,20010614,440300.0,444000.0,420700.0,426700.0,88936900.0,0.7437512254881903,0.5257990610564566\nSPY,20010615,201000.0,215000.0,193500.0,204200.0,7551700.0,,\nQQQ,20010615,418000.0,438500.0,412800.0,424600.0,83800700.0,0.7477344257598056,0.5190098999734586\nSPY,20010618,204100.0,208500.0,200000.0,203300.0,6071100.0,,\nQQQ,20010618,426400.0,431700.0,410400.0,415800.0,59699500.0,0.7513423473148579,0.5119632527752711\nSPY,20010619,208500.0,214000.0,200100.0,201700.0,5640500.0,,\nQQQ,20010619,433200.0,435600.0,412600.0,418000.0,71801900.0,0.7558883616745145,0.5047080435833381\nSPY,20010620,200000.0,218500.0,199800.0,216700.0,7809500.0,,\nQQQ,20010620,413000.0,429900.0,412000.0,429200.0,83728600.0,0.7633641452205145,0.4958119054622055\nSPY,20010621,215500.0,230000.0,211000.0,224900.0,5661100.0,,\nQQQ,20010621,426700.0,442300.0,423000.0,436500.0,65080900.0,0.7606528069473543,0.48615454183911755\nSPY,20010622,224800.0,230000.0,217600.0,222500.0,5199900.0,,\nQQQ,20010622,436200.0,442000.0,420700.0,431000.0,51549000.0,0.7583722247764976,0.4766321570936851\nSPY,20010625,225000.0,240000.0,224500.0,239900.0,7584900.0,,\nQQQ,20010625,436100.0,438000.0,426500.0,434400.0,37957000.0,0.756115462580971,0.4663470542707276\nSPY,20010626,233400.0,239900.0,230100.0,237400.0,4751300.0,,\nQQQ,20010626,425400.0,454500.0,424800.0,436000.0,60733700.0,0.7535899304179268,0.45606401748063086\nSPY,20010627,238300.0,240000.0,225000.0,233100.0,6324100.0,,\nQQQ,20010627,436800.0,441500.0,430000.0,437300.0,52390000.0,0.7513435991311809,0.44590029941338183\nSPY,20010628,230900.0,239100.0,229400.0,235400.0,6034200.0,,\nQQQ,20010628,444000.0,463600.0,443300.0,450900.0,89045500.0,0.7488821762395803,0.4358158814059399\nSPY,20010629,236600.0,257500.0,228900.0,241700.0,7861700.0,,\nQQQ,20010629,450900.0,465200.0,425500.0,460000.0,58494400.0,0.7466974398257947,0.4256036084557355\nSPY,20010702,236400.0,242300.0,226900.0,239100.0,3935600.0,,\nQQQ,20010702,456500.0,464800.0,451900.0,454800.0,49351300.0,0.744190145588917,0.4151873675030012\nSPY,20010703,236500.0,241800.0,235000.0,238400.0,2015000.0,,\nQQQ,20010703,452500.0,464500.0,448000.0,455000.0,25147800.0,0.7414073622102704,0.404660518901836\nSPY,20010705,236000.0,237700.0,217500.0,231500.0,2458000.0,,\nQQQ,20010705,448700.0,451900.0,408000.0,436700.0,41670100.0,0.7391223587491641,0.39402081300515324\nSPY,20010706,227600.0,229600.0,217200.0,220400.0,5190300.0,,\nQQQ,20010706,430100.0,432200.0,414900.0,416500.0,51795400.0,0.7364620785155337,0.38366250046490213\nSPY,20010709,220900.0,230000.0,212900.0,226900.0,5972700.0,,\nQQQ,20010709,419000.0,426900.0,415000.0,422500.0,44272300.0,0.733316700415299,0.37268865210839236\nSPY,20010710,229500.0,230800.0,208400.0,211300.0,6434500.0,,\nQQQ,20010710,427600.0,429300.0,404400.0,405400.0,57261700.0,0.7305589383269943,0.3632437661542052\nSPY,20010711,210300.0,225500.0,210000.0,225300.0,8163000.0,,\nQQQ,20010711,404200.0,411000.0,398700.0,409000.0,70997400.0,0.7275412873481308,0.35176725748792914\nSPY,20010712,233000.0,248100.0,233000.0,243600.0,10560700.0,,\nQQQ,20010712,426300.0,438300.0,409500.0,436200.0,67236900.0,0.7235372514261135,0.34000647525482375\nSPY,20010713,241300.0,250100.0,234300.0,248400.0,8139400.0,,\nQQQ,20010713,433800.0,444300.0,429000.0,436400.0,63548700.0,0.7190574243670277,0.32814183429507654\nSPY,20010716,248800.0,251000.0,239100.0,239600.0,4421600.0,,\nQQQ,20010716,433700.0,441600.0,419000.0,420200.0,52420600.0,0.714044950966401,0.31584938536746604\nSPY,20010717,239800.0,252200.0,229600.0,250800.0,10158000.0,,\nQQQ,20010717,418300.0,431200.0,415400.0,430600.0,57271300.0,0.7084986512967631,0.3033638416953772\nSPY,20010718,218500.0,227800.0,204200.0,207900.0,19256400.0,,\nQQQ,20010718,422800.0,428500.0,411400.0,415400.0,59593600.0,0.7042806589362423,0.29366636116880346\nSPY,20010719,212300.0,214200.0,197500.0,199500.0,15090600.0,,\nQQQ,20010719,424600.0,433500.0,410000.0,422500.0,72354800.0,0.7009921914113003,0.28545844179361757\nSPY,20010720,197000.0,200600.0,194900.0,199800.0,7595600.0,,\nQQQ,20010720,414900.0,421500.0,411000.0,418100.0,52048800.0,0.69677599149833,0.2772715964994051\nSPY,20010723,200900.0,205000.0,195100.0,195200.0,4031500.0,,\nQQQ,20010723,422400.0,432300.0,405500.0,406400.0,54783500.0,0.6929055645403095,0.2698927499049421\nSPY,20010724,193900.0,199200.0,187300.0,190700.0,5975800.0,,\nQQQ,20010724,403800.0,409000.0,393100.0,400100.0,68604800.0,0.6899914769354781,0.2639937969846836\nSPY,20010725,191200.0,193000.0,179700.0,184800.0,8130300.0,,\nQQQ,20010725,401400.0,407500.0,394000.0,405400.0,68750100.0,0.6867532509370352,0.25983143383171403\nSPY,20010726,184800.0,188000.0,178500.0,186000.0,6454800.0,,\nQQQ,20010726,404500.0,418900.0,399800.0,416800.0,67815000.0,0.6835388798299469,0.25444197755291303\nSPY,20010727,187500.0,192500.0,185000.0,189000.0,5884600.0,,\nQQQ,20010727,416400.0,428000.0,409000.0,419400.0,46802200.0,0.6805063510810498,0.24815008605384373\nSPY,20010730,191200.0,199000.0,185100.0,189300.0,4297600.0,,\nQQQ,20010730,421300.0,423000.0,414000.0,416500.0,38357700.0,0.6784740628670132,0.2419057606901701\nSPY,20010731,192700.0,194200.0,185100.0,187800.0,4030400.0,,\nQQQ,20010731,418400.0,427800.0,415000.0,419500.0,53883800.0,0.675701286435003,0.23581750315130817\nSPY,20010801,190100.0,197800.0,189500.0,190500.0,5208600.0,,\nQQQ,20010801,426400.0,435000.0,418900.0,430400.0,52746700.0,0.6732845809197961,0.22843190207351122\nSPY,20010802,196500.0,198700.0,192600.0,198200.0,4380600.0,,\nQQQ,20010802,438000.0,440000.0,423100.0,436800.0,50312800.0,0.6709134786857781,0.21886039104122365\nSPY,20010803,198900.0,199000.0,190000.0,195100.0,3280300.0,,\nQQQ,20010803,435300.0,438000.0,421000.0,430500.0,50402400.0,0.667900709979956,0.21009211377138087\nSPY,20010806,190400.0,196600.0,190000.0,191300.0,1695300.0,,\nQQQ,20010806,425400.0,429000.0,423500.0,424800.0,29624300.0,0.6649448241694389,0.2025381667146271\nSPY,20010807,193300.0,196700.0,189800.0,192500.0,2839600.0,,\nQQQ,20010807,421000.0,428200.0,419400.0,422800.0,36068800.0,0.6614193171414112,0.1947994830410591\nSPY,20010808,192600.0,197000.0,185400.0,189000.0,4699400.0,,\nQQQ,20010808,418500.0,435700.0,403000.0,404900.0,75797500.0,0.6580502039061766,0.18864110027002373\nSPY,20010809,189600.0,191500.0,187200.0,190500.0,3550200.0,,\nQQQ,20010809,404100.0,408800.0,399800.0,405800.0,66912200.0,0.654358345690146,0.18202191161446155\nSPY,20010810,190400.0,193200.0,185900.0,190200.0,3246100.0,,\nQQQ,20010810,404300.0,407500.0,392300.0,403300.0,70475700.0,0.6509627494127953,0.17535094561379724\nSPY,20010813,191000.0,193300.0,187600.0,190900.0,2553800.0,,\nQQQ,20010813,405900.0,413400.0,401100.0,412300.0,48215100.0,0.6472624907597523,0.16801708236216764\nSPY,20010814,192000.0,193600.0,186700.0,187400.0,3994000.0,,\nQQQ,20010814,414900.0,427500.0,405400.0,406200.0,48940300.0,0.6432745865903999,0.16219048548433923\nSPY,20010815,187600.0,189400.0,182000.0,184200.0,4396000.0,,\nQQQ,20010815,406200.0,415000.0,387000.0,391500.0,57162600.0,0.639216305764319,0.15764469008235774\nSPY,20010816,182700.0,190900.0,179700.0,186500.0,4917500.0,,\nQQQ,20010816,386500.0,393900.0,380400.0,393700.0,66777900.0,0.6346426627990804,0.1522256550324701\nSPY,20010817,180000.0,184500.0,179900.0,180700.0,3421800.0,,\nQQQ,20010817,384400.0,392600.0,377100.0,378000.0,56438200.0,0.6289251820848409,0.14801130825597128\nSPY,20010820,181400.0,188700.0,178100.0,181300.0,4403000.0,,\nQQQ,20010820,378500.0,388000.0,372000.0,382500.0,48996200.0,0.6233581959309098,0.14375421810469305\nSPY,20010821,181400.0,181400.0,177000.0,179300.0,3105200.0,,\nQQQ,20010821,382900.0,386500.0,368900.0,369200.0,53873000.0,0.6173410202742862,0.13994855798178707\nSPY,20010822,179400.0,182500.0,171000.0,182200.0,2960500.0,,\nQQQ,20010822,374500.0,381800.0,365400.0,376900.0,63321700.0,0.6107804246902611,0.13578145388267604\nSPY,20010823,182000.0,183400.0,175800.0,178100.0,3411200.0,,\nQQQ,20010823,376800.0,393900.0,371700.0,373200.0,52627100.0,0.6030460418297189,0.13180632002818848\nSPY,20010824,180000.0,186200.0,176500.0,185600.0,5144000.0,,\nQQQ,20010824,378600.0,396000.0,373500.0,393600.0,58194300.0,0.5940122892121165,0.12640305623459\nSPY,20010827,186000.0,193000.0,181600.0,189100.0,2996000.0,,\nQQQ,20010827,392800.0,399900.0,387600.0,393500.0,50453200.0,0.5843803176135421,0.11990268757251582\nSPY,20010828,189000.0,191400.0,184000.0,184000.0,2857700.0,,\nQQQ,20010828,393200.0,399600.0,380100.0,380700.0,64854400.0,0.5738268225280896,0.11523053587971391\nSPY,20010829,184400.0,188300.0,178300.0,178300.0,4091900.0,,\nQQQ,20010829,383700.0,384500.0,371300.0,373500.0,58143600.0,0.5625745707701089,0.11108967693618575\nSPY,20010830,177400.0,181800.0,172800.0,178300.0,6236000.0,,\nQQQ,20010830,368000.0,373100.0,357500.0,362000.0,75646400.0,0.5502184898408686,0.10699383108563802\nSPY,20010831,177300.0,186000.0,176500.0,184900.0,3667900.0,,\nQQQ,20010831,360400.0,370300.0,359400.0,366000.0,54054800.0,0.5351212821294619,0.10237679499455149\nSPY,20010904,185000.0,190800.0,176300.0,182700.0,5838200.0,,\nQQQ,20010904,365200.0,375000.0,354200.0,354800.0,68143200.0,0.5178892261431494,0.09795174758338845\nSPY,20010905,182400.0,189500.0,181200.0,185500.0,6377400.0,,\nQQQ,20010905,354900.0,359100.0,341500.0,352800.0,97184300.0,0.5009902483099807,0.09271493134385397\nSPY,20010906,184000.0,189300.0,176500.0,177600.0,4776500.0,,\nQQQ,20010906,347400.0,355200.0,329900.0,339600.0,86160800.0,0.4862525220941217,0.08872592239616245\nSPY,20010907,175000.0,181000.0,172000.0,172900.0,4254500.0,,\nQQQ,20010907,336200.0,351000.0,333500.0,337800.0,94698900.0,0.46787228184846064,0.08482614966705826\nSPY,20010910,170000.0,175000.0,169200.0,173700.0,5521300.0,,\nQQQ,20010910,334900.0,348800.0,333400.0,340000.0,81278700.0,0.451050100037936,0.0809128790225375\nSPY,20010917,160000.0,170700.0,157300.0,170000.0,7867200.0,,\nQQQ,20010917,312500.0,328000.0,312000.0,312200.0,95411900.0,0.43519913890093453,0.07767375426499395\nSPY,20010918,169000.0,177200.0,161700.0,162800.0,5654900.0,,\nQQQ,20010918,315300.0,325000.0,303700.0,304900.0,65111300.0,0.41953784851861764,0.07535323763961843\nSPY,20010919,165000.0,170800.0,156000.0,170300.0,6367400.0,,\nQQQ,20010919,306400.0,310000.0,282600.0,301100.0,115755400.0,0.4004880201674663,0.07198700751154902\nSPY,20010920,162900.0,169500.0,155000.0,156800.0,6304700.0,,\nQQQ,20010920,293000.0,300900.0,288500.0,289800.0,90193400.0,0.38097100540374584,0.06962749690830321\nSPY,20010921,150000.0,162500.0,146800.0,157300.0,9512200.0,,\nQQQ,20010921,274100.0,289700.0,270000.0,281700.0,113189400.0,0.36175948325081236,0.06725748792640002\nSPY,20010924,161100.0,168400.0,159500.0,164400.0,5032100.0,,\nQQQ,20010924,290800.0,300000.0,285900.0,296100.0,90878300.0,0.34132249144468746,0.0646317684357707\nSPY,20010925,161400.0,162200.0,153500.0,155500.0,6531700.0,,\nQQQ,20010925,297100.0,304300.0,288900.0,295000.0,82499400.0,0.31394542618739,0.06222426524437688\nSPY,20010926,158100.0,158900.0,149300.0,151500.0,8668800.0,,\nQQQ,20010926,299500.0,300000.0,284100.0,285100.0,57647500.0,0.28119875242342873,0.05995849016485767\nSPY,20010927,152500.0,157500.0,152000.0,155000.0,5500300.0,,\nQQQ,20010927,284000.0,288000.0,274100.0,285100.0,67806600.0,0.24767731465611795,0.05752475181091951\nSPY,20010928,157100.0,159100.0,153900.0,155000.0,5304200.0,,\nQQQ,20010928,288400.0,299400.0,280000.0,290600.0,83837100.0,0.2122169743542275,0.055075077499714555\nSPY,20011001,154900.0,159900.0,152300.0,155000.0,3473100.0,,\nQQQ,20011001,288500.0,323600.0,278500.0,286100.0,52781600.0,0.17204365507443906,0.05261117418878984\nSPY,20011002,154300.0,158300.0,148800.0,150500.0,3772800.0,,\nQQQ,20011002,286500.0,299700.0,280000.0,288400.0,77309500.0,0.12794234667424992,0.05060110773383679\nSPY,20011003,149500.0,155000.0,148300.0,149700.0,12254000.0,,\nQQQ,20011003,284300.0,316100.0,283300.0,310500.0,133162300.0,0.07646529328227895,0.04864127444797088\nSPY,20011004,153500.0,162500.0,150000.0,158700.0,6880500.0,,\nQQQ,20011004,316500.0,332000.0,309400.0,313900.0,126378100.0,-0.019093319319802383,0.04612466121976784\nSPY,20011005,154000.0,161500.0,149900.0,161400.0,6063900.0,,\nQQQ,20011005,310000.0,319000.0,302600.0,316500.0,95137800.0,-0.032216874604797704,0.04387388213620067\nSPY,20011008,155800.0,163500.0,155000.0,162200.0,3343400.0,,\nQQQ,20011008,311300.0,323500.0,309600.0,318500.0,66660200.0,-0.03968801993683493,0.042822918656067605\nSPY,20011009,160500.0,162000.0,156300.0,160100.0,2996400.0,,\nQQQ,20011009,318600.0,320200.0,290000.0,309700.0,55918700.0,-0.03935037432422419,0.0455404924602092\nSPY,20011010,161000.0,168500.0,159500.0,168100.0,5334800.0,,\nQQQ,20011010,308700.0,326000.0,307500.0,324800.0,70647400.0,-0.04675055430233062,0.04475986257957231\nSPY,20011011,169200.0,177400.0,168500.0,177300.0,5932400.0,,\nQQQ,20011011,331900.0,363300.0,331400.0,346000.0,113872600.0,-0.051559578676641016,0.045469423844853\nSPY,20011012,173100.0,180800.0,168600.0,180100.0,5089300.0,,\nQQQ,20011012,343300.0,348000.0,322000.0,347100.0,111213100.0,-0.056382560139086796,0.04615519306500329\nSPY,20011015,179500.0,183800.0,173600.0,180000.0,5284000.0,,\nQQQ,20011015,341200.0,349700.0,336600.0,343200.0,88414300.0,-0.05999160520035031,0.04754811212272745\nSPY,20011016,180900.0,182000.0,177700.0,179900.0,3523800.0,,\nQQQ,20011016,346700.0,350600.0,340700.0,349500.0,81013200.0,-0.06095135139752555,0.050255195062975544\nSPY,20011017,183400.0,184100.0,169600.0,169800.0,4573100.0,,\nQQQ,20011017,358700.0,369500.0,323000.0,327900.0,154599400.0,-0.05606504265821154,0.0579133793656666\nSPY,20011018,172900.0,182300.0,172900.0,180000.0,10969600.0,,\nQQQ,20011018,327000.0,346900.0,320900.0,331700.0,90973000.0,-0.05372090004833913,0.06365376778165566\nSPY,20011019,179400.0,184000.0,178800.0,182900.0,2915100.0,,\nQQQ,20011019,328700.0,345000.0,320000.0,335500.0,69141300.0,-0.058708049530541574,0.06436240873958585\nSPY,20011022,182100.0,190700.0,180900.0,190100.0,9710700.0,,\nQQQ,20011022,334400.0,345000.0,330400.0,344400.0,72150100.0,-0.06354605989142846,0.06313784716889802\nSPY,20011023,191200.0,194200.0,178700.0,181500.0,11853100.0,,\nQQQ,20011023,348200.0,358600.0,340000.0,345600.0,108646000.0,-0.06276812301272723,0.06758874926755387\nSPY,20011024,180600.0,191200.0,177500.0,189500.0,6595900.0,,\nQQQ,20011024,346000.0,356800.0,342000.0,354400.0,88422300.0,-0.06334133039822847,0.06946832096587159\nSPY,20011025,184400.0,192500.0,181600.0,190800.0,4500500.0,,\nQQQ,20011025,347100.0,368200.0,342300.0,367600.0,120707500.0,-0.06059235088885354,0.07471338494823092\nSPY,20011026,188600.0,192500.0,186200.0,186700.0,4817900.0,,\nQQQ,20011026,365000.0,370600.0,333200.0,362600.0,92281300.0,-0.059242961465937855,0.07965234691179049\nSPY,20011029,185700.0,186700.0,166400.0,176200.0,3961400.0,,\nQQQ,20011029,360000.0,369900.0,342000.0,342500.0,90782900.0,-0.0590111499605687,0.08369341740645453\nSPY,20011030,173800.0,180000.0,170600.0,176000.0,4837200.0,,\nQQQ,20011030,337100.0,377100.0,314500.0,334000.0,92425500.0,-0.053284307619687714,0.09282734040480004\nSPY,20011031,177300.0,184000.0,161700.0,175600.0,4761900.0,,\nQQQ,20011031,340400.0,355800.0,336800.0,339600.0,105198200.0,-0.04673733733836257,0.10280598271079851\nSPY,20011101,176500.0,187800.0,172500.0,186000.0,5312400.0,,\nQQQ,20011101,344400.0,355600.0,337800.0,354400.0,92836500.0,-0.04208126991619309,0.11104589221629632\nSPY,20011102,185200.0,188600.0,181600.0,185800.0,3368800.0,,\nQQQ,20011102,352700.0,358500.0,348900.0,355000.0,63444000.0,-0.037197679982776545,0.11968603193460693\nSPY,20011105,188400.0,192500.0,186100.0,191700.0,4098600.0,,\nQQQ,20011105,362600.0,371600.0,361600.0,368400.0,62362700.0,-0.035798697000985535,0.12268928610545221\nSPY,20011106,189600.0,196200.0,185300.0,195700.0,5505300.0,,\nQQQ,20011106,366100.0,379800.0,357100.0,379200.0,110400900.0,-0.03555343124335779,0.12432613822871143\nSPY,20011107,194600.0,201300.0,193300.0,195900.0,6191700.0,,\nQQQ,20011107,376100.0,388400.0,371000.0,379500.0,91493000.0,-0.038711387368523975,0.1228691195303928\nSPY,20011108,196300.0,200000.0,185700.0,187000.0,5899500.0,,\nQQQ,20011108,385500.0,399700.0,372500.0,376500.0,117043400.0,-0.04847502194025967,0.12082004716666044\nSPY,20011109,186000.0,192500.0,185500.0,187100.0,2359200.0,,\nQQQ,20011109,376000.0,387500.0,344300.0,376900.0,71811800.0,-0.0589403421767425,0.11870053129336086\nSPY,20011112,186600.0,191700.0,179600.0,187400.0,3512600.0,,\nQQQ,20011112,370000.0,383500.0,363000.0,380400.0,113516600.0,-0.06590347973207597,0.11785243802563115\nSPY,20011113,190800.0,200900.0,187100.0,193600.0,3292100.0,,\nQQQ,20011113,390300.0,399800.0,381000.0,393400.0,95704000.0,-0.07360277414185319,0.11520348305049066\nSPY,20011114,195900.0,200000.0,191500.0,196200.0,3824500.0,,\nQQQ,20011114,399600.0,402400.0,387400.0,395000.0,87957000.0,-0.07577472607549227,0.1147115395460083\nSPY,20011115,194500.0,199000.0,192300.0,194400.0,3597400.0,,\nQQQ,20011115,391600.0,401100.0,389500.0,394100.0,82087600.0,-0.0787439617092279,0.11388331737953235\nSPY,20011116,192800.0,192900.0,184000.0,189700.0,4043700.0,,\nQQQ,20011116,394800.0,399800.0,389200.0,394500.0,70540600.0,-0.07721800083477762,0.11796152361112043\nSPY,20011119,190000.0,200500.0,189600.0,200000.0,5533000.0,,\nQQQ,20011119,397900.0,403400.0,387100.0,403200.0,71648300.0,-0.0774897568220979,0.11927793963011082\nSPY,20011120,198200.0,202000.0,195000.0,195200.0,4446100.0,,\nQQQ,20011120,400800.0,410700.0,384000.0,386300.0,84262300.0,-0.08019300653763184,0.11836498175574449\nSPY,20011121,196100.0,198000.0,192600.0,196900.0,3419600.0,,\nQQQ,20011121,384700.0,389500.0,331800.0,386800.0,60797400.0,-0.08261283749104033,0.11782283981105814\nSPY,20011123,197100.0,199500.0,195700.0,198400.0,1066000.0,,\nQQQ,20011123,387600.0,394600.0,382700.0,393800.0,27694200.0,-0.08185966815067164,0.12060450165193083\nSPY,20011126,199400.0,215500.0,198800.0,213700.0,7386200.0,,\nQQQ,20011126,395800.0,404000.0,390100.0,403000.0,78656500.0,-0.08025245584807336,0.12498715829179319\nSPY,20011127,212000.0,215200.0,205100.0,210000.0,4646600.0,,\nQQQ,20011127,400500.0,409700.0,392000.0,401300.0,105401900.0,-0.07993378912097872,0.1274325200906697\nSPY,20011128,208500.0,222100.0,204100.0,205300.0,4388700.0,,\nQQQ,20011128,397300.0,403700.0,369500.0,387600.0,107577600.0,-0.07896214563428512,0.13091156824577174\nSPY,20011129,206000.0,207000.0,201900.0,204200.0,3512500.0,,\nQQQ,20011129,390400.0,398600.0,367400.0,398400.0,80035400.0,-0.07705335824310765,0.13674979097415338\nSPY,20011130,204700.0,214400.0,202500.0,213000.0,4978700.0,,\nQQQ,20011130,397300.0,400500.0,392300.0,397300.0,65087100.0,-0.07783655700041874,0.13752584041750937\nSPY,20011203,210600.0,212800.0,206000.0,210400.0,3052800.0,,\nQQQ,20011203,392900.0,398200.0,380000.0,390300.0,59201900.0,-0.07657396053316784,0.14158756833356817\nSPY,20011204,210500.0,225600.0,207200.0,224000.0,6669900.0,,\nQQQ,20011204,393400.0,406800.0,384400.0,406500.0,75291200.0,-0.07456485363074897,0.14784644621622026\nSPY,20011205,223600.0,240300.0,220000.0,237500.0,9748900.0,,\nQQQ,20011205,412100.0,431500.0,411200.0,428000.0,113669600.0,-0.07098589310191974,0.1563000076523396\nSPY,20011206,234800.0,235000.0,221400.0,227900.0,5846000.0,,\nQQQ,20011206,427100.0,444900.0,423600.0,427700.0,75755300.0,-0.06526396695354109,0.16659939616251215\nSPY,20011207,224600.0,227100.0,220000.0,225300.0,3169200.0,,\nQQQ,20011207,424900.0,462000.0,411400.0,417200.0,83031500.0,-0.06040722325690665,0.17573874922226718\nSPY,20011210,222900.0,229900.0,222300.0,225400.0,2844100.0,,\nQQQ,20011210,413300.0,422700.0,408800.0,409900.0,69371400.0,-0.05476874025352478,0.1851725830370491\nSPY,20011211,226700.0,228500.0,216500.0,217700.0,3451500.0,,\nQQQ,20011211,414600.0,429800.0,411500.0,413600.0,64052300.0,-0.046654089991927924,0.1952633081704732\nSPY,20011212,218700.0,219200.0,212500.0,214800.0,3230000.0,,\nQQQ,20011212,415000.0,419400.0,405000.0,415700.0,75318100.0,-0.029933983025397713,0.20929502297633476\nSPY,20011213,214900.0,215500.0,205000.0,209900.0,3077300.0,,\nQQQ,20011213,407100.0,499300.0,390000.0,398700.0,78461000.0,-0.013154584096942111,0.22327390786028364\nSPY,20011214,207300.0,208400.0,200900.0,203900.0,3252400.0,,\nQQQ,20011214,398700.0,404600.0,395700.0,400200.0,81937100.0,0.004903895169875632,0.23792051613121165\nSPY,20011217,204000.0,210000.0,201900.0,207000.0,2970900.0,,\nQQQ,20011217,400200.0,412400.0,395800.0,408200.0,62613300.0,0.02546202670669142,0.2525525436055509\nSPY,20011218,208900.0,213300.0,202200.0,210000.0,3979800.0,,\nQQQ,20011218,411600.0,419000.0,408800.0,413000.0,48943000.0,0.04377535765706008,0.2667526903861664\nSPY,20011219,205800.0,216800.0,204700.0,215800.0,5092800.0,,\nQQQ,20011219,405600.0,413200.0,403200.0,405600.0,78018900.0,0.06222930885686062,0.2810385983746199\nSPY,20011220,214000.0,214700.0,206200.0,206700.0,3810800.0,,\nQQQ,20011220,401000.0,419600.0,388000.0,388100.0,82299600.0,0.08150276046313634,0.29531743251440884\nSPY,20011221,210100.0,215400.0,208000.0,210000.0,3355600.0,,\nQQQ,20011221,394200.0,397100.0,384100.0,393000.0,54071800.0,0.1003225179008064,0.3085312360749009\nSPY,20011224,209000.0,217500.0,209000.0,214200.0,888600.0,,\nQQQ,20011224,395400.0,396300.0,391200.0,392000.0,13781200.0,0.11891091057099923,0.3213350640631615\nSPY,20011226,213500.0,223000.0,211400.0,215600.0,2594400.0,,\nQQQ,20011226,393700.0,403000.0,391600.0,396500.0,37810000.0,0.13558623370543105,0.3339424234618338\nSPY,20011227,215800.0,222500.0,215800.0,220700.0,3280800.0,,\nQQQ,20011227,398500.0,408000.0,396000.0,399500.0,33573400.0,0.14670504199639905,0.34557718835403295\nSPY,20011228,219700.0,230000.0,219600.0,224200.0,4845100.0,,\nQQQ,20011228,402900.0,408000.0,400000.0,403400.0,38556000.0,0.15906421995171474,0.3576873772378312\nSPY,20011231,225100.0,226600.0,218300.0,219000.0,2210300.0,,\nQQQ,20011231,403100.0,410800.0,392100.0,392100.0,43090400.0,0.17455949124962575,0.3693870067597991\nSPY,20020102,220500.0,233000.0,219600.0,232500.0,9121200.0,,\nQQQ,20020102,395700.0,400500.0,389300.0,400200.0,67753000.0,0.190339730839011,0.38134871938123677\nSPY,20020103,230000.0,249300.0,227700.0,235500.0,10701000.0,,\nQQQ,20020103,403100.0,419800.0,402600.0,414500.0,84514500.0,0.20816316302714666,0.39446277069705876\nSPY,20020104,233400.0,239500.0,223800.0,236900.0,7677000.0,,\nQQQ,20020104,419500.0,422900.0,399700.0,416500.0,87549900.0,0.22704886664362456,0.40789115024553185\nSPY,20020107,237200.0,240000.0,227500.0,229100.0,7780300.0,,\nQQQ,20020107,421200.0,422200.0,401100.0,410900.0,73078100.0,0.24346313574156936,0.42122816299634835\nSPY,20020108,227500.0,230500.0,220000.0,226400.0,8596000.0,,\nQQQ,20020108,411100.0,417700.0,408400.0,415100.0,67217200.0,0.25449598079602576,0.43475827016583934\nSPY,20020109,228000.0,229300.0,208000.0,216600.0,5679800.0,,\nQQQ,20020109,420400.0,433700.0,409000.0,411300.0,83691000.0,0.2720346106332987,0.44736602341311826\nSPY,20020110,212200.0,214700.0,202600.0,212300.0,7926700.0,,\nQQQ,20020110,411700.0,419200.0,401000.0,412600.0,77405400.0,0.286116639346929,0.45911413922108585\nSPY,20020111,213900.0,218400.0,206000.0,210600.0,6214000.0,,\nQQQ,20020111,413600.0,418900.0,404600.0,406800.0,60523800.0,0.29867665582818026,0.47153675787343047\nSPY,20020114,210100.0,214000.0,209000.0,211500.0,7122500.0,,\nQQQ,20020114,404900.0,411000.0,391000.0,399000.0,70789900.0,0.31076115539839505,0.48332028852316\nSPY,20020115,213200.0,217600.0,212100.0,216800.0,4849000.0,,\nQQQ,20020115,400400.0,409000.0,395600.0,401300.0,63410600.0,0.32161665614985824,0.49418682364732164\nSPY,20020116,214100.0,217000.0,205000.0,207800.0,9480400.0,,\nQQQ,20020116,395400.0,399400.0,387900.0,388200.0,97561400.0,0.33830285266217064,0.5067679631863763\nSPY,20020117,219700.0,227400.0,199000.0,224800.0,11242700.0,,\nQQQ,20020117,394800.0,399800.0,390100.0,398500.0,69688400.0,0.35038572407891944,0.5156732677506066\nSPY,20020118,220000.0,232700.0,212200.0,221700.0,5821500.0,,\nQQQ,20020118,388300.0,399300.0,377300.0,385600.0,78912100.0,0.366616489296056,0.5256380645759942\nSPY,20020122,222700.0,223700.0,218200.0,218200.0,5699400.0,,\nQQQ,20020122,390000.0,399700.0,373300.0,373900.0,81591200.0,0.3828725047742282,0.534701966324436\nSPY,20020123,218000.0,230400.0,215900.0,230100.0,8067000.0,,\nQQQ,20020123,376500.0,386900.0,373500.0,385300.0,75346000.0,0.4028572174267365,0.5443236906798573\nSPY,20020124,229100.0,238300.0,229000.0,232100.0,4829400.0,,\nQQQ,20020124,389400.0,395100.0,379600.0,389600.0,77965900.0,0.4162090679242081,0.5487284922435504\nSPY,20020125,228900.0,234200.0,226500.0,233000.0,3277700.0,,\nQQQ,20020125,384700.0,399800.0,383000.0,388000.0,58013100.0,0.4261443088796367,0.5504194741172527\nSPY,20020128,234000.0,235500.0,227200.0,232500.0,3271400.0,,\nQQQ,20020128,391500.0,393900.0,381500.0,389500.0,47825500.0,0.4380849970503863,0.5527971596055196\nSPY,20020129,232200.0,235400.0,228500.0,230700.0,4150400.0,,\nQQQ,20020129,391300.0,394100.0,375200.0,378600.0,82903400.0,0.4444165217631681,0.5508008728661179\nSPY,20020130,230700.0,241400.0,212100.0,241400.0,8124200.0,,\nQQQ,20020130,380000.0,388500.0,368500.0,382800.0,100341700.0,0.4503975327645356,0.5476791184446057\nSPY,20020131,241600.0,247200.0,232700.0,247200.0,7478000.0,,\nQQQ,20020131,385800.0,387800.0,380200.0,385600.0,68444300.0,0.45694169454320244,0.5456001757763572\nSPY,20020201,243400.0,249600.0,243400.0,245000.0,7019500.0,,\nQQQ,20020201,384000.0,389800.0,377000.0,380600.0,60410100.0,0.46730849633425503,0.5450149619972757\nSPY,20020204,243200.0,255200.0,242000.0,253500.0,9018700.0,,\nQQQ,20020204,379600.0,388300.0,366100.0,367700.0,81961500.0,0.46373896429944883,0.535171178044416\nSPY,20020205,250900.0,259800.0,244500.0,254600.0,7992400.0,,\nQQQ,20020205,365900.0,373300.0,360000.0,364200.0,85944600.0,0.45997386454045575,0.525150149519472\nSPY,20020206,256100.0,259800.0,240400.0,246700.0,10279100.0,,\nQQQ,20020206,368400.0,398500.0,335600.0,360000.0,96051400.0,0.45697809209769463,0.5156874070525833\nSPY,20020207,246500.0,252900.0,240800.0,242800.0,5930500.0,,\nQQQ,20020207,360000.0,365500.0,350000.0,352100.0,96616900.0,0.4581133393928676,0.5074849311557641\nSPY,20020208,244100.0,246400.0,229000.0,240200.0,6199500.0,,\nQQQ,20020208,354600.0,361300.0,349700.0,361000.0,79277700.0,0.4608964284015452,0.5018094613931656\nSPY,20020211,239300.0,252500.0,237400.0,249800.0,7448400.0,,\nQQQ,20020211,361400.0,391700.0,352500.0,367900.0,57597300.0,0.46551784606772345,0.4970022599535791\nSPY,20020212,246600.0,250400.0,244500.0,247100.0,3460200.0,,\nQQQ,20020212,363100.0,369800.0,360400.0,365300.0,48355900.0,0.46674123848294974,0.4899305142229475\nSPY,20020213,247300.0,252400.0,246500.0,249900.0,5211700.0,,\nQQQ,20020213,367200.0,371500.0,360700.0,369500.0,60846400.0,0.4686937454917412,0.4840324218303855\nSPY,20020214,250500.0,252300.0,243200.0,246100.0,4311800.0,,\nQQQ,20020214,371500.0,378000.0,360000.0,367500.0,75775100.0,0.4704725681276568,0.4783861974031621\nSPY,20020215,245300.0,249800.0,238500.0,239200.0,4424100.0,,\nQQQ,20020215,368400.0,389000.0,356400.0,357800.0,64923700.0,0.4779259320326438,0.4773007455327317\nSPY,20020219,237600.0,244100.0,224800.0,226000.0,6650700.0,,\nQQQ,20020219,353800.0,354600.0,340000.0,345600.0,70780900.0,0.48608490809203414,0.4774702185013574\nSPY,20020220,227700.0,232000.0,223500.0,231600.0,4932300.0,,\nQQQ,20020220,349100.0,360700.0,339300.0,350900.0,105033200.0,0.4944389089467787,0.4786561543445934\nSPY,20020221,229200.0,230000.0,214500.0,214500.0,7495800.0,,\nQQQ,20020221,347900.0,349500.0,336000.0,336000.0,108215300.0,0.5071022512805814,0.4811510966173492\nSPY,20020222,216600.0,233600.0,215000.0,227400.0,6994200.0,,\nQQQ,20020222,336200.0,342000.0,311100.0,337600.0,96129700.0,0.5174560988418732,0.4794642403546326\nSPY,20020225,228500.0,247200.0,223600.0,238100.0,6959400.0,,\nQQQ,20020225,340100.0,352500.0,339600.0,350100.0,87795700.0,0.5268169709230703,0.47943799453591945\nSPY,20020226,239100.0,243700.0,232500.0,236600.0,4568600.0,,\nQQQ,20020226,352300.0,359000.0,342500.0,348800.0,93980300.0,0.535588493854271,0.48257727892523267\nSPY,20020227,239400.0,242500.0,209400.0,219800.0,18298000.0,,\nQQQ,20020227,354000.0,360800.0,340000.0,343400.0,93326900.0,0.5440478978615904,0.4871567984918734\nSPY,20020228,221500.0,225900.0,213500.0,217000.0,7791900.0,,\nQQQ,20020228,345100.0,349700.0,337500.0,338500.0,96407300.0,0.5524566456317535,0.49147901694552665\nSPY,20020301,219300.0,235000.0,218200.0,234700.0,6168000.0,,\nQQQ,20020301,341500.0,357300.0,340000.0,357000.0,84833800.0,0.5598467055358821,0.4940454821131257\nSPY,20020304,232600.0,245800.0,227600.0,243100.0,5932700.0,,\nQQQ,20020304,357000.0,372300.0,327400.0,371800.0,105917300.0,0.5664348229567933,0.49365282725511017\nSPY,20020305,241500.0,244300.0,234000.0,235300.0,4654800.0,,\nQQQ,20020305,369400.0,378700.0,344200.0,372700.0,93016600.0,0.5713102974252015,0.4947822394621881\nSPY,20020306,234800.0,243400.0,229300.0,240700.0,3976800.0,,\nQQQ,20020306,370800.0,379500.0,366000.0,377900.0,88847100.0,0.5770561993553243,0.4973273330425623\nSPY,20020307,240600.0,245300.0,236100.0,243700.0,4485500.0,,\nQQQ,20020307,381200.0,383300.0,370100.0,375100.0,82054500.0,0.5828934462051636,0.49879822315979994\nSPY,20020308,247400.0,250900.0,243000.0,246400.0,4659800.0,,\nQQQ,20020308,382300.0,390300.0,381300.0,386600.0,85001000.0,0.5854116130415699,0.4985480446322406\nSPY,20020311,246000.0,251400.0,241000.0,250500.0,4190200.0,,\nQQQ,20020311,383500.0,419100.0,380600.0,386600.0,70091400.0,0.5855140301340298,0.4963494891916514\nSPY,20020312,245100.0,247400.0,241000.0,247400.0,4220200.0,,\nQQQ,20020312,375800.0,387000.0,373200.0,377700.0,79447200.0,0.583645333795133,0.49205042569807006\nSPY,20020313,243700.0,248500.0,241500.0,245000.0,3399700.0,,\nQQQ,20020313,374100.0,376600.0,344500.0,370200.0,72345500.0,0.5823508361525198,0.487562858724582\nSPY,20020314,243000.0,246000.0,238800.0,244300.0,3720200.0,,\nQQQ,20020314,370700.0,379100.0,359100.0,368100.0,71020000.0,0.5810467791267903,0.483458013447399\nSPY,20020315,244600.0,249500.0,217000.0,249500.0,3823400.0,,\nQQQ,20020315,369000.0,373300.0,366000.0,371500.0,63630600.0,0.5781324161784346,0.478823752611997\nSPY,20020318,249500.0,250500.0,243200.0,247300.0,4897900.0,,\nQQQ,20020318,376400.0,379400.0,370000.0,374800.0,78530400.0,0.5759619554893985,0.4746536677408296\nSPY,20020319,246900.0,253000.0,243000.0,248000.0,4123400.0,,\nQQQ,20020319,376100.0,378800.0,347000.0,374300.0,57919600.0,0.5750093979706659,0.4714408051924005\nSPY,20020320,246600.0,251400.0,245000.0,249200.0,5056800.0,,\nQQQ,20020320,368800.0,379000.0,360000.0,361500.0,60864800.0,0.5697004594058115,0.4650192044374154\nSPY,20020321,238600.0,243000.0,230600.0,243000.0,10432500.0,,\nQQQ,20020321,361500.0,371400.0,359000.0,370900.0,91180400.0,0.5670815125701606,0.4598791492762078\nSPY,20020322,242200.0,245600.0,238700.0,240900.0,3458800.0,,\nQQQ,20020322,369400.0,378800.0,364700.0,366200.0,58163100.0,0.5637433288119879,0.4543528205346178\nSPY,20020325,240700.0,240900.0,232400.0,233400.0,4432600.0,,\nQQQ,20020325,366900.0,369900.0,350000.0,355500.0,84092000.0,0.5608281991638432,0.4508580036131899\nSPY,20020326,232000.0,236400.0,224300.0,234600.0,4612100.0,,\nQQQ,20020326,354300.0,367000.0,350000.0,358000.0,93168600.0,0.5572681325135386,0.44641196359019975\nSPY,20020327,233500.0,237200.0,232600.0,234900.0,2167800.0,,\nQQQ,20020327,356400.0,387000.0,354000.0,357600.0,63829700.0,0.5534523790293647,0.4423172424659734\nSPY,20020328,237000.0,238800.0,234600.0,236700.0,1743500.0,,\nQQQ,20020328,360200.0,363700.0,351700.0,361500.0,62262900.0,0.549459636840003,0.43711181958198564\nSPY,20020401,233800.0,247000.0,232800.0,244600.0,3353500.0,,\nQQQ,20020401,358000.0,377700.0,350000.0,367700.0,68919000.0,0.5440549381817896,0.4299400414048581\nSPY,20020402,240000.0,243000.0,238700.0,240800.0,3436900.0,,\nQQQ,20020402,359900.0,373500.0,350000.0,351100.0,74779400.0,0.5379913107792397,0.42332496778811823\nSPY,20020403,240500.0,244900.0,227700.0,237600.0,3376500.0,,\nQQQ,20020403,353000.0,354500.0,340000.0,347000.0,77375600.0,0.5314585227457777,0.41602217547144504\nSPY,20020404,236700.0,250500.0,236700.0,249000.0,5592500.0,,\nQQQ,20020404,345100.0,358500.0,340000.0,347600.0,89712800.0,0.5233082170117062,0.40837128821026564\nSPY,20020405,249500.0,251900.0,241000.0,247200.0,4320700.0,,\nQQQ,20020405,350100.0,351800.0,340000.0,343100.0,65961900.0,0.5154700335238253,0.4013348238449347\nSPY,20020408,241600.0,246800.0,237800.0,246100.0,4641900.0,,\nQQQ,20020408,334800.0,347500.0,333300.0,346900.0,72541700.0,0.5083357817378723,0.395014159611482\nSPY,20020409,245900.0,250000.0,240000.0,241300.0,3276100.0,,\nQQQ,20020409,347800.0,349800.0,332200.0,335000.0,77182400.0,0.5009358193022724,0.38766233498443964\nSPY,20020410,242100.0,249500.0,240100.0,247100.0,3902600.0,,\nQQQ,20020410,337600.0,388500.0,331300.0,339100.0,85289100.0,0.4920956687905789,0.37578144581894796\nSPY,20020411,250300.0,252000.0,247500.0,249100.0,6770000.0,,\nQQQ,20020411,336600.0,339200.0,328900.0,330000.0,88480400.0,0.4808352003004549,0.3611932698977036\nSPY,20020412,250100.0,251700.0,245700.0,250500.0,5463500.0,,\nQQQ,20020412,333300.0,340300.0,329500.0,336300.0,78926400.0,0.471333515998603,0.35100895488662104\nSPY,20020415,250600.0,251500.0,248000.0,250000.0,5120700.0,,\nQQQ,20020415,338000.0,339600.0,332000.0,337800.0,66479000.0,0.46221281984992524,0.3396266420517627\nSPY,20020416,251500.0,260000.0,244100.0,257600.0,13157300.0,,\nQQQ,20020416,344300.0,352200.0,340000.0,351500.0,66046100.0,0.4535627560825038,0.33047054048687285\nSPY,20020417,259300.0,261700.0,253800.0,261100.0,6038000.0,,\nQQQ,20020417,354000.0,356800.0,340000.0,349700.0,70550300.0,0.44421369139776423,0.32267172535935995\nSPY,20020418,255000.0,255200.0,240500.0,254200.0,6809600.0,,\nQQQ,20020418,347900.0,355200.0,336100.0,347700.0,87576400.0,0.43629577852291057,0.31497570576045875\nSPY,20020419,254900.0,254900.0,249300.0,249800.0,6350100.0,,\nQQQ,20020419,350600.0,366500.0,340000.0,345000.0,58349600.0,0.4286796676074503,0.3062820280901951\nSPY,20020422,248400.0,249300.0,242300.0,245300.0,4339700.0,,\nQQQ,20020422,340100.0,348900.0,332600.0,335600.0,65846400.0,0.4215048323807371,0.2987306779342094\nSPY,20020423,245400.0,255000.0,240900.0,242300.0,4024500.0,,\nQQQ,20020423,336000.0,337800.0,320000.0,328600.0,72528100.0,0.4152732474277566,0.2918102138434178\nSPY,20020424,243000.0,245000.0,236800.0,237600.0,2490300.0,,\nQQQ,20020424,332100.0,333100.0,320000.0,324000.0,67272200.0,0.4078472474920223,0.2851036698544251\nSPY,20020425,235600.0,252500.0,235500.0,241200.0,3377700.0,,\nQQQ,20020425,323100.0,354800.0,320000.0,324100.0,101260200.0,0.3936075131032156,0.26928791866401874\nSPY,20020426,242800.0,243700.0,230000.0,230100.0,5081600.0,,\nQQQ,20020426,326600.0,340000.0,311700.0,311800.0,95728900.0,0.382302433976669,0.25804779503888975\nSPY,20020429,231600.0,240600.0,230900.0,239600.0,4703100.0,,\nQQQ,20020429,312400.0,315500.0,305700.0,310300.0,83507600.0,0.37080702990436804,0.24692188678028842\nSPY,20020430,238900.0,243800.0,237500.0,242500.0,4667200.0,,\nQQQ,20020430,310300.0,322000.0,309400.0,317700.0,92557900.0,0.3603186816674729,0.2364820695482476\nSPY,20020501,242900.0,242900.0,230500.0,239400.0,3698700.0,,\nQQQ,20020501,316700.0,318400.0,305800.0,315600.0,108551800.0,0.3489789440310095,0.22391030397627\nSPY,20020502,238100.0,243400.0,236000.0,236500.0,3896000.0,,\nQQQ,20020502,314000.0,319900.0,300000.0,305800.0,87076700.0,0.3381442135619378,0.21237067172542617\nSPY,20020503,235700.0,240200.0,234300.0,235100.0,3803000.0,,\nQQQ,20020503,304700.0,305100.0,289800.0,296500.0,88511800.0,0.3242934826009295,0.19866101683259574\nSPY,20020506,233500.0,235000.0,224600.0,226500.0,4233700.0,,\nQQQ,20020506,296400.0,299800.0,285000.0,289100.0,95854400.0,0.3121215512482988,0.18679493839561234\nSPY,20020507,229400.0,229500.0,221400.0,224700.0,4140600.0,,\nQQQ,20020507,292700.0,338800.0,284200.0,288400.0,94387900.0,0.29824409912968186,0.17507099476738405\nSPY,20020508,232000.0,245200.0,230400.0,243700.0,7451000.0,,\nQQQ,20020508,301300.0,318700.0,298400.0,318600.0,127606800.0,0.27963217510753025,0.15737723173366325\nSPY,20020509,242500.0,243500.0,222200.0,241900.0,3884700.0,,\nQQQ,20020509,315800.0,318900.0,308000.0,308900.0,102722900.0,0.26532299108800284,0.14108724163946823\nSPY,20020510,242900.0,242900.0,229800.0,233300.0,4081500.0,,\nQQQ,20020510,310100.0,311000.0,287800.0,296500.0,108307700.0,0.24944397415343622,0.1263030316670878\nSPY,20020513,235200.0,240900.0,229400.0,239300.0,4503100.0,,\nQQQ,20020513,298700.0,309800.0,296800.0,308700.0,92038500.0,0.23524707785923474,0.11077341567059339\nSPY,20020514,244500.0,256800.0,242200.0,256100.0,8980400.0,,\nQQQ,20020514,320600.0,326100.0,318700.0,325000.0,97229800.0,0.21929625245648104,0.0947087611162632\nSPY,20020515,253700.0,259800.0,248400.0,252700.0,5914400.0,,\nQQQ,20020515,320800.0,337500.0,318500.0,326300.0,148199200.0,0.20656564814525427,0.08192070218696901\nSPY,20020516,250600.0,254500.0,247500.0,252300.0,4003900.0,,\nQQQ,20020516,325400.0,328600.0,322100.0,327500.0,81522200.0,0.19654489750181361,0.0724621053414738\nSPY,20020517,254900.0,257800.0,246100.0,250100.0,3994600.0,,\nQQQ,20020517,332900.0,337300.0,317500.0,330000.0,77990100.0,0.1877378040751658,0.06355168184762777\nSPY,20020520,245700.0,249300.0,245300.0,247200.0,4803000.0,,\nQQQ,20020520,326000.0,329900.0,318800.0,321700.0,72959900.0,0.1779411436943295,0.0543658720949023\nSPY,20020521,248300.0,250000.0,234000.0,234400.0,4761100.0,,\nQQQ,20020521,323700.0,325900.0,310000.0,313000.0,100485000.0,0.17027688709213995,0.04904097940259544\nSPY,20020522,233700.0,243700.0,233200.0,243200.0,5085100.0,,\nQQQ,20020522,309700.0,315900.0,306500.0,314500.0,84738700.0,0.15771463872210897,0.037342487859667234\nSPY,20020523,244500.0,254700.0,240700.0,251800.0,6794300.0,,\nQQQ,20020523,316300.0,327000.0,308000.0,320600.0,91359900.0,0.14518070408812095,0.026223263304126124\nSPY,20020524,249900.0,249900.0,239600.0,241100.0,2810300.0,,\nQQQ,20020524,315900.0,317000.0,310100.0,312300.0,53973600.0,0.13396450410009675,0.017011748349763028\nSPY,20020528,237000.0,242000.0,234300.0,239800.0,2544200.0,,\nQQQ,20020528,314700.0,318900.0,304900.0,309800.0,65321800.0,0.12151512128704385,0.00787784928080549\nSPY,20020529,239200.0,244400.0,234500.0,240600.0,3866700.0,,\nQQQ,20020529,306700.0,309000.0,303000.0,303400.0,69849800.0,0.10834051710996032,-0.0012736687452713457\nSPY,20020530,237700.0,243800.0,235100.0,242000.0,3402600.0,,\nQQQ,20020530,300100.0,307200.0,299000.0,305700.0,88733100.0,0.09642698258349124,-0.009710925616209048\nSPY,20020531,240900.0,242500.0,232800.0,233200.0,6128100.0,,\nQQQ,20020531,307600.0,310400.0,300300.0,300800.0,75415100.0,0.08566387142201219,-0.015618467855938381\nSPY,20020603,233900.0,234500.0,223900.0,229000.0,4096400.0,,\nQQQ,20020603,300100.0,302500.0,287900.0,288600.0,73872900.0,0.07728951892566674,-0.019853031327346296\nSPY,20020604,228800.0,230400.0,221800.0,227800.0,6072000.0,,\nQQQ,20020604,287500.0,299900.0,278000.0,293400.0,96760700.0,0.07387436632202203,-0.0213977808848282\nSPY,20020605,228300.0,234500.0,223500.0,227000.0,4700100.0,,\nQQQ,20020605,294200.0,298000.0,282900.0,297100.0,91564300.0,0.07437769160703633,-0.02160362251275479\nSPY,20020606,229600.0,232300.0,220400.0,221200.0,4418500.0,,\nQQQ,20020606,295100.0,299800.0,280300.0,288300.0,86572200.0,0.07597087140364768,-0.020574597985608213\nSPY,20020607,217600.0,219400.0,209300.0,213900.0,10665600.0,,\nQQQ,20020607,276300.0,288700.0,275200.0,283700.0,104499800.0,0.0775382720453724,-0.017991642231608544\nSPY,20020610,214800.0,218400.0,213400.0,215000.0,4584400.0,,\nQQQ,20020610,283600.0,287500.0,281400.0,282700.0,71866600.0,0.07943722144206539,-0.015353195484490573\nSPY,20020611,216400.0,217000.0,204100.0,204500.0,5829200.0,,\nQQQ,20020611,286000.0,286900.0,273600.0,274200.0,84114200.0,0.0842514644925474,-0.009718984987269922\nSPY,20020612,204100.0,207500.0,199400.0,200900.0,9364500.0,,\nQQQ,20020612,272500.0,285000.0,262000.0,279300.0,149489600.0,0.09049341517632928,-0.003226538792429115\nSPY,20020613,200200.0,200500.0,193800.0,195400.0,6124300.0,,\nQQQ,20020613,277700.0,282100.0,267000.0,275500.0,97081400.0,0.09551912154473363,0.0032722807543831634\nSPY,20020614,192400.0,203600.0,181100.0,201000.0,7375600.0,,\nQQQ,20020614,268600.0,277200.0,262000.0,276200.0,120081600.0,0.0998476106768198,0.008828502868299415\nSPY,20020617,202400.0,206300.0,198500.0,205200.0,5611600.0,,\nQQQ,20020617,280000.0,287500.0,279100.0,286000.0,84985700.0,0.10638747348420594,0.014977878594754676\nSPY,20020618,204200.0,205900.0,199800.0,201500.0,5587700.0,,\nQQQ,20020618,283200.0,295700.0,274100.0,283300.0,79964200.0,0.11326140554811737,0.0217102845787941\nSPY,20020619,173700.0,176000.0,168800.0,171200.0,29642500.0,,\nQQQ,20020619,281000.0,289500.0,272500.0,273200.0,90029700.0,0.12736065755740988,0.03527370552291451\nSPY,20020620,171700.0,176000.0,168500.0,171200.0,6330600.0,,\nQQQ,20020620,272700.0,277500.0,248400.0,264900.0,98065700.0,0.14229074617961518,0.04889187673736104\nSPY,20020621,169700.0,174900.0,167900.0,169200.0,5859900.0,,\nQQQ,20020621,263700.0,277700.0,256500.0,258000.0,98877900.0,0.15695514602559718,0.06187750740515541\nSPY,20020624,167700.0,177300.0,167000.0,172700.0,7528400.0,,\nQQQ,20020624,254600.0,268000.0,252100.0,263500.0,138656300.0,0.16940665089851145,0.0745995650708071\nSPY,20020625,174000.0,176800.0,168600.0,169700.0,5096300.0,,\nQQQ,20020625,265800.0,267200.0,244500.0,254700.0,132797500.0,0.18353369657250285,0.08736361591256774\nSPY,20020626,168000.0,172900.0,159800.0,164200.0,9387500.0,,\nQQQ,20020626,244400.0,294000.0,243700.0,255700.0,146630700.0,0.19624747619044416,0.09865978028587691\nSPY,20020627,167900.0,172700.0,164200.0,170500.0,4346300.0,,\nQQQ,20020627,260000.0,261500.0,205900.0,261100.0,115953200.0,0.20474059588356958,0.10896085636103282\nSPY,20020628,171000.0,178200.0,169900.0,177100.0,4389700.0,,\nQQQ,20020628,260500.0,267500.0,255000.0,261500.0,87711900.0,0.21174667129215446,0.11895785684847118\nSPY,20020701,177100.0,178800.0,170500.0,170700.0,3546200.0,,\nQQQ,20020701,259800.0,261400.0,248100.0,248500.0,62464800.0,0.21774523173037164,0.1248541487010555\nSPY,20020702,170300.0,171600.0,168300.0,169400.0,5202000.0,,\nQQQ,20020702,246100.0,254200.0,238900.0,239800.0,113618100.0,0.22485508679940824,0.13183626410731425\nSPY,20020703,168100.0,176800.0,167500.0,175600.0,3365200.0,,\nQQQ,20020703,238500.0,259300.0,227300.0,247200.0,103246100.0,0.23015219625768402,0.13993553671349476\nSPY,20020705,177100.0,187900.0,177100.0,187300.0,2910000.0,,\nQQQ,20020705,252600.0,264100.0,250500.0,263500.0,58559700.0,0.23056889974575132,0.14405202056641886\nSPY,20020708,185200.0,186100.0,176800.0,180100.0,3386900.0,,\nQQQ,20020708,262000.0,286800.0,250800.0,252500.0,96044800.0,0.23118660908389815,0.14748986586016088\nSPY,20020709,180900.0,182900.0,174600.0,175200.0,3730900.0,,\nQQQ,20020709,252500.0,259200.0,241200.0,246800.0,88783000.0,0.23407651318681358,0.15354438540641474\nSPY,20020710,177100.0,181700.0,172500.0,173200.0,3469900.0,,\nQQQ,20020710,250000.0,256000.0,238300.0,239500.0,114568600.0,0.23788145608553737,0.15958540713847086\nSPY,20020711,172600.0,183500.0,169700.0,182800.0,4763700.0,,\nQQQ,20020711,237700.0,257800.0,233000.0,248000.0,163549300.0,0.24052656461308597,0.16621395872741201\nSPY,20020712,185500.0,187900.0,172600.0,175000.0,7439000.0,,\nQQQ,20020712,252500.0,259000.0,241900.0,248500.0,127952000.0,0.24729277828802895,0.17614565935818863\nSPY,20020715,174300.0,186000.0,168100.0,182600.0,4622400.0,,\nQQQ,20020715,246900.0,255100.0,237400.0,254100.0,138627900.0,0.25059191558652294,0.18363728394199202\nSPY,20020716,181500.0,185700.0,171000.0,178600.0,7104200.0,,\nQQQ,20020716,252500.0,260300.0,241400.0,251700.0,140417200.0,0.2572187429328965,0.19364699605509503\nSPY,20020717,161300.0,165700.0,151900.0,156000.0,20861000.0,,\nQQQ,20020717,260800.0,266800.0,248900.0,255500.0,151021200.0,0.2663149251106327,0.20344673861314921\nSPY,20020718,155000.0,155600.0,147500.0,149900.0,9668300.0,,\nQQQ,20020718,253900.0,258700.0,246700.0,247800.0,108479000.0,0.27322596783831726,0.20723962084746833\nSPY,20020719,147000.0,151700.0,145300.0,149600.0,6704600.0,,\nQQQ,20020719,243300.0,255900.0,238000.0,240000.0,119480300.0,0.2797942207678597,0.20941576640776768\nSPY,20020722,147500.0,151900.0,146100.0,149000.0,7484100.0,,\nQQQ,20020722,238600.0,282800.0,230900.0,233800.0,146379600.0,0.28908363362022693,0.21576831627956752\nSPY,20020723,149000.0,151300.0,144400.0,144400.0,6727700.0,,\nQQQ,20020723,234500.0,238500.0,222800.0,222900.0,147579000.0,0.2978074981475703,0.2168725112267822\nSPY,20020724,143000.0,152200.0,142500.0,151900.0,6559300.0,,\nQQQ,20020724,218200.0,236500.0,211600.0,236200.0,180896400.0,0.31031346771698437,0.22812742597227997\nSPY,20020725,149300.0,149500.0,140100.0,143700.0,8353300.0,,\nQQQ,20020725,232600.0,251300.0,218000.0,222200.0,156626000.0,0.32735106701952027,0.24034780828622518\nSPY,20020726,144600.0,145300.0,138000.0,143300.0,3500300.0,,\nQQQ,20020726,225700.0,245900.0,220100.0,226500.0,93825700.0,0.34307430972440256,0.25249807703306376\nSPY,20020729,144800.0,151000.0,143700.0,150300.0,4594000.0,,\nQQQ,20020729,232800.0,241200.0,222400.0,240400.0,94672200.0,0.3557552653174433,0.26441021003388115\nSPY,20020730,148500.0,155100.0,145600.0,154200.0,5962700.0,,\nQQQ,20020730,237300.0,246900.0,229600.0,243600.0,115180600.0,0.3674592027781778,0.2760831794216581\nSPY,20020731,154000.0,164000.0,149000.0,152500.0,5277900.0,,\nQQQ,20020731,240000.0,246500.0,223800.0,238800.0,90724800.0,0.380914772832032,0.28860013602852375\nSPY,20020801,151100.0,154200.0,147300.0,147900.0,3558200.0,,\nQQQ,20020801,237400.0,239000.0,221300.0,227000.0,81369500.0,0.396511183978832,0.30166313443210774\nSPY,20020802,147400.0,150000.0,142500.0,144600.0,3077100.0,,\nQQQ,20020802,227800.0,228400.0,210000.0,222000.0,83653600.0,0.4122675766375881,0.3141721560815133\nSPY,20020805,145100.0,147000.0,139700.0,139700.0,3467500.0,,\nQQQ,20020805,221100.0,225200.0,213000.0,213300.0,81709800.0,0.4287833482711321,0.32644196222675687\nSPY,20020806,142100.0,152300.0,140800.0,147400.0,4694600.0,,\nQQQ,20020806,218000.0,230100.0,210900.0,224900.0,106901800.0,0.4431590118446674,0.33872082579544466\nSPY,20020807,150900.0,153600.0,143500.0,150400.0,5755300.0,,\nQQQ,20020807,232000.0,234000.0,219600.0,228400.0,122890500.0,0.45690654729468205,0.3506730521200686\nSPY,20020808,148000.0,153800.0,147700.0,152900.0,3950000.0,,\nQQQ,20020808,227600.0,240000.0,217900.0,235100.0,109982600.0,0.46845015181503236,0.36184134551997066\nSPY,20020809,152500.0,152500.0,147500.0,150000.0,3617200.0,,\nQQQ,20020809,232100.0,237200.0,220100.0,232900.0,91800100.0,0.4805072886006086,0.3733448339478887\nSPY,20020812,149000.0,150200.0,146900.0,149300.0,2965900.0,,\nQQQ,20020812,230500.0,239500.0,229000.0,233300.0,59848600.0,0.492749322557787,0.3848183272949999\nSPY,20020813,149000.0,158500.0,145500.0,146100.0,4655800.0,,\nQQQ,20020813,232300.0,238700.0,225500.0,226000.0,84948300.0,0.5051543969633385,0.3961185990504519\nSPY,20020814,146700.0,153500.0,145400.0,151700.0,6668400.0,,\nQQQ,20020814,226700.0,242000.0,224700.0,240600.0,99407600.0,0.5150040026021641,0.40693370037385385\nSPY,20020815,152500.0,157500.0,150100.0,156000.0,5673700.0,,\nQQQ,20020815,242400.0,249600.0,233800.0,243700.0,120220300.0,0.5238836182201965,0.4173938131768666\nSPY,20020816,154500.0,161000.0,152800.0,158100.0,4179400.0,,\nQQQ,20020816,241300.0,252700.0,237300.0,247300.0,96297400.0,0.5321247516746693,0.42758726836151073\nSPY,20020819,157800.0,162500.0,157200.0,159800.0,3584000.0,,\nQQQ,20020819,247700.0,265000.0,240600.0,254700.0,74446500.0,0.5404387303895304,0.43768782083108565\nSPY,20020820,159700.0,167500.0,155300.0,159100.0,3241000.0,,\nQQQ,20020820,251900.0,254300.0,221800.0,251000.0,87549600.0,0.5490169804449123,0.4478294524384599\nSPY,20020821,160100.0,162400.0,154500.0,161500.0,3487200.0,,\nQQQ,20020821,254000.0,258500.0,244900.0,257000.0,97853600.0,0.5563615913629368,0.45752386437261877\nSPY,20020822,162000.0,162500.0,156600.0,159600.0,4502900.0,,\nQQQ,20020822,257500.0,262100.0,244900.0,261000.0,77330400.0,0.5634442756014608,0.46709754608389703\nSPY,20020823,159000.0,159300.0,154500.0,157200.0,2782800.0,,\nQQQ,20020823,258000.0,264500.0,244900.0,251300.0,72462100.0,0.570593839633474,0.4761324410551775\nSPY,20020826,159500.0,159500.0,151600.0,155600.0,3327900.0,,\nQQQ,20020826,253000.0,259500.0,240000.0,252500.0,83014500.0,0.5780271447220019,0.48527334714911863\nSPY,20020827,157100.0,157400.0,147100.0,148500.0,4464500.0,,\nQQQ,20020827,254300.0,258100.0,241500.0,242600.0,89840200.0,0.5855012910818856,0.4935167483226109\nSPY,20020828,148000.0,151200.0,146500.0,146900.0,4165700.0,,\nQQQ,20020828,240300.0,249800.0,233900.0,235000.0,117503400.0,0.5935574654052229,0.5024979345578106\nSPY,20020829,146500.0,150800.0,145100.0,146900.0,2657500.0,,\nQQQ,20020829,232000.0,250600.0,228500.0,238800.0,94443000.0,0.6015368495638787,0.5114117286463274\nSPY,20020830,147300.0,151400.0,145800.0,147400.0,2960700.0,,\nQQQ,20020830,236200.0,240100.0,233800.0,234800.0,57482700.0,0.6101304869824649,0.5212037259926477\nSPY,20020903,144900.0,145500.0,140500.0,140500.0,4601100.0,,\nQQQ,20020903,230600.0,234300.0,223400.0,223900.0,78187800.0,0.6190358703248465,0.5306083156933956\nSPY,20020904,142000.0,147800.0,141700.0,144500.0,7073400.0,,\nQQQ,20020904,225000.0,230200.0,215200.0,228600.0,81576600.0,0.6269621664889955,0.5393605118973808\nSPY,20020905,142200.0,144500.0,140500.0,141900.0,3637700.0,,\nQQQ,20020905,224000.0,229700.0,219300.0,220000.0,84877100.0,0.6354766451807489,0.548031618583118\nSPY,20020906,145100.0,146500.0,142300.0,143800.0,2857600.0,,\nQQQ,20020906,226600.0,232200.0,225000.0,229000.0,83713000.0,0.6424002272447867,0.5550088532413385\nSPY,20020909,142800.0,145300.0,141500.0,143700.0,2483700.0,,\nQQQ,20020909,226800.0,233900.0,222100.0,231800.0,70717100.0,0.6486107071237863,0.5615936323405075\nSPY,20020910,144100.0,145000.0,141200.0,143400.0,4311400.0,,\nQQQ,20020910,232300.0,236700.0,230300.0,235400.0,70398600.0,0.6540769040187653,0.5672278375565158\nSPY,20020911,143400.0,146000.0,141500.0,142800.0,3564100.0,,\nQQQ,20020911,241200.0,250800.0,235000.0,235500.0,69184600.0,0.6590904104629975,0.572661075580418\nSPY,20020912,142000.0,145100.0,141200.0,141400.0,4570900.0,,\nQQQ,20020912,232400.0,241300.0,227100.0,228000.0,68748300.0,0.6642744160336511,0.5771296753699089\nSPY,20020913,141300.0,143400.0,140500.0,142100.0,4926500.0,,\nQQQ,20020913,226000.0,239800.0,220800.0,229600.0,77287500.0,0.6695035800510918,0.5816419538367754\nSPY,20020916,141400.0,146100.0,141200.0,145000.0,4781100.0,,\nQQQ,20020916,228700.0,230100.0,223700.0,225700.0,55021100.0,0.6746641136774333,0.5862720712338281\nSPY,20020917,145700.0,150300.0,145700.0,148000.0,7296000.0,,\nQQQ,20020917,230500.0,239700.0,222600.0,223300.0,85846700.0,0.6782397757164408,0.5885648210826399\nSPY,20020918,146900.0,150900.0,145200.0,150100.0,5959400.0,,\nQQQ,20020918,220100.0,229900.0,210900.0,222400.0,81549700.0,0.6815450807769188,0.5900964454706032\nSPY,20020919,147500.0,148000.0,144800.0,145700.0,3503600.0,,\nQQQ,20020919,217000.0,221300.0,212000.0,216000.0,82665100.0,0.6848427966246333,0.591616446760396\nSPY,20020920,146200.0,149400.0,145200.0,148100.0,5158700.0,,\nQQQ,20020920,218300.0,219000.0,214800.0,216500.0,74384900.0,0.6877136985771517,0.592804627344351\nSPY,20020923,147600.0,149600.0,144500.0,148500.0,3970200.0,,\nQQQ,20020923,214500.0,228400.0,208100.0,209900.0,70595300.0,0.690190633264205,0.5933622723553742\nSPY,20020924,144000.0,148200.0,144000.0,146300.0,4289900.0,,\nQQQ,20020924,206900.0,219500.0,206500.0,209800.0,86963400.0,0.6933645653071759,0.5944837140697474\nSPY,20020925,146900.0,151700.0,146500.0,149400.0,4153900.0,,\nQQQ,20020925,213500.0,220400.0,211000.0,218800.0,96534200.0,0.6963884901368692,0.5956426496562159\nSPY,20020926,151000.0,151900.0,145500.0,147100.0,3635000.0,,\nQQQ,20020926,221600.0,255900.0,210200.0,217700.0,102333100.0,0.6991499071066096,0.5965412659374159\nSPY,20020927,144900.0,148500.0,144800.0,147200.0,3374600.0,,\nQQQ,20020927,215500.0,222100.0,211500.0,213600.0,106090000.0,0.7018465613453806,0.5972431901349898\nSPY,20020930,144000.0,145700.0,141400.0,145000.0,3805000.0,,\nQQQ,20020930,210700.0,219600.0,204900.0,207200.0,89339200.0,0.7051050134757223,0.5983462590248688\nSPY,20021001,145900.0,146000.0,140000.0,145000.0,5404900.0,,\nQQQ,20021001,209100.0,219000.0,204500.0,216200.0,94488100.0,0.7079179533164557,0.5990751013386071\nSPY,20021002,143300.0,146300.0,141000.0,141700.0,3877000.0,,\nQQQ,20021002,215100.0,219700.0,206800.0,211600.0,91509600.0,0.7113411433026167,0.6002009295875954\nSPY,20021003,141800.0,155500.0,140600.0,142900.0,3725400.0,,\nQQQ,20021003,210600.0,219800.0,206800.0,207000.0,69115500.0,0.7163913264199097,0.6030365900709738\nSPY,20021004,143600.0,144000.0,140000.0,140200.0,3330200.0,,\nQQQ,20021004,209400.0,216500.0,201100.0,202800.0,78358700.0,0.7211689010560737,0.6055801734002396\nSPY,20021007,139700.0,142100.0,137600.0,137700.0,4055400.0,,\nQQQ,20021007,202600.0,205900.0,198500.0,199900.0,76567500.0,0.7260630507827341,0.6082148668045367\nSPY,20021008,139000.0,144500.0,133600.0,136700.0,7897100.0,,\nQQQ,20021008,202800.0,209700.0,197600.0,201600.0,94908000.0,0.7309569482607449,0.6108953027156396\nSPY,20021009,135400.0,138500.0,134100.0,136000.0,6279000.0,,\nQQQ,20021009,199400.0,209300.0,198400.0,200900.0,104403400.0,0.7354326683793814,0.6127632467230694\nSPY,20021010,136300.0,142200.0,135800.0,141000.0,5528500.0,,\nQQQ,20021010,201000.0,219100.0,199100.0,210900.0,106641000.0,0.7396365125042845,0.6158504909938795\nSPY,20021011,142600.0,147800.0,141000.0,145100.0,4853914.0,,\nQQQ,20021011,215500.0,229800.0,205100.0,221000.0,128397800.0,0.7437929196399932,0.6200243072706171\nSPY,20021014,145500.0,149800.0,144400.0,147700.0,3281546.0,,\nQQQ,20021014,218700.0,224800.0,209800.0,224200.0,78089800.0,0.7475291050266318,0.62422181512447\nSPY,20021015,152200.0,152500.0,147800.0,151600.0,6718573.0,,\nQQQ,20021015,234400.0,235900.0,222100.0,235800.0,105141300.0,0.7506518500266731,0.6282192917469023\nSPY,20021016,148600.0,151300.0,144600.0,145700.0,4285267.0,,\nQQQ,20021016,227200.0,236000.0,209500.0,226500.0,86678000.0,0.7544541469171543,0.6326687359545706\nSPY,20021017,142100.0,143900.0,139800.0,141200.0,8012398.0,,\nQQQ,20021017,236000.0,238100.0,225800.0,234800.0,84511600.0,0.75770297800065,0.6353944710812773\nSPY,20021018,140000.0,143500.0,139300.0,143500.0,4880616.0,,\nQQQ,20021018,232800.0,238000.0,226400.0,237800.0,84281700.0,0.7602356028654336,0.6379635507156287\nSPY,20021021,142600.0,146300.0,140000.0,145600.0,4118782.0,,\nQQQ,20021021,235200.0,244500.0,214200.0,243200.0,79368900.0,0.762506091776592,0.640477889306983\nSPY,20021022,144700.0,158000.0,142600.0,147000.0,3805018.0,,\nQQQ,20021022,237400.0,243400.0,230900.0,239500.0,84516800.0,0.764728307526588,0.6440275542479721\nSPY,20021023,146300.0,149800.0,145000.0,148800.0,3567166.0,,\nQQQ,20021023,238500.0,246300.0,230400.0,245800.0,85971700.0,0.7674031870767686,0.6477303276267813\nSPY,20021024,150200.0,152100.0,145500.0,147000.0,2957698.0,,\nQQQ,20021024,246800.0,248600.0,226300.0,240200.0,88992000.0,0.7699748910013338,0.6521300452235966\nSPY,20021025,147000.0,154500.0,145900.0,154200.0,4723115.0,,\nQQQ,20021025,239900.0,247500.0,239900.0,247400.0,67082000.0,0.7727710887881923,0.6578806026416072\nSPY,20021028,155500.0,159500.0,152500.0,156000.0,6114344.0,,\nQQQ,20021028,250000.0,255700.0,239800.0,243400.0,100819700.0,0.7757559673262618,0.6631799845637907\nSPY,20021029,155700.0,158800.0,149600.0,154400.0,4416190.0,,\nQQQ,20021029,243100.0,244700.0,225000.0,239100.0,89420200.0,0.7787374361711115,0.6666792896145004\nSPY,20021030,154900.0,166500.0,154800.0,159700.0,4465654.0,,\nQQQ,20021030,240700.0,247900.0,231400.0,245500.0,103630700.0,0.7810739512880227,0.669517952267337\nSPY,20021031,159900.0,164400.0,159200.0,160100.0,4817642.0,,\nQQQ,20021031,246600.0,255500.0,243600.0,245700.0,78279800.0,0.7837141295645725,0.6729665144011635\nSPY,20021101,159400.0,165000.0,158900.0,163600.0,3188813.0,,\nQQQ,20021101,243800.0,259200.0,238500.0,253000.0,80262900.0,0.7860319902249484,0.6773667968801241\nSPY,20021104,165000.0,173800.0,163500.0,168800.0,6161467.0,,\nQQQ,20021104,260500.0,268200.0,248200.0,259700.0,107500700.0,0.7882384103748662,0.6817048395080701\nSPY,20021105,167500.0,169700.0,163500.0,169000.0,3526039.0,,\nQQQ,20021105,257100.0,261400.0,247600.0,261100.0,76438700.0,0.790539987611276,0.6874220361389566\nSPY,20021106,170800.0,173200.0,167000.0,172200.0,3685004.0,,\nQQQ,20021106,262900.0,265100.0,256400.0,264600.0,112278100.0,0.7929133634420948,0.694095949125409\nSPY,20021107,169400.0,171000.0,158100.0,160000.0,5719174.0,,\nQQQ,20021107,259800.0,267800.0,253100.0,254900.0,79315500.0,0.7955257685323404,0.7006318845849503\nSPY,20021108,160100.0,162000.0,155200.0,158500.0,3181773.0,,\nQQQ,20021108,254900.0,258700.0,249600.0,251100.0,76464100.0,0.7990604340430368,0.707012595326717\nSPY,20021111,157500.0,158900.0,151200.0,151800.0,2555023.0,,\nQQQ,20021111,249500.0,250200.0,241500.0,242500.0,73499000.0,0.8028154609239578,0.7133539374806422\nSPY,20021112,153200.0,160400.0,152800.0,156300.0,3773941.0,,\nQQQ,20021112,244000.0,259500.0,241300.0,249400.0,84558000.0,0.806594283244657,0.7197305238941589\nSPY,20021113,155000.0,160700.0,152800.0,155900.0,3942528.0,,\nQQQ,20021113,247400.0,259200.0,233500.0,251600.0,113670000.0,0.810393935962784,0.7268179945224121\nSPY,20021114,159000.0,164100.0,157800.0,163300.0,2295638.0,,\nQQQ,20021114,255800.0,266900.0,246900.0,262900.0,77875600.0,0.8137624612177741,0.73369662416564\nSPY,20021115,162300.0,162400.0,157600.0,159000.0,2794754.0,,\nQQQ,20021115,259000.0,264500.0,252200.0,263800.0,65146200.0,0.8172695204863621,0.7404421504880706\nSPY,20021118,161900.0,162000.0,155200.0,155500.0,2474690.0,,\nQQQ,20021118,267200.0,267700.0,236300.0,260200.0,72857100.0,0.8215266153697787,0.7470485744667947\nSPY,20021119,155500.0,157500.0,150100.0,152700.0,3357161.0,,\nQQQ,20021119,258000.0,260500.0,253000.0,255000.0,86414500.0,0.8250902340115318,0.7536321271706777\nSPY,20021120,153000.0,157000.0,152500.0,155200.0,3083701.0,,\nQQQ,20021120,255800.0,266700.0,255200.0,266500.0,69602600.0,0.8278847172352924,0.7593983130031862\nSPY,20021121,159000.0,169300.0,157500.0,163400.0,6976478.0,,\nQQQ,20021121,269300.0,297000.0,266000.0,278000.0,104164700.0,0.8303858886412419,0.7654622003475622\nSPY,20021122,160900.0,163100.0,150500.0,160100.0,3187524.0,,\nQQQ,20021122,273700.0,283200.0,257600.0,277400.0,71339800.0,0.83308332647485,0.7716154678124995\nSPY,20021125,160300.0,161400.0,157100.0,159700.0,3080903.0,,\nQQQ,20021125,277600.0,282100.0,275400.0,280600.0,69442600.0,0.8343732349613548,0.7772498219083659\nSPY,20021126,158500.0,159000.0,152700.0,154000.0,3427720.0,,\nQQQ,20021126,277800.0,279400.0,269000.0,270300.0,77010400.0,0.8361931720179758,0.7825403752872553\nSPY,20021127,156000.0,167600.0,154500.0,157300.0,4623892.0,,\nQQQ,20021127,275300.0,290900.0,272500.0,279800.0,70462800.0,0.83758039225048,0.7876117973776219\nSPY,20021129,157900.0,158800.0,154200.0,155000.0,2564552.0,,\nQQQ,20021129,282100.0,289100.0,270100.0,277800.0,37214000.0,0.8397223476910362,0.7927390853478837\nSPY,20021202,159000.0,161000.0,150100.0,152000.0,6899707.0,,\nQQQ,20021202,284200.0,287900.0,270400.0,278500.0,86342100.0,0.8406240273299367,0.7973403341940303\nSPY,20021203,152000.0,153400.0,151000.0,151800.0,3707976.0,,\nQQQ,20021203,275500.0,291900.0,267500.0,270800.0,77431000.0,0.8418019954947531,0.8019349844806662\nSPY,20021204,151800.0,151900.0,145000.0,149900.0,5170015.0,,\nQQQ,20021204,265600.0,269500.0,254900.0,265900.0,120174500.0,0.8424798474814135,0.8057523880843791\nSPY,20021205,150300.0,150800.0,145300.0,146400.0,4145081.0,,\nQQQ,20021205,269500.0,270000.0,255900.0,261700.0,77947200.0,0.8427082972103959,0.8070755475747847\nSPY,20021206,146200.0,151900.0,145200.0,149800.0,4252095.0,,\nQQQ,20021206,258100.0,267200.0,256900.0,264800.0,78722300.0,0.8440915153996917,0.8101890404646479\nSPY,20021209,149400.0,149500.0,146700.0,147600.0,3828679.0,,\nQQQ,20021209,262200.0,266500.0,252500.0,252700.0,73871100.0,0.8456488715321477,0.8138821889431105\nSPY,20021210,147500.0,154500.0,147300.0,153100.0,5307794.0,,\nQQQ,20021210,254200.0,268200.0,245400.0,256600.0,73678300.0,0.846858367263141,0.8179750223228971\nSPY,20021211,153000.0,154900.0,150800.0,154900.0,4322493.0,,\nQQQ,20021211,254400.0,260700.0,253200.0,257600.0,62319700.0,0.8492307258712921,0.8222883197945959\nSPY,20021212,155100.0,155500.0,150100.0,151600.0,2601009.0,,\nQQQ,20021212,260200.0,266900.0,249400.0,258300.0,61826200.0,0.8521135178992587,0.8264570457746091\nSPY,20021213,151400.0,151500.0,146500.0,147900.0,2695980.0,,\nQQQ,20021213,255200.0,255700.0,250300.0,250400.0,70483400.0,0.854709187912018,0.8306411458196438\nSPY,20021216,148100.0,151000.0,146100.0,148400.0,4245858.0,,\nQQQ,20021216,252200.0,259600.0,250700.0,258700.0,57796400.0,0.8579837481958683,0.8343335768626808\nSPY,20021217,148500.0,151900.0,146600.0,150100.0,3834171.0,,\nQQQ,20021217,258100.0,262000.0,255600.0,258800.0,58934900.0,0.8615586472044452,0.8381727344377837\nSPY,20021218,148000.0,148600.0,145000.0,145600.0,2525299.0,,\nQQQ,20021218,255500.0,256000.0,250500.0,252000.0,63551600.0,0.8652764550453821,0.8414155824750054\nSPY,20021219,145300.0,149200.0,141000.0,141800.0,5904745.0,,\nQQQ,20021219,251700.0,260800.0,240300.0,250100.0,98159000.0,0.8676755139456562,0.8438800569979164\nSPY,20021220,143000.0,145600.0,137800.0,141500.0,4620362.0,,\nQQQ,20021220,253300.0,255000.0,250700.0,252300.0,56692000.0,0.8699640650604249,0.8458758576803223\nSPY,20021223,141600.0,145500.0,141200.0,144900.0,1965148.0,,\nQQQ,20021223,252000.0,257600.0,251300.0,256700.0,44123800.0,0.8721692556012646,0.8477786734727721\nSPY,20021224,144400.0,144700.0,143000.0,143600.0,712262.0,,\nQQQ,20021224,255000.0,257300.0,253000.0,254000.0,16811500.0,0.8739242355855737,0.8496522440175748\nSPY,20021226,144200.0,148100.0,142800.0,144100.0,1369186.0,,\nQQQ,20021226,255300.0,259100.0,251700.0,252500.0,32835100.0,0.8759151834449598,0.8515626625767317\nSPY,20021227,143100.0,143800.0,140100.0,140800.0,1338695.0,,\nQQQ,20021227,251800.0,258500.0,247500.0,248200.0,39670200.0,0.8776143289795846,0.8533732443756532\nSPY,20021230,140800.0,141500.0,138400.0,140500.0,2590862.0,,\nQQQ,20021230,248400.0,249700.0,242600.0,246100.0,56237900.0,0.8792706774943635,0.8554175737134656\nSPY,20021231,140000.0,143600.0,139500.0,143400.0,3292784.0,,\nQQQ,20021231,245400.0,247100.0,235400.0,244000.0,43931800.0,0.8810027152519246,0.8579174552177907\nSPY,20030102,143600.0,149200.0,143500.0,148100.0,3064011.0,,\nQQQ,20030102,247200.0,255500.0,203100.0,255000.0,62930000.0,0.8816082729473711,0.8595071720361552\nSPY,20030103,148000.0,149300.0,145900.0,149200.0,2387315.0,,\nQQQ,20030103,254600.0,257000.0,252800.0,256300.0,37309100.0,0.8826816056743453,0.8605997457220843\nSPY,20030106,150300.0,153800.0,148800.0,148900.0,6763083.0,,\nQQQ,20030106,257100.0,266600.0,252000.0,263900.0,59486400.0,0.8834965651361641,0.8608730766133137\nSPY,20030107,147900.0,150000.0,144700.0,148200.0,5872947.0,,\nQQQ,20030107,264100.0,269300.0,254100.0,265800.0,87422200.0,0.8848550180834298,0.8615153479667785\nSPY,20030108,145800.0,147100.0,144400.0,145500.0,3702836.0,,\nQQQ,20030108,263900.0,264900.0,258400.0,259100.0,71480100.0,0.8871520834654076,0.8618291723233752\nSPY,20030109,146100.0,149200.0,138000.0,146900.0,3339662.0,,\nQQQ,20030109,262400.0,269800.0,259300.0,267300.0,72158200.0,0.8903722733888971,0.861926204000333\nSPY,20030110,145800.0,148200.0,144900.0,147400.0,3050577.0,,\nQQQ,20030110,263500.0,279600.0,262200.0,270500.0,79339000.0,0.8944381721296526,0.8624934104412243\nSPY,20030113,149000.0,149000.0,143600.0,147500.0,3043045.0,,\nQQQ,20030113,273300.0,274700.0,263000.0,269000.0,68663100.0,0.8984262228849609,0.8630273248814414\nSPY,20030114,146900.0,148200.0,144900.0,146100.0,4344226.0,,\nQQQ,20030114,269100.0,277300.0,268500.0,271900.0,40962000.0,0.9014040764178557,0.8626131779892503\nSPY,20030115,145900.0,147000.0,142600.0,144400.0,6253243.0,,\nQQQ,20030115,272400.0,277700.0,265800.0,266900.0,52539700.0,0.9041377126395124,0.861080209813321\nSPY,20030116,142100.0,154900.0,142100.0,146000.0,9528226.0,,\nQQQ,20030116,267700.0,269800.0,256300.0,263900.0,61663400.0,0.9072433446696336,0.8606533144348781\nSPY,20030117,145600.0,145600.0,140800.0,141000.0,4486352.0,,\nQQQ,20030117,259000.0,267000.0,244500.0,253500.0,74862300.0,0.9093668338764609,0.8598822237971526\nSPY,20030121,142100.0,144100.0,140000.0,140000.0,4263298.0,,\nQQQ,20030121,254000.0,263400.0,251000.0,251100.0,63857100.0,0.9110068916192507,0.8593726800693703\nSPY,20030122,139800.0,141500.0,138500.0,138600.0,3556382.0,,\nQQQ,20030122,249700.0,255400.0,240600.0,250600.0,79003600.0,0.9122286958689202,0.8585684333467115\nSPY,20030123,140500.0,143600.0,139500.0,142100.0,3904754.0,,\nQQQ,20030123,254000.0,258400.0,251100.0,256600.0,73375400.0,0.912929697323012,0.8565482286712942\nSPY,20030124,142400.0,142400.0,135600.0,137900.0,5226338.0,,\nQQQ,20030124,255300.0,255300.0,246400.0,247600.0,71254900.0,0.9139789473493376,0.8559228283053819\nSPY,20030127,136900.0,145000.0,136500.0,141400.0,6756357.0,,\nQQQ,20030127,244500.0,250300.0,237000.0,245500.0,72478300.0,0.9150662276520722,0.8558841554230134\nSPY,20030128,142400.0,146900.0,141600.0,146300.0,4953959.0,,\nQQQ,20030128,247700.0,250500.0,244200.0,248500.0,61389300.0,0.9163828379852046,0.8556954521850568\nSPY,20030129,145300.0,151000.0,143000.0,148900.0,6241029.0,,\nQQQ,20030129,247600.0,254500.0,243400.0,253000.0,92756700.0,0.9171739075686689,0.8554288151495058\nSPY,20030130,149800.0,150700.0,142900.0,143100.0,7230593.0,,\nQQQ,20030130,253200.0,254200.0,244500.0,245100.0,67206600.0,0.9174102995783694,0.854169013961867\nSPY,20030131,141900.0,145500.0,140500.0,143500.0,5687811.0,,\nQQQ,20030131,240700.0,251300.0,240100.0,244100.0,86037100.0,0.9173774440931918,0.8523449821860551\nSPY,20030203,144100.0,149100.0,143500.0,146600.0,4529384.0,,\nQQQ,20030203,245300.0,248000.0,243800.0,245100.0,47509700.0,0.9173372898203709,0.8507706062313208\nSPY,20030204,144500.0,146500.0,143100.0,146000.0,5330728.0,,\nQQQ,20030204,241800.0,242900.0,238200.0,241400.0,58999700.0,0.9166309166815033,0.8490220703291436\nSPY,20030205,147100.0,149300.0,144000.0,144500.0,3834401.0,,\nQQQ,20030205,243300.0,257400.0,240100.0,240900.0,79135200.0,0.9158610951086912,0.8472033918726606\nSPY,20030206,143600.0,145900.0,142200.0,144500.0,3084939.0,,\nQQQ,20030206,240200.0,251900.0,211500.0,241500.0,108671100.0,0.9152658325143894,0.8455766245410077\nSPY,20030207,145500.0,146000.0,140700.0,141100.0,4480073.0,,\nQQQ,20030207,243600.0,249800.0,236500.0,237800.0,71679500.0,0.9147743965591041,0.8446107474699951\nSPY,20030210,142600.0,145700.0,140600.0,143500.0,2649713.0,,\nQQQ,20030210,239000.0,249900.0,236200.0,241300.0,66776400.0,0.9144102334448736,0.8431510137879896\nSPY,20030211,145000.0,146300.0,142000.0,143500.0,2643513.0,,\nQQQ,20030211,242500.0,246100.0,211400.0,241100.0,72796800.0,0.9137132583879628,0.841246163427138\nSPY,20030212,142700.0,146000.0,142700.0,143500.0,3597446.0,,\nQQQ,20030212,240700.0,244100.0,238000.0,238300.0,53702200.0,0.9131271975839593,0.8399283485660943\nSPY,20030213,144100.0,146400.0,142400.0,145400.0,3447951.0,,\nQQQ,20030213,238500.0,245900.0,233200.0,236700.0,69510700.0,0.9124775656003885,0.838338218545449\nSPY,20030214,146100.0,147200.0,143500.0,146700.0,3804780.0,,\nQQQ,20030214,238300.0,244000.0,236200.0,244000.0,65201400.0,0.9118603069173675,0.8362237318060242\nSPY,20030218,147500.0,153000.0,147200.0,152700.0,4549011.0,,\nQQQ,20030218,247000.0,252300.0,242500.0,252300.0,71444500.0,0.9112841081397232,0.8349443670122627\nSPY,20030219,150700.0,151500.0,146800.0,148600.0,4113157.0,,\nQQQ,20030219,252000.0,252400.0,247100.0,250200.0,42341000.0,0.9110649067257511,0.8333287403138432\nSPY,20030220,148500.0,149600.0,147100.0,147200.0,3775076.0,,\nQQQ,20030220,251500.0,252700.0,248400.0,248700.0,57530900.0,0.9106977350591429,0.831452684538701\nSPY,20030221,148200.0,150600.0,146500.0,149900.0,2589151.0,,\nQQQ,20030221,249300.0,253700.0,245100.0,252500.0,66980700.0,0.910773402997407,0.8297248499184023\nSPY,20030224,148600.0,150300.0,147400.0,147500.0,3077105.0,,\nQQQ,20030224,251300.0,259000.0,247100.0,247400.0,53999000.0,0.9103700250906397,0.8276446010928468\nSPY,20030225,146800.0,150800.0,145900.0,150300.0,3153686.0,,\nQQQ,20030225,244500.0,254500.0,240800.0,248400.0,70866400.0,0.9097132123120387,0.8257917865155114\nSPY,20030226,149900.0,150200.0,144800.0,145200.0,3722144.0,,\nQQQ,20030226,246800.0,249400.0,242000.0,242400.0,56822500.0,0.9091469250856052,0.8240719216450247\nSPY,20030227,145700.0,150000.0,145100.0,148600.0,2560293.0,,\nQQQ,20030227,244200.0,249200.0,242700.0,247500.0,63839900.0,0.909254781982243,0.8221276198707125\nSPY,20030228,148600.0,150900.0,147700.0,150100.0,3056389.0,,\nQQQ,20030228,248100.0,252200.0,240200.0,251100.0,49281500.0,0.9092982847405412,0.8202455769530395\nSPY,20030303,150100.0,151600.0,145500.0,146500.0,3509718.0,,\nQQQ,20030303,252500.0,254800.0,245600.0,246500.0,59576800.0,0.9089223808634811,0.8181717628954733\nSPY,20030304,147400.0,148100.0,144400.0,145000.0,2101115.0,,\nQQQ,20030304,246600.0,255300.0,242600.0,244500.0,58553200.0,0.9085188345750886,0.8156875530276836\nSPY,20030305,146100.0,148000.0,145200.0,146100.0,2058182.0,,\nQQQ,20030305,244000.0,247800.0,243200.0,246800.0,65213900.0,0.9088549860842233,0.8135641041991535\nSPY,20030306,145800.0,146000.0,144000.0,145600.0,1592763.0,,\nQQQ,20030306,244400.0,246800.0,242300.0,244600.0,53137500.0,0.9090631355057988,0.8112916470206204\nSPY,20030307,144700.0,147100.0,143100.0,145600.0,2506428.0,,\nQQQ,20030307,240700.0,246900.0,233500.0,245700.0,70092600.0,0.9088210742323647,0.8085978290373421\nSPY,20030310,145100.0,146700.0,143000.0,143700.0,2159588.0,,\nQQQ,20030310,243500.0,244600.0,239100.0,239800.0,53167500.0,0.909187494754113,0.8062933074064431\nSPY,20030311,143600.0,144900.0,141200.0,142300.0,2849759.0,,\nQQQ,20030311,240500.0,242400.0,237800.0,238200.0,52508000.0,0.9091785481333072,0.804161967400305\nSPY,20030312,141700.0,143900.0,140200.0,142500.0,3745280.0,,\nQQQ,20030312,237600.0,241800.0,235400.0,241600.0,73786900.0,0.9089100233213383,0.8013060093700086\nSPY,20030313,144700.0,148000.0,141700.0,147200.0,5519861.0,,\nQQQ,20030313,246600.0,256300.0,241000.0,255800.0,117076000.0,0.908097351988699,0.7974921397890744\nSPY,20030314,146800.0,150100.0,146400.0,147800.0,2748057.0,,\nQQQ,20030314,257300.0,266400.0,243000.0,256100.0,88905300.0,0.9072497993813357,0.7939095358338029\nSPY,20030317,149100.0,150700.0,147100.0,150200.0,6766017.0,,\nQQQ,20030317,254500.0,267800.0,244800.0,267600.0,137851800.0,0.9055638422484016,0.7910040833953518\nSPY,20030318,150000.0,150900.0,148200.0,150000.0,3714589.0,,\nQQQ,20030318,267900.0,269000.0,256300.0,268500.0,93588900.0,0.9042001484273341,0.7878404412291383\nSPY,20030319,150700.0,151500.0,147900.0,149600.0,2333051.0,,\nQQQ,20030319,268400.0,270800.0,255400.0,267100.0,85549100.0,0.9027924977480318,0.7843997130713402\nSPY,20030320,149300.0,149900.0,146000.0,149100.0,2849565.0,,\nQQQ,20030320,265400.0,271400.0,261700.0,268300.0,89296900.0,0.9004550424497917,0.780630238514053\nSPY,20030321,150900.0,151500.0,148100.0,149600.0,4889464.0,,\nQQQ,20030321,272200.0,273800.0,253500.0,271600.0,92263600.0,0.8990096351630109,0.7771950496525716\nSPY,20030324,146700.0,148000.0,143500.0,143900.0,2625223.0,,\nQQQ,20030324,264700.0,266000.0,259700.0,260300.0,82734600.0,0.8979578131322383,0.770452775174878\nSPY,20030325,144100.0,148300.0,143700.0,145600.0,2856717.0,,\nQQQ,20030325,261600.0,274700.0,260100.0,265100.0,90591500.0,0.8967620706184111,0.7640649445547258\nSPY,20030326,145500.0,145600.0,143000.0,144100.0,3007022.0,,\nQQQ,20030326,264900.0,267700.0,255600.0,265700.0,65788800.0,0.895460972625398,0.7561898984965862\nSPY,20030327,143200.0,147000.0,143200.0,144900.0,2072573.0,,\nQQQ,20030327,262600.0,266500.0,261000.0,263800.0,64262200.0,0.8943270524335887,0.7490498852339214\nSPY,20030328,144000.0,146200.0,143700.0,145600.0,2365845.0,,\nQQQ,20030328,261500.0,264300.0,259500.0,260300.0,43106700.0,0.8936411267123138,0.7431830743674508\nSPY,20030331,143700.0,145300.0,140400.0,141300.0,4139895.0,,\nQQQ,20030331,255800.0,273600.0,243100.0,253200.0,83742300.0,0.8927340999676835,0.735957830481587\nSPY,20030401,142000.0,143100.0,140700.0,141300.0,2460258.0,,\nQQQ,20030401,254500.0,256700.0,252500.0,254300.0,68171400.0,0.8910147615505264,0.7286311123467001\nSPY,20030402,144000.0,146900.0,142700.0,146400.0,2775579.0,,\nQQQ,20030402,260500.0,265600.0,254300.0,264400.0,72604600.0,0.8888804127673476,0.7224407231967502\nSPY,20030403,145600.0,147000.0,143500.0,144600.0,2588284.0,,\nQQQ,20030403,266400.0,268500.0,254900.0,264400.0,65951500.0,0.8854944251521507,0.7142258834063662\nSPY,20030404,145200.0,146700.0,143900.0,144100.0,2358386.0,,\nQQQ,20030404,265700.0,266000.0,259700.0,261200.0,62935800.0,0.882271898797055,0.706125959065293\nSPY,20030407,148300.0,149500.0,144100.0,144900.0,3200909.0,,\nQQQ,20030407,271200.0,279800.0,261800.0,262100.0,80657200.0,0.8790515965573533,0.6982563778018215\nSPY,20030408,145100.0,146400.0,143600.0,144500.0,2156329.0,,\nQQQ,20030408,261500.0,262900.0,258800.0,260100.0,54447300.0,0.8760052413796335,0.6906220813894167\nSPY,20030409,145200.0,146200.0,141400.0,141900.0,2400982.0,,\nQQQ,20030409,261000.0,267100.0,235900.0,254600.0,73818600.0,0.872720059454439,0.682925261017032\nSPY,20030410,142000.0,143900.0,142000.0,143700.0,1864621.0,,\nQQQ,20030410,254700.0,257700.0,244200.0,256900.0,53669700.0,0.8692792377025553,0.6752632519782322\nSPY,20030411,140500.0,144400.0,129400.0,132800.0,24638602.0,,\nQQQ,20030411,260300.0,265200.0,253600.0,255100.0,65478200.0,0.8647554993887417,0.665555442384292\nSPY,20030414,137100.0,137500.0,135000.0,135700.0,8692791.0,,\nQQQ,20030414,255800.0,261400.0,254900.0,260500.0,49686300.0,0.8595867908069126,0.6539035212170413\nSPY,20030415,135900.0,136000.0,133000.0,133900.0,5251498.0,,\nQQQ,20030415,259700.0,263500.0,252700.0,262100.0,54077000.0,0.8529044769618354,0.6414167084405384\nSPY,20030416,129900.0,136700.0,129200.0,132200.0,16439658.0,,\nQQQ,20030416,266500.0,268300.0,254600.0,262100.0,68950400.0,0.845203683179903,0.6287793971051421\nSPY,20030417,132000.0,132500.0,127200.0,131200.0,10804682.0,,\nQQQ,20030417,261600.0,269800.0,261500.0,269100.0,67251600.0,0.8363031198255982,0.6137161768709807\nSPY,20030421,131300.0,131900.0,129800.0,131400.0,2671012.0,,\nQQQ,20030421,269500.0,271100.0,266000.0,268800.0,51163300.0,0.8274394506881482,0.5985985889628521\nSPY,20030422,131900.0,136200.0,130900.0,135200.0,5165269.0,,\nQQQ,20030422,267400.0,274600.0,266500.0,274000.0,66685300.0,0.8181948886973857,0.5827427255371982\nSPY,20030423,135300.0,136300.0,133700.0,135800.0,3656563.0,,\nQQQ,20030423,275000.0,278000.0,272600.0,276500.0,66712100.0,0.8085265257980314,0.5663169389085791\nSPY,20030424,135200.0,136100.0,130000.0,134500.0,5522911.0,,\nQQQ,20030424,273600.0,277500.0,244700.0,275600.0,71731200.0,0.7989708929073738,0.5499076500568878\nSPY,20030425,134600.0,135800.0,132300.0,133500.0,3619018.0,,\nQQQ,20030425,273200.0,274500.0,268600.0,269400.0,63228300.0,0.789829174652779,0.5342062658151957\nSPY,20030428,134800.0,139600.0,134300.0,138500.0,11134220.0,,\nQQQ,20030428,270500.0,276300.0,269500.0,275200.0,57086100.0,0.7816082811223809,0.5182034221950927\nSPY,20030429,139800.0,141600.0,135800.0,140600.0,8051309.0,,\nQQQ,20030429,276500.0,282000.0,274100.0,277500.0,74657300.0,0.772770730865983,0.5022961906912768\nSPY,20030430,139300.0,143500.0,138500.0,142000.0,7858495.0,,\nQQQ,20030430,276600.0,277900.0,274300.0,274700.0,58553700.0,0.7632603773658266,0.4879686213283113\nSPY,20030501,142500.0,143900.0,140000.0,143800.0,5528566.0,,\nQQQ,20030501,274400.0,278700.0,271900.0,276800.0,64591500.0,0.7536232667334658,0.47561075072767106\nSPY,20030502,144600.0,145900.0,143400.0,144500.0,5802303.0,,\nQQQ,20030502,276100.0,289600.0,271400.0,282700.0,83785100.0,0.7440993102119184,0.4630632692301503\nSPY,20030505,147700.0,168800.0,147500.0,160700.0,26719111.0,,\nQQQ,20030505,283300.0,287100.0,281700.0,282400.0,79783100.0,0.7391301724102347,0.4613297874186526\nSPY,20030506,161800.0,179000.0,161100.0,174900.0,26563406.0,,\nQQQ,20030506,282200.0,295300.0,280800.0,286300.0,73696900.0,0.7369663866124465,0.460561889308942\nSPY,20030507,173300.0,182400.0,171100.0,176900.0,19087219.0,,\nQQQ,20030507,284100.0,286900.0,281200.0,282800.0,69065700.0,0.7353069887766286,0.4601010754530658\nSPY,20030508,177300.0,189000.0,173000.0,180200.0,12211982.0,,\nQQQ,20030508,278600.0,281900.0,270900.0,278100.0,78385700.0,0.7278672747589792,0.45961176537827453\nSPY,20030509,183200.0,184000.0,178800.0,182500.0,10374920.0,,\nQQQ,20030509,280400.0,284800.0,273800.0,284100.0,57497000.0,0.7223263031441128,0.459336551895595\nSPY,20030512,181500.0,187400.0,181300.0,185700.0,7335438.0,,\nQQQ,20030512,283600.0,289600.0,258500.0,288500.0,66583800.0,0.7198115690127981,0.45921356821396164\nSPY,20030513,184300.0,189700.0,182700.0,185600.0,7903218.0,,\nQQQ,20030513,286300.0,289900.0,285400.0,287200.0,62044000.0,0.714379249280401,0.45909583383581265\nSPY,20030514,188300.0,188400.0,184300.0,185600.0,6147490.0,,\nQQQ,20030514,288700.0,289700.0,283600.0,285300.0,59402700.0,0.7038952723550873,0.4589650622454126\nSPY,20030515,186000.0,188500.0,184000.0,187300.0,5164736.0,,\nQQQ,20030515,287500.0,297200.0,285600.0,289100.0,56876800.0,0.6927060446814038,0.4588352279819685\nSPY,20030516,185900.0,189900.0,182800.0,189800.0,5459862.0,,\nQQQ,20030516,287200.0,289400.0,283500.0,286600.0,67115800.0,0.6804631743579447,0.45872911702174757\nSPY,20030519,185500.0,186500.0,180600.0,181500.0,7714931.0,,\nQQQ,20030519,285200.0,286800.0,276100.0,277000.0,90054700.0,0.6654389951230647,0.4579848404986435\nSPY,20030520,181000.0,181600.0,176000.0,177900.0,7255299.0,,\nQQQ,20030520,277600.0,279600.0,266100.0,276800.0,66025400.0,0.6516266542169102,0.4570308649126441\nSPY,20030521,177900.0,180900.0,176700.0,178500.0,5112327.0,,\nQQQ,20030521,276500.0,285100.0,274400.0,277100.0,62584100.0,0.6407791286777584,0.45612648440368986\nSPY,20030522,178900.0,184000.0,177400.0,182400.0,3074953.0,,\nQQQ,20030522,277600.0,283200.0,231400.0,281300.0,60491200.0,0.6285194539638606,0.45567541900059216\nSPY,20030523,181800.0,184600.0,179600.0,183200.0,3403240.0,,\nQQQ,20030523,280500.0,282500.0,271500.0,280800.0,37486800.0,0.6120028408667167,0.45537433378140046\nSPY,20030527,179600.0,189000.0,179100.0,188700.0,4962328.0,,\nQQQ,20030527,279300.0,292200.0,278900.0,291400.0,101068600.0,0.6004585283289404,0.4552359770617471\nSPY,20030528,185000.0,186600.0,181500.0,182800.0,5591100.0,,\nQQQ,20030528,291800.0,294000.0,282200.0,291600.0,75175800.0,0.5884053735986192,0.45495072505578427\nSPY,20030529,182900.0,185000.0,179000.0,181000.0,5793730.0,,\nQQQ,20030529,292300.0,298000.0,291000.0,293100.0,95698200.0,0.5788031896924425,0.4544617895645847\nSPY,20030530,181200.0,181800.0,175300.0,179000.0,6362591.0,,\nQQQ,20030530,295300.0,298700.0,290700.0,297400.0,76031300.0,0.5672244692320222,0.45380075178008733\nSPY,20030602,181600.0,182900.0,172700.0,174500.0,7242756.0,,\nQQQ,20030602,300800.0,305000.0,290000.0,294500.0,99416800.0,0.5568203283203867,0.4525682893877771\nSPY,20030603,174400.0,176700.0,170200.0,173100.0,6058330.0,,\nQQQ,20030603,294500.0,298400.0,286600.0,298300.0,75594300.0,0.5528877691590169,0.4512642114442251\nSPY,20030604,173000.0,177900.0,171400.0,175800.0,4571872.0,,\nQQQ,20030604,298100.0,305800.0,297200.0,304000.0,83244900.0,0.5473752156772911,0.45043632067385064\nSPY,20030605,174500.0,177400.0,173300.0,176300.0,3426007.0,,\nQQQ,20030605,301300.0,306500.0,299700.0,306100.0,84153500.0,0.5402747474858892,0.4496046803981755\nSPY,20030606,177400.0,180400.0,171400.0,171400.0,4090874.0,,\nQQQ,20030606,311700.0,314700.0,300700.0,301000.0,133737800.0,0.5365397823689642,0.44828147997759055\nSPY,20030609,169400.0,170400.0,166300.0,168000.0,4484685.0,,\nQQQ,20030609,300000.0,302200.0,295300.0,297300.0,94536600.0,0.5338383777269183,0.4464112267336466\nSPY,20030610,168700.0,172900.0,167500.0,171800.0,2924069.0,,\nQQQ,20030610,298500.0,301800.0,296800.0,301800.0,63484600.0,0.53403922849148,0.4453065389900273\nSPY,20030611,171500.0,175100.0,168100.0,174500.0,3555559.0,,\nQQQ,20030611,300700.0,328600.0,291700.0,305200.0,85915300.0,0.5388859789648504,0.44600628016500576\nSPY,20030612,175300.0,178800.0,174900.0,177400.0,3897287.0,,\nQQQ,20030612,306200.0,313900.0,302600.0,305600.0,77631200.0,0.542389839286492,0.4458697981720624\nSPY,20030613,177500.0,179500.0,171300.0,174200.0,3276792.0,,\nQQQ,20030613,306600.0,307300.0,298600.0,299500.0,82269400.0,0.545608996032018,0.4462492481084874\nSPY,20030616,175900.0,182700.0,174500.0,182700.0,3905895.0,,\nQQQ,20030616,301700.0,308400.0,300000.0,308200.0,68028500.0,0.5538053217283418,0.4473598515785373\nSPY,20030617,184000.0,185000.0,179900.0,181800.0,2966204.0,,\nQQQ,20030617,310100.0,311100.0,305600.0,307900.0,66045300.0,0.5580226553078287,0.4472871111757049\nSPY,20030618,184300.0,194800.0,183100.0,191200.0,7170561.0,,\nQQQ,20030618,306600.0,312300.0,285000.0,310200.0,77165700.0,0.5668998671192202,0.447656062497288\nSPY,20030619,193600.0,196100.0,187700.0,191100.0,6524409.0,,\nQQQ,20030619,309800.0,312400.0,303800.0,304800.0,77195000.0,0.5753863121019012,0.44979582084483666\nSPY,20030620,195300.0,195800.0,189000.0,192000.0,5560495.0,,\nQQQ,20030620,306900.0,315000.0,302500.0,304000.0,73708600.0,0.5847196748070701,0.45341455273412457\nSPY,20030623,193000.0,196900.0,187500.0,190300.0,5248599.0,,\nQQQ,20030623,303300.0,303700.0,290800.0,297900.0,83259300.0,0.5928905680148084,0.4587789699677063\nSPY,20030624,196300.0,196700.0,187500.0,187600.0,8412857.0,,\nQQQ,20030624,297300.0,303000.0,295300.0,297100.0,80621500.0,0.5997262643819076,0.4627171761141519\nSPY,20030625,188600.0,194000.0,187100.0,190900.0,5487496.0,,\nQQQ,20030625,296700.0,330500.0,294700.0,296000.0,91645200.0,0.6075849843926726,0.4686994228322457\nSPY,20030626,187000.0,193200.0,187000.0,192900.0,2739539.0,,\nQQQ,20030626,297100.0,302800.0,296100.0,302100.0,76949300.0,0.6158721296887296,0.4744714091278438\nSPY,20030627,193000.0,193100.0,184800.0,187200.0,6289256.0,,\nQQQ,20030627,302500.0,305700.0,297700.0,299600.0,80921800.0,0.6225624795856691,0.4788049959674292\nSPY,20030630,186300.0,192100.0,185900.0,190500.0,3199671.0,,\nQQQ,20030630,301600.0,303400.0,298000.0,298600.0,68284200.0,0.6300952167240181,0.48332427216455437\nSPY,20030701,189400.0,191800.0,185100.0,190900.0,2856123.0,,\nQQQ,20030701,297000.0,303300.0,292600.0,302900.0,91627200.0,0.6397075322042858,0.49111124373491\nSPY,20030702,190300.0,194000.0,190200.0,193300.0,5378878.0,,\nQQQ,20030702,304100.0,336100.0,303800.0,309000.0,79805700.0,0.6519000193524899,0.5019481471714761\nSPY,20030703,190000.0,195500.0,189900.0,190700.0,2435930.0,,\nQQQ,20030703,307000.0,318400.0,300700.0,305300.0,50131300.0,0.6628597390579503,0.5109102046603227\nSPY,20030707,192500.0,201800.0,191300.0,199000.0,4774316.0,,\nQQQ,20030707,309700.0,318800.0,302500.0,318400.0,85553900.0,0.6757925420103941,0.5155771119982926\nSPY,20030708,195200.0,205000.0,194900.0,204100.0,4254879.0,,\nQQQ,20030708,317800.0,323100.0,316200.0,322600.0,79946000.0,0.6906641476427575,0.5232573749553754\nSPY,20030709,202100.0,204500.0,198900.0,198900.0,3631235.0,,\nQQQ,20030709,321700.0,327800.0,312000.0,321700.0,81128700.0,0.7037608439617576,0.5321750768616851\nSPY,20030710,198900.0,199400.0,193700.0,195800.0,2853373.0,,\nQQQ,20030710,318400.0,323000.0,313300.0,315700.0,98458300.0,0.7160712951732235,0.5432091777398866\nSPY,20030711,196700.0,200000.0,195300.0,198500.0,2257642.0,,\nQQQ,20030711,316500.0,319900.0,316100.0,318400.0,66236400.0,0.7298281936822347,0.5529087457210067\nSPY,20030714,200600.0,204000.0,198700.0,199000.0,3215668.0,,\nQQQ,20030714,323400.0,327500.0,320700.0,322200.0,82207300.0,0.7408241013764533,0.5609139170320224\nSPY,20030715,200300.0,202400.0,194300.0,196100.0,3344061.0,,\nQQQ,20030715,325300.0,326500.0,311500.0,321700.0,69431300.0,0.7519478069947317,0.5679402017285264\nSPY,20030716,199700.0,200000.0,193800.0,198900.0,3666244.0,,\nQQQ,20030716,324600.0,329900.0,310900.0,321400.0,75587900.0,0.7622742269668227,0.5754612350836072\nSPY,20030717,201800.0,209500.0,201000.0,209200.0,12905820.0,,\nQQQ,20030717,316800.0,318400.0,310400.0,312100.0,100236000.0,0.7661675553503552,0.5801695260549511\nSPY,20030718,208900.0,211800.0,204000.0,208500.0,5128996.0,,\nQQQ,20030718,314000.0,333400.0,309200.0,313000.0,75330500.0,0.7700479245318135,0.5862804966668446\nSPY,20030721,207200.0,208000.0,203000.0,206100.0,3202773.0,,\nQQQ,20030721,312600.0,318600.0,306100.0,308300.0,131325500.0,0.7730533859511466,0.593178478321447\nSPY,20030722,208800.0,209900.0,205000.0,208000.0,3447245.0,,\nQQQ,20030722,311100.0,315000.0,308600.0,313100.0,88362500.0,0.7769386911581954,0.6004127440112222\nSPY,20030723,209400.0,209600.0,204600.0,208100.0,2383960.0,,\nQQQ,20030723,313800.0,316200.0,309900.0,315200.0,64567900.0,0.780899069257608,0.6047714125637889\nSPY,20030724,210400.0,215000.0,204100.0,205100.0,3845728.0,,\nQQQ,20030724,318600.0,320200.0,310800.0,311300.0,76500400.0,0.7845849562878207,0.6127139553945444\nSPY,20030725,204100.0,215700.0,204000.0,215400.0,3742276.0,,\nQQQ,20030725,311300.0,317800.0,307700.0,317700.0,78832100.0,0.7882065641047032,0.6163236451952268\nSPY,20030728,215000.0,215100.0,208600.0,209300.0,2861430.0,,\nQQQ,20030728,318600.0,319900.0,316000.0,318500.0,56717300.0,0.791914214388979,0.6198606055849505\nSPY,20030729,210100.0,210800.0,205200.0,208100.0,3351940.0,,\nQQQ,20030729,319300.0,327100.0,312300.0,316600.0,78070000.0,0.7955227722387829,0.6269385069329677\nSPY,20030730,207700.0,209000.0,201700.0,202500.0,2964600.0,,\nQQQ,20030730,317000.0,317400.0,313300.0,314100.0,55694000.0,0.7989449973866182,0.6337896331384409\nSPY,20030731,207300.0,213500.0,202800.0,211200.0,4475072.0,,\nQQQ,20030731,318000.0,323300.0,312600.0,317000.0,82437900.0,0.8024956784567573,0.6411238776401057\nSPY,20030801,209900.0,212700.0,206400.0,206400.0,2461833.0,,\nQQQ,20030801,316900.0,319200.0,313000.0,314900.0,70790300.0,0.8058242740100763,0.6476276091004012\nSPY,20030804,205300.0,215000.0,202800.0,212500.0,3590798.0,,\nQQQ,20030804,314100.0,319800.0,308400.0,315100.0,93816600.0,0.8086155576166191,0.6519455779395136\nSPY,20030805,213800.0,214000.0,201000.0,203700.0,3809945.0,,\nQQQ,20030805,314100.0,317200.0,300500.0,305500.0,91471700.0,0.810143427218828,0.6533868785899761\nSPY,20030806,200600.0,201700.0,195000.0,196800.0,4191812.0,,\nQQQ,20030806,303600.0,315100.0,300000.0,302100.0,93193400.0,0.8120963546483538,0.6593608675429434\nSPY,20030807,197900.0,200900.0,194200.0,198800.0,2921153.0,,\nQQQ,20030807,302200.0,312200.0,300200.0,302900.0,66734200.0,0.814270886383126,0.6669969960683956\nSPY,20030808,201000.0,201300.0,196000.0,196400.0,2196728.0,,\nQQQ,20030808,304300.0,305500.0,289900.0,300600.0,64610600.0,0.8161305247158682,0.6744674614106521\nSPY,20030811,198000.0,199300.0,195100.0,196600.0,2176118.0,,\nQQQ,20030811,300800.0,306000.0,300300.0,304000.0,63342200.0,0.8180141853921119,0.6813855087715084\nSPY,20030812,197600.0,198000.0,194600.0,196800.0,2609740.0,,\nQQQ,20030812,305100.0,308900.0,300400.0,308600.0,55531500.0,0.8200970695300608,0.6878923015046243\nSPY,20030813,198500.0,203700.0,195800.0,201800.0,4832228.0,,\nQQQ,20030813,309800.0,310700.0,306500.0,308200.0,56769800.0,0.8220629373667463,0.6928897273290149\nSPY,20030814,201600.0,203300.0,199400.0,199500.0,3550316.0,,\nQQQ,20030814,308800.0,311900.0,306700.0,311400.0,42839000.0,0.8241861781681684,0.6992394740809449\nSPY,20030815,200200.0,200700.0,196600.0,197100.0,2165374.0,,\nQQQ,20030815,310000.0,313300.0,309300.0,311500.0,26323200.0,0.8264674487243104,0.7057536907532033\nSPY,20030818,198500.0,204100.0,197200.0,203800.0,3317525.0,,\nQQQ,20030818,313000.0,319600.0,310500.0,319400.0,63737300.0,0.8293688870201215,0.7113899101379315\nSPY,20030819,203700.0,204500.0,200000.0,202400.0,2168722.0,,\nQQQ,20030819,321000.0,323700.0,318500.0,323600.0,63208400.0,0.832106606264319,0.7153722335869204\nSPY,20030820,202000.0,212700.0,201400.0,210100.0,4650223.0,,\nQQQ,20030820,320900.0,343400.0,320200.0,322700.0,56847400.0,0.8350607267042424,0.7203830395912781\nSPY,20030821,210300.0,217100.0,209500.0,216400.0,4316154.0,,\nQQQ,20030821,325900.0,328200.0,321000.0,326800.0,75593700.0,0.8381786667675213,0.7239491706828263\nSPY,20030822,219900.0,220000.0,206400.0,208600.0,4184591.0,,\nQQQ,20030822,332700.0,333700.0,323300.0,324700.0,90054000.0,0.8407562117014298,0.7268801397441901\nSPY,20030825,207800.0,209100.0,204900.0,208600.0,2369310.0,,\nQQQ,20030825,323600.0,333100.0,320000.0,324600.0,41284000.0,0.8433360458388834,0.7315048863775993\nSPY,20030826,207500.0,210700.0,203500.0,210300.0,2855223.0,,\nQQQ,20030826,322800.0,325900.0,318100.0,325100.0,78153300.0,0.845769714712553,0.7359226738951685\nSPY,20030827,209100.0,214800.0,206600.0,214500.0,3687432.0,,\nQQQ,20030827,324900.0,337100.0,323700.0,328100.0,46132500.0,0.8481863047226215,0.7407803603858213\nSPY,20030828,215900.0,222200.0,213300.0,222100.0,5543415.0,,\nQQQ,20030828,329400.0,331100.0,316200.0,330900.0,53470300.0,0.8507482991481298,0.745705630998534\nSPY,20030829,222000.0,228500.0,220500.0,226400.0,4411862.0,,\nQQQ,20030829,330400.0,334600.0,322600.0,333100.0,49200100.0,0.8532213402569282,0.7503252203005286\nSPY,20030902,226900.0,229000.0,224000.0,228500.0,4105724.0,,\nQQQ,20030902,334900.0,338600.0,304800.0,338300.0,77991800.0,0.8562331417826771,0.7553160517773503\nSPY,20030903,228000.0,233200.0,227600.0,229800.0,4935615.0,,\nQQQ,20030903,341000.0,342000.0,336500.0,337900.0,80100500.0,0.8587935367568362,0.7574137406901336\nSPY,20030904,231600.0,232500.0,227700.0,228300.0,3278605.0,,\nQQQ,20030904,338300.0,342200.0,337000.0,341500.0,59976700.0,0.8618112529278796,0.7610740498346044\nSPY,20030905,227500.0,231500.0,224100.0,224500.0,4079210.0,,\nQQQ,20030905,339600.0,343400.0,327900.0,338600.0,88478700.0,0.8645991110266182,0.7634281968122664\nSPY,20030908,225000.0,227900.0,224700.0,227100.0,2866165.0,,\nQQQ,20030908,340000.0,345100.0,338600.0,344600.0,68858600.0,0.867478692068415,0.7665061771705065\nSPY,20030909,225500.0,226700.0,221200.0,223600.0,3090628.0,,\nQQQ,20030909,343200.0,344700.0,339200.0,340500.0,80989900.0,0.8698180063416228,0.7694385761210002\nSPY,20030910,222500.0,226100.0,221100.0,222600.0,3718094.0,,\nQQQ,20030910,337500.0,345500.0,331100.0,331100.0,108812900.0,0.8713413809491031,0.7721851005663048\nSPY,20030911,222500.0,227900.0,221000.0,225400.0,3590474.0,,\nQQQ,20030911,332800.0,337800.0,293100.0,335600.0,92848200.0,0.8730673430882893,0.7748764646923396\nSPY,20030912,224800.0,231400.0,223100.0,230800.0,3131781.0,,\nQQQ,20030912,333400.0,338000.0,322100.0,337400.0,102369500.0,0.8748297249940766,0.7772405425080122\nSPY,20030915,228000.0,229000.0,221300.0,222500.0,3770502.0,,\nQQQ,20030915,338500.0,339100.0,334400.0,334900.0,50427200.0,0.8764619550197829,0.779838585804661\nSPY,20030916,222100.0,227000.0,222000.0,222800.0,4562446.0,,\nQQQ,20030916,335400.0,344300.0,330000.0,343400.0,79812200.0,0.8788331916221135,0.7834765564220166\nSPY,20030917,223700.0,223800.0,218600.0,221500.0,5047779.0,,\nQQQ,20030917,343100.0,345000.0,333300.0,341700.0,76836800.0,0.8815297346733866,0.7882987328097549\nSPY,20030918,220500.0,229900.0,219500.0,229300.0,4541765.0,,\nQQQ,20030918,341700.0,348600.0,334400.0,347800.0,88501800.0,0.8849427811807572,0.7941470638191602\nSPY,20030919,228800.0,230500.0,224300.0,226200.0,3046812.0,,\nQQQ,20030919,348000.0,348600.0,343600.0,346000.0,67567000.0,0.8880261811906404,0.797835252822301\nSPY,20030922,221800.0,225000.0,219200.0,221200.0,3105603.0,,\nQQQ,20030922,341200.0,342000.0,337700.0,339500.0,93800100.0,0.8910276466183928,0.8025116088553721\nSPY,20030923,220300.0,224600.0,218800.0,224300.0,2373195.0,,\nQQQ,20030923,339800.0,345600.0,339100.0,344700.0,72929000.0,0.8950007163975929,0.8074515135560063\nSPY,20030924,222500.0,223500.0,210800.0,212600.0,5160629.0,,\nQQQ,20030924,345000.0,345200.0,332600.0,333600.0,106822400.0,0.8979722448137077,0.8112709295223696\nSPY,20030925,213400.0,213700.0,202500.0,203000.0,10442657.0,,\nQQQ,20030925,333900.0,339800.0,329600.0,329800.0,107048600.0,0.9000268083623048,0.8160683540988429\nSPY,20030926,202800.0,210200.0,201500.0,206500.0,6058519.0,,\nQQQ,20030926,328900.0,339300.0,318100.0,325900.0,104092400.0,0.9020453205451248,0.8199186669535367\nSPY,20030929,214000.0,216700.0,206500.0,213800.0,6265799.0,,\nQQQ,20030929,327600.0,347300.0,322900.0,331100.0,91294800.0,0.9047687233299486,0.823896527216783\nSPY,20030930,210900.0,213600.0,204400.0,206200.0,4580421.0,,\nQQQ,20030930,329200.0,329600.0,323600.0,324400.0,115751500.0,0.9076150963837792,0.8267688917112034\nSPY,20031001,207500.0,211000.0,201900.0,207900.0,4054439.0,,\nQQQ,20031001,326100.0,332300.0,320100.0,331300.0,104783200.0,0.9095599718562895,0.8294732138169207\nSPY,20031002,208000.0,208000.0,202800.0,205700.0,3400047.0,,\nQQQ,20031002,331000.0,343500.0,322000.0,332100.0,81978200.0,0.9113443980258266,0.8306527902718254\nSPY,20031003,210000.0,218600.0,208800.0,217700.0,5080520.0,,\nQQQ,20031003,338600.0,349600.0,338200.0,341600.0,107858100.0,0.9143889777771843,0.8323059220549384\nSPY,20031006,216700.0,223300.0,215800.0,222900.0,4446173.0,,\nQQQ,20031006,342800.0,344100.0,333000.0,343400.0,47134200.0,0.9176951264503427,0.8333098056023182\nSPY,20031007,220500.0,234100.0,219100.0,232200.0,7106564.0,,\nQQQ,20031007,341600.0,346100.0,340100.0,345700.0,75347600.0,0.9211466337698252,0.8341534316420796\nSPY,20031008,232500.0,235400.0,227300.0,230600.0,7487502.0,,\nQQQ,20031008,348100.0,348400.0,341900.0,344200.0,67981200.0,0.9241992563365735,0.8349648124198767\nSPY,20031009,233000.0,236700.0,227900.0,234500.0,6024474.0,,\nQQQ,20031009,349200.0,352700.0,344300.0,346400.0,115553800.0,0.9273501079867547,0.8357956903328151\nSPY,20031010,235000.0,238100.0,233700.0,237200.0,2909583.0,,\nQQQ,20031010,347700.0,349700.0,346400.0,349300.0,63783500.0,0.9302771261316845,0.8370193535878601\nSPY,20031013,238000.0,244100.0,237200.0,243400.0,4677340.0,,\nQQQ,20031013,351400.0,362500.0,341500.0,351500.0,58393900.0,0.9327412122175348,0.8398396886462676\nSPY,20031014,243300.0,247400.0,223800.0,246000.0,3888389.0,,\nQQQ,20031014,351000.0,353500.0,349600.0,353100.0,56284800.0,0.9352410271903125,0.8438369755457202\nSPY,20031015,248400.0,250100.0,245800.0,248500.0,9838429.0,,\nQQQ,20031015,357900.0,358500.0,342000.0,352100.0,92129400.0,0.9369980878488501,0.8490073056705078\nSPY,20031016,238000.0,238400.0,224100.0,231900.0,17471338.0,,\nQQQ,20031016,351000.0,355300.0,341100.0,354400.0,65957400.0,0.9388625338176321,0.851998615013459\nSPY,20031017,234400.0,234900.0,224300.0,227300.0,6181420.0,,\nQQQ,20031017,354100.0,368500.0,346100.0,346600.0,92146300.0,0.9396388519046878,0.8531245741456829\nSPY,20031020,226000.0,233400.0,223800.0,232300.0,4842875.0,,\nQQQ,20031020,346600.0,356800.0,340800.0,349800.0,66406700.0,0.9405459708304966,0.8547313245522001\nSPY,20031021,233100.0,234000.0,227500.0,231800.0,2796085.0,,\nQQQ,20031021,351300.0,354500.0,349400.0,353600.0,69893000.0,0.941340275579901,0.8573782677677938\nSPY,20031022,229300.0,232000.0,226800.0,228500.0,2519936.0,,\nQQQ,20031022,349100.0,358800.0,344400.0,345600.0,85295700.0,0.9422396074690044,0.8605559091705777\nSPY,20031023,227300.0,231500.0,225900.0,228700.0,2804733.0,,\nQQQ,20031023,341500.0,345100.0,340500.0,343400.0,86490000.0,0.9429435078871161,0.8638000263406815\nSPY,20031024,225600.0,228500.0,222300.0,226000.0,3683712.0,,\nQQQ,20031024,337900.0,344100.0,334900.0,340700.0,94799400.0,0.9436892337348666,0.8668201934079187\nSPY,20031027,227500.0,228900.0,224900.0,226200.0,2798803.0,,\nQQQ,20031027,342800.0,344500.0,340400.0,341800.0,61720400.0,0.9445629083105046,0.8706954183292931\nSPY,20031028,225400.0,237700.0,223200.0,235500.0,4333551.0,,\nQQQ,20031028,344200.0,353100.0,343700.0,352900.0,103921000.0,0.9460243452951935,0.8753353398013176\nSPY,20031029,235100.0,239000.0,233400.0,236900.0,3243343.0,,\nQQQ,20031029,352100.0,354100.0,343200.0,353000.0,72076300.0,0.9476437587476586,0.8800386266655664\nSPY,20031030,239900.0,240000.0,228700.0,230500.0,4611733.0,,\nQQQ,20031030,357900.0,360000.0,344500.0,352200.0,87880200.0,0.9491014390898467,0.88432220804682\nSPY,20031031,232800.0,233500.0,227800.0,228300.0,3623392.0,,\nQQQ,20031031,354500.0,354900.0,350600.0,351600.0,51389300.0,0.9504902243804538,0.8885197159294842\nSPY,20031103,228300.0,233000.0,227800.0,232700.0,4798412.0,,\nQQQ,20031103,354300.0,360000.0,347500.0,358800.0,67913163.0,0.9516854683686511,0.8918646021563262\nSPY,20031104,230800.0,231000.0,225900.0,229100.0,4255713.0,,\nQQQ,20031104,356900.0,358700.0,354000.0,355800.0,58032335.0,0.9527271751887011,0.894170875737954\nSPY,20031105,228200.0,231300.0,224700.0,230300.0,5561040.0,,\nQQQ,20031105,355200.0,357700.0,342900.0,356400.0,57850100.0,0.9537196049763259,0.8961978168828542\nSPY,20031106,229100.0,231500.0,226500.0,231200.0,7133593.0,,\nQQQ,20031106,357700.0,359000.0,325400.0,358200.0,86443900.0,0.9547054329411054,0.8977605787570575\nSPY,20031107,231900.0,232400.0,224500.0,224500.0,3583446.0,,\nQQQ,20031107,360800.0,369900.0,351500.0,357600.0,57801500.0,0.9550842677104102,0.9000164037801401\nSPY,20031110,224400.0,229600.0,218400.0,219000.0,4014748.0,,\nQQQ,20031110,357000.0,361200.0,346900.0,351900.0,64945700.0,0.9554615537870031,0.9027599159535554\nSPY,20031111,218500.0,220200.0,214800.0,215700.0,3772162.0,,\nQQQ,20031111,351500.0,359000.0,348500.0,350100.0,73588600.0,0.9557241573216186,0.9059471342395977\nSPY,20031112,214800.0,227200.0,214800.0,223400.0,5021429.0,,\nQQQ,20031112,351700.0,358800.0,351400.0,358300.0,74280100.0,0.9560538168376003,0.9086422220596918\nSPY,20031113,220700.0,225600.0,219200.0,224400.0,3723946.0,,\nQQQ,20031113,357000.0,359500.0,355500.0,357900.0,62183500.0,0.9563404424356459,0.9110456044924691\nSPY,20031114,225300.0,226100.0,212800.0,214600.0,4105749.0,,\nQQQ,20031114,358200.0,360200.0,349900.0,350200.0,89191000.0,0.9562831357960387,0.9120328285089281\nSPY,20031117,213700.0,213700.0,209700.0,211700.0,3879294.0,,\nQQQ,20031117,348300.0,358500.0,303300.0,346200.0,106152500.0,0.956064326261245,0.9128946505376985\nSPY,20031118,212100.0,213400.0,203500.0,203500.0,4583032.0,,\nQQQ,20031118,348800.0,358600.0,339500.0,339800.0,99638900.0,0.9556038458457522,0.9139531134605995\nSPY,20031119,205600.0,206500.0,202600.0,203400.0,6061588.0,,\nQQQ,20031119,340000.0,344000.0,338800.0,343000.0,82821700.0,0.9549764892195095,0.915085096968752\nSPY,20031120,204600.0,210800.0,201000.0,203500.0,4054672.0,,\nQQQ,20031120,339300.0,346800.0,330200.0,339600.0,115695700.0,0.9544898832216858,0.915282113343573\nSPY,20031121,203400.0,205800.0,198500.0,202800.0,4102100.0,,\nQQQ,20031121,340700.0,349800.0,337300.0,341500.0,77430500.0,0.9539192845051169,0.9144613481371819\nSPY,20031124,204900.0,212700.0,204400.0,211200.0,6565550.0,,\nQQQ,20031124,345100.0,352400.0,329200.0,352300.0,84299600.0,0.9533853148445078,0.9136910124133075\nSPY,20031125,212300.0,212500.0,206100.0,207000.0,4334878.0,,\nQQQ,20031125,352800.0,354500.0,350900.0,351300.0,69609800.0,0.9526516552317159,0.912473948547969\nSPY,20031126,208900.0,211500.0,202500.0,206800.0,3826812.0,,\nQQQ,20031126,354100.0,355200.0,348100.0,352800.0,71861800.0,0.9516906199459522,0.9115215941986287\nSPY,20031128,207700.0,210700.0,205200.0,209000.0,1355183.0,,\nQQQ,20031128,352600.0,355000.0,352100.0,353700.0,25140100.0,0.951053016078911,0.9101867983389229\nSPY,20031201,210500.0,218500.0,210000.0,218000.0,5667136.0,,\nQQQ,20031201,356900.0,360100.0,354700.0,359000.0,80524000.0,0.9508549115573862,0.9092561906637012\nSPY,20031202,216200.0,219000.0,214100.0,215100.0,3568916.0,,\nQQQ,20031202,358200.0,360500.0,355800.0,356100.0,62444500.0,0.9507405680226734,0.9083911979534929\nSPY,20031203,216000.0,218400.0,209600.0,211300.0,3319669.0,,\nQQQ,20031203,358400.0,361200.0,353500.0,353600.0,104129600.0,0.9502286274320649,0.907775337348108\nSPY,20031204,209400.0,211600.0,207800.0,211500.0,3045290.0,,\nQQQ,20031204,354000.0,394300.0,350800.0,356300.0,97153700.0,0.9495085623311319,0.9074851490195125\nSPY,20031205,209000.0,211500.0,207300.0,208900.0,3133474.0,,\nQQQ,20031205,352700.0,356300.0,349600.0,350500.0,85470500.0,0.9488926211095691,0.9079129758537203\nSPY,20031208,207800.0,210800.0,204100.0,210500.0,2345229.0,,\nQQQ,20031208,350100.0,353300.0,347800.0,352500.0,85254800.0,0.9483218300193965,0.9077674981299924\nSPY,20031209,211700.0,212500.0,204000.0,204900.0,2286801.0,,\nQQQ,20031209,354400.0,359700.0,343400.0,344200.0,107980800.0,0.9477298520517704,0.9083818243815711\nSPY,20031210,205100.0,206100.0,199600.0,203900.0,4213875.0,,\nQQQ,20031210,344900.0,355400.0,336500.0,345300.0,100299900.0,0.9471099692032576,0.9085706251511921\nSPY,20031211,202500.0,213400.0,202100.0,211900.0,3124635.0,,\nQQQ,20031211,344900.0,355300.0,341400.0,352400.0,108067400.0,0.9467420642298393,0.9087648454112208\nSPY,20031212,211700.0,213200.0,207000.0,209000.0,3390312.0,,\nQQQ,20031212,353100.0,353400.0,349000.0,352300.0,69817400.0,0.9460770459926966,0.908661701953198\nSPY,20031215,213900.0,214900.0,200900.0,200900.0,6215098.0,,\nQQQ,20031215,359200.0,370000.0,347000.0,347500.0,98920400.0,0.9450328803030401,0.9084382360876019\nSPY,20031216,201000.0,222000.0,200200.0,201000.0,6423761.0,,\nQQQ,20031216,347900.0,350200.0,344200.0,349000.0,88258500.0,0.9438629504774461,0.9075983643779796\nSPY,20031217,200000.0,201300.0,197900.0,199700.0,4309556.0,,\nQQQ,20031217,348200.0,350000.0,345700.0,348000.0,64756100.0,0.9426717062708896,0.9066872710422723\nSPY,20031218,199000.0,201800.0,199000.0,200900.0,5610538.0,,\nQQQ,20031218,349500.0,356400.0,344500.0,355700.0,87652600.0,0.9409441091739001,0.904850962436218\nSPY,20031219,201900.0,204200.0,196500.0,197000.0,6785337.0,,\nQQQ,20031219,356000.0,356500.0,352000.0,354500.0,88921700.0,0.9388137267008863,0.9022042466845936\nSPY,20031222,196500.0,198900.0,192500.0,198500.0,6179746.0,,\nQQQ,20031222,353500.0,385700.0,346400.0,355800.0,62437500.0,0.9367648057002551,0.8996131910050326\nSPY,20031223,199200.0,199500.0,196000.0,198800.0,5229035.0,,\nQQQ,20031223,355900.0,360200.0,349000.0,359600.0,68370200.0,0.9344722296361342,0.8965081468476581\nSPY,20031224,197100.0,205900.0,196500.0,204200.0,3172450.0,,\nQQQ,20031224,358400.0,360200.0,353700.0,358600.0,46722800.0,0.932896498219135,0.8945408264134196\nSPY,20031226,203700.0,209100.0,203400.0,207200.0,1838468.0,,\nQQQ,20031226,359600.0,360900.0,358200.0,358700.0,25403900.0,0.9316300494558376,0.8929953959169219\nSPY,20031229,209100.0,211500.0,208600.0,211100.0,3858601.0,,\nQQQ,20031229,360200.0,365100.0,359000.0,364900.0,59296100.0,0.9302558149383888,0.8920048000164821\nSPY,20031230,211800.0,215000.0,211500.0,212500.0,3604773.0,,\nQQQ,20031230,365200.0,365500.0,362800.0,364700.0,47434400.0,0.9290315814795168,0.8909615043703515\nSPY,20031231,213500.0,215300.0,211800.0,213700.0,2721718.0,,\nQQQ,20031231,366000.0,366400.0,354100.0,363700.0,57150500.0,0.9280918799771117,0.8899778653333559\nSPY,20040102,215400.0,217500.0,211800.0,212100.0,2296599.0,,\nQQQ,20040102,366500.0,367900.0,357000.0,363300.0,53850600.0,0.9270926037656217,0.8891612423692519\nSPY,20040105,214200.0,223900.0,214200.0,221000.0,6727065.0,,\nQQQ,20040105,366000.0,371600.0,358300.0,371200.0,66093600.0,0.9264752277885896,0.888803548013074\nSPY,20040106,222400.0,224200.0,217100.0,221000.0,7778117.0,,\nQQQ,20040106,370800.0,374200.0,369500.0,373200.0,60312000.0,0.9258133000810345,0.8879826342207013\nSPY,20040107,221000.0,228300.0,207000.0,225900.0,9833296.0,,\nQQQ,20040107,372700.0,376200.0,370700.0,376100.0,66027600.0,0.9254869303119238,0.887714550974662\nSPY,20040108,228300.0,246900.0,226500.0,234000.0,7786092.0,,\nQQQ,20040108,378700.0,379800.0,376000.0,379400.0,71539000.0,0.9255103013704651,0.8887493897985337\nSPY,20040109,232300.0,241300.0,227900.0,229600.0,7502048.0,,\nQQQ,20040109,377100.0,388400.0,358700.0,378100.0,90933300.0,0.9254563277664215,0.889040344482347\nSPY,20040112,232600.0,240000.0,223000.0,238000.0,8097023.0,,\nQQQ,20040112,378500.0,383200.0,367700.0,383000.0,74670800.0,0.9259130683100033,0.889618129492342\nSPY,20040113,246200.0,248400.0,235000.0,240400.0,11105205.0,,\nQQQ,20040113,382600.0,386300.0,376000.0,379000.0,93502800.0,0.926480392253975,0.8902437401318094\nSPY,20040114,244000.0,245400.0,237800.0,242700.0,10011242.0,,\nQQQ,20040114,380800.0,389500.0,371000.0,381000.0,57436200.0,0.9272593397063809,0.8910013299314581\nSPY,20040115,228500.0,234000.0,225000.0,228300.0,17797181.0,,\nQQQ,20040115,379300.0,384600.0,376300.0,381200.0,101805100.0,0.9270043397771238,0.8913540887466294\nSPY,20040116,230300.0,230400.0,226200.0,226500.0,6234849.0,,\nQQQ,20040116,383800.0,386300.0,348300.0,385700.0,73172000.0,0.926221037191579,0.8912384396290675\nSPY,20040120,226700.0,228000.0,221000.0,227600.0,5258150.0,,\nQQQ,20040120,387200.0,390000.0,383100.0,386400.0,74319500.0,0.9253084150784022,0.8915983835678055\nSPY,20040121,227000.0,229700.0,224300.0,226500.0,3915577.0,,\nQQQ,20040121,383900.0,387000.0,380000.0,384100.0,106032800.0,0.9243813192655808,0.8916403770293932\nSPY,20040122,226300.0,228300.0,221800.0,221800.0,3543392.0,,\nQQQ,20040122,385600.0,386900.0,380700.0,380900.0,83945200.0,0.9231741825051728,0.8908833699332329\nSPY,20040123,222500.0,227400.0,222500.0,226100.0,3912298.0,,\nQQQ,20040123,382000.0,388900.0,376000.0,380300.0,86325100.0,0.9225312496059687,0.8908957430061272\nSPY,20040126,225200.0,230600.0,224300.0,230400.0,4610352.0,,\nQQQ,20040126,379700.0,389000.0,378400.0,385600.0,80168100.0,0.9218106338168391,0.8911150838437961\nSPY,20040127,230300.0,232500.0,228000.0,229400.0,4944499.0,,\nQQQ,20040127,385100.0,386300.0,376900.0,377900.0,90496900.0,0.9213145473125408,0.8911345808071446\nSPY,20040128,228400.0,233800.0,224200.0,224700.0,4717904.0,,\nQQQ,20040128,379400.0,380600.0,360500.0,371600.0,122748000.0,0.9208339465831278,0.8907461413065889\nSPY,20040129,226200.0,228000.0,221900.0,227000.0,3634190.0,,\nQQQ,20040129,372400.0,373100.0,361000.0,371600.0,138458200.0,0.9205395584794509,0.8905640866413169\nSPY,20040130,226500.0,228700.0,224200.0,225100.0,3730050.0,,\nQQQ,20040130,372000.0,381900.0,369700.0,370900.0,80818200.0,0.9199782330271409,0.8898680280727074\nSPY,20040202,224600.0,228100.0,220900.0,221200.0,4682047.0,,\nQQQ,20040202,372000.0,374800.0,368200.0,369500.0,90665200.0,0.9192159250849385,0.8885620234510845\nSPY,20040203,223000.0,224000.0,220000.0,223000.0,3072723.0,,\nQQQ,20040203,369100.0,381000.0,360800.0,370600.0,64169800.0,0.9186337352480232,0.8878110161245336\nSPY,20040204,220000.0,220900.0,217000.0,217800.0,5086720.0,,\nQQQ,20040204,366200.0,377600.0,363300.0,364000.0,106355100.0,0.9179456423097022,0.8866003308237689\nSPY,20040205,218200.0,229100.0,218100.0,225100.0,5678294.0,,\nQQQ,20040205,365100.0,396000.0,363300.0,364800.0,85194100.0,0.9175160250508465,0.885745009451852\nSPY,20040206,224500.0,228900.0,224000.0,227400.0,3071970.0,,\nQQQ,20040206,366000.0,379800.0,365300.0,372500.0,103881600.0,0.9170279330211417,0.8852409659515598\nSPY,20040209,225600.0,228600.0,225000.0,226700.0,3466677.0,,\nQQQ,20040209,373400.0,374800.0,362700.0,371000.0,56269700.0,0.9163857860521635,0.8843354841874496\nSPY,20040210,226300.0,231200.0,224400.0,229900.0,3962210.0,,\nQQQ,20040210,370600.0,374100.0,370300.0,372300.0,62856800.0,0.9159307720773305,0.8839585465857633\nSPY,20040211,231200.0,238700.0,230500.0,238400.0,6090711.0,,\nQQQ,20040211,372400.0,376700.0,370000.0,375800.0,90129700.0,0.9157294549697558,0.8840592398390587\nSPY,20040212,236100.0,240000.0,236000.0,237300.0,3190280.0,,\nQQQ,20040212,375200.0,377000.0,372600.0,373300.0,64090300.0,0.915508457689185,0.884141726728799\nSPY,20040213,238500.0,241000.0,228300.0,229900.0,5269352.0,,\nQQQ,20040213,373900.0,379700.0,367600.0,369700.0,87747000.0,0.915222600772708,0.8838220682516981\nSPY,20040217,231000.0,234900.0,231000.0,231700.0,2815475.0,,\nQQQ,20040217,372800.0,376200.0,363700.0,374600.0,67387900.0,0.9148562956156789,0.8838561878352145\nSPY,20040218,231600.0,234400.0,230500.0,232600.0,2375772.0,,\nQQQ,20040218,375100.0,376700.0,373200.0,374900.0,66260400.0,0.9146996201212143,0.8841002740865233\nSPY,20040219,233100.0,236400.0,224200.0,224400.0,5598155.0,,\nQQQ,20040219,378600.0,379000.0,369200.0,369600.0,94731500.0,0.9140459358527407,0.883099183009726\nSPY,20040220,224900.0,225100.0,222100.0,223500.0,4655473.0,,\nQQQ,20040220,370100.0,371400.0,338700.0,369100.0,132579000.0,0.9132797349974582,0.8819284535009013\nSPY,20040223,223800.0,225000.0,218900.0,221500.0,3295084.0,,\nQQQ,20040223,370000.0,372700.0,359000.0,363900.0,121943700.0,0.9126069524726088,0.8804431046621486\nSPY,20040224,221300.0,227400.0,220000.0,223200.0,4393323.0,,\nQQQ,20040224,363000.0,366700.0,360000.0,363800.0,134313900.0,0.9119204557452197,0.8790888196548858\nSPY,20040225,222200.0,237000.0,222100.0,228300.0,4509087.0,,\nQQQ,20040225,364300.0,366700.0,363300.0,365800.0,70050200.0,0.9115167891562266,0.8782827481907076\nSPY,20040226,228400.0,231800.0,228000.0,230400.0,3321636.0,,\nQQQ,20040226,364700.0,368400.0,363100.0,367000.0,68667000.0,0.9109348275080612,0.8775394048995806\nSPY,20040227,229600.0,240200.0,227000.0,239400.0,7826497.0,,\nQQQ,20040227,367700.0,369400.0,362700.0,365400.0,95661900.0,0.910489833586129,0.877072603391638\nSPY,20040301,240900.0,245000.0,238700.0,240500.0,5127484.0,,\nQQQ,20040301,366800.0,370700.0,307000.0,369800.0,77086800.0,0.9101768930489026,0.8768236425874018\nSPY,20040302,239900.0,241000.0,237700.0,238300.0,4041261.0,,\nQQQ,20040302,369800.0,371800.0,366200.0,366700.0,92975700.0,0.9096231028546432,0.8762979753471323\nSPY,20040303,236000.0,241900.0,236000.0,238900.0,3825242.0,,\nQQQ,20040303,365100.0,366300.0,362100.0,364900.0,82912400.0,0.9089221701859982,0.8756101228170512\nSPY,20040304,239600.0,252200.0,239000.0,251600.0,10685333.0,,\nQQQ,20040304,364400.0,368300.0,363900.0,368100.0,61527400.0,0.9080103471560044,0.8750379627892096\nSPY,20040305,249600.0,279000.0,249000.0,268200.0,27326885.0,,\nQQQ,20040305,364200.0,399300.0,361500.0,366800.0,114239900.0,0.9056363065068838,0.8743866440202325\nSPY,20040308,267900.0,294600.0,258000.0,260000.0,9035563.0,,\nQQQ,20040308,366900.0,369700.0,358000.0,358400.0,106604300.0,0.9031613792815546,0.8727054818759254\nSPY,20040309,259000.0,272300.0,257500.0,270500.0,10845951.0,,\nQQQ,20040309,358100.0,367400.0,355200.0,357900.0,125237900.0,0.8992803822632933,0.8707136109580446\nSPY,20040310,270300.0,281400.0,269400.0,276600.0,17636890.0,,\nQQQ,20040310,357500.0,369600.0,352300.0,352900.0,125469200.0,0.8935405750854972,0.8677791150676794\nSPY,20040311,272900.0,280400.0,270900.0,271400.0,10050797.0,,\nQQQ,20040311,350700.0,355300.0,348600.0,348900.0,146342700.0,0.8879955174909573,0.8637267583792932\nSPY,20040312,273300.0,277800.0,271700.0,275700.0,5756140.0,,\nQQQ,20040312,351800.0,363600.0,344500.0,355600.0,116411400.0,0.8831961157690348,0.8611332950915838\nSPY,20040315,270000.0,273500.0,262600.0,264800.0,8458037.0,,\nQQQ,20040315,353600.0,359800.0,348100.0,348300.0,114826500.0,0.878891774122143,0.8571146830462357\nSPY,20040316,265800.0,266100.0,253900.0,258500.0,10630647.0,,\nQQQ,20040316,351100.0,352500.0,346300.0,350000.0,115980400.0,0.8758828964821563,0.8530855726674982\nSPY,20040317,260900.0,263800.0,257800.0,261900.0,6790242.0,,\nQQQ,20040317,352000.0,356200.0,343400.0,355000.0,92743400.0,0.8731628026044591,0.8501992808663142\nSPY,20040318,259200.0,260600.0,255900.0,256800.0,5431215.0,,\nQQQ,20040318,353700.0,354600.0,349700.0,352900.0,107889400.0,0.8706266639387311,0.8469091207689508\nSPY,20040319,257000.0,269400.0,255400.0,258700.0,6539695.0,,\nQQQ,20040319,352800.0,359700.0,348200.0,348300.0,100061600.0,0.8672967933242582,0.8425340966383137\nSPY,20040322,253000.0,261700.0,252500.0,258600.0,7461153.0,,\nQQQ,20040322,345300.0,371300.0,340300.0,343500.0,129988200.0,0.8633884359761784,0.8372208121335016\nSPY,20040323,259200.0,260000.0,252300.0,253000.0,6653217.0,,\nQQQ,20040323,345900.0,353600.0,340100.0,341200.0,121264600.0,0.8592641922618132,0.8313912659091968\nSPY,20040324,253000.0,257500.0,252700.0,254900.0,6595136.0,,\nQQQ,20040324,341500.0,353500.0,335000.0,344100.0,116587400.0,0.8554503118300943,0.8260257107989427\nSPY,20040325,261000.0,269100.0,252600.0,268000.0,8608936.0,,\nQQQ,20040325,346400.0,354600.0,342100.0,354100.0,135180300.0,0.8514760994939807,0.8226919601518464\nSPY,20040326,270500.0,299000.0,269100.0,270500.0,7028796.0,,\nQQQ,20040326,353000.0,355800.0,352200.0,352700.0,76148500.0,0.8468510084709484,0.8188943755184046\nSPY,20040329,274000.0,279900.0,272000.0,279100.0,5686812.0,,\nQQQ,20040329,355100.0,359600.0,347900.0,358500.0,98635000.0,0.8419674783060822,0.8163777750287308\nSPY,20040330,277200.0,279500.0,273400.0,279100.0,6079218.0,,\nQQQ,20040330,356700.0,359400.0,338400.0,358900.0,90110600.0,0.836713864988181,0.814015650016075\nSPY,20040331,279000.0,279800.0,269500.0,270500.0,6129424.0,,\nQQQ,20040331,359200.0,360000.0,356100.0,356900.0,84007400.0,0.8321277491560282,0.81107488559269\nSPY,20040401,269000.0,272700.0,266200.0,269800.0,5248146.0,,\nQQQ,20040401,358100.0,362500.0,351100.0,360800.0,89126800.0,0.8287262395429474,0.8087069835329045\nSPY,20040402,277400.0,279300.0,272300.0,275000.0,4657475.0,,\nQQQ,20040402,368900.0,390200.0,357200.0,369800.0,140202400.0,0.8260149782890107,0.8074135897639186\nSPY,20040405,274800.0,283700.0,274400.0,283400.0,6560265.0,,\nQQQ,20040405,370100.0,374800.0,369700.0,374600.0,64820400.0,0.8231465117969251,0.8068190850854642\nSPY,20040406,276900.0,281500.0,274300.0,278300.0,4339799.0,,\nQQQ,20040406,371600.0,372500.0,369200.0,370600.0,91542000.0,0.8201062854017805,0.8055991007438357\nSPY,20040407,276200.0,277000.0,269200.0,273000.0,4479797.0,,\nQQQ,20040407,369900.0,371100.0,366000.0,368700.0,84326300.0,0.8170065227787102,0.8039942041701459\nSPY,20040408,279000.0,280000.0,272000.0,275300.0,3518374.0,,\nQQQ,20040408,373500.0,373900.0,367400.0,369900.0,74677100.0,0.8134603485086415,0.8025971756864728\nSPY,20040412,275000.0,281000.0,274900.0,280300.0,4013677.0,,\nQQQ,20040412,370300.0,372900.0,369800.0,371600.0,54066000.0,0.8099188666437985,0.8016272803902055\nSPY,20040413,280300.0,280300.0,268400.0,269400.0,7595371.0,,\nQQQ,20040413,373400.0,373600.0,360000.0,366200.0,93369400.0,0.8053349085302249,0.7996637156334359\nSPY,20040414,267800.0,280000.0,263100.0,266400.0,8510747.0,,\nQQQ,20040414,364100.0,369500.0,363600.0,366800.0,107922800.0,0.8012918165580261,0.7976669306878512\nSPY,20040415,288200.0,295800.0,281600.0,292900.0,30117258.0,,\nQQQ,20040415,367500.0,368600.0,360200.0,363100.0,117232200.0,0.7939222550021683,0.7949574592219459\nSPY,20040416,290700.0,293100.0,285000.0,291800.0,6746407.0,,\nQQQ,20040416,362100.0,369900.0,357900.0,360300.0,108160600.0,0.78580984971006,0.7921911462993859\nSPY,20040419,281300.0,287500.0,278300.0,283500.0,11803350.0,,\nQQQ,20040419,360100.0,382800.0,359800.0,365600.0,81496500.0,0.7804384164087262,0.7901495938646693\nSPY,20040420,282600.0,284100.0,275600.0,276700.0,6050964.0,,\nQQQ,20040420,366100.0,367900.0,355400.0,357500.0,111965600.0,0.7739603410168884,0.7866427729423728\nSPY,20040421,276000.0,288300.0,265000.0,277500.0,5208543.0,,\nQQQ,20040421,359200.0,369200.0,347400.0,360800.0,112645000.0,0.7685279820716974,0.7838342386595558\nSPY,20040422,276200.0,281800.0,271100.0,278200.0,5927920.0,,\nQQQ,20040422,360000.0,371800.0,359800.0,369200.0,131772800.0,0.7646641350811424,0.7819666583870667\nSPY,20040423,277400.0,280000.0,270500.0,277000.0,5487744.0,,\nQQQ,20040423,370800.0,372300.0,360000.0,372100.0,92034400.0,0.760994211258262,0.78066523876735\nSPY,20040426,275800.0,276400.0,270000.0,271400.0,3872747.0,,\nQQQ,20040426,371900.0,377600.0,366500.0,367800.0,72734100.0,0.7557964195132705,0.7785214730533024\nSPY,20040427,273400.0,273400.0,266900.0,269100.0,4942694.0,,\nQQQ,20040427,369400.0,371900.0,366900.0,368100.0,85016300.0,0.7514216611292229,0.7762067334527432\nSPY,20040428,268300.0,270100.0,263400.0,265000.0,3785082.0,,\nQQQ,20040428,367100.0,367200.0,343300.0,360800.0,108687300.0,0.7463982272431777,0.7732162641986083\nSPY,20040429,263200.0,270000.0,259800.0,268300.0,7686184.0,,\nQQQ,20040429,360800.0,369900.0,350700.0,356400.0,161410800.0,0.739818828730103,0.7695254874751948\nSPY,20040430,267200.0,269600.0,254900.0,257700.0,7877484.0,,\nQQQ,20040430,356600.0,358000.0,348200.0,348600.0,139728500.0,0.7329542872800299,0.7639537172606585\nSPY,20040503,260000.0,263300.0,257400.0,261000.0,4383986.0,,\nQQQ,20040503,350000.0,355200.0,348900.0,351800.0,115006300.0,0.7269232034350406,0.7589115082571954\nSPY,20040504,259700.0,265500.0,255000.0,261600.0,4959511.0,,\nQQQ,20040504,352100.0,357500.0,350300.0,354100.0,123153200.0,0.7216398437464328,0.7545975764922467\nSPY,20040505,262000.0,267500.0,259600.0,266400.0,3632256.0,,\nQQQ,20040505,354200.0,366300.0,352000.0,355300.0,93779100.0,0.7175748804421018,0.7504997967818564\nSPY,20040506,264100.0,267500.0,259000.0,265800.0,4477566.0,,\nQQQ,20040506,352400.0,355200.0,340400.0,352300.0,99725700.0,0.7131065658197198,0.7455866100880025\nSPY,20040507,265500.0,275700.0,265500.0,267000.0,7254363.0,,\nQQQ,20040507,350900.0,356400.0,349600.0,349800.0,132379100.0,0.7085032642799781,0.739879013843646\nSPY,20040510,262600.0,266000.0,259400.0,261200.0,4216318.0,,\nQQQ,20040510,346700.0,355800.0,344200.0,347500.0,156762300.0,0.7042869169942325,0.7339575112347747\nSPY,20040511,263500.0,271900.0,255800.0,270800.0,5141612.0,,\nQQQ,20040511,349700.0,353800.0,349200.0,353000.0,111580200.0,0.7005027069937418,0.7290965291269919\nSPY,20040512,267900.0,273400.0,262000.0,272900.0,4286336.0,,\nQQQ,20040512,351200.0,384000.0,342700.0,352200.0,195129600.0,0.6962831775088367,0.7234963992474247\nSPY,20040513,271000.0,277200.0,269000.0,271900.0,3686449.0,,\nQQQ,20040513,350600.0,354500.0,341900.0,352200.0,132681600.0,0.6921859051069413,0.7178104364728255\nSPY,20040514,272400.0,273200.0,260000.0,270000.0,4612001.0,,\nQQQ,20040514,352100.0,353100.0,346400.0,348000.0,130002900.0,0.6875350612607842,0.7112543347997318\nSPY,20040517,267000.0,287600.0,263600.0,266400.0,5309216.0,,\nQQQ,20040517,343800.0,354400.0,341100.0,343200.0,147278400.0,0.6827449692775451,0.7038929314958476\nSPY,20040518,269600.0,272900.0,268000.0,270600.0,3404530.0,,\nQQQ,20040518,346600.0,349000.0,343500.0,347600.0,88454700.0,0.6770677121267171,0.6968788870970568\nSPY,20040519,274000.0,275000.0,264200.0,264800.0,6385714.0,,\nQQQ,20040519,351600.0,357500.0,347100.0,347500.0,136180600.0,0.6711472988982294,0.6903175406930253\nSPY,20040520,267000.0,270000.0,255800.0,267000.0,3385347.0,,\nQQQ,20040520,347800.0,350200.0,345600.0,347700.0,92710700.0,0.6649886826269981,0.6835591425070725\nSPY,20040521,269600.0,272000.0,267300.0,271100.0,2762683.0,,\nQQQ,20040521,350100.0,351700.0,347300.0,350100.0,111755300.0,0.6595161837579846,0.6768283000728211\nSPY,20040524,271600.0,279000.0,271300.0,273700.0,4041489.0,,\nQQQ,20040524,352900.0,354600.0,350000.0,351600.0,95480400.0,0.6542104055762207,0.6703559781255194\nSPY,20040525,274700.0,285100.0,272900.0,284100.0,5505282.0,,\nQQQ,20040525,351400.0,360800.0,349500.0,360200.0,141954900.0,0.6508306389494684,0.6666785398542089\nSPY,20040526,283100.0,287800.0,280000.0,285100.0,5629807.0,,\nQQQ,20040526,358800.0,361900.0,349900.0,361500.0,91168200.0,0.6466126710023692,0.6629883535301635\nSPY,20040527,284400.0,286000.0,278200.0,281500.0,3759315.0,,\nQQQ,20040527,362900.0,365000.0,360000.0,363600.0,107739200.0,0.6428234839214018,0.6593484095316028\nSPY,20040528,280800.0,282700.0,278000.0,280800.0,2241421.0,,\nQQQ,20040528,363900.0,365400.0,353400.0,365400.0,55778500.0,0.6392750699734523,0.6564521000278855\nSPY,20040601,277900.0,282000.0,276100.0,280400.0,3121734.0,,\nQQQ,20040601,362700.0,365400.0,351700.0,365200.0,90503200.0,0.6347513528735435,0.6534314383494458\nSPY,20040602,280300.0,291700.0,278000.0,289300.0,5496755.0,,\nQQQ,20040602,365700.0,366600.0,361700.0,364000.0,95596600.0,0.6294430008763021,0.6499269705184908\nSPY,20040603,287100.0,289900.0,282900.0,284900.0,4376265.0,,\nQQQ,20040603,363000.0,363600.0,359400.0,359700.0,90273600.0,0.6240880136815641,0.6459087202283503\nSPY,20040604,285600.0,292500.0,285100.0,288200.0,6304500.0,,\nQQQ,20040604,363300.0,366200.0,361800.0,362300.0,87623900.0,0.6193859831970404,0.6419598249029401\nSPY,20040607,290000.0,299800.0,288100.0,298000.0,5058541.0,,\nQQQ,20040607,364400.0,370900.0,356500.0,370700.0,101724100.0,0.615252414090347,0.6399160128616553\nSPY,20040608,300000.0,304400.0,298300.0,303000.0,7139801.0,,\nQQQ,20040608,369100.0,372000.0,368500.0,371600.0,68719300.0,0.610114924174853,0.6382062426539882\nSPY,20040609,300300.0,307100.0,300000.0,302500.0,5867721.0,,\nQQQ,20040609,369800.0,371900.0,363700.0,365300.0,94907000.0,0.6038441134624554,0.6350049792460117\nSPY,20040610,303200.0,309700.0,302300.0,307000.0,4457582.0,,\nQQQ,20040610,366900.0,377300.0,365300.0,368000.0,54661300.0,0.598833818306536,0.63223752489906\nSPY,20040614,306300.0,306800.0,295000.0,300600.0,4232396.0,,\nQQQ,20040614,365900.0,368300.0,352000.0,362500.0,77881000.0,0.592723514129777,0.6280666588706776\nSPY,20040615,305600.0,311400.0,302600.0,306800.0,7752733.0,,\nQQQ,20040615,365600.0,369900.0,365600.0,368400.0,86341300.0,0.5869465640082063,0.6252103430306724\nSPY,20040616,306200.0,333200.0,305300.0,327300.0,16724386.0,,\nQQQ,20040616,367700.0,372500.0,358200.0,368000.0,60572400.0,0.5811513836797139,0.6223697747970312\nSPY,20040617,325900.0,331300.0,322000.0,328100.0,8955362.0,,\nQQQ,20040617,366600.0,366600.0,362500.0,364000.0,75210100.0,0.5733754050706008,0.6185172083041918\nSPY,20040618,325800.0,334100.0,323900.0,329200.0,5960942.0,,\nQQQ,20040618,363000.0,368400.0,362600.0,364200.0,77752200.0,0.5671299965398605,0.6146762899632388\nSPY,20040621,330500.0,335000.0,321200.0,322900.0,6527457.0,,\nQQQ,20040621,365000.0,380000.0,360600.0,361500.0,64205700.0,0.5602802671552024,0.6100826000110373\nSPY,20040622,323200.0,330900.0,322900.0,330000.0,6056122.0,,\nQQQ,20040622,361600.0,366800.0,360200.0,366700.0,99245300.0,0.5553413142556114,0.6067587277466939\nSPY,20040623,330000.0,338300.0,328900.0,336500.0,6880535.0,,\nQQQ,20040623,365800.0,371900.0,365100.0,371000.0,89991600.0,0.5515818233063866,0.6045732966510606\nSPY,20040624,335500.0,337000.0,329800.0,331600.0,4234378.0,,\nQQQ,20040624,370200.0,379800.0,359800.0,370200.0,88429700.0,0.5474080684113731,0.6020739242124903\nSPY,20040625,331700.0,336300.0,330500.0,334600.0,4555939.0,,\nQQQ,20040625,370000.0,373900.0,369800.0,372400.0,75034100.0,0.5448435868343782,0.6003500095661601\nSPY,20040628,340800.0,341900.0,322100.0,324800.0,9152284.0,,\nQQQ,20040628,374900.0,375200.0,364800.0,371100.0,90888800.0,0.5427104175300075,0.598058056587691\nSPY,20040629,320600.0,329900.0,314100.0,324900.0,10484466.0,,\nQQQ,20040629,371100.0,379900.0,370000.0,374400.0,64979700.0,0.5406879348159046,0.5964274285259155\nSPY,20040630,325100.0,329700.0,318900.0,324900.0,6083908.0,,\nQQQ,20040630,374400.0,379000.0,373000.0,377400.0,95439900.0,0.540405847883482,0.5950938670567913\nSPY,20040701,322500.0,325300.0,319000.0,322900.0,5919613.0,,\nQQQ,20040701,376500.0,377000.0,367700.0,370400.0,120050000.0,0.5376448031968617,0.5924148972501643\nSPY,20040702,304500.0,311800.0,297300.0,310800.0,14873487.0,,\nQQQ,20040702,370400.0,371900.0,366300.0,367800.0,72132100.0,0.5348896850783799,0.5891310668919455\nSPY,20040706,312600.0,314200.0,308000.0,309500.0,5759511.0,,\nQQQ,20040706,365900.0,368200.0,358300.0,360100.0,127570400.0,0.5288997907376989,0.5841458199757762\nSPY,20040707,308000.0,313600.0,301300.0,302500.0,6702361.0,,\nQQQ,20040707,359500.0,382500.0,359200.0,360900.0,94757900.0,0.5253688331817603,0.5800074613747699\nSPY,20040708,301200.0,306800.0,299500.0,300500.0,3863624.0,,\nQQQ,20040708,358200.0,361300.0,355500.0,355700.0,101630700.0,0.5210599851050988,0.5742152576112903\nSPY,20040709,302700.0,305000.0,300400.0,301000.0,3171290.0,,\nQQQ,20040709,358400.0,380200.0,356300.0,357900.0,90265500.0,0.516766634054956,0.5689357868180034\nSPY,20040712,300200.0,300400.0,289300.0,291500.0,8760885.0,,\nQQQ,20040712,355700.0,356900.0,336300.0,356000.0,79116100.0,0.5115756024855075,0.5627758411997462\nSPY,20040713,292500.0,296000.0,290200.0,291800.0,5229437.0,,\nQQQ,20040713,356900.0,358100.0,354300.0,355300.0,73771200.0,0.5066050119060862,0.5562879243685688\nSPY,20040714,288300.0,299700.0,287400.0,295900.0,12087406.0,,\nQQQ,20040714,351900.0,356500.0,350500.0,352100.0,114940900.0,0.5006342413815188,0.5479957766411632\nSPY,20040715,326600.0,339700.0,321100.0,328500.0,30434278.0,,\nQQQ,20040715,353300.0,354900.0,322000.0,351900.0,85396400.0,0.49057591773685355,0.538150984186101\nSPY,20040716,328500.0,329200.0,321200.0,321900.0,7673586.0,,\nQQQ,20040716,354300.0,354500.0,346400.0,346800.0,116114100.0,0.47922823662825237,0.5267721945602917\nSPY,20040719,320500.0,322200.0,316600.0,319400.0,9093009.0,,\nQQQ,20040719,347900.0,349700.0,344700.0,347300.0,102237900.0,0.4697688870931085,0.5161335436823848\nSPY,20040720,319500.0,322000.0,315500.0,322000.0,4841807.0,,\nQQQ,20040720,347500.0,352900.0,347000.0,352700.0,101676200.0,0.46240301000990053,0.5082005813937562\nSPY,20040721,323100.0,327100.0,313400.0,316300.0,5018572.0,,\nQQQ,20040721,355700.0,378100.0,345000.0,345300.0,130292900.0,0.4517966940111712,0.49619610160337335\nSPY,20040722,313400.0,317300.0,310600.0,316400.0,5638793.0,,\nQQQ,20040722,344700.0,355400.0,342500.0,349600.0,123607500.0,0.44344268200392917,0.4860280011827999\nSPY,20040723,317400.0,317500.0,304800.0,306600.0,4788429.0,,\nQQQ,20040723,346300.0,350100.0,335000.0,341600.0,102369000.0,0.43276967275785444,0.47299158083184034\nSPY,20040726,308900.0,314500.0,307800.0,312700.0,6621338.0,,\nQQQ,20040726,342200.0,349500.0,337000.0,340600.0,113081100.0,0.4199368576978707,0.4586499811752269\nSPY,20040727,318000.0,327500.0,315700.0,324300.0,7317109.0,,\nQQQ,20040727,342000.0,347100.0,340400.0,345700.0,99691800.0,0.40989585597428485,0.44771183016051536\nSPY,20040728,323000.0,324100.0,311600.0,322300.0,4921173.0,,\nQQQ,20040728,344000.0,346300.0,338100.0,344000.0,153651300.0,0.398193057456296,0.43489249985502587\nSPY,20040729,325000.0,328200.0,321300.0,326500.0,3843286.0,,\nQQQ,20040729,347000.0,349200.0,345000.0,347700.0,94962100.0,0.3875197347485855,0.42285069490008603\nSPY,20040730,327100.0,330000.0,320000.0,323600.0,4255005.0,,\nQQQ,20040730,347600.0,351000.0,340100.0,348500.0,79091500.0,0.3762963696497059,0.4108791103999906\nSPY,20040802,312100.0,322000.0,311300.0,315800.0,6331488.0,,\nQQQ,20040802,346100.0,350200.0,344600.0,349300.0,79747400.0,0.36796040615875963,0.4002798206569843\nSPY,20040803,315000.0,317200.0,311500.0,313200.0,3650806.0,,\nQQQ,20040803,348400.0,354100.0,324100.0,342800.0,81095500.0,0.3557925349051221,0.3859873332768546\nSPY,20040804,311900.0,321200.0,311700.0,317700.0,4685954.0,,\nQQQ,20040804,341500.0,348000.0,321900.0,342600.0,86488100.0,0.34402699094209727,0.37277911383527707\nSPY,20040805,317200.0,323000.0,312500.0,313800.0,4172493.0,,\nQQQ,20040805,343600.0,349200.0,329100.0,336500.0,104229100.0,0.32714900383636275,0.3563764451345817\nSPY,20040806,309200.0,311000.0,297000.0,297200.0,8367654.0,,\nQQQ,20040806,334100.0,351800.0,320000.0,327300.0,138880600.0,0.3064406238281393,0.3391237151452618\nSPY,20040809,298500.0,304500.0,298100.0,302700.0,4666653.0,,\nQQQ,20040809,328200.0,329600.0,326500.0,328000.0,75444000.0,0.2848572343550062,0.3212954530274327\nSPY,20040810,304200.0,315400.0,303500.0,315100.0,5405397.0,,\nQQQ,20040810,329600.0,350200.0,329000.0,334200.0,95689300.0,0.26215909215407973,0.3035276204228977\nSPY,20040811,310400.0,311300.0,302600.0,310000.0,5545092.0,,\nQQQ,20040811,328600.0,377200.0,325000.0,329100.0,117079300.0,0.23749606843898466,0.2847103203696396\nSPY,20040812,304500.0,308500.0,302800.0,304200.0,3843882.0,,\nQQQ,20040812,326900.0,328600.0,320000.0,324600.0,107413800.0,0.21203211685078596,0.2653934575748405\nSPY,20040813,306700.0,312800.0,304000.0,308300.0,5295871.0,,\nQQQ,20040813,326400.0,327400.0,323500.0,325200.0,87914900.0,0.18667979702235413,0.24655478219827645\nSPY,20040816,310000.0,317200.0,306400.0,307800.0,7142937.0,,\nQQQ,20040816,326200.0,331900.0,325200.0,329800.0,73989600.0,0.1630672779384796,0.22778101479881468\nSPY,20040817,305900.0,311300.0,303500.0,308800.0,5561880.0,,\nQQQ,20040817,331200.0,334400.0,329900.0,331700.0,86043800.0,0.138867363268369,0.20923966636527208\nSPY,20040818,305200.0,318500.0,304900.0,317800.0,6203405.0,,\nQQQ,20040818,330700.0,339100.0,330100.0,338900.0,102031000.0,0.1200324191261802,0.19184564611936247\nSPY,20040819,315300.0,318600.0,303600.0,306900.0,6664568.0,,\nQQQ,20040819,337300.0,338500.0,334100.0,336300.0,101371700.0,0.1020902640098232,0.17425103091254313\nSPY,20040820,307000.0,309900.0,304900.0,307900.0,5443583.0,,\nQQQ,20040820,335700.0,341400.0,330300.0,340000.0,90290800.0,0.08671192401468093,0.15806545470216987\nSPY,20040823,309000.0,312700.0,306000.0,310700.0,4342021.0,,\nQQQ,20040823,340500.0,342700.0,339100.0,340900.0,81107400.0,0.07348346331670261,0.14341789817338832\nSPY,20040824,312500.0,319400.0,311900.0,319200.0,6271983.0,,\nQQQ,20040824,342400.0,343100.0,338100.0,340400.0,82955200.0,0.056688313423427034,0.12659583104096747\nSPY,20040825,319300.0,331500.0,317300.0,330500.0,8659041.0,,\nQQQ,20040825,340800.0,346000.0,330400.0,345500.0,87032100.0,0.04118482507522183,0.11093628319330107\nSPY,20040826,330500.0,351800.0,327400.0,346600.0,16817887.0,,\nQQQ,20040826,344500.0,354800.0,343100.0,344000.0,54385400.0,0.023700878880595994,0.09423818266500586\nSPY,20040827,345800.0,347600.0,312800.0,343500.0,6878884.0,,\nQQQ,20040827,344700.0,355000.0,344400.0,345600.0,56679700.0,0.009188257107814813,0.07971081330794866\nSPY,20040830,340100.0,355400.0,339600.0,341100.0,3623523.0,,\nQQQ,20040830,344000.0,344300.0,340200.0,340400.0,58228100.0,-0.006237070932519409,0.06374646592107402\nSPY,20040831,340700.0,349500.0,340000.0,343900.0,6217497.0,,\nQQQ,20040831,340200.0,341200.0,336500.0,339900.0,76201100.0,-0.020943843822568014,0.04946335213885709\nSPY,20040901,343400.0,359900.0,341900.0,358400.0,9006654.0,,\nQQQ,20040901,339200.0,349600.0,330400.0,342600.0,94958500.0,-0.033605540418530845,0.038024750424500334\nSPY,20040902,354700.0,358100.0,345400.0,357300.0,6987513.0,,\nQQQ,20040902,341800.0,348800.0,341600.0,347500.0,74637100.0,-0.042483916834446224,0.029627914607675686\nSPY,20040903,350300.0,359200.0,350100.0,352300.0,5085149.0,,\nQQQ,20040903,344400.0,346800.0,340500.0,341300.0,83317100.0,-0.054469089672343346,0.017655918527105435\nSPY,20040907,354000.0,361900.0,352300.0,358200.0,5402194.0,,\nQQQ,20040907,343900.0,354100.0,341200.0,343700.0,93256200.0,-0.06629543303511559,0.004383655225927623\nSPY,20040908,357500.0,365700.0,356800.0,363200.0,6061471.0,,\nQQQ,20040908,343100.0,346800.0,341800.0,342300.0,98371200.0,-0.07746095925678002,-0.00671918004329949\nSPY,20040909,360800.0,363000.0,352800.0,357000.0,8037677.0,,\nQQQ,20040909,344500.0,347500.0,341300.0,345700.0,101869700.0,-0.08717653258980419,-0.018930734722620073\nSPY,20040910,357400.0,362300.0,354600.0,358600.0,5329419.0,,\nQQQ,20040910,346100.0,351900.0,340200.0,351200.0,102507300.0,-0.09626733150146398,-0.02964512870213131\nSPY,20040913,358800.0,360700.0,350500.0,355300.0,4574584.0,,\nQQQ,20040913,352400.0,357200.0,342800.0,354400.0,105704500.0,-0.1015894599235235,-0.03579871506905312\nSPY,20040914,353000.0,355500.0,347800.0,354900.0,4310100.0,,\nQQQ,20040914,354600.0,357300.0,344900.0,356500.0,74984800.0,-0.10446307968609743,-0.0371732597465232\nSPY,20040915,353800.0,354800.0,348000.0,351500.0,3847849.0,,\nQQQ,20040915,354300.0,356700.0,343000.0,352000.0,88658500.0,-0.11218571751420055,-0.047480095163592154\nSPY,20040916,352000.0,367600.0,351200.0,362900.0,7968046.0,,\nQQQ,20040916,352800.0,363200.0,351300.0,352400.0,65246200.0,-0.11705064401086969,-0.054914839005885605\nSPY,20040917,365500.0,373800.0,364000.0,371500.0,7688061.0,,\nQQQ,20040917,352400.0,355200.0,351600.0,354500.0,79814800.0,-0.12109041876645774,-0.061253639771065835\nSPY,20040920,369000.0,379800.0,368700.0,377200.0,4273236.0,,\nQQQ,20040920,352900.0,357700.0,351000.0,354400.0,107819300.0,-0.12276657645647229,-0.06301891087035587\nSPY,20040921,377500.0,388700.0,374600.0,384100.0,6574255.0,,\nQQQ,20040921,355400.0,358500.0,354200.0,356700.0,85690400.0,-0.1232696612463553,-0.06478413537415531\nSPY,20040922,381000.0,381400.0,368100.0,369200.0,6971966.0,,\nQQQ,20040922,354300.0,354600.0,348700.0,349500.0,96856600.0,-0.13168815494421998,-0.07703504095206135\nSPY,20040923,370400.0,375000.0,369300.0,372700.0,6905477.0,,\nQQQ,20040923,349800.0,351500.0,348800.0,349900.0,89448200.0,-0.13790254463526552,-0.0863808931636919\nSPY,20040924,373600.0,380000.0,371500.0,373400.0,6406864.0,,\nQQQ,20040924,349900.0,351900.0,346800.0,348000.0,101830200.0,-0.1509070013764658,-0.1012433522482661\nSPY,20040927,369700.0,379800.0,368300.0,375300.0,6908050.0,,\nQQQ,20040927,346200.0,347900.0,343800.0,344400.0,82962100.0,-0.16996347165860343,-0.11958859638515704\nSPY,20040928,374700.0,382900.0,374500.0,379600.0,6064334.0,,\nQQQ,20040928,345500.0,346900.0,342300.0,345900.0,84949800.0,-0.18978667254625442,-0.13785212169683078\nSPY,20040929,379300.0,388600.0,378200.0,386500.0,4656664.0,,\nQQQ,20040929,345400.0,351200.0,345300.0,350900.0,91650200.0,-0.20236200804326207,-0.15132948604353808\nSPY,20040930,390000.0,399800.0,384500.0,387200.0,6458670.0,,\nQQQ,20040930,350200.0,352700.0,340500.0,351300.0,71179500.0,-0.22009947003989533,-0.16701605212102053\nSPY,20041001,391500.0,391900.0,385800.0,386700.0,7253439.0,,\nQQQ,20041001,354400.0,361500.0,351300.0,361000.0,114761600.0,-0.22664616578895233,-0.17392439777804652\nSPY,20041004,389100.0,391700.0,387600.0,387600.0,9867199.0,,\nQQQ,20041004,363600.0,385000.0,361300.0,362900.0,103923700.0,-0.23197205652232525,-0.1807551299994685\nSPY,20041005,385600.0,396700.0,384000.0,396300.0,6547605.0,,\nQQQ,20041005,362300.0,364900.0,361600.0,363300.0,87060500.0,-0.2299599212931535,-0.18444083083032686\nSPY,20041006,394700.0,407600.0,394700.0,406300.0,7317414.0,,\nQQQ,20041006,363200.0,369500.0,361100.0,366300.0,84776300.0,-0.22335698744154026,-0.1844516696302338\nSPY,20041007,405400.0,409300.0,394600.0,395900.0,7409878.0,,\nQQQ,20041007,365400.0,366700.0,361700.0,362100.0,80315000.0,-0.22002438163026625,-0.18203130332462522\nSPY,20041008,395700.0,397700.0,388400.0,390500.0,6291721.0,,\nQQQ,20041008,360800.0,366500.0,355000.0,356200.0,110280800.0,-0.22240097990613558,-0.18352054590015107\nSPY,20041011,388000.0,389500.0,382000.0,386300.0,5766445.0,,\nQQQ,20041011,357200.0,360600.0,356000.0,357500.0,50871400.0,-0.22306926946060415,-0.18327536702616995\nSPY,20041012,385000.0,385800.0,376500.0,383600.0,8130555.0,,\nQQQ,20041012,354400.0,358000.0,342300.0,357100.0,93088500.0,-0.22319500477458254,-0.18245608050336187\nSPY,20041013,388600.0,397600.0,387400.0,396100.0,13637567.0,,\nQQQ,20041013,360500.0,361400.0,348400.0,356600.0,126325100.0,-0.22245062711539856,-0.18031627634010866\nSPY,20041014,430300.0,457500.0,425500.0,449700.0,46207682.0,,\nQQQ,20041014,356800.0,357800.0,353300.0,354300.0,95862100.0,-0.22150400161195724,-0.18007368771322504\nSPY,20041015,449200.0,456100.0,440000.0,455700.0,17642187.0,,\nQQQ,20041015,355000.0,358600.0,344400.0,355800.0,130561600.0,-0.2190813673019968,-0.17886268636194794\nSPY,20041018,448000.0,477400.0,440000.0,476700.0,20606493.0,,\nQQQ,20041018,355100.0,362000.0,354000.0,361900.0,101332900.0,-0.2089275894206605,-0.17485181288265417\nSPY,20041019,481000.0,483500.0,473100.0,474000.0,13897561.0,,\nQQQ,20041019,363800.0,365700.0,358900.0,359100.0,122829800.0,-0.2054968421810119,-0.17563019602793373\nSPY,20041020,471800.0,476000.0,466500.0,474700.0,9918333.0,,\nQQQ,20041020,358300.0,362300.0,356500.0,360900.0,103808000.0,-0.19913749153620994,-0.17303896003707292\nSPY,20041021,476700.0,481300.0,473100.0,479500.0,11733833.0,,\nQQQ,20041021,362400.0,367900.0,351900.0,366400.0,112647100.0,-0.1857823264535848,-0.16701020878820924\nSPY,20041022,472000.0,476700.0,470200.0,474500.0,8318392.0,,\nQQQ,20041022,366000.0,366500.0,357400.0,357900.0,109420000.0,-0.18523386826345245,-0.16920397516839009\nSPY,20041025,472100.0,478400.0,470600.0,475100.0,6881400.0,,\nQQQ,20041025,357300.0,366500.0,354900.0,356100.0,99945900.0,-0.18749233707446056,-0.17324590388957808\nSPY,20041026,474500.0,480500.0,469700.0,479600.0,9863422.0,,\nQQQ,20041026,356600.0,358000.0,345000.0,357900.0,94993400.0,-0.18922491860748145,-0.17854026130540737\nSPY,20041027,486600.0,506200.0,481700.0,503200.0,19885445.0,,\nQQQ,20041027,358400.0,370000.0,357100.0,367700.0,154784400.0,-0.17870452758777716,-0.17796059669719266\nSPY,20041028,498900.0,522200.0,495000.0,521700.0,15134568.0,,\nQQQ,20041028,366700.0,371200.0,356700.0,369200.0,106664600.0,-0.16151979895554966,-0.1706802301794913\nSPY,20041029,519600.0,532000.0,518000.0,523900.0,14058321.0,,\nQQQ,20041029,369100.0,372400.0,366700.0,369000.0,97922700.0,-0.14546998666204777,-0.1636522374402991\nSPY,20041101,525000.0,532600.0,520400.0,523300.0,10189672.0,,\nQQQ,20041101,369700.0,371800.0,270500.0,370200.0,68724600.0,-0.12953650567786448,-0.15625152322513827\nSPY,20041102,523500.0,540800.0,523500.0,535000.0,12610053.0,,\nQQQ,20041102,370900.0,375500.0,370000.0,371500.0,105136100.0,-0.11239945022243042,-0.14915071405719482\nSPY,20041103,544200.0,561100.0,539900.0,553200.0,19732532.0,,\nQQQ,20041103,377600.0,379000.0,371500.0,373400.0,132787200.0,-0.09055928563735124,-0.13763205533629477\nSPY,20041104,550900.0,555500.0,543700.0,544500.0,15831845.0,,\nQQQ,20041104,372600.0,377800.0,371100.0,376400.0,109005800.0,-0.06824823986246727,-0.1274432517793198\nSPY,20041105,550000.0,550000.0,520400.0,547000.0,21155354.0,,\nQQQ,20041105,380200.0,381600.0,353100.0,379200.0,109332800.0,-0.04384561600161335,-0.11622865726801994\nSPY,20041108,543900.0,554500.0,538600.0,543100.0,9144536.0,,\nQQQ,20041108,379400.0,381000.0,378500.0,379800.0,65062400.0,-0.0202141800930846,-0.10383338845851679\nSPY,20041109,543000.0,545500.0,533800.0,540700.0,7972395.0,,\nQQQ,20041109,379400.0,381500.0,378100.0,380000.0,80383200.0,0.001854965546336386,-0.09325884699524153\nSPY,20041110,540000.0,553900.0,539100.0,547500.0,8747549.0,,\nQQQ,20041110,379400.0,380600.0,373400.0,377400.0,92698600.0,0.018961548339946042,-0.08691310976887547\nSPY,20041111,549500.0,554300.0,542300.0,553700.0,6920589.0,,\nQQQ,20041111,379200.0,383800.0,377200.0,383400.0,94573200.0,0.04066465652014085,-0.0800073788999385\nSPY,20041112,550700.0,556900.0,548400.0,555000.0,6695185.0,,\nQQQ,20041112,383500.0,386800.0,381700.0,386600.0,98482200.0,0.06657995154904962,-0.06799193046529019\nSPY,20041115,550800.0,559700.0,543400.0,551700.0,6467800.0,,\nQQQ,20041115,386500.0,388600.0,385000.0,388000.0,80057500.0,0.09168411531008419,-0.05622645358237981\nSPY,20041116,552300.0,552400.0,544800.0,549200.0,5103307.0,,\nQQQ,20041116,386600.0,388300.0,383200.0,385200.0,94416500.0,0.11049721090580597,-0.04935637283424733\nSPY,20041117,551700.0,554500.0,542200.0,549000.0,6885025.0,,\nQQQ,20041117,388500.0,393200.0,309000.0,390400.0,120965200.0,0.13098099228019214,-0.044089548391251274\nSPY,20041118,543000.0,554500.0,542900.0,554000.0,8038004.0,,\nQQQ,20041118,389800.0,393600.0,388900.0,392900.0,92570200.0,0.15030823824254072,-0.0423914235578208\nSPY,20041119,553600.0,569100.0,545000.0,551000.0,13187176.0,,\nQQQ,20041119,392400.0,392900.0,385900.0,386600.0,113559500.0,0.1645742813032799,-0.03918829338188546\nSPY,20041122,580000.0,640000.0,579000.0,613500.0,44278258.0,,\nQQQ,20041122,386100.0,390400.0,384100.0,390200.0,77406800.0,0.18436188102575407,-0.0375355445995958\nSPY,20041123,623200.0,645600.0,610500.0,612800.0,15201677.0,,\nQQQ,20041123,390100.0,391500.0,338900.0,388900.0,89658300.0,0.2020844821937396,-0.03498443236849351\nSPY,20041124,616800.0,652000.0,615500.0,640000.0,24549426.0,,\nQQQ,20041124,391000.0,393900.0,390700.0,393600.0,71208900.0,0.22733675011288426,-0.02705043561946045\nSPY,20041126,654200.0,657600.0,643400.0,646900.0,9340944.0,,\nQQQ,20041126,393600.0,394800.0,391700.0,392400.0,31350600.0,0.2498212768500611,-0.019994383359043928\nSPY,20041129,690000.0,695700.0,674100.0,684400.0,28794688.0,,\nQQQ,20041129,394600.0,396400.0,389700.0,393000.0,91385800.0,0.27364180786643805,-0.011912117924643565\nSPY,20041130,687500.0,687900.0,672100.0,672700.0,16050227.0,,\nQQQ,20041130,392900.0,393900.0,390600.0,391300.0,87409100.0,0.2939011097206389,-0.003701433912162421\nSPY,20110323,3392500.0,3402200.0,3359500.0,3391900.0,12982214.0,,\nQQQ,20110323,552000.0,558600.0,548200.0,557200.0,54175787.0,0.6891424033137038,0.007564093166933212\nSPY,20110324,3418500.0,3460000.0,3388600.0,3450900.0,14036453.0,,\nQQQ,20110324,561300.0,568200.0,558200.0,567300.0,62779061.0,0.8022111901117815,0.017061012533396168\nSPY,20110325,3481300.0,3520600.0,3470200.0,3515400.0,15610680.0,,\nQQQ,20110325,568800.0,572200.0,567600.0,568400.0,66809144.0,0.8548345134559753,0.025141400224476335\nSPY,20110328,3531800.0,3543200.0,3504400.0,3504400.0,10656989.0,,\nQQQ,20110328,570900.0,571000.0,565000.0,565100.0,31936709.0,0.8843830273851506,0.03464581986074338\nSPY,20110329,3475900.0,3509600.0,3460600.0,3509600.0,12019582.0,,\nQQQ,20110329,564000.0,570800.0,562400.0,570800.0,41471856.0,0.9045447369258364,0.041032216944042\nSPY,20110330,3507100.0,3508800.0,3474400.0,3487800.0,11223004.0,,\nQQQ,20110330,573600.0,574300.0,570800.0,573600.0,41170128.0,0.9188243721852135,0.04855281535282517\nSPY,20110331,3463000.0,3498000.0,3460600.0,3484500.0,9409136.0,,\nQQQ,20110331,572700.0,574800.0,571600.0,574300.0,42075889.0,0.9294016581977148,0.052093398201271644\nSPY,20110401,3511100.0,3515700.0,3433100.0,3445600.0,14461249.0,,\nQQQ,20110401,577200.0,579000.0,572900.0,574600.0,49725119.0,0.9374253611664796,0.055729955904098384\nSPY,20110404,3445600.0,3446000.0,3384000.0,3411900.0,16121814.0,,\nQQQ,20110404,576300.0,576800.0,570200.0,572700.0,39049670.0,0.9436208862776047,0.06311668659184289\nSPY,20110405,3365200.0,3422500.0,3360000.0,3388900.0,16272032.0,,\nQQQ,20110405,571600.0,574900.0,570100.0,570900.0,45852649.0,0.9485799894900452,0.0702938217217445\nSPY,20110406,3414500.0,3439000.0,3371400.0,3380400.0,13998531.0,,\nQQQ,20110406,575600.0,577300.0,569300.0,572200.0,43043240.0,0.9527287761539626,0.07483258845182023\nSPY,20110407,3380400.0,3404300.0,3360300.0,3380800.0,13097403.0,,\nQQQ,20110407,572400.0,576000.0,568100.0,572300.0,51317888.0,0.9562242435706717,0.08019463233523542\nSPY,20110408,3400000.0,3401500.0,3339700.0,3350600.0,13198455.0,,\nQQQ,20110408,574700.0,575700.0,566500.0,569300.0,36391150.0,0.9591444732212171,0.08509095054203471\nSPY,20110411,3342000.0,3356700.0,3300200.0,3310000.0,14001442.0,,\nQQQ,20110411,571700.0,572900.0,565600.0,567700.0,37979835.0,0.9616341268998344,0.09348212766179749\nSPY,20110412,3304500.0,3337300.0,3302000.0,3324000.0,14749065.0,,\nQQQ,20110412,565000.0,566400.0,561500.0,563700.0,45706183.0,0.9637650177088959,0.1014353699252986\nSPY,20110413,3350000.0,3361400.0,3325200.0,3360900.0,11904296.0,,\nQQQ,20110413,567900.0,570000.0,564000.0,568500.0,45983815.0,0.9657419093524423,0.10978867174702726\nSPY,20110414,3346500.0,3360000.0,3320600.0,3320700.0,10439480.0,,\nQQQ,20110414,564600.0,568300.0,562300.0,567400.0,43891370.0,0.9675021951033718,0.12024728889574918\nSPY,20110415,3336200.0,3336400.0,3268000.0,3274600.0,15933741.0,,\nQQQ,20110415,565300.0,568700.0,562800.0,566500.0,58674418.0,0.9690340759635665,0.13040407816733904\nSPY,20110418,3261600.0,3322300.0,3201700.0,3318500.0,21242570.0,,\nQQQ,20110418,560800.0,562700.0,553300.0,562300.0,52309096.0,0.9703933412465202,0.14048812879524739\nSPY,20110419,3332500.0,3379800.0,3317100.0,3378600.0,14545668.0,,\nQQQ,20110419,564000.0,566000.0,561000.0,566000.0,30112824.0,0.97174594235664,0.15305913744809965\nSPY,20110420,3437400.0,3457500.0,3415000.0,3424200.0,19095349.0,,\nQQQ,20110420,576000.0,579400.0,575300.0,578800.0,46608364.0,0.9730751526505914,0.16549144412352976\nSPY,20110421,3544300.0,3551300.0,3485200.0,3507200.0,25487906.0,,\nQQQ,20110421,584400.0,584700.0,581600.0,583400.0,33546679.0,0.9743299839287061,0.17752706280623998\nSPY,20110425,3505700.0,3537500.0,3503000.0,3531000.0,9256954.0,,\nQQQ,20110425,583900.0,585200.0,582800.0,584900.0,20071389.0,0.9754823087458709,0.18933843104086642\nSPY,20110426,3536300.0,3549900.0,3493600.0,3504500.0,11497554.0,,\nQQQ,20110426,586400.0,590300.0,585100.0,588300.0,41471881.0,0.9766227033453673,0.20455238670395165\nSPY,20110427,3522800.0,3523500.0,3471000.0,3502400.0,12263435.0,,\nQQQ,20110427,589300.0,592900.0,586600.0,592300.0,40010055.0,0.977687341555216,0.22015069264485035\nSPY,20110428,3462000.0,3497500.0,3455200.0,3471100.0,12173779.0,,\nQQQ,20110428,590400.0,592300.0,588800.0,591700.0,38076882.0,0.9786933064759898,0.23577861894461\nSPY,20110429,3470400.0,3539500.0,3466900.0,3482300.0,27036884.0,,\nQQQ,20110429,590200.0,592800.0,589800.0,591300.0,39023164.0,0.9796989281805881,0.25170049918547016\nSPY,20110502,3497500.0,3504500.0,3455000.0,3462800.0,15153684.0,,\nQQQ,20110502,591700.0,593400.0,588200.0,589700.0,44759093.0,0.9806048787745211,0.26741128750179\nSPY,20110503,3479100.0,3498900.0,3456200.0,3482000.0,10899515.0,,\nQQQ,20110503,589400.0,590000.0,583300.0,587000.0,34248871.0,0.9815685536545034,0.28327130243616855\nSPY,20110504,3483200.0,3518300.0,3468800.0,3498900.0,13535774.0,,\nQQQ,20110504,587300.0,588700.0,581100.0,586100.0,48327411.0,0.9823877629639066,0.2984852935943784\nSPY,20110505,3484000.0,3509500.0,3460500.0,3469200.0,11715807.0,,\nQQQ,20110505,583100.0,589700.0,580800.0,583000.0,66104025.0,0.9831820148375044,0.31390062820459214\nSPY,20110506,3498500.0,3499900.0,3462100.0,3466600.0,9597113.0,,\nQQQ,20110506,588600.0,592000.0,583100.0,584700.0,61240812.0,0.9839536232236342,0.3294778756684693\nSPY,20110509,3478200.0,3492000.0,3465300.0,3476000.0,7059321.0,,\nQQQ,20110509,585700.0,589200.0,583400.0,586900.0,38139617.0,0.9847873752331636,0.3452572105505877\nSPY,20110510,3488900.0,3496900.0,3466600.0,3494500.0,9634033.0,,\nQQQ,20110510,588600.0,592800.0,587800.0,591900.0,35139127.0,0.985585325941365,0.36084951158531314\nSPY,20110511,3491500.0,3500000.0,3452500.0,3472300.0,11650417.0,,\nQQQ,20110511,591000.0,593100.0,583600.0,587600.0,54260133.0,0.9862943313956917,0.37617522949024274\nSPY,20110512,3464500.0,3471200.0,3422700.0,3465700.0,11090522.0,,\nQQQ,20110512,585800.0,591900.0,582400.0,591100.0,55738060.0,0.986892984027994,0.39141321117523953\nSPY,20110513,3457900.0,3462200.0,3403500.0,3405000.0,11339058.0,,\nQQQ,20110513,589700.0,590700.0,583900.0,584100.0,55298733.0,0.9874429682597038,0.40629874821606177\nSPY,20110516,3392500.0,3412200.0,3326000.0,3333000.0,15684647.0,,\nQQQ,20110516,581400.0,583100.0,572700.0,574000.0,64614401.0,0.988061337821225,0.4211587103071345\nSPY,20110517,3320000.0,3361400.0,3307500.0,3361400.0,15768145.0,,\nQQQ,20110517,571000.0,575700.0,569900.0,575600.0,58413846.0,0.9885165203592825,0.4352332470867048\nSPY,20110518,3365000.0,3410500.0,3360000.0,3398400.0,11729143.0,,\nQQQ,20110518,574800.0,581400.0,574100.0,580300.0,32175251.0,0.9888725505718844,0.4484209188483577\nSPY,20110519,3420800.0,3424000.0,3386700.0,3405300.0,8947448.0,,\nQQQ,20110519,582200.0,583400.0,578500.0,582300.0,31424569.0,0.9892105967458223,0.461427724340997\nSPY,20110520,3397500.0,3409500.0,3350200.0,3352400.0,11795025.0,,\nQQQ,20110520,581500.0,582100.0,576900.0,577600.0,37737127.0,0.9895206974449028,0.47387978139057996\nSPY,20110523,3300000.0,3359800.0,3294300.0,3344000.0,13334106.0,,\nQQQ,20110523,569800.0,571500.0,566500.0,569300.0,38695717.0,0.9897970488085436,0.48582247210252927\nSPY,20110524,3352800.0,3358700.0,3313400.0,3323300.0,11302916.0,,\nQQQ,20110524,570600.0,570700.0,565600.0,565800.0,33166887.0,0.9900643126562911,0.4981342968913534\nSPY,20110525,3334300.0,3385600.0,3328500.0,3365600.0,10219248.0,,\nQQQ,20110525,565000.0,570600.0,564700.0,567900.0,37202691.0,0.990264197529313,0.5079791945820876\nSPY,20110526,3357200.0,3368900.0,3344400.0,3350000.0,7734665.0,,\nQQQ,20110526,566200.0,573000.0,566100.0,571500.0,35031021.0,0.9904716496041834,0.5178986105755359\nSPY,20110527,3348000.0,3376300.0,3343100.0,3374100.0,7121663.0,,\nQQQ,20110527,572400.0,574900.0,571900.0,574300.0,26563167.0,0.9907509233936379,0.5303620947566616\nSPY,20110531,3411400.0,3478300.0,3410000.0,3478300.0,14137978.0,,\nQQQ,20110531,579700.0,583600.0,576700.0,583600.0,41641015.0,0.9910181939943903,0.5421827327052482\nSPY,20110601,3491100.0,3521300.0,3446500.0,3455000.0,19378362.0,,\nQQQ,20110601,582200.0,583600.0,570400.0,570700.0,46076014.0,0.9912517643570352,0.554250451720292\nSPY,20110602,3465500.0,3479800.0,3443000.0,3459700.0,11899977.0,,\nQQQ,20110602,572000.0,574100.0,568900.0,572100.0,46676655.0,0.9915204690254737,0.5664982436048133\nSPY,20110603,3430300.0,3453200.0,3420100.0,3433100.0,10588225.0,,\nQQQ,20110603,565500.0,569900.0,562700.0,563300.0,44579375.0,0.991704300534001,0.578265362336945\nSPY,20110606,3457000.0,3470500.0,3378100.0,3380500.0,16031347.0,,\nQQQ,20110606,562200.0,565300.0,558700.0,559000.0,41528641.0,0.9918426154518598,0.5889961467530045\nSPY,20110607,3381700.0,3382200.0,3319000.0,3319100.0,18557846.0,,\nQQQ,20110607,560400.0,562600.0,557600.0,557900.0,40292556.0,0.9920500637792808,0.6010394836291553\nSPY,20110608,3320000.0,3348000.0,3306500.0,3322400.0,11628251.0,,\nQQQ,20110608,556700.0,557700.0,552300.0,553800.0,41478680.0,0.9922255793077674,0.6129771978490013\nSPY,20110609,3332700.0,3336700.0,3307500.0,3314900.0,9597575.0,,\nQQQ,20110609,554100.0,557600.0,552300.0,554700.0,39398038.0,0.992357938760659,0.6235516302791129\nSPY,20110610,3306500.0,3316600.0,3255100.0,3255700.0,15078370.0,,\nQQQ,20110610,552300.0,553400.0,545900.0,546200.0,50520598.0,0.9924443926755172,0.6338613550789844\nSPY,20110613,3272000.0,3283000.0,3250700.0,3266200.0,11585233.0,,\nQQQ,20110613,546700.0,549300.0,544500.0,546300.0,34837062.0,0.9924837662065933,0.6425813343374712\nSPY,20110614,3300200.0,3332500.0,3293100.0,3322500.0,11412156.0,,\nQQQ,20110614,550600.0,554700.0,550300.0,553300.0,36738832.0,0.9925525016669005,0.6511648354409901\nSPY,20110615,3296000.0,3303000.0,3248800.0,3267900.0,13493541.0,,\nQQQ,20110615,548100.0,551400.0,541800.0,543000.0,50513749.0,0.9925709762731603,0.6601236514706709\nSPY,20110616,3267900.0,3286800.0,3183300.0,3251300.0,17715993.0,,\nQQQ,20110616,543200.0,545000.0,536200.0,540800.0,49715263.0,0.9925883643516882,0.6693801698493751\nSPY,20110617,3290700.0,3292500.0,3193600.0,3203800.0,21053914.0,,\nQQQ,20110617,544000.0,545200.0,536400.0,537900.0,58145745.0,0.992592760259248,0.6780707766702418\nSPY,20110620,3173000.0,3177000.0,3105000.0,3153200.0,22442476.0,,\nQQQ,20110620,536400.0,542300.0,536400.0,540700.0,33472582.0,0.992687222160989,0.6878805756717589\nSPY,20110621,3165300.0,3258000.0,3152000.0,3253000.0,17244458.0,,\nQQQ,20110621,542600.0,552900.0,540300.0,552400.0,49103421.0,0.992791300616345,0.6967357743272695\nSPY,20110622,3250200.0,3289000.0,3223800.0,3226700.0,13608711.0,,\nQQQ,20110622,550000.0,553200.0,548200.0,548400.0,32337397.0,0.9928670296586228,0.7049983221556553\nSPY,20110623,3189500.0,3316900.0,3181200.0,3312300.0,19431664.0,,\nQQQ,20110623,542400.0,553600.0,540600.0,553400.0,67844594.0,0.9929590523540335,0.7140694812121071\nSPY,20110624,3315000.0,3331400.0,3250900.0,3263500.0,15067160.0,,\nQQQ,20110624,550800.0,551300.0,542700.0,543800.0,43763114.0,0.9929835927283722,0.7214039164793872\nSPY,20110627,3276200.0,3339000.0,3272500.0,3320400.0,11624397.0,,\nQQQ,20110627,544400.0,555200.0,543300.0,552600.0,43430783.0,0.9930085215533997,0.7273467096897621\nSPY,20110628,3335800.0,3367000.0,3334400.0,3352600.0,10061511.0,,\nQQQ,20110628,553700.0,560800.0,552900.0,560600.0,36440865.0,0.9930611625463702,0.732626685804101\nSPY,20110629,3360800.0,3363700.0,3318800.0,3340400.0,12247344.0,,\nQQQ,20110629,562000.0,564100.0,559000.0,563200.0,52950961.0,0.9931131778023488,0.7368697323498031\nSPY,20110630,3347000.0,3361100.0,3328400.0,3356700.0,11219649.0,,\nQQQ,20110630,565000.0,570900.0,564700.0,570500.0,43265519.0,0.9931713585849876,0.7401246259363132\nSPY,20110701,3359500.0,3435000.0,3342000.0,3432300.0,15147932.0,,\nQQQ,20110701,570800.0,579900.0,569300.0,579100.0,42594720.0,0.9932312171231095,0.7443711834820701\nSPY,20110705,3429700.0,3498300.0,3425000.0,3492000.0,12408017.0,,\nQQQ,20110705,579700.0,582600.0,578300.0,581900.0,39766322.0,0.9932925086533937,0.7470635268130426\nSPY,20110706,3490000.0,3540900.0,3467200.0,3517600.0,15643131.0,,\nQQQ,20110706,581300.0,584900.0,579400.0,583900.0,44754532.0,0.9933514990765063,0.7501267761632605\nSPY,20110707,3547200.0,3580000.0,3540000.0,3572000.0,13956274.0,,\nQQQ,20110707,588300.0,593600.0,587400.0,591900.0,44410702.0,0.9934078075181417,0.7543479777016024\nSPY,20110708,3535200.0,3600000.0,3522000.0,3597100.0,16968843.0,,\nQQQ,20110708,586800.0,590400.0,583700.0,590400.0,50288141.0,0.9934678006001751,0.7581809769645182\nSPY,20110711,3563300.0,3597700.0,3528200.0,3540000.0,15458294.0,,\nQQQ,20110711,584100.0,587100.0,577600.0,579600.0,43981033.0,0.9935215095783234,0.760609830454215\nSPY,20110712,3535000.0,3576600.0,3486200.0,3537500.0,15672904.0,,\nQQQ,20110712,579500.0,580700.0,574600.0,575100.0,72832299.0,0.9935723757777581,0.761679530825642\nSPY,20110713,3583300.0,3600000.0,3563900.0,3580200.0,13635609.0,,\nQQQ,20110713,579400.0,583400.0,575500.0,577600.0,69988061.0,0.9936285607249364,0.7622840750627768\nSPY,20110714,3609500.0,3616100.0,3563400.0,3577700.0,14525923.0,,\nQQQ,20110714,579100.0,581800.0,568700.0,570900.0,79795319.0,0.9936460845205576,0.7631953195728407\nSPY,20110715,3609900.0,3650000.0,3591900.0,3649200.0,16601958.0,,\nQQQ,20110715,577300.0,578500.0,573100.0,578500.0,59840643.0,0.9936747854906786,0.7664473961812802\nSPY,20110718,3654300.0,3746500.0,3652800.0,3738000.0,19850623.0,,\nQQQ,20110718,575300.0,577900.0,569800.0,575400.0,48404652.0,0.9936473950554892,0.7696350252854157\nSPY,20110719,3779200.0,3786500.0,3733200.0,3768500.0,23957368.0,,\nQQQ,20110719,580900.0,589000.0,580900.0,588600.0,53550605.0,0.9936958192378895,0.7745600751183815\nSPY,20110720,3960500.0,3962700.0,3860000.0,3869000.0,32046847.0,,\nQQQ,20110720,591800.0,591900.0,585000.0,586000.0,47110777.0,0.9936968096696727,0.7793341689573428\nSPY,20110721,3870200.0,3900600.0,3839000.0,3872900.0,18167326.0,,\nQQQ,20110721,586600.0,593200.0,583400.0,590000.0,61596367.0,0.9937191555764201,0.7836819575504941\nSPY,20110722,3883200.0,3950500.0,3877500.0,3933000.0,18174328.0,,\nQQQ,20110722,589600.0,597000.0,589200.0,596000.0,40488449.0,0.9937653603604792,0.7886723223717339\nSPY,20110725,3901800.0,4000000.0,3896200.0,3985000.0,20602720.0,,\nQQQ,20110725,591300.0,598100.0,590200.0,595000.0,45720071.0,0.9938326044118044,0.7948123142618828\nSPY,20110726,4000000.0,4045000.0,3996800.0,4033600.0,16516257.0,,\nQQQ,20110726,594400.0,598300.0,593200.0,596000.0,34684887.0,0.9939183181743497,0.8013063982602057\nSPY,20110727,4003200.0,4026400.0,3921700.0,3925700.0,22865584.0,,\nQQQ,20110727,592400.0,592900.0,579400.0,580900.0,73137508.0,0.9939058436368372,0.8070009643514343\nSPY,20110728,3916300.0,3969900.0,3881400.0,3918200.0,20467102.0,,\nQQQ,20110728,581200.0,589300.0,579000.0,581900.0,55346807.0,0.9938999789448079,0.8123634872166585\nSPY,20110729,3875200.0,3951500.0,3840000.0,3904800.0,21747826.0,,\nQQQ,20110729,577200.0,586100.0,574400.0,579700.0,75650701.0,0.9938912284524962,0.8177142356972417\nSPY,20110801,3980000.0,3994800.0,3923700.0,3967500.0,21010857.0,,\nQQQ,20110801,587000.0,588200.0,570300.0,577500.0,77841199.0,0.9938295772912232,0.8231124470684602\nSPY,20110802,3978400.0,3979000.0,3883500.0,3889100.0,22372999.0,,\nQQQ,20110802,574600.0,577200.0,562100.0,562700.0,82904125.0,0.9936163838058228,0.8267902189139212\nSPY,20110803,3910700.0,3935500.0,3822500.0,3925700.0,25434054.0,,\nQQQ,20110803,563400.0,568800.0,553500.0,568100.0,92910298.0,0.9934583637760507,0.8311581283940979\nSPY,20110804,3895500.0,3913200.0,3773500.0,3773700.0,30401513.0,,\nQQQ,20110804,560000.0,560900.0,541700.0,541700.0,115998085.0,0.9930171353271435,0.8332772800585722\nSPY,20110805,3799100.0,3835000.0,3625700.0,3736200.0,41327895.0,,\nQQQ,20110805,547200.0,550300.0,523200.0,538300.0,190960226.0,0.9925616954701101,0.8349397877335222\nSPY,20110808,3610000.0,3677700.0,3530200.0,3532100.0,39454248.0,,\nQQQ,20110808,521800.0,531200.0,505900.0,505900.0,191921886.0,0.9917278054520703,0.8373060233399101\nSPY,20110809,3617900.0,3746100.0,3550000.0,3740100.0,36671924.0,,\nQQQ,20110809,513500.0,530700.0,499300.0,530300.0,168633829.0,0.9911267810567128,0.8382072178724054\nSPY,20110810,3711500.0,3746400.0,3625000.0,3636900.0,30017386.0,,\nQQQ,20110810,518300.0,526000.0,508100.0,508600.0,168319667.0,0.9901939071870186,0.8394286092545161\nSPY,20110811,3705400.0,3754500.0,3647400.0,3737000.0,25143527.0,,\nQQQ,20110811,515900.0,536900.0,513400.0,531000.0,123262127.0,0.9896965977482026,0.8415929694709151\nSPY,20110812,3784100.0,3796400.0,3742300.0,3769100.0,18319169.0,,\nQQQ,20110812,534300.0,539000.0,528800.0,535700.0,77080960.0,0.9892871927576757,0.8439134612997294\nSPY,20110815,3799000.0,3849700.0,3780900.0,3834100.0,15829029.0,,\nQQQ,20110815,537900.0,543600.0,535300.0,543600.0,63012914.0,0.9889310634226306,0.8458753537398764\nSPY,20110816,3815000.0,3833700.0,3760600.0,3804800.0,17306117.0,,\nQQQ,20110816,538300.0,543500.0,531800.0,539000.0,79282047.0,0.988537933872281,0.8477882875080337\nSPY,20110817,3823600.0,3845200.0,3780000.0,3804400.0,15351522.0,,\nQQQ,20110817,539700.0,544100.0,530200.0,535800.0,78082177.0,0.9880546360408532,0.8485602848872255\nSPY,20110818,3707000.0,3726500.0,3613700.0,3660500.0,29527714.0,,\nQQQ,20110818,521300.0,521400.0,504800.0,509500.0,114746166.0,0.9871813785957536,0.8485119178828955\nSPY,20110819,3617300.0,3670000.0,3560000.0,3560300.0,27045763.0,,\nQQQ,20110819,504200.0,516700.0,499900.0,500300.0,86478970.0,0.9862414350069298,0.8474388452751992\nSPY,20110822,3646400.0,3648700.0,3550900.0,3564400.0,18609902.0,,\nQQQ,20110822,512300.0,512400.0,500600.0,502100.0,69616648.0,0.9853558352024713,0.846753833516198\nSPY,20110823,3603000.0,3736400.0,3570000.0,3736000.0,22773913.0,,\nQQQ,20110823,505500.0,522800.0,503400.0,522800.0,69654353.0,0.9847165999739429,0.8459499664054709\nSPY,20110824,3734600.0,3789600.0,3706000.0,3761800.0,20291424.0,,\nQQQ,20110824,521300.0,528000.0,517100.0,526900.0,65288345.0,0.9841436453062569,0.8452378296663816\nSPY,20110825,3650000.0,3754500.0,3650000.0,3737200.0,28247760.0,,\nQQQ,20110825,526600.0,529100.0,516500.0,518300.0,80546727.0,0.983416714034123,0.844079646562832\nSPY,20110826,3711700.0,3838000.0,3708400.0,3835800.0,22442286.0,,\nQQQ,20110826,516600.0,533100.0,511500.0,531300.0,87365378.0,0.9828487901563322,0.8422406058495113\nSPY,20110829,3881700.0,3915000.0,3880000.0,3899700.0,14087302.0,,\nQQQ,20110829,536600.0,546700.0,536400.0,546100.0,42669827.0,0.9824961491826463,0.840252213030106\nSPY,20110830,3882500.0,3918400.0,3862100.0,3899900.0,14537163.0,,\nQQQ,20110830,544100.0,552900.0,541100.0,549700.0,57552324.0,0.9822135204020483,0.8391836408805733\nSPY,20110831,3908600.0,3920800.0,3818600.0,3848300.0,17906640.0,,\nQQQ,20110831,553000.0,557400.0,546000.0,550600.0,55341790.0,0.9819930065675272,0.838022302041051\nSPY,20110901,3859800.0,3873000.0,3807200.0,3811500.0,11787396.0,,\nQQQ,20110901,552000.0,556400.0,544600.0,545600.0,49670668.0,0.9817345858830421,0.8365517970639303\nSPY,20110902,3749400.0,3780000.0,3718400.0,3740500.0,15047753.0,,\nQQQ,20110902,535800.0,538200.0,529900.0,532800.0,52630129.0,0.9813378597821523,0.8341494159570159\nSPY,20110906,3670800.0,3803300.0,3664800.0,3795700.0,17725315.0,,\nQQQ,20110906,520400.0,533700.0,519100.0,533000.0,50139050.0,0.9808909620069002,0.8308702129690391\nSPY,20110907,3855700.0,3856000.0,3820000.0,3839300.0,11777261.0,,\nQQQ,20110907,540500.0,546500.0,539000.0,546400.0,46182793.0,0.9806267676371605,0.828671954665985\nSPY,20110908,3824000.0,3886100.0,3823100.0,3842200.0,14415660.0,,\nQQQ,20110908,543600.0,551600.0,542200.0,544000.0,53958349.0,0.9803252721329512,0.8262144596910399\nSPY,20110909,3839500.0,3860000.0,3750300.0,3773300.0,19695038.0,,\nQQQ,20110909,540100.0,542300.0,528500.0,531800.0,59865531.0,0.9798899633589435,0.8233490338386291\nSPY,20110912,3730200.0,3808800.0,3719000.0,3799500.0,16194032.0,,\nQQQ,20110912,525900.0,539000.0,525700.0,539000.0,60184754.0,0.9795568696395293,0.8207774926644952\nSPY,20110913,3821400.0,3862100.0,3802500.0,3846200.0,15238153.0,,\nQQQ,20110913,540600.0,546900.0,538100.0,545800.0,52431611.0,0.9792909050427604,0.818612229263468\nSPY,20110914,3870200.0,3922100.0,3857600.0,3893000.0,18577889.0,,\nQQQ,20110914,548600.0,559800.0,543300.0,553600.0,74980813.0,0.9791209156395532,0.8180659454928539\nSPY,20110915,3915700.0,3936500.0,3899000.0,3929000.0,14041491.0,,\nQQQ,20110915,559600.0,562800.0,553900.0,561900.0,67055308.0,0.9790324133270373,0.817873636756544\nSPY,20110916,3960000.0,4005000.0,3950300.0,4005000.0,21375790.0,,\nQQQ,20110916,562000.0,566500.0,561000.0,565900.0,83866394.0,0.9789540670219679,0.8181522151817153\nSPY,20110919,3969000.0,4132300.0,3952100.0,4116300.0,28822208.0,,\nQQQ,20110919,558900.0,569100.0,554300.0,566100.0,62092729.0,0.9788138670528963,0.8184225449859528\nSPY,20110920,4153500.0,4228600.0,4111900.0,4134500.0,26988790.0,,\nQQQ,20110920,569000.0,573500.0,562400.0,563600.0,56754267.0,0.9786249001989125,0.818295066298795\nSPY,20110921,4197100.0,4215900.0,4120000.0,4121400.0,20796654.0,,\nQQQ,20110921,566500.0,569300.0,553700.0,553800.0,72511493.0,0.978282757950744,0.8173251034644502\nSPY,20110922,4010000.0,4098200.0,3967000.0,4018200.0,33275510.0,,\nQQQ,20110922,539700.0,544600.0,527500.0,535800.0,138575219.0,0.9776918252389677,0.8145439711625422\nSPY,20110923,4002500.0,4067400.0,3998500.0,4043000.0,18497785.0,,\nQQQ,20110923,531300.0,543800.0,531000.0,541500.0,75107083.0,0.9772068913543666,0.8122279829325603\nSPY,20110926,4000000.0,4039800.0,3913000.0,4031700.0,27527487.0,,\nQQQ,20110926,544200.0,548700.0,532200.0,547800.0,89140914.0,0.976910069419329,0.810989189811003\nSPY,20110927,4089600.0,4092500.0,3980600.0,3992600.0,21927105.0,,\nQQQ,20110927,557100.0,562000.0,549800.0,553500.0,74075322.0,0.9767481039497393,0.8100196017322053\nSPY,20110928,4000700.0,4037400.0,3965100.0,3969200.0,14821403.0,,\nQQQ,20110928,555900.0,559700.0,544000.0,545300.0,72217551.0,0.9764374828055724,0.8077688886451903\nSPY,20110929,4019200.0,4022100.0,3862100.0,3905700.0,22789477.0,,\nQQQ,20110929,553600.0,554300.0,529700.0,538800.0,104820025.0,0.9760987050703949,0.8053031498909483\nSPY,20110930,3871200.0,3888900.0,3811800.0,3811800.0,18686791.0,,\nQQQ,20110930,531600.0,536100.0,524600.0,525200.0,90442657.0,0.9755813425415936,0.8027678242410612\nSPY,20111003,3803600.0,3826400.0,3732300.0,3746000.0,23126196.0,,\nQQQ,20111003,520200.0,528500.0,511100.0,511400.0,90873581.0,0.9748919853900043,0.8004994539095295\nSPY,20111004,3749000.0,3818000.0,3542400.0,3725000.0,43182467.0,,\nQQQ,20111004,506200.0,522900.0,501000.0,521900.0,123724379.0,0.9744439837967529,0.7970309094571327\nSPY,20111005,3678600.0,3798200.0,3603000.0,3785900.0,27310299.0,,\nQQQ,20111005,520600.0,536700.0,516600.0,535300.0,99358132.0,0.9741407647820199,0.7931874277598548\nSPY,20111006,3731100.0,3847700.0,3718100.0,3773700.0,27380776.0,,\nQQQ,20111006,534600.0,544300.0,532100.0,544300.0,65588150.0,0.9739695026859109,0.78949594365193\nSPY,20111007,3757700.0,3777400.0,3684900.0,3698000.0,18406587.0,,\nQQQ,20111007,544000.0,546600.0,537200.0,540700.0,64010623.0,0.9737905907056105,0.7854574938313379\nSPY,20111010,3791800.0,3888100.0,3782100.0,3888100.0,15098284.0,,\nQQQ,20111010,549900.0,559400.0,548900.0,559400.0,43619939.0,0.9737253472966023,0.7824561206233978\nSPY,20111011,3925800.0,4031800.0,3915000.0,4002900.0,21101625.0,,\nQQQ,20111011,557900.0,564600.0,557000.0,563200.0,58409284.0,0.9736689671015835,0.779470265972213\nSPY,20111012,4074100.0,4092500.0,4001400.0,4021900.0,21800461.0,,\nQQQ,20111012,568600.0,572300.0,565600.0,566400.0,71300836.0,0.9736289650181436,0.7768121892181358\nSPY,20111013,4050400.0,4084300.0,4028600.0,4084300.0,14108015.0,,\nQQQ,20111013,564900.0,571900.0,564300.0,571200.0,52844678.0,0.973620868879172,0.7751947096404902\nSPY,20111014,4170000.0,4220000.0,4152700.0,4220000.0,19251871.0,,\nQQQ,20111014,578200.0,581900.0,575100.0,581900.0,56954894.0,0.973640971514562,0.7751111596108765\nSPY,20111017,4214300.0,4267000.0,4160000.0,4199900.0,23269712.0,,\nQQQ,20111017,579100.0,580900.0,569800.0,572800.0,46380766.0,0.9736112700781749,0.7739706420307779\nSPY,20111018,4215900.0,4248000.0,4159900.0,4222400.0,23836006.0,,\nQQQ,20111018,571900.0,582900.0,566700.0,579900.0,77179052.0,0.9736728756318098,0.7737800287430332\nSPY,20111019,4014500.0,4084100.0,3978000.0,3986200.0,37692681.0,,\nQQQ,20111019,576700.0,578500.0,566800.0,568700.0,58308910.0,0.9736656044691424,0.7714160485277052\nSPY,20111020,4000000.0,4003500.0,3942100.0,3953100.0,18931225.0,,\nQQQ,20111020,568600.0,569200.0,557900.0,565900.0,67802234.0,0.9736304593908413,0.7689033623163196\nSPY,20111021,3983100.0,3991400.0,3907500.0,3931000.0,21569017.0,,\nQQQ,20111021,571900.0,576600.0,567800.0,573100.0,53809416.0,0.9735896808281128,0.7673792415586969\nSPY,20111024,3961800.0,4065000.0,3954300.0,4057700.0,17551893.0,,\nQQQ,20111024,575100.0,586500.0,574500.0,584900.0,50182465.0,0.9735817187525988,0.7679757670507948\nSPY,20111025,4050300.0,4065500.0,3973800.0,3977700.0,14802720.0,,\nQQQ,20111025,583000.0,583200.0,572200.0,573400.0,55321114.0,0.9735070965771662,0.766214685821138\nSPY,20111026,4020000.0,4025000.0,3932000.0,4005600.0,15468830.0,,\nQQQ,20111026,576600.0,577700.0,562200.0,572800.0,92943748.0,0.9734283597830135,0.7648110081666829\nSPY,20111027,4077000.0,4090000.0,4018900.0,4046900.0,16813282.0,,\nQQQ,20111027,586400.0,592000.0,580400.0,588500.0,74564318.0,0.9733929402137107,0.765172822675823\nSPY,20111028,4030000.0,4063500.0,4025100.0,4049500.0,10868995.0,,\nQQQ,20111028,585200.0,590100.0,584900.0,589400.0,38063135.0,0.9733512994015804,0.7654626492204503\nSPY,20111031,4021100.0,4093300.0,4010600.0,4047800.0,13328273.0,,\nQQQ,20111031,584300.0,586400.0,579100.0,579400.0,53551654.0,0.9732637097902099,0.7643558342660651\nSPY,20111101,3970000.0,3994800.0,3932300.0,3965100.0,18321979.0,,\nQQQ,20111101,565200.0,569700.0,561200.0,564400.0,84137143.0,0.9730979216966077,0.7599945634159949\nSPY,20111102,4000000.0,4004400.0,3951100.0,3974100.0,11041550.0,,\nQQQ,20111102,570300.0,571600.0,563900.0,569200.0,54890647.0,0.9729527627763348,0.7562050719715605\nSPY,20111103,3990700.0,4033800.0,3953600.0,4030700.0,15153875.0,,\nQQQ,20111103,573700.0,581800.0,567100.0,581000.0,60337389.0,0.9728520498917512,0.7543438831390511\nSPY,20111104,4020000.0,4034400.0,3991600.0,4002400.0,10034522.0,,\nQQQ,20111104,578200.0,580500.0,572200.0,578000.0,50649243.0,0.9727475682446641,0.7520676386986473\nSPY,20111107,3999100.0,4000000.0,3961300.0,3997300.0,9284553.0,,\nQQQ,20111107,577600.0,582500.0,571700.0,582100.0,50369039.0,0.9726404216567847,0.749932745626063\nSPY,20111108,4022100.0,4080000.0,4015600.0,4062300.0,13796113.0,,\nQQQ,20111108,586300.0,589800.0,579700.0,588800.0,54497813.0,0.9725454303449237,0.7492196148526076\nSPY,20111109,3970000.0,4008900.0,3942300.0,3952800.0,18781796.0,,\nQQQ,20111109,577400.0,578300.0,566300.0,568100.0,60635255.0,0.972371283124181,0.7450442651152681\nSPY,20111110,3971100.0,3972100.0,3821500.0,3852200.0,26111624.0,,\nQQQ,20111110,573700.0,574200.0,562300.0,567800.0,61401667.0,0.9722158124478837,0.7407744781696448\nSPY,20111111,3867500.0,3887000.0,3802600.0,3846200.0,22776196.0,,\nQQQ,20111111,572700.0,580200.0,572000.0,578500.0,44533763.0,0.9720750888205378,0.7375165980193498\nSPY,20111114,3843700.0,3852500.0,3782000.0,3792600.0,15036445.0,,\nQQQ,20111114,577100.0,580100.0,572800.0,574900.0,41619309.0,0.9719219337908284,0.7333340332226899\nSPY,20111115,3808000.0,3895000.0,3794500.0,3888300.0,14945553.0,,\nQQQ,20111115,573200.0,583600.0,572600.0,581300.0,49387714.0,0.9717754032234986,0.7302497982898973\nSPY,20111116,3894400.0,3911300.0,3843200.0,3847700.0,12004115.0,,\nQQQ,20111116,577100.0,581300.0,570600.0,571700.0,60799705.0,0.9716093338842218,0.7263234539893622\nSPY,20111117,3838200.0,3845800.0,3755000.0,3774100.0,16682739.0,,\nQQQ,20111117,570100.0,570400.0,554800.0,558300.0,89409830.0,0.9713919464630643,0.7210184649224912\nSPY,20111118,3788900.0,3799900.0,3748800.0,3749400.0,12854611.0,,\nQQQ,20111118,558400.0,559000.0,553000.0,554000.0,53680494.0,0.9711440643042466,0.7153280402233675\nSPY,20111121,3702300.0,3716800.0,3659100.0,3690100.0,15375313.0,,\nQQQ,20111121,546500.0,547300.0,537800.0,543400.0,45821220.0,0.9708280666687954,0.7092250514422088\nSPY,20111122,3713900.0,3779200.0,3709400.0,3765100.0,13969928.0,,\nQQQ,20111122,541700.0,546800.0,538800.0,545200.0,45616304.0,0.9704920935398335,0.7031345696945789\nSPY,20111123,3747000.0,3758200.0,3668800.0,3669900.0,14915547.0,,\nQQQ,20111123,541100.0,541700.0,532600.0,532900.0,44133473.0,0.9701014238664711,0.6968742413431765\nSPY,20111125,3682000.0,3711500.0,3633200.0,3635900.0,8068504.0,,\nQQQ,20111125,530600.0,536700.0,528900.0,529000.0,20866292.0,0.9696753535470441,0.6906772773980382\nSPY,20111128,3724700.0,3767200.0,3703300.0,3761200.0,11750977.0,,\nQQQ,20111128,541700.0,547900.0,541400.0,547200.0,42979123.0,0.9693488133302454,0.6844206984197877\nSPY,20111129,3758400.0,3788300.0,3702000.0,3732000.0,13244638.0,,\nQQQ,20111129,546900.0,551000.0,542300.0,543800.0,44688181.0,0.9690215288464736,0.6779947748783626\nSPY,20111130,3810200.0,3822000.0,3783000.0,3822000.0,13403929.0,,\nQQQ,20111130,558600.0,564400.0,556700.0,564200.0,55346352.0,0.968842560896448,0.6725529336657988\nSPY,20111201,3824500.0,3890000.0,3807500.0,3879300.0,13345111.0,,\nQQQ,20111201,563800.0,569200.0,563500.0,567800.0,42152749.0,0.9686638830855585,0.667468907849015\nSPY,20111202,3900000.0,3936100.0,3885800.0,3897000.0,12924721.0,,\nQQQ,20111202,573400.0,573400.0,565700.0,566200.0,32732541.0,0.9684298408475635,0.6620139428053207\nSPY,20111205,3932800.0,3964100.0,3903900.0,3930100.0,12346770.0,,\nQQQ,20111205,574700.0,576200.0,569200.0,572400.0,35244994.0,0.9682016687109507,0.6579042533528542\nSPY,20111206,3925400.0,3946300.0,3894000.0,3909500.0,9948992.0,,\nQQQ,20111206,572900.0,574500.0,568900.0,570800.0,35394447.0,0.9679297125338007,0.6533046431204537\nSPY,20111207,3897000.0,3909400.0,3867700.0,3890900.0,10404114.0,,\nQQQ,20111207,569200.0,573400.0,563500.0,570800.0,36626993.0,0.9676550874344191,0.6484765623691701\nSPY,20111208,3914800.0,3955000.0,3902500.0,3906600.0,12907172.0,,\nQQQ,20111208,567100.0,571500.0,560100.0,561100.0,43112494.0,0.967290983485715,0.6423774502029059\nSPY,20111209,3927000.0,3940400.0,3910500.0,3936200.0,10295777.0,,\nQQQ,20111209,562600.0,571900.0,562400.0,570200.0,46365400.0,0.9669690840253763,0.63732103988298\nSPY,20111212,3916600.0,3939000.0,3894500.0,3918400.0,10346413.0,,\nQQQ,20111212,564200.0,564500.0,559000.0,563800.0,49138135.0,0.9666036746113018,0.631341039559674\nSPY,20111213,3930000.0,3954000.0,3871000.0,3888100.0,11822809.0,,\nQQQ,20111213,567500.0,569800.0,555300.0,557600.0,58665524.0,0.9661760612159281,0.6249600925714923\nSPY,20111214,3867000.0,3873800.0,3776800.0,3801900.0,14199799.0,,\nQQQ,20111214,555500.0,555900.0,545800.0,548900.0,57710086.0,0.9656998029450152,0.6181849676655975\nSPY,20111215,3833300.0,3837400.0,3783200.0,3789400.0,8827712.0,,\nQQQ,20111215,553600.0,554200.0,546600.0,547400.0,56613840.0,0.9651934561551903,0.6113359800255324\nSPY,20111216,3809800.0,3841400.0,3795700.0,3810200.0,13505326.0,,\nQQQ,20111216,548700.0,556100.0,547700.0,548600.0,54829554.0,0.964687588957393,0.6044401251683538\nSPY,20111219,3824700.0,3848400.0,3804800.0,3822100.0,7955619.0,,\nQQQ,20111219,550700.0,552000.0,541700.0,543500.0,41414616.0,0.9640914827265712,0.5971618338195308\nSPY,20111220,3875000.0,3961000.0,3872600.0,3961000.0,11397692.0,,\nQQQ,20111220,552000.0,560000.0,551700.0,559500.0,62949475.0,0.9635906508291024,0.590175244030021\nSPY,20111221,3965200.0,3973000.0,3920100.0,3964500.0,8933964.0,,\nQQQ,20111221,556000.0,556500.0,544900.0,551300.0,62746156.0,0.9629407884388096,0.5820638410297927\nSPY,20111222,3970000.0,3991200.0,3961000.0,3985500.0,6910317.0,,\nQQQ,20111222,552500.0,556200.0,551700.0,556000.0,30951391.0,0.9623433507389809,0.5742992554362026\nSPY,20111223,3996900.0,4035900.0,3995000.0,4033800.0,9418982.0,,\nQQQ,20111223,557100.0,560800.0,555900.0,560800.0,24062133.0,0.9617523653484188,0.5667176394582226\nSPY,20111227,4031600.0,4090900.0,4030200.0,4065300.0,9340738.0,,\nQQQ,20111227,559900.0,564200.0,559300.0,562400.0,19761204.0,0.9611514368702837,0.558934681915524\nSPY,20111228,4069000.0,4082500.0,4013400.0,4025800.0,7937376.0,,\nQQQ,20111228,561700.0,562600.0,554500.0,555900.0,29940746.0,0.9604434055069591,0.5507452918660192\nSPY,20111229,4032500.0,4056500.0,4005100.0,4051200.0,7211300.0,,\nQQQ,20111229,556800.0,560300.0,555100.0,559900.0,24958839.0,0.959744515700716,0.5426507610639516\nSPY,20111230,4035100.0,4062800.0,4034900.0,4050000.0,6067027.0,,\nQQQ,20111230,558700.0,561200.0,558200.0,558300.0,19592740.0,0.9589968034828765,0.5342930239705759\nSPY,20120103,4095000.0,4125000.0,4090000.0,4112300.0,10355371.0,,\nQQQ,20120103,569100.0,571900.0,567500.0,569000.0,36763716.0,0.9583356089212356,0.5281995358703765\nSPY,20120104,4102000.0,4146800.0,4093100.0,4134400.0,8995709.0,,\nQQQ,20120104,568100.0,572200.0,565600.0,571400.0,26818947.0,0.9576553382648034,0.5229365348574245\nSPY,20120105,4149500.0,4185500.0,4126700.0,4180300.0,9368902.0,,\nQQQ,20120105,570200.0,576600.0,568100.0,576100.0,36087054.0,0.9569834681784617,0.5193240097623333\nSPY,20120106,4197700.0,4227500.0,4192200.0,4224500.0,10974416.0,,\nQQQ,20120106,576200.0,579400.0,574100.0,577900.0,42716301.0,0.9562874098053079,0.515920324986699\nSPY,20120109,4255200.0,4277500.0,4213500.0,4217500.0,13625461.0,,\nQQQ,20120109,579600.0,579800.0,574400.0,576200.0,35996640.0,0.9555467709146601,0.5122354369083851\nSPY,20120110,4260000.0,4260000.0,4215000.0,4232400.0,8861764.0,,\nQQQ,20120110,582300.0,584100.0,578900.0,580400.0,32991485.0,0.9548228625098695,0.5094537738382782\nSPY,20120111,4223900.0,4228500.0,4193100.0,4225500.0,7485410.0,,\nQQQ,20120111,580300.0,582900.0,578100.0,581600.0,33149554.0,0.9540704562141777,0.5067069799777034\nSPY,20120112,4224100.0,4229000.0,4187500.0,4213900.0,7361184.0,,\nQQQ,20120112,582900.0,584700.0,578600.0,583900.0,24233233.0,0.9533089515627625,0.504537309879718\nSPY,20120113,4195300.0,4204500.0,4186600.0,4199700.0,7740621.0,,\nQQQ,20120113,580800.0,582000.0,576800.0,581800.0,32554172.0,0.952501538693431,0.5016787840376582\nSPY,20120117,4242000.0,4259900.0,4229600.0,4247000.0,8282230.0,,\nQQQ,20120117,586900.0,589600.0,584900.0,587100.0,35561100.0,0.9517043302108232,0.5003305076829825\nSPY,20120118,4269900.0,4294700.0,4263000.0,4291100.0,9548237.0,,\nQQQ,20120118,588200.0,594900.0,587100.0,594900.0,43562388.0,0.9509060711354101,0.5002382729824123\nSPY,20120119,4300300.0,4313300.0,4265100.0,4277500.0,8771133.0,,\nQQQ,20120119,597300.0,599700.0,596500.0,598600.0,37413775.0,0.9500622777283675,0.5002465216141707\nSPY,20120120,4274900.0,4275000.0,4197500.0,4203000.0,14348428.0,,\nQQQ,20120120,596000.0,597900.0,595600.0,597700.0,34342484.0,0.9491503991074076,0.5000136852359022\nSPY,20120123,4229700.0,4284500.0,4223000.0,4274200.0,10390483.0,,\nQQQ,20120123,597800.0,602100.0,594400.0,597900.0,33819646.0,0.9482214382378265,0.5000751750362822\nSPY,20120124,4250000.0,4251100.0,4195600.0,4205000.0,13222112.0,,\nQQQ,20120124,595200.0,598400.0,594100.0,596700.0,29239003.0,0.9472324414509089,0.499885081568034\nSPY,20120125,4542600.0,4544500.0,4437700.0,4466600.0,31925920.0,,\nQQQ,20120125,602600.0,605800.0,598400.0,604500.0,55563526.0,0.9462601269782943,0.4999338234829695\nSPY,20120126,4484500.0,4487900.0,4431400.0,4444700.0,11158367.0,,\nQQQ,20120126,606900.0,608000.0,599400.0,602200.0,33275864.0,0.9452448294736814,0.4999765663929897\nSPY,20120127,4443400.0,4484800.0,4437700.0,4472800.0,10443460.0,,\nQQQ,20120127,600900.0,605100.0,600600.0,604000.0,35014715.0,0.9441446921198381,0.5000185594273957\nSPY,20120130,4458300.0,4539000.0,4454000.0,4530100.0,13006687.0,,\nQQQ,20120130,598900.0,605400.0,596600.0,604400.0,38894772.0,0.9429466377948971,0.5000343068152979\nSPY,20120131,4558400.0,4582400.0,4530700.0,4564800.0,13224876.0,,\nQQQ,20120131,607500.0,608600.0,601400.0,605100.0,44869042.0,0.941675055254389,0.5000470547007425\nSPY,20120201,4584900.0,4589900.0,4555500.0,4561900.0,9278413.0,,\nQQQ,20120201,608800.0,612400.0,606600.0,610200.0,39119430.0,0.9403637009054845,0.5000560532081152\nSPY,20120202,4560100.0,4571700.0,4539800.0,4551200.0,6527185.0,,\nQQQ,20120202,612200.0,614100.0,609700.0,612300.0,35620022.0,0.9389867221712014,0.5000605524618016\nSPY,20120203,4573000.0,4600000.0,4555600.0,4596800.0,9839016.0,,\nQQQ,20120203,617800.0,621200.0,616800.0,620500.0,32234737.0,0.9376160722338548,0.5000605524618016\nSPY,20120206,4583800.0,4649800.0,4582200.0,4639700.0,8713906.0,,\nQQQ,20120206,618200.0,620200.0,616600.0,620000.0,25805381.0,0.9361772195040279,0.5000598025861872\nSPY,20120207,4654600.0,4697500.0,4645900.0,4688300.0,11072336.0,,\nQQQ,20120207,619500.0,622500.0,616700.0,621300.0,34930746.0,0.9346914058991698,0.5000631770264519\nSPY,20120208,4706600.0,4767900.0,4697000.0,4766800.0,14260524.0,,\nQQQ,20120208,621600.0,624600.0,619100.0,624600.0,35271525.0,0.9331347448455264,0.5000699259069814\nSPY,20120209,4809500.0,4967400.0,4805500.0,4931700.0,30876210.0,,\nQQQ,20120209,627000.0,629800.0,623200.0,629300.0,40182582.0,0.9315374349996367,0.5000740502228607\nSPY,20120210,4911700.0,4976200.0,4885500.0,4936900.0,21870615.0,,\nQQQ,20120210,624600.0,626400.0,622500.0,624600.0,44286006.0,0.929789547020622,0.5000737690338004\nSPY,20120213,4997400.0,5038300.0,4970900.0,5026000.0,17315742.0,,\nQQQ,20120213,629400.0,631300.0,626500.0,630500.0,28657953.0,0.9279603034778292,0.5000751750362822\nSPY,20120214,5047000.0,5095600.0,5020000.0,5094600.0,15374423.0,,\nQQQ,20120214,629100.0,632200.0,626900.0,631900.0,47560956.0,0.9260118346184013,0.5000751750362822\nSPY,20120215,5144700.0,5262900.0,4968900.0,4976700.0,52535256.0,,\nQQQ,20120215,635100.0,638600.0,626700.0,627700.0,83960618.0,0.923871203058382,0.5000736752850535\nSPY,20120216,4913100.0,5048900.0,4866300.0,5025500.0,32373924.0,,\nQQQ,20120216,627900.0,637000.0,626300.0,636300.0,72560662.0,0.921750186846015,0.5000714256582103\nSPY,20120217,5033000.0,5077700.0,5003000.0,5021200.0,17239614.0,,\nQQQ,20120217,636400.0,636900.0,631500.0,634300.0,61393177.0,0.9194702099554584,0.500069176031367\nSPY,20120221,5071600.0,5148500.0,5041200.0,5148500.0,20658079.0,,\nQQQ,20120221,635000.0,638900.0,632100.0,636100.0,35205308.0,0.9170379497452412,0.5000676762801383\nSPY,20120222,5130600.0,5154900.0,5090900.0,5130400.0,16741726.0,,\nQQQ,20120222,635000.0,636800.0,632300.0,633200.0,39365682.0,0.9143496288007144,0.5000616772752231\nSPY,20120223,5150800.0,5178100.0,5095100.0,5163900.0,19838769.0,,\nQQQ,20120223,634100.0,638100.0,630900.0,637400.0,45138601.0,0.9115530768048381,0.5000616772752231\nSPY,20120224,5197600.0,5229000.0,5186400.0,5224100.0,14089349.0,,\nQQQ,20120224,639200.0,640700.0,638000.0,639600.0,38979636.0,0.9086105016337483,0.5001017956205931\nSPY,20120227,5213100.0,5285000.0,5162800.0,5257600.0,19101765.0,,\nQQQ,20120227,636100.0,642600.0,633300.0,640500.0,39766303.0,0.9054474987750332,0.5001070447498939\nSPY,20120228,5279800.0,5354100.0,5258500.0,5354100.0,20681233.0,,\nQQQ,20120228,641100.0,647000.0,640300.0,647000.0,39018968.0,0.9022193030776039,0.5001115440035802\nSPY,20120229,5415500.0,5476100.0,5357000.0,5424400.0,32705505.0,,\nQQQ,20120229,647500.0,649600.0,642000.0,644100.0,54577012.0,0.8985790619143434,0.500113043754809\nSPY,20120301,5481700.0,5482100.0,5387700.0,5444700.0,23669814.0,,\nQQQ,20120301,646500.0,649700.0,644600.0,649200.0,54911277.0,0.8947625092542137,0.5001137936304234\nSPY,20120302,5444600.0,5468000.0,5425200.0,5451800.0,14856679.0,,\nQQQ,20120302,648300.0,650700.0,646600.0,648600.0,30305495.0,0.8904792063479978,0.500113043754809\nSPY,20120305,5456900.0,5474300.0,5260000.0,5332800.0,28500880.0,,\nQQQ,20120305,648300.0,649000.0,639900.0,641900.0,42795104.0,0.8856914550002017,0.5001239169512176\nSPY,20120306,5236500.0,5336900.0,5162300.0,5302700.0,28150675.0,,\nQQQ,20120306,635700.0,637200.0,632300.0,635700.0,47127644.0,0.8802425612992782,0.5001219485044202\nSPY,20120307,5367600.0,5377800.0,5233000.0,5306900.0,27547187.0,,\nQQQ,20120307,638700.0,642100.0,637700.0,640700.0,38419162.0,0.8744290226792635,0.5001256978817892\nSPY,20120308,5348600.0,5429900.0,5321200.0,5419900.0,17939269.0,,\nQQQ,20120308,644400.0,649400.0,643000.0,647500.0,37968663.0,0.8680440495422459,0.5001271976327368\nSPY,20120309,5444000.0,5477400.0,5431100.0,5451700.0,14412283.0,,\nQQQ,20120309,648600.0,651400.0,648200.0,650200.0,37411668.0,0.8612691020219932,0.5001316968855797\nSPY,20120312,5490000.0,5520000.0,5470000.0,5520000.0,13801501.0,,\nQQQ,20120312,650000.0,651100.0,647200.0,650400.0,30365923.0,0.85381233401566,0.5001406953912654\nSPY,20120313,5575400.0,5681800.0,5557500.0,5681000.0,23940890.0,,\nQQQ,20120313,654000.0,662600.0,652700.0,662600.0,55311490.0,0.8456208630625556,0.5001406953912654\nSPY,20120314,5781100.0,5947200.0,5754000.0,5895800.0,49127144.0,,\nQQQ,20120314,663300.0,667400.0,660800.0,664900.0,57130573.0,0.8370145037159061,0.5001406953912654\nSPY,20120315,6000000.0,6000100.0,5785800.0,5855600.0,40098073.0,,\nQQQ,20120315,666900.0,668200.0,663500.0,666800.0,61965237.0,0.8272129086265759,0.5001399455157917\nSPY,20120316,5845500.0,5892000.0,5780000.0,5855700.0,27598233.0,,\nQQQ,20120316,666700.0,666700.0,663600.0,665200.0,48925966.0,0.8163248187932525,0.500142195142213\nSPY,20120319,5985600.0,6017700.0,5890600.0,6011000.0,29000504.0,,\nQQQ,20120319,666300.0,671500.0,664500.0,670000.0,49615270.0,0.8042146010344207,0.5001429450176869\nSPY,20120320,5993200.0,6069000.0,5914800.0,6059600.0,28096021.0,,\nQQQ,20120320,666400.0,671900.0,664700.0,671100.0,44077101.0,0.7905909358509037,0.5001429450176869\nSPY,20120321,6029400.0,6096500.0,6014100.0,6025000.0,21261051.0,,\nQQQ,20120321,671200.0,674900.0,670300.0,671200.0,35971792.0,0.774222565022197,0.500142195142213\nSPY,20120322,5980600.0,6045000.0,5955300.0,5992100.0,21604598.0,,\nQQQ,20120322,667200.0,671400.0,666800.0,669800.0,54412724.0,0.7816848031318695,0.5056342831124148\nSPY,20120323,6004900.0,6018000.0,5900000.0,5958100.0,14894388.0,,\nQQQ,20120323,670600.0,670800.0,665600.0,669500.0,39814758.0,0.7890454277632253,0.5131547842392791\nSPY,20120326,5999900.0,6071500.0,5952600.0,6069800.0,20320164.0,,\nQQQ,20120326,673900.0,681100.0,673300.0,681100.0,38349349.0,0.7971823818402264,0.5218139712731273\nSPY,20120327,6064300.0,6162800.0,6060600.0,6144800.0,21171483.0,,\nQQQ,20120327,681600.0,684900.0,681300.0,682200.0,32847019.0,0.8047800583686455,0.5298736328656626\nSPY,20120328,6186500.0,6214500.0,6103400.0,6176200.0,22769418.0,,\nQQQ,20120328,682500.0,685100.0,675400.0,679200.0,40649324.0,0.8118632843957044,0.5385707606515878\nSPY,20120329,6125000.0,6165600.0,6072300.0,6098600.0,20700664.0,,\nQQQ,20120329,676000.0,679300.0,672000.0,676800.0,46832930.0,0.8183646843154626,0.5474785263951965\nSPY,20120330,6089000.0,6105600.0,5979400.0,5994700.0,25105975.0,,\nQQQ,20120330,679800.0,680100.0,672800.0,675500.0,37902514.0,0.8242481039842463,0.5562579592234884\nSPY,20120402,6019300.0,6187700.0,6003800.0,6187000.0,20400009.0,,\nQQQ,20120402,674800.0,683400.0,673600.0,682500.0,37717634.0,0.8306885029022334,0.564625813360885\nSPY,20120403,6273000.0,6322100.0,6225100.0,6293200.0,28716702.0,,\nQQQ,20120403,683000.0,685500.0,678500.0,682300.0,42032556.0,0.8367340516931804,0.5725857355464271\nSPY,20120404,6247100.0,6258600.0,6170000.0,6243100.0,19719634.0,,\nQQQ,20120404,677200.0,677600.0,669100.0,673000.0,52762020.0,0.8414931494362285,0.5800123879352923\nSPY,20120405,6270900.0,6346500.0,6234000.0,6336800.0,22229967.0,,\nQQQ,20120405,671900.0,677800.0,671300.0,677200.0,27725850.0,0.8464531560884871,0.5876937301511963\nSPY,20120409,6261900.0,6398400.0,6253000.0,6362300.0,20763598.0,,\nQQQ,20120409,668800.0,674800.0,667600.0,672100.0,33742301.0,0.8506292861774191,0.5952423445326477\nSPY,20120410,6400000.0,6440000.0,6260000.0,6284400.0,31047285.0,,\nQQQ,20120410,671800.0,674400.0,659200.0,661300.0,68159763.0,0.8534783351568594,0.6021493281630182\nSPY,20120411,6360000.0,6367800.0,6233500.0,6261100.0,24296083.0,,\nQQQ,20120411,667300.0,668900.0,662800.0,664400.0,63309580.0,0.8565765596435141,0.6085401347000908\nSPY,20120412,6252300.0,6313300.0,6205000.0,6225600.0,21370484.0,,\nQQQ,20120412,665600.0,672800.0,664900.0,671900.0,49887235.0,0.8599001880513722,0.6139797252685772\nSPY,20120413,6241000.0,6246900.0,6035300.0,6052300.0,30120982.0,,\nQQQ,20120413,669800.0,669900.0,661600.0,661800.0,53928212.0,0.8626615874471723,0.6204560175135087\nSPY,20120416,6100000.0,6102800.0,5782500.0,5806800.0,36759532.0,,\nQQQ,20120416,665200.0,665600.0,652500.0,654700.0,54508192.0,0.865020033242903,0.6266383589033467\nSPY,20120417,5789600.0,6100000.0,5719100.0,6097000.0,35498058.0,,\nQQQ,20120417,657300.0,669900.0,656300.0,667800.0,43527031.0,0.8680353033778804,0.6328162010454027\nSPY,20120418,6138800.0,6202500.0,6027200.0,6083400.0,33051624.0,,\nQQQ,20120418,665900.0,670000.0,664100.0,666100.0,37969767.0,0.8704699093814778,0.6376165234915243\nSPY,20120419,6001600.0,6047300.0,5845700.0,5879500.0,28883186.0,,\nQQQ,20120419,663700.0,671700.0,656200.0,658700.0,76106897.0,0.8725501054771508,0.6433635626584501\nSPY,20120420,5918200.0,5946200.0,5704200.0,5729800.0,35812780.0,,\nQQQ,20120420,662200.0,665100.0,655800.0,656800.0,54846782.0,0.8751849095542925,0.6516204322131237\nSPY,20120423,5708000.0,5766500.0,5566500.0,5717000.0,33600193.0,,\nQQQ,20120423,650600.0,651800.0,644900.0,650800.0,68043774.0,0.8776020987274925,0.6609796174743972\nSPY,20120424,5629100.0,5676800.0,5550000.0,5602800.0,30737141.0,,\nQQQ,20120424,649600.0,652300.0,644500.0,647300.0,43306476.0,0.8798814014448241,0.6703401768167224\nSPY,20120425,6159900.0,6180000.0,6060000.0,6100000.0,29546637.0,,\nQQQ,20120425,660700.0,664900.0,659700.0,664600.0,51393392.0,0.8831118499924995,0.6796716149673151\nSPY,20120426,6145000.0,6146900.0,6021300.0,6077000.0,18363306.0,,\nQQQ,20120426,664400.0,669900.0,663500.0,668400.0,38380057.0,0.8867945320206316,0.6892347643352441\nSPY,20120427,6050000.0,6061800.0,6005000.0,6030000.0,14206223.0,,\nQQQ,20120427,671200.0,674500.0,667700.0,672500.0,42329050.0,0.8905820741691203,0.698748047049604\nSPY,20120430,5979400.0,5984000.0,5830000.0,5842400.0,17538646.0,,\nQQQ,20120430,670400.0,671700.0,667100.0,667600.0,33528739.0,0.8939271791596498,0.7081465989670302\nSPY,20120501,5849000.0,5967600.0,5812300.0,5821300.0,21398059.0,,\nQQQ,20120501,666900.0,676200.0,665900.0,668700.0,34377955.0,0.8971277451135132,0.7174094236018098\nSPY,20120502,5804800.0,5873500.0,5788600.0,5860000.0,15389455.0,,\nQQQ,20120502,665400.0,671100.0,663900.0,670400.0,33011148.0,0.9000145645434182,0.726132338603961\nSPY,20120503,5907300.0,5914000.0,5803000.0,5818200.0,13419154.0,,\nQQQ,20120503,671000.0,671500.0,661800.0,663400.0,48559532.0,0.902556366683398,0.7348383814300925\nSPY,20120504,5770400.0,5783500.0,5651700.0,5652500.0,18398916.0,,\nQQQ,20120504,657400.0,658300.0,646900.0,646900.0,81890539.0,0.9044897399804496,0.7432306017822589\nSPY,20120507,5615000.0,5727700.0,5612300.0,5694800.0,16075557.0,,\nQQQ,20120507,643100.0,650700.0,642900.0,647600.0,47732112.0,0.9065448204303231,0.7516310707538126\nSPY,20120508,5699400.0,5714900.0,5587300.0,5681800.0,17275510.0,,\nQQQ,20120508,643500.0,647400.0,634800.0,645200.0,68416238.0,0.9086442164752274,0.7600555357090387\nSPY,20120509,5637100.0,5739700.0,5608500.0,5691800.0,16813170.0,,\nQQQ,20120509,637700.0,646800.0,635100.0,644100.0,75462234.0,0.9110254558723073,0.7687971975734339\nSPY,20120510,5751900.0,5758700.0,5684500.0,5705200.0,11448923.0,,\nQQQ,20120510,646100.0,646300.0,639500.0,641700.0,44845941.0,0.9130151819466843,0.7770964334888698\nSPY,20120511,5651800.0,5744700.0,5643500.0,5667100.0,13589694.0,,\nQQQ,20120511,639700.0,648600.0,639100.0,641800.0,44382143.0,0.9153636731059968,0.7856525014170491\nSPY,20120514,5626900.0,5675100.0,5576000.0,5582200.0,12312502.0,,\nQQQ,20120514,636300.0,640800.0,634800.0,635800.0,44440123.0,0.9172140691866678,0.7936236672432143\nSPY,20120515,5614300.0,5632200.0,5517500.0,5531700.0,16592895.0,,\nQQQ,20120515,637500.0,642700.0,632600.0,633700.0,62668343.0,0.9185171384944474,0.7998746209898667\nSPY,20120516,5540500.0,5568900.0,5410400.0,5460800.0,19594205.0,,\nQQQ,20120516,635900.0,637800.0,628100.0,629400.0,51374803.0,0.9197697394876388,0.8060145933120342\nSPY,20120517,5453100.0,5475000.0,5301200.0,5301200.0,25068401.0,,\nQQQ,20120517,629600.0,630600.0,616100.0,616100.0,59003423.0,0.920951073205164,0.8128646967760058\nSPY,20120518,5338900.0,5434100.0,5286800.0,5303800.0,25506966.0,,\nQQQ,20120518,618000.0,619600.0,607700.0,608400.0,73078982.0,0.9219003839975727,0.820333071756786\nSPY,20120521,5347600.0,5615400.0,5340500.0,5612800.0,21912594.0,,\nQQQ,20120521,609300.0,625700.0,608500.0,625100.0,53185463.0,0.9229351173557586,0.8264605162139497\nSPY,20120522,5699000.0,5738800.0,5525800.0,5569700.0,24111373.0,,\nQQQ,20120522,626900.0,629400.0,619900.0,624400.0,50607821.0,0.9234764948663764,0.8312398403784687\nSPY,20120523,5573300.0,5728000.0,5532300.0,5705600.0,20316323.0,,\nQQQ,20120523,619100.0,627100.0,613700.0,625600.0,54900351.0,0.9236317406174496,0.8349217234329579\nSPY,20120524,5760000.0,5765000.0,5612900.0,5653200.0,17188820.0,,\nQQQ,20120524,626500.0,627100.0,616900.0,621500.0,78964489.0,0.923697336394421,0.8390887751913688\nSPY,20120525,5646100.0,5658500.0,5584800.0,5622900.0,11469366.0,,\nQQQ,20120525,622100.0,623200.0,618900.0,620700.0,30066834.0,0.9240898690125181,0.8439685825186783\nSPY,20120529,5709000.0,5740000.0,5653100.0,5722700.0,13219037.0,,\nQQQ,20120529,626500.0,631500.0,622800.0,628600.0,42850613.0,0.9248631777553341,0.8491224689206143\nSPY,20120530,5692000.0,5799900.0,5665600.0,5791700.0,18504462.0,,\nQQQ,20120530,622900.0,625500.0,616800.0,623200.0,51204984.0,0.9254702065343987,0.8554836530247351\nSPY,20120531,5810000.0,5815000.0,5714600.0,5777300.0,16778221.0,,\nQQQ,20120531,622500.0,624100.0,615900.0,620600.0,53276145.0,0.925153917756269,0.8594722346880406\nSPY,20120601,5690000.0,5726500.0,5605200.0,5609900.0,17728939.0,,\nQQQ,20120601,609400.0,613200.0,603900.0,604100.0,64069771.0,0.9242051384141832,0.8637723891434314\nSPY,20120604,5615000.0,5675000.0,5485000.0,5642900.0,19516231.0,,\nQQQ,20120604,605800.0,609600.0,600400.0,608700.0,62970181.0,0.9231284696106736,0.8665994154398519\nSPY,20120605,5609800.0,5664700.0,5583300.0,5627000.0,13551771.0,,\nQQQ,20120605,606600.0,612400.0,606300.0,611200.0,44688151.0,0.9222160874840084,0.8687324330261035\nSPY,20120606,5678900.0,5738500.0,5655400.0,5717900.0,13984144.0,,\nQQQ,20120606,615800.0,625700.0,615200.0,625500.0,54662658.0,0.9220835789260347,0.8706813564596306\nSPY,20120607,5772900.0,5773200.0,5705100.0,5717200.0,13220825.0,,\nQQQ,20120607,631800.0,631800.0,622200.0,622700.0,36726970.0,0.9215905163719547,0.8721798168396494\nSPY,20120608,5711200.0,5805500.0,5690000.0,5803200.0,11906883.0,,\nQQQ,20120608,621700.0,629500.0,619600.0,628700.0,38502700.0,0.921322932164698,0.8738029195641747\nSPY,20120611,5876400.0,5885000.0,5706300.0,5715400.0,20446471.0,,\nQQQ,20120611,633500.0,633800.0,617700.0,618900.0,48551584.0,0.9203788983979703,0.8744800559745448\nSPY,20120612,5747100.0,5766200.0,5667000.0,5761600.0,15067518.0,,\nQQQ,20120612,621000.0,625900.0,616800.0,625600.0,45167200.0,0.919743985638425,0.8752375930052675\nSPY,20120613,5745000.0,5784500.0,5703800.0,5721600.0,9941396.0,,\nQQQ,20120613,623600.0,628500.0,619200.0,621300.0,47102026.0,0.919163874925432,0.8762737086929973\nSPY,20120614,5712400.0,5735000.0,5672600.0,5715300.0,12097754.0,,\nQQQ,20120614,621200.0,626100.0,618000.0,623900.0,56303765.0,0.9184209440630864,0.876412810410848\nSPY,20120615,5710000.0,5746200.0,5695500.0,5741300.0,11074060.0,,\nQQQ,20120615,623900.0,630800.0,623600.0,630100.0,36570234.0,0.9179003103887909,0.8765110439690067\nSPY,20120618,5709600.0,5878900.0,5703700.0,5857800.0,15326182.0,,\nQQQ,20120618,627300.0,637400.0,626300.0,635800.0,30886073.0,0.9173962143219488,0.876472214807148\nSPY,20120619,5834200.0,5900000.0,5831000.0,5874100.0,12491078.0,,\nQQQ,20120619,639000.0,645100.0,638500.0,642600.0,35630853.0,0.9173219098241165,0.8768653596654192\nSPY,20120620,5880100.0,5892200.0,5808000.0,5857500.0,12592364.0,,\nQQQ,20120620,643800.0,645700.0,638100.0,642900.0,49194238.0,0.9176750062668406,0.8782931206939252\nSPY,20120621,5857400.0,5882200.0,5774400.0,5776400.0,11455181.0,,\nQQQ,20120621,642400.0,643100.0,626200.0,626900.0,41450098.0,0.9172335871735242,0.8789057681520605\nSPY,20120622,5789400.0,5821900.0,5754400.0,5821000.0,9498743.0,,\nQQQ,20120622,629000.0,634300.0,627400.0,633500.0,27808501.0,0.9171696219914602,0.8799027262861984\nSPY,20120625,5773000.0,5798000.0,5703800.0,5707200.0,10654042.0,,\nQQQ,20120625,628300.0,628500.0,619500.0,621200.0,32252091.0,0.9163074967331835,0.8798107017237611\nSPY,20120626,5713300.0,5744900.0,5673300.0,5721700.0,9653714.0,,\nQQQ,20120626,623400.0,627000.0,620600.0,625200.0,29212542.0,0.9159514554248847,0.8805287064131041\nSPY,20120627,5750000.0,5767400.0,5719200.0,5745000.0,7064479.0,,\nQQQ,20120627,627600.0,631800.0,626900.0,629000.0,30497453.0,0.9161263881699663,0.8819714646609325\nSPY,20120628,5718500.0,5740000.0,5656500.0,5690500.0,9890478.0,,\nQQQ,20120628,624300.0,624700.0,615400.0,621900.0,45148433.0,0.9162385160654146,0.8837481262557968\nSPY,20120629,5780000.0,5840000.0,5742500.0,5840000.0,14283552.0,,\nQQQ,20120629,634000.0,641600.0,632100.0,641600.0,41144040.0,0.9175167506038117,0.8871551797225932\nSPY,20120702,5847300.0,5934700.0,5836000.0,5927100.0,14045633.0,,\nQQQ,20120702,642500.0,643800.0,638700.0,643600.0,30680753.0,0.9192214829316275,0.891711040476972\nSPY,20120703,5950000.0,6000000.0,5940000.0,5994100.0,8377002.0,,\nQQQ,20120703,643900.0,648900.0,642900.0,648900.0,15437730.0,0.9210815597437484,0.8972581052478255\nSPY,20120705,6002400.0,6143400.0,5996500.0,6099400.0,16805052.0,,\nQQQ,20120705,648300.0,652500.0,644800.0,649300.0,31506751.0,0.9229066101419521,0.9027511364357953\nSPY,20120706,6072500.0,6084400.0,6015800.0,6062300.0,14600915.0,,\nQQQ,20120706,646300.0,646900.0,636500.0,640900.0,33284419.0,0.9248754268386533,0.9079012686385322\nSPY,20120709,6053600.0,6139000.0,6041200.0,6138900.0,13111489.0,,\nQQQ,20120709,640500.0,642600.0,636800.0,640000.0,32944028.0,0.9263961717974027,0.9125519849928382\nSPY,20120710,6180000.0,6198700.0,6053200.0,6082100.0,17597329.0,,\nQQQ,20120710,643500.0,645000.0,631200.0,633700.0,43512723.0,0.9269914089383421,0.9155951438950627\nSPY,20120711,6061300.0,6075900.0,5972200.0,6044300.0,16204883.0,,\nQQQ,20120711,632900.0,634600.0,625000.0,630200.0,41678676.0,0.9271568624109194,0.9179388744159263\nSPY,20120712,6003300.0,6034700.0,5926900.0,5989000.0,15062839.0,,\nQQQ,20120712,625200.0,626900.0,618600.0,624200.0,51628007.0,0.9271336885409668,0.9200306473444015\nSPY,20120713,6029900.0,6071900.0,6000000.0,6049700.0,10850667.0,,\nQQQ,20120713,626000.0,635200.0,625600.0,633800.0,30505899.0,0.9271908809648901,0.921698741583295\nSPY,20120716,6052000.0,6116100.0,6050200.0,6069500.0,10555546.0,,\nQQQ,20120716,632400.0,635200.0,629500.0,632000.0,26765032.0,0.9273904640225956,0.9238782640148517\nSPY,20120717,6109000.0,6115000.0,6031700.0,6069400.0,10229627.0,,\nQQQ,20120717,636000.0,637400.0,626300.0,635400.0,37756030.0,0.9274151518938277,0.9251451755402629\nSPY,20120718,6067600.0,6083300.0,6035600.0,6062600.0,8578890.0,,\nQQQ,20120718,634100.0,645800.0,633900.0,644000.0,37115491.0,0.928671830031831,0.9278885882752241\nSPY,20120719,6112800.0,6153500.0,6060000.0,6144900.0,15151582.0,,\nQQQ,20120719,648400.0,653100.0,647200.0,651100.0,47864177.0,0.9296469169419753,0.9294876938259428\nSPY,20120720,6139600.0,6144400.0,6037000.0,6037000.0,13428545.0,,\nQQQ,20120720,650800.0,651000.0,642100.0,642800.0,37262421.0,0.9306700022747132,0.9305795098549446\nSPY,20120723,5950000.0,6059000.0,5877100.0,6038300.0,17014855.0,,\nQQQ,20120723,629900.0,636800.0,625100.0,634600.0,45625546.0,0.931519799164551,0.9303663713247159\nSPY,20120724,6075000.0,6096800.0,5985300.0,6012900.0,15646588.0,,\nQQQ,20120724,635700.0,636600.0,625500.0,629500.0,51212540.0,0.931922404249137,0.9295328869231141\nSPY,20120725,5748900.0,5808000.0,5700000.0,5749700.0,30072375.0,,\nQQQ,20120725,624700.0,629500.0,621500.0,625400.0,41543674.0,0.9326196681949073,0.9287455197421135\nSPY,20120726,5798200.0,5804000.0,5703600.0,5748800.0,14002905.0,,\nQQQ,20120726,634400.0,637300.0,629800.0,633800.0,38009342.0,0.933074469034679,0.9286141044110202\nSPY,20120727,5752200.0,5858300.0,5716100.0,5854500.0,14075533.0,,\nQQQ,20120727,638300.0,649900.0,636400.0,649400.0,37453412.0,0.9338696832532263,0.9291242191498426\nSPY,20120730,5910000.0,5994400.0,5878200.0,5950300.0,13104122.0,,\nQQQ,20120730,650300.0,653100.0,646000.0,648200.0,34613776.0,0.9345338286342051,0.929425293305945\nSPY,20120731,6030400.0,6117000.0,6027300.0,6107600.0,15939567.0,,\nQQQ,20120731,649200.0,651800.0,647400.0,648000.0,31813913.0,0.9348446875942734,0.9292483231917726\nSPY,20120801,6158300.0,6163900.0,6030000.0,6068100.0,13273690.0,,\nQQQ,20120801,652600.0,652700.0,643500.0,646100.0,25812266.0,0.9347761558884156,0.9287729034782755\nSPY,20120802,6030000.0,6106700.0,6002500.0,6077900.0,10859961.0,,\nQQQ,20120802,641200.0,650200.0,639100.0,643700.0,36673691.0,0.9347040362976556,0.9281057171291717\nSPY,20120803,6140000.0,6179800.0,6115600.0,6157000.0,11850359.0,,\nQQQ,20120803,654200.0,658800.0,651900.0,656100.0,36050002.0,0.9346533602289038,0.9277905964438999\nSPY,20120806,6171100.0,6248600.0,6152600.0,6225500.0,10608552.0,,\nQQQ,20120806,659400.0,663900.0,658000.0,661100.0,22631713.0,0.9346625969008899,0.9274239085058326\nSPY,20120807,6225000.0,6250000.0,6180400.0,6211100.0,10166999.0,,\nQQQ,20120807,663700.0,669200.0,662800.0,666700.0,26767704.0,0.9351217288018684,0.9270024798326345\nSPY,20120808,6190500.0,6238800.0,6171500.0,6198600.0,8514316.0,,\nQQQ,20120808,664800.0,667600.0,663700.0,666200.0,19135858.0,0.9353215676298255,0.9266500394831628\nSPY,20120809,6178500.0,6217300.0,6178100.0,6207300.0,7670673.0,,\nQQQ,20120809,666100.0,669100.0,664900.0,668200.0,19523612.0,0.9360181770035123,0.9262811019258433\nSPY,20120810,6187100.0,6217600.0,6187100.0,6216400.0,6833092.0,,\nQQQ,20120810,665800.0,668800.0,664100.0,668500.0,19168159.0,0.9362150554611679,0.9259939005346782\nSPY,20120813,6232800.0,6300000.0,6232500.0,6300000.0,9602650.0,,\nQQQ,20120813,668400.0,670300.0,665000.0,670300.0,18910475.0,0.9364046765584739,0.9259039157646004\nSPY,20120814,6320000.0,6386100.0,6302100.0,6316900.0,11861459.0,,\nQQQ,20120814,672700.0,674100.0,668600.0,670500.0,20286640.0,0.9365774321694519,0.9260463916505568\nSPY,20120815,6313000.0,6340000.0,6277500.0,6308300.0,8997692.0,,\nQQQ,20120815,670000.0,673100.0,669900.0,672300.0,22419947.0,0.9367729388326513,0.9261883189686744\nSPY,20120816,6311300.0,6367500.0,6305000.0,6363400.0,8930924.0,,\nQQQ,20120816,674700.0,681700.0,673900.0,680200.0,29030753.0,0.9370849031823871,0.9263868616302242\nSPY,20120817,6400000.0,6481900.0,6387800.0,6481100.0,15195845.0,,\nQQQ,20120817,681700.0,683300.0,680100.0,683200.0,21264247.0,0.9380215380542536,0.9263921107398441\nSPY,20120820,6500100.0,6651500.0,6499000.0,6651500.0,21294888.0,,\nQQQ,20120820,682700.0,684300.0,680000.0,684200.0,22313144.0,0.9391646971205689,0.9263921107398441\nSPY,20120821,6708400.0,6748800.0,6503300.0,6562300.0,28358870.0,,\nQQQ,20120821,686000.0,688800.0,678800.0,681400.0,37157407.0,0.940209916524196,0.9263553669725055\nSPY,20120822,6545200.0,6690000.0,6481100.0,6688700.0,19807396.0,,\nQQQ,20120822,680000.0,685600.0,678100.0,684000.0,40101626.0,0.9408533229923847,0.9264108575599147\nSPY,20120823,6661300.0,6699000.0,6611500.0,6623600.0,14068136.0,,\nQQQ,20120823,681200.0,683400.0,677000.0,678700.0,27052207.0,0.9413076445578797,0.9264356033624082\nSPY,20120824,6597700.0,6694800.0,6555500.0,6633500.0,14967165.0,,\nQQQ,20120824,677100.0,684500.0,676000.0,682900.0,35213527.0,0.9421499302486132,0.9264813456033805\nSPY,20120827,6799900.0,6808700.0,6735400.0,6757000.0,14137325.0,,\nQQQ,20120827,685800.0,686700.0,682500.0,684000.0,19744080.0,0.9427110718630942,0.9268039646552099\nSPY,20120828,6748000.0,6761000.0,6707000.0,6748000.0,9332639.0,,\nQQQ,20120828,683400.0,685800.0,681100.0,684000.0,28985608.0,0.9430114523756031,0.9273608919325694\nSPY,20120829,6752500.0,6776700.0,6726100.0,6736300.0,6995835.0,,\nQQQ,20120829,684000.0,685700.0,681100.0,684000.0,20575956.0,0.943259959398156,0.927843729220946\nSPY,20120830,6706400.0,6715500.0,6628600.0,6640600.0,10316886.0,,\nQQQ,20120830,681000.0,681300.0,676000.0,677000.0,23632687.0,0.9433110753857469,0.928066441860902\nSPY,20120831,6672700.0,6685900.0,6572500.0,6652400.0,11584140.0,,\nQQQ,20120831,682000.0,684500.0,674700.0,681600.0,35385449.0,0.9434522788031762,0.9282677830859132\nSPY,20120904,6657900.0,6751400.0,6645500.0,6745700.0,12882979.0,,\nQQQ,20120904,680300.0,683500.0,674200.0,680900.0,29397848.0,0.9436428530943897,0.9282055435265988\nSPY,20120905,6754000.0,6763500.0,6696000.0,6702300.0,11577787.0,,\nQQQ,20120905,680600.0,683500.0,678400.0,680200.0,23918420.0,0.9439459429371074,0.9282600834269655\nSPY,20120906,6733300.0,6782800.0,6708000.0,6765600.0,13673109.0,,\nQQQ,20120906,684400.0,695400.0,684200.0,695000.0,40867097.0,0.9442573669870664,0.928509791585244\nSPY,20120907,6780500.0,6824800.0,6757800.0,6805000.0,11390113.0,,\nQQQ,20120907,693700.0,695500.0,692300.0,694300.0,27713573.0,0.944600490188541,0.9287448771937138\nSPY,20120910,6804500.0,6832900.0,6621000.0,6627400.0,16931103.0,,\nQQQ,20120910,692500.0,694000.0,684900.0,685500.0,24396248.0,0.9449680621719996,0.9287579999948244\nSPY,20120911,6652700.0,6701000.0,6565000.0,6605900.0,17306070.0,,\nQQQ,20120911,685500.0,688200.0,683200.0,684300.0,27143461.0,0.9451693636828478,0.9288637322780596\nSPY,20120912,6668500.0,6699000.0,6560000.0,6697200.0,24669333.0,,\nQQQ,20120912,686800.0,688100.0,682100.0,686600.0,40555722.0,0.945346686123425,0.9290675239307636\nSPY,20120913,6773600.0,6855000.0,6747700.0,6830900.0,20407922.0,,\nQQQ,20120913,686900.0,698500.0,686200.0,695800.0,44038688.0,0.9456109419081732,0.9295002013491304\nSPY,20120914,6899700.0,6969800.0,6878900.0,6912800.0,20536354.0,,\nQQQ,20120914,698100.0,704300.0,697900.0,701900.0,36946349.0,0.9459611552300597,0.930043485213267\nSPY,20120917,6993300.0,6998000.0,6946100.0,6998000.0,13007527.0,,\nQQQ,20120917,702200.0,702400.0,699600.0,702100.0,29362698.0,0.9463727070706315,0.9306754546980398\nSPY,20120918,6999000.0,7023300.0,6964200.0,7019500.0,12744766.0,,\nQQQ,20120918,700300.0,703000.0,700200.0,702700.0,25058283.0,0.9468150526682549,0.9313597147851167\nSPY,20120919,7004500.0,7039900.0,6995700.0,7021000.0,11198269.0,,\nQQQ,20120919,702600.0,705800.0,700600.0,704000.0,29978142.0,0.9472743494461967,0.9321287106418811\nSPY,20120920,6991700.0,7000600.0,6936200.0,6987900.0,11670337.0,,\nQQQ,20120920,700600.0,704000.0,698700.0,703200.0,29054672.0,0.9478337737099204,0.9331279178375304\nSPY,20120921,7025600.0,7050700.0,6993700.0,7007100.0,18186568.0,,\nQQQ,20120921,704800.0,705400.0,700800.0,701800.0,21632845.0,0.9487837429227688,0.9341364984590301\nSPY,20120924,6869100.0,6951200.0,6830000.0,6898800.0,21746945.0,,\nQQQ,20120924,695700.0,698600.0,694300.0,696800.0,28205592.0,0.9494763463504946,0.9351690750507069\nSPY,20120925,6880000.0,6927800.0,6730000.0,6737000.0,17924953.0,,\nQQQ,20120925,699200.0,700800.0,687300.0,687600.0,39282700.0,0.949810073031381,0.9358829551634709\nSPY,20120926,6686300.0,6726800.0,6612000.0,6650000.0,19467086.0,,\nQQQ,20120926,686700.0,687100.0,678600.0,682000.0,31348419.0,0.9498847026215078,0.936269890182574\nSPY,20120927,6642900.0,6821600.0,6603500.0,6814100.0,20650880.0,,\nQQQ,20120927,683700.0,693000.0,682500.0,691600.0,23492190.0,0.9502118215920894,0.9367576832638274\nSPY,20120928,6787500.0,6811100.0,6667700.0,6672600.0,18444141.0,,\nQQQ,20120928,689100.0,691200.0,685100.0,685800.0,27258871.0,0.9505415597900282,0.937082753672318\nSPY,20121001,6715000.0,6767500.0,6565000.0,6597300.0,18985664.0,,\nQQQ,20121001,689000.0,693300.0,682500.0,684700.0,33653093.0,0.9512058615604913,0.9371015005240189\nSPY,20121002,6621600.0,6663500.0,6506500.0,6613100.0,22051196.0,,\nQQQ,20121002,687700.0,689800.0,681400.0,686700.0,30198566.0,0.9525651410474035,0.9369811457361001\nSPY,20121003,6651400.0,6718600.0,6626300.0,6717400.0,14368331.0,,\nQQQ,20121003,688600.0,692400.0,685900.0,690900.0,34352509.0,0.9532780872277882,0.9369492760882088\nSPY,20121004,6712500.0,6742300.0,6655500.0,6668000.0,12724261.0,,\nQQQ,20121004,692200.0,695400.0,690000.0,693500.0,21279480.0,0.953517906192185,0.9369005342737868\nSPY,20121005,6650000.0,6660000.0,6512800.0,6526500.0,20632462.0,,\nQQQ,20121005,697000.0,698000.0,688100.0,689800.0,23591888.0,0.9533811541797276,0.9367194396863577\nSPY,20121008,6470000.0,6475600.0,6361100.0,6381700.0,22316409.0,,\nQQQ,20121008,685700.0,687200.0,682000.0,683500.0,28687851.0,0.9531250034316123,0.9366268302389561\nSPY,20121009,6386400.0,6404900.0,6235600.0,6358500.0,29263275.0,,\nQQQ,20121009,681400.0,681800.0,671000.0,672600.0,53433015.0,0.9528988013697727,0.9366588992305344\nSPY,20121010,6397600.0,6449800.0,6370000.0,6409100.0,17688869.0,,\nQQQ,20121010,672400.0,674300.0,668000.0,669200.0,44123172.0,0.9526899409572527,0.9366109072991775\nSPY,20121011,6467500.0,6472000.0,6281000.0,6281000.0,19097475.0,,\nQQQ,20121011,674200.0,674700.0,666700.0,667100.0,27871688.0,0.9524748076828822,0.9364579330179772\nSPY,20121012,6299200.0,6353800.0,6253000.0,6295600.0,16054488.0,,\nQQQ,20121012,667000.0,670600.0,665500.0,666800.0,23416702.0,0.9522821533816369,0.9361904035328109\nSPY,20121015,6323000.0,6351300.0,6238600.0,6347600.0,15190898.0,,\nQQQ,20121015,669300.0,672600.0,665300.0,671600.0,21166650.0,0.9522193405696667,0.9360666743115856\nSPY,20121016,6356300.0,6503000.0,6310000.0,6496100.0,19021255.0,,\nQQQ,20121016,672700.0,682000.0,672500.0,681500.0,28134152.0,0.9521714397443859,0.9361861037192758\nSPY,20121017,6492900.0,6527900.0,6440000.0,6446800.0,13402452.0,,\nQQQ,20121017,677700.0,683000.0,676800.0,681000.0,31303904.0,0.9521154818895382,0.9361714811776904\nSPY,20121018,6400000.0,6420600.0,6300000.0,6325100.0,16605231.0,,\nQQQ,20121018,678600.0,680700.0,670400.0,673200.0,55260383.0,0.9518846145908864,0.9362213477938659\nSPY,20121019,6314500.0,6317700.0,6096200.0,6098000.0,25784603.0,,\nQQQ,20121019,672100.0,672700.0,656000.0,656600.0,59625000.0,0.9515066568140395,0.9358029181423477\nSPY,20121022,6124200.0,6353800.0,6108500.0,6340300.0,18642527.0,,\nQQQ,20121022,656500.0,661900.0,655000.0,660200.0,32936008.0,0.9511424349673501,0.9350301730601079\nSPY,20121023,6311500.0,6339000.0,6117000.0,6133900.0,24789449.0,,\nQQQ,20121023,654800.0,659500.0,651900.0,653900.0,43623312.0,0.9510259137606016,0.9343549115884371\nSPY,20121024,6214400.0,6265500.0,6106400.0,6164800.0,19530413.0,,\nQQQ,20121024,657400.0,658700.0,650600.0,651200.0,34929069.0,0.9505567552165216,0.9337100200108283\nSPY,20121025,6200000.0,6220000.0,6055600.0,6098000.0,19581822.0,,\nQQQ,20121025,656300.0,657200.0,649700.0,651600.0,31951144.0,0.9501321617834204,0.9330818005823466\nSPY,20121026,6094300.0,6140000.0,5910000.0,6040000.0,34797165.0,,\nQQQ,20121026,651600.0,656200.0,646600.0,653500.0,44286059.0,0.9502022298846671,0.9322910583776095\nSPY,20121031,5944900.0,6019600.0,5877000.0,5951000.0,17726394.0,,\nQQQ,20121031,652700.0,653900.0,647300.0,649500.0,33458499.0,0.9502956924563005,0.9314362019400558\nSPY,20121101,5982500.0,6030000.0,5941800.0,5968000.0,12483719.0,,\nQQQ,20121101,653600.0,660000.0,651700.0,659000.0,23978633.0,0.9500603624114567,0.9304921104884069\nSPY,20121102,5960900.0,5969500.0,5747500.0,5766700.0,20926677.0,,\nQQQ,20121102,661700.0,662100.0,651100.0,651300.0,34921840.0,0.9495441713637005,0.9294505354079137\nSPY,20121105,5832900.0,5877700.0,5776000.0,5848000.0,17495751.0,,\nQQQ,20121105,651800.0,657300.0,650500.0,655900.0,25224623.0,0.9490600918607214,0.9284978204044821\nSPY,20121106,5902500.0,5907200.0,5800900.0,5828600.0,13019316.0,,\nQQQ,20121106,657100.0,661700.0,654600.0,657500.0,28572692.0,0.9487770809280106,0.9273985050207508\nSPY,20121107,5739500.0,5745400.0,5557500.0,5579900.0,27725729.0,,\nQQQ,20121107,650200.0,651000.0,639100.0,641700.0,53586406.0,0.9484427274550976,0.9257339581363973\nSPY,20121108,5606500.0,5622300.0,5353000.0,5372600.0,36951238.0,,\nQQQ,20121108,643500.0,645000.0,631600.0,631600.0,50947971.0,0.9482572490384569,0.9246308931755352\nSPY,20121109,5400100.0,5548800.0,5337300.0,5470600.0,32125076.0,,\nQQQ,20121109,632000.0,641100.0,631600.0,634300.0,42488190.0,0.9482833527434329,0.9230548306335239\nSPY,20121112,5543800.0,5545000.0,5386500.0,5428900.0,17877737.0,,\nQQQ,20121112,638000.0,638700.0,632500.0,634200.0,28916502.0,0.9477241141237422,0.921610572636991\nSPY,20121113,5390900.0,5504800.0,5363700.0,5425900.0,18180830.0,,\nQQQ,20121113,629300.0,635800.0,627900.0,630000.0,36400463.0,0.9471729151048154,0.9204432206575642\nSPY,20121114,5455000.0,5474400.0,5361800.0,5369300.0,16194558.0,,\nQQQ,20121114,632900.0,633600.0,621400.0,622500.0,56182834.0,0.9470011221585143,0.919869191950875\nSPY,20121115,5375300.0,5395000.0,5226200.0,5260500.0,27772842.0,,\nQQQ,20121115,622800.0,624900.0,618000.0,620300.0,42096592.0,0.9467734650680046,0.9195598688398243\nSPY,20121116,5251200.0,5300000.0,5057600.0,5277200.0,44120265.0,,\nQQQ,20121116,620800.0,624700.0,613100.0,622500.0,58234840.0,0.9467344039145786,0.9190508765460433\nSPY,20121119,5406200.0,5675000.0,5398800.0,5664400.0,28102967.0,,\nQQQ,20121119,629800.0,638300.0,629600.0,637800.0,38198026.0,0.9462699870480147,0.9175526275963691\nSPY,20121120,5715600.0,5719500.0,5545800.0,5611500.0,22065070.0,,\nQQQ,20121120,637600.0,638900.0,631900.0,638000.0,49504314.0,0.9454515957894595,0.9157516326714092\nSPY,20121121,5642500.0,5673700.0,5566000.0,5617000.0,12928182.0,,\nQQQ,20121121,638700.0,640200.0,636000.0,639300.0,17220668.0,0.944530590278926,0.9139103165521725\nSPY,20121123,5673900.0,5720000.0,5626000.0,5717500.0,9235447.0,,\nQQQ,20121123,642900.0,649200.0,642600.0,648800.0,14765872.0,0.9434647170965275,0.9121841061239572\nSPY,20121126,5759000.0,5900000.0,5737100.0,5892700.0,21840748.0,,\nQQQ,20121126,647400.0,652100.0,645400.0,652000.0,25751224.0,0.9425008427109972,0.911000804622774\nSPY,20121127,5896000.0,5904000.0,5801000.0,5848900.0,17837350.0,,\nQQQ,20121127,651700.0,654000.0,648500.0,649600.0,24818422.0,0.9415403886644556,0.9097668866125096\nSPY,20121128,5772400.0,5858000.0,5722600.0,5829400.0,17776953.0,,\nQQQ,20121128,646500.0,655700.0,642500.0,655200.0,35557704.0,0.9405389000562343,0.9084343601438134\nSPY,20121129,5902700.0,5942500.0,5852500.0,5893600.0,17623122.0,,\nQQQ,20121129,658700.0,661300.0,655800.0,659100.0,37418115.0,0.9393513183903093,0.9071329534547743\nSPY,20121130,5866000.0,5884000.0,5827200.0,5852800.0,13038466.0,,\nQQQ,20121130,659400.0,659700.0,656100.0,658000.0,31125755.0,0.9380685721495707,0.9057265643765304\nSPY,20121203,5937000.0,5945800.0,5855000.0,5861400.0,12575950.0,,\nQQQ,20121203,663100.0,663700.0,656500.0,657200.0,25878210.0,0.9369688711992422,0.9044229080648654\nSPY,20121204,5817900.0,5818400.0,5721300.0,5758500.0,21944437.0,,\nQQQ,20121204,657000.0,657700.0,652000.0,655800.0,44808964.0,0.9358381592354628,0.9027308169131418\nSPY,20121205,5689000.0,5692600.0,5387700.0,5388100.0,36073366.0,,\nQQQ,20121205,655300.0,655500.0,645500.0,649100.0,47567533.0,0.9341776033925161,0.8997339446384404\nSPY,20121206,5289000.0,5533100.0,5187200.0,5472800.0,40918651.0,,\nQQQ,20121206,647000.0,654800.0,645300.0,652800.0,39736556.0,0.9326605030725249,0.896302895196955\nSPY,20121207,5534700.0,5552000.0,5300000.0,5330800.0,27188442.0,,\nQQQ,20121207,656400.0,657100.0,647100.0,649200.0,27348745.0,0.9308649293004759,0.8930705624207508\nSPY,20121210,5250000.0,5385100.0,5215800.0,5297700.0,21743087.0,,\nQQQ,20121210,647500.0,654600.0,647500.0,651200.0,28014274.0,0.9287601906648255,0.8890832729923352\nSPY,20121211,5397000.0,5495500.0,5373700.0,5410000.0,20465346.0,,\nQQQ,20121211,655700.0,663400.0,655200.0,659700.0,35501364.0,0.9260107665857662,0.8843013242675741\nSPY,20121212,5478600.0,5480000.0,5362800.0,5387700.0,16921575.0,,\nQQQ,20121212,663200.0,663200.0,656500.0,658300.0,42455798.0,0.9234366856231984,0.8796123599621117\nSPY,20121213,5311500.0,5376100.0,5258100.0,5296900.0,21432294.0,,\nQQQ,20121213,657000.0,661600.0,650300.0,653300.0,39545132.0,0.9206453048782516,0.8751281113539775\nSPY,20121214,5150000.0,5181300.0,5055800.0,5089700.0,34139379.0,,\nQQQ,20121214,648700.0,650800.0,644700.0,646900.0,37638441.0,0.9173617857679929,0.871523628741462\nSPY,20121217,5089200.0,5200000.0,5012300.0,5191700.0,25879436.0,,\nQQQ,20121217,647500.0,655700.0,646600.0,655500.0,38906421.0,0.9132725294533327,0.8663607428794312\nSPY,20121218,5252700.0,5349000.0,5202500.0,5340000.0,21223024.0,,\nQQQ,20121218,658800.0,666500.0,657000.0,665700.0,49257715.0,0.9085096612210353,0.8602215204317261\nSPY,20121219,5313700.0,5337000.0,5255000.0,5261000.0,15413507.0,,\nQQQ,20121219,667400.0,667600.0,662200.0,662400.0,32478335.0,0.9035141747519053,0.8538697085661728\nSPY,20121220,5301500.0,5302000.0,5188800.0,5219800.0,17133161.0,,\nQQQ,20121220,663800.0,664100.0,659300.0,662600.0,34733567.0,0.8981146375995503,0.8472053578635383\nSPY,20121221,5126900.0,5196700.0,5102400.0,5193300.0,19546914.0,,\nQQQ,20121221,648800.0,652800.0,646000.0,651700.0,44719518.0,0.8939964147392881,0.8421594514759572\nSPY,20121224,5201500.0,5242500.0,5187100.0,5199600.0,6010014.0,,\nQQQ,20121224,650300.0,651400.0,649200.0,650700.0,9921678.0,0.8899495451135319,0.8374483641108242\nSPY,20121226,5186600.0,5194500.0,5111200.0,5131000.0,10578011.0,,\nQQQ,20121226,651200.0,651800.0,642900.0,645000.0,20958811.0,0.8860245251894099,0.8336806190306634\nSPY,20121227,5135400.0,5162100.0,5046600.0,5150600.0,15911136.0,,\nQQQ,20121227,645600.0,646400.0,636000.0,644000.0,44967714.0,0.8822303897402594,0.8299865172614783\nSPY,20121228,5102300.0,5144800.0,5081200.0,5094100.0,12188158.0,,\nQQQ,20121228,639100.0,644300.0,637500.0,637800.0,30401612.0,0.8787746295606219,0.8271967632505286\nSPY,20121231,5100900.0,5354000.0,5090000.0,5330300.0,22747864.0,,\nQQQ,20121231,637100.0,652500.0,635800.0,651100.0,53485109.0,0.874665794498511,0.8225743135663363\nSPY,20130102,5540000.0,5550000.0,5416500.0,5490300.0,18991235.0,,\nQQQ,20130102,667300.0,672300.0,664800.0,672000.0,51501317.0,0.8685828141887348,0.8150073244157992\nSPY,20130103,5479500.0,5496600.0,5410000.0,5424400.0,12168029.0,,\nQQQ,20130103,671900.0,673400.0,666500.0,668700.0,38927150.0,0.8622560474339092,0.8076513529736967\nSPY,20130104,5371500.0,5385900.0,5258300.0,5270200.0,20550185.0,,\nQQQ,20130104,668800.0,668800.0,664700.0,666300.0,29237113.0,0.855063500426776,0.7999527578650275\nSPY,20130107,5220500.0,5293000.0,5152000.0,5241600.0,16901452.0,,\nQQQ,20130107,664500.0,667600.0,662500.0,666800.0,24407789.0,0.8473047525834311,0.7917668141493533\nSPY,20130108,5288700.0,5318900.0,5212500.0,5252100.0,15647990.0,,\nQQQ,20130108,666400.0,668200.0,661700.0,665600.0,25491910.0,0.8397678916502886,0.7839099909266185\nSPY,20130109,5227100.0,5250100.0,5159900.0,5171000.0,14063812.0,,\nQQQ,20130109,666200.0,669500.0,665500.0,667700.0,22695693.0,0.8309794487995562,0.7750734550300105\nSPY,20130110,5285000.0,5287200.0,5155200.0,5236800.0,20521047.0,,\nQQQ,20130110,672300.0,672700.0,665500.0,671700.0,36088156.0,0.82141657759352,0.7648016569383833\nSPY,20130111,5211400.0,5253200.0,5190200.0,5203000.0,12090440.0,,\nQQQ,20130111,671400.0,672900.0,670000.0,672600.0,18988373.0,0.8110519980580225,0.753743755422043\nSPY,20130114,5030000.0,5075000.0,4985100.0,5017500.0,24311151.0,,\nQQQ,20130114,669200.0,671500.0,666700.0,669600.0,35140604.0,0.7990678815747607,0.7429174221799996\nSPY,20130115,4980400.0,4989900.0,4833800.0,4859200.0,30553382.0,,\nQQQ,20130115,666300.0,667200.0,663400.0,666300.0,26269574.0,0.7858578077144984,0.7331234305469193\nSPY,20130116,4947100.0,5094300.0,4925000.0,5060900.0,23537030.0,,\nQQQ,20130116,667200.0,671300.0,666000.0,669000.0,26310674.0,0.7733097943308352,0.7225558025077273\nSPY,20130117,5104300.0,5107500.0,5020300.0,5026800.0,15520871.0,,\nQQQ,20130117,671700.0,674800.0,670600.0,672200.0,29794841.0,0.7594867607625228,0.7104224333050914\nSPY,20130118,4983500.0,5022200.0,4964000.0,5000000.0,16243482.0,,\nQQQ,20130118,670200.0,671400.0,667700.0,670700.0,28834310.0,0.7462478470959194,0.6985428971406862\nSPY,20130122,5045500.0,5078800.0,4966300.0,5047700.0,15533026.0,,\nQQQ,20130122,671400.0,672300.0,667300.0,671800.0,26326796.0,0.7332023895352714,0.6864575200043628\nSPY,20130123,5088100.0,5149900.0,5047700.0,5141700.0,21860651.0,,\nQQQ,20130123,675600.0,677900.0,674600.0,675900.0,26232049.0,0.7191706737832155,0.673695754683448\nSPY,20130124,4600000.0,4657300.0,4502500.0,4504700.0,49071326.0,,\nQQQ,20130124,666600.0,672800.0,665600.0,666600.0,39220362.0,0.6997466419663642,0.6623190104012695\nSPY,20130125,4518100.0,4562300.0,4350000.0,4398800.0,41366875.0,,\nQQQ,20130125,668700.0,671900.0,667400.0,670000.0,37731048.0,0.6761539476162949,0.6485817779470936\nSPY,20130128,4376000.0,4532100.0,4359000.0,4495500.0,27131161.0,,\nQQQ,20130128,670100.0,673800.0,669300.0,671500.0,26475197.0,0.6553087846114791,0.6346130845273107\nSPY,20130129,4583700.0,4602000.0,4521200.0,4582700.0,19665519.0,,\nQQQ,20130129,670700.0,673100.0,666300.0,671600.0,30720184.0,0.6349901167854182,0.6209410835434017\nSPY,20130130,4571400.0,4625900.0,4545000.0,4568300.0,14314262.0,,\nQQQ,20130130,672800.0,674800.0,668700.0,670200.0,31990436.0,0.6151990755354476,0.6078354951461059\nSPY,20130131,4568000.0,4592800.0,4549800.0,4553100.0,10880568.0,,\nQQQ,20130131,669900.0,673500.0,668100.0,668900.0,27642487.0,0.5958965084814581,0.595165584889156\nSPY,20130201,4593300.0,4594800.0,4483600.0,4537300.0,18969321.0,,\nQQQ,20130201,673400.0,677700.0,670700.0,676600.0,34271506.0,0.5728536852684684,0.5798838554190815\nSPY,20130204,4535600.0,4559300.0,4420000.0,4422100.0,16535820.0,,\nQQQ,20130204,672700.0,674500.0,664600.0,664800.0,37613556.0,0.554566198588873,0.5694624492995289\nSPY,20130205,4443000.0,4597400.0,4422200.0,4578700.0,20035126.0,,\nQQQ,20130205,667700.0,676700.0,666100.0,674800.0,29882634.0,0.533853907071784,0.5546823870857222\nSPY,20130206,4564500.0,4665000.0,4525900.0,4573500.0,20760382.0,,\nQQQ,20130206,672400.0,675500.0,670400.0,672400.0,36961001.0,0.5160048630833809,0.5411594925178538\nSPY,20130207,4632500.0,4700000.0,4541200.0,4682500.0,23626763.0,,\nQQQ,20130207,673200.0,673700.0,665600.0,673000.0,37608724.0,0.49922176502258114,0.527402735411354\nSPY,20130208,4739500.0,4788100.0,4702500.0,4749800.0,21581855.0,,\nQQQ,20130208,676400.0,681300.0,676300.0,679900.0,31070401.0,0.480750933952909,0.5130031365562091\nSPY,20130211,4765000.0,4849200.0,4732500.0,4799300.0,17788322.0,,\nQQQ,20130211,680300.0,680600.0,677800.0,680100.0,17048942.0,0.46382507706488685,0.4993496698959037\nSPY,20130212,4795100.0,4823800.0,4677500.0,4678400.0,21255081.0,,\nQQQ,20130212,679200.0,680500.0,676600.0,677300.0,20341824.0,0.4481111702710974,0.4869429685522111\nSPY,20130213,4672400.0,4736400.0,4632200.0,4670100.0,16653578.0,,\nQQQ,20130213,679300.0,682300.0,677700.0,679700.0,22219188.0,0.43062231585618593,0.47366191158647264\nSPY,20130214,4645200.0,4716300.0,4640200.0,4665900.0,11404756.0,,\nQQQ,20130214,676600.0,680500.0,676200.0,679500.0,22526457.0,0.41468329066950205,0.46181649256104856\nSPY,20130215,4690700.0,4701600.0,4599200.0,4602500.0,13658262.0,,\nQQQ,20130215,679400.0,681100.0,675600.0,677500.0,22779254.0,0.39956758765585204,0.4507899383205935\nSPY,20130219,4611000.0,4627300.0,4538500.0,4599900.0,15143804.0,,\nQQQ,20130219,678800.0,682600.0,678600.0,682300.0,20352831.0,0.3812785766638021,0.4367789587798899\nSPY,20130220,4575000.0,4576900.0,4488000.0,4490700.0,16290123.0,,\nQQQ,20130220,682200.0,682500.0,671800.0,671900.0,34691421.0,0.368322495723207,0.4281325901655221\nSPY,20130221,4456000.0,4491700.0,4428200.0,4460700.0,15245390.0,,\nQQQ,20130221,669400.0,670100.0,662300.0,664700.0,42395558.0,0.3581369851372014,0.42265166390028497\nSPY,20130222,4492500.0,4516000.0,4466300.0,4508100.0,11336122.0,,\nQQQ,20130222,668500.0,671500.0,665900.0,671500.0,20086730.0,0.34638200372025624,0.4149400136422038\nSPY,20130225,4538000.0,4551200.0,4425700.0,4428000.0,12693350.0,,\nQQQ,20130225,675700.0,678100.0,662500.0,663100.0,35795017.0,0.33738639085794303,0.4099315887800858\nSPY,20130226,4440000.0,4515400.0,4376600.0,4489000.0,17567685.0,,\nQQQ,20130226,664000.0,666800.0,659600.0,665600.0,40470990.0,0.3286381078261375,0.4053484198604096\nSPY,20130227,4489700.0,4524400.0,4406600.0,4445700.0,20624698.0,,\nQQQ,20130227,665600.0,676500.0,664700.0,672300.0,32802752.0,0.3173846148630123,0.39770125286665314\nSPY,20130228,4440000.0,4478700.0,4414000.0,4414000.0,10867099.0,,\nQQQ,20130228,672500.0,677400.0,671000.0,671000.0,24045864.0,0.3069280366591924,0.3913366740441356\nSPY,20130301,4380000.0,4381400.0,4299800.0,4305100.0,19050526.0,,\nQQQ,20130301,668700.0,675000.0,665400.0,673800.0,29589120.0,0.29548534308207036,0.38429758109486045\nSPY,20130304,4277000.0,4281900.0,4190000.0,4200500.0,20203392.0,,\nQQQ,20130304,671600.0,676900.0,670700.0,676800.0,18359784.0,0.2819328440085012,0.3770537011103904\nSPY,20130305,4211700.0,4351900.0,4207500.0,4311700.0,22085443.0,,\nQQQ,20130305,680800.0,687700.0,680800.0,686800.0,31181738.0,0.2655527265553692,0.36513959326127693\nSPY,20130306,4347700.0,4352500.0,4244300.0,4256500.0,15912520.0,,\nQQQ,20130306,688900.0,689000.0,684200.0,685000.0,27942851.0,0.24993483956323215,0.3538884468873565\nSPY,20130307,4244600.0,4320100.0,4210600.0,4304000.0,16360004.0,,\nQQQ,20130307,685900.0,688000.0,684600.0,686900.0,18570291.0,0.23360092205335778,0.3413182678240382\nSPY,20130308,4300000.0,4354300.0,4286100.0,4317200.0,13335096.0,,\nQQQ,20130308,689200.0,690200.0,685000.0,687500.0,23300919.0,0.21696537058961185,0.3284612610155836\nSPY,20130311,4297000.0,4390100.0,4251400.0,4378700.0,16202327.0,,\nQQQ,20130311,686800.0,689900.0,684700.0,689700.0,20129831.0,0.2009481903136745,0.3157249843168465\nSPY,20130312,4358100.0,4388800.0,4275700.0,4284300.0,16228727.0,,\nQQQ,20130312,687700.0,689200.0,683900.0,687200.0,21415708.0,0.1864403954579178,0.3040437837943361\nSPY,20130313,4284300.0,4345000.0,4253600.0,4283500.0,14189143.0,,\nQQQ,20130313,688100.0,688900.0,683900.0,686300.0,30606728.0,0.17302793289296362,0.29326730921824906\nSPY,20130314,4328800.0,4346300.0,4304500.0,4324300.0,10320830.0,,\nQQQ,20130314,688700.0,690100.0,687200.0,688700.0,26684228.0,0.15956830059118726,0.28211289690739416\nSPY,20130315,4378800.0,4442300.0,4372500.0,4438500.0,21526106.0,,\nQQQ,20130315,687500.0,687900.0,683400.0,685100.0,28059529.0,0.1494260516279207,0.2723809491737493\nSPY,20130318,4414500.0,4574600.0,4412000.0,4557200.0,20915314.0,,\nQQQ,20130318,678800.0,686300.0,677300.0,683600.0,34527111.0,0.14077574741124524,0.2620386550056448\nSPY,20130319,4595000.0,4609700.0,4485100.0,4544900.0,18163618.0,,\nQQQ,20130319,685700.0,687000.0,676200.0,682400.0,30993355.0,0.13261825411104994,0.2521930120616276\nSPY,20130320,4575000.0,4576300.0,4496000.0,4520800.0,10613519.0,,\nQQQ,20130320,687100.0,688600.0,683900.0,686800.0,25454493.0,0.12305082888663718,0.2405024919369796\nSPY,20130321,4502200.0,4579700.0,4501500.0,4527300.0,13384420.0,,\nQQQ,20130321,680800.0,682500.0,677700.0,679300.0,28810626.0,0.11569108115393718,0.2316201668670893\nSPY,20130322,4546000.0,4621000.0,4531100.0,4618300.0,13694507.0,,\nQQQ,20130322,682100.0,686400.0,681300.0,685900.0,25921264.0,0.10684608182935429,0.2188572791247514\nSPY,20130325,4648000.0,4699500.0,4617800.0,4635800.0,17327661.0,,\nQQQ,20130325,688100.0,689600.0,680100.0,683200.0,23704292.0,0.09914815783977354,0.20809584915941606\nSPY,20130326,4654300.0,4658000.0,4605300.0,4610800.0,10032435.0,,\nQQQ,20130326,686000.0,687300.0,684500.0,687100.0,17487822.0,0.09046047579907135,0.19623655964795808\nSPY,20130327,4568000.0,4568000.0,4507500.0,4520800.0,11389781.0,,\nQQQ,20130327,682400.0,688500.0,681400.0,688300.0,21507882.0,0.081002408128918,0.18414690524601254\nSPY,20130328,4500000.0,4518100.0,4416200.0,4426300.0,14983197.0,,\nQQQ,20130328,688000.0,690600.0,686400.0,689700.0,20065356.0,0.06933966185665834,0.16818657223086367\nSPY,20130401,4420000.0,4436900.0,4277400.0,4289100.0,13558596.0,,\nQQQ,20130401,690200.0,690900.0,683100.0,685000.0,26433654.0,0.05798850623865788,0.15220673644363783\nSPY,20130402,4273000.0,4381400.0,4264000.0,4299000.0,18143258.0,,\nQQQ,20130402,688300.0,692700.0,687700.0,690400.0,23887778.0,0.04521251996597836,0.13536488613809206\nSPY,20130403,4316600.0,4372800.0,4303100.0,4318500.0,12713724.0,,\nQQQ,20130403,690800.0,691800.0,682400.0,684100.0,30686380.0,0.0355065481926796,0.12104372285356786\nSPY,20130404,4335500.0,4350000.0,4252500.0,4277200.0,12548487.0,,\nQQQ,20130404,683800.0,686000.0,680600.0,684300.0,25498178.0,0.02615496033248934,0.10843344809189673\nSPY,20130405,4246300.0,4249400.0,4196800.0,4231700.0,13322259.0,,\nQQQ,20130405,673500.0,679600.0,671900.0,678500.0,41910292.0,0.017128020863596723,0.09621533602558134\nSPY,20130408,4247900.0,4275000.0,4224900.0,4262100.0,10043543.0,,\nQQQ,20130408,678900.0,682400.0,676900.0,682200.0,15875018.0,0.006590775696876786,0.08187355848171064\nSPY,20130409,4263800.0,4285000.0,4227600.0,4269800.0,10567174.0,,\nQQQ,20130409,684000.0,689600.0,680900.0,686800.0,27067297.0,-0.0036632369354363662,0.06684699949225444\nSPY,20130410,4284700.0,4370500.0,4260100.0,4356900.0,13133731.0,,\nQQQ,20130410,689200.0,701700.0,688800.0,700200.0,43507204.0,-0.018086480052599246,0.04962495859394539\nSPY,20130411,4335000.0,4379900.0,4312000.0,4344000.0,11470851.0,,\nQQQ,20130411,698500.0,701500.0,697700.0,699700.0,32081397.0,-0.03135062143590286,0.03381043607092758\nSPY,20130412,4341500.0,4341500.0,4290900.0,4298000.0,8187983.0,,\nQQQ,20130412,698200.0,699900.0,694100.0,699400.0,27190869.0,-0.0426737421929484,0.02154357973517818\nSPY,20130415,4268500.0,4278900.0,4195500.0,4198500.0,10916909.0,,\nQQQ,20130415,696500.0,697900.0,684800.0,685500.0,44037024.0,-0.050682094128752166,0.011173538349917302\nSPY,20130416,4215100.0,4266100.0,4205700.0,4262400.0,10520619.0,,\nQQQ,20130416,689500.0,695500.0,688100.0,694700.0,24030900.0,-0.06187797414584704,-0.0036106558215382423\nSPY,20130417,4202600.0,4206000.0,3981100.0,4028000.0,32593294.0,,\nQQQ,20130417,688700.0,688800.0,677100.0,681000.0,50495161.0,-0.06830028234104195,-0.010201323157764838\nSPY,20130418,4050000.0,4057800.0,3897500.0,3919600.0,22913819.0,,\nQQQ,20130418,682900.0,683300.0,668800.0,671400.0,50205946.0,-0.07108397914098244,-0.013441540547113695\nSPY,20130419,3879900.0,3996000.0,3851000.0,3905000.0,21262851.0,,\nQQQ,20130419,673000.0,682300.0,672000.0,680900.0,37077190.0,-0.07832930095140947,-0.02118552160273818\nSPY,20130422,3930000.0,4022000.0,3912800.0,3986700.0,15050851.0,,\nQQQ,20130422,683300.0,690400.0,680800.0,687900.0,30310722.0,-0.08719146827584265,-0.03215209602859279\nSPY,20130423,4040000.0,4083800.0,3988100.0,4060000.0,17072924.0,,\nQQQ,20130423,691800.0,696900.0,688200.0,694400.0,37475020.0,-0.09663475023031644,-0.04236166974448124\nSPY,20130424,3936000.0,4152200.0,3925000.0,4056600.0,32297924.0,,\nQQQ,20130424,692800.0,696700.0,691200.0,694300.0,27197515.0,-0.10577414210507297,-0.05162490851645503\nSPY,20130425,4115500.0,4139400.0,4070000.0,4083800.0,13175576.0,,\nQQQ,20130425,696000.0,700500.0,695900.0,697900.0,23524446.0,-0.11529613907541494,-0.061278075397358\nSPY,20130426,4098100.0,4187500.0,4082500.0,4171100.0,27009517.0,,\nQQQ,20130426,696200.0,697700.0,692700.0,695700.0,21664689.0,-0.12363781665563163,-0.07001864194469003\nSPY,20130429,4205500.0,4336200.0,4200000.0,4301200.0,22196150.0,,\nQQQ,20130429,697900.0,704700.0,697600.0,702100.0,24304758.0,-0.13290983592792238,-0.08146852943892818\nSPY,20130430,4351100.0,4452500.0,4320700.0,4427500.0,24029795.0,,\nQQQ,20130430,703000.0,707300.0,700400.0,707300.0,25725809.0,-0.14238605343585814,-0.09359179349709285\nSPY,20130501,4445000.0,4449300.0,4343900.0,4392900.0,17662043.0,,\nQQQ,20130501,707400.0,708500.0,702500.0,703900.0,24346600.0,-0.1516457121893902,-0.10671201924050086\nSPY,20130502,4420000.0,4485900.0,4406300.0,4455200.0,14690283.0,,\nQQQ,20130502,705100.0,714300.0,704500.0,712800.0,27746900.0,-0.1608409684199909,-0.1170633235677666\nSPY,20130503,4513100.0,4532300.0,4491500.0,4499800.0,12121132.0,,\nQQQ,20130503,719700.0,723400.0,719200.0,721200.0,30565219.0,-0.17055271371228561,-0.12684094808808039\nSPY,20130506,4560000.0,4622000.0,4543100.0,4607100.0,17245440.0,,\nQQQ,20130506,722500.0,725100.0,721900.0,724000.0,18240163.0,-0.179295237710966,-0.1362140359019425\nSPY,20130507,4652400.0,4657000.0,4537000.0,4586900.0,16838625.0,,\nQQQ,20130507,725200.0,725700.0,720900.0,723400.0,23187021.0,-0.18734687059002703,-0.14433220452251702\nSPY,20130508,4593200.0,4653700.0,4558100.0,4638400.0,16483083.0,,\nQQQ,20130508,723200.0,727600.0,722000.0,727100.0,19494491.0,-0.1945087539037783,-0.1510270782456278\nSPY,20130509,4598900.0,4630000.0,4556000.0,4567700.0,13476072.0,,\nQQQ,20130509,725700.0,731000.0,724700.0,726500.0,29161203.0,-0.20200346009070508,-0.1582742633486174\nSPY,20130510,4580000.0,4597100.0,4504800.0,4529700.0,11754378.0,,\nQQQ,20130510,727600.0,730800.0,726400.0,730500.0,19641643.0,-0.20999539848122004,-0.16562643121475243\nSPY,20130513,4515300.0,4579000.0,4515000.0,4547400.0,10823925.0,,\nQQQ,20130513,729300.0,733200.0,728600.0,731400.0,23596920.0,-0.21751639596120778,-0.17273863847941232\nSPY,20130514,4539000.0,4552000.0,4421900.0,4438600.0,15602519.0,,\nQQQ,20130514,731600.0,737400.0,731300.0,735200.0,32446658.0,-0.2261977053848362,-0.1807874080743859\nSPY,20130515,4391500.0,4410000.0,4223600.0,4289800.0,25399943.0,,\nQQQ,20130515,733800.0,737400.0,732000.0,736700.0,24257132.0,-0.23645708616212135,-0.18953959443397517\nSPY,20130516,4228300.0,4378500.0,4189000.0,4345300.0,21213655.0,,\nQQQ,20130516,737300.0,740900.0,735500.0,736000.0,24867739.0,-0.2460361523526097,-0.19776383049440258\nSPY,20130517,4390000.0,4400900.0,4310100.0,4332600.0,14988427.0,,\nQQQ,20130517,739700.0,743300.0,737400.0,743000.0,26182388.0,-0.25634880729732745,-0.20606530074639573\nSPY,20130520,4317600.0,4457900.0,4301000.0,4427400.0,15114118.0,,\nQQQ,20130520,741600.0,744300.0,738900.0,741900.0,21342362.0,-0.2656933544752628,-0.21418383821753226\nSPY,20130521,4379000.0,4454800.0,4342000.0,4396600.0,15767868.0,,\nQQQ,20130521,741500.0,745400.0,739000.0,742700.0,24414499.0,-0.2772627552529973,-0.2233713245793634\nSPY,20130522,4437900.0,4483400.0,4382600.0,4413800.0,14960056.0,,\nQQQ,20130522,743600.0,749500.0,732400.0,736500.0,53574732.0,-0.2887063183520106,-0.23237809071484775\nSPY,20130523,4360100.0,4461600.0,4357900.0,4421400.0,12116959.0,,\nQQQ,20130523,729700.0,737000.0,728300.0,734500.0,43717647.0,-0.2959522888414191,-0.24026679105164697\nSPY,20130524,4405500.0,4456600.0,4403600.0,4451500.0,9500218.0,,\nQQQ,20130524,729600.0,734300.0,727600.0,734300.0,24435361.0,-0.30301913242445777,-0.24770931489601308\nSPY,20130528,4500000.0,4511000.0,4408500.0,4414400.0,13267220.0,,\nQQQ,20130528,742700.0,745400.0,736600.0,739000.0,25448511.0,-0.30956157306122317,-0.2553287617178613\nSPY,20130529,4402000.0,4475000.0,4394000.0,4449500.0,11467563.0,,\nQQQ,20130529,736000.0,738000.0,731200.0,735400.0,30680205.0,-0.3158369923702566,-0.2625358230033457\nSPY,20130530,4456500.0,4545000.0,4445100.0,4515900.0,12186764.0,,\nQQQ,20130530,735700.0,742800.0,735500.0,739300.0,30462008.0,-0.32176878919998214,-0.2689341426806317\nSPY,20130531,4524500.0,4571000.0,4496400.0,4496800.0,12653311.0,,\nQQQ,20130531,736600.0,742000.0,731700.0,731700.0,35109348.0,-0.3264769562453378,-0.2754516926923669\nSPY,20130603,4504600.0,4523600.0,4424800.0,4507200.0,12868929.0,,\nQQQ,20130603,732600.0,734000.0,724300.0,733700.0,45144379.0,-0.33068680683091617,-0.28164117181528736\nSPY,20130604,4532000.0,4544300.0,4473900.0,4493100.0,10004318.0,,\nQQQ,20130604,735300.0,738200.0,727000.0,730000.0,32019053.0,-0.33483986694392526,-0.2877875330499636\nSPY,20130605,4456500.0,4507100.0,4437200.0,4451100.0,10119941.0,,\nQQQ,20130605,727600.0,730400.0,719900.0,720300.0,39875365.0,-0.34080108481804827,-0.2943047081235401\nSPY,20130606,4451100.0,4470000.0,4340500.0,4384600.0,14596961.0,,\nQQQ,20130606,721500.0,724000.0,714700.0,723500.0,59722927.0,-0.34672307515070616,-0.3011210838477159\nSPY,20130607,4362800.0,4432400.0,4327700.0,4419600.0,14049697.0,,\nQQQ,20130607,727000.0,734700.0,725200.0,734000.0,29238269.0,-0.35296563011087834,-0.3078497240427686\nSPY,20130610,4447900.0,4490600.0,4368000.0,4388900.0,15364918.0,,\nQQQ,20130610,735300.0,737600.0,732600.0,734200.0,21723639.0,-0.3579627074877391,-0.31460273521813326\nSPY,20130611,4360000.0,4427400.0,4333200.0,4376000.0,9991109.0,,\nQQQ,20130611,726900.0,733400.0,724400.0,727000.0,36375657.0,-0.3625805094427862,-0.32116115348916086\nSPY,20130612,4395000.0,4412500.0,4315000.0,4321900.0,9195268.0,,\nQQQ,20130612,731100.0,731400.0,717400.0,718400.0,37991366.0,-0.36603911037111764,-0.3272985162080296\nSPY,20130613,4322900.0,4371400.0,4287500.0,4360000.0,9782947.0,,\nQQQ,20130613,717500.0,729200.0,715500.0,727200.0,26721451.0,-0.3707081323230634,-0.33359672739695717\nSPY,20130614,4354000.0,4362900.0,4285000.0,4300500.0,9132983.0,,\nQQQ,20130614,727600.0,728400.0,721800.0,722800.0,25898887.0,-0.37474942284388174,-0.3397854566435603\nSPY,20130617,4313500.0,4357000.0,4304000.0,4320000.0,9287798.0,,\nQQQ,20130617,728500.0,734000.0,726000.0,729800.0,31542853.0,-0.3794811335342092,-0.3458774518452329\nSPY,20130618,4315600.0,4349000.0,4302200.0,4317700.0,6766313.0,,\nQQQ,20130618,730800.0,737200.0,730600.0,735600.0,23655080.0,-0.3843883370296446,-0.35224090227376487\nSPY,20130619,4310800.0,4316600.0,4230000.0,4230000.0,9814616.0,,\nQQQ,20130619,736000.0,736800.0,726800.0,727600.0,40191166.0,-0.38886629836701214,-0.3587873225237158\nSPY,20130620,4195600.0,4259700.0,4151700.0,4166400.0,12207762.0,,\nQQQ,20130620,719200.0,721600.0,707900.0,709400.0,55526174.0,-0.3910284893011757,-0.3645463726405112\nSPY,20130621,4189000.0,4200000.0,4081000.0,4136800.0,16553893.0,,\nQQQ,20130621,707800.0,709700.0,698400.0,703400.0,48936222.0,-0.3924399835360388,-0.37000022309616903\nSPY,20130624,4074000.0,4086600.0,3980500.0,4022900.0,16311351.0,,\nQQQ,20130624,698500.0,702700.0,691500.0,697300.0,37639288.0,-0.3931011277021392,-0.3744454899050704\nSPY,20130625,4057200.0,4077900.0,3988300.0,4026300.0,10808423.0,,\nQQQ,20130625,704000.0,705200.0,698100.0,702300.0,26332850.0,-0.39492106665266413,-0.37958889156536985\nSPY,20130626,4035900.0,4047800.0,3956600.0,3980700.0,12732915.0,,\nQQQ,20130626,708400.0,710000.0,705900.0,708700.0,21303374.0,-0.3973113886155127,-0.385280452813609\nSPY,20130627,3990100.0,4013900.0,3935400.0,3937800.0,11624505.0,,\nQQQ,20130627,712400.0,716200.0,711300.0,711700.0,22303731.0,-0.4012046284895606,-0.39098438702108346\nSPY,20130628,3913100.0,4002700.0,3888700.0,3960800.0,16302273.0,,\nQQQ,20130628,709500.0,716900.0,707900.0,712100.0,25434130.0,-0.4047467064541761,-0.39657209039937785\nSPY,20130701,4029000.0,4122500.0,4012200.0,4092200.0,13570862.0,,\nQQQ,20130701,717500.0,723000.0,716400.0,717300.0,23957336.0,-0.4081416950790818,-0.401930331624581\nSPY,20130702,4100000.0,4216100.0,4095000.0,4185100.0,16364715.0,,\nQQQ,20130702,716800.0,721700.0,713500.0,717300.0,21898154.0,-0.4117894487984506,-0.4071634198358563\nSPY,20130703,4209500.0,4229500.0,4174600.0,4208000.0,8274905.0,,\nQQQ,20130703,714800.0,723700.0,714200.0,720400.0,14935751.0,-0.41420754834581935,-0.41201024632130323\nSPY,20130705,4203300.0,4232900.0,4153500.0,4174200.0,9249360.0,,\nQQQ,20130705,724400.0,726100.0,718600.0,725600.0,25781531.0,-0.4167274152289404,-0.41693281032899504\nSPY,20130708,4200400.0,4210000.0,4106500.0,4150500.0,10030575.0,,\nQQQ,20130708,729600.0,729900.0,723800.0,726500.0,19705770.0,-0.4192673847317666,-0.4218993212031057\nSPY,20130709,4138600.0,4235000.0,4103800.0,4221200.0,12159532.0,,\nQQQ,20130709,729900.0,732400.0,726500.0,730900.0,24217324.0,-0.4212991612018443,-0.42701122997474145\nSPY,20130710,4196000.0,4248000.0,4182500.0,4207300.0,9742157.0,,\nQQQ,20130710,730200.0,736100.0,729800.0,735100.0,23850377.0,-0.42318181797553284,-0.43203427836946084\nSPY,20130711,4229900.0,4282500.0,4212000.0,4272400.0,11408870.0,,\nQQQ,20130711,743000.0,750300.0,742500.0,750300.0,42873715.0,-0.4244834302582527,-0.4368008689675102\nSPY,20130712,4278200.0,4297900.0,4234200.0,4265100.0,9339811.0,,\nQQQ,20130712,750300.0,753500.0,748300.0,752900.0,28057716.0,-0.4257461004358524,-0.44141223510968036\nSPY,20130715,4250100.0,4314600.0,4248000.0,4274400.0,8265718.0,,\nQQQ,20130715,753800.0,755200.0,751700.0,754800.0,17826964.0,-0.4269328034382084,-0.4458916229705233\nSPY,20130716,4264300.0,4307100.0,4241700.0,4302900.0,7485743.0,,\nQQQ,20130716,755300.0,755900.0,751800.0,753700.0,21857873.0,-0.4280632048487106,-0.4498449723975534\nSPY,20130717,4293700.0,4322200.0,4282200.0,4303100.0,6935109.0,,\nQQQ,20130717,756000.0,757400.0,753500.0,755700.0,18766690.0,-0.4288327708108713,-0.4537191247845264\nSPY,20130718,4333100.0,4348700.0,4306100.0,4316900.0,7617959.0,,\nQQQ,20130718,755500.0,757400.0,752500.0,753700.0,25371333.0,-0.42924517030040804,-0.4572485040540533\nSPY,20130719,4339000.0,4339800.0,4243500.0,4250000.0,9322687.0,,\nQQQ,20130719,747200.0,747400.0,743700.0,745900.0,31486623.0,-0.43011888636892226,-0.4617200182106124\nSPY,20130722,4295500.0,4297500.0,4254700.0,4263100.0,7053972.0,,\nQQQ,20130722,749100.0,749800.0,745800.0,748100.0,17712674.0,-0.4312056697559235,-0.46604596893723305\nSPY,20130723,4260000.0,4267400.0,4187100.0,4189900.0,9303980.0,,\nQQQ,20130723,749500.0,749600.0,742000.0,742600.0,18543671.0,-0.43271186395668043,-0.4710149369839719\nSPY,20130724,4389300.0,4445900.0,4352600.0,4406100.0,20134520.0,,\nQQQ,20130724,749900.0,750200.0,743400.0,745000.0,20284733.0,-0.43262790350240005,-0.4737849801000451\nSPY,20130725,4405100.0,4414000.0,4358100.0,4385000.0,8024371.0,,\nQQQ,20130725,748500.0,750600.0,744600.0,749700.0,20701923.0,-0.4322874755224836,-0.4764732866975336\nSPY,20130726,4353000.0,4410400.0,4343400.0,4409900.0,7170818.0,,\nQQQ,20130726,746700.0,753800.0,745500.0,753700.0,19526727.0,-0.4316507192344871,-0.4787085622922222\nSPY,20130729,4403800.0,4499900.0,4402000.0,4477900.0,8670500.0,,\nQQQ,20130729,752200.0,755400.0,750300.0,752300.0,17979325.0,-0.43221435548722265,-0.4802383108398435\nSPY,20130730,4500000.0,4571400.0,4492300.0,4533200.0,10857573.0,,\nQQQ,20130730,755000.0,759400.0,753500.0,756300.0,22817021.0,-0.4319983426838651,-0.48040890779797285\nSPY,20130731,4549900.0,4573000.0,4494400.0,4525000.0,11227589.0,,\nQQQ,20130731,757800.0,762000.0,756300.0,757700.0,23513930.0,-0.4313858020425457,-0.48059825167457787\nSPY,20130801,4552900.0,4568000.0,4532600.0,4567600.0,7086504.0,,\nQQQ,20130801,762900.0,766500.0,762100.0,765400.0,15627001.0,-0.42961050772961623,-0.4799649807684671\nSPY,20130802,4580100.0,4628500.0,4566600.0,4625400.0,9518980.0,,\nQQQ,20130802,765500.0,769900.0,763900.0,769700.0,13585522.0,-0.42644511210079683,-0.4781746500540328\nSPY,20130805,4646000.0,4706700.0,4621500.0,4694500.0,11065526.0,,\nQQQ,20130805,769000.0,770800.0,767800.0,770200.0,13937894.0,-0.4226194648728596,-0.4756423163063283\nSPY,20130806,4680400.0,4718900.0,4621700.0,4652500.0,11708544.0,,\nQQQ,20130806,769300.0,769900.0,762500.0,765600.0,22529435.0,-0.41935989727024836,-0.47333419570359375\nSPY,20130807,4636500.0,4669800.0,4617700.0,4649800.0,10463905.0,,\nQQQ,20130807,763400.0,765600.0,758800.0,764200.0,18208362.0,-0.4168065092757804,-0.4712791585002819\nSPY,20130808,4640200.0,4640900.0,4579500.0,4610100.0,8957698.0,,\nQQQ,20130808,768400.0,769800.0,763000.0,768000.0,18356292.0,-0.4147415759432052,-0.4693737217064065\nSPY,20130809,4586400.0,4604600.0,4536500.0,4544500.0,9376318.0,,\nQQQ,20130809,766700.0,769400.0,762700.0,765000.0,16950100.0,-0.4139946568634782,-0.46911951349187536\nSPY,20130812,4568600.0,4686500.0,4565300.0,4673600.0,12737192.0,,\nQQQ,20130812,762000.0,768000.0,761900.0,766700.0,16961448.0,-0.41197231000645085,-0.466877756980545\nSPY,20130813,4710300.0,4946600.0,4680500.0,4895700.0,30882705.0,,\nQQQ,20130813,767700.0,772700.0,762200.0,771200.0,22745617.0,-0.40776496735217554,-0.4640612199487481\nSPY,20130814,4979100.0,5042400.0,4934000.0,4985000.0,26021452.0,,\nQQQ,20130814,770700.0,771800.0,767000.0,768100.0,25890627.0,-0.40305600974213146,-0.46108570904827695\nSPY,20130815,4969500.0,5023800.0,4890800.0,4981000.0,16823810.0,,\nQQQ,20130815,759500.0,759900.0,752900.0,755100.0,35619823.0,-0.39963366787909055,-0.45849301022308053\nSPY,20130816,5000000.0,5029400.0,4988600.0,5023300.0,11820157.0,,\nQQQ,20130816,755200.0,758700.0,753500.0,754600.0,20645369.0,-0.39592674079179857,-0.4555579926665168\nSPY,20130819,5044000.0,5137400.0,5040000.0,5077400.0,17856568.0,,\nQQQ,20130819,754900.0,761300.0,753300.0,753500.0,27632475.0,-0.3921088944923098,-0.4531200584412851\nSPY,20130820,5094300.0,5105700.0,5008300.0,5010700.0,12451415.0,,\nQQQ,20130820,754900.0,760300.0,754300.0,757000.0,17239354.0,-0.3896583237132668,-0.451883802153888\nSPY,20130821,5031800.0,5071500.0,5012000.0,5024300.0,11518727.0,,\nQQQ,20130821,754400.0,760900.0,751400.0,754200.0,28275359.0,-0.3879050165132272,-0.45116271136000835\nSPY,20130822,5049900.0,5055900.0,4982000.0,5029600.0,8324416.0,,\nQQQ,20130822,757500.0,762100.0,757100.0,761600.0,15557186.0,-0.38601650782368535,-0.4501608766001075\nSPY,20130823,5027600.0,5033000.0,4993500.0,5010200.0,7691314.0,,\nQQQ,20130823,767000.0,767700.0,764000.0,766800.0,18100973.0,-0.3832213310048337,-0.44864237705759313\nSPY,20130826,5007500.0,5102000.0,5005000.0,5029700.0,11655707.0,,\nQQQ,20130826,767300.0,772700.0,765500.0,767100.0,24605595.0,-0.3809257670703072,-0.4470930046245279\nSPY,20130827,4980000.0,5025100.0,4863000.0,4881200.0,14820572.0,,\nQQQ,20130827,758000.0,761700.0,749600.0,750700.0,36525181.0,-0.37974360208188995,-0.44521344174941\nSPY,20130828,4860000.0,4957500.0,4860000.0,4906700.0,10591733.0,,\nQQQ,20130828,750500.0,757500.0,750500.0,754300.0,19453652.0,-0.3789674471429045,-0.4438921611645477\nSPY,20130829,4917600.0,4965000.0,4911300.0,4917300.0,8113098.0,,\nQQQ,20130829,754100.0,763400.0,753000.0,759600.0,24481541.0,-0.3782554713088802,-0.4423509182834965\nSPY,20130830,4920000.0,4929000.0,4865000.0,4870500.0,9372697.0,,\nQQQ,20130830,760400.0,760400.0,752000.0,754600.0,23730053.0,-0.3781258422101802,-0.4408627912426471\nSPY,20130903,4930000.0,5006000.0,4873600.0,4885800.0,11385049.0,,\nQQQ,20130903,760900.0,764300.0,755400.0,759000.0,24697960.0,-0.3776174825593399,-0.43903722042836224\nSPY,20130904,5000000.0,5022400.0,4935000.0,4987600.0,11093939.0,,\nQQQ,20130904,761600.0,768400.0,759300.0,767100.0,25470022.0,-0.37417811898139947,-0.43548589382212655\nSPY,20130905,5005500.0,5006800.0,4936400.0,4952700.0,7612028.0,,\nQQQ,20130905,767600.0,770550.0,767300.0,768400.0,16810392.0,-0.3718403796953465,-0.43281521332347794\nSPY,20130906,4987000.0,4993800.0,4899500.0,4982200.0,11883330.0,,\nQQQ,20130906,771000.0,773400.0,760600.0,769300.0,25556974.0,-0.36917592722616066,-0.4296000428979561\nSPY,20130909,5050000.0,5079200.0,5034800.0,5061800.0,11464428.0,,\nQQQ,20130909,772600.0,779600.0,772300.0,778300.0,24193250.0,-0.36475658210214035,-0.42539699323105695\nSPY,20130910,5063800.0,5074500.0,4895000.0,4946500.0,25629530.0,,\nQQQ,20130910,782800.0,783100.0,779200.0,782000.0,22680213.0,-0.3646045245843556,-0.42614049434519263\nSPY,20130911,4670700.0,4737000.0,4648100.0,4678300.0,29489066.0,,\nQQQ,20130911,776900.0,781100.0,775900.0,780700.0,26345474.0,-0.36732026822825153,-0.42705376209900087\nSPY,20130912,4684000.0,4754000.0,4660100.0,4726900.0,14085256.0,,\nQQQ,20130912,780800.0,782500.0,778600.0,780100.0,17348184.0,-0.3671555685896274,-0.4254107064163351\nSPY,20130913,4700000.0,4718300.0,4647000.0,4649000.0,10318198.0,,\nQQQ,20130913,780900.0,781400.0,776400.0,780600.0,15908509.0,-0.36743988244320985,-0.4235644353249071\nSPY,20130916,4610000.0,4616100.0,4472200.0,4501200.0,18981587.0,,\nQQQ,20130916,787200.0,787200.0,776700.0,778500.0,24288939.0,-0.36985141208259714,-0.42497494950458087\nSPY,20130917,4475000.0,4597100.0,4475000.0,4551800.0,13881918.0,,\nQQQ,20130917,780200.0,784700.0,779800.0,783800.0,21785412.0,-0.37421798186494987,-0.427760358818987\nSPY,20130918,4634700.0,4663500.0,4606600.0,4646500.0,15281520.0,,\nQQQ,20130918,784900.0,794600.0,783300.0,793400.0,29833813.0,-0.37919254856925466,-0.42962867146048467\nSPY,20130919,4708400.0,4758300.0,4692500.0,4723000.0,13885812.0,,\nQQQ,20130919,795600.0,796900.0,793700.0,795000.0,24861345.0,-0.38386356697590635,-0.4309052522370723\nSPY,20130920,4785000.0,4785500.0,4660000.0,4669800.0,20042241.0,,\nQQQ,20130920,794500.0,795300.0,789500.0,789800.0,24226392.0,-0.38989649614986766,-0.43270832544770904\nSPY,20130923,4960000.0,4969100.0,4682600.0,4907300.0,23830821.0,,\nQQQ,20130923,793200.0,794100.0,784600.0,788500.0,25687298.0,-0.39392903977722543,-0.4338470098604151\nSPY,20130924,4950000.0,4954700.0,4878200.0,4891000.0,12333667.0,,\nQQQ,20130924,790000.0,792500.0,785700.0,788300.0,21064604.0,-0.39793483474824287,-0.43457476305273074\nSPY,20130925,4889600.0,4896400.0,4814300.0,4815300.0,10979614.0,,\nQQQ,20130925,788900.0,790000.0,784000.0,786000.0,20362564.0,-0.40293390681125624,-0.43506180653383225\nSPY,20130926,4860000.0,4885600.0,4839000.0,4862200.0,7902223.0,,\nQQQ,20130926,788800.0,793600.0,788500.0,791700.0,20003228.0,-0.4051286233657215,-0.4344679059379394\nSPY,20130927,4837800.0,4846700.0,4807200.0,4827500.0,7837431.0,,\nQQQ,20130927,787100.0,792100.0,785900.0,790800.0,22430191.0,-0.40474528611596194,-0.4323097671563996\nSPY,20130930,4768400.0,4816600.0,4744100.0,4767500.0,8510584.0,,\nQQQ,20130930,782500.0,790900.0,780000.0,788500.0,24476177.0,-0.4036175066319441,-0.4274472861608192\nSPY,20131001,4784500.0,4891400.0,4783600.0,4880300.0,11765925.0,,\nQQQ,20131001,788900.0,797200.0,788500.0,796800.0,27311350.0,-0.40370354451624507,-0.4256843309048846\nSPY,20131002,4857200.0,4918000.0,4837500.0,4896000.0,9845586.0,,\nQQQ,20131002,791400.0,797600.0,790600.0,796500.0,21879194.0,-0.4015642891526034,-0.4216005136680409\nSPY,20131003,4905100.0,4923500.0,4807400.0,4833900.0,10283559.0,,\nQQQ,20131003,795500.0,797200.0,783000.0,787100.0,34917178.0,-0.4003675385352243,-0.41705027441112436\nSPY,20131004,4835000.0,4846000.0,4786000.0,4830300.0,9036729.0,,\nQQQ,20131004,787200.0,795100.0,786500.0,794000.0,20531533.0,-0.39933979689967103,-0.41321916492470595\nSPY,20131007,4864500.0,4926300.0,4853500.0,4877500.0,10685718.0,,\nQQQ,20131007,787000.0,793500.0,786700.0,787400.0,18658142.0,-0.3998948031338477,-0.41094629492013873\nSPY,20131008,4896100.0,4906400.0,4805400.0,4809400.0,10062442.0,,\nQQQ,20131008,787400.0,788100.0,772000.0,772200.0,40968703.0,-0.4026484161928753,-0.40874241338156303\nSPY,20131009,4846400.0,4877900.0,4782800.0,4863000.0,10084479.0,,\nQQQ,20131009,774000.0,774400.0,763600.0,769600.0,62806871.0,-0.4034216134760914,-0.40620221307127874\nSPY,20131010,4915600.0,4923800.0,4870400.0,4899000.0,9429020.0,,\nQQQ,20131010,778100.0,787800.0,777900.0,786100.0,41310257.0,-0.4006430319651157,-0.4003070736648434\nSPY,20131011,4869900.0,4938400.0,4851600.0,4930000.0,9292377.0,,\nQQQ,20131011,784100.0,792900.0,784000.0,792300.0,23175005.0,-0.3945812683981961,-0.3918694108606906\nSPY,20131014,4895400.0,4975800.0,4893500.0,4960400.0,9112189.0,,\nQQQ,20131014,787500.0,797900.0,786800.0,797900.0,29982341.0,-0.38693557907444226,-0.381664368929497\nSPY,20131015,4978900.0,5020000.0,4955200.0,4986800.0,11025937.0,,\nQQQ,20131015,797300.0,801100.0,793800.0,794800.0,34625853.0,-0.3784533459226733,-0.37105739427179013\nSPY,20131016,5007000.0,5025300.0,4992400.0,5011200.0,8439434.0,,\nQQQ,20131016,798500.0,804200.0,797900.0,803700.0,43259878.0,-0.368602165856154,-0.3599876795672327\nSPY,20131017,5000000.0,5047800.0,4996800.0,5046600.0,8854753.0,,\nQQQ,20131017,800200.0,808700.0,799500.0,808100.0,29348023.0,-0.3587112857360288,-0.34947700023566736\nSPY,20131018,5061000.0,5092600.0,5057100.0,5089500.0,9822030.0,,\nQQQ,20131018,815800.0,821800.0,813500.0,821500.0,32161620.0,-0.34926486995555134,-0.34082682630228384\nSPY,20131021,5115200.0,5243000.0,5115200.0,5213000.0,13790242.0,,\nQQQ,20131021,823400.0,825400.0,820700.0,823000.0,29997232.0,-0.33687456210982947,-0.33029778061856296\nSPY,20131022,5261100.0,5284300.0,5080300.0,5198300.0,18554795.0,,\nQQQ,20131022,826500.0,829000.0,819300.0,824100.0,42243734.0,-0.3223707754147235,-0.31824318003797153\nSPY,20131023,5190000.0,5256700.0,5190000.0,5249600.0,10584974.0,,\nQQQ,20131023,820500.0,822000.0,815500.0,819500.0,29817224.0,-0.30396090273863446,-0.3025216385516452\nSPY,20131024,5250000.0,5324700.0,5224500.0,5319400.0,11987508.0,,\nQQQ,20131024,820000.0,824800.0,818800.0,823100.0,20213140.0,-0.28382631109703044,-0.28553661915791134\nSPY,20131025,5313000.0,5332300.0,5251100.0,5262000.0,11687454.0,,\nQQQ,20131025,830800.0,832800.0,825000.0,828800.0,31793241.0,-0.2628983947032911,-0.2688920425272404\nSPY,20131028,5292700.0,5310000.0,5232400.0,5293800.0,13948149.0,,\nQQQ,20131028,829100.0,830500.0,825500.0,829600.0,22528984.0,-0.24029638050276111,-0.25163177222893324\nSPY,20131029,5362800.0,5392500.0,5145400.0,5170200.0,21154617.0,,\nQQQ,20131029,832000.0,832600.0,827000.0,830600.0,33858025.0,-0.22022278480897534,-0.23631747481651927\nSPY,20131030,5195900.0,5275200.0,5170600.0,5249400.0,11990058.0,,\nQQQ,20131030,833500.0,834900.0,825800.0,829600.0,30270108.0,-0.1989945648312666,-0.21967594198379825\nSPY,20131031,5250000.0,5274900.0,5212700.0,5223500.0,9252920.0,,\nQQQ,20131031,827700.0,833000.0,824800.0,827900.0,28059609.0,-0.1780015466611167,-0.20298262354784297\nSPY,20131101,5244000.0,5248000.0,5158400.0,5200400.0,9701808.0,,\nQQQ,20131101,830700.0,831600.0,824000.0,827900.0,29477014.0,-0.15886276591585122,-0.18665752820280415\nSPY,20131104,5211700.0,5268200.0,5188100.0,5267500.0,8502865.0,,\nQQQ,20131104,830600.0,830700.0,826400.0,829300.0,15624610.0,-0.13804003726040817,-0.1689563758899335\nSPY,20131105,5244400.0,5288900.0,5230000.0,5256200.0,9529653.0,,\nQQQ,20131105,826100.0,832200.0,823700.0,830500.0,25760387.0,-0.11732295709183414,-0.15151318025646499\nSPY,20131106,5241500.0,5248600.0,5182000.0,5208600.0,7317747.0,,\nQQQ,20131106,833700.0,834000.0,827300.0,829900.0,24499794.0,-0.09783901222202222,-0.13452703286746048\nSPY,20131107,5195800.0,5231900.0,5123800.0,5125100.0,9103759.0,,\nQQQ,20131107,830100.0,831300.0,813700.0,814300.0,48939052.0,-0.08095439373692105,-0.118253265843084\nSPY,20131108,5145900.0,5211300.0,5126000.0,5206000.0,9468592.0,,\nQQQ,20131108,817400.0,825500.0,815100.0,825500.0,28585128.0,-0.06299423180813009,-0.10070883721043153\nSPY,20131111,5199900.0,5216700.0,5144100.0,5192900.0,7909914.0,,\nQQQ,20131111,824200.0,826400.0,821400.0,824300.0,22542990.0,-0.044320503855354354,-0.08337849762420146\nSPY,20131112,5170000.0,5239200.0,5170000.0,5200100.0,6705283.0,,\nQQQ,20131112,821600.0,826600.0,821200.0,825400.0,18085279.0,-0.025908892795305474,-0.06553824367171134\nSPY,20131113,5180000.0,5222500.0,5169600.0,5207500.0,6702613.0,,\nQQQ,20131113,820000.0,835500.0,820000.0,835500.0,27274000.0,-0.0060386905257164515,-0.04742990973990066\nSPY,20131114,5230600.0,5292700.0,5218700.0,5281600.0,9871545.0,,\nQQQ,20131114,833200.0,838600.0,831500.0,837400.0,30069422.0,0.015363562147770064,-0.02782557182593238\nSPY,20131115,5265500.0,5290500.0,5245000.0,5250800.0,11115247.0,,\nQQQ,20131115,838200.0,839600.0,836100.0,839600.0,19385521.0,0.03470582772973722,-0.00994595283674924\nSPY,20131118,5248400.0,5271900.0,5182000.0,5186500.0,8543029.0,,\nQQQ,20131118,839400.0,841000.0,829800.0,831600.0,29550469.0,0.05231372413982783,0.00731577003621409\nSPY,20131119,5190300.0,5233800.0,5179700.0,5194700.0,7253929.0,,\nQQQ,20131119,830900.0,834900.0,827600.0,829000.0,24472996.0,0.07435438111133824,0.02588151881702832\nSPY,20131120,5190500.0,5204200.0,5143300.0,5150000.0,6764412.0,,\nQQQ,20131120,831200.0,834300.0,824600.0,827000.0,30334723.0,0.09498638718981832,0.0439737236729133\nSPY,20131121,5176000.0,5212100.0,5136700.0,5210100.0,9070757.0,,\nQQQ,20131121,830500.0,836100.0,829800.0,835500.0,25424452.0,0.11733835746661332,0.06316713002670832\nSPY,20131122,5196000.0,5221600.0,5185300.0,5198000.0,7043008.0,,\nQQQ,20131122,836800.0,840200.0,836200.0,840000.0,23816428.0,0.14004990991839752,0.08201071194963\nSPY,20131125,5210200.0,5258700.0,5210000.0,5237400.0,7951205.0,,\nQQQ,20131125,842900.0,843800.0,839800.0,841900.0,21042353.0,0.16624003195136788,0.10170315115842644\nSPY,20131126,5240700.0,5361400.0,5240000.0,5334000.0,13272949.0,,\nQQQ,20131126,842100.0,848400.0,840300.0,847000.0,24328260.0,0.19481612125291445,0.12312554951785289\nSPY,20131127,5362500.0,5460000.0,5361700.0,5459600.0,12554511.0,,\nQQQ,20131127,848000.0,852400.0,847300.0,852200.0,19823184.0,0.22490414914199297,0.14550028776514234\nSPY,20131129,5497000.0,5583300.0,5478100.0,5560700.0,9824672.0,,\nQQQ,20131129,855600.0,858400.0,854800.0,857300.0,14900285.0,0.2578153175862516,0.16834669671279862\nSPY,20131202,5580000.0,5643300.0,5508200.0,5512300.0,16389276.0,,\nQQQ,20131202,858200.0,859600.0,853500.0,854800.0,24364586.0,0.28939673058944515,0.19138057414231774\nSPY,20131203,5580000.0,5663800.0,5512300.0,5663600.0,15158588.0,,\nQQQ,20131203,854000.0,856400.0,850900.0,854000.0,30805607.0,0.32370936497550085,0.21459067194478784\nSPY,20131204,5656000.0,5691900.0,5608200.0,5650000.0,13362810.0,,\nQQQ,20131204,850500.0,857700.0,847800.0,854700.0,35176633.0,0.35603734012924737,0.23797773999413643\nSPY,20131205,5728700.0,5772500.0,5664100.0,5679700.0,14861978.0,,\nQQQ,20131205,855600.0,856600.0,851700.0,853800.0,37493947.0,0.38182098164748124,0.2605414464711436\nSPY,20131206,5657900.0,5667500.0,5595200.0,5600200.0,11757937.0,,\nQQQ,20131206,861000.0,861800.0,855900.0,860000.0,32744675.0,0.407908637216502,0.28305866076464886\nSPY,20131209,5610000.0,5695800.0,5609100.0,5664300.0,11082743.0,,\nQQQ,20131209,863500.0,865300.0,862000.0,863500.0,20696434.0,0.43230885677328135,0.30507495927461664\nSPY,20131210,5635600.0,5678800.0,5612000.0,5655500.0,9073451.0,,\nQQQ,20131210,862100.0,864500.0,861200.0,862900.0,24381167.0,0.4550531632264958,0.3267298185515529\nSPY,20131211,5668900.0,5709800.0,5590000.0,5613600.0,12527141.0,,\nQQQ,20131211,862800.0,864000.0,850600.0,851800.0,34470799.0,0.476942859144273,0.34849715891760685\nSPY,20131212,5622200.0,5653400.0,5600200.0,5605400.0,9107594.0,,\nQQQ,20131212,852100.0,854200.0,849000.0,849600.0,29962653.0,0.49804313803587635,0.3700890287846373\nSPY,20131213,5624200.0,5628800.0,5536600.0,5544300.0,11359046.0,,\nQQQ,20131213,853600.0,854000.0,847100.0,848500.0,31226220.0,0.5172088443790571,0.39120922795130086\nSPY,20131216,5550200.0,5626400.0,5549600.0,5575000.0,9755613.0,,\nQQQ,20131216,852700.0,858100.0,852100.0,853300.0,20847465.0,0.5334634842608222,0.4079059208199297\nSPY,20131217,5558100.0,5594400.0,5533800.0,5549900.0,7727382.0,,\nQQQ,20131217,853400.0,855200.0,849900.0,851500.0,23291934.0,0.5499950460003692,0.4251875153519705\nSPY,20131218,5497000.0,5533000.0,5388000.0,5507700.0,19211943.0,,\nQQQ,20131218,852500.0,862200.0,840500.0,861400.0,64031984.0,0.5678957559175859,0.4456253292446535\nSPY,20131219,5493700.0,5549900.0,5437300.0,5444600.0,11057441.0,,\nQQQ,20131219,860000.0,860100.0,855200.0,859000.0,42197117.0,0.5838794355075864,0.4652127861036067\nSPY,20131220,5453900.0,5516300.0,5448100.0,5487000.0,13862042.0,,\nQQQ,20131220,857900.0,866800.0,857300.0,864700.0,34200758.0,0.5994785429963532,0.48359632037203704\nSPY,20131223,5678800.0,5707200.0,5627600.0,5700900.0,16862588.0,,\nQQQ,20131223,872100.0,874100.0,869500.0,874100.0,24476170.0,0.6178860936205992,0.5004489870175759\nSPY,20131224,5698900.0,5718800.0,5660300.0,5676700.0,5819031.0,,\nQQQ,20131224,874300.0,875100.0,872700.0,874500.0,12736703.0,0.6359687385570433,0.5176068523515872\nSPY,20131226,5681000.0,5695000.0,5633800.0,5639000.0,7143023.0,,\nQQQ,20131226,876100.0,878100.0,874400.0,877400.0,13877683.0,0.6529092419925852,0.5334209436076058\nSPY,20131227,5638200.0,5644100.0,5595000.0,5600900.0,7907277.0,,\nQQQ,20131227,878500.0,879000.0,874200.0,875200.0,14785346.0,0.6696908888926766,0.5492417837289717\nSPY,20131230,5574600.0,5580900.0,5523300.0,5545200.0,8699433.0,,\nQQQ,20131230,873900.0,875100.0,871400.0,873900.0,18024432.0,0.6854368682161602,0.5645594584450178\nSPY,20131231,5541700.0,5612800.0,5540000.0,5611100.0,7737963.0,,\nQQQ,20131231,875500.0,879600.0,875200.0,879600.0,23007605.0,0.7047448736859727,0.5840426828280553\nSPY,20140102,5556800.0,5570700.0,5520300.0,5531300.0,7947737.0,,\nQQQ,20140102,875600.0,875800.0,870200.0,872700.0,27825620.0,0.7232904974898989,0.6022578703997729\nSPY,20140103,5530000.0,5536800.0,5404300.0,5409800.0,13567943.0,,\nQQQ,20140103,872700.0,873500.0,866200.0,866400.0,29271884.0,0.7400004802353283,0.620894487118718\nSPY,20140106,5374900.0,5468000.0,5335900.0,5439300.0,14176163.0,,\nQQQ,20140106,866600.0,867600.0,860000.0,863200.0,27757464.0,0.7540094273216017,0.6388973405954146\nSPY,20140107,5443200.0,5459600.0,5379500.0,5401300.0,11020143.0,,\nQQQ,20140107,867200.0,872500.0,865600.0,870900.0,25858017.0,0.7671512115725506,0.655667143028149\nSPY,20140108,5388100.0,5460700.0,5386900.0,5434600.0,8819395.0,,\nQQQ,20140108,871400.0,875500.0,869500.0,873100.0,23942763.0,0.7808318165927949,0.6729024909341094\nSPY,20140109,5468000.0,5469800.0,5353600.0,5364700.0,9764580.0,,\nQQQ,20140109,876300.0,876400.0,867200.0,870100.0,22253847.0,0.7921632390308124,0.6871650876866378\nSPY,20140110,5398300.0,5408000.0,5311200.0,5329400.0,10551229.0,,\nQQQ,20140110,872300.0,874000.0,865800.0,873000.0,35086007.0,0.803911656509843,0.7024167677786292\nSPY,20140113,5300000.0,5425000.0,5298800.0,5357300.0,13240846.0,,\nQQQ,20140113,871700.0,874800.0,856800.0,859800.0,40329318.0,0.8151386044422468,0.7164787733307737\nSPY,20140114,5380500.0,5475100.0,5376600.0,5463900.0,12452805.0,,\nQQQ,20140114,863000.0,877200.0,863000.0,876500.0,35990060.0,0.8240220179598798,0.7288479391264076\nSPY,20140115,5535200.0,5602000.0,5516600.0,5573700.0,13320329.0,,\nQQQ,20140115,880300.0,885400.0,879400.0,883700.0,34433362.0,0.8312923184400721,0.7381774920967852\nSPY,20140116,5550000.0,5568400.0,5516600.0,5542500.0,7992055.0,,\nQQQ,20140116,883000.0,885100.0,881600.0,883800.0,27909058.0,0.8411208225369581,0.7508608549502167\nSPY,20140117,5514800.0,5520800.0,5399000.0,5406000.0,14793616.0,,\nQQQ,20140117,881100.0,883800.0,876700.0,878500.0,30782579.0,0.8492610589984191,0.7623470445273381\nSPY,20140121,5410000.0,5500600.0,5404200.0,5490700.0,11350081.0,,\nQQQ,20140121,884400.0,885900.0,878100.0,885500.0,24876851.0,0.8574781053032621,0.7736723862073297\nSPY,20140122,5508800.0,5572900.0,5478100.0,5515100.0,13334883.0,,\nQQQ,20140122,887800.0,890000.0,885200.0,888100.0,25718497.0,0.8663487339324459,0.7853621664794204\nSPY,20140123,5498500.0,5565000.0,5448100.0,5561800.0,14140803.0,,\nQQQ,20140123,885100.0,885200.0,878600.0,884700.0,29992632.0,0.8763943359859867,0.797059445487974\nSPY,20140124,5540000.0,5555800.0,5447500.0,5460700.0,15007786.0,,\nQQQ,20140124,880500.0,881800.0,867100.0,867100.0,61735444.0,0.8786751718613247,0.802033357383848\nSPY,20140127,5507600.0,5548000.0,5458000.0,5505000.0,14670294.0,,\nQQQ,20140127,867400.0,868900.0,852500.0,859000.0,59324167.0,0.8800264084193706,0.8055339185774404\nSPY,20140128,5088900.0,5150000.0,5020700.0,5069500.0,35371978.0,,\nQQQ,20140128,855000.0,859400.0,853100.0,858400.0,42937856.0,0.8801923747511896,0.8095410923305522\nSPY,20140129,5040000.0,5100000.0,4986200.0,5005700.0,17445195.0,,\nQQQ,20140129,851100.0,857400.0,847600.0,849300.0,47807341.0,0.8809784457621403,0.8146049890639815\nSPY,20140130,5024800.0,5065000.0,4967000.0,4994400.0,26124158.0,,\nQQQ,20140130,859700.0,867900.0,858800.0,864900.0,59035956.0,0.880946806042359,0.8187772860319662\nSPY,20140131,4951000.0,5015300.0,4935600.0,5006000.0,17591938.0,,\nQQQ,20140131,855400.0,866800.0,854500.0,862700.0,39874762.0,0.8811089491062186,0.8228472252472315\nSPY,20140203,5024100.0,5077300.0,4993000.0,5015300.0,13293407.0,,\nQQQ,20140203,861100.0,865000.0,840700.0,842900.0,60101399.0,0.8816717693314169,0.827255357476976\nSPY,20140204,5059100.0,5094600.0,5027600.0,5087900.0,13316963.0,,\nQQQ,20140204,847200.0,852500.0,844600.0,849100.0,35682519.0,0.8820986348452041,0.830661283578447\nSPY,20140205,5066900.0,5152700.0,5063200.0,5125900.0,11177212.0,,\nQQQ,20140205,846300.0,849900.0,837400.0,846900.0,38952842.0,0.8836224558292043,0.8356981848606098\nSPY,20140206,5105700.0,5135000.0,5078100.0,5125100.0,8906928.0,,\nQQQ,20140206,849400.0,858800.0,849200.0,857700.0,29877943.0,0.8849788096303601,0.8402024584279836\nSPY,20140207,5212500.0,5246200.0,5173800.0,5199500.0,12468510.0,,\nQQQ,20140207,862500.0,873500.0,860000.0,873100.0,35785768.0,0.8874140833921899,0.8456272039311545\nSPY,20140210,5186600.0,5319900.0,5180000.0,5289900.0,11875614.0,,\nQQQ,20140210,872700.0,878300.0,872100.0,878100.0,27965402.0,0.8905619280209408,0.8514154807771427\nSPY,20140211,5306100.0,5377500.0,5295000.0,5359600.0,9772092.0,,\nQQQ,20140211,879900.0,889700.0,878900.0,887900.0,36673442.0,0.8944377541020895,0.8572629976633994\nSPY,20140212,5369200.0,5395600.0,5332400.0,5359200.0,10876046.0,,\nQQQ,20140212,889800.0,891600.0,887100.0,889700.0,30459185.0,0.8971459501467884,0.8626842112219009\nSPY,20140213,5346600.0,5448500.0,5342000.0,5444300.0,10667043.0,,\nQQQ,20140213,883200.0,897000.0,883000.0,896300.0,36046644.0,0.8999571614572559,0.8677766050632153\nSPY,20140214,5424700.0,5459800.0,5412000.0,5439900.0,9580305.0,,\nQQQ,20140214,896000.0,900100.0,893300.0,898100.0,31687128.0,0.9026633592278872,0.8726515354655692\nSPY,20140218,5460000.0,5511800.0,5455700.0,5459900.0,8926172.0,,\nQQQ,20140218,899600.0,904100.0,897400.0,902500.0,26876524.0,0.9049008169472059,0.8768722008662226\nSPY,20140219,5445000.0,5468800.0,5343600.0,5373700.0,10855231.0,,\nQQQ,20140219,900800.0,902900.0,894500.0,896400.0,34832280.0,0.9065027633654207,0.8805544567869669\nSPY,20140220,5327600.0,5369900.0,5290000.0,5311500.0,10582841.0,,\nQQQ,20140220,896900.0,902200.0,893100.0,900500.0,37174480.0,0.9071744147939397,0.8833207417053307\nSPY,20140221,5327200.0,5345600.0,5246000.0,5252500.0,9783649.0,,\nQQQ,20140221,903400.0,904700.0,898300.0,899300.0,27496934.0,0.9075505051743884,0.8857267122015549\nSPY,20140224,5230400.0,5299100.0,5224200.0,5275500.0,9765997.0,,\nQQQ,20140224,901400.0,908200.0,900400.0,904300.0,30101716.0,0.9079968157106719,0.8884731254608412\nSPY,20140225,5290800.0,5295600.0,5210000.0,5220600.0,8118914.0,,\nQQQ,20140225,905400.0,907200.0,900200.0,903100.0,24950263.0,0.9077998827746026,0.8900984771985896\nSPY,20140226,5236100.0,5250000.0,5156100.0,5173500.0,9684680.0,,\nQQQ,20140226,905500.0,908400.0,898800.0,902300.0,37952454.0,0.9076509324447908,0.891339143611556\nSPY,20140227,5171400.0,5287800.0,5160500.0,5276700.0,10177957.0,,\nQQQ,20140227,898800.0,905300.0,897300.0,904400.0,26390229.0,0.9076855756439429,0.8932052048800159\nSPY,20140228,5290800.0,5327500.0,5221300.0,5262400.0,12576984.0,,\nQQQ,20140228,904200.0,909600.0,895500.0,903400.0,41851761.0,0.9074968519096638,0.8946044696286379\nSPY,20140303,5232000.0,5306500.0,5228100.0,5277600.0,8256993.0,,\nQQQ,20140303,894900.0,899000.0,888700.0,896800.0,35467056.0,0.9069496757847585,0.8948410548527485\nSPY,20140304,5311700.0,5326400.0,5277700.0,5312400.0,8995123.0,,\nQQQ,20140304,906500.0,909800.0,905600.0,908300.0,30906558.0,0.9057543581238565,0.8941384229827277\nSPY,20140305,5308500.0,5347500.0,5291300.0,5323600.0,7189931.0,,\nQQQ,20140305,909600.0,912200.0,907700.0,910600.0,24910323.0,0.9048476375387966,0.8945242924369569\nSPY,20140306,5327800.0,5344300.0,5281000.0,5307500.0,6210965.0,,\nQQQ,20140306,912700.0,913300.0,906500.0,909800.0,22567197.0,0.9036921876416959,0.894181057676965\nSPY,20140307,5313900.0,5319100.0,5260500.0,5304400.0,7617556.0,,\nQQQ,20140307,913200.0,913600.0,900700.0,905400.0,28582649.0,0.9028314824801857,0.8943805239920918\nSPY,20140310,5283600.0,5333300.0,5283600.0,5309200.0,6103050.0,,\nQQQ,20140310,904800.0,906600.0,900300.0,906100.0,17206260.0,0.9020292873282449,0.8946039862549028\nSPY,20140311,5351000.0,5387400.0,5325500.0,5360900.0,9680769.0,,\nQQQ,20140311,908300.0,910500.0,899500.0,902200.0,23484073.0,0.9019077371094002,0.8950991098094065\nSPY,20140312,5343500.0,5373500.0,5320000.0,5366100.0,6961901.0,,\nQQQ,20140312,898100.0,906100.0,894800.0,905500.0,26867060.0,0.901392942042848,0.8951538505547995\nSPY,20140313,5374400.0,5396600.0,5291600.0,5306500.0,9019961.0,,\nQQQ,20140313,909000.0,909300.0,888700.0,892900.0,45554081.0,0.9008594730620452,0.8948437779764438\nSPY,20140314,5282600.0,5308900.0,5230000.0,5246700.0,8255742.0,,\nQQQ,20140314,889900.0,893800.0,886300.0,886500.0,35799615.0,0.9002741402250941,0.8946154415795652\nSPY,20140317,5272500.0,5299700.0,5258500.0,5267400.0,6875252.0,,\nQQQ,20140317,892400.0,899100.0,891900.0,894500.0,24699347.0,0.900223332610983,0.8951321042312872\nSPY,20140318,5257600.0,5319700.0,5252000.0,5314000.0,7121883.0,,\nQQQ,20140318,895600.0,906300.0,895300.0,905300.0,28629543.0,0.9010429470846483,0.896656596496818\nSPY,20140319,5322600.0,5362200.0,5290000.0,5312600.0,7752258.0,,\nQQQ,20140319,905600.0,906600.0,894500.0,900600.0,36461083.0,0.9019706714757638,0.8978886382047705\nSPY,20140320,5300000.0,5326700.0,5273500.0,5287000.0,6706576.0,,\nQQQ,20140320,897600.0,905600.0,895800.0,902900.0,29064586.0,0.9023152893490562,0.8985667490991185\nSPY,20140321,5336800.0,5337500.0,5263300.0,5328700.0,12087211.0,,\nQQQ,20140321,906000.0,906500.0,888300.0,890000.0,55655583.0,0.9036089409083494,0.8995843266833197\nSPY,20140324,5382500.0,5405000.0,5350600.0,5391000.0,11628740.0,,\nQQQ,20140324,893200.0,893900.0,874100.0,882200.0,71913746.0,0.9056982856056783,0.9008354896893915\nSPY,20140325,5412400.0,5457500.0,5395900.0,5449900.0,9947341.0,,\nQQQ,20140325,886800.0,892500.0,877800.0,885100.0,39905615.0,0.9082405840662444,0.9022546242347862\nSPY,20140326,5471100.0,5490100.0,5388600.0,5397800.0,10315890.0,,\nQQQ,20140326,889500.0,891500.0,873600.0,873700.0,37871980.0,0.9102728031791972,0.9033910566805171\nSPY,20140327,5397600.0,5415000.0,5351200.0,5374600.0,7525058.0,,\nQQQ,20140327,872500.0,876400.0,864000.0,868900.0,61956289.0,0.9115069469388485,0.9038027369264465\nSPY,20140328,5377100.0,5389200.0,5342500.0,5368600.0,6951213.0,,\nQQQ,20140328,871600.0,880100.0,868100.0,870500.0,38160798.0,0.912077678608578,0.9036640104319166\nSPY,20140331,5392300.0,5408300.0,5359300.0,5367400.0,5693824.0,,\nQQQ,20140331,877300.0,882600.0,876200.0,876800.0,29215241.0,0.9120419707767692,0.9024934587672607\nSPY,20140401,5379000.0,5418700.0,5367700.0,5417400.0,7002591.0,,\nQQQ,20140401,880800.0,892700.0,880800.0,892100.0,32216185.0,0.9119713488018724,0.9012726656153968\nSPY,20140402,5423800.0,5434800.0,5402500.0,5425500.0,5979109.0,,\nQQQ,20140402,895800.0,896800.0,890400.0,894400.0,28852842.0,0.9120865421886062,0.9002940814242529\nSPY,20140403,5416700.0,5425000.0,5376400.0,5387900.0,5684220.0,,\nQQQ,20140403,895300.0,896800.0,882200.0,887300.0,28025987.0,0.9119528465746096,0.898846076770537\nSPY,20140404,5400000.0,5400000.0,5303100.0,5318200.0,9152044.0,,\nQQQ,20140404,893200.0,894100.0,861400.0,863700.0,105004938.0,0.9116742513286732,0.8974798082676525\nSPY,20140407,5282400.0,5309000.0,5218900.0,5234700.0,8909613.0,,\nQQQ,20140407,858300.0,866200.0,849500.0,855500.0,76128955.0,0.9113561857113848,0.8968195451409838\nSPY,20140408,5250700.0,5261200.0,5186900.0,5234400.0,8231064.0,,\nQQQ,20140408,856500.0,864500.0,853500.0,863400.0,49757280.0,0.9109319711991412,0.8959009507853125\nSPY,20140409,5228000.0,5304900.0,5220200.0,5303000.0,7161962.0,,\nQQQ,20140409,866600.0,878700.0,864300.0,878200.0,42483078.0,0.9106820966183373,0.8947326487394867\nSPY,20140410,5307000.0,5322400.0,5231700.0,5234800.0,8028551.0,,\nQQQ,20140410,878800.0,878800.0,848600.0,851100.0,67439802.0,0.9104237092352789,0.8948215086832803\nSPY,20140411,5191800.0,5228300.0,5171400.0,5196100.0,9481701.0,,\nQQQ,20140411,843300.0,854400.0,839100.0,841100.0,83684201.0,0.9099511008730183,0.8947030287582223\nSPY,20140414,5217900.0,5221700.0,5172100.0,5216800.0,7013924.0,,\nQQQ,20140414,848600.0,852200.0,839900.0,847700.0,44542889.0,0.9092581010374842,0.8943303419053498\nSPY,20140415,5199600.0,5216400.0,5113300.0,5179500.0,9115796.0,,\nQQQ,20140415,850800.0,855400.0,832800.0,850600.0,77906223.0,0.9086326259904506,0.8937754359272299\nSPY,20140416,5182500.0,5210900.0,5141400.0,5190100.0,7271911.0,,\nQQQ,20140416,857900.0,861800.0,850900.0,861800.0,39759150.0,0.9072837570472722,0.8920132345102273\nSPY,20140417,5200000.0,5277600.0,5192000.0,5249400.0,9841130.0,,\nQQQ,20140417,858500.0,866300.0,856400.0,862000.0,51035550.0,0.9057636368881911,0.8905817065484206\nSPY,20140421,5252800.0,5321400.0,5239600.0,5311700.0,6346726.0,,\nQQQ,20140421,864000.0,868400.0,860000.0,868400.0,24617562.0,0.904476878676509,0.8887463921753738\nSPY,20140422,5282900.0,5318300.0,5265000.0,5316900.0,7002681.0,,\nQQQ,20140422,871400.0,877500.0,869900.0,875300.0,28569180.0,0.9032594591689761,0.8865503888489311\nSPY,20140423,5290400.0,5311300.0,5244500.0,5247500.0,8934671.0,,\nQQQ,20140423,875300.0,875600.0,867100.0,867600.0,28084736.0,0.9020301346357541,0.8848290551846494\nSPY,20140424,5683600.0,5700000.0,5607300.0,5677700.0,25484506.0,,\nQQQ,20140424,881900.0,882100.0,866600.0,875900.0,45728630.0,0.9008624661863206,0.8829581218401134\nSPY,20140425,5641000.0,5719900.0,5639600.0,5719400.0,13487447.0,,\nQQQ,20140425,870700.0,871700.0,859800.0,861900.0,41998612.0,0.8988981765453727,0.880027242891368\nSPY,20140428,5725700.0,5957500.0,5725700.0,5940900.0,22819610.0,,\nQQQ,20140428,866000.0,871100.0,851100.0,864700.0,56034542.0,0.895589524170549,0.8774163493010525\nSPY,20140429,5937700.0,5959800.0,5895100.0,5923300.0,11702037.0,,\nQQQ,20140429,867300.0,873200.0,863200.0,871600.0,35440778.0,0.8933927838617034,0.8755866586331257\nSPY,20140430,5926400.0,5994300.0,5899000.0,5900900.0,12414705.0,,\nQQQ,20140430,867600.0,874800.0,865400.0,873900.0,36591919.0,0.8920517914023878,0.8744991314621868\nSPY,20140501,5920000.0,5948000.0,5863600.0,5914800.0,8485996.0,,\nQQQ,20140501,875300.0,881500.0,873100.0,876500.0,34723173.0,0.890722676082788,0.8731877666420674\nSPY,20140502,5928900.0,5942000.0,5897100.0,5925800.0,6467235.0,,\nQQQ,20140502,879500.0,881100.0,872800.0,874900.0,36675211.0,0.8894105922218832,0.8719377275080389\nSPY,20140505,5901300.0,6010000.0,5899500.0,6009600.0,9886270.0,,\nQQQ,20140505,869700.0,879700.0,867600.0,879500.0,26314378.0,0.8879872184750313,0.8709055266274208\nSPY,20140506,6016200.0,6044000.0,5944100.0,5944100.0,12348031.0,,\nQQQ,20140506,878100.0,878600.0,867700.0,868100.0,30419125.0,0.8867250270369442,0.8693165446688087\nSPY,20140507,5951000.0,5972900.0,5877500.0,5923300.0,9790289.0,,\nQQQ,20140507,869900.0,870800.0,855300.0,865600.0,53682765.0,0.8853784964605689,0.8675443812747434\nSPY,20140508,5882500.0,5953200.0,5864000.0,5881200.0,7956963.0,,\nQQQ,20140508,862500.0,875300.0,860500.0,864800.0,44446172.0,0.8845087417748257,0.8655875859947414\nSPY,20140509,5846100.0,5862500.0,5803300.0,5855500.0,10161906.0,,\nQQQ,20140509,864300.0,868600.0,858500.0,868000.0,33332319.0,0.883658284580132,0.8637232381888234\nSPY,20140512,5874500.0,5936600.0,5873700.0,5928300.0,6772318.0,,\nQQQ,20140512,873200.0,882600.0,872400.0,882300.0,37120129.0,0.8830830973247419,0.8623408463810374\nSPY,20140513,5920000.0,5945500.0,5906800.0,5937600.0,5251387.0,,\nQQQ,20140513,883100.0,886100.0,881200.0,882900.0,26042141.0,0.8825768385117623,0.8609367082415855\nSPY,20140514,5924300.0,5973700.0,5917400.0,5938700.0,5861860.0,,\nQQQ,20140514,880200.0,883500.0,876200.0,878300.0,23363797.0,0.8814212672388381,0.8591861285424934\nSPY,20140515,5947000.0,5966000.0,5880400.0,5888200.0,7879691.0,,\nQQQ,20140515,878100.0,879600.0,865800.0,871500.0,55388370.0,0.8799705381460389,0.8568322756080531\nSPY,20140516,5888100.0,5975300.0,5854000.0,5975100.0,9663223.0,,\nQQQ,20140516,872400.0,877600.0,866400.0,877000.0,62860032.0,0.878411010193963,0.8548616080350335\nSPY,20140519,5976300.0,6073300.0,5972800.0,6045900.0,11058117.0,,\nQQQ,20140519,874500.0,884500.0,873000.0,883200.0,28226365.0,0.8770300654855524,0.8531443977069457\nSPY,20140520,6045100.0,6064400.0,6007300.0,6045500.0,7989435.0,,\nQQQ,20140520,882800.0,886000.0,876400.0,880000.0,32121236.0,0.8754659755198382,0.8512824617922546\nSPY,20140521,6040000.0,6067100.0,6020600.0,6063100.0,6865057.0,,\nQQQ,20140521,881300.0,888900.0,881100.0,888400.0,32678326.0,0.8743889113220956,0.84979396288341\nSPY,20140522,6066000.0,6098500.0,6041000.0,6073000.0,6940437.0,,\nQQQ,20140522,889400.0,894800.0,888000.0,892300.0,29916293.0,0.8734774035746328,0.8484449404466283\nSPY,20140523,6072500.0,6147500.0,6064900.0,6141300.0,8184957.0,,\nQQQ,20140523,893200.0,899000.0,891300.0,898800.0,20407426.0,0.8726911168526608,0.847485102359313\nSPY,20140527,6158900.0,6258600.0,6156100.0,6257100.0,11428480.0,,\nQQQ,20140527,902800.0,910200.0,902000.0,910200.0,25720519.0,0.8722460406739136,0.8476860684588444\nSPY,20140528,6260900.0,6298300.0,6238200.0,6240100.0,10976548.0,,\nQQQ,20140528,909700.0,911000.0,906500.0,907200.0,28293408.0,0.8716236101861962,0.847724312007636\nSPY,20140529,6280000.0,6368700.0,6277500.0,6353800.0,13073141.0,,\nQQQ,20140529,910400.0,913100.0,908600.0,913000.0,25483306.0,0.8709655093555048,0.847950773806362\nSPY,20140530,6379800.0,6441700.0,6289000.0,6330000.0,19661438.0,,\nQQQ,20140530,913200.0,914500.0,908300.0,913100.0,28188860.0,0.8706441976508336,0.8481712366170424\nSPY,20140602,6340000.0,6348300.0,6225000.0,6286500.0,12991558.0,,\nQQQ,20140602,914200.0,914400.0,906400.0,912200.0,25887041.0,0.8704507956965108,0.8483901996807112\nSPY,20140603,6284700.0,6387100.0,6282500.0,6375400.0,10184007.0,,\nQQQ,20140603,909200.0,913300.0,908000.0,911800.0,18172523.0,0.8698871479001217,0.8486286594555286\nSPY,20140604,6372800.0,6479000.0,6361000.0,6448200.0,11799618.0,,\nQQQ,20140604,909500.0,916700.0,908100.0,915200.0,18691262.0,0.8692532218577156,0.8488401237841403\nSPY,20140605,6462500.0,6493500.0,6426100.0,6473500.0,10445282.0,,\nQQQ,20140605,916000.0,924600.0,912900.0,922900.0,33347504.0,0.8690871133493571,0.8491385734394149\nSPY,20140606,6500000.0,6512500.0,6444800.0,6455700.0,12116671.0,,\nQQQ,20140606,926300.0,928200.0,924500.0,928200.0,20317781.0,0.8690589618145476,0.8493380397919351\nSPY,20140609,926900.0,938800.0,917500.0,937000.0,72875948.0,,\nQQQ,20140609,928400.0,929800.0,925000.0,927500.0,22411660.0,0.7276686291806262,0.8259622329982743\nSPY,20140610,946400.0,950500.0,935700.0,942500.0,60833696.0,,\nQQQ,20140610,926700.0,929600.0,925600.0,929100.0,19209256.0,0.6174978320702502,0.8025631801259362\nSPY,20140611,941300.0,947600.0,928600.0,938600.0,43961198.0,,\nQQQ,20140611,925900.0,930200.0,925000.0,928900.0,19775586.0,0.527954952658644,0.779364343479624\nSPY,20140612,940400.0,941200.0,919000.0,922600.0,53269396.0,,\nQQQ,20140612,926900.0,927900.0,917300.0,920500.0,28209727.0,0.4555693674264105,0.7567616562703556\nSPY,20140613,921800.0,924400.0,908800.0,912800.0,52677810.0,,\nQQQ,20140613,924500.0,925500.0,919200.0,923200.0,36056588.0,0.39258303678567297,0.734103478421664\nSPY,20140616,915800.0,927500.0,914500.0,922000.0,34610650.0,,\nQQQ,20140616,921600.0,926700.0,919600.0,924000.0,22562853.0,0.3369099519976138,0.7115960251476214\nSPY,20140617,924000.0,927000.0,918000.0,920800.0,28883049.0,,\nQQQ,20140617,923300.0,927000.0,921800.0,924500.0,19276742.0,0.2875587953652107,0.6892872883525932\nSPY,20140618,922600.0,922900.0,913500.0,921800.0,32596437.0,,\nQQQ,20140618,925400.0,931000.0,919800.0,929700.0,33010865.0,0.24167338491816873,0.6669448072498079\nSPY,20140619,922600.0,923000.0,913400.0,918600.0,34721227.0,,\nQQQ,20140619,931100.0,931700.0,924900.0,929100.0,31932813.0,0.19941255889495765,0.6447258012047177\nSPY,20140620,919200.0,925500.0,909000.0,909100.0,78569071.0,,\nQQQ,20140620,927000.0,928700.0,925300.0,927700.0,23569535.0,0.15991277847097363,0.6228943548033612\nSPY,20140623,913300.0,916200.0,906000.0,908300.0,42615345.0,,\nQQQ,20140623,927600.0,928200.0,925100.0,927900.0,18030134.0,0.1227739318527707,0.6012421282034687\nSPY,20140624,907500.0,917400.0,901900.0,902800.0,38045810.0,,\nQQQ,20140624,927800.0,935700.0,924300.0,927000.0,30711382.0,0.08701410730397409,0.57977624520468\nSPY,20140625,902500.0,907000.0,896500.0,903600.0,35839195.0,,\nQQQ,20140625,924900.0,934500.0,924800.0,932900.0,27844900.0,0.05202460955238736,0.5582743682708693\nSPY,20140626,904300.0,910500.0,898000.0,909000.0,31624602.0,,\nQQQ,20140626,933500.0,933600.0,926200.0,933400.0,21254573.0,0.018826763231244936,0.5369562103804005\nSPY,20140627,908600.0,920000.0,907700.0,919800.0,40494262.0,,\nQQQ,20140627,932200.0,937600.0,931900.0,937400.0,20826102.0,-0.01376583077996436,0.5158378938166687\nSPY,20140630,921600.0,937200.0,920900.0,929300.0,47487348.0,,\nQQQ,20140630,937300.0,941400.0,936700.0,939100.0,18441080.0,-0.04494829613554024,0.4949392902313009\nSPY,20140701,935600.0,940700.0,931300.0,935200.0,37123859.0,,\nQQQ,20140701,942400.0,951900.0,942000.0,949400.0,30211114.0,-0.07569285772498614,0.47422844109125184\nSPY,20140702,938500.0,940600.0,930900.0,934800.0,27737757.0,,\nQQQ,20140702,950000.0,952400.0,949100.0,951000.0,16607753.0,-0.1046646030644103,0.45370627792359025\nSPY,20140703,936900.0,941000.0,932000.0,941000.0,22035671.0,,\nQQQ,20140703,954100.0,956800.0,951600.0,956500.0,13034409.0,-0.13310881061463709,0.43339482921103467\nSPY,20140707,941500.0,959900.0,941000.0,959700.0,54013617.0,,\nQQQ,20140707,955900.0,957100.0,952300.0,954100.0,21024203.0,-0.15965354069129872,0.41326897419114356\nSPY,20140708,962000.0,968000.0,939200.0,953200.0,63148759.0,,\nQQQ,20140708,952300.0,953000.0,938700.0,942900.0,38108601.0,-0.1830673954114412,0.3933223389391184\nSPY,20140709,954500.0,959500.0,947700.0,953900.0,35530162.0,,\nQQQ,20140709,945100.0,950600.0,942500.0,949600.0,26433732.0,-0.20610836237807673,0.3735691710515677\nSPY,20140710,937500.0,955500.0,935200.0,950400.0,38041019.0,,\nQQQ,20140710,937400.0,950500.0,936300.0,946600.0,36106183.0,-0.2275640103496298,0.3539967226788945\nSPY,20140711,953800.0,958900.0,948700.0,952300.0,33392700.0,,\nQQQ,20140711,949000.0,952700.0,946200.0,952700.0,18401479.0,-0.24792997127457006,0.33463123939379863\nSPY,20140714,958600.0,968900.0,956500.0,964500.0,41202273.0,,\nQQQ,20140714,957000.0,960500.0,955400.0,958400.0,17520943.0,-0.2682534246264096,0.31549521740145164\nSPY,20140715,968000.0,968500.0,950300.0,953200.0,42877882.0,,\nQQQ,20140715,959900.0,961300.0,948300.0,955100.0,35339512.0,-0.28710106061813995,0.29674431108433336\nSPY,20140716,970200.0,971000.0,947400.0,947800.0,50656145.0,,\nQQQ,20140716,962000.0,963000.0,957900.0,958900.0,20026624.0,-0.30573956702019206,0.2780044373752021\nSPY,20140717,950400.0,952800.0,925700.0,930800.0,56130224.0,,\nQQQ,20140717,956300.0,959700.0,943200.0,946100.0,39788499.0,-0.3216749300081393,0.2596287940073827\nSPY,20140718,936400.0,947400.0,930200.0,944300.0,48510804.0,,\nQQQ,20140718,951100.0,961700.0,950000.0,961200.0,34080235.0,-0.3392784217485193,0.2412512307294704\nSPY,20140721,950000.0,950000.0,937300.0,939500.0,37909339.0,,\nQQQ,20140721,959200.0,961600.0,955500.0,960000.0,25727045.0,-0.35699861239346353,0.22295995152845463\nSPY,20140722,947100.0,948900.0,941200.0,947200.0,47741734.0,,\nQQQ,20140722,964500.0,967600.0,963500.0,966100.0,21643377.0,-0.3747096969605006,0.20486701375815192\nSPY,20140723,954300.0,978800.0,951700.0,971900.0,87866712.0,,\nQQQ,20140723,969500.0,973400.0,967700.0,972400.0,25302052.0,-0.3933802221491869,0.18700953613621935\nSPY,20140724,970800.0,973200.0,964200.0,970300.0,43840339.0,,\nQQQ,20140724,974000.0,975100.0,969800.0,971200.0,22239162.0,-0.40999119585445876,0.16934177640453402\nSPY,20140725,969000.0,978400.0,966500.0,976900.0,42306431.0,,\nQQQ,20140725,966200.0,968700.0,962300.0,967400.0,23384467.0,-0.425436439892299,0.15185998519767613\nSPY,20140728,978000.0,992400.0,975500.0,990200.0,52748822.0,,\nQQQ,20140728,968400.0,970200.0,960200.0,967700.0,21983478.0,-0.4400315145475879,0.13463690020479183\nSPY,20140729,992800.0,994400.0,982500.0,983800.0,42496523.0,,\nQQQ,20140729,969800.0,972000.0,965200.0,966000.0,25167304.0,-0.45381118459614367,0.11754279338235228\nSPY,20140730,983800.0,987000.0,975900.0,981300.0,32369882.0,,\nQQQ,20140730,971400.0,973200.0,966000.0,969800.0,30946048.0,-0.4670709749742085,0.10086561599460638\nSPY,20140731,971800.0,974500.0,953300.0,955700.0,55112283.0,,\nQQQ,20140731,961800.0,963400.0,948800.0,950300.0,47218109.0,-0.47795708006529547,0.08436128435271821\nSPY,20140801,950000.0,966200.0,948100.0,961300.0,45461799.0,,\nQQQ,20140801,948200.0,953400.0,940400.0,946500.0,57744099.0,-0.48751504905234927,0.06811640879788758\nSPY,20140804,963500.0,965800.0,951700.0,955900.0,38674177.0,,\nQQQ,20140804,948700.0,956900.0,945200.0,953200.0,30827711.0,-0.49706300407215026,0.05228171381999479\nSPY,20140805,953500.0,956800.0,943600.0,951200.0,55156025.0,,\nQQQ,20140805,949600.0,952200.0,941500.0,945900.0,43571883.0,-0.50534600083645,0.03660824155515797\nSPY,20140806,948000.0,954800.0,947100.0,949700.0,35940623.0,,\nQQQ,20140806,940000.0,951100.0,939200.0,945200.0,31672131.0,-0.5138081034117279,0.02093251967106922\nSPY,20140807,949200.0,959500.0,941000.0,944800.0,45737704.0,,\nQQQ,20140807,949600.0,951400.0,938900.0,942200.0,31336166.0,-0.5219112315021591,0.005463387821617338\nSPY,20140808,942000.0,948200.0,932800.0,947400.0,41088716.0,,\nQQQ,20140808,943700.0,950100.0,939700.0,948700.0,37213639.0,-0.530426021568531,-0.009805152977869526\nSPY,20140811,952900.0,960800.0,948400.0,959900.0,36041206.0,,\nQQQ,20140811,952700.0,957600.0,952000.0,954600.0,26312581.0,-0.5397652931934287,-0.024981459388026678\nSPY,20140812,962200.0,968800.0,956100.0,959700.0,32763944.0,,\nQQQ,20140812,953600.0,956700.0,949300.0,954200.0,25161676.0,-0.5482672819795056,-0.03992268807058245\nSPY,20140813,961700.0,972400.0,960400.0,972400.0,31053455.0,,\nQQQ,20140813,958100.0,964700.0,957600.0,964300.0,25864146.0,-0.5562966075655267,-0.054377244347174385\nSPY,20140814,973900.0,975700.0,968000.0,975000.0,27460474.0,,\nQQQ,20140814,965600.0,969500.0,964300.0,969300.0,21646680.0,-0.5643301370754513,-0.06860121460721455\nSPY,20140815,979900.0,981900.0,968600.0,979800.0,47800225.0,,\nQQQ,20140815,974900.0,976300.0,964800.0,974000.0,52041436.0,-0.5732488390522817,-0.08267670996879212\nSPY,20140818,984800.0,993700.0,979800.0,991600.0,45257170.0,,\nQQQ,20140818,979100.0,982400.0,977700.0,981500.0,36443608.0,-0.5822821780467715,-0.09624789754340167\nSPY,20140819,994100.0,1006800.0,993200.0,1005600.0,67308924.0,,\nQQQ,20140819,983800.0,987600.0,983200.0,987100.0,20134213.0,-0.5912450100698106,-0.10952065112986556\nSPY,20140820,1004800.0,1010900.0,999500.0,1005700.0,51129491.0,,\nQQQ,20140820,986200.0,989000.0,985300.0,987000.0,21476088.0,-0.6000710433078842,-0.12286501759584964\nSPY,20140821,1005500.0,1009400.0,1001100.0,1005800.0,32597331.0,,\nQQQ,20140821,987500.0,989500.0,986000.0,989000.0,16063783.0,-0.6089442458508878,-0.13594317911702045\nSPY,20140822,1003100.0,1014800.0,1001900.0,1013100.0,43114284.0,,\nQQQ,20140822,989400.0,992500.0,987200.0,990500.0,21846385.0,-0.6171904129893866,-0.14891410878718198\nSPY,20140825,1018100.0,1021700.0,1012800.0,1015400.0,39094845.0,,\nQQQ,20140825,995500.0,996800.0,991600.0,994000.0,21151578.0,-0.6251342825056614,-0.16179280406801386\nSPY,20140826,1014600.0,1015100.0,1008600.0,1008900.0,32314867.0,,\nQQQ,20140826,995500.0,996100.0,992700.0,995000.0,17998022.0,-0.6328545919236922,-0.17444163054630094\nSPY,20140827,1010000.0,1025700.0,1007000.0,1021300.0,46316498.0,,\nQQQ,20140827,995300.0,996400.0,993100.0,995200.0,14091738.0,-0.6421625841942077,-0.18730532595391597\nSPY,20140828,1015900.0,1027800.0,1015600.0,1022500.0,65877482.0,,\nQQQ,20140828,991800.0,995300.0,990800.0,994100.0,18652210.0,-0.6509241259367708,-0.19994555922439675\nSPY,20140829,1028800.0,1029000.0,1022000.0,1025000.0,40117524.0,,\nQQQ,20140829,996300.0,999100.0,992700.0,997800.0,15587002.0,-0.659208904969767,-0.2124031984331588\nSPY,20140902,1030400.0,1037400.0,1027200.0,1033000.0,52140027.0,,\nQQQ,20140902,1000200.0,1001000.0,996700.0,1000700.0,16424740.0,-0.668017676583221,-0.22477722680873136\nSPY,20140903,1032000.0,1032000.0,985800.0,989400.0,123374711.0,,\nQQQ,20140903,1003400.0,1003400.0,993000.0,994800.0,23468745.0,-0.6762545935343053,-0.23697428516966065\nSPY,20140904,990000.0,1000900.0,977900.0,981200.0,82260202.0,,\nQQQ,20140904,997100.0,1002200.0,991400.0,993900.0,22028262.0,-0.6833752007167603,-0.24888226751090797\nSPY,20140905,988900.0,993900.0,983100.0,989700.0,57209980.0,,\nQQQ,20140905,995400.0,999500.0,990300.0,998900.0,28034536.0,-0.6905174343602966,-0.26068376789419195\nSPY,20140908,993000.0,993100.0,980500.0,983600.0,45136396.0,,\nQQQ,20140908,999200.0,1003300.0,996200.0,1000800.0,23584765.0,-0.6974257804253898,-0.27233454381585187\nSPY,20140909,991100.0,1030800.0,961400.0,979900.0,187242716.0,,\nQQQ,20140909,1000900.0,1004600.0,990700.0,992500.0,34270823.0,-0.7032031633456497,-0.28351214991022416\nSPY,20140910,980100.0,1011100.0,977600.0,1010000.0,97449384.0,,\nQQQ,20140910,993800.0,1001100.0,991000.0,1000700.0,29393854.0,-0.7090977066330216,-0.29484503497801645\nSPY,20140911,1004500.0,1014400.0,996200.0,1014300.0,60714077.0,,\nQQQ,20140911,996400.0,1000400.0,992500.0,999900.0,26806349.0,-0.7158397198149418,-0.306078508712594\nSPY,20140912,1012200.0,1021900.0,1010300.0,1016600.0,60866788.0,,\nQQQ,20140912,998700.0,999300.0,991700.0,994800.0,28578154.0,-0.7223053588601805,-0.3171283229931671\nSPY,20140915,1028100.0,1030500.0,1014400.0,1016300.0,58511837.0,,\nQQQ,20140915,995900.0,996000.0,982200.0,985200.0,30971086.0,-0.728754851503147,-0.32806372422690544\nSPY,20140916,998500.0,1012600.0,988900.0,1008600.0,63146478.0,,\nQQQ,20140916,981500.0,995700.0,980500.0,993800.0,34619414.0,-0.7360182093156723,-0.3387812872889095\nSPY,20140917,1013200.0,1018000.0,1006000.0,1015800.0,59803465.0,,\nQQQ,20140917,993600.0,1000000.0,989300.0,995300.0,35057109.0,-0.7426040679058401,-0.34931550634750896\nSPY,20140918,1019000.0,1023500.0,1015600.0,1017900.0,35889816.0,,\nQQQ,20140918,998400.0,1002900.0,997300.0,1002800.0,27032104.0,-0.7481240497707096,-0.35954715155999906\nSPY,20140919,1022900.0,1023500.0,1005000.0,1009600.0,62086165.0,,\nQQQ,20140919,1004600.0,1004700.0,995800.0,999800.0,42610305.0,-0.7532322421959342,-0.3696408200991704\nSPY,20140922,1018000.0,1021400.0,1005800.0,1010600.0,47773021.0,,\nQQQ,20140922,997400.0,997500.0,986200.0,990500.0,44814291.0,-0.7587259415479629,-0.3796123304681192\nSPY,20140923,1006500.0,1029400.0,1005400.0,1026400.0,61660067.0,,\nQQQ,20140923,986500.0,992200.0,985800.0,987800.0,30509677.0,-0.7635087156303213,-0.38950083751499304\nSPY,20140924,1021000.0,1028500.0,1012000.0,1017500.0,55977075.0,,\nQQQ,20140924,988800.0,998800.0,985400.0,998400.0,32498884.0,-0.7684258429913152,-0.3990958403598328\nSPY,20140925,1004800.0,1007100.0,977200.0,978700.0,97842006.0,,\nQQQ,20140925,995200.0,996400.0,977000.0,977400.0,64369226.0,-0.773471011849718,-0.4084632566810191\nSPY,20140926,985500.0,1007500.0,984000.0,1007500.0,60784488.0,,\nQQQ,20140926,980600.0,989600.0,978900.0,987800.0,48690943.0,-0.7781080029377777,-0.4176972738733445\nSPY,20140929,987000.0,1004400.0,986300.0,1001100.0,46707464.0,,\nQQQ,20140929,978000.0,989200.0,977500.0,986500.0,30405584.0,-0.7828869525984617,-0.42674037172020574\nSPY,20140930,1007700.0,1015400.0,1005200.0,1007500.0,52283709.0,,\nQQQ,20140930,989400.0,993000.0,983200.0,987900.0,36525121.0,-0.7880323136185265,-0.4356150171921626\nSPY,20141001,1005800.0,1006900.0,987000.0,991800.0,49982342.0,,\nQQQ,20141001,985100.0,986100.0,969000.0,972100.0,52474323.0,-0.791945957177618,-0.44430942555415953\nSPY,20141002,993600.0,1002100.0,980400.0,999000.0,46419286.0,,\nQQQ,20141002,971700.0,975100.0,959700.0,972100.0,51546624.0,-0.7958432951632236,-0.45282507397554445\nSPY,20141003,994200.0,1002100.0,990400.0,996200.0,42012699.0,,\nQQQ,20141003,977800.0,985700.0,974400.0,981700.0,38842888.0,-0.8008672944400661,-0.4611291747345759\nSPY,20141006,999400.0,1006500.0,994200.0,996200.0,36283753.0,,\nQQQ,20141006,984800.0,987200.0,976600.0,979600.0,31858655.0,-0.8053308833906002,-0.4692503942934146\nSPY,20141007,994100.0,1001200.0,987300.0,987500.0,41114215.0,,\nQQQ,20141007,975000.0,977700.0,965600.0,965700.0,43292545.0,-0.809921921255323,-0.47722155264783106\nSPY,20141008,987800.0,1011100.0,983100.0,1008000.0,56392245.0,,\nQQQ,20141008,966200.0,987600.0,960600.0,984500.0,61805524.0,-0.8166583386552393,-0.48499324457494014\nSPY,20141009,1015000.0,1023800.0,1006100.0,1010200.0,71888950.0,,\nQQQ,20141009,983200.0,985700.0,967100.0,968600.0,58887960.0,-0.8233699242416237,-0.492827550963253\nSPY,20141010,1007300.0,1020300.0,1003000.0,1007300.0,64743054.0,,\nQQQ,20141010,962800.0,968300.0,944200.0,944400.0,74259870.0,-0.8274970930601311,-0.5010409185508279\nSPY,20141013,1013100.0,1017800.0,998100.0,998100.0,52019790.0,,\nQQQ,20141013,942700.0,949900.0,928800.0,929600.0,73671039.0,-0.8301880146014369,-0.5091912967403059\nSPY,20141014,1003400.0,1005200.0,985700.0,987500.0,61748112.0,,\nQQQ,20141014,935400.0,941600.0,927100.0,929700.0,67206351.0,-0.8323934491610837,-0.5169000056057537\nSPY,20141015,980000.0,991500.0,951800.0,975400.0,96758668.0,,\nQQQ,20141015,915700.0,927500.0,902400.0,923700.0,101723479.0,-0.8344420253532789,-0.5242266501873857\nSPY,20141016,955200.0,977200.0,954100.0,962600.0,55098547.0,,\nQQQ,20141016,904200.0,925800.0,903900.0,917900.0,61162296.0,-0.8352814692913859,-0.5309811408551149\nSPY,20141017,975000.0,990000.0,968100.0,976700.0,66402540.0,,\nQQQ,20141017,930000.0,938900.0,924600.0,930000.0,63457932.0,-0.8366818348063128,-0.5377450049486945\nSPY,20141020,983700.0,999600.0,983000.0,997600.0,64746474.0,,\nQQQ,20141020,929900.0,944700.0,928100.0,943900.0,36009514.0,-0.8379670999711963,-0.5445902303786548\nSPY,20141021,1030000.0,1030200.0,1012700.0,1024700.0,88178571.0,,\nQQQ,20141021,955600.0,968700.0,953200.0,968700.0,49361784.0,-0.8397765832578623,-0.5505925973561556\nSPY,20141022,1028900.0,1041000.0,1026000.0,1029900.0,65844236.0,,\nQQQ,20141022,971700.0,973000.0,963100.0,963700.0,36737927.0,-0.8414526596118231,-0.5567899315913429\nSPY,20141023,1039500.0,1050500.0,1036300.0,1048300.0,64767408.0,,\nQQQ,20141023,973400.0,983600.0,971700.0,978200.0,44492023.0,-0.8434764277232799,-0.5618902000650106\nSPY,20141024,1051200.0,1054900.0,1045300.0,1052200.0,43168139.0,,\nQQQ,20141024,980300.0,986900.0,976400.0,986200.0,39138857.0,-0.8451544579057932,-0.56489269583338\nSPY,20141027,1049000.0,1054800.0,1047000.0,1051100.0,32561930.0,,\nQQQ,20141027,984300.0,988700.0,980200.0,986900.0,27809728.0,-0.8466407388217022,-0.5695595370957295\nSPY,20141028,1053900.0,1067400.0,1050300.0,1067400.0,43806521.0,,\nQQQ,20141028,991500.0,1002000.0,990800.0,1001800.0,29861051.0,-0.847751102683939,-0.5730341586324426\nSPY,20141029,1067300.0,1073700.0,1063600.0,1073400.0,49453987.0,,\nQQQ,20141029,998500.0,1001200.0,991100.0,998100.0,37010193.0,-0.8490933246961222,-0.5776496326558752\nSPY,20141030,1068900.0,1073400.0,1059000.0,1069800.0,39780372.0,,\nQQQ,20141030,993600.0,1002600.0,991400.0,1000200.0,33566940.0,-0.850294768378093,-0.5815796128819077\nSPY,20141031,1080400.0,1080400.0,1072200.0,1080000.0,42365405.0,,\nQQQ,20141031,1016800.0,1017500.0,1010700.0,1014000.0,44363171.0,-0.8511454245045059,-0.5854672237731646\nSPY,20141103,1081600.0,1103000.0,1080100.0,1094000.0,49696995.0,,\nQQQ,20141103,1015800.0,1019700.0,1014300.0,1017000.0,28457381.0,-0.8518853931684068,-0.5892960786111269\nSPY,20141104,1094500.0,1094900.0,1077200.0,1086000.0,40539033.0,,\nQQQ,20141104,1013800.0,1016200.0,1006700.0,1013600.0,20898564.0,-0.852604384883944,-0.5923563129616408\nSPY,20141105,1091900.0,1093000.0,1081200.0,1088600.0,34086810.0,,\nQQQ,20141105,1020300.0,1020300.0,1010200.0,1013700.0,23519245.0,-0.8532799557940469,-0.5954345442796657\nSPY,20141106,1085900.0,1087500.0,1078000.0,1087000.0,33012857.0,,\nQQQ,20141106,1013600.0,1017200.0,1009200.0,1016900.0,21932569.0,-0.853938634129946,-0.5987358630074621\nSPY,20141107,1087200.0,1093200.0,1085500.0,1090100.0,30691002.0,,\nQQQ,20141107,1018800.0,1019100.0,1010700.0,1016000.0,18598551.0,-0.8557431988298563,-0.6020816863460531\nSPY,20141110,1090000.0,1093300.0,1086700.0,1088300.0,26629543.0,,\nQQQ,20141110,1016600.0,1020900.0,1013800.0,1019600.0,18867350.0,-0.8565301850319721,-0.6050163163106633\nSPY,20141111,1087500.0,1097500.0,1084000.0,1097000.0,26751536.0,,\nQQQ,20141111,1019800.0,1022800.0,1017000.0,1022800.0,14618860.0,-0.8572541856672796,-0.6078320913246181\nSPY,20141112,1094200.0,1114300.0,1093700.0,1112500.0,46007748.0,,\nQQQ,20141112,1018800.0,1025700.0,1018700.0,1024600.0,19096147.0,-0.857798258226675,-0.6104045323859688\nSPY,20141113,1118100.0,1134500.0,1115900.0,1128200.0,58597487.0,,\nQQQ,20141113,1026600.0,1032800.0,1024200.0,1029000.0,25954103.0,-0.8575808381715879,-0.6128122613297557\nSPY,20141114,1131600.0,1141900.0,1130500.0,1141800.0,41998287.0,,\nQQQ,20141114,1028700.0,1032200.0,1025300.0,1032200.0,17459898.0,-0.8569873060934569,-0.6142546427475947\nSPY,20141117,1143100.0,1150800.0,1133000.0,1139900.0,45559173.0,,\nQQQ,20141117,1029700.0,1032100.0,1024200.0,1029100.0,21625241.0,-0.8565667743690021,-0.616029967939554\nSPY,20141118,1139900.0,1156900.0,1138900.0,1154700.0,42041679.0,,\nQQQ,20141118,1030000.0,1038200.0,1029900.0,1036800.0,24182426.0,-0.8561299819569836,-0.6179721399552561\nSPY,20141119,1155000.0,1157400.0,1138000.0,1146700.0,41427159.0,,\nQQQ,20141119,1035600.0,1035700.0,1027400.0,1032100.0,22506680.0,-0.8561371825319276,-0.6197110962890063\nSPY,20141120,1149500.0,1168600.0,1148500.0,1163100.0,40539887.0,,\nQQQ,20141120,1027900.0,1037600.0,1026900.0,1036700.0,19564210.0,-0.8560571519480106,-0.6213855635133549\nSPY,20141121,1175700.0,1175700.0,1160300.0,1164700.0,55225591.0,,\nQQQ,20141121,1046200.0,1046900.0,1035400.0,1038700.0,29619626.0,-0.8553690177887098,-0.6227132143063281\nSPY,20141124,1168500.0,1187700.0,1166200.0,1186300.0,45675906.0,,\nQQQ,20141124,1041700.0,1047300.0,1040600.0,1046800.0,16799716.0,-0.8539783533719795,-0.6239062628302593\nSPY,20141125,1191000.0,1197500.0,1174500.0,1176000.0,64637526.0,,\nQQQ,20141125,1048600.0,1051400.0,1045700.0,1048400.0,16545703.0,-0.8524420743607549,-0.6247434964424337\nSPY,20141126,1179500.0,1191000.0,1178400.0,1190000.0,39611380.0,,\nQQQ,20141126,1049100.0,1055800.0,1048400.0,1055200.0,16499205.0,-0.8501774808159553,-0.6236865499342744\nSPY,20141128,1193600.0,1194000.0,1180500.0,1189300.0,23702453.0,,\nQQQ,20141128,1058200.0,1062500.0,1057300.0,1060100.0,15993111.0,-0.8474074078812479,-0.6214043103474833\nSPY,20141201,1187600.0,1192500.0,1112700.0,1150700.0,82254880.0,,\nQQQ,20141201,1057400.0,1059100.0,1044200.0,1048100.0,32991801.0,-0.8455464468886106,-0.6186166561125904\nSPY,20141202,1135000.0,1157500.0,1127500.0,1146300.0,55984706.0,,\nQQQ,20141202,1049300.0,1054100.0,1047000.0,1052300.0,24269235.0,-0.8435398038757164,-0.6158046309933307\nSPY,20141203,1157500.0,1163500.0,1151100.0,1159300.0,40686383.0,,\nQQQ,20141203,1053900.0,1055600.0,1047700.0,1054200.0,30389323.0,-0.8413281660871527,-0.6124943150229382\nSPY,20141204,1158000.0,1172000.0,1152900.0,1154900.0,40851707.0,,\nQQQ,20141204,1053200.0,1057800.0,1049300.0,1053700.0,29464112.0,-0.8392285088171751,-0.6090677686809494\nSPY,20141205,1158500.0,1160800.0,1146400.0,1150000.0,37134951.0,,\nQQQ,20141205,1055300.0,1057000.0,1051500.0,1053800.0,24523000.0,-0.8371698644211674,-0.6054365069102787\nSPY,20141208,1142300.0,1146400.0,1116300.0,1124000.0,56104385.0,,\nQQQ,20141208,1051100.0,1055700.0,1040800.0,1046300.0,31188836.0,-0.8356834627656727,-0.6020969458786457\nSPY,20141209,1101800.0,1143000.0,1093500.0,1141200.0,56585421.0,,\nQQQ,20141209,1034200.0,1050400.0,1030400.0,1049600.0,40089969.0,-0.8339967906709123,-0.5988061266157467\nSPY,20141210,1144500.0,1148500.0,1115400.0,1119500.0,43489939.0,,\nQQQ,20141210,1047700.0,1050300.0,1031200.0,1033100.0,37408941.0,-0.8331141512908238,-0.5952663493956225\nSPY,20141211,1123000.0,1138000.0,1113400.0,1116200.0,40327056.0,,\nQQQ,20141211,1036100.0,1050400.0,1035900.0,1038000.0,45086091.0,-0.8320706691930948,-0.5912219074007619\nSPY,20141212,1104500.0,1118700.0,1095800.0,1097300.0,54379478.0,,\nQQQ,20141212,1028200.0,1039900.0,1026700.0,1026700.0,43751088.0,-0.8314588183393872,-0.5869405054225182\nSPY,20141215,1107200.0,1116000.0,1063500.0,1082300.0,66181040.0,,\nQQQ,20141215,1032300.0,1035800.0,1013200.0,1016100.0,51390788.0,-0.8311599001723992,-0.5825897401579995\nSPY,20141216,1063900.0,1101600.0,1062600.0,1067500.0,58418976.0,,\nQQQ,20141216,1009700.0,1024700.0,999600.0,999800.0,61291540.0,-0.8309377332093081,-0.5782810762114545\nSPY,20141217,1071200.0,1098400.0,1068200.0,1094100.0,51258958.0,,\nQQQ,20141217,1000700.0,1020900.0,999200.0,1018000.0,75179756.0,-0.8305143805392067,-0.5738332015123141\nSPY,20141218,1117700.0,1126500.0,1106700.0,1126500.0,56157035.0,,\nQQQ,20141218,1033100.0,1042600.0,1029800.0,1042500.0,44502274.0,-0.8292587705631328,-0.5696189124102035\nSPY,20141219,1120300.0,1132400.0,1116600.0,1117800.0,75266022.0,,\nQQQ,20141219,1039900.0,1047400.0,1037100.0,1043200.0,47736874.0,-0.8280444562558041,-0.5654438856641664\nSPY,20141222,1122500.0,1134900.0,1119700.0,1129400.0,40548325.0,,\nQQQ,20141222,1041600.0,1046100.0,1041000.0,1045800.0,33319787.0,-0.826673026530217,-0.5611642531686952\nSPY,20141223,1132800.0,1133300.0,1124600.0,1125400.0,24713148.0,,\nQQQ,20141223,1049700.0,1049700.0,1040900.0,1042100.0,24804171.0,-0.8254990969382673,-0.5567954917624185\nSPY,20141224,1125500.0,1127100.0,1120000.0,1120100.0,14133724.0,,\nQQQ,20141224,1043500.0,1047000.0,1042700.0,1043000.0,10773303.0,-0.8243160475657159,-0.5522910033024969\nSPY,20141226,1120500.0,1145200.0,1120200.0,1139900.0,33108300.0,,\nQQQ,20141226,1045700.0,1052600.0,1045700.0,1050400.0,12548448.0,-0.8228473968302437,-0.547688384124285\nSPY,20141229,1137000.0,1147700.0,1136000.0,1139100.0,27102505.0,,\nQQQ,20141229,1049800.0,1052500.0,1048800.0,1050200.0,15179628.0,-0.8213707493022784,-0.5429165649652441\nSPY,20141230,1135400.0,1139100.0,1121100.0,1125200.0,28623808.0,,\nQQQ,20141230,1047300.0,1049600.0,1041800.0,1043200.0,16900848.0,-0.8202129330102027,-0.5380300151813375\nSPY,20141231,1128000.0,1131300.0,1102100.0,1103800.0,39225568.0,,\nQQQ,20141231,1045100.0,1049100.0,1031000.0,1032500.0,22286939.0,-0.8195288696341592,-0.533002864141468\nSPY,20150102,1114100.0,1114400.0,1073500.0,1093300.0,52381530.0,,\nQQQ,20150102,1037500.0,1042000.0,1024500.0,1029400.0,29310772.0,-0.8188131480140476,-0.5276840123625607\nSPY,20150105,1081700.0,1086500.0,1054100.0,1062500.0,60549442.0,,\nQQQ,20150105,1025000.0,1026100.0,1011500.0,1014300.0,33994158.0,-0.8183545142817643,-0.5224015294418625\nSPY,20150106,1065000.0,1074300.0,1046400.0,1062600.0,64594899.0,,\nQQQ,20150106,1015800.0,1017500.0,996200.0,1000700.0,63345086.0,-0.8178801876444385,-0.5168805025508596\nSPY,20150107,1072900.0,1082000.0,1067000.0,1077500.0,38901910.0,,\nQQQ,20150107,1007400.0,1016000.0,1004900.0,1013600.0,33961867.0,-0.8174017697102703,-0.5113011624926311\nSPY,20150108,1094400.0,1121500.0,1087000.0,1118900.0,56120227.0,,\nQQQ,20150108,1022500.0,1035000.0,1021200.0,1033000.0,37950558.0,-0.8165101004347295,-0.5055435357040822\nSPY,20150109,1127600.0,1132500.0,1102100.0,1120100.0,52563657.0,,\nQQQ,20150109,1036100.0,1036500.0,1020200.0,1026200.0,39201903.0,-0.8157655706155773,-0.49981609341961014\nSPY,20150112,1124600.0,1126400.0,1088000.0,1092500.0,49065302.0,,\nQQQ,20150112,1028200.0,1029300.0,1012900.0,1015500.0,33011889.0,-0.8152410463623654,-0.49390483724955003\nSPY,20150113,1115000.0,1128000.0,1089100.0,1102200.0,65057451.0,,\nQQQ,20150113,1025400.0,1036200.0,1007100.0,1015200.0,53995540.0,-0.8146105768105806,-0.48794858864384305\nSPY,20150114,1090000.0,1104900.0,1085000.0,1098000.0,47170193.0,,\nQQQ,20150114,1004800.0,1014800.0,1000700.0,1009600.0,48551828.0,-0.8140674924247261,-0.4814969580434608\nSPY,20150115,1099600.0,1100600.0,1066600.0,1068200.0,57306482.0,,\nQQQ,20150115,1013900.0,1015900.0,995300.0,996500.0,45530286.0,-0.8136409115620631,-0.47495430925303256\nSPY,20150116,1070300.0,1075800.0,1052000.0,1059900.0,75983276.0,,\nQQQ,20150116,995200.0,1009500.0,993600.0,1008200.0,33576728.0,-0.8132228793742599,-0.4681195846226189\nSPY,20150120,1079800.0,1089700.0,1065000.0,1087200.0,45777693.0,,\nQQQ,20150120,1014400.0,1018800.0,1002900.0,1016200.0,28456896.0,-0.812611815393951,-0.46124024250188655\nSPY,20150121,1088700.0,1110500.0,1082800.0,1095500.0,47025028.0,,\nQQQ,20150121,1013300.0,1026100.0,1009700.0,1021400.0,34202760.0,-0.8120403195033189,-0.4540609508664068\nSPY,20150122,1102800.0,1124700.0,1097200.0,1124000.0,47646702.0,,\nQQQ,20150122,1025700.0,1041400.0,1016400.0,1040300.0,38065971.0,-0.8110309626913619,-0.44688999162028453\nSPY,20150123,1123200.0,1137500.0,1115300.0,1129800.0,43139143.0,,\nQQQ,20150123,1040500.0,1045800.0,1037200.0,1042600.0,33559434.0,-0.8098276902802136,-0.4395161063547427\nSPY,20150126,1136500.0,1143600.0,1128000.0,1131000.0,50936140.0,,\nQQQ,20150126,1041700.0,1043300.0,1036100.0,1041400.0,18618622.0,-0.8083354457886051,-0.43191463435222105\nSPY,20150127,1124300.0,1124800.0,1090300.0,1091400.0,75190353.0,,\nQQQ,20150127,1025100.0,1025600.0,1011000.0,1014400.0,39424461.0,-0.8073187670386046,-0.42389248307640204\nSPY,20150128,1175600.0,1181200.0,1153100.0,1153100.0,136712874.0,,\nQQQ,20150128,1030900.0,1031800.0,1009000.0,1009200.0,41913841.0,-0.806695314569812,-0.4179789772845616\nSPY,20150129,1163600.0,1191900.0,1155600.0,1189000.0,82382016.0,,\nQQQ,20150129,1008300.0,1020700.0,999600.0,1018900.0,42412437.0,-0.806128321904458,-0.4116380433540769\nSPY,20150130,1182800.0,1200000.0,1168500.0,1171600.0,79575789.0,,\nQQQ,20150130,1018000.0,1025800.0,1009600.0,1011000.0,37715667.0,-0.8054691580228375,-0.4053436016070938\nSPY,20150202,1180300.0,1191700.0,1160800.0,1186300.0,60131845.0,,\nQQQ,20150202,1013300.0,1020700.0,997500.0,1019800.0,40681549.0,-0.8046712043423008,-0.3985633162731364\nSPY,20150203,1182700.0,1190900.0,1176100.0,1186500.0,49916630.0,,\nQQQ,20150203,1023300.0,1030300.0,1016800.0,1029600.0,28345597.0,-0.803957498103331,-0.3915328719483791\nSPY,20150204,1185200.0,1205100.0,1183000.0,1195600.0,68703880.0,,\nQQQ,20150204,1025400.0,1035500.0,1023100.0,1028700.0,33263403.0,-0.8029845252164776,-0.38444131288707784\nSPY,20150205,1200500.0,1202300.0,1192500.0,1199400.0,40669841.0,,\nQQQ,20150205,1031300.0,1038300.0,1028700.0,1037600.0,20600221.0,-0.8017146983370453,-0.37698044084727483\nSPY,20150206,1201000.0,1202500.0,1184600.0,1189300.0,42612197.0,,\nQQQ,20150206,1039200.0,1041700.0,1027600.0,1031300.0,29563768.0,-0.8004694752316486,-0.36943415242095734\nSPY,20150209,1185200.0,1198400.0,1184300.0,1197200.0,37214075.0,,\nQQQ,20150209,1027200.0,1032800.0,1025500.0,1028000.0,21894719.0,-0.7991766386793447,-0.36137075505586475\nSPY,20150210,1202600.0,1221500.0,1201600.0,1220200.0,58869874.0,,\nQQQ,20150210,1033800.0,1045400.0,1032100.0,1044000.0,22742554.0,-0.7973321467456445,-0.35231902348383537\nSPY,20150211,1228200.0,1249200.0,1225000.0,1248800.0,71229031.0,,\nQQQ,20150211,1045100.0,1050100.0,1043200.0,1047800.0,19289541.0,-0.7954424792011312,-0.3426988872616859\nSPY,20150212,1259800.0,1274800.0,1255700.0,1264600.0,71634335.0,,\nQQQ,20150212,1054500.0,1060400.0,1053000.0,1060000.0,21113798.0,-0.7929926913636356,-0.33275443044431635\nSPY,20150213,1272700.0,1272800.0,1256500.0,1270800.0,50521507.0,,\nQQQ,20150213,1062900.0,1069300.0,1061100.0,1069100.0,26422732.0,-0.7902511993475155,-0.32270311655222106\nSPY,20150217,1274700.0,1294500.0,1269200.0,1278300.0,60116379.0,,\nQQQ,20150217,1069100.0,1070800.0,1066500.0,1070100.0,15379926.0,-0.7875276764560223,-0.31251982479941187\nSPY,20150218,1276300.0,1287800.0,1274500.0,1287200.0,43304111.0,,\nQQQ,20150218,1069000.0,1072100.0,1067400.0,1071600.0,13795618.0,-0.7849113473715361,-0.30226154562574253\nSPY,20150219,1284500.0,1290300.0,1283300.0,1284500.0,36424190.0,,\nQQQ,20150219,1070900.0,1077600.0,1070600.0,1076900.0,18462422.0,-0.7817504971803849,-0.2916718220518713\nSPY,20150220,1286500.0,1295000.0,1280500.0,1295000.0,47113208.0,,\nQQQ,20150220,1076000.0,1084700.0,1072900.0,1084100.0,25294546.0,-0.7782884466281946,-0.28085938583804543\nSPY,20150223,1300000.0,1330000.0,1296600.0,1330000.0,67039713.0,,\nQQQ,20150223,1084000.0,1085500.0,1081100.0,1085200.0,16260145.0,-0.7746535292371661,-0.26990972264404545\nSPY,20150224,1327500.0,1336000.0,1311700.0,1321700.0,66965072.0,,\nQQQ,20150224,1084100.0,1087300.0,1080500.0,1086000.0,18272329.0,-0.7712478348923909,-0.25879358737573593\nSPY,20150225,1316000.0,1316000.0,1281500.0,1287900.0,72964684.0,,\nQQQ,20150225,1084400.0,1088600.0,1080900.0,1083300.0,18554299.0,-0.7681079134067873,-0.24732876060042666\nSPY,20150226,1287600.0,1308700.0,1266100.0,1304200.0,85570967.0,,\nQQQ,20150226,1084400.0,1089400.0,1081400.0,1088800.0,21048589.0,-0.7645824354285722,-0.2355737325063886\nSPY,20150227,1300500.0,1305700.0,1282400.0,1284600.0,58596297.0,,\nQQQ,20150227,1088600.0,1089100.0,1082300.0,1084000.0,21848435.0,-0.7615602224833575,-0.22398442661245152\nSPY,20150302,1291100.0,1302800.0,1283000.0,1290900.0,46011961.0,,\nQQQ,20150302,1086100.0,1094200.0,1085900.0,1093800.0,21483782.0,-0.7579084163275358,-0.21223689726049946\nSPY,20150303,1290900.0,1295200.0,1280900.0,1293600.0,36769226.0,,\nQQQ,20150303,1090600.0,1091600.0,1081800.0,1088700.0,20043637.0,-0.7543478153011887,-0.20039188426142923\nSPY,20150304,1290800.0,1295600.0,1283300.0,1285400.0,29476455.0,,\nQQQ,20150304,1085300.0,1086700.0,1078600.0,1084500.0,20174241.0,-0.751593822146876,-0.18833690648395054\nSPY,20150305,1286600.0,1287500.0,1257600.0,1264100.0,55320717.0,,\nQQQ,20150305,1087300.0,1089600.0,1081900.0,1086400.0,14192254.0,-0.7489449098100319,-0.17621444002769773\nSPY,20150306,1283700.0,1293700.0,1262600.0,1266000.0,68111601.0,,\nQQQ,20150306,1085200.0,1087100.0,1071400.0,1074100.0,29117528.0,-0.7468798029819503,-0.16381526998847096\nSPY,20150309,1280700.0,1295700.0,1250600.0,1271400.0,86686564.0,,\nQQQ,20150309,1076400.0,1079800.0,1071900.0,1077200.0,24850772.0,-0.7444431227766358,-0.1512893712079905\nSPY,20150310,1266900.0,1272200.0,1238000.0,1245100.0,64283335.0,,\nQQQ,20150310,1069500.0,1069800.0,1057200.0,1057200.0,30989645.0,-0.742877112957582,-0.1386003747871392\nSPY,20150311,1247300.0,1247700.0,1221100.0,1222400.0,67279240.0,,\nQQQ,20150311,1058700.0,1060100.0,1050700.0,1051100.0,22830168.0,-0.7413271055792311,-0.1258993803789503\nSPY,20150312,1223700.0,1249000.0,1216300.0,1244500.0,46704070.0,,\nQQQ,20150312,1050300.0,1059200.0,1049600.0,1058000.0,18992078.0,-0.7396775869627049,-0.11298317207289271\nSPY,20150313,1243900.0,1253900.0,1225800.0,1235900.0,50464979.0,,\nQQQ,20150313,1056700.0,1061200.0,1046800.0,1053400.0,39102687.0,-0.7375533087460096,-0.0999004916925256\nSPY,20150316,1239900.0,1249500.0,1228700.0,1249500.0,34603503.0,,\nQQQ,20150316,1057600.0,1067300.0,1056200.0,1067000.0,23517924.0,-0.734679554669123,-0.08662471870344358\nSPY,20150317,1258600.0,1273200.0,1256500.0,1270400.0,49464334.0,,\nQQQ,20150317,1064100.0,1070400.0,1061600.0,1068700.0,18705018.0,-0.7319662388622032,-0.07314048068437033\nSPY,20150318,1272500.0,1291600.0,1263700.0,1284700.0,62794886.0,,\nQQQ,20150318,1065700.0,1084100.0,1060300.0,1079200.0,37558204.0,-0.7292713655876717,-0.05950251845253377\nSPY,20150319,1287900.0,1292500.0,1274000.0,1275000.0,44833198.0,,\nQQQ,20150319,1080400.0,1083800.0,1078700.0,1080800.0,26245908.0,-0.7262753190658319,-0.045707082636890876\nSPY,20150320,1282600.0,1283500.0,1251600.0,1259000.0,61492812.0,,\nQQQ,20150320,1087400.0,1090700.0,1085200.0,1085300.0,26136729.0,-0.7232128534673629,-0.03179841581574914\nSPY,20150323,1270800.0,1278500.0,1265200.0,1272100.0,35083458.0,,\nQQQ,20150323,1085000.0,1087700.0,1082800.0,1083200.0,14419498.0,-0.7195674803540636,-0.017793765095906414\nSPY,20150324,1271900.0,1280400.0,1265600.0,1266900.0,32252388.0,,\nQQQ,20150324,1083000.0,1088100.0,1079100.0,1079300.0,18200101.0,-0.715699127049699,-0.0037403725525045808\nSPY,20150325,1267100.0,1268100.0,1233800.0,1233800.0,49728951.0,,\nQQQ,20150325,1081100.0,1082000.0,1054200.0,1054600.0,38077715.0,-0.7127747237445333,0.010552604800545451\nSPY,20150326,1229000.0,1248800.0,1226000.0,1242400.0,45474803.0,,\nQQQ,20150326,1045900.0,1057000.0,1042400.0,1051000.0,43741298.0,-0.7093622023506804,0.02485083127305569\nSPY,20150327,1246100.0,1247000.0,1229100.0,1232500.0,37952047.0,,\nQQQ,20150327,1051000.0,1057700.0,1049300.0,1055200.0,31333313.0,-0.7055950897241459,0.03936690358322456\nSPY,20150330,1241200.0,1264000.0,1240000.0,1263700.0,46028175.0,,\nQQQ,20150330,1061800.0,1068100.0,1061600.0,1067300.0,26189750.0,-0.7013591433980837,0.05408656212044325\nSPY,20150331,1261200.0,1264900.0,1243600.0,1244300.0,39902253.0,,\nQQQ,20150331,1064000.0,1066500.0,1055700.0,1056000.0,25346058.0,-0.6976429130968007,0.06901543560108302\nSPY,20150401,1248300.0,1251200.0,1231000.0,1242500.0,39412425.0,,\nQQQ,20150401,1056000.0,1056200.0,1043700.0,1050500.0,29862894.0,-0.6947023303830275,0.08413402729206518\nSPY,20150402,1250100.0,1255600.0,1241900.0,1253200.0,29718669.0,,\nQQQ,20150402,1051700.0,1054600.0,1047800.0,1051200.0,17412755.0,-0.6917774631112363,0.09941309209377176\nSPY,20150406,1245000.0,1275100.0,1243300.0,1273500.0,36226296.0,,\nQQQ,20150406,1045000.0,1062600.0,1043400.0,1059800.0,21853293.0,-0.6881097689180893,0.11488562447756664\nSPY,20150407,1277000.0,1281200.0,1259800.0,1260100.0,33809482.0,,\nQQQ,20150407,1059100.0,1067000.0,1058000.0,1058000.0,17585902.0,-0.6833536011485117,0.13047441184535408\nSPY,20150408,1257800.0,1263900.0,1249700.0,1256000.0,36048498.0,,\nQQQ,20150408,1059000.0,1067900.0,1058300.0,1066400.0,24616222.0,-0.6780263216215415,0.14624014805526037\nSPY,20150409,1258500.0,1265800.0,1246600.0,1265600.0,31410050.0,,\nQQQ,20150409,1066400.0,1073500.0,1062300.0,1073100.0,21752747.0,-0.6725401423917196,0.16215473435138353\nSPY,20150410,1259400.0,1272100.0,1252600.0,1271000.0,38834436.0,,\nQQQ,20150410,1072700.0,1077600.0,1070300.0,1077500.0,15889883.0,-0.6672906964030766,0.17834377471075794\nSPY,20150413,1280900.0,1285700.0,1266100.0,1268500.0,35004940.0,,\nQQQ,20150413,1078100.0,1083800.0,1073600.0,1074800.0,16864629.0,-0.6609413518391162,0.19461605113849542\nSPY,20150414,1270900.0,1272900.0,1259100.0,1263000.0,24812578.0,,\nQQQ,20150414,1074000.0,1076800.0,1065600.0,1071700.0,21871938.0,-0.6542693994120462,0.21108029543561083\nSPY,20150415,1265500.0,1271200.0,1259487.0,1267800.0,28307913.0,,\nQQQ,20150415,1074700.0,1080700.0,1073300.0,1078400.0,18705724.0,-0.6472163866050541,0.22770501287353428\nSPY,20150416,1263900.0,1271000.0,1261100.0,1261700.0,27243141.0,,\nQQQ,20150416,1075900.0,1078800.0,1074000.0,1076900.0,15231803.0,-0.6401530573500511,0.24451049590157387\nSPY,20150417,1255400.0,1261400.0,1244600.0,1247500.0,49015933.0,,\nQQQ,20150417,1066800.0,1069500.0,1055500.0,1060100.0,40117505.0,-0.6338125655769655,0.2615475090661514\nSPY,20150420,1255700.0,1281200.0,1251700.0,1276000.0,45768408.0,,\nQQQ,20150420,1065400.0,1077900.0,1065000.0,1076000.0,23707314.0,-0.6265355567827728,0.27874026287627596\nSPY,20150421,1280200.0,1281900.0,1266700.0,1269100.0,31457777.0,,\nQQQ,20150421,1082200.0,1084100.0,1079300.0,1080600.0,21590796.0,-0.6190555638917926,0.2961313585633072\nSPY,20150422,1270000.0,1288700.0,1263200.0,1286200.0,36338467.0,,\nQQQ,20150422,1083400.0,1088300.0,1076400.0,1086500.0,17955253.0,-0.6114230314858816,0.31382090440916216\nSPY,20150423,1284500.0,1304200.0,1281400.0,1296700.0,44425685.0,,\nQQQ,20150423,1083000.0,1095500.0,1082600.0,1090600.0,25831045.0,-0.6029494736467697,0.33168554601402545\nSPY,20150424,1305000.0,1306300.0,1292300.0,1302800.0,42043896.0,,\nQQQ,20150424,1101900.0,1106900.0,1100400.0,1105400.0,29027413.0,-0.5933285687729029,0.34976727636506827\nSPY,20150427,1323900.0,1331300.0,1311500.0,1326500.0,77109849.0,,\nQQQ,20150427,1109600.0,1111600.0,1100200.0,1102600.0,26308369.0,-0.5821990240901698,0.36799298267212655\nSPY,20150428,1344800.0,1345400.0,1295700.0,1305600.0,114120278.0,,\nQQQ,20150428,1103300.0,1105500.0,1091100.0,1100400.0,33274943.0,-0.5706696509719684,0.38646164840496083\nSPY,20150429,1302700.0,1315900.0,1283000.0,1286400.0,57329252.0,,\nQQQ,20150429,1094200.0,1100700.0,1087500.0,1093500.0,31561296.0,-0.5597588081752867,0.4050254723041979\nSPY,20150430,1274800.0,1278800.0,1245800.0,1251500.0,77949216.0,,\nQQQ,20150430,1087400.0,1091700.0,1070600.0,1076300.0,37755317.0,-0.5493950651331292,0.42367147992481485\nSPY,20150501,1261000.0,1301300.0,1253000.0,1289500.0,54695914.0,,\nQQQ,20150501,1080600.0,1091200.0,1080300.0,1090500.0,30133298.0,-0.5381378340411608,0.44263655920063977\nSPY,20150504,1295600.0,1305700.0,1282600.0,1287000.0,49365875.0,,\nQQQ,20150504,1093900.0,1099100.0,1091700.0,1092300.0,20504793.0,-0.5260623322414987,0.46174411465622844\nSPY,20150505,1281400.0,1284500.0,1257800.0,1258000.0,48009631.0,,\nQQQ,20150505,1088100.0,1090000.0,1074000.0,1074500.0,42441431.0,-0.5145762380123085,0.4809990204766782\nSPY,20150506,1267200.0,1267500.0,1233700.0,1250100.0,70664916.0,,\nQQQ,20150506,1076500.0,1079500.0,1060000.0,1067100.0,39326009.0,-0.5012270245339079,0.5005171322923758\nSPY,20150507,1247800.0,1260800.0,1240200.0,1252600.0,41106784.0,,\nQQQ,20150507,1066800.0,1076400.0,1066000.0,1073500.0,27755019.0,-0.48655536183674786,0.5201132310696284\nSPY,20150508,1265200.0,1276200.0,1261100.0,1276200.0,54289341.0,,\nQQQ,20150508,1084400.0,1089200.0,1083000.0,1086900.0,30641874.0,-0.47040588716651566,0.539932792486721\nSPY,20150511,1272800.0,1275600.0,1256300.0,1263200.0,40025464.0,,\nQQQ,20150511,1087200.0,1089800.0,1081900.0,1082700.0,18614261.0,-0.4539372629349272,0.5598250917429561\nSPY,20150512,1256000.0,1268800.0,1248200.0,1258700.0,45416628.0,,\nQQQ,20150512,1076100.0,1083300.0,1068000.0,1077800.0,29119576.0,-0.4386890914155925,0.5799258561464248\nSPY,20150513,1263300.0,1271900.0,1258700.0,1260100.0,33158568.0,,\nQQQ,20150513,1082400.0,1088100.0,1078400.0,1080000.0,18362097.0,-0.42245577528253264,0.6001667721494306\nSPY,20150514,1274500.0,1289500.0,1271600.0,1289500.0,43051195.0,,\nQQQ,20150514,1088900.0,1096700.0,1084800.0,1095800.0,22193220.0,-0.40359460593973634,0.6208105660377257\nSPY,20150515,1291300.0,1294900.0,1282100.0,1287700.0,36751793.0,,\nQQQ,20150515,1098900.0,1100100.0,1093100.0,1095800.0,23292276.0,-0.38223660084178535,0.641621402334242\nSPY,20150518,1283600.0,1307200.0,1283600.0,1301900.0,48511186.0,,\nQQQ,20150518,1094200.0,1102800.0,1093200.0,1100600.0,16710552.0,-0.35984619270822854,0.6626576471699596\nSPY,20150519,1306900.0,1308800.0,1296400.0,1300700.0,41848959.0,,\nQQQ,20150519,1101800.0,1103500.0,1097600.0,1099400.0,12318113.0,-0.3369384248789601,0.6838828605187988\nSPY,20150520,1300700.0,1309800.0,1293400.0,1300600.0,35556662.0,,\nQQQ,20150520,1100100.0,1106700.0,1094300.0,1100100.0,19541881.0,-0.31130622602565844,0.7052940428805513\nSPY,20150521,1300000.0,1316300.0,1298500.0,1313900.0,38372763.0,,\nQQQ,20150521,1098000.0,1107300.0,1096600.0,1105800.0,15868269.0,-0.28529752197624075,0.7268994428807899\nSPY,20150522,1316500.0,1329700.0,1314000.0,1325400.0,44236807.0,,\nQQQ,20150522,1104700.0,1108700.0,1103800.0,1104700.0,12645649.0,-0.2579648883581713,0.7487013101446708\nSPY,20150526,1326200.0,1329100.0,1291200.0,1296200.0,63880386.0,,\nQQQ,20150526,1102100.0,1103800.0,1087600.0,1092000.0,23784971.0,-0.230261788460761,0.7706460286059711\nSPY,20150527,1303600.0,1322600.0,1300500.0,1320500.0,44479311.0,,\nQQQ,20150527,1095400.0,1110800.0,1092900.0,1109600.0,26132531.0,-0.2024503264559973,0.7928100855200019\nSPY,20150528,1318700.0,1319500.0,1311000.0,1317800.0,28905646.0,,\nQQQ,20150528,1108000.0,1110100.0,1103700.0,1107100.0,14036756.0,-0.1703504853170638,0.8151601114469459\nSPY,20150529,1312500.0,1314500.0,1299000.0,1302800.0,45363440.0,,\nQQQ,20150529,1106600.0,1107900.0,1097900.0,1100500.0,22445514.0,-0.13599669731696315,0.8376940138029457\nSPY,20150601,1313500.0,1314600.0,1300500.0,1305400.0,30862313.0,,\nQQQ,20150601,1106300.0,1107200.0,1095200.0,1104200.0,22638136.0,-0.09595120199785369,0.8604171068281602\nSPY,20150602,1300000.0,1306600.0,1293200.0,1299600.0,32783490.0,,\nQQQ,20150602,1100200.0,1106100.0,1094700.0,1100700.0,18321906.0,-0.0476519945900555,0.8833141708980693\nSPY,20150603,1307400.0,1309400.0,1298300.0,1301200.0,29771833.0,,\nQQQ,20150603,1106300.0,1108100.0,1101300.0,1104000.0,18534156.0,0.015098723855137256,0.906392704764599\nSPY,20150604,1295000.0,1305800.0,1289100.0,1293600.0,36991398.0,,\nQQQ,20150604,1097500.0,1104800.0,1092100.0,1095600.0,27319592.0,0.10192321839902002,0.9296431343291792\nSPY,20150605,1295400.0,1296900.0,1283600.0,1286500.0,34408910.0,,\nQQQ,20150605,1094200.0,1096900.0,1086300.0,1093000.0,20738018.0,0.24757081830920336,0.9526995511998809\nSPY,20150608,1289400.0,1292100.0,1268300.0,1278000.0,51884105.0,,\nQQQ,20150608,1092400.0,1093300.0,1079700.0,1081900.0,22816995.0,0.9650280599339535,0.9745122998304271\nSPY,20150609,1266900.0,1280800.0,1256200.0,1274200.0,54359060.0,,\nQQQ,20150609,1079100.0,1083900.0,1072000.0,1080100.0,25115832.0,0.965156025505735,0.9745531680360879\nSPY,20150610,1279900.0,1293400.0,1278500.0,1288800.0,37718572.0,,\nQQQ,20150610,1083700.0,1098100.0,1082600.0,1094900.0,26938768.0,0.9653786317739895,0.9746403457976004\nSPY,20150611,1291900.0,1301800.0,1284800.0,1285900.0,34582287.0,,\nQQQ,20150611,1098500.0,1101500.0,1094600.0,1096500.0,16036994.0,0.9655298450523536,0.9745837302205556\nSPY,20150612,1281500.0,1283300.0,1271100.0,1271700.0,35461904.0,,\nQQQ,20150612,1090900.0,1093000.0,1086000.0,1087500.0,26026319.0,0.9656563615192864,0.9744052599247053\nSPY,20150615,1261500.0,1272400.0,1257100.0,1269200.0,38175579.0,,\nQQQ,20150615,1079500.0,1083800.0,1073100.0,1082100.0,28151455.0,0.9655924095068864,0.9742324136928\nSPY,20150616,1269900.0,1278500.0,1263700.0,1276000.0,30287785.0,,\nQQQ,20150616,1080600.0,1089800.0,1080600.0,1088000.0,15862189.0,0.96563607006878,0.9741197400932778\nSPY,20150617,1277400.0,1278800.0,1267400.0,1273000.0,31831018.0,,\nQQQ,20150617,1089800.0,1094500.0,1084300.0,1091000.0,21498113.0,0.9656233316637738,0.973823164398987\nSPY,20150618,1272700.0,1283100.0,1272200.0,1278800.0,34367764.0,,\nQQQ,20150618,1094800.0,1108800.0,1094400.0,1106900.0,35321279.0,0.9652963117361025,0.9733597464372196\nSPY,20150619,1276400.0,1278200.0,1264000.0,1266000.0,47645772.0,,\nQQQ,20150619,1105100.0,1105700.0,1098400.0,1098900.0,24473983.0,0.9649778165393943,0.9725144444736062\nSPY,20150622,1274700.0,1280600.0,1270800.0,1276100.0,32188149.0,,\nQQQ,20150622,1107000.0,1110300.0,1104500.0,1107000.0,16384186.0,0.9645063126466392,0.9718346824840369\nSPY,20150623,1274400.0,1276100.0,1268800.0,1270300.0,29418654.0,,\nQQQ,20150623,1108200.0,1108900.0,1103300.0,1107900.0,16923201.0,0.9638994786439838,0.9706172598805448\nSPY,20150624,1271800.0,1298000.0,1271200.0,1281100.0,54138107.0,,\nQQQ,20150624,1106500.0,1111300.0,1101900.0,1102200.0,14851240.0,0.9635375001982934,0.9701020955266186\nSPY,20150625,1289400.0,1291900.0,1275000.0,1275000.0,30629446.0,,\nQQQ,20150625,1106700.0,1107600.0,1098200.0,1100000.0,17711591.0,0.9631195036447299,0.9696373545968191\nSPY,20150626,1276600.0,1279900.0,1265100.0,1267500.0,37130391.0,,\nQQQ,20150626,1099700.0,1102200.0,1088600.0,1092700.0,29877470.0,0.9627591919701806,0.9690052095724022\nSPY,20150629,1255000.0,1264700.0,1244800.0,1245300.0,47221837.0,,\nQQQ,20150629,1080100.0,1086600.0,1066400.0,1066900.0,47282136.0,0.962386927996636,0.969048702349883\nSPY,20150630,1256400.0,1261200.0,1248600.0,1254300.0,42588470.0,,\nQQQ,20150630,1075100.0,1077200.0,1067400.0,1070700.0,31102628.0,0.9620721403642398,0.9690348296536176\nSPY,20150701,1269200.0,1269400.0,1259900.0,1266000.0,28942279.0,,\nQQQ,20150701,1082000.0,1083400.0,1074300.0,1079200.0,20038829.0,0.9618221235464339,0.9690108104005589\nSPY,20150702,1264300.0,1266900.0,1257700.0,1264400.0,26481354.0,,\nQQQ,20150702,1082400.0,1083200.0,1076200.0,1079500.0,16326770.0,0.9615717584678022,0.968942196743254\nSPY,20150706,1250000.0,1262200.0,1248200.0,1260000.0,26843491.0,,\nQQQ,20150706,1072300.0,1083200.0,1070500.0,1077000.0,22725533.0,0.9613509826567053,0.9689699421565904\nSPY,20150707,1259600.0,1261500.0,1237700.0,1256900.0,45270790.0,,\nQQQ,20150707,1078300.0,1080700.0,1058400.0,1079700.0,42260072.0,0.9611492058501931,0.9687905401656707\nSPY,20150708,1244800.0,1246400.0,1225400.0,1225700.0,58906199.0,,\nQQQ,20150708,1071400.0,1073300.0,1059000.0,1060900.0,37130269.0,0.9609104040928302,0.9688274773973556\nSPY,20150709,1238500.0,1240600.0,1192200.0,1200700.0,76433454.0,,\nQQQ,20150709,1075200.0,1075900.0,1060200.0,1060300.0,25291503.0,0.9605666420994378,0.9688477240427396\nSPY,20150710,1221600.0,1238500.0,1212100.0,1232800.0,59441406.0,,\nQQQ,20150710,1074500.0,1080500.0,1070600.0,1076500.0,24788200.0,0.9602336323551065,0.9684870338046034\nSPY,20150713,1249500.0,1257500.0,1243200.0,1256600.0,35933229.0,,\nQQQ,20150713,1085700.0,1096300.0,1085700.0,1095400.0,24304084.0,0.9597538109381715,0.9671863743076237\nSPY,20150714,1259900.0,1263700.0,1250400.0,1256100.0,30313083.0,,\nQQQ,20150714,1097000.0,1105600.0,1096300.0,1102600.0,21059019.0,0.9590821942528681,0.9652200060889919\nSPY,20150715,1256800.0,1271500.0,1255800.0,1268200.0,32770018.0,,\nQQQ,20150715,1104500.0,1108100.0,1100700.0,1103800.0,25995945.0,0.9585180711858997,0.9640468252504208\nSPY,20150716,1277800.0,1285700.0,1273500.0,1285100.0,34394530.0,,\nQQQ,20150716,1112600.0,1119600.0,1110700.0,1119400.0,25961481.0,0.9577003063345972,0.96353091063429\nSPY,20150717,1290000.0,1296200.0,1283100.0,1296200.0,44376506.0,,\nQQQ,20150717,1128500.0,1135900.0,1126500.0,1135900.0,30128315.0,0.9561662190387766,0.9634182349230562\nSPY,20150720,1310000.0,1329700.0,1307000.0,1320700.0,52616030.0,,\nQQQ,20150720,1138500.0,1143900.0,1134800.0,1139800.0,23950721.0,0.9552934867407614,0.9635172185598238\nSPY,20150721,1329200.0,1329200.0,1300600.0,1307500.0,57081607.0,,\nQQQ,20150721,1140400.0,1142000.0,1135800.0,1139100.0,29742179.0,0.9541256796773193,0.9635892066592909\nSPY,20150722,1220500.0,1255000.0,1219900.0,1252200.0,106491431.0,,\nQQQ,20150722,1121700.0,1131700.0,1121600.0,1126200.0,30892117.0,0.952224047289436,0.9606871863995152\nSPY,20150723,1262700.0,1270900.0,1250600.0,1251600.0,49032005.0,,\nQQQ,20150723,1127400.0,1131000.0,1119100.0,1122000.0,21618211.0,0.9506432476387205,0.9577709184950531\nSPY,20150724,1254300.0,1257400.0,1239000.0,1245000.0,40068855.0,,\nQQQ,20150724,1128000.0,1128600.0,1109400.0,1111000.0,27426504.0,0.9495139941826585,0.954300117261882\nSPY,20150727,1230000.0,1236500.0,1221200.0,1227700.0,42440558.0,,\nQQQ,20150727,1104300.0,1109400.0,1099400.0,1101800.0,31598559.0,0.9483535700502772,0.9508956800579071\nSPY,20150728,1232800.0,1257800.0,1225500.0,1233800.0,32710304.0,,\nQQQ,20150728,1106500.0,1113500.0,1097900.0,1111300.0,32169764.0,0.9468639189229906,0.9468532758528914\nSPY,20150729,1230800.0,1235000.0,1222700.0,1229900.0,34802025.0,,\nQQQ,20150729,1113700.0,1117900.0,1109400.0,1115500.0,22891930.0,0.9449582731559515,0.9425096180993774\nSPY,20150730,1223300.0,1225600.0,1217100.0,1223700.0,31198778.0,,\nQQQ,20150730,1112800.0,1122600.0,1106200.0,1120800.0,21760664.0,0.9424801248762932,0.9379379979881481\nSPY,20150731,1225000.0,1226000.0,1209100.0,1213000.0,40712570.0,,\nQQQ,20150731,1124400.0,1124900.0,1117200.0,1119500.0,19592341.0,0.9394599216468656,0.9330023129931325\nSPY,20150803,1215000.0,1225700.0,1175200.0,1184400.0,68567177.0,,\nQQQ,20150803,1120000.0,1122800.0,1108600.0,1116000.0,22628113.0,0.9355751170173751,0.9269433134854257\nSPY,20150804,1172900.0,1177000.0,1132500.0,1146400.0,120984910.0,,\nQQQ,20150804,1115600.0,1117400.0,1109300.0,1113900.0,20301727.0,0.9299238213003769,0.9196957602376552\nSPY,20150805,1130000.0,1174400.0,1121000.0,1154000.0,95606411.0,,\nQQQ,20150805,1120100.0,1130000.0,1118800.0,1122500.0,26749046.0,0.9234927612855707,0.9125921832158107\nSPY,20150806,1160000.0,1165000.0,1141200.0,1151300.0,51203733.0,,\nQQQ,20150806,1123200.0,1125000.0,1099500.0,1104500.0,38108680.0,0.9188969062671386,0.9061717433909362\nSPY,20150807,1146400.0,1162500.0,1145000.0,1155200.0,37418332.0,,\nQQQ,20150807,1101800.0,1105700.0,1094000.0,1103100.0,26293988.0,0.9144623573883417,0.9001352401685304\nSPY,20150810,1166200.0,1199900.0,1165300.0,1197200.0,53124478.0,,\nQQQ,20150810,1110500.0,1118100.0,1110000.0,1115700.0,19112128.0,0.9106714572912294,0.8944813414838803\nSPY,20150811,1179800.0,1181800.0,1133300.0,1134900.0,93411434.0,,\nQQQ,20150811,1109700.0,1114100.0,1095300.0,1101400.0,32092237.0,0.905464143576524,0.8875798547978394\nSPY,20150812,1126100.0,1154200.0,1096300.0,1152400.0,97639734.0,,\nQQQ,20150812,1093700.0,1107300.0,1082200.0,1105200.0,38597869.0,0.9006094131337846,0.8806911160091924\nSPY,20150813,1161500.0,1164000.0,1145400.0,1151500.0,46775881.0,,\nQQQ,20150813,1106800.0,1111600.0,1101000.0,1103400.0,21330805.0,0.8960468878385208,0.8740955788605999\nSPY,20150814,1141900.0,1163100.0,1140100.0,1159600.0,41570969.0,,\nQQQ,20150814,1101000.0,1106700.0,1098600.0,1105100.0,16264603.0,0.8917458747155662,0.8674801699895993\nSPY,20150817,1159900.0,1176900.0,1155000.0,1171600.0,40107461.0,,\nQQQ,20150817,1102300.0,1114600.0,1099600.0,1114300.0,20310989.0,0.8871823571542609,0.860450990699524\nSPY,20150818,1162500.0,1174400.0,1151500.0,1165000.0,33747792.0,,\nQQQ,20150818,1112800.0,1113700.0,1107100.0,1108600.0,13174353.0,0.8830622003435817,0.8534973863058458\nSPY,20150819,1160000.0,1165200.0,1146800.0,1150100.0,44224612.0,,\nQQQ,20150819,1105000.0,1111000.0,1094900.0,1101300.0,39140424.0,0.8790819108867179,0.8469389668054568\nSPY,20150820,1141100.0,1143500.0,1116300.0,1126500.0,66244812.0,,\nQQQ,20150820,1091400.0,1094600.0,1070700.0,1070800.0,52999826.0,0.8767064665076342,0.8450595598865475\nSPY,20150821,1104100.0,1119000.0,1056500.0,1057600.0,122102610.0,,\nQQQ,20150821,1055500.0,1064700.0,1024000.0,1024000.0,85631198.0,0.8756281455692384,0.8448533438219784\nSPY,20150824,951700.0,1088000.0,920000.0,1031200.0,148011210.0,,\nQQQ,20150824,941700.0,1025300.0,847400.0,984600.0,134472193.0,0.8756838024676784,0.8447463280429894\nSPY,20150825,1110700.0,1111600.0,1000000.0,1037400.0,96182393.0,,\nQQQ,20150825,1021100.0,1027400.0,980400.0,980900.0,66062248.0,0.8758064353285933,0.8445652328784176\nSPY,20150826,1071800.0,1098900.0,1050500.0,1096900.0,89812240.0,,\nQQQ,20150826,1009500.0,1032300.0,989300.0,1030300.0,94961536.0,0.8751266856116398,0.8444388786952692\nSPY,20150827,1122500.0,1132400.0,1100200.0,1129200.0,76221504.0,,\nQQQ,20150827,1045300.0,1057000.0,1032800.0,1056400.0,57986325.0,0.8738238762905015,0.8435723964482188\nSPY,20150828,1121700.0,1133100.0,1115400.0,1132900.0,50095268.0,,\nQQQ,20150828,1050800.0,1059900.0,1048500.0,1056200.0,43761962.0,0.8725349265813511,0.8427404085182297\nSPY,20150831,1121300.0,1145300.0,1120000.0,1127600.0,53501827.0,,\nQQQ,20150831,1050300.0,1056100.0,1040500.0,1043100.0,35157391.0,0.8717290973276877,0.8423598462158688\nSPY,20150901,1101800.0,1118700.0,1073600.0,1077200.0,70563946.0,,\nQQQ,20150901,1016800.0,1032900.0,1006300.0,1010500.0,62227907.0,0.8715086192797676,0.8424249866205986\nSPY,20150902,1100000.0,1123400.0,1091300.0,1123400.0,55873613.0,,\nQQQ,20150902,1028900.0,1039100.0,1017000.0,1039000.0,37770603.0,0.8709052048488598,0.8422156133174763\nSPY,20150903,1124500.0,1132900.0,1100400.0,1103700.0,50334322.0,,\nQQQ,20150903,1043200.0,1050200.0,1031000.0,1033900.0,40175421.0,0.8703445295562546,0.8421061314367274\nSPY,20150904,1090600.0,1105000.0,1085100.0,1092700.0,46251489.0,,\nQQQ,20150904,1020000.0,1028400.0,1015900.0,1021600.0,41189839.0,0.8702713433052839,0.8422636053747908\nSPY,20150908,1117500.0,1125600.0,1103200.0,1123100.0,48048995.0,,\nQQQ,20150908,1041300.0,1051700.0,1036900.0,1050400.0,34480814.0,0.8698134661195663,0.8419655000794669\nSPY,20150909,1137600.0,1140200.0,1097700.0,1101500.0,79565793.0,,\nQQQ,20150909,1062800.0,1063100.0,1035900.0,1038600.0,40940102.0,0.8689661884261507,0.8416213069788884\nSPY,20150910,1103400.0,1132800.0,1099000.0,1125700.0,58460286.0,,\nQQQ,20150910,1037500.0,1056800.0,1036200.0,1049900.0,40846811.0,0.8681048148938851,0.8410362460027648\nSPY,20150911,1118900.0,1142100.0,1117600.0,1142100.0,47737926.0,,\nQQQ,20150911,1045400.0,1055700.0,1042100.0,1055700.0,25336262.0,0.8671584961430927,0.8400820289256893\nSPY,20150914,1165100.0,1168900.0,1060900.0,1153100.0,54169550.0,,\nQQQ,20150914,1059800.0,1059800.0,1048500.0,1052500.0,18237470.0,0.8661426520721224,0.8388422663896214\nSPY,20150915,1159500.0,1165300.0,1144200.0,1162800.0,41713354.0,,\nQQQ,20150915,1055000.0,1068200.0,1051100.0,1064900.0,28310624.0,0.8644898570983888,0.837056436609603\nSPY,20150916,1162500.0,1165400.0,1154400.0,1164100.0,35784091.0,,\nQQQ,20150916,1065700.0,1071900.0,1061400.0,1070900.0,29704071.0,0.8629635119275016,0.8349114162082837\nSPY,20150917,1157900.0,1164900.0,1125300.0,1139200.0,57718504.0,,\nQQQ,20150917,1070000.0,1087200.0,1066400.0,1071300.0,50633919.0,0.8607575853689898,0.8326171704757764\nSPY,20150918,1121300.0,1143000.0,1118400.0,1134500.0,66331261.0,,\nQQQ,20150918,1052500.0,1066000.0,1051700.0,1053500.0,38704240.0,0.8597920619560953,0.8316404569387309\nSPY,20150921,1137500.0,1153700.0,1136400.0,1152100.0,44270981.0,,\nQQQ,20150921,1059400.0,1065400.0,1047400.0,1056800.0,31943013.0,0.858861799936194,0.8302324090384055\nSPY,20150922,1133700.0,1141800.0,1125300.0,1134000.0,47616935.0,,\nQQQ,20150922,1040500.0,1044200.0,1031300.0,1041000.0,41367236.0,0.8576253951154686,0.8294607867418936\nSPY,20150923,1136700.0,1147200.0,1133000.0,1143200.0,34479433.0,,\nQQQ,20150923,1044000.0,1046600.0,1036400.0,1041800.0,19982982.0,0.8562770234145046,0.8284597345801874\nSPY,20150924,1132700.0,1155000.0,1123800.0,1150000.0,47300905.0,,\nQQQ,20150924,1031600.0,1041900.0,1022700.0,1038000.0,32290399.0,0.8554298287333821,0.8272221873346134\nSPY,20150925,1163600.0,1166900.0,1140200.0,1147100.0,52203931.0,,\nQQQ,20150925,1049500.0,1050100.0,1022800.0,1029200.0,40582724.0,0.8535417658637676,0.8258540385067125\nSPY,20150928,1139000.0,1145700.0,1124400.0,1124400.0,47290100.0,,\nQQQ,20150928,1024200.0,1025300.0,996900.0,999900.0,40162084.0,0.8518659645420286,0.8249877770249903\nSPY,20150929,1127900.0,1135100.0,1078600.0,1090600.0,69395568.0,,\nQQQ,20150929,1002100.0,1012600.0,987500.0,994700.0,42893667.0,0.850899962164776,0.8248423011012553\nSPY,20150930,1103100.0,1115400.0,1087300.0,1103000.0,63725854.0,,\nQQQ,20150930,1008900.0,1018700.0,1005000.0,1017600.0,39210176.0,0.849821688307255,0.8246165884566975\nSPY,20151001,1091300.0,1096200.0,1073100.0,1095800.0,62051252.0,,\nQQQ,20151001,1019700.0,1022300.0,1005900.0,1022200.0,39333463.0,0.8478108035860722,0.8243044855529982\nSPY,20151002,1081500.0,1110100.0,1075500.0,1103800.0,53377309.0,,\nQQQ,20151002,1008400.0,1040100.0,1004800.0,1040100.0,50423188.0,0.8450986050969315,0.8234415329291368\nSPY,20151005,1098500.0,1113700.0,1090700.0,1107800.0,49771105.0,,\nQQQ,20151005,1047400.0,1057800.0,1045500.0,1055000.0,30317059.0,0.8418503171019723,0.8214785787704199\nSPY,20151006,1106000.0,1117400.0,1097600.0,1113100.0,46546703.0,,\nQQQ,20151006,1052600.0,1056000.0,1041800.0,1050000.0,30459249.0,0.8388957315752635,0.8201374259826686\nSPY,20151007,1117500.0,1117700.0,1094100.0,1107800.0,44558837.0,,\nQQQ,20151007,1056300.0,1058600.0,1042900.0,1056300.0,35204895.0,0.8344540347709485,0.8178195600240776\nSPY,20151008,1101400.0,1101900.0,1082100.0,1095000.0,59674015.0,,\nQQQ,20151008,1052500.0,1062300.0,1042100.0,1060500.0,46622971.0,0.8300591827818906,0.8140735556901595\nSPY,20151009,1101100.0,1122800.0,1095000.0,1121200.0,50570265.0,,\nQQQ,20151009,1061200.0,1067300.0,1058100.0,1065300.0,22249821.0,0.8254982674881273,0.8112438995288064\nSPY,20151012,1127300.0,1127500.0,1114400.0,1116000.0,28970135.0,,\nQQQ,20151012,1067500.0,1069900.0,1063500.0,1067900.0,15543419.0,0.8201428801330084,0.807686863885139\nSPY,20151013,1108400.0,1124500.0,1106800.0,1117900.0,31213216.0,,\nQQQ,20151013,1061900.0,1072600.0,1060000.0,1061000.0,25378996.0,0.8152622628121168,0.8045865025762442\nSPY,20151014,1111900.0,1115200.0,1095600.0,1102100.0,42928758.0,,\nQQQ,20151014,1061100.0,1066300.0,1054900.0,1059300.0,28844025.0,0.8091143901208288,0.8014407737841741\nSPY,20151015,1109600.0,1121000.0,1105000.0,1118600.0,34753173.0,,\nQQQ,20151015,1063300.0,1076800.0,1061800.0,1076700.0,32971499.0,0.8008039095131166,0.7964582243303219\nSPY,20151016,1118700.0,1120000.0,1105300.0,1110400.0,35244451.0,,\nQQQ,20151016,1078900.0,1081800.0,1073800.0,1081200.0,23317566.0,0.7901209867240225,0.7895042515166718\nSPY,20151019,1108600.0,1117500.0,1101100.0,1117300.0,29148511.0,,\nQQQ,20151019,1079800.0,1088100.0,1077400.0,1087400.0,22272493.0,0.7790205419242631,0.7811206405761846\nSPY,20151020,1113000.0,1141700.0,1108200.0,1137700.0,45802744.0,,\nQQQ,20151020,1085400.0,1087700.0,1078100.0,1081800.0,20605910.0,0.7706242599649902,0.7759566211896314\nSPY,20151021,1140000.0,1155800.0,1137000.0,1137600.0,40872421.0,,\nQQQ,20151021,1087500.0,1088400.0,1074800.0,1075200.0,27188298.0,0.7641265986736113,0.7721105084424257\nSPY,20151022,1143900.0,1155000.0,1141000.0,1155000.0,39478806.0,,\nQQQ,20151022,1085100.0,1098000.0,1081800.0,1097100.0,34971791.0,0.7558933630401746,0.7653222581706225\nSPY,20151023,1167000.0,1192200.0,1163300.0,1190800.0,56141448.0,,\nQQQ,20151023,1126700.0,1132400.0,1120700.0,1127800.0,45250993.0,0.7464748096389313,0.7581598198970928\nSPY,20151026,1181000.0,1181300.0,1149300.0,1152800.0,63661863.0,,\nQQQ,20151026,1127100.0,1130700.0,1122700.0,1128500.0,24142346.0,0.7330066675542565,0.7484298070385693\nSPY,20151027,1154600.0,1165400.0,1139900.0,1145500.0,53494503.0,,\nQQQ,20151027,1125300.0,1132400.0,1125200.0,1130800.0,26939008.0,0.7179366505533205,0.7375881033733132\nSPY,20151028,1169900.0,1193000.0,1160600.0,1192700.0,80274697.0,,\nQQQ,20151028,1132700.0,1140200.0,1123400.0,1140200.0,38078165.0,0.7073740465293376,0.7300068594906364\nSPY,20151029,1186900.0,1206900.0,1182700.0,1205300.0,48804435.0,,\nQQQ,20151029,1134900.0,1140300.0,1133900.0,1138400.0,23226884.0,0.6985974263473365,0.7230247663361753\nSPY,20151030,1210000.0,1212200.0,1194500.0,1195000.0,46615923.0,,\nQQQ,20151030,1139200.0,1140800.0,1133100.0,1133300.0,23161165.0,0.6894431916087624,0.7154993881972432\nSPY,20151102,1198600.0,1213600.0,1196100.0,1211800.0,30151300.0,,\nQQQ,20151102,1136300.0,1147400.0,1133900.0,1146100.0,21457203.0,0.6809607589003297,0.7083706943326867\nSPY,20151103,1207800.0,1234900.0,1207000.0,1225700.0,43917758.0,,\nQQQ,20151103,1143800.0,1154200.0,1142100.0,1150100.0,19280811.0,0.6740223425600729,0.7014944651684311\nSPY,20151104,1230700.0,1238200.0,1216200.0,1220000.0,41216071.0,,\nQQQ,20151104,1153800.0,1154700.0,1145400.0,1150200.0,26568612.0,0.6661600924860003,0.6941890440555082\nSPY,20151105,1219400.0,1226900.0,1201800.0,1209200.0,37390909.0,,\nQQQ,20151105,1151600.0,1153900.0,1141100.0,1147100.0,22367646.0,0.6577181830368144,0.6868001433039722\nSPY,20151106,1212300.0,1218100.0,1206200.0,1210600.0,31344554.0,,\nQQQ,20151106,1145100.0,1149200.0,1137700.0,1147900.0,26724607.0,0.649503648791692,0.6793160083315559\nSPY,20151109,1208100.0,1218100.0,1200500.0,1205700.0,31884055.0,,\nQQQ,20151109,1143900.0,1145100.0,1128700.0,1135700.0,30580591.0,0.6425251797853357,0.6719882224540494\nSPY,20151110,1169000.0,1180700.0,1160700.0,1167700.0,55062722.0,,\nQQQ,20151110,1129400.0,1133900.0,1126300.0,1132800.0,32966364.0,0.6322860382769332,0.6628149923435771\nSPY,20151111,1163400.0,1174200.0,1152100.0,1161100.0,43926468.0,,\nQQQ,20151111,1136000.0,1141400.0,1129600.0,1131400.0,21495927.0,0.6220069109115273,0.6531862127119643\nSPY,20151112,1162700.0,1168200.0,1156500.0,1157200.0,30860499.0,,\nQQQ,20151112,1126800.0,1132300.0,1119600.0,1120400.0,28620767.0,0.6137209702025631,0.6436984097222845\nSPY,20151113,1152000.0,1155600.0,1122700.0,1123400.0,43523662.0,,\nQQQ,20151113,1115700.0,1116900.0,1097800.0,1098400.0,48163448.0,0.6068543067786221,0.6340952447398486\nSPY,20151116,1113900.0,1142400.0,1110000.0,1141800.0,33271774.0,,\nQQQ,20151116,1097300.0,1114300.0,1094900.0,1114200.0,31274348.0,0.5993681942284181,0.6245729456803001\nSPY,20151117,1149100.0,1150500.0,1133200.0,1136900.0,26091772.0,,\nQQQ,20151117,1116100.0,1122900.0,1112100.0,1114900.0,27471264.0,0.591277027825631,0.614298218466357\nSPY,20151118,1157500.0,1174900.0,1156800.0,1172900.0,44100076.0,,\nQQQ,20151118,1119400.0,1137400.0,1118300.0,1136300.0,31114270.0,0.5838320080939303,0.6079745162247472\nSPY,20151119,1176900.0,1197500.0,1167600.0,1187800.0,41271032.0,,\nQQQ,20151119,1136900.0,1142300.0,1134900.0,1137100.0,23931227.0,0.5776165792374297,0.6013756095810657\nSPY,20151120,1193200.0,1199200.0,1188500.0,1193000.0,32664936.0,,\nQQQ,20151120,1142500.0,1145700.0,1141400.0,1144800.0,19260571.0,0.5716071969423325,0.5964834201556817\nSPY,20151123,1194000.0,1197300.0,1173400.0,1177500.0,31087892.0,,\nQQQ,20151123,1145200.0,1149400.0,1136600.0,1141500.0,19646578.0,0.5645717575424747,0.5903460620391804\nSPY,20151124,1171600.0,1193500.0,1171200.0,1188800.0,40504830.0,,\nQQQ,20151124,1134100.0,1143200.0,1128400.0,1140500.0,24969108.0,0.5596238662688142,0.584751879284038\nSPY,20151125,1191400.0,1192300.0,1179200.0,1180300.0,20805226.0,,\nQQQ,20151125,1142200.0,1143600.0,1139100.0,1141500.0,12992442.0,0.5534681042913137,0.5784436591179479\nSPY,20151127,1182900.0,1184000.0,1176000.0,1178300.0,11277631.0,,\nQQQ,20151127,1143900.0,1145400.0,1139300.0,1143100.0,7849771.0,0.5473014330819541,0.572389054967479\nSPY,20151130,1178600.0,1194200.0,1177500.0,1183000.0,34348485.0,,\nQQQ,20151130,1146500.0,1146500.0,1136500.0,1140200.0,21683418.0,0.5421011340282929,0.5664482466897166\nSPY,20151201,1187300.0,1188100.0,1168600.0,1173400.0,32398602.0,,\nQQQ,20151201,1144800.0,1151600.0,1143400.0,1151600.0,25534944.0,0.533571388142119,0.5582896015347034\nSPY,20151202,1170000.0,1181100.0,1160800.0,1162800.0,28707221.0,,\nQQQ,20151202,1152500.0,1157500.0,1142800.0,1144500.0,20645950.0,0.5251873658162878,0.5496515140569992\nSPY,20151203,1165500.0,1167900.0,1142200.0,1152000.0,37698054.0,,\nQQQ,20151203,1147600.0,1149600.0,1118500.0,1125100.0,35431495.0,0.5189503579228187,0.5416717127065207\nSPY,20151204,1152000.0,1192500.0,1151100.0,1190300.0,53546266.0,,\nQQQ,20151204,1128500.0,1153300.0,1126200.0,1151400.0,34604736.0,0.5130400757353873,0.5346003856628697\nSPY,20151207,1189800.0,1198600.0,1178100.0,1182800.0,28996202.0,,\nQQQ,20151207,1152200.0,1152900.0,1140700.0,1146200.0,24149941.0,0.5070221665410167,0.5261265051188064\nSPY,20151208,1175000.0,1186000.0,1168600.0,1182300.0,29539915.0,,\nQQQ,20151208,1134200.0,1150000.0,1133800.0,1146300.0,26535184.0,0.5002870433115157,0.5166652294069186\nSPY,20151209,1175500.0,1212300.0,1150700.0,1156200.0,42880865.0,,\nQQQ,20151209,1141300.0,1147600.0,1122000.0,1128900.0,42158097.0,0.4937586671729098,0.5075156255285402\nSPY,20151210,1162300.0,1169400.0,1155200.0,1161700.0,27116869.0,,\nQQQ,20151210,1131400.0,1141600.0,1128100.0,1134000.0,25002095.0,0.4857320345759037,0.4975737783606068\nSPY,20151211,1149400.0,1153900.0,1128600.0,1131800.0,43754105.0,,\nQQQ,20151211,1120900.0,1123800.0,1107200.0,1107900.0,49050061.0,0.4789900344205935,0.4864535021065059\nSPY,20151214,1120000.0,1126800.0,1097900.0,1124800.0,58209901.0,,\nQQQ,20151214,1109400.0,1116800.0,1093800.0,1116300.0,42789964.0,0.4691061172717767,0.4729377491004089\nSPY,20151215,1120000.0,1128000.0,1103500.0,1104900.0,49746473.0,,\nQQQ,20151215,1126600.0,1132800.0,1121700.0,1123100.0,42768159.0,0.45476128466933047,0.4567790604823508\nSPY,20151216,1110900.0,1119900.0,1088000.0,1113400.0,52617436.0,,\nQQQ,20151216,1130900.0,1141600.0,1118900.0,1139800.0,41588672.0,0.43560649803227747,0.4395702538656522\nSPY,20151217,1120500.0,1121700.0,1089800.0,1089800.0,42746353.0,,\nQQQ,20151217,1144800.0,1144800.0,1123000.0,1123200.0,38526481.0,0.420366748046369,0.42075250378823437\nSPY,20151218,1086900.0,1095200.0,1058100.0,1060300.0,84234984.0,,\nQQQ,20151218,1116300.0,1118800.0,1098300.0,1098300.0,47556795.0,0.4111728082509506,0.4083179921345252\nSPY,20151221,1073000.0,1077500.0,1055700.0,1073300.0,42044168.0,,\nQQQ,20151221,1109000.0,1110700.0,1100500.0,1110500.0,24164382.0,0.4002572404548928,0.3919173952493616\nSPY,20151222,1074500.0,1113400.0,1064500.0,1072300.0,30479794.0,,\nQQQ,20151222,1116400.0,1119400.0,1110500.0,1117800.0,24205862.0,0.38832634455383547,0.375279539412457\nSPY,20151223,1072600.0,1088500.0,1072000.0,1086100.0,31837067.0,,\nQQQ,20151223,1123600.0,1126900.0,1121600.0,1126100.0,23531296.0,0.37569820202847354,0.358348857312823\nSPY,20151224,1089500.0,1090000.0,1079600.0,1080300.0,13255026.0,,\nQQQ,20151224,1126100.0,1129000.0,1125400.0,1125900.0,10830020.0,0.36262328452901355,0.341353996890868\nSPY,20151228,1076000.0,1076900.0,1061900.0,1068200.0,26329818.0,,\nQQQ,20151228,1122600.0,1125500.0,1115100.0,1125300.0,18294658.0,0.34979938892035595,0.3248732429967079\nSPY,20151229,1068800.0,1094300.0,1068600.0,1087400.0,30142003.0,,\nQQQ,20151229,1132000.0,1145400.0,1131400.0,1143000.0,25563474.0,0.33531416398141156,0.3073025457140981\nSPY,20151230,1085800.0,1106400.0,1071800.0,1073200.0,23789060.0,,\nQQQ,20151230,1142000.0,1142400.0,1132600.0,1132700.0,16521959.0,0.32094160287389,0.29019002208830397\nSPY,20151231,1070000.0,1070300.0,1048200.0,1052600.0,39488848.0,,\nQQQ,20151231,1128900.0,1130800.0,1118400.0,1118600.0,27209868.0,0.30636937498785616,0.2726305218216584\nSPY,20160104,1025000.0,1053600.0,1020000.0,1053500.0,64325249.0,,\nQQQ,20160104,1094500.0,1096000.0,1081200.0,1095000.0,44020950.0,0.2963107204372147,0.2609598436366384\nSPY,20160105,1057000.0,1058500.0,1024100.0,1027100.0,53186132.0,,\nQQQ,20160105,1100400.0,1101800.0,1088000.0,1093100.0,34272879.0,0.2819509035183366,0.24819772251794034\nSPY,20160106,1005000.0,1023700.0,998700.0,1007000.0,65026240.0,,\nQQQ,20160106,1074100.0,1088900.0,1074100.0,1082600.0,38920777.0,0.2676920988322745,0.23908149321892086\nSPY,20160107,987100.0,1001300.0,964300.0,964500.0,75233164.0,,\nQQQ,20160107,1059500.0,1072900.0,1048100.0,1048700.0,54364285.0,0.26502876891825206,0.23862631914764465\nSPY,20160108,985300.0,991100.0,964500.0,969600.0,64889958.0,,\nQQQ,20160108,1056300.0,1062900.0,1039000.0,1040100.0,56883349.0,0.26918847759191505,0.2404414364460747\nSPY,20160111,989400.0,990600.0,973400.0,985300.0,46086027.0,,\nQQQ,20160111,1047500.0,1050600.0,1027300.0,1043300.0,44653532.0,0.27187387070279273,0.24179571079011455\nSPY,20160112,1004900.0,1006900.0,988400.0,999600.0,45215333.0,,\nQQQ,20160112,1053300.0,1060700.0,1040800.0,1055400.0,43529730.0,0.2689342994917948,0.24113094655645384\nSPY,20160113,1005700.0,1011900.0,973000.0,973900.0,58149425.0,,\nQQQ,20160113,1059700.0,1062200.0,1017400.0,1019000.0,60799713.0,0.27609830270936647,0.24290815042986158\nSPY,20160114,979000.0,1004800.0,957400.0,995200.0,56250797.0,,\nQQQ,20160114,1023600.0,1049700.0,1006700.0,1040700.0,65779962.0,0.2767663838155732,0.24375963355148794\nSPY,20160115,959100.0,990900.0,953600.0,971300.0,73223469.0,,\nQQQ,20160115,1006200.0,1019400.0,995100.0,1008400.0,78400205.0,0.2822040962539951,0.24446821964545842\nSPY,20160119,983800.0,986500.0,955000.0,966600.0,45856986.0,,\nQQQ,20160119,1022100.0,1023700.0,998800.0,1010600.0,49036071.0,0.28788549007884423,0.24496238721213193\nSPY,20160120,951000.0,981900.0,934200.0,967900.0,56826893.0,,\nQQQ,20160120,994700.0,1018300.0,972600.0,1007500.0,68557035.0,0.2967601475569071,0.24664923082553405\nSPY,20160121,971200.0,978800.0,949400.0,963000.0,43657991.0,,\nQQQ,20160121,1011800.0,1023400.0,998200.0,1008500.0,45952520.0,0.3063869890135611,0.24881674425720282\nSPY,20160122,986400.0,1014600.0,983900.0,1014200.0,60713598.0,,\nQQQ,20160122,1028800.0,1038100.0,1025300.0,1037700.0,36278141.0,0.3104590777231904,0.25102175143444616\nSPY,20160125,1014400.0,1015300.0,992100.0,994400.0,46713238.0,,\nQQQ,20160125,1034000.0,1039900.0,1021400.0,1022300.0,33372429.0,0.3182881539825875,0.25395976133767345\nSPY,20160126,995000.0,1008800.0,980800.0,999900.0,59451886.0,,\nQQQ,20160126,1026600.0,1035900.0,1017600.0,1031500.0,30207695.0,0.3240587568573536,0.2564174763600897\nSPY,20160127,960300.0,966400.0,933400.0,934200.0,117335544.0,,\nQQQ,20160127,1025800.0,1029900.0,1001500.0,1005800.0,43080545.0,0.3343602029007483,0.2584522619324243\nSPY,20160128,938800.0,945100.0,923900.0,940900.0,48265714.0,,\nQQQ,20160128,1022500.0,1022900.0,1002700.0,1020000.0,37061022.0,0.34527240996256303,0.2636199754643939\nSPY,20160129,945200.0,973400.0,943500.0,973400.0,59725465.0,,\nQQQ,20160129,1019700.0,1041700.0,1019400.0,1041300.0,45849215.0,0.353027584711283,0.27165938288336405\nSPY,20160201,964600.0,967100.0,954000.0,964300.0,35220933.0,,\nQQQ,20160201,1036300.0,1048000.0,1032300.0,1044100.0,28099108.0,0.35945686225008067,0.2776245846399945\nSPY,20160202,954700.0,960400.0,942800.0,944800.0,32676278.0,,\nQQQ,20160202,1039300.0,1039700.0,1018400.0,1021500.0,40295051.0,0.37174725865480723,0.2861892777303759\nSPY,20160203,949900.0,968400.0,940900.0,963500.0,37399924.0,,\nQQQ,20160203,1028300.0,1028300.0,998800.0,1016600.0,49835631.0,0.38353314023147805,0.29436741044881903\nSPY,20160204,958500.0,973300.0,951900.0,966000.0,41402077.0,,\nQQQ,20160204,1013900.0,1024500.0,1004400.0,1016500.0,38761193.0,0.39558232446270114,0.3035589987301612\nSPY,20160205,965100.0,969200.0,936900.0,940200.0,41188645.0,,\nQQQ,20160205,1012700.0,1013200.0,977200.0,981200.0,59948909.0,0.4137406296318737,0.31275508625928533\nSPY,20160208,930700.0,956900.0,930400.0,950100.0,48015011.0,,\nQQQ,20160208,962900.0,970500.0,948400.0,966200.0,76925794.0,0.4319875074517073,0.32109519189788105\nSPY,20160209,942900.0,959400.0,939400.0,949900.0,36667202.0,,\nQQQ,20160209,953300.0,977800.0,951800.0,963200.0,61525623.0,0.45023206400610766,0.33029721650359667\nSPY,20160210,959100.0,963500.0,941000.0,942700.0,36358639.0,,\nQQQ,20160210,974300.0,986900.0,966200.0,966900.0,45562783.0,0.4675617053832679,0.33962153084648944\nSPY,20160211,937900.0,946900.0,925900.0,937000.0,39858015.0,,\nQQQ,20160211,954600.0,973200.0,951900.0,965500.0,58684176.0,0.4853713733857869,0.3497208404745468\nSPY,20160212,942600.0,945000.0,930100.0,939900.0,35804761.0,,\nQQQ,20160212,976400.0,981200.0,967300.0,980200.0,44003341.0,0.49995905030232546,0.35953782235721043\nSPY,20160216,950000.0,968500.0,946100.0,966400.0,44555281.0,,\nQQQ,20160216,994700.0,1002300.0,988500.0,1002300.0,32545076.0,0.5097868976520742,0.36891087854193744\nSPY,20160217,967500.0,996600.0,961500.0,981200.0,41915245.0,,\nQQQ,20160217,1009600.0,1026400.0,1007000.0,1025000.0,36522271.0,0.5166273860419451,0.3785437662373655\nSPY,20160218,987500.0,988900.0,960900.0,962600.0,36653466.0,,\nQQQ,20160218,1028200.0,1028300.0,1012000.0,1013300.0,32951179.0,0.525070314292625,0.3883839942292116\nSPY,20160219,960000.0,967600.0,958100.0,960400.0,32036210.0,,\nQQQ,20160219,1008400.0,1019400.0,1006200.0,1016300.0,25162410.0,0.5323480693502746,0.39729767780820446\nSPY,20160222,962500.0,969000.0,959200.0,968800.0,32744639.0,,\nQQQ,20160222,1025800.0,1033800.0,1024800.0,1032800.0,21959855.0,0.5368625205834922,0.40552904853915345\nSPY,20160223,964000.0,965000.0,945500.0,946900.0,29287806.0,,\nQQQ,20160223,1026800.0,1029600.0,1015100.0,1015800.0,26878182.0,0.5442160137808655,0.4145582855776299\nSPY,20160224,939800.0,963800.0,933200.0,961000.0,32733453.0,,\nQQQ,20160224,1003900.0,1026800.0,997700.0,1025500.0,37544135.0,0.5497732714488909,0.4232369563578648\nSPY,20160225,961600.0,967600.0,952500.0,967600.0,26266393.0,,\nQQQ,20160225,1027600.0,1035600.0,1018400.0,1035600.0,27092847.0,0.5535729578946972,0.4310922651027\nSPY,20160226,972000.0,980200.0,965800.0,969100.0,27352037.0,,\nQQQ,20160226,1043500.0,1043600.0,1031900.0,1034300.0,28087183.0,0.5571927458465508,0.4389112049416\nSPY,20160229,968500.0,982300.0,966500.0,966900.0,31032502.0,,\nQQQ,20160229,1033300.0,1041000.0,1025000.0,1025000.0,24891677.0,0.5619138346410514,0.44659900049257517\nSPY,20160301,976500.0,1007700.0,974200.0,1005300.0,48534551.0,,\nQQQ,20160301,1034800.0,1057900.0,1031600.0,1057900.0,34994483.0,0.562223429031331,0.4524154019723811\nSPY,20160302,1005100.0,1008900.0,996400.0,1007500.0,31787208.0,,\nQQQ,20160302,1056600.0,1058500.0,1050100.0,1058300.0,26887677.0,0.5630236559184411,0.45809111610755854\nSPY,20160303,1005900.0,1017000.0,1004500.0,1015000.0,34077414.0,,\nQQQ,20160303,1057200.0,1057500.0,1048700.0,1056300.0,22589009.0,0.5643802717920862,0.4642189888468723\nSPY,20160304,1022700.0,1037500.0,1013700.0,1030100.0,43614910.0,,\nQQQ,20160304,1057500.0,1063500.0,1049700.0,1056700.0,27500528.0,0.5653158290677983,0.47010062940728514\nSPY,20160307,1025200.0,1028300.0,1009600.0,1018700.0,34404341.0,,\nQQQ,20160307,1051300.0,1057400.0,1042700.0,1050200.0,24615843.0,0.5678489105269714,0.4773293385042234\nSPY,20160308,1007800.0,1017600.0,1004000.0,1010300.0,29762509.0,,\nQQQ,20160308,1043000.0,1052100.0,1039700.0,1041500.0,27109086.0,0.5709384939974653,0.48452100575360485\nSPY,20160309,1013400.0,1015800.0,1002700.0,1011200.0,25667347.0,,\nQQQ,20160309,1045400.0,1048300.0,1039700.0,1048200.0,25609559.0,0.5746464704816202,0.49200362414137944\nSPY,20160310,1014700.0,1022400.0,1001500.0,1011700.0,30354062.0,,\nQQQ,20160310,1052600.0,1058700.0,1033100.0,1046600.0,38607172.0,0.5782850856944559,0.49945399794422907\nSPY,20160311,1022400.0,1022700.0,1015000.0,1022600.0,26097267.0,,\nQQQ,20160311,1057900.0,1064900.0,1054600.0,1064900.0,28959137.0,0.5804686167750684,0.5050308113881214\nSPY,20160314,1020000.0,1029100.0,1017900.0,1025200.0,24036425.0,,\nQQQ,20160314,1060900.0,1069200.0,1060600.0,1066700.0,22704436.0,0.5827133349025844,0.5113248793780785\nSPY,20160315,1039100.0,1051800.0,1038600.0,1045800.0,37426905.0,,\nQQQ,20160315,1062900.0,1067500.0,1059500.0,1066300.0,25498145.0,0.5844214912258429,0.5165331297175372\nSPY,20160316,1046100.0,1063100.0,1044900.0,1059700.0,36073482.0,,\nQQQ,20160316,1063700.0,1078600.0,1063400.0,1075800.0,25722466.0,0.5860276008535968,0.5210631189624684\nSPY,20160317,1054200.0,1064700.0,1049600.0,1058000.0,32103964.0,,\nQQQ,20160317,1072700.0,1077700.0,1068700.0,1075200.0,24837678.0,0.5869413743717196,0.5251557441572249\nSPY,20160318,1064800.0,1065000.0,1052000.0,1059200.0,40334458.0,,\nQQQ,20160318,1074600.0,1076300.0,1068000.0,1073700.0,34702877.0,0.5876347659808798,0.5291007324393585\nSPY,20160321,1060000.0,1076500.0,1051400.0,1059100.0,33966615.0,,\nQQQ,20160321,1071800.0,1078900.0,1071200.0,1077900.0,14364000.0,0.5873430121038833,0.5317729081798123\nSPY,20160322,1052500.0,1072900.0,1052000.0,1067200.0,30191506.0,,\nQQQ,20160322,1071800.0,1083700.0,1071700.0,1081200.0,17551682.0,0.5873618003942896,0.5333376201134316\nSPY,20160323,1064600.0,1070700.0,1059000.0,1061300.0,24413883.0,,\nQQQ,20160323,1079100.0,1079900.0,1069900.0,1072300.0,19249855.0,0.588232179604661,0.5371623527973867\nSPY,20160324,1055900.0,1062400.0,1048900.0,1056700.0,24620470.0,,\nQQQ,20160324,1067100.0,1072900.0,1065400.0,1072600.0,16577767.0,0.5905403446669139,0.542894663334765\nSPY,20160328,1060000.0,1061900.0,1050600.0,1051900.0,18618333.0,,\nQQQ,20160328,1075600.0,1075800.0,1069200.0,1071100.0,13193281.0,0.5936693495965162,0.5491118680672198\nSPY,20160329,1050000.0,1077900.0,1048800.0,1076800.0,27384932.0,,\nQQQ,20160329,1069100.0,1089000.0,1067400.0,1088300.0,26809882.0,0.5951745464728128,0.5519685127938254\nSPY,20160330,1086400.0,1104200.0,1086000.0,1095600.0,43558283.0,,\nQQQ,20160330,1094800.0,1100400.0,1091300.0,1093600.0,22560356.0,0.596558227160657,0.5534292672044901\nSPY,20160331,1096900.0,1099000.0,1088800.0,1089900.0,23383629.0,,\nQQQ,20160331,1092800.0,1096900.0,1090400.0,1092000.0,18504785.0,0.5985681058938477,0.5559307633775131\nSPY,20160401,1087800.0,1100000.0,1009300.0,1099900.0,24136296.0,,\nQQQ,20160401,1085400.0,1104000.0,1083900.0,1103600.0,23785449.0,0.6006554464798892,0.5567038835416458\nSPY,20160404,1104100.0,1121900.0,1060000.0,1111200.0,36038819.0,,\nQQQ,20160404,1103600.0,1104400.0,1096800.0,1099400.0,15263058.0,0.6037966667189651,0.5598519598338952\nSPY,20160405,1096500.0,1107300.0,1094200.0,1098100.0,24550721.0,,\nQQQ,20160405,1090900.0,1095000.0,1087400.0,1088800.0,17405013.0,0.6071021943315832,0.5640894989867036\nSPY,20160406,1102200.0,1109800.0,1092000.0,1109600.0,24758528.0,,\nQQQ,20160406,1089900.0,1107100.0,1089900.0,1106700.0,22246888.0,0.6093446657060563,0.564900382042339\nSPY,20160407,1100000.0,1104200.0,1081200.0,1085400.0,28650223.0,,\nQQQ,20160407,1100300.0,1102200.0,1086100.0,1090800.0,27300196.0,0.6109541818321682,0.5675028199954164\nSPY,20160408,1089400.0,1097700.0,1081700.0,1086600.0,22520493.0,,\nQQQ,20160408,1097600.0,1100200.0,1086200.0,1090000.0,20874722.0,0.6122515436441334,0.5699567828830251\nSPY,20160411,1089700.0,1106200.0,1088300.0,1090200.0,26747015.0,,\nQQQ,20160411,1094700.0,1100200.0,1085900.0,1086000.0,22181556.0,0.6135658473700106,0.5724969812884566\nSPY,20160412,1094500.0,1105000.0,1086600.0,1104400.0,25431141.0,,\nQQQ,20160412,1086800.0,1097200.0,1080200.0,1095100.0,25024412.0,0.6149273520896952,0.5748954534950313\nSPY,20160413,1110000.0,1123400.0,1107600.0,1120400.0,30070078.0,,\nQQQ,20160413,1103500.0,1110800.0,1102100.0,1109100.0,22696366.0,0.6161401633082713,0.5750814222639014\nSPY,20160414,1116400.0,1123900.0,1100000.0,1121000.0,24250233.0,,\nQQQ,20160414,1109300.0,1113300.0,1106200.0,1109200.0,16622024.0,0.6168189762595503,0.5746393715008011\nSPY,20160415,1120600.0,1122900.0,1097300.0,1098500.0,44654013.0,,\nQQQ,20160415,1108300.0,1110600.0,1103600.0,1106400.0,18678370.0,0.6170572076156733,0.5736907808047508\nSPY,20160418,1089000.0,1089500.0,1069400.0,1074800.0,55829179.0,,\nQQQ,20160418,1103200.0,1112600.0,1102500.0,1112300.0,15549236.0,0.617435815579896,0.5723188861973008\nSPY,20160419,1078100.0,1080000.0,1062300.0,1069100.0,30575827.0,,\nQQQ,20160419,1114400.0,1114400.0,1098800.0,1105500.0,33797563.0,0.6174573665585745,0.5714189301927228\nSPY,20160420,1066600.0,1080900.0,1060600.0,1071300.0,27172931.0,,\nQQQ,20160420,1105500.0,1111400.0,1101700.0,1106400.0,16292426.0,0.6168026272213722,0.5700538915750745\nSPY,20160421,1069000.0,1069800.0,1055200.0,1059700.0,29440769.0,,\nQQQ,20160421,1105800.0,1110400.0,1101500.0,1106500.0,16604689.0,0.6155507077266555,0.5684571413149042\nSPY,20160422,1050100.0,1064800.0,1046200.0,1056800.0,32267863.0,,\nQQQ,20160422,1092100.0,1097200.0,1081200.0,1089800.0,36436003.0,0.6156006231084993,0.5711510644093069\nSPY,20160425,1050000.0,1056500.0,1045100.0,1050800.0,26401664.0,,\nQQQ,20160425,1086500.0,1089900.0,1084500.0,1089800.0,13120373.0,0.6139017541494115,0.5717562128959298\nSPY,20160426,1040100.0,1053000.0,1038700.0,1043500.0,38680717.0,,\nQQQ,20160426,1092100.0,1093900.0,1081200.0,1084500.0,14936225.0,0.6132883276275818,0.5733664602705721\nSPY,20160427,960000.0,987000.0,956900.0,978200.0,104206496.0,,\nQQQ,20160427,1073400.0,1078300.0,1066900.0,1075800.0,27772991.0,0.611810438040186,0.5759024548638444\nSPY,20160428,975500.0,978800.0,942500.0,948300.0,76881981.0,,\nQQQ,20160428,1077000.0,1083300.0,1060800.0,1062800.0,24518367.0,0.6117718263147691,0.5795790881086217\nSPY,20160429,940000.0,1069300.0,925100.0,937400.0,63561750.0,,\nQQQ,20160429,1062800.0,1065000.0,1048800.0,1057200.0,61807683.0,0.6133750760750056,0.5846433635764177\nSPY,20160502,939600.0,940800.0,924000.0,936400.0,45232855.0,,\nQQQ,20160502,1059900.0,1068700.0,1055600.0,1067200.0,21181924.0,0.6129009638768533,0.5874963373346852\nSPY,20160503,942300.0,957400.0,936800.0,951800.0,51186961.0,,\nQQQ,20160503,1059600.0,1064300.0,1054500.0,1057300.0,31740729.0,0.6139095826401054,0.5915606547833795\nSPY,20160504,952000.0,959000.0,938200.0,941900.0,37580754.0,,\nQQQ,20160504,1050900.0,1054800.0,1048000.0,1050500.0,22955639.0,0.6169678794855485,0.597845349347495\nSPY,20160505,940100.0,941200.0,926800.0,932400.0,33012074.0,,\nQQQ,20160505,1054700.0,1056600.0,1048100.0,1050200.0,18539892.0,0.6205769315454785,0.6044593519447736\nSPY,20160506,933700.0,934500.0,918500.0,927200.0,41627180.0,,\nQQQ,20160506,1045000.0,1056000.0,1044000.0,1055800.0,26421287.0,0.6226866262257239,0.6099135620010462\nSPY,20160509,930000.0,937700.0,925900.0,927900.0,30968163.0,,\nQQQ,20160509,1055900.0,1063700.0,1055400.0,1058800.0,16140332.0,0.6235173291958366,0.6137150493015583\nSPY,20160510,933500.0,935700.0,921100.0,934200.0,31222728.0,,\nQQQ,20160510,1062600.0,1073800.0,1060700.0,1073300.0,20620530.0,0.6226130087829802,0.6157664456358297\nSPY,20160511,934700.0,935700.0,924600.0,925100.0,26888445.0,,\nQQQ,20160511,1071500.0,1074900.0,1063300.0,1063600.0,17987786.0,0.6234045735628381,0.6192424881814556\nSPY,20160512,927700.0,946900.0,894700.0,903400.0,71121271.0,,\nQQQ,20160512,1066100.0,1067400.0,1051400.0,1058900.0,27023527.0,0.624164769598256,0.6230214799641504\nSPY,20160513,900100.0,916700.0,900000.0,905200.0,41649299.0,,\nQQQ,20160513,1058000.0,1064500.0,1053000.0,1055000.0,17780734.0,0.6244338285678974,0.6258644410904807\nSPY,20160516,924500.0,943900.0,916500.0,938800.0,56807028.0,,\nQQQ,20160516,1056600.0,1072100.0,1055700.0,1068200.0,16662116.0,0.6236573061448476,0.6268898942629849\nSPY,20160517,946700.0,947000.0,903700.0,934900.0,42317394.0,,\nQQQ,20160517,1067300.0,1070400.0,1052000.0,1054800.0,26056588.0,0.6242230270650613,0.6292066310647778\nSPY,20160518,941800.0,952100.0,938900.0,945600.0,38544096.0,,\nQQQ,20160518,1052400.0,1064300.0,1050400.0,1058600.0,23889263.0,0.6246602912787567,0.6310167094476999\nSPY,20160519,945600.0,946400.0,935700.0,942000.0,28614843.0,,\nQQQ,20160519,1054500.0,1057000.0,1045400.0,1053100.0,24578667.0,0.6255779770427778,0.6333034508468327\nSPY,20160520,947000.0,954300.0,945000.0,952200.0,29324990.0,,\nQQQ,20160520,1057300.0,1069000.0,1056800.0,1064700.0,27063887.0,0.6248785287198492,0.6338981010942544\nSPY,20160523,958700.0,971900.0,956700.0,964300.0,35964734.0,,\nQQQ,20160523,1065900.0,1069700.0,1062300.0,1063300.0,13250193.0,0.62496974896111,0.6349469192073972\nSPY,20160524,972200.0,980900.0,968400.0,979000.0,33318600.0,,\nQQQ,20160524,1069200.0,1085900.0,1068900.0,1084600.0,25304493.0,0.6242001484145504,0.6356221302090554\nSPY,20160525,986700.0,997400.0,981100.0,996200.0,37351316.0,,\nQQQ,20160525,1088700.0,1095700.0,1086900.0,1092400.0,37124817.0,0.6212167402939182,0.6333710082568463\nSPY,20160526,996700.0,1007300.0,986400.0,1004100.0,54820476.0,,\nQQQ,20160526,1093700.0,1097000.0,1090900.0,1095600.0,20023555.0,0.6184892879222584,0.6307555657545543\nSPY,20160527,994400.0,1004700.0,992500.0,1003500.0,35202844.0,,\nQQQ,20160527,1096300.0,1101400.0,1096100.0,1101300.0,16913314.0,0.6157538571744703,0.6282949713247618\nSPY,20160531,996700.0,1004000.0,988200.0,998600.0,39056261.0,,\nQQQ,20160531,1102800.0,1105100.0,1097900.0,1103400.0,22259453.0,0.6121458909120677,0.6244639803423876\nSPY,20160601,989800.0,995400.0,983300.0,984600.0,28548655.0,,\nQQQ,20160601,1100000.0,1106000.0,1099100.0,1103500.0,18990799.0,0.6083224395015552,0.6209894368940911\nSPY,20160602,976800.0,978400.0,966300.0,977200.0,38758853.0,,\nQQQ,20160602,1101300.0,1105900.0,1095300.0,1105800.0,14573816.0,0.6034441385926195,0.6159731514948511\nSPY,20160603,978300.0,982700.0,974500.0,979200.0,27434297.0,,\nQQQ,20160603,1103700.0,1104200.0,1093400.0,1100600.0,19005526.0,0.600512376652085,0.6136821698822826\nSPY,20160606,979000.0,996500.0,975500.0,986300.0,22891049.0,,\nQQQ,20160606,1102600.0,1107500.0,1100700.0,1104600.0,12206740.0,0.597648769631563,0.6112304556976372\nSPY,20160607,993000.0,998700.0,989600.0,990300.0,21636446.0,,\nQQQ,20160607,1105200.0,1106300.0,1101300.0,1101800.0,11714181.0,0.5968538648150419,0.6110880941313187\nSPY,20160608,990600.0,995600.0,986700.0,989400.0,20364034.0,,\nQQQ,20160608,1103700.0,1105900.0,1099600.0,1103700.0,13230934.0,0.5960413334738845,0.6106782877226656\nSPY,20160609,985000.0,999900.0,984600.0,996500.0,25936969.0,,\nQQQ,20160609,1099200.0,1103100.0,1097100.0,1101900.0,17004569.0,0.5940616604708051,0.6093202650217128\nSPY,20160610,985100.0,993500.0,984800.0,988300.0,30821007.0,,\nQQQ,20160610,1091900.0,1094000.0,1085600.0,1089400.0,31816092.0,0.5929584838758845,0.6091016766079482\nSPY,20160613,986000.0,991200.0,970900.0,973400.0,36653624.0,,\nQQQ,20160613,1083200.0,1089300.0,1078900.0,1080300.0,23793618.0,0.5934100266308249,0.6109442327619549\nSPY,20160614,973200.0,984800.0,967500.0,974600.0,30869793.0,,\nQQQ,20160614,1077400.0,1084200.0,1072400.0,1080300.0,23284140.0,0.5947167452415723,0.6132665219919053\nSPY,20160615,978500.0,989400.0,970300.0,971400.0,27761532.0,,\nQQQ,20160615,1082900.0,1084400.0,1075400.0,1077200.0,22349990.0,0.5956699258275296,0.6152953081846146\nSPY,20160616,964500.0,977500.0,960000.0,975500.0,30806287.0,,\nQQQ,20160616,1071900.0,1081400.0,1065000.0,1080400.0,30003216.0,0.5959024618469522,0.6160808020071477\nSPY,20160617,966500.0,966500.0,953000.0,953300.0,53087273.0,,\nQQQ,20160617,1075300.0,1075600.0,1062400.0,1064900.0,27359949.0,0.5951564313567487,0.6144124887232331\nSPY,20160620,960100.0,965800.0,950300.0,951000.0,33146541.0,,\nQQQ,20160620,1077300.0,1082400.0,1070800.0,1071600.0,19633136.0,0.594477252509845,0.6138345948127538\nSPY,20160621,950000.0,995400.0,946700.0,959100.0,33929570.0,,\nQQQ,20160621,1073000.0,1077100.0,1071000.0,1075000.0,21579600.0,0.592717607769138,0.6108039747898046\nSPY,20160622,962700.0,968900.0,953600.0,955500.0,28303971.0,,\nQQQ,20160622,1075600.0,1081900.0,1071500.0,1072400.0,19196650.0,0.5909495262943021,0.6077372468323178\nSPY,20160623,960000.0,962900.0,952500.0,961000.0,30886732.0,,\nQQQ,20160623,1080700.0,1087900.0,1076200.0,1087700.0,17263349.0,0.5885719734882846,0.6043752959678389\nSPY,20160624,928800.0,946500.0,926500.0,934000.0,63948180.0,,\nQQQ,20160624,1049000.0,1065000.0,1040700.0,1042900.0,63088407.0,0.5908160332860394,0.6063834613572859\nSPY,20160627,930100.0,930800.0,915000.0,920400.0,44066853.0,,\nQQQ,20160627,1036000.0,1036000.0,1017500.0,1022200.0,46626203.0,0.5958170260917978,0.6108955740697053\nSPY,20160628,929100.0,936600.0,921400.0,935900.0,38383117.0,,\nQQQ,20160628,1033500.0,1045100.0,1033000.0,1044600.0,26073817.0,0.6021350959173892,0.6177055656317548\nSPY,20160629,939700.0,945500.0,936300.0,944000.0,34886961.0,,\nQQQ,20160629,1052800.0,1065300.0,1052400.0,1063100.0,29668019.0,0.6065798452195447,0.6221320788939669\nSPY,20160630,944600.0,957700.0,943000.0,956000.0,34038373.0,,\nQQQ,20160630,1064900.0,1076000.0,1061300.0,1075400.0,30429572.0,0.6091397754701144,0.6237446854957605\nSPY,20160701,955000.0,967000.0,953300.0,958900.0,25316094.0,,\nQQQ,20160701,1074900.0,1084800.0,1074500.0,1080800.0,19531458.0,0.6111719821939117,0.624442444362521\nSPY,20160705,953800.0,954000.0,932900.0,949900.0,25866347.0,,\nQQQ,20160705,1075100.0,1076600.0,1068400.0,1074200.0,19314640.0,0.6140480432544428,0.6261252816735063\nSPY,20160706,946000.0,956600.0,943700.0,955300.0,30244764.0,,\nQQQ,20160706,1069100.0,1083500.0,1065700.0,1083000.0,22961895.0,0.6155734884144568,0.6266663167264301\nSPY,20160707,957000.0,965000.0,956200.0,959400.0,24041197.0,,\nQQQ,20160707,1084000.0,1088600.0,1081100.0,1086200.0,17526516.0,0.6186353406459588,0.6307552686718438\nSPY,20160708,964900.0,968900.0,960500.0,966800.0,27600367.0,,\nQQQ,20160708,1092000.0,1103600.0,1090200.0,1103000.0,25680410.0,0.6188018687102598,0.6332714748807806\nSPY,20160711,967600.0,976500.0,967300.0,969800.0,23076180.0,,\nQQQ,20160711,1106700.0,1113400.0,1106600.0,1109300.0,18578691.0,0.6174549925605477,0.6325021029331217\nSPY,20160712,971700.0,977000.0,967900.0,974200.0,23198341.0,,\nQQQ,20160712,1116100.0,1117900.0,1113400.0,1114900.0,20556785.0,0.6136521293746997,0.6285814983280684\nSPY,20160713,974100.0,976600.0,968400.0,968700.0,25236731.0,,\nQQQ,20160713,1117500.0,1118200.0,1112200.0,1112200.0,20285318.0,0.6088895182421594,0.6233788632661295\nSPY,20160714,973300.0,989800.0,973200.0,987900.0,37605743.0,,\nQQQ,20160714,1119600.0,1121900.0,1117000.0,1119800.0,19711925.0,0.6044788325456493,0.6178057897895758\nSPY,20160715,990600.0,993000.0,985000.0,987800.0,28780560.0,,\nQQQ,20160715,1122400.0,1123000.0,1115500.0,1118000.0,15768055.0,0.5982415454935318,0.6104543869602708\nSPY,20160718,987000.0,1001300.0,986100.0,998300.0,36068957.0,,\nQQQ,20160718,1118700.0,1127400.0,1118500.0,1125400.0,18868100.0,0.5892057670616493,0.6016598490521677\nSPY,20160719,995000.0,1000000.0,983800.0,998700.0,22768722.0,,\nQQQ,20160719,1121500.0,1124700.0,1119300.0,1121300.0,16190351.0,0.5800853921412065,0.5931141585639956\nSPY,20160720,1000000.0,1004600.0,997400.0,999600.0,24962357.0,,\nQQQ,20160720,1127400.0,1136500.0,1126000.0,1134400.0,21979892.0,0.5692592569144329,0.5831701729602212\nSPY,20160721,1000000.0,1010000.0,973600.0,994300.0,30624178.0,,\nQQQ,20160721,1135200.0,1137400.0,1128700.0,1131800.0,17868626.0,0.5601249182813265,0.5735578960012413\nSPY,20160722,992600.0,1000000.0,983100.0,986600.0,27293674.0,,\nQQQ,20160722,1132600.0,1137800.0,1129200.0,1136500.0,17919229.0,0.5503380548863775,0.563888628516936\nSPY,20160725,982000.0,988300.0,969200.0,973400.0,38373260.0,,\nQQQ,20160725,1135600.0,1136900.0,1132800.0,1136600.0,12503677.0,0.5410950318608317,0.5544920650967536\nSPY,20160726,968300.0,979700.0,964200.0,966700.0,41029326.0,,\nQQQ,20160726,1136200.0,1142000.0,1132200.0,1137900.0,19621479.0,0.5322757434059409,0.5457337889083786\nSPY,20160727,1042500.0,1043500.0,1027500.0,1029500.0,84214186.0,,\nQQQ,20160727,1147500.0,1148800.0,1141000.0,1145800.0,22704072.0,0.5264153450365257,0.5390486478061514\nSPY,20160728,1028300.0,1044500.0,1028200.0,1043400.0,37944007.0,,\nQQQ,20160728,1147500.0,1151100.0,1144000.0,1149800.0,14847431.0,0.5207231675733419,0.531934577852497\nSPY,20160729,1041900.0,1045500.0,1036800.0,1042100.0,26620766.0,,\nQQQ,20160729,1152000.0,1155400.0,1148700.0,1152300.0,20810707.0,0.5140506369451775,0.5239386541763278\nSPY,20160801,1044400.0,1061600.0,1043500.0,1060500.0,37133531.0,,\nQQQ,20160801,1153100.0,1161300.0,1151700.0,1158400.0,13509130.0,0.508634186283238,0.5175204687928211\nSPY,20160802,1056000.0,1060700.0,1040000.0,1044800.0,32391206.0,,\nQQQ,20160802,1156700.0,1157700.0,1142200.0,1149600.0,19858833.0,0.5032222318219497,0.5103025410665745\nSPY,20160803,1048100.0,1058400.0,1047700.0,1057900.0,28482936.0,,\nQQQ,20160803,1148700.0,1153500.0,1148100.0,1153400.0,13242595.0,0.4990727515912431,0.5039773402592512\nSPY,20160804,1055500.0,1060100.0,1052800.0,1058700.0,25148182.0,,\nQQQ,20160804,1153000.0,1157800.0,1150400.0,1156700.0,12152693.0,0.4941796979428516,0.4968666447458616\nSPY,20160805,1062100.0,1076500.0,1061600.0,1074800.0,36569624.0,,\nQQQ,20160805,1162600.0,1170400.0,1161300.0,1167800.0,19130371.0,0.49127944335441553,0.49225950125430984\nSPY,20160808,1075200.0,1083700.0,1071600.0,1083700.0,26102786.0,,\nQQQ,20160808,1168400.0,1168700.0,1162800.0,1166500.0,11212368.0,0.48946253071407897,0.4882926585105635\nSPY,20160809,1082300.0,1089400.0,1080100.0,1088100.0,25643394.0,,\nQQQ,20160809,1167400.0,1172800.0,1166700.0,1169200.0,13573049.0,0.4868543113388876,0.48362505687380575\nSPY,20160810,1087100.0,1089000.0,1077600.0,1080000.0,23378227.0,,\nQQQ,20160810,1169900.0,1170200.0,1163200.0,1166200.0,14145957.0,0.4850761652859007,0.48055431565723833\nSPY,20160811,1085100.0,1089300.0,1078500.0,1079300.0,23509403.0,,\nQQQ,20160811,1170200.0,1173700.0,1167800.0,1171200.0,12005676.0,0.482825096695444,0.4764393724518872\nSPY,20160812,1077800.0,1084400.0,1077700.0,1081800.0,18220787.0,,\nQQQ,20160812,1169200.0,1172100.0,1167900.0,1172000.0,17743232.0,0.4810208414350152,0.47287587421466387\nSPY,20160815,1081400.0,1097900.0,1080800.0,1094800.0,24936635.0,,\nQQQ,20160815,1173500.0,1179700.0,1173200.0,1177000.0,11481381.0,0.4801272501443056,0.46973314551478496\nSPY,20160816,1096700.0,1102300.0,1081300.0,1093800.0,32554612.0,,\nQQQ,20160816,1174800.0,1174900.0,1170300.0,1170500.0,13348580.0,0.47869087095191637,0.46580079779296085\nSPY,20160817,1091000.0,1093700.0,1083400.0,1092200.0,24838329.0,,\nQQQ,20160817,1170800.0,1173000.0,1164300.0,1172600.0,14855132.0,0.47768608490731534,0.4622385136868347\nSPY,20160818,1092200.0,1096000.0,1085600.0,1090800.0,19211459.0,,\nQQQ,20160818,1171500.0,1174600.0,1169500.0,1172900.0,9071625.0,0.47722530717170264,0.4600604137177492\nSPY,20160819,1087800.0,1096900.0,1083600.0,1093600.0,24581208.0,,\nQQQ,20160819,1170800.0,1175200.0,1167600.0,1172600.0,17196221.0,0.4792201831100137,0.46217814869987695\nSPY,20160822,1090000.0,1091400.0,1078500.0,1085100.0,25028483.0,,\nQQQ,20160822,1170900.0,1175500.0,1168700.0,1173500.0,14042742.0,0.48063497711258074,0.4622741327785178\nSPY,20160823,1085700.0,1093200.0,1085300.0,1088500.0,18902755.0,,\nQQQ,20160823,1178100.0,1180000.0,1175100.0,1175600.0,11351356.0,0.4825615990744229,0.4619895549828595\nSPY,20160824,1085600.0,1087500.0,1076800.0,1080300.0,22543200.0,,\nQQQ,20160824,1174800.0,1176400.0,1164100.0,1168000.0,16723656.0,0.4850498799610625,0.4614167365146714\nSPY,20160825,1073800.0,1080300.0,1066800.0,1075700.0,24495590.0,,\nQQQ,20160825,1165000.0,1169700.0,1163600.0,1166100.0,22287155.0,0.4882680413438433,0.46595723421096136\nSPY,20160826,1074100.0,1079400.0,1063100.0,1069400.0,27005806.0,,\nQQQ,20160826,1166500.0,1175400.0,1160800.0,1167800.0,23406014.0,0.4903955911618803,0.46936606991572594\nSPY,20160829,1066300.0,1074400.0,1062900.0,1068200.0,24616111.0,,\nQQQ,20160829,1168100.0,1172500.0,1167900.0,1169400.0,10914791.0,0.49267314350986724,0.4729404420333842\nSPY,20160830,1058200.0,1065000.0,1055000.0,1060000.0,23452366.0,,\nQQQ,20160830,1167500.0,1170900.0,1161600.0,1165600.0,18464823.0,0.49576669463136364,0.47802872587646356\nSPY,20160831,1056700.0,1065600.0,1056400.0,1061000.0,26798366.0,,\nQQQ,20160831,1163800.0,1165600.0,1159500.0,1164400.0,15328565.0,0.4986567014565352,0.48071815628000103\nSPY,20160901,1061400.0,1068300.0,1056200.0,1067300.0,26334018.0,,\nQQQ,20160901,1164800.0,1168800.0,1159200.0,1167400.0,19241076.0,0.5026113328814339,0.4867324457805312\nSPY,20160902,1076700.0,1080000.0,1068200.0,1077300.0,25594944.0,,\nQQQ,20160902,1173200.0,1175600.0,1166800.0,1171200.0,16736947.0,0.5063980892923593,0.49243984353878906\nSPY,20160906,1078200.0,1083000.0,1075100.0,1077000.0,23230452.0,,\nQQQ,20160906,1173200.0,1178500.0,1170700.0,1178500.0,17081737.0,0.5103048620390663,0.497885068375063\nSPY,20160907,1078600.0,1087600.0,1070700.0,1083600.0,41617783.0,,\nQQQ,20160907,1179600.0,1181200.0,1174700.0,1179200.0,16552699.0,0.513986719019304,0.5033831594718833\nSPY,20160908,1071200.0,1072700.0,1052400.0,1055200.0,50877838.0,,\nQQQ,20160908,1175700.0,1176000.0,1169200.0,1172300.0,18633525.0,0.5156824357272282,0.5077871814320069\nSPY,20160909,1046100.0,1057200.0,1031300.0,1031300.0,44189149.0,,\nQQQ,20160909,1162500.0,1165100.0,1142600.0,1142800.0,49577287.0,0.5181197826923721,0.5134299986037979\nSPY,20160912,1026500.0,1057200.0,1025300.0,1054400.0,43328049.0,,\nQQQ,20160912,1136400.0,1164900.0,1136300.0,1163300.0,39029019.0,0.5213245599434753,0.5178647654814024\nSPY,20160913,1075000.0,1087900.0,1072400.0,1079500.0,59335783.0,,\nQQQ,20160913,1157500.0,1160900.0,1147400.0,1152900.0,44471915.0,0.5277333256451434,0.5243268222226528\nSPY,20160914,1086000.0,1130300.0,1086000.0,1117700.0,109514728.0,,\nQQQ,20160914,1154100.0,1164700.0,1153800.0,1158400.0,26998332.0,0.5350085015603947,0.5307758325591101\nSPY,20160915,1136700.0,1157300.0,1135600.0,1155700.0,86901712.0,,\nQQQ,20160915,1158700.0,1178100.0,1158600.0,1176400.0,37286204.0,0.5437438527117013,0.5400128003770792\nSPY,20160916,1151700.0,1161200.0,1140400.0,1149200.0,73176814.0,,\nQQQ,20160916,1172400.0,1174100.0,1167100.0,1172900.0,22052198.0,0.5506297686156987,0.5479465871003217\nSPY,20160919,1151900.0,1161800.0,1130000.0,1135800.0,45421766.0,,\nQQQ,20160919,1175900.0,1179500.0,1165500.0,1167800.0,16555774.0,0.5584870292439653,0.5576231099849438\nSPY,20160920,1130600.0,1141200.0,1125100.0,1135700.0,33788087.0,,\nQQQ,20160920,1172000.0,1174800.0,1168100.0,1170000.0,15272828.0,0.5671922815011063,0.5673220084543511\nSPY,20160921,1138200.0,1139900.0,1124400.0,1135500.0,33698695.0,,\nQQQ,20160921,1175000.0,1183200.0,1168200.0,1181500.0,29347887.0,0.5767358366482763,0.5789627112833169\nSPY,20160922,1142300.0,1149400.0,1140000.0,1146200.0,30029962.0,,\nQQQ,20160922,1188400.0,1192200.0,1187200.0,1190900.0,20605769.0,0.5876001951376281,0.5915790030181665\nSPY,20160923,1144600.0,1147900.0,1115500.0,1127100.0,51888735.0,,\nQQQ,20160923,1190000.0,1190000.0,1181600.0,1183300.0,20733818.0,0.5985039711790059,0.6045188663232608\nSPY,20160926,1116400.0,1133900.0,1115500.0,1128800.0,28250520.0,,\nQQQ,20160926,1176600.0,1178000.0,1171700.0,1173400.0,16010083.0,0.6106091942210867,0.6178490401783265\nSPY,20160927,1130000.0,1131800.0,1123400.0,1130900.0,23890807.0,,\nQQQ,20160927,1172600.0,1185500.0,1171500.0,1185000.0,16697729.0,0.6250700546901454,0.632104561235437\nSPY,20160928,1136600.0,1152900.0,1134300.0,1139500.0,28888973.0,,\nQQQ,20160928,1186500.0,1187700.0,1180900.0,1187000.0,14094643.0,0.6368906051491937,0.6437700099782339\nSPY,20160929,1132000.0,1138000.0,1118000.0,1121800.0,35052192.0,,\nQQQ,20160929,1185000.0,1187200.0,1173400.0,1178400.0,26361231.0,0.646175453818709,0.6548190605037852\nSPY,20160930,1124700.0,1133700.0,1118000.0,1130500.0,34030629.0,,\nQQQ,20160930,1181500.0,1190700.0,1180300.0,1187200.0,23458388.0,0.6546158555697282,0.6652590868581509\nSPY,20161003,1127500.0,1130400.0,1122800.0,1125200.0,21145474.0,,\nQQQ,20161003,1185700.0,1187000.0,1180800.0,1185500.0,17875967.0,0.6614302777480002,0.6749488584646833\nSPY,20161004,1130000.0,1143100.0,1126300.0,1130000.0,29186112.0,,\nQQQ,20161004,1189000.0,1191600.0,1179300.0,1183700.0,20504314.0,0.6672284080831727,0.6830926295108481\nSPY,20161005,1133800.0,1136600.0,1126900.0,1130500.0,20448168.0,,\nQQQ,20161005,1187200.0,1191700.0,1186700.0,1187900.0,14065651.0,0.6739035657769082,0.6919142959506855\nSPY,20161006,1136500.0,1143400.0,1131300.0,1138900.0,28112479.0,,\nQQQ,20161006,1186400.0,1189800.0,1181600.0,1187300.0,11332868.0,0.6799484499930524,0.6999123395411215\nSPY,20161007,1144300.0,1145600.0,1135100.0,1140600.0,23825116.0,,\nQQQ,20161007,1188400.0,1190100.0,1179000.0,1184700.0,18328776.0,0.6848778193179765,0.706596730767731\nSPY,20161010,1150200.0,1167500.0,1147200.0,1160500.0,34819261.0,,\nQQQ,20161010,1190800.0,1194800.0,1190300.0,1192200.0,18022477.0,0.6917291512280144,0.7137561681960521\nSPY,20161011,1176400.0,1186900.0,1162000.0,1163000.0,61260821.0,,\nQQQ,20161011,1191200.0,1191400.0,1170000.0,1175200.0,25781487.0,0.6976359364416778,0.7200648717398558\nSPY,20161012,1173600.0,1179800.0,1167500.0,1173400.0,36737941.0,,\nQQQ,20161012,1176300.0,1178200.0,1170600.0,1174200.0,13514398.0,0.7044299294061572,0.7275270203671327\nSPY,20161013,1167900.0,1174400.0,1157000.0,1169800.0,34118506.0,,\nQQQ,20161013,1166200.0,1173200.0,1159400.0,1170000.0,21791329.0,0.7100980657201128,0.7338452361138874\nSPY,20161014,1178900.0,1181700.0,1171200.0,1176300.0,34509912.0,,\nQQQ,20161014,1175800.0,1180500.0,1170700.0,1171400.0,20678381.0,0.7152155908140001,0.7385143383774658\nSPY,20161017,1173400.0,1178400.0,1167800.0,1175500.0,22447130.0,,\nQQQ,20161017,1170400.0,1173000.0,1166800.0,1168200.0,13220120.0,0.7193509227999867,0.7420697358209722\nSPY,20161018,1180000.0,1182100.0,1174500.0,1174700.0,22628010.0,,\nQQQ,20161018,1182100.0,1184100.0,1178000.0,1178600.0,17384714.0,0.7236877340076653,0.7460054587208861\nSPY,20161019,1173200.0,1177600.0,1154200.0,1171200.0,19411810.0,,\nQQQ,20161019,1177300.0,1180200.0,1176400.0,1178500.0,12799584.0,0.7294073865217006,0.7516311675422472\nSPY,20161020,1168600.0,1173800.0,1163300.0,1170600.0,23506627.0,,\nQQQ,20161020,1177300.0,1179700.0,1170300.0,1177100.0,16319681.0,0.735699492150212,0.7580518377864599\nSPY,20161021,1168100.0,1169100.0,1162800.0,1166000.0,21994183.0,,\nQQQ,20161021,1178000.0,1182200.0,1174100.0,1181500.0,12972732.0,0.740745810526574,0.7627645749633262\nSPY,20161024,1171000.0,1177400.0,1170000.0,1176500.0,22528797.0,,\nQQQ,20161024,1189100.0,1196500.0,1189000.0,1195700.0,16216682.0,0.7448960298700598,0.7663126127630725\nSPY,20161025,1179800.0,1183600.0,1172800.0,1182500.0,38161660.0,,\nQQQ,20161025,1196400.0,1196600.0,1190100.0,1191900.0,18183030.0,0.7478341166565738,0.769128771688772\nSPY,20161026,1141700.0,1157000.0,1133100.0,1155900.0,62667865.0,,\nQQQ,20161026,1184200.0,1190400.0,1180300.0,1183800.0,19074971.0,0.7497277766530159,0.7708133678881022\nSPY,20161027,1153000.0,1158600.0,1141000.0,1144800.0,27887140.0,,\nQQQ,20161027,1188900.0,1189900.0,1176700.0,1178400.0,16357162.0,0.7518030486548296,0.7726648114741899\nSPY,20161028,1138500.0,1152100.0,1134500.0,1137200.0,34828527.0,,\nQQQ,20161028,1175000.0,1181100.0,1167400.0,1171000.0,32410172.0,0.7543166788713189,0.7743156632582207\nSPY,20161031,1136000.0,1142300.0,1132000.0,1135400.0,23701883.0,,\nQQQ,20161031,1175300.0,1175300.0,1169300.0,1169900.0,18025131.0,0.7569624642596254,0.776525922460324\nSPY,20161101,1134700.0,1137700.0,1105300.0,1114900.0,42226139.0,,\nQQQ,20161101,1171900.0,1172100.0,1151000.0,1161100.0,22925367.0,0.7586035949843157,0.777441895866726\nSPY,20161102,1112300.0,1123500.0,1112300.0,1115900.0,27711308.0,,\nQQQ,20161102,1160300.0,1163000.0,1149000.0,1151800.0,24660939.0,0.7603958143658671,0.7779829313253579\nSPY,20161103,1109600.0,1114600.0,1095500.0,1098300.0,24904137.0,,\nQQQ,20161103,1149900.0,1153700.0,1139200.0,1140500.0,30499787.0,0.7617533613514867,0.7786152226716725\nSPY,20161104,1083000.0,1102500.0,1081100.0,1088400.0,29554877.0,,\nQQQ,20161104,1137700.0,1145400.0,1134500.0,1136500.0,24483522.0,0.7629841279766062,0.7793761180193889\nSPY,20161107,1100000.0,1105100.0,1094700.0,1104100.0,31445735.0,,\nQQQ,20161107,1154900.0,1164700.0,1153000.0,1163500.0,24629132.0,0.7645211435080225,0.7802174790896431\nSPY,20161108,1103000.0,1117200.0,1097000.0,1110600.0,23222237.0,,\nQQQ,20161108,1162300.0,1176400.0,1159600.0,1171100.0,19311317.0,0.7674066517521771,0.7823894954354463\nSPY,20161109,1098500.0,1113200.0,1080500.0,1108800.0,55423726.0,,\nQQQ,20161109,1157400.0,1178400.0,1156000.0,1176500.0,64121012.0,0.7689464511578414,0.7840849654709586\nSPY,20161110,1110700.0,1191500.0,1058300.0,1077900.0,56050617.0,,\nQQQ,20161110,1182200.0,1183800.0,1142000.0,1157500.0,69491123.0,0.7697778672642969,0.7852202780024783\nSPY,20161111,1070000.0,1088700.0,1065500.0,1084300.0,33567111.0,,\nQQQ,20161111,1152500.0,1160500.0,1148300.0,1158000.0,39097265.0,0.7716101448868653,0.7867174057892541\nSPY,20161114,1077400.0,1078200.0,1040800.0,1057100.0,50015318.0,,\nQQQ,20161114,1158300.0,1159400.0,1140300.0,1146300.0,34543671.0,0.7732772424266056,0.7882574242922029\nSPY,20161115,1065000.0,1076800.0,1061600.0,1071100.0,31126175.0,,\nQQQ,20161115,1155000.0,1166200.0,1153300.0,1162200.0,28474667.0,0.774555839122084,0.7898497866519387\nSPY,20161116,1068800.0,1102300.0,1066200.0,1099900.0,61925327.0,,\nQQQ,20161116,1156700.0,1169900.0,1156700.0,1169100.0,14903722.0,0.7764506548877539,0.7920101803215654\nSPY,20161117,1098200.0,1103400.0,1088300.0,1099500.0,26360929.0,,\nQQQ,20161117,1168500.0,1177800.0,1166100.0,1177600.0,20176082.0,0.7779212921211455,0.7940022267584079\nSPY,20161118,1097200.0,1105400.0,1090000.0,1100600.0,26357908.0,,\nQQQ,20161118,1179000.0,1181000.0,1172100.0,1173200.0,15082780.0,0.7801610332985577,0.7963572133328117\nSPY,20161121,1100200.0,1119900.0,1100100.0,1117300.0,27242865.0,,\nQQQ,20161121,1176100.0,1186500.0,1175700.0,1185400.0,20611982.0,0.7823734336984339,0.7986357125228536\nSPY,20161122,1119500.0,1124100.0,1114000.0,1118000.0,22574252.0,,\nQQQ,20161122,1190100.0,1191900.0,1186100.0,1189000.0,18793612.0,0.7843301218984859,0.8010734102536387\nSPY,20161123,1113700.0,1115200.0,1103300.0,1112300.0,24626417.0,,\nQQQ,20161123,1185100.0,1186400.0,1179000.0,1184200.0,20491749.0,0.7868346683087489,0.8035441016160546\nSPY,20161125,1111300.0,1118600.0,1109500.0,1117900.0,11103305.0,,\nQQQ,20161125,1185600.0,1188500.0,1184200.0,1188000.0,6743757.0,0.7891034722140671,0.8060846816264228\nSPY,20161128,1114300.0,1124600.0,1113900.0,1115700.0,25825140.0,,\nQQQ,20161128,1186500.0,1190800.0,1184200.0,1185300.0,13216697.0,0.7911793848668752,0.8084726618634408\nSPY,20161129,1106900.0,1120300.0,1100700.0,1114600.0,27670837.0,,\nQQQ,20161129,1186400.0,1195100.0,1183000.0,1189400.0,18188142.0,0.7937617982302824,0.8110634835682289\nSPY,20161130,1116000.0,1122000.0,1102700.0,1105200.0,32985566.0,,\nQQQ,20161130,1190900.0,1191300.0,1174600.0,1175000.0,27473786.0,0.7948623723930196,0.8129601425969145\nSPY,20161201,1103400.0,1109400.0,1090300.0,1094900.0,34696931.0,,\nQQQ,20161201,1174600.0,1174700.0,1152900.0,1154700.0,36706479.0,0.7960203939749739,0.8143912807435523\nSPY,20161202,1091700.0,1100900.0,1088500.0,1099000.0,25859473.0,,\nQQQ,20161202,1155400.0,1161600.0,1152200.0,1157000.0,31218241.0,0.7984196693039074,0.8170942084090252\nSPY,20161205,1100000.0,1100300.0,1082500.0,1091100.0,32291534.0,,\nQQQ,20161205,1163000.0,1170600.0,1157600.0,1166000.0,20525092.0,0.8001300412498913,0.8190135157636593\nSPY,20161206,1094700.0,1103600.0,1091900.0,1099500.0,24991348.0,,\nQQQ,20161206,1169300.0,1170800.0,1163900.0,1168800.0,25136386.0,0.8022723207342511,0.8215310031564016\nSPY,20161207,1092500.0,1111900.0,1092300.0,1110300.0,29129311.0,,\nQQQ,20161207,1166200.0,1185000.0,1162900.0,1183600.0,24978449.0,0.8046860587374889,0.8241077976597192\nSPY,20161208,1107800.0,1124300.0,1106000.0,1121200.0,26530750.0,,\nQQQ,20161208,1184100.0,1188700.0,1181800.0,1185700.0,17855858.0,0.8077686780647729,0.8277454456289812\nSPY,20161209,1125000.0,1147000.0,1124100.0,1139500.0,33661925.0,,\nQQQ,20161209,1190100.0,1195400.0,1190000.0,1195000.0,20873892.0,0.8111911337883666,0.8317450646441324\nSPY,20161212,1131900.0,1133500.0,1124900.0,1133000.0,25752165.0,,\nQQQ,20161212,1189700.0,1192100.0,1184700.0,1189600.0,22603883.0,0.8151288749570852,0.8361982034846186\nSPY,20161213,1138300.0,1159200.0,1137500.0,1151900.0,42063362.0,,\nQQQ,20161213,1193200.0,1211100.0,1193200.0,1204600.0,53002044.0,0.8185779484116245,0.8397949838918581\nSPY,20161214,1149800.0,1162000.0,1149800.0,1151900.0,32225223.0,,\nQQQ,20161214,1206100.0,1210000.0,1198600.0,1202100.0,25883799.0,0.82082736164413,0.8420807639139178\nSPY,20161215,1152300.0,1167300.0,1152300.0,1158200.0,43999090.0,,\nQQQ,20161215,1203700.0,1211100.0,1200800.0,1204000.0,21186643.0,0.8226580973967675,0.8438583453907766\nSPY,20161216,1164300.0,1165000.0,1156500.0,1159700.0,39461290.0,,\nQQQ,20161216,1203400.0,1205200.0,1193600.0,1196000.0,22952131.0,0.8244453175457789,0.8457379100276662\nSPY,20161219,1158000.0,1173800.0,1084200.0,1166400.0,28251760.0,,\nQQQ,20161219,1197200.0,1208300.0,1195500.0,1200900.0,19564214.0,0.8265178044689957,0.8474442532677388\nSPY,20161220,1167400.0,1175000.0,1117200.0,1169500.0,19534840.0,,\nQQQ,20161220,1204700.0,1207700.0,1203300.0,1205500.0,11195243.0,0.8286221225846668,0.8490988550516193\nSPY,20161221,1168000.0,1174000.0,1167500.0,1170600.0,23127455.0,,\nQQQ,20161221,1206000.0,1206800.0,1201900.0,1204600.0,6849219.0,0.8304656415385865,0.8506349203969245\nSPY,20161222,1163500.0,1165100.0,1156400.0,1162900.0,25054805.0,,\nQQQ,20161222,1204700.0,1205000.0,1196600.0,1201200.0,15569584.0,0.8321121675301211,0.8522134103407062\nSPY,20161223,1158000.0,1165200.0,1157500.0,1165200.0,13757757.0,,\nQQQ,20161223,1199200.0,1202500.0,1198000.0,1202000.0,8073528.0,0.8336979802706297,0.8536016465785522\nSPY,20161227,1165200.0,1178000.0,1164900.0,1172600.0,17558697.0,,\nQQQ,20161227,1204600.0,1215200.0,1204100.0,1208200.0,15536641.0,0.8353864381914372,0.8548856495073653\nSPY,20161228,1175200.0,1180200.0,1162000.0,1167600.0,20364341.0,,\nQQQ,20161228,1210800.0,1211900.0,1198000.0,1198800.0,17481445.0,0.8366057892944951,0.8559977158774063\nSPY,20161229,1164500.0,1171100.0,1164000.0,1167300.0,14768141.0,,\nQQQ,20161229,1198500.0,1201300.0,1193300.0,1197100.0,12913138.0,0.8378441269344656,0.8570377941344843\nSPY,20161230,1166500.0,1172000.0,1154300.0,1158200.0,28511929.0,,\nQQQ,20161230,1199400.0,1199500.0,1181500.0,1184800.0,39570090.0,0.8387534524588135,0.8580454136347242\nSPY,20170103,1158000.0,1167800.0,1147600.0,1161500.0,27566154.0,,\nQQQ,20170103,1192700.0,1199900.0,1188900.0,1195400.0,21298217.0,0.8402408373253192,0.8592860840016558\nSPY,20170104,1159500.0,1165100.0,1157900.0,1160200.0,20381945.0,,\nQQQ,20170104,1196700.0,1204100.0,1196600.0,1201900.0,18383601.0,0.8415027604851503,0.8603704051564355\nSPY,20170105,1159000.0,1168600.0,1158000.0,1166100.0,21763957.0,,\nQQQ,20170105,1201000.0,1209500.0,1201000.0,1208700.0,20177699.0,0.8427810405267715,0.8617554267144424\nSPY,20170106,1167800.0,1181600.0,1164700.0,1179100.0,30837563.0,,\nQQQ,20170106,1210000.0,1222500.0,1206800.0,1219300.0,22000840.0,0.8438073699949028,0.8633999054782265\nSPY,20170109,1179400.0,1194300.0,1179400.0,1189900.0,31681011.0,,\nQQQ,20170109,1220300.0,1225500.0,1219500.0,1223300.0,17445807.0,0.8449946922502165,0.86503913510779\nSPY,20170110,1187700.0,1193800.0,1156600.0,1191100.0,22959337.0,,\nQQQ,20170110,1223800.0,1229700.0,1221000.0,1226000.0,15473817.0,0.8465101373435688,0.8672295238305503\nSPY,20170111,1187000.0,1199300.0,1186000.0,1197500.0,26579626.0,,\nQQQ,20170111,1226500.0,1229300.0,1220100.0,1229300.0,18854540.0,0.8482952699057916,0.8698546777465815\nSPY,20170112,1188000.0,1193000.0,1182100.0,1192500.0,26290866.0,,\nQQQ,20170112,1224900.0,1228200.0,1215900.0,1227400.0,18632951.0,0.8497866702379728,0.8717098714077288\nSPY,20170113,1191000.0,1196200.0,1188100.0,1190400.0,25328556.0,,\nQQQ,20170113,1228000.0,1233700.0,1228000.0,1231600.0,14033357.0,0.8515383186348873,0.8743505603639655\nSPY,20170117,1182200.0,1202400.0,1182200.0,1200000.0,31860846.0,,\nQQQ,20170117,1228400.0,1230300.0,1224400.0,1227900.0,13796704.0,0.8531782160909863,0.8760441557090348\nSPY,20170118,1200000.0,1205000.0,1197100.0,1199900.0,22661302.0,,\nQQQ,20170118,1229700.0,1231600.0,1226600.0,1230400.0,10920268.0,0.8545844018861642,0.8773189452094188\nSPY,20170119,1194000.0,1200900.0,1193700.0,1197800.0,24056010.0,,\nQQQ,20170119,1232200.0,1236400.0,1227200.0,1229800.0,11715608.0,0.8560610105903922,0.8787470843879374\nSPY,20170120,1204100.0,1204500.0,1197400.0,1200000.0,28290059.0,,\nQQQ,20170120,1235200.0,1238300.0,1229300.0,1232500.0,18817221.0,0.8573480060561942,0.8799091824793539\nSPY,20170123,1200000.0,1208100.0,1197700.0,1200800.0,20719009.0,,\nQQQ,20170123,1231700.0,1235200.0,1225700.0,1233500.0,16548029.0,0.8598364008943374,0.8829420572445728\nSPY,20170124,1195500.0,1201000.0,1195000.0,1199700.0,22375368.0,,\nQQQ,20170124,1235900.0,1243700.0,1233900.0,1241800.0,16689559.0,0.862084933106444,0.8854871374654042\nSPY,20170125,1202800.0,1221000.0,1202800.0,1218800.0,31611924.0,,\nQQQ,20170125,1249600.0,1254600.0,1248600.0,1254300.0,14562459.0,0.8646344884050701,0.8883490404302843\nSPY,20170126,1217000.0,1224400.0,1216000.0,1219400.0,24836210.0,,\nQQQ,20170126,1256000.0,1258200.0,1253500.0,1255600.0,13551108.0,0.8654237883387225,0.8886600725057773\nSPY,20170127,1221400.0,1223500.0,1216000.0,1219500.0,20071528.0,,\nQQQ,20170127,1258300.0,1259200.0,1253900.0,1258000.0,13846308.0,0.8662929785127822,0.889179736696228\nSPY,20170130,1209300.0,1216300.0,1206500.0,1216300.0,29565047.0,,\nQQQ,20170130,1253800.0,1253800.0,1241300.0,1248200.0,23217505.0,0.8675204653065224,0.8905520716543948\nSPY,20170131,1210300.0,1213900.0,1206300.0,1213500.0,40339947.0,,\nQQQ,20170131,1243800.0,1246000.0,1238500.0,1245700.0,17455571.0,0.8684624078733391,0.8915507390221673\nSPY,20170201,1271000.0,1304900.0,1270000.0,1287500.0,104711500.0,,\nQQQ,20170201,1254500.0,1256800.0,1248600.0,1254300.0,20792517.0,0.8690624740792698,0.8920694452450608\nSPY,20170202,1279900.0,1293900.0,1210300.0,1285300.0,31899868.0,,\nQQQ,20170202,1252100.0,1257000.0,1248600.0,1253200.0,14269696.0,0.8701953517771724,0.8930022906842335\nSPY,20170203,1283100.0,1291900.0,1281600.0,1290800.0,22354077.0,,\nQQQ,20170203,1254500.0,1258100.0,1253300.0,1256800.0,15831866.0,0.8715285487044988,0.8939362609370386\nSPY,20170206,1289500.0,1305000.0,1289200.0,1302900.0,26243472.0,,\nQQQ,20170206,1254700.0,1258400.0,1253500.0,1258300.0,10763179.0,0.8727052271746384,0.8942872027903607\nSPY,20170207,1305000.0,1320900.0,1283100.0,1315300.0,37247537.0,,\nQQQ,20170207,1260900.0,1265500.0,1259700.0,1262900.0,16420559.0,0.8752756696624117,0.8947701227765562\nSPY,20170208,1313000.0,1324400.0,1312200.0,1320400.0,22628497.0,,\nQQQ,20170208,1261200.0,1266800.0,1258800.0,1265000.0,11734728.0,0.8782115087874119,0.8952247545954048\nSPY,20170209,1316700.0,1324500.0,1311200.0,1324200.0,24801967.0,,\nQQQ,20170209,1266300.0,1272400.0,1265700.0,1269600.0,15038528.0,0.88085177969165,0.8955565745547697\nSPY,20170210,1324200.0,1329400.0,1320600.0,1321200.0,19385330.0,,\nQQQ,20170210,1272400.0,1275600.0,1270200.0,1273800.0,13149710.0,0.8836326758975116,0.8957939101867222\nSPY,20170213,1330000.0,1338200.0,1327500.0,1332900.0,21783645.0,,\nQQQ,20170213,1277700.0,1282600.0,1277200.0,1281000.0,18153459.0,0.8861578752689432,0.8960747386043089\nSPY,20170214,1334600.0,1350900.0,1332600.0,1350200.0,30958677.0,,\nQQQ,20170214,1281500.0,1285400.0,1277400.0,1285300.0,15535982.0,0.8890316946132005,0.8969303466803208\nSPY,20170215,1355000.0,1362700.0,1346200.0,1355100.0,35068655.0,,\nQQQ,20170215,1284400.0,1293500.0,1283800.0,1292900.0,15673199.0,0.8918992019064523,0.8985255386040246\nSPY,20170216,1356800.0,1359000.0,1348300.0,1353500.0,21464041.0,,\nQQQ,20170216,1293700.0,1296300.0,1289200.0,1292500.0,14290464.0,0.8944154459527965,0.899306158972256\nSPY,20170217,1351000.0,1357900.0,1351000.0,1357200.0,21060304.0,,\nQQQ,20170217,1290600.0,1298200.0,1290400.0,1298100.0,13024315.0,0.8969133925627508,0.8999997937855257\nSPY,20170221,1362500.0,1367500.0,1359700.0,1367000.0,21741434.0,,\nQQQ,20170221,1300600.0,1305300.0,1299900.0,1304500.0,16989257.0,0.8993352904829555,0.9009262649334121\nSPY,20170222,1364100.0,1371200.0,1361100.0,1371100.0,18855723.0,,\nQQQ,20170222,1303300.0,1305900.0,1301200.0,1305000.0,10602727.0,0.9014661893790242,0.9012048436719308\nSPY,20170223,1374000.0,1374800.0,1363000.0,1365300.0,20003938.0,,\nQQQ,20170223,1307000.0,1307000.0,1294900.0,1300100.0,16964987.0,0.9035311201952172,0.9018465680096533\nSPY,20170224,1359000.0,1366600.0,1352800.0,1366600.0,20909781.0,,\nQQQ,20170224,1294200.0,1302600.0,1293800.0,1302600.0,16940719.0,0.9055400108990705,0.9026436854888737\nSPY,20170227,1370000.0,1374400.0,1362800.0,1369300.0,18856049.0,,\nQQQ,20170227,1300200.0,1304300.0,1298000.0,1304200.0,11391864.0,0.9075890696480297,0.9034820461114217\nSPY,20170228,1370800.0,1374400.0,1367000.0,1369900.0,22116215.0,,\nQQQ,20170228,1303900.0,1304500.0,1296600.0,1300200.0,14269724.0,0.9096406495881207,0.9042236728159835\nSPY,20170301,1379000.0,1401500.0,1376000.0,1397900.0,35076042.0,,\nQQQ,20170301,1308500.0,1316800.0,1306100.0,1314400.0,21803450.0,0.9120686113003089,0.9062340885843653\nSPY,20170302,1400000.0,1402700.0,1387600.0,1389600.0,25440603.0,,\nQQQ,20170302,1314100.0,1314300.0,1306200.0,1307800.0,19745391.0,0.9142466362714158,0.9082010115834203\nSPY,20170303,1387900.0,1398300.0,1385800.0,1397800.0,19882672.0,,\nQQQ,20170303,1306900.0,1310600.0,1303500.0,1310200.0,12312143.0,0.9166318507369909,0.9101649350811422\nSPY,20170306,1393300.0,1397700.0,1386000.0,1393400.0,20432521.0,,\nQQQ,20170306,1305900.0,1309500.0,1302100.0,1307300.0,10942484.0,0.919291309861205,0.9121693518468585\nSPY,20170307,1390600.0,1399800.0,1387900.0,1395200.0,16650769.0,,\nQQQ,20170307,1304700.0,1310800.0,1302800.0,1305100.0,14506559.0,0.9216991157689765,0.9142827040737421\nSPY,20170308,1389200.0,1398000.0,1388200.0,1390000.0,17929655.0,,\nQQQ,20170308,1305900.0,1311500.0,1304600.0,1307400.0,14790141.0,0.9242566785093466,0.9164532178188639\nSPY,20170309,1387400.0,1387900.0,1370500.0,1386800.0,20246158.0,,\nQQQ,20170309,1307100.0,1310200.0,1301400.0,1308400.0,18455453.0,0.9265451070993023,0.9184947530308499\nSPY,20170310,1392700.0,1393500.0,1386400.0,1391400.0,18381146.0,,\nQQQ,20170310,1314400.0,1316000.0,1308300.0,1313900.0,18542254.0,0.9289695930168181,0.9204890461056993\nSPY,20170313,1388200.0,1394300.0,1388200.0,1392000.0,16139100.0,,\nQQQ,20170313,1313400.0,1316400.0,1312700.0,1316100.0,10106985.0,0.9309928562406734,0.9218199017599062\nSPY,20170314,1393000.0,1396500.0,1388400.0,1389900.0,14739266.0,,\nQQQ,20170314,1313100.0,1313700.0,1307600.0,1312900.0,13459518.0,0.9328883889560042,0.9231066873492588\nSPY,20170315,1394200.0,1407600.0,1390300.0,1404600.0,23744951.0,,\nQQQ,20170315,1315600.0,1324000.0,1311400.0,1321000.0,21389658.0,0.9354053182475941,0.9246821748336583\nSPY,20170316,1407400.0,1410200.0,1402600.0,1406900.0,18587506.0,,\nQQQ,20170316,1323500.0,1323500.0,1317100.0,1320100.0,17182282.0,0.9378089140134246,0.926262751621521\nSPY,20170317,1410000.0,1410000.0,1398900.0,1399900.0,38040426.0,,\nQQQ,20170317,1319000.0,1320400.0,1316200.0,1316900.0,18320512.0,0.9400644785488194,0.9277928710915713\nSPY,20170320,1404600.0,1415000.0,1402300.0,1414600.0,19377966.0,,\nQQQ,20170320,1316500.0,1321100.0,1314700.0,1318100.0,9807650.0,0.9423239532344487,0.9294204742818402\nSPY,20170321,1421500.0,1428100.0,1397300.0,1398400.0,38207481.0,,\nQQQ,20170321,1323100.0,1324300.0,1297300.0,1298100.0,35310462.0,0.9439558922507636,0.9307239311155658\nSPY,20170322,1398300.0,1416000.0,1397600.0,1414200.0,24790035.0,,\nQQQ,20170322,1298500.0,1308200.0,1296800.0,1306900.0,29543892.0,0.9457448151893016,0.9320838292675573\nSPY,20170323,1412600.0,1415800.0,1406100.0,1409200.0,19450906.0,,\nQQQ,20170323,1305200.0,1308800.0,1301400.0,1303600.0,18406145.0,0.9476707519480367,0.9337927941908485\nSPY,20170324,1415000.0,1417400.0,1403500.0,1406400.0,21390648.0,,\nQQQ,20170324,1307800.0,1312900.0,1301300.0,1306300.0,22445760.0,0.9495218800341513,0.9350675815403855\nSPY,20170327,1393900.0,1412200.0,1386200.0,1408800.0,23158410.0,,\nQQQ,20170327,1297000.0,1310700.0,1294000.0,1308400.0,17716189.0,0.9513138401420546,0.936248435106146\nSPY,20170328,1408900.0,1440400.0,1406200.0,1438000.0,32835709.0,,\nQQQ,20170328,1308400.0,1320300.0,1305500.0,1316400.0,19908117.0,0.9529810192850322,0.9377961772136201\nSPY,20170329,1436700.0,1444900.0,1432000.0,1441200.0,27980524.0,,\nQQQ,20170329,1317300.0,1323000.0,1315900.0,1322500.0,11704446.0,0.9549791674272183,0.9404841043377677\nSPY,20170330,1441400.0,1445000.0,1410400.0,1439300.0,19039911.0,,\nQQQ,20170330,1322000.0,1326100.0,1320900.0,1324700.0,14980189.0,0.9569082494331851,0.9427704733715314\nSPY,20170331,1436300.0,1442700.0,1430100.0,1436600.0,18766711.0,,\nQQQ,20170331,1322800.0,1327400.0,1321300.0,1323800.0,17964005.0,0.958559975385759,0.9451762702854233\nSPY,20170403,1436700.0,1441200.0,1430500.0,1437000.0,19044722.0,,\nQQQ,20170403,1324900.0,1328100.0,1315600.0,1323000.0,23062647.0,0.960580310533794,0.9482927504175879\nSPY,20170404,1432500.0,1449000.0,1405500.0,1447700.0,19491173.0,,\nQQQ,20170404,1319200.0,1325300.0,1318700.0,1325100.0,12560176.0,0.9626671026464757,0.9509581807904892\nSPY,20170405,1446400.0,1454600.0,1438100.0,1440200.0,26332914.0,,\nQQQ,20170405,1327000.0,1334800.0,1317200.0,1319700.0,30289939.0,0.9641796491363407,0.9531425664076683\nSPY,20170406,1442600.0,1445200.0,1434600.0,1436600.0,20140741.0,,\nQQQ,20170406,1321000.0,1323900.0,1317000.0,1320400.0,18389289.0,0.9657741940999119,0.9550478026615601\nSPY,20170407,1437300.0,1441700.0,1432700.0,1433400.0,16247556.0,,\nQQQ,20170407,1320000.0,1323700.0,1315000.0,1319700.0,15775514.0,0.967404655537674,0.9569050476181719\nSPY,20170410,1435000.0,1438800.0,1429000.0,1431700.0,16692110.0,,\nQQQ,20170410,1321000.0,1325600.0,1316600.0,1320200.0,14505106.0,0.9692770590606105,0.9590541899203046\nSPY,20170411,1429000.0,1433500.0,1400600.0,1416300.0,30318420.0,,\nQQQ,20170411,1319000.0,1321000.0,1305000.0,1314500.0,33039379.0,0.9710571529188313,0.9616247620807061\nSPY,20170412,1416000.0,1421500.0,1410200.0,1418000.0,19833656.0,,\nQQQ,20170412,1314300.0,1315400.0,1307800.0,1309200.0,15255090.0,0.9725182185142957,0.9641822114252362\nSPY,20170413,1419400.0,1423800.0,1360500.0,1410500.0,17095815.0,,\nQQQ,20170413,1307400.0,1315100.0,1303800.0,1304000.0,22113044.0,0.9739298868812093,0.9665851864800805\nSPY,20170417,1411700.0,1418700.0,1408700.0,1418300.0,15526720.0,,\nQQQ,20170417,1307700.0,1315000.0,1307300.0,1314800.0,12457358.0,0.9750846924531145,0.9681653669474338\nSPY,20170418,1414100.0,1420400.0,1411100.0,1412000.0,14069604.0,,\nQQQ,20170418,1310400.0,1316600.0,1309500.0,1312800.0,12162470.0,0.9756955801401627,0.9686541038893549\nSPY,20170419,1418200.0,1420000.0,1404500.0,1406800.0,15918460.0,,\nQQQ,20170419,1318500.0,1322900.0,1313100.0,1314900.0,17440534.0,0.9764076293704818,0.9691437722065598\nSPY,20170420,1412100.0,1429300.0,1411600.0,1424400.0,22702707.0,,\nQQQ,20170420,1320200.0,1328800.0,1318300.0,1325900.0,20502778.0,0.977164839656132,0.9696953052039629\nSPY,20170421,1424400.0,1426800.0,1418500.0,1422700.0,16870411.0,,\nQQQ,20170421,1327100.0,1327500.0,1322200.0,1325600.0,19906888.0,0.9777604561064273,0.9700170015409935\nSPY,20170424,1435200.0,1439500.0,1431800.0,1436400.0,16301965.0,,\nQQQ,20170424,1340300.0,1342900.0,1338100.0,1341600.0,21177216.0,0.9787669157139962,0.9704764929273869\nSPY,20170425,1440500.0,1449000.0,1438900.0,1445300.0,17242559.0,,\nQQQ,20170425,1346000.0,1353600.0,1344800.0,1351300.0,18911331.0,0.9796696205903674,0.9708686774325753\nSPY,20170426,1444500.0,1446000.0,1433800.0,1436800.0,19393674.0,,\nQQQ,20170426,1351800.0,1355100.0,1348600.0,1349400.0,22603210.0,0.9805620987277053,0.9712642363742326\nSPY,20170427,1438900.0,1441600.0,1433100.0,1437900.0,13764732.0,,\nQQQ,20170427,1352700.0,1357500.0,1351900.0,1357500.0,13877278.0,0.9808016331543004,0.9713898403983608\nSPY,20170428,1440700.0,1443000.0,1432600.0,1436500.0,18982479.0,,\nQQQ,20170428,1362900.0,1363400.0,1357700.0,1359900.0,17610230.0,0.9809321043266521,0.9713609702196807\nSPY,20170501,1450000.0,1472000.0,1449600.0,1465800.0,31477137.0,,\nQQQ,20170501,1364400.0,1373800.0,1363800.0,1372000.0,21055619.0,0.9811292078108919,0.9714187105770412\nSPY,20170502,1475400.0,1488700.0,1468400.0,1475100.0,39806717.0,,\nQQQ,20170502,1373700.0,1374900.0,1370200.0,1374300.0,17229212.0,0.9812727427292246,0.9714884489307362\nSPY,20170503,1455200.0,1474900.0,1442700.0,1470600.0,45086464.0,,\nQQQ,20170503,1371200.0,1371700.0,1366200.0,1369900.0,21209026.0,0.9816126129619088,0.9715536880358057\nSPY,20170504,1465200.0,1471400.0,1445900.0,1465300.0,22910014.0,,\nQQQ,20170504,1369700.0,1372300.0,1365600.0,1370400.0,13988193.0,0.9819253285222365,0.9716121782679371\nSPY,20170505,1467600.0,1489800.0,1467600.0,1489600.0,26354726.0,,\nQQQ,20170505,1373900.0,1375400.0,1368800.0,1375400.0,13539327.0,0.9822351700575239,0.97164742238217\nSPY,20170508,1490300.0,1537000.0,1490300.0,1530100.0,46461213.0,,\nQQQ,20170508,1376100.0,1378400.0,1373300.0,1378400.0,12757417.0,0.9824791760088634,0.9716781672477776\nSPY,20170509,1538800.0,1548800.0,1534500.0,1539900.0,34859133.0,,\nQQQ,20170509,1380500.0,1386300.0,1379300.0,1383200.0,24217378.0,0.9827114674819488,0.9717104118629268\nSPY,20170510,1536300.0,1539400.0,1521100.0,1532600.0,25145451.0,,\nQQQ,20170510,1384000.0,1384500.0,1379100.0,1384000.0,18306881.0,0.9829019847849777,0.9717779005923092\nSPY,20170511,1526900.0,1540700.0,1465300.0,1539500.0,25282995.0,,\nQQQ,20170511,1380200.0,1383200.0,1373900.0,1382900.0,24357025.0,0.9830737364548982,0.9718153943308548\nSPY,20170512,1550000.0,1564200.0,1399100.0,1561000.0,31507288.0,,\nQQQ,20170512,1383500.0,1386300.0,1382300.0,1386000.0,17094601.0,0.9831649960285236,0.9718386404487533\nSPY,20170515,1560100.0,1566500.0,1550500.0,1557000.0,23703680.0,,\nQQQ,20170515,1386600.0,1391200.0,1385300.0,1390400.0,18227851.0,0.9833103245827582,0.9718498885703172\nSPY,20170516,1560000.0,1560600.0,1547200.0,1554700.0,19246902.0,,\nQQQ,20170516,1394000.0,1396400.0,1389900.0,1396200.0,18530508.0,0.9835372688381887,0.9718738845629863\nSPY,20170517,1539400.0,1545700.0,1497100.0,1502500.0,48923443.0,,\nQQQ,20170517,1385100.0,1387700.0,1360500.0,1360700.0,51256217.0,0.983728509335831,0.9718648860657353\nSPY,20170518,1512500.0,1533400.0,1465300.0,1525400.0,32228764.0,,\nQQQ,20170518,1360200.0,1377200.0,1358700.0,1372600.0,38424762.0,0.9839887453039575,0.9718618865666517\nSPY,20170519,1534300.0,1539800.0,1526300.0,1530600.0,25761484.0,,\nQQQ,20170519,1377500.0,1384200.0,1376600.0,1378400.0,33965774.0,0.9843215231185773,0.9718616938232659\nSPY,20170522,1540600.0,1545800.0,1529100.0,1539900.0,21770285.0,,\nQQQ,20170522,1381500.0,1390800.0,1381000.0,1390000.0,18766106.0,0.9846087816732735,0.9718712494547675\nSPY,20170523,1549000.0,1549000.0,1512500.0,1538000.0,19015403.0,,\nQQQ,20170523,1394100.0,1394200.0,1387900.0,1391400.0,17140392.0,0.9850076016741919,0.9719117427075796\nSPY,20170524,1538400.0,1541700.0,1526800.0,1533400.0,18678731.0,,\nQQQ,20170524,1395600.0,1398500.0,1391700.0,1397800.0,15071337.0,0.9852090298059548,0.9720111011519789\nSPY,20170525,1537300.0,1543500.0,1530300.0,1538700.0,18840307.0,,\nQQQ,20170525,1403100.0,1413300.0,1400100.0,1409700.0,22391583.0,0.9853692708402385,0.9721663252877576\nSPY,20170526,1538000.0,1542400.0,1533100.0,1536100.0,21091115.0,,\nQQQ,20170526,1410000.0,1412800.0,1408100.0,1412200.0,11601987.0,0.9854972420362137,0.9723492948004628\nSPY,20170530,1533500.0,1544300.0,1532900.0,1536700.0,19183398.0,,\nQQQ,20170530,1411500.0,1415100.0,1410600.0,1413400.0,19387675.0,0.9855633679398264,0.9724985199358249\nSPY,20170531,1540000.0,1541800.0,1523800.0,1527600.0,22111096.0,,\nQQQ,20170531,1418400.0,1418400.0,1405700.0,1412900.0,28836181.0,0.9855379001789278,0.9725555104397824\nSPY,20170601,1531500.0,1533300.0,1522200.0,1531800.0,15551577.0,,\nQQQ,20170601,1415800.0,1418900.0,1409800.0,1418400.0,18935148.0,0.9854468625707113,0.9725753821286621\nSPY,20170602,1536000.0,1554500.0,1529000.0,1554500.0,27057234.0,,\nQQQ,20170602,1423400.0,1434900.0,1421000.0,1434600.0,34757896.0,0.9853269762156154,0.9726424959458225\nSPY,20170605,1544100.0,1544500.0,1534600.0,1539300.0,23453532.0,,\nQQQ,20170605,1434500.0,1436800.0,1432300.0,1434300.0,14470464.0,0.9850670390565681,0.972660118009546\nSPY,20170606,1538900.0,1558100.0,1537800.0,1544500.0,25151726.0,,\nQQQ,20170606,1432600.0,1437300.0,1426500.0,1428600.0,21570129.0,0.9849703039708952,0.9727032358250401\nSPY,20170607,1550000.0,1559800.0,1544800.0,1553700.0,20465650.0,,\nQQQ,20170607,1432600.0,1435400.0,1426000.0,1434200.0,18012338.0,0.9848911072242861,0.972754227328581\nSPY,20170608,1552500.0,1555500.0,1544000.0,1549900.0,19322103.0,,\nQQQ,20170608,1437400.0,1438000.0,1427900.0,1435700.0,22741112.0,0.9847584897001441,0.9727872218308722\nSPY,20170609,1551500.0,1552000.0,1460200.0,1489800.0,63505882.0,,\nQQQ,20170609,1437400.0,1439000.0,1381100.0,1399800.0,102590425.0,0.984638897984291,0.972743729077852\nSPY,20170612,1455700.0,1460900.0,1425100.0,1454200.0,70436329.0,,\nQQQ,20170612,1388000.0,1394800.0,1374700.0,1392300.0,100249191.0,0.9843525587617395,0.9726529941965515\nSPY,20170613,1471500.0,1474500.0,1451500.0,1465900.0,32807595.0,,\nQQQ,20170613,1400100.0,1405500.0,1392800.0,1403600.0,48814127.0,0.9839844463659618,0.9725444600768766\nSPY,20170614,1474800.0,1475000.0,1438400.0,1451600.0,30707499.0,,\nQQQ,20170614,1409300.0,1409300.0,1386300.0,1397500.0,58252735.0,0.9835867785750125,0.972418481115363\nSPY,20170615,1432000.0,1444700.0,1422100.0,1442900.0,30816994.0,,\nQQQ,20170615,1383400.0,1392800.0,1374900.0,1391300.0,51345482.0,0.9832257478063122,0.9722610074134711\nSPY,20170616,1437500.0,1445000.0,1422000.0,1422700.0,48151518.0,,\nQQQ,20170616,1386800.0,1387100.0,1376400.0,1381500.0,43343677.0,0.9828283850427911,0.9720212297100028\nSPY,20170619,1440000.0,1467400.0,1437100.0,1463400.0,30570369.0,,\nQQQ,20170619,1394900.0,1405900.0,1392900.0,1404600.0,34467257.0,0.9824543269254112,0.9717805198634137\nSPY,20170620,1468700.0,1468700.0,1449400.0,1450100.0,23346143.0,,\nQQQ,20170620,1403200.0,1405000.0,1393200.0,1393600.0,37878867.0,0.982076570091338,0.9715653057638155\nSPY,20170621,1455000.0,1460700.0,1446000.0,1458700.0,19922042.0,,\nQQQ,20170621,1396800.0,1408100.0,1395900.0,1407400.0,32847639.0,0.9815469325501099,0.9712991001702356\nSPY,20170622,1457500.0,1467000.0,1450500.0,1456300.0,18178190.0,,\nQQQ,20170622,1409600.0,1412200.0,1403400.0,1407000.0,24061597.0,0.9810011496017258,0.9710156474536916\nSPY,20170623,1451600.0,1471600.0,1451100.0,1462800.0,25911469.0,,\nQQQ,20170623,1405400.0,1414200.0,1401500.0,1412400.0,19652211.0,0.9803864867388429,0.9706849526177233\nSPY,20170626,1472300.0,1482900.0,1453800.0,1458200.0,24516590.0,,\nQQQ,20170626,1420500.0,1422900.0,1402800.0,1405800.0,32858257.0,0.9800532595866435,0.9703655059054277\nSPY,20170627,1450000.0,1461600.0,1436200.0,1437300.0,24140221.0,,\nQQQ,20170627,1400500.0,1402200.0,1380200.0,1380300.0,58836648.0,0.9801564056181835,0.9701382938072454\nSPY,20170628,1439500.0,1498700.0,1431600.0,1458300.0,21398579.0,,\nQQQ,20170628,1385400.0,1401400.0,1377400.0,1400200.0,52499260.0,0.9799280091268022,0.9698015999719852\nSPY,20170629,1447300.0,1451200.0,1422800.0,1436800.0,30271952.0,,\nQQQ,20170629,1394400.0,1394400.0,1362500.0,1375900.0,84967360.0,0.979711465648515,0.9695816934514192\nSPY,20170630,1447200.0,1449600.0,1437800.0,1440200.0,21052499.0,,\nQQQ,20170630,1379800.0,1383300.0,1371900.0,1376400.0,55840647.0,0.9794851545857487,0.9694189648318757\nSPY,20170703,1449300.0,1453100.0,1431100.0,1435000.0,13452690.0,,\nQQQ,20170703,1382700.0,1385000.0,1361000.0,1361900.0,30112069.0,0.9793358735695412,0.9692682399181536\nSPY,20170705,1437500.0,1447900.0,1427200.0,1440900.0,19987760.0,,\nQQQ,20170705,1366200.0,1379000.0,1361500.0,1375300.0,37563894.0,0.9790937009504982,0.9691073916893306\nSPY,20170706,1430200.0,1435000.0,1424100.0,1427300.0,22077641.0,,\nQQQ,20170706,1364800.0,1370600.0,1358000.0,1362900.0,47088492.0,0.9788649486261262,0.9689127990768381\nSPY,20170707,1429400.0,1447500.0,1429000.0,1441800.0,18194883.0,,\nQQQ,20170707,1367500.0,1381300.0,1367400.0,1377600.0,34879095.0,0.9785796745628005,0.9687512009728225\nSPY,20170710,1441900.0,1459500.0,1433700.0,1450600.0,19471988.0,,\nQQQ,20170710,1378500.0,1389900.0,1375000.0,1386600.0,22738627.0,0.9782677787146876,0.9685108659735786\nSPY,20170711,1447200.0,1458500.0,1443800.0,1455300.0,17490648.0,,\nQQQ,20170711,1384600.0,1392200.0,1379400.0,1390500.0,26219948.0,0.9779691935123256,0.9682019173942078\nSPY,20170712,1459000.0,1461800.0,1448200.0,1457400.0,23118912.0,,\nQQQ,20170712,1402400.0,1408600.0,1399600.0,1407000.0,32649785.0,0.9774382809286406,0.9678132885418687\nSPY,20170713,1455800.0,1484900.0,1454000.0,1477700.0,24473757.0,,\nQQQ,20170713,1408700.0,1413500.0,1406000.0,1410100.0,29645544.0,0.9770839810122302,0.9675080892812455\nSPY,20170714,1480000.0,1493300.0,1473300.0,1490400.0,18825091.0,,\nQQQ,20170714,1416400.0,1423000.0,1412000.0,1421200.0,30623353.0,0.9766934806192118,0.9672190123402863\nSPY,20170717,1489100.0,1509000.0,1485700.0,1495600.0,22561123.0,,\nQQQ,20170717,1422700.0,1426900.0,1419200.0,1421900.0,23034590.0,0.9763445871743761,0.96691418801733\nSPY,20170718,1492000.0,1501300.0,1486700.0,1500800.0,17268849.0,,\nQQQ,20170718,1420900.0,1431700.0,1416500.0,1431400.0,23121659.0,0.975920421883396,0.9665831180577102\nSPY,20170719,1505500.0,1514200.0,1499500.0,1510200.0,19642010.0,,\nQQQ,20170719,1435600.0,1441900.0,1435000.0,1439800.0,30756253.0,0.9754328060763557,0.9662228029600948\nSPY,20170720,1516400.0,1517700.0,1501900.0,1503400.0,16459695.0,,\nQQQ,20170720,1443500.0,1444400.0,1435200.0,1441700.0,32319253.0,0.9749377613277167,0.9658422412284824\nSPY,20170721,1498900.0,1504500.0,1488800.0,1502700.0,24292496.0,,\nQQQ,20170721,1436400.0,1441100.0,1433500.0,1441100.0,29346464.0,0.9744627646265747,0.9654421827382059\nSPY,20170724,1505600.0,1524400.0,1499000.0,1520900.0,20749699.0,,\nQQQ,20170724,1440900.0,1448700.0,1439200.0,1447700.0,21625264.0,0.9742313731156007,0.9650366942060392\nSPY,20170725,1522400.0,1538400.0,1522000.0,1527400.0,18230976.0,,\nQQQ,20170725,1442900.0,1447400.0,1440100.0,1444000.0,25884573.0,0.9742774349540374,0.9646632563601005\nSPY,20170726,1534000.0,1539300.0,1530500.0,1534600.0,14226366.0,,\nQQQ,20170726,1447600.0,1449500.0,1445300.0,1448700.0,16848394.0,0.97444557133242,0.964418797047297\nSPY,20170727,1539700.0,1539900.0,1473000.0,1505600.0,31881954.0,,\nQQQ,20170727,1458200.0,1459600.0,1423000.0,1439600.0,74666110.0,0.9741153484055494,0.964005615816148\nSPY,20170728,1497200.0,1502300.0,1491900.0,1495000.0,16372471.0,,\nQQQ,20170728,1431000.0,1440700.0,1428700.0,1438400.0,33509998.0,0.9736716154775293,0.9635339443199722\nSPY,20170731,1499500.0,1503300.0,1437400.0,1487300.0,18913565.0,,\nQQQ,20170731,1442500.0,1444300.0,1429200.0,1432300.0,31606853.0,0.9732910390730843,0.9631125144617039\nSPY,20170801,1492700.0,1502300.0,1484000.0,1500500.0,24289768.0,,\nQQQ,20170801,1437200.0,1437600.0,1431200.0,1435600.0,17002233.0,0.9730115034059746,0.962801510698889\nSPY,20170802,1595000.0,1597500.0,1420400.0,1571400.0,64949846.0,,\nQQQ,20170802,1444900.0,1445200.0,1426100.0,1439500.0,39489761.0,0.9731832646618389,0.9627220239433695\nSPY,20170803,1570300.0,1572100.0,1550200.0,1555700.0,25511481.0,,\nQQQ,20170803,1440900.0,1441400.0,1431300.0,1433900.0,25521874.0,0.9733015583964314,0.9626035436851424\nSPY,20170804,1561200.0,1574000.0,1556900.0,1563900.0,20052407.0,,\nQQQ,20170804,1437100.0,1439700.0,1430600.0,1436500.0,26533912.0,0.973458414562959,0.9625862965589449\nSPY,20170807,1570000.0,1589200.0,1566800.0,1588100.0,20592672.0,,\nQQQ,20170807,1439100.0,1445600.0,1437100.0,1445600.0,16741235.0,0.9737032060911122,0.9628969531657952\nSPY,20170808,1585700.0,1618300.0,1559800.0,1600800.0,35541907.0,,\nQQQ,20170808,1442800.0,1454700.0,1439000.0,1443100.0,28774682.0,0.9739021014421216,0.963229897501664\nSPY,20170809,1591200.0,1612700.0,1591000.0,1610600.0,25340482.0,,\nQQQ,20170809,1431200.0,1441900.0,1427900.0,1441200.0,33748470.0,0.974073494037515,0.9636179576228625\nSPY,20170810,1599400.0,1600800.0,1546300.0,1553200.0,38455016.0,,\nQQQ,20170810,1433000.0,1434000.0,1408900.0,1410300.0,58083013.0,0.9741413955881681,0.9634919786849662\nSPY,20170811,1565000.0,1585700.0,1560700.0,1574800.0,25298131.0,,\nQQQ,20170811,1412200.0,1424000.0,1409000.0,1421000.0,41971258.0,0.9742758650350547,0.9637351323322937\nSPY,20170814,1593800.0,1602100.0,1587500.0,1598500.0,21053730.0,,\nQQQ,20170814,1432300.0,1441500.0,1431900.0,1439300.0,32387080.0,0.9744773417309811,0.9641929307082906\nSPY,20170815,1606300.0,1622000.0,1601400.0,1616000.0,27411433.0,,\nQQQ,20170815,1442900.0,1443000.0,1436400.0,1440300.0,23753863.0,0.974638152704108,0.9648168262837686\nSPY,20170816,1618700.0,1625100.0,1601500.0,1609500.0,26915110.0,,\nQQQ,20170816,1443900.0,1449700.0,1438100.0,1442800.0,30514187.0,0.974783722195902,0.9652315068766046\nSPY,20170817,1606300.0,1607100.0,1578400.0,1578600.0,26717471.0,,\nQQQ,20170817,1437200.0,1439400.0,1413300.0,1413300.0,67323077.0,0.9747835495254129,0.9653374331463755\nSPY,20170818,1578600.0,1595000.0,1567300.0,1575000.0,26528434.0,,\nQQQ,20170818,1414100.0,1422000.0,1406600.0,1412300.0,56332272.0,0.9747917369678614,0.965379995005838\nSPY,20170821,1574200.0,1578900.0,1551200.0,1572100.0,24666267.0,,\nQQQ,20170821,1412200.0,1415200.0,1401800.0,1410500.0,35123426.0,0.9747810002735028,0.9653466256035552\nSPY,20170822,1582600.0,1600000.0,1580200.0,1597800.0,20317719.0,,\nQQQ,20170822,1418100.0,1433500.0,1417600.0,1432000.0,34619678.0,0.9749042064706106,0.9655704630548227\nSPY,20170823,1590700.0,1604700.0,1497100.0,1599800.0,18213450.0,,\nQQQ,20170823,1424800.0,1430100.0,1423800.0,1426900.0,22597420.0,0.9749785645900946,0.9657823025187527\nSPY,20170824,1604300.0,1607400.0,1585500.0,1592700.0,18873650.0,,\nQQQ,20170824,1430100.0,1431700.0,1414700.0,1422700.0,34827777.0,0.974998315022425,0.9656000830860624\nSPY,20170825,1596500.0,1605600.0,1592700.0,1598600.0,24813251.0,,\nQQQ,20170825,1428200.0,1431800.0,1417800.0,1419700.0,24297121.0,0.9749540652897862,0.9652712632455906\nSPY,20170828,1601400.0,1620000.0,1599300.0,1614700.0,23327700.0,,\nQQQ,20170828,1424000.0,1427400.0,1419600.0,1424100.0,13775472.0,0.974913946517985,0.9649591346753374\nSPY,20170829,1600700.0,1631200.0,1600000.0,1629100.0,28847350.0,,\nQQQ,20170829,1411900.0,1432100.0,1410600.0,1429700.0,22758846.0,0.9748842073364531,0.96472104965874\nSPY,20170830,1638000.0,1638900.0,1626100.0,1633500.0,25997624.0,,\nQQQ,20170830,1430900.0,1448900.0,1430000.0,1446500.0,32434308.0,0.9750301722690716,0.9648260320282633\nSPY,20170831,1636400.0,1645200.0,1592900.0,1640000.0,25651230.0,,\nQQQ,20170831,1450600.0,1462100.0,1449800.0,1462000.0,34597547.0,0.9752448992425705,0.9649812559603441\nSPY,20170901,1648000.0,1649400.0,1636300.0,1640500.0,16185567.0,,\nQQQ,20170901,1463900.0,1465800.0,1456100.0,1460000.0,19670085.0,0.9754455897407063,0.965132730522085\nSPY,20170905,1636900.0,1642500.0,1605600.0,1620800.0,28621329.0,,\nQQQ,20170905,1455700.0,1458800.0,1436000.0,1446900.0,44535041.0,0.9755883770466156,0.9654686741045596\nSPY,20170906,1627200.0,1629900.0,1605200.0,1619100.0,20038564.0,,\nQQQ,20170906,1451100.0,1454600.0,1440800.0,1451300.0,29368747.0,0.9758392806452669,0.96626673390543\nSPY,20170907,1620900.0,1622200.0,1603600.0,1612600.0,21420148.0,,\nQQQ,20170907,1454000.0,1458400.0,1449300.0,1454700.0,21870139.0,0.9760624558954852,0.9670342298701712\nSPY,20170908,1608600.0,1611500.0,1585300.0,1586300.0,25060001.0,,\nQQQ,20170908,1452800.0,1453500.0,1440600.0,1442100.0,25232399.0,0.9763345629811481,0.9672528181200216\nSPY,20170911,1606000.0,1620500.0,1598900.0,1615000.0,29226472.0,,\nQQQ,20170911,1453400.0,1461200.0,1453200.0,1458700.0,26018868.0,0.9764005072794186,0.9672213234150688\nSPY,20170912,1627300.0,1639600.0,1587800.0,1608600.0,70363567.0,,\nQQQ,20170912,1462800.0,1464100.0,1455300.0,1462200.0,27088720.0,0.976570301449597,0.9671988271972456\nSPY,20170913,1599200.0,1599600.0,1579100.0,1596500.0,43411017.0,,\nQQQ,20170913,1459700.0,1464400.0,1457300.0,1464200.0,22866601.0,0.9765085030250297,0.9669986108586175\nSPY,20170914,1590000.0,1594000.0,1580900.0,1582800.0,22096926.0,,\nQQQ,20170914,1458500.0,1462900.0,1454700.0,1455600.0,27843552.0,0.9764754682700318,0.9670068594718194\nSPY,20170915,1583000.0,1609700.0,1580000.0,1598800.0,44620658.0,,\nQQQ,20170915,1455300.0,1465900.0,1452900.0,1460600.0,38902729.0,0.9765499854594533,0.9675265221035394\nSPY,20170918,1601100.0,1605000.0,1580000.0,1586700.0,26043729.0,,\nQQQ,20170918,1459100.0,1463700.0,1451100.0,1455500.0,23954582.0,0.9765840168961508,0.9679070831217184\nSPY,20170919,1594500.0,1597700.0,1584400.0,1587300.0,19626195.0,,\nQQQ,20170919,1458100.0,1460100.0,1453100.0,1458000.0,18389221.0,0.9765757745460133,0.9681361696065531\nSPY,20170920,1580100.0,1582600.0,1538300.0,1560700.0,50472434.0,,\nQQQ,20170920,1457500.0,1459100.0,1442400.0,1453500.0,32303679.0,0.976438174350337,0.9681213655728103\nSPY,20170921,1556700.0,1558300.0,1527500.0,1533900.0,35666895.0,,\nQQQ,20170921,1452500.0,1452500.0,1439500.0,1444600.0,27084994.0,0.97618911058704,0.9676885069868449\nSPY,20170922,1520100.0,1522700.0,1495000.0,1518900.0,45239765.0,,\nQQQ,20170922,1440000.0,1445300.0,1438600.0,1443200.0,20342334.0,0.9758465671722417,0.9667710365806081\nSPY,20170925,1500000.0,1518300.0,1491600.0,1505500.0,42667717.0,,\nQQQ,20170925,1437500.0,1438300.0,1421000.0,1428000.0,51391091.0,0.9755748107702182,0.9663803524108907\nSPY,20170926,1519100.0,1539200.0,1516900.0,1531400.0,35492487.0,,\nQQQ,20170926,1435300.0,1438000.0,1426700.0,1431700.0,27820070.0,0.9754134813740369,0.9658261957862817\nSPY,20170927,1539000.0,1547200.0,1535400.0,1542300.0,23962434.0,,\nQQQ,20170927,1439300.0,1450000.0,1435700.0,1444600.0,30416002.0,0.9752367585643222,0.9655575470955075\nSPY,20170928,1540000.0,1542800.0,1527000.0,1532800.0,21390619.0,,\nQQQ,20170928,1441100.0,1445500.0,1437900.0,1444100.0,23139707.0,0.9749928668848815,0.9648596086560094\nSPY,20170929,1532300.0,1541300.0,1517500.0,1541200.0,25174786.0,,\nQQQ,20170929,1447000.0,1455600.0,1443200.0,1454500.0,40386063.0,0.9746699282687499,0.964338640625712\nSPY,20171002,1542000.0,1544500.0,1527200.0,1538100.0,18229406.0,,\nQQQ,20171002,1456700.0,1461700.0,1449200.0,1455800.0,26083175.0,0.9743319951897388,0.963545468759031\nSPY,20171003,1540000.0,1550900.0,1539100.0,1544800.0,15858806.0,,\nQQQ,20171003,1457700.0,1460600.0,1454500.0,1458900.0,18520352.0,0.9740169348521145,0.9629748151281629\nSPY,20171004,1537000.0,1538600.0,1524600.0,1534800.0,19486252.0,,\nQQQ,20171004,1456100.0,1463400.0,1454700.0,1460300.0,24676565.0,0.9735589832610523,0.9618432562201734\nSPY,20171005,1541400.0,1554400.0,1540500.0,1553900.0,20286192.0,,\nQQQ,20171005,1465600.0,1475400.0,1464100.0,1474600.0,29588461.0,0.9731044106694595,0.9611848674055844\nSPY,20171006,1549700.0,1555000.0,1545600.0,1553000.0,15995936.0,,\nQQQ,20171006,1469600.0,1476600.0,1469600.0,1476600.0,21384976.0,0.9725925313403301,0.9603652558174912\nSPY,20171009,1559200.0,1567200.0,1554900.0,1558400.0,15526608.0,,\nQQQ,20171009,1478500.0,1480100.0,1473100.0,1474900.0,13194621.0,0.9721664705710776,0.9597972267434012\nSPY,20171010,1559800.0,1580000.0,1551000.0,1559000.0,15002617.0,,\nQQQ,20171010,1479900.0,1481400.0,1469500.0,1476000.0,18721458.0,0.9717559766613023,0.9591932037477845\nSPY,20171011,1559700.0,1569700.0,1557500.0,1565500.0,15963488.0,,\nQQQ,20171011,1475300.0,1480700.0,1473400.0,1480400.0,11429786.0,0.9713901423727855,0.9588167673184864\nSPY,20171012,1563500.0,1573700.0,1557200.0,1560000.0,15912676.0,,\nQQQ,20171012,1478200.0,1483600.0,1476200.0,1477700.0,13958082.0,0.9710746452173071,0.9584879478478745\nSPY,20171013,1566800.0,1572800.0,1564100.0,1569900.0,15745079.0,,\nQQQ,20171013,1483700.0,1485100.0,1481900.0,1483400.0,17149441.0,0.9707924880847385,0.9582299914102679\nSPY,20171016,1578000.0,1600000.0,1576500.0,1598800.0,23166564.0,,\nQQQ,20171016,1487100.0,1488900.0,1484000.0,1488500.0,20856843.0,0.9707644745919954,0.9584611320879325\nSPY,20171017,1598600.0,1608700.0,1592300.0,1604700.0,18280484.0,,\nQQQ,20171017,1488000.0,1490600.0,1485700.0,1490400.0,12221763.0,0.9707912268476896,0.9588578151724547\nSPY,20171018,1604200.0,1607100.0,1596000.0,1597600.0,15752452.0,,\nQQQ,20171018,1491900.0,1492100.0,1486400.0,1488600.0,16268748.0,0.9706766366253106,0.9587449592098449\nSPY,20171019,1567500.0,1570800.0,1550200.0,1559800.0,39062104.0,,\nQQQ,20171019,1479900.0,1483300.0,1472700.0,1483100.0,25560329.0,0.970226606750445,0.9580730725487258\nSPY,20171020,1570500.0,1577500.0,1559600.0,1562500.0,22673927.0,,\nQQQ,20171020,1489100.0,1490500.0,1485300.0,1487100.0,23514523.0,0.9697456602619653,0.9574758062732828\nSPY,20171023,1569000.0,1576900.0,1555000.0,1561700.0,20606089.0,,\nQQQ,20171023,1490200.0,1490300.0,1475400.0,1477400.0,25842803.0,0.9693683594676051,0.9566989374670024\nSPY,20171024,1562600.0,1574200.0,1561800.0,1571000.0,16523775.0,,\nQQQ,20171024,1480300.0,1483000.0,1474400.0,1479900.0,19394812.0,0.9690499413306358,0.955816336516238\nSPY,20171025,1569100.0,1575500.0,1552600.0,1564100.0,19331068.0,,\nQQQ,20171025,1477000.0,1481800.0,1463300.0,1474300.0,32891839.0,0.9687666904906909,0.9548902429102956\nSPY,20171026,1573800.0,1578300.0,1559400.0,1574100.0,15131211.0,,\nQQQ,20171026,1473400.0,1477100.0,1469200.0,1469600.0,24484471.0,0.9685380676747222,0.9539626495576231\nSPY,20171027,1592700.0,1636000.0,1587000.0,1630500.0,42169463.0,,\nQQQ,20171027,1494300.0,1515200.0,1492100.0,1512400.0,56067103.0,0.9683039429401495,0.9539716480380047\nSPY,20171030,1640000.0,1680700.0,1637200.0,1667200.0,43201736.0,,\nQQQ,20171030,1511300.0,1521900.0,1509900.0,1515800.0,28902993.0,0.9682784400189356,0.9540815044859969\nSPY,20171031,1679200.0,1696400.0,1669400.0,1690400.0,33873828.0,,\nQQQ,20171031,1520700.0,1523700.0,1516300.0,1521500.0,24287932.0,0.9683166968420076,0.9541808627068774\nSPY,20171101,1698800.0,1699400.0,1656200.0,1668900.0,32331945.0,,\nQQQ,20171101,1527600.0,1528300.0,1515000.0,1521000.0,26423581.0,0.9681975554761765,0.9542745968775194\nSPY,20171102,1675800.0,1684900.0,1652800.0,1681100.0,32121248.0,,\nQQQ,20171102,1519300.0,1520000.0,1507700.0,1518100.0,28505858.0,0.9681500478480501,0.9544125735767044\nSPY,20171103,1741000.0,1742600.0,1711200.0,1725000.0,55026231.0,,\nQQQ,20171103,1523600.0,1533000.0,1518400.0,1532700.0,23695997.0,0.9681489343242032,0.9544350697776582\nSPY,20171106,1722100.0,1749900.0,1717300.0,1742500.0,32878022.0,,\nQQQ,20171106,1531500.0,1538500.0,1531000.0,1537900.0,27154642.0,0.9681266044362851,0.9544470677515005\nSPY,20171107,1740000.0,1752500.0,1736000.0,1748100.0,23670840.0,,\nQQQ,20171107,1536700.0,1540800.0,1533400.0,1538800.0,20668666.0,0.9681465250972736,0.9544628150921685\nSPY,20171108,1747300.0,1762400.0,1743400.0,1762400.0,22484325.0,,\nQQQ,20171108,1538000.0,1545400.0,1536200.0,1545000.0,15989852.0,0.9682123410156954,0.9544751880026933\nSPY,20171109,1751200.0,1761000.0,1731400.0,1758800.0,28588781.0,,\nQQQ,20171109,1532300.0,1537700.0,1521100.0,1536900.0,36619448.0,0.9682423006707567,0.9544763128127407\nSPY,20171110,1750700.0,1754000.0,1742700.0,1746700.0,21178623.0,,\nQQQ,20171110,1533300.0,1538200.0,1530600.0,1536800.0,18812296.0,0.9681897174327803,0.954483061673027\nSPY,20171113,1735000.0,1745000.0,1734000.0,1739700.0,16359711.0,,\nQQQ,20171113,1531000.0,1543000.0,1531000.0,1538700.0,11838812.0,0.9681302383145204,0.9544838115463921\nSPY,20171114,1730500.0,1734800.0,1711800.0,1713400.0,23361493.0,,\nQQQ,20171114,1533300.0,1535000.0,1525600.0,1533100.0,23486879.0,0.9679558430463954,0.954483061673027\nSPY,20171115,1698700.0,1703200.0,1683800.0,1690800.0,26995122.0,,\nQQQ,20171115,1526500.0,1530000.0,1517800.0,1525900.0,23184844.0,0.96782331801665,0.9544868110398527\nSPY,20171116,1711800.0,1718700.0,1703000.0,1711000.0,22206864.0,,\nQQQ,20171116,1533600.0,1548900.0,1533600.0,1545400.0,30813361.0,0.9676941226471983,0.9544624401554859\nSPY,20171117,1708900.0,1713900.0,1696500.0,1701500.0,21081018.0,,\nQQQ,20171117,1545800.0,1546900.0,1538000.0,1539500.0,26503931.0,0.9676129472195915,0.9544393900906296\nSPY,20171120,1702900.0,1705600.0,1695600.0,1699800.0,15874764.0,,\nQQQ,20171120,1540600.0,1541900.0,1536100.0,1538300.0,17318168.0,0.9674725290112532,0.9544176437671176\nSPY,20171121,1710000.0,1737000.0,1707200.0,1731400.0,24125988.0,,\nQQQ,20171121,1545600.0,1555700.0,1544900.0,1555000.0,19556391.0,0.9674904132468043,0.9544030212392386\nSPY,20171122,1733500.0,1750000.0,1730500.0,1749600.0,23431212.0,,\nQQQ,20171122,1556400.0,1558400.0,1553500.0,1556900.0,18645624.0,0.9676024883117565,0.9544056457955247\nSPY,20171124,1750400.0,1754900.0,1746500.0,1749700.0,13778416.0,,\nQQQ,20171124,1558500.0,1563100.0,1557700.0,1562600.0,7365109.0,0.9676710614780332,0.9543951475703808\nSPY,20171127,1749700.0,1751100.0,1733300.0,1740900.0,19671729.0,,\nQQQ,20171127,1562100.0,1565600.0,1558300.0,1561900.0,20884148.0,0.967716388607315,0.9543722764370316\nSPY,20171128,1741600.0,1748700.0,1718600.0,1730700.0,24565814.0,,\nQQQ,20171128,1565400.0,1566900.0,1557000.0,1565900.0,23291094.0,0.9676534679352298,0.9543276589801707\nSPY,20171129,1725600.0,1729200.0,1671600.0,1694800.0,40229053.0,,\nQQQ,20171129,1564100.0,1564300.0,1531200.0,1538600.0,69863394.0,0.967580416061097,0.954298788861025\nSPY,20171130,1704800.0,1721400.0,1684400.0,1718500.0,38817138.0,,\nQQQ,20171130,1545100.0,1554500.0,1541500.0,1551500.0,51088380.0,0.9674372720670493,0.9542455478620815\nSPY,20171201,1699600.0,1716700.0,1685000.0,1710500.0,37974115.0,,\nQQQ,20171201,1542000.0,1552400.0,1522600.0,1544900.0,54713571.0,0.9671145146143353,0.9541915569899134\nSPY,20171204,1724500.0,1726200.0,1696300.0,1698000.0,30414292.0,,\nQQQ,20171204,1554600.0,1556300.0,1525600.0,1527100.0,47860659.0,0.966769786814425,0.9541870577505659\nSPY,20171205,1691500.0,1715200.0,1684000.0,1696400.0,26590890.0,,\nQQQ,20171205,1526800.0,1545500.0,1521000.0,1528100.0,35003699.0,0.9664970500378615,0.954180308891545\nSPY,20171206,1675000.0,1702000.0,1664500.0,1690100.0,27017119.0,,\nQQQ,20171206,1522400.0,1537400.0,1520600.0,1535000.0,26735402.0,0.9661706769380659,0.9541548132019101\nSPY,20171207,1690000.0,1704400.0,1689100.0,1693200.0,24061242.0,,\nQQQ,20171207,1534900.0,1544600.0,1533300.0,1540200.0,29052610.0,0.965968511868211,0.954066328161412\nSPY,20171208,1702400.0,1710000.0,1688200.0,1693700.0,21584713.0,,\nQQQ,20171208,1551500.0,1555300.0,1544600.0,1547000.0,25372639.0,0.9656924138145085,0.9539474732553196\nSPY,20171211,1690500.0,1728900.0,1687900.0,1726700.0,29453279.0,,\nQQQ,20171211,1547700.0,1559500.0,1547600.0,1559000.0,19555803.0,0.9655937137789676,0.9538826092213953\nSPY,20171212,1721500.0,1723800.0,1714700.0,1717000.0,18096570.0,,\nQQQ,20171212,1558300.0,1561500.0,1553600.0,1556900.0,18878908.0,0.9654007932497878,0.9537988022272742\nSPY,20171213,1725000.0,1735400.0,1719200.0,1722700.0,22498974.0,,\nQQQ,20171213,1563200.0,1565000.0,1557600.0,1559900.0,23519388.0,0.9653287127641513,0.9537581389349853\nSPY,20171214,1724300.0,1731400.0,1716500.0,1722200.0,20158164.0,,\nQQQ,20171214,1562600.0,1566600.0,1557100.0,1558800.0,22166182.0,0.965220921913846,0.9536988989613507\nSPY,20171215,1736800.0,1743100.0,1724600.0,1739700.0,35341147.0,,\nQQQ,20171215,1564900.0,1578200.0,1562400.0,1576500.0,40839767.0,0.9651207417202321,0.9536434083531363\nSPY,20171218,1748900.0,1772000.0,1737400.0,1764200.0,26886594.0,,\nQQQ,20171218,1583600.0,1587700.0,1580700.0,1586400.0,22690586.0,0.9650356126359168,0.9536449080993044\nSPY,20171219,1746900.0,1753900.0,1740900.0,1745400.0,26280694.0,,\nQQQ,20171219,1583400.0,1585000.0,1572700.0,1577000.0,28335811.0,0.9648946525251177,0.9535957914123036\nSPY,20171220,1748700.0,1754200.0,1732500.0,1743500.0,22020474.0,,\nQQQ,20171220,1582500.0,1582800.0,1569100.0,1575300.0,32193822.0,0.9647785657924303,0.9535253033424091\nSPY,20171221,1741900.0,1760200.0,1741000.0,1750100.0,19239113.0,,\nQQQ,20171221,1577500.0,1582500.0,1573700.0,1575500.0,16384267.0,0.9646771049493373,0.9534866848785842\nSPY,20171222,1746800.0,1754200.0,1745000.0,1750100.0,15171228.0,,\nQQQ,20171222,1573100.0,1574300.0,1569500.0,1573700.0,20892107.0,0.9645575952525505,0.9534452456631718\nSPY,20171226,1706000.0,1714700.0,1696700.0,1705700.0,31831723.0,,\nQQQ,20171226,1564900.0,1567200.0,1559500.0,1565200.0,21303618.0,0.9641646073178584,0.9532551528007466\nSPY,20171227,1700000.0,1707700.0,1697100.0,1706000.0,20757571.0,,\nQQQ,20171227,1565300.0,1569600.0,1563900.0,1565400.0,22489654.0,0.9638113951832231,0.9530478128541563\nSPY,20171228,1710000.0,1718500.0,1704800.0,1710800.0,15557072.0,,\nQQQ,20171228,1570400.0,1570600.0,1565400.0,1567300.0,22681899.0,0.9633862371962473,0.9528329741753203\nSPY,20171229,1702800.0,1707100.0,1692200.0,1692300.0,24766173.0,,\nQQQ,20171229,1568700.0,1569000.0,1557000.0,1557600.0,30723064.0,0.9628512549241949,0.9525821415817057\nSPY,20180102,1701600.0,1723000.0,1692600.0,1722600.0,24586774.0,,\nQQQ,20180102,1565600.0,1585300.0,1561700.0,1584900.0,29229435.0,0.9622094778243565,0.9523530553116032\nSPY,20180103,1726100.0,1745500.0,1719600.0,1722300.0,27884172.0,,\nQQQ,20180103,1586400.0,1601700.0,1586100.0,1600300.0,25624560.0,0.9614077334478968,0.9520939741125184\nSPY,20180104,1727700.0,1734700.0,1720800.0,1730300.0,21587118.0,,\nQQQ,20180104,1605800.0,1607900.0,1600800.0,1603100.0,23211278.0,0.9607833242194767,0.9518723865746617\nSPY,20180105,1735100.0,1753700.0,1730500.0,1750000.0,22493412.0,,\nQQQ,20180105,1610700.0,1620300.0,1607700.0,1619200.0,24592644.0,0.9602778664556852,0.9518123967166968\nSPY,20180108,1744000.0,1756000.0,1739300.0,1743500.0,19477075.0,,\nQQQ,20180108,1619200.0,1626300.0,1618600.0,1625500.0,21648301.0,0.9596572547315828,0.9516618506050459\nSPY,20180109,1745400.0,1750500.0,1734100.0,1743300.0,20625554.0,,\nQQQ,20180109,1628700.0,1630400.0,1620700.0,1625600.0,22325508.0,0.9590551058737501,0.9514980032747639\nSPY,20180110,1731000.0,1743000.0,1729700.0,1742900.0,23032635.0,,\nQQQ,20180110,1618400.0,1622100.0,1611200.0,1621800.0,31069194.0,0.958594728769378,0.9513307815143386\nSPY,20180111,1745100.0,1754800.0,1744900.0,1752800.0,16831200.0,,\nQQQ,20180111,1624600.0,1633000.0,1622100.0,1632900.0,19081503.0,0.9581376249417889,0.951280914935557\nSPY,20180112,1759600.0,1773600.0,1740200.0,1770900.0,24381629.0,,\nQQQ,20180112,1631500.0,1646600.0,1629400.0,1644900.0,32400221.0,0.9578250848245425,0.9512839144290177\nSPY,20180116,1780000.0,1793900.0,1761400.0,1761900.0,27324757.0,,\nQQQ,20180116,1655800.0,1664200.0,1635300.0,1640200.0,36820412.0,0.9576015182739311,0.951261043291381\nSPY,20180117,1762000.0,1792500.0,1750600.0,1791000.0,32027071.0,,\nQQQ,20180117,1648000.0,1660400.0,1640300.0,1657900.0,30469423.0,0.9574371929254821,0.9512679887556679\nSPY,20180118,1794700.0,1801000.0,1726100.0,1792600.0,28110366.0,,\nQQQ,20180118,1655300.0,1661900.0,1651300.0,1658200.0,24456253.0,0.9573875868996993,0.9512702383753415\nSPY,20180119,1787500.0,1795800.0,1774100.0,1784600.0,26983172.0,,\nQQQ,20180119,1663100.0,1666000.0,1655400.0,1663400.0,36302385.0,0.9571625374472319,0.9512679887556679\nSPY,20180122,1773000.0,1777800.0,1766200.0,1770000.0,24741267.0,,\nQQQ,20180122,1662800.0,1681200.0,1660900.0,1681200.0,23816650.0,0.9562915858600615,0.9512619897698713\nSPY,20180123,1772800.0,1794400.0,1768200.0,1770400.0,30775398.0,,\nQQQ,20180123,1686400.0,1696600.0,1685600.0,1695100.0,31171023.0,0.9551405114127256,0.9512522414179521\nSPY,20180124,1773000.0,1773000.0,1732000.0,1742200.0,47653913.0,,\nQQQ,20180124,1698700.0,1702400.0,1674400.0,1684100.0,51050581.0,0.9538867754312234,0.9509301708680044\nSPY,20180125,1742900.0,1749500.0,1705300.0,1711100.0,39089494.0,,\nQQQ,20180125,1695700.0,1696300.0,1678100.0,1683500.0,26898995.0,0.9517897007238222,0.9502731037772526\nSPY,20180126,1720000.0,1720100.0,1700600.0,1715100.0,36397039.0,,\nQQQ,20180126,1692900.0,1709300.0,1689500.0,1709300.0,26322276.0,0.9489158676287636,0.9495877197784943\nSPY,20180129,1700000.0,1700000.0,1670700.0,1679600.0,47358109.0,,\nQQQ,20180129,1705700.0,1709000.0,1697400.0,1701000.0,35410275.0,0.945163397751039,0.9482791912469483\nSPY,20180130,1654800.0,1673700.0,1646800.0,1669700.0,43970225.0,,\nQQQ,20180130,1685500.0,1694200.0,1678200.0,1687000.0,41542632.0,0.9416398562340047,0.9469646637307303\nSPY,20180131,1669500.0,1684500.0,1665000.0,1674300.0,30124391.0,,\nQQQ,20180131,1696500.0,1699900.0,1683400.0,1694000.0,35604847.0,0.9381458496410734,0.9456073934487255\nSPY,20180201,1672400.0,1686200.0,1667600.0,1677800.0,36252650.0,,\nQQQ,20180201,1681000.0,1697300.0,1674200.0,1679600.0,33038089.0,0.9349021573669988,0.9442876168209196\nSPY,20180202,1663400.0,1668000.0,1601000.0,1605000.0,79374752.0,,\nQQQ,20180202,1673000.0,1677000.0,1644700.0,1646100.0,60915528.0,0.9299956381957529,0.9420604937614971\nSPY,20180205,1591800.0,1638800.0,1560000.0,1564900.0,69245119.0,,\nQQQ,20180205,1630700.0,1657500.0,1580000.0,1581200.0,98547041.0,0.9264184796752923,0.938748679286097\nSPY,20180206,1550000.0,1637100.0,1540000.0,1630300.0,65386026.0,,\nQQQ,20180206,1558100.0,1625100.0,1551000.0,1623100.0,112110301.0,0.9235926033962423,0.9373640386365268\nSPY,20180207,1630000.0,1634000.0,1590600.0,1595400.0,50395881.0,,\nQQQ,20180207,1617900.0,1635500.0,1602000.0,1602100.0,83257372.0,0.9202666935825967,0.9347811007987556\nSPY,20180208,1602800.0,1610000.0,1550300.0,1551500.0,54055640.0,,\nQQQ,20180208,1606200.0,1608000.0,1534500.0,1534500.0,89080576.0,0.9178293459690505,0.9325104851004624\nSPY,20180209,1570000.0,1578900.0,1502400.0,1564100.0,70048242.0,,\nQQQ,20180209,1556200.0,1572400.0,1501300.0,1561000.0,107816842.0,0.9148999109837529,0.9296750143180389\nSPY,20180212,1584100.0,1638900.0,1575000.0,1627100.0,60799699.0,,\nQQQ,20180212,1577000.0,1599500.0,1564600.0,1588700.0,57585969.0,0.913088965470545,0.9282108868470892\nSPY,20180213,1619000.0,1647500.0,1616500.0,1643400.0,31511889.0,,\nQQQ,20180213,1579600.0,1600100.0,1577200.0,1596900.0,29696626.0,0.9115644369393187,0.9269949674134682\nSPY,20180214,1630700.0,1675400.0,1628800.0,1673700.0,38647789.0,,\nQQQ,20180214,1587500.0,1629300.0,1580000.0,1626800.0,47805902.0,0.9101811204755176,0.9256579434540813\nSPY,20180215,1698500.0,1730900.0,1690000.0,1729900.0,49253393.0,,\nQQQ,20180215,1641400.0,1657000.0,1624400.0,1657000.0,48455411.0,0.9097442805059095,0.9249436892076895\nSPY,20180216,1724000.0,1748100.0,1717700.0,1724300.0,38964970.0,,\nQQQ,20180216,1651600.0,1667600.0,1646800.0,1649600.0,56144964.0,0.9092782127145439,0.9241409499208002\nSPY,20180220,1718700.0,1742600.0,1714200.0,1718500.0,31689320.0,,\nQQQ,20180220,1643800.0,1666800.0,1643100.0,1652900.0,33092894.0,0.9086977692103826,0.9232309787630586\nSPY,20180221,1727300.0,1741200.0,1710100.0,1710700.0,34766080.0,,\nQQQ,20180221,1661000.0,1677200.0,1647300.0,1648200.0,35263645.0,0.9080672950829538,0.9222265235787627\nSPY,20180222,1717600.0,1739500.0,1717100.0,1725000.0,29784392.0,,\nQQQ,20180222,1655400.0,1664100.0,1643800.0,1648000.0,34023215.0,0.9077470307859702,0.9213962117153297\nSPY,20180223,1738000.0,1756500.0,1735400.0,1755000.0,32671944.0,,\nQQQ,20180223,1661300.0,1681700.0,1654600.0,1681700.0,45502535.0,0.9076018236200617,0.9210385221201599\nSPY,20180226,1762100.0,1793900.0,1762100.0,1789700.0,36053336.0,,\nQQQ,20180226,1689600.0,1704000.0,1688200.0,1704000.0,36878844.0,0.9079944111631226,0.9209987788318076\nSPY,20180227,1790000.0,1804800.0,1781600.0,1783900.0,37677735.0,,\nQQQ,20180227,1704500.0,1707300.0,1682100.0,1682900.0,40035622.0,0.9083951925935833,0.9207790659358227\nSPY,20180228,1792000.0,1806200.0,1780500.0,1781200.0,31903035.0,,\nQQQ,20180228,1692500.0,1698000.0,1671000.0,1672100.0,38293608.0,0.908693762444555,0.9204648689958308\nSPY,20180301,1786500.0,1799000.0,1726600.0,1750000.0,47735816.0,,\nQQQ,20180301,1673000.0,1680700.0,1630000.0,1644800.0,67254077.0,0.9087769873510017,0.9199592518744916\nSPY,20180302,1726700.0,1763000.0,1724500.0,1762100.0,36825048.0,,\nQQQ,20180302,1625000.0,1662700.0,1619600.0,1659900.0,51884411.0,0.9088819280351909,0.919641680444822\nSPY,20180305,1751500.0,1777500.0,1745200.0,1768200.0,26782814.0,,\nQQQ,20180305,1652100.0,1682600.0,1645900.0,1678300.0,35146466.0,0.9090055664326783,0.9193795996545749\nSPY,20180306,1780000.0,1782500.0,1760000.0,1766700.0,22607671.0,,\nQQQ,20180306,1686500.0,1691100.0,1674900.0,1685400.0,26680406.0,0.9089979291959014,0.9191895067208768\nSPY,20180307,1751200.0,1758500.0,1742600.0,1750300.0,29146763.0,,\nQQQ,20180307,1672500.0,1690700.0,1669600.0,1689300.0,30575790.0,0.9085678533661422,0.918845689718507\nSPY,20180308,1754100.0,1771200.0,1750700.0,1769400.0,22739730.0,,\nQQQ,20180308,1696300.0,1699700.0,1689500.0,1698600.0,24106812.0,0.9084546769796005,0.918717086412277\nSPY,20180309,1777700.0,1800300.0,1773900.0,1799800.0,30588580.0,,\nQQQ,20180309,1710700.0,1731600.0,1708200.0,1731600.0,33424419.0,0.9086553805505716,0.9187566574705031\nSPY,20180312,1802300.0,1823900.0,1802100.0,1817200.0,31374675.0,,\nQQQ,20180312,1736700.0,1744800.0,1732800.0,1740800.0,33469089.0,0.9091920948096257,0.918816647339714\nSPY,20180313,1824900.0,1835000.0,1792400.0,1799700.0,30587951.0,,\nQQQ,20180313,1748300.0,1752100.0,1712700.0,1717100.0,52183520.0,0.9095579310782201,0.9188953840430533\nSPY,20180314,1805000.0,1805200.0,1778200.0,1784400.0,28476607.0,,\nQQQ,20180314,1726100.0,1727400.0,1709400.0,1716800.0,35893605.0,0.9095745752090421,0.9188976336631486\nSPY,20180315,1785000.0,1802400.0,1780800.0,1786500.0,22144134.0,,\nQQQ,20180315,1718000.0,1725300.0,1709000.0,1715300.0,24478596.0,0.9097079323655246,0.9190168635282053\nSPY,20180316,1786500.0,1791200.0,1776200.0,1780200.0,32980020.0,,\nQQQ,20180316,1718200.0,1722000.0,1709400.0,1710200.0,24677194.0,0.9097373322656567,0.9190442339060328\nSPY,20180319,1772500.0,1774700.0,1736600.0,1753000.0,31740935.0,,\nQQQ,20180319,1691000.0,1692200.0,1656400.0,1671000.0,62665331.0,0.909543374847879,0.918611556974349\nSPY,20180320,1752800.0,1768000.0,1749400.0,1752400.0,18691511.0,,\nQQQ,20180320,1671700.0,1680400.0,1666100.0,1676500.0,31500793.0,0.9093087976572933,0.9181001433393262\nSPY,20180321,1750000.0,1750900.0,1712600.0,1712700.0,34988000.0,,\nQQQ,20180321,1672100.0,1687600.0,1661900.0,1669200.0,41773262.0,0.9081504327581588,0.9167571201423672\nSPY,20180322,1700000.0,1726800.0,1686000.0,1688500.0,40536280.0,,\nQQQ,20180322,1646100.0,1657700.0,1625900.0,1628000.0,61401317.0,0.9071856996771334,0.9152270035408065\nSPY,20180323,1686300.0,1699200.0,1649200.0,1649400.0,39368017.0,,\nQQQ,20180323,1626100.0,1633000.0,1584400.0,1585100.0,70619939.0,0.9060077668450619,0.91385810971275\nSPY,20180326,1680700.0,1731100.0,1664400.0,1727700.0,35606307.0,,\nQQQ,20180326,1617200.0,1646000.0,1591500.0,1644000.0,51322647.0,0.9054186095651142,0.9128472804165465\nSPY,20180327,1737800.0,1751500.0,1669200.0,1683400.0,38378641.0,,\nQQQ,20180327,1656200.0,1656200.0,1576800.0,1590800.0,70092542.0,0.9045753651723665,0.9113599065967986\nSPY,20180328,1671000.0,1700200.0,1651900.0,1664800.0,43199395.0,,\nQQQ,20180328,1581700.0,1597800.0,1560400.0,1572500.0,80283198.0,0.9038523834864653,0.9102800889510023\nSPY,20180329,1680700.0,1717500.0,1669000.0,1677800.0,35262367.0,,\nQQQ,20180329,1581000.0,1617100.0,1566400.0,1601300.0,62725737.0,0.9031059446336005,0.9088843700691178\nSPY,20180402,1678900.0,1689400.0,1644800.0,1666800.0,36685363.0,,\nQQQ,20180402,1589900.0,1597500.0,1538800.0,1555100.0,81617579.0,0.902383703671432,0.908005518320421\nSPY,20180403,1675800.0,1687400.0,1648800.0,1683900.0,29061821.0,,\nQQQ,20180403,1568700.0,1579300.0,1544400.0,1572600.0,59080294.0,0.9016881308034747,0.9066499519903773\nSPY,20180404,1649000.0,1720100.0,1647700.0,1716100.0,33511676.0,,\nQQQ,20180404,1542200.0,1602300.0,1540400.0,1597400.0,59094528.0,0.9011266989871646,0.9054505295428419\nSPY,20180405,1725300.0,1742300.0,1720800.0,1728000.0,25584007.0,,\nQQQ,20180405,1613300.0,1615700.0,1594800.0,1606500.0,40378173.0,0.900712515774603,0.9044816931550856\nSPY,20180406,1710200.0,1724800.0,1682000.0,1683800.0,33132888.0,,\nQQQ,20180406,1588800.0,1604600.0,1558800.0,1566300.0,54466041.0,0.8999500246903019,0.9030969008505471\nSPY,20180409,1700600.0,1730900.0,1698100.0,1700500.0,26702284.0,,\nQQQ,20180409,1579800.0,1608800.0,1574600.0,1577300.0,38606428.0,0.8991818326027774,0.9016642683236006\nSPY,20180410,1730000.0,1740000.0,1715300.0,1732500.0,27749761.0,,\nQQQ,20180410,1602100.0,1617300.0,1590700.0,1612100.0,45510646.0,0.898584381082025,0.9005338346494988\nSPY,20180411,1720800.0,1739300.0,1717100.0,1724400.0,21062559.0,,\nQQQ,20180411,1602000.0,1620000.0,1601000.0,1602800.0,39039665.0,0.897875293733554,0.8993059174744791\nSPY,20180412,1733900.0,1750000.0,1730400.0,1741400.0,21819041.0,,\nQQQ,20180412,1612500.0,1627700.0,1611600.0,1622100.0,29137347.0,0.8971360897309976,0.8981638607675757\nSPY,20180413,1748800.0,1758400.0,1738500.0,1747300.0,21495010.0,,\nQQQ,20180413,1630200.0,1632500.0,1606700.0,1613700.0,39801932.0,0.8962746109707408,0.8970784194785123\nSPY,20180416,1749800.0,1761900.0,1748400.0,1758200.0,20907059.0,,\nQQQ,20180416,1625000.0,1631900.0,1614700.0,1626000.0,24878654.0,0.8953926700834722,0.8961103333270924\nSPY,20180417,1765100.0,1789500.0,1764100.0,1782400.0,23689716.0,,\nQQQ,20180417,1642400.0,1664500.0,1639100.0,1661000.0,33172661.0,0.8949438365676352,0.8955393049736408\nSPY,20180418,1777800.0,1788200.0,1768800.0,1778400.0,19221238.0,,\nQQQ,20180418,1661000.0,1670000.0,1653100.0,1664400.0,27217596.0,0.8943975852047905,0.894966027000937\nSPY,20180419,1748300.0,1753900.0,1726600.0,1728000.0,32558174.0,,\nQQQ,20180419,1656000.0,1659900.0,1643400.0,1649100.0,32272835.0,0.8932595264580169,0.8936482925868068\nSPY,20180420,1704500.0,1712100.0,1654300.0,1657200.0,63304522.0,,\nQQQ,20180420,1644900.0,1646100.0,1617300.0,1623000.0,43908605.0,0.8911133813511932,0.891388549624598\nSPY,20180423,1668600.0,1684700.0,1640900.0,1652400.0,33320520.0,,\nQQQ,20180423,1630900.0,1637300.0,1610200.0,1618900.0,29619483.0,0.888862371596813,0.8892268733526854\nSPY,20180424,1657500.0,1663300.0,1612300.0,1629400.0,33141927.0,,\nQQQ,20180424,1626600.0,1629000.0,1573900.0,1584600.0,68025816.0,0.8869518073303264,0.8872220876626611\nSPY,20180425,1626200.0,1654200.0,1624000.0,1636500.0,26929449.0,,\nQQQ,20180425,1587400.0,1593100.0,1564800.0,1586500.0,48319632.0,0.8852521957556868,0.8852296748785227\nSPY,20180426,1640600.0,1657300.0,1633700.0,1642200.0,26197515.0,,\nQQQ,20180426,1607000.0,1625300.0,1601800.0,1619900.0,38128925.0,0.8828371749135291,0.882887280787122\nSPY,20180427,1640700.0,1643300.0,1606300.0,1623200.0,34624256.0,,\nQQQ,20180427,1643700.0,1644100.0,1611700.0,1620900.0,46538264.0,0.8797887170724848,0.8801015028023769\nSPY,20180430,1621900.0,1672600.0,1618400.0,1652600.0,38705206.0,,\nQQQ,20180430,1624700.0,1634800.0,1605400.0,1609400.0,32583764.0,0.8779943780325808,0.877822263990901\nSPY,20180501,1663500.0,1692000.0,1652700.0,1691000.0,42125960.0,,\nQQQ,20180501,1605200.0,1628000.0,1601400.0,1627800.0,34080939.0,0.8769193639473547,0.875852722705051\nSPY,20180502,1752500.0,1777500.0,1738000.0,1765700.0,63185303.0,,\nQQQ,20180502,1630600.0,1635700.0,1616300.0,1618200.0,35408333.0,0.8763236080664553,0.8747410360664549\nSPY,20180503,1756800.0,1775000.0,1744600.0,1768900.0,33030686.0,,\nQQQ,20180503,1610000.0,1624000.0,1592200.0,1618000.0,59058522.0,0.8756112047375386,0.8735101196298575\nSPY,20180504,1781700.0,1842500.0,1781700.0,1838300.0,54148783.0,,\nQQQ,20180504,1611000.0,1652500.0,1609800.0,1648700.0,38502554.0,0.8747559022768249,0.8728423577737564\nSPY,20180507,1851100.0,1876700.0,1847500.0,1851600.0,41115737.0,,\nQQQ,20180507,1656400.0,1667800.0,1655100.0,1662400.0,30015319.0,0.8743297671919967,0.8724505491608279\nSPY,20180508,1850000.0,1862200.0,1836500.0,1860500.0,25983870.0,,\nQQQ,20180508,1658900.0,1664300.0,1648600.0,1660700.0,24944018.0,0.8743019610003364,0.8725771141080007\nSPY,20180509,1865800.0,1874000.0,1852200.0,1873600.0,22319481.0,,\nQQQ,20180509,1663700.0,1680000.0,1657800.0,1678800.0,26637300.0,0.8748755646397767,0.8732375883427814\nSPY,20180510,1877400.0,1903700.0,1876600.0,1900400.0,27462372.0,,\nQQQ,20180510,1684200.0,1697400.0,1682900.0,1696200.0,25001870.0,0.8754760058558787,0.8739192225927659\nSPY,20180511,1895500.0,1900600.0,1874500.0,1885900.0,24637060.0,,\nQQQ,20180511,1694200.0,1698600.0,1687200.0,1694600.0,21711786.0,0.8764072651322969,0.8749341752411203\nSPY,20180514,1891000.0,1895300.0,1878600.0,1881500.0,18701305.0,,\nQQQ,20180514,1698500.0,1708200.0,1659300.0,1697500.0,19876008.0,0.8779603803664361,0.8768598482377762\nSPY,20180515,1867900.0,1870700.0,1851000.0,1864400.0,22604774.0,,\nQQQ,20180515,1684100.0,1685000.0,1669800.0,1678700.0,44101965.0,0.8789514719821274,0.8778755507587925\nSPY,20180516,1860800.0,1884600.0,1860000.0,1881800.0,18301821.0,,\nQQQ,20180516,1680900.0,1693700.0,1680100.0,1689800.0,21105809.0,0.8799083292997485,0.8789883617895704\nSPY,20180517,1880000.0,1889100.0,1863600.0,1869900.0,16526973.0,,\nQQQ,20180517,1683900.0,1696100.0,1675100.0,1683300.0,25902938.0,0.880107038559205,0.8789163740139944\nSPY,20180518,1872000.0,1878200.0,1861300.0,1863100.0,17287673.0,,\nQQQ,20180518,1676800.0,1682600.0,1672100.0,1674600.0,23540773.0,0.880496701893745,0.8789212481862991\nSPY,20180521,1879200.0,1892700.0,1869100.0,1876300.0,17721804.0,,\nQQQ,20180521,1687600.0,1694900.0,1676800.0,1684000.0,20890845.0,0.8810424261690113,0.8791064667338748\nSPY,20180522,1883600.0,1888800.0,1867800.0,1871600.0,13738714.0,,\nQQQ,20180522,1691700.0,1694500.0,1678800.0,1681800.0,18229381.0,0.8816291012652867,0.8794960255819131\nSPY,20180523,1863100.0,1885000.0,1857600.0,1883600.0,17659144.0,,\nQQQ,20180523,1668800.0,1696100.0,1668800.0,1696000.0,24979100.0,0.882416368232559,0.8800550556516199\nSPY,20180524,1887500.0,1888600.0,1862100.0,1881500.0,19921225.0,,\nQQQ,20180524,1695500.0,1698500.0,1678400.0,1695500.0,26195326.0,0.8830479118772876,0.8803262996524116\nSPY,20180525,1882700.0,1896500.0,1876500.0,1885800.0,16669631.0,,\nQQQ,20180525,1695300.0,1703300.0,1692100.0,1697200.0,24132082.0,0.883667864452281,0.8806097515718802\nSPY,20180529,1876000.0,1887400.0,1868700.0,1879000.0,21361650.0,,\nQQQ,20180529,1689500.0,1699200.0,1679600.0,1689700.0,38703565.0,0.8840910864416337,0.8807301061567337\nSPY,20180530,1877500.0,1880000.0,1867800.0,1875000.0,17846432.0,,\nQQQ,20180530,1695800.0,1704800.0,1692200.0,1701800.0,19705057.0,0.8847926324421731,0.881019931995026\nSPY,20180531,1872000.0,1882300.0,1861300.0,1868700.0,24645231.0,,\nQQQ,20180531,1701800.0,1712000.0,1696300.0,1700700.0,33849468.0,0.8853642036466676,0.8809824383548849\nSPY,20180601,1878900.0,1902600.0,1877500.0,1902400.0,22614339.0,,\nQQQ,20180601,1709200.0,1728300.0,1708700.0,1727400.0,41272483.0,0.8863505145302865,0.8813266299713822\nSPY,20180604,1916500.0,1934200.0,1913500.0,1918300.0,25448080.0,,\nQQQ,20180604,1731800.0,1743400.0,1730700.0,1743000.0,18753380.0,0.8877439423197327,0.8822032312778866\nSPY,20180605,1931100.0,1939400.0,1923600.0,1933100.0,20520196.0,,\nQQQ,20180605,1747100.0,1751300.0,1740600.0,1748400.0,22545503.0,0.8890362257503029,0.8829009879209169\nSPY,20180606,1937000.0,1940800.0,1919200.0,1939800.0,19985438.0,,\nQQQ,20180606,1750200.0,1758900.0,1741400.0,1758600.0,23283885.0,0.890497592833017,0.8835631256058128\nSPY,20180607,1941600.0,1942300.0,1923400.0,1934600.0,18775035.0,,\nQQQ,20180607,1758900.0,1759300.0,1735500.0,1744300.0,36818037.0,0.891694885871787,0.8843459928119637\nSPY,20180608,1910000.0,1920000.0,1897700.0,1917000.0,25233155.0,,\nQQQ,20180608,1736100.0,1747000.0,1731800.0,1744400.0,29149960.0,0.8928429262071571,0.8850178788432965\nSPY,20180611,1914500.0,1919700.0,1902200.0,1912300.0,17608516.0,,\nQQQ,20180611,1743100.0,1753400.0,1742800.0,1749100.0,21215513.0,0.8935350171149147,0.8850658707026774\nSPY,20180612,1913800.0,1926200.0,1911500.0,1922800.0,16306173.0,,\nQQQ,20180612,1751500.0,1760000.0,1749600.0,1758300.0,21069179.0,0.8941761075810809,0.8850673704482832\nSPY,20180613,1925000.0,1928700.0,1904400.0,1907000.0,20489309.0,,\nQQQ,20180613,1761000.0,1771400.0,1754300.0,1758200.0,35959036.0,0.8948372968984187,0.8850756190491141\nSPY,20180614,1915700.0,1915900.0,1902200.0,1908000.0,20255595.0,,\nQQQ,20180614,1766300.0,1778900.0,1765000.0,1776000.0,32847905.0,0.895495542059915,0.8850531228650295\nSPY,20180615,1901500.0,1901600.0,1882600.0,1888400.0,54238943.0,,\nQQQ,20180615,1769300.0,1773300.0,1761100.0,1769800.0,39273659.0,0.8958007191884195,0.884998382150423\nSPY,20180618,1876900.0,1892200.0,1872000.0,1887400.0,16566274.0,,\nQQQ,20180618,1754900.0,1766500.0,1749400.0,1765000.0,26933522.0,0.8959761472287978,0.8849533897822534\nSPY,20180619,1853300.0,1863300.0,1834500.0,1856900.0,31427809.0,,\nQQQ,20180619,1742700.0,1760400.0,1737000.0,1760000.0,35197757.0,0.8959387353929612,0.8844989668637404\nSPY,20180620,1863400.0,1872100.0,1857300.0,1865000.0,18819334.0,,\nQQQ,20180620,1768100.0,1779800.0,1766500.0,1772500.0,29298016.0,0.8957984607484748,0.884103034023848\nSPY,20180621,1874300.0,1883500.0,1849400.0,1854600.0,24567773.0,,\nQQQ,20180621,1777000.0,1778800.0,1753700.0,1757100.0,38540665.0,0.8957765980670636,0.8836568597061663\nSPY,20180622,1859400.0,1861500.0,1847000.0,1849200.0,21470706.0,,\nQQQ,20180622,1763000.0,1763600.0,1746900.0,1753200.0,27812197.0,0.8956839449028199,0.8831591535374972\nSPY,20180625,1834000.0,1849200.0,1807300.0,1821700.0,30457522.0,,\nQQQ,20180625,1737300.0,1739900.0,1698100.0,1713700.0,72480257.0,0.8954559670031725,0.8828052136409155\nSPY,20180626,1826900.0,1865300.0,1825300.0,1844300.0,24023509.0,,\nQQQ,20180626,1720000.0,1730500.0,1713700.0,1720700.0,36103163.0,0.8953178714522123,0.8824017821486252\nSPY,20180627,1852500.0,1872800.0,1840300.0,1841600.0,23870027.0,,\nQQQ,20180627,1728000.0,1735800.0,1696200.0,1697300.0,48556388.0,0.8946515153770496,0.8818285044983353\nSPY,20180628,1839400.0,1862100.0,1838000.0,1855000.0,16750302.0,,\nQQQ,20180628,1694700.0,1717700.0,1691700.0,1711900.0,43043605.0,0.8943698450666391,0.8813778310283233\nSPY,20180629,1863800.0,1871900.0,1829000.0,1851100.0,19461976.0,,\nQQQ,20180629,1720100.0,1729200.0,1714300.0,1716500.0,31725952.0,0.8937102923630927,0.8809001621424702\nSPY,20180702,1836800.0,1873000.0,1834200.0,1871800.0,16607711.0,,\nQQQ,20180702,1699700.0,1728500.0,1696700.0,1728000.0,30298605.0,0.893169691510947,0.880580716388352\nSPY,20180703,1877700.0,1879500.0,1835400.0,1839200.0,13459252.0,,\nQQQ,20180703,1734500.0,1734500.0,1706300.0,1708000.0,23208287.0,0.8921003482488863,0.8800055640564066\nSPY,20180705,1853300.0,1864100.0,1842800.0,1854000.0,15945124.0,,\nQQQ,20180705,1719400.0,1730600.0,1710300.0,1729200.0,28400870.0,0.8913560678203949,0.879512147844646\nSPY,20180706,1854200.0,1884300.0,1850500.0,1879700.0,16923582.0,,\nQQQ,20180706,1733200.0,1757400.0,1730000.0,1756100.0,31464288.0,0.8906484237901465,0.8792421936862362\nSPY,20180709,1894400.0,1906800.0,1893000.0,1905800.0,18044343.0,,\nQQQ,20180709,1765200.0,1772300.0,1758200.0,1771900.0,22085629.0,0.8904366608402786,0.879159707693389\nSPY,20180710,1908000.0,1912800.0,1901900.0,1903500.0,14540849.0,,\nQQQ,20180710,1775200.0,1777200.0,1767100.0,1773200.0,20775763.0,0.8903164391662343,0.8790847204271639\nSPY,20180711,1886900.0,1897700.0,1876100.0,1878800.0,17580516.0,,\nQQQ,20180711,1759300.0,1770700.0,1758000.0,1764200.0,26968896.0,0.8899381667317906,0.8787412787478538\nSPY,20180712,1894900.0,1914100.0,1892500.0,1910300.0,17011315.0,,\nQQQ,20180712,1772000.0,1794600.0,1770800.0,1794600.0,25270075.0,0.8902744641741905,0.8786632919909797\nSPY,20180713,1911600.0,1918400.0,1909000.0,1913300.0,11922214.0,,\nQQQ,20180713,1794500.0,1799000.0,1789500.0,1796100.0,24760337.0,0.8905723618584588,0.878592054088066\nSPY,20180716,1916500.0,1926500.0,1904200.0,1909100.0,14071804.0,,\nQQQ,20180716,1796500.0,1799500.0,1788800.0,1791800.0,19170458.0,0.8909299523055437,0.8787105339687012\nSPY,20180717,1897500.0,1918700.0,1892000.0,1914500.0,14311243.0,,\nQQQ,20180717,1772800.0,1806500.0,1772800.0,1802700.0,28261011.0,0.8913246694542141,0.878841011811933\nSPY,20180718,1917600.0,1918800.0,1899300.0,1904000.0,14584283.0,,\nQQQ,20180718,1802900.0,1804400.0,1793800.0,1799300.0,21232152.0,0.891681008193202,0.8791154652063162\nSPY,20180719,1897900.0,1925500.0,1896900.0,1918800.0,18771686.0,,\nQQQ,20180719,1792800.0,1798800.0,1788300.0,1790300.0,28485440.0,0.8922753907871162,0.8795668885489905\nSPY,20180720,1919300.0,1940000.0,1901700.0,1914400.0,19264998.0,,\nQQQ,20180720,1796200.0,1801700.0,1787900.0,1789900.0,30820674.0,0.8928750753984368,0.8800745523413334\nSPY,20180723,1906400.0,1919600.0,1895600.0,1916100.0,14428802.0,,\nQQQ,20180723,1784600.0,1796400.0,1777400.0,1795600.0,19113242.0,0.8934737018057489,0.8805169772120607\nSPY,20180724,1922000.0,1936600.0,1920500.0,1930000.0,17437674.0,,\nQQQ,20180724,1814100.0,1820500.0,1795600.0,1803000.0,33515633.0,0.8942064430957496,0.8812915956721646\nSPY,20180725,1930000.0,1948500.0,1924300.0,1948200.0,16025166.0,,\nQQQ,20180725,1803800.0,1829300.0,1802800.0,1828200.0,28811490.0,0.8950994778933973,0.8819597322142289\nSPY,20180726,1946000.0,1959600.0,1936100.0,1942100.0,18054743.0,,\nQQQ,20180726,1803400.0,1809200.0,1798100.0,1800500.0,33630464.0,0.8957734064919439,0.8827107296854719\nSPY,20180727,1950000.0,1951900.0,1901000.0,1909800.0,22768994.0,,\nQQQ,20180727,1811900.0,1813100.0,1766100.0,1776200.0,55034032.0,0.8960518381205629,0.8830346746755637\nSPY,20180730,1919000.0,1922000.0,1890700.0,1899100.0,19597501.0,,\nQQQ,20180730,1776300.0,1777300.0,1742700.0,1751100.0,57906701.0,0.8961312003617893,0.8831966471706096\nSPY,20180731,1903100.0,1921400.0,1893400.0,1902900.0,30686367.0,,\nQQQ,20180731,1758000.0,1771300.0,1748200.0,1764500.0,41396605.0,0.8962515777694339,0.8833901143174699\nSPY,20180801,1990200.0,2017600.0,1973100.0,2015000.0,64115647.0,,\nQQQ,20180801,1768600.0,1776500.0,1761300.0,1771200.0,35078349.0,0.895327518632886,0.8835565860484894\nSPY,20180802,2003800.0,2083800.0,2003500.0,2073900.0,61204559.0,,\nQQQ,20180802,1758700.0,1797400.0,1757900.0,1795300.0,42632985.0,0.8940798129020894,0.884456433243189\nSPY,20180803,2070500.0,2087400.0,2054800.0,2079900.0,31409980.0,,\nQQQ,20180803,1798700.0,1800900.0,1790800.0,1800800.0,25587620.0,0.8929066393665599,0.8849393512376778\nSPY,20180806,2079300.0,2092500.0,2070700.0,2090700.0,24842483.0,,\nQQQ,20180806,1799600.0,1811900.0,1797400.0,1811400.0,21889822.0,0.892132189715556,0.8855999890531197\nSPY,20180807,2094500.0,2095000.0,2067600.0,2071100.0,24628640.0,,\nQQQ,20180807,1816500.0,1821400.0,1812600.0,1818000.0,26022610.0,0.8923999045770625,0.8864615927420445\nSPY,20180808,2060500.0,2078100.0,2045200.0,2072500.0,21327126.0,,\nQQQ,20180808,1816000.0,1823600.0,1810600.0,1820200.0,20074033.0,0.8929540437895191,0.8875091648512071\nSPY,20180809,2075000.0,2097800.0,2072000.0,2088800.0,23061519.0,,\nQQQ,20180809,1819100.0,1826300.0,1816500.0,1819100.0,16874406.0,0.8933961713714991,0.8886864649309392\nSPY,20180810,2073100.0,2091000.0,2066700.0,2075300.0,24126427.0,,\nQQQ,20180810,1806800.0,1812100.0,1798400.0,1805200.0,30783887.0,0.8928935262086565,0.8889129264749385\nSPY,20180813,2077000.0,2109600.0,2077000.0,2088700.0,25277798.0,,\nQQQ,20180813,1808800.0,1820100.0,1802500.0,1803200.0,24111870.0,0.8923769861842615,0.8896980431523138\nSPY,20180814,2101500.0,2105600.0,2082600.0,2097500.0,19584346.0,,\nQQQ,20180814,1810100.0,1816600.0,1800400.0,1814500.0,19338963.0,0.8924580185586948,0.890624135890192\nSPY,20180815,2090000.0,2107400.0,2083300.0,2102400.0,27446468.0,,\nQQQ,20180815,1800100.0,1805800.0,1781200.0,1792300.0,53086234.0,0.8918804923944461,0.8915877222611828\nSPY,20180816,2119300.0,2138200.0,2114700.0,2133200.0,26206801.0,,\nQQQ,20180816,1806100.0,1809900.0,1794700.0,1798200.0,25312473.0,0.8907348087190775,0.8925415602875643\nSPY,20180817,2134700.0,2179500.0,2131600.0,2175800.0,34300137.0,,\nQQQ,20180817,1793500.0,1803100.0,1782700.0,1798600.0,33948698.0,0.8882557587843167,0.8931377090540525\nSPY,20180820,2181700.0,2191800.0,2151000.0,2154600.0,28477170.0,,\nQQQ,20180820,1802600.0,1803200.0,1790000.0,1797000.0,21741917.0,0.8865762519807336,0.893703113041389\nSPY,20180821,2166200.0,2172000.0,2140200.0,2150400.0,24850932.0,,\nQQQ,20180821,1802400.0,1814400.0,1801300.0,1803600.0,22583897.0,0.8855082570407312,0.8942902633359303\nSPY,20180822,2142400.0,2163600.0,2138400.0,2150500.0,17693684.0,,\nQQQ,20180822,1799800.0,1812700.0,1797500.0,1810600.0,16186743.0,0.8851548775589495,0.8950416357435044\nSPY,20180823,2146000.0,2170500.0,2146000.0,2154900.0,17875005.0,,\nQQQ,20180823,1807400.0,1820500.0,1805000.0,1808000.0,24600674.0,0.8848264561927838,0.8958499984734096\nSPY,20180824,2164100.0,2169000.0,2151100.0,2161600.0,17703970.0,,\nQQQ,20180824,1814000.0,1826300.0,1813600.0,1824800.0,20993905.0,0.8851358781213812,0.8964881401089841\nSPY,20180827,2170200.0,2187400.0,2163200.0,2179400.0,19528107.0,,\nQQQ,20180827,1834000.0,1843400.0,1831100.0,1843400.0,25171565.0,0.8861780470897671,0.8972567595877898\nSPY,20180828,2190100.0,2205400.0,2189200.0,2197000.0,22101025.0,,\nQQQ,20180828,1848300.0,1850200.0,1842200.0,1846100.0,18477558.0,0.8874213816096673,0.8982075981235224\nSPY,20180829,2201800.0,2234900.0,2194100.0,2229800.0,26116995.0,,\nQQQ,20180829,1849300.0,1868400.0,1848500.0,1867400.0,25960654.0,0.8893315542971837,0.8992836653938505\nSPY,20180830,2232500.0,2282600.0,2224100.0,2250300.0,48008353.0,,\nQQQ,20180830,1863800.0,1875100.0,1857900.0,1864100.0,26992915.0,0.8905429092275946,0.9003357367389868\nSPY,20180831,2266400.0,2288700.0,2262200.0,2276300.0,40227875.0,,\nQQQ,20180831,1861800.0,1871800.0,1859800.0,1866500.0,26303627.0,0.8913015415719516,0.9011999649822294\nSPY,20180904,2285900.0,2291800.0,2266300.0,2283600.0,25495964.0,,\nQQQ,20180904,1860800.0,1864000.0,1848500.0,1858500.0,25733347.0,0.8917046504192121,0.9020810653603727\nSPY,20180905,2290000.0,2296800.0,2251000.0,2268700.0,31865602.0,,\nQQQ,20180905,1855200.0,1855700.0,1828200.0,1834500.0,38956869.0,0.8912562955391998,0.9027394535578278\nSPY,20180906,2266100.0,2273500.0,2213000.0,2231000.0,33161533.0,,\nQQQ,20180906,1835300.0,1837600.0,1805800.0,1818100.0,41730763.0,0.8908830923434115,0.9033273537250315\nSPY,20180907,2219400.0,2253800.0,2207100.0,2213000.0,35892265.0,,\nQQQ,20180907,1805000.0,1826700.0,1804400.0,1811100.0,40746877.0,0.8904903006448902,0.9038162707008183\nSPY,20180910,2210000.0,2218500.0,2164700.0,2183300.0,38196181.0,,\nQQQ,20180910,1821500.0,1822500.0,1807300.0,1817200.0,23431667.0,0.8906154354150041,0.9041679609794134\nSPY,20180911,2179100.0,2243000.0,2165600.0,2238500.0,34613944.0,,\nQQQ,20180911,1809900.0,1834200.0,1805200.0,1831200.0,28024267.0,0.8907619220408866,0.9046441301199418\nSPY,20180912,2249700.0,2250000.0,2198300.0,2210700.0,48211997.0,,\nQQQ,20180912,1828500.0,1829800.0,1810100.0,1825800.0,34032538.0,0.8910168505970608,0.9050291897320071\nSPY,20180913,2235100.0,2283600.0,2225600.0,2264100.0,39251148.0,,\nQQQ,20180913,1837200.0,1848800.0,1836500.0,1845300.0,28520937.0,0.891102258555952,0.9053062676807082\nSPY,20180914,2255000.0,2268500.0,2225200.0,2238400.0,30610962.0,,\nQQQ,20180914,1846600.0,1849400.0,1832600.0,1839900.0,28530710.0,0.8912922193121536,0.9055522259139263\nSPY,20180917,2220000.0,2229500.0,2172700.0,2178800.0,35976341.0,,\nQQQ,20180917,1836800.0,1838100.0,1811700.0,1813400.0,31552851.0,0.8915025749179818,0.9057620204575411\nSPY,20180918,2176800.0,2218200.0,2171200.0,2182400.0,30424424.0,,\nQQQ,20180918,1814900.0,1837300.0,1814000.0,1828400.0,30073629.0,0.8920017298108741,0.9059734845086526\nSPY,20180919,2185000.0,2196400.0,2153000.0,2183700.0,26326617.0,,\nQQQ,20180919,1828700.0,1833000.0,1815100.0,1827000.0,30354762.0,0.8924384961731052,0.9061399562084639\nSPY,20180920,2203200.0,2222900.0,2191500.0,2200300.0,25437404.0,,\nQQQ,20180920,1839600.0,1849700.0,1835100.0,1847200.0,30913412.0,0.8929468986200015,0.9061677014917658\nSPY,20180921,2210000.0,2213600.0,2172900.0,2176600.0,73988725.0,,\nQQQ,20180921,1852200.0,1854800.0,1834800.0,1837100.0,33896755.0,0.8930722916843995,0.9060985433554425\nSPY,20180924,2167200.0,2212600.0,2166300.0,2207900.0,26047095.0,,\nQQQ,20180924,1820200.0,1839600.0,1813000.0,1838900.0,31096778.0,0.8928831175370888,0.9060423029268603\nSPY,20180925,2197300.0,2228200.0,2197000.0,2221900.0,21667045.0,,\nQQQ,20180925,1838100.0,1842800.0,1831700.0,1841400.0,22974400.0,0.8925772420463918,0.9059965607116136\nSPY,20180926,2211500.0,2237500.0,2197500.0,2204200.0,22561108.0,,\nQQQ,20180926,1843000.0,1859900.0,1839100.0,1842700.0,32001124.0,0.8927491675478068,0.9059200737287418\nSPY,20180927,2239900.0,2264400.0,2235400.0,2249500.0,28199654.0,,\nQQQ,20180927,1850200.0,1864900.0,1849200.0,1858300.0,29602448.0,0.8930617291109142,0.9059073258982633\nSPY,20180928,2248000.0,2258400.0,2240200.0,2257400.0,20450318.0,,\nQQQ,20180928,1853100.0,1862900.0,1849700.0,1857900.0,26049970.0,0.8931906988814591,0.9058840798544494\nSPY,20181001,2279500.0,2294200.0,2263500.0,2272600.0,20845743.0,,\nQQQ,20181001,1868700.0,1875300.0,1857000.0,1861700.0,25704709.0,0.8933436345822339,0.9058735816411139\nSPY,20181002,2272300.0,2300000.0,2266200.0,2292800.0,23727885.0,,\nQQQ,20181002,1860100.0,1871800.0,1853200.0,1857500.0,24386848.0,0.8931505102934453,0.9058458363630135\nSPY,20181003,2300500.0,2334800.0,2297800.0,2320700.0,26848042.0,,\nQQQ,20181003,1865300.0,1869700.0,1856600.0,1859500.0,27517991.0,0.892808493235713,0.9058255898087237\nSPY,20181004,2307800.0,2323500.0,2267300.0,2279900.0,30427873.0,,\nQQQ,20181004,1852000.0,1853200.0,1810600.0,1823800.0,73919030.0,0.8915629474391276,0.9055878802639168\nSPY,20181005,2279600.0,2284100.0,2205800.0,2242900.0,32529751.0,,\nQQQ,20181005,1823600.0,1829700.0,1784300.0,1801500.0,76707685.0,0.8901493802511155,0.9051735757733617\nSPY,20181008,2220600.0,2248000.0,2202000.0,2237700.0,28251787.0,,\nQQQ,20181008,1795200.0,1806400.0,1769300.0,1790500.0,61742017.0,0.8883943595383527,0.9044585724579874\nSPY,20181009,2236000.0,2272700.0,2222500.0,2268700.0,25564613.0,,\nQQQ,20181009,1791800.0,1810200.0,1787500.0,1796300.0,45411634.0,0.8864855637328681,0.9037036203861225\nSPY,20181010,2255000.0,2263500.0,2160500.0,2163600.0,39709643.0,,\nQQQ,20181010,1785100.0,1786200.0,1715000.0,1717300.0,107750119.0,0.8830237729714262,0.9023227301374623\nSPY,20181011,2145300.0,2195000.0,2123200.0,2144500.0,49769239.0,,\nQQQ,20181011,1710200.0,1734000.0,1678100.0,1696000.0,129230929.0,0.8789889806982467,0.9001115248129742\nSPY,20181012,2212000.0,2228800.0,2168400.0,2221100.0,36679388.0,,\nQQQ,20181012,1741700.0,1748600.0,1709400.0,1743200.0,93735869.0,0.8755721728307685,0.8984059394426874\nSPY,20181015,2210400.0,2218300.0,2172800.0,2173600.0,27851304.0,,\nQQQ,20181015,1737100.0,1740300.0,1715600.0,1722100.0,61016751.0,0.8722118130707761,0.8970325476617772\nSPY,20181016,2189300.0,2230000.0,2167700.0,2221500.0,27734036.0,,\nQQQ,20181016,1740200.0,1776500.0,1737000.0,1772200.0,61956383.0,0.8705801319575991,0.8961270764221108\nSPY,20181017,2221500.0,2226400.0,2193400.0,2211900.0,21679517.0,,\nQQQ,20181017,1780800.0,1782500.0,1754700.0,1772900.0,64279103.0,0.8692048377857886,0.8952493504709477\nSPY,20181018,2178600.0,2197400.0,2130000.0,2160200.0,31376893.0,,\nQQQ,20181018,1766200.0,1766800.0,1724500.0,1731800.0,78359843.0,0.8668869191887666,0.8940544283836528\nSPY,20181019,2180400.0,2212600.0,2174300.0,2193100.0,31046915.0,,\nQQQ,20181019,1745800.0,1760700.0,1723900.0,1730200.0,73550766.0,0.8634285203882879,0.8922881033277238\nSPY,20181022,2196600.0,2233600.0,2188000.0,2206500.0,27278719.0,,\nQQQ,20181022,1740600.0,1752400.0,1725800.0,1739100.0,49029825.0,0.8601489051360103,0.890380802211292\nSPY,20181023,2155800.0,2232500.0,2146900.0,2227300.0,37582868.0,,\nQQQ,20181023,1706400.0,1741300.0,1688200.0,1732700.0,72284499.0,0.8561602643222219,0.8881870497378809\nSPY,20181024,2227000.0,2242300.0,2145400.0,2150900.0,38531785.0,,\nQQQ,20181024,1730700.0,1733600.0,1650400.0,1653400.0,92899209.0,0.8494578991719293,0.8830361744208882\nSPY,20181025,2175100.0,2213800.0,2167500.0,2198000.0,27454374.0,,\nQQQ,20181025,1679100.0,1720800.0,1671600.0,1710600.0,72464690.0,0.844909556593763,0.8803810852165035\nSPY,20181026,2159800.0,2202000.0,2126700.0,2163000.0,45224645.0,,\nQQQ,20181026,1652000.0,1699600.0,1642300.0,1666600.0,119369315.0,0.8387674202915049,0.8754143045692079\nSPY,20181029,2191900.0,2196900.0,2060900.0,2122400.0,44260765.0,,\nQQQ,20181029,1692100.0,1698600.0,1600900.0,1632300.0,105659436.0,0.8319499722049039,0.869529305019125\nSPY,20181030,2111500.0,2151800.0,2092700.0,2133000.0,34923742.0,,\nQQQ,20181030,1627500.0,1660400.0,1620200.0,1659200.0,84336866.0,0.8270934302835212,0.865279027566287\nSPY,20181031,2169800.0,2204500.0,2166000.0,2188600.0,35290603.0,,\nQQQ,20181031,1686200.0,1712500.0,1685400.0,1698200.0,67657933.0,0.8235154545843201,0.8631951318285601\nSPY,20181101,2190300.0,2225000.0,2168100.0,2222200.0,41924436.0,,\nQQQ,20181101,1700700.0,1722400.0,1687800.0,1720600.0,48385077.0,0.8201608008590573,0.8610422478188393\nSPY,20181102,2095500.0,2136500.0,2054300.0,2074800.0,85282286.0,,\nQQQ,20181102,1715300.0,1725500.0,1682200.0,1693800.0,69880974.0,0.8184682704447761,0.8593929032074215\nSPY,20181105,2043900.0,2043900.0,1981600.0,2015900.0,62626951.0,,\nQQQ,20181105,1696000.0,1696600.0,1670700.0,1689600.0,37334894.0,0.8179469084773963,0.8589368196907388\nSPY,20181106,2018200.0,2047200.0,2016900.0,2037700.0,30717374.0,,\nQQQ,20181106,1689700.0,1711900.0,1687200.0,1702400.0,31202142.0,0.8177809040229364,0.8595382173403767\nSPY,20181107,2060000.0,2100600.0,2041300.0,2099500.0,31328425.0,,\nQQQ,20181107,1722800.0,1755800.0,1718700.0,1755800.0,47526012.0,0.8185993781815188,0.8606124095262949\nSPY,20181108,2100400.0,2101200.0,2060100.0,2084900.0,23835422.0,,\nQQQ,20181108,1748600.0,1753100.0,1736300.0,1744600.0,36874874.0,0.8193817020687765,0.8621526473970637\nSPY,20181109,2055500.0,2060300.0,2022500.0,2044700.0,31538704.0,,\nQQQ,20181109,1728300.0,1732500.0,1701600.0,1715200.0,46735288.0,0.8199068705846547,0.8636115241144835\nSPY,20181112,1990100.0,1998500.0,1937800.0,1941700.0,48980221.0,,\nQQQ,20181112,1703200.0,1706400.0,1661800.0,1663300.0,58429623.0,0.8199327168982804,0.8622936234047096\nSPY,20181113,1917200.0,1971800.0,1914500.0,1922300.0,44755460.0,,\nQQQ,20181113,1671100.0,1694800.0,1660000.0,1664700.0,62013664.0,0.8199904710257084,0.8608960748317952\nSPY,20181114,1938200.0,1944800.0,1859300.0,1868000.0,59011334.0,,\nQQQ,20181114,1681200.0,1687000.0,1642500.0,1652000.0,69916045.0,0.8199164651270233,0.8605046415222452\nSPY,20181115,1884600.0,1919700.0,1869000.0,1914100.0,44357251.0,,\nQQQ,20181115,1649000.0,1685400.0,1634600.0,1680900.0,64836206.0,0.8195845071021629,0.8587765609439726\nSPY,20181116,1905300.0,1949700.0,1894600.0,1935300.0,35358818.0,,\nQQQ,20181116,1664500.0,1683100.0,1657800.0,1675000.0,52984169.0,0.8190177035775709,0.8562412428987829\nSPY,20181119,1900000.0,1907000.0,1849900.0,1858600.0,39345918.0,,\nQQQ,20181119,1667000.0,1669000.0,1615400.0,1620600.0,61634066.0,0.8181481059751631,0.8544021812289139\nSPY,20181120,1780500.0,1814800.0,1755100.0,1769800.0,64410698.0,,\nQQQ,20181120,1583700.0,1613800.0,1571200.0,1591600.0,95765718.0,0.8179335981830385,0.8534790885008368\nSPY,20181121,1795600.0,1802700.0,1765500.0,1767800.0,28809177.0,,\nQQQ,20181121,1613500.0,1619700.0,1601100.0,1603700.0,39161372.0,0.8181384915947536,0.8537959095224554\nSPY,20181123,1749600.0,1765800.0,1721000.0,1722900.0,22727552.0,,\nQQQ,20181123,1591300.0,1608400.0,1590900.0,1592100.0,19440370.0,0.8190122449742289,0.8546899719423966\nSPY,20181126,1741800.0,1749500.0,1702600.0,1746200.0,42322672.0,,\nQQQ,20181126,1614600.0,1629700.0,1607600.0,1628900.0,37670928.0,0.8196097722894632,0.8557881596327596\nSPY,20181127,1714800.0,1747700.0,1708800.0,1742400.0,38404632.0,,\nQQQ,20181127,1620400.0,1638500.0,1611800.0,1634400.0,35179662.0,0.8200590471561463,0.8564071790512605\nSPY,20181128,1767400.0,1812900.0,1749300.0,1809400.0,44160354.0,,\nQQQ,20181128,1646600.0,1687000.0,1637100.0,1687000.0,65556617.0,0.8197852351566655,0.8567755268701516\nSPY,20181129,1827300.0,1828000.0,1777000.0,1795500.0,39761060.0,,\nQQQ,20181129,1679900.0,1692600.0,1668200.0,1681500.0,40641640.0,0.8194318830251923,0.8564133385779816\nSPY,20181130,1803300.0,1803300.0,1770300.0,1785800.0,34349738.0,,\nQQQ,20181130,1684100.0,1694700.0,1675400.0,1693700.0,32157445.0,0.8190042217447965,0.8564041795624998\nSPY,20181203,1844500.0,1849400.0,1812100.0,1848200.0,37497639.0,,\nQQQ,20181203,1731100.0,1733100.0,1710300.0,1723300.0,46778837.0,0.8184874173026261,0.8554814619435231\nSPY,20181204,1810000.0,1823800.0,1762700.0,1766900.0,39089374.0,,\nQQQ,20181204,1714300.0,1719100.0,1655200.0,1657200.0,63579527.0,0.818831326881925,0.8554893356005725\nSPY,20181206,1717400.0,1747800.0,1704200.0,1747200.0,40585440.0,,\nQQQ,20181206,1623800.0,1669100.0,1617700.0,1668900.0,66954926.0,0.8189276801131328,0.8547248409946835\nSPY,20181207,1734500.0,1744900.0,1683000.0,1684900.0,40013532.0,,\nQQQ,20181207,1661600.0,1671200.0,1608600.0,1613800.0,75527503.0,0.8195492932088589,0.8543802747647607\nSPY,20181210,1650000.0,1700900.0,1633300.0,1696000.0,58438527.0,,\nQQQ,20181210,1610800.0,1637800.0,1594100.0,1630700.0,68065748.0,0.8199172749107192,0.853914229254648\nSPY,20181211,1716900.0,1717900.0,1670000.0,1686300.0,43484675.0,,\nQQQ,20181211,1657300.0,1657700.0,1622300.0,1636100.0,52460716.0,0.820079904895408,0.8531639822186577\nSPY,20181212,1704000.0,1719100.0,1690200.0,1691000.0,32813045.0,,\nQQQ,20181212,1660000.0,1676000.0,1649600.0,1650500.0,46326965.0,0.8203597024360386,0.8528593190940491\nSPY,20181213,1704400.0,1725600.0,1695500.0,1709500.0,31080738.0,,\nQQQ,20181213,1661300.0,1668100.0,1640300.0,1651000.0,44378354.0,0.8206044804491992,0.8526039875961527\nSPY,20181214,1690000.0,1693000.0,1652800.0,1654800.0,39498528.0,,\nQQQ,20181214,1632100.0,1638100.0,1607000.0,1610800.0,49409065.0,0.8216114090526087,0.8531971365384021\nSPY,20181217,1654200.0,1683500.0,1627300.0,1639400.0,41779997.0,,\nQQQ,20181217,1603900.0,1616600.0,1561700.0,1574300.0,70668559.0,0.8230407160183358,0.8543684369780904\nSPY,20181218,1654900.0,1675300.0,1643900.0,1660700.0,32370476.0,,\nQQQ,20181218,1586500.0,1599500.0,1570400.0,1584200.0,58081477.0,0.8241765110725376,0.8555183660589241\nSPY,20181219,1660000.0,1674500.0,1590900.0,1608900.0,46221126.0,,\nQQQ,20181219,1581800.0,1607300.0,1533400.0,1545300.0,74373454.0,0.8259984410577816,0.8577372380186153\nSPY,20181220,1601900.0,1621000.0,1553000.0,1568300.0,62736123.0,,\nQQQ,20181220,1541500.0,1558700.0,1503900.0,1522900.0,94250074.0,0.8281507492312844,0.8596801569937962\nSPY,20181221,1558500.0,1581600.0,1496300.0,1507300.0,87909043.0,,\nQQQ,20181221,1530500.0,1540900.0,1467100.0,1475700.0,129074071.0,0.830899229646693,0.8615801717323376\nSPY,20181224,1481500.0,1515500.0,1466000.0,1468300.0,35943663.0,,\nQQQ,20181224,1460800.0,1479800.0,1435000.0,1435000.0,49335610.0,0.8338569237356798,0.8636207867509051\nSPY,20181226,1482000.0,1572300.0,1467200.0,1571700.0,55871647.0,,\nQQQ,20181226,1450800.0,1524800.0,1440900.0,1524600.0,92989917.0,0.8359545612774957,0.8656443162332468\nSPY,20181227,1561300.0,1567700.0,1500700.0,1561500.0,49673892.0,,\nQQQ,20181227,1503700.0,1531700.0,1470900.0,1530500.0,78590106.0,0.8376230601453245,0.8666180249724798\nSPY,20181228,1574800.0,1585200.0,1545500.0,1562300.0,39967793.0,,\nQQQ,20181228,1541500.0,1555900.0,1517200.0,1529700.0,71489790.0,0.8392601970535869,0.8675632385772569\nSPY,20181231,1585300.0,1593600.0,1564800.0,1577400.0,32904170.0,,\nQQQ,20181231,1544000.0,1549800.0,1527100.0,1542600.0,47505014.0,0.8407662063028161,0.8685639427070271\nSPY,20190102,1548000.0,1588500.0,1542400.0,1579200.0,30451305.0,,\nQQQ,20190102,1509900.0,1557500.0,1508800.0,1548800.0,51536023.0,0.8421349054240805,0.8694446673232991\nSPY,20190103,1440100.0,1457500.0,1420000.0,1421900.0,87179424.0,,\nQQQ,20190103,1526000.0,1532600.0,1494900.0,1498200.0,69404288.0,0.8451783626239915,0.8705661008385267\nSPY,20190104,1445000.0,1485400.0,1438000.0,1482600.0,55892106.0,,\nQQQ,20190104,1523400.0,1570000.0,1517300.0,1562300.0,67039114.0,0.8464885927436936,0.8715060653395884\nSPY,20190107,1487000.0,1488300.0,1459000.0,1479300.0,53268908.0,,\nQQQ,20190107,1566200.0,1588600.0,1561100.0,1580900.0,47861136.0,0.8472642335765292,0.8723856651479214\nSPY,20190108,1497400.0,1518200.0,1485200.0,1507500.0,39034603.0,,\nQQQ,20190108,1595400.0,1601000.0,1572000.0,1595200.0,46488474.0,0.8477562310936306,0.8731379979736095\nSPY,20190109,1514000.0,1545300.0,1496300.0,1533100.0,43288070.0,,\nQQQ,20190109,1601400.0,1615200.0,1594700.0,1608200.0,42344592.0,0.8479097974241555,0.873457068432503\nSPY,20190110,1523200.0,1539700.0,1508600.0,1538000.0,35652756.0,,\nQQQ,20190110,1596000.0,1613700.0,1587000.0,1612800.0,35692946.0,0.8479562096216587,0.8736524100412968\nSPY,20190111,1529100.0,1537000.0,1515100.0,1522900.0,25399628.0,,\nQQQ,20190111,1603300.0,1608600.0,1597900.0,1606900.0,26703439.0,0.8481369434736626,0.8739527337047207\nSPY,20190114,1508500.0,1512700.0,1492200.0,1500000.0,30366113.0,,\nQQQ,20190114,1593300.0,1599600.0,1585900.0,1592700.0,27932686.0,0.8486934478724287,0.8744753943624145\nSPY,20190115,1502800.0,1533900.0,1500500.0,1530700.0,27851063.0,,\nQQQ,20190115,1600000.0,1626000.0,1599100.0,1623800.0,37634318.0,0.8484214723985828,0.8743644133332342\nSPY,20190116,1530500.0,1558800.0,1530000.0,1549400.0,29486618.0,,\nQQQ,20190116,1626500.0,1637800.0,1623000.0,1623500.0,31433490.0,0.8483127645752764,0.8741214548639474\nSPY,20190117,1542200.0,1576500.0,1532600.0,1558600.0,28844868.0,,\nQQQ,20190117,1618300.0,1643600.0,1615700.0,1636300.0,35227649.0,0.8479159647944968,0.8736779056831354\nSPY,20190118,1576000.0,1578800.0,1559900.0,1568200.0,31796579.0,,\nQQQ,20190118,1647800.0,1660200.0,1638200.0,1652500.0,53513611.0,0.8469986116373514,0.8728954144402322\nSPY,20190122,1565900.0,1567300.0,1526200.0,1533000.0,28047236.0,,\nQQQ,20190122,1640600.0,1641400.0,1607600.0,1619400.0,51323876.0,0.8470405090429551,0.8729351576466279\nSPY,20190123,1540300.0,1551400.0,1517000.0,1539200.0,22344193.0,,\nQQQ,20190123,1627700.0,1635100.0,1603200.0,1621500.0,35694193.0,0.8472230136330824,0.872919035402524\nSPY,20190124,1538000.0,1544800.0,1517400.0,1527000.0,23095470.0,,\nQQQ,20190124,1626800.0,1634400.0,1620700.0,1632000.0,29885170.0,0.8471287229534965,0.8726813260359687\nSPY,20190125,1554800.0,1581400.0,1543200.0,1577600.0,32290301.0,,\nQQQ,20190125,1645100.0,1656500.0,1639500.0,1651500.0,33802582.0,0.8467434679815771,0.8726138375722781\nSPY,20190128,1558400.0,1563300.0,1536700.0,1563000.0,24184758.0,,\nQQQ,20190128,1630200.0,1631100.0,1617500.0,1631100.0,29304666.0,0.847157714317496,0.8732594772082528\nSPY,20190129,1562100.0,1581300.0,1541100.0,1546800.0,32559817.0,,\nQQQ,20190129,1632000.0,1632400.0,1609900.0,1615700.0,28156234.0,0.8486824082497361,0.8755529601660101\nSPY,20190130,1632200.0,1661500.0,1602300.0,1652500.0,58281742.0,,\nQQQ,20190130,1634000.0,1662800.0,1628900.0,1656800.0,38435029.0,0.8498385754065719,0.8779780456279644\nSPY,20190131,1661400.0,1690000.0,1645600.0,1664400.0,37741865.0,,\nQQQ,20190131,1667000.0,1689900.0,1664800.0,1681600.0,33302200.0,0.8499660529777138,0.8781432277403998\nSPY,20190201,1670100.0,1689800.0,1659300.0,1665200.0,30521556.0,,\nQQQ,20190201,1673300.0,1686000.0,1669900.0,1674500.0,29537201.0,0.8505261113605536,0.8792204184061476\nSPY,20190204,1674800.0,1716600.0,1672800.0,1712500.0,29741119.0,,\nQQQ,20190204,1674800.0,1695300.0,1673300.0,1695300.0,23620118.0,0.8503871804816021,0.8790361601179588\nSPY,20190205,1729300.0,1750800.0,1723500.0,1741800.0,34820577.0,,\nQQQ,20190205,1697600.0,1712300.0,1696900.0,1710300.0,26425448.0,0.8496916066724975,0.877920351269962\nSPY,20190206,1748000.0,1755700.0,1728600.0,1742400.0,27610319.0,,\nQQQ,20190206,1710700.0,1713800.0,1697500.0,1705200.0,24886080.0,0.8478691460596244,0.8758804899514032\nSPY,20190207,1723200.0,1739400.0,1703400.0,1709400.0,30668812.0,,\nQQQ,20190207,1689400.0,1694400.0,1669500.0,1682300.0,40057925.0,0.8469876454849544,0.8748516660089002\nSPY,20190208,1689900.0,1706600.0,1684200.0,1704100.0,22643786.0,,\nQQQ,20190208,1667600.0,1685600.0,1665800.0,1685600.0,26940223.0,0.8456557514297433,0.8733140541327321\nSPY,20190211,1711000.0,1712100.0,1692500.0,1694300.0,19952918.0,,\nQQQ,20190211,1691700.0,1695800.0,1679800.0,1684000.0,20121553.0,0.8437007338620278,0.8712880641966643\nSPY,20190212,1701000.0,1710000.0,1697000.0,1708900.0,21342247.0,,\nQQQ,20190212,1696300.0,1711400.0,1693300.0,1708900.0,27174863.0,0.8411424602341774,0.8680025008226531\nSPY,20190213,1713200.0,1724800.0,1699200.0,1701800.0,21333941.0,,\nQQQ,20190213,1716500.0,1721600.0,1708200.0,1710100.0,23977737.0,0.8389219665611886,0.8647776770659633\nSPY,20190214,1698500.0,1712700.0,1693900.0,1708000.0,19904136.0,,\nQQQ,20190214,1704000.0,1718300.0,1698300.0,1712200.0,27535626.0,0.8368141596329836,0.8613353904818257\nSPY,20190215,1714700.0,1717000.0,1697500.0,1704200.0,23061402.0,,\nQQQ,20190215,1725200.0,1725300.0,1711400.0,1719400.0,29110477.0,0.8346375833177299,0.8576955126734381\nSPY,20190219,1695500.0,1714400.0,1694300.0,1709300.0,17797528.0,,\nQQQ,20190219,1714100.0,1728000.0,1713800.0,1722800.0,17490039.0,0.8327250693855548,0.8540575095445974\nSPY,20190220,1711000.0,1733200.0,1709900.0,1720300.0,24184631.0,,\nQQQ,20190220,1724000.0,1730800.0,1713200.0,1722500.0,31141890.0,0.8309297509336367,0.8509447916248162\nSPY,20190221,1718000.0,1723700.0,1703100.0,1710600.0,16844199.0,,\nQQQ,20190221,1717900.0,1722600.0,1707100.0,1716200.0,23187005.0,0.8292854659897586,0.8480244158265537\nSPY,20190222,1713800.0,1730000.0,1713800.0,1729700.0,18076934.0,,\nQQQ,20190222,1719900.0,1730100.0,1719000.0,1728900.0,25006408.0,0.8273617129408058,0.8451760277228949\nSPY,20190225,1739900.0,1758700.0,1739400.0,1742300.0,20981451.0,,\nQQQ,20190225,1742100.0,1746600.0,1734000.0,1735200.0,30248457.0,0.8253884184281508,0.8420974289708685\nSPY,20190226,1736200.0,1753000.0,1731600.0,1743300.0,16335773.0,,\nQQQ,20190226,1731000.0,1742500.0,1728100.0,1737000.0,20979120.0,0.8237086313375547,0.8398346907576815\nSPY,20190227,1732300.0,1750000.0,1727300.0,1748700.0,25394202.0,,\nQQQ,20190227,1729000.0,1738000.0,1717600.0,1735900.0,23268086.0,0.822371051386119,0.8381688505122481\nSPY,20190228,1743200.0,1749100.0,1729100.0,1731500.0,24330849.0,,\nQQQ,20190228,1730500.0,1738100.0,1727000.0,1731900.0,23248524.0,0.8206781985179225,0.8355866669042583\nSPY,20190301,1742300.0,1751500.0,1728900.0,1749700.0,24392490.0,,\nQQQ,20190301,1744400.0,1746500.0,1731800.0,1743900.0,29248724.0,0.8187020891901414,0.8331462090700189\nSPY,20190304,1756400.0,1777500.0,1739700.0,1758500.0,25600749.0,,\nQQQ,20190304,1755400.0,1757900.0,1724700.0,1744200.0,36753041.0,0.8167213309889811,0.8308332294449732\nSPY,20190305,1758600.0,1760000.0,1745400.0,1755300.0,18002718.0,,\nQQQ,20190305,1745500.0,1750900.0,1736800.0,1745500.0,20872391.0,0.8147158505278526,0.8283650263534387\nSPY,20190306,1746700.0,1754900.0,1739400.0,1745200.0,19532202.0,,\nQQQ,20190306,1747200.0,1747500.0,1732800.0,1735600.0,25466317.0,0.8131009278222993,0.8262665100685659\nSPY,20190307,1738700.0,1744400.0,1720200.0,1725000.0,23273842.0,,\nQQQ,20190307,1731200.0,1731800.0,1707900.0,1714300.0,37390742.0,0.812102976065834,0.8249561090652372\nSPY,20190308,1703200.0,1730800.0,1695000.0,1729100.0,22428998.0,,\nQQQ,20190308,1695100.0,1712500.0,1693400.0,1711700.0,35843196.0,0.8113667127976196,0.8238939156339268\nSPY,20190311,1754100.0,1791300.0,1753500.0,1789000.0,28592932.0,,\nQQQ,20190311,1718800.0,1748500.0,1718400.0,1747300.0,27970535.0,0.8102504602140782,0.82322465503566\nSPY,20190312,1800000.0,1826700.0,1793700.0,1809100.0,29892421.0,,\nQQQ,20190312,1751900.0,1761400.0,1747800.0,1756900.0,31812656.0,0.809592725673616,0.8226142593751682\nSPY,20190313,1822900.0,1832900.0,1809200.0,1817100.0,29284826.0,,\nQQQ,20190313,1766000.0,1779300.0,1763500.0,1770100.0,41549368.0,0.8086366523588762,0.8219296264046165\nSPY,20190314,1839000.0,1841000.0,1825600.0,1837300.0,22343443.0,,\nQQQ,20190314,1771300.0,1773400.0,1766500.0,1767100.0,21819108.0,0.8077207988693064,0.8208933035510542\nSPY,20190315,1847000.0,1873300.0,1837400.0,1861200.0,37251007.0,,\nQQQ,20190315,1774000.0,1788800.0,1772800.0,1783500.0,35552903.0,0.8067355216081334,0.8201951728877643\nSPY,20190318,1859000.0,1883900.0,1857900.0,1880200.0,24635460.0,,\nQQQ,20190318,1779500.0,1789900.0,1776000.0,1784500.0,31265820.0,0.8059780175634692,0.820233041414613\nSPY,20190319,1884000.0,1889900.0,1859200.0,1865300.0,30220000.0,,\nQQQ,20190319,1791800.0,1800000.0,1782900.0,1790500.0,35154600.0,0.8047113005023276,0.8194818234786985\nSPY,20190320,1862300.0,1894900.0,1847300.0,1881600.0,29792200.0,,\nQQQ,20190320,1790600.0,1808500.0,1782400.0,1797600.0,48359171.0,0.8029822186067417,0.8186269694450246\nSPY,20190321,1900000.0,1963200.0,1898100.0,1950900.0,48452146.0,,\nQQQ,20190321,1792200.0,1828300.0,1791800.0,1825700.0,39599407.0,0.8016447728937791,0.8185328605141245\nSPY,20190322,1952800.0,1976900.0,1907700.0,1910500.0,40784741.0,,\nQQQ,20190322,1817800.0,1822700.0,1783700.0,1785600.0,63081223.0,0.8007882147454154,0.8181676728699149\nSPY,20190325,1915400.0,1919800.0,1866000.0,1887400.0,42198785.0,,\nQQQ,20190325,1779100.0,1788400.0,1769300.0,1782200.0,43505452.0,0.7991996731695221,0.8165218569908961\nSPY,20190326,1916000.0,1928800.0,1845900.0,1867900.0,47668901.0,,\nQQQ,20190326,1796000.0,1806900.0,1781300.0,1790500.0,31204124.0,0.796702232066317,0.8135306997810372\nSPY,20190327,1887100.0,1897600.0,1865400.0,1884700.0,28993216.0,,\nQQQ,20190327,1793200.0,1797200.0,1766000.0,1779000.0,35311283.0,0.795387605396765,0.812102942499775\nSPY,20190328,1889400.0,1895600.0,1875300.0,1887200.0,20234083.0,,\nQQQ,20190328,1783800.0,1789800.0,1772400.0,1783100.0,28929492.0,0.7937588942563939,0.8102788775908096\nSPY,20190329,1898500.0,1900800.0,1885400.0,1899500.0,22013390.0,,\nQQQ,20190329,1796900.0,1798300.0,1786000.0,1796600.0,30546067.0,0.7918554695500953,0.8082294759890819\nSPY,20190401,1915700.0,1916800.0,1883800.0,1912400.0,25425424.0,,\nQQQ,20190401,1815100.0,1822600.0,1807700.0,1820400.0,29488047.0,0.7893016819621216,0.8058051381265185\nSPY,20190402,1910500.0,1944600.0,1910500.0,1940200.0,21057211.0,,\nQQQ,20190402,1822400.0,1829100.0,1817800.0,1827300.0,21129929.0,0.7874256290909466,0.8039881970065089\nSPY,20190403,1932500.0,1965000.0,1931500.0,1953500.0,21671194.0,,\nQQQ,20190403,1837600.0,1849200.0,1832100.0,1837800.0,30133176.0,0.7854376705846186,0.8020778967575514\nSPY,20190404,1948000.0,1963700.0,1931400.0,1956900.0,18756603.0,,\nQQQ,20190404,1838300.0,1845000.0,1826500.0,1837100.0,27789757.0,0.7836750799797222,0.8008253848393511\nSPY,20190405,1964100.0,1971000.0,1959300.0,1970000.0,17154104.0,,\nQQQ,20190405,1842400.0,1847600.0,1840200.0,1846600.0,23644875.0,0.7819132280302875,0.7994132247518483\nSPY,20190408,1964200.0,2002300.0,1963300.0,2001000.0,24768724.0,,\nQQQ,20190408,1843600.0,1852800.0,1836300.0,1851300.0,20744290.0,0.7805865603008443,0.7970323794955417\nSPY,20190409,2003200.0,2028500.0,1992300.0,1995000.0,34653266.0,,\nQQQ,20190409,1845000.0,1851100.0,1840900.0,1844800.0,24699718.0,0.7794298862814025,0.7948701220793024\nSPY,20190410,1987700.0,2007400.0,1981800.0,2006200.0,20754302.0,,\nQQQ,20190410,1847200.0,1855200.0,1845200.0,1854700.0,23262552.0,0.7781809502185397,0.7933362578362236\nSPY,20190411,2007400.0,2010000.0,1984500.0,1989500.0,19339690.0,,\nQQQ,20190411,1857800.0,1857800.0,1846900.0,1850300.0,18505271.0,0.7767367634835097,0.7915069438196063\nSPY,20190412,1991400.0,2001400.0,1962100.0,1988700.0,26689186.0,,\nQQQ,20190412,1858500.0,1859500.0,1850700.0,1858300.0,22223740.0,0.7750282109661271,0.7895041823211646\nSPY,20190415,1985300.0,1998400.0,1980100.0,1992300.0,16318763.0,,\nQQQ,20190415,1858400.0,1860700.0,1846200.0,1858600.0,20123121.0,0.7735715661943604,0.7879047039325879\nSPY,20190416,1993200.0,2013700.0,1985600.0,1992500.0,25195764.0,,\nQQQ,20190416,1865400.0,1869100.0,1859300.0,1865000.0,24893990.0,0.7719092131943527,0.7859602841193774\nSPY,20190417,1992800.0,2034600.0,1986100.0,2031300.0,29206623.0,,\nQQQ,20190417,1877500.0,1879300.0,1866000.0,1871500.0,27750109.0,0.7709249214127786,0.7839959926806169\nSPY,20190418,2034500.0,2041500.0,2025200.0,2038600.0,23419730.0,,\nQQQ,20190418,1874600.0,1875200.0,1862900.0,1873900.0,25593845.0,0.7700240268966071,0.7821471816318428\nSPY,20190422,2026600.0,2049400.0,2023300.0,2045300.0,16941460.0,,\nQQQ,20190422,1865700.0,1879900.0,1864300.0,1879200.0,13731861.0,0.7688362426665148,0.7796178611420781\nSPY,20190423,2044300.0,2077500.0,2039000.0,2074800.0,22404497.0,,\nQQQ,20190423,1884000.0,1905400.0,1881200.0,1903100.0,31631498.0,0.7670601306751085,0.7766815053997012\nSPY,20190424,2072500.0,2084800.0,2070500.0,2071600.0,16379009.0,,\nQQQ,20190424,1904700.0,1907100.0,1896500.0,1897100.0,21734340.0,0.7653256442823865,0.77352604064541\nSPY,20190425,2066600.0,2077600.0,2051200.0,2052800.0,17045102.0,,\nQQQ,20190425,1911300.0,1912200.0,1894500.0,1904800.0,26548184.0,0.7624842161015277,0.7702052289380956\nSPY,20190426,2048600.0,2050000.0,2021200.0,2043000.0,18079176.0,,\nQQQ,20190426,1901800.0,1906900.0,1885900.0,1906500.0,23822356.0,0.7594074749080917,0.766704447758103\nSPY,20190429,2043100.0,2059700.0,2038600.0,2046100.0,20616417.0,,\nQQQ,20190429,1906500.0,1913200.0,1903400.0,1910200.0,19023392.0,0.7565675571581607,0.7633063991520974\nSPY,20190430,2030000.0,2033900.0,1991100.0,2006700.0,37897524.0,,\nQQQ,20190430,1894800.0,1898500.0,1882100.0,1895400.0,28317401.0,0.7531555594458949,0.7594857972216997\nSPY,20190501,2102000.0,2153100.0,2092300.0,2105200.0,60920449.0,,\nQQQ,20190501,1907800.0,1913200.0,1888000.0,1889300.0,32651807.0,0.7521818075500204,0.7566325312069472\nSPY,20190502,2096500.0,2126500.0,2081300.0,2091500.0,29773353.0,,\nQQQ,20190502,1888700.0,1898500.0,1868700.0,1881100.0,42131444.0,0.7514985299618245,0.753613402024288\nSPY,20190503,2107800.0,2118400.0,2102300.0,2117500.0,19914692.0,,\nQQQ,20190503,1896700.0,1912500.0,1893300.0,1911100.0,27017721.0,0.751648757023935,0.7522193887451677\nSPY,20190506,2041600.0,2088400.0,2035000.0,2084800.0,30671387.0,,\nQQQ,20190506,1870500.0,1902000.0,1867600.0,1899400.0,34743766.0,0.7513844771342916,0.750311337756076\nSPY,20190507,2058600.0,2074000.0,2008300.0,2028600.0,37611128.0,,\nQQQ,20190507,1878700.0,1886700.0,1845100.0,1862400.0,54326767.0,0.7513505982867398,0.7481044625110781\nSPY,20190508,2019000.0,2053400.0,2017600.0,2029000.0,25065553.0,,\nQQQ,20190508,1856300.0,1871700.0,1849600.0,1857700.0,32449463.0,0.7513774717478666,0.7463587589533632\nSPY,20190509,2004900.0,2016800.0,1966700.0,2007200.0,33971701.0,,\nQQQ,20190509,1837000.0,1854100.0,1820900.0,1847700.0,52171029.0,0.7513874313001441,0.7446138052683107\nSPY,20190510,1974700.0,1988500.0,1927600.0,1971800.0,37862697.0,,\nQQQ,20190510,1841100.0,1858900.0,1810400.0,1850000.0,54954515.0,0.7506354640160987,0.7433521445140773\nSPY,20190513,1874800.0,1894800.0,1828500.0,1857200.0,54536180.0,,\nQQQ,20190513,1802900.0,1812600.0,1780600.0,1785800.0,60429485.0,0.7498843320600177,0.742428301394187\nSPY,20190514,1863300.0,1897100.0,1854100.0,1886600.0,34254031.0,,\nQQQ,20190514,1795200.0,1816300.0,1788600.0,1805400.0,38580449.0,0.7489141761191288,0.7414144735548267\nSPY,20190515,1862700.0,1917500.0,1860100.0,1909200.0,25174109.0,,\nQQQ,20190515,1793500.0,1835500.0,1793100.0,1830900.0,37705489.0,0.7475087692178105,0.7395613995622824\nSPY,20190516,1898800.0,1924800.0,1888400.0,1900800.0,31423655.0,,\nQQQ,20190516,1831700.0,1860800.0,1829500.0,1849300.0,36142804.0,0.7453543506869809,0.7358540298151384\nSPY,20190517,1870400.0,1909000.0,1867600.0,1890000.0,31183123.0,,\nQQQ,20190517,1831000.0,1855900.0,1828800.0,1830400.0,39804299.0,0.7437470662130075,0.7334154443746627\nSPY,20190520,1835000.0,1843400.0,1802900.0,1830900.0,35753103.0,,\nQQQ,20190520,1804900.0,1811800.0,1793400.0,1799500.0,35994540.0,0.7421825455468201,0.7304710699183193\nSPY,20190521,1850500.0,1880000.0,1847000.0,1866000.0,26468911.0,,\nQQQ,20190521,1815000.0,1823300.0,1809200.0,1818300.0,29307875.0,0.7406205470579327,0.7268758061131652\nSPY,20190522,1846600.0,1857100.0,1825500.0,1827800.0,28925399.0,,\nQQQ,20190522,1808200.0,1820700.0,1807600.0,1810200.0,22060482.0,0.7387058451424984,0.7233951371902039\nSPY,20190523,1797200.0,1805400.0,1778100.0,1796600.0,35226162.0,,\nQQQ,20190523,1789400.0,1790200.0,1771400.0,1782500.0,44194819.0,0.7373354738296649,0.7218069074870462\nSPY,20190524,1802000.0,1821400.0,1786200.0,1789700.0,22837599.0,,\nQQQ,20190524,1792100.0,1798500.0,1779400.0,1781600.0,22589441.0,0.7358631453140464,0.7204401300128997\nSPY,20190528,1789000.0,1805900.0,1779200.0,1782300.0,26276760.0,,\nQQQ,20190528,1786600.0,1796600.0,1774700.0,1774900.0,23392868.0,0.7345435462646087,0.7190528663679432\nSPY,20190529,1764400.0,1793500.0,1760000.0,1773800.0,27586624.0,,\nQQQ,20190529,1763900.0,1770000.0,1750900.0,1760300.0,39572794.0,0.7336597686094519,0.7184818386567895\nSPY,20190530,1779500.0,1792300.0,1766700.0,1783000.0,20656632.0,,\nQQQ,20190530,1765000.0,1772700.0,1757700.0,1767700.0,28350773.0,0.7326929032263507,0.7175538717591495\nSPY,20190531,1760000.0,1779900.0,1749900.0,1750700.0,25064310.0,,\nQQQ,20190531,1746900.0,1752900.0,1738800.0,1739500.0,40117278.0,0.7321453477330669,0.717536999633738\nSPY,20190603,1754400.0,1779200.0,1702700.0,1733000.0,39113826.0,,\nQQQ,20190603,1734800.0,1739500.0,1692700.0,1701200.0,71017154.0,0.7324461277554619,0.7187360453463247\nSPY,20190604,1754300.0,1798400.0,1745200.0,1796400.0,29218482.0,,\nQQQ,20190604,1720300.0,1749700.0,1713700.0,1749100.0,43072748.0,0.7320138172591121,0.7190889950417702\nSPY,20190605,1843900.0,1849900.0,1811400.0,1825400.0,28097747.0,,\nQQQ,20190605,1765800.0,1766100.0,1743800.0,1762100.0,30828347.0,0.7314992464946755,0.7197905006542838\nSPY,20190606,1830000.0,1854700.0,1821500.0,1852200.0,19838791.0,,\nQQQ,20190606,1765100.0,1780400.0,1757400.0,1776100.0,27751893.0,0.7309214429686324,0.7202269263800807\nSPY,20190607,1866300.0,1919200.0,1857700.0,1901500.0,29612392.0,,\nQQQ,20190607,1785600.0,1817600.0,1783300.0,1810400.0,42141936.0,0.7301080437366219,0.7198444914657226\nSPY,20190610,1920000.0,1953700.0,1916100.0,1925800.0,25047727.0,,\nQQQ,20190610,1822500.0,1848500.0,1822100.0,1831500.0,38783273.0,0.7291931524786328,0.7198351180609589\nSPY,20190611,1949300.0,1960000.0,1936000.0,1948100.0,24003333.0,,\nQQQ,20190611,1850600.0,1854000.0,1827700.0,1834000.0,36934648.0,0.7285419836006218,0.7199914664524171\nSPY,20190612,1939900.0,1959700.0,1933700.0,1941900.0,17215817.0,,\nQQQ,20190612,1829000.0,1832800.0,1820000.0,1823400.0,25812738.0,0.7280210064530596,0.7201049371213887\nSPY,20190613,1947300.0,1968000.0,1936000.0,1941500.0,19529750.0,,\nQQQ,20190613,1831000.0,1838700.0,1827400.0,1834200.0,21717303.0,0.7272764657575738,0.7197116291312374\nSPY,20190614,1914900.0,1935800.0,1903000.0,1927400.0,17078239.0,,\nQQQ,20190614,1824800.0,1831100.0,1819400.0,1826400.0,20519150.0,0.7265347827943647,0.719025121095044\nSPY,20190617,1928600.0,1949600.0,1921700.0,1938900.0,13922065.0,,\nQQQ,20190617,1830400.0,1842500.0,1828400.0,1837400.0,19397014.0,0.7258341747873645,0.7180199173566308\nSPY,20190618,1960000.0,2002900.0,1952100.0,1984500.0,25386223.0,,\nQQQ,20190618,1859100.0,1877200.0,1854300.0,1864100.0,43883008.0,0.7253195229613307,0.7159890226183264\nSPY,20190619,1996700.0,1998900.0,1973100.0,1978700.0,19989153.0,,\nQQQ,20190619,1866600.0,1875300.0,1855700.0,1871100.0,30558353.0,0.7244853699861126,0.7137797647727775\nSPY,20190620,2002200.0,2006000.0,1980300.0,1994600.0,20517172.0,,\nQQQ,20190620,1897200.0,1897600.0,1874500.0,1888500.0,36957899.0,0.7236041825019727,0.7114435378074461\nSPY,20190621,1988000.0,2008500.0,1981400.0,1987800.0,41263981.0,,\nQQQ,20190621,1886300.0,1897700.0,1881800.0,1885700.0,34571622.0,0.72281247498058,0.7090716919106901\nSPY,20190624,1985400.0,2001600.0,1981700.0,1985800.0,17357165.0,,\nQQQ,20190624,1885300.0,1887200.0,1880600.0,1881600.0,17994745.0,0.7219408117094235,0.7066008628781858\nSPY,20190625,1984300.0,1992900.0,1952900.0,1955700.0,21313820.0,,\nQQQ,20190625,1880300.0,1881400.0,1846500.0,1849300.0,32580001.0,0.7213051281834557,0.7047566842221135\nSPY,20190626,1977700.0,2009900.0,1973400.0,1998000.0,25253435.0,,\nQQQ,20190626,1861600.0,1873300.0,1854900.0,1857900.0,19491445.0,0.7208238597573109,0.7019935360993073\nSPY,20190627,2001900.0,2015700.0,1995700.0,1997400.0,16997615.0,,\nQQQ,20190627,1864600.0,1869400.0,1860000.0,1865000.0,17743833.0,0.7202808533029891,0.6991509004383213\nSPY,20190628,1986100.0,1994900.0,1970500.0,1979200.0,27712001.0,,\nQQQ,20190628,1869300.0,1871500.0,1860700.0,1867400.0,19321818.0,0.719362034352423,0.6958763369771229\nSPY,20190701,2031000.0,2044900.0,2006500.0,2015500.0,25670964.0,,\nQQQ,20190701,1903200.0,1905700.0,1883800.0,1892600.0,28837907.0,0.7186003000537277,0.6928134815139774\nSPY,20190702,2014600.0,2031300.0,2013600.0,2027300.0,16587660.0,,\nQQQ,20190702,1892000.0,1900300.0,1886500.0,1900100.0,17109901.0,0.7179057569707948,0.6897063835554651\nSPY,20190703,2031300.0,2044400.0,2027000.0,2044100.0,10760409.0,,\nQQQ,20190703,1904900.0,1914400.0,1902900.0,1914400.0,14307879.0,0.7173217218258574,0.6870360865045994\nSPY,20190705,2029000.0,2050800.0,2029000.0,2042300.0,16516244.0,,\nQQQ,20190705,1901300.0,1914000.0,1893900.0,1910500.0,18644892.0,0.7166861392167078,0.6840028510171654\nSPY,20190708,2007800.0,2014000.0,1984100.0,2000200.0,23775835.0,,\nQQQ,20190708,1898100.0,1898800.0,1889300.0,1897100.0,16851074.0,0.7155877686866144,0.6805861831795563\nSPY,20190709,1990500.0,2015100.0,1988100.0,2012400.0,18952251.0,,\nQQQ,20190709,1888100.0,1909000.0,1886500.0,1906600.0,17897528.0,0.7146667449541032,0.6776043134201095\nSPY,20190710,2018500.0,2037300.0,2015600.0,2032300.0,16985391.0,,\nQQQ,20190710,1918200.0,1930900.0,1914700.0,1925600.0,25459850.0,0.7137578973429537,0.675095238551479\nSPY,20190711,2031500.0,2043900.0,2017100.0,2017500.0,17716133.0,,\nQQQ,20190711,1928500.0,1933400.0,1918100.0,1924200.0,21016895.0,0.712577168785794,0.6725959120311127\nSPY,20190712,2024400.0,2040000.0,2022000.0,2033000.0,16951805.0,,\nQQQ,20190712,1926300.0,1935400.0,1924600.0,1935300.0,17235862.0,0.7115067028751174,0.6696710326153646\nSPY,20190715,2040600.0,2058700.0,2040000.0,2052100.0,15841588.0,,\nQQQ,20190715,1939800.0,1941900.0,1934400.0,1941500.0,14462032.0,0.7109379753013567,0.6675068993007001\nSPY,20190716,2045900.0,2061100.0,2035000.0,2045000.0,15428190.0,,\nQQQ,20190716,1939100.0,1940900.0,1925600.0,1931500.0,18367842.0,0.7104761725003157,0.6653322677648278\nSPY,20190717,2040500.0,2050900.0,2032700.0,2033500.0,12894336.0,,\nQQQ,20190717,1931500.0,1934900.0,1921800.0,1922000.0,14367120.0,0.7099808779319831,0.6626409737709501\nSPY,20190718,2039100.0,2058800.0,2037000.0,2056600.0,16631100.0,,\nQQQ,20190718,1912900.0,1927900.0,1906900.0,1924200.0,27032737.0,0.7100427695636606,0.6607086750579075\nSPY,20190719,2060000.0,2065000.0,2023600.0,2025900.0,19557061.0,,\nQQQ,20190719,1937400.0,1938300.0,1908100.0,1910100.0,26118257.0,0.7098061825696889,0.6583308275086011\nSPY,20190722,2038100.0,2072300.0,2036100.0,2072200.0,21090062.0,,\nQQQ,20190722,1914400.0,1929400.0,1914400.0,1925300.0,16914364.0,0.7100216339116326,0.6557981311674523\nSPY,20190723,2084600.0,2089100.0,2073000.0,2088400.0,17244346.0,,\nQQQ,20190723,1935800.0,1938100.0,1922900.0,1937900.0,17741243.0,0.7103775779613003,0.653832338877794\nSPY,20190724,2077000.0,2091500.0,2071800.0,2086700.0,14426025.0,,\nQQQ,20190724,1930500.0,1951600.0,1930300.0,1951500.0,17824133.0,0.7104898608491336,0.6520007738701683\nSPY,20190725,2088300.0,2092400.0,2067300.0,2070200.0,13227412.0,,\nQQQ,20190725,1944900.0,1945200.0,1929300.0,1933000.0,20193300.0,0.7105936278451379,0.6498220176246591\nSPY,20190726,2074500.0,2097300.0,2071400.0,2077400.0,17068566.0,,\nQQQ,20190726,1945300.0,1955500.0,1944300.0,1952900.0,17791758.0,0.7105956135305259,0.6490616463175014\nSPY,20190729,2084600.0,2106400.0,2084100.0,2096800.0,20726142.0,,\nQQQ,20190729,1951100.0,1951800.0,1933900.0,1946200.0,19023985.0,0.7109515649163712,0.6475701487534615\nSPY,20190730,2087400.0,2106600.0,2073100.0,2087800.0,25813791.0,,\nQQQ,20190730,1931300.0,1945400.0,1929900.0,1937800.0,16274996.0,0.7112409548856052,0.6455316187746569\nSPY,20190731,2163500.0,2213700.0,2113000.0,2130400.0,66545065.0,,\nQQQ,20190731,1943000.0,1944300.0,1893200.0,1911000.0,38087747.0,0.7123615023632773,0.6436089441873274\nSPY,20190801,2140200.0,2180300.0,2067300.0,2084300.0,53417109.0,,\nQQQ,20190801,1914300.0,1949800.0,1892300.0,1901500.0,58757033.0,0.7129400047091629,0.6409566430892836\nSPY,20190802,2052600.0,2064300.0,2016300.0,2040200.0,37596689.0,,\nQQQ,20190802,1887200.0,1889900.0,1862100.0,1873500.0,49202220.0,0.7133325266670425,0.6395832505359708\nSPY,20190805,1979800.0,1986500.0,1925800.0,1933400.0,49704015.0,,\nQQQ,20190805,1834300.0,1835100.0,1792100.0,1807300.0,67590576.0,0.713214533546135,0.642133193958051\nSPY,20190806,1964500.0,1980700.0,1940400.0,1970000.0,33878295.0,,\nQQQ,20190806,1824000.0,1838000.0,1810800.0,1832600.0,38954290.0,0.7130730638276147,0.6437882845440608\nSPY,20190807,1954000.0,1995600.0,1938200.0,1990400.0,32066903.0,,\nQQQ,20190807,1812700.0,1845100.0,1798900.0,1842500.0,44179383.0,0.712884886745952,0.6451984211428441\nSPY,20190808,2004200.0,2035300.0,1993900.0,2034300.0,25802533.0,,\nQQQ,20190808,1850800.0,1883200.0,1845700.0,1882600.0,35522550.0,0.7127068168779889,0.6452141684805598\nSPY,20190809,2012300.0,2027600.0,1992900.0,2009900.0,23591110.0,,\nQQQ,20190809,1873600.0,1880000.0,1850300.0,1864900.0,31554795.0,0.7123916339113296,0.6455321147277728\nSPY,20190812,1994400.0,2020600.0,1991500.0,2004800.0,21678415.0,,\nQQQ,20190812,1853400.0,1859000.0,1835100.0,1843500.0,22477823.0,0.7122190490034028,0.6468725131166722\nSPY,20190813,2010200.0,2121400.0,2008300.0,2089700.0,46000668.0,,\nQQQ,20190813,1841900.0,1896800.0,1840100.0,1883900.0,37689505.0,0.7128734324897421,0.6475447744624893\nSPY,20190814,2031100.0,2064400.0,2025000.0,2027500.0,33845211.0,,\nQQQ,20190814,1853600.0,1859500.0,1820100.0,1827600.0,46121089.0,0.7131366369522767,0.649186246951049\nSPY,20190815,2033800.0,2051500.0,1996700.0,2017400.0,25991513.0,,\nQQQ,20190815,1830000.0,1835900.0,1811600.0,1825500.0,33464974.0,0.7131825694414795,0.6510718031742028\nSPY,20190816,2043600.0,2071600.0,2038500.0,2065000.0,26376612.0,,\nQQQ,20190816,1842100.0,1859500.0,1841000.0,1854800.0,28569490.0,0.714018672868795,0.6526236658124277\nSPY,20190819,2105900.0,2127300.0,2100400.0,2103500.0,23121339.0,,\nQQQ,20190819,1881600.0,1888300.0,1875000.0,1884300.0,20129768.0,0.7152833738777029,0.6542760114627435\nSPY,20190820,2108900.0,2133500.0,2103200.0,2103600.0,22806812.0,,\nQQQ,20190820,1879600.0,1886400.0,1869500.0,1869700.0,18657174.0,0.7168770650164649,0.6555271749379203\nSPY,20190821,2128700.0,2136500.0,2116100.0,2126400.0,20374054.0,,\nQQQ,20190821,1886100.0,1892300.0,1879600.0,1886300.0,18359394.0,0.7185765546519115,0.6574704713993651\nSPY,20190822,2133000.0,2144300.0,2107500.0,2124600.0,21585112.0,,\nQQQ,20190822,1889800.0,1894600.0,1865400.0,1880200.0,23071644.0,0.7199956507196974,0.659251795244305\nSPY,20190823,2094300.0,2120500.0,2010000.0,2026400.0,44029832.0,,\nQQQ,20190823,1867400.0,1884500.0,1815600.0,1820700.0,49924672.0,0.7204601711249333,0.6614534230316104\nSPY,20190826,2059700.0,2071900.0,2050600.0,2064900.0,24544286.0,,\nQQQ,20190826,1841400.0,1848700.0,1830900.0,1848200.0,24232347.0,0.7213019654337037,0.662916425692725\nSPY,20190827,2079200.0,2085500.0,2035400.0,2041600.0,23816371.0,,\nQQQ,20190827,1861100.0,1864200.0,1837100.0,1844300.0,26262643.0,0.7216032535015092,0.6644116729024958\nSPY,20190828,2041700.0,2057200.0,2033300.0,2055300.0,14983320.0,,\nQQQ,20190828,1838300.0,1854000.0,1829200.0,1850900.0,19959085.0,0.7215969654581644,0.6647101224458704\nSPY,20190829,2085000.0,2093200.0,2066500.0,2090100.0,20221028.0,,\nQQQ,20190829,1873900.0,1884600.0,1866700.0,1879200.0,23300786.0,0.721897880187606,0.6646611303527798\nSPY,20190830,2100000.0,2104500.0,2072000.0,2087400.0,19329251.0,,\nQQQ,20190830,1889300.0,1889700.0,1864200.0,1874700.0,24080848.0,0.721696306247296,0.6629036778479076\nSPY,20190903,2066700.0,2069800.0,2042200.0,2057000.0,18937497.0,,\nQQQ,20190903,1862200.0,1877000.0,1850300.0,1856500.0,25662692.0,0.7214409595140603,0.6611972173717037\nSPY,20190904,2083900.0,2094800.0,2073100.0,2091900.0,18690378.0,,\nQQQ,20190904,1874400.0,1884900.0,1869000.0,1883300.0,19594427.0,0.7215726458591286,0.6591916818085954\nSPY,20190905,2120000.0,2139600.0,2115100.0,2132800.0,22262812.0,,\nQQQ,20190905,1904100.0,1923200.0,1903300.0,1917800.0,31241898.0,0.7225687685841029,0.6584545565670418\nSPY,20190906,2140700.0,2144200.0,2125100.0,2132600.0,18686623.0,,\nQQQ,20190906,1921000.0,1921700.0,1911700.0,1915900.0,17211972.0,0.7244891419747592,0.6596414819973331\nSPY,20190909,2147700.0,2164400.0,2110700.0,2141700.0,25735935.0,,\nQQQ,20190909,1921900.0,1922700.0,1902200.0,1911900.0,23060214.0,0.7267925817398446,0.6623755187489849\nSPY,20190910,2138600.0,2167800.0,2117100.0,2167000.0,29786065.0,,\nQQQ,20190910,1901600.0,1907400.0,1889100.0,1906400.0,22283912.0,0.7293540841542117,0.6657237014412847\nSPY,20190911,2180000.0,2236400.0,2177300.0,2235900.0,42429827.0,,\nQQQ,20190911,1910000.0,1925300.0,1905600.0,1924300.0,21915341.0,0.7320152638032527,0.6713653705309864\nSPY,20190912,2248000.0,2264200.0,2228600.0,2230900.0,29902917.0,,\nQQQ,20190912,1936100.0,1947100.0,1929600.0,1932300.0,25912875.0,0.7348245820345118,0.6760082088600736\nSPY,20190913,2198100.0,2207900.0,2170200.0,2187500.0,37753560.0,,\nQQQ,20190913,1930000.0,1934000.0,1922900.0,1925400.0,24713148.0,0.7371485007200607,0.6797984416525102\nSPY,20190916,2176400.0,2201300.0,2175600.0,2199000.0,20302149.0,,\nQQQ,20190916,1912300.0,1920700.0,1911100.0,1916800.0,18829434.0,0.7392751243730192,0.6823690061025\nSPY,20190917,2199600.0,2208200.0,2191200.0,2207000.0,17281680.0,,\nQQQ,20190917,1916900.0,1926000.0,1912900.0,1926000.0,19428537.0,0.7415322514455198,0.6857734292655552\nSPY,20190918,2210100.0,2228500.0,2194500.0,2227700.0,24215116.0,,\nQQQ,20190918,1922100.0,1926000.0,1901100.0,1925200.0,26993056.0,0.7442234073233163,0.6912673733854061\nSPY,20190919,2220200.0,2237600.0,2203700.0,2209600.0,21122718.0,,\nQQQ,20190919,1928700.0,1940400.0,1924700.0,1928400.0,24851268.0,0.7463936383547729,0.6955757683817351\nSPY,20190920,2215000.0,2225500.0,2174800.0,2177300.0,48887352.0,,\nQQQ,20190920,1930500.0,1933100.0,1901600.0,1908000.0,27164480.0,0.748187179907531,0.6988913316009968\nSPY,20190923,2189800.0,2198400.0,2176500.0,2187200.0,18212999.0,,\nQQQ,20190923,1903200.0,1913300.0,1897200.0,1905000.0,21159602.0,0.7494946903860391,0.700942609037679\nSPY,20190924,2210800.0,2224800.0,2171900.0,2176800.0,29844705.0,,\nQQQ,20190924,1914100.0,1917800.0,1871600.0,1879700.0,38842147.0,0.7504950090666032,0.7027744168903254\nSPY,20190925,2186200.0,2215000.0,2171500.0,2210300.0,21190603.0,,\nQQQ,20190925,1877800.0,1905800.0,1862100.0,1900800.0,32534077.0,0.752110687700465,0.7054975799737904\nSPY,20190926,2199400.0,2209400.0,2188300.0,2198900.0,18055336.0,,\nQQQ,20190926,1898300.0,1900000.0,1879800.0,1893800.0,25722859.0,0.7536307693419537,0.7079080460984768\nSPY,20190927,2205400.0,2209600.0,2172800.0,2188200.0,24024717.0,,\nQQQ,20190927,1897300.0,1898300.0,1857500.0,1870300.0,38265215.0,0.7544709557099776,0.7092469439879237\nSPY,20190930,2208500.0,2245800.0,2208000.0,2239700.0,24486462.0,,\nQQQ,20190930,1877900.0,1891000.0,1874000.0,1888100.0,24564895.0,0.755468205039041,0.7106678197214755\nSPY,20191001,2250000.0,2282000.0,2241900.0,2245900.0,33778745.0,,\nQQQ,20191001,1895000.0,1905900.0,1869600.0,1872700.0,31105641.0,0.7560697995951104,0.7115454122803626\nSPY,20191002,2231200.0,2235900.0,2179300.0,2189600.0,33571088.0,,\nQQQ,20191002,1860000.0,1860300.0,1830200.0,1840500.0,45253981.0,0.7560857866426658,0.7101120309551868\nSPY,20191003,2181900.0,2209600.0,2151500.0,2208200.0,27251589.0,,\nQQQ,20191003,1840300.0,1862000.0,1818200.0,1860700.0,38298158.0,0.756969463022471,0.7102447583915228\nSPY,20191004,2255400.0,2274900.0,2239000.0,2270100.0,32870062.0,,\nQQQ,20191004,1870800.0,1890800.0,1868800.0,1888100.0,29130844.0,0.7586194426855443,0.7116853969241476\nSPY,20191007,2262600.0,2299300.0,2258600.0,2270600.0,29690531.0,,\nQQQ,20191007,1882700.0,1897400.0,1879100.0,1882400.0,20000452.0,0.7611728843591977,0.7158171952931406\nSPY,20191008,2258700.0,2280600.0,2243300.0,2244000.0,26652154.0,,\nQQQ,20191008,1870600.0,1878600.0,1852700.0,1854200.0,30189252.0,0.7633793410374272,0.7189966553810772\nSPY,20191009,2270000.0,2277900.0,2256500.0,2270300.0,18028870.0,,\nQQQ,20191009,1869900.0,1880800.0,1864300.0,1872300.0,18612667.0,0.7664290605669853,0.723754940252258\nSPY,20191010,2279000.0,2304400.0,2273000.0,2300900.0,27542365.0,,\nQQQ,20191010,1872800.0,1894300.0,1871300.0,1886800.0,22593965.0,0.7700808700021999,0.7292421303722428\nSPY,20191011,2329000.0,2376400.0,2323000.0,2362100.0,40790607.0,,\nQQQ,20191011,1908300.0,1926300.0,1907200.0,1911100.0,37029245.0,0.7758074136391112,0.7385710544389971\nSPY,20191014,2350000.0,2381400.0,2346700.0,2358700.0,23356092.0,,\nQQQ,20191014,1908400.0,1917000.0,1906500.0,1910900.0,13636783.0,0.782104650312018,0.7489627858962044\nSPY,20191015,2363200.0,2376500.0,2348800.0,2353200.0,19881534.0,,\nQQQ,20191015,1916800.0,1939700.0,1915600.0,1935200.0,22291734.0,0.7887333476755604,0.75854503011802\nSPY,20191016,2332600.0,2352400.0,2332000.0,2343700.0,17355461.0,,\nQQQ,20191016,1928600.0,1935200.0,1924300.0,1930400.0,18871220.0,0.7950530836117576,0.7681077776579273\nSPY,20191017,2350000.0,2361500.0,2335300.0,2352800.0,16457679.0,,\nQQQ,20191017,1942000.0,1945000.0,1928100.0,1935500.0,18090263.0,0.7999814032563605,0.7761857778832674\nSPY,20191018,2345300.0,2375800.0,2342900.0,2364100.0,23618798.0,,\nQQQ,20191018,1932000.0,1936700.0,1907100.0,1916900.0,25488691.0,0.8038614304740621,0.783596016753243\nSPY,20191021,2375000.0,2409900.0,2373200.0,2405100.0,21108275.0,,\nQQQ,20191021,1927100.0,1935200.0,1921400.0,1933900.0,14439112.0,0.8087670292172264,0.7924880034482613\nSPY,20191022,2411500.0,2422000.0,2396200.0,2399600.0,19912916.0,,\nQQQ,20191022,1941500.0,1944200.0,1917900.0,1918500.0,19768612.0,0.8139298212342192,0.8013162509908865\nSPY,20191023,2421000.0,2432400.0,2412200.0,2431800.0,18201573.0,,\nQQQ,20191023,1914600.0,1922500.0,1911500.0,1922200.0,12763854.0,0.8186574758717777,0.8096555817410381\nSPY,20191024,2446900.0,2448000.0,2418100.0,2435800.0,16751305.0,,\nQQQ,20191024,1935900.0,1942100.0,1927400.0,1940900.0,16698261.0,0.8249771227361713,0.819386675630501\nSPY,20191025,2430000.0,2467300.0,2428800.0,2465800.0,16940620.0,,\nQQQ,20191025,1930700.0,1957400.0,1930500.0,1956400.0,20284113.0,0.8339621918723846,0.8318323075395261\nSPY,20191028,2473800.0,2492500.0,2467300.0,2490500.0,23078082.0,,\nQQQ,20191028,1965500.0,1978300.0,1965500.0,1975700.0,16695008.0,0.8412995970538882,0.8423035254691292\nSPY,20191029,2490000.0,2497400.0,2425700.0,2432900.0,33578680.0,,\nQQQ,20191029,1973000.0,1975300.0,1960100.0,1960400.0,17566024.0,0.8499804996770591,0.8541095162370805\nSPY,20191030,2447700.0,2453000.0,2412100.0,2432600.0,25917983.0,,\nQQQ,20191030,1964300.0,1973200.0,1952900.0,1969900.0,19817911.0,0.8596509907024067,0.866443792097513\nSPY,20191031,2472300.0,2491800.0,2423700.0,2487600.0,31413217.0,,\nQQQ,20191031,1975200.0,1976500.0,1959400.0,1970800.0,24861874.0,0.8674313492831051,0.8780300702578037\nSPY,20191101,2495000.0,2559300.0,2491700.0,2558200.0,36783160.0,,\nQQQ,20191101,1979300.0,1988800.0,1976300.0,1988700.0,20308848.0,0.8743698183615216,0.8886846319845845\nSPY,20191104,2574500.0,2578500.0,2553800.0,2575000.0,24447271.0,,\nQQQ,20191104,2002000.0,2005300.0,1997400.0,2001000.0,17960874.0,0.8810947412183749,0.8985132092835898\nSPY,20191105,2570300.0,2581900.0,2563200.0,2571300.0,18617883.0,,\nQQQ,20191105,2003400.0,2005500.0,1995500.0,2002100.0,14223837.0,0.8853759816103931,0.9060207617132964\nSPY,20191106,2567800.0,2574900.0,2553600.0,2572400.0,16734698.0,,\nQQQ,20191106,1999700.0,2000000.0,1987900.0,1997600.0,17544510.0,0.8883528563825152,0.9104105138092857\nSPY,20191107,2586900.0,2603500.0,2581100.0,2594300.0,22907896.0,,\nQQQ,20191107,2007600.0,2017200.0,1998500.0,2004300.0,16370368.0,0.8912484022419349,0.9156637437902312\nSPY,20191108,2587000.0,2604400.0,2568500.0,2601400.0,16802101.0,,\nQQQ,20191108,2000700.0,2012500.0,1995400.0,2012300.0,14639508.0,0.8935653191763272,0.9215187462441918\nSPY,20191111,2582800.0,2624700.0,2582700.0,2622000.0,19903371.0,,\nQQQ,20191111,2002100.0,2010400.0,1999400.0,2009600.0,8982977.0,0.8956542242795823,0.9267697266084154\nSPY,20191112,2616300.0,2627900.0,2609200.0,2619600.0,20163851.0,,\nQQQ,20191112,2011300.0,2022100.0,2008200.0,2015400.0,14317792.0,0.8982345854644086,0.931715883906869\nSPY,20191113,2611000.0,2647800.0,2610500.0,2644700.0,25158183.0,,\nQQQ,20191113,2008400.0,2017700.0,2007100.0,2015900.0,14498055.0,0.9005026174701263,0.9340352387467894\nSPY,20191114,2640000.0,2648800.0,2620900.0,2626400.0,20744040.0,,\nQQQ,20191114,2008400.0,2015600.0,2002200.0,2014300.0,15516675.0,0.9025463399775554,0.9359691592550842\nSPY,20191115,2640000.0,2657800.0,2630100.0,2657600.0,23977970.0,,\nQQQ,20191115,2026500.0,2029100.0,2020000.0,2029100.0,16865354.0,0.904339049333724,0.9373972909371499\nSPY,20191118,2657400.0,2674300.0,2642300.0,2671000.0,19678304.0,,\nQQQ,20191118,2025900.0,2033900.0,2017700.0,2030700.0,15292448.0,0.9059817152133438,0.9391549914689228\nSPY,20191119,2679600.0,2680000.0,2654000.0,2662900.0,16368358.0,,\nQQQ,20191119,2038400.0,2038400.0,2025900.0,2033700.0,15201852.0,0.9081967676484398,0.9410071759030009\nSPY,20191120,2656900.0,2660800.0,2604000.0,2631900.0,23905480.0,,\nQQQ,20191120,2028400.0,2034500.0,2006200.0,2021500.0,32107878.0,0.9106787528956447,0.9427461296287609\nSPY,20191121,2635900.0,2640100.0,2611800.0,2620100.0,28360767.0,,\nQQQ,20191121,2019300.0,2044500.0,2010700.0,2017000.0,16371636.0,0.9125716317100412,0.9440943999172116\nSPY,20191122,2625000.0,2631800.0,2608400.0,2617800.0,15152877.0,,\nQQQ,20191122,2022000.0,2023200.0,2007400.0,2018300.0,14828836.0,0.9142029366508693,0.9452844471629128\nSPY,20191125,2625200.0,2664400.0,2625200.0,2663700.0,18806882.0,,\nQQQ,20191125,2027000.0,2042600.0,2026500.0,2042200.0,16159124.0,0.9158324792401443,0.9459458344790491\nSPY,20191126,2670000.0,2672100.0,2625000.0,2642900.0,21530133.0,,\nQQQ,20191126,2043500.0,2048700.0,2040500.0,2046100.0,12811867.0,0.9171941647434851,0.9465044892982347\nSPY,20191127,2658400.0,2679800.0,2653100.0,2678400.0,15141632.0,,\nQQQ,20191127,2051400.0,2060500.0,2048900.0,2060400.0,15155241.0,0.9185583568808217,0.9469047435604919\nSPY,20191129,2662000.0,2680000.0,2659000.0,2672500.0,10136207.0,,\nQQQ,20191129,2055200.0,2058300.0,2050000.0,2051000.0,8390058.0,0.9195730639792729,0.9473869113207537\nSPY,20191202,2673300.0,2682500.0,2634500.0,2641600.0,21924088.0,,\nQQQ,20191202,2051100.0,2051800.0,2017800.0,2030000.0,26045351.0,0.9202488222670735,0.947874328185715\nSPY,20191203,2582800.0,2595300.0,2562900.0,2594500.0,26825032.0,,\nQQQ,20191203,2002100.0,2014900.0,1992300.0,2014100.0,28526741.0,0.9206638659272363,0.9481922739560898\nSPY,20191204,2610000.0,2633100.0,2606900.0,2617400.0,15489436.0,,\nQQQ,20191204,2024400.0,2029100.0,2021400.0,2024300.0,13924086.0,0.9212435344266422,0.9484149859697723\nSPY,20191205,2638000.0,2658900.0,2627300.0,2655800.0,16894553.0,,\nQQQ,20191205,2031000.0,2031500.0,2018400.0,2028300.0,14205182.0,0.9218832109424426,0.9487479291821459\nSPY,20191206,2675800.0,2710000.0,2673000.0,2707100.0,24429287.0,,\nQQQ,20191206,2043100.0,2051500.0,2041500.0,2050000.0,13379376.0,0.9224673253285663,0.9489676417074285\nSPY,20191209,2701000.0,2707900.0,2649100.0,2669200.0,29535952.0,,\nQQQ,20191209,2046300.0,2055900.0,2039800.0,2040700.0,12675207.0,0.9232270896340523,0.9491198657437165\nSPY,20191210,2686700.0,2700700.0,2658600.0,2684800.0,21119366.0,,\nQQQ,20191210,2041600.0,2048800.0,2034400.0,2039000.0,19320256.0,0.9237545229602171,0.9491941030816106\nSPY,20191211,2687300.0,2711000.0,2685000.0,2707700.0,18581840.0,,\nQQQ,20191211,2043600.0,2051900.0,2040400.0,2049800.0,15793538.0,0.924269649221018,0.9492308468145076\nSPY,20191212,2677000.0,2725500.0,2673200.0,2714600.0,32297515.0,,\nQQQ,20191212,2047700.0,2073200.0,2045000.0,2065100.0,29930333.0,0.9249332680082133,0.9492570923380055\nSPY,20191213,2714700.0,2753000.0,2709300.0,2751500.0,31067183.0,,\nQQQ,20191213,2064000.0,2079200.0,2059600.0,2071900.0,29345791.0,0.9256824006767153,0.9493560754551977\nSPY,20191216,2770000.0,2807900.0,2769500.0,2798600.0,29324890.0,,\nQQQ,20191216,2085500.0,2095200.0,2084800.0,2092700.0,18405004.0,0.9267045311578145,0.9494888028168872\nSPY,20191217,2798200.0,2817700.0,2788000.0,2804100.0,26651704.0,,\nQQQ,20191217,2095400.0,2097100.0,2089700.0,2093900.0,14379967.0,0.928194507921954,0.9496815199465719\nSPY,20191218,2798300.0,2819000.0,2791200.0,2797400.0,25882777.0,,\nQQQ,20191218,2095700.0,2101400.0,2093300.0,2095500.0,14046362.0,0.9297764789239895,0.9498539905295583\nSPY,20191219,2795000.0,2811800.0,2789500.0,2800200.0,20705891.0,,\nQQQ,20191219,2096200.0,2109300.0,2096200.0,2108600.0,15213543.0,0.931814588659516,0.9500399588103435\nSPY,20191220,2826500.0,2826500.0,2785600.0,2794400.0,46250825.0,,\nQQQ,20191220,2118600.0,2120500.0,2112700.0,2117100.0,24243313.0,0.9340229503602911,0.9502011813118308\nSPY,20191223,2806600.0,2842500.0,2803700.0,2840000.0,21823263.0,,\nQQQ,20191223,2120000.0,2121500.0,2116300.0,2118100.0,21504172.0,0.9367815368947637,0.9502206779864292\nSPY,20191224,2846900.0,2848900.0,2829300.0,2842700.0,9836468.0,,\nQQQ,20191224,2120000.0,2120900.0,2114400.0,2119200.0,6416983.0,0.9405560141808529,0.950221427858529\nSPY,20191226,2848200.0,2899800.0,2847000.0,2899100.0,22011315.0,,\nQQQ,20191226,2122600.0,2138100.0,2122300.0,2137900.0,13380487.0,0.9432188112945102,0.9503744017669169\nSPY,20191227,2911800.0,2939700.0,2881100.0,2898000.0,34863745.0,,\nQQQ,20191227,2145400.0,2145600.0,2130400.0,2136100.0,16329144.0,0.945613290596727,0.9504868825819082\nSPY,20191230,2894400.0,2926900.0,2852300.0,2915200.0,34989194.0,,\nQQQ,20191230,2135000.0,2136300.0,2111600.0,2122100.0,18324822.0,0.9479139857080763,0.9505858656991003\nSPY,20191231,2898100.0,2936800.0,2895200.0,2936500.0,23468463.0,,\nQQQ,20191231,2115300.0,2127600.0,2112050.0,2126100.0,16245049.0,0.9501307194228424,0.9506968467698915\nSPY,20200102,2962700.0,3006000.0,2951900.0,3003500.0,32381034.0,,\nQQQ,20200102,2144000.0,2161600.0,2139800.0,2161600.0,28675286.0,0.9525926783001392,0.9508115772011824\nSPY,20200103,2969500.0,3005800.0,2965000.0,2974300.0,32601142.0,,\nQQQ,20200103,2133000.0,2154700.0,2132800.0,2141800.0,24570808.0,0.9544110268058223,0.9508115772011824\nSPY,20200106,2937000.0,2999600.0,2927500.0,2998000.0,27977020.0,,\nQQQ,20200106,2125000.0,2155900.0,2122500.0,2155600.0,19700382.0,0.9555559607893158,0.9508123270732823\nSPY,20200107,2999800.0,3009000.0,2974800.0,2983900.0,25250263.0,,\nQQQ,20200107,2156400.0,2161400.0,2148500.0,2155300.0,20510990.0,0.9563839530808971,0.9508123270732823\nSPY,20200108,2971700.0,3044400.0,2971500.0,3031900.0,31268321.0,,\nQQQ,20200108,2155000.0,2181400.0,2151600.0,2171500.0,23694484.0,0.957309395622358,0.9508123270732823\nSPY,20200109,3072500.0,3104200.0,3062000.0,3096300.0,39912596.0,,\nQQQ,20200109,2189400.0,2194100.0,2177200.0,2189900.0,21454160.0,0.9583304813502066,0.9508250748989814\nSPY,20200110,3107700.0,3126600.0,3082500.0,3103300.0,33656639.0,,\nQQQ,20200110,2198500.0,2198700.0,2180400.0,2184300.0,18295352.0,0.9592408520771475,0.9508348232362808\nSPY,20200113,3117500.0,3170700.0,3111500.0,3169600.0,28896523.0,,\nQQQ,20200113,2193300.0,2209800.0,2189800.0,2209500.0,20226442.0,0.960300916645456,0.9508348232362808\nSPY,20200114,3167600.0,3175500.0,3117500.0,3126800.0,38416611.0,,\nQQQ,20200114,2208400.0,2212100.0,2197400.0,2200800.0,22066006.0,0.9613506510635094,0.9508348232362808\nSPY,20200115,3119900.0,3155000.0,3095500.0,3113400.0,29150931.0,,\nQQQ,20200115,2202100.0,2212000.0,2194500.0,2201700.0,22702156.0,0.9621650188242514,0.9508460713177797\nSPY,20200116,3135900.0,3157000.0,3120900.0,3152400.0,24836375.0,,\nQQQ,20200116,2212700.0,2223200.0,2208000.0,2222800.0,16403665.0,0.9631697083055278,0.9508490708061793\nSPY,20200117,3163000.0,3187400.0,3150000.0,3187300.0,31081354.0,,\nQQQ,20200117,2232800.0,2235600.0,2221200.0,2233800.0,19745031.0,0.9641051789434195,0.9508505705503794\nSPY,20200121,3172500.0,3190200.0,3160000.0,3165700.0,25133196.0,,\nQQQ,20200121,2227600.0,2238400.0,2226600.0,2232800.0,18901138.0,0.9648662791296314,0.9508498206782794\nSPY,20200122,3187500.0,3199900.0,3173200.0,3177000.0,24127862.0,,\nQQQ,20200122,2244100.0,2251500.0,2235900.0,2238700.0,18307031.0,0.965778974546948,0.950853570038779\nSPY,20200123,3179200.0,3195600.0,3156500.0,3192300.0,22286631.0,,\nQQQ,20200123,2237400.0,2246900.0,2227100.0,2245900.0,24446740.0,0.9666937650775416,0.9508565695271789\nSPY,20200124,3202500.0,3233300.0,3175200.0,3183100.0,35615543.0,,\nQQQ,20200124,2256400.0,2258800.0,2216700.0,2227000.0,33897189.0,0.9673592697183471,0.950855069782979\nSPY,20200127,3099000.0,3133333.0,3048800.0,3089500.0,37697592.0,,\nQQQ,20200127,2176700.0,2192800.0,2171900.0,2181000.0,36374142.0,0.9678230939569576,0.950855069782979\nSPY,20200128,3125000.0,3184000.0,3121900.0,3176900.0,31754321.0,,\nQQQ,20200128,2196400.0,2219600.0,2190308.0,2214500.0,23235600.0,0.9685841375650708,0.9508505705503794\nSPY,20200129,3246500.0,3278500.0,3213900.0,3243400.0,51731160.0,,\nQQQ,20200129,2226800.0,2229200.0,2208200.0,2218100.0,25046216.0,0.9694353926743062,0.9508318237478809\nSPY,20200130,3206700.0,3240800.0,3187500.0,3238700.0,30144754.0,,\nQQQ,20200130,2203800.0,2227000.0,2196700.0,2226000.0,34714336.0,0.9703627272761532,0.9508138268174823\nSPY,20200131,3209400.0,3226900.0,3082800.0,3095100.0,48133278.0,,\nQQQ,20200131,2235300.0,2235600.0,2182850.0,2190700.0,45539329.0,0.9708969386680453,0.9508123270732823\nSPY,20200203,3041100.0,3134900.0,3022100.0,3086600.0,41259829.0,,\nQQQ,20200203,2201100.0,2228900.0,2199900.0,2223800.0,21835864.0,0.9714502684752565,0.9507650851309861\nSPY,20200204,3154900.0,3196400.0,3136400.0,3188500.0,32279972.0,,\nQQQ,20200204,2254200.0,2278600.0,2246600.0,2274700.0,27788619.0,0.9719798485018297,0.9507913306544842\nSPY,20200205,3236900.0,3247500.0,3189500.0,3214500.0,28242608.0,,\nQQQ,20200205,2302100.0,2302500.0,2268500.0,2282200.0,34146249.0,0.9724998692685294,0.9508325736199807\nSPY,20200206,3226700.0,3252200.0,3202900.0,3252100.0,24559070.0,,\nQQQ,20200206,2287900.0,2302500.0,2279800.0,2301900.0,20098819.0,0.9730358715446289,0.950903811469475\nSPY,20200207,3222600.0,3234000.0,3179000.0,3200300.0,27946505.0,,\nQQQ,20200207,2291600.0,2304350.0,2285400.0,2292000.0,22874659.0,0.9735294485362439,0.950919558783574\nSPY,20200210,3141300.0,3215500.0,3138500.0,3215500.0,25450198.0,,\nQQQ,20200210,2284400.0,2319800.0,2283900.0,2319700.0,19851151.0,0.9736977646242724,0.950903811469475\nSPY,20200211,3236000.0,3239000.0,3187200.0,3196100.0,22191448.0,,\nQQQ,20200211,2332500.0,2340200.0,2314000.0,2320100.0,28704498.0,0.9737295161014896,0.9508775659459772\nSPY,20200212,3214700.0,3272100.0,3214700.0,3272000.0,25914325.0,,\nQQQ,20200212,2333800.0,2344000.0,2328000.0,2342700.0,21491343.0,0.9737483687214178,0.950893313260076\nSPY,20200213,3243800.0,3262100.0,3233500.0,3248700.0,21873539.0,,\nQQQ,20200213,2326400.0,2349300.0,2323600.0,2339700.0,20488613.0,0.9736661876946059,0.9508985623647755\nSPY,20200214,3247000.0,3259700.0,3228500.0,3249500.0,19018937.0,,\nQQQ,20200214,2343400.0,2348600.0,2335500.0,2346400.0,20643026.0,0.9735207958608884,0.9509075608299749\nSPY,20200218,3153300.0,3197500.0,3146100.0,3190000.0,35034300.0,,\nQQQ,20200218,2335000.0,2351700.0,2332400.0,2347300.0,21181754.0,0.9729740394167048,0.9508625685039783\nSPY,20200219,3200000.0,3245700.0,3200000.0,3236200.0,22163363.0,,\nQQQ,20200219,2361300.0,2376000.0,2358500.0,2369800.0,19213715.0,0.9724164016505673,0.9508370728525803\nSPY,20200220,3226300.0,3246500.0,3182100.0,3203000.0,23849231.0,,\nQQQ,20200220,2364800.0,2369400.0,2318700.0,2347800.0,39564186.0,0.9720643474005888,0.9507913306544842\nSPY,20200221,3187800.0,3204500.0,3105000.0,3130500.0,30890162.0,,\nQQQ,20200221,2336100.0,2340100.0,2293300.0,2302700.0,60202540.0,0.9719262851050019,0.9506983465140915\nSPY,20200224,2970000.0,3041200.0,2892200.0,2981800.0,52307378.0,,\nQQQ,20200224,2216800.0,2242500.0,2202600.0,2213900.0,74650743.0,0.9719518322318553,0.9506443557228957\nSPY,20200225,3006400.0,3025200.0,2861300.0,2880800.0,54932892.0,,\nQQQ,20200225,2232500.0,2239800.0,2147400.0,2153700.0,90742316.0,0.9719755832691305,0.9506331076413965\nSPY,20200226,2865200.0,2978700.0,2865000.0,2926500.0,47456499.0,,\nQQQ,20200226,2167100.0,2202900.0,2149000.0,2164800.0,72045289.0,0.97202368944432,0.9506188600714978\nSPY,20200227,2810900.0,2860000.0,2729600.0,2735200.0,75781788.0,,\nQQQ,20200227,2109000.0,2143700.0,2055000.0,2056400.0,108461905.0,0.9718269414410451,0.9506143608388979\nSPY,20200228,2574400.0,2784200.0,2563700.0,2733600.0,100904820.0,,\nQQQ,20200228,1986400.0,2071700.0,1981600.0,2058000.0,137166353.0,0.9716237647949942,0.9506098616062985\nSPY,20200302,2823700.0,3014400.0,2777200.0,2988100.0,81659854.0,,\nQQQ,20200302,2087600.0,2165700.0,2059400.0,2164200.0,97482567.0,0.9716598334887235,0.9505941142921996\nSPY,20200303,3037500.0,3040000.0,2858000.0,2893200.0,76293729.0,,\nQQQ,20200303,2170300.0,2196100.0,2076200.0,2094800.0,121621623.0,0.9714001641547343,0.9505716181292014\nSPY,20200304,2968000.0,3034000.0,2931300.0,3027400.0,52290112.0,,\nQQQ,20200304,2133500.0,2183300.0,2113700.0,2182200.0,64764691.0,0.9714741777328258,0.9505588703035024\nSPY,20200305,2954800.0,2995600.0,2914200.0,2929200.0,44777759.0,,\nQQQ,20200305,2125300.0,2163600.0,2101000.0,2115900.0,72037789.0,0.9713076880499332,0.9505183772101057\nSPY,20200306,2819600.0,2908200.0,2812200.0,2890300.0,53813953.0,,\nQQQ,20200306,2045500.0,2091500.0,2029100.0,2080200.0,79862351.0,0.9709394652542673,0.9504823833493085\nSPY,20200309,2635000.0,2780900.0,2630000.0,2661700.0,68555675.0,,\nQQQ,20200309,1930000.0,2011600.0,1921100.0,1935700.0,110141061.0,0.969352731797946,0.9498907342624554\nSPY,20200310,2770800.0,2864400.0,2693700.0,2853400.0,68122357.0,,\nQQQ,20200310,2011800.0,2043000.0,1936900.0,2041100.0,90119540.0,0.9685894284974279,0.9497677552380651\nSPY,20200311,2773000.0,2812200.0,2718600.0,2754300.0,61364748.0,,\nQQQ,20200311,1993000.0,2007500.0,1927300.0,1952200.0,83550670.0,0.966632593875331,0.9491701071744123\nSPY,20200312,2555700.0,2700000.0,2480000.0,2482300.0,99843824.0,,\nQQQ,20200312,1820900.0,1907800.0,1769400.0,1773200.0,126249753.0,0.9617661730362148,0.9403373637092121\nSPY,20200313,2650000.0,2799200.0,2529700.0,2779700.0,88089084.0,,\nQQQ,20200313,1870700.0,1944800.0,1781300.0,1923400.0,125012600.0,0.9587414076151033,0.9383427039233703\nSPY,20200316,2419400.0,2591200.0,2400000.0,2422100.0,76597410.0,,\nQQQ,20200316,1741500.0,1847000.0,1691600.0,1693000.0,84060751.0,0.951281276484603,0.9295144596907695\nSPY,20200317,2473700.0,2580000.0,2384100.0,2528600.0,79230394.0,,\nQQQ,20200317,1753400.0,1843900.0,1697800.0,1821400.0,115793406.0,0.9476986223676451,0.9229463299673897\nSPY,20200318,2404000.0,2500000.0,2371200.0,2466700.0,71796128.0,,\nQQQ,20200318,1715000.0,1792200.0,1668000.0,1766000.0,103468629.0,0.9428733861355553,0.9142588902950606\nSPY,20200319,2470000.0,2528400.0,2426000.0,2447800.0,66152618.0,,\nQQQ,20200319,1754300.0,1834900.0,1716200.0,1776600.0,114691905.0,0.9387449338873796,0.9061392767190735\nSPY,20200320,2472900.0,2518300.0,2280000.0,2292400.0,94917781.0,,\nQQQ,20200320,1818900.0,1828700.0,1701000.0,1707000.0,104841464.0,0.9342617060495898,0.8988587698656143\nSPY,20200323,2278600.0,2281900.0,2126100.0,2243700.0,80038459.0,,\nQQQ,20200323,1707000.0,1742100.0,1649200.0,1704600.0,114873208.0,0.9303530713940948,0.8918463422376273\nSPY,20200324,2365200.0,2476900.0,2343000.0,2468800.0,69055081.0,,\nQQQ,20200324,1798800.0,1838300.0,1779500.0,1836600.0,86434644.0,0.927912528130847,0.8865353740854357\nSPY,20200325,2508000.0,2582500.0,2443000.0,2455200.0,71644221.0,,\nQQQ,20200325,1844900.0,1895100.0,1799800.0,1823000.0,82965783.0,0.9252270170694649,0.8801802092298309\nSPY,20200326,2463600.0,2586800.0,2463500.0,2584400.0,59057497.0,,\nQQQ,20200326,1839300.0,1927200.0,1835600.0,1919000.0,74995622.0,0.9237275589986549,0.8796388016751705\nSPY,20200327,2529200.0,2558700.0,2470500.0,2477400.0,48846513.0,,\nQQQ,20200327,1869000.0,1905100.0,1846600.0,1853000.0,54182139.0,0.921599234853728,0.8754545161419227\nSPY,20200330,2507700.0,2555200.0,2494000.0,2548100.0,40114610.0,,\nQQQ,20200330,1870600.0,1924900.0,1863500.0,1920400.0,46667707.0,0.9203692906417846,0.8749603505207021\nSPY,20200331,2555500.0,2624900.0,2520000.0,2542900.0,46008161.0,,\nQQQ,20200331,1917200.0,1952500.0,1892000.0,1904000.0,57650860.0,0.9189648162503257,0.8736087063139496\nSPY,20200401,2466200.0,2487200.0,2391400.0,2409100.0,42038194.0,,\nQQQ,20200401,1847700.0,1876600.0,1808600.0,1823100.0,49855126.0,0.9168730171779471,0.8677263357287234\nSPY,20200402,2399800.0,2451500.0,2369000.0,2449300.0,39708628.0,,\nQQQ,20200402,1812400.0,1861800.0,1809700.0,1860100.0,52939936.0,0.9153460456328558,0.8643264162649696\nSPY,20200403,2428000.0,2457500.0,2389700.0,2414100.0,31059630.0,,\nQQQ,20200403,1855500.0,1870600.0,1812900.0,1833700.0,45022619.0,0.9135328470773975,0.8593532654304714\nSPY,20200406,2511800.0,2631100.0,2493800.0,2624700.0,47496802.0,,\nQQQ,20200406,1904800.0,1976500.0,1891900.0,1964800.0,58240710.0,0.9128296588944106,0.8604782869935581\nSPY,20200407,2712500.0,2717000.0,2590000.0,2594300.0,48072366.0,,\nQQQ,20200407,2023700.0,2026600.0,1960000.0,1964000.0,65151399.0,0.9122464441755925,0.8619182024674741\nSPY,20200408,2627500.0,2673800.0,2612300.0,2660700.0,39082334.0,,\nQQQ,20200408,1981500.0,2011750.0,1963700.0,2005700.0,43133208.0,0.9118691671227928,0.8632248543566649\nSPY,20200409,2689200.0,2700700.0,2647000.0,2679900.0,38627672.0,,\nQQQ,20200409,2023500.0,2032200.0,1990300.0,2008600.0,61293607.0,0.9115184848737948,0.8646312392164508\nSPY,20200413,2681900.0,2737000.0,2658400.0,2732500.0,31595212.0,,\nQQQ,20200413,2000000.0,2034200.0,1987700.0,2030300.0,40864552.0,0.9112328466207515,0.8658917739801407\nSPY,20200414,2800000.0,2892000.0,2780500.0,2870500.0,46345015.0,,\nQQQ,20200414,2072300.0,2125100.0,2064100.0,2118600.0,59587525.0,0.9114711814901555,0.8675167465160813\nSPY,20200415,2826200.0,2863500.0,2806300.0,2844300.0,29698253.0,,\nQQQ,20200415,2084200.0,2112600.0,2071200.0,2094300.0,42199544.0,0.9115791443253856,0.8690862285270289\nSPY,20200416,2872500.0,2882000.0,2823500.0,2866900.0,36580021.0,,\nQQQ,20200416,2116900.0,2143600.0,2096900.0,2132500.0,58633388.0,0.9118857469716943,0.870792023988782\nSPY,20200417,2850000.0,2869450.0,2768600.0,2828000.0,50272804.0,,\nQQQ,20200417,2161700.0,2165100.0,2120800.0,2152900.0,57826538.0,0.9120519097266697,0.8725474739165607\nSPY,20200420,2776600.0,2816700.0,2768500.0,2769300.0,30573223.0,,\nQQQ,20200420,2133600.0,2158800.0,2125700.0,2127400.0,35519823.0,0.9121447697386901,0.874452148336278\nSPY,20200421,2761800.0,2772600.0,2654300.0,2683700.0,42903803.0,,\nQQQ,20200421,2106000.0,2111600.0,2036300.0,2048900.0,68622607.0,0.9121702492509601,0.8765197555570767\nSPY,20200422,2737100.0,2779800.0,2721800.0,2761000.0,27502743.0,,\nQQQ,20200422,2091000.0,2123600.0,2083300.0,2109700.0,34148223.0,0.9124781689628215,0.8788286104542832\nSPY,20200423,2758200.0,2817500.0,2748700.0,2750300.0,29742001.0,,\nQQQ,20200423,2117900.0,2144350.0,2101000.0,2105200.0,40773523.0,0.9127151804252961,0.8810285687934479\nSPY,20200424,2770400.0,2830500.0,2770000.0,2829700.0,30057060.0,,\nQQQ,20200424,2109700.0,2143000.0,2095100.0,2138400.0,32035824.0,0.9131918182437779,0.8833805408712317\nSPY,20200427,2818300.0,2845400.0,2799500.0,2831700.0,27697617.0,,\nQQQ,20200427,2161900.0,2166200.0,2145000.0,2155600.0,34846700.0,0.9136656867945169,0.8856224478588592\nSPY,20200428,2850800.0,2858200.0,2782000.0,2785800.0,25978683.0,,\nQQQ,20200428,2173200.0,2173200.0,2112100.0,2115000.0,43643613.0,0.9141713656224608,0.8879399262803648\nSPY,20200429,2850000.0,2896700.0,2838900.0,2877300.0,30806334.0,,\nQQQ,20200429,2161900.0,2199700.0,2151500.0,2190000.0,42337803.0,0.9145877984301025,0.8901201781847585\nSPY,20200430,2899800.0,2945300.0,2883500.0,2938000.0,36903820.0,,\nQQQ,20200430,2199500.0,2200400.0,2173500.0,2189100.0,37675523.0,0.9149361943155687,0.8923844157171114\nSPY,20200501,2861000.0,2990000.0,2858500.0,2890700.0,58497701.0,,\nQQQ,20200501,2145000.0,2166700.0,2116800.0,2127400.0,46164351.0,0.9151477468065641,0.8945798327602307\nSPY,20200504,2889800.0,2936900.0,2863100.0,2931600.0,32239791.0,,\nQQQ,20200504,2114600.0,2154500.0,2111200.0,2152200.0,30929871.0,0.9156393981625928,0.8967261727339431\nSPY,20200505,2950100.0,3010000.0,2944600.0,2975600.0,35880335.0,,\nQQQ,20200505,2174400.0,2201400.0,2168500.0,2176600.0,34640471.0,0.9161795450051484,0.8987871950415011\nSPY,20200506,3005600.0,3032400.0,2988700.0,3006300.0,34121143.0,,\nQQQ,20200506,2194000.0,2210400.0,2181100.0,2190000.0,34176586.0,0.9165561649244451,0.900355720444432\nSPY,20200507,3033000.0,3051700.0,3019700.0,3037400.0,27534394.0,,\nQQQ,20200507,2218200.0,2227300.0,2204200.0,2218200.0,35261962.0,0.9169400232798501,0.9017853510669481\nSPY,20200508,3057000.0,3103500.0,3042800.0,3101300.0,32233356.0,,\nQQQ,20200508,2236200.0,2250000.0,2224800.0,2248600.0,29133599.0,0.9173907792895466,0.9029206570005907\nSPY,20200511,3080000.0,3170500.0,3072400.0,3150100.0,35350431.0,,\nQQQ,20200511,2234900.0,2279210.0,2232500.0,2268700.0,33314351.0,0.9179928400356823,0.9039254852377644\nSPY,20200512,3177600.0,3196900.0,3108900.0,3114100.0,38375666.0,,\nQQQ,20200512,2274900.0,2281000.0,2220900.0,2221200.0,38662692.0,0.9181220063460447,0.9043919055090495\nSPY,20200513,3120600.0,3159500.0,3032000.0,3076500.0,48719640.0,,\nQQQ,20200513,2226600.0,2246100.0,2167100.0,2193400.0,61854906.0,0.9182208664028803,0.9048680741139787\nSPY,20200514,3047000.0,3097900.0,3015300.0,3095400.0,38327759.0,,\nQQQ,20200514,2179700.0,2218700.0,2159850.0,2218300.0,51132763.0,0.9185829461200196,0.905634068176869\nSPY,20200515,3009400.0,3079000.0,3002000.0,3077100.0,40036651.0,,\nQQQ,20200515,2187800.0,2233300.0,2183400.0,2232700.0,50176605.0,0.9191180489330555,0.9066353520256395\nSPY,20200518,3130000.0,3166800.0,3103300.0,3149600.0,31825542.0,,\nQQQ,20200518,2263300.0,2286800.0,2254700.0,2274300.0,39429845.0,0.9195688332426785,0.9073499797349729\nSPY,20200519,3150100.0,3185200.0,3130100.0,3131400.0,24463706.0,,\nQQQ,20200519,2277000.0,2298300.0,2267100.0,2268600.0,33780445.0,0.9197458565899588,0.9077399130076418\nSPY,20200520,3166800.0,3195200.0,3161800.0,3192300.0,26655394.0,,\nQQQ,20200520,2295000.0,2317600.0,2294800.0,2313900.0,35071301.0,0.9200749332721525,0.9081690098600207\nSPY,20200521,3186600.0,3208900.0,3158700.0,3168500.0,24479394.0,,\nQQQ,20200521,2314400.0,2321300.0,2283500.0,2288700.0,39518143.0,0.9204121557925444,0.9085428209616856\nSPY,20200522,3159000.0,3192300.0,3153400.0,3188900.0,19743294.0,,\nQQQ,20200522,2284500.0,2298700.0,2275000.0,2296600.0,26279140.0,0.9205464000777625,0.9089608745006588\nSPY,20200526,3234800.0,3242400.0,3165000.0,3167300.0,30322784.0,,\nQQQ,20200526,2333600.0,2335800.0,2287800.0,2290400.0,30865055.0,0.9206076363693364,0.9093196881659479\nSPY,20200527,3158800.0,3187100.0,3131000.0,3181100.0,26592670.0,,\nQQQ,20200527,2286900.0,2304100.0,2239400.0,2302900.0,50433111.0,0.9205998981155494,0.9096102634957277\nSPY,20200528,3167900.0,3234400.0,3156500.0,3182500.0,31536479.0,,\nQQQ,20200528,2291100.0,2334650.0,2290200.0,2299900.0,38161883.0,0.9204778560332982,0.9097178701017234\nSPY,20200529,3194700.0,3211500.0,3164700.0,3179400.0,35401913.0,,\nQQQ,20200529,2303800.0,2335900.0,2287600.0,2333600.0,48067862.0,0.9201545346836564,0.9098700940809369\nSPY,20200601,3178300.0,3223500.0,3172100.0,3218500.0,19591309.0,,\nQQQ,20200601,2324600.0,2344500.0,2320000.0,2340600.0,24017870.0,0.9197846932734177,0.9100110699828687\nSPY,20200602,3206200.0,3234400.0,3189200.0,3233400.0,20446066.0,,\nQQQ,20200602,2345000.0,2356900.0,2320100.0,2356300.0,31388131.0,0.9191609500041791,0.910014069470144\nSPY,20200603,3248500.0,3262000.0,3223000.0,3251200.0,24772075.0,,\nQQQ,20200603,2362600.0,2374800.0,2353500.0,2366900.0,35745723.0,0.9188089531167425,0.9102037870402968\nSPY,20200604,3243900.0,3256200.0,3207600.0,3223200.0,20789365.0,,\nQQQ,20200604,2363300.0,2377850.0,2336800.0,2350300.0,36792651.0,0.9185089130833617,0.9103297655058529\nSPY,20200605,3233300.0,3317500.0,3232300.0,3315000.0,32280099.0,,\nQQQ,20200605,2362200.0,2402900.0,2356200.0,2396900.0,42990497.0,0.9184548198872324,0.9107017019279707\nSPY,20200608,3300000.0,3336000.0,3273400.0,3334600.0,22810245.0,,\nQQQ,20200608,2395400.0,2416800.0,2379100.0,2415500.0,29106011.0,0.9185876950449152,0.9111508751474235\nSPY,20200609,3320900.0,3456000.0,3320100.0,3439900.0,35161695.0,,\nQQQ,20200609,2406600.0,2441800.0,2404700.0,2433000.0,32807637.0,0.9194030645951413,0.9118947479916595\nSPY,20200610,3479700.0,3547700.0,3461000.0,3528400.0,40052142.0,,\nQQQ,20200610,2450500.0,2478100.0,2445100.0,2462200.0,52872597.0,0.9205028793491912,0.9126948612223041\nSPY,20200611,3493000.0,3510600.0,3354800.0,3359000.0,48008118.0,,\nQQQ,20200611,2421600.0,2435900.0,2339600.0,2340200.0,68123873.0,0.9210414034735651,0.9133142553446215\nSPY,20200612,3449000.0,3478000.0,3342300.0,3388000.0,47299827.0,,\nQQQ,20200612,2391400.0,2404000.0,2317400.0,2358800.0,66941083.0,0.9217380172554015,0.9140768749843269\nSPY,20200615,3331200.0,3457500.0,3325700.0,3429900.0,33041320.0,,\nQQQ,20200615,2323500.0,2394500.0,2314700.0,2387500.0,42852259.0,0.9224763938133743,0.9147562588521472\nSPY,20200616,3513100.0,3532000.0,3447000.0,3520800.0,39345262.0,,\nQQQ,20200616,2436900.0,2444500.0,2391000.0,2428500.0,45787110.0,0.9235318171535876,0.9155916160582749\nSPY,20200617,3550000.0,3555000.0,3510900.0,3515900.0,27085491.0,,\nQQQ,20200617,2444000.0,2454950.0,2427300.0,2436200.0,33182954.0,0.9246977692798201,0.916852900457473\nSPY,20200618,3514500.0,3534500.0,3492200.0,3517300.0,22999982.0,,\nQQQ,20200618,2433200.0,2445400.0,2424800.0,2442800.0,25822891.0,0.9259154024907714,0.918178673833087\nSPY,20200619,3554000.0,3565600.0,3451400.0,3497200.0,59934663.0,,\nQQQ,20200619,2467300.0,2470000.0,2424600.0,2442400.0,43799625.0,0.9271895945163393,0.9200601022264212\nSPY,20200622,3516300.0,3594800.0,3511500.0,3588700.0,32515789.0,,\nQQQ,20200622,2436800.0,2468800.0,2433800.0,2467400.0,22203280.0,0.9286970126133797,0.9217488135623274\nSPY,20200623,3640000.0,3723900.0,3622700.0,3665300.0,51631515.0,,\nQQQ,20200623,2483900.0,2511500.0,2478200.0,2488400.0,29980789.0,0.9303309428838442,0.9232515566871748\nSPY,20200624,3652500.0,3687900.0,3585200.0,3600600.0,46763018.0,,\nQQQ,20200624,2480600.0,2493200.0,2421600.0,2437100.0,44109927.0,0.9314008897685715,0.9241041609451346\nSPY,20200625,3606900.0,3650000.0,3575700.0,3648400.0,33120124.0,,\nQQQ,20200625,2438000.0,2463400.0,2411400.0,2460300.0,34114959.0,0.9325454281249784,0.9251269861059589\nSPY,20200626,3643800.0,3653200.0,3530200.0,3536300.0,46965764.0,,\nQQQ,20200626,2457800.0,2459600.0,2396800.0,2402200.0,50293064.0,0.9334042950406735,0.926217299730474\nSPY,20200629,3534000.0,3621700.0,3512800.0,3617800.0,30730944.0,,\nQQQ,20200629,2399700.0,2428400.0,2373500.0,2428400.0,31576290.0,0.9344700279558723,0.9272888665595191\nSPY,20200630,3600800.0,3659800.0,3599700.0,3648000.0,32258552.0,,\nQQQ,20200630,2427700.0,2481700.0,2425800.0,2476000.0,35413828.0,0.9358400049269112,0.9289505825099492\nSPY,20200701,3650100.0,3673600.0,3639100.0,3641100.0,26463915.0,,\nQQQ,20200701,2476400.0,2515200.0,2470800.0,2504900.0,31503867.0,0.937170151439655,0.930575929677168\nSPY,20200702,3678800.0,3704700.0,3636400.0,3641100.0,26826178.0,,\nQQQ,20200702,2530200.0,2542700.0,2517100.0,2521900.0,29232232.0,0.9385244188633578,0.9324440351810582\nSPY,20200706,3699500.0,3757800.0,3698600.0,3738500.0,27797951.0,,\nQQQ,20200706,2554500.0,2589200.0,2554200.0,2583900.0,31904132.0,0.93993191191427,0.9341623667759387\nSPY,20200707,3755400.0,3786200.0,3722300.0,3726900.0,26145379.0,,\nQQQ,20200707,2581300.0,2608900.0,2563000.0,2566100.0,34564264.0,0.9413439538904498,0.9357738416166095\nSPY,20200708,3769200.0,3815000.0,3763600.0,3813700.0,27857053.0,,\nQQQ,20200708,2579800.0,2600200.0,2564900.0,2599900.0,27663321.0,0.9430084562066858,0.9374985471231445\nSPY,20200709,3850000.0,3852700.0,3786600.0,3827300.0,29984767.0,,\nQQQ,20200709,2619700.0,2628800.0,2576300.0,2621800.0,39040687.0,0.9447565609230738,0.9398355230844992\nSPY,20200710,3820300.0,3839200.0,3788200.0,3836800.0,21449624.0,,\nQQQ,20200710,2620300.0,2642300.0,2592600.0,2639700.0,29877101.0,0.9464625474681803,0.9421164569681536\nSPY,20200713,3890600.0,3998300.0,3810300.0,3819100.0,45405010.0,,\nQQQ,20200713,2669100.0,2697900.0,2576900.0,2585400.0,58228063.0,0.948327959059938,0.9446037817910666\nSPY,20200714,3795000.0,3890200.0,3755000.0,3882300.0,38742064.0,,\nQQQ,20200714,2559300.0,2607900.0,2527600.0,2603700.0,66487195.0,0.9502570579568751,0.9470896068703422\nSPY,20200715,3959800.0,3969900.0,3859400.0,3909000.0,36575111.0,,\nQQQ,20200715,2618300.0,2626900.0,2574900.0,2609000.0,50547825.0,0.9520663093898328,0.9492252418102448\nSPY,20200716,3862400.0,3896200.0,3836100.0,3860900.0,26114472.0,,\nQQQ,20200716,2580200.0,2597800.0,2556300.0,2591200.0,41572814.0,0.9536558835900145,0.9510759254590085\nSPY,20200717,3880000.0,3885900.0,3833600.0,3853100.0,21876696.0,,\nQQQ,20200717,2595900.0,2603100.0,2571700.0,2594200.0,32678634.0,0.9551049484895466,0.9529056126968463\nSPY,20200720,3856000.0,3940000.0,3842400.0,3934300.0,21976225.0,,\nQQQ,20200720,2600800.0,2674300.0,2587900.0,2667800.0,35279436.0,0.9565419200177322,0.954357364538016\nSPY,20200721,3970000.0,3970000.0,3869700.0,3880000.0,24751445.0,,\nQQQ,20200721,2684000.0,2684200.0,2631300.0,2640000.0,40920166.0,0.9578418495605917,0.9560790702339486\nSPY,20200722,3867700.0,3919000.0,3864100.0,3890900.0,19731553.0,,\nQQQ,20200722,2645100.0,2658900.0,2625400.0,2649300.0,26731843.0,0.9591883858521307,0.9580039911927722\nSPY,20200723,3878900.0,3883400.0,3680300.0,3713800.0,46441599.0,,\nQQQ,20200723,2645100.0,2652400.0,2565500.0,2580100.0,47424354.0,0.9604112786816654,0.9599611566398036\nSPY,20200724,3636300.0,3718800.0,3565800.0,3704600.0,44385196.0,,\nQQQ,20200724,2540400.0,2569300.0,2513200.0,2555600.0,50106555.0,0.9615221501968866,0.9616753636175484\nSPY,20200727,3748600.0,3796200.0,3739200.0,3792400.0,28296482.0,,\nQQQ,20200727,2572600.0,2607500.0,2564500.0,2601200.0,33649763.0,0.9629256041668977,0.9636347786800363\nSPY,20200728,3771500.0,3782100.0,3729900.0,3730100.0,24538559.0,,\nQQQ,20200728,2593100.0,2598400.0,2565100.0,2568100.0,28263635.0,0.9640711128677606,0.9653189907850297\nSPY,20200729,3750000.0,3809200.0,3749000.0,3801600.0,21090305.0,,\nQQQ,20200729,2584000.0,2606600.0,2579100.0,2597700.0,25325691.0,0.9652287006045365,0.9670002034027477\nSPY,20200730,3769000.0,3851900.0,3750700.0,3847600.0,30067346.0,,\nQQQ,20200730,2577400.0,2617100.0,2565500.0,2611300.0,35294253.0,0.9659984398397652,0.967917296637123\nSPY,20200731,4115000.0,4256700.0,4033000.0,4250400.0,88982562.0,,\nQQQ,20200731,2659100.0,2659500.0,2608500.0,2657900.0,48399485.0,0.9667547719239067,0.9688268911533104\nSPY,20200803,4330000.0,4465900.0,4315700.0,4357500.0,74380886.0,,\nQQQ,20200803,2680000.0,2701500.0,2678700.0,2693800.0,27416106.0,0.9674160557025117,0.9696067578448478\nSPY,20200804,4365500.0,4431700.0,4335500.0,4386600.0,41828167.0,,\nQQQ,20200804,2688600.0,2704500.0,2680910.0,2703800.0,22999848.0,0.9678520935977404,0.9698737122123355\nSPY,20200805,4377500.0,4415600.0,4355900.0,4402500.0,28434345.0,,\nQQQ,20200805,2708800.0,2715200.0,2694166.0,2710500.0,20136543.0,0.9683779075017074,0.9702951401744933\nSPY,20200806,4416500.0,4576600.0,4391900.0,4556100.0,48853284.0,,\nQQQ,20200806,2707800.0,2749800.0,2702000.0,2745850.0,24776741.0,0.9687764427039842,0.9708230499349187\nSPY,20200807,4530000.0,4547000.0,4411500.0,4444500.0,46559480.0,,\nQQQ,20200807,2740800.0,2748800.0,2692400.0,2714700.0,42197977.0,0.9693977982777341,0.9716216634219259\nSPY,20200810,4500600.0,4551000.0,4400000.0,4509100.0,51298151.0,,\nQQQ,20200810,2717400.0,2719800.0,2666700.0,2702800.0,32696601.0,0.9695990741220604,0.9722935485715581\nSPY,20200811,4480000.0,4499300.0,4364400.0,4375000.0,44241133.0,,\nQQQ,20200811,2691100.0,2705333.0,2646300.0,2651900.0,39253943.0,0.9696172508042971,0.9727854644846816\nSPY,20200812,4419000.0,4531000.0,4411900.0,4520400.0,40095900.0,,\nQQQ,20200812,2674200.0,2728400.0,2673700.0,2718600.0,35525096.0,0.9698959865732979,0.973482095404334\nSPY,20200813,4580000.0,4641700.0,4557100.0,4600400.0,48991175.0,,\nQQQ,20200813,2726600.0,2748300.0,2715100.0,2724800.0,29986886.0,0.9697731137037731,0.9738487827237202\nSPY,20200814,4587600.0,4600000.0,4521800.0,4596300.0,39205563.0,,\nQQQ,20200814,2731200.0,2733900.0,2707000.0,2721600.0,28896708.0,0.9696619177803738,0.9742109708121938\nSPY,20200817,4640000.0,4643800.0,4558500.0,4584300.0,27472451.0,,\nQQQ,20200817,2739300.0,2758400.0,2737400.0,2753200.0,22159381.0,0.9699744410745113,0.9747261327516998\nSPY,20200818,4574500.0,4640000.0,4560300.0,4622500.0,25044141.0,,\nQQQ,20200818,2764200.0,2784650.0,2749000.0,2779700.0,21794437.0,0.9704819882755881,0.975377021490406\nSPY,20200819,4639700.0,4686500.0,4624300.0,4628300.0,35168834.0,,\nQQQ,20200819,2779300.0,2790200.0,2755700.0,2761000.0,29395264.0,0.9707394515473141,0.975937925610858\nSPY,20200820,4630000.0,4735700.0,4629000.0,4731000.0,30343029.0,,\nQQQ,20200820,2752800.0,2804300.0,2748600.0,2799300.0,25435198.0,0.9710906303713411,0.9765513207586249\nSPY,20200821,4780600.0,4994700.0,4769600.0,4974800.0,80480241.0,,\nQQQ,20200821,2801300.0,2823400.0,2794700.0,2818700.0,29363161.0,0.9707906349625794,0.9771309716745464\nSPY,20200824,5151100.0,5151600.0,4957100.0,5034300.0,82116269.0,,\nQQQ,20200824,2852500.0,2860000.0,2812700.0,2836300.0,34403998.0,0.9704122194493676,0.9773349368092563\nSPY,20200825,4988000.0,5007500.0,4922100.0,4993000.0,50533344.0,,\nQQQ,20200825,2828300.0,2860600.0,2823600.0,2858600.0,33333982.0,0.970543964703506,0.9777398675914009\nSPY,20200826,5049800.0,5079800.0,5003400.0,5060900.0,39166661.0,,\nQQQ,20200826,2871500.0,2922500.0,2869700.0,2919600.0,39113373.0,0.9710441303549309,0.9781328004244446\nSPY,20200827,5085000.0,5099400.0,4953300.0,5000400.0,37351071.0,,\nQQQ,20200827,2929700.0,2938500.0,2887000.0,2910500.0,45601932.0,0.9715821869974314,0.9785152350520253\nSPY,20200828,5040000.0,5057700.0,4983100.0,4992300.0,44109029.0,,\nQQQ,20200828,2923300.0,2931800.0,2909300.0,2925300.0,26005692.0,0.9722585472485715,0.979035646094263\nSPY,20200831,1276700.0,1310000.0,1262500.0,1290400.0,210024091.0,,\nQQQ,20200831,2930700.0,2967450.0,2926200.0,2948800.0,31727310.0,0.9180528697976122,0.9558338621492056\nSPY,20200901,1329100.0,1348000.0,1305300.0,1341800.0,142927370.0,,\nQQQ,20200901,2976200.0,3000400.0,2957900.0,2999200.0,31517742.0,0.8643757932548586,0.9327198132069463\nSPY,20200902,1375800.0,1379800.0,1270000.0,1314000.0,189870444.0,,\nQQQ,20200902,3032800.0,3035100.0,2968900.0,3027600.0,47661474.0,0.8107959846402437,0.9098937150431008\nSPY,20200903,1269700.0,1288400.0,1205000.0,1208800.0,239632199.0,,\nQQQ,20200903,2981000.0,2986200.0,2817000.0,2874100.0,95099057.0,0.7668249662446315,0.8880034569091001\nSPY,20200904,1200000.0,1237000.0,1108900.0,1209600.0,313674294.0,,\nQQQ,20200904,2855600.0,2889300.0,2718000.0,2835800.0,114075652.0,0.7269094299437103,0.8666148630218674\nSPY,20200908,1137400.0,1189900.0,1126800.0,1128200.0,215998176.0,,\nQQQ,20200908,2722200.0,2782200.0,2696600.0,2699500.0,87866075.0,0.6940576997134668,0.8477285913939234\nSPY,20200909,1173000.0,1191400.0,1152600.0,1173200.0,163375192.0,,\nQQQ,20200909,2756400.0,2800500.0,2730000.0,2778800.0,58062975.0,0.6592422692328498,0.8271678559946304\nSPY,20200910,1203700.0,1205000.0,1125000.0,1134900.0,173105110.0,,\nQQQ,20200910,2809400.0,2821990.0,2705500.0,2723400.0,65086110.0,0.627974365102648,0.8076689390907383\nSPY,20200911,1146800.0,1152300.0,1100000.0,1120000.0,173446838.0,,\nQQQ,20200911,2741500.0,2752200.0,2669000.0,2704500.0,68822924.0,0.5985334544198668,0.7890241261884434\nSPY,20200914,1147800.0,1159300.0,1128000.0,1153550.0,131875383.0,,\nQQQ,20200914,2743600.0,2772200.0,2729600.0,2751600.0,35382634.0,0.5683941355953035,0.7695552041573028\nSPY,20200915,1183800.0,1188100.0,1136100.0,1155400.0,174732675.0,,\nQQQ,20200915,2790300.0,2806238.0,2772600.0,2790600.0,39339954.0,0.5375365682864166,0.749470637362939\nSPY,20200916,1153300.0,1160000.0,1120400.0,1121300.0,148185782.0,,\nQQQ,20200916,2798800.0,2803600.0,2742500.0,2746100.0,38840730.0,0.5092894764531978,0.7302581714938231\nSPY,20200917,1097700.0,1122000.0,1087000.0,1103400.0,167927991.0,,\nQQQ,20200917,2675500.0,2723700.0,2666800.0,2703200.0,72649343.0,0.48363339024495744,0.7124224702839983\nSPY,20200918,1104100.0,1108700.0,1060900.0,1068400.0,257836586.0,,\nQQQ,20200918,2717900.0,2720900.0,2626300.0,2668700.0,77618636.0,0.45974557878089045,0.6951026808854983\nSPY,20200921,1045200.0,1101900.0,1031000.0,1100800.0,184509278.0,,\nQQQ,20200921,2624700.0,2676500.0,2600000.0,2675100.0,52105625.0,0.4365288398327233,0.6777903902051862\nSPY,20200922,1126700.0,1128600.0,1091500.0,1118100.0,173469313.0,,\nQQQ,20200922,2699900.0,2730700.0,2665300.0,2724800.0,37039928.0,0.4122931283554226,0.659311047638662\nSPY,20200923,1116300.0,1121100.0,1067700.0,1071200.0,143337239.0,,\nQQQ,20200923,2721000.0,2723400.0,2632600.0,2641600.0,43870199.0,0.39120004903668476,0.6429387182139101\nSPY,20200924,1051800.0,1102500.0,1050000.0,1082200.0,156876677.0,,\nQQQ,20200924,2613900.0,2687000.0,2612200.0,2653900.0,62809100.0,0.37064568921585334,0.6263901688787079\nSPY,20200925,1084900.0,1124400.0,1076800.0,1122800.0,142794694.0,,\nQQQ,20200925,2659100.0,2724000.0,2642900.0,2715600.0,46868512.0,0.34877115733408043,0.6087914238644179\nSPY,20200928,1149100.0,1153200.0,1127800.0,1149600.0,131094725.0,,\nQQQ,20200928,2765800.0,2772000.0,2738500.0,2772000.0,52051448.0,0.3255800333821923,0.5903108294259168\nSPY,20200929,1145200.0,1153200.0,1135700.0,1140900.0,94874590.0,,\nQQQ,20200929,2766200.0,2777200.0,2753700.0,2759500.0,24168938.0,0.30374839876237186,0.5721900662605586\nSPY,20200930,1136700.0,1172600.0,1136200.0,1158100.0,136407147.0,,\nQQQ,20200930,2761500.0,2810900.0,2758800.0,2778400.0,45658941.0,0.2820092804432211,0.5540394188868437\nSPY,20201001,1177200.0,1177200.0,1158300.0,1167900.0,108893988.0,,\nQQQ,20201001,2818700.0,2828700.0,2798410.0,2822500.0,46988396.0,0.2589877613419858,0.5355175849628298\nSPY,20201002,1127400.0,1153700.0,1122200.0,1130200.0,134381717.0,,\nQQQ,20201002,2760200.0,2797800.0,2734400.0,2743100.0,69374529.0,0.23903884399563385,0.5182405382580005\nSPY,20201005,1139100.0,1166500.0,1135500.0,1165000.0,99613735.0,,\nQQQ,20201005,2763400.0,2804900.0,2762300.0,2801600.0,24986321.0,0.21859020587920458,0.500278108710801\nSPY,20201006,1157100.0,1161200.0,1122500.0,1131600.0,155170544.0,,\nQQQ,20201006,2794500.0,2811900.0,2742400.0,2751600.0,45169764.0,0.1999052341335423,0.4831661243842953\nSPY,20201007,1146600.0,1155500.0,1141300.0,1150800.0,91397477.0,,\nQQQ,20201007,2778900.0,2807300.0,2772900.0,2799200.0,25117578.0,0.18008542484945217,0.46569373279515786\nSPY,20201008,1162700.0,1164000.0,1145900.0,1149700.0,79054883.0,,\nQQQ,20201008,2824000.0,2824700.0,2803100.0,2814100.0,22441634.0,0.16059265165159364,0.4482310895414922\nSPY,20201009,1151900.0,1170000.0,1149100.0,1169700.0,94514444.0,,\nQQQ,20201009,2831100.0,2857900.0,2827100.0,2857100.0,27008102.0,0.14082010926504987,0.43061434760017747\nSPY,20201012,1200000.0,1251800.0,1192900.0,1244000.0,226136777.0,,\nQQQ,20201012,2905500.0,2974600.0,2894700.0,2945300.0,73412806.0,0.12036419443853894,0.41255818069067596\nSPY,20201013,1253300.0,1253900.0,1196500.0,1211000.0,248673492.0,,\nQQQ,20201013,2963900.0,2970400.0,2931100.0,2945200.0,52472495.0,0.10019162249759406,0.3946797334355435\nSPY,20201014,1210000.0,1230300.0,1196200.0,1211900.0,144919505.0,,\nQQQ,20201014,2953600.0,2963500.0,2902600.0,2920600.0,34763392.0,0.0814168589840616,0.3772354620448823\nSPY,20201015,1188000.0,1212000.0,1181500.0,1207100.0,105978785.0,,\nQQQ,20201015,2872000.0,2907100.0,2865300.0,2901000.0,39059672.0,0.0635644369057274,0.360295104610913\nSPY,20201016,1213400.0,1215500.0,1188000.0,1190200.0,109798659.0,,\nQQQ,20201016,2917400.0,2932690.0,2881500.0,2885100.0,35321283.0,0.04654078422487655,0.34352871747151587\nSPY,20201019,1199800.0,1204200.0,1156600.0,1159800.0,115626252.0,,\nQQQ,20201019,2905600.0,2914800.0,2827800.0,2838000.0,33555662.0,0.03082015903743464,0.32699404076756183\nSPY,20201020,1160700.0,1189800.0,1156300.0,1175100.0,117201313.0,,\nQQQ,20201020,2846200.0,2876200.0,2829400.0,2844100.0,28804080.0,0.015792662642708375,0.3107353169446535\nSPY,20201021,1164800.0,1187000.0,1164500.0,1168700.0,85131018.0,,\nQQQ,20201021,2845500.0,2873200.0,2836900.0,2841900.0,25921078.0,0.0010254588676589561,0.294559079037275\nSPY,20201022,1174500.0,1180400.0,1145900.0,1157500.0,98341620.0,,\nQQQ,20201022,2850500.0,2859800.0,2808200.0,2841800.0,29136166.0,-0.013250264604908442,0.2785508124487939\nSPY,20201023,1163200.0,1165500.0,1142800.0,1150400.0,78699954.0,,\nQQQ,20201023,2847700.0,2849100.0,2817850.0,2847400.0,21783950.0,-0.027205283649219206,0.2627498854570766\nSPY,20201026,1139700.0,1165500.0,1128800.0,1150500.0,105623648.0,,\nQQQ,20201026,2823800.0,2853000.0,2767600.0,2804700.0,36416689.0,-0.03962458695358366,0.2475181112825159\nSPY,20201027,1155000.0,1172750.0,1145300.0,1166000.0,88006894.0,,\nQQQ,20201027,2815000.0,2835000.0,2802000.0,2826600.0,27735748.0,-0.05188773961641145,0.2322885867238332\nSPY,20201028,1148900.0,1154300.0,1111000.0,1112000.0,138547743.0,,\nQQQ,20201028,2780100.0,2786600.0,2713800.0,2716400.0,47247688.0,-0.06215667158611172,0.21884000806863763\nSPY,20201029,1124200.0,1169300.0,1122000.0,1153200.0,120764972.0,,\nQQQ,20201029,2730000.0,2794900.0,2725200.0,2763900.0,34705839.0,-0.07296361535121439,0.20453245108399176\nSPY,20201030,1110000.0,1119800.0,1077200.0,1088600.0,180368663.0,,\nQQQ,20201030,2743350.0,2752400.0,2670700.0,2693800.0,58415861.0,-0.08206341530701664,0.19217272254004217\nSPY,20201102,1092400.0,1106800.0,1073300.0,1087700.0,117088646.0,,\nQQQ,20201102,2718500.0,2735200.0,2669700.0,2699800.0,36913723.0,-0.09065712866164687,0.17986769631607552\nSPY,20201103,1097100.0,1121136.0,1087300.0,1104400.0,102939716.0,,\nQQQ,20201103,2719600.0,2768200.0,2708400.0,2746500.0,38634028.0,-0.09981584850760893,0.16633100516795732\nSPY,20201104,1141700.0,1155800.0,1123500.0,1149500.0,130107078.0,,\nQQQ,20201104,2835900.0,2887700.0,2818600.0,2869100.0,62887187.0,-0.11094443430321725,0.15168075395142813\nSPY,20201105,1180100.0,1196200.0,1168600.0,1190300.0,119380038.0,,\nQQQ,20201105,2935300.0,2953900.0,2920000.0,2943900.0,46908237.0,-0.12291290138937137,0.13690864851865867\nSPY,20201106,1182400.0,1192000.0,1161300.0,1186900.0,108714236.0,,\nQQQ,20201106,2937100.0,2953600.0,2898300.0,2946100.0,34229573.0,-0.13448161419299498,0.12229661785253608\nSPY,20201109,1202600.0,1219900.0,1160500.0,1163200.0,143638864.0,,\nQQQ,20201109,2976500.0,2991400.0,2881200.0,2885900.0,69321520.0,-0.14477429137090955,0.10833175235331613\nSPY,20201110,1155400.0,1175900.0,1141300.0,1159700.0,128009306.0,,\nQQQ,20201110,2851700.0,2866600.0,2806200.0,2834200.0,62574523.0,-0.1538533320871009,0.09490754453679703\nSPY,20201111,1171500.0,1196300.0,1164400.0,1194900.0,108090635.0,,\nQQQ,20201111,2860300.0,2902500.0,2855300.0,2897600.0,31131846.0,-0.16358583140535965,0.08136560682265792\nSPY,20201112,1196200.0,1205300.0,1185700.0,1192100.0,99357117.0,,\nQQQ,20201112,2907600.0,2920800.0,2872500.0,2884000.0,31267892.0,-0.17275995441990405,0.06800738773856277\nSPY,20201113,1194300.0,1196800.0,1178700.0,1192600.0,77852195.0,,\nQQQ,20201113,2901700.0,2915700.0,2878700.0,2909300.0,22737090.0,-0.18219053214737993,0.054815640229446246\nSPY,20201116,1188800.0,1209900.0,1181500.0,1203000.0,84834352.0,,\nQQQ,20201116,2906200.0,2935200.0,2899900.0,2932000.0,26002717.0,-0.19147660557669055,0.0413434406075279\nSPY,20201117,1194600.0,1206700.0,1189600.0,1193900.0,71696016.0,,\nQQQ,20201117,2934000.0,2937400.0,2916100.0,2922700.0,19878141.0,-0.20037275805477836,0.02819668541597315\nSPY,20201118,1186100.0,1198200.0,1180000.0,1180300.0,70257532.0,,\nQQQ,20201118,2917000.0,2933700.0,2900200.0,2901100.0,25187901.0,-0.20881996001510755,0.015544845717598094\nSPY,20201119,1173900.0,1190600.0,1168100.0,1186400.0,71380389.0,,\nQQQ,20201119,2895400.0,2927000.0,2888500.0,2923800.0,20097304.0,-0.21754481466829248,0.002744531371269128\nSPY,20201120,1186300.0,1187700.0,1172900.0,1173400.0,70773969.0,,\nQQQ,20201120,2923100.0,2930700.0,2902900.0,2903800.0,22316893.0,-0.22591613271254374,-0.009548869530530347\nSPY,20201123,1171300.0,1176200.0,1135100.0,1138500.0,121710863.0,,\nQQQ,20201123,2915300.0,2927500.0,2880600.0,2903900.0,24177232.0,-0.23425403935531655,-0.022018865278759847\nSPY,20201124,1138900.0,1158500.0,1125800.0,1151700.0,109318450.0,,\nQQQ,20201124,2915900.0,2949800.0,2896300.0,2944700.0,22295725.0,-0.24259527309965379,-0.03478731006681588\nSPY,20201125,1156200.0,1167500.0,1151700.0,1160300.0,71597559.0,,\nQQQ,20201125,2955700.0,2969400.0,2946000.0,2962800.0,21366275.0,-0.2509975162450835,-0.04724643267163461\nSPY,20201127,1165300.0,1174900.0,1162150.0,1165900.0,44376849.0,,\nQQQ,20201127,2983100.0,3001700.0,2979100.0,2990100.0,14003962.0,-0.2593012634137916,-0.059494841255872295\nSPY,20201130,1168300.0,1209700.0,1168100.0,1190500.0,154701563.0,,\nQQQ,20201130,2993400.0,2999700.0,2947700.0,2996200.0,25542421.0,-0.26740456097965254,-0.07137131334826587\nSPY,20201201,1210400.0,1234600.0,1200100.0,1227200.0,119871958.0,,\nQQQ,20201201,3019700.0,3051400.0,3008300.0,3034600.0,25607635.0,-0.27576681419807275,-0.08295908473630462\nSPY,20201202,1220900.0,1233700.0,1208900.0,1230800.0,79971583.0,,\nQQQ,20201202,3022500.0,3042000.0,3003500.0,3038500.0,22008272.0,-0.28423933251128725,-0.09436238762234003\nSPY,20201203,1235000.0,1237800.0,1222100.0,1229400.0,72305745.0,,\nQQQ,20201203,3041700.0,3058800.0,3035310.0,3042800.0,21082085.0,-0.29240949796604265,-0.10558497136616893\nSPY,20201204,1225400.0,1228700.0,1215200.0,1222500.0,71261462.0,,\nQQQ,20201204,3043300.0,3056700.0,3036300.0,3055200.0,17540116.0,-0.30035331861315456,-0.11663133519954748\nSPY,20201207,1223500.0,1245700.0,1222200.0,1237500.0,77750844.0,,\nQQQ,20201207,3057200.0,3076300.0,3055200.0,3072500.0,15799078.0,-0.3078755513643586,-0.12747223411606054\nSPY,20201208,1243500.0,1249800.0,1230900.0,1243800.0,73917230.0,,\nQQQ,20201208,3067600.0,3086100.0,3049600.0,3082900.0,16698225.0,-0.3154654209392964,-0.13814516171367625\nSPY,20201209,1244500.0,1259500.0,1210000.0,1217800.0,108033510.0,,\nQQQ,20201209,3081300.0,3083600.0,3002100.0,3013100.0,43692846.0,-0.32231014327142793,-0.1486298714494918\nSPY,20201210,1205300.0,1238700.0,1201500.0,1232400.0,76346631.0,,\nQQQ,20201210,2992100.0,3036800.0,2980900.0,3025200.0,25113732.0,-0.3289066512406037,-0.15892411370762913\nSPY,20201211,1224100.0,1227600.0,1205500.0,1224100.0,80921421.0,,\nQQQ,20201211,3007700.0,3019800.0,2984700.0,3018500.0,24711707.0,-0.3352399175169425,-0.16902488900025076\nSPY,20201214,1226300.0,1233500.0,1215400.0,1217800.0,76642800.0,,\nQQQ,20201214,3030500.0,3060500.0,3030100.0,3040400.0,25957392.0,-0.34147333704407273,-0.1789599761390981\nSPY,20201215,1243200.0,1279000.0,1241300.0,1278800.0,147839243.0,,\nQQQ,20201215,3064000.0,3073636.0,3041100.0,3072900.0,23074931.0,-0.34729770358111633,-0.18865094822267361\nSPY,20201216,1274500.0,1283700.0,1265600.0,1278100.0,93829046.0,,\nQQQ,20201216,3077500.0,3097810.0,3066200.0,3089800.0,22970435.0,-0.3530756376725721,-0.19815745176966384\nSPY,20201217,1289800.0,1295800.0,1280500.0,1287000.0,83049250.0,,\nQQQ,20201217,3107000.0,3112400.0,3093800.0,3110000.0,20697627.0,-0.35881928772628086,-0.20747048831486958\nSPY,20201218,1290000.0,1291000.0,1261200.0,1266550.0,175622774.0,,\nQQQ,20201218,3116000.0,3119700.0,3076100.0,3100600.0,36636019.0,-0.36440526950974533,-0.2166110542770891\nSPY,20201221,1251000.0,1283100.0,1234400.0,1282300.0,106381816.0,,\nQQQ,20201221,3065100.0,3094700.0,3036000.0,3089200.0,32463534.0,-0.36970113387221026,-0.22556190259802378\nSPY,20201222,1316100.0,1344100.0,1296500.0,1318800.0,160595408.0,,\nQQQ,20201222,3097700.0,3107200.0,3068500.0,3097600.0,24534478.0,-0.37459761849099876,-0.23427916575982713\nSPY,20201223,1321700.0,1324300.0,1307800.0,1309600.0,81901772.0,,\nQQQ,20201223,3098800.0,3103500.0,3080400.0,3082000.0,19091918.0,-0.37930694142844024,-0.24283370667594348\nSPY,20201224,1314100.0,1334600.0,1311000.0,1319700.0,52389677.0,,\nQQQ,20201224,3085300.0,3100200.0,3083900.0,3095600.0,11876055.0,-0.38371830884817154,-0.2511887816134758\nSPY,20201228,1340000.0,1373400.0,1335200.0,1366900.0,118820877.0,,\nQQQ,20201228,3123100.0,3131690.0,3103600.0,3126800.0,20724335.0,-0.3879700219955585,-0.2593353921072247\nSPY,20201229,1380500.0,1387890.0,1343400.0,1348700.0,116216209.0,,\nQQQ,20201229,3140900.0,3146900.0,3120300.0,3129600.0,24384741.0,-0.39217104054591423,-0.26728703585498925\nSPY,20201230,1355400.0,1359900.0,1334000.0,1337200.0,91783071.0,,\nQQQ,20201230,3142000.0,3144900.0,3123300.0,3129700.0,16742560.0,-0.39623778716591124,-0.275060210042968\nSPY,20201231,1340000.0,1347400.0,1317200.0,1326900.0,95781876.0,,\nQQQ,20201231,3129200.0,3142400.0,3117700.0,3137400.0,19472357.0,-0.4000484817072544,-0.2826867842354085\nSPY,20210104,1335600.0,1336100.0,1267500.0,1294100.0,134310279.0,,\nQQQ,20210104,3151800.0,3152900.0,3051800.0,3093100.0,41715635.0,-0.40375798918945344,-0.29013451393201334\nSPY,20210105,1289800.0,1317400.0,1284300.0,1310100.0,90751839.0,,\nQQQ,20210105,3084400.0,3121400.0,3082900.0,3118600.0,26190005.0,-0.40735274768388247,-0.29739659453150463\nSPY,20210106,1275300.0,1310400.0,1263800.0,1266000.0,148162644.0,,\nQQQ,20210106,3068200.0,3118900.0,3059800.0,3075400.0,48330659.0,-0.41082919515384614,-0.3044847592273833\nSPY,20210107,1283800.0,1316250.0,1278600.0,1309200.0,101546258.0,,\nQQQ,20210107,3104100.0,3158400.0,3102500.0,3149800.0,27676047.0,-0.4142683141664974,-0.31141732549169415\nSPY,20210108,1325000.0,1326300.0,1302300.0,1320500.0,98370666.0,,\nQQQ,20210108,3173800.0,3193900.0,3150800.0,3190300.0,30741271.0,-0.4175560994044822,-0.3180769383627969\nSPY,20210111,1290000.0,1301700.0,1285000.0,1289800.0,91540256.0,,\nQQQ,20210111,3159500.0,3171900.0,3137600.0,3144200.0,30253406.0,-0.42066510990565603,-0.32461132261668596\nSPY,20210112,1284800.0,1296900.0,1268600.0,1288000.0,86984801.0,,\nQQQ,20210112,3144000.0,3155800.0,3112000.0,3139200.0,26793444.0,-0.4235394487832018,-0.3308974992520259\nSPY,20210113,1286200.0,1314500.0,1284900.0,1308900.0,83856968.0,,\nQQQ,20210113,3142800.0,3168600.0,3135700.0,3160400.0,19774972.0,-0.42640060888376535,-0.33708394291677063\nSPY,20210114,1307600.0,1310000.0,1287500.0,1289100.0,84631818.0,,\nQQQ,20210114,3165700.0,3175300.0,3138700.0,3143500.0,21894878.0,-0.42921061702022745,-0.3431324101409925\nSPY,20210115,1289600.0,1302200.0,1270000.0,1271400.0,105455867.0,,\nQQQ,20210115,3139600.0,3151200.0,3105800.0,3118600.0,31695724.0,-0.43183257237821737,-0.34891811265446554\nSPY,20210119,1277200.0,1287000.0,1269300.0,1278300.0,82744545.0,,\nQQQ,20210119,3143200.0,3169200.0,3131200.0,3164100.0,21457525.0,-0.434478606062687,-0.3545582756541648\nSPY,20210120,1286200.0,1324900.0,1285400.0,1320300.0,97655021.0,,\nQQQ,20210120,3201800.0,3247400.0,3197600.0,3237700.0,28226415.0,-0.4371254647333037,-0.3599063634709374\nSPY,20210121,1338300.0,1395000.0,1335900.0,1368700.0,111368141.0,,\nQQQ,20210121,3251500.0,3271350.0,3237300.0,3263600.0,23050428.0,-0.4394982021385921,-0.3650099929831295\nSPY,20210122,1363400.0,1398500.0,1350200.0,1390700.0,108987826.0,,\nQQQ,20210122,3253200.0,3264600.0,3247100.0,3254200.0,18993700.0,-0.44165230665526567,-0.36986647030030023\nSPY,20210125,1431300.0,1462500.0,1365400.0,1429200.0,149872132.0,,\nQQQ,20210125,3289500.0,3303200.0,3214100.0,3281100.0,35751624.0,-0.4435515295333034,-0.3745644181257104\nSPY,20210126,1435600.0,1443000.0,1413800.0,1431600.0,88575471.0,,\nQQQ,20210126,3289300.0,3297600.0,3272100.0,3285900.0,22007761.0,-0.4455177366229978,-0.379139386949785\nSPY,20210127,1434300.0,1443000.0,1404100.0,1420600.0,117622448.0,,\nQQQ,20210127,3262600.0,3263000.0,3173600.0,3194300.0,46566155.0,-0.4471672540613775,-0.3835051414971972\nSPY,20210128,1395200.0,1421311.0,1367000.0,1370900.0,132668032.0,,\nQQQ,20210128,3206000.0,3264200.0,3200200.0,3213200.0,38276373.0,-0.44885063622568366,-0.3874112245335199\nSPY,20210129,1357000.0,1367400.0,1302100.0,1319600.0,169240240.0,,\nQQQ,20210129,3194900.0,3207100.0,3127600.0,3145600.0,50173676.0,-0.4504932660181083,-0.3913083091063302\nSPY,20210201,1336500.0,1353800.0,1309200.0,1341400.0,101481210.0,,\nQQQ,20210201,3184100.0,3235400.0,3161300.0,3224200.0,32488751.0,-0.4524623276514316,-0.39522564022204326\nSPY,20210202,1356000.0,1363200.0,1346100.0,1349900.0,77143372.0,,\nQQQ,20210202,3255200.0,3288700.0,3253100.0,3276800.0,30132421.0,-0.4544754521856586,-0.39892925782933786\nSPY,20210203,1355600.0,1357700.0,1336100.0,1339400.0,85290931.0,,\nQQQ,20210203,3298900.0,3302000.0,3263200.0,3263800.0,22431939.0,-0.4563374523307965,-0.40246715373361325\nSPY,20210204,1364100.0,1375843.0,1345900.0,1373900.0,75587226.0,,\nQQQ,20210204,3279600.0,3303300.0,3264700.0,3302400.0,19972688.0,-0.45800375230003293,-0.4057118497017776\nSPY,20210205,1373500.0,1374200.0,1358650.0,1367600.0,71738089.0,,\nQQQ,20210205,3313100.0,3324000.0,3295300.0,3313600.0,20409945.0,-0.4596450092166106,-0.4087443319054421\nSPY,20210208,1361100.0,1369600.0,1349200.0,1369100.0,66521628.0,,\nQQQ,20210208,3331800.0,3337400.0,3314100.0,3335800.0,18171176.0,-0.4612685470615945,-0.4116665829310803\nSPY,20210209,1367100.0,1378750.0,1358500.0,1360100.0,72253657.0,,\nQQQ,20210209,3327200.0,3348100.0,3326100.0,3335100.0,16472896.0,-0.46293075138666395,-0.41444635828443954\nSPY,20210210,1364900.0,1369900.0,1344000.0,1353900.0,69469843.0,,\nQQQ,20210210,3349900.0,3354600.0,3295000.0,3327500.0,25751725.0,-0.4645731812744664,-0.4170529132151858\nSPY,20210211,1359800.0,1363900.0,1337700.0,1351300.0,61294694.0,,\nQQQ,20210211,3344400.0,3350000.0,3321200.0,3345800.0,20534222.0,-0.4661633700817059,-0.41945700271690406\nSPY,20210212,1342800.0,1355300.0,1336900.0,1353700.0,58004505.0,,\nQQQ,20210212,3337500.0,3366200.0,3326200.0,3364500.0,18255219.0,-0.467696444302827,-0.4216916211558062\nSPY,20210216,1354700.0,1360100.0,1327000.0,1331900.0,75143402.0,,\nQQQ,20210216,3373500.0,3381900.0,3343400.0,3355400.0,24054540.0,-0.4692823109586537,-0.4238542518866096\nSPY,20210217,1312300.0,1322200.0,1289656.0,1308400.0,93799555.0,,\nQQQ,20210217,3324900.0,3356570.0,3301700.0,3339300.0,28125595.0,-0.4709595274097527,-0.42606299974291373\nSPY,20210218,1292200.0,1299950.0,1274000.0,1297100.0,93027275.0,,\nQQQ,20210218,3301200.0,3338661.0,3283600.0,3324700.0,28453870.0,-0.4726376615894337,-0.42805128524316516\nSPY,20210219,1301600.0,1307100.0,1288000.0,1298700.0,82969578.0,,\nQQQ,20210219,3339900.0,3339900.0,3299700.0,3310200.0,35763999.0,-0.4741723974908692,-0.42985660198533193\nSPY,20210222,1279900.0,1297300.0,1256000.0,1260000.0,99386093.0,,\nQQQ,20210222,3264000.0,3309653.0,3222300.0,3224400.0,40867925.0,-0.47557487781488933,-0.43150632029593083\nSPY,20210223,1237900.0,1267400.0,1183800.0,1258600.0,149836737.0,,\nQQQ,20210223,3168400.0,3232100.0,3110000.0,3214800.0,92411395.0,-0.4770659647288023,-0.43297644427226223\nSPY,20210224,1249800.0,1261667.0,1222300.0,1253500.0,105531170.0,,\nQQQ,20210224,3186600.0,3244500.0,3159500.0,3241300.0,52227753.0,-0.47887929562836173,-0.4342902199450665\nSPY,20210225,1246400.0,1264600.0,1200563.0,1209900.0,139143008.0,,\nQQQ,20210225,3214400.0,3241953.0,3112400.0,3128300.0,102454568.0,-0.4802645467429493,-0.4353816585819196\nSPY,20210226,1226100.0,1248500.0,1212000.0,1212600.0,149612830.0,,\nQQQ,20210226,3158300.0,3191200.0,3108700.0,3141400.0,94147142.0,-0.4825249635708076,-0.43636024148888847\nSPY,20210301,1237800.0,1279300.0,1227900.0,1277900.0,110211547.0,,\nQQQ,20210301,3194800.0,3239400.0,3179350.0,3235900.0,44420555.0,-0.48483715055069415,-0.43710598915247517\nSPY,20210302,1284200.0,1287200.0,1250100.0,1251200.0,95815822.0,,\nQQQ,20210302,3242600.0,3243397.0,3181400.0,3184000.0,45149257.0,-0.48597202537859985,-0.43762902484413096\nSPY,20210303,1247700.0,1257200.0,1218399.0,1220600.0,105107985.0,,\nQQQ,20210303,3171300.0,3182400.0,3091000.0,3091600.0,81334799.0,-0.48719063472166596,-0.4377073864638844\nSPY,20210304,1217200.0,1236000.0,1186150.0,1201300.0,162524577.0,,\nQQQ,20210304,3086600.0,3140000.0,3001050.0,3041000.0,133918263.0,-0.4876900534435391,-0.4376773915855099\nSPY,20210305,1209600.0,1219350.0,1175600.0,1214200.0,147534127.0,,\nQQQ,20210305,3069500.0,3096667.0,2974500.0,3086800.0,112054692.0,-0.48865628014967794,-0.43742281005530603\nSPY,20210308,1209200.0,1210000.0,1162100.0,1163600.0,146625101.0,,\nQQQ,20210308,3081100.0,3100600.0,2995100.0,2999400.0,81723076.0,-0.4894404134619927,-0.43720834667492825\nSPY,20210309,1191000.0,1220600.0,1187900.0,1210850.0,120468403.0,,\nQQQ,20210309,3076500.0,3137300.0,3069200.0,3117700.0,74021178.0,-0.49222137328967636,-0.4368266618476123\nSPY,20210310,1216300.0,1221700.0,1194500.0,1199800.0,106188810.0,,\nQQQ,20210310,3162800.0,3164700.0,3101600.0,3108800.0,70751807.0,-0.4936296550007708,-0.4363741141201367\nSPY,20210311,1224700.0,1232200.0,1199800.0,1219600.0,96995435.0,,\nQQQ,20210311,3160100.0,3198600.0,3148500.0,3180400.0,49817297.0,-0.4959899441294874,-0.43586795054756655\nSPY,20210312,1203100.0,1219600.0,1191600.0,1210300.0,84418265.0,,\nQQQ,20210312,3137800.0,3182302.0,3113900.0,3154600.0,61570587.0,-0.5011679180013265,-0.4353212938891909\nSPY,20210315,1214500.0,1240000.0,1204200.0,1239900.0,85568838.0,,\nQQQ,20210315,3158000.0,3190000.0,3140950.0,3188300.0,39818985.0,-0.503509989276492,-0.4342680987222653\nSPY,20210316,1257100.0,1272200.0,1247100.0,1255700.0,110417901.0,,\nQQQ,20210316,3212300.0,3242000.0,3189554.0,3205800.0,52496933.0,-0.5101018776803602,-0.4330728028190405\nSPY,20210317,1241000.0,1258599.0,1223360.0,1247600.0,108018092.0,,\nQQQ,20210317,3174200.0,3238600.0,3156800.0,3219000.0,74074006.0,-0.5148248588585277,-0.4317425299631303\nSPY,20210318,1229100.0,1231800.0,1203200.0,1205300.0,116917364.0,,\nQQQ,20210318,3169200.0,3178801.0,3115700.0,3120400.0,72715984.0,-0.5204449267534047,-0.430338019783243\nSPY,20210319,1201500.0,1214300.0,1196700.0,1199900.0,157394857.0,,\nQQQ,20210319,3119300.0,3147300.0,3096601.0,3131400.0,74114866.0,-0.5262779579502722,-0.42898450089659257\nSPY,20210322,1202600.0,1238700.0,1202600.0,1233900.0,100349204.0,,\nQQQ,20210322,3154100.0,3207500.0,3152000.0,3186100.0,50067564.0,-0.5344259991906793,-0.42714056574851855\nSPY,20210323,1233400.0,1242400.0,1221400.0,1225400.0,92996567.0,,\nQQQ,20210323,3196800.0,3210900.0,3163700.0,3172200.0,50079047.0,-0.5432717863145476,-0.4252486387950453\nSPY,20210324,1228300.0,1229000.0,1200650.0,1200900.0,84561533.0,,\nQQQ,20210324,3185400.0,3186700.0,3117200.0,3118700.0,61930710.0,-0.5487872710505961,-0.4232314832243585\nSPY,20210325,1194100.0,1216600.0,1190000.0,1205900.0,94704046.0,,\nQQQ,20210325,3099900.0,3134344.0,3073850.0,3113300.0,73199853.0,-0.5546788307526849,-0.4209361251567479\nSPY,20210326,1203500.0,1214800.0,1189200.0,1212100.0,90549889.0,,\nQQQ,20210326,3110200.0,3163300.0,3096700.0,3160000.0,59438321.0,-0.5588861476151946,-0.4186542647844058\nSPY,20210329,1216700.0,1225800.0,1207200.0,1213900.0,75279258.0,,\nQQQ,20210329,3155200.0,3169900.0,3124600.0,3159100.0,50225374.0,-0.5646413993413743,-0.4162081824529632\nSPY,20210330,1200100.0,1213900.0,1188600.0,1199000.0,83655585.0,,\nQQQ,20210330,3140500.0,3157420.0,3115400.0,3143200.0,41179093.0,-0.5692654107399832,-0.41382583923806654\nSPY,20210331,1216500.0,1235400.0,1211500.0,1221500.0,109019052.0,,\nQQQ,20210331,3161400.0,3207400.0,3150500.0,3191300.0,50120342.0,-0.5742656593616626,-0.41104831350058546\n"
  },
  {
    "path": "Tests/TestData/spy_qqq_cov.csv",
    "content": "Symbol,Date,Open,High,Low,Close,Volume,Covariance\nSPY,20000308 00:00,1364700,1378400,1350300,1370500,11415800,0.0002057897906935883\nQQQ,20000308 00:00,2220000,2240000,2125600,2222300,21500300,0.0002057897906935883\nSPY,20000309 00:00,1372500,1405900,1361300,1405900,5019700,0.00020870426821456632\nQQQ,20000309 00:00,2224400,2335200,2181900,2293800,15018800,0.00020870426821456632\nSPY,20000310 00:00,1401900,1420000,1395300,1400000,7541900,0.0002082728090128403\nQQQ,20000310 00:00,2297500,2328800,2270200,2292500,14530700,0.0002082728090128403\nSPY,20000313 00:00,1366900,1404700,1356900,1388800,10611500,0.00020837676611924576\nQQQ,20000313 00:00,2200000,2282500,2190600,2215000,18525700,0.00020837676611924576\nSPY,20000314 00:00,1392800,1400900,1361600,1365000,7658200,0.00021176204408761376\nQQQ,20000314 00:00,2255000,2267500,2110000,2114400,19050900,0.00021176204408761376\nSPY,20000315 00:00,1368800,1404400,1325000,1395000,9382100,0.00020909281628794096\nQQQ,20000315 00:00,2130000,2140000,2037500,2060000,25181900,0.00020909281628794096\nSPY,20000316 00:00,1416300,1466900,1408800,1463100,22099800,0.00021837867270050937\nQQQ,20000316 00:00,2107500,2185000,2020000,2175000,27753800,0.00021837867270050937\nSPY,20000317 00:00,1458100,1480000,1454400,1466900,9838300,0.0002167905741962602\nQQQ,20000317 00:00,2160000,2219800,2099400,2217300,15175600,0.0002167905741962602\nSPY,20000320 00:00,1468800,1473400,1447800,1459800,12307100,0.00022785280867019037\nQQQ,20000320 00:00,1110000,1130000,1060800,1068100,20882300,0.00022785280867019037\nSPY,20000321 00:00,1455300,1497200,1445000,1497200,12668600,0.000227764178964046\nQQQ,20000321 00:00,1061300,1115000,1035600,1111900,32973700,0.000227764178964046\nSPY,20000322 00:00,1495600,1508400,1486900,1500000,8026500,0.0002275034037793908\nQQQ,20000322 00:00,1135000,1159700,1111300,1146400,24162100,0.0002275034037793908\nSPY,20000323 00:00,1491600,1534700,1491600,1526300,10541800,0.00022622719496916138\nQQQ,20000323 00:00,1144800,1177500,1135600,1165000,18691200,0.00022622719496916138\nSPY,20000324 00:00,1528800,1557500,1517200,1532800,11529700,0.0002260477691249312\nQQQ,20000324 00:00,1174800,1205000,1150200,1172500,21882800,0.0002260477691249312\nSPY,20000327 00:00,1533800,1537800,1520000,1525000,8327400,0.00022297956874618786\nQQQ,20000327 00:00,1180000,1195000,1171300,1176900,11821900,0.00022297956874618786\nSPY,20000328 00:00,1512500,1529800,1507500,1510000,5989100,0.00022382148000659477\nQQQ,20000328 00:00,1169800,1178100,1145300,1149400,18001000,0.00022382148000659477\nSPY,20000329 00:00,1515600,1524800,1496600,1510300,6497400,0.00022299328117500125\nQQQ,20000329 00:00,1153800,1154400,1100000,1100200,27132300,0.00022299328117500125\nSPY,20000330 00:00,1501600,1519400,1471300,1488800,9297700,0.00022459096633241065\nQQQ,20000330 00:00,1072500,1127500,1035000,1064400,42153000,0.00022459096633241065\nSPY,20000331 00:00,1496300,1523100,1484400,1505600,8466800,0.00022280149584581578\nQQQ,20000331 00:00,1081400,1106300,1040000,1099800,31164500,0.00022280149584581578\nSPY,20000403 00:00,1501300,1510300,1486900,1507700,7490200,0.0002225129659515736\nQQQ,20000403 00:00,1077700,1091300,1007500,1021900,30483400,0.0002225129659515736\nSPY,20000404 00:00,1517500,1530000,1413900,1500000,19282600,0.0002231361257456741\nQQQ,20000404 00:00,1036300,1060000,883100,1010600,66719600,0.0002231361257456741\nSPY,20000405 00:00,1478800,1508100,1476300,1488800,8021800,0.00022276374026699593\nQQQ,20000405 00:00,975000,1039400,962500,1001300,36884700,0.00022276374026699593\nSPY,20000406 00:00,1502500,1516900,1490000,1503100,5914800,0.00022333847125507913\nQQQ,20000406 00:00,1023800,1038800,997500,1018100,29610300,0.00022333847125507913\nSPY,20000407 00:00,1515600,1521300,1505000,1517800,5785800,0.00022529248581676248\nQQQ,20000407 00:00,1041300,1070000,1026300,1070000,20359300,0.00022529248581676248\nSPY,20000410 00:00,1517500,1531100,1503100,1507800,9456200,0.00022661727551164342\nQQQ,20000410 00:00,1076300,1076900,1000000,1000000,26572700,0.00022661727551164342\nSPY,20000411 00:00,1500000,1516300,1483800,1500600,13823200,0.0002249537020859923\nQQQ,20000411 00:00,971300,1015000,951300,975000,34431600,0.0002249537020859923\nSPY,20000412 00:00,1503800,1511600,1465600,1466300,9981900,0.00023161984858609077\nQQQ,20000412 00:00,976300,987500,905000,907500,34016500,0.00023161984858609077\nSPY,20000413 00:00,1474700,1481600,1437800,1440000,11909800,0.00023279904119664042\nQQQ,20000413 00:00,928100,965000,883600,888800,46695000,0.00023279904119664042\nSPY,20000414 00:00,1426300,1428100,1335000,1358100,27304000,0.00024973939223846113\nQQQ,20000414 00:00,860600,885000,780000,802500,59724100,0.00024973939223846113\nSPY,20000417 00:00,1351900,1401300,1266900,1400600,23564600,0.00025974128900107797\nQQQ,20000417 00:00,780200,880000,780000,876300,55296400,0.00025974128900107797\nSPY,20000418 00:00,1405600,1442200,1397800,1442200,10593700,0.0002625915022163493\nQQQ,20000418 00:00,894800,926300,873800,925000,36234200,0.0002625915022163493\nSPY,20000419 00:00,1445000,1451300,1425300,1430000,6276600,0.00026125182950232473\nQQQ,20000419 00:00,925000,942500,891900,896900,27710800,0.00026125182950232473\nSPY,20000420 00:00,1435600,1439400,1423800,1433800,8187000,0.0002610742804525401\nQQQ,20000420 00:00,903800,909700,861900,873100,21119200,0.0002610742804525401\nSPY,20000424 00:00,1415000,1432800,1405000,1430000,12621000,0.0002612145777093793\nQQQ,20000424 00:00,834400,850000,798800,843800,30763800,0.0002612145777093793\nSPY,20000425 00:00,1446300,1479700,1444400,1478800,13812600,0.00027070939646440124\nQQQ,20000425 00:00,865000,902500,860000,901900,28058500,0.00027070939646440124\nSPY,20000426 00:00,1479700,1487500,1460000,1463800,7411100,0.0002710511061088578\nQQQ,20000426 00:00,906300,924200,872500,872500,25610400,0.0002710511061088578\nSPY,20000427 00:00,1430000,1473400,1430000,1465000,15325600,0.00027084670162265824\nQQQ,20000427 00:00,835000,975000,822500,922500,36393500,0.00027084670162265824\nSPY,20000428 00:00,1470000,1478600,1450600,1452200,8173500,0.000270137309381801\nQQQ,20000428 00:00,935600,947500,828900,942500,23397200,0.000270137309381801\nSPY,20000501 00:00,1465600,1484800,1436300,1471900,6737100,0.0002707309638195227\nQQQ,20000501 00:00,957500,968800,942500,957500,23529300,0.0002707309638195227\nSPY,20000502 00:00,1455000,1471300,1445000,1446300,8785100,0.0002733279917402526\nQQQ,20000502 00:00,948800,956300,905000,905000,19892700,0.0002733279917402526\nSPY,20000503 00:00,1440000,1440000,1397800,1416300,11442100,0.00027343563280416295\nQQQ,20000503 00:00,895000,902500,855200,889400,26339900,0.00027343563280416295\nSPY,20000504 00:00,1420000,1423600,1407500,1413100,5713300,0.00027184187395379203\nQQQ,20000504 00:00,890000,907500,873800,891300,16999400,0.00027184187395379203\nSPY,20000505 00:00,1410600,1440000,1409400,1433400,7416300,0.0002731565056529293\nQQQ,20000505 00:00,881300,923100,880300,920000,20170400,0.0002731565056529293\nSPY,20000508 00:00,1427500,1433800,1418400,1425300,4530300,0.0002742773782454335\nQQQ,20000508 00:00,905000,907500,880600,880600,13131400,0.0002742773782454335\nSPY,20000509 00:00,1430600,1434100,1402700,1416300,5299000,0.00027399755755408206\nQQQ,20000509 00:00,885000,891300,843100,861600,19798000,0.00027399755755408206\nSPY,20000510 00:00,1405000,1409700,1377500,1385900,9882100,0.0002787090284755059\nQQQ,20000510 00:00,843800,923000,807500,809800,33201800,0.0002787090284755059\nSPY,20000511 00:00,1401300,1415000,1391300,1411100,6838500,0.00028202250771199727\nQQQ,20000511 00:00,827500,845000,808800,845000,24141600,0.00028202250771199727\nSPY,20000512 00:00,1418100,1434700,1415600,1424100,5805300,0.0002803838337035779\nQQQ,20000512 00:00,853800,875600,840000,848100,17512200,0.0002803838337035779\nSPY,20000515 00:00,1427500,1455900,1420000,1453800,4193500,0.00028339696930671605\nQQQ,20000515 00:00,848100,879400,826300,879400,18046800,0.00028339696930671605\nSPY,20000516 00:00,1465600,1477200,1453100,1470000,7907600,0.00028476563206841895\nQQQ,20000516 00:00,900000,915000,880600,911300,23360000,0.00028476563206841895\nSPY,20000517 00:00,1456900,1461900,1444700,1452500,5507300,0.0002856199144820231\nQQQ,20000517 00:00,892500,905000,877500,887500,19724600,0.0002856199144820231\nSPY,20000518 00:00,1456300,1463100,1439400,1440600,4718200,0.0002864173905886634\nQQQ,20000518 00:00,890000,898800,855600,856300,18813400,0.0002864173905886634\nSPY,20000519 00:00,1425600,1432300,1404100,1408800,5731800,0.00029033584080430906\nQQQ,20000519 00:00,837500,850000,813100,815900,27104000,0.00029033584080430906\nSPY,20000522 00:00,1412500,1414700,1370000,1404100,10008900,0.0002884685011059809\nQQQ,20000522 00:00,816300,818800,755800,816300,44383800,0.0002884685011059809\nSPY,20000523 00:00,1404400,1408100,1375600,1375600,7422700,0.0002923202178742487\nQQQ,20000523 00:00,813800,857800,753100,757500,30734700,0.0002923202178742487\nSPY,20000524 00:00,1380000,1406900,1276300,1404100,10710100,0.0002948209213410198\nQQQ,20000524 00:00,750000,800000,722500,794400,49939800,0.0002948209213410198\nSPY,20000525 00:00,1406900,1418100,1377200,1388800,7101900,0.00029580621473988627\nQQQ,20000525 00:00,802500,822500,765000,775600,29384200,0.00029580621473988627\nSPY,20000526 00:00,1388100,1396900,1373300,1383100,4605900,0.0002946350815670895\nQQQ,20000526 00:00,777500,792500,722700,775200,17858000,0.0002946350815670895\nSPY,20000530 00:00,1400000,1426900,1394700,1426300,5037500,0.0003058656993286252\nQQQ,20000530 00:00,800000,852500,790000,850000,31747000,0.0003058656993286252\nSPY,20000531 00:00,1425600,1440000,1420900,1424100,5541700,0.00030617730625650066\nQQQ,20000531 00:00,844700,866700,827500,827500,29489300,0.00030617730625650066\nSPY,20000601 00:00,1436900,1453800,1430000,1451700,8473400,0.00031082005580203325\nQQQ,20000601 00:00,851900,883800,831900,876300,28593900,0.00031082005580203325\nSPY,20000602 00:00,1489400,1490900,1474800,1480900,8538300,0.00031415440365337253\nQQQ,20000602 00:00,926300,1083100,825000,933800,31332700,0.00031415440365337253\nSPY,20000605 00:00,1474700,1482200,1468800,1472500,6629400,0.00031326602370802424\nQQQ,20000605 00:00,922500,953100,918800,930600,23338800,0.00031326602370802424\nSPY,20000606 00:00,1466300,1477800,1459100,1463400,4847700,0.00031242556722713166\nQQQ,20000606 00:00,931900,950000,910000,911300,22103400,0.00031242556722713166\nSPY,20000607 00:00,1466300,1480000,1460000,1475600,4402800,0.000313061687715948\nQQQ,20000607 00:00,915600,931300,895600,929400,22159300,0.000313061687715948\nSPY,20000608 00:00,1475000,1477500,1460600,1465600,5458000,0.00031250838443407905\nQQQ,20000608 00:00,946300,948800,916300,927500,19062800,0.00031250838443407905\nSPY,20000609 00:00,1475000,1479700,1455300,1463400,2865600,0.00031184938566171584\nQQQ,20000609 00:00,947500,949200,925600,936900,16509900,0.00031184938566171584\nSPY,20000612 00:00,1469700,1469700,1451300,1452800,3294200,0.00031272008571610126\nQQQ,20000612 00:00,943100,943100,908800,909800,15911800,0.00031272008571610126\nSPY,20000613 00:00,1448100,1477500,1446300,1474700,6277200,0.00031428458989954795\nQQQ,20000613 00:00,905000,938800,893600,938800,24877300,0.00031428458989954795\nSPY,20000614 00:00,1482500,1488800,1471900,1475000,6227300,0.00030977132471721945\nQQQ,20000614 00:00,948800,948800,913800,917500,19879200,0.00030977132471721945\nSPY,20000615 00:00,1481300,1487500,1468400,1482500,5566200,0.0003098285734813166\nQQQ,20000615 00:00,918800,938100,817700,935600,18513300,0.0003098285734813166\nSPY,20000616 00:00,1483100,1483100,1458800,1468800,5010200,0.00030949151189757474\nQQQ,20000616 00:00,947500,959400,930600,946300,21969800,0.00030949151189757474\nSPY,20000619 00:00,1464700,1491600,1462500,1486600,4748700,0.0003106725258460525\nQQQ,20000619 00:00,940200,989400,926900,981300,19736000,0.0003106725258460525\nSPY,20000620 00:00,1481900,1488800,1470000,1478100,8314200,0.0003095932377397381\nQQQ,20000620 00:00,982500,996900,971900,982500,20659300,0.0003095932377397381\nSPY,20000621 00:00,1469400,1484400,1468900,1479500,2953900,0.0003097810635050923\nQQQ,20000621 00:00,968100,997200,966900,989400,20680400,0.0003097810635050923\nSPY,20000622 00:00,1475600,1476900,1450000,1455300,7127200,0.00031116441726990077\nQQQ,20000622 00:00,986300,996300,950000,952500,21247800,0.00031116441726990077\nSPY,20000623 00:00,1458100,1461300,1438800,1443800,4198700,0.00031238521574299735\nQQQ,20000623 00:00,950000,955000,914400,918100,24185800,0.00031238521574299735\nSPY,20000626 00:00,1453800,1462500,1448800,1457500,4770700,0.00031196219234383584\nQQQ,20000626 00:00,930600,944200,920000,939400,22647600,0.00031196219234383584\nSPY,20000627 00:00,1459800,1467200,1453100,1455600,3585500,0.0003112372841605741\nQQQ,20000627 00:00,937700,950600,921300,926600,14657300,0.0003112372841605741\nSPY,20000628 00:00,1456300,1469800,1452200,1456300,5585500,0.0003107029863154296\nQQQ,20000628 00:00,929800,955000,925000,941300,18793000,0.0003107029863154296\nSPY,20000629 00:00,1447500,1457500,1435200,1444400,6081000,0.00031136641117078046\nQQQ,20000629 00:00,929400,933800,906300,916300,21115000,0.00031136641117078046\nSPY,20000630 00:00,1439400,1455300,1438900,1453800,6673700,0.0003115876536620335\nQQQ,20000630 00:00,918100,939500,913100,937500,14225300,0.0003115876536620335\nSPY,20000703 00:00,1454400,1474400,1451600,1472800,1436600,0.00031225060806887496\nQQQ,20000703 00:00,935000,952500,932500,952500,5219200,0.00031225060806887496\nSPY,20000705 00:00,1463800,1466600,1443800,1450900,2447900,0.00031462192779804\nQQQ,20000705 00:00,936300,939700,908800,912500,15877900,0.00031462192779804\nSPY,20000706 00:00,1449400,1464700,1442200,1458800,5394400,0.00031536458657978057\nQQQ,20000706 00:00,915600,947500,900600,945000,22878900,0.00031536458657978057\nSPY,20000707 00:00,1466900,1487800,1462200,1480900,2796000,0.000316074135626598\nQQQ,20000707 00:00,950000,979700,930000,958800,16126000,0.000316074135626598\nSPY,20000710 00:00,1478800,1489100,1476300,1479700,2468600,0.0003161366658872676\nQQQ,20000710 00:00,946900,958800,921300,941900,12520300,0.0003161366658872676\nSPY,20000711 00:00,1474700,1491300,1471600,1483800,5233700,0.00031595864333202933\nQQQ,20000711 00:00,940600,957500,928100,935000,14307200,0.00031595864333202933\nSPY,20000712 00:00,1492800,1501300,1486900,1495900,5507100,0.0003170304329392114\nQQQ,20000712 00:00,954400,978800,942500,971400,17877700,0.0003170304329392114\nSPY,20000713 00:00,1499800,1503800,1491900,1498800,5108200,0.00031683665732945814\nQQQ,20000713 00:00,979400,999700,943100,987500,19184000,0.00031683665732945814\nSPY,20000714 00:00,1504400,1512500,1496700,1508800,5512500,0.00031712326720155314\nQQQ,20000714 00:00,1002500,1015600,988100,1008600,16775700,0.00031712326720155314\nSPY,20000717 00:00,1509800,1519800,1506900,1510600,3566600,0.00031673804939913035\nQQQ,20000717 00:00,1009400,1020600,916100,1015200,12798100,0.00031673804939913035\nSPY,20000718 00:00,1506300,1506300,1493400,1496900,3678300,0.0003141832558032124\nQQQ,20000718 00:00,1003800,1009700,983600,990000,20309800,0.0003141832558032124\nSPY,20000719 00:00,1494700,1499100,1482500,1484400,8163200,0.00031523056568306284\nQQQ,20000719 00:00,983100,989400,878300,960600,21249600,0.00031523056568306284\nSPY,20000720 00:00,1490000,1505000,1488100,1498100,4139400,0.0003148075322967518\nQQQ,20000720 00:00,978800,998800,873900,995000,19233600,0.0003148075322967518\nSPY,20000721 00:00,1497500,1497500,1478800,1482500,5062300,0.0003157238978881878\nQQQ,20000721 00:00,984400,995200,971400,976900,13855200,0.0003157238978881878\nSPY,20000724 00:00,1481300,1488600,1465600,1466600,5520000,0.0003164847926950686\nQQQ,20000724 00:00,979400,990000,943100,946300,18282200,0.0003164847926950686\nSPY,20000725 00:00,1477500,1478400,1467800,1474400,4247400,0.0003155940595779845\nQQQ,20000725 00:00,956300,967300,938100,962500,19678200,0.0003155940595779845\nSPY,20000726 00:00,1469700,1471600,1456400,1461600,11008600,0.0003158990363293526\nQQQ,20000726 00:00,955000,961300,932500,953100,20265800,0.0003158990363293526\nSPY,20000727 00:00,1459400,1466300,1446900,1455000,7169400,0.00031460778450750063\nQQQ,20000727 00:00,939400,950600,916300,919800,25065100,0.00031460778450750063\nSPY,20000728 00:00,1457200,1459100,1415200,1422500,5674800,0.00031976946956194496\nQQQ,20000728 00:00,921900,928800,860000,867500,36466800,0.00031976946956194496\nSPY,20000731 00:00,1429400,1441300,1420600,1434400,4837700,0.00032097312622650744\nQQQ,20000731 00:00,876300,901300,857200,901300,28653800,0.00032097312622650744\nSPY,20000801 00:00,1436300,1447200,1431300,1440000,3742800,0.00032045257742645473\nQQQ,20000801 00:00,898100,998300,874800,879800,15374700,0.00032045257742645473\nSPY,20000802 00:00,1438800,1454100,1436300,1442700,7275200,0.00031955213181950395\nQQQ,20000802 00:00,878800,903900,868800,870900,22761400,0.00031955213181950395\nSPY,20000803 00:00,1428800,1458100,1426300,1455000,4363300,0.0003204707094310574\nQQQ,20000803 00:00,842500,905000,793100,905000,35322400,0.0003204707094310574\nSPY,20000804 00:00,1463100,1467200,1454100,1465300,3492400,0.0003199178210077373\nQQQ,20000804 00:00,920000,927700,891300,902500,21894100,0.0003199178210077373\nSPY,20000807 00:00,1467200,1484400,1463800,1481300,4067300,0.00032098064309183494\nQQQ,20000807 00:00,908800,930300,902500,927000,14571900,0.00032098064309183494\nSPY,20000808 00:00,1475000,1488100,1475000,1485600,3161200,0.00032030691784076234\nQQQ,20000808 00:00,920600,934400,915000,920600,14047000,0.00032030691784076234\nSPY,20000809 00:00,1491400,1492200,1473800,1476900,5205000,0.0003178886050642728\nQQQ,20000809 00:00,936900,944400,920000,924700,17560500,0.0003178886050642728\nSPY,20000810 00:00,1475300,1478600,1462800,1465600,3987200,0.0003186502603766401\nQQQ,20000810 00:00,918100,922300,896900,897500,15177500,0.0003186502603766401\nSPY,20000811 00:00,1466300,1480000,1455600,1474400,4739000,0.0003147879053185288\nQQQ,20000811 00:00,892500,911100,878800,909400,20686000,0.0003147879053185288\nSPY,20000814 00:00,1477800,1495000,1470600,1493800,2682600,0.00031583530665916474\nQQQ,20000814 00:00,913800,929700,902000,928800,11959600,0.00031583530665916474\nSPY,20000815 00:00,1493400,1498100,1473400,1490200,4731200,0.000315479481310612\nQQQ,20000815 00:00,927500,939800,920000,929800,13981800,0.000315479481310612\nSPY,20000816 00:00,1493100,1499400,1478400,1483800,4843200,0.00031526255868359376\nQQQ,20000816 00:00,934400,946900,920000,928900,15201600,0.00031526255868359376\nSPY,20000817 00:00,1486900,1504400,1483400,1499400,5401400,0.0003159893532169637\nQQQ,20000817 00:00,929400,958800,928800,955600,14138600,0.0003159893532169637\nSPY,20000818 00:00,1503800,1503800,1491600,1496700,4350300,0.0003157236407712105\nQQQ,20000818 00:00,959400,966300,946900,949400,14175900,0.0003157236407712105\nSPY,20000821 00:00,1500300,1507200,1494100,1503600,2058200,0.000313550775567859\nQQQ,20000821 00:00,960000,968600,943800,955200,13089000,0.000313550775567859\nSPY,20000822 00:00,1505600,1513100,1500900,1502300,2831300,0.00031354174751822774\nQQQ,20000822 00:00,960000,973600,954400,955000,14501500,0.00031354174751822774\nSPY,20000823 00:00,1498100,1512800,1491900,1509100,5518000,0.0003125432970776198\nQQQ,20000823 00:00,946900,974400,938100,972200,21260400,0.0003125432970776198\nSPY,20000824 00:00,1511600,1515500,1500900,1514400,4636200,0.0003116986387379019\nQQQ,20000824 00:00,974400,986900,960600,985900,13294500,0.0003116986387379019\nSPY,20000825 00:00,1511600,1516300,1509400,1510900,2700900,0.0003114619360540849\nQQQ,20000825 00:00,984800,999500,968800,981300,11603100,0.0003114619360540849\nSPY,20000828 00:00,1512500,1529100,1512500,1517800,5721600,0.0003100898718769409\nQQQ,20000828 00:00,982500,998400,979400,986900,12159300,0.0003100898718769409\nSPY,20000829 00:00,1514400,1518800,1509100,1515000,3375600,0.0003101953577606443\nQQQ,20000829 00:00,986300,995500,978400,986400,11256200,0.0003101953577606443\nSPY,20000830 00:00,1513100,1517800,1504500,1506300,3854400,0.0003099788755814893\nQQQ,20000830 00:00,983100,995000,977700,991700,9802300,0.0003099788755814893\nSPY,20000831 00:00,1510600,1530900,1508400,1522500,5246300,0.0003108364918112291\nQQQ,20000831 00:00,996300,1018100,988800,1017000,15360900,0.0003108364918112291\nSPY,20000901 00:00,1532500,1535900,1520000,1525600,2983800,0.0003056014900180391\nQQQ,20000901 00:00,1030000,1039700,1011900,1023100,13990200,0.0003056014900180391\nSPY,20000905 00:00,1518800,1522000,1508100,1512500,3202700,0.00030649289093102465\nQQQ,20000905 00:00,1016300,1035600,994200,996100,16152400,0.00030649289093102465\nSPY,20000906 00:00,1511900,1519500,1496900,1496900,3930600,0.00030779647897849526\nQQQ,20000906 00:00,992500,994800,957500,958800,21246800,0.00030779647897849526\nSPY,20000907 00:00,1502500,1510800,1498300,1507500,4187500,0.00030845931050426767\nQQQ,20000907 00:00,968100,994200,965600,986300,16257200,0.00030845931050426767\nSPY,20000908 00:00,1502800,1505000,1493300,1497500,3067500,0.0003093350500505445\nQQQ,20000908 00:00,977700,980000,926300,953100,23168400,0.0003093350500505445\nSPY,20000911 00:00,1497500,1511900,1486900,1494700,3726500,0.0003092379701079838\nQQQ,20000911 00:00,945000,977500,920000,926300,26901000,0.0003092379701079838\nSPY,20000912 00:00,1497500,1502500,1484400,1487500,4628300,0.0003097550623341752\nQQQ,20000912 00:00,935000,946900,908400,915900,33512800,0.0003097550623341752\nSPY,20000913 00:00,1480000,1498400,1476600,1488800,4335400,0.00030859234000278163\nQQQ,20000913 00:00,902500,937500,850000,933100,33216900,0.00030859234000278163\nSPY,20000914 00:00,1498800,1499400,1481600,1485300,3442900,0.0003085980041355626\nQQQ,20000914 00:00,952500,962500,926400,932300,27741100,0.0003085980041355626\nSPY,20000915 00:00,1481900,1482500,1460300,1467500,3880800,0.000308473970021707\nQQQ,20000915 00:00,931300,936300,906900,915800,23981000,0.000308473970021707\nSPY,20000918 00:00,1463800,1469700,1442000,1446900,4960300,0.00030979392283386525\nQQQ,20000918 00:00,918100,942500,880000,895000,28672900,0.00030979392283386525\nSPY,20000919 00:00,1451300,1463100,1447000,1460800,6372400,0.00030936965321997934\nQQQ,20000919 00:00,907500,966300,898800,935600,27215200,0.00030936965321997934\nSPY,20000920 00:00,1456900,1460300,1431600,1452200,6594700,0.0003090531319472296\nQQQ,20000920 00:00,933800,972500,913100,945000,32819400,0.0003090531319472296\nSPY,20000921 00:00,1444700,1455600,1437500,1450300,4911900,0.00030491386408881604\nQQQ,20000921 00:00,937500,949700,920600,926300,23885500,0.00030491386408881604\nSPY,20000922 00:00,1426300,1451600,1421300,1451600,7241600,0.000304908918804894\nQQQ,20000922 00:00,876300,977500,875000,922000,33321300,0.000304908918804894\nSPY,20000925 00:00,1459400,1460600,1437200,1441300,9551700,0.0003054532006671098\nQQQ,20000925 00:00,936300,942500,900600,905000,19947900,0.0003054532006671098\nSPY,20000926 00:00,1443800,1450000,1426300,1428900,4889400,0.0003059389326322272\nQQQ,20000926 00:00,907700,927500,889800,893800,25171000,0.0003059389326322272\nSPY,20000927 00:00,1435600,1439700,1421300,1428100,5471600,0.00030517398434313993\nQQQ,20000927 00:00,906300,911900,880000,891300,28443400,0.00030517398434313993\nSPY,20000928 00:00,1431900,1463300,1428900,1461900,6598400,0.00030872014222630534\nQQQ,20000928 00:00,887200,930000,887200,928100,28626400,0.00030872014222630534\nSPY,20000929 00:00,1454700,1459700,1437500,1437800,7669100,0.0003114228448456501\nQQQ,20000929 00:00,920000,921300,888800,891300,26376000,0.0003114228448456501\nSPY,20001002 00:00,1442800,1449100,1431400,1438100,5182100,0.0003096986028308079\nQQQ,20001002 00:00,902500,902500,860000,863000,24413800,0.0003096986028308079\nSPY,20001003 00:00,1445300,1457500,1425300,1426300,8184100,0.00031082375891676467\nQQQ,20001003 00:00,880600,888100,835000,836300,35169700,0.00031082375891676467\nSPY,20001004 00:00,1428800,1442500,1417500,1435800,5717600,0.0003101711807256474\nQQQ,20001004 00:00,835000,868600,821300,860000,37322200,0.0003101711807256474\nSPY,20001005 00:00,1434100,1448400,1433100,1438800,4038600,0.00031019624573311934\nQQQ,20001005 00:00,852500,871900,845600,855000,23416600,0.00031019624573311934\nSPY,20001006 00:00,1438800,1446400,1397500,1410000,9717900,0.000312332397072015\nQQQ,20001006 00:00,855600,865600,811300,827300,35636600,0.000312332397072015\nSPY,20001009 00:00,1413100,1413100,1393800,1404400,4323000,0.0003122916859638111\nQQQ,20001009 00:00,825600,838100,793800,828100,28668200,0.0003122916859638111\nSPY,20001010 00:00,1400900,1412500,1385600,1388800,5724500,0.00031281833036486185\nQQQ,20001010 00:00,818100,833100,791300,795000,33051500,0.00031281833036486185\nSPY,20001011 00:00,1376300,1386300,1351300,1365600,10570900,0.00031212882679222323\nQQQ,20001011 00:00,768800,804500,731900,774800,48166600,0.00031212882679222323\nSPY,20001012 00:00,1372800,1433800,1327800,1331600,11288200,0.0003154759209394593\nQQQ,20001012 00:00,792500,795600,744100,748800,51753500,0.0003154759209394593\nSPY,20001013 00:00,1329400,1376600,1328800,1375600,10629900,0.000323812406324211\nQQQ,20001013 00:00,746900,815000,746300,814400,40653500,0.000323812406324211\nSPY,20001016 00:00,1374100,1390000,1366900,1374700,5407400,0.0003241644312071269\nQQQ,20001016 00:00,811300,823100,797500,810000,27298100,0.0003241644312071269\nSPY,20001017 00:00,1384400,1385600,1344100,1354800,7302200,0.000325400273349026\nQQQ,20001017 00:00,831300,831700,780000,793100,50132700,0.000325400273349026\nSPY,20001018 00:00,1326300,1361300,1301600,1344100,9962600,0.0003214056790114427\nQQQ,20001018 00:00,767500,811900,745600,784200,64129700,0.0003214056790114427\nSPY,20001019 00:00,1368400,1394500,1364400,1390500,8309100,0.0003327168650481591\nQQQ,20001019 00:00,823900,850000,814400,848300,46974100,0.0003327168650481591\nSPY,20001020 00:00,1383800,1411900,1383800,1398800,6603800,0.00033295597163188526\nQQQ,20001020 00:00,845000,878800,843900,860600,40117600,0.00033295597163188526\nSPY,20001023 00:00,1399400,1410300,1389400,1400000,5066000,0.00033291957062741797\nQQQ,20001023 00:00,861900,875000,841300,855000,28581000,0.00033291957062741797\nSPY,20001024 00:00,1409700,1419400,1390000,1401300,5115800,0.00033266405272788124\nQQQ,20001024 00:00,864400,870000,828900,838100,27862200,0.00033266405272788124\nSPY,20001025 00:00,1387500,1395600,1363900,1369200,7817300,0.0003395318314684742\nQQQ,20001025 00:00,812500,820000,768900,776900,47678700,0.0003395318314684742\nSPY,20001026 00:00,1371300,1376600,1340000,1367500,8644800,0.00033514060958450396\nQQQ,20001026 00:00,781900,800000,736300,790600,67672500,0.00033514060958450396\nSPY,20001027 00:00,1378800,1388400,1366300,1383800,9866200,0.0003329103616024484\nQQQ,20001027 00:00,808600,818600,774800,791300,50978000,0.0003329103616024484\nSPY,20001030 00:00,1384400,1410900,1381600,1402500,8510100,0.00033146810356485555\nQQQ,20001030 00:00,781900,798800,757000,770500,36014700,0.00033146810356485555\nSPY,20001031 00:00,1410200,1436900,1400600,1429700,8131100,0.0003363994975492287\nQQQ,20001031 00:00,780000,825600,778800,819400,44479100,0.0003363994975492287\nSPY,20001101 00:00,1422500,1432500,1412200,1424100,6349600,0.0003361954971807904\nQQQ,20001101 00:00,803100,828100,791900,806300,46031900,0.0003361954971807904\nSPY,20001102 00:00,1431600,1439100,1425200,1430300,4360600,0.00033629164835317855\nQQQ,20001102 00:00,821900,832500,810600,823900,26099400,0.00033629164835317855\nSPY,20001103 00:00,1434700,1437500,1423800,1431100,4853300,0.00033585316209278976\nQQQ,20001103 00:00,828800,839400,816400,830000,29681300,0.00033585316209278976\nSPY,20001106 00:00,1431600,1443000,1430300,1437000,3814400,0.00033549848022711675\nQQQ,20001106 00:00,836300,849400,820000,822300,21860400,0.00033549848022711675\nSPY,20001107 00:00,1431400,1440000,1425600,1436600,5032700,0.0003351727333422488\nQQQ,20001107 00:00,814400,824700,800600,819100,23864100,0.0003351727333422488\nSPY,20001108 00:00,1440600,1440600,1410300,1412500,5889100,0.000339357093848987\nQQQ,20001108 00:00,821300,822500,763100,763100,37279500,0.000339357093848987\nSPY,20001109 00:00,1400000,1412200,1372500,1404100,9700200,0.0003389507484286183\nQQQ,20001109 00:00,747500,769400,730000,763100,64666200,0.0003389507484286183\nSPY,20001110 00:00,1390000,1394700,1368800,1369700,8316000,0.00034375472519840343\nQQQ,20001110 00:00,742500,756900,720000,720000,46913100,0.00034375472519840343\nSPY,20001113 00:00,1356300,1369800,1330200,1353800,16883900,0.00034433233421107465\nQQQ,20001113 00:00,709500,741900,682700,710000,73766200,0.00034433233421107465\nSPY,20001114 00:00,1374700,1396300,1370000,1387500,7432300,0.00034875407164803186\nQQQ,20001114 00:00,730000,760000,727500,757000,44479400,0.00034875407164803186\nSPY,20001115 00:00,1390600,1401100,1377500,1391300,7877100,0.0003485533266025911\nQQQ,20001115 00:00,755600,780600,748000,768100,37421900,0.0003485533266025911\nSPY,20001116 00:00,1385800,1398800,1373100,1377700,6418000,0.000349318519487347\nQQQ,20001116 00:00,753800,770000,723800,731300,32917600,0.000349318519487347\nSPY,20001117 00:00,1373100,1390000,1357500,1374700,6429800,0.00034933722276092876\nQQQ,20001117 00:00,731900,751900,710000,736100,48455800,0.00034933722276092876\nSPY,20001120 00:00,1357500,1363800,1343800,1346900,5017900,0.00035343757020665106\nQQQ,20001120 00:00,709400,720600,690000,697300,46531500,0.00035343757020665106\nSPY,20001121 00:00,1348800,1361900,1335200,1351600,4344600,0.00035281740463828756\nQQQ,20001121 00:00,701900,715000,684400,696600,41578500,0.00035281740463828756\nSPY,20001122 00:00,1343400,1348800,1324400,1325000,5285300,0.0003547182103607752\nQQQ,20001122 00:00,684400,701300,666300,667500,56425200,0.0003547182103607752\nSPY,20001124 00:00,1336300,1349700,1335600,1348400,3412100,0.0003588591375854215\nQQQ,20001124 00:00,683800,706300,681700,704400,23193800,0.0003588591375854215\nSPY,20001127 00:00,1364700,1366900,1353100,1355000,5997600,0.00035837606039722963\nQQQ,20001127 00:00,725600,729400,687500,691400,35971200,0.00035837606039722963\nSPY,20001128 00:00,1351300,1365900,1338100,1338100,4190100,0.00035946288772887805\nQQQ,20001128 00:00,689400,716900,653100,654800,48160300,0.00035946288772887805\nSPY,20001129 00:00,1343800,1359100,1332700,1346400,6534900,0.0003590642602717795\nQQQ,20001129 00:00,658100,667500,625000,650000,61390400,0.0003590642602717795\nSPY,20001130 00:00,1325000,1335000,1297500,1316300,10401100,0.0003612010489744782\nQQQ,20001130 00:00,617500,642500,600600,624700,75005000,0.0003612010489744782\nSPY,20001201 00:00,1331900,1340600,1310000,1318800,7233600,0.0003596289250338233\nQQQ,20001201 00:00,640600,667700,621300,636700,57421900,0.0003596289250338233\nSPY,20001204 00:00,1318800,1338800,1315000,1330000,6328000,0.00036011227425391233\nQQQ,20001204 00:00,641300,654400,617500,640000,46778200,0.00036011227425391233\nSPY,20001205 00:00,1348800,1381900,1344100,1381300,8270800,0.0003772860908053142\nQQQ,20001205 00:00,660600,710000,583100,709400,77330700,0.0003772860908053142\nSPY,20001206 00:00,1377800,1383400,1350300,1355300,12544800,0.00037893613673785625\nQQQ,20001206 00:00,705900,723000,675600,688100,62158200,0.00037893613673785625\nSPY,20001207 00:00,1348800,1358800,1343800,1349800,5966200,0.0003790970770558222\nQQQ,20001207 00:00,670000,689800,661300,678900,38431000,0.0003790970770558222\nSPY,20001208 00:00,1370600,1391300,1360900,1376600,8949000,0.0003835702738111675\nQQQ,20001208 00:00,710900,872500,697000,718900,59582400,0.0003835702738111675\nSPY,20001211 00:00,1373800,1488800,1367200,1386300,5943200,0.00038443474650810437\nQQQ,20001211 00:00,720600,747800,709500,741300,51124900,0.00038443474650810437\nSPY,20001212 00:00,1381900,1392500,1373800,1377500,4619700,0.0003844682163333825\nQQQ,20001212 00:00,735000,738800,708800,715000,29755000,0.0003844682163333825\nSPY,20001213 00:00,1392500,1394100,1362500,1365300,5580800,0.0003851521128627533\nQQQ,20001213 00:00,734400,735000,683100,685200,51205100,0.0003851521128627533\nSPY,20001214 00:00,1358800,1365000,1341900,1341900,7348300,0.0003871274960289701\nQQQ,20001214 00:00,685200,696900,656300,658800,38315600,0.0003871274960289701\nSPY,20001215 00:00,1331300,1332500,1305600,1314500,8490700,0.0003894631231487652\nQQQ,20001215 00:00,642500,656300,605000,638100,57821200,0.0003894631231487652\nSPY,20001218 00:00,1110000,1334700,1110000,1323800,6906100,0.0003895567893193125\nQQQ,20001218 00:00,651600,659700,625600,633800,42454900,0.0003895567893193125\nSPY,20001219 00:00,1324700,1349700,1305000,1305600,9054500,0.0003902897660517478\nQQQ,20001219 00:00,634500,658600,597800,600000,78288100,0.0003902897660517478\nSPY,20001220 00:00,1286300,1289400,1239400,1266900,9490400,0.00039866223461637167\nQQQ,20001220 00:00,573100,583800,547500,554200,78896600,0.00039866223461637167\nSPY,20001221 00:00,1260000,1288600,1255300,1276900,14252300,0.0003984144752682216\nQQQ,20001221 00:00,550200,587500,542500,558100,84496400,0.0003984144752682216\nSPY,20001222 00:00,1290000,1308600,1288400,1308600,8862700,0.00040743911165299767\nQQQ,20001222 00:00,576300,607500,560600,606300,56301600,0.00040743911165299767\nSPY,20001226 00:00,1308400,1319400,1302800,1318900,4395100,0.0004073238824909707\nQQQ,20001226 00:00,605900,619200,580000,601900,35626800,0.0004073238824909707\nSPY,20001227 00:00,1320000,1336600,1312500,1331300,5193500,0.00040790259983325433\nQQQ,20001227 00:00,596900,621900,589400,612500,33769600,0.00040790259983325433\nSPY,20001228 00:00,1328100,1338100,1325900,1336100,7872300,0.0004079198516587795\nQQQ,20001228 00:00,607800,624800,602500,612800,30069700,0.0004079198516587795\nSPY,20001229 00:00,1340600,1342800,1318800,1322500,7564700,0.00040960127744102073\nQQQ,20001229 00:00,615600,622300,580000,584400,46732700,0.00040960127744102073\nSPY,20010102 00:00,1320000,1321600,1275600,1282500,8348100,0.00042092210170041784\nQQQ,20010102 00:00,585600,586900,524400,532300,61819700,0.00042092210170041784\nSPY,20010103 00:00,1283100,1360000,1276600,1350000,17057200,0.00045056658577060065\nQQQ,20010103 00:00,521900,640000,520600,628100,115085400,0.00045056658577060065\nSPY,20010104 00:00,1349400,1354700,1330000,1334100,8331000,0.0004515153796105736\nQQQ,20010104 00:00,616300,636300,602300,614800,56326000,0.0004515153796105736\nSPY,20010105 00:00,1334700,1336300,1292800,1302500,12281600,0.0004586631278628167\nQQQ,20010105 00:00,613100,613100,560000,566900,70772600,0.0004586631278628167\nSPY,20010108 00:00,1298800,1300600,1276300,1297500,6134300,0.00045138206833330577\nQQQ,20010108 00:00,563100,569400,535200,568900,53219400,0.00045138206833330577\nSPY,20010109 00:00,1310500,1315000,1296300,1301300,5161100,0.0004496443900739431\nQQQ,20010109 00:00,577500,591300,566300,574400,52452400,0.0004496443900739431\nSPY,20010110 00:00,1290000,1318100,1288100,1316600,8509500,0.00045014786638251865\nQQQ,20010110 00:00,561300,603800,557500,601900,71989200,0.00045014786638251865\nSPY,20010111 00:00,1310900,1334800,1310900,1327700,6271200,0.0004514590237526186\nQQQ,20010111 00:00,592700,636900,584400,627500,61255400,0.0004514590237526186\nSPY,20010112 00:00,1326900,1337200,1312800,1319100,6402300,0.00044950998847307895\nQQQ,20010112 00:00,627500,646300,605000,624800,59666900,0.00044950998847307895\nSPY,20010116 00:00,1320000,1331900,1315200,1325800,7763000,0.0004481254466687611\nQQQ,20010116 00:00,625600,629200,603800,615600,29908700,0.0004481254466687611\nSPY,20010117 00:00,1348400,1350500,1326400,1329400,7793500,0.00044897085153189305\nQQQ,20010117 00:00,645000,656100,631400,636900,59521200,0.00044897085153189305\nSPY,20010118 00:00,1334400,1357000,1329400,1350500,8764500,0.00045194493916890873\nQQQ,20010118 00:00,641300,669800,621300,665000,53229400,0.00045194493916890873\nSPY,20010119 00:00,1361900,1361900,1338800,1344800,7353300,0.00045237455046152653\nQQQ,20010119 00:00,681400,683100,655600,663600,56472600,0.00045237455046152653\nSPY,20010122 00:00,1342500,1357800,1335600,1346300,7091800,0.00045241059961334377\nQQQ,20010122 00:00,658800,670000,640000,659800,34900100,0.00045241059961334377\nSPY,20010123 00:00,1344700,1366600,1341600,1361300,8381500,0.0004488050240654673\nQQQ,20010123 00:00,659100,689500,653100,678100,48097800,0.0004488050240654673\nSPY,20010124 00:00,1362500,1373100,1358400,1366900,5708800,0.0004482076156987765\nQQQ,20010124 00:00,680600,691300,666300,679400,51456100,0.0004482076156987765\nSPY,20010125 00:00,1362500,1372500,1356600,1360600,10440400,0.00044872760936487\nQQQ,20010125 00:00,668800,679500,642300,647700,56402000,0.00044872760936487\nSPY,20010126 00:00,1351600,1361300,1344500,1357800,7049800,0.00044854793536732124\nQQQ,20010126 00:00,635600,665600,625600,655600,46583400,0.00044854793536732124\nSPY,20010129 00:00,1355000,1369000,1353700,1366500,6346400,0.0004451425474957928\nQQQ,20010129 00:00,647500,672500,638000,671000,31339200,0.0004451425474957928\nSPY,20010130 00:00,1363000,1379200,1357900,1377500,6535400,0.00044201824489543924\nQQQ,20010130 00:00,671500,692100,604000,668600,41285400,0.00044201824489543924\nSPY,20010131 00:00,1374000,1387000,1366000,1370600,9018400,0.0004418213884399852\nQQQ,20010131 00:00,672500,699400,646200,646500,58744000,0.0004418213884399852\nSPY,20010201 00:00,1371000,1375600,1362500,1374800,7899200,0.00044156724572982773\nQQQ,20010201 00:00,645500,688400,632900,650000,45100700,0.00044156724572982773\nSPY,20010202 00:00,1374000,1379900,1350000,1350800,7931800,0.00044328757850159445\nQQQ,20010202 00:00,649400,659000,600000,616800,46227700,0.00044328757850159445\nSPY,20010205 00:00,1348000,1359000,1347500,1358900,3758500,0.00044332551961928776\nQQQ,20010205 00:00,611900,619000,601200,615600,35503900,0.00044332551961928776\nSPY,20010206 00:00,1353000,1367000,1352200,1354200,6830900,0.00044327743935051295\nQQQ,20010206 00:00,614900,631200,611200,617000,41770200,0.00044327743935051295\nSPY,20010207 00:00,1347200,1354200,1336800,1342200,5602500,0.0004424506201012637\nQQQ,20010207 00:00,605100,635000,585800,602000,61065000,0.0004424506201012637\nSPY,20010208 00:00,1348000,1354000,1334800,1334800,5591600,0.0004415988946457542\nQQQ,20010208 00:00,609000,615000,586500,587000,49388600,0.0004415988946457542\nSPY,20010209 00:00,1333500,1333500,1312600,1318300,9406500,0.00044286541977631307\nQQQ,20010209 00:00,582500,593200,559500,564600,53923600,0.00044286541977631307\nSPY,20010212 00:00,1317000,1335000,1317000,1331400,5507600,0.00044154181727461744\nQQQ,20010212 00:00,562500,599600,555000,569900,50717500,0.00044154181727461744\nSPY,20010213 00:00,1337000,1341700,1320000,1321200,5986900,0.0004424110885454244\nQQQ,20010213 00:00,576500,591800,550000,551000,56703000,0.0004424110885454244\nSPY,20010214 00:00,1326500,1326500,1306600,1321500,8150200,0.00044217553317001004\nQQQ,20010214 00:00,554000,576100,541300,575000,63183900,0.00044217553317001004\nSPY,20010215 00:00,1328400,1335200,1319900,1329600,5417200,0.0004430696411570923\nQQQ,20010215 00:00,588000,604900,559900,591000,64075400,0.0004430696411570923\nSPY,20010216 00:00,1310000,1312900,1293000,1304600,10245800,0.0004476583787771918\nQQQ,20010216 00:00,559600,580900,544400,552600,66033400,0.0004476583787771918\nSPY,20010220 00:00,1310400,1311400,1281000,1283200,5457000,0.0004469031927606742\nQQQ,20010220 00:00,557400,558400,523900,524000,54283000,0.0004469031927606742\nSPY,20010221 00:00,1279000,1288400,1255200,1256000,10237700,0.00044817734414693915\nQQQ,20010221 00:00,515500,540700,509200,514000,71588600,0.00044817734414693915\nSPY,20010222 00:00,1263500,1265400,1230200,1255200,21327100,0.00044625587369006095\nQQQ,20010222 00:00,514500,521600,488900,506500,103011300,0.00044625587369006095\nSPY,20010223 00:00,1250800,1255400,1218000,1248900,15540300,0.0004464558859451843\nQQQ,20010223 00:00,500900,551000,478000,512600,92596000,0.0004464558859451843\nSPY,20010226 00:00,1258000,1272100,1245000,1272100,9555900,0.00044752933623553345\nQQQ,20010226 00:00,520800,526000,502500,522500,77513400,0.00044752933623553345\nSPY,20010227 00:00,1268000,1278400,1255100,1263500,10871500,0.0004490853594586669\nQQQ,20010227 00:00,515400,520800,489000,491500,64978600,0.0004490853594586669\nSPY,20010228 00:00,1267500,1268400,1232700,1241500,13986800,0.00044929412071428794\nQQQ,20010228 00:00,494500,502100,467400,475000,103002500,0.00044929412071428794\nSPY,20010301 00:00,1240500,1245000,1217500,1244900,13921800,0.00044915161827197383\nQQQ,20010301 00:00,469700,492000,456300,489500,99562100,0.00044915161827197383\nSPY,20010302 00:00,1225000,1256500,1223000,1237700,12367500,0.00045017962866276425\nQQQ,20010302 00:00,472000,572500,456500,467500,96432700,0.00045017962866276425\nSPY,20010305 00:00,1241500,1247800,1238100,1244000,4718700,0.00044674092311034223\nQQQ,20010305 00:00,475000,483600,470900,477800,42975900,0.00044674092311034223\nSPY,20010306 00:00,1263500,1277500,1254900,1258700,6597400,0.00044899425169086707\nQQQ,20010306 00:00,493000,506600,491000,493200,62538000,0.00044899425169086707\nSPY,20010307 00:00,1269000,1269000,1257600,1266400,6407800,0.0004482192453438068\nQQQ,20010307 00:00,504000,504300,489700,497200,54750000,0.0004482192453438068\nSPY,20010308 00:00,1266000,1272400,1261000,1269000,5554000,0.00044743110257845336\nQQQ,20010308 00:00,493500,498500,481000,482500,48622000,0.00044743110257845336\nSPY,20010309 00:00,1261000,1261000,1231100,1236700,9754500,0.0004494464005044472\nQQQ,20010309 00:00,472500,495600,449000,452000,79218100,0.0004494464005044472\nSPY,20010312 00:00,1223400,1245000,1177000,1184400,11973300,0.0004606451662657776\nQQQ,20010312 00:00,440000,449500,418000,419500,78427100,0.0004606451662657776\nSPY,20010313 00:00,1194000,1204400,1175300,1202000,12711300,0.00046408083139184655\nQQQ,20010313 00:00,427800,447400,421000,446800,79151000,0.00046408083139184655\nSPY,20010314 00:00,1170500,1192900,1157500,1172000,17316500,0.00046347291956795177\nQQQ,20010314 00:00,427000,451900,421000,435100,95895400,0.00046347291956795177\nSPY,20010315 00:00,1184500,1188600,1175100,1177100,8083600,0.00046491594391164735\nQQQ,20010315 00:00,452000,459500,422500,423200,68653700,0.00046491594391164735\nSPY,20010316 00:00,1171300,1185000,1144600,1153100,35979400,0.0004548082571297399\nQQQ,20010316 00:00,418800,442500,400500,411000,76209500,0.0004548082571297399\nSPY,20010319 00:00,1157600,1176900,1148200,1173000,9638200,0.0004584986216972276\nQQQ,20010319 00:00,414400,432500,407500,431900,52692800,0.0004584986216972276\nSPY,20010320 00:00,1179000,1184600,1141500,1142500,13717000,0.0004568275122101604\nQQQ,20010320 00:00,434400,452000,402000,402000,105692400,0.0004568275122101604\nSPY,20010321 00:00,1141800,1152600,1119000,1123400,18086400,0.0004520930941256497\nQQQ,20010321 00:00,405200,442500,388300,401000,93462300,0.0004520930941256497\nSPY,20010322 00:00,1120200,1157000,1080400,1119000,25414600,0.000450973704387341\nQQQ,20010322 00:00,406000,426600,387500,425000,137815500,0.000450973704387341\nSPY,20010323 00:00,1132500,1144800,1115000,1142500,12191600,0.000449858059099574\nQQQ,20010323 00:00,435500,438300,415000,425200,97528100,0.000449858059099574\nSPY,20010326 00:00,1157000,1162700,1147700,1155000,9392300,0.0004491482443098331\nQQQ,20010326 00:00,434700,439000,415500,419300,56139500,0.0004491482443098331\nSPY,20010327 00:00,1156200,1186500,1152500,1185100,12432000,0.0004530101679285527\nQQQ,20010327 00:00,418000,445600,412700,432500,66475700,0.0004530101679285527\nSPY,20010328 00:00,1169000,1175000,1149000,1154500,10194300,0.00045964690541559604\nQQQ,20010328 00:00,419000,422000,399000,399000,77522400,0.00045964690541559604\nSPY,20010329 00:00,1147000,1166000,1093400,1149800,11463600,0.0004600762796600482\nQQQ,20010329 00:00,393800,406100,373300,389700,79643600,0.0004600762796600482\nSPY,20010330 00:00,1155500,1166500,1145000,1161200,8495500,0.00045884890426644144\nQQQ,20010330 00:00,393000,399800,380000,391300,63067100,0.00045884890426644144\nSPY,20010402 00:00,1163000,1173800,1138000,1145400,10040900,0.00045867420739923343\nQQQ,20010402 00:00,391700,399100,366700,377500,69169900,0.00045867420739923343\nSPY,20010403 00:00,1139800,1141500,1101000,1106700,12365600,0.0004688544128744421\nQQQ,20010403 00:00,372000,392500,346200,348600,86663600,0.0004688544128744421\nSPY,20010404 00:00,1105800,1121000,1093000,1103100,14720900,0.00046889020015301647\nQQQ,20010404 00:00,347100,358100,330500,341000,74655900,0.00046889020015301647\nSPY,20010405 00:00,1133000,1154900,1125000,1152200,15035600,0.0004888688843370253\nQQQ,20010405 00:00,360000,379600,357000,377700,89159500,0.0004888688843370253\nSPY,20010406 00:00,1139900,1144000,1120600,1130500,14400500,0.0004908478465609036\nQQQ,20010406 00:00,369000,371000,355000,361500,86475100,0.0004908478465609036\nSPY,20010409 00:00,1140000,1154800,1127800,1140000,8617400,0.0004894655631616832\nQQQ,20010409 00:00,367900,379500,350500,369500,50189400,0.0004894655631616832\nSPY,20010410 00:00,1154500,1177500,1151700,1170900,15812700,0.0004973552932570358\nQQQ,20010410 00:00,379000,404600,377800,399000,97463700,0.0004973552932570358\nSPY,20010411 00:00,1187800,1189900,1161400,1169600,12328300,0.0004969826853274535\nQQQ,20010411 00:00,421600,425000,404500,411000,92204700,0.0004969826853274535\nSPY,20010412 00:00,1163000,1186300,1159600,1185500,8316200,0.0004934933422240683\nQQQ,20010412 00:00,403000,434000,400000,427000,78626700,0.0004934933422240683\nSPY,20010416 00:00,1182900,1188900,1169100,1182300,6587800,0.0004925108303455182\nQQQ,20010416 00:00,419400,424300,406300,411200,61071600,0.0004925108303455182\nSPY,20010417 00:00,1173100,1196600,1170200,1194200,9952300,0.00047182315984081\nQQQ,20010417 00:00,399500,424500,399000,416500,85919400,0.00047182315984081\nSPY,20010418 00:00,1210600,1260000,1206900,1241400,19909300,0.0004753191684935255\nQQQ,20010418 00:00,437200,510000,431200,455900,123366600,0.0004753191684935255\nSPY,20010419 00:00,1242500,1258300,1200000,1257200,13370400,0.00047209841191328154\nQQQ,20010419 00:00,461000,487300,438000,487000,118045800,0.00047209841191328154\nSPY,20010420 00:00,1249000,1254000,1236600,1243600,7779700,0.00047155355842523296\nQQQ,20010420 00:00,481800,495500,430500,481800,78204100,0.00047155355842523296\nSPY,20010423 00:00,1236500,1263000,1219100,1227000,8156500,0.00047501419227917755\nQQQ,20010423 00:00,469900,495000,448900,451300,78734700,0.00047501419227917755\nSPY,20010424 00:00,1225200,1237000,1211000,1211300,9259600,0.00047596563664803216\nQQQ,20010424 00:00,451000,466000,437500,439200,87153500,0.00047596563664803216\nSPY,20010425 00:00,1214200,1236700,1209500,1231000,7959200,0.0004683372497845366\nQQQ,20010425 00:00,439000,462400,430200,452500,66242700,0.0004683372497845366\nSPY,20010426 00:00,1237300,1252200,1235000,1237400,9880700,0.000466566528413921\nQQQ,20010426 00:00,459000,465000,437000,439700,70252600,0.000466566528413921\nSPY,20010427 00:00,1249200,1256800,1242000,1255500,7258700,0.00046793537182079095\nQQQ,20010427 00:00,451500,466300,442400,451100,56644300,0.00046793537182079095\nSPY,20010430 00:00,1264500,1272700,1246700,1252100,8758500,0.0004684791547802268\nQQQ,20010430 00:00,462500,475900,451000,462300,71109700,0.0004684791547802268\nSPY,20010501 00:00,1250700,1269700,1246000,1269500,10205900,0.0004695992458246446\nQQQ,20010501 00:00,462000,479000,451500,478500,53341000,0.0004695992458246446\nSPY,20010502 00:00,1274100,1276900,1260000,1268900,9164600,0.00046602463467678974\nQQQ,20010502 00:00,488000,498000,468200,489000,76506000,0.00046602463467678974\nSPY,20010503 00:00,1261300,1261500,1242200,1251600,9322200,0.00046693036314235137\nQQQ,20010503 00:00,479000,489300,462000,468100,66584000,0.00046693036314235137\nSPY,20010504 00:00,1236500,1272000,1234400,1269500,12084200,0.00046848670291206894\nQQQ,20010504 00:00,453000,481600,451100,479500,72450800,0.00046848670291206894\nSPY,20010507 00:00,1268600,1274700,1255300,1265700,6651400,0.0004666322641962524\nQQQ,20010507 00:00,480000,487500,427900,472100,44587600,0.0004666322641962524\nSPY,20010508 00:00,1268600,1271000,1255600,1265200,6522000,0.00046577133010579705\nQQQ,20010508 00:00,483000,494800,469900,481500,54614100,0.00046577133010579705\nSPY,20010509 00:00,1252500,1266000,1250600,1258700,9240800,0.000465828276040989\nQQQ,20010509 00:00,470500,479600,464200,467300,60699300,0.000465828276040989\nSPY,20010510 00:00,1272600,1275000,1257700,1259900,6503700,0.00046081143204948065\nQQQ,20010510 00:00,479200,481200,450900,458200,59892700,0.00046081143204948065\nSPY,20010511 00:00,1260000,1264900,1244000,1248200,7394500,0.0004577656517792809\nQQQ,20010511 00:00,458400,464200,450000,453800,49665800,0.0004577656517792809\nSPY,20010514 00:00,1249000,1254400,1244600,1252300,7793600,0.00045735925451089197\nQQQ,20010514 00:00,453000,473300,433500,446900,43110100,0.00045735925451089197\nSPY,20010515 00:00,1255500,1265000,1248500,1253000,8986500,0.0004540773354857406\nQQQ,20010515 00:00,449000,463000,442000,447500,69238500,0.0004540773354857406\nSPY,20010516 00:00,1248400,1292000,1246200,1289600,12431300,0.00045916976683985246\nQQQ,20010516 00:00,443100,475200,440600,472600,80099100,0.00045916976683985246\nSPY,20010517 00:00,1290100,1300800,1285600,1293100,11930400,0.000458279531400254\nQQQ,20010517 00:00,474500,487900,470000,480300,73045600,0.000458279531400254\nSPY,20010518 00:00,1290900,1297200,1281000,1296200,6030000,0.0004572661605291532\nQQQ,20010518 00:00,476400,488000,470000,481000,39510500,0.0004572661605291532\nSPY,20010521 00:00,1298400,1318000,1291500,1317700,11722200,0.0004575567898853027\nQQQ,20010521 00:00,481700,511200,476500,511000,85177700,0.0004575567898853027\nSPY,20010522 00:00,1318300,1320900,1310700,1313700,7704800,0.00045760679081773345\nQQQ,20010522 00:00,513100,519600,500200,509100,79936700,0.00045760679081773345\nSPY,20010523 00:00,1310500,1310500,1292900,1292900,11528900,0.00045443539133961864\nQQQ,20010523 00:00,504500,510100,487700,488000,63701400,0.00045443539133961864\nSPY,20010524 00:00,1294700,1300000,1249000,1297000,7410400,0.00045060613311999906\nQQQ,20010524 00:00,489700,499800,458500,499100,61504700,0.00045060613311999906\nSPY,20010525 00:00,1296500,1297000,1280100,1282300,7097400,0.000450493574361902\nQQQ,20010525 00:00,499600,500200,480200,489000,35867000,0.000450493574361902\nSPY,20010529 00:00,1282300,1283500,1269000,1273000,8350400,0.0004517290477088776\nQQQ,20010529 00:00,485000,489500,464500,467000,65791600,0.0004517290477088776\nSPY,20010530 00:00,1265900,1275300,1250000,1252900,9937200,0.00044246063504051886\nQQQ,20010530 00:00,454400,458500,421800,443000,80711900,0.00044246063504051886\nSPY,20010531 00:00,1254300,1267600,1252600,1261000,9468700,0.00044273876565701194\nQQQ,20010531 00:00,445400,459500,441500,448500,69693600,0.00044273876565701194\nSPY,20010601 00:00,1262000,1271000,1251200,1266400,8898100,0.0004384245510397204\nQQQ,20010601 00:00,455400,462300,443300,459200,60100500,0.0004384245510397204\nSPY,20010604 00:00,1268000,1272700,1258900,1271700,5421400,0.0004328473121407668\nQQQ,20010604 00:00,463400,469000,445500,457600,41102300,0.0004328473121407668\nSPY,20010605 00:00,1274900,1292300,1272700,1288700,8082500,0.00043558372147984274\nQQQ,20010605 00:00,463000,483600,462000,479600,66255700,0.00043558372147984274\nSPY,20010606 00:00,1288300,1288300,1273600,1275300,12487900,0.00043551573318596006\nQQQ,20010606 00:00,480800,488900,455500,474300,60944800,0.00043551573318596006\nSPY,20010607 00:00,1270500,1282900,1270000,1282400,6862800,0.00043553803398535984\nQQQ,20010607 00:00,471400,494900,466400,488900,59904000,0.00043553803398535984\nSPY,20010608 00:00,1277000,1278700,1261400,1270000,7278100,0.0004366786133938671\nQQQ,20010608 00:00,487200,489000,469500,472700,56323600,0.0004366786133938671\nSPY,20010611 00:00,1267100,1277500,1254100,1259400,7055200,0.0004374774487356778\nQQQ,20010611 00:00,469000,484700,454900,460400,48320700,0.0004374774487356778\nSPY,20010612 00:00,1248600,1268800,1240400,1261300,9128400,0.00043679358651010274\nQQQ,20010612 00:00,448700,468000,442300,461700,78438100,0.00043679358651010274\nSPY,20010613 00:00,1261700,1265800,1246700,1247400,8230500,0.0004360309443607771\nQQQ,20010613 00:00,462700,467500,445500,445800,68349600,0.0004360309443607771\nSPY,20010614 00:00,1241800,1243000,1222400,1224800,12436500,0.0004389242592217065\nQQQ,20010614 00:00,440300,444000,420700,426700,88936900,0.0004389242592217065\nSPY,20010615 00:00,1209100,1224000,1204000,1216200,16676600,0.0004384806988680103\nQQQ,20010615 00:00,418000,438500,412800,424600,83800700,0.0004384806988680103\nSPY,20010618 00:00,1216500,1224400,1209500,1210800,7895700,0.00043922863412041135\nQQQ,20010618 00:00,426400,431700,410400,415800,59699500,0.00043922863412041135\nSPY,20010619 00:00,1223800,1228900,1208600,1214600,7655100,0.00043732704643998526\nQQQ,20010619 00:00,433200,435600,412600,418000,71801900,0.00043732704643998526\nSPY,20010620 00:00,1211900,1228600,1211000,1226000,8120400,0.0004385857733933702\nQQQ,20010620 00:00,413000,429900,412000,429200,83728600,0.0004385857733933702\nSPY,20010621 00:00,1222200,1274700,1221500,1238600,11993900,0.00043937678729706495\nQQQ,20010621 00:00,426700,442300,423000,436500,65080900,0.00043937678729706495\nSPY,20010622 00:00,1234900,1236000,1221600,1227500,11803800,0.00043752924975131607\nQQQ,20010622 00:00,436200,442000,420700,431000,51549000,0.00043752924975131607\nSPY,20010625 00:00,1232800,1234400,1215000,1221300,8064300,0.00043636204670971003\nQQQ,20010625 00:00,436100,438000,426500,434400,37957000,0.00043636204670971003\nSPY,20010626 00:00,1209000,1229000,1200300,1218400,8014800,0.0004352937305397127\nQQQ,20010626 00:00,425400,454500,424800,436000,60733700,0.0004352937305397127\nSPY,20010627 00:00,1216000,1251500,1209100,1213100,9785600,0.0004351844540449455\nQQQ,20010627 00:00,436800,441500,430000,437300,52390000,0.0004351844540449455\nSPY,20010628 00:00,1220000,1239400,1219300,1228900,9986900,0.0004369181583904715\nQQQ,20010628 00:00,444000,463600,443300,450900,89045500,0.0004369181583904715\nSPY,20010629 00:00,1228000,1240100,1222600,1232000,9113800,0.00043645242908703727\nQQQ,20010629 00:00,450900,465200,425500,460000,58494400,0.00043645242908703727\nSPY,20010702 00:00,1228000,1243200,1226200,1239000,8031000,0.0004355152605410721\nQQQ,20010702 00:00,456500,464800,451900,454800,49351300,0.0004355152605410721\nSPY,20010703 00:00,1239800,1241000,1230500,1240800,3305300,0.0004345467635047392\nQQQ,20010703 00:00,452500,464500,448000,455000,25147800,0.0004345467635047392\nSPY,20010705 00:00,1230700,1236500,1221100,1221300,4818400,0.0004345737833106105\nQQQ,20010705 00:00,448700,451900,408000,436700,41670100,0.0004345737833106105\nSPY,20010706 00:00,1213100,1215800,1190500,1191900,9531300,0.00043774167345173617\nQQQ,20010706 00:00,430100,432200,414900,416500,51795400,0.00043774167345173617\nSPY,20010709 00:00,1194900,1205400,1192000,1201000,8274300,0.0004372209500236892\nQQQ,20010709 00:00,419000,426900,415000,422500,44272300,0.0004372209500236892\nSPY,20010710 00:00,1202900,1206400,1182100,1183500,8339800,0.00043930033379230873\nQQQ,20010710 00:00,427600,429300,404400,405400,57261700,0.00043930033379230873\nSPY,20010711 00:00,1181000,1190400,1170900,1182700,14904100,0.0004393729502466698\nQQQ,20010711 00:00,404200,411000,398700,409000,70997400,0.0004393729502466698\nSPY,20010712 00:00,1195000,1214700,1193100,1211600,11252600,0.0004448326593223587\nQQQ,20010712 00:00,426300,438300,409500,436200,67236900,0.0004448326593223587\nSPY,20010713 00:00,1208400,1223200,1206200,1219000,9992900,0.00044471041495871\nQQQ,20010713 00:00,433800,444300,429000,436400,63548700,0.00044471041495871\nSPY,20010716 00:00,1217700,1222800,1202900,1206000,6321000,0.00044535788995186384\nQQQ,20010716 00:00,433700,441600,419000,420200,52420600,0.00044535788995186384\nSPY,20010717 00:00,1202000,1219400,1198300,1216700,7384300,0.00044634236389161727\nQQQ,20010717 00:00,418300,431200,415400,430600,57271300,0.00044634236389161727\nSPY,20010718 00:00,1205600,1216400,1200600,1211000,6678700,0.00044612043428168856\nQQQ,20010718 00:00,422800,428500,411400,415400,59593600,0.00044612043428168856\nSPY,20010719 00:00,1221800,1229800,1207600,1218300,9143600,0.0004458295013317805\nQQQ,20010719 00:00,424600,433500,410000,422500,72354800,0.0004458295013317805\nSPY,20010720 00:00,1211500,1219400,1209200,1214500,8514700,0.00044437949122389485\nQQQ,20010720 00:00,414900,421500,411000,418100,52048800,0.00044437949122389485\nSPY,20010723 00:00,1218000,1218800,1192200,1193600,7405300,0.00044543897999803757\nQQQ,20010723 00:00,422400,432300,405500,406400,54783500,0.00044543897999803757\nSPY,20010724 00:00,1190000,1192000,1167500,1173900,11894500,0.00044510545839549203\nQQQ,20010724 00:00,403800,409000,393100,400100,68604800,0.00044510545839549203\nSPY,20010725 00:00,1179200,1194800,1174600,1193000,11752400,0.00044570886790218324\nQQQ,20010725 00:00,401400,407500,394000,405400,68750100,0.00044570886790218324\nSPY,20010726 00:00,1190600,1208500,1185600,1207500,12583600,0.00044706063009272224\nQQQ,20010726 00:00,404500,418900,399800,416800,67815000,0.00044706063009272224\nSPY,20010727 00:00,1208300,1216000,1199100,1210000,8333200,0.00044665619006369983\nQQQ,20010727 00:00,416400,428000,409000,419400,46802200,0.00044665619006369983\nSPY,20010730 00:00,1211900,1213500,1203000,1208200,8736400,0.000441949321369961\nQQQ,20010730 00:00,421300,423000,414000,416500,38357700,0.000441949321369961\nSPY,20010731 00:00,1210000,1226800,1201800,1214600,11528000,0.00044070369352232125\nQQQ,20010731 00:00,418400,427800,415000,419500,53883800,0.00044070369352232125\nSPY,20010801 00:00,1219700,1227000,1209000,1219600,11666400,0.00044161536238649307\nQQQ,20010801 00:00,426400,435000,418900,430400,52746700,0.00044161536238649307\nSPY,20010802 00:00,1232300,1233500,1214600,1223800,10605300,0.00044196421623843453\nQQQ,20010802 00:00,438000,440000,423100,436800,50312800,0.00044196421623843453\nSPY,20010803 00:00,1223600,1223700,1202000,1218700,10527700,0.00044063921078852975\nQQQ,20010803 00:00,435300,438000,421000,430500,50402400,0.00044063921078852975\nSPY,20010806 00:00,1213500,1215100,1201000,1204500,7974000,0.0004411336159687087\nQQQ,20010806 00:00,425400,429000,423500,424800,29624300,0.0004411336159687087\nSPY,20010807 00:00,1202700,1215300,1199100,1208300,8373000,0.0004397310529242962\nQQQ,20010807 00:00,421000,428200,419400,422800,36068800,0.0004397310529242962\nSPY,20010808 00:00,1201200,1211600,1184300,1186500,14886400,0.0004425376771867902\nQQQ,20010808 00:00,418500,435700,403000,404900,75797500,0.0004425376771867902\nSPY,20010809 00:00,1187000,1189700,1178600,1187400,13918500,0.0004427094439960914\nQQQ,20010809 00:00,404100,408800,399800,405800,66912200,0.0004427094439960914\nSPY,20010810 00:00,1188000,1198400,1173400,1194400,11299200,0.0004418744606381182\nQQQ,20010810 00:00,404300,407500,392300,403300,70475700,0.0004418744606381182\nSPY,20010813 00:00,1196000,1198500,1188200,1194900,7194100,0.00044156566966765563\nQQQ,20010813 00:00,405900,413400,401100,412300,48215100,0.00044156566966765563\nSPY,20010814 00:00,1201400,1203500,1188000,1191100,13026500,0.00044035861007874936\nQQQ,20010814 00:00,414900,427500,405400,406200,48940300,0.00044035861007874936\nSPY,20010815 00:00,1192300,1196100,1181600,1182800,8303100,0.0004412039942313616\nQQQ,20010815 00:00,406200,415000,387000,391500,57162600,0.0004412039942313616\nSPY,20010816 00:00,1178000,1187500,1170000,1186200,10275800,0.00044135128528647775\nQQQ,20010816 00:00,386500,393900,380400,393700,66777900,0.00044135128528647775\nSPY,20010817 00:00,1176500,1178700,1160100,1166400,10893500,0.0004422567474694791\nQQQ,20010817 00:00,384400,392600,377100,378000,56438200,0.0004422567474694791\nSPY,20010820 00:00,1168000,1176600,1165500,1175600,9717400,0.0004427634366540624\nQQQ,20010820 00:00,378500,388000,372000,382500,48996200,0.0004427634366540624\nSPY,20010821 00:00,1178000,1185400,1080500,1161300,13952900,0.0004439890595654055\nQQQ,20010821 00:00,382900,386500,368900,369200,53873000,0.0004439890595654055\nSPY,20010822 00:00,1167500,1174300,1157800,1170500,11224700,0.0004448299615506219\nQQQ,20010822 00:00,374500,381800,365400,376900,63321700,0.0004448299615506219\nSPY,20010823 00:00,1169600,1175200,1165200,1167000,8169600,0.00044442942093908956\nQQQ,20010823 00:00,376800,393900,371700,373200,52627100,0.00044442942093908956\nSPY,20010824 00:00,1172100,1191000,1166500,1190000,11056100,0.00044886474114881776\nQQQ,20010824 00:00,378600,396000,373500,393600,58194300,0.00044886474114881776\nSPY,20010827 00:00,1189700,1192000,1182600,1184900,6219700,0.00044881817669968236\nQQQ,20010827 00:00,392800,399900,387600,393500,50453200,0.00044881817669968236\nSPY,20010828 00:00,1182800,1184900,1165900,1166400,11146700,0.0004503569233591958\nQQQ,20010828 00:00,393200,399600,380100,380700,64854400,0.0004503569233591958\nSPY,20010829 00:00,1171300,1171800,1151700,1154000,15345700,0.0004509738992337343\nQQQ,20010829 00:00,383700,384500,371300,373500,58143600,0.0004509738992337343\nSPY,20010830 00:00,1148500,1159100,1120100,1132800,16303700,0.0004530421712124343\nQQQ,20010830 00:00,368000,373100,357500,362000,75646400,0.0004530421712124343\nSPY,20010831 00:00,1134000,1147700,1131300,1139200,15875800,0.0004520697362810508\nQQQ,20010831 00:00,360400,370300,359400,366000,54054800,0.0004520697362810508\nSPY,20010904 00:00,1138500,1167900,1134400,1136500,22807100,0.000452094559577712\nQQQ,20010904 00:00,365200,375000,354200,354800,68143200,0.000452094559577712\nSPY,20010905 00:00,1137000,1141900,1119500,1136500,20800000,0.0004513976161876589\nQQQ,20010905 00:00,354900,359100,341500,352800,97184300,0.0004513976161876589\nSPY,20010906 00:00,1126500,1133000,1110900,1111000,20895800,0.00045303819664399336\nQQQ,20010906 00:00,347400,355200,329900,339600,86160800,0.00045303819664399336\nSPY,20010907 00:00,1100200,1112500,1086900,1091300,30316100,0.00045210441358976253\nQQQ,20010907 00:00,336200,351000,333500,337800,94698900,0.00045210441358976253\nSPY,20010910 00:00,1077000,1110700,1075500,1098300,23040200,0.0004517477321198684\nQQQ,20010910 00:00,334900,348800,333400,340000,81278700,0.0004517477321198684\nSPY,20010917 00:00,1010000,1065100,1000000,1043000,32337700,0.0004670001025294412\nQQQ,20010917 00:00,312500,328000,312000,312200,95411900,0.0004670001025294412\nSPY,20010918 00:00,1043300,1053000,1033600,1039000,21762400,0.0004670920034538982\nQQQ,20010918 00:00,315300,325000,303700,304900,65111300,0.0004670920034538982\nSPY,20010919 00:00,1041000,1045000,985600,1020200,43139900,0.00046747444537105373\nQQQ,20010919 00:00,306400,310000,282600,301100,115755400,0.00046747444537105373\nSPY,20010920 00:00,1004000,1018500,985700,989600,37685200,0.00047131401434947465\nQQQ,20010920 00:00,293000,300900,288500,289800,90193400,0.00047131401434947465\nSPY,20010921 00:00,940500,997000,938000,968500,49249900,0.0004726340065272712\nQQQ,20010921 00:00,274100,289700,270000,281700,113189400,0.0004726340065272712\nSPY,20010924 00:00,997300,1011600,990600,1004800,24672600,0.00048020624449092593\nQQQ,20010924 00:00,290800,300000,285900,296100,90878300,0.00048020624449092593\nSPY,20010925 00:00,1007500,1020000,999000,1014000,25190100,0.00047806558200476633\nQQQ,20010925 00:00,297100,304300,288900,295000,82499400,0.00047806558200476633\nSPY,20010926 00:00,1023500,1024000,1004300,1010000,17174200,0.00047862689920019863\nQQQ,20010926 00:00,299500,300000,284100,285100,57647500,0.00047862689920019863\nSPY,20010927 00:00,1012500,1022500,1000000,1020500,19974800,0.0004788139249597349\nQQQ,20010927 00:00,284000,288000,274100,285100,67806600,0.0004788139249597349\nSPY,20010928 00:00,1029800,1099200,1025000,1042500,21208700,0.00048092896897567356\nQQQ,20010928 00:00,288400,299400,280000,290600,83837100,0.00048092896897567356\nSPY,20011001 00:00,1039000,1043200,1024200,1040000,21059700,0.0004806421203127292\nQQQ,20011001 00:00,288500,323600,278500,286100,52781600,0.0004806421203127292\nSPY,20011002 00:00,1040000,1053800,1030700,1053800,18549500,0.0004810688363938562\nQQQ,20011002 00:00,286500,299700,280000,288400,77309500,0.0004810688363938562\nSPY,20011003 00:00,1046000,1078800,1043500,1073400,30475800,0.0004873534871925661\nQQQ,20011003 00:00,284300,316100,283300,310500,133162300,0.0004873534871925661\nSPY,20011004 00:00,1082900,1089700,1043700,1071000,31695300,0.0004828689738910812\nQQQ,20011004 00:00,316500,332000,309400,313900,126378100,0.0004828689738910812\nSPY,20011005 00:00,1072500,1076200,1055200,1072600,28749400,0.00048077240561976767\nQQQ,20011005 00:00,310000,319000,302600,316500,95137800,0.00048077240561976767\nSPY,20011008 00:00,1062800,1073000,1058700,1065300,11713400,0.00048069688301271895\nQQQ,20011008 00:00,311300,323500,309600,318500,66660200,0.00048069688301271895\nSPY,20011009 00:00,1066100,1067500,1056000,1058700,15220700,0.00048040762078846964\nQQQ,20011009 00:00,318600,320200,290000,309700,55918700,0.00048040762078846964\nSPY,20011010 00:00,1058000,1085500,1055200,1084000,18755600,0.0004846014193841847\nQQQ,20011010 00:00,308700,326000,307500,324800,70647400,0.0004846014193841847\nSPY,20011011 00:00,1089500,1103000,1089500,1100100,24722000,0.0004889430543982914\nQQQ,20011011 00:00,331900,363300,331400,346000,113872600,0.0004889430543982914\nSPY,20011012 00:00,1091500,1098900,1073000,1094500,30699900,0.00048659260672448466\nQQQ,20011012 00:00,343300,348000,322000,347100,111213100,0.00048659260672448466\nSPY,20011015 00:00,1086300,1094500,1071900,1093000,25426400,0.00048665440390633497\nQQQ,20011015 00:00,341200,349700,336600,343200,88414300,0.00048665440390633497\nSPY,20011016 00:00,1098000,1106200,1089500,1100600,15043500,0.0004857830832293729\nQQQ,20011016 00:00,346700,350600,340700,349500,81013200,0.0004857830832293729\nSPY,20011017 00:00,1110700,1111500,1079000,1079000,27566600,0.0004887749135963006\nQQQ,20011017 00:00,358700,369500,323000,327900,154599400,0.0004887749135963006\nSPY,20011018 00:00,1078200,1081600,1067400,1072100,16793600,0.00048548463221143544\nQQQ,20011018 00:00,327000,346900,320900,331700,90973000,0.00048548463221143544\nSPY,20011019 00:00,1070000,1079200,1060100,1075500,22435500,0.0004735333326656031\nQQQ,20011019 00:00,328700,345000,320000,335500,69141300,0.0004735333326656031\nSPY,20011022 00:00,1073000,1094900,1072100,1092600,17101100,0.00047548755211614195\nQQQ,20011022 00:00,334400,345000,330400,344400,72150100,0.00047548755211614195\nSPY,20011023 00:00,1099600,1106100,1083800,1088000,21806000,0.0004744098264077112\nQQQ,20011023 00:00,348200,358600,340000,345600,108646000,0.0004744098264077112\nSPY,20011024 00:00,1089800,1099400,1081200,1087700,15508500,0.00047421475805644773\nQQQ,20011024 00:00,346000,356800,342000,354400,88422300,0.00047421475805644773\nSPY,20011025 00:00,1074500,1103300,1067400,1103100,26339700,0.0004647309854919252\nQQQ,20011025 00:00,347100,368200,342300,367600,120707500,0.0004647309854919252\nSPY,20011026 00:00,1099500,1118000,1096400,1107700,18892000,0.00046404928524812765\nQQQ,20011026 00:00,365000,370600,333200,362600,92281300,0.00046404928524812765\nSPY,20011029 00:00,1101600,1105500,1080600,1082300,17805500,0.00046869811742107376\nQQQ,20011029 00:00,360000,369900,342000,342500,90782900,0.00046869811742107376\nSPY,20011030 00:00,1073500,1077000,1055600,1062000,25662200,0.00047037640325714144\nQQQ,20011030 00:00,337100,377100,314500,334000,92425500,0.00047037640325714144\nSPY,20011031 00:00,1069000,1078600,1060100,1062700,27388000,0.0004643552032905345\nQQQ,20011031 00:00,340400,355800,336800,339600,105198200,0.0004643552032905345\nSPY,20011101 00:00,1066000,1090100,1054300,1086700,28591900,0.0004686927662369987\nQQQ,20011101 00:00,344400,355600,337800,354400,92836500,0.0004686927662369987\nSPY,20011102 00:00,1084400,1093800,1078700,1090600,16378300,0.00046859515563703265\nQQQ,20011102 00:00,352700,358500,348900,355000,63444000,0.00046859515563703265\nSPY,20011105 00:00,1101200,1110900,1007400,1105800,15885700,0.0004723244777556113\nQQQ,20011105 00:00,362600,371600,361600,368400,62362700,0.0004723244777556113\nSPY,20011106 00:00,1103500,1124500,1098500,1122900,22531600,0.00046907573654519094\nQQQ,20011106 00:00,366100,379800,357100,379200,110400900,0.00046907573654519094\nSPY,20011107 00:00,1117700,1131200,1115600,1119600,19023300,0.00046888305103373216\nQQQ,20011107 00:00,376100,388400,371000,379500,91493000,0.00046888305103373216\nSPY,20011108 00:00,1128700,1226600,1104500,1123500,21245000,0.0004682856089703235\nQQQ,20011108 00:00,385500,399700,372500,376500,117043400,0.0004682856089703235\nSPY,20011109 00:00,1122500,1129600,1114400,1124400,16170300,0.00046825327579033297\nQQQ,20011109 00:00,376000,387500,344300,376900,71811800,0.00046825327579033297\nSPY,20011112 00:00,1110000,1126500,1100000,1121600,25038200,0.00046831427224035797\nQQQ,20011112 00:00,370000,383500,363000,380400,113516600,0.00046831427224035797\nSPY,20011113 00:00,1134400,1144300,1131800,1143900,14030800,0.00047132826254869353\nQQQ,20011113 00:00,390300,399800,381000,393400,95704000,0.00047132826254869353\nSPY,20011114 00:00,1151700,1154000,1137000,1146200,17418000,0.00046716637164622994\nQQQ,20011114 00:00,399600,402400,387400,395000,87957000,0.00046716637164622994\nSPY,20011115 00:00,1143700,1151800,1139300,1146000,20437200,0.00046720591448131836\nQQQ,20011115 00:00,391600,401100,389500,394100,82087600,0.00046720591448131836\nSPY,20011116 00:00,1150800,1151000,1134000,1143100,17188100,0.00046199304229888207\nQQQ,20011116 00:00,394800,399800,389200,394500,70540600,0.00046199304229888207\nSPY,20011119 00:00,1149200,1155700,1144500,1155300,12517900,0.00046251543125811357\nQQQ,20011119 00:00,397900,403400,387100,403200,71648300,0.00046251543125811357\nSPY,20011120 00:00,1153700,1158000,1111500,1148100,15890300,0.00045651702974612514\nQQQ,20011120 00:00,400800,410700,384000,386300,84262300,0.00045651702974612514\nSPY,20011121 00:00,1145000,1146700,1135100,1141500,10996400,0.00045622353886918247\nQQQ,20011121 00:00,384700,389500,331800,386800,60797400,0.00045622353886918247\nSPY,20011123 00:00,1140400,1186300,1140000,1155200,7265300,0.0004555576969610408\nQQQ,20011123 00:00,387600,394600,382700,393800,27694200,0.0004555576969610408\nSPY,20011126 00:00,1157500,1163400,1150700,1162200,13697200,0.0004562750154760315\nQQQ,20011126 00:00,395800,404000,390100,403000,78656500,0.0004562750154760315\nSPY,20011127 00:00,1156200,1169000,1140900,1154000,18924400,0.0004523359441330308\nQQQ,20011127 00:00,400500,409700,392000,401300,105401900,0.0004523359441330308\nSPY,20011128 00:00,1147400,1151700,1132500,1133400,19443200,0.0004545692549931046\nQQQ,20011128 00:00,397300,403700,369500,387600,107577600,0.0004545692549931046\nSPY,20011129 00:00,1136600,1145600,1130000,1144800,15954000,0.0004527396910233672\nQQQ,20011129 00:00,390400,398600,367400,398400,80035400,0.0004527396910233672\nSPY,20011130 00:00,1144000,1149100,1140200,1143000,12983000,0.0004486331759183731\nQQQ,20011130 00:00,397300,400500,392300,397300,65087100,0.0004486331759183731\nSPY,20011203 00:00,1136500,1140800,1130100,1133600,14533800,0.0004494881051353995\nQQQ,20011203 00:00,392900,398200,380000,390300,59201900,0.0004494881051353995\nSPY,20011204 00:00,1139200,1150000,1133500,1150000,14970000,0.0004496109418535578\nQQQ,20011204 00:00,393400,406800,384400,406500,75291200,0.0004496109418535578\nSPY,20011205 00:00,1156100,1180000,1155600,1176400,23817500,0.00045481591644799373\nQQQ,20011205 00:00,412100,431500,411200,428000,113669600,0.00045481591644799373\nSPY,20011206 00:00,1173500,1179400,1169300,1173000,16930400,0.00045148867885468487\nQQQ,20011206 00:00,427100,444900,423600,427700,75755300,0.00045148867885468487\nSPY,20011207 00:00,1169000,1170900,1157000,1164500,17768300,0.0004519528734583595\nQQQ,20011207 00:00,424900,462000,411400,417200,83031500,0.0004519528734583595\nSPY,20011210 00:00,1158500,1163900,1144600,1144600,13238000,0.0004528204621267344\nQQQ,20011210 00:00,413300,422700,408800,409900,69371400,0.0004528204621267344\nSPY,20011211 00:00,1149000,1157200,1139000,1141900,19660800,0.0004356312822377034\nQQQ,20011211 00:00,414600,429800,411500,413600,64052300,0.0004356312822377034\nSPY,20011212 00:00,1145500,1147800,1131100,1142900,15487100,0.0004335961151897955\nQQQ,20011212 00:00,415000,419400,405000,415700,75318100,0.0004335961151897955\nSPY,20011213 00:00,1134500,1137000,1122800,1123600,17341600,0.00043599262988823354\nQQQ,20011213 00:00,407100,499300,390000,398700,78461000,0.00043599262988823354\nSPY,20011214 00:00,1123300,1134900,1120000,1129000,15363600,0.00043116435162078126\nQQQ,20011214 00:00,398700,404600,395700,400200,81937100,0.00043116435162078126\nSPY,20011217 00:00,1129900,1143600,1129000,1139900,13616800,0.00043104589622513064\nQQQ,20011217 00:00,400200,412400,395800,408200,62613300,0.00043104589622513064\nSPY,20011218 00:00,1146300,1151500,1143400,1149300,12932400,0.00043075269277516895\nQQQ,20011218 00:00,411600,419000,408800,413000,48943000,0.00043075269277516895\nSPY,20011219 00:00,1140900,1159200,1140000,1155000,19767600,0.0004290667822202251\nQQQ,20011219 00:00,405600,413200,403200,405600,78018900,0.0004290667822202251\nSPY,20011220 00:00,1155000,1158000,1146300,1146900,13673400,0.00042769036113119634\nQQQ,20011220 00:00,401000,419600,388000,388100,82299600,0.00042769036113119634\nSPY,20011221 00:00,1150300,1151000,1142000,1146600,12542200,0.00042531754297182883\nQQQ,20011221 00:00,394200,397100,384100,393000,54071800,0.00042531754297182883\nSPY,20011224 00:00,1148300,1150400,1146100,1147300,7822400,0.0004254757834812272\nQQQ,20011224 00:00,395400,396300,391200,392000,13781200,0.0004254757834812272\nSPY,20011226 00:00,1146500,1162100,1146500,1152500,9195600,0.0004229582646453438\nQQQ,20011226 00:00,393700,403000,391600,396500,37810000,0.0004229582646453438\nSPY,20011227 00:00,1153000,1163300,1152600,1159300,8636700,0.00041435268708182513\nQQQ,20011227 00:00,398500,408000,396000,399500,33573400,0.00041435268708182513\nSPY,20011228 00:00,1162900,1167500,1159500,1162100,9602500,0.00041421330319160873\nQQQ,20011228 00:00,402900,408000,400000,403400,38556000,0.00041421330319160873\nSPY,20011231 00:00,1161500,1164000,1148500,1148900,12333600,0.0004066480918560468\nQQQ,20011231 00:00,403100,410800,392100,392100,43090400,0.0004066480918560468\nSPY,20020102 00:00,1151100,1156500,1138100,1155900,16855900,0.0004074169521206717\nQQQ,20020102 00:00,395700,400500,389300,400200,67753000,0.0004074169521206717\nSPY,20020103 00:00,1156500,1168300,1150000,1167600,14579900,0.0004082320477415989\nQQQ,20020103 00:00,403100,419800,402600,414500,84514500,0.0004082320477415989\nSPY,20020104 00:00,1171700,1179800,1133600,1174100,19708000,0.0004083467037470226\nQQQ,20020104 00:00,419500,422900,399700,416500,87549900,0.0004083467037470226\nSPY,20020107 00:00,1177000,1179900,1157100,1167000,11601500,0.0004068594272973965\nQQQ,20020107 00:00,421200,422200,401100,410900,73078100,0.0004068594272973965\nSPY,20020108 00:00,1168000,1170600,1159700,1163600,12006100,0.00039620208619252785\nQQQ,20020108 00:00,411100,417700,408400,415100,67217200,0.00039620208619252785\nSPY,20020109 00:00,1166800,1199100,1153400,1157000,15074900,0.0003581794005214259\nQQQ,20020109 00:00,420400,433700,409000,411300,83691000,0.0003581794005214259\nSPY,20020110 00:00,1157000,1163500,1153000,1159600,13162200,0.0003573244618035195\nQQQ,20020110 00:00,411700,419200,401000,412600,77405400,0.0003573244618035195\nSPY,20020111 00:00,1162100,1162800,1147100,1147700,12628100,0.0003507097947418739\nQQQ,20020111 00:00,413600,418900,404600,406800,60523800,0.0003507097947418739\nSPY,20020114 00:00,1146500,1148400,1141000,1141200,11640600,0.0003511521138494496\nQQQ,20020114 00:00,404900,411000,391000,399000,70789900,0.0003511521138494496\nSPY,20020115 00:00,1145500,1153900,1139000,1148800,16475400,0.0003511992416770228\nQQQ,20020115 00:00,400400,409000,395600,401300,63410600,0.0003511992416770228\nSPY,20020116 00:00,1143000,1144000,1130000,1130500,15926800,0.0003507608104792662\nQQQ,20020116 00:00,395400,399400,387900,388200,97561400,0.0003507608104792662\nSPY,20020117 00:00,1137600,1142400,1134000,1141300,16033000,0.0003503147516540735\nQQQ,20020117 00:00,394800,399800,390100,398500,69688400,0.0003503147516540735\nSPY,20020118 00:00,1130000,1138700,1113600,1130800,15778700,0.00035131735259014135\nQQQ,20020118 00:00,388300,399300,377300,385600,78912100,0.00035131735259014135\nSPY,20020122 00:00,1137500,1139500,1120200,1122500,11249800,0.0003523971228305611\nQQQ,20020122 00:00,390000,399700,373300,373900,81591200,0.0003523971228305611\nSPY,20020123 00:00,1126300,1135600,1120200,1131400,11791000,0.0003530073947415468\nQQQ,20020123 00:00,376500,386900,373500,385300,75346000,0.0003530073947415468\nSPY,20020124 00:00,1136400,1142500,1133200,1135400,11323700,0.0003502223635542887\nQQQ,20020124 00:00,389400,395100,379600,389600,77965900,0.0003502223635542887\nSPY,20020125 00:00,1131200,1141800,1130400,1135900,11634500,0.0003502051348835061\nQQQ,20020125 00:00,384700,399800,383000,388000,58013100,0.0003502051348835061\nSPY,20020128 00:00,1139000,1141900,989200,1136300,9808100,0.0003502535338147755\nQQQ,20020128 00:00,391500,393900,381500,389500,47825500,0.0003502535338147755\nSPY,20020129 00:00,1138500,1144100,1100500,1102800,27316700,0.00035188607601671087\nQQQ,20020129 00:00,391300,394100,375200,378600,82903400,0.00035188607601671087\nSPY,20020130 00:00,1103900,1133900,1084000,1116100,34240300,0.00035247118627057035\nQQQ,20020130 00:00,380000,388500,368500,382800,100341700,0.00035247118627057035\nSPY,20020131 00:00,1121500,1132700,1116200,1132400,17736200,0.0003523136132310617\nQQQ,20020131 00:00,385800,387800,380200,385600,68444300,0.0003523136132310617\nSPY,20020201 00:00,1130900,1137000,1115500,1126000,15398900,0.0003526175389078605\nQQQ,20020201 00:00,384000,389800,377000,380600,60410100,0.0003526175389078605\nSPY,20020204 00:00,1122300,1151800,1094500,1097000,24526300,0.00035510417423979416\nQQQ,20020204 00:00,379600,388300,366100,367700,81961500,0.00035510417423979416\nSPY,20020205 00:00,1094000,1105000,1085300,1092700,35497300,0.00035525793773784293\nQQQ,20020205 00:00,365900,373300,360000,364200,85944600,0.00035525793773784293\nSPY,20020206 00:00,1096500,1097400,1080600,1087000,29039000,0.00035490769388001606\nQQQ,20020206 00:00,368400,398500,335600,360000,96051400,0.00035490769388001606\nSPY,20020207 00:00,1087200,1098600,1081600,1083800,23921700,0.00035496207179294063\nQQQ,20020207 00:00,360000,365500,350000,352100,96616900,0.00035496207179294063\nSPY,20020208 00:00,1086300,1100500,1083000,1099700,17609700,0.0003533558788812532\nQQQ,20020208 00:00,354600,361300,349700,361000,79277700,0.0003533558788812532\nSPY,20020211 00:00,1100500,1116300,1098200,1115900,17618500,0.00035463901983920343\nQQQ,20020211 00:00,361400,391700,352500,367900,57597300,0.00035463901983920343\nSPY,20020212 00:00,1109600,1117100,1106200,1111100,13050700,0.00035476035018862633\nQQQ,20020212 00:00,363100,369800,360400,365300,48355900,0.00035476035018862633\nSPY,20020213 00:00,1114800,1125400,1113500,1122600,16158600,0.00035458584495579997\nQQQ,20020213 00:00,367200,371500,360700,369500,60846400,0.00035458584495579997\nSPY,20020214 00:00,1125100,1129700,1115900,1119800,19646600,0.0003541569322894505\nQQQ,20020214 00:00,371500,378000,360000,367500,75775100,0.0003541569322894505\nSPY,20020215 00:00,1121500,1122400,1107100,1108300,17842600,0.0003533970299853159\nQQQ,20020215 00:00,368400,389000,356400,357800,64923700,0.0003533970299853159\nSPY,20020219 00:00,1101500,1103000,1002000,1087400,14698200,0.0003553122944609597\nQQQ,20020219 00:00,353800,354600,340000,345600,70780900,0.0003553122944609597\nSPY,20020220 00:00,1090500,1103800,1078200,1103200,28524400,0.0003554405290485899\nQQQ,20020220 00:00,349100,360700,339300,350900,105033200,0.0003554405290485899\nSPY,20020221 00:00,1099300,1109900,1084000,1086000,23205400,0.00035772078593671367\nQQQ,20020221 00:00,347900,349500,336000,336000,108215300,0.00035772078593671367\nSPY,20020222 00:00,1083500,1099400,1078700,1093700,26396200,0.0003571190865188668\nQQQ,20020222 00:00,336200,342000,311100,337600,96129700,0.0003571190865188668\nSPY,20020225 00:00,1097500,1118100,1097000,1115000,16472600,0.0003556052114469729\nQQQ,20020225 00:00,340100,352500,339600,350100,87795700,0.0003556052114469729\nSPY,20020226 00:00,1116000,1120400,1101900,1113600,21362600,0.0003524120026917439\nQQQ,20020226 00:00,352300,359000,342500,348800,93980300,0.0003524120026917439\nSPY,20020227 00:00,1119600,1128600,1106500,1115500,26777200,0.0003508041187183793\nQQQ,20020227 00:00,354000,360800,340000,343400,93326900,0.0003508041187183793\nSPY,20020228 00:00,1118300,1127500,1111400,1111900,22479100,0.0003509395020523134\nQQQ,20020228 00:00,345100,349700,337500,338500,96407300,0.0003509395020523134\nSPY,20020301 00:00,1117200,1137300,1115100,1136600,25086800,0.00035618697811886144\nQQQ,20020301 00:00,341500,357300,340000,357000,84833800,0.00035618697811886144\nSPY,20020304 00:00,1139000,1159900,1136500,1159300,26297000,0.0003580861794566755\nQQQ,20020304 00:00,357000,372300,327400,371800,105917300,0.0003580861794566755\nSPY,20020305 00:00,1153300,1164000,1149700,1152100,21551900,0.0003564982931250162\nQQQ,20020305 00:00,369400,378700,344200,372700,93016600,0.0003564982931250162\nSPY,20020306 00:00,1151000,1177100,1150800,1168100,19031000,0.0003550472835167402\nQQQ,20020306 00:00,370800,379500,366000,377900,88847100,0.0003550472835167402\nSPY,20020307 00:00,1173600,1175000,1125300,1163300,18622500,0.0003547966456179047\nQQQ,20020307 00:00,381200,383300,370100,375100,82054500,0.0003547966456179047\nSPY,20020308 00:00,1173800,1273000,1164800,1168900,19918100,0.00035441498962229145\nQQQ,20020308 00:00,382300,390300,381300,386600,85001000,0.00035441498962229145\nSPY,20020311 00:00,1168900,1179000,1164300,1173400,14648900,0.00035395428701673874\nQQQ,20020311 00:00,383500,419100,380600,386600,70091400,0.00035395428701673874\nSPY,20020312 00:00,1161100,1171200,1159400,1171000,16309200,0.00035256073050877156\nQQQ,20020312 00:00,375800,387000,373200,377700,79447200,0.00035256073050877156\nSPY,20020313 00:00,1166300,1167500,1150000,1159000,16205200,0.00035310633064806286\nQQQ,20020313 00:00,374100,376600,344500,370200,72345500,0.00035310633064806286\nSPY,20020314 00:00,1160400,1164300,1156300,1158600,10434100,0.0003533752229792744\nQQQ,20020314 00:00,370700,379100,359100,368100,71020000,0.0003533752229792744\nSPY,20020315 00:00,1159700,1169500,1062200,1167900,21148600,0.00034738091109205255\nQQQ,20020315 00:00,369000,373300,366000,371500,63630600,0.00034738091109205255\nSPY,20020318 00:00,1171000,1175700,1158500,1167600,16975000,0.00033530101051606684\nQQQ,20020318 00:00,376400,379400,370000,374800,78530400,0.00033530101051606684\nSPY,20020319 00:00,1173000,1177400,1168200,1173500,17720100,0.00033141861266748764\nQQQ,20020319 00:00,376100,378800,347000,374300,57919600,0.00033141861266748764\nSPY,20020320 00:00,1165000,1172500,1153900,1154300,16332900,0.00033105341673291547\nQQQ,20020320 00:00,368800,379000,360000,361500,60864800,0.00033105341673291547\nSPY,20020321 00:00,1153000,1159000,1141200,1156000,26674700,0.0003316744570477433\nQQQ,20020321 00:00,361500,371400,359000,370900,91180400,0.0003316744570477433\nSPY,20020322 00:00,1155000,1159400,1147000,1150900,15162300,0.00032955555793184535\nQQQ,20020322 00:00,369400,378800,364700,366200,58163100,0.00032955555793184535\nSPY,20020325 00:00,1150900,1153600,1133800,1134300,16756100,0.00032772028559253653\nQQQ,20020325 00:00,366900,369900,350000,355500,84092000,0.00032772028559253653\nSPY,20020326 00:00,1135200,1150200,1134700,1140800,19121200,0.0003207283248451242\nQQQ,20020326 00:00,354300,367000,350000,358000,93168600,0.0003207283248451242\nSPY,20020327 00:00,1140300,1150100,1130000,1146700,18290300,0.00032054119217387537\nQQQ,20020327 00:00,356400,387000,354000,357600,63829700,0.00032054119217387537\nSPY,20020328 00:00,1149700,1157700,1146800,1149100,16005200,0.00032160277484313837\nQQQ,20020328 00:00,360200,363700,351700,361500,62262900,0.00032160277484313837\nSPY,20020401 00:00,1142300,1151000,1129600,1148300,14408500,0.0003214904711551449\nQQQ,20020401 00:00,358000,377700,350000,367700,68919000,0.0003214904711551449\nSPY,20020402 00:00,1139800,1441200,1137700,1139300,14373500,0.00032349683665428507\nQQQ,20020402 00:00,359900,373500,350000,351100,74779400,0.00032349683665428507\nSPY,20020403 00:00,1140100,1162000,1121500,1127400,24583000,0.00032065359828051677\nQQQ,20020403 00:00,353000,354500,340000,347000,77375600,0.00032065359828051677\nSPY,20020404 00:00,1126000,1155300,1122300,1128900,22450100,0.00031274683649143523\nQQQ,20020404 00:00,345100,358500,340000,347600,89712800,0.00031274683649143523\nSPY,20020405 00:00,1131900,1136700,1121800,1125300,19653800,0.0003125340951442468\nQQQ,20020405 00:00,350100,351800,340000,343100,65961900,0.0003125340951442468\nSPY,20020408 00:00,1113200,1128800,1112300,1128100,15283800,0.0003124800843997344\nQQQ,20020408 00:00,334800,347500,333300,346900,72541700,0.0003124800843997344\nSPY,20020409 00:00,1131900,1131900,1119300,1120500,13036600,0.0003114907748317489\nQQQ,20020409 00:00,347800,349800,332200,335000,77182400,0.0003114907748317489\nSPY,20020410 00:00,1121000,1135400,1120900,1133500,17406700,0.0003017020467904352\nQQQ,20020410 00:00,337600,388500,331300,339100,85289100,0.0003017020467904352\nSPY,20020411 00:00,1128900,1130500,1105000,1107200,24076100,0.00030392530359305686\nQQQ,20020411 00:00,336600,339200,328900,330000,88480400,0.00030392530359305686\nSPY,20020412 00:00,1110300,1119700,1105700,1113300,14083200,0.000285278399682115\nQQQ,20020412 00:00,333300,340300,329500,336300,78926400,0.000285278399682115\nSPY,20020415 00:00,1116200,1119700,1102000,1106300,16132400,0.00028195510238465974\nQQQ,20020415 00:00,338000,339600,332000,337800,66479000,0.00028195510238465974\nSPY,20020416 00:00,1117000,1133200,1116700,1131200,13535800,0.0002848417771215893\nQQQ,20020416 00:00,344300,352200,340000,351500,66046100,0.0002848417771215893\nSPY,20020417 00:00,1133900,1136700,1126000,1130500,12254200,0.00027622964430417746\nQQQ,20020417 00:00,354000,356800,340000,349700,70550300,0.00027622964430417746\nSPY,20020418 00:00,1129000,1134600,1111500,1127600,24116800,0.0002764095680560141\nQQQ,20020418 00:00,347900,355200,336100,347700,87576400,0.0002764095680560141\nSPY,20020419 00:00,1132000,1132400,1125600,1128500,10213300,0.0002742379529333799\nQQQ,20020419 00:00,350600,366500,340000,345000,58349600,0.0002742379529333799\nSPY,20020422 00:00,1123800,1126100,1108400,1111400,13095800,0.0002754677914691709\nQQQ,20020422 00:00,340100,348900,332600,335600,65846400,0.0002754677914691709\nSPY,20020423 00:00,1110900,1119000,1101700,1103800,15862500,0.00027545682038036644\nQQQ,20020423 00:00,336000,337800,320000,328600,72528100,0.00027545682038036644\nSPY,20020424 00:00,1105600,1112400,1095100,1095900,17114100,0.00026066773090739983\nQQQ,20020424 00:00,332100,333100,320000,324000,67272200,0.00026066773090739983\nSPY,20020425 00:00,1092100,1104300,1087200,1094300,25129800,0.000257019037522228\nQQQ,20020425 00:00,323100,354800,320000,324100,101260200,0.000257019037522228\nSPY,20020426 00:00,1097900,1100100,1079000,1079500,17209600,0.0002585362856528215\nQQQ,20020426 00:00,326600,340000,311700,311800,95728900,0.0002585362856528215\nSPY,20020429 00:00,1079300,1082600,1066300,1069200,16865400,0.0002554852949851772\nQQQ,20020429 00:00,312400,315500,305700,310300,83507600,0.0002554852949851772\nSPY,20020430 00:00,1070200,1087500,1066400,1079800,18604700,0.0002552433356682669\nQQQ,20020430 00:00,310300,322000,309400,317700,92557900,0.0002552433356682669\nSPY,20020501 00:00,1079700,1092500,1068000,1089600,23395700,0.00025295352980793097\nQQQ,20020501 00:00,316700,318400,305800,315600,108551800,0.00025295352980793097\nSPY,20020502 00:00,1091000,1099100,1082000,1087700,14990800,0.0002537198814380313\nQQQ,20020502 00:00,314000,319900,300000,305800,87076700,0.0002537198814380313\nSPY,20020503 00:00,1086000,1089500,1072000,1076700,17107800,0.00025320294493530075\nQQQ,20020503 00:00,304700,305100,289800,296500,88511800,0.00025320294493530075\nSPY,20020506 00:00,1076500,1089000,1055100,1056200,20615700,0.0002551566183089811\nQQQ,20020506 00:00,296400,299800,285000,289100,95854400,0.0002551566183089811\nSPY,20020507 00:00,1061100,1063200,1050000,1052300,20654000,0.0002530436531655583\nQQQ,20020507 00:00,292700,338800,284200,288400,94387900,0.0002530436531655583\nSPY,20020508 00:00,1070500,1093600,1067900,1091600,26506300,0.00026909296218636776\nQQQ,20020508 00:00,301300,318700,298400,318600,127606800,0.00026909296218636776\nSPY,20020509 00:00,1086500,1091000,1075800,1076500,15747600,0.0002684741123461011\nQQQ,20020509 00:00,315800,318900,308000,308900,102722900,0.0002684741123461011\nSPY,20020510 00:00,1079700,1080500,1057200,1059800,17174700,0.00026924655298634324\nQQQ,20020510 00:00,310100,311000,287800,296500,108307700,0.00026924655298634324\nSPY,20020513 00:00,1062200,1079500,1057800,1078200,13380700,0.00027216264511906445\nQQQ,20020513 00:00,298700,309800,296800,308700,92038500,0.00027216264511906445\nSPY,20020514 00:00,1096200,1102600,1090000,1100900,18675600,0.0002767999756652984\nQQQ,20020514 00:00,320600,326100,318700,325000,97229800,0.0002767999756652984\nSPY,20020515 00:00,1095000,1109100,1092900,1095500,27642300,0.00027618336168738474\nQQQ,20020515 00:00,320800,337500,318500,326300,148199200,0.00027618336168738474\nSPY,20020516 00:00,1097000,1104300,1093300,1103500,18318500,0.0002764333638984828\nQQQ,20020516 00:00,325400,328600,322100,327500,81522200,0.0002764333638984828\nSPY,20020517 00:00,1106600,1111700,1101000,1111100,26024300,0.0002763774216388105\nQQQ,20020517 00:00,332900,337300,317500,330000,77990100,0.0002763774216388105\nSPY,20020520 00:00,1106400,1106900,1094900,1096400,12980900,0.0002778241720080101\nQQQ,20020520 00:00,326000,329900,318800,321700,72959900,0.0002778241720080101\nSPY,20020521 00:00,1101100,1104900,1082900,1084800,15775700,0.00027886238031332874\nQQQ,20020521 00:00,323700,325900,310000,313000,100485000,0.00027886238031332874\nSPY,20020522 00:00,1082200,1091200,1080000,1090500,14899600,0.0002722122569488034\nQQQ,20020522 00:00,309700,315900,306500,314500,84738700,0.0002722122569488034\nSPY,20020523 00:00,1092600,1102400,1084800,1101600,12756400,0.00027286728541829944\nQQQ,20020523 00:00,316300,327000,308000,320600,91359900,0.00027286728541829944\nSPY,20020524 00:00,1099800,1102100,1086600,1088500,10518500,0.00027394072878888647\nQQQ,20020524 00:00,315900,317000,310100,312300,53973600,0.00027394072878888647\nSPY,20020528 00:00,1090500,1099400,1074500,1079000,22840100,0.00026975734016791616\nQQQ,20020528 00:00,314700,318900,304900,309800,65321800,0.00026975734016791616\nSPY,20020529 00:00,1076300,1080200,1072500,1072500,13926300,0.00027013903712142163\nQQQ,20020529 00:00,306700,309000,303000,303400,69849800,0.00027013903712142163\nSPY,20020530 00:00,1065500,1075100,1059000,1070100,18078000,0.0002676826086285792\nQQQ,20020530 00:00,300100,307200,299000,305700,88733100,0.0002676826086285792\nSPY,20020531 00:00,1074000,1085600,1070800,1072300,17164100,0.0002671513250320653\nQQQ,20020531 00:00,307600,310400,300300,300800,75415100,0.0002671513250320653\nSPY,20020603 00:00,1070900,1088800,1042500,1043000,25052400,0.00027048596573859125\nQQQ,20020603 00:00,300100,302500,287900,288600,73872900,0.00027048596573859125\nSPY,20020604 00:00,1041500,1052000,1032800,1044100,25161300,0.0002694895192865546\nQQQ,20020604 00:00,287500,299900,278000,293400,96760700,0.0002694895192865546\nSPY,20020605 00:00,1049500,1056200,1043500,1055000,18265200,0.00026709432824571533\nQQQ,20020605 00:00,294200,298000,282900,297100,91564300,0.00026709432824571533\nSPY,20020606 00:00,1055400,1246700,1031500,1034200,19173400,0.0002688508868039066\nQQQ,20020606 00:00,295100,299800,280300,288300,86572200,0.0002688508868039066\nSPY,20020607 00:00,1017900,1039200,1017200,1032600,21968400,0.00026839209702970355\nQQQ,20020607 00:00,276300,288700,275200,283700,104499800,0.00026839209702970355\nSPY,20020610 00:00,1032400,1044600,1030200,1035600,18162400,0.0002684012450308122\nQQQ,20020610 00:00,283600,287500,281400,282700,71866600,0.0002684012450308122\nSPY,20020611 00:00,1041300,1045400,1017600,1018900,20164600,0.0002673193382065086\nQQQ,20020611 00:00,286000,286900,273600,274200,84114200,0.0002673193382065086\nSPY,20020612 00:00,1017100,1029700,1007800,1026400,28666100,0.0002676337409967781\nQQQ,20020612 00:00,272500,285000,262000,279300,149489600,0.0002676337409967781\nSPY,20020613 00:00,1021300,1030000,1013400,1015000,20605000,0.0002672841137766227\nQQQ,20020613 00:00,277700,282100,267000,275500,97081400,0.0002672841137766227\nSPY,20020614 00:00,1003100,1015600,985000,1012900,36963600,0.0002661630058021586\nQQQ,20020614 00:00,268600,277200,262000,276200,120081600,0.0002661630058021586\nSPY,20020617 00:00,1019200,1042900,1004700,1041900,16406300,0.0002697770092146038\nQQQ,20020617 00:00,280000,287500,279100,286000,84985700,0.0002697770092146038\nSPY,20020618 00:00,1037400,1047400,1029200,1042400,15992500,0.0002697021863276155\nQQQ,20020618 00:00,283200,295700,274100,283300,79964200,0.0002697021863276155\nSPY,20020619 00:00,1035000,1044800,1022600,1025400,19380200,0.00027046931760034534\nQQQ,20020619 00:00,281000,289500,272500,273200,90029700,0.00027046931760034534\nSPY,20020620 00:00,1022700,1030500,1009600,1012000,23810000,0.0002690248899819719\nQQQ,20020620 00:00,272700,277500,248400,264900,98065700,0.0002690248899819719\nSPY,20020621 00:00,1004700,1012000,986900,991900,27083500,0.00027080653749166745\nQQQ,20020621 00:00,263700,277700,256500,258000,98877900,0.00027080653749166745\nSPY,20020624 00:00,986100,1006900,972500,996900,35515100,0.0002710471487963984\nQQQ,20020624 00:00,254600,268000,252100,263500,138656300,0.0002710471487963984\nSPY,20020625 00:00,1003000,1008900,975400,979000,30054700,0.00027312527605870995\nQQQ,20020625 00:00,265800,267200,244500,254700,132797500,0.00027312527605870995\nSPY,20020626 00:00,952000,981500,952000,976200,35590000,0.000271923303522525\nQQQ,20020626 00:00,244400,294000,243700,255700,146630700,0.000271923303522525\nSPY,20020627 00:00,985000,994500,965700,994500,31061400,0.0002728753240570998\nQQQ,20020627 00:00,260000,261500,205900,261100,115953200,0.0002728753240570998\nSPY,20020628 00:00,992400,1005000,990200,992500,20632900,0.0002725037460265067\nQQQ,20020628 00:00,260500,267500,255000,261500,87711900,0.0002725037460265067\nSPY,20020701 00:00,991900,1015000,969500,970800,18535000,0.0002766904575898173\nQQQ,20020701 00:00,259800,261400,248100,248500,62464800,0.0002766904575898173\nSPY,20020702 00:00,968700,980800,947700,950200,33423400,0.0002794035656068678\nQQQ,20020702 00:00,246100,254200,238900,239800,113618100,0.0002794035656068678\nSPY,20020703 00:00,946200,958400,937300,956900,30051200,0.0002805106053064215\nQQQ,20020703 00:00,238500,259300,227300,247200,103246100,0.0002805106053064215\nSPY,20020705 00:00,967800,995500,966700,993000,19291300,0.0002891032521377101\nQQQ,20020705 00:00,252600,264100,250500,263500,58559700,0.0002891032521377101\nSPY,20020708 00:00,989800,997000,975600,980300,18365500,0.0002907143600154735\nQQQ,20020708 00:00,262000,286800,250800,252500,96044800,0.0002907143600154735\nSPY,20020709 00:00,977300,983400,950100,956100,26169900,0.00029290231231885507\nQQQ,20020709 00:00,252500,259200,241200,246800,88783000,0.00029290231231885507\nSPY,20020710 00:00,960000,960700,922000,922900,47057800,0.00029656217567938423\nQQQ,20020710 00:00,250000,256000,238300,239500,114568600,0.00029656217567938423\nSPY,20020711 00:00,917600,933500,900600,931500,55775500,0.00029587982846370853\nQQQ,20020711 00:00,237700,257800,233000,248000,163549300,0.00029587982846370853\nSPY,20020712 00:00,933300,938900,915200,924600,35065500,0.0002916879930419612\nQQQ,20020712 00:00,252500,259000,241900,248500,127952000,0.0002916879930419612\nSPY,20020715 00:00,916400,1016000,878900,921000,75907900,0.0002908535836622612\nQQQ,20020715 00:00,246900,255100,237400,254100,138627900,0.0002908535836622612\nSPY,20020716 00:00,911300,923800,898700,905800,50090100,0.0002892333702278039\nQQQ,20020716 00:00,252500,260300,241400,251700,140417200,0.0002892333702278039\nSPY,20020717 00:00,924600,933000,897500,910000,45753500,0.0002895926665907517\nQQQ,20020717 00:00,260800,266800,248900,255500,151021200,0.0002895926665907517\nSPY,20020718 00:00,907000,911000,882400,883300,28861700,0.000285863750071708\nQQQ,20020718 00:00,253900,258700,246700,247800,108479000,0.000285863750071708\nSPY,20020719 00:00,867700,884000,843000,848000,64420100,0.0002903421996620104\nQQQ,20020719 00:00,243300,255900,238000,240000,119480300,0.0002903421996620104\nSPY,20020722 00:00,841100,859100,814500,822100,73962000,0.00029181205867333064\nQQQ,20020722 00:00,238600,282800,230900,233800,146379600,0.00029181205867333064\nSPY,20020723 00:00,825500,832400,788500,800000,65162600,0.0002951991452751309\nQQQ,20020723 00:00,234500,238500,222800,222900,147579000,0.0002951991452751309\nSPY,20020724 00:00,781400,849400,776800,847500,98931400,0.00030973453919475844\nQQQ,20020724 00:00,218200,236500,211600,236200,180896400,0.00030973453919475844\nSPY,20020725 00:00,842800,858500,816000,842000,85709600,0.0003103448078237505\nQQQ,20020725 00:00,232600,251300,218000,222200,156626000,0.0003103448078237505\nSPY,20020726 00:00,846500,856900,838000,856000,38022600,0.0003118234836091374\nQQQ,20020726 00:00,225700,245900,220100,226500,93825700,0.0003118234836091374\nSPY,20020729 00:00,875100,903400,845400,902300,49081500,0.000324079407349808\nQQQ,20020729 00:00,232800,241200,222400,240400,94672200,0.000324079407349808\nSPY,20020730 00:00,893200,914000,887000,907000,45504900,0.00032359150127580285\nQQQ,20020730 00:00,237300,246900,229600,243600,115180600,0.00032359150127580285\nSPY,20020731 00:00,905000,914500,889300,913800,44683000,0.00032196210027068484\nQQQ,20020731 00:00,240000,246500,223800,238800,90724800,0.00032196210027068484\nSPY,20020801 00:00,908800,913500,884600,886400,59773800,0.0003258634127577784\nQQQ,20020801 00:00,237400,239000,221300,227000,81369500,0.0003258634127577784\nSPY,20020802 00:00,885000,889200,852900,866600,49173500,0.00032743533298565\nQQQ,20020802 00:00,227800,228400,210000,222000,83653600,0.00032743533298565\nSPY,20020805 00:00,865000,869300,836000,837300,44063900,0.000332221333319006\nQQQ,20020805 00:00,221100,225200,213000,213300,81709800,0.000332221333319006\nSPY,20020806 00:00,852300,879000,848800,864000,58414400,0.0003394550205706426\nQQQ,20020806 00:00,218000,230100,210900,224900,106901800,0.0003394550205706426\nSPY,20020807 00:00,878800,885000,857700,881500,39145700,0.00034037069442050606\nQQQ,20020807 00:00,232000,234000,219600,228400,122890500,0.00034037069442050606\nSPY,20020808 00:00,884200,911000,878000,909800,45784100,0.00034422486852455194\nQQQ,20020808 00:00,227600,240000,217900,235100,109982600,0.00034422486852455194\nSPY,20020809 00:00,901000,919400,893500,912600,40215000,0.00034395180922307174\nQQQ,20020809 00:00,232100,237200,220100,232900,91800100,0.00034395180922307174\nSPY,20020812 00:00,900000,912700,895500,907000,25204200,0.000343401181844799\nQQQ,20020812 00:00,230500,239500,229000,233300,59848600,0.000343401181844799\nSPY,20020813 00:00,901500,916600,886700,887500,46577700,0.00034582545674962414\nQQQ,20020813 00:00,232300,238700,225500,226000,84948300,0.00034582545674962414\nSPY,20020814 00:00,890200,926300,880100,924100,52910500,0.0003542698271563461\nQQQ,20020814 00:00,226700,242000,224700,240600,99407600,0.0003542698271563461\nSPY,20020815 00:00,928500,939900,903000,934000,43290900,0.0003549156217274408\nQQQ,20020815 00:00,242400,249600,233800,243700,120220300,0.0003549156217274408\nSPY,20020816 00:00,928200,940800,920000,932200,35341900,0.00035496835042948084\nQQQ,20020816 00:00,241300,252700,237300,247300,96297400,0.00035496835042948084\nSPY,20020819 00:00,934600,957500,931000,955200,31944500,0.00035804684916809857\nQQQ,20020819 00:00,247700,265000,240600,254700,74446500,0.00035804684916809857\nSPY,20020820 00:00,948200,958000,936200,942700,29017300,0.000358557236064933\nQQQ,20020820 00:00,251900,254300,221800,251000,87549600,0.000358557236064933\nSPY,20020821 00:00,950600,957500,931000,955000,39314900,0.00035909315974832915\nQQQ,20020821 00:00,254000,258500,244900,257000,97853600,0.00035909315974832915\nSPY,20020822 00:00,954900,975000,950700,967600,36382900,0.0003599275210235984\nQQQ,20020822 00:00,257500,262100,244900,261000,77330400,0.0003599275210235984\nSPY,20020823 00:00,960200,961500,922500,945200,26890400,0.00036067888682680645\nQQQ,20020823 00:00,258000,264500,244900,251300,72462100,0.00036067888682680645\nSPY,20020826 00:00,949100,956400,935000,952800,31061600,0.00036043808216586714\nQQQ,20020826 00:00,253000,259500,240000,252500,83014500,0.00036043808216586714\nSPY,20020827 00:00,957000,962500,935100,939000,33956800,0.0003609908280471311\nQQQ,20020827 00:00,254300,258100,241500,242600,89840200,0.0003609908280471311\nSPY,20020828 00:00,932900,951500,918000,923000,38884800,0.00036215922933618543\nQQQ,20020828 00:00,240300,249800,233900,235000,117503400,0.00036215922933618543\nSPY,20020829 00:00,912700,930600,908100,923000,43642300,0.00036214452890336084\nQQQ,20020829 00:00,232000,250600,228500,238800,94443000,0.00036214452890336084\nSPY,20020830 00:00,916900,933900,914000,921000,28912000,0.0003576190293593805\nQQQ,20020830 00:00,236200,240100,233800,234800,57482700,0.0003576190293593805\nSPY,20020903 00:00,907400,913500,881500,882100,47441000,0.0003649795379311473\nQQQ,20020903 00:00,230600,234300,223400,223900,78187800,0.0003649795379311473\nSPY,20020904 00:00,886200,902500,880600,897500,48415200,0.0003648574982299089\nQQQ,20020904 00:00,225000,230200,215200,228600,81576600,0.0003648574982299089\nSPY,20020905 00:00,884900,894300,875000,884700,48908200,0.000366100475330222\nQQQ,20020905 00:00,224000,229700,219300,220000,84877100,0.000366100475330222\nSPY,20020906 00:00,897500,913700,893500,898600,34957300,0.00036686994342238364\nQQQ,20020906 00:00,226600,232200,225000,229000,83713000,0.00036686994342238364\nSPY,20020909 00:00,891000,920200,882700,908000,32916400,0.00036716197186653226\nQQQ,20020909 00:00,226800,233900,222100,231800,70717100,0.00036716197186653226\nSPY,20020910 00:00,911400,916100,905600,915500,36657700,0.00036758062384201906\nQQQ,20020910 00:00,232300,236700,230300,235400,70398600,0.00036758062384201906\nSPY,20020911 00:00,924700,937000,909200,915000,24306100,0.00036759490388753877\nQQQ,20020911 00:00,241200,250800,235000,235500,69184600,0.00036759490388753877\nSPY,20020912 00:00,907500,908400,889900,892600,48311100,0.0003673631567731046\nQQQ,20020912 00:00,232400,241300,227100,228000,68748300,0.0003673631567731046\nSPY,20020913 00:00,887000,899000,882500,895400,42509400,0.0003672090014815383\nQQQ,20020913 00:00,226000,239800,220800,229600,77287500,0.0003672090014815383\nSPY,20020916 00:00,893200,898300,884700,897300,24897000,0.00036681520735754784\nQQQ,20020916 00:00,228700,230100,223700,225700,55021100,0.00036681520735754784\nSPY,20020917 00:00,908900,911900,877500,879700,44418100,0.0003515560124115412\nQQQ,20020917 00:00,230500,239700,222600,223300,85846700,0.0003515560124115412\nSPY,20020918 00:00,870200,885000,861000,874900,49351800,0.0003513239903268079\nQQQ,20020918 00:00,220100,229900,210900,222400,81549700,0.0003513239903268079\nSPY,20020919 00:00,860000,868000,847800,848500,44725900,0.0003538023386945496\nQQQ,20020919 00:00,217000,221300,212000,216000,82665100,0.0003538023386945496\nSPY,20020920 00:00,849200,852000,840500,846600,43886200,0.0003494825706604444\nQQQ,20020920 00:00,218300,219000,214800,216500,74384900,0.0003494825706604444\nSPY,20020923 00:00,836500,840700,826900,835900,44616900,0.00034866596096604275\nQQQ,20020923 00:00,214500,228400,208100,209900,70595300,0.00034866596096604275\nSPY,20020924 00:00,824400,836500,818500,821500,64501200,0.00034074877840100726\nQQQ,20020924 00:00,206900,219500,206500,209800,86963400,0.00034074877840100726\nSPY,20020925 00:00,833700,847700,820400,841100,56135500,0.0003451381270435297\nQQQ,20020925 00:00,213500,220400,211000,218800,96534200,0.0003451381270435297\nSPY,20020926 00:00,850200,859800,844500,858700,52674900,0.0003443335741858094\nQQQ,20020926 00:00,221600,255900,210200,217700,102333100,0.0003443335741858094\nSPY,20020927 00:00,850000,857000,828000,828500,58450400,0.00034679017043892\nQQQ,20020927 00:00,215500,222100,211500,213600,106090000,0.00034679017043892\nSPY,20020930 00:00,820000,828000,800100,816000,69973300,0.0003466513747594014\nQQQ,20020930 00:00,210700,219600,204900,207200,89339200,0.0003466513747594014\nSPY,20021001 00:00,824400,851000,810900,850000,60049200,0.0003540463821522937\nQQQ,20021001 00:00,209100,219000,204500,216200,94488100,0.0003540463821522937\nSPY,20021002 00:00,846900,855300,825800,830500,54398600,0.00035536185569906906\nQQQ,20021002 00:00,215100,219700,206800,211600,91509600,0.00035536185569906906\nSPY,20021003 00:00,831400,848400,819500,820500,54268700,0.0003502493194454431\nQQQ,20021003 00:00,210600,219800,206800,207000,69115500,0.0003502493194454431\nSPY,20021004 00:00,828000,829200,795800,803900,65678900,0.0003517655347507925\nQQQ,20021004 00:00,209400,216500,201100,202800,78358700,0.0003517655347507925\nSPY,20021007 00:00,800700,812000,785500,788200,49064700,0.00035261429471186083\nQQQ,20021007 00:00,202600,205900,198500,199900,76567500,0.00035261429471186083\nSPY,20021008 00:00,798100,813100,782000,801100,73542900,0.0003534843050031572\nQQQ,20021008 00:00,202800,209700,197600,201600,94908000,0.0003534843050031572\nSPY,20021009 00:00,790900,798500,777800,780000,78213900,0.00035315478873943997\nQQQ,20021009 00:00,199400,209300,198400,200900,104403400,0.00035315478873943997\nSPY,20021010 00:00,779400,810700,770700,806600,72425800,0.00035533527060075055\nQQQ,20021010 00:00,201000,219100,199100,210900,106641000,0.00035533527060075055\nSPY,20021011 00:00,821000,847300,801800,839000,74412000,0.0003592081256838934\nQQQ,20021011 00:00,215500,229800,205100,221000,128397800,0.0003592081256838934\nSPY,20021014 00:00,832000,848500,830300,844700,38471500,0.0003597727337393569\nQQQ,20021014 00:00,218700,224800,209800,224200,78089800,0.0003597727337393569\nSPY,20021015 00:00,869900,897500,868600,884200,68613100,0.0003697943240388242\nQQQ,20021015 00:00,234400,235900,222100,235800,105141300,0.0003697943240388242\nSPY,20021016 00:00,874200,882600,859200,863700,57091900,0.00037260140206577224\nQQQ,20021016 00:00,227200,236000,209500,226500,86678000,0.00037260140206577224\nSPY,20021017 00:00,888700,900300,878500,881800,55143700,0.0003713118146230006\nQQQ,20021017 00:00,236000,238100,225800,234800,84511600,0.0003713118146230006\nSPY,20021018 00:00,871500,891100,869300,886500,45093200,0.00037192666869366903\nQQQ,20021018 00:00,232800,238000,226400,237800,84281700,0.00037192666869366903\nSPY,20021021 00:00,881200,905000,875700,902900,42064100,0.0003735398444906931\nQQQ,20021021 00:00,235200,244500,214200,243200,79368900,0.0003735398444906931\nSPY,20021022 00:00,890500,900100,885200,893200,38383100,0.0003723015507576115\nQQQ,20021022 00:00,237400,243400,230900,239500,84516800,0.0003723015507576115\nSPY,20021023 00:00,887700,899900,866500,899700,52322200,0.0003732290924951858\nQQQ,20021023 00:00,238500,246300,230400,245800,85971700,0.0003732290924951858\nSPY,20021024 00:00,907000,909000,881000,885800,51738000,0.000374467697712004\nQQQ,20021024 00:00,246800,248600,226300,240200,88992000,0.000374467697712004\nSPY,20021025 00:00,882200,901600,879400,900400,38908200,0.0003743265361806472\nQQQ,20021025 00:00,239900,247500,239900,247400,67082000,0.0003743265361806472\nSPY,20021028 00:00,911500,912900,888300,894200,38074900,0.0003749351370778852\nQQQ,20021028 00:00,250000,255700,239800,243400,100819700,0.0003749351370778852\nSPY,20021029 00:00,890800,899200,870000,886000,57023000,0.00037068358923734784\nQQQ,20021029 00:00,243100,244700,225000,239100,89420200,0.00037068358923734784\nSPY,20021030 00:00,886800,899600,882300,894500,38636800,0.00037008711470972204\nQQQ,20021030 00:00,240700,247900,231400,245500,103630700,0.00037008711470972204\nSPY,20021031 00:00,896600,903000,881900,888600,35755600,0.00036995958963496504\nQQQ,20021031 00:00,246600,255500,243600,245700,78279800,0.00036995958963496504\nSPY,20021101 00:00,883500,908200,880500,905300,48012400,0.00036821595969242603\nQQQ,20021101 00:00,243800,259200,238500,253000,80262900,0.00036821595969242603\nSPY,20021104 00:00,918000,929400,909000,911500,44177600,0.00036898470917580265\nQQQ,20021104 00:00,260500,268200,248200,259700,107500700,0.00036898470917580265\nSPY,20021105 00:00,908400,920700,908400,919700,30931400,0.000366986803752724\nQQQ,20021105 00:00,257100,261400,247600,261100,76438700,0.000366986803752724\nSPY,20021106 00:00,924800,930700,900400,927700,63379600,0.0003655778482981877\nQQQ,20021106 00:00,262900,265100,256400,264600,112278100,0.0003655778482981877\nSPY,20021107 00:00,920000,922200,902200,905700,45962500,0.0003688548550933966\nQQQ,20021107 00:00,259800,267800,253100,254900,79315500,0.0003688548550933966\nSPY,20021108 00:00,905300,915700,895200,898700,36903700,0.00036934748043359684\nQQQ,20021108 00:00,254900,258700,249600,251100,76464100,0.00036934748043359684\nSPY,20021111 00:00,895200,900300,878000,880500,31852200,0.0003718836690401518\nQQQ,20021111 00:00,249500,250200,241500,242500,73499000,0.0003718836690401518\nSPY,20021112 00:00,886600,899100,883600,887500,36401700,0.00037299619209001973\nQQQ,20021112 00:00,244000,259500,241300,249400,84558000,0.00037299619209001973\nSPY,20021113 00:00,883200,899000,874500,886800,60231700,0.00037006350269960884\nQQQ,20021113 00:00,247400,259200,233500,251600,113670000,0.00037006350269960884\nSPY,20021114 00:00,900700,910000,891900,908700,28761400,0.000374707108640397\nQQQ,20021114 00:00,255800,266900,246900,262900,77875600,0.000374707108640397\nSPY,20021115 00:00,900000,915500,899100,913800,33334000,0.0003748286023806635\nQQQ,20021115 00:00,259000,264500,252200,263800,65146200,0.0003748286023806635\nSPY,20021118 00:00,921500,926100,903500,905000,25907100,0.00037528089944120714\nQQQ,20021118 00:00,267200,267700,236300,260200,72857100,0.00037528089944120714\nSPY,20021119 00:00,900200,911000,897600,902300,30986600,0.0003743678405936507\nQQQ,20021119 00:00,258000,260500,253000,255000,86414500,0.0003743678405936507\nSPY,20021120 00:00,899800,920700,897400,919400,34245800,0.0003771390019679244\nQQQ,20021120 00:00,255800,266700,255200,266500,69602600,0.0003771390019679244\nSPY,20021121 00:00,926000,965800,924300,939000,54281600,0.0003810614808615221\nQQQ,20021121 00:00,269300,297000,266000,278000,104164700,0.0003810614808615221\nSPY,20021122 00:00,934800,942700,930000,936200,39499700,0.00038010826243439056\nQQQ,20021122 00:00,273700,283200,257600,277400,71339800,0.00038010826243439056\nSPY,20021125 00:00,934300,942600,927700,938000,32286500,0.0003795817606356768\nQQQ,20021125 00:00,277600,282100,275400,280600,69442600,0.0003795817606356768\nSPY,20021126 00:00,930700,934500,916200,918500,39862600,0.0003823443093861094\nQQQ,20021126 00:00,277800,279400,269000,270300,77010400,0.0003823443093861094\nSPY,20021127 00:00,925200,946500,915700,943500,33837800,0.00038410864389296225\nQQQ,20021127 00:00,275300,290900,272500,279800,70462800,0.00038410864389296225\nSPY,20021129 00:00,948000,948000,937100,939800,20285500,0.00038296115140577997\nQQQ,20021129 00:00,282100,289100,270100,277800,37214000,0.00038296115140577997\nSPY,20021202 00:00,954700,960500,932200,938900,42283000,0.00038295047490512186\nQQQ,20021202 00:00,284200,287900,270400,278500,86342100,0.00038295047490512186\nSPY,20021203 00:00,932500,934000,923500,925500,31785300,0.00038389312187194706\nQQQ,20021203 00:00,275500,291900,267500,270800,77431000,0.00038389312187194706\nSPY,20021204 00:00,918100,931400,914300,923700,63588800,0.00038139482966722496\nQQQ,20021204 00:00,265600,269500,254900,265900,120174500,0.00038139482966722496\nSPY,20021205 00:00,927000,929500,911000,911600,34786300,0.0003769503990528018\nQQQ,20021205 00:00,269500,270000,255900,261700,77947200,0.0003769503990528018\nSPY,20021206 00:00,901200,921700,899800,918100,47964000,0.00037738471457149077\nQQQ,20021206 00:00,258100,267200,256900,264800,78722300,0.00037738471457149077\nSPY,20021209 00:00,910700,914600,896200,896900,33704600,0.000380705792675544\nQQQ,20021209 00:00,262200,266500,252500,252700,73871100,0.000380705792675544\nSPY,20021210 00:00,900200,911000,897600,909200,31434700,0.00038066076139339045\nQQQ,20021210 00:00,254200,268200,245400,256600,73678300,0.00038066076139339045\nSPY,20021211 00:00,904200,916200,901600,910400,35787600,0.00038077250885981066\nQQQ,20021211 00:00,254400,260700,253200,257600,62319700,0.00038077250885981066\nSPY,20021212 00:00,912000,914900,902000,907500,33138900,0.00038068828207081593\nQQQ,20021212 00:00,260200,266900,249400,258300,61826200,0.00038068828207081593\nSPY,20021213 00:00,899100,910000,893600,895000,34552900,0.00037966594521816725\nQQQ,20021213 00:00,255200,255700,250300,250400,70483400,0.00037966594521816725\nSPY,20021216 00:00,898200,916800,896600,916800,34515200,0.0003830078460057345\nQQQ,20021216 00:00,252200,259600,250700,258700,57796400,0.0003830078460057345\nSPY,20021217 00:00,913700,917400,907400,909300,31189300,0.00038206896578455346\nQQQ,20021217 00:00,258100,262000,255600,258800,58934900,0.00038206896578455346\nSPY,20021218 00:00,903400,909000,846600,896400,33084000,0.0003829087260934408\nQQQ,20021218 00:00,255500,256000,250500,252000,63551600,0.0003829087260934408\nSPY,20021219 00:00,893500,907000,886000,890800,37939400,0.0003834157443183177\nQQQ,20021219 00:00,251700,260800,240300,250100,98159000,0.0003834157443183177\nSPY,20021220 00:00,892000,900200,891000,896900,27739500,0.00038271057449030507\nQQQ,20021220 00:00,253300,255000,250700,252300,56692000,0.00038271057449030507\nSPY,20021223 00:00,895900,906000,893100,899300,20291700,0.00038294145061121054\nQQQ,20021223 00:00,252000,257600,251300,256700,44123800,0.00038294145061121054\nSPY,20021224 00:00,896100,900000,892500,893300,11260600,0.0003831611085883542\nQQQ,20021224 00:00,255000,257300,253000,254000,16811500,0.0003831611085883542\nSPY,20021226 00:00,897700,906100,888400,890300,16532700,0.0003829281456686229\nQQQ,20021226 00:00,255300,259100,251700,252500,32835100,0.0003829281456686229\nSPY,20021227 00:00,889600,899800,875200,876800,21248800,0.0003835629154191878\nQQQ,20021227 00:00,251800,258500,247500,248200,39670200,0.0003835629154191878\nSPY,20021230 00:00,878000,884700,872200,880900,27752900,0.00038325523796733295\nQQQ,20021230 00:00,248400,249700,242600,246100,56237900,0.00038325523796733295\nSPY,20021231 00:00,879900,884300,870800,881800,29418400,0.0003821032467806493\nQQQ,20021231 00:00,245400,247100,235400,244000,43931800,0.0003821032467806493\nSPY,20030102 00:00,888500,911900,885400,911300,40792000,0.00038785602068315637\nQQQ,20030102 00:00,247200,255500,203100,255000,62930000,0.00038785602068315637\nSPY,20030103 00:00,909100,913900,896800,911300,29192500,0.00038625388812344797\nQQQ,20030103 00:00,254600,257000,252800,256300,37309100,0.00038625388812344797\nSPY,20030106 00:00,912400,937000,910900,931300,37793700,0.0003889185209055442\nQQQ,20030106 00:00,257100,266600,252000,263900,59486400,0.0003889185209055442\nSPY,20030107 00:00,929000,933700,922000,925600,37236200,0.0003884828788282322\nQQQ,20030107 00:00,264100,269300,254100,265800,87422200,0.0003884828788282322\nSPY,20030108 00:00,922000,924000,910500,912000,36077300,0.00038989557675118844\nQQQ,20030108 00:00,263900,264900,258400,259100,71480100,0.00038989557675118844\nSPY,20030109 00:00,918200,931800,910900,930000,31914000,0.0003924491465392595\nQQQ,20030109 00:00,262400,269800,259300,267300,72158200,0.0003924491465392595\nSPY,20030110 00:00,919500,936400,918000,929700,39609900,0.0003924174741930708\nQQQ,20030110 00:00,263500,279600,262200,270500,79339000,0.0003924174741930708\nSPY,20030113 00:00,935500,938600,924400,928800,29576600,0.0003919367965554519\nQQQ,20030113 00:00,273300,274700,263000,269000,68663100,0.0003919367965554519\nSPY,20030114 00:00,926900,938300,922000,934400,21777100,0.0003919011557520361\nQQQ,20030114 00:00,269100,277300,268500,271900,40962000,0.0003919011557520361\nSPY,20030115 00:00,935400,935700,915100,921200,32379000,0.00039261555147304385\nQQQ,20030115 00:00,272400,277700,265800,266900,52539700,0.00039261555147304385\nSPY,20030116 00:00,925000,933300,914600,918300,40043700,0.00039080765131870206\nQQQ,20030116 00:00,267700,269800,256300,263900,61663400,0.00039080765131870206\nSPY,20030117 00:00,909900,923000,901500,904800,34847000,0.00039178652369020164\nQQQ,20030117 00:00,259000,267000,244500,253500,74862300,0.00039178652369020164\nSPY,20030121 00:00,908700,909200,878800,890300,37621400,0.00039123914794424343\nQQQ,20030121 00:00,254000,263400,251000,251100,63857100,0.00039123914794424343\nSPY,20030122 00:00,887700,900000,880100,880400,40523500,0.00039051285923985123\nQQQ,20030122 00:00,249700,255400,240600,250600,79003600,0.00039051285923985123\nSPY,20030123 00:00,887500,894300,879500,890600,42524800,0.0003906517820499456\nQQQ,20030123 00:00,254000,258400,251100,256600,73375400,0.0003906517820499456\nSPY,20030124 00:00,885900,887600,861700,863300,61025800,0.0003944317860108485\nQQQ,20030124 00:00,255300,255300,246400,247600,71254900,0.0003944317860108485\nSPY,20030127 00:00,857000,869400,845000,850300,57425600,0.0003948409420214828\nQQQ,20030127 00:00,244500,250300,237000,245500,72478300,0.0003948409420214828\nSPY,20030128 00:00,856900,878500,846500,861200,44568500,0.0003955642017746573\nQQQ,20030128 00:00,247700,250500,244200,248500,61389300,0.0003955642017746573\nSPY,20030129 00:00,854500,871800,847700,867800,48968100,0.0003931906672574871\nQQQ,20030129 00:00,247600,254500,243400,253000,92756700,0.0003931906672574871\nSPY,20030130 00:00,867900,868800,846300,848000,46355700,0.0003951627308095727\nQQQ,20030130 00:00,253200,254200,244500,245100,67206600,0.0003951627308095727\nSPY,20030131 00:00,841500,862200,841500,858400,50426300,0.00039448109858541107\nQQQ,20030131 00:00,240700,251300,240100,244100,86037100,0.00039448109858541107\nSPY,20030203 00:00,861000,886900,858900,862700,37270000,0.0003943951893080431\nQQQ,20030203 00:00,245300,248000,243800,245100,47509700,0.0003943951893080431\nSPY,20030204 00:00,853100,854400,843000,851400,39714400,0.0003918402179680441\nQQQ,20030204 00:00,241800,242900,238200,241400,58999700,0.0003918402179680441\nSPY,20030205 00:00,857500,865400,844200,846400,51490200,0.0003917556735817682\nQQQ,20030205 00:00,243300,257400,240100,240900,79135200,0.0003917556735817682\nSPY,20030206 00:00,843900,852200,836500,841700,52470600,0.0003915080270179315\nQQQ,20030206 00:00,240200,251900,211500,241500,108671100,0.0003915080270179315\nSPY,20030207 00:00,849100,849900,829700,832900,40984200,0.0003918757628338784\nQQQ,20030207 00:00,243600,249800,236500,237800,71679500,0.0003918757628338784\nSPY,20030210 00:00,834700,841300,826500,839400,43562000,0.00039078376739308274\nQQQ,20030210 00:00,239000,249900,236200,241300,66776400,0.00039078376739308274\nSPY,20030211 00:00,843700,848800,828300,832100,45084300,0.0003894927045175183\nQQQ,20030211 00:00,242500,246100,211400,241100,72796800,0.0003894927045175183\nSPY,20030212 00:00,831600,836200,822200,822200,35247100,0.00038986277614301513\nQQQ,20030212 00:00,240700,244100,238000,238300,53702200,0.00038986277614301513\nSPY,20030213 00:00,821500,829500,810000,821000,47069400,0.000389284450357152\nQQQ,20030213 00:00,238500,245900,233200,236700,69510700,0.000389284450357152\nSPY,20030214 00:00,823700,839100,818300,838800,57097600,0.000392176498089178\nQQQ,20030214 00:00,238300,244000,236200,244000,65201400,0.000392176498089178\nSPY,20030218 00:00,845300,857700,844900,855500,36249100,0.0003941612164286122\nQQQ,20030218 00:00,247000,252300,242500,252300,71444500,0.0003941612164286122\nSPY,20030219 00:00,853200,854700,839000,849300,29998000,0.0003919739068489996\nQQQ,20030219 00:00,252000,252400,247100,250200,42341000,0.0003919739068489996\nSPY,20030220 00:00,852200,854200,805000,840900,27850500,0.00039115202968278436\nQQQ,20030220 00:00,251500,252700,248400,248700,57530900,0.00039115202968278436\nSPY,20030221 00:00,843800,857400,834600,853400,63271800,0.00038973047684974423\nQQQ,20030221 00:00,249300,253700,245100,252500,66980700,0.00038973047684974423\nSPY,20030224 00:00,849300,855100,835900,836300,29643900,0.0003910313575686969\nQQQ,20030224 00:00,251300,259000,247100,247400,53999000,0.0003910313575686969\nSPY,20030225 00:00,829500,844900,822200,843200,53471300,0.0003881244802583635\nQQQ,20030225 00:00,244500,254500,240800,248400,70866400,0.0003881244802583635\nSPY,20030226 00:00,840200,845300,830800,831900,37153800,0.00038926353456892205\nQQQ,20030226 00:00,246800,249400,242000,242400,56822500,0.00038926353456892205\nSPY,20030227 00:00,837000,855000,829900,841700,48562900,0.00039054238590318085\nQQQ,20030227 00:00,244200,249200,242700,247500,63839900,0.00039054238590318085\nSPY,20030228 00:00,844700,852300,834500,846200,41091800,0.0003908094960380612\nQQQ,20030228 00:00,248100,252200,240200,251100,49281500,0.0003908094960380612\nSPY,20030303 00:00,852600,857800,837200,839300,41103000,0.0003861571099185432\nQQQ,20030303 00:00,252500,254800,245600,246500,59576800,0.0003861571099185432\nSPY,20030304 00:00,839500,840100,826500,827300,29689500,0.0003829296618981585\nQQQ,20030304 00:00,246600,255300,242600,244500,58553200,0.0003829296618981585\nSPY,20030305 00:00,826100,835400,823600,835000,41109200,0.00038345203269732456\nQQQ,20030305 00:00,244000,247800,243200,246800,65213900,0.00038345203269732456\nSPY,20030306 00:00,828600,835200,824700,827000,40633100,0.0003827868233546101\nQQQ,20030306 00:00,244400,246800,242300,244600,53137500,0.0003827868233546101\nSPY,20030307 00:00,816400,840700,814300,833700,61733800,0.0003829343260545618\nQQQ,20030307 00:00,240700,246900,233500,245700,70092600,0.0003829343260545618\nSPY,20030310 00:00,826300,828600,811000,812300,38552200,0.0003843552996194064\nQQQ,20030310 00:00,243500,244600,239100,239800,53167500,0.0003843552996194064\nSPY,20030311 00:00,814900,820800,805200,805500,47065100,0.00038446599892281714\nQQQ,20030311 00:00,240500,242400,237800,238200,52508000,0.00038446599892281714\nSPY,20030312 00:00,804100,810100,793800,809700,65050000,0.0003848172624209722\nQQQ,20030312 00:00,237600,241800,235400,241600,73786900,0.0003848172624209722\nSPY,20030313 00:00,821900,838300,815300,837800,68351300,0.0003927488284857059\nQQQ,20030313 00:00,246600,256300,241000,255800,117076000,0.0003927488284857059\nSPY,20030314 00:00,841900,847700,833500,839000,62069400,0.00039278669869369134\nQQQ,20030314 00:00,257300,266400,243000,256100,88905300,0.00039278669869369134\nSPY,20030317 00:00,834600,869500,832200,868300,79922400,0.0003990031075019888\nQQQ,20030317 00:00,254500,267800,244800,267600,137851800,0.0003990031075019888\nSPY,20030318 00:00,871500,873200,861000,871900,48600400,0.00039906226689602296\nQQQ,20030318 00:00,267900,269000,256300,268500,93588900,0.00039906226689602296\nSPY,20030319 00:00,873100,881600,866800,879900,46060100,0.0003988991918052405\nQQQ,20030319 00:00,268400,270800,255400,267100,85549100,0.0003988991918052405\nSPY,20030320 00:00,873200,885900,863500,881300,66050700,0.0003969122545092853\nQQQ,20030320 00:00,265400,271400,261700,268300,89296900,0.0003969122545092853\nSPY,20030321 00:00,887900,898800,877900,897400,65617700,0.000397664270541007\nQQQ,20030321 00:00,272200,273800,253500,271600,92263600,0.000397664270541007\nSPY,20030324 00:00,879900,881400,855800,865800,66185400,0.000403055474932855\nQQQ,20030324 00:00,264700,266000,259700,260300,82734600,0.000403055474932855\nSPY,20030325 00:00,867400,886700,855900,876700,59039700,0.000402575887202451\nQQQ,20030325 00:00,261600,274700,260100,265100,90591500,0.000402575887202451\nSPY,20030326 00:00,875600,878500,862300,872000,44220500,0.0004023132955776504\nQQQ,20030326 00:00,264900,267700,255600,265700,65788800,0.0004023132955776504\nSPY,20030327 00:00,864300,885000,859900,871000,51967900,0.00040232519399809535\nQQQ,20030327 00:00,262600,266500,261000,263800,64262200,0.00040232519399809535\nSPY,20030328 00:00,864700,872800,862500,865900,31216600,0.0004024225964373263\nQQQ,20030328 00:00,261500,264300,259500,260300,43106700,0.0004024225964373263\nSPY,20030331 00:00,853500,869600,844000,849800,55166100,0.0004042373031666141\nQQQ,20030331 00:00,255800,273600,243100,253200,83742300,0.0004042373031666141\nSPY,20030401 00:00,852600,868500,849100,860700,52487500,0.0004033330206213587\nQQQ,20030401 00:00,254500,256700,252500,254300,68171400,0.0004033330206213587\nSPY,20030402 00:00,875600,887700,870500,883900,45771800,0.00040741905927295705\nQQQ,20030402 00:00,260500,265600,254300,264400,72604600,0.00040741905927295705\nSPY,20030403 00:00,888400,889900,878000,878800,46588000,0.00040738328127520293\nQQQ,20030403 00:00,266400,268500,254900,264400,65951500,0.00040738328127520293\nSPY,20030404 00:00,884300,885900,875700,881200,34027100,0.0004071073798002859\nQQQ,20030404 00:00,265700,266000,259700,261200,62935800,0.0004071073798002859\nSPY,20030407 00:00,903400,909200,881900,882000,65803200,0.00040698029602564577\nQQQ,20030407 00:00,271200,279800,261800,262100,80657200,0.00040698029602564577\nSPY,20030408 00:00,883000,888900,862000,881100,37497500,0.0004061934366448234\nQQQ,20030408 00:00,261500,262900,258800,260100,54447300,0.0004061934366448234\nSPY,20030409 00:00,883600,898100,867700,868600,54266200,0.0004066343224788356\nQQQ,20030409 00:00,261000,267100,235900,254600,73818600,0.0004066343224788356\nSPY,20030410 00:00,870700,889000,857100,874500,36457100,0.00040460557782820964\nQQQ,20030410 00:00,254700,257700,244200,256900,53669700,0.00040460557782820964\nSPY,20030411 00:00,881900,887100,868600,871700,44797600,0.0004041678809510692\nQQQ,20030411 00:00,260300,265200,253600,255100,65478200,0.0004041678809510692\nSPY,20030414 00:00,874700,888700,864600,888500,33088500,0.0004060299737555884\nQQQ,20030414 00:00,255800,261400,254900,260500,49686300,0.0004060299737555884\nSPY,20030415 00:00,888600,894700,883900,894200,41537300,0.000402398515356298\nQQQ,20030415 00:00,259700,263500,252700,262100,54077000,0.000402398515356298\nSPY,20030416 00:00,899100,900700,880300,882300,49914000,0.00040236107034436093\nQQQ,20030416 00:00,266500,268300,254600,262100,68950400,0.00040236107034436093\nSPY,20030417 00:00,883500,897200,872900,896600,35530800,0.00040418561547337414\nQQQ,20030417 00:00,261600,269800,261500,269100,67251600,0.00040418561547337414\nSPY,20030421 00:00,898600,901600,890600,895000,30947000,0.00040423164067659035\nQQQ,20030421 00:00,269500,271100,266000,268800,51163300,0.00040423164067659035\nSPY,20030422 00:00,891000,915600,888900,915100,55045400,0.00040453050289069204\nQQQ,20030422 00:00,267400,274600,266500,274000,66685300,0.00040453050289069204\nSPY,20030423 00:00,916000,931100,912400,922000,42098700,0.0004043303606279689\nQQQ,20030423 00:00,275000,278000,272600,276500,66712100,0.0004043303606279689\nSPY,20030424 00:00,915300,920800,901800,914200,48770700,0.000404063420665157\nQQQ,20030424 00:00,273600,277500,244700,275600,71731200,0.000404063420665157\nSPY,20030425 00:00,913000,914700,900200,901500,42082300,0.00040523906072467285\nQQQ,20030425 00:00,273200,274500,268600,269400,63228300,0.00040523906072467285\nSPY,20030428 00:00,904400,921900,901700,918700,44105500,0.00040499778704160364\nQQQ,20030428 00:00,270500,276300,269500,275200,57086100,0.00040499778704160364\nSPY,20030429 00:00,921400,936600,914000,921500,47893600,0.00040494741096687914\nQQQ,20030429 00:00,276500,282000,274100,277500,74657300,0.00040494741096687914\nSPY,20030430 00:00,919300,925700,913200,918500,43007600,0.0004040643648847619\nQQQ,20030430 00:00,276600,277900,274300,274700,58553700,0.0004040643648847619\nSPY,20030501 00:00,919200,927300,905000,919200,47446800,0.00040434828766379335\nQQQ,20030501 00:00,274400,278700,271900,276800,64591500,0.00040434828766379335\nSPY,20030502 00:00,915600,934700,909000,933000,46777300,0.0004055152361696319\nQQQ,20030502 00:00,276100,289600,271400,282700,83785100,0.0004055152361696319\nSPY,20030505 00:00,934700,939700,920500,929500,34390100,0.0004043556948873192\nQQQ,20030505 00:00,283300,287100,281700,282400,79783100,0.0004043556948873192\nSPY,20030506 00:00,931000,944200,920500,937900,42445700,0.000402993737444952\nQQQ,20030506 00:00,282200,295300,280800,286300,73696900,0.000402993737444952\nSPY,20030507 00:00,934200,941400,924000,933300,39303700,0.00040318570459739456\nQQQ,20030507 00:00,284100,286900,281200,282800,69065700,0.00040318570459739456\nSPY,20030508 00:00,925200,933800,922100,923400,39041600,0.0003881064435241054\nQQQ,20030508 00:00,278600,281900,270900,278100,78385700,0.0003881064435241054\nSPY,20030509 00:00,928300,938000,922000,937200,32040000,0.00038782245833746956\nQQQ,20030509 00:00,280400,284800,273800,284100,57497000,0.00038782245833746956\nSPY,20030512 00:00,935000,963000,922400,949000,33488000,0.00038618495854912167\nQQQ,20030512 00:00,283600,289600,258500,288500,66583800,0.00038618495854912167\nSPY,20030513 00:00,945300,959700,916000,946400,36510100,0.00038333674228164014\nQQQ,20030513 00:00,286300,289900,285400,287200,62044000,0.00038333674228164014\nSPY,20030514 00:00,951000,952400,922400,943600,31475800,0.00037887742279730873\nQQQ,20030514 00:00,288700,289700,283600,285300,59402700,0.00037887742279730873\nSPY,20030515 00:00,948900,953300,942500,951300,43037600,0.00037941528753089154\nQQQ,20030515 00:00,287500,297200,285600,289100,56876800,0.00037941528753089154\nSPY,20030516 00:00,948900,954500,940500,948600,35295200,0.00037937651242139824\nQQQ,20030516 00:00,287200,289400,283500,286600,67115800,0.00037937651242139824\nSPY,20030519 00:00,942000,949200,920800,925100,43984300,0.0003823492425504943\nQQQ,20030519 00:00,285200,286800,276100,277000,90054700,0.0003823492425504943\nSPY,20030520 00:00,928200,942100,916000,924500,52587100,0.0003810965581971463\nQQQ,20030520 00:00,277600,279600,266100,276800,66025400,0.0003810965581971463\nSPY,20030521 00:00,921100,929200,919100,927800,43595100,0.0003800416969360558\nQQQ,20030521 00:00,276500,285100,274400,277100,62584100,0.0003800416969360558\nSPY,20030522 00:00,929500,940500,921400,936800,37055000,0.0003805492053074693\nQQQ,20030522 00:00,277600,283200,231400,281300,60491200,0.0003805492053074693\nSPY,20030523 00:00,935300,953600,928600,937200,25718600,0.0003797123948783295\nQQQ,20030523 00:00,280500,282500,271500,280800,37486800,0.0003797123948783295\nSPY,20030527 00:00,933000,958400,931800,956200,40479600,0.00038165680379198796\nQQQ,20030527 00:00,279300,292200,278900,291400,101068600,0.00038165680379198796\nSPY,20030528 00:00,958500,977300,949800,958300,35069300,0.00038139454253805296\nQQQ,20030528 00:00,291800,294000,282200,291600,75175800,0.00038139454253805296\nSPY,20030529 00:00,958800,968200,923200,953700,49556400,0.00038083275269570866\nQQQ,20030529 00:00,292300,298000,291000,293100,95698200,0.00038083275269570866\nSPY,20030530 00:00,959000,970900,951700,969300,46174600,0.00038185130252852805\nQQQ,20030530 00:00,295300,298700,290700,297400,76031300,0.00038185130252852805\nSPY,20030602 00:00,975300,988400,960800,971700,47403200,0.0003818921464343134\nQQQ,20030602 00:00,300800,305000,290000,294500,99416800,0.0003818921464343134\nSPY,20030603 00:00,971500,979000,968500,977100,31344400,0.0003777582189801951\nQQQ,20030603 00:00,294500,298400,286600,298300,75594300,0.0003777582189801951\nSPY,20030604 00:00,976600,993500,947200,991400,46824600,0.00037877994345158876\nQQQ,20030604 00:00,298100,305800,297200,304000,83244900,0.00037877994345158876\nSPY,20030605 00:00,985800,995900,981400,995600,42870100,0.00037838095022224956\nQQQ,20030605 00:00,301300,306500,299700,306100,84153500,0.00037838095022224956\nSPY,20030606 00:00,1004400,1014000,991300,992200,55486600,0.0003762550783602896\nQQQ,20030606 00:00,311700,314700,300700,301000,133737800,0.0003762550783602896\nSPY,20030609 00:00,987800,999200,977700,981100,36095100,0.0003767233284583309\nQQQ,20030609 00:00,300000,302200,295300,297300,94536600,0.0003767233284583309\nSPY,20030610 00:00,984600,998300,977200,990400,27750200,0.000377325422283466\nQQQ,20030610 00:00,298500,301800,296800,301800,63484600,0.000377325422283466\nSPY,20030611 00:00,991600,1011900,982800,1003300,35323300,0.000375899847021967\nQQQ,20030611 00:00,300700,328600,291700,305200,85915300,0.000375899847021967\nSPY,20030612 00:00,1007500,1014000,996200,1005200,34887000,0.000375384320656353\nQQQ,20030612 00:00,306200,313900,302600,305600,77631200,0.000375384320656353\nSPY,20030613 00:00,1006000,1007500,989500,994400,43904700,0.0003756374145101039\nQQQ,20030613 00:00,306600,307300,298600,299500,82269400,0.0003756374145101039\nSPY,20030616 00:00,999600,1016600,998000,1016600,34397800,0.00037816423283439327\nQQQ,20030616 00:00,301700,308400,300000,308200,68028500,0.00037816423283439327\nSPY,20030617 00:00,1020500,1021800,1007300,1016800,34970300,0.00037420603756938703\nQQQ,20030617 00:00,310100,311100,305600,307900,66045300,0.00037420603756938703\nSPY,20030618 00:00,1012900,1021400,1010000,1015400,33837000,0.00037418462518328395\nQQQ,20030618 00:00,306600,312300,285000,310200,77165700,0.00037418462518328395\nSPY,20030619 00:00,1016400,1017300,998400,1000200,41701500,0.0003728995207251243\nQQQ,20030619 00:00,309800,312400,303800,304800,77195000,0.0003728995207251243\nSPY,20030620 00:00,1003900,1005000,995000,997500,36384800,0.000371306314649186\nQQQ,20030620 00:00,306900,315000,302500,304000,73708600,0.000371306314649186\nSPY,20030623 00:00,994500,996600,979200,983600,33254600,0.0003703367894289987\nQQQ,20030623 00:00,303300,303700,290800,297900,83259300,0.0003703367894289987\nSPY,20030624 00:00,982200,990900,980200,986500,35363600,0.00036989416940581897\nQQQ,20030624 00:00,297300,303000,295300,297100,80621500,0.00036989416940581897\nSPY,20030625 00:00,985300,995900,976700,978000,43741400,0.0003675871672833677\nQQQ,20030625 00:00,296700,330500,294700,296000,91645200,0.0003675871672833677\nSPY,20030626 00:00,977800,990000,969600,988900,30562500,0.0003684847708011173\nQQQ,20030626 00:00,297100,302800,296100,302100,76949300,0.0003684847708011173\nSPY,20030627 00:00,987500,991900,976600,978600,49177600,0.0003673703951574909\nQQQ,20030627 00:00,302500,305700,297700,299600,80921800,0.0003673703951574909\nSPY,20030630 00:00,982200,989300,967200,976900,29156600,0.00036740644432818923\nQQQ,20030630 00:00,301600,303400,298000,298600,68284200,0.00036740644432818923\nSPY,20030701 00:00,972500,988500,964300,985600,48168800,0.00036343553589901186\nQQQ,20030701 00:00,297000,303300,292600,302900,91627200,0.00036343553589901186\nSPY,20030702 00:00,987700,996800,985700,996300,32277800,0.00036113792509638836\nQQQ,20030702 00:00,304100,336100,303800,309000,79805700,0.00036113792509638836\nSPY,20030703 00:00,990700,998500,979000,988000,31558400,0.0003607932216159405\nQQQ,20030703 00:00,307000,318400,300700,305300,50131300,0.0003607932216159405\nSPY,20030707 00:00,996500,1009000,996100,1007500,26522100,0.0003543546025967162\nQQQ,20030707 00:00,309700,318800,302500,318400,85553900,0.0003543546025967162\nSPY,20030708 00:00,1005000,1012900,1001700,1010200,26654100,0.0003522483872691428\nQQQ,20030708 00:00,317800,323100,316200,322600,79946000,0.0003522483872691428\nSPY,20030709 00:00,1009200,1014000,1000300,1005500,32218300,0.00034995405926958965\nQQQ,20030709 00:00,321700,327800,312000,321700,81128700,0.00034995405926958965\nSPY,20030710 00:00,998400,1007700,986300,992100,49644400,0.00034672130738899737\nQQQ,20030710 00:00,318400,323000,313300,315700,98458300,0.00034672130738899737\nSPY,20030711 00:00,993900,1004500,993900,1001400,32413800,0.00034576836294800015\nQQQ,20030711 00:00,316500,319900,316100,318400,66236400,0.00034576836294800015\nSPY,20030714 00:00,1012000,1019000,996100,1007200,40162200,0.0003460183525203038\nQQQ,20030714 00:00,323400,327500,320700,322200,82207300,0.0003460183525203038\nSPY,20030715 00:00,1013800,1019100,999500,1003800,38640700,0.0003464320755523521\nQQQ,20030715 00:00,325300,326500,311500,321700,69431300,0.0003464320755523521\nSPY,20030716 00:00,1008100,1008700,977600,997600,36831600,0.00034576698135619125\nQQQ,20030716 00:00,324600,329900,310900,321400,75587900,0.00034576698135619125\nSPY,20030717 00:00,991500,999800,981600,985100,46981700,0.00034709621532257333\nQQQ,20030717 00:00,316800,318400,310400,312100,100236000,0.00034709621532257333\nSPY,20030718 00:00,990200,999800,984600,995800,33310400,0.00034344809034806453\nQQQ,20030718 00:00,314000,333400,309200,313000,75330500,0.00034344809034806453\nSPY,20030721 00:00,994500,994900,978500,982400,32513000,0.0003390687381441577\nQQQ,20030721 00:00,312600,318600,306100,308300,131325500,0.0003390687381441577\nSPY,20030722 00:00,986900,999100,979100,991200,47511800,0.0003361392866647642\nQQQ,20030722 00:00,311100,315000,308600,313100,88362500,0.0003361392866647642\nSPY,20030723 00:00,992100,998300,982800,992300,36864600,0.0003308083217441353\nQQQ,20030723 00:00,313800,316200,309900,315200,64567900,0.0003308083217441353\nSPY,20030724 00:00,999900,1003400,983700,985000,37033900,0.00031769649354555253\nQQQ,20030724 00:00,318600,320200,310800,311300,76500400,0.00031769649354555253\nSPY,20030725 00:00,986600,1002900,980400,1002300,39276800,0.00031721447373878243\nQQQ,20030725 00:00,311300,317800,307700,317700,78832100,0.00031721447373878243\nSPY,20030728 00:00,1003700,1009800,996700,1000400,33516100,0.0003160859126472326\nQQQ,20030728 00:00,318600,319900,316000,318500,56717300,0.0003160859126472326\nSPY,20030729 00:00,1001400,1003000,986800,993200,52108100,0.00030355565477574784\nQQQ,20030729 00:00,319300,327100,312300,316600,78070000,0.00030355565477574784\nSPY,20030730 00:00,996000,997900,989300,991100,27288900,0.0003034243252501384\nQQQ,20030730 00:00,317000,317400,313300,314100,55694000,0.0003034243252501384\nSPY,20030731 00:00,999800,1009400,989000,994100,51122000,0.0003040943449486913\nQQQ,20030731 00:00,318000,323300,312600,317000,82437900,0.0003040943449486913\nSPY,20030801 00:00,991900,996800,982400,983800,47944800,0.0002982683226033027\nQQQ,20030801 00:00,316900,319200,313000,314900,70790300,0.0002982683226033027\nSPY,20030804 00:00,983100,997100,970000,987200,54147600,0.00029610271604143184\nQQQ,20030804 00:00,314100,319800,308400,315100,93816600,0.00029610271604143184\nSPY,20030805 00:00,984100,988500,968400,968500,51537800,0.00029300320407855366\nQQQ,20030805 00:00,314100,317200,300500,305500,91471700,0.00029300320407855366\nSPY,20030806 00:00,967100,980600,964200,971000,48456400,0.00028632256170231356\nQQQ,20030806 00:00,303600,315100,300000,302100,93193400,0.00028632256170231356\nSPY,20030807 00:00,971700,979800,966700,978800,40462700,0.00028524638563150987\nQQQ,20030807 00:00,302200,312200,300200,302900,66734200,0.00028524638563150987\nSPY,20030808 00:00,983200,985500,977600,982200,25756900,0.0002816029803964407\nQQQ,20030808 00:00,304300,305500,289900,300600,64610600,0.0002816029803964407\nSPY,20030811 00:00,982600,996900,978400,985100,36860500,0.0002818174605002397\nQQQ,20030811 00:00,300800,306000,300300,304000,63342200,0.0002818174605002397\nSPY,20030812 00:00,987100,995600,984200,995400,29867800,0.0002823798035286035\nQQQ,20030812 00:00,305100,308900,300400,308600,55531500,0.0002823798035286035\nSPY,20030813 00:00,998200,998500,985300,988900,34206500,0.00027958982469522054\nQQQ,20030813 00:00,309800,310700,306500,308200,56769800,0.00027958982469522054\nSPY,20030814 00:00,991000,997500,985100,995400,30134100,0.00026953413070752785\nQQQ,20030814 00:00,308800,311900,306700,311400,42839000,0.00026953413070752785\nSPY,20030815 00:00,993600,997900,991200,995400,11731800,0.0002690547602052737\nQQQ,20030815 00:00,310000,313300,309300,311500,26323200,0.0002690547602052737\nSPY,20030818 00:00,999300,1007800,997400,1005000,21228600,0.0002700710387077123\nQQQ,20030818 00:00,313000,319600,310500,319400,63737300,0.0002700710387077123\nSPY,20030819 00:00,1006900,1009400,996000,1008200,36117200,0.00026742271094424815\nQQQ,20030819 00:00,321000,323700,318500,323600,63208400,0.00026742271094424815\nSPY,20030820 00:00,1002900,1008900,1001600,1005000,19140800,0.0002666379784310549\nQQQ,20030820 00:00,320900,343400,320200,322700,56847400,0.0002666379784310549\nSPY,20030821 00:00,1010500,1044500,1002000,1009100,44924100,0.0002656593266667366\nQQQ,20030821 00:00,325900,328200,321000,326800,75593700,0.0002656593266667366\nSPY,20030822 00:00,1017500,1020000,997400,997700,49593900,0.0002652634798645208\nQQQ,20030822 00:00,332700,333700,323300,324700,90054000,0.0002652634798645208\nSPY,20030825 00:00,997300,1016300,992800,998200,22212200,0.00026168711160165996\nQQQ,20030825 00:00,323600,333100,320000,324600,41284000,0.00026168711160165996\nSPY,20030826 00:00,995000,1004600,988300,1001800,43123200,0.00026158172312380627\nQQQ,20030826 00:00,322800,325900,318100,325100,78153300,0.00026158172312380627\nSPY,20030827 00:00,1000500,1003600,995700,1002400,17611500,0.00025919916599820384\nQQQ,20030827 00:00,324900,337100,323700,328100,46132500,0.00025919916599820384\nSPY,20030828 00:00,1004000,1010000,996600,1008500,25828500,0.0002570785483328983\nQQQ,20030828 00:00,329400,331100,316200,330900,53470300,0.0002570785483328983\nSPY,20030829 00:00,1006100,1014600,1000000,1014000,23586600,0.00025720709942409197\nQQQ,20030829 00:00,330400,334600,322600,333100,49200100,0.00025720709942409197\nSPY,20030902 00:00,1016400,1028800,1002800,1027700,46298000,0.00025773870237645044\nQQQ,20030902 00:00,334900,338600,304800,338300,77991800,0.00025773870237645044\nSPY,20030903 00:00,1030300,1037000,1012500,1031900,40191200,0.0002494736128419842\nQQQ,20030903 00:00,341000,342000,336500,337900,80100500,0.0002494736128419842\nSPY,20030904 00:00,1031000,1035500,1004300,1034300,26062300,0.00024824970956314183\nQQQ,20030904 00:00,338300,342200,337000,341500,59976700,0.00024824970956314183\nSPY,20030905 00:00,1029400,1205200,1015300,1026700,29648500,0.00024623173661092684\nQQQ,20030905 00:00,339600,343400,327900,338600,88478700,0.00024623173661092684\nSPY,20030908 00:00,1030400,1038800,1027300,1038000,32461700,0.0002445454444664898\nQQQ,20030908 00:00,340000,345100,338600,344600,68858600,0.0002445454444664898\nSPY,20030909 00:00,1033700,1034600,1026800,1029300,34210600,0.0002446262190677178\nQQQ,20030909 00:00,343200,344700,339200,340500,80989900,0.0002446262190677178\nSPY,20030910 00:00,1025400,1036000,1015500,1016900,42588100,0.00024566713350138\nQQQ,20030910 00:00,337500,345500,331100,331100,108812900,0.00024566713350138\nSPY,20030911 00:00,1021000,1028500,1014200,1022500,34663300,0.00024590082171948826\nQQQ,20030911 00:00,332800,337800,293100,335600,92848200,0.00024590082171948826\nSPY,20030912 00:00,1019100,1026400,1004600,1025200,40924400,0.0002425829560422213\nQQQ,20030912 00:00,333400,338000,322100,337400,102369500,0.0002425829560422213\nSPY,20030915 00:00,1025200,1026300,1010800,1021200,20062100,0.00024269480537034762\nQQQ,20030915 00:00,338500,339100,334400,334900,50427200,0.00024269480537034762\nSPY,20030916 00:00,1022300,1036400,1021700,1035500,35237000,0.00024406244796047868\nQQQ,20030916 00:00,335400,344300,330000,343400,79812200,0.00024406244796047868\nSPY,20030917 00:00,1034800,1037900,1025800,1032200,30704300,0.00024315639172319692\nQQQ,20030917 00:00,343100,345000,333300,341700,76836800,0.00024315639172319692\nSPY,20030918 00:00,1034000,1055000,1031700,1045900,29197800,0.00024380258719886112\nQQQ,20030918 00:00,341700,348600,334400,347800,88501800,0.00024380258719886112\nSPY,20030919 00:00,1042700,1046000,1034000,1038600,24909700,0.00024022119244484642\nQQQ,20030919 00:00,348000,348600,343600,346000,67567000,0.00024022119244484642\nSPY,20030922 00:00,1028500,1038700,1002900,1024900,33784400,0.00024139055637629155\nQQQ,20030922 00:00,341200,342000,337700,339500,93800100,0.00024139055637629155\nSPY,20030923 00:00,1025900,1032900,1023600,1030900,29146200,0.0002398984044051806\nQQQ,20030923 00:00,339800,345600,339100,344700,72929000,0.0002398984044051806\nSPY,20030924 00:00,1031200,1032200,1010700,1012000,39700500,0.00024234370712742024\nQQQ,20030924 00:00,345000,345200,332600,333600,106822400,0.00024234370712742024\nSPY,20030925 00:00,1014100,1018800,1002700,1005900,47503000,0.0002389549280967118\nQQQ,20030925 00:00,333900,339800,329600,329800,107048600,0.0002389549280967118\nSPY,20030926 00:00,1004400,1006600,998400,1000200,39894100,0.00023985220295227367\nQQQ,20030926 00:00,328900,339300,318100,325900,104092400,0.00023985220295227367\nSPY,20030929 00:00,1003000,1009900,987500,1008700,34534700,0.00023732184426945155\nQQQ,20030929 00:00,327600,347300,322900,331100,91294800,0.00023732184426945155\nSPY,20030930 00:00,1005300,1007600,959100,998600,66541600,0.00023625459838679883\nQQQ,20030930 00:00,329200,329600,323600,324400,115751500,0.00023625459838679883\nSPY,20031001 00:00,1002400,1021200,1000100,1020000,61422900,0.00023109001421914267\nQQQ,20031001 00:00,326100,332300,320100,331300,104783200,0.00023109001421914267\nSPY,20031002 00:00,1019300,1028500,1016300,1023200,42650800,0.00022889429954823712\nQQQ,20031002 00:00,331000,343500,322000,332100,81978200,0.00022889429954823712\nSPY,20031003 00:00,1036700,1042800,1023200,1032600,44559600,0.000228531629083675\nQQQ,20031003 00:00,338600,349600,338200,341600,107858100,0.000228531629083675\nSPY,20031006 00:00,1034800,1039900,1032000,1037200,21426800,0.000226664638636132\nQQQ,20031006 00:00,342800,344100,333000,343400,47134200,0.000226664638636132\nSPY,20031007 00:00,1032600,1042600,1029100,1041900,39712400,0.0002253554557960018\nQQQ,20031007 00:00,341600,346100,340100,345700,75347600,0.0002253554557960018\nSPY,20031008 00:00,1043300,1043900,1026000,1037100,37406500,0.00022513409456040526\nQQQ,20031008 00:00,348100,348400,341900,344200,67981200,0.00022513409456040526\nSPY,20031009 00:00,1048800,1052200,1036500,1041700,43192200,0.00022455178979908694\nQQQ,20031009 00:00,349200,352700,344300,346400,115553800,0.00022455178979908694\nSPY,20031010 00:00,1042700,1044800,1039100,1042000,20895700,0.00021829499877339185\nQQQ,20031010 00:00,347700,349700,346400,349300,63783500,0.00021829499877339185\nSPY,20031013 00:00,1047200,1052900,1017000,1048600,22789900,0.0002112430142483876\nQQQ,20031013 00:00,351400,362500,341500,351500,58393900,0.0002112430142483876\nSPY,20031014 00:00,1048000,1053600,1036700,1052900,34600000,0.0002109846848233844\nQQQ,20031014 00:00,351000,353500,349600,353100,56284800,0.0002109846848233844\nSPY,20031015 00:00,1058600,1058900,1046400,1050200,36984200,0.00020192667045719343\nQQQ,20031015 00:00,357900,358500,342000,352100,92129400,0.00020192667045719343\nSPY,20031016 00:00,1046800,1059800,1046500,1053300,31219000,0.0001980199997761761\nQQQ,20031016 00:00,351000,355300,341100,354400,65957400,0.0001980199997761761\nSPY,20031017 00:00,1054700,1059100,1039800,1042300,32168100,0.00019629059982211963\nQQQ,20031017 00:00,354100,368500,346100,346600,92146300,0.00019629059982211963\nSPY,20031020 00:00,1044500,1048300,1039400,1047800,25177800,0.00019622410660935461\nQQQ,20031020 00:00,346600,356800,340800,349800,66406700,0.00019622410660935461\nSPY,20031021 00:00,1048700,1052800,1043200,1049600,24689900,0.0001947695338386111\nQQQ,20031021 00:00,351300,354500,349400,353600,69893000,0.0001947695338386111\nSPY,20031022 00:00,1040300,1045400,1027000,1034000,31485700,0.0001955043081598923\nQQQ,20031022 00:00,349100,358800,344400,345600,85295700,0.0001955043081598923\nSPY,20031023 00:00,1028900,1039500,1026800,1037400,43512900,0.0001947666600932487\nQQQ,20031023 00:00,341500,345100,340500,343400,86490000,0.0001947666600932487\nSPY,20031024 00:00,1028300,1037600,1021800,1032800,50146300,0.00019339756941971317\nQQQ,20031024 00:00,337900,344100,334900,340700,94799400,0.00019339756941971317\nSPY,20031027 00:00,1037400,1044400,1032700,1034400,30493800,0.00019160723074002832\nQQQ,20031027 00:00,342800,344500,340400,341800,61720400,0.00019160723074002832\nSPY,20031028 00:00,1039800,1050700,1038200,1050200,32172100,0.0001928755756881494\nQQQ,20031028 00:00,344200,353100,343700,352900,103921000,0.0001928755756881494\nSPY,20031029 00:00,1047700,1060800,1037300,1052500,30289100,0.00019210482228021537\nQQQ,20031029 00:00,352100,354100,343200,353000,72076300,0.00019210482228021537\nSPY,20031030 00:00,1057900,1059700,1042400,1050900,36716900,0.00019125294058652822\nQQQ,20031030 00:00,357900,360000,344500,352200,87880200,0.00019125294058652822\nSPY,20031031 00:00,1054000,1057400,1052200,1054200,22457300,0.00019119885531383826\nQQQ,20031031 00:00,354500,354900,350600,351600,51389300,0.00019119885531383826\nSPY,20031103 00:00,1057500,1066100,1042000,1063200,36184684,0.00018976131513380928\nQQQ,20031103 00:00,354300,360000,347500,358800,67913163,0.00018976131513380928\nSPY,20031104 00:00,1059800,1062700,1038400,1057800,30356338,0.00018937279690745416\nQQQ,20031104 00:00,356900,358700,354000,355800,58032335,0.00018937279690745416\nSPY,20031105 00:00,1055200,1059700,1049000,1056300,34379600,0.00018923747776836928\nQQQ,20031105 00:00,355200,357700,342900,356400,57850100,0.00018923747776836928\nSPY,20031106 00:00,1056400,1064000,1051000,1062600,26891500,0.00018892829155282023\nQQQ,20031106 00:00,357700,359000,325400,358200,86443900,0.00018892829155282023\nSPY,20031107 00:00,1066400,1067200,1056500,1058100,30466600,0.00018529226035621325\nQQQ,20031107 00:00,360800,369900,351500,357600,57801500,0.00018529226035621325\nSPY,20031110 00:00,1057300,1067500,1050100,1051800,24000800,0.0001852035896227996\nQQQ,20031110 00:00,357000,361200,346900,351900,64945700,0.0001852035896227996\nSPY,20031111 00:00,1050800,1053400,1048000,1050800,25833400,0.0001822557448612294\nQQQ,20031111 00:00,351500,359000,348500,350100,73588600,0.0001822557448612294\nSPY,20031112 00:00,1052100,1064700,1051600,1063800,26023500,0.00018249638933620266\nQQQ,20031112 00:00,351700,358800,351400,358300,74280100,0.00018249638933620266\nSPY,20031113 00:00,1060100,1065400,1057800,1063500,26263200,0.000182553338830593\nQQQ,20031113 00:00,357000,359500,355500,357900,62183500,0.000182553338830593\nSPY,20031114 00:00,1064000,1069500,1025600,1055400,47567700,0.0001791610985655585\nQQQ,20031114 00:00,358200,360200,349900,350200,89191000,0.0001791610985655585\nSPY,20031117 00:00,1049100,1055100,1040400,1048600,43458300,0.00017947562050923296\nQQQ,20031117 00:00,348300,358500,303300,346200,106152500,0.00017947562050923296\nSPY,20031118 00:00,1052400,1054600,1039000,1039100,34193000,0.00017962834313629047\nQQQ,20031118 00:00,348800,358600,339500,339800,99638900,0.00017962834313629047\nSPY,20031119 00:00,1040300,1055300,1039200,1047800,27333500,0.00017957317270593282\nQQQ,20031119 00:00,340000,344000,338800,343000,82821700,0.00017957317270593282\nSPY,20031120 00:00,1040000,1056300,1038000,1039000,48251500,0.0001767645487071211\nQQQ,20031120 00:00,339300,346800,330200,339600,115695700,0.0001767645487071211\nSPY,20031121 00:00,1042400,1049100,1026500,1040400,28252200,0.00017328794351018805\nQQQ,20031121 00:00,340700,349800,337300,341500,77430500,0.00017328794351018805\nSPY,20031124 00:00,1046800,1057700,1046800,1057200,26789400,0.0001751503814179387\nQQQ,20031124 00:00,345100,352400,329200,352300,84299600,0.0001751503814179387\nSPY,20031125 00:00,1057300,1064200,1040600,1060100,37048100,0.00017505894382752066\nQQQ,20031125 00:00,352800,354500,350900,351300,69609800,0.00017505894382752066\nSPY,20031126 00:00,1064200,1064500,1044000,1064000,43671100,0.0001718749211373094\nQQQ,20031126 00:00,354100,355200,348100,352800,71861800,0.0001718749211373094\nSPY,20031128 00:00,1062800,1066600,1062000,1065400,10401800,0.0001682711562799069\nQQQ,20031128 00:00,352600,355000,352100,353700,25140100,0.0001682711562799069\nSPY,20031201 00:00,1068500,1076800,1003500,1075700,34785800,0.00016862613844971595\nQQQ,20031201 00:00,356900,360100,354700,359000,80524000,0.00016862613844971595\nSPY,20031202 00:00,1073800,1077700,1070700,1072700,31161900,0.00016875888810176216\nQQQ,20031202 00:00,358200,360500,355800,356100,62444500,0.00016875888810176216\nSPY,20031203 00:00,1076500,1080800,1070800,1071100,38845700,0.00016711914651828993\nQQQ,20031203 00:00,358400,361200,353500,353600,104129600,0.00016711914651828993\nSPY,20031204 00:00,1071700,1077200,1069400,1076800,34806300,0.00016703751139978516\nQQQ,20031204 00:00,354000,394300,350800,356300,97153700,0.00016703751139978516\nSPY,20031205 00:00,1071500,1078000,1000600,1068100,28144500,0.00016671256165191336\nQQQ,20031205 00:00,352700,356300,349600,350500,85470500,0.00016671256165191336\nSPY,20031208 00:00,1067400,1076400,1066800,1075200,25534900,0.00016654650946138695\nQQQ,20031208 00:00,350100,353300,347800,352500,85254800,0.00016654650946138695\nSPY,20031209 00:00,1079000,1079300,1055200,1066200,41477400,0.00016298757450004684\nQQQ,20031209 00:00,354400,359700,343400,344200,107980800,0.00016298757450004684\nSPY,20031210 00:00,1067700,1069800,1007000,1065400,30425000,0.00016224664844485863\nQQQ,20031210 00:00,344900,355400,336500,345300,100299900,0.00016224664844485863\nSPY,20031211 00:00,1067000,1081000,1066700,1078400,41272400,0.0001631203259138231\nQQQ,20031211 00:00,344900,355300,341400,352400,108067400,0.0001631203259138231\nSPY,20031212 00:00,1079700,1087000,1066500,1081300,32363800,0.00016312863034671315\nQQQ,20031212 00:00,353100,353400,349000,352300,69817400,0.00016312863034671315\nSPY,20031215 00:00,1091700,1094500,1074800,1075200,37584800,0.00016165901684232582\nQQQ,20031215 00:00,359200,370000,347000,347500,98920400,0.00016165901684232582\nSPY,20031216 00:00,1076800,1085000,1002400,1081700,31281800,0.00015873292293009614\nQQQ,20031216 00:00,347900,350200,344200,349000,88258500,0.00015873292293009614\nSPY,20031217 00:00,1080600,1083800,1078000,1083400,22379200,0.00015868622184158542\nQQQ,20031217 00:00,348200,350000,345700,348000,64756100,0.00015868622184158542\nSPY,20031218 00:00,1085500,1097200,1083900,1096000,27293400,0.0001579270554975256\nQQQ,20031218 00:00,349500,356400,344500,355700,87652600,0.0001579270554975256\nSPY,20031219 00:00,1093000,1097000,1085800,1090400,38548300,0.00015778699662927613\nQQQ,20031219 00:00,356000,356500,352000,354500,88921700,0.00015778699662927613\nSPY,20031222 00:00,1087900,1094700,1086500,1094600,26487100,0.00015763869397352235\nQQQ,20031222 00:00,353500,385700,346400,355800,62437500,0.00015763869397352235\nSPY,20031223 00:00,1094800,1099500,1084200,1097900,23343300,0.0001576019566201511\nQQQ,20031223 00:00,355900,360200,349000,359600,68370200,0.0001576019566201511\nSPY,20031224 00:00,1095200,1098800,1094300,1095800,8102900,0.00015728898132721591\nQQQ,20031224 00:00,358400,360200,353700,358600,46722800,0.00015728898132721591\nSPY,20031226 00:00,1097100,1100800,1096300,1096700,8278000,0.00015716413819765894\nQQQ,20031226 00:00,359600,360900,358200,358700,25403900,0.00015716413819765894\nSPY,20031229 00:00,1101000,1111700,1090000,1111500,18474600,0.00015675438268930732\nQQQ,20031229 00:00,360200,365100,359000,364900,59296100,0.00015675438268930732\nSPY,20031230 00:00,1110900,1112700,1101500,1111700,17554100,0.0001569103116025522\nQQQ,20031230 00:00,365200,365500,362800,364700,47434400,0.0001569103116025522\nSPY,20031231 00:00,1112300,1115200,1108400,1111500,28056500,0.00015693253400777383\nQQQ,20031231 00:00,366000,366400,354100,363700,57150500,0.00015693253400777383\nSPY,20040102 00:00,1117400,1199100,1107300,1110000,35070700,0.00015132135587071514\nQQQ,20040102 00:00,366500,367900,357000,363300,53850600,0.00015132135587071514\nSPY,20040105 00:00,1116900,1124500,1111700,1123700,25956100,0.0001522566048537048\nQQQ,20040105 00:00,366000,371600,358300,371200,66093600,0.0001522566048537048\nSPY,20040106 00:00,1121800,1127300,1112300,1126300,18416900,0.00014991649934279925\nQQQ,20040106 00:00,370800,374200,369500,373200,60312000,0.00014991649934279925\nSPY,20040107 00:00,1123900,1129200,1118900,1129000,27474700,0.00015011355632695857\nQQQ,20040107 00:00,372700,376200,370700,376100,66027600,0.00015011355632695857\nSPY,20040108 00:00,1132600,1134100,1121900,1133200,33802100,0.00014853384689724464\nQQQ,20040108 00:00,378700,379800,376000,379400,71539000,0.00014853384689724464\nSPY,20040109 00:00,1128200,1139800,1121900,1125100,40552100,0.0001464311589139677\nQQQ,20040109 00:00,377100,388400,358700,378100,90933300,0.0001464311589139677\nSPY,20040112 00:00,1125500,1131200,1123600,1131100,28825100,0.00014668492826136877\nQQQ,20040112 00:00,378500,383200,367700,383000,74670800,0.00014668492826136877\nSPY,20040113 00:00,1130900,1132300,1111300,1124700,44553600,0.00014694287595113677\nQQQ,20040113 00:00,382600,386300,376000,379000,93502800,0.00014694287595113677\nSPY,20040114 00:00,1127600,1134200,1126700,1133100,25360700,0.000146850436699301\nQQQ,20040114 00:00,380800,389500,371000,381000,57436200,0.000146850436699301\nSPY,20040115 00:00,1135700,1140600,1125800,1135300,38120800,0.00014565960869984484\nQQQ,20040115 00:00,379300,384600,376300,381200,101805100,0.00014565960869984484\nSPY,20040116 00:00,1140400,1143100,1130800,1142500,29709700,0.00014567433829709836\nQQQ,20040116 00:00,383800,386300,348300,385700,73172000,0.00014567433829709836\nSPY,20040120 00:00,1145300,1146500,1138200,1142100,27297000,0.00014311005106936275\nQQQ,20040120 00:00,387200,390000,383100,386400,74319500,0.00014311005106936275\nSPY,20040121 00:00,1141300,1153000,1137200,1150600,30519200,0.0001421469426279088\nQQQ,20040121 00:00,383900,387000,380000,384100,106032800,0.0001421469426279088\nSPY,20040122 00:00,1151400,1153800,1145800,1147300,27978800,0.00014212259499569017\nQQQ,20040122 00:00,385600,386900,380700,380900,83945200,0.00014212259499569017\nSPY,20040123 00:00,1150000,1153700,1139500,1143600,29245600,0.00014124882422597695\nQQQ,20040123 00:00,382000,388900,376000,380300,86325100,0.00014124882422597695\nSPY,20040126 00:00,1143900,1159100,1143900,1158000,28336100,0.0001371382291455371\nQQQ,20040126 00:00,379700,389000,378400,385600,80168100,0.0001371382291455371\nSPY,20040127 00:00,1157500,1165000,1147000,1147000,32571800,0.00013740043373347582\nQQQ,20040127 00:00,385100,386300,376900,377900,90496900,0.00013740043373347582\nSPY,20040128 00:00,1149800,1153700,1129400,1132300,48424700,0.0001379447996649119\nQQQ,20040128 00:00,379400,380600,360500,371600,122748000,0.0001379447996649119\nSPY,20040129 00:00,1135600,1138500,1125600,1137500,55569800,0.00013749400662525882\nQQQ,20040129 00:00,372400,373100,361000,371600,138458200,0.00013749400662525882\nSPY,20040130 00:00,1135200,1152900,1130900,1134400,27744000,0.00013440407136705132\nQQQ,20040130 00:00,372000,381900,369700,370900,80818200,0.00013440407136705132\nSPY,20040202 00:00,1137000,1163600,1131200,1138300,37615300,0.00013461197436603455\nQQQ,20040202 00:00,372000,374800,368200,369500,90665200,0.00013461197436603455\nSPY,20040203 00:00,1137400,1149700,1134400,1139500,22680000,0.00013457552492619656\nQQQ,20040203 00:00,369100,381000,360800,370600,64169800,0.00013457552492619656\nSPY,20040204 00:00,1131900,1139400,1127900,1130300,37534600,0.00013433824214616064\nQQQ,20040204 00:00,366200,377600,363300,364000,106355100,0.00013433824214616064\nSPY,20040205 00:00,1131700,1135400,1127800,1132600,34498800,0.00013423227512506078\nQQQ,20040205 00:00,365100,396000,363300,364800,85194100,0.00013423227512506078\nSPY,20040206 00:00,1134200,1146900,1132000,1146600,34866300,0.00013510675599502867\nQQQ,20040206 00:00,366000,379800,365300,372500,103881600,0.00013510675599502867\nSPY,20040209 00:00,1146700,1148700,1142900,1143400,22947000,0.00013439863623858114\nQQQ,20040209 00:00,373400,374800,362700,371000,56269700,0.00013439863623858114\nSPY,20040210 00:00,1142800,1151400,1142600,1149000,26564200,0.00013408900127969163\nQQQ,20040210 00:00,370600,374100,370300,372300,62856800,0.00013408900127969163\nSPY,20040211 00:00,1148500,1163900,1050100,1161900,41979200,0.00013427940954709153\nQQQ,20040211 00:00,372400,376700,370000,375800,90129700,0.00013427940954709153\nSPY,20040212 00:00,1159700,1167400,1146400,1156700,25685800,0.00013376443820711063\nQQQ,20040212 00:00,375200,377000,372600,373300,64090300,0.00013376443820711063\nSPY,20040213 00:00,1158200,1162000,1147500,1151200,42820400,0.00013394915463985595\nQQQ,20040213 00:00,373900,379700,367600,369700,87747000,0.00013394915463985595\nSPY,20040217 00:00,1158500,1164300,1157700,1161400,23040800,0.0001319429855577541\nQQQ,20040217 00:00,372800,376200,363700,374600,67387900,0.0001319429855577541\nSPY,20040218 00:00,1162000,1166000,1153500,1156600,26629100,0.0001295697182563273\nQQQ,20040218 00:00,375100,376700,373200,374900,66260400,0.0001295697182563273\nSPY,20040219 00:00,1163300,1163900,1150000,1152200,45058400,0.00012954979269704154\nQQQ,20040219 00:00,378600,379000,369200,369600,94731500,0.00012954979269704154\nSPY,20040220 00:00,1154500,1155600,1143200,1150000,45242500,0.00012924735646273583\nQQQ,20040220 00:00,370100,371400,338700,369100,132579000,0.00012924735646273583\nSPY,20040223 00:00,1152200,1156100,1141700,1145500,36514400,0.00012882953510852093\nQQQ,20040223 00:00,370000,372700,359000,363900,121943700,0.00012882953510852093\nSPY,20040224 00:00,1142700,1149900,1130300,1144500,44472000,0.00012699665741745694\nQQQ,20040224 00:00,363000,366700,360000,363800,134313900,0.00012699665741745694\nSPY,20040225 00:00,1144600,1150600,1143200,1149100,28553900,0.0001269720090005317\nQQQ,20040225 00:00,364300,366700,363300,365800,70050200,0.0001269720090005317\nSPY,20040226 00:00,1146100,1152900,1143400,1150400,27040800,0.0001254564180599956\nQQQ,20040226 00:00,364700,368400,363100,367000,68667000,0.0001254564180599956\nSPY,20040227 00:00,1151900,1160800,1145500,1150800,36024700,0.00012467292316565833\nQQQ,20040227 00:00,367700,369400,362700,365400,95661900,0.00012467292316565833\nSPY,20040301 00:00,1154300,1163400,1144400,1160700,32675900,0.00012476738018426416\nQQQ,20040301 00:00,366800,370700,307000,369800,77086800,0.00012476738018426416\nSPY,20040302 00:00,1159400,1169700,1151900,1154900,38210300,0.00012426654188421468\nQQQ,20040302 00:00,369800,371800,366200,366700,92975700,0.00012426654188421468\nSPY,20040303 00:00,1152500,1164000,1142500,1157000,30759200,0.00012364340574856847\nQQQ,20040303 00:00,365100,366300,362100,364900,82912400,0.00012364340574856847\nSPY,20040304 00:00,1157200,1161000,1150400,1160500,19519800,0.00012344605901969347\nQQQ,20040304 00:00,364400,368300,363900,368100,61527400,0.00012344605901969347\nSPY,20040305 00:00,1154200,1169500,1150800,1162900,54667200,0.0001229683135288484\nQQQ,20040305 00:00,364200,399300,361500,366800,114239900,0.0001229683135288484\nSPY,20040308 00:00,1163400,1166200,1152200,1152700,35524500,0.0001238837233948474\nQQQ,20040308 00:00,366900,369700,358000,358400,106604300,0.0001238837233948474\nSPY,20040309 00:00,1151000,1166500,1049700,1146600,37870300,0.00012120013028177624\nQQQ,20040309 00:00,358100,367400,355200,357900,125237900,0.00012120013028177624\nSPY,20040310 00:00,1147200,1156200,1114500,1129800,63572300,0.00012187577957633274\nQQQ,20040310 00:00,357500,369600,352300,352900,125469200,0.00012187577957633274\nSPY,20040311 00:00,1123900,1156500,1111500,1113500,82967500,0.0001224944600040909\nQQQ,20040311 00:00,350700,355300,348600,348900,146342700,0.0001224944600040909\nSPY,20040312 00:00,1117300,1127000,1115800,1126900,50845500,0.00011562193439503183\nQQQ,20040312 00:00,351800,363600,344500,355600,116411400,0.00011562193439503183\nSPY,20040315 00:00,1122600,1126900,1109000,1110300,59041900,0.00011701031398962253\nQQQ,20040315 00:00,353600,359800,348100,348300,114826500,0.00011701031398962253\nSPY,20040316 00:00,1117800,1149300,1108400,1117300,56252100,0.00011120155830263857\nQQQ,20040316 00:00,351100,352500,346300,350000,115980400,0.00011120155830263857\nSPY,20040317 00:00,1122000,1132600,1115600,1130000,37263700,0.00011171302619061744\nQQQ,20040317 00:00,352000,356200,343400,355000,92743400,0.00011171302619061744\nSPY,20040318 00:00,1126700,1139400,1119300,1129100,57846900,0.00011197306264689502\nQQQ,20040318 00:00,353700,354600,349700,352900,107889400,0.00011197306264689502\nSPY,20040319 00:00,1124100,1133300,1107000,1112900,42347600,0.00011283342212712611\nQQQ,20040319 00:00,352800,359700,348200,348300,100061600,0.00011283342212712611\nSPY,20040322 00:00,1105400,1105700,1053500,1097400,59212700,0.00011293513574498505\nQQQ,20040322 00:00,345300,371300,340300,343500,129988200,0.00011293513574498505\nSPY,20040323 00:00,1102500,1109300,1093600,1096500,50925500,0.00010684375883374606\nQQQ,20040323 00:00,345900,353600,340100,341200,121264600,0.00010684375883374606\nSPY,20040324 00:00,1096200,1104700,1088500,1094100,51507700,0.0001059496713642145\nQQQ,20040324 00:00,341500,353500,335000,344100,116587400,0.0001059496713642145\nSPY,20040325 00:00,1100800,1113000,1097900,1111100,45819300,0.00010759648386801555\nQQQ,20040325 00:00,346400,354600,342100,354100,135180300,0.00010759648386801555\nSPY,20040326 00:00,1109600,1117900,1108000,1111700,34724000,0.00010753419874078018\nQQQ,20040326 00:00,353000,355800,352200,352700,76148500,0.00010753419874078018\nSPY,20040329 00:00,1116300,1145000,1115800,1124900,42364300,0.00010778715228687383\nQQQ,20040329 00:00,355100,359600,347900,358500,98635000,0.00010778715228687383\nSPY,20040330 00:00,1123000,1130700,1122200,1129700,36690700,0.0001055293300922905\nQQQ,20040330 00:00,356700,359400,338400,358900,90110600,0.0001055293300922905\nSPY,20040331 00:00,1129900,1134000,1116000,1128800,44063000,0.00010544910919667504\nQQQ,20040331 00:00,359200,360000,356100,356900,84007400,0.00010544910919667504\nSPY,20040401 00:00,1130700,1181800,1130500,1134900,43460700,0.00010166046172885908\nQQQ,20040401 00:00,358100,362500,351100,360800,89126800,0.00010166046172885908\nSPY,20040402 00:00,1148100,1155500,1120100,1144400,49027100,0.00010231010095698478\nQQQ,20040402 00:00,368900,390200,357200,369800,140202400,0.00010231010095698478\nSPY,20040405 00:00,1144600,1157900,1144400,1153300,28795500,0.00010270501465507616\nQQQ,20040405 00:00,370100,374800,369700,374600,64820400,0.00010270501465507616\nSPY,20040406 00:00,1148300,1151800,1141000,1150800,25102800,0.00010286486582630609\nQQQ,20040406 00:00,371600,372500,369200,370600,91542000,0.00010286486582630609\nSPY,20040407 00:00,1149400,1149800,1141100,1144900,43731300,0.00010295178845892055\nQQQ,20040407 00:00,369900,371100,366000,368700,84326300,0.00010295178845892055\nSPY,20040408 00:00,1154100,1154100,1137400,1142300,45988200,0.00010154796647611346\nQQQ,20040408 00:00,373500,373900,367400,369900,74677100,0.00010154796647611346\nSPY,20040412 00:00,1145800,1150800,1145000,1148800,22187200,0.00010143436871104\nQQQ,20040412 00:00,370300,372900,369800,371600,54066000,0.00010143436871104\nSPY,20040413 00:00,1152600,1153000,1130700,1133100,51934900,0.00010223328798191128\nQQQ,20040413 00:00,373400,373600,360000,366200,93369400,0.00010223328798191128\nSPY,20040414 00:00,1126100,1143200,1125500,1131900,65752200,0.00010080198687185308\nQQQ,20040414 00:00,364100,369500,363600,366800,107922800,0.00010080198687185308\nSPY,20040415 00:00,1134500,1137800,1120300,1131700,59058100,0.00010075284205277351\nQQQ,20040415 00:00,367500,368600,360200,363100,117232200,0.00010075284205277351\nSPY,20040416 00:00,1134300,1140500,1129800,1137200,42013900,0.00010053554545072919\nQQQ,20040416 00:00,362100,369900,357900,360300,108160600,0.00010053554545072919\nSPY,20040419 00:00,1135500,1166300,1132700,1138900,27015500,9.902485148468512e-05\nQQQ,20040419 00:00,360100,382800,359800,365600,81496500,9.902485148468512e-05\nSPY,20040420 00:00,1141100,1143200,1121100,1121400,46026100,0.00010052175988996688\nQQQ,20040420 00:00,366100,367900,355400,357500,111965600,0.00010052175988996688\nSPY,20040421 00:00,1122000,1129500,1118700,1128100,50401500,9.91255618128675e-05\nQQQ,20040421 00:00,359200,369200,347400,360800,112645000,9.91255618128675e-05\nSPY,20040422 00:00,1124800,1146700,1122400,1144400,58743900,0.00010010888374326793\nQQQ,20040422 00:00,360000,371800,359800,369200,131772800,0.00010010888374326793\nSPY,20040423 00:00,1144200,1146100,1133400,1144400,28136900,9.991652578267696e-05\nQQQ,20040423 00:00,370800,372300,360000,372100,92034400,9.991652578267696e-05\nSPY,20040426 00:00,1145000,1149400,1136000,1139100,30358300,9.879545945450308e-05\nQQQ,20040426 00:00,371900,377600,366500,367800,72734100,9.879545945450308e-05\nSPY,20040427 00:00,1142300,1151200,1125200,1142200,42595100,9.732814636487321e-05\nQQQ,20040427 00:00,369400,371900,366900,368100,85016300,9.732814636487321e-05\nSPY,20040428 00:00,1138800,1143300,1125000,1125800,48133100,9.854027862862998e-05\nQQQ,20040428 00:00,367100,367200,343300,360800,108687300,9.854027862862998e-05\nSPY,20040429 00:00,1127200,1135000,1111600,1118400,64784500,9.875053852649689e-05\nQQQ,20040429 00:00,360800,369900,350700,356400,161410800,9.875053852649689e-05\nSPY,20040430 00:00,1121700,1123800,1111000,1111300,43933900,9.940525722367995e-05\nQQQ,20040430 00:00,356600,358000,348200,348600,139728500,9.940525722367995e-05\nSPY,20040503 00:00,1113900,1147000,1111400,1121400,32438000,9.852335609576631e-05\nQQQ,20040503 00:00,350000,355200,348900,351800,115006300,9.852335609576631e-05\nSPY,20040504 00:00,1122500,1132600,1116600,1123600,49564600,9.851302583576167e-05\nQQQ,20040504 00:00,352100,357500,350300,354100,123153200,9.851302583576167e-05\nSPY,20040505 00:00,1124200,1129600,1121600,1125800,31951000,9.810153319965534e-05\nQQQ,20040505 00:00,354200,366300,352000,355300,93779100,9.810153319965534e-05\nSPY,20040506 00:00,1120200,1129900,1110000,1118500,55153900,9.807539984765829e-05\nQQQ,20040506 00:00,352400,355200,340400,352300,99725700,9.807539984765829e-05\nSPY,20040507 00:00,1112200,1125000,1017700,1103000,56597900,9.774920753967462e-05\nQQQ,20040507 00:00,350900,356400,349600,349800,132379100,9.774920753967462e-05\nSPY,20040510 00:00,1094400,1103000,1083600,1091300,71688500,9.691557196781194e-05\nQQQ,20040510 00:00,346700,355800,344200,347500,156762300,9.691557196781194e-05\nSPY,20040511 00:00,1094600,1100500,1091700,1100100,45139000,9.666230105631755e-05\nQQQ,20040511 00:00,349700,353800,349200,353000,111580200,9.666230105631755e-05\nSPY,20040512 00:00,1095900,1103000,1080600,1103000,88509300,9.656459171199157e-05\nQQQ,20040512 00:00,351200,384000,342700,352200,195129600,9.656459171199157e-05\nSPY,20040513 00:00,1097600,1110800,1094400,1101500,55237300,9.646383743039833e-05\nQQQ,20040513 00:00,350600,354500,341900,352200,132681600,9.646383743039833e-05\nSPY,20040514 00:00,1099600,1115400,1092700,1100200,50676700,9.618260966144718e-05\nQQQ,20040514 00:00,352100,353100,346400,348000,130002900,9.618260966144718e-05\nSPY,20040517 00:00,1088900,1098900,1062900,1088500,50323900,9.670663301937964e-05\nQQQ,20040517 00:00,343800,354400,341100,343200,147278400,9.670663301937964e-05\nSPY,20040518 00:00,1095100,1099400,1093300,1097000,27587700,9.356459524315258e-05\nQQQ,20040518 00:00,346600,349000,343500,347600,88454700,9.356459524315258e-05\nSPY,20040519 00:00,1105000,1111800,1093000,1094100,52483500,9.357237953054128e-05\nQQQ,20040519 00:00,351600,357500,347100,347500,136180600,9.357237953054128e-05\nSPY,20040520 00:00,1094500,1098700,1090400,1095200,36316800,9.357075569340285e-05\nQQQ,20040520 00:00,347800,350200,345600,347700,92710700,9.357075569340285e-05\nSPY,20040521 00:00,1099700,1105500,1003200,1099300,45668000,9.313325556611431e-05\nQQQ,20040521 00:00,350100,351700,347300,350100,111755300,9.313325556611431e-05\nSPY,20040524 00:00,1105200,1109700,1089800,1100900,38977400,9.314101031040357e-05\nQQQ,20040524 00:00,352900,354600,350000,351600,95480400,9.314101031040357e-05\nSPY,20040525 00:00,1099200,1119800,1096000,1119200,47273500,9.176085731159948e-05\nQQQ,20040525 00:00,351400,360800,349500,360200,141954900,9.176085731159948e-05\nSPY,20040526 00:00,1116600,1130000,1109000,1120900,35125400,9.177156924068174e-05\nQQQ,20040526 00:00,358800,361900,349900,361500,91168200,9.177156924068174e-05\nSPY,20040527 00:00,1125300,1130300,1120600,1127200,42981900,9.195934885194698e-05\nQQQ,20040527 00:00,362900,365000,360000,363600,107739200,9.195934885194698e-05\nSPY,20040528 00:00,1127400,1129000,1120800,1127100,21270500,9.1087387489093e-05\nQQQ,20040528 00:00,363900,365400,353400,365400,55778500,9.1087387489093e-05\nSPY,20040601 00:00,1125000,1136300,1118700,1126800,38048600,9.117127858921506e-05\nQQQ,20040601 00:00,362700,365400,351700,365200,90503200,9.117127858921506e-05\nSPY,20040602 00:00,1130300,1137300,1124600,1131200,35038800,9.088015487748887e-05\nQQQ,20040602 00:00,365700,366600,361700,364000,95596600,9.088015487748887e-05\nSPY,20040603 00:00,1127900,1131900,1120400,1122500,32395900,9.027007535147797e-05\nQQQ,20040603 00:00,363000,363600,359400,359700,90273600,9.027007535147797e-05\nSPY,20040604 00:00,1130000,1135800,1126700,1129000,30328600,9.031492548020928e-05\nQQQ,20040604 00:00,363300,366200,361800,362300,87623900,9.031492548020928e-05\nSPY,20040607 00:00,1134800,1147000,1134200,1146500,29638400,9.136739711000347e-05\nQQQ,20040607 00:00,364400,370900,356500,370700,101724100,9.136739711000347e-05\nSPY,20040608 00:00,1143700,1149200,1141700,1148500,30447200,9.075107949467577e-05\nQQQ,20040608 00:00,369100,372000,368500,371600,68719300,9.075107949467577e-05\nSPY,20040609 00:00,1145200,1148600,1129800,1137700,33968300,9.096171701877801e-05\nQQQ,20040609 00:00,369800,371900,363700,365300,94907000,9.096171701877801e-05\nSPY,20040610 00:00,1140400,1143200,1139300,1143000,19793700,9.055073700993082e-05\nQQQ,20040610 00:00,366900,377300,365300,368000,54661300,9.055073700993082e-05\nSPY,20040614 00:00,1138400,1138500,1112300,1131900,30710200,9.118974641388183e-05\nQQQ,20040614 00:00,365900,368300,352000,362500,77881000,9.118974641388183e-05\nSPY,20040615 00:00,1139600,1144500,1135100,1139500,35119400,9.063533319046333e-05\nQQQ,20040615 00:00,365600,369900,365600,368400,86341300,9.063533319046333e-05\nSPY,20040616 00:00,1140200,1142000,1137000,1139900,24930800,8.818738383830134e-05\nQQQ,20040616 00:00,367700,372500,358200,368000,60572400,8.818738383830134e-05\nSPY,20040617 00:00,1138500,1140700,1133300,1138600,26144700,8.826060452219276e-05\nQQQ,20040617 00:00,366600,366600,362500,364000,75210100,8.826060452219276e-05\nSPY,20040618 00:00,1132700,1142200,1131800,1137100,30286600,8.831174081961675e-05\nQQQ,20040618 00:00,363000,368400,362600,364200,77752200,8.831174081961675e-05\nSPY,20040621 00:00,1137800,1141400,1131800,1133100,21889000,8.732381329060524e-05\nQQQ,20040621 00:00,365000,380000,360600,361500,64205700,8.732381329060524e-05\nSPY,20040622 00:00,1131300,1138200,1126700,1137900,35492200,8.748000868726854e-05\nQQQ,20040622 00:00,361600,366800,360200,366700,99245300,8.748000868726854e-05\nSPY,20040623 00:00,1136100,1148400,1134200,1147000,33526700,8.658660671885143e-05\nQQQ,20040623 00:00,365800,371900,365100,371000,89991600,8.658660671885143e-05\nSPY,20040624 00:00,1145600,1149300,1142600,1144400,33590600,8.665606746219924e-05\nQQQ,20040624 00:00,370200,379800,359800,370200,88429700,8.665606746219924e-05\nSPY,20040625 00:00,1144100,1149400,1139500,1141300,28221300,8.641773837341892e-05\nQQQ,20040625 00:00,370000,373900,369800,372400,75034100,8.641773837341892e-05\nSPY,20040628 00:00,1145200,1146100,1134300,1136800,38803300,8.567297853509863e-05\nQQQ,20040628 00:00,374900,375200,364800,371100,90888800,8.567297853509863e-05\nSPY,20040629 00:00,1135300,1141700,1134200,1139900,25858700,8.533592132934072e-05\nQQQ,20040629 00:00,371100,379900,370000,374400,64979700,8.533592132934072e-05\nSPY,20040630 00:00,1140700,1147900,1136500,1144500,45402600,8.538976394731926e-05\nQQQ,20040630 00:00,374400,379000,373000,377400,95439900,8.538976394731926e-05\nSPY,20040701 00:00,1142900,1144100,1125800,1132000,54746200,8.584151737887848e-05\nQQQ,20040701 00:00,376500,377000,367700,370400,120050000,8.584151737887848e-05\nSPY,20040702 00:00,1131300,1142000,1126000,1128000,32907500,8.517604260953289e-05\nQQQ,20040702 00:00,370400,371900,366300,367800,72132100,8.517604260953289e-05\nSPY,20040706 00:00,1123700,1177400,1116300,1119600,37407000,8.541577232582606e-05\nQQQ,20040706 00:00,365900,368200,358300,360100,127570400,8.541577232582606e-05\nSPY,20040707 00:00,1118100,1125700,1117500,1121400,26849200,8.218246879949932e-05\nQQQ,20040707 00:00,359500,382500,359200,360900,94757900,8.218246879949932e-05\nSPY,20040708 00:00,1118100,1144500,1112000,1112200,42989300,8.258249393734246e-05\nQQQ,20040708 00:00,358200,361300,355500,355700,101630700,8.258249393734246e-05\nSPY,20040709 00:00,1117000,1119400,1113800,1116400,28340700,8.259242253468119e-05\nQQQ,20040709 00:00,358400,380200,356300,357900,90265500,8.259242253468119e-05\nSPY,20040712 00:00,1115100,1120400,1110000,1117800,35749900,8.15200129211374e-05\nQQQ,20040712 00:00,355700,356900,336300,356000,79116100,8.15200129211374e-05\nSPY,20040713 00:00,1119000,1120200,1116300,1118900,24206700,8.123095573911786e-05\nQQQ,20040713 00:00,356900,358100,354300,355300,73771200,8.123095573911786e-05\nSPY,20040714 00:00,1112600,1144100,1111200,1114900,51054000,8.113881733243628e-05\nQQQ,20040714 00:00,351900,356500,350500,352100,114940900,8.113881733243628e-05\nSPY,20040715 00:00,1117400,1119100,1110100,1110400,33439800,8.112652608887641e-05\nQQQ,20040715 00:00,353300,354900,322000,351900,85396400,8.112652608887641e-05\nSPY,20040716 00:00,1115700,1119400,1104400,1105300,35916600,8.138953039124098e-05\nQQQ,20040716 00:00,354300,354500,346400,346800,116114100,8.138953039124098e-05\nSPY,20040719 00:00,1107500,1116400,1099900,1104500,38330500,7.986488268256824e-05\nQQQ,20040719 00:00,347900,349700,344700,347300,102237900,7.986488268256824e-05\nSPY,20040720 00:00,1105300,1113100,1102500,1112500,43557500,8.017238677409485e-05\nQQQ,20040720 00:00,347500,352900,347000,352700,101676200,8.017238677409485e-05\nSPY,20040721 00:00,1118100,1120600,1097600,1097900,50225500,8.047475570145764e-05\nQQQ,20040721 00:00,355700,378100,345000,345300,130292900,8.047475570145764e-05\nSPY,20040722 00:00,1094000,1103900,1087700,1100100,68211300,8.003853302775572e-05\nQQQ,20040722 00:00,344700,355400,342500,349600,123607500,8.003853302775572e-05\nSPY,20040723 00:00,1096300,1100800,1086900,1089200,47526400,8.09814625933987e-05\nQQQ,20040723 00:00,346300,350100,335000,341600,102369000,8.09814625933987e-05\nSPY,20040726 00:00,1091900,1099500,1082100,1088500,47699800,8.059981825984782e-05\nQQQ,20040726 00:00,342200,349500,337000,340600,113081100,8.059981825984782e-05\nSPY,20040727 00:00,1090500,1101100,1089700,1098800,49254500,7.97483746421549e-05\nQQQ,20040727 00:00,342000,347100,340400,345700,99691800,7.97483746421549e-05\nSPY,20040728 00:00,1095500,1103700,1077200,1100300,64194000,7.974730511717077e-05\nQQQ,20040728 00:00,344000,346300,338100,344000,153651300,7.974730511717077e-05\nSPY,20040729 00:00,1105400,1116300,1100000,1105500,49656000,7.97306138301462e-05\nQQQ,20040729 00:00,347000,349200,345000,347700,94962100,7.97306138301462e-05\nSPY,20040730 00:00,1103200,1108500,1005100,1106700,39101900,7.964948442064e-05\nQQQ,20040730 00:00,347600,351000,340100,348500,79091500,7.964948442064e-05\nSPY,20040802 00:00,1102000,1136100,1018100,1111000,36502400,7.95849415805361e-05\nQQQ,20040802 00:00,346100,350200,344600,349300,79747400,7.95849415805361e-05\nSPY,20040803 00:00,1109300,1118500,1100000,1103800,37293400,7.980791319477874e-05\nQQQ,20040803 00:00,348400,354100,324100,342800,81095500,7.980791319477874e-05\nSPY,20040804 00:00,1098900,1107500,1004500,1102800,39996100,7.981069516632026e-05\nQQQ,20040804 00:00,341500,348000,321900,342600,86488100,7.981069516632026e-05\nSPY,20040805 00:00,1102700,1109200,1083700,1085200,48165600,7.861460845058026e-05\nQQQ,20040805 00:00,343600,349200,329100,336500,104229100,7.861460845058026e-05\nSPY,20040806 00:00,1076300,1104400,1066200,1068300,69832900,8.04846611934185e-05\nQQQ,20040806 00:00,334100,351800,320000,327300,138880600,8.04846611934185e-05\nSPY,20040809 00:00,1070200,1102700,1068500,1070100,35622900,8.042498021815003e-05\nQQQ,20040809 00:00,328200,329600,326500,328000,75444000,8.042498021815003e-05\nSPY,20040810 00:00,1073100,1180000,1047700,1083600,50445900,8.142188869677163e-05\nQQQ,20040810 00:00,329600,350200,329000,334200,95689300,8.142188869677163e-05\nSPY,20040811 00:00,1076900,1083300,1047900,1080900,52934600,8.149292915854592e-05\nQQQ,20040811 00:00,328600,377200,325000,329100,117079300,8.149292915854592e-05\nSPY,20040812 00:00,1076800,1079500,1067700,1068500,46393500,8.155705584483125e-05\nQQQ,20040812 00:00,326900,328600,320000,324600,107413800,8.155705584483125e-05\nSPY,20040813 00:00,1071000,1073500,1065900,1070700,39483400,8.152475054236201e-05\nQQQ,20040813 00:00,326400,327400,323500,325200,87914900,8.152475054236201e-05\nSPY,20040816 00:00,1071400,1095300,1070300,1085300,42741600,8.200762906572749e-05\nQQQ,20040816 00:00,326200,331900,325200,329800,73989600,8.200762906572749e-05\nSPY,20040817 00:00,1087500,1092800,1085300,1087100,38877500,8.20355203148311e-05\nQQQ,20040817 00:00,331200,334400,329900,331700,86043800,8.20355203148311e-05\nSPY,20040818 00:00,1085200,1101300,1080800,1100800,39425800,8.215271759032125e-05\nQQQ,20040818 00:00,330700,339100,330100,338900,102031000,8.215271759032125e-05\nSPY,20040819 00:00,1098100,1100200,1083400,1096100,35353700,8.215542655447904e-05\nQQQ,20040819 00:00,337300,338500,334100,336300,101371700,8.215542655447904e-05\nSPY,20040820 00:00,1096200,1106300,1004200,1104400,44928200,8.24203418962839e-05\nQQQ,20040820 00:00,335700,341400,330300,340000,90290800,8.24203418962839e-05\nSPY,20040823 00:00,1105500,1107700,1014600,1102200,32167300,8.221480626447239e-05\nQQQ,20040823 00:00,340500,342700,339100,340900,81107400,8.221480626447239e-05\nSPY,20040824 00:00,1106400,1107300,1098500,1101900,28175700,8.190817176116359e-05\nQQQ,20040824 00:00,342400,343100,338100,340400,82955200,8.190817176116359e-05\nSPY,20040825 00:00,1103300,1112700,1099000,1111200,32871800,8.237667729531177e-05\nQQQ,20040825 00:00,340800,346000,330400,345500,87032100,8.237667729531177e-05\nSPY,20040826 00:00,1109600,1113100,1103900,1111600,25411100,8.236281174036374e-05\nQQQ,20040826 00:00,344500,354800,343100,344000,54385400,8.236281174036374e-05\nSPY,20040827 00:00,1112000,1116300,1103400,1114600,23741200,8.239646719186957e-05\nQQQ,20040827 00:00,344700,355000,344400,345600,56679700,8.239646719186957e-05\nSPY,20040830 00:00,1112300,1113400,1105100,1105800,24429400,8.271545252433114e-05\nQQQ,20040830 00:00,344000,344300,340200,340400,58228100,8.271545252433114e-05\nSPY,20040831 00:00,1106600,1110800,1101000,1110700,39554400,8.255840426267965e-05\nQQQ,20040831 00:00,340200,341200,336500,339900,76201100,8.255840426267965e-05\nSPY,20040901 00:00,1109500,1116400,1104800,1113100,48592800,8.18040417572552e-05\nQQQ,20040901 00:00,339200,349600,330400,342600,94958500,8.18040417572552e-05\nSPY,20040902 00:00,1112400,1126600,1112400,1125500,38976400,8.243160760848602e-05\nQQQ,20040902 00:00,341800,348800,341600,347500,74637100,8.243160760848602e-05\nSPY,20040903 00:00,1123000,1128200,1113000,1120900,27059500,8.266749903184987e-05\nQQQ,20040903 00:00,344400,346800,340500,341300,83317100,8.266749903184987e-05\nSPY,20040907 00:00,1125700,1131300,1120300,1128100,35207800,8.256999545043224e-05\nQQQ,20040907 00:00,343900,354100,341200,343700,93256200,8.256999545043224e-05\nSPY,20040908 00:00,1126200,1139300,1116200,1123500,31513900,8.189692769206492e-05\nQQQ,20040908 00:00,343100,346800,341800,342300,98371200,8.189692769206492e-05\nSPY,20040909 00:00,1125700,1128800,1120300,1125000,32230700,8.151754169654396e-05\nQQQ,20040909 00:00,344500,347500,341300,345700,101869700,8.151754169654396e-05\nSPY,20040910 00:00,1125200,1132700,1120800,1130900,26319500,8.043789157878563e-05\nQQQ,20040910 00:00,346100,351900,340200,351200,102507300,8.043789157878563e-05\nSPY,20040913 00:00,1132800,1137400,1130100,1132900,40108000,8.021623259862098e-05\nQQQ,20040913 00:00,352400,357200,342800,354400,105704500,8.021623259862098e-05\nSPY,20040914 00:00,1133000,1136900,1123600,1136100,26316500,8.022530394136913e-05\nQQQ,20040914 00:00,354600,357300,344900,356500,74984800,8.022530394136913e-05\nSPY,20040915 00:00,1133000,1133600,1123500,1127400,35820600,8.050832374196505e-05\nQQQ,20040915 00:00,354300,356700,343000,352000,88658500,8.050832374196505e-05\nSPY,20040916 00:00,1128500,1133700,1128000,1131000,21854300,7.915488300682072e-05\nQQQ,20040916 00:00,352800,363200,351300,352400,65246200,7.915488300682072e-05\nSPY,20040917 00:00,1129500,1133600,1126900,1131100,31200400,7.907490765628036e-05\nQQQ,20040917 00:00,352400,355200,351600,354500,79814800,7.907490765628036e-05\nSPY,20040920 00:00,1126900,1129900,1122800,1125200,35149300,7.817576393842339e-05\nQQQ,20040920 00:00,352900,357700,351000,354400,107819300,7.817576393842339e-05\nSPY,20040921 00:00,1127500,1134700,1125400,1132400,36802200,7.817229109262076e-05\nQQQ,20040921 00:00,355400,358500,354200,356700,85690400,7.817229109262076e-05\nSPY,20040922 00:00,1124800,1136000,1115000,1116300,47097600,7.83312044243977e-05\nQQQ,20040922 00:00,354300,354600,348700,349500,96856600,7.83312044243977e-05\nSPY,20040923 00:00,1116000,1117000,1110400,1111400,41857200,7.79799403968776e-05\nQQQ,20040923 00:00,349800,351500,348800,349900,89448200,7.79799403968776e-05\nSPY,20040924 00:00,1111700,1125800,1110000,1113500,33678500,7.553319736576244e-05\nQQQ,20040924 00:00,349900,351900,346800,348000,101830200,7.553319736576244e-05\nSPY,20040927 00:00,1111000,1118000,1105800,1106700,38491500,7.55097312513118e-05\nQQQ,20040927 00:00,346200,347900,343800,344400,82962100,7.55097312513118e-05\nSPY,20040928 00:00,1109100,1115100,1098000,1113500,36924500,7.530889816492552e-05\nQQQ,20040928 00:00,345500,346900,342300,345900,84949800,7.530889816492552e-05\nSPY,20040929 00:00,1112100,1117900,1110000,1117400,31233100,7.497905558133314e-05\nQQQ,20040929 00:00,345400,351200,345300,350900,91650200,7.497905558133314e-05\nSPY,20040930 00:00,1115500,1119800,1058800,1117400,36058300,7.411971452422199e-05\nQQQ,20040930 00:00,350200,352700,340500,351300,71179500,7.411971452422199e-05\nSPY,20041001 00:00,1122700,1135200,1117800,1134900,59600200,7.402410142318449e-05\nQQQ,20041001 00:00,354400,361500,351300,361000,114761600,7.402410142318449e-05\nSPY,20041004 00:00,1141000,1144400,1134900,1138500,31199200,7.40552900207242e-05\nQQQ,20041004 00:00,363600,385000,361300,362900,103923700,7.40552900207242e-05\nSPY,20041005 00:00,1138500,1141600,1130000,1138300,35789400,7.306830010627715e-05\nQQQ,20041005 00:00,362300,364900,361600,363300,87060500,7.306830010627715e-05\nSPY,20041006 00:00,1137700,1197900,1136800,1145600,40810300,7.317833608751824e-05\nQQQ,20041006 00:00,363200,369500,361100,366300,84776300,7.317833608751824e-05\nSPY,20041007 00:00,1143800,1188200,1133600,1133800,35343800,7.357318176499354e-05\nQQQ,20041007 00:00,365400,366700,361700,362100,80315000,7.357318176499354e-05\nSPY,20041008 00:00,1131500,1137700,1123500,1125800,49598900,7.397073057093586e-05\nQQQ,20041008 00:00,360800,366500,355000,356200,110280800,7.397073057093586e-05\nSPY,20041011 00:00,1127800,1130200,1126400,1128700,18952100,7.390050410079485e-05\nQQQ,20041011 00:00,357200,360600,356000,357500,50871400,7.390050410079485e-05\nSPY,20041012 00:00,1122000,1129500,1119400,1125300,37984800,7.391935173072038e-05\nQQQ,20041012 00:00,354400,358000,342300,357100,93088500,7.391935173072038e-05\nSPY,20041013 00:00,1130000,1130700,1113200,1116700,52363600,7.382017568777788e-05\nQQQ,20041013 00:00,360500,361400,348400,356600,126325100,7.382017568777788e-05\nSPY,20041014 00:00,1116800,1119300,1105800,1107000,62188900,7.398523462375123e-05\nQQQ,20041014 00:00,356800,357800,353300,354300,95862100,7.398523462375123e-05\nSPY,20041015 00:00,1110200,1126700,1105700,1111700,61272300,7.401862562291945e-05\nQQQ,20041015 00:00,355000,358600,344400,355800,130561600,7.401862562291945e-05\nSPY,20041018 00:00,1109100,1119600,1107000,1118000,41935800,7.431663955419401e-05\nQQQ,20041018 00:00,355100,362000,354000,361900,101332900,7.431663955419401e-05\nSPY,20041019 00:00,1120200,1144700,1007500,1107200,50433700,7.36831576581252e-05\nQQQ,20041019 00:00,363800,365700,358900,359100,122829800,7.36831576581252e-05\nSPY,20041020 00:00,1104000,1108800,1097500,1107100,54179800,7.349581779286271e-05\nQQQ,20041020 00:00,358300,362300,356500,360900,103808000,7.349581779286271e-05\nSPY,20041021 00:00,1107900,1113200,1102100,1110400,49232000,7.359715020459085e-05\nQQQ,20041021 00:00,362400,367900,351900,366400,112647100,7.359715020459085e-05\nSPY,20041022 00:00,1111800,1112500,1009400,1099500,45811600,7.316112732582977e-05\nQQQ,20041022 00:00,366000,366500,357400,357900,109420000,7.316112732582977e-05\nSPY,20041025 00:00,1097500,1101200,1093500,1098700,41245600,7.326107481146768e-05\nQQQ,20041025 00:00,357300,366500,354900,356100,99945900,7.326107481146768e-05\nSPY,20041026 00:00,1101300,1114300,1098800,1114000,47990100,7.337031893700236e-05\nQQQ,20041026 00:00,356600,358000,345000,357900,94993400,7.337031893700236e-05\nSPY,20041027 00:00,1113600,1131000,1111200,1129700,71710400,7.483857830229073e-05\nQQQ,20041027 00:00,358400,370000,357100,367700,154784400,7.483857830229073e-05\nSPY,20041028 00:00,1127600,1135600,1124900,1131700,52313400,7.294680391348244e-05\nQQQ,20041028 00:00,366700,371200,356700,369200,106664600,7.294680391348244e-05\nSPY,20041029 00:00,1131200,1160000,1105100,1133800,43958500,7.294170809255924e-05\nQQQ,20041029 00:00,369100,372400,366700,369000,97922700,7.294170809255924e-05\nSPY,20041101 00:00,1135600,1138400,1132000,1134900,35382400,7.293087833675059e-05\nQQQ,20041101 00:00,369700,371800,270500,370200,68724600,7.293087833675059e-05\nSPY,20041102 00:00,1136600,1145700,1132200,1135000,51994200,7.29500510028154e-05\nQQQ,20041102 00:00,370900,375500,370000,371500,105136100,7.29500510028154e-05\nSPY,20041103 00:00,1150000,1153600,1140000,1147700,72697500,7.249860776985609e-05\nQQQ,20041103 00:00,377600,379000,371500,373400,132787200,7.249860776985609e-05\nSPY,20041104 00:00,1147800,1166700,1146800,1165500,52191400,7.278057392380585e-05\nQQQ,20041104 00:00,372600,377800,371100,376400,109005800,7.278057392380585e-05\nSPY,20041105 00:00,1170200,1188400,1164900,1171000,58818600,7.291289777660513e-05\nQQQ,20041105 00:00,380200,381600,353100,379200,109332800,7.291289777660513e-05\nSPY,20041108 00:00,1170100,1172300,1167200,1170000,31567600,7.280164672570654e-05\nQQQ,20041108 00:00,379400,381000,378500,379800,65062400,7.280164672570654e-05\nSPY,20041109 00:00,1170800,1175000,1167600,1170000,41364900,7.276460953736935e-05\nQQQ,20041109 00:00,379400,381500,378100,380000,80383200,7.276460953736935e-05\nSPY,20041110 00:00,1170600,1175500,1167600,1169400,43129500,7.237763779453458e-05\nQQQ,20041110 00:00,379400,380600,373400,377400,92698600,7.237763779453458e-05\nSPY,20041111 00:00,1171800,1181200,1171000,1179900,35989400,7.287274197221868e-05\nQQQ,20041111 00:00,379200,383800,377200,383400,94573200,7.287274197221868e-05\nSPY,20041112 00:00,1179700,1189900,1173500,1189100,51980800,7.201342816671415e-05\nQQQ,20041112 00:00,383500,386800,381700,386600,98482200,7.201342816671415e-05\nSPY,20041115 00:00,1185000,1187300,1182300,1186700,33332800,7.197691479595478e-05\nQQQ,20041115 00:00,386500,388600,385000,388000,80057500,7.197691479595478e-05\nSPY,20041116 00:00,1183700,1186300,1177300,1177600,37279200,7.151843316955176e-05\nQQQ,20041116 00:00,386600,388300,383200,385200,94416500,7.151843316955176e-05\nSPY,20041117 00:00,1183600,1191400,1180700,1184000,52866900,7.144619675083216e-05\nQQQ,20041117 00:00,388500,393200,309000,390400,120965200,7.144619675083216e-05\nSPY,20041118 00:00,1185300,1188000,1182300,1186600,30321600,7.075592801606048e-05\nQQQ,20041118 00:00,389800,393600,388900,392900,92570200,7.075592801606048e-05\nSPY,20041119 00:00,1186800,1188700,1114700,1173200,52205900,7.126148059436145e-05\nQQQ,20041119 00:00,392400,392900,385900,386600,113559500,7.126148059436145e-05\nSPY,20041122 00:00,1171800,1181200,1170300,1179500,33744100,7.105892599988775e-05\nQQQ,20041122 00:00,386100,390400,384100,390200,77406800,7.105892599988775e-05\nSPY,20041123 00:00,1179300,1182600,1173700,1179700,39390300,7.104815667101668e-05\nQQQ,20041123 00:00,390100,391500,338900,388900,89658300,7.104815667101668e-05\nSPY,20041124 00:00,1182700,1185900,1180400,1185400,27437400,6.93097165636612e-05\nQQQ,20041124 00:00,391000,393900,390700,393600,71208900,6.93097165636612e-05\nSPY,20041126 00:00,1184900,1189800,1182600,1184000,15774700,6.93633433414332e-05\nQQQ,20041126 00:00,393600,394800,391700,392400,31350600,6.93633433414332e-05\nSPY,20041129 00:00,1187900,1190100,1174800,1181300,57211000,6.930360317418816e-05\nQQQ,20041129 00:00,394600,396400,389700,393000,91385800,6.930360317418816e-05\nSPY,20041130 00:00,1180000,1182400,1176400,1177700,44535700,6.936286761481618e-05\nQQQ,20041130 00:00,392900,393900,390600,391300,87409100,6.936286761481618e-05\nSPY,20110323 00:00,1289600,1300000,1283200,1296400,126368332,0.00023758666406180202\nQQQ,20110323 00:00,552000,558600,548200,557200,54175787,0.00023758666406180202\nSPY,20110324 00:00,1304600,1310800,1296800,1309000,124919412,0.00023800775873249294\nQQQ,20110324 00:00,561300,568200,558200,567300,62779061,0.00023800775873249294\nSPY,20110325 00:00,1312200,1318600,1309500,1312900,130636077,0.00023791963627963088\nQQQ,20110325 00:00,568800,572200,567600,568400,66809144,0.00023791963627963088\nSPY,20110328 00:00,1315700,1319200,1309400,1309400,76324619,0.0002379341637968627\nQQQ,20110328 00:00,570900,571000,565000,565100,31936709,0.0002379341637968627\nSPY,20110329 00:00,1308900,1318900,1304400,1318600,112305617,0.00023746933302586543\nQQQ,20110329 00:00,564000,570800,562400,570800,41471856,0.00023746933302586543\nSPY,20110330 00:00,1325800,1331500,1323600,1327000,110691781,0.00023744803046180717\nQQQ,20110330 00:00,573600,574300,570800,573600,41170128,0.00023744803046180717\nSPY,20110331 00:00,1326300,1329600,1324600,1325100,107390884,0.00023650355764939294\nQQQ,20110331 00:00,572700,574800,571600,574300,42075889,0.00023650355764939294\nSPY,20110401 00:00,1334500,1337700,1328400,1331500,132462581,0.000236480281914026\nQQQ,20110401 00:00,577200,579000,572900,574600,49725119,0.000236480281914026\nSPY,20110404 00:00,1334800,1336700,1328800,1332400,87692371,0.00023566419548425255\nQQQ,20110404 00:00,576300,576800,570200,572700,39049670,0.00023566419548425255\nSPY,20110405 00:00,1329500,1338300,1329400,1332400,102189817,0.0002357014645839726\nQQQ,20110405 00:00,571600,574900,570100,570900,45852649,0.0002357014645839726\nSPY,20110406 00:00,1338500,1340000,1331200,1336600,102531525,0.00023528734436830426\nQQQ,20110406 00:00,575600,577300,569300,572200,43043240,0.00023528734436830426\nSPY,20110407 00:00,1333900,1339400,1326600,1333200,166665573,0.00023527538916505767\nQQQ,20110407 00:00,572400,576000,568100,572300,51317888,0.00023527538916505767\nSPY,20110408 00:00,1338800,1339900,1323100,1328600,122011059,0.00023541954710460097\nQQQ,20110408 00:00,574700,575700,566500,569300,36391150,0.00023541954710460097\nSPY,20110411 00:00,1330100,1334500,1321400,1324700,105116572,0.00023463926202778023\nQQQ,20110411 00:00,571700,572900,565600,567700,37979835,0.00023463926202778023\nSPY,20110412 00:00,1317100,1319700,1309900,1314500,147011475,0.00023482086382250274\nQQQ,20110412 00:00,565000,566400,561500,563700,45706183,0.00023482086382250274\nSPY,20110413 00:00,1320900,1321800,1309700,1314500,131494341,0.00023478319409821723\nQQQ,20110413 00:00,567900,570000,564000,568500,45983815,0.00023478319409821723\nSPY,20110414 00:00,1306900,1317600,1302700,1315600,132675697,0.00023470577070788665\nQQQ,20110414 00:00,564600,568300,562300,567400,43891370,0.00023470577070788665\nSPY,20110415 00:00,1317800,1323700,1314100,1321200,127204358,0.00023460110718381843\nQQQ,20110415 00:00,565300,568700,562800,566500,58674418,0.00023460110718381843\nSPY,20110418 00:00,1305300,1308100,1295100,1305300,175212323,0.00023508850444363438\nQQQ,20110418 00:00,560800,562700,553300,562300,52309096,0.00023508850444363438\nSPY,20110419 00:00,1307500,1313500,1304400,1312800,103007172,0.00023440538483906874\nQQQ,20110419 00:00,564000,566000,561000,566000,30112824,0.00023440538483906874\nSPY,20110420 00:00,1328800,1333900,1328000,1331600,123308092,0.00023550871338439425\nQQQ,20110420 00:00,576000,579400,575300,578800,46608364,0.00023550871338439425\nSPY,20110421 00:00,1337500,1338300,1333500,1337400,90235439,0.0002355722874734779\nQQQ,20110421 00:00,584400,584700,581600,583400,33546679,0.0002355722874734779\nSPY,20110425 00:00,1336600,1338500,1332000,1336200,51582371,0.0002355417960830659\nQQQ,20110425 00:00,583900,585200,582800,584900,20071389,0.0002355417960830659\nSPY,20110426 00:00,1340500,1350500,1339100,1347900,116407987,0.00023475573185373832\nQQQ,20110426 00:00,586400,590300,585100,588300,41471881,0.00023475573185373832\nSPY,20110427 00:00,1350500,1358700,1345000,1356300,95956938,0.0002348366625902869\nQQQ,20110427 00:00,589300,592900,586600,592300,40010055,0.0002348366625902869\nSPY,20110428 00:00,1354200,1362900,1354100,1360400,101543480,0.00023477222868077346\nQQQ,20110428 00:00,590400,592300,588800,591700,38076882,0.00023477222868077346\nSPY,20110429 00:00,1361400,1365700,1359800,1365400,85741363,0.00023466213610531716\nQQQ,20110429 00:00,590200,592800,589800,591300,39023164,0.00023466213610531716\nSPY,20110502 00:00,1371000,1371800,1359500,1362500,103821177,0.0002345431116688746\nQQQ,20110502 00:00,591700,593400,588200,589700,44759093,0.0002345431116688746\nSPY,20110503 00:00,1359400,1361900,1350500,1357100,108602242,0.00023447146451238798\nQQQ,20110503 00:00,589400,590000,583300,587000,34248871,0.00023447146451238798\nSPY,20110504 00:00,1357000,1357300,1342400,1348600,158575567,0.00023425209400804842\nQQQ,20110504 00:00,587300,588700,581100,586100,48327411,0.00023425209400804842\nSPY,20110505 00:00,1340900,1349400,1330200,1336300,188183223,0.00023445337022938635\nQQQ,20110505 00:00,583100,589700,580800,583000,66104025,0.00023445337022938635\nSPY,20110506 00:00,1348800,1356200,1336800,1342000,184218970,0.00023447336359212376\nQQQ,20110506 00:00,588600,592000,583100,584700,61240812,0.00023447336359212376\nSPY,20110509 00:00,1342000,1351100,1339800,1347200,101087402,0.00023427552866570465\nQQQ,20110509 00:00,585700,589200,583400,586900,38139617,0.00023427552866570465\nSPY,20110510 00:00,1351500,1361100,1350100,1358700,96564068,0.0002344772651643574\nQQQ,20110510 00:00,588600,592800,587800,591900,35139127,0.0002344772651643574\nSPY,20110511 00:00,1356400,1356900,1338200,1344500,169055758,0.00023510450816429813\nQQQ,20110511 00:00,591000,593100,583600,587600,54260133,0.00023510450816429813\nSPY,20110512 00:00,1340700,1353600,1333900,1351000,151731104,0.0002350224874828922\nQQQ,20110512 00:00,585800,591900,582400,591100,55738060,0.0002350224874828922\nSPY,20110513 00:00,1351700,1353300,1335700,1340400,137536979,0.00023543832010725733\nQQQ,20110513 00:00,589700,590700,583900,584100,55298733,0.00023543832010725733\nSPY,20110516 00:00,1335400,1346000,1329700,1331900,123693366,0.00023540450741971457\nQQQ,20110516 00:00,581400,583100,572700,574000,64614401,0.00023540450741971457\nSPY,20110517 00:00,1327000,1333500,1321200,1331700,169691578,0.00023451806521080908\nQQQ,20110517 00:00,571000,575700,569900,575600,58413846,0.00023451806521080908\nSPY,20110518 00:00,1332600,1345000,1329500,1343800,113414741,0.000233715706729898\nQQQ,20110518 00:00,574800,581400,574100,580300,32175251,0.000233715706729898\nSPY,20110519 00:00,1347900,1350200,1339400,1346600,107562279,0.00023375559392440067\nQQQ,20110519 00:00,582200,583400,578500,582300,31424569,0.00023375559392440067\nSPY,20110520 00:00,1343100,1345200,1333600,1336700,151825718,0.00023402775140856112\nQQQ,20110520 00:00,581500,582100,576900,577600,37737127,0.00023402775140856112\nSPY,20110523 00:00,1319900,1324600,1315900,1320400,146936625,0.00023493478767804465\nQQQ,20110523 00:00,569800,571500,566500,569300,38695717,0.00023493478767804465\nSPY,20110524 00:00,1324200,1327300,1317000,1319500,125130970,0.00023497590875409607\nQQQ,20110524 00:00,570600,570700,565600,565800,33166887,0.00023497590875409607\nSPY,20110525 00:00,1313800,1329300,1313800,1323700,126797102,0.00023430221380543577\nQQQ,20110525 00:00,565000,570600,564700,567900,37202691,0.00023430221380543577\nSPY,20110526 00:00,1320000,1332400,1317800,1330100,141163316,0.00023437180912483192\nQQQ,20110526 00:00,566200,573000,566100,571500,35031021,0.00023437180912483192\nSPY,20110527 00:00,1333900,1338700,1331900,1335400,104585597,0.00023352266787865953\nQQQ,20110527 00:00,572400,574900,571900,574300,26563167,0.00023352266787865953\nSPY,20110531 00:00,1347800,1349000,1338400,1348900,137873991,0.00023396818384146956\nQQQ,20110531 00:00,579700,583600,576700,583600,41641015,0.00023396818384146956\nSPY,20110601 00:00,1345200,1346000,1317600,1318500,191089527,0.00023617811131625605\nQQQ,20110601 00:00,582200,583600,570400,570700,46076014,0.00023617811131625605\nSPY,20110602 00:00,1319800,1322300,1309600,1316900,171255274,0.00023586151796869143\nQQQ,20110602 00:00,572000,574100,568900,572100,46676655,0.00023586151796869143\nSPY,20110603 00:00,1301600,1314200,1300800,1304000,175974272,0.00023640380287913939\nQQQ,20110603 00:00,565500,569900,562700,563300,44579375,0.00023640380287913939\nSPY,20110606 00:00,1300900,1303600,1288700,1290500,150447026,0.00023657595892257065\nQQQ,20110606 00:00,562200,565300,558700,559000,41528641,0.00023657595892257065\nSPY,20110607 00:00,1296700,1300700,1288500,1288500,140942241,0.00023622999819662683\nQQQ,20110607 00:00,560400,562600,557600,557900,40292556,0.00023622999819662683\nSPY,20110608 00:00,1287700,1291900,1281800,1284000,172442254,0.0002363554293322029\nQQQ,20110608 00:00,556700,557700,552300,553800,41478680,0.0002363554293322029\nSPY,20110609 00:00,1287700,1299300,1284600,1294000,124608303,0.0002360727597549917\nQQQ,20110609 00:00,554100,557600,552300,554700,39398038,0.0002360727597549917\nSPY,20110610 00:00,1288300,1289300,1272600,1275600,200759581,0.00023705154095294702\nQQQ,20110610 00:00,552300,553400,545900,546200,50520598,0.00023705154095294702\nSPY,20110613 00:00,1278900,1282400,1270500,1276700,166838405,0.000236769516105729\nQQQ,20110613 00:00,546700,549300,544500,546300,34837062,0.000236769516105729\nSPY,20110614 00:00,1288800,1297700,1288200,1293200,135441318,0.00023729349882390603\nQQQ,20110614 00:00,550600,554700,550300,553300,36738832,0.00023729349882390603\nSPY,20110615 00:00,1282600,1286500,1266800,1270200,253954829,0.00023874103556143801\nQQQ,20110615 00:00,548100,551400,541800,543000,50513749,0.00023874103556143801\nSPY,20110616 00:00,1270900,1279700,1263200,1272800,235033145,0.0002386992947860458\nQQQ,20110616 00:00,543200,545000,536200,540800,49715263,0.0002386992947860458\nSPY,20110617 00:00,1279100,1279400,1266200,1270200,196654705,0.00023876860491989148\nQQQ,20110617 00:00,544000,545200,536400,537900,58145745,0.00023876860491989148\nSPY,20110620 00:00,1266000,1279700,1265800,1277000,118761833,0.00023850272580067396\nQQQ,20110620 00:00,536400,542300,536400,540700,33472582,0.00023850272580067396\nSPY,20110621 00:00,1283400,1297000,1281900,1294200,156360187,0.00023930165119435574\nQQQ,20110621 00:00,542600,552900,540300,552400,49103421,0.00023930165119435574\nSPY,20110622 00:00,1290500,1298100,1285900,1287000,149249226,0.00023955986893034782\nQQQ,20110622 00:00,550000,553200,548200,548400,32337397,0.00023955986893034782\nSPY,20110623 00:00,1270900,1283700,1261900,1282900,235834402,0.000239386257773983\nQQQ,20110623 00:00,542400,553600,540600,553400,67844594,0.000239386257773983\nSPY,20110624 00:00,1282800,1283700,1266200,1268100,164159526,0.00024034022392783102\nQQQ,20110624 00:00,550800,551300,542700,543800,43763114,0.00024034022392783102\nSPY,20110627 00:00,1269100,1284300,1266400,1279400,136843451,0.00023990883120040315\nQQQ,20110627 00:00,544400,555200,543300,552600,43430783,0.00023990883120040315\nSPY,20110628 00:00,1284300,1296300,1282700,1296100,140874843,0.00024044818497104438\nQQQ,20110628 00:00,553700,560800,552900,560600,36440865,0.00024044818497104438\nSPY,20110629 00:00,1301600,1309200,1297100,1307500,194592323,0.00023955066899970686\nQQQ,20110629 00:00,562000,564100,559000,563200,52950961,0.00023955066899970686\nSPY,20110630 00:00,1311500,1321800,1309900,1319700,175250888,0.00023910356538275375\nQQQ,20110630 00:00,565000,570900,564700,570500,43265519,0.00023910356538275375\nSPY,20110701 00:00,1319500,1341000,1317800,1339600,177311326,0.00023907273321934535\nQQQ,20110701 00:00,570800,579900,569300,579100,42594720,0.00023907273321934535\nSPY,20110705 00:00,1338000,1340800,1333900,1337100,143543355,0.00023763628493350068\nQQQ,20110705 00:00,579700,582600,578300,581900,39766322,0.00023763628493350068\nSPY,20110706 00:00,1334800,1341400,1331100,1339400,120813267,0.00023758503286472663\nQQQ,20110706 00:00,581300,584900,579400,583900,44754532,0.00023758503286472663\nSPY,20110707 00:00,1351300,1357000,1348800,1354600,135298236,0.00023755950673357506\nQQQ,20110707 00:00,588300,593600,587400,591900,44410702,0.00023755950673357506\nSPY,20110708 00:00,1338400,1344400,1333900,1344000,141569480,0.00023767611963445347\nQQQ,20110708 00:00,586800,590400,583700,590400,50288141,0.00023767611963445347\nSPY,20110711 00:00,1327300,1331800,1316600,1319600,153549170,0.0002383053543348213\nQQQ,20110711 00:00,584100,587100,577600,579600,43981033,0.0002383053543348213\nSPY,20110712 00:00,1316900,1327800,1313600,1314300,183267791,0.0002375534527649241\nQQQ,20110712 00:00,579500,580700,574600,575100,72832299,0.0002375534527649241\nSPY,20110713 00:00,1321100,1332200,1315200,1318500,175157447,0.00023751459839615771\nQQQ,20110713 00:00,579400,583400,575500,577600,69988061,0.00023751459839615771\nSPY,20110714 00:00,1321700,1327800,1306800,1309400,203950283,0.0002380139740092951\nQQQ,20110714 00:00,579100,581800,568700,570900,79795319,0.0002380139740092951\nSPY,20110715 00:00,1316400,1318700,1307700,1317400,181930028,0.0002366724295496263\nQQQ,20110715 00:00,577300,578500,573100,578500,59840643,0.0002366724295496263\nSPY,20110718 00:00,1310600,1312800,1296300,1305800,156024657,0.00023695784768379213\nQQQ,20110718 00:00,575300,577900,569800,575400,48404652,0.00023695784768379213\nSPY,20110719 00:00,1313500,1328900,1313100,1327800,141053959,0.00023765638009434173\nQQQ,20110719 00:00,580900,589000,580900,588600,53550605,0.00023765638009434173\nSPY,20110720 00:00,1330800,1331500,1324200,1326500,116123946,0.00023771788335305927\nQQQ,20110720 00:00,591800,591900,585000,586000,47110777,0.00023771788335305927\nSPY,20110721 00:00,1333900,1348200,1331400,1345200,210672957,0.00023791141066123873\nQQQ,20110721 00:00,586600,593200,583400,590000,61596367,0.00023791141066123873\nSPY,20110722 00:00,1345000,1347200,1337700,1346100,104151486,0.00023774944782321567\nQQQ,20110722 00:00,589600,597000,589200,596000,40488449,0.00023774944782321567\nSPY,20110725 00:00,1333300,1344900,1331600,1338300,118778460,0.00023715850013182916\nQQQ,20110725 00:00,591300,598100,590200,595000,45720071,0.00023715850013182916\nSPY,20110726 00:00,1337500,1339600,1330300,1333600,110478321,0.00023686085387543589\nQQQ,20110726 00:00,594400,598300,593200,596000,34684887,0.00023686085387543589\nSPY,20110727 00:00,1325800,1326000,1304300,1306000,227669341,0.00023905056131202004\nQQQ,20110727 00:00,592400,592900,579400,580900,73137508,0.00023905056131202004\nSPY,20110728 00:00,1306200,1317600,1300100,1301600,174850267,0.0002388927266828671\nQQQ,20110728 00:00,581200,589300,579000,581900,55346807,0.0002388927266828671\nSPY,20110729 00:00,1289000,1305500,1283600,1290500,259846955,0.00023911905878556822\nQQQ,20110729 00:00,577200,586100,574400,579700,75650701,0.00023911905878556822\nSPY,20110801 00:00,1309500,1309600,1275300,1287100,282573772,0.00023914167233061718\nQQQ,20110801 00:00,587000,588200,570300,577500,77841199,0.00023914167233061718\nSPY,20110802 00:00,1277700,1285000,1254900,1254900,277202501,0.00024101919338306236\nQQQ,20110802 00:00,574600,577200,562100,562700,82904125,0.00024101919338306236\nSPY,20110803 00:00,1256600,1263100,1235300,1262100,330037238,0.00024117494095305132\nQQQ,20110803 00:00,563400,568800,553500,568100,92910298,0.00024117494095305132\nSPY,20110804 00:00,1244200,1246200,1200700,1201800,425131235,0.0002504490886789308\nQQQ,20110804 00:00,560000,560900,541700,541700,115998085,0.0002504490886789308\nSPY,20110805 00:00,1219000,1220700,1168700,1199800,563324602,0.0002506886810843529\nQQQ,20110805 00:00,547200,550300,523200,538300,190960226,0.0002506886810843529\nSPY,20110808 00:00,1169800,1183500,1120200,1122600,575520736,0.0002665395938158321\nQQQ,20110808 00:00,521800,531200,505900,505900,191921886,0.0002665395938158321\nSPY,20110809 00:00,1142500,1174900,1102700,1173700,488407780,0.00027346377239208903\nQQQ,20110809 00:00,513500,530700,499300,530300,168633829,0.00027346377239208903\nSPY,20110810 00:00,1151800,1162800,1119600,1123500,437511075,0.0002805997591696907\nQQQ,20110810 00:00,518300,526000,508100,508600,168319667,0.0002805997591696907\nSPY,20110811 00:00,1134500,1189200,1128500,1172800,370920501,0.0002867436653402654\nQQQ,20110811 00:00,515900,536900,513400,531000,123262127,0.0002867436653402654\nSPY,20110812 00:00,1185500,1192100,1172800,1181500,268509211,0.0002869512235137605\nQQQ,20110812 00:00,534300,539000,528800,535700,77080960,0.0002869512235137605\nSPY,20110815 00:00,1192400,1207400,1190000,1205500,212752002,0.0002877209186658966\nQQQ,20110815 00:00,537900,543600,535300,543600,63012914,0.0002877209186658966\nSPY,20110816 00:00,1193400,1206900,1183100,1195600,244497729,0.0002880815119608824\nQQQ,20110816 00:00,538300,543500,531800,539000,79282047,0.0002880815119608824\nSPY,20110817 00:00,1203100,1211900,1187200,1196700,208918724,0.00028679389581252114\nQQQ,20110817 00:00,539700,544100,530200,535800,78082177,0.00028679389581252114\nSPY,20110818 00:00,1165000,1166400,1133900,1146100,425616854,0.00029504304541772876\nQQQ,20110818 00:00,521300,521400,504800,509500,114746166,0.00029504304541772876\nSPY,20110819 00:00,1129100,1158800,1125000,1126800,356095922,0.0002957734506119244\nQQQ,20110819 00:00,504200,516700,499900,500300,86478970,0.0002957734506119244\nSPY,20110822 00:00,1151200,1152300,1124100,1127300,242458988,0.0002955114675968946\nQQQ,20110822 00:00,512300,512400,500600,502100,69616648,0.0002955114675968946\nSPY,20110823 00:00,1131700,1165400,1125800,1164600,281355605,0.0003006445651369046\nQQQ,20110823 00:00,505500,522800,503400,522800,69654353,0.0003006445651369046\nSPY,20110824 00:00,1161800,1182400,1159300,1181300,207713990,0.0003009670418717319\nQQQ,20110824 00:00,521300,528000,517100,526900,65288345,0.0003009670418717319\nSPY,20110825 00:00,1188000,1194000,1158700,1163100,257738746,0.0003018267259368157\nQQQ,20110825 00:00,526600,529100,516500,518300,80546727,0.0003018267259368157\nSPY,20110826 00:00,1156600,1185100,1138600,1180400,270142650,0.00030265932517876227\nQQQ,20110826 00:00,516600,533100,511500,531300,87365378,0.00030265932517876227\nSPY,20110829 00:00,1195200,1214200,1194400,1213800,161544072,0.0003051387162308517\nQQQ,20110829 00:00,536600,546700,536400,546100,42669827,0.0003051387162308517\nSPY,20110830 00:00,1208600,1224300,1192600,1216200,211257778,0.00030475220974299314\nQQQ,20110830 00:00,544100,552900,541100,549700,57552324,0.00030475220974299314\nSPY,20110831 00:00,1224800,1235100,1213000,1220600,245536971,0.00030478380038343025\nQQQ,20110831 00:00,553000,557400,546000,550600,55341790,0.00030478380038343025\nSPY,20110901 00:00,1222500,1234000,1207800,1209600,224361524,0.00030519148607438643\nQQQ,20110901 00:00,552000,556400,544600,545600,49670668,0.00030519148607438643\nSPY,20110902 00:00,1184700,1190700,1174300,1178400,203457102,0.00030776908406355646\nQQQ,20110902 00:00,535800,538200,529900,532800,52630129,0.00030776908406355646\nSPY,20110906 00:00,1144300,1171600,1143800,1169900,246122470,0.0003071250908468213\nQQQ,20110906 00:00,520400,533700,519100,533000,50139050,0.0003071250908468213\nSPY,20110907 00:00,1188500,1203300,1183700,1202700,179440332,0.00030934188884644667\nQQQ,20110907 00:00,540500,546500,539000,546400,46182793,0.00030934188884644667\nSPY,20110908 00:00,1195900,1209300,1187800,1190200,217993064,0.00030959441502437907\nQQQ,20110908 00:00,543600,551600,542200,544000,53958349,0.00030959441502437907\nSPY,20110909 00:00,1176800,1181000,1152800,1158600,324360564,0.00031222845426347954\nQQQ,20110909 00:00,540100,542300,528500,531800,59865531,0.00031222845426347954\nSPY,20110912 00:00,1144900,1167600,1140500,1166600,266243906,0.00031246357403392794\nQQQ,20110912 00:00,525900,539000,525700,539000,60184754,0.00031246357403392794\nSPY,20110913 00:00,1170800,1181800,1162200,1175800,233871130,0.00031277024080142766\nQQQ,20110913 00:00,540600,546900,538100,545800,52431611,0.00031277024080142766\nSPY,20110914 00:00,1183200,1207800,1167200,1193600,262265087,0.0003120385866701914\nQQQ,20110914 00:00,548600,559800,543300,553600,74980813,0.0003120385866701914\nSPY,20110915 00:00,1205500,1214700,1195700,1214700,249832457,0.0003129206434350827\nQQQ,20110915 00:00,559600,562800,553900,561900,67055308,0.0003129206434350827\nSPY,20110916 00:00,1213100,1219500,1203200,1215800,241561427,0.00031285410273972823\nQQQ,20110916 00:00,562000,566500,561000,565900,83866394,0.00031285410273972823\nSPY,20110919 00:00,1195600,1209300,1187200,1203100,203129673,0.0003129352274149453\nQQQ,20110919 00:00,558900,569100,554300,566100,62092729,0.0003129352274149453\nSPY,20110920 00:00,1208300,1219900,1200100,1201700,197070638,0.00031296790861049927\nQQQ,20110920 00:00,569000,573500,562400,563600,56754267,0.00031296790861049927\nSPY,20110921 00:00,1202600,1205900,1165000,1165100,265304249,0.0003154270541258966\nQQQ,20110921 00:00,566500,569300,553700,553800,72511493,0.0003154270541258966\nSPY,20110922 00:00,1132800,1142100,1113000,1128000,421358975,0.00031939349684379447\nQQQ,20110922 00:00,539700,544600,527500,535800,138575219,0.00031939349684379447\nSPY,20110923 00:00,1121600,1141600,1120200,1135400,256734677,0.0003194972800435482\nQQQ,20110923 00:00,531300,543800,531000,541500,75107083,0.0003194972800435482\nSPY,20110926 00:00,1146400,1164000,1129800,1162500,239547138,0.0003191128176677979\nQQQ,20110926 00:00,544200,548700,532200,547800,89140914,0.0003191128176677979\nSPY,20110927 00:00,1185300,1195600,1168400,1176000,256192520,0.00031949590135093333\nQQQ,20110927 00:00,557100,562000,549800,553500,74075322,0.00031949590135093333\nSPY,20110928 00:00,1178300,1184800,1149700,1151600,259939999,0.0003201725573568166\nQQQ,20110928 00:00,555900,559700,544000,545300,72217551,0.0003201725573568166\nSPY,20110929 00:00,1171200,1176300,1139400,1160200,269136509,0.000319670267298495\nQQQ,20110929 00:00,553600,554300,529700,538800,104820025,0.000319670267298495\nSPY,20110930 00:00,1144500,1154400,1130800,1131700,248418973,0.00032167770197949876\nQQQ,20110930 00:00,531600,536100,524600,525200,90442657,0.00032167770197949876\nSPY,20111003 00:00,1125000,1139500,1098200,1099300,311460260,0.00032449093234434797\nQQQ,20111003 00:00,520200,528500,511100,511400,90873581,0.00032449093234434797\nSPY,20111004 00:00,1084300,1125800,1074300,1121300,417972274,0.0003259956556247379\nQQQ,20111004 00:00,506200,522900,501000,521900,123724379,0.0003259956556247379\nSPY,20111005 00:00,1125900,1147200,1115800,1145000,256163233,0.00032793484351993944\nQQQ,20111005 00:00,520600,536700,516600,535300,99358132,0.00032793484351993944\nSPY,20111006 00:00,1143500,1166600,1135200,1165100,227492632,0.0003289577140951063\nQQQ,20111006 00:00,534600,544300,532100,544300,65588150,0.0003289577140951063\nSPY,20111007 00:00,1171600,1172500,1150600,1157500,248676622,0.0003290487469377562\nQQQ,20111007 00:00,544000,546600,537200,540700,64010623,0.0003290487469377562\nSPY,20111010 00:00,1177200,1195900,1176700,1195900,198271905,0.00033312557370607546\nQQQ,20111010 00:00,549900,559400,548900,559400,43619939,0.00033312557370607546\nSPY,20111011 00:00,1188500,1200400,1187500,1196800,178972455,0.00033283689691257815\nQQQ,20111011 00:00,557900,564600,557000,563200,58409284,0.00033283689691257815\nSPY,20111012 00:00,1206000,1221300,1203300,1206700,242813965,0.0003329095620435425\nQQQ,20111012 00:00,568600,572300,565600,566400,71300836,0.0003329095620435425\nSPY,20111013 00:00,1200300,1208700,1191200,1204700,195568141,0.00033290593016955557\nQQQ,20111013 00:00,564900,571900,564300,571200,52844678,0.00033290593016955557\nSPY,20111014 00:00,1218600,1225800,1212300,1225600,172262036,0.00033393452157857073\nQQQ,20111014 00:00,578200,581900,575100,581900,56954894,0.00033393452157857073\nSPY,20111017 00:00,1219900,1220600,1199300,1202400,171627600,0.00033523450988774353\nQQQ,20111017 00:00,579100,580900,569800,572800,46380766,0.00033523450988774353\nSPY,20111018 00:00,1200800,1235000,1192000,1226100,268361142,0.00033594338306921085\nQQQ,20111018 00:00,571900,582900,566700,579900,77179052,0.00033594338306921085\nSPY,20111019 00:00,1223300,1230800,1207200,1211400,214042358,0.0003360688317441433\nQQQ,20111019 00:00,576700,578500,566800,568700,58308910,0.0003360688317441433\nSPY,20111020 00:00,1213600,1220900,1198200,1216900,237363342,0.000335810616023381\nQQQ,20111020 00:00,568600,569200,557900,565900,67802234,0.000335810616023381\nSPY,20111021 00:00,1230700,1241200,1227200,1239100,235785897,0.00033583283391610803\nQQQ,20111021 00:00,571900,576600,567800,573100,53809416,0.00033583283391610803\nSPY,20111024 00:00,1241400,1258000,1240600,1254900,183187923,0.00033672582595194726\nQQQ,20111024 00:00,575100,586500,574500,584900,50182465,0.00033672582595194726\nSPY,20111025 00:00,1249300,1249400,1227800,1230800,251450068,0.0003378704568095189\nQQQ,20111025 00:00,583000,583200,572200,573400,55321114,0.0003378704568095189\nSPY,20111026 00:00,1243500,1247700,1222100,1243300,269728092,0.000337692421241651\nQQQ,20111026 00:00,576600,577700,562200,572800,92943748,0.000337692421241651\nSPY,20111027 00:00,1277000,1294200,1266100,1285300,311523237,0.00034103083320108027\nQQQ,20111027 00:00,586400,592000,580400,588500,74564318,0.00034103083320108027\nSPY,20111028 00:00,1279800,1288500,1278000,1286800,195357919,0.0003410347536339699\nQQQ,20111028 00:00,585200,590100,584900,589400,38063135,0.0003410347536339699\nSPY,20111031 00:00,1272300,1272600,1253600,1254500,196077055,0.0003428264595297798\nQQQ,20111031 00:00,584300,586400,579100,579400,53551654,0.0003428264595297798\nSPY,20111101 00:00,1220000,1235100,1215200,1220800,327694121,0.00034585135478146017\nQQQ,20111101 00:00,565200,569700,561200,564400,84137143,0.00034585135478146017\nSPY,20111102 00:00,1238800,1244000,1228000,1239900,223203130,0.0003458825455198065\nQQQ,20111102 00:00,570300,571600,563900,569200,54890647,0.0003458825455198065\nSPY,20111103 00:00,1253100,1265000,1236000,1262400,250528531,0.0003471597703334983\nQQQ,20111103 00:00,573700,581800,567100,581000,60337389,0.0003471597703334983\nSPY,20111104 00:00,1252300,1257000,1240100,1254500,222714743,0.00034701856169842696\nQQQ,20111104 00:00,578200,580500,572200,578000,50649243,0.00034701856169842696\nSPY,20111107 00:00,1254300,1263900,1242000,1262800,190854662,0.0003458500496907069\nQQQ,20111107 00:00,577600,582500,571700,582100,50369039,0.0003458500496907069\nSPY,20111108 00:00,1269300,1280200,1257100,1278600,198356191,0.00034622418696937803\nQQQ,20111108 00:00,586300,589800,579700,588800,54497813,0.00034622418696937803\nSPY,20111109 00:00,1249100,1254600,1228700,1231900,258953226,0.00035072599203844095\nQQQ,20111109 00:00,577400,578300,566300,568100,60635255,0.00035072599203844095\nSPY,20111110 00:00,1248000,1249400,1230200,1243200,212759650,0.0003505990920422185\nQQQ,20111110 00:00,573700,574200,562300,567800,61401667,0.0003505990920422185\nSPY,20111111 00:00,1258600,1269900,1258000,1266200,160894568,0.00035132630248538294\nQQQ,20111111 00:00,572700,580200,572000,578500,44533763,0.00035132630248538294\nSPY,20111114 00:00,1262100,1263500,1249200,1254600,132357162,0.0003516853324872349\nQQQ,20111114 00:00,577100,580100,572800,574900,41619309,0.0003516853324872349\nSPY,20111115 00:00,1251200,1267500,1247200,1261200,161096614,0.0003517100224510101\nQQQ,20111115 00:00,573200,583600,572600,581300,49387714,0.0003517100224510101\nSPY,20111116 00:00,1248100,1263400,1239000,1240500,208022997,0.0003529913269913028\nQQQ,20111116 00:00,577100,581300,570600,571700,60799705,0.0003529913269913028\nSPY,20111117 00:00,1238400,1241600,1212300,1221800,289968098,0.0003545911525098658\nQQQ,20111117 00:00,570100,570400,554800,558300,89409830,0.0003545911525098658\nSPY,20111118 00:00,1224600,1227500,1214700,1219900,194731409,0.00035409219890440474\nQQQ,20111118 00:00,558400,559000,553000,554000,53680494,0.00035409219890440474\nSPY,20111121 00:00,1202100,1203400,1186600,1196200,196378704,0.00035577231197570636\nQQQ,20111121 00:00,546500,547300,537800,543400,45821220,0.00035577231197570636\nSPY,20111122 00:00,1193900,1201000,1185300,1191900,211395413,0.0003544427961926676\nQQQ,20111122 00:00,541700,546800,538800,545200,45616304,0.0003544427961926676\nSPY,20111123 00:00,1180700,1182000,1165600,1165600,187557531,0.0003547806201279544\nQQQ,20111123 00:00,541100,541700,532600,532900,44133473,0.0003547806201279544\nSPY,20111125 00:00,1163800,1177000,1162000,1162000,82609855,0.00035491700014708417\nQQQ,20111125 00:00,530600,536700,528900,529000,20866292,0.00035491700014708417\nSPY,20111128 00:00,1195300,1201800,1188200,1197000,187351680,0.00035790488691180656\nQQQ,20111128 00:00,541700,547900,541400,547200,42979123,0.00035790488691180656\nSPY,20111129 00:00,1200900,1208600,1196100,1200800,179062421,0.00035760273217275417\nQQQ,20111129 00:00,546900,551000,542300,543800,44688181,0.00035760273217275417\nSPY,20111130 00:00,1235000,1252200,1232200,1251100,251880591,0.00036258072400995484\nQQQ,20111130 00:00,558600,564400,556700,564200,55346352,0.00036258072400995484\nSPY,20111201 00:00,1248500,1256400,1244300,1249800,159154203,0.00036255785007341536\nQQQ,20111201 00:00,563800,569200,563500,567800,42152749,0.00036255785007341536\nSPY,20111202 00:00,1261400,1265000,1247800,1248600,177337985,0.0003619969376775673\nQQQ,20111202 00:00,573400,573400,565700,566200,32732541,0.0003619969376775673\nSPY,20111205 00:00,1268000,1271800,1254500,1262100,162251741,0.00036232347119472967\nQQQ,20111205 00:00,574700,576200,569200,572400,35244994,0.00036232347119472967\nSPY,20111206 00:00,1261700,1271100,1257600,1262600,131839611,0.0003614179491114406\nQQQ,20111206 00:00,572900,574500,568900,570800,35394447,0.0003614179491114406\nSPY,20111207 00:00,1258400,1272600,1249700,1267500,198050354,0.00036118645372962613\nQQQ,20111207 00:00,569200,573400,563500,570800,36626993,0.00036118645372962613\nSPY,20111208 00:00,1258800,1261800,1236500,1239800,209396519,0.0003626901313769852\nQQQ,20111208 00:00,567100,571500,560100,561100,43112494,0.0003626901313769852\nSPY,20111209 00:00,1245200,1263700,1244100,1260300,165468493,0.00036356892808219246\nQQQ,20111209 00:00,562600,571900,562400,570200,46365400,0.00036356892808219246\nSPY,20111212 00:00,1249100,1249700,1231600,1242400,178947251,0.0003643604993374309\nQQQ,20111212 00:00,564200,564500,559000,563800,49138135,0.0003643604993374309\nSPY,20111213 00:00,1249000,1255700,1224500,1231100,208440687,0.00036447664589593946\nQQQ,20111213 00:00,567500,569800,555300,557600,58665524,0.00036447664589593946\nSPY,20111214 00:00,1225900,1230200,1214700,1217100,209648393,0.00036531823200879374\nQQQ,20111214 00:00,555500,555900,545800,548900,57710086,0.00036531823200879374\nSPY,20111215 00:00,1231200,1232000,1219900,1221500,165196209,0.0003652348393571377\nQQQ,20111215 00:00,553600,554200,546600,547400,56613840,0.0003652348393571377\nSPY,20111216 00:00,1222100,1229500,1213000,1215700,176091223,0.00036465836656628066\nQQQ,20111216 00:00,548700,556100,547700,548600,54829554,0.00036465836656628066\nSPY,20111219 00:00,1220600,1223200,1200300,1203200,155423430,0.0003652125910704867\nQQQ,20111219 00:00,550700,552000,541700,543500,41414616,0.0003652125910704867\nSPY,20111220 00:00,1222300,1241400,1221700,1238800,174072018,0.0003683216309415575\nQQQ,20111220 00:00,552000,560000,551700,559500,62949475,0.0003683216309415575\nSPY,20111221 00:00,1239400,1243600,1227500,1241700,172629737,0.00036769094072794037\nQQQ,20111221 00:00,556000,556500,544900,551300,62746156,0.00036769094072794037\nSPY,20111222 00:00,1246400,1253900,1243600,1253300,107292214,0.00036753963179529106\nQQQ,20111222 00:00,552500,556200,551700,556000,30951391,0.00036753963179529106\nSPY,20111223 00:00,1256400,1264300,1254100,1263900,70389081,0.00036762806607116514\nQQQ,20111223 00:00,557100,560800,555900,560800,24062133,0.00036762806607116514\nSPY,20111227 00:00,1261500,1268200,1260600,1264900,67901152,0.0003675093142717336\nQQQ,20111227 00:00,559900,564200,559300,562400,19761204,0.0003675093142717336\nSPY,20111228 00:00,1265300,1265300,1247300,1249200,99876424,0.00036820323895434204\nQQQ,20111228 00:00,561700,562600,554500,555900,29940746,0.00036820323895434204\nSPY,20111229 00:00,1252100,1262500,1251800,1261000,92793923,0.0003681226914126063\nQQQ,20111229 00:00,556800,560300,555100,559900,24958839,0.0003681226914126063\nSPY,20111230 00:00,1259900,1263300,1255000,1255000,68634754,0.0003681960719597453\nQQQ,20111230 00:00,558700,561200,558200,558300,19592740,0.0003681960719597453\nSPY,20120103 00:00,1277500,1283800,1274400,1274900,153839622,0.0003691956947333092\nQQQ,20120103 00:00,569100,571900,567500,569000,36763716,0.0003691956947333092\nSPY,20120104 00:00,1271800,1278100,1267200,1276300,97719637,0.00036870952364767426\nQQQ,20120104 00:00,568100,572200,565600,571400,26818947,0.00036870952364767426\nSPY,20120105 00:00,1270100,1282300,1264300,1281000,125717608,0.0003687938626212972\nQQQ,20120105 00:00,570200,576600,568100,576100,36087054,0.0003687938626212972\nSPY,20120106 00:00,1282200,1282200,1272900,1278200,107707317,0.00036879261721019534\nQQQ,20120106 00:00,576200,579400,574100,577900,42716301,0.00036879261721019534\nSPY,20120109 00:00,1280400,1281800,1274100,1279900,73574543,0.00036871708362826616\nQQQ,20120109 00:00,579600,579800,574400,576200,35996640,0.00036871708362826616\nSPY,20120110 00:00,1293700,1296500,1289500,1291300,89928567,0.0003687850695991943\nQQQ,20120110 00:00,582300,584100,578900,580400,32991485,0.0003687850695991943\nSPY,20120111 00:00,1287500,1293700,1285200,1292500,89885776,0.00036744692925770204\nQQQ,20120111 00:00,580300,582900,578100,581600,33149554,0.00036744692925770204\nSPY,20120112 00:00,1295400,1297000,1285400,1295100,90072240,0.0003674289949687492\nQQQ,20120112 00:00,582900,584700,578600,583900,24233233,0.0003674289949687492\nSPY,20120113 00:00,1286600,1290100,1277200,1290100,140555253,0.0003675755436799165\nQQQ,20120113 00:00,580800,582000,576800,581800,32554172,0.0003675755436799165\nSPY,20120117 00:00,1301000,1303200,1290600,1293100,100741169,0.0003672694059010357\nQQQ,20120117 00:00,586900,589600,584900,587100,35561100,0.0003672694059010357\nSPY,20120118 00:00,1293500,1308400,1290800,1308000,121911064,0.00036769195114858043\nQQQ,20120118 00:00,588200,594900,587100,594900,43562388,0.00036769195114858043\nSPY,20120119 00:00,1312400,1315700,1308100,1314800,94452469,0.00036762702246816387\nQQQ,20120119 00:00,597300,599700,596500,598600,37413775,0.00036762702246816387\nSPY,20120120 00:00,1312300,1319500,1309200,1319500,92111257,0.0003675780840759466\nQQQ,20120120 00:00,596000,597900,595600,597700,34342484,0.0003675780840759466\nSPY,20120123 00:00,1315000,1322500,1309800,1315800,104367886,0.00036611220628459545\nQQQ,20120123 00:00,597800,602100,594400,597900,33819646,0.00036611220628459545\nSPY,20120124 00:00,1307700,1315000,1306000,1314600,80446736,0.0003661119027436133\nQQQ,20120124 00:00,595200,598400,594100,596700,29239003,0.0003661119027436133\nSPY,20120125 00:00,1312400,1328700,1307500,1325700,142742589,0.00036643671300233094\nQQQ,20120125 00:00,602600,605800,598400,604500,55563526,0.00036643671300233094\nSPY,20120126 00:00,1331500,1334000,1313700,1319000,136612555,0.00036644509138685275\nQQQ,20120126 00:00,606900,608000,599400,602200,33275864,0.00036644509138685275\nSPY,20120127 00:00,1311500,1320500,1311500,1317300,103843754,0.0003658332171274388\nQQQ,20120127 00:00,600900,605100,600600,604000,35014715,0.0003658332171274388\nSPY,20120130 00:00,1305000,1314400,1300600,1313800,111244083,0.00036527626156067843\nQQQ,20120130 00:00,598900,605400,596600,604400,38894772,0.00036527626156067843\nSPY,20120131 00:00,1320200,1321800,1306800,1312100,123069314,0.00036527829484217115\nQQQ,20120131 00:00,607500,608600,601400,605100,44869042,0.00036527829484217115\nSPY,20120201 00:00,1323100,1331400,1321300,1324700,123870829,0.0003654336534639723\nQQQ,20120201 00:00,608800,612400,606600,610200,39119430,0.0003654336534639723\nSPY,20120202 00:00,1327500,1330200,1322100,1326800,87353028,0.0003653048017525394\nQQQ,20120202 00:00,612200,614100,609700,612300,35620022,0.0003653048017525394\nSPY,20120203 00:00,1340300,1346200,1337700,1345700,108928852,0.00036553938284499123\nQQQ,20120203 00:00,617800,621200,616800,620500,32234737,0.00036553938284499123\nSPY,20120206 00:00,1339900,1345000,1338300,1344600,78933992,0.0003655406612085839\nQQQ,20120206 00:00,618200,620200,616600,620000,25805381,0.0003655406612085839\nSPY,20120207 00:00,1342000,1350200,1336400,1347900,105743604,0.0003652589609593957\nQQQ,20120207 00:00,619500,622500,616700,621300,34930746,0.0003652589609593957\nSPY,20120208 00:00,1348800,1352200,1343100,1351900,101030602,0.00036484913475413167\nQQQ,20120208 00:00,621600,624600,619100,624600,35271525,0.00036484913475413167\nSPY,20120209 00:00,1353900,1355800,1345700,1353400,115253050,0.00036486266670687984\nQQQ,20120209 00:00,627000,629800,623200,629300,40182582,0.00036486266670687984\nSPY,20120210 00:00,1341400,1344700,1338400,1344300,120730639,0.0003650615657992686\nQQQ,20120210 00:00,624600,626400,622500,624600,44286006,0.0003650615657992686\nSPY,20120213 00:00,1352900,1355200,1347400,1353600,90078617,0.00036412476108568965\nQQQ,20120213 00:00,629400,631300,626500,630500,28657953,0.00036412476108568965\nSPY,20120214 00:00,1349900,1352700,1342500,1351900,124259501,0.0003640773787323953\nQQQ,20120214 00:00,629100,632200,626900,631900,47560956,0.0003640773787323953\nSPY,20120215 00:00,1356400,1358300,1342900,1345400,151754087,0.00036416348938921636\nQQQ,20120215 00:00,635100,638600,626700,627700,83960618,0.00036416348938921636\nSPY,20120216 00:00,1345600,1361700,1343400,1360400,133245607,0.00036331199685331057\nQQQ,20120216 00:00,627900,637000,626300,636300,72560662,0.00036331199685331057\nSPY,20120217 00:00,1365200,1365700,1359600,1364100,96651581,0.00036326424157421834\nQQQ,20120217 00:00,636400,636900,631500,634300,61393177,0.00036326424157421834\nSPY,20120221 00:00,1367500,1370500,1360500,1364600,95051314,0.0003632759103133669\nQQQ,20120221 00:00,635000,638900,632100,636100,35205308,0.0003632759103133669\nSPY,20120222 00:00,1362000,1365500,1357900,1360200,95836135,0.00036339055010342207\nQQQ,20120222 00:00,635000,636800,632300,633200,39365682,0.00036339055010342207\nSPY,20120223 00:00,1359500,1367300,1355000,1366100,111498117,0.0003634507182678503\nQQQ,20120223 00:00,634100,638100,630900,637400,45138601,0.0003634507182678503\nSPY,20120224 00:00,1369500,1372000,1366300,1369300,85773667,0.0003633494738514319\nQQQ,20120224 00:00,639200,640700,638000,639600,38979636,0.0003633494738514319\nSPY,20120227 00:00,1360400,1375300,1358000,1371600,108707496,0.0003630215841382182\nQQQ,20120227 00:00,636100,642600,633300,640500,39766303,0.0003630215841382182\nSPY,20120228 00:00,1371900,1377200,1369300,1375600,98896749,0.00036300937740694176\nQQQ,20120228 00:00,641100,647000,640300,647000,39018968,0.00036300937740694176\nSPY,20120229 00:00,1377300,1381900,1367200,1368700,137944326,0.0003631638003613415\nQQQ,20120229 00:00,647500,649600,642000,644100,54577012,0.0003631638003613415\nSPY,20120301 00:00,1373200,1379900,1371200,1377700,110411453,0.0003632836120685186\nQQQ,20120301 00:00,646500,649700,644600,649200,54911277,0.0003632836120685186\nSPY,20120302 00:00,1376300,1378200,1370000,1373200,88920412,0.0003632913713313111\nQQQ,20120302 00:00,648300,650700,646600,648600,30305495,0.0003632913713313111\nSPY,20120305 00:00,1370500,1371900,1362800,1367500,96836494,0.00036309968134704793\nQQQ,20120305 00:00,648300,649000,639900,641900,42795104,0.00036309968134704793\nSPY,20120306 00:00,1352900,1354300,1343600,1346700,144814675,0.0003636925000511005\nQQQ,20120306 00:00,635700,637200,632300,635700,47127644,0.0003636925000511005\nSPY,20120307 00:00,1350600,1359100,1349300,1356900,103577541,0.00036385778836276486\nQQQ,20120307 00:00,638700,642100,637700,640700,38419162,0.00036385778836276486\nSPY,20120308 00:00,1365000,1373200,1362400,1370200,85876391,0.00036383521626129155\nQQQ,20120308 00:00,644400,649400,643000,647500,37968663,0.00036383521626129155\nSPY,20120309 00:00,1373600,1379300,1371300,1375700,91438907,0.0003636500262349644\nQQQ,20120309 00:00,648600,651400,648200,650200,37411668,0.0003636500262349644\nSPY,20120312 00:00,1375600,1377600,1370900,1375800,78786035,0.00036363163393886814\nQQQ,20120312 00:00,650000,651100,647200,650400,30365923,0.00036363163393886814\nSPY,20120313 00:00,1383800,1401200,1380900,1400600,158323337,0.0003638646151824105\nQQQ,20120313 00:00,654000,662600,652700,662600,55311490,0.0003638646151824105\nSPY,20120314 00:00,1400700,1404500,1394800,1399100,128829330,0.00036373389503004024\nQQQ,20120314 00:00,663300,667400,660800,664900,57130573,0.00036373389503004024\nSPY,20120315 00:00,1401200,1407800,1397600,1407200,137226098,0.0003637258624606832\nQQQ,20120315 00:00,666900,668200,663500,666800,61965237,0.0003637258624606832\nSPY,20120316 00:00,1403200,1404800,1400000,1402700,124840231,0.00036365002462286655\nQQQ,20120316 00:00,666700,666700,663600,665200,48925966,0.00036365002462286655\nSPY,20120319 00:00,1402000,1412800,1401100,1408800,109925153,0.0003636732260414682\nQQQ,20120319 00:00,666300,671500,664500,670000,49615270,0.0003636732260414682\nSPY,20120320 00:00,1400500,1406100,1396400,1404100,111240920,0.0003636754847467528\nQQQ,20120320 00:00,666400,671900,664700,671100,44077101,0.0003636754847467528\nSPY,20120321 00:00,1404600,1406500,1399200,1401600,108863774,0.00036359479531393213\nQQQ,20120321 00:00,671200,674900,670300,671200,35971792,0.00036359479531393213\nSPY,20120322 00:00,1391700,1395500,1387400,1391600,125466549,0.0001951424351950711\nQQQ,20120322 00:00,667200,671400,666800,669800,54412724,0.0001951424351950711\nSPY,20120323 00:00,1393700,1398100,1385500,1396900,92667075,0.00019447998038061705\nQQQ,20120323 00:00,670600,670800,665600,669500,39814758,0.00019447998038061705\nSPY,20120326 00:00,1406200,1416100,1406000,1416100,99701237,0.00019534845529602712\nQQQ,20120326 00:00,673900,681100,673300,681100,38349349,0.00019534845529602712\nSPY,20120327 00:00,1417400,1418300,1410800,1411300,92318657,0.00019525557153476003\nQQQ,20120327 00:00,681600,684900,681300,682200,32847019,0.00019525557153476003\nSPY,20120328 00:00,1410900,1413200,1396400,1404300,129945172,0.0001951210896742137\nQQQ,20120328 00:00,682500,685100,675400,679200,40649324,0.0001951210896742137\nSPY,20120329 00:00,1396200,1404200,1390900,1402200,149350733,0.00019505331310971553\nQQQ,20120329 00:00,676000,679300,672000,676800,46832930,0.00019505331310971553\nSPY,20120330 00:00,1409100,1410500,1400600,1407200,116418788,0.00019502207246626914\nQQQ,20120330 00:00,679800,680100,672800,675500,37902514,0.00019502207246626914\nSPY,20120402 00:00,1406400,1422100,1403700,1417900,124770859,0.0001953039195209004\nQQQ,20120402 00:00,674800,683400,673600,682500,37717634,0.0001953039195209004\nSPY,20120403 00:00,1416000,1418800,1404300,1412600,135974247,0.0001953270491651157\nQQQ,20120403 00:00,683000,685500,678500,682300,42032556,0.0001953270491651157\nSPY,20120404 00:00,1401700,1403300,1393400,1398400,136665920,0.00019591723604180542\nQQQ,20120404 00:00,677200,677600,669100,673000,52762020,0.00019591723604180542\nSPY,20120405 00:00,1394000,1402000,1392600,1397800,104649640,0.00019588438757610723\nQQQ,20120405 00:00,671900,677800,671300,677200,27725850,0.00019588438757610723\nSPY,20120409 00:00,1379400,1387800,1378400,1382300,102847154,0.0001962527548055074\nQQQ,20120409 00:00,668800,674800,667600,672100,33742301,0.0001962527548055074\nSPY,20120410 00:00,1379400,1383400,1357600,1358400,218274578,0.0001973368166957049\nQQQ,20120410 00:00,671800,674400,659200,661300,68159763,0.0001973368166957049\nSPY,20120411 00:00,1373300,1375400,1367500,1369000,132627770,0.00019741274874592277\nQQQ,20120411 00:00,667300,668900,662800,664400,63309580,0.00019741274874592277\nSPY,20120412 00:00,1371300,1389000,1370300,1388500,139019808,0.00019774997199822677\nQQQ,20120412 00:00,665600,672800,664900,671900,49887235,0.00019774997199822677\nSPY,20120413 00:00,1384600,1384800,1370100,1371300,139193450,0.00019855688114300447\nQQQ,20120413 00:00,669800,669900,661600,661800,53928212,0.00019855688114300447\nSPY,20120416 00:00,1378300,1380400,1365800,1369300,135725445,0.0001986413276771145\nQQQ,20120416 00:00,665200,665600,652500,654700,54508192,0.0001986413276771145\nSPY,20120417 00:00,1378600,1393600,1377000,1390900,120502872,0.0001998683197103983\nQQQ,20120417 00:00,657300,669900,656300,667800,43527031,0.0001998683197103983\nSPY,20120418 00:00,1384900,1390800,1383800,1385900,112671125,0.00019951712140196093\nQQQ,20120418 00:00,665900,670000,664100,666100,37969767,0.00019951712140196093\nSPY,20120419 00:00,1386000,1391400,1370700,1377500,183200752,0.0001996921646774771\nQQQ,20120419 00:00,663700,671700,656200,658700,76106897,0.0001996921646774771\nSPY,20120420 00:00,1382400,1388300,1378700,1379500,126288466,0.00019844628063534118\nQQQ,20120420 00:00,662200,665100,655800,656800,54846782,0.00019844628063534118\nSPY,20120423 00:00,1365500,1369100,1359400,1367900,143801646,0.000198658441195756\nQQQ,20120423 00:00,650600,651800,644900,650800,68043774,0.000198658441195756\nSPY,20120424 00:00,1368700,1376500,1368000,1373100,120700892,0.00019858273802737114\nQQQ,20120424 00:00,649600,652300,644500,647300,43306476,0.00019858273802737114\nSPY,20120425 00:00,1385600,1392500,1385300,1392400,133661106,0.00019984653032940617\nQQQ,20120425 00:00,660700,664900,659700,664600,51393392,0.00019984653032940617\nSPY,20120426 00:00,1389100,1403200,1388200,1401700,114664137,0.00019982981682992838\nQQQ,20120426 00:00,664400,669900,663500,668400,38380057,0.00019982981682992838\nSPY,20120427 00:00,1405600,1407800,1398000,1404200,104637129,0.00019988199216213024\nQQQ,20120427 00:00,671200,674500,667700,672500,42329050,0.00019988199216213024\nSPY,20120430 00:00,1401300,1402100,1394900,1397700,92165955,0.00020005181228738918\nQQQ,20120430 00:00,670400,671700,667100,667600,33528739,0.00020005181228738918\nSPY,20120501 00:00,1398100,1416600,1396300,1407400,115353699,0.0002000491447801899\nQQQ,20120501 00:00,666900,676200,665900,668700,34377955,0.0002000491447801899\nSPY,20120502 00:00,1399300,1404600,1394600,1402800,103011706,0.0001999354080696068\nQQQ,20120502 00:00,665400,671100,663900,670400,33011148,0.0001999354080696068\nSPY,20120503 00:00,1404000,1404500,1389900,1392500,123832837,0.00020021349863921908\nQQQ,20120503 00:00,671000,671500,661800,663400,48559532,0.00020021349863921908\nSPY,20120504 00:00,1385200,1386600,1369200,1369600,158063698,0.00020168409810924552\nQQQ,20120504 00:00,657400,658300,646900,646900,81890539,0.00020168409810924552\nSPY,20120507 00:00,1364800,1375600,1364700,1371000,108876105,0.00020164707900363388\nQQQ,20120507 00:00,643100,650700,642900,647600,47732112,0.00020164707900363388\nSPY,20120508 00:00,1363100,1367700,1349200,1365000,191348137,0.00020167517837124853\nQQQ,20120508 00:00,643500,647400,634800,645200,68416238,0.00020167517837124853\nSPY,20120509 00:00,1351000,1366000,1344900,1357400,201963421,0.00020145460978071453\nQQQ,20120509 00:00,637700,646800,635100,644100,75462234,0.00020145460978071453\nSPY,20120510 00:00,1367500,1368500,1357100,1359500,129264219,0.000201105803613464\nQQQ,20120510 00:00,646100,646300,639500,641700,44845941,0.000201105803613464\nSPY,20120511 00:00,1351600,1368700,1351100,1355600,135521665,0.00020100608147602367\nQQQ,20120511 00:00,639700,648600,639100,641800,44382143,0.00020100608147602367\nSPY,20120514 00:00,1343200,1350300,1339100,1341300,140800618,0.00020103244376770953\nQQQ,20120514 00:00,636300,640800,634800,635800,44440123,0.00020103244376770953\nSPY,20120515 00:00,1340500,1348100,1331300,1333500,177460833,0.0002006651478292237\nQQQ,20120515 00:00,637500,642700,632600,633700,62668343,0.0002006651478292237\nSPY,20120516 00:00,1339200,1345400,1328000,1328800,187878911,0.00020077245038098855\nQQQ,20120516 00:00,635900,637800,628100,629400,51374803,0.00020077245038098855\nSPY,20120517 00:00,1328800,1330200,1308100,1308700,212866150,0.0002017948752362496\nQQQ,20120517 00:00,629600,630600,616100,616100,59003423,0.0002017948752362496\nSPY,20120518 00:00,1314000,1316000,1295500,1297400,279229262,0.0002022082357457025\nQQQ,20120518 00:00,618000,619600,607700,608400,73078982,0.0002022082357457025\nSPY,20120521 00:00,1301400,1320200,1299500,1320200,148240929,0.0002038576746933398\nQQQ,20120521 00:00,609300,625700,608500,625100,53185463,0.0002038576746933398\nSPY,20120522 00:00,1323400,1332300,1313400,1322000,168227548,0.00020312477856524453\nQQQ,20120522 00:00,626900,629400,619900,624400,50607821,0.00020312477856524453\nSPY,20120523 00:00,1312600,1324600,1299900,1322700,190382180,0.00020310618270358484\nQQQ,20120523 00:00,619100,627100,613700,625600,54900351,0.00020310618270358484\nSPY,20120524 00:00,1326700,1328400,1314200,1325300,150009412,0.000203014708390173\nQQQ,20120524 00:00,626500,627100,616900,621500,78964489,0.000203014708390173\nSPY,20120525 00:00,1324800,1328500,1317800,1321000,117560211,0.0002029266574289861\nQQQ,20120525 00:00,622100,623200,618900,620700,30066834,0.0002029266574289861\nSPY,20120529 00:00,1331600,1339300,1327500,1337000,136971363,0.00020344545330110172\nQQQ,20120529 00:00,626500,631500,622800,628600,42850613,0.00020344545330110172\nSPY,20120530 00:00,1325900,1326200,1314900,1317300,137463079,0.0002033450237232307\nQQQ,20120530 00:00,622900,625500,616800,623200,51204984,0.0002033450237232307\nSPY,20120531 00:00,1317100,1324500,1303400,1314900,177358856,0.00020135336029990412\nQQQ,20120531 00:00,622500,624100,615900,620600,53276145,0.00020135336029990412\nSPY,20120601 00:00,1294100,1298500,1281600,1281600,204865682,0.00020408991585459924\nQQQ,20120601 00:00,609400,613200,603900,604100,64069771,0.00020408991585459924\nSPY,20120604 00:00,1284400,1287400,1271400,1281000,165707651,0.00020346014508563988\nQQQ,20120604 00:00,605800,609600,600400,608700,62970181,0.00020346014508563988\nSPY,20120605 00:00,1278800,1292600,1277900,1290300,142793334,0.00020322987171463372\nQQQ,20120605 00:00,606600,612400,606300,611200,44688151,0.00020322987171463372\nSPY,20120606 00:00,1299800,1320300,1299300,1320200,158440296,0.0002053115508064349\nQQQ,20120606 00:00,615800,625700,615200,625500,54662658,0.0002053115508064349\nSPY,20120607 00:00,1334900,1335300,1317800,1320500,161308954,0.0002051943821373775\nQQQ,20120607 00:00,631800,631800,622200,622700,36726970,0.0002051943821373775\nSPY,20120608 00:00,1317200,1331200,1312900,1331200,122247149,0.00020544733943485188\nQQQ,20120608 00:00,621700,629500,619600,628700,38502700,0.00020544733943485188\nSPY,20120611 00:00,1341900,1342500,1312800,1314500,147440040,0.00020535449260089246\nQQQ,20120611 00:00,633500,633800,617700,618900,48551584,0.00020535449260089246\nSPY,20120612 00:00,1318000,1330100,1311600,1330100,158037459,0.0002058276957139254\nQQQ,20120612 00:00,621000,625900,616800,625600,45167200,0.0002058276957139254\nSPY,20120613 00:00,1325000,1333600,1316200,1321000,156244332,0.00020542135296316129\nQQQ,20120613 00:00,623600,628500,619200,621300,47102026,0.00020542135296316129\nSPY,20120614 00:00,1323800,1340000,1319800,1335700,205109009,0.00020419428428145782\nQQQ,20120614 00:00,621200,626100,618000,623900,56303765,0.00020419428428145782\nSPY,20120615 00:00,1333500,1342600,1331100,1341000,140129470,0.00020436195804639934\nQQQ,20120615 00:00,623900,630800,623600,630100,36570234,0.00020436195804639934\nSPY,20120618 00:00,1335900,1347300,1332900,1344300,114237240,0.00020437518334298665\nQQQ,20120618 00:00,627300,637400,626300,635800,30886073,0.00020437518334298665\nSPY,20120619 00:00,1351300,1362500,1349300,1356900,123471677,0.00020464356347617881\nQQQ,20120619 00:00,639000,645100,638500,642600,35630853,0.00020464356347617881\nSPY,20120620 00:00,1357600,1361000,1344600,1354400,187408947,0.00020355163681481247\nQQQ,20120620 00:00,643800,645700,638100,642900,49194238,0.00020355163681481247\nSPY,20120621 00:00,1356700,1357800,1323300,1324400,183348690,0.00020564989456221298\nQQQ,20120621 00:00,642400,643100,626200,626900,41450098,0.00020564989456221298\nSPY,20120622 00:00,1331100,1337100,1326200,1334200,113139172,0.00020604740550772126\nQQQ,20120622 00:00,629000,634300,627400,633500,27808501,0.00020604740550772126\nSPY,20120625 00:00,1321000,1321000,1308500,1312600,127618191,0.0002065164440214619\nQQQ,20120625 00:00,628300,628500,619500,621200,32252091,0.0002065164440214619\nSPY,20120626 00:00,1316900,1323800,1309300,1320000,130178242,0.00020610383977202708\nQQQ,20120626 00:00,623400,627000,620600,625200,29212542,0.00020610383977202708\nSPY,20120627 00:00,1324000,1334300,1323100,1331700,93079408,0.00020558279048293247\nQQQ,20120627 00:00,627600,631800,626900,629000,30497453,0.00020558279048293247\nSPY,20120628 00:00,1323200,1329900,1312800,1327900,155144041,0.00020558556329586033\nQQQ,20120628 00:00,624300,624700,615400,621900,45148433,0.00020558556329586033\nSPY,20120629 00:00,1352400,1362700,1348500,1362700,171534507,0.0002083597109003731\nQQQ,20120629 00:00,634000,641600,632100,641600,41144040,0.0002083597109003731\nSPY,20120702 00:00,1365300,1366500,1355200,1364600,109683533,0.00020751154905009381\nQQQ,20120702 00:00,642500,643800,638700,643600,30680753,0.00020751154905009381\nSPY,20120703 00:00,1365100,1375100,1363400,1374700,71720585,0.00020776775986497534\nQQQ,20120703 00:00,643900,648900,642900,648900,15437730,0.00020776775986497534\nSPY,20120705 00:00,1369300,1374000,1362900,1368400,106181413,0.00020774879586582103\nQQQ,20120705 00:00,648300,652500,644800,649300,31506751,0.00020774879586582103\nSPY,20120706 00:00,1355600,1357600,1348500,1355900,122598176,0.0002076554441631516\nQQQ,20120706 00:00,646300,646900,636500,640900,33284419,0.0002076554441631516\nSPY,20120709 00:00,1354100,1355700,1347000,1353200,89161246,0.0002075770205193733\nQQQ,20120709 00:00,640500,642600,636800,640000,32944028,0.0002075770205193733\nSPY,20120710 00:00,1360800,1362300,1336800,1341400,136359914,0.00020657387968976674\nQQQ,20120710 00:00,643500,645000,631200,633700,43512723,0.00020657387968976674\nSPY,20120711 00:00,1342300,1346000,1333800,1341600,128650992,0.00020643695100905197\nQQQ,20120711 00:00,632900,634600,625000,630200,41678676,0.00020643695100905197\nSPY,20120712 00:00,1333900,1340900,1326000,1335100,129050301,0.00020658919546019552\nQQQ,20120712 00:00,625200,626900,618600,624200,51628007,0.00020658919546019552\nSPY,20120713 00:00,1338800,1358800,1338400,1357500,110927086,0.00020723181604116777\nQQQ,20120713 00:00,626000,635200,625600,633800,30505899,0.00020723181604116777\nSPY,20120716 00:00,1354200,1358300,1349000,1353900,82751324,0.00020697000168315042\nQQQ,20120716 00:00,632400,635200,629500,632000,26765032,0.00020697000168315042\nSPY,20120717 00:00,1360100,1366400,1345500,1363600,120755154,0.00020689420744995928\nQQQ,20120717 00:00,636000,637400,626300,635400,37756030,0.00020689420744995928\nSPY,20120718 00:00,1360200,1376400,1359600,1374100,101000531,0.0002057970790396417\nQQQ,20120718 00:00,634100,645800,633900,644000,37115491,0.0002057970790396417\nSPY,20120719 00:00,1376300,1381800,1372100,1377400,115912986,0.00020586332977974635\nQQQ,20120719 00:00,648400,653100,647200,651100,47864177,0.00020586332977974635\nSPY,20120720 00:00,1369800,1371600,1363200,1364700,124504674,0.00020601012634527117\nQQQ,20120720 00:00,650800,651000,642100,642800,37262421,0.00020601012634527117\nSPY,20120723 00:00,1344500,1354600,1338500,1350900,118466395,0.00020652731410183495\nQQQ,20120723 00:00,629900,636800,625100,634600,45625546,0.00020652731410183495\nSPY,20120724 00:00,1352000,1352500,1330300,1340300,145582265,0.00020674559517050735\nQQQ,20120724 00:00,635700,636600,625500,629500,51212540,0.00020674559517050735\nSPY,20120725 00:00,1342600,1345600,1332500,1339500,103594503,0.0002067847197324814\nQQQ,20120725 00:00,624700,629500,621500,625400,41543674,0.0002067847197324814\nSPY,20120726 00:00,1359100,1364600,1352600,1361700,125654874,0.00020549565135351532\nQQQ,20120726 00:00,634400,637300,629800,633800,38009342,0.00020549565135351532\nSPY,20120727 00:00,1369100,1390700,1366500,1388000,186380497,0.00020733846956554023\nQQQ,20120727 00:00,638300,649900,636400,649400,37453412,0.00020733846956554023\nSPY,20120730 00:00,1385700,1393300,1382700,1386800,94642715,0.00020719663169422504\nQQQ,20120730 00:00,650300,653100,646000,648200,34613776,0.00020719663169422504\nSPY,20120731 00:00,1385100,1388700,1377100,1377100,101993870,0.00020716985010859837\nQQQ,20120731 00:00,649200,651800,647400,648000,31813913,0.00020716985010859837\nSPY,20120801 00:00,1387200,1387300,1374000,1375900,120308711,0.0002045283871153754\nQQQ,20120801 00:00,652600,652700,643500,646100,25812266,0.0002045283871153754\nSPY,20120802 00:00,1365400,1375600,1355900,1366400,162944408,0.00020446669694021256\nQQQ,20120802 00:00,641200,650200,639100,643700,36673691,0.00020446669694021256\nSPY,20120803 00:00,1386000,1396400,1385000,1393900,125877370,0.0001968209751345916\nQQQ,20120803 00:00,654200,658800,651900,656100,36050002,0.0001968209751345916\nSPY,20120806 00:00,1397000,1401700,1395600,1396200,73331353,0.00019677910660807958\nQQQ,20120806 00:00,659400,663900,658000,661100,22631713,0.00019677910660807958\nSPY,20120807 00:00,1402000,1409200,1401500,1403200,91323457,0.00018099622620537754\nQQQ,20120807 00:00,663700,669200,662800,666700,26767704,0.00018099622620537754\nSPY,20120808 00:00,1398200,1406400,1398100,1404900,77895539,0.00017261332878801386\nQQQ,20120808 00:00,664800,667600,663700,666200,19135858,0.00017261332878801386\nSPY,20120809 00:00,1403000,1408900,1401500,1406300,78981598,0.0001653071381744064\nQQQ,20120809 00:00,666100,669100,664900,668200,19523612,0.0001653071381744064\nSPY,20120810 00:00,1400700,1408900,1398100,1408400,91051646,0.00015794883366998627\nQQQ,20120810 00:00,665800,668800,664100,668500,19168159,0.00015794883366998627\nSPY,20120813 00:00,1406000,1408400,1400400,1407700,71864462,0.00015773255388447206\nQQQ,20120813 00:00,668400,670300,665000,670300,18910475,0.00015773255388447206\nSPY,20120814 00:00,1412800,1413800,1403700,1407900,85796080,0.0001566578975700004\nQQQ,20120814 00:00,672700,674100,668600,670500,20286640,0.0001566578975700004\nSPY,20120815 00:00,1406400,1411900,1405500,1409500,63862368,0.00015632634834110144\nQQQ,20120815 00:00,670000,673100,669900,672300,22419947,0.00015632634834110144\nSPY,20120816 00:00,1410900,1421600,1408000,1420100,94540455,0.00015662131376973658\nQQQ,20120816 00:00,674700,681700,673900,680200,29030753,0.00015662131376973658\nSPY,20120817 00:00,1422500,1423000,1418600,1422200,77899419,0.00014799920547160387\nQQQ,20120817 00:00,681700,683300,680100,683200,21264247,0.00014799920547160387\nSPY,20120820 00:00,1420100,1422200,1416000,1422200,65230362,0.00014662633744714967\nQQQ,20120820 00:00,682700,684300,680000,684200,22313144,0.00014662633744714967\nSPY,20120821 00:00,1425200,1430900,1414500,1417600,91504684,0.0001467223045695674\nQQQ,20120821 00:00,686000,688800,678800,681400,37157407,0.0001467223045695674\nSPY,20120822 00:00,1413800,1420500,1410700,1418200,113612822,0.00014158995687915804\nQQQ,20120822 00:00,680000,685600,678100,684000,40101626,0.00014158995687915804\nSPY,20120823 00:00,1414500,1414800,1404400,1406800,98981571,0.00014153983246885095\nQQQ,20120823 00:00,681200,683400,677000,678700,27052207,0.00014153983246885095\nSPY,20120824 00:00,1403000,1418100,1402200,1415200,84633688,0.0001405165125281029\nQQQ,20120824 00:00,677100,684500,676000,682900,35213527,0.0001405165125281029\nSPY,20120827 00:00,1419000,1420800,1413400,1415400,59637252,0.00013917409665144856\nQQQ,20120827 00:00,685800,686700,682500,684000,19744080,0.00013917409665144856\nSPY,20120828 00:00,1411700,1418400,1409700,1414000,67508199,0.00013623495538357615\nQQQ,20120828 00:00,683400,685800,681100,684000,28985608,0.00013623495538357615\nSPY,20120829 00:00,1414800,1418900,1411200,1415100,60586630,0.00013620530829355052\nQQQ,20120829 00:00,684000,685700,681100,684000,20575956,0.00013620530829355052\nSPY,20120830 00:00,1409000,1409400,1401900,1404900,87670205,0.00013654603517334812\nQQQ,20120830 00:00,681000,681300,676000,677000,23632687,0.00013654603517334812\nSPY,20120831 00:00,1413200,1418200,1403600,1412400,130393446,0.00013626987386218658\nQQQ,20120831 00:00,682000,684500,674700,681600,35385449,0.00013626987386218658\nSPY,20120904 00:00,1410900,1414600,1401300,1408700,101328393,0.00013371162478155075\nQQQ,20120904 00:00,680300,683500,674200,680900,29397848,0.00013371162478155075\nSPY,20120905 00:00,1411000,1414700,1406300,1409400,84134821,0.00013369270053835352\nQQQ,20120905 00:00,680600,683500,678400,680200,23918420,0.00013369270053835352\nSPY,20120906 00:00,1417900,1437800,1417600,1437800,131300165,0.00013267449624923086\nQQQ,20120906 00:00,684400,695400,684200,695000,40867097,0.00013267449624923086\nSPY,20120907 00:00,1440200,1443900,1438800,1443900,82439521,0.00013240431465721248\nQQQ,20120907 00:00,693700,695500,692300,694300,27713573,0.00013240431465721248\nSPY,20120910 00:00,1442100,1444400,1434600,1435100,72407250,0.00013021927380285037\nQQQ,20120910 00:00,692500,694000,684900,685500,24396248,0.00013021927380285037\nSPY,20120911 00:00,1436300,1443700,1435600,1438900,71392996,0.00012990150000205745\nQQQ,20120911 00:00,685500,688200,683200,684300,27143461,0.00012990150000205745\nSPY,20120912 00:00,1443800,1445500,1439000,1443900,76655733,0.00012960211619917372\nQQQ,20120912 00:00,686800,688100,682100,686600,40555722,0.00012960211619917372\nSPY,20120913 00:00,1443300,1470400,1441500,1467000,176699165,0.00012959401174907108\nQQQ,20120913 00:00,686900,698500,686200,695800,44038688,0.00012959401174907108\nSPY,20120914 00:00,1468900,1481100,1467600,1472400,149771595,0.0001287419168167405\nQQQ,20120914 00:00,698100,704300,697900,701900,36946349,0.0001287419168167405\nSPY,20120917 00:00,1469500,1471900,1463700,1467400,93464487,0.0001287508901645078\nQQQ,20120917 00:00,702200,702400,699600,702100,29362698,0.0001287508901645078\nSPY,20120918 00:00,1465300,1468100,1462500,1466200,81839586,0.00012872549597805707\nQQQ,20120918 00:00,700300,703000,700200,702700,25058283,0.00012872549597805707\nSPY,20120919 00:00,1467600,1471700,1464100,1467400,97491385,0.00012868226014138066\nQQQ,20120919 00:00,702600,705800,700600,704000,29978142,0.00012868226014138066\nSPY,20120920 00:00,1460000,1467900,1456300,1467500,126125706,0.0001263923727650568\nQQQ,20120920 00:00,700600,704000,698700,703200,29054672,0.0001263923727650568\nSPY,20120921 00:00,1466400,1470000,1458100,1458900,92863680,0.00012207818423474976\nQQQ,20120921 00:00,704800,705400,700800,701800,21632845,0.00012207818423474976\nSPY,20120924 00:00,1451600,1459800,1450500,1455900,81529919,0.00012197191526456367\nQQQ,20120924 00:00,695700,698600,694300,696800,28205592,0.00012197191526456367\nSPY,20120925 00:00,1459600,1462400,1440600,1441900,116957213,0.00012160487461720083\nQQQ,20120925 00:00,699200,700800,687300,687600,39282700,0.00012160487461720083\nSPY,20120926 00:00,1441100,1441100,1429600,1432900,128852225,0.00012145760011736354\nQQQ,20120926 00:00,686700,687100,678600,682000,31348419,0.00012145760011736354\nSPY,20120927 00:00,1438800,1449700,1435100,1447200,96575805,0.00012057132564337766\nQQQ,20120927 00:00,683700,693000,682500,691600,23492190,0.00012057132564337766\nSPY,20120928 00:00,1440100,1445500,1434600,1439300,127590894,0.00012114763842200893\nQQQ,20120928 00:00,689100,691200,685100,685800,27258871,0.00012114763842200893\nSPY,20121001 00:00,1445000,1456900,1440200,1442400,120196114,0.00011845800574986088\nQQQ,20121001 00:00,689000,693300,682500,684700,33653093,0.00011845800574986088\nSPY,20121002 00:00,1449000,1451500,1438300,1445000,102440134,0.00011521310989737634\nQQQ,20121002 00:00,687700,689800,681400,686700,30198566,0.00011521310989737634\nSPY,20121003 00:00,1448800,1454300,1441300,1450700,104035525,0.00011381332084658764\nQQQ,20121003 00:00,688600,692400,685900,690900,34352509,0.00011381332084658764\nSPY,20121004 00:00,1456300,1463300,1454400,1462700,110972345,0.00011192545889267\nQQQ,20121004 00:00,692200,695400,690000,693500,21279480,0.00011192545889267\nSPY,20121005 00:00,1469200,1471500,1457000,1461300,102439846,0.00011093472704255187\nQQQ,20121005 00:00,697000,698000,688100,689800,23591888,0.00011093472704255187\nSPY,20121008 00:00,1455800,1458900,1453100,1456600,70711413,0.00011087634865468378\nQQQ,20121008 00:00,685700,687200,682000,683500,28687851,0.00011087634865468378\nSPY,20121009 00:00,1455200,1456400,1441500,1442500,133493925,0.00010725065287813075\nQQQ,20121009 00:00,681400,681800,671000,672600,53433015,0.00010725065287813075\nSPY,20121010 00:00,1442000,1443200,1430900,1432800,112051156,0.00010742561511788593\nQQQ,20121010 00:00,672400,674300,668000,669200,44123172,0.00010742561511788593\nSPY,20121011 00:00,1442800,1444900,1433600,1433600,104250608,0.00010728024926240117\nQQQ,20121011 00:00,674200,674700,666700,667100,27871688,0.00010728024926240117\nSPY,20121012 00:00,1434400,1439500,1425900,1428400,106195956,0.00010737423270952578\nQQQ,20121012 00:00,667000,670600,665500,666800,23416702,0.00010737423270952578\nSPY,20121015 00:00,1432300,1442300,1427700,1440100,89763067,0.00010637092562430409\nQQQ,20121015 00:00,669300,672600,665300,671600,21166650,0.00010637092562430409\nSPY,20121016 00:00,1447600,1456400,1446600,1455800,93647156,0.00010565859142825112\nQQQ,20121016 00:00,672700,682000,672500,681500,28134152,0.00010565859142825112\nSPY,20121017 00:00,1456300,1463200,1454200,1461600,97927398,0.00010475983494730211\nQQQ,20121017 00:00,677700,683000,676800,681000,31303904,0.00010475983494730211\nSPY,20121018 00:00,1458500,1465200,1453300,1458600,126316151,0.0001038785841041657\nQQQ,20121018 00:00,678600,680700,670400,673200,55260383,0.0001038785841041657\nSPY,20121019 00:00,1455000,1455600,1430500,1433000,161433193,0.00010581127175094642\nQQQ,20121019 00:00,672100,672700,656000,656600,59625000,0.00010581127175094642\nSPY,20121022 00:00,1432000,1436700,1422800,1434100,112027680,0.00010496693200722352\nQQQ,20121022 00:00,656500,661900,655000,660200,32936008,0.00010496693200722352\nSPY,20121023 00:00,1418800,1420600,1408300,1413500,166634827,0.00010459730215234903\nQQQ,20121023 00:00,654800,659500,651900,653900,43623312,0.00010459730215234903\nSPY,20121024 00:00,1419400,1421000,1408000,1410500,101447368,0.00010305694888970258\nQQQ,20121024 00:00,657400,658700,650600,651200,34929069,0.00010305694888970258\nSPY,20121025 00:00,1420700,1422800,1405700,1414300,114919471,0.00010311897537834878\nQQQ,20121025 00:00,656300,657200,649700,651600,31951144,0.00010311897537834878\nSPY,20121026 00:00,1413200,1418400,1403900,1413500,118933565,9.954335377266313e-05\nQQQ,20121026 00:00,651600,656200,646600,653500,44286059,9.954335377266313e-05\nSPY,20121031 00:00,1418400,1420300,1406800,1411800,85205741,9.958274770627764e-05\nQQQ,20121031 00:00,652700,653900,647300,649500,33458499,9.958274770627764e-05\nSPY,20121101 00:00,1416600,1430100,1415200,1429100,89011864,9.846287514974115e-05\nQQQ,20121101 00:00,653600,660000,651700,659000,23978633,9.846287514974115e-05\nSPY,20121102 00:00,1437200,1437200,1414100,1415600,113381608,9.605645116834185e-05\nQQQ,20121102 00:00,661700,662100,651100,651300,34921840,9.605645116834185e-05\nSPY,20121105 00:00,1413700,1421700,1409300,1419000,85689537,9.56303066805924e-05\nQQQ,20121105 00:00,651800,657300,650500,655900,25224623,9.56303066805924e-05\nSPY,20121106 00:00,1422700,1435200,1421300,1429300,92986054,9.426819376169964e-05\nQQQ,20121106 00:00,657100,661700,654600,657500,28572692,9.426819376169964e-05\nSPY,20121107 00:00,1416500,1416800,1390700,1397800,225343099,9.63196077186445e-05\nQQQ,20121107 00:00,650200,651000,639100,641700,53586406,9.63196077186445e-05\nSPY,20121108 00:00,1397200,1404100,1379500,1379500,157175132,9.702687031551814e-05\nQQQ,20121108 00:00,643500,645000,631600,631600,50947971,9.702687031551814e-05\nSPY,20121109 00:00,1376100,1394400,1375600,1381600,176223379,9.650598322034093e-05\nQQQ,20121109 00:00,632000,641100,631600,634300,42488190,9.650598322034093e-05\nSPY,20121112 00:00,1385500,1388100,1379600,1382400,86603151,9.126771564732439e-05\nQQQ,20121112 00:00,638000,638700,632500,634200,28916502,9.126771564732439e-05\nSPY,20121113 00:00,1375200,1392500,1373600,1378000,109828367,9.140621645477037e-05\nQQQ,20121113 00:00,629300,635800,627900,630000,36400463,9.140621645477037e-05\nSPY,20121114 00:00,1382100,1384300,1356200,1359800,169918714,9.074276272316428e-05\nQQQ,20121114 00:00,632900,633600,621400,622500,56182834,9.074276272316428e-05\nSPY,20121115 00:00,1359500,1364900,1351800,1357000,160925393,9.053102394352103e-05\nQQQ,20121115 00:00,622800,624900,618000,620300,42096592,9.053102394352103e-05\nSPY,20121116 00:00,1359200,1366400,1347000,1363500,213614223,9.037670231188991e-05\nQQQ,20121116 00:00,620800,624700,613100,622500,58234840,9.037670231188991e-05\nSPY,20121119 00:00,1379200,1391500,1378300,1391500,125631368,9.117783736284783e-05\nQQQ,20121119 00:00,629800,638300,629600,637800,38198026,9.117783736284783e-05\nSPY,20121120 00:00,1388900,1394200,1380800,1392800,99716218,8.968682980117455e-05\nQQQ,20121120 00:00,637600,638900,631900,638000,49504314,8.968682980117455e-05\nSPY,20121121 00:00,1393100,1395700,1390300,1394500,66253719,8.962030769209772e-05\nQQQ,20121121 00:00,638700,640200,636000,639300,17220668,8.962030769209772e-05\nSPY,20121123 00:00,1401400,1414000,1400400,1413300,53475754,8.876045079060754e-05\nQQQ,20121123 00:00,642900,649200,642600,648800,14765872,8.876045079060754e-05\nSPY,20121126 00:00,1406900,1411700,1401900,1411700,86491321,8.877360230706551e-05\nQQQ,20121126 00:00,647400,652100,645400,652000,25751224,8.877360230706551e-05\nSPY,20121127 00:00,1409100,1413800,1402400,1403800,113949581,8.676359695144511e-05\nQQQ,20121127 00:00,651700,654000,648500,649600,24818422,8.676359695144511e-05\nSPY,20121128 00:00,1397700,1415400,1390000,1414800,153889115,8.685391093000146e-05\nQQQ,20121128 00:00,646500,655700,642500,655200,35557704,8.685391093000146e-05\nSPY,20121129 00:00,1420200,1425000,1413700,1421600,132400376,8.301215190360334e-05\nQQQ,20121129 00:00,658700,661300,655800,659100,37418115,8.301215190360334e-05\nSPY,20121130 00:00,1421700,1424200,1416700,1420600,115188920,8.309482176403945e-05\nQQQ,20121130 00:00,659400,659700,656100,658000,31125755,8.309482176403945e-05\nSPY,20121203 00:00,1428100,1429200,1413400,1414700,103003304,7.708335861279526e-05\nQQQ,20121203 00:00,663100,663700,656500,657200,25878210,7.708335861279526e-05\nSPY,20121204 00:00,1414400,1418700,1408700,1412200,110768908,7.714433621537735e-05\nQQQ,20121204 00:00,657000,657700,652000,655800,44808964,7.714433621537735e-05\nSPY,20121205 00:00,1414100,1421600,1403800,1415000,134509723,7.706128480607133e-05\nQQQ,20121205 00:00,655300,655500,645500,649100,47567533,7.706128480607133e-05\nSPY,20121206 00:00,1413700,1420400,1411600,1419100,81136204,7.668451213150704e-05\nQQQ,20121206 00:00,647000,654800,645300,652800,39736556,7.668451213150704e-05\nSPY,20121207 00:00,1425200,1426900,1416700,1424000,89962391,7.661168186605861e-05\nQQQ,20121207 00:00,656400,657100,647100,649200,27348745,7.661168186605861e-05\nSPY,20121210 00:00,1422200,1428100,1421500,1425200,77982728,7.662264001272271e-05\nQQQ,20121210 00:00,647500,654600,647500,651200,28014274,7.662264001272271e-05\nSPY,20121211 00:00,1430700,1441100,1429900,1434200,120603702,7.533389670111637e-05\nQQQ,20121211 00:00,655700,663400,655200,659700,35501364,7.533389670111637e-05\nSPY,20121212 00:00,1440100,1445500,1433100,1435400,120477188,7.434188251628841e-05\nQQQ,20121212 00:00,663200,663200,656500,658300,42455798,7.434188251628841e-05\nSPY,20121213 00:00,1434400,1438300,1422800,1426600,112947114,7.386397587273856e-05\nQQQ,20121213 00:00,657000,661600,650300,653300,39545132,7.386397587273856e-05\nSPY,20121214 00:00,1423200,1425800,1418800,1421200,104037074,7.359696299505828e-05\nQQQ,20121214 00:00,648700,650800,644700,646900,37638441,7.359696299505828e-05\nSPY,20121217 00:00,1425000,1438500,1424300,1437900,111442822,7.337364785723978e-05\nQQQ,20121217 00:00,647500,655700,646600,655500,38906421,7.337364785723978e-05\nSPY,20121218 00:00,1440000,1455000,1437900,1454100,145326291,7.403562985859019e-05\nQQQ,20121218 00:00,658800,666500,657000,665700,49257715,7.403562985859019e-05\nSPY,20121219 00:00,1455500,1455800,1442400,1442700,128974934,7.426242235854186e-05\nQQQ,20121219 00:00,667400,667600,662200,662400,32478335,7.426242235854186e-05\nSPY,20121220 00:00,1443600,1451400,1439900,1451400,111467367,7.380735020649375e-05\nQQQ,20121220 00:00,663800,664100,659300,662600,34733567,7.380735020649375e-05\nSPY,20121221 00:00,1422000,1431000,1419400,1427700,177975926,7.166891603529102e-05\nQQQ,20121221 00:00,648800,652800,646000,651700,44719518,7.166891603529102e-05\nSPY,20121224 00:00,1424500,1425600,1421900,1423300,38187479,7.180848128375464e-05\nQQQ,20121224 00:00,650300,651400,649200,650700,9921678,7.180848128375464e-05\nSPY,20121226 00:00,1426200,1427100,1413500,1416500,84610171,7.173324452768259e-05\nQQQ,20121226 00:00,651200,651800,642900,645000,20958811,7.173324452768259e-05\nSPY,20121227 00:00,1417500,1420700,1399200,1415900,153336787,7.148706368302687e-05\nQQQ,20121227 00:00,645600,646400,636000,644000,44967714,7.148706368302687e-05\nSPY,20121228 00:00,1406500,1414200,1398700,1398700,118554490,7.199617210783216e-05\nQQQ,20121228 00:00,639100,644300,637500,637800,30401612,7.199617210783216e-05\nSPY,20121231 00:00,1397200,1425600,1395400,1425200,207656929,7.285865119227901e-05\nQQQ,20121231 00:00,637100,652500,635800,651100,53485109,7.285865119227901e-05\nSPY,20130102 00:00,1452800,1461500,1447300,1461500,154762124,7.574056566950661e-05\nQQQ,20130102 00:00,667300,672300,664800,672000,51501317,7.574056566950661e-05\nSPY,20130103 00:00,1459900,1463700,1453400,1457300,125860852,7.574194972952666e-05\nQQQ,20130103 00:00,671900,673400,666500,668700,38927150,7.574194972952666e-05\nSPY,20130104 00:00,1459700,1466100,1456700,1464500,95968674,7.454680032947675e-05\nQQQ,20130104 00:00,668800,668800,664700,666300,29237113,7.454680032947675e-05\nSPY,20130107 00:00,1458700,1461100,1454300,1459200,82356729,7.45380179264029e-05\nQQQ,20130107 00:00,664500,667600,662500,666800,24407789,7.45380179264029e-05\nSPY,20130108 00:00,1457200,1459100,1449800,1455300,96448983,7.447481847495154e-05\nQQQ,20130108 00:00,666400,668200,661700,665600,25491910,7.447481847495154e-05\nSPY,20130109 00:00,1458900,1463200,1456400,1459900,76541810,7.452846355580792e-05\nQQQ,20130109 00:00,666200,669500,665500,667700,22695693,7.452846355580792e-05\nSPY,20130110 00:00,1467200,1470900,1459700,1470700,104550895,7.468475667811942e-05\nQQQ,20130110 00:00,672300,672700,665500,671700,36088156,7.468475667811942e-05\nSPY,20130111 00:00,1470600,1471500,1466100,1470700,78613039,7.446243862268179e-05\nQQQ,20130111 00:00,671400,672900,670000,672600,18988373,7.446243862268179e-05\nSPY,20130114 00:00,1468900,1470700,1464300,1469600,76595746,7.448644588714023e-05\nQQQ,20130114 00:00,669200,671500,666700,669600,35140604,7.448644588714023e-05\nSPY,20130115 00:00,1462900,1472100,1462000,1470700,76588670,7.446217659172694e-05\nQQQ,20130115 00:00,666300,667200,663400,666300,26269574,7.446217659172694e-05\nSPY,20130116 00:00,1467800,1472800,1466100,1470500,82147565,7.43793099284602e-05\nQQQ,20130116 00:00,667200,671300,666000,669000,26310674,7.43793099284602e-05\nSPY,20130117 00:00,1476600,1484200,1474300,1479700,105543278,7.441451979061053e-05\nQQQ,20130117 00:00,671700,674800,670600,672200,29794841,7.441451979061053e-05\nSPY,20130118 00:00,1480000,1484900,1474300,1483300,143478816,7.383712147501854e-05\nQQQ,20130118 00:00,670200,671400,667700,670700,28834310,7.383712147501854e-05\nSPY,20130122 00:00,1483400,1491300,1479800,1491000,85902251,7.375196160744275e-05\nQQQ,20130122 00:00,671400,672300,667300,671800,26326796,7.375196160744275e-05\nSPY,20130123 00:00,1491200,1494900,1488600,1493700,78754801,7.38050138297114e-05\nQQQ,20130123 00:00,675600,677900,674600,675900,26232049,7.38050138297114e-05\nSPY,20130124 00:00,1491200,1501400,1490100,1494200,117043379,7.381394395531262e-05\nQQQ,20130124 00:00,666600,672800,665600,666600,39220362,7.381394395531262e-05\nSPY,20130125 00:00,1498800,1502500,1494600,1502500,106824958,7.389120222113507e-05\nQQQ,20130125 00:00,668700,671900,667400,670000,37731048,7.389120222113507e-05\nSPY,20130128 00:00,1503300,1503300,1495100,1500700,93917764,7.348297569494506e-05\nQQQ,20130128 00:00,670100,673800,669300,671500,26475197,7.348297569494506e-05\nSPY,20130129 00:00,1497800,1508500,1496700,1506600,90136030,7.338321848814979e-05\nQQQ,20130129 00:00,670700,673100,666300,671600,30720184,7.338321848814979e-05\nSPY,20130130 00:00,1506400,1509300,1499300,1500800,107211861,7.344658536873214e-05\nQQQ,20130130 00:00,672800,674800,668700,670200,31990436,7.344658536873214e-05\nSPY,20130131 00:00,1499300,1503800,1496000,1497000,92861090,7.347865453656693e-05\nQQQ,20130131 00:00,669900,673500,668100,668900,27642487,7.347865453656693e-05\nSPY,20130201 00:00,1506600,1514100,1503900,1512800,107936504,7.392273596419647e-05\nQQQ,20130201 00:00,673400,677700,670700,676600,34271506,7.392273596419647e-05\nSPY,20130204 00:00,1503100,1505800,1494300,1495300,121333979,7.4498526532298e-05\nQQQ,20130204 00:00,672700,674500,664600,664800,37613556,7.4498526532298e-05\nSPY,20130205 00:00,1503600,1514800,1502900,1510800,100432126,7.50590096448885e-05\nQQQ,20130205 00:00,667700,676700,666100,674800,29882634,7.50590096448885e-05\nSPY,20130206 00:00,1505300,1512600,1504100,1511800,112965414,7.43465838441888e-05\nQQQ,20130206 00:00,672400,675500,670400,672400,36961001,7.43465838441888e-05\nSPY,20130207 00:00,1512100,1513500,1498700,1509600,134829859,7.433638165918814e-05\nQQQ,20130207 00:00,673200,673700,665600,673000,37608724,7.433638165918814e-05\nSPY,20130208 00:00,1512400,1518900,1512200,1518000,81972911,7.4522106157641e-05\nQQQ,20130208 00:00,676400,681300,676300,679900,31070401,7.4522106157641e-05\nSPY,20130211 00:00,1517600,1519000,1514000,1517700,56652554,7.447405576060497e-05\nQQQ,20130211 00:00,680300,680600,677800,680100,17048942,7.447405576060497e-05\nSPY,20130212 00:00,1517800,1523000,1516100,1520000,56302742,7.443825474694189e-05\nQQQ,20130212 00:00,679200,680500,676600,677300,20341824,7.443825474694189e-05\nSPY,20130213 00:00,1523200,1526100,1517200,1521500,73581411,7.421862325736163e-05\nQQQ,20130213 00:00,679300,682300,677700,679700,22219188,7.421862325736163e-05\nSPY,20130214 00:00,1517100,1524700,1515200,1523100,60435268,7.398548817083702e-05\nQQQ,20130214 00:00,676600,680500,676200,679500,22526457,7.398548817083702e-05\nSPY,20130215 00:00,1524300,1525900,1515500,1521700,188245249,7.40172693856203e-05\nQQQ,20130215 00:00,679400,681100,675600,677500,22779254,7.40172693856203e-05\nSPY,20130219 00:00,1523800,1532800,1523600,1532000,74071874,7.403598479826327e-05\nQQQ,20130219 00:00,678800,682600,678600,682300,20352831,7.403598479826327e-05\nSPY,20130220 00:00,1531000,1531900,1512600,1512600,139347892,7.428482510529269e-05\nQQQ,20130220 00:00,682200,682500,671800,671900,34691421,7.428482510529269e-05\nSPY,20130221 00:00,1509000,1509600,1499400,1504000,145971241,7.458318166698103e-05\nQQQ,20130221 00:00,669400,670100,662300,664700,42395558,7.458318166698103e-05\nSPY,20130222 00:00,1511400,1518900,1507700,1518900,89396944,7.49603904136748e-05\nQQQ,20130222 00:00,668500,671500,665900,671500,20086730,7.49603904136748e-05\nSPY,20130225 00:00,1526000,1528600,1490000,1490100,179800584,7.587589941116988e-05\nQQQ,20130225 00:00,675700,678100,662500,663100,35795017,7.587589941116988e-05\nSPY,20130226 00:00,1497000,1501900,1487300,1500200,171479227,7.586546462654819e-05\nQQQ,20130226 00:00,664000,666800,659600,665600,40470990,7.586546462654819e-05\nSPY,20130227 00:00,1498900,1523300,1497700,1519100,119804636,7.631769479716657e-05\nQQQ,20130227 00:00,665600,676500,664700,672300,32802752,7.631769479716657e-05\nSPY,20130228 00:00,1518700,1528700,1515300,1515300,102964805,7.633739400781761e-05\nQQQ,20130228 00:00,672500,677400,671000,671000,24045864,7.633739400781761e-05\nSPY,20130301 00:00,1510900,1523400,1504200,1521100,143240616,7.629260733251189e-05\nQQQ,20130301 00:00,668700,675000,665400,673800,29589120,7.629260733251189e-05\nSPY,20130304 00:00,1517600,1529200,1515200,1529200,82972461,7.62719257506354e-05\nQQQ,20130304 00:00,671600,676900,670700,676800,18359784,7.62719257506354e-05\nSPY,20130305 00:00,1536500,1547000,1536400,1542900,104395367,7.657629772212432e-05\nQQQ,20130305 00:00,680800,687700,680800,686800,31181738,7.657629772212432e-05\nSPY,20130306 00:00,1548300,1549200,1541600,1545000,83236231,7.65484339474142e-05\nQQQ,20130306 00:00,688900,689000,684200,685000,27942851,7.65484339474142e-05\nSPY,20130307 00:00,1546900,1549800,1545200,1548200,63019696,7.636634674922758e-05\nQQQ,20130307 00:00,685900,688000,684600,686900,18570291,7.636634674922758e-05\nSPY,20130308 00:00,1554700,1556400,1546600,1554400,97289907,7.574529133275396e-05\nQQQ,20130308 00:00,689200,690200,685000,687500,23300919,7.574529133275396e-05\nSPY,20130311 00:00,1553500,1560400,1551400,1560300,63325768,7.557270406345223e-05\nQQQ,20130311 00:00,686800,689900,684700,689700,20129831,7.557270406345223e-05\nSPY,20130312 00:00,1559300,1561000,1552200,1556400,92466418,7.524170389571744e-05\nQQQ,20130312 00:00,687700,689200,683900,687200,21415708,7.524170389571744e-05\nSPY,20130313 00:00,1557500,1561200,1552400,1558400,75940737,7.518296620797032e-05\nQQQ,20130313 00:00,688100,688900,683900,686300,30606728,7.518296620797032e-05\nSPY,20130314 00:00,1563100,1568000,1562200,1567300,104114468,7.524952717665415e-05\nQQQ,20130314 00:00,688700,690100,687200,688700,26684228,7.524952717665415e-05\nSPY,20130315 00:00,1558700,1560400,1553100,1558800,105586093,7.408494468618594e-05\nQQQ,20130315 00:00,687500,687900,683400,685100,28059529,7.408494468618594e-05\nSPY,20130318 00:00,1542900,1556400,1542000,1549700,110246166,7.41640232879057e-05\nQQQ,20130318 00:00,678800,686300,677300,683600,34527111,7.41640232879057e-05\nSPY,20130319 00:00,1552900,1555100,1535900,1546100,149589016,7.412695420288079e-05\nQQQ,20130319 00:00,685700,687000,676200,682400,30993355,7.412695420288079e-05\nSPY,20130320 00:00,1555100,1559500,1552600,1556300,95297590,7.424467046310398e-05\nQQQ,20130320 00:00,687100,688600,683900,686800,25454493,7.424467046310398e-05\nSPY,20130321 00:00,1547900,1553100,1541000,1543400,115911436,7.451770872749378e-05\nQQQ,20130321 00:00,680800,682500,677700,679300,28810626,7.451770872749378e-05\nSPY,20130322 00:00,1548500,1556000,1547300,1556000,91810945,7.4836615020222e-05\nQQQ,20130322 00:00,682100,686400,681300,685900,25921264,7.4836615020222e-05\nSPY,20130325 00:00,1559900,1562700,1543500,1550700,131779376,7.489905299938261e-05\nQQQ,20130325 00:00,688100,689600,680100,683200,23704292,7.489905299938261e-05\nSPY,20130326 00:00,1556000,1562200,1554200,1561500,75820229,7.497623449497336e-05\nQQQ,20130326 00:00,686000,687300,684500,687100,17487822,7.497623449497336e-05\nSPY,20130327 00:00,1552700,1562500,1550000,1561600,89094609,7.498153997901873e-05\nQQQ,20130327 00:00,682400,688500,681400,688300,21507882,7.498153997901873e-05\nSPY,20130328 00:00,1561300,1568500,1558500,1565500,83562253,7.408639830490849e-05\nQQQ,20130328 00:00,688000,690600,686400,689700,20065356,7.408639830490849e-05\nSPY,20130401 00:00,1566000,1569100,1556800,1560500,82034908,7.420937846306055e-05\nQQQ,20130401 00:00,690200,690900,683100,685000,26433654,7.420937846306055e-05\nSPY,20130402 00:00,1565900,1572100,1563700,1568200,89338807,7.425183136624773e-05\nQQQ,20130402 00:00,688300,692700,687700,690400,23887778,7.425183136624773e-05\nSPY,20130403 00:00,1569200,1570300,1548200,1551500,138206759,7.463175141636626e-05\nQQQ,20130403 00:00,690800,691800,682400,684100,30686380,7.463175141636626e-05\nSPY,20130404 00:00,1554300,1561700,1550900,1558500,108461458,7.466007798891748e-05\nQQQ,20130404 00:00,683800,686000,680600,684300,25498178,7.466007798891748e-05\nSPY,20130405 00:00,1539800,1553500,1537700,1551800,132353586,7.452547403698788e-05\nQQQ,20130405 00:00,673500,679600,671900,678500,41910292,7.452547403698788e-05\nSPY,20130408 00:00,1552500,1562200,1547600,1562100,75492357,7.465437360773686e-05\nQQQ,20130408 00:00,678900,682400,676900,682200,15875018,7.465437360773686e-05\nSPY,20130409 00:00,1564800,1573200,1559800,1567500,91965576,7.415926875844801e-05\nQQQ,20130409 00:00,684000,689600,680900,686800,27067297,7.415926875844801e-05\nSPY,20130410 00:00,1571700,1588700,1571300,1587300,114994657,7.511665298592516e-05\nQQQ,20130410 00:00,689200,701700,688800,700200,43507204,7.511665298592516e-05\nSPY,20130411 00:00,1586900,1597100,1585400,1592200,94630689,7.474877786292188e-05\nQQQ,20130411 00:00,698500,701500,697700,699700,32081397,7.474877786292188e-05\nSPY,20130412 00:00,1587100,1590400,1579200,1587800,100708097,7.359387809809724e-05\nQQQ,20130412 00:00,698200,699900,694100,699400,27190869,7.359387809809724e-05\nSPY,20130415 00:00,1580200,1581300,1551200,1551700,186156530,7.533324279203372e-05\nQQQ,20130415 00:00,696500,697900,684800,685500,44037024,7.533324279203372e-05\nSPY,20130416 00:00,1563200,1574900,1559100,1574200,126446312,7.54632595638694e-05\nQQQ,20130416 00:00,689500,695500,688100,694700,24030900,7.54632595638694e-05\nSPY,20130417 00:00,1563100,1563200,1542800,1550400,198134784,7.592097334030993e-05\nQQQ,20130417 00:00,688700,688800,677100,681000,50495161,7.592097334030993e-05\nSPY,20130418 00:00,1553300,1554100,1535500,1541400,148855136,7.619424250165757e-05\nQQQ,20130418 00:00,682900,683300,668800,671400,50205946,7.619424250165757e-05\nSPY,20130419 00:00,1544400,1555500,1541200,1554800,123372939,7.544213288189254e-05\nQQQ,20130419 00:00,673000,682300,672000,680900,37077190,7.544213288189254e-05\nSPY,20130422 00:00,1557800,1565400,1547500,1562000,90989989,7.556520908414171e-05\nQQQ,20130422 00:00,683300,690400,680800,687900,30310722,7.556520908414171e-05\nSPY,20130423 00:00,1569600,1579300,1561800,1577900,120401270,7.562174119308464e-05\nQQQ,20130423 00:00,691800,696900,688200,694400,37475020,7.562174119308464e-05\nSPY,20130424 00:00,1578200,1582900,1575400,1579000,81172344,7.563257479159278e-05\nQQQ,20130424 00:00,692800,696700,691200,694300,27197515,7.563257479159278e-05\nSPY,20130425 00:00,1582500,1592700,1581000,1586100,113027663,7.537011085413417e-05\nQQQ,20130425 00:00,696000,700500,695900,697900,23524446,7.537011085413417e-05\nSPY,20130426 00:00,1583400,1586000,1577300,1582600,83462024,7.548177834659779e-05\nQQQ,20130426 00:00,696200,697700,692700,695700,21664689,7.548177834659779e-05\nSPY,20130429 00:00,1586500,1596500,1584200,1593000,79783650,7.427562959863853e-05\nQQQ,20130429 00:00,697900,704700,697600,702100,24304758,7.427562959863853e-05\nSPY,20130430 00:00,1592900,1597200,1586100,1596800,101793690,7.419469975649669e-05\nQQQ,20130430 00:00,703000,707300,700400,707300,25725809,7.419469975649669e-05\nSPY,20130501 00:00,1593200,1594100,1581000,1583200,111301363,7.434762948276483e-05\nQQQ,20130501 00:00,707400,708500,702500,703900,24346600,7.434762948276483e-05\nSPY,20130502 00:00,1586700,1598900,1585300,1597200,82810536,7.46016772070579e-05\nQQQ,20130502 00:00,705100,714300,704500,712800,27746900,7.46016772070579e-05\nSPY,20130503 00:00,1611300,1618800,1610400,1613200,115367824,7.499941477278874e-05\nQQQ,20130503 00:00,719700,723400,719200,721200,30565219,7.499941477278874e-05\nSPY,20130506 00:00,1614600,1620100,1614200,1617800,58439339,7.506493778444369e-05\nQQQ,20130506 00:00,722500,725100,721900,724000,18240163,7.506493778444369e-05\nSPY,20130507 00:00,1620900,1626500,1616700,1626300,80144043,7.469951949387225e-05\nQQQ,20130507 00:00,725200,725700,720900,723400,23187021,7.469951949387225e-05\nSPY,20130508 00:00,1624200,1633900,1623300,1633400,83868841,7.303891453753017e-05\nQQQ,20130508 00:00,723200,727600,722000,727100,19494491,7.303891453753017e-05\nSPY,20130509 00:00,1632900,1637000,1624700,1629300,94159930,7.305540384438816e-05\nQQQ,20130509 00:00,725700,731000,724700,726500,29161203,7.305540384438816e-05\nSPY,20130510 00:00,1630300,1634900,1625100,1634100,91107266,7.301329835831993e-05\nQQQ,20130510 00:00,727600,730800,726400,730500,19641643,7.301329835831993e-05\nSPY,20130513 00:00,1632300,1638100,1628200,1635400,71774035,7.295666578915486e-05\nQQQ,20130513 00:00,729300,733200,728600,731400,23596920,7.295666578915486e-05\nSPY,20130514 00:00,1637200,1653500,1636700,1652800,91589504,7.315114410816547e-05\nQQQ,20130514 00:00,731600,737400,731300,735200,32446658,7.315114410816547e-05\nSPY,20130515 00:00,1650100,1664500,1649100,1661500,104178214,7.317039520769832e-05\nQQQ,20130515 00:00,733800,737400,732000,736700,24257132,7.317039520769832e-05\nSPY,20130516 00:00,1657900,1663600,1651100,1653400,99638286,7.275361903979258e-05\nQQQ,20130516 00:00,737300,740900,735500,736000,24867739,7.275361903979258e-05\nSPY,20130517 00:00,1659700,1670400,1657400,1669700,106565142,7.29642069197046e-05\nQQQ,20130517 00:00,739700,743300,737400,743000,26182388,7.29642069197046e-05\nSPY,20130520 00:00,1668100,1675800,1666100,1669700,78535046,7.283953290316316e-05\nQQQ,20130520 00:00,741600,744300,738900,741900,21342362,7.283953290316316e-05\nSPY,20130521 00:00,1670900,1678000,1665000,1671100,82655513,7.143641181034598e-05\nQQQ,20130521 00:00,741500,745400,739000,742700,24414499,7.143641181034598e-05\nSPY,20130522 00:00,1673400,1690700,1651700,1659200,207803061,7.122187500643415e-05\nQQQ,20130522 00:00,743600,749500,732400,736500,53574732,7.122187500643415e-05\nSPY,20130523 00:00,1642000,1659100,1639400,1654500,184821919,6.950761765540677e-05\nQQQ,20130523 00:00,729700,737000,728300,734500,43717647,6.950761765540677e-05\nSPY,20130524 00:00,1644800,1653300,1639800,1653300,116703919,6.951707238735377e-05\nQQQ,20130524 00:00,729600,734300,727600,734300,24435361,6.951707238735377e-05\nSPY,20130528 00:00,1670900,1677800,1658100,1663000,127445547,6.963121674914105e-05\nQQQ,20130528 00:00,742700,745400,736600,739000,25448511,6.963121674914105e-05\nSPY,20130529 00:00,1654100,1658000,1643400,1652200,146895581,6.982626653079066e-05\nQQQ,20130529 00:00,736000,738000,731200,735400,30680205,6.982626653079066e-05\nSPY,20130530 00:00,1653800,1665900,1652300,1658900,96487592,6.985000924762292e-05\nQQQ,20130530 00:00,735700,742800,735500,739300,30462008,6.985000924762292e-05\nSPY,20130531 00:00,1653600,1663100,1632400,1632400,137865958,7.00483201772471e-05\nQQQ,20130531 00:00,736600,742000,731700,731700,35109348,7.00483201772471e-05\nSPY,20130603 00:00,1638800,1644600,1626600,1643800,146747874,6.952300356084168e-05\nQQQ,20130603 00:00,732600,734000,724300,733700,45144379,6.952300356084168e-05\nSPY,20130604 00:00,1644300,1651000,1627300,1635600,140302603,6.960478949542042e-05\nQQQ,20130604 00:00,735300,738200,727000,730000,32019053,6.960478949542042e-05\nSPY,20130605 00:00,1631000,1634200,1611300,1611800,183592216,6.761311878162105e-05\nQQQ,20130605 00:00,727600,730400,719900,720300,39875365,6.761311878162105e-05\nSPY,20130606 00:00,1611900,1627400,1602500,1626400,168748465,6.777190474242829e-05\nQQQ,20130606 00:00,721500,724000,714700,723500,59722927,6.777190474242829e-05\nSPY,20130607 00:00,1638300,1649500,1631400,1648100,146431212,6.836530634997134e-05\nQQQ,20130607 00:00,727000,734700,725200,734000,29238269,6.836530634997134e-05\nSPY,20130610 00:00,1653000,1654000,1643800,1648000,83501459,6.636042063425485e-05\nQQQ,20130610 00:00,735300,737600,732600,734200,21723639,6.636042063425485e-05\nSPY,20130611 00:00,1632700,1645400,1627400,1631200,136509220,6.680938241445391e-05\nQQQ,20130611 00:00,726900,733400,724400,727000,36375657,6.680938241445391e-05\nSPY,20130612 00:00,1642300,1643800,1616000,1617500,152312512,6.700612969290445e-05\nQQQ,20130612 00:00,731100,731400,717400,718400,37991366,6.700612969290445e-05\nSPY,20130613 00:00,1616500,1645000,1613000,1642200,134784614,6.680747571222071e-05\nQQQ,20130613 00:00,717500,729200,715500,727200,26721451,6.680747571222071e-05\nSPY,20130614 00:00,1640300,1646600,1629100,1631700,113390558,6.655602002123081e-05\nQQQ,20130614 00:00,727600,728400,721800,722800,25898887,6.655602002123081e-05\nSPY,20130617 00:00,1643000,1652200,1635500,1645000,117546027,6.658692708185527e-05\nQQQ,20130617 00:00,728500,734000,726000,729800,31542853,6.658692708185527e-05\nSPY,20130618 00:00,1645600,1659900,1645200,1656900,89587973,6.662771956181017e-05\nQQQ,20130618 00:00,730800,737200,730600,735600,23655080,6.662771956181017e-05\nSPY,20130619 00:00,1656100,1658900,1633800,1635400,169087146,6.714775456617763e-05\nQQQ,20130619 00:00,736000,736800,726800,727600,40191166,6.714775456617763e-05\nSPY,20130620 00:00,1618700,1621000,1589800,1592700,271644171,6.982665190355007e-05\nQQQ,20130620 00:00,719200,721600,707900,709400,55526174,6.982665190355007e-05\nSPY,20130621 00:00,1596200,1597600,1574800,1590500,232959955,6.954490235864367e-05\nQQQ,20130621 00:00,707800,709700,698400,703400,48936222,6.954490235864367e-05\nSPY,20130624 00:00,1574100,1584300,1557300,1569900,201603786,7.003615708747129e-05\nQQQ,20130624 00:00,698500,702700,691500,697300,37639288,7.003615708747129e-05\nSPY,20130625 00:00,1585200,1591700,1574300,1586500,140715013,6.799866590933216e-05\nQQQ,20130625 00:00,704000,705200,698100,702300,26332850,6.799866590933216e-05\nSPY,20130626 00:00,1599300,1605000,1592600,1601700,120215759,6.80361309514065e-05\nQQQ,20130626 00:00,708400,710000,705900,708700,21303374,6.80361309514065e-05\nSPY,20130627 00:00,1611500,1618200,1609500,1611300,119294686,6.676214136703426e-05\nQQQ,20130627 00:00,712400,716200,711300,711700,22303731,6.676214136703426e-05\nSPY,20130628 00:00,1606500,1614000,1598600,1600100,130109066,6.664972546319755e-05\nQQQ,20130628 00:00,709500,716900,707900,712100,25434130,6.664972546319755e-05\nSPY,20130701 00:00,1612800,1624800,1610800,1614000,114653012,6.66843337114265e-05\nQQQ,20130701 00:00,717500,723000,716400,717300,23957336,6.66843337114265e-05\nSPY,20130702 00:00,1610900,1623000,1605000,1611600,119553837,6.651694750666504e-05\nQQQ,20130702 00:00,716800,721700,713500,717300,21898154,6.651694750666504e-05\nSPY,20130703 00:00,1605100,1617600,1602200,1613400,59696858,6.336589337341808e-05\nQQQ,20130703 00:00,714800,723700,714200,720400,14935751,6.336589337341808e-05\nSPY,20130705 00:00,1625300,1630800,1613000,1630500,97439875,6.362303065430139e-05\nQQQ,20130705 00:00,724400,726100,718600,725600,25781531,6.362303065430139e-05\nSPY,20130708 00:00,1639200,1643900,1635800,1639400,90672202,6.343149737380132e-05\nQQQ,20130708 00:00,729600,729900,723800,726500,19705770,6.343149737380132e-05\nSPY,20130709 00:00,1650000,1653300,1642700,1650800,106757402,6.357133123424532e-05\nQQQ,20130709 00:00,729900,732400,726500,730900,24217324,6.357133123424532e-05\nSPY,20130710 00:00,1650300,1657500,1646300,1652100,105437138,6.303776096742347e-05\nQQQ,20130710 00:00,730200,736100,729800,735100,23850377,6.303776096742347e-05\nSPY,20130711 00:00,1671100,1676000,1665300,1675100,113993351,6.405927865991797e-05\nQQQ,20130711 00:00,743000,750300,742500,750300,42873715,6.405927865991797e-05\nSPY,20130712 00:00,1674300,1678500,1671300,1675100,81255611,6.364559973459211e-05\nQQQ,20130712 00:00,750300,753500,748300,752900,28057716,6.364559973459211e-05\nSPY,20130715 00:00,1679600,1683900,1676800,1682200,61816116,6.364992874656471e-05\nQQQ,20130715 00:00,753800,755200,751700,754800,17826964,6.364992874656471e-05\nSPY,20130716 00:00,1682500,1683500,1670700,1675000,76492853,6.345939145566243e-05\nQQQ,20130716 00:00,755300,755900,751800,753700,21857873,6.345939145566243e-05\nSPY,20130717 00:00,1681600,1684700,1677300,1679700,79399399,6.254925379771132e-05\nQQQ,20130717 00:00,756000,757400,753500,755700,18766690,6.254925379771132e-05\nSPY,20130718 00:00,1682900,1692700,1682000,1688800,84464524,6.243773015167047e-05\nQQQ,20130718 00:00,755500,757400,752500,753700,25371333,6.243773015167047e-05\nSPY,20130719 00:00,1684800,1692300,1683100,1692300,89925668,6.226930120912493e-05\nQQQ,20130719 00:00,747200,747400,743700,745900,31486623,6.226930120912493e-05\nSPY,20130722 00:00,1693900,1697400,1690100,1695000,66244175,6.192565856883618e-05\nQQQ,20130722 00:00,749100,749800,745800,748100,17712674,6.192565856883618e-05\nSPY,20130723 00:00,1697900,1698300,1690500,1691400,68810946,6.195568897381973e-05\nQQQ,20130723 00:00,749500,749600,742000,742600,18543671,6.195568897381973e-05\nSPY,20130724 00:00,1698000,1698500,1681800,1685500,101293288,6.137443987475675e-05\nQQQ,20130724 00:00,749900,750200,743400,745000,20284733,6.137443987475675e-05\nSPY,20130725 00:00,1681700,1690800,1679400,1689300,88599506,6.0816776140964874e-05\nQQQ,20130725 00:00,748500,750600,744600,749700,20701923,6.0816776140964874e-05\nSPY,20130726 00:00,1682400,1691600,1675200,1691100,87678043,6.0512612265787263e-05\nQQQ,20130726 00:00,746700,753800,745500,753700,19526727,6.0512612265787263e-05\nSPY,20130729 00:00,1687000,1690600,1681100,1685300,69807907,6.051354069525813e-05\nQQQ,20130729 00:00,752200,755400,750300,752300,17979325,6.051354069525813e-05\nSPY,20130730 00:00,1691500,1692800,1681900,1686000,76066677,5.9713463293261484e-05\nQQQ,20130730 00:00,755000,759400,753500,756300,22817021,5.9713463293261484e-05\nSPY,20130731 00:00,1689400,1698500,1684900,1686600,119215193,5.7950642258050236e-05\nQQQ,20130731 00:00,757800,762000,756300,757700,23513930,5.7950642258050236e-05\nSPY,20130801 00:00,1700000,1708100,1699000,1706500,93280387,5.834849140626291e-05\nQQQ,20130801 00:00,762900,766500,762100,765400,15627001,5.834849140626291e-05\nSPY,20130802 00:00,1703000,1709600,1700500,1709500,69378174,5.8334025367780556e-05\nQQQ,20130802 00:00,765500,769900,763900,769700,13585522,5.8334025367780556e-05\nSPY,20130805 00:00,1706100,1709600,1703500,1708000,45392458,5.830893751358174e-05\nQQQ,20130805 00:00,769000,770800,767800,770200,13937894,5.830893751358174e-05\nSPY,20130806 00:00,1703400,1705200,1693500,1697300,71528242,5.83619501186567e-05\nQQQ,20130806 00:00,769300,769900,762500,765600,22529435,5.83619501186567e-05\nSPY,20130807 00:00,1692300,1694300,1685500,1691800,73391843,5.6975377514031845e-05\nQQQ,20130807 00:00,763400,765600,758800,764200,18208362,5.6975377514031845e-05\nSPY,20130808 00:00,1700000,1701800,1689300,1698100,84008835,5.700224603700646e-05\nQQQ,20130808 00:00,768400,769800,763000,768000,18356292,5.700224603700646e-05\nSPY,20130809 00:00,1695600,1701000,1687300,1693000,82562992,5.6938053599906946e-05\nQQQ,20130809 00:00,766700,769400,762700,765000,16950100,5.6938053599906946e-05\nSPY,20130812 00:00,1684700,1693100,1683800,1691000,59076849,5.6927717411371e-05\nQQQ,20130812 00:00,762000,768000,761900,766700,16961448,5.6927717411371e-05\nSPY,20130813 00:00,1694000,1699000,1684100,1696900,74561074,5.6982657533677826e-05\nQQQ,20130813 00:00,767700,772700,762200,771200,22745617,5.6982657533677826e-05\nSPY,20130814 00:00,1695600,1697900,1687000,1687400,70350361,5.71000010848223e-05\nQQQ,20130814 00:00,770700,771800,767000,768100,25890627,5.71000010848223e-05\nSPY,20130815 00:00,1674300,1674300,1660900,1662700,126229462,5.817930371770811e-05\nQQQ,20130815 00:00,759500,759900,752900,755100,35619823,5.817930371770811e-05\nSPY,20130816 00:00,1660400,1666300,1655000,1658700,106209007,5.819324887201655e-05\nQQQ,20130816 00:00,755200,758700,753500,754600,20645369,5.819324887201655e-05\nSPY,20130819 00:00,1656400,1662100,1647600,1647600,83024441,5.8246416080463206e-05\nQQQ,20130819 00:00,754900,761300,753300,753500,27632475,5.8246416080463206e-05\nSPY,20130820 00:00,1650300,1662000,1648600,1655900,77447684,5.8010473664057665e-05\nQQQ,20130820 00:00,754900,760300,754300,757000,17239354,5.8010473664057665e-05\nSPY,20130821 00:00,1651500,1660300,1641900,1645600,132890097,5.810991581527757e-05\nQQQ,20130821 00:00,754400,760900,751400,754200,28275359,5.810991581527757e-05\nSPY,20130822 00:00,1649500,1662900,1648900,1660600,82535506,5.842925822626252e-05\nQQQ,20130822 00:00,757500,762100,757100,761600,15557186,5.842925822626252e-05\nSPY,20130823 00:00,1665500,1668300,1657700,1666700,70964457,5.843453815133825e-05\nQQQ,20130823 00:00,767000,767700,764000,766800,18100973,5.843453815133825e-05\nSPY,20130826 00:00,1667700,1673000,1658900,1659700,71204095,5.843976690964162e-05\nQQQ,20130826 00:00,767300,772700,765500,767100,24605595,5.843976690964162e-05\nSPY,20130827 00:00,1643300,1649800,1632100,1632900,132014807,5.961658354659483e-05\nQQQ,20130827 00:00,758000,761700,749600,750700,36525181,5.961658354659483e-05\nSPY,20130828 00:00,1633100,1644900,1630600,1639100,83019406,5.9549098377988605e-05\nQQQ,20130828 00:00,750500,757500,750500,754300,19453652,5.9549098377988605e-05\nSPY,20130829 00:00,1635300,1650400,1634000,1642200,88993054,5.958476871429177e-05\nQQQ,20130829 00:00,754100,763400,753000,759600,24481541,5.958476871429177e-05\nSPY,20130830 00:00,1644600,1645300,1631700,1636500,105523797,5.9696250922868664e-05\nQQQ,20130830 00:00,760400,760400,752000,754600,23730053,5.9696250922868664e-05\nSPY,20130903 00:00,1652300,1655800,1637000,1643800,113549991,5.977911825689477e-05\nQQQ,20130903 00:00,760900,764300,755400,759000,24697960,5.977911825689477e-05\nSPY,20130904 00:00,1644600,1660300,1641350,1657600,83234247,5.9757068347962175e-05\nQQQ,20130904 00:00,761600,768400,759300,767100,25470022,5.9757068347962175e-05\nSPY,20130905 00:00,1658500,1664000,1657300,1658600,55584480,5.964023838129757e-05\nQQQ,20130905 00:00,767600,770550,767300,768400,16810392,5.964023838129757e-05\nSPY,20130906 00:00,1664800,1669800,1644800,1660400,131889423,5.9621041473152356e-05\nQQQ,20130906 00:00,771000,773400,760600,769300,25556974,5.9621041473152356e-05\nSPY,20130909 00:00,1664500,1677300,1664400,1676700,71813338,6.002482612086117e-05\nQQQ,20130909 00:00,772600,779600,772300,778300,24193250,6.002482612086117e-05\nSPY,20130910 00:00,1686400,1689000,1682600,1688400,91018703,5.848539453259526e-05\nQQQ,20130910 00:00,782800,783100,779200,782000,22680213,5.848539453259526e-05\nSPY,20130911 00:00,1686600,1694000,1683500,1693700,77547138,5.84855757784831e-05\nQQQ,20130911 00:00,776900,781100,775900,780700,26345474,5.84855757784831e-05\nSPY,20130912 00:00,1693500,1695600,1687200,1690400,74584175,5.814331010949643e-05\nQQQ,20130912 00:00,780800,782500,778600,780100,17348184,5.814331010949643e-05\nSPY,20130913 00:00,1691300,1694600,1687400,1693300,61972527,5.816177073882158e-05\nQQQ,20130913 00:00,780900,781400,776400,780600,15908509,5.816177073882158e-05\nSPY,20130916 00:00,1711600,1712400,1700400,1703800,94743068,5.805923367062577e-05\nQQQ,20130916 00:00,787200,787200,776700,778500,24288939,5.805923367062577e-05\nSPY,20130917 00:00,1704700,1711100,1704600,1710700,68422451,5.735724477777384e-05\nQQQ,20130917 00:00,780200,784700,779800,783800,21785412,5.735724477777384e-05\nSPY,20130918 00:00,1709700,1735200,1705800,1731400,162552414,5.779275469989363e-05\nQQQ,20130918 00:00,784900,794600,783300,793400,29833813,5.779275469989363e-05\nSPY,20130919 00:00,1735300,1736000,1725900,1728100,122855888,5.777352085016728e-05\nQQQ,20130919 00:00,795600,796900,793700,795000,24861345,5.777352085016728e-05\nSPY,20130920 00:00,1723000,1723300,1705800,1706200,110504216,5.815013163365205e-05\nQQQ,20130920 00:00,794500,795300,789500,789800,24226392,5.815013163365205e-05\nSPY,20130923 00:00,1705000,1706400,1694000,1699400,88854203,5.8188320937629275e-05\nQQQ,20130923 00:00,793200,794100,784600,788500,25687298,5.8188320937629275e-05\nSPY,20130924 00:00,1699200,1705200,1692100,1695700,86708329,5.819306094682466e-05\nQQQ,20130924 00:00,790000,792500,785700,788300,21064604,5.819306094682466e-05\nSPY,20130925 00:00,1696100,1699300,1689000,1691100,98740960,5.817424014169156e-05\nQQQ,20130925 00:00,788900,790000,784000,786000,20362564,5.817424014169156e-05\nSPY,20130926 00:00,1693200,1701700,1690500,1696900,67188223,5.8167873958270324e-05\nQQQ,20130926 00:00,788800,793600,788500,791700,20003228,5.8167873958270324e-05\nSPY,20130927 00:00,1688500,1691400,1684700,1689500,80759674,5.7638817361763226e-05\nQQQ,20130927 00:00,787100,792100,785900,790800,22430191,5.7638817361763226e-05\nSPY,20130930 00:00,1674600,1685400,1671500,1681000,121886292,5.747791986309161e-05\nQQQ,20130930 00:00,782500,790900,780000,788500,24476177,5.747791986309161e-05\nSPY,20131001 00:00,1681500,1695000,1680000,1694000,107332142,5.725728773259879e-05\nQQQ,20131001 00:00,788900,797200,788500,796800,27311350,5.725728773259879e-05\nSPY,20131002 00:00,1683400,1692100,1678300,1691100,87176914,5.704721919855124e-05\nQQQ,20131002 00:00,791400,797600,790600,796500,21879194,5.704721919855124e-05\nSPY,20131003 00:00,1687700,1689400,1668400,1676200,153254596,5.752813514455694e-05\nQQQ,20131003 00:00,795500,797200,783000,787100,34917178,5.752813514455694e-05\nSPY,20131004 00:00,1677400,1690600,1675300,1688900,84960871,5.774314562715981e-05\nQQQ,20131004 00:00,787200,795100,786500,794000,20531533,5.774314562715981e-05\nSPY,20131007 00:00,1674300,1684500,1672500,1674200,81489219,5.800046713904078e-05\nQQQ,20131007 00:00,787000,793500,786700,787400,18658142,5.800046713904078e-05\nSPY,20131008 00:00,1674500,1676200,1653700,1654800,153859703,5.885920990960567e-05\nQQQ,20131008 00:00,787400,788100,772000,772200,40968703,5.885920990960567e-05\nSPY,20131009 00:00,1658200,1662000,1645300,1655700,143898404,5.882468419422808e-05\nQQQ,20131009 00:00,774000,774400,763600,769600,62806871,5.882468419422808e-05\nSPY,20131010 00:00,1673200,1692400,1672300,1692400,157839488,6.047717527545022e-05\nQQQ,20131010 00:00,778100,787800,777900,786100,41310257,6.047717527545022e-05\nSPY,20131011 00:00,1689000,1703200,1687700,1703000,88751455,5.99559306745284e-05\nQQQ,20131011 00:00,784100,792900,784000,792300,23175005,5.99559306745284e-05\nSPY,20131014 00:00,1692400,1710700,1690800,1710400,94276399,5.9877179751874073e-05\nQQQ,20131014 00:00,787500,797900,786800,797900,29982341,5.9877179751874073e-05\nSPY,20131015 00:00,1705200,1711500,1694700,1697200,135988023,6.0029942805432816e-05\nQQQ,20131015 00:00,797300,801100,793800,794800,34625853,6.0029942805432816e-05\nSPY,20131016 00:00,1707200,1721600,1706400,1720500,130275941,6.054961047592377e-05\nQQQ,20131016 00:00,798500,804200,797900,803700,43259878,6.054961047592377e-05\nSPY,20131017 00:00,1713800,1733200,1713400,1732700,109465354,6.0478021701738516e-05\nQQQ,20131017 00:00,800200,808700,799500,808100,29348023,6.0478021701738516e-05\nSPY,20131018 00:00,1738500,1745100,1735100,1743600,123495408,6.0262058147109435e-05\nQQQ,20131018 00:00,815800,821800,813500,821500,32161620,6.0262058147109435e-05\nSPY,20131021 00:00,1744700,1747500,1740100,1744500,84701818,6.0280754561935984e-05\nQQQ,20131021 00:00,823400,825400,820700,823000,29997232,6.0280754561935984e-05\nSPY,20131022 00:00,1749400,1759300,1746600,1753500,112475864,6.0153124861800774e-05\nQQQ,20131022 00:00,826500,829000,819300,824100,42243734,6.0153124861800774e-05\nSPY,20131023 00:00,1748000,1748900,1739700,1746200,93453544,5.8414825753065365e-05\nQQQ,20131023 00:00,820500,822000,815500,819500,29817224,5.8414825753065365e-05\nSPY,20131024 00:00,1748900,1753700,1745100,1752400,62520580,5.8453629649931435e-05\nQQQ,20131024 00:00,820000,824800,818800,823100,20213140,5.8453629649931435e-05\nSPY,20131025 00:00,1755100,1759600,1751700,1759300,75063201,5.789082356615018e-05\nQQQ,20131025 00:00,830800,832800,825000,828800,31793241,5.789082356615018e-05\nSPY,20131028 00:00,1759000,1764700,1757000,1762400,68672145,5.782904195006973e-05\nQQQ,20131028 00:00,829100,830500,825500,829600,22528984,5.782904195006973e-05\nSPY,20131029 00:00,1766400,1772200,1763800,1772200,69837141,5.7835592259801306e-05\nQQQ,20131029 00:00,832000,832600,827000,830600,33858025,5.7835592259801306e-05\nSPY,20131030 00:00,1773700,1775100,1756600,1763300,119958891,5.789887320882386e-05\nQQQ,20131030 00:00,833500,834900,825800,829600,30270108,5.789887320882386e-05\nSPY,20131031 00:00,1761800,1768900,1755300,1757300,113070805,5.789137230323927e-05\nQQQ,20131031 00:00,827700,833000,824800,827900,28059609,5.789137230323927e-05\nSPY,20131101 00:00,1760500,1766000,1752200,1761400,111765973,5.7266813132488985e-05\nQQQ,20131101 00:00,830700,831600,824000,827900,29477014,5.7266813132488985e-05\nSPY,20131104 00:00,1767100,1769000,1761500,1768600,71643685,5.675525656779288e-05\nQQQ,20131104 00:00,830600,830700,826400,829300,15624610,5.675525656779288e-05\nSPY,20131105 00:00,1761600,1767500,1755700,1762800,74666522,5.67111722244029e-05\nQQQ,20131105 00:00,826100,832200,823700,830500,25760387,5.67111722244029e-05\nSPY,20131106 00:00,1770600,1775000,1765400,1771800,71899592,5.664536823981597e-05\nQQQ,20131106 00:00,833700,834000,827300,829900,24499794,5.664536823981597e-05\nSPY,20131107 00:00,1775200,1776400,1747600,1749700,130922217,5.541380938199504e-05\nQQQ,20131107 00:00,830100,831300,813700,814300,48939052,5.541380938199504e-05\nSPY,20131108 00:00,1748500,1773100,1748500,1773100,112039875,5.5102026062452186e-05\nQQQ,20131108 00:00,817400,825500,815100,825500,28585128,5.5102026062452186e-05\nSPY,20131111 00:00,1771400,1775300,1769100,1772900,53145668,5.5107125050804536e-05\nQQQ,20131111 00:00,824200,826400,821400,824300,22542990,5.5107125050804536e-05\nSPY,20131112 00:00,1769400,1773600,1763700,1769800,73699767,5.510215911027831e-05\nQQQ,20131112 00:00,821600,826600,821200,825400,18085279,5.510215911027831e-05\nSPY,20131113 00:00,1761100,1784000,1760900,1783200,84500144,5.5262040547316956e-05\nQQQ,20131113 00:00,820000,835500,820000,835500,27274000,5.5262040547316956e-05\nSPY,20131114 00:00,1785300,1794200,1782500,1793200,92770485,5.453624832899524e-05\nQQQ,20131114 00:00,833200,838600,831500,837400,30069422,5.453624832899524e-05\nSPY,20131115 00:00,1795400,1801200,1793300,1801200,88157314,5.449421547782051e-05\nQQQ,20131115 00:00,838200,839600,836100,839600,19385521,5.449421547782051e-05\nSPY,20131118 00:00,1803900,1805000,1790200,1795000,83432360,5.4656019739917796e-05\nQQQ,20131118 00:00,839400,841000,829800,831600,29550469,5.4656019739917796e-05\nSPY,20131119 00:00,1793400,1798700,1787200,1790300,85703243,5.290035084989677e-05\nQQQ,20131119 00:00,830900,834900,827600,829000,24472996,5.290035084989677e-05\nSPY,20131120 00:00,1794100,1799300,1779800,1785100,108921426,5.295451531679213e-05\nQQQ,20131120 00:00,831200,834300,824600,827000,30334723,5.295451531679213e-05\nSPY,20131121 00:00,1789800,1800500,1788600,1799700,70890848,5.321592068290254e-05\nQQQ,20131121 00:00,830500,836100,829800,835500,25424452,5.321592068290254e-05\nSPY,20131122 00:00,1799600,1808300,1797700,1808100,66142514,5.259431962037627e-05\nQQQ,20131122 00:00,836800,840200,836200,840000,23816428,5.259431962037627e-05\nSPY,20131125 00:00,1811400,1811700,1803700,1807100,66442019,5.261985153989762e-05\nQQQ,20131125 00:00,842900,843800,839800,841900,21042353,5.261985153989762e-05\nSPY,20131126 00:00,1807500,1812200,1804100,1806400,72012227,5.246682958818137e-05\nQQQ,20131126 00:00,842100,848400,840300,847000,24328260,5.246682958818137e-05\nSPY,20131127 00:00,1808800,1812400,1806500,1811200,51121354,5.229506297015225e-05\nQQQ,20131127 00:00,848000,852400,847300,852200,19823184,5.229506297015225e-05\nSPY,20131129 00:00,1813400,1817500,1808000,1809300,41250857,5.2181054488592756e-05\nQQQ,20131129 00:00,855600,858400,854800,857300,14900285,5.2181054488592756e-05\nSPY,20131202 00:00,1811300,1814300,1802500,1805400,76545928,5.221250735367119e-05\nQQQ,20131202 00:00,858200,859600,853500,854800,24364586,5.221250735367119e-05\nSPY,20131203 00:00,1799500,1803900,1791700,1798500,92867713,5.2204133981933075e-05\nQQQ,20131203 00:00,854000,856400,850900,854000,30805607,5.2204133981933075e-05\nSPY,20131204 00:00,1792100,1804800,1783500,1796700,107731159,5.217104818144302e-05\nQQQ,20131204 00:00,850500,857700,847800,854700,35176633,5.217104818144302e-05\nSPY,20131205 00:00,1794200,1797400,1787800,1790100,88220890,5.2256555483801015e-05\nQQQ,20131205 00:00,855600,856600,851700,853800,37493947,5.2256555483801015e-05\nSPY,20131206 00:00,1807300,1811100,1801600,1809500,99444907,5.246266896356081e-05\nQQQ,20131206 00:00,861000,861800,855900,860000,32744675,5.246266896356081e-05\nSPY,20131209 00:00,1814800,1816700,1811600,1814000,60060446,5.254548347463655e-05\nQQQ,20131209 00:00,863500,865300,862000,863500,20696434,5.254548347463655e-05\nSPY,20131210 00:00,1809600,1813600,1806400,1807500,62301715,5.258019206549853e-05\nQQQ,20131210 00:00,862100,864500,861200,862900,24381167,5.258019206549853e-05\nSPY,20131211 00:00,1808100,1808500,1785000,1787200,111930458,5.300072679209616e-05\nQQQ,20131211 00:00,862800,864000,850600,851800,34470799,5.300072679209616e-05\nSPY,20131212 00:00,1786400,1788600,1777600,1781300,94786627,5.306065547414935e-05\nQQQ,20131212 00:00,852100,854200,849000,849600,29962653,5.306065547414935e-05\nSPY,20131213 00:00,1784700,1786600,1777700,1781100,83056349,5.2827866852504485e-05\nQQQ,20131213 00:00,853600,854000,847100,848500,31226220,5.2827866852504485e-05\nSPY,20131216 00:00,1789200,1798100,1789000,1792200,74941906,5.271953691080919e-05\nQQQ,20131216 00:00,852700,858100,852100,853300,20847465,5.271953691080919e-05\nSPY,20131217 00:00,1793700,1794100,1782500,1785400,75948317,5.2253502063782634e-05\nQQQ,20131217 00:00,853400,855200,849900,851500,23291934,5.2253502063782634e-05\nSPY,20131218 00:00,1789400,1817300,1773300,1817000,207030899,5.2361732717014445e-05\nQQQ,20131218 00:00,852500,862200,840500,861400,64031984,5.2361732717014445e-05\nSPY,20131219 00:00,1812000,1817000,1807200,1815000,112655750,5.218267732574696e-05\nQQQ,20131219 00:00,860000,860100,855200,859000,42197117,5.218267732574696e-05\nSPY,20131220 00:00,1806700,1819900,1806600,1815800,133819141,5.2187646518704126e-05\nQQQ,20131220 00:00,857900,866800,857300,864700,34200758,5.2187646518704126e-05\nSPY,20131223 00:00,1824100,1826400,1820700,1825400,66321111,5.114363913353175e-05\nQQQ,20131223 00:00,872100,874100,869500,874100,24476170,5.114363913353175e-05\nSPY,20131224 00:00,1825700,1830000,1825300,1829300,38250253,5.109569187717384e-05\nQQQ,20131224 00:00,874300,875100,872700,874500,12736703,5.109569187717384e-05\nSPY,20131226 00:00,1833700,1839600,1833300,1838400,53110222,5.089680851641716e-05\nQQQ,20131226 00:00,876100,878100,874400,877400,13877683,5.089680851641716e-05\nSPY,20131227 00:00,1841600,1841800,1836600,1838400,53771801,5.089613013837023e-05\nQQQ,20131227 00:00,878500,879000,874200,875200,14785346,5.089613013837023e-05\nSPY,20131230 00:00,1839200,1840200,1835800,1838200,47180243,5.033489968579243e-05\nQQQ,20131230 00:00,873900,875100,871400,873900,18024432,5.033489968579243e-05\nSPY,20131231 00:00,1841200,1846800,1839300,1846700,68550651,4.901430396363705e-05\nQQQ,20131231 00:00,875500,879600,875200,879600,23007605,4.901430396363705e-05\nSPY,20140102 00:00,1839100,1840600,1824800,1829200,108167846,4.636929793793845e-05\nQQQ,20140102 00:00,875600,875800,870200,872700,27825620,4.636929793793845e-05\nSPY,20140103 00:00,1832400,1836000,1826300,1828800,71382847,4.6316599042682844e-05\nQQQ,20140103 00:00,872700,873500,866200,866400,29271884,4.6316599042682844e-05\nSPY,20140106 00:00,1835200,1835600,1820800,1823600,89901576,4.6462233292553e-05\nQQQ,20140106 00:00,866600,867600,860000,863200,27757464,4.6462233292553e-05\nSPY,20140107 00:00,1831200,1837900,1829600,1834300,75867995,4.661130254204214e-05\nQQQ,20140107 00:00,867200,872500,865600,870900,25858017,4.661130254204214e-05\nSPY,20140108 00:00,1834600,1838300,1829000,1835200,86342393,4.6567069787129204e-05\nQQQ,20140108 00:00,871400,875500,869500,873100,23942763,4.6567069787129204e-05\nSPY,20140109 00:00,1841000,1841400,1828000,1836400,79126576,4.6553985601835124e-05\nQQQ,20140109 00:00,876300,876400,867200,870100,22253847,4.6553985601835124e-05\nSPY,20140110 00:00,1839600,1842100,1830100,1841400,77972574,4.64433915253262e-05\nQQQ,20140110 00:00,872300,874000,865800,873000,35086007,4.64433915253262e-05\nSPY,20140113 00:00,1836900,1841800,1813400,1816600,122813410,4.7368676650687485e-05\nQQQ,20140113 00:00,871700,874800,856800,859800,40329318,4.7368676650687485e-05\nSPY,20140114 00:00,1822700,1837700,1819500,1837200,85261773,4.8097866874423146e-05\nQQQ,20140114 00:00,863000,877200,863000,876500,35990060,4.8097866874423146e-05\nSPY,20140115 00:00,1841000,1849400,1840100,1846900,83647160,4.8216878445809644e-05\nQQQ,20140115 00:00,880300,885400,879400,883700,34433362,4.8216878445809644e-05\nSPY,20140116 00:00,1843000,1845000,1838400,1843900,61950237,4.8239651738433373e-05\nQQQ,20140116 00:00,883000,885100,881600,883800,27909058,4.8239651738433373e-05\nSPY,20140117 00:00,1841000,1844500,1833300,1836500,89214819,4.8300651496457404e-05\nQQQ,20140117 00:00,881100,883800,876700,878500,30782579,4.8300651496457404e-05\nSPY,20140121 00:00,1847200,1847700,1830500,1841800,77312943,4.8375999716015615e-05\nQQQ,20140121 00:00,884400,885900,878100,885500,24876851,4.8375999716015615e-05\nSPY,20140122 00:00,1845100,1845700,1839100,1843000,53915460,4.836572111795742e-05\nQQQ,20140122 00:00,887800,890000,885200,888100,25718497,4.836572111795742e-05\nSPY,20140123 00:00,1833500,1834000,1818300,1827900,115258815,4.852471670819784e-05\nQQQ,20140123 00:00,885100,885200,878600,884700,29992632,4.852471670819784e-05\nSPY,20140124 00:00,1815700,1816500,1788300,1788300,175573279,5.037448882009034e-05\nQQQ,20140124 00:00,880500,881800,867100,867100,61735444,5.037448882009034e-05\nSPY,20140127 00:00,1790500,1795100,1771300,1780100,160064102,5.0515877531334714e-05\nQQQ,20140127 00:00,867400,868900,852500,859000,59324167,5.0515877531334714e-05\nSPY,20140128 00:00,1782500,1793000,1781300,1791000,90568738,5.0488374305724485e-05\nQQQ,20140128 00:00,855000,859400,853100,858400,42937856,5.0488374305724485e-05\nSPY,20140129 00:00,1776200,1785500,1768800,1772800,179260502,5.1000468441984055e-05\nQQQ,20140129 00:00,851100,857400,847600,849300,47807341,5.1000468441984055e-05\nSPY,20140130 00:00,1788800,1798100,1782600,1792300,96632848,5.16569255856853e-05\nQQQ,20140130 00:00,859700,867900,858800,864900,59035956,5.16569255856853e-05\nSPY,20140131 00:00,1770200,1792900,1769200,1781800,159765786,5.171228942310651e-05\nQQQ,20140131 00:00,855400,866800,854500,862700,39874762,5.171228942310651e-05\nSPY,20140203 00:00,1779400,1783700,1738300,1741500,222544720,5.351448032046346e-05\nQQQ,20140203 00:00,861100,865000,840700,842900,60101399,5.351448032046346e-05\nSPY,20140204 00:00,1749400,1758400,1743400,1753600,144004983,5.2782424535150236e-05\nQQQ,20140204 00:00,847200,852500,844600,849100,35682519,5.2782424535150236e-05\nSPY,20140205 00:00,1747800,1755600,1737100,1751700,146216400,5.2261297981423776e-05\nQQQ,20140205 00:00,846300,849900,837400,846900,38952842,5.2261297981423776e-05\nSPY,20140206 00:00,1756100,1774800,1755800,1774800,110630862,5.2850971659461946e-05\nQQQ,20140206 00:00,849400,858800,849200,857700,29877943,5.2850971659461946e-05\nSPY,20140207 00:00,1782800,1798700,1777400,1797400,132131649,5.3661681766398477e-05\nQQQ,20140207 00:00,862500,873500,860000,873100,35785768,5.3661681766398477e-05\nSPY,20140210 00:00,1797100,1800700,1792100,1800100,72626938,5.349860587347533e-05\nQQQ,20140210 00:00,872700,878300,872100,878100,27965402,5.349860587347533e-05\nSPY,20140211 00:00,1802300,1824400,1800700,1819800,103111329,5.390654957310243e-05\nQQQ,20140211 00:00,879900,889700,878900,887900,36673442,5.390654957310243e-05\nSPY,20140212 00:00,1822600,1828300,1817100,1821600,87336980,5.3923419303250465e-05\nQQQ,20140212 00:00,889800,891600,887100,889700,30459185,5.3923419303250465e-05\nSPY,20140213 00:00,1808700,1832000,1808300,1830000,86663567,5.4017931202171906e-05\nQQQ,20140213 00:00,883200,897000,883000,896300,36046644,5.4017931202171906e-05\nSPY,20140214 00:00,1829000,1843600,1826800,1840100,79238964,5.4036061361673374e-05\nQQQ,20140214 00:00,896000,900100,893300,898100,31687128,5.4036061361673374e-05\nSPY,20140218 00:00,1842000,1844900,1836500,1842600,68488244,5.4016861340726614e-05\nQQQ,20140218 00:00,899600,904100,897400,902500,26876524,5.4016861340726614e-05\nSPY,20140219 00:00,1837800,1849500,1828700,1830500,107451814,5.4105341788639076e-05\nQQQ,20140219 00:00,900800,902900,894500,896400,34832280,5.4105341788639076e-05\nSPY,20140220 00:00,1833000,1845200,1826200,1841000,89178782,5.329533028053562e-05\nQQQ,20140220 00:00,896900,902200,893100,900500,37174480,5.329533028053562e-05\nSPY,20140221 00:00,1844200,1848900,1838000,1839600,100978693,5.3002284543700923e-05\nQQQ,20140221 00:00,903400,904700,898300,899300,27496934,5.3002284543700923e-05\nSPY,20140224 00:00,1843000,1861500,1842100,1849100,93723541,5.275120227361322e-05\nQQQ,20140224 00:00,901400,908200,900400,904300,30101716,5.275120227361322e-05\nSPY,20140225 00:00,1850300,1855800,1842300,1848400,97120950,5.167911931731908e-05\nQQQ,20140225 00:00,905400,907200,900200,903100,24950263,5.167911931731908e-05\nSPY,20140226 00:00,1851000,1856000,1843300,1848500,84192425,5.162666906440644e-05\nQQQ,20140226 00:00,905500,908400,898800,902300,37952454,5.162666906440644e-05\nSPY,20140227 00:00,1845800,1858700,1843800,1858700,80283904,5.1233042876696716e-05\nQQQ,20140227 00:00,898800,905300,897300,904400,26390229,5.1233042876696716e-05\nSPY,20140228 00:00,1857800,1871500,1850500,1863000,127758775,5.117760895202686e-05\nQQQ,20140228 00:00,904200,909600,895500,903400,41851761,5.117760895202686e-05\nSPY,20140303 00:00,1846500,1854500,1837500,1849800,141848312,5.140960014318062e-05\nQQQ,20140303 00:00,894900,899000,888700,896800,35467056,5.140960014318062e-05\nSPY,20140304 00:00,1868100,1879800,1867500,1875800,149682598,5.196473667808801e-05\nQQQ,20140304 00:00,906500,909800,905600,908300,30906558,5.196473667808801e-05\nSPY,20140305 00:00,1877500,1880700,1874500,1876100,72001348,5.152016263059333e-05\nQQQ,20140305 00:00,909600,912200,907700,910600,24910323,5.152016263059333e-05\nSPY,20140306 00:00,1882200,1886100,1878900,1882100,71357422,5.1509136638311117e-05\nQQQ,20140306 00:00,912700,913300,906500,909800,22567197,5.1509136638311117e-05\nSPY,20140307 00:00,1889600,1889600,1874300,1882600,92692794,5.151379326858427e-05\nQQQ,20140307 00:00,913200,913600,900700,905400,28582649,5.151379326858427e-05\nSPY,20140310 00:00,1879900,1882300,1870800,1882100,66969564,5.151853480019588e-05\nQQQ,20140310 00:00,904800,906600,900300,906100,17206260,5.151853480019588e-05\nSPY,20140311 00:00,1884800,1887000,1868000,1872300,88435777,5.16222808800647e-05\nQQQ,20140311 00:00,908300,910500,899500,902200,23484073,5.16222808800647e-05\nSPY,20140312 00:00,1863200,1873500,1859000,1872800,93180936,5.1555902453352495e-05\nQQQ,20140312 00:00,898100,906100,894800,905500,26867060,5.1555902453352495e-05\nSPY,20140313 00:00,1878800,1879900,1846600,1851800,136495375,5.2276047356504574e-05\nQQQ,20140313 00:00,909000,909300,888700,892900,45554081,5.2276047356504574e-05\nSPY,20140314 00:00,1848000,1857900,1844400,1846600,133250737,5.234198444415475e-05\nQQQ,20140314 00:00,889900,893800,886300,886500,35799615,5.234198444415475e-05\nSPY,20140317 00:00,1856200,1867700,1855200,1863300,86212672,5.24528667643445e-05\nQQQ,20140317 00:00,892400,899100,891900,894500,24699347,5.24528667643445e-05\nSPY,20140318 00:00,1867400,1879100,1865100,1876600,88937577,5.264423233898454e-05\nQQQ,20140318 00:00,895600,906300,895300,905300,28629543,5.264423233898454e-05\nSPY,20140319 00:00,1877100,1879400,1854800,1866600,142453779,5.276254514598535e-05\nQQQ,20140319 00:00,905600,906600,894500,900600,36461083,5.276254514598535e-05\nSPY,20140320 00:00,1862500,1878900,1859200,1877500,100140419,5.266787776573002e-05\nQQQ,20140320 00:00,897600,905600,895800,902900,29064586,5.266787776573002e-05\nSPY,20140321 00:00,1876900,1881700,1860300,1861900,137887629,5.279064902072433e-05\nQQQ,20140321 00:00,906000,906500,888300,890000,55655583,5.279064902072433e-05\nSPY,20140324 00:00,1868400,1870700,1846200,1854000,110550534,5.273056179534287e-05\nQQQ,20140324 00:00,893200,893900,874100,882200,71913746,5.273056179534287e-05\nSPY,20140325 00:00,1864000,1869400,1852700,1863100,95520395,5.268552953956107e-05\nQQQ,20140325 00:00,886800,892500,877800,885100,39905615,5.268552953956107e-05\nSPY,20140326 00:00,1870000,1873400,1849500,1849700,102575862,5.300775438811086e-05\nQQQ,20140326 00:00,889500,891500,873600,873700,37871980,5.300775438811086e-05\nSPY,20140327 00:00,1847700,1853400,1839100,1845800,127599205,5.3081909853731543e-05\nQQQ,20140327 00:00,872500,876400,864000,868900,61956289,5.3081909853731543e-05\nSPY,20140328 00:00,1851400,1864200,1850000,1855000,88551960,5.308928940739158e-05\nQQQ,20140328 00:00,871600,880100,868100,870500,38160798,5.308928940739158e-05\nSPY,20140331 00:00,1866600,1873000,1864700,1870400,83948640,5.3156377242563994e-05\nQQQ,20140331 00:00,877300,882600,876200,876800,29215241,5.3156377242563994e-05\nSPY,20140401 00:00,1876500,1883600,1874500,1882700,77846445,5.3423284450021934e-05\nQQQ,20140401 00:00,880800,892700,880800,892100,32216185,5.3423284450021934e-05\nSPY,20140402 00:00,1885000,1891300,1881400,1888600,70718887,5.297301066542337e-05\nQQQ,20140402 00:00,895800,896800,890400,894400,28852842,5.297301066542337e-05\nSPY,20140403 00:00,1891300,1892100,1880600,1886000,69874589,5.3062726812212446e-05\nQQQ,20140403 00:00,895300,896800,882200,887300,28025987,5.3062726812212446e-05\nSPY,20140404 00:00,1896400,1897000,1861000,1863800,147905014,5.4251003855733617e-05\nQQQ,20140404 00:00,893200,894100,861400,863700,105004938,5.4251003855733617e-05\nSPY,20140407 00:00,1859000,1862600,1839600,1843400,126552113,5.463106620886535e-05\nQQQ,20140407 00:00,858300,866200,849500,855500,76128955,5.463106620886535e-05\nSPY,20140408 00:00,1841800,1854000,1835900,1851300,101526439,5.468596162341218e-05\nQQQ,20140408 00:00,856500,864500,853500,863400,49757280,5.468596162341218e-05\nSPY,20140409 00:00,1856100,1871500,1850800,1871500,90817021,5.4462131332174344e-05\nQQQ,20140409 00:00,866600,878700,864300,878200,42483078,5.4462131332174344e-05\nSPY,20140410 00:00,1870700,1871700,1829400,1831700,150960665,5.72461737163203e-05\nQQQ,20140410 00:00,878800,878800,848600,851100,67439802,5.72461737163203e-05\nSPY,20140411 00:00,1821600,1834200,1813100,1814800,147808432,5.771949207811946e-05\nQQQ,20140411 00:00,843300,854400,839100,841100,83684201,5.771949207811946e-05\nSPY,20140414 00:00,1829200,1833700,1814500,1829400,118011184,5.600131119697334e-05\nQQQ,20140414 00:00,848600,852200,839900,847700,44542889,5.600131119697334e-05\nSPY,20140415 00:00,1833300,1843300,1815200,1842400,146271143,5.5374682543130964e-05\nQQQ,20140415 00:00,850800,855400,832800,850600,77906223,5.5374682543130964e-05\nSPY,20140416 00:00,1854900,1861400,1846500,1861400,89620166,5.454421877838327e-05\nQQQ,20140416 00:00,857900,861800,850900,861800,39759150,5.454421877838327e-05\nSPY,20140417 00:00,1858700,1869100,1855600,1863900,89232723,5.4147259536130206e-05\nQQQ,20140417 00:00,858500,866300,856400,862000,51035550,5.4147259536130206e-05\nSPY,20140421 00:00,1864500,1871000,1862100,1870400,53096311,5.3801997322258234e-05\nQQQ,20140421 00:00,864000,868400,860000,868400,24617562,5.3801997322258234e-05\nSPY,20140422 00:00,1872400,1884000,1871300,1878900,76101182,5.376359701492965e-05\nQQQ,20140422 00:00,871400,877500,869900,875300,28569180,5.376359701492965e-05\nSPY,20140423 00:00,1878000,1879200,1873000,1874400,64174505,5.356554865476679e-05\nQQQ,20140423 00:00,875300,875600,867100,867600,28084736,5.356554865476679e-05\nSPY,20140424 00:00,1883900,1883900,1869300,1878100,80287334,5.3608860990702324e-05\nQQQ,20140424 00:00,881900,882100,866600,875900,45728630,5.3608860990702324e-05\nSPY,20140425 00:00,1872000,1873300,1858700,1862900,90739070,5.413540574837351e-05\nQQQ,20140425 00:00,870700,871700,859800,861900,41998612,5.413540574837351e-05\nSPY,20140428 00:00,1870800,1876900,1849700,1868800,120930399,5.4112501148148316e-05\nQQQ,20140428 00:00,866000,871100,851100,864700,56034542,5.4112501148148316e-05\nSPY,20140429 00:00,1874800,1880400,1870800,1877000,71643542,5.4022252544695516e-05\nQQQ,20140429 00:00,867300,873200,863200,871600,35440778,5.4022252544695516e-05\nSPY,20140430 00:00,1874600,1885000,1871800,1884300,85384290,5.4000381942339794e-05\nQQQ,20140430 00:00,867600,874800,865400,873900,36591919,5.4000381942339794e-05\nSPY,20140501 00:00,1882500,1888400,1877300,1882900,82539046,5.3779234421828826e-05\nQQQ,20140501 00:00,875300,881500,873100,876500,34723173,5.3779234421828826e-05\nSPY,20140502 00:00,1883300,1891400,1877900,1880600,80493271,5.341784091590331e-05\nQQQ,20140502 00:00,879500,881100,872800,874900,36675211,5.341784091590331e-05\nSPY,20140505 00:00,1871600,1885500,1866300,1884400,62112050,5.303356379573241e-05\nQQQ,20140505 00:00,869700,879700,867600,879500,26314378,5.303356379573241e-05\nSPY,20140506 00:00,1880300,1881300,1867400,1868100,70612290,5.351387617742415e-05\nQQQ,20140506 00:00,878100,878600,867700,868100,30419125,5.351387617742415e-05\nSPY,20140507 00:00,1874100,1879700,1860200,1878900,95472189,5.346820128141162e-05\nQQQ,20140507 00:00,869900,870800,855300,865600,53682765,5.346820128141162e-05\nSPY,20140508 00:00,1877100,1890400,1870800,1877000,87869466,5.3412863277608696e-05\nQQQ,20140508 00:00,862500,875300,860500,864800,44446172,5.3412863277608696e-05\nSPY,20140509 00:00,1877100,1880400,1868300,1880000,74953765,5.3405629205107295e-05\nQQQ,20140509 00:00,864300,868600,858500,868000,33332319,5.3405629205107295e-05\nSPY,20140512 00:00,1887700,1898800,1887500,1898100,71834301,5.392608568165699e-05\nQQQ,20140512 00:00,873200,882600,872400,882300,37120129,5.392608568165699e-05\nSPY,20140513 00:00,1900000,1904200,1897800,1899600,60592895,5.3925702962650176e-05\nQQQ,20140513 00:00,883100,886100,881200,882900,26042141,5.3925702962650176e-05\nSPY,20140514 00:00,1898200,1898800,1887900,1890400,64159354,5.3877433655446485e-05\nQQQ,20140514 00:00,880200,883500,876200,878300,23363797,5.3877433655446485e-05\nSPY,20140515 00:00,1886800,1887200,1864800,1874000,141261751,5.416302890194166e-05\nQQQ,20140515 00:00,878100,879600,865800,871500,55388370,5.416302890194166e-05\nSPY,20140516 00:00,1875000,1881300,1867200,1881100,85281290,5.420002884105198e-05\nQQQ,20140516 00:00,872400,877600,866400,877000,62860032,5.420002884105198e-05\nSPY,20140519 00:00,1877000,1888900,1875200,1887000,51306979,5.393936386807927e-05\nQQQ,20140519 00:00,874500,884500,873000,883200,28226365,5.393936386807927e-05\nSPY,20140520 00:00,1886700,1886700,1870700,1875500,94515421,5.404900864763344e-05\nQQQ,20140520 00:00,882800,886000,876400,880000,32121236,5.404900864763344e-05\nSPY,20140521 00:00,1881000,1892200,1880600,1891300,77745877,5.432678856338445e-05\nQQQ,20140521 00:00,881300,888900,881100,888400,32678326,5.432678856338445e-05\nSPY,20140522 00:00,1892000,1899800,1888600,1896000,57302105,5.4076658167389284e-05\nQQQ,20140522 00:00,889400,894800,888000,892300,29916293,5.4076658167389284e-05\nSPY,20140523 00:00,1897600,1904800,1896800,1903800,50524951,5.412012003056058e-05\nQQQ,20140523 00:00,893200,899000,891300,898800,20407426,5.412012003056058e-05\nSPY,20140527 00:00,1910600,1915800,1909500,1915700,56783233,5.4380415126230284e-05\nQQQ,20140527 00:00,902800,910200,902000,910200,25720519,5.4380415126230284e-05\nSPY,20140528 00:00,1915500,1918200,1910600,1913800,60654048,5.4290635296075245e-05\nQQQ,20140528 00:00,909700,911000,906500,907200,28293408,5.4290635296075245e-05\nSPY,20140529 00:00,1918500,1924000,1913400,1924000,55471647,5.423203255278565e-05\nQQQ,20140529 00:00,910400,913100,908600,913000,25483306,5.423203255278565e-05\nSPY,20140530 00:00,1922100,1928000,1920400,1926300,63232048,5.416987363924012e-05\nQQQ,20140530 00:00,913200,914500,908300,913100,28188860,5.416987363924012e-05\nSPY,20140602 00:00,1929800,1929900,1919700,1929100,55322323,5.342376664091107e-05\nQQQ,20140602 00:00,914200,914400,906400,912200,25887041,5.342376664091107e-05\nSPY,20140603 00:00,1924300,1929000,1922600,1928100,52564603,5.33841574838581e-05\nQQQ,20140603 00:00,909200,913300,908000,911800,18172523,5.33841574838581e-05\nSPY,20140604 00:00,1924800,1933000,1922700,1931900,48936106,5.3264337407323384e-05\nQQQ,20140604 00:00,909500,916700,908100,915200,18691262,5.3264337407323384e-05\nSPY,20140605 00:00,1934300,1946500,1927000,1944600,76105702,5.25692917043664e-05\nQQQ,20140605 00:00,916000,924600,912900,922900,33347504,5.25692917043664e-05\nSPY,20140606 00:00,1948800,1954300,1947800,1954100,61256519,5.253377566986776e-05\nQQQ,20140606 00:00,926300,928200,924500,928200,20317781,5.253377566986776e-05\nSPY,20140609 00:00,1953600,1960500,1951700,1955700,58266471,5.185375777928658e-05\nQQQ,20140609 00:00,928400,929800,925000,927500,22411660,5.185375777928658e-05\nSPY,20140610 00:00,1953600,1956000,1949200,1955900,50668363,5.184982491832058e-05\nQQQ,20140610 00:00,926700,929600,925600,929100,19209256,5.184982491832058e-05\nSPY,20140611 00:00,1948700,1951100,1944800,1949200,55834216,5.140039819601598e-05\nQQQ,20140611 00:00,925900,930200,925000,928900,19775586,5.140039819601598e-05\nSPY,20140612 00:00,1946800,1948000,1931100,1935400,87647599,5.12461744579389e-05\nQQQ,20140612 00:00,926900,927900,917300,920500,28209727,5.12461744579389e-05\nSPY,20140613 00:00,1938900,1943200,1933000,1941600,64621214,5.061288504723653e-05\nQQQ,20140613 00:00,924500,925500,919200,923200,36056588,5.061288504723653e-05\nSPY,20140616 00:00,1938800,1947000,1936600,1942900,67831890,5.041370203936909e-05\nQQQ,20140616 00:00,921600,926700,919600,924000,22562853,5.041370203936909e-05\nSPY,20140617 00:00,1940000,1949700,1938100,1948300,69206159,5.015211267691792e-05\nQQQ,20140617 00:00,923300,927000,921800,924500,19276742,5.015211267691792e-05\nSPY,20140618 00:00,1948300,1963700,1944000,1962600,93135373,5.0093566403091105e-05\nQQQ,20140618 00:00,925400,931000,919800,929700,33010865,5.0093566403091105e-05\nSPY,20140619 00:00,1964600,1966000,1958000,1964800,74988020,4.944371412295096e-05\nQQQ,20140619 00:00,931100,931700,924900,929100,31932813,4.944371412295096e-05\nSPY,20140620 00:00,1960000,1960600,1957100,1959400,77778094,4.6685693978573125e-05\nQQQ,20140620 00:00,927000,928700,925300,927700,23569535,4.6685693978573125e-05\nSPY,20140623 00:00,1960000,1960500,1955200,1958800,50217325,4.660486285258204e-05\nQQQ,20140623 00:00,927600,928200,925100,927900,18030134,4.660486285258204e-05\nSPY,20140624 00:00,1955200,1965000,1944800,1947100,88391670,4.612209714346445e-05\nQQQ,20140624 00:00,927800,935700,924300,927000,30711382,4.612209714346445e-05\nSPY,20140625 00:00,1942800,1957800,1942500,1955800,72492534,4.596432970063003e-05\nQQQ,20140625 00:00,924900,934500,924800,932900,27844900,4.596432970063003e-05\nSPY,20140626 00:00,1956000,1956300,1941300,1954500,69751995,4.569009842811742e-05\nQQQ,20140626 00:00,933500,933600,926200,933400,21254573,4.569009842811742e-05\nSPY,20140627 00:00,1950100,1958800,1948900,1957900,55840263,4.563761677998945e-05\nQQQ,20140627 00:00,932200,937600,931900,937400,20826102,4.563761677998945e-05\nSPY,20140630 00:00,1957100,1961700,1955300,1957200,59593898,4.561695026394078e-05\nQQQ,20140630 00:00,937300,941400,936700,939100,18441080,4.561695026394078e-05\nSPY,20140701 00:00,1962100,1976300,1961300,1970600,81724640,4.565980066512591e-05\nQQQ,20140701 00:00,942400,951900,942000,949400,30211114,4.565980066512591e-05\nSPY,20140702 00:00,1970300,1974800,1969600,1972200,46267119,4.5649245785752275e-05\nQQQ,20140702 00:00,950000,952400,949100,951000,16607753,4.5649245785752275e-05\nSPY,20140703 00:00,1978100,1982900,1976500,1982500,39315126,4.5726633195384135e-05\nQQQ,20140703 00:00,954100,956800,951600,956500,13034409,4.5726633195384135e-05\nSPY,20140707 00:00,1978400,1979800,1972200,1975100,55946614,4.5555523052688245e-05\nQQQ,20140707 00:00,955900,957100,952300,954100,21024203,4.5555523052688245e-05\nSPY,20140708 00:00,1971200,1972200,1957600,1962800,90890519,4.5909911391292036e-05\nQQQ,20140708 00:00,952300,953000,938700,942900,38108601,4.5909911391292036e-05\nSPY,20140709 00:00,1967500,1973000,1963100,1971200,65783629,4.587161439549366e-05\nQQQ,20140709 00:00,945100,950600,942500,949600,26433732,4.587161439549366e-05\nSPY,20140710 00:00,1952400,1968600,1950600,1963500,88163470,4.5947843591305716e-05\nQQQ,20140710 00:00,937400,950500,936300,946600,36106183,4.5947843591305716e-05\nSPY,20140711 00:00,1962400,1967500,1957900,1966000,55246470,4.492306582608805e-05\nQQQ,20140711 00:00,949000,952700,946200,952700,18401479,4.492306582608805e-05\nSPY,20140714 00:00,1976300,1978600,1974400,1976000,51736248,4.501767940892236e-05\nQQQ,20140714 00:00,957000,960500,955400,958400,17520943,4.501767940892236e-05\nSPY,20140715 00:00,1977300,1981000,1963700,1972300,100356883,4.504033991728198e-05\nQQQ,20140715 00:00,959900,961300,948300,955100,35339512,4.504033991728198e-05\nSPY,20140716 00:00,1981300,1982600,1974200,1979600,66890342,4.5028643348603594e-05\nQQQ,20140716 00:00,962000,963000,957900,958900,20026624,4.5028643348603594e-05\nSPY,20140717 00:00,1973200,1981000,1954300,1957100,124560916,4.5699186483830044e-05\nQQQ,20140717 00:00,956300,959700,943200,946100,39788499,4.5699186483830044e-05\nSPY,20140718 00:00,1963800,1979100,1962400,1977400,111817075,4.6349653370207526e-05\nQQQ,20140718 00:00,951100,961700,950000,961200,34080235,4.6349653370207526e-05\nSPY,20140721 00:00,1970800,1975000,1964300,1973400,60883796,4.643856728961449e-05\nQQQ,20140721 00:00,959200,961600,955500,960000,25727045,4.643856728961449e-05\nSPY,20140722 00:00,1980400,1985600,1978700,1982000,60031730,4.651005927729368e-05\nQQQ,20140722 00:00,964500,967600,963500,966100,21643377,4.651005927729368e-05\nSPY,20140723 00:00,1985100,1988500,1981000,1986400,54979732,4.645097234014832e-05\nQQQ,20140723 00:00,969500,973400,967700,972400,25302052,4.645097234014832e-05\nSPY,20140724 00:00,1988200,1990600,1984500,1986500,50510204,4.649207663101368e-05\nQQQ,20140724 00:00,974000,975100,969800,971200,22239162,4.649207663101368e-05\nSPY,20140725 00:00,1981100,1982600,1973300,1977400,69172823,4.6562662729258515e-05\nQQQ,20140725 00:00,966200,968700,962300,967400,23384467,4.6562662729258515e-05\nSPY,20140728 00:00,1977800,1980900,1966200,1978000,64463636,4.655643116487789e-05\nQQQ,20140728 00:00,968400,970200,960200,967700,21983478,4.655643116487789e-05\nSPY,20140729 00:00,1982100,1984500,1969300,1969300,71955637,4.656552944439127e-05\nQQQ,20140729 00:00,969800,972000,965200,966000,25167304,4.656552944439127e-05\nSPY,20140730 00:00,1976600,1979100,1961600,1969800,97604354,4.656488779282325e-05\nQQQ,20140730 00:00,971400,973200,966000,969800,30946048,4.656488779282325e-05\nSPY,20140731 00:00,1956300,1957800,1930400,1930900,156932334,4.827475612390966e-05\nQQQ,20140731 00:00,961800,963400,948800,950300,47218109,4.827475612390966e-05\nSPY,20140801 00:00,1925800,1937500,1915800,1924800,159252899,4.793108389753675e-05\nQQQ,20140801 00:00,948200,953400,940400,946500,57744099,4.793108389753675e-05\nSPY,20140804 00:00,1929100,1943000,1920500,1938800,81387375,4.807458835103083e-05\nQQQ,20140804 00:00,948700,956900,945200,953200,30827711,4.807458835103083e-05\nSPY,20140805 00:00,1931100,1936000,1913200,1920100,136260078,4.841803896871915e-05\nQQQ,20140805 00:00,949600,952200,941500,945900,43571883,4.841803896871915e-05\nSPY,20140806 00:00,1910800,1928900,1910800,1920700,86720027,4.8235134567916036e-05\nQQQ,20140806 00:00,940000,951100,939200,945200,31672131,4.8235134567916036e-05\nSPY,20140807 00:00,1929600,1931200,1905500,1909900,121255519,4.829357699265312e-05\nQQQ,20140807 00:00,949600,951400,938900,942200,31336166,4.829357699265312e-05\nSPY,20140808 00:00,1914300,1933700,1909500,1932400,101088602,4.851176203573099e-05\nQQQ,20140808 00:00,943700,950100,939700,948700,37213639,4.851176203573099e-05\nSPY,20140811 00:00,1939900,1946600,1937100,1938000,68566260,4.8493803813803006e-05\nQQQ,20140811 00:00,952700,957600,952000,954600,26312581,4.8493803813803006e-05\nSPY,20140812 00:00,1936300,1941500,1929400,1935400,67359712,4.8512954833526135e-05\nQQQ,20140812 00:00,953600,956700,949300,954200,25161676,4.8512954833526135e-05\nSPY,20140813 00:00,1943000,1950600,1939600,1948900,59607085,4.8702261498466146e-05\nQQQ,20140813 00:00,958100,964700,957600,964300,25864146,4.8702261498466146e-05\nSPY,20140814 00:00,1951900,1957600,1949800,1957600,51962205,4.864551129739372e-05\nQQQ,20140814 00:00,965600,969500,964300,969300,21646680,4.864551129739372e-05\nSPY,20140815 00:00,1964900,1966500,1943200,1957100,131789171,4.754073154445051e-05\nQQQ,20140815 00:00,974900,976300,964800,974000,52041436,4.754073154445051e-05\nSPY,20140818 00:00,1968100,1974500,1966900,1973200,62330394,4.771889773096181e-05\nQQQ,20140818 00:00,979100,982400,977700,981500,36443608,4.771889773096181e-05\nSPY,20140819 00:00,1978500,1985400,1976500,1983900,52380329,4.7729700603234054e-05\nQQQ,20140819 00:00,983800,987600,983200,987100,20134213,4.7729700603234054e-05\nSPY,20140820 00:00,1981500,1991600,1980800,1989200,67210020,4.76599821366395e-05\nQQQ,20140820 00:00,986200,989000,985300,987000,21476088,4.76599821366395e-05\nSPY,20140821 00:00,1990600,1997600,1989300,1995000,59306589,4.75344190086677e-05\nQQQ,20140821 00:00,987500,989500,986000,989000,16063783,4.75344190086677e-05\nSPY,20140822 00:00,1993200,1996900,1987400,1991900,67316596,4.7240394403978215e-05\nQQQ,20140822 00:00,989400,992500,987200,990500,21846385,4.7240394403978215e-05\nSPY,20140825 00:00,2001500,2005300,1998600,2002000,59522463,4.7215697890784816e-05\nQQQ,20140825 00:00,995500,996800,991600,994000,21151578,4.7215697890784816e-05\nSPY,20140826 00:00,2003500,2008200,2002800,2003300,40694869,4.7202440357891264e-05\nQQQ,20140826 00:00,995500,996100,992700,995000,17998022,4.7202440357891264e-05\nSPY,20140827 00:00,2004500,2005700,1999400,2002500,41413859,4.568850298315696e-05\nQQQ,20140827 00:00,995300,996400,993100,995200,14091738,4.568850298315696e-05\nSPY,20140828 00:00,1995900,2002600,1993900,2001400,47413129,4.5657425365306244e-05\nQQQ,20140828 00:00,991800,995300,990800,994100,18652210,4.5657425365306244e-05\nSPY,20140829 00:00,2004400,2007300,1998200,2007100,52731377,4.565317762508182e-05\nQQQ,20140829 00:00,996300,999100,992700,997800,15587002,4.565317762508182e-05\nSPY,20140902 00:00,2009900,2010000,1998600,2006100,62095645,4.551184681511929e-05\nQQQ,20140902 00:00,1000200,1001000,996700,1000700,16424740,4.551184681511929e-05\nSPY,20140903 00:00,2013500,2014100,2002200,2005000,50973915,4.548189002141955e-05\nQQQ,20140903 00:00,1003400,1003400,993000,994800,23468745,4.548189002141955e-05\nSPY,20140904 00:00,2008600,2015800,1996600,2002200,69364467,4.520862017347996e-05\nQQQ,20140904 00:00,997100,1002200,991400,993900,22028262,4.520862017347996e-05\nSPY,20140905 00:00,2001900,2011900,1994200,2011100,83243971,4.5266986061487925e-05\nQQQ,20140905 00:00,995400,999500,990300,998900,28034536,4.5266986061487925e-05\nSPY,20140908 00:00,2009400,2012100,2000000,2005900,59405002,4.525576562697783e-05\nQQQ,20140908 00:00,999200,1003300,996200,1000800,23584765,4.525576562697783e-05\nSPY,20140909 00:00,2004200,2005500,1989200,1993200,81235943,4.5132888726417885e-05\nQQQ,20140909 00:00,1000900,1004600,990700,992500,34270823,4.5132888726417885e-05\nSPY,20140910 00:00,1994600,2002000,1987700,2000700,63306991,4.512763656897461e-05\nQQQ,20140910 00:00,993800,1001100,991000,1000700,29393854,4.512763656897461e-05\nSPY,20140911 00:00,1992800,2003300,1991200,2003000,60058285,4.5150409867372856e-05\nQQQ,20140911 00:00,996400,1000400,992500,999900,26806349,4.5150409867372856e-05\nSPY,20140912 00:00,2001200,2001200,1985600,1991200,104418519,4.529164853422079e-05\nQQQ,20140912 00:00,998700,999300,991700,994800,28578154,4.529164853422079e-05\nSPY,20140915 00:00,1991700,1993100,1983800,1990200,66547024,4.5342514690919456e-05\nQQQ,20140915 00:00,995900,996000,982200,985200,30971086,4.5342514690919456e-05\nSPY,20140916 00:00,1986400,2008400,1985000,2005200,104267737,4.563565477307395e-05\nQQQ,20140916 00:00,981500,995700,980500,993800,34619414,4.563565477307395e-05\nSPY,20140917 00:00,2008000,2016800,1997500,2007500,129557361,4.555812089332196e-05\nQQQ,20140917 00:00,993600,1000000,989300,995300,35057109,4.555812089332196e-05\nSPY,20140918 00:00,2013600,2018500,2011000,2018200,82911266,4.516590520011329e-05\nQQQ,20140918 00:00,998400,1002900,997300,1002800,27032104,4.516590520011329e-05\nSPY,20140919 00:00,2015500,2017300,2002900,2007000,103522528,4.52735673071147e-05\nQQQ,20140919 00:00,1004600,1004700,995800,999800,42610305,4.52735673071147e-05\nSPY,20140922 00:00,2003600,2003700,1987400,1991500,100445733,4.521794613135766e-05\nQQQ,20140922 00:00,997400,997500,986200,990500,44814291,4.521794613135766e-05\nSPY,20140923 00:00,1984100,1992600,1979500,1980100,95589005,4.526311826035297e-05\nQQQ,20140923 00:00,986500,992200,985800,987800,30509677,4.526311826035297e-05\nSPY,20140924 00:00,1980600,1996900,1975200,1995700,96800805,4.553146527629126e-05\nQQQ,20140924 00:00,988800,998800,985400,998400,32498884,4.553146527629126e-05\nSPY,20140925 00:00,1990500,1990500,1963200,1963300,131462409,4.6956892884614236e-05\nQQQ,20140925 00:00,995200,996400,977000,977400,64369226,4.6956892884614236e-05\nSPY,20140926 00:00,1967000,1983900,1964200,1979000,89383462,4.717194850939084e-05\nQQQ,20140926 00:00,980600,989600,978900,987800,48690943,4.717194850939084e-05\nSPY,20140929 00:00,1962000,1978900,1960500,1974900,84163503,4.7155211005261934e-05\nQQQ,20140929 00:00,978000,989200,977500,986500,30405584,4.7155211005261934e-05\nSPY,20140930 00:00,1977000,1983000,1966100,1970200,106045623,4.706261945366398e-05\nQQQ,20140930 00:00,989400,993000,983200,987900,36525121,4.706261945366398e-05\nSPY,20141001 00:00,1967500,1967700,1939100,1943700,163982292,4.7733514732968405e-05\nQQQ,20141001 00:00,985100,986100,969000,972100,52474323,4.7733514732968405e-05\nSPY,20141002 00:00,1941800,1950500,1923500,1944200,145715250,4.772363524931004e-05\nQQQ,20141002 00:00,971700,975100,959700,972100,51546624,4.772363524931004e-05\nSPY,20141003 00:00,1957100,1969400,1950800,1965200,101990291,4.7613626697368025e-05\nQQQ,20141003 00:00,977800,985700,974400,981700,38842888,4.7613626697368025e-05\nSPY,20141006 00:00,1973600,1976000,1955900,1963000,97319437,4.741691674530373e-05\nQQQ,20141006 00:00,984800,987200,976600,979600,31858655,4.741691674530373e-05\nSPY,20141007 00:00,1952900,1957200,1932500,1933000,126487728,4.802919839446452e-05\nQQQ,20141007 00:00,975000,977700,965600,965700,43292545,4.802919839446452e-05\nSPY,20141008 00:00,1933600,1969200,1923600,1966100,170825947,4.826065909512793e-05\nQQQ,20141008 00:00,966200,987600,960600,984500,61805524,4.826065909512793e-05\nSPY,20141009 00:00,1963600,1966000,1925800,1927000,193080301,4.9660533946882337e-05\nQQQ,20141009 00:00,983200,985700,967100,968600,58887960,4.9660533946882337e-05\nSPY,20141010 00:00,1927100,1936500,1905100,1905400,195742635,4.9099827784175785e-05\nQQQ,20141010 00:00,962800,968300,944200,944400,74259870,4.9099827784175785e-05\nSPY,20141013 00:00,1904400,1911500,1873000,1874500,203655232,5.002162466972822e-05\nQQQ,20141013 00:00,942700,949900,928800,929600,73671039,5.002162466972822e-05\nSPY,20141014 00:00,1884600,1898200,1870400,1878300,195991419,4.9917232567678504e-05\nQQQ,20141014 00:00,935400,941600,927100,929700,67206351,4.9917232567678504e-05\nSPY,20141015 00:00,1851900,1868800,1819200,1864300,349938478,4.9992788572555553e-05\nQQQ,20141015 00:00,915700,927500,902400,923700,101723479,4.9992788572555553e-05\nSPY,20141016 00:00,1830200,1875800,1829000,1862700,179272051,4.946191803802295e-05\nQQQ,20141016 00:00,904200,925800,903900,917900,61162296,4.946191803802295e-05\nSPY,20141017 00:00,1884800,1897500,1876200,1884700,195960240,4.990606242759442e-05\nQQQ,20141017 00:00,930000,938900,924600,930000,63457932,4.990606242759442e-05\nSPY,20141020 00:00,1880900,1904500,1880700,1903000,102818615,5.0063000419485096e-05\nQQQ,20141020 00:00,929900,944700,928100,943900,36009514,5.0063000419485096e-05\nSPY,20141021 00:00,1917000,1942000,1914800,1940700,136732853,5.2044544518005e-05\nQQQ,20141021 00:00,955600,968700,953200,968700,49361784,5.2044544518005e-05\nSPY,20141022 00:00,1944400,1949100,1926100,1926900,134617023,5.2206942801916216e-05\nQQQ,20141022 00:00,971700,973000,963100,963700,36737927,5.2206942801916216e-05\nSPY,20141023 00:00,1946400,1962000,1942600,1949300,141433028,5.273211144303742e-05\nQQQ,20141023 00:00,973400,983600,971700,978200,44492023,5.273211144303742e-05\nSPY,20141024 00:00,1952300,1964900,1944900,1964300,101947411,5.2901319260925965e-05\nQQQ,20141024 00:00,980300,986900,976400,986200,39138857,5.2901319260925965e-05\nSPY,20141027 00:00,1957500,1964500,1950300,1961600,75533804,5.28160200555046e-05\nQQQ,20141027 00:00,984300,988700,980200,986900,27809728,5.28160200555046e-05\nSPY,20141028 00:00,1968400,1984200,1967300,1984100,92862874,5.344318704379763e-05\nQQQ,20141028 00:00,991500,1002000,990800,1001800,29861051,5.344318704379763e-05\nSPY,20141029 00:00,1985900,1991200,1968000,1981100,129853584,5.346993889605669e-05\nQQQ,20141029 00:00,998500,1001200,991100,998100,37010193,5.346993889605669e-05\nSPY,20141030 00:00,1975900,1999500,1974100,1993800,106646609,5.345798613621927e-05\nQQQ,20141030 00:00,993600,1002600,991400,1000200,33566940,5.345798613621927e-05\nSPY,20141031 00:00,2017800,2018100,2007800,2016600,121383830,5.3976786197013294e-05\nQQQ,20141031 00:00,1016800,1017500,1010700,1014000,44363171,5.3976786197013294e-05\nSPY,20141103 00:00,2019600,2024500,2013100,2017700,80803486,5.3982572356435656e-05\nQQQ,20141103 00:00,1015800,1019700,1014300,1017000,28457381,5.3982572356435656e-05\nSPY,20141104 00:00,2012200,2016000,2000600,2010700,82190940,5.403761903938453e-05\nQQQ,20141104 00:00,1013800,1016200,1006700,1013600,20898564,5.403761903938453e-05\nSPY,20141105 00:00,2025500,2025900,2014500,2023400,82242532,5.403022275472874e-05\nQQQ,20141105 00:00,1020300,1020300,1010200,1013700,23519245,5.403022275472874e-05\nSPY,20141106 00:00,2024100,2032600,2016400,2031500,90435301,5.409014177283837e-05\nQQQ,20141106 00:00,1013600,1017200,1009200,1016900,21932569,5.409014177283837e-05\nSPY,20141107 00:00,2031600,2035900,2026100,2033400,70687484,5.3063438086906334e-05\nQQQ,20141107 00:00,1018800,1019100,1010700,1016000,18598551,5.3063438086906334e-05\nSPY,20141110 00:00,2034000,2040400,2031300,2039800,58529173,5.24358437959331e-05\nQQQ,20141110 00:00,1016600,1020900,1013800,1019600,18867350,5.24358437959331e-05\nSPY,20141111 00:00,2040700,2043000,2036600,2041600,48919008,5.243208827448185e-05\nQQQ,20141111 00:00,1019800,1022800,1017000,1022800,14618860,5.243208827448185e-05\nSPY,20141112 00:00,2033500,2042400,2033100,2039600,78536093,5.243078960026754e-05\nQQQ,20141112 00:00,1018800,1025700,1018700,1024600,19096147,5.243078960026754e-05\nSPY,20141113 00:00,2041400,2048300,2032100,2041900,79200441,5.212165373895013e-05\nQQQ,20141113 00:00,1026600,1032800,1024200,1029000,25954103,5.212165373895013e-05\nSPY,20141114 00:00,2041300,2044800,2037200,2042400,65017444,5.2090505251627386e-05\nQQQ,20141114 00:00,1028700,1032200,1025300,1032200,17459898,5.2090505251627386e-05\nSPY,20141117 00:00,2038500,2045800,2036600,2043700,60076767,5.206114372183686e-05\nQQQ,20141117 00:00,1029700,1032100,1024200,1029100,21625241,5.206114372183686e-05\nSPY,20141118 00:00,2044600,2059200,2044400,2055500,68462821,5.203362133373698e-05\nQQQ,20141118 00:00,1030000,1038200,1029900,1036800,24182426,5.203362133373698e-05\nSPY,20141119 00:00,2053000,2055500,2043000,2052200,77328648,5.202949221208929e-05\nQQQ,20141119 00:00,1035600,1035700,1027400,1032100,22506680,5.202949221208929e-05\nSPY,20141120 00:00,2042500,2057100,2041900,2055800,64783018,5.199995810069504e-05\nQQQ,20141120 00:00,1027900,1037600,1026900,1036700,19564210,5.199995810069504e-05\nSPY,20141121 00:00,2076000,2077200,2059800,2067200,121172657,5.1736507720829525e-05\nQQQ,20141121 00:00,1046200,1046900,1035400,1038700,29619626,5.1736507720829525e-05\nSPY,20141124 00:00,2071900,2073900,2069100,2072600,59414411,5.171944622458036e-05\nQQQ,20141124 00:00,1041700,1047300,1040600,1046800,16799716,5.171944622458036e-05\nSPY,20141125 00:00,2075100,2077900,2068000,2072500,66365644,5.1723964829879124e-05\nQQQ,20141125 00:00,1048600,1051400,1045700,1048400,16545703,5.1723964829879124e-05\nSPY,20141126 00:00,2072700,2077600,2070300,2076400,48377586,5.1772768523685186e-05\nQQQ,20141126 00:00,1049100,1055800,1048400,1055200,16499205,5.1772768523685186e-05\nSPY,20141128 00:00,2075000,2078700,2069100,2072000,47640169,5.168915883002827e-05\nQQQ,20141128 00:00,1058200,1062500,1057300,1060100,15993111,5.168915883002827e-05\nSPY,20141201 00:00,2063800,2065400,2053800,2058000,95613332,5.207621978590422e-05\nQQQ,20141201 00:00,1057400,1059100,1044200,1048100,32991801,5.207621978590422e-05\nSPY,20141202 00:00,2058000,2073400,2057900,2070900,68327439,5.2107637982714104e-05\nQQQ,20141202 00:00,1049300,1054100,1047000,1052300,24269235,5.2107637982714104e-05\nSPY,20141203 00:00,2072800,2081500,2071100,2079100,59313893,5.208865883936443e-05\nQQQ,20141203 00:00,1053900,1055600,1047700,1054200,30389323,5.208865883936443e-05\nSPY,20141204 00:00,2075500,2082700,2067000,2076400,80223355,5.209849421156136e-05\nQQQ,20141204 00:00,1053200,1057800,1049300,1053700,29464112,5.209849421156136e-05\nSPY,20141205 00:00,2078800,2084700,2075500,2080000,75793135,5.206224929899773e-05\nQQQ,20141205 00:00,1055300,1057000,1051500,1053800,24523000,5.206224929899773e-05\nSPY,20141208 00:00,2075500,2081200,2059300,2066100,98866205,5.203044465339818e-05\nQQQ,20141208 00:00,1051100,1055700,1040800,1046300,31188836,5.203044465339818e-05\nSPY,20141209 00:00,2043700,2066000,2039100,2064700,115507853,5.199382408978112e-05\nQQQ,20141209 00:00,1034200,1050400,1030400,1049600,40089969,5.199382408978112e-05\nSPY,20141210 00:00,2059400,2059800,2029300,2031600,146331601,5.305730359161469e-05\nQQQ,20141210 00:00,1047700,1050300,1031200,1033100,37408941,5.305730359161469e-05\nSPY,20141211 00:00,2038900,2061900,2037100,2042300,150279681,5.2493148126125956e-05\nQQQ,20141211 00:00,1036100,1050400,1035900,1038000,45086091,5.2493148126125956e-05\nSPY,20141212 00:00,2026500,2038100,2008500,2009400,177421306,5.32163301311138e-05\nQQQ,20141212 00:00,1028200,1039900,1026700,1026700,43751088,5.32163301311138e-05\nSPY,20141215 00:00,2020000,2025300,1987800,1995100,178323144,5.354750300176818e-05\nQQQ,20141215 00:00,1032300,1035800,1013200,1016100,51390788,5.354750300176818e-05\nSPY,20141216 00:00,1985500,2023900,1978600,1979000,222136276,5.400169646989737e-05\nQQQ,20141216 00:00,1009700,1024700,999600,999800,61291540,5.400169646989737e-05\nSPY,20141217 00:00,1984800,2023400,1983000,2017900,236495966,5.529190094065922e-05\nQQQ,20141217 00:00,1000700,1020900,999200,1018000,75179756,5.529190094065922e-05\nSPY,20141218 00:00,2047800,2129700,2039300,2068400,227706451,5.682313159448996e-05\nQQQ,20141218 00:00,1033100,1042600,1029800,1042500,44502274,5.682313159448996e-05\nSPY,20141219 00:00,2064600,2073300,2056200,2063300,201656897,5.680128520678444e-05\nQQQ,20141219 00:00,1039900,1047400,1037100,1043200,47736874,5.680128520678444e-05\nSPY,20141222 00:00,2067100,2074700,2064600,2074700,122695539,5.683725509592921e-05\nQQQ,20141222 00:00,1041600,1046100,1041000,1045800,33319787,5.683725509592921e-05\nSPY,20141223 00:00,2082000,2082300,2075100,2077500,105506063,5.663261069503786e-05\nQQQ,20141223 00:00,1049700,1049700,1040900,1042100,24804171,5.663261069503786e-05\nSPY,20141224 00:00,2080300,2083400,2077200,2078100,37099900,5.6634263883036834e-05\nQQQ,20141224 00:00,1043500,1047000,1042700,1043000,10773303,5.6634263883036834e-05\nSPY,20141226 00:00,2082900,2088400,2082500,2084400,47217364,5.665205675938986e-05\nQQQ,20141226 00:00,1045700,1052600,1045700,1050400,12548448,5.665205675938986e-05\nSPY,20141229 00:00,2082500,2089700,2081500,2087200,68552412,5.664212999511272e-05\nQQQ,20141229 00:00,1049800,1052500,1048800,1050200,15179628,5.664212999511272e-05\nSPY,20141230 00:00,2082100,2083700,2075100,2076000,67744755,5.6810414069853146e-05\nQQQ,20141230 00:00,1047300,1049600,1041800,1043200,16900848,5.6810414069853146e-05\nSPY,20141231 00:00,2079600,2081800,2054000,2055000,104411039,5.717717150729235e-05\nQQQ,20141231 00:00,1045100,1049100,1031000,1032500,22286939,5.717717150729235e-05\nSPY,20150102 00:00,2064000,2068800,2041800,2054300,105957476,5.6851173087424556e-05\nQQQ,20150102 00:00,1037500,1042000,1024500,1029400,29310772,5.6851173087424556e-05\nSPY,20150105 00:00,2042000,2043700,2013500,2017600,151790532,5.795002086859352e-05\nQQQ,20150105 00:00,1025000,1026100,1011500,1014300,33994158,5.795002086859352e-05\nSPY,20150106 00:00,2021300,2027200,1988600,1998200,191309913,5.8454791321669e-05\nQQQ,20150106 00:00,1015800,1017500,996200,1000700,63345086,5.8454791321669e-05\nSPY,20150107 00:00,2014600,2027200,2008800,2023100,110907078,5.8863262787753914e-05\nQQQ,20150107 00:00,1007400,1016000,1004900,1013600,33961867,5.8863262787753914e-05\nSPY,20150108 00:00,2040000,2061600,2039900,2059000,135532145,6.013537986738278e-05\nQQQ,20150108 00:00,1022500,1035000,1021200,1033000,37950558,6.013537986738278e-05\nSPY,20150109 00:00,2063900,2064100,2035200,2041900,138380098,6.039298840534804e-05\nQQQ,20150109 00:00,1036100,1036500,1020200,1026200,39201903,6.039298840534804e-05\nSPY,20150112 00:00,2044200,2045900,2019300,2026500,130060345,6.072086412560078e-05\nQQQ,20150112 00:00,1028200,1029300,1012900,1015500,33011889,6.072086412560078e-05\nSPY,20150113 00:00,2041500,2054800,2005200,2020800,195352135,5.985914430641111e-05\nQQQ,20150113 00:00,1025400,1036200,1007100,1015200,53995540,5.985914430641111e-05\nSPY,20150114 00:00,1996700,2011000,1985700,2009400,175802901,5.9190851872451785e-05\nQQQ,20150114 00:00,1004800,1014800,1000700,1009600,48551828,5.9190851872451785e-05\nSPY,20150115 00:00,2016400,2020000,1988800,1989700,156300011,5.958812461655108e-05\nQQQ,20150115 00:00,1013900,1015900,995300,996500,45530286,5.958812461655108e-05\nSPY,20150116 00:00,1987500,2018200,1985500,2016300,185662074,6.016572674621012e-05\nQQQ,20150116 00:00,995200,1009500,993600,1008200,33576728,6.016572674621012e-05\nSPY,20150120 00:00,2024300,2027100,2001700,2020800,120590234,6.010385243568816e-05\nQQQ,20150120 00:00,1014400,1018800,1002900,1016200,28456896,6.010385243568816e-05\nSPY,20150121 00:00,2015100,2036600,2009400,2030600,111421802,6.0110984500150753e-05\nQQQ,20150121 00:00,1013300,1026100,1009700,1021400,34202760,6.0110984500150753e-05\nSPY,20150122 00:00,2040200,2062600,2023300,2060500,143386079,6.112575718927563e-05\nQQQ,20150122 00:00,1025700,1041400,1016400,1040300,38065971,6.112575718927563e-05\nSPY,20150123 00:00,2058000,2061000,2048100,2049700,103145813,6.093517543760136e-05\nQQQ,20150123 00:00,1040500,1045800,1037200,1042600,33559434,6.093517543760136e-05\nSPY,20150126 00:00,2047300,2055600,2038500,2054400,80310454,5.9098512735615985e-05\nQQQ,20150126 00:00,1041700,1043300,1036100,1041400,18618622,5.9098512735615985e-05\nSPY,20150127 00:00,2030000,2041200,2017500,2027900,118119788,6.0321570275778444e-05\nQQQ,20150127 00:00,1025100,1025600,1011000,1014400,39424461,6.0321570275778444e-05\nSPY,20150128 00:00,2041600,2049500,1999100,2001400,143518567,6.066726899714488e-05\nQQQ,20150128 00:00,1030900,1031800,1009000,1009200,41913841,6.066726899714488e-05\nSPY,20150129 00:00,2003400,2023000,1986800,2020100,142243135,6.0498919148486254e-05\nQQQ,20150129 00:00,1008300,1020700,999600,1018900,42412437,6.0498919148486254e-05\nSPY,20150130 00:00,2005600,2021700,1991300,1994700,168157021,6.02010209742155e-05\nQQQ,20150130 00:00,1018000,1025800,1009600,1011000,37715667,6.02010209742155e-05\nSPY,20150202 00:00,2000700,2020200,1978600,2019000,148086377,6.0493293993081485e-05\nQQQ,20150202 00:00,1013300,1020700,997500,1019800,40681549,6.0493293993081485e-05\nSPY,20150203 00:00,2029400,2048500,2025500,2048400,111656466,5.8791412623907807e-05\nQQQ,20150203 00:00,1023300,1030300,1016800,1029600,28345597,5.8791412623907807e-05\nSPY,20150204 00:00,2039100,2053800,2035100,2040600,113368828,5.8657348087186866e-05\nQQQ,20150204 00:00,1025400,1035500,1023100,1028700,33263403,5.8657348087186866e-05\nSPY,20150205 00:00,2048300,2063000,2047700,2061800,86542389,5.8937512718977465e-05\nQQQ,20150205 00:00,1031300,1038300,1028700,1037600,20600221,5.8937512718977465e-05\nSPY,20150206 00:00,2065700,2072400,2049200,2055300,105345677,5.84444409024474e-05\nQQQ,20150206 00:00,1039200,1041700,1027600,1031300,29563768,5.84444409024474e-05\nSPY,20150209 00:00,2047700,2056400,2041400,2046300,77313286,5.768746445145935e-05\nQQQ,20150209 00:00,1027200,1032800,1025500,1028000,21894719,5.768746445145935e-05\nSPY,20150210 00:00,2058900,2071200,2048200,2067700,87817324,5.825459534216894e-05\nQQQ,20150210 00:00,1033800,1045400,1032100,1044000,22742554,5.825459534216894e-05\nSPY,20150211 00:00,2066000,2074500,2058300,2069300,77041314,5.7824658352551925e-05\nQQQ,20150211 00:00,1045100,1050100,1043200,1047800,19289541,5.7824658352551925e-05\nSPY,20150212 00:00,2079100,2089900,2076800,2089200,82340827,5.821702065178535e-05\nQQQ,20150212 00:00,1054500,1060400,1053000,1060000,21113798,5.821702065178535e-05\nSPY,20150213 00:00,2090800,2098400,2087600,2097800,77979039,5.822033113447755e-05\nQQQ,20150213 00:00,1062900,1069300,1061100,1069100,26422732,5.822033113447755e-05\nSPY,20150217 00:00,2093800,2103200,2091000,2101600,65018633,5.819619342510692e-05\nQQQ,20150217 00:00,1069100,1070800,1066500,1070100,15379926,5.819619342510692e-05\nSPY,20150218 00:00,2096300,2102200,2093500,2101500,68979537,5.8181158289582916e-05\nQQQ,20150218 00:00,1069000,1072100,1067400,1071600,13795618,5.8181158289582916e-05\nSPY,20150219 00:00,2094300,2104200,2092400,2099800,82658520,5.7945242007305887e-05\nQQQ,20150219 00:00,1070900,1077600,1070600,1076900,18462422,5.7945242007305887e-05\nSPY,20150220 00:00,2094300,2113300,2087300,2112800,123596635,5.799941705846086e-05\nQQQ,20150220 00:00,1076000,1084700,1072900,1084100,25294546,5.799941705846086e-05\nSPY,20150223 00:00,2109700,2112100,2104800,2111900,68459606,5.7987256266353474e-05\nQQQ,20150223 00:00,1084000,1085500,1081100,1085200,16260145,5.7987256266353474e-05\nSPY,20150224 00:00,2111100,2120500,2107600,2118100,65091020,5.7899310469750646e-05\nQQQ,20150224 00:00,1084100,1087300,1080500,1086000,18272329,5.7899310469750646e-05\nSPY,20150225 00:00,2116400,2122400,2112200,2116100,67297730,5.791098626116607e-05\nQQQ,20150225 00:00,1084400,1088600,1080900,1083300,18554299,5.791098626116607e-05\nSPY,20150226 00:00,2115500,2117100,2106500,2113700,65693818,5.787857243185177e-05\nQQQ,20150226 00:00,1084400,1089400,1081400,1088800,21048589,5.787857243185177e-05\nSPY,20150227 00:00,2112500,2115800,2106400,2106600,87493136,5.792817265768487e-05\nQQQ,20150227 00:00,1088600,1089100,1082300,1084000,21848435,5.792817265768487e-05\nSPY,20150302 00:00,2107900,2120600,2107200,2119900,75805733,5.8131909063515934e-05\nQQQ,20150302 00:00,1086100,1094200,1085900,1093800,21483782,5.8131909063515934e-05\nSPY,20150303 00:00,2114600,2115900,2100800,2111200,97220283,5.798664179629972e-05\nQQQ,20150303 00:00,1090600,1091600,1081800,1088700,20043637,5.798664179629972e-05\nSPY,20150304 00:00,2104200,2104900,2090600,2102100,99097965,5.742569451018334e-05\nQQQ,20150304 00:00,1085300,1086700,1078600,1084500,20174241,5.742569451018334e-05\nSPY,20150305 00:00,2105900,2108000,2098500,2105100,69813562,5.7431797975973066e-05\nQQQ,20150305 00:00,1087300,1089600,1081900,1086400,14192254,5.7431797975973066e-05\nSPY,20150306 00:00,2093800,2099400,2071000,2075000,151279849,5.815666140801392e-05\nQQQ,20150306 00:00,1085200,1087100,1071400,1074100,29117528,5.815666140801392e-05\nSPY,20150309 00:00,2077600,2087900,2075800,2083600,81466789,5.8185464172535816e-05\nQQQ,20150309 00:00,1076400,1079800,1071900,1077200,24850772,5.8185464172535816e-05\nSPY,20150310 00:00,2067000,2068100,2049700,2050000,137606860,5.9453329144456565e-05\nQQQ,20150310 00:00,1069500,1069800,1057200,1057200,30989645,5.9453329144456565e-05\nSPY,20150311 00:00,2052900,2055000,2044000,2045000,101445686,5.941512744986329e-05\nQQQ,20150311 00:00,1058700,1060100,1050700,1051100,22830168,5.941512744986329e-05\nSPY,20150312 00:00,2052400,2071800,2052000,2071300,83701264,5.97102588124232e-05\nQQQ,20150312 00:00,1050300,1059200,1049600,1058000,18992078,5.97102588124232e-05\nSPY,20150313 00:00,2067600,2069300,2045800,2058400,142726670,5.916642871338504e-05\nQQQ,20150313 00:00,1056700,1061200,1046800,1053400,39102687,5.916642871338504e-05\nSPY,20150316 00:00,2066800,2086900,2066800,2086400,122468254,5.969954179467066e-05\nQQQ,20150316 00:00,1057600,1067300,1056200,1067000,23517924,5.969954179467066e-05\nSPY,20150317 00:00,2076500,2084200,2069800,2079900,86273420,5.940586744191961e-05\nQQQ,20150317 00:00,1064100,1070400,1061600,1068700,18705018,5.940586744191961e-05\nSPY,20150318 00:00,2073500,2112600,2066200,2104200,201026638,5.9510660850247054e-05\nQQQ,20150318 00:00,1065700,1084100,1060300,1079200,37558204,5.9510660850247054e-05\nSPY,20150319 00:00,2100400,2102900,2090300,2095000,107031725,5.935890278364596e-05\nQQQ,20150319 00:00,1080400,1083800,1078700,1080800,26245908,5.935890278364596e-05\nSPY,20150320 00:00,2096600,2110200,2096100,2104500,143568202,5.937559284320814e-05\nQQQ,20150320 00:00,1087400,1090700,1085200,1085300,26136729,5.937559284320814e-05\nSPY,20150323 00:00,2104300,2111100,2100000,2100000,60797901,5.887537482341528e-05\nQQQ,20150323 00:00,1085000,1087700,1082800,1083200,14419498,5.887537482341528e-05\nSPY,20150324 00:00,2098700,2104000,2087400,2088200,66524763,5.880204117005894e-05\nQQQ,20150324 00:00,1083000,1088100,1079100,1079300,18200101,5.880204117005894e-05\nSPY,20150325 00:00,2090100,2093500,2057100,2057600,143214221,6.0183154064064894e-05\nQQQ,20150325 00:00,1081100,1082000,1054200,1054600,38077715,6.0183154064064894e-05\nSPY,20150326 00:00,2049600,2063700,2041200,2052700,135552421,5.981576868519849e-05\nQQQ,20150326 00:00,1045900,1057000,1042400,1051000,43741298,5.981576868519849e-05\nSPY,20150327 00:00,2051600,2059500,2049100,2057500,101603187,5.977583598408482e-05\nQQQ,20150327 00:00,1051000,1057700,1049300,1055200,31333313,5.977583598408482e-05\nSPY,20150330 00:00,2069600,2086100,2069600,2082400,79185641,6.025052727697471e-05\nQQQ,20150330 00:00,1061800,1068100,1061600,1067300,26189750,6.025052727697471e-05\nSPY,20150331 00:00,2072600,2081000,2063600,2064300,101521731,6.0464979591390056e-05\nQQQ,20150331 00:00,1064000,1066500,1055700,1056000,25346058,6.0464979591390056e-05\nSPY,20150401 00:00,2064200,2064200,2045100,2057000,123533228,6.014671662171593e-05\nQQQ,20150401 00:00,1056000,1056200,1043700,1050500,29862894,6.014671662171593e-05\nSPY,20150402 00:00,2055800,2069800,2054000,2064000,76346908,6.012571941644816e-05\nQQQ,20150402 00:00,1051700,1054600,1047800,1051200,17412755,6.012571941644816e-05\nSPY,20150406 00:00,2053900,2084500,2052100,2078400,94957784,6.0260412446208116e-05\nQQQ,20150406 00:00,1045000,1062600,1043400,1059800,21853293,6.0260412446208116e-05\nSPY,20150407 00:00,2078600,2087500,2072500,2072800,66012249,5.8959852585362786e-05\nQQQ,20150407 00:00,1059100,1067000,1058000,1058000,17585902,5.8959852585362786e-05\nSPY,20150408 00:00,2075300,2085000,2070800,2080200,79769143,5.857483187980687e-05\nQQQ,20150408 00:00,1059000,1067900,1058300,1066400,24616222,5.857483187980687e-05\nSPY,20150409 00:00,2078200,2091800,2071900,2089200,79714373,5.853127593428252e-05\nQQQ,20150409 00:00,1066400,1073500,1062300,1073100,21752747,5.853127593428252e-05\nSPY,20150410 00:00,2092100,2100900,2089600,2100600,64668878,5.7920034145530005e-05\nQQQ,20150410 00:00,1072700,1077600,1070300,1077500,15889883,5.7920034145530005e-05\nSPY,20150413 00:00,2098400,2106200,2090300,2090600,68313801,5.5234998885794425e-05\nQQQ,20150413 00:00,1078100,1083800,1073600,1074800,16864629,5.5234998885794425e-05\nSPY,20150414 00:00,2088600,2097100,2081000,2094900,66715857,5.471523346375431e-05\nQQQ,20150414 00:00,1074000,1076800,1065600,1071700,21871938,5.471523346375431e-05\nSPY,20150415 00:00,2100700,2110400,2099500,2104700,86369302,5.4597308238229977e-05\nQQQ,20150415 00:00,1074700,1080700,1073300,1078400,18705724,5.4597308238229977e-05\nSPY,20150416 00:00,2100400,2109800,2098000,2104000,60189683,5.454222854333461e-05\nQQQ,20150416 00:00,1075900,1078800,1074000,1076900,15231803,5.454222854333461e-05\nSPY,20150417 00:00,2089800,2092300,2070100,2079800,164756043,5.48539107837487e-05\nQQQ,20150417 00:00,1066800,1069500,1055500,1060100,40117505,5.48539107837487e-05\nSPY,20150420 00:00,2090900,2102500,2089600,2098500,77138230,5.533463121069291e-05\nQQQ,20150420 00:00,1065400,1077900,1065000,1076000,23707314,5.533463121069291e-05\nSPY,20150421 00:00,2106500,2108600,2092400,2096000,62036953,5.5234241162915884e-05\nQQQ,20150421 00:00,1082200,1084100,1079300,1080600,21590796,5.5234241162915884e-05\nSPY,20150422 00:00,2100400,2108500,2089000,2106600,72044468,5.520330011466906e-05\nQQQ,20150422 00:00,1083400,1088300,1076400,1086500,17955253,5.520330011466906e-05\nSPY,20150423 00:00,2101700,2119300,2100100,2112100,91675891,5.511577087165707e-05\nQQQ,20150423 00:00,1083000,1095500,1082600,1090600,25831045,5.511577087165707e-05\nSPY,20150424 00:00,2117000,2119700,2111100,2116700,49570752,5.514953316913471e-05\nQQQ,20150424 00:00,1101900,1106900,1100400,1105400,29027413,5.514953316913471e-05\nSPY,20150427 00:00,2123400,2124800,2105400,2107400,70031075,5.463674845889374e-05\nQQQ,20150427 00:00,1109600,1111600,1100200,1102600,26308369,5.463674845889374e-05\nSPY,20150428 00:00,2107100,2115000,2093400,2114400,80175010,5.457951016396475e-05\nQQQ,20150428 00:00,1103300,1105500,1091100,1100400,33274943,5.457951016396475e-05\nSPY,20150429 00:00,2103200,2112900,2096000,2105300,113900782,5.460918917304621e-05\nQQQ,20150429 00:00,1094200,1100700,1087500,1093500,31561296,5.460918917304621e-05\nSPY,20150430 00:00,2099000,2103500,2076200,2085200,139993578,5.524796363863918e-05\nQQQ,20150430 00:00,1087400,1091700,1070600,1076300,37755317,5.524796363863918e-05\nSPY,20150501 00:00,2094100,2107700,2092800,2107200,87366934,5.575331421550896e-05\nQQQ,20150501 00:00,1080600,1091200,1080300,1090500,30133298,5.575331421550896e-05\nSPY,20150504 00:00,2112200,2120200,2111000,2113900,63475146,5.574272781031723e-05\nQQQ,20150504 00:00,1093900,1099100,1091700,1092300,20504793,5.574272781031723e-05\nSPY,20150505 00:00,2110100,2114600,2087300,2089200,102623336,5.654647203887251e-05\nQQQ,20150505 00:00,1088100,1090000,1074000,1074500,42441431,5.654647203887251e-05\nSPY,20150506 00:00,2095400,2099300,2067600,2080400,122648566,5.618968649304811e-05\nQQQ,20150506 00:00,1076500,1079500,1060000,1067100,39326009,5.618968649304811e-05\nSPY,20150507 00:00,2079100,2093800,2075300,2088700,75342115,5.6341653437664e-05\nQQQ,20150507 00:00,1066800,1076400,1066000,1073500,27755019,5.6341653437664e-05\nSPY,20150508 00:00,2108400,2118500,2107900,2116500,125762691,5.692218019638867e-05\nQQQ,20150508 00:00,1084400,1089200,1083000,1086900,30641874,5.692218019638867e-05\nSPY,20150511 00:00,2115400,2118900,2105300,2106000,65829833,5.701402471865862e-05\nQQQ,20150511 00:00,1087200,1089800,1081900,1082700,18614261,5.701402471865862e-05\nSPY,20150512 00:00,2095900,2106300,2086300,2099800,101766611,5.6516681379541195e-05\nQQQ,20150512 00:00,1076100,1083300,1068000,1077800,29119576,5.6516681379541195e-05\nSPY,20150513 00:00,2104900,2112200,2097400,2100600,79703427,5.6516681873802273e-05\nQQQ,20150513 00:00,1082400,1088100,1078400,1080000,18362097,5.6516681873802273e-05\nSPY,20150514 00:00,2112400,2123200,2109100,2122500,82976922,5.693456087052135e-05\nQQQ,20150514 00:00,1088900,1096700,1084800,1095800,22193220,5.693456087052135e-05\nSPY,20150515 00:00,2124300,2126100,2118700,2124400,68168050,5.661594364343524e-05\nQQQ,20150515 00:00,1098900,1100100,1093100,1095800,23292276,5.661594364343524e-05\nSPY,20150518 00:00,2122400,2134000,2121700,2131000,68309200,5.658148089919904e-05\nQQQ,20150518 00:00,1094200,1102800,1093200,1100600,16710552,5.658148089919904e-05\nSPY,20150519 00:00,2132600,2135700,2126900,2130300,62912644,5.652401503250093e-05\nQQQ,20150519 00:00,1101800,1103500,1097600,1099400,12318113,5.652401503250093e-05\nSPY,20150520 00:00,2131600,2137800,2125100,2128800,70291407,5.6405849205539635e-05\nQQQ,20150520 00:00,1100100,1106700,1094300,1100100,19541881,5.6405849205539635e-05\nSPY,20150521 00:00,2127400,2137500,2125100,2135000,59049641,5.617464945159938e-05\nQQQ,20150521 00:00,1098000,1107300,1096600,1105800,15868269,5.617464945159938e-05\nSPY,20150522 00:00,2130200,2135400,2129100,2130000,48920652,5.616833042029578e-05\nQQQ,20150522 00:00,1104700,1108700,1103800,1104700,12645649,5.616833042029578e-05\nSPY,20150526 00:00,2123900,2125000,2102100,2107100,110549834,5.662576537719197e-05\nQQQ,20150526 00:00,1102100,1103800,1087600,1092000,23784971,5.662576537719197e-05\nSPY,20150527 00:00,2112300,2129800,2108500,2126700,83068343,5.689133523317417e-05\nQQQ,20150527 00:00,1095400,1110800,1092900,1109600,26132531,5.689133523317417e-05\nSPY,20150528 00:00,2123400,2125900,2116300,2125000,68137802,5.6883019199514283e-05\nQQQ,20150528 00:00,1108000,1110100,1103700,1107100,14036756,5.6883019199514283e-05\nSPY,20150529 00:00,2124000,2124300,2108200,2111300,101440890,5.695860878664911e-05\nQQQ,20150529 00:00,1106600,1107900,1097900,1100500,22445514,5.695860878664911e-05\nSPY,20150601 00:00,2119500,2123400,2106200,2115400,85386556,5.697662486119003e-05\nQQQ,20150601 00:00,1106300,1107200,1095200,1104200,22638136,5.697662486119003e-05\nSPY,20150602 00:00,2110200,2121900,2102700,2113900,80789780,5.700148509315626e-05\nQQQ,20150602 00:00,1100200,1106100,1094700,1100700,18321906,5.700148509315626e-05\nSPY,20150603 00:00,2119700,2126700,2113400,2119200,78010486,5.7015608613565126e-05\nQQQ,20150603 00:00,1106300,1108100,1101300,1104000,18534156,5.7015608613565126e-05\nSPY,20150604 00:00,2111200,2117700,2097500,2102700,133914464,5.72696480436548e-05\nQQQ,20150604 00:00,1097500,1104800,1092100,1095600,27319592,5.72696480436548e-05\nSPY,20150605 00:00,2099300,2105800,2089800,2097600,97753516,5.711318161531206e-05\nQQQ,20150605 00:00,1094200,1096900,1086300,1093000,20738018,5.711318161531206e-05\nSPY,20150608 00:00,2096300,2098200,2083900,2084800,80415421,5.7297232921858264e-05\nQQQ,20150608 00:00,1092400,1093300,1079700,1081900,22816995,5.7297232921858264e-05\nSPY,20150609 00:00,2084400,2091000,2076900,2084700,92083031,5.7303250699870284e-05\nQQQ,20150609 00:00,1079100,1083900,1072000,1080100,25115832,5.7303250699870284e-05\nSPY,20150610 00:00,2093800,2114000,2093100,2109500,122058028,5.7906277385473393e-05\nQQQ,20150610 00:00,1083700,1098100,1082600,1094900,26938768,5.7906277385473393e-05\nSPY,20150611 00:00,2114900,2120900,2112000,2116300,65279388,5.790152463742558e-05\nQQQ,20150611 00:00,1098500,1101500,1094600,1096500,16036994,5.790152463742558e-05\nSPY,20150612 00:00,2106200,2108400,2096800,2100100,120211197,5.7897198289928705e-05\nQQQ,20150612 00:00,1090900,1093000,1086000,1087500,26026319,5.7897198289928705e-05\nSPY,20150615 00:00,2086200,2094400,2077900,2091100,113025531,5.797548251422959e-05\nQQQ,20150615 00:00,1079500,1083800,1073100,1082100,28151455,5.797548251422959e-05\nSPY,20150616 00:00,2089000,2103500,2087200,2102500,75706432,5.807267562036589e-05\nQQQ,20150616 00:00,1080600,1089800,1080600,1088000,15862189,5.807267562036589e-05\nSPY,20150617 00:00,2105800,2113200,2093900,2105900,118475364,5.808465209647947e-05\nQQQ,20150617 00:00,1089800,1094500,1084300,1091000,21498113,5.808465209647947e-05\nSPY,20150618 00:00,2112300,2133400,2111800,2127800,153435733,5.850312810465882e-05\nQQQ,20150618 00:00,1094800,1108800,1094400,1106900,35321279,5.850312810465882e-05\nSPY,20150619 00:00,2114200,2115500,2104500,2108100,106014352,5.881079165792956e-05\nQQQ,20150619 00:00,1105100,1105700,1098400,1098900,24473983,5.881079165792956e-05\nSPY,20150622 00:00,2119500,2125900,2116500,2118900,61838092,5.8910738469379576e-05\nQQQ,20150622 00:00,1107000,1110300,1104500,1107000,16384186,5.8910738469379576e-05\nSPY,20150623 00:00,2121800,2124400,2115700,2120400,59750874,5.890949802407039e-05\nQQQ,20150623 00:00,1108200,1108900,1103300,1107900,16923201,5.890949802407039e-05\nSPY,20150624 00:00,2117100,2121700,2104800,2105000,77999419,5.904469644644154e-05\nQQQ,20150624 00:00,1106500,1111300,1101900,1102200,14851240,5.904469644644154e-05\nSPY,20150625 00:00,2111300,2112500,2097700,2098600,80464312,5.898746317825862e-05\nQQQ,20150625 00:00,1106700,1107600,1098200,1100000,17711591,5.898746317825862e-05\nSPY,20150626 00:00,2102800,2105800,2091600,2098200,84634171,5.900145163708813e-05\nQQQ,20150626 00:00,1099700,1102200,1088600,1092700,29877470,5.900145163708813e-05\nSPY,20150629 00:00,2080200,2088200,2053300,2054200,173766367,6.10286648453389e-05\nQQQ,20150629 00:00,1080100,1086600,1066400,1066900,47282136,6.10286648453389e-05\nSPY,20150630 00:00,2073200,2073200,2052800,2058500,147775137,6.10539734803845e-05\nQQQ,20150630 00:00,1075100,1077200,1067400,1070700,31102628,6.10539734803845e-05\nSPY,20150701 00:00,2077900,2080300,2065600,2075000,119981651,6.100853612707364e-05\nQQQ,20150701 00:00,1082000,1083400,1074300,1079200,20038829,6.100853612707364e-05\nSPY,20150702 00:00,2080700,2082700,2068200,2073100,91216426,6.10071016752888e-05\nQQQ,20150702 00:00,1082400,1083200,1076200,1079500,16326770,6.10071016752888e-05\nSPY,20150706 00:00,2057400,2076500,2055400,2067200,107837293,6.093668762172965e-05\nQQQ,20150706 00:00,1072300,1083200,1070500,1077000,22725533,6.093668762172965e-05\nSPY,20150707 00:00,2069300,2081600,2041200,2080200,160419568,6.0937191945902575e-05\nQQQ,20150707 00:00,1078300,1080700,1058400,1079700,42260072,6.0937191945902575e-05\nSPY,20150708 00:00,2063400,2067600,2042500,2045300,149493795,6.183637067333328e-05\nQQQ,20150708 00:00,1071400,1073300,1059000,1060900,37130269,6.183637067333328e-05\nSPY,20150709 00:00,2070300,2073500,2048800,2049000,129658638,6.172170342750754e-05\nQQQ,20150709 00:00,1075200,1075900,1060200,1060300,25291503,6.172170342750754e-05\nSPY,20150710 00:00,2072800,2079800,2064900,2074800,117226689,6.238951015790243e-05\nQQQ,20150710 00:00,1074500,1080500,1070600,1076500,24788200,6.238951015790243e-05\nSPY,20150713 00:00,2090000,2099000,2089400,2097700,95163867,6.309480089424382e-05\nQQQ,20150713 00:00,1085700,1096300,1085700,1095400,24304084,6.309480089424382e-05\nSPY,20150714 00:00,2096900,2110500,2096600,2106800,72962870,6.30882586999212e-05\nQQQ,20150714 00:00,1097000,1105600,1096300,1102600,21059019,6.30882586999212e-05\nSPY,20150715 00:00,2107100,2112800,2100500,2106100,88918067,6.305224324087097e-05\nQQQ,20150715 00:00,1104500,1108100,1100700,1103800,25995945,6.305224324087097e-05\nSPY,20150716 00:00,2118200,2123000,2115500,2123000,94346340,6.342240924958952e-05\nQQQ,20150716 00:00,1112600,1119600,1110700,1119400,25961481,6.342240924958952e-05\nSPY,20150717 00:00,2123400,2125500,2118000,2124800,79523761,6.279614290327716e-05\nQQQ,20150717 00:00,1128500,1135900,1126500,1135900,30128315,6.279614290327716e-05\nSPY,20150720 00:00,2127700,2131800,2122100,2125900,59688017,6.218950351530994e-05\nQQQ,20150720 00:00,1138500,1143900,1134800,1139800,23950721,6.218950351530994e-05\nSPY,20150721 00:00,2124500,2127400,2113900,2117500,69759154,6.219382501562706e-05\nQQQ,20150721 00:00,1140400,1142000,1135800,1139100,29742179,6.219382501562706e-05\nSPY,20150722 00:00,2109100,2117700,2108900,2113700,78346222,6.220209831204924e-05\nQQQ,20150722 00:00,1121700,1131700,1121600,1126200,30892117,6.220209831204924e-05\nSPY,20150723 00:00,2115400,2116500,2097500,2101800,82429587,6.225867075669182e-05\nQQQ,20150723 00:00,1127400,1131000,1119100,1122000,21618211,6.225867075669182e-05\nSPY,20150724 00:00,2102500,2103700,2076000,2080000,103477607,6.269648478064604e-05\nQQQ,20150724 00:00,1128000,1128600,1109400,1111000,27426504,6.269648478064604e-05\nSPY,20150727 00:00,2069800,2075500,2062600,2067900,115528777,6.282342149894052e-05\nQQQ,20150727 00:00,1104300,1109400,1099400,1101800,31598559,6.282342149894052e-05\nSPY,20150728 00:00,2078000,2095000,2068000,2093300,112137492,6.32100383201795e-05\nQQQ,20150728 00:00,1106500,1113500,1097900,1111300,32169764,6.32100383201795e-05\nSPY,20150729 00:00,2094400,2110400,2093200,2107700,93976149,6.324978564064723e-05\nQQQ,20150729 00:00,1113700,1117900,1109400,1115500,22891930,6.324978564064723e-05\nSPY,20150730 00:00,2102000,2110200,2094200,2108200,84772348,6.324936292854003e-05\nQQQ,20150730 00:00,1112800,1122600,1106200,1120800,21760664,6.324936292854003e-05\nSPY,20150731 00:00,2114400,2114500,2101600,2105000,87268759,6.160174522358887e-05\nQQQ,20150731 00:00,1124400,1124900,1117200,1119500,19592341,6.160174522358887e-05\nSPY,20150803 00:00,2105300,2105300,2086500,2097900,103970825,6.159272677038666e-05\nQQQ,20150803 00:00,1120000,1122800,1108600,1116000,22628113,6.159272677038666e-05\nSPY,20150804 00:00,2097000,2102400,2088000,2093800,75432078,6.143963737245898e-05\nQQQ,20150804 00:00,1115600,1117400,1109300,1113900,20301727,6.143963737245898e-05\nSPY,20150805 00:00,2104000,2113100,2097300,2100700,76059680,6.118922805307051e-05\nQQQ,20150805 00:00,1120100,1130000,1118800,1122500,26749046,6.118922805307051e-05\nSPY,20150806 00:00,2102700,2104100,2076500,2083500,102560139,6.175898810089624e-05\nQQQ,20150806 00:00,1123200,1125000,1099500,1104500,38108680,6.175898810089624e-05\nSPY,20150807 00:00,2081600,2083400,2068700,2079500,100231197,6.168510036736511e-05\nQQQ,20150807 00:00,1101800,1105700,1094000,1103100,26293988,6.168510036736511e-05\nSPY,20150810 00:00,2092900,2106700,2092800,2105700,71084411,6.19258322125227e-05\nQQQ,20150810 00:00,1110500,1118100,1110000,1115700,19112128,6.19258322125227e-05\nSPY,20150811 00:00,2089600,2094700,2077600,2086700,105506895,6.237166364164322e-05\nQQQ,20150811 00:00,1109700,1114100,1095300,1101400,32092237,6.237166364164322e-05\nSPY,20150812 00:00,2071400,2091400,2053600,2089200,161327951,6.237462329009315e-05\nQQQ,20150812 00:00,1093700,1107300,1082200,1105200,38597869,6.237462329009315e-05\nSPY,20150813 00:00,2087500,2095500,2080200,2086600,83612688,6.21235250530104e-05\nQQQ,20150813 00:00,1106800,1111600,1101000,1103400,21330805,6.21235250530104e-05\nSPY,20150814 00:00,2084300,2095000,2082600,2094200,64655468,6.205985038916277e-05\nQQQ,20150814 00:00,1101000,1106700,1098600,1105100,16264603,6.205985038916277e-05\nSPY,20150817 00:00,2087300,2105900,2081600,2105900,72957322,6.223263159449416e-05\nQQQ,20150817 00:00,1102300,1114600,1099600,1114300,20310989,6.223263159449416e-05\nSPY,20150818 00:00,2102900,2106800,2097000,2099800,64867959,6.207877693232575e-05\nQQQ,20150818 00:00,1112800,1113700,1107100,1108600,13174353,6.207877693232575e-05\nSPY,20150819 00:00,2091000,2100100,2073500,2083200,158175490,6.220156686297352e-05\nQQQ,20150819 00:00,1105000,1111000,1094900,1101300,39140424,6.220156686297352e-05\nSPY,20150820 00:00,2065400,2071700,2039100,2039700,168829568,6.45652977710961e-05\nQQQ,20150820 00:00,1091400,1094600,1070700,1070800,52999826,6.45652977710961e-05\nSPY,20150821 00:00,2018100,2029200,1975400,1978300,302127692,6.983098793736317e-05\nQQQ,20150821 00:00,1055500,1064700,1024000,1024000,85631198,6.983098793736317e-05\nSPY,20150824 00:00,1874900,1958400,1829500,1895000,422467681,7.629868857205974e-05\nQQQ,20150824 00:00,941700,1025300,847400,984600,134472193,7.629868857205974e-05\nSPY,20150825 00:00,1954500,1954500,1870600,1872700,309260532,7.639844170101083e-05\nQQQ,20150825 00:00,1021100,1027400,980400,980900,66062248,7.639844170101083e-05\nSPY,20150826 00:00,1922100,1947900,1883700,1944600,286850037,8.411575464770609e-05\nQQQ,20150826 00:00,1009500,1032300,989300,1030300,94961536,8.411575464770609e-05\nSPY,20150827 00:00,1970500,1994100,1952100,1992700,223431181,8.659135829301062e-05\nQQQ,20150827 00:00,1045300,1057000,1032800,1056400,57986325,8.659135829301062e-05\nSPY,20150828 00:00,1985000,1998300,1979200,1992800,125935492,8.658812520065832e-05\nQQQ,20150828 00:00,1050800,1059900,1048500,1056200,43761962,8.658812520065832e-05\nSPY,20150831 00:00,1981400,1991200,1970200,1976700,125137509,8.695658564780099e-05\nQQQ,20150831 00:00,1050300,1056100,1040500,1043100,35157391,8.695658564780099e-05\nSPY,20150901 00:00,1930700,1947600,1907300,1917700,218973748,9.06870548348031e-05\nQQQ,20150901 00:00,1016800,1032900,1006300,1010500,62227907,9.06870548348031e-05\nSPY,20150902 00:00,1946900,1954400,1924300,1954100,135717247,9.28077606613012e-05\nQQQ,20150902 00:00,1028900,1039100,1017000,1039000,37770603,9.28077606613012e-05\nSPY,20150903 00:00,1962500,1980500,1949600,1955500,132209917,9.278595607123786e-05\nQQQ,20150903 00:00,1043200,1050200,1031000,1033900,40175421,9.278595607123786e-05\nSPY,20150904 00:00,1928800,1938600,1916100,1925900,156708531,9.342230984014464e-05\nQQQ,20150904 00:00,1020000,1028400,1015900,1021600,41189839,9.342230984014464e-05\nSPY,20150908 00:00,1959700,1976100,1951800,1974300,101013620,9.625027443823568e-05\nQQQ,20150908 00:00,1041300,1051700,1036900,1050400,34480814,9.625027443823568e-05\nSPY,20150909 00:00,1993300,1994600,1943500,1947900,124972739,9.664605269488593e-05\nQQQ,20150909 00:00,1062800,1063100,1035900,1038600,40940102,9.664605269488593e-05\nSPY,20150910 00:00,1945000,1972200,1942500,1958500,129752786,9.675689714464948e-05\nQQQ,20150910 00:00,1037500,1056800,1036200,1049900,40846811,9.675689714464948e-05\nSPY,20150911 00:00,1953200,1967600,1945400,1967400,99026646,9.685787375744209e-05\nQQQ,20150911 00:00,1045400,1055700,1042100,1055700,25336262,9.685787375744209e-05\nSPY,20150914 00:00,1969500,1970000,1954400,1960100,67361661,9.67807301269964e-05\nQQQ,20150914 00:00,1059800,1059800,1048500,1052500,18237470,9.67807301269964e-05\nSPY,20150915 00:00,1965900,1989900,1960900,1984600,101089338,9.733060115028773e-05\nQQQ,20150915 00:00,1055000,1068200,1051100,1064900,28310624,9.733060115028773e-05\nSPY,20150916 00:00,1988200,2004000,1984100,2001800,87778654,9.726183659917945e-05\nQQQ,20150916 00:00,1065700,1071900,1061400,1070900,29704071,9.726183659917945e-05\nSPY,20150917 00:00,1999600,2028400,1992800,1997300,222001098,9.725652208114895e-05\nQQQ,20150917 00:00,1070000,1087200,1066400,1071300,50633919,9.725652208114895e-05\nSPY,20150918 00:00,1957400,1975600,1949600,1954500,187553370,9.854463747383335e-05\nQQQ,20150918 00:00,1052500,1066000,1051700,1053500,38704240,9.854463747383335e-05\nSPY,20150921 00:00,1964500,1976800,1952200,1964600,89174988,9.853301991215842e-05\nQQQ,20150921 00:00,1059400,1065400,1047400,1056800,31943013,9.853301991215842e-05\nSPY,20150922 00:00,1939000,1944600,1925700,1939100,126149228,9.902446092037705e-05\nQQQ,20150922 00:00,1040500,1044200,1031300,1041000,41367236,9.902446092037705e-05\nSPY,20150923 00:00,1941300,1946700,1929100,1936000,84630237,9.895377375073766e-05\nQQQ,20150923 00:00,1044000,1046600,1036400,1041800,19982982,9.895377375073766e-05\nSPY,20150924 00:00,1921300,1934500,1905600,1929000,138435508,9.86768044528567e-05\nQQQ,20150924 00:00,1031600,1041900,1022700,1038000,32290399,9.86768044528567e-05\nSPY,20150925 00:00,1946100,1950000,1918100,1928500,123731291,9.731273354865336e-05\nQQQ,20150925 00:00,1049500,1050100,1022800,1029200,40582724,9.731273354865336e-05\nSPY,20150928 00:00,1917500,1919000,1876400,1880100,140388758,9.983061424517709e-05\nQQQ,20150928 00:00,1024200,1025300,996900,999900,40162084,9.983061424517709e-05\nSPY,20150929 00:00,1882400,1897400,1869300,1881200,133559566,9.980419854854627e-05\nQQQ,20150929 00:00,1002100,1012600,987500,994700,42893667,9.980419854854627e-05\nSPY,20150930 00:00,1904000,1918200,1894400,1916300,138923111,0.00010152661480581707\nQQQ,20150930 00:00,1008900,1018700,1005000,1017600,39210176,0.00010152661480581707\nSPY,20151001 00:00,1920300,1924900,1898200,1921300,120401494,0.00010070504720891347\nQQQ,20151001 00:00,1019700,1022300,1005900,1022200,39333463,0.00010070504720891347\nSPY,20151002 00:00,1897500,1950000,1891200,1950000,171195207,0.00010172785210707897\nQQQ,20151002 00:00,1008400,1040100,1004800,1040100,50423188,0.00010172785210707897\nSPY,20151005 00:00,1964700,1987400,1963300,1984700,113013522,0.00010230776165784246\nQQQ,20151005 00:00,1047400,1057800,1045500,1055000,30317059,0.00010230776165784246\nSPY,20151006 00:00,1982700,1989800,1970000,1977900,98202913,0.0001023669119157758\nQQQ,20151006 00:00,1052600,1056000,1041800,1050000,30459249,0.0001023669119157758\nSPY,20151007 00:00,1988500,1998300,1974900,1994100,109575864,0.0001016534574940567\nQQQ,20151007 00:00,1056300,1058600,1042900,1056300,35204895,0.0001016534574940567\nSPY,20151008 00:00,1989600,2015500,1985900,2012100,135414276,0.00010049033411935059\nQQQ,20151008 00:00,1052500,1062300,1042100,1060500,46622971,0.00010049033411935059\nSPY,20151009 00:00,2014000,2019000,2005800,2013300,86171310,9.917431365261015e-05\nQQQ,20151009 00:00,1061200,1067300,1058100,1065300,22249821,9.917431365261015e-05\nSPY,20151012 00:00,2014300,2017600,2009100,2015200,49928236,9.801726137007374e-05\nQQQ,20151012 00:00,1067500,1069900,1063500,1067900,15543419,9.801726137007374e-05\nSPY,20151013 00:00,2006300,2021600,2000500,2002500,73963310,9.713408557112237e-05\nQQQ,20151013 00:00,1061900,1072600,1060000,1061000,25378996,9.713408557112237e-05\nSPY,20151014 00:00,2001600,2008700,1989400,1992900,87771536,9.718159312915399e-05\nQQQ,20151014 00:00,1061100,1066300,1054900,1059300,28844025,9.718159312915399e-05\nSPY,20151015 00:00,2000500,2023500,1996400,2023500,115541959,9.790857484912422e-05\nQQQ,20151015 00:00,1063300,1076800,1061800,1076700,32971499,9.790857484912422e-05\nSPY,20151016 00:00,2028200,2032800,2019200,2032700,99255980,9.793210155356619e-05\nQQQ,20151016 00:00,1078900,1081800,1073800,1081200,23317566,9.793210155356619e-05\nSPY,20151019 00:00,2025300,2033700,2021300,2033700,69118218,9.736533293253098e-05\nQQQ,20151019 00:00,1079800,1088100,1077400,1087400,22272493,9.736533293253098e-05\nSPY,20151020 00:00,2028600,2038400,2025500,2031100,69151520,9.686742628592311e-05\nQQQ,20151020 00:00,1085400,1087700,1078100,1081800,20605910,9.686742628592311e-05\nSPY,20151021 00:00,2036400,2037900,2016500,2018500,91935632,9.503247556022475e-05\nQQQ,20151021 00:00,1087500,1088400,1074800,1075200,27188298,9.503247556022475e-05\nSPY,20151022 00:00,2030000,2055100,2028100,2052600,150245339,9.618200765140987e-05\nQQQ,20151022 00:00,1085100,1098000,1081800,1097100,34971791,9.618200765140987e-05\nSPY,20151023 00:00,2072400,2079500,2063000,2075100,122715586,9.669365183249132e-05\nQQQ,20151023 00:00,1126700,1132400,1120700,1127800,45250993,9.669365183249132e-05\nSPY,20151026 00:00,2072700,2073700,2065600,2070000,60360403,9.646969857207563e-05\nQQQ,20151026 00:00,1127100,1130700,1122700,1128500,24142346,9.646969857207563e-05\nSPY,20151027 00:00,2062000,2070000,2058000,2066000,68555036,9.64578912936496e-05\nQQQ,20151027 00:00,1125300,1132400,1125200,1130800,26939008,9.64578912936496e-05\nSPY,20151028 00:00,2070000,2089700,2062100,2089500,120529088,9.615164247207872e-05\nQQQ,20151028 00:00,1132700,1140200,1123400,1140200,38078165,9.615164247207872e-05\nSPY,20151029 00:00,2083600,2092700,2082100,2088300,76891203,9.612873026988962e-05\nQQQ,20151029 00:00,1134900,1140300,1133900,1138400,23226884,9.612873026988962e-05\nSPY,20151030 00:00,2090700,2094400,2078300,2079300,106285063,9.618226573778041e-05\nQQQ,20151030 00:00,1139200,1140800,1133100,1133300,23161165,9.618226573778041e-05\nSPY,20151102 00:00,2083600,2106200,2081800,2103900,76512481,9.60872800555975e-05\nQQQ,20151102 00:00,1136300,1147400,1133900,1146100,21457203,9.60872800555975e-05\nSPY,20151103 00:00,2099800,2116600,2097000,2110000,88875760,9.611558527498054e-05\nQQQ,20151103 00:00,1143800,1154200,1142100,1150100,19280811,9.611558527498054e-05\nSPY,20151104 00:00,2113700,2114900,2097300,2103600,85726190,9.606431841587079e-05\nQQQ,20151104 00:00,1153800,1154700,1145400,1150200,26568612,9.606431841587079e-05\nSPY,20151105 00:00,2104400,2109800,2090900,2101500,70361947,9.609105986527972e-05\nQQQ,20151105 00:00,1151600,1153900,1141100,1147100,22367646,9.609105986527972e-05\nSPY,20151106 00:00,2097400,2103200,2084700,2100400,88269574,9.605090103948818e-05\nQQQ,20151106 00:00,1145100,1149200,1137700,1147900,26724607,9.605090103948818e-05\nSPY,20151109 00:00,2093300,2094900,2069500,2080800,116567529,9.647668227224582e-05\nQQQ,20151109 00:00,1143900,1145100,1128700,1135700,30580591,9.647668227224582e-05\nSPY,20151110 00:00,2075400,2086000,2071900,2085600,66317971,9.641368242249849e-05\nQQQ,20151110 00:00,1129400,1133900,1126300,1132800,32966364,9.641368242249849e-05\nSPY,20151111 00:00,2089000,2089400,2076700,2077400,61997358,9.643313346391789e-05\nQQQ,20151111 00:00,1136000,1141400,1129600,1131400,21495927,9.643313346391789e-05\nSPY,20151112 00:00,2065100,2070600,2048200,2049000,108620680,9.699567151637463e-05\nQQQ,20151112 00:00,1126800,1132300,1119600,1120400,28620767,9.699567151637463e-05\nSPY,20151113 00:00,2043600,2046700,2024400,2025300,138508160,9.790339668300003e-05\nQQQ,20151113 00:00,1115700,1116900,1097800,1098400,48163448,9.790339668300003e-05\nSPY,20151116 00:00,2023000,2056500,2021900,2056500,98680096,9.87606680795646e-05\nQQQ,20151116 00:00,1097300,1114300,1094900,1114200,31274348,9.87606680795646e-05\nSPY,20151117 00:00,2059700,2070300,2048800,2054000,106324660,9.876697696270565e-05\nQQQ,20151117 00:00,1116100,1122900,1112100,1114900,27471264,9.876697696270565e-05\nSPY,20151118 00:00,2060300,2089000,2060100,2086800,102442425,9.979572369822093e-05\nQQQ,20151118 00:00,1119400,1137400,1118300,1136300,31114270,9.979572369822093e-05\nSPY,20151119 00:00,2085500,2090500,2082000,2085400,76035735,9.97609755610101e-05\nQQQ,20151119 00:00,1136900,1142300,1134900,1137100,23931227,9.97609755610101e-05\nSPY,20151120 00:00,2094700,2101200,2088600,2093800,81212191,9.98333653661327e-05\nQQQ,20151120 00:00,1142500,1145700,1141400,1144800,19260571,9.98333653661327e-05\nSPY,20151123 00:00,2094000,2099800,2085300,2090900,60019105,9.982095361373294e-05\nQQQ,20151123 00:00,1145200,1149400,1136600,1141500,19646578,9.982095361373294e-05\nSPY,20151124 00:00,2078700,2098300,2074100,2093700,87434656,9.974031029756467e-05\nQQQ,20151124 00:00,1134100,1143200,1128400,1140500,24969108,9.974031029756467e-05\nSPY,20151125 00:00,2094800,2097400,2090100,2093000,47935311,9.974011429329441e-05\nQQQ,20151125 00:00,1142200,1143600,1139100,1141500,12992442,9.974011429329441e-05\nSPY,20151127 00:00,2094000,2098000,2088700,2095300,29568841,9.970052746508281e-05\nQQQ,20151127 00:00,1143900,1145400,1139300,1143100,7849771,9.970052746508281e-05\nSPY,20151130 00:00,2097900,2098900,2085600,2086900,88383711,9.978523131356878e-05\nQQQ,20151130 00:00,1146500,1146500,1136500,1140200,21683418,9.978523131356878e-05\nSPY,20151201 00:00,2094200,2108200,2091200,2106800,88004669,9.982582605632919e-05\nQQQ,20151201 00:00,1144800,1151600,1143400,1151600,25534944,9.982582605632919e-05\nSPY,20151202 00:00,2106000,2110000,2082300,2085400,97535582,0.00010000668449135415\nQQQ,20151202 00:00,1152500,1157500,1142800,1144500,20645950,0.00010000668449135415\nSPY,20151203 00:00,2089000,2091500,2047600,2055800,136133021,0.00010096539705020948\nQQQ,20151203 00:00,1147600,1149600,1118500,1125100,35431495,0.00010096539705020948\nSPY,20151204 00:00,2061000,2099700,2059400,2096600,163843653,0.00010277614834476926\nQQQ,20151204 00:00,1128500,1153300,1126200,1151400,34604736,0.00010277614834476926\nSPY,20151207 00:00,2092000,2092400,2072000,2082700,91156641,0.0001029095549360813\nQQQ,20151207 00:00,1152200,1152900,1140700,1146200,24149941,0.0001029095549360813\nSPY,20151208 00:00,2064800,2080400,2057800,2069900,88063594,0.00010271551240984725\nQQQ,20151208 00:00,1134200,1150000,1133800,1146300,26535184,0.00010271551240984725\nSPY,20151209 00:00,2062000,2086800,2041800,2053300,141598569,0.00010322331256927101\nQQQ,20151209 00:00,1141300,1147600,1122000,1128900,42158097,0.00010322331256927101\nSPY,20151210 00:00,2054400,2074300,2051500,2058600,104748495,0.00010223160289833598\nQQQ,20151210 00:00,1131400,1141600,1128100,1134000,25002095,0.00010223160289833598\nSPY,20151211 00:00,2033800,2041400,2015100,2018800,179403932,0.00010394746311517964\nQQQ,20151211 00:00,1120900,1123800,1107200,1107900,49050061,0.00010394746311517964\nSPY,20151214 00:00,2021000,2030000,1999700,2030000,149245578,0.00010338211194722212\nQQQ,20151214 00:00,1109400,1116800,1093800,1116300,42789964,0.00010338211194722212\nSPY,20151215 00:00,2046900,2061100,2045500,2050600,136119948,0.00010329825277231787\nQQQ,20151215 00:00,1126600,1132800,1121700,1123100,42768159,0.00010329825277231787\nSPY,20151216 00:00,2063700,2083900,2048300,2080200,173480390,0.00010356610739320322\nQQQ,20151216 00:00,1130900,1141600,1118900,1139800,41588672,0.00010356610739320322\nSPY,20151217 00:00,2083700,2084800,2048400,2048600,153094246,0.00010311693559853138\nQQQ,20151217 00:00,1144800,1144800,1123000,1123200,38526481,0.00010311693559853138\nSPY,20151218 00:00,2027700,2028900,1999800,2000200,210818406,0.00010287606382875287\nQQQ,20151218 00:00,1116300,1118800,1098300,1098300,47556795,0.00010287606382875287\nSPY,20151221 00:00,2014300,2018800,2000900,2017000,85939272,0.00010324446875346516\nQQQ,20151221 00:00,1109000,1110700,1100500,1110500,24164382,0.00010324446875346516\nSPY,20151222 00:00,2027000,2038500,2015500,2035600,94477624,0.00010342699175554387\nQQQ,20151222 00:00,1116400,1119400,1110500,1117800,24205862,0.00010342699175554387\nSPY,20151223 00:00,2047000,2060700,2045800,2060500,100768218,0.00010379302750352958\nQQQ,20151223 00:00,1123600,1126900,1121600,1126100,23531296,0.00010379302750352958\nSPY,20151224 00:00,2057200,2063300,2054300,2056500,37303088,0.00010379672769940682\nQQQ,20151224 00:00,1126100,1129000,1125400,1125900,10830020,0.00010379672769940682\nSPY,20151228 00:00,2048600,2052500,2039500,2052200,61014906,0.00010372253154878915\nQQQ,20151228 00:00,1122600,1125500,1115100,1125300,18294658,0.00010372253154878915\nSPY,20151229 00:00,2065300,2077900,2064700,2074000,82484583,0.00010437534922305942\nQQQ,20151229 00:00,1132000,1145400,1131400,1143000,25563474,0.00010437534922305942\nSPY,20151230 00:00,2070900,2072100,2057600,2059300,56653819,0.00010449020608940671\nQQQ,20151230 00:00,1142000,1142400,1132600,1132700,16521959,0.00010449020608940671\nSPY,20151231 00:00,2051700,2058900,2038900,2038900,88561987,0.00010456795590413844\nQQQ,20151231 00:00,1128900,1130800,1118400,1118600,27209868,0.00010456795590413844\nSPY,20160104 00:00,2005300,2010300,1985900,2010100,194050675,0.00010576940469195884\nQQQ,20160104 00:00,1094500,1096000,1081200,1095000,44020950,0.00010576940469195884\nSPY,20160105 00:00,2013900,2019000,2000500,2013500,95287082,0.00010468748292859612\nQQQ,20160105 00:00,1100400,1101800,1088000,1093100,34272879,0.00010468748292859612\nSPY,20160106 00:00,1983300,2000500,1976000,1988500,125322778,0.00010465259367912276\nQQQ,20160106 00:00,1074100,1088900,1074100,1082600,38920777,0.00010465259367912276\nSPY,20160107 00:00,1953200,1974300,1935900,1939900,186961947,0.00010709623701193511\nQQQ,20160107 00:00,1059500,1072900,1048100,1048700,54364285,0.00010709623701193511\nSPY,20160108 00:00,1952100,1958500,1915800,1919500,167303627,0.0001060842397926401\nQQQ,20160108 00:00,1056300,1062900,1039000,1040100,56883349,0.0001060842397926401\nSPY,20160111 00:00,1930500,1934000,1898300,1921100,170857466,0.00010588074436569659\nQQQ,20160111 00:00,1047500,1050600,1027300,1043300,44653532,0.00010588074436569659\nSPY,20160112 00:00,1938500,1945500,1911400,1936600,149409008,0.0001059436877180884\nQQQ,20160112 00:00,1053300,1060700,1040800,1055400,43529730,0.0001059436877180884\nSPY,20160113 00:00,1945300,1948600,1883800,1888700,188087693,0.00010932826488418641\nQQQ,20160113 00:00,1059700,1062200,1017400,1019000,60799713,0.00010932826488418641\nSPY,20160114 00:00,1895500,1932600,1876600,1918900,190012996,0.00011056800404774536\nQQQ,20160114 00:00,1023600,1049700,1006700,1040700,65779962,0.00011056800404774536\nSPY,20160115 00:00,1867900,1887600,1855200,1878300,270477512,0.00011267315742077728\nQQQ,20160115 00:00,1006200,1019400,995100,1008400,78400205,0.00011267315742077728\nSPY,20160119 00:00,1899500,1901100,1862100,1880600,162816196,0.00011205549005526087\nQQQ,20160119 00:00,1022100,1023700,998800,1010600,49036071,0.00011205549005526087\nSPY,20160120 00:00,1850000,1874900,1810200,1858100,227085634,0.00011212323997102243\nQQQ,20160120 00:00,994700,1018300,972600,1007500,68557035,0.00011212323997102243\nSPY,20160121 00:00,1861900,1888700,1846500,1867000,146780065,0.00011203867696924585\nQQQ,20160121 00:00,1011800,1023400,998200,1008500,45952520,0.00011203867696924585\nSPY,20160122 00:00,1897800,1907600,1888800,1905500,138442684,0.00011334225664377706\nQQQ,20160122 00:00,1028800,1038100,1025300,1037700,36278141,0.00011334225664377706\nSPY,20160125 00:00,1899100,1901500,1874100,1876300,106621985,0.00011427656602610584\nQQQ,20160125 00:00,1034000,1039900,1021400,1022300,33372429,0.00011427656602610584\nSPY,20160126 00:00,1884400,1905300,1880300,1902400,122035268,0.0001147963924966811\nQQQ,20160126 00:00,1026600,1035900,1017600,1031500,30207695,0.0001147963924966811\nSPY,20160127 00:00,1895800,1915600,1870600,1881400,146285880,0.00011456048208963811\nQQQ,20160127 00:00,1025800,1029900,1001500,1005800,43080545,0.00011456048208963811\nSPY,20160128 00:00,1900000,1902000,1871700,1891700,112813076,0.00011461199912367194\nQQQ,20160128 00:00,1022500,1022900,1002700,1020000,37061022,0.00011461199912367194\nSPY,20160129 00:00,1900300,1938700,1898800,1938700,168702015,0.00011631922442417176\nQQQ,20160129 00:00,1019700,1041700,1019400,1041300,45849215,0.00011631922442417176\nSPY,20160201 00:00,1925000,1945800,1918500,1936500,110539586,0.0001159141729466389\nQQQ,20160201 00:00,1036300,1048000,1032300,1044100,28099108,0.0001159141729466389\nSPY,20160202 00:00,1919000,1919600,1895400,1901100,155214611,0.00011706986836026613\nQQQ,20160202 00:00,1039300,1039700,1018400,1021500,40295051,0.00011706986836026613\nSPY,20160203 00:00,1913700,1917800,1871100,1912300,163410140,0.00011638984806159824\nQQQ,20160203 00:00,1028300,1028300,998800,1016600,49835631,0.00011638984806159824\nSPY,20160204 00:00,1907200,1927400,1899600,1915300,108163692,0.00011637611648279837\nQQQ,20160204 00:00,1013900,1024500,1004400,1016500,38761193,0.00011637611648279837\nSPY,20160205 00:00,1909700,1910800,1872000,1879800,146276261,0.00011853102932705085\nQQQ,20160205 00:00,1012700,1013200,977200,981200,59948909,0.00011853102932705085\nSPY,20160208 00:00,1857500,1861200,1828100,1853500,154383523,0.00011928743566993066\nQQQ,20160208 00:00,962900,970500,948400,966200,76925794,0.00011928743566993066\nSPY,20160209 00:00,1833800,1869300,1832100,1853500,146059137,0.00011923494327567921\nQQQ,20160209 00:00,953300,977800,951800,963200,61525623,0.00011923494327567921\nSPY,20160210 00:00,1864400,1883200,1851200,1853100,117266734,0.00011855752415312072\nQQQ,20160210 00:00,974300,986900,966200,966900,45562783,0.00011855752415312072\nSPY,20160211 00:00,1823800,1841000,1810900,1830300,163939145,0.00011859651187642997\nQQQ,20160211 00:00,954600,973200,951900,965500,58684176,0.00011859651187642997\nSPY,20160212 00:00,1849300,1866500,1839700,1866500,104243751,0.00011936585602941328\nQQQ,20160212 00:00,976400,981200,967300,980200,44003341,0.00011936585602941328\nSPY,20160216 00:00,1887800,1898100,1876400,1898100,96542669,0.00012077693086066756\nQQQ,20160216 00:00,994700,1002300,988500,1002300,32545076,0.00012077693086066756\nSPY,20160217 00:00,1911200,1933200,1910100,1928700,118038289,0.00012225984314864045\nQQQ,20160217 00:00,1009600,1026400,1007000,1025000,36522271,0.00012225984314864045\nSPY,20160218 00:00,1932200,1932600,1917200,1920500,90826534,0.00012243642487144254\nQQQ,20160218 00:00,1028200,1028300,1012000,1013300,32951179,0.00012243642487144254\nSPY,20160219 00:00,1911500,1921800,1904500,1920000,98439467,0.00012244723442885426\nQQQ,20160219 00:00,1008400,1019400,1006200,1016300,25162410,0.00012244723442885426\nSPY,20160222 00:00,1939000,1949500,1938000,1948300,88924304,0.00012325106904446486\nQQQ,20160222 00:00,1025800,1033800,1024800,1032800,21959855,0.00012325106904446486\nSPY,20160223 00:00,1939900,1943200,1921800,1923300,94280136,0.00012406660037362748\nQQQ,20160223 00:00,1026800,1029600,1015100,1015800,26878182,0.00012406660037362748\nSPY,20160224 00:00,1906200,1935300,1893200,1932300,125633728,0.0001242481288101076\nQQQ,20160224 00:00,1003900,1026800,997700,1025500,37544135,0.0001242481288101076\nSPY,20160225 00:00,1937300,1955500,1928300,1955500,98561286,0.00012473025028428002\nQQQ,20160225 00:00,1027600,1035600,1018400,1035600,27092847,0.00012473025028428002\nSPY,20160226 00:00,1965200,1966800,1949000,1951000,111611131,0.0001247576208539302\nQQQ,20160226 00:00,1043500,1043600,1031900,1034300,28087183,0.0001247576208539302\nSPY,20160229 00:00,1950800,1962300,1934400,1935600,101903944,0.0001249740058267869\nQQQ,20160229 00:00,1033300,1041000,1025000,1025000,24891677,0.0001249740058267869\nSPY,20160301 00:00,1950500,1982100,1944600,1982100,120346342,0.00012784812382752824\nQQQ,20160301 00:00,1034800,1057900,1031600,1057900,34994483,0.00012784812382752824\nSPY,20160302 00:00,1977000,1990600,1972500,1990300,89104136,0.00012778339225207034\nQQQ,20160302 00:00,1056600,1058500,1050100,1058300,26887677,0.00012778339225207034\nSPY,20160303 00:00,1987000,1997900,1981100,1997700,89517942,0.00012769132021721592\nQQQ,20160303 00:00,1057200,1057500,1048700,1056300,22589009,0.00012769132021721592\nSPY,20160304 00:00,2000000,2013500,1990300,2003600,106711620,0.00012768520169930892\nQQQ,20160304 00:00,1057500,1063500,1049700,1056700,27500528,0.00012768520169930892\nSPY,20160307 00:00,1994000,2010700,1992700,2006300,83187387,0.00012701066518064217\nQQQ,20160307 00:00,1051300,1057400,1042700,1050200,24615843,0.00012701066518064217\nSPY,20160308 00:00,1993000,1999200,1982200,1983600,108213232,0.0001273296942005488\nQQQ,20160308 00:00,1043000,1052100,1039700,1041500,27109086,0.0001273296942005488\nSPY,20160309 00:00,1993600,1997900,1984300,1994100,80085909,0.0001262824222918957\nQQQ,20160309 00:00,1045400,1048300,1039700,1048200,25609559,0.0001262824222918957\nSPY,20160310 00:00,1999000,2010500,1973800,1995400,128146107,0.0001262225258188882\nQQQ,20160310 00:00,1052600,1058700,1033100,1046600,38607172,0.0001262225258188882\nSPY,20160311 00:00,2012500,2028100,2011300,2027600,115060016,0.0001270107323198137\nQQQ,20160311 00:00,1057900,1064900,1054600,1064900,28959137,0.0001270107323198137\nSPY,20160314 00:00,2022000,2030300,2017700,2025300,64367388,0.00012689325972944286\nQQQ,20160314 00:00,1060900,1069200,1060600,1066700,22704436,0.00012689325972944286\nSPY,20160315 00:00,2013200,2022000,2010600,2022000,83697700,0.00012620025826201472\nQQQ,20160315 00:00,1062900,1067500,1059500,1066300,25498145,0.00012620025826201472\nSPY,20160316 00:00,2016200,2038200,2015600,2033900,112017848,0.00012642712790258308\nQQQ,20160316 00:00,1063700,1078600,1063400,1075800,25722466,0.00012642712790258308\nSPY,20160317 00:00,2032600,2052200,2027700,2047900,116797254,0.00012595439474995376\nQQQ,20160317 00:00,1072700,1077700,1068700,1075200,24837678,0.00012595439474995376\nSPY,20160318 00:00,2042000,2047800,2038000,2045200,118003097,0.00012598630588661204\nQQQ,20160318 00:00,1074600,1076300,1068000,1073700,34702877,0.00012598630588661204\nSPY,20160321 00:00,2041100,2049400,2038100,2046900,65685245,0.00012592477225893128\nQQQ,20160321 00:00,1071800,1078900,1071200,1077900,14364000,0.00012592477225893128\nSPY,20160322 00:00,2037400,2052300,2035700,2046200,83178482,0.0001259046823128771\nQQQ,20160322 00:00,1071800,1083700,1071700,1081200,17551682,0.0001259046823128771\nSPY,20160323 00:00,2041100,2043300,2030100,2032200,69049169,0.00012604785468187088\nQQQ,20160323 00:00,1079100,1079900,1069900,1072300,19249855,0.00012604785468187088\nSPY,20160324 00:00,2019800,2031600,2017400,2031100,71333708,0.00012470778997576414\nQQQ,20160324 00:00,1067100,1072900,1065400,1072600,16577767,0.00012470778997576414\nSPY,20160328 00:00,2036200,2038500,2027100,2032700,53066451,0.00012466904126425096\nQQQ,20160328 00:00,1075600,1075800,1069200,1071100,13193281,0.00012466904126425096\nSPY,20160329 00:00,2027500,2052300,2024100,2052300,83887128,0.00012524204195312738\nQQQ,20160329 00:00,1069100,1089000,1067400,1088300,26809882,0.00012524204195312738\nSPY,20160330 00:00,2063500,2068700,2055900,2061000,76192165,0.0001247780943728855\nQQQ,20160330 00:00,1094800,1100400,1091300,1093600,22560356,0.0001247780943728855\nSPY,20160331 00:00,2058700,2064100,2053300,2055600,76146466,0.00012442109424293035\nQQQ,20160331 00:00,1092800,1096900,1090400,1092000,18504785,0.00012442109424293035\nSPY,20160401 00:00,2043500,2071400,2039900,2069100,92124925,0.00012461219027442926\nQQQ,20160401 00:00,1085400,1104000,1083900,1103600,23785449,0.00012461219027442926\nSPY,20160404 00:00,2068400,2070700,2058900,2062900,56532432,0.00012465653177149973\nQQQ,20160404 00:00,1103600,1104400,1096800,1099400,15263058,0.00012465653177149973\nSPY,20160405 00:00,2046400,2052500,2039000,2041400,81083900,0.00012484613750402324\nQQQ,20160405 00:00,1090900,1095000,1087400,1088800,17405013,0.00012484613750402324\nSPY,20160406 00:00,2042700,2064900,2039800,2064600,80656346,0.0001255589848876239\nQQQ,20160406 00:00,1089900,1107100,1089900,1106700,22246888,0.0001255589848876239\nSPY,20160407 00:00,2051800,2055600,2030900,2038900,102193798,0.00012617292006463982\nQQQ,20160407 00:00,1100300,1102200,1086100,1090800,27300196,0.00012617292006463982\nSPY,20160408 00:00,2053200,2058400,2038800,2044800,85480012,0.0001260563123851597\nQQQ,20160408 00:00,1097600,1100200,1086200,1090000,20874722,0.0001260563123851597\nSPY,20160411 00:00,2052300,2060700,2039100,2039900,73916328,0.00012600476348206168\nQQQ,20160411 00:00,1094700,1100200,1085900,1086000,22181556,0.00012600476348206168\nSPY,20160412 00:00,2042000,2062500,2037000,2059900,100704771,0.00012627824237939445\nQQQ,20160412 00:00,1086800,1097200,1080200,1095100,25024412,0.00012627824237939445\nSPY,20160413 00:00,2070200,2081000,2068400,2080400,85422095,0.00012680213671008745\nQQQ,20160413 00:00,1103500,1110800,1102100,1109100,22696366,0.00012680213671008745\nSPY,20160414 00:00,2080300,2086000,2076000,2080200,55930929,0.000126689931161712\nQQQ,20160414 00:00,1109300,1113300,1106200,1109200,16622024,0.000126689931161712\nSPY,20160415 00:00,2080000,2081100,2074000,2078000,69798928,0.00012669930840293963\nQQQ,20160415 00:00,1108300,1110600,1103600,1106400,18678370,0.00012669930840293963\nSPY,20160418 00:00,2071100,2092700,2070000,2092500,69184743,0.00012611222524845322\nQQQ,20160418 00:00,1103200,1112600,1102500,1112300,15549236,0.00012611222524845322\nSPY,20160419 00:00,2097000,2102000,2089400,2099100,81005196,0.00012550919784309992\nQQQ,20160419 00:00,1114400,1114400,1098800,1105500,33797563,0.00012550919784309992\nSPY,20160420 00:00,2099000,2109200,2094000,2100700,68129528,0.00012553140160787558\nQQQ,20160420 00:00,1105500,1111400,1101700,1106400,16292426,0.00012553140160787558\nSPY,20160421 00:00,2101300,2102500,2086600,2089000,66185715,0.0001254271801907199\nQQQ,20160421 00:00,1105800,1110400,1101500,1106500,16604689,0.0001254271801907199\nSPY,20160422 00:00,2085300,2092900,2079200,2089600,81454081,0.00012537305673118197\nQQQ,20160422 00:00,1092100,1097200,1081200,1089800,36436003,0.00012537305673118197\nSPY,20160425 00:00,2082800,2086200,2075400,2085900,54918433,0.0001252563795974044\nQQQ,20160425 00:00,1086500,1089900,1084500,1089800,13120373,0.0001252563795974044\nSPY,20160426 00:00,2090200,2095200,2083700,2090000,67103310,0.00012517359346484795\nQQQ,20160426 00:00,1092100,1093900,1081200,1084500,14936225,0.00012517359346484795\nSPY,20160427 00:00,2084600,2098100,2080600,2093800,65535983,0.00012514237340374108\nQQQ,20160427 00:00,1073400,1078300,1066900,1075800,27772991,0.00012514237340374108\nSPY,20160428 00:00,2084900,2097600,2069700,2074200,80393263,0.00012548524095056118\nQQQ,20160428 00:00,1077000,1083300,1060800,1062800,24518367,0.00012548524095056118\nSPY,20160429 00:00,2067100,2071300,2050300,2063000,110829381,0.00012500029642384042\nQQQ,20160429 00:00,1062800,1065000,1048800,1057200,61807683,0.00012500029642384042\nSPY,20160502 00:00,2069000,2081800,2064100,2080300,55377797,0.00012476188571617708\nQQQ,20160502 00:00,1059900,1068700,1055600,1067200,21181924,0.00012476188571617708\nSPY,20160503 00:00,2065000,2067900,2052800,2061300,89754991,0.00012507626978351327\nQQQ,20160503 00:00,1059600,1064300,1054500,1057300,31740729,0.00012507626978351327\nSPY,20160504 00:00,2050000,2058300,2044200,2049600,74239405,0.00012446510397602387\nQQQ,20160504 00:00,1050900,1054800,1048000,1050500,22955639,0.00012446510397602387\nSPY,20160505 00:00,2055700,2059800,2044700,2049500,57183088,0.00012434987148682102\nQQQ,20160505 00:00,1054700,1056600,1048100,1050200,18539892,0.00012434987148682102\nSPY,20160506 00:00,2040400,2057700,2038800,2057000,70502951,0.00012433228913171358\nQQQ,20160506 00:00,1045000,1056000,1044000,1055800,26421287,0.00012433228913171358\nSPY,20160509 00:00,2055800,2064000,2053700,2058900,60302710,0.00012367936778801813\nQQQ,20160509 00:00,1055900,1063700,1055400,1058800,16140332,0.00012367936778801813\nSPY,20160510 00:00,2066400,2084600,2066400,2084600,65978296,0.0001242847877597619\nQQQ,20160510 00:00,1062600,1073800,1060700,1073300,20620530,0.0001242847877597619\nSPY,20160511 00:00,2078900,2083300,2065000,2065000,72657913,0.00012457118307914443\nQQQ,20160511 00:00,1071500,1074900,1063300,1063600,17987786,0.00012457118307914443\nSPY,20160512 00:00,2072900,2074800,2053700,2065500,77898879,0.00012456354689908373\nQQQ,20160512 00:00,1066100,1067400,1051400,1058900,27023527,0.00012456354689908373\nSPY,20160513 00:00,2062300,2068600,2043800,2047200,83635846,0.00012407951607735715\nQQQ,20160513 00:00,1058000,1064500,1053000,1055000,17780734,0.00012407951607735715\nSPY,20160516 00:00,2049500,2073400,2048900,2068100,68003049,0.00012459363406877995\nQQQ,20160516 00:00,1056600,1072100,1055700,1068200,16662116,0.00012459363406877995\nSPY,20160517 00:00,2064400,2068000,2042300,2048200,100223310,0.00012501233994605433\nQQQ,20160517 00:00,1067300,1070400,1052000,1054800,26056588,0.00012501233994605433\nSPY,20160518 00:00,2044400,2063000,2036400,2049100,102872425,0.00012501933221156645\nQQQ,20160518 00:00,1052400,1064300,1050400,1058600,23889263,0.00012501933221156645\nSPY,20160519 00:00,2040000,2045400,2027800,2042400,104044038,0.00012508555163061476\nQQQ,20160519 00:00,1054500,1057000,1045400,1053100,24578667,0.00012508555163061476\nSPY,20160520 00:00,2049500,2060900,2048600,2054900,90968053,0.00012529744778648328\nQQQ,20160520 00:00,1057300,1069000,1056800,1064700,27063887,0.00012529744778648328\nSPY,20160523 00:00,2054800,2058400,2049900,2051600,52302088,0.00012529666973631472\nQQQ,20160523 00:00,1065900,1069700,1062300,1063300,13250193,0.00012529666973631472\nSPY,20160524 00:00,2061500,2082400,2061400,2078700,84293252,0.00012586508478681783\nQQQ,20160524 00:00,1069200,1085900,1068900,1084600,25304493,0.00012586508478681783\nSPY,20160525 00:00,2086400,2097700,2086200,2092600,71874969,0.00012545964281868402\nQQQ,20160525 00:00,1088700,1095700,1086900,1092400,37124817,0.00012545964281868402\nSPY,20160526 00:00,2094700,2097100,2089700,2093400,48058849,0.00012545691865873082\nQQQ,20160526 00:00,1093700,1097000,1090900,1095600,20023555,0.00012545691865873082\nSPY,20160527 00:00,2095500,2102100,2094700,2102100,53233980,0.00012538662054210203\nQQQ,20160527 00:00,1096300,1101400,1096100,1101300,16913314,0.00012538662054210203\nSPY,20160531 00:00,2105300,2106900,2091800,2100800,87775464,0.000125356913082903\nQQQ,20160531 00:00,1102800,1105100,1097900,1103400,22259453,0.000125356913082903\nSPY,20160601 00:00,2091500,2104800,2088900,2103000,64263039,0.00012534734193447806\nQQQ,20160601 00:00,1100000,1106000,1099100,1103500,18990799,0.00012534734193447806\nSPY,20160602 00:00,2098000,2109200,2092400,2109200,56601095,0.00012534185425981158\nQQQ,20160602 00:00,1101300,1105900,1095300,1105800,14573816,0.00012534185425981158\nSPY,20160603 00:00,2103200,2106900,2088600,2102800,89799792,0.00012516041219121814\nQQQ,20160603 00:00,1103700,1104200,1093400,1100600,19005526,0.00012516041219121814\nSPY,20160606 00:00,2107100,2117600,2105100,2113900,57500239,0.00012520885742772027\nQQQ,20160606 00:00,1102600,1107500,1100700,1104600,12206740,0.00012520885742772027\nSPY,20160607 00:00,2115600,2123400,2115000,2117000,52942760,0.0001249399588885216\nQQQ,20160607 00:00,1105200,1106300,1101300,1101800,11714181,0.0001249399588885216\nSPY,20160608 00:00,2118000,2125200,2116900,2123900,57416846,0.0001249582885933988\nQQQ,20160608 00:00,1103700,1105900,1099600,1103700,13230934,0.0001249582885933988\nSPY,20160609 00:00,2114900,2122200,2111900,2120400,72933317,0.0001243330989764515\nQQQ,20160609 00:00,1099200,1103100,1097100,1101900,17004569,0.0001243330989764515\nSPY,20160610 00:00,2104300,2108600,2094400,2100300,100123152,0.00012474931800765223\nQQQ,20160610 00:00,1091900,1094000,1085600,1089400,31816092,0.00012474931800765223\nSPY,20160613 00:00,2093400,2103700,2083500,2084200,99528764,0.00012475412216477475\nQQQ,20160613 00:00,1083200,1089300,1078900,1080300,23793618,0.00012475412216477475\nSPY,20160614 00:00,2079700,2087400,2069200,2080900,112987135,0.00012466805887549368\nQQQ,20160614 00:00,1077400,1084200,1072400,1080300,23284140,0.00012466805887549368\nSPY,20160615 00:00,2085700,2092000,2075300,2077800,94632612,0.0001245689526707164\nQQQ,20160615 00:00,1082900,1084400,1075400,1077200,22349990,0.0001245689526707164\nSPY,20160616 00:00,2067400,2085700,2055900,2083500,139759122,0.00012458346865736045\nQQQ,20160616 00:00,1071900,1081400,1065000,1080400,30003216,0.00012458346865736045\nSPY,20160617 00:00,2071400,2072000,2057500,2065300,108517057,0.00012447476579172416\nQQQ,20160617 00:00,1075300,1075600,1062400,1064900,27359949,0.00012447476579172416\nSPY,20160620 00:00,2088400,2096000,2077500,2079100,74625875,0.00012438038438725125\nQQQ,20160620 00:00,1077300,1082400,1070800,1071600,19633136,0.00012438038438725125\nSPY,20160621 00:00,2082600,2089200,2077900,2084100,66630510,0.00012425993645975893\nQQQ,20160621 00:00,1073000,1077100,1071000,1075000,21579600,0.00012425993645975893\nSPY,20160622 00:00,2086900,2094900,2079400,2080300,90582991,0.00012427457085022162\nQQQ,20160622 00:00,1075600,1081900,1071500,1072400,19196650,0.00012427457085022162\nSPY,20160623 00:00,2098300,2108700,2092700,2108700,86757627,0.00012490105312980084\nQQQ,20160623 00:00,1080700,1087900,1076200,1087700,17263349,0.00012490105312980084\nSPY,20160624 00:00,2040000,2069000,2027200,2031300,294018070,0.00013089247169330518\nQQQ,20160624 00:00,1049000,1065000,1040700,1042900,63088407,0.00013089247169330518\nSPY,20160627 00:00,2015900,2015900,1986500,1995300,216490003,0.0001322724875259804\nQQQ,20160627 00:00,1036000,1036000,1017500,1022200,46626203,0.0001322724875259804\nSPY,20160628 00:00,2016600,2032200,2011200,2032200,145242853,0.0001319400118154971\nQQQ,20160628 00:00,1033500,1045100,1033000,1044600,26073817,0.0001319400118154971\nSPY,20160629 00:00,2048300,2069300,2047200,2067100,122034443,0.00013311780939864235\nQQQ,20160629 00:00,1052800,1065300,1052400,1063100,29668019,0.00013311780939864235\nSPY,20160630 00:00,2071800,2095400,2065600,2095300,140612123,0.00013349047579645632\nQQQ,20160630 00:00,1064900,1076000,1061300,1075400,30429572,0.00013349047579645632\nSPY,20160701 00:00,2092900,2104900,2092900,2097900,92251985,0.00013351369532972086\nQQQ,20160701 00:00,1074900,1084800,1074500,1080800,19531458,0.00013351369532972086\nSPY,20160705 00:00,2089000,2090800,2077100,2083900,99629966,0.00013365252689169678\nQQQ,20160705 00:00,1075100,1076600,1068400,1074200,19314640,0.00013365252689169678\nSPY,20160706 00:00,2078700,2098000,2070600,2097700,87769094,0.0001338036464058638\nQQQ,20160706 00:00,1069100,1083500,1065700,1083000,22961895,0.0001338036464058638\nSPY,20160707 00:00,2098900,2106400,2086300,2095400,76391364,0.00013260828081106894\nQQQ,20160707 00:00,1084000,1088600,1081100,1086200,17526516,0.00013260828081106894\nSPY,20160708 00:00,2110000,2129400,2107800,2127000,114482147,0.00013351900428793404\nQQQ,20160708 00:00,1092000,1103600,1090200,1103000,25680410,0.00013351900428793404\nSPY,20160711 00:00,2131600,2140700,2129500,2134500,67609333,0.00013284802041048705\nQQQ,20160711 00:00,1106700,1113400,1106600,1109300,18578691,0.00013284802041048705\nSPY,20160712 00:00,2145100,2153000,2142500,2150000,91585333,0.00013223291049577356\nQQQ,20160712 00:00,1116100,1117900,1113400,1114900,20556785,0.00013223291049577356\nSPY,20160713 00:00,2154200,2154500,2143500,2149300,77887465,0.0001321302523835151\nQQQ,20160713 00:00,1117500,1118200,1112200,1112200,20285318,0.0001321302523835151\nSPY,20160714 00:00,2163400,2166600,2156600,2161100,81647966,0.000132274743155061\nQQQ,20160714 00:00,1119600,1121900,1117000,1119800,19711925,0.000132274743155061\nSPY,20160715 00:00,2167900,2168200,2153100,2158400,88704013,0.00013184391678149572\nQQQ,20160715 00:00,1122400,1123000,1115500,1118000,15768055,0.00013184391678149572\nSPY,20160718 00:00,2159500,2166000,2156700,2164100,48647808,0.00013186748000007097\nQQQ,20160718 00:00,1118700,1127400,1118500,1125400,18868100,0.00013186748000007097\nSPY,20160719 00:00,2158800,2162300,2156500,2161800,43905369,0.00013187965111808778\nQQQ,20160719 00:00,1121500,1124700,1119300,1121300,16190351,0.00013187965111808778\nSPY,20160720 00:00,2167500,2173700,2162400,2171300,52553592,0.00013206617782702878\nQQQ,20160720 00:00,1127400,1136500,1126000,1134400,21979892,0.00013206617782702878\nSPY,20160721 00:00,2169200,2172200,2157500,2162200,63005168,0.0001320187390393817\nQQQ,20160721 00:00,1135200,1137400,1128700,1131800,17868626,0.0001320187390393817\nSPY,20160722 00:00,2163900,2173000,2161000,2172500,52576045,0.0001320037045538437\nQQQ,20160722 00:00,1132600,1137800,1129200,1136500,17919229,0.0001320037045538437\nSPY,20160725 00:00,2170000,2170600,2159700,2166400,49718650,0.0001315848926835846\nQQQ,20160725 00:00,1135600,1136900,1132800,1136600,12503677,0.0001315848926835846\nSPY,20160726 00:00,2165300,2171700,2157600,2167500,64796484,0.00013138172107305285\nQQQ,20160726 00:00,1136200,1142000,1132200,1137900,19621479,0.00013138172107305285\nSPY,20160727 00:00,2171700,2172700,2156200,2165100,73524223,0.00013094163130791602\nQQQ,20160727 00:00,1147500,1148800,1141000,1145800,22704072,0.00013094163130791602\nSPY,20160728 00:00,2162600,2171100,2157500,2168000,59237051,0.00013086135882365183\nQQQ,20160728 00:00,1147500,1151100,1144000,1149800,14847431,0.00013086135882365183\nSPY,20160729 00:00,2164500,2175400,2161300,2171500,68771465,0.00013087155127700992\nQQQ,20160729 00:00,1152000,1155400,1148700,1152300,20810707,0.00013087155127700992\nSPY,20160801 00:00,2171500,2176500,2164100,2169300,65459572,0.00013083820897150016\nQQQ,20160801 00:00,1153100,1161300,1151700,1158400,13509130,0.00013083820897150016\nSPY,20160802 00:00,2166400,2168300,2145800,2155200,86422053,0.0001309985727130331\nQQQ,20160802 00:00,1156700,1157700,1142200,1149600,19858833,0.0001309985727130331\nSPY,20160803 00:00,2154500,2162400,2151300,2162300,46176692,0.00013101928083349287\nQQQ,20160803 00:00,1148700,1153500,1148100,1153400,13242595,0.00013101928083349287\nSPY,20160804 00:00,2163000,2167800,2158300,2164300,40200895,0.0001309339632536635\nQQQ,20160804 00:00,1153000,1157800,1150400,1156700,12152693,0.0001309339632536635\nSPY,20160805 00:00,2171900,2182300,2170700,2181400,61991590,0.0001306754762725583\nQQQ,20160805 00:00,1162600,1170400,1161300,1167800,19130371,0.0001306754762725583\nSPY,20160808 00:00,2183900,2185200,2177400,2180500,36959153,0.00013066564205679385\nQQQ,20160808 00:00,1168400,1168700,1162800,1166500,11212368,0.00013066564205679385\nSPY,20160809 00:00,2181200,2187600,2178000,2182200,48239720,0.0001301210064043499\nQQQ,20160809 00:00,1167400,1172800,1166700,1169200,13573049,0.0001301210064043499\nSPY,20160810 00:00,2182900,2184000,2172300,2176300,51678201,0.0001296719766457702\nQQQ,20160810 00:00,1169900,1170200,1163200,1166200,14145957,0.0001296719766457702\nSPY,20160811 00:00,2182500,2189400,2179500,2186800,65858201,0.00012973267612597636\nQQQ,20160811 00:00,1170200,1173700,1167800,1171200,12005676,0.00012973267612597636\nSPY,20160812 00:00,2182600,2187100,2179900,2184100,48330938,0.00012971902409701877\nQQQ,20160812 00:00,1169200,1172100,1167900,1172000,17743232,0.00012971902409701877\nSPY,20160815 00:00,2188900,2195000,2188800,2190900,43891571,0.00012974768337995057\nQQQ,20160815 00:00,1173500,1179700,1173200,1177000,11481381,0.00012974768337995057\nSPY,20160816 00:00,2185600,2186800,2179600,2179600,48785828,0.00012970077144922336\nQQQ,20160816 00:00,1174800,1174900,1170300,1170500,13348580,0.00012970077144922336\nSPY,20160817 00:00,2179800,2185300,2170200,2183800,69540455,0.00012964432138335487\nQQQ,20160817 00:00,1170800,1173000,1164300,1172600,14855132,0.00012964432138335487\nSPY,20160818 00:00,2183100,2189000,2182200,2189000,49012060,0.00012941997205447194\nQQQ,20160818 00:00,1171500,1174600,1169500,1172900,9071625,0.00012941997205447194\nSPY,20160819 00:00,2183400,2187500,2177400,2185600,68512765,0.00012705589355902543\nQQQ,20160819 00:00,1170800,1175200,1167600,1172600,17196221,0.00012705589355902543\nSPY,20160822 00:00,2182500,2188000,2178300,2185100,56032026,0.00012168154814355723\nQQQ,20160822 00:00,1170900,1175500,1168700,1173500,14042742,0.00012168154814355723\nSPY,20160823 00:00,2192300,2196000,2189000,2189300,49279171,0.00011503230461796903\nQQQ,20160823 00:00,1178100,1180000,1175100,1175600,11351356,0.00011503230461796903\nSPY,20160824 00:00,2188000,2189100,2173600,2178800,62792016,0.00011496513409819336\nQQQ,20160824 00:00,1174800,1176400,1164100,1168000,16723656,0.00011496513409819336\nSPY,20160825 00:00,2174000,2181900,2172200,2176600,61431694,0.00010749097428811875\nQQQ,20160825 00:00,1165000,1169700,1163600,1166100,22287155,0.00010749097428811875\nSPY,20160826 00:00,2179000,2191100,2162500,2172800,116455917,0.00010508053624240111\nQQQ,20160826 00:00,1166500,1175400,1160800,1167800,23406014,0.00010508053624240111\nSPY,20160829 00:00,2174300,2186600,2174000,2183400,60888768,0.00010509573028109907\nQQQ,20160829 00:00,1168100,1172500,1167900,1169400,10914791,0.00010509573028109907\nSPY,20160830 00:00,2182500,2185900,2173500,2179800,52513386,0.00010468992800025501\nQQQ,20160830 00:00,1167500,1170900,1161600,1165600,18464823,0.00010468992800025501\nSPY,20160831 00:00,2176400,2177500,2164700,2174400,71308010,0.00010086288050920043\nQQQ,20160831 00:00,1163800,1165600,1159500,1164400,15328565,0.00010086288050920043\nSPY,20160901 00:00,2173800,2177300,2160300,2173700,89011329,9.882265917441703e-05\nQQQ,20160901 00:00,1164800,1168800,1159200,1167400,19241076,9.882265917441703e-05\nSPY,20160902 00:00,2183600,2188700,2177000,2183600,70476391,9.88720099787485e-05\nQQQ,20160902 00:00,1173200,1175600,1166800,1171200,16736947,9.88720099787485e-05\nSPY,20160906 00:00,2187200,2190900,2178600,2190900,48541412,9.815639972795626e-05\nQQQ,20160906 00:00,1173200,1178500,1170700,1178500,17081737,9.815639972795626e-05\nSPY,20160907 00:00,2188400,2192200,2183100,2190100,72763936,9.544685244302931e-05\nQQQ,20160907 00:00,1179600,1181200,1174700,1179200,16552699,9.544685244302931e-05\nSPY,20160908 00:00,2186000,2189400,2181600,2185100,66880396,9.486794849892961e-05\nQQQ,20160908 00:00,1175700,1176000,1169200,1172300,18633525,9.486794849892961e-05\nSPY,20160909 00:00,2170000,2170200,2132500,2133200,199753948,9.713124233712819e-05\nQQQ,20160909 00:00,1162500,1165100,1142600,1142800,49577287,9.713124233712819e-05\nSPY,20160912 00:00,2123900,2168100,2123100,2164000,158990452,9.802653333785408e-05\nQQQ,20160912 00:00,1136400,1164900,1136300,1163300,39029019,9.802653333785408e-05\nSPY,20160913 00:00,2148500,2151400,2125000,2132400,166172973,9.853016733424838e-05\nQQQ,20160913 00:00,1157500,1160900,1147400,1152900,44471915,9.853016733424838e-05\nSPY,20160914 00:00,2132900,2146900,2125000,2131500,122562929,9.796641930941998e-05\nQQQ,20160914 00:00,1154100,1164700,1153800,1158400,26998332,9.796641930941998e-05\nSPY,20160915 00:00,2130000,2157300,2127600,2152800,125570649,9.837527351675245e-05\nQQQ,20160915 00:00,1158700,1178100,1158600,1176400,37286204,9.837527351675245e-05\nSPY,20160916 00:00,2135000,2136900,2125800,2133700,139164920,9.849936233727757e-05\nQQQ,20160916 00:00,1172400,1174100,1167100,1172900,22052198,9.849936233727757e-05\nSPY,20160919 00:00,2141000,2148700,2130300,2134100,75239623,9.702207065478226e-05\nQQQ,20160919 00:00,1175900,1179500,1165500,1167800,16555774,9.702207065478226e-05\nSPY,20160920 00:00,2144300,2145900,2133800,2134200,62864323,9.696938541612053e-05\nQQQ,20160920 00:00,1172000,1174800,1168100,1170000,15272828,9.696938541612053e-05\nSPY,20160921 00:00,2142200,2160300,2134400,2158200,102931692,9.654543243251409e-05\nQQQ,20160921 00:00,1175000,1183200,1168200,1181500,29347887,9.654543243251409e-05\nSPY,20160922 00:00,2169900,2175300,2167100,2171800,69951017,9.671800697283716e-05\nQQQ,20160922 00:00,1188400,1192200,1187200,1190900,20605769,9.671800697283716e-05\nSPY,20160923 00:00,2167300,2168800,2158800,2159900,63444583,9.681453880652983e-05\nQQQ,20160923 00:00,1190000,1190000,1181600,1183300,20733818,9.681453880652983e-05\nSPY,20160926 00:00,2150200,2152300,2140100,2142400,80230788,9.709382172229859e-05\nQQQ,20160926 00:00,1176600,1178000,1171700,1173400,16010083,9.709382172229859e-05\nSPY,20160927 00:00,2140300,2156800,2136200,2155700,68564482,9.432971264305488e-05\nQQQ,20160927 00:00,1172600,1185500,1171500,1185000,16697729,9.432971264305488e-05\nSPY,20160928 00:00,2158100,2168200,2147100,2166400,79072162,9.434585867169411e-05\nQQQ,20160928 00:00,1186500,1187700,1180900,1187000,14094643,9.434585867169411e-05\nSPY,20160929 00:00,2163900,2168700,2140500,2146800,115706725,9.303915033935369e-05\nQQQ,20160929 00:00,1185000,1187200,1173400,1178400,26361231,9.303915033935369e-05\nSPY,20160930 00:00,2156700,2171200,2153600,2163000,96329808,9.319803573607974e-05\nQQQ,20160930 00:00,1181500,1190700,1180300,1187200,23458388,9.319803573607974e-05\nSPY,20161003 00:00,2158100,2160400,2150400,2157800,75146488,9.224821462146195e-05\nQQQ,20161003 00:00,1185700,1187000,1180800,1185500,17875967,9.224821462146195e-05\nSPY,20161004 00:00,2158600,2161700,2139900,2146800,114252574,9.13384213621453e-05\nQQQ,20161004 00:00,1189000,1191600,1179300,1183700,20504314,9.13384213621453e-05\nSPY,20161005 00:00,2153700,2161300,2153300,2156300,63422919,9.130749149214775e-05\nQQQ,20161005 00:00,1187200,1191700,1186700,1187900,14065651,9.130749149214775e-05\nSPY,20161006 00:00,2153900,2160400,2147400,2157800,56891266,9.113584799377305e-05\nQQQ,20161006 00:00,1186400,1189800,1181600,1187300,11332868,9.113584799377305e-05\nSPY,20161007 00:00,2160600,2163000,2141900,2150400,79463848,9.105617997642044e-05\nQQQ,20161007 00:00,1188400,1190100,1179000,1184700,18328776,9.105617997642044e-05\nSPY,20161010 00:00,2161400,2167000,2159900,2161600,46875472,9.11653205539196e-05\nQQQ,20161010 00:00,1190800,1194800,1190300,1192200,18022477,9.11653205539196e-05\nSPY,20161011 00:00,2156400,2157400,2125800,2134300,119387206,9.191884784932042e-05\nQQQ,20161011 00:00,1191200,1191400,1170000,1175200,25781487,9.191884784932042e-05\nSPY,20161012 00:00,2136100,2143200,2130100,2137100,66340623,9.173217042025218e-05\nQQQ,20161012 00:00,1176300,1178200,1170600,1174200,13514398,9.173217042025218e-05\nSPY,20161013 00:00,2121500,2135900,2112100,2130100,91466314,9.17478593445524e-05\nQQQ,20161013 00:00,1166200,1173200,1159400,1170000,21791329,9.17478593445524e-05\nSPY,20161014 00:00,2141400,2146900,2130300,2131200,80852248,9.078723816245358e-05\nQQQ,20161014 00:00,1175800,1180500,1170700,1171400,20678381,9.078723816245358e-05\nSPY,20161017 00:00,2130700,2133800,2121700,2123800,53226160,9.076778074455212e-05\nQQQ,20161017 00:00,1170400,1173000,1166800,1168200,13220120,9.076778074455212e-05\nSPY,20161018 00:00,2142400,2142900,2132700,2137100,66888708,9.096726093379848e-05\nQQQ,20161018 00:00,1182100,1184100,1178000,1178600,17384714,9.096726093379848e-05\nSPY,20161019 00:00,2140000,2146400,2136000,2142800,57783289,9.092907777141463e-05\nQQQ,20161019 00:00,1177300,1180200,1176400,1178500,12799584,9.092907777141463e-05\nSPY,20161020 00:00,2138500,2145300,2131100,2138800,68059264,9.07749558569714e-05\nQQQ,20161020 00:00,1177300,1179700,1170300,1177100,16319681,9.07749558569714e-05\nSPY,20161021 00:00,2129500,2140800,2127600,2139800,78690483,8.945193740849738e-05\nQQQ,20161021 00:00,1178000,1182200,1174100,1181500,12972732,8.945193740849738e-05\nSPY,20161024 00:00,2149800,2153100,2144800,2148900,51206007,8.845425847555013e-05\nQQQ,20161024 00:00,1189100,1196500,1189000,1195700,16216682,8.845425847555013e-05\nSPY,20161025 00:00,2147000,2149800,2139800,2141700,58851733,8.850643481575485e-05\nQQQ,20161025 00:00,1196400,1196600,1190100,1191900,18183030,8.850643481575485e-05\nSPY,20161026 00:00,2132200,2144200,2129300,2137400,72529547,8.858272176727428e-05\nQQQ,20161026 00:00,1184200,1190400,1180300,1183800,19074971,8.858272176727428e-05\nSPY,20161027 00:00,2145700,2146200,2130900,2131700,68426767,8.827390067863715e-05\nQQQ,20161027 00:00,1188900,1189900,1176700,1178400,16357162,8.827390067863715e-05\nSPY,20161028 00:00,2131300,2139300,2117200,2125400,130649200,8.834805571043464e-05\nQQQ,20161028 00:00,1175000,1181100,1167400,1171000,32410172,8.834805571043464e-05\nSPY,20161031 00:00,2129500,2131900,2123700,2125500,54590230,8.8266246583224e-05\nQQQ,20161031 00:00,1175300,1175300,1169300,1169900,18025131,8.8266246583224e-05\nSPY,20161101 00:00,2129000,2129900,2096000,2110100,114185217,8.796870806443198e-05\nQQQ,20161101 00:00,1171900,1172100,1151000,1161100,22925367,8.796870806443198e-05\nSPY,20161102 00:00,2106700,2111000,2092400,2097400,91540186,8.812500514540822e-05\nQQQ,20161102 00:00,1160300,1163000,1149000,1151800,24660939,8.812500514540822e-05\nSPY,20161103 00:00,2100100,2102400,2084600,2087800,82365245,8.830572485132586e-05\nQQQ,20161103 00:00,1149900,1153700,1139200,1140500,30499787,8.830572485132586e-05\nSPY,20161104 00:00,2089100,2098800,2084000,2085500,95290592,8.831043826949613e-05\nQQQ,20161104 00:00,1137700,1145400,1134500,1136500,24483522,8.831043826949613e-05\nSPY,20161107 00:00,2114700,2131900,2113000,2131500,95548312,9.038875123241018e-05\nQQQ,20161107 00:00,1154900,1164700,1153000,1163500,24629132,9.038875123241018e-05\nSPY,20161108 00:00,2127200,2147700,2123800,2141100,97985548,9.009419774113517e-05\nQQQ,20161108 00:00,1162300,1176400,1159600,1171100,19311317,9.009419774113517e-05\nSPY,20161109 00:00,2124700,2171000,2123400,2164400,219161783,9.030609945898909e-05\nQQQ,20161109 00:00,1157400,1178400,1156000,1176500,64121012,9.030609945898909e-05\nSPY,20161110 00:00,2173500,2183100,2152300,2169200,159836491,9.015158102834008e-05\nQQQ,20161110 00:00,1182200,1183800,1142000,1157500,69491123,9.015158102834008e-05\nSPY,20161111 00:00,2161300,2167000,2153200,2164200,86128015,8.960094229251476e-05\nQQQ,20161111 00:00,1152500,1160500,1148300,1158000,39097265,8.960094229251476e-05\nSPY,20161114 00:00,2169900,2172700,2157200,2165900,85660687,8.864354265915181e-05\nQQQ,20161114 00:00,1158300,1159400,1140300,1146300,34543671,8.864354265915181e-05\nSPY,20161115 00:00,2170000,2182800,2168100,2182800,79608357,8.81993089483979e-05\nQQQ,20161115 00:00,1155000,1166200,1153300,1162200,28474667,8.81993089483979e-05\nSPY,20161116 00:00,2175200,2181400,2174200,2178700,59816015,8.815272840542951e-05\nQQQ,20161116 00:00,1156700,1169900,1156700,1169100,14903722,8.815272840542951e-05\nSPY,20161117 00:00,2180400,2190600,2179200,2189900,61742349,8.710200733699338e-05\nQQQ,20161117 00:00,1168500,1177800,1166100,1177600,20176082,8.710200733699338e-05\nSPY,20161118 00:00,2190400,2192600,2182900,2185000,79242591,8.714240454560688e-05\nQQQ,20161118 00:00,1179000,1181000,1172100,1173200,15082780,8.714240454560688e-05\nSPY,20161121 00:00,2191900,2201800,2190000,2201500,62050842,8.73406128823613e-05\nQQQ,20161121 00:00,1176100,1186500,1175700,1185400,20611982,8.73406128823613e-05\nSPY,20161122 00:00,2204900,2207900,2197300,2205800,60951795,8.73398117577669e-05\nQQQ,20161122 00:00,1190100,1191900,1186100,1189000,18793612,8.73398117577669e-05\nSPY,20161123 00:00,2200000,2207600,2197500,2207000,50177872,8.733955710543864e-05\nQQQ,20161123 00:00,1185100,1186400,1179000,1184200,20491749,8.733955710543864e-05\nSPY,20161125 00:00,2211200,2215400,2210100,2215200,30799433,8.738244554844036e-05\nQQQ,20161125 00:00,1185600,1188500,1184200,1188000,6743757,8.738244554844036e-05\nSPY,20161128 00:00,2211900,2214800,2203700,2204800,64260081,8.742732126257495e-05\nQQQ,20161128 00:00,1186500,1190800,1184200,1185300,13216697,8.742732126257495e-05\nSPY,20161129 00:00,2205800,2214400,2201700,2209100,60422740,8.740258083223531e-05\nQQQ,20161129 00:00,1186400,1195100,1183000,1189400,18188142,8.740258083223531e-05\nSPY,20161130 00:00,2216500,2218200,2203100,2203800,89052622,8.716831757616246e-05\nQQQ,20161130 00:00,1190900,1191300,1174600,1175000,27473786,8.716831757616246e-05\nSPY,20161201 00:00,2207300,2207300,2191500,2195700,73523163,8.717905742407615e-05\nQQQ,20161201 00:00,1174600,1174700,1152900,1154700,36706479,8.717905742407615e-05\nSPY,20161202 00:00,2197000,2202500,2192600,2196800,65214024,8.619628277063151e-05\nQQQ,20161202 00:00,1155400,1161600,1152200,1157000,31218241,8.619628277063151e-05\nSPY,20161205 00:00,2206700,2214000,2204200,2210000,62268605,8.455880180727989e-05\nQQQ,20161205 00:00,1163000,1170600,1157600,1166000,20525092,8.455880180727989e-05\nSPY,20161206 00:00,2212400,2217400,2206700,2217000,54251477,8.445780738464487e-05\nQQQ,20161206 00:00,1169300,1170800,1163900,1168800,25136386,8.445780738464487e-05\nSPY,20161207 00:00,2215000,2246700,2213800,2246000,100958910,8.509149489147921e-05\nQQQ,20161207 00:00,1166200,1185000,1162900,1183600,24978449,8.509149489147921e-05\nSPY,20161208 00:00,2245800,2257000,2242700,2251500,87138295,8.458890455054121e-05\nQQQ,20161208 00:00,1184100,1188700,1181800,1185700,17855858,8.458890455054121e-05\nSPY,20161209 00:00,2254400,2265100,2253700,2265100,75738981,8.472221999923682e-05\nQQQ,20161209 00:00,1190100,1195400,1190000,1195000,20873892,8.472221999923682e-05\nSPY,20161212 00:00,2264200,2269600,2257600,2262500,82237402,8.291488371521197e-05\nQQQ,20161212 00:00,1189700,1192100,1184700,1189600,22603883,8.291488371521197e-05\nSPY,20161213 00:00,2270100,2283400,2270000,2277600,98759427,8.307117069518983e-05\nQQQ,20161213 00:00,1193200,1211100,1193200,1204600,53002044,8.307117069518983e-05\nSPY,20161214 00:00,2274100,2282200,2253700,2258800,131328288,8.29330144700128e-05\nQQQ,20161214 00:00,1206100,1210000,1198600,1202100,25883799,8.29330144700128e-05\nSPY,20161215 00:00,2261300,2278100,2260100,2268100,109782020,8.213727098455973e-05\nQQQ,20161215 00:00,1203700,1211100,1200800,1204000,21186643,8.213727098455973e-05\nSPY,20161216 00:00,2259900,2260800,2246700,2250400,133572412,8.144150946349999e-05\nQQQ,20161216 00:00,1203400,1205200,1193600,1196000,22952131,8.144150946349999e-05\nSPY,20161219 00:00,2252400,2260100,2250800,2255300,77760990,7.930563242858705e-05\nQQQ,20161219 00:00,1197200,1208300,1195500,1200900,19564214,7.930563242858705e-05\nSPY,20161220 00:00,2261600,2265700,2258800,2264000,95464598,7.901448513009193e-05\nQQQ,20161220 00:00,1204700,1207700,1203300,1205500,11195243,7.901448513009193e-05\nSPY,20161221 00:00,2262700,2264500,2257700,2257700,58961932,7.881236954010043e-05\nQQQ,20161221 00:00,1206000,1206800,1201900,1204600,6849219,7.881236954010043e-05\nSPY,20161222 00:00,2256100,2257400,2249200,2253800,50253495,7.850532405224136e-05\nQQQ,20161222 00:00,1204700,1205000,1196600,1201200,15569584,7.850532405224136e-05\nSPY,20161223 00:00,2254200,2257200,2252100,2257100,30271966,7.850228579320986e-05\nQQQ,20161223 00:00,1199200,1202500,1198000,1202000,8073528,7.850228579320986e-05\nSPY,20161227 00:00,2260000,2267300,2260000,2262700,35839769,7.853356748069524e-05\nQQQ,20161227 00:00,1204600,1215200,1204100,1208200,15536641,7.853356748069524e-05\nSPY,20161228 00:00,2265900,2265900,2242800,2244000,55878521,7.818179371854475e-05\nQQQ,20161228 00:00,1210800,1211900,1198000,1198800,17481445,7.818179371854475e-05\nSPY,20161229 00:00,2244700,2248900,2238400,2243500,44831649,7.791064719427885e-05\nQQQ,20161229 00:00,1198500,1201300,1193300,1197100,12913138,7.791064719427885e-05\nSPY,20161230 00:00,2247100,2248300,2227300,2235300,86143160,7.755874814767774e-05\nQQQ,20161230 00:00,1199400,1199500,1181500,1184800,39570090,7.755874814767774e-05\nSPY,20170103 00:00,2250700,2258300,2238900,2252400,77920116,7.656164508054771e-05\nQQQ,20170103 00:00,1192700,1199900,1188900,1195400,21298217,7.656164508054771e-05\nSPY,20170104 00:00,2256400,2267500,2256100,2265800,70209892,7.668107245134975e-05\nQQQ,20170104 00:00,1196700,1204100,1196600,1201900,18383601,7.668107245134975e-05\nSPY,20170105 00:00,2262800,2265800,2254900,2264000,65938728,7.613480395763191e-05\nQQQ,20170105 00:00,1201000,1209500,1201000,1208700,20177699,7.613480395763191e-05\nSPY,20170106 00:00,2265300,2277500,2259000,2272100,62917568,7.305077691298982e-05\nQQQ,20170106 00:00,1210000,1222500,1206800,1219300,22000840,7.305077691298982e-05\nSPY,20170109 00:00,2269000,2270700,2264200,2264600,41106606,7.261393643929495e-05\nQQQ,20170109 00:00,1220300,1225500,1219500,1223300,17445807,7.261393643929495e-05\nSPY,20170110 00:00,2264700,2274400,2260100,2264600,56225536,7.260839558854477e-05\nQQQ,20170110 00:00,1223800,1229700,1221000,1226000,15473817,7.260839558854477e-05\nSPY,20170111 00:00,2263800,2271000,2255900,2271000,66005672,7.230388319359858e-05\nQQQ,20170111 00:00,1226500,1229300,1220100,1229300,18854540,7.230388319359858e-05\nSPY,20170112 00:00,2265000,2267500,2249600,2265300,67094792,6.876394190447768e-05\nQQQ,20170112 00:00,1224900,1228200,1215900,1227400,18632951,6.876394190447768e-05\nSPY,20170113 00:00,2267500,2274000,2266900,2270500,48194702,6.753119731312378e-05\nQQQ,20170113 00:00,1228000,1233700,1228000,1231600,14033357,6.753119731312378e-05\nSPY,20170117 00:00,2263000,2267800,2258000,2262500,52726727,6.48211324180339e-05\nQQQ,20170117 00:00,1228400,1230300,1224400,1227900,13796704,6.48211324180339e-05\nSPY,20170118 00:00,2265200,2268000,2259000,2267500,47432023,6.48256227619639e-05\nQQQ,20170118 00:00,1229700,1231600,1226600,1230400,10920268,6.48256227619639e-05\nSPY,20170119 00:00,2268300,2270000,2254100,2259100,60830945,6.465118509032248e-05\nQQQ,20170119 00:00,1232200,1236400,1227200,1229800,11715608,6.465118509032248e-05\nSPY,20170120 00:00,2267300,2273100,2260500,2267400,106233534,6.466425541314346e-05\nQQQ,20170120 00:00,1235200,1238300,1229300,1232500,18817221,6.466425541314346e-05\nSPY,20170123 00:00,2263700,2268000,2252700,2261500,64870592,6.243424151763619e-05\nQQQ,20170123 00:00,1231700,1235200,1225700,1233500,16548029,6.243424151763619e-05\nSPY,20170124 00:00,2264000,2280800,2262800,2276000,81566655,6.156872305324588e-05\nQQQ,20170124 00:00,1235900,1243700,1233900,1241800,16689559,6.156872305324588e-05\nSPY,20170125 00:00,2287000,2295700,2285100,2295700,65524898,6.14308499026863e-05\nQQQ,20170125 00:00,1249600,1254600,1248600,1254300,14562459,6.14308499026863e-05\nSPY,20170126 00:00,2294200,2297100,2290200,2293300,52160586,6.021410213202432e-05\nQQQ,20170126 00:00,1256000,1258200,1253500,1255600,13551108,6.021410213202432e-05\nSPY,20170127 00:00,2294400,2295900,2287600,2289700,45459870,5.995826943997336e-05\nQQQ,20170127 00:00,1258300,1259200,1253900,1258000,13846308,5.995826943997336e-05\nSPY,20170130 00:00,2281800,2282000,2264200,2275500,69104606,5.8267299887586467e-05\nQQQ,20170130 00:00,1253800,1253800,1241300,1248200,23217505,5.8267299887586467e-05\nSPY,20170131 00:00,2270100,2275900,2263200,2275300,63594548,5.828945422707708e-05\nQQQ,20170131 00:00,1243800,1246000,1238500,1245700,17455571,5.828945422707708e-05\nSPY,20170201 00:00,2282800,2285800,2269500,2276200,69036939,5.658456670497713e-05\nQQQ,20170201 00:00,1254500,1256800,1248600,1254300,20792517,5.658456670497713e-05\nSPY,20170202 00:00,2272400,2280900,2268300,2277700,64355660,5.670140038776264e-05\nQQQ,20170202 00:00,1252100,1257000,1248600,1253200,14269696,5.670140038776264e-05\nSPY,20170203 00:00,2288500,2295500,2284600,2293400,65321136,5.675369838433634e-05\nQQQ,20170203 00:00,1254500,1258100,1253300,1256800,15831866,5.675369838433634e-05\nSPY,20170206 00:00,2288900,2293200,2285500,2289300,52191634,5.400646504413119e-05\nQQQ,20170206 00:00,1254700,1258400,1253500,1258300,10763179,5.400646504413119e-05\nSPY,20170207 00:00,2293600,2296500,2287200,2289400,52308487,5.303260629429885e-05\nQQQ,20170207 00:00,1260900,1265500,1259700,1262900,16420559,5.303260629429885e-05\nSPY,20170208 00:00,2285900,2293900,2283100,2292400,44188553,5.301905625631997e-05\nQQQ,20170208 00:00,1261200,1266800,1258800,1265000,11734728,5.301905625631997e-05\nSPY,20170209 00:00,2295700,2309500,2295200,2306000,57358826,5.308166548357263e-05\nQQQ,20170209 00:00,1266300,1272400,1265700,1269600,15038528,5.308166548357263e-05\nSPY,20170210 00:00,2310000,2317700,2308800,2315100,53177237,5.29722708883699e-05\nQQQ,20170210 00:00,1272400,1275600,1270200,1273800,13149710,5.29722708883699e-05\nSPY,20170213 00:00,2320900,2330700,2320500,2327700,47492534,5.199431348169772e-05\nQQQ,20170213 00:00,1277700,1282600,1277200,1281000,18153459,5.199431348169772e-05\nSPY,20170214 00:00,2325500,2337100,2321600,2337000,63276400,5.064845125879896e-05\nQQQ,20170214 00:00,1281500,1285400,1277400,1285300,15535982,5.064845125879896e-05\nSPY,20170215 00:00,2334300,2351400,2333900,2349200,75351898,4.941487349368033e-05\nQQQ,20170215 00:00,1284400,1293500,1283800,1292900,15673199,4.941487349368033e-05\nSPY,20170216 00:00,2349300,2351500,2338500,2347200,77912159,4.9173388474388046e-05\nQQQ,20170216 00:00,1293700,1296300,1289200,1292500,14290464,4.9173388474388046e-05\nSPY,20170217 00:00,2339700,2350900,2339400,2350900,61031072,4.919184090138392e-05\nQQQ,20170217 00:00,1290600,1298200,1290400,1298100,13024315,4.919184090138392e-05\nSPY,20170221 00:00,2355100,2366800,2355100,2364900,68354069,4.842623418320536e-05\nQQQ,20170221 00:00,1300600,1305300,1299900,1304500,16989257,4.842623418320536e-05\nSPY,20170222 00:00,2360200,2365400,2358300,2362800,52965600,4.748142535997532e-05\nQQQ,20170222 00:00,1303300,1305900,1301200,1305000,10602727,4.748142535997532e-05\nSPY,20170223 00:00,2369000,2369000,2355700,2364400,66891920,4.735327283379806e-05\nQQQ,20170223 00:00,1307000,1307000,1294900,1300100,16964987,4.735327283379806e-05\nSPY,20170224 00:00,2354200,2367900,2354100,2367400,65260982,4.695818293359033e-05\nQQQ,20170224 00:00,1294200,1302600,1293800,1302600,16940719,4.695818293359033e-05\nSPY,20170227 00:00,2366100,2373100,2363500,2371100,47536121,4.693194127551822e-05\nQQQ,20170227 00:00,1300200,1304300,1298000,1304200,11391864,4.693194127551822e-05\nSPY,20170228 00:00,2367100,2369500,2360200,2364700,68854635,4.664318059411938e-05\nQQQ,20170228 00:00,1303900,1304500,1296600,1300200,14269724,4.664318059411938e-05\nSPY,20170301 00:00,2384000,2403200,2383700,2397800,118445158,4.428464052802919e-05\nQQQ,20170301 00:00,1308500,1316800,1306100,1314400,21803450,4.428464052802919e-05\nSPY,20170302 00:00,2395700,2395700,2382100,2382700,62429917,4.445727172981947e-05\nQQQ,20170302 00:00,1314100,1314300,1306200,1307800,19745391,4.445727172981947e-05\nSPY,20170303 00:00,2381900,2386100,2377300,2384200,59910203,4.4489842003621923e-05\nQQQ,20170303 00:00,1306900,1310600,1303500,1310200,12312143,4.4489842003621923e-05\nSPY,20170306 00:00,2374800,2381200,2370100,2377100,47626346,4.453978197679011e-05\nQQQ,20170306 00:00,1305900,1309500,1302100,1307300,10942484,4.453978197679011e-05\nSPY,20170307 00:00,2373900,2377700,2367700,2370000,51126013,4.4595786029682805e-05\nQQQ,20170307 00:00,1304700,1310800,1302800,1305100,14506559,4.4595786029682805e-05\nSPY,20170308 00:00,2373100,2376300,2364100,2365600,62858443,4.414688568320076e-05\nQQQ,20170308 00:00,1305900,1311500,1304600,1307400,14790141,4.414688568320076e-05\nSPY,20170309 00:00,2367100,2372400,2357400,2368600,78158975,4.4045929371346715e-05\nQQQ,20170309 00:00,1307100,1310200,1301400,1308400,18455453,4.4045929371346715e-05\nSPY,20170310 00:00,2379500,2380200,2365900,2376900,67005430,4.40819128693407e-05\nQQQ,20170310 00:00,1314400,1316000,1308300,1313900,18542254,4.40819128693407e-05\nSPY,20170313 00:00,2375900,2378500,2372400,2378100,44239339,4.306035757618953e-05\nQQQ,20170313 00:00,1313400,1316400,1312700,1316100,10106985,4.306035757618953e-05\nSPY,20170314 00:00,2372200,2372400,2361900,2369000,52143010,4.312494506308073e-05\nQQQ,20170314 00:00,1313100,1313700,1307600,1312900,13459518,4.312494506308073e-05\nSPY,20170315 00:00,2375600,2394300,2372900,2389500,78506663,4.328243369995251e-05\nQQQ,20170315 00:00,1315600,1324000,1311400,1321000,21389658,4.328243369995251e-05\nSPY,20170316 00:00,2391200,2392000,2381000,2384800,71500910,4.313130339689328e-05\nQQQ,20170316 00:00,1323500,1323500,1317100,1320100,17182282,4.313130339689328e-05\nSPY,20170317 00:00,2377500,2379700,2370300,2370300,66555644,4.325323316719587e-05\nQQQ,20170317 00:00,1319000,1320400,1316200,1316900,18320512,4.325323316719587e-05\nSPY,20170320 00:00,2370100,2373600,2363300,2367700,46808067,4.3235658509250386e-05\nQQQ,20170320 00:00,1316500,1321100,1314700,1318100,9807650,4.3235658509250386e-05\nSPY,20170321 00:00,2374900,2376100,2335800,2337300,119931847,4.408640862482598e-05\nQQQ,20170321 00:00,1323100,1324300,1297300,1298100,35310462,4.408640862482598e-05\nSPY,20170322 00:00,2337300,2346100,2330500,2342800,85892073,4.4137629758950826e-05\nQQQ,20170322 00:00,1298500,1308200,1296800,1306900,29543892,4.4137629758950826e-05\nSPY,20170323 00:00,2339800,2353400,2336000,2340300,89153899,4.389277964904072e-05\nQQQ,20170323 00:00,1305200,1308800,1301400,1303600,18406145,4.389277964904072e-05\nSPY,20170324 00:00,2343500,2350400,2329600,2338600,93360484,4.388384058277971e-05\nQQQ,20170324 00:00,1307800,1312900,1301300,1306300,22445760,4.388384058277971e-05\nSPY,20170327 00:00,2319700,2339200,2316100,2336200,78643223,4.3880659522165254e-05\nQQQ,20170327 00:00,1297000,1310700,1294000,1308400,17716189,4.3880659522165254e-05\nSPY,20170328 00:00,2333200,2358100,2331400,2353200,78046362,4.34711276048989e-05\nQQQ,20170328 00:00,1308400,1320300,1305500,1316400,19908117,4.34711276048989e-05\nSPY,20170329 00:00,2350000,2358100,2347300,2355400,48500109,4.3416979785703713e-05\nQQQ,20170329 00:00,1317300,1323000,1315900,1322500,11704446,4.3416979785703713e-05\nSPY,20170330 00:00,2355000,2365200,2352700,2362900,46797888,4.339755204557078e-05\nQQQ,20170330 00:00,1322000,1326100,1320900,1324700,14980189,4.339755204557078e-05\nSPY,20170331 00:00,2359100,2365100,2356800,2357400,55060512,4.317834795209915e-05\nQQQ,20170331 00:00,1322800,1327400,1321300,1323800,17964005,4.317834795209915e-05\nSPY,20170403 00:00,2357900,2360300,2339200,2353300,73352665,4.3126411003851755e-05\nQQQ,20170403 00:00,1324900,1328100,1315600,1323000,23062647,4.3126411003851755e-05\nSPY,20170404 00:00,2350000,2355800,2345600,2354800,47152999,4.267018058318949e-05\nQQQ,20170404 00:00,1319200,1325300,1318700,1325100,12560176,4.267018058318949e-05\nSPY,20170405 00:00,2362600,2373900,2345500,2347800,96925396,4.206357608349006e-05\nQQQ,20170405 00:00,1327000,1334800,1317200,1319700,30289939,4.206357608349006e-05\nSPY,20170406 00:00,2349600,2360400,2344300,2354400,59853359,4.1277758620747694e-05\nQQQ,20170406 00:00,1321000,1323900,1317000,1320400,18389289,4.1277758620747694e-05\nSPY,20170407 00:00,2351800,2360000,2346400,2352000,58063904,4.1300151800090714e-05\nQQQ,20170407 00:00,1320000,1323700,1315000,1319700,15775514,4.1300151800090714e-05\nSPY,20170410 00:00,2353600,2362500,2347300,2353400,62169916,4.1247167776345415e-05\nQQQ,20170410 00:00,1321000,1325600,1316600,1320200,14505106,4.1247167776345415e-05\nSPY,20170411 00:00,2349000,2351800,2333400,2350600,80178276,4.1002980500868666e-05\nQQQ,20170411 00:00,1319000,1321000,1305000,1314500,33039379,4.1002980500868666e-05\nSPY,20170412 00:00,2348000,2349500,2337700,2340300,66034492,4.064205517105166e-05\nQQQ,20170412 00:00,1314300,1315400,1307800,1309200,15255090,4.064205517105166e-05\nSPY,20170413 00:00,2336500,2344900,2325100,2325100,72058660,4.07698098152027e-05\nQQQ,20170413 00:00,1307400,1315100,1303800,1304000,22113044,4.07698098152027e-05\nSPY,20170417 00:00,2331200,2345700,2328800,2345700,56011057,4.1003512590897795e-05\nQQQ,20170417 00:00,1307700,1315000,1307300,1314800,12457358,4.1003512590897795e-05\nSPY,20170418 00:00,2337100,2344900,2330800,2338700,74664350,4.091421404536155e-05\nQQQ,20170418 00:00,1310400,1316600,1309500,1312800,12162470,4.091421404536155e-05\nSPY,20170419 00:00,2345200,2349500,2331800,2334400,59798136,4.097938577249319e-05\nQQQ,20170419 00:00,1318500,1322900,1313100,1314900,17440534,4.097938577249319e-05\nSPY,20170420 00:00,2341400,2358500,2337800,2353400,83135283,4.121299075177196e-05\nQQQ,20170420 00:00,1320200,1328800,1318300,1325900,20502778,4.121299075177196e-05\nSPY,20170421 00:00,2352200,2353000,2341300,2345900,92494914,4.12113958228474e-05\nQQQ,20170421 00:00,1327100,1327500,1322200,1325600,19906888,4.12113958228474e-05\nSPY,20170424 00:00,2371700,2374100,2366100,2371700,103888079,4.166921166577155e-05\nQQQ,20170424 00:00,1340300,1342900,1338100,1341600,21177216,4.166921166577155e-05\nSPY,20170425 00:00,2379300,2389500,2378100,2385500,67491880,4.1795130567936456e-05\nQQQ,20170425 00:00,1346000,1353600,1344800,1351300,18911331,4.1795130567936456e-05\nSPY,20170426 00:00,2385300,2395300,2383500,2384000,73538016,4.1838371966807434e-05\nQQQ,20170426 00:00,1351800,1355100,1348600,1349400,22603210,4.1838371966807434e-05\nSPY,20170427 00:00,2387400,2389500,2379800,2386000,45634569,4.188994636732557e-05\nQQQ,20170427 00:00,1352700,1357500,1351900,1357500,13877278,4.188994636732557e-05\nSPY,20170428 00:00,2389300,2389300,2379300,2380800,49721027,4.136544389152937e-05\nQQQ,20170428 00:00,1362900,1363400,1357700,1359900,17610230,4.136544389152937e-05\nSPY,20170501 00:00,2386600,2391700,2382000,2386800,44888079,4.127593312592474e-05\nQQQ,20170501 00:00,1364400,1373800,1363800,1372000,21055619,4.127593312592474e-05\nSPY,20170502 00:00,2388200,2389800,2383000,2387700,49086142,4.101386968509575e-05\nQQQ,20170502 00:00,1373700,1374900,1370200,1374300,17229212,4.101386968509575e-05\nSPY,20170503 00:00,2382900,2387300,2377000,2384800,61863616,4.064481826952895e-05\nQQQ,20170503 00:00,1371200,1371700,1366200,1369900,21209026,4.064481826952895e-05\nSPY,20170504 00:00,2388100,2389200,2377800,2387600,56277584,4.045537128149294e-05\nQQQ,20170504 00:00,1369700,1372300,1365600,1370400,13988193,4.045537128149294e-05\nSPY,20170505 00:00,2391600,2397200,2386900,2397000,49995690,4.0485319710551533e-05\nQQQ,20170505 00:00,1373900,1375400,1368800,1375400,13539327,4.0485319710551533e-05\nSPY,20170508 00:00,2397700,2399200,2391700,2396600,43249763,4.0430712670792616e-05\nQQQ,20170508 00:00,1376100,1378400,1373300,1378400,12757417,4.0430712670792616e-05\nSPY,20170509 00:00,2399400,2401900,2390400,2394400,46767168,4.0413900617616895e-05\nQQQ,20170509 00:00,1380500,1386300,1379300,1383200,24217378,4.0413900617616895e-05\nSPY,20170510 00:00,2393700,2398700,2391600,2398700,46195692,3.9813393067581264e-05\nQQQ,20170510 00:00,1384000,1384500,1379100,1384000,18306881,3.9813393067581264e-05\nSPY,20170511 00:00,2393100,2395700,2381400,2393800,54364403,3.943108555211266e-05\nQQQ,20170511 00:00,1380200,1383200,1373900,1382900,24357025,3.943108555211266e-05\nSPY,20170512 00:00,2390500,2392100,2386700,2389800,41779519,3.9412702087243365e-05\nQQQ,20170512 00:00,1383500,1386300,1382300,1386000,17094601,3.9412702087243365e-05\nSPY,20170515 00:00,2394900,2404400,2394500,2403000,51325482,3.927194954088796e-05\nQQQ,20170515 00:00,1386600,1391200,1385300,1390400,18227851,3.927194954088796e-05\nSPY,20170516 00:00,2406400,2406700,2396300,2400800,45582380,3.8817838259647464e-05\nQQQ,20170516 00:00,1394000,1396400,1389900,1396200,18530508,3.8817838259647464e-05\nSPY,20170517 00:00,2380900,2386400,2357500,2358200,144257251,4.0199309585639485e-05\nQQQ,20170517 00:00,1385100,1387700,1360500,1360700,51256217,4.0199309585639485e-05\nSPY,20170518 00:00,2357000,2377500,2354300,2367700,93498838,4.030638694232412e-05\nQQQ,20170518 00:00,1360200,1377200,1358700,1372600,38424762,4.030638694232412e-05\nSPY,20170519 00:00,2373600,2390800,2372700,2383100,97341700,4.028330760184817e-05\nQQQ,20170519 00:00,1377500,1384200,1376600,1378400,33965774,4.028330760184817e-05\nSPY,20170522 00:00,2388700,2397100,2388200,2395200,44766182,4.019600548690152e-05\nQQQ,20170522 00:00,1381500,1390800,1381000,1390000,18766106,4.019600548690152e-05\nSPY,20170523 00:00,2399800,2402400,2395200,2400500,44309601,4.0174021751571605e-05\nQQQ,20170523 00:00,1394100,1394200,1387900,1391400,17140392,4.0174021751571605e-05\nSPY,20170524 00:00,2403300,2407300,2399300,2406100,42561538,3.924682511450649e-05\nQQQ,20170524 00:00,1395600,1398500,1391700,1397800,15071337,3.924682511450649e-05\nSPY,20170525 00:00,2412200,2420800,2409700,2417600,57128563,3.9222077832023946e-05\nQQQ,20170525 00:00,1403100,1413300,1400100,1409700,22391583,3.9222077832023946e-05\nSPY,20170526 00:00,2415900,2419000,2414500,2417100,34160249,3.922130606010149e-05\nQQQ,20170526 00:00,1410000,1412800,1408100,1412200,11601987,3.922130606010149e-05\nSPY,20170530 00:00,2413200,2417900,2411600,2415000,30629121,3.916278961147187e-05\nQQQ,20170530 00:00,1411500,1415100,1410600,1413400,19387675,3.916278961147187e-05\nSPY,20170531 00:00,2418400,2418800,2406400,2414400,67558518,3.9171482518057216e-05\nQQQ,20170531 00:00,1418400,1418400,1405700,1412900,28836181,3.9171482518057216e-05\nSPY,20170601 00:00,2419700,2433600,2416500,2433600,58482273,3.925765942086628e-05\nQQQ,20170601 00:00,1415800,1418900,1409800,1418400,18935148,3.925765942086628e-05\nSPY,20170602 00:00,2434500,2443500,2430800,2441700,56727456,3.936076649097518e-05\nQQQ,20170602 00:00,1423400,1434900,1421000,1434600,34757896,3.936076649097518e-05\nSPY,20170605 00:00,2440200,2443000,2437600,2439900,33597787,3.9283934235514514e-05\nQQQ,20170605 00:00,1434500,1436800,1432300,1434300,14470464,3.9283934235514514e-05\nSPY,20170606 00:00,2433400,2439800,2431200,2432100,43156884,3.931193406633742e-05\nQQQ,20170606 00:00,1432600,1437300,1426500,1428600,21570129,3.931193406633742e-05\nSPY,20170607 00:00,2436100,2439200,2428300,2436600,43784238,3.9339203048957846e-05\nQQQ,20170607 00:00,1432600,1435400,1426000,1434200,18012338,3.9339203048957846e-05\nSPY,20170608 00:00,2438000,2443300,2431700,2437800,59231538,3.933221702163501e-05\nQQQ,20170608 00:00,1437400,1438000,1427900,1435700,22741112,3.933221702163501e-05\nSPY,20170609 00:00,2440700,2450100,2419500,2434100,115565354,3.9524908191935125e-05\nQQQ,20170609 00:00,1437400,1439000,1381100,1399800,102590425,3.9524908191935125e-05\nSPY,20170612 00:00,2430900,2434200,2423800,2433600,74220413,3.9050376559762925e-05\nQQQ,20170612 00:00,1388000,1394800,1374700,1392300,100249191,3.9050376559762925e-05\nSPY,20170613 00:00,2439800,2446100,2435800,2445500,53143874,3.886045945869769e-05\nQQQ,20170613 00:00,1400100,1405500,1392800,1403600,48814127,3.886045945869769e-05\nSPY,20170614 00:00,2448600,2448700,2433000,2442400,67840892,3.88923961664452e-05\nQQQ,20170614 00:00,1409300,1409300,1386300,1397500,58252735,3.88923961664452e-05\nSPY,20170615 00:00,2426900,2439100,2423700,2437700,57671192,3.891526826342631e-05\nQQQ,20170615 00:00,1383400,1392800,1374900,1391300,51345482,3.891526826342631e-05\nSPY,20170616 00:00,2428300,2428300,2416400,2426400,68393285,3.906841389198219e-05\nQQQ,20170616 00:00,1386800,1387100,1376400,1381500,43343677,3.906841389198219e-05\nSPY,20170619 00:00,2436100,2447300,2434800,2446600,51499196,3.897000718908407e-05\nQQQ,20170619 00:00,1394900,1405900,1392900,1404600,34467257,3.897000718908407e-05\nSPY,20170620 00:00,2442300,2442600,2429900,2430100,48023571,3.910907364884121e-05\nQQQ,20170620 00:00,1403200,1405000,1393200,1393600,37878867,3.910907364884121e-05\nSPY,20170621 00:00,2434600,2435900,2424200,2429500,50482105,3.906342541038371e-05\nQQQ,20170621 00:00,1396800,1408100,1395900,1407400,32847639,3.906342541038371e-05\nSPY,20170622 00:00,2429600,2435300,2426400,2428400,36622080,3.903499834623755e-05\nQQQ,20170622 00:00,1409600,1412200,1403400,1407000,24061597,3.903499834623755e-05\nSPY,20170623 00:00,2428800,2435100,2424700,2431300,56648578,3.8356377783601104e-05\nQQQ,20170623 00:00,1405400,1414200,1401500,1412400,19652211,3.8356377783601104e-05\nSPY,20170626 00:00,2439300,2443800,2430500,2432900,48970596,3.2056183780383645e-05\nQQQ,20170626 00:00,1420500,1422900,1402800,1405800,32858257,3.2056183780383645e-05\nSPY,20170627 00:00,2430100,2433800,2413100,2413300,72130894,3.118511559636686e-05\nQQQ,20170627 00:00,1400500,1402200,1380200,1380300,58836648,3.118511559636686e-05\nSPY,20170628 00:00,2425100,2437100,2422400,2434900,59025861,3.015273579439021e-05\nQQQ,20170628 00:00,1385400,1401400,1377400,1400200,52499260,3.015273579439021e-05\nSPY,20170629 00:00,2436200,2437200,2399600,2413500,97388588,2.9759233798355815e-05\nQQQ,20170629 00:00,1394400,1394400,1362500,1375900,84967360,2.9759233798355815e-05\nSPY,20170630 00:00,2423000,2427100,2415800,2418000,58187364,2.9208207970764442e-05\nQQQ,20170630 00:00,1379800,1383300,1371900,1376400,55840647,2.9208207970764442e-05\nSPY,20170703 00:00,2429000,2433800,2422100,2422100,32862520,2.9146596158664232e-05\nQQQ,20170703 00:00,1382700,1385000,1361000,1361900,30112069,2.9146596158664232e-05\nSPY,20170705 00:00,2426100,2430100,2417000,2427700,47672771,2.9001827209913248e-05\nQQQ,20170705 00:00,1366200,1379000,1361500,1375300,37563894,2.9001827209913248e-05\nSPY,20170706 00:00,2418600,2420300,2403400,2405500,57599572,2.9215435434374373e-05\nQQQ,20170706 00:00,1364800,1370600,1358000,1362900,47088492,2.9215435434374373e-05\nSPY,20170707 00:00,2411800,2422800,2410200,2421100,43893302,2.9460433177841025e-05\nQQQ,20170707 00:00,1367500,1381300,1367400,1377600,34879095,2.9460433177841025e-05\nSPY,20170710 00:00,2419800,2428000,2417800,2423700,31706829,2.8631980186431503e-05\nQQQ,20170710 00:00,1378500,1389900,1375000,1386600,22738627,2.8631980186431503e-05\nSPY,20170711 00:00,2421200,2425500,2408500,2421900,45825492,2.856520357381355e-05\nQQQ,20170711 00:00,1384600,1392200,1379400,1390500,26219948,2.856520357381355e-05\nSPY,20170712 00:00,2433100,2442000,2433100,2440100,46071933,2.8759485310261908e-05\nQQQ,20170712 00:00,1402400,1408600,1399600,1407000,32649785,2.8759485310261908e-05\nSPY,20170713 00:00,2440200,2445500,2437600,2444200,33501511,2.875387724613798e-05\nQQQ,20170713 00:00,1408700,1413500,1406000,1410100,29645544,2.875387724613798e-05\nSPY,20170714 00:00,2444000,2459700,2443100,2455600,47191923,2.875170939673673e-05\nQQQ,20170714 00:00,1416400,1423000,1412000,1421200,30623353,2.875170939673673e-05\nSPY,20170717 00:00,2454400,2459100,2453400,2455300,25751504,2.873472423897874e-05\nQQQ,20170717 00:00,1422700,1426900,1419200,1421900,23034590,2.873472423897874e-05\nSPY,20170718 00:00,2450600,2457200,2446700,2456600,36481728,2.868727421970955e-05\nQQQ,20170718 00:00,1420900,1431700,1416500,1431400,23121659,2.868727421970955e-05\nSPY,20170719 00:00,2460100,2470000,2460100,2469900,42449945,2.875264674019301e-05\nQQQ,20170719 00:00,1435600,1441900,1435000,1439800,30756253,2.875264674019301e-05\nSPY,20170720 00:00,2472500,2474200,2464700,2471000,38472135,2.858816395103051e-05\nQQQ,20170720 00:00,1443500,1444400,1435200,1441700,32319253,2.858816395103051e-05\nSPY,20170721 00:00,2464300,2469100,2461800,2468800,77627243,2.8534521803164725e-05\nQQQ,20170721 00:00,1436400,1441100,1433500,1441100,29346464,2.8534521803164725e-05\nSPY,20170724 00:00,2468100,2469800,2462900,2468200,32070018,2.8469979122537616e-05\nQQQ,20170724 00:00,1440900,1448700,1439200,1447700,21625264,2.8469979122537616e-05\nSPY,20170725 00:00,2477000,2478000,2471600,2474200,49230957,2.8431371788018455e-05\nQQQ,20170725 00:00,1442900,1447400,1440100,1444000,25884573,2.8431371788018455e-05\nSPY,20170726 00:00,2477800,2477900,2471300,2474300,41030559,2.842686383664833e-05\nQQQ,20170726 00:00,1447600,1449500,1445300,1448700,16848394,2.842686383664833e-05\nSPY,20170727 00:00,2479600,2480000,2456800,2472000,64357340,2.8508474779266268e-05\nQQQ,20170727 00:00,1458200,1459600,1423000,1439600,74666110,2.8508474779266268e-05\nSPY,20170728 00:00,2467000,2470600,2461400,2469100,40266001,2.8512163363889295e-05\nQQQ,20170728 00:00,1431000,1440700,1428700,1438400,33509998,2.8512163363889295e-05\nSPY,20170731 00:00,2473800,2474800,2465300,2467700,41852288,2.852899348220376e-05\nQQQ,20170731 00:00,1442500,1444300,1429200,1432300,31606853,2.852899348220376e-05\nSPY,20170801 00:00,2474500,2475000,2468000,2473200,39456990,2.8565724974730966e-05\nQQQ,20170801 00:00,1437200,1437600,1431200,1435600,17002233,2.8565724974730966e-05\nSPY,20170802 00:00,2474700,2476000,2463700,2474400,40002720,2.8326851340471457e-05\nQQQ,20170802 00:00,1444900,1445200,1426100,1439500,39489761,2.8326851340471457e-05\nSPY,20170803 00:00,2473100,2473400,2466400,2469600,35313680,2.8348122436303243e-05\nQQQ,20170803 00:00,1440900,1441400,1431300,1433900,25521874,2.8348122436303243e-05\nSPY,20170804 00:00,2475200,2477900,2469700,2474100,47115173,2.8349843259692595e-05\nQQQ,20170804 00:00,1437100,1439700,1430600,1436500,26533912,2.8349843259692595e-05\nSPY,20170807 00:00,2475000,2478700,2473700,2478700,26044202,2.8122708056758305e-05\nQQQ,20170807 00:00,1439100,1445600,1437100,1445600,16741235,2.8122708056758305e-05\nSPY,20170808 00:00,2474900,2489000,2468300,2472600,52101258,2.8146190658957732e-05\nQQQ,20170808 00:00,1442800,1454700,1439000,1443100,28774682,2.8146190658957732e-05\nSPY,20170809 00:00,2464600,2473100,2460600,2472500,55549945,2.8149407621141743e-05\nQQQ,20170809 00:00,1431200,1441900,1427900,1441200,33748470,2.8149407621141743e-05\nSPY,20170810 00:00,2463000,2464300,2437000,2437600,104046619,2.940113373806507e-05\nQQQ,20170810 00:00,1433000,1434000,1408900,1410300,58083013,2.940113373806507e-05\nSPY,20170811 00:00,2440000,2448000,2437500,2441200,61113729,2.936782412840891e-05\nQQQ,20170811 00:00,1412200,1424000,1409000,1421000,41971258,2.936782412840891e-05\nSPY,20170814 00:00,2455500,2467900,2455500,2465400,57898513,2.982064106765141e-05\nQQQ,20170814 00:00,1432300,1441500,1431900,1439300,32387080,2.982064106765141e-05\nSPY,20170815 00:00,2470000,2470000,2461600,2465100,47792878,2.978506062879858e-05\nQQQ,20170815 00:00,1442900,1443000,1436400,1440300,23753863,2.978506062879858e-05\nSPY,20170816 00:00,2470900,2475700,2464600,2469400,49448733,2.964622586474814e-05\nQQQ,20170816 00:00,1443900,1449700,1438100,1442800,30514187,2.964622586474814e-05\nSPY,20170817 00:00,2462600,2466000,2430900,2430900,115678588,3.100103659315954e-05\nQQQ,20170817 00:00,1437200,1439400,1413300,1413300,67323077,3.100103659315954e-05\nSPY,20170818 00:00,2429500,2441900,2422000,2427100,118659025,3.1016680938452965e-05\nQQQ,20170818 00:00,1414100,1422000,1406600,1412300,56332272,3.1016680938452965e-05\nSPY,20170821 00:00,2426400,2432000,2418300,2429000,52959492,3.1005786853058966e-05\nQQQ,20170821 00:00,1412200,1415200,1401800,1410500,35123426,3.1005786853058966e-05\nSPY,20170822 00:00,2436000,2456200,2435500,2454400,56390025,3.158182336976977e-05\nQQQ,20170822 00:00,1418100,1433500,1417600,1432000,34619678,3.158182336976977e-05\nSPY,20170823 00:00,2443400,2450500,2441800,2445600,41275750,3.1646559991938354e-05\nQQQ,20170823 00:00,1424800,1430100,1423800,1426900,22597420,3.1646559991938354e-05\nSPY,20170824 00:00,2450000,2451800,2437500,2439900,44822885,3.153606067626636e-05\nQQQ,20170824 00:00,1430100,1431700,1414700,1422700,34827777,3.153606067626636e-05\nSPY,20170825 00:00,2448900,2456100,2443900,2445600,53279580,3.1500030059050924e-05\nQQQ,20170825 00:00,1428200,1431800,1417800,1419700,24297121,3.1500030059050924e-05\nSPY,20170828 00:00,2451700,2451900,2440900,2445700,30596755,3.15017708875067e-05\nQQQ,20170828 00:00,1424000,1427400,1419600,1424100,13775472,3.15017708875067e-05\nSPY,20170829 00:00,2431300,2451500,2429300,2448500,45762826,3.1500383294888274e-05\nQQQ,20170829 00:00,1411900,1432100,1410600,1429700,22758846,3.1500383294888274e-05\nSPY,20170830 00:00,2448600,2463200,2446200,2460100,51768706,3.165034733051331e-05\nQQQ,20170830 00:00,1430900,1448900,1430000,1446500,32434308,3.165034733051331e-05\nSPY,20170831 00:00,2467500,2477700,2466100,2474900,74827764,3.184244438825675e-05\nQQQ,20170831 00:00,1450600,1462100,1449800,1462000,34597547,3.184244438825675e-05\nSPY,20170901 00:00,2479800,2483300,2476700,2478400,48254590,3.1840019309337976e-05\nQQQ,20170901 00:00,1463900,1465800,1456100,1460000,19670085,3.1840019309337976e-05\nSPY,20170905 00:00,2472700,2475200,2449500,2460600,80412244,3.210420273973613e-05\nQQQ,20170905 00:00,1455700,1458800,1436000,1446900,44535041,3.210420273973613e-05\nSPY,20170906 00:00,2468700,2472800,2462300,2469000,51824854,3.2068515092982175e-05\nQQQ,20170906 00:00,1451100,1454600,1440800,1451300,29368747,3.2068515092982175e-05\nSPY,20170907 00:00,2472700,2472700,2464000,2468700,51789141,3.20640068584445e-05\nQQQ,20170907 00:00,1454000,1458400,1449300,1454700,21870139,3.20640068584445e-05\nSPY,20170908 00:00,2465400,2471000,2463000,2465800,50483333,3.2053057377523075e-05\nQQQ,20170908 00:00,1452800,1453500,1440600,1442100,25232399,3.2053057377523075e-05\nSPY,20170911 00:00,2480400,2493000,2480300,2492100,58404461,2.995250876369039e-05\nQQQ,20170911 00:00,1453400,1461200,1453200,1458700,26018868,2.995250876369039e-05\nSPY,20170912 00:00,2496400,2500700,2494200,2500500,49393581,2.9032985503470357e-05\nQQQ,20170912 00:00,1462800,1464100,1455300,1462200,27088720,2.9032985503470357e-05\nSPY,20170913 00:00,2497300,2502100,2496000,2501700,42484385,2.8432930605709536e-05\nQQQ,20170913 00:00,1459700,1464400,1457300,1464200,22866601,2.8432930605709536e-05\nSPY,20170914 00:00,2498300,2503200,2496000,2500900,65581923,2.847547065727194e-05\nQQQ,20170914 00:00,1458500,1462900,1454700,1455600,27843552,2.847547065727194e-05\nSPY,20170915 00:00,2487000,2492900,2485700,2491900,68255555,2.788657883735267e-05\nQQQ,20170915 00:00,1455300,1465900,1452900,1460600,38902729,2.788657883735267e-05\nSPY,20170918 00:00,2496200,2501100,2492800,2497200,38706384,2.7714455184953253e-05\nQQQ,20170918 00:00,1459100,1463700,1451100,1455500,23954582,2.7714455184953253e-05\nSPY,20170919 00:00,2500000,2500700,2496000,2499700,38421723,2.7706236683492624e-05\nQQQ,20170919 00:00,1458100,1460100,1453100,1458000,18389221,2.7706236683492624e-05\nSPY,20170920 00:00,2500700,2501900,2489200,2500600,50752645,2.7713022989410296e-05\nQQQ,20170920 00:00,1457500,1459100,1442400,1453500,32303679,2.7713022989410296e-05\nSPY,20170921 00:00,2498700,2499800,2491900,2493900,43352855,2.7424347740896856e-05\nQQQ,20170921 00:00,1452500,1452500,1439500,1444600,27084994,2.7424347740896856e-05\nSPY,20170922 00:00,2490600,2496300,2490200,2494400,35884635,2.7263774878805967e-05\nQQQ,20170922 00:00,1440000,1445300,1438600,1443200,20342334,2.7263774878805967e-05\nSPY,20170925 00:00,2491600,2495500,2480800,2489300,50407468,2.7209005619281895e-05\nQQQ,20170925 00:00,1437500,1438300,1421000,1428000,51391091,2.7209005619281895e-05\nSPY,20170926 00:00,2494500,2496900,2488100,2490800,43026163,2.6891842085543596e-05\nQQQ,20170926 00:00,1435300,1438000,1426700,1431700,27820070,2.6891842085543596e-05\nSPY,20170927 00:00,2498900,2504900,2488800,2500500,62619261,2.679672472630469e-05\nQQQ,20170927 00:00,1439300,1450000,1435700,1444600,30416002,2.679672472630469e-05\nSPY,20170928 00:00,2497300,2504300,2496400,2503500,36427192,2.677858363852158e-05\nQQQ,20170928 00:00,1441100,1445500,1437900,1444100,23139707,2.677858363852158e-05\nSPY,20170929 00:00,2503700,2513100,2501300,2512300,59810909,2.6541582937528186e-05\nQQQ,20170929 00:00,1447000,1455600,1443200,1454500,40386063,2.6541582937528186e-05\nSPY,20171002 00:00,2515000,2523200,2514000,2523200,45157038,2.635980929819331e-05\nQQQ,20171002 00:00,1456700,1461700,1449200,1455800,26083175,2.635980929819331e-05\nSPY,20171003 00:00,2524800,2528900,2522300,2528600,48890886,2.6340077433727923e-05\nQQQ,20171003 00:00,1457700,1460600,1454500,1458900,18520352,2.6340077433727923e-05\nSPY,20171004 00:00,2527200,2534400,2525600,2531600,39214468,2.6285993993118222e-05\nQQQ,20171004 00:00,1456100,1463400,1454700,1460300,24676565,2.6285993993118222e-05\nSPY,20171005 00:00,2535400,2546800,2534100,2546600,57502282,2.6432769308172193e-05\nQQQ,20171005 00:00,1465600,1475400,1464100,1474600,29588461,2.6432769308172193e-05\nSPY,20171006 00:00,2541600,2544600,2538600,2543700,63350212,2.642953269433833e-05\nQQQ,20171006 00:00,1469600,1476600,1469600,1476600,21384976,2.642953269433833e-05\nSPY,20171009 00:00,2546500,2547000,2536500,2539500,27885527,2.6398108689502823e-05\nQQQ,20171009 00:00,1478500,1480100,1473100,1474900,13194621,2.6398108689502823e-05\nSPY,20171010 00:00,2545900,2550500,2539800,2546200,35938141,2.6298443354554168e-05\nQQQ,20171010 00:00,1479900,1481400,1469500,1476000,18721458,2.6298443354554168e-05\nSPY,20171011 00:00,2545300,2550200,2543200,2550200,35324039,2.5501041570196706e-05\nQQQ,20171011 00:00,1475300,1480700,1473400,1480400,11429786,2.5501041570196706e-05\nSPY,20171012 00:00,2546800,2550600,2543700,2546400,39362384,2.5529542887820743e-05\nQQQ,20171012 00:00,1478200,1483600,1476200,1477700,13958082,2.5529542887820743e-05\nSPY,20171013 00:00,2551500,2552700,2547600,2549500,39906982,2.5463372962238648e-05\nQQQ,20171013 00:00,1483700,1485100,1481900,1483400,17149441,2.5463372962238648e-05\nSPY,20171016 00:00,2552000,2555000,2548200,2552900,31623755,2.5469538334101044e-05\nQQQ,20171016 00:00,1487100,1488900,1484000,1488500,20856843,2.5469538334101044e-05\nSPY,20171017 00:00,2552400,2555200,2549800,2554700,29021655,2.5407239890669997e-05\nQQQ,20171017 00:00,1488000,1490600,1485700,1490400,12221763,2.5407239890669997e-05\nSPY,20171018 00:00,2559200,2559500,2555000,2557200,32340875,2.5230384002544956e-05\nQQQ,20171018 00:00,1491900,1492100,1486400,1488600,16268748,2.5230384002544956e-05\nSPY,20171019 00:00,2548300,2558200,2543500,2557900,51983499,2.5246577542273322e-05\nQQQ,20171019 00:00,1479900,1483300,1472700,1483100,25560329,2.5246577542273322e-05\nSPY,20171020 00:00,2567300,2571400,2564200,2571100,68864750,2.5255524005395266e-05\nQQQ,20171020 00:00,1489100,1490500,1485300,1487100,23514523,2.5255524005395266e-05\nSPY,20171023 00:00,2575100,2575100,2560200,2561100,50941227,2.5395749399447923e-05\nQQQ,20171023 00:00,1490200,1490300,1475400,1477400,25842803,2.5395749399447923e-05\nSPY,20171024 00:00,2565600,2568300,2561500,2565600,57258734,2.5242401820411054e-05\nQQQ,20171024 00:00,1480300,1483000,1474400,1479900,19394812,2.5242401820411054e-05\nSPY,20171025 00:00,2562300,2563100,2540000,2552900,84509571,2.528185442330814e-05\nQQQ,20171025 00:00,1477000,1481800,1463300,1474300,32891839,2.528185442330814e-05\nSPY,20171026 00:00,2560100,2563000,2555600,2556200,60425004,2.518931287476775e-05\nQQQ,20171026 00:00,1473400,1477100,1469200,1469600,24484471,2.518931287476775e-05\nSPY,20171027 00:00,2564700,2578900,2561600,2577100,68581031,2.5948916901471808e-05\nQQQ,20171027 00:00,1494300,1515200,1492100,1512400,56067103,2.5948916901471808e-05\nSPY,20171030 00:00,2570900,2576000,2564100,2567500,45270942,2.5818866465930918e-05\nQQQ,20171030 00:00,1511300,1521900,1509900,1515800,28902993,2.5818866465930918e-05\nSPY,20171031 00:00,2572100,2574400,2568100,2571500,42638839,2.5821707526079437e-05\nQQQ,20171031 00:00,1520700,1523700,1516300,1521500,24287932,2.5821707526079437e-05\nSPY,20171101 00:00,2581000,2584300,2570700,2574900,47993039,2.5543457256340033e-05\nQQQ,20171101 00:00,1527600,1528300,1515000,1521000,26423581,2.5543457256340033e-05\nSPY,20171102 00:00,2574300,2577500,2561900,2575900,48827159,2.5300376573414312e-05\nQQQ,20171102 00:00,1519300,1520000,1507700,1518100,28505858,2.5300376573414312e-05\nSPY,20171103 00:00,2578200,2585000,2573100,2584500,45788670,2.5147667618340363e-05\nQQQ,20171103 00:00,1523600,1533000,1518400,1532700,23695997,2.5147667618340363e-05\nSPY,20171106 00:00,2583100,2590000,2582200,2588500,40510098,2.5116684758032962e-05\nQQQ,20171106 00:00,1531500,1538500,1531000,1537900,27154642,2.5116684758032962e-05\nSPY,20171107 00:00,2590000,2593500,2580900,2586700,51927624,2.321020163914499e-05\nQQQ,20171107 00:00,1536700,1540800,1533400,1538800,20668666,2.321020163914499e-05\nSPY,20171108 00:00,2584600,2592200,2581500,2591100,40183247,2.3140594041645043e-05\nQQQ,20171108 00:00,1538000,1545400,1536200,1545000,15989852,2.3140594041645043e-05\nSPY,20171109 00:00,2577400,2583900,2563600,2581700,88196762,2.3109205513635462e-05\nQQQ,20171109 00:00,1532300,1537700,1521100,1536900,36619448,2.3109205513635462e-05\nSPY,20171110 00:00,2577100,2582100,2573700,2580900,46236809,2.3218066544672357e-05\nQQQ,20171110 00:00,1533300,1538200,1530600,1536800,18812296,2.3218066544672357e-05\nSPY,20171113 00:00,2573200,2585900,2572700,2583300,41967655,2.3209543721600053e-05\nQQQ,20171113 00:00,1531000,1543000,1531000,1538700,11838812,2.3209543721600053e-05\nSPY,20171114 00:00,2574400,2578500,2565200,2577300,50761825,2.327106232572635e-05\nQQQ,20171114 00:00,1533300,1535000,1525600,1533100,23486879,2.327106232572635e-05\nSPY,20171115 00:00,2566200,2572200,2556300,2564400,68119981,2.3041554335369198e-05\nQQQ,20171115 00:00,1526500,1530000,1517800,1525900,23184844,2.3041554335369198e-05\nSPY,20171116 00:00,2575200,2590400,2574800,2586200,68715102,2.3454391593990395e-05\nQQQ,20171116 00:00,1533600,1548900,1533600,1545400,30813361,2.3454391593990395e-05\nSPY,20171117 00:00,2582000,2584400,2577800,2578600,65649757,2.3415624603802353e-05\nQQQ,20171117 00:00,1545800,1546900,1538000,1539500,26503931,2.3415624603802353e-05\nSPY,20171120 00:00,2581500,2585200,2578600,2583000,38680440,2.335201930014755e-05\nQQQ,20171120 00:00,1540600,1541900,1536100,1538300,17318168,2.335201930014755e-05\nSPY,20171121 00:00,2591900,2602000,2591000,2599900,59121571,2.3325337233915446e-05\nQQQ,20171121 00:00,1545600,1555700,1544900,1555000,19556391,2.3325337233915446e-05\nSPY,20171122 00:00,2600700,2601500,2595800,2597600,36058663,2.3314589050445266e-05\nQQQ,20171122 00:00,1556400,1558400,1553500,1556900,18645624,2.3314589050445266e-05\nSPY,20171124 00:00,2603200,2604800,2601600,2603600,20775775,2.332893333922932e-05\nQQQ,20171124 00:00,1558500,1563100,1557700,1562600,7365109,2.332893333922932e-05\nSPY,20171127 00:00,2603800,2607500,2600000,2602300,43626677,2.3310628462399416e-05\nQQQ,20171127 00:00,1562100,1565600,1558300,1561900,20884148,2.3310628462399416e-05\nSPY,20171128 00:00,2607900,2629000,2606600,2628700,85200455,2.3292485048425243e-05\nQQQ,20171128 00:00,1565400,1566900,1557000,1565900,23291094,2.3292485048425243e-05\nSPY,20171129 00:00,2630500,2636300,2622000,2627100,70248234,2.337744747145755e-05\nQQQ,20171129 00:00,1564100,1564300,1531200,1538600,69863394,2.337744747145755e-05\nSPY,20171130 00:00,2638000,2660500,2636700,2650100,102291232,2.3447191397455157e-05\nQQQ,20171130 00:00,1545100,1554500,1541500,1551500,51088380,2.3447191397455157e-05\nSPY,20171201 00:00,2648000,2653100,2607600,2644600,144772948,2.3183381940518937e-05\nQQQ,20171201 00:00,1542000,1552400,1522600,1544900,54713571,2.3183381940518937e-05\nSPY,20171204 00:00,2663800,2667900,2641200,2641400,81628604,2.3282894724035788e-05\nQQQ,20171204 00:00,1554600,1556300,1525600,1527100,47860659,2.3282894724035788e-05\nSPY,20171205 00:00,2644000,2651500,2630400,2631900,72059111,2.3150259409478114e-05\nQQQ,20171205 00:00,1526800,1545500,1521000,1528100,35003699,2.3150259409478114e-05\nSPY,20171206 00:00,2628400,2637300,2627200,2632400,63603819,2.3130543896733008e-05\nQQQ,20171206 00:00,1522400,1537400,1520600,1535000,26735402,2.3130543896733008e-05\nSPY,20171207 00:00,2630800,2644300,2629400,2640700,66321314,2.258095240263917e-05\nQQQ,20171207 00:00,1534900,1544600,1533300,1540200,29052610,2.258095240263917e-05\nSPY,20171208 00:00,2650000,2655200,2647200,2655100,61507907,2.263980283607105e-05\nQQQ,20171208 00:00,1551500,1555300,1544600,1547000,25372639,2.263980283607105e-05\nSPY,20171211 00:00,2656000,2663800,2654900,2663100,59974834,2.2557383765332773e-05\nQQQ,20171211 00:00,1547700,1559500,1547600,1559000,19555803,2.2557383765332773e-05\nSPY,20171212 00:00,2666000,2673200,2663500,2667800,70771940,2.2506361867898955e-05\nQQQ,20171212 00:00,1558300,1561500,1553600,1556900,18878908,2.2506361867898955e-05\nSPY,20171213 00:00,2670500,2675600,2666600,2667500,84036820,2.222678084517004e-05\nQQQ,20171213 00:00,1563200,1565000,1557600,1559900,23519388,2.222678084517004e-05\nSPY,20171214 00:00,2670900,2672100,2656000,2656600,80249826,2.214905253751432e-05\nQQQ,20171214 00:00,1562600,1566600,1557100,1558800,22166182,2.214905253751432e-05\nSPY,20171215 00:00,2655400,2670400,2653900,2665100,121594778,2.2246424785137333e-05\nQQQ,20171215 00:00,1564900,1578200,1562400,1576500,40839767,2.2246424785137333e-05\nSPY,20171218 00:00,2681000,2686000,2679800,2682000,63715443,2.210063603699942e-05\nQQQ,20171218 00:00,1583600,1587700,1580700,1586400,22690586,2.210063603699942e-05\nSPY,20171219 00:00,2685100,2685300,2670900,2671700,65048769,2.2210381203959975e-05\nQQQ,20171219 00:00,1583400,1585000,1572700,1577000,28335811,2.2210381203959975e-05\nSPY,20171220 00:00,2682500,2683300,2666900,2670300,57876020,2.2186011455650255e-05\nQQQ,20171220 00:00,1582500,1582800,1569100,1575300,32193822,2.2186011455650255e-05\nSPY,20171221 00:00,2677300,2683900,2673000,2675800,58124382,2.2155491550849903e-05\nQQQ,20171221 00:00,1577500,1582500,1573700,1575500,16384267,2.2155491550849903e-05\nSPY,20171222 00:00,2676100,2676300,2669000,2675100,49690800,2.212629409923758e-05\nQQQ,20171222 00:00,1573100,1574300,1569500,1573700,20892107,2.212629409923758e-05\nSPY,20171226 00:00,2670200,2673800,2668900,2671900,39296365,2.2176154045381258e-05\nQQQ,20171226 00:00,1564900,1567200,1559500,1565200,21303618,2.2176154045381258e-05\nSPY,20171227 00:00,2673500,2677300,2670200,2673200,46121058,2.214736285400654e-05\nQQQ,20171227 00:00,1565300,1569600,1563900,1565400,22489654,2.214736285400654e-05\nSPY,20171228 00:00,2678700,2679200,2674500,2678700,40062616,2.183246271038642e-05\nQQQ,20171228 00:00,1570400,1570600,1565400,1567300,22681899,2.183246271038642e-05\nSPY,20171229 00:00,2685500,2685500,2666400,2668600,60907419,2.1952779935988754e-05\nQQQ,20171229 00:00,1568700,1569000,1557000,1557600,30723064,2.1952779935988754e-05\nSPY,20180102 00:00,2678600,2688100,2674000,2687700,60549562,2.217495370811296e-05\nQQQ,20180102 00:00,1565600,1585300,1561700,1584900,29229435,2.217495370811296e-05\nSPY,20180103 00:00,2689900,2706400,2689500,2704700,69993787,2.2151089940314533e-05\nQQQ,20180103 00:00,1586400,1601700,1586100,1600300,25624560,2.2151089940314533e-05\nSPY,20180104 00:00,2712200,2721600,2711000,2716100,70499774,2.2070448893500825e-05\nQQQ,20180104 00:00,1605800,1607900,1600800,1603100,23211278,2.2070448893500825e-05\nSPY,20180105 00:00,2725600,2735600,2719500,2734200,62838867,2.2307123549534964e-05\nQQQ,20180105 00:00,1610700,1620300,1607700,1619200,24592644,2.2307123549534964e-05\nSPY,20180108 00:00,2733200,2741000,2729800,2739200,45590194,2.2233311375478263e-05\nQQQ,20180108 00:00,1619200,1626300,1618600,1625500,21648301,2.2233311375478263e-05\nSPY,20180109 00:00,2744300,2752400,2740900,2745400,50588042,2.226113931375472e-05\nQQQ,20180109 00:00,1628700,1630400,1620700,1625600,22325508,2.226113931375472e-05\nSPY,20180110 00:00,2737100,2744200,2729200,2741200,52504885,2.229629208895493e-05\nQQQ,20180110 00:00,1618400,1622100,1611200,1621800,31069194,2.229629208895493e-05\nSPY,20180111 00:00,2747500,2761200,2745600,2761200,57132771,2.2431779022083423e-05\nQQQ,20180111 00:00,1624600,1633000,1622100,1632900,19081503,2.2431779022083423e-05\nSPY,20180112 00:00,2764300,2781100,2762700,2779200,72240014,2.2536770065357766e-05\nQQQ,20180112 00:00,1631500,1646600,1629400,1644900,32400221,2.2536770065357766e-05\nSPY,20180116 00:00,2794200,2800900,2761800,2769700,98395992,2.2591313824750008e-05\nQQQ,20180116 00:00,1655800,1664200,1635300,1640200,36820412,2.2591313824750008e-05\nSPY,20180117 00:00,2780700,2800500,2771900,2796100,86404443,2.2851926733359725e-05\nQQQ,20180117 00:00,1648000,1660400,1640300,1657900,30469423,2.2851926733359725e-05\nSPY,20180118 00:00,2795100,2799600,2785800,2791400,86824501,2.2857776353448595e-05\nQQQ,20180118 00:00,1655300,1661900,1651300,1658200,24456253,2.2857776353448595e-05\nSPY,20180119 00:00,2797000,2804100,2791400,2804100,115665358,2.2855218308905876e-05\nQQQ,20180119 00:00,1663100,1666000,1655400,1663400,36302385,2.2855218308905876e-05\nSPY,20180122 00:00,2801600,2826900,2801200,2826900,67806515,2.3118060081757716e-05\nQQQ,20180122 00:00,1662800,1681200,1660900,1681200,23816650,2.3118060081757716e-05\nSPY,20180123 00:00,2827600,2836200,2823800,2832900,78792149,2.3145917727849656e-05\nQQQ,20180123 00:00,1686400,1696600,1685600,1695100,31171023,2.3145917727849656e-05\nSPY,20180124 00:00,2840300,2847000,2818400,2831800,109450315,2.306504064292807e-05\nQQQ,20180124 00:00,1698700,1702400,1674400,1684100,51050581,2.306504064292807e-05\nSPY,20180125 00:00,2841600,2842700,2824100,2833000,68835239,2.2792772775352177e-05\nQQQ,20180125 00:00,1695700,1696300,1678100,1683500,26898995,2.2792772775352177e-05\nSPY,20180126 00:00,2843200,2865800,2839700,2865800,79736062,2.3393211616526786e-05\nQQQ,20180126 00:00,1692900,1709300,1689500,1709300,26322276,2.3393211616526786e-05\nSPY,20180129 00:00,2859900,2864200,2845000,2846800,75630192,2.3582139110881257e-05\nQQQ,20180129 00:00,1705700,1709000,1697400,1701000,35410275,2.3582139110881257e-05\nSPY,20180130 00:00,2832000,2832900,2812200,2817600,111230880,2.37472230983884e-05\nQQQ,20180130 00:00,1685500,1694200,1678200,1687000,41542632,2.37472230983884e-05\nSPY,20180131 00:00,2827500,2833000,2806800,2819000,95104527,2.373080888483641e-05\nQQQ,20180131 00:00,1696500,1699900,1683400,1694000,35604847,2.373080888483641e-05\nSPY,20180201 00:00,2811000,2830600,2806900,2815800,72849227,2.3818381939298813e-05\nQQQ,20180201 00:00,1681000,1697300,1674200,1679600,33038089,2.3818381939298813e-05\nSPY,20180202 00:00,2800000,2802300,2754100,2754500,149222076,2.5714352734321215e-05\nQQQ,20180202 00:00,1673000,1677000,1644700,1646100,60915528,2.5714352734321215e-05\nSPY,20180205 00:00,2734700,2758400,2633100,2639300,260184696,3.251595167336449e-05\nQQQ,20180205 00:00,1630700,1657500,1580000,1581200,98547041,3.251595167336449e-05\nSPY,20180206 00:00,2597300,2697000,2587000,2691300,317612443,3.445786646715562e-05\nQQQ,20180206 00:00,1558100,1625100,1551000,1623100,112110301,3.445786646715562e-05\nSPY,20180207 00:00,2684600,2723600,2676400,2676700,146912435,3.480151416172639e-05\nQQQ,20180207 00:00,1617900,1635500,1602000,1602100,83257372,3.480151416172639e-05\nSPY,20180208 00:00,2680000,2681600,2576000,2576300,210533683,4.1332918345195445e-05\nQQQ,20180208 00:00,1606200,1608000,1534500,1534500,89080576,4.1332918345195445e-05\nSPY,20180209 00:00,2609400,2636000,2529300,2615000,252255048,4.222344859750335e-05\nQQQ,20180209 00:00,1556200,1572400,1501300,1561000,107816842,4.222344859750335e-05\nSPY,20180212 00:00,2638900,2669800,2618800,2653400,125613495,4.314087835122868e-05\nQQQ,20180212 00:00,1577000,1599500,1564600,1588700,57585969,4.314087835122868e-05\nSPY,20180213 00:00,2640000,2666200,2633100,2660000,72719768,4.3081256075832397e-05\nQQQ,20180213 00:00,1579600,1600100,1577200,1596900,29696626,4.3081256075832397e-05\nSPY,20180214 00:00,2644000,2700000,2639700,2695900,104371989,4.3964328373393785e-05\nQQQ,20180214 00:00,1587500,1629300,1580000,1626800,47805902,4.3964328373393785e-05\nSPY,20180215 00:00,2715600,2730300,2687700,2730300,97354499,4.472492014738737e-05\nQQQ,20180215 00:00,1641400,1657000,1624400,1657000,48455411,4.472492014738737e-05\nSPY,20180216 00:00,2722700,2753200,2722700,2731100,133139606,4.4724285587384566e-05\nQQQ,20180216 00:00,1651600,1667600,1646800,1649600,56144964,4.4724285587384566e-05\nSPY,20180220 00:00,2720000,2736700,2705000,2714000,74302666,4.468397330400046e-05\nQQQ,20180220 00:00,1643800,1666800,1643100,1652900,33092894,4.468397330400046e-05\nSPY,20180221 00:00,2718500,2747100,2699800,2700500,78867162,4.468354007940266e-05\nQQQ,20180221 00:00,1661000,1677200,1647300,1648200,35263645,4.468354007940266e-05\nSPY,20180222 00:00,2710900,2730500,2696500,2704000,96644954,4.46770052335112e-05\nQQQ,20180222 00:00,1655400,1664100,1643800,1648000,34023215,4.46770052335112e-05\nSPY,20180223 00:00,2718400,2747100,2712600,2747100,71109438,4.586794443069811e-05\nQQQ,20180223 00:00,1661300,1681700,1654600,1681700,45502535,4.586794443069811e-05\nSPY,20180226 00:00,2759000,2780100,2752600,2779000,74117961,4.639849226374899e-05\nQQQ,20180226 00:00,1689600,1704000,1688200,1704000,36878844,4.639849226374899e-05\nSPY,20180227 00:00,2781100,2789200,2743600,2744300,84017988,4.710110037964656e-05\nQQQ,20180227 00:00,1704500,1707300,1682100,1682900,40035622,4.710110037964656e-05\nSPY,20180228 00:00,2756500,2761800,2713200,2716500,97944730,4.7365773663136124e-05\nQQQ,20180228 00:00,1692500,1698000,1671000,1672100,38293608,4.7365773663136124e-05\nSPY,20180301 00:00,2715000,2731700,2660000,2677000,157627163,4.7869910455450654e-05\nQQQ,20180301 00:00,1673000,1680700,1630000,1644800,67254077,4.7869910455450654e-05\nSPY,20180302 00:00,2657500,2697200,2648200,2690800,111706399,4.7861717021047863e-05\nQQQ,20180302 00:00,1625000,1662700,1619600,1659900,51884411,4.7861717021047863e-05\nSPY,20180305 00:00,2677500,2728900,2676100,2721900,82516773,4.830460401965911e-05\nQQQ,20180305 00:00,1652100,1682600,1645900,1678300,35146466,4.830460401965911e-05\nSPY,20180306 00:00,2732800,2733800,2711800,2728800,66749775,4.828407579212012e-05\nQQQ,20180306 00:00,1686500,1691100,1674900,1685400,26680406,4.828407579212012e-05\nSPY,20180307 00:00,2703900,2731700,2702100,2727800,75522183,4.824053985821141e-05\nQQQ,20180307 00:00,1672500,1690700,1669600,1689300,30575790,4.824053985821141e-05\nSPY,20180308 00:00,2735200,2742400,2724200,2741000,55014311,4.832237492137818e-05\nQQQ,20180308 00:00,1696300,1699700,1689500,1698600,24106812,4.832237492137818e-05\nSPY,20180309 00:00,2756900,2788700,2753400,2788700,93409685,4.9546532037318305e-05\nQQQ,20180309 00:00,1710700,1731600,1708200,1731600,33424419,4.9546532037318305e-05\nSPY,20180312 00:00,2792000,2799100,2780900,2785200,62503496,4.948020946780732e-05\nQQQ,20180312 00:00,1736700,1744800,1732800,1740800,33469089,4.948020946780732e-05\nSPY,20180313 00:00,2798400,2804000,2760300,2767200,77611771,4.989738255484822e-05\nQQQ,20180313 00:00,1748300,1752100,1712700,1717100,52183520,4.989738255484822e-05\nSPY,20180314 00:00,2778100,2780200,2746700,2753000,90187429,4.98640177807626e-05\nQQQ,20180314 00:00,1726100,1727400,1709400,1716800,35893605,4.98640177807626e-05\nSPY,20180315 00:00,2758500,2766000,2744300,2750000,68608453,4.971416839677082e-05\nQQQ,20180315 00:00,1718000,1725300,1709000,1715300,24478596,4.971416839677082e-05\nSPY,20180316 00:00,2744500,2753800,2741600,2742000,80466251,4.9752578327943275e-05\nQQQ,20180316 00:00,1718200,1722000,1709400,1710200,24677194,4.9752578327943275e-05\nSPY,20180319 00:00,2733400,2733800,2686300,2704900,95066872,5.1005652477039016e-05\nQQQ,20180319 00:00,1691000,1692200,1656400,1671000,62665331,5.1005652477039016e-05\nSPY,20180320 00:00,2709100,2716700,2701800,2709500,52033461,5.101568240410253e-05\nQQQ,20180320 00:00,1671700,1680400,1666100,1676500,31500793,5.101568240410253e-05\nSPY,20180321 00:00,2708800,2732600,2701900,2704300,71895340,5.0203695833978436e-05\nQQQ,20180321 00:00,1672100,1687600,1661900,1669200,41773262,5.0203695833978436e-05\nSPY,20180322 00:00,2678500,2688600,2633700,2636700,128018295,5.2772895205094e-05\nQQQ,20180322 00:00,1646100,1657700,1625900,1628000,61401317,5.2772895205094e-05\nSPY,20180323 00:00,2641700,2650200,2578300,2580500,152584561,5.511249119634276e-05\nQQQ,20180323 00:00,1626100,1633000,1584400,1585100,70619939,5.511249119634276e-05\nSPY,20180326 00:00,2621600,2654300,2594100,2651100,119051490,5.9004220286967507e-05\nQQQ,20180326 00:00,1617200,1646000,1591500,1644000,51322647,5.9004220286967507e-05\nSPY,20180327 00:00,2661700,2667700,2588700,2606000,116865500,6.132713666869844e-05\nQQQ,20180327 00:00,1656200,1656200,1576800,1590800,70092542,6.132713666869844e-05\nSPY,20180328 00:00,2607600,2626400,2585800,2598300,130160686,6.13481925781779e-05\nQQQ,20180328 00:00,1581700,1597800,1560400,1572500,80283198,6.13481925781779e-05\nSPY,20180329 00:00,2611200,2652600,2602800,2631500,101867581,6.220241196675848e-05\nQQQ,20180329 00:00,1581000,1617100,1566400,1601300,62725737,6.220241196675848e-05\nSPY,20180402 00:00,2625600,2631300,2546700,2574700,156224122,6.478662609363818e-05\nQQQ,20180402 00:00,1589900,1597500,1538800,1555100,81617579,6.478662609363818e-05\nSPY,20180403 00:00,2589200,2613100,2568400,2607700,112280149,6.529329613685325e-05\nQQQ,20180403 00:00,1568700,1579300,1544400,1572600,59080294,6.529329613685325e-05\nSPY,20180404 00:00,2567600,2643600,2566000,2635600,105850742,6.589390628490766e-05\nQQQ,20180404 00:00,1542200,1602300,1540400,1597400,59094528,6.589390628490766e-05\nSPY,20180405 00:00,2655500,2666400,2643300,2656400,74694497,6.603766502608057e-05\nQQQ,20180405 00:00,1613300,1615700,1594800,1606500,40378173,6.603766502608057e-05\nSPY,20180406 00:00,2634200,2651000,2580000,2597200,147082676,6.830960405360469e-05\nQQQ,20180406 00:00,1588800,1604600,1558800,1566300,54466041,6.830960405360469e-05\nSPY,20180409 00:00,2613700,2648400,2605400,2610000,91750575,6.842407710617373e-05\nQQQ,20180409 00:00,1579800,1608800,1574600,1577300,38606428,6.842407710617373e-05\nSPY,20180410 00:00,2642500,2660400,2629900,2651500,95382545,6.972315997383429e-05\nQQQ,20180410 00:00,1602100,1617300,1590700,1612100,45510646,6.972315997383429e-05\nSPY,20180411 00:00,2634200,2656400,2633900,2637600,80296381,6.987421859915622e-05\nQQQ,20180411 00:00,1602000,1620000,1601000,1602800,39039665,6.987421859915622e-05\nSPY,20180412 00:00,2652800,2670000,2650600,2659300,63531523,7.018379654924757e-05\nQQQ,20180412 00:00,1612500,1627700,1611600,1622100,29137347,7.018379654924757e-05\nSPY,20180413 00:00,2674500,2675400,2640100,2651500,74484642,7.01712020859596e-05\nQQQ,20180413 00:00,1630200,1632500,1606700,1613700,39801932,7.01712020859596e-05\nSPY,20180416 00:00,2670000,2681900,2660700,2673300,53229700,7.02394551556821e-05\nQQQ,20180416 00:00,1625000,1631900,1614700,1626000,24878654,7.02394551556821e-05\nSPY,20180417 00:00,2693300,2708700,2687500,2701900,54103741,7.082663284179882e-05\nQQQ,20180417 00:00,1642400,1664500,1639100,1661000,33172661,7.082663284179882e-05\nSPY,20180418 00:00,2706800,2713000,2698700,2703900,50299257,7.079143264833272e-05\nQQQ,20180418 00:00,1661000,1670000,1653100,1664400,27217596,7.079143264833272e-05\nSPY,20180419 00:00,2695900,2698600,2677200,2688900,66127959,7.10464055022388e-05\nQQQ,20180419 00:00,1656000,1659900,1643400,1649100,32272835,7.10464055022388e-05\nSPY,20180420 00:00,2688700,2690600,2656200,2666100,86632836,7.142337005232812e-05\nQQQ,20180420 00:00,1644900,1646100,1617300,1623000,43908605,7.142337005232812e-05\nSPY,20180423 00:00,2672800,2678800,2653500,2665700,56938463,7.141656889168771e-05\nQQQ,20180423 00:00,1630900,1637300,1610200,1618900,29619483,7.141656889168771e-05\nSPY,20180424 00:00,2677600,2679700,2612800,2629800,105344976,7.216526190193754e-05\nQQQ,20180424 00:00,1626600,1629000,1573900,1584600,68025816,7.216526190193754e-05\nSPY,20180425 00:00,2629400,2641300,2608500,2636300,85139536,7.202923245011512e-05\nQQQ,20180425 00:00,1587400,1593100,1564800,1586500,48319632,7.202923245011512e-05\nSPY,20180426 00:00,2648600,2672400,2642900,2663100,58733046,7.28066886396088e-05\nQQQ,20180426 00:00,1607000,1625300,1601800,1619900,38128925,7.28066886396088e-05\nSPY,20180427 00:00,2670000,2673300,2655000,2665600,49090356,7.279869584120947e-05\nQQQ,20180427 00:00,1643700,1644100,1611700,1620900,46538264,7.279869584120947e-05\nSPY,20180430 00:00,2672600,2678900,2644400,2645100,64203115,7.306388849384294e-05\nQQQ,20180430 00:00,1624700,1634800,1605400,1609400,32583764,7.306388849384294e-05\nSPY,20180501 00:00,2638700,2651000,2621200,2649800,60987801,7.305313781673309e-05\nQQQ,20180501 00:00,1605200,1628000,1601400,1627800,34080939,7.305313781673309e-05\nSPY,20180502 00:00,2647700,2656800,2627700,2632000,70609719,7.324175149765539e-05\nQQQ,20180502 00:00,1630600,1635700,1616300,1618200,35408333,7.324175149765539e-05\nSPY,20180503 00:00,2622800,2633600,2590500,2626200,120224810,7.322505737051507e-05\nQQQ,20180503 00:00,1610000,1624000,1592200,1618000,59058522,7.322505737051507e-05\nSPY,20180504 00:00,2615200,2667800,2611500,2660200,68817239,7.413441183215583e-05\nQQQ,20180504 00:00,1611000,1652500,1609800,1648700,38502554,7.413441183215583e-05\nSPY,20180507 00:00,2669100,2680200,2661100,2669200,47379307,7.418244177570493e-05\nQQQ,20180507 00:00,1656400,1667800,1655100,1662400,30015319,7.418244177570493e-05\nSPY,20180508 00:00,2664800,2673200,2651500,2669200,57615594,7.418919685127092e-05\nQQQ,20180508 00:00,1658900,1664300,1648600,1660700,24944018,7.418919685127092e-05\nSPY,20180509 00:00,2676700,2698600,2671000,2695000,52616842,7.457334776673809e-05\nQQQ,20180509 00:00,1663700,1680000,1657800,1678800,26637300,7.457334776673809e-05\nSPY,20180510 00:00,2703400,2723900,2702300,2720200,59562006,7.490985338885113e-05\nQQQ,20180510 00:00,1684200,1697400,1682900,1696200,25001870,7.490985338885113e-05\nSPY,20180511 00:00,2722500,2731400,2715800,2728500,49302696,7.487471865684191e-05\nQQQ,20180511 00:00,1694200,1698600,1687200,1694600,21711786,7.487471865684191e-05\nSPY,20180514 00:00,2733400,2740700,2723700,2729800,48164268,7.488668780174293e-05\nQQQ,20180514 00:00,1698500,1708200,1659300,1697500,19876008,7.488668780174293e-05\nSPY,20180515 00:00,2715200,2716100,2700300,2711000,75504782,7.519217499103781e-05\nQQQ,20180515 00:00,1684100,1685000,1669800,1678700,44101965,7.519217499103781e-05\nSPY,20180516 00:00,2711100,2727500,2711000,2722400,41303208,7.529661147128282e-05\nQQQ,20180516 00:00,1680900,1693700,1680100,1689800,21105809,7.529661147128282e-05\nSPY,20180517 00:00,2719300,2732300,2711400,2720100,49747414,7.340600477954969e-05\nQQQ,20180517 00:00,1683900,1696100,1675100,1683300,25902938,7.340600477954969e-05\nSPY,20180518 00:00,2716100,2720200,2709300,2713300,57758893,7.337214802654953e-05\nQQQ,20180518 00:00,1676800,1682600,1672100,1674600,23540773,7.337214802654953e-05\nSPY,20180521 00:00,2729900,2739800,2726000,2733700,49218301,7.342420284416427e-05\nQQQ,20180521 00:00,1687600,1694900,1676800,1684000,20890845,7.342420284416427e-05\nSPY,20180522 00:00,2739400,2742500,2722500,2726100,46039188,7.331609233704567e-05\nQQQ,20180522 00:00,1691700,1694500,1678800,1681800,18229381,7.331609233704567e-05\nSPY,20180523 00:00,2711900,2733900,2709900,2733600,52441278,7.338185479635065e-05\nQQQ,20180523 00:00,1668800,1696100,1668800,1696000,24979100,7.338185479635065e-05\nSPY,20180524 00:00,2729500,2732200,2707800,2728000,64497794,7.336648790722679e-05\nQQQ,20180524 00:00,1695500,1698500,1678400,1695500,26195326,7.336648790722679e-05\nSPY,20180525 00:00,2721500,2728600,2715800,2721500,43997689,7.323325260079656e-05\nQQQ,20180525 00:00,1695300,1703300,1692100,1697200,24132082,7.323325260079656e-05\nSPY,20180529 00:00,2702600,2711700,2677600,2690200,98456218,7.34840411713313e-05\nQQQ,20180529 00:00,1689500,1699200,1679600,1689700,38703565,7.34840411713313e-05\nSPY,20180530 00:00,2705000,2731000,2704300,2726100,61173533,7.381141571977561e-05\nQQQ,20180530 00:00,1695800,1704800,1692200,1701800,19705057,7.381141571977561e-05\nSPY,20180531 00:00,2722000,2724800,2702600,2709400,77780721,7.384595697485035e-05\nQQQ,20180531 00:00,1701800,1712000,1696300,1700700,33849468,7.384595697485035e-05\nSPY,20180601 00:00,2724900,2739400,2723300,2736000,61618180,7.430751331110402e-05\nQQQ,20180601 00:00,1709200,1728300,1708700,1727400,41272483,7.430751331110402e-05\nSPY,20180604 00:00,2745100,2751800,2742700,2749000,41517726,7.43270393109269e-05\nQQQ,20180604 00:00,1731800,1743400,1730700,1743000,18753380,7.43270393109269e-05\nSPY,20180605 00:00,2750200,2755300,2741900,2751000,43560811,7.43238924189374e-05\nQQQ,20180605 00:00,1747100,1751300,1740600,1748400,22545503,7.43238924189374e-05\nSPY,20180606 00:00,2759000,2775200,2750900,2774000,51074336,7.440725697545056e-05\nQQQ,20180606 00:00,1750200,1758900,1741400,1758600,23283885,7.440725697545056e-05\nSPY,20180607 00:00,2779800,2782800,2763400,2773700,62257297,7.441490161664298e-05\nQQQ,20180607 00:00,1758900,1759300,1735500,1744300,36818037,7.441490161664298e-05\nSPY,20180608 00:00,2767800,2782500,2766700,2781900,49348853,7.44075381288528e-05\nQQQ,20180608 00:00,1736100,1747000,1731800,1744400,29149960,7.44075381288528e-05\nSPY,20180611 00:00,2784200,2793700,2783100,2785600,44542078,7.41987384285943e-05\nQQQ,20180611 00:00,1743100,1753400,1742800,1749100,21215513,7.41987384285943e-05\nSPY,20180612 00:00,2790500,2793300,2782000,2789200,63125112,7.419163716161758e-05\nQQQ,20180612 00:00,1751500,1760000,1749600,1758300,21069179,7.419163716161758e-05\nSPY,20180613 00:00,2792100,2794800,2778000,2780300,66680720,7.408339863411225e-05\nQQQ,20180613 00:00,1761000,1771400,1754300,1758200,35959036,7.408339863411225e-05\nSPY,20180614 00:00,2790100,2793300,2780600,2787300,59029532,7.411670637847788e-05\nQQQ,20180614 00:00,1766300,1778900,1765000,1776000,32847905,7.411670637847788e-05\nSPY,20180615 00:00,2766500,2775000,2753500,2771300,95685257,7.417578599450707e-05\nQQQ,20180615 00:00,1769300,1773300,1761100,1769800,39273659,7.417578599450707e-05\nSPY,20180618 00:00,2754700,2767000,2749500,2765600,46078648,7.404806200646463e-05\nQQQ,20180618 00:00,1754900,1766500,1749400,1765000,26933522,7.404806200646463e-05\nSPY,20180619 00:00,2739800,2757500,2735300,2755000,73157804,7.362554305399212e-05\nQQQ,20180619 00:00,1742700,1760400,1737000,1760000,35197757,7.362554305399212e-05\nSPY,20180620 00:00,2762700,2767200,2755900,2759700,45977778,7.339959590158458e-05\nQQQ,20180620 00:00,1768100,1779800,1766500,1772500,29298016,7.339959590158458e-05\nSPY,20180621 00:00,2759800,2759800,2736800,2742400,63277398,7.368840111483678e-05\nQQQ,20180621 00:00,1777000,1778800,1753700,1757100,38540665,7.368840111483678e-05\nSPY,20180622 00:00,2756700,2757800,2744900,2747400,45162641,7.366730627426296e-05\nQQQ,20180622 00:00,1763000,1763600,1746900,1753200,27812197,7.366730627426296e-05\nSPY,20180625 00:00,2734500,2736100,2691100,2710000,115078014,7.497414200661434e-05\nQQQ,20180625 00:00,1737300,1739900,1698100,1713700,72480257,7.497414200661434e-05\nSPY,20180626 00:00,2716100,2725600,2707900,2716000,62816272,7.500100159437113e-05\nQQQ,20180626 00:00,1720000,1730500,1713700,1720700,36103163,7.500100159437113e-05\nSPY,20180627 00:00,2722700,2738700,2691800,2693500,89809831,7.485996731875764e-05\nQQQ,20180627 00:00,1728000,1735800,1696200,1697300,48556388,7.485996731875764e-05\nSPY,20180628 00:00,2692600,2717500,2684900,2708900,69724773,7.456359852442319e-05\nQQQ,20180628 00:00,1694700,1717700,1691700,1711900,43043605,7.456359852442319e-05\nSPY,20180629 00:00,2720800,2736600,2711900,2712800,71773644,7.38971117906463e-05\nQQQ,20180629 00:00,1720100,1729200,1714300,1716500,31725952,7.38971117906463e-05\nSPY,20180702 00:00,2695100,2720400,2692400,2718600,54236596,7.393794747179416e-05\nQQQ,20180702 00:00,1699700,1728500,1696700,1728000,30298605,7.393794747179416e-05\nSPY,20180703 00:00,2728800,2729800,2704200,2709000,35551259,7.41938308706781e-05\nQQQ,20180703 00:00,1734500,1734500,1706300,1708000,23208287,7.41938308706781e-05\nSPY,20180705 00:00,2721600,2731800,2709600,2731100,51422807,7.44793297876233e-05\nQQQ,20180705 00:00,1719400,1730600,1710300,1729200,28400870,7.44793297876233e-05\nSPY,20180706 00:00,2731400,2758400,2727200,2754200,53890390,7.455193512641475e-05\nQQQ,20180706 00:00,1733200,1757400,1730000,1756100,31464288,7.455193512641475e-05\nSPY,20180709 00:00,2765600,2779600,2765100,2779000,42066501,7.458950756849921e-05\nQQQ,20180709 00:00,1765200,1772300,1758200,1771900,22085629,7.458950756849921e-05\nSPY,20180710 00:00,2784000,2790100,2780900,2789000,45949582,7.457507387960858e-05\nQQQ,20180710 00:00,1775200,1777200,1767100,1773200,20775763,7.457507387960858e-05\nSPY,20180711 00:00,2771700,2780300,2765200,2768600,65023147,7.477593676186228e-05\nQQQ,20180711 00:00,1759300,1770700,1758000,1764200,26968896,7.477593676186228e-05\nSPY,20180712 00:00,2782900,2794300,2776100,2793700,52468803,7.502474530047641e-05\nQQQ,20180712 00:00,1772000,1794600,1770800,1794600,25270075,7.502474530047641e-05\nSPY,20180713 00:00,2791900,2799300,2786600,2795900,40862085,7.501932280914569e-05\nQQQ,20180713 00:00,1794500,1799000,1789500,1796100,24760337,7.501932280914569e-05\nSPY,20180716 00:00,2796600,2798000,2788400,2793400,37927451,7.492623857101706e-05\nQQQ,20180716 00:00,1796500,1799500,1788800,1791800,19170458,7.492623857101706e-05\nSPY,20180717 00:00,2784800,2809100,2784100,2804700,47922571,7.49958958240787e-05\nQQQ,20180717 00:00,1772800,1806500,1772800,1802700,28261011,7.49958958240787e-05\nSPY,20180718 00:00,2805700,2811800,2800600,2810600,35961053,7.497904950779873e-05\nQQQ,20180718 00:00,1802900,1804400,1793800,1799300,21232152,7.497904950779873e-05\nSPY,20180719 00:00,2803100,2807400,2794600,2800000,48872857,7.49857417449638e-05\nQQQ,20180719 00:00,1792800,1798800,1788300,1790300,28485440,7.49857417449638e-05\nSPY,20180720 00:00,2798000,2804800,2795100,2796800,61205760,7.499344493939402e-05\nQQQ,20180720 00:00,1796200,1801700,1787900,1789900,30820674,7.499344493939402e-05\nSPY,20180723 00:00,2794600,2804100,2790600,2802000,40201459,7.499790468557778e-05\nQQQ,20180723 00:00,1784600,1796400,1777400,1795600,19113242,7.499790468557778e-05\nSPY,20180724 00:00,2817900,2825500,2806400,2816100,55176993,7.506649279007673e-05\nQQQ,20180724 00:00,1814100,1820500,1795600,1803000,33515633,7.506649279007673e-05\nSPY,20180725 00:00,2813700,2843600,2812800,2840100,62755526,7.550523750439021e-05\nQQQ,20180725 00:00,1803800,1829300,1802800,1828200,28811490,7.550523750439021e-05\nSPY,20180726 00:00,2831500,2841100,2830900,2833400,46601066,7.569832982683035e-05\nQQQ,20180726 00:00,1803400,1809200,1798100,1800500,33630464,7.569832982683035e-05\nSPY,20180727 00:00,2837300,2838200,2803800,2814200,69312181,7.607650054888227e-05\nQQQ,20180727 00:00,1811900,1813100,1766100,1776200,55034032,7.607650054888227e-05\nSPY,20180730 00:00,2815100,2816800,2793600,2799500,53456799,7.640911030369877e-05\nQQQ,20180730 00:00,1776300,1777300,1742700,1751100,57906701,7.640911030369877e-05\nSPY,20180731 00:00,2807000,2820200,2803800,2813300,54314615,7.650535901877149e-05\nQQQ,20180731 00:00,1758000,1771300,1748200,1764500,41396605,7.650535901877149e-05\nSPY,20180801 00:00,2814800,2821300,2801400,2808600,48996782,7.647016343130742e-05\nQQQ,20180801 00:00,1768600,1776500,1761300,1771200,35078349,7.647016343130742e-05\nSPY,20180802 00:00,2794400,2825800,2791600,2823900,50365933,7.671851565341296e-05\nQQQ,20180802 00:00,1758700,1797400,1757900,1795300,42632985,7.671851565341296e-05\nSPY,20180803 00:00,2825500,2836500,2823400,2836000,41504629,7.670153132575126e-05\nQQQ,20180803 00:00,1798700,1800900,1790800,1800800,25587620,7.670153132575126e-05\nSPY,20180806 00:00,2836400,2849700,2832100,2846400,35260013,7.675776733393416e-05\nQQQ,20180806 00:00,1799600,1811900,1797400,1811400,21889822,7.675776733393416e-05\nSPY,20180807 00:00,2854000,2860100,2852500,2855800,38972125,7.675953295289043e-05\nQQQ,20180807 00:00,1816500,1821400,1812600,1818000,26022610,7.675953295289043e-05\nSPY,20180808 00:00,2853900,2859100,2849400,2854600,34117081,7.672565113904245e-05\nQQQ,20180808 00:00,1816000,1823600,1810600,1820200,20074033,7.672565113904245e-05\nSPY,20180809 00:00,2855400,2859700,2849200,2850700,31121962,7.673219829225239e-05\nQQQ,20180809 00:00,1819100,1826300,1816500,1819100,16874406,7.673219829225239e-05\nSPY,20180810 00:00,2834200,2840500,2823600,2831600,64276743,7.56670667079231e-05\nQQQ,20180810 00:00,1806800,1812100,1798400,1805200,30783887,7.56670667079231e-05\nSPY,20180813 00:00,2834900,2841600,2817700,2821000,54746417,7.56814416037432e-05\nQQQ,20180813 00:00,1808800,1820100,1802500,1803200,24111870,7.56814416037432e-05\nSPY,20180814 00:00,2829400,2841700,2825000,2839000,37456013,7.536177896509722e-05\nQQQ,20180814 00:00,1810100,1816600,1800400,1814500,19338963,7.536177896509722e-05\nSPY,20180815 00:00,2823500,2825100,2801600,2817800,90330173,7.578357536143642e-05\nQQQ,20180815 00:00,1800100,1805800,1781200,1792300,53086234,7.578357536143642e-05\nSPY,20180816 00:00,2833800,2850400,2833600,2840600,60613010,7.58506514894664e-05\nQQQ,20180816 00:00,1806100,1809900,1794700,1798200,25312473,7.58506514894664e-05\nSPY,20180817 00:00,2837600,2855600,2833800,2850600,55316391,7.445840013923565e-05\nQQQ,20180817 00:00,1793500,1803100,1782700,1798600,33948698,7.445840013923565e-05\nSPY,20180820 00:00,2855800,2859700,2850600,2856700,36225951,7.443198289090367e-05\nQQQ,20180820 00:00,1802600,1803200,1790000,1797000,21741917,7.443198289090367e-05\nSPY,20180821 00:00,2862600,2873100,2861100,2863400,57496192,7.445050461472528e-05\nQQQ,20180821 00:00,1802400,1814400,1801300,1803600,22583897,7.445050461472528e-05\nSPY,20180822 00:00,2858900,2867600,2855800,2861700,39705478,7.388061622460439e-05\nQQQ,20180822 00:00,1799800,1812700,1797500,1810600,16186743,7.388061622460439e-05\nSPY,20180823 00:00,2859400,2869400,2854400,2857900,41655271,7.382298411171838e-05\nQQQ,20180823 00:00,1807400,1820500,1805000,1808000,24600674,7.382298411171838e-05\nSPY,20180824 00:00,2864600,2876700,2863800,2875100,45762305,7.395215246648039e-05\nQQQ,20180824 00:00,1814000,1826300,1813600,1824800,20993905,7.395215246648039e-05\nSPY,20180827 00:00,2888600,2899000,2886800,2897800,51785180,7.423480771011931e-05\nQQQ,20180827 00:00,1834000,1843400,1831100,1843400,25171565,7.423480771011931e-05\nSPY,20180828 00:00,2903000,2904100,2894000,2899200,41169485,7.423979816367523e-05\nQQQ,20180828 00:00,1848300,1850200,1842200,1846100,18477558,7.423979816367523e-05\nSPY,20180829 00:00,2901600,2917400,2898900,2914800,51917476,7.442900137470832e-05\nQQQ,20180829 00:00,1849300,1868400,1848500,1867400,25960654,7.442900137470832e-05\nSPY,20180830 00:00,2909400,2913600,2896300,2903000,55221298,7.431177366226895e-05\nQQQ,20180830 00:00,1863800,1875100,1857900,1864100,26992915,7.431177366226895e-05\nSPY,20180831 00:00,2898400,2908100,2892900,2903100,52151495,7.410535036607769e-05\nQQQ,20180831 00:00,1861800,1871800,1859800,1866500,26303627,7.410535036607769e-05\nSPY,20180904 00:00,2898500,2902100,2886900,2898100,50641175,7.416283468971864e-05\nQQQ,20180904 00:00,1860800,1864000,1848500,1858500,25733347,7.416283468971864e-05\nSPY,20180905 00:00,2894100,2896400,2878900,2890300,62293382,7.40369763096372e-05\nQQQ,20180905 00:00,1855200,1855700,1828200,1834500,38956869,7.40369763096372e-05\nSPY,20180906 00:00,2891700,2894900,2870000,2881600,57093261,7.415906711365761e-05\nQQQ,20180906 00:00,1835300,1837600,1805800,1818100,41730763,7.415906711365761e-05\nSPY,20180907 00:00,2869600,2886900,2867100,2876000,59629388,7.421261141271672e-05\nQQQ,20180907 00:00,1805000,1826700,1804400,1811100,40746877,7.421261141271672e-05\nSPY,20180910 00:00,2887400,2890400,2878800,2881000,42190430,7.415359830281888e-05\nQQQ,20180910 00:00,1821500,1822500,1807300,1817200,23431667,7.415359830281888e-05\nSPY,20180911 00:00,2873700,2895500,2869800,2890500,42539380,7.38035869828823e-05\nQQQ,20180911 00:00,1809900,1834200,1805200,1831200,28024267,7.38035869828823e-05\nSPY,20180912 00:00,2890500,2898000,2882400,2891200,53961780,7.379337519791849e-05\nQQQ,20180912 00:00,1828500,1829800,1810100,1825800,34032538,7.379337519791849e-05\nSPY,20180913 00:00,2903000,2910300,2900000,2908300,44562244,7.399885758564608e-05\nQQQ,20180913 00:00,1837200,1848800,1836500,1845300,28520937,7.399885758564608e-05\nSPY,20180914 00:00,2911100,2912700,2900000,2908800,47621027,7.398006390903501e-05\nQQQ,20180914 00:00,1846600,1849400,1832600,1839900,28530710,7.398006390903501e-05\nSPY,20180917 00:00,2908200,2908600,2890400,2893400,59631885,7.438407769399518e-05\nQQQ,20180917 00:00,1836800,1838100,1811700,1813400,31552851,7.438407769399518e-05\nSPY,20180918 00:00,2895500,2915700,2895500,2909100,50345855,7.455063949376774e-05\nQQQ,20180918 00:00,1814900,1837300,1814000,1828400,30073629,7.455063949376774e-05\nSPY,20180919 00:00,2909800,2916700,2908300,2912200,42388455,7.454659309222258e-05\nQQQ,20180919 00:00,1828700,1833000,1815100,1827000,30354762,7.454659309222258e-05\nSPY,20180920 00:00,2926400,2939400,2925100,2935800,89443398,7.484105274012131e-05\nQQQ,20180920 00:00,1839600,1849700,1835100,1847200,30913412,7.484105274012131e-05\nSPY,20180921 00:00,2931700,2932200,2918100,2919900,86818431,7.490292485371771e-05\nQQQ,20180921 00:00,1852200,1854800,1834800,1837100,33896755,7.490292485371771e-05\nSPY,20180924 00:00,2914100,2915000,2903700,2910200,44500016,7.489989846840263e-05\nQQQ,20180924 00:00,1820200,1839600,1813000,1838900,31096778,7.489989846840263e-05\nSPY,20180925 00:00,2915300,2916500,2904900,2907500,38617967,7.477389142744382e-05\nQQQ,20180925 00:00,1838100,1842800,1831700,1841400,22974400,7.477389142744382e-05\nSPY,20180926 00:00,2908900,2922400,2894100,2898800,63273109,7.477924507221638e-05\nQQQ,20180926 00:00,1843000,1859900,1839100,1842700,32001124,7.477924507221638e-05\nSPY,20180927 00:00,2904100,2919100,2901000,2906900,49923097,7.473968769630845e-05\nQQQ,20180927 00:00,1850200,1864900,1849200,1858300,29602448,7.473968769630845e-05\nSPY,20180928 00:00,2900100,2912800,2899500,2907200,55605049,7.474553359216128e-05\nQQQ,20180928 00:00,1853100,1862900,1849700,1857900,26049970,7.474553359216128e-05\nSPY,20181001 00:00,2921200,2929300,2909800,2917300,55669774,7.468598215263729e-05\nQQQ,20181001 00:00,1868700,1875300,1857000,1861700,25704709,7.468598215263729e-05\nSPY,20181002 00:00,2915700,2923600,2911500,2915600,42173808,7.470363611208229e-05\nQQQ,20181002 00:00,1860100,1871800,1853200,1857500,24386848,7.470363611208229e-05\nSPY,20181003 00:00,2927400,2932100,2913200,2917200,55817020,7.469682106452753e-05\nQQQ,20181003 00:00,1865300,1869700,1856600,1859500,27517991,7.469682106452753e-05\nSPY,20181004 00:00,2912200,2912400,2876600,2894400,99293459,7.537177659085845e-05\nQQQ,20181004 00:00,1852000,1853200,1810600,1823800,73919030,7.537177659085845e-05\nSPY,20181005 00:00,2896500,2902700,2862300,2878200,90999928,7.550164882808709e-05\nQQQ,20181005 00:00,1823600,1829700,1784300,1801500,76707685,7.550164882808709e-05\nSPY,20181008 00:00,2870600,2882200,2855000,2878200,76849736,7.551944538020261e-05\nQQQ,20181008 00:00,1795200,1806400,1769300,1790500,61742017,7.551944538020261e-05\nSPY,20181009 00:00,2874300,2888600,2867700,2874000,66107852,7.54832787462575e-05\nQQQ,20181009 00:00,1791800,1810200,1787500,1796300,45411634,7.54832787462575e-05\nSPY,20181010 00:00,2869100,2869100,2778900,2783000,181989770,8.120664928361191e-05\nQQQ,20181010 00:00,1785100,1786200,1715000,1717300,107750119,8.120664928361191e-05\nSPY,20181011 00:00,2771500,2789000,2703900,2721700,246184984,8.23564562346169e-05\nQQQ,20181011 00:00,1710200,1734000,1678100,1696000,129230929,8.23564562346169e-05\nSPY,20181012 00:00,2768600,2770800,2723700,2759500,164510497,8.380705367632485e-05\nQQQ,20181012 00:00,1741700,1748600,1709400,1743200,93735869,8.380705367632485e-05\nSPY,20181015 00:00,2755400,2770400,2743000,2744000,90506955,8.409949118830387e-05\nQQQ,20181015 00:00,1737100,1740300,1715600,1722100,61016751,8.409949118830387e-05\nSPY,20181016 00:00,2765600,2808200,2760700,2804000,98163677,8.65204517792712e-05\nQQQ,20181016 00:00,1740200,1776500,1737000,1772200,61956383,8.65204517792712e-05\nSPY,20181017 00:00,2804400,2811500,2775600,2804500,96178817,8.652015710569971e-05\nQQQ,20181017 00:00,1780800,1782500,1754700,1772900,64279103,8.652015710569971e-05\nSPY,20181018 00:00,2794100,2800700,2749700,2764000,123177259,8.793500607328394e-05\nQQQ,20181018 00:00,1766200,1766800,1724500,1731800,78359843,8.793500607328394e-05\nSPY,20181019 00:00,2771600,2793000,2754700,2762500,117788143,8.793942890984383e-05\nQQQ,20181019 00:00,1745800,1760700,1723900,1730200,73550766,8.793942890984383e-05\nSPY,20181022 00:00,2770000,2773500,2744200,2750100,73429798,8.781501938124278e-05\nQQQ,20181022 00:00,1740600,1752400,1725800,1739100,49029825,8.781501938124278e-05\nSPY,20181023 00:00,2708700,2748700,2686100,2736100,125899322,8.778848828954598e-05\nQQQ,20181023 00:00,1706400,1741300,1688200,1732700,72284499,8.778848828954598e-05\nSPY,20181024 00:00,2733300,2737600,2647000,2653200,148689080,9.342254429656636e-05\nQQQ,20181024 00:00,1730700,1733600,1650400,1653400,92899209,9.342254429656636e-05\nSPY,20181025 00:00,2673100,2718100,2662300,2700800,119060991,9.573426110405244e-05\nQQQ,20181025 00:00,1679100,1720800,1671600,1710600,72464690,9.573426110405244e-05\nSPY,20181026 00:00,2659200,2687800,2623000,2653300,178385574,9.761948632212789e-05\nQQQ,20181026 00:00,1652000,1699600,1642300,1666600,119369315,9.761948632212789e-05\nSPY,20181029 00:00,2688100,2702500,2598600,2638600,145358219,9.718253440637102e-05\nQQQ,20181029 00:00,1692100,1698600,1600900,1632300,105659436,9.718253440637102e-05\nSPY,20181030 00:00,2637300,2681200,2631200,2677700,139865192,9.814950002669205e-05\nQQQ,20181030 00:00,1627500,1660400,1620200,1659200,84336866,9.814950002669205e-05\nSPY,20181031 00:00,2707100,2732300,2701300,2706300,109862120,9.909167153682538e-05\nQQQ,20181031 00:00,1686200,1712500,1685400,1698200,67657933,9.909167153682538e-05\nSPY,20181101 00:00,2716400,2737300,2703800,2735100,90496605,9.961870754459391e-05\nQQQ,20181101 00:00,1700700,1722400,1687800,1720600,48385077,9.961870754459391e-05\nSPY,20181102 00:00,2747500,2752300,2696000,2718900,105725403,0.00010001720432229384\nQQQ,20181102 00:00,1715300,1725500,1682200,1693800,69880974,0.00010001720432229384\nSPY,20181105 00:00,2724800,2740100,2713500,2733900,58423015,9.984303379611257e-05\nQQQ,20181105 00:00,1696000,1696600,1670700,1689600,37334894,9.984303379611257e-05\nSPY,20181106 00:00,2733600,2753000,2732500,2751200,50219235,9.999964109971596e-05\nQQQ,20181106 00:00,1689700,1711900,1687200,1702400,31202142,9.999964109971596e-05\nSPY,20181107 00:00,2775500,2811000,2770800,2810100,86619120,0.00010258939987329056\nQQQ,20181107 00:00,1722800,1755800,1718700,1755800,47526012,0.00010258939987329056\nSPY,20181108 00:00,2801100,2812100,2792200,2805000,56765848,0.00010263135455284703\nQQQ,20181108 00:00,1748600,1753100,1736300,1744600,36874874,0.00010263135455284703\nSPY,20181109 00:00,2790000,2792300,2761800,2777600,84222634,0.00010324038215426484\nQQQ,20181109 00:00,1728300,1732500,1701600,1715200,46735288,0.00010324038215426484\nSPY,20181112 00:00,2772400,2774600,2720000,2725700,88721475,0.00010556140072606857\nQQQ,20181112 00:00,1703200,1706400,1661800,1663300,58429623,0.00010556140072606857\nSPY,20181113 00:00,2730600,2753300,2712500,2720600,87233813,0.00010555530897408268\nQQQ,20181113 00:00,1671100,1694800,1660000,1664700,62013664,0.00010555530897408268\nSPY,20181114 00:00,2741800,2746100,2684500,2702000,112019431,0.00010574009574335465\nQQQ,20181114 00:00,1681200,1687000,1642500,1652000,69916045,0.00010574009574335465\nSPY,20181115 00:00,2687600,2735400,2670200,2730200,118697478,0.00010632512154294183\nQQQ,20181115 00:00,1649000,1685400,1634600,1680900,64836206,0.00010632512154294183\nSPY,20181116 00:00,2717400,2747400,2701800,2737300,107996462,0.00010588414775149194\nQQQ,20181116 00:00,1664500,1683100,1657800,1675000,52984169,0.00010588414775149194\nSPY,20181119 00:00,2731700,2733700,2680800,2691000,88067909,0.0001080743910616576\nQQQ,20181119 00:00,1667000,1669000,1615400,1620600,61634066,0.0001080743910616576\nSPY,20181120 00:00,2654100,2670000,2631600,2641200,121906074,0.00010943090848097345\nQQQ,20181120 00:00,1583700,1613800,1571200,1591600,95765718,0.00010943090848097345\nSPY,20181121 00:00,2657800,2671500,2650200,2650200,65299409,0.0001092553777388154\nQQQ,20181121 00:00,1613500,1619700,1601100,1603700,39161372,0.0001092553777388154\nSPY,20181123 00:00,2631600,2648200,2631000,2632500,37268417,0.00010946008174338459\nQQQ,20181123 00:00,1591300,1608400,1590900,1592100,19440370,0.00010946008174338459\nSPY,20181126 00:00,2658000,2675500,2653400,2675000,67846819,0.00011089203312363138\nQQQ,20181126 00:00,1614600,1629700,1607600,1628900,37670928,0.00011089203312363138\nSPY,20181127 00:00,2663400,2684000,2656600,2684000,68394857,0.00011093006504756745\nQQQ,20181127 00:00,1620400,1638500,1611800,1634400,35179662,0.00011093006504756745\nSPY,20181128 00:00,2696100,2745800,2685400,2745800,113271909,0.0001137397397048601\nQQQ,20181128 00:00,1646600,1687000,1637100,1687000,65556617,0.0001137397397048601\nSPY,20181129 00:00,2737100,2755500,2724400,2739800,70520259,0.00011371631096929386\nQQQ,20181129 00:00,1679900,1692600,1668200,1681500,40641640,0.00011371631096929386\nSPY,20181130 00:00,2738100,2762800,2734500,2756500,79834477,0.00011360558256342333\nQQQ,20181130 00:00,1684100,1694700,1675400,1693700,32157445,0.00011360558256342333\nSPY,20181203 00:00,2803800,2804000,2775100,2793000,87120547,0.00011444341649944064\nQQQ,20181203 00:00,1731100,1733100,1710300,1723300,46778837,0.00011444341649944064\nSPY,20181204 00:00,2783400,2788400,2699000,2702500,156127119,0.00011941851732262366\nQQQ,20181204 00:00,1714300,1719100,1655200,1657200,63579527,0.00011941851732262366\nSPY,20181206 00:00,2659700,2699600,2624400,2698400,183371757,0.00011937809892267926\nQQQ,20181206 00:00,1623800,1669100,1617700,1668900,66954926,0.00011937809892267926\nSPY,20181207 00:00,2694500,2712200,2626400,2635700,141538111,0.00012247973419166798\nQQQ,20181207 00:00,1661600,1671200,1608600,1613800,75527503,0.00012247973419166798\nSPY,20181210 00:00,2633700,2651600,2586200,2640700,144445674,0.00012251641675861674\nQQQ,20181210 00:00,1610800,1637800,1594100,1630700,68065748,0.00012251641675861674\nSPY,20181211 00:00,2676200,2678600,2624800,2641300,113002276,0.00012243019323595697\nQQQ,20181211 00:00,1657300,1657700,1622300,1636100,52460716,0.00012243019323595697\nSPY,20181212 00:00,2674500,2689500,2653800,2654600,86056529,0.0001225109886647038\nQQQ,20181212 00:00,1660000,1676000,1649600,1650500,46326965,0.0001225109886647038\nSPY,20181213 00:00,2664500,2674900,2641200,2653700,86351666,0.00012252252095906667\nQQQ,20181213 00:00,1661300,1668100,1640300,1651000,44378354,0.00012252252095906667\nSPY,20181214 00:00,2629200,2640300,2598500,2604700,104539987,0.000124333349120334\nQQQ,20181214 00:00,1632100,1638100,1607000,1610800,49409065,0.000124333349120334\nSPY,20181217 00:00,2593900,2606500,2535300,2553600,147122082,0.00012609703036208522\nQQQ,20181217 00:00,1603900,1616600,1561700,1574300,70668559,0.00012609703036208522\nSPY,20181218 00:00,2571900,2579400,2533500,2550800,119888002,0.00012592453694354493\nQQQ,20181218 00:00,1586500,1599500,1570400,1584200,58081477,0.00012592453694354493\nSPY,20181219 00:00,2551800,2593900,2493500,2512600,197525731,0.00012721463077960079\nQQQ,20181219 00:00,1581800,1607300,1533400,1545300,74373454,0.00012721463077960079\nSPY,20181220 00:00,2497800,2516200,2446600,2471700,223400311,0.00012805463568503928\nQQQ,20181220 00:00,1541500,1558700,1503900,1522900,94250074,0.00012805463568503928\nSPY,20181221 00:00,2467500,2496900,2399900,2407000,213445004,0.00013123701524319137\nQQQ,20181221 00:00,1530500,1540900,1467100,1475700,129074071,0.00013123701524319137\nSPY,20181224 00:00,2390000,2402900,2343400,2343400,126345859,0.00013406843791133262\nQQQ,20181224 00:00,1460800,1479800,1435000,1435000,49335610,0.00013406843791133262\nSPY,20181226 00:00,2359000,2461800,2337600,2461800,194254142,0.0001467602544048519\nQQQ,20181226 00:00,1450800,1524800,1440900,1524600,92989917,0.0001467602544048519\nSPY,20181227 00:00,2425700,2481800,2389600,2480700,162914215,0.00014686240122297137\nQQQ,20181227 00:00,1503700,1531700,1470900,1530500,78590106,0.00014686240122297137\nSPY,20181228 00:00,2497300,2513200,2464500,2477500,137837623,0.000146864312988884\nQQQ,20181228 00:00,1541500,1555900,1517200,1529700,71489790,0.000146864312988884\nSPY,20181231 00:00,2495000,2501600,2474800,2499200,109065742,0.00014715456071116745\nQQQ,20181231 00:00,1544000,1549800,1527100,1542600,47505014,0.00014715456071116745\nSPY,20190102 00:00,2460600,2512100,2459600,2501800,113049958,0.00014708552257207305\nQQQ,20190102 00:00,1509900,1557500,1508800,1548800,51536023,0.00014708552257207305\nSPY,20190103 00:00,2483000,2485700,2436700,2442100,120229906,0.00014963757258049562\nQQQ,20190103 00:00,1526000,1532600,1494900,1498200,69404288,0.00014963757258049562\nSPY,20190104 00:00,2475900,2531100,2471700,2523900,127632690,0.00015514316173051174\nQQQ,20190104 00:00,1523400,1570000,1517300,1562300,67039114,0.00015514316173051174\nSPY,20190107 00:00,2527600,2559300,2517000,2543800,92782393,0.00015549561533383127\nQQQ,20190107 00:00,1566200,1588600,1561100,1580900,47861136,0.00015549561533383127\nSPY,20190108 00:00,2568600,2573100,2540100,2567700,91402346,0.00015556623310759713\nQQQ,20190108 00:00,1595400,1601000,1572000,1595200,46488474,0.00015556623310759713\nSPY,20190109 00:00,2575600,2589100,2562000,2579700,81042188,0.00015569205703432022\nQQQ,20190109 00:00,1601400,1615200,1594700,1608200,42344592,0.00015569205703432022\nSPY,20190110 00:00,2563100,2591500,2555200,2588800,89194945,0.00015573327994774255\nQQQ,20190110 00:00,1596000,1613700,1587000,1612800,35692946,0.00015573327994774255\nSPY,20190111 00:00,2576500,2589800,2570300,2589800,63179848,0.00015571194549849455\nQQQ,20190111 00:00,1603300,1608600,1597900,1606900,26703439,0.00015571194549849455\nSPY,20190114 00:00,2568700,2583000,2564100,2574000,55596057,0.00015571808761564348\nQQQ,20190114 00:00,1593300,1599600,1585900,1592700,27932686,0.00015571808761564348\nSPY,20190115 00:00,2578200,2607000,2578200,2603500,75236655,0.00015642820157275785\nQQQ,20190115 00:00,1600000,1626000,1599100,1623800,37634318,0.00015642820157275785\nSPY,20190116 00:00,2608200,2619600,2606000,2609800,64108161,0.00015638800183785567\nQQQ,20190116 00:00,1626500,1637800,1623000,1623500,31433490,0.00015638800183785567\nSPY,20190117 00:00,2600000,2639200,2599700,2629600,81545544,0.0001562149362251553\nQQQ,20190117 00:00,1618300,1643600,1615700,1636300,35227649,0.0001562149362251553\nSPY,20190118 00:00,2650000,2669700,2641100,2664600,107074964,0.0001567424496216473\nQQQ,20190118 00:00,1647800,1660200,1638200,1652500,53513611,0.0001567424496216473\nSPY,20190122 00:00,2647700,2650400,2610600,2628600,94951142,0.00015775275564740236\nQQQ,20190122 00:00,1640600,1641400,1607600,1619400,51323876,0.00015775275564740236\nSPY,20190123 00:00,2640000,2647600,2606600,2634100,78007199,0.0001574088405805084\nQQQ,20190123 00:00,1627700,1635100,1603200,1621500,35694193,0.0001574088405805084\nSPY,20190124 00:00,2632100,2641900,2620900,2635500,52302743,0.0001573508254792736\nQQQ,20190124 00:00,1626800,1634400,1620700,1632000,29885170,0.0001573508254792736\nSPY,20190125 00:00,2656200,2667000,2651100,2657800,82960927,0.00015775891512701085\nQQQ,20190125 00:00,1645100,1656500,1639500,1651500,33802582,0.00015775891512701085\nSPY,20190128 00:00,2633800,2638300,2618000,2637600,78330632,0.00015812402498808587\nQQQ,20190128 00:00,1630200,1631100,1617500,1631100,29304666,0.00015812402498808587\nSPY,20190129 00:00,2639300,2645500,2624800,2634100,57549403,0.00015743939409915305\nQQQ,20190129 00:00,1632000,1632400,1609900,1615700,28156234,0.00015743939409915305\nSPY,20190130 00:00,2650900,2685200,2642500,2675800,83541451,0.0001589477619494036\nQQQ,20190130 00:00,1634000,1662800,1628900,1656800,38435029,0.0001589477619494036\nSPY,20190131 00:00,2675000,2703900,2672700,2699300,80400276,0.00015914458125636236\nQQQ,20190131 00:00,1667000,1689900,1664800,1681600,33302200,0.00015914458125636236\nSPY,20190201 00:00,2701300,2712000,2691900,2700600,72038042,0.00015912467168359721\nQQQ,20190201 00:00,1673300,1686000,1669900,1674500,29537201,0.00015912467168359721\nSPY,20190204 00:00,2701400,2720200,2693600,2719600,52322390,0.00015943854144363854\nQQQ,20190204 00:00,1674800,1695300,1673300,1695300,23620118,0.00015943854144363854\nSPY,20190205 00:00,2724700,2734400,2718900,2731000,66377266,0.00015783780040308363\nQQQ,20190205 00:00,1697600,1712300,1696900,1710300,26425448,0.00015783780040308363\nSPY,20190206 00:00,2728000,2733400,2719200,2727400,48360155,0.00015121422276509404\nQQQ,20190206 00:00,1710700,1713800,1697500,1705200,24886080,0.00015121422276509404\nSPY,20190207 00:00,2709300,2715400,2683000,2701400,87046957,0.00014970327551896807\nQQQ,20190207 00:00,1689400,1694400,1669500,1682300,40057925,0.00014970327551896807\nSPY,20190208 00:00,2687200,2705100,2678300,2704700,66123754,0.00014942072279107917\nQQQ,20190208 00:00,1667600,1685600,1665800,1685600,26940223,0.00014942072279107917\nSPY,20190211 00:00,2711700,2714900,2700400,2706200,59745218,0.00014302530159147255\nQQQ,20190211 00:00,1691700,1695800,1679800,1684000,20121553,0.00014302530159147255\nSPY,20190212 00:00,2724300,2745200,2723400,2741000,63150422,0.00014275576994113718\nQQQ,20190212 00:00,1696300,1711400,1693300,1708900,27174863,0.00014275576994113718\nSPY,20190213 00:00,2750600,2759300,2745600,2749900,58128429,0.00014176106573763684\nQQQ,20190213 00:00,1716500,1721600,1708200,1710100,23977737,0.00014176106573763684\nSPY,20190214 00:00,2737700,2756400,2728700,2743800,75153118,0.00014170924320747056\nQQQ,20190214 00:00,1704000,1718300,1698300,1712200,27535626,0.00014170924320747056\nSPY,20190215 00:00,2763800,2774000,2761300,2773700,79085885,0.00014089860545673982\nQQQ,20190215 00:00,1725200,1725300,1711400,1719400,29110477,0.00014089860545673982\nSPY,20190219 00:00,2765200,2785800,2764700,2778500,52093038,0.0001399907593312532\nQQQ,20190219 00:00,1714100,1728000,1713800,1722800,17490039,0.0001399907593312532\nSPY,20190220 00:00,2778500,2789200,2772500,2784100,67228767,0.00013999059916060754\nQQQ,20190220 00:00,1724000,1730800,1713200,1722500,31141890,0.00013999059916060754\nSPY,20190221 00:00,2777500,2781000,2763500,2774200,54799005,0.0001400925410634359\nQQQ,20190221 00:00,1717900,1722600,1707100,1716200,23187005,0.0001400925410634359\nSPY,20190222 00:00,2781500,2793500,2778200,2791400,69886502,0.00014020028273298762\nQQQ,20190222 00:00,1719900,1730100,1719000,1728900,25006408,0.00014020028273298762\nSPY,20190225 00:00,2806900,2813100,2794300,2795200,63299670,0.00014021782027752772\nQQQ,20190225 00:00,1742100,1746600,1734000,1735200,30248457,0.00014021782027752772\nSPY,20190226 00:00,2791300,2802900,2789000,2793200,51868143,0.00013894579770879278\nQQQ,20190226 00:00,1731000,1742500,1728100,1737000,20979120,0.00013894579770879278\nSPY,20190227 00:00,2785300,2795900,2774800,2792000,51380666,0.00013834833769399332\nQQQ,20190227 00:00,1729000,1738000,1717600,1735900,23268086,0.00013834833769399332\nSPY,20190228 00:00,2789700,2794500,2783200,2786800,55290567,0.00013773752045389317\nQQQ,20190228 00:00,1730500,1738100,1727000,1731900,23248524,0.00013773752045389317\nSPY,20190301 00:00,2804400,2808700,2788200,2804200,66469737,0.000137627432357856\nQQQ,20190301 00:00,1744400,1746500,1731800,1743900,29248724,0.000137627432357856\nSPY,20190304 00:00,2816500,2818700,2768400,2794000,92363298,0.00013665294431303209\nQQQ,20190304 00:00,1755400,1757900,1724700,1744200,36753041,0.00013665294431303209\nSPY,20190305 00:00,2795500,2797600,2784100,2790200,50799626,0.00013647556512142621\nQQQ,20190305 00:00,1745500,1750900,1736800,1745500,20872391,0.00013647556512142621\nSPY,20190306 00:00,2791600,2791600,2769700,2773300,65186339,0.00013613137583670779\nQQQ,20190306 00:00,1747200,1747500,1732800,1735600,25466317,0.00013613137583670779\nSPY,20190307 00:00,2768400,2769700,2740700,2750100,87135188,0.00013651319822328205\nQQQ,20190307 00:00,1731200,1731800,1707900,1714300,37390742,0.00013651319822328205\nSPY,20190308 00:00,2729200,2746500,2724300,2744600,75928240,0.00013653090938893752\nQQQ,20190308 00:00,1695100,1712500,1693400,1711700,35843196,0.00013653090938893752\nSPY,20190311 00:00,2752400,2786200,2752300,2784400,55683813,0.00013761353723055697\nQQQ,20190311 00:00,1718800,1748500,1718400,1747300,27970535,0.00013761353723055697\nSPY,20190312 00:00,2790900,2800700,2788500,2794900,67070688,0.00013636399859558713\nQQQ,20190312 00:00,1751900,1761400,1747800,1756900,31812656,0.00013636399859558713\nSPY,20190313 00:00,2804900,2823600,2803000,2813400,67192638,0.00013658296581458984\nQQQ,20190313 00:00,1766000,1779300,1763500,1770100,41549368,0.00013658296581458984\nSPY,20190314 00:00,2813300,2818400,2806700,2811600,58035218,0.00013622744604813725\nQQQ,20190314 00:00,1771300,1773400,1766500,1767100,21819108,0.00013622744604813725\nSPY,20190315 00:00,2805600,2822000,2803400,2813100,70500698,0.00013623362036163983\nQQQ,20190315 00:00,1774000,1788800,1772800,1783500,35552903,0.00013623362036163983\nSPY,20190318 00:00,2815300,2826500,2813000,2823300,53932917,0.00013623232580079405\nQQQ,20190318 00:00,1779500,1789900,1776000,1784500,31265820,0.00013623232580079405\nSPY,20190319 00:00,2834900,2843600,2814200,2824000,75871459,0.000136193710532875\nQQQ,20190319 00:00,1791800,1800000,1782900,1790500,35154600,0.000136193710532875\nSPY,20190320 00:00,2821600,2835000,2803200,2815500,76226168,0.00013487626024617436\nQQQ,20190320 00:00,1790600,1808500,1782400,1797600,48359171,0.00013487626024617436\nSPY,20190321 00:00,2806300,2851800,2806000,2847300,71740185,0.00013553032842829972\nQQQ,20190321 00:00,1792200,1828300,1791800,1825700,39599407,0.00013553032842829972\nSPY,20190322 00:00,2832200,2838000,2791800,2792500,112328040,0.0001372239898197842\nQQQ,20190322 00:00,1817800,1822700,1783700,1785600,63081223,0.0001372239898197842\nSPY,20190325 00:00,2788900,2801900,2776400,2790400,76291897,0.00013471105065096018\nQQQ,20190325 00:00,1779100,1788400,1769300,1782200,43505452,0.00013471105065096018\nSPY,20190326 00:00,2809700,2821800,2795700,2811200,59544156,0.00013251101673116336\nQQQ,20190326 00:00,1796000,1806900,1781300,1790500,31204124,0.00013251101673116336\nSPY,20190327 00:00,2811300,2817500,2779300,2796500,66485128,0.0001287151790598456\nQQQ,20190327 00:00,1793200,1797200,1766000,1779000,35311283,0.0001287151790598456\nSPY,20190328 00:00,2803600,2812100,2790700,2807100,51663386,0.000126475556386763\nQQQ,20190328 00:00,1783800,1789800,1772400,1783100,28929492,0.000126475556386763\nSPY,20190329 00:00,2824100,2828400,2811400,2824800,62399538,0.00012648134540640222\nQQQ,20190329 00:00,1796900,1798300,1786000,1796600,30546067,0.00012648134540640222\nSPY,20190401 00:00,2847000,2861600,2844100,2858300,63982897,0.00012618477345347428\nQQQ,20190401 00:00,1815100,1822600,1807700,1820400,29488047,0.00012618477345347428\nSPY,20190402 00:00,2860400,2862300,2851000,2859700,37196324,0.00012359792235867764\nQQQ,20190402 00:00,1822400,1829100,1817800,1827300,21129929,0.00012359792235867764\nSPY,20190403 00:00,2873300,2877500,2857500,2864200,58863047,0.00012310122942379151\nQQQ,20190403 00:00,1837600,1849200,1832100,1837800,30133176,0.00012310122942379151\nSPY,20190404 00:00,2868000,2874600,2860100,2871800,46049322,0.00012247262486033363\nQQQ,20190404 00:00,1838300,1845000,1826500,1837100,27789757,0.00012247262486033363\nSPY,20190405 00:00,2879500,2886300,2876000,2885700,52350041,0.00012240184854625077\nQQQ,20190405 00:00,1842400,1847600,1840200,1846600,23644875,0.00012240184854625077\nSPY,20190408 00:00,2881000,2889000,2873700,2887900,43533191,0.00012007756078712757\nQQQ,20190408 00:00,1843600,1852800,1836300,1851300,20744290,0.00012007756078712757\nSPY,20190409 00:00,2877200,2880800,2867000,2873100,58219574,0.00012005937564882317\nQQQ,20190409 00:00,1845000,1851100,1840900,1844800,24699718,0.00012005937564882317\nSPY,20190410 00:00,2877700,2883800,2873200,2882900,45338210,0.00011879507162353972\nQQQ,20190410 00:00,1847200,1855200,1845200,1854700,23262552,0.00011879507162353972\nSPY,20190411 00:00,2888400,2888400,2875800,2882100,50745623,0.00011865910260137282\nQQQ,20190411 00:00,1857800,1857800,1846900,1850300,18505271,0.00011865910260137282\nSPY,20190412 00:00,2900100,2904700,2892600,2901600,54347951,0.000118396811328272\nQQQ,20190412 00:00,1858500,1859500,1850700,1858300,22223740,0.000118396811328272\nSPY,20190415 00:00,2902700,2903500,2890800,2899700,40803641,0.00011832167615471801\nQQQ,20190415 00:00,1858400,1860700,1846200,1858600,20123121,0.00011832167615471801\nSPY,20190416 00:00,2909600,2910100,2895000,2901600,47250452,0.00011810668202336306\nQQQ,20190416 00:00,1865400,1869100,1859300,1865000,24893990,0.00011810668202336306\nSPY,20190417 00:00,2914100,2914200,2889900,2894500,46905428,0.00011721114427784122\nQQQ,20190417 00:00,1877500,1879300,1866000,1871500,27750109,0.00011721114427784122\nSPY,20190418 00:00,2901200,2903200,2886600,2900200,57128888,0.00011721341161753806\nQQQ,20190418 00:00,1874600,1875200,1862900,1873900,25593845,0.00011721341161753806\nSPY,20190422 00:00,2891700,2904400,2890700,2902700,34371097,0.00011698906285820853\nQQQ,20190422 00:00,1865700,1879900,1864300,1879200,13731861,0.00011698906285820853\nSPY,20190423 00:00,2906800,2931300,2904200,2928800,48067844,0.00011682045419653094\nQQQ,20190423 00:00,1884000,1905400,1881200,1903100,31631498,0.00011682045419653094\nSPY,20190424 00:00,2927600,2931500,2920800,2922300,39141617,0.00011685375879445694\nQQQ,20190424 00:00,1904700,1907100,1896500,1897100,21734340,0.00011685375879445694\nSPY,20190425 00:00,2921200,2927800,2907300,2920500,47913789,0.00011562408243178956\nQQQ,20190425 00:00,1911300,1912200,1894500,1904800,26548184,0.00011562408243178956\nSPY,20190426 00:00,2921200,2934900,2912500,2934100,40182622,0.00011562230833088605\nQQQ,20190426 00:00,1901800,1906900,1885900,1906500,23822356,0.00011562230833088605\nSPY,20190429 00:00,2935300,2944500,2934100,2938700,54400805,0.0001148427776943218\nQQQ,20190429 00:00,1906500,1913200,1903400,1910200,19023392,0.0001148427776943218\nSPY,20190430 00:00,2935200,2943400,2919200,2940200,65799876,0.00011484041007167289\nQQQ,20190430 00:00,1894800,1898500,1882100,1895400,28317401,0.00011484041007167289\nSPY,20190501 00:00,2947600,2949500,2918000,2918100,60258030,0.00011471221280107946\nQQQ,20190501 00:00,1907800,1913200,1888000,1889300,32651807,0.00011471221280107946\nSPY,20190502 00:00,2916800,2927000,2895500,2911800,60849168,0.00011470619100001083\nQQQ,20190502 00:00,1888700,1898500,1868700,1881100,42131444,0.00011470619100001083\nSPY,20190503 00:00,2928000,2943400,2925700,2940300,46544275,0.0001150848907486932\nQQQ,20190503 00:00,1896700,1912500,1893300,1911100,27017721,0.0001150848907486932\nSPY,20190506 00:00,2892400,2933100,2889300,2928200,87572687,0.00011520123023492203\nQQQ,20190506 00:00,1870500,1902000,1867600,1899400,34743766,0.00011520123023492203\nSPY,20190507 00:00,2901500,2908100,2858200,2879300,122126119,0.00011565865786548328\nQQQ,20190507 00:00,1878700,1886700,1845100,1862400,54326767,0.00011565865786548328\nSPY,20190508 00:00,2875600,2894300,2868800,2875300,76825136,0.00011558608108766706\nQQQ,20190508 00:00,1856300,1871700,1849600,1857700,32449463,0.00011558608108766706\nSPY,20190509 00:00,2852000,2873300,2833100,2866600,92353972,0.0001156629939632592\nQQQ,20190509 00:00,1837000,1854100,1820900,1847700,52171029,0.0001156629939632592\nSPY,20190510 00:00,2856400,2889400,2823000,2881000,98319928,0.0001152894782654487\nQQQ,20190510 00:00,1841100,1858900,1810400,1850000,54954515,0.0001152894782654487\nSPY,20190513 00:00,2823900,2834900,2799300,2808600,109539319,0.00011847324800150867\nQQQ,20190513 00:00,1802900,1812600,1780600,1785800,60429485,0.00011847324800150867\nSPY,20190514 00:00,2820100,2851000,2818500,2834000,71206743,0.00011886391362291519\nQQQ,20190514 00:00,1795200,1816300,1788600,1805400,38580449,0.00011886391362291519\nSPY,20190515 00:00,2816000,2857600,2813600,2850600,63998271,0.00011917227492602616\nQQQ,20190515 00:00,1793500,1835500,1793100,1830900,37705489,0.00011917227492602616\nSPY,20190516 00:00,2858300,2892100,2857700,2877000,64428827,0.00011919059161308818\nQQQ,20190516 00:00,1831700,1860800,1829500,1849300,36142804,0.00011919059161308818\nSPY,20190517 00:00,2851300,2886000,2851300,2858400,83049965,0.00011937912294221152\nQQQ,20190517 00:00,1831000,1855900,1828800,1830400,39804299,0.00011937912294221152\nSPY,20190520 00:00,2840600,2854300,2831200,2839500,54207516,0.00011983140979438127\nQQQ,20190520 00:00,1804900,1811800,1793400,1799500,35994540,0.00011983140979438127\nSPY,20190521 00:00,2858300,2869300,2855500,2865100,42481385,0.00012012271529474703\nQQQ,20190521 00:00,1815000,1823300,1809200,1818300,29307875,0.00012012271529474703\nSPY,20190522 00:00,2854300,2866700,2851000,2856300,44484176,0.00012003539894602251\nQQQ,20190522 00:00,1808200,1820700,1807600,1810200,22060482,0.00012003539894602251\nSPY,20190523 00:00,2831600,2832100,2805800,2821400,84366849,0.00012079009822124293\nQQQ,20190523 00:00,1789400,1790200,1771400,1782500,44194819,0.00012079009822124293\nSPY,20190524 00:00,2837500,2841900,2820900,2827800,47298776,0.00012070004187671419\nQQQ,20190524 00:00,1792100,1798500,1779400,1781600,22589441,0.00012070004187671419\nSPY,20190528 00:00,2830100,2841400,2801500,2801500,60527933,0.0001208472712783296\nQQQ,20190528 00:00,1786600,1796600,1774700,1774900,23392868,0.0001208472712783296\nSPY,20190529 00:00,2789100,2793500,2767200,2782700,92901721,0.00012108631651797922\nQQQ,20190529 00:00,1763900,1770000,1750900,1760300,39572794,0.00012108631651797922\nSPY,20190530 00:00,2790800,2800400,2778100,2790300,55710278,0.0001209097879544911\nQQQ,20190530 00:00,1765000,1772700,1757700,1767700,28350773,0.0001209097879544911\nSPY,20190531 00:00,2762000,2771200,2752500,2752700,72088865,0.00012142188710722533\nQQQ,20190531 00:00,1746900,1752900,1738800,1739500,40117278,0.00012142188710722533\nSPY,20190603 00:00,2753000,2765500,2730900,2745700,87492324,0.00012163509800128132\nQQQ,20190603 00:00,1734800,1739500,1692700,1701200,71017154,0.00012163509800128132\nSPY,20190604 00:00,2771100,2806800,2766200,2805300,68467401,0.0001234444760775027\nQQQ,20190604 00:00,1720300,1749700,1713700,1749100,43072748,0.0001234444760775027\nSPY,20190605 00:00,2823400,2829900,2803200,2829600,62528891,0.00012352886043322716\nQQQ,20190605 00:00,1765800,1766100,1743800,1762100,30828347,0.00012352886043322716\nSPY,20190606 00:00,2832900,2855500,2825700,2848000,59513845,0.00012371906868683958\nQQQ,20190606 00:00,1765100,1780400,1757400,1776100,27751893,0.00012371906868683958\nSPY,20190607 00:00,2859500,2888500,2857500,2876500,64257228,0.000124283422223139\nQQQ,20190607 00:00,1785600,1817600,1783300,1810400,42141936,0.000124283422223139\nSPY,20190610 00:00,2893500,2908200,2888800,2889700,54537978,0.00012447259905279764\nQQQ,20190610 00:00,1822500,1848500,1822100,1831500,38783273,0.00012447259905279764\nSPY,20190611 00:00,2909500,2914000,2881900,2889000,48746820,0.00012447321387302972\nQQQ,20190611 00:00,1850600,1854000,1827700,1834000,36934648,0.00012447321387302972\nSPY,20190612 00:00,2886400,2892600,2878200,2883900,40324747,0.00012450940453412288\nQQQ,20190612 00:00,1829000,1832800,1820000,1823400,25812738,0.00012450940453412288\nSPY,20190613 00:00,2893700,2899800,2886200,2895800,43570266,0.00012457627804824547\nQQQ,20190613 00:00,1831000,1838700,1827400,1834200,21717303,0.00012457627804824547\nSPY,20190614 00:00,2892700,2899200,2884100,2892600,44888094,0.00012459553654993005\nQQQ,20190614 00:00,1824800,1831100,1819400,1826400,20519150,0.00012459553654993005\nSPY,20190617 00:00,2895300,2902200,2891800,2893700,35295998,0.0001245083764236096\nQQQ,20190617 00:00,1830400,1842500,1828400,1837400,19397014,0.0001245083764236096\nSPY,20190618 00:00,2913800,2935600,2910000,2924000,77625000,0.0001250014455062919\nQQQ,20190618 00:00,1859100,1877200,1854300,1864100,43883008,0.0001250014455062919\nSPY,20190619 00:00,2925300,2936500,2914900,2930600,70013693,0.00012500072561599232\nQQQ,20190619 00:00,1866600,1875300,1855700,1871100,30558353,0.00012500072561599232\nSPY,20190620 00:00,2960200,2963100,2936100,2958600,86590076,0.00012527821981034122\nQQQ,20190620 00:00,1897200,1897600,1874500,1888500,36957899,0.00012527821981034122\nSPY,20190621 00:00,2941400,2955100,2937600,2940000,67991002,0.0001252891361316759\nQQQ,20190621 00:00,1886300,1897700,1881800,1885700,34571622,0.0001252891361316759\nSPY,20190624 00:00,2941800,2945800,2934700,2936400,38096535,0.00012506769375592367\nQQQ,20190624 00:00,1885300,1887200,1880600,1881600,17994745,0.00012506769375592367\nSPY,20190625 00:00,2936700,2937300,2906400,2907600,71876031,0.00012578766825311556\nQQQ,20190625 00:00,1880300,1881400,1846500,1849300,32580001,0.00012578766825311556\nSPY,20190626 00:00,2917800,2923100,2903500,2904700,44754247,0.00012449705011630837\nQQQ,20190626 00:00,1861600,1873300,1854900,1857900,19491445,0.00012449705011630837\nSPY,20190627 00:00,2912900,2920600,2909300,2915000,34194112,0.00012451316465950294\nQQQ,20190627 00:00,1864600,1869400,1860000,1865000,17743833,0.00012451316465950294\nSPY,20190628 00:00,2925700,2935500,2920200,2930000,48292420,0.0001240461103560153\nQQQ,20190628 00:00,1869300,1871500,1860700,1867400,19321818,0.0001240461103560153\nSPY,20190701 00:00,2966800,2969100,2943300,2956600,62311396,0.00012432427881157472\nQQQ,20190701 00:00,1903200,1905700,1883800,1892600,28837907,0.00012432427881157472\nSPY,20190702 00:00,2955900,2964900,2946900,2964300,54952846,0.00012434568371061229\nQQQ,20190702 00:00,1892000,1900300,1886500,1900100,17109901,0.00012434568371061229\nSPY,20190703 00:00,2971900,2988200,2970200,2988000,31250129,0.00012451540852649186\nQQQ,20190703 00:00,1904900,1914400,1902900,1914400,14307879,0.00012451540852649186\nSPY,20190705 00:00,2974600,2986400,2960200,2984600,41808407,0.00012434065659565734\nQQQ,20190705 00:00,1901300,1914000,1893900,1910500,18644892,0.00012434065659565734\nSPY,20190708 00:00,2970100,2973500,2962300,2968200,38037047,0.0001241491534371433\nQQQ,20190708 00:00,1898100,1898800,1889300,1897100,16851074,0.0001241491534371433\nSPY,20190709 00:00,2955100,2975200,2954800,2971900,35212296,0.00012367765691652897\nQQQ,20190709 00:00,1888100,1909000,1886500,1906600,17897528,0.00012367765691652897\nSPY,20190710 00:00,2984000,2996600,2977900,2986100,49211837,0.0001235503280008294\nQQQ,20190710 00:00,1918200,1930900,1914700,1925600,25459850,0.0001235503280008294\nSPY,20190711 00:00,2993400,2995800,2982000,2993100,46132132,0.0001235370261719626\nQQQ,20190711 00:00,1928500,1933400,1918100,1924200,21016895,0.0001235370261719626\nSPY,20190712 00:00,2998600,3007300,2995100,3006500,35952915,0.00012345636028446102\nQQQ,20190712 00:00,1926300,1935400,1924600,1935300,17235862,0.00012345636028446102\nSPY,20190715 00:00,3011200,3011300,3002200,3007500,28272073,0.00012287311282789548\nQQQ,20190715 00:00,1939800,1941900,1934400,1941500,14462032,0.00012287311282789548\nSPY,20190716 00:00,3006400,3008800,2994400,2997100,35700618,0.00012295594774761707\nQQQ,20190716 00:00,1939100,1940900,1925600,1931500,18367842,0.00012295594774761707\nSPY,20190717 00:00,2997700,2999300,2977400,2977400,35522550,0.00012308780000250385\nQQQ,20190717 00:00,1931500,1934900,1921800,1922000,14367120,0.00012308780000250385\nSPY,20190718 00:00,2971800,2992400,2967000,2988300,46198657,0.00012301289183187545\nQQQ,20190718 00:00,1912900,1927900,1906900,1924200,27032737,0.00012301289183187545\nSPY,20190719 00:00,3000100,3000700,2969700,2971700,63466815,0.00012320732838847065\nQQQ,20190719 00:00,1937400,1938300,1908100,1910100,26118257,0.00012320732838847065\nSPY,20190722 00:00,2976100,2984900,2970500,2979000,36969602,0.00012318681192707422\nQQQ,20190722 00:00,1914400,1929400,1914400,1925300,16914364,0.00012318681192707422\nSPY,20190723 00:00,2991500,3000300,2982300,3000300,40884695,0.0001233509269738055\nQQQ,20190723 00:00,1935800,1938100,1922900,1937900,17741243,0.0001233509269738055\nSPY,20190724 00:00,2991600,3014400,2990900,3014400,39298979,0.00012344899960854274\nQQQ,20190724 00:00,1930500,1951600,1930300,1951500,17824133,0.00012344899960854274\nSPY,20190725 00:00,3009700,3010000,2991200,3000000,47024731,0.000123579395247193\nQQQ,20190725 00:00,1944900,1945200,1929300,1933000,20193300,0.000123579395247193\nSPY,20190726 00:00,3007700,3022300,3006200,3020100,36417399,0.00012338656496657676\nQQQ,20190726 00:00,1945300,1955500,1944300,1952900,17791758,0.00012338656496657676\nSPY,20190729 00:00,3018500,3019300,3008500,3014600,33607291,0.0001232546152724186\nQQQ,20190729 00:00,1951100,1951800,1933900,1946200,19023985,0.0001232546152724186\nSPY,20190730 00:00,2999000,3011700,2994900,3007200,39992583,0.00012291425631268704\nQQQ,20190730 00:00,1931300,1945400,1929900,1937800,16274996,0.00012291425631268704\nSPY,20190731 00:00,3009800,3012000,2952000,2974300,93490663,0.0001232325546269875\nQQQ,20190731 00:00,1943000,1944300,1893200,1911000,38087747,0.0001232325546269875\nSPY,20190801 00:00,2975600,3008700,2939600,2948400,129413425,0.0001232901745947622\nQQQ,20190801 00:00,1914300,1949800,1892300,1901500,58757033,0.0001232901745947622\nSPY,20190802 00:00,2938600,2941200,2909000,2926200,98958651,0.00012378169467505617\nQQQ,20190802 00:00,1887200,1889900,1862100,1873500,49202220,0.00012378169467505617\nSPY,20190805 00:00,2880700,2882000,2817300,2838200,153207444,0.0001277777125478733\nQQQ,20190805 00:00,1834300,1835100,1792100,1807300,67590576,0.0001277777125478733\nSPY,20190806 00:00,2859300,2880300,2842800,2878000,101365146,0.00012849821160987706\nQQQ,20190806 00:00,1824000,1838000,1810800,1832600,38954290,0.00012849821160987706\nSPY,20190807 00:00,2844000,2888200,2820600,2879700,111953123,0.0001284270937992148\nQQQ,20190807 00:00,1812700,1845100,1798900,1842500,44179383,0.0001284270937992148\nSPY,20190808 00:00,2896200,2936200,2890200,2936200,72990577,0.0001300584171301081\nQQQ,20190808 00:00,1850800,1883200,1845700,1882600,35522550,0.0001300584171301081\nSPY,20190809 00:00,2925900,2932400,2896500,2916200,80339390,0.0001303271976074698\nQQQ,20190809 00:00,1873600,1880000,1850300,1864900,31554795,0.0001303271976074698\nSPY,20190812 00:00,2899000,2905600,2870200,2881000,56407758,0.00013088784156621\nQQQ,20190812 00:00,1853400,1859000,1835100,1843500,22477823,0.00013088784156621\nSPY,20190813 00:00,2877800,2941500,2873600,2925500,84048259,0.00013199829080191993\nQQQ,20190813 00:00,1841900,1896800,1840100,1883900,37689505,0.00013199829080191993\nSPY,20190814 00:00,2880500,2887400,2837600,2839000,117557987,0.000135538254837514\nQQQ,20190814 00:00,1853600,1859500,1820100,1827600,46121089,0.000135538254837514\nSPY,20190815 00:00,2848900,2856300,2823900,2846500,83862040,0.00013537094894338372\nQQQ,20190815 00:00,1830000,1835900,1811600,1825500,33464974,0.00013537094894338372\nSPY,20190816 00:00,2864900,2893300,2864400,2888500,68482425,0.00013592278233378558\nQQQ,20190816 00:00,1842100,1859500,1841000,1854800,28569490,0.00013592278233378558\nSPY,20190819 00:00,2922300,2930800,2914400,2923300,48006246,0.0001365680196057894\nQQQ,20190819 00:00,1881600,1888300,1875000,1884300,20129768,0.0001365680196057894\nSPY,20190820 00:00,2917800,2923600,2899500,2900900,44802403,0.00013681792030061337\nQQQ,20190820 00:00,1879600,1886400,1869500,1869700,18657174,0.00013681792030061337\nSPY,20190821 00:00,2924700,2928600,2917200,2924500,43174047,0.00013710158208969883\nQQQ,20190821 00:00,1886100,1892300,1879600,1886300,18359394,0.00013710158208969883\nSPY,20190822 00:00,2932400,2939300,2904000,2923600,46884642,0.00013707802811239856\nQQQ,20190822 00:00,1889800,1894600,1865400,1880200,23071644,0.00013707802811239856\nSPY,20190823 00:00,2909500,2927600,2834700,2848500,120191247,0.00014035719080647286\nQQQ,20190823 00:00,1867400,1884500,1815600,1820700,49924672,0.00014035719080647286\nSPY,20190826 00:00,2872400,2880000,2855800,2880000,59943714,0.0001410034288589419\nQQQ,20190826 00:00,1841400,1848700,1830900,1848200,24232347,0.0001410034288589419\nSPY,20190827 00:00,2895500,2899500,2860400,2868700,61103929,0.00014082310517046431\nQQQ,20190827 00:00,1861100,1864200,1837100,1844300,26262643,0.00014082310517046431\nSPY,20190828 00:00,2861000,2890600,2852500,2888900,53616521,0.00014060447786411618\nQQQ,20190828 00:00,1838300,1854000,1829200,1850900,19959085,0.00014060447786411618\nSPY,20190829 00:00,2917700,2931600,2906200,2925800,50484863,0.00014136905407719286\nQQQ,20190829 00:00,1873900,1884600,1866700,1879200,23300786,0.00014136905407719286\nSPY,20190830 00:00,2942100,2942400,2914300,2924500,53366859,0.0001411336910411457\nQQQ,20190830 00:00,1889300,1889700,1864200,1874700,24080848,0.0001411336910411457\nSPY,20190903 00:00,2905600,2915800,2892800,2907400,56717313,0.00014133410323308645\nQQQ,20190903 00:00,1862200,1877000,1850300,1856500,25662692,0.00014133410323308645\nSPY,20190904 00:00,2931500,2940600,2923100,2940400,41612831,0.0001419774024891801\nQQQ,20190904 00:00,1874400,1884900,1869000,1883300,19594427,0.0001419774024891801\nSPY,20190905 00:00,2967800,2988200,2966500,2978200,73400759,0.00014286359119507\nQQQ,20190905 00:00,1904100,1923200,1903300,1917800,31241898,0.00014286359119507\nSPY,20190906 00:00,2982100,2987500,2974200,2980500,42688556,0.00014271052689789082\nQQQ,20190906 00:00,1921000,1921700,1911700,1915900,17211972,0.00014271052689789082\nSPY,20190909 00:00,2991500,2992300,2971600,2982000,46732221,0.00014259008689830843\nQQQ,20190909 00:00,1921900,1922700,1902200,1911900,23060214,0.00014259008689830843\nSPY,20190910 00:00,2973300,2982000,2959700,2981300,52064073,0.0001425601569074546\nQQQ,20190910 00:00,1901600,1907400,1889100,1906400,22283912,0.0001425601569074546\nSPY,20190911 00:00,2984900,3003300,2977500,3002500,56792958,0.0001427910663400106\nQQQ,20190911 00:00,1910000,1925300,1905600,1924300,21915341,0.0001427910663400106\nSPY,20190912 00:00,3012400,3024400,3004100,3012900,67811540,0.0001427501213252706\nQQQ,20190912 00:00,1936100,1947100,1929600,1932300,25912875,0.0001427501213252706\nSPY,20190913 00:00,3017800,3021700,3006800,3010900,54558955,0.00014276407905930018\nQQQ,20190913 00:00,1930000,1934000,1922900,1925400,24713148,0.00014276407905930018\nSPY,20190916 00:00,2998000,3006400,2994500,3001600,49705444,0.00014258945740012986\nQQQ,20190916 00:00,1912300,1920700,1911100,1916800,18829434,0.00014258945740012986\nSPY,20190917 00:00,2999100,3010200,2997700,3009200,36323494,0.00014263166023313468\nQQQ,20190917 00:00,1916900,1926000,1912900,1926000,19428537,0.00014263166023313468\nSPY,20190918 00:00,3004700,3012200,2982500,3011000,69120166,0.0001423083507180113\nQQQ,20190918 00:00,1922100,1926000,1901100,1925200,26993056,0.0001423083507180113\nSPY,20190919 00:00,3015000,3026300,3007200,3010800,69121065,0.00014214152286370929\nQQQ,20190919 00:00,1928700,1940400,1924700,1928400,24851268,0.00014214152286370929\nSPY,20190920 00:00,3003400,3006700,2974100,2982800,76469577,0.00014255546310762077\nQQQ,20190920 00:00,1930500,1933100,1901600,1908000,27164480,0.00014255546310762077\nSPY,20190923 00:00,2975700,2990000,2972800,2982100,34996734,0.00014221492203428686\nQQQ,20190923 00:00,1903200,1913300,1897200,1905000,21159602,0.00014221492203428686\nSPY,20190924 00:00,2994100,2998400,2948200,2958700,86035930,0.0001425176439831214\nQQQ,20190924 00:00,1914100,1917800,1871600,1879700,38842147,0.0001425176439831214\nSPY,20190925 00:00,2959400,2981000,2943300,2976200,59649873,0.0001427822007882162\nQQQ,20190925 00:00,1877800,1905800,1862100,1900800,32534077,0.0001427822007882162\nSPY,20190926 00:00,2976200,2978600,2954500,2970000,50218277,0.00014282167099948797\nQQQ,20190926 00:00,1898300,1900000,1879800,1893800,25722859,0.00014282167099948797\nSPY,20190927 00:00,2978700,2979400,2936900,2954000,69755359,0.00014310526242523322\nQQQ,20190927 00:00,1897300,1898300,1857500,1870300,38265215,0.00014310526242523322\nSPY,20190930 00:00,2959800,2975500,2959200,2967700,43647624,0.00014318511852286488\nQQQ,20190930 00:00,1877900,1891000,1874000,1888100,24564895,0.00014318511852286488\nSPY,20191001 00:00,2976700,2984500,2930000,2932400,82358360,0.0001435824108308595\nQQQ,20191001 00:00,1895000,1905900,1869600,1872700,31105641,0.0001435824108308595\nSPY,20191002 00:00,2914900,2915100,2866400,2880600,112701810,0.00014477581997515346\nQQQ,20191002 00:00,1860000,1860300,1830200,1840500,45253981,0.00014477581997515346\nSPY,20191003 00:00,2878100,2904200,2848200,2904200,80754022,0.00014512469455733057\nQQQ,20191003 00:00,1840300,1862000,1818200,1860700,38298158,0.00014512469455733057\nSPY,20191004 00:00,2912100,2946300,2910800,2943500,51702655,0.00014590559535973218\nQQQ,20191004 00:00,1870800,1890800,1868800,1888100,29130844,0.00014590559535973218\nSPY,20191007 00:00,2935000,2952600,2927700,2930800,53449478,0.00014535053161577975\nQQQ,20191007 00:00,1882700,1897400,1879100,1882400,20000452,0.00014535053161577975\nSPY,20191008 00:00,2910300,2918500,2884900,2885300,84728916,0.00014601417361224508\nQQQ,20191008 00:00,1870600,1878600,1852700,1854200,30189252,0.00014601417361224508\nSPY,20191009 00:00,2907800,2923000,2900600,2912700,53598153,0.0001463687005467776\nQQQ,20191009 00:00,1869900,1880800,1864300,1872300,18612667,0.0001463687005467776\nSPY,20191010 00:00,2911400,2942100,2910000,2932400,51438836,0.00014658461762736327\nQQQ,20191010 00:00,1872800,1894300,1871300,1886800,22593965,0.00014658461762736327\nSPY,20191011 00:00,2962800,2987200,2961500,2962800,84666635,0.00014145003353029402\nQQQ,20191011 00:00,1908300,1926300,1907200,1911100,37029245,0.00014145003353029402\nSPY,20191014 00:00,2959300,2966700,2955800,2959500,33597139,0.00014029956318142137\nQQQ,20191014 00:00,1908400,1917000,1906500,1910900,13636783,0.00014029956318142137\nSPY,20191015 00:00,2970500,2997000,2969700,2988800,42092291,0.00013929268663291427\nQQQ,20191015 00:00,1916800,1939700,1915600,1935200,22291734,0.00013929268663291427\nSPY,20191016 00:00,2984000,2991600,2979200,2984000,44244959,0.00013901466374378912\nQQQ,20191016 00:00,1928600,1935200,1924300,1930400,18871220,0.00013901466374378912\nSPY,20191017 00:00,2997000,3002400,2985200,2992800,42407689,0.00013658563035943657\nQQQ,20191017 00:00,1942000,1945000,1928100,1935500,18090263,0.00013658563035943657\nSPY,20191018 00:00,2987100,2994000,2970000,2979700,52953828,0.00013677273081173967\nQQQ,20191018 00:00,1932000,1936700,1907100,1916900,25488691,0.00013677273081173967\nSPY,20191021 00:00,2994800,3002100,2989400,2999900,32012712,0.00013559594389026233\nQQQ,20191021 00:00,1927100,1935200,1921400,1933900,14439112,0.00013559594389026233\nSPY,20191022 00:00,3006300,3009000,2989200,2990100,45261515,0.0001357136708541944\nQQQ,20191022 00:00,1941500,1944200,1917900,1918500,19768612,0.0001357136708541944\nSPY,20191023 00:00,2987400,2999400,2985000,2998800,29921722,0.00013581825368069324\nQQQ,20191023 00:00,1914600,1922500,1911500,1922200,12763854,0.00013581825368069324\nSPY,20191024 00:00,3008800,3010700,2994700,3003700,32530924,0.00013577115365356158\nQQQ,20191024 00:00,1935900,1942100,1927400,1940900,16698261,0.00013577115365356158\nSPY,20191025 00:00,2997400,3021900,2996900,3016000,39239172,0.00013018231513143444\nQQQ,20191025 00:00,1930700,1957400,1930500,1956400,20284113,0.00013018231513143444\nSPY,20191028 00:00,3029100,3038500,3029100,3033000,36575627,0.0001280186176705495\nQQQ,20191028 00:00,1965500,1978300,1965500,1975700,16695008,0.0001280186176705495\nSPY,20191029 00:00,3030300,3042200,3028600,3032100,41162448,0.0001261384839498093\nQQQ,20191029 00:00,1973000,1975300,1960100,1960400,17566024,0.0001261384839498093\nSPY,20191030 00:00,3034200,3045500,3019900,3041400,42953304,0.0001256561468952758\nQQQ,20191030 00:00,1964300,1973200,1952900,1969900,19817911,0.0001256561468952758\nSPY,20191031 00:00,3041100,3041300,3017400,3033300,58711304,0.00012477107124367033\nQQQ,20191031 00:00,1975200,1976500,1959400,1970800,24861874,0.00012477107124367033\nSPY,20191101 00:00,3049200,3061900,3047500,3061400,60530013,0.00012414138615815076\nQQQ,20191101 00:00,1979300,1988800,1976300,1988700,20308848,0.00012414138615815076\nSPY,20191104 00:00,3078700,3080000,3069600,3073700,53557993,0.0001237142189565209\nQQQ,20191104 00:00,2002000,2005300,1997400,2001000,17960874,0.0001237142189565209\nSPY,20191105 00:00,3075800,3079100,3067100,3070300,38622636,0.00012329695292270958\nQQQ,20191105 00:00,2003400,2005500,1995500,2002100,14223837,0.00012329695292270958\nSPY,20191106 00:00,3070600,3074000,3060700,3071000,39751180,0.00012336468202788888\nQQQ,20191106 00:00,1999700,2000000,1987900,1997600,17544510,0.00012336468202788888\nSPY,20191107 00:00,3086000,3094500,3076600,3081800,49868008,0.00012323746786491483\nQQQ,20191107 00:00,2007600,2017200,1998500,2004300,16370368,0.00012323746786491483\nSPY,20191108 00:00,3078200,3089700,3070400,3089400,40602769,0.0001207027249736159\nQQQ,20191108 00:00,2000700,2012500,1995400,2012300,14639508,0.0001207027249736159\nSPY,20191111 00:00,3074300,3085400,3072700,3083500,29661437,0.0001206585306225148\nQQQ,20191111 00:00,2002100,2010400,1999400,2009600,8982977,0.0001206585306225148\nSPY,20191112 00:00,3087500,3099900,3081500,3090000,42687583,0.00011995945591913833\nQQQ,20191112 00:00,2011300,2022100,2008200,2015400,14317792,0.00011995945591913833\nSPY,20191113 00:00,3079000,3095400,3076700,3091000,48941059,0.00011758615131179863\nQQQ,20191113 00:00,2008400,2017700,2007100,2015900,14498055,0.00011758615131179863\nSPY,20191114 00:00,3087700,3096400,3080900,3095500,45780378,0.00011758031185043723\nQQQ,20191114 00:00,2008400,2015600,2002200,2014300,15516675,0.00011758031185043723\nSPY,20191115 00:00,3109800,3118300,3102600,3117900,48879480,0.00011750074716859283\nQQQ,20191115 00:00,2026500,2029100,2020000,2029100,16865354,0.00011750074716859283\nSPY,20191118 00:00,3115200,3122800,3110300,3120200,43348280,0.00011684866887692302\nQQQ,20191118 00:00,2025900,2033900,2017700,2030700,15292448,0.00011684866887692302\nSPY,20191119 00:00,3126800,3126900,3112200,3119300,61908885,0.000116881628560373\nQQQ,20191119 00:00,2038400,2038400,2025900,2033700,15201852,0.000116881628560373\nSPY,20191120 00:00,3113000,3118200,3090700,3107700,67573622,0.00011467206220240001\nQQQ,20191120 00:00,2028400,2034500,2006200,2021500,32107878,0.00011467206220240001\nSPY,20191121 00:00,3108500,3110100,3093900,3102700,45099359,0.00011325999698868087\nQQQ,20191121 00:00,2019300,2044500,2010700,2017000,16371636,0.00011325999698868087\nSPY,20191122 00:00,3110600,3112300,3098500,3109600,35054695,0.00011318615720389466\nQQQ,20191122 00:00,2022000,2023200,2007400,2018300,14828836,0.00011318615720389466\nSPY,20191125 00:00,3119900,3133700,3119800,3133700,40447004,0.00011324644917084202\nQQQ,20191125 00:00,2027000,2042600,2026500,2042200,16159124,0.00011324644917084202\nSPY,20191126 00:00,3134200,3142800,3130600,3140800,33060315,0.00011189349066271828\nQQQ,20191126 00:00,2043500,2048700,2040500,2046100,12811867,0.00011189349066271828\nSPY,20191127 00:00,3146700,3154800,3143700,3154800,39384378,0.00011195818944984863\nQQQ,20191127 00:00,2051400,2060500,2048900,2060400,15155241,0.00011195818944984863\nSPY,20191129 00:00,3148900,3151300,3140600,3143100,26816024,0.00010926424051054628\nQQQ,20191129 00:00,2055200,2058300,2050000,2051000,8390058,0.00010926424051054628\nSPY,20191202 00:00,3146300,3146600,3111800,3116400,66926781,0.00010961916217641193\nQQQ,20191202 00:00,2051100,2051800,2017800,2030000,26045351,0.00010961916217641193\nSPY,20191203 00:00,3086400,3096400,3071300,3095500,66499178,0.00010972446335066617\nQQQ,20191203 00:00,2002100,2014900,1992300,2014100,28526741,0.00010972446335066617\nSPY,20191204 00:00,3106300,3121100,3103200,3114600,39502096,0.00010897201354247877\nQQQ,20191204 00:00,2024400,2029100,2021400,2024300,13924086,0.00010897201354247877\nSPY,20191205 00:00,3122200,3122400,3105900,3120200,36852740,0.00010383917091262075\nQQQ,20191205 00:00,2031000,2031500,2018400,2028300,14205182,0.00010383917091262075\nSPY,20191206 00:00,3141400,3153100,3141000,3148700,41180679,0.00010422470020071926\nQQQ,20191206 00:00,2043100,2051500,2041500,2050000,13379376,0.00010422470020071926\nSPY,20191209 00:00,3144100,3151800,3138000,3138800,30852815,0.00010107084592792876\nQQQ,20191209 00:00,2046300,2055900,2039800,2040700,12675207,0.00010107084592792876\nSPY,20191210 00:00,3138000,3145400,3128100,3135300,43286945,0.0001010399491624288\nQQQ,20191210 00:00,2041600,2048800,2034400,2039000,19320256,0.0001010399491624288\nSPY,20191211 00:00,3140500,3147000,3136000,3144200,45117507,0.00010108112887047732\nQQQ,20191211 00:00,2043600,2051900,2040400,2049800,15793538,0.00010108112887047732\nSPY,20191212 00:00,3144500,3179900,3141700,3171300,84790876,0.00010115112144029073\nQQQ,20191212 00:00,2047700,2073200,2045000,2065100,29930333,0.00010115112144029073\nSPY,20191213 00:00,3168800,3186600,3160300,3173200,69090591,0.00010114686597965754\nQQQ,20191213 00:00,2064000,2079200,2059600,2071900,29345791,0.00010114686597965754\nSPY,20191216 00:00,3191800,3201500,3191800,3195000,66586561,9.941597476923744e-05\nQQQ,20191216 00:00,2085500,2095200,2084800,2092700,18405004,9.941597476923744e-05\nSPY,20191217 00:00,3199800,3202400,3194800,3195700,47875424,9.747193409392985e-05\nQQQ,20191217 00:00,2095400,2097100,2089700,2093900,14379967,9.747193409392985e-05\nSPY,20191218 00:00,3200000,3202500,3195300,3195900,42877236,9.751465068407241e-05\nQQQ,20191218 00:00,2095700,2101400,2093300,2095500,14046362,9.751465068407241e-05\nSPY,20191219 00:00,3197800,3209800,3197600,3209000,66460035,9.593832411362563e-05\nQQQ,20191219 00:00,2096200,2109300,2096200,2108600,15213543,9.593832411362563e-05\nSPY,20191220 00:00,3205400,3214500,3204000,3207300,121837660,9.482912173551004e-05\nQQQ,20191220 00:00,2118600,2120500,2112700,2117100,24243313,9.482912173551004e-05\nSPY,20191223 00:00,3216300,3216500,3210700,3212200,40678424,9.130009831310521e-05\nQQQ,20191223 00:00,2120000,2121500,2116300,2118100,21504172,9.130009831310521e-05\nSPY,20191224 00:00,3214300,3215200,3209000,3212300,16196485,8.809492423068064e-05\nQQQ,20191224 00:00,2120000,2120900,2114400,2119200,6416983,8.809492423068064e-05\nSPY,20191226 00:00,3216900,3229400,3216400,3229400,27791943,7.623974689930521e-05\nQQQ,20191226 00:00,2122600,2138100,2122300,2137900,13380487,7.623974689930521e-05\nSPY,20191227 00:00,3237700,3238000,3222900,3228600,36687383,7.618646484436557e-05\nQQQ,20191227 00:00,2145400,2145600,2130400,2136100,16329144,7.618646484436557e-05\nSPY,20191230 00:00,3229400,3231000,3205500,3210800,43131761,7.63763726940155e-05\nQQQ,20191230 00:00,2135000,2136300,2111600,2122100,18324822,7.63763726940155e-05\nSPY,20191231 00:00,3205000,3221250,3201500,3218600,39932115,7.616144434893297e-05\nQQQ,20191231 00:00,2115300,2127600,2112050,2126100,16245049,7.616144434893297e-05\nSPY,20200102 00:00,3235800,3248700,3225350,3248700,48912531,7.666902460527495e-05\nQQQ,20200102 00:00,2144000,2161600,2139800,2161600,28675286,7.666902460527495e-05\nSPY,20200103 00:00,3211900,3236400,3211100,3224100,60780998,7.364389199119552e-05\nQQQ,20200103 00:00,2133000,2154700,2132800,2141800,24570808,7.364389199119552e-05\nSPY,20200106 00:00,3204400,3237300,3203600,3236400,43759922,6.835302042428363e-05\nQQQ,20200106 00:00,2125000,2155900,2122500,2155600,19700382,6.835302042428363e-05\nSPY,20200107 00:00,3230200,3235350,3222400,3227300,35212108,6.808375745532053e-05\nQQQ,20200107 00:00,2156400,2161400,2148500,2155300,20510990,6.808375745532053e-05\nSPY,20200108 00:00,3229900,3257800,3226800,3244500,57728195,6.79312865877252e-05\nQQQ,20200108 00:00,2155000,2181400,2151600,2171500,23694484,6.79312865877252e-05\nSPY,20200109 00:00,3262000,3267300,3255200,3266500,44095946,6.799653716043758e-05\nQQQ,20200109 00:00,2189400,2194100,2177200,2189900,21454160,6.799653716043758e-05\nSPY,20200110 00:00,3273600,3274600,3252050,3257100,45653071,6.803841672151731e-05\nQQQ,20200110 00:00,2198500,2198700,2180400,2184300,18295352,6.803841672151731e-05\nSPY,20200113 00:00,3264000,3279600,3259200,3279500,40497334,6.826934457313186e-05\nQQQ,20200113 00:00,2193300,2209800,2189800,2209500,20226442,6.826934457313186e-05\nSPY,20200114 00:00,3274800,3286200,3268500,3274500,55569570,6.803535929302015e-05\nQQQ,20200114 00:00,2208400,2212100,2197400,2200800,22066006,6.803535929302015e-05\nSPY,20200115 00:00,3273400,3290200,3272600,3281900,59764758,6.726837835994683e-05\nQQQ,20200115 00:00,2202100,2212000,2194500,2201700,22702156,6.726837835994683e-05\nSPY,20200116 00:00,3296700,3309200,3294500,3309200,44147974,6.752049890161009e-05\nQQQ,20200116 00:00,2212700,2223200,2208000,2222800,16403665,6.752049890161009e-05\nSPY,20200117 00:00,3317200,3321800,3310700,3319500,74196426,6.737776214627002e-05\nQQQ,20200117 00:00,2232800,2235600,2221200,2233800,19745031,6.737776214627002e-05\nSPY,20200121 00:00,3309200,3321800,3308200,3313000,64018769,6.697103445335832e-05\nQQQ,20200121 00:00,2227600,2238400,2226600,2232800,18901138,6.697103445335832e-05\nSPY,20200122 00:00,3322600,3329500,3311700,3313400,43894937,6.574126334770172e-05\nQQQ,20200122 00:00,2244100,2251500,2235900,2238700,18307031,6.574126334770172e-05\nSPY,20200123 00:00,3306000,3319200,3294100,3317200,42424449,6.57429545724745e-05\nQQQ,20200123 00:00,2237400,2246900,2227100,2245900,24446740,6.57429545724745e-05\nSPY,20200124 00:00,3324600,3325300,3273600,3287700,76182796,6.613136703035418e-05\nQQQ,20200124 00:00,2256400,2258800,2216700,2227000,33897189,6.613136703035418e-05\nSPY,20200127 00:00,3230500,3251200,3226800,3235000,70764386,6.727749627185996e-05\nQQQ,20200127 00:00,2176700,2192800,2171900,2181000,36374142,6.727749627185996e-05\nSPY,20200128 00:00,3250600,3278500,3245500,3268900,56570669,6.736475731400618e-05\nQQQ,20200128 00:00,2196400,2219600,2190308,2214500,23235600,6.736475731400618e-05\nSPY,20200129 00:00,3284000,3286200,3264000,3266200,44285050,6.726810085622427e-05\nQQQ,20200129 00:00,2226800,2229200,2208200,2218100,25046216,6.726810085622427e-05\nSPY,20200130 00:00,3243700,3279000,3235400,3276800,69267283,6.584764109454825e-05\nQQQ,20200130 00:00,2203800,2227000,2196700,2226000,34714336,6.584764109454825e-05\nSPY,20200131 00:00,3269700,3271700,3207400,3217300,97365490,6.669078250753778e-05\nQQQ,20200131 00:00,2235300,2235600,2182850,2190700,45539329,6.669078250753778e-05\nSPY,20200203 00:00,3233500,3261500,3232200,3241200,60751881,6.705780201460615e-05\nQQQ,20200203 00:00,2201100,2228900,2199900,2223800,21835864,6.705780201460615e-05\nSPY,20200204 00:00,3280700,3300100,3277350,3290600,54266275,6.802844106837097e-05\nQQQ,20200204 00:00,2254200,2278600,2246600,2274700,27788619,6.802844106837097e-05\nSPY,20200205 00:00,3322900,3330800,3306800,3328600,53887796,6.801482144271553e-05\nQQQ,20200205 00:00,2302100,2302500,2268500,2282200,34146249,6.801482144271553e-05\nSPY,20200206 00:00,3339800,3341900,3328050,3339800,43537036,6.805411994476562e-05\nQQQ,20200206 00:00,2287900,2302500,2279800,2301900,20098819,6.805411994476562e-05\nSPY,20200207 00:00,3328100,3336200,3316000,3322000,54243541,6.758378041376163e-05\nQQQ,20200207 00:00,2291600,2304350,2285400,2292000,22874659,6.758378041376163e-05\nSPY,20200210 00:00,3311900,3347200,3311900,3346800,35723822,6.786674705543743e-05\nQQQ,20200210 00:00,2284400,2319800,2283900,2319700,19851151,6.786674705543743e-05\nSPY,20200211 00:00,3361600,3370200,3347500,3352600,49571204,6.785993986266076e-05\nQQQ,20200211 00:00,2332500,2340200,2314000,2320100,28704498,6.785993986266076e-05\nSPY,20200212 00:00,3368600,3376500,3364300,3374200,35993342,6.74032903444809e-05\nQQQ,20200212 00:00,2333800,2344000,2328000,2342700,21491343,6.74032903444809e-05\nSPY,20200213 00:00,3359200,3381200,3355700,3370600,47811785,6.742856647934044e-05\nQQQ,20200213 00:00,2326400,2349300,2323600,2339700,20488613,6.742856647934044e-05\nSPY,20200214 00:00,3374800,3377200,3362000,3376000,51819302,6.743251062411965e-05\nQQQ,20200214 00:00,2343400,2348600,2335500,2346400,20643026,6.743251062411965e-05\nSPY,20200218 00:00,3365200,3371700,3352100,3367300,49435726,6.732776601922048e-05\nQQQ,20200218 00:00,2335000,2351700,2332400,2347300,21181754,6.732776601922048e-05\nSPY,20200219 00:00,3378100,3390650,3374800,3383400,36863549,6.74565933194857e-05\nQQQ,20200219 00:00,2361300,2376000,2358500,2369800,19213715,6.74565933194857e-05\nSPY,20200220 00:00,3377700,3386350,3336900,3369500,68702515,6.767046348372648e-05\nQQQ,20200220 00:00,2364800,2369400,2318700,2347800,39564186,6.767046348372648e-05\nSPY,20200221 00:00,3354100,3358100,3325800,3334800,94782814,6.848808970812217e-05\nQQQ,20200221 00:00,2336100,2340100,2293300,2302700,60202540,6.848808970812217e-05\nSPY,20200224 00:00,3231700,3258400,3212400,3224200,137060852,7.370157844457386e-05\nQQQ,20200224 00:00,2216800,2242500,2202600,2213900,74650743,7.370157844457386e-05\nSPY,20200225 00:00,3239600,3246100,3116900,3126500,197728104,7.7153308403584e-05\nQQQ,20200225 00:00,2232500,2239800,2147400,2153700,90742316,7.7153308403584e-05\nSPY,20200226 00:00,3141900,3181100,3107000,3115000,173407681,7.70838353263895e-05\nQQQ,20200226 00:00,2167100,2202900,2149000,2164800,72045289,7.70838353263895e-05\nSPY,20200227 00:00,3054500,3096400,2975100,2975100,253785330,8.626345536255254e-05\nQQQ,20200227 00:00,2109000,2143700,2055000,2056400,108461905,8.626345536255254e-05\nSPY,20200228 00:00,2886200,2962600,2855400,2962600,346777226,8.623669478028707e-05\nQQQ,20200228 00:00,1986400,2071700,1981600,2058000,137166353,8.623669478028707e-05\nSPY,20200302 00:00,2980000,3091500,2944600,3090900,207524129,9.478236148345919e-05\nQQQ,20200302 00:00,2087600,2165700,2059400,2164200,97482567,9.478236148345919e-05\nSPY,20200303 00:00,3095500,3138000,2975700,3002400,276438674,9.857644349141934e-05\nQQQ,20200303 00:00,2170300,2196100,2076200,2094800,121621623,9.857644349141934e-05\nSPY,20200304 00:00,3061100,3131000,3033300,3128600,150015051,0.00010534909924099831\nQQQ,20200304 00:00,2133500,2183300,2113700,2182200,64764691,0.00010534909924099831\nSPY,20200305 00:00,3049500,3084700,3000200,3024600,162185198,0.0001093778034002461\nQQQ,20200305 00:00,2125300,2163600,2101000,2115900,72037789,0.0001093778034002461\nSPY,20200306 00:00,2930800,2987800,2902400,2974600,201271746,0.00011011441945490124\nQQQ,20200306 00:00,2045500,2091500,2029100,2080200,79862351,0.00011011441945490124\nSPY,20200309 00:00,2756000,2841400,2734600,2742300,280056192,0.00013198442247380163\nQQQ,20200309 00:00,1930000,2011600,1921100,1935700,110141061,0.00013198442247380163\nSPY,20200310 00:00,2847600,2885200,2735000,2884200,248563890,0.0001418963687446561\nQQQ,20200310 00:00,2011800,2043000,1936900,2041100,90119540,0.0001418963687446561\nSPY,20200311 00:00,2807300,2819100,2708900,2743600,232891616,0.00015041899203914694\nQQQ,20200311 00:00,1993000,2007500,1927300,1952200,83550670,0.00015041899203914694\nSPY,20200312 00:00,2560500,2666400,2477200,2481100,347822422,0.00018521688449910206\nQQQ,20200312 00:00,1820900,1907800,1769400,1773200,126249753,0.00018521688449910206\nSPY,20200313 00:00,2633400,2710600,2495800,2693200,287485966,0.00021404631838015095\nQQQ,20200313 00:00,1870700,1944800,1781300,1923400,125012600,0.00021404631838015095\nSPY,20200316 00:00,2407800,2569000,2373700,2398500,266357640,0.0002661888627452993\nQQQ,20200316 00:00,1741500,1847000,1691600,1693000,84060751,0.0002661888627452993\nSPY,20200317 00:00,2450400,2559900,2370800,2528000,235335708,0.00028259737011787324\nQQQ,20200317 00:00,1753400,1843900,1697800,1821400,115793406,0.00028259737011787324\nSPY,20200318 00:00,2362500,2460300,2280800,2400000,300967068,0.0002887107775247364\nQQQ,20200318 00:00,1715000,1792200,1668000,1766000,103468629,0.0002887107775247364\nSPY,20200319 00:00,2392600,2473800,2322500,2405100,263646203,0.0002888108716389842\nQQQ,20200319 00:00,1754300,1834900,1716200,1776600,114691905,0.0002888108716389842\nSPY,20200320 00:00,2425900,2444600,2286200,2288000,304651791,0.0002955765118644264\nQQQ,20200320 00:00,1818900,1828700,1701000,1707000,104841464,0.0002955765118644264\nSPY,20200323 00:00,2280000,2293900,2182700,2229500,281816983,0.00029409429822903756\nQQQ,20200323 00:00,1707000,1742100,1649200,1704600,114873208,0.00029409429822903756\nSPY,20200324 00:00,2349900,2441000,2338000,2431500,214693586,0.0003221703122870761\nQQQ,20200324 00:00,1798800,1838300,1779500,1836600,86434644,0.0003221703122870761\nSPY,20200325 00:00,2450000,2563500,2397600,2467900,278538590,0.00032156440752775616\nQQQ,20200325 00:00,1844900,1895100,1799800,1823000,82965783,0.00032156440752775616\nSPY,20200326 00:00,2492600,2628000,2490500,2612000,224153673,0.00033364263322943654\nQQQ,20200326 00:00,1839300,1927200,1835600,1919000,74995622,0.00033364263322943654\nSPY,20200327 00:00,2532200,2608000,2510500,2534200,193638954,0.00033771897057197325\nQQQ,20200327 00:00,1869000,1905100,1846600,1853000,54182139,0.00033771897057197325\nSPY,20200330 00:00,2556800,2623900,2535300,2616500,141153243,0.0003422151863668511\nQQQ,20200330 00:00,1870600,1924900,1863500,1920400,46667707,0.0003422151863668511\nSPY,20200331 00:00,2607000,2633300,2562200,2577500,165876305,0.0003421236769386823\nQQQ,20200331 00:00,1917200,1952500,1892000,1904000,57650860,0.0003421236769386823\nSPY,20200401 00:00,2479500,2514400,2439000,2461500,171513817,0.0003497233123304257\nQQQ,20200401 00:00,1847700,1876600,1808600,1823100,49855126,0.0003497233123304257\nSPY,20200402 00:00,2452000,2526700,2446000,2518300,158102646,0.0003515570319296404\nQQQ,20200402 00:00,1812400,1861800,1809700,1860100,52939936,0.0003515570319296404\nSPY,20200403 00:00,2508100,2533100,2452300,2481900,121365280,0.00035237245553676363\nQQQ,20200403 00:00,1855500,1870600,1812900,1833700,45022619,0.00035237245553676363\nSPY,20200406 00:00,2580500,2669700,2567250,2648600,161181089,0.00037139982540947386\nQQQ,20200406 00:00,1904800,1976500,1891900,1964800,58240710,0.00037139982540947386\nSPY,20200407 00:00,2743000,2750000,2648900,2651300,180252896,0.0003713881730495871\nQQQ,20200407 00:00,2023700,2026600,1960000,1964000,65151399,0.0003713881730495871\nSPY,20200408 00:00,2680500,2760000,2655600,2740300,138883582,0.00037408908365132526\nQQQ,20200408 00:00,1981500,2011750,1963700,2005700,43133208,0.00037408908365132526\nSPY,20200409 00:00,2778100,2812000,2754800,2782000,163674342,0.00037407947678418655\nQQQ,20200409 00:00,2023500,2032200,1990300,2008600,61293607,0.00037407947678418655\nSPY,20200413 00:00,2771500,2774100,2714100,2756600,105066645,0.00037370152614802813\nQQQ,20200413 00:00,2000000,2034200,1987700,2030300,40864552,0.00037370152614802813\nSPY,20200414 00:00,2810800,2847500,2799100,2837900,123049134,0.000378627833093856\nQQQ,20200414 00:00,2072300,2125100,2064100,2118600,59587525,0.000378627833093856\nSPY,20200415 00:00,2775200,2795800,2754600,2777600,109527503,0.00037965962057133577\nQQQ,20200415 00:00,2084200,2112600,2071200,2094300,42199544,0.00037965962057133577\nSPY,20200416 00:00,2790500,2800300,2757600,2791000,111598189,0.0003799877930289359\nQQQ,20200416 00:00,2116900,2143600,2096900,2132500,58633388,0.0003799877930289359\nSPY,20200417 00:00,2854100,2873000,2824000,2866400,129983603,0.00038096110506961905\nQQQ,20200417 00:00,2161700,2165100,2120800,2152900,57826538,0.00038096110506961905\nSPY,20200420 00:00,2826000,2862900,2813600,2815900,89823671,0.0003818458097032143\nQQQ,20200420 00:00,2133600,2158800,2125700,2127400,35519823,0.0003818458097032143\nSPY,20200421 00:00,2764800,2780400,2720400,2730400,115363846,0.00038638042235860075\nQQQ,20200421 00:00,2106000,2111600,2036300,2048900,68622607,0.00038638042235860075\nSPY,20200422 00:00,2783800,2810000,2769100,2791000,82718312,0.0003885194613397847\nQQQ,20200422 00:00,2091000,2123600,2083300,2109700,34148223,0.0003885194613397847\nSPY,20200423 00:00,2804600,2839300,2787510,2790800,97600252,0.0003884868442028401\nQQQ,20200423 00:00,2117900,2144350,2101000,2105200,40773523,0.0003884868442028401\nSPY,20200424 00:00,2806900,2836900,2785000,2829700,73686003,0.0003893331561004171\nQQQ,20200424 00:00,2109700,2143000,2095100,2138400,32035824,0.0003893331561004171\nSPY,20200427 00:00,2850200,2882700,2846200,2870500,68934756,0.0003897494901594477\nQQQ,20200427 00:00,2161900,2166200,2145000,2155600,34846700,0.0003897494901594477\nSPY,20200428 00:00,2910000,2914000,2854050,2857300,97598619,0.00039010658200441524\nQQQ,20200428 00:00,2173200,2173200,2112100,2115000,43643613,0.00039010658200441524\nSPY,20200429 00:00,2915900,2948700,2904100,2932100,104012097,0.0003937257618384481\nQQQ,20200429 00:00,2161900,2199700,2151500,2190000,42337803,0.0003937257618384481\nSPY,20200430 00:00,2916900,2922300,2885900,2904800,104971069,0.0003936482515772715\nQQQ,20200430 00:00,2199500,2200400,2173500,2189100,37675523,0.0003936482515772715\nSPY,20200501 00:00,2851600,2860400,2815300,2827900,112895959,0.00039666885164516864\nQQQ,20200501 00:00,2145000,2166700,2116800,2127400,46164351,0.00039666885164516864\nSPY,20200504 00:00,2804600,2839000,2791600,2835700,70791051,0.0003961957030976832\nQQQ,20200504 00:00,2114600,2154500,2111200,2152200,30929871,0.0003961957030976832\nSPY,20200505 00:00,2866600,2892500,2857500,2861900,72761195,0.00039646861445153075\nQQQ,20200505 00:00,2174400,2201400,2168500,2176600,34640471,0.00039646861445153075\nSPY,20200506 00:00,2880100,2884600,2841500,2842500,65961054,0.00039496138557956506\nQQQ,20200506 00:00,2194000,2210400,2181100,2190000,34176586,0.00039496138557956506\nSPY,20200507 00:00,2877900,2897800,2871500,2876800,69442289,0.00039550817492828657\nQQQ,20200507 00:00,2218200,2227300,2204200,2218200,35261962,0.00039550817492828657\nSPY,20200508 00:00,2910500,2928500,2898700,2924400,62554633,0.0003962539080435661\nQQQ,20200508 00:00,2236200,2250000,2224800,2248600,29133599,0.0003962539080435661\nSPY,20200511 00:00,2903700,2940000,2898800,2925000,62733856,0.00039624744771933515\nQQQ,20200511 00:00,2234900,2279210,2232500,2268700,33314351,0.00039624744771933515\nSPY,20200512 00:00,2937500,2942200,2865500,2866700,82244098,0.0003943990208156419\nQQQ,20200512 00:00,2274900,2281000,2220900,2221200,38662692,0.0003943990208156419\nSPY,20200513 00:00,2859500,2871900,2789650,2816000,126198350,0.00039501669031123356\nQQQ,20200513 00:00,2226600,2246100,2167100,2193400,61854906,0.00039501669031123356\nSPY,20200514 00:00,2788400,2851000,2763800,2849700,110802691,0.000395206512428743\nQQQ,20200514 00:00,2179700,2218700,2159850,2218300,51132763,0.000395206512428743\nSPY,20200515 00:00,2823200,2863300,2813400,2862800,91973272,0.0003949752664045967\nQQQ,20200515 00:00,2187800,2233300,2183400,2232700,50176605,0.0003949752664045967\nSPY,20200518 00:00,2930900,2966750,2927000,2950000,101361961,0.00039679419636387493\nQQQ,20200518 00:00,2263300,2286800,2254700,2274300,39429845,0.00039679419636387493\nSPY,20200519 00:00,2944100,2962050,2919700,2919700,79323689,0.00039644988767340966\nQQQ,20200519 00:00,2277000,2298300,2267100,2268600,33780445,0.00039644988767340966\nSPY,20200520 00:00,2958300,2978700,2955800,2969300,68822340,0.00039737711078773936\nQQQ,20200520 00:00,2295000,2317600,2294800,2313900,35071301,0.00039737711078773936\nSPY,20200521 00:00,2968000,2976700,2936900,2948800,70251827,0.00039764844190826374\nQQQ,20200521 00:00,2314400,2321300,2283500,2288700,39518143,0.00039764844190826374\nSPY,20200522 00:00,2945600,2956300,2932300,2954400,54086999,0.0003968365552602744\nQQQ,20200522 00:00,2284500,2298700,2275000,2296600,26279140,0.0003968365552602744\nSPY,20200526 00:00,3019600,3021900,2987000,2990800,80856468,0.0003966634679106832\nQQQ,20200526 00:00,2333600,2335800,2287800,2290400,30865055,0.0003966634679106832\nSPY,20200527 00:00,3021400,3035700,2968700,3035300,92634618,0.00039671190401529427\nQQQ,20200527 00:00,2286900,2304100,2239400,2302900,50433111,0.00039671190401529427\nSPY,20200528 00:00,3046900,3068300,3022600,3029700,80738978,0.0003964625039038544\nQQQ,20200528 00:00,2291100,2334650,2290200,2299900,38161883,0.0003964625039038544\nSPY,20200529 00:00,3024600,3049600,2994700,3043200,102897180,0.0003966453980081049\nQQQ,20200529 00:00,2303800,2335900,2287600,2333600,48067862,0.0003966453980081049\nSPY,20200601 00:00,3036300,3062050,3030600,3055500,47464891,0.00039569890681285104\nQQQ,20200601 00:00,2324600,2344500,2320000,2340600,24017870,0.00039569890681285104\nSPY,20200602 00:00,3065200,3081300,3051000,3080800,67599676,0.0003955617585720231\nQQQ,20200602 00:00,2345000,2356900,2320100,2356300,31388131,0.0003955617585720231\nSPY,20200603 00:00,3102600,3132100,3099400,3121800,79682933,0.00039347456710643077\nQQQ,20200603 00:00,2362600,2374800,2353500,2366900,35745723,0.00039347456710643077\nSPY,20200604 00:00,3111200,3130000,3090800,3113600,68818172,0.00039338835333011093\nQQQ,20200604 00:00,2363300,2377850,2336800,2350300,36792651,0.00039338835333011093\nSPY,20200605 00:00,3174100,3212750,3171700,3193400,123509914,0.0003950728028139235\nQQQ,20200605 00:00,2362200,2402900,2356200,2396900,42990497,0.0003950728028139235\nSPY,20200608 00:00,3203000,3234100,3196300,3232000,65325209,0.0003946955251678209\nQQQ,20200608 00:00,2395400,2416800,2379100,2415500,29106011,0.0003946955251678209\nSPY,20200609 00:00,3202600,3223650,3193600,3207900,68019755,0.00039434310789789354\nQQQ,20200609 00:00,2406600,2441800,2404700,2433000,32807637,0.00039434310789789354\nSPY,20200610 00:00,3214000,3223900,3182300,3190000,84532800,0.00039408084026342237\nQQQ,20200610 00:00,2450500,2478100,2445100,2462200,52872597,0.00039408084026342237\nSPY,20200611 00:00,3113100,3121400,3000100,3006100,183916982,0.0004057929926315951\nQQQ,20200611 00:00,2421600,2435900,2339600,2340200,68123873,0.0004057929926315951\nSPY,20200612 00:00,3083200,3090800,2986000,3042100,170715746,0.0004060338333703425\nQQQ,20200612 00:00,2391400,2404000,2317400,2358800,66941083,0.0004060338333703425\nSPY,20200615 00:00,2980100,3082800,2967400,3070500,125276263,0.00040638793352795163\nQQQ,20200615 00:00,2323500,2394500,2314700,2387500,42852259,0.00040638793352795163\nSPY,20200616 00:00,3155600,3156400,3076800,3129600,122098812,0.0004075763272476076\nQQQ,20200616 00:00,2436900,2444500,2391000,2428500,45787110,0.0004075763272476076\nSPY,20200617 00:00,3140400,3143890,3108600,3116600,74761010,0.0004070157587143496\nQQQ,20200617 00:00,2444000,2454950,2427300,2436200,33182954,0.0004070157587143496\nSPY,20200618 00:00,3099800,3123000,3095200,3117800,65220566,0.00040699758440853836\nQQQ,20200618 00:00,2433200,2445400,2424800,2442800,25822891,0.00040699758440853836\nSPY,20200619 00:00,3141000,3143800,3065300,3086400,114303869,0.00040676410093215293\nQQQ,20200619 00:00,2467300,2470000,2424600,2442400,43799625,0.00040676410093215293\nSPY,20200622 00:00,3079500,3110500,3067500,3106200,64819717,0.00040690597133566077\nQQQ,20200622 00:00,2436800,2468800,2433800,2467400,22203280,0.00040690597133566077\nSPY,20200623 00:00,3135000,3145000,3116200,3120500,60336017,0.00040700244315569254\nQQQ,20200623 00:00,2483900,2511500,2478200,2488400,29980789,0.00040700244315569254\nSPY,20200624 00:00,3098400,3105000,3021100,3040900,116094751,0.0004085151088521896\nQQQ,20200624 00:00,2480600,2493200,2421600,2437100,44109927,0.0004085151088521896\nSPY,20200625 00:00,3034700,3076400,3012800,3073500,81346026,0.0004088704521792565\nQQQ,20200625 00:00,2438000,2463400,2411400,2460300,34114959,0.0004088704521792565\nSPY,20200626 00:00,3061700,3063800,2994200,3000500,110191083,0.0004112317011260987\nQQQ,20200626 00:00,2457800,2459600,2396800,2402200,50293064,0.0004112317011260987\nSPY,20200629 00:00,3014200,3044600,2989300,3044600,68919256,0.00041178343487401216\nQQQ,20200629 00:00,2399700,2428400,2373500,2428400,31576290,0.00041178343487401216\nSPY,20200630 00:00,3040100,3102000,3038300,3083600,87954973,0.0004122676897364737\nQQQ,20200630 00:00,2427700,2481700,2425800,2476000,35413828,0.0004122676897364737\nSPY,20200701 00:00,3095700,3118900,3090700,3105200,62334610,0.0004125175699638939\nQQQ,20200701 00:00,2476400,2515200,2470800,2504900,31503867,0.0004125175699638939\nSPY,20200702 00:00,3142400,3157000,3115100,3122300,59836713,0.0004124409317829577\nQQQ,20200702 00:00,2530200,2542700,2517100,2521900,29232232,0.0004124409317829577\nSPY,20200706 00:00,3163800,3176800,3155600,3170500,52435296,0.0004138089457827006\nQQQ,20200706 00:00,2554500,2589200,2554200,2583900,31904132,0.0004138089457827006\nSPY,20200707 00:00,3153800,3175200,3133700,3137800,72195898,0.0004139654880812946\nQQQ,20200707 00:00,2581300,2608900,2563000,2566100,34564264,0.0004139654880812946\nSPY,20200708 00:00,3145900,3163000,3127000,3161800,49246242,0.00041429085110241467\nQQQ,20200708 00:00,2579800,2600200,2564900,2599900,27663321,0.00041429085110241467\nSPY,20200709 00:00,3168500,3171000,3106800,3143800,75016501,0.00041397322100341125\nQQQ,20200709 00:00,2619700,2628800,2576300,2621800,39040687,0.00041397322100341125\nSPY,20200710 00:00,3142600,3178700,3127610,3175900,50767516,0.00041419892323422703\nQQQ,20200710 00:00,2620300,2642300,2592600,2639700,29877101,0.00041419892323422703\nSPY,20200713 00:00,3200600,3227100,3141400,3148400,88782287,0.00041492455856863915\nQQQ,20200713 00:00,2669100,2697900,2576900,2585400,58228063,0.00041492455856863915\nSPY,20200714 00:00,3132500,3197600,3120000,3189200,80603945,0.00041520988884864783\nQQQ,20200714 00:00,2559300,2607900,2527600,2603700,66487195,0.00041520988884864783\nSPY,20200715 00:00,3224800,3230350,3192700,3218500,76618906,0.00041512935266106244\nQQQ,20200715 00:00,2618300,2626900,2574900,2609000,50547825,0.00041512935266106244\nSPY,20200716 00:00,3197800,3212800,3190900,3207900,48326537,0.0004150754580169431\nQQQ,20200716 00:00,2580200,2597800,2556300,2591200,41572814,0.0004150754580169431\nSPY,20200717 00:00,3218200,3225600,3197400,3217200,54472899,0.00041507638021494287\nQQQ,20200717 00:00,2595900,2603100,2571700,2594200,32678634,0.00041507638021494287\nSPY,20200720 00:00,3214100,3251300,3206200,3243200,49745039,0.0004156713623680088\nQQQ,20200720 00:00,2600800,2674300,2587900,2667800,35279436,0.0004156713623680088\nSPY,20200721 00:00,3264800,3269200,3239400,3250100,49755103,0.00041554820187758286\nQQQ,20200721 00:00,2684000,2684200,2631300,2640000,40920166,0.00041554820187758286\nSPY,20200722 00:00,3246200,3272000,3245000,3268600,46779160,0.0004154569111329167\nQQQ,20200722 00:00,2645100,2658900,2625400,2649300,26731843,0.0004154569111329167\nSPY,20200723 00:00,3264500,3272300,3214900,3229600,69166002,0.00041672866815872274\nQQQ,20200723 00:00,2645100,2652400,2565500,2580100,47424354,0.00041672866815872274\nSPY,20200724 00:00,3209300,3219900,3192500,3208800,60592047,0.000416800759065538\nQQQ,20200724 00:00,2540400,2569300,2513200,2555600,50106555,0.000416800759065538\nSPY,20200727 00:00,3216300,3234100,3207800,3232200,43728174,0.000417026658036634\nQQQ,20200727 00:00,2572600,2607500,2564500,2601200,33649763,0.000417026658036634\nSPY,20200728 00:00,3224500,3236400,3208500,3211700,50744355,0.0004173651121918718\nQQQ,20200728 00:00,2593100,2598400,2565100,2568100,28263635,0.0004173651121918718\nSPY,20200729 00:00,3221400,3257300,3220800,3251200,44530648,0.00041777663005916583\nQQQ,20200729 00:00,2584000,2606600,2579100,2597700,25325691,0.00041777663005916583\nSPY,20200730 00:00,3219000,3244050,3196400,3239600,54373583,0.0004170165281885289\nQQQ,20200730 00:00,2577400,2617100,2565500,2611300,35294253,0.0004170165281885289\nSPY,20200731 00:00,3260000,3266100,3213400,3265200,67655356,0.00041725264848154\nQQQ,20200731 00:00,2659100,2659500,2608500,2657900,48399485,0.00041725264848154\nSPY,20200803 00:00,3283100,3296200,3277300,3287900,46717604,0.0004170191406939792\nQQQ,20200803 00:00,2680000,2701500,2678700,2693800,27416106,0.0004170191406939792\nSPY,20200804 00:00,3278800,3300600,3278600,3300600,38139316,0.00041249100522312013\nQQQ,20200804 00:00,2688600,2704500,2680910,2703800,22999848,0.00041249100522312013\nSPY,20200805 00:00,3314600,3323900,3311900,3321100,37235538,0.0004118627791650089\nQQQ,20200805 00:00,2708800,2715200,2694166,2710500,20136543,0.0004118627791650089\nSPY,20200806 00:00,3315200,3344600,3311400,3343300,39913430,0.0004121297666631793\nQQQ,20200806 00:00,2707800,2749800,2702000,2745850,24776741,0.0004121297666631793\nSPY,20200807 00:00,3332900,3348800,3323000,3345700,50273179,0.00041062843208676287\nQQQ,20200807 00:00,2740800,2748800,2692400,2714700,42197977,0.00041062843208676287\nSPY,20200810 00:00,3350000,3357700,3329600,3355700,39093250,0.0004102403157552009\nQQQ,20200810 00:00,2717400,2719800,2666700,2702800,32696601,0.0004102403157552009\nSPY,20200811 00:00,3368600,3375400,3320100,3328000,60840577,0.0004103050397273389\nQQQ,20200811 00:00,2691100,2705333,2646300,2651900,39253943,0.0004103050397273389\nSPY,20200812 00:00,3354700,3382800,3354300,3374400,47937318,0.00041035349361664964\nQQQ,20200812 00:00,2674200,2728400,2673700,2718600,35525096,0.00041035349361664964\nSPY,20200813 00:00,3365800,3382500,3358300,3368300,37594791,0.0004065171793676337\nQQQ,20200813 00:00,2726600,2748300,2715100,2724800,29986886,0.0004065171793676337\nSPY,20200814 00:00,3364300,3374100,3356700,3368400,42748803,0.00040654801792803136\nQQQ,20200814 00:00,2731200,2733900,2707000,2721600,28896708,0.00040654801792803136\nSPY,20200817 00:00,3379100,3383400,3374900,3379100,29645911,0.0004058494684236067\nQQQ,20200817 00:00,2739300,2758400,2737400,2753200,22159381,0.0004058494684236067\nSPY,20200818 00:00,3383200,3391000,3366200,3386400,34414214,0.00040525918448918184\nQQQ,20200818 00:00,2764200,2784650,2749000,2779700,21794437,0.00040525918448918184\nSPY,20200819 00:00,3391100,3396100,3366300,3372300,58910587,0.00040510637862936833\nQQQ,20200819 00:00,2779300,2790200,2755700,2761000,29395264,0.00040510637862936833\nSPY,20200820 00:00,3353300,3387950,3352200,3382800,37450891,0.00040501039584559705\nQQQ,20200820 00:00,2752800,2804300,2748600,2799300,25435198,0.00040501039584559705\nSPY,20200821 00:00,3378600,3397100,3375500,3394800,43998909,0.0004050444419051096\nQQQ,20200821 00:00,2801300,2823400,2794700,2818700,29363161,0.0004050444419051096\nSPY,20200824 00:00,3421300,3430000,3410600,3429200,40778173,0.0004016545203558403\nQQQ,20200824 00:00,2852500,2860000,2812700,2836300,34403998,0.0004016545203558403\nSPY,20200825 00:00,3435300,3442100,3422700,3441200,33649645,0.0004011846332519423\nQQQ,20200825 00:00,2828300,2860600,2823600,2858600,33333982,0.0004011846332519423\nSPY,20200826 00:00,3447200,3478600,3441700,3475700,44752689,0.0004018050680170377\nQQQ,20200826 00:00,2871500,2922500,2869700,2919600,39113373,0.0004018050680170377\nSPY,20200827 00:00,3485000,3499000,3465400,3483300,53042146,0.0004017423764196768\nQQQ,20200827 00:00,2929700,2938500,2887000,2910500,45601932,0.0004017423764196768\nSPY,20200828 00:00,3494500,3507100,3481600,3505800,45300252,0.0004011834839683621\nQQQ,20200828 00:00,2923300,2931800,2909300,2925300,26005692,0.0004011834839683621\nSPY,20200831 00:00,3503500,3512900,3491000,3493100,53787099,0.00040105039344814366\nQQQ,20200831 00:00,2930700,2967450,2926200,2948800,31727310,0.00040105039344814366\nSPY,20200901 00:00,3502400,3526900,3492400,3526000,48071811,0.0004012390156161797\nQQQ,20200901 00:00,2976200,3000400,2957900,2999200,31517742,0.0004012390156161797\nSPY,20200902 00:00,3546400,3587000,3534300,3577000,65239809,0.0004011250578088919\nQQQ,20200902 00:00,3032800,3035100,2968900,3027600,47661474,0.0004011250578088919\nSPY,20200903 00:00,3558500,3563800,3426100,3453900,132142532,0.00040775382313244936\nQQQ,20200903 00:00,2981000,2986200,2817000,2874100,95099057,0.00040775382313244936\nSPY,20200904 00:00,3460700,3478090,3348800,3425700,121071294,0.0004082929587409414\nQQQ,20200904 00:00,2855600,2889300,2718000,2835800,114075652,0.0004082929587409414\nSPY,20200908 00:00,3367400,3380500,3328800,3332100,102804803,0.00041384605377378175\nQQQ,20200908 00:00,2722200,2782200,2696600,2699500,87866075,0.00041384605377378175\nSPY,20200909 00:00,3375200,3424600,3366200,3397900,81687944,0.00041593328269210535\nQQQ,20200909 00:00,2756400,2800500,2730000,2778800,58062975,0.00041593328269210535\nSPY,20200910 00:00,3417500,3425200,3328600,3338900,83084631,0.0004172888657584771\nQQQ,20200910 00:00,2809400,2821990,2705500,2723400,65086110,0.0004172888657584771\nSPY,20200911 00:00,3357900,3369700,3310000,3340600,73834123,0.0004172638931151976\nQQQ,20200911 00:00,2741500,2752200,2669000,2704500,68822924,0.0004172638931151976\nSPY,20200914 00:00,3375200,3403700,3369300,3384600,57267531,0.0004180253842403538\nQQQ,20200914 00:00,2743600,2772200,2729600,2751600,35382634,0.0004180253842403538\nSPY,20200915 00:00,3411100,3420200,3390200,3401700,47255792,0.0004181495180798708\nQQQ,20200915 00:00,2790300,2806238,2772600,2790600,39339954,0.0004181495180798708\nSPY,20200916 00:00,3415000,3430600,3385300,3388200,72445309,0.00041845439091566325\nQQQ,20200916 00:00,2798800,2803600,2742500,2746100,38840730,0.00041845439091566325\nSPY,20200917 00:00,3335200,3376900,3330000,3358400,82845183,0.0004191033711816387\nQQQ,20200917 00:00,2675500,2723700,2666800,2703200,72649343,0.0004191033711816387\nSPY,20200918 00:00,3353500,3354900,3279700,3306500,90698721,0.00042002012257640146\nQQQ,20200918 00:00,2717900,2720900,2626300,2668700,77618636,0.00042002012257640146\nSPY,20200921 00:00,3257100,3270900,3217300,3269700,88383996,0.0004195030249526257\nQQQ,20200921 00:00,2624700,2676500,2600000,2675100,52105625,0.0004195030249526257\nSPY,20200922 00:00,3285500,3309000,3258700,3303000,58131952,0.0004201402810057315\nQQQ,20200922 00:00,2699900,2730700,2665300,2724800,37039928,0.0004201402810057315\nSPY,20200923 00:00,3309200,3312000,3221000,3226400,82043108,0.0004226858542321667\nQQQ,20200923 00:00,2721000,2723400,2632600,2641600,43870199,0.0004226858542321667\nSPY,20200924 00:00,3212200,3267900,3198000,3235000,71764361,0.00042250560215251827\nQQQ,20200924 00:00,2613900,2687000,2612200,2653900,62809100,0.00042250560215251827\nSPY,20200925 00:00,3225700,3295700,3216400,3287300,60520195,0.0004237927237773723\nQQQ,20200925 00:00,2659100,2724000,2642900,2715600,46868512,0.0004237927237773723\nSPY,20200928 00:00,3332200,3349600,3321600,3341900,58415562,0.00042466138068066424\nQQQ,20200928 00:00,2765800,2772000,2738500,2772000,52051448,0.00042466138068066424\nSPY,20200929 00:00,3340000,3347700,3316300,3323700,44028300,0.00042469282015526223\nQQQ,20200929 00:00,2766200,2777200,2753700,2759500,24168938,0.00042469282015526223\nSPY,20200930 00:00,3331000,3382900,3328800,3348900,84868616,0.0004243335406715123\nQQQ,20200930 00:00,2761500,2810900,2758800,2778400,45658941,0.0004243335406715123\nSPY,20201001 00:00,3376300,3387100,3350100,3370400,80342903,0.0004232460165662476\nQQQ,20201001 00:00,2818700,2828700,2798410,2822500,46988396,0.0004232460165662476\nSPY,20201002 00:00,3317100,3359150,3311900,3338400,77980566,0.00042420783815591426\nQQQ,20201002 00:00,2760200,2797800,2734400,2743100,69374529,0.00042420783815591426\nSPY,20201005 00:00,3360100,3399500,3360100,3397600,41167062,0.00042487021934979466\nQQQ,20201005 00:00,2763400,2804900,2762300,2801600,24986321,0.00042487021934979466\nSPY,20201006 00:00,3398700,3421700,3343800,3349300,82966706,0.00042594436344834297\nQQQ,20201006 00:00,2794500,2811900,2742400,2751600,45169764,0.00042594436344834297\nSPY,20201007 00:00,3381200,3416300,3380900,3407600,44075564,0.00042587570139281675\nQQQ,20201007 00:00,2778900,2807300,2772900,2799200,25117578,0.00042587570139281675\nSPY,20201008 00:00,3428800,3438500,3418700,3437800,38281729,0.00042571451141270336\nQQQ,20201008 00:00,2824000,2824700,2803100,2814100,22441634,0.00042571451141270336\nSPY,20201009 00:00,3455300,3473500,3448900,3468500,50708118,0.00042600695109231524\nQQQ,20201009 00:00,2831100,2857900,2827100,2857100,27008102,0.00042600695109231524\nSPY,20201012 00:00,3495500,3540200,3490600,3524300,64619979,0.0004273457636130348\nQQQ,20201012 00:00,2905500,2974600,2894700,2945300,73412806,0.0004273457636130348\nSPY,20201013 00:00,3523100,3523800,3491000,3501300,65629877,0.00042738813997009867\nQQQ,20201013 00:00,2963900,2970400,2931100,2945200,52472495,0.00042738813997009867\nSPY,20201014 00:00,3507300,3519300,3471500,3479300,50761914,0.0004272906660782325\nQQQ,20201014 00:00,2953600,2963500,2902600,2920600,34763392,0.0004272906660782325\nSPY,20201015 00:00,3437200,3480200,3431300,3475000,54266254,0.00042731891407383853\nQQQ,20201015 00:00,2872000,2907100,2865300,2901000,39059672,0.00042731891407383853\nSPY,20201016 00:00,3489900,3507500,3471100,3472900,64891517,0.0004273534755000211\nQQQ,20201016 00:00,2917400,2932690,2881500,2885100,35321283,0.0004273534755000211\nSPY,20201019 00:00,3485700,3493200,3410600,3420100,59117764,0.0004282738903751047\nQQQ,20201019 00:00,2905600,2914800,2827800,2838000,33555662,0.0004282738903751047\nSPY,20201020 00:00,3434200,3468800,3426500,3433800,52953855,0.0004281086932582199\nQQQ,20201020 00:00,2846200,2876200,2829400,2844100,28804080,0.0004281086932582199\nSPY,20201021 00:00,3433600,3456700,3424100,3427300,55820362,0.00042797946476526283\nQQQ,20201021 00:00,2845500,2873200,2836900,2841900,25921078,0.00042797946476526283\nSPY,20201022 00:00,3429200,3452400,3406500,3446100,48736995,0.000427943878852017\nQQQ,20201022 00:00,2850500,2859800,2808200,2841800,29136166,0.000427943878852017\nSPY,20201023 00:00,3459100,3459900,3431500,3457800,40954601,0.00042791859816126613\nQQQ,20201023 00:00,2847700,2849100,2817850,2847400,21783950,0.00042791859816126613\nSPY,20201026 00:00,3421400,3429800,3356300,3393900,83377228,0.00042911366470152457\nQQQ,20201026 00:00,2823800,2853000,2767600,2804700,36416689,0.00042911366470152457\nSPY,20201027 00:00,3397400,3401150,3379900,3382200,52891143,0.0004288506679218618\nQQQ,20201027 00:00,2815000,2835000,2802000,2826600,27735748,0.0004288506679218618\nSPY,20201028 00:00,3321100,3328400,3261300,3266600,113415793,0.0004344389448995092\nQQQ,20201028 00:00,2780100,2786600,2713800,2716400,47247688,0.0004344389448995092\nSPY,20201029 00:00,3269900,3333900,3251000,3299800,78860838,0.0004350169132219379\nQQQ,20201029 00:00,2730000,2794900,2725200,2763900,34705839,0.0004350169132219379\nSPY,20201030 00:00,3282800,3296800,3226000,3265400,99522697,0.0004361770393488359\nQQQ,20201030 00:00,2743350,2752400,2670700,2693800,58415861,0.0004361770393488359\nSPY,20201102 00:00,3302000,3323500,3272400,3302000,73909088,0.0004359439887574777\nQQQ,20201102 00:00,2718500,2735200,2669700,2699800,36913723,0.0004359439887574777\nSPY,20201103 00:00,3337200,3382500,3331700,3360300,80997071,0.0004369570296551615\nQQQ,20201103 00:00,2719600,2768200,2708400,2746500,38634028,0.0004369570296551615\nSPY,20201104 00:00,3408000,3479200,3396000,3435400,113182021,0.0004406763575152001\nQQQ,20201104 00:00,2835900,2887700,2818600,2869100,62887187,0.0004406763575152001\nSPY,20201105 00:00,3492800,3521900,3488750,3502400,73813299,0.00044249129944951064\nQQQ,20201105 00:00,2935300,2953900,2920000,2943900,46908237,0.00044249129944951064\nSPY,20201106 00:00,3499700,3515000,3476500,3501600,60701935,0.0004424779138937773\nQQQ,20201106 00:00,2937100,2953600,2898300,2946100,34229573,0.0004424779138937773\nSPY,20201109 00:00,3643600,3643700,3540600,3545600,145206783,0.0004414189938052859\nQQQ,20201109 00:00,2976500,2991400,2881200,2885900,69321520,0.0004414189938052859\nSPY,20201110 00:00,3535200,3551800,3505900,3540400,73250171,0.0004415614146959389\nQQQ,20201110 00:00,2851700,2866600,2806200,2834200,62574523,0.0004415614146959389\nSPY,20201111 00:00,3564300,3575600,3550700,3566700,48425558,0.00044210343440259143\nQQQ,20201111 00:00,2860300,2902500,2855300,2897600,31131846,0.00044210343440259143\nSPY,20201112 00:00,3555700,3564200,3512600,3532100,60620567,0.00044236700773107456\nQQQ,20201112 00:00,2907600,2920800,2872500,2884000,31267892,0.00044236700773107456\nSPY,20201113 00:00,3553000,3589000,3547100,3581000,51387458,0.0004427422533703588\nQQQ,20201113 00:00,2901700,2915700,2878700,2909300,22737090,0.0004427422533703588\nSPY,20201116 00:00,3611000,3625900,3595900,3625700,63099795,0.00044288116471268024\nQQQ,20201116 00:00,2906200,2935200,2899900,2932000,26002717,0.00044288116471268024\nSPY,20201117 00:00,3599700,3619200,3583400,3606200,57359007,0.0004430011896682934\nQQQ,20201117 00:00,2934000,2937400,2916100,2922700,19878141,0.0004430011896682934\nSPY,20201118 00:00,3609800,3615000,3562400,3562800,58727952,0.0004434633065864548\nQQQ,20201118 00:00,2917000,2933700,2900200,2901100,25187901,0.0004434633065864548\nSPY,20201119 00:00,3556800,3581800,3541500,3577800,51165348,0.0004434099846459383\nQQQ,20201119 00:00,2895400,2927000,2888500,2923800,20097304,0.0004434099846459383\nSPY,20201120 00:00,3574500,3577100,3552500,3553300,50408452,0.0004436322226193019\nQQQ,20201120 00:00,2923100,2930700,2902900,2903800,22316893,0.0004436322226193019\nSPY,20201123 00:00,3572500,3588200,3548650,3574600,51739439,0.00044360368128293256\nQQQ,20201123 00:00,2915300,2927500,2880600,2903900,24177232,0.00044360368128293256\nSPY,20201124 00:00,3603000,3638100,3592900,3632200,56453154,0.0004440763225627007\nQQQ,20201124 00:00,2915900,2949800,2896300,2944700,22295725,0.0004440763225627007\nSPY,20201125 00:00,3631600,3631600,3614850,3626600,35940388,0.0004440337908268301\nQQQ,20201125 00:00,2955700,2969400,2946000,2962800,21366275,0.0004440337908268301\nSPY,20201127 00:00,3638400,3641800,3625800,3636700,23919941,0.0004440164040869685\nQQQ,20201127 00:00,2983100,3001700,2979100,2990100,14003962,0.0004440164040869685\nSPY,20201130 00:00,3628400,3631200,3591800,3620600,70776034,0.00044389729872057075\nQQQ,20201130 00:00,2993400,2999700,2947700,2996200,25542421,0.00044389729872057075\nSPY,20201201 00:00,3656000,3676500,3649300,3660200,67257271,0.0004438938312719037\nQQQ,20201201 00:00,3019700,3051400,3008300,3034600,25607635,0.0004438938312719037\nSPY,20201202 00:00,3648000,3669500,3642000,3667900,38543468,0.00044359777034098664\nQQQ,20201202 00:00,3022500,3042000,3003500,3038500,22008272,0.00044359777034098664\nSPY,20201203 00:00,3666600,3681900,3655000,3666900,54787910,0.00044353283934433726\nQQQ,20201203 00:00,3041700,3058800,3035310,3042800,21082085,0.00044353283934433726\nSPY,20201204 00:00,3673000,3698500,3672200,3698500,41677506,0.00044360022222281035\nQQQ,20201204 00:00,3043300,3056700,3036300,3055200,17540116,0.00044360022222281035\nSPY,20201207 00:00,3689700,3696200,3677200,3690900,41405227,0.0004432655001283695\nQQQ,20201207 00:00,3057200,3076300,3055200,3072500,15799078,0.0004432655001283695\nSPY,20201208 00:00,3676700,3707700,3676700,3701700,35566369,0.00044317540201874324\nQQQ,20201208 00:00,3067600,3086100,3049600,3082900,16698225,0.00044317540201874324\nSPY,20201209 00:00,3709100,3710500,3659500,3668500,62483119,0.0004441135845336775\nQQQ,20201209 00:00,3081300,3083600,3002100,3013100,43692846,0.0004441135845336775\nSPY,20201210 00:00,3653900,3678550,3644500,3667300,49958315,0.0004440754772882702\nQQQ,20201210 00:00,2992100,3036800,2980900,3025200,25113732,0.0004440754772882702\nSPY,20201211 00:00,3649300,3665800,3632650,3663000,48805237,0.0004439304442596792\nQQQ,20201211 00:00,3007700,3019800,2984700,3018500,24711707,0.0004439304442596792\nSPY,20201214 00:00,3686100,3698000,3644900,3646600,56272411,0.00044381653600832695\nQQQ,20201214 00:00,3030500,3060500,3030100,3040400,25957392,0.00044381653600832695\nSPY,20201215 00:00,3674600,3695900,3659200,3695900,52393172,0.0004440683537839278\nQQQ,20201215 00:00,3064000,3073636,3041100,3072900,23074931,0.0004440683537839278\nSPY,20201216 00:00,3698100,3711600,3688800,3701700,48533538,0.00044407680248167205\nQQQ,20201216 00:00,3077500,3097810,3066200,3089800,22970435,0.00044407680248167205\nSPY,20201217 00:00,3719300,3724590,3710500,3722400,53146880,0.00044416353086454993\nQQQ,20201217 00:00,3107000,3112400,3093800,3110000,20697627,0.00044416353086454993\nSPY,20201218 00:00,3709800,3711500,3670200,3691800,97825013,0.00044427873351610657\nQQQ,20201218 00:00,3116000,3119700,3076100,3100600,36636019,0.00044427873351610657\nSPY,20201221 00:00,3649800,3784600,3620300,3678600,75870057,0.00044438490103483\nQQQ,20201221 00:00,3065100,3094700,3036000,3089200,32463534,0.00044438490103483\nSPY,20201222 00:00,3682300,3683300,3660400,3672400,42023209,0.0004443794610099767\nQQQ,20201222 00:00,3097700,3107200,3068500,3097600,24534478,0.0004443794610099767\nSPY,20201223 00:00,3683300,3696100,3673900,3675700,38573967,0.00044437208946897965\nQQQ,20201223 00:00,3098800,3103500,3080400,3082000,19091918,0.00044437208946897965\nSPY,20201224 00:00,3680600,3690000,3674500,3690000,21624848,0.00044427653855122094\nQQQ,20201224 00:00,3085300,3100200,3083900,3095600,11876055,0.00044427653855122094\nSPY,20201228 00:00,3718100,3725900,3710700,3721700,32833964,0.00044452561396955985\nQQQ,20201228 00:00,3123100,3131690,3103600,3126800,20724335,0.00044452561396955985\nSPY,20201229 00:00,3738500,3740000,3708300,3714600,45884792,0.00044432561037476\nQQQ,20201229 00:00,3140900,3146900,3120300,3129600,24384741,0.00044432561037476\nSPY,20201230 00:00,3723800,3730800,3715800,3719900,43472434,0.00044432062914988\nQQQ,20201230 00:00,3142000,3144900,3123300,3129700,16742560,0.00044432062914988\nSPY,20201231 00:00,3718500,3746420,3712400,3738800,55021528,0.00044382316229967173\nQQQ,20201231 00:00,3129200,3142400,3117700,3137400,19472357,0.00044382316229967173\nSPY,20210104 00:00,3753000,3754500,3648300,3687900,94376649,0.00044436938940336466\nQQQ,20210104 00:00,3151800,3152900,3051800,3093100,41715635,0.00044436938940336466\nSPY,20210105 00:00,3680500,3724800,3680500,3713300,54611244,0.00044447116983201466\nQQQ,20210105 00:00,3084400,3121400,3082900,3118600,26190005,0.00044447116983201466\nSPY,20210106 00:00,3696700,3769800,3691200,3735500,92950127,0.0004441234233284826\nQQQ,20210106 00:00,3068200,3118900,3059800,3075400,48330659,0.0004441234233284826\nSPY,20210107 00:00,3761800,3798900,3759200,3791000,62270874,0.0004452765294788891\nQQQ,20210107 00:00,3104100,3158400,3102500,3149800,27676047,0.0004452765294788891\nSPY,20210108 00:00,3806300,3814900,3771100,3812600,63163985,0.00044533231351142445\nQQQ,20210108 00:00,3173800,3193900,3150800,3190300,30741271,0.00044533231351142445\nSPY,20210111 00:00,3778400,3805700,3777200,3786900,45616919,0.00044575703331676864\nQQQ,20210111 00:00,3159500,3171900,3137600,3144200,30253406,0.00044575703331676864\nSPY,20210112 00:00,3788400,3798500,3763600,3787700,46336265,0.0004455265153224109\nQQQ,20210112 00:00,3144000,3155800,3112000,3139200,26793444,0.0004455265153224109\nSPY,20210113 00:00,3786500,3808600,3778500,3797900,39076595,0.0004455126393903981\nQQQ,20210113 00:00,3142800,3168600,3135700,3160400,19774972,0.0004455126393903981\nSPY,20210114 00:00,3806300,3811300,3781000,3784600,41851848,0.00044564057611731436\nQQQ,20210114 00:00,3165700,3175300,3138700,3143500,21894878,0.00044564057611731436\nSPY,20210115 00:00,3767100,3775800,3737200,3757000,81635248,0.0004457078583719189\nQQQ,20210115 00:00,3139600,3151200,3105800,3118600,31695724,0.0004457078583719189\nSPY,20210119 00:00,3782400,3792300,3767800,3786500,43441293,0.0004460439420747292\nQQQ,20210119 00:00,3143200,3169200,3131200,3164100,21457525,0.0004460439420747292\nSPY,20210120 00:00,3811000,3847900,3806900,3838900,54390017,0.0004471431794292439\nQQQ,20210120 00:00,3201800,3247400,3197600,3237700,28226415,0.0004471431794292439\nSPY,20210121 00:00,3845000,3849500,3832500,3842400,42558878,0.0004471481306796132\nQQQ,20210121 00:00,3251500,3271350,3237300,3263600,23050428,0.0004471481306796132\nSPY,20210122 00:00,3822400,3840800,3818400,3828800,40128912,0.0004472261243002795\nQQQ,20210122 00:00,3253200,3264600,3247100,3254200,18993700,0.0004472261243002795\nSPY,20210125 00:00,3836000,3847700,3784600,3843900,62710822,0.00044691311583430017\nQQQ,20210125 00:00,3289500,3303200,3214100,3281100,35751624,0.00044691311583430017\nSPY,20210126 00:00,3854100,3858500,3835500,3837900,39595836,0.00044540171776877367\nQQQ,20210126 00:00,3289300,3297600,3272100,3285900,22007761,0.00044540171776877367\nSPY,20210127 00:00,3802400,3803200,3720100,3744100,101850739,0.00044786879166314544\nQQQ,20210127 00:00,3262600,3263000,3173600,3194300,46566155,0.00044786879166314544\nSPY,20210128 00:00,3762700,3819300,3758900,3776300,76978675,0.0004479988390380562\nQQQ,20210128 00:00,3206000,3264200,3200200,3213200,38276373,0.0004479988390380562\nSPY,20210129 00:00,3755700,3766700,3682700,3700700,110053148,0.0004498607039646306\nQQQ,20210129 00:00,3194900,3207100,3127600,3145600,50173676,0.0004498607039646306\nSPY,20210201 00:00,3738400,3773400,3714200,3762300,65567084,0.0004500062310347131\nQQQ,20210201 00:00,3184100,3235400,3161300,3224200,32488751,0.0004500062310347131\nSPY,20210202 00:00,3796800,3832200,3796000,3815500,55798392,0.00045042595386227786\nQQQ,20210202 00:00,3255200,3288700,3253100,3276800,30132421,0.00045042595386227786\nSPY,20210203 00:00,3824300,3837000,3804800,3818500,44014303,0.0004492147488099277\nQQQ,20210203 00:00,3298900,3302000,3263200,3263800,22431939,0.0004492147488099277\nSPY,20210204 00:00,3830300,3862400,3827800,3861900,41511995,0.0004495720553009589\nQQQ,20210204 00:00,3279600,3303300,3264700,3302400,19972688,0.0004495720553009589\nSPY,20210205 00:00,3882700,3884700,3864850,3877100,40406184,0.0004495226964331537\nQQQ,20210205 00:00,3313100,3324000,3295300,3313600,20409945,0.0004495226964331537\nSPY,20210208 00:00,3893000,3905400,3883600,3905100,34842630,0.00044950078133484484\nQQQ,20210208 00:00,3331800,3337400,3314100,3335800,18171176,0.00044950078133484484\nSPY,20210209 00:00,3895500,3908900,3891700,3902500,31350935,0.0004492395283448147\nQQQ,20210209 00:00,3327200,3348100,3326100,3335100,16472896,0.0004492395283448147\nSPY,20210210 00:00,3921000,3922800,3875100,3900800,54203861,0.00044926506904760505\nQQQ,20210210 00:00,3349900,3354600,3295000,3327500,25751725,0.00044926506904760505\nSPY,20210211 00:00,3913400,3916900,3881200,3907100,39710262,0.0004490966044830147\nQQQ,20210211 00:00,3344400,3350000,3321200,3345800,20534222,0.0004490966044830147\nSPY,20210212 00:00,3898800,3928900,3897700,3926400,40896380,0.000449138312309621\nQQQ,20210212 00:00,3337500,3366200,3326200,3364500,18255219,0.000449138312309621\nSPY,20210216 00:00,3940600,3941600,3915400,3923000,44689625,0.0004491643476132583\nQQQ,20210216 00:00,3373500,3381900,3343400,3355400,24054540,0.0004491643476132583\nSPY,20210217 00:00,3904300,3926300,3893300,3923900,45915151,0.00044916235113940924\nQQQ,20210217 00:00,3324900,3356570,3301700,3339300,28125595,0.00044916235113940924\nSPY,20210218 00:00,3895600,3915150,3877400,3907200,53102694,0.000449157986904708\nQQQ,20210218 00:00,3301200,3338661,3283600,3324700,28453870,0.000449157986904708\nSPY,20210219 00:00,3921000,3923800,3895500,3900300,69024514,0.0004490059283536886\nQQQ,20210219 00:00,3339900,3339900,3299700,3310200,35763999,0.0004490059283536886\nSPY,20210222 00:00,3870600,3896200,3867400,3870300,58902644,0.00044901710059110236\nQQQ,20210222 00:00,3264000,3309653,3222300,3224400,40867925,0.00044901710059110236\nSPY,20210223 00:00,3847200,3889450,3802000,3875000,99054818,0.0004435533217229314\nQQQ,20210223 00:00,3168400,3232100,3110000,3214800,92411395,0.0004435533217229314\nSPY,20210224 00:00,3862300,3922300,3852700,3917700,65524154,0.0004401886416293734\nQQQ,20210224 00:00,3186600,3244500,3159500,3241300,52227753,0.0004401886416293734\nSPY,20210225 00:00,3905100,3918700,3807789,3823300,138895516,0.0004439290451684953\nQQQ,20210225 00:00,3214400,3241953,3112400,3128300,102454568,0.0004439290451684953\nSPY,20210226 00:00,3844400,3855800,3782300,3803600,136480361,0.0004343526939989636\nQQQ,20210226 00:00,3158300,3191200,3108700,3141400,94147142,0.0004343526939989636\nSPY,20210301 00:00,3856500,3909200,3855500,3895800,94752970,0.00043689902839191\nQQQ,20210301 00:00,3194800,3239400,3179350,3235900,44420555,0.00043689902839191\nSPY,20210302 00:00,3898700,3900700,3860000,3865400,73195170,0.0004292095113827413\nQQQ,20210302 00:00,3242600,3243397,3181400,3184000,45149257,0.0004292095113827413\nSPY,20210303 00:00,3858300,3868300,3813100,3814200,109545489,0.0004269595376067842\nQQQ,20210303 00:00,3171300,3182400,3091000,3091600,81334799,0.0004269595376067842\nSPY,20210304 00:00,3812200,3840000,3718800,3767000,171790812,0.00042138833865990705\nQQQ,20210304 00:00,3086600,3140000,3001050,3041000,133918263,0.00042138833865990705\nSPY,20210305 00:00,3804100,3847600,3726500,3836300,136356393,0.0004179376658537784\nQQQ,20210305 00:00,3069500,3096667,2974500,3086800,112054692,0.0004179376658537784\nSPY,20210308 00:00,3846900,3876800,3814200,3817200,108618789,0.0004173625624985292\nQQQ,20210308 00:00,3081100,3100600,2995100,2999400,81723076,0.0004173625624985292\nSPY,20210309 00:00,3858800,3899100,3853100,3871700,100993909,0.00039668813800874323\nQQQ,20210309 00:00,3076500,3137300,3069200,3117700,74021178,0.00039668813800874323\nSPY,20210310 00:00,3895900,3914000,3881702,3895800,102850671,0.000386095133697454\nQQQ,20210310 00:00,3162800,3164700,3101600,3108800,70751807,0.000386095133697454\nSPY,20210311 00:00,3922400,3956500,3917400,3935300,78605803,0.0003776899561533966\nQQQ,20210311 00:00,3160100,3198600,3148500,3180400,49817297,0.0003776899561533966\nSPY,20210312 00:00,3920900,3942100,3912000,3940600,58694370,0.0003411894499642172\nQQQ,20210312 00:00,3137800,3182302,3113900,3154600,61570587,0.0003411894499642172\nSPY,20210315 00:00,3944000,3966850,3920400,3964100,67193193,0.0003138841828558998\nQQQ,20210315 00:00,3158000,3190000,3140950,3188300,39818985,0.0003138841828558998\nSPY,20210316 00:00,3970600,3978300,3950800,3959100,67508285,0.0002596268385013464\nQQQ,20210316 00:00,3212300,3242000,3189554,3205800,52496933,0.0002596268385013464\nSPY,20210317 00:00,3945600,3981200,3933000,3972600,83563811,0.0002444614780048278\nQQQ,20210317 00:00,3174200,3238600,3156800,3219000,74074006,0.0002444614780048278\nSPY,20210318 00:00,3944900,3967200,3908650,3914800,101153040,0.00023975552357376607\nQQQ,20210318 00:00,3169200,3178801,3115700,3120400,72715984,0.00023975552357376607\nSPY,20210319 00:00,3899400,3915690,3871500,3894800,94802448,0.00023972267783426348\nQQQ,20210319 00:00,3119300,3147300,3096601,3131400,74114866,0.00023972267783426348\nSPY,20210322 00:00,3900100,3940500,3899800,3925900,62207903,0.00023162608557814024\nQQQ,20210322 00:00,3154100,3207500,3152000,3186100,50067564,0.00023162608557814024\nSPY,20210323 00:00,3918900,3934600,3886600,3895000,80338274,0.00023146152502758778\nQQQ,20210323 00:00,3196800,3210900,3163700,3172200,50079047,0.00023146152502758778\nSPY,20210324 00:00,3909200,3927500,3874800,3875200,86478164,0.00020558146993517563\nQQQ,20210324 00:00,3185400,3186700,3117200,3118700,61930710,0.00020558146993517563\nSPY,20210325 00:00,3859900,3905500,3839000,3897000,102523995,0.00020602472527279402\nQQQ,20210325 00:00,3099900,3134344,3073850,3113300,73199853,0.00020602472527279402\nSPY,20210326 00:00,3909800,3964100,3902900,3959800,101407276,0.00019538115598653926\nQQQ,20210326 00:00,3110200,3163300,3096700,3160000,59438321,0.00019538115598653926\nSPY,20210329 00:00,3943500,3967499,3928100,3957800,93832458,0.0001908004696126226\nQQQ,20210329 00:00,3155200,3169900,3124600,3159100,50225374,0.0001908004696126226\nSPY,20210330 00:00,3943500,3957800,3930299,3947300,66174457,0.0001867468036635878\nQQQ,20210330 00:00,3140500,3157420,3115400,3143200,41179093,0.0001867468036635878\nSPY,20210331 00:00,3953500,3980000,3953300,3963300,90673494,0.00018615835302076886\nQQQ,20210331 00:00,3161400,3207400,3150500,3191300,50120342,0.00018615835302076886\n"
  },
  {
    "path": "Tests/TestData/spy_rdv.txt",
    "content": "Date,Open,High,Low,Close,Volume,Past Volume,Current Volume,RDV\n2021-04-05T13:30:00Z,403.46,405.49,403.38,405.49,1655683,1407011.5,1655683,0\n2021-04-05T14:30:00Z,405.3,406.03,405.3,406.03,819253,2210619,2474936,0\n2021-04-05T15:30:00Z,405.71,406.67,405.69,406.67,599391,2758116,3074327,0\n2021-04-05T16:30:00Z,406.59,406.94,406.165,406.94,696600,3205933,3770927,0\n2021-04-05T17:30:00Z,406.27,406.59,406.08,406.59,395203,3815751.5,4166130,0\n2021-04-05T18:30:00Z,406.39,406.83,405.76,406.83,933409,4701544,5099539,0\n2021-04-05T19:30:00Z,406.02,406.8,405.84,406.8,1634218,6818329.5,6733757,0\n2021-04-06T13:30:00Z,405.76,407.19,405.52,407.19,1064241,1642762.5,1064241,0\n2021-04-06T14:30:00Z,406.86,407.13,406.51,407.13,545077,2476623,1609318,0\n2021-04-06T15:30:00Z,406.9,407.23,406.71,407.23,453480,3044671,2062798,0\n2021-04-06T16:30:00Z,406.9,406.91,405.88,406.91,547449,3590239,2610247,0\n2021-04-06T17:30:00Z,406.01,406.81,405.93,406.81,426760,3992943.5,3037007,0\n2021-04-06T18:30:00Z,406.68,406.825,405.95,406.825,802977,4744023,3839984,0\n2021-04-06T19:30:00Z,406.32,406.36,405.42,406.36,1262598,6083980.5,5102582,0\n2021-04-07T13:30:00Z,405.97,406.84,405.94,406.84,663826,1359962,663826,0.488120992\n2021-04-07T14:30:00Z,406.86,406.95,406.18,406.95,425908,2042127,1089734,0.533626949\n2021-04-07T15:30:00Z,406.25,406.31,405.51,406.31,663430,2568562.5,1753164,0.682546755\n2021-04-07T16:30:00Z,405.5,406.31,405.46,406.31,425734,3190587,2178898,0.682914461\n2021-04-07T17:30:00Z,406.02,406.91,405.98,406.91,553931,3601568.5,2732829,0.758788567\n2021-04-07T18:30:00Z,406.625,406.8,405.89,406.8,604410,4469761.5,3337239,0.746625743\n2021-04-07T19:30:00Z,406.05,406.75,405.76,406.75,990660,5918169.5,4327899,0.73129014\n2021-04-08T13:30:00Z,407.93,408.04,406.94,408.04,1077540,864033.5,1077540,1.247104424\n2021-04-08T14:30:00Z,407.44,407.94,407.37,407.94,654695,1349526,1732235,1.283587719\n2021-04-08T15:30:00Z,407.85,408.38,407.66,408.38,517037,1907981,2249272,1.178875471\n2021-04-08T16:30:00Z,408.16,408.32,407.94,408.32,294778,2394572.5,2544050,1.06242346\n2021-04-08T17:30:00Z,408.11,408.43,407.84,408.43,285365,2884918,2829415,0.980760978\n2021-04-08T18:30:00Z,408.33,408.575,408.27,408.575,388665,3588611.5,3218080,0.896747948\n2021-04-08T19:30:00Z,408.34,408.56,408.05,408.56,1043513,4715240.5,4261593,0.903791228\n2021-04-09T13:30:00Z,408.39,409.24,408.27,409.24,961117,870683,961117,1.103865586\n2021-04-09T14:30:00Z,408.71,409.09,408.43,409.09,658877,1410984.5,1619994,1.148130259\n2021-04-09T15:30:00Z,408.91,409.47,408.84,409.47,431209,2001218,2051203,1.024977289\n2021-04-09T16:30:00Z,409.25,409.54,409.25,409.54,301439,2361474,2352642,0.996259963\n2021-04-09T17:30:00Z,409.45,409.97,409.44,409.97,411509,2781122,2764151,0.993897787\n2021-04-09T18:30:00Z,409.76,410.55,409.5,410.55,622175,3277659.5,3386326,1.033153688\n2021-04-09T19:30:00Z,410.56,411.66,410.54,411.66,1469883,4294746,4856209,1.130732528\n2021-04-12T13:30:00Z,410.85,411.47,410.46,411.47,856235,1019328.5,856235,0.839999078\n2021-04-12T14:30:00Z,410.87,411.05,410.21,411.05,533711,1676114.5,1389946,0.829266736\n2021-04-12T15:30:00Z,411.03,411.34,410.66,411.34,323430,2150237.5,1713376,0.796831048\n2021-04-12T16:30:00Z,411.31,411.78,411.15,411.78,414529,2448346,2127905,0.869119397\n2021-04-12T17:30:00Z,411.2,411.21,410.62,411.21,567932,2796783,2695837,0.963906388\n2021-04-12T18:30:00Z,411.11,411.16,410.53,411.16,508113,3302203,3203950,0.970246227\n2021-04-12T19:30:00Z,411.02,411.93,410.89,411.93,1248383,4558901,4452333,0.976624191\n2021-04-13T13:30:00Z,411.53,412.13,411.12,412.13,964733,908676,964733,1.061690856\n2021-04-13T14:30:00Z,411.98,412.2,411.73,412.2,470659,1504970,1435392,0.953767849\n2021-04-13T15:30:00Z,412.06,412.2,411.74,412.2,310765,1882289.5,1746157,0.927677172\n2021-04-13T16:30:00Z,411.97,412.11,411.55,412.11,826739,2240273.5,2572896,1.148474059\n2021-04-13T17:30:00Z,411.98,412.72,411.945,412.72,731083,2729994,3303979,1.210251378\n2021-04-13T18:30:00Z,412.69,413.52,412.67,413.52,683586,3295138,3987565,1.210135964\n2021-04-13T19:30:00Z,413.36,413.42,412.7,413.42,1119171,4654271,5106736,1.09721501\n2021-04-14T13:30:00Z,412.83,413.83,412.57,413.83,966283,910484,966283,1.061284987\n2021-04-14T14:30:00Z,413.32,413.95,412.73,413.95,661505,1412669,1627788,1.152278418\n2021-04-14T15:30:00Z,413.15,413.44,412.89,413.44,390180,1729766.5,2017968,1.16661295\n2021-04-14T16:30:00Z,413.07,413.56,413.06,413.56,279345,2350400.5,2297313,0.977413424\n2021-04-14T17:30:00Z,413.29,413.29,411.21,413.29,974491,2999908,3271804,1.090634779\n2021-04-14T18:30:00Z,412.38,412.47,410.89,412.47,787996,3595757.5,4059800,1.12905278\n2021-04-14T19:30:00Z,411.94,412.12,410.87,412.12,1430183,4779534.5,5489983,1.148643869\n2021-04-15T13:30:00Z,413.77,414.55,413.69,414.55,1162215,965508,1162215,1.2037342\n2021-04-15T14:30:00Z,414.56,415.45,414.56,415.45,882572,1531590,2044787,1.335074661\n2021-04-15T15:30:00Z,414.66,415.22,414.52,415.22,485883,1882062.5,2530670,1.344625909\n2021-04-15T16:30:00Z,415.19,415.7,415.1,415.7,519983,2435104.5,3050653,1.252781143\n2021-04-15T17:30:00Z,415.32,415.665,415.25,415.665,575475,3287891.5,3626128,1.102873376\n2021-04-15T18:30:00Z,415.62,415.79,414.89,415.79,683202,4023682.5,4309330,1.070991561\n2021-04-15T19:30:00Z,414.98,416.15,414.96,416.15,1239343,5298359.5,5548673,1.047243585\n2021-04-16T13:30:00Z,417.25,417.39,415.74,417.39,1248037,1064249,1248037,1.172692669\n2021-04-16T14:30:00Z,416.43,416.99,416.27,416.99,655464,1836287.5,1903501,1.036602928\n2021-04-16T15:30:00Z,416.32,416.84,416.21,416.84,392217,2274319,2295718,1.00940897\n2021-04-16T16:30:00Z,416.75,416.86,416.43,416.86,339822,2673983,2635540,0.985623319\n2021-04-16T17:30:00Z,416.58,417.16,416.41,417.16,508003,3448966,3143543,0.911445053\n2021-04-16T18:30:00Z,417.08,417.58,417.08,417.58,733165,4184565,3876708,0.926430346\n2021-04-16T19:30:00Z,417.51,417.91,417.11,417.91,1805905,5519328,5682613,1.029584217\n2021-04-19T13:30:00Z,416.26,416.74,415.07,416.74,1363656,1205126,1363656,1.131546411\n2021-04-19T14:30:00Z,415.79,416.06,414.38,416.06,907154,1974144,2270810,1.150275765\n2021-04-19T15:30:00Z,415.64,415.67,414.23,415.67,1006394,2413194,3277204,1.358035865\n2021-04-19T16:30:00Z,414.54,414.93,413.79,414.93,698109,2843096.5,3975313,1.398233581\n2021-04-19T17:30:00Z,414.67,415.09,414.4,415.09,416519,3384835.5,4391832,1.297502345\n2021-04-19T18:30:00Z,414.98,415.19,414.22,415.19,700004,4093019,5091836,1.244029407\n2021-04-19T19:30:00Z,414.32,415.34,414.14,415.34,1129627,5615643,6221463,1.107880789\n2021-04-20T13:30:00Z,413.91,414.67,413.67,414.67,1024548,1305846.5,1024548,0.784585325\n2021-04-20T14:30:00Z,413.93,413.93,411.12,413.93,1679556,2087155.5,2704104,1.295592973\n2021-04-20T15:30:00Z,411.565,412.39,410.63,412.39,917625,2786461,3621729,1.299759444\n2021-04-20T16:30:00Z,412.14,412.2,411.25,412.2,557725,3305426.5,4179454,1.264422004\n2021-04-20T17:30:00Z,411.3,412.1,411.21,412.1,510020,3767687.5,4689474,1.244655774\n2021-04-20T18:30:00Z,411.53,412.015,410.6,412.015,646824,4484272,5336298,1.190003193\n2021-04-20T19:30:00Z,411.93,412.67,411.81,412.67,1061306,5952038,6397604,1.074859401\n2021-04-21T13:30:00Z,411.51,414.1,411.36,414.1,1460070,1194102,1460070,1.222734741\n2021-04-21T14:30:00Z,413.97,414.33,413.43,414.33,796546,2487457,2256616,0.907197994\n2021-04-21T15:30:00Z,414.2,414.91,414.16,414.91,673212,3449466.5,2929828,0.84935685\n2021-04-21T16:30:00Z,414.53,414.93,414.375,414.93,459143,4077383.5,3388971,0.831163171\n2021-04-21T17:30:00Z,414.71,415.25,414.71,415.25,404380,4540653,3793351,0.835419707\n2021-04-21T18:30:00Z,414.93,415.24,414.775,415.24,450257,5214067,4243608,0.813876768\n2021-04-21T19:30:00Z,415.135,416.29,415.135,416.29,1477365,6309533.5,5720973,0.906718856\n2021-04-22T13:30:00Z,415.88,415.88,414.54,415.88,1063243,1242309,1063243,0.855860337\n2021-04-22T14:30:00Z,415.365,416.25,415.29,416.25,587396,2480360,1650639,0.665483639\n2021-04-22T15:30:00Z,415.91,416.44,415.71,416.44,400600,3275778.5,2051239,0.626183669\n2021-04-22T16:30:00Z,416.37,416.77,413.15,416.77,2117894,3784212.5,4169133,1.101717464\n2021-04-22T17:30:00Z,414.69,414.76,411.15,414.76,2150398,4241412.5,6319531,1.489959064\n2021-04-22T18:30:00Z,413.06,413.45,411.76,413.45,1160029,4789953,7479560,1.561510102\n2021-04-22T19:30:00Z,412.16,413.04,412.06,413.04,1700462,6059288.5,9180022,1.515032994\n2021-04-23T13:30:00Z,412.87,414.47,412.79,414.47,973423,1261656.5,973423,0.771543602\n2021-04-23T14:30:00Z,414.35,416.33,414.24,416.33,933651,1953627.5,1907074,0.976170739\n2021-04-23T15:30:00Z,416.15,416.55,416.02,416.55,410303,2490533.5,2317377,0.930474133\n2021-04-23T16:30:00Z,416.42,417.28,416.42,417.28,428405,3779052,2745782,0.726579576\n2021-04-23T17:30:00Z,417.06,417.38,416.75,417.38,335260,5056441,3081042,0.609330159\n2021-04-23T18:30:00Z,417.04,417.855,416.94,417.855,589433,5861584,3670475,0.626191657\n2021-04-23T19:30:00Z,417.78,418.24,416.65,418.24,1168604,7450497.5,4839079,0.649497433\n2021-04-26T13:30:00Z,417.44,418.17,417.21,418.17,870018,1018333,870018,0.854355108\n2021-04-26T14:30:00Z,417.84,418.13,417.62,418.13,353514,1778856.5,1223532,0.687819394\n2021-04-26T15:30:00Z,417.91,417.94,417.29,417.94,318360,2184308,1541892,0.705894956\n2021-04-26T16:30:00Z,417.4,417.805,417.31,417.805,238677,3457457.5,1780569,0.514993749\n2021-04-26T17:30:00Z,417.4,417.95,417.295,417.95,346865,4700286.5,2127434,0.452617941\n2021-04-26T18:30:00Z,417.92,418.215,417.18,418.215,578173,5575017.5,2705607,0.485309149\n2021-04-26T19:30:00Z,417.29,417.935,416.98,417.935,1193760,7009550.5,3899367,0.556293446\n2021-04-27T13:30:00Z,417.93,417.98,416.32,417.98,1244170,921720.5,1244170,1.349834359\n2021-04-27T14:30:00Z,417.18,417.38,416.53,417.38,424250,1565303,1668420,1.065876702\n2021-04-27T15:30:00Z,417.21,417.73,417.15,417.73,450617,1929634.5,2119037,1.098154599\n2021-04-27T16:30:00Z,417.67,417.67,416.98,417.67,278159,2263175.5,2397196,1.0592179\n2021-04-27T17:30:00Z,417.34,417.58,417.07,417.58,443599,2604238,2840795,1.0908354\n2021-04-27T18:30:00Z,417.565,417.95,417.3,417.95,463940,3188041,3304735,1.03660367\n2021-04-27T19:30:00Z,417.86,418.14,417.26,418.14,723747,4369223,4028482,0.922013365\n2021-04-28T13:30:00Z,417.81,418.44,417.33,418.44,849421,1057094,849421,0.803543488\n2021-04-28T14:30:00Z,418.16,418.22,417.71,418.22,455211,1445976,1304632,0.902250107\n2021-04-28T15:30:00Z,417.92,417.92,417.12,417.92,482286,1830464.5,1786918,0.976210137\n2021-04-28T16:30:00Z,417.63,417.89,417.53,417.89,215062,2088882.5,2001980,0.958397612\n2021-04-28T17:30:00Z,417.79,418.22,416.9,418.22,750443,2484114.5,2752423,1.108009715\n2021-04-28T18:30:00Z,417.67,419.01,417.13,419.01,1181485,3005171,3933908,1.309046307\n2021-04-28T19:30:00Z,417.97,418.17,417.04,418.17,983172,3963924.5,4917080,1.240457531\n2021-04-29T13:30:00Z,420.32,420.71,418.67,420.71,1629358,1046795.5,1629358,1.556519874\n2021-04-29T14:30:00Z,418.94,418.97,417.56,418.97,1029116,1486526,2658474,1.788380425\n2021-04-29T15:30:00Z,418.48,418.49,416.44,418.49,1088651,1952977.5,3747125,1.918672898\n2021-04-29T16:30:00Z,417.12,418.52,416.86,418.52,624148,2199588,4371273,1.987314443\n2021-04-29T17:30:00Z,418.52,419.39,418.14,419.39,599676,2796609,4970949,1.777491598\n2021-04-29T18:30:00Z,419.32,420.485,419.31,420.485,1114941,3619321.5,6085890,1.681500248\n2021-04-29T19:30:00Z,419.58,420.28,419.51,420.28,1237299,4472781,7323189,1.637278686\n2021-04-30T13:30:00Z,417.63,418.54,417.41,418.54,1136001,1239389.5,1136001,0.916581107\n2021-04-30T14:30:00Z,418.47,418.48,416.84,418.48,1163414,1981553,2299415,1.160410547\n2021-04-30T15:30:00Z,416.93,417.88,416.71,417.88,662691,2767021.5,2962106,1.070503428\n2021-04-30T16:30:00Z,417.67,417.79,417.11,417.79,383003,3186626.5,3345109,1.049733629\n2021-04-30T17:30:00Z,417.72,417.89,416.39,417.89,806211,3861686,4151320,1.075001955\n2021-04-30T18:30:00Z,417.27,417.52,416.57,417.52,783698,5009899,4935018,0.985053391\n2021-04-30T19:30:00Z,417.48,417.56,416.35,417.56,2315811,6120134.5,7250829,1.184749943\n2021-05-03T13:30:00Z,419.43,419.84,418.625,419.84,1145862,1382679.5,1145862,0.828725674\n2021-05-03T14:30:00Z,419.36,419.74,418.18,419.74,867918,2478944.5,2013780,0.812353806\n2021-05-03T15:30:00Z,418.22,418.96,418.15,418.96,455410,3354615.5,2469190,0.73605753\n2021-05-03T16:30:00Z,418.4,418.7,418.18,418.7,354535,3858191,2823725,0.731877971\n2021-05-03T17:30:00Z,418.34,418.98,418.29,418.98,347822,4561134.5,3171547,0.695341696\n2021-05-03T18:30:00Z,418.93,419.27,418.465,419.27,696866,5510454,3868413,0.702013482\n2021-05-03T19:30:00Z,418.6,418.63,417.67,418.63,1107550,7287009,4975963,0.682853967\n2021-05-04T13:30:00Z,416.09,416.59,413.16,416.59,2391061,1140931.5,2391061,2.095709515\n2021-05-04T14:30:00Z,414.28,414.5,411.97,414.5,1614389,2156597.5,4005450,1.857300678\n2021-05-04T15:30:00Z,412.91,413.51,411.67,413.51,1147763,2715648,5153213,1.897599763\n2021-05-04T16:30:00Z,413.47,413.93,412.6,413.93,882176,3084417,6035389,1.956735746\n2021-05-04T17:30:00Z,413.69,414.27,413.19,414.27,982558,3661433.5,7017947,1.916721142\n2021-05-04T18:30:00Z,413.74,414.4,413.49,414.4,945672,4401715.5,7963619,1.809208024\n2021-05-04T19:30:00Z,413.87,415.66,413.62,415.66,1860345,6113396,9823964,1.606956919\n2021-05-05T13:30:00Z,417.35,417.44,414.95,417.44,1269836,1768461.5,1269836,0.718045601\n2021-05-05T14:30:00Z,415.81,416.91,415.7,416.91,619580,3009615,1889416,0.627793256\n2021-05-05T15:30:00Z,416.88,417.63,416.88,417.63,387413,3811201.5,2276829,0.597404519\n2021-05-05T16:30:00Z,417.21,417.3,416.35,417.3,496251,4429557,2773080,0.626040031\n2021-05-05T17:30:00Z,416.81,417.12,416.44,417.12,398411,5094747,3171491,0.622502158\n2021-05-05T18:30:00Z,417,417.22,415.15,417.22,694918,5916016,3866409,0.653549449\n2021-05-05T19:30:00Z,415.57,416.13,415.29,416.13,893586,7399963.5,4759995,0.64324574\n2021-05-06T13:30:00Z,415.85,416.3,413.68,416.3,1407909,1830448.5,1407909,0.769160673\n2021-05-06T14:30:00Z,414.3,416.09,414.2,416.09,848413,2947433,2256322,0.765521048\n2021-05-06T15:30:00Z,416.08,417.58,415.96,417.58,1025122,3715021,3281444,0.883290835\n2021-05-06T16:30:00Z,417.56,417.56,416.41,417.56,694701,4404234.5,3976145,0.902800475\n2021-05-06T17:30:00Z,416.71,416.96,415.74,416.96,782978,5094719,4759123,0.934128654\n2021-05-06T18:30:00Z,415.94,417.19,415.66,417.19,1002751,5915014,5761874,0.974109951\n2021-05-06T19:30:00Z,417.04,419.21,416.95,419.21,1447208,7291979.5,7209082,0.988631688\n2021-05-07T13:30:00Z,419.89,422.67,419.17,422.67,1738027,1338872.5,1738027,1.298127342\n2021-05-07T14:30:00Z,422.14,422.59,421.78,422.59,657624,2072869,2395651,1.15571751\n2021-05-07T15:30:00Z,422.34,422.81,421.97,422.81,567619,2779136.5,2963270,1.066255652\n2021-05-07T16:30:00Z,422.03,422.26,421.45,422.26,489082,3374612.5,3452352,1.023036571\n2021-05-07T17:30:00Z,421.51,422.28,421.21,422.28,515714,3965307,3968066,1.000695785\n2021-05-07T18:30:00Z,422.27,422.79,421.61,422.79,617771,4814141.5,4585837,0.95257628\n2021-05-07T19:30:00Z,422.56,422.79,422.01,422.79,966864,5984538.5,5552701,0.927841136\n2021-05-10T13:30:00Z,422.5,422.74,421.67,422.74,913621,1572968,913621,0.580826183\n2021-05-10T14:30:00Z,421.68,422.38,421.04,422.38,845776,2325986.5,1759397,0.756408947\n2021-05-10T15:30:00Z,422.22,422.65,421.94,422.65,549848,3122357,2309245,0.73958391\n2021-05-10T16:30:00Z,422.12,422.23,421.63,422.23,416262,3714248.5,2725507,0.733797698\n2021-05-10T17:30:00Z,421.72,421.79,419.49,421.79,1064633,4363594.5,3790140,0.868582083\n2021-05-10T18:30:00Z,419.73,419.88,418.74,419.88,1332289,5173855.5,5122429,0.990060314\n2021-05-10T19:30:00Z,419.43,419.8,417.82,419.8,1622035,6380891.5,6744464,1.056978323\n2021-05-11T13:30:00Z,413.1,415.27,411.82,415.27,3018877,1325824,3018877,2.276981711\n2021-05-11T14:30:00Z,411.87,413.9,410.08,413.9,2131025,2077524,5149902,2.478865226\n2021-05-11T15:30:00Z,413.86,414.43,413.11,414.43,1226820,2636257.5,6376722,2.418854\n2021-05-11T16:30:00Z,413.435,414.18,412.05,414.18,1063244,3088929.5,7439966,2.408590419\n2021-05-11T17:30:00Z,414.17,414.77,413.21,414.77,1042602,3879103,8482568,2.186734407\n2021-05-11T18:30:00Z,414.71,415.03,413.14,415.03,1283027,4854133,9765595,2.011810348\n2021-05-11T19:30:00Z,414.44,414.58,412.66,414.58,1732330,6148582.5,11497925,1.870012316\n2021-05-12T13:30:00Z,411.23,412.59,410.34,412.59,2392630,1966249,2392630,1.216849951\n2021-05-12T14:30:00Z,410.36,410.72,408.74,410.72,1800944,3454649.5,4193574,1.213892755\n2021-05-12T15:30:00Z,409.51,409.775,406.72,409.775,1535378,4342983.5,5728952,1.319128198\n2021-05-12T16:30:00Z,407.675,408.6,407.01,408.6,1552559,5082736.5,7281511,1.432596594\n2021-05-12T17:30:00Z,407.47,407.89,406.42,407.89,1232309,6136354,8513820,1.387439512\n2021-05-12T18:30:00Z,406.68,408.25,405.4,408.25,1855387,7444012,10369207,1.392959469\n2021-05-12T19:30:00Z,405.73,406.55,404.8,406.55,3015101,9121194.5,13384308,1.467385439\n2021-05-13T13:30:00Z,407.07,411.44,407.06,411.44,2340084,2705753.5,2340084,0.864854836\n2021-05-13T14:30:00Z,411.24,412.01,409.67,412.01,1370067,4671738,3710151,0.794169322\n2021-05-13T15:30:00Z,409.85,410.82,409.22,410.82,993863,6052837,4704014,0.777158546\n2021-05-13T16:30:00Z,410.75,411.13,408.64,411.13,1127312,7360738.5,5831326,0.792220237\n2021-05-13T17:30:00Z,409.06,411.18,407.84,411.18,1445553,8498194,7276879,0.856285347\n2021-05-13T18:30:00Z,411.14,411.89,410.76,411.89,1392213,10067401,8669092,0.861105264\n2021-05-13T19:30:00Z,411.61,412.34,410.21,412.34,1724024,12441116.5,10393116,0.835384509\n2021-05-14T13:30:00Z,413.21,415.22,413.2,415.22,1519811,2366357,1519811,0.642257698\n2021-05-14T14:30:00Z,414.45,415.67,414.08,415.67,833960,3951862.5,2353771,0.595610551\n2021-05-14T15:30:00Z,415.5,416.02,415.28,416.02,481022,5216483,2834793,0.543429932\n2021-05-14T16:30:00Z,415.91,416.44,415.79,416.44,331719,6556418.5,3166512,0.482963679\n2021-05-14T17:30:00Z,416.39,416.95,416.16,416.95,503571,7895349.5,3670083,0.464841107\n2021-05-14T18:30:00Z,416.75,417.49,416.72,417.49,719634,9519149.5,4389717,0.461145925\n2021-05-14T19:30:00Z,417.03,417.37,416.31,417.37,2019740,11888712,6409457,0.539121227\n2021-05-17T13:30:00Z,415.39,416.38,414.16,416.38,1653633,1929947.5,1653633,0.856827971\n2021-05-17T14:30:00Z,414.34,415.41,413.83,415.41,1113426,3031961,2767059,0.912630143\n2021-05-17T15:30:00Z,414.2,414.79,413.85,414.79,641231,3769403.5,3408290,0.904198768\n2021-05-17T16:30:00Z,414.68,415.12,413.72,415.12,441142,4498919,3849432,0.855634876\n2021-05-17T17:30:00Z,414.025,414.64,413.36,414.64,560435,5473481,4409867,0.80567869\n2021-05-17T18:30:00Z,414.56,415.69,414.16,415.69,713954,6529404.5,5123821,0.784730215\n2021-05-17T19:30:00Z,414.96,415.63,414.77,415.63,804740,8401286.5,5928561,0.705672994\n2021-05-18T13:30:00Z,415.8,416.06,414.47,416.06,1155098,1586722,1155098,0.727977554\n2021-05-18T14:30:00Z,415.77,415.98,415.29,415.98,567000,2560415,1722098,0.672585499\n2021-05-18T15:30:00Z,415.54,415.58,414.76,415.58,411543,3121541.5,2133641,0.683521587\n2021-05-18T16:30:00Z,415.41,415.57,414.97,415.57,261799,3507972,2395440,0.682856078\n2021-05-18T17:30:00Z,415.55,415.58,414.34,415.58,351317,4039975,2746757,0.679894554\n2021-05-18T18:30:00Z,414.4,414.5,413.11,414.5,774217,4756769,3520974,0.740202856\n2021-05-18T19:30:00Z,414.28,414.585,411.77,414.585,1255110,6169009,4776084,0.774206035\n2021-05-19T13:30:00Z,406.92,407.64,405.34,407.64,2868676,1404365.5,2868676,2.042684757\n2021-05-19T14:30:00Z,406.92,408.33,405.38,408.33,1479734,2244578.5,4348410,1.937294686\n2021-05-19T15:30:00Z,408.09,409.28,407.24,409.28,964347,2770965.5,5312757,1.917294531\n2021-05-19T16:30:00Z,408.95,410.24,408.75,410.24,648685,3122436,5961442,1.909227923\n2021-05-19T17:30:00Z,409.85,410.51,407.6,410.51,1159445,3578312,7120887,1.990012889\n2021-05-19T18:30:00Z,410.04,410.55,407.6,410.55,1219814,4322397.5,8340701,1.929646915\n2021-05-19T19:30:00Z,409.95,411.05,408.67,411.05,1960612,5352322.5,10301313,1.924643554\n2021-05-20T13:30:00Z,411.81,413.69,411.67,413.69,1367317,2011887,1367317,0.679619183\n2021-05-20T14:30:00Z,413.66,414.87,413.39,414.87,677483,3035254,2044800,0.673683323\n2021-05-20T15:30:00Z,414.87,416.14,414.66,416.14,814102,3723199,2858902,0.767861723\n2021-05-20T16:30:00Z,414.71,415.48,414.11,415.48,674116,4178441,3533018,0.845534973\n2021-05-20T17:30:00Z,415.41,415.57,414.57,415.57,501200,4933822,4034218,0.817665899\n2021-05-20T18:30:00Z,415.58,416.61,415.23,416.61,812942,5930837.5,4847160,0.817280865\n2021-05-20T19:30:00Z,416.59,416.6,414.92,416.6,1745756,7538698.5,6592916,0.874543\n2021-05-21T13:30:00Z,416.89,418.2,416.78,418.2,1351177,2117996.5,1351177,0.637950535\n2021-05-21T14:30:00Z,416.78,417.33,416.23,417.33,735161,3196605,2086338,0.65267307\n2021-05-21T15:30:00Z,416.27,416.75,415.12,416.75,737485,4085829.5,2823823,0.691126\n2021-05-21T16:30:00Z,415.49,415.68,414.45,415.68,610403,4747230,3434226,0.723416814\n2021-05-21T17:30:00Z,415.42,416.19,415.35,416.19,395883,5577552.5,3830109,0.686700663\n2021-05-21T18:30:00Z,415.45,416.24,414.97,416.24,737694,6593930.5,4567803,0.692728411\n2021-05-21T19:30:00Z,416.01,416.01,414.7,416.01,1161952,8447114.5,5729755,0.678309143\n2021-05-24T13:30:00Z,417.34,419.27,417.08,419.27,974030,1359247,974030,0.716595291\n2021-05-24T14:30:00Z,419.01,419.59,419,419.59,399861,2065569,1373891,0.665139243\n2021-05-24T15:30:00Z,419.55,419.68,418.92,419.68,254199,2841362.5,1628090,0.57299623\n2021-05-24T16:30:00Z,418.98,419.62,418.98,419.62,234402,3483622,1862492,0.534642392\n2021-05-24T17:30:00Z,419.62,420.18,419.6,420.18,346390,3932163.5,2208882,0.561747242\n2021-05-24T18:30:00Z,420.07,420.31,419.87,420.31,564756,4707481.5,2773638,0.589197855\n2021-05-24T19:30:00Z,419.94,419.99,418.95,419.99,1245310,6161335.5,4018948,0.652285207\n2021-05-25T13:30:00Z,420.33,420.7,419.18,420.7,1124625,1162603.5,1124625,0.967333231\n2021-05-25T14:30:00Z,419.46,419.595,418.43,419.595,622823,1730114.5,1747448,1.010018701\n2021-05-25T15:30:00Z,418.53,419.42,417.95,419.42,559663,2225956.5,2307111,1.03645826\n2021-05-25T16:30:00Z,419.28,419.44,418.39,419.44,323693,2648359,2630804,0.993371367\n2021-05-25T17:30:00Z,419.1,419.19,418.24,419.19,371220,3019495.5,3002024,0.994213768\n2021-05-25T18:30:00Z,418.31,418.75,417.8,418.75,583171,3670720.5,3585195,0.976700623\n2021-05-25T19:30:00Z,418.445,418.49,417.62,418.49,947336,4874351.5,4532531,0.929873646\n2021-05-26T13:30:00Z,418.87,419.18,417.76,419.18,669323,1049327.5,669323,0.63785901\n2021-05-26T14:30:00Z,418.76,419.35,418.56,419.35,376354,1560669.5,1045677,0.67001822\n2021-05-26T15:30:00Z,418.95,419.45,418.7,419.45,284566,1967600.5,1330243,0.676073725\n2021-05-26T16:30:00Z,419.32,419.61,419.05,419.61,205013,2246648,1535256,0.683354046\n2021-05-26T17:30:00Z,419.26,419.27,418.44,419.27,474517,2605453,2009773,0.771371811\n2021-05-26T18:30:00Z,419.09,419.16,418.63,419.16,613327,3179416.5,2623100,0.825025598\n2021-05-26T19:30:00Z,418.95,419.1,418.56,419.1,798180,4275739.5,3421280,0.800161001\n2021-05-27T13:30:00Z,420.17,420.63,419.79,420.63,799607,896974,799607,0.891449473\n2021-05-27T14:30:00Z,420.34,420.7,419.78,420.7,483951,1396562.5,1283558,0.919083822\n2021-05-27T15:30:00Z,419.74,420.42,419.46,420.42,330375,1818677,1613933,0.887421461\n2021-05-27T16:30:00Z,420.305,420.38,419.89,420.38,218346,2083030,1832279,0.879621993\n2021-05-27T17:30:00Z,419.91,419.97,419.2,419.97,454291,2505898.5,2286570,0.912475106\n2021-05-27T18:30:00Z,419.57,419.71,419.12,419.71,736986,3104147.5,3023556,0.974037477\n2021-05-27T19:30:00Z,419.45,420.1,419.16,420.1,1252399,3976905.5,4275955,1.075196532\n2021-05-28T13:30:00Z,420.97,421.08,419.97,421.08,675847,734465,675847,0.920189526\n2021-05-28T14:30:00Z,420.12,420.78,420.11,420.78,364439,1164617.5,1040286,0.893242631\n2021-05-28T15:30:00Z,420.72,421.25,420.67,421.25,288711,1472088,1328997,0.902797251\n2021-05-28T16:30:00Z,421.12,421.21,420.54,421.21,310001,1683767.5,1638998,0.973411115\n2021-05-28T17:30:00Z,420.65,420.83,420.47,420.83,319719,2148171.5,1958717,0.911806623\n2021-05-28T18:30:00Z,420.8,420.91,420.43,420.91,449763,2823328,2408480,0.853064185\n2021-05-28T19:30:00Z,420.65,420.95,419.79,420.95,1372916,3848617.5,3781396,0.982533598\n2021-06-01T13:30:00Z,422.56,422.72,419.91,422.72,1118179,737727,1118179,1.515708385\n2021-06-01T14:30:00Z,420.44,420.69,419.45,420.69,680893,1161922,1799072,1.548358668\n2021-06-01T15:30:00Z,420.21,420.47,419.74,420.47,334339,1471465,2133411,1.449855076\n2021-06-01T16:30:00Z,420.02,420.23,419.2,420.23,267785,1735638.5,2401196,1.383465509\n2021-06-01T17:30:00Z,419.32,420.04,419.25,420.04,304649,2122643.5,2705845,1.274752449\n2021-06-01T18:30:00Z,420.04,420.37,419.86,420.37,453791,2716018,3159636,1.163333969\n2021-06-01T19:30:00Z,419.86,420,419.45,420,659154,4028675.5,3818790,0.947902108\n2021-06-02T13:30:00Z,420.38,420.97,419.55,420.97,628835,897013,628835,0.701032204\n2021-06-02T14:30:00Z,420.85,421.23,420.49,421.23,381397,1419679,1010232,0.711591846\n2021-06-02T15:30:00Z,421.1,421.18,420.28,421.18,223045,1731204,1233277,0.712381094\n2021-06-02T16:30:00Z,420.41,420.53,419.6,420.53,306008,2020097,1539285,0.761985687\n2021-06-02T17:30:00Z,419.79,420.03,419.3,420.03,371803,2332281,1911088,0.819407267\n2021-06-02T18:30:00Z,419.78,420.05,419.67,420.05,335793,2784058,2246881,0.807052511\n2021-06-02T19:30:00Z,419.74,420.47,419.59,420.47,997552,3800093,3244433,0.853777263\n2021-06-03T13:30:00Z,417.86,418.21,416.28,418.21,1208605,873507,1208605,1.383623715\n2021-06-03T14:30:00Z,417.63,419.99,417.27,419.99,987370,1404652,2195975,1.563358754\n2021-06-03T15:30:00Z,419.64,419.76,418.93,419.76,368635,1683344,2564610,1.523521039\n2021-06-03T16:30:00Z,419.3,419.86,418.89,419.86,389665,1970240.5,2954275,1.499448925\n2021-06-03T17:30:00Z,419.79,419.89,419.01,419.89,296514,2308466.5,3250789,1.408202805\n2021-06-03T18:30:00Z,419.04,419.27,418.74,419.27,396537,2703258.5,3647326,1.349233157\n2021-06-03T19:30:00Z,419.205,419.44,418.73,419.44,519210,3531611.5,4166536,1.179783224\n2021-06-04T13:30:00Z,420.75,421.645,420.68,421.645,787063,918720,787063,0.856695185\n2021-06-04T14:30:00Z,421.37,422.02,421.32,422.02,401510,1603103.5,1188573,0.741420002\n2021-06-04T15:30:00Z,421.88,421.9,421.46,421.9,209393,1898943.5,1397966,0.736180934\n2021-06-04T16:30:00Z,421.62,422.02,421.62,422.02,148480,2246780,1546446,0.688294359\n2021-06-04T17:30:00Z,421.83,422.41,421.83,422.41,300871,2580938.5,1847317,0.715753979\n2021-06-04T18:30:00Z,422.43,422.64,422.34,422.64,322334,2947103.5,2169651,0.736197762\n2021-06-04T19:30:00Z,422.47,422.91,422.36,422.91,963371,3705484.5,3133022,0.845509406\n2021-06-07T13:30:00Z,422.59,422.78,421.48,422.78,603105,997834,603105,0.604414161\n2021-06-07T14:30:00Z,421.64,421.9,421.29,421.9,421980,1692274,1025085,0.605744105\n2021-06-07T15:30:00Z,421.47,421.81,421.24,421.81,343163,1981288,1368248,0.690585114\n2021-06-07T16:30:00Z,421.56,421.8,421.39,421.8,177776,2250360.5,1546024,0.687011703\n2021-06-07T17:30:00Z,421.51,421.64,421.2,421.64,286991,2549053,1833015,0.719096464\n2021-06-07T18:30:00Z,421.5,422.235,421.435,422.235,307950,2908488.5,2140965,0.736109151\n2021-06-07T19:30:00Z,422.21,422.39,421.81,422.39,848627,3649779,2989592,0.819115897\n2021-06-08T13:30:00Z,423.12,423.2,421.55,423.2,716922,695084,716922,1.031417785\n2021-06-08T14:30:00Z,421.85,422.23,420.33,422.23,661815,1106829,1378737,1.245663964\n2021-06-08T15:30:00Z,420.93,422.48,420.89,422.48,489552,1383107,1868289,1.35079137\n2021-06-08T16:30:00Z,422.44,422.64,422.23,422.64,239714,1546235,2108003,1.363313468\n2021-06-08T17:30:00Z,422.22,422.655,422.15,422.655,224422,1840166,2332425,1.267507931\n2021-06-08T18:30:00Z,422.58,422.94,422.375,422.94,280193,2155308,2612618,1.212178491\n2021-06-08T19:30:00Z,422.69,422.78,422.25,422.78,688752,3061307,3301370,1.078418466\n2021-06-09T13:30:00Z,423.18,423.26,422.33,423.26,683728,660013.5,683728,1.035930326\n2021-06-09T14:30:00Z,422.9,423.12,422.7,423.12,297560,1201911,981288,0.81643982\n2021-06-09T15:30:00Z,422.95,422.95,422.22,422.95,231587,1618268.5,1212875,0.749489346\n2021-06-09T16:30:00Z,422.64,422.97,422.63,422.97,184156,1827013.5,1397031,0.764652806\n2021-06-09T17:30:00Z,422.84,422.89,422.53,422.89,300198,2082720,1697229,0.814909829\n2021-06-09T18:30:00Z,422.8,422.88,421.82,422.88,484199,2376791.5,2181428,0.917803686\n2021-06-09T19:30:00Z,421.83,422.05,421.41,422.05,863268,3145481,3044696,0.967958795\n2021-06-10T13:30:00Z,422.96,424.62,422.94,424.62,822691,700325,822691,1.174727448\n2021-06-10T14:30:00Z,423.76,423.9,421.55,423.9,718744,1180012.5,1541435,1.30628701\n2021-06-10T15:30:00Z,423.21,423.59,422.88,423.59,308377,1540582,1849812,1.200722844\n2021-06-10T16:30:00Z,423.27,424.05,423.27,424.05,204553,1752517,2054365,1.172236846\n2021-06-10T17:30:00Z,423.745,424.1,423.53,424.1,221645,2014827,2276010,1.129630484\n2021-06-10T18:30:00Z,423.68,423.85,423.35,423.85,321957,2397023,2597967,1.083830652\n2021-06-10T19:30:00Z,423.5,423.73,423.18,423.73,772193,3173033,3370160,1.062125733\n2021-06-11T13:30:00Z,424.2,424.41,423.44,424.41,591668,753209.5,591668,0.785529126\n2021-06-11T14:30:00Z,423.65,423.68,423.03,423.68,456508,1261361.5,1048176,0.830987786\n2021-06-11T15:30:00Z,423.52,423.61,422.97,423.61,244156,1531343.5,1292332,0.843920388\n2021-06-11T16:30:00Z,422.99,423.3,422.82,423.3,175851,1725698,1468183,0.850776324\n2021-06-11T17:30:00Z,423.23,423.76,423.23,423.76,182305,1986619.5,1650488,0.830802275\n2021-06-11T18:30:00Z,423.75,423.85,423.48,423.85,218270,2389697.5,1868758,0.782006091\n2021-06-11T19:30:00Z,423.53,424.41,423.41,424.41,920851,3207428,2789609,0.869733943\n2021-06-14T13:30:00Z,424.43,424.45,423.36,424.45,477912,707179.5,477912,0.675800133\n2021-06-14T14:30:00Z,423.52,423.99,423.24,423.99,313790,1294805.5,791702,0.611444731\n2021-06-14T15:30:00Z,423.51,423.59,423.23,423.59,245689,1571072,1037391,0.660307739\n2021-06-14T16:30:00Z,423.38,423.4,423.1,423.4,203084,1761274,1240475,0.70430552\n2021-06-14T17:30:00Z,423.4,423.52,423.19,423.52,186446,1963249,1426921,0.726816109\n2021-06-14T18:30:00Z,423.16,423.74,423.16,423.74,348642,2233362.5,1775563,0.795017826\n2021-06-14T19:30:00Z,423.72,425.29,423.69,425.29,758621,3079884.5,2534184,0.822817869\n2021-06-15T13:30:00Z,425.43,425.45,424.25,425.45,509664,534790,509664,0.953017072\n2021-06-15T14:30:00Z,424.39,424.47,423.91,424.47,341523,919939,851187,0.92526461\n2021-06-15T15:30:00Z,424.13,424.44,423.55,424.44,211465,1164861.5,1062652,0.912256092\n2021-06-15T16:30:00Z,424.41,424.48,423.94,424.48,199612,1354329,1262264,0.932021687\n2021-06-15T17:30:00Z,424.09,425,424.06,425,294305,1538704.5,1556569,1.011610091\n2021-06-15T18:30:00Z,424.62,424.99,424.28,424.99,417579,1822160.5,1974148,1.0834106\n2021-06-15T19:30:00Z,424.43,424.96,424.03,424.96,1062992,2661896.5,3037140,1.140968479\n2021-06-16T13:30:00Z,424.65,424.83,424.13,424.83,478777,493788,478777,0.969600314\n2021-06-16T14:30:00Z,424.3,424.57,424.05,424.57,215585,821444.5,694362,0.84529387\n2021-06-16T15:30:00Z,424.5,424.52,423.27,424.52,210810,1050021.5,905172,0.86205092\n2021-06-16T16:30:00Z,423.51,423.64,423,423.64,248972,1251369.5,1154144,0.922304723\n2021-06-16T17:30:00Z,423.09,423.46,419.93,423.46,1825780,1491745,2979924,1.997609511\n2021-06-16T18:30:00Z,421.54,423.59,419.97,423.59,1818089,1874855.5,4798013,2.559137491\n2021-06-16T19:30:00Z,422.99,423.58,421.94,423.58,1224173,2785662,6022186,2.161850935\n2021-06-17T13:30:00Z,421.67,422.89,421.1,422.89,1074141,494220.5,1074141,2.173404381\n2021-06-17T14:30:00Z,422.01,422.93,421.28,422.93,636788,772774.5,1710929,2.214008097\n2021-06-17T15:30:00Z,422.12,422.62,419.41,422.62,666244,983912,2377173,2.416042288\n2021-06-17T16:30:00Z,419.61,422.25,419.33,422.25,608581,1208204,2985754,2.471233335\n2021-06-17T17:30:00Z,422.27,422.61,421.86,422.61,477810,2268246.5,3463564,1.52697866\n2021-06-17T18:30:00Z,422.24,422.73,421.59,422.73,493421,3386080.5,3956985,1.168603345\n2021-06-17T19:30:00Z,422.58,423,421.82,423,989345,4529663,4946330,1.091986313\n2021-06-18T13:30:00Z,417.16,417.82,416.12,417.82,1718559,776459,1718559,2.213328714\n2021-06-18T14:30:00Z,416.65,417.21,415.61,417.21,947862,1202645.5,2666421,2.217129653\n2021-06-18T15:30:00Z,415.65,417.26,415.59,417.26,414029,1641172.5,3080450,1.876981244\n2021-06-18T16:30:00Z,417.25,417.255,416.31,417.255,344321,2069949,3424771,1.654519507\n2021-06-18T17:30:00Z,416.49,417.12,416.07,417.12,324262,3221744,3749033,1.163665704\n2021-06-18T18:30:00Z,416.77,416.94,415.61,416.94,718509,4377499,4467542,1.020569508\n2021-06-18T19:30:00Z,416.55,416.93,414.71,416.93,1416235,5484258,5883777,1.072848323\n2021-06-21T13:30:00Z,416.8,419.21,415.93,419.21,1032321,1396350,1032321,0.739299603\n2021-06-21T14:30:00Z,419.08,420.25,419.07,420.25,458238,2188675,1490559,0.681032588\n2021-06-21T15:30:00Z,419.87,420.38,419.82,420.38,270879,2728811.5,1761438,0.6454964\n2021-06-21T16:30:00Z,420.02,420.21,419.81,420.21,186342,3205262.5,1947780,0.607681898\n2021-06-21T17:30:00Z,420.14,420.98,420.14,420.98,326395,3606298.5,2274175,0.63061197\n2021-06-21T18:30:00Z,420.58,420.94,420.32,420.94,393682,4212263.5,2667857,0.633354727\n2021-06-21T19:30:00Z,420.62,421.06,420.36,421.06,913294,5415053.5,3581151,0.661332524\n2021-06-22T13:30:00Z,420.85,421.35,420.08,421.35,766795,1375440,766795,0.557490694\n2021-06-22T14:30:00Z,421.26,422.63,421.22,422.63,395509,2078490,1162304,0.559205962\n2021-06-22T15:30:00Z,422.44,422.54,421.98,422.54,240031,2420944,1402335,0.579251317\n2021-06-22T16:30:00Z,422.46,422.53,422.14,422.53,204090,2686275.5,1606425,0.598012006\n2021-06-22T17:30:00Z,422.42,422.62,422.24,422.62,347499,3011604,1953924,0.648798448\n2021-06-22T18:30:00Z,422.46,424,422.44,424,580761,3567699.5,2534685,0.710453613\n2021-06-22T19:30:00Z,423.84,423.96,422.99,423.96,890177,4732464,3424862,0.72369531\n2021-06-23T13:30:00Z,423.16,424.05,423.05,424.05,580039,899558,580039,0.644804448\n2021-06-23T14:30:00Z,423.67,423.71,422.98,423.71,285716,1326431.5,865755,0.652694843\n2021-06-23T15:30:00Z,423.22,423.45,422.93,423.45,147066,1581886.5,1012821,0.640261485\n2021-06-23T16:30:00Z,423.38,423.59,422.7,423.59,207847,1777102.5,1220668,0.68688666\n2021-06-23T17:30:00Z,423.54,423.6,423.22,423.6,194668,2114049.5,1415336,0.669490473\n2021-06-23T18:30:00Z,423.25,423.82,423.19,423.82,180320,2601271,1595656,0.613413981\n2021-06-23T19:30:00Z,423.7,423.73,422.51,423.73,725807,3503006.5,2321463,0.662705879\n2021-06-24T13:30:00Z,424.89,425.47,424.73,425.47,507570,673417,507570,0.753723176\n2021-06-24T14:30:00Z,425.48,425.52,424.8,425.52,255427,1014029.5,762997,0.752440634\n2021-06-24T15:30:00Z,424.99,425.16,424.62,425.16,181306,1207578,944303,0.781980957\n2021-06-24T16:30:00Z,424.98,425.52,424.88,425.52,223794,1413546.5,1168097,0.82635909\n2021-06-24T17:30:00Z,425.01,425.46,424.78,425.46,226293,1684630,1394390,0.82771291\n2021-06-24T18:30:00Z,425.42,425.55,424.97,425.55,284483,2065170.5,1678873,0.812946437\n2021-06-24T19:30:00Z,425.02,425.35,424.86,425.35,659044,2873162.5,2337917,0.813708588\n2021-06-25T13:30:00Z,426,426.48,425.55,426.48,506206,543804.5,506206,0.930860263\n2021-06-25T14:30:00Z,426.35,426.44,425.86,426.44,246732,814376,752938,0.924558189\n2021-06-25T15:30:00Z,426.31,426.38,426.09,426.38,148414,978562,901352,0.92109851\n2021-06-25T16:30:00Z,426.11,426.34,426.05,426.34,134960,1194382.5,1036312,0.867655044\n2021-06-25T17:30:00Z,426.16,426.44,425.96,426.44,234225,1404863,1270537,0.904384983\n2021-06-25T18:30:00Z,426.36,426.95,426.32,426.95,535719,1637264.5,1806256,1.10321576\n2021-06-25T19:30:00Z,426.59,427.09,426.41,427.09,1477438,2329690,3283694,1.409498259\n2021-06-28T13:30:00Z,427.17,427.24,426.03,427.24,492353,506888,492353,0.971325026\n2021-06-28T14:30:00Z,426.65,426.86,426.2,426.86,240548,757967.5,732901,0.966929321\n2021-06-28T15:30:00Z,426.26,426.65,426.15,426.65,140507,922827.5,873408,0.946447738\n2021-06-28T16:30:00Z,426.36,426.42,425.89,426.42,137138,1102204.5,1010546,0.91684075\n2021-06-28T17:30:00Z,425.95,426.75,425.89,426.75,171462,1332463.5,1182008,0.887084712\n2021-06-28T18:30:00Z,426.73,427.29,426.68,427.29,322888,1742564.5,1504896,0.863609927\n2021-06-28T19:30:00Z,427.2,427.64,427.1,427.64,701417,2810805.5,2206313,0.784939762\n2021-06-29T13:30:00Z,427.88,428.4,427.88,428.4,447895,499279.5,447895,0.897082696\n2021-06-29T14:30:00Z,428.2,428.55,427.98,428.55,282388,742919.5,730283,0.982990755\n2021-06-29T15:30:00Z,428.2,428.21,427.85,428.21,184451,887380,914734,1.030825576\n2021-06-29T16:30:00Z,428.05,428.06,427.74,428.06,113921,1023429,1028655,1.005106363\n2021-06-29T17:30:00Z,427.74,428.06,427.61,428.06,159705,1226272.5,1188360,0.969083136\n2021-06-29T18:30:00Z,427.66,427.75,427.15,427.75,281284,1655576,1469644,0.887693467\n2021-06-29T19:30:00Z,427.69,427.8,427.48,427.8,434845,2745003.5,1904489,0.69380203\n2021-06-30T13:30:00Z,427.21,428.02,427.21,428.02,560695,470124,560695,1.192653428\n2021-06-30T14:30:00Z,427.92,428.38,427.805,428.38,329304,731592,889999,1.216523691\n2021-06-30T15:30:00Z,427.96,428.11,427.78,428.11,197724,894071,1087723,1.216595774\n2021-06-30T16:30:00Z,427.81,428.18,427.73,428.18,241868,1019600.5,1329591,1.304031334\n2021-06-30T17:30:00Z,427.87,427.95,427.58,427.95,224972,1185184,1554563,1.311663843\n2021-06-30T18:30:00Z,427.88,428.21,427.8,428.21,283404,1487270,1837967,1.235799149\n2021-06-30T19:30:00Z,428.15,428.76,427.97,428.76,963398,2055401,2801365,1.362928694\n2021-07-01T13:30:00Z,428.86,429.64,428.81,429.64,555471,504295,555471,1.101480284\n2021-07-01T14:30:00Z,429.39,429.73,428.87,429.73,386303,810141,941774,1.162481593\n2021-07-01T15:30:00Z,429.32,429.66,429.28,429.66,142629,1001228.5,1084403,1.083072446\n2021-07-01T16:30:00Z,429.54,429.78,429.41,429.78,146352,1179123,1230755,1.043788477\n2021-07-01T17:30:00Z,429.75,430.205,429.71,430.205,214434,1371461.5,1445189,1.053758345\n2021-07-01T18:30:00Z,430.18,430.52,430.16,430.52,280918,1653805.5,1726107,1.043718261\n2021-07-01T19:30:00Z,430.28,430.59,430.05,430.59,776363,2352927,2502470,1.063556158\n2021-07-02T13:30:00Z,431.67,431.95,431.33,431.95,468790,558083,468790,0.840000502\n2021-07-02T14:30:00Z,431.87,432.13,431.74,432.13,224782,915886.5,693572,0.757268504\n2021-07-02T15:30:00Z,432.11,432.62,432.04,432.62,195550,1086063,889122,0.818665216\n2021-07-02T16:30:00Z,432.49,433.48,432.47,433.48,282177,1280173,1171299,0.914953682\n2021-07-02T17:30:00Z,433.15,433.56,433.03,433.56,195225,1499876,1366524,0.911091317\n2021-07-02T18:30:00Z,433.54,433.66,433.185,433.66,281637,1782037,1648161,0.924874736\n2021-07-02T19:30:00Z,433.6,434.1,433.44,434.1,965555,2651917.5,2613716,0.985594763"
  },
  {
    "path": "Tests/TestData/spy_rocr.txt",
    "content": "Date,Open,High,Low,Close,Volume,ROCR_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,1.00144841661729\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,1.02630872483221\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,1.02846287161712\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,1.01704956882365\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,1.0209089110217\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,1.02189205180462\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,1.02033743133665\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,1.00900900900901\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,1.00906148867314\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,1.01259852694147\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,1.00250900669068\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.993206434660001\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.993126927029805\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.998652982681206\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0.984878453391182\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0.998524032599628\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.999870942763115\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,1.01021926136731\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,1.00321151005203\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,1.01496501684374\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,1.00289203084833\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,1.01206840916425\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.993853639797682\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.997887188680453\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.990361907193464\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,1.00102531239987\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.999553628363729\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,1.02216066481994\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,1.02136532785833\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,1.02345965455014\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,0.993022213686704\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,1.00421052631579\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.977563496565198\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,0.968276901815441\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0.979093198992443\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,1.00676895306859\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,1.00235054952036\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,1.01785829411385\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1.02841572596341\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,1.01775147928994\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,1.02004226163796\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,1.01204208391431\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,1.00253356979985\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,1.00775927327782\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,1.01978008088979\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,1.01556811048336\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,1.01828657314629\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,1.03196866312863\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1.019593114241\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,1.01264175497304\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,1.0108789714427\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1.01617466174662\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1.01701971348108\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1.01510314341847\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1.02160210513432\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,1.02072887367005\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1.01174120922351\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,0.998856248495064\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1.0006652957542\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.99023601293878\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,0.996225962978494\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,0.98833522761261\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0.999397336226119\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,0.987911755817467\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0.994192728812534\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,0.983523752254961\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,0.976092482750272\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0.981306156907676\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,1.00825940654634\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,1.00273805902038\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,0.997187576424554\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,1.00297637502325\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,1.00909481963989\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.990169902912621\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0.997815533980582\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1.01618638871858\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1.01051004636785\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,0.970708239449485\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,0.974813089839441\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,0.955120408659694\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0.956739471461325\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0.979749158764148\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,1.01053952321205\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,1.00848682969762\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,1.02737807207437\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,1.01664879863783\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1.00711877107531\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1.01204370499131\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,1.02200473756389\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,1.02336390679227\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,1.0246882947708\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1.03819444444444\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,1.02754263280579\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,1.0256175663312\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,1.01447344516442\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,1.01670803317392\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,1.00854037267081\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,1.00990985612799\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,1.00802854594112\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,1.00967048710602\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,1.00339386722239\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,1.00035530289572\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.999645327185671\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.994631268436578\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0.996748255882701\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1.00112746261571\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,1.01024092819511\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,1.01088049198746\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,1.01251557031852\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,1.00676196690195\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,1.00278584553376\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0.994960740653932\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.990406551623282\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.990685413005273\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.999292994756378\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.99739921976593\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0.979858657243816\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0.979445986651704\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0.974336230855656\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.976239608513649\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0.97522816166884\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.998076691910085\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,1.00476391485256\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,1.00746495114402\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,0.986411402343278\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0.996050072921731\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0.988618571600626\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0.982175009002521\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,0.990301204819277\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1.01481662891079\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,1.01250686352267\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1.0113906316623\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1.02432019553926\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1.02725226595292\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1.02202111613876\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1.01801638949144\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1.01981450252951\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1.01598759171986\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,1.01302777284302\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,1.021546635183\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1.02255105060669\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,1.00820882300833\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0.997768774587517\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.99099783714269\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,0.976827506501011\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0.982229682796944\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.989397844423618\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.988701229918202\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,0.998879254409249\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,1.00082820634169\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.987801284695621\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.99988159374815\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.996547824534254\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,0.977205621825912\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,0.978839106277338\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1.00924710655053\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,1.00811178873823\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,1.02096398494893\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,1.02550157118685\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,1.03907004830918\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1.02394041496719\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1.02425701867732\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,1.02024102024102\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,1.03364761343547\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1.01452897076771\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,1.01114190047339\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,1.0089454670566\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,1.01049311926605\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1.01003363548258\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,1.00985278111932\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,1.00365401084784\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,1.00147769252629\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,1.00340464166147\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.994920133205396\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,1.00499177491633\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.995107799078446\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,1.00612905056467\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,1.00277102301646\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,1.00391444942418\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,1.00682959869052\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,1.02480992396959\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,1.01556771391505\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,1.01184299571396\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,1.01169755877034\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,1.00050454086781\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,1.00357003402689\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,1.00422104970841\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,1.0067439527366\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,1.00921633245825\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,1.01484843391046\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,1.00605858484798\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.998451413085559\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.995128162542213\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.994742085454948\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.987963780918728\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.999668508287293\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,1.00481914363264\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,1.00556328233658\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.994380459578256\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0.995473343020007\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.984359456173317\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.987982359426681\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0.988381742738589\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,1.01667412712623\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,1.01886262841745\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,1.01937005221492\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,1.01846892087937\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,1.02395745871816\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,1.01183269124931\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,1.01300347126563\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,1.01244767569949\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,1.01183367117734\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.999945334280872\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.994723959749796\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.991895567038347\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.998150364486998\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.993665060371433\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,1.00393614694949\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,1.00688976377953\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.996271112085984\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,1.0010355352082\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,1.00621185701831\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,1.00424744064474\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.99723036819811\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,1.01376045794804\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,1.00343006479011\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.989873280623849\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,0.970014098253985\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,0.969394979033927\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0.972255402323814\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,0.962289744981009\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0.980524098692489\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,0.996031080552295\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,0.978428178192236\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0.979393533255152\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0.987707922187764\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0.990236009596608\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,1.00841845324952\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,1.0335304587472\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,1.03763256927814\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,1.03939030655934\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,1.03115844038765\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,1.02415405164737\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,1.02349869451697\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,1.00571491372678\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,1.01114955786236\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,1.00480848041091\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,1.00483643082274\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,1.00325662179766\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,1.00999890722325\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,1.00934274850625\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,1.01305128065691\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,1.00037856254394\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,1.01482363124865\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,1.01568839599675\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,1.01270046281348\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,1.01057491008642\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,1.01719104768083\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0.998134129438106\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.997496671105193\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.984057816983739\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0.980877509826835\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0.990274234693878\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,1.00229664049565\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,0.996689448953439\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,1.01387838859488\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,1.00833965125095\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.995169859925938\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.99280613876159\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,0.990946105218043\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,0.983115845539281\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,0.996186895810956\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,1.00852073558755\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,1.01041275293865\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,1.02113856301022\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,1.02194170549355\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,1.0049059248477\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.985722688626277\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.983266932270916\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0.990523083439221\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,0.970948417536977\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,0.973766094420601\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0.992405337962461\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0.995137763371151\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0.994815329520552\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,1.01769041769042\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,1.03046664095642\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,1.02705805182027\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,1.01764386536373\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,1.00918762088975\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.999463490530608\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.999144568006843\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.999254883176327\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,1.00458789010403\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,1.00260874194751\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,1.00950131515379\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,1.00824058219178\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.994833555259654\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.997716531251659\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.99660152931181\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.999468254812294\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,1.00727099034073\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,1.01702537744941\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,1.00628060464126\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.998508098891731\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,1.00047882528197\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.994467569418831\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.987313118551274\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,1.00037025282979\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,1.01168623265742\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,1.01223078968359\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,1.01472925717919\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,1.02042122100773\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,1.01713107386454\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,1.01629832797088\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,1.0133963750985\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,1.00668337510443\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1.00945762357613\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1.01081249675105\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,1.01401287108159\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,1.01389320891654\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,1.01452282157676\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,1.00895491485067\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.995320133710465\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.993602211075852\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.993404233561714\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,0.996063394683027\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,1.00687461522676\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,1.01519065826186\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,1.00932364910112\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,1.00818364300787\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.999332751629626\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.996535208397024\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.99470684039088\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.999387567622742\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.999183173371452\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,1.01196712891628\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,1.00843644544432\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,1.01412198117069\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,1.00863037483403\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,1.00265685673411\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,1.00045678323098\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.995487501901334\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.991977800201816\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,1.00045567313047\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,1.00504484304933\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,1.00426136363636\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.996791280431904\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,1.00559483240934\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.998684210526316\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,1.00491811590529\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,1.00343503738129\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,1.01502222676409\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,1.00005057913105\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,1.002331002331\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.993693239152371\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.991643173580346\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,0.972011074754593\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,0.9735990289298\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0.980232558139535\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,0.974917491749175\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0.975073611534166\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,0.989331399865348\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,1.00384415584416\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,0.999484243643303\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,1.00791625436175\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,1.01442182537616\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,1.0247605088206\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,1.01283378182571\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,1.01842200319934\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,1.02511238567664\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,1.02094025867378\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,1.01910502656314\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,1.01772940936031\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,1.01438994730442\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,1.00977871868542\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,1.00668610496682\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,1.00320802005013\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,1.00763090516592\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,1.00204795204795\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,1.00084859981031\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.99980024968789\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,1.00484660737484\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0.999402122465248\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0.993569612681322\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.99785536159601\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,1.0004495279956\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.990154641738352\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.99197367765093\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,1.00581978727674\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,1.00339881041635\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,1.00758861707439\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,1.0078842966906\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,1.00085435722183\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.987679569034318\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.994072229140722\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,0.972847091467644\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0.986048829098157\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0.991915641476274\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0.995000252512499\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,0.973892563640008\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0.990017316899256\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0.993026781202628\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,0.993672167662246\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,0.98091564308192\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,1.01178286596347\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,0.991562917995679\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,0.969570527172807\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,0.954760813082684\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,0.971230466728759\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0.948077705451587\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0.966431462073259\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0.989136139393303\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,1.01542073528627\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,1.03393713372403\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,1.03357828675642\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,1.04649165190315\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,1.04223483843583\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,1.03079348397267\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,1.0223630648735\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,1.02812808137423\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,1.02282870774124\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,1.02662526090719\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,1.02859910277325\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,1.01340658232952\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,1.02135177426682\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,1.01890861671181\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,1.00833085391253\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,1.01095306537146\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,1.01546725021137\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,1.00800632598596\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,1.0051193699237\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,1.00442608439068\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,1.00191195215217\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,1.00670976589284\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,1.00617768189841\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,1.00680738527842\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,1.01194672933803\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,1.01414101874052\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,1.00758939430795\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,1.01179222298022\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,1.00788014398288\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.995548674279079\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.999179774196661\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,1.00376611462508\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,1.00009632055481\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,1.003861003861\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,1.00413102643857\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.997006132599353\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,0.977247582856318\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0.983289993258211\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,0.965817307692308\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,0.965635738831615\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,0.95854119242505\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0.993256546564284\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,1.01268426465547\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,1.02802528747076\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,1.03989774948624\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,1.04971956950129\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,1.02963476881907\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,1.00802785569204\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,1.01065272128607\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,1.00062659661638\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.989362214199759\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,0.988737546325263\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,0.96776050662061\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,0.957359141433499\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0.974518304431599\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,1.00175148389608\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,0.994255950932191\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,1.00461035098156\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,1.01131017916125\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.992832781375117\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,0.966585721223895\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0.987172582619339\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,0.997039230199852\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,1.00494853523357\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,1.02608782236384\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,1.02989649281479\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,1.01894559341368\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,1.00341499628805\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0.985522946622021\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.980058224163028\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,0.973069229643362\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0.982818203942565\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,1.01035809411068\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,1.01958628959728\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,1.02044655676024\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,1.0305841062923\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1.01342115689382\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,1.00961726225347\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,1.01406449083603\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,1.0135843198137\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,1.0205789345658\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,1.02678004202707\n"
  },
  {
    "path": "Tests/TestData/spy_rvi.txt",
    "content": "Date,Open,High,Low,Close,Volume,\"Volume MA\",RVI,RVI_S\n\"2019/06/18 13:30:00\",291.39,293.57,290.99,292.4,85434823,67784978.8,0.15220211018037463,\n\"2019/06/19 13:30:00\",292.55,293.65,291.47,293.06,78674377,69376343.4,0.14135307964391708,\n\"2019/06/20 13:30:00\",296.04,296.3093,293.1255,295.86,116570017,72730720.65,0.10126262549413703,\n\"2019/06/21 13:30:00\",294.13,295.52,293.76,294,83309466,71959501.6,0.04248738655711323,\n\"2019/06/24 13:30:00\",294.23,294.58,293.47,293.64,47582730,71575233.35,-0.015672847394692935,\n\"2019/06/25 13:30:00\",293.7,293.73,290.64,290.76,82028656,72175198.35,-0.07134526195033382,\n\"2019/06/26 13:30:00\",291.75,292.31,290.345,290.47,51584902,69505797.1,-0.11528836149931332,\n\"2019/06/27 13:30:00\",291.31,292.06,290.89,291.5,40355239,68397370.05,-0.1491730586795767,\n\"2019/06/28 13:30:00\",292.58,293.55,292.01,293,59350929,67021777.4,-0.16946732527187935,\n\"2019/07/01 13:30:00\",296.68,296.92,294.33,295.66,79107474,66155753.5,-0.17572248912832295,\n\"2019/07/02 13:30:00\",295.61,296.49,294.68,296.43,61504544,65369386.25,-0.1814550623165708,\n\"2019/07/03 13:30:00\",297.18,298.82,297.02,298.8,40898896,63855845.2,-0.18448711766775655,\n\"2019/07/05 13:30:00\",297.44,298.64,296.01,298.46,51677326,62968192.45,-0.1686026887518619,\n\"2019/07/08 13:30:00\",297.01,298.2579,296.22,296.82,45841772,61546671.1,-0.13525392223780955,\n\"2019/07/09 13:30:00\",295.54,297.52,295.48,297.19,41101279,60561782.4,-0.08798774216569046,\n\"2019/07/10 13:30:00\",298.37,299.66,297.78,298.61,58595558,60559494.05,-0.01452911877554625,\n\"2019/07/11 13:30:00\",299.32,299.58,298.2,299.31,50889481,60749152.5,0.08671706517826108,\n\"2019/07/12 13:30:00\",299.85,300.73,299.51,300.65,40354410,60319615.2,0.1897105666893676,0.04101645288818447\n\"2019/07/15 13:30:00\",301.13,301.13,300.19,300.75,33910261,59398892.45,0.2486719857780745,0.13116635512296426\n\"2019/07/16 13:30:00\",300.65,300.88,299.44,299.71,40567964,59467005.2,0.26382098159131323,0.20455052528407644\n\"2019/07/17 13:30:00\",299.75,299.93,297.74,297.74,44102443,57400386.2,0.23730806512528987,0.24200076109223886\n\"2019/07/18 13:30:00\",297.19,299.25,296.7,298.83,51701687,56051751.7,0.18123146924719083,0.2386935914097453\n\"2019/07/19 13:30:00\",300.04,300.07,296.96,297.17,71081238,53777312.75,0.09099569720345568,0.1986492912566217\n\"2019/07/22 13:30:00\",297.61,298.5,297.04,297.9,43687404,51796209.65,-0.002637334655036688,0.12985417722859105\n\"2019/07/23 13:30:00\",299.14,300.03,298.22,300.03,44657973,51649971.8,-0.07118005652694373,0.04779468963618085\n\"2019/07/24 13:30:00\",299.19,301.44,299.09,301.44,47213232,49909200.6,-0.09387153010594568,-0.02508510254440847\n\"2019/07/25 13:30:00\",300.94,301,299.11,300,55394092,50099660.1,-0.07488866672726177,-0.06793819577467955\n\"2019/07/26 13:30:00\",300.76,302.23,300.62,302.01,45084077,50336102,-0.05697726259474461,-0.07761295213135054\n\"2019/07/29 13:30:00\",301.88,301.93,300.85,301.46,38126462,49274878.65,-0.046962290502798286,-0.06742761320879279\n\"2019/07/30 13:30:00\",299.91,301.17,299.49,300.72,45849045,47611957.2,-0.032138867405693376,-0.05248444005467349\n\"2019/07/31 13:30:00\",300.99,301.2,295.2,297.43,104245162,49748988.1,-0.01170361823127466,-0.0378138661071671\n\"2019/08/01 13:30:00\",297.6,300.87,293.96,294.84,142646576,54836372.1,-0.04076756514597638,-0.029235804487118457\n\"2019/08/02 13:30:00\",293.85,294.12,290.9,292.62,116749695,58089990.55,-0.0927499668038819,-0.038305200160679564\n\"2019/08/05 13:30:00\",288.09,288.21,281.72,283.82,178745449,64735174.4,-0.15201900237530114,-0.07179294741771539\n\"2019/08/06 13:30:00\",285.91,288.04,284.28,287.8,120711682,68715694.55,-0.18833450456781786,-0.11977333467869339\n\"2019/08/07 13:30:00\",284.4,288.82,282.04,287.97,140572265,72814529.9,-0.19165560961226819,-0.16085209838373135\n\"2019/08/08 13:30:00\",289.62,293.62,289.01,293.62,87713904,74655751.05,-0.15169642857142995,-0.17728260988448385\n\"2019/08/09 13:30:00\",292.58,293.24,289.65,291.62,93729958,77324528.45,-0.09358873797630449,-0.16143788648525312\n\"2019/08/12 13:30:00\",289.96,291.6052,287.02,288.07,65527632,78905397,-0.06688107650794536,-0.1248511698692804\n\"2019/08/13 13:30:00\",287.74,294.15,287.36,292.55,94792972,81616647.4,-0.056688039039306734,-0.08822068276320606\n\"2019/08/14 13:30:00\",288.07,288.74,283.76,283.9,135622053,86192627.9,-0.04565748121771264,-0.06439740838142022\n\"2019/08/15 13:30:00\",284.88,285.64,282.39,284.65,101929845,88704035.8,-0.018714221363629775,-0.04838105639760232\n\"2019/08/16 13:30:00\",286.48,289.33,284.7138,288.85,85825286,89441238.2,0.019023794325606545,-0.027734608312730835\n\"2019/08/19 13:30:00\",292.19,293.08,291.44,292.33,53640153,89938875.65,0.07482928282654236,0.004965157922130543\n\"2019/08/20 13:30:00\",291.77,292.36,289.95,290.09,51652752,90288614.6,0.13163347913942192,0.05010423534668166\n\"2019/08/21 13:30:00\",292.48,292.86,291.72,292.45,49723430,90414124.5,0.1463646313635881,0.0963856582701872\n\"2019/08/22 13:30:00\",293.23,293.93,290.4,292.36,51739292,90231384.5,0.0974230251043395,0.12137475482281697\n\"2019/08/23 13:30:00\",290.92,292.76,283.47,284.85,149318151,95443088.2,-0.008384366749314037,0.10180407088766052\n\"2019/08/26 13:30:00\",287.27,288,285.58,288,72620598,97167795,-0.09736262091672383,0.037846554526152536\n\"2019/08/27 13:30:00\",289.54,289.95,286.03,286.87,68262998,98288492.65,-0.16880466325504895,-0.047145935580464184\n\"2019/08/28 13:30:00\",286.14,289.07,285.25,288.89,59852324,96068850.75,-0.2067936925775944,-0.12458543794507566\n\"2019/08/29 13:30:00\",291.72,293.16,290.61,292.58,57998913,91836467.6,-0.20530299206011707,-0.17564372077368792\n\"2019/08/30 13:30:00\",294.22,294.2399,291.42,292.45,62961780,89147071.85,-0.19275729116750256,-0.19762588728299577\n\"2019/09/03 13:30:00\",290.57,291.58,289.27,290.74,69252354,83672417.1,-0.19375158354659916,-0.19944430709657213\n\"2019/09/04 13:30:00\",293.14,294.055,292.31,294.04,47003957,79987030.85,-0.21944342102752656,-0.19962736041930784\n\"2019/09/05 13:30:00\",296.79,298.83,296.64,297.82,83356779,77126256.55,-0.20972833036410782,-0.20481260511331031\n\"2019/09/06 13:30:00\",298.17,298.76,297.42,298.05,49584290,75219775.85,-0.1707784936400435,-0.2038122633283186\n\"2019/09/09 13:30:00\",299.14,299.24,297.16,298.2,51260290,73096292.45,-0.1209923866111466,-0.18357490927449596\n\"2019/09/10 13:30:00\",297.36,298.2,295.97,298.13,57947101,72717265.9,-0.05984002233417569,-0.14218501886677729\n\"2019/09/11 13:30:00\",298.47,300.34,297.75,300.25,68821066,71418670.6,0.032464337158752986,-0.08332982906198917\n\"2019/09/12 13:30:00\",301.25,302.46,300.41,301.29,72908745,68283005.2,0.11408049597325823,-0.010277210164788964\n\"2019/09/13 13:30:00\",301.78,302.17,300.68,301.09,62104838,66291754.85,0.1346622932441085,0.06131865619565921\n\"2019/09/16 13:30:00\",299.84,301.1378,299.45,300.16,58191175,64910049.3,0.12778605805226406,0.10962266227429174\n\"2019/09/17 13:30:00\",299.94,301.02,299.75,300.92,42904427,64373263,0.1286021968377817,0.12792989923396417\n\"2019/09/18 13:30:00\",300.49,301.22,298.24,301.1,74192091,65500229.95,0.16685967705292326,0.1357164133461872\n\"2019/09/19 13:30:00\",301.53,302.63,300.7103,301.08,78099215,66919019.2,0.1824712582019812,0.15019684400594255\n\"2019/09/20 13:30:00\",300.36,300.67,297.41,298.28,97455979,69204853.55,0.1388692173793538,0.16102221412115741\n\"2019/09/23 13:30:00\",297.55,299,297.27,298.21,47541321,64116012.05,0.08906500368810145,0.14976760531728245\n\"2019/09/24 13:30:00\",299.41,299.84,294.81,295.87,97367568,65353360.55,0.03475904780336727,0.11218312469004316\n\"2019/09/25 13:30:00\",295.96,298.11,294.33,297.62,73434081,65611914.7,-0.021941174326639813,0.0607626910059419\n\"2019/09/26 13:30:00\",297.63,297.86,295.45,297,58722357,65555416.35,-0.07535732736352681,0.006557237213004927\n\"2019/09/27 13:30:00\",297.83,297.9465,293.69,295.4,84781110,66894526.2,-0.12070865143670526,-0.04675776783561187\n\"2019/09/30 13:30:00\",295.97,297.55,295.92,296.77,52562761,66374575.25,-0.14284234559164175,-0.09281924625312427\n\"2019/10/01 13:30:00\",297.74,298.455,293,293.24,89900420,67406978.55,-0.1851753411870274,-0.1312724437678747\n\"2019/10/02 13:30:00\",291.5,291.51,286.64,288.06,124523974,71282979.4,-0.25795763172189223,-0.17245027611932262\n\"2019/10/03 13:30:00\",287.81,290.45,284.82,290.42,85906799,71410480.4,-0.31520366178512266,-0.22405199219910057\n\"2019/10/04 13:30:00\",291.14,294.63,290.82,294.35,66700681,72266299.95,-0.3019856086576023,-0.2722472561431099\n\"2019/10/07 13:30:00\",293.47,295.26,292.77,293.08,60656561,72736113.5,-0.2360261963528285,-0.2880603948266951\n\"2019/10/08 13:30:00\",291.04,291.85,288.49,288.53,101575470,74917531.95,-0.17701979980057872,-0.2613745119344271\n\"2019/10/09 13:30:00\",290.75,292.3,288.6559,291.27,65707329,74761845.1,-0.16025146886322786,-0.21472151163794076\n\"2019/10/10 13:30:00\",291.18,294.21,291,293.24,57255974,73979206.55,-0.1554699526272383,-0.17767311438461333\n\"2019/10/11 13:30:00\",296.27,298.74,296.1448,296.28,101228577,75935393.5,-0.12780261723492173,-0.1560442100027388\n\"2019/10/14 13:30:00\",295.93,296.67,295.57,295.95,40546668,75053168.15,-0.09190433192431535,-0.13645015675197722\n\"2019/10/15 13:30:00\",297.1,299.7,296.97,298.88,47832356,75299564.6,-0.03806684777536843,-0.10549178312018015\n\"2019/10/16 13:30:00\",298.37,299.16,297.92,298.4,50563596,74118139.85,0.04195209974390831,-0.057632146148396825\n\"2019/10/17 13:30:00\",299.68,300.24,298.515,299.28,46784885,72552423.35,0.1290796104065475,0.007490963736551985\n\"2019/10/18 13:30:00\",298.69,299.395,296.99,297.97,64338028,70896525.8,0.16301992491989958,0.0778360829075738\n\"2019/10/21 13:30:00\",299.42,300.21,298.935,299.99,39460901,70492504.8,0.11799808707946077,0.12402487624604387\n\"2019/10/22 13:30:00\",300.58,300.9,298.91,299.01,49126038,68080428.3,0.07078804177260789,0.12698394602964602\n\"2019/10/23 13:30:00\",298.73,299.94,298.495,299.88,34991829,66158315.7,0.07911645124457224,0.10328477231143485\n\"2019/10/24 13:30:00\",300.91,301.07,299.4601,300.37,35857459,65015070.8,0.09746635605782772,0.08587890486194145\n\"2019/10/25 13:30:00\",299.74,302.2,299.6806,301.6,45205412,63036285.9,0.0951440221010841,0.0865162797464153\n\"2019/10/28 13:30:00\",302.94,303.85,302.91,303.3,42146965,62515496.1,0.09526556527419287,0.09326712880609812\n\"2019/10/29 13:30:00\",303,304.23,302.86,303.21,44284921,60234721.15,0.10030843905792072,0.0964323283110504\n\"2019/10/30 13:30:00\",303.43,304.55,301.99,304.14,49643928,56490718.85,0.10269804482028726,0.09816501259759976\n\"2019/10/31 13:30:00\",304.13,304.13,301.73,303.33,69053791,55648068.45,0.08476769275849393,0.09767437096485045\n\"2019/11/01 13:30:00\",304.92,306.19,304.74,306.14,71141515,55870110.15,0.09214708322641697,0.09456449957365003\n\"2019/11/04 14:30:00\",307.85,308,306.96,307.37,60606916,55867627.9,0.11695001807832438,0.09557960247807223\n\"2019/11/05 14:30:00\",307.59,307.9195,306.71,307.03,43033885,52940548.65,0.14252284515283345,0.10758079008680167\n\"2019/11/06 14:30:00\",307.03,307.4,306.06,307.1,46487108,51979537.6,0.154520156918554,0.12760216110121445\n\"2019/11/07 14:30:00\",308.57,309.65,307.66,308.18,54272274,51830352.6,0.14664104111142895,0.14294617722208805\n\"2019/11/08 14:30:00\",307.8,309.0036,307.03,308.94,49068797,49222363.6,0.13198123873100234,0.14613774665730025\n\"2019/11/11 14:30:00\",307.42,308.54,307.27,308.35,35934909,48991775.65,0.11549403935867167,0.13787645932701473\n\"2019/11/12 14:30:00\",308.75,309.99,308.15,309,46484624,48924389.05,0.11390504634479788,0.1259161072725958\n\"2019/11/13 14:30:00\",307.91,309.54,307.66,309.1,54459018,49119160.15,0.12327707046488917,0.1190094134338051\n\"2019/11/14 14:30:00\",308.79,309.64,308.09,309.55,52001874,49380009.6,0.15644145153443417,0.12438328741874666\n\"2019/11/15 14:30:00\",311.02,311.84,310.26,311.79,62706192,49298417.8,0.1984090019934015,0.14529184872280768\n\"2019/11/18 14:30:00\",311.53,312.28,311.03,312.02,49327980,49791771.75,0.2411607815974452,0.17902312651966765\n\"2019/11/19 14:30:00\",312.68,312.69,311.22,311.93,67927818,50731860.75,0.2663527396357138,0.21698895972530688\n\"2019/11/20 14:30:00\",311.28,311.85,309.06,310.77,79696276,52967083.1,0.2648990290803249,0.24638917892334075\n\"2019/11/21 14:30:00\",310.89,311.01,309.39,310.27,54664690,53907444.65,0.24835679864308585,0.2586701862787681\n\"2019/11/22 14:30:00\",311.09,311.24,309.85,310.96,44850228,53889685.45,0.21382960026557826,0.25111566589135226\n\"2019/11/25 14:30:00\",311.98,313.37,311.98,313.37,48762676,54220471,0.18397191244582678,0.2288739565572467\n\"2019/11/26 14:30:00\",313.41,314.28,313.06,314.08,37727953,53892622.6,0.17321661761358353,0.20286274027991325\n\"2019/11/27 14:30:00\",314.61,315.48,314.37,315.48,44793179,53650085.15,0.17912278908086987,0.18455490824421147\n\"2019/11/29 14:30:00\",314.86,315.13,314.06,314.31,36592740,52027032.6,0.1781979507763792,0.1778081127685188\n\"2019/12/02 14:30:00\",314.59,314.66,311.17,311.64,76110027,52275458.2,0.1103145730793899,0.1663621117345786\n\"2019/12/03 14:30:00\",308.65,309.64,307.13,309.55,75172709,53003747.85,0.003512033880795076,0.12660997844553387\n\"2019/12/04 14:30:00\",310.7,312.12,310.32,311.46,49190402,53311573.7,-0.059029126213594456,0.05780367308052579\n\"2019/12/05 14:30:00\",312.23,312.25,310.58,312.02,40781669,53026301.75,-0.05291203141067839,-0.008938607166147876\n\"2019/12/06 14:30:00\",314.12,315.31,314.11,314.87,48956767,52760526.4,-0.0024475195330920054,-0.03713630015014044\n\"2019/12/09 14:30:00\",314.44,315.18,313.8,313.88,34904315,52052302.3,0.04020489030636438,-0.02159055629912848\n\"2019/12/10 14:30:00\",313.82,314.55,312.81,313.53,53109165,52911015.1,0.04575805184602772,0.01139346033031568\n\"2019/12/11 14:30:00\",314.03,314.7,313.4393,314.42,53521450,53262856.4,0.014979337325860657,0.03074295034959214\n\"2019/12/12 14:30:00\",314.43,317.99,314.17,317.13,96585802,55369195.6,-0.009373038407684766,0.025384438373742726\n\"2019/12/13 14:30:00\",316.87,318.67,316.02,317.32,81546487,56846426.25,0.012648878628258272,0.01160325471843963\n\"2019/12/16 14:30:00\",319.22,320.15,317.2542,319.5,82836128,57852923.05,0.0829203832177054,0.01740856683078551\n\"2019/12/17 14:30:00\",319.92,320.25,319.48,319.57,61131769,58443112.5,0.15384416908022142,0.055934942394077335\n\"2019/12/18 14:30:00\",320,320.25,319.53,319.59,48199955,57456719.35,0.19081676584354343,0.11283245817794256\n\"2019/12/19 14:30:00\",319.8,320.98,319.5246,320.9,85388424,57741326.75,0.1990222601592108,0.161877418870741\n\"2019/12/20 14:30:00\",320.46,321.9742,319.3873,320.73,149338215,62475003,0.19119679962628955,0.1874531701186699\n\"2019/12/23 14:30:00\",321.59,321.65,321.06,321.22,53015641,62883273.65,0.19650845932860156,0.19462722412385758\n\"2019/12/24 14:30:00\",321.47,321.52,320.9,321.23,20270007,61458640.2,0.20379815498587467,0.19637182217581128\n\"2019/12/26 14:30:00\",321.65,322.95,321.64,322.94,31024188,61123451.95,0.21658099049828955,0.2013985031255886\n\"2019/12/27 14:30:00\",323.74,323.8,322.28,322.86,42554820,61011534,0.21312125232722456,0.2083980004373591\n\"2019/12/30 14:30:00\",322.95,323.1,320.55,321.08,49782730,61671033.5,0.14734355777231808,0.20175769973487015\n\"2019/12/31 14:30:00\",320.53,322.13,320.15,321.86,57106998,60720882.05,0.04913239382609328,0.16444050075391137\n\"2020/01/02 14:30:00\",323.54,324.89,322.53,324.87,59253833,59924938.25,0.0007860646459566964,0.10114320336166734\n\"2020/01/03 14:30:00\",321.16,323.64,321.1,322.41,77783566,61354596.45,0.05286605673494188,0.050007755241893326\n\"2020/01/06 14:30:00\",320.49,323.73,320.36,323.64,55761948,62103610.4,0.1465902996245708,0.05050448936874355\n\"2020/01/07 14:30:00\",323.02,323.54,322.24,322.73,42854811,61798512.6,0.21529894430172897,0.10249962027778516\n\"2020/01/08 14:30:00\",322.94,325.78,322.67,324.45,68434153,63475004.5,0.2622100663600654,0.17314243515793448\n\"2020/01/09 14:30:00\",326.16,326.73,325.52,326.65,48569601,63248026.3,0.29701488625420536,0.2331038678670608\n\"2020/01/10 14:30:00\",327.2899,327.46,325.2,325.71,53057389,63224823.25,0.2973590528350498,0.2718513170608867\n\"2020/01/13 14:30:00\",326.39,327.96,325.92,327.95,47262010,60758633.65,0.2836989560945626,0.2891094834388564\n\"2020/01/14 14:30:00\",327.47,328.62,326.844,327.45,63036384,59833128.5,0.2907521272437498,0.2916471718928633\n\"2020/01/15 14:30:00\",327.35,329.02,327.26,328.19,72056598,59294152,0.32944063395818163,0.2959503089116427\n\"2020/01/16 14:30:00\",329.7,330.92,329.45,330.92,54050328,58940079.95,0.37395416348356936,0.31633977366366584\n\"2020/01/17 14:30:00\",331.7,332.18,330.8539,331.95,95846017,61322383.05,0.3836119221324703,0.34685894070995366\n\"2020/01/21 14:30:00\",330.9,332.18,330.82,331.3,77742415,60940082.6,0.3587447600626273,0.3672195942088147\n\"2020/01/22 14:30:00\",332.24,332.95,331.17,331.34,48914899,55918916.8,0.3079513036116573,0.36110313858090365\n\"2020/01/23 14:30:00\",330.63,332.1682,329.41,331.72,52004140,55868341.75,0.24621129935607108,0.32720255813951843\n\"2020/01/24 14:30:00\",332.44,332.53,327.36,328.77,87578442,59233763.5,0.16048882112721732,0.2712597978542169\n\"2020/01/27 14:30:00\",323.03,325.12,322.66,323.5,84062463,61885677.25,0.08488428044578086,0.20103930417066915\n\"2020/01/28 14:30:00\",325.06,327.85,323.6038,326.89,63833953,62949633.9,0.04432691711610989,0.1302140699363629\n\"2020/01/29 14:30:00\",328.38,328.63,326.4,326.62,54040889,63162541.85,0.03225542833669765,0.07519444076461608\n\"2020/01/30 14:30:00\",324.36,327.91,323.54,327.68,75491844,64081784.15,0.041323781733932016,0.04656212551422132\n\"2020/01/31 14:30:00\",327,327.17,320.73,321.73,113845576,66811371.3,0.008202418148007238,0.033281292567562744\n\"2020/02/03 14:30:00\",323.35,326.16,323.22,324.12,69242293,66384307.65,-0.044818237462054766,0.014414931773086899\n\"2020/02/04 14:30:00\",328.07,330.01,327.72,329.06,62573190,66724869.75,-0.0867568283562622,-0.01977744754173754\n\"2020/02/05 14:30:00\",332.27,333.09,330.67,332.86,65951146,67879686.5,-0.0958195187002211,-0.05846120536480796\n\"2020/02/06 14:30:00\",333.91,334.19,332.8,333.98,50359688,66975963.25,-0.07663860756507744,-0.08110158985668313\n\"2020/02/07 14:30:00\",332.82,333.9941,331.6,332.2,64139443,67754455.35,-0.05547242301489138,-0.08119091731695845\n\"2020/02/10 14:30:00\",331.23,334.75,331.19,334.68,42070006,67205086.2,-0.014200690628604998,-0.06237371174812729\n\"2020/02/11 14:30:00\",336.16,337.02,334.684,335.26,54864533,67585212.35,0.028758545863344483,-0.031204381498120954\n\"2020/02/12 14:30:00\",336.83,337.65,336.43,337.42,43992662,66633026.25,0.061342694730769615,0.005830997030892868\n\"2020/02/13 14:30:00\",335.8621,338.12,335.56,337.06,54501922,65755292.45,0.06412989400459979,0.03835528076070383\n\"2020/02/14 14:30:00\",337.51,337.73,336.2,337.6,64582210,66281886.55,0.08741621740855685,0.06118665679044002\n\"2020/02/18 14:30:00\",336.51,337.6677,335.21,336.73,57342526,64356712,0.15049213849003001,0.08582117600785215\n\"2020/02/19 14:30:00\",337.79,339.08,337.48,338.34,48814692,62910325.85,0.2158329227197614,0.12596325475358916\n\"2020/02/20 14:30:00\",337.7423,338.64,333.6817,336.95,74163362,64172749,0.23835488963938142,0.17640353824458685\n\"2020/02/21 14:30:00\",335.47,335.81,332.58,333.48,113788208,67261952.4,0.18467208389677797,0.20725664118418227\n\"2020/02/24 14:30:00\",323.14,325.85,321.24,322.42,161088409,70937450.75,0.12219652063668913,0.1973472317381282\n\"2020/02/25 14:30:00\",323.94,324.61,311.69,312.65,218913168,77679986,-0.013036775832333213,0.1398425538123304\n\"2020/02/26 14:30:00\",314.18,318.11,310.7,311.5,194773819,84226979.3,-0.17925032399261231,0.03729020825214625\n\"2020/02/27 14:30:00\",305.46,311.5637,297.51,297.51,284353460,95742607.85,-0.318246647071858,-0.09677072101417665\n\"2020/02/28 14:30:00\",288.7,297.892,285.54,296.26,385764020,111256216.65,-0.35689486514030466,-0.22748759718359646\n\"2020/03/02 14:30:00\",298.21,309.16,294.46,309.09,238703625,117499119.1,-0.2813734394461557,-0.3018177979771823\n\"2020/03/03 14:30:00\",309.5,313.84,297.57,300.24,300139150,129043961.95,-0.1968539620803642,-0.2986062030541905\n\"2020/03/04 14:30:00\",306.12,313.1,303.33,312.86,176613448,134745974.85,-0.13890871576932745,-0.24204306399377865\n\"2020/03/05 14:30:00\",304.98,308.47,300.01,302.46,186366809,140766758,-0.11966954786976002,-0.17876139050254983\n\"2020/03/06 14:30:00\",293.15,298.78,290.23,297.46,228667168,149682132,-0.10189888677006102,-0.13598489602143335\n\"2020/03/09 13:30:00\",275.3,284.19,273.45,274.23,309417350,161946027.35,-0.07345473826204614,-0.10925005388516928\n\"2020/03/10 13:30:00\",284.64,288.52,273.5,288.42,276444060,173664730.05,-0.03263932707442659,-0.0838360208347335\n\"2020/03/11 13:30:00\",280.7,281.94,270.88,274.36,256416563,183742331.55,0.014701351114583762,-0.04989761105473712\n\"2020/03/12 13:30:00\",256,266.66,247.68,248.11,392220670,201153731.95,0.04562994048601809,-0.010616791615952284\n\"2020/03/13 13:30:00\",263.09,271.4754,248.5237,269.32,329566100,214906940.85,0.0525560513163226,0.023429884573849948\n\"2020/03/16 13:30:00\",241.18,256.9,237.36,239.85,297240030,226539831.85,0.026526924320006452,0.039600043173211925\n\"2020/03/17 13:30:00\",245.04,256.17,237.07,252.8,262070471,236776229.1,0.013175733157495735,0.03616193748602866\n\"2020/03/18 13:30:00\",236.25,248.37,228.02,240,327597130,250715351,0.018764202170014184,0.02512092807355686\n\"2020/03/19 13:30:00\",239.25,247.38,232.22,240.51,289322040,261473284.9,0.03976060584459841,0.02169456680327078\n\"2020/03/20 13:30:00\",242.53,244.47,228.5,228.8,347158790,273141814,0.0384684460376658,0.02811563253739779\n\"2020/03/23 13:30:00\",228.19,229.6833,218.26,222.95,326025170,281388652.05,0.000700540685423638,0.029320474436661036\n\"2020/03/24 13:30:00\",234.42,244.1,233.8,243.15,235494475,282217717.4,-0.03489044052769854,0.01386802312717979\n\"2020/03/25 13:30:00\",244.87,256.35,239.75,246.79,299430255,287450539.2,-0.04287584842742721,-0.012131200345718537\n\"2020/03/26 13:30:00\",249.52,262.8,249.05,261.2,257632816,286114507,-0.0013928685132121694,-0.02603748428967334\n\"2020/03/27 13:30:00\",253.27,260.81,251.05,253.42,224341217,278043366.85,0.053784650632098675,-0.011607203962813104\n\"2020/03/30 13:30:00\",255.7,262.43,253.53,261.65,170961866,274656278.9,0.1011222401372511,0.027171659324599483\n\"2020/03/31 13:30:00\",260.56,263.33,256.22,257.75,194881060,269393374.4,0.12150944124385667,0.07165505904489067\n\"2020/04/01 13:30:00\",247.98,257.6591,243.9,246.15,189554623,270040433.15,0.10884126639221599,0.10131487996442172\n\"2020/04/02 13:30:00\",245.19,252.68,244.59,251.83,177660430,269605114.2,0.09088315910228877,0.10878446908528087\n\"2020/04/03 13:30:00\",250.76,253.32,245.22,248.19,135561171,264949814.35,0.09715574320571595,0.10301900590643036\n\"2020/04/06 13:30:00\",257.84,267,248.1698,264.86,188061238,258882008.75,0.1593361848942225,0.10737587598374132\n\"2020/04/07 13:30:00\",274.21,275.03,264.89,265.13,201427189,255131165.2,0.21210752239113845,0.13599575628221736\n\"2020/04/08 13:30:00\",267.96,276,265.2542,274.03,153774487,249999061.4,0.21808100231646466,0.17635402668215042\n\"2020/04/09 13:30:00\",277.58,281.2,275.47,278.2,190282705,239902163.15,0.18293860591215697,0.2004419733702643\n\"2020/04/13 13:30:00\",277.14,277.51,271.41,275.66,115139268,229180821.55,0.13953529503913836,0.19228033898125332\n\"2020/04/14 13:30:00\",280.98,284.9,275.5106,283.79,134143350,221025987.55,0.10585257725137363,0.1614802302450715\n\"2020/04/15 13:30:00\",277.57,279.26,275.46,277.76,121775006,214011214.3,0.07904932241490581,0.1254606121513478\n\"2020/04/16 13:30:00\",279.15,280.03,275.76,279.1,131798325,204221274.05,0.08143527471202472,0.09846239484728699\n\"2020/04/17 13:30:00\",285.38,287.3,282.4,286.64,146684784,197089411.25,0.08763158864954301,0.08574222669246295\n\"2020/04/20 13:30:00\",282.61,286.7912,281.35,281.59,100224647,184742704.1,0.08781889913847142,0.08416699137941878\n\"2020/04/21 13:30:00\",276.73,278.04,272.02,273.04,126385698,174760730.5,0.059143934753660136,0.08191336417361895\n\"2020/04/22 13:30:00\",278.35,281,276.91,279.1,93524584,167662235.95,0.03267644242659624,0.06903894981006707\n\"2020/04/23 13:30:00\",280.49,283.94,278.75,279.08,104709693,157926207.85,0.016738651451833828,0.048033050825136335\n\"2020/04/24 13:30:00\",280.73,283.7,278.5,282.97,85165953,149302864.7,0.0059982204331797614,0.027328723823950005\n\"2020/04/27 13:30:00\",285.12,288.27,284.62,287.05,77896608,141980634.25,0.010963475016868047,0.014852276868915243\n\"2020/04/28 13:30:00\",291.02,291.4,285.4,285.73,105283871,138696734.5,-0.005977339242781908,0.007447450518191256\n\"2020/04/29 13:30:00\",291.53,294.88,290.41,293.21,118745579,134889960.45,-0.026784360296912512,-0.0018023113859267457\n\"2020/04/30 13:30:00\",291.71,293.3239,288.59,290.48,122901701,131557314.35,-0.06442811218902478,-0.019831339375257596\n\"2020/05/01 13:30:00\",285.31,290.6572,281.52,282.79,125180028,128933294.25,-0.10124985808039404,-0.04827535704917509\n\"2020/05/04 13:30:00\",280.74,283.9,279.13,283.57,80873213,126198896.35,-0.11296312378711458,-0.07851723743714412\n\"2020/05/05 13:30:00\",286.64,289.25,283.7134,286.19,79569938,120774331.35,-0.1034843192379201,-0.09938973252699368\n\"2020/05/06 13:30:00\",288.04,288.46,283.78,284.25,73632628,114384603.3,-0.08432025289187349,-0.1030774995037228\n\"2020/05/07 13:30:00\",287.75,289.78,287.13,287.68,75250412,110458399.55,-0.07693289959276636,-0.09425086127324468\n\"2020/05/08 13:30:00\",291.09,292.95,289.86,292.44,76622128,104775370.7,-0.0916142764666498,-0.0862674834456416\n\"2020/05/11 13:30:00\",290.34,294,289.88,292.5,79514231,102994118.85,-0.10542151699573685,-0.0878060203344071\n\"2020/05/12 13:30:00\",293.79,294.24,286.52,286.67,95870786,101080490.65,-0.11295724831975464,-0.09732695580621571\n\"2020/05/13 13:30:00\",286.06,287.19,278.965,281.6,144721099,102227795.3,-0.1444142263824742,-0.11213100558001782\n\"2020/05/14 13:30:00\",278.95,285.11,276.37,284.97,121977890,101736773.55,-0.1639512309351814,-0.130685949555896\n\"2020/05/15 13:30:00\",282.37,286.33,281.34,286.28,111146276,99959848.15,-0.1369498780911193,-0.1444396735076975\n\"2020/05/18 13:30:00\",293.05,296.75,292.7,295,120320229,100964627.25,-0.07507949198002166,-0.1368826560691829\n\"2020/05/19 13:30:00\",294.35,296.205,291.95,291.97,95189316,99404808.15,-0.02659873009365589,-0.10243478352851987\n\"2020/05/20 13:30:00\",295.82,297.87,295.57,296.93,85861691,99021663.5,-0.009486147073727644,-0.05829874488536701\n\"2020/05/21 13:30:00\",296.79,297.67,293.6886,294.88,78293925,97700875.1,0.0006761259912499011,-0.024428853387256467\n\"2020/05/22 13:30:00\",294.57,295.63,293.22,295.44,63958200,96640487.45,0.012788132612936,-0.005238439940945896\n\"2020/05/26 13:30:00\",301.93,302.19,298.69,299.08,88951442,97193229.15,-0.002722766593293628,0.002453267256891755\n\"2020/05/27 13:30:00\",302.12,303.57,296.87,303.53,104817449,97169908.05,-0.016922912168763824,0.0006473243102951368\n\"2020/05/28 13:30:00\",304.65,306.84,302.24,302.97,90767807,95771019.45,0.014306859766329665,-0.00203272752414154\n\"2020/05/29 13:30:00\",302.46,304.96,299.47,304.32,119265702,95589219.5,0.06270328888863548,0.009124736248412256\n\"2020/06/01 13:30:00\",303.62,306.205,303.06,305.55,56779836,92169209.9,0.08092359997646854,0.03633683085293917\n\"2020/06/02 13:30:00\",306.55,308.13,305.1,308.08,74267162,91838907.35,0.046094840333703466,0.05794257963837352\n\"2020/06/03 13:30:00\",310.24,313.22,309.94,312.18,92567574,92488789.15,0.02870235409220618,0.057573753933530945\n\"2020/06/04 13:30:00\",311.11,313,309.08,311.36,75794363,92596875.9,0.050215214109034755,0.04678886715622043\n\"2020/06/05 13:30:00\",317.23,321.275,317.16,319.34,150524674,96360589,0.09459522289897469,0.04975419993919334\n\"2020/06/08 13:30:00\",320.22,323.41,319.63,323.2,73641217,96211543.45,0.14607724588047868,0.0774000789981173\n\"2020/06/09 13:30:00\",320.3,323.2849,319.36,320.79,77479228,96109793.3,0.20310228869847768,0.12244374006106985\n\"2020/06/10 13:30:00\",321.42,322.39,318.2209,319,95000766,96066292.3,0.24706789260328124,0.17333703077669474\n\"2020/06/11 13:30:00\",311.46,312.15,300.01,300.61,209243560,99292415.35,0.21047457004245085,0.20948202975440788\n\"2020/06/12 13:30:00\",308.24,309.08,298.6,304.21,194678879,102927464.8,0.09131961528098859,0.20158447154515505\n\"2020/06/15 13:30:00\",298.02,308.28,296.74,307.05,135782724,104159287.2,-0.008328044353554252,0.14038803648276763\n\"2020/06/16 13:30:00\",315.48,315.64,307.67,312.96,137627502,105024650.85,-0.03940196831820836,0.056175957263185194\n\"2020/06/17 13:30:00\",314.07,314.39,310.86,311.66,83398944,104435132.25,-0.047215197764462334,-0.008559267971166495\n\"2020/06/18 13:30:00\",310.005,312.3,309.51,311.78,80828658,104183480.6,-0.06620640775594183,-0.04129479737913958\n\"2020/06/19 13:30:00\",314.17,314.38,306.53,308.64,135549624,107046265.55,-0.10910805089591484,-0.06255887170915526\n\"2020/06/22 13:30:00\",307.99,311.05,306.75,310.62,74649389,107580825,-0.14985393840631533,-0.09128300891241518\n\"2020/06/23 13:30:00\",313.49,314.5,311.6101,312.05,68471246,106556815.2,-0.18788470162677454,-0.12866918133119612\n\"2020/06/24 13:30:00\",309.84,310.51,302.1,304.09,132813492,107956617.35,-0.2223460977629975,-0.16782190478751535\n\"2020/06/25 13:30:00\",303.47,307.64,301.28,307.35,89467968,107891625.4,-0.2124021909894804,-0.19711962136255665\n\"2020/06/26 13:30:00\",306.16,306.39,299.42,300.05,127961017,108326391.15,-0.17014165344805815,-0.20458715542996475\n\"2020/06/29 13:30:00\",301.41,304.61,298.93,304.46,79773260,109476062.35,-0.1376293869043345,-0.18751052892373485\n\"2020/06/30 13:30:00\",303.99,310.2,303.82,308.36,113394772,111432442.85,-0.132333553889258,-0.1600463042639206\n\"2020/07/01 13:30:00\",309.57,311.89,309.07,310.52,72396542,110423891.25,-0.1306620464598348,-0.14012159691584633\n\"2020/07/02 13:30:00\",314.24,315.7,311.51,312.23,69344217,110101383.95,-0.10187770817499116,-0.1275830492962519\n\"2020/07/06 13:30:00\",316.37,317.68,315.56,317.05,61713828,105660841.65,-0.0661441011613518,-0.11059286072004364\n\"2020/07/07 13:30:00\",315.38,317.52,313.37,313.78,82909963,106124278.95,-0.05555390483102625,-0.08704326166059116\n\"2020/07/08 13:30:00\",314.61,316.3,312.7,316.18,54638596,104982247.35,-0.04691735991223133,-0.06536518001199644\n\"2020/07/09 13:30:00\",316.84,317.1,310.68,314.38,83354158,104399916.95,-0.024424402143617893,-0.049251838798580805\n\"2020/07/10 13:30:00\",314.31,317.88,312.76,317.59,57550365,96815257.2,0.0014856839160178334,-0.03279195750445114\n\"2020/07/13 13:30:00\",320.13,322.71,314.13,314.84,102997484,92231187.45,0.033045681802614246,-0.009958185760802868\n\"2020/07/14 13:30:00\",313.3,319.76,312,318.92,93656951,90124898.8,0.054464743042511206,0.01651717872269291\n\"2020/07/15 13:30:00\",322.41,323.04,319.265,321.85,87196524,87603349.9,0.05803262648244499,0.03908986001478562\n\"2020/07/16 13:30:00\",319.79,321.28,319.09,320.79,54622520,86164528.7,0.045053406003744516,0.05051563780937853\n\"2020/07/17 13:30:00\",321.88,322.57,319.735,321.72,62774911,85261841.35,0.02756650720996541,0.04803388587080928\n\"2020/07/20 13:30:00\",321.43,325.13,320.62,324.32,56308749,81299797.6,0.03174048920159816,0.03916882368524383\n\"2020/07/21 13:30:00\",326.45,326.93,323.94,325.01,57498967,80442276.5,0.060767795161598755,0.03740586566474507\n\"2020/07/22 13:30:00\",324.62,327.2,324.5,326.86,57792915,79908359.95,0.08603200055774302,0.049769179415683706\n\"2020/07/23 13:30:00\",326.47,327.23,321.48,322.96,75737989,77054584.8,0.09667100221464382,0.07033518047582092\n\"2020/07/24 13:30:00\",320.95,321.99,319.246,320.88,73766597,76269516.25,0.0847750491371293,0.08515814164058362\n\"2020/07/27 13:30:00\",321.63,323.41,320.775,323.22,48292970,72286113.9,0.08419637766794795,0.08885341348820619\n\"2020/07/28 13:30:00\",322.43,323.64,320.85,321.17,57494979,71172199.85,0.08834381119241384,0.08715961116953536\n\"2020/07/29 13:30:00\",322.12,325.73,322.075,325.12,48454159,67925169.2,0.09915280253288637,0.08816803823178987\n\"2020/07/30 13:30:00\",321.9,324.41,319.64,323.96,61861714,67398427.8,0.11206424886665609,0.09520897566420074\n\"2020/07/31 13:30:00\",325.9,326.63,321.33,326.52,85210755,68191754.7,0.12591795055016647,0.10611597742361088\n\"2020/08/03 13:30:00\",328.32,329.62,327.73,328.79,53077948,67759960.7,0.14407676633919067,0.11986566128428701\n\"2020/08/04 13:30:00\",327.86,330.06,327.86,330.06,41917893,65710357.2,0.14966496719132705,0.1336197749727829\n\"2020/08/05 13:30:00\",331.47,332.39,331.18,332.11,42866354,65121745.1,0.16153904732894128,0.14582341082335717\n\"2020/08/06 13:30:00\",331.4799,334.46,331.13,334.33,43679447,63138009.55,0.20927313170809483,0.16262632118130368\n\"2020/08/07 13:30:00\",333.28,334.88,332.3,334.57,57308270,63125904.8,0.29458248578730417,0.19764530184211726\n\"2020/08/10 13:30:00\",335.06,335.77,332.955,335.57,44282089,60190135.05,0.3737638460043609,0.25716902138735004\n\"2020/08/11 13:30:00\",336.85,337.54,332.01,332.8,69600882,58987331.6,0.39530721320661116,0.32354550141633936\n\"2020/08/12 13:30:00\",335.44,338.28,332.8377,337.44,53826128,57318811.8,0.34180101964444426,0.3624209373089488\n\"2020/08/13 13:30:00\",336.61,338.2514,335.83,336.83,41816146,56678493.1,0.27751780040639373,0.35424968535214424\n\"2020/08/14 13:30:00\",336.41,337.42,335.62,336.84,47260390,55902767.05,0.23643375824894686,0.3117297685928723\n\"2020/08/17 13:30:00\",337.94,338.34,336.8517,337.91,35480974,54861378.3,0.2198061239109025,0.26491837681100466\n\"2020/08/18 13:30:00\",338.34,339.1,336.61,338.64,38733908,53923125.35,0.20321073249647933,0.23220138287042866\n\"2020/08/19 13:30:00\",339.05,339.61,336.62,337.23,68054244,54436191.8,0.16311450114433199,0.2075969953680071\n\"2020/08/20 13:30:00\",335.36,338.8,335.22,338.28,42207826,52759683.65,0.10864889797823471,0.1768509148617933\n\"2020/08/21 13:30:00\",337.92,339.72,337.55,339.48,55106628,51826685.2,0.07146050184357083,0.13636633876419726\n\"2020/08/24 13:30:00\",342.12,343,339.4504,342.92,48588662,51841469.8,0.06260916203326704,0.09765707713686834\n\"2020/08/25 13:30:00\",343.53,344.21,342.27,344.12,38463381,50889889.9,0.09531817621647586,0.07868440032473105\n\"2020/08/26 13:30:00\",344.76,347.86,344.17,347.57,50790237,51006693.8,0.1619256042440203,0.09154013043117948\n\"2020/08/27 13:30:00\",348.51,349.9,346.53,348.33,58034142,50815315.2,0.2354795140029509,0.1354293728262017\n\"2020/08/28 13:30:00\",349.44,350.72,348.15,350.58,48588940,48984224.45,0.27997845560231244,0.19501781138545513\n\"2020/08/31 13:30:00\",350.35,351.3,349.06,349.31,66099183,49635286.2,0.2783847605617518,0.24520438400271646\n\"2020/09/01 13:30:00\",350.21,352.71,349.24,352.6,54999325,50289357.8,0.27664940926589493,0.2714758925994957\n\"2020/09/02 13:30:00\",354.67,358.75,353.43,357.7,69540035,51623041.85,0.31018557174170036,0.28337206116655106\n\"2020/09/03 13:30:00\",355.87,356.38,342.59,345.39,148011129,56839625.95,0.2792846017508977,0.28855655405464\n\"2020/09/04 13:30:00\",346.13,347.83,334.87,342.57,139156281,60932026.5,0.1472964272264528,0.2671476972462573\n\"2020/09/08 13:30:00\",336.71,342.64,332.88,333.21,114465322,64441188.15,-0.009038245299401131,0.19238489739950004\n\"2020/09/09 13:30:00\",337.55,342.46,336.61,339.79,91462290,65534258.55,-0.10065356458841732,0.07585790016943063\n\"2020/09/10 13:30:00\",341.82,342.53,332.85,333.89,90569548,67371429.55,-0.1482646292865386,-0.03672530363928712\n\"2020/09/11 13:30:00\",335.82,336.97,331,334.06,84680194,69514631.95,-0.19846496783018439,-0.11755660014658291\n\"2020/09/14 13:30:00\",337.49,340.38,334.2208,338.46,65605686,70431896.75,-0.24200208268170117,-0.17268580691726074\n\"2020/09/15 13:30:00\",341.12,342.02,338.4683,340.17,52920862,71303891.15,-0.26337884129250155,-0.21542959526713523\n\"2020/09/16 13:30:00\",341.51,343.06,338.52,338.82,82211256,73477758.55,-0.2706075922574595,-0.24663906800600824\n\"2020/09/17 13:30:00\",333.56,337.6996,332.991,335.84,91523339,74651213.3,-0.2897346228095314,-0.26661826209852574\n\"2020/09/18 13:30:00\",335.37,335.49,327.97,330.65,105877942,77834719.1,-0.3050330563878342,-0.28151605463571955\n\"2020/09/21 13:30:00\",325.7,327.13,321.73,326.97,99450829,80051929.15,-0.2967951081781714,-0.2928230098050604\n\"2020/09/22 13:30:00\",328.57,330.9,325.86,330.3,63612107,80803101.4,-0.25742618472859424,-0.2918028561116895\n\"2020/09/23 13:30:00\",330.9,331.2,322.1,322.64,93112240,83535544.35,-0.23537432720706764,-0.2748083282347389\n\"2020/09/24 13:30:00\",321.22,326.797,319.8,323.5,76681332,84830099.1,-0.2315182829888716,-0.25231906917306113\n\"2020/09/25 13:30:00\",322.58,329.58,321.64,328.73,71069426,85481863.3,-0.19773322095550758,-0.23149077101266338\n\"2020/09/28 13:30:00\",333.22,334.96,332.15,334.19,64584614,86281647,-0.12690623861936734,-0.2034639289525322\n\"2020/09/29 13:30:00\",333.97,334.77,331.6209,332.37,51531594,85553267.55,-0.05717216293047562,-0.15632822751151618\n\"2020/09/30 13:30:00\",333.09,338.29,332.88,334.89,104081136,88007358.1,-0.026100284751238954,-0.09866505146773874\n\"2020/10/01 13:30:00\",337.69,338.74,335.01,337.04,88698745,88965293.6,-0.01259912032073065,-0.05100837571725453\n\"2020/10/02 13:30:00\",331.7,337.0126,331.19,333.84,89431112,86036292.75,0.014521278922275933,-0.020008282358689816\n\"2020/10/05 13:30:00\",336.06,339.96,336.01,339.76,45713108,81364134.1,0.05863275303920022,0.006062797581841973\n\"2020/10/06 13:30:00\",339.91,342.17,334.38,334.93,90128883,80147312.15,0.0863184893602684,0.036671238827081676\n\"2020/10/07 13:30:00\",338.12,341.63,338.09,340.76,56999597,78424177.5,0.11560792380980169,0.07000528125516914\n\"2020/10/08 13:30:00\",342.85,343.85,341.86,343.78,45242476,76157823.9,0.14998961220590956,0.10207919859754165\n\"2020/10/09 13:30:00\",345.56,347.35,344.89,346.85,59528606,74900244.5,0.1880495198210813,0.13426051353546203\n\"2020/10/12 13:30:00\",349.59,354.02,349.06,352.43,80388533,75639386.85,0.2064991147901781,0.1663642171089936\n\"2020/10/13 13:30:00\",352.28,352.4651,349.09,350.13,73255513,76656119.4,0.18495217252413348,0.18733984232542697\n\"2020/10/14 13:30:00\",350.75,351.93,347.14,347.93,57958749,75443494.05,0.15907775730198895,0.18833830862528225\n\"2020/10/15 13:30:00\",343.71,348.02,343.13,347.5,60357659,73885210.05,0.1418518567471167,0.17273513853158995\n\"2020/10/16 13:30:00\",348.96,350.75,347.1,347.29,89501868,73066406.35,0.12392071570551635,0.1517886860546435\n\"2020/10/19 13:30:00\",348.65,349.33,341.04,342.01,68425614,71515145.6,0.0700201961960472,0.1267738497338837\n\"2020/10/20 13:30:00\",343.46,346.88,342.64,343.38,60051880,71337134.25,-0.0034229031449162,0.08771846290088793\n\"2020/10/21 13:30:00\",343.33,348.6847,342.4,342.73,63574979,69860271.2,-0.07178676964495084,0.030888088693804588\n\"2020/10/22 13:30:00\",342.96,345.24,340.65,344.61,55399292,68796169.2,-0.0939084026711525,-0.029051258675806563\n\"2020/10/23 13:30:00\",345.93,345.99,343.13,345.78,49143511,67699873.45,-0.09707887131086249,-0.07198201984799757\n\"2020/10/26 13:30:00\",342.13,342.98,335.62,339.39,91473002,69044292.85,-0.1291500278846608,-0.09715189091560694\n\"2020/10/27 13:30:00\",339.76,340.12,337.99,338.22,65994108,69767418.55,-0.16944486423771407,-0.1193018442166522\n\"2020/10/28 13:30:00\",332.1,332.84,326.13,326.66,127094307,70918077.1,-0.2138274167250146,-0.15134934538010444\n\"2020/10/29 13:30:00\",326.91,333.395,325.09,329.98,90596689,71012974.3,-0.2426472059169284,-0.18972363262117442\n\"2020/10/30 13:30:00\",328.28,329.69,322.6,326.54,120448685,72563852.95,-0.2521451056850775,-0.22242320253444625\n\"2020/11/02 14:30:00\",330.2,332.36,327.24,330.2,86068299,74581612.5,-0.23524374631343173,-0.23977596437374302\n\"2020/11/03 14:30:00\",333.69,338.25,330.2935,336.03,93294192,74739877.95,-0.18598818020700805,-0.23390218168682583\n\"2020/11/04 14:30:00\",340.86,347.94,339.59,343.54,126959700,78237883.1,-0.1205144504140488,-0.20252056819000097\n\"2020/11/05 14:30:00\",349.24,352.19,348.86,350.24,82039749,80077746.75,-0.06861807797720727,-0.15281118092212545\n\"2020/11/06 14:30:00\",349.93,351.51,347.65,350.16,74972973,80849965.1,-0.044890312044933135,-0.10152392483907556\n\"2020/11/09 14:30:00\",363.97,364.38,354.06,354.56,172304203,85445748.6,-0.05517408804129155,-0.06711755308327019\n\"2020/11/10 14:30:00\",353.49,355.18,350.51,354.04,85552022,86060574.05,-0.08377971906620775,-0.05875443286931073\n\"2020/11/11 14:30:00\",356.4,357.56,355.06,356.67,58649048,86095089,-0.09014991606913604,-0.06882464038817797\n\"2020/11/12 14:30:00\",355.58,356.7182,351.26,353.21,68118563,86483134.2,-0.08164736312505194,-0.08078012023950516\n\"2020/11/13 14:30:00\",355.27,358.9,354.71,358.1,62959429,85156012.25,-0.06501213725742658,-0.08206440245200171\n\"2020/11/16 14:30:00\",360.98,362.78,359.59,362.57,74541138,85461788.45,-0.052187304769790735,-0.07260937026731397\n\"2020/11/17 14:30:00\",359.97,361.92,358.34,360.62,66111009,85764744.9,-0.03902075922724751,-0.05917783440112234\n\"2020/11/18 14:30:00\",360.91,361.5,356.24,356.28,70591299,86115560.9,-0.05089764195857689,-0.04972098453501333\n\"2020/11/19 14:30:00\",355.6,358.18,354.15,357.78,59940947,86342643.65,-0.10577933282437967,-0.05630057332763653\n\"2020/11/20 14:30:00\",357.5,357.72,355.25,355.33,70411890,87406062.6,-0.16772524979677209,-0.08668332643165544\n\"2020/11/23 14:30:00\",357.28,358.82,354.865,357.46,63230608,85993942.9,-0.17501849774006753,-0.12882088415682466\n\"2020/11/24 14:30:00\",360.21,363.81,359.29,363.22,62415877,85815031.35,-0.11489173318259208,-0.15102642684677517\n\"2020/11/25 14:30:00\",363.13,363.16,361.48,362.66,45330890,81726860.5,-0.03515774495650473,-0.13045057609976599\n\"2020/11/27 14:30:00\",363.84,364.18,362.58,363.67,28514072,78622729.65,0.02955178338018046,-0.07426094510634679\n\"2020/11/30 14:30:00\",362.83,363.12,359.17,362.06,83872709,76793930.85,0.0389946147249863,-0.014518173601709053\n\"2020/12/01 14:30:00\",365.57,367.68,364.93,366.02,74504969,76215764.35,0.01842058294941123,0.02005927236720667\n\"2020/12/02 14:30:00\",364.82,366.96,364.2,366.79,45927000,73847404.75,-0.01031890324799797,0.022343879246829592\n\"2020/12/03 14:30:00\",366.68,368.19,365.5,366.69,62881998,70643519.65,-0.0035321424967197936,0.008610971938515505\n\"2020/12/04 14:30:00\",367.32,369.85,367.22,369.85,50749859,69079025.15,0.055022156573118174,0.007623441338848981\n\"2020/12/07 14:30:00\",369.02,369.62,367.72,369.09,48944269,67777589.95,0.13299672640515184,0.03760964188499177\n\"2020/12/08 14:30:00\",367.72,370.78,367.67,370.17,42458859,61285322.75,0.20859002169197788,0.09684927419196633\n\"2020/12/09 14:30:00\",370.88,371.05,365.95,366.85,74098312,60712637.25,0.2268577337863834,0.16084223109229348\n\"2020/12/10 14:30:00\",365.37,367.86,364.43,366.73,57735353,60666952.5,0.19378955114054852,0.19961363141707053\n\"2020/12/11 14:30:00\",364.9,366.7402,363.26,366.3,57698614,60145955.05,0.1500254599015129,0.19998500857455911\n\"2020/12/14 14:30:00\",368.64,369.8,364.47,364.66,69216174,60458792.3,0.1238699371071936,0.17305961549628332\n\"2020/12/15 14:30:00\",367.4,369.59,365.92,369.59,63608839,59911206.6,0.11949623932241095,0.14351276408006208\n"
  },
  {
    "path": "Tests/TestData/spy_sarext.txt",
    "content": "date,high,low,close,open,SAR,SAREXT,SAREXT_PARAM1,SAREXT_PARAM2,SAREXT_PARAM3,SAREXT_PARAM4\n1998-01-02,97.53,96.53,97.36,97.31,,,,,,\n1998-01-05,98.44,96.78,97.75,97.84,96.53,96.53,96.53,-98.44,96.78,-100.4088\n1998-01-06,97.28,96.19,96.63,97.25,98.44,-98.44,-98.44,-98.44,-98.44,-100.299936\n1998-01-07,96.5,95.22,96.47,96.09,98.44,-98.44,-98.44,-98.44,-98.44,-100.0944392\n1998-01-08,96.31,95.5,95.78,96.31,98.3112,-98.3112,-98.279,-98.2146,-98.279,-99.753228456\n1998-01-09,95.5,91.91,92.47,95.25,98.187552,-98.187552,-98.12604999999999,-98.00497800000001,-98.12604999999999,-99.43590246408\n1998-01-12,94.19,90.91,94.06,91.13,97.81089888,-97.81089888,-97.69092649999999,-97.45642998000001,-97.69092649999999,-98.7585712423128\n1998-01-13,95.63,94.22,95.22,94.63,97.2588269696,-97.2588269696,-97.08064311499999,-96.73632268220001,-97.08064311499999,-97.89522840565839\n1998-01-14,95.97,94.72,95.81,95.69,96.75092081203199,-96.75092081203199,-96.52528523464999,-96.09542718715801,-96.52528523464999,-97.12685328103596\n1998-01-15,95.75,94.81,94.94,95.5,96.28364714706943,-96.28364714706943,-96.01990956353148,-95.97,-96.01990956353148,-96.442999420122\n1998-01-16,96.69,95.66,96.23,96.25,90.91,90.91,90.91,90.91,90.91,89.09179999999999\n1998-01-20,98.0,96.5,98.0,96.69,91.0256,91.0256,91.0256,91.0256,91.0256,89.243764\n1998-01-21,97.69,96.16,97.16,97.22,91.304576,91.304576,91.234832,91.234832,91.234832,89.50645108\n1998-01-22,96.88,95.88,96.3,96.16,91.57239296,91.57239296,91.43778704,91.43778704,91.43778704,89.76125754760001\n1998-01-23,96.78,95.0,95.66,96.5,91.8294972416,91.8294972416,91.63465342880001,91.63465342880001,91.63465342880001,90.00841982117201\n1998-01-26,96.73,93.75,95.75,96.38,92.076317351936,92.076317351936,91.825613825936,91.825613825936,91.825613825936,90.24816722653685\n1998-01-27,98.0,95.66,97.0,95.81,92.31326465785855,92.31326465785855,92.01084541115792,92.01084541115792,92.01084541115792,90.48072220974075\n1998-01-28,98.11,97.17,97.88,97.41,92.54073407154421,92.54073407154421,92.19052004882317,92.19052004882317,92.19052004882317,90.70630054344852\n1998-01-29,99.56,97.56,98.75,97.84,92.87489002725155,92.87489002725155,92.42729924687025,92.42729924687025,92.42729924687025,91.00244852171058\n1998-01-30,98.97,98.0,98.31,98.78,93.40969882507143,93.40969882507143,92.78393428452674,92.78393428452674,92.78393428452674,91.43032609562505\n1998-02-02,100.5,99.75,100.25,99.91,93.90172291906572,93.90172291906572,93.1227375703004,93.1227375703004,93.1227375703004,91.8368097908438\n1998-02-03,100.81,99.72,100.69,100.0,94.56155062715915,94.56155062715915,93.56537331608237,93.56537331608237,93.56537331608237,92.35660120339317\n1998-02-04,101.16,99.88,100.59,100.28,95.31136455190006,95.31136455190006,94.0724971839566,94.0724971839566,94.0724971839566,92.94833911915565\n1998-02-05,101.59,100.03,100.38,101.31,96.13017351463405,96.13017351463405,94.63949740924006,94.63949740924006,94.63949740924006,93.60527198962319\n1998-02-06,101.5,100.69,101.28,101.0,97.0037457522926,97.0037457522926,95.26504264240846,95.26504264240846,95.26504264240846,94.3238975105571\n1998-02-09,101.75,100.72,101.14,101.72,97.7375464319258,97.7375464319258,95.8342888045917,95.8342888045917,95.8342888045917,94.97784673460697\n1998-02-10,102.47,101.19,102.05,101.44,98.45978807417914,98.45978807417914,96.42585992413252,96.42585992413252,96.42585992413252,95.65506206114627\n1998-02-11,103.19,101.7,102.13,102.09,99.26183045934332,99.26183045934332,97.09071533247794,97.09071533247794,97.09071533247794,96.40470523442018\n1998-02-12,102.94,100.88,102.66,101.72,100.04746436747465,100.04746436747465,97.82262949258059,97.82262949258059,97.82262949258059,97.21894060628975\n1998-02-13,102.94,101.88,102.16,102.19,100.67597149397972,100.67597149397972,98.46671395347092,98.46671395347092,98.46671395347092,97.93546773353498\n1998-02-17,103.09,102.16,102.34,102.81,100.88,100.88,99.0335082790544,99.0335082790544,99.0335082790544,98.56601160551078\n1998-02-18,103.47,102.28,103.41,102.31,101.342,101.342,99.53228728556788,99.53228728556788,99.53228728556788,99.12089021284949\n1998-02-19,103.41,102.75,103.0,103.25,101.7676,101.7676,100.04418993844405,100.04418993844405,100.04418993844405,99.68627448517906\n1998-02-20,103.75,102.38,103.56,103.08,102.10808,102.10808,100.48954524644633,100.48954524644633,100.48954524644633,100.17815880210578\n1998-02-23,104.25,103.34,104.0,104.25,102.38,102.38,100.94600891194384,100.94600891194384,100.94600891194384,100.67821656981097\n1998-02-24,104.09,102.94,103.19,103.91,102.38,102.38,101.44160757515226,101.44160757515226,101.44160757515226,101.21398408433933\n1998-02-25,104.88,103.63,104.48,103.75,102.75399999999999,102.75399999999999,101.86286643887942,101.86286643887942,101.86286643887942,101.66938647168843\n1998-02-26,105.16,104.19,105.06,104.44,102.94,102.94,102.34560780865871,102.34560780865871,102.34560780865871,102.18308463621828\n1998-02-27,105.53,104.31,105.2,104.97,103.384,103.384,102.82405448118674,102.82405448118674,102.82405448118674,102.68916024806117\n1998-03-02,105.75,104.63,104.81,105.25,103.8132,103.8132,103.31112467457312,103.31112467457312,103.31112467457312,103.20051140341016\n1998-03-03,105.47,104.5,105.41,104.53,104.20056,104.20056,103.77451098640422,103.77451098640422,103.77451098640422,103.68491423676222\n1998-03-04,105.41,104.06,104.97,105.09,105.75,-105.75,-105.75,-105.75,-105.75,-107.865\n1998-03-05,104.44,103.16,103.75,103.5,105.7162,-105.7162,-105.6993,-105.6993,-105.6993,-107.75085\n1998-03-06,105.88,104.44,105.75,104.56,103.16,103.16,103.16,103.16,103.16,-107.5213075\n1998-03-09,106.22,105.25,105.44,105.53,103.16,103.16,103.16,103.16,103.16,-107.30324212500001\n1998-03-10,106.84,105.38,106.66,106.22,103.2824,103.2824,103.2518,103.2518,103.2518,-107.09608001875002\n1998-03-11,107.31,106.73,107.25,106.97,103.49585599999999,103.49585599999999,103.395328,103.395328,103.395328,101.0968\n1998-03-12,107.59,106.5,107.25,107.09,103.80098751999999,103.80098751999999,103.5910616,103.5910616,103.5910616,101.221064\n1998-03-13,108.0,106.88,107.22,107.84,104.179888768,104.179888768,103.830997904,103.830997904,103.830997904,101.41213207999999\n1998-03-16,108.28,107.53,108.25,107.84,104.63830211583999,104.63830211583999,104.12282805072,104.12282805072,104.12282805072,101.6756467968\n1998-03-17,108.5,107.66,108.47,108.31,105.14813981962239,105.14813981962239,104.45540180666241,104.45540180666241,104.45540180666241,102.00586445696\n1998-03-18,108.94,108.0,108.78,108.25,105.68443744848281,105.68443744848281,104.81941564406279,104.81941564406279,104.81941564406279,102.39551258954239\n1998-03-19,109.38,108.66,109.34,108.97,106.2704387077559,106.2704387077559,105.23147407965651,105.23147407965651,105.23147407965651,102.85362670827442\n1998-03-20,110.19,108.88,110.0,109.56,106.89235096620472,106.89235096620472,105.68781193089428,105.68781193089428,105.68781193089428,103.37573657161246\n1998-03-23,110.31,109.41,109.5,109.72,107.55188077296377,107.55188077296377,106.22807449918697,106.22807449918697,106.22807449918697,103.98902028016734\n1998-03-24,110.81,109.94,110.59,110.06,108.10350461837102,108.10350461837102,106.75872481429266,106.75872481429266,106.75872481429266,104.62111825215061\n1998-03-25,111.53,109.19,110.19,111.41,108.64480369469682,108.64480369469682,107.32590334029169,107.32590334029169,107.32590334029169,105.30189524441404\n1998-03-26,110.75,109.63,110.13,109.88,109.19,109.19,107.95651783924794,107.95651783924794,107.95651783924794,106.04926781508436\n1998-03-27,110.78,109.0,109.53,110.75,111.53,-111.53,108.49254016336074,108.49254016336074,108.49254016336074,106.70695567727424\n1998-03-30,110.09,108.97,109.34,109.63,111.4794,-111.4794,108.94815913885664,108.94815913885664,108.94815913885664,107.28572099600133\n1998-03-31,111.19,109.75,110.09,110.16,111.379024,-111.379024,108.97,108.97,108.97,107.79503447648118\n1998-04-01,111.08,109.41,110.98,110.31,111.28266304,-111.28266304,108.97,108.97,108.97,108.24323033930344\n1998-04-02,112.25,110.75,112.03,110.94,108.97,108.97,109.354,109.354,109.354,108.63764269858703\n1998-04-03,112.81,111.84,112.19,112.34,109.0356,109.0356,109.41,109.41,109.41,109.10724914777072\n1998-04-06,113.38,112.06,112.25,113.25,109.186576,109.186576,109.988,109.988,109.988,109.62563426708282\n1998-04-07,111.94,110.16,111.0,111.75,109.43818144000001,109.43818144000001,-113.38,-113.38,-113.38,-115.6476\n1998-04-08,111.28,109.75,110.13,111.22,109.6746905536,109.6746905536,-113.38,-113.38,-113.38,-115.482972\n1998-04-09,111.28,110.53,111.0,110.56,109.75,109.75,-113.1985,-113.1985,-113.1985,-115.1963234\n1998-04-13,111.38,110.0,111.0,111.38,109.75,109.75,-113.02607499999999,-113.02607499999999,-113.02607499999999,-114.92400723\n1998-04-14,111.72,110.91,111.69,111.13,109.9678,109.9678,-112.86227124999999,-112.86227124999999,-112.86227124999999,-114.6653068685\n1998-04-15,112.13,111.16,112.02,111.97,110.0,110.0,-112.7066576875,-112.7066576875,-112.7066576875,-114.41954152507499\n1998-04-16,111.5,110.5,110.91,111.31,110.2028,110.2028,-112.55882480312499,-112.55882480312499,-112.55882480312499,-114.18606444882124\n1998-04-17,112.41,110.44,112.22,110.72,110.39343199999999,110.39343199999999,-112.41838356296874,-112.41838356296874,-112.41838356296874,-113.96426122638017\n1998-04-20,112.56,111.88,112.41,112.0,110.44,110.44,109.75,109.75,109.75,-113.75354816506116\n1998-04-21,113.16,111.91,112.63,112.44,110.44,110.44,109.8062,109.8062,109.8062,-113.5533707568081\n1998-04-22,113.44,112.81,113.0,112.88,110.6164,110.6164,109.906814,109.906814,109.906814,107.555\n1998-04-23,113.0,111.75,112.09,112.63,110.842288,110.842288,110.04814144,110.04814144,110.04814144,107.6727\n1998-04-24,112.47,110.34,110.88,111.75,113.44,-113.44,110.18381578239999,110.18381578239999,110.18381578239999,107.78804600000001\n1998-04-27,110.66,107.63,108.59,109.38,113.378,-113.378,-113.44,-113.44,-113.44,-115.7088\n1998-04-28,109.81,108.13,108.63,109.78,113.14808,-113.14808,-113.2657,-113.2657,-113.2657,-115.466436\n1998-04-29,109.97,108.44,109.53,109.03,112.9273568,-112.9273568,-113.096629,-113.096629,-113.096629,-115.23134292\n1998-04-30,111.92,110.41,111.44,110.56,112.715462528,-112.715462528,-112.93263012999999,-112.93263012999999,-112.93263012999999,-115.00330263240001\n1998-05-01,112.31,111.31,112.19,111.75,112.51204402688,-112.51204402688,-112.7735512261,-112.7735512261,-112.7735512261,-114.782103553428\n1998-05-04,113.31,112.16,112.25,112.72,107.63,107.63,107.63,107.63,107.63,-114.56754044682516\n1998-05-05,112.16,111.13,111.66,112.0,107.7436,107.7436,107.7436,107.7436,107.7436,-114.35941423342041\n1998-05-06,112.13,110.47,110.5,112.13,107.854928,107.854928,107.854928,107.854928,107.854928,-114.1575318064178\n1998-05-07,110.56,109.41,109.59,110.5,107.96402944,107.96402944,107.96402944,107.96402944,107.96402944,-113.96170585222526\n1998-05-08,111.38,110.0,111.0,110.0,108.0709488512,108.0709488512,108.0709488512,108.0709488512,108.0709488512,-113.7717546766585\n1998-05-11,112.22,110.38,110.86,111.56,108.175729874176,108.175729874176,108.175729874176,108.175729874176,108.175729874176,-113.58750203635874\n1998-05-12,111.88,110.25,111.64,110.81,108.27841527669248,108.27841527669248,108.27841527669248,108.27841527669248,108.27841527669248,-113.40877697526798\n1998-05-13,112.56,111.59,112.06,112.06,108.37904697115863,108.37904697115863,108.37904697115863,108.37904697115863,108.37904697115863,-113.23541366600995\n1998-05-14,112.69,111.34,111.97,111.53,108.47766603173545,108.47766603173545,108.47766603173545,108.47766603173545,108.47766603173545,-113.06725125602965\n1998-05-15,112.22,110.81,111.0,112.0,108.57431271110075,108.57431271110075,108.57431271110075,108.57431271110075,108.57431271110075,-112.90413371834876\n1998-05-18,111.59,109.83,110.84,110.72,108.66902645687873,108.66902645687873,108.66902645687873,108.66902645687873,108.66902645687873,-112.7459097067983\n1998-05-19,111.69,110.78,111.06,111.0,108.76184592774115,108.76184592774115,108.76184592774115,108.76184592774115,108.76184592774115,-112.59243241559435\n1998-05-20,112.5,110.88,112.28,112.09,108.85280900918633,108.85280900918633,108.85280900918633,108.85280900918633,108.85280900918633,105.47739999999999\n1998-05-21,112.78,111.31,111.69,112.38,108.9419528290026,108.9419528290026,108.9419528290026,108.9419528290026,108.9419528290026,105.61785199999998\n1998-05-22,112.06,110.94,111.16,111.75,109.02931377242255,109.02931377242255,109.02931377242255,109.02931377242255,109.02931377242255,105.83271643999998\n1998-05-26,112.09,109.44,109.53,112.09,109.1149274969741,109.1149274969741,109.1149274969741,109.1149274969741,109.1149274969741,106.04113494679999\n1998-05-27,109.91,107.58,109.63,109.31,113.31,-113.31,-113.31,-113.31,-113.31,106.24330089839599\n1998-05-28,110.38,108.73,110.0,109.88,113.1954,-113.1954,-113.13810000000001,-113.13810000000001,-113.13810000000001,106.4394018714441\n1998-05-29,110.81,109.38,109.38,110.63,113.08309200000001,-113.08309200000001,-112.97135700000001,-112.97135700000001,-112.97135700000001,106.62961981530079\n1998-06-01,110.22,108.56,109.5,108.97,112.97303016000001,-112.97303016000001,-112.80961629000001,-112.80961629000001,-112.80961629000001,106.81413122084176\n1998-06-02,110.34,109.16,109.59,110.0,112.86516955680001,-112.86516955680001,-112.6527278013,-112.6527278013,-112.6527278013,106.9931072842165\n1998-06-03,110.19,108.22,108.5,109.88,112.75946616566401,-112.75946616566401,-112.500545967261,-112.500545967261,-112.500545967261,107.16671406569002\n1998-06-04,110.06,108.06,109.91,108.25,112.65587684235072,-112.65587684235072,-112.35292958824317,-112.35292958824317,-112.35292958824317,107.33511264371931\n1998-06-05,111.88,109.88,111.81,110.38,112.55435930550371,-112.55435930550371,-112.20974170059587,-112.20974170059587,-112.20974170059587,107.49845926440773\n1998-06-08,112.47,111.66,111.88,111.94,107.58,107.58,107.58,107.58,107.58,107.6569054864755\n1998-06-09,112.42,111.41,112.28,111.72,107.6778,107.6778,107.6778,107.6778,107.6778,107.81059832188123\n1998-06-10,113.06,111.25,111.38,111.63,107.773644,107.773644,107.773644,107.773644,107.773644,107.9596803722248\n1998-06-11,111.88,109.28,109.66,111.44,107.98509824,107.98509824,107.93223468000001,107.93223468000001,107.93223468000001,108.1636931573358\n1998-06-12,110.44,108.25,110.25,109.88,108.1880943104,108.1880943104,108.0860676396,108.0860676396,108.0860676396,-115.3212\n1998-06-15,109.91,107.88,108.0,108.81,113.06,-113.06,-113.06,-113.06,-113.06,-115.109064\n1998-06-16,109.16,107.75,109.06,108.41,112.9564,-112.9564,-112.9046,-112.9046,-112.9046,-114.7476108\n1998-06-17,111.78,109.94,111.25,110.16,112.748144,-112.748144,-112.64687,-112.64687,-112.64687,-114.257778044\n1998-06-18,111.44,110.75,111.16,111.19,112.54821824,-112.54821824,-112.4020265,-112.4020265,-112.4020265,-113.80223358092\n1998-06-19,111.23,109.63,110.03,111.06,112.3562895104,-112.3562895104,-112.169425175,-112.169425175,-112.169425175,-113.3785772302556\n1998-06-22,111.06,110.06,110.38,110.25,112.172037929984,-112.172037929984,-111.94845391625,-111.94845391625,-111.94845391625,-112.9845768241377\n1998-06-23,112.19,111.0,111.97,111.09,107.75,107.75,107.75,107.75,107.75,-112.61815644644807\n1998-06-24,113.69,111.61,113.47,112.16,107.8388,107.8388,107.8388,107.8388,107.8388,105.595\n1998-06-25,114.47,112.81,113.0,113.91,108.07284800000001,108.07284800000001,108.014336,108.014336,108.014336,105.7569\n1998-06-26,113.84,113.13,113.41,113.31,108.45667712000001,108.45667712000001,108.27256256,108.27256256,108.27256256,106.018293\n1998-06-29,114.69,113.8,113.89,114.25,108.81747649280001,108.81747649280001,108.52046005759999,108.52046005759999,108.52046005759999,106.27184421\n1998-06-30,114.19,113.06,113.36,113.91,109.28727837337601,109.28727837337601,108.82893705471999,108.82893705471999,108.82893705471999,106.6085704416\n1998-07-01,114.94,113.63,114.94,114.06,109.71949610350593,109.71949610350593,109.12199020198399,109.12199020198399,109.12199020198399,106.93182762393599\n1998-07-02,114.88,114.25,114.63,114.72,110.24154649315534,110.24154649315534,109.47107078986495,109.47107078986495,109.47107078986495,107.33223624273919\n1998-07-06,115.84,114.56,115.78,114.78,110.7113918438398,110.7113918438398,109.79920654247306,109.79920654247306,109.79920654247306,107.71262443060223\n1998-07-07,116.13,115.28,115.56,115.98,111.32682482257903,111.32682482257903,110.22206208449994,110.22206208449994,110.22206208449994,108.2002669647661\n1998-07-08,116.94,115.75,116.81,115.88,111.99926934741796,111.99926934741796,110.69469711773995,110.69469711773995,110.69469711773995,108.75534827723247\n1998-07-09,116.72,115.63,116.0,116.28,112.78978625183109,112.78978625183109,111.25677437714336,111.25677437714336,111.25677437714336,109.41012041505387\n1998-07-10,116.91,115.06,116.53,116.03,113.45382045153812,113.45382045153812,111.76826468320046,111.76826468320046,111.76826468320046,110.01251078184956\n1998-07-13,116.84,116.06,116.75,116.56,114.01160917929202,114.01160917929202,112.23372086171241,112.23372086171241,112.23372086171241,110.56670991930159\n1998-07-14,118.16,116.94,117.81,116.94,114.4801517106053,114.4801517106053,112.65728598415829,112.65728598415829,112.65728598415829,111.07657312575746\n1998-07-15,118.28,117.44,117.56,118.06,115.14252440269634,115.14252440269634,113.20755738574246,113.20755738574246,113.20755738574246,111.7140815444393\n1998-07-16,118.59,117.06,118.44,117.69,115.77001952215707,115.77001952215707,113.7655260733108,113.7655260733108,113.7655260733108,112.37067338999536\n1998-07-17,119.0,118.31,118.75,118.63,116.33401561772565,116.33401561772565,114.3444629445135,114.3444629445135,114.3444629445135,113.05479931709587\n1998-07-20,119.23,117.94,118.5,118.75,116.86721249418052,116.86721249418052,114.94968276172673,114.94968276172673,114.94968276172673,113.76822339904436\n1998-07-21,119.0,116.28,116.53,119.0,119.23,-119.23,115.548927175085,115.548927175085,115.548927175085,114.4782543571686\n1998-07-22,119.59,115.53,116.63,116.34,115.53,115.53,-119.59,-119.59,-119.59,115.09598129073667\n1998-07-23,116.84,113.88,114.19,116.31,119.59,-119.59,-119.59,-119.59,-119.59,-121.9818\n1998-07-24,115.09,112.88,114.16,114.97,119.59,-119.59,-119.59,-119.59,-119.59,-121.738746\n1998-07-27,115.0,112.84,114.98,113.63,119.3216,-119.3216,-119.1203,-119.1203,-119.1203,-121.29580870000001\n1998-07-28,114.66,111.88,113.31,114.44,118.932704,-118.932704,-118.55507300000001,-118.55507300000001,-118.55507300000001,-120.703902091\n1998-07-29,114.13,112.25,112.66,113.72,118.36848768,-118.36848768,-117.82081497,-117.82081497,-117.82081497,-119.90975090281\n1998-07-30,114.59,113.41,114.34,113.63,117.8494086656,-117.8494086656,-117.1673253233,-117.1673253233,-117.1673253233,-119.18707332155711\n1998-07-31,114.5,111.31,112.06,114.34,117.371855972352,-117.371855972352,-116.585719537737,-116.585719537737,-116.585719537737,-118.52943672261696\n1998-08-03,112.42,111.03,111.38,111.78,116.7656703751168,-116.7656703751168,-115.8998759978312,-115.8998759978312,-115.8998759978312,-117.7352986831291\n1998-08-04,112.22,107.25,107.61,112.22,116.07738993010278,-116.07738993010278,-115.16939459815652,-115.16939459815652,-115.16939459815652,-116.86360985432232\n1998-08-05,108.88,105.59,108.16,107.94,114.84155533988839,-114.84155533988839,-113.82309751646991,-113.82309751646991,-113.82309751646991,-115.42156837617397\n1998-08-06,109.52,107.56,109.09,108.13,113.36130648550625,-113.36130648550625,-112.25880898834063,-112.25880898834063,-112.25880898834063,-113.7502017522244\n1998-08-07,110.59,108.47,109.03,109.69,112.11789744782524,-112.11789744782524,-110.99173528055591,-110.99173528055591,-110.99173528055591,-112.36296745434625\n1998-08-10,109.66,108.19,108.59,108.75,111.07343385617321,-111.07343385617321,-110.59,-110.59,-110.59,-111.21156298710738\n1998-08-11,107.44,105.5,107.06,106.78,110.59,-110.59,-110.59,-110.59,-110.59,-110.59\n1998-08-12,108.81,107.5,108.5,107.75,109.6738,-109.6738,-109.66,-109.66,-109.66,-109.66\n1998-08-13,109.66,107.63,107.64,108.81,105.5,105.5,105.5,105.5,105.5,103.39\n1998-08-14,108.72,105.78,106.48,108.34,105.5832,105.5832,105.5832,105.5832,105.5832,103.5154\n1998-08-17,108.94,105.5,108.5,106.0,109.66,-109.66,-109.66,-109.66,-109.66,103.63829199999999\n1998-08-18,110.59,108.78,110.25,109.0,105.5,105.5,105.5,105.5,105.5,103.75872616\n1998-08-19,111.09,109.63,110.0,111.09,105.5,105.5,105.5,105.5,105.5,103.9636643752\n1998-08-20,110.41,109.16,109.25,109.69,105.7236,105.7236,105.6677,105.6677,105.6677,104.248717800192\n1998-08-21,108.72,105.5,108.38,108.19,111.09,-111.09,-111.09,-111.09,-111.09,104.52236908818432\n1998-08-24,109.94,108.31,109.06,109.25,110.9782,-110.9782,-110.9223,-110.9223,-110.9223,104.78507432465695\n1998-08-25,111.25,108.64,109.5,110.38,105.5,105.5,105.5,105.5,105.5,105.03727135167067\n1998-08-26,109.63,107.75,108.5,108.28,105.615,105.615,105.615,105.615,105.615,105.34790778408714\n1998-08-27,107.84,103.89,104.25,107.0,111.25,-111.25,-111.25,-111.25,-111.25,-113.475\n1998-08-28,105.72,102.16,103.0,104.97,111.1028,-111.1028,-111.0292,-111.0292,-111.0292,-113.18745\n1998-08-31,104.02,95.0,96.25,103.75,110.745088,-110.745088,-110.58574,-110.58574,-110.58574,-112.6360775\n1998-09-01,100.56,93.63,99.69,96.06,109.80038272,-109.80038272,-109.4947382,-109.4947382,-109.4947382,-111.401552075\n1998-09-02,101.75,98.78,99.0,99.81,108.5067521024,-108.5067521024,-108.066911762,-108.066911762,-108.066911762,-109.80211238825\n1998-09-03,99.38,96.69,98.52,97.63,107.316611934208,-107.316611934208,-106.76758970342,-106.76758970342,-106.76758970342,-108.34662227330749\n1998-09-04,99.81,95.78,97.63,99.44,106.22168297947135,-106.22168297947135,-105.5852066301122,-105.5852066301122,-105.5852066301122,-107.02212626870981\n1998-09-08,102.97,99.81,102.59,100.88,105.21434834111365,-105.21434834111365,-104.5092380334021,-104.5092380334021,-104.5092380334021,-105.81683490452593\n1998-09-09,103.13,100.48,100.75,102.75,104.28760047382455,-104.28760047382455,-103.5301066103959,-103.5301066103959,-103.5301066103959,-104.7200197631186\n1998-09-10,99.34,96.81,98.25,98.44,103.43499243591859,-103.43499243591859,-103.13,-103.13,-103.13,-103.72191798443792\n1998-09-11,101.5,97.0,101.25,98.19,103.13,-103.13,-103.13,-103.13,-103.13,-103.13\n1998-09-14,104.45,102.09,103.16,102.88,93.63,93.63,93.63,93.63,93.63,91.75739999999999\n1998-09-15,104.31,102.28,104.2,102.88,93.84639999999999,93.84639999999999,93.84639999999999,93.84639999999999,93.84639999999999,92.01125199999998\n1998-09-16,105.25,103.16,105.0,104.75,94.058472,94.058472,94.058472,94.058472,94.058472,92.26002695999999\n1998-09-17,103.03,101.78,102.23,102.25,94.50613312,94.50613312,94.39421784,94.39421784,94.39421784,92.64972615119999\n1998-09-18,102.41,101.09,101.97,102.38,94.9358877952,94.9358877952,94.7198913048,94.7198913048,94.7198913048,93.02773436666399\n1998-09-21,103.41,98.94,102.19,99.63,95.348452283392,95.348452283392,95.035794565656,95.035794565656,95.035794565656,93.39440233566407\n1998-09-22,103.66,102.16,103.0,103.5,95.74451419205633,95.74451419205633,95.34222072868633,95.34222072868633,95.34222072868633,93.75007026559415\n1998-09-23,107.0,103.78,106.63,103.88,96.12473362437407,96.12473362437407,95.63945410682574,95.63945410682574,95.63945410682574,94.09506815762633\n1998-09-24,106.81,103.25,104.38,106.31,96.77724960691162,96.77724960691162,96.09387594255271,96.09387594255271,96.09387594255271,94.61126543132127\n1998-09-25,105.42,102.63,104.3,103.13,97.39061463049693,97.39061463049693,96.5301209048506,96.5301209048506,96.5301209048506,95.10681481406841\n1998-09-28,106.31,104.25,104.91,105.31,97.96717775266711,97.96717775266711,96.94891606865659,96.94891606865659,96.94891606865659,95.58254222150568\n1998-09-29,105.94,103.38,104.94,105.38,98.50914708750709,98.50914708750709,97.35095942591032,97.35095942591032,97.35095942591032,96.03924053264545\n1998-09-30,104.31,101.38,101.84,103.5,99.01859826225666,99.01859826225666,97.73692104887391,97.73692104887391,97.73692104887391,96.47767091133963\n1998-10-01,101.55,98.09,98.63,100.03,107.0,-107.0,-107.0,-107.0,-107.0,96.89856407488604\n1998-10-02,100.88,97.22,100.31,98.88,106.8218,-106.8218,-106.7327,-106.7327,-106.7327,-109.14\n1998-10-05,100.0,96.34,99.0,99.59,106.43772799999999,-106.43772799999999,-106.257065,-106.257065,-106.257065,-108.7824\n1998-10-06,101.28,97.53,98.53,100.75,105.83186432,-105.83186432,-105.56287044999999,-105.56287044999999,-105.56287044999999,-108.16028\n1998-10-07,100.03,95.75,97.22,98.63,105.26235246079999,-105.26235246079999,-104.91726951849999,-104.91726951849999,-104.91726951849999,-107.569266\n1998-10-08,96.75,92.22,96.22,94.56,104.50136426393598,-104.50136426393598,-104.092215261835,-104.092215261835,-104.092215261835,-106.74191738\n1998-10-09,99.56,94.06,98.63,97.0,103.27322783754238,-103.27322783754238,-102.78627158303314,-102.78627158303314,-102.78627158303314,-105.43494481580001\n1998-10-12,101.44,99.69,99.78,100.63,102.16790505378815,-102.16790505378815,-101.62398170889949,-101.62398170889949,-101.62398170889949,-104.24559978237801\n1998-10-13,100.41,98.75,99.53,99.56,101.44,-101.44,-101.44,-101.44,-101.44,-103.16329580196398\n1998-10-14,101.81,98.84,100.5,98.94,92.22,92.22,92.22,92.22,92.22,-102.17839917978722\n1998-10-15,107.25,99.94,105.03,100.13,92.4118,92.4118,92.4118,92.4118,92.4118,90.3756\n1998-10-16,106.75,105.0,105.66,106.13,93.005328,93.005328,92.856946,92.856946,92.856946,90.713088\n1998-10-19,106.81,105.5,106.34,105.69,93.57511488,93.57511488,93.28873761999999,93.28873761999999,93.28873761999999,91.04382624\n1998-10-20,108.8,106.09,106.5,107.56,94.1221102848,94.1221102848,93.7075754914,93.7075754914,93.7075754914,91.3679497152\n1998-10-21,107.63,105.88,107.13,106.88,95.002783667712,95.002783667712,94.31127247174399,94.31127247174399,94.31127247174399,91.890911223744\n1998-10-22,108.47,106.16,108.0,106.78,95.83061664764928,95.83061664764928,94.89082157287423,94.89082157287423,94.89082157287423,92.39818388703168\n1998-10-23,108.0,106.78,107.13,107.97,96.60877964879032,96.60877964879032,95.44718870995926,95.44718870995926,95.44718870995926,92.89023837042073\n1998-10-26,108.56,106.78,107.55,107.72,97.3402528698629,97.3402528698629,95.98130116156089,95.98130116156089,95.98130116156089,93.3675312193081\n1998-10-27,108.97,106.28,106.63,108.44,98.02783769767112,98.02783769767112,96.49404911509846,96.49404911509846,96.49404911509846,93.83050528272886\n1998-10-28,107.81,106.03,106.78,106.56,98.90321068185743,98.90321068185743,97.11784665934354,97.11784665934354,97.11784665934354,94.43608507141971\n1998-10-29,108.97,106.63,108.97,107.09,99.70855382730883,99.70855382730883,97.71045432637636,97.71045432637636,97.71045432637636,95.01744166856292\n1998-10-30,110.91,109.5,110.0,110.13,100.44946952112413,100.44946952112413,98.27343161005754,98.27343161005754,98.27343161005754,95.5755440018204\n1998-11-02,111.75,110.19,111.48,110.81,101.49552256901171,101.49552256901171,99.03162571345409,99.03162571345409,99.03162571345409,96.34226680172938\n1998-11-03,111.81,110.75,111.13,111.59,102.7260598607303,102.7260598607303,99.9219119135123,99.9219119135123,99.9219119135123,97.26673079362561\n1998-11-04,113.09,111.09,111.84,112.47,103.99781148022807,103.99781148022807,100.87295896043132,100.87295896043132,100.87295896043132,98.28475963807182\n1998-11-05,113.81,111.13,113.73,111.53,105.45256164339158,105.45256164339158,101.9724926539925,101.9724926539925,101.9724926539925,99.46917886702607\n1998-11-06,114.5,113.31,114.28,113.47,106.95690054758109,106.95690054758109,103.15624338859325,103.15624338859325,103.15624338859325,100.75985276899372\n1998-11-09,114.25,112.5,113.14,113.94,108.46552043806487,108.46552043806487,104.40405661584799,104.40405661584799,104.40405661584799,102.13386749209435\n1998-11-10,113.94,112.5,112.69,113.0,109.6724163504519,109.6724163504519,105.51461038810471,105.51461038810471,105.51461038810471,103.37048074288492\n1998-11-11,114.06,111.89,112.38,113.81,110.63793308036152,110.63793308036152,106.5030032454132,106.5030032454132,106.5030032454132,104.48343266859644\n1998-11-12,113.13,111.69,112.03,112.31,111.41034646428922,111.41034646428922,107.38267288841774,107.38267288841774,107.38267288841774,105.48508940173679\n1998-11-13,113.06,112.13,112.77,112.22,111.69,111.69,108.16557887069179,108.16557887069179,108.16557887069179,106.38658046156311\n1998-11-16,114.36,112.89,113.84,114.22,111.69,111.69,108.8623651949157,108.8623651949157,108.8623651949157,107.19792241540681\n1998-11-17,115.63,113.0,114.34,113.66,112.13,112.13,109.48250502347497,109.48250502347497,109.48250502347497,107.92813017386612\n1998-11-18,114.94,113.5,114.75,114.31,112.83,112.83,110.22020442065798,110.22020442065798,110.22020442065798,108.77533585474085\n1998-11-19,115.91,114.63,115.5,115.28,113.0,113.0,110.86937989017902,110.86937989017902,110.86937989017902,109.52934891071935\n1998-11-20,116.75,115.84,116.63,116.36,113.5,113.5,111.52466050445575,111.52466050445575,111.52466050445575,110.29502704143303\n1998-11-23,119.22,117.16,119.16,117.47,114.15,114.15,112.25620803383195,112.25620803383195,112.25620803383195,111.13417352604674\n1998-11-24,119.66,118.45,118.69,119.0,115.164,115.164,113.30077682875717,113.30077682875717,113.30077682875717,112.2661892324002\n1998-11-25,119.19,118.16,118.88,118.94,116.0632,116.0632,114.31825253615602,114.31825253615602,114.31825253615602,113.37526084754016\n1998-11-27,119.72,119.0,119.5,119.47,116.78255999999999,116.78255999999999,115.17293213037107,115.17293213037107,115.17293213037107,114.31797172040913\n1998-11-30,119.38,116.66,116.69,119.02,119.72,-119.72,115.94593366820799,115.94593366820799,115.94593366820799,115.18229624514368\n1998-12-01,118.03,115.22,117.81,116.13,119.72,-119.72,-119.72,-119.72,-119.72,-122.1144\n1998-12-02,117.91,116.0,117.5,117.22,119.53999999999999,-119.53999999999999,-119.585,-119.585,-119.585,-121.907568\n1998-12-03,118.31,115.19,115.28,117.25,119.3672,-119.3672,-119.45405,-119.45405,-119.45405,-121.70694096\n1998-12-04,118.88,115.59,117.97,116.63,119.116568,-119.116568,-119.2408475,-119.2408475,-119.2408475,-121.381093912\n1998-12-07,119.53,118.0,119.25,118.06,115.19,115.19,115.19,115.19,115.19,-121.0715392164\n1998-12-08,119.75,117.5,118.47,118.53,115.2768,115.2768,115.2768,115.2768,115.2768,-120.77746225557999\n1998-12-09,118.97,117.88,118.81,118.69,115.455728,115.455728,115.410996,115.410996,115.410996,-120.49808914280099\n1998-12-10,118.84,116.72,116.81,118.84,115.62749887999999,115.62749887999999,115.54116612,115.54116612,115.54116612,-120.23268468566094\n1998-12-11,117.34,115.56,117.06,116.44,119.75,-119.75,-119.75,-119.75,-119.75,-119.9805504513779\n1998-12-14,116.41,113.91,114.47,116.16,119.6662,-119.6662,-119.6243,-119.6243,-119.6243,-119.741022928809\n1998-12-15,116.75,114.53,116.63,114.69,119.435952,-119.435952,-119.33858500000001,-119.33858500000001,-119.33858500000001,-119.33285132379237\n1998-12-16,117.13,115.75,116.41,117.13,119.21491392,-119.21491392,-119.06715575000001,-119.06715575000001,-119.06715575000001,-118.9532517311269\n1998-12-17,118.56,117.02,118.5,117.22,119.0027173632,-119.0027173632,-118.80929796250001,-118.80929796250001,-118.80929796250001,-118.60022410994802\n1998-12-18,119.13,117.88,119.02,118.31,113.91,113.91,113.91,113.91,113.91,111.6318\n1998-12-21,121.34,119.0,120.31,119.25,114.0144,114.0144,114.0144,114.0144,114.0144,111.781764\n1998-12-22,121.22,119.19,120.53,120.41,114.307424,114.307424,114.234168,114.234168,114.234168,112.06851108\n1998-12-23,123.19,120.81,122.81,121.19,114.58872704,114.58872704,114.44734296,114.44734296,114.44734296,112.3466557476\n1998-12-24,123.88,122.28,122.69,123.16,115.1048034176,115.1048034176,114.7970492416,114.7970492416,114.7970492416,112.780389517696\n1998-12-28,123.31,122.0,122.63,123.25,115.80681914419199,115.80681914419199,115.25119677952,115.25119677952,115.25119677952,113.33537004181119\n1998-12-29,124.44,122.13,124.31,122.72,116.45267361265662,116.45267361265662,115.682636940544,115.682636940544,115.682636940544,113.86260153972063\n1998-12-30,124.75,123.03,123.38,123.94,117.25140625139096,117.25140625139096,116.20807872411136,116.20807872411136,116.20807872411136,114.49724544733739\n1998-12-31,123.94,122.47,122.88,123.31,118.15123750122405,118.15123750122405,116.80601321342357,116.80601321342357,116.80601321342357,115.21493826602378\n1999-01-04,125.22,121.72,122.88,123.38,118.94308900107715,118.94308900107715,117.36209228848392,117.36209228848392,117.36209228848392,115.88239258740211\n1999-01-05,124.88,122.94,124.44,122.94,119.82185654092635,119.82185654092635,117.9907249054052,117.9907249054052,117.9907249054052,116.62940118040994\n1999-01-06,127.63,125.75,127.5,125.81,120.57759662519666,120.57759662519666,118.56906691297279,118.56906691297279,118.56906691297279,117.31664908597715\n1999-01-07,127.22,125.78,126.94,126.38,121.7059811651652,121.7059811651652,119.38455089080523,119.38455089080523,119.38455089080523,118.24485066823921\n1999-01-08,128.5,125.97,127.5,128.19,122.65382417873876,122.65382417873876,120.12664131063276,120.12664131063276,120.12664131063276,119.08951410809767\n1999-01-11,127.69,125.22,126.28,127.69,123.70613582656578,123.70613582656578,120.96397717956948,120.96397717956948,120.96397717956948,120.0305626972879\n1999-01-12,126.22,123.81,124.0,126.22,128.5,-128.5,121.71757946161253,121.71757946161253,121.71757946161253,120.87750642755911\n1999-01-13,125.13,120.38,123.31,120.41,128.4062,-128.4062,-128.5,-128.5,-128.5,-131.07\n1999-01-14,123.91,120.91,121.16,123.63,128.08515200000002,-128.08515200000002,-128.2564,-128.2564,-128.2564,-130.7493\n1999-01-15,124.78,122.03,124.31,122.38,127.77694592000002,-127.77694592000002,-128.02010800000002,-128.02010800000002,-128.02010800000002,-130.438221\n1999-01-19,127.47,123.5,125.28,125.3,127.48106808320001,-127.48106808320001,-127.79090476000002,-127.79090476000002,-127.79090476000002,-130.13647437\n1999-01-20,127.94,125.03,125.63,126.09,120.38,120.38,120.38,120.38,120.38,-129.8437801389\n1999-01-21,125.84,123.22,123.59,125.58,120.5312,120.5312,120.5312,120.5312,120.5312,-129.559866734733\n1999-01-22,123.84,121.78,122.56,122.13,120.679376,120.679376,120.679376,120.679376,120.679376,-129.284470732691\n1999-01-25,124.0,121.91,123.63,123.28,120.82458848,120.82458848,120.82458848,120.82458848,120.82458848,-129.0173366107103\n1999-01-26,125.72,123.63,125.5,124.13,120.96689671040001,120.96689671040001,120.96689671040001,120.96689671040001,120.96689671040001,-128.75821651238897\n1999-01-27,126.63,124.41,124.47,126.38,121.10635877619201,121.10635877619201,121.10635877619201,121.10635877619201,121.10635877619201,-128.5068700170173\n1999-01-28,126.97,125.19,126.66,125.25,121.24303160066817,121.24303160066817,121.24303160066817,121.24303160066817,121.24303160066817,-128.26306391650678\n1999-01-29,128.3,125.41,127.88,127.34,121.37697096865482,121.37697096865482,121.37697096865482,121.37697096865482,121.37697096865482,117.9724\n1999-02-01,128.69,127.0,127.09,128.69,121.65389212990863,121.65389212990863,121.58466183959517,121.58466183959517,121.58466183959517,118.178952\n1999-02-02,127.22,124.77,126.28,127.08,122.0760586021141,122.0760586021141,121.86887536601137,121.86887536601137,121.86887536601137,118.49428343999999\n1999-02-03,127.94,125.66,127.19,125.69,122.47289508598726,122.47289508598726,122.1417203513709,122.1417203513709,122.1417203513709,118.80015493679998\n1999-02-04,127.5,124.81,124.84,127.38,122.84592138082803,122.84592138082803,122.40365153731607,122.40365153731607,122.40365153731607,119.09685028869599\n1999-02-05,125.66,123.22,124.0,125.66,123.19656609797835,123.19656609797835,122.65510547582342,122.65510547582342,122.65510547582342,119.3846447800351\n1999-02-08,125.09,123.34,124.38,125.09,123.22,123.22,122.89650125679049,122.89650125679049,122.89650125679049,119.66380543663405\n1999-02-09,124.5,121.56,121.86,124.38,128.69,-128.69,-128.69,-128.69,-128.69,119.93459127353503\n1999-02-10,123.0,121.33,122.69,122.13,128.5474,-128.5474,-128.4761,-128.4761,-128.4761,120.19725353532898\n1999-02-11,125.69,122.5,125.69,123.06,128.25870400000002,-128.25870400000002,-128.118795,-128.118795,-128.118795,120.45203592926912\n1999-02-12,125.5,122.63,123.5,124.81,127.98155584000003,-127.98155584000003,-127.77935525000001,-127.77935525000001,-127.77935525000001,120.69917485139104\n1999-02-16,125.63,123.38,124.38,124.75,127.71549360640003,-127.71549360640003,-127.45688748750001,-127.45688748750001,-127.45688748750001,120.9388996058493\n1999-02-17,125.36,122.25,122.75,123.19,127.46007386214403,-127.46007386214403,-127.15054311312501,-127.15054311312501,-127.15054311312501,121.17143261767382\n1999-02-18,124.38,122.22,123.94,123.19,127.21487090765827,-127.21487090765827,-126.85951595746876,-126.85951595746876,-126.85951595746876,121.3969896391436\n1999-02-19,125.75,123.38,123.94,124.0,126.97947607135194,-126.97947607135194,-126.58304015959533,-126.58304015959533,-126.58304015959533,121.6157799499693\n1999-02-22,127.72,124.28,127.69,124.44,121.33,121.33,121.33,121.33,121.33,121.82800655147021\n1999-02-23,128.5,126.59,127.5,127.59,121.45779999999999,121.45779999999999,121.45779999999999,121.45779999999999,121.45779999999999,122.0338663549261\n1999-02-24,128.84,125.41,125.41,127.84,121.739488,121.739488,121.66906599999999,121.66906599999999,121.66906599999999,122.23355036427832\n1999-02-25,125.28,122.59,124.75,124.53,122.16551872,122.16551872,121.95590336,121.95590336,121.95590336,122.49780834970719\n1999-02-26,124.84,122.81,123.91,124.75,122.5659875968,122.5659875968,122.23126722559999,122.23126722559999,122.23126722559999,122.59\n1999-03-01,124.31,120.88,123.78,123.66,128.84,-128.84,-128.84,-128.84,-128.84,-131.4168\n1999-03-02,125.31,122.31,122.81,124.5,128.6808,-128.6808,-128.6012,-128.6012,-128.6012,-131.100696\n1999-03-03,123.56,121.78,123.13,123.09,128.524784,-128.524784,-128.369564,-128.369564,-128.369564,-130.79407512\n1999-03-04,125.23,123.27,125.0,124.06,128.37188832,-128.37188832,-128.14487708,-128.14487708,-128.14487708,-130.4966528664\n1999-03-05,128.13,125.92,127.81,127.5,128.2220505536,-128.2220505536,120.88,120.88,120.88,-130.208153280408\n1999-03-08,128.8,127.25,128.52,128.28,120.88,120.88,121.02499999999999,121.02499999999999,121.02499999999999,-129.92830868199576\n1999-03-09,129.94,127.44,128.25,128.13,121.0384,121.0384,121.25824999999999,121.25824999999999,121.25824999999999,118.4624\n1999-03-10,129.22,127.78,129.03,128.47,121.394464,121.394464,121.60551999999998,121.60551999999998,121.60551999999998,118.691952\n1999-03-11,131.19,128.88,130.22,129.69,121.73628544,121.73628544,121.93889919999998,121.93889919999998,121.93889919999998,118.91691296\n1999-03-12,131.03,129.22,129.53,131.0,122.3035083136,122.3035083136,122.40145423999998,122.40145423999998,122.40145423999998,119.2851055712\n1999-03-15,131.19,129.5,131.16,129.94,122.836697814784,122.836697814784,122.84088152799998,122.84088152799998,122.84088152799998,119.64225240406401\n1999-03-16,131.66,130.47,130.98,131.13,123.33789594589696,123.33789594589696,123.25833745159999,123.25833745159999,123.25833745159999,119.9886848319421\n1999-03-17,130.94,129.63,130.25,130.69,124.0036642702252,124.0036642702252,123.76243720450398,123.76243720450398,123.76243720450398,120.45553743866441\n1999-03-18,132.34,129.75,132.16,129.78,124.61617112860718,124.61617112860718,124.23629097223375,124.23629097223375,124.23629097223375,120.90371594111784\n1999-03-19,132.63,129.84,130.06,132.31,125.38855401574646,125.38855401574646,124.80355060417739,124.80355060417739,124.80355060417739,121.47553014406195\n1999-03-22,130.59,129.42,129.91,130.06,126.25752753385689,126.25752753385689,125.4296665558432,125.4296665558432,125.4296665558432,122.14479833541823\n1999-03-23,129.63,125.7,126.41,129.31,132.63,-132.63,-132.63,-132.63,-132.63,122.77391043529313\n1999-03-24,127.16,125.63,126.94,126.84,132.4914,-132.4914,-132.4221,-132.4221,-132.4221,123.36527580917554\n1999-03-25,129.25,127.75,129.13,128.06,132.216944,-132.216944,-132.082495,-132.082495,-132.082495,123.921159260625\n1999-03-26,129.13,127.72,128.47,128.63,131.95346624,-131.95346624,-131.75987025,-131.75987025,-131.75987025,124.4436897049875\n1999-03-29,131.44,129.16,131.22,129.16,131.70052759040001,-131.70052759040001,-131.4533767375,-131.4533767375,-131.4533767375,124.93486832268826\n1999-03-30,131.22,129.56,130.34,129.94,131.45770648678402,-131.45770648678402,-131.44,-131.44,-131.44,125.39657622332696\n1999-03-31,131.61,128.44,128.63,131.16,125.63,125.63,125.63,125.63,125.63,125.83058164992734\n1999-04-01,129.69,128.13,129.38,129.69,125.7496,125.7496,125.7496,125.7496,125.7496,126.2385467509317\n1999-04-05,132.38,130.25,132.38,130.94,125.866808,125.866808,125.866808,125.866808,125.866808,126.6220339458758\n1999-04-06,132.98,131.16,131.94,132.19,126.12733568,126.12733568,126.06220376,126.06220376,126.06220376,126.98251190912325\n1999-04-07,133.38,131.38,132.88,132.69,126.5384955392,126.5384955392,126.33891560960001,126.33891560960001,126.33891560960001,127.40233607548461\n1999-04-08,134.78,132.28,134.53,133.19,127.085815896064,127.085815896064,126.69096982912001,126.69096982912001,126.69096982912001,127.88054918944584\n1999-04-09,135.69,133.59,134.88,134.44,127.8552343064576,127.8552343064576,127.17631163937281,127.17631163937281,127.17631163937281,128.50149976239572\n1999-04-12,136.25,133.22,136.06,133.47,128.7954061896827,128.7954061896827,127.77226982461671,127.77226982461671,127.77226982461671,129.22034978615616\n1999-04-13,136.47,134.03,135.19,136.25,129.8390493231271,129.8390493231271,128.45048823864738,128.45048823864738,128.45048823864738,129.99361130967898\n1999-04-14,136.06,132.69,133.03,136.06,130.90000143142677,130.90000143142677,129.17224429716913,129.17224429716913,129.17224429716913,130.7707779525175\n1999-04-15,133.56,131.0,132.63,133.44,136.47,-136.47,129.82904231042392,129.82904231042392,129.82904231042392,-139.1994\n1999-04-16,132.91,131.19,132.13,132.91,136.3606,-136.3606,130.42672850248576,130.42672850248576,130.42672850248576,-138.953418\n1999-04-19,134.53,128.38,128.91,132.69,136.253388,-136.253388,-136.47,-136.47,-136.47,-138.71481546\n1999-04-20,131.03,128.88,130.63,129.81,135.93845248,-135.93845248,-136.22729999999999,-136.22729999999999,-136.22729999999999,-138.198074687\n1999-04-21,133.78,125.78,133.69,131.06,135.6361143808,-135.6361143808,-135.99188099999998,-135.99188099999998,-135.99188099999998,-137.70717095265\n1999-04-22,136.25,134.39,135.97,135.13,125.78,125.78,125.78,125.78,125.78,-136.8722689859645\n1999-04-23,136.75,135.0,135.75,135.88,125.78,125.78,125.78,125.78,125.78,123.2644\n1999-04-26,136.81,135.47,136.13,136.5,126.2188,126.2188,126.1091,126.1091,126.1091,123.534112\n1999-04-27,137.5,135.84,136.56,137.13,126.85427200000001,126.85427200000001,126.537136,126.537136,126.537136,123.93238864\n1999-04-28,137.25,135.0,135.34,136.44,127.70593024000001,127.70593024000001,127.0852792,127.0852792,127.0852792,124.4750930944\n1999-04-29,136.06,133.81,134.56,135.56,128.4894558208,128.4894558208,127.60601524,127.60601524,127.60601524,124.99608937062399\n1999-04-30,135.63,131.5,133.47,135.09,129.21029935513602,129.21029935513602,128.10071447800001,128.10071447800001,128.10071447800001,125.49624579579903\n1999-05-03,135.72,133.03,135.63,133.44,129.87347540672513,129.87347540672513,128.57067875410002,128.57067875410002,128.57067875410002,125.97639596396706\n1999-05-04,135.81,133.13,133.31,135.13,130.48359737418713,130.48359737418713,129.01714481639502,129.01714481639502,129.01714481639502,126.43734012540838\n1999-05-05,135.0,131.84,134.97,133.94,131.04490958425217,131.04490958425217,129.44128757557527,129.44128757557527,129.44128757557527,126.87984652039205\n1999-05-06,135.13,132.38,133.5,134.44,131.561316817512,131.561316817512,129.84422319679652,129.84422319679652,129.84422319679652,127.30465265957636\n1999-05-07,134.98,133.44,134.63,134.5,131.84,131.84,130.2270120369567,130.2270120369567,130.2270120369567,127.71246655319331\n1999-05-10,135.72,133.53,134.22,134.84,132.2928,132.2928,130.59066143510887,130.59066143510887,130.59066143510887,128.10396789106557\n1999-05-11,136.88,125.78,135.72,135.31,137.5,-137.5,-137.5,-137.5,-137.5,-140.25\n1999-05-12,137.22,131.5,136.63,135.75,137.2656,-137.2656,125.78,125.78,125.78,-139.8159\n1999-05-13,138.0,136.81,137.02,137.25,125.78,125.78,125.78,125.78,125.78,-139.394823\n1999-05-14,136.25,133.31,134.3,134.56,126.0244,126.0244,126.1466,126.1466,126.1466,-138.98637831\n1999-05-17,134.48,132.31,134.31,133.63,126.263912,126.263912,126.50220200000001,126.50220200000001,126.50220200000001,-138.59018696069998\n1999-05-18,134.98,132.63,133.63,134.53,126.49863376,126.49863376,126.84713594000002,126.84713594000002,126.84713594000002,-138.205881351879\n1999-05-19,134.88,133.25,134.81,134.47,126.72866108480001,126.72866108480001,127.18172186180001,127.18172186180001,127.18172186180001,-137.8331049113226\n1999-05-20,135.59,130.06,134.31,135.13,126.95408786310401,126.95408786310401,127.50627020594601,127.50627020594601,127.50627020594601,-137.47151176398293\n1999-05-21,134.69,119.58,133.42,134.13,138.0,-138.0,-138.0,-138.0,-138.0,-137.12076641106344\n1999-05-24,133.84,130.39,131.09,133.84,137.6316,-137.6316,-137.4474,-137.4474,-137.4474,-136.24372809051027\n1999-05-25,132.34,128.69,128.84,131.38,137.270568,-137.270568,-136.91137799999998,-136.91137799999998,-136.91137799999998,-135.41054168598475\n1999-05-26,131.0,128.09,130.66,129.31,136.91675664,-136.91675664,-136.39143665999998,-136.39143665999998,-136.39143665999998,-134.6190146016855\n1999-05-27,130.28,128.0,128.44,129.84,136.57002150719998,-136.57002150719998,-135.8870935602,-135.8870935602,-135.8870935602,-133.86706387160123\n1999-05-28,130.75,128.59,130.59,129.0,136.23022107705597,-136.23022107705597,-135.397880753394,-135.397880753394,-135.397880753394,-133.15271067802118\n1999-06-01,130.16,128.38,129.88,130.13,135.89721665551485,-135.89721665551485,-134.92334433079216,-134.92334433079216,-134.92334433079216,-132.47407514412012\n1999-06-02,130.19,120.63,129.78,129.75,135.57087232240457,-135.57087232240457,-134.4630440008684,-134.4630440008684,-134.4630440008684,-131.82937138691412\n1999-06-03,130.91,129.78,130.28,130.69,135.25105487595647,-135.25105487595647,-134.01655268084235,-134.01655268084235,-134.01655268084235,-131.2169028175684\n1999-06-04,133.19,130.94,131.94,131.47,134.93763377843734,-134.93763377843734,-133.5834561004171,-133.5834561004171,-133.5834561004171,117.1884\n1999-06-07,134.19,132.91,133.75,133.44,134.6304811028686,-134.6304811028686,119.58,119.58,119.58,117.508432\n1999-06-08,133.8,131.59,132.16,133.38,134.32947148081124,-134.32947148081124,119.87219999999999,119.87219999999999,119.87219999999999,118.00887904\n1999-06-09,133.09,131.81,132.16,132.41,134.19,-134.19,120.15855599999999,120.15855599999999,120.15855599999999,118.49431266879999\n1999-06-10,131.5,129.59,130.91,131.44,133.8978,-133.8978,120.43918487999998,120.43918487999998,120.43918487999998,118.96518328873599\n1999-06-11,132.22,129.09,129.81,131.22,133.61144399999998,-133.61144399999998,120.71420118239999,120.71420118239999,120.71420118239999,119.42192779007391\n1999-06-14,130.75,129.55,129.78,130.69,133.33081511999998,-133.33081511999998,120.98371715875199,120.98371715875199,120.98371715875199,119.8649699563717\n1999-06-15,131.66,130.08,130.59,130.47,133.0557988176,-133.0557988176,121.24784281557694,121.24784281557694,121.24784281557694,120.29472085768055\n1999-06-16,133.88,132.16,133.48,132.38,119.58,119.58,121.50668595926541,121.50668595926541,121.50668595926541,120.71157923195013\n1999-06-17,135.56,132.63,134.66,132.88,119.866,119.866,121.76035224008011,121.76035224008011,121.76035224008011,121.11593185499162\n1999-06-18,134.69,133.38,134.31,134.06,120.49376,120.49376,122.1743416728777,122.1743416728777,122.1743416728777,121.69369458079196\n1999-06-21,135.0,133.66,134.94,134.47,121.0964096,121.0964096,122.57591142269138,122.57591142269138,122.57591142269138,122.24834679756027\n1999-06-22,135.19,133.34,133.7,134.0,121.674953216,121.674953216,122.96543408001064,122.96543408001064,122.96543408001064,122.78081292565787\n1999-06-23,133.63,132.13,133.28,133.0,122.23035508736001,122.23035508736001,123.34327105761032,123.34327105761032,123.34327105761032,123.29198040863156\n1999-06-24,133.81,130.66,131.69,132.88,122.76354088386562,122.76354088386562,123.709772925882,123.709772925882,123.709772925882,123.7827011922863\n1999-06-25,133.02,131.25,131.66,132.59,123.275399248511,123.275399248511,124.06527973810554,124.06527973810554,124.06527973810554,124.25379314459485\n1999-06-28,133.63,132.47,133.38,132.69,123.76678327857056,123.76678327857056,124.41012134596238,124.41012134596238,124.41012134596238,124.70604141881105\n1999-06-29,135.13,132.78,135.13,133.0,124.23851194742774,124.23851194742774,124.74461770558351,124.74461770558351,124.74461770558351,125.14019976205861\n1999-06-30,137.5,133.84,136.75,134.63,124.69137146953062,124.69137146953062,125.069079174416,125.069079174416,125.069079174416,125.55699177157626\n1999-07-01,138.5,136.06,138.06,137.0,125.45988918135879,125.45988918135879,125.56631600743937,125.56631600743937,125.56631600743937,126.15414218299745\n1999-07-02,139.3,137.91,139.19,138.13,126.50309804685008,126.50309804685008,126.2130002070674,126.2130002070674,126.2130002070674,126.8948936520176\n1999-07-06,140.75,138.59,138.72,139.25,127.78278824216508,127.78278824216508,126.99822019464335,126.99822019464335,126.99822019464335,127.76325109637637\n1999-07-07,139.72,138.52,139.56,139.06,129.33885365310528,129.33885365310528,127.96084478101832,127.96084478101832,127.96084478101832,128.80219100866626\n1999-07-08,140.63,138.75,139.56,139.06,130.70819121473264,130.70819121473264,128.85608564634705,128.85608564634705,128.85608564634705,129.75801572797295\n1999-07-09,140.47,139.38,140.22,140.0,131.91320826896472,131.91320826896472,129.68865965110277,129.68865965110277,129.68865965110277,130.6373744697351\n1999-07-12,140.94,139.5,140.06,140.94,132.97362327668895,132.97362327668895,130.46295347552558,130.46295347552558,130.46295347552558,131.4463845121563\n1999-07-13,139.92,138.66,139.5,139.38,134.0889160179525,134.0889160179525,131.30111719748353,131.30111719748353,131.30111719748353,132.30080990606223\n1999-07-14,140.22,138.75,139.84,140.0,135.04806777543914,135.04806777543914,132.07222782168486,132.07222782168486,132.07222782168486,133.07833701451662\n1999-07-15,148.88,140.31,141.13,140.78,135.87293828687766,135.87293828687766,132.78164959595009,132.78164959595009,132.78164959595009,133.78588668321012\n1999-07-16,142.16,140.75,142.0,141.25,137.95406816097724,137.95406816097724,134.23050113231457,134.23050113231457,134.23050113231457,135.2952980148891\n1999-07-19,142.25,140.56,141.0,142.19,139.7022172552209,139.7022172552209,135.54895603040626,135.54895603040626,135.54895603040626,136.6537682134002\n1999-07-20,140.41,137.53,137.8,140.13,148.88,-148.88,136.7487499876697,136.7487499876697,136.7487499876697,-151.8576\n1999-07-21,138.91,137.0,137.88,138.09,148.653,-148.653,-148.88,-148.88,-148.88,-151.427772\n1999-07-22,138.0,135.47,136.14,137.44,148.18688,-148.18688,-148.5236,-148.5236,-148.5236,-150.7063834\n1999-07-23,137.0,135.13,135.75,136.66,147.4238672,-147.4238672,-147.87091999999998,-147.87091999999998,-147.87091999999998,-149.639836562\n1999-07-26,136.13,134.63,135.0,134.88,146.440357824,-146.440357824,-146.97905559999998,-146.97905559999998,-146.97905559999998,-148.33395127142\n1999-07-27,137.2,135.38,136.5,136.0,145.2593220416,-145.2593220416,-145.86764059599997,-145.86764059599997,-145.86764059599997,-146.8265166315638\n1999-07-28,137.31,135.59,136.73,136.25,144.19638983744,-144.19638983744,-144.85625294236,-144.85625294236,-144.85625294236,-145.48489980209177\n1999-07-29,135.25,133.31,134.38,134.94,143.239750853696,-143.239750853696,-143.93589017754758,-143.93589017754758,-143.93589017754758,-144.2908608238617\n1999-07-30,135.34,132.88,133.09,134.81,142.0481807512525,-142.0481807512525,-142.76704225801734,-142.76704225801734,-142.76704225801734,-142.86334891675966\n1999-08-02,134.75,132.5,132.94,132.75,140.76463544607714,-140.76463544607714,-141.4817267644751,-141.4817267644751,-141.4817267644751,-141.36584657924573\n1999-08-03,133.84,131.38,132.36,133.72,139.4422937747048,-139.4422937747048,-140.13446774980383,-140.13446774980383,-140.13446774980383,-139.85865266077394\n1999-08-04,133.88,130.53,130.69,132.72,137.99108089525794,-137.99108089525794,-138.6462082323372,-138.6462082323372,-138.6462082323372,-138.2477086552269\n1999-08-05,131.72,128.84,131.56,130.88,136.49886471620636,-136.49886471620636,-137.1041286681931,-137.1041286681931,-137.1041286681931,-136.62698983762925\n1999-08-06,132.0,129.5,130.06,131.22,134.9670917729651,-134.9670917729651,-135.36866164787256,-135.36866164787256,-135.36866164787256,-134.83598217497453\n1999-08-09,131.8,129.72,130.05,130.59,133.74167341837207,-133.74167341837207,-133.99764270181933,-133.99764270181933,-133.99764270181933,-133.4569062747304\n1999-08-10,130.16,127.0,128.22,129.88,132.76133873469766,-132.76133873469766,-132.91453773443726,-132.91453773443726,-132.91453773443726,-132.3950178315424\n1999-08-11,130.53,128.63,130.53,129.69,131.8,-131.8,-131.8,-131.8,-131.8,-131.8\n1999-08-12,131.81,130.0,130.02,130.69,127.0,127.0,127.0,127.0,127.0,124.46\n1999-08-13,133.25,131.13,133.19,131.63,127.0962,127.0962,127.0962,127.0962,127.0962,124.607\n1999-08-16,133.97,132.25,133.38,133.13,127.34235199999999,127.34235199999999,127.28081399999999,127.28081399999999,127.28081399999999,124.86628999999999\n1999-08-17,135.16,133.13,134.7,134.44,127.74001087999999,127.74001087999999,127.54838143999999,127.54838143999999,127.54838143999999,125.2304384\n1999-08-18,134.38,133.41,133.56,134.2,128.3336100096,128.3336100096,127.92896236799999,127.92896236799999,127.92896236799999,125.72691648\n1999-08-19,133.23,131.69,132.88,132.38,128.879721208832,128.879721208832,128.2905142496,128.2905142496,128.2905142496,126.198570656\n1999-08-20,133.91,132.69,133.88,133.06,129.38214351212542,129.38214351212542,128.63398853712,128.63398853712,128.63398853712,126.6466421232\n1999-08-23,136.45,134.66,136.39,134.81,129.8443720311554,129.8443720311554,128.960289110264,128.960289110264,128.960289110264,127.07231001704\n1999-08-24,137.97,135.38,136.5,136.06,130.50493482803984,130.50493482803984,129.40967176364816,129.40967176364816,129.40967176364816,127.63497141601759\n1999-08-25,138.78,127.91,138.44,137.19,138.78,-138.78,-138.78,-138.78,-138.78,-141.5556\n1999-08-26,138.42,136.5,136.5,138.28,138.78,-138.78,-138.78,-138.78,-138.78,-141.146232\n1999-08-27,137.06,135.13,135.16,136.88,138.78,-138.78,-138.78,-138.78,-138.78,-140.74914504\n1999-08-30,135.5,132.39,132.66,135.34,138.5626,-138.5626,-138.4539,-138.4539,-138.4539,-140.3639706888\n1999-08-31,133.75,130.75,132.5,132.94,138.349548,-138.349548,-138.137583,-138.137583,-138.137583,-139.99035156813602\n1999-09-01,133.56,132.31,133.56,132.94,138.14075704,-138.14075704,-137.83075551000002,-137.83075551000002,-137.83075551000002,-139.62794102109194\n1999-09-02,132.67,130.66,132.25,132.13,137.9361418992,-137.9361418992,-137.53313284470002,-137.53313284470002,-137.53313284470002,-139.27640279045917\n1999-09-03,136.28,134.69,136.19,134.88,137.735619061216,-137.735619061216,-137.244438859359,-137.244438859359,-137.244438859359,-138.9354107067454\n1999-09-07,136.63,134.28,135.52,136.06,137.53910667999168,-137.53910667999168,-136.96440569357824,-136.96440569357824,-136.96440569357824,-138.60464838554302\n1999-09-08,136.06,133.5,134.91,134.84,137.34652454639183,-137.34652454639183,-136.6927735227709,-136.6927735227709,-136.6927735227709,-138.28380893397673\n1999-09-09,135.25,133.69,135.13,134.75,137.157794055464,-137.157794055464,-136.63,-136.63,-136.63,-137.97259466595742\n1999-09-10,136.36,134.94,135.45,136.25,136.9728381743547,-136.9728381743547,-136.3684,-136.3684,-136.3684,-137.6707168259787\n1999-09-13,135.47,134.5,134.81,135.13,136.79158141086762,-136.79158141086762,-136.36,-136.36,-136.36,-137.37789532119933\n1999-09-14,134.56,133.38,134.06,134.06,136.61394978265028,-136.61394978265028,-136.36,-136.36,-136.36,-137.09385846156334\n1999-09-15,135.44,132.06,132.08,135.44,136.43987078699726,-136.43987078699726,-136.1065,-136.1065,-136.1065,-136.81834270771645\n1999-09-16,132.81,130.31,132.38,132.5,136.26927337125733,-136.26927337125733,-135.86060500000002,-135.86060500000002,-135.86060500000002,-136.55109242648496\n1999-09-17,133.94,132.16,133.72,132.63,136.10208790383217,-136.10208790383217,-135.62208685000002,-135.62208685000002,-135.62208685000002,-136.2918596536904\n1999-09-20,134.0,133.09,133.63,133.94,135.93824614575553,-135.93824614575553,-135.3907242445,-135.3907242445,-135.3907242445,-136.0404038640797\n1999-09-21,132.47,130.16,130.91,132.25,135.7776812228404,-135.7776812228404,-135.166302517165,-135.166302517165,-135.166302517165,-135.7964917481573\n1999-09-22,131.84,129.75,131.16,131.25,135.6203275983836,-135.6203275983836,-134.94861344165005,-134.94861344165005,-134.94861344165005,-135.5598969957126\n1999-09-23,134.25,123.78,128.0,131.81,135.46612104641594,-135.46612104641594,-134.73745503840055,-134.73745503840055,-134.73745503840055,-135.3304000858412\n1999-09-24,128.38,126.31,128.06,127.75,134.9986762045593,-134.9986762045593,-134.25,-134.25,-134.25,-134.75288008154914\n1999-09-27,129.75,128.28,128.28,128.75,134.54992915637692,-134.54992915637692,-134.25,-134.25,-134.25,-134.25\n1999-09-28,128.81,125.56,128.19,127.94,134.11913199012184,-134.11913199012184,-133.7265,-133.7265,-133.7265,-133.7265\n1999-09-29,129.13,126.78,126.78,128.44,133.70556671051696,-133.70556671051696,-133.229175,-133.229175,-133.229175,-133.229175\n1999-09-30,129.44,126.97,128.38,127.44,133.3085440420963,-133.3085440420963,-132.75671625,-132.75671625,-132.75671625,-132.75671625\n1999-10-01,128.56,126.63,128.34,127.94,132.92740228041242,-132.92740228041242,-132.30788043750002,-132.30788043750002,-132.30788043750002,-132.30788043750002\n1999-10-04,130.63,128.75,130.63,129.19,132.56150618919594,-132.56150618919594,-131.881486415625,-131.881486415625,-131.881486415625,-131.881486415625\n1999-10-05,131.97,128.69,130.19,130.72,132.2102459416281,-132.2102459416281,123.78,123.78,123.78,121.3044\n1999-10-06,132.81,130.69,132.63,130.75,123.78,123.78,123.9438,123.9438,123.9438,121.517712\n1999-10-07,133.0,131.5,132.0,132.86,123.9606,123.9606,124.209786,124.209786,124.209786,121.85648064\n1999-10-08,133.88,131.23,133.72,131.75,124.322176,124.322176,124.56139456,124.56139456,124.56139456,122.3022214144\n1999-10-11,134.13,133.31,133.81,133.59,124.89564544,124.89564544,125.02732483199999,125.02732483199999,125.02732483199999,122.88111034367999\n1999-10-12,133.31,131.19,131.41,133.13,125.6343938048,125.6343938048,125.57348534207999,125.57348534207999,125.57348534207999,123.55604372305919\n1999-10-13,131.31,128.25,128.66,130.69,126.31404230041599,126.31404230041599,126.08687622155519,126.08687622155519,126.08687622155519,124.19048109967564\n1999-10-14,129.19,126.75,128.41,128.48,134.13,-134.13,126.56946364826187,126.56946364826187,126.56946364826187,124.7868522336951\n1999-10-15,126.75,124.5,124.81,126.0,133.98239999999998,-133.98239999999998,-134.13,-134.13,-134.13,-136.8126\n1999-10-18,125.75,123.44,125.56,124.94,133.60310399999997,-133.60310399999997,-133.84109999999998,-133.84109999999998,-133.84109999999998,-136.443222\n1999-10-19,128.25,125.94,126.08,127.19,132.99331775999997,-132.99331775999997,-133.32104499999997,-133.32104499999997,-133.32104499999997,-135.7930609\n1999-10-20,129.25,127.13,129.22,127.75,132.42011869439997,-132.42011869439997,-132.82699274999996,-132.82699274999996,-132.82699274999996,-135.175407855\n1999-10-21,128.88,126.63,128.63,127.22,131.88131157273597,-131.88131157273597,-132.35764311249997,-132.35764311249997,-132.35764311249997,-134.58863746225\n1999-10-22,131.22,129.56,130.34,129.75,131.37483287837182,-131.37483287837182,-131.91176095687499,-131.91176095687499,-131.91176095687499,-134.0312055891375\n1999-10-25,130.47,128.75,129.5,129.31,131.22,-131.22,-131.48817290903125,-131.48817290903125,-131.48817290903125,-133.5016453096806\n1999-10-26,130.69,128.19,128.25,130.19,131.22,-131.22,-131.22,-131.22,-131.22,-132.99856304419657\n1999-10-27,130.31,128.25,130.13,128.38,130.7532,-130.7532,-130.831,-130.831,-130.831,-132.52063489198673\n1999-10-28,134.5,132.19,134.5,132.44,123.44,123.44,123.44,123.44,123.44,120.9712\n1999-10-29,137.69,135.72,136.56,135.84,123.6612,123.6612,123.6612,123.6612,123.6612,121.241776\n1999-11-01,137.0,135.63,135.94,136.5,124.222352,124.222352,124.08206399999999,124.08206399999999,124.08206399999999,121.73522272\n1999-11-02,137.25,134.75,134.81,135.97,124.76105792,124.76105792,124.49030207999999,124.49030207999999,124.49030207999999,122.2138660384\n1999-11-03,136.38,135.13,135.69,136.0,125.2782156032,125.2782156032,124.8862930176,124.8862930176,124.8862930176,122.678150057248\n1999-11-04,137.36,135.77,136.47,136.75,125.774686979072,125.774686979072,125.27040422707199,125.27040422707199,125.27040422707199,123.12850555553057\n1999-11-05,139.11,136.78,137.22,138.63,126.25129949990912,126.25129949990912,125.64299210025983,125.64299210025983,125.64299210025983,123.56535038886464\n1999-11-08,138.38,136.75,137.94,137.0,127.02282152991458,127.02282152991458,126.18167241624944,126.18167241624944,126.18167241624944,124.18713637331005\n1999-11-09,138.69,136.28,136.72,138.5,127.74805223811971,127.74805223811971,126.69880551959946,126.69880551959946,126.69880551959946,124.78405091837766\n1999-11-10,138.39,136.08,137.75,136.25,128.42976910383254,128.42976910383254,127.19525329881549,127.19525329881549,127.19525329881549,125.35708888164255\n1999-11-11,138.56,137.47,138.38,138.19,129.0705829576026,129.0705829576026,127.67184316686287,127.67184316686287,127.67184316686287,125.90720532637685\n1999-11-12,139.97,137.13,139.75,139.25,129.67294798014643,129.67294798014643,128.12936944018836,128.12936944018836,128.12936944018836,126.43531711332179\n1999-11-15,140.25,139.41,139.81,139.84,130.49671214173472,130.49671214173472,128.72140096817893,128.72140096817893,128.72140096817893,127.1120512576557\n1999-11-16,142.63,140.09,142.44,140.56,131.47204092756124,131.47204092756124,129.41311691008818,129.41311691008818,129.41311691008818,127.90032818219635\n1999-11-17,142.94,141.31,141.56,142.25,132.81099601625388,132.81099601625388,130.338298726382,130.338298726382,130.338298726382,128.9314052094426\n1999-11-18,143.0,141.63,142.81,142.44,134.22905657397834,134.22905657397834,131.34643482827144,131.34643482827144,131.34643482827144,130.0520927926872\n1999-11-19,142.97,142.0,142.5,142.41,135.63240752214182,135.63240752214182,132.39525569372702,132.39525569372702,132.39525569372702,131.21740444134537\n1999-11-22,143.0,141.5,142.47,142.44,136.81122231859914,136.81122231859914,133.3496826812916,133.3496826812916,133.3496826812916,132.27783804162428\n1999-11-23,142.84,140.06,140.88,142.84,137.80142674762328,137.80142674762328,134.21821123997535,134.21821123997535,134.21821123997535,133.2428326178781\n1999-11-24,142.44,140.0,142.06,140.75,138.63319846800357,138.63319846800357,135.00857222837757,135.00857222837757,135.00857222837757,134.12097768226906\n1999-11-26,142.88,141.25,141.44,142.47,139.331886713123,139.331886713123,135.7278007278236,135.7278007278236,135.7278007278236,134.92008969086484\n1999-11-29,141.92,140.44,141.0,140.88,139.91878483902332,139.91878483902332,136.38229866231947,136.38229866231947,136.38229866231947,135.647281618687\n1999-11-30,142.31,139.0,139.25,140.75,143.0,-143.0,136.9778917827107,136.9778917827107,136.9778917827107,136.30902627300517\n1999-12-01,140.5,139.0,140.13,139.31,142.92,-142.92,137.51988152226676,137.51988152226676,137.51988152226676,136.91121390843472\n1999-12-02,141.36,140.38,141.13,140.63,142.8416,-142.8416,138.01309218526274,138.01309218526274,138.01309218526274,137.45920465667558\n1999-12-03,145.41,143.03,143.69,143.03,139.0,139.0,138.4619138885891,138.4619138885891,138.4619138885891,137.95787623757477\n1999-12-06,143.72,142.25,142.75,143.53,139.1282,139.1282,139.1567224997302,139.1567224997302,139.1567224997302,138.7030886138173\n1999-12-07,143.31,141.38,141.94,143.28,139.25383599999998,139.25383599999998,139.78205024975716,139.78205024975716,139.78205024975716,139.37377975243558\n1999-12-08,142.06,140.63,140.63,141.34,139.37695927999997,139.37695927999997,140.34484522478144,140.34484522478144,140.34484522478144,139.97740177719203\n1999-12-09,142.22,139.38,141.0,141.81,145.41,-145.41,-145.41,-145.41,-145.41,-148.3182\n1999-12-10,142.81,140.88,142.0,142.28,145.2894,-145.2894,-145.2291,-145.2291,-145.2291,-148.050054\n1999-12-13,142.72,141.28,142.13,141.44,145.171212,-145.171212,-145.05362699999998,-145.05362699999998,-145.05362699999998,-147.78995238\n1999-12-14,142.48,140.63,140.81,141.63,145.05538776,-145.05538776,-144.88341819,-144.88341819,-144.88341819,-147.5376538086\n1999-12-15,142.2,140.0,141.8,140.38,144.9418800048,-144.9418800048,-144.7183156443,-144.7183156443,-144.7183156443,-147.292924194342\n1999-12-16,142.66,141.16,142.38,142.19,144.830642404704,-144.830642404704,-144.55816617497098,-144.55816617497098,-144.55816617497098,-147.05553646851172\n1999-12-17,143.31,142.06,142.38,143.0,144.72162955660994,-144.72162955660994,-144.40282118972186,-144.40282118972186,-144.40282118972186,-146.82527037445638\n1999-12-20,143.19,141.09,141.69,142.56,144.61479696547775,-144.61479696547775,-144.25213655403022,-144.25213655403022,-144.25213655403022,-146.6019122632227\n1999-12-21,144.06,141.34,143.34,141.59,144.5101010261682,-144.5101010261682,-144.1059724574093,-144.1059724574093,-144.1059724574093,-146.385254895326\n1999-12-22,144.19,142.97,143.75,143.63,144.40749900564484,-144.40749900564484,139.38,139.38,139.38,-146.17509724846622\n1999-12-23,146.44,144.97,146.09,145.02,139.38,139.38,139.4762,139.4762,139.4762,136.5924\n1999-12-27,146.78,145.06,145.81,146.5,139.5212,139.5212,139.685114,139.685114,139.685114,136.789352\n1999-12-28,146.5,145.48,146.14,145.88,139.811552,139.811552,139.96890944,139.96890944,139.96890944,137.08907144\n1999-12-29,146.81,145.25,146.34,146.31,140.09028992,140.09028992,140.2413530624,140.2413530624,140.2413530624,137.3797992968\n1999-12-30,147.88,146.19,146.63,147.13,140.4934725248,140.4934725248,140.56978540928,140.56978540928,140.56978540928,137.757007324928\n1999-12-31,147.5,146.25,146.88,146.84,141.084394722816,141.084394722816,141.0083982847232,141.0083982847232,141.0083982847232,138.2631569586816\n2000-01-03,148.25,143.88,145.56,148.25,141.62804314499073,141.62804314499073,141.4206943876398,141.4206943876398,141.4206943876398,138.74399911074752\n2000-01-04,144.06,139.64,140.06,143.53,148.25,-148.25,-148.25,-148.25,-148.25,139.31435916410268\n2000-01-05,141.53,137.25,140.28,139.94,148.25,-148.25,-148.25,-148.25,-148.25,-151.215\n2000-01-06,141.5,139.25,140.34,139.63,147.81,-147.81,-147.7,-147.7,-147.7,-150.79605\n2000-01-07,144.44,140.06,144.44,140.31,147.3876,-147.3876,-147.17749999999998,-147.17749999999998,-147.17749999999998,-150.3896685\n2000-01-10,146.91,145.03,145.81,146.25,146.98209599999998,-146.98209599999998,137.25,137.25,137.25,-149.995478445\n2000-01-11,146.09,143.5,144.09,145.81,146.91,-146.91,137.4432,137.4432,137.4432,-149.61311409165\n2000-01-12,144.63,142.88,143.34,144.59,146.91,-146.91,137.632536,137.632536,137.632536,-149.2422206689005\n2000-01-13,145.75,143.28,145.13,144.47,146.5236,-146.5236,137.81808528,137.81808528,137.81808528,-148.8824540488335\n2000-01-14,147.47,145.97,146.5,146.53,137.25,137.25,137.9999235744,137.9999235744,137.9999235744,-148.5334804273685\n2000-01-18,146.63,145.19,145.63,145.34,137.4544,137.4544,138.284025867168,138.284025867168,138.284025867168,-148.19497601454742\n2000-01-19,146.47,145.0,145.69,145.31,137.654712,137.654712,138.55960509115295,138.55960509115295,138.55960509115295,-147.866626734111\n2000-01-20,146.97,143.81,144.5,146.97,137.85101776,137.85101776,138.82691693841835,138.82691693841835,138.82691693841835,-147.54812793208768\n2000-01-21,145.5,144.09,144.13,145.5,138.0433974048,138.0433974048,139.0862094302658,139.0862094302658,139.0862094302658,-147.23918409412505\n2000-01-24,145.84,139.41,140.06,145.66,138.231929456704,138.231929456704,139.33772314735782,139.33772314735782,139.33772314735782,-146.97\n2000-01-25,142.0,139.0,141.0,140.52,138.4166908675699,138.4166908675699,-147.47,-147.47,-147.47,-146.6784\n2000-01-26,141.55,140.09,140.67,141.0,138.59775705021852,138.59775705021852,-147.2159,-147.2159,-147.2159,-146.39554800000002\n2000-01-27,142.22,138.13,140.0,141.84,147.47,-147.47,-146.969423,-146.969423,-146.969423,-146.12118156000003\n2000-01-28,140.06,135.53,136.47,139.44,147.2832,-147.2832,-146.52745185,-146.52745185,-146.52745185,-145.85504611320002\n2000-01-31,139.44,135.0,139.44,135.81,146.813072,-146.813072,-145.7576302205,-145.7576302205,-145.7576302205,-145.33879380754001\n2000-02-01,141.69,138.53,140.19,139.75,146.10428768,-146.10428768,-144.789443500655,-144.789443500655,-144.789443500655,-144.6150782410122\n2000-02-02,142.25,140.38,141.3,141.28,145.4380304192,-145.4380304192,-143.90839358559606,-143.90839358559606,-143.90839358559606,-143.94202276414137\n2000-02-03,142.97,140.0,142.84,140.88,144.811748594048,-144.811748594048,-143.1066381628924,-143.1066381628924,-143.1066381628924,-143.31608117065147\n2000-02-04,144.0,142.13,142.78,143.19,144.2230436784051,-144.2230436784051,135.0,135.0,135.0,132.3\n2000-02-07,142.78,141.44,142.72,142.56,144.0,-144.0,135.18,135.18,135.18,132.53400000000002\n2000-02-08,144.56,143.63,144.28,143.97,135.0,135.0,135.3564,135.3564,135.3564,132.76332000000002\n2000-02-09,144.47,141.38,141.41,144.47,135.1912,135.1912,135.632508,135.632508,135.632508,133.1172204\n2000-02-10,142.56,140.88,141.88,141.63,135.378576,135.378576,135.90033276,135.90033276,135.90033276,133.460503788\n2000-02-11,141.94,138.03,139.13,141.84,135.56220448000002,135.56220448000002,136.1601227772,136.1601227772,136.1601227772,133.79348867436002\n2000-02-14,139.78,138.31,139.25,139.78,135.74216039040002,135.74216039040002,136.412119093884,136.412119093884,136.412119093884,134.1164840141292\n2000-02-15,141.22,137.8,140.75,139.25,135.918517182592,135.918517182592,136.65655552106747,136.65655552106747,136.65655552106747,134.42978949370533\n2000-02-16,140.94,138.8,139.09,140.38,136.09134683894018,136.09134683894018,136.89365885543546,136.89365885543546,136.89365885543546,134.73369580889417\n2000-02-17,140.44,138.22,139.06,140.44,136.26071990216138,136.26071990216138,137.12364908977239,137.12364908977239,137.12364908977239,135.02848493462736\n2000-02-18,138.88,134.63,135.19,138.88,144.56,-144.56,-144.56,-144.56,-144.56,-147.4512\n2000-02-22,144.19,133.34,135.42,135.19,144.3614,-144.3614,-144.2621,-144.2621,-144.2621,-147.066564\n2000-02-23,137.47,134.5,136.52,135.63,144.19,-144.19,-144.19,-144.19,-144.19,-146.3802358\n2000-02-24,137.03,133.09,135.69,136.69,144.19,-144.19,-144.19,-144.19,-144.19,-145.72822401000002\n2000-02-25,137.53,133.13,133.75,135.19,143.524,-143.524,-143.413,-143.413,-143.413,-144.8435483293\n2000-02-28,136.69,132.72,135.06,133.38,142.89796,-142.89796,-142.69039,-142.69039,-142.69039,-144.020799946249\n2000-02-29,137.44,135.75,136.91,136.06,142.0837232,-142.0837232,-141.79305490000002,-141.79305490000002,-141.79305490000002,-143.0037279510866\n2000-03-01,139.0,137.22,138.31,137.63,141.33462534400002,-141.33462534400002,-140.97647995900002,-140.97647995900002,-140.97647995900002,-142.0781924354888\n2000-03-02,139.13,137.34,138.72,138.69,140.64545531648002,-140.64545531648002,-140.23339676269,-140.23339676269,-140.23339676269,-141.2359551162948\n2000-03-03,141.72,139.72,141.31,140.44,132.72,132.72,132.72,132.72,132.72,130.0656\n2000-03-06,141.34,138.75,139.39,140.81,132.9,132.9,132.9,132.9,132.9,130.298688\n2000-03-07,140.16,135.22,135.94,140.0,133.0764,133.0764,133.0764,133.0764,133.0764,130.52711424\n2000-03-08,137.84,135.03,137.05,136.47,133.24927200000002,133.24927200000002,133.24927200000002,133.24927200000002,133.24927200000002,130.75097195520001\n2000-03-09,140.59,136.13,140.59,137.25,133.41868656000003,133.41868656000003,133.41868656000003,133.41868656000003,133.41868656000003,130.97035251609603\n2000-03-10,142.0,139.53,140.0,140.19,133.58471282880004,133.58471282880004,133.58471282880004,133.58471282880004,133.58471282880004,131.1853454657741\n2000-03-13,140.47,135.69,138.88,136.69,133.92132431564804,133.92132431564804,133.83717144393603,133.83717144393603,133.83717144393603,131.50978510180087\n2000-03-14,140.09,136.16,136.5,139.28,134.24447134302213,134.24447134302213,134.08205630061795,134.08205630061795,134.08205630061795,131.82449154874683\n2000-03-15,140.44,132.5,139.5,136.88,142.0,-142.0,-142.0,-142.0,-142.0,132.12975680228442\n2000-03-16,146.69,140.88,146.31,141.63,132.5,132.5,132.5,132.5,132.5,132.4258640982159\n2000-03-17,148.0,145.44,146.69,145.81,132.5,132.5,132.5,132.5,132.5,132.5\n2000-03-20,147.34,144.78,145.98,146.88,133.12,133.12,132.965,132.965,132.965,133.275\n2000-03-21,149.72,144.5,149.72,145.53,133.7152,133.7152,133.41605,133.41605,133.41605,134.01125000000002\n2000-03-22,150.84,148.69,150.0,149.56,134.675488,134.675488,134.068208,134.068208,134.068208,134.953775\n2000-03-23,153.47,149.16,152.63,149.16,135.96864896,135.96864896,134.9067976,134.9067976,134.9067976,136.06581075\n2000-03-24,155.75,151.72,153.28,152.88,137.718784064,137.718784064,136.020589744,136.020589744,136.020589744,137.45814589\n2000-03-27,153.78,152.0,152.5,153.38,139.88252997632,139.88252997632,137.40164846192002,137.40164846192002,137.40164846192002,139.1044127599\n2000-03-28,152.98,150.75,151.0,151.25,141.7866263791616,141.7866263791616,138.68603306958562,138.68603306958562,138.68603306958562,140.60251561150898\n2000-03-29,152.48,149.66,151.03,151.56,143.4622312136622,143.4622312136622,139.88051075471463,139.88051075471463,139.88051075471463,141.96578920647318\n2000-03-30,151.94,147.13,148.88,150.16,144.93676346802272,144.93676346802272,140.99137500188462,140.99137500188462,140.99137500188462,143.2063681778906\n2000-03-31,152.31,148.44,150.56,149.63,146.23435185186,146.23435185186,142.0244787517527,142.0244787517527,142.0244787517527,144.33529504188044\n2000-04-03,151.03,148.69,150.77,150.13,147.13,147.13,142.98526523913,142.98526523913,142.98526523913,145.3626184881112\n2000-04-04,153.0,141.39,150.0,151.75,155.75,-155.75,-155.75,-155.75,-155.75,-158.865\n2000-04-05,150.81,147.63,148.88,147.88,155.4628,-155.4628,-155.3192,-155.3192,-155.3192,-158.34075\n2000-04-06,151.69,149.0,150.31,150.25,155.181344,-155.181344,-154.901324,-154.901324,-154.901324,-157.83222750000002\n2000-04-07,152.13,150.5,151.78,151.56,154.90551711999998,-154.90551711999998,-154.49598428,-154.49598428,-154.49598428,-157.338960675\n2000-04-10,153.11,150.31,150.78,151.75,154.6352067776,-154.6352067776,-154.1028047516,-154.1028047516,-154.1028047516,-156.86049185475002\n2000-04-11,151.63,148.38,150.06,150.0,154.370302642048,-154.370302642048,-153.721420609052,-153.721420609052,-153.721420609052,-156.39637709910753\n2000-04-12,151.16,146.56,146.63,150.38,154.11069658920704,-154.11069658920704,-153.35147799078044,-153.35147799078044,-153.35147799078044,-155.9461857861343\n2000-04-13,148.16,143.78,144.0,147.47,153.8562826574229,-153.8562826574229,-152.99263365105702,-152.99263365105702,-152.99263365105702,-155.50950021255025\n2000-04-14,142.81,133.5,135.81,142.63,153.60695700427445,-153.60695700427445,-152.6445546415253,-152.6445546415253,-152.6445546415253,-155.08591520617375\n2000-04-17,140.13,126.69,140.06,135.19,152.80267872410346,-152.80267872410346,-151.68732690944904,-151.68732690944904,-151.68732690944904,-154.00661944586506\n2000-04-18,144.22,139.78,144.22,140.56,151.23591800065725,-151.23591800065725,-149.9375140257876,-149.9375140257876,-149.9375140257876,-152.0944560846545\n2000-04-19,145.13,142.53,143.0,144.5,149.76316292061782,-149.76316292061782,-148.31018804398246,-148.31018804398246,-148.31018804398246,-150.3161441587287\n2000-04-20,143.94,142.38,143.38,143.56,148.37877314538073,-148.37877314538073,-146.79677488090368,-146.79677488090368,-146.79677488090368,-148.66231406761767\n2000-04-24,143.28,140.5,143.0,141.5,147.07744675665788,-147.07744675665788,-145.38930063924042,-145.38930063924042,-145.38930063924042,-147.12425208288442\n2000-04-25,147.97,144.44,147.88,144.63,126.69,126.69,126.69,126.69,126.69,124.1562\n2000-04-26,148.75,146.0,146.38,147.97,127.1156,127.1156,127.1156,127.1156,127.1156,124.632476\n2000-04-27,147.34,143.0,146.5,143.0,127.980976,127.980976,127.764632,127.764632,127.764632,125.35600172\n2000-04-28,147.86,145.06,145.22,147.0,128.81173696,128.81173696,128.39419304,128.39419304,128.39419304,126.0578216684\n2000-05-01,148.48,143.63,147.19,146.56,129.6092674816,129.6092674816,129.0048672488,129.0048672488,129.0048672488,126.738587018348\n2000-05-02,147.13,144.5,144.63,145.5,130.374896782336,130.374896782336,129.597221231336,129.597221231336,129.597221231336,127.39892940779755\n2000-05-03,144.0,139.78,141.63,144.0,131.10990091104256,131.10990091104256,130.17180459439592,130.17180459439592,130.17180459439592,128.03946152556364\n2000-05-04,142.36,140.75,141.31,142.0,131.81550487460086,131.81550487460086,130.72915045656404,130.72915045656404,130.72915045656404,128.66077767979672\n2000-05-05,144.0,140.94,143.34,141.06,132.49288467961682,132.49288467961682,131.2697759428671,131.2697759428671,131.2697759428671,129.26345434940282\n2000-05-08,143.38,141.84,142.53,142.75,133.14316929243216,133.14316929243216,131.7941826645811,131.7941826645811,131.7941826645811,129.84805071892075\n2000-05-09,143.41,140.27,141.63,143.06,133.76744252073487,133.76744252073487,132.30285718464364,132.30285718464364,132.30285718464364,130.41510919735313\n2000-05-10,140.97,137.75,138.59,140.5,134.36674481990548,134.36674481990548,132.79627146910434,132.79627146910434,132.79627146910434,130.96515592143254\n2000-05-11,141.5,139.13,141.11,140.13,134.94207502710927,134.94207502710927,133.2748833250312,133.2748833250312,133.2748833250312,131.49870124378955\n2000-05-12,143.47,141.56,142.41,141.81,135.4943920260249,135.4943920260249,133.73913682528027,133.73913682528027,133.73913682528027,132.01624020647586\n2000-05-15,145.59,142.0,145.38,142.75,136.0246163449839,136.0246163449839,134.18946272052187,134.18946272052187,134.18946272052187,132.5182530002816\n2000-05-16,147.72,145.31,147.0,146.56,136.53363169118455,136.53363169118455,134.62627883890622,134.62627883890622,134.62627883890622,133.00520541027313\n2000-05-17,146.19,144.47,145.25,145.69,137.02228642353717,137.02228642353717,135.04999047373903,135.04999047373903,135.04999047373903,133.47754924796493\n2000-05-18,146.31,143.94,144.06,145.63,137.4913949665957,137.4913949665957,135.46099075952685,135.46099075952685,135.46099075952685,133.93572277052598\n2000-05-19,143.23,140.41,140.88,142.56,137.94173916793187,137.94173916793187,135.85966103674104,135.85966103674104,135.85966103674104,134.3801510874102\n2000-05-22,141.47,137.0,140.41,141.25,148.75,-148.75,136.2463712056388,136.2463712056388,136.2463712056388,134.8112465547879\n2000-05-23,140.81,137.56,137.56,140.44,148.515,-148.515,136.62148006946964,136.62148006946964,136.62148006946964,135.22940915814428\n2000-05-24,140.69,127.63,140.41,138.0,148.2847,-148.2847,-148.75,-148.75,-148.75,-151.725\n2000-05-25,141.81,137.72,138.88,140.69,147.45851199999998,-147.45851199999998,-148.1164,-148.1164,-148.1164,-151.00215\n2000-05-26,139.69,137.33,138.31,138.81,146.66537151999998,-146.66537151999998,-147.501808,-147.501808,-147.501808,-150.3009855\n2000-05-30,142.69,139.47,142.63,140.0,145.9039566592,-145.9039566592,-146.90565376,-146.90565376,-146.90565376,-149.620855935\n2000-05-31,144.0,142.09,142.41,142.56,145.172998392832,-145.172998392832,-146.3273841472,-146.3273841472,-146.3273841472,-148.96113025695\n2000-06-01,145.38,143.0,145.17,143.69,127.63,127.63,-145.76646262278402,-145.76646262278402,-145.76646262278402,-148.32119634924152\n2000-06-02,149.09,147.48,148.09,148.94,127.985,127.985,127.63,127.63,127.63,125.0774\n2000-06-05,148.22,146.88,147.25,147.47,128.8292,128.8292,128.0592,128.0592,128.0592,125.55765199999999\n2000-06-06,147.78,145.91,146.34,146.63,129.63963199999998,129.63963199999998,128.479816,128.479816,128.479816,126.02829895999999\n2000-06-07,148.0,146.0,147.56,146.63,130.41764671999996,130.41764671999996,128.89201968,128.89201968,128.89201968,126.48953298079999\n2000-06-08,147.75,146.06,146.56,147.5,131.16454085119997,131.16454085119997,129.2959792864,129.2959792864,129.2959792864,126.94154232118399\n2000-06-09,147.97,145.53,146.34,147.5,131.881559217152,131.881559217152,129.691859700672,129.691859700672,129.691859700672,127.3845114747603\n2000-06-12,146.97,145.13,145.28,146.97,132.5698968484659,132.5698968484659,130.07982250665856,130.07982250665856,130.07982250665856,127.81862124526509\n2000-06-13,147.75,144.63,147.47,144.81,133.23070097452725,133.23070097452725,130.46002605652538,130.46002605652538,130.46002605652538,128.24404882035978\n2000-06-14,148.88,147.19,147.5,148.25,133.86507293554615,133.86507293554615,130.83262553539487,130.83262553539487,130.83262553539487,128.6609678439526\n2000-06-15,148.75,146.84,148.25,148.13,134.4740700181243,134.4740700181243,131.19777302468697,131.19777302468697,131.19777302468697,129.06954848707355\n2000-06-16,148.31,145.88,146.88,148.31,135.05870721739933,135.05870721739933,131.55561756419323,131.55561756419323,131.55561756419323,129.46995751733206\n2000-06-19,149.16,146.25,148.66,146.47,135.61995892870337,135.61995892870337,131.90630521290936,131.90630521290936,131.90630521290936,129.86235836698543\n2000-06-20,148.88,147.0,147.81,148.19,136.43236139298116,136.43236139298116,132.42391605652207,132.42391605652207,132.42391605652207,130.44128761597588\n2000-06-21,148.44,146.89,147.95,146.94,137.1960197094023,137.1960197094023,132.92599857482642,132.92599857482642,132.92599857482642,131.0028489874966\n2000-06-22,147.69,145.0,145.53,147.56,137.91385852683817,137.91385852683817,133.41301861758163,133.41301861758163,133.41301861758163,131.5475635178717\n2000-06-23,146.13,143.88,144.38,145.81,138.58862701522787,138.58862701522787,133.8854280590542,133.8854280590542,133.8854280590542,132.07593661233557\n2000-06-26,146.25,144.88,145.75,145.38,139.2229093943142,139.2229093943142,134.34366521728256,134.34366521728256,134.34366521728256,132.5884585139655\n2000-06-27,146.72,145.31,145.56,145.98,139.81913483065534,139.81913483065534,134.78815526076409,134.78815526076409,134.78815526076409,133.08560475854654\n2000-06-28,146.98,145.22,145.63,145.63,140.37958674081602,140.37958674081602,135.21931060294116,135.21931060294116,135.21931060294116,133.56783661579013\n2000-06-29,145.75,143.52,144.44,144.75,140.90641153636707,140.90641153636707,135.63753128485294,135.63753128485294,135.63753128485294,134.03560151731642\n2000-06-30,145.53,143.89,145.38,143.94,141.40162684418505,141.40162684418505,136.04320534630736,136.04320534630736,136.04320534630736,134.48933347179693\n2000-07-03,147.44,145.16,147.28,145.44,141.86712923353394,141.86712923353394,136.43670918591815,136.43670918591815,136.43670918591815,134.92945346764301\n2000-07-05,146.66,144.38,145.09,146.38,142.3047014795219,142.3047014795219,136.8184079103406,136.8184079103406,136.8184079103406,135.35636986361374\n2000-07-06,146.47,144.22,145.88,144.94,142.71601939075057,142.71601939075057,137.18865567303038,137.18865567303038,137.18865567303038,135.77047876770533\n2000-07-07,148.78,146.22,148.09,146.69,143.10265822730554,143.10265822730554,137.54779600283948,137.54779600283948,137.54779600283948,136.17216440467416\n2000-07-10,148.91,147.63,147.97,147.88,143.4660987336672,143.4660987336672,137.8961621227543,137.8961621227543,137.8961621227543,136.56179947253395\n2000-07-11,149.13,147.16,148.38,147.47,143.80773280964718,143.80773280964718,138.23407725907168,138.23407725907168,138.23407725907168,136.93974548835794\n2000-07-12,150.13,148.69,149.59,149.28,144.12886884106834,144.12886884106834,138.56185494129954,138.56185494129954,138.56185494129954,137.3063531237072\n2000-07-13,150.38,149.19,149.88,149.98,144.60895933378288,144.60895933378288,139.02458074364756,139.02458074364756,139.02458074364756,137.8192989987589\n2000-07-14,151.25,149.67,150.88,150.44,145.18606340040458,145.18606340040458,139.5923517064652,139.5923517064652,139.5923517064652,138.44733404882098\n2000-07-17,151.98,150.69,151.06,150.98,145.91373579235602,145.91373579235602,140.29181060407728,140.29181060407728,140.29181060407728,139.2154940058917\n2000-07-18,150.63,149.34,149.69,150.63,146.76301278142617,146.76301278142617,141.10998386179187,141.10998386179187,141.10998386179187,140.1090094254793\n2000-07-19,149.91,148.25,148.44,149.47,147.4933909920265,147.4933909920265,141.87088499146645,141.87088499146645,141.87088499146645,140.93997876569574\n2000-07-20,150.5,148.81,149.81,149.0,148.12151625314277,148.12151625314277,142.5785230420638,142.5785230420638,142.5785230420638,141.71278025209705\n2000-07-21,149.75,147.88,148.25,149.75,151.98,-151.98,143.23662642911933,143.23662642911933,143.23662642911933,142.43148563445024\n2000-07-24,148.86,146.56,146.66,148.13,151.898,-151.898,143.84866257908098,143.84866257908098,143.84866257908098,143.09988164003872\n2000-07-25,147.84,146.78,147.44,147.75,151.68448,-151.68448,144.4178561985453,144.4178561985453,144.4178561985453,143.721489925236\n2000-07-26,147.16,145.64,146.16,146.97,151.4795008,-151.4795008,144.94720626464715,144.94720626464715,144.94720626464715,144.29958563046947\n2000-07-27,146.63,144.69,145.5,145.94,151.129130752,-151.129130752,-151.98,-151.98,-151.98,-155.0196\n2000-07-28,145.91,141.52,142.25,145.72,150.61400029184,-150.61400029184,-151.76129999999998,-151.76129999999998,-151.76129999999998,-154.709712\n2000-07-31,144.13,142.06,143.44,142.94,149.70460026265602,-149.70460026265602,-151.24923499999997,-151.24923499999997,-151.24923499999997,-154.05022639999999\n2000-08-01,144.72,143.13,144.0,143.63,148.88614023639042,-148.88614023639042,-150.76277324999998,-150.76277324999998,-150.76277324999998,-153.42371508\n2000-08-02,145.41,143.63,144.27,143.88,148.14952621275137,-148.14952621275137,-150.30063458749999,-150.30063458749999,-150.30063458749999,-152.828529326\n2000-08-03,145.81,142.63,145.5,142.88,147.48657359147623,-147.48657359147623,-149.861602858125,-149.861602858125,-149.861602858125,-152.26310285969998\n2000-08-04,146.72,145.41,146.53,146.31,146.8899162323286,-146.8899162323286,-149.44452271521874,-149.44452271521874,-149.44452271521874,-151.72594771671498\n2000-08-07,148.44,146.38,148.13,146.72,141.52,141.52,-149.0482965794578,-149.0482965794578,-149.0482965794578,-151.21565033087924\n2000-08-08,148.81,147.5,148.56,147.5,141.6584,141.6584,141.52,141.52,141.52,-150.73086781433528\n2000-08-09,149.22,147.38,147.69,149.14,141.944464,141.944464,141.66580000000002,141.66580000000002,141.66580000000002,-150.27032442361852\n2000-08-10,147.86,146.28,146.56,147.53,142.38099616000002,142.38099616000002,141.89242600000003,141.89242600000003,141.89242600000003,-149.8328082024376\n2000-08-11,148.0,145.56,147.44,146.63,142.79133639040003,142.79133639040003,142.11225322,142.11225322,142.11225322,-149.41716779231572\n2000-08-14,149.5,147.06,149.38,147.78,143.17705620697603,143.17705620697603,142.32548562340003,142.32548562340003,142.32548562340003,138.6896\n2000-08-15,149.81,147.34,149.02,149.34,143.68289171041795,143.68289171041795,142.61246619846403,142.61246619846403,142.61246619846403,138.905808\n2000-08-16,149.94,147.84,148.38,149.31,144.29560253937615,144.29560253937615,142.97234288854082,142.97234288854082,142.97234288854082,139.23293376\n2000-08-17,150.44,148.34,149.94,148.69,144.97293023465102,144.97293023465102,143.39040231522839,143.39040231522839,143.39040231522839,139.6612164096\n2000-08-18,150.38,149.16,149.67,150.38,145.73832000179988,145.73832000179988,143.8838741531624,143.8838741531624,143.8838741531624,140.20015558912002\n2000-08-21,150.72,149.41,150.36,150.03,146.3965552015479,146.3965552015479,144.34280296244103,144.34280296244103,144.34280296244103,140.712147809664\n2000-08-22,151.31,150.09,150.23,150.56,147.08830636930023,147.08830636930023,144.85297872544575,144.85297872544575,144.85297872544575,141.31261894108417\n2000-08-23,151.28,149.19,150.91,149.81,147.8482112228262,147.8482112228262,145.43411064015564,145.43411064015564,145.43411064015564,142.0124356152083\n2000-08-24,151.55,150.09,151.44,151.16,148.4713332027175,148.4713332027175,145.96294068254164,145.96294068254164,145.96294068254164,142.6632651221437\n2000-08-25,151.63,150.94,151.09,151.16,149.087066562174,149.087066562174,146.52164661428748,146.52164661428748,146.52164661428748,143.37420391237222\n2000-08-28,152.91,151.25,151.78,151.25,149.5956532497392,149.5956532497392,147.08356548671586,147.08356548671586,147.08356548671586,144.11722556025873\n2000-08-29,151.88,150.91,151.5,151.44,150.25852259979135,150.25852259979135,147.78273762830995,147.78273762830995,147.78273762830995,144.99650300423286\n2000-08-30,151.78,150.45,150.63,151.31,152.91,-152.91,148.39800911291275,148.39800911291275,148.39800911291275,145.78785270380956\n2000-08-31,153.09,150.84,152.25,151.06,150.45,150.45,148.93944801936323,148.93944801936323,148.93944801936323,146.5000674334286\n2000-09-01,153.59,152.0,152.56,153.25,150.45,150.45,149.479019776846,149.479019776846,149.479019776846,147.22496001575146\n2000-09-05,152.2,150.81,151.25,151.88,150.57559999999998,150.57559999999998,150.05455700808756,150.05455700808756,150.05455700808756,147.98876481386128\n2000-09-06,151.95,149.69,149.69,151.19,153.59,-153.59,-153.59,-153.59,-153.59,148.66091303619794\n2000-09-07,151.08,149.83,150.75,150.25,153.512,-153.512,-153.473,-153.473,-153.473,149.2524034718542\n2000-09-08,150.5,149.33,149.75,150.28,153.43556,-153.43556,-153.35951,-153.35951,-153.35951,-156.6618\n2000-09-11,151.19,148.69,149.47,149.75,153.2713376,-153.2713376,-153.1580345,-153.1580345,-153.1580345,-156.441846\n2000-09-12,150.25,148.44,148.75,149.75,152.99645734400002,-152.99645734400002,-152.845272085,-152.845272085,-152.845272085,-156.0542537\n2000-09-13,149.84,147.66,148.88,148.0,152.63194075648002,-152.63194075648002,-152.44879759735,-152.44879759735,-152.44879759735,-155.521255941\n2000-09-14,149.94,148.16,148.53,149.88,152.13474668083202,-152.13474668083202,-151.9220298616415,-151.9220298616415,-151.9220298616415,-154.81374290630998\n2000-09-15,148.25,146.03,146.75,148.19,151.68727201274882,-151.68727201274882,-151.45320657686094,-151.45320657686094,-151.45320657686094,-154.16990604474208\n2000-09-18,146.97,144.2,144.69,146.38,151.00839937121896,-151.00839937121896,-150.748189721869,-150.748189721869,-150.748189721869,-153.27451637982045\n2000-09-19,146.31,144.7,146.08,145.13,150.0552234592483,-150.0552234592483,-149.76596126358865,-149.76596126358865,-149.76596126358865,-152.09482925044378\n2000-09-20,146.03,143.16,145.22,145.69,149.23549217495355,-149.23549217495355,-148.93106707405036,-148.93106707405036,-148.93106707405036,-151.0685014478861\n2000-09-21,145.56,143.75,145.03,144.47,148.263413426961,-148.263413426961,-147.9499856714618,-147.9499856714618,-147.9499856714618,-149.88222623070317\n2000-09-22,145.16,142.13,145.16,142.63,147.44686727864723,-147.44686727864723,-147.13568810731329,-147.13568810731329,-147.13568810731329,-148.8738922960977\n2000-09-25,146.06,143.72,144.13,145.94,146.48983116849072,-146.48983116849072,-146.18460736692376,-146.18460736692376,-146.18460736692376,-147.72743060576107\n2000-09-26,145.0,142.63,142.89,144.38,146.06,-146.06,-146.06,-146.06,-146.06,-146.7758674027817\n2000-09-27,143.97,142.13,142.81,143.56,146.06,-146.06,-146.06,-146.06,-146.06,-146.06\n2000-09-28,146.33,142.89,146.19,143.19,142.13,142.13,142.13,142.13,142.13,139.2874\n2000-09-29,145.97,143.75,143.78,145.47,142.13,142.13,142.13,142.13,142.13,139.428252\n2000-10-02,144.91,143.14,143.81,144.28,142.214,142.214,142.214,142.214,142.214,139.56628695999999\n2000-10-03,145.75,142.53,142.63,144.53,142.29632,142.29632,142.29632,142.29632,142.29632,139.7015612208\n2000-10-04,144.25,141.75,143.58,142.88,146.33,-146.33,-146.33,-146.33,-146.33,139.83412999638398\n2000-10-05,144.84,143.31,143.88,143.41,146.2384,-146.2384,-146.1926,-146.1926,-146.1926,139.9640473964563\n2000-10-06,144.64,139.75,141.0,143.88,146.14863200000002,-146.14863200000002,-146.059322,-146.059322,-146.059322,-149.25660000000002\n2000-10-09,141.31,139.38,140.44,141.31,145.89268672000003,-145.89268672000003,-145.7438559,-145.7438559,-145.7438559,-148.971402\n2000-10-10,141.25,138.56,138.88,140.09,145.50192551680001,-145.50192551680001,-145.298385987,-145.298385987,-145.298385987,-148.49183190000002\n2000-10-11,138.63,135.13,136.56,137.63,144.946571475456,-144.946571475456,-144.69193124817,-144.69193124817,-144.69193124817,-147.79660366700003\n2000-10-12,143.38,132.78,133.16,137.28,143.9649143279104,-143.9649143279104,-143.6401188108713,-143.6401188108713,-143.6401188108713,-146.65660933697004\n2000-10-13,137.66,132.88,137.56,132.94,143.38,-143.38,-143.38,-143.38,-143.38,-145.13018230990332\n2000-10-16,139.0,136.69,137.47,137.41,143.38,-143.38,-143.38,-143.38,-143.38,-143.77166225581396\n2000-10-17,138.56,134.41,135.48,138.44,142.108,-142.108,-142.002,-142.002,-142.002,-142.56257940767443\n2000-10-18,136.13,130.16,134.41,132.63,140.98864,-140.98864,-140.80314,-140.80314,-140.80314,-141.48649567283024\n2000-10-19,139.45,136.44,139.05,136.84,139.4726304,-139.4726304,130.16,130.16,130.16,-140.0140512353623\n2000-10-20,141.19,138.38,139.88,138.38,130.16,130.16,130.16,130.16,130.16,127.5568\n2000-10-23,141.03,138.94,140.0,139.94,130.3806,130.3806,130.4909,130.4909,130.4909,127.829464\n2000-10-24,141.94,139.0,140.13,140.97,130.59678799999998,130.59678799999998,130.81187300000002,130.81187300000002,130.81187300000002,128.09667472\n2000-10-25,139.56,136.39,136.92,138.75,131.05051647999997,131.05051647999997,131.25699808000002,131.25699808000002,131.25699808000002,128.51197447840002\n2000-10-26,137.66,134.0,136.75,137.13,131.48609582079996,131.48609582079996,131.6843181568,131.6843181568,131.6843181568,128.91481524404801\n2000-10-27,138.84,136.63,138.38,137.88,131.90425198796797,131.90425198796797,132.094545430528,132.094545430528,132.094545430528,129.30557078672658\n2000-10-30,141.09,138.16,140.25,138.44,132.30568190844926,132.30568190844926,132.4883636133069,132.4883636133069,132.4883636133069,129.6846036631248\n2000-10-31,143.69,140.06,142.97,141.02,132.69105463211127,132.69105463211127,132.8664290687746,132.8664290687746,132.8664290687746,130.05226555323105\n2000-11-01,143.25,141.22,142.41,142.25,133.3509913541846,133.3509913541846,133.40760761533588,133.40760761533588,133.40760761533588,130.5977749311018\n2000-11-02,143.91,142.52,143.03,143.16,133.97133187293352,133.97133187293352,133.9217272345691,133.9217272345691,133.9217272345691,131.12146393385774\n2000-11-03,143.75,142.38,143.11,143.47,134.76642532309884,134.76642532309884,134.52102360049494,134.52102360049494,134.52102360049494,131.76089073716486\n2000-11-06,144.3,143.03,143.7,143.16,135.49791129725094,135.49791129725094,135.08436218446525,135.08436218446525,135.08436218446525,132.3683462003066\n2000-11-07,144.0,142.56,143.66,143.14,136.37812016752585,136.37812016752585,135.72945683155268,135.72945683155268,135.72945683155268,133.0842454282882\n2000-11-08,144.06,141.03,141.25,144.06,137.17030815077328,137.17030815077328,136.32939485334398,136.32939485334398,136.32939485334398,133.75719070259092\n2000-11-09,141.22,137.25,140.41,140.0,144.3,-144.3,136.8873372136099,136.8873372136099,136.8873372136099,134.38975926043545\n2000-11-10,139.47,136.88,136.97,139.0,144.15900000000002,-144.15900000000002,-144.3,-144.3,-144.3,134.98437370480931\n2000-11-13,136.98,133.02,135.38,135.63,143.86784000000003,-143.86784000000003,-144.0774,-144.0774,-144.0774,-147.186\n2000-11-14,139.63,137.0,138.75,137.47,143.21696960000003,-143.21696960000003,-143.52453,-143.52453,-143.52453,-146.76102\n2000-11-15,140.11,137.75,139.13,139.06,142.605151424,-142.605151424,-142.9993035,-142.9993035,-142.9993035,-146.34878940000002\n2000-11-16,139.88,137.31,137.77,138.58,142.03004233856,-142.03004233856,-142.500338325,-142.500338325,-142.500338325,-145.94892571800003\n2000-11-17,139.0,135.75,137.47,137.31,141.4894397982464,-141.4894397982464,-142.02632140875,-142.02632140875,-142.02632140875,-145.56105794646004\n2000-11-20,136.38,134.38,134.69,135.75,140.9812734103516,-140.9812734103516,-141.57600533831248,-141.57600533831248,-141.57600533831248,-145.18482620806623\n2000-11-21,136.19,133.52,135.16,134.88,140.5035970057305,-140.5035970057305,-141.14820507139686,-141.14820507139686,-141.14820507139686,-144.81988142182425\n2000-11-22,134.88,132.44,132.5,134.34,140.0545811853867,-140.0545811853867,-140.741794817827,-140.741794817827,-140.741794817827,-144.46588497916952\n2000-11-24,134.97,133.56,134.84,133.63,139.44541469055576,-139.44541469055576,-140.16066918057913,-140.16066918057913,-140.16066918057913,-143.86459073021103\n2000-11-27,136.69,135.31,135.5,136.47,138.8849815153113,-138.8849815153113,-139.6202223379386,-139.6202223379386,-139.6202223379386,-143.2933611937005\n2000-11-28,136.59,133.81,133.81,135.13,138.36938299408638,-138.36938299408638,-139.1176067742829,-139.1176067742829,-139.1176067742829,-142.75069313401548\n2000-11-29,135.91,133.27,134.64,134.38,137.89503235455948,-137.89503235455948,-138.6501743000831,-138.6501743000831,-138.6501743000831,-142.2351584773147\n2000-11-30,133.5,129.75,131.63,132.5,137.45862976619472,-137.45862976619472,-138.21546209907729,-138.21546209907729,-138.21546209907729,-141.74540055344897\n2000-12-01,134.06,131.0,131.88,133.19,136.68776678957525,-136.68776678957525,-137.45357051016032,-137.45357051016032,-137.45357051016032,-140.90572251470755\n2000-12-04,133.88,131.5,133.0,131.88,135.99399011061772,-135.99399011061772,-136.7602491642459,-136.7602491642459,-136.7602491642459,-140.12482193867802\n2000-12-05,138.19,134.41,138.13,134.88,129.75,129.75,129.75,129.75,129.75,-139.39858440297056\n2000-12-06,138.34,135.03,135.53,137.78,129.9188,129.9188,129.9188,129.9188,129.9188,-138.72318349476262\n2000-12-07,135.88,134.38,134.98,134.88,130.255648,130.255648,130.171436,130.171436,130.171436,-138.34\n2000-12-08,139.13,136.09,137.66,137.06,130.57902208000002,130.57902208000002,130.41649292,130.41649292,130.41649292,127.155\n2000-12-11,148.88,136.72,138.63,137.38,131.09208075520002,131.09208075520002,130.7650332032,130.7650332032,130.7650332032,127.39450000000001\n2000-12-12,139.25,137.38,137.75,138.19,132.515114294784,132.515114294784,131.67078154304,131.67078154304,131.67078154304,128.039065\n2000-12-13,139.41,136.25,136.53,139.25,133.8243051512013,133.8243051512013,132.531242465888,132.531242465888,132.531242465888,128.66429305\n2000-12-14,136.5,134.19,134.19,135.88,148.88,-148.88,133.3486803425936,133.3486803425936,133.3486803425936,129.2707642585\n2000-12-15,133.25,130.56,131.45,133.13,148.5862,-148.5862,-148.88,-148.88,-148.88,129.85904133074501\n2000-12-18,133.47,111.0,132.38,111.0,147.865152,-147.865152,-148.3304,-148.3304,-148.3304,-151.8576\n2000-12-19,134.97,130.5,130.56,132.47,145.65324288,-145.65324288,-146.46388,-146.46388,-146.46388,-150.631872\n2000-12-20,128.94,123.94,126.69,128.63,143.5740483072,-143.5740483072,-144.690686,-144.690686,-144.690686,-149.44291583999998\n2000-12-21,128.86,125.53,127.69,126.0,141.619605408768,-141.619605408768,-143.0061517,-143.0061517,-143.0061517,-148.2896283648\n2000-12-22,130.86,128.84,130.86,129.0,139.78242908424193,-139.78242908424193,-141.405844115,-141.405844115,-141.405844115,-147.17093951385598\n2000-12-26,131.94,130.28,131.89,130.84,138.05548333918742,-138.05548333918742,-139.88555190925,-139.88555190925,-139.88555190925,-146.08581132844031\n2000-12-27,133.66,131.25,133.13,132.0,136.43215433883617,-136.43215433883617,-138.44127431378752,-138.44127431378752,-138.44127431378752,-145.0332369885871\n2000-12-28,133.81,132.59,133.61,132.81,134.906225078506,-134.906225078506,-137.06921059809815,-137.06921059809815,-137.06921059809815,-144.0122398789295\n2000-12-29,134.28,131.88,132.25,134.06,111.0,111.0,-135.76575006819326,-135.76575006819326,-135.76575006819326,-143.02187268256162\n2001-01-02,132.16,127.56,128.25,132.0,111.4656,111.4656,-134.5274625647836,-134.5274625647836,-134.5274625647836,-142.06121650208476\n2001-01-03,136.0,127.66,135.0,128.31,111.921888,111.921888,111.0,111.0,111.0,-141.1293800070222\n2001-01-04,135.47,133.0,133.41,134.94,112.88501248,112.88501248,111.5,111.5,111.5,-140.22549860681153\n2001-01-05,133.63,129.28,130.25,133.47,113.8096119808,113.8096119808,111.99,111.99,111.99,-139.34873364860718\n2001-01-08,130.06,127.63,129.75,129.88,114.697227501568,114.697227501568,112.47019999999999,112.47019999999999,112.47019999999999,-138.49827163914895\n2001-01-09,131.5,129.63,130.13,131.05,115.54933840150528,115.54933840150528,112.94079599999999,112.94079599999999,112.94079599999999,-137.67332348997448\n2001-01-10,131.81,128.81,131.66,129.0,116.36736486544507,116.36736486544507,113.40198007999999,113.40198007999999,113.40198007999999,-136.87312378527525\n2001-01-11,133.48,131.09,132.77,131.09,117.15267027082727,117.15267027082727,113.85394047839999,113.85394047839999,113.85394047839999,-136.096930071717\n2001-01-12,133.72,131.28,131.91,132.69,117.90656345999417,117.90656345999417,114.296861668832,114.296861668832,114.296861668832,-135.34402216956548\n2001-01-16,133.19,131.52,132.58,132.0,118.63030092159441,118.63030092159441,114.73092443545535,114.73092443545535,114.73092443545535,-134.6137015044785\n2001-01-17,135.05,132.64,132.94,134.84,119.32508888473063,119.32508888473063,115.15630594674624,115.15630594674624,115.15630594674624,108.78\n2001-01-18,135.7,132.94,135.05,133.44,119.9920853293414,119.9920853293414,115.57317982781132,115.57317982781132,115.57317982781132,109.3054\n2001-01-19,136.19,133.88,134.48,136.19,120.63240191616775,120.63240191616775,115.98171623125509,115.98171623125509,115.98171623125509,110.097238\n2001-01-22,135.78,133.56,134.63,134.25,121.56585780119768,121.56585780119768,116.58796474431745,116.58796474431745,116.58796474431745,111.14094848\n2001-01-23,136.66,134.16,136.13,134.47,122.44330633312582,122.44330633312582,117.17602580198792,117.17602580198792,117.17602580198792,112.1429105408\n2001-01-24,137.31,135.84,136.69,136.25,123.58064182647576,123.58064182647576,117.9553847699084,117.9553847699084,117.9553847699084,113.36876501376\n2001-01-25,137.25,135.66,136.06,136.25,124.95357764382818,124.95357764382818,118.92311553141299,118.92311553141299,118.92311553141299,114.8052391129344\n2001-01-26,136.13,134.45,135.78,135.16,126.18921987944536,126.18921987944536,119.84245975484234,119.84245975484234,119.84245975484234,116.15552476615834\n2001-01-29,136.9,135.37,136.65,135.5,127.30129789150082,127.30129789150082,120.71583676710023,120.71583676710023,120.71583676710023,117.42479328018884\n2001-01-30,137.92,135.79,137.75,136.3,128.30216810235075,128.30216810235075,121.54554492874522,121.54554492874522,121.54554492874522,118.6179056833775\n2001-01-31,138.7,136.6,137.06,137.4,129.45630793006865,129.45630793006865,122.5280122330205,122.5280122330205,122.5280122330205,119.96905228554108\n2001-02-01,137.56,136.25,137.48,137.1,130.75042481985903,130.75042481985903,123.66005137670906,123.66005137670906,123.66005137670906,121.4675281026978\n2001-02-02,137.99,135.0,135.08,137.4,131.86336534507876,131.86336534507876,124.71284778033943,124.71284778033943,124.71284778033943,122.84612585448197\n2001-02-05,135.9,134.75,135.89,134.8,132.82049419676773,132.82049419676773,125.69194843571567,125.69194843571567,125.69194843571567,124.11443578612341\n2001-02-06,136.7,135.22,135.42,135.3,133.64362500922024,133.64362500922024,126.60251204521558,126.60251204521558,126.60251204521558,125.28128092323354\n2001-02-07,135.42,133.68,134.22,134.72,138.7,-138.7,127.44933620205049,127.44933620205049,127.44933620205049,126.35477844937485\n2001-02-08,135.4,133.48,133.48,134.8,138.59959999999998,-138.59959999999998,128.23688266790694,128.23688266790694,128.23688266790694,127.34239617342486\n2001-02-09,133.35,131.26,131.83,133.35,138.394816,-138.394816,128.96930088115346,128.96930088115346,128.96930088115346,128.25100447955086\n2001-02-12,133.5,131.7,133.14,131.7,137.96672704,-137.96672704,129.65044981947273,129.65044981947273,129.65044981947273,129.0869241211868\n2001-02-13,134.17,132.0,132.12,133.7,137.5643234176,-137.5643234176,130.28391833210964,130.28391833210964,130.28391833210964,129.85597019149185\n2001-02-14,132.65,130.66,132.15,132.65,137.186064012544,-137.186064012544,-138.7,-138.7,-138.7,130.5634925761725\n2001-02-15,133.52,131.99,132.96,132.84,136.66397889154047,-136.66397889154047,-138.4588,-138.4588,-138.4588,130.66\n2001-02-16,131.29,129.3,130.46,131.0,136.18366058021724,-136.18366058021724,-138.224836,-138.224836,-138.224836,-141.474\n2001-02-20,131.14,128.1,128.32,131.04,135.4952945221955,-135.4952945221955,-137.77859420000001,-137.77859420000001,-137.77859420000001,-141.10878\n2001-02-21,128.84,125.52,125.6,127.9,134.60785917953206,-134.60785917953206,-137.101092606,-137.101092606,-137.101092606,-140.458341\n2001-02-22,126.54,123.02,125.52,126.35,133.33555889439756,-133.33555889439756,-136.05879427146002,-136.05879427146002,-136.05879427146002,-139.41265712999999\n2001-02-23,125.54,121.8,124.89,125.08,131.68506947129396,-131.68506947129396,-134.6245269015994,-134.6245269015994,-134.6245269015994,-137.93731798829998\n2001-02-26,127.21,124.5,127.21,125.8,129.90575696646104,-129.90575696646104,-132.9573384043915,-132.9573384043915,-132.9573384043915,-136.162213009587\n2001-02-27,127.84,125.51,126.35,126.8,128.44672071249806,-128.44672071249806,-131.5068844118206,-131.5068844118206,-131.5068844118206,-134.58236957853242\n2001-02-28,126.84,123.27,124.15,126.75,127.84,-127.84,-130.24498943828394,-130.24498943828394,-130.24498943828394,-133.17630892489385\n2001-03-01,124.5,121.75,124.49,124.05,127.84,-127.84,-129.14714081130703,-129.14714081130703,-129.14714081130703,-131.92491494315553\n2001-03-02,125.65,122.3,123.77,122.5,126.84,-126.84,-128.03756968961096,-128.03756968961096,-128.03756968961096,-130.6021760005453\n2001-03-05,124.78,123.81,124.4,124.15,125.822,-125.822,-127.09443423616932,-127.09443423616932,-127.09443423616932,-129.45139312047442\n2001-03-06,127.75,125.49,125.87,126.35,121.75,121.75,121.75,121.75,121.75,-128.45021201481273\n2001-03-07,126.9,125.76,126.64,126.9,121.87,121.87,121.87,121.87,121.87,-127.75\n2001-03-08,127.24,126.1,126.9,126.6,121.9876,121.9876,121.9876,121.9876,121.9876,-127.75\n2001-03-09,126.1,123.11,123.67,126.1,122.102848,122.102848,122.102848,122.102848,122.102848,-127.24\n2001-03-12,124.5,117.7,118.44,122.34,127.75,-127.75,-127.75,-127.75,-127.75,-127.24\n2001-03-13,120.44,117.53,120.2,119.4,127.549,-127.549,-127.4485,-127.4485,-127.4485,-126.1\n2001-03-14,119.29,115.75,117.2,117.05,127.14824,-127.14824,-126.952575,-126.952575,-126.952575,-124.64309999999999\n2001-03-15,118.86,117.51,117.71,118.45,126.4643456,-126.4643456,-126.16839474999999,-126.16839474999999,-126.16839474999999,-122.95341099999999\n2001-03-16,118.5,114.46,115.31,117.13,125.821484864,-125.821484864,-125.43910711749999,-125.43910711749999,-125.43910711749999,-121.58476291\n2001-03-19,117.69,114.82,117.3,115.76,124.91256607488,-124.91256607488,-124.450987476925,-124.450987476925,-124.450987476925,-120.08856269889999\n2001-03-20,118.46,114.15,114.25,117.9,124.0763607888896,-124.0763607888896,-123.55179860400175,-123.55179860400175,-123.55179860400175,-118.90656453213099\n2001-03-21,115.26,111.9,112.34,114.18,123.08372471000064,-123.08372471000064,-122.51760075756155,-122.51760075756155,-122.51760075756155,-118.46\n2001-03-22,115.7,108.04,111.9,112.02,121.74167774480057,-121.74167774480057,-121.13731265907855,-121.13731265907855,-121.13731265907855,-118.46\n2001-03-23,114.48,111.5,114.25,113.25,119.82344286052849,-119.82344286052849,-119.17271576021676,-119.17271576021676,-119.17271576021676,-115.7\n2001-03-26,116.27,114.77,115.5,115.7,118.1737608600545,-118.1737608600545,-117.50280839618425,-117.50280839618425,-117.50280839618425,105.87920000000001\n2001-03-27,118.65,115.25,118.51,115.62,108.04,108.04,108.04,108.04,108.04,106.087016\n2001-03-28,117.5,114.9,115.45,116.9,108.2522,108.2522,108.2522,108.2522,108.2522,106.46390552000001\n2001-03-29,116.6,109.34,114.98,114.7,108.460156,108.460156,108.460156,108.460156,108.460156,106.82948835440001\n2001-03-30,116.65,114.5,116.12,115.55,108.66395288,108.66395288,108.66395288,108.66395288,108.66395288,107.18410370376802\n2001-04-02,117.38,113.8,114.54,116.3,108.8636738224,108.8636738224,108.8636738224,108.8636738224,108.8636738224,107.52808059265497\n2001-04-03,114.15,110.1,110.67,113.98,109.059400345952,109.059400345952,109.059400345952,109.059400345952,109.059400345952,107.86173817487533\n2001-04-04,112.1,109.3,110.31,110.58,109.25121233903296,109.25121233903296,109.25121233903296,109.25121233903296,109.25121233903296,108.18538602962907\n2001-04-05,115.49,112.5,115.22,113.3,109.3,109.3,109.3,109.3,109.3,108.4993244487402\n2001-04-06,114.4,112.06,113.05,113.99,109.3,109.3,109.3,109.3,109.3,108.80384471527799\n2001-04-09,115.48,112.78,114.0,114.0,109.487,109.487,109.487,109.487,109.487,109.09922937381965\n2001-04-10,117.75,115.17,117.09,115.45,109.67026,109.67026,109.67026,109.67026,109.67026,109.38575249260506\n2001-04-11,118.99,116.14,116.96,118.78,109.8498548,109.8498548,109.8498548,109.8498548,109.8498548,109.66367991782691\n2001-04-12,118.63,115.96,118.55,116.3,110.215460608,110.215460608,110.124059156,110.124059156,110.124059156,110.03673272111384\n2001-04-16,118.89,116.91,118.23,118.29,110.56644218368,110.56644218368,110.39003738132,110.39003738132,110.39003738132,110.39486341226929\n2001-04-17,119.66,117.02,119.42,117.31,110.90338449633279,110.90338449633279,110.6480362598804,110.6480362598804,110.6480362598804,110.73866887577852\n2001-04-18,126.0,120.69,124.14,121.06,111.42878142655282,111.42878142655282,111.00851480948518,111.00851480948518,111.00851480948518,111.1847354319896\n2001-04-19,125.83,120.0,125.72,124.25,112.59447891242858,112.59447891242858,111.75808906901092,111.75808906901092,111.75808906901092,112.07365130607022\n2001-04-20,125.4,123.66,124.36,124.9,113.66692059943429,113.66692059943429,112.47018461556037,112.47018461556037,112.47018461556037,112.909232227706\n2001-04-23,126.3,121.91,122.7,123.65,114.65356695147955,114.65356695147955,113.14667538478236,113.14667538478236,113.14667538478236,113.69467829404364\n2001-04-24,123.7,121.1,121.13,122.52,115.8182102563316,115.8182102563316,113.93587486169541,113.93587486169541,113.93587486169541,114.57705081346059\n2001-04-25,123.67,120.95,123.1,121.42,116.86638923069843,116.86638923069843,114.67772236999369,114.67772236999369,114.67772236999369,115.39765725651834\n2001-04-26,125.22,123.5,123.74,123.73,117.80975030762859,117.80975030762859,115.37505902779407,115.37505902779407,115.37505902779407,116.16082124856206\n2001-04-27,125.68,124.2,125.55,124.92,118.65877527686573,118.65877527686573,116.03055548612642,116.03055548612642,116.03055548612642,116.87056376116271\n2001-04-30,127.27,124.67,125.21,126.45,119.42289774917916,119.42289774917916,116.64672215695883,116.64672215695883,116.64672215695883,117.53062429788132\n2001-05-01,126.97,124.6,126.95,125.07,120.36455001927766,120.36455001927766,117.39035160597172,117.39035160597172,117.39035160597172,118.30977435405082\n2001-05-02,127.69,126.0,126.89,127.41,121.19320401696434,121.19320401696434,118.0819269935537,118.0819269935537,118.0819269935537,119.02659240572675\n2001-05-03,126.15,124.22,125.16,126.13,122.10275545458934,122.10275545458934,118.8505728340694,118.8505728340694,118.8505728340694,119.80629908921134\n2001-05-04,127.2,123.44,126.95,123.65,122.88496969094683,122.88496969094683,119.55772700734384,119.55772700734384,119.55772700734384,120.51583217118231\n2001-05-07,127.47,125.53,126.57,126.86,123.44,123.44,120.20830884675634,120.20830884675634,120.20830884675634,121.1615072757759\n2001-05-08,127.1,125.56,126.52,126.86,123.44,123.44,120.80684413901584,120.80684413901584,120.80684413901584,121.74907162095607\n2001-05-09,126.6,125.06,125.87,125.25,124.035,124.035,121.35749660789457,121.35749660789457,121.35749660789457,122.28375517507003\n2001-05-10,127.5,125.77,125.99,127.26,124.5467,124.5467,121.864096879263,121.864096879263,121.864096879263,122.77031720931373\n2001-05-11,126.49,124.4,124.82,126.0,127.69,-127.69,122.33016912892197,122.33016912892197,122.33016912892197,123.21308866047549\n2001-05-14,125.44,124.46,125.23,124.9,127.6242,-127.6242,122.75895559860821,122.75895559860821,122.75895559860821,123.61601068103269\n2001-05-15,126.5,124.85,125.3,125.55,127.55971600000001,-127.55971600000001,123.15343915071955,123.15343915071955,123.15343915071955,123.98266971973975\n2001-05-16,129.2,124.62,128.96,124.84,124.4,124.4,123.51636401866199,123.51636401866199,123.51636401866199,124.31632944496317\n2001-05-17,130.08,128.56,129.31,129.01,124.49600000000001,124.49600000000001,124.02789125698241,124.02789125698241,124.02789125698241,124.62\n2001-05-18,129.72,128.1,129.62,129.09,124.62,124.62,124.62,124.62,124.62,124.62\n2001-05-21,131.8,129.15,131.77,129.84,124.83840000000001,124.83840000000001,125.16600000000001,125.16600000000001,125.16600000000001,125.2206\n2001-05-22,132.09,131.07,131.37,131.83,125.25609600000001,125.25609600000001,125.89574000000002,125.89574000000002,125.89574000000002,126.01012800000001\n2001-05-23,131.05,129.29,129.29,131.05,125.80280832000001,125.80280832000001,126.63905120000001,126.63905120000001,126.63905120000001,126.80051136\n2001-05-24,130.0,124.9,129.7,129.47,132.09,-132.09,-132.09,-132.09,-132.09,-134.7318\n2001-05-25,129.7,128.01,128.23,129.65,131.9462,-131.9462,-131.8743,-131.8743,-131.8743,-134.436846\n2001-05-29,128.35,126.9,127.3,128.23,131.805276,-131.805276,-131.665071,-131.665071,-131.665071,-134.15074062\n2001-05-30,127.53,125.0,125.29,126.59,131.66717047999998,-131.66717047999998,-131.46211887,-131.46211887,-131.46211887,-133.87321840139998\n2001-05-31,126.76,125.26,126.1,125.43,131.53182707039997,-131.53182707039997,-131.2652553039,-131.2652553039,-131.2652553039,-133.604021849358\n2001-06-01,127.1,125.12,126.64,126.2,131.39919052899197,-131.39919052899197,-131.074297644783,-131.074297644783,-131.074297644783,-133.34290119387725\n2001-06-04,127.27,125.89,127.17,126.8,131.26920671841214,-131.26920671841214,-130.88906871543952,-130.88906871543952,-130.88906871543952,-133.08961415806093\n2001-06-05,129.23,127.27,128.87,127.49,131.1418225840439,-131.1418225840439,-130.70939665397634,-130.70939665397634,-130.70939665397634,-132.8439257333191\n2001-06-06,128.83,127.36,127.53,128.83,131.016986132363,-131.016986132363,-130.53511475435704,-130.53511475435704,-130.53511475435704,-132.60560796131955\n2001-06-07,128.29,127.0,128.24,127.05,130.89464640971573,-130.89464640971573,-130.36606131172633,-130.36606131172633,-130.36606131172633,-132.37443972247996\n2001-06-08,127.87,126.14,127.0,127.7,130.77475348152143,-130.77475348152143,-130.20207947237455,-130.20207947237455,-130.20207947237455,-132.15020653080558\n2001-06-11,127.75,125.41,125.94,126.71,130.657258411891,-130.657258411891,-130.0430170882033,-130.0430170882033,-130.0430170882033,-131.93270033488142\n2001-06-12,126.88,124.04,126.13,124.86,130.54211324365318,-130.54211324365318,-129.8887265755572,-129.8887265755572,-129.8887265755572,-131.72171932483496\n2001-06-13,126.58,124.67,124.74,126.17,130.28202871390704,-130.28202871390704,-129.59629024677935,-129.59629024677935,-129.59629024677935,-131.33763335859322\n2001-06-14,124.3,122.24,122.48,124.18,130.03234756535076,-130.03234756535076,-129.31847573444037,-129.31847573444037,-129.31847573444037,-130.97275169066356\n2001-06-15,122.4,120.4,121.62,120.91,129.56480671142972,-129.56480671142972,-128.82298243302955,-128.82298243302955,-128.82298243302955,-130.3614590723171\n2001-06-18,122.44,120.95,121.08,121.65,128.83162217451536,-128.83162217451536,-128.06491401405688,-128.06491401405688,-128.06491401405688,-129.46492775580856\n2001-06-19,122.89,120.86,121.46,122.38,128.15709240055412,-128.15709240055412,-127.37507175279177,-127.37507175279177,-127.37507175279177,-128.6490842577858\n2001-06-20,122.86,121.1,122.6,121.19,127.53652500850978,-127.53652500850978,-126.74731529504051,-126.74731529504051,-126.74731529504051,-127.90666667458508\n2001-06-21,127.47,122.15,123.86,122.22,120.4,120.4,120.4,120.4,120.4,117.992\n2001-06-22,123.6,122.16,122.75,123.49,120.54140000000001,120.54140000000001,120.54140000000001,120.54140000000001,120.54140000000001,118.18156\n2001-06-25,123.44,121.5,122.13,123.28,120.679972,120.679972,120.679972,120.679972,120.679972,118.36732880000001\n2001-06-26,122.9,120.03,121.84,120.9,127.47,-127.47,-127.47,-127.47,-127.47,118.54938222400001\n2001-06-27,125.15,120.91,121.31,121.6,127.3212,-127.3212,-127.2468,-127.2468,-127.2468,118.72779457952001\n2001-06-28,123.94,121.93,122.89,122.0,127.175376,-127.175376,-127.03029599999999,-127.03029599999999,-127.03029599999999,118.90263868792961\n2001-06-29,124.01,122.26,123.2,122.8,127.03246848,-127.03246848,-126.82028711999999,-126.82028711999999,-126.82028711999999,119.07398591417102\n2001-07-02,124.32,122.62,123.9,122.8,126.8924191104,-126.8924191104,-126.61657850639999,-126.61657850639999,-126.61657850639999,119.2419061958876\n2001-07-03,124.1,123.05,124.08,123.98,126.755170728192,-126.755170728192,-126.41898115120799,-126.41898115120799,-126.41898115120799,119.40646807196984\n2001-07-05,123.65,122.11,122.13,123.07,126.62066731362816,-126.62066731362816,-126.22731171667175,-126.22731171667175,-126.22731171667175,119.56773871053045\n2001-07-06,121.58,119.05,119.19,121.31,126.4888539673556,-126.4888539673556,-126.0413923651716,-126.0413923651716,-126.0413923651716,-130.0194\n2001-07-09,120.54,119.2,120.1,119.49,126.19129980866137,-126.19129980866137,-125.69182274691302,-125.69182274691302,-125.69182274691302,-129.690318\n2001-07-10,120.64,118.21,118.35,120.29,125.90564781631491,-125.90564781631491,-125.35973160956736,-125.35973160956736,-125.35973160956736,-129.37110846\n2001-07-11,119.04,117.09,118.27,118.1,125.44390894733601,-125.44390894733601,-124.85925039689765,-124.85925039689765,-124.85925039689765,-128.81305303699997\n2001-07-12,121.47,119.31,121.16,119.5,124.77559623154913,-124.77559623154913,-124.16001786117687,-124.16001786117687,-124.16001786117687,-127.99243932440997\n2001-07-13,122.32,120.62,121.9,120.84,124.1607485330252,-124.1607485330252,-123.52371625367095,-123.52371625367095,-123.52371625367095,-127.22926857170127\n2001-07-16,122.28,120.29,120.6,121.77,123.59508865038319,-123.59508865038319,-122.94468179084056,-122.94468179084056,-122.94468179084056,-126.51951977168218\n2001-07-17,121.94,119.83,121.67,120.2,123.07468155835254,-123.07468155835254,-122.41776042966491,-122.41776042966491,-122.41776042966491,-125.85945338766443\n2001-07-18,121.64,120.06,121.1,120.56,122.59590703368434,-122.59590703368434,-122.28,-122.28,-122.28,-125.24559165052793\n2001-07-19,122.98,120.76,121.83,122.18,117.09,117.09,117.09,117.09,117.09,-124.67470023499098\n2001-07-20,121.94,120.92,121.45,121.15,117.2078,117.2078,117.2078,117.2078,117.2078,-124.14377121854162\n2001-07-23,121.88,119.22,119.36,121.8,117.323244,117.323244,117.323244,117.323244,117.323244,-123.6500072332437\n2001-07-24,119.2,116.75,117.39,119.0,122.98,-122.98,-122.98,-122.98,-122.98,-123.19080672691663\n2001-07-25,119.48,117.46,119.3,117.92,122.8554,-122.8554,-122.79310000000001,-122.79310000000001,-122.79310000000001,-122.61113412149413\n2001-07-26,120.85,118.56,120.75,119.06,122.733292,-122.733292,-122.61180700000001,-122.61180700000001,-122.61180700000001,-122.08363205055966\n2001-07-27,121.6,119.91,121.0,120.83,122.61362616000001,-122.61362616000001,-122.43595279000002,-122.43595279000002,-122.43595279000002,-121.60360516600929\n2001-07-30,121.35,120.3,120.82,121.19,122.49635363680001,-122.49635363680001,-122.26537420630001,-122.26537420630001,-122.26537420630001,-121.6\n2001-07-31,122.68,120.18,121.46,121.0,116.75,116.75,116.75,116.75,116.75,114.415\n2001-08-01,122.7,120.9,121.96,121.97,116.8686,116.8686,116.8686,116.8686,116.8686,114.58030000000001\n2001-08-02,123.35,121.46,122.38,123.23,117.101856,117.101856,117.043542,117.043542,117.043542,114.823891\n2001-08-03,122.37,120.2,121.87,122.36,117.47674463999999,117.47674463999999,117.29580032,117.29580032,117.29580032,115.16493536\n2001-08-06,121.51,120.1,120.45,121.35,117.82913996159999,117.82913996159999,117.5379683072,117.5379683072,117.5379683072,115.4923379456\n2001-08-07,121.53,119.91,120.83,120.27,118.16039156390399,118.16039156390399,117.770449574912,117.770449574912,117.770449574912,115.80664442777599\n2001-08-08,121.16,118.43,118.65,120.12,123.35,-123.35,117.99363159191553,117.99363159191553,117.99363159191553,116.10837865066495\n2001-08-09,118.97,117.86,118.74,118.7,123.2516,-123.2516,-123.35,-123.35,-123.35,116.39804350463835\n2001-08-10,119.84,117.34,119.44,118.8,123.03593599999999,-123.03593599999999,-123.1853,-123.1853,-123.1853,116.67612176445282\n2001-08-13,119.85,118.82,119.49,119.6,122.69417983999999,-122.69417983999999,-122.893035,-122.893035,-122.893035,116.9430768938747\n2001-08-14,120.35,118.8,119.11,120.14,122.37292904959999,-122.37292904959999,-122.61538325,-122.61538325,-122.61538325,117.19935381811972\n2001-08-15,119.61,118.16,118.28,119.23,122.07095330662399,-122.07095330662399,-122.3516140875,-122.3516140875,-122.3516140875,117.44537966539492\n2001-08-16,118.75,117.0,118.62,117.8,121.78709610822655,-121.78709610822655,-122.101033383125,-122.101033383125,-122.101033383125,-125.817\n2001-08-17,117.87,116.01,116.64,117.65,121.40412841956842,-121.40412841956842,-121.74396104630625,-121.74396104630625,-121.74396104630625,-125.55248999999999\n2001-08-20,117.66,116.55,117.56,116.8,120.86471557761158,-120.86471557761158,-121.2279045521387,-121.2279045521387,-121.2279045521387,-125.07536549999999\n2001-08-21,118.54,108.05,116.13,117.8,120.37924401985042,-120.37924401985042,-120.75829314244622,-120.75829314244622,-120.75829314244622,-124.62209722499999\n2001-08-22,117.43,115.78,117.05,116.75,118.89973473746836,-118.89973473746836,-119.36038089677713,-119.36038089677713,-119.36038089677713,-123.46205041924999\n2001-08-23,117.52,116.52,116.7,116.96,118.54,-118.54,-118.54,-118.54,-118.54,-122.3832068899025\n2001-08-24,119.1,116.65,119.0,117.21,108.05,108.05,108.05,108.05,108.05,-121.37988240760932\n2001-08-27,119.2,118.26,118.49,118.97,108.271,108.271,108.271,108.271,108.271,-120.44679063907667\n2001-08-28,118.49,116.59,116.64,118.28,108.70816,108.70816,108.59887,108.59887,108.59887,-119.5790152943413\n2001-08-29,117.18,115.17,115.4,117.13,109.1278336,109.1278336,108.91690390000001,108.91690390000001,108.91690390000001,-119.2\n2001-08-30,115.91,112.01,113.28,114.85,109.53072025600001,109.53072025600001,109.22539678300001,109.22539678300001,109.22539678300001,-118.49\n2001-08-31,114.77,113.13,113.92,113.4,109.91749144576,109.91749144576,109.52463487951,109.52463487951,109.52463487951,-117.75919999999999\n2001-09-04,116.79,113.44,113.65,113.85,110.28879178792961,110.28879178792961,109.81489583312471,109.81489583312471,109.81489583312471,-117.079556\n2001-09-05,114.19,111.95,113.65,113.7,110.64524011641242,110.64524011641242,110.09644895813096,110.09644895813096,110.09644895813096,-116.79\n2001-09-06,113.3,111.09,111.1,112.65,110.98743051175593,110.98743051175593,110.36955548938704,110.36955548938704,110.36955548938704,-116.79\n2001-09-07,111.25,108.69,109.13,110.02,119.2,-119.2,-119.2,-119.2,-119.2,-116.1782\n2001-09-10,111.07,107.55,109.83,107.7,118.9898,-118.9898,-118.88470000000001,-118.88470000000001,-118.88470000000001,-115.609226\n2001-09-17,106.51,100.0,104.3,101.0,118.532208,-118.532208,-118.31796500000002,-118.31796500000002,-118.31796500000002,-114.88389566000001\n2001-09-18,105.3,103.36,103.9,104.33,117.42027552,-117.42027552,-117.03570745000002,-117.03570745000002,-117.03570745000002,-113.24666713740001\n2001-09-19,104.5,98.56,102.02,104.1,116.3750589888,-116.3750589888,-115.84320792850002,-115.84320792850002,-115.84320792850002,-111.789533752286\n2001-09-20,101.85,98.57,98.96,100.4,114.949854269696,-114.949854269696,-114.28771921493502,-114.28771921493502,-114.28771921493502,-110.06969436448883\n2001-09-21,99.7,93.8,96.85,94.05,113.63866592812032,-113.63866592812032,-112.87222448559088,-112.87222448559088,-112.87222448559088,-108.57343409710528\n2001-09-24,101.16,99.06,100.48,99.73,111.65479933530828,-111.65479933530828,-110.77427979217588,-110.77427979217588,-110.77427979217588,-106.35741898253949\n2001-09-25,102.0,99.9,101.4,100.75,109.86931940177746,-109.86931940177746,-108.90710901503653,-108.90710901503653,-108.90710901503653,-104.47380613515857\n2001-09-26,102.4,100.43,101.0,102.35,108.26238746159972,-108.26238746159972,-107.2453270233825,-107.2453270233825,-107.2453270233825,-102.87273521488478\n2001-09-27,102.25,100.0,102.05,101.25,106.81614871543974,-106.81614871543974,-105.76634105081042,-105.76634105081042,-105.76634105081042,-102.4\n2001-09-28,109.92,102.5,104.25,102.98,93.8,93.8,93.8,93.8,93.8,91.92399999999999\n2001-10-01,104.32,102.42,104.0,103.9,94.1224,94.1224,94.1224,94.1224,94.1224,92.28392\n2001-10-02,105.38,103.07,105.38,104.0,94.438352,94.438352,94.438352,94.438352,94.438352,92.63664159999999\n2001-10-03,107.88,104.35,107.34,104.6,94.74798496,94.74798496,94.74798496,94.74798496,94.74798496,92.982308768\n2001-10-04,108.97,104.37,107.1,108.29,95.0514252608,95.0514252608,95.0514252608,95.0514252608,95.0514252608,93.32106259263999\n2001-10-05,107.62,105.52,107.26,107.25,95.348796755584,95.348796755584,95.348796755584,95.348796755584,95.348796755584,93.65304134078718\n2001-10-08,107.3,105.87,106.53,106.28,95.64022082047232,95.64022082047232,95.64022082047232,95.64022082047232,95.64022082047232,93.97838051397144\n2001-10-09,106.75,105.6,105.87,106.61,95.92581640406287,95.92581640406287,95.92581640406287,95.92581640406287,95.92581640406287,94.29721290369201\n2001-10-10,108.55,105.52,108.4,105.8,96.20570007598161,96.20570007598161,96.20570007598161,96.20570007598161,96.20570007598161,94.60966864561817\n2001-10-11,110.3,108.95,110.01,108.95,96.47998607446198,96.47998607446198,96.47998607446198,96.47998607446198,96.47998607446198,94.9158752727058\n2001-10-12,109.89,107.3,109.45,109.15,97.0327866314835,97.0327866314835,96.89458649222811,96.89458649222811,96.89458649222811,95.37739901452463\n2001-10-15,109.45,107.19,109.3,108.63,97.56347516622417,97.56347516622417,97.29674889746127,97.29674889746127,97.29674889746127,95.82507704408889\n2001-10-16,110.62,108.95,110.06,109.8,98.07293615957519,98.07293615957519,97.68684643053743,97.68684643053743,97.68684643053743,96.25932473276622\n2001-10-17,111.15,107.9,107.9,111.07,98.82575999000068,98.82575999000068,98.20417257331593,98.20417257331593,98.20417257331593,96.83375174345557\n2001-10-18,108.16,106.74,107.21,107.82,99.81169919080062,99.81169919080062,98.85146394465013,98.85146394465013,98.85146394465013,97.54956415628278\n2001-10-19,107.92,106.01,107.55,107.0,100.71876325553657,100.71876325553657,99.46639074741763,99.46639074741763,99.46639074741763,98.22958594846864\n2001-10-22,109.49,107.21,109.26,107.3,101.55326219509365,101.55326219509365,100.05057121004675,100.05057121004675,100.05057121004675,98.8756066510452\n2001-10-23,110.61,108.38,108.8,109.96,102.32100121948616,102.32100121948616,100.60554264954442,100.60554264954442,100.60554264954442,99.48932631849294\n2001-10-24,109.94,108.12,108.77,108.98,103.02732112192727,103.02732112192727,101.1327655170672,101.1327655170672,101.1327655170672,100.0723600025683\n2001-10-25,110.33,106.74,110.31,107.45,103.67713543217309,103.67713543217309,101.63362724121384,101.63362724121384,101.63362724121384,100.62624200243988\n2001-10-26,111.8,109.64,110.77,109.95,104.27496459759924,104.27496459759924,102.10944587915316,102.10944587915316,102.10944587915316,101.15242990231789\n2001-10-29,110.55,108.06,108.23,110.16,105.0274681378393,105.0274681378393,102.69087912640397,102.69087912640397,102.69087912640397,101.79128410817881\n2001-10-30,107.7,105.56,106.2,107.35,111.8,-111.8,103.23742637881973,103.23742637881973,103.23742637881973,102.39180706168808\n2001-10-31,107.86,106.01,106.27,106.9,111.6752,-111.6752,103.75118079609055,103.75118079609055,103.75118079609055,102.9562986379868\n2001-11-01,109.01,105.43,108.67,106.6,111.552896,-111.552896,104.23410994832511,104.23410994832511,104.23410994832511,103.4869207197076\n2001-11-02,109.38,107.87,109.06,108.44,111.30798016,-111.30798016,104.68806335142561,104.68806335142561,104.68806335142561,103.98570547652514\n2001-11-05,111.09,100.74,110.58,110.12,100.74,100.74,-111.8,-111.8,-111.8,-114.036\n2001-11-06,112.45,109.85,112.29,110.35,100.74,100.74,100.74,100.74,100.74,-113.63712\n2001-11-07,113.12,111.56,111.96,111.77,100.74,100.74,100.74,100.74,100.74,-113.2502064\n2001-11-08,122.66,110.45,112.35,112.87,101.4828,101.4828,101.11139999999999,101.11139999999999,101.11139999999999,98.7252\n2001-11-09,112.96,111.44,112.44,112.25,103.176976,103.176976,101.97334399999998,101.97334399999998,101.97334399999998,99.203896\n2001-11-12,112.65,110.0,112.16,111.0,104.73561792,104.73561792,102.80081023999999,102.80081023999999,102.80081023999999,99.67301808\n2001-11-13,114.43,113.18,114.39,113.44,106.1695684864,106.1695684864,103.59517783039999,103.59517783039999,103.59517783039999,100.1327577184\n2001-11-14,115.4,113.7,114.62,115.17,107.488803007488,107.488803007488,104.357770717184,104.357770717184,104.357770717184,100.583302564032\n2001-11-15,115.18,113.93,114.6,114.37,108.70249876688897,108.70249876688897,105.08985988849663,105.08985988849663,105.08985988849663,101.02483651275135\n2001-11-16,115.1,113.4,114.31,115.08,109.81909886553785,109.81909886553785,105.79266549295677,105.79266549295677,105.79266549295677,101.45753978249633\n2001-11-19,115.57,114.45,115.53,114.92,110.84637095629482,110.84637095629482,106.4673588732385,106.4673588732385,106.4673588732385,101.8815889868464\n2001-11-20,115.8,111.15,114.81,115.37,122.66,-122.66,107.11506451830896,107.11506451830896,107.11506451830896,102.29715720710946\n2001-11-21,114.67,113.51,114.15,114.5,122.4298,-122.4298,107.73686193757659,107.73686193757659,107.73686193757659,102.70441406296727\n2001-11-23,118.63,114.0,115.52,114.04,122.204204,-122.204204,108.33378746007352,108.33378746007352,108.33378746007352,103.10352578170793\n2001-11-26,116.34,115.07,116.22,115.75,121.98311992000001,-121.98311992000001,108.90683596167058,108.90683596167058,108.90683596167058,103.49465526607378\n2001-11-27,116.9,114.09,115.4,115.62,121.7664575216,-121.7664575216,109.45696252320376,109.45696252320376,109.45696252320376,103.8779621607523\n2001-11-28,115.17,113.25,113.34,114.74,121.554128371168,-121.554128371168,109.9850840222756,109.9850840222756,109.9850840222756,104.25360291753726\n2001-11-29,114.56,113.0,114.48,113.66,121.34604580374464,-121.34604580374464,110.49208066138458,110.49208066138458,110.49208066138458,104.62173085918651\n2001-11-30,114.91,114.02,114.3,114.4,121.14212488766975,-121.14212488766975,110.97879743492919,110.97879743492919,110.97879743492919,104.98249624200278\n2001-12-03,114.08,113.01,113.36,113.65,120.94228238991636,-120.94228238991636,111.44604553753203,111.44604553753203,111.44604553753203,105.33604631716273\n2001-12-04,115.0,113.35,115.0,113.92,120.74643674211804,-120.74643674211804,111.89460371603074,111.89460371603074,111.89460371603074,105.68252539081948\n2001-12-05,118.0,115.56,117.64,115.61,120.55450800727567,-120.55450800727567,112.32521956738951,112.32521956738951,112.32521956738951,106.02207488300309\n2001-12-06,117.94,116.93,117.3,117.35,120.36641784713017,-120.36641784713017,112.73861078469393,112.73861078469393,112.73861078469393,106.35483338534303\n2001-12-07,117.09,115.7,116.45,116.9,120.18208949018756,-120.18208949018756,113.13546635330617,113.13546635330617,113.13546635330617,106.68093671763617\n2001-12-10,116.39,114.46,114.46,115.85,120.0014477003838,-120.0014477003838,113.51644769917392,113.51644769917392,113.51644769917392,107.00051798328344\n2001-12-11,115.72,113.9,114.19,114.9,119.82441874637613,-119.82441874637613,113.88218979120697,113.88218979120697,113.88218979120697,107.31370762361777\n2001-12-12,114.78,113.11,114.29,114.55,119.65093037144861,-119.65093037144861,-122.66,-122.66,-122.66,107.62063347114542\n2001-12-13,113.7,112.28,112.36,113.45,119.48091176401964,-119.48091176401964,-122.37349999999999,-122.37349999999999,-122.37349999999999,107.92142080172252\n2001-12-14,113.49,112.0,112.9,112.33,119.31429352873924,-119.31429352873924,-121.86882499999999,-121.86882499999999,-121.86882499999999,108.21619238568807\n2001-12-17,114.36,112.9,113.99,112.99,119.15100765816446,-119.15100765816446,-121.17800725,-121.17800725,-121.17800725,108.50506853797431\n2001-12-18,115.15,114.34,114.93,114.63,118.99098750500117,-118.99098750500117,-120.53554674249999,-120.53554674249999,-120.53554674249999,108.78816716721482\n2001-12-19,115.92,114.0,115.5,114.09,118.83416775490115,-118.83416775490115,-119.938058470525,-119.938058470525,-119.938058470525,109.06560382387053\n2001-12-20,115.8,114.63,114.69,115.5,118.68048439980312,-118.68048439980312,-119.38239437758824,-119.38239437758824,-119.38239437758824,109.33749174739312\n2001-12-21,115.1,114.2,114.66,115.03,118.52987471180705,-118.52987471180705,-118.86562677115707,-118.86562677115707,-118.86562677115707,109.60394191244525\n2001-12-24,115.04,114.61,114.73,114.83,118.38227721757092,-118.38227721757092,-118.38503289717607,-118.38503289717607,-118.38503289717607,109.86506307419634\n2001-12-26,116.21,114.65,115.25,114.65,118.2376316732195,-118.2376316732195,-117.93808059437374,-117.93808059437374,-117.93808059437374,110.12096181271241\n2001-12-27,116.33,115.26,115.93,115.3,118.0958790397551,-118.0958790397551,-117.52241495276758,-117.52241495276758,-117.52241495276758,110.37174257645816\n2001-12-28,116.75,115.95,116.21,116.29,117.95696145896,-117.95696145896,-117.13584590607384,-117.13584590607384,-117.13584590607384,110.617507724929\n2001-12-31,116.4,114.85,114.89,116.15,117.8208222297808,-117.8208222297808,-116.77633669264867,-116.77633669264867,-116.77633669264867,110.85835757043041\n2002-01-02,115.65,113.81,115.59,115.11,117.68740578518519,-117.68740578518519,-116.75,-116.75,-116.75,111.0943904190218\n2002-01-03,116.83,115.0,116.76,115.65,117.55665766948148,-117.55665766948148,112.0,112.0,112.0,111.32570261064137\n2002-01-04,117.98,113.36,117.41,117.17,111.15,111.15,112.0966,112.0966,112.0966,111.55238855842855\n2002-01-07,117.99,115.71,116.7,117.7,111.2866,111.2866,112.273102,112.273102,112.273102,111.77454078725998\n2002-01-08,117.06,115.97,116.36,116.8,111.554736,111.554736,112.50177792,112.50177792,112.50177792,111.99224997151478\n2002-01-09,119.91,115.34,115.7,116.68,111.81214656,111.81214656,112.7213068032,112.7213068032,112.7213068032,112.20560497208449\n2002-01-10,116.35,115.3,115.96,115.7,112.29801776640001,112.29801776640001,113.08074146304,113.08074146304,113.08074146304,112.4146928726428\n2002-01-11,116.28,114.71,114.77,116.21,112.754736700416,112.754736700416,113.422204389888,113.422204389888,113.422204389888,112.61959901518995\n2002-01-14,114.84,114.1,114.12,114.65,113.18405249839104,113.18405249839104,113.74659417039359,113.74659417039359,113.74659417039359,112.82040703488614\n2002-01-15,115.39,113.9,114.88,114.55,113.58760934848758,113.58760934848758,-119.91,-119.91,-119.91,113.01719889418843\n2002-01-16,114.4,113.0,113.05,114.3,119.91,-119.91,-119.7297,-119.7297,-119.7297,-125.11319999999999\n2002-01-17,114.24,113.4,114.13,113.76,119.7718,-119.7718,-119.393215,-119.393215,-119.393215,-124.749804\n2002-01-18,113.87,111.36,113.08,113.0,119.636364,-119.636364,-119.07355425,-119.07355425,-119.07355425,-124.39730988\n2002-01-22,113.95,112.02,112.25,113.75,119.30530944,-119.30530944,-118.5336054525,-118.5336054525,-118.5336054525,-123.74544438599999\n2002-01-23,113.56,112.02,113.14,112.63,118.9874970624,-118.9874970624,-118.031453070825,-118.031453070825,-118.031453070825,-123.12617216669999\n2002-01-24,114.25,113.32,113.54,113.64,118.682397179904,-118.682397179904,-117.56445135586725,-117.56445135586725,-117.56445135586725,-122.53786355836499\n2002-01-25,114.18,113.04,113.59,113.12,118.38950129270783,-118.38950129270783,-117.13013976095654,-117.13013976095654,-117.13013976095654,-121.97897038044674\n2002-01-28,114.19,98.92,113.63,113.9,118.10832124099952,-118.10832124099952,-116.72622997768958,-116.72622997768958,-116.72622997768958,-121.44802186142441\n2002-01-29,114.41,110.05,110.28,113.85,116.95702196653954,-116.95702196653954,-115.12366927969752,-115.12366927969752,-115.12366927969752,-119.8710603311247\n2002-01-30,113.39,108.4,111.61,110.39,115.87480064854716,-115.87480064854716,-114.41,-114.41,-114.41,-118.40448610794597\n2002-01-31,113.27,111.62,113.24,112.15,114.85751260963434,-114.85751260963434,-114.41,-114.41,-114.41,-117.04057208038975\n2002-02-01,113.7,111.55,112.6,113.09,113.90126185305628,-113.90126185305628,98.92,98.92,98.92,-115.77213203476246\n2002-02-04,115.18,109.45,109.7,112.23,98.92,98.92,99.2156,99.2156,99.2156,96.94160000000001\n2002-02-05,110.5,108.53,109.27,109.4,99.2452,99.2452,99.694532,99.694532,99.694532,97.306368\n2002-02-06,109.74,108.06,108.7,109.65,99.563896,99.563896,100.15909604,100.15909604,100.15909604,97.66384064\n2002-02-07,109.86,108.16,108.38,108.72,99.87621808,99.87621808,100.6097231588,100.6097231588,100.6097231588,98.01416382720001\n2002-02-08,110.05,108.3,109.97,108.63,100.1822937184,100.1822937184,101.04683146403599,101.04683146403599,101.04683146403599,98.357480550656\n2002-02-11,111.63,109.82,111.59,110.05,100.482247844032,100.482247844032,101.47082652011491,101.47082652011491,101.47082652011491,98.69393093964288\n2002-02-12,111.71,110.62,111.11,110.96,100.77620288715136,100.77620288715136,101.88210172451147,101.88210172451147,101.88210172451147,99.02365232085002\n2002-02-13,112.54,111.35,112.26,111.48,101.06427882940832,101.06427882940832,102.28103867277613,102.28103867277613,102.28103867277613,99.34677927443302\n2002-02-14,112.97,111.59,111.98,112.51,101.34659325282016,101.34659325282016,102.66800751259285,102.66800751259285,102.66800751259285,99.66344368894435\n2002-02-15,112.24,110.71,110.83,112.15,101.62326138776375,101.62326138776375,103.04336728721506,103.04336728721506,103.04336728721506,99.97377481516547\n2002-02-19,110.3,100.2,108.74,110.15,115.18,-115.18,-115.18,-115.18,-115.18,-117.48360000000001\n2002-02-20,110.38,107.82,110.32,109.05,114.88040000000001,-114.88040000000001,-114.73060000000001,-114.73060000000001,-114.73060000000001,-116.96509200000001\n2002-02-21,110.99,108.4,108.6,109.93,114.586792,-114.586792,-114.29468200000001,-114.29468200000001,-114.29468200000001,-116.46213924000001\n2002-02-22,109.94,107.87,109.37,108.35,114.29905616,-114.29905616,-113.87184154,-113.87184154,-113.87184154,-115.97427506280002\n2002-02-25,111.81,109.7,111.5,109.75,114.01707503680001,-114.01707503680001,-113.4616862938,-113.4616862938,-113.4616862938,-115.50104681091602\n2002-02-26,112.04,110.19,111.36,111.6,113.74073353606401,-113.74073353606401,-113.063835704986,-113.063835704986,-113.063835704986,-115.04201540658855\n2002-02-27,112.86,110.65,111.55,111.96,113.46991886534273,-113.46991886534273,100.2,100.2,100.2,-114.5967549443909\n2002-02-28,112.75,111.14,111.19,111.83,113.20452048803588,-113.20452048803588,100.45320000000001,100.45320000000001,100.45320000000001,-114.16485229605917\n2002-03-01,113.73,111.51,113.66,111.72,100.2,100.2,100.70133600000001,100.70133600000001,100.70133600000001,-113.74590672717738\n2002-03-04,115.99,113.65,115.93,113.9,100.4706,100.4706,101.09219592000001,101.09219592000001,101.09219592000001,98.196\n2002-03-05,116.4,114.97,115.21,115.33,101.09137600000001,101.09137600000001,101.6881080832,101.6881080832,101.6881080832,98.55188\n2002-03-06,117.71,115.08,116.81,115.1,102.00989344000001,102.00989344000001,102.42370267904,102.42370267904,102.42370267904,99.08732359999999\n2002-03-07,117.5,112.53,116.33,117.36,103.26590196480001,103.26590196480001,103.34088051829761,103.34088051829761,103.34088051829761,99.832230656\n2002-03-08,127.3,116.48,116.89,117.38,104.42142980761601,104.42142980761601,104.20302768719975,104.20302768719975,104.20302768719975,100.54734142976\n2002-03-11,117.9,116.43,117.34,116.89,106.70928682685441,106.70928682685441,105.81981574909577,105.81981574909577,105.81981574909577,101.88497435827199\n2002-03-12,117.12,115.94,117.1,116.11,108.76835814416897,108.76835814416897,107.32342864665907,107.32342864665907,107.32342864665907,103.15572564035838\n2002-03-13,116.75,115.0,115.9,116.63,110.62152232975207,110.62152232975207,108.72178864139293,108.72178864139293,108.72178864139293,104.36293935834047\n2002-03-14,116.43,115.63,115.86,116.04,112.28937009677686,112.28937009677686,110.02226343649542,110.02226343649542,110.02226343649542,105.50979239042344\n2002-03-15,116.95,106.22,116.79,115.97,127.3,-127.3,-127.3,-127.3,-127.3,-129.846\n2002-03-18,117.57,115.85,116.76,117.1,126.8784,-126.8784,-126.6676,-126.6676,-126.6676,-129.13722\n2002-03-19,117.74,116.82,117.35,117.3,126.465232,-126.465232,-126.054172,-126.054172,-126.054172,-128.4497034\n2002-03-20,117.25,115.39,115.43,116.5,126.06032736,-126.06032736,-125.45914683999999,-125.45914683999999,-125.45914683999999,-127.78281229800001\n2002-03-21,115.9,114.12,115.6,115.3,125.6635208128,-125.6635208128,-124.88197243479999,-124.88197243479999,-124.88197243479999,-127.13592792906002\n2002-03-22,115.94,114.7,115.09,115.5,125.274650396544,-125.274650396544,-124.32211326175599,-124.32211326175599,-124.32211326175599,-126.50845009118822\n2002-03-25,115.36,113.38,113.43,115.09,124.89355738861312,-124.89355738861312,-123.77904986390331,-123.77904986390331,-123.77904986390331,-125.89979658845257\n2002-03-26,115.02,113.47,114.08,113.52,124.52008624084085,-124.52008624084085,-123.25227836798621,-123.25227836798621,-123.25227836798621,-125.30940269079899\n2002-03-27,115.01,113.0,114.67,114.03,124.15408451602404,-124.15408451602404,-122.74131001694663,-122.74131001694663,-122.74131001694663,-124.73672061007503\n2002-03-28,115.77,114.68,114.91,114.97,123.79540282570356,-123.79540282570356,-122.24567071643823,-122.24567071643823,-122.24567071643823,-124.18121899177278\n2002-04-01,115.1,112.96,114.83,114.23,123.44389476918948,-123.44389476918948,-121.76490059494508,-121.76490059494508,-121.76490059494508,-123.6423824220196\n2002-04-02,144.12,113.77,113.93,113.98,106.22,106.22,106.22,106.22,106.22,104.0956\n2002-04-03,116.2,112.15,112.74,114.01,106.978,106.978,106.978,106.978,106.978,104.896088\n2002-04-04,115.53,112.23,112.89,112.6,107.72084,107.72084,107.72084,107.72084,107.72084,105.68056624\n2002-04-05,113.67,112.18,112.53,113.19,108.44882319999999,108.44882319999999,108.44882319999999,108.44882319999999,108.44882319999999,106.4493549152\n2002-04-08,112.88,111.23,112.81,111.32,109.16224673599999,109.16224673599999,109.16224673599999,109.16224673599999,109.16224673599999,107.202767816896\n2002-04-09,113.19,111.93,112.05,113.19,109.86140180127998,109.86140180127998,109.86140180127998,109.86140180127998,109.86140180127998,107.94111246055807\n2002-04-10,113.54,112.09,113.35,112.1,110.54657376525438,110.54657376525438,110.54657376525438,110.54657376525438,110.54657376525438,108.66469021134691\n2002-04-11,113.05,110.5,110.72,112.89,144.12,-144.12,-144.12,-144.12,-144.12,109.37379640711997\n2002-04-12,111.97,110.57,111.33,111.03,143.4476,-143.4476,-143.1114,-143.1114,-143.1114,110.06872047897757\n2002-04-15,111.97,110.2,110.63,111.62,142.788648,-142.788648,-142.133058,-142.133058,-142.133058,-147.0024\n2002-04-16,113.32,111.67,113.12,111.7,141.48510208,-141.48510208,-140.5364051,-140.5364051,-140.5364051,-145.898328\n2002-04-17,113.67,112.6,113.05,113.39,140.2336979968,-140.2336979968,-139.019584845,-139.019584845,-139.019584845,-144.82737816\n2002-04-18,113.46,111.15,112.76,112.9,139.032350076928,-139.032350076928,-137.57860560275,-137.57860560275,-137.57860560275,-143.7885568152\n2002-04-19,113.24,112.56,112.85,113.2,137.87905607385088,-137.87905607385088,-136.2096753226125,-136.2096753226125,-136.2096753226125,-142.780900110744\n2002-04-22,112.61,110.84,111.14,112.38,136.77189383089683,-136.77189383089683,-134.9091915564819,-134.9091915564819,-134.9091915564819,-141.80347310742167\n2002-04-23,111.9,110.17,110.38,111.09,135.70901807766094,-135.70901807766094,-133.6737319786578,-133.6737319786578,-133.6737319786578,-140.855368914199\n2002-04-24,111.24,109.51,109.59,110.56,134.17667699300128,-134.17667699300128,-132.02847074015176,-132.02847074015176,-132.02847074015176,-139.32110046848905\n2002-04-25,110.43,108.72,109.43,109.21,132.20334283356118,-132.20334283356118,-130.0018083735381,-130.0018083735381,-130.0018083735381,-137.23432343569482\n2002-04-26,110.01,107.9,107.95,109.79,129.85500855020507,-129.85500855020507,-127.6608094524489,-127.6608094524489,-127.6608094524489,-134.66803432648229\n2002-04-29,108.26,106.63,106.92,107.93,127.22040752418046,-127.22040752418046,-125.09190422363055,-125.09190422363055,-125.09190422363055,-131.72355055056923\n2002-04-30,108.75,106.64,107.98,107.02,124.3377504707952,-124.3377504707952,-122.32261859008597,-122.32261859008597,-122.32261859008597,-128.46138897899522\n2002-05-01,109.25,106.8,108.96,107.97,121.85866540488387,-121.85866540488387,-119.96872580157307,-119.96872580157307,-119.96872580157307,-125.62330841172584\n2002-05-02,109.91,108.2,108.77,109.1,119.72665224820012,-119.72665224820012,-117.96791693133711,-117.96791693133711,-117.96791693133711,-123.15417831820149\n2002-05-03,108.95,107.2,107.67,108.6,117.89312093345211,-117.89312093345211,-116.26722939163655,-116.26722939163655,-116.26722939163655,-121.0060351368353\n2002-05-06,108.9,105.51,105.62,107.65,116.31628400276881,-116.31628400276881,-114.82164498289106,-114.82164498289106,-114.82164498289106,-119.13715056904671\n2002-05-07,106.32,105.0,105.23,106.11,114.5872785623258,-114.5872785623258,-113.23866533579958,-113.23866533579958,-113.23866533579958,-117.09307798368971\n2002-05-08,109.36,106.79,109.16,107.05,112.86156842110717,-112.86156842110717,-111.67331892199766,-111.67331892199766,-111.67331892199766,-115.03725472646246\n2002-05-09,109.1,107.58,107.65,108.65,111.44648610530787,-111.44648610530787,-110.40538832681811,-110.40538832681811,-110.40538832681811,-113.33092142296384\n2002-05-10,108.05,105.72,105.98,107.97,110.28611860635246,-110.28611860635246,-109.37836454472267,-109.37836454472267,-109.37836454472267,-111.91466478105998\n2002-05-13,107.95,105.78,107.82,106.22,109.33461725720902,-109.33461725720902,-109.1,-109.1,-109.1,-110.73917176827979\n2002-05-14,110.26,109.0,110.09,109.62,105.0,105.0,105.0,105.0,105.0,102.9\n2002-05-15,110.91,109.29,109.55,109.5,105.1052,105.1052,105.1052,105.1052,105.1052,103.0472\n2002-05-16,110.43,109.33,110.35,109.7,105.337392,105.337392,105.279344,105.279344,105.279344,103.283084\n2002-05-17,111.17,110.1,111.11,110.66,105.56029631999999,105.56029631999999,105.44826368,105.44826368,105.44826368,103.51189148\n2002-05-20,110.69,109.49,109.64,110.64,105.89687854079999,105.89687854079999,105.6771331328,105.6771331328,105.6771331328,103.8182158208\n2002-05-21,110.49,108.29,108.48,110.11,106.213265828352,106.213265828352,105.896847807488,105.896847807488,105.896847807488,104.11228718796801\n2002-05-22,109.12,108.0,109.05,108.22,106.51066987865087,106.51066987865087,106.10777389518849,106.10777389518849,106.10777389518849,104.39459570044929\n2002-05-23,110.24,108.48,110.16,109.26,106.79022968593182,106.79022968593182,106.31026293938095,106.31026293938095,106.31026293938095,104.66561187243131\n2002-05-24,110.21,108.66,108.85,109.98,107.0530159047759,107.0530159047759,106.50465242180572,106.50465242180572,106.50465242180572,104.92578739753407\n2002-05-28,109.94,107.45,107.9,109.05,107.30003495048935,107.30003495048935,106.6912663249335,106.6912663249335,106.6912663249335,105.1755559016327\n2002-05-29,108.02,107.25,107.25,107.63,111.17,-111.17,106.87041567193616,106.87041567193616,106.87041567193616,105.4153336655674\n2002-05-30,107.51,105.9,107.01,106.55,111.0916,-111.0916,-111.17,-111.17,-111.17,105.6455203189447\n2002-05-31,108.56,107.08,107.23,107.4,110.883936,-110.883936,-111.0119,-111.0119,-111.0119,105.86649950618691\n2002-06-03,108.88,104.25,104.3,107.09,110.68457856,-110.68457856,-110.858543,-110.858543,-110.858543,-113.3934\n2002-06-04,105.2,103.28,104.41,104.15,110.29850384640001,-110.29850384640001,-110.52811584999999,-110.52811584999999,-110.52811584999999,-113.119098\n2002-06-05,105.62,104.35,105.5,104.95,109.737023538688,-109.737023538688,-110.0207477405,-110.0207477405,-110.0207477405,-112.6271431\n2002-06-06,124.67,103.15,103.42,105.54,103.15,103.15,103.15,103.15,103.15,101.087\n2002-06-07,103.92,101.72,103.26,101.79,124.67,-124.67,-124.67,-124.67,-124.67,101.55866\n2002-06-10,104.46,103.02,103.56,103.24,124.67,-124.67,-124.67,-124.67,-124.67,101.72\n2002-06-11,104.54,101.76,101.89,104.13,124.211,-124.211,-123.9815,-123.9815,-123.9815,101.72\n2002-06-12,102.97,100.78,102.64,101.71,123.76118,-123.76118,-123.313655,-123.313655,-123.313655,-127.1634\n2002-06-13,103.0,101.34,101.5,102.13,122.8419328,-122.8419328,-122.18697225,-122.18697225,-122.18697225,-126.371898\n2002-06-14,101.56,98.5,101.29,100.31,121.95945548799999,-121.95945548799999,-121.1166236375,-121.1166236375,-121.1166236375,-125.60414106\n2002-06-17,104.29,100.47,104.19,101.92,120.55188815871999,-120.55188815871999,-119.533459982875,-119.533459982875,-119.533459982875,-124.248934007\n2002-06-18,104.74,102.92,104.24,103.74,119.2287748691968,-119.2287748691968,-118.06111778407376,-118.06111778407376,-118.06111778407376,-122.96148730665\n2002-06-19,104.48,102.26,102.54,103.5,117.98504837704499,-117.98504837704499,-116.69183953918859,-116.69183953918859,-116.69183953918859,-121.7384129413175\n2002-06-20,103.05,100.96,101.2,102.27,116.81594547442229,-116.81594547442229,-115.4184107714454,-115.4184107714454,-115.4184107714454,-120.57649229425164\n2002-06-21,101.2,98.69,99.19,100.47,115.71698874595695,-115.71698874595695,-114.23412201744422,-114.23412201744422,-114.23412201744422,-119.47266767953906\n2002-06-24,100.69,97.25,99.69,98.61,114.68396942119954,-114.68396942119954,-113.13273347622312,-113.13273347622312,-113.13273347622312,-118.42403429556211\n2002-06-25,100.89,97.54,97.9,100.3,113.28925186750357,-113.28925186750357,-111.70328746336304,-111.70328746336304,-111.70328746336304,-116.94185189487276\n2002-06-26,98.15,95.2,97.62,95.2,112.00611171810328,-112.00611171810328,-110.40249159166036,-110.40249159166036,-110.40249159166036,-115.56342226223167\n2002-06-27,99.45,96.57,99.45,98.5,110.32550054629296,-110.32550054629296,-108.73021751657772,-108.73021751657772,-108.73021751657772,-113.73071425863081\n2002-06-28,100.5,99.02,99.25,99.24,108.81295049166366,-108.81295049166366,-107.24189358975417,-107.24189358975417,-107.24189358975417,-112.06294997535404\n2002-07-01,101.5,96.95,97.08,99.19,107.4516554424973,-107.4516554424973,-105.91728529488121,-105.91728529488121,-105.91728529488121,-110.54528447757218\n2002-07-02,98.08,94.77,95.02,96.87,106.22648989824756,-106.22648989824756,-104.73838391244428,-104.73838391244428,-104.73838391244428,-109.16420887459068\n2002-07-03,95.84,93.73,95.69,94.62,104.85171111045786,-104.85171111045786,-103.44249400382652,-103.44249400382652,-103.44249400382652,-107.5808458983857\n2002-07-05,99.55,96.67,99.3,96.78,103.29467155499376,-103.29467155499376,-101.98561990325254,-101.98561990325254,-101.98561990325254,-105.78023593159557\n2002-07-08,99.7,97.56,98.03,98.98,101.95561753729463,-101.95561753729463,-100.74727691776467,-100.74727691776467,-100.74727691776467,-104.21370526048814\n2002-07-09,98.34,95.01,95.61,97.73,100.80403108207338,-100.80403108207338,-99.7,-99.7,-99.7,-102.85082357662468\n2002-07-10,96.07,92.2,92.29,96.0,99.81366673058311,-99.81366673058311,-99.7,-99.7,-99.7,-101.66511651166347\n2002-07-11,93.35,90.06,93.15,91.76,98.59548005368981,-98.59548005368981,-98.425,-98.425,-98.425,-100.24534903491394\n2002-07-12,93.89,91.52,92.46,93.33,97.05909364402565,-97.05909364402565,-96.83565,-96.83565,-96.83565,-98.51383969897857\n2002-07-15,101.6,87.89,92.1,91.64,87.89,87.89,87.89,87.89,87.89,86.1322\n2002-07-16,92.38,89.87,90.58,91.13,87.89,87.89,87.89,87.89,87.89,86.44155599999999\n2002-07-17,93.3,89.75,91.0,92.46,87.89,87.89,87.89,87.89,87.89,86.74472487999999\n2002-07-18,91.1,88.24,88.33,90.7,88.1642,88.1642,88.1642,88.1642,88.1642,87.0418303824\n2002-07-19,88.4,84.3,84.8,86.77,101.6,-101.6,-101.6,-101.6,-101.6,-103.63199999999999\n2002-07-22,85.91,81.45,82.21,84.11,101.25399999999999,-101.25399999999999,-101.08099999999999,-101.08099999999999,-101.08099999999999,-103.05203999999999\n2002-07-23,83.24,78.85,80.0,82.55,100.46184,-100.46184,-100.09944999999999,-100.09944999999999,-100.09944999999999,-101.971938\n2002-07-24,84.94,77.68,84.75,78.14,99.1651296,-99.1651296,-98.6119885,-98.6119885,-98.6119885,-100.35340233999999\n2002-07-25,85.85,81.6,84.2,84.28,97.44631923200001,-97.44631923200001,-96.728109535,-96.728109535,-96.728109535,-98.31279612939998\n2002-07-26,85.69,83.8,85.6,84.65,95.86501369344,-95.86501369344,-95.01377967685,-95.01377967685,-95.01377967685,-96.45584447775398\n2002-07-29,90.34,84.54,90.23,87.51,94.4102125979648,-94.4102125979648,-93.45373950593351,-93.45373950593351,-93.45373950593351,-94.76601847475612\n2002-07-30,91.4,88.7,90.7,89.32,93.07179559012762,-93.07179559012762,-92.0341029503995,-92.0341029503995,-92.0341029503995,-93.22827681202807\n2002-07-31,91.45,88.93,91.38,90.5,91.84045194291741,-91.84045194291741,77.68,77.68,77.68,-91.82893189894554\n2002-08-01,91.35,88.46,88.64,90.88,91.45,-91.45,77.95540000000001,77.95540000000001,77.95540000000001,-91.45\n2002-08-02,88.92,85.29,86.66,88.5,91.45,-91.45,78.22529200000001,78.22529200000001,78.22529200000001,-91.45\n2002-08-05,86.93,83.6,83.73,86.5,91.35,-91.35,78.48978616000001,78.48978616000001,78.48978616000001,-91.35\n2002-08-06,87.9,84.88,86.4,85.23,90.2564,-90.2564,78.74899043680001,78.74899043680001,78.74899043680001,-90.1197\n2002-08-07,88.5,85.77,88.15,87.88,89.250288,-89.250288,79.00301062806402,79.00301062806402,79.00301062806402,-89.00012699999999\n2002-08-08,91.1,87.8,90.98,88.42,77.68,77.68,79.25195041550273,79.25195041550273,79.25195041550273,76.1264\n2002-08-09,91.94,89.35,91.26,90.1,77.9484,77.9484,79.49591140719268,79.49591140719268,79.49591140719268,76.425872\n2002-08-12,91.27,89.55,90.7,90.0,78.508064,78.508064,79.8692340649769,79.8692340649769,79.8692340649769,76.89129584\n2002-08-13,91.66,88.67,88.75,90.15,79.04534144,79.04534144,80.23135704302759,80.23135704302759,80.23135704302759,77.3427569648\n2002-08-14,92.63,88.01,92.41,89.02,79.5611277824,79.5611277824,80.58261633173676,80.58261633173676,80.58261633173676,77.780674255856\n2002-08-15,93.99,90.3,93.4,92.85,80.345260115456,80.345260115456,81.06451167846728,81.06451167846728,81.06451167846728,78.37464728562176\n2002-08-16,94.08,92.0,93.22,92.82,81.43683930621953,81.43683930621953,81.71078609454392,81.71078609454392,81.71078609454392,79.15541492134068\n2002-08-19,95.75,93.1,95.52,93.46,82.70115537559758,82.70115537559758,82.45293892887129,82.45293892887129,82.45293892887129,80.05089002606024\n2002-08-20,95.8,93.62,94.27,94.82,84.26701673052587,84.26701673052587,83.3837332038503,83.3837332038503,83.3837332038503,81.14982772423603\n2002-08-21,95.75,93.1,95.5,95.06,85.88163438825225,85.88163438825225,84.37703454754228,84.37703454754228,84.37703454754228,82.32184150629715\n2002-08-22,97.5,95.07,96.76,95.49,87.27020557389693,87.27020557389693,85.2908717837389,85.2908717837389,85.2908717837389,83.40009418579338\n2002-08-23,96.15,92.25,94.52,96.02,88.90697268207342,88.90697268207342,86.3896933232024,86.3896933232024,86.3896933232024,84.66908570907198\n2002-08-26,95.64,93.5,95.28,94.91,90.28185705294167,90.28185705294167,87.38962092411418,87.38962092411418,87.38962092411418,85.8238679952555\n2002-08-27,96.25,93.51,93.9,95.7,91.436759924471,91.436759924471,88.2995550409439,88.2995550409439,88.2995550409439,86.8747198756825\n2002-08-28,95.15,91.8,92.3,93.29,97.5,-97.5,89.12759508725895,89.12759508725895,89.12759508725895,87.83099508687107\n2002-08-29,93.06,90.81,92.3,91.27,97.386,-97.386,89.88111152940564,89.88111152940564,89.88111152940564,88.70120552905267\n2002-08-30,93.39,91.4,92.1,91.69,97.12295999999999,-97.12295999999999,90.56681149175914,90.56681149175914,90.56681149175914,89.49309703143793\n2002-09-03,91.35,88.15,88.21,90.74,96.87044159999999,-96.87044159999999,-97.5,-97.5,-97.5,-99.45\n2002-09-04,90.25,88.06,89.75,88.62,96.347215104,-96.347215104,-97.2195,-97.2195,-97.2195,-99.111\n2002-09-05,89.43,87.5,88.47,88.49,95.68423789568,-95.68423789568,-96.76152499999999,-96.76152499999999,-96.76152499999999,-98.55845000000001\n2002-09-06,91.37,89.35,89.86,89.75,94.865814106112,-94.865814106112,-96.11321824999999,-96.11321824999999,-96.11321824999999,-97.78435850000001\n2002-09-09,92.02,88.27,90.8,89.1,94.1292326955008,-94.1292326955008,-95.51029297249998,-95.51029297249998,-95.51029297249998,-97.06445340500001\n2002-09-10,91.61,90.56,91.55,91.14,93.46630942595073,-93.46630942595073,-94.94957246442499,-94.94957246442499,-94.94957246442499,-96.39494166665001\n2002-09-11,93.7,90.92,91.5,92.47,87.5,87.5,-94.42810239191525,-94.42810239191525,-94.42810239191525,-95.77229574998451\n2002-09-12,90.84,88.99,89.26,90.75,87.624,87.624,-93.94313522448118,-93.94313522448118,-93.94313522448118,-95.19323504748559\n2002-09-13,89.9,88.25,89.54,88.7,87.74552,87.74552,-93.7,-93.7,-93.7,-94.65470859416159\n2002-09-16,89.83,88.47,89.73,89.32,87.8646096,87.8646096,-93.266,-93.266,-93.266,-94.15387899257028\n2002-09-17,91.19,87.75,87.97,90.89,93.7,-93.7,-92.86238,-92.86238,-92.86238,-93.68810746309036\n2002-09-18,88.5,86.1,87.49,87.02,93.581,-93.581,-92.4870134,-92.4870134,-92.4870134,-93.25493994067403\n2002-09-19,86.8,84.78,84.85,86.0,93.28176,-93.28176,-91.912182194,-91.912182194,-91.912182194,-92.61099534601337\n2002-09-20,85.2,84.05,84.66,84.92,92.7716544,-92.7716544,-91.12764215266,-91.12764215266,-91.12764215266,-91.7495858579519\n2002-09-23,84.07,82.69,83.59,83.65,92.073922048,-92.073922048,-90.2075486728142,-90.2075486728142,-90.2075486728142,-90.74863969641815\n2002-09-24,83.65,81.85,82.15,82.44,91.1355298432,-91.1355298432,-89.07991637189207,-89.07991637189207,-89.07991637189207,-89.53984374195542\n2002-09-25,84.77,82.04,84.11,83.37,90.021266262016,-90.021266262016,-87.85083058867042,-87.85083058867042,-87.85083058867042,-88.232570305823\n2002-09-26,85.98,84.45,85.87,85.02,89.04071431057407,-89.04071431057407,-86.83068938859645,-86.83068938859645,-86.83068938859645,-87.1475333538331\n2002-09-27,85.7,82.8,82.85,85.0,88.17782859330518,-88.17782859330518,-85.98397219253506,-85.98397219253506,-85.98397219253506,-86.24695268368147\n2002-09-30,82.8,80.01,81.6,82.0,87.41848916210856,-87.41848916210856,-85.98,-85.98,-85.98,-85.98\n2002-10-01,85.1,81.09,85.0,82.44,86.38130067941336,-86.38130067941336,-85.7,-85.7,-85.7,-85.7\n2002-10-02,85.53,82.58,83.05,84.69,80.01,80.01,80.01,80.01,80.01,78.4098\n2002-10-03,84.84,81.95,82.05,83.14,80.1204,80.1204,80.1204,80.1204,80.1204,78.552204\n2002-10-04,82.92,79.58,80.39,82.8,85.53,-85.53,-85.53,-85.53,-85.53,78.69175992000001\n2002-10-07,81.2,78.55,78.82,80.07,85.411,-85.411,-85.3515,-85.3515,-85.3515,-87.2406\n2002-10-08,81.31,78.2,80.11,79.81,85.13656,-85.13656,-85.011425,-85.011425,-85.011425,-86.979882\n2002-10-09,79.85,77.78,78.0,79.09,84.7203664,-84.7203664,-84.53462525,-84.53462525,-84.53462525,-86.5408879\n2002-10-10,81.07,77.07,80.66,77.94,84.16513708800001,-84.16513708800001,-83.9267089775,-83.9267089775,-83.9267089775,-85.92762574700001\n2002-10-11,84.73,80.18,83.9,82.1,77.07,77.07,77.07,77.07,77.07,-85.13043942977001\n2002-10-14,84.85,83.03,84.47,83.2,77.07,77.07,77.07,77.07,77.07,75.5286\n2002-10-15,89.75,86.86,88.42,86.99,77.38119999999999,77.38119999999999,77.3034,77.3034,77.3034,75.715028\n2002-10-16,88.26,85.92,86.37,87.42,78.12332799999999,78.12332799999999,77.801264,77.801264,77.801264,76.13607716\n2002-10-17,90.03,87.85,88.18,88.87,78.82092832,78.82092832,78.27921344,78.27921344,78.27921344,76.5444948452\n2002-10-18,89.11,86.93,88.65,87.15,79.7176540544,79.7176540544,78.86675276800001,78.86675276800001,78.86675276800001,77.08391505139201\n2002-10-21,90.5,87.57,90.29,88.12,80.542641730048,80.542641730048,79.42491512960001,79.42491512960001,79.42491512960001,77.60175844933633\n2002-10-22,90.01,88.52,89.32,89.05,81.5383775570432,81.5383775570432,80.08942022182401,80.08942022182401,80.08942022182401,78.24667052686951\n2002-10-23,89.99,86.65,89.97,88.77,82.43453980133889,82.43453980133889,80.71405500851458,80.71405500851458,80.71405500851458,78.85933700052604\n2002-10-24,90.9,88.1,88.58,90.7,83.24108582120499,83.24108582120499,81.3012117080037,81.3012117080037,81.3012117080037,79.44137015049974\n2002-10-25,90.16,87.94,90.04,88.22,84.16015552266039,84.16015552266039,81.97312688844345,81.97312688844345,81.97312688844345,80.12888794146976\n2002-10-28,91.29,88.83,89.42,91.15,84.96893685994114,84.96893685994114,82.5980080062524,82.5980080062524,82.5980080062524,80.77515466498157\n2002-10-29,89.92,87.0,88.6,89.08,85.85388569954938,85.85388569954938,83.2933673657522,83.2933673657522,83.2933673657522,81.51119383843286\n2002-10-30,89.96,88.23,89.45,88.68,86.61494170161247,86.61494170161247,83.93309797649202,83.93309797649202,83.93309797649202,82.19571026974256\n2002-10-31,90.3,88.19,88.86,89.66,87.0,87.0,84.52165013837266,84.52165013837266,84.52165013837266,82.83231055086058\n2002-11-01,90.82,88.05,90.53,88.35,87.6006,87.6006,85.06311812730286,85.06311812730286,85.06311812730286,83.42434881230034\n2002-11-04,92.94,90.9,91.15,91.8,88.05,88.05,85.56126867711863,85.56126867711863,85.56126867711863,83.97494439543931\n2002-11-05,92.07,90.84,91.97,90.84,88.05,88.05,86.22535449617796,86.22535449617796,86.22535449617796,84.69214884380416\n2002-11-06,93.07,90.04,92.77,92.48,88.83239999999999,88.83239999999999,86.82967259152194,86.82967259152194,86.82967259152194,85.35197693629983\n2002-11-07,92.22,90.22,90.57,92.0,89.59516799999999,89.59516799999999,87.45370533236975,87.45370533236975,87.45370533236975,86.04659901203284\n2002-11-08,91.57,89.52,89.87,90.53,93.07,-93.07,88.01533479913277,88.01533479913277,88.01533479913277,86.67870510094988\n2002-11-11,90.03,87.8,88.05,89.52,92.999,-92.999,-93.07,-93.07,-93.07,87.2539216418644\n2002-11-12,89.91,88.36,88.75,88.66,92.79104,-92.79104,-92.91189999999999,-92.91189999999999,-92.91189999999999,87.7773686940966\n2002-11-13,89.9,87.45,88.68,88.32,92.59139839999999,-92.59139839999999,-92.75854299999999,-92.75854299999999,-92.75854299999999,-94.9314\n2002-11-14,91.0,89.19,90.87,90.07,92.28291449599999,-92.28291449599999,-92.49311585,-92.49311585,-92.49311585,-94.706958\n2002-11-15,91.55,89.91,91.38,90.0,91.99293962623999,-91.99293962623999,-92.24096005749999,-92.24096005749999,-92.24096005749999,-94.48924926\n2002-11-18,92.61,90.35,90.5,92.15,87.45,87.45,87.45,87.45,87.45,-94.27807178219999\n2002-11-19,91.1,89.76,90.23,90.02,87.5532,87.5532,87.5532,87.5532,87.5532,-94.07322962873398\n2002-11-20,92.07,89.74,91.94,89.98,87.654336,87.654336,87.654336,87.654336,87.654336,-93.87453273987197\n2002-11-21,96.58,92.43,93.9,92.6,87.75344928,87.75344928,87.75344928,87.75344928,87.75344928,85.70100000000001\n2002-11-22,94.27,93.0,93.62,93.48,88.1065113088,88.1065113088,88.0182458016,88.0182458016,88.0182458016,85.91858\n2002-11-25,94.26,92.77,93.8,93.43,88.44545085644799,88.44545085644799,88.275098427552,88.275098427552,88.275098427552,86.13180840000001\n2002-11-26,93.45,91.62,91.85,93.07,88.77083282219007,88.77083282219007,88.52424547472543,88.52424547472543,88.52424547472543,86.340772232\n2002-11-27,94.65,91.57,94.35,92.52,89.08319950930247,89.08319950930247,88.76591811048367,88.76591811048367,88.76591811048367,86.54555678736\n2002-11-29,94.8,93.71,93.98,94.8,89.38307152893037,89.38307152893037,89.00034056716916,89.00034056716916,89.00034056716916,86.7462456516128\n2002-12-02,96.05,93.22,93.89,95.47,89.67094866777316,89.67094866777316,89.22773035015409,89.22773035015409,89.22773035015409,86.94292073858054\n2002-12-03,93.4,92.35,92.55,93.25,89.94731072106224,89.94731072106224,89.44829843964946,89.44829843964946,89.44829843964946,87.13566232380893\n2002-12-04,93.14,91.43,92.37,91.81,90.21261829221974,90.21261829221974,89.66224948645998,89.66224948645998,89.66224948645998,87.32454907733275\n2002-12-05,92.95,91.1,91.16,92.7,90.46731356053095,90.46731356053095,89.86978200186618,89.86978200186618,89.86978200186618,87.5096580957861\n2002-12-06,92.17,89.98,91.81,90.12,96.58,-96.58,-96.58,-96.58,-96.58,87.69106493387036\n2002-12-09,91.46,89.62,89.69,91.07,96.448,-96.448,-96.382,-96.382,-96.382,87.86884363519296\n2002-12-10,91.1,89.76,90.92,90.02,96.17487999999999,-96.17487999999999,-96.04390000000001,-96.04390000000001,-96.04390000000001,88.0430667624891\n2002-12-11,91.62,90.16,91.04,90.42,95.9126848,-95.9126848,-95.722705,-95.722705,-95.722705,88.21380542723932\n2002-12-12,91.49,90.2,90.75,91.2,95.660977408,-95.660977408,-95.41756975,-95.41756975,-95.41756975,88.38112931869453\n2002-12-13,91.0,89.36,89.5,89.91,95.41933831168,-95.41933831168,-95.1276912625,-95.1276912625,-95.1276912625,88.54510673232065\n2002-12-16,91.68,89.66,91.68,89.82,95.05577801297919,-95.05577801297919,-94.72395287412499,-94.72395287412499,-94.72395287412499,88.70580459767423\n2002-12-17,91.74,90.74,90.93,91.37,94.71403133220043,-94.71403133220043,-94.34847617293624,-94.34847617293624,-94.34847617293624,88.86328850572075\n2002-12-18,90.9,84.66,89.64,90.34,94.3927894522684,-94.3927894522684,-93.9992828408307,-93.9992828408307,-93.9992828408307,-98.5116\n2002-12-19,90.7,88.6,89.08,89.35,93.61416629608694,-93.61416629608694,-93.15874738515593,-93.15874738515593,-93.15874738515593,-98.096052\n2002-12-20,90.02,89.1,89.69,89.2,92.89783299239998,-92.89783299239998,-92.3938601204919,-92.3938601204919,-92.3938601204919,-97.69297044\n2002-12-23,90.6,89.31,89.93,89.59,92.23880635300799,-92.23880635300799,-91.69781270964762,-91.69781270964762,-91.69781270964762,-97.30198132679999\n2002-12-24,90.0,89.25,89.33,89.61,91.63250184476735,-91.63250184476735,-91.06440956577933,-91.06440956577933,-91.06440956577933,-96.92272188699599\n2002-12-26,90.61,88.84,89.03,89.77,91.07470169718596,-91.07470169718596,84.66,84.66,84.66,-96.5548402303861\n2002-12-27,89.98,87.52,87.68,88.96,90.61,-90.61,84.779,84.779,84.779,-96.19799502347452\n2002-12-30,88.47,87.22,88.09,87.8,90.61,-90.61,84.89562,84.89562,84.89562,-95.85185517277029\n2002-12-31,88.43,87.08,88.18,87.99,90.134,-90.134,85.00990759999999,85.00990759999999,85.00990759999999,-95.51609951758718\n2003-01-02,91.19,88.54,91.13,88.85,84.66,84.66,85.121909448,85.121909448,85.121909448,-95.19041653205956\n2003-01-03,91.39,89.68,91.13,90.91,84.7906,84.7906,85.30395216456,85.30395216456,85.30395216456,-94.87450403609778\n2003-01-06,93.7,91.09,93.13,91.24,85.054576,85.054576,85.5473940779776,85.5473940779776,85.5473940779776,-94.56806891501485\n2003-01-07,93.37,92.2,92.56,92.9,85.57330144,85.57330144,85.95502437407872,85.95502437407872,85.95502437407872,-94.27082684756441\n2003-01-08,92.4,91.05,91.2,92.2,86.0609033536,86.0609033536,86.34227315537478,86.34227315537478,86.34227315537478,-93.98250204213747\n2003-01-09,93.18,91.09,93.0,91.82,86.51924915238399,86.51924915238399,86.71015949760604,86.71015949760604,86.71015949760604,-93.70282698087334\n2003-01-10,93.64,91.8,92.97,91.95,86.95009420324095,86.95009420324095,87.05965152272574,87.05965152272574,87.05965152272574,82.96679999999999\n2003-01-13,93.86,92.44,92.88,93.55,87.35508855104649,87.35508855104649,87.39166894658946,87.39166894658946,87.39166894658946,83.180264\n2003-01-14,93.83,92.2,93.44,92.69,87.87548146696277,87.87548146696277,87.77976880979409,87.77976880979409,87.77976880979409,83.50065608\n2003-01-15,93.57,91.51,92.12,93.54,88.35424294960575,88.35424294960575,88.14458268120644,88.14458268120644,88.14458268120644,83.8114363976\n2003-01-16,93.33,91.46,91.83,92.5,88.79470351363729,88.79470351363729,88.48750772033405,88.48750772033405,88.48750772033405,84.112893305672\n2003-01-17,92.3,90.15,90.48,90.99,89.1999272325463,89.1999272325463,88.809857257114,88.809857257114,88.809857257114,84.40530650650184\n2003-01-21,90.92,87.88,89.03,90.87,93.86,-93.86,-93.86,-93.86,-93.86,84.68894731130679\n2003-01-22,90.0,88.01,88.04,88.77,93.7404,-93.7404,-93.6806,-93.6806,-93.6806,84.96407889196759\n2003-01-23,89.43,87.95,89.06,88.75,93.62319199999999,-93.62319199999999,-93.506582,-93.506582,-93.506582,85.23095652520855\n2003-01-24,88.76,86.17,86.33,88.59,93.50832815999999,-93.50832815999999,-93.33778454,-93.33778454,-93.33778454,85.4898278294523\n2003-01-27,86.94,84.5,85.03,85.7,93.2147950336,-93.2147950336,-92.979395313,-92.979395313,-92.979395313,-95.7372\n2003-01-28,87.85,84.65,86.12,85.69,92.69190733158399,-92.69190733158399,-92.38583764108999,-92.38583764108999,-92.38583764108999,-95.400084\n2003-01-29,87.18,84.77,86.78,85.45,92.20039289168895,-92.20039289168895,-91.83382900621369,-91.83382900621369,-91.83382900621369,-95.07308148000001\n2003-01-30,86.88,84.63,84.8,86.79,91.73836931818761,-91.73836931818761,-91.32046097577873,-91.32046097577873,-91.32046097577873,-94.7558890356\n2003-01-31,86.22,84.15,85.84,84.15,91.30406715909635,-91.30406715909635,-90.84302870747422,-90.84302870747422,-90.84302870747422,-94.44821236453201\n2003-02-03,88.69,85.89,86.27,86.1,90.73174178636864,-90.73174178636864,-90.24065612380154,-90.24065612380154,-90.24065612380154,-93.93330174630542\n2003-02-04,85.44,84.3,85.14,85.31,90.20520244345916,-90.20520244345916,-89.6924970726594,-89.6924970726594,-89.6924970726594,-93.44413665899015\n2003-02-05,86.54,84.42,84.64,85.75,89.72078624798243,-89.72078624798243,-89.19367233612006,-89.19367233612006,-89.19367233612006,-92.97942982604064\n2003-02-06,85.22,83.65,84.17,84.39,89.27512334814384,-89.27512334814384,-88.73974182586926,-88.73974182586926,-88.73974182586926,-92.53795833473862\n2003-02-07,84.99,82.97,83.29,84.91,88.71261101332945,-88.71261101332945,-88.17987022502363,-88.17987022502363,-88.17987022502363,-91.91580125130692\n2003-02-10,84.13,82.65,83.94,83.47,88.02349769172992,-88.02349769172992,-87.50258709577056,-87.50258709577056,-87.50258709577056,-91.11067913868929\n2003-02-11,84.88,82.83,83.21,84.37,87.27120801488773,-87.27120801488773,-86.77469903140498,-86.77469903140498,-86.77469903140498,-90.18000443343347\n2003-02-12,83.62,82.22,82.22,83.16,86.62423889280345,-86.62423889280345,-86.15599417669424,-86.15599417669424,-86.15599417669424,-89.35170394575579\n2003-02-13,82.95,81.0,82.1,82.15,85.91956066995489,-85.91956066995489,-85.48687516665622,-85.48687516665622,-85.48687516665622,-88.42458243280754\n2003-02-14,83.91,81.83,83.88,82.37,85.034039749363,-85.034039749363,-84.63436888499153,-84.63436888499153,-84.63436888499153,-87.3108950678864\n2003-02-18,85.77,84.49,85.55,84.53,81.0,81.0,81.0,81.0,81.0,-86.36426080770345\n2003-02-19,85.47,83.9,84.93,85.32,81.0954,81.0954,81.0954,81.0954,81.0954,-85.77\n2003-02-20,85.42,80.5,84.09,85.22,85.77,-85.77,-85.77,-85.77,-85.77,-85.77\n2003-02-21,85.74,83.46,85.34,84.38,80.5,80.5,80.5,80.5,80.5,78.89\n2003-02-24,85.51,83.59,83.63,84.93,80.5,80.5,80.5,80.5,80.5,79.027\n2003-02-25,84.49,82.22,84.32,82.95,80.6048,80.6048,80.6048,80.6048,80.6048,79.16126\n2003-02-26,84.53,83.08,83.19,84.02,80.707504,80.707504,80.707504,80.707504,80.707504,79.2928348\n2003-02-27,85.5,82.99,84.17,83.7,80.80815392,80.80815392,80.80815392,80.80815392,80.80815392,79.421778104\n2003-02-28,85.23,83.45,84.62,84.47,80.9067908416,80.9067908416,80.9067908416,80.9067908416,80.9067908416,79.54814254192\n2003-03-03,85.78,83.72,83.93,85.26,81.003455024768,81.003455024768,81.003455024768,81.003455024768,81.003455024768,79.6719796910816\n2003-03-04,84.01,82.65,82.73,83.95,81.19451682377728,81.19451682377728,81.14675137402496,81.14675137402496,81.14675137402496,79.85522030034916\n2003-03-05,83.54,82.36,83.5,82.61,81.37793615082619,81.37793615082619,81.28574883280422,81.28574883280422,81.28574883280422,80.03296369133868\n2003-03-06,83.52,82.47,82.7,82.86,81.55401870479314,81.55401870479314,81.42057636782009,81.42057636782009,81.42057636782009,80.20537478059852\n2003-03-07,84.07,81.43,83.37,81.64,85.78,-85.78,-85.78,-85.78,-85.78,80.37261353718057\n2003-03-10,82.86,81.1,81.23,82.63,85.693,-85.693,-85.6495,-85.6495,-85.6495,80.53483513106515\n2003-03-11,82.08,80.52,80.55,81.49,85.50928,-85.50928,-85.422025,-85.422025,-85.422025,-87.4956\n2003-03-12,81.01,79.38,80.97,80.41,85.2099232,-85.2099232,-85.07888325,-85.07888325,-85.07888325,-87.286332\n2003-03-13,83.83,81.53,83.78,82.19,84.74352934400001,-84.74352934400001,-84.5659837575,-84.5659837575,-84.5659837575,-86.8910154\n2003-03-14,84.77,83.35,83.9,84.19,79.38,79.38,79.38,79.38,79.38,-86.51546463\n2003-03-17,86.95,83.22,86.83,83.46,79.4878,79.4878,79.4878,79.4878,79.4878,77.7924\n2003-03-18,87.32,86.1,87.19,87.15,79.786288,79.786288,79.711666,79.711666,79.711666,77.97555200000001\n2003-03-19,88.16,86.68,87.99,87.31,80.23831072,80.23831072,80.01599936,80.01599936,80.01599936,78.25588544\n2003-03-20,88.59,86.35,88.13,87.32,80.8720458624,80.8720458624,80.423199392,80.423199392,80.423199392,78.6520500224\n2003-03-21,89.88,87.79,89.74,88.79,81.64384127616,81.64384127616,80.91320742848,80.91320742848,80.91320742848,79.14894752128001\n2003-03-24,88.14,85.58,86.58,87.99,82.6321803230208,82.6321803230208,81.54088290848641,81.54088290848641,81.54088290848641,79.7928106700032\n2003-03-25,88.67,85.59,87.67,86.74,83.50191868425831,83.50191868425831,82.12462110489236,82.12462110489236,82.12462110489236,80.39804202980301\n2003-03-26,87.85,86.23,87.2,87.56,84.26728844214732,84.26728844214732,82.66749762754989,82.66749762754989,82.66749762754989,80.96695950801482\n2003-03-27,88.5,85.99,87.1,86.43,84.94081382908963,84.94081382908963,83.1723727936214,83.1723727936214,83.1723727936214,81.50174193753394\n2003-03-28,87.28,86.25,86.59,86.47,85.53351616959888,85.53351616959888,83.64190669806791,83.64190669806791,83.64190669806791,82.00443742128189\n2003-03-31,86.96,84.4,84.98,85.35,89.88,-89.88,84.07857322920316,84.07857322920316,84.07857322920316,82.47697117600498\n2003-04-01,86.85,84.91,86.07,85.26,89.7704,-89.7704,84.4,84.4,84.4,82.92115290544469\n2003-04-02,88.77,87.05,88.39,87.56,89.66299199999999,-89.66299199999999,84.4,84.4,84.4,83.33868373111801\n2003-04-03,88.99,87.8,87.88,88.84,89.55773215999999,-89.55773215999999,84.7836,84.7836,84.7836,83.73116270725093\n2003-04-04,88.59,87.57,88.12,88.43,89.45457751679999,-89.45457751679999,85.140348,85.140348,85.140348,84.10009294481587\n2003-04-07,90.92,88.19,88.2,90.34,84.4,84.4,85.47212364,85.47212364,85.47212364,84.44688736812692\n2003-04-08,88.89,86.2,88.11,88.3,84.5304,84.5304,85.90795374880001,85.90795374880001,85.90795374880001,84.90000525235804\n2003-04-09,89.81,86.77,86.86,88.36,84.658192,84.658192,86.2,86.2,86.2,85.32140488469298\n2003-04-10,88.9,85.71,87.45,87.07,84.78342816,84.78342816,-90.92,-90.92,-90.92,-92.7384\n2003-04-11,88.71,86.86,87.17,88.19,84.9061595968,84.9061595968,-90.7637,-90.7637,-90.7637,-92.527548\n2003-04-14,88.87,86.46,88.85,87.47,85.026436404864,85.026436404864,-90.612089,-90.612089,-90.612089,-92.32302156\n2003-04-15,89.47,88.39,89.42,88.86,85.14430767676672,85.14430767676672,-90.46502633,-90.46502633,-90.46502633,-92.1246309132\n2003-04-16,90.07,88.03,88.23,89.91,85.25982152323138,85.25982152323138,-90.3223755401,-90.3223755401,-90.3223755401,-91.932191985804\n2003-04-17,89.72,87.29,89.66,88.35,85.37302509276675,85.37302509276675,-90.184004273897,-90.184004273897,-90.184004273897,-91.74552622622987\n2003-04-21,90.16,89.06,89.5,89.86,85.48396459091141,85.48396459091141,85.71,85.71,85.71,-91.56446043944297\n2003-04-22,91.56,88.89,91.51,89.1,85.59268529909319,85.59268529909319,85.79899999999999,85.79899999999999,85.79899999999999,83.99579999999999\n2003-04-23,93.11,91.24,92.2,91.6,85.83137788712946,85.83137788712946,85.97183,85.97183,85.97183,84.14708399999999\n2003-04-24,92.08,90.18,91.42,91.53,86.26809521390169,86.26809521390169,86.2573568,86.2573568,86.2573568,84.41597148\n2003-04-25,91.47,90.02,90.15,91.3,86.67860950106758,86.67860950106758,86.53146252799999,86.53146252799999,86.53146252799999,84.6767923356\n2003-04-28,92.19,90.17,91.87,90.44,87.06449293100353,87.06449293100353,86.79460402688,86.79460402688,86.79460402688,84.929788565532\n2003-04-29,93.66,91.4,92.15,92.14,87.42722335514331,87.42722335514331,87.04721986580479,87.04721986580479,87.04721986580479,85.17519490856603\n2003-04-30,92.57,91.32,91.85,91.93,87.92584548673184,87.92584548673184,87.37785887251455,87.37785887251455,87.37785887251455,85.51458711222338\n2003-05-01,92.73,90.5,91.92,91.92,88.3845778477933,88.3845778477933,87.69196592888882,87.69196592888882,87.69196592888882,85.84040362773445\n2003-05-02,93.47,90.9,93.3,91.56,88.80661161996983,88.80661161996983,87.99036763244438,87.99036763244438,87.99036763244438,86.15318748262507\n2003-05-05,93.97,92.05,92.95,93.47,89.19488269037224,89.19488269037224,88.27384925082215,88.27384925082215,88.27384925082215,86.45345998332007\n2003-05-06,94.42,92.05,93.79,93.1,89.67239442133501,89.67239442133501,88.61561829577282,88.61561829577282,88.61561829577282,86.82928698415407\n2003-05-07,94.14,92.4,93.33,93.42,90.24210709077481,90.24210709077481,89.02192501506872,89.02192501506872,89.02192501506872,87.28472976510483\n2003-05-08,93.38,92.21,92.34,92.52,90.74345423988183,90.74345423988183,89.3997902640139,89.3997902640139,89.3997902640139,87.71284597919853\n2003-05-09,93.8,92.2,93.72,92.83,91.18463973109601,91.18463973109601,89.75120494553293,89.75120494553293,89.75120494553293,88.11527522044662\n2003-05-12,96.3,92.24,94.9,93.5,91.57288296336449,91.57288296336449,90.07802059934563,90.07802059934563,90.07802059934563,88.49355870721982\n2003-05-13,95.97,91.6,94.64,94.53,96.3,-96.3,90.57577895139798,90.57577895139798,90.57577895139798,89.04000959771443\n2003-05-14,95.24,92.24,94.36,95.1,96.3,-96.3,91.03371663528614,91.03371663528614,91.03371663528614,89.54820892587442\n2003-05-15,95.33,94.25,95.13,94.89,96.206,-96.206,91.45501930446325,91.45501930446325,91.45501930446325,90.0208343010632\n2003-05-16,95.45,94.05,94.86,94.89,96.11388000000001,-96.11388000000001,91.8426177601062,91.8426177601062,91.8426177601062,90.46037589998878\n2003-05-19,94.92,92.08,92.51,94.2,96.02360240000002,-96.02360240000002,-96.3,-96.3,-96.3,90.86914958698956\n2003-05-20,94.21,91.6,92.45,92.82,95.93513035200002,-95.93513035200002,-96.1734,-96.1734,-96.1734,91.24930911590029\n2003-05-21,92.92,91.91,92.78,92.11,95.84842774496002,-95.84842774496002,-95.94473,-95.94473,-95.94473,91.6\n2003-05-22,94.05,92.14,93.68,92.95,95.76345919006081,-95.76345919006081,-95.72749350000001,-95.72749350000001,-95.72749350000001,91.6\n2003-05-23,95.36,92.86,93.72,93.53,95.6801900062596,-95.6801900062596,-95.521118825,-95.521118825,-95.521118825,91.91\n2003-05-27,95.84,93.18,95.62,93.3,91.6,91.6,91.6,91.6,91.6,92.14\n2003-05-28,97.73,94.98,95.83,95.85,91.6848,91.6848,91.6848,91.6848,91.6848,92.4312\n2003-05-29,96.82,92.32,95.37,95.88,91.926608,91.926608,91.86615599999999,91.86615599999999,91.86615599999999,-99.6846\n2003-05-30,97.09,95.17,96.93,95.9,92.15874368,92.15874368,92.04207131999999,92.04207131999999,92.04207131999999,-99.463662\n2003-06-02,98.84,96.08,97.17,97.53,92.32,92.32,92.2127091804,92.2127091804,92.2127091804,-99.24935214\n2003-06-03,97.9,96.85,97.71,97.15,92.71119999999999,92.71119999999999,92.477800813184,92.477800813184,92.477800813184,-99.0414715758\n2003-06-04,99.35,94.72,99.14,97.66,93.07892799999999,93.07892799999999,92.73228878065665,92.73228878065665,92.73228878065665,90.47359999999999\n2003-06-05,99.59,98.14,99.56,98.58,93.58061375999999,93.58061375999999,93.0631743416238,93.0631743416238,93.0631743416238,90.65112799999999\n2003-06-06,101.4,99.13,99.22,100.44,94.18155238399999,94.18155238399999,93.45478388112637,93.45478388112637,93.45478388112637,90.91929415999999\n2003-06-09,99.92,97.77,98.11,98.78,95.04776609791999,95.04776609791999,94.01094900944753,94.01094900944753,94.01094900944753,91.33852239359999\n2003-06-10,99.83,97.72,99.04,98.46,95.81003416616959,95.81003416616959,94.5281825787862,94.5281825787862,94.5281825787862,91.74098149785598\n2003-06-11,101.19,98.28,100.33,99.16,96.48083006622923,96.48083006622923,95.00920979827117,95.00920979827117,95.00920979827117,92.12734223794175\n2003-06-12,101.4,99.62,100.52,100.75,97.07113045828173,97.07113045828173,95.45656511239218,95.45656511239218,95.45656511239218,92.49824854842407\n2003-06-13,100.75,98.95,99.44,100.6,97.59059480328793,97.59059480328793,95.87260555452472,95.87260555452472,95.87260555452472,92.85431860648711\n2003-06-16,101.66,99.8,101.66,99.96,98.04772342689338,98.04772342689338,96.25952316570799,96.25952316570799,96.25952316570799,93.19614586222762\n2003-06-17,102.18,100.73,101.68,102.05,98.55344214712831,98.55344214712831,96.69156131245136,96.69156131245136,96.69156131245136,93.61933856911624\n2003-06-18,102.14,101.0,101.54,101.29,99.13369140358778,99.13369140358778,97.18552079433073,97.18552079433073,97.18552079433073,94.13297825496926\n2003-06-19,101.73,99.84,100.02,101.64,99.62110077901373,99.62110077901373,97.63502392284096,97.63502392284096,97.63502392284096,94.6157995596711\n2003-06-20,100.5,99.5,99.75,100.39,102.18,-102.18,98.04407176978528,98.04407176978528,98.04407176978528,95.06965158609084\n2003-06-23,99.66,97.92,98.36,99.45,102.1264,-102.1264,-102.18,-102.18,-102.18,95.49627249092539\n2003-06-24,99.09,98.02,98.65,98.22,101.958144,-101.958144,-102.05220000000001,-102.05220000000001,-102.05220000000001,95.89729614146987\n2003-06-25,99.59,97.67,97.8,98.53,101.79661824,-101.79661824,-101.92823400000002,-101.92823400000002,-101.92823400000002,96.27425837298168\n2003-06-26,99.0,96.96,98.89,97.78,101.5490211456,-101.5490211456,-101.71532230000001,-101.71532230000001,-101.71532230000001,96.62860287060278\n2003-06-27,99.19,97.66,97.86,98.75,101.181899453952,-101.181899453952,-101.38244973900001,-101.38244973900001,-101.38244973900001,96.96\n2003-06-30,98.93,96.72,97.69,98.22,100.84414749763584,-100.84414749763584,-101.07287825727,-101.07287825727,-101.07287825727,-104.2236\n2003-07-01,98.85,96.43,98.56,97.25,100.43173274787226,-100.43173274787226,-100.68111921411571,-100.68111921411571,-100.68111921411571,-103.998492\n2003-07-02,99.68,98.57,99.63,98.77,99.9515248181276,-99.9515248181276,-100.21349610056298,-100.21349610056298,-100.21349610056298,-103.6200674\n2003-07-03,99.85,97.9,98.8,99.07,96.43,96.43,96.43,96.43,96.43,-103.26056403\n2003-07-07,100.9,99.61,100.75,99.65,96.4984,96.4984,96.4984,96.4984,96.4984,-102.9190358285\n2003-07-08,101.29,100.17,101.02,100.5,96.674464,96.674464,96.630448,96.630448,96.630448,-102.594584037075\n2003-07-09,101.4,100.03,100.55,100.92,96.95139616,96.95139616,96.81683008,96.81683008,96.81683008,-102.28635483522125\n2003-07-10,100.77,98.63,99.21,99.84,97.3072844672,97.3072844672,97.045988576,97.045988576,97.045988576,-101.99353709346019\n2003-07-11,100.45,99.39,100.14,99.39,97.634701709824,97.634701709824,97.2636891472,97.2636891472,97.2636891472,-101.71536023878718\n2003-07-14,101.9,99.61,100.72,101.2,97.93592557303808,97.93592557303808,97.47050468984,97.47050468984,97.47050468984,94.5014\n2003-07-15,101.91,99.95,100.38,101.38,98.33233301573426,98.33233301573426,97.7362744084496,97.7362744084496,97.7362744084496,94.649372\n2003-07-16,100.87,97.76,99.76,100.81,101.91,-101.91,-101.91,-101.91,-101.91,94.86719084\n2003-07-17,99.98,98.16,98.51,99.15,101.91,-101.91,-101.91,-101.91,-101.91,95.0784751148\n2003-07-18,99.98,98.46,99.58,99.02,101.827,-101.827,-101.7855,-101.7855,-101.7855,95.283420861356\n2003-07-21,99.49,97.85,98.24,99.45,101.74566,-101.74566,-101.664735,-101.664735,-101.664735,95.48221823551533\n2003-07-22,99.91,97.91,99.12,98.69,101.6659468,-101.6659468,-101.54759295,-101.54759295,-101.54759295,95.67505168844987\n2003-07-23,99.83,98.28,99.23,99.21,101.587827864,-101.587827864,-101.4339651615,-101.4339651615,-101.4339651615,95.86210013779638\n2003-07-24,100.34,98.37,98.5,99.99,101.51127130672,-101.51127130672,-101.323746206655,-101.323746206655,-101.323746206655,96.04353713366248\n2003-07-25,100.29,98.04,100.23,98.66,101.4362458805856,-101.4362458805856,-101.21683382045535,-101.21683382045535,-101.21683382045535,96.2195310196526\n2003-07-28,100.98,99.67,100.04,100.37,101.3627209629739,-101.3627209629739,-101.11312880584168,-101.11312880584168,-101.11312880584168,96.39024508906303\n2003-07-29,100.3,98.68,99.32,100.14,101.29066654371442,-101.29066654371442,-101.01253494166643,-101.01253494166643,-101.01253494166643,96.55583773639114\n2003-07-30,99.79,98.93,99.11,99.6,101.22005321284013,-101.22005321284013,-100.98,-100.98,-100.98,96.71646260429941\n2003-07-31,100.94,98.9,99.41,99.98,101.15085214858333,-101.15085214858333,97.76,97.76,97.76,96.87226872617043\n2003-08-01,99.68,98.24,98.38,99.19,101.08303510561166,-101.08303510561166,97.8236,97.8236,97.8236,97.02340066438532\n2003-08-04,99.71,97.0,98.72,98.31,101.01657440349942,-101.01657440349942,-100.94,-100.94,-100.94,-103.9482\n2003-08-05,98.85,96.84,96.85,98.41,100.85591142735944,-100.85591142735944,-100.8218,-100.8218,-100.8218,-103.739754\n2003-08-06,98.06,96.42,97.1,96.71,100.61495674171788,-100.61495674171788,-100.62271,-100.62271,-100.62271,-103.3947663\n2003-08-07,97.98,96.67,97.88,97.17,100.27936020238045,-100.27936020238045,-100.3285203,-100.3285203,-100.3285203,-102.906532659\n2003-08-08,98.55,97.76,98.22,98.32,99.97061138619001,-99.97061138619001,-100.054923879,-100.054923879,-100.054923879,-102.45247537287001\n2003-08-11,99.69,97.84,98.51,98.26,96.42,96.42,-99.80047920747,-99.80047920747,-99.80047920747,-102.03020209676912\n2003-08-12,99.56,98.42,99.54,98.71,96.4854,96.4854,-99.69,-99.69,-99.69,-101.63748794999528\n2003-08-13,99.85,98.53,98.89,99.82,96.549492,96.549492,96.42,96.42,96.42,-101.27226379349561\n2003-08-14,99.75,98.51,99.54,99.1,96.68151232,96.68151232,96.4886,96.4886,96.4886,-100.93260532795092\n2003-08-15,99.79,99.12,99.54,99.36,96.8082518272,96.8082518272,96.555828,96.555828,96.555828,-100.61672295499436\n2003-08-18,100.78,99.74,100.5,99.93,96.929921754112,96.929921754112,96.62171144,96.62171144,96.62171144,94.4916\n2003-08-19,100.94,99.6,100.82,100.69,97.16092644886528,97.16092644886528,96.74646009679999,96.74646009679999,96.74646009679999,94.617368\n2003-08-20,100.89,100.16,100.5,100.29,97.46325233295606,97.46325233295606,96.91420169292799,96.91420169292799,96.91420169292799,94.80704696\n2003-08-21,104.45,100.2,100.91,101.05,97.74139214631957,97.74139214631957,97.07523362521087,97.07523362521087,97.07523362521087,94.9910355512\n2003-08-22,102.0,99.74,99.77,101.75,98.41225293168762,98.41225293168762,97.44397194395033,97.44397194395033,97.44397194395033,95.369394129152\n2003-08-25,101.63,99.28,99.82,99.73,99.01602763851886,99.01602763851886,97.79427334675282,97.79427334675282,97.79427334675282,95.73261836398592\n2003-08-26,100.46,98.83,100.18,99.5,104.45,-104.45,98.12705967941518,98.12705967941518,98.12705967941518,96.08131362942649\n2003-08-27,100.36,99.57,100.24,100.05,104.33760000000001,-104.33760000000001,98.44320669544442,98.44320669544442,98.44320669544442,96.41606108424943\n2003-08-28,101.0,99.66,100.85,100.4,104.22744800000001,-104.22744800000001,98.7435463606722,98.7435463606722,98.7435463606722,96.73741864087945\n2003-08-29,101.46,100.0,101.4,100.61,104.11949904000001,-104.11949904000001,99.02886904263859,99.02886904263859,99.02886904263859,97.04592189524428\n2003-09-02,102.88,100.28,102.77,101.64,104.01370905920001,-104.01370905920001,99.29992559050666,99.29992559050666,99.29992559050666,97.3420850194345\n2003-09-03,103.7,101.25,103.19,103.03,103.910034878016,-103.910034878016,99.55742931098133,99.55742931098133,99.55742931098133,97.62640161865713\n2003-09-04,103.55,100.43,103.43,103.1,103.80843418045569,-103.80843418045569,99.80205784543227,99.80205784543227,99.80205784543227,97.89934555391085\n2003-09-05,120.52,101.53,102.67,102.94,98.83,98.83,100.03445495316066,100.03445495316066,100.03445495316066,98.16137173175441\n2003-09-08,103.88,102.73,103.8,103.04,99.2638,99.2638,100.43,100.43,100.43,99.2793031451667\n2003-09-09,103.46,102.68,102.93,103.37,99.688924,99.688924,101.53,101.53,101.53,100.34133798790836\n2003-09-10,103.6,101.55,101.69,102.54,100.10554552,100.10554552,-120.52,-120.52,-120.52,101.35027108851294\n2003-09-11,102.85,101.42,102.25,102.1,100.51383460960001,100.51383460960001,-119.95089999999999,-119.95089999999999,-119.95089999999999,-122.93039999999999\n2003-09-12,102.64,100.46,102.52,101.91,120.52,-120.52,-119.02435499999999,-119.02435499999999,-119.02435499999999,-122.28508799999999\n2003-09-15,102.63,101.08,102.12,102.52,120.1188,-120.1188,-117.72485014999998,-117.72485014999998,-117.72485014999998,-121.19383359999999\n2003-09-16,103.64,102.17,103.55,102.23,119.725624,-119.725624,-116.51631063949998,-116.51631063949998,-116.51631063949998,-120.15714191999999\n2003-09-17,103.79,102.58,103.22,103.48,119.34031152,-119.34031152,-115.39236889473497,-115.39236889473497,-115.39236889473497,-119.17228482399999\n2003-09-18,105.5,103.17,104.59,103.4,118.9627052896,-118.9627052896,-114.34710307210352,-114.34710307210352,-114.34710307210352,-118.23667058279999\n2003-09-19,104.6,103.4,103.86,104.27,118.592651183808,-118.592651183808,-113.37500585705628,-113.37500585705628,-113.37500585705628,-117.34783705365999\n2003-09-22,103.87,100.29,102.49,102.85,118.22999816013184,-118.22999816013184,-112.47095544706234,-112.47095544706234,-112.47095544706234,-116.50344520097698\n2003-09-23,103.29,102.36,103.09,102.59,117.51239823372657,-117.51239823372657,-111.37466945682672,-111.37466945682672,-111.37466945682672,-115.36850403690859\n2003-09-24,103.22,101.07,101.2,103.12,116.82350230437751,-116.82350230437751,-110.37704920571232,-110.37704920571232,-110.37704920571232,-114.31300875432498\n2003-09-25,101.88,100.27,100.59,101.41,116.16216221220242,-116.16216221220242,-109.46921477719822,-109.46921477719822,-109.46921477719822,-113.33139814152223\n2003-09-26,100.66,99.84,100.02,100.44,115.20863247947027,-115.20863247947027,-108.45730115170642,-108.45730115170642,-108.45730115170642,-112.15587230878523\n2003-09-29,100.99,98.75,100.87,100.3,113.97914188111265,-113.97914188111265,-107.33705200198459,-107.33705200198459,-107.33705200198459,-110.80112635481886\n2003-09-30,100.76,95.91,99.86,100.53,112.45622769300138,-112.45622769300138,-106.0489942016869,-106.0489942016869,-106.0489942016869,-109.23447992869241\n2003-10-01,102.12,100.01,102.0,100.24,110.47068036984122,-110.47068036984122,-104.32536518740012,-104.32536518740012,-104.32536518740012,-107.23580793938855\n2003-10-02,102.85,101.63,102.32,101.93,108.72339872546027,-108.72339872546027,-102.89475310554211,-102.89475310554211,-102.89475310554211,-105.53693674848027\n2003-10-03,104.28,102.32,103.26,103.67,107.18579087840504,-107.18579087840504,95.91,95.91,95.91,93.9918\n2003-10-06,103.99,103.2,103.72,103.48,105.83269597299643,-105.83269597299643,96.0774,96.0774,96.0774,94.197564\n2003-10-07,104.26,102.91,104.19,103.26,104.64197245623686,-104.64197245623686,96.241452,96.241452,96.241452,94.39921272\n2003-10-08,104.39,102.6,103.71,104.33,95.91,95.91,96.40222295999999,96.40222295999999,96.40222295999999,94.5968284656\n2003-10-09,105.22,103.65,104.17,104.88,96.0796,96.0796,96.64185627119998,96.64185627119998,96.64185627119998,94.890623611632\n2003-10-10,104.48,103.91,104.2,104.27,96.445216,96.445216,96.98498202035198,96.98498202035198,96.98498202035198,95.30379866716672\n2003-10-13,105.29,101.7,104.86,104.72,96.79620736,96.79620736,97.3143827395379,97.3143827395379,97.3143827395379,95.70044672048004\n2003-10-14,105.36,103.67,105.29,104.8,97.3058349184,97.3058349184,97.71316360256101,97.71316360256101,97.71316360256101,96.17992438445604\n2003-10-15,105.89,104.64,105.02,105.86,97.950168124928,97.950168124928,98.17197378640735,98.17197378640735,98.17197378640735,96.73072892138867\n2003-10-16,105.98,104.65,105.33,104.68,98.74415131243519,98.74415131243519,98.71223562135883,98.71223562135883,98.71223562135883,97.37187789689146\n2003-10-17,105.91,103.98,104.23,105.47,99.61245315494297,99.61245315494297,99.29365677165012,99.29365677165012,99.29365677165012,98.06052766514014\n2003-10-20,104.83,103.94,104.78,104.45,100.37655877634981,100.37655877634981,99.82856422991811,99.82856422991811,99.82856422991811,98.69408545192893\n2003-10-21,105.28,104.32,104.96,104.87,101.04897172318783,101.04897172318783,100.32067909152467,100.32067909152467,100.32067909152467,99.27695861577462\n2003-10-22,104.54,102.7,103.4,104.03,101.6406951164053,101.6406951164053,100.77342476420269,100.77342476420269,100.77342476420269,99.81320192651265\n2003-10-23,103.95,102.68,103.74,102.89,102.16141170243667,102.16141170243667,101.18995078306648,101.18995078306648,101.18995078306648,100.30654577239163\n2003-10-24,103.76,102.18,103.28,102.83,105.98,-105.98,101.57315472042116,101.57315472042116,101.57315472042116,100.7604221106003\n2003-10-27,104.44,103.27,103.44,103.74,105.90400000000001,-105.90400000000001,101.92570234278746,101.92570234278746,101.92570234278746,101.17798834175228\n2003-10-28,105.07,103.82,105.02,103.98,105.82952000000002,-105.82952000000002,102.18,102.18,102.18,101.5621492744121\n2003-10-29,106.08,103.73,105.25,104.77,102.18,102.18,102.48400000000001,102.48400000000001,102.48400000000001,101.91557733245914\n2003-10-30,105.97,104.24,105.09,105.79,102.25800000000001,102.25800000000001,102.80764,102.80764,102.80764,102.29037537253781\n2003-10-31,105.74,105.22,105.42,105.4,102.33444000000001,102.33444000000001,103.10215240000001,103.10215240000001,103.10215240000001,102.63144158900941\n2003-11-03,106.61,104.2,106.32,105.75,102.40935120000002,102.40935120000002,103.370158684,103.370158684,103.370158684,102.94181184599857\n2003-11-04,106.27,103.84,105.78,105.98,102.57737715200001,102.57737715200001,103.6941428156,103.6941428156,103.6941428156,103.30863066139871\n2003-11-05,105.97,104.9,105.63,105.52,102.73868206592002,102.73868206592002,103.84,103.84,103.84,103.63876759525884\n2003-11-06,106.4,105.1,106.26,105.64,102.89353478328322,102.89353478328322,103.84,103.84,103.84,103.84\n2003-11-07,106.72,105.65,105.81,106.64,103.04219339195188,103.04219339195188,104.117,104.117,104.117,104.117\n2003-11-10,106.75,105.01,105.18,105.73,103.26286178843478,103.26286178843478,104.40333,104.40333,104.40333,104.40333\n2003-11-11,105.34,104.8,105.08,105.08,103.54183284535999,103.54183284535999,104.6849304,104.6849304,104.6849304,104.6849304\n2003-11-12,106.47,105.16,106.38,105.21,103.7984862177312,103.7984862177312,104.8,104.8,104.8,104.8\n2003-11-13,106.54,105.78,106.35,106.01,104.0346073203127,104.0346073203127,104.8,104.8,104.8,104.8\n2003-11-14,106.95,102.56,105.54,106.4,106.95,-106.95,-106.95,-106.95,-106.95,-109.089\n2003-11-17,105.51,104.04,104.86,104.91,106.95,-106.95,-106.95,-106.95,-106.95,-108.89313\n2003-11-18,105.46,103.9,103.91,105.24,106.95,-106.95,-106.95,-106.95,-106.95,-108.7031361\n2003-11-19,105.53,103.92,104.78,104.03,106.8622,-106.8622,-106.81830000000001,-106.81830000000001,-106.81830000000001,-108.518842017\n2003-11-20,105.63,103.8,103.9,104.0,106.776156,-106.776156,-106.69055100000001,-106.69055100000001,-106.69055100000001,-108.34007675648999\n2003-11-21,104.91,102.65,104.04,104.24,106.69183288,-106.69183288,-106.56663447000001,-106.56663447000001,-106.56663447000001,-108.1666744537953\n2003-11-24,105.77,104.68,105.72,104.68,106.6091962224,-106.6091962224,-106.44643543590001,-106.44643543590001,-106.44643543590001,-107.99847422018144\n2003-11-25,106.42,104.06,106.01,105.73,106.528212297952,-106.528212297952,102.56,102.56,102.56,-107.835319993576\n2003-11-26,106.45,104.4,106.4,106.42,102.56,102.56,102.6372,102.6372,102.6372,-107.67706039376871\n2003-11-28,106.66,106.2,106.54,106.28,102.6378,102.6378,102.75158400000001,102.75158400000001,102.75158400000001,-107.52354858195565\n2003-12-01,107.68,100.35,107.57,106.85,107.68,-107.68,-107.68,-107.68,-107.68,98.34299999999999\n2003-12-02,107.77,107.07,107.27,107.38,100.35,100.35,100.35,100.35,100.35,98.52973999999999\n2003-12-03,108.08,107.08,107.11,107.65,100.35,100.35,100.35,100.35,100.35,98.80694779999999\n2003-12-04,107.72,106.94,107.68,107.17,100.6592,100.6592,100.58189999999999,100.58189999999999,100.58189999999999,99.17786988799999\n2003-12-05,107.8,100.06,106.81,107.15,108.08,-108.08,-108.08,-108.08,-108.08,99.53395509247999\n2003-12-08,107.64,106.68,107.52,106.74,107.9196,-107.9196,-107.8394,-107.8394,-107.8394,99.87579688878078\n2003-12-09,107.93,105.52,106.62,107.9,100.06,100.06,100.06,100.06,100.06,100.06\n2003-12-10,106.98,100.7,106.54,106.77,100.2174,100.2174,100.2174,100.2174,100.2174,100.38080000000001\n2003-12-11,108.1,106.67,107.84,106.7,100.371652,100.371652,100.371652,100.371652,100.371652,100.68876800000001\n2003-12-12,108.7,106.65,108.13,107.97,100.68078591999999,100.68078591999999,100.60350244,100.60350244,100.60350244,100.7\n2003-12-15,109.45,107.48,107.52,109.17,101.1619387648,101.1619387648,100.9273623424,100.9273623424,100.9273623424,101.18\n2003-12-16,108.5,100.24,108.17,107.68,109.45,-109.45,-109.45,-109.45,-109.45,-111.63900000000001\n2003-12-17,108.38,107.8,108.34,108.06,109.45,-109.45,-109.45,-109.45,-109.45,-111.29703\n2003-12-18,109.72,108.39,109.6,108.55,100.24,100.24,100.24,100.24,100.24,-110.9653191\n2003-12-19,109.7,108.58,109.04,109.3,100.4296,100.4296,100.4296,100.4296,100.4296,-110.64355952700001\n2003-12-22,109.47,108.65,109.46,108.79,100.61540799999999,100.61540799999999,100.61540799999999,100.61540799999999,100.61540799999999,-110.33145274119\n2003-12-23,109.95,108.42,109.79,109.48,100.79749983999999,100.79749983999999,100.79749983999999,100.79749983999999,100.79749983999999,-110.0287091589543\n2003-12-24,109.88,109.43,109.58,109.52,101.16359984639999,101.16359984639999,101.07207484479999,101.07207484479999,101.07207484479999,-109.95\n2003-12-26,110.08,109.63,109.67,109.71,101.515055852544,101.515055852544,101.33841259945599,101.33841259945599,101.33841259945599,98.23519999999999\n2003-12-29,111.17,109.0,111.15,110.1,102.02895250139136,102.02895250139136,101.68807609547775,101.68807609547775,101.68807609547775,98.472096\n2003-12-30,111.27,110.15,111.17,111.09,102.76023630128005,102.76023630128005,102.16217229070386,102.16217229070386,102.16217229070386,98.85303311999999\n2003-12-31,111.52,110.84,111.15,111.23,103.61121267115205,103.61121267115205,102.70864195326163,102.70864195326163,102.70864195326163,99.3497117952\n2004-01-02,119.91,110.73,111.0,111.74,104.5602671506138,104.5602671506138,103.32543701653331,103.32543701653331,103.32543701653331,99.95822620544\n2004-01-05,112.45,111.17,112.37,111.69,106.70922974952786,106.70922974952786,104.65220205521065,104.65220205521065,104.65220205521065,101.1553326331136\n2004-01-06,112.73,111.23,112.63,112.18,108.55733758459397,108.55733758459397,105.8728258907938,105.8728258907938,105.8728258907938,102.28061267512679\n2004-01-07,112.92,111.89,112.9,112.39,110.1467103227508,110.1467103227508,106.9957998195303,106.9957998195303,106.9957998195303,103.33837591461918\n2004-01-08,113.41,112.19,113.32,113.26,111.23,111.23,108.02893583396788,108.02893583396788,108.02893583396788,104.33267335974203\n2004-01-09,113.98,112.19,112.51,112.82,111.89,111.89,108.97942096725045,108.97942096725045,108.97942096725045,105.2673129581575\n2004-01-12,113.12,112.36,113.11,112.55,112.19,112.19,109.85386728987041,109.85386728987041,109.85386728987041,106.14587418066806\n2004-01-13,113.23,111.13,112.47,113.09,119.91,-119.91,110.65835790668078,110.65835790668078,110.65835790668078,106.97172172982798\n2004-01-14,113.42,112.67,113.31,112.76,119.7344,-119.7344,111.13,111.13,111.13,107.7480184260383\n2004-01-15,114.06,112.58,113.53,113.57,119.56231199999999,-119.56231199999999,111.13,111.13,111.13,108.477737320476\n2004-01-16,114.31,113.08,114.25,114.04,119.39366575999999,-119.39366575999999,111.83239999999999,111.83239999999999,111.83239999999999,109.16367308124744\n2004-01-20,114.65,113.82,114.21,114.53,119.2283924448,-119.2283924448,112.478608,112.478608,112.478608,109.8084526963726\n2004-01-21,115.3,113.72,115.06,114.13,119.066424595904,-119.066424595904,113.07311935999999,113.07311935999999,113.07311935999999,110.41454553459025\n2004-01-22,115.38,114.58,114.73,115.14,118.90769610398591,-118.90769610398591,113.6200698112,113.6200698112,113.6200698112,110.98427280251484\n2004-01-23,115.37,113.95,114.36,115.0,118.7521421819062,-118.7521421819062,113.72,113.72,113.72,111.51981643436395\n2004-01-26,115.91,114.39,115.8,114.39,118.59969933826807,-118.59969933826807,113.95,113.95,113.95,112.02322744830211\n2004-01-27,116.5,114.7,114.7,115.75,118.4503053515027,-118.4503053515027,113.95,113.95,113.95,112.49643380140398\n2004-01-28,115.37,112.94,113.23,114.98,118.30389924447265,-118.30389924447265,-119.91,-119.91,-119.91,-122.3082\n2004-01-29,113.85,112.56,113.75,113.56,118.16042125958319,-118.16042125958319,-119.70089999999999,-119.70089999999999,-119.70089999999999,-122.027154\n2004-01-30,115.29,113.09,113.44,113.52,118.01981283439153,-118.01981283439153,-119.34385499999999,-119.34385499999999,-119.34385499999999,-121.5537963\n2004-02-02,116.36,113.12,113.83,113.7,117.8820165777037,-117.8820165777037,-119.00466225,-119.00466225,-119.00466225,-121.104106485\n2004-02-03,114.97,113.44,113.95,113.74,117.74697624614961,-117.74697624614961,-118.6824291375,-118.6824291375,-118.6824291375,-120.67690116075\n2004-02-04,113.94,112.79,113.03,113.19,117.61463672122662,-117.61463672122662,-118.37630768062499,-118.37630768062499,-118.37630768062499,-120.2710561027125\n2004-02-05,113.54,112.78,113.26,113.17,117.48494398680208,-117.48494398680208,-118.08549229659374,-118.08549229659374,-118.08549229659374,-119.88550329757688\n2004-02-06,114.69,113.2,114.66,113.42,117.35784510706604,-117.35784510706604,-117.80921768176405,-117.80921768176405,-117.80921768176405,-119.51922813269803\n2004-02-09,114.87,114.29,114.34,114.67,117.23328820492472,-117.23328820492472,-117.54675679767585,-117.54675679767585,-117.54675679767585,-119.17126672606312\n2004-02-10,115.14,114.26,114.9,114.28,117.11122244082623,-117.11122244082623,-117.29741895779206,-117.29741895779206,-117.29741895779206,-118.84070338975997\n2004-02-11,116.39,105.01,116.19,114.85,116.9915979920097,-116.9915979920097,-117.06054800990246,-117.06054800990246,-117.06054800990246,-118.52666822027197\n2004-02-12,116.74,114.64,115.67,115.97,105.01,105.01,105.01,105.01,105.01,-117.58050144485293\n2004-02-13,116.2,114.75,115.12,115.82,105.01,105.01,105.01,105.01,105.01,-116.74\n2004-02-17,116.43,115.77,116.14,115.85,105.2446,105.2446,105.2446,105.2446,105.2446,-116.74\n2004-02-18,116.6,115.35,115.66,116.2,105.474508,105.474508,105.474508,105.474508,105.474508,102.9098\n2004-02-19,116.39,115.0,115.22,116.33,105.69981784,105.69981784,105.69981784,105.69981784,105.69981784,103.183604\n2004-02-20,115.56,114.32,115.0,115.45,105.9206214832,105.9206214832,105.9206214832,105.9206214832,105.9206214832,103.45193192\n2004-02-23,115.61,114.17,114.55,115.22,106.13700905353599,106.13700905353599,106.13700905353599,106.13700905353599,106.13700905353599,103.71489328160001\n2004-02-24,114.99,113.03,114.45,114.27,106.34906887246527,106.34906887246527,106.34906887246527,106.34906887246527,106.34906887246527,103.97259541596802\n2004-02-25,115.06,114.32,114.91,114.46,106.55688749501596,106.55688749501596,106.55688749501596,106.55688749501596,106.55688749501596,104.22514350764865\n2004-02-26,115.29,114.34,115.04,114.61,106.76054974511564,106.76054974511564,106.76054974511564,106.76054974511564,106.76054974511564,104.47264063749569\n2004-02-27,116.08,114.55,115.08,115.19,106.96013875021333,106.96013875021333,106.96013875021333,106.96013875021333,106.96013875021333,104.71518782474577\n2004-03-01,116.34,114.44,116.07,115.43,107.15573597520907,107.15573597520907,107.15573597520907,107.15573597520907,107.15573597520907,104.95288406825085\n2004-03-02,116.97,115.19,115.49,115.94,107.34742125570489,107.34742125570489,107.34742125570489,107.34742125570489,107.34742125570489,105.18582638688584\n2004-03-03,116.4,114.25,115.7,115.25,107.73232440547669,107.73232440547669,107.63609861803374,107.63609861803374,107.63609861803374,105.53935159527926\n2004-03-04,116.1,115.04,116.05,115.72,108.10183142925762,108.10183142925762,107.91611565949273,107.91611565949273,107.91611565949273,105.88227104742089\n2004-03-05,116.95,115.08,116.29,115.42,108.45655817208731,108.45655817208731,108.18773218970794,108.18773218970794,108.18773218970794,106.21490291599827\n2004-03-08,116.62,115.22,115.27,116.34,108.79709584520381,108.79709584520381,108.4512002240167,108.4512002240167,108.4512002240167,106.53755582851832\n2004-03-09,116.65,104.97,114.66,115.1,116.97,-116.97,-116.97,-116.97,-116.97,-119.3094\n2004-03-10,115.62,111.45,112.98,114.72,116.73,-116.73,-116.65,-116.65,-116.65,-118.879218\n2004-03-11,115.65,111.15,111.35,112.39,116.65,-116.65,-116.65,-116.65,-116.65,-118.46194145999999\n2004-03-12,112.7,111.58,112.69,111.73,116.41640000000001,-116.41640000000001,-116.29960000000001,-116.29960000000001,-116.29960000000001,-118.05718321619999\n2004-03-15,112.69,110.9,111.03,112.26,116.18747200000001,-116.18747200000001,-115.95971200000001,-115.95971200000001,-115.95971200000001,-117.66456771971399\n2004-03-16,114.93,110.84,111.73,111.78,115.96312256000002,-115.96312256000002,-115.63002064000001,-115.63002064000001,-115.63002064000001,-117.28373068812256\n2004-03-17,113.26,111.56,113.0,112.2,115.74326010880002,-115.74326010880002,-115.31022002080002,-115.31022002080002,-115.31022002080002,-116.91431876747889\n2004-03-18,113.94,111.93,112.91,112.67,115.52779490662401,-115.52779490662401,-115.00001342017602,-115.00001342017602,-115.00001342017602,-116.55598920445452\n2004-03-19,113.33,110.7,111.29,112.41,115.31663900849153,-115.31663900849153,-114.69911301757074,-114.69911301757074,-114.69911301757074,-116.20840952832089\n2004-03-22,110.57,105.35,109.74,110.54,115.1097062283217,-115.1097062283217,-114.40723962704362,-114.40723962704362,-114.40723962704362,-115.87125724247126\n2004-03-23,110.93,109.36,109.65,110.25,114.90691210375526,-114.90691210375526,-114.12412243823232,-114.12412243823232,-114.12412243823232,-115.54421952519712\n2004-03-24,110.47,108.85,109.41,109.62,114.70817386168015,-114.70817386168015,-113.84949876508534,-113.84949876508534,-113.84949876508534,-115.2269929394412\n2004-03-25,111.3,109.79,111.11,110.08,114.51341038444654,-114.51341038444654,-113.58311380213279,-113.58311380213279,-113.58311380213279,-114.91928315125797\n2004-03-26,111.79,110.8,111.17,110.96,114.32254217675761,-114.32254217675761,-113.3247203880688,-113.3247203880688,-113.3247203880688,-114.62080465672024\n2004-03-29,114.5,111.58,112.49,111.63,104.97,104.97,104.97,104.97,104.97,102.8706\n2004-03-30,113.07,112.22,112.97,112.3,105.1606,105.1606,105.1606,105.1606,105.1606,103.103188\n2004-03-31,113.4,111.6,112.88,112.99,105.347388,105.347388,105.347388,105.347388,105.347388,103.33112424000001\n2004-04-01,118.18,113.05,113.49,113.07,105.53044023999999,105.53044023999999,105.53044023999999,105.53044023999999,105.53044023999999,103.55450175520001\n2004-04-02,115.55,112.01,114.44,114.81,106.0364226304,106.0364226304,105.90992703279998,105.90992703279998,105.90992703279998,103.993266702544\n2004-04-05,115.79,114.44,115.33,114.46,106.522165725184,106.522165725184,106.27802922181598,106.27802922181598,106.27802922181598,104.41886870146769\n2004-04-06,115.18,114.1,115.08,114.83,106.98847909617663,106.98847909617663,106.6350883451615,106.6350883451615,106.6350883451615,104.83170264042366\n2004-04-07,114.98,114.11,114.49,114.94,107.43613993232957,107.43613993232957,106.98143569480666,106.98143569480666,106.98143569480666,105.23215156121094\n2004-04-08,115.41,113.74,114.23,115.41,107.86589433503639,107.86589433503639,107.31739262396246,107.31739262396246,107.31739262396246,105.6205870143746\n2004-04-12,115.08,114.5,114.88,114.58,108.27845856163493,108.27845856163493,107.64327084524359,107.64327084524359,107.64327084524359,105.99736940394337\n2004-04-13,115.3,113.07,113.31,115.26,108.67452021916954,108.67452021916954,107.95937271988629,107.95937271988629,107.95937271988629,106.36284832182507\n2004-04-14,114.32,112.55,113.19,112.61,109.05473941040276,109.05473941040276,108.2659915382897,108.2659915382897,108.2659915382897,106.71736287217031\n2004-04-15,113.78,112.03,113.17,113.45,109.41974983398666,109.41974983398666,108.56341179214101,108.56341179214101,108.56341179214101,107.0612419860052\n2004-04-16,114.05,112.98,113.72,113.43,109.77015984062719,109.77015984062719,108.85190943837678,108.85190943837678,108.85190943837678,107.39480472642505\n2004-04-19,116.63,113.27,113.89,113.55,110.1065534470021,110.1065534470021,109.13175215522547,109.13175215522547,109.13175215522547,107.7183605846323\n2004-04-20,114.32,112.11,112.14,114.11,110.42949130912201,110.42949130912201,109.4031995905687,109.4031995905687,109.4031995905687,108.03220976709332\n2004-04-21,112.95,111.87,112.81,112.2,110.73951165675713,110.73951165675713,109.66650360285165,109.66650360285165,109.66650360285165,108.33664347408052\n2004-04-22,114.67,112.24,114.44,112.48,111.03713119048685,111.03713119048685,109.9219084947661,109.9219084947661,109.9219084947661,108.6319441698581\n2004-04-23,114.61,113.34,114.44,114.42,111.32284594286737,111.32284594286737,110.16965123992311,110.16965123992311,110.16965123992311,108.91838584476235\n2004-04-26,114.94,113.6,113.91,114.5,111.59713210515268,111.59713210515268,110.40996170272543,110.40996170272543,110.40996170272543,109.19623426941948\n2004-04-27,115.12,112.52,114.22,114.23,111.86044682094658,111.86044682094658,110.64306285164366,110.64306285164366,110.64306285164366,109.4657472413369\n2004-04-28,114.33,112.5,112.58,113.88,112.11322894810871,112.11322894810871,110.86917096609436,110.86917096609436,110.86917096609436,109.72717482409679\n2004-04-29,113.5,111.16,111.84,112.72,118.18,-118.18,111.08849583711152,111.08849583711152,111.08849583711152,109.9807595793739\n2004-04-30,112.38,111.1,111.13,112.17,118.03960000000001,-118.03960000000001,-118.18,-118.18,-118.18,110.22673679199268\n2004-05-03,114.7,111.14,112.14,111.39,117.762016,-117.762016,-117.9676,-117.9676,-117.9676,110.4653346882329\n2004-05-04,113.26,111.66,112.36,112.25,117.49553536,-117.49553536,-117.761572,-117.761572,-117.761572,110.69677464758591\n2004-05-05,112.96,112.16,112.58,112.42,117.2397139456,-117.2397139456,-117.56172484,-117.56172484,-117.56172484,110.92127140815833\n2004-05-06,112.99,111.0,111.85,112.02,116.994125387776,-116.994125387776,-117.36787309479999,-117.36787309479999,-117.36787309479999,-120.54360000000001\n2004-05-07,112.5,101.77,110.3,111.22,116.63447786450944,-116.63447786450944,-117.04947944006,-117.04947944006,-117.04947944006,-120.257292\n2004-05-10,110.3,108.36,109.13,109.44,115.44531963534868,-115.44531963534868,-115.9799158792558,-115.9799158792558,-115.9799158792558,-119.3329274\n2004-05-11,110.05,109.17,110.01,109.46,114.35129406452079,-114.35129406452079,-114.9852217677079,-114.9852217677079,-114.9852217677079,-118.45478103\n2004-05-12,110.3,108.06,110.3,109.59,113.34479053935912,-113.34479053935912,-114.06015624396835,-114.06015624396835,-114.06015624396835,-117.6205419785\n2004-05-13,111.08,109.44,110.15,109.76,112.41880729621039,-112.41880729621039,-113.19984530689057,-113.19984530689057,-113.19984530689057,-116.828014879575\n2004-05-14,111.54,109.27,110.02,109.96,111.56690271251355,-111.56690271251355,-112.39975613540823,-112.39975613540823,-112.39975613540823,-116.07511413559624\n2004-05-17,109.89,106.29,108.85,108.89,111.54,-111.54,-111.65567320592965,-111.65567320592965,-111.65567320592965,-115.35985842881642\n2004-05-18,109.94,109.33,109.7,109.51,111.54,-111.54,-111.54,-111.54,-111.54,-114.6803655073756\n2004-05-19,111.18,109.3,109.41,110.5,101.77,101.77,101.77,101.77,101.77,-114.03484723200681\n2004-05-20,109.87,109.04,109.52,109.45,101.95819999999999,101.95819999999999,101.95819999999999,101.95819999999999,101.95819999999999,-113.42160487040647\n2004-05-21,110.55,100.32,109.93,109.97,111.18,-111.18,-111.18,-111.18,-111.18,-112.83902462688614\n2004-05-24,110.97,108.98,110.09,110.52,100.32,100.32,100.32,100.32,100.32,-111.96269290300411\n2004-05-25,111.98,109.6,111.92,109.92,100.32,100.32,100.32,100.32,100.32,98.3136\n2004-05-26,113.0,110.9,112.09,111.66,100.7864,100.7864,100.6698,100.6698,100.6698,98.586928\n2004-05-27,113.03,112.06,112.72,112.53,101.519216,101.519216,101.16300799999999,101.16300799999999,101.16300799999999,99.01932016\n2004-05-28,112.9,112.08,112.71,112.74,102.44007872,102.44007872,101.75635759999999,101.75635759999999,101.75635759999999,99.57974735360001\n2004-06-01,113.63,111.87,112.68,112.5,103.28727242240001,103.28727242240001,102.32003971999998,102.32003971999998,102.32003971999998,100.11775745945602\n2004-06-02,113.73,112.46,113.12,113.03,104.32154518016,104.32154518016,102.99863733679999,102.99863733679999,102.99863733679999,100.79336958648321\n2004-06-03,113.19,112.04,112.25,112.79,105.4505597585408,105.4505597585408,103.74983272322399,103.74983272322399,103.74983272322399,101.56956741129422\n2004-06-04,113.58,112.67,112.9,113.0,106.44409258751591,106.44409258751591,104.44844443259831,104.44844443259831,104.44844443259831,102.29919336661656\n2004-06-07,114.7,113.42,114.65,113.48,107.318401477014,107.318401477014,105.09815332231642,105.09815332231642,105.09815332231642,102.98504176461957\n2004-06-08,114.92,114.17,114.85,114.37,108.35182527023204,108.35182527023204,105.86630105653111,105.86630105653111,105.86630105653111,103.8050888410962\n2004-06-09,114.86,112.98,113.77,114.52,109.40273322699491,109.40273322699491,106.68113396144331,106.68113396144331,106.68113396144331,104.6942817338085\n2004-06-10,114.32,113.93,114.3,114.04,110.28549591067572,110.28549591067572,107.42263190491342,107.42263190491342,107.42263190491342,105.51233919510382\n2004-06-14,113.85,111.23,113.19,113.84,111.02701656496761,111.02701656496761,108.09739503347122,108.09739503347122,108.09739503347122,106.26495205949551\n2004-06-15,114.45,113.51,113.95,113.96,111.23,111.23,108.7114294804588,108.7114294804588,108.7114294804588,106.95735589473587\n2004-06-16,114.2,113.7,113.99,114.02,111.23,111.23,109.27020082721751,109.27020082721751,109.27020082721751,107.594367423157\n2004-06-17,114.07,113.33,113.86,113.85,111.8204,111.8204,109.77868275276793,109.77868275276793,109.77868275276793,108.18041802930443\n2004-06-18,114.22,113.18,113.71,113.27,112.316336,112.316336,110.24140130501883,110.24140130501883,110.24140130501883,108.71958458696008\n2004-06-21,114.14,113.18,113.31,113.78,112.73292224000001,112.73292224000001,110.66247518756713,110.66247518756713,110.66247518756713,109.21561782000327\n2004-06-22,113.82,112.67,113.79,113.13,114.92,-114.92,111.04565242068608,111.04565242068608,111.04565242068608,109.67196839440301\n2004-06-23,114.84,113.42,114.7,113.61,114.875,-114.875,111.39434370282433,111.39434370282433,111.39434370282433,110.09181092285077\n2004-06-24,114.93,114.26,114.44,114.56,112.67,112.67,111.71165276957014,111.71165276957014,111.71165276957014,110.4780660490227\n2004-06-25,114.94,113.95,114.13,114.41,112.7152,112.7152,112.03348749261312,112.03348749261312,112.03348749261312,110.87874010461066\n2004-06-28,114.61,113.43,113.68,114.52,112.804192,112.804192,112.35320386842568,112.35320386842568,112.35320386842568,111.28486609414959\n2004-06-29,114.17,113.42,113.99,113.53,112.88962432,112.88962432,112.63775144289886,112.63775144289886,112.63775144289886,111.65037948473463\n2004-06-30,114.79,113.65,114.45,114.07,112.9716393472,112.9716393472,112.89099878417998,112.89099878417998,112.89099878417998,111.97934153626116\n2004-07-01,114.41,112.58,113.2,114.29,114.94,-114.94,-114.94,-114.94,-114.94,112.27540738263504\n2004-07-02,114.2,112.6,112.8,113.13,114.8928,-114.8928,-114.86919999999999,-114.86919999999999,-114.86919999999999,112.54186664437154\n2004-07-06,117.74,111.63,111.96,112.37,111.63,111.63,111.63,111.63,111.63,-120.09479999999999\n2004-07-07,112.57,111.75,112.14,111.81,111.63,111.63,111.63,111.63,111.63,-119.84085599999999\n2004-07-08,114.45,111.2,111.22,111.81,117.74,-117.74,-117.74,-117.74,-117.74,-119.59453031999999\n2004-07-09,111.94,111.38,111.64,111.7,117.6092,-117.6092,-117.54379999999999,-117.54379999999999,-117.54379999999999,-119.17480380399999\n2004-07-12,112.04,111.0,111.78,111.51,117.481016,-117.481016,-117.35348599999999,-117.35348599999999,-117.35348599999999,-118.77606361379999\n2004-07-13,112.02,111.63,111.89,111.9,117.22177536,-117.22177536,-117.0358117,-117.0358117,-117.0358117,-118.231739160834\n2004-07-14,114.41,111.12,111.49,111.26,116.9729043456,-116.9729043456,-116.73402111499999,-116.73402111499999,-116.73402111499999,-117.72551741957561\n2004-07-15,111.91,111.01,111.04,111.74,116.733988171776,-116.733988171776,-116.44732005924999,-116.44732005924999,-116.44732005924999,-117.25473120020531\n2004-07-16,111.94,110.44,110.53,111.57,116.50462864490497,-116.50462864490497,-116.17495405628749,-116.17495405628749,-116.17495405628749,-116.81690001619094\n2004-07-19,111.64,109.99,110.45,110.75,116.14075092621067,-116.14075092621067,-115.77350727234736,-115.77350727234736,-115.77350727234736,-116.24297901473376\n2004-07-20,111.31,110.25,111.25,110.53,115.64869085211382,-115.64869085211382,-115.2529916178361,-115.2529916178361,-115.2529916178361,-115.55515132311305\n2004-07-21,112.06,109.76,109.79,111.81,115.19599558394471,-115.19599558394471,-114.77932237223085,-114.77932237223085,-114.77932237223085,-114.94298467757062\n2004-07-22,110.39,108.77,110.01,109.4,114.65239602555023,-114.65239602555023,-114.22719691128546,-114.22719691128546,-114.22719691128546,-114.26919666948645\n2004-07-23,110.08,108.69,108.92,109.63,113.9465085024842,-113.9465085024842,-113.51776131281835,-113.51776131281835,-113.51776131281835,-113.44431716906348\n2004-07-26,109.95,108.21,108.85,109.19,113.21059731213641,-113.21059731213641,-112.7935971158956,-112.7935971158956,-112.7935971158956,-112.63608325032268\n2004-07-27,110.11,108.97,109.88,109.05,112.41050174219458,-112.41050174219458,-112.01438560619334,-112.01438560619334,-112.01438560619334,-111.79512743276138\n2004-07-28,110.37,107.72,110.03,109.55,111.73842146344344,-111.73842146344344,-111.36764005314048,-111.36764005314048,-111.36764005314048,-111.11395322053671\n2004-07-29,111.63,110.0,110.55,110.54,107.72,107.72,107.72,107.72,107.72,105.5656\n2004-07-30,110.85,100.51,110.67,110.32,111.63,-111.63,-111.63,-111.63,-111.63,-113.8626\n2004-08-02,113.61,101.81,111.1,110.2,100.51,100.51,100.51,100.51,100.51,98.49980000000001\n2004-08-03,111.85,110.0,110.38,110.93,100.51,100.51,100.51,100.51,100.51,98.80200400000001\n2004-08-04,110.75,100.45,110.28,109.89,113.61,-113.61,-113.61,-113.61,-113.61,99.09816392\n2004-08-05,110.92,108.37,108.52,110.27,113.3468,-113.3468,-113.2152,-113.2152,-113.2152,99.3884006416\n2004-08-06,110.44,106.62,106.83,107.63,113.088864,-113.088864,-112.832244,-112.832244,-112.832244,99.672832628768\n2004-08-09,110.27,106.85,107.01,107.02,112.83608672,-112.83608672,-112.46077668000001,-112.46077668000001,-112.46077668000001,99.95157597619264\n2004-08-10,118.0,104.77,108.36,107.31,100.45,100.45,100.45,100.45,100.45,100.22474445666879\n2004-08-11,108.33,104.79,108.09,107.69,100.801,100.801,100.801,100.801,100.801,100.75800212296872\n2004-08-12,107.95,106.77,106.85,107.68,101.14498,101.14498,101.14498,101.14498,101.14498,101.27526205927965\n2004-08-13,107.35,106.59,107.07,107.1,101.4820804,101.4820804,101.4820804,101.4820804,101.4820804,101.77700419750127\n2004-08-16,109.53,107.03,108.53,107.14,101.812438792,101.812438792,101.812438792,101.812438792,101.812438792,102.26369407157623\n2004-08-17,109.28,108.53,108.71,108.75,102.13619001616,102.13619001616,102.13619001616,102.13619001616,102.13619001616,102.73578324942893\n2004-08-18,110.13,108.08,110.08,108.52,102.4534662158368,102.4534662158368,102.4534662158368,102.4534662158368,102.4534662158368,103.19370975194606\n2004-08-19,110.02,108.34,109.61,109.81,102.76439689152006,102.76439689152006,102.76439689152006,102.76439689152006,102.76439689152006,103.63789845938767\n2004-08-20,110.63,100.42,110.44,109.62,118.0,-118.0,-118.0,-118.0,-118.0,-120.36\n2004-08-23,110.77,101.46,110.22,110.55,117.6484,-117.6484,-117.4726,-117.4726,-117.4726,-119.7618\n2004-08-24,110.73,109.85,110.19,110.64,117.303832,-117.303832,-116.961022,-116.961022,-116.961022,-119.181546\n2004-08-25,111.27,109.9,111.12,110.33,116.96615536,-116.96615536,-116.46479134,-116.46479134,-116.46479134,-118.61869962\n2004-08-26,111.31,110.39,111.16,110.96,116.63523225280001,-116.63523225280001,-115.9834475998,-115.9834475998,-115.9834475998,-118.0727386314\n2004-08-27,111.63,110.34,111.46,111.2,116.310927607744,-116.310927607744,-115.516544171806,-115.516544171806,-115.516544171806,-117.543156472458\n2004-08-30,111.34,110.51,110.58,111.23,115.99310905558913,-115.99310905558913,-115.06364784665182,-115.06364784665182,-115.06364784665182,-117.02946177828426\n2004-08-31,111.08,110.1,111.07,110.66,115.68164687447735,-115.68164687447735,-114.62433841125227,-114.62433841125227,-114.62433841125227,-116.53117792493573\n2004-09-01,111.64,110.48,111.31,110.95,115.3764139369878,-115.3764139369878,-114.1982082589147,-114.1982082589147,-114.1982082589147,-116.04784258718766\n2004-09-02,112.66,111.24,112.55,111.24,115.07728565824804,-115.07728565824804,-113.78486201114727,-113.78486201114727,-113.78486201114727,-115.57900730957203\n2004-09-03,112.82,111.3,112.09,112.3,114.78413994508308,-114.78413994508308,-113.38391615081285,-113.38391615081285,-113.38391615081285,-115.12423709028488\n2004-09-07,113.13,112.03,112.81,112.57,114.49685714618143,-114.49685714618143,100.42,100.42,100.42,-114.68310997757634\n2004-09-08,113.93,111.62,112.35,112.62,114.2153200032578,-114.2153200032578,100.6742,100.6742,100.6742,-114.25521667824904\n2004-09-09,112.88,112.03,112.5,112.57,113.93941360319265,-113.93941360319265,101.071874,101.071874,101.071874,-113.93\n2004-09-10,113.27,112.08,113.09,112.52,113.93,-113.93,101.45761777999999,101.45761777999999,101.45761777999999,-113.93\n2004-09-13,113.74,113.01,113.29,113.28,100.42,100.42,101.8317892466,101.8317892466,101.8317892466,98.4116\n2004-09-14,113.69,112.36,113.61,113.3,100.6864,100.6864,102.194735569202,102.194735569202,102.194735569202,98.718168\n2004-09-15,113.36,112.35,112.74,113.3,100.947472,100.947472,102.54679350212594,102.54679350212594,102.54679350212594,99.01860464\n2004-09-16,113.37,112.8,113.1,112.85,101.20332256,101.20332256,102.88828969706216,102.88828969706216,102.88828969706216,99.31303254720001\n2004-09-17,113.36,112.69,113.11,112.95,101.4540561088,101.4540561088,103.2195410061503,103.2195410061503,103.2195410061503,99.601571896256\n2004-09-20,112.99,112.28,112.52,112.69,101.699774986624,101.699774986624,103.54085477596578,103.54085477596578,103.54085477596578,99.88434045833088\n2004-09-21,113.47,112.54,113.24,112.75,101.94057948689152,101.94057948689152,103.85252913268681,103.85252913268681,103.85252913268681,100.16145364916426\n2004-09-22,113.6,111.5,111.63,112.48,102.17656789715369,102.17656789715369,104.15485325870621,104.15485325870621,104.15485325870621,100.43302457618097\n2004-09-23,111.7,111.04,111.14,111.6,102.40783653921062,102.40783653921062,104.44810766094503,104.44810766094503,104.44810766094503,100.69916408465735\n2004-09-24,112.58,111.0,111.35,111.17,102.6344798084264,102.6344798084264,104.73256443111667,104.73256443111667,104.73256443111667,100.95998080296421\n2004-09-27,111.8,110.58,110.67,111.1,102.85659021225787,102.85659021225787,105.00848749818317,105.00848749818317,105.00848749818317,101.21558118690493\n2004-09-28,111.51,109.8,111.35,110.91,103.07425840801271,103.07425840801271,105.27613287323767,105.27613287323767,105.27613287323767,101.46606956316683\n2004-09-29,111.79,111.0,111.74,111.21,103.28757323985245,103.28757323985245,105.53574888704054,105.53574888704054,105.53574888704054,101.71154817190349\n2004-09-30,111.98,105.88,111.74,111.55,103.4966217750554,103.4966217750554,105.78757642042932,105.78757642042932,105.78757642042932,101.95211720846542\n2004-10-01,113.52,111.78,113.49,112.27,103.7014893395543,103.7014893395543,105.88,105.88,105.88,102.18787486429612\n2004-10-04,114.44,113.49,113.85,114.1,103.90225955276321,103.90225955276321,105.88,105.88,105.88,102.4189173670102\n2004-10-05,114.16,113.0,113.83,113.85,104.32376917065268,104.32376917065268,106.2224,106.2224,106.2224,102.7795498459999\n2004-10-06,119.79,113.68,114.56,113.77,104.72841840382658,104.72841840382658,106.551104,106.551104,106.551104,103.1293633506199\n2004-10-07,118.82,113.36,113.38,114.38,105.63211329959698,105.63211329959698,107.2130488,107.2130488,107.2130488,103.7957888165951\n2004-10-08,113.77,112.35,112.58,113.15,106.48158650162117,106.48158650162117,107.84189635999999,107.84189635999999,107.84189635999999,104.4355572639313\n2004-10-11,113.02,112.64,112.87,112.78,107.28009131152389,107.28009131152389,108.439301542,108.439301542,108.439301542,105.04973497337404\n2004-10-12,112.95,111.94,112.53,112.2,108.03068583283246,108.03068583283246,109.00683646489999,109.00683646489999,109.00683646489999,105.63934557443908\n2004-10-13,113.07,111.32,111.67,113.0,108.73624468286252,108.73624468286252,109.54599464165499,109.54599464165499,109.54599464165499,106.20537175146151\n2004-10-14,111.93,110.58,110.7,111.68,109.39947000189076,109.39947000189076,110.05819490957224,110.05819490957224,110.05819490957224,106.74875688140305\n2004-10-15,112.67,110.57,111.17,111.02,110.02290180177732,110.02290180177732,110.54478516409362,110.54478516409362,110.54478516409362,107.27040660614693\n2004-10-18,111.96,110.7,111.8,110.91,110.57,110.57,110.57,110.57,110.57,107.77119034190106\n2004-10-19,114.47,100.75,110.72,112.02,119.79,-119.79,-119.79,-119.79,-119.79,-122.1858\n2004-10-20,110.88,109.75,110.71,110.4,119.40920000000001,-119.40920000000001,-119.2188,-119.2188,-119.2188,-121.542726\n2004-10-21,111.32,110.21,111.04,110.79,119.03601600000002,-119.03601600000002,-118.664736,-118.664736,-118.664736,-120.91894422\n2004-10-22,111.25,100.94,109.95,111.18,118.67029568000002,-118.67029568000002,-118.12729392,-118.12729392,-118.12729392,-120.3138758934\n2004-10-25,110.12,109.35,109.87,109.75,118.31188976640003,-118.31188976640003,-117.6059751024,-117.6059751024,-117.6059751024,-119.726959616598\n2004-10-26,111.43,109.88,111.4,110.13,117.96065197107202,-117.96065197107202,-117.10029584932799,-117.10029584932799,-117.10029584932799,-119.15765082810006\n2004-10-27,113.1,111.12,112.97,111.36,117.61643893165058,-117.61643893165058,-116.60978697384816,-116.60978697384816,-116.60978697384816,-118.60542130325706\n2004-10-28,113.56,112.49,113.17,112.76,117.27911015301757,-117.27911015301757,-116.13399336463272,-116.13399336463272,-116.13399336463272,-118.06975866415935\n2004-10-29,116.0,110.51,113.38,113.12,116.94852794995722,-116.94852794995722,100.75,100.75,100.75,-117.55016590423458\n2004-11-01,113.84,113.2,113.49,113.56,116.62455739095807,-116.62455739095807,101.055,101.055,101.055,-117.04616092710754\n2004-11-02,114.57,113.22,113.5,113.66,116.30706624313892,-116.30706624313892,101.35390000000001,101.35390000000001,101.35390000000001,-116.55727609929431\n2004-11-03,115.36,114.0,114.77,115.0,115.99592491827615,-115.99592491827615,101.64682200000001,101.64682200000001,101.64682200000001,-116.08305781631549\n2004-11-04,116.67,114.68,116.55,114.78,100.75,100.75,101.93388556000001,101.93388556000001,101.93388556000001,98.735\n2004-11-05,118.84,116.49,117.1,117.02,101.0684,101.0684,102.3759689932,102.3759689932,102.3759689932,99.0937\n2004-11-08,117.23,116.72,117.0,117.01,101.779264,101.779264,103.034530233472,103.034530233472,103.034530233472,99.686089\n2004-11-09,117.5,116.76,117.0,117.08,102.46169344,102.46169344,103.66674902413311,103.66674902413311,103.66674902413311,100.26070632999999\n2004-11-10,117.55,116.76,116.94,117.06,103.1168257024,103.1168257024,104.27367906316779,104.27367906316779,104.27367906316779,100.8180851401\n2004-11-11,118.12,117.1,117.99,117.18,103.745752674304,103.745752674304,104.85633190064108,104.85633190064108,104.85633190064108,101.35874258589699\n2004-11-12,118.99,117.35,118.91,117.97,104.34952256733185,104.34952256733185,105.41567862461544,105.41567862461544,105.41567862461544,101.88318030832008\n2004-11-15,118.73,118.23,118.67,118.5,105.22795121329193,105.22795121329193,106.09439469338467,106.09439469338467,106.09439469338467,102.56745309598728\n2004-11-16,118.63,117.73,117.76,118.37,106.05367414049441,106.05367414049441,106.73917495871544,106.73917495871544,106.73917495871544,103.22435497214778\n2004-11-17,119.14,118.07,118.4,118.36,106.82985369206475,106.82985369206475,107.35171621077967,107.35171621077967,107.35171621077967,103.85498077326187\n2004-11-18,118.8,118.23,118.66,118.53,107.81466539669957,107.81466539669957,108.05901323813289,108.05901323813289,108.05901323813289,104.61923173459878\n2004-11-19,118.87,111.47,117.32,118.68,108.72069216496361,108.72069216496361,108.72387244384491,108.72387244384491,108.72387244384491,105.34527014786885\n2004-11-22,118.12,117.03,117.95,117.18,109.55423679176651,109.55423679176651,109.34884009721422,109.34884009721422,109.34884009721422,106.0350066404754\n2004-11-23,118.26,117.37,117.97,117.93,110.3210978484252,110.3210978484252,109.93630969138137,109.93630969138137,109.93630969138137,106.69025630845164\n2004-11-24,118.59,118.04,118.54,118.27,111.02661002055117,111.02661002055117,110.48853110989849,110.48853110989849,110.48853110989849,107.31274349302906\n2004-11-26,118.98,118.26,118.4,118.49,111.67568121890709,111.67568121890709,111.00761924330457,111.00761924330457,111.00761924330457,107.90410631837761\n2004-11-29,119.01,117.48,118.13,118.79,112.27282672139452,112.27282672139452,111.4955620887063,111.4955620887063,111.4955620887063,108.46590100245874\n2004-11-30,118.24,117.64,117.77,118.0,112.82220058368296,112.82220058368296,111.95422836338392,111.95422836338392,111.95422836338392,108.9996059523358\n2004-12-01,119.47,118.1,119.47,118.16,113.32762453698832,113.32762453698832,112.38537466158088,112.38537466158088,112.38537466158088,109.506625654719\n2004-12-02,119.95,110.4,119.38,119.1,119.95,-119.95,-119.95,-119.95,-119.95,110.10442811543587\n2004-12-03,120.14,119.09,119.43,119.31,110.4,110.4,110.4,110.4,110.4,110.4\n2004-12-06,119.64,118.8,119.34,119.22,110.4,110.4,110.4,110.4,110.4,110.4\n2004-12-07,119.62,118.05,118.07,119.49,110.5948,110.5948,110.5948,110.5948,110.5948,111.17920000000001\n2004-12-08,118.83,118.01,118.62,118.21,110.78570400000001,110.78570400000001,110.78570400000001,110.78570400000001,110.78570400000001,111.89606400000001\n2004-12-09,119.46,117.73,119.3,118.14,110.97278992000001,110.97278992000001,110.97278992000001,110.97278992000001,110.97278992000001,112.55557888000001\n2004-12-10,119.56,118.85,119.17,118.91,111.1561341216,111.1561341216,111.1561341216,111.1561341216,111.1561341216,113.16233256960001\n2004-12-13,120.31,119.35,120.29,119.76,111.335811439168,111.335811439168,111.335811439168,111.335811439168,111.335811439168,113.72054596403201\n2004-12-14,120.96,120.18,120.8,120.2,111.69477898160127,111.69477898160127,111.60503709599296,111.60503709599296,111.60503709599296,114.31359682726914\n2004-12-15,121.11,120.31,120.97,120.7,112.2506922427052,112.2506922427052,111.97923561215323,111.97923561215323,111.97923561215323,114.97823714454222\n2004-12-16,128.88,120.04,120.7,120.72,112.95943686328879,112.95943686328879,112.43577383154557,112.43577383154557,112.43577383154557,115.65273105864257\n2004-12-17,120.0,118.88,119.42,119.45,114.55149317695991,114.55149317695991,113.42242740165284,113.42242740165284,113.42242740165284,117.24000333160546\n2004-12-20,120.38,107.14,119.27,119.73,128.88,-128.88,-128.88,-128.88,-128.88,-131.45759999999999\n2004-12-21,120.92,118.89,120.4,119.6,128.4452,-128.4452,-128.2278,-128.2278,-128.2278,-130.728072\n2004-12-22,121.08,120.05,120.91,120.38,128.019096,-128.019096,-127.595166,-127.595166,-127.595166,-130.02042984\n2004-12-23,121.28,120.09,120.99,120.87,127.60151407999999,-127.60151407999999,-126.98151102,-126.98151102,-126.98151102,-129.3340169448\n2004-12-27,121.36,120.41,120.42,121.22,127.19228379839998,-127.19228379839998,-126.3862656894,-126.3862656894,-126.3862656894,-128.668196436456\n2004-12-28,121.3,120.6,121.25,120.62,126.79123812243199,-126.79123812243199,-125.80887771871801,-125.80887771871801,-125.80887771871801,-128.0223505433623\n2004-12-29,121.33,120.95,121.27,121.08,126.39821335998334,-126.39821335998334,-125.24881138715647,-125.24881138715647,-125.24881138715647,-127.39588002706144\n2004-12-30,121.57,121.21,121.23,121.4,126.01304909278367,-126.01304909278367,-124.70554704554178,-124.70554704554178,-124.70554704554178,-126.7882036262496\n2004-12-31,121.66,121.03,121.04,121.3,125.635588110928,-125.635588110928,-124.17858063417552,-124.17858063417552,-124.17858063417552,-126.19875751746211\n2005-01-03,121.76,119.9,120.06,121.56,125.26567634870943,-125.26567634870943,-123.66742321515025,-123.66742321515025,-123.66742321515025,-125.62699479193824\n2005-01-04,120.54,118.44,118.74,120.46,124.90316282173525,-124.90316282173525,-123.17160051869574,-123.17160051869574,-123.17160051869574,-125.0723849481801\n2005-01-05,119.77,118.29,118.32,118.75,124.54789956530054,-124.54789956530054,-122.69065250313487,-122.69065250313487,-122.69065250313487,-124.5344133997347\n2005-01-06,119.15,118.04,118.71,118.44,124.19974157399453,-124.19974157399453,-122.22413292804083,-122.22413292804083,-122.22413292804083,-124.01258099774266\n2005-01-07,119.23,118.13,118.56,118.97,123.85854674251463,-123.85854674251463,-121.77160894019961,-121.77160894019961,-121.77160894019961,-123.50640356781038\n2005-01-10,119.46,116.57,118.94,118.34,123.52417580766434,-123.52417580766434,-121.33266067199362,-121.33266067199362,-121.33266067199362,-123.01541146077606\n2005-01-11,118.74,117.99,118.29,118.65,123.19649229151105,-123.19649229151105,-120.90688085183382,-120.90688085183382,-120.90688085183382,-122.53914911695279\n2005-01-12,118.84,117.34,118.8,118.39,122.87536244568082,-122.87536244568082,-120.49387442627881,-120.49387442627881,-120.49387442627881,-122.0771746434442\n2005-01-13,118.73,117.5,117.68,118.61,122.5606551967672,-122.5606551967672,-120.09325819349044,-120.09325819349044,-120.09325819349044,-121.62905940414088\n2005-01-14,118.53,117.76,118.42,117.95,122.25224209283185,-122.25224209283185,-119.70466044768573,-119.70466044768573,-119.70466044768573,-121.19438762201665\n2005-01-18,119.6,117.95,119.57,118.06,121.94999725097522,-121.94999725097522,107.14,107.14,107.14,-120.77275599335614\n2005-01-19,119.88,118.39,118.4,119.42,121.6537973059557,-121.6537973059557,107.3892,107.3892,107.3892,-120.36377331355546\n2005-01-20,118.8,117.29,117.57,117.9,121.3635213598366,-121.3635213598366,107.763924,107.763924,107.763924,-119.9670601141488\n2005-01-21,118.0,116.74,116.8,117.78,121.07905093263986,-121.07905093263986,108.12740628,108.12740628,108.12740628,-119.88\n2005-01-24,117.34,116.37,116.42,117.07,120.80026991398707,-120.80026991398707,108.4799840916,108.4799840916,108.4799840916,-119.4978\n2005-01-25,117.47,116.4,116.87,116.91,120.52706451570732,-120.52706451570732,108.821984568852,108.821984568852,108.821984568852,-119.127066\n2005-01-26,117.6,116.84,117.41,117.31,120.25932322539317,-120.25932322539317,109.15372503178644,109.15372503178644,109.15372503178644,-118.76745402\n2005-01-27,117.75,116.98,117.46,117.18,119.9969367608853,-119.9969367608853,109.47551328083284,109.47551328083284,109.47551328083284,-118.4186303994\n2005-01-28,117.65,116.61,117.13,117.49,119.7397980256676,-119.7397980256676,109.78764788240785,109.78764788240785,109.78764788240785,-118.080271487418\n2005-01-31,118.25,117.16,118.07,117.95,119.48780206515424,-119.48780206515424,110.09041844593561,110.09041844593561,110.09041844593561,104.9972\n2005-02-01,119.08,117.82,118.91,118.28,119.24084602385116,-119.24084602385116,110.38410589255754,110.38410589255754,110.38410589255754,105.26225600000001\n2005-02-02,119.59,118.9,119.34,119.06,107.14,107.14,110.66898271578081,110.66898271578081,110.66898271578081,105.67678832000001\n2005-02-03,119.39,118.57,119.05,119.07,107.389,107.389,110.94531323430739,110.94531323430739,110.94531323430739,106.23331678720001\n2005-02-04,120.43,118.98,120.33,119.03,107.63302,107.63302,111.21335383727816,111.21335383727816,111.21335383727816,106.76758411571201\n2005-02-07,120.52,119.96,120.23,120.22,108.1448992,108.1448992,111.58201968378704,111.58201968378704,111.58201968378704,107.45070490992642\n2005-02-08,120.65,120.07,120.34,120.17,108.887405248,108.887405248,112.02891869959768,112.02891869959768,112.02891869959768,108.23486261533083\n2005-02-09,120.49,119.25,119.3,120.42,109.82841282816,109.82841282816,112.54618357762182,112.54618357762182,112.54618357762182,109.10392223225767\n2005-02-10,120.02,119.26,119.83,119.66,110.6941398019072,110.6941398019072,113.03241256296451,113.03241256296451,113.03241256296451,109.91214767599963\n2005-02-11,121.04,119.46,120.72,119.71,111.49060861775462,111.49060861775462,113.48946780918664,113.48946780918664,113.48946780918664,110.66379733867966\n2005-02-14,120.86,120.48,120.78,120.68,112.44554775597916,112.44554775597916,114.01800506254357,114.01800506254357,114.01800506254357,111.49389355158529\n2005-02-15,121.43,120.05,121.2,120.8,113.30499298038124,113.30499298038124,114.50954470816552,114.50954470816552,114.50954470816552,112.25758206745847\n2005-02-16,121.46,120.67,121.19,120.93,114.27999382273549,114.27999382273549,115.06318113151228,115.06318113151228,115.06318113151228,113.08309968138721\n2005-02-17,121.33,120.24,120.29,121.23,115.28519468755252,115.28519468755252,115.63889482967618,115.63889482967618,115.63889482967618,113.92078971324848\n2005-02-18,120.48,119.9,120.35,120.17,116.14966743129517,116.14966743129517,116.16279429500531,116.16279429500531,116.16279429500531,114.67471074192363\n2005-02-22,120.92,118.58,118.67,119.9,116.89311399091385,116.89311399091385,116.63954280845483,116.63954280845483,116.63954280845483,115.35323966773127\n2005-02-23,119.57,118.62,119.33,118.97,117.5324780321859,117.5324780321859,117.0733839556939,117.0733839556939,117.0733839556939,115.96391570095814\n2005-02-24,120.32,118.98,120.26,119.24,118.08233110767988,118.08233110767988,117.46817939968145,117.46817939968145,117.46817939968145,116.51352413086232\n2005-02-25,121.67,112.18,121.38,120.27,121.67,-121.67,-121.67,-121.67,-121.67,-124.10340000000001\n2005-02-28,121.65,120.02,120.54,121.16,121.67,-121.67,-121.67,-121.67,-121.67,-123.745698\n2005-03-01,121.91,120.62,121.3,120.78,112.18,112.18,112.18,112.18,112.18,-123.39872706\n2005-03-02,121.93,120.01,121.29,120.76,112.3746,112.3746,112.3746,112.3746,112.3746,-123.0621652482\n2005-03-03,121.9,120.7,121.36,121.66,112.756816,112.756816,112.66126200000001,112.66126200000001,112.66126200000001,-122.735700290754\n2005-03-04,122.9,120.24,122.56,122.05,113.12374336,113.12374336,112.93932414000001,112.93932414000001,112.93932414000001,109.9364\n2005-03-07,123.25,121.9,122.78,122.65,113.7103187584,113.7103187584,113.33775117440001,113.33775117440001,113.33775117440001,110.195672\n2005-03-08,123.0,122.05,122.2,122.67,114.47349325772801,114.47349325772801,113.83336361568001,113.83336361568001,113.83336361568001,110.58730184\n2005-03-09,122.29,120.98,121.01,121.96,115.17561379710976,115.17561379710976,114.30419543489602,114.30419543489602,114.30419543489602,110.9671827848\n2005-03-10,126.27,120.4,121.2,121.21,115.82156469334097,115.82156469334097,114.75148566315121,114.75148566315121,114.75148566315121,111.335667301256\n2005-03-11,121.72,120.16,120.41,121.31,116.86640822400688,116.86640822400688,115.44259652336214,115.44259652336214,115.44259652336214,111.93304060920576\n2005-03-14,121.06,120.28,121.04,120.63,117.80676740160618,117.80676740160618,116.09224073196042,116.09224073196042,116.09224073196042,112.50651898483753\n2005-03-15,121.46,120.13,120.17,121.42,118.65309066144556,118.65309066144556,116.7029062880428,116.7029062880428,116.7029062880428,113.05705822544402\n2005-03-16,120.16,118.9,119.18,119.7,126.27,-126.27,117.27693191076023,117.27693191076023,117.27693191076023,113.58557589642626\n2005-03-17,119.74,117.49,119.41,119.31,126.12259999999999,-126.12259999999999,-126.27,-126.27,-126.27,114.09295286056921\n2005-03-18,119.22,118.1,118.81,119.11,125.77729599999999,-125.77729599999999,-126.00659999999999,-126.00659999999999,-126.00659999999999,114.58003474614644\n2005-03-21,118.88,117.76,118.26,118.71,125.44580416,-125.44580416,-125.75110199999999,-125.75110199999999,-125.75110199999999,115.04763335630058\n2005-03-22,118.93,117.06,117.13,118.36,125.1275719936,-125.1275719936,-125.50326893999998,-125.50326893999998,-125.50326893999998,115.49652802204855\n2005-03-23,119.06,116.62,117.06,116.95,124.64351767398401,-124.64351767398401,-125.08110549299998,-125.08110549299998,-125.08110549299998,115.92746690116661\n2005-03-24,117.99,115.43,117.14,117.47,124.00163626006528,-124.00163626006528,-124.48882810848998,-124.48882810848998,-124.48882810848998,-128.7954\n2005-03-28,117.94,117.33,117.36,117.42,123.14447263405876,-123.14447263405876,-123.67353357872588,-123.67353357872588,-123.67353357872588,-128.394438\n2005-03-29,117.9,116.25,116.42,117.14,122.37302537065288,-122.37302537065288,-122.93161555664055,-122.93161555664055,-122.93161555664055,-128.00550486\n2005-03-30,118.13,116.49,118.12,116.79,121.6787228335876,-121.6787228335876,-122.2564701565429,-122.2564701565429,-122.2564701565429,-127.6282397142\n2005-03-31,118.66,110.09,117.95,118.19,121.05385055022884,-121.05385055022884,-121.64208784245405,-121.64208784245405,-121.64208784245405,-127.262292522774\n2005-04-01,119.74,116.91,117.22,118.62,110.09,110.09,-120.3713581797841,-120.3713581797841,-120.3713581797841,-126.4036778966353\n2005-04-04,117.86,116.74,117.59,117.35,110.09,110.09,-119.74,-119.74,-119.74,-125.58799400180354\n2005-04-05,118.82,117.11,118.09,117.8,110.283,110.283,-119.74,-119.74,-119.74,-124.81309430171336\n2005-04-06,118.95,118.14,118.4,118.45,110.47214,110.47214,110.09,110.09,110.09,-124.0769395866277\n2005-04-07,119.23,118.12,119.15,118.41,110.6574972,110.6574972,110.2672,110.2672,110.2672,-123.37759260729632\n2005-04-08,119.24,118.08,118.1,119.15,110.83914725599999,110.83914725599999,110.536084,110.536084,110.536084,-122.7132129769315\n2005-04-11,118.42,117.83,118.18,118.29,111.01716431087999,111.01716431087999,110.88424064,110.88424064,110.88424064,-122.08205232808493\n2005-04-12,119.06,117.07,118.76,117.89,111.1916210246624,111.1916210246624,111.2184710144,111.2184710144,111.2184710144,-121.48244971168069\n2005-04-13,118.8,117.13,117.42,118.55,111.36258860416915,111.36258860416915,111.539332173824,111.539332173824,111.539332173824,-120.91282722609665\n2005-04-14,117.87,116.13,116.27,117.42,111.53013683208576,111.53013683208576,111.84735888687104,111.84735888687104,111.84735888687104,-120.37168586479181\n2005-04-15,116.82,114.16,114.28,115.74,111.69433409544405,111.69433409544405,112.14306453139619,112.14306453139619,112.14306453139619,-119.85760157155222\n2005-04-18,114.96,113.96,114.61,114.15,111.85524741353517,111.85524741353517,112.42694195014035,112.42694195014035,112.42694195014035,-119.36922149297462\n2005-04-19,115.53,114.62,115.29,115.07,112.01294246526446,112.01294246526446,112.69946427213473,112.69946427213473,112.69946427213473,-118.90526041832588\n2005-04-20,115.91,113.6,113.82,115.4,112.16748361595917,112.16748361595917,112.96108570124935,112.96108570124935,112.96108570124935,-118.46449739740959\n2005-04-21,117.75,113.63,115.99,114.79,112.31893394363999,112.31893394363999,113.21224227319937,113.21224227319937,113.21224227319937,-118.04577252753911\n2005-04-22,116.5,114.27,115.28,115.74,112.46735526476719,112.46735526476719,113.45335258227139,113.45335258227139,113.45335258227139,-117.75\n2005-04-25,116.5,115.25,116.27,115.86,112.61280815947185,112.61280815947185,113.63,113.63,113.63,-117.75\n2005-04-26,116.83,115.22,115.22,115.98,112.75535199628241,112.75535199628241,113.8544,113.8544,113.8544,-117.367\n2005-04-27,116.8,110.0,115.68,114.86,119.74,-119.74,-119.24,-119.24,-119.24,-117.00315\n2005-04-28,115.68,114.35,114.4,115.27,119.5452,-119.5452,-118.9628,-118.9628,-118.9628,-116.83\n2005-04-29,115.79,113.97,115.7,115.08,119.35429599999999,-119.35429599999999,-118.693916,-118.693916,-118.693916,-116.8\n2005-05-02,116.98,115.52,116.33,116.07,119.16721007999999,-119.16721007999999,-118.43309852,-118.43309852,-118.43309852,107.8\n2005-05-03,116.93,115.69,116.25,116.05,118.9838658784,-118.9838658784,-118.1801055644,-118.1801055644,-118.1801055644,107.9836\n2005-05-04,117.75,116.22,117.62,116.65,118.804188560832,-118.804188560832,-117.934702397468,-117.934702397468,-117.934702397468,108.163528\n2005-05-05,119.78,116.69,117.36,117.66,110.0,110.0,110.0,110.0,110.0,108.45112216\n2005-05-06,119.17,116.67,117.2,117.93,110.1956,110.1956,110.1956,110.1956,110.1956,108.9042772736\n2005-05-09,118.03,117.05,118.01,117.21,110.387288,110.387288,110.387288,110.387288,110.387288,109.339306182656\n2005-05-10,119.98,116.39,116.69,117.38,110.57514223999999,110.57514223999999,110.57514223999999,110.57514223999999,110.57514223999999,109.75693393534976\n2005-05-11,118.27,115.85,117.2,116.93,110.95133655039999,110.95133655039999,110.8572879728,110.8572879728,110.8572879728,110.26808723858228\n2005-05-12,117.59,115.95,116.09,117.31,111.31248308838398,111.31248308838398,111.130969333616,111.130969333616,111.130969333616,110.75368287665317\n2005-05-13,116.65,114.8,115.6,116.3,111.65918376484862,111.65918376484862,111.39644025360751,111.39644025360751,111.39644025360751,111.21499873282052\n2005-05-16,116.85,115.66,116.79,115.7,111.99201641425468,111.99201641425468,111.65394704599929,111.65394704599929,111.65394704599929,111.6532487961795\n2005-05-17,117.7,116.16,117.59,116.43,112.3115357576845,112.3115357576845,111.90372863461931,111.90372863461931,111.90372863461931,112.06958635637052\n2005-05-18,119.84,117.63,118.79,118.06,112.61827432737712,112.61827432737712,112.14601677558073,112.14601677558073,112.14601677558073,112.46510703855199\n2005-05-19,119.41,118.7,119.38,119.0,112.91274335428204,112.91274335428204,112.38103627231331,112.38103627231331,112.38103627231331,112.84085168662439\n2005-05-20,119.39,118.74,119.15,119.32,113.19543362011076,113.19543362011076,112.60900518414391,112.60900518414391,112.60900518414391,113.19780910229318\n2005-05-23,120.04,119.18,119.65,119.2,113.46681627530633,113.46681627530633,112.8301350286196,112.8301350286196,112.8301350286196,113.53691864717852\n2005-05-24,119.83,119.2,119.65,119.44,113.86120729878795,113.86120729878795,113.11852962747481,113.11852962747481,113.11852962747481,113.92710352834781\n2005-05-25,119.47,118.83,119.32,119.36,114.23193486086068,114.23193486086068,113.39538844237582,113.39538844237582,113.39538844237582,114.29387731664694\n2005-05-26,120.21,117.77,120.05,119.79,114.58041876920903,114.58041876920903,113.66117290468078,113.66117290468078,113.66117290468078,114.63864467764813\n2005-05-27,120.25,119.8,120.18,120.08,115.03078526767231,115.03078526767231,113.98861425944675,113.98861425944675,113.98861425944675,115.02863955021276\n2005-05-31,120.17,117.51,119.45,120.06,115.55270674090508,115.55270674090508,114.36429740387995,114.36429740387995,114.36429740387995,115.44634838619574\n2005-06-01,120.92,119.4,120.54,119.52,116.02243606681458,116.02243606681458,114.71743955964715,114.71743955964715,114.71743955964715,115.83064051530008\n2005-06-02,120.84,120.1,120.71,120.23,116.61014373879682,116.61014373879682,115.15161879047184,115.15161879047184,115.15161879047184,116.28868286892308\n2005-06-03,120.89,119.73,119.94,120.55,117.1273264901412,117.1273264901412,115.55540547513881,115.55540547513881,115.55540547513881,116.70550141072\n2005-06-06,120.22,119.55,120.14,120.01,117.58244731132426,117.58244731132426,115.9309270918791,115.9309270918791,115.9309270918791,117.0848062837552\n2005-06-07,121.51,120.05,120.07,120.39,117.98295363396535,117.98295363396535,116.28016219544756,116.28016219544756,116.28016219544756,117.42997371821723\n2005-06-08,123.95,119.67,119.85,120.45,118.4767401252102,118.4767401252102,116.69854921981175,116.69854921981175,116.69854921981175,117.83797634639551\n2005-06-09,120.58,119.34,120.49,119.74,123.95,-123.95,117.3511797900287,117.3511797900287,117.3511797900287,118.510298948292\n2005-06-10,120.65,119.24,120.21,120.57,123.95,-123.95,117.94507360892611,117.94507360892611,117.94507360892611,119.10866606397988\n2005-06-13,121.08,112.04,120.49,119.95,123.7616,-123.7616,-123.95,-123.95,-123.95,-126.429\n2005-06-14,121.2,120.38,120.82,120.45,123.058304,-123.058304,-123.59270000000001,-123.59270000000001,-123.59270000000001,-125.99733\n2005-06-15,121.24,120.23,121.06,121.16,122.39720576,-122.39720576,-123.24611900000001,-123.24611900000001,-123.24611900000001,-125.5786101\n2005-06-16,121.64,120.92,121.48,121.1,121.7757734144,-121.7757734144,-122.90993543,-122.90993543,-122.90993543,-125.17245179700001\n2005-06-17,121.93,121.2,121.6,121.54,112.04,112.04,-122.5838373671,-122.5838373671,-122.5838373671,-124.77847824309\n2005-06-20,122.18,120.94,121.5,121.08,112.23780000000001,112.23780000000001,-122.267522246087,-122.267522246087,-122.267522246087,-124.39632389579731\n2005-06-21,121.65,121.03,121.3,121.49,112.63548800000001,112.63548800000001,-122.18,-122.18,-122.18,-124.02563417892338\n2005-06-22,121.94,121.07,121.37,121.69,113.01726848000001,113.01726848000001,-122.18,-122.18,-122.18,-123.66606515355568\n2005-06-23,121.6,119.97,120.0,121.31,113.38377774080001,113.38377774080001,-121.94,-121.94,-121.94,-123.31728319894901\n2005-06-24,120.01,119.05,119.09,119.88,113.73562663116802,113.73562663116802,-121.94,-121.94,-121.94,-122.97896470298055\n2005-06-27,119.41,118.75,119.04,118.97,114.0734015659213,114.0734015659213,-121.643,-121.643,-121.643,-122.65079576189113\n2005-06-28,120.24,119.37,120.18,119.41,114.39766550328444,114.39766550328444,-121.35491,-121.35491,-121.35491,-122.3324718890344\n2005-06-29,120.4,119.81,119.94,120.37,114.70895888315306,114.70895888315306,-121.0754627,-121.0754627,-121.0754627,-122.02369773236336\n2005-06-30,120.32,118.95,119.06,120.2,115.00780052782693,115.00780052782693,-120.804398819,-120.804398819,-120.804398819,-121.72418680039246\n2005-07-01,119.8,119.21,119.5,119.46,115.29468850671385,115.29468850671385,-120.54146685443,-120.54146685443,-120.54146685443,-121.43366119638068\n2005-07-05,120.65,119.19,120.48,119.26,115.5701009664453,115.5701009664453,112.04,112.04,112.04,-121.15185136048926\n2005-07-06,120.65,119.45,119.49,120.39,115.83449692778748,115.83449692778748,112.21220000000001,112.21220000000001,112.21220000000001,-120.87849581967458\n2005-07-07,120.4,118.18,119.77,118.29,116.08831705067598,116.08831705067598,112.38095600000001,112.38095600000001,112.38095600000001,-120.65\n2005-07-08,121.32,119.72,121.22,119.97,116.33198436864895,116.33198436864895,112.54633688000001,112.54633688000001,112.54633688000001,109.79920000000001\n2005-07-11,122.06,121.31,122.02,121.33,116.56590499390299,116.56590499390299,112.80954677360002,112.80954677360002,112.80954677360002,110.02961600000002\n2005-07-12,122.63,121.64,122.22,121.9,116.79046879414688,116.79046879414688,113.17956490265601,113.17956490265601,113.17956490265601,110.39052752000002\n2005-07-13,122.52,121.99,122.34,122.27,117.14084066649806,117.14084066649806,113.65208665752321,113.65208665752321,113.65208665752321,110.88010641920002\n2005-07-14,123.44,122.37,122.74,122.98,117.47019022650818,117.47019022650818,114.10098232464705,114.10098232464705,114.10098232464705,111.35010216243202\n2005-07-15,123.04,122.36,122.77,122.79,117.94777500838752,117.94777500838752,114.66132338516823,114.66132338516823,114.66132338516823,111.95459705431043\n2005-07-18,122.83,122.05,122.2,122.5,118.38715300771652,118.38715300771652,115.18804398205813,115.18804398205813,115.18804398205813,112.5288672015949\n2005-07-19,123.11,122.17,123.0,122.71,118.7913807670992,118.7913807670992,115.68316134313464,115.68316134313464,115.68316134313464,113.07442384151516\n2005-07-20,123.89,122.3,123.54,122.59,119.16327030573126,119.16327030573126,116.14857166254656,116.14857166254656,116.14857166254656,113.5927026494394\n2005-07-21,123.89,122.47,122.7,123.55,119.63594327515813,119.63594327515813,116.6904716461683,116.6904716461683,116.6904716461683,114.21054049047304\n2005-07-22,125.25,122.63,123.43,122.88,120.06134894764232,120.06134894764232,117.19443863093652,117.19443863093652,117.19443863093652,114.79130806104466\n2005-07-25,123.95,122.85,122.93,123.41,120.68398707392524,120.68398707392524,117.8388835404616,117.8388835404616,117.8388835404616,115.52341649677153\n2005-07-26,123.53,122.95,123.23,123.23,121.2319086250542,121.2319086250542,118.43177285722467,118.43177285722467,118.43177285722467,116.20427734199752\n2005-07-27,123.85,123.05,123.79,123.48,121.7140795900477,121.7140795900477,118.9772310286467,118.9772310286467,118.9772310286467,116.8374779280577\n2005-07-28,124.93,123.64,124.5,123.99,122.13839003924198,122.13839003924198,119.47905254635496,119.47905254635496,119.47905254635496,117.42635447309365\n2005-07-29,124.63,123.4,123.56,124.41,122.51178323453294,122.51178323453294,119.94072834264657,119.94072834264657,119.94072834264657,117.9740096599771\n2005-08-01,124.04,121.89,123.55,123.8,125.25,-125.25,120.36547007523484,120.36547007523484,120.36547007523484,118.4833289837787\n2005-08-02,128.28,123.74,124.46,123.87,121.89,121.89,120.75623246921606,120.75623246921606,120.75623246921606,118.95699595491419\n2005-08-03,124.74,124.1,124.64,124.24,121.89,121.89,121.43337154698662,121.43337154698662,121.43337154698662,119.70283627852106\n2005-08-04,124.69,123.6,123.66,124.22,122.0178,122.0178,122.04956810775782,122.04956810775782,122.04956810775782,120.38900937623937\n2005-08-05,132.3,122.67,122.77,123.46,122.14304399999999,122.14304399999999,122.61030697805961,122.61030697805961,122.61030697805961,121.02028862614023\n2005-08-08,123.41,122.38,122.42,123.17,132.3,-132.3,-132.3,-132.3,-132.3,122.0354626497876\n2005-08-09,123.59,122.87,123.34,123.05,132.3,-132.3,-132.3,-132.3,-132.3,122.38\n2005-08-10,124.5,122.82,123.12,123.83,132.10160000000002,-132.10160000000002,-132.00240000000002,-132.00240000000002,-132.00240000000002,122.38\n2005-08-11,124.03,122.22,123.97,123.27,131.907168,-131.907168,-131.71372800000003,-131.71372800000003,-131.71372800000003,-134.946\n2005-08-12,129.3,122.75,123.24,123.57,131.51968128000001,-131.51968128000001,-131.23904160000004,-131.23904160000004,-131.23904160000004,-134.56422\n2005-08-15,123.87,122.02,123.65,123.2,131.1476940288,-131.1476940288,-130.78808952000003,-130.78808952000003,-130.78808952000003,-134.1938934\n2005-08-16,123.52,115.88,122.13,123.44,130.600032387072,-130.600032387072,-130.17432325360002,-130.17432325360002,-130.17432325360002,-133.58519873\n2005-08-17,122.87,122.03,122.29,122.19,129.42242979610623,-129.42242979610623,-128.887834160776,-128.887834160776,-128.887834160776,-132.3458348189\n2005-08-18,122.56,121.84,122.11,122.04,128.33903541241773,-128.33903541241773,-127.71712908630617,-127.71712908630617,-127.71712908630617,-131.19322638157698\n2005-08-19,122.82,122.2,122.27,122.63,127.34231257942432,-127.34231257942432,-126.65178746853861,-126.65178746853861,-126.65178746853861,-130.12130053486658\n2005-08-22,123.23,121.88,122.47,122.58,126.42532757307038,-126.42532757307038,-125.68232659637013,-125.68232659637013,-125.68232659637013,-129.12440949742592\n2005-08-23,122.61,121.67,122.05,122.51,125.58170136722475,-125.58170136722475,-124.80011720269682,-124.80011720269682,-124.80011720269682,-128.1973008326061\n2005-08-24,122.73,121.19,121.24,121.94,124.80556525784677,-124.80556525784677,-123.9973066544541,-123.9973066544541,-123.9973066544541,-127.33508977432366\n2005-08-25,121.67,121.21,121.53,121.34,124.09152003721903,-124.09152003721903,-123.26674905555323,-123.26674905555323,-123.26674905555323,-126.533233490121\n2005-08-26,122.24,120.68,120.82,121.48,123.43459843424151,-123.43459843424151,-122.73,-122.73,-122.73,-125.78750714581254\n2005-08-29,121.78,120.38,121.6,120.41,122.83023055950218,-122.83023055950218,-122.24,-122.24,-122.24,-125.09398164560567\n2005-08-30,121.62,120.39,121.18,121.25,122.27421211474201,-122.27421211474201,-122.24,-122.24,-122.24,-124.44900293041327\n2005-08-31,123.33,120.0,122.39,121.19,115.88,115.88,115.88,115.88,115.88,-123.84917272528435\n2005-09-01,123.15,119.62,122.54,122.49,116.029,116.029,116.029,116.029,116.029,-123.33\n2005-09-02,122.88,122.1,122.13,122.83,116.17501999999999,116.17501999999999,116.17501999999999,116.17501999999999,116.17501999999999,-123.33\n2005-09-06,123.76,105.68,123.75,122.67,123.76,-123.76,-123.76,-123.76,-123.76,103.5664\n2005-09-07,124.13,122.86,124.02,123.63,105.68,105.68,105.68,105.68,105.68,103.97027200000001\n2005-09-08,124.0,123.31,123.58,123.66,105.68,105.68,105.68,105.68,105.68,104.57506384000001\n2005-09-09,124.74,123.8,124.48,123.83,106.049,106.049,106.049,106.049,106.049,105.16171192480002\n2005-09-12,124.67,124.27,124.43,124.44,106.79664000000001,106.79664000000001,106.60973000000001,106.60973000000001,106.60973000000001,105.94484344780801\n2005-09-13,124.42,123.52,123.55,124.13,107.51437440000001,107.51437440000001,107.15363810000001,107.15363810000001,107.15363810000001,106.6966497098957\n2005-09-14,123.92,123.02,123.18,123.75,108.20339942400001,108.20339942400001,107.681228957,107.681228957,107.681228957,107.41838372149986\n2005-09-15,123.65,122.9,123.22,123.49,108.86486344704001,108.86486344704001,108.19299208829,108.19299208829,108.19299208829,108.11124837263986\n2005-09-16,123.74,122.87,123.7,123.28,109.49986890915841,109.49986890915841,108.6894023256413,108.6894023256413,108.6894023256413,108.77639843773427\n2005-09-19,123.7,122.64,122.96,123.45,110.10947415279207,110.10947415279207,109.17092025587206,109.17092025587206,109.17092025587206,109.4149425002249\n2005-09-20,123.7,121.87,122.1,123.21,110.69469518668039,110.69469518668039,109.6379926481959,109.6379926481959,109.6379926481959,110.0279448002159\n2005-09-21,131.37,120.86,120.89,121.81,111.25650737921318,111.25650737921318,110.09105286875003,110.09105286875003,110.09105286875003,110.61642700820727\n2005-09-22,121.66,120.44,121.44,120.95,112.46331693646039,112.46331693646039,110.94221075400003,110.94221075400003,110.94221075400003,111.6541056577969\n2005-09-23,121.89,120.9,121.56,121.24,113.59771792027277,113.59771792027277,111.75932232384002,111.75932232384002,111.75932232384002,112.63990037490706\n2005-09-26,122.78,121.0,121.47,122.04,114.6640548450564,114.6640548450564,112.54374943088642,112.54374943088642,112.54374943088642,113.5764053561617\n2005-09-27,121.99,121.02,121.5,121.52,115.66641155435302,115.66641155435302,113.29679945365096,113.29679945365096,113.29679945365096,114.46608508835362\n2005-09-28,122.12,121.2,121.68,121.91,116.60862686109184,116.60862686109184,114.01972747550492,114.01972747550492,114.01972747550492,115.31128083393594\n2005-09-29,122.86,121.08,122.81,121.57,117.49430924942632,117.49430924942632,114.71373837648473,114.71373837648473,114.71373837648473,116.11421679223915\n2005-09-30,122.97,120.69,122.82,122.61,118.32685069446075,118.32685069446075,115.37998884142534,115.37998884142534,115.37998884142534,116.87700595262719\n2005-10-03,123.34,122.45,122.68,122.95,119.1094396527931,119.1094396527931,116.01958928776833,116.01958928776833,116.01958928776833,117.60165565499582\n2005-10-04,123.03,121.33,121.38,122.79,119.84507327362552,119.84507327362552,116.63360571625759,116.63360571625759,116.63360571625759,118.29007287224603\n2005-10-05,122.67,112.09,119.63,121.31,131.37,-131.37,-131.37,-131.37,-131.37,-133.9974\n2005-10-06,120.26,118.17,119.15,119.78,130.9844,-130.9844,-130.79160000000002,-130.79160000000002,-130.79160000000002,-133.340178\n2005-10-07,120.05,119.13,119.67,119.7,130.60651199999998,-130.60651199999998,-130.23055200000002,-130.23055200000002,-130.23055200000002,-132.70267266000002\n2005-10-10,119.71,117.19,118.77,119.69,130.23618176,-130.23618176,-129.68633544000002,-129.68633544000002,-129.68633544000002,-132.08429248020002\n2005-10-11,119.39,118.32,118.54,118.99,129.8732581248,-129.8732581248,-129.15844537680002,-129.15844537680002,-129.15844537680002,-131.484463705794\n2005-10-12,119.13,117.41,117.85,118.39,129.517592962304,-129.517592962304,-128.64639201549602,-128.64639201549602,-128.64639201549602,-130.9026297946202\n2005-10-13,118.08,116.88,117.77,117.46,129.16904110305794,-129.16904110305794,-128.14970025503115,-128.14970025503115,-128.14970025503115,-130.3382509007816\n2005-10-14,118.81,117.56,118.75,118.12,128.82746028099677,-128.82746028099677,-127.66790924738021,-127.66790924738021,-127.66790924738021,-129.79080337375814\n2005-10-17,119.27,118.0,119.07,118.76,128.49271107537683,-128.49271107537683,-127.2005719699588,-127.2005719699588,-127.2005719699588,-129.2597792725454\n2005-10-18,118.96,117.87,117.9,118.95,128.1646568538693,-128.1646568538693,-126.74725481086004,-126.74725481086004,-126.74725481086004,-128.744685894369\n2005-10-19,119.66,116.65,119.64,117.56,127.84316371679192,-127.84316371679192,-126.30753716653425,-126.30753716653425,-126.30753716653425,-128.24504531753794\n2005-10-20,119.81,117.3,117.72,119.51,127.52810044245608,-127.52810044245608,-125.88101105153822,-125.88101105153822,-125.88101105153822,-127.7603939580118\n2005-10-21,118.78,117.51,118.02,118.27,127.21933843360696,-127.21933843360696,-125.46728071999208,-125.46728071999208,-125.46728071999208,-127.29028213927145\n2005-10-24,120.06,118.41,120.04,118.44,126.91675166493482,-126.91675166493482,-125.06596229839231,-125.06596229839231,-125.06596229839231,-126.83427367509331\n2005-10-25,120.24,118.94,119.74,119.71,126.62021663163613,-126.62021663163613,-124.67668342944054,-124.67668342944054,-124.67668342944054,-126.39194546484052\n2005-10-26,120.54,119.19,119.24,119.5,126.3296122990034,-126.3296122990034,-124.29908292655733,-124.29908292655733,-124.29908292655733,-125.9628871008953\n2005-10-27,119.37,109.22,117.97,119.21,126.04482005302333,-126.04482005302333,-123.93281043876061,-123.93281043876061,-123.93281043876061,-125.54670048786845\n2005-10-28,119.95,118.1,119.9,118.42,125.3718272509024,-125.3718272509024,-123.19716991682259,-123.19716991682259,-123.19716991682259,-124.73036546347502\n2005-10-31,121.3,117.96,120.71,120.29,124.7257541608663,-124.7257541608663,-122.49831142098145,-122.49831142098145,-122.49831142098145,-123.95484719030128\n2005-11-01,120.9,120.22,120.3,120.56,124.10552399443165,-124.10552399443165,-121.83439584993238,-121.83439584993238,-121.83439584993238,-123.21810483078622\n2005-11-02,121.66,120.0,121.63,120.17,123.51010303465438,-123.51010303465438,109.22,109.22,109.22,-122.5181995892469\n2005-11-03,122.66,121.75,122.15,122.15,122.9384989132682,-122.9384989132682,109.4688,109.4688,109.4688,107.0356\n2005-11-04,122.46,121.55,122.11,122.4,122.66,-122.66,109.864536,109.864536,109.864536,107.348088\n2005-11-07,122.62,121.85,122.44,122.4,122.66,-122.66,110.24839992,110.24839992,110.24839992,107.65432624\n2005-11-08,122.49,121.79,122.07,121.95,122.62,-122.62,110.6207479224,110.6207479224,110.6207479224,107.95443971520001\n2005-11-09,122.95,120.05,122.25,122.08,109.22,109.22,110.981925484728,110.981925484728,110.981925484728,108.24855092089601\n2005-11-10,123.52,121.0,123.35,122.36,109.4946,109.4946,111.46064846533888,111.46064846533888,111.46064846533888,108.68959439326913\n2005-11-11,123.84,123.28,123.65,123.35,110.055616,110.055616,112.06361604207193,112.06361604207193,112.06361604207193,109.28281061753837\n2005-11-14,124.02,123.37,123.67,123.76,110.88267904,110.88267904,112.77019907954761,112.77019907954761,112.77019907954761,110.01067008666145\n2005-11-15,124.09,122.86,123.16,123.57,111.9336647168,111.9336647168,113.55768514397927,113.55768514397927,113.55768514397927,110.85122988146176\n2005-11-16,123.55,122.98,123.47,123.39,113.14929824512,113.14929824512,114.40027033246093,114.40027033246093,114.40027033246093,111.77794378975943\n2005-11-17,124.62,123.24,124.53,123.76,114.243368420608,114.243368420608,115.17544870586406,115.17544870586406,115.17544870586406,112.63978772447628\n2005-11-18,126.06,124.33,125.09,125.02,115.48856421013504,115.48856421013504,116.02545832233629,116.02545832233629,116.02545832233629,113.59820470651817\n2005-11-21,125.91,124.98,125.78,125.16,116.96856522071613,116.96856522071613,117.02891249010267,117.02891249010267,117.02891249010267,114.71976628293154\n2005-11-22,126.52,125.42,126.37,125.56,118.24136608981587,118.24136608981587,117.9320212410924,117.9320212410924,117.9320212410924,115.74038731746771\n2005-11-23,127.41,125.55,126.88,126.25,119.56594751544533,119.56594751544533,118.87669890457224,118.87669890457224,118.87669890457224,116.81834858572094\n2005-11-25,127.22,126.81,127.05,126.98,120.97787696266516,120.97787696266516,119.90069503602356,119.90069503602356,119.90069503602356,117.98343024129164\n2005-11-28,129.69,125.56,126.15,127.25,122.13565910938543,122.13565910938543,120.80181163170073,120.80181163170073,120.80181163170073,119.02035291474957\n2005-11-29,126.98,126.09,126.12,126.63,123.64652728750835,123.64652728750835,121.95727611957963,121.95727611957963,121.95727611957963,120.30071056497962\n2005-11-30,126.52,125.01,125.33,126.14,124.85522183000668,124.85522183000668,122.96253022403428,122.96253022403428,122.96253022403428,121.42742529718207\n2005-12-01,127.32,125.41,126.91,126.02,125.01,125.01,123.83710129490983,123.83710129490983,123.83710129490983,122.41893426152022\n2005-12-02,127.08,126.5,126.87,126.77,125.01,125.01,124.59797812657155,124.59797812657155,124.59797812657155,123.29146215013779\n2005-12-05,126.9,123.34,126.64,126.64,129.69,-129.69,-129.69,-129.69,-129.69,-132.28379999999999\n2005-12-06,127.74,126.6,126.73,127.04,129.563,-129.563,-129.4995,-129.4995,-129.4995,-132.01548599999998\n2005-12-07,126.87,125.68,126.15,126.77,129.43854,-129.43854,-129.314715,-129.314715,-129.314715,-131.75522141999997\n2005-12-08,126.82,125.48,126.03,126.22,129.3165692,-129.3165692,-129.13547355,-129.13547355,-129.13547355,-131.50276477739996\n2005-12-09,126.78,125.82,126.41,126.17,129.197037816,-129.197037816,-128.9616093435,-128.9616093435,-128.9616093435,-131.25788183407795\n2005-12-12,126.86,125.96,126.5,126.71,129.07989705968,-129.07989705968,-128.79296106319498,-128.79296106319498,-128.79296106319498,-131.0203453790556\n2005-12-13,137.32,126.29,127.17,126.4,123.34,123.34,123.34,123.34,123.34,120.8732\n2005-12-14,128.09,121.71,127.76,127.2,137.32,-137.32,-137.32,-137.32,-137.32,121.202136\n2005-12-15,128.0,127.18,127.53,127.84,137.32,-137.32,-137.32,-137.32,-137.32,121.52449328\n2005-12-16,128.57,126.49,126.6,127.27,137.0078,-137.0078,-136.8517,-136.8517,-136.8517,121.71\n2005-12-19,126.87,125.69,125.78,126.73,136.701844,-136.701844,-136.397449,-136.397449,-136.397449,122.0222\n2005-12-20,126.22,125.48,125.77,125.86,136.40200712,-136.40200712,-135.95682553,-135.95682553,-135.95682553,122.32815599999999\n2005-12-21,126.76,125.8,126.12,126.17,136.1081669776,-136.1081669776,-135.5294207641,-135.5294207641,-135.5294207641,122.62799288\n2005-12-22,126.66,126.08,126.66,126.31,135.820203638048,-135.820203638048,-135.114838141177,-135.114838141177,-135.114838141177,122.9218330224\n2005-12-23,126.86,126.3,126.75,126.8,135.53799956528707,-135.53799956528707,-134.71269299694168,-134.71269299694168,-134.71269299694168,123.20979636195199\n2005-12-27,127.05,125.48,125.51,126.92,135.26143957398133,-135.26143957398133,-134.32261220703344,-134.32261220703344,-134.32261220703344,123.49200043471295\n2005-12-28,125.99,125.5,125.61,125.74,134.9904107825017,-134.9904107825017,-133.94423384082245,-133.94423384082245,-133.94423384082245,123.7685604260187\n2005-12-29,125.96,125.25,125.31,125.72,134.72480256685165,-134.72480256685165,-133.57720682559778,-133.57720682559778,-133.57720682559778,124.03958921749832\n2005-12-30,125.31,124.5,124.55,125.0,134.4645065155146,-134.4645065155146,-133.22119062082984,-133.22119062082984,-133.22119062082984,124.30519743314835\n2006-01-03,127.0,124.39,126.75,125.1,134.20941638520432,-134.20941638520432,-132.87585490220494,-132.87585490220494,-132.87585490220494,-140.0664\n2006-01-04,127.49,126.7,127.27,126.83,133.95942805750025,-133.95942805750025,-132.54087925513878,-132.54087925513878,-132.54087925513878,-139.596108\n2006-01-05,127.59,126.88,127.23,127.17,133.71443949635025,-133.71443949635025,-132.21595287748463,-132.21595287748463,-132.21595287748463,-139.13992475999999\n2006-01-06,128.58,127.28,128.41,128.04,133.47435070642325,-133.47435070642325,-131.90077429116008,-131.90077429116008,-131.90077429116008,-138.6974270172\n2006-01-09,129.06,125.78,128.92,128.42,133.2390636922948,-133.2390636922948,-131.59505106242528,-131.59505106242528,-131.59505106242528,-138.268204206684\n2006-01-10,128.97,128.26,128.88,128.4,133.0084824184489,-133.0084824184489,-131.29849953055253,-131.29849953055253,-131.29849953055253,-137.85185808048348\n2006-01-11,129.44,128.73,129.35,129.02,132.7825127700799,-132.7825127700799,-131.01084454463594,-131.01084454463594,-131.01084454463594,-137.448002338069\n2006-01-12,129.28,128.44,128.59,129.08,132.5610625146783,-132.5610625146783,-130.73181920829686,-130.73181920829686,-130.73181920829686,-137.0562622679269\n2006-01-13,128.9,128.2,128.72,128.57,132.34404126438474,-132.34404126438474,-130.46116463204794,-130.46116463204794,-130.46116463204794,-136.6762743998891\n2006-01-17,128.42,126.11,128.25,128.2,132.13136043909705,-132.13136043909705,-130.1986296930865,-130.1986296930865,-130.1986296930865,-136.30768616789243\n2006-01-18,128.26,126.53,127.79,127.59,131.92293323031512,-131.92293323031512,-129.9439708022939,-129.9439708022939,-129.9439708022939,-135.95015558285564\n2006-01-19,128.77,127.81,128.37,128.09,131.71867456570882,-131.71867456570882,-129.69695167822508,-129.69695167822508,-129.69695167822508,-135.60335091537\n2006-01-20,128.47,120.89,126.12,128.28,131.51850107439463,-131.51850107439463,-129.45734312787832,-129.45734312787832,-129.45734312787832,-135.26695038790888\n2006-01-23,126.82,126.12,126.33,126.21,131.09336103141885,-131.09336103141885,-129.0289759714844,-129.0289759714844,-129.0289759714844,-134.54810286851344\n2006-01-24,127.15,125.91,126.62,126.63,130.6852265901621,-130.6852265901621,-128.62202717291018,-128.62202717291018,-128.62202717291018,-133.86519772508777\n2006-01-25,127.88,125.84,126.47,127.04,130.29341752655563,-130.29341752655563,-128.23542581426466,-128.23542581426466,-128.23542581426466,-133.21643783883337\n2006-01-26,127.67,126.44,127.41,127.28,129.9172808254934,-129.9172808254934,-127.88,-127.88,-127.88,-132.6001159468917\n2006-01-27,128.66,127.45,128.31,127.65,129.55618959247366,-129.55618959247366,120.89,120.89,120.89,-132.0146101495471\n2006-01-30,128.81,128.35,128.53,128.44,129.20954200877472,-129.20954200877472,121.0454,121.0454,121.0454,-131.45837964206976\n2006-01-31,128.54,127.65,127.95,128.34,128.87676032842373,-128.87676032842373,121.278338,121.278338,121.278338,-130.92996065996627\n2006-02-01,128.35,127.72,128.23,127.82,128.81,-128.81,121.50428786,121.50428786,121.50428786,-130.42796262696797\n2006-02-02,128.15,126.8,127.11,128.1,128.54,-128.54,121.7234592242,121.7234592242,121.7234592242,-129.95106449561956\n2006-02-03,128.6,126.14,126.41,126.61,120.89,120.89,121.936055447474,121.936055447474,121.936055447474,-129.4980112708386\n2006-02-06,126.8,126.17,126.56,126.44,121.0442,121.0442,122.14227378404978,122.14227378404978,122.14227378404978,-129.06761070729667\n2006-02-07,126.66,125.4,125.57,126.39,121.195316,121.195316,122.34230557052828,122.34230557052828,122.34230557052828,-128.65873017193184\n2006-02-08,127.75,125.6,126.63,125.89,121.34340968000001,121.34340968000001,122.53633640341243,122.53633640341243,122.53633640341243,-128.27029366333525\n2006-02-09,137.33,126.37,126.5,126.91,121.48854148640001,121.48854148640001,122.72454631131006,122.72454631131006,122.72454631131006,118.4722\n2006-02-10,127.13,125.55,126.82,126.44,122.12219982694401,122.12219982694401,123.30876445885767,123.30876445885767,123.30876445885767,118.849356\n2006-02-13,126.79,125.95,126.46,126.57,122.73051183386625,122.73051183386625,123.86961388050337,123.86961388050337,123.86961388050337,119.21896888\n2006-02-14,128.03,126.19,127.71,126.46,123.3144913605116,123.3144913605116,124.40802932528324,124.40802932528324,124.40802932528324,119.58118950240001\n2006-02-15,128.32,127.24,128.14,127.66,123.87511170609113,123.87511170609113,124.92490815227191,124.92490815227191,124.92490815227191,119.93616571235201\n2006-02-16,129.12,128.18,129.08,128.34,124.41330723784749,124.41330723784749,125.42111182618103,125.42111182618103,125.42111182618103,120.28404239810497\n2006-02-17,129.98,128.56,128.88,129.07,124.9299749483336,124.9299749483336,125.89746735313379,125.89746735313379,125.89746735313379,120.62496155014287\n2006-02-21,129.4,128.29,128.52,129.12,125.42597595040026,125.42597595040026,126.35476865900844,126.35476865900844,126.35476865900844,120.95906231914002\n2006-02-22,129.65,128.65,129.43,128.77,125.90213691238425,125.90213691238425,126.79377791264811,126.79377791264811,126.79377791264811,121.28648107275721\n2006-02-23,129.64,128.54,129.01,129.27,126.35925143588888,126.35925143588888,127.21522679614219,127.21522679614219,127.21522679614219,121.60735145130207\n2006-02-24,129.48,128.76,129.23,129.14,126.79808137845332,126.79808137845332,127.6198177242965,127.6198177242965,127.6198177242965,121.92180442227603\n2006-02-27,130.04,129.28,129.69,129.4,127.21935812331519,127.21935812331519,128.00822501532463,128.00822501532463,128.00822501532463,122.2299683338305\n2006-02-28,129.68,128.13,128.26,129.19,127.62378379838258,127.62378379838258,-137.33,-137.33,-137.33,122.53196896715389\n2006-03-01,129.49,128.5,129.39,128.6,128.01203244644728,128.01203244644728,-137.054,-137.054,-137.054,122.82792958781081\n2006-03-02,129.43,128.61,129.22,128.88,128.13,128.13,-136.78628,-136.78628,-136.78628,123.1179709960546\n2006-03-03,130.07,128.65,128.99,128.67,128.498,128.498,-136.52659160000002,-136.52659160000002,-136.52659160000002,123.40221157613351\n2006-03-06,129.18,127.85,128.15,129.14,137.33,-137.33,-136.274693852,-136.274693852,-136.274693852,123.68076734461084\n2006-03-07,129.9,127.4,127.86,127.91,137.1404,-137.1404,-135.85345915940002,-135.85345915940002,-135.85345915940002,123.95375199771863\n2006-03-08,128.44,127.18,128.17,127.7,136.750784,-136.750784,-135.26171701824202,-135.26171701824202,-135.26171701824202,124.22127695776426\n2006-03-09,128.68,127.57,127.57,128.34,136.17653696000002,-136.17653696000002,-134.53436248660023,-134.53436248660023,-134.53436248660023,124.48345141860898\n2006-03-10,128.84,127.37,128.52,127.7,135.63674474240003,-135.63674474240003,-133.8724698628062,-133.8724698628062,-133.8724698628062,124.7403823902368\n2006-03-13,129.16,128.53,128.82,128.84,135.129340057856,-135.129340057856,-133.27014757515366,-133.27014757515366,-133.27014757515366,124.99217474243207\n2006-03-14,130.23,128.56,130.12,128.71,134.65237965438465,-134.65237965438465,-132.72203429338984,-132.72203429338984,-132.72203429338984,125.23893124758342\n2006-03-15,130.86,129.85,130.77,130.15,134.20403687512157,-134.20403687512157,-132.22325120698474,-132.22325120698474,-132.22325120698474,125.48075262263175\n2006-03-16,131.47,130.71,131.01,130.98,133.7825946626143,-133.7825946626143,-131.76935859835612,-131.76935859835612,-131.76935859835612,125.71773757017912\n2006-03-17,131.11,130.38,130.58,130.68,133.38643898285744,-133.38643898285744,-131.47,-131.47,-131.47,125.94998281877554\n2006-03-20,130.9,130.21,130.39,130.64,133.014052643886,-133.014052643886,-131.47,-131.47,-131.47,126.17758316240003\n2006-03-21,130.99,129.45,129.59,130.34,132.66400948525285,-132.66400948525285,-131.11,-131.11,-131.11,126.40063149915203\n2006-03-22,130.51,129.45,130.42,129.51,132.33496891613768,-132.33496891613768,-130.99,-130.99,-130.99,126.61921886916899\n2006-03-23,130.88,129.66,130.08,130.24,132.02567078116942,-132.02567078116942,-130.99,-130.99,-130.99,126.83343449178561\n2006-03-24,130.57,128.96,130.15,129.99,131.73493053429925,-131.73493053429925,-130.88,-130.88,-130.88,127.0433658019499\n2006-03-27,130.28,129.74,130.08,130.03,131.4616347022413,-131.4616347022413,-130.88,-130.88,-130.88,127.2490984859109\n2006-03-28,130.53,128.55,129.22,129.93,131.20473662010681,-131.20473662010681,-130.57,-130.57,-130.57,127.45071651619268\n2006-03-29,130.5,129.14,130.21,129.4,130.9632524229004,-130.9632524229004,-130.53,-130.53,-130.53,127.64830218586883\n2006-03-30,130.98,129.55,129.95,130.11,127.18,127.18,127.18,127.18,127.18,127.84193614215145\n2006-03-31,130.24,129.37,129.49,130.03,127.256,127.256,127.256,127.256,127.256,128.03169741930841\n2006-04-03,130.87,129.49,129.69,130.07,127.33048,127.33048,127.33048,127.33048,127.33048,128.21766347092225\n2006-04-04,130.73,129.36,130.53,129.73,127.40347039999999,127.40347039999999,127.40347039999999,127.40347039999999,127.40347039999999,128.39991020150381\n2006-04-05,131.28,130.0,131.05,130.62,127.47500099199999,127.47500099199999,127.47500099199999,127.47500099199999,127.47500099199999,128.57851199747373\n2006-04-06,131.21,130.0,130.82,130.85,127.62720095232,127.62720095232,127.58915096224,127.58915096224,127.58915096224,128.75354175752426\n2006-04-07,131.4,129.35,129.47,131.06,127.77331291422719,127.77331291422719,127.6998764333728,127.6998764333728,127.6998764333728,128.92507092237378\n2006-04-10,130.08,129.26,129.6,129.71,127.99091413937356,127.99091413937356,127.84788137603788,127.84788137603788,127.84788137603788,129.0931695039263\n2006-04-11,130.06,128.25,128.65,129.86,128.19545929101113,128.19545929101113,127.98996612099636,127.98996612099636,127.98996612099636,-140.0766\n2006-04-12,129.13,128.61,128.84,128.77,128.25,128.25,128.1263674761565,128.1263674761565,128.1263674761565,-139.72180200000003\n2006-04-13,129.25,128.1,128.86,128.59,131.4,-131.4,-131.4,-131.4,-131.4,-139.37764794000003\n2006-04-17,129.9,128.02,128.52,128.79,131.334,-131.334,-131.30100000000002,-131.30100000000002,-131.30100000000002,-138.81376554300002\n2006-04-18,130.94,128.54,130.73,128.96,131.20144,-131.20144,-131.13695,-131.13695,-131.13695,-138.05820195499\n2006-04-19,139.41,130.24,130.99,130.72,128.02,128.02,128.02,128.02,128.02,125.45960000000001\n2006-04-20,134.34,130.6,131.15,131.0,128.2478,128.2478,128.2478,128.2478,128.2478,125.73860800000001\n2006-04-21,132.03,130.62,131.1,131.74,128.471044,128.471044,128.471044,128.471044,128.471044,126.01203584000001\n2006-04-24,131.14,130.38,130.83,130.92,128.68982312,128.68982312,128.68982312,128.68982312,128.68982312,126.27999512320001\n2006-04-25,131.12,129.92,130.23,131.05,128.9042266576,128.9042266576,128.9042266576,128.9042266576,128.9042266576,126.542595220736\n2006-04-26,131.14,130.2,130.58,130.5,129.114342124448,129.114342124448,129.114342124448,129.114342124448,129.114342124448,126.79994331632129\n2006-04-27,131.63,129.59,131.16,129.9,129.32025528195905,129.32025528195905,129.32025528195905,129.32025528195905,129.32025528195905,127.05214444999487\n2006-04-28,131.75,130.71,131.14,130.79,129.52205017631988,129.52205017631988,129.52205017631988,129.52205017631988,129.52205017631988,127.29930156099498\n2006-05-01,131.88,130.32,130.56,131.46,129.59,129.59,129.59,129.59,129.59,127.54151552977508\n2006-05-02,131.46,130.74,131.38,131.0,129.78640000000001,129.78640000000001,129.78640000000001,129.78640000000001,129.78640000000001,127.77888521917959\n2006-05-03,131.32,130.45,130.82,131.2,129.97887200000002,129.97887200000002,129.97887200000002,129.97887200000002,129.97887200000002,128.011507514796\n2006-05-04,131.62,130.97,131.29,131.06,130.16749456000002,130.16749456000002,130.16749456000002,130.16749456000002,130.16749456000002,128.23947736450006\n2006-05-05,132.8,131.31,132.71,132.04,130.35234466880001,130.35234466880001,130.35234466880001,130.35234466880001,130.35234466880001,128.46288781721006\n2006-05-08,132.77,132.37,132.56,132.52,130.53349777542402,130.53349777542402,130.53349777542402,130.53349777542402,130.53349777542402,128.68183006086585\n2006-05-09,132.77,132.31,132.53,132.43,130.71102781991556,130.71102781991556,130.71102781991556,130.71102781991556,130.71102781991556,128.89639345964852\n2006-05-10,133.33,131.89,132.43,132.41,130.88500726351725,130.88500726351725,130.88500726351725,130.88500726351725,130.88500726351725,129.10666559045555\n2006-05-11,132.55,130.52,130.78,132.5,139.41,-139.41,-139.41,-139.41,-139.41,129.31273227864645\n2006-05-12,130.78,129.19,129.25,130.46,139.2322,-139.2322,-139.1433,-139.1433,-139.1433,-142.19819999999999\n2006-05-15,129.71,128.63,129.62,128.79,138.830512,-138.830512,-138.645635,-138.645635,-138.645635,-141.807954\n2006-05-16,130.79,129.01,129.36,129.76,138.21848128,-138.21848128,-137.94454055,-137.94454055,-137.94454055,-141.14905629999998\n2006-05-17,129.09,126.95,127.2,128.67,137.6431724032,-137.6431724032,-137.2925227115,-137.2925227115,-137.2925227115,-140.52310348499998\n2006-05-18,127.75,126.36,126.36,127.38,136.787718610944,-136.787718610944,-136.361695667465,-136.361695667465,-136.361695667465,-139.57298624105\n2006-05-19,127.48,125.83,126.96,126.87,135.74494674984962,-135.74494674984962,-135.26150914404386,-135.26150914404386,-135.26150914404386,-138.38381747935549\n2006-05-22,127.17,125.5,126.98,126.28,134.55515313986766,-134.55515313986766,-134.03541295531815,-134.03541295531815,-134.03541295531815,-137.00289755662638\n2006-05-23,127.63,125.81,125.9,127.18,133.2874317002862,-133.2874317002862,-132.75510101202042,-132.75510101202042,-132.75510101202042,-135.50752087426494\n2006-05-24,126.73,124.76,126.08,125.68,132.19719126224612,-132.19719126224612,-131.66683586021736,-131.66683586021736,-131.66683586021736,-134.2065431606105\n2006-05-25,127.66,126.45,127.63,126.92,131.00724066028675,-131.00724066028675,-130.4926737639804,-130.4926737639804,-130.4926737639804,-132.7895616865189\n2006-05-26,128.37,127.51,128.3,128.0,130.00768215464086,-130.00768215464086,-129.51811922410374,-129.51811922410374,-129.51811922410374,-131.58512743354106\n2006-05-30,128.05,126.26,126.28,127.97,129.16805300989833,-129.16805300989833,-128.70923895600612,-128.70923895600612,-128.70923895600612,-130.5613583185099\n2006-05-31,127.38,126.2,127.3,126.58,128.4627645283146,-128.4627645283146,-128.37,-128.37,-128.37,-129.6911545707334\n2006-06-01,128.94,127.27,128.82,127.38,124.76,124.76,124.76,124.76,124.76,-128.9514813851234\n2006-06-02,129.43,128.32,129.13,129.25,124.84360000000001,124.84360000000001,124.84360000000001,124.84360000000001,124.84360000000001,122.26480000000001\n2006-06-05,128.86,126.77,126.9,128.79,125.02705600000002,125.02705600000002,124.98119200000001,124.98119200000001,124.98119200000001,122.40810400000001\n2006-06-06,127.95,125.76,126.75,127.21,125.20317376000001,125.20317376000001,125.11465624,125.11465624,125.11465624,122.54854192\n2006-06-07,127.65,125.91,125.91,126.91,125.37224680960001,125.37224680960001,125.24411655280001,125.24411655280001,125.24411655280001,122.68617108160001\n2006-06-08,126.5,123.0,126.14,125.58,129.43,-129.43,-129.43,-129.43,-129.43,122.821047659968\n2006-06-09,126.67,125.34,125.53,126.36,129.3014,-129.3014,-129.2371,-129.2371,-129.2371,122.95322670676865\n2006-06-12,125.93,123.98,124.0,125.89,129.175372,-129.175372,-129.049987,-129.049987,-129.049987,123.0\n2006-06-13,124.84,122.67,122.73,123.78,129.05186456,-129.05186456,-128.86848738999998,-128.86848738999998,-128.86848738999998,-132.01860000000002\n2006-06-14,123.63,122.34,123.49,122.84,128.7965899776,-128.7965899776,-128.55856302049997,-128.55856302049997,-128.55856302049997,-131.738142\n2006-06-15,126.36,123.87,125.97,123.9,128.409194578944,-128.409194578944,-128.12326360906496,-128.12326360906496,-128.12326360906496,-131.2682349\n2006-06-16,125.56,124.46,125.0,125.19,128.04504290420738,-128.04504290420738,-127.71843515643042,-127.71843515643042,-127.71843515643042,-130.821823155\n2006-06-19,125.75,123.55,123.82,125.4,127.70274032995493,-127.70274032995493,-127.3419446954803,-127.3419446954803,-127.3419446954803,-130.39773199725\n2006-06-20,124.8,123.72,123.88,124.01,127.38097591015764,-127.38097591015764,-126.99180856679668,-126.99180856679668,-126.99180856679668,-129.99484539738748\n2006-06-21,125.7,123.96,125.13,124.0,127.07851735554819,-127.07851735554819,-126.6661819671209,-126.6661819671209,-126.6661819671209,-129.6121031275181\n2006-06-22,125.06,124.04,124.45,124.95,126.7942063142153,-126.7942063142153,-126.36334922942244,-126.36334922942244,-126.36334922942244,-129.2484979711422\n2006-06-23,125.29,124.03,124.39,124.33,126.52695393536239,-126.52695393536239,-126.08171478336287,-126.08171478336287,-126.08171478336287,-128.9030730725851\n2006-06-26,125.05,124.25,125.04,124.54,126.27573669924064,-126.27573669924064,-125.81979474852747,-125.81979474852747,-125.81979474852747,-128.57491941895586\n2006-06-27,125.29,123.77,123.87,125.01,126.03959249728621,-126.03959249728621,-125.57620911613054,-125.57620911613054,-125.57620911613054,-128.26317344800808\n2006-06-28,124.71,123.65,124.58,124.18,125.81761694744904,-125.81761694744904,-125.3496744780014,-125.3496744780014,-125.3496744780014,-127.96701477560767\n2006-06-29,127.28,125.17,127.23,125.19,122.34,122.34,122.34,122.34,122.34,-127.68566403682728\n2006-06-30,127.66,126.97,127.01,127.47,122.4388,122.4388,122.4388,122.4388,122.4388,119.89320000000001\n2006-07-03,128.01,127.31,127.9,127.43,122.647648,122.647648,122.595436,122.595436,122.595436,120.04853600000001\n2006-07-05,127.45,126.52,127.03,127.29,122.96938912,122.96938912,122.81201856000001,122.81201856000001,122.81201856000001,120.28737992\n2006-07-06,127.85,127.08,127.37,127.2,123.2718257728,123.2718257728,123.01993781760001,123.01993781760001,123.01993781760001,120.5190585224\n2006-07-07,127.56,126.3,126.53,127.2,123.556116226432,123.556116226432,123.21954030489601,123.21954030489601,123.21954030489601,120.74378676672801\n2006-07-10,127.43,126.41,126.74,126.94,123.82334925284607,123.82334925284607,123.41115869270017,123.41115869270017,123.41115869270017,120.96177316372616\n2006-07-11,127.41,125.94,127.27,126.61,124.0745482976753,124.0745482976753,123.59511234499216,123.59511234499216,123.59511234499216,121.17321996881438\n2006-07-12,127.4,125.72,125.96,127.21,124.31067539981478,124.31067539981478,123.77170785119247,123.77170785119247,123.77170785119247,121.37832336974995\n2006-07-13,125.68,124.13,124.21,125.48,128.01,-128.01,123.94123953714478,123.94123953714478,123.94123953714478,121.57727366865745\n2006-07-14,124.26,122.83,123.63,124.15,127.93239999999999,-127.93239999999999,-128.01,-128.01,-128.01,121.77025545859773\n2006-07-17,124.1,123.15,123.43,123.5,127.728304,-127.728304,-127.85459999999999,-127.85459999999999,-127.85459999999999,121.9574477948398\n2006-07-18,124.05,122.39,123.68,123.75,127.53237184,-127.53237184,-127.70386199999999,-127.70386199999999,-127.70386199999999,122.1390243609946\n2006-07-19,126.26,124.15,125.97,124.18,127.2238295296,-127.2238295296,-127.4381689,-127.4381689,-127.4381689,122.31515363016476\n2006-07-20,126.3,124.92,124.96,126.12,126.93379975782399,-126.93379975782399,-127.185760455,-127.185760455,-127.185760455,122.39\n2006-07-21,125.16,123.88,124.11,125.15,126.66117177235455,-126.66117177235455,-126.94597243224999,-126.94597243224999,-126.94597243224999,122.5586\n2006-07-24,126.32,124.44,126.13,124.44,126.40490146601327,-126.40490146601327,-126.7181738106375,-126.7181738106375,-126.7181738106375,122.722142\n2006-07-25,127.3,125.72,126.97,125.98,122.39,122.39,122.39,122.39,122.39,122.88077774\n2006-07-26,127.44,126.18,126.9,126.59,122.4882,122.4882,122.4882,122.4882,122.4882,123.0346544078\n2006-07-27,127.69,126.2,126.37,127.33,122.686272,122.686272,122.63675400000001,122.63675400000001,122.63675400000001,123.18391477556601\n2006-07-28,128.14,126.86,127.85,126.99,122.98649568,122.98649568,122.83888384000001,122.83888384000001,122.83888384000001,123.32869733229903\n2006-07-31,127.94,126.55,127.67,127.68,123.3987760256,123.3987760256,123.10393964800001,123.10393964800001,123.10393964800001,123.52114943900706\n2006-08-01,127.38,126.6,127.16,127.34,123.778073943552,123.778073943552,123.3557426656,123.3557426656,123.3557426656,123.70590346144678\n2006-08-02,128.46,127.55,127.91,127.58,124.12702802806784,124.12702802806784,123.59495553232,123.59495553232,123.59495553232,123.88326732298891\n2006-08-03,128.54,127.15,128.12,127.33,124.56032522526105,124.56032522526105,123.8868582003808,123.8868582003808,123.8868582003808,124.11210395683946\n2006-08-04,129.43,127.49,128.0,129.06,125.03788619822973,125.03788619822973,124.21257812635415,124.21257812635415,124.21257812635415,124.37777771942909\n2006-08-07,128.07,127.4,127.76,127.9,125.65278213047756,125.65278213047756,124.62997187624582,124.62997187624582,124.62997187624582,124.73143327906905\n2006-08-08,128.45,126.95,127.33,128.1,126.18159263221071,126.18159263221071,125.01397412614615,125.01397412614615,125.01397412614615,125.06033294953421\n2006-08-09,128.6,126.61,126.78,128.2,129.43,-129.43,125.36725619605446,125.36725619605446,125.36725619605446,125.36620964306682\n2006-08-10,127.5,126.29,127.28,126.53,129.3736,-129.3736,125.6922757003701,125.6922757003701,125.6922757003701,125.65067496805214\n2006-08-11,127.2,126.39,126.84,127.17,129.250256,-129.250256,125.9912936443405,125.9912936443405,125.9912936443405,125.9152277202885\n2006-08-14,128.16,126.92,127.05,127.63,129.13184576,-129.13184576,126.26639015279326,126.26639015279326,126.26639015279326,126.1612617798683\n2006-08-15,128.87,127.91,128.71,128.22,129.01817192960002,-129.01817192960002,126.39,126.39,126.39,126.39\n2006-08-16,129.89,129.04,129.75,129.34,126.29,126.29,126.6332,126.6332,126.6332,126.6028\n2006-08-17,130.37,129.49,130.03,129.57,126.36200000000001,126.36200000000001,126.926312,126.926312,126.926312,126.865776\n2006-08-18,130.48,129.59,130.46,130.19,126.52232000000001,126.52232000000001,127.2706808,127.2706808,127.2706808,127.18115616\n2006-08-21,130.25,129.14,130.11,130.18,126.7597808,126.7597808,127.62370591199999,127.62370591199999,127.62370591199999,127.511040544\n2006-08-22,130.52,129.68,130.13,129.95,126.982993952,126.982993952,127.93789826167999,127.93789826167999,127.93789826167999,127.8079364896\n2006-08-23,130.44,129.19,129.57,130.18,127.26595443584,127.26595443584,128.2477504702784,128.2477504702784,128.2477504702784,128.106263475744\n2006-08-24,130.1,129.4,129.87,129.99,127.5262780809728,127.5262780809728,128.520420413845,128.520420413845,128.520420413845,128.37177449341215\n2006-08-25,130.29,129.55,129.84,129.64,127.76577583449497,127.76577583449497,128.76036996418358,128.76036996418358,128.76036996418358,128.60807929913682\n2006-08-28,130.82,129.64,130.48,129.66,127.98611376773538,127.98611376773538,128.97152556848155,128.97152556848155,128.97152556848155,128.81839057623176\n2006-08-29,130.83,129.81,130.75,130.49,128.26950239096183,128.26950239096183,129.21182724457896,129.21182724457896,129.21182724457896,129.05858370708395\n2006-08-30,131.04,130.55,130.74,130.87,128.57676210404642,128.57676210404642,129.4383714303379,129.4383714303379,129.4383714303379,129.28886782516304\n2006-08-31,130.99,130.58,130.71,130.85,128.92161540947993,128.92161540947993,129.6786157157872,129.6786157157872,129.6786157157872,129.5340263296402\n2006-09-01,131.58,130.84,131.48,131.14,129.21818925215274,129.21818925215274,129.88282335841913,129.88282335841913,129.88282335841913,129.74486264349056\n2006-09-05,131.85,131.2,131.72,131.51,129.5960789718083,129.5960789718083,130.15437162107207,130.15437162107207,130.15437162107207,130.020133246967\n2006-09-06,131.16,130.33,130.43,131.1,130.0017847568828,130.0017847568828,-131.85,-131.85,-131.85,130.31291192745226\n2006-09-07,130.57,129.35,129.82,130.06,131.85,-131.85,-131.85,-131.85,-131.85,-134.487\n2006-09-08,130.46,129.83,130.3,130.08,131.79999999999998,-131.79999999999998,-131.725,-131.725,-131.725,-134.33289\n2006-09-11,130.69,129.48,130.38,129.86,131.75099999999998,-131.75099999999998,-131.60625,-131.60625,-131.60625,-134.18340329999998\n2006-09-12,131.83,130.54,131.64,130.57,129.35,129.35,129.35,129.35,129.35,-134.03840120099997\n2006-09-13,132.45,131.52,132.25,131.62,129.3996,129.3996,129.3996,129.3996,129.3996,-133.89774916496998\n2006-09-14,132.22,131.75,132.05,131.94,129.521616,129.521616,129.491112,129.491112,129.491112,-133.7613166900209\n2006-09-15,132.39,131.68,131.82,132.34,129.63875136,129.63875136,129.57987863999998,129.57987863999998,129.57987863999998,-133.62897718932027\n2006-09-18,132.65,131.66,132.02,131.8,129.75120130559998,129.75120130559998,129.66598228079997,129.66598228079997,129.66598228079997,-133.50060787364066\n2006-09-19,132.14,131.07,131.75,132.12,129.92512922726397,129.92512922726397,129.78534298956797,129.78534298956797,129.78534298956797,-133.37608963743145\n2006-09-20,132.86,130.46,132.41,132.24,130.08862147362814,130.08862147362814,129.89992926998525,129.89992926998525,129.89992926998525,-133.25530694830852\n2006-09-21,132.75,131.43,131.7,132.6,130.31033175573788,130.31033175573788,130.047932806486,130.047932806486,130.047932806486,-133.13814773985925\n2006-09-22,131.68,131.0,131.39,131.67,130.46,130.46,130.1885361661617,130.1885361661617,130.1885361661617,-133.02450330766348\n2006-09-25,132.85,131.05,132.54,131.73,130.65200000000002,130.65200000000002,130.3221093578536,130.3221093578536,130.3221093578536,-132.91426820843358\n2006-09-26,133.58,132.4,133.54,132.49,130.82864,130.82864,130.44900388996092,130.44900388996092,130.44900388996092,126.76299999999999\n2006-09-27,133.97,133.25,133.64,133.48,131.05,131.05,130.63686365656326,130.63686365656326,130.63686365656326,126.89934\n2006-09-28,133.98,133.25,133.78,133.74,131.40040000000002,131.40040000000002,130.87018320060383,130.87018320060383,130.87018320060383,127.11145979999999\n2006-09-29,133.94,133.48,133.48,133.79,131.76154400000001,131.76154400000001,131.1189685445555,131.1189685445555,131.1189685445555,127.38620140799999\n2006-10-02,133.83,132.95,133.07,133.54,132.07212784,132.07212784,131.34785106099108,131.34785106099108,131.34785106099108,127.64995335168\n2006-10-03,133.79,132.66,133.44,132.89,132.3392299424,132.3392299424,131.55842297611179,131.55842297611179,131.55842297611179,127.90315521761279\n2006-10-04,135.0,133.08,134.95,133.22,132.56893775046402,132.56893775046402,131.75214913802284,131.75214913802284,131.75214913802284,128.14622900890828\n2006-10-05,135.41,125.35,135.3,134.9,135.41,-135.41,-135.41,-135.41,-135.41,-138.1182\n2006-10-06,135.09,134.41,135.03,134.96,135.41,-135.41,-135.41,-135.41,-135.41,-137.735154\n2006-10-09,135.3,134.64,135.09,134.85,135.41,-135.41,-135.41,-135.41,-135.41,-137.36359937999998\n2006-10-10,135.45,134.84,135.33,135.11,125.35,125.35,125.35,125.35,125.35,-137.0031913986\n2006-10-11,135.43,134.3,134.99,134.84,125.55199999999999,125.55199999999999,125.55199999999999,125.55199999999999,125.55199999999999,-136.65359565664198\n2006-10-12,136.39,135.4,136.27,135.47,125.74995999999999,125.74995999999999,125.74995999999999,125.74995999999999,125.74995999999999,122.84299999999999\n2006-10-13,136.71,136.04,136.55,136.16,126.17556159999998,126.17556159999998,126.06916119999998,126.06916119999998,126.06916119999998,123.11393999999999\n2006-10-16,137.05,136.42,136.89,136.52,126.80762790399999,126.80762790399999,126.49479475199999,126.49479475199999,126.49479475199999,123.52182179999998\n2006-10-17,136.7,135.67,136.45,136.47,127.62701767168,127.62701767168,127.02255501439998,127.02255501439998,127.02255501439998,124.06294892799998\n2006-10-18,137.34,136.11,136.58,137.06,128.3808562579456,128.3808562579456,127.52392726367998,127.52392726367998,127.52392726367998,124.58243097087998\n2006-10-19,136.87,136.23,136.75,136.41,129.27677063215103,129.27677063215103,128.11289162785917,128.11289162785917,128.11289162785917,125.22030942233599\n2006-10-20,136.94,136.0,136.86,136.81,130.08309356893594,130.08309356893594,128.66651813018763,128.66651813018763,128.66651813018763,125.82629395121918\n2006-10-23,137.8,136.39,137.68,136.56,130.80878421204235,130.80878421204235,129.18692704237637,129.18692704237637,129.18692704237637,126.40197925365823\n2006-10-24,137.83,137.22,137.76,137.3,131.64773010659727,131.64773010659727,129.78984214941002,129.78984214941002,129.78984214941002,127.08586049843873\n2006-10-25,138.41,137.59,138.2,137.74,132.51324789167364,132.51324789167364,130.43305477745722,130.43305477745722,130.43305477745722,127.83795026354802\n2006-10-26,139.92,137.98,138.86,138.66,133.45672822900585,133.45672822900585,131.15097984748607,131.15097984748607,131.15097984748607,128.6837142424642\n2006-10-27,138.75,137.64,137.91,138.61,134.62011714778478,134.62011714778478,132.02788186273747,132.02788186273747,132.02788186273747,129.6949799606424\n2006-10-30,138.2,137.4,137.87,137.66,135.57409606118352,135.57409606118352,132.8170936764637,132.8170936764637,132.8170936764637,130.61523176418459\n2006-10-31,138.25,137.25,137.79,138.07,136.3563587701705,136.3563587701705,133.52738430881735,133.52738430881735,133.52738430881735,131.45266090540798\n2006-11-01,138.3,136.72,136.89,138.22,139.92,-139.92,134.16664587793562,134.16664587793562,134.16664587793562,132.21472142392128\n2006-11-02,137.01,136.36,136.81,136.5,139.856,-139.856,134.74198129014206,134.74198129014206,134.74198129014206,132.90819649576835\n2006-11-03,137.39,135.62,136.6,137.26,139.71616,-139.71616,135.25978316112787,135.25978316112787,135.25978316112787,133.5392588111492\n2006-11-06,138.28,136.95,138.08,136.96,139.4703904,-139.4703904,135.62,135.62,135.62,134.1135255181458\n2006-11-07,138.98,134.44,138.43,138.2,139.239366976,-139.239366976,-139.92,-139.92,-139.92,-142.71839999999997\n2006-11-08,139.05,136.86,138.74,138.0,134.44,134.44,-139.7556,-139.7556,-139.7556,-142.47004799999996\n2006-11-09,139.14,137.9,138.09,139.01,134.44,134.44,-139.59613199999998,-139.59613199999998,-139.59613199999998,-142.22914655999998\n2006-11-10,138.34,137.72,138.27,138.14,134.628,134.628,-139.44144803999998,-139.44144803999998,-139.44144803999998,-141.99547216319996\n2006-11-13,139.04,138.07,138.68,138.18,134.80847999999997,134.80847999999997,-139.29140459879997,-139.29140459879997,-139.29140459879997,-141.76880799830397\n2006-11-14,139.73,138.12,139.55,138.97,134.98174079999998,134.98174079999998,134.44,134.44,134.44,-141.54894375835485\n2006-11-15,140.45,139.53,139.97,139.57,135.26663635199998,135.26663635199998,134.54579999999999,134.54579999999999,134.54579999999999,-141.3356754456042\n2006-11-16,145.2,139.49,140.23,140.44,135.68130544384,135.68130544384,134.72292599999997,134.72292599999997,134.72292599999997,131.7512\n2006-11-17,140.42,139.73,140.39,139.92,136.63317489945598,136.63317489945598,135.14200895999997,135.14200895999997,135.14200895999997,132.02017600000002\n2006-11-20,140.74,140.1,140.37,140.3,137.4898574095104,137.4898574095104,135.54432860159997,135.54432860159997,135.54432860159997,132.28377248\n2006-11-21,140.67,140.29,140.58,140.49,138.26087166855936,138.26087166855936,135.93055545753597,135.93055545753597,135.93055545753597,132.54209703040002\n2006-11-22,141.16,140.0,140.92,140.75,138.95478450170341,138.95478450170341,136.30133323923454,136.30133323923454,136.30133323923454,132.79525508979202\n2006-11-24,140.84,140.2,140.46,140.24,139.57930605153308,139.57930605153308,136.65727990966516,136.65727990966516,136.65727990966516,133.04334998799618\n2006-11-27,140.35,138.44,138.49,140.29,145.2,-145.2,136.99898871327855,136.99898871327855,136.99898871327855,133.28648298823626\n2006-11-28,139.15,138.11,139.03,138.24,145.0648,-145.0648,137.32702916474742,137.32702916474742,137.32702916474742,133.52475332847155\n2006-11-29,140.53,139.42,140.36,139.47,144.786608,-144.786608,137.64194799815752,137.64194799815752,137.64194799815752,133.7582582619021\n2006-11-30,141.05,139.76,140.46,140.44,144.51954368,-144.51954368,137.94427007823123,137.94427007823123,137.94427007823123,133.98709309666407\n2006-12-01,140.66,138.97,140.06,140.53,144.2631619328,-144.2631619328,138.23449927510197,138.23449927510197,138.23449927510197,134.21135123473078\n2006-12-04,141.55,140.08,141.33,140.25,144.01703545548799,-144.01703545548799,138.5131193040979,138.5131193040979,138.5131193040979,134.43112421003616\n2006-12-05,141.96,141.26,141.88,141.56,143.78075403726848,-143.78075403726848,138.78059453193399,138.78059453193399,138.78059453193399,134.64650172583544\n2006-12-06,142.07,141.5,141.75,141.87,143.55392387577774,-143.55392387577774,139.03737075065663,139.03737075065663,139.03737075065663,134.85757169131873\n2006-12-07,142.3,141.11,141.22,142.03,143.33616692074662,-143.33616692074662,139.28387592063038,139.28387592063038,139.28387592063038,135.06442025749234\n2006-12-08,141.9,140.78,141.41,141.13,143.12712024391675,-143.12712024391675,139.52052088380518,139.52052088380518,139.52052088380518,135.2671318523425\n2006-12-11,142.09,141.34,141.74,141.42,142.92643543416008,-142.92643543416008,139.74770004845297,139.74770004845297,139.74770004845297,135.46578921529564\n2006-12-12,141.87,140.89,141.62,141.68,142.73377801679368,-142.73377801679368,139.96579204651485,139.96579204651485,139.96579204651485,135.66047343098973\n2006-12-13,142.33,141.56,141.84,142.23,142.54882689612194,-142.54882689612194,140.17516036465426,140.17516036465426,140.17516036465426,135.85126396236993\n2006-12-14,143.24,141.84,142.98,141.87,138.11,138.11,140.3761539500681,140.3761539500681,140.3761539500681,136.03823868312253\n2006-12-15,142.89,142.24,142.38,142.65,138.2126,138.2126,140.56910779206538,140.56910779206538,140.56910779206538,136.2214739094601\n2006-12-18,143.5,141.75,141.94,142.54,138.313148,138.313148,140.75434348038277,140.75434348038277,140.75434348038277,136.4010444312709\n2006-12-19,142.56,141.19,142.28,141.53,138.52062208,138.52062208,140.93216974116746,140.93216974116746,140.93216974116746,136.57702354264546\n2006-12-20,142.66,142.05,142.13,142.29,138.71979719680002,138.71979719680002,141.10288295152077,141.10288295152077,141.10288295152077,136.74948307179255\n2006-12-21,142.43,141.32,141.62,142.27,138.91100530892803,138.91100530892803,141.19,141.19,141.19,136.9184934103567\n2006-12-22,141.65,140.78,140.85,141.64,139.0945650965709,139.0945650965709,-145.2,-145.2,-145.2,137.08412354214954\n2006-12-26,141.58,140.78,141.54,140.82,139.27078249270807,139.27078249270807,-145.0674,-145.0674,-145.0674,137.24644107130655\n2006-12-27,142.6,141.83,142.59,141.87,139.43995119299973,139.43995119299973,-144.93877799999999,-144.93877799999999,-144.93877799999999,137.40551224988042\n2006-12-28,142.7,141.99,142.19,142.41,139.60235314527975,139.60235314527975,-144.81401466,-144.81401466,-144.81401466,137.5614020048828\n2006-12-29,142.54,141.47,141.52,142.1,139.75825901946857,139.75825901946857,-144.6929942202,-144.6929942202,-144.6929942202,137.71417396478515\n2007-01-03,142.84,140.58,141.45,142.27,139.90792865868983,139.90792865868983,-144.575604393594,-144.575604393594,-144.575604393594,137.86389048548943\n2007-01-04,142.05,140.61,141.67,141.23,140.05161151234222,140.05161151234222,-144.3758241739143,-144.3758241739143,-144.3758241739143,138.01061267577964\n2007-01-05,141.39,140.38,140.76,141.33,140.18954705184854,140.18954705184854,-144.1860329652186,-144.1860329652186,-144.1860329652186,138.15440042226405\n2007-01-08,141.41,140.25,141.17,140.82,143.5,-143.5,-143.9196106576533,-143.9196106576533,-143.9196106576533,138.29531241381878\n2007-01-09,141.6,140.4,141.13,141.31,143.435,-143.435,-143.58934569846448,-143.58934569846448,-143.58934569846448,138.4334061655424\n2007-01-10,141.53,140.3,141.4,140.57,143.3713,-143.3713,-143.2888045856027,-143.2888045856027,-143.2888045856027,138.56873804223156\n2007-01-11,142.62,141.5,142.27,141.56,143.308874,-143.308874,-143.01531217289846,-143.01531217289846,-143.01531217289846,138.70136328138693\n2007-01-12,143.03,142.08,142.97,142.12,143.24769652,-143.24769652,140.25,140.25,140.25,138.8313360157592\n2007-01-16,143.44,142.73,143.03,143.05,140.25,140.25,140.3056,140.3056,140.3056,138.958709295444\n2007-01-17,143.46,142.73,142.94,142.87,140.3138,140.3138,140.399632,140.399632,140.399632,139.08353510953512\n2007-01-18,143.25,142.31,142.45,143.18,140.43964799999998,140.43964799999998,140.52204672,140.52204672,140.52204672,139.20586440734442\n2007-01-19,143.1,142.46,142.93,142.55,140.56046207999998,140.56046207999998,140.6395648512,140.6395648512,140.6395648512,139.32574711919753\n2007-01-22,145.95,141.93,142.21,143.07,140.67644359679997,140.67644359679997,140.752382257152,140.752382257152,140.752382257152,139.44323217681358\n2007-01-23,143.08,142.06,142.75,142.25,140.99285698099197,140.99285698099197,141.0122631442944,141.0122631442944,141.0122631442944,139.63843521150918\n2007-01-24,143.98,142.91,143.91,142.97,141.29028556213245,141.29028556213245,141.25914998707967,141.25914998707967,141.25914998707967,139.8277821551639\n2007-01-25,143.92,134.4,142.35,143.84,145.95,-145.95,-145.95,-145.95,-145.95,-148.869\n2007-01-26,142.65,141.58,142.19,142.59,145.719,-145.719,-145.6035,-145.6035,-145.6035,-148.43493\n2007-01-29,142.63,141.74,141.96,142.19,145.49262,-145.49262,-145.267395,-145.267395,-145.267395,-148.01388210000002\n2007-01-30,142.83,142.06,142.76,142.36,145.2707676,-145.2707676,-144.94137315,-144.94137315,-144.94137315,-147.605465637\n2007-01-31,144.13,142.41,143.81,142.61,145.053352248,-145.053352248,-144.6251319555,-144.6251319555,-144.6251319555,-147.20930166789\n2007-02-01,144.66,143.91,144.57,144.15,144.84028520304,-144.84028520304,134.4,134.4,134.4,-146.8250226178533\n2007-02-02,144.9,144.38,144.79,144.73,134.4,134.4,134.6052,134.6052,134.6052,-146.4522719393177\n2007-02-05,144.93,144.34,144.7,144.69,134.61,134.61,134.914044,134.914044,134.914044,-146.0907037811382\n2007-02-06,145.03,144.33,144.79,144.97,135.02280000000002,135.02280000000002,135.31468224,135.31468224,135.31468224,-145.73998266770406\n2007-02-07,145.36,144.57,145.03,145.12,135.62323200000003,135.62323200000003,135.800448128,135.800448128,135.800448128,-145.39978318767294\n2007-02-08,145.12,144.27,144.88,144.8,136.40217344000004,136.40217344000004,136.37402124032,136.37402124032,136.37402124032,-145.36\n2007-02-09,145.33,143.39,143.92,145.06,137.11879956480004,137.11879956480004,136.91317996590078,136.91317996590078,136.91317996590078,-145.36\n2007-02-12,144.04,143.19,143.42,143.93,137.77809559961605,137.77809559961605,137.41998916794674,137.41998916794674,137.41998916794674,-145.33\n2007-02-13,144.55,143.76,144.51,143.77,138.38464795164677,138.38464795164677,137.89638981786993,137.89638981786993,137.89638981786993,-145.33\n2007-02-14,145.89,144.78,145.64,144.8,138.94267611551504,138.94267611551504,138.34420642879775,138.34420642879775,138.34420642879775,131.71200000000002\n2007-02-15,145.95,145.43,145.83,145.67,139.63740850396354,139.63740850396354,138.8724119787819,138.8724119787819,138.8724119787819,131.99556\n2007-02-16,145.74,145.23,145.68,145.43,140.3949194834879,140.3949194834879,139.43861902047936,139.43861902047936,139.43861902047936,132.4141932\n2007-02-20,146.2,144.06,146.1,145.56,141.06152914546936,141.06152914546936,139.95952949884102,139.95952949884102,139.95952949884102,132.820267404\n2007-02-21,146.07,145.35,145.89,145.61,141.78091506510364,141.78091506510364,140.52117184394533,140.52117184394533,140.52117184394533,133.35545670784\n2007-02-22,146.42,145.17,145.83,146.05,142.39958695598912,142.39958695598912,141.03226637799025,141.03226637799025,141.03226637799025,133.8692384395264\n2007-02-23,145.79,144.75,145.36,145.73,143.04285304303087,143.04285304303087,141.57103974019122,141.57103974019122,141.57103974019122,134.4967765175501\n2007-02-26,145.95,144.75,145.21,145.83,143.58319655614594,143.58319655614594,142.0559357661721,142.0559357661721,142.0559357661721,135.0929376916726\n2007-02-27,144.2,139.1,140.0,143.89,146.42,-146.42,-146.42,-146.42,-146.42,135.65929080708898\n2007-02-28,141.98,139.8,140.93,140.39,146.2736,-146.2736,-146.2004,-146.2004,-146.2004,136.19732626673454\n2007-03-01,141.25,138.05,140.59,139.35,146.13012799999998,-146.13012799999998,-145.987388,-145.987388,-145.987388,136.7084599533978\n2007-03-02,140.65,138.9,138.98,140.05,145.80692287999997,-145.80692287999997,-145.5905186,-145.5905186,-145.5905186,137.1940369557279\n2007-03-05,139.51,137.66,137.69,137.92,145.49664596479997,-145.49664596479997,-145.21349267,-145.21349267,-145.21349267,137.6553351079415\n2007-03-06,140.12,138.44,139.8,138.78,145.02644720691197,-145.02644720691197,-144.6847481831,-144.6847481831,-144.6847481831,137.66\n2007-03-07,140.46,139.4,139.46,139.74,144.58446037449724,-144.58446037449724,-144.193015810283,-144.193015810283,-144.193015810283,137.66\n2007-03-08,141.16,140.07,140.54,140.55,144.1689927520274,-144.1689927520274,-143.7357047035632,-143.7357047035632,-143.7357047035632,138.09799999999998\n2007-03-09,141.41,140.08,140.62,141.33,143.77845318690575,-143.77845318690575,-143.31040537431377,-143.31040537431377,-143.31040537431377,138.51409999999998\n2007-03-12,141.34,140.16,141.01,140.42,143.4113459956914,-143.4113459956914,-142.91487699811182,-142.91487699811182,-142.91487699811182,138.909395\n2007-03-13,140.77,138.12,138.15,140.24,143.0662652359499,-143.0662652359499,-142.547035608244,-142.547035608244,-142.547035608244,-149.3484\n2007-03-14,139.24,136.75,139.14,138.43,142.7418893217929,-142.7418893217929,-142.2049431156669,-142.2049431156669,-142.2049431156669,-149.011548\n2007-03-15,139.99,138.8,139.57,139.04,142.26253817604947,-142.26253817604947,-141.7139982352569,-141.7139982352569,-141.7139982352569,-148.3984706\n2007-03-16,139.63,138.12,138.48,139.31,141.82153512196552,-141.82153512196552,-141.26723839408376,-141.26723839408376,-141.26723839408376,-147.81604707\n2007-03-19,140.33,139.15,140.07,139.26,141.4158123122083,-141.4158123122083,-140.86068693861623,-140.86068693861623,-140.86068693861623,-147.2627447165\n2007-03-20,141.04,139.96,140.93,140.08,141.04254732723163,-141.04254732723163,136.75,136.75,136.75,-146.737107480675\n2007-03-21,143.65,140.82,143.33,141.1,136.75,136.75,136.8358,136.8358,136.8358,-146.23775210664127\n2007-03-22,143.64,142.79,143.31,143.47,136.888,136.888,137.04022600000002,137.04022600000002,137.04022600000002,-145.7633645013092\n2007-03-23,143.79,143.15,143.5,143.28,137.02324000000002,137.02324000000002,137.23851922000003,137.23851922000003,137.23851922000003,-145.31269627624374\n2007-03-26,143.65,142.12,143.59,143.5,137.29391040000002,137.29391040000002,137.50057845120003,137.50057845120003,137.50057845120003,-144.88456146243155\n2007-03-27,143.16,142.4,142.71,143.13,137.55375398400002,137.55375398400002,137.75215531315203,137.75215531315203,137.75215531315203,-144.47783338930998\n2007-03-28,142.47,141.26,141.54,142.23,137.80320382464004,137.80320382464004,137.99366910062594,137.99366910062594,137.99366910062594,-144.09144171984448\n2007-03-29,142.61,141.19,142.12,142.54,138.04267567165442,138.04267567165442,138.2255223366009,138.2255223366009,138.2255223366009,-143.72436963385226\n2007-03-30,142.84,140.56,141.94,142.17,138.27256864478824,138.27256864478824,138.44810144313686,138.44810144313686,138.44810144313686,-143.37565115215966\n2007-04-02,142.46,141.48,142.3,142.16,138.4932658989967,138.4932658989967,138.6617773854114,138.6617773854114,138.6617773854114,-143.04436859455168\n2007-04-03,143.98,142.91,143.66,142.97,138.70513526303682,138.70513526303682,138.86690628999494,138.86690628999494,138.86690628999494,134.015\n2007-04-04,143.95,143.16,143.79,143.69,139.0216271472546,139.0216271472546,139.1225609754952,139.1225609754952,139.1225609754952,134.21429999999998\n2007-04-05,144.44,143.61,144.28,143.67,139.31912951841932,139.31912951841932,139.36543292672042,139.36543292672042,139.36543292672042,134.40961399999998\n2007-04-09,144.78,144.15,144.42,144.59,139.72879915694577,139.72879915694577,139.66990695111718,139.66990695111718,139.66990695111718,134.71052557999997\n2007-04-10,144.85,144.27,144.8,144.33,140.2339192412512,140.2339192412512,140.02761346453897,140.02761346453897,140.02761346453897,135.11330455679996\n2007-04-11,144.86,143.54,143.83,144.82,140.78784893230105,140.78784893230105,140.41340438737586,140.41340438737586,140.41340438737586,135.60013932895995\n2007-04-12,144.8,143.34,144.74,143.74,141.3579500817789,141.3579500817789,140.81359799251203,140.81359799251203,140.81359799251203,136.15573096922236\n2007-04-13,145.29,144.37,145.26,144.9,141.84823707032987,141.84823707032987,141.17777417318595,141.17777417318595,141.17777417318595,136.67798711106903\n2007-04-16,146.86,145.84,146.78,145.87,142.3989191390771,142.3989191390771,141.58899675586736,141.58899675586736,141.58899675586736,137.28082801329418\n2007-04-17,147.4,146.65,147.07,146.96,143.2019136940432,143.2019136940432,142.16880711272194,142.16880711272194,142.16880711272194,138.04716177223065\n2007-04-18,147.64,146.57,147.15,146.6,144.04153095523458,144.04153095523458,142.7965502591953,142.7965502591953,142.7965502591953,138.8889172127299\n2007-04-19,147.4,146.36,147.03,146.54,144.76122476418766,144.76122476418766,143.42619872549992,143.42619872549992,143.42619872549992,139.7640254914569\n2007-04-20,148.48,147.69,148.47,148.2,145.33697981135012,145.33697981135012,143.97399289118493,143.97399289118493,143.97399289118493,140.5516229423112\n2007-04-23,148.73,147.97,148.12,148.37,145.9655838490801,145.9655838490801,144.60483388641904,144.60483388641904,144.60483388641904,141.42374441865698\n2007-04-24,148.4,147.33,148.04,148.23,146.51846707926407,146.51846707926407,145.2236088034562,145.2236088034562,145.2236088034562,142.30049508841813\n2007-04-25,149.65,148.16,149.46,148.73,146.96077366341126,146.96077366341126,145.74956748293775,145.74956748293775,145.74956748293775,143.07203567780795\n2007-04-26,149.8,149.1,149.39,149.49,147.33,147.33,146.37363668566772,146.37363668566772,146.37363668566772,143.92717103969292\n2007-04-27,149.74,148.84,149.4,149.03,147.824,147.824,146.9561184491042,146.9561184491042,146.9561184491042,144.74936709413592\n2007-04-30,149.74,148.21,148.23,149.63,149.8,-149.8,147.43957831275648,147.43957831275648,147.43957831275648,145.4564557009569\n2007-05-01,149.47,147.67,148.61,148.52,149.7682,-149.7682,-149.8,-149.8,-149.8,146.06455190282293\n2007-05-02,149.95,148.75,149.62,148.9,147.67,147.67,147.67,147.67,147.67,146.58751463642773\n2007-05-03,150.4,149.05,150.26,149.95,147.67,147.67,147.67,147.67,147.67,147.09188744096357\n2007-05-04,151.11,150.22,150.64,150.75,147.77919999999997,147.77919999999997,147.75189999999998,147.75189999999998,147.75189999999998,147.6211854504094\n2007-05-07,151.2,150.81,150.95,150.88,147.97904799999998,147.97904799999998,147.88622399999997,147.88622399999997,147.88622399999997,148.21428392383982\n2007-05-08,150.92,150.13,150.86,150.57,148.23672415999997,148.23672415999997,148.05191279999997,148.05191279999997,148.05191279999997,148.75171281754865\n2007-05-09,152.82,150.44,151.38,150.64,148.47378622719998,148.47378622719998,148.20931715999996,148.20931715999996,148.20931715999996,149.19240451038988\n2007-05-10,151.02,149.27,149.33,150.73,148.90840760447998,148.90840760447998,148.48595813039995,148.48595813039995,148.48595813039995,-155.8764\n2007-05-11,150.82,149.72,150.81,149.75,149.27,149.27,148.74600064257595,148.74600064257595,148.74600064257595,-155.67820799999998\n2007-05-14,151.3,149.79,150.55,150.86,149.27,149.27,148.9904406040214,148.9904406040214,148.9904406040214,-155.48596175999998\n2007-05-15,151.66,150.19,150.38,150.7,149.625,149.625,149.2202141677801,149.2202141677801,149.2202141677801,-155.29948290719997\n2007-05-16,151.63,150.38,151.61,150.8,149.79,149.79,149.4362013177133,149.4362013177133,149.4362013177133,-155.11859841998398\n2007-05-17,151.96,151.11,151.44,151.38,150.093,150.093,149.6392292386505,149.6392292386505,149.6392292386505,-154.94314046738447\n2007-05-18,152.5,151.81,152.49,151.94,150.3657,150.3657,149.83007548433147,149.83007548433147,149.83007548433147,-154.77294625336293\n2007-05-21,153.23,152.5,152.71,152.58,150.61113,150.61113,150.00947095527158,150.00947095527158,150.00947095527158,-154.60785786576204\n2007-05-22,153.16,152.4,152.6,152.71,150.9253944,150.9253944,150.23490798840257,150.23490798840257,150.23490798840257,-154.44772212978918\n2007-05-23,153.5,152.37,152.38,152.95,151.201947072,151.201947072,150.44456442921438,150.44456442921438,150.44456442921438,-154.29239046589552\n2007-05-24,153.2,150.74,151.01,152.53,153.5,-153.5,150.68899927487723,150.68899927487723,150.68899927487723,-154.14171875191866\n2007-05-25,152.02,151.19,151.86,151.49,153.5,-153.5,150.74,150.74,150.74,-153.9955671893611\n2007-05-29,152.5,151.45,152.08,151.94,153.4448,-153.4448,150.74,150.74,150.74,-153.85380017368027\n2007-05-30,153.38,151.34,153.37,151.46,153.390704,-153.390704,150.9608,150.9608,150.9608,-153.71628616846985\n2007-05-31,153.89,153.12,153.35,153.66,150.74,150.74,151.163936,151.163936,151.163936,146.2846\n2007-06-01,154.4,153.51,153.96,153.88,150.803,150.803,151.34,151.34,151.34,146.436708\n2007-06-04,154.39,153.5,154.24,153.53,150.94688,150.94688,151.64600000000002,151.64600000000002,151.64600000000002,146.67560676000002\n2007-06-05,153.9,152.86,153.44,153.72,151.0850048,151.0850048,151.9214,151.9214,151.9214,146.90733855720003\n2007-06-06,152.95,151.76,152.1,152.91,151.21760460800002,151.21760460800002,-154.4,-154.4,-154.4,147.13211840048405\n2007-06-07,152.06,149.25,149.36,151.55,154.4,-154.4,-154.3208,-154.3208,-154.3208,147.35015484846951\n2007-06-08,151.19,149.09,151.05,149.42,154.297,-154.297,-154.06726,-154.06726,-154.06726,147.56165020301543\n2007-06-11,151.95,150.7,151.3,150.96,154.08872,-154.08872,-153.7188518,-153.7188518,-153.7188518,147.76680069692497\n2007-06-12,151.54,149.67,149.67,150.67,153.8887712,-153.8887712,-153.39483217400002,-153.39483217400002,-153.39483217400002,147.96579667601722\n2007-06-13,151.98,150.19,151.95,150.45,153.696820352,-153.696820352,-153.09349392182003,-153.09349392182003,-153.09349392182003,148.1588227757367\n2007-06-14,153.12,152.03,152.71,152.06,153.51254753792,-153.51254753792,149.09,149.09,149.09,148.3460580924646\n2007-06-15,153.66,152.93,153.04,153.25,149.09,149.09,149.1706,149.1706,149.1706,148.52767634969067\n2007-06-18,153.39,152.66,152.9,153.36,149.1814,149.1814,149.305282,149.305282,149.305282,148.70384605919995\n2007-06-19,153.38,152.36,153.2,152.64,149.270972,149.270972,149.43592354,149.43592354,149.43592354,148.87473067742394\n2007-06-20,153.59,150.96,151.02,153.59,149.35875256,149.35875256,149.5626458338,149.5626458338,149.5626458338,149.04048875710123\n2007-06-21,152.11,150.25,151.98,151.08,149.4447775088,149.4447775088,149.68556645878598,149.68556645878598,149.68556645878598,149.2012740943882\n2007-06-22,151.77,149.85,150.24,151.5,149.529081958624,149.529081958624,149.8047994650224,149.8047994650224,149.8047994650224,149.35723587155655\n2007-06-25,151.25,149.02,149.61,150.24,153.66,-153.66,-153.66,-153.66,-153.66,-157.488\n2007-06-26,150.46,148.82,149.07,150.21,153.56719999999999,-153.56719999999999,-153.5208,-153.5208,-153.5208,-157.23396\n2007-06-27,150.56,148.06,150.55,148.24,153.377312,-153.377312,-153.28576,-153.28576,-153.28576,-156.813262\n2007-06-28,151.41,150.31,150.4,150.37,153.05827327999998,-153.05827327999998,-152.91995680000002,-152.91995680000002,-152.91995680000002,-156.20053366000002\n2007-06-29,151.65,149.15,149.98,150.83,152.7583768832,-152.7583768832,-152.579759824,-152.579759824,-152.579759824,-155.63069630380002\n2007-07-02,151.8,150.77,151.8,150.84,152.47647427020797,-152.47647427020797,-152.26337663632,-152.26337663632,-152.26337663632,-155.10074756253402\n2007-07-03,152.5,151.99,152.24,152.17,148.06,148.06,148.06,148.06,148.06,-154.60789523315665\n2007-07-05,152.56,151.63,152.43,152.43,148.1488,148.1488,148.1488,148.1488,148.1488,-154.1495425668357\n2007-07-06,153.16,151.93,152.96,152.38,148.325248,148.325248,148.281136,148.281136,148.281136,-153.7232745871572\n2007-07-09,153.36,152.62,153.08,153.15,148.61533312,148.61533312,148.47629056,148.47629056,148.47629056,145.0988\n2007-07-10,152.6,150.87,150.89,152.27,148.9949064704,148.9949064704,148.720476032,148.720476032,148.720476032,145.264024\n2007-07-11,151.89,150.53,151.84,150.75,149.344113952768,149.344113952768,148.95245223039998,148.95245223039998,148.95245223039998,145.42594352\n2007-07-12,154.75,152.34,154.75,152.36,149.66538483654656,149.66538483654656,149.17282961887997,149.17282961887997,149.17282961887997,145.58462464960002\n2007-07-13,155.46,154.4,155.11,154.57,150.1738463528919,150.1738463528919,149.50745984174716,149.50745984174716,149.50745984174716,145.859585910112\n2007-07-16,155.53,154.58,154.9,154.99,150.80818479054489,150.80818479054489,149.92413765282487,149.92413765282487,149.92413765282487,146.2436024737075\n2007-07-17,155.48,154.68,154.86,155.02,151.46923891986862,151.46923891986862,150.3726066405989,150.3726066405989,150.3726066405989,146.70792235002213\n2007-07-18,154.8,153.3,154.59,154.32,152.03774547108702,152.03774547108702,150.78519810935097,150.78519810935097,150.78519810935097,147.149026232521\n2007-07-19,155.53,154.76,155.22,155.2,152.52666110513485,152.52666110513485,151.1647822606029,151.1647822606029,151.1647822606029,147.56807492089496\n2007-07-20,154.99,152.83,153.33,154.87,155.53,-155.53,151.51399967975465,151.51399967975465,151.51399967975465,147.96617117485022\n2007-07-23,154.72,153.84,154.06,154.28,155.53,-155.53,151.83527970537426,151.83527970537426,151.83527970537426,148.3443626161077\n2007-07-24,153.5,150.76,151.12,153.12,155.476,-155.476,-155.53,-155.53,-155.53,148.7036444853023\n2007-07-25,152.39,150.27,151.75,152.03,155.28736,-155.28736,-155.3869,-155.3869,-155.3869,149.0449622610372\n2007-07-26,150.75,146.4,148.55,150.16,154.98631840000002,-154.98631840000002,-155.131055,-155.131055,-155.131055,-158.6406\n2007-07-27,148.87,145.9,146.04,148.26,154.299412928,-154.299412928,-154.51988115,-154.51988115,-154.51988115,-158.273382\n2007-07-30,147.81,145.36,147.27,145.89,153.4594716352,-153.4594716352,-153.7440918465,-153.7440918465,-153.7440918465,-157.6547129\n2007-07-31,148.88,145.39,145.39,148.33,152.487535038976,-152.487535038976,-152.821841743385,-152.821841743385,-152.821841743385,-156.794082997\n2007-08-01,147.01,143.96,146.62,145.21,151.6322308342989,-151.6322308342989,-152.00103915161264,-152.00103915161264,-152.00103915161264,-155.99369718721002\n2007-08-02,147.76,146.1,147.29,146.77,150.55811851749706,-150.55811851749706,-150.955704061903,-150.955704061903,-150.955704061903,-154.9106644403611\n2007-08-03,147.58,143.24,143.35,147.26,149.63438192504748,-149.63438192504748,-150.0462625338556,-150.0462625338556,-150.0462625338556,-153.9251046407286\n2007-08-06,146.83,142.76,146.76,144.22,148.61128081703987,-148.61128081703987,-149.02532315377726,-149.02532315377726,-149.02532315377726,-152.74974313024845\n2007-08-07,148.97,145.6,147.68,145.94,142.76,142.76,142.76,142.76,142.76,-151.45107652331615\n2007-08-08,150.58,147.92,149.86,148.41,142.76,142.76,142.76,142.76,142.76,139.9048\n2007-08-09,148.95,145.65,145.72,147.41,143.0728,143.0728,142.9946,142.9946,142.9946,140.118304\n2007-08-10,146.46,143.12,145.54,144.24,150.58,-150.58,-150.58,-150.58,-150.58,140.32753792\n2007-08-13,146.89,145.28,145.51,146.51,150.4308,-150.4308,-150.3562,-150.3562,-150.3562,140.5325871616\n2007-08-14,145.84,142.75,142.77,145.7,150.284584,-150.284584,-150.139114,-150.139114,-150.139114,140.73353541836798\n2007-08-15,144.43,140.63,140.9,142.7,149.98320064,-149.98320064,-149.7696583,-149.7696583,-149.7696583,-153.5916\n2007-08-16,141.92,137.25,141.73,139.79,149.4220086016,-149.4220086016,-149.129882219,-149.129882219,-149.129882219,-153.202752\n2007-08-17,145.81,142.33,144.74,145.56,148.448247913472,-148.448247913472,-148.06069281928998,-148.06069281928998,-148.06069281928998,-152.4051144\n2007-08-20,145.45,143.3,144.75,145.13,147.55238808039422,-147.55238808039422,-147.08773046555388,-147.08773046555388,-147.08773046555388,-151.64735868\n2007-08-21,145.82,144.14,144.95,144.59,146.7281970339627,-146.7281970339627,-146.20233472365402,-146.20233472365402,-146.20233472365402,-150.927490746\n2007-08-22,146.8,145.33,146.66,146.01,137.25,137.25,137.25,137.25,137.25,-150.2436162087\n2007-08-23,147.65,145.61,146.57,147.33,137.441,137.441,137.441,137.441,137.441,-149.593935398265\n2007-08-24,148.25,146.28,148.16,146.49,137.84936,137.84936,137.74727000000001,137.74727000000001,137.74727000000001,-148.97673862835174\n2007-08-27,147.91,146.81,146.92,147.87,138.47339839999998,138.47339839999998,138.16737920000003,138.16737920000003,138.16737920000003,-148.39040169693416\n2007-08-28,146.24,143.46,143.65,146.16,139.05999449599997,139.05999449599997,138.57068403200003,138.57068403200003,138.57068403200003,-148.25\n2007-08-29,146.74,143.96,146.71,144.39,139.61139482623997,139.61139482623997,138.95785667072002,138.95785667072002,138.95785667072002,-147.91\n2007-08-30,147.18,145.31,146.15,145.45,140.12971113666558,140.12971113666558,139.32954240389122,139.32954240389122,139.32954240389122,-147.377\n2007-08-31,148.5,146.83,147.47,147.67,140.61692846846563,140.61692846846563,139.6863607077356,139.6863607077356,139.6863607077356,134.505\n2007-09-04,149.98,147.4,149.2,147.47,141.2475741909884,141.2475741909884,140.1270426723488,140.1270426723488,140.1270426723488,134.7849\n2007-09-05,148.36,147.0,147.55,148.18,142.12081677188954,142.12081677188954,140.71822011200788,140.71822011200788,140.71822011200788,135.24075299999998\n2007-09-06,148.61,147.13,148.26,147.95,142.9067350947006,142.9067350947006,141.2739269052874,141.2739269052874,141.2739269052874,135.68293040999998\n2007-09-07,146.89,145.26,145.84,146.48,143.61406158523053,143.61406158523053,141.79629129097015,141.79629129097015,141.79629129097015,136.1118424977\n2007-09-10,146.71,144.34,145.51,146.51,144.25065542670748,144.25065542670748,142.28731381351193,142.28731381351193,142.28731381351193,136.52788722276898\n2007-09-11,147.7,146.13,147.64,146.23,144.34,144.34,142.74887498470122,142.74887498470122,142.74887498470122,136.93145060608592\n2007-09-12,148.43,146.99,147.64,147.28,144.34,144.34,143.18274248561914,143.18274248561914,143.18274248561914,137.32290708790333\n2007-09-13,149.45,148.2,148.81,148.57,144.904,144.904,143.590577936482,143.590577936482,143.590577936482,137.70261987526624\n2007-09-14,149.09,147.74,148.93,147.95,145.4116,145.4116,143.97394326029308,143.97394326029308,143.97394326029308,138.07094127900825\n2007-09-17,148.65,147.63,148.13,148.29,145.86844,145.86844,144.3343066646755,144.3343066646755,144.3343066646755,138.428213040638\n2007-09-18,152.5,148.37,152.39,148.83,146.279596,146.279596,144.67304826479497,144.67304826479497,144.67304826479497,138.77476664941886\n2007-09-19,154.37,152.71,153.36,153.41,147.02604448,147.02604448,145.22093488625933,145.22093488625933,145.22093488625933,139.32377598344212\n2007-09-20,153.43,152.11,152.34,153.35,148.0541982528,148.0541982528,145.95286009535857,145.95286009535857,145.95286009535857,140.07608718427002\n2007-09-21,152.88,152.25,152.27,152.7,148.938410497408,148.938410497408,146.6262312877299,146.6262312877299,146.6262312877299,140.7907828250565\n2007-09-24,152.81,151.36,151.55,152.43,149.6988330277709,149.6988330277709,147.2457327847115,147.2457327847115,147.2457327847115,141.4697436838037\n2007-09-25,151.65,150.47,151.64,150.81,150.35279640388296,150.35279640388296,147.81567416193457,147.81567416193457,147.81567416193457,142.11475649961352\n2007-09-26,152.77,151.64,152.37,152.27,150.47,150.47,148.3400202289798,148.3400202289798,148.3400202289798,142.72751867463285\n2007-09-27,153.08,152.36,152.94,152.89,150.47,150.47,148.8224186106614,148.8224186106614,148.8224186106614,143.3096427409012\n2007-09-28,153.19,151.98,152.47,152.85,151.016,151.016,149.2662251218085,149.2662251218085,149.2662251218085,143.86266060385614\n2007-10-01,154.74,152.6,154.52,152.61,151.48556,151.48556,149.67452711206383,149.67452711206383,149.67452711206383,144.38802757366332\n2007-10-02,154.65,153.81,154.43,154.62,151.98,151.98,150.13041967197807,150.13041967197807,150.13041967197807,145.00914591924354\n2007-10-03,154.41,153.45,153.8,153.81,152.42159999999998,152.42159999999998,150.54528190150006,150.54528190150006,150.54528190150006,145.59299716408893\n2007-10-04,154.26,153.59,154.16,154.1,152.792544,152.792544,150.92280653036505,150.92280653036505,150.92280653036505,146.1418173342436\n2007-10-05,156.1,154.64,155.6,155.02,153.10413696,153.10413696,151.2663539426322,151.2663539426322,151.2663539426322,146.65770829418898\n2007-10-08,155.49,154.77,155.19,155.39,153.59,153.59,151.74971854836897,151.74971854836897,151.74971854836897,147.31866871359574\n2007-10-09,156.4,155.03,156.4,155.6,154.0418,154.0418,152.18474669353208,152.18474669353208,152.18474669353208,147.93336190364403\n2007-10-10,156.44,155.41,156.03,156.04,154.51344,154.51344,152.64842455724354,152.64842455724354,152.64842455724354,148.61069295135252\n2007-10-11,157.52,154.54,155.35,156.92,157.52,-157.52,153.10341361037433,153.10341361037433,153.10341361037433,149.3153305857308\n2007-10-12,156.23,155.27,156.06,155.47,157.52,-157.52,153.67756984102567,153.67756984102567,153.67756984102567,150.13579752715773\n2007-10-15,156.36,153.94,154.83,156.27,157.52,-157.52,-157.52,-157.52,-157.52,150.87421777444197\n2007-10-16,154.51,153.48,153.77,154.41,157.3768,-157.3768,-157.4126,-157.4126,-157.4126,151.53879599699778\n2007-10-17,155.09,152.47,154.03,155.0,157.142992,-157.142992,-157.21597,-157.21597,-157.21597,152.136916397298\n2007-10-18,154.19,153.08,153.82,153.44,156.76915264,-156.76915264,-156.8837521,-156.8837521,-156.8837521,152.47\n2007-10-19,153.15,149.91,149.97,153.1,156.42522042879997,-156.42522042879997,-156.57478945300002,-156.57478945300002,-156.57478945300002,-160.6704\n2007-10-22,150.76,148.66,150.6,148.83,155.77369838591997,-155.77369838591997,-155.97495840223002,-155.97495840223002,-155.97495840223002,-160.347588\n2007-10-23,151.95,150.26,151.94,151.3,154.92005457960957,-154.92005457960957,-155.1703129779847,-155.1703129779847,-155.1703129779847,-159.7632086\n2007-10-24,151.71,148.84,151.56,151.21,154.1688480300564,-154.1688480300564,-154.4541785504064,-154.4541785504064,-154.4541785504064,-159.20804817\n2007-10-25,152.29,149.89,151.32,151.68,153.50778626644964,-153.50778626644964,-153.8168189098617,-153.8168189098617,-153.8168189098617,-158.68064576150002\n2007-10-26,153.5,151.9,153.45,153.06,148.66,148.66,148.66,148.66,148.66,-158.179613473425\n2007-10-29,154.44,153.56,154.0,153.92,148.7568,148.7568,148.7568,148.7568,148.7568,-157.70363279975376\n2007-10-30,153.75,152.87,153.06,153.43,148.984128,148.984128,148.927296,148.927296,148.927296,-157.25145115976608\n2007-10-31,155.26,152.85,154.79,153.98,149.20236288,149.20236288,149.09267712000002,149.09267712000002,149.09267712000002,-156.82187860177777\n2007-11-01,153.4,150.59,150.78,153.33,149.5658211072,149.5658211072,149.3393700352,149.3393700352,149.3393700352,-156.4137846716889\n2007-11-02,151.55,149.22,151.11,151.54,155.26,-155.26,-155.26,-155.26,-155.26,-156.02609543810445\n2007-11-05,151.14,148.97,150.19,149.63,155.1392,-155.1392,-155.0788,-155.0788,-155.0788,-155.65779066619922\n2007-11-06,152.09,149.9,152.09,150.84,154.89243199999999,-154.89243199999999,-154.77336,-154.77336,-154.77336,-155.30790113288927\n2007-11-07,151.13,147.56,147.59,150.43,154.65553472,-154.65553472,-154.483192,-154.483192,-154.483192,-154.9755060762448\n2007-11-08,148.4,145.07,147.53,147.98,154.2298026368,-154.2298026368,-153.99856856,-153.99856856,-153.99856856,-154.4564206509077\n2007-11-09,147.54,144.9,145.26,145.51,153.497018425856,-153.497018425856,-153.1949973896,-153.1949973896,-153.1949973896,-153.611642792326\n2007-11-12,146.61,143.93,143.99,145.2,152.6373165832704,-152.6373165832704,-152.282547676744,-152.282547676744,-152.282547676744,-152.65336208517013\n2007-11-13,148.3,145.22,148.19,145.26,151.59243859327796,-151.59243859327796,-151.19671647876729,-151.19671647876729,-151.19671647876729,-151.519325014098\n2007-11-14,149.39,146.81,147.1,149.22,150.6729459620846,-150.6729459620846,-150.25204333652755,-150.25204333652755,-150.25204333652755,-150.53271276226525\n2007-11-15,147.49,144.52,145.36,146.79,149.86379244663445,-149.86379244663445,-149.43017770277896,-149.43017770277896,-149.43017770277896,-149.67436010317076\n2007-11-16,146.46,144.58,146.04,146.28,149.39,-149.39,-149.39,-149.39,-149.39,-149.39\n2007-11-19,145.36,143.2,143.56,145.28,148.73479999999998,-148.73479999999998,-148.68019999999999,-148.68019999999999,-148.68019999999999,-148.68019999999999\n2007-11-20,145.52,142.12,144.2,143.64,147.959928,-147.959928,-147.85816999999997,-147.85816999999997,-147.85816999999997,-147.85816999999997\n2007-11-21,143.91,141.74,141.81,143.08,147.02553952,-147.02553952,-146.88268109999999,-146.88268109999999,-146.88268109999999,-146.88268109999999\n2007-11-23,144.34,142.71,144.18,143.01,146.0741424064,-146.0741424064,-145.90557169099998,-145.90557169099998,-145.90557169099998,-145.90557169099998\n2007-11-26,144.87,140.78,140.82,144.38,145.293996773248,-145.293996773248,-145.11411306971,-145.11411306971,-145.11411306971,-145.11411306971\n2007-11-27,143.23,140.95,143.09,141.74,144.87,-144.87,-144.87,-144.87,-144.87,-144.87\n2007-11-28,147.47,144.14,147.26,144.21,140.78,140.78,140.78,140.78,140.78,137.9644\n2007-11-29,147.72,146.11,147.27,146.61,140.9138,140.9138,140.9138,140.9138,140.9138,138.154512\n2007-11-30,149.25,147.34,148.46,149.04,141.186048,141.186048,141.117986,141.117986,141.117986,138.44147664000002\n2007-12-03,148.44,147.3,147.56,148.21,141.66988512,141.66988512,141.44326656,141.44326656,141.44326656,138.87381757440002\n2007-12-04,147.34,146.31,146.55,146.66,142.1246920128,142.1246920128,141.7555358976,141.7555358976,141.7555358976,139.288864871424\n2007-12-05,149.0,147.83,148.86,147.92,142.552210492032,142.552210492032,142.05531446169599,142.05531446169599,142.05531446169599,139.68731027656705\n2007-12-06,151.21,148.57,151.11,148.63,142.95407786251008,142.95407786251008,142.34310188322814,142.34310188322814,142.34310188322814,140.06981786550438\n2007-12-07,151.5,150.62,150.75,151.42,143.61455163350928,143.61455163350928,142.78644678906673,142.78644678906673,142.78644678906673,140.62682697222917\n2007-12-10,152.24,150.86,152.03,151.25,144.40309647015835,144.40309647015835,143.30925998172273,143.30925998172273,143.30925998172273,141.2792173538954\n2007-12-11,152.88,147.96,148.24,152.12,145.34352489373936,145.34352489373936,143.93441178300213,143.93441178300213,143.93441178300213,142.04647213912273\n2007-12-12,151.72,147.2,149.13,151.52,146.39863140861584,146.39863140861584,144.65005884036196,144.65005884036196,144.65005884036196,142.91315436799292\n2007-12-13,149.37,147.3,149.3,148.32,147.2,147.2,145.308454133133,145.308454133133,145.308454133133,143.71050201855348\n2007-12-14,149.1,147.17,147.18,148.05,152.88,-152.88,145.91417780248236,145.91417780248236,145.91417780248236,144.44406185706922\n2007-12-17,146.87,144.94,145.07,146.62,152.76579999999998,-152.76579999999998,-152.88,-152.88,-152.88,-155.9376\n2007-12-18,146.47,143.96,145.82,146.09,152.452768,-152.452768,-152.6418,-152.6418,-152.6418,-155.607672\n2007-12-19,146.89,144.94,145.63,145.93,151.94320191999998,-151.94320191999998,-152.20771,-152.20771,-152.20771,-155.02528840000002\n2007-12-20,146.85,145.18,146.54,146.84,151.4642098048,-151.4642098048,-151.7953245,-151.7953245,-151.7953245,-154.47202398000002\n2007-12-21,148.27,147.09,148.2,147.36,151.01395721651198,-151.01395721651198,-151.403558275,-151.403558275,-151.403558275,-153.94642278100002\n2007-12-24,149.48,148.54,149.2,148.73,150.59071978352125,-150.59071978352125,-151.03138036125,-151.03138036125,-151.03138036125,-153.44710164195\n2007-12-26,149.62,148.5,149.48,148.84,150.19287659651,-150.19287659651,-150.6778113431875,-150.6778113431875,-150.6778113431875,-152.9727465598525\n2007-12-27,149.03,147.32,147.52,149.01,149.81890400071939,-149.81890400071939,-150.34192077602813,-150.34192077602813,-150.34192077602813,-152.52210923185987\n2007-12-28,148.61,146.9,147.54,148.54,149.62,-149.62,-150.02282473722673,-150.02282473722673,-150.02282473722673,-152.09400377026688\n2007-12-31,147.33,146.26,146.42,147.1,149.28040000000001,-149.28040000000001,-149.7196835003654,-149.7196835003654,-149.7196835003654,-151.68730358175353\n2008-01-02,146.99,143.88,144.56,146.53,148.96117600000002,-148.96117600000002,-149.43169932534713,-149.43169932534713,-149.43169932534713,-151.30093840266585\n2008-01-03,145.49,144.13,144.46,144.92,148.55468192,-148.55468192,-149.04308037257283,-149.04308037257283,-149.04308037257283,-150.78147271447924\n2008-01-04,143.44,140.92,140.93,143.34,148.18070736640001,-148.18070736640001,-148.68166474649274,-148.68166474649274,-148.68166474649274,-150.2983696244657\n2008-01-07,142.23,140.11,141.46,141.81,147.45463662976002,-147.45463662976002,-147.9831149193084,-147.9831149193084,-147.9831149193084,-149.45431635826378\n2008-01-08,142.9,138.63,138.81,142.08,146.57328023418881,-146.57328023418881,-147.11707227818448,-147.11707227818448,-147.11707227818448,-148.42644155885478\n2008-01-09,140.79,137.7,140.78,139.02,145.46122100140238,-145.46122100140238,-146.0137528820205,-146.0137528820205,-146.0137528820205,-147.15290415620365\n2008-01-10,142.8,139.37,141.8,139.7,144.219425641178,-144.219425641178,-144.76668994971743,-144.76668994971743,-144.76668994971743,-145.7349685327731\n2008-01-11,141.57,139.29,140.03,140.76,143.1763175385895,-143.1763175385895,-143.70668645725982,-143.70668645725982,-143.70668645725982,-144.52972325285714\n2008-01-14,141.7,140.41,141.46,141.16,142.8,-142.8,-142.80568348867084,-142.80568348867084,-142.80568348867084,-143.50526476492857\n2008-01-15,140.1,137.91,137.95,139.74,141.984,-141.984,-142.03983096537021,-142.03983096537021,-142.03983096537021,-142.63447505018928\n2008-01-16,139.12,136.28,137.14,137.38,141.7,-141.7,-141.7,-141.7,-141.7,-141.89430379266088\n2008-01-17,137.7,132.93,133.23,137.58,140.7244,-140.7244,-140.77859999999998,-140.77859999999998,-140.77859999999998,-140.93987214790852\n2008-01-18,135.01,131.11,132.49,134.18,139.16552000000001,-139.16552000000001,-139.287366,-139.287366,-139.287366,-139.4179964398059\n2008-01-22,132.25,126.0,131.02,126.45,137.7,-137.7,-137.7,-137.7,-137.7,-137.7\n2008-01-23,133.88,126.84,133.62,127.12,135.35999999999999,-135.35999999999999,-135.01,-135.01,-135.01,-135.01\n2008-01-24,135.45,133.32,134.99,134.28,126.0,126.0,126.0,126.0,126.0,123.48\n2008-01-25,136.76,132.6,132.98,136.5,126.189,126.189,126.189,126.189,126.189,123.71940000000001\n2008-01-28,135.33,132.06,135.32,133.29,126.61183999999999,126.61183999999999,126.50613,126.50613,126.50613,124.110618\n2008-01-29,136.45,134.89,136.07,136.1,127.01776639999999,127.01776639999999,126.8137461,126.8137461,126.8137461,124.49009946\n2008-01-30,138.54,135.15,135.37,135.58,127.40745574399999,127.40745574399999,127.112133717,127.112133717,127.112133717,124.85819647619999\n2008-01-31,138.54,133.2,137.44,133.4,128.07540839936,128.07540839936,127.56924836832,127.56924836832,127.56924836832,125.405468617152\n2008-02-01,139.61,137.52,139.45,137.92,128.70328389539839,128.70328389539839,128.0080784335872,128.0080784335872,128.0080784335872,125.93084987246591\n2008-02-04,139.3,137.89,138.02,139.19,129.57582118376652,129.57582118376652,128.58817451190785,128.58817451190785,128.58817451190785,126.61480737884261\n2008-02-05,136.25,133.68,133.72,135.87,130.3785554890652,130.3785554890652,129.13926578631245,129.13926578631245,129.13926578631245,127.26456700990049\n2008-02-06,135.25,132.41,132.72,134.57,131.11707104994,131.11707104994,129.66280249699682,129.66280249699682,129.66280249699682,127.88183865940546\n2008-02-07,134.78,131.73,133.78,132.08,139.61,-139.61,130.16016237214697,130.16016237214697,130.16016237214697,128.46824672643518\n2008-02-08,134.21,132.11,133.12,133.24,139.4524,-139.4524,130.6326542535396,130.6326542535396,130.6326542535396,129.02533439011341\n2008-02-11,134.22,132.04,133.91,133.1,139.297952,-139.297952,131.08152154086264,131.08152154086264,131.08152154086264,129.55456767060775\n2008-02-12,136.3,133.98,134.92,134.91,139.14659296000002,-139.14659296000002,131.5079454638195,131.5079454638195,131.5079454638195,130.05733928707735\n2008-02-13,137.06,135.16,136.71,136.02,138.99826110080002,-138.99826110080002,131.91304819062853,131.91304819062853,131.91304819062853,130.5349723227235\n2008-02-14,137.0,134.79,135.01,136.94,138.852895878784,-138.852895878784,132.2978957810971,132.2978957810971,132.2978957810971,130.9887237065873\n2008-02-15,135.15,133.91,135.07,134.55,138.71043796120833,-138.71043796120833,132.66350099204226,132.66350099204226,132.66350099204226,131.41978752125794\n2008-02-19,136.88,134.61,135.03,136.67,138.57082920198417,-138.57082920198417,133.01082594244014,133.01082594244014,133.01082594244014,131.82929814519505\n2008-02-20,136.55,133.77,136.11,134.0,138.4340126179445,-138.4340126179445,133.34078464531814,133.34078464531814,133.34078464531814,132.2183332379353\n2008-02-21,137.0,134.07,134.48,136.66,138.2999323655856,-138.2999323655856,133.65424541305222,133.65424541305222,133.65424541305222,132.58791657603854\n2008-02-22,135.65,132.87,135.64,134.98,138.1685337182739,-138.1685337182739,-139.61,-139.61,-139.61,-142.40220000000002\n2008-02-25,137.65,134.78,137.31,135.55,138.0397630439084,-138.0397630439084,-139.4078,-139.4078,-139.4078,-142.11623400000002\n2008-02-26,138.95,136.5,138.35,136.75,131.73,131.73,-139.211666,-139.211666,-139.211666,-141.83884698000003\n2008-02-27,139.14,137.42,138.12,137.58,131.87439999999998,131.87439999999998,132.87,132.87,132.87,-141.56978157060001\n2008-02-28,137.96,136.56,137.0,137.25,132.165024,132.165024,132.99540000000002,132.99540000000002,132.99540000000002,-141.308788123482\n2008-02-29,135.68,132.78,133.25,135.6,132.44402304,132.44402304,-139.14,-139.14,-139.14,-141.05562447977755\n2008-03-03,133.81,132.24,133.39,133.16,139.14,-139.14,-138.9492,-138.9492,-138.9492,-140.64184325578867\n2008-03-04,133.4,130.99,132.92,132.26,139.00199999999998,-139.00199999999998,-138.61373999999998,-138.61373999999998,-138.61373999999998,-140.05371422788346\n2008-03-05,134.76,132.34,133.7,133.43,138.68151999999998,-138.68151999999998,-138.08007819999997,-138.08007819999997,-138.08007819999997,-139.23797994737396\n2008-03-06,133.21,130.66,130.82,132.98,138.37385919999997,-138.37385919999997,-137.58377272599998,-137.58377272599998,-137.58377272599998,-138.4956617521103\n2008-03-07,131.74,128.58,129.71,129.72,137.91102764799996,-137.91102764799996,-136.96063318065998,-136.96063318065998,-136.96063318065998,-137.63373895937815\n2008-03-10,129.92,127.59,127.86,129.79,137.16454543615995,-137.16454543615995,-136.03876353078738,-136.03876353078738,-136.03876353078738,-136.456752894659\n2008-03-11,132.45,128.96,132.39,130.71,136.20709089254396,-136.20709089254396,-134.94042427178502,-134.94042427178502,-134.94042427178502,-135.12673996046016\n2008-03-12,133.77,131.16,131.31,132.75,135.34538180328957,-135.34538180328957,-133.98486911645296,-133.98486911645296,-133.98486911645296,-133.99622896639113\n2008-03-13,132.61,128.6,131.92,129.61,134.5698436229606,-134.5698436229606,-133.77,-133.77,-133.77,-133.77\n2008-03-14,132.81,127.78,129.26,132.77,133.87185926066454,-133.87185926066454,-133.77,-133.77,-133.77,-133.77\n2008-03-17,129.25,126.08,127.9,126.35,133.24367333459807,-133.24367333459807,-132.9666,-132.9666,-132.9666,-132.84300000000002\n2008-03-18,133.38,129.98,133.32,130.6,126.08,126.08,126.08,126.08,126.08,123.55839999999999\n2008-03-19,134.65,130.24,130.36,134.15,126.08,126.08,126.08,126.08,126.08,123.754832\n2008-03-20,132.9,129.26,132.73,130.03,126.4228,126.4228,126.33709999999999,126.33709999999999,126.33709999999999,124.08168703999999\n2008-03-24,135.81,133.24,134.77,133.31,126.751888,126.751888,126.58648699999999,126.58648699999999,126.58648699999999,124.39873642879999\n2008-03-25,135.54,133.77,135.05,134.83,127.29537472,127.29537472,126.95542751999999,126.95542751999999,126.95542751999999,124.855186971648\n2008-03-26,134.58,133.46,133.83,134.46,127.80625223679999,127.80625223679999,127.30961041919998,127.30961041919998,127.30961041919998,125.29337949278208\n2008-03-27,134.44,132.37,132.45,134.2,128.286477102592,128.286477102592,127.64962600243199,127.64962600243199,127.64962600243199,125.7140443130708\n2008-03-28,133.35,131.08,131.4,132.99,128.73788847643647,128.73788847643647,127.97604096233471,127.97604096233471,127.97604096233471,126.11788254054797\n2008-03-31,132.73,131.09,131.94,131.28,129.1622151678503,129.1622151678503,128.2893993238413,128.2893993238413,128.2893993238413,126.50556723892605\n2008-04-01,136.84,133.52,136.8,133.6,129.56108225777928,129.56108225777928,128.59022335088767,128.59022335088767,128.59022335088767,126.87774454936901\n2008-04-02,137.66,135.99,136.66,137.06,130.14339567715695,130.14339567715695,129.00271218334328,129.00271218334328,129.00271218334328,127.37585732190057\n2008-04-03,137.43,135.71,136.8,135.94,130.89505610944124,130.89505610944124,129.5221494523427,129.5221494523427,129.5221494523427,127.99290588258654\n2008-04-04,137.96,136.12,136.97,136.95,131.57155049849712,131.57155049849712,130.01042048520213,130.01042048520213,130.01042048520213,128.57293152963135\n2008-04-07,138.57,136.75,137.05,137.87,132.33816443867747,132.33816443867747,130.56689105123797,130.56689105123797,130.56689105123797,129.23002632255717\n2008-04-08,136.92,135.95,136.47,136.18,133.21062141726262,133.21062141726262,131.20713976713893,131.20713976713893,131.20713976713893,129.9772242167526\n2008-04-09,136.8,134.9,135.39,136.62,133.96093441884585,133.96093441884585,131.79616858576782,131.79616858576782,131.79616858576782,130.66464627941238\n2008-04-10,136.67,134.9,135.94,135.4,134.60620360020744,134.60620360020744,132.3380750989064,132.3380750989064,132.3380750989064,131.2970745770594\n2008-04-11,135.03,133.01,133.29,134.46,138.57,-138.57,132.83662909099388,132.83662909099388,132.83662909099388,131.87890861089463\n2008-04-14,133.54,132.55,132.81,133.19,138.4588,-138.4588,-138.57,-138.57,-138.57,132.41419592202305\n2008-04-15,133.69,132.33,133.52,133.57,138.22244799999999,-138.22244799999999,-138.3894,-138.3894,-138.3894,-141.3414\n2008-04-16,136.5,134.51,136.23,134.53,137.86890111999998,-137.86890111999998,-138.08643,-138.08643,-138.08643,-141.071058\n2008-04-17,136.82,135.67,136.48,136.01,137.53656705279997,-137.53656705279997,-137.7986085,-137.7986085,-137.7986085,-140.80882626\n2008-04-18,139.56,138.26,138.96,138.95,132.33,132.33,132.33,132.33,132.33,-140.5544614722\n2008-04-21,138.98,137.85,138.78,138.22,132.4746,132.4746,132.4746,132.4746,132.4746,-140.307727628034\n2008-04-22,138.3,136.9,137.69,138.19,132.616308,132.616308,132.616308,132.616308,132.616308,-140.06839579919298\n2008-04-23,138.78,137.12,137.98,138.08,132.75518184,132.75518184,132.75518184,132.75518184,132.75518184,-139.8362439252172\n2008-04-24,139.74,137.04,138.79,138.09,132.89127820320002,132.89127820320002,132.89127820320002,132.89127820320002,132.89127820320002,129.6834\n2008-04-25,139.89,137.91,139.76,139.4,133.165227075072,133.165227075072,133.096739857104,133.096739857104,133.096739857104,129.884532\n2008-04-28,140.24,139.39,139.62,139.89,133.56871345056769,133.56871345056769,133.36847026281984,133.36847026281984,133.36847026281984,130.18469604\n2008-04-29,139.73,138.62,139.07,139.4,134.10241637452228,134.10241637452228,133.71204674967885,133.71204674967885,133.71204674967885,130.5869081984\n2008-04-30,140.58,138.36,138.43,139.3,134.59342306456048,134.59342306456048,134.0384444121949,134.0384444121949,134.0384444121949,130.973031870464\n2008-05-01,141.02,138.27,140.93,138.39,135.19208075810442,135.19208075810442,134.43093774746322,134.43093774746322,134.43093774746322,131.4533802769408\n2008-05-02,142.35,140.57,141.34,142.33,135.8914310671319,135.8914310671319,134.8921721051408,134.8921721051408,134.8921721051408,132.02737746032435\n2008-05-05,141.55,140.41,140.71,141.05,136.79563071773342,136.79563071773342,135.48879833672953,135.48879833672953,135.48879833672953,132.74996103810165\n2008-05-06,142.19,139.69,141.84,140.02,137.57324241725073,137.57324241725073,136.03769446979118,136.03769446979118,136.03769446979118,133.42196376543453\n2008-05-07,142.04,139.14,139.28,141.89,138.24198847883562,138.24198847883562,136.5426789122079,136.5426789122079,136.5426789122079,134.0469263018541\n2008-05-08,140.32,138.98,139.84,139.75,138.81711009179864,138.81711009179864,137.00726459923126,137.00726459923126,137.00726459923126,134.62814146072432\n2008-05-09,139.39,138.45,138.93,138.6,142.35,-142.35,137.43468343129277,137.43468343129277,137.43468343129277,135.16867155847362\n2008-05-12,140.53,138.73,140.47,139.24,142.272,-142.272,137.82790875678936,137.82790875678936,137.82790875678936,135.67136454938046\n2008-05-13,140.88,139.74,140.4,140.82,142.19556,-142.19556,138.1896760562462,138.1896760562462,138.1896760562462,136.13886903092381\n2008-05-14,142.2,140.88,140.96,141.1,138.45,138.45,138.52250197174652,138.52250197174652,138.52250197174652,136.57364819875914\n2008-05-15,142.63,140.83,142.55,141.04,138.52499999999998,138.52499999999998,138.8287018140068,138.8287018140068,138.8287018140068,136.977992824846\n2008-05-16,142.87,141.61,142.65,142.86,138.68919999999997,138.68919999999997,139.17081865074618,139.17081865074618,139.17081865074618,137.43015339885832\n2008-05-19,144.22,142.33,142.83,142.8,138.94004799999996,138.94004799999996,139.54073678567156,139.54073678567156,139.54073678567156,137.91973959296107\n2008-05-20,142.34,141.07,141.63,142.27,139.36244415999997,139.36244415999997,140.0554557392477,140.0554557392477,140.0554557392477,138.54976563366495\n2008-05-21,142.12,139.04,139.31,141.81,144.22,-144.22,-144.22,-144.22,-144.22,-147.1044\n2008-05-22,140.16,139.24,139.57,139.43,144.1164,-144.1164,-144.06459999999998,-144.06459999999998,-144.06459999999998,-146.862468\n2008-05-23,139.2,137.57,137.86,139.04,144.014872,-144.014872,-143.913862,-143.913862,-143.913862,-146.62779396000002\n2008-05-27,139.0,137.53,138.74,137.8,143.75707712,-143.75707712,-143.5966689,-143.5966689,-143.5966689,-146.174904262\n2008-05-28,139.37,138.05,139.37,139.18,143.3834524928,-143.3834524928,-143.172002077,-143.172002077,-143.172002077,-145.56976096366\n2008-05-29,140.92,139.08,140.03,139.13,143.03224534323198,-143.03224534323198,-142.77706193161,-142.77706193161,-142.77706193161,-145.0069776962038\n2008-05-30,140.74,140.06,140.1,140.47,142.70211062263806,-142.70211062263806,-142.4097675963973,-142.4097675963973,-142.4097675963973,-144.48358925746953\n2008-06-02,139.84,138.03,138.83,139.82,142.39178398527977,-142.39178398527977,-142.06818386464948,-142.06818386464948,-142.06818386464948,-143.99683800944666\n2008-06-03,139.62,137.23,138.01,139.33,142.100076946163,-142.100076946163,-141.75051099412403,-141.75051099412403,-141.75051099412403,-143.5441593487854\n2008-06-04,139.16,137.46,138.04,137.79,141.71047079046997,-141.71047079046997,-141.34366500465288,-141.34366500465288,-141.34366500465288,-142.9758850073947\n2008-06-05,140.82,138.32,140.64,138.57,141.35203312723237,-141.35203312723237,-140.97343515423412,-140.97343515423412,-140.97343515423412,-142.45875535672917\n2008-06-06,139.8,136.35,136.38,139.58,141.02227047705378,-141.02227047705378,-140.82,-140.82,-140.82,-141.98816737462354\n2008-06-09,137.5,135.42,136.62,136.86,140.82,-140.82,-140.82,-140.82,-140.82,-141.36796896341497\n2008-06-10,137.1,135.52,136.14,135.66,140.172,-140.172,-140.118,-140.118,-140.118,-140.59473299817103\n2008-06-11,136.08,133.94,133.95,135.97,139.60175999999998,-139.60175999999998,-139.50726,-139.50726,-139.50726,-139.9220177084088\n2008-06-12,135.77,133.52,134.45,134.6,138.8091136,-138.8091136,-138.672171,-138.672171,-138.672171,-139.02471505214746\n2008-06-13,136.42,134.61,136.4,135.18,137.962855424,-137.962855424,-137.79630193,-137.79630193,-137.79630193,-138.0889134932824\n2008-06-16,136.93,135.46,136.39,135.52,137.25199855616,-137.25199855616,-137.0693306019,-137.0693306019,-137.0693306019,-137.3121981994244\n2008-06-17,137.11,135.45,135.5,137.06,133.52,133.52,133.52,133.52,133.52,130.8496\n2008-06-18,135.08,133.72,134.32,134.7,133.5918,133.5918,133.5918,133.5918,133.5918,130.974808\n2008-06-19,135.24,133.52,134.71,134.15,137.11,-137.11,-137.11,-137.11,-137.11,131.09751184\n2008-06-20,133.09,131.23,131.59,132.84,137.03820000000002,-137.03820000000002,-137.00230000000002,-137.00230000000002,-137.00230000000002,131.21776160320002\n2008-06-23,132.22,131.32,131.63,132.04,136.80587200000002,-136.80587200000002,-136.71368500000003,-136.71368500000003,-136.71368500000003,131.23\n2008-06-24,132.44,130.2,131.24,131.05,136.58283712000002,-136.58283712000002,-136.43950075000004,-136.43950075000004,-136.43950075000004,-139.8522\n2008-06-25,133.4,131.62,132.0,131.73,136.19986689280003,-136.19986689280003,-136.00273569750004,-136.00273569750004,-136.00273569750004,-139.562634\n2008-06-26,130.75,128.17,128.21,130.59,135.83987487923204,-135.83987487923204,-135.59654419867505,-135.59654419867505,-135.59654419867505,-139.28175498000002\n2008-06-27,128.86,127.04,127.8,128.29,135.22628488889347,-135.22628488889347,-134.92815522079428,-134.92815522079428,-134.92815522079428,-138.726167231\n2008-06-30,128.91,127.3,127.84,127.89,134.40765640000413,-134.40765640000413,-134.0604581465069,-134.0604581465069,-134.0604581465069,-137.90813552483002\n2008-07-01,128.45,125.94,128.37,126.52,133.67089076000372,-133.67089076000372,-133.28820775039114,-133.28820775039114,-133.28820775039114,-137.14736603809192\n2008-07-02,129.15,126.04,126.07,128.79,132.74318386880327,-132.74318386880327,-132.3329407428403,-132.3329407428403,-132.3329407428403,-136.13870309466364\n2008-07-03,127.12,125.05,126.38,127.09,131.92680180454687,-131.92680180454687,-131.50185844627106,-131.50185844627106,-131.50185844627106,-135.22081981614392\n2008-07-07,127.34,123.92,125.09,126.78,130.9640495519103,-130.9640495519103,-130.5340796793304,-130.5340796793304,-130.5340796793304,-134.1020296363681\n2008-07-08,127.39,124.21,127.28,125.0,129.83700162360466,-129.83700162360466,-129.40968613384425,-129.40968613384425,-129.40968613384425,-132.77836578364023\n2008-07-09,127.74,124.39,124.43,127.49,128.8902813638279,-128.8902813638279,-128.47643949109073,-128.47643949109073,-128.47643949109073,-131.626778231767\n2008-07-10,125.79,123.6,125.38,124.44,128.09503634561545,-128.09503634561545,-127.74,-127.74,-127.74,-130.62489706163728\n2008-07-11,125.74,122.49,124.02,123.92,127.74,-127.74,-127.74,-127.74,-127.74,-129.5711625023917\n2008-07-14,125.5,122.41,122.82,125.28,126.69,-126.69,-126.63749999999999,-126.63749999999999,-126.63749999999999,-128.3673648769851\n2008-07-15,123.46,120.03,121.43,121.81,125.834,-125.834,-125.74,-125.74,-125.74,-127.23546555035793\n2008-07-16,124.57,121.11,124.47,121.56,125.5,-125.5,-125.5,-125.5,-125.5,-125.72231778478276\n2008-07-17,126.26,124.11,125.9,125.15,120.03,120.03,120.03,120.03,120.03,117.6294\n2008-07-18,126.28,125.15,125.92,126.17,120.1546,120.1546,120.1546,120.1546,120.1546,117.802012\n2008-07-21,126.79,125.55,125.99,126.51,120.39961600000001,120.39961600000001,120.338362,120.338362,120.338362,118.05635164\n2008-07-22,127.8,124.89,127.69,125.17,120.78303904,120.78303904,120.59642752,120.59642752,120.59642752,118.40569757440001\n2008-07-23,129.14,127.58,128.22,127.9,121.34439591680001,121.34439591680001,120.956606144,120.956606144,120.956606144,118.87541269568001\n2008-07-24,128.41,125.16,125.43,128.37,122.12395632512,122.12395632512,121.44760977536001,121.44760977536001,121.44760977536001,119.4912879339392\n2008-07-25,126.33,125.18,125.72,125.9,122.82556069260801,122.82556069260801,121.9091531888384,121.9091531888384,121.9091531888384,120.07021065790285\n2008-07-28,126.06,123.43,123.56,125.49,129.14,-129.14,122.34300399750809,122.34300399750809,122.34300399750809,120.61439801842867\n2008-07-29,126.3,123.85,126.27,123.99,129.02579999999998,-129.02579999999998,122.7508237576576,122.7508237576576,122.7508237576576,121.12593413732296\n2008-07-30,128.47,126.51,128.45,127.02,128.91388399999997,-128.91388399999997,123.13417433219814,123.13417433219814,123.13417433219814,121.60677808908358\n2008-07-31,128.57,126.63,126.85,127.44,128.80420631999996,-128.80420631999996,123.49452387226626,123.49452387226626,123.49452387226626,122.05877140373856\n2008-08-01,127.28,125.46,126.11,127.13,128.69672219359995,-128.69672219359995,123.83325243993028,123.83325243993028,123.83325243993028,122.48364511951425\n2008-08-04,126.14,124.76,124.92,126.04,128.59138774972794,-128.59138774972794,124.15165729353446,124.15165729353446,124.15165729353446,122.8830264123434\n2008-08-05,128.47,125.9,128.42,126.02,128.4881599947334,-128.4881599947334,124.45095785592238,124.45095785592238,124.45095785592238,123.25844482760279\n2008-08-06,129.3,127.68,129.09,128.05,123.43,123.43,124.73230038456704,124.73230038456704,124.73230038456704,123.61133813794662\n2008-08-07,128.44,126.54,126.86,127.95,123.54740000000001,123.54740000000001,125.05203935764735,125.05203935764735,125.05203935764735,124.00954446829036\n2008-08-08,129.93,126.39,129.62,126.6,123.66245200000002,123.66245200000002,125.34939660261203,125.34939660261203,125.34939660261203,124.37987635551004\n2008-08-11,131.5,129.23,130.65,129.45,123.91315392000001,123.91315392000001,125.71584487440307,125.71584487440307,125.71584487440307,124.82388624706924\n2008-08-12,130.35,128.73,129.24,130.29,124.36836468480001,124.36836468480001,126.2364188357068,126.2364188357068,126.2364188357068,125.424736484833\n2008-08-13,129.65,127.67,128.82,128.78,124.79626280371201,124.79626280371201,126.71014114049319,126.71014114049319,126.71014114049319,125.97151020119803\n2008-08-14,130.28,127.75,129.52,127.83,125.1984870354893,125.1984870354893,127.14122843784881,127.14122843784881,127.14122843784881,126.46907428309021\n2008-08-15,130.5,129.3,130.05,129.92,125.57657781335993,125.57657781335993,127.53351787844241,127.53351787844241,127.53351787844241,126.92185759761209\n2008-08-18,130.47,127.66,128.24,130.44,125.93198314455833,125.93198314455833,-131.5,-131.5,-131.5,127.333890413827\n2008-08-19,127.69,126.54,127.0,127.42,126.26606415588483,126.26606415588483,-131.3848,-131.3848,-131.3848,-134.13\n2008-08-20,127.94,126.34,127.71,127.38,131.5,-131.5,-131.14256,-131.14256,-131.14256,-133.9023\n2008-08-21,128.44,126.61,127.98,126.75,131.3968,-131.3968,-130.8063808,-130.8063808,-130.8063808,-133.524185\n2008-08-22,129.64,128.56,129.51,128.69,131.29566400000002,-131.29566400000002,-130.493734144,-130.493734144,-130.493734144,-133.16497575\n2008-08-25,128.83,126.76,127.08,128.79,131.19655072,-131.19655072,-130.20297275392,-130.20297275392,-130.20297275392,-132.8237269625\n2008-08-26,127.87,126.59,127.44,127.04,131.0994197056,-131.0994197056,-129.9325646611456,-129.9325646611456,-129.9325646611456,-132.49954061437498\n2008-08-27,128.83,127.3,128.46,127.55,131.004231311488,-131.004231311488,-129.6810851348654,-129.6810851348654,-129.6810851348654,-132.19156358365623\n2008-08-28,130.34,129.13,130.31,129.19,130.91094668525824,-130.91094668525824,126.34,126.34,126.34,-131.89898540447342\n2008-08-29,130.13,128.61,128.69,129.68,130.81952775155307,-130.81952775155307,126.42,126.42,126.42,-131.62103613424975\n2008-09-02,130.7,127.52,128.1,130.06,130.729937196522,-130.729937196522,126.4984,126.4984,126.4984,-131.35698432753725\n2008-09-03,128.5,126.93,127.96,127.89,130.7,-130.7,126.624448,126.624448,126.624448,-131.1061351111604\n2008-09-04,127.22,124.0,124.07,126.97,130.7,-130.7,-130.7,-130.7,-130.7,-130.86782835560237\n2008-09-05,124.95,122.11,124.64,123.3,130.432,-130.432,-130.499,-130.499,-130.499,-130.3870803707102\n2008-09-08,128.24,125.1,127.25,128.05,129.93267999999998,-129.93267999999998,-130.07954999999998,-130.07954999999998,-130.07954999999998,-129.6421431373463\n2008-09-09,127.36,122.92,122.94,127.1,129.46331919999997,-129.46331919999997,-129.68107249999997,-129.68107249999997,-129.68107249999997,-128.96425025498513\n2008-09-10,124.89,122.6,123.6,123.89,129.02212004799998,-129.02212004799998,-129.30251887499998,-129.30251887499998,-129.30251887499998,-128.34736773203647\n2008-09-11,125.53,121.6,125.51,122.12,128.60739284512,-128.60739284512,-128.94289293125,-128.94289293125,-128.94289293125,-127.7860046361532\n2008-09-12,125.98,123.83,125.74,124.29,128.04680141751038,-128.04680141751038,-128.42889042606248,-128.42889042606248,-128.42889042606248,-127.10554412617634\n2008-09-15,124.26,120.14,120.36,121.79,127.53105730410955,-127.53105730410955,-127.95086809623811,-127.95086809623811,-127.95086809623811,-126.49993427229694\n2008-09-16,122.09,117.16,121.85,117.25,126.7919515736986,-126.7919515736986,-127.24788996757668,-127.24788996757668,-127.24788996757668,-125.98\n2008-09-17,120.37,116.03,116.35,119.7,125.63611738485477,-125.63611738485477,-126.13822207114325,-126.13822207114325,-126.13822207114325,-124.657\n2008-09-18,121.79,113.82,120.55,117.95,124.2912609509751,-124.2912609509751,-124.82415320189463,-124.82415320189463,-124.82415320189463,-123.19041\n2008-09-19,127.99,123.33,125.05,127.6,113.82,113.82,113.82,113.82,113.82,111.5436\n2008-09-22,124.75,120.36,120.7,124.44,113.82,113.82,113.82,113.82,113.82,111.872528\n2008-09-23,122.02,118.5,118.7,120.86,114.1034,114.1034,114.1034,114.1034,114.1034,112.19487744\n2008-09-24,119.68,117.8,118.81,119.16,114.381132,114.381132,114.381132,114.381132,114.381132,112.5107798912\n2008-09-25,121.89,119.07,121.0,119.57,114.65330936,114.65330936,114.65330936,114.65330936,114.65330936,112.820364293376\n2008-09-26,121.5,118.51,121.33,119.14,114.92004317279999,114.92004317279999,114.92004317279999,114.92004317279999,114.92004317279999,113.12375700750849\n2008-09-29,119.34,110.97,113.02,119.14,127.99,-127.99,-127.99,-127.99,-127.99,-130.5498\n2008-09-30,116.74,112.71,116.54,113.51,127.64959999999999,-127.64959999999999,-127.4794,-127.4794,-127.4794,-129.96240600000002\n2008-10-01,116.69,113.95,116.0,115.21,127.316008,-127.316008,-126.984118,-126.984118,-126.984118,-129.39263382000001\n2008-10-02,115.11,111.06,111.36,114.95,126.98908784,-126.98908784,-126.50369445999999,-126.50369445999999,-126.50369445999999,-128.83995480540003\n2008-10-03,115.44,109.69,109.97,112.84,126.6687060832,-126.6687060832,-126.03768362619999,-126.03768362619999,-126.03768362619999,-128.30385616123803\n2008-10-06,107.62,100.65,106.28,107.12,125.98955783987199,-125.98955783987199,-125.22029944488999,-125.22029944488999,-125.22029944488999,-127.37316335317612\n2008-10-07,107.32,99.65,99.74,106.84,124.46918436947968,-124.46918436947968,-123.5003784837477,-123.5003784837477,-123.5003784837477,-125.5025419184538\n2008-10-08,102.18,96.81,98.39,97.5,122.48364961992131,-122.48364961992131,-121.35384442021041,-121.35384442021041,-121.35384442021041,-123.17581314579296\n2008-10-09,100.62,90.9,91.72,99.64,119.91628465792918,-119.91628465792918,-118.65402153398726,-118.65402153398726,-118.65402153398726,-120.27557369975574\n2008-10-10,93.93,83.58,90.45,87.07,116.43433049897769,-116.43433049897769,-115.04599873456891,-115.04599873456891,-115.04599873456891,-116.4567491187875\n2008-10-13,100.92,93.17,100.68,93.95,111.83472422912081,-111.83472422912081,-110.32609892438357,-110.32609892438357,-110.32609892438357,-111.52523675096937\n2008-10-14,105.53,97.11,99.91,104.66,107.87906283704389,-107.87906283704389,-106.31418408572604,-106.31418408572604,-106.31418408572604,-107.33345123832396\n2008-10-15,97.77,90.5,90.75,97.46,105.53,-105.53,-105.53,-105.53,-105.53,-105.53\n2008-10-16,94.77,86.54,94.41,91.21,105.53,-105.53,-105.53,-105.53,-105.53,-105.53\n2008-10-17,98.58,91.66,94.09,92.04,102.457,-102.457,-102.2375,-102.2375,-102.2375,-102.2375\n2008-10-20,98.55,94.37,98.49,95.43,99.81421999999999,-99.81421999999999,-99.438875,-99.438875,-99.438875,-99.438875\n2008-10-21,98.64,95.23,95.5,97.03,83.58,83.58,83.58,83.58,83.58,81.9084\n2008-10-22,93.5,87.53,90.39,93.2,83.88119999999999,83.88119999999999,83.88119999999999,83.88119999999999,83.88119999999999,82.243032\n2008-10-23,92.44,85.81,91.04,90.39,84.17637599999999,84.17637599999999,84.17637599999999,84.17637599999999,84.17637599999999,82.57097136\n2008-10-24,89.86,83.81,87.54,84.01,98.64,-98.64,-98.64,-98.64,-98.64,82.8923519328\n2008-10-27,89.51,84.68,84.82,85.98,98.3434,-98.3434,-98.1951,-98.1951,-98.1951,83.207304894144\n2008-10-28,94.13,84.54,93.77,87.39,98.052732,-98.052732,-97.763547,-97.763547,-97.763547,83.51595879626112\n2008-10-29,97.17,92.1,92.36,93.61,97.76787736,-97.76787736,-97.34494059000001,-97.34494059000001,-97.34494059000001,83.8184396203359\n2008-10-30,96.51,92.91,95.44,95.82,97.4887198128,-97.4887198128,-97.17,-97.17,-97.17,84.11487082792918\n2008-10-31,98.57,94.48,97.13,95.03,83.81,83.81,83.81,83.81,83.81,84.4053734113706\n2008-11-03,97.69,95.95,96.74,96.84,84.1052,84.1052,84.1052,84.1052,84.1052,84.6900659431432\n2008-11-04,100.86,98.2,100.28,99.03,84.39449599999999,84.39449599999999,84.39449599999999,84.39449599999999,84.39449599999999,84.96906462428034\n2008-11-05,100.2,95.09,95.7,99.21,85.05311615999999,85.05311615999999,84.88846111999999,84.88846111999999,84.88846111999999,85.44579268555192\n2008-11-06,95.44,90.11,90.81,94.5,85.68539151359998,85.68539151359998,85.36760728639999,85.36760728639999,85.36760728639999,85.90821890498536\n2008-11-07,93.41,90.86,93.13,91.65,86.29237585305599,86.29237585305599,85.83237906780799,85.83237906780799,85.83237906780799,86.3567723378358\n2008-11-10,95.53,90.92,92.17,95.21,86.87508081893375,86.87508081893375,86.28320769577375,86.28320769577375,86.28320769577375,86.79186916770074\n2008-11-11,92.03,88.65,90.16,90.71,87.4344775861764,87.4344775861764,86.72051146490054,86.72051146490054,86.72051146490054,87.21391309266971\n2008-11-12,88.95,85.12,85.73,88.23,100.86,-100.86,-100.86,-100.86,-100.86,-102.8772\n2008-11-13,91.65,82.1,91.05,86.09,100.5452,-100.5452,-100.3878,-100.3878,-100.3878,-102.34448400000001\n2008-11-14,92.06,87.23,87.68,89.38,99.807392,-99.807392,-99.47341,-99.47341,-99.47341,-101.3322598\n2008-11-17,88.55,85.16,85.3,86.41,99.09909631999999,-99.09909631999999,-98.6047395,-98.6047395,-98.6047395,-100.37064681\n2008-11-18,87.0,82.91,86.17,85.13,98.41913246719999,-98.41913246719999,-97.779502525,-97.779502525,-97.779502525,-99.4571144695\n2008-11-19,86.86,80.93,81.34,85.89,97.76636716851199,-97.76636716851199,-96.99552739875,-96.99552739875,-96.99552739875,-98.589258746025\n2008-11-20,82.51,75.08,75.95,80.07,96.75618513840128,-96.75618513840128,-95.8709404808375,-95.8709404808375,-95.8709404808375,-97.35311063380324\n2008-11-21,80.53,74.34,80.27,77.44,95.02209032732918,-95.02209032732918,-93.99975583756213,-93.99975583756213,-93.99975583756213,-95.34853067676094\n2008-11-24,86.98,81.17,84.89,81.92,92.95388129459626,-92.95388129459626,-91.8371826954303,-91.8371826954303,-91.8371826954303,-93.03759230231724\n2008-11-25,87.5,83.83,86.06,87.23,91.09249316513663,-91.09249316513663,-89.91249259893297,-89.91249259893297,-89.91249259893297,-90.98085714906235\n2008-11-26,89.15,84.24,89.02,84.34,89.41724384862297,-89.41724384862297,74.34,74.34,74.34,-89.15036286266549\n2008-11-28,90.04,88.48,89.82,88.66,74.34,74.34,74.6362,74.6362,74.6362,72.8532\n2008-12-01,87.54,81.97,82.13,87.46,74.654,74.654,75.098314,75.098314,75.098314,73.19693600000001\n2008-12-02,85.49,82.24,85.27,83.44,74.96172,74.96172,75.54656458000001,75.54656458000001,75.54656458000001,73.53379728\n2008-12-03,87.82,83.14,87.41,83.44,75.2632856,75.2632856,75.9813676426,75.9813676426,75.9813676426,73.8639213344\n2008-12-04,88.05,83.74,85.0,86.04,75.558819888,75.558819888,76.403126613322,76.403126613322,76.403126613322,74.18744290771201\n2008-12-05,88.42,82.25,87.97,83.58,75.84844349024,75.84844349024,76.81223281492234,76.81223281492234,76.81223281492234,74.50449404955778\n2008-12-08,92.38,89.8,91.06,90.4,76.1322746204352,76.1322746204352,77.20906583047467,77.20906583047467,77.20906583047467,74.81520416856662\n2008-12-09,92.13,88.98,89.55,90.36,76.78218363561778,76.78218363561778,77.81590319725568,77.81590319725568,77.81590319725568,75.34214804350962\n2008-12-10,91.36,89.0,90.25,90.34,77.40609629019308,77.40609629019308,78.39846706936545,78.39846706936545,78.39846706936545,75.85328360220433\n2008-12-11,91.0,87.37,88.03,89.51,78.00505243858535,78.00505243858535,78.95772838659083,78.95772838659083,78.95772838659083,76.3490850941382\n2008-12-12,88.9,85.21,88.47,85.56,78.58005034104194,78.58005034104194,79.49461925112719,79.49461925112719,79.49461925112719,76.83001254131406\n2008-12-15,89.14,86.29,87.48,89.01,79.13204832740026,79.13204832740026,80.0100344810821,80.0100344810821,80.0100344810821,77.29651216507465\n2008-12-16,92.02,88.18,91.87,88.35,79.66196639430424,79.66196639430424,80.50483310183881,80.50483310183881,80.50483310183881,77.7490168001224\n2008-12-17,92.43,90.07,91.02,90.85,80.17068773853208,80.17068773853208,80.97983977776526,80.97983977776526,80.97983977776526,78.18794629611874\n2008-12-18,91.67,88.21,89.2,91.36,80.90624647422015,80.90624647422015,81.552347788877,81.552347788877,81.552347788877,78.75762844427399\n2008-12-19,90.38,88.09,88.28,89.1,81.59767168576694,81.59767168576694,82.09623039943315,82.09623039943315,82.09623039943315,79.30452330650303\n2008-12-22,88.67,85.49,86.57,88.65,82.24761138462092,82.24761138462092,82.61291887946149,82.61291887946149,82.61291887946149,79.8295423742429\n2008-12-23,87.93,85.8,86.19,87.49,82.85855470154367,82.85855470154367,83.10377293548842,83.10377293548842,83.10377293548842,80.33356067927319\n2008-12-24,86.86,86.0,86.56,86.47,83.43284141945105,83.43284141945105,83.570084288714,83.570084288714,83.570084288714,80.81741825210226\n2008-12-26,87.3,86.5,87.1,87.28,83.97267093428398,83.97267093428398,84.0130800742783,84.0130800742783,84.0130800742783,81.28192152201817\n2008-12-29,87.33,85.61,86.89,87.33,84.48011067822695,84.48011067822695,84.4339260705644,84.4339260705644,84.4339260705644,81.72784466113744\n2008-12-30,89.05,87.09,88.87,87.67,84.95710403753333,84.95710403753333,84.83372976703617,84.83372976703617,84.83372976703617,82.15593087469195\n2008-12-31,90.97,88.87,90.33,89.07,85.40547779528133,85.40547779528133,85.21354327868437,85.21354327868437,85.21354327868437,82.56689363970428\n2009-01-02,93.44,89.86,93.03,90.5,85.82694912756445,85.82694912756445,85.57436611475015,85.57436611475015,85.57436611475015,82.96141789411611\n2009-01-05,93.66,91.89,92.84,92.6,86.4359931973593,86.4359931973593,86.04630414786514,86.04630414786514,86.04630414786514,83.48534699941031\n2009-01-06,94.45,92.68,93.44,93.69,87.15839387762337,87.15839387762337,86.57926285751458,86.57926285751458,86.57926285751458,84.0958261794457\n2009-01-07,92.26,90.2,90.62,92.0,88.03338661230856,88.03338661230856,87.20892182891342,87.20892182891342,87.20892182891342,84.8206183468845\n2009-01-08,91.09,89.67,91.01,90.16,88.80338021883153,88.80338021883153,87.78820808260035,87.78820808260035,87.78820808260035,85.49467506260258\n2009-01-09,91.31,88.81,89.01,91.27,94.45,-94.45,88.32115143599232,88.32115143599232,88.32115143599232,86.1215478082204\n2009-01-12,88.91,86.41,86.94,88.86,94.3372,-94.3372,-94.45,-94.45,-94.45,-96.339\n2009-01-13,87.77,86.21,87.05,86.68,94.020112,-94.020112,-94.2088,-94.2088,-94.2088,-96.04113\n2009-01-14,85.75,83.69,84.21,85.61,93.55150528,-93.55150528,-93.80886,-93.80886,-93.80886,-95.5495735\n2009-01-15,85.25,81.72,84.44,84.15,92.7625848576,-92.7625848576,-93.10053979999999,-93.10053979999999,-93.10053979999999,-94.719403355\n2009-01-16,85.96,83.05,85.02,85.9,91.65832637184,-91.65832637184,-92.076291218,-92.076291218,-92.076291218,-93.54945705304999\n2009-01-20,84.46,80.47,80.54,84.29,90.664493734656,-90.664493734656,-91.14422500837999,-91.14422500837999,-91.14422500837999,-92.4848059182755\n2009-01-21,84.24,80.47,84.02,81.99,89.44115448649728,-89.44115448649728,-89.97006025745819,-89.97006025745819,-89.97006025745819,-91.1631772672652\n2009-01-22,84.04,81.17,82.84,82.43,88.3646159481176,-88.3646159481176,-88.92505362913779,-88.92505362913779,-88.92505362913779,-89.98692776786602\n2009-01-23,83.99,80.58,83.11,80.88,87.4172620343435,-87.4172620343435,-87.99499772993263,-87.99499772993263,-87.99499772993263,-88.94006571340076\n2009-01-26,85.36,82.81,83.73,83.57,86.58359059022227,-86.58359059022227,-87.16724797964004,-87.16724797964004,-87.16724797964004,-88.00835848492667\n2009-01-27,85.14,83.3,84.59,84.08,85.8499597193956,-85.8499597193956,-86.43055070187964,-86.43055070187964,-86.43055070187964,-87.17913905158474\n2009-01-28,87.95,86.07,87.38,86.42,80.47,80.47,80.47,80.47,80.47,78.8606\n2009-01-29,86.35,84.47,84.57,86.13,80.6196,80.6196,80.6196,80.6196,80.6196,79.042388\n2009-01-30,85.25,82.21,82.69,85.0,80.766208,80.766208,80.766208,80.766208,80.766208,79.22054024\n2009-02-02,83.18,81.31,82.52,81.51,80.90988384,80.90988384,80.90988384,80.90988384,80.90988384,79.3951294352\n2009-02-03,84.36,82.22,83.72,83.09,81.05068616320001,81.05068616320001,81.05068616320001,81.05068616320001,81.05068616320001,79.56622684649601\n2009-02-04,85.37,83.04,83.33,84.32,81.18867243993601,81.18867243993601,81.18867243993601,81.18867243993601,81.18867243993601,79.73390230956609\n2009-02-05,85.29,82.13,84.57,82.74,81.3238989911373,81.3238989911373,81.3238989911373,81.3238989911373,81.3238989911373,79.89822426337477\n2009-02-06,87.34,84.69,87.0,84.86,81.45642101131455,81.45642101131455,81.45642101131455,81.45642101131455,81.45642101131455,80.05925977810728\n2009-02-09,87.74,86.32,87.13,86.98,81.58629259108825,81.58629259108825,81.58629259108825,81.58629259108825,81.58629259108825,80.21707458254512\n2009-02-10,87.03,82.45,82.92,86.26,81.71356673926648,81.71356673926648,81.71356673926648,81.71356673926648,81.71356673926648,80.37173309089422\n2009-02-11,84.05,82.41,83.63,83.45,81.83829540448116,81.83829540448116,81.83829540448116,81.83829540448116,81.83829540448116,80.52329842907633\n2009-02-12,83.82,81.0,83.61,82.15,87.95,-87.95,-87.95,-87.95,-87.95,80.67183246049481\n2009-02-13,84.23,82.74,82.74,83.51,87.811,-87.811,-87.7415,-87.7415,-87.7415,80.81739581128491\n2009-02-17,80.62,79.17,79.19,80.17,87.67478000000001,-87.67478000000001,-87.539255,-87.539255,-87.539255,-89.709\n2009-02-18,79.94,78.28,78.97,79.81,87.3345888,-87.3345888,-87.12079225,-87.12079225,-87.12079225,-89.39283\n2009-02-19,80.15,78.02,78.28,79.77,86.791313472,-86.791313472,-86.50193679249999,-86.50193679249999,-86.50193679249999,-88.8371885\n2009-02-20,78.33,75.77,77.38,76.7,86.08960839424,-86.08960839424,-85.738562481175,-85.738562481175,-85.738562481175,-88.079985305\n2009-02-23,78.26,74.59,74.65,78.26,85.057647554816,-85.057647554816,-84.64202060824574,-84.64202060824574,-84.64202060824574,-86.97208662755\n2009-02-24,77.95,74.84,77.47,75.27,83.80152984823808,-83.80152984823808,-83.33525792917379,-83.33525792917379,-83.33525792917379,-85.6100570985195\n2009-02-25,78.42,75.63,76.83,77.19,82.6961462664495,-82.6961462664495,-82.1983743983812,-82.1983743983812,-82.1983743983812,-84.39785081768235\n2009-02-26,78.38,75.54,75.54,77.83,81.72340871447557,-81.72340871447557,-81.20928572659165,-81.20928572659165,-81.20928572659165,-83.3189872277373\n2009-02-27,75.58,73.82,73.93,74.02,80.8673996687385,-80.8673996687385,-80.34877858213473,-80.34877858213473,-80.34877858213473,-82.35879863268619\n2009-03-02,72.92,70.38,70.58,72.5,79.88076371511511,-79.88076371511511,-79.36946179481451,-79.36946179481451,-79.36946179481451,-81.24875481043698\n2009-03-03,71.7,69.64,70.07,71.56,78.36064152069669,-78.36064152069669,-77.84125328969604,-77.84125328969604,-77.84125328969604,-79.61844158887143\n2009-03-04,72.87,70.41,71.67,71.32,76.79092604697128,-76.79092604697128,-76.28301516465379,-76.28301516465379,-76.28301516465379,-77.92210651876329\n2009-03-05,70.86,68.17,68.79,70.06,75.50375935851645,-75.50375935851645,-75.02084228336957,-75.02084228336957,-75.02084228336957,-76.51414841057353\n2009-03-06,70.45,67.1,68.84,69.45,74.03700748681315,-74.03700748681315,-73.58216540386196,-73.58216540386196,-73.58216540386196,-74.92876021256455\n2009-03-09,70.0,67.73,68.11,67.97,72.64960598945052,-72.64960598945052,-72.09126736097372,-72.09126736097372,-72.09126736097372,-73.284720567926\n2009-03-10,72.36,69.37,72.16,69.51,67.1,67.1,67.1,67.1,67.1,65.758\n2009-03-11,73.74,71.84,72.61,73.03,67.20519999999999,67.20519999999999,67.20519999999999,67.20519999999999,67.20519999999999,65.89004\n2009-03-12,75.75,71.97,75.53,72.58,67.46659199999999,67.46659199999999,67.40124399999999,67.40124399999999,67.40124399999999,66.1255388\n2009-03-13,76.38,74.73,76.15,75.95,67.96359647999999,67.96359647999999,67.73519424,67.73519424,67.73519424,66.510517248\n2009-03-16,77.96,75.81,75.96,76.98,68.6369087616,68.6369087616,68.167434528,68.167434528,68.167434528,67.0039913856\n2009-03-17,78.29,75.45,78.24,76.0,69.56921788544,69.56921788544,68.75498845632,68.75498845632,68.75498845632,67.661351902464\n2009-03-18,80.9,77.07,79.89,77.77,70.6157117391872,70.6157117391872,69.4224392643776,69.4224392643776,69.4224392643776,68.40535726929153\n2009-03-19,81.0,78.69,78.84,80.97,72.05551209570099,72.05551209570099,70.34064412322739,70.34064412322739,70.34064412322739,69.40492868774821\n2009-03-20,78.86,76.53,76.65,78.76,73.48663016038883,73.48663016038883,71.29998615213692,71.29998615213692,71.29998615213692,70.44848510585088\n2009-03-23,82.27,78.4,82.22,79.11,74.68876933472662,74.68876933472662,72.1729873984446,72.1729873984446,72.1729873984446,71.3981214463243\n2009-03-24,82.36,80.51,80.6,81.21,76.05339085447582,76.05339085447582,73.18268865860014,73.18268865860014,73.18268865860014,72.48530930169187\n2009-03-25,82.7,79.06,81.32,81.28,77.31471268358065,77.31471268358065,74.19219290615413,74.19219290615413,74.19219290615413,73.57152527850576\n2009-03-26,83.3,81.48,83.11,82.3,78.39177014686452,78.39177014686452,75.21312975741564,75.21312975741564,75.21312975741564,74.66694224508507\n2009-03-27,82.53,81.32,81.61,82.08,79.06,79.06,76.26442288895161,76.26442288895161,76.26442288895161,75.78923975322401\n2009-03-30,79.88,77.96,78.76,79.73,83.3,-83.3,77.1790479133879,77.1790479133879,77.1790479133879,76.76563858530488\n2009-03-31,81.07,79.05,79.44,79.55,83.19319999999999,-83.19319999999999,77.96,77.96,77.96,77.61510556921525\n2009-04-01,81.42,78.33,81.0,78.51,83.08853599999999,-83.08853599999999,77.96,77.96,77.96,77.96\n2009-04-02,84.61,82.73,83.39,83.16,77.96,77.96,78.33,78.33,78.33,78.33\n2009-04-03,84.28,82.67,84.27,83.51,78.09299999999999,78.09299999999999,78.33,78.33,78.33,78.33\n2009-04-06,83.81,82.29,83.48,83.38,78.22334,78.22334,79.2092,79.2092,79.2092,79.2092\n2009-04-07,82.65,81.51,81.61,82.22,78.35107319999999,78.35107319999999,79.965312,79.965312,79.965312,79.965312\n2009-04-08,82.94,81.54,82.49,82.04,78.476251736,78.476251736,80.61556832,80.61556832,80.61556832,80.61556832\n2009-04-09,85.82,84.34,85.82,84.73,78.59892670127999,78.59892670127999,81.1747887552,81.1747887552,81.1747887552,81.1747887552\n2009-04-13,86.54,84.58,85.83,84.95,78.8877696332288,78.8877696332288,81.54,81.54,81.54,81.54\n2009-04-14,85.76,84.08,84.38,85.05,79.34690345523506,79.34690345523506,82.34,82.34,82.34,82.34\n2009-04-15,85.42,83.61,85.31,83.89,79.77848924792096,79.77848924792096,83.012,83.012,83.012,83.012\n2009-04-16,87.15,84.78,86.62,85.97,80.1841798930457,80.1841798930457,83.57648,83.57648,83.57648,83.57648\n2009-04-17,87.65,86.14,87.14,86.85,80.74144550160204,80.74144550160204,83.61,83.61,83.61,83.61\n2009-04-20,85.66,83.34,83.41,85.53,81.43230095144185,81.43230095144185,-87.65,-87.65,-87.65,-89.403\n2009-04-21,85.13,82.76,85.08,82.79,82.05407085629766,82.05407085629766,-87.65,-87.65,-87.65,-89.22111000000001\n2009-04-22,86.34,84.07,84.57,84.32,82.6136637706679,82.6136637706679,-87.4055,-87.4055,-87.4055,-88.89805450000001\n2009-04-23,85.42,83.63,85.37,84.74,82.76,82.76,-87.173225,-87.173225,-87.173225,-88.59115177500001\n2009-04-24,87.31,85.69,86.68,86.04,83.24900000000001,83.24900000000001,82.76,82.76,82.76,-88.29959418625002\n2009-04-27,87.01,85.54,85.84,85.75,83.63,83.63,82.851,82.851,82.851,-88.02261447693752\n2009-04-28,86.59,84.76,85.56,84.97,84.032,84.032,82.94018,82.94018,82.94018,-87.75948375309065\n2009-04-29,88.36,86.3,87.36,86.53,84.3938,84.3938,83.0275764,83.0275764,83.0275764,81.10480000000001\n2009-04-30,89.02,86.94,87.55,88.58,84.76,84.76,83.187549108,83.187549108,83.187549108,81.24990400000002\n2009-05-01,88.2,86.72,87.84,87.48,85.35640000000001,85.35640000000001,83.42084714367999,83.42084714367999,83.42084714367999,81.48300688000002\n2009-05-04,90.93,88.38,90.92,88.54,85.869304,85.869304,83.6448132579328,83.6448132579328,83.6448132579328,81.70911667360002\n2009-05-05,90.92,89.84,90.56,90.61,86.67901536,86.67901536,84.00907259503616,84.00907259503616,84.00907259503616,82.07795200665602\n2009-05-06,92.2,90.61,92.11,91.71,87.35917290239999,87.35917290239999,84.35511896528435,84.35511896528435,84.35511896528435,82.43203392638978\n2009-05-07,93.15,90.29,90.9,93.09,88.23052177996799,88.23052177996799,84.82581182736729,84.82581182736729,84.82581182736729,82.92043223007029\n2009-05-08,93.22,91.44,92.99,92.06,89.2144174239744,89.2144174239744,85.40850499945158,85.40850499945158,85.40850499945158,83.53420629626608\n2009-05-11,92.1,91.04,91.14,91.68,90.01553393917952,90.01553393917952,86.03342459949545,86.03342459949545,86.03342459949545,84.21221185552746\n2009-05-12,91.82,89.85,91.01,91.63,93.22,-93.22,86.60835063153581,86.60835063153581,86.60835063153581,84.84275702564054\n2009-05-13,90.0,88.5,88.8,89.7,93.15259999999999,-93.15259999999999,87.13728258101295,87.13728258101295,87.13728258101295,85.4291640338457\n2009-05-14,90.11,88.5,89.45,88.72,92.96649599999999,-92.96649599999999,87.62389997453192,87.62389997453192,87.62389997453192,85.9745225514765\n2009-05-15,89.99,88.15,88.73,89.35,92.78783616,-92.78783616,88.07158797656938,88.07158797656938,88.07158797656938,86.48170597287314\n2009-05-18,91.31,89.37,91.24,89.59,92.50956599039999,-92.50956599039999,88.15,88.15,88.15,86.95338655477202\n2009-05-19,91.97,90.82,91.12,91.2,92.247992030976,-92.247992030976,88.15,88.15,88.15,87.39204949593798\n2009-05-20,92.8,90.41,90.51,91.96,88.15,88.15,88.5556,88.5556,88.5556,87.80000603122232\n2009-05-21,89.8,88.26,89.24,89.46,88.24300000000001,88.24300000000001,-93.22,-93.22,-93.22,88.17940560903676\n2009-05-22,90.0,88.68,89.04,89.41,88.26,88.26,-93.0712,-93.0712,-93.0712,88.26\n2009-05-26,91.56,88.32,91.3,88.33,88.26,88.26,-92.92686400000001,-92.92686400000001,-92.92686400000001,88.26\n2009-05-27,91.75,89.53,89.71,91.45,88.32,88.32,-92.78685808,-92.78685808,-92.78685808,88.32\n2009-05-28,91.34,89.1,90.93,90.42,88.32,88.32,-92.6510523376,-92.6510523376,-92.6510523376,88.32\n2009-05-29,92.68,90.68,92.41,91.44,88.4096,88.4096,88.26,88.26,88.26,88.663\n2009-06-01,95.17,93.43,94.78,93.68,88.497408,88.497408,88.3484,88.3484,88.3484,88.98199\n2009-06-02,95.36,94.16,94.88,94.43,88.76431167999999,88.76431167999999,88.553048,88.553048,88.553048,89.4770308\n2009-06-03,94.13,92.76,93.64,94.05,89.16005297919999,89.16005297919999,88.82532608000001,88.82532608000001,88.82532608000001,90.006498028\n2009-06-04,94.67,93.3,94.6,94.0,89.532049800448,89.532049800448,89.0867130368,89.0867130368,89.0867130368,90.48831320548\n2009-06-05,95.66,93.8,94.53,95.5,89.8817268124211,89.8817268124211,89.33764451532801,89.33764451532801,89.33764451532801,90.92676501698679\n2009-06-08,95.1,93.04,94.3,93.83,90.34398866742742,90.34398866742742,89.65376228956161,89.65376228956161,89.65376228956161,91.40008851528812\n2009-06-09,95.14,94.02,94.62,94.67,90.76926957403323,90.76926957403323,89.95407417508353,89.95407417508353,89.95407417508353,91.8260796637593\n2009-06-10,95.49,93.2,94.34,95.48,91.16052800811057,91.16052800811057,90.23937046632936,90.23937046632936,90.23937046632936,92.20947169738336\n2009-06-11,96.11,94.57,94.85,94.6,91.52048576746172,91.52048576746172,90.5104019430129,90.5104019430129,90.5104019430129,92.55452452764503\n2009-06-12,95.13,94.0,95.09,94.38,91.97943719071554,91.97943719071554,90.84637782643212,90.84637782643212,90.84637782643212,92.94562682960408\n2009-06-15,94.02,92.42,92.88,94.0,92.39249347164399,92.39249347164399,91.1621951568462,91.1621951568462,91.1621951568462,-98.0322\n2009-06-16,93.29,91.58,91.64,93.18,96.11,-96.11,91.45906344743543,91.45906344743543,91.45906344743543,-97.863834\n2009-06-17,92.33,90.83,91.52,91.6,96.0194,-96.0194,-96.11,-96.11,-96.11,-97.5496423\n2009-06-18,92.67,91.26,92.08,91.65,95.811824,-95.811824,-95.9516,-95.9516,-95.9516,-97.079267339\n2009-06-19,92.7,91.52,92.04,92.55,95.61255104,-95.61255104,-95.797952,-95.797952,-95.797952,-96.64181862526999\n2009-06-22,91.18,89.26,89.27,91.13,95.4212489984,-95.4212489984,-95.64891344,-95.64891344,-95.64891344,-96.2349913215011\n2009-06-23,89.87,88.85,89.36,89.49,95.051574058496,-95.051574058496,-95.329467768,-95.329467768,-95.329467768,-95.607242102566\n2009-06-24,91.08,89.6,90.15,90.19,94.55544813381633,-94.55544813381633,-94.87590502424,-94.87590502424,-94.87590502424,-94.86394547128374\n2009-06-25,92.17,89.57,92.0,89.66,94.09901228311102,-94.09901228311102,-94.4540916725432,-94.4540916725432,-94.4540916725432,-94.20241146944252\n2009-06-26,92.24,91.28,91.89,91.76,93.67909130046215,-93.67909130046215,-94.06180525546517,-94.06180525546517,-94.06180525546517,-93.61364620780384\n2009-06-29,92.82,91.6,92.68,92.13,93.29276399642518,-93.29276399642518,-93.69697888758262,-93.69697888758262,-93.69697888758262,-93.08964512494542\n2009-06-30,93.06,91.27,91.92,92.72,88.85,88.85,-93.35769036545183,-93.35769036545183,-93.35769036545183,87.073\n2009-07-01,93.23,92.22,92.34,92.38,88.93419999999999,88.93419999999999,88.85,88.85,88.85,87.19273999999999\n2009-07-02,91.16,89.76,89.85,91.16,89.10603199999998,89.10603199999998,88.93759999999999,88.93759999999999,88.93759999999999,87.37385779999998\n2009-07-06,89.93,88.66,89.8,88.99,93.23,-93.23,-93.23,-93.23,-93.23,87.54954206599999\n2009-07-07,89.82,88.0,88.11,89.73,93.1386,-93.1386,-93.0929,-93.0929,-93.0929,87.71995580401999\n2009-07-08,88.8,87.01,88.0,88.55,92.933056,-92.933056,-92.838255,-92.838255,-92.838255,-95.0946\n2009-07-09,88.9,87.91,88.2,88.58,92.57767263999999,-92.57767263999999,-92.43027715000001,-92.43027715000001,-92.43027715000001,-94.852062\n2009-07-10,88.49,87.35,87.95,87.77,92.2436122816,-92.2436122816,-92.05085774950001,-92.05085774950001,-92.05085774950001,-94.61680014000001\n2009-07-13,90.17,87.59,90.13,88.27,91.929595544704,-91.929595544704,-91.69799770703501,-91.69799770703501,-91.69799770703501,-94.38859613580001\n2009-07-14,90.69,89.73,90.63,90.39,91.63441981202176,-91.63441981202176,-91.36983786754256,-91.36983786754256,-91.36983786754256,-94.16723825172602\n2009-07-15,93.51,91.68,93.25,91.83,87.01,87.01,87.01,87.01,87.01,-93.95252110417424\n2009-07-16,94.51,92.82,94.12,93.01,87.14,87.14,87.14,87.14,87.14,85.2698\n2009-07-17,94.32,93.54,94.17,94.06,87.4348,87.4348,87.36110000000001,87.36110000000001,87.36110000000001,85.454604\n2009-07-20,95.28,94.19,95.07,94.73,87.71780799999999,87.71780799999999,87.575567,87.575567,87.575567,85.63571192\n2009-07-21,95.9,94.42,95.57,95.89,88.17153952,88.17153952,87.88374432,87.88374432,87.88374432,85.9250405624\n2009-07-22,96.13,94.89,95.55,94.96,88.7898163584,88.7898163584,88.284557104,88.284557104,88.284557104,86.324038939904\n2009-07-23,98.08,95.53,97.7,95.6,89.52383472256,89.52383472256,88.75528367776,88.75528367776,88.75528367776,86.8143369929088\n2009-07-24,98.14,96.69,98.1,97.12,90.55057455585279,90.55057455585279,89.40801382031681,89.40801382031681,89.40801382031681,87.49027677333427\n2009-07-27,98.4,97.34,98.35,97.96,91.6130941180334,91.6130941180334,90.10657271469147,90.10657271469147,90.10657271469147,88.23575739920088\n2009-07-28,98.37,97.06,98.11,97.68,92.69899905914806,92.69899905914806,90.85298117036923,90.85298117036923,90.85298117036923,89.04889680726481\n2009-07-29,97.93,96.98,97.68,97.38,93.61115920968437,93.61115920968437,91.532212865036,91.532212865036,91.532212865036,89.79698506268363\n2009-07-30,99.83,98.6,98.7,98.83,94.37737373613487,94.37737373613487,92.15031370718276,92.15031370718276,92.15031370718276,90.48522625766894\n2009-07-31,99.47,98.38,98.81,98.67,95.3588464636306,95.3588464636306,92.91828233646449,92.91828233646449,92.91828233646449,91.32625589447873\n2009-08-03,100.53,99.31,100.45,99.88,96.16365410017708,96.16365410017708,93.60945410281803,93.60945410281803,93.60945410281803,92.09159286397565\n2009-08-04,100.84,99.78,100.68,100.03,97.03692328014166,97.03692328014166,94.37071415150805,94.37071415150805,94.37071415150805,92.93543357757808\n2009-08-05,100.85,99.58,100.37,100.78,97.79753862411333,97.79753862411333,95.14702845332708,95.14702845332708,95.14702845332708,93.8049358840445\n2009-08-06,101.02,99.42,99.89,100.82,98.40803089929067,98.40803089929067,95.88841475439456,95.88841475439456,95.88841475439456,94.65034357795916\n2009-08-07,102.02,100.4,101.2,100.96,98.93042471943254,98.93042471943254,96.60683668877932,96.60683668877932,96.60683668877932,95.47839891282447\n2009-08-10,101.22,100.27,100.98,100.74,99.42,99.42,97.41881118546243,97.41881118546243,97.41881118546243,96.39422306502905\n2009-08-11,100.61,99.46,99.66,100.52,102.02,-102.02,98.10898950764306,98.10898950764306,98.10898950764306,97.18183183592498\n2009-08-12,101.56,99.53,100.77,99.54,101.9688,-101.9688,98.6956410814966,98.6956410814966,98.6956410814966,97.85917537889549\n2009-08-13,101.61,100.26,101.57,101.31,101.91862400000001,-101.91862400000001,99.19429491927211,99.19429491927211,99.19429491927211,98.44169082585012\n2009-08-14,101.6,99.7,100.73,101.6,101.86945152000001,-101.86945152000001,99.53,99.53,99.53,98.9426541102311\n2009-08-17,98.94,98.12,98.27,98.85,101.82126248960002,-101.82126248960002,-102.02,-102.02,-102.02,-104.0604\n2009-08-18,99.44,98.36,99.16,98.53,101.67321199001601,-101.67321199001601,-101.90299999999999,-101.90299999999999,-101.90299999999999,-103.882188\n2009-08-19,100.3,98.25,100.01,98.36,101.53108351041537,-101.53108351041537,-101.78950999999999,-101.78950999999999,-101.78950999999999,-103.70932236\n2009-08-20,101.22,99.87,101.01,100.02,101.39464016999875,-101.39464016999875,-101.6794247,-101.6794247,-101.6794247,-103.5416426892\n2009-08-21,103.13,101.62,102.97,101.82,98.12,98.12,98.12,98.12,98.12,-103.378993408524\n2009-08-24,103.95,102.59,102.96,103.41,98.2202,98.2202,98.2202,98.2202,98.2202,96.1576\n2009-08-25,104.21,102.94,103.14,103.34,98.449392,98.449392,98.392094,98.392094,98.392094,96.31344800000001\n2009-08-26,103.64,102.49,103.17,102.82,98.79502848,98.79502848,98.62481024,98.62481024,98.62481024,96.55034456000001\n2009-08-27,103.71,101.94,103.43,103.07,99.1199267712,99.1199267712,98.8482178304,98.8482178304,98.8482178304,96.78013422320001\n2009-08-28,104.35,102.67,103.33,104.22,99.425331164928,99.425331164928,99.06268911718401,99.06268911718401,99.06268911718401,97.00303019650401\n2009-08-31,102.58,101.79,102.55,102.34,99.81930467173376,99.81930467173376,99.32705466132481,99.32705466132481,99.32705466132481,97.29690898864385\n2009-09-01,103.24,99.99,100.2,101.89,104.35,-104.35,99.57820192825857,99.57820192825857,99.57820192825857,97.5790326290981\n2009-09-02,100.43,99.57,99.8,99.76,104.2628,-104.2628,-104.35,-104.35,-104.35,97.84987132393417\n2009-09-03,100.77,99.6,100.65,100.36,104.075088,-104.075088,-104.2066,-104.2066,-104.2066,98.1098764709768\n2009-09-04,102.09,100.55,102.08,100.88,103.89488447999999,-103.89488447999999,-104.06750199999999,-104.06750199999999,-104.06750199999999,98.35948141213773\n2009-09-08,103.05,102.39,102.89,103.03,103.72188910079998,-103.72188910079998,-103.93257693999999,-103.93257693999999,-103.93257693999999,98.59910215565222\n2009-09-09,104.08,102.8,103.76,103.13,99.57,99.57,99.57,99.57,99.57,98.82913806942614\n2009-09-10,104.86,103.22,104.82,103.79,99.66019999999999,99.66019999999999,99.66019999999999,99.66019999999999,99.66019999999999,99.04997254664909\n2009-09-11,105.3,104.28,104.79,104.98,99.868192,99.868192,99.816194,99.816194,99.816194,99.34047391931664\n2009-09-14,105.46,103.87,105.34,103.87,100.19410047999999,100.19410047999999,100.03554624,100.03554624,100.03554624,99.69804548415763\n2009-09-15,106.11,104.77,105.74,105.46,100.61537244159999,100.61537244159999,100.306768928,100.306768928,100.306768928,100.1013823002666\n2009-09-16,107.34,105.73,107.33,106.12,101.16483519743998,101.16483519743998,100.65496279231999,100.65496279231999,100.65496279231999,100.58207171624527\n2009-09-17,108.06,106.57,107.16,107.2,101.90585497374718,101.90585497374718,101.1229153968576,101.1229153968576,101.1229153968576,101.19028526178319\n2009-09-18,107.16,106.37,106.72,107.14,102.76743527742258,102.76743527742258,101.67788216510898,101.67788216510898,101.67788216510898,101.87725673560487\n2009-09-21,106.71,105.67,106.44,105.91,103.50839433858341,103.50839433858341,102.18845159190026,102.18845159190026,102.18845159190026,102.49553106204439\n2009-09-22,107.37,106.6,107.08,107.04,104.14561913118173,104.14561913118173,102.65817546454824,102.65817546454824,102.65817546454824,103.05197795583996\n2009-09-23,108.03,105.99,106.14,107.29,104.69363245281629,104.69363245281629,103.09032142738438,103.09032142738438,103.09032142738438,103.55278016025596\n2009-09-24,106.64,104.55,104.95,106.4,108.06,-108.06,103.48789571319364,103.48789571319364,103.48789571319364,104.00350214423037\n2009-09-25,105.36,104.09,104.45,104.76,108.03,-108.03,103.85366405613814,103.85366405613814,103.85366405613814,-110.2212\n2009-09-28,106.55,104.83,106.32,104.85,107.8724,-107.8724,104.09,104.09,104.09,-110.037264\n2009-09-29,107.02,105.78,106.03,106.5,107.721104,-107.721104,104.09,104.09,104.09,-109.85884607999999\n2009-09-30,106.46,104.62,105.56,106.37,107.57585983999999,-107.57585983999999,104.4076,104.4076,104.4076,-109.6857806976\n2009-10-01,105.38,102.95,103.05,105.29,107.4364254464,-107.4364254464,-108.06,-108.06,-108.06,-109.51790727667199\n2009-10-02,103.1,101.99,102.54,102.0,107.167239919616,-107.167239919616,-107.9067,-107.9067,-107.9067,-109.1895119128384\n2009-10-05,104.32,102.6,104.01,102.86,106.75306072604671,-106.75306072604671,-107.610865,-107.610865,-107.610865,-108.68554607893971\n2009-10-06,106.11,104.72,105.55,104.78,106.37201586796297,-106.37201586796297,-107.32982175000001,-107.32982175000001,-107.32982175000001,-108.21685785341393\n2009-10-07,105.91,105.07,105.77,105.28,106.11,-106.11,-107.0628306625,-107.0628306625,-107.0628306625,-107.78097780367496\n2009-10-08,107.17,106.15,106.64,106.59,101.99,101.99,101.99,101.99,101.99,-107.37560935741772\n2009-10-09,107.26,106.36,107.25,106.61,102.0936,102.0936,102.0936,102.0936,102.0936,99.9502\n2009-10-12,108.09,107.28,107.76,107.79,102.30025599999999,102.30025599999999,102.248592,102.248592,102.248592,100.096396\n2009-10-13,107.65,106.76,107.5,107.42,102.64764063999999,102.64764063999999,102.48224832,102.48224832,102.48224832,100.33620412\n2009-10-14,109.42,108.26,109.31,108.74,102.97418220159999,102.97418220159999,102.70655838719999,102.70655838719999,102.70655838719999,100.5688179964\n2009-10-15,109.7,108.73,109.65,108.83,103.489847625472,103.489847625472,103.04223046783999,103.04223046783999,103.04223046783999,100.922865276544\n2009-10-16,109.27,108.23,108.86,108.74,104.11086286292479,104.11086286292479,103.44169663976959,103.44169663976959,103.44169663976959,101.3617220127168\n2009-10-19,110.13,108.73,109.86,109.02,104.66977657663232,104.66977657663232,103.81719484138341,103.81719484138341,103.81719484138341,101.77863591208096\n2009-10-20,109.99,108.68,109.2,109.98,105.32500338743644,105.32500338743644,104.25909120248657,104.25909120248657,104.25909120248657,102.2797177573561\n2009-10-21,110.31,108.15,108.15,109.05,105.90160298094406,105.90160298094406,104.67005481831251,104.67005481831251,104.67005481831251,102.75073469191473\n2009-10-22,109.68,107.51,109.34,108.16,106.51877856361189,106.51877856361189,105.1212504328475,105.1212504328475,105.1212504328475,103.2798832634807\n2009-10-23,109.74,107.64,108.08,109.72,107.04954956470623,107.04954956470623,105.53635039821971,105.53635039821971,105.53635039821971,103.77199143503705\n2009-10-26,109.31,106.62,106.83,108.2,110.31,-110.31,105.91824236636214,105.91824236636214,105.91824236636214,104.22965203458446\n2009-10-27,107.39,106.16,106.4,107.01,110.2362,-110.2362,-110.31,-110.31,-110.31,104.65527639216354\n2009-10-28,106.47,104.35,104.38,106.13,110.073152,-110.073152,-110.1855,-110.1855,-110.1855,-112.5162\n2009-10-29,106.86,104.94,106.65,105.2,109.72976288,-109.72976288,-109.893725,-109.893725,-109.893725,-112.271214\n2009-10-30,106.62,103.44,103.56,106.3,109.40697710719999,-109.40697710719999,-109.61653875,-109.61653875,-109.61653875,-112.03357758\n2009-11-02,105.41,103.08,104.36,104.06,108.92961893862399,-108.92961893862399,-109.1841810375,-109.1841810375,-109.1841810375,-111.603898701\n2009-11-03,104.8,103.55,104.65,103.69,108.34465704476159,-108.34465704476159,-108.63480474412499,-108.63480474412499,-108.63480474412499,-111.00722579193001\n2009-11-04,106.33,104.65,104.91,105.56,107.81819134028544,-107.81819134028544,-108.13487231715374,-108.13487231715374,-108.13487231715374,-110.45231998649491\n2009-11-05,106.88,105.44,106.86,105.63,107.34437220625689,-107.34437220625689,-107.6799338086099,-107.6799338086099,-107.6799338086099,-109.93625758744027\n2009-11-06,107.39,106.05,107.16,106.2,103.08,103.08,103.08,103.08,103.08,-109.45631955631944\n2009-11-09,109.63,107.88,109.63,108.0,103.1662,103.1662,103.1662,103.1662,103.1662,101.0184\n2009-11-10,109.92,108.97,109.57,109.33,103.424752,103.424752,103.36011400000001,103.36011400000001,103.36011400000001,101.190632\n2009-11-11,110.82,109.62,110.15,110.3,103.81446688,103.81446688,103.62250944000002,103.62250944000002,103.62250944000002,101.45251304\n2009-11-12,110.57,108.75,108.99,110.02,104.3749095296,104.3749095296,103.98238396800002,103.98238396800002,103.98238396800002,101.8272125184\n2009-11-13,110.09,108.75,109.61,109.27,104.890516767232,104.890516767232,104.32426476960002,104.32426476960002,104.32426476960002,102.186924017664\n2009-11-16,111.69,110.32,111.22,110.39,105.36487542585344,105.36487542585344,104.64905153112002,104.64905153112002,104.64905153112002,102.53224705695743\n2009-11-17,111.39,110.5,111.32,110.91,105.99738788326809,105.99738788326809,105.07150843925282,105.07150843925282,105.07150843925282,102.99013470410956\n2009-11-18,111.43,110.58,111.27,111.29,106.56664909494128,106.56664909494128,105.46861793289766,105.46861793289766,105.46861793289766,103.42512796890409\n2009-11-19,110.55,109.14,109.77,110.48,107.07898418544715,107.07898418544715,105.8419008569238,105.8419008569238,105.8419008569238,103.83837157045889\n2009-11-20,109.76,109.01,109.43,109.29,107.54008576690244,107.54008576690244,106.19278680550838,106.19278680550838,106.19278680550838,104.23095299193595\n2009-11-23,111.63,110.6,110.92,110.69,107.9550771902122,107.9550771902122,106.52261959717788,106.52261959717788,106.52261959717788,104.60390534233915\n2009-11-24,111.14,110.1,110.99,111.05,108.32856947119097,108.32856947119097,106.83266242134721,106.83266242134721,106.83266242134721,104.95821007522218\n2009-11-25,111.5,110.82,111.37,111.13,108.66471252407187,108.66471252407187,107.12410267606637,107.12410267606637,107.12410267606637,105.29479957146107\n2009-11-27,110.32,108.29,109.5,108.41,111.69,-111.69,107.39805651550239,107.39805651550239,107.39805651550239,105.61455959288801\n2009-11-30,110.15,109.02,109.88,109.53,111.622,-111.622,107.65557312457224,107.65557312457224,107.65557312457224,105.91833161324361\n2009-12-01,111.66,110.73,111.25,111.04,108.29,108.29,107.8976387370979,107.8976387370979,107.8976387370979,106.20691503258143\n2009-12-02,112.01,110.92,111.32,111.27,108.35740000000001,108.35740000000001,108.12518041287203,108.12518041287203,108.12518041287203,106.48106928095237\n2009-12-03,112.18,110.29,110.38,111.57,108.503504,108.503504,108.39711778397098,108.39711778397098,108.39711778397098,106.81280512409522\n2009-12-04,112.38,110.04,111.01,111.88,108.72409376,108.72409376,108.6997483612533,108.6997483612533,108.6997483612533,107.18850876540856\n2009-12-07,111.52,110.5,110.8,110.91,109.0165662592,109.0165662592,109.03097100874051,109.03097100874051,109.03097100874051,107.60382806417587\n2009-12-08,110.25,109.27,109.61,110.04,112.38,-112.38,-112.38,-112.38,-112.38,107.9859218190418\n2009-12-09,110.18,109.02,109.97,109.56,112.31779999999999,-112.31779999999999,-112.2867,-112.2867,-112.2867,108.33744807351846\n2009-12-10,111.11,110.45,110.65,110.74,112.18588799999999,-112.18588799999999,-112.12336499999999,-112.12336499999999,-112.12336499999999,108.66085222763698\n2009-12-11,111.36,110.61,111.18,111.16,112.05925248,-112.05925248,-111.96819674999999,-111.96819674999999,-111.96819674999999,108.95838404942602\n2009-12-14,111.99,111.37,111.9,111.88,109.02,109.02,109.02,109.02,109.02,109.23211332547193\n2009-12-15,111.92,111.0,111.3,111.46,109.07939999999999,109.07939999999999,109.07939999999999,109.07939999999999,109.07939999999999,109.48394425943417\n2009-12-16,112.13,111.27,111.49,111.78,109.13761199999999,109.13761199999999,109.13761199999999,109.13761199999999,109.13761199999999,109.71562871867944\n2009-12-17,110.93,110.08,110.13,110.69,109.25730751999998,109.25730751999998,109.22738363999999,109.22738363999999,109.22738363999999,109.92877842118509\n2009-12-18,110.3,109.28,110.19,110.16,112.13,-112.13,-112.13,-112.13,-112.13,-114.6276\n2009-12-21,111.7,110.76,111.33,110.83,112.073,-112.073,-112.0445,-112.0445,-112.0445,-114.467172\n2009-12-22,111.96,111.43,111.74,111.57,112.01714,-112.01714,-111.961565,-111.961565,-111.961565,-114.31155684000001\n2009-12-23,112.11,111.5,111.97,112.03,109.28,109.28,109.28,109.28,109.28,-114.16061013480001\n2009-12-24,112.6,112.18,112.6,112.2,109.3366,109.3366,109.3366,109.3366,109.3366,-114.014191830756\n2009-12-28,112.98,112.32,112.67,112.95,109.46713600000001,109.46713600000001,109.43450200000001,109.43450200000001,109.43450200000001,-113.87216607583332\n2009-12-29,113.03,112.55,112.62,113.03,109.67790784000002,109.67790784000002,109.57632192000001,109.57632192000001,109.57632192000001,-113.73440109355832\n2009-12-30,112.64,112.17,112.45,112.18,109.94607521280001,109.94607521280001,109.74900582400001,109.74900582400001,109.74900582400001,-113.60076906075157\n2009-12-31,112.8,111.43,111.44,112.74,110.19278919577602,110.19278919577602,109.9130555328,109.9130555328,109.9130555328,-113.47114598892902\n2010-01-04,113.39,112.33,113.33,112.33,110.41976606011393,110.41976606011393,110.06890275616,110.06890275616,110.06890275616,107.09440000000001\n2010-01-05,113.68,112.92,113.65,113.29,110.71678945410254,110.71678945410254,110.2681685907904,110.2681685907904,110.2681685907904,107.220312\n2010-01-06,113.99,113.43,113.73,113.55,111.07237471961024,111.07237471961024,110.50699678943506,110.50699678943506,110.50699678943506,107.41410264000001\n2010-01-07,114.33,113.18,114.21,113.55,111.4808422588648,111.4808422588648,110.78563704628026,110.78563704628026,110.78563704628026,107.67713853440002\n2010-01-08,114.62,113.66,114.62,113.87,111.93670749744643,111.93670749744643,111.10462971211503,111.10462971211503,111.10462971211503,108.00978160768001\n2010-01-11,115.13,114.24,114.74,115.11,112.41970014790607,112.41970014790607,111.45616674090353,111.45616674090353,111.45616674090353,108.4063947112192\n2010-01-12,114.21,113.22,113.67,113.98,112.96176011832486,112.96176011832486,111.86028839940414,111.86028839940414,111.86028839940414,108.87704708143386\n2010-01-13,114.94,113.37,114.64,113.95,113.22,113.22,112.21995667546969,112.21995667546969,112.21995667546969,109.31475378573349\n2010-01-14,115.13,114.42,114.94,114.51,113.22,113.22,112.54006144116802,112.54006144116802,112.54006144116802,109.72182102073214\n2010-01-15,114.84,113.2,113.67,114.71,115.13,-115.13,112.82495468263954,112.82495468263954,112.82495468263954,110.10039354928088\n2010-01-19,115.13,113.58,115.12,113.62,113.2,113.2,113.0785096675492,113.0785096675492,113.0785096675492,110.45246600083122\n2010-01-20,114.29,112.98,113.86,114.28,115.13,-115.13,-115.13,-115.13,-115.13,110.77989338077303\n2010-01-21,114.27,111.56,111.65,113.89,115.13,-115.13,-115.13,-115.13,-115.13,111.08440084411892\n2010-01-22,111.62,109.09,109.21,111.25,114.9872,-114.9872,-114.9515,-114.9515,-114.9515,-117.4326\n2010-01-25,110.41,109.41,109.78,110.2,114.633368,-114.633368,-114.541195,-114.541195,-114.541195,-117.182322\n2010-01-26,110.46,109.04,109.29,109.36,114.30076592,-114.30076592,-114.15961135,-114.15961135,-114.15961135,-116.93955234\n2010-01-27,110.07,108.34,109.81,109.16,113.8799046464,-113.8799046464,-113.69884632850001,-113.69884632850001,-113.69884632850001,-116.54457472300001\n2010-01-28,110.25,107.91,108.54,110.21,113.32591418176001,-113.32591418176001,-113.10937323236502,-113.10937323236502,-113.10937323236502,-115.97025449239001\n2010-01-29,109.8,107.22,107.37,109.08,112.67600447994882,-112.67600447994882,-112.43345471215757,-112.43345471215757,-112.43345471215757,-115.24483158807492\n2010-02-01,109.07,108.08,109.06,108.15,111.91216385275598,-111.91216385275598,-111.65143650533393,-111.65143650533393,-111.65143650533393,-114.36210011338667\n2010-02-02,110.59,108.88,110.41,109.28,111.25526091337014,-111.25526091337014,-110.98672102953384,-110.98672102953384,-110.98672102953384,-113.57646910091414\n2010-02-03,110.42,109.51,109.82,109.91,110.69032438549831,-110.69032438549831,-110.59,-110.59,-110.59,-112.87725749981358\n2010-02-04,109.03,106.43,106.49,108.95,110.59,-110.59,-110.59,-110.59,-110.59,-112.25495917483408\n2010-02-05,106.88,104.58,106.66,106.53,110.42,-110.42,-110.42,-110.42,-110.42,-111.49771448210565\n2010-02-08,107.33,105.81,105.87,106.72,109.36880000000001,-109.36880000000001,-109.3104,-109.3104,-109.3104,-110.4600573097898\n2010-02-09,108.14,106.27,107.2,107.15,108.506816,-108.506816,-108.411624,-108.411624,-108.411624,-109.57804871332134\n2010-02-10,107.6,106.11,107.01,107.08,108.14,-108.14,-108.14,-108.14,-108.14,-108.82834140632313\n2010-02-11,108.25,106.25,108.13,106.9,104.58,104.58,104.58,104.58,104.58,102.4884\n2010-02-12,108.06,106.51,108.04,107.0,104.6534,104.6534,104.6534,104.6534,104.6534,102.603632\n2010-02-16,109.85,108.42,109.75,108.85,104.72533200000001,104.72533200000001,104.72533200000001,104.72533200000001,104.72533200000001,102.71655936\n2010-02-17,110.41,109.75,110.26,110.27,104.93031872,104.93031872,104.87907204000001,104.87907204000001,104.87907204000001,102.9305625792\n2010-02-18,111.14,110.04,110.91,110.1,105.2590995968,105.2590995968,105.10030915840001,105.10030915840001,105.10030915840001,103.229740076032\n2010-02-19,111.57,110.36,111.18,110.66,105.729571629056,105.729571629056,105.40229370048002,105.40229370048002,105.40229370048002,103.62525307223041\n2010-02-22,111.57,110.83,111.15,111.56,106.3136144661504,106.3136144661504,105.77235607845121,105.77235607845121,105.77235607845121,104.10193788789658\n2010-02-23,111.2,109.52,109.81,110.88,106.83925301953536,106.83925301953536,106.12021471374413,106.12021471374413,106.12021471374413,104.55002161462279\n2010-02-24,111.0,109.86,110.84,110.13,107.31232771758182,107.31232771758182,106.44720183091948,106.44720183091948,106.44720183091948,104.97122031774542\n2010-02-25,110.75,108.94,110.67,109.22,107.73809494582363,107.73809494582363,106.75456972106431,106.75456972106431,106.75456972106431,105.36714709868069\n2010-02-26,111.12,110.11,110.76,110.8,108.12128545124126,108.12128545124126,107.04349553780045,107.04349553780045,107.04349553780045,105.73931827275985\n2010-03-01,112.0,111.17,111.86,111.2,108.46615690611713,108.46615690611713,107.31508580553242,107.31508580553242,107.31508580553242,106.08915917639426\n2010-03-02,112.74,112.0,112.19,112.42,108.89021807738308,108.89021807738308,107.64302979914515,107.64302979914515,107.64302979914515,106.50291803404666\n2010-03-03,112.97,112.02,112.3,112.49,109.42918754654946,109.42918754654946,108.05078741521353,108.05078741521353,108.05078741521353,107.00188459132292\n2010-03-04,112.8,112.03,112.66,112.47,109.99571753910155,109.99571753910155,108.49351654784432,108.49351654784432,108.49351654784432,107.53901497810385\n2010-03-05,114.34,113.1,114.23,113.39,110.4716027328453,110.4716027328453,108.89640005853833,108.89640005853833,108.89640005853833,108.0278036300745\n2010-03-08,114.52,114.07,114.29,114.28,111.16791424093314,111.16791424093314,109.4407600526845,109.4407600526845,109.4407600526845,108.65902326706706\n2010-03-09,114.99,113.87,114.46,113.93,111.83833139274651,111.83833139274651,109.9994764468892,109.9994764468892,109.9994764468892,109.30373070768968\n2010-03-10,115.27,114.42,114.99,114.51,112.46866511419721,112.46866511419721,110.5983392732625,110.5983392732625,110.5983392732625,109.98608302276692\n2010-03-11,115.48,114.35,115.45,114.7,113.02893209135776,113.02893209135776,111.20565516773837,111.20565516773837,111.20565516773837,110.67299222980722\n2010-03-12,115.97,115.14,115.46,115.93,113.51914567308621,113.51914567308621,111.804063444255,111.804063444255,111.804063444255,111.3459733176342\n2010-03-15,115.58,114.6,115.5,115.25,114.00931653846897,114.00931653846897,112.42895392761675,112.42895392761675,112.42895392761675,112.03957731998908\n2010-03-16,116.51,115.49,116.41,115.8,114.40145323077518,114.40145323077518,112.96011083847424,112.96011083847424,112.96011083847424,112.62914072199072\n2010-03-17,117.48,116.71,117.13,116.76,114.6,114.6,113.52809310431836,113.52809310431836,113.52809310431836,113.25007820647221\n2010-03-18,117.27,116.57,117.03,117.11,115.176,115.176,114.19991727658424,114.19991727658424,114.19991727658424,113.96916491137193\n2010-03-19,116.97,115.52,115.93,116.89,117.48,-117.48,114.75753133956492,114.75753133956492,114.75753133956492,114.5660068764387\n2010-03-22,116.8,115.24,116.59,115.29,117.44080000000001,-117.44080000000001,115.22035101183889,115.22035101183889,115.22035101183889,115.06138570744413\n2010-03-23,117.51,116.38,117.4,116.74,115.24,115.24,115.24,115.24,115.24,115.24\n2010-03-24,117.32,116.6,116.85,116.97,115.24,115.24,115.24,115.24,115.24,115.24\n2010-03-25,118.1,116.51,116.62,117.67,115.2854,115.2854,115.6486,115.6486,115.6486,115.6486\n2010-03-26,117.42,116.12,116.66,116.9,115.397984,115.397984,116.114366,116.114366,116.114366,116.114366\n2010-03-29,117.53,116.97,117.32,117.19,115.50606463999999,115.50606463999999,116.12,116.12,116.12,116.12\n2010-03-30,117.83,116.91,117.4,117.43,115.60982205439998,115.60982205439998,116.12,116.12,116.12,116.12\n2010-03-31,117.52,116.61,116.99,116.93,115.70942917222399,115.70942917222399,116.4962,116.4962,116.4962,116.4962\n2010-04-01,118.21,117.1,117.82,117.83,115.80505200533503,115.80505200533503,116.61,116.61,116.61,116.61\n2010-04-05,118.84,117.92,118.76,118.26,115.94934888501493,115.94934888501493,116.61,116.61,116.61,116.61\n2010-04-06,119.25,118.29,119.04,118.44,116.18060097421373,116.18060097421373,117.0783,117.0783,117.0783,117.0783\n2010-04-07,119.08,117.81,118.36,118.81,116.48754087679237,116.48754087679237,117.556074,117.556074,117.556074,117.556074\n2010-04-08,118.97,117.6,118.78,117.92,116.76378678911313,116.76378678911313,-119.25,-119.25,-119.25,-121.635\n2010-04-09,119.6,118.8,119.55,119.01,117.01240811020182,117.01240811020182,117.6,117.6,117.6,-121.51395000000001\n2010-04-12,120.05,119.56,119.74,119.72,117.3229191369776,117.3229191369776,117.6,117.6,117.6,-121.39653150000001\n2010-04-13,120.03,119.0,119.87,119.64,117.70471045780074,117.70471045780074,117.67349999999999,117.67349999999999,117.67349999999999,-121.28263555500001\n2010-04-14,121.19,120.08,121.19,120.29,118.03305099370864,118.03305099370864,117.744795,117.744795,117.744795,115.24799999999999\n2010-04-15,121.53,120.95,121.32,121.02,118.53816283471527,118.53816283471527,117.88260319999999,117.88260319999999,117.88260319999999,115.36684\n2010-04-16,121.08,118.76,119.4,120.86,121.53,-121.53,118.06497304,118.06497304,118.06497304,115.55173479999999\n2010-04-19,119.92,118.47,119.81,119.02,121.53,-121.53,118.23822438799999,118.23822438799999,118.23822438799999,115.73108275599999\n2010-04-20,120.98,120.17,120.88,120.54,121.4076,-121.4076,118.40281316859999,118.40281316859999,118.40281316859999,115.90505027331999\n2010-04-21,121.22,119.99,120.66,120.97,121.290096,-121.290096,118.47,118.47,118.47,116.07379876512039\n2010-04-22,121.17,119.13,121.02,119.84,121.22,-121.22,118.623,118.623,118.623,116.23748480216678\n2010-04-23,121.86,120.63,121.79,120.95,118.47,118.47,118.76835,118.76835,118.76835,116.39626025810178\n2010-04-26,122.12,121.23,121.35,121.85,118.5378,118.5378,118.953849,118.953849,118.953849,116.6148098477777\n2010-04-27,121.27,118.25,118.43,120.69,122.12,-122.12,-122.12,-122.12,-122.12,116.89006935538882\n2010-04-28,119.68,118.28,119.35,119.06,122.12,-122.12,-122.12,-122.12,-122.12,117.15156588761937\n2010-04-29,121.11,120.07,120.85,120.12,122.04260000000001,-122.04260000000001,-122.0039,-122.0039,-122.0039,117.39998759323841\n2010-04-30,121.01,118.78,118.86,120.89,121.96674800000001,-121.96674800000001,-121.891283,-121.891283,-121.891283,117.63598821357648\n2010-05-03,120.68,119.2,120.36,119.39,121.89241304000001,-121.89241304000001,-121.78204451,-121.78204451,-121.78204451,117.86018880289765\n2010-05-04,119.03,116.92,117.58,119.02,121.81956477920001,-121.81956477920001,-121.67608317470001,-121.67608317470001,-121.67608317470001,-124.56240000000001\n2010-05-05,117.8,115.97,116.82,116.51,121.623582188032,-121.623582188032,-121.43827901596501,-121.43827901596501,-121.43827901596501,-124.33312800000002\n2010-05-06,117.0,106.13,112.74,116.25,121.28436725675009,-121.28436725675009,-121.05549948484746,-121.05549948484746,-121.05549948484746,-123.91497160000002\n2010-05-07,113.76,109.58,111.0,112.77,120.07201787621008,-120.07201787621008,-119.71220453121119,-119.71220453121119,-119.71220453121119,-122.67002358800002\n2010-05-10,116.65,114.92,116.17,115.87,118.95665644611327,-118.95665644611327,-118.48980612340218,-118.48980612340218,-118.48980612340218,-121.51222193684002\n2010-05-11,117.36,114.92,115.83,115.07,117.93052393042421,-117.93052393042421,-117.37742357229598,-117.37742357229598,-117.37742357229598,-120.43546640126122\n2010-05-12,117.61,116.09,117.47,116.33,106.13,106.13,106.13,106.13,106.13,-119.43408375317294\n2010-05-13,117.67,115.89,116.02,117.2,106.3596,106.3596,106.3596,106.3596,106.3596,-118.50279789045084\n2010-05-14,115.33,112.87,113.92,115.1,106.812016,106.812016,106.698912,106.698912,106.698912,-117.67\n2010-05-17,114.51,111.78,113.91,114.18,107.24633536,107.24633536,107.02804464,107.02804464,107.02804464,-117.67\n2010-05-18,115.22,112.03,112.43,114.9,107.6632819456,107.6632819456,107.34730330080001,107.34730330080001,107.34730330080001,-116.8622\n2010-05-19,112.77,110.37,111.74,111.75,108.063550667776,108.063550667776,107.65698420177601,107.65698420177601,107.65698420177601,-116.110946\n2010-05-20,109.89,107.48,107.55,109.44,117.67,-117.67,-117.67,-117.67,-117.67,-115.41227977999999\n2010-05-21,109.38,105.64,109.03,105.96,117.4662,-117.4662,-117.3643,-117.3643,-117.3643,-114.76252019539999\n2010-05-24,109.38,107.61,107.7,108.5,116.993152,-116.993152,-116.778085,-116.778085,-116.778085,-113.94149337781398\n2010-05-25,107.87,104.38,107.8,105.18,116.53902592,-116.53902592,-116.22118075,-116.22118075,-116.22118075,-113.19435897381072\n2010-05-26,109.47,106.86,107.17,108.53,115.8094843648,-115.8094843648,-115.3922980975,-115.3922980975,-115.3922980975,-112.22477948669155\n2010-05-27,110.8,108.79,110.79,109.22,115.123715302912,-115.123715302912,-114.621437230675,-114.621437230675,-114.621437230675,-111.36185374315548\n2010-05-28,110.68,108.85,109.44,110.67,114.47909238473729,-114.47909238473729,-113.90453662452775,-113.90453662452775,-113.90453662452775,-110.8\n2010-06-01,109.95,107.38,107.52,108.34,113.87314684165305,-113.87314684165305,-113.2378190608108,-113.2378190608108,-113.2378190608108,-110.8\n2010-06-02,110.34,107.61,110.28,108.06,113.30355803115387,-113.30355803115387,-112.61777172655405,-112.61777172655405,-112.61777172655405,-110.68\n2010-06-03,111.06,109.59,110.7,110.68,112.76814454928464,-112.76814454928464,-112.04112770569527,-112.04112770569527,-112.04112770569527,102.2924\n2010-06-04,109.33,106.47,106.94,108.64,112.26485587632756,-112.26485587632756,-111.5048487662966,-111.5048487662966,-111.5048487662966,102.467752\n2010-06-07,107.61,105.41,105.49,107.17,111.7917645237479,-111.7917645237479,-111.06,-111.06,-111.06,102.63959696\n2010-06-08,106.83,104.65,106.57,105.61,111.34705865232303,-111.34705865232303,-110.5924,-110.5924,-110.5924,102.80800502080001\n2010-06-09,108.28,105.66,105.99,107.26,110.92903513318365,-110.92903513318365,-110.157532,-110.157532,-110.157532,102.97304492038401\n2010-06-10,109.28,107.69,109.19,107.86,110.53609302519263,-110.53609302519263,-109.75310476,-109.75310476,-109.75310476,103.13478402197633\n2010-06-11,109.75,108.13,109.68,108.21,110.16672744368107,-110.16672744368107,104.38,104.38,104.38,103.29328834153681\n2010-06-14,111.12,109.4,109.57,110.59,104.38,104.38,104.4874,104.4874,104.4874,103.44862257470608\n2010-06-15,112.1,110.09,111.95,110.36,104.5148,104.5148,104.68637799999999,104.68637799999999,104.68637799999999,103.67876389746489\n2010-06-16,112.42,111.2,111.96,111.46,104.818208,104.818208,104.98292287999999,104.98292287999999,104.98292287999999,104.0156133415663\n2010-06-17,112.33,111.06,112.14,112.29,105.27431552,105.27431552,105.35477673599999,105.35477673599999,105.35477673599999,104.43583267448798\n2010-06-18,112.13,111.37,111.66,111.81,105.7030565888,105.7030565888,105.7080378992,105.7080378992,105.7080378992,104.83504104076358\n2010-06-21,113.2,110.79,111.41,113.14,106.106073193472,106.106073193472,106.04363600424,106.04363600424,106.04363600424,105.2142889887254\n2010-06-22,111.9,109.42,109.57,111.43,106.67358733799423,106.67358733799423,106.4730178439856,106.4730178439856,106.4730178439856,105.69343164940187\n2010-06-23,110.02,108.48,109.26,109.62,107.1957003509547,107.1957003509547,106.87663677334646,106.87663677334646,106.87663677334646,106.14382575043776\n2010-06-24,108.83,107.14,107.47,108.68,113.2,-113.2,-113.2,-113.2,-113.2,106.56719620541149\n2010-06-25,108.42,106.77,107.95,107.74,113.0788,-113.0788,-113.01820000000001,-113.01820000000001,-113.01820000000001,-115.464\n2010-06-28,108.32,107.15,107.49,108.03,112.826448,-112.826448,-112.70579000000001,-112.70579000000001,-112.70579000000001,-115.20318\n2010-06-29,106.06,103.56,104.2,106.04,112.58419008,-112.58419008,-112.4090005,-112.4090005,-112.4090005,-114.9501846\n2010-06-30,104.88,102.88,103.22,103.9,112.0427386752,-112.0427386752,-111.78957046500001,-111.78957046500001,-111.78957046500001,-114.38067537\n2010-07-01,103.49,101.14,102.81,103.18,111.309719581184,-111.309719581184,-110.98770912315001,-110.98770912315001,-110.98770912315001,-113.57562809410001\n2010-07-02,103.42,101.62,102.2,103.12,110.2927476230656,-110.2927476230656,-109.90446111960351,-109.90446111960351,-109.90446111960351,-112.456421565631\n2010-07-06,104.37,101.88,102.86,103.65,109.37747286075904,-109.37747286075904,-108.94037039644712,-108.94037039644712,-108.94037039644712,-111.43794362472421\n2010-07-07,106.24,103.03,106.15,103.11,108.55372557468314,-108.55372557468314,-108.08232965283794,-108.08232965283794,-108.08232965283794,-110.51112869849904\n2010-07-08,107.28,105.91,107.17,106.93,107.81235301721483,-107.81235301721483,-107.31867339102577,-107.31867339102577,-107.31867339102577,-109.66772711563412\n2010-07-09,107.96,106.93,107.93,107.13,101.14,101.14,101.14,101.14,101.14,-108.90023167522705\n2010-07-12,108.24,107.15,108.03,107.62,101.2764,101.2764,101.2764,101.2764,101.2764,99.1172\n2010-07-13,110.09,108.93,109.66,109.17,101.55494399999999,101.55494399999999,101.48530799999999,101.48530799999999,101.48530799999999,99.299656\n2010-07-14,110.07,108.87,109.67,109.32,102.06704735999999,102.06704735999999,101.82949568,101.82949568,101.82949568,99.62336632\n2010-07-15,110.06,108.17,109.68,109.58,102.5484245184,102.5484245184,102.1599158528,102.1599158528,102.1599158528,99.9373653304\n2010-07-16,109.16,106.45,106.63,109.06,103.000919047296,103.000919047296,102.477119218688,102.477119218688,102.477119218688,100.241944370488\n2010-07-19,107.63,106.22,107.29,107.08,103.42626390445824,103.42626390445824,102.78163444994048,102.78163444994048,102.78163444994048,100.53738603937336\n2010-07-20,108.56,105.82,108.48,105.85,103.82608807019075,103.82608807019075,103.07396907194287,103.07396907194287,103.07396907194287,100.82396445819217\n2010-07-21,109.07,106.63,107.07,109.05,104.2019227859793,104.2019227859793,103.35461030906515,103.35461030906515,103.35461030906515,101.1019455244464\n2010-07-22,109.94,108.33,109.48,108.33,104.55520741882054,104.55520741882054,103.62402589670255,103.62402589670255,103.62402589670255,101.37158715871301\n2010-07-23,110.56,108.93,110.41,109.26,104.88729497369131,104.88729497369131,103.88266486083445,103.88266486083445,103.88266486083445,101.63313954395163\n2010-07-26,111.67,110.29,111.57,110.56,105.341111375796,105.341111375796,104.21653161779273,104.21653161779273,104.21653161779273,101.99021396219356\n2010-07-27,112.29,111.11,111.55,112.15,105.9740002382164,105.9740002382164,104.66373972072516,104.66373972072516,104.66373972072516,102.47420326408388\n2010-07-28,111.66,110.46,110.8,111.37,106.73192020963043,106.73192020963043,105.1975779402744,105.1975779402744,105.1975779402744,103.06315106823885\n2010-07-29,111.82,109.42,110.29,111.51,107.39888978447478,107.39888978447478,105.6940474844552,105.6940474844552,105.6940474844552,103.61676200414452\n2010-07-30,110.86,108.98,110.27,109.2,107.9858230103378,107.9858230103378,106.15576416054333,106.15576416054333,106.15576416054333,104.13715628389585\n2010-08-02,112.94,111.54,112.76,112.01,108.50232424909726,108.50232424909726,106.5851606693053,106.5851606693053,106.5851606693053,104.6263269068621\n2010-08-03,112.77,111.85,112.22,112.5,108.98,108.98,107.09354781576087,107.09354781576087,107.09354781576087,105.20828402338175\n2010-08-04,113.11,112.16,112.97,112.5,109.5344,109.5344,107.5612639905,107.5612639905,107.5612639905,105.74950414174502\n2010-08-05,112.91,112.08,112.85,112.31,110.106496,110.106496,108.060650231355,108.060650231355,108.060650231355,106.33834381040542\n2010-08-06,112.57,110.92,112.41,111.76,110.58705664,110.58705664,108.51509171053304,108.51509171053304,108.51509171053304,106.88007630557298\n2010-08-09,113.18,112.32,113.01,112.94,110.92,110.92,108.92863345658508,108.92863345658508,108.92863345658508,107.37847020112714\n2010-08-10,112.98,111.38,112.39,112.08,110.92,110.92,109.35377011092656,109.35377011092656,109.35377011092656,107.9006078830257\n2010-08-11,110.69,109.12,109.3,110.69,113.18,-113.18,-113.18,-113.18,-113.18,108.37575317355339\n2010-08-12,109.02,107.6,108.6,107.62,113.09880000000001,-113.09880000000001,-113.05820000000001,-113.05820000000001,-113.05820000000001,-115.4436\n2010-08-13,108.95,108.18,108.28,108.27,112.878848,-112.878848,-112.78529000000002,-112.78529000000002,-112.78529000000002,-115.208292\n2010-08-16,108.61,107.18,108.26,107.56,112.66769408,-112.66769408,-112.52602550000002,-112.52602550000002,-112.52602550000002,-114.98004324\n2010-08-17,110.39,108.88,109.59,109.16,112.3384324352,-112.3384324352,-112.15180371500001,-112.15180371500001,-112.15180371500001,-114.590041078\n2010-08-18,110.38,108.91,109.78,109.53,112.02892648908801,-112.02892648908801,-111.80377745495001,-111.80377745495001,-111.80377745495001,-114.2195390241\n2010-08-19,109.49,107.43,107.88,109.23,111.73799089974273,-111.73799089974273,-111.4801130331035,-111.4801130331035,-111.4801130331035,-113.867562072895\n2010-08-20,107.7,106.75,107.53,107.52,111.46451144575816,-111.46451144575816,-111.17910512078626,-111.17910512078626,-111.17910512078626,-113.53318396925025\n2010-08-23,108.57,107.07,107.13,108.0,111.08735053009751,-111.08735053009751,-110.7804856599155,-110.7804856599155,-110.7804856599155,-113.05836109140273\n2010-08-24,106.39,104.98,105.56,105.88,110.74036248768971,-110.74036248768971,-110.41774195052311,-110.41774195052311,-110.41774195052311,-112.61677581500454\n2010-08-25,106.34,104.3,105.88,104.93,110.16432623892074,-110.16432623892074,-109.81959033596557,-109.81959033596557,-109.81959033596557,-111.92946599165414\n2010-08-26,106.58,104.88,105.23,106.4,109.46060709025025,-109.46060709025025,-109.10204359229004,-109.10204359229004,-109.10204359229004,-111.09022473257218\n2010-08-27,106.97,104.31,106.82,105.83,108.84133423942022,-108.84133423942022,-108.47777792529234,-108.47777792529234,-108.47777792529234,-110.34330001198924\n2010-08-30,106.91,105.3,105.34,106.54,108.2963741306898,-108.2963741306898,-107.93466679500433,-107.93466679500433,-107.93466679500433,-109.67853701067042\n2010-08-31,105.98,104.49,105.47,104.88,107.81680923500703,-107.81680923500703,-107.46216011165377,-107.46216011165377,-107.46216011165377,-109.08689793949668\n2010-09-01,108.61,106.67,108.44,106.74,104.3,104.3,104.3,104.3,104.3,102.214\n2010-09-02,109.49,108.49,109.47,108.69,104.3862,104.3862,104.3862,104.3862,104.3862,102.34192\n2010-09-03,110.99,109.95,110.92,110.58,104.590352,104.590352,104.539314,104.539314,104.539314,102.5563624\n2010-09-07,110.51,109.55,109.68,110.39,104.97433088,104.97433088,104.79734144000001,104.79734144000001,104.79734144000001,102.893707904\n2010-09-08,110.85,109.81,110.41,109.85,105.3352710272,105.3352710272,105.0450477824,105.0450477824,105.0450477824,103.21755958784\n2010-09-09,111.68,110.62,110.94,111.63,105.67455476556799,105.67455476556799,105.282845871104,105.282845871104,105.282845871104,103.5284572043264\n2010-09-10,111.61,110.87,111.54,111.13,106.15499038432255,106.15499038432255,105.6027035775488,105.6027035775488,105.6027035775488,103.93603434411008\n2010-09-13,112.95,112.13,112.72,112.61,106.59699115357674,106.59699115357674,105.90656839867135,105.90656839867135,105.90656839867135,104.32323262690458\n2010-09-14,113.29,112.08,112.65,112.54,107.23229203821907,107.23229203821907,106.32917429475107,106.32917429475107,106.32917429475107,104.8408386692903\n2010-09-15,113.21,111.98,113.14,112.28,107.95921699363278,107.95921699363278,106.8164320941185,106.8164320941185,106.8164320941185,105.43227996243999\n2010-09-16,113.12,112.35,113.1,112.71,108.59891095439684,108.59891095439684,107.2695818475302,107.2695818475302,107.2695818475302,105.9823203650692\n2010-09-17,113.15,112.18,112.51,113.0,109.16184163986922,109.16184163986922,107.6910111182031,107.6910111182031,107.6910111182031,106.49385793951436\n2010-09-20,114.46,112.62,114.23,112.87,109.65722064308491,109.65722064308491,108.08294033992888,108.08294033992888,108.08294033992888,106.96958788374835\n2010-09-21,114.84,113.51,114.0,114.3,110.32960975305302,110.32960975305302,108.59310511273458,108.59310511273458,108.59310511273458,107.56882085304848\n2010-09-22,114.43,113.1,113.43,113.81,111.05127219256454,111.05127219256454,109.15532565258846,109.15532565258846,109.15532565258846,108.22322697627412\n2010-09-23,113.67,112.19,112.5,112.45,111.6574686417542,111.6574686417542,109.6669463438555,109.6669463438555,109.6669463438555,108.81873654840945\n2010-09-24,114.9,113.65,114.79,113.73,112.16667365907354,112.16667365907354,110.13252117290851,110.13252117290851,110.13252117290851,109.36065025905259\n2010-09-27,114.99,114.17,114.32,114.82,112.19,112.19,110.60926905561766,110.60926905561766,110.60926905561766,109.91458523314733\n2010-09-28,115.04,113.19,114.67,114.42,112.75,112.75,111.09114945949972,111.09114945949972,111.09114945949972,110.47288085750112\n2010-09-29,114.9,114.02,114.41,114.44,113.19,113.19,111.56501152435975,111.56501152435975,111.56501152435975,111.02093515460099\n2010-09-30,115.79,113.59,114.12,115.08,113.19,113.19,111.98201014143658,111.98201014143658,111.98201014143658,111.50322293604887\n2010-10-01,115.12,113.93,114.61,114.99,113.59,113.59,112.47704882304983,112.47704882304983,112.47704882304983,112.06050395436252\n2010-10-04,114.85,113.18,113.75,114.36,115.79,-115.79,112.90773247605335,112.90773247605335,112.90773247605335,112.5453384402954\n2010-10-05,116.32,114.67,116.05,114.84,113.18,113.18,113.18,113.18,113.18,112.967144443057\n2010-10-06,116.33,115.56,116.06,116.05,113.18,113.18,113.18,113.18,113.18,113.18\n2010-10-07,116.53,115.19,115.89,116.5,113.30600000000001,113.30600000000001,113.6525,113.6525,113.6525,113.6525\n2010-10-08,116.86,115.61,116.56,116.04,113.49944,113.49944,114.1129,114.1129,114.1129,114.1129\n2010-10-11,116.97,116.25,116.66,116.77,113.7682848,113.7682848,114.57990699999999,114.57990699999999,114.57990699999999,114.57990699999999\n2010-10-12,117.35,115.65,116.99,116.28,114.08845632,114.08845632,115.01012374,115.01012374,115.01012374,115.01012374\n2010-10-13,118.55,117.38,117.88,117.62,114.47984156160001,114.47984156160001,115.4547002294,115.4547002294,115.4547002294,115.4547002294\n2010-10-14,118.01,116.72,117.55,117.81,115.04966374297601,115.04966374297601,115.65,115.65,115.65,115.65\n2010-10-15,118.35,116.76,117.72,118.27,115.53971081895936,115.53971081895936,116.23,116.23,116.23,116.23\n2010-10-18,118.66,117.52,118.55,117.77,115.96115130430505,115.96115130430505,116.694,116.694,116.694,116.694\n2010-10-19,117.85,116.02,116.71,117.22,118.66,-118.66,-118.66,-118.66,-118.66,-121.0332\n2010-10-20,118.44,116.87,117.87,116.97,118.66,-118.66,-118.66,-118.66,-118.66,-120.882804\n2010-10-21,119.08,117.21,118.12,118.42,116.02,116.02,116.02,116.02,116.02,-120.73691987999999\n2010-10-22,118.53,118.0,118.38,118.29,116.0812,116.0812,116.0812,116.0812,116.0812,-120.59541228359998\n2010-10-25,119.76,118.61,118.69,119.19,116.141176,116.141176,116.141176,116.141176,116.141176,-120.45814991509198\n2010-10-26,118.84,117.87,118.73,118.08,116.28592896,116.28592896,116.24974072,116.24974072,116.24974072,-120.32500541763922\n2010-10-27,118.51,117.26,118.38,117.84,116.42489180160001,116.42489180160001,116.35504849840001,116.35504849840001,116.35504849840001,-120.19585525511005\n2010-10-28,119.11,117.83,118.4,119.04,116.55829612953602,116.55829612953602,116.457197043448,116.457197043448,116.457197043448,-120.07057959745674\n2010-10-29,118.71,118.07,118.53,118.27,116.68636428435458,116.68636428435458,116.55628113214456,116.55628113214456,116.55628113214456,-119.94906220953304\n2010-11-01,119.75,117.85,118.53,119.15,116.8093097129804,116.8093097129804,116.65239269818022,116.65239269818022,116.65239269818022,-119.83119034324704\n2010-11-02,119.75,119.1,119.49,119.41,116.92733732446118,116.92733732446118,116.74562091723482,116.74562091723482,116.74562091723482,113.69959999999999\n2010-11-03,120.02,118.45,120.01,119.63,117.04064383148273,117.04064383148273,116.83605228971777,116.83605228971777,116.83605228971777,113.820608\n2010-11-04,122.32,121.13,122.26,121.3,117.21940520159376,117.21940520159376,116.96341019812905,116.96341019812905,116.96341019812905,114.00658976\n2010-11-05,122.92,122.18,122.74,122.36,117.62745278546626,117.62745278546626,117.2312396882226,117.2312396882226,117.2312396882226,114.3391261696\n2010-11-08,122.69,121.94,122.54,122.33,118.15670750691963,118.15670750691963,117.57256530692925,117.57256530692925,117.57256530692925,114.76816986111999\n2010-11-09,122.94,121.12,121.6,122.82,118.63303675622767,118.63303675622767,117.8934113885135,117.8934113885135,117.8934113885135,115.17576136806399\n2010-11-10,122.16,120.66,122.09,121.56,119.14987234548035,119.14987234548035,118.24667259131755,118.24667259131755,118.24667259131755,115.64161568598014\n2010-11-11,121.82,120.69,121.66,121.03,119.6046876640227,119.6046876640227,118.57520550992533,118.57520550992533,118.57520550992533,116.07951874482133\n2010-11-12,121.35,119.65,120.18,120.81,122.94,-122.94,118.88074112423055,118.88074112423055,118.88074112423055,116.49114762013205\n2010-11-15,121.05,119.98,120.04,120.57,122.8742,-122.8742,119.16488924553441,119.16488924553441,119.16488924553441,116.87807876292413\n2010-11-16,119.49,117.59,118.12,119.33,122.80971600000001,-122.80971600000001,-122.94,-122.94,-122.94,117.24179403714868\n2010-11-17,118.7,117.86,118.21,118.21,122.60092736000001,-122.60092736000001,-122.7795,-122.7795,-122.7795,117.58368639491975\n2010-11-18,120.39,119.35,120.02,119.35,122.40049026560001,-122.40049026560001,-122.623815,-122.623815,-122.623815,117.59\n2010-11-19,120.34,119.25,120.26,119.92,122.20807065497601,-122.20807065497601,-122.47280054999999,-122.47280054999999,-122.47280054999999,117.86\n2010-11-22,120.24,118.77,120.19,119.72,122.02334782877698,-122.02334782877698,-122.32631653349999,-122.32631653349999,-122.32631653349999,118.1648\n2010-11-23,119.02,117.99,118.42,118.79,121.8460139156259,-121.8460139156259,-122.18422703749499,-122.18422703749499,-122.18422703749499,-125.3988\n2010-11-24,120.23,119.17,120.19,119.25,121.67577335900087,-121.67577335900087,-122.04640022637014,-122.04640022637014,-122.04640022637014,-125.176536\n2010-11-26,119.81,119.03,119.27,119.14,121.51234242464083,-121.51234242464083,-121.91270821957903,-121.91270821957903,-121.91270821957903,-124.96093992\n2010-11-29,119.48,117.74,119.16,118.51,121.3554487276552,-121.3554487276552,-121.78302697299166,-121.78302697299166,-121.78302697299166,-124.7518117224\n2010-11-30,119.17,117.81,118.48,117.96,121.204830778549,-121.204830778549,-121.65723616380191,-121.65723616380191,-121.65723616380191,-124.40122113628\n2010-12-01,121.24,120.19,121.0,120.25,117.59,117.59,-121.53521907888785,-121.53521907888785,-121.53521907888785,-124.068160079466\n2010-12-02,122.65,121.14,122.57,121.17,117.663,117.663,117.59,117.59,117.59,-123.7517520754927\n2010-12-03,123.03,122.11,122.86,122.15,117.86247999999999,117.86247999999999,117.69120000000001,117.69120000000001,117.69120000000001,-123.45116447171807\n2010-12-06,123.04,122.5,122.74,122.64,118.1725312,118.1725312,117.851364,117.851364,117.851364,-123.16560624813216\n2010-12-07,124.01,122.76,122.83,123.97,118.561928704,118.561928704,118.05890944000001,118.05890944000001,118.05890944000001,115.3852\n2010-12-08,123.38,122.41,123.29,122.97,119.1067358336,119.1067358336,118.35646396800001,118.35646396800001,118.35646396800001,115.55769599999999\n2010-12-09,124.02,123.16,123.82,123.94,119.59706225024,119.59706225024,118.63914076960002,118.63914076960002,118.63914076960002,115.72674208\n2010-12-10,124.6,123.73,124.5,124.12,120.1278147802112,120.1278147802112,118.96199232342401,118.96199232342401,118.96199232342401,115.9755398176\n2010-12-13,125.2,124.52,124.56,125.04,120.75392071098163,120.75392071098163,119.35665286078434,119.35665286078434,119.35665286078434,116.32051822489599\n2010-12-14,125.23,124.29,124.65,124.79,121.46529339722457,121.46529339722457,119.82412063192159,119.82412063192159,119.82412063192159,116.76449231365119\n2010-12-15,124.93,123.89,124.12,124.49,122.14294058572415,122.14294058572415,120.31064977504865,120.31064977504865,120.31064977504865,117.27242277483212\n2010-12-16,124.91,123.75,124.82,124.22,122.6986112802938,122.6986112802938,120.75339129529426,120.75339129529426,120.75339129529426,117.7498774083422\n2010-12-17,124.46,123.82,124.38,124.05,123.15426124984091,123.15426124984091,121.15628607871778,121.15628607871778,121.15628607871778,118.19868476384167\n2010-12-20,124.9,123.99,124.57,124.62,123.52789422486956,123.52789422486956,121.52292033163319,121.52292033163319,121.52292033163319,118.62056367801117\n2010-12-21,125.47,124.88,125.39,125.0,123.82,123.82,121.8565575017862,121.8565575017862,121.8565575017862,119.0171298573305\n2010-12-22,125.82,125.41,125.79,125.54,123.99,123.99,122.21790175160758,122.21790175160758,122.21790175160758,119.46883076731737\n2010-12-23,125.77,125.29,125.61,125.63,124.356,124.356,122.61413255893075,122.61413255893075,122.61413255893075,119.97692430593199\n2010-12-27,125.77,125.04,125.65,125.09,124.6488,124.6488,122.96677797744836,122.96677797744836,122.96677797744836,120.44437036145743\n2010-12-28,125.95,125.5,125.8,125.93,124.88304,124.88304,123.28063239992903,123.28063239992903,123.28063239992903,120.87442073254084\n2010-12-29,126.2,125.9,125.92,125.96,125.04,125.04,123.60095651193755,123.60095651193755,123.60095651193755,121.33122286661217\n2010-12-30,126.13,125.53,125.72,125.81,125.272,125.272,123.93883216538568,123.93883216538568,123.93883216538568,121.81810057995095\n2010-12-31,125.87,125.34,125.78,125.53,126.2,-126.2,124.23278398388554,124.23278398388554,124.23278398388554,122.25629052195586\n2011-01-03,127.6,126.66,127.01,126.73,125.34,125.34,124.48852206598042,124.48852206598042,124.48852206598042,122.65066146976028\n2011-01-04,127.37,126.19,126.93,127.3,125.34,125.34,124.92412897674316,124.92412897674316,124.92412897674316,123.19508870808664\n2011-01-05,127.72,126.47,127.64,126.57,125.3852,125.3852,125.29875091999912,125.29875091999912,125.29875091999912,123.67962895019711\n2011-01-06,127.83,127.01,127.39,127.7,125.47859199999999,125.47859199999999,125.66193828199926,125.66193828199926,125.66193828199926,124.16447347617346\n2011-01-07,127.77,126.16,127.13,127.55,125.61967648,125.61967648,126.00882815687937,126.00882815687937,126.00882815687937,124.6409919242709\n2011-01-10,127.16,126.2,127.01,126.59,125.75229589119999,125.75229589119999,126.16,126.16,126.16,125.05556297411569\n2011-01-11,127.74,126.95,127.43,127.45,125.876958137728,125.876958137728,126.16,126.16,126.16,125.41623978748065\n2011-01-12,128.71,127.99,128.64,128.25,125.99414064946431,125.99414064946431,126.2,126.2,126.2,125.73002861510817\n2011-01-13,128.69,128.05,128.45,128.61,126.21140939750717,126.21140939750717,126.6267,126.6267,126.6267,126.14722460899303\n2011-01-14,129.33,128.11,129.28,128.17,126.4112966457066,126.4112966457066,126.980861,126.980861,126.980861,126.50601316373401\n2011-01-18,129.64,129.03,129.53,129.21,126.70316698113594,126.70316698113594,127.40370602,127.40370602,127.40370602,126.92961118917391\n2011-01-19,129.5,127.91,128.27,129.43,127.05558694339962,127.05558694339962,127.8286018762,127.8286018762,127.8286018762,127.36327339890609\n2011-01-20,128.39,127.14,128.14,127.93,129.64,-129.64,-129.64,-129.64,-129.64,-132.2328\n2011-01-21,129.17,128.23,128.36,128.85,129.58999999999997,-129.58999999999997,-129.565,-129.565,-129.565,-132.080016\n2011-01-24,129.25,128.26,129.16,128.31,129.54099999999997,-129.54099999999997,-129.49224999999998,-129.49224999999998,-129.49224999999998,-131.93181552\n2011-01-25,129.2,128.11,129.16,128.77,129.49297999999996,-129.49297999999996,-129.42168249999997,-129.42168249999997,-129.42168249999997,-131.78806105439998\n2011-01-26,130.05,129.23,129.69,129.44,127.14,127.14,127.14,127.14,127.14,-131.64861922276796\n2011-01-27,130.21,129.47,130.03,129.65,127.1982,127.1982,127.1982,127.1982,127.1982,-131.51336064608492\n2011-01-28,130.35,127.51,127.72,130.17,127.318672,127.318672,127.288554,127.288554,127.288554,-131.38215982670238\n2011-01-31,128.78,127.76,128.67,128.05,127.50055168,127.50055168,127.41101184,127.41101184,127.41101184,-131.2548950319013\n2011-02-01,130.97,129.39,130.71,129.44,127.51,127.51,127.51,127.51,127.51,-131.13144818094426\n2011-02-02,130.84,130.33,130.48,130.46,127.76,127.76,127.683,127.683,127.683,-131.01170473551593\n2011-02-03,130.98,129.57,130.76,130.27,128.01680000000002,128.01680000000002,127.84735,127.84735,127.84735,124.5972\n2011-02-04,131.2,130.23,131.17,130.85,128.31312000000003,128.31312000000003,128.035309,128.035309,128.035309,124.724856\n2011-02-07,132.4,131.43,132.0,131.44,128.65954560000003,128.65954560000003,128.25683737,128.25683737,128.25683737,124.91911032\n2011-02-08,132.64,131.73,132.59,132.13,129.18320921600002,129.18320921600002,128.5882903804,128.5882903804,128.5882903804,125.2183459072\n2011-02-09,132.63,131.61,132.32,132.2,129.73629574144002,129.73629574144002,128.952944246164,128.952944246164,128.952944246164,125.58942861184\n2011-02-10,132.47,131.3,132.33,131.61,130.2008884228096,130.2008884228096,129.28477926400925,129.28477926400925,129.28477926400925,125.941957181248\n2011-02-11,133.28,131.77,133.15,131.8,130.59114627516007,130.59114627516007,129.58674913024842,129.58674913024842,129.58674913024842,126.2768593221856\n2011-02-14,133.54,132.89,133.43,133.07,131.07513994563126,131.07513994563126,129.95607421722357,129.95607421722357,129.95607421722357,126.69704776285447\n2011-02-15,133.22,132.66,133.04,133.05,131.56811195650502,131.56811195650502,130.35030605332898,130.35030605332898,130.35030605332898,127.17605441945466\n2011-02-16,134.01,133.19,133.82,133.47,131.962489565204,131.962489565204,130.70117238746278,130.70117238746278,130.70117238746278,127.62153061009283\n2011-02-17,134.43,133.34,134.22,133.43,132.37199165216322,132.37199165216322,131.09823170096723,131.09823170096723,131.09823170096723,128.13260816128542\n2011-02-18,134.69,134.06,134.57,134.32,132.78359332173056,132.78359332173056,131.5313615798415,131.5313615798415,131.5313615798415,128.69937342676974\n2011-02-22,133.86,131.48,131.8,133.11,134.69,-134.69,-134.69,-134.69,-134.69,129.29843608409277\n2011-02-23,132.07,130.21,131.01,131.72,134.69,-134.69,-134.69,-134.69,-134.69,129.8375924756835\n2011-02-24,131.44,129.7,130.92,130.86,134.5108,-134.5108,-134.466,-134.466,-134.466,-137.3838\n2011-02-25,132.41,131.4,132.32,131.47,134.222152,-134.222152,-134.13238,-134.13238,-134.13238,-137.153286\n2011-02-28,133.32,132.38,133.15,132.84,133.95082288,-133.95082288,-133.8221134,-133.8221134,-133.8221134,-136.92968742000002\n2011-03-01,133.68,130.89,130.89,133.68,133.69577350720002,-133.69577350720002,129.7,129.7,129.7,-136.71279679740002\n2011-03-02,131.81,130.6,131.16,130.79,133.68,-133.68,129.7796,129.7796,129.7796,-136.502412893478\n2011-03-03,133.62,132.39,133.47,132.39,133.68,-133.68,129.857608,129.857608,129.857608,-136.29834050667367\n2011-03-04,133.48,131.6,132.47,133.37,133.62,-133.62,129.93405583999998,129.93405583999998,129.93405583999998,-136.10039029147345\n2011-03-07,133.15,130.74,131.37,132.8,133.62,-133.62,130.0089747232,130.0089747232,130.0089747232,-135.90837858272926\n2011-03-08,133.0,131.07,132.56,131.67,133.48,-133.48,130.082395228736,130.082395228736,130.082395228736,-135.7221272252474\n2011-03-09,132.79,131.6,132.39,132.34,133.2532,-133.2532,130.15434732416128,130.15434732416128,130.15434732416128,-135.54146340848996\n2011-03-10,131.04,129.81,129.93,131.04,133.040008,-133.040008,-133.68,-133.68,-133.68,-135.36621950623527\n2011-03-11,131.31,129.49,130.84,129.49,132.83960752,-132.83960752,-133.56390000000002,-133.56390000000002,-133.56390000000002,-135.19623292104822\n2011-03-14,130.48,129.06,130.05,130.03,132.5716389184,-132.5716389184,-133.360205,-133.360205,-133.360205,-134.91092127499581\n2011-03-15,129.33,126.51,128.56,126.7,132.22047502656,-132.22047502656,-133.05919065,-133.05919065,-133.05919065,-134.5013567857461\n2011-03-16,128.57,125.28,126.21,128.18,131.5352180233728,-131.5352180233728,-132.4697634915,-132.4697634915,-132.4697634915,-133.78213467502897\n2011-03-17,128.39,127.1,127.85,128.01,130.65948750010062,-130.65948750010062,-131.678889507435,-131.678889507435,-131.678889507435,-132.84689986077578\n2011-03-18,128.88,127.51,127.76,128.84,129.90635925008652,-129.90635925008652,-130.97501166161715,-130.97501166161715,-130.97501166161715,-132.01454087609045\n2011-03-21,130.01,129.2,129.74,129.41,125.28,125.28,-130.34856037883927,-130.34856037883927,-130.34856037883927,-131.2737413797205\n2011-03-22,129.88,129.17,129.3,129.76,125.3746,125.3746,-130.01,-130.01,-130.01,-130.61442982795123\n2011-03-23,130.0,128.32,129.64,128.96,125.467308,125.467308,-130.01,-130.01,-130.01,-130.0276425468766\n2011-03-24,131.08,129.68,130.9,130.46,125.55816184,125.55816184,125.28,125.28,125.28,122.7744\n2011-03-25,131.86,130.95,131.29,131.22,125.7790353664,125.7790353664,125.396,125.396,125.396,122.940512\n2011-03-28,131.92,130.94,130.94,131.57,126.14389324441599,126.14389324441599,125.58992,125.58992,125.58992,123.20809664\n2011-03-29,131.89,130.44,131.86,130.89,126.6059817848627,126.6059817848627,125.84312320000001,125.84312320000001,125.84312320000001,123.5565727744\n2011-03-30,133.15,132.36,132.7,132.58,127.03110324207368,127.03110324207368,126.086198272,126.086198272,126.086198272,123.89110986342399\n2011-03-31,132.96,132.46,132.51,132.63,127.64299291786631,127.64299291786631,126.43938835840001,126.43938835840001,126.43938835840001,124.3540543702528\n2011-04-01,133.77,132.84,133.15,133.45,128.19369362607966,128.19369362607966,126.77491894048,126.77491894048,126.77491894048,124.79385165174016\n2011-04-04,133.67,132.88,133.24,133.48,128.86285039095011,128.86285039095011,127.1946238040512,127.1946238040512,127.1946238040512,125.33242055263575\n2011-04-05,133.83,132.94,133.24,132.95,129.4517083440361,129.4517083440361,127.58914637580813,127.58914637580813,127.58914637580813,125.8386753194776\n2011-04-06,134.0,133.12,133.66,133.85,130.06466917587105,130.06466917587105,128.02600612950155,128.02600612950155,128.02600612950155,126.39806804711417\n2011-04-07,133.94,132.66,133.32,133.39,130.69432210773167,130.69432210773167,128.50392563914144,128.50392563914144,128.50392563914144,127.00622260334504\n2011-04-08,133.99,132.31,132.86,133.88,131.2232305704946,131.2232305704946,128.94361158801013,128.94361158801013,128.94361158801013,127.56572479507743\n2011-04-11,133.45,132.14,132.47,133.01,131.66751367921546,131.66751367921546,129.34812266096932,129.34812266096932,129.34812266096932,128.08046681147124\n2011-04-12,131.97,130.99,131.45,131.71,134.0,-134.0,129.72027284809178,129.72027284809178,129.72027284809178,128.55402946655354\n2011-04-13,132.18,130.97,131.45,132.09,133.9398,-133.9398,130.06265102024443,130.06265102024443,130.06265102024443,128.98970710922927\n2011-04-14,131.76,130.27,131.56,130.69,133.82100799999998,-133.82100799999998,-134.0,-134.0,-134.0,129.39053054049094\n2011-04-15,132.37,131.41,132.12,131.78,133.60794751999998,-133.60794751999998,-133.8881,-133.8881,-133.8881,129.75928809725167\n2011-04-18,130.81,129.51,130.53,130.53,133.4076706688,-133.4076706688,-133.779557,-133.779557,-133.779557,-136.68\n2011-04-19,131.35,130.44,131.28,130.75,133.095857015296,-133.095857015296,-133.56607915,-133.56607915,-133.56607915,-136.4649\n2011-04-20,133.39,132.8,133.16,132.88,129.51,129.51,129.51,129.51,129.51,-136.256253\n2011-04-21,133.83,133.35,133.74,133.75,129.58759999999998,129.58759999999998,129.58759999999998,129.58759999999998,129.58759999999998,-136.05386541\n2011-04-25,133.85,133.2,133.62,133.66,129.75729599999997,129.75729599999997,129.71487199999999,129.71487199999999,129.71487199999999,-135.8575494477\n2011-04-26,135.05,133.91,134.79,134.05,130.00285823999997,130.00285823999997,129.88027712,129.88027712,129.88027712,-135.667122964269\n2011-04-27,135.87,134.5,135.63,135.05,130.40662958079997,130.40662958079997,130.13876326399998,130.13876326399998,130.13876326399998,126.9198\n2011-04-28,136.29,135.41,136.04,135.42,130.95296662271997,130.95296662271997,130.48263746815996,130.48263746815996,130.48263746815996,127.098804\n2011-04-29,136.57,135.98,136.54,136.14,131.59341062799356,131.59341062799356,130.88915284538876,130.88915284538876,130.88915284538876,127.37453988\n2011-05-02,137.18,135.95,136.25,137.1,132.29013314007446,132.29013314007446,131.34362061775767,131.34362061775767,131.34362061775767,127.7423582848\n2011-05-03,136.19,135.05,135.71,135.94,133.07251183766255,133.07251183766255,131.86889476215947,131.86889476215947,131.86889476215947,128.21424037056\n2011-05-04,135.73,134.24,134.86,135.7,133.72970994363655,133.72970994363655,132.3468942335651,132.3468942335651,132.3468942335651,128.66252835203198\n2011-05-05,134.94,133.02,133.63,134.09,137.18,-137.18,132.78187375254424,132.78187375254424,132.78187375254424,129.08840193443038\n2011-05-06,135.62,133.68,134.2,134.88,137.0968,-137.0968,133.02,133.02,133.02,129.49298183770887\n2011-05-09,135.11,133.98,134.72,134.2,137.015264,-137.015264,133.02,133.02,133.02,129.87733274582342\n2011-05-10,136.11,135.01,135.87,135.15,136.93535872,-136.93535872,133.39440000000002,133.39440000000002,133.39440000000002,130.24246610853226\n2011-05-11,135.69,133.82,134.45,135.64,136.8570515456,-136.8570515456,133.735104,133.735104,133.735104,130.58934280310564\n2011-05-12,135.36,133.39,135.1,134.07,136.780310514688,-136.780310514688,-137.18,-137.18,-137.18,130.91887566295037\n2011-05-13,135.33,133.57,134.04,135.17,136.70510430439424,-136.70510430439424,-137.0663,-137.0663,-137.0663,131.23193187980286\n2011-05-16,134.6,132.97,133.19,133.54,136.63140221830636,-136.63140221830636,-136.95601100000002,-136.95601100000002,-136.95601100000002,131.52933528581272\n2011-05-17,133.35,132.12,133.17,132.7,136.4849461295741,-136.4849461295741,-136.75671045,-136.75671045,-136.75671045,131.8118685215221\n2011-05-18,134.5,132.95,134.38,133.26,136.22304936179964,-136.22304936179964,-136.43214071850002,-136.43214071850002,-136.43214071850002,132.08027509544598\n2011-05-19,135.02,133.94,134.66,134.79,135.97686640009167,-135.97686640009167,-136.130290868205,-136.130290868205,-136.130290868205,132.12\n2011-05-20,134.52,133.36,133.67,134.31,135.74545441608618,-135.74545441608618,-135.84957050743066,-135.84957050743066,-135.84957050743066,132.373\n2011-05-23,132.46,131.59,132.04,131.99,135.527927151121,-135.527927151121,-135.58850057191052,-135.58850057191052,-135.58850057191052,-139.9236\n2011-05-24,132.73,131.7,131.95,132.42,135.21289297903132,-135.21289297903132,-135.22863552043856,-135.22863552043856,-135.22863552043856,-139.67359199999999\n2011-05-25,132.93,131.38,132.37,131.38,134.92306154070883,-134.92306154070883,-134.90115832359908,-134.90115832359908,-134.90115832359908,-139.43108424\n2011-05-26,133.24,131.78,133.01,132.0,134.56875538663795,-134.56875538663795,-134.51383090800317,-134.51383090800317,-134.51383090800317,-139.02853002799998\n2011-05-27,133.87,133.19,133.54,133.39,134.24987984797414,-134.24987984797414,-134.16910950812283,-134.16910950812283,-134.16910950812283,-138.64610352659997\n2011-05-31,134.9,133.84,134.89,134.78,131.38,131.38,131.38,131.38,131.38,-138.28279835026999\n2011-06-01,134.6,131.76,131.85,134.52,131.4504,131.4504,131.4504,131.4504,131.4504,-137.93765843275648\n2011-06-02,132.23,130.96,131.69,131.98,134.9,-134.9,-134.9,-134.9,-134.9,-137.60977551111864\n2011-06-03,131.42,130.08,130.4,130.16,134.8212,-134.8212,-134.7818,-134.7818,-134.7818,-137.14429122534034\n2011-06-06,130.36,128.87,129.05,130.09,134.631552,-134.631552,-134.54671000000002,-134.54671000000002,-134.54671000000002,-136.5085050150597\n2011-06-07,130.07,128.85,128.85,129.67,134.28585888,-134.28585888,-134.1493403,-134.1493403,-134.1493403,-135.66826946340313\n2011-06-08,129.19,128.18,128.4,128.77,133.8509901696,-133.8509901696,-133.672399673,-133.672399673,-133.672399673,-134.78189443316072\n2011-06-09,129.93,128.46,129.4,128.77,133.28389115264002,-133.28389115264002,-133.06823570897,-133.06823570897,-133.06823570897,-133.79161026818662\n2011-06-10,128.93,127.26,127.56,128.83,132.77350203737603,-132.77350203737603,-132.5305297809833,-132.5305297809833,-132.5305297809833,-132.94986872795863\n2011-06-13,128.24,127.05,127.67,127.89,132.1118817928909,-132.1118817928909,-131.84536090945548,-131.84536090945548,-131.84536090945548,-131.98259104420566\n2011-06-14,129.77,128.82,129.32,128.88,131.40321834188617,-131.40321834188617,-131.12605677303716,-131.12605677303716,-131.12605677303716,-131.04539874580658\n2011-06-15,128.65,126.68,127.02,128.26,130.79376777402211,-130.79376777402211,-130.51464825708157,-130.51464825708157,-130.51464825708157,-130.28627298410333\n2011-06-16,127.97,126.32,127.28,127.09,130.1355649301786,-130.1355649301786,-129.86275805337772,-129.86275805337772,-129.86275805337772,-129.77\n2011-06-17,127.94,126.62,127.02,127.91,129.44876324274645,-129.44876324274645,-129.18963402323595,-129.18963402323595,-129.18963402323595,-128.97650000000002\n2011-06-20,127.97,126.58,127.7,126.6,128.8855858590521,-128.8855858590521,-128.64440355882112,-128.64440355882112,-128.64440355882112,-128.365505\n2011-06-21,129.7,128.19,129.42,128.34,126.32,126.32,126.32,126.32,126.32,123.7936\n2011-06-22,129.81,128.59,128.7,129.05,126.38759999999999,126.38759999999999,126.38759999999999,126.38759999999999,126.38759999999999,123.911728\n2011-06-23,128.37,126.19,128.29,127.09,129.81,-129.81,-129.81,-129.81,-129.81,124.08867615999999\n2011-06-24,128.37,126.62,126.81,128.28,129.81,-129.81,-129.81,-129.81,-129.81,124.26031587519999\n2011-06-27,128.43,126.64,127.94,126.91,129.73760000000001,-129.73760000000001,-129.7014,-129.7014,-129.7014,124.426806398944\n2011-06-28,129.63,128.27,129.61,128.43,129.666648,-129.666648,126.19,126.19,126.19,124.58830220697567\n2011-06-29,130.92,129.71,130.75,130.16,126.19,126.19,126.2588,126.2588,126.2588,124.7449531407664\n2011-06-30,132.18,130.99,131.97,131.15,126.2846,126.2846,126.398636,126.398636,126.398636,124.99195501513574\n2011-07-01,134.1,131.78,133.96,131.95,126.520416,126.520416,126.62989055999999,126.62989055999999,126.62989055999999,125.35135726437896\n2011-07-05,134.08,133.39,133.71,133.8,126.97519104,126.97519104,127.003396032,127.003396032,127.003396032,125.87627582851623\n2011-07-06,134.14,133.11,133.94,133.48,127.4026795776,127.4026795776,127.35822623039999,127.35822623039999,127.35822623039999,126.36969927880526\n2011-07-07,135.7,134.88,135.46,135.13,127.94166521139199,127.94166521139199,127.76513265657599,127.76513265657599,127.76513265657599,126.91362032928889\n2011-07-08,134.44,133.39,134.4,133.84,128.7174986902528,128.7174986902528,128.32057337061568,128.32057337061568,128.32057337061568,127.61653070294578\n2011-07-11,133.18,131.66,131.96,132.73,129.4157488212275,129.4157488212275,128.8371332346726,128.8371332346726,128.8371332346726,128.26320824671012\n2011-07-12,132.78,131.36,131.43,131.69,130.04417393910475,130.04417393910475,129.3175339082455,129.3175339082455,129.3175339082455,128.85815158697332\n2011-07-13,133.22,131.52,131.85,132.11,130.60975654519427,130.60975654519427,129.76430653466832,129.76430653466832,129.76430653466832,129.40549946001545\n2011-07-14,132.78,130.68,130.94,132.17,135.7,-135.7,130.17980507724153,130.17980507724153,130.17980507724153,129.90905950321422\n2011-07-15,131.87,130.77,131.74,131.64,135.59959999999998,-135.59959999999998,130.56621872183462,130.56621872183462,130.56621872183462,130.3723347429571\n2011-07-18,131.28,129.63,130.58,131.06,135.501208,-135.501208,-135.7,-135.7,-135.7,-138.414\n2011-07-19,132.89,131.31,132.78,131.35,135.26635968,-135.26635968,-135.5179,-135.5179,-135.5179,-138.15048\n2011-07-20,133.15,132.42,132.65,133.08,135.0409052928,-135.0409052928,-135.341263,-135.341263,-135.341263,-137.89486559999997\n2011-07-21,134.82,133.14,134.52,133.39,134.824469081088,-134.824469081088,-135.16992511,-135.16992511,-135.16992511,-137.64691963199996\n2011-07-22,134.72,133.77,134.61,134.5,134.82,-134.82,-135.0037273567,-135.0037273567,-135.0037273567,-137.40641204303998\n2011-07-25,134.49,133.16,133.83,133.33,134.82,-134.82,-134.842515535999,-134.842515535999,-134.842515535999,-137.17311968174877\n2011-07-26,133.96,133.03,133.36,133.75,134.72,-134.72,-134.72,-134.72,-134.72,-136.94682609129632\n2011-07-27,132.6,130.43,130.6,132.58,134.5164,-134.5164,-134.5673,-134.5673,-134.5673,-136.72732130855744\n2011-07-28,131.76,130.01,130.16,130.62,134.320944,-134.320944,-134.41918099999998,-134.41918099999998,-134.41918099999998,-136.51440166930072\n2011-07-29,130.55,128.36,129.05,128.9,134.13330624,-134.13330624,-134.27550556999998,-134.27550556999998,-134.27550556999998,-136.3078696192217\n2011-08-01,130.96,127.53,128.71,130.95,133.7869078656,-133.7869078656,-133.97973029149998,-133.97973029149998,-133.97973029149998,-135.9104761382606\n2011-08-02,128.5,125.49,125.49,127.77,133.286355236352,-133.286355236352,-133.52824917109498,-133.52824917109498,-133.52824917109498,-135.32384280858236\n2011-08-03,126.31,123.53,126.21,125.66,132.5067197127168,-132.5067197127168,-132.80480674569642,-132.80480674569642,-132.80480674569642,-134.43879695580995\n2011-08-04,124.62,120.07,120.18,124.42,131.42951334719078,-131.42951334719078,-131.78457800366982,-131.78457800366982,-131.78457800366982,-133.23882929067085\n2011-08-05,122.07,116.87,119.98,121.9,129.83918147858407,-129.83918147858407,-130.26168286319273,-130.26168286319273,-130.26168286319273,-131.52688148288365\n2011-08-08,118.35,112.02,112.26,116.98,127.76411244201061,-127.76411244201061,-128.25293043371383,-128.25293043371383,-128.25293043371383,-129.3283492604511\n2011-08-09,117.49,110.27,117.37,114.25,124.9301722024487,-124.9301722024487,-125.49333225998248,-125.49333225998248,-125.49333225998248,-126.38592988617441\n2011-08-10,116.28,111.96,112.35,115.18,121.99813776195896,-121.99813776195896,-122.60089913058582,-122.60089913058582,-122.60089913058582,-123.32390320780127\n2011-08-11,118.92,112.85,117.28,113.45,119.65251020956717,-119.65251020956717,-120.25802829577451,-120.25802829577451,-120.25802829577451,-120.84366159831903\n2011-08-12,119.21,117.28,118.15,118.55,110.27,110.27,110.27,110.27,110.27,108.0646\n2011-08-15,120.74,119.0,120.55,119.24,110.44879999999999,110.44879999999999,110.44879999999999,110.44879999999999,110.44879999999999,108.287508\n2011-08-16,120.69,118.31,119.56,119.34,110.86044799999999,110.86044799999999,110.75753599999999,110.75753599999999,110.75753599999999,108.66108276\n2011-08-17,121.19,118.72,119.67,120.31,111.25563007999999,111.25563007999999,111.05700991999998,111.05700991999998,111.05700991999998,109.0234502772\n2011-08-18,116.64,113.39,114.61,116.5,111.8516922752,111.8516922752,111.46232952319998,111.46232952319998,111.46232952319998,109.510112266112\n2011-08-19,115.88,112.5,112.68,112.91,112.41199073868799,112.41199073868799,111.85143634227198,111.85143634227198,111.85143634227198,109.97730777546752\n2011-08-22,115.23,112.41,112.73,115.12,121.19,-121.19,112.2249788885811,112.2249788885811,112.2249788885811,110.42581546444882\n2011-08-23,116.54,112.58,116.46,113.17,121.0144,-121.0144,112.41,112.41,112.41,110.85638284587087\n2011-08-24,118.24,115.93,118.13,116.18,120.84231199999999,-120.84231199999999,112.41,112.41,112.41,111.26972753203603\n2011-08-25,119.4,115.87,116.31,118.8,120.67366575999999,-120.67366575999999,112.58,112.58,112.58,111.66653843075458\n2011-08-26,118.51,113.86,118.04,115.66,120.5083924448,-120.5083924448,112.92439999999999,112.92439999999999,112.92439999999999,112.0474768935244\n2011-08-29,121.42,119.44,121.38,119.52,112.41,112.41,113.25502399999999,113.25502399999999,113.25502399999999,112.41317781778343\n2011-08-30,122.43,119.26,121.62,120.86,112.5902,112.5902,113.66327279999999,113.66327279999999,113.66327279999999,112.86351892689426\n2011-08-31,123.51,121.3,122.06,122.48,112.983792,112.983792,114.18927643199999,114.18927643199999,114.18927643199999,113.43750779128061\n2011-09-01,123.4,120.78,120.96,122.25,113.61536448,113.61536448,114.84172708175998,114.84172708175998,114.84172708175998,114.14258224589096\n2011-09-02,119.07,117.43,117.84,118.47,114.20904261119999,114.20904261119999,115.44850618603678,115.44850618603678,115.44850618603678,114.79830148867859\n2011-09-06,117.16,114.38,116.99,114.43,123.51,-123.51,-123.51,-123.51,-123.51,-125.98020000000001\n2011-09-07,120.33,118.37,120.27,118.85,123.32740000000001,-123.32740000000001,-123.23610000000001,-123.23610000000001,-123.23610000000001,-125.63219400000001\n2011-09-08,120.93,118.78,119.02,119.59,123.148452,-123.148452,-122.97041700000001,-122.97041700000001,-122.97041700000001,-125.29462818000002\n2011-09-09,118.1,115.28,115.86,117.68,122.97308296,-122.97308296,-122.71270449000001,-122.71270449000001,-122.71270449000001,-124.96718933460002\n2011-09-12,116.76,114.05,116.66,114.49,122.8012213008,-122.8012213008,-122.46272335530001,-122.46272335530001,-122.46272335530001,-124.64957365456202\n2011-09-13,118.18,116.22,117.58,117.08,122.45117244876799,-122.45117244876799,-122.04208718753502,-122.04208718753502,-122.04208718753502,-124.11959497183392\n2011-09-14,120.78,116.72,119.36,118.32,122.11512555081727,-122.11512555081727,-121.64248282815826,-121.64248282815826,-121.64248282815826,-123.61611522324222\n2011-09-15,121.47,119.57,121.47,120.55,121.79252052878458,-121.79252052878458,114.05,114.05,114.05,-123.13780946208011\n2011-09-16,121.95,120.32,121.58,121.31,114.05,114.05,114.19839999999999,114.19839999999999,114.19839999999999,-122.68341898897611\n2011-09-19,120.93,118.72,120.31,119.56,114.208,114.208,114.43094799999999,114.43094799999999,114.43094799999999,-122.25174803952731\n2011-09-20,121.99,120.01,120.17,120.83,114.36284,114.36284,114.65651955999999,114.65651955999999,114.65651955999999,111.76899999999999\n2011-09-21,120.59,116.5,116.51,120.26,114.6679264,114.6679264,114.9498587776,114.9498587776,114.9498587776,111.97341999999999\n2011-09-22,114.21,111.3,112.8,113.28,121.99,-121.99,-121.99,-121.99,-121.99,-124.4298\n2011-09-23,114.16,112.02,113.54,112.16,121.77619999999999,-121.77619999999999,-121.66929999999999,-121.66929999999999,-121.66929999999999,-124.035906\n2011-09-26,116.4,112.98,116.25,114.64,121.56667599999999,-121.56667599999999,-121.35822099999999,-121.35822099999999,-121.35822099999999,-123.65382882\n2011-09-27,119.56,116.84,117.6,118.53,121.36134247999999,-121.36134247999999,-121.05647436999999,-121.05647436999999,-121.05647436999999,-123.2832139554\n2011-09-28,118.48,114.97,115.16,117.83,121.16011563039999,-121.16011563039999,-120.76378013889999,-120.76378013889999,-120.76378013889999,-122.923717536738\n2011-09-29,117.63,113.94,116.02,117.12,120.96291331779199,-120.96291331779199,-120.479866734733,-120.479866734733,-120.479866734733,-122.57500601063586\n2011-09-30,115.44,113.08,113.17,114.45,120.76965505143615,-120.76965505143615,-120.20447073269101,-120.20447073269101,-120.20447073269101,-122.23675583031678\n2011-10-03,113.95,109.82,109.93,112.5,120.58026195040742,-120.58026195040742,-119.93733661071028,-119.93733661071028,-119.93733661071028,-121.90865315540728\n2011-10-04,112.58,107.43,112.13,108.43,120.14985147239112,-120.14985147239112,-119.43146978017477,-119.43146978017477,-119.43146978017477,-121.30422049763692\n2011-10-05,114.72,111.58,114.5,112.59,119.38666038404766,-119.38666038404766,-118.59136689556253,-118.59136689556253,-118.59136689556253,-120.33302506280234\n2011-10-06,116.66,113.52,116.51,114.35,118.6692607610048,-118.6692607610048,-117.81007121287315,-117.81007121287315,-117.81007121287315,-119.42981330840617\n2011-10-07,117.25,115.06,115.75,117.16,117.99490511534451,-117.99490511534451,107.43,107.43,107.43,-118.58982637681774\n2011-10-10,119.59,117.67,119.59,117.72,107.43,107.43,107.6264,107.6264,107.6264,105.2814\n2011-10-11,120.04,118.75,119.68,118.85,107.67320000000001,107.67320000000001,107.985308,107.985308,107.985308,105.567572\n2011-10-12,122.13,120.33,120.67,120.6,108.167872,108.167872,108.46749568,108.46749568,108.46749568,106.00174484\n2011-10-13,120.87,119.12,120.47,120.03,109.00559968,109.00559968,109.15062089599999,109.15062089599999,109.15062089599999,106.6468750464\n2011-10-14,122.58,121.23,122.56,121.86,109.7930636992,109.7930636992,109.7995898512,109.7995898512,109.7995898512,107.266200044544\n2011-10-17,122.06,119.93,120.24,121.99,110.816018603264,110.816018603264,110.566414460128,110.566414460128,110.566414460128,108.03189004231679\n2011-10-18,123.5,119.2,122.61,120.08,111.75713711500288,111.75713711500288,111.28722959252032,111.28722959252032,111.28722959252032,108.75929554020095\n2011-10-19,123.08,120.72,121.14,122.33,112.93142340350259,112.93142340350259,112.1421235210439,112.1421235210439,112.1421235210439,109.6437378077889\n2011-10-20,122.09,119.82,121.69,121.36,113.98828106315233,113.98828106315233,112.93717487457083,112.93717487457083,112.93717487457083,110.47511353932155\n2011-10-21,124.12,122.72,123.91,123.07,114.9394529568371,114.9394529568371,113.67657263335087,113.67657263335087,113.67657263335087,111.25660672696226\n2011-10-24,125.8,124.06,125.49,124.14,116.04111860201665,116.04111860201665,114.5120468226828,114.5120468226828,114.5120468226828,112.1570442560749\n2011-10-25,124.94,122.78,123.08,124.93,117.40736199773433,117.40736199773433,115.52796260864135,115.52796260864135,115.52796260864135,113.24848071558891\n2011-10-26,124.77,122.21,124.33,124.35,118.58233131805152,118.58233131805152,116.45244597386362,116.45244597386362,116.45244597386362,114.2526022583418\n2011-10-27,129.42,126.61,128.53,127.7,119.5928049335243,119.5928049335243,117.2937258362159,117.2937258362159,117.2937258362159,115.17639407767444\n2011-10-28,128.85,127.8,128.68,127.98,121.16515614416042,121.16515614416042,118.50635325259431,118.50635325259431,118.50635325259431,116.45831861068375\n2011-10-31,127.26,125.36,125.45,127.23,122.48593116109475,122.48593116109475,119.59771792733488,119.59771792733488,119.59771792733488,117.6248699357222\n2011-11-01,123.51,121.52,122.08,122.0,129.42,-129.42,120.5799461346014,120.5799461346014,120.5799461346014,118.6864316415072\n2011-11-02,124.4,122.8,123.99,123.88,129.262,-129.262,121.46395152114125,121.46395152114125,121.46395152114125,119.65245279377154\n2011-11-03,126.5,123.6,126.24,125.31,129.10716,-129.10716,121.52,121.52,121.52,120.5315320423321\n2011-11-04,125.7,124.01,125.45,125.23,128.9554168,-128.9554168,122.30999999999999,122.30999999999999,122.30999999999999,121.33149415852222\n2011-11-07,126.39,124.2,126.28,125.43,128.806708464,-128.806708464,123.02099999999999,123.02099999999999,123.02099999999999,122.05945968425522\n2011-11-08,128.02,125.71,127.86,126.93,128.66097429472,-128.66097429472,123.66089999999998,123.66089999999998,123.66089999999998,122.72190831267224\n2011-11-09,125.46,122.87,123.19,124.91,128.5181548088256,-128.5181548088256,-129.42,-129.42,-129.42,-132.0084\n2011-11-10,124.94,123.02,124.32,124.8,128.3781917126491,-128.3781917126491,-129.2235,-129.2235,-129.2235,-131.734248\n2011-11-11,126.99,125.8,126.62,125.86,128.24102787839612,-128.24102787839612,-129.032895,-129.032895,-129.032895,-131.46832056\n2011-11-14,126.35,124.92,125.46,126.21,128.1066073208282,-128.1066073208282,-128.84800815,-128.84800815,-128.84800815,-131.2103709432\n2011-11-15,126.75,124.72,126.12,125.12,127.97487517441164,-127.97487517441164,-128.6686679055,-128.6686679055,-128.6686679055,-130.960159814904\n2011-11-16,126.34,123.9,124.05,124.81,127.8457776709234,-127.8457776709234,-128.494707868335,-128.494707868335,-128.494707868335,-130.71745502045687\n2011-11-17,124.16,121.23,122.18,123.84,127.71926211750493,-127.71926211750493,-128.32596663228497,-128.32596663228497,-128.32596663228497,-130.48203136984316\n2011-11-18,122.75,121.47,121.99,122.46,127.45969163280473,-127.45969163280473,-127.97116830067073,-127.97116830067073,-127.97116830067073,-130.019429801351\n2011-11-21,120.34,118.66,119.62,120.21,127.21050396749254,-127.21050396749254,-127.63410988563719,-127.63410988563719,-127.63410988563719,-129.57995831128346\n2011-11-22,120.1,118.53,119.19,119.39,126.69747372944299,-126.69747372944299,-127.00592219364259,-127.00592219364259,-127.00592219364259,-128.81556122949362\n2011-11-23,118.2,116.56,116.56,118.07,126.04407583108755,-126.04407583108755,-126.24308919621475,-126.24308919621475,-126.24308919621475,-127.8898607188392\n2011-11-25,117.7,116.2,116.2,116.38,125.0956682479788,-125.0956682479788,-125.17794938463113,-125.17794938463113,-125.17794938463113,-126.64357603976688\n2011-11-28,120.18,118.82,119.7,119.53,124.02818805822133,-124.02818805822133,-124.01081596462909,-124.01081596462909,-124.01081596462909,-125.28591115459719\n2011-11-29,120.86,119.61,120.08,120.09,123.08880549123477,-123.08880549123477,-122.9954098892273,-122.9954098892273,-122.9954098892273,-124.10474270449956\n2011-11-30,125.22,123.22,125.11,123.5,116.2,116.2,116.2,116.2,116.2,113.876\n2011-12-01,125.64,124.43,124.98,124.85,116.38040000000001,116.38040000000001,116.38040000000001,116.38040000000001,116.38040000000001,114.10288\n2011-12-02,126.5,124.78,124.86,126.14,116.75078400000001,116.75078400000001,116.65818800000001,116.65818800000001,116.65818800000001,114.4489936\n2011-12-05,127.18,125.45,126.21,126.8,117.33573696,117.33573696,117.05186048000002,117.05186048000002,117.05186048000002,114.931033856\n2011-12-06,127.11,125.76,126.26,126.17,118.1232780032,118.1232780032,117.55826745600001,117.55826745600001,117.55826745600001,115.5434821632\n2011-12-07,127.26,124.97,126.75,125.84,118.847815762944,118.847815762944,118.03935408320001,118.03935408320001,118.03935408320001,116.12530805504\n2011-12-08,126.18,123.65,123.98,125.88,119.6890341866496,119.6890341866496,118.592592838208,118.592592838208,118.592592838208,116.79338957173759\n2011-12-09,126.37,124.41,126.03,124.52,120.44613076798464,120.44613076798464,119.11263726791553,119.11263726791553,119.11263726791553,117.42138619743334\n2011-12-12,124.97,123.16,124.24,124.91,121.12751769118617,121.12751769118617,119.6014790318406,119.6014790318406,119.6014790318406,118.01170302558734\n2011-12-13,125.57,122.45,123.11,124.9,121.74076592206755,121.74076592206755,120.06099028993016,120.06099028993016,120.06099028993016,118.5666008440521\n2011-12-14,123.02,121.47,121.71,122.59,127.26,-127.26,120.49293087253434,120.49293087253434,120.49293087253434,119.08820479340898\n2011-12-15,123.2,121.99,122.15,123.12,127.14420000000001,-127.14420000000001,120.89895502018229,120.89895502018229,120.89895502018229,119.57851250580444\n2011-12-16,122.95,121.3,121.57,122.21,127.03071600000001,-127.03071600000001,121.28061771897134,121.28061771897134,121.28061771897134,120.03940175545617\n2011-12-19,122.32,120.03,120.32,122.06,126.80148736000001,-126.80148736000001,-127.26,-127.26,-127.26,-129.8052\n2011-12-20,124.14,122.17,123.88,122.23,126.3951981184,-126.3951981184,-127.04310000000001,-127.04310000000001,-127.04310000000001,-129.511944\n2011-12-21,124.36,122.75,124.17,123.94,126.01328623129601,-126.01328623129601,-126.83270700000001,-126.83270700000001,-126.83270700000001,-129.22748568\n2011-12-22,125.39,124.36,125.33,124.64,125.65428905741825,-125.65428905741825,-126.62862579000002,-126.62862579000002,-126.62862579000002,-128.9515611096\n2011-12-23,126.43,125.41,126.39,125.64,120.03,120.03,-126.43066701630002,-126.43066701630002,-126.43066701630002,-128.68391427631198\n2011-12-27,126.82,126.06,126.49,126.15,120.158,120.158,120.03,120.03,120.03,-128.42429684802264\n2011-12-28,126.53,124.73,124.92,126.53,120.42448,120.42448,120.1658,120.1658,120.1658,-128.17246794258196\n2011-12-29,126.25,125.18,126.1,125.21,120.6803008,120.6803008,120.298884,120.298884,120.298884,-127.9281939043045\n2011-12-30,126.33,125.5,125.5,125.99,120.925888768,120.925888768,120.42930632,120.42930632,120.42930632,-127.69124808717537\n2012-01-03,128.38,127.44,127.49,127.75,121.16165321727999,121.16165321727999,120.5571201936,120.5571201936,120.5571201936,117.6294\n2012-01-04,127.81,126.72,127.63,127.18,121.59475402424319,121.59475402424319,120.791806587792,120.791806587792,120.791806587792,117.844412\n2012-01-05,128.23,126.43,128.1,127.01,122.00186878278859,122.00186878278859,121.01945239015824,121.01945239015824,121.01945239015824,118.05512376\n2012-01-06,128.22,127.29,127.82,128.22,122.38455665582127,122.38455665582127,121.24026881845349,121.24026881845349,121.24026881845349,118.2616212848\n2012-01-09,128.18,127.41,127.99,128.04,122.74428325647199,122.74428325647199,121.45446075389988,121.45446075389988,121.45446075389988,118.463988859104\n2012-01-10,129.65,128.95,129.13,129.37,123.08242626108367,123.08242626108367,121.66222693128289,121.66222693128289,121.66222693128289,118.66230908192193\n2012-01-11,129.37,128.52,129.25,128.75,123.60783216019698,123.60783216019698,121.98173785403158,121.98173785403158,121.98173785403158,118.99193980946427\n2012-01-12,129.7,128.54,129.51,129.54,124.09120558738122,124.09120558738122,122.28846833987032,122.28846833987032,122.28846833987032,119.31168161518035\n2012-01-13,129.01,127.72,129.01,128.66,124.6520850286431,124.6520850286431,122.6590449228768,122.6590449228768,122.6590449228768,119.72721435057313\n2012-01-17,130.32,129.06,129.31,130.1,125.15687652577878,125.15687652577878,123.01109267673296,123.01109267673296,123.01109267673296,120.12612577655021\n2012-01-18,130.84,129.08,130.8,129.35,125.77645134268533,125.77645134268533,123.44962711612898,123.44962711612898,123.44962711612898,120.6358194877227\n2012-01-19,131.57,130.81,131.48,131.24,126.48534815470938,126.48534815470938,123.96695321799996,123.96695321799996,123.96695321799996,121.24807031845934\n2012-01-20,131.95,130.92,131.95,131.23,127.29889244995589,127.29889244995589,124.57519696055996,124.57519696055996,124.57519696055996,121.97060539616719\n2012-01-23,132.25,130.98,131.58,131.5,128.1360918089638,128.1360918089638,125.23892923410956,125.23892923410956,125.23892923410956,122.76895696447382\n2012-01-24,131.5,130.6,131.46,130.77,128.95887344717104,128.95887344717104,125.9400363106986,125.9400363106986,125.9400363106986,123.62225083767117\n2012-01-25,132.87,130.75,132.57,131.24,129.61709875773684,129.61709875773684,126.57103267962874,126.57103267962874,126.57103267962874,124.39874826228076\n2012-01-26,133.4,131.37,131.9,133.15,130.26767900618947,130.26767900618947,127.26391908486958,127.26391908486958,127.26391908486958,125.24587343605269\n2012-01-27,132.05,131.15,131.73,131.15,130.75,130.75,128.00024879468523,128.00024879468523,128.00024879468523,126.14282735808689\n2012-01-30,131.44,130.06,131.38,130.5,133.4,-133.4,128.64821893932302,128.64821893932302,128.64821893932302,126.94111634869734\n2012-01-31,132.18,130.68,131.21,132.02,133.3332,-133.3332,129.21843266660426,129.21843266660426,129.21843266660426,127.65159355034064\n2012-02-01,133.14,132.13,132.47,132.31,133.267736,-133.267736,129.72022074661174,129.72022074661174,129.72022074661174,128.28391825980316\n2012-02-02,133.02,132.21,132.68,132.75,133.20358128,-133.20358128,130.16179425701833,130.16179425701833,130.16179425701833,128.8466872512248\n2012-02-03,134.62,133.77,134.57,134.03,130.06,130.06,130.55037894617612,130.55037894617612,130.55037894617612,129.34755165359007\n2012-02-06,134.5,133.83,134.46,133.99,130.1512,130.1512,131.07942968317323,131.07942968317323,131.07942968317323,129.98024545515926\n2012-02-07,135.02,133.64,134.79,134.2,130.24057599999998,130.24057599999998,131.5397038243607,131.5397038243607,131.5397038243607,130.53701600054015\n2012-02-08,135.22,134.31,135.19,134.88,130.43175295999998,130.43175295999998,132.0269452889502,132.0269452889502,132.0269452889502,131.11980392046993\n2012-02-09,135.58,134.57,135.34,135.39,130.7190477824,130.7190477824,132.50590349560767,132.50590349560767,132.50590349560767,131.69383137160415\n2012-02-10,134.47,133.84,134.43,134.14,131.107923959808,131.107923959808,132.99775893631045,132.99775893631045,132.99775893631045,132.27675666586353\n2012-02-13,135.52,134.74,135.36,135.29,131.46569004302336,131.46569004302336,133.41091750650077,133.41091750650077,133.41091750650077,132.772243165984\n2012-02-14,135.27,134.25,135.19,134.99,131.79483483958148,131.79483483958148,133.75797070546065,133.75797070546065,133.75797070546065,133.1934066910864\n2012-02-15,135.83,134.29,134.54,135.64,132.09764805241497,132.09764805241497,134.04949539258695,134.04949539258695,134.04949539258695,133.55139568742345\n2012-02-16,136.17,134.34,136.04,134.56,132.47088324717348,132.47088324717348,134.25,134.25,134.25,133.9159723774357\n2012-02-17,136.57,135.96,136.41,136.52,132.91477725751267,132.91477725751267,134.29,134.29,134.29,134.29\n2012-02-21,137.05,136.05,136.46,136.75,133.4265084414609,133.4265084414609,134.34,134.34,134.34,134.34\n2012-02-22,136.55,135.79,136.02,136.2,134.00626709082715,134.00626709082715,134.882,134.882,134.882,134.85490000000001\n2012-02-23,136.73,135.5,136.61,135.95,134.49326435629482,134.49326435629482,135.31560000000002,135.31560000000002,135.31560000000002,135.271969\n2012-02-24,137.2,136.63,136.93,136.95,134.90234205928763,134.90234205928763,135.5,135.5,135.5,135.5\n2012-02-27,137.53,135.8,137.16,136.04,135.31592048861586,135.31592048861586,135.5,135.5,135.5,135.5\n2012-02-28,137.72,136.93,137.56,137.19,135.7587363908927,135.7587363908927,135.8,135.8,135.8,135.8\n2012-02-29,138.19,136.72,136.87,137.73,135.8,135.8,135.8,135.8,135.8,135.8\n2012-03-01,137.99,137.12,137.77,137.32,136.27800000000002,136.27800000000002,136.3736,136.3736,136.3736,136.3497\n2012-03-02,137.82,137.0,137.32,137.63,136.6604,136.6604,136.72,136.72,136.72,136.72\n2012-03-05,137.19,136.28,136.75,137.05,138.19,-138.19,-138.19,-138.19,-138.19,-140.9538\n2012-03-06,135.43,134.36,134.67,135.29,138.1518,-138.1518,-138.1327,-138.1327,-138.1327,-140.81358600000002\n2012-03-07,135.91,134.93,135.69,135.06,138.00012800000002,-138.00012800000002,-137.944065,-137.944065,-137.944065,-140.4909067\n2012-03-08,137.32,136.24,137.02,136.5,137.85452288000002,-137.85452288000002,-137.76486175,-137.76486175,-137.76486175,-140.184361365\n2012-03-09,137.93,137.13,137.57,137.36,134.36,134.36,134.36,134.36,134.36,-139.89314329675\n2012-03-12,137.76,137.09,137.58,137.56,134.43140000000002,134.43140000000002,134.43140000000002,134.43140000000002,134.43140000000002,-139.6164861319125\n2012-03-13,140.12,138.09,140.06,138.38,134.50137200000003,134.50137200000003,134.50137200000003,134.50137200000003,134.50137200000003,131.67280000000002\n2012-03-14,140.45,139.48,139.91,140.07,134.72611712000003,134.72611712000003,134.66993084000003,134.66993084000003,134.66993084000003,131.84174400000003\n2012-03-15,140.78,139.76,140.72,140.12,135.06955009280003,135.06955009280003,134.90113360640004,134.90113360640004,134.90113360640004,132.09999168000004\n2012-03-16,140.48,140.0,140.27,140.32,135.52638608537603,135.52638608537603,135.19507692608005,135.19507692608005,135.19507692608005,132.44719201280003\n2012-03-19,141.28,140.11,140.88,140.2,135.94667519854596,135.94667519854596,135.47432307977604,135.47432307977604,135.47432307977604,132.78050433228802\n2012-03-20,140.61,139.64,140.41,140.05,136.48000767869138,136.48000767869138,135.82266369498947,135.82266369498947,135.82266369498947,133.20547911567363\n2012-03-21,140.65,139.92,140.16,140.46,136.96000691082224,136.96000691082224,136.1501038732901,136.1501038732901,136.1501038732901,133.60920515988994\n2012-03-22,139.55,138.74,139.16,139.17,137.39200621974,137.39200621974,136.4578976408927,136.4578976408927,136.4578976408927,133.99274490189543\n2012-03-23,139.81,138.55,139.69,139.37,137.780805597766,137.780805597766,136.74722378243914,136.74722378243914,136.74722378243914,134.35710765680065\n2012-03-26,141.61,140.6,141.61,140.62,138.1307250379894,138.1307250379894,137.01919035549278,137.01919035549278,137.01919035549278,134.70325227396063\n2012-03-27,141.83,141.08,141.13,141.74,138.5482380334307,138.5482380334307,137.3405470306083,137.3405470306083,137.3405470306083,135.117657137523\n2012-03-28,141.32,139.64,140.43,141.09,139.0076847087504,139.0076847087504,137.69970326815962,137.69970326815962,137.69970326815962,135.58752113789637\n2012-03-29,140.42,139.09,140.22,139.62,141.83,-141.83,138.03012700670686,138.03012700670686,138.03012700670686,136.02449465824364\n2012-03-30,141.05,140.06,140.72,140.91,141.7752,-141.7752,138.3341168461703,138.3341168461703,138.3341168461703,136.43088003216658\n2012-04-02,142.21,140.37,141.79,140.64,139.09,139.09,138.61378749847668,138.61378749847668,138.61378749847668,136.80881842991494\n2012-04-03,141.88,140.43,141.26,141.6,139.1524,139.1524,138.9374466236138,138.9374466236138,138.9374466236138,137.24091295552174\n2012-04-04,140.33,139.34,139.84,140.17,139.213552,139.213552,139.23197642748855,139.23197642748855,139.23197642748855,137.63843991907999\n2012-04-05,140.2,139.26,139.78,139.4,142.21,-142.21,-142.21,-142.21,-142.21,138.00416472555358\n2012-04-09,138.78,137.84,138.23,137.94,142.151,-142.151,-142.1215,-142.1215,-142.1215,-145.0542\n2012-04-10,138.34,135.76,135.84,137.94,141.97856000000002,-141.97856000000002,-141.907425,-141.907425,-141.907425,-144.837774\n2012-04-11,137.54,136.75,136.9,137.33,141.6054464,-141.6054464,-141.47710525,-141.47710525,-141.47710525,-144.3838853\n2012-04-12,138.9,137.03,138.85,137.13,141.25471961600002,-141.25471961600002,-141.0769078825,-141.0769078825,-141.0769078825,-143.95269103500002\n2012-04-13,138.48,137.01,137.13,138.46,140.92503643904,-140.92503643904,-140.70472433072499,-140.70472433072499,-140.70472433072499,-143.54305648325\n2012-04-16,138.04,136.58,136.93,137.83,140.6151342526976,-140.6151342526976,-140.35859362757424,-140.35859362757424,-140.35859362757424,-143.15390365908752\n2012-04-17,139.36,137.7,139.09,137.86,140.32382619753574,-140.32382619753574,-140.03669207364405,-140.03669207364405,-140.03669207364405,-142.78420847613313\n2012-04-18,139.08,138.38,138.59,138.49,140.0499966256836,-140.0499966256836,-139.73732362848895,-139.73732362848895,-139.73732362848895,-142.43299805232647\n2012-04-19,139.14,137.07,137.75,138.6,139.7925968281426,-139.7925968281426,-139.45891097449473,-139.45891097449473,-139.45891097449473,-142.09934814971015\n2012-04-20,138.83,137.87,137.95,138.24,139.55064101845403,-139.55064101845403,-139.1999872062801,-139.1999872062801,-139.1999872062801,-141.78238074222463\n2012-04-23,136.91,135.94,136.79,136.55,139.32320255734678,-139.32320255734678,-139.14,-139.14,-139.14,-141.4812617051134\n2012-04-24,137.65,136.8,137.31,136.87,139.10941040390597,-139.10941040390597,-138.90339999999998,-138.90339999999998,-138.90339999999998,-141.19519861985773\n2012-04-25,139.25,138.53,139.24,138.56,135.76,135.76,135.76,135.76,135.76,-140.92343868886485\n2012-04-26,140.32,138.82,140.17,138.91,135.82979999999998,135.82979999999998,135.82979999999998,135.82979999999998,135.82979999999998,-140.6652667544216\n2012-04-27,140.78,139.8,140.42,140.56,136.00940799999998,136.00940799999998,135.96450599999997,135.96450599999997,135.96450599999997,133.04479999999998\n2012-04-30,140.21,139.49,139.77,140.13,136.29564351999997,136.29564351999997,136.15712575999999,136.15712575999999,136.15712575999999,133.199504\n2012-05-01,141.66,139.63,140.74,139.81,136.56470490879997,136.56470490879997,136.34204072959997,136.34204072959997,136.34204072959997,133.35111392\n2012-05-02,140.46,139.46,140.28,139.93,136.97232851609596,136.97232851609596,136.60793869311996,136.60793869311996,136.60793869311996,133.6003805024\n2012-05-03,140.45,138.99,139.25,140.4,137.34734223480828,137.34734223480828,136.86054175846397,136.86054175846397,136.86054175846397,133.842169087328\n2012-05-04,138.66,136.92,136.96,138.52,141.66,-141.66,-141.66,-141.66,-141.66,134.07670401470816\n2012-05-07,137.56,136.47,137.1,136.48,141.5652,-141.5652,-141.5178,-141.5178,-141.5178,134.30420289426692\n2012-05-08,136.77,134.92,136.5,136.31,141.361392,-141.361392,-141.26541,-141.26541,-141.26541,134.52487680743891\n2012-05-09,136.6,134.49,135.74,135.1,140.97490847999998,-140.97490847999998,-140.8212313,-140.8212313,-140.8212313,-144.4932\n2012-05-10,136.85,135.71,135.95,136.75,140.4561158016,-140.4561158016,-140.251420483,-140.251420483,-140.251420483,-144.193104\n2012-05-11,136.87,135.11,135.56,135.16,139.978826537472,-139.978826537472,-139.73289263953,-139.73289263953,-139.73289263953,-143.90201088\n2012-05-14,135.03,133.91,134.13,134.32,139.53972041447423,-139.53972041447423,-139.2610323019723,-139.2610323019723,-139.2610323019723,-143.6196505536\n2012-05-15,134.81,133.13,133.35,134.05,138.9767483730268,-138.9767483730268,-138.67241874875535,-138.67241874875535,-138.67241874875535,-143.13416802592\n2012-05-16,134.54,132.8,132.88,133.92,138.27513856826357,-138.27513856826357,-137.95190431141714,-137.95190431141714,-137.95190431141714,-142.43387626410558\n2012-05-17,133.02,130.81,130.87,132.88,137.50861916870667,-137.50861916870667,-137.17911866470456,-137.17911866470456,-137.17911866470456,-141.56682740033608\n2012-05-18,131.6,129.55,129.74,131.4,136.4368401017136,-136.4368401017136,-136.0963684917048,-136.0963684917048,-136.0963684917048,-140.38357638629913\n2012-05-21,132.02,129.95,132.02,130.14,135.19720888340515,-135.19720888340515,-134.85255847828088,-134.85255847828088,-134.85255847828088,-138.97521145608025\n2012-05-22,133.23,131.34,132.2,132.34,134.18071128439223,-134.18071128439223,-133.8450723674075,-133.8450723674075,-133.8450723674075,-137.74993396678983\n2012-05-23,132.46,129.99,132.27,131.26,133.34718325320162,-133.34718325320162,-133.23,-133.23,-133.23,-136.68394255110715\n2012-05-24,132.84,131.42,132.53,132.67,133.23,-133.23,-133.23,-133.23,-133.23,-135.7565300194632\n2012-05-25,132.85,131.78,132.1,132.48,129.55,129.55,129.55,129.55,129.55,-134.949681116933\n2012-05-29,133.93,132.75,133.7,133.16,129.616,129.616,129.616,129.616,129.616,-134.2477225717317\n2012-05-30,132.62,131.49,131.73,132.59,129.78856000000002,129.78856000000002,129.74542000000002,129.74542000000002,129.74542000000002,-133.93\n2012-05-31,132.45,130.34,131.49,131.71,129.95421760000002,129.95421760000002,129.87095740000004,129.87095740000004,129.87095740000004,-133.93\n2012-06-01,129.85,128.16,128.16,129.41,133.93,-133.93,-133.93,-133.93,-133.93,-133.3606\n2012-06-04,128.74,127.14,128.1,128.44,133.8146,-133.8146,-133.7569,-133.7569,-133.7569,-132.58051\n2012-06-05,129.26,127.79,129.03,127.88,133.547616,-133.547616,-133.426055,-133.426055,-133.426055,-131.6556233\n2012-06-06,132.03,129.93,132.02,129.98,133.29131136,-133.29131136,-133.11175225,-133.11175225,-133.11175225,124.5972\n2012-06-07,133.53,131.78,132.05,133.49,127.14,127.14,127.14,127.14,127.14,124.745856\n2012-06-08,133.12,131.29,133.12,131.72,127.2678,127.2678,127.2678,127.2678,127.2678,125.00938032\n2012-06-11,134.25,131.28,131.45,134.19,127.39304399999999,127.39304399999999,127.39304399999999,127.39304399999999,127.39304399999999,125.26499891040001\n2012-06-12,133.01,131.16,133.01,131.8,127.66732223999999,127.66732223999999,127.59875267999999,127.59875267999999,127.59875267999999,125.62439895398401\n2012-06-13,133.36,131.62,132.1,132.5,127.9306293504,127.9306293504,127.7982900996,127.7982900996,127.7982900996,125.96942299582466\n2012-06-14,134.0,131.98,133.57,132.38,128.183404176384,128.183404176384,127.99184139661199,127.99184139661199,127.99184139661199,126.30064607599166\n2012-06-15,134.26,133.11,134.1,133.35,128.42606800932862,128.42606800932862,128.17958615471363,128.17958615471363,128.17958615471363,126.618620232952\n2012-06-18,134.73,133.29,134.43,133.59,128.7761039287689,128.7761039287689,128.4228027085251,128.4228027085251,128.4228027085251,127.0006892213044\n2012-06-19,136.25,134.93,135.69,135.13,129.25241561446737,129.25241561446737,128.73816257309883,128.73816257309883,128.73816257309883,127.46444786802613\n2012-06-20,136.1,134.46,135.44,135.76,129.95217405302063,129.95217405302063,129.1888728187129,129.1888728187129,129.1888728187129,128.0794365172643\n2012-06-21,135.78,132.33,132.44,135.67,130.58195664771856,130.58195664771856,129.6125404495901,129.6125404495901,129.6125404495901,128.6513759610558\n2012-06-22,133.71,132.62,133.42,133.11,131.1487609829467,131.1487609829467,130.01078802261472,130.01078802261472,130.01078802261472,129.1832796437819\n2012-06-25,132.1,130.85,131.26,132.1,136.25,-136.25,130.38514074125783,130.38514074125783,130.38514074125783,129.67795006871717\n2012-06-26,132.38,130.93,132.0,131.69,136.142,-136.142,130.73703229678236,130.73703229678236,130.73703229678236,130.13799356390697\n2012-06-27,133.43,132.31,133.17,132.4,136.03616,-136.03616,130.85,130.85,130.85,130.56583401443348\n2012-06-28,132.99,131.28,132.79,132.32,135.9324368,-135.9324368,130.93,130.93,130.93,130.93\n2012-06-29,136.27,134.85,136.27,135.24,130.85,130.85,131.2492,131.2492,131.2492,131.28\n2012-07-02,136.65,135.52,136.46,136.53,130.95839999999998,130.95839999999998,131.28,131.28,131.28,131.28\n2012-07-03,137.51,136.34,137.47,136.51,131.186064,131.186064,131.7096,131.7096,131.7096,131.76330000000002\n2012-07-05,137.4,136.29,136.84,136.93,131.56550016,131.56550016,132.23163599999998,132.23163599999998,132.23163599999998,132.33797\n2012-07-06,135.76,134.85,135.59,135.56,131.9221701504,131.9221701504,132.70668876,132.70668876,132.70668876,132.855173\n2012-07-09,135.57,134.7,135.32,135.41,132.257439941376,132.257439941376,133.1389867716,133.1389867716,133.1389867716,133.3206557\n2012-07-10,136.23,133.68,134.14,136.08,132.57259354489344,132.57259354489344,133.532377962156,133.532377962156,133.532377962156,-140.2602\n2012-07-11,134.6,133.38,134.16,134.23,132.86883793219982,132.86883793219982,-137.51,-137.51,-137.51,-140.062794\n2012-07-12,134.09,132.6,133.51,133.39,137.51,-137.51,-137.3861,-137.3861,-137.3861,-139.7286543\n2012-07-13,135.88,133.84,135.75,133.88,137.4118,-137.4118,-137.146795,-137.146795,-137.146795,-139.22964849899998\n2012-07-16,135.83,134.9,135.39,135.42,137.315564,-137.315564,-136.91945525,-136.91945525,-136.91945525,-138.76557310406997\n2012-07-17,136.64,134.55,136.36,136.01,137.22125272,-137.22125272,-136.7034824875,-136.7034824875,-136.7034824875,-138.33398298678506\n2012-07-18,137.64,135.96,137.41,136.02,132.6,132.6,132.6,132.6,132.6,-137.93260417771012\n2012-07-19,138.18,137.21,137.74,137.63,132.7008,132.7008,132.7008,132.7008,132.7008,129.948\n2012-07-20,137.16,136.32,136.47,136.98,132.91996799999998,132.91996799999998,132.865176,132.865176,132.865176,130.11264\n2012-07-23,135.46,133.85,135.09,134.45,133.13036928,133.13036928,133.02462072,133.02462072,133.02462072,130.2739872\n2012-07-24,135.25,133.03,134.03,135.2,138.18,-138.18,-138.18,-138.18,-138.18,130.43210745599998\n2012-07-25,134.56,133.25,133.95,134.26,138.077,-138.077,-138.0255,-138.0255,-138.0255,130.58706530688\n2012-07-26,136.46,135.26,136.17,135.91,137.97606,-137.97606,-137.875635,-137.875635,-137.875635,130.7389240007424\n2012-07-27,139.07,136.65,138.8,136.91,133.03,133.03,133.03,133.03,133.03,130.88774552072755\n2012-07-30,139.33,138.27,138.68,138.57,133.1508,133.1508,133.1508,133.1508,133.1508,131.13321315510572\n2012-07-31,138.87,137.71,137.71,138.51,133.397968,133.397968,133.336176,133.336176,133.336176,131.4610846289015\n2012-08-01,138.73,137.4,137.59,138.72,133.63524927999998,133.63524927999998,133.51599072,133.51599072,133.51599072,131.77584124374542\n2012-08-02,137.56,135.59,136.64,136.54,133.86303930879998,133.86303930879998,133.69041099839998,133.69041099839998,133.69041099839998,132.0780075939956\n2012-08-03,139.64,138.5,139.39,138.6,134.08171773644798,134.08171773644798,133.85959866844797,133.85959866844797,133.85959866844797,132.3680872902358\n2012-08-06,140.17,139.56,139.62,139.7,134.4152146722611,134.4152146722611,134.09081472171005,134.09081472171005,134.09081472171005,132.731682925724\n2012-08-07,140.92,140.15,140.32,140.2,134.8755974984802,134.8755974984802,134.39477398562454,134.39477398562454,134.39477398562454,133.17798195018054\n2012-08-08,140.64,139.81,140.49,139.82,135.48003774863218,135.48003774863218,134.78628754648707,134.78628754648707,134.78628754648707,133.7199232136679\n2012-08-09,140.89,140.15,140.63,140.3,136.02403397376895,136.02403397376895,135.15431029369785,135.15431029369785,135.15431029369785,134.22392858871115\n2012-08-10,140.89,139.81,140.84,140.07,136.51363057639205,136.51363057639205,135.50025167607598,135.50025167607598,135.50025167607598,134.69265358750135\n2012-08-13,140.84,140.04,140.77,140.6,136.95426751875283,136.95426751875283,135.82543657551142,135.82543657551142,135.82543657551142,135.12856783637625\n2012-08-14,141.38,140.37,140.79,141.28,137.35084076687755,137.35084076687755,136.13111038098074,136.13111038098074,136.13111038098074,135.53396808782992\n2012-08-15,141.19,140.55,140.95,140.64,137.83433987485225,137.83433987485225,136.4985326543121,136.4985326543121,136.4985326543121,136.00165064080352\n2012-08-16,142.16,140.8,142.01,141.09,138.25981908986998,138.25981908986998,136.84023536851026,136.84023536851026,136.84023536851026,136.43191858953924\n2012-08-17,142.3,141.86,142.22,142.25,138.80584441728817,138.80584441728817,137.26581653902943,137.26581653902943,137.26581653902943,136.94744591648072\n2012-08-20,142.22,141.6,142.22,142.01,139.36490931052205,139.36490931052205,137.71889305051678,137.71889305051678,137.71889305051678,137.48270132483265\n2012-08-21,143.09,141.45,141.76,142.52,139.8345238208385,139.8345238208385,138.13119267597028,138.13119267597028,138.13119267597028,137.9644311923494\n2012-08-22,142.05,141.07,141.82,141.38,140.42050953308757,140.42050953308757,138.62707340837326,138.62707340837326,138.62707340837326,138.52824376119096\n2012-08-23,141.48,140.44,140.68,141.45,143.09,-143.09,139.07336606753594,139.07336606753594,139.07336606753594,139.03003694745996\n2012-08-24,141.81,140.22,141.52,140.3,143.037,-143.037,139.47502946078234,139.47502946078234,139.47502946078234,139.47663288323938\n2012-08-27,142.08,141.34,141.54,141.9,142.92432,-142.92432,139.8365265147041,139.8365265147041,139.8365265147041,139.87410326608304\n2012-08-28,141.84,140.97,141.4,141.17,142.8161472,-142.8161472,140.1618738632337,140.1618738632337,140.1618738632337,140.22\n2012-08-29,141.89,141.12,141.51,141.48,142.712301312,-142.712301312,140.45468647691033,140.45468647691033,140.45468647691033,140.5357\n2012-08-30,140.94,140.19,140.49,140.9,142.61260925951999,-142.61260925951999,-143.09,-143.09,-143.09,-145.9518\n2012-08-31,141.82,140.36,141.24,141.32,142.4672527039488,-142.4672527039488,-143.00300000000001,-143.00300000000001,-143.00300000000001,-145.778946\n2012-09-04,141.46,140.13,140.87,141.09,142.33061754171186,-142.33061754171186,-142.91861,-142.91861,-142.91861,-145.61127761999998\n2012-09-05,141.47,140.63,140.94,141.1,142.1545681383749,-142.1545681383749,-142.7791795,-142.7791795,-142.7791795,-145.337213739\n2012-09-06,143.78,141.76,143.78,141.79,140.13,140.13,140.13,140.13,140.13,-145.07685305204998\n2012-09-07,144.39,143.88,144.39,144.02,140.203,140.203,140.203,140.203,140.203,-144.82951039944749\n2012-09-10,144.44,143.46,143.51,144.21,140.37048000000001,140.37048000000001,140.32861,140.32861,140.32861,-144.5945348794751\n2012-09-11,144.37,143.56,143.89,143.63,140.61465120000003,140.61465120000003,140.4930656,140.4930656,140.4930656,-144.44\n2012-09-12,144.55,143.9,144.39,144.38,140.84417212800003,140.84417212800003,140.65094297599998,140.65094297599998,140.65094297599998,137.32739999999998\n2012-09-13,147.04,144.15,146.7,144.33,141.14063835776003,141.14063835776003,140.8458958272,140.8458958272,140.8458958272,137.47185199999998\n2012-09-14,148.11,146.76,147.24,146.89,141.730574521984,141.730574521984,141.217542077568,141.217542077568,141.217542077568,137.75889643999997\n2012-09-17,147.19,146.37,146.74,146.95,142.49610557934594,142.49610557934594,141.70001413213825,141.70001413213825,141.70001413213825,138.17294058239997\n2012-09-18,146.81,146.25,146.62,146.53,143.16977290982442,143.16977290982442,142.14871314288857,142.14871314288857,142.14871314288857,138.57042295910398\n2012-09-19,147.17,146.41,146.74,146.76,143.7626001606455,143.7626001606455,142.56600322288637,142.56600322288637,142.56600322288637,138.95200604073983\n2012-09-20,146.79,145.63,146.75,146.0,144.28428814136802,144.28428814136802,142.95408299728433,142.95408299728433,142.95408299728433,139.31832579911023\n2012-09-21,147.0,145.81,145.89,146.64,144.74337356440387,144.74337356440387,143.31499718747443,143.31499718747443,143.31499718747443,139.66999276714583\n2012-09-24,145.98,145.05,145.59,145.16,148.11,-148.11,143.65064738435123,143.65064738435123,143.65064738435123,140.00759305646\n2012-09-25,146.24,144.06,144.19,145.96,148.0488,-148.0488,143.96280206744666,143.96280206744666,143.96280206744666,140.3316893342016\n2012-09-26,144.11,142.96,143.29,144.11,147.889248,-147.889248,-148.11,-148.11,-148.11,140.64282176083353\n2012-09-27,144.97,143.51,144.72,143.88,147.59349312,-147.59349312,-147.9555,-147.9555,-147.9555,140.9415088904002\n2012-09-28,144.55,143.46,143.93,144.01,147.31548353280002,-147.31548353280002,-147.805635,-147.805635,-147.805635,141.2282485347842\n2012-10-01,145.69,144.02,144.24,144.5,147.05415452083201,-147.05415452083201,-147.66026595,-147.66026595,-147.66026595,141.50351859339284\n2012-10-02,145.15,143.83,144.5,144.9,146.80850524958208,-146.80850524958208,-147.5192579715,-147.5192579715,-147.5192579715,141.76777784965714\n2012-10-03,145.43,144.13,145.07,144.88,146.57759493460716,-146.57759493460716,-147.382480232355,-147.382480232355,-147.382480232355,142.02146673567086\n2012-10-04,146.33,145.44,146.27,145.63,146.36053923853072,-146.36053923853072,-147.24980582538436,-147.24980582538436,-147.24980582538436,142.26500806624404\n2012-10-05,147.15,145.7,146.13,146.92,142.96,142.96,142.96,142.96,142.96,142.49880774359428\n2012-10-08,145.89,145.31,145.66,145.58,143.0438,143.0438,143.0438,143.0438,143.0438,142.7232554338505\n2012-10-09,145.64,144.15,144.25,145.52,143.125924,143.125924,143.125924,143.125924,143.125924,142.9387252164965\n2012-10-10,144.32,143.09,143.28,144.2,147.15,-147.15,-147.15,-147.15,-147.15,-151.0722\n2012-10-11,144.49,143.36,143.36,144.28,147.0688,-147.0688,-147.0282,-147.0282,-147.0282,-150.83273400000002\n2012-10-12,143.95,142.59,142.84,143.44,146.989224,-146.989224,-146.910054,-146.910054,-146.910054,-150.60045198\n2012-10-15,144.23,142.77,144.01,143.23,146.81325504,-146.81325504,-146.6940513,-146.6940513,-146.6940513,-150.199929381\n2012-10-16,145.64,144.66,145.58,144.76,146.6443248384,-146.6443248384,-146.488848735,-146.488848735,-146.488848735,-149.81943291195\n2012-10-17,146.32,145.42,146.16,145.63,146.482151844864,-146.482151844864,142.59,142.59,142.59,-149.4579612663525\n2012-10-18,146.52,145.33,145.86,145.85,142.59,142.59,142.6646,142.6646,142.6646,-149.11456320303486\n2012-10-19,145.56,143.05,143.3,145.5,142.6686,142.6686,142.780262,142.780262,142.780262,-148.78833504288312\n2012-10-22,143.67,142.28,143.41,143.2,146.52,-146.52,-146.52,-146.52,-146.52,-148.47841829073897\n2012-10-23,142.06,140.83,141.35,141.88,146.4352,-146.4352,-146.39280000000002,-146.39280000000002,-146.39280000000002,-148.04452901038724\n2012-10-24,142.1,140.8,141.05,141.94,146.210992,-146.210992,-146.11466000000001,-146.11466000000001,-146.11466000000001,-147.3952213994524\n2012-10-25,142.28,140.57,141.43,142.07,145.88633248,-145.88633248,-145.74263380000002,-145.74263380000002,-145.74263380000002,-146.66974704551262\n2012-10-26,141.84,140.39,141.35,141.32,145.4610258816,-145.4610258816,-145.27709675800003,-145.27709675800003,-145.27709675800003,-145.87677992959598\n2012-10-31,142.03,140.68,141.18,141.84,144.95392329344,-144.95392329344,-144.73951611462002,-144.73951611462002,-144.73951611462002,-145.0537629401566\n2012-11-01,143.01,141.52,142.91,141.66,144.497530964096,-144.497530964096,-144.2610693420118,-144.2610693420118,-144.2610693420118,-144.3541984991331\n2012-11-02,143.72,141.41,141.56,143.72,144.0867778676864,-144.0867778676864,-143.8352517143905,-143.8352517143905,-143.8352517143905,-143.75956872426315\n2012-11-05,142.17,140.93,141.9,141.37,143.72,-143.72,-143.72,-143.72,-143.72,-143.72\n2012-11-06,143.52,142.13,142.93,142.27,143.72,-143.72,-143.72,-143.72,-143.72,-143.72\n2012-11-07,141.68,139.07,139.78,141.65,143.52,-143.52,-143.52,-143.52,-143.52,-143.52\n2012-11-08,140.41,137.95,137.95,139.72,143.52,-143.52,-143.52,-143.52,-143.52,-143.52\n2012-11-09,139.44,137.56,138.16,137.61,142.74020000000002,-142.74020000000002,-142.6845,-142.6845,-142.6845,-142.4617\n2012-11-12,138.81,137.96,138.24,138.55,141.911368,-141.911368,-141.81333500000002,-141.81333500000002,-141.81333500000002,-141.432343\n2012-11-13,139.25,137.36,137.8,137.52,141.21514912,-141.21514912,-141.09026805000002,-141.09026805000002,-141.09026805000002,-140.61915097\n2012-11-14,138.43,135.62,135.98,138.21,140.52122227840002,-140.52122227840002,-140.3815171205,-140.3815171205,-140.3815171205,-139.8695462469\n2012-11-15,136.49,135.18,135.7,135.95,139.54097782272,-139.54097782272,-139.38159852519502,-139.38159852519502,-139.38159852519502,-139.25\n2012-11-16,136.64,134.7,136.35,135.92,138.668782258176,-138.668782258176,-138.43,-138.43,-138.43,-138.43\n2012-11-19,139.15,137.83,139.15,137.92,134.7,134.7,134.7,134.7,134.7,132.006\n2012-11-20,139.42,138.08,139.28,138.89,134.7,134.7,134.7,134.7,134.7,132.14888\n2012-11-21,139.57,139.03,139.45,139.31,134.88879999999997,134.88879999999997,134.8416,134.8416,134.8416,132.36701359999998\n2012-11-23,141.4,140.04,141.33,140.14,135.16967199999996,135.16967199999996,135.030736,135.030736,135.030736,132.65513305599998\n2012-11-26,141.17,140.19,141.17,140.69,135.66809823999998,135.66809823999998,135.3491992,135.3491992,135.3491992,133.09237640319998\n2012-11-27,141.38,140.24,140.38,140.91,136.1266503808,136.1266503808,135.65173923999998,135.65173923999998,135.65173923999998,133.50775758304\n2012-11-28,141.54,139.0,141.48,139.77,136.548518350336,136.548518350336,135.939152278,135.939152278,135.939152278,133.90236970388798\n2012-11-29,142.5,141.37,142.16,142.02,137.0476665153024,137.0476665153024,136.27520314132,136.27520314132,136.27520314132,134.3606275216547\n2012-11-30,142.42,141.67,142.06,142.17,137.70194653346613,137.70194653346613,136.71093892142758,136.71093892142758,136.71093892142758,134.93038359513886\n2012-12-03,142.92,141.34,141.47,142.81,138.2777129494502,138.2777129494502,137.11617319692766,137.11617319692766,137.11617319692766,135.46025674347914\n2012-12-04,141.87,140.87,141.22,141.44,138.92763313652716,138.92763313652716,137.58047934117346,137.58047934117346,137.58047934117346,136.0570362040008\n2012-12-05,142.16,140.38,141.5,141.41,139.48656449741335,139.48656449741335,138.0076409938796,138.0076409938796,138.0076409938796,136.60607330768073\n2012-12-06,142.04,141.16,141.91,141.37,139.96724546777548,139.96724546777548,138.40062971436922,138.40062971436922,138.40062971436922,137.11118744306629\n2012-12-07,142.69,141.67,142.4,142.52,140.38,140.38,138.7621793372197,138.7621793372197,138.7621793372197,137.575892447621\n2012-12-10,142.81,142.15,142.52,142.22,140.7356,140.7356,139.09480499024212,139.09480499024212,139.09480499024212,138.0034210518113\n2012-12-11,144.11,142.99,143.42,143.07,141.041416,141.041416,139.40082059102275,139.40082059102275,139.40082059102275,138.3967473676664\n2012-12-12,144.55,143.31,143.54,144.01,141.53238944,141.53238944,139.8246467378307,139.8246467378307,139.8246467378307,138.9109401045764\n2012-12-13,143.83,142.28,142.66,143.44,142.0755593408,142.0755593408,140.29718206404763,140.29718206404763,140.29718206404763,139.47484609411876\n2012-12-14,142.58,141.88,142.12,142.32,144.55,-144.55,140.72246385764288,140.72246385764288,140.72246385764288,139.98236148470687\n2012-12-17,143.85,142.43,143.79,142.5,144.4966,-144.4966,141.1052174718786,141.1052174718786,141.1052174718786,140.43912533623617\n2012-12-18,145.5,143.79,145.41,144.0,141.88,141.88,141.44969572469074,141.44969572469074,141.44969572469074,140.85021280261256\n2012-12-19,145.58,144.24,144.27,145.55,141.95239999999998,141.95239999999998,141.89522919497475,141.89522919497475,141.89522919497475,141.36168939432517\n2012-12-20,145.14,143.99,145.14,144.36,142.097504,142.097504,142.33740169157778,142.33740169157778,142.33740169157778,141.86788666700616\n2012-12-21,143.1,141.94,142.77,142.2,145.58,-145.58,-145.58,-145.58,-145.58,-148.4916\n2012-12-24,142.56,142.19,142.33,142.45,145.5072,-145.5072,-145.47080000000003,-145.47080000000003,-145.47080000000003,-148.295052\n2012-12-26,142.71,141.35,141.65,142.62,145.435856,-145.435856,-145.36487600000004,-145.36487600000004,-145.36487600000004,-148.10440044\n2012-12-27,142.07,139.92,141.59,141.75,145.27242176000001,-145.27242176000001,-145.16413220000004,-145.16413220000004,-145.16413220000004,-147.766680418\n2012-12-28,141.42,139.87,139.87,140.65,144.95127645440002,-144.95127645440002,-144.79704294600003,-144.79704294600003,-144.79704294600003,-147.21741278874\n2012-12-31,142.56,139.54,142.52,139.72,144.54477433804803,-144.54477433804803,-144.35360908086002,-144.35360908086002,-144.35360908086002,-146.55614563775342\n2013-01-02,146.15,144.73,146.15,145.28,139.54,139.54,139.54,139.54,139.54,136.7492\n2013-01-03,146.37,145.34,145.73,145.99,139.54,139.54,139.54,139.54,139.54,136.937216\n2013-01-04,146.61,145.67,146.45,145.97,139.8132,139.8132,139.7449,139.7449,139.7449,137.22019952\n2013-01-07,146.11,145.43,145.92,145.87,140.22100799999998,140.22100799999998,140.019504,140.019504,140.019504,137.5957915392\n2013-01-08,145.91,144.98,145.53,145.72,140.60434751999998,140.60434751999998,140.28312384,140.28312384,140.28312384,137.956359877632\n2013-01-09,146.32,145.64,145.99,145.89,140.96468666879997,140.96468666879997,140.5361988864,140.5361988864,140.5361988864,138.30250548252673\n2013-01-10,147.09,145.97,147.07,146.72,141.30340546867197,141.30340546867197,140.779150930944,140.779150930944,140.779150930944,138.63480526322564\n2013-01-11,147.15,146.61,147.07,147.06,141.76633303117822,141.76633303117822,141.0946933843968,141.0946933843968,141.0946933843968,139.05756500006436\n2013-01-14,147.07,146.43,146.96,146.89,142.3046997280604,142.3046997280604,141.458011781333,141.458011781333,141.458011781333,139.5431111000605\n2013-01-15,147.21,146.2,147.07,146.29,142.78922975525435,142.78922975525435,141.79953107445303,141.79953107445303,141.79953107445303,139.99952443405687\n2013-01-16,147.28,146.61,147.05,146.78,143.31972218462383,143.31972218462383,142.17826389924133,142.17826389924133,142.17826389924133,140.50425772367288\n2013-01-17,148.42,147.43,147.97,147.66,143.8741610787765,143.8741610787765,142.58640278730203,142.58640278730203,142.58640278730203,141.04631710577905\n2013-01-18,148.49,147.43,148.33,148.0,144.60149530617227,144.60149530617227,143.11142653644484,143.11142653644484,143.11142653644484,141.70994856625893\n2013-01-22,149.13,147.98,149.1,148.34,145.30142615106126,145.30142615106126,143.64928388280035,143.64928388280035,143.64928388280035,142.38795370963302\n2013-01-23,149.49,148.86,149.37,149.12,146.067140920849,146.067140920849,144.2521626556923,144.2521626556923,144.2521626556923,143.1295788015734\n2013-01-24,150.14,149.01,149.42,149.12,146.7517127366792,146.7517127366792,144.88070313700922,144.88070313700922,144.88070313700922,143.89282934538457\n2013-01-25,150.25,149.46,150.25,149.88,147.42937018934336,147.42937018934336,145.564411729198,145.564411729198,145.564411729198,144.70496153048458\n2013-01-28,150.33,149.51,150.07,150.33,147.9934961514747,147.9934961514747,146.2203940871103,146.2203940871103,146.2203940871103,145.48126691621675\n2013-01-29,150.85,149.67,150.66,149.78,148.46079692117976,148.46079692117976,146.83683497404374,146.83683497404374,146.83683497404374,146.20857687878424\n2013-01-30,150.93,149.93,150.08,150.64,148.93863753694382,148.93863753694382,147.47894137819674,147.47894137819674,147.47894137819674,146.95120457817876\n2013-01-31,150.38,149.6,149.7,149.93,149.33691002955504,149.33691002955504,148.0656213439033,148.0656213439033,148.0656213439033,147.62759979988837\n2013-02-01,151.41,150.39,151.28,150.66,149.6,149.6,148.55256571543975,148.55256571543975,148.55256571543975,148.18900783390734\n2013-02-04,150.58,149.43,149.53,150.31,151.41,-151.41,149.0669038866606,149.0669038866606,149.0669038866606,148.76878642380402\n2013-02-05,151.48,150.29,151.08,150.36,149.43,149.43,149.43,149.43,149.43,149.2442048675193\n2013-02-06,151.26,150.41,151.18,150.53,149.43,149.43,149.43,149.43,149.43,149.43\n2013-02-07,151.35,149.87,150.96,151.21,149.471,149.471,149.8195,149.8195,149.8195,149.8195\n2013-02-08,151.89,151.22,151.8,151.24,149.51118,149.51118,149.87,149.87,149.87,149.87\n2013-02-11,151.9,151.4,151.77,151.76,149.6063328,149.6063328,149.87,149.87,149.87,149.87\n2013-02-12,152.3,151.61,152.0,151.78,149.743952832,149.743952832,150.2963,150.2963,150.2963,150.2963\n2013-02-13,152.61,151.72,152.15,152.32,149.94843660543998,149.94843660543998,150.737114,150.737114,150.737114,150.737114\n2013-02-14,152.47,151.52,152.31,151.71,150.21459294489597,150.21459294489597,151.16787778,151.16787778,151.16787778,151.16787778\n2013-02-15,152.59,151.55,152.17,152.43,150.45413365040636,150.45413365040636,151.4995658906,151.4995658906,151.4995658906,151.4995658906\n2013-02-19,153.28,152.36,153.2,152.38,150.6697202853657,150.6697202853657,151.52,151.52,151.52,151.52\n2013-02-20,153.19,151.26,151.26,153.1,150.98295385112183,150.98295385112183,-153.28,-153.28,-153.28,-156.3456\n2013-02-21,150.96,149.94,150.4,150.9,153.28,-153.28,-153.28,-153.28,-153.28,-156.193032\n2013-02-22,151.89,150.77,151.89,151.14,153.2132,-153.2132,-153.19,-153.19,-153.19,-155.88038039999998\n2013-02-25,152.86,149.0,149.01,152.6,153.147736,-153.147736,-153.0275,-153.0275,-153.0275,-155.58336137999999\n2013-02-26,150.19,148.73,150.02,149.7,152.98182656,-152.98182656,-152.86,-152.86,-152.86,-155.12252608339998\n2013-02-27,152.33,149.77,151.91,149.89,152.86,-152.86,-152.86,-152.86,-152.86,-154.54719873589397\n2013-02-28,152.87,151.53,151.53,151.87,148.73,148.73,148.73,148.73,148.73,-154.0236508496635\n2013-03-01,152.34,150.42,152.11,151.09,148.81279999999998,148.81279999999998,148.81279999999998,148.81279999999998,148.81279999999998,-153.5472222731938\n2013-03-04,152.92,151.52,152.92,151.76,148.89394399999998,148.89394399999998,148.89394399999998,148.89394399999998,148.89394399999998,-153.11367226860636\n2013-03-05,154.7,153.64,154.29,153.65,149.05498623999998,149.05498623999998,149.01472567999997,149.01472567999997,149.01472567999997,145.75539999999998\n2013-03-06,154.92,154.16,154.5,154.83,149.39368706559998,149.39368706559998,149.24213665279996,149.24213665279996,149.24213665279996,145.93429199999997\n2013-03-07,154.98,154.52,154.82,154.69,149.83579210035197,149.83579210035197,149.52602982015995,149.52602982015995,149.52602982015995,146.20386323999998\n2013-03-08,155.64,154.66,155.44,155.47,150.35021289031675,150.35021289031675,149.85326803095035,149.85326803095035,149.85326803095035,146.55490871039999\n2013-03-11,156.04,155.14,156.03,155.35,150.98498734347874,150.98498734347874,150.25833926878383,150.25833926878383,150.25833926878383,147.00916327488\n2013-03-12,156.1,155.22,155.64,155.93,151.69268911539172,151.69268911539172,150.72087212728113,150.72087212728113,150.72087212728113,147.5510134783872\n2013-03-13,156.12,155.24,155.84,155.75,152.39785885692905,152.39785885692905,151.20499363582582,151.20499363582582,151.20499363582582,148.1494425349001\n2013-03-14,156.8,156.22,156.73,156.31,153.06784426268183,153.06784426268183,151.69649427224323,151.69649427224323,151.69649427224323,148.78708713210807\n2013-03-15,156.04,155.31,155.88,155.87,153.81427541014546,153.81427541014546,152.25787990229648,152.25787990229648,152.25787990229648,149.50824929021834\n2013-03-18,155.64,154.2,154.97,154.29,156.8,-156.8,152.75751311304387,152.75751311304387,152.75751311304387,150.1645068540987\n2013-03-19,155.51,153.59,154.61,155.29,156.74800000000002,-156.74800000000002,153.20218667060905,153.20218667060905,153.20218667060905,150.76170123722983\n2013-03-20,155.95,155.26,155.63,155.51,156.62168000000003,-156.62168000000003,153.59,153.59,153.59,151.30514812587916\n2013-03-21,155.31,154.1,154.34,154.79,156.50041280000002,-156.50041280000002,153.59,153.59,153.59,151.79968479455005\n2013-03-22,155.6,154.73,155.6,154.85,156.38399628800002,-156.38399628800002,153.94310000000002,153.94310000000002,153.94310000000002,152.24971316304055\n2013-03-25,156.27,154.35,155.07,155.99,156.27223643648003,-156.27223643648003,154.1,154.1,154.1,152.65923897836691\n2013-03-26,156.22,155.42,156.15,155.6,156.27,-156.27,154.35,154.35,154.35,153.03190747031388\n2013-03-27,156.25,155.0,156.16,155.27,156.27,-156.27,154.35,154.35,154.35,153.37103579798563\n2013-03-28,156.85,155.85,156.55,156.13,153.59,153.59,154.6195,154.6195,154.6195,153.6796425761669\n2013-04-01,156.91,155.68,156.05,156.6,153.6552,153.6552,154.88716,154.88716,154.88716,153.9966783185502\n2013-04-02,157.21,156.37,156.82,156.59,153.785392,153.785392,155.15012919999998,155.15012919999998,155.15012919999998,154.3171437035097\n2013-04-03,157.03,154.82,155.15,156.92,153.99086848,153.99086848,-157.21,-157.21,-157.21,154.66428645908852\n2013-04-04,156.17,155.09,155.85,155.43,154.1840163712,154.1840163712,-157.21,-157.21,-157.21,154.82\n2013-04-05,155.35,153.77,155.18,153.98,157.21,-157.21,-157.13830000000002,-157.13830000000002,-157.13830000000002,-160.35420000000002\n2013-04-08,156.22,154.76,156.21,155.25,157.1412,-157.1412,-156.969885,-156.969885,-156.969885,-160.156674\n2013-04-09,157.32,155.98,156.75,156.48,153.77,153.77,153.77,153.77,153.77,-159.96507378\n2013-04-10,158.87,157.13,158.73,157.17,153.841,153.841,153.841,153.841,153.841,-159.7792215666\n2013-04-11,159.71,158.54,159.22,158.69,154.04216,154.04216,153.99187,153.99187,153.99187,150.6946\n2013-04-12,159.04,157.92,158.78,158.71,154.3822304,154.3822304,154.22059520000002,154.22059520000002,154.22059520000002,150.874908\n2013-04-15,158.13,155.12,155.17,158.02,154.701896576,154.701896576,154.44017139200002,154.44017139200002,154.44017139200002,151.05160984\n2013-04-16,157.49,155.91,157.42,156.32,155.00238278144,155.00238278144,154.65096453632003,154.65096453632003,154.65096453632003,151.22477764319999\n2013-04-17,156.32,154.28,155.04,156.31,159.71,-159.71,-159.71,-159.71,-159.71,151.394482090336\n2013-04-18,155.41,153.55,154.14,155.33,159.6014,-159.6014,-159.5471,-159.5471,-159.5471,151.56079244852927\n2013-04-19,155.55,154.12,155.48,154.44,159.35934400000002,-159.35934400000002,-159.247245,-159.247245,-159.247245,151.72377659955868\n2013-04-22,156.54,154.75,156.2,155.78,159.12697024000002,-159.12697024000002,-158.96238275,-158.96238275,-158.96238275,151.8835010675675\n2013-04-23,157.93,156.18,157.79,156.96,158.90389143040002,-158.90389143040002,-158.69176361249998,-158.69176361249998,-158.69176361249998,152.04003104621614\n2013-04-24,158.29,157.54,157.9,157.82,158.68973577318403,-158.68973577318403,-158.43467543187498,-158.43467543187498,-158.43467543187498,152.1934304252918\n2013-04-25,159.27,158.1,158.61,158.25,153.55,153.55,153.55,153.55,153.55,152.34376181678599\n2013-04-26,158.6,157.73,158.26,158.34,153.6644,153.6644,153.6644,153.6644,153.6644,152.49108658045026\n2013-04-29,159.65,158.42,159.3,158.65,153.776512,153.776512,153.776512,153.776512,153.776512,152.63546484884125\n2013-04-30,159.72,158.61,159.68,159.29,154.01145152,154.01145152,153.95271664,153.95271664,153.95271664,152.77695555186443\n2013-05-01,159.41,158.1,158.32,159.32,154.3539644288,154.3539644288,154.1834079744,154.1834079744,154.1834079744,152.9852468853085\n2013-05-02,159.89,158.53,159.72,158.67,154.675926563072,154.675926563072,154.40487165542402,154.40487165542402,154.40487165542402,153.18728947874925\n2013-05-03,161.88,161.04,161.32,161.13,155.09305243802626,155.09305243802626,154.67912807265282,154.67912807265282,154.67912807265282,153.4553978995993\n2013-05-06,162.01,161.42,161.78,161.46,155.77174719422362,155.77174719422362,155.11118038829363,155.11118038829363,155.11118038829363,153.87662800461933\n2013-05-07,162.65,161.67,162.63,162.09,156.52033753091678,156.52033753091678,155.5940977611131,155.5940977611131,155.5940977611131,154.3646303243422\n2013-05-08,163.39,162.33,163.34,162.42,157.37849027658842,157.37849027658842,156.15856994022406,156.15856994022406,156.15856994022406,154.94460620163824\n2013-05-09,163.7,162.47,162.93,163.29,158.34033183233427,158.34033183233427,156.8093986456039,156.8093986456039,156.8093986456039,155.62023770550718\n2013-05-10,163.49,162.51,163.41,163.03,159.3050721025141,159.3050721025141,157.4984587810435,157.4984587810435,157.4984587810435,156.34741631201155\n2013-05-13,163.81,162.82,163.54,163.23,160.09615912406156,160.09615912406156,158.11861290293913,158.11861290293913,158.11861290293913,157.00914884393052\n2013-05-14,165.35,163.67,165.28,163.72,160.83892729924924,160.83892729924924,158.74466548361582,158.74466548361582,158.74466548361582,157.68923395953746\n2013-05-15,166.45,164.91,166.15,165.01,161.74114183939938,161.74114183939938,159.53730562558192,159.53730562558192,159.53730562558192,158.53191822398833\n2013-05-16,166.36,165.11,165.34,165.79,162.6829134715195,162.6829134715195,160.43595589425627,160.43595589425627,160.43595589425627,159.48208803710972\n2013-05-17,167.04,165.74,166.97,165.97,163.4363307772156,163.4363307772156,161.21778162800294,161.21778162800294,161.21778162800294,160.31823747265656\n2013-05-20,167.58,166.61,166.97,166.81,164.1570646217725,164.1570646217725,162.03289220008253,162.03289220008253,162.03289220008253,161.1920666012112\n2013-05-21,167.8,166.5,167.11,167.09,164.841651697418,164.841651697418,162.86495837007016,162.86495837007016,162.86495837007016,162.08637727704163\n2013-05-22,169.07,165.17,165.92,167.34,169.07,-169.07,163.65456503085892,163.65456503085892,163.65456503085892,162.9434206854854\n2013-05-23,165.91,163.94,165.45,164.2,169.07,-169.07,-169.07,-169.07,-169.07,163.92367337580774\n2013-05-24,165.33,163.98,165.33,164.48,169.07,-169.07,-169.07,-169.07,-169.07,163.94\n2013-05-28,167.78,165.81,166.3,167.09,168.8648,-168.8648,-168.9161,-168.9161,-168.9161,163.94\n2013-05-29,165.8,164.34,165.22,165.41,168.667808,-168.667808,-168.766817,-168.766817,-168.766817,163.98\n2013-05-30,166.59,165.23,165.89,165.38,168.47869568000002,-168.47869568000002,-168.62201249,-168.62201249,-168.62201249,164.34\n2013-05-31,166.31,163.24,163.24,165.36,168.2971478528,-168.2971478528,-168.4815521153,-168.4815521153,-168.4815521153,-172.4514\n2013-06-03,164.46,162.66,164.38,163.88,167.99371898163201,-167.99371898163201,-168.219474509535,-168.219474509535,-168.219474509535,-172.175058\n2013-06-04,165.1,162.73,163.56,164.43,167.56702146310144,-167.56702146310144,-167.83031129386754,-167.83031129386754,-167.83031129386754,-171.6993051\n2013-06-05,163.42,161.13,161.18,163.1,167.17445974605332,-167.17445974605332,-167.4683895032968,-167.4683895032968,-167.4683895032968,-171.247339845\n2013-06-06,162.74,160.25,162.64,161.19,166.57001377144798,-166.57001377144798,-166.8979344480001,-166.8979344480001,-166.8979344480001,-170.53912605585\n2013-06-07,164.95,163.14,164.81,163.83,165.81161211887422,-165.81161211887422,-166.16666165872007,-166.16666165872007,-166.16666165872007,-169.6131047108235\n2013-06-10,165.4,164.38,164.8,165.3,160.25,160.25,-165.51582887626085,-165.51582887626085,-165.51582887626085,-168.7704252868494\n2013-06-11,164.54,162.74,163.12,163.27,160.353,160.353,-165.4,-165.4,-165.4,-168.00358701103295\n2013-06-12,164.38,161.6,161.75,164.23,160.45394000000002,160.45394000000002,-165.4,-165.4,-165.4,-167.30576418003997\n2013-06-13,164.5,161.3,164.22,161.65,160.55286120000002,160.55286120000002,-164.83350000000002,-164.83350000000002,-164.83350000000002,-166.67074540383638\n2013-06-14,164.66,162.91,163.17,164.03,160.64980397600002,160.64980397600002,160.25,160.25,160.25,-166.0928783174911\n2013-06-17,165.22,163.55,164.5,164.3,160.74480789648,160.74480789648,160.3382,160.3382,160.3382,-165.5670192689169\n2013-06-18,165.99,164.52,165.69,164.56,160.83791173855042,160.83791173855042,160.484654,160.484654,160.484654,157.045\n2013-06-19,165.89,163.38,163.54,165.61,161.0439952690084,161.0439952690084,160.70486784000002,160.70486784000002,160.70486784000002,157.2239\n2013-06-20,162.1,158.98,159.27,161.87,165.99,-165.99,-165.99,-165.99,-165.99,157.39922199999998\n2013-06-21,159.76,157.48,159.05,159.62,165.89,-165.89,-165.89,-165.89,-165.89,-169.3098\n2013-06-24,158.43,155.73,156.99,157.41,165.5536,-165.5536,-165.46949999999998,-165.46949999999998,-165.46949999999998,-168.954906\n2013-06-25,159.17,157.43,158.65,158.52,164.964184,-164.964184,-164.78773499999997,-164.78773499999997,-164.78773499999997,-168.2936607\n2013-06-26,160.5,159.26,160.17,159.93,164.41013296,-164.41013296,-164.15369354999996,-164.15369354999996,-164.15369354999996,-167.665477665\n2013-06-27,161.82,160.95,161.13,161.15,163.8893249824,-163.8893249824,-163.56403500149995,-163.56403500149995,-163.56403500149995,-167.06870378175\n2013-06-28,161.4,159.86,160.01,160.65,163.399765483456,-163.399765483456,-163.01565255139494,-163.01565255139494,-163.01565255139494,-166.5017685926625\n2013-07-01,162.48,161.08,161.4,161.28,162.93957955444864,-162.93957955444864,-162.5056568727973,-162.5056568727973,-162.5056568727973,-165.96318016302936\n2013-07-02,162.3,160.5,161.16,161.09,162.50700478118173,-162.50700478118173,-162.48,-162.48,-162.48,-165.4515211548779\n2013-07-03,161.76,160.22,161.34,160.51,162.48,-162.48,-162.48,-162.48,-162.48,-164.965445097134\n2013-07-05,163.08,161.3,163.05,162.53,155.73,155.73,155.73,155.73,155.73,-164.5036728422773\n2013-07-08,164.39,163.58,163.94,163.92,155.87699999999998,155.87699999999998,155.87699999999998,155.87699999999998,155.87699999999998,152.6154\n2013-07-09,165.33,164.27,165.08,165.0,156.21751999999998,156.21751999999998,156.13239,156.13239,156.13239,152.850892\n2013-07-10,165.75,164.63,165.21,165.03,156.76426879999997,156.76426879999997,156.5002944,156.5002944,156.5002944,153.22526524\n2013-07-11,167.6,166.53,167.51,167.11,157.48312729599996,157.48312729599996,156.96277968,156.96277968,156.96277968,153.7262546304\n2013-07-12,167.85,167.13,167.51,167.43,158.49481456639995,158.49481456639995,157.60101289920001,157.60101289920001,157.60101289920001,154.41994189888\n2013-07-15,168.39,167.68,168.22,167.96,159.61743681843197,159.61743681843197,158.318441996256,158.318441996256,158.318441996256,155.2257453849472\n2013-07-16,168.35,167.07,167.5,168.25,160.8455956638515,160.8455956638515,159.12416663655554,159.12416663655554,159.12416663655554,156.1472432080009\n2013-07-17,168.47,167.73,167.97,168.16,161.90181227091227,161.90181227091227,159.8654333056311,159.8654333056311,159.8654333056311,157.00423618344084\n2013-07-18,169.27,168.2,168.88,168.29,162.95272230756632,162.95272230756632,160.63984430812428,160.63984430812428,160.63984430812428,157.92149728876558\n2013-07-19,169.23,168.31,169.23,168.48,164.0898322922044,164.0898322922044,161.50285987731186,161.50285987731186,161.50285987731186,158.94286253277667\n2013-07-22,169.74,169.01,169.5,169.39,165.0222624796076,165.0222624796076,162.2795738895807,162.2795738895807,162.2795738895807,159.87230490482676\n2013-07-23,169.83,169.05,169.14,169.79,165.96580998368609,165.96580998368609,163.1002207617268,163.1002207617268,163.1002207617268,160.8590744143441\n2013-07-24,169.85,168.18,168.55,169.8,166.73864798694888,166.73864798694888,163.90779427031958,163.90779427031958,163.90779427031958,161.84587622876626\n2013-07-25,169.08,167.94,168.93,168.17,167.3609183895591,167.3609183895591,164.68028101517802,164.68028101517802,164.68028101517802,162.8063710813143\n2013-07-26,169.16,167.52,169.11,168.24,169.85,-169.85,165.3523444832049,165.3523444832049,165.3523444832049,163.65160655155657\n2013-07-29,169.06,168.11,168.53,168.7,169.80339999999998,-169.80339999999998,165.93703970038825,165.93703970038825,165.93703970038825,164.39541376536977\n2013-07-30,169.28,168.19,168.6,169.15,169.75773199999998,-169.75773199999998,166.4457245393378,166.4457245393378,166.4457245393378,165.0499641135254\n2013-07-31,169.85,168.49,168.66,168.94,167.52,167.52,166.88828034922386,166.88828034922386,166.88828034922386,165.62596841990234\n2013-08-01,170.81,169.9,170.65,170.0,167.56660000000002,167.56660000000002,167.27330390382477,167.27330390382477,167.27330390382477,166.13285220951406\n2013-08-02,170.96,170.05,170.95,170.3,167.69633600000003,167.69633600000003,167.7684413572893,167.7684413572893,167.7684413572893,166.74088142227723\n2013-08-05,170.96,170.35,170.8,170.61,167.89215584000004,167.89215584000004,168.2471751536959,168.2471751536959,168.2471751536959,167.3315580231584\n2013-08-06,170.52,169.35,169.73,170.34,168.07622648960003,168.07622648960003,168.65409888064153,168.65409888064153,168.65409888064153,167.83953989991622\n2013-08-07,169.43,168.55,169.18,169.23,168.24925290022404,168.24925290022404,-170.96,-170.96,-170.96,168.27640431392794\n2013-08-08,170.18,168.93,169.81,170.0,168.41189772621058,168.41189772621058,-170.8877,-170.8877,-170.8877,168.55\n2013-08-09,170.1,168.73,169.3,169.56,168.55,168.55,-170.817569,-170.817569,-170.817569,168.55\n2013-08-12,169.31,168.38,169.1,168.47,170.96,-170.96,-170.74954193,-170.74954193,-170.74954193,-174.3792\n2013-08-13,169.9,168.41,169.69,169.4,170.9084,-170.9084,-170.6310648335,-170.6310648335,-170.6310648335,-174.199224\n2013-08-14,169.79,168.7,168.74,169.56,170.857832,-170.857832,-170.51851159182502,-170.51851159182502,-170.51851159182502,-174.02464727999998\n2013-08-15,167.43,166.09,166.27,167.43,170.80827536,-170.80827536,-170.41158601223376,-170.41158601223376,-170.41158601223376,-173.85530786159998\n2013-08-16,166.63,165.5,165.87,166.04,170.61954434560002,-170.61954434560002,-170.10907499137738,-170.10907499137738,-170.10907499137738,-173.46704246852\n2013-08-19,166.21,164.76,164.76,165.64,170.31237168486402,-170.31237168486402,-169.6942582421534,-169.6942582421534,-169.6942582421534,-172.9093494957236\n2013-08-20,166.2,164.86,165.59,165.03,169.8681819500749,-169.8681819500749,-169.15148983551654,-169.15148983551654,-169.15148983551654,-172.17590804110847\n2013-08-21,166.03,164.19,164.56,165.15,169.4595273940689,-169.4595273940689,-168.66842595360973,-168.66842595360973,-168.66842595360973,-171.5084763174087\n2013-08-22,166.29,164.89,166.06,164.95,168.93257465466203,-168.93257465466203,-168.08623057964047,-168.08623057964047,-168.08623057964047,-170.70344392249376\n2013-08-23,166.83,165.77,166.67,166.55,168.45831718919584,-168.45831718919584,-167.57972060428722,-167.57972060428722,-167.57972060428722,-169.98696509101944\n2013-08-26,167.3,165.89,165.97,166.77,168.03148547027627,-168.03148547027627,164.19,164.19,164.19,-169.3492989310073\n2013-08-27,164.98,163.21,163.29,164.33,167.64733692324864,-167.64733692324864,-167.3,-167.3,-167.3,-168.7817760485965\n2013-08-28,164.49,163.06,163.91,163.31,167.3,-167.3,-167.3,-167.3,-167.3,-168.05744516227895\n2013-08-29,165.04,163.4,164.22,163.53,166.7064,-166.7064,-167.08800000000002,-167.08800000000002,-167.08800000000002,-167.30782838793712\n2013-08-30,164.53,163.17,163.65,164.46,166.195904,-166.195904,-166.88660000000002,-166.88660000000002,-166.88660000000002,-166.67065412974657\n2013-09-03,165.58,163.7,164.38,165.23,165.75687744,-165.75687744,-166.69527000000002,-166.69527000000002,-166.69527000000002,-166.1290560102846\n2013-09-04,166.03,164.135,165.76,164.46,163.06,163.06,-166.51350650000003,-166.51350650000003,-166.51350650000003,159.7988\n2013-09-05,166.4,165.73,165.86,165.85,163.1194,163.1194,163.06,163.06,163.06,159.923424\n2013-09-06,166.98,164.48,166.04,166.48,163.25062400000002,163.25062400000002,163.1268,163.1268,163.1268,160.11772128\n2013-09-09,167.73,166.44,167.67,166.45,163.47438656000003,163.47438656000003,163.242396,163.242396,163.242396,160.3922124288\n2013-09-10,168.9,168.26,168.84,168.64,163.8148356352,163.8148356352,163.42190016,163.42190016,163.42190016,160.75910180736\n2013-09-11,169.4,168.35,169.37,168.66,164.32335207168,164.32335207168,163.69580515200002,163.69580515200002,163.69580515200002,161.2475556989184\n2013-09-12,169.56,168.72,169.04,169.35,164.9325498230784,164.9325498230784,164.03805684288002,164.03805684288002,164.03805684288002,161.8182267999941\n2013-09-13,169.46,168.74,169.33,169.13,165.58039284784743,165.58039284784743,164.42459286387842,164.42459286387842,164.42459286387842,162.43756865599457\n2013-09-16,171.24,170.04,170.38,171.16,166.1375378491488,166.1375378491488,164.78407136340692,164.78407136340692,164.78407136340692,163.007363163515\n2013-09-17,171.11,170.46,171.07,170.47,166.953931793285,166.953931793285,165.30054565433437,165.30054565433437,165.30054565433437,163.74830047879865\n2013-09-18,173.52,170.58,173.14,170.97,167.6397027063594,167.6397027063594,165.7757020019876,165.7757020019876,165.7757020019876,164.4225534357068\n2013-09-19,173.6,172.59,172.81,173.53,168.69815621921472,168.69815621921472,166.47268882180873,166.47268882180873,166.47268882180873,165.3322980921361\n2013-09-20,172.33,170.58,170.62,172.3,169.67852497537177,169.67852497537177,167.18541993962785,167.18541993962785,167.18541993962785,166.24174530200114\n2013-09-23,170.64,169.4,169.94,170.5,173.6,-173.6,167.82687794566507,167.82687794566507,167.82687794566507,167.05115331878102\n2013-09-24,170.52,169.21,169.57,169.92,173.516,-173.516,168.40419015109856,168.40419015109856,168.40419015109856,167.7715264537151\n2013-09-25,169.93,168.9,169.11,169.61,173.34376,-173.34376,-173.6,-173.6,-173.6,168.41265854380643\n2013-09-26,170.17,169.05,169.69,169.32,173.0771344,-173.0771344,-173.459,-173.459,-173.459,168.9\n2013-09-27,169.14,168.47,168.95,168.85,172.826506336,-172.826506336,-173.32223,-173.32223,-173.32223,-177.072\n2013-09-30,168.54,167.15,168.1,167.46,172.47798582912,-172.47798582912,-173.07961849999998,-173.07961849999998,-173.07961849999998,-176.81394\n2013-10-01,169.5,168.0,169.4,168.15,171.945187246208,-171.945187246208,-172.664545205,-172.664545205,-172.664545205,-176.330743\n2013-10-02,169.21,167.83,169.11,168.34,171.46566852158722,-171.46566852158722,-172.27852704065,-172.27852704065,-172.27852704065,-175.87170585\n2013-10-03,168.94,166.84,167.62,168.77,171.0341016694285,-171.0341016694285,-171.9195301478045,-171.9195301478045,-171.9195301478045,-175.43562055750002\n2013-10-04,169.06,167.53,168.89,167.74,170.53080946909708,-170.53080946909708,-171.4623724345021,-171.4623724345021,-171.4623724345021,-174.833927118475\n2013-10-07,168.45,167.25,167.42,167.43,170.08791233280542,-170.08791233280542,-171.04635891539692,-171.04635891539692,-171.04635891539692,-174.27435222018175\n2013-10-08,167.62,165.37,165.48,167.45,169.69816285286876,-169.69816285286876,-170.6677866130112,-170.6677866130112,-170.6677866130112,-173.75394756476902\n2013-10-09,166.2,164.53,165.57,165.82,169.09222005346714,-169.09222005346714,-170.08503008557997,-170.08503008557997,-170.08503008557997,-172.9993922839398\n2013-10-10,169.24,167.23,169.24,167.32,164.53,164.53,-169.36287617445458,-169.36287617445458,-169.36287617445458,-172.06775913270644\n2013-10-11,170.32,168.77,170.3,168.9,164.53,164.53,164.53,164.53,164.53,-171.23860562810873\n2013-10-14,171.07,169.08,171.04,169.24,164.7616,164.7616,164.6458,164.6458,164.6458,161.2394\n2013-10-15,171.15,169.47,169.72,170.52,165.14010399999998,165.14010399999998,164.838526,164.838526,164.838526,161.43601199999998\n2013-10-16,172.16,170.64,172.05,170.72,165.62089568,165.62089568,165.09098496000001,165.09098496000001,165.09098496000001,161.72743163999996\n2013-10-17,173.32,171.34,173.27,171.38,166.274806112,166.274806112,165.444435712,165.444435712,165.444435712,162.14473437439997\n2013-10-18,174.51,173.51,174.36,173.85,167.12022937856,167.12022937856,165.91696956928,165.91696956928,165.91696956928,162.70349765567997\n2013-10-21,174.75,174.01,174.45,174.47,168.1547972655616,168.1547972655616,166.51848169943042,166.51848169943042,166.51848169943042,163.41188779633916\n2013-10-22,175.93,174.66,175.35,174.94,169.21002970307174,169.21002970307174,167.177003163476,167.177003163476,167.177003163476,164.20555565059541\n2013-10-23,174.89,173.97,174.62,174.8,170.41962435651882,170.41962435651882,167.96477287876317,167.96477287876317,167.96477287876317,165.14351119854777\n2013-10-24,175.37,174.51,175.24,174.89,171.41149197234543,171.41149197234543,168.6816433196745,168.6816433196745,168.6816433196745,166.00643030266394\n2013-10-25,175.96,175.17,175.93,175.51,172.22482341732325,172.22482341732325,169.3339954209038,169.3339954209038,169.3339954209038,166.80031587845082\n2013-10-28,176.47,175.7,176.24,175.9,172.9718587338586,172.9718587338586,169.99659587881342,169.99659587881342,169.99659587881342,167.62468744939025\n2013-10-29,177.22,176.38,177.22,176.64,173.67148698708687,173.67148698708687,170.70867033214395,170.70867033214395,170.70867033214395,168.50921870445123\n2013-10-30,177.51,175.66,176.33,177.37,174.3811895896695,174.3811895896695,171.49002989228669,171.49002989228669,171.49002989228669,169.4674046469616\n2013-10-31,176.89,175.53,175.73,176.18,175.0069516717356,175.0069516717356,172.2726260062894,172.2726260062894,172.2726260062894,170.4325160893262\n2013-11-01,176.6,175.22,176.14,176.05,177.51,-177.51,172.9534846254718,172.9534846254718,172.9534846254718,171.28181415860706\n2013-11-04,176.9,176.15,176.86,176.71,177.4642,-177.4642,173.54583162416046,173.54583162416046,173.54583162416046,172.02919645957422\n2013-11-05,176.75,175.57,176.28,176.16,177.419316,-177.419316,174.06117351301958,174.06117351301958,174.06117351301958,172.6868928844253\n2013-11-06,177.5,176.54,177.18,177.06,175.22,175.22,174.50952095632704,174.50952095632704,174.50952095632704,173.26566573829427\n2013-11-07,177.64,174.76,174.97,177.52,177.64,-177.64,-177.64,-177.64,-177.64,173.77498584969896\n2013-11-08,177.31,174.85,177.31,174.85,177.64,-177.64,-177.64,-177.64,-177.64,174.2774376892381\n2013-11-11,177.53,176.91,177.29,177.14,177.64,-177.64,-177.64,-177.64,-177.64,174.71457078963715\n2013-11-12,177.36,176.37,176.98,176.94,177.58239999999998,-177.58239999999998,-177.5536,-177.5536,-177.5536,174.85\n2013-11-13,178.4,176.09,178.32,176.11,174.76,174.76,174.76,174.76,174.76,175.21269999999998\n2013-11-14,179.42,178.25,179.32,178.53,174.8328,174.8328,174.8328,174.8328,174.8328,175.658922\n2013-11-15,180.12,179.33,180.12,179.54,175.016288,175.016288,174.970416,174.970416,174.970416,176.09\n2013-11-18,180.5,179.02,179.5,180.39,175.32251072,175.32251072,175.17639936,175.17639936,175.17639936,176.7348\n2013-11-19,179.87,178.72,179.03,179.34,175.7367098624,175.7367098624,175.442579392,175.442579392,175.442579392,177.374884\n2013-11-20,179.93,177.98,178.51,179.41,176.11777307340802,176.11777307340802,175.6954504224,175.6954504224,175.6954504224,177.90615372000002\n2013-11-21,180.05,178.86,179.97,178.98,176.46835122753538,176.46835122753538,175.93567790128,175.93567790128,175.93567790128,177.98\n2013-11-22,180.83,179.77,180.81,179.96,176.79088312933254,176.79088312933254,176.163894006216,176.163894006216,176.163894006216,177.98\n2013-11-25,181.17,180.37,180.71,181.14,177.19479481639928,177.19479481639928,176.44386036584305,176.44386036584305,176.44386036584305,178.493\n2013-11-26,181.22,180.41,180.64,180.75,177.67181943843136,177.67181943843136,176.77469014023404,176.77469014023404,176.77469014023404,179.00163\n2013-11-27,181.24,180.65,181.12,180.88,178.16856471705097,178.16856471705097,177.13031492901533,177.13031492901533,177.13031492901533,179.445304\n2013-11-29,181.75,180.8,180.93,181.34,178.6599943623228,178.6599943623228,177.50018658540395,177.50018658540395,177.50018658540395,179.82219016\n2013-12-02,181.43,180.25,180.54,181.13,179.2161953771047,179.2161953771047,177.92516792686357,177.92516792686357,177.92516792686357,180.2463083248\n2013-12-03,180.39,179.17,179.85,179.95,181.75,-181.75,178.3076511341772,178.3076511341772,178.3076511341772,-185.385\n2013-12-04,180.48,178.35,179.67,179.21,181.6984,-181.6984,-181.75,-181.75,-181.75,-185.19854999999998\n2013-12-05,179.74,178.78,179.01,179.42,181.564464,-181.564464,-181.648,-181.648,-181.648,-184.85612249999997\n2013-12-06,181.11,180.16,180.95,180.73,181.43588544,-181.43588544,-181.54906,-181.54906,-181.54906,-184.53081637499997\n2013-12-09,181.67,181.16,181.4,181.48,178.35,178.35,178.35,178.35,178.35,-184.22177555624998\n2013-12-10,181.36,180.64,180.75,180.96,178.41639999999998,178.41639999999998,178.41639999999998,178.41639999999998,178.41639999999998,-183.9281867784375\n2013-12-11,180.85,178.5,178.72,180.81,178.48147199999997,178.48147199999997,178.48147199999997,178.48147199999997,178.48147199999997,-183.64927743951563\n2013-12-12,178.86,177.76,178.13,178.64,181.67,-181.67,-181.67,-181.67,-181.67,-183.38431356753983\n2013-12-13,178.66,177.77,178.11,178.47,181.59179999999998,-181.59179999999998,-181.5527,-181.5527,-181.5527,-182.99061161781205\n2013-12-16,179.81,178.9,179.22,178.92,181.51516399999997,-181.51516399999997,-181.438919,-181.438919,-181.438919,-182.6244688045652\n2013-12-17,179.41,178.25,178.54,179.37,181.44006071999996,-181.44006071999996,-181.32855143,-181.32855143,-181.32855143,-182.28395598824562\n2013-12-18,181.73,177.33,181.7,178.94,177.33,177.33,177.33,177.33,177.33,-181.96727906906844\n2013-12-19,181.7,180.72,181.5,181.2,177.33,177.33,177.33,177.33,177.33,-181.73\n2013-12-20,181.99,180.66,181.58,180.67,177.33,177.33,177.33,177.33,177.33,173.7834\n2013-12-23,182.64,182.07,182.54,182.41,177.5164,177.5164,177.46980000000002,177.46980000000002,177.46980000000002,173.947532\n2013-12-24,183.0,182.53,182.93,182.57,177.823816,177.823816,177.67660800000002,177.67660800000002,177.67660800000002,174.20830604\n2013-12-26,183.96,183.33,183.84,183.37,178.23791072,178.23791072,177.94277760000003,177.94277760000003,177.94277760000003,174.5599737984\n2013-12-27,184.18,183.66,183.84,184.16,178.810119648,178.810119648,178.30381094400002,178.30381094400002,178.30381094400002,175.02997510848\n2013-12-30,184.02,183.58,183.82,183.92,179.45450529024,179.45450529024,178.71514417792002,178.71514417792002,178.71514417792002,175.5789766019712\n2013-12-31,184.68,183.93,184.67,184.12,180.0215646554112,180.0215646554112,179.09768408546563,179.09768408546563,179.09768408546563,176.09503800585293\n2014-01-02,184.06,182.48,182.92,183.91,180.67374560365363,180.67374560365363,179.54426935862838,179.54426935862838,179.54426935862838,176.69598534544323\n2014-01-03,183.6,182.63,182.88,183.24,181.23462121914213,181.23462121914213,179.95512780993812,179.95512780993812,179.95512780993812,177.2548663712622\n2014-01-06,183.56,182.08,182.36,183.52,181.71697424846224,181.71697424846224,180.33311758514307,180.33311758514307,180.33311758514307,177.77462572527386\n2014-01-07,183.79,182.96,183.43,183.12,182.08,182.08,180.68086817833162,180.68086817833162,180.68086817833162,178.2580019245047\n2014-01-08,183.83,182.9,183.52,183.46,182.08,182.08,181.0007987240651,181.0007987240651,181.0007987240651,178.70754178978936\n2014-01-09,184.14,182.8,183.64,184.1,182.44400000000002,182.44400000000002,181.2951348261399,181.2951348261399,181.2951348261399,179.12561386450412\n2014-01-10,184.21,183.01,184.14,183.96,182.75704000000002,182.75704000000002,181.5659240400487,181.5659240400487,181.5659240400487,179.51442089398884\n2014-01-13,184.18,181.34,181.66,183.69,184.68,-184.68,-184.68,-184.68,-184.68,179.87601143140964\n2014-01-14,183.77,181.95,183.72,182.27,184.6132,-184.6132,-184.5798,-184.5798,-184.5798,180.21229063121098\n2014-01-15,184.94,184.01,184.69,184.1,181.34,181.34,181.34,181.34,181.34,180.5250302870262\n2014-01-16,184.5,183.84,184.39,184.3,181.412,181.412,181.412,181.412,181.412,180.87822786406412\n2014-01-17,184.45,183.33,183.65,184.1,181.48256,181.48256,181.48256,181.48256,181.48256,181.20316963493897\n2014-01-21,184.77,183.05,184.18,184.72,181.5517088,181.5517088,181.5517088,181.5517088,181.5517088,181.50211606414385\n2014-01-22,184.57,183.91,184.3,184.51,181.619474624,181.619474624,181.619474624,181.619474624,181.619474624,181.77714677901233\n2014-01-23,183.4,181.83,182.79,183.35,181.68588513152,181.68588513152,181.68588513152,181.68588513152,181.68588513152,-188.6388\n2014-01-24,181.65,178.83,178.83,181.57,184.94,-184.94,-184.94,-184.94,-184.94,-188.434536\n2014-01-27,179.51,177.13,178.01,179.05,184.8178,-184.8178,-184.7567,-184.7567,-184.7567,-187.9543092\n2014-01-28,179.3,178.13,179.1,178.25,184.510288,-184.510288,-184.375365,-184.375365,-184.375365,-187.196607556\n2014-01-29,178.55,176.88,177.28,177.62,184.21507648,-184.21507648,-184.01309675,-184.01309675,-184.01309675,-186.49194502708\n2014-01-30,179.81,178.26,179.23,178.88,183.77497189119998,-183.77497189119998,-183.51377997749998,-183.51377997749998,-183.51377997749998,-185.6268699746428\n2014-01-31,179.29,176.92,178.18,177.02,183.36127357772799,-183.36127357772799,-183.049415379075,-183.049415379075,-183.049415379075,-184.83965167692494\n2014-02-03,178.37,173.83,174.15,177.94,182.9723971630643,-182.9723971630643,-182.61755630253973,-182.61755630253973,-182.61755630253973,-184.1232830260017\n2014-02-04,175.84,174.34,175.36,174.94,182.24100539001915,-182.24100539001915,-181.82667623531114,-181.82667623531114,-181.82667623531114,-182.99102189314152\n2014-02-05,175.56,173.71,175.17,174.78,181.56812495881763,-181.56812495881763,-181.10697537413313,-181.10697537413313,-181.10697537413313,-181.98330948489595\n2014-02-06,177.48,175.58,177.48,175.61,180.78231246293586,-180.78231246293586,-180.29330808297848,-180.29330808297848,-180.29330808297848,-180.9077792518595\n2014-02-07,179.87,177.74,179.74,178.28,180.07508121664227,-180.07508121664227,173.71,173.71,173.71,-179.97206794911776\n2014-02-10,180.07,179.21,180.01,179.71,173.71,173.71,173.8332,173.8332,173.8332,170.2358\n2014-02-11,182.44,180.07,181.98,180.23,173.8372,173.8372,174.020304,174.020304,174.020304,170.43248400000002\n2014-02-12,182.83,181.71,182.16,182.26,174.181312,174.181312,174.35709184,174.35709184,174.35709184,170.79270948\n2014-02-13,183.2,180.83,183.0,180.87,174.70023328,174.70023328,174.780737248,174.780737248,174.780737248,171.2742011008\n2014-02-14,184.36,182.68,184.01,182.9,175.3802146176,175.3802146176,175.28589301312002,175.28589301312002,175.28589301312002,171.87049104576002\n2014-02-18,184.49,183.65,184.26,184.2,176.27819315584,176.27819315584,175.92108050220162,175.92108050220162,175.92108050220162,172.61986158301443\n2014-02-19,184.95,182.87,183.05,183.78,177.2636099771392,177.2636099771392,176.6065940620255,176.6065940620255,176.6065940620255,173.4507712722034\n2014-02-20,184.52,182.62,184.1,183.3,178.3397045803397,178.3397045803397,177.3575005964432,177.3575005964432,177.3575005964432,174.37070957042712\n2014-02-21,184.89,183.8,183.96,184.42,179.26514593909215,179.26514593909215,178.04082554276332,178.04082554276332,178.04082554276332,175.21705280479296\n2014-02-24,186.15,184.21,184.91,184.3,180.06102550761923,180.06102550761923,178.6626512439146,178.6626512439146,178.6626512439146,175.9956885804095\n2014-02-25,185.58,184.23,184.84,185.03,181.03526142640015,181.03526142640015,179.41138611952314,179.41138611952314,179.41138611952314,176.90957660817264\n2014-02-26,185.6,184.33,184.85,185.1,181.85361959817612,181.85361959817612,180.08524750757084,180.08524750757084,180.08524750757084,177.7412147134371\n2014-02-27,185.87,184.38,185.87,184.58,182.54104046246795,182.54104046246795,180.69172275681376,180.69172275681376,180.69172275681376,178.49800538922776\n2014-02-28,187.15,185.05,186.3,185.78,183.11847398847308,183.11847398847308,181.2375504811324,181.2375504811324,181.2375504811324,179.18668490419725\n2014-03-03,185.45,183.75,184.98,184.65,187.15,-187.15,181.88791992820782,181.88791992820782,181.88791992820782,179.98301641377753\n2014-03-04,187.98,186.75,187.58,186.81,183.75,183.75,182.46674873610496,182.46674873610496,182.46674873610496,180.69971477239977\n2014-03-05,188.07,187.45,187.61,187.75,183.75,183.75,183.12833888777237,183.12833888777237,183.12833888777237,181.50054614743578\n2014-03-06,188.61,187.89,188.21,188.22,183.9228,183.9228,183.77075483236197,183.77075483236197,183.77075483236197,182.2888806097435\n2014-03-07,188.96,187.43,188.26,188.96,184.20403199999998,184.20403199999998,184.4482491558313,184.4482491558313,184.4482491558313,183.11062613047685\n2014-03-10,188.23,187.08,188.21,187.99,184.58450943999998,184.58450943999998,185.1250117824566,185.1250117824566,185.1250117824566,183.92953847221008\n2014-03-11,188.7,186.8,187.23,188.48,184.93454868479998,184.93454868479998,185.7002600150881,185.7002600150881,185.7002600150881,184.63380308610067\n2014-03-12,187.35,185.9,187.28,186.32,185.25658479001598,185.25658479001598,-188.96,-188.96,-188.96,185.23947065404658\n2014-03-13,187.99,184.66,185.18,187.88,188.96,-188.96,-188.8682,-188.8682,-188.8682,-192.7392\n2014-03-14,185.79,184.44,184.66,184.8,188.874,-188.874,-188.65779,-188.65779,-188.65779,-192.496824\n2014-03-17,186.77,185.52,186.33,185.62,188.69664,-188.69664,-188.3625447,-188.3625447,-188.3625447,-192.0939828\n2014-03-18,187.91,186.51,187.66,186.74,188.5263744,-188.5263744,-188.087966571,-188.087966571,-188.087966571,-191.71128366\n2014-03-19,187.94,185.48,186.66,187.71,188.362919424,-188.362919424,184.44,184.44,184.44,-191.347719477\n2014-03-20,187.89,185.92,187.75,186.25,188.20600264704,-188.20600264704,184.51,184.51,184.51,-191.00233350315\n2014-03-21,188.17,186.03,186.19,187.69,184.44,184.44,184.5786,184.5786,184.5786,-190.6742168279925\n2014-03-24,187.07,184.62,185.4,186.84,184.5146,184.5146,-188.17,-188.17,-188.17,-190.36250598659288\n2014-03-25,186.94,185.27,186.31,186.4,184.587708,184.587708,-188.17,-188.17,-188.17,-190.06638068726323\n2014-03-26,187.34,184.95,184.97,187.0,184.62,184.62,-188.06349999999998,-188.06349999999998,-188.06349999999998,-189.78506165290008\n2014-03-27,185.34,183.91,184.58,184.77,188.17,-188.17,-187.96019499999997,-187.96019499999997,-187.96019499999997,-189.51780857025508\n2014-03-28,186.42,185.0,185.5,185.14,188.0848,-188.0848,-187.75768524999998,-187.75768524999998,-187.75768524999998,-189.12526197033722\n2014-03-31,187.3,186.47,187.04,186.66,188.001304,-188.001304,-187.5653009875,-187.5653009875,-187.5653009875,-188.7601936324136\n2014-04-01,188.36,187.45,188.27,187.65,183.91,183.91,183.91,183.91,183.91,-188.42068007814464\n2014-04-02,189.13,188.14,188.86,188.5,183.999,183.999,183.999,183.999,183.999,180.2318\n2014-04-03,189.21,188.06,188.6,189.13,184.20424,184.20424,184.15293,184.15293,184.15293,180.409764\n2014-04-04,189.7,186.1,186.38,189.64,184.5045856,184.5045856,184.3552128,184.3552128,184.3552128,180.67377108\n2014-04-07,186.26,183.96,184.34,185.9,189.7,-189.7,-189.7,-189.7,-189.7,181.0348202368\n2014-04-08,185.4,183.59,185.13,184.18,189.7,-189.7,-189.7,-189.7,-189.7,181.381427427328\n2014-04-09,187.15,185.08,187.15,185.61,189.45559999999998,-189.45559999999998,-189.3945,-189.3945,-189.3945,181.71417033023488\n2014-04-10,187.17,182.94,183.17,187.07,189.22097599999998,-189.22097599999998,-189.104275,-189.104275,-189.104275,182.03360351702548\n2014-04-11,183.42,181.31,181.48,182.16,188.84411744,-188.84411744,-188.67277575,-188.67277575,-188.67277575,-193.494\n2014-04-14,183.37,181.45,182.94,182.92,188.2413880448,-188.2413880448,-188.0101259325,-188.0101259325,-188.0101259325,-193.12848\n2014-04-15,184.33,181.52,184.24,183.33,187.686877001216,-187.686877001216,-187.407114598575,-187.407114598575,-187.407114598575,-192.77392559999998\n2014-04-16,186.14,184.65,186.14,185.49,187.17672684111872,-187.17672684111872,-186.85837428470325,-186.85837428470325,-186.85837428470325,-192.43000783199997\n2014-04-17,186.91,185.56,186.39,185.87,181.31,181.31,181.31,181.31,181.31,-192.09640759703998\n2014-04-21,187.1,186.21,187.04,186.45,181.422,181.422,181.422,181.422,181.422,-191.77281536912878\n2014-04-22,188.4,187.13,187.89,187.24,181.64912,181.64912,181.59234,181.59234,181.59234,-191.45893090805492\n2014-04-23,187.92,187.3,187.44,187.8,182.0541728,182.0541728,181.8646464,181.8646464,181.8646464,-191.15446298081326\n2014-04-24,188.39,186.93,187.81,188.39,182.434922432,182.434922432,182.126060544,182.126060544,182.126060544,-190.85912909138887\n2014-04-25,187.33,185.87,186.29,187.2,182.79282708608,182.79282708608,182.37701812224,182.37701812224,182.37701812224,-190.5726552186472\n2014-04-28,187.69,184.97,186.88,187.08,183.1292574609152,183.1292574609152,182.6179373973504,182.6179373973504,182.6179373973504,-190.2947755620878\n2014-04-29,188.04,187.08,187.7,187.48,183.4455020132603,183.4455020132603,182.8492199014564,182.8492199014564,182.8492199014564,-190.02523229522518\n2014-04-30,188.5,187.18,188.43,187.46,183.74277189246467,183.74277189246467,183.07125110539815,183.07125110539815,183.07125110539815,-189.76377532636843\n2014-05-01,188.84,187.73,188.29,188.25,184.1233501410675,184.1233501410675,183.34268855012823,183.34268855012823,183.34268855012823,-189.51016206657738\n2014-05-02,189.14,187.79,188.06,188.33,184.59501512696076,184.59501512696076,183.67252723712053,183.67252723712053,183.67252723712053,-189.26415720458004\n2014-05-05,188.55,186.63,188.44,187.16,185.14041331172547,185.14041331172547,184.05525033052209,184.05525033052209,184.05525033052209,-189.14\n2014-05-06,188.13,186.74,186.81,188.03,185.62036371431842,185.62036371431842,184.41118280738553,184.41118280738553,184.41118280738553,-189.14\n2014-05-07,187.97,186.02,187.89,187.41,189.14,-189.14,184.74220001086854,184.74220001086854,184.74220001086854,-188.90509999999998\n2014-05-08,189.04,187.08,187.7,187.71,189.0776,-189.0776,185.05004601010774,185.05004601010774,185.05004601010774,177.6838\n2014-05-09,188.04,186.83,188.0,187.71,189.04,-189.04,185.3363427894002,185.3363427894002,185.3363427894002,177.910924\n2014-05-12,189.88,188.75,189.81,188.77,186.02,186.02,185.60259879414218,185.60259879414218,185.60259879414218,178.13350552\n2014-05-13,190.42,189.78,189.96,190.0,186.09720000000002,186.09720000000002,185.94479089061082,185.94479089061082,185.94479089061082,178.4859003544\n2014-05-14,189.88,188.79,189.04,189.82,186.270112,186.270112,186.34755971045584,186.34755971045584,186.34755971045584,178.96326434022401\n2014-05-15,188.72,186.48,187.4,188.68,186.43610752,186.43610752,-190.42,-190.42,-190.42,179.42153376661506\n2014-05-16,188.13,186.72,188.11,187.5,186.48,186.48,-190.3018,-190.3018,-190.3018,179.86147241595046\n2014-05-19,188.89,187.52,188.7,187.7,186.48,186.48,-190.18714599999998,-190.18714599999998,-190.18714599999998,180.28381351931245\n2014-05-20,188.67,187.07,187.55,188.67,186.6376,186.6376,-190.07593161999998,-190.07593161999998,-190.07593161999998,180.68926097853995\n2014-05-21,189.22,188.06,189.13,188.1,186.788896,186.788896,-189.96805367139999,-189.96805367139999,-189.96805367139999,181.07849053939836\n2014-05-22,189.98,188.86,189.6,189.2,186.93414016,186.93414016,186.48,186.48,186.48,181.45215091782242\n2014-05-23,190.48,189.68,190.38,189.76,187.0735745536,187.0735745536,186.54999999999998,186.54999999999998,186.54999999999998,181.81086488110952\n2014-05-27,191.58,190.95,191.57,191.06,187.277960080384,187.277960080384,186.66789999999997,186.66789999999997,186.66789999999997,182.24432163705404\n2014-05-28,191.82,191.06,191.38,191.55,187.62212327395326,187.62212327395326,186.86438399999997,186.86438399999997,186.86438399999997,182.8044623388308\n2014-05-29,192.4,191.34,192.4,191.85,188.04191094655795,188.04191094655795,187.11216479999996,187.11216479999996,187.11216479999996,183.43554997511265\n2014-05-30,192.8,192.04,192.63,192.21,188.564881632971,188.564881632971,187.42943491199998,187.42943491199998,187.42943491199998,184.15270597710364\n2014-06-02,192.99,191.97,192.91,192.98,189.15779820435506,189.15779820435506,187.80537446815998,187.80537446815998,187.80537446815998,184.93096243916432\n2014-06-03,192.9,192.26,192.81,192.43,189.77095049165825,189.77095049165825,188.22014451070717,188.22014451070717,188.22014451070717,185.7368661952479\n2014-06-04,193.3,192.27,193.19,192.48,190.28599841299294,190.28599841299294,188.6017329498506,188.6017329498506,188.6017329498506,186.4621795757231\n2014-06-05,194.65,192.7,194.46,193.43,190.82851869865422,190.82851869865422,189.02457698436405,189.02457698436405,189.02457698436405,187.21433982239355\n2014-06-06,195.43,194.78,195.41,194.88,191.59281495892338,191.59281495892338,189.58711928592766,189.58711928592766,189.58711928592766,188.10661904370633\n2014-06-09,196.05,195.17,195.57,195.36,192.3602519671387,192.3602519671387,190.2298361644756,190.2298361644756,190.2298361644756,189.0586585680245\n2014-06-10,195.6,194.92,195.59,195.36,193.09820157371098,193.09820157371098,190.92825582473853,190.92825582473853,190.92825582473853,190.03744636850107\n2014-06-11,195.11,194.48,194.92,194.87,193.68856125896878,193.68856125896878,191.5428651257699,191.5428651257699,191.5428651257699,190.8792038769109\n2014-06-12,194.8,193.11,193.54,194.68,196.05,-196.05,192.08372131067753,192.08372131067753,192.08372131067753,191.60311533414338\n2014-06-13,194.32,193.3,194.16,193.89,195.99120000000002,-195.99120000000002,192.55967475339622,192.55967475339622,192.55967475339622,192.2256791873633\n2014-06-16,194.7,193.66,194.29,193.88,195.93357600000002,-195.93357600000002,192.97851378298867,192.97851378298867,192.97851378298867,192.76108410113244\n2014-06-17,194.97,193.81,194.83,194.0,195.87710448,-195.87710448,193.3,193.3,193.3,193.2215323269739\n2014-06-18,196.37,194.4,196.26,194.83,193.11,193.11,193.63000000000002,193.63000000000002,193.63000000000002,193.61751780119755\n2014-06-19,196.6,195.8,196.48,196.46,193.17520000000002,193.17520000000002,193.81,193.81,193.81,193.81\n2014-06-20,196.06,195.71,195.94,196.0,193.312192,193.312192,194.2006,194.2006,194.2006,194.2564\n2014-06-23,196.05,195.52,195.88,196.0,193.44370432000002,193.44370432000002,194.536516,194.536516,194.536516,194.63137600000002\n2014-06-24,196.5,194.48,194.71,195.52,193.56995614720003,193.56995614720003,-196.6,-196.6,-196.6,-200.53199999999998\n2014-06-25,195.78,194.25,195.58,194.28,193.69115790131204,193.69115790131204,-196.5364,-196.5364,-196.5364,-200.35044\n2014-06-26,195.63,194.13,195.45,195.6,193.80751158525956,193.80751158525956,-196.5,-196.5,-196.5,-200.04541799999998\n2014-06-27,195.88,194.89,195.79,195.01,193.91921112184917,193.91921112184917,-196.3341,-196.3341,-196.3341,-199.63133874\n2014-06-30,196.17,195.53,195.72,195.71,194.0264426769752,194.0264426769752,-196.179813,-196.179813,-196.179813,-199.24624502819998\n2014-07-01,197.63,196.13,197.06,196.21,194.1293849698962,194.1293849698962,194.13,194.13,194.13,-198.88810787622597\n2014-07-02,197.48,196.96,197.22,197.03,194.33942187170243,194.33942187170243,194.2,194.2,194.2,-198.55504032489014\n2014-07-03,198.29,197.65,198.25,197.81,194.5368565594003,194.5368565594003,194.2686,194.2686,194.2686,190.2474\n2014-07-07,197.98,197.22,197.51,197.84,194.83710803464828,194.83710803464828,194.389242,194.389242,194.389242,190.408252\n2014-07-08,197.22,195.76,196.28,197.12,195.11333939187642,195.11333939187642,194.50626474,194.50626474,194.50626474,190.56588696\n2014-07-09,197.3,196.31,197.12,196.75,195.3674722405263,195.3674722405263,194.6197767978,194.6197767978,194.6197767978,190.7203692208\n2014-07-10,196.86,195.06,196.35,195.24,198.29,-198.29,194.729883493866,194.729883493866,194.729883493866,190.871761836384\n2014-07-11,196.75,195.79,196.6,196.24,198.22539999999998,-198.22539999999998,194.83668698905,194.83668698905,194.83668698905,191.02012659965632\n2014-07-14,197.86,197.44,197.6,197.63,198.16209199999997,-198.16209199999997,194.9402863793785,194.9402863793785,194.9402863793785,191.1655240676632\n2014-07-15,198.1,196.37,197.23,197.73,198.10005015999997,-198.10005015999997,195.04077778799714,195.04077778799714,195.04077778799714,191.30801358630993\n2014-07-16,198.26,197.42,197.96,198.13,195.06,195.06,195.13825445435722,195.13825445435722,195.13825445435722,191.44765331458373\n2014-07-17,198.1,195.43,195.71,197.32,195.124,195.124,195.2328068207265,195.2328068207265,195.2328068207265,191.58450024829204\n2014-07-18,197.91,196.24,197.74,196.38,195.18672,195.18672,195.3245226161047,195.3245226161047,195.3245226161047,191.7186102433262\n2014-07-21,197.5,196.43,197.34,197.08,195.2481856,195.2481856,195.41348693762157,195.41348693762157,195.41348693762157,191.85003803845967\n2014-07-22,198.56,197.87,198.2,198.04,195.308421888,195.308421888,195.49978232949292,195.49978232949292,195.49978232949292,191.97883727769047\n2014-07-23,198.85,198.1,198.64,198.51,195.43848501248,195.43848501248,195.6221910363132,195.6221910363132,195.6221910363132,192.17627215935977\n2014-07-24,199.06,198.45,198.65,198.82,195.6431759117312,195.6431759117312,195.78358148449755,195.78358148449755,195.78358148449755,192.44322127298537\n2014-07-25,198.26,197.33,197.74,198.11,195.9165218387927,195.9165218387927,195.9801665954277,195.9801665954277,195.9801665954277,192.7740602093361\n2014-07-28,198.09,196.62,197.8,197.78,196.1680000916893,196.1680000916893,196.16495659970204,196.16495659970204,196.16495659970204,193.08835719886932\n2014-07-29,198.45,196.93,196.93,198.21,196.39936008435416,196.39936008435416,196.3386592037199,196.3386592037199,196.3386592037199,193.38693933892586\n2014-07-30,197.91,196.16,196.98,197.66,199.06,-199.06,-199.06,-199.06,-199.06,193.67059237197955\n2014-07-31,195.78,193.04,193.09,195.63,199.002,-199.002,-198.973,-198.973,-198.973,-203.0412\n2014-08-01,193.75,191.58,192.48,192.58,198.76352,-198.76352,-198.67635,-198.67635,-198.67635,-202.741164\n2014-08-04,194.3,192.05,193.88,192.91,198.3325088,-198.3325088,-198.1796055,-198.1796055,-198.1796055,-202.1831058\n2014-08-05,193.6,191.32,192.01,193.11,197.927358272,-197.927358272,-197.717633115,-197.717633115,-197.717633115,-201.65295050999998\n2014-08-06,192.89,191.08,192.07,191.08,197.39876961023998,-197.39876961023998,-197.14184613465002,-197.14184613465002,-197.14184613465002,-200.92964397429998\n2014-08-07,193.12,190.55,190.99,192.96,196.76689264921598,-196.76689264921598,-196.47504305983853,-196.47504305983853,-196.47504305983853,-200.043176016613\n2014-08-08,193.37,190.95,193.24,191.43,196.02086553131005,-196.02086553131005,-195.70478746205953,-195.70478746205953,-195.70478746205953,-198.99892665478555\n2014-08-11,194.66,193.71,193.8,193.99,195.36436166755286,-195.36436166755286,-195.0346650919918,-195.0346650919918,-195.0346650919918,-198.06954472275913\n2014-08-12,194.15,192.94,193.54,193.63,194.7866382674465,-194.7866382674465,-194.66,-194.66,-194.66,-197.24239480325562\n2014-08-13,195.06,193.96,194.89,194.3,190.55,190.55,190.55,190.55,190.55,-196.5062313748975\n2014-08-14,195.76,194.98,195.76,195.19,190.64020000000002,190.64020000000002,190.64020000000002,190.64020000000002,190.64020000000002,-195.85104592365877\n2014-08-15,196.65,194.32,195.71,196.49,190.84499200000002,190.84499200000002,190.79379400000002,190.79379400000002,190.79379400000002,186.739\n2014-08-18,197.45,196.69,197.32,196.81,191.19329248000003,191.19329248000003,191.02804224000002,191.02804224000002,191.02804224000002,186.93722\n2014-08-19,198.54,197.65,198.39,197.85,191.69382908160003,191.69382908160003,191.34914012800002,191.34914012800002,191.34914012800002,187.2526034\n2014-08-20,199.16,198.08,198.92,198.15,192.37844617344,192.37844617344,191.78059172032002,191.78059172032002,191.78059172032002,187.704099264\n2014-08-21,199.76,198.93,199.5,199.06,193.1922326326272,193.1922326326272,192.29715029989762,192.29715029989762,192.29715029989762,188.2768943008\n2014-08-22,199.69,198.74,199.19,199.32,194.1117200640594,194.1117200640594,192.8941782759058,192.8941782759058,192.8941782759058,188.96588064275198\n2014-08-25,200.53,199.86,200.2,200.15,194.9024792550911,194.9024792550911,193.44344401383333,193.44344401383333,193.44344401383333,189.61352780418687\n2014-08-26,200.82,200.28,200.33,200.35,195.8028825742765,195.8028825742765,194.08123405258834,194.08123405258834,194.08123405258834,190.37768085789378\n2014-08-27,200.57,199.94,200.25,200.45,196.70596371090673,196.70596371090673,194.7551106473295,194.7551106473295,194.7551106473295,191.21306638926228\n2014-08-28,200.26,199.39,200.14,199.59,197.44649024294353,197.44649024294353,195.36159958259654,195.36159958259654,195.36159958259654,191.9816210781213\n2014-08-29,200.73,199.82,200.71,200.44,198.05372199921368,198.05372199921368,195.9074396243369,195.9074396243369,195.9074396243369,192.6886913918716\n2014-09-02,201.0,199.86,200.61,200.99,198.55165203935522,198.55165203935522,196.3986956619032,196.3986956619032,196.3986956619032,193.33919608052187\n2014-09-03,201.41,200.22,200.5,201.35,199.04132163148418,199.04132163148418,196.90483913909384,196.90483913909384,196.90483913909384,194.0286684332749\n2014-09-04,201.58,199.66,200.22,200.86,199.51505730518736,199.51505730518736,197.44545844240258,197.44545844240258,197.44545844240258,194.76680158994742\n2014-09-05,201.19,199.42,201.11,200.19,201.58,-201.58,197.98294884489025,197.98294884489025,197.98294884489025,195.5162534150532\n2014-09-08,201.21,200.0,200.59,200.94,201.58,-201.58,198.45056549505452,198.45056549505452,198.45056549505452,196.18326553939735\n2014-09-09,200.55,198.92,199.32,200.42,201.5368,-201.5368,198.85739198069743,198.85739198069743,198.85739198069743,196.77690633006364\n2014-09-10,200.2,198.77,200.07,199.46,201.432128,-201.432128,-201.58,-201.58,-201.58,197.30524663375664\n2014-09-11,200.33,199.12,200.3,199.28,201.27240032,-201.27240032,-201.4957,-201.4957,-201.4957,197.7754695040434\n2014-09-12,200.12,198.56,199.12,200.12,201.1222563008,-201.1222563008,-201.413929,-201.413929,-201.413929,198.19396785859863\n2014-09-15,199.31,198.38,199.02,199.17,200.917275796736,-200.917275796736,-201.27123255,-201.27123255,-201.27123255,-205.6116\n2014-09-16,200.84,198.5,200.52,198.64,198.38,198.38,-201.0688462715,-201.0688462715,-201.0688462715,-205.394652\n2014-09-17,201.68,199.75,200.75,200.8,198.38,198.38,198.38,198.38,198.38,-205.18421244\n2014-09-18,201.85,201.1,201.82,201.36,198.5,198.5,198.446,198.446,198.446,-204.9800860668\n2014-09-19,201.73,200.29,200.7,201.55,198.701,198.701,198.54812,198.54812,198.54812,-204.782083484796\n2014-09-22,200.37,198.74,199.15,200.36,201.85,-201.85,198.6471764,198.6471764,198.6471764,-204.59002098025212\n2014-09-23,199.26,197.95,198.01,198.41,201.7878,-201.7878,-201.85,-201.85,-201.85,-204.40372035084457\n2014-09-24,199.69,197.52,199.57,198.06,201.634288,-201.634288,-201.733,-201.733,-201.733,-204.08103433330234\n2014-09-25,199.05,196.32,196.33,199.05,201.38743072,-201.38743072,-201.52235000000002,-201.52235000000002,-201.52235000000002,-203.62176192997117\n2014-09-26,198.39,196.42,197.9,196.7,200.9820362624,-200.9820362624,-201.1581855,-201.1581855,-201.1581855,-202.96460335627376\n2014-09-29,197.89,196.05,197.49,196.2,200.60907336140798,-200.60907336140798,-200.819512515,-200.819512515,-200.819512515,-202.36658905420913\n2014-09-30,198.3,196.61,197.02,197.7,200.15316602526718,-200.15316602526718,-200.39025638865002,-200.39025638865002,-200.39025638865002,-201.67176425824613\n2014-10-01,196.77,193.91,194.37,196.75,199.74284942274048,-199.74284942274048,-199.99963331367152,-199.99963331367152,-199.99963331367152,-201.05337018983906\n2014-10-02,195.05,192.35,194.42,194.18,199.0429074920116,-199.0429074920116,-199.32977364916766,-199.32977364916766,-199.32977364916766,-200.12473206515998\n2014-10-03,196.94,195.08,196.52,195.71,198.10590044312997,-198.10590044312997,-198.42240307477587,-198.42240307477587,-198.42240307477587,-198.958522255386\n2014-10-06,197.6,195.59,196.3,197.36,192.35,192.35,-197.632990675055,-197.632990675055,-197.632990675055,-197.9672439170781\n2014-10-07,195.72,193.25,193.3,195.29,192.45499999999998,192.45499999999998,-197.6,-197.6,-197.6,-197.6\n2014-10-08,196.92,192.36,196.61,193.36,197.6,-197.6,-197.6,-197.6,-197.6,-197.6\n2014-10-09,196.6,192.58,192.7,196.36,197.49519999999998,-197.49519999999998,-196.92,-196.92,-196.92,-196.92\n2014-10-10,193.65,190.51,190.54,192.71,197.392496,-197.392496,-196.92,-196.92,-196.92,-196.92\n2014-10-13,191.15,187.3,187.45,190.44,197.11719616,-197.11719616,-196.6,-196.6,-196.6,-196.6\n2014-10-14,189.82,187.04,187.83,188.46,196.52816439039998,-196.52816439039998,-195.019,-195.019,-195.019,-194.833\n2014-10-15,186.88,181.92,186.43,185.19,195.76911123916798,-195.76911123916798,-193.50299,-193.50299,-193.50299,-193.19647\n2014-10-16,187.58,182.9,186.27,183.02,194.3842001152512,-194.3842001152512,-191.07056210000002,-191.07056210000002,-191.07056210000002,-190.6028819\n2014-10-17,189.75,187.62,188.47,188.48,193.13778010372607,-193.13778010372607,181.92,181.92,181.92,178.2816\n2014-10-20,190.45,188.07,190.3,188.09,192.01600209335345,-192.01600209335345,182.07659999999998,182.07659999999998,182.07659999999998,178.510968\n2014-10-21,194.2,191.48,194.07,191.7,181.92,181.92,182.327802,182.327802,182.327802,178.86913896\n2014-10-22,194.91,192.61,192.69,194.44,182.16559999999998,182.16559999999998,182.80268991999998,182.80268991999998,182.80268991999998,179.4823734016\n2014-10-23,196.2,194.26,194.93,194.64,182.67537599999997,182.67537599999997,183.40805542399997,183.40805542399997,183.40805542399997,180.25375473152\n2014-10-24,196.49,194.49,196.43,195.23,183.48685343999998,183.48685343999998,184.17557209855997,184.17557209855997,184.17557209855997,181.2105294476288\n2014-10-27,196.45,195.03,196.16,195.75,184.5271051648,184.5271051648,185.03758205166076,185.03758205166076,185.03758205166076,182.2800923862948\n2014-10-28,198.42,196.73,198.41,196.84,185.484136751616,185.484136751616,185.8392513080445,185.8392513080445,185.8392513080445,183.27478591925416\n2014-10-29,199.12,196.8,198.11,198.59,186.7777230764544,186.7777230764544,186.84571120340095,186.84571120340095,186.84571120340095,184.4864030457138\n2014-10-30,199.95,197.41,199.38,197.59,188.25879630727988,188.25879630727988,187.95039719509487,187.95039719509487,187.95039719509487,185.80342677159956\n2014-10-31,201.81,200.78,201.66,201.78,189.8955648242607,189.8955648242607,189.15035747558537,189.15035747558537,189.15035747558537,187.2180840944396\n2014-11-03,202.45,201.31,201.77,201.96,191.801874452379,191.801874452379,190.542918153271,190.542918153271,190.542918153271,188.82319484405124\n2014-11-04,201.6,200.06,201.07,201.22,193.71853705095077,193.71853705095077,191.97176797487847,191.97176797487847,191.97176797487847,190.4584114627651\n2014-11-05,202.59,201.45,202.34,202.55,195.29020038177964,195.29020038177964,193.22915581789306,193.22915581789306,193.22915581789306,191.89740208723327\n2014-11-06,203.26,201.64,203.15,202.41,196.75016030542372,196.75016030542372,194.44606556156697,194.44606556156697,194.44606556156697,193.28743981589295\n2014-11-07,203.59,202.61,203.34,203.16,198.05212824433897,198.05212824433897,195.6800163829476,195.6800163829476,195.6800163829476,194.68359824166794\n2014-11-10,204.04,203.13,203.98,203.4,199.15970259547117,199.15970259547117,196.86651392550547,196.86651392550547,196.86651392550547,196.01955850541773\n2014-11-11,204.3,203.66,204.16,204.07,200.13576207637695,200.13576207637695,198.0142716974246,198.0142716974246,198.0142716974246,197.30282914455088\n2014-11-12,204.24,203.31,203.96,203.35,200.96860966110157,200.96860966110157,199.08284550886242,199.08284550886242,199.08284550886242,198.49234818997724\n2014-11-13,204.83,203.21,204.19,204.14,201.63488772888127,201.63488772888127,199.9697617723558,199.9697617723558,199.9697617723558,199.4796489976811\n2014-11-14,204.48,203.72,204.24,204.13,202.27391018310502,202.27391018310502,200.84460465333177,200.84460465333177,200.84460465333177,200.4427121780985\n2014-11-17,204.58,203.66,204.37,203.85,202.78512814648403,202.78512814648403,201.56197581573207,201.56197581573207,201.56197581573207,201.23242398604077\n2014-11-18,205.92,204.44,205.55,204.46,203.19410251718722,203.19410251718722,202.1502201689003,202.1502201689003,202.1502201689003,201.87998766855344\n2014-11-19,205.55,204.3,205.22,205.3,203.66,203.66,202.86647833680922,202.86647833680922,202.86647833680922,202.64759001152828\n2014-11-20,205.71,204.19,205.58,204.25,204.112,204.112,203.44664745281545,203.44664745281545,203.44664745281545,203.2693479093379\n2014-11-21,207.72,205.98,206.72,207.6,204.19,204.19,203.9165844367805,203.9165844367805,203.9165844367805,203.7729718065637\n2014-11-24,207.39,206.91,207.26,207.19,204.19,204.19,204.19,204.19,204.19,204.19\n2014-11-25,207.79,206.8,207.25,207.51,204.896,204.896,204.896,204.896,204.896,204.896\n2014-11-26,207.76,207.03,207.64,207.27,205.4748,205.4748,205.50374,205.50374,205.50374,205.50374\n2014-11-28,207.87,206.91,207.2,207.5,205.93784,205.93784,205.9838546,205.9838546,205.9838546,205.9838546\n2014-12-01,206.54,205.38,205.8,206.38,207.87,-207.87,-207.87,-207.87,-207.87,-212.0274\n2014-12-02,207.34,205.79,207.09,205.8,207.87,-207.87,-207.87,-207.87,-207.87,-211.827978\n2014-12-03,208.15,207.11,207.91,207.28,205.38,205.38,205.38,205.38,205.38,-211.63453866\n2014-12-04,208.27,206.7,207.64,207.55,205.4354,205.4354,205.4354,205.4354,205.4354,-211.4469025002\n2014-12-05,208.47,207.55,208.0,207.88,205.54878399999998,205.54878399999998,205.52043799999998,205.52043799999998,205.52043799999998,-211.264895425194\n2014-12-08,208.12,205.93,206.61,207.55,205.72405695999998,205.72405695999998,205.63842047999998,205.63842047999998,205.63842047999998,-211.08834856243817\n2014-12-09,206.6,203.91,206.47,204.37,208.47,-208.47,-208.47,-208.47,-208.47,-210.91709810556503\n2014-12-10,205.98,202.93,203.16,205.94,208.3788,-208.3788,-208.3332,-208.3332,-208.3332,-210.5667432002868\n2014-12-11,206.19,203.71,204.23,203.89,208.16084800000002,-208.16084800000002,-208.06304,-208.06304,-208.06304,-210.03217117626673\n2014-12-12,203.81,200.85,200.94,202.65,207.95161408,-207.95161408,-207.806388,-207.806388,-207.806388,-209.53501919392806\n2014-12-15,202.53,198.78,199.51,202.0,207.5255172352,-207.5255172352,-207.31944084,-207.31944084,-207.31944084,-208.75336746647454\n2014-12-16,202.39,197.86,197.9,198.55,206.825875856384,-206.825875856384,-206.55089116439999,-206.55089116439999,-206.55089116439999,-207.65629704516235\n2014-12-17,202.34,198.3,201.79,198.48,205.9292882707456,-205.9292882707456,-205.594893136316,-205.594893136316,-205.594893136316,-206.38277842929125\n2014-12-18,212.97,203.93,206.84,204.78,197.86,197.86,197.86,197.86,197.86,193.9028\n2014-12-19,207.33,205.62,206.33,206.46,198.1622,198.1622,198.1622,198.1622,198.1622,194.28414400000003\n2014-12-22,207.47,206.46,207.47,206.71,198.458356,198.458356,198.458356,198.458356,198.458356,194.65786112000004\n2014-12-23,208.23,207.51,207.75,208.2,198.74858888,198.74858888,198.74858888,198.74858888,198.74858888,195.02410389760004\n2014-12-24,208.34,207.72,207.81,208.03,199.0330171024,199.0330171024,199.0330171024,199.0330171024,199.0330171024,195.38302181964804\n2014-12-26,208.84,208.25,208.44,208.29,199.311756760352,199.311756760352,199.311756760352,199.311756760352,199.311756760352,195.73476138325506\n2014-12-29,208.97,208.15,208.72,208.25,199.58492162514497,199.58492162514497,199.58492162514497,199.58492162514497,199.58492162514497,196.07946615558996\n2014-12-30,208.37,207.51,207.6,208.21,199.85262319264208,199.85262319264208,199.85262319264208,199.85262319264208,199.85262319264208,196.41727683247817\n2014-12-31,208.18,205.4,205.5,207.96,200.11497072878925,200.11497072878925,200.11497072878925,200.11497072878925,200.11497072878925,196.7483312958286\n2015-01-02,206.88,204.18,205.43,206.4,200.37207131421346,200.37207131421346,200.37207131421346,200.37207131421346,200.37207131421346,197.07276466991203\n2015-01-05,204.37,201.35,201.76,204.2,200.6240298879292,200.6240298879292,200.6240298879292,200.6240298879292,200.6240298879292,197.3907093765138\n2015-01-06,202.72,198.86,199.82,202.13,212.97,-212.97,-212.97,-212.97,-212.97,197.70229518898353\n2015-01-07,202.72,200.88,202.31,201.46,212.6878,-212.6878,-212.5467,-212.5467,-212.5467,198.00764928520385\n2015-01-08,206.16,203.99,205.9,204.0,212.411244,-212.411244,-212.136099,-212.136099,-212.136099,198.30689629949978\n2015-01-09,206.41,203.52,204.19,206.39,212.14021912,-212.14021912,-211.73781603,-211.73781603,-211.73781603,198.6001583735098\n2015-01-12,204.59,201.93,202.65,204.42,211.8746147376,-211.8746147376,-211.35148154910001,-211.35148154910001,-211.35148154910001,198.8875552060396\n2015-01-13,205.48,200.52,202.08,204.15,211.61432244284802,-211.61432244284802,-210.97673710262703,-210.97673710262703,-210.97673710262703,199.1692041019188\n2015-01-14,201.1,198.57,200.94,199.67,211.35923599399106,-211.35923599399106,-210.6132349895482,-210.6132349895482,-210.6132349895482,-217.2294\n2015-01-15,202.0,198.88,198.97,201.64,210.8476665542314,-210.8476665542314,-210.0110732400708,-210.0110732400708,-210.0110732400708,-216.66961799999999\n2015-01-16,201.82,198.55,201.63,198.75,210.35655989206217,-210.35655989206217,-209.43901957806725,-209.43901957806725,-209.43901957806725,-216.12662945999998\n2015-01-20,202.71,200.17,202.08,202.43,209.64816629853843,-209.64816629853843,-208.67678820760253,-208.67678820760253,-208.67678820760253,-215.24779798699998\n2015-01-21,203.66,200.94,203.06,201.51,208.9822763206261,-208.9822763206261,-207.96791303307035,-207.96791303307035,-207.96791303307035,-214.41290808764998\n2015-01-22,206.26,202.33,206.05,204.02,208.35633974138855,-208.35633974138855,-207.30865912075544,-207.30865912075544,-207.30865912075544,-213.61976268326748\n2015-01-23,206.1,204.81,204.97,205.8,207.76795935690524,-207.76795935690524,-206.69555298230256,-206.69555298230256,-206.69555298230256,-212.8662745491041\n2015-01-26,205.56,203.85,205.44,204.73,207.21488179549092,-207.21488179549092,-206.26,-206.26,-206.26,-212.1504608216489\n2015-01-27,204.12,201.75,202.79,203.0,206.69498888776147,-206.69498888776147,-206.1,-206.1,-206.1,-211.47043778056644\n2015-01-28,204.95,199.91,200.14,204.16,206.20628955449578,-206.20628955449578,-205.5715,-205.5715,-205.5715,-210.8244158915381\n2015-01-29,202.3,198.68,202.01,200.34,205.74691218122604,-205.74691218122604,-205.079995,-205.079995,-205.079995,-210.21069509696122\n2015-01-30,202.17,199.13,199.47,200.56,205.31509745035248,-205.31509745035248,-204.95,-204.95,-204.95,-209.62766034211316\n2015-02-02,202.02,197.86,201.9,200.07,204.90919160333132,-204.90919160333132,-204.50199999999998,-204.50199999999998,-204.50199999999998,-209.0737773250075\n2015-02-03,204.85,202.55,204.84,202.94,197.86,197.86,197.86,197.86,197.86,-208.288812912257\n2015-02-04,205.38,203.51,204.06,203.91,197.86,197.86,197.86,197.86,197.86,-207.55879600839899\n2015-02-05,206.3,204.77,206.18,204.83,198.16080000000002,198.16080000000002,198.0856,198.0856,198.0856,-206.87988028781106\n2015-02-06,207.24,204.92,205.53,206.57,198.64915200000002,198.64915200000002,198.414176,198.414176,198.414176,193.9028\n2015-02-09,205.64,204.14,204.63,204.77,199.33641984000002,199.33641984000002,198.8554672,198.8554672,198.8554672,194.169544\n2015-02-10,207.12,204.82,206.77,205.89,199.96870625280002,199.96870625280002,199.27469384,199.27469384,199.27469384,194.43095312\n2015-02-11,207.45,205.83,206.93,206.6,200.55040975257603,200.55040975257603,199.672959148,199.672959148,199.672959148,194.6871340576\n2015-02-12,208.99,207.68,208.92,207.91,201.24036877731842,201.24036877731842,200.13958159912,200.13958159912,200.13958159912,195.07002003587198\n2015-02-13,209.84,208.76,209.78,209.08,202.1703245240402,202.1703245240402,200.7591108871816,200.7591108871816,200.7591108871816,195.6268192344371\n2015-02-17,210.32,209.1,210.16,209.38,203.24407909067457,203.24407909067457,201.48558201620708,201.48558201620708,201.48558201620708,196.33747827271526\n2015-02-18,210.22,209.35,210.15,209.63,204.37622643616663,204.37622643616663,202.28067963474845,202.28067963474845,202.28067963474845,197.17642957635235\n2015-02-19,210.42,209.24,209.98,209.43,205.32723020637997,205.32723020637997,203.0042184676211,203.0042184676211,203.0042184676211,197.9650438017712\n2015-02-20,211.33,208.73,211.28,209.43,206.24392876923156,206.24392876923156,203.74579662085898,203.74579662085898,203.74579662085898,198.83689073564722\n2015-02-23,211.21,210.48,211.19,210.97,207.26114301538524,207.26114301538524,204.5800589925645,204.5800589925645,204.5800589925645,199.83633947679544\n2015-02-24,212.05,210.76,211.81,211.11,208.0749144123082,208.0749144123082,205.32255250338238,205.32255250338238,205.32255250338238,200.7558323186518\n2015-02-25,212.24,211.22,211.61,211.64,208.86993152984655,208.86993152984655,206.1298462029765,206.1298462029765,206.1298462029765,201.77230740997314\n2015-02-26,211.71,210.65,211.37,211.55,209.54394522387724,209.54394522387724,206.92416619658954,206.92416619658954,206.92416619658954,202.8190766689758\n2015-02-27,211.58,210.64,210.66,211.25,210.0831561791018,210.0831561791018,207.6152245910329,207.6152245910329,207.6152245910329,203.76116900207822\n2015-03-02,212.06,210.72,211.99,210.79,210.51452494328143,210.51452494328143,208.21644539419862,208.21644539419862,208.21644539419862,204.6090521018704\n2015-03-03,211.59,210.08,211.12,211.46,212.24,-212.24,208.73950749295278,208.73950749295278,208.73950749295278,205.37214689168334\n2015-03-04,210.49,209.06,210.21,210.42,212.1968,-212.1968,-212.24,-212.24,-212.24,206.058932202515\n2015-03-05,210.8,209.85,210.51,210.59,212.071328,-212.071328,-212.1446,-212.1446,-212.1446,206.6770389822635\n2015-03-06,209.94,207.1,207.5,209.38,211.95087488,-211.95087488,-212.052062,-212.052062,-212.052062,-216.4848\n2015-03-09,208.79,207.58,208.36,207.76,211.6598223872,-211.6598223872,-211.80445890000001,-211.80445890000001,-211.80445890000001,-216.203256\n2015-03-10,206.81,204.97,205.0,206.7,211.386233043968,-211.386233043968,-211.569235955,-211.569235955,-211.569235955,-215.93015832\n2015-03-11,205.5,204.4,204.5,205.29,210.87293440045056,-210.87293440045056,-211.10728943815002,-211.10728943815002,-211.10728943815002,-215.38215040400001\n2015-03-12,207.18,205.2,207.13,205.24,210.2256409604055,-210.2256409604055,-210.5036333887165,-210.5036333887165,-210.5036333887165,-214.61339987572\n2015-03-13,206.93,204.58,205.84,206.76,209.64307686436496,-209.64307686436496,-209.95430638373202,-209.95430638373202,-209.95430638373202,-213.89846188441962\n2015-03-16,208.69,206.68,208.64,206.68,209.11876917792847,-209.11876917792847,-209.45441880919614,-209.45441880919614,-209.45441880919614,-213.23356955251023\n2015-03-17,208.42,206.98,207.99,207.65,208.69,-208.69,-208.9995211163685,-208.9995211163685,-208.9995211163685,-212.6152196838345\n2015-03-18,211.26,206.62,210.42,207.35,204.4,204.4,204.4,204.4,204.4,-212.0401543059661\n2015-03-19,210.29,209.03,209.5,210.04,204.5372,204.5372,204.5372,204.5372,204.5372,-211.50534350454848\n2015-03-20,211.02,209.61,210.45,209.66,204.671656,204.671656,204.671656,204.671656,204.671656,-211.26\n2015-03-23,211.11,210.0,210.0,210.43,204.80342288,204.80342288,204.80342288,204.80342288,204.80342288,200.312\n2015-03-24,210.4,208.74,208.82,209.87,204.9325544224,204.9325544224,204.9325544224,204.9325544224,204.9325544224,200.52796\n2015-03-25,209.35,205.71,205.76,209.01,205.05910333395198,205.05910333395198,205.05910333395198,205.05910333395198,205.05910333395198,200.7396008\n2015-03-26,206.37,204.12,205.27,204.96,211.26,-211.26,-211.26,-211.26,-211.26,200.94700878400002\n2015-03-27,205.95,204.91,205.75,205.16,211.1172,-211.1172,-211.04579999999999,-211.04579999999999,-211.04579999999999,201.15026860832\n2015-03-30,208.61,206.96,208.24,206.96,210.977256,-210.977256,-210.83802599999999,-210.83802599999999,-210.83802599999999,201.3494632361536\n2015-03-31,208.1,206.36,206.43,207.26,210.84011088,-210.84011088,-210.63648522,-210.63648522,-210.63648522,201.54467397143054\n2015-04-01,206.42,204.51,205.7,206.42,210.70570866239999,-210.70570866239999,-210.4409906634,-210.4409906634,-210.4409906634,201.73598049200194\n2015-04-02,206.98,205.4,206.4,205.58,210.57399448915197,-210.57399448915197,-210.25136094349799,-210.25136094349799,-210.25136094349799,201.9234608821619\n2015-04-06,208.45,205.21,207.84,205.39,210.44491459936893,-210.44491459936893,-210.06742011519304,-210.06742011519304,-210.06742011519304,202.10719166451867\n2015-04-07,208.75,207.25,207.28,207.86,210.31841630738154,-210.31841630738154,-209.88899751173724,-209.88899751173724,-209.88899751173724,202.28724783122829\n2015-04-08,208.5,207.08,208.02,207.53,210.1944479812339,-210.1944479812339,-209.71592758638513,-209.71592758638513,-209.71592758638513,202.4637028746037\n2015-04-09,209.18,207.19,208.92,207.82,210.07295902160922,-210.07295902160922,-209.54804975879358,-209.54804975879358,-209.54804975879358,202.63662881711164\n2015-04-10,210.09,208.96,210.06,209.21,204.12,204.12,204.12,204.12,204.12,202.80609624076942\n2015-04-13,210.62,209.03,209.06,209.84,204.23940000000002,204.23940000000002,204.23940000000002,204.23940000000002,204.23940000000002,202.97217431595402\n2015-04-14,209.71,208.1,209.49,208.86,204.49462400000002,204.49462400000002,204.43081800000002,204.43081800000002,204.43081800000002,203.13493082963495\n2015-04-15,211.04,209.95,210.47,210.07,204.73963904000001,204.73963904000001,204.61649346000002,204.61649346000002,204.61649346000002,203.29443221304226\n2015-04-16,210.98,209.8,210.4,210.04,205.1176606976,205.1176606976,204.8734337216,204.8734337216,204.8734337216,203.4507435687814\n2015-04-17,209.23,207.01,207.98,208.98,205.473001055744,205.473001055744,205.12009637273601,205.12009637273601,205.12009637273601,203.60392869740576\n2015-04-20,210.25,208.96,209.85,209.09,205.80702099239934,205.80702099239934,205.35689251782657,205.35689251782657,205.35689251782657,203.75405012345766\n2015-04-21,210.86,209.24,209.6,210.65,206.12099973285538,206.12099973285538,205.58421681711351,205.58421681711351,205.58421681711351,203.9011691209885\n2015-04-22,210.85,208.9,210.66,210.04,206.41613974888406,206.41613974888406,205.80244814442898,205.80244814442898,205.80244814442898,204.04534573856873\n2015-04-23,211.93,210.01,211.21,210.17,206.693571363951,206.693571363951,206.01195021865183,206.01195021865183,206.01195021865183,204.18663882379735\n2015-04-24,211.97,211.11,211.67,211.7,207.11248565483493,207.11248565483493,206.30785270771923,206.30785270771923,206.30785270771923,204.41893965908343\n2015-04-27,212.48,210.54,210.74,212.34,207.59823708935144,207.59823708935144,206.6475815452561,206.6475815452561,206.6475815452561,204.7209820727201\n2015-04-28,211.5,209.34,211.44,210.71,208.18404863862926,208.18404863862926,207.05585083708817,207.05585083708817,207.05585083708817,205.1089329690841\n2015-04-29,211.29,209.6,210.53,210.32,208.69956280199375,208.69956280199375,207.435541278492,207.435541278492,207.435541278492,205.47748632062988\n2015-04-30,210.35,207.62,208.52,209.9,212.48,-212.48,-212.48,-212.48,-212.48,205.8276120045984\n2015-05-01,210.77,209.28,210.72,209.41,212.3828,-212.3828,-212.33419999999998,-212.33419999999998,-212.33419999999998,206.16023140436846\n2015-05-04,212.02,211.1,211.39,211.22,212.287544,-212.287544,-212.192774,-212.192774,-212.192774,206.47621983415004\n2015-05-05,211.46,208.73,208.92,211.01,212.19419312,-212.19419312,-212.05559078,-212.05559078,-212.05559078,206.77640884244255\n2015-05-06,209.93,206.76,208.04,209.54,212.1027092576,-212.1027092576,-212.02,-212.02,-212.02,-216.72959999999998\n2015-05-07,209.38,207.53,208.87,207.91,211.889000887296,-211.889000887296,-211.757,-211.757,-211.757,-216.43051199999996\n2015-05-08,211.85,210.79,211.65,210.84,206.76,206.76,206.76,206.76,206.76,-216.14039663999998\n2015-05-11,211.89,210.53,210.6,211.54,206.8618,206.8618,206.8618,206.8618,206.8618,-215.85898474079997\n2015-05-12,210.63,208.63,209.98,209.59,207.062928,207.062928,207.012646,207.012646,207.012646,-215.58601519857598\n2015-05-13,211.22,209.74,210.06,210.49,207.25601088,207.25601088,207.15896662,207.15896662,207.15896662,-215.32123474261869\n2015-05-14,212.32,210.91,212.25,211.24,207.4413704448,207.4413704448,207.3008976214,207.3008976214,207.3008976214,-215.06439770034012\n2015-05-15,212.61,211.87,212.44,212.43,207.734088218112,207.734088218112,207.501661716544,207.501661716544,207.501661716544,-214.81526576932993\n2015-05-18,213.4,212.17,213.1,212.24,208.12416116066302,208.12416116066302,207.7570786307168,207.7570786307168,207.7570786307168,-214.57360779625003\n2015-05-19,213.57,212.69,213.03,213.26,208.6517450445967,208.6517450445967,208.0956539128738,208.0956539128738,208.0956539128738,-214.33919956236252\n2015-05-20,213.78,212.51,212.88,213.16,209.2419356392451,209.2419356392451,208.4788581389726,208.4788581389726,208.4788581389726,-214.11182357549166\n2015-05-21,213.75,212.51,213.5,212.74,209.8772646497508,209.8772646497508,208.9029494878548,208.9029494878548,208.9029494878548,-213.89126886822692\n2015-05-22,213.54,212.91,213.0,213.02,210.4236475987857,210.4236475987857,209.29311352882644,209.29311352882644,209.29311352882644,-213.78\n2015-05-26,212.5,210.21,210.71,212.39,213.78,-213.78,209.6520644465203,209.6520644465203,209.6520644465203,-213.75\n2015-05-27,212.98,210.85,212.67,211.23,213.7086,-213.7086,209.9822992907987,209.9822992907987,209.9822992907987,-213.5403\n2015-05-28,212.59,211.63,212.5,212.34,213.63862799999998,-213.63862799999998,210.21,210.21,210.21,-213.336891\n2015-05-29,212.43,210.82,211.13,212.4,213.57005543999998,-213.57005543999998,210.4956,210.4956,210.4956,-213.13958427\n2015-06-01,212.34,210.62,211.54,211.95,213.50285433119998,-213.50285433119998,-213.78,-213.78,-213.78,-212.9481967419\n2015-06-02,212.19,210.27,211.39,211.02,213.436997244576,-213.436997244576,-213.6852,-213.6852,-213.6852,-212.762550839643\n2015-06-03,212.67,211.34,211.92,211.97,213.37245729968447,-213.37245729968447,-213.51444,-213.51444,-213.51444,202.6248\n2015-06-04,211.77,209.75,210.27,211.12,213.30920815369078,-213.30920815369078,-213.352218,-213.352218,-213.352218,202.825704\n2015-06-05,210.58,208.98,209.76,209.93,213.16683982754316,-213.16683982754316,-213.10006274,-213.10006274,-213.10006274,203.02258992\n2015-06-08,209.82,208.39,208.48,209.63,212.91562943789057,-212.91562943789057,-212.7292570934,-212.7292570934,-212.7292570934,203.2155381216\n2015-06-09,209.1,207.69,208.47,208.44,212.55357908285933,-212.55357908285933,-212.251938813126,-212.251938813126,-212.251938813126,203.404627359168\n2015-06-10,211.4,209.31,210.95,209.38,212.0672211745734,-212.0672211745734,-211.65888676741963,-211.65888676741963,-211.65888676741963,203.58993481198462\n2015-06-11,212.09,211.2,211.63,211.49,207.69,207.69,207.69,207.69,207.69,203.77153611574494\n2015-06-12,210.84,209.68,210.01,210.62,207.778,207.778,207.778,207.778,207.778,203.94950539343003\n2015-06-15,209.44,207.79,209.11,208.62,212.09,-212.09,-212.09,-212.09,-212.09,204.12391528556142\n2015-06-16,210.35,208.72,210.25,208.9,212.004,-212.004,-211.961,-211.961,-211.961,204.2948369798502\n2015-06-17,211.32,209.39,210.59,210.58,211.91971999999998,-211.91971999999998,-211.83587,-211.83587,-211.83587,204.4623402402532\n2015-06-18,213.34,211.18,212.78,211.23,207.79,207.79,207.79,207.79,207.79,204.62649343544814\n2015-06-19,211.55,210.45,210.81,211.42,207.90099999999998,207.90099999999998,207.90099999999998,207.90099999999998,207.90099999999998,204.8878986323847\n2015-06-22,212.59,211.65,211.89,211.95,208.00977999999998,208.00977999999998,208.00977999999998,208.00977999999998,208.00977999999998,205.14146167341315\n2015-06-23,212.44,211.57,212.04,212.18,208.1163844,208.1163844,208.1163844,208.1163844,208.1163844,205.38741782321074\n2015-06-24,212.17,210.48,210.5,211.71,208.220856712,208.220856712,208.220856712,208.220856712,208.220856712,205.62599528851442\n2015-06-25,211.25,209.77,209.86,211.13,208.32323957776,208.32323957776,208.32323957776,208.32323957776,208.32323957776,205.85741542985897\n2015-06-26,210.58,209.16,209.82,210.28,208.4235747862048,208.4235747862048,208.4235747862048,208.4235747862048,208.4235747862048,206.0818929669632\n2015-06-29,208.82,205.33,205.42,208.02,213.34,-213.34,-213.34,-213.34,-213.34,-217.6068\n2015-06-30,207.32,205.28,205.85,207.32,213.1798,-213.1798,-213.0997,-213.0997,-213.0997,-217.238496\n2015-07-01,208.03,206.56,207.5,207.79,212.863808,-212.863808,-212.708715,-212.708715,-212.708715,-216.6405712\n2015-07-02,208.27,206.82,207.31,208.07,212.56045568000002,-212.56045568000002,-212.33727925000002,-212.33727925000002,-212.33727925000002,-216.07254264000002\n2015-07-06,207.65,205.54,206.72,205.74,212.2692374528,-212.2692374528,-211.9844152875,-211.9844152875,-211.9844152875,-215.53291550800003\n2015-07-07,208.16,204.12,208.02,206.93,211.989667954688,-211.989667954688,-211.649194523125,-211.649194523125,-211.649194523125,-215.02026973260004\n2015-07-08,206.76,204.25,204.53,206.34,211.51748787740672,-211.51748787740672,-211.12215090650625,-211.12215090650625,-211.12215090650625,-214.25725085131805\n2015-07-09,207.35,204.88,204.9,207.03,211.07363860476232,-211.07363860476232,-210.6320003430508,-210.6320003430508,-210.6320003430508,-213.5476432917258\n2015-07-10,207.98,206.49,207.48,207.28,210.6564202884766,-210.6564202884766,-210.17616031903725,-210.17616031903725,-210.17616031903725,-212.887708261305\n2015-07-13,209.9,208.94,209.77,209.0,210.264235071168,-210.264235071168,204.12,204.12,204.12,-212.27396868301363\n2015-07-14,211.05,209.66,210.68,209.69,204.12,204.12,204.2356,204.2356,204.2356,-211.7031908752027\n2015-07-15,211.28,210.05,210.61,210.71,204.2586,204.2586,204.440032,204.440032,204.440032,200.0376\n2015-07-16,212.3,211.55,212.3,211.82,204.539456,204.539456,204.71363072,204.71363072,204.71363072,200.262448\n2015-07-17,212.55,211.8,212.48,212.34,205.00508864,205.00508864,205.092949184,205.092949184,205.092949184,200.62357456\n2015-07-20,213.18,212.21,212.59,212.77,205.6086815488,205.6086815488,205.54037223295998,205.54037223295998,205.54037223295998,201.1006315776\n2015-07-21,212.74,211.39,211.75,212.45,206.36581339392,206.36581339392,206.0751461766528,206.0751461766528,206.0751461766528,201.70459999872\n2015-07-22,211.77,210.89,211.37,210.91,207.047232054528,207.047232054528,206.5724859442871,206.5724859442871,206.5724859442871,202.278369998784\n2015-07-23,211.65,209.75,210.18,211.54,207.6605088490752,207.6605088490752,207.035011928187,207.035011928187,207.035011928187,202.8234514988448\n2015-07-24,210.37,207.6,208.0,210.25,213.18,-213.18,207.4651610932139,207.4651610932139,207.4651610932139,203.34127892390256\n2015-07-27,207.55,206.26,206.79,206.98,213.0684,-213.0684,-213.18,-213.18,-213.18,203.83321497770743\n2015-07-28,209.5,206.8,209.33,207.8,212.796064,-212.796064,-212.9724,-212.9724,-212.9724,204.30055422882205\n2015-07-29,211.04,209.32,210.77,209.44,212.53462144,-212.53462144,-212.771028,-212.771028,-212.771028,204.74452651738096\n2015-07-30,211.02,209.42,210.82,210.2,212.2836365824,-212.2836365824,-212.57569716,-212.57569716,-212.57569716,205.1663001915119\n2015-07-31,211.45,210.16,210.5,211.44,212.042691119104,-212.042691119104,-212.3862262452,-212.3862262452,-212.3862262452,205.5669851819363\n2015-08-03,210.53,208.65,209.79,210.53,211.81138347433983,-211.81138347433983,-212.20243945784398,-212.20243945784398,-212.20243945784398,205.94763592283948\n2015-08-04,210.24,208.8,209.38,209.7,211.58932813536623,-211.58932813536623,-212.02416627410867,-212.02416627410867,-212.02416627410867,206.3092541266975\n2015-08-05,211.31,209.73,210.07,210.4,211.3761550099516,-211.3761550099516,-211.8512412858854,-211.8512412858854,-211.8512412858854,206.65279142036263\n2015-08-06,210.41,207.65,208.35,210.27,211.31,-211.31,-211.68350404730884,-211.68350404730884,-211.68350404730884,206.9791518493445\n2015-08-07,208.34,206.87,207.95,208.16,211.31,-211.31,-211.52079892588958,-211.52079892588958,-211.52079892588958,-217.4436\n2015-08-10,210.67,209.28,210.57,209.29,211.108,-211.108,-211.3629749581129,-211.3629749581129,-211.3629749581129,-217.126392\n2015-08-11,209.47,207.76,208.67,208.96,210.91408,-210.91408,-211.2098857093695,-211.2098857093695,-211.2098857093695,-216.81870024\n2015-08-12,209.14,205.36,208.92,207.14,210.7279168,-210.7279168,-211.06138913808843,-211.06138913808843,-211.06138913808843,-216.5202392328\n2015-08-13,209.55,208.02,208.66,208.75,210.405841792,-210.405841792,-210.77631968118402,-210.77631968118402,-210.77631968118402,-215.96222727116\n2015-08-14,209.5,208.26,209.42,208.43,210.10309128448,-210.10309128448,-210.50550369712482,-210.50550369712482,-210.50550369712482,-215.432115907602\n2015-08-17,210.59,208.16,210.59,208.73,205.36,205.36,205.36,205.36,205.36,-214.9285101122219\n2015-08-18,210.68,209.7,209.98,210.29,205.46460000000002,205.46460000000002,205.46460000000002,205.46460000000002,205.46460000000002,-214.4500846066108\n2015-08-19,210.01,207.35,208.32,209.1,205.67321600000002,205.67321600000002,205.62106200000002,205.62106200000002,205.62106200000002,-213.99558037628026\n2015-08-20,207.17,203.91,203.97,206.54,210.68,-210.68,-210.68,-210.68,-210.68,-213.56380135746625\n2015-08-21,202.92,197.54,197.83,201.81,210.5446,-210.5446,-210.4769,-210.4769,-210.4769,-212.88803526244362\n2015-08-24,195.84,182.95,189.5,187.49,210.024416,-210.024416,-209.830055,-209.830055,-209.830055,-211.5067120888237\n2015-08-25,195.45,187.06,187.27,195.45,208.39995104,-208.39995104,-207.94845114999998,-207.94845114999998,-207.94845114999998,-208.3654737590531\n2015-08-26,194.79,188.37,194.46,192.21,206.8729539776,-206.8729539776,-206.1985595695,-206.1985595695,-206.1985595695,-205.56977164555724\n2015-08-27,199.41,195.21,199.27,197.05,205.437576738944,-205.437576738944,-204.571160399635,-204.571160399635,-204.571160399635,-203.08159676454594\n2015-08-28,199.83,197.92,199.28,198.5,204.08832213460735,-204.08832213460735,-203.05767917166057,-203.05767917166057,-203.05767917166057,-200.8671211204459\n2015-08-31,199.12,197.02,197.67,198.14,202.82002280653091,-202.82002280653091,-201.65014162964434,-201.65014162964434,-201.65014162964434,-199.83\n2015-09-01,194.76,190.73,191.77,193.07,201.62782143813905,-201.62782143813905,-200.34113171556925,-200.34113171556925,-200.34113171556925,-199.83\n2015-09-02,195.44,192.43,195.41,194.69,200.5071521518507,-200.5071521518507,-199.1237524954794,-199.1237524954794,-199.1237524954794,-199.12\n2015-09-03,198.05,194.96,195.55,196.25,199.45372302273967,-199.45372302273967,182.95,182.95,182.95,179.291\n2015-09-04,193.86,191.61,192.59,192.88,198.46349964137528,-198.46349964137528,183.25199999999998,183.25199999999998,183.25199999999998,179.66618\n2015-09-08,197.61,195.18,197.43,195.97,198.05,-198.05,183.54796,183.54796,183.54796,180.0338564\n2015-09-09,199.46,194.35,194.79,199.33,182.95,182.95,183.8380008,183.8380008,183.8380008,180.394179272\n2015-09-10,197.22,194.25,195.85,194.5,183.28019999999998,183.28019999999998,184.306660776,184.306660776,184.306660776,180.96615389384002\n2015-09-11,196.76,194.54,196.74,195.32,183.603796,183.603796,184.76126095272,184.76126095272,184.76126095272,181.52096927702482\n2015-09-14,197.0,195.44,196.01,196.95,183.92092008,183.92092008,185.20222312413838,185.20222312413838,185.20222312413838,182.05914019871406\n2015-09-15,198.99,196.09,198.46,196.59,184.23170167840001,184.23170167840001,185.62995643041424,185.62995643041424,185.62995643041424,182.58116599275263\n2015-09-16,200.4,198.41,200.18,198.82,184.536267644832,184.536267644832,186.04485773750181,186.04485773750181,186.04485773750181,183.08753101297006\n2015-09-17,202.84,199.28,199.73,199.96,185.17081693903873,185.17081693903873,186.61906342800174,186.61906342800174,186.61906342800174,183.78002977245126\n2015-09-18,197.56,194.96,195.45,195.74,186.2309679226964,186.2309679226964,187.43011025660167,187.43011025660167,187.43011025660167,184.7330282838287\n2015-09-21,197.68,195.22,196.46,196.45,187.22750984733463,187.22750984733463,188.20060474377158,188.20060474377158,188.20060474377158,185.63837686963726\n2015-09-22,194.46,192.57,193.91,193.9,188.16425925649455,188.16425925649455,188.932574506583,188.932574506583,188.932574506583,186.4984580261554\n2015-09-23,194.67,192.91,193.6,194.13,189.04480370110488,189.04480370110488,189.62794578125386,189.62794578125386,189.62794578125386,187.31553512484763\n2015-09-24,193.45,190.56,192.9,192.13,189.87251547903858,189.87251547903858,190.28854849219115,190.28854849219115,190.28854849219115,188.09175836860524\n2015-09-25,195.0,191.81,192.85,194.61,190.56,190.56,190.56,190.56,190.56,188.82917045017498\n2015-09-28,191.9,187.64,188.01,191.75,202.84,-202.84,-202.84,-202.84,-202.84,-206.8968\n2015-09-29,189.74,186.93,188.12,188.24,202.536,-202.536,-202.38400000000001,-202.38400000000001,-202.38400000000001,-206.319096\n2015-09-30,191.82,189.44,191.63,190.4,201.91176000000002,-201.91176000000002,-201.61130000000003,-201.61130000000003,-201.61130000000003,-205.3496412\n2015-10-01,192.49,189.82,192.13,192.03,201.31248960000002,-201.31248960000002,-200.87723500000004,-200.87723500000004,-200.87723500000004,-204.42865914\n2015-10-02,195.0,189.12,195.0,189.75,200.73719001600003,-200.73719001600003,-200.17987325000004,-200.17987325000004,-200.17987325000004,-203.553726183\n2015-10-05,198.74,196.33,198.47,196.47,200.18490241536003,-200.18490241536003,-199.51737958750005,-199.51737958750005,-199.51737958750005,-202.72253987385\n2015-10-06,198.98,197.0,197.79,198.27,199.65470631874564,-199.65470631874564,186.93,186.93,186.93,-201.9329128801575\n2015-10-07,199.83,197.49,199.41,198.85,186.93,186.93,187.171,187.171,187.171,-201.1827672361496\n2015-10-08,201.55,198.59,201.21,198.96,187.18800000000002,187.18800000000002,187.55077,187.55077,187.55077,183.19140000000002\n2015-10-09,201.9,200.58,201.33,201.4,187.76248,187.76248,188.1107392,188.1107392,188.1107392,183.55857200000003\n2015-10-12,201.76,200.91,201.52,201.43,188.6107312,188.6107312,188.80020224,188.80020224,188.80020224,184.10881484000004\n2015-10-13,202.16,200.05,200.25,200.63,189.408087328,189.408087328,189.455192128,189.455192128,189.455192128,184.64255039480003\n2015-10-14,200.87,198.94,199.29,200.16,190.42824034176,190.42824034176,190.21748060032,190.21748060032,190.21748060032,185.34324837900803\n2015-10-15,202.35,199.64,202.35,200.05,191.36678111441918,191.36678111441918,190.93403176430078,190.93403176430078,190.93403176430078,186.0159184438477\n2015-10-16,203.28,201.92,203.27,202.82,192.46510300297726,192.46510300297726,191.73314954079973,191.73314954079973,191.73314954079973,186.8326225216553\n2015-10-19,203.37,202.13,203.37,202.53,193.76289064262,193.76289064262,192.65689757753574,192.65689757753574,192.65689757753574,187.81946517035598\n2015-10-20,203.84,202.55,203.11,202.86,195.1078859526532,195.1078859526532,193.62107679555754,193.62107679555754,193.62107679555754,188.90800260843108\n2015-10-21,203.79,201.65,201.85,203.64,196.5050242002287,196.5050242002287,194.64296911600178,194.64296911600178,194.64296911600178,190.10256239975658\n2015-10-22,205.51,202.81,205.26,203.0,197.6786203281921,197.6786203281921,195.5626722044016,195.5626722044016,195.5626722044016,191.20155740777605\n2015-10-23,207.95,206.3,207.51,207.24,199.08826866911753,199.08826866911753,196.65687826191743,196.65687826191743,196.65687826191743,192.4893172410762\n2015-10-26,207.37,206.56,207.0,207.27,200.86061493529402,200.86061493529402,198.01205287048734,198.01205287048734,198.01205287048734,194.03538551696857\n2015-10-27,207.0,205.8,206.6,206.2,202.27849194823523,202.27849194823523,199.20460652602887,199.20460652602887,199.20460652602887,195.42684696527172\n2015-10-28,208.97,206.21,208.95,207.0,203.4127935585882,203.4127935585882,200.2540537429054,200.2540537429054,200.2540537429054,196.67916226874456\n2015-10-29,209.27,208.21,208.83,208.36,204.52423484687054,204.52423484687054,201.3871267563277,201.3871267563277,201.3871267563277,198.03115441918266\n2015-10-30,209.44,207.83,207.93,209.07,205.47338787749644,205.47338787749644,202.4907290104418,202.4907290104418,202.4907290104418,199.37981588888073\n2015-11-02,210.62,208.18,210.39,208.36,206.26671030199714,206.26671030199714,203.53311965887553,203.53311965887553,203.53311965887553,200.68763982332624\n2015-11-03,211.66,209.7,211.0,209.98,207.1373682415977,207.1373682415977,204.66702051345544,204.66702051345544,204.66702051345544,202.07817024806056\n2015-11-04,211.49,209.73,210.36,211.37,208.04189459327816,208.04189459327816,205.85582702616801,205.85582702616801,205.85582702616801,203.51544471085148\n2015-11-05,210.98,209.09,210.15,210.44,208.76551567462252,208.76551567462252,206.84253643171945,206.84253643171945,206.84253643171945,204.73712800422376\n2015-11-06,210.32,208.47,210.04,209.74,211.66,-211.66,207.66150523832715,207.66150523832715,207.66150523832715,205.7755588035902\n2015-11-09,209.49,206.95,208.08,209.33,211.5962,-211.5962,-211.66,-211.66,-211.66,206.65822498305167\n2015-11-10,208.6,207.19,208.56,207.54,211.41035200000002,-211.41035200000002,-211.5187,-211.5187,-211.5187,206.95\n2015-11-11,208.94,207.67,207.74,208.9,211.23193792,-211.23193792,-211.381639,-211.381639,-211.381639,206.95\n2015-11-12,207.06,204.82,204.9,206.51,211.06066040320002,-211.06066040320002,-211.24868983000002,-211.24868983000002,-211.24868983000002,-215.8932\n2015-11-13,204.67,202.44,202.53,204.36,210.686220779008,-210.686220779008,-210.9272553385,-210.9272553385,-210.9272553385,-215.561004\n2015-11-16,205.65,202.19,205.65,202.3,210.02652311668737,-210.02652311668737,-210.333147464805,-210.333147464805,-210.333147464805,-214.9049538\n2015-11-17,207.03,204.88,205.4,205.97,209.24287080501864,-209.24287080501864,-209.60026419297253,-209.60026419297253,-209.60026419297253,-214.01490703399998\n2015-11-18,208.9,206.01,208.68,206.03,202.19,202.19,-208.93334041560502,-208.93334041560502,-208.93334041560502,-213.18716354161998\n2015-11-19,209.05,208.2,208.54,208.55,202.3242,202.3242,202.19,202.19,202.19,-212.41736209370657\n2015-11-20,210.12,208.86,209.38,209.47,202.593232,202.593232,202.3272,202.3272,202.3272,-211.70144674714712\n2015-11-23,209.98,208.53,209.09,209.4,203.04483808,203.04483808,202.56098400000002,202.56098400000002,202.56098400000002,-211.03564547484683\n2015-11-24,209.83,207.41,209.37,207.87,203.4693477952,203.4693477952,202.78775448000002,202.78775448000002,202.78775448000002,-210.41645029160756\n2015-11-25,209.74,209.01,209.3,209.48,203.86838692748802,203.86838692748802,203.00772184560003,203.00772184560003,203.00772184560003,-209.98\n2015-11-27,209.8,208.87,209.53,209.4,204.24348371183873,204.24348371183873,203.22109019023202,203.22109019023202,203.22109019023202,-209.83\n2015-11-30,209.89,208.56,208.69,209.79,204.59607468912841,204.59607468912841,203.42805748452506,203.42805748452506,203.42805748452506,198.1462\n2015-12-01,210.82,209.12,210.68,209.42,204.9275102077807,204.9275102077807,203.6288157599893,203.6288157599893,203.6288157599893,198.381076\n2015-12-02,211.0,208.23,208.54,210.6,205.39890939115824,205.39890939115824,203.91646312958972,203.91646312958972,203.91646312958972,198.75424372\n2015-12-03,209.15,204.76,205.58,208.9,211.0,-211.0,204.27063997311024,204.27063997311024,204.27063997311024,199.2440739712\n2015-12-04,209.97,205.94,209.66,206.1,211.0,-211.0,204.60710797445472,204.60710797445472,204.60710797445472,199.714311012352\n2015-12-07,209.24,207.2,208.27,209.2,210.8752,-210.8752,204.76,204.76,204.76,200.16573857185793\n2015-12-08,208.04,205.78,206.99,206.48,210.752896,-210.752896,205.072,205.072,205.072,200.5991090289836\n2015-12-09,208.68,204.18,205.33,206.2,210.63303808,-210.63303808,-211.0,-211.0,-211.0,201.01514466782427\n2015-12-10,207.43,205.15,205.86,205.44,210.3749165568,-210.3749165568,-210.7954,-210.7954,-210.7954,201.4145388811113\n2015-12-11,204.14,201.51,201.88,203.38,210.127119894528,-210.127119894528,-210.596938,-210.596938,-210.596938,-215.22\n2015-12-14,203.0,199.97,203.0,202.1,209.6100927008563,-209.6100927008563,-210.1425911,-210.1425911,-210.1425911,-214.8087\n2015-12-15,206.11,204.55,205.06,204.69,208.8388852847878,-208.8388852847878,-209.430509723,-209.430509723,-209.430509723,-214.06676499999998\n2015-12-16,208.39,204.83,208.02,206.37,199.97,199.97,-208.76827404239,-208.76827404239,-208.76827404239,-213.36192674999998\n2015-12-17,208.48,204.84,204.86,208.37,200.1384,200.1384,199.97,199.97,199.97,-212.69233041249998\n2015-12-18,202.89,199.98,200.02,202.77,208.48,-208.48,-208.48,-208.48,-208.48,-212.056213891875\n2015-12-21,201.88,200.09,201.7,201.43,208.48,-208.48,-208.48,-208.48,-208.48,-211.45190319728124\n2015-12-22,203.85,201.55,203.56,202.7,208.31,-208.31,-208.225,-208.225,-208.225,-210.87780803741717\n2015-12-23,206.07,204.58,206.05,204.7,208.1434,-208.1434,-207.97764999999998,-207.97764999999998,-207.97764999999998,-210.3324176355463\n2015-12-24,206.33,205.43,205.65,205.72,207.98013200000003,-207.98013200000003,-207.7377205,-207.7377205,-207.7377205,-209.81429675376899\n2015-12-28,205.25,203.95,205.22,204.86,207.82012936000004,-207.82012936000004,-207.504988885,-207.504988885,-207.504988885,-209.32208191608055\n2015-12-29,207.79,206.47,207.4,206.53,199.98,199.98,199.98,199.98,199.98,-208.85447782027651\n2015-12-30,207.21,205.76,205.93,207.09,200.1362,200.1362,200.1362,200.1362,200.1362,-208.4102539292627\n2015-12-31,205.89,203.89,203.89,205.17,200.289276,200.289276,200.289276,200.289276,200.289276,-207.98824123279957\n2016-01-04,201.03,198.59,201.01,200.53,207.79,-207.79,-207.79,-207.79,-207.79,-207.58732917115958\n2016-01-05,201.9,200.05,201.35,201.39,207.606,-207.606,-207.51399999999998,-207.51399999999998,-207.51399999999998,-206.9575161291784\n2016-01-06,200.05,197.6,198.85,198.33,207.42568,-207.42568,-207.24627999999998,-207.24627999999998,-207.24627999999998,-206.37179000013592\n2016-01-07,197.43,193.59,193.99,195.32,207.0326528,-207.0326528,-206.76396599999998,-206.76396599999998,-206.76396599999998,-205.58232890012368\n2016-01-08,195.85,191.58,191.95,195.21,206.226093632,-206.226093632,-205.84178838,-205.84178838,-205.84178838,-204.26317272111007\n2016-01-11,193.4,189.83,192.11,193.05,205.05440614143998,-205.05440614143998,-204.5582274258,-204.5582274258,-204.5582274258,-202.61436026736575\n2016-01-12,194.55,191.14,193.66,193.85,203.531965527296,-203.531965527296,-202.938122408962,-202.938122408962,-202.938122408962,-200.6967062272609\n2016-01-13,194.86,188.38,188.87,194.53,202.1617689745664,-202.1617689745664,-201.49622894397618,-201.49622894397618,-201.49622894397618,-199.06670029317178\n2016-01-14,193.26,187.66,191.89,189.55,200.50795669761843,-200.50795669761843,-199.79111918125926,-199.79111918125926,-199.79111918125926,-197.24996124333256\n2016-01-15,188.76,185.52,187.83,186.79,198.70924275995185,-198.70924275995185,-197.97145130407037,-197.97145130407037,-197.97145130407037,-195.42786860709938\n2016-01-19,190.11,186.21,188.06,189.95,196.59896391835954,-196.59896391835954,-195.85470458237842,-195.85470458237842,-195.85470458237842,-193.3472161996085\n2016-01-20,187.49,181.02,185.81,185.0,194.82632969142202,-194.82632969142202,-194.0978048033741,-194.0978048033741,-194.0978048033741,-191.70350079769074\n2016-01-21,188.87,184.65,186.7,186.19,192.34119034696604,-192.34119034696604,-191.61302189073302,-191.61302189073302,-191.61302189073302,-190.11\n2016-01-22,190.76,188.88,190.55,189.78,181.02,181.02,181.02,181.02,181.02,177.39960000000002\n2016-01-25,190.15,187.41,187.63,189.91,181.2148,181.2148,181.2148,181.2148,181.2148,177.66680800000003\n2016-01-26,190.53,188.03,190.24,188.44,181.405704,181.405704,181.405704,181.405704,181.405704,177.92867184000002\n2016-01-27,191.56,187.06,188.14,189.58,181.59278991999997,181.59278991999997,181.59278991999997,181.59278991999997,181.59278991999997,178.18529840320002\n2016-01-28,190.2,187.17,189.17,190.0,181.99147832319997,181.99147832319997,181.89180622239996,181.89180622239996,181.89180622239996,178.58653945110402\n2016-01-29,193.87,189.88,193.87,190.03,182.37421919027196,182.37421919027196,182.18185203572796,182.18185203572796,182.18185203572796,178.9757432675709\n2016-02-01,194.58,191.85,193.65,192.5,183.06396603885565,183.06396603885565,182.64937795429884,182.64937795429884,182.64937795429884,179.57151353686805\n2016-02-02,191.96,189.54,190.11,191.9,183.9852487557472,183.9852487557472,183.2459090565839,183.2459090565839,183.2459090565839,180.32193786002466\n2016-02-03,191.78,187.11,191.23,191.37,184.83282885528743,184.83282885528743,183.81261360375473,183.81261360375473,183.81261360375473,181.03484096702343\n2016-02-04,192.74,189.96,191.53,190.72,185.61260254686445,185.61260254686445,184.350982923567,184.350982923567,184.350982923567,181.71209891867227\n2016-02-05,191.08,187.2,187.98,190.97,186.3299943431153,186.3299943431153,184.86243377738865,184.86243377738865,184.86243377738865,182.35549397273866\n2016-02-08,186.12,182.81,185.35,185.75,194.58,-194.58,-194.58,-194.58,-194.58,-198.47160000000002\n2016-02-09,186.93,183.21,185.35,183.38,194.3446,-194.3446,-194.2269,-194.2269,-194.2269,-198.001752\n2016-02-10,188.32,185.12,185.31,186.44,194.113908,-194.113908,-193.884393,-193.884393,-193.884393,-197.54599944\n2016-02-11,184.1,181.09,183.03,182.38,193.88782984,-193.88782984,-193.55216120999998,-193.55216120999998,-193.55216120999998,-197.1039194568\n2016-02-12,186.65,183.97,186.65,184.93,193.3759166464,-193.3759166464,-192.9290531495,-192.9290531495,-192.9290531495,-196.30322348396\n2016-02-16,189.81,187.64,189.81,188.78,192.884479980544,-192.884479980544,-192.337100492025,-192.337100492025,-192.337100492025,-195.54256230976202\n2016-02-17,193.32,191.01,192.87,191.12,181.09,181.09,181.09,181.09,181.09,-194.8199341942739\n2016-02-18,193.26,191.72,192.05,193.22,181.3346,181.3346,181.3346,181.3346,181.3346,-194.1334374845602\n2016-02-19,192.18,190.45,192.0,191.15,181.574308,181.574308,181.574308,181.574308,181.574308,-193.4812656103322\n2016-02-22,194.95,193.8,194.83,193.9,181.80922184,181.80922184,181.80922184,181.80922184,181.80922184,177.4682\n2016-02-23,194.32,192.18,192.33,193.99,182.33485296639998,182.33485296639998,182.2034451848,182.2034451848,182.2034451848,177.817836\n2016-02-24,193.53,189.32,193.23,190.62,182.83945884774397,182.83945884774397,182.585841829256,182.585841829256,182.585841829256,178.16047928\n2016-02-25,195.55,192.83,195.55,193.73,183.32388049383422,183.32388049383422,182.95676657437832,182.95676657437832,182.95676657437832,178.4962696944\n2016-02-26,196.68,194.9,195.1,196.52,184.05744766420418,184.05744766420418,183.4604959114032,183.4604959114032,183.4604959114032,179.00788160356802\n2016-02-29,196.23,193.44,193.56,195.08,185.06725185106785,185.06725185106785,184.12147111583303,184.12147111583303,184.12147111583303,179.7147663394253\n2016-03-01,198.21,194.46,198.21,195.05,185.99627170298243,185.99627170298243,184.7493975600414,184.7493975600414,184.7493975600414,180.3933756858483\n2016-03-02,199.06,197.25,199.03,197.7,187.21764453268418,187.21764453268418,185.55703370643892,185.55703370643892,185.55703370643892,181.28420690155588\n2016-03-03,199.79,198.11,199.77,198.7,188.63872718876206,188.63872718876206,186.5022413469882,186.5022413469882,186.5022413469882,182.35075448746252\n2016-03-04,201.35,199.03,200.36,200.0,190.19990538233537,190.19990538233537,187.56526203922914,187.56526203922914,187.56526203922914,183.57150167334015\n2016-03-07,201.07,199.27,200.63,199.4,191.9839205211617,191.9839205211617,188.80588845569852,188.80588845569852,188.80588845569852,184.99378153947293\n2016-03-08,199.92,198.22,198.36,199.3,193.48249323777583,193.48249323777583,189.93485849468564,189.93485849468564,189.93485849468564,186.3022790163151\n2016-03-09,199.79,198.43,199.41,199.36,194.7412943197317,194.7412943197317,190.96222123016395,190.96222123016395,190.96222123016395,187.50609669500992\n2016-03-10,201.05,197.38,199.54,199.9,195.79868722857464,195.79868722857464,191.89712131944918,191.89712131944918,191.89712131944918,188.61360895940913\n2016-03-11,202.81,201.13,202.76,201.25,196.68689727200268,196.68689727200268,192.74788040069876,192.74788040069876,192.74788040069876,189.6325202426564\n2016-03-14,203.03,201.77,202.53,202.2,197.38,197.38,193.75409236062887,193.75409236062887,193.75409236062887,190.81849342081733\n2016-03-15,202.2,201.06,202.2,201.32,198.51,198.51,194.7744422009597,194.7744422009597,194.7744422009597,192.0396440787356\n2016-03-16,203.82,201.56,203.39,201.62,199.414,199.414,195.68255355885412,195.68255355885412,195.68255355885412,193.13867967086202\n2016-03-17,205.22,202.77,204.79,203.26,200.2952,200.2952,196.65904713179162,196.65904713179162,196.65904713179162,194.3136249070672\n2016-03-18,204.78,203.8,204.52,204.2,201.28016,201.28016,197.77197100465872,197.77197100465872,197.77197100465872,195.62238991821914\n2016-03-21,204.94,203.81,204.69,204.11,202.068128,202.068128,198.7402147740531,198.7402147740531,198.7402147740531,196.77410312803283\n2016-03-22,205.23,203.57,204.62,203.74,202.6985024,202.6985024,199.5825868534262,199.5825868534262,199.5825868534262,197.78761075266888\n2016-03-23,204.33,203.01,203.22,204.11,205.23,-205.23,200.37322469394653,200.37322469394653,200.37322469394653,198.75512135482194\n2016-03-24,203.16,201.74,203.11,201.98,205.23,-205.23,201.053173236794,201.053173236794,201.053173236794,199.59685557869508\n2016-03-28,203.85,202.71,203.27,203.62,205.0904,-205.0904,201.63792898364284,201.63792898364284,201.63792898364284,200.32916435346473\n2016-03-29,205.23,202.41,205.23,202.75,201.74,201.74,201.74,201.74,201.74,200.96627298751432\n2016-03-30,206.87,205.59,206.1,206.35,201.8098,201.8098,202.2286,202.2286,202.2286,201.52055749913745\n2016-03-31,206.41,205.33,205.56,205.87,202.012208,202.012208,202.41,202.41,202.41,202.2694794492582\n2016-04-01,207.14,203.99,206.91,204.35,202.20651967999999,202.20651967999999,203.079,203.079,203.079,202.91355232636207\n2016-04-04,207.07,205.89,206.29,206.84,202.5025284992,202.5025284992,203.72876,203.72876,203.72876,203.54751947740775\n2016-04-05,205.25,203.9,204.14,204.64,202.780776789248,202.780776789248,-207.14,-207.14,-207.14,-211.28279999999998\n2016-04-06,206.49,203.98,206.46,204.27,203.0423301818931,203.0423301818931,-207.07,-207.07,-207.07,-211.06131599999998\n2016-04-07,205.56,203.09,203.89,205.18,207.14,-207.14,-206.9749,-206.9749,-206.9749,-210.84647651999998\n2016-04-08,205.84,203.88,204.48,205.32,207.059,-207.059,-206.780655,-206.780655,-206.780655,-210.458652694\n2016-04-11,206.07,203.91,203.99,205.23,206.97962,-206.97962,-206.59612225,-206.59612225,-206.59612225,-210.0902200593\n2016-04-12,206.25,203.7,205.99,204.2,206.90182760000002,-206.90182760000002,-206.4208161375,-206.4208161375,-206.4208161375,-209.740209056335\n2016-04-13,208.1,206.84,208.04,207.02,203.09,203.09,203.09,203.09,203.09,-209.40769860351824\n2016-04-14,208.6,207.6,208.02,208.03,203.1902,203.1902,203.1902,203.1902,203.1902,-209.09181367334233\n2016-04-15,208.11,207.4,207.8,208.0,203.40659200000002,203.40659200000002,203.352494,203.352494,203.352494,-208.7917229896752\n2016-04-18,209.27,207.0,209.25,207.11,203.61432832000003,203.61432832000003,203.50991918,203.50991918,203.50991918,199.0282\n2016-04-19,210.2,208.94,209.91,209.7,203.95366862080002,203.95366862080002,203.7403224128,203.7403224128,203.7403224128,199.233036\n2016-04-20,210.92,209.4,210.07,209.9,204.45337513113603,204.45337513113603,204.06330629216,204.06330629216,204.06330629216,199.56204492\n2016-04-21,210.25,208.66,208.9,210.13,205.1000376180224,205.1000376180224,204.47470791463041,204.47470791463041,204.47470791463041,200.0163631232\n2016-04-22,209.29,207.92,208.96,208.53,205.68203385622016,205.68203385622016,204.8614254397526,204.8614254397526,204.8614254397526,200.452508598272\n2016-04-25,208.62,207.54,208.59,208.28,206.20583047059813,206.20583047059813,205.22493991336745,205.22493991336745,205.22493991336745,200.87120825434113\n2016-04-26,209.52,208.37,209.0,209.02,206.67724742353832,206.67724742353832,205.5666435185654,205.5666435185654,205.5666435185654,201.2731599241675\n2016-04-27,209.81,208.06,209.38,208.46,207.1015226811845,207.1015226811845,205.88784490745147,205.88784490745147,205.88784490745147,201.6590335272008\n2016-04-28,209.76,206.97,207.42,208.49,210.92,-210.92,206.18977421300437,206.18977421300437,206.18977421300437,202.02947218611277\n2016-04-29,207.13,205.03,206.3,206.71,210.84099999999998,-210.84099999999998,-210.92,-210.92,-210.92,202.38509329866827\n2016-05-02,208.18,206.41,208.03,206.9,210.60855999999998,-210.60855999999998,-210.74329999999998,-210.74329999999998,-210.74329999999998,202.72648956672154\n2016-05-03,206.79,205.28,206.13,206.5,210.38541759999998,-210.38541759999998,-210.57190099999997,-210.57190099999997,-210.57190099999997,203.05422998405268\n2016-05-04,205.83,204.42,204.96,205.0,210.171200896,-210.171200896,-210.40564396999997,-210.40564396999997,-210.40564396999997,203.36886078469058\n2016-05-05,205.98,204.47,204.95,205.57,209.82612884224,-209.82612884224,-210.10636177149996,-210.10636177149996,-210.10636177149996,203.67090635330297\n2016-05-06,205.77,203.88,205.7,204.04,209.5017611117056,-209.5017611117056,-209.82204368292497,-209.82204368292497,-209.82204368292497,-215.1384\n2016-05-09,206.4,205.37,205.89,205.58,209.05202022276916,-209.05202022276916,-209.40610062512022,-209.40610062512022,-209.40610062512022,-214.800648\n2016-05-10,208.46,206.64,208.46,206.64,208.63825860494762,-208.63825860494762,-209.0192735813618,-209.0192735813618,-209.0192735813618,-214.47302856\n2016-05-11,208.33,206.5,206.5,207.89,208.46,-208.46,-208.65952443066647,-208.65952443066647,-208.65952443066647,-214.1552377032\n2016-05-12,207.48,205.37,206.55,207.29,208.46,-208.46,-208.46,-208.46,-208.46,-213.84698057210397\n2016-05-13,206.86,204.38,204.72,206.23,208.33,-208.33,-208.33,-208.33,-208.33,-213.54797115494085\n2016-05-16,207.34,204.89,206.81,204.95,207.97400000000002,-207.97400000000002,-208.01850000000002,-208.01850000000002,-208.01850000000002,-213.25793202029263\n2016-05-17,206.8,204.23,204.82,206.44,207.64648000000003,-207.64648000000003,-207.72880500000002,-207.72880500000002,-207.72880500000002,-212.97659405968386\n2016-05-18,206.3,203.64,204.91,204.44,207.3451616,-207.3451616,-207.45938865000002,-207.45938865000002,-207.45938865000002,-212.70369623789335\n2016-05-19,204.54,202.78,204.24,204.0,206.97464544000002,-206.97464544000002,-207.1156436715,-207.1156436715,-207.1156436715,-212.2505114259987\n2016-05-20,206.09,204.86,205.49,204.95,206.47128798720001,-206.47128798720001,-206.638722867635,-206.638722867635,-206.638722867635,-211.5875756261788\n2016-05-23,205.84,204.99,205.16,205.48,206.09,-206.09,-206.21426335219516,-206.21426335219516,-206.21426335219516,-210.97104533234628\n2016-05-24,208.24,206.14,207.87,206.15,202.78,202.78,202.78,202.78,202.78,-210.39767215908205\n2016-05-25,209.77,208.62,209.26,208.64,202.8892,202.8892,202.8892,202.8892,202.8892,-209.8644351079463\n2016-05-26,209.71,208.97,209.34,209.47,203.16443199999998,203.16443199999998,203.095624,203.095624,203.095624,-209.77\n2016-05-27,210.21,209.47,210.21,209.55,203.42865471999997,203.42865471999997,203.29585527999998,203.29585527999998,203.29585527999998,198.7244\n2016-05-31,210.69,209.18,210.08,210.53,203.83553543679997,203.83553543679997,203.5724210688,203.5724210688,203.5724210688,198.954112\n2016-06-01,210.48,208.89,210.3,209.15,204.38389260185596,204.38389260185596,203.92830001536,203.92830001536,203.92830001536,199.30618864000002\n2016-06-02,210.92,209.24,210.92,209.8,204.8883811937075,204.8883811937075,204.266385014592,204.266385014592,204.266385014592,199.6477029808\n2016-06-03,210.69,208.86,210.28,210.32,205.49154307433673,205.49154307433673,204.66560191371647,204.66560191371647,204.66560191371647,200.09859486156802\n2016-06-06,211.76,210.51,211.39,210.71,206.03438876690305,206.03438876690305,205.0408657988935,205.0408657988935,205.0408657988935,200.5314510671053\n2016-06-07,212.34,211.5,211.7,211.56,206.72146211487467,206.72146211487467,205.51120519297095,205.51120519297095,205.51120519297095,201.09287851375004\n2016-06-08,212.52,211.69,212.39,211.8,207.50805741879222,207.50805741879222,206.0575087775333,206.0575087775333,206.0575087775333,201.76770580292504\n2016-06-09,212.22,211.19,212.04,211.49,208.30996823178546,208.30996823178546,206.63913298755529,206.63913298755529,206.63913298755529,202.52036639672028\n2016-06-10,210.86,209.44,210.03,210.43,208.98357331469978,208.98357331469978,207.1684110186753,207.1684110186753,207.1684110186753,203.22034074894987\n2016-06-13,210.37,208.35,208.42,209.34,212.52,-212.52,207.65005402699452,207.65005402699452,207.65005402699452,203.87131689652338\n2016-06-14,208.74,206.92,208.09,207.97,212.4366,-212.4366,-212.52,-212.52,-212.52,204.47672471376674\n2016-06-15,209.2,207.53,207.78,208.57,212.215936,-212.215936,-212.352,-212.352,-212.352,205.03975398380308\n2016-06-16,208.57,205.59,208.35,206.74,212.00409856,-212.00409856,-212.18904,-212.18904,-212.18904,205.56337120493686\n2016-06-17,207.2,205.75,206.53,207.14,211.61925264639999,-211.61925264639999,-211.859088,-211.859088,-211.859088,205.59\n2016-06-20,209.6,207.75,207.91,208.84,211.25749748761598,-211.25749748761598,-211.5456336,-211.5456336,-211.5456336,205.59\n2016-06-21,208.92,207.79,208.41,208.26,210.91744763835902,-210.91744763835902,-211.24785192000002,-211.24785192000002,-211.24785192000002,205.75\n2016-06-22,209.49,207.94,208.03,208.69,210.59780078005747,-210.59780078005747,-210.964959324,-210.964959324,-210.964959324,206.22390000000001\n2016-06-23,210.87,209.27,210.87,209.83,205.59,205.59,205.59,205.59,205.59,206.66462700000002\n2016-06-24,206.9,202.72,203.13,204.0,210.87,-210.87,-210.87,-210.87,-210.87,-216.77040000000002\n2016-06-27,201.59,198.65,199.53,201.59,210.87,-210.87,-210.87,-210.87,-210.87,-216.34888800000002\n2016-06-28,203.22,201.12,203.22,201.66,210.3812,-210.3812,-210.25900000000001,-210.25900000000001,-210.25900000000001,-215.46394360000002\n2016-06-29,206.93,204.72,206.71,204.83,209.911952,-209.911952,-209.67855,-209.67855,-209.67855,-214.62324642000002\n2016-06-30,209.54,206.56,209.53,207.18,198.65,198.65,198.65,198.65,198.65,-213.82458409900002\n2016-07-01,210.49,209.29,209.79,209.29,198.86780000000002,198.86780000000002,198.86780000000002,198.86780000000002,198.86780000000002,-213.06585489405\n2016-07-05,209.08,207.71,208.39,208.9,199.33268800000002,199.33268800000002,199.21646600000003,199.21646600000003,199.21646600000003,-212.3450621493475\n2016-07-06,209.8,207.06,209.77,207.87,199.77898048000003,199.77898048000003,199.55467202000003,199.55467202000003,199.55467202000003,-211.66030904188014\n2016-07-07,210.64,208.63,209.54,209.89,200.20742126080003,200.20742126080003,199.88273185940002,199.88273185940002,199.88273185940002,-211.00979358978614\n2016-07-08,212.94,210.78,212.7,211.0,200.83337598515203,200.83337598515203,200.31302258502402,200.31302258502402,200.31302258502402,194.677\n2016-07-11,214.07,212.95,213.45,213.16,201.80190590633987,201.80190590633987,200.94437145577282,200.94437145577282,200.94437145577282,195.04226\n2016-07-12,215.3,214.25,215.0,214.51,203.02871531570588,203.02871531570588,201.73190916842645,201.73190916842645,201.73190916842645,195.6130922\n2016-07-13,215.45,214.35,214.93,215.42,204.50126947782118,204.50126947782118,202.6816755266366,202.6816755266366,202.6816755266366,196.400568512\n2016-07-14,216.66,215.66,216.11,216.34,206.03409175092622,206.03409175092622,203.7031414845057,203.7031414845057,203.7031414845057,197.3530400864\n2016-07-15,216.82,215.31,215.84,216.79,207.73423707077802,207.73423707077802,204.86925875090017,204.86925875090017,204.86925875090017,198.511457681216\n2016-07-18,216.6,215.67,216.41,215.95,209.36967439803797,209.36967439803797,206.06433287581015,206.06433287581015,206.06433287581015,199.7930556435309\n2016-07-19,216.23,215.65,216.18,215.88,210.71073300639114,210.71073300639114,207.13989958822913,207.13989958822913,207.13989958822913,200.98494174848372\n2016-07-20,217.37,216.24,217.13,216.75,211.81040106524074,211.81040106524074,208.1079096294062,208.1079096294062,208.1079096294062,202.09339582608985\n2016-07-21,217.22,215.75,216.22,216.92,212.9223208521926,212.9223208521926,209.12673957017154,209.12673957017154,209.12673957017154,203.31552416000267\n2016-07-22,217.3,216.1,217.25,216.39,213.81185668175408,213.81185668175408,210.03349821745266,210.03349821745266,210.03349821745266,204.43988222720245\n2016-07-25,217.06,215.97,216.64,217.0,214.52348534540326,214.52348534540326,210.84051341353288,210.84051341353288,210.84051341353288,205.47429164902624\n2016-07-26,217.17,215.76,216.75,216.53,215.0927882763226,215.0927882763226,211.55875693804427,211.55875693804427,211.55875693804427,206.42594831710414\n2016-07-27,217.27,215.62,216.51,217.17,215.54823062105808,215.54823062105808,212.1979936748594,212.1979936748594,212.1979936748594,207.3014724517358\n2016-07-28,217.11,215.75,216.8,216.26,215.62,215.62,212.76691437062485,212.76691437062485,212.76691437062485,208.10695465559695\n2016-07-29,217.54,216.13,217.15,216.45,215.62,215.62,213.2732537898561,213.2732537898561,213.2732537898561,208.8479982831492\n2016-08-01,217.65,216.41,216.93,217.15,215.75,215.75,213.78526333507338,213.78526333507338,213.78526333507338,209.63027843766577\n2016-08-02,216.83,214.58,215.52,216.64,217.65,-217.65,214.28767910151385,214.28767910151385,214.28767910151385,210.4322505938992\n2016-08-03,216.24,215.13,216.23,215.45,217.65,-217.65,214.58,214.58,214.58,211.1540255345093\n2016-08-04,216.78,215.83,216.43,216.3,217.5886,-217.5886,214.58,214.58,214.58,211.80362298105837\n2016-08-05,218.23,217.07,218.14,217.19,214.58,214.58,214.97910000000002,214.97910000000002,214.97910000000002,212.38826068295253\n2016-08-08,218.52,217.74,218.05,218.39,214.65300000000002,214.65300000000002,215.43422600000002,215.43422600000002,215.43422600000002,213.03085200782775\n2016-08-09,218.76,217.8,218.22,218.12,214.80768000000003,214.80768000000003,215.8970921,215.8970921,215.8970921,213.6895497668884\n2016-08-10,218.4,217.23,217.63,218.29,215.04481920000003,215.04481920000003,216.355157364,216.355157364,216.355157364,214.3487082971929\n2016-08-11,218.94,217.95,218.68,218.25,215.26773004800003,215.26773004800003,216.73993218576,216.73993218576,216.73993218576,214.9221762185578\n2016-08-12,218.71,217.99,218.41,218.26,215.56151164416002,215.56151164416002,217.1139437141808,217.1139437141808,217.1139437141808,215.48467154795972\n2016-08-15,219.5,218.88,219.09,218.89,215.83179071262722,215.83179071262722,217.42437328277006,217.42437328277006,217.42437328277006,215.96841753124536\n2016-08-16,218.68,217.96,217.96,218.56,216.1986116413645,216.1986116413645,217.79798609187145,217.79798609187145,217.79798609187145,216.49815490155856\n2016-08-17,218.53,217.02,218.38,217.98,216.52875047722804,216.52875047722804,-219.5,-219.5,-219.5,216.94843166632478\n2016-08-18,218.9,218.22,218.9,218.31,216.82587542950523,216.82587542950523,-219.4256,-219.4256,-219.4256,217.02\n2016-08-19,218.75,217.74,218.56,218.34,217.02,217.02,-219.353432,-219.353432,-219.353432,217.02\n2016-08-22,218.8,217.83,218.51,218.25,217.268,217.268,-219.28342904,-219.28342904,-219.28342904,217.392\n2016-08-23,219.6,218.9,218.93,219.23,217.4912,217.4912,217.02,217.02,217.02,217.7082\n2016-08-24,218.91,217.36,217.88,218.8,219.6,-219.6,217.07160000000002,217.07160000000002,217.07160000000002,-223.992\n2016-08-25,218.19,217.22,217.66,217.4,219.6,-219.6,217.12216800000002,217.12216800000002,217.12216800000002,-223.79304\n2016-08-26,219.11,216.25,217.28,217.9,219.5048,-219.5048,-219.6,-219.6,-219.6,-223.46438799999999\n2016-08-29,218.66,217.4,218.34,217.43,219.30951199999998,-219.30951199999998,-219.49949999999998,-219.49949999999998,-219.49949999999998,-222.95938084\n2016-08-30,218.59,217.35,217.98,218.25,219.12594127999998,-219.12594127999998,-219.40201499999998,-219.40201499999998,-219.40201499999998,-222.4897241812\n2016-08-31,217.75,216.47,217.44,217.64,218.95338480319998,-218.95338480319998,-219.30745455,-219.30745455,-219.30745455,-222.05294348851598\n2016-09-01,217.73,216.03,217.37,217.38,218.79118171500798,-218.79118171500798,-219.21573091349998,-219.21573091349998,-219.21573091349998,-221.64673744431985\n2016-09-02,218.87,217.7,218.36,218.36,216.03,216.03,-219.05644436782498,-219.05644436782498,-219.05644436782498,-221.14123107433107\n2016-09-06,219.09,217.86,219.09,218.72,216.03,216.03,216.03,216.03,216.03,-220.68122027764127\n2016-09-07,219.22,218.31,219.01,218.84,216.1524,216.1524,216.09120000000001,216.09120000000001,216.09120000000001,-220.26261045265355\n2016-09-08,218.94,218.16,218.51,218.6,216.336456,216.336456,216.185064,216.185064,216.185064,-219.88167551191472\n2016-09-09,217.02,213.25,213.32,217.0,219.22,-219.22,-219.22,-219.22,-219.22,-219.53502471584238\n2016-09-12,216.81,212.31,216.4,212.39,219.1006,-219.1006,-219.0409,-219.0409,-219.0409,-218.94\n2016-09-13,215.14,212.5,213.24,214.85,218.82897599999998,-218.82897599999998,-218.704355,-218.704355,-218.704355,-218.0781\n2016-09-14,214.69,212.5,213.15,213.29,218.56821695999997,-218.56821695999997,-218.38463725,-218.38463725,-218.38463725,-217.328247\n2016-09-15,215.73,212.76,215.28,213.0,218.31788828159998,-218.31788828159998,-218.0809053875,-218.0809053875,-218.0809053875,-216.67587489000002\n2016-09-16,213.69,212.58,213.37,213.5,218.07757275033597,-218.07757275033597,-217.792360118125,-217.792360118125,-217.792360118125,-216.10831115430003\n2016-09-19,214.87,213.03,213.41,214.1,217.84686984032254,-217.84686984032254,-217.51824211221876,-217.51824211221876,-217.51824211221876,-215.73\n2016-09-20,214.59,213.38,213.42,214.43,217.62539504670963,-217.62539504670963,-217.25783000660783,-217.25783000660783,-217.25783000660783,-215.28539999999998\n2016-09-21,216.03,213.44,215.82,214.22,217.41277924484123,-217.41277924484123,-217.01043850627744,-217.01043850627744,-217.01043850627744,208.06380000000001\n2016-09-22,217.53,216.71,217.18,216.99,212.31,212.31,212.31,212.31,212.31,208.223124\n2016-09-23,216.88,215.88,215.99,216.73,212.4144,212.4144,212.4144,212.4144,212.4144,208.50233028000002\n2016-09-26,215.23,214.01,214.24,215.02,212.516712,212.516712,212.516712,212.516712,212.516712,208.77316037160003\n2016-09-27,215.68,213.62,215.57,214.03,212.61697776000003,212.61697776000003,212.61697776000003,212.61697776000003,212.61697776000003,209.03586556045204\n2016-09-28,216.82,214.71,216.64,215.81,212.71523820480002,212.71523820480002,212.71523820480002,212.71523820480002,212.71523820480002,209.2906895936385\n2016-09-29,216.87,214.05,214.68,216.39,212.811533440704,212.811533440704,212.811533440704,212.811533440704,212.811533440704,209.53786890582933\n2016-09-30,217.12,215.36,216.3,215.67,212.90590277188994,212.90590277188994,212.90590277188994,212.90590277188994,212.90590277188994,209.77763283865445\n2016-10-03,216.04,215.04,215.78,215.81,212.99838471645214,212.99838471645214,212.99838471645214,212.99838471645214,212.99838471645214,210.01020385349483\n2016-10-04,216.17,213.99,214.68,215.86,213.0890170221231,213.0890170221231,213.0890170221231,213.0890170221231,213.0890170221231,210.23579773788998\n2016-10-05,216.13,215.33,215.63,215.37,213.17783668168065,213.17783668168065,213.17783668168065,213.17783668168065,213.17783668168065,210.45462380575327\n2016-10-06,216.04,214.74,215.78,215.39,213.26487994804702,213.26487994804702,213.26487994804702,213.26487994804702,213.26487994804702,210.66688509158067\n2016-10-07,216.3,214.19,215.04,216.06,213.35018234908608,213.35018234908608,213.35018234908608,213.35018234908608,213.35018234908608,210.87277853883324\n2016-10-10,216.7,215.99,216.16,216.14,213.43377870210435,213.43377870210435,213.43377870210435,213.43377870210435,213.43377870210435,211.07249518266823\n2016-10-11,215.74,212.58,213.43,215.64,217.53,-217.53,-217.53,-217.53,-217.53,211.2662203271882\n2016-10-12,214.32,213.01,213.71,213.61,217.431,-217.431,-217.3815,-217.3815,-217.3815,211.45413371737254\n2016-10-13,213.59,211.21,213.01,212.15,217.33398000000003,-217.33398000000003,-217.23745499999998,-217.23745499999998,-217.23745499999998,-221.88060000000002\n2016-10-14,214.69,213.03,213.12,214.14,217.08902080000001,-217.08902080000001,-216.93608224999997,-216.93608224999997,-216.93608224999997,-221.560482\n2016-10-17,213.38,212.17,212.38,213.07,216.85385996800002,-216.85385996800002,-216.64977813749996,-216.64977813749996,-216.64977813749996,-221.24996754\n2016-10-18,214.29,213.27,213.71,214.24,216.62810556928002,-216.62810556928002,-216.37778923062496,-216.37778923062496,-216.37778923062496,-220.9487685138\n2016-10-19,214.64,213.6,214.28,214.0,216.41138134650882,-216.41138134650882,-216.11939976909372,-216.11939976909372,-216.11939976909372,-220.656605458386\n2016-10-20,214.53,213.11,213.88,213.85,216.20332609264847,-216.20332609264847,-215.87392978063903,-215.87392978063903,-215.87392978063903,-220.37320729463443\n2016-10-21,214.08,212.76,213.98,212.95,216.00359304894252,-216.00359304894252,-215.6407332916071,-215.6407332916071,-215.6407332916071,-220.09831107579538\n2016-10-24,215.31,214.48,214.89,214.98,215.81184932698483,-215.81184932698483,-215.41919662702674,-215.41919662702674,-215.41919662702674,-219.83166174352152\n2016-10-25,214.98,213.98,214.17,214.7,215.62777535390543,-215.62777535390543,-215.31,-215.31,-215.31,-219.57301189121588\n2016-10-26,214.42,212.93,213.74,213.22,215.45106433974922,-215.45106433974922,-215.31,-215.31,-215.31,-219.3221215344794\n2016-10-27,214.62,213.09,213.17,214.57,215.28142176615924,-215.28142176615924,-215.105,-215.105,-215.105,-219.078757888445\n2016-10-28,213.93,211.72,212.54,213.13,215.11856489551286,-215.11856489551286,-214.91025,-214.91025,-214.91025,-218.84269515179167\n2016-10-31,213.19,212.37,212.55,212.95,214.96222229969234,-214.96222229969234,-214.7252375,-214.7252375,-214.7252375,-218.61371429723792\n2016-11-01,212.99,209.6,211.01,212.9,214.81213340770464,-214.81213340770464,-214.54947562499999,-214.54947562499999,-214.54947562499999,-218.39160286832077\n2016-11-02,211.1,209.24,209.74,210.67,214.49940540324235,-214.49940540324235,-214.20301233125,-214.20301233125,-214.20301233125,-217.95202272490474\n2016-11-03,210.24,208.46,208.78,210.01,214.07865297098297,-214.07865297098297,-213.7563412214375,-213.7563412214375,-213.7563412214375,-217.3421811341614\n2016-11-04,209.88,208.4,208.55,208.91,213.51678767388466,-213.51678767388466,-213.1737436870794,-213.1737436870794,-213.1737436870794,-216.54278483208688\n2016-11-07,213.19,211.3,213.15,211.47,208.4,208.4,208.4,208.4,208.4,-215.6470785005573\n2016-11-08,214.77,212.38,214.11,212.72,208.4,208.4,208.4,208.4,208.4,-214.849899865496\n2016-11-09,217.1,212.34,216.44,212.47,208.6548,208.6548,208.5911,208.5911,208.5911,204.232\n2016-11-10,218.31,215.23,216.92,217.35,209.161512,209.161512,208.931456,208.931456,208.931456,204.48936\n2016-11-11,216.7,215.32,216.42,216.13,209.89339103999998,209.89339103999998,209.4003832,209.4003832,209.4003832,204.9039792\n2016-11-14,217.27,215.72,216.59,216.99,210.56671975679998,210.56671975679998,209.84586403999998,209.84586403999998,209.84586403999998,205.30615982400002\n2016-11-15,218.28,216.81,218.28,217.0,211.18618217625598,211.18618217625598,210.26907083799998,210.26907083799998,210.26907083799998,205.69627502928003\n2016-11-16,218.14,217.42,217.87,217.52,211.7560876021555,211.7560876021555,210.67111729609996,210.67111729609996,210.67111729609996,206.07468677840163\n2016-11-17,219.06,217.92,218.99,218.04,212.28040059398307,212.28040059398307,211.05306143129496,211.05306143129496,211.05306143129496,206.4417461750496\n2016-11-18,219.26,218.29,218.5,219.04,212.95836053458476,212.95836053458476,211.53347774541726,211.53347774541726,211.53347774541726,206.9464763280476\n2016-11-21,220.18,219.0,220.15,219.19,213.7145572704346,213.7145572704346,212.07433430323806,212.07433430323806,212.07433430323806,207.56215251164522\n2016-11-22,220.79,219.73,220.58,220.49,214.61971925257376,214.61971925257376,212.722787558979,212.722787558979,212.722787558979,208.31922336094652\n2016-11-23,220.76,219.75,220.7,220.0,215.60696417216195,215.60696417216195,213.4488366786709,213.4488366786709,213.4488366786709,209.19217772568027\n2016-11-25,221.54,221.01,221.52,221.12,216.43624990461603,216.43624990461603,214.10954137759052,214.10954137759052,214.10954137759052,210.00402528488266\n2016-11-28,221.48,220.37,220.48,221.19,217.35492492178514,217.35492492178514,214.85258723983145,214.85258723983145,214.85258723983145,210.92690326209205\n2016-11-29,221.44,220.17,220.91,220.58,218.10823843586383,218.10823843586383,215.5213285158483,215.5213285158483,215.5213285158483,211.7759510011247\n2016-11-30,221.82,220.31,220.38,221.65,218.72595551740832,218.72595551740832,216.12319566426348,216.12319566426348,216.12319566426348,212.5570749210347\n2016-12-01,220.73,219.15,219.57,220.73,221.82,-221.82,216.7498441411945,216.7498441411945,216.7498441411945,213.3907381781416\n2016-12-02,220.25,219.26,219.68,219.7,221.82,-221.82,217.3075612856631,217.3075612856631,217.3075612856631,214.14937174210885\n2016-12-05,221.4,220.42,221.0,220.67,221.76659999999998,-221.76659999999998,217.80392954424016,217.80392954424016,217.80392954424016,214.83972828531907\n2016-12-06,221.74,220.67,221.7,221.24,219.15,219.15,218.24569729437374,218.24569729437374,218.24569729437374,215.46795273964034\n2016-12-07,224.67,221.38,224.6,221.5,219.2018,219.2018,218.63887059199263,218.63887059199263,218.63887059199263,216.03963699307272\n2016-12-08,225.7,224.27,225.15,224.58,219.420528,219.420528,219.3626061209535,219.3626061209535,219.3626061209535,216.90267329376545\n2016-12-09,226.51,225.37,226.51,225.44,219.79729632,219.79729632,220.18646732522956,220.18646732522956,220.18646732522956,217.87037923145124\n2016-12-12,226.96,225.76,226.25,226.42,220.33431261439998,220.33431261439998,221.0717618996974,221.0717618996974,221.0717618996974,218.90713372367708\n2016-12-13,228.34,227.0,227.76,227.01,220.99688135295997,220.99688135295997,221.9549976147428,221.9549976147428,221.9549976147428,219.95400633959906\n2016-12-14,228.22,225.37,225.88,227.41,221.8780555906048,221.8780555906048,222.97659799638396,222.97659799638396,222.97659799638396,221.1280454520552\n2016-12-15,227.81,226.01,226.81,226.13,222.6534889197322,222.6534889197322,223.83474231696252,223.83474231696252,223.83474231696252,222.13771908876748\n2016-12-16,226.08,224.67,225.04,225.99,223.33587024936435,223.33587024936435,224.55558354624853,224.55558354624853,224.55558354624853,223.00603841634003\n2016-12-19,226.01,225.08,225.53,225.24,223.93636581944062,223.93636581944062,224.67,224.67,224.67,223.75279303805243\n2016-12-20,226.57,225.88,226.4,226.16,224.46480192110775,224.46480192110775,224.67,224.67,224.67,224.3950020127251\n2016-12-21,226.45,225.77,225.77,226.27,224.92982569057483,224.92982569057483,225.08,225.08,225.08,224.94730173094356\n2016-12-22,225.74,224.92,225.38,225.61,228.34,-228.34,-228.34,-228.34,-228.34,-232.9068\n2016-12-23,225.72,225.21,225.71,225.42,228.2716,-228.2716,-228.2374,-228.2374,-228.2374,-232.667196\n2016-12-27,226.73,226.0,226.27,226.0,228.204568,-228.204568,-228.137878,-228.137878,-228.137878,-232.43478012\n2016-12-28,226.59,224.28,224.4,226.59,228.13887664,-228.13887664,-228.04134166,-228.04134166,-228.04134166,-232.2093367164\n2016-12-29,224.89,223.84,224.35,224.47,227.98452157440002,-227.98452157440002,-227.853274577,-227.853274577,-227.853274577,-231.81286988058\n2016-12-30,224.83,222.73,223.53,224.71,227.73585027993602,-227.73585027993602,-227.57234535661001,-227.57234535661001,-227.57234535661001,-231.2547689889394\n2017-01-03,225.83,223.89,225.24,225.07,227.33538225754114,-227.33538225754114,-227.1365342745151,-227.1365342745151,-227.1365342745151,-230.48753977993485\n2017-01-04,226.75,225.61,226.58,225.64,226.96695167693784,-226.96695167693784,222.73,222.73,222.73,-229.7893611997407\n2017-01-05,226.58,225.49,226.4,226.28,226.75,-226.75,222.8104,222.8104,222.8104,-229.15401869176404\n2017-01-06,227.75,225.9,227.21,226.53,222.73,222.73,222.88919199999998,222.88919199999998,222.88919199999998,-228.57585700950528\n2017-01-09,227.07,226.42,226.46,226.9,222.8304,222.8304,223.03501623999998,223.03501623999998,223.03501623999998,-228.0497298786498\n2017-01-10,227.44,226.01,226.46,226.47,222.928792,222.928792,223.17646575279997,223.17646575279997,223.17646575279997,-227.75\n2017-01-11,227.1,225.59,227.1,226.38,223.02521615999999,223.02521615999999,223.31367178021597,223.31367178021597,223.31367178021597,-227.44\n2017-01-12,226.75,224.96,226.53,226.5,223.11971183679998,223.11971183679998,223.4467616268095,223.4467616268095,223.4467616268095,-227.44\n2017-01-13,227.4,226.69,227.05,226.75,223.21231760006398,223.21231760006398,223.5758587780052,223.5758587780052,223.5758587780052,218.2754\n2017-01-17,226.78,225.8,226.25,226.3,223.3030712480627,223.3030712480627,223.70108301466504,223.70108301466504,223.70108301466504,218.457892\n2017-01-18,226.8,225.9,226.75,226.52,223.39200982310146,223.39200982310146,223.8225505242251,223.8225505242251,223.8225505242251,218.63673415999997\n2017-01-19,227.0,225.41,225.91,226.83,223.47916962663942,223.47916962663942,223.94037400849837,223.94037400849837,223.94037400849837,218.81199947679997\n2017-01-20,227.31,226.05,226.74,226.73,223.56458623410663,223.56458623410663,224.0546627882434,224.0546627882434,224.0546627882434,218.98375948726397\n2017-01-23,226.8,225.27,226.15,226.37,223.6482945094245,223.6482945094245,224.16552290459612,224.16552290459612,224.16552290459612,219.15208429751868\n2017-01-24,228.08,226.28,227.6,226.4,223.730328619236,223.730328619236,224.27305721745824,224.27305721745824,224.27305721745824,219.3170426115683\n2017-01-25,229.57,228.51,229.57,228.7,223.90431547446656,223.90431547446656,224.42533492875992,224.42533492875992,224.42533492875992,219.57993133322125\n2017-01-26,229.71,229.02,229.33,229.42,224.24425654599855,224.24425654599855,224.68256818232192,224.68256818232192,224.68256818232192,219.9795340798924\n2017-01-27,229.59,228.76,228.97,229.44,224.68151602231868,224.68151602231868,224.9842140913826,224.9842140913826,224.9842140913826,220.46605737589778\n2017-01-30,228.2,226.42,227.55,228.18,225.0837947405332,225.0837947405332,225.26776124589964,225.26776124589964,225.26776124589964,220.92825450710288\n2017-01-31,227.59,226.32,227.53,227.01,225.45389116129053,225.45389116129053,225.53429557114566,225.53429557114566,225.53429557114566,221.36734178174774\n2017-02-01,228.58,226.95,227.62,228.28,225.7943798683873,225.7943798683873,225.78483783687693,225.78483783687693,225.78483783687693,221.78447469266035\n2017-02-02,228.09,226.83,227.77,227.24,226.10762947891632,226.10762947891632,226.02034756666433,226.02034756666433,226.02034756666433,222.18075095802735\n2017-02-03,229.55,228.46,229.34,228.85,226.39581912060302,226.39581912060302,226.24172671266447,226.24172671266447,226.24172671266447,222.55721341012597\n2017-02-06,229.32,228.55,228.93,228.89,226.6609535909548,226.6609535909548,226.4498231099046,226.4498231099046,226.4498231099046,222.91485273961968\n2017-02-07,229.65,228.72,228.94,229.36,226.9048773036784,226.9048773036784,226.64543372331033,226.64543372331033,226.64543372331033,223.25461010263868\n2017-02-08,229.39,228.31,229.24,228.59,227.12928711938414,227.12928711938414,226.8293076999117,226.8293076999117,226.8293076999117,223.57737959750673\n2017-02-09,230.95,229.52,230.6,229.57,227.3357441498334,227.3357441498334,227.002149237917,227.002149237917,227.002149237917,223.8840106176314\n2017-02-10,231.77,230.88,231.51,231.0,227.69716973485006,227.69716973485006,227.2784987912628,227.2784987912628,227.2784987912628,224.30796998057352\n2017-02-13,233.07,232.05,232.77,232.09,228.18590936666806,228.18590936666806,227.63781888796177,227.63781888796177,227.63781888796177,224.83031208193339\n2017-02-14,233.71,232.16,233.7,232.55,228.86968205533452,228.86968205533452,228.1267151880452,228.1267151880452,228.1267151880452,225.48948711537872\n2017-02-15,235.14,233.39,234.92,233.43,229.644132926481,229.644132926481,228.68504366924068,228.68504366924068,228.68504366924068,226.22933327499464\n2017-02-16,235.15,233.85,234.72,234.93,230.6333889997144,230.6333889997144,229.39508886562422,229.39508886562422,229.39508886562422,227.12039994749517\n2017-02-17,235.09,233.94,235.09,233.97,231.53671119977153,231.53671119977153,230.08567820174932,230.08567820174932,230.08567820174932,228.0036559532707\n2017-02-21,236.68,235.51,236.49,235.51,232.25936895981724,232.25936895981724,230.6933968175394,230.6933968175394,230.6933968175394,228.78975379841094\n2017-02-22,236.54,235.83,236.28,236.02,233.14349516785379,233.14349516785379,231.47165523125926,231.47165523125926,231.47165523125926,229.73658334260162\n2017-02-23,236.9,235.57,236.44,236.9,233.85079613428303,233.85079613428303,232.14874005119555,232.14874005119555,232.14874005119555,230.56979334148943\n2017-02-24,236.79,235.41,236.74,235.42,234.46063690742642,234.46063690742642,232.81391644402817,232.81391644402817,232.81391644402817,231.3927202070958\n2017-02-27,237.31,236.35,237.11,236.61,234.94850952594115,234.94850952594115,233.38596814186423,233.38596814186423,233.38596814186423,232.10866658017335\n2017-02-28,236.95,236.02,236.47,236.71,235.41,235.41,233.9745729205846,233.9745729205846,233.9745729205846,232.83685325894908\n2017-03-01,240.32,238.37,239.78,238.4,235.79,235.79,234.4748869824969,234.4748869824969,234.4748869824969,233.4630938026962\n2017-03-02,239.57,238.21,238.27,239.57,236.02,236.02,235.41010506529742,235.41010506529742,235.41010506529742,234.49162973229176\n2017-03-03,238.61,237.73,238.42,238.19,236.88,236.88,236.19568825484984,236.19568825484984,236.19568825484984,235.365885272448\n2017-03-06,238.12,237.01,237.71,237.48,240.32,-240.32,236.85557813407385,236.85557813407385,236.85557813407385,236.1090024815808\n2017-03-07,237.77,236.77,237.0,237.39,240.25379999999998,-240.25379999999998,-240.32,-240.32,-240.32,236.74065210934367\n2017-03-08,237.63,236.41,236.56,237.31,240.11444799999998,-240.11444799999998,-240.21349999999998,-240.21349999999998,-240.21349999999998,-245.1264\n2017-03-09,237.24,235.74,236.86,236.71,239.89218111999998,-239.89218111999998,-240.02332499999997,-240.02332499999997,-240.02332499999997,-244.86490799999999\n2017-03-10,238.02,236.59,237.69,237.95,239.56000663039998,-239.56000663039998,-239.72349224999996,-239.72349224999996,-239.72349224999996,-244.40866259999999\n2017-03-13,237.85,237.24,237.81,237.59,239.25440609996798,-239.25440609996798,-239.44464779249998,-239.44464779249998,-239.44464779249998,-243.97522947\n2017-03-14,237.24,236.19,236.9,237.22,238.97325361197053,-238.97325361197053,-239.185322447025,-239.185322447025,-239.185322447025,-243.56346799649998\n2017-03-15,239.43,237.29,238.95,237.56,235.74,235.74,235.74,235.74,235.74,-243.172294596675\n2017-03-16,239.2,238.1,238.48,239.12,235.81380000000001,235.81380000000001,235.81380000000001,235.81380000000001,235.81380000000001,-242.80067986684125\n2017-03-17,237.97,237.03,237.03,237.75,235.88612400000002,235.88612400000002,235.88612400000002,235.88612400000002,235.88612400000002,-242.4476458734992\n2017-03-20,237.36,236.33,236.77,237.01,235.95700152000003,235.95700152000003,235.95700152000003,235.95700152000003,235.95700152000003,-242.11226357982423\n2017-03-21,237.61,233.58,233.73,237.49,239.43,-239.43,-239.43,-239.43,-239.43,-241.79365040083303\n2017-03-22,234.61,233.05,234.28,233.73,239.31300000000002,-239.31300000000002,-239.2545,-239.2545,-239.2545,-241.2186948727747\n2017-03-23,235.34,233.6,234.03,233.98,239.06248000000002,-239.06248000000002,-238.944275,-238.944275,-238.944275,-240.48351233422497\n2017-03-24,235.04,232.96,233.86,234.35,238.82198080000003,-238.82198080000003,-238.64956125,-238.64956125,-238.64956125,-239.81449622414473\n2017-03-27,233.92,231.61,233.62,231.97,238.47026195200004,-238.47026195200004,-238.2512919625,-238.2512919625,-238.2512919625,-239.06050163948882\n2017-03-28,235.81,233.14,235.32,233.32,237.92144099584004,-237.92144099584004,-237.653575685875,-237.653575685875,-237.653575685875,-238.09193642635526\n2017-03-29,235.81,234.73,235.54,235.0,237.41652571617283,-237.41652571617283,-237.10965387414626,-237.10965387414626,-237.10965387414626,-237.24928469092907\n2017-03-30,236.52,235.27,236.29,235.5,236.952003658879,-236.952003658879,-236.6146850254731,-236.6146850254731,-236.6146850254731,226.9778\n2017-03-31,236.51,235.68,235.74,235.91,236.52464336616868,-236.52464336616868,-236.52,-236.52,-236.52,227.168644\n2017-04-03,236.03,233.92,235.33,235.79,236.52,-236.52,-236.52,-236.52,-236.52,227.35567112\n2017-04-04,235.58,234.56,235.48,235.0,236.51,-236.51,-236.51,-236.51,-236.51,227.5389576976\n2017-04-05,237.39,234.55,234.78,236.26,231.61,231.61,231.61,231.61,231.61,227.71857854364802\n2017-04-06,236.04,234.43,235.44,234.96,231.72560000000001,231.72560000000001,231.72560000000001,231.72560000000001,231.72560000000001,228.00872118733858\n2017-04-07,236.0,234.64,235.2,235.18,231.83888800000003,231.83888800000003,231.83888800000003,231.83888800000003,231.83888800000003,228.29015955171843\n2017-04-10,236.25,234.73,235.34,235.36,231.94991024000004,231.94991024000004,231.94991024000004,231.94991024000004,231.94991024000004,228.56315476516687\n2017-04-11,235.18,233.34,235.06,234.9,232.05871203520005,232.05871203520005,232.05871203520005,232.05871203520005,232.05871203520005,228.82796012221186\n2017-04-12,234.95,233.77,234.03,234.8,232.16533779449605,232.16533779449605,232.16533779449605,232.16533779449605,232.16533779449605,229.0848213185455\n2017-04-13,234.49,232.51,232.51,233.65,232.26983103860613,232.26983103860613,232.26983103860613,232.26983103860613,232.26983103860613,229.33397667898913\n2017-04-17,234.57,232.88,234.57,233.12,232.372234417834,232.372234417834,232.372234417834,232.372234417834,232.372234417834,229.57565737861947\n2017-04-18,234.49,233.08,233.87,233.71,232.4725897294773,232.4725897294773,232.4725897294773,232.4725897294773,232.4725897294773,229.81008765726088\n2017-04-19,234.95,233.18,233.44,234.52,232.57093793488775,232.57093793488775,232.57093793488775,232.57093793488775,232.57093793488775,230.03748502754306\n2017-04-20,235.85,233.78,235.34,234.14,232.66731917619,232.66731917619,232.66731917619,232.66731917619,232.66731917619,230.25806047671676\n2017-04-21,235.3,234.13,234.59,235.22,232.7617727926662,232.7617727926662,232.7617727926662,232.7617727926662,232.7617727926662,230.47201866241525\n2017-04-24,237.41,236.61,237.17,237.17,232.85433733681288,232.85433733681288,232.85433733681288,232.85433733681288,232.85433733681288,230.67955810254279\n2017-04-25,238.95,237.81,238.55,237.93,233.03656384334036,233.03656384334036,232.99100721670848,232.99100721670848,232.99100721670848,230.94877577844107\n2017-04-26,239.53,238.35,238.4,238.53,233.39137001273994,233.39137001273994,233.22936692804015,233.22936692804015,233.22936692804015,231.34883698951901\n2017-04-27,238.95,237.98,238.6,238.74,233.88246041172076,233.88246041172076,233.54439858163815,233.54439858163815,233.54439858163815,231.83970677014787\n2017-04-28,238.93,237.93,238.08,238.93,234.3342635787831,234.3342635787831,233.84367865255624,233.84367865255624,233.84367865255624,232.301124363939\n2017-05-01,239.17,238.2,238.68,238.66,234.74992249248044,234.74992249248044,234.12799471992844,234.12799471992844,234.12799471992844,232.73485690210268\n2017-05-02,238.98,238.3,238.77,238.82,235.132328693082,235.132328693082,234.39809498393203,234.39809498393203,234.39809498393203,233.14256548797653\n2017-05-03,238.73,237.7,238.48,238.29,235.48414239763545,235.48414239763545,234.65469023473543,234.65469023473543,234.65469023473543,233.52581155869794\n2017-05-04,238.92,237.78,238.76,238.81,235.80781100582462,235.80781100582462,234.89845572299865,234.89845572299865,234.89845572299865,233.88606286517606\n2017-05-05,239.72,238.69,239.7,239.16,236.10558612535866,236.10558612535866,235.13003293684872,235.13003293684872,235.13003293684872,234.22469909326549\n2017-05-08,239.92,239.17,239.66,239.77,236.4670275128228,236.4670275128228,235.4054309606378,235.4054309606378,235.4054309606378,234.6093701567369\n2017-05-09,240.19,239.04,239.44,239.94,236.88138421128406,236.88138421128406,235.72145079339316,235.72145079339316,235.72145079339316,235.03422054419795\n2017-05-10,239.87,239.16,239.87,239.37,237.34459042170428,237.34459042170428,236.0789347299217,236.0789347299217,236.0789347299217,235.49824069522015\n2017-05-11,239.57,238.14,239.38,239.31,237.7429477626657,237.7429477626657,236.40781995152798,236.40781995152798,236.40781995152798,235.92049903265033\n2017-05-12,239.21,238.67,238.98,239.05,238.0855350758925,238.0855350758925,236.71039435540575,236.71039435540575,236.71039435540575,236.3047541197118\n2017-05-15,240.44,239.45,240.3,239.49,238.14,238.14,236.98876280697328,236.98876280697328,236.98876280697328,236.65442624893774\n2017-05-16,240.67,239.63,240.08,240.64,238.50799999999998,238.50799999999998,237.29937415434568,237.29937415434568,237.29937415434568,237.03298362404396\n2017-05-17,238.64,235.75,235.82,238.09,240.67,-240.67,-240.67,-240.67,-240.67,-245.4834\n2017-05-18,237.75,235.43,236.77,235.7,240.67,-240.67,-240.67,-240.67,-240.67,-245.191398\n2017-05-19,239.08,237.27,238.31,237.36,240.4604,-240.4604,-240.408,-240.408,-240.408,-244.7033281\n2017-05-22,239.71,238.82,239.52,238.87,240.259184,-240.259184,-240.1591,-240.1591,-240.1591,-244.239661695\n2017-05-23,240.24,239.52,240.05,239.98,235.43,235.43,235.43,235.43,235.43,-243.79917861025\n2017-05-24,240.73,239.93,240.61,240.33,235.52620000000002,235.52620000000002,235.52620000000002,235.52620000000002,235.52620000000002,-243.38071967973752\n2017-05-25,242.08,240.97,241.76,241.22,235.73435200000003,235.73435200000003,235.68231400000002,235.68231400000002,235.68231400000002,-242.98318369575065\n2017-05-26,241.9,241.45,241.71,241.59,236.11509088000003,236.11509088000003,235.93822144,235.93822144,235.93822144,-242.6055245109631\n2017-05-30,241.79,241.16,241.5,241.32,236.47298542720003,236.47298542720003,236.1838925824,236.1838925824,236.1838925824,-242.24674828541495\n2017-05-31,241.88,240.64,241.44,241.84,236.80940630156803,236.80940630156803,236.419736879104,236.419736879104,236.419736879104,-241.90591087114421\n2017-06-01,243.36,241.65,243.36,241.97,237.12564192347395,237.12564192347395,236.64614740393984,236.64614740393984,236.64614740393984,230.72140000000002\n2017-06-02,244.35,243.08,244.17,243.45,237.62439056959604,237.62439056959604,236.98184003374286,236.98184003374286,236.98184003374286,230.974172\n2017-06-05,244.3,243.76,243.99,244.02,238.29695151263644,238.29695151263644,237.4239296317183,237.4239296317183,237.4239296317183,231.37544684000002\n2017-06-06,243.98,243.12,243.21,243.34,238.9022563613728,238.9022563613728,237.83949385381518,237.83949385381518,237.83949385381518,231.76468343480002\n2017-06-07,243.92,242.83,243.66,243.61,239.44703072523552,239.44703072523552,238.23012422258628,238.23012422258628,238.23012422258628,232.14224293175602\n2017-06-08,244.33,243.17,243.78,243.8,239.93732765271196,239.93732765271196,238.5973167692311,238.5973167692311,238.5973167692311,232.50847564380334\n2017-06-09,245.01,241.95,243.41,244.07,240.37859488744076,240.37859488744076,238.94247776307722,238.94247776307722,238.94247776307722,232.86372137448924\n2017-06-12,243.42,242.38,243.36,243.09,240.93436350094785,240.93436350094785,239.36720431966182,239.36720431966182,239.36720431966182,233.34957251950968\n2017-06-13,244.61,243.58,244.55,243.98,241.4234398808341,241.4234398808341,239.7622000172855,239.7622000172855,239.7622000172855,233.8159896187293\n2017-06-14,244.87,243.3,244.24,244.86,241.85382709513402,241.85382709513402,240.12954601607552,240.12954601607552,240.12954601607552,234.26375003398013\n2017-06-15,243.91,242.37,243.77,242.69,242.23256784371793,242.23256784371793,240.47117779495022,240.47117779495022,240.47117779495022,234.69360003262094\n2017-06-16,242.83,241.64,242.64,242.83,245.01,-245.01,240.78889534930371,240.78889534930371,240.78889534930371,235.1062560313161\n2017-06-19,244.73,243.48,244.66,243.61,244.9426,-244.9426,241.08437267485246,241.08437267485246,241.08437267485246,235.50240579006345\n2017-06-20,244.26,242.99,243.01,244.23,244.87654799999999,-244.87654799999999,241.35916658761278,241.35916658761278,241.35916658761278,235.8827095584609\n2017-06-21,243.59,242.42,242.95,243.46,244.81181704,-244.81181704,241.61472492647988,241.61472492647988,241.61472492647988,236.24780117612246\n2017-06-22,243.53,242.64,242.84,242.96,244.7483806992,-244.7483806992,241.8523941816263,241.8523941816263,241.8523941816263,236.59828912907756\n2017-06-23,243.51,242.47,243.13,242.88,244.686213085216,-244.686213085216,242.07342658891244,242.07342658891244,242.07342658891244,236.93475756391445\n2017-06-26,244.38,243.05,243.29,243.93,244.62528882351168,-244.62528882351168,242.27898672768856,242.27898672768856,242.27898672768856,237.25776726135786\n2017-06-27,243.38,241.31,241.33,243.01,244.56558304704146,-244.56558304704146,-245.01,-245.01,-245.01,237.56785657090353\n2017-06-28,243.71,242.24,243.49,242.51,244.4353597251598,-244.4353597251598,-244.899,-244.899,-244.899,237.86554230806738\n2017-06-29,243.72,239.96,241.35,243.62,244.3103453361534,-244.3103453361534,-244.79133,-244.79133,-244.79133,238.15132061574468\n2017-06-30,242.71,241.58,241.8,242.3,244.0493246159842,-244.0493246159842,-244.54976349999998,-244.54976349999998,-244.54976349999998,238.4256677911149\n2017-07-03,243.38,242.21,242.21,242.9,243.80396513902517,-243.80396513902517,-244.32027532499998,-244.32027532499998,-244.32027532499998,238.68904107947031\n2017-07-05,243.01,241.7,242.77,242.61,243.57332723068365,-243.57332723068365,-244.10226155874997,-244.10226155874997,-244.10226155874997,238.94187943629152\n2017-07-06,242.03,240.34,240.55,241.86,243.38,-243.38,-243.89514848081248,-243.89514848081248,-243.89514848081248,239.18460425883984\n2017-07-07,242.28,241.02,242.11,241.18,243.1748,-243.1748,-243.69839105677187,-243.69839105677187,-243.69839105677187,239.41762008848625\n2017-07-10,242.8,241.78,242.37,241.98,242.981912,-242.981912,-243.51147150393328,-243.51147150393328,-243.51147150393328,239.64131528494678\n2017-07-11,242.55,240.85,242.19,242.12,242.80059728,-242.80059728,-243.3338979287366,-243.3338979287366,-243.3338979287366,239.8560626735489\n2017-07-12,244.2,243.31,244.01,243.31,239.96,239.96,239.96,239.96,239.96,240.06222016660695\n2017-07-13,244.55,243.76,244.42,244.02,240.0448,240.0448,240.0448,240.0448,240.0448,240.26013135994268\n2017-07-14,245.97,244.31,245.56,244.4,240.225008,240.225008,240.179956,240.179956,240.179956,240.45012610554497\n2017-07-17,245.91,245.34,245.53,245.44,240.56970752,240.56970752,240.41155776,240.41155776,240.41155776,240.72611980026772\n2017-07-18,245.72,244.67,245.66,245.06,240.8937250688,240.8937250688,240.6338954496,240.6338954496,240.6338954496,240.98831381025434\n2017-07-19,247.0,246.01,246.99,246.01,241.198301564672,241.198301564672,240.847339631616,240.847339631616,240.847339631616,241.2373981197416\n2017-07-20,247.42,246.47,247.1,247.25,241.66243743949823,241.66243743949823,241.1549726500352,241.1549726500352,241.1549726500352,241.58315423255712\n2017-07-21,246.91,246.18,246.88,246.43,242.2381936955484,242.2381936955484,241.5308742910331,241.5308742910331,241.5308742910331,241.9917334362781\n2017-07-24,246.98,246.29,246.82,246.81,242.75637432599356,242.75637432599356,241.8842218335711,241.8842218335711,241.8842218335711,242.37171209573864\n2017-07-25,247.8,247.16,247.42,247.7,243.2227368933942,243.2227368933942,242.21636852355684,242.21636852355684,242.21636852355684,242.72509224903695\n2017-07-26,247.79,247.13,247.43,247.78,243.7720084661869,243.7720084661869,242.60722272690785,242.60722272690785,242.60722272690785,243.131084869114\n2017-07-27,248.0,245.68,247.2,247.96,244.25536745024448,244.25536745024448,242.9707171360243,242.9707171360243,242.9707171360243,243.5045980795849\n2017-07-28,247.06,246.14,246.91,246.7,244.77961600721025,244.77961600721025,243.37305976514236,243.37305976514236,243.37305976514236,243.90918425242225\n2017-07-31,247.48,246.53,246.77,247.38,245.23046976620083,245.23046976620083,243.74321498393098,243.74321498393098,243.74321498393098,244.27735766970426\n2017-08-01,247.5,246.8,247.32,247.45,245.6182039989327,245.6182039989327,244.0837577852165,244.0837577852165,244.0837577852165,244.6123954794309\n2017-08-02,247.6,246.37,247.44,247.47,245.95165543908212,245.95165543908212,244.3970571623992,244.3970571623992,244.3970571623992,244.9172798862821\n2017-08-03,247.34,246.64,246.96,247.31,246.23842367761063,246.23842367761063,244.68529258940725,244.68529258940725,244.68529258940725,245.19472469651672\n2017-08-04,247.79,246.97,247.41,247.52,246.37,246.37,244.95046918225466,244.95046918225466,244.95046918225466,245.4471994738302\n2017-08-07,247.87,247.37,247.87,247.5,246.5982,246.5982,245.1944316476743,245.1944316476743,245.1944316476743,245.6769515211855\n2017-08-08,248.9,246.83,247.26,247.49,246.794452,246.794452,245.41887711586034,245.41887711586034,245.41887711586034,245.88602588427878\n2017-08-09,247.31,246.06,247.25,246.46,248.9,-248.9,245.73217817543292,245.73217817543292,245.73217817543292,-253.87800000000001\n2017-08-10,246.43,243.7,243.76,246.3,248.9,-248.9,-248.9,-248.9,-248.9,-253.64346\n2017-08-11,244.8,243.75,244.12,244.0,248.692,-248.692,-248.744,-248.744,-248.744,-253.146287\n2017-08-14,246.79,245.55,246.54,245.55,248.49232,-248.49232,-248.59268,-248.59268,-248.59268,-252.67397265\n2017-08-15,247.0,246.16,246.51,247.0,248.3006272,-248.3006272,-248.4458996,-248.4458996,-248.4458996,-252.2252740175\n2017-08-16,247.57,246.46,246.94,247.09,248.116602112,-248.116602112,-248.303522612,-248.303522612,-248.303522612,-251.799010316625\n2017-08-17,246.6,243.09,243.09,246.26,247.93993802752001,-247.93993802752001,-248.16541693364,-248.16541693364,-248.16541693364,-251.39405980079374\n2017-08-18,244.19,242.2,242.71,242.95,247.64894174586883,-247.64894174586883,-247.911646086958,-247.911646086958,-247.911646086958,-250.81277561473817\n2017-08-21,243.2,241.83,242.9,242.64,247.2130264061993,-247.2130264061993,-247.51183086087093,-247.51183086087093,-247.51183086087093,-250.03762580941174\n2017-08-22,245.62,243.55,245.44,243.6,246.6747237655794,-246.6747237655794,-247.00046608339255,-247.00046608339255,-247.00046608339255,-249.13478697037644\n2017-08-23,245.05,244.18,244.56,244.34,246.19025138902145,-246.19025138902145,-246.53512413588723,-246.53512413588723,-246.53512413588723,-248.33126040363504\n2017-08-24,245.18,243.75,243.99,245.0,245.7542262501193,-245.7542262501193,-246.11166296365738,-246.11166296365738,-246.11166296365738,-247.6161217592352\n2017-08-25,245.61,244.39,244.56,244.89,241.83,241.83,-245.72631329692823,-245.72631329692823,-245.72631329692823,-246.97964836571933\n2017-08-28,245.19,244.09,244.57,245.17,241.90560000000002,241.90560000000002,-245.61,-245.61,-245.61,-246.4131870454902\n2017-08-29,245.15,242.93,244.85,243.13,241.979688,241.979688,-245.61,-245.61,-245.61,-245.90903647048626\n2017-08-30,246.32,244.62,246.01,244.86,242.05229424,242.05229424,241.83,241.83,241.83,236.9934\n2017-08-31,247.77,246.61,247.49,246.75,242.22300247040002,242.22300247040002,241.9198,241.9198,241.9198,237.179932\n2017-09-01,248.33,247.67,247.84,247.98,242.55582232217603,242.55582232217603,242.09530600000002,242.09530600000002,242.09530600000002,237.49763404\n2017-09-05,247.52,244.95,246.06,247.27,243.01775653640195,243.01775653640195,242.34469376,242.34469376,242.34469376,237.93092867840002\n2017-09-06,247.28,246.23,246.9,246.87,243.4427360134898,243.4427360134898,242.58410600960002,242.58410600960002,242.58410600960002,238.34689153126402\n2017-09-07,247.27,246.4,246.87,247.27,243.8337171324106,243.8337171324106,242.81394176921603,242.81394176921603,242.81394176921603,238.74621587001346\n2017-09-08,247.1,246.3,246.58,246.54,244.19341976181775,244.19341976181775,243.0345840984474,243.0345840984474,243.0345840984474,239.12956723521293\n2017-09-11,249.3,248.03,249.21,248.04,244.52434618087233,244.52434618087233,243.2464007345095,243.2464007345095,243.2464007345095,239.49758454580441\n2017-09-12,250.07,249.42,250.05,249.64,245.0019115627851,245.0019115627851,243.54908069778404,243.54908069778404,243.54908069778404,239.9877053185142\n2017-09-13,250.21,249.6,250.17,249.73,245.61008217525088,245.61008217525088,243.940335855917,243.940335855917,243.940335855917,240.59264299940335\n2017-09-14,250.32,249.6,250.09,249.83,246.25407067071575,246.25407067071575,244.37921234600282,244.37921234600282,244.37921234600282,241.26585798944512\n2017-09-15,249.29,248.57,249.19,248.7,246.90461936340122,246.90461936340122,244.8544753583226,244.8544753583226,244.8544753583226,241.9901893502895\n2017-09-18,250.11,249.28,249.72,249.62,247.45108026525702,247.45108026525702,245.2917173296568,245.2917173296568,245.2917173296568,242.65657420226634\n2017-09-19,250.07,249.6,249.97,250.0,247.91010742281588,247.91010742281588,245.69397994328423,245.69397994328423,245.69397994328423,243.26964826608503\n2017-09-20,250.19,248.92,250.06,250.07,248.29569023516535,248.29569023516535,246.0640615478215,246.0640615478215,246.0640615478215,243.8336764047982\n2017-09-21,249.98,249.19,249.39,249.87,248.6195797975389,248.6195797975389,246.40453662399577,246.40453662399577,246.40453662399577,244.35258229241435\n2017-09-22,249.63,249.02,249.44,249.06,248.89164702993267,248.89164702993267,246.7177736940761,246.7177736940761,246.7177736940761,244.8299757090212\n2017-09-25,249.55,248.08,248.93,249.16,250.32,-250.32,247.00595179855,247.00595179855,247.00595179855,245.2691776522995\n2017-09-26,249.69,248.81,249.08,249.45,250.27519999999998,-250.27519999999998,247.271075654666,247.271075654666,247.271075654666,245.67324344011556\n2017-09-27,250.49,248.88,250.05,249.89,248.08,248.08,247.5149896022927,247.5149896022927,247.5149896022927,246.04498396490632\n2017-09-28,250.43,249.64,250.35,249.73,248.12820000000002,248.12820000000002,247.78274053808636,247.78274053808636,247.78274053808636,246.44503540806474\n2017-09-29,251.31,250.13,251.23,250.37,248.17543600000002,248.17543600000002,248.02639388965858,248.02639388965858,248.02639388965858,246.8090822213389\n2017-10-02,252.32,251.4,252.32,251.5,248.30081856,248.30081856,248.3547545006927,248.3547545006927,248.3547545006927,247.25917399920502\n2017-10-03,252.89,252.23,252.86,252.48,248.5419694464,248.5419694464,248.7909315056165,248.7909315056165,248.7909315056165,247.81586485929247\n2017-10-04,253.44,252.56,253.16,252.72,248.889811890688,248.889811890688,249.28281972494253,249.28281972494253,249.28281972494253,248.4247610761774\n2017-10-05,254.68,253.41,254.66,253.54,249.3448307016192,249.3448307016192,249.8232531607,249.8232531607,249.8232531607,249.07674213627433\n2017-10-06,254.46,253.86,254.37,254.16,249.9850510174249,249.9850510174249,250.50319771820202,250.50319771820202,250.50319771820202,249.86119823719594\n2017-10-09,254.7,253.65,253.95,254.65,250.54844489533392,250.54844489533392,251.08795003765374,251.08795003765374,251.08795003765374,250.53583048398852\n2017-10-10,255.05,253.98,254.62,254.59,251.12966260998718,251.12966260998718,251.62975753200567,251.62975753200567,251.62975753200567,251.16045591139024\n2017-10-11,255.02,254.32,255.02,254.53,251.75691659238925,251.75691659238925,252.17699632688476,252.17699632688476,252.17699632688476,251.7827829655678\n2017-10-12,255.06,254.37,254.64,254.68,252.28380993760697,252.28380993760697,252.6366769145832,252.6366769145832,252.6366769145832,252.30553769107695\n2017-10-13,255.27,254.76,254.95,255.15,252.78352414883773,252.78352414883773,253.04864183910405,253.04864183910405,253.04864183910405,252.77379628359387\n2017-10-16,255.5,254.82,255.29,255.2,253.2808193190702,253.2808193190702,253.44848630806533,253.44848630806533,253.44848630806533,253.22311295254698\n2017-10-17,255.52,254.98,255.47,255.24,253.72465545525614,253.72465545525614,253.83827390953292,253.83827390953292,253.83827390953292,253.65572149156307\n2017-10-18,255.95,255.5,255.72,255.92,254.08372436420493,254.08372436420493,254.17461912762633,254.17461912762633,254.17461912762633,254.02857719325047\n2017-10-19,255.82,254.35,255.79,254.83,255.95,-255.95,-255.95,-255.95,-255.95,-261.06899999999996\n2017-10-20,257.14,256.42,257.11,256.73,254.35,254.35,254.35,254.35,254.35,-260.86742999999996\n2017-10-23,257.51,256.02,256.11,257.51,254.35,254.35,254.35,254.35,254.35,-260.67190709999994\n2017-10-24,256.83,256.15,256.56,256.56,254.47639999999998,254.47639999999998,254.4448,254.4448,254.4448,-260.48224988699997\n2017-10-25,256.31,254.0,255.29,256.23,257.51,-257.51,-257.51,-257.51,-257.51,-260.29828239038994\n2017-10-26,256.3,255.56,255.62,256.01,257.4398,-257.4398,-257.4047,-257.4047,-257.4047,-259.98336827087047\n2017-10-27,257.89,256.16,257.71,256.47,254.0,254.0,254.0,254.0,254.0,-259.684199857327\n2017-10-30,257.6,256.41,256.75,257.09,254.0778,254.0778,254.0778,254.0778,254.0778,-259.3999898644606\n2017-10-31,257.44,256.81,257.15,257.21,254.154044,254.154044,254.154044,254.154044,254.154044,-259.12999037123757\n2017-11-01,258.43,257.07,257.49,258.1,254.22876312,254.22876312,254.22876312,254.22876312,254.22876312,-258.8734908526757\n2017-11-02,257.75,256.19,257.59,257.43,254.3968125952,254.3968125952,254.3548002264,254.3548002264,254.3548002264,-258.62981631004186\n2017-11-03,258.5,257.31,258.45,257.82,254.558140091392,254.558140091392,254.477056219608,254.477056219608,254.477056219608,248.92\n2017-11-06,259.0,258.22,258.85,258.31,254.7946516859085,254.7946516859085,254.63797397082368,254.63797397082368,254.63797397082368,249.11159999999998\n2017-11-07,259.35,258.09,258.67,259.0,255.1310795510358,255.1310795510358,254.8560752722825,254.8560752722825,254.8560752722825,249.40825199999998\n2017-11-08,259.22,258.15,259.11,258.46,255.55297159593223,255.55297159593223,255.12571075594556,255.12571075594556,255.12571075594556,249.80592191999997\n2017-11-09,258.39,256.36,258.17,257.74,255.93267443633903,255.93267443633903,255.37916811058884,255.37916811058884,255.37916811058884,250.18768504319996\n2017-11-10,258.21,257.37,258.09,257.71,256.2744069927051,256.2744069927051,255.61741802395352,255.61741802395352,255.61741802395352,250.55417764147197\n2017-11-13,258.59,257.27,258.33,257.32,256.36,256.36,255.8413729425163,255.8413729425163,255.8413729425163,250.9060105358131\n2017-11-14,257.85,256.52,257.73,257.44,259.35,-259.35,256.0518905659653,256.0518905659653,256.0518905659653,251.24377011438057\n2017-11-15,257.22,255.63,256.44,256.62,259.2934,-259.2934,-259.35,-259.35,-259.35,251.56801930980535\n2017-11-16,259.04,257.48,258.62,257.52,259.146864,-259.146864,-259.2384,-259.2384,-259.2384,251.87929853741315\n2017-11-17,258.44,257.78,257.86,258.2,259.04,-259.04,-259.130148,-259.130148,-259.130148,252.17812659591664\n2017-11-20,258.52,257.86,258.3,258.15,259.04,-259.04,-259.04,-259.04,-259.04,252.46500153207998\n2017-11-21,260.2,259.1,259.99,259.19,255.63,255.63,255.63,255.63,255.63,252.74040147079677\n2017-11-22,260.15,259.58,259.76,260.07,255.7214,255.7214,255.7214,255.7214,255.7214,253.11338139725694\n2017-11-24,260.48,260.16,260.36,260.32,255.810972,255.810972,255.810972,255.810972,255.810972,253.4677123273941\n2017-11-27,260.75,260.0,260.23,260.38,255.99773312,255.99773312,255.95104283999999,255.95104283999999,255.95104283999999,253.88844958775047\n2017-11-28,262.9,260.66,262.87,260.79,256.2828691328,256.2828691328,256.1430011264,256.1430011264,256.1430011264,254.36875811660795\n2017-11-29,263.63,262.2,262.71,263.05,256.81223960217596,256.81223960217596,256.48085107008,256.48085107008,256.48085107008,255.0512574672793\n2017-11-30,266.05,263.67,265.01,263.8,257.49401564195836,257.49401564195836,256.9098000058752,256.9098000058752,256.9098000058752,255.82334429522416\n2017-12-01,265.31,260.76,264.46,264.8,258.52073376492336,258.52073376492336,257.5496140054639,257.5496140054639,257.5496140054639,256.8460098657017\n2017-12-04,266.79,264.12,264.14,266.38,259.42424571313256,259.42424571313256,258.14464102508146,258.14464102508146,258.14464102508146,257.7664088791315\n2017-12-05,265.15,263.04,263.19,264.4,260.455451313294,260.455451313294,258.8362697430749,258.8362697430749,258.8362697430749,258.759003902427\n2017-12-06,263.73,262.72,263.24,262.84,261.34228812943286,261.34228812943286,259.4725681636289,259.4725681636289,259.4725681636289,259.64241347316005\n2017-12-07,264.43,262.94,264.07,263.08,262.1049677913123,262.1049677913123,260.0579627105386,260.0579627105386,260.0579627105386,260.4286479911124\n2017-12-08,265.52,264.72,265.51,265.0,262.72,262.72,260.5965256936955,260.5965256936955,260.5965256936955,261.1283967120901\n2017-12-11,266.38,265.49,266.31,265.6,262.94,262.94,261.0920036381999,261.0920036381999,261.0920036381999,261.7511730737602\n2017-12-12,267.32,266.35,266.78,266.6,263.479,263.479,261.5478433471439,261.5478433471439,261.5478433471439,262.3054440356466\n2017-12-13,267.56,266.66,266.75,267.05,264.09355999999997,264.09355999999997,262.06733744590093,262.06733744590093,262.06733744590093,262.907190751369\n2017-12-14,267.21,265.6,265.66,267.09,264.71751919999997,264.71751919999997,262.61660370131085,262.61660370131085,262.61660370131085,263.512055953691\n2017-12-15,267.04,265.39,266.51,265.54,265.229165744,265.229165744,263.1109433311798,263.1109433311798,263.1109433311798,264.0382886797112\n2017-12-18,268.6,267.98,268.2,268.1,265.39,265.39,263.5558489980618,263.5558489980618,263.5558489980618,264.4961111513487\n2017-12-19,268.53,267.09,267.17,268.51,265.39,265.39,264.110705608275,264.110705608275,264.110705608275,265.0706555901599\n2017-12-20,268.33,266.69,267.03,268.25,266.032,266.032,264.60452799136476,264.60452799136476,264.60452799136476,265.56476380753753\n2017-12-21,268.39,267.3,267.58,267.73,266.5456,266.5456,265.0440299123146,265.0440299123146,265.0440299123146,265.98969687448226\n2017-12-22,267.63,266.9,267.51,267.61,266.69,266.69,265.43518662196,265.43518662196,265.43518662196,266.35513931205475\n2017-12-26,267.38,266.89,267.19,267.02,268.6,-268.6,265.7833160935444,265.7833160935444,265.7833160935444,266.6694198083671\n2017-12-27,267.73,267.02,267.32,267.35,268.5658,-268.5658,266.0931513232545,266.0931513232545,266.0931513232545,266.89\n2017-12-28,267.92,267.45,267.87,267.87,268.532284,-268.532284,266.36890467769655,266.36890467769655,266.36890467769655,266.89\n2017-12-29,268.55,266.64,266.86,268.55,266.64,266.64,266.61432516314994,266.61432516314994,266.61432516314994,-273.97200000000004\n2018-01-02,268.81,267.4,268.77,267.86,266.64,266.64,266.64,266.64,266.64,-273.75204\n2018-01-03,270.64,268.95,270.47,268.99,266.64,266.64,266.64,266.64,266.64,-273.5386788\n2018-01-04,272.16,271.1,271.61,271.22,266.88,266.88,267.15999999999997,267.15999999999997,267.15999999999997,-273.331718436\n2018-01-05,273.56,271.95,273.42,272.56,267.3024,267.3024,267.85999999999996,267.85999999999996,267.85999999999996,261.30719999999997\n2018-01-08,274.1,272.98,273.92,273.32,267.92816,267.92816,268.715,268.715,268.715,261.55225599999994\n2018-01-09,275.24,274.09,274.54,274.43,268.6687808,268.6687808,269.5766,269.5766,269.5766,261.92868831999994\n2018-01-10,274.42,272.92,274.12,273.71,269.58875148799996,269.58875148799996,270.539378,270.539378,270.539378,262.46114078719995\n2018-01-11,276.12,274.56,276.12,274.75,270.37992627968,270.37992627968,271.33848374,271.33848374,271.33848374,262.97229515571195\n2018-01-12,278.11,276.27,277.92,276.43,271.29833807493117,271.29833807493117,272.19915666680004,272.19915666680004,272.19915666680004,263.62968039792634\n2018-01-16,280.09,276.18,276.97,279.42,272.5244372214436,272.5244372214436,273.32221690010806,273.32221690010806,273.32221690010806,264.49849957405075\n2018-01-17,280.05,277.19,279.61,278.07,274.0375497771549,274.0375497771549,274.67577352008647,274.67577352008647,274.67577352008647,265.5899046038672\n2018-01-18,279.96,278.58,279.14,279.51,275.2480398217239,275.2480398217239,275.75861881606914,275.75861881606914,275.75861881606914,266.60491128159646\n2018-01-19,280.41,279.14,280.41,279.7,276.2164318573791,276.2164318573791,276.6248950528553,276.6248950528553,276.6248950528553,267.5488674918847\n2018-01-22,282.69,280.12,282.69,280.16,277.0551454859033,277.0551454859033,277.4197670917557,277.4197670917557,277.4197670917557,268.57775809253394\n2018-01-23,283.62,282.38,283.29,282.76,278.18211638872265,278.18211638872265,278.57921833156945,278.57921833156945,278.57921833156945,269.8478598642059\n2018-01-24,284.7,281.84,283.18,284.03,279.2696931109781,279.2696931109781,279.7385981153085,279.7385981153085,279.7385981153085,271.2250738777853\n2018-01-25,284.27,282.41,283.3,284.16,280.35575448878245,280.35575448878245,280.92933456763444,280.92933456763444,280.92933456763444,272.7073157512289\n2018-01-26,286.58,283.97,286.58,284.32,281.224603591026,281.224603591026,281.8342942714022,281.8342942714022,281.8342942714022,274.02651101859374\n2018-01-29,286.42,284.5,284.68,285.99,282.2956828728208,282.2956828728208,282.41,282.41,282.41,275.5329296963625\n2018-01-30,283.29,281.22,281.76,283.2,286.58,-286.58,-286.58,-286.58,-286.58,276.858578132799\n2018-01-31,283.3,280.68,281.9,282.75,286.4728,-286.4728,-286.42,-286.42,-286.42,278.0251487568631\n2018-02-01,283.06,280.69,281.58,281.1,286.241088,-286.241088,-286.13300000000004,-286.13300000000004,-286.13300000000004,279.0517309060395\n2018-02-02,280.23,275.41,275.45,280.0,286.01864448,-286.01864448,-285.86035000000004,-285.86035000000004,-285.86035000000004,-292.3116\n2018-02-05,275.84,263.31,263.93,273.47,285.38212581119996,-285.38212581119996,-285.12882550000006,-285.12882550000006,-285.12882550000006,-291.804552\n2018-02-06,269.7,258.7,269.13,259.73,283.61635574630395,-283.61635574630395,-283.1651312050001,-283.1651312050001,-283.1651312050001,-290.3798244\n2018-02-07,272.36,267.64,267.67,268.46,281.1247201716736,-281.1247201716736,-280.47396677245007,-280.47396677245007,-280.47396677245007,-288.162236692\n2018-02-08,268.16,257.6,257.63,268.0,278.8822481545062,-278.8822481545062,-278.07883042748057,-278.07883042748057,-278.07883042748057,-286.09988012356\n2018-02-09,263.6,252.93,261.5,260.94,276.3283783759655,-276.3283783759655,-275.4165824719081,-275.4165824719081,-275.4165824719081,-283.5348909124396\n2018-02-12,266.98,261.88,265.34,263.89,273.0526054033303,-273.0526054033303,-272.04359510112187,-272.04359510112187,-272.04359510112187,-280.16835291207127\n2018-02-13,266.62,263.31,266.0,264.0,270.23544064686405,-270.23544064686405,-269.1765558359536,-269.1765558359536,-269.1765558359536,-277.17213409174343\n2018-02-14,270.0,263.97,269.59,264.4,252.93,252.93,252.93,252.93,252.93,-274.50549934165167\n2018-02-15,273.03,268.77,273.03,271.56,253.2714,253.2714,253.2714,253.2714,253.2714,247.8714\n2018-02-16,275.32,272.27,273.11,272.27,254.061744,254.061744,253.864158,253.864158,253.864158,248.374572\n2018-02-20,273.67,270.5,271.4,272.0,255.33723936,255.33723936,254.72239168000002,254.72239168000002,254.72239168000002,249.18293484\n2018-02-21,274.71,269.98,270.05,271.85,256.5362049984,256.5362049984,255.5462960128,255.5462960128,255.5462960128,249.9670467948\n2018-02-22,273.05,269.65,270.4,271.09,257.663232698496,257.663232698496,256.337244172288,256.337244172288,256.337244172288,250.727635390956\n2018-02-23,274.71,271.26,274.71,271.84,258.72263873658625,258.72263873658625,257.0965544053965,257.0965544053965,257.0965544053965,251.46540632922733\n2018-02-26,278.01,275.26,277.9,275.9,259.71848041239105,259.71848041239105,257.8254922291806,257.8254922291806,257.8254922291806,252.18104413935052\n2018-02-27,278.92,274.36,274.43,278.11,261.1818019793998,261.1818019793998,258.8347176177216,258.8347176177216,258.8347176177216,253.2142023737765\n2018-02-28,276.18,271.32,271.65,275.65,262.9556217814598,262.9556217814598,260.0398345606583,260.0398345606583,260.0398345606583,254.49949225508766\n2018-03-01,273.17,266.0,267.7,271.5,264.5520596033138,264.5520596033138,261.1726444870188,261.1726444870188,261.1726444870188,255.72051764233328\n2018-03-02,269.72,264.82,269.08,265.75,278.92,-278.92,262.2374858177976,262.2374858177976,262.2374858177976,256.8804917602166\n2018-03-05,272.89,267.61,272.19,267.75,278.63800000000003,-278.63800000000003,263.2384366687298,263.2384366687298,263.2384366687298,257.98246717220576\n2018-03-06,273.38,271.18,272.88,273.28,278.36164,-278.36164,264.179330468606,264.179330468606,264.179330468606,259.02934381359546\n2018-03-07,273.17,270.21,272.78,270.39,278.09080720000003,-278.09080720000003,265.0637706404896,265.0637706404896,265.0637706404896,260.0238766229157\n2018-03-08,274.24,272.42,274.1,273.52,277.825391056,-277.825391056,265.8951444020602,265.8951444020602,265.8951444020602,260.9686827917699\n2018-03-09,278.87,275.34,278.87,275.69,264.82,264.82,266.67663573793664,266.67663573793664,266.67663573793664,261.8662486521814\n2018-03-12,279.91,278.09,278.52,279.2,265.101,265.101,267.4112375936604,267.4112375936604,267.4112375936604,262.71893621957236\n2018-03-13,280.4,276.03,276.72,279.84,265.69336,265.69336,268.2861509621042,268.2861509621042,268.2861509621042,263.750400046398\n2018-03-14,278.02,274.67,275.3,277.81,266.5757584,266.5757584,269.2552588851359,269.2552588851359,269.2552588851359,264.91587204315016\n2018-03-15,276.6,274.43,275.0,275.85,267.40521289599997,267.40521289599997,270.146838174325,270.146838174325,270.146838174325,265.99976100012964\n2018-03-16,275.38,274.16,274.2,274.45,268.18490012224,268.18490012224,270.967091120379,270.967091120379,270.967091120379,267.00777773012055\n2018-03-19,273.38,268.63,270.49,273.34,280.4,-280.4,-280.4,-280.4,-280.4,267.9452332890121\n2018-03-20,271.67,270.18,270.95,270.91,280.16459999999995,-280.16459999999995,-280.0469,-280.0469,-280.0469,268.63\n2018-03-21,273.26,270.19,270.43,270.88,279.933908,-279.933908,-279.704393,-279.704393,-279.704393,268.63\n2018-03-22,268.86,263.37,263.67,267.85,279.70782984,-279.70782984,-279.37216121,-279.37216121,-279.37216121,-286.008\n2018-03-23,265.02,257.83,258.05,264.17,279.05431664639997,-279.05431664639997,-278.5720531495,-278.5720531495,-278.5720531495,-285.32885999999996\n2018-03-26,265.43,259.41,265.11,262.16,277.78085764761596,-277.78085764761596,-277.120109429035,-277.120109429035,-277.120109429035,-283.953917\n2018-03-27,266.77,258.87,260.6,266.17,276.583806188759,-276.583806188759,-275.7698017690025,-275.7698017690025,-275.7698017690025,-282.64772115\n2018-03-28,262.64,258.58,259.83,260.76,275.4585778174335,-275.4585778174335,-274.5140156451723,-274.5140156451723,-274.5140156451723,-281.4068350925\n2018-03-29,265.26,260.28,263.15,261.12,274.4008631483875,-274.4008631483875,-273.3461345500103,-273.3461345500103,-273.3461345500103,-280.227993337875\n2018-04-02,263.13,254.67,257.47,262.56,273.40661135948426,-273.40661135948426,-272.26000513150956,-272.26000513150956,-272.26000513150956,-279.10809367098125\n2018-04-03,261.31,256.84,260.77,258.92,271.90768245072553,-271.90768245072553,-270.6769046696737,-270.6769046696737,-270.6769046696737,-277.39742711401254\n2018-04-04,264.36,256.6,263.56,256.76,270.5286678546675,-270.5286678546675,-269.2362832494031,-269.2362832494031,-269.2362832494031,-275.80650721603166\n2018-04-05,266.64,264.33,265.64,265.55,269.2599744262941,-269.2599744262941,-267.9253177569568,-267.9253177569568,-267.9253177569568,-274.32695171090944\n2018-04-06,265.1,258.0,259.72,263.42,268.09277647219056,-268.09277647219056,-266.7323391588307,-266.7323391588307,-266.7323391588307,-272.9509650911458\n2018-04-09,264.84,260.54,261.0,261.37,267.0189543544153,-267.0189543544153,-266.64,-266.64,-266.64,-271.6712975347656\n2018-04-10,266.04,262.99,265.15,264.25,254.67,254.67,254.67,254.67,254.67,-270.481206707332\n2018-04-11,265.64,263.39,263.76,263.42,254.89739999999998,254.89739999999998,254.89739999999998,254.89739999999998,254.89739999999998,-269.37442223781875\n2018-04-12,267.0,265.06,265.93,265.28,255.12025199999997,255.12025199999997,255.12025199999997,255.12025199999997,255.12025199999997,-268.34511268117143\n2018-04-13,267.54,264.01,265.15,267.45,255.59544191999996,255.59544191999996,255.47664443999997,255.47664443999997,255.47664443999997,249.57659999999998\n2018-04-16,268.19,266.07,267.33,267.0,256.31211540479995,256.31211540479995,255.95917866239998,255.95917866239998,255.95917866239998,249.935868\n2018-04-17,270.87,268.75,270.19,269.33,257.26234617241596,257.26234617241596,256.57071972928,256.57071972928,256.57071972928,250.48349196\n2018-04-18,271.3,269.87,270.39,270.68,258.6231115551744,258.6231115551744,257.42867654552316,257.42867654552316,257.42867654552316,251.2989522816\n2018-04-19,269.86,267.72,268.89,269.59,260.1443381685535,260.1443381685535,258.39966918733654,258.39966918733654,258.39966918733654,252.29900466752002\n2018-04-20,269.06,265.62,266.61,268.87,261.4830175883271,261.4830175883271,259.302692344223,259.302692344223,259.302692344223,253.24905443414403\n2018-04-23,267.88,265.35,266.57,267.28,262.6610554777278,262.6610554777278,260.1425038801274,260.1425038801274,260.1425038801274,254.15160171243681\n2018-04-24,267.97,261.28,262.98,267.76,271.3,-271.3,260.92352860851844,260.92352860851844,260.92352860851844,255.00902162681498\n2018-04-25,264.13,260.85,263.63,262.94,271.0996,-271.0996,-271.3,-271.3,-271.3,255.82357054547424\n2018-04-26,267.24,264.29,266.31,264.86,270.689616,-270.689616,-270.98650000000004,-270.98650000000004,-270.98650000000004,256.59739201820054\n2018-04-27,267.33,265.5,266.56,267.0,270.29603136000003,-270.29603136000003,-270.682405,-270.682405,-270.682405,257.33252241729053\n2018-04-30,267.89,264.44,264.51,267.26,269.91819010560005,-269.91819010560005,-270.38743285000004,-270.38743285000004,-270.38743285000004,258.030896296426\n2018-05-01,265.1,262.12,264.98,263.87,269.55546250137604,-269.55546250137604,-270.1013098645,-270.1013098645,-270.1013098645,258.6943514816047\n2018-05-02,265.68,262.77,263.2,264.77,269.207244001321,-269.207244001321,-269.823770568565,-269.823770568565,-269.823770568565,259.32463390752446\n2018-05-03,263.36,259.05,262.62,262.28,268.87295424126813,-268.87295424126813,-269.55455745150806,-269.55455745150806,-269.55455745150806,-276.726\n2018-05-04,266.78,261.15,266.02,261.52,268.28357698679207,-268.28357698679207,-269.0293295789327,-269.0293295789327,-269.0293295789327,-276.19572\n2018-05-07,268.02,266.11,266.92,266.91,259.05,259.05,-268.53036309998606,-268.53036309998606,-268.53036309998606,-275.6813484\n2018-05-08,267.32,265.15,266.92,266.48,259.2294,259.2294,-268.05634494498673,-268.05634494498673,-268.05634494498673,-275.182407948\n2018-05-09,269.86,267.1,269.5,267.67,259.405212,259.405212,259.05,259.05,259.05,-274.69843570956\n2018-05-10,272.39,270.23,272.02,270.34,259.82340352,259.82340352,259.2662,259.2662,259.2662,-274.2289826382732\n2018-05-11,273.14,271.58,272.85,272.25,260.5773993088,260.5773993088,259.659914,259.659914,259.659914,-273.773613159125\n2018-05-14,274.07,272.37,272.98,273.34,261.582407364096,261.582407364096,260.19911744,260.19911744,260.19911744,253.869\n2018-05-15,271.61,270.03,271.1,271.52,262.8311666276864,262.8311666276864,260.892661568,260.892661568,260.892661568,254.27302\n2018-05-16,272.75,271.1,272.24,271.11,263.95504996491775,263.95504996491775,261.5515284896,261.5515284896,261.5515284896,254.6689596\n2018-05-17,273.23,271.14,272.01,271.93,264.966544968426,264.966544968426,262.17745206512,262.17745206512,262.17745206512,255.056980408\n2018-05-18,272.02,270.93,271.33,271.61,265.87689047158335,265.87689047158335,262.772079461864,262.772079461864,262.772079461864,255.43724079984\n2018-05-21,273.98,272.6,273.37,272.99,266.696201424425,266.696201424425,263.3369754887708,263.3369754887708,263.3369754887708,255.8098959838432\n2018-05-22,274.25,272.25,272.61,273.94,267.43358128198247,267.43358128198247,263.87362671433226,263.87362671433226,263.87362671433226,256.1750980641663\n2018-05-23,273.39,270.99,273.36,271.19,268.25155152814455,268.25155152814455,264.49620911147235,264.49620911147235,264.49620911147235,256.71734512224134\n2018-05-24,273.22,270.78,272.8,272.95,268.9713653447672,268.9713653447672,265.081436564784,265.081436564784,265.081436564784,257.2433247685741\n2018-05-25,272.86,271.58,272.15,272.15,269.60480150339515,269.60480150339515,265.63155037089695,265.63155037089695,265.63155037089695,257.75352502551686\n2018-05-29,271.17,267.76,269.02,270.26,274.25,-274.25,266.14865734864316,266.14865734864316,266.14865734864316,258.24841927475137\n2018-05-30,273.1,270.43,272.61,270.5,274.1202,-274.1202,266.63473790772457,266.63473790772457,266.63473790772457,258.7284666965088\n2018-05-31,272.48,270.26,270.94,272.2,273.992996,-273.992996,267.0916536332611,267.0916536332611,267.0916536332611,259.1941126956135\n2018-06-01,273.94,272.33,273.6,272.49,267.76,267.76,267.5211544152654,267.5211544152654,267.5211544152654,259.6457893147451\n2018-06-04,275.18,274.27,274.9,274.51,267.8836,267.8836,267.9248851503495,267.9248851503495,267.9248851503495,260.0839156353028\n2018-06-05,275.53,274.19,275.1,275.02,268.175456,268.175456,268.43274318982503,268.43274318982503,268.43274318982503,260.68775900989067\n2018-06-06,277.52,275.09,277.4,275.9,268.61672864,268.61672864,269.00052373463905,269.00052373463905,269.00052373463905,261.42987105939613\n2018-06-07,278.28,276.34,277.37,277.98,269.3289903488,269.3289903488,269.7672765985215,269.7672765985215,269.7672765985215,262.3952787958324\n2018-06-08,278.25,276.67,278.19,276.78,270.22409131392,270.22409131392,270.61854893866933,270.61854893866933,270.61854893866933,263.50720928012413\n2018-06-11,279.37,278.31,278.56,278.42,271.029682182528,271.029682182528,271.3846940448024,271.3846940448024,271.3846940448024,264.5413046305154\n2018-06-12,279.33,278.2,278.92,279.05,272.03052032062465,272.03052032062465,272.26307769987415,272.26307769987415,272.26307769987415,265.72760026007415\n2018-06-13,279.48,277.8,278.03,279.21,272.9112578821497,272.9112578821497,273.044839152888,273.044839152888,273.044839152888,266.8189922392682\n2018-06-14,279.33,278.06,278.73,279.01,273.83088177864875,273.83088177864875,273.81705845454144,273.81705845454144,273.81705845454144,267.95848293773406\n2018-06-15,277.5,275.35,277.13,276.65,274.62175832963794,274.62175832963794,274.49661143999646,274.49661143999646,274.49661143999646,268.995419473338\n2018-06-18,276.7,274.95,276.56,275.47,279.48,-279.48,-279.48,-279.48,-279.48,269.9390317207376\n2018-06-19,275.75,273.53,275.5,273.98,279.3894,-279.3894,-279.3441,-279.3441,-279.3441,270.7977188658712\n2018-06-20,276.72,275.59,275.97,276.27,279.155024,-279.155024,-279.053395,-279.053395,-279.053395,271.57912416794284\n2018-06-21,275.98,273.68,274.24,275.98,278.93002304000004,-278.93002304000004,-278.77722525,-278.77722525,-278.77722525,272.290202992828\n2018-06-22,275.78,274.49,274.74,275.67,278.7140221184,-278.7140221184,-278.5148639875,-278.5148639875,-278.5148639875,272.93728472347345\n2018-06-25,273.61,269.11,271.0,273.45,278.50666123366403,-278.50666123366403,-278.26562078812503,-278.26562078812503,-278.26562078812503,-285.06960000000004\n2018-06-26,272.56,270.79,271.6,271.61,277.9428615596442,-277.9428615596442,-277.6247273329563,-277.6247273329563,-277.6247273329563,-284.590812\n2018-06-27,273.87,269.18,269.35,272.27,277.41288986606554,-277.41288986606554,-277.02869641964935,-277.02869641964935,-277.02869641964935,-284.12638764\n2018-06-28,271.75,268.49,270.89,269.26,276.9147164741016,-276.9147164741016,-276.47438767027387,-276.47438767027387,-276.47438767027387,-283.67589601080005\n2018-06-29,273.66,271.19,271.28,272.08,276.2407391561735,-276.2407391561735,-275.7557927799492,-275.7557927799492,-275.7557927799492,-282.91660121026007\n2018-07-02,272.04,269.24,271.86,269.51,275.6206800236796,-275.6206800236796,-275.10187142975377,-275.10187142975377,-275.10187142975377,-282.19527114974704\n2018-07-03,272.98,270.42,270.9,272.88,275.0502256217852,-275.0502256217852,-274.5068030010759,-274.5068030010759,-274.5068030010759,-281.5100075922597\n2018-07-05,273.18,270.96,273.11,272.16,274.5254075720424,-274.5254075720424,-273.96529073097906,-273.96529073097906,-273.96529073097906,-280.8590072126467\n2018-07-06,275.84,272.72,275.42,273.14,268.49,268.49,268.49,268.49,268.49,-280.2405568520144\n2018-07-09,277.96,276.51,277.9,276.56,268.637,268.637,268.637,268.637,268.637,-279.6530290094137\n2018-07-10,279.01,278.09,278.9,278.4,269.00992,269.00992,268.91669,268.91669,268.91669,-279.094877558943\n2018-07-11,278.03,276.52,276.86,277.17,269.60992480000004,269.60992480000004,269.32042240000004,269.32042240000004,269.32042240000004,-279.01\n2018-07-12,279.43,277.61,279.37,278.29,270.17392931200004,270.17392931200004,269.708005504,269.708005504,269.708005504,263.1202\n2018-07-13,279.93,278.66,279.59,279.19,270.91441496704005,270.91441496704005,270.1941052288,270.1941052288,270.1941052288,263.446396\n2018-07-16,279.8,278.84,279.34,279.66,271.815973470336,271.815973470336,270.778258915072,270.778258915072,270.778258915072,263.94090411999997\n2018-07-17,280.91,278.41,280.47,278.48,272.62737612330244,272.62737612330244,271.3273633801677,271.3273633801677,271.3273633801677,264.4205769964\n2018-07-18,281.18,280.06,281.06,280.57,273.62129098850613,273.62129098850613,271.998147943556,271.998147943556,271.998147943556,265.08015391654396\n2018-07-19,280.74,279.46,280.0,280.31,274.6795102501153,274.6795102501153,272.7326961080715,272.7326961080715,272.7326961080715,265.88514622071676\n2018-07-20,280.48,279.51,279.68,279.8,275.5895788150992,275.5895788150992,273.40848041942576,273.40848041942576,273.40848041942576,266.64988890968095\n2018-07-23,280.41,279.06,280.2,279.46,276.3722377809853,276.3722377809853,274.0302019858717,274.0302019858717,274.0302019858717,267.3763944641969\n2018-07-24,282.55,280.64,281.61,281.79,277.04532449164736,277.04532449164736,274.60218582700196,274.60218582700196,274.60218582700196,268.06657474098705\n2018-07-25,284.36,281.28,284.01,281.37,277.9260725729838,277.9260725729838,275.3174891025718,275.3174891025718,275.3174891025718,268.9355802565278\n2018-07-26,284.11,283.09,283.34,283.15,279.0841795098467,279.0841795098467,276.22174019231466,276.22174019231466,276.22174019231466,270.0152896385709\n2018-07-27,283.82,280.38,281.42,283.73,280.0338271980743,280.0338271980743,277.03556617308317,277.03556617308317,277.03556617308317,271.01941936387095\n2018-07-30,281.68,279.36,279.95,281.51,284.36,-284.36,277.7680095557748,277.7680095557748,277.7680095557748,271.9532600084\n2018-07-31,282.02,280.38,281.33,280.7,284.26,-284.26,278.42720860019733,278.42720860019733,278.42720860019733,272.821731807812\n2018-08-01,282.13,280.14,280.86,281.48,284.162,-284.162,279.0204877401776,279.0204877401776,279.0204877401776,273.6294105812652\n2018-08-02,282.58,279.16,282.39,279.44,284.06595999999996,-284.06595999999996,-284.36,-284.36,-284.36,274.38055184057663\n2018-08-03,283.65,282.34,283.6,282.55,283.8697216,-283.8697216,-284.204,-284.204,-284.204,275.0791132117363\n2018-08-06,284.97,283.21,284.64,283.64,279.16,279.16,279.16,279.16,279.16,275.72877528691475\n2018-08-07,286.01,285.25,285.58,285.4,279.2762,279.2762,279.2762,279.2762,279.2762,276.46807326396157\n2018-08-08,285.91,284.94,285.46,285.39,279.54555200000004,279.54555200000004,279.47821400000004,279.47821400000004,279.47821400000004,277.32684667020504\n2018-08-09,285.97,284.92,285.07,285.54,279.80412992000004,279.80412992000004,279.67416758,279.67416758,279.67416758,278.1083304698866\n2018-08-10,284.05,282.36,283.16,283.42,280.0523647232,280.0523647232,279.8642425526,279.8642425526,279.8642425526,278.8194807275968\n2018-08-13,284.16,281.77,282.1,283.49,280.29067013427203,280.29067013427203,280.04861527602196,280.04861527602196,280.04861527602196,279.4666274621131\n2018-08-14,284.17,282.5,283.9,282.94,280.51944332890116,280.51944332890116,280.2274568177413,280.2274568177413,280.2274568177413,280.0555309905229\n2018-08-15,282.51,280.16,281.78,282.35,286.01,-286.01,-286.01,-286.01,-286.01,-291.73019999999997\n2018-08-16,285.04,283.36,284.06,283.38,285.893,-285.893,-285.8345,-285.8345,-285.8345,-291.38309399999997\n2018-08-17,285.56,283.38,285.06,283.76,285.77833999999996,-285.77833999999996,-285.664265,-285.664265,-285.664265,-291.04640118\n2018-08-20,285.97,285.06,285.67,285.58,280.16,280.16,280.16,280.16,280.16,-290.7198091446\n2018-08-21,287.31,286.11,286.34,286.26,280.2762,280.2762,280.2762,280.2762,280.2762,-290.403014870262\n2018-08-22,286.76,285.58,286.17,285.89,280.55755200000004,280.55755200000004,280.487214,280.487214,280.487214,-290.0957244241541\n2018-08-23,286.94,285.44,285.79,285.94,280.82764992000006,280.82764992000006,280.69189758,280.69189758,280.69189758,-289.7976526914295\n2018-08-24,287.67,286.38,287.51,286.46,281.08694392320007,281.08694392320007,280.8904406526,280.8904406526,280.8904406526,-289.5085231106866\n2018-08-27,289.9,288.68,289.78,288.86,281.48192728780805,281.48192728780805,281.161623026496,281.161623026496,281.161623026496,274.5568\n2018-08-28,290.41,289.4,289.92,290.3,282.1553731047834,282.1553731047834,281.5985418751712,281.5985418751712,281.5985418751712,274.863664\n2018-08-29,291.74,289.89,291.48,290.16,282.98083579430505,282.98083579430505,282.1272293626609,282.1272293626609,282.1272293626609,275.33005408\n2018-08-30,291.36,289.63,290.3,290.94,284.03193549898845,284.03193549898845,282.80012330727465,282.80012330727465,282.80012330727465,275.98645191680004\n2018-08-31,290.81,289.29,290.31,289.84,284.9569032391098,284.9569032391098,283.4259146757654,283.4259146757654,283.4259146757654,276.616593840128\n2018-09-04,290.21,288.69,289.81,289.85,285.77087485041665,285.77087485041665,284.0079006484618,284.0079006484618,284.0079006484618,277.2215300865229\n2018-09-05,289.64,287.89,289.03,289.41,286.48716986836666,286.48716986836666,284.5491476030695,284.5491476030695,284.5491476030695,277.80226888306197\n2018-09-06,289.49,287.0,288.16,289.17,291.74,-291.74,285.0525072708547,285.0525072708547,285.0525072708547,278.3597781277395\n2018-09-07,288.69,286.71,287.6,286.96,291.6452,-291.6452,285.52063176189483,285.52063176189483,285.52063176189483,278.89498700262993\n2018-09-10,289.04,287.88,288.1,288.74,291.447792,-291.447792,285.95598753856217,285.95598753856217,285.95598753856217,279.40878752252473\n2018-09-11,289.55,286.98,289.05,287.37,291.25828032,-291.25828032,286.3608684108628,286.3608684108628,286.3608684108628,279.90203602162376\n2018-09-12,289.8,288.24,289.12,289.05,291.0763491072,-291.0763491072,286.7374076221024,286.7374076221024,286.7374076221024,280.37555458075883\n2018-09-13,291.03,290.0,290.83,290.3,286.71,286.71,286.98,286.98,286.98,280.8301323975285\n2018-09-14,291.27,290.0,290.88,291.11,286.7964,286.7964,287.3132,287.3132,287.3132,281.26652710162733\n2018-09-17,290.86,289.04,289.34,290.82,286.975344,286.975344,287.62307599999997,287.62307599999997,287.62307599999997,281.68546601756225\n2018-09-18,291.57,289.55,290.91,289.55,287.14713024,287.14713024,287.91126068,287.91126068,287.91126068,282.08764737685976\n2018-09-19,291.67,290.83,291.22,290.98,287.4125024256,287.4125024256,288.1792724324,288.1792724324,288.1792724324,282.4737414817854\n2018-09-20,293.94,292.51,293.58,292.64,287.753102231552,287.753102231552,288.428523362132,288.428523362132,288.428523362132,282.84439182251396\n2018-09-21,293.22,291.81,291.99,293.17,288.3717920083968,288.3717920083968,288.86944149316145,288.86944149316145,288.86944149316145,283.39917223138826\n2018-09-24,291.5,290.37,291.02,291.41,288.92861280755716,288.92861280755716,289.27508617370853,289.27508617370853,289.27508617370853,283.92621361981884\n2018-09-25,291.65,290.49,290.75,291.53,289.42975152680145,289.42975152680145,289.64827927981185,289.64827927981185,289.64827927981185,284.4269029388279\n2018-09-26,292.24,289.41,289.88,290.89,293.94,-293.94,-293.94,-293.94,-293.94,284.90255779188647\n2018-09-27,291.91,290.1,290.69,290.41,293.8494,-293.8494,-293.8041,-293.8041,-293.8041,285.35442990229217\n2018-09-28,291.28,289.95,290.72,290.01,293.760612,-293.760612,-293.672277,-293.672277,-293.672277,285.7837084071776\n2018-10-01,292.93,290.98,291.73,292.12,293.67359976,-293.67359976,-293.54440869,-293.54440869,-293.54440869,286.1915229868187\n2018-10-02,292.36,291.15,291.56,291.57,293.5883277648,-293.5883277648,-293.4203764293,-293.4203764293,-293.4203764293,286.57894683747776\n2018-10-03,293.21,291.32,291.72,292.74,293.504761209504,-293.504761209504,-293.300065136421,-293.300065136421,-293.300065136421,286.94699949560385\n2018-10-04,291.24,287.66,289.44,291.22,293.42286598531393,-293.42286598531393,-293.21,-293.21,-293.21,287.2966495208237\n2018-10-05,290.27,286.23,287.82,289.65,293.21,-293.21,-293.21,-293.21,-293.21,-299.8188\n2018-10-08,288.22,285.5,287.82,287.06,292.7912,-292.7912,-292.72139999999996,-292.72139999999996,-292.72139999999996,-299.411136\n2018-10-09,288.86,286.77,287.4,287.43,292.207904,-292.207904,-292.07147399999997,-292.07147399999997,-292.07147399999997,-298.7155792\n2018-10-10,286.91,277.89,278.3,286.91,291.67127167999996,-291.67127167999996,-291.48004133999996,-291.48004133999996,-291.48004133999996,-298.05480023999996\n2018-10-11,278.9,270.39,272.17,277.15,290.29314451199997,-290.29314451199997,-289.9851367926,-289.9851367926,-289.9851367926,-296.6432642232\n2018-10-12,277.08,272.37,275.95,276.86,287.90476717056,-287.90476717056,-287.437769009562,-287.437769009562,-287.437769009562,-294.280470443112\n2018-10-15,277.04,274.3,274.4,275.54,285.80299511009275,-285.80299511009275,-285.2215590383189,-285.2215590383189,-285.2215590383189,-292.13032810323193\n2018-10-16,280.82,276.07,280.4,276.56,283.9534356968816,-283.9534356968816,-283.29345636333744,-283.29345636333744,-283.29345636333744,-290.17369857394107\n2018-10-17,281.15,277.56,280.45,280.44,282.3258234132558,-282.3258234132558,-281.61600703610355,-281.61600703610355,-281.61600703610355,-288.39316570228635\n2018-10-18,280.07,274.97,276.4,279.41,281.15,-281.15,-281.15,-281.15,-281.15,-286.7728807890806\n2018-10-19,279.3,275.47,276.25,277.16,281.15,-281.15,-281.15,-281.15,-281.15,-285.2984215180633\n2018-10-22,277.35,274.42,275.01,277.0,280.07,-280.07,-280.07,-280.07,-280.07,-283.9566635814376\n2018-10-23,274.87,268.61,273.61,270.87,279.3,-279.3,-279.3,-279.3,-279.3,-282.73566385910823\n2018-10-24,273.76,264.7,265.32,273.33,277.8034,-277.8034,-277.6965,-277.6965,-277.6965,-281.1818408346063\n2018-10-25,271.81,266.23,270.08,267.31,275.706856,-275.706856,-275.487095,-275.487095,-275.487095,-279.0392015261075\n2018-10-26,268.78,262.3,265.33,265.92,273.94575904,-273.94575904,-273.76,-273.76,-273.76,-277.17510532771354\n2018-10-29,270.25,259.86,263.86,268.81,271.8495224128,-271.8495224128,-271.81,-271.81,-271.81,-274.9438395285565\n2018-10-30,268.12,263.12,267.77,263.73,270.25,-270.25,-270.25,-270.25,-270.25,-272.3795868087019\n2018-10-31,273.23,270.13,270.63,270.71,259.86,259.86,259.86,259.86,259.86,254.6628\n2018-11-01,273.73,270.38,273.51,271.64,260.1274,260.1274,260.1274,260.1274,260.1274,255.034144\n2018-11-02,275.23,269.6,271.89,274.75,260.671504,260.671504,260.535478,260.535478,260.535478,255.59501968\n2018-11-05,274.01,271.35,273.39,272.48,261.54501376,261.54501376,261.12325888000004,261.12325888000004,261.12325888000004,256.3804188928\n2018-11-06,275.3,273.25,275.12,273.36,262.3661129344,262.3661129344,261.68752852480003,261.68752852480003,261.68752852480003,257.134402137088\n2018-11-07,281.1,277.08,281.01,277.55,263.400823899648,263.400823899648,262.36815209856,262.36815209856,262.36815209856,258.0426820302336\n2018-11-08,281.21,279.22,280.5,280.11,265.1707415096832,265.1707415096832,263.4920629726464,263.4920629726464,263.4920629726464,259.4261211084196\n2018-11-09,279.23,276.18,277.76,279.0,267.0954525285212,267.0954525285212,264.7323185645612,264.7323185645612,264.7323185645612,260.9509926308302\n2018-11-12,277.46,272.0,272.57,277.24,268.7891982250987,268.7891982250987,265.8857562650419,265.8857562650419,265.8857562650419,262.3691231466721\n2018-11-13,275.33,271.25,272.06,273.06,270.27969443808684,270.27969443808684,266.95845332648895,266.95845332648895,266.95845332648895,263.68798452640505\n2018-11-14,274.61,268.45,270.2,274.18,281.21,-281.21,267.95606159363473,267.95606159363473,267.95606159363473,264.9145256095567\n2018-11-15,273.54,267.02,273.02,268.76,280.9548,-280.9548,-281.21,-281.21,-281.21,266.0552088168877\n2018-11-16,274.74,270.18,273.73,271.74,280.397408,-280.397408,-280.7843,-280.7843,-280.7843,267.02\n2018-11-19,273.37,268.08,269.1,273.17,279.86231168,-279.86231168,-280.37137099999995,-280.37137099999995,-280.37137099999995,267.02\n2018-11-20,267.0,263.16,264.12,265.41,279.34861921280003,-279.34861921280003,-279.97082986999993,-279.97082986999993,-279.97082986999993,-286.83419999999995\n2018-11-21,267.15,265.02,265.02,265.78,278.37730206003204,-278.37730206003204,-279.13028837649995,-279.13028837649995,-279.13028837649995,-286.123974\n2018-11-23,264.82,263.1,263.25,263.16,277.46426393643014,-277.46426393643014,-278.33177395767495,-278.33177395767495,-278.33177395767495,-285.43505478\n2018-11-26,267.55,265.34,267.5,265.8,276.31512282151573,-276.31512282151573,-277.2655497806377,-277.2655497806377,-277.2655497806377,-284.318302041\n2018-11-27,268.4,265.66,268.4,266.34,275.25791299579447,-275.25791299579447,-276.27396129599305,-276.27396129599305,-276.27396129599305,-283.25738693895\n2018-11-28,274.58,268.54,274.58,269.61,263.1,263.1,-275.35178400527354,-275.35178400527354,-275.35178400527354,-282.2495175920025\n2018-11-29,275.55,272.44,273.98,273.71,263.3296,263.3296,263.1,263.1,263.1,-281.2920417124024\n2018-11-30,276.28,273.45,275.65,273.81,263.818416,263.818416,263.34900000000005,263.34900000000005,263.34900000000005,-280.3824396267823\n2018-12-03,280.4,277.51,279.3,280.38,264.56611104,264.56611104,263.73693000000003,263.73693000000003,263.73693000000003,257.838\n2018-12-04,278.84,269.9,270.25,278.34,265.83282215680003,265.83282215680003,264.4034528,264.4034528,264.4034528,258.28924\n2018-12-06,269.96,262.44,269.84,265.97,280.4,-280.4,-280.4,-280.4,-280.4,258.7314552\n2018-12-07,271.22,262.64,263.57,269.45,280.0408,-280.0408,-279.8612,-279.8612,-279.8612,259.164826096\n2018-12-10,265.16,258.62,264.07,263.37,279.688784,-279.688784,-279.338564,-279.338564,-279.338564,-286.008\n2018-12-11,267.86,262.48,264.13,267.62,278.84603264,-278.84603264,-278.3026358,-278.3026358,-278.3026358,-285.18636\n2018-12-12,268.95,265.38,265.46,267.45,278.0369913344,-278.0369913344,-277.31850401,-277.31850401,-277.31850401,-284.3893692\n2018-12-13,267.49,264.12,265.37,266.45,277.260311681024,-277.260311681024,-276.3835788095,-276.3835788095,-276.3835788095,-283.616288124\n2018-12-14,264.03,259.85,260.47,262.92,276.51469921378305,-276.51469921378305,-275.49539986902505,-275.49539986902505,-275.49539986902505,-282.86639948028\n2018-12-17,260.65,253.53,255.36,259.39,275.79891124523175,-275.79891124523175,-274.6516298755738,-274.6516298755738,-274.6516298755738,-282.13900749587157\n2018-12-18,257.94,253.35,255.08,257.19,274.46277657051786,-274.46277657051786,-273.17311578428365,-273.17311578428365,-273.17311578428365,-280.708557121078\n2018-12-19,259.39,249.35,251.26,255.18,272.77375444487643,-272.77375444487643,-271.3890353636981,-271.3890353636981,-271.3890353636981,-278.79345812260254\n2018-12-20,251.62,244.66,247.17,249.78,270.4313790003888,-270.4313790003888,-268.96474147369133,-268.96474147369133,-268.96474147369133,-276.1435468915683\n2018-12-21,249.69,239.99,240.7,246.75,267.33881352034217,-267.33881352034217,-265.80512508211143,-265.80512508211143,-265.80512508211143,-272.6803567334958\n2018-12-24,240.29,234.34,234.34,239.0,263.50997962749426,-263.50997962749426,-261.9328563197947,-261.9328563197947,-261.9328563197947,-268.43061035814134\n2018-12-26,246.18,233.76,246.18,235.9,258.84278288709515,-258.84278288709515,-257.2420707454296,-257.2420707454296,-257.2420707454296,-263.3170188044201\n2018-12-27,248.18,238.96,248.07,242.57,254.32788196741802,-254.32788196741802,-252.78047730379797,-252.78047730379797,-252.78047730379797,-258.2923256076687\n2018-12-28,251.32,246.45,247.75,249.73,233.76,233.76,233.76,233.76,233.76,-254.12183025436502\n2018-12-31,250.16,247.48,249.92,249.5,234.1112,234.1112,234.1112,234.1112,234.1112,-251.32\n2019-01-02,251.21,245.96,250.18,246.06,234.455376,234.455376,234.455376,234.455376,234.455376,-251.32\n2019-01-03,248.57,243.67,244.21,248.3,234.79266848,234.79266848,234.79266848,234.79266848,234.79266848,-251.21\n2019-01-04,253.11,247.17,252.39,247.59,235.1232151104,235.1232151104,235.1232151104,235.1232151104,235.1232151104,229.0848\n2019-01-07,255.93,251.7,254.38,252.76,235.842686505984,235.842686505984,235.662818657088,235.662818657088,235.662818657088,229.565304\n2019-01-08,257.31,254.01,256.77,256.86,237.04792531562498,237.04792531562498,236.47350591080448,236.47350591080448,236.47350591080448,230.35624488\n2019-01-09,258.91,256.2,257.97,257.56,238.66889129037497,238.66889129037497,237.51533061526425,237.51533061526425,237.51533061526425,231.4343950848\n2019-01-10,259.15,255.52,258.88,256.31,240.6930021613375,240.6930021613375,238.7990107783484,238.7990107783484,238.7990107783484,232.80817533056\n2019-01-11,258.98,257.03,258.98,257.65,242.90784190197698,242.90784190197698,240.223580023864,240.223580023864,240.223580023864,234.3886848107264\n2019-01-14,258.3,256.41,257.4,256.87,244.85690087373973,244.85690087373973,241.54842942219352,241.54842942219352,241.54842942219352,235.87436372208282\n2019-01-15,260.7,257.82,260.35,257.82,246.57207276889096,246.57207276889096,242.78053936263998,242.78053936263998,242.78053936263998,237.27090189875784\n2019-01-16,261.96,260.6,260.98,260.82,248.5499825812462,248.5499825812462,244.21409621362878,244.21409621362878,244.21409621362878,238.9109387658448\n2019-01-17,263.92,259.97,262.96,260.0,250.6955853682468,250.6955853682468,245.8112275544022,245.8112275544022,245.8112275544022,240.75486366457721\n2019-01-18,266.97,264.11,266.46,265.0,253.0759800019624,253.0759800019624,247.62210479896197,247.62210479896197,247.62210479896197,242.83972593476526\n2019-01-22,265.04,261.06,262.86,264.77,255.85478400156993,255.85478400156993,249.75037327107614,249.75037327107614,249.75037327107614,245.25275334128872\n2019-01-23,264.76,260.66,263.41,264.0,258.07782720125596,258.07782720125596,251.64453221125777,251.64453221125777,251.64453221125777,247.42447800715985\n2019-01-24,264.19,262.09,263.55,263.21,259.85626176100476,259.85626176100476,253.33033366801942,253.33033366801942,253.33033366801942,249.37903020644387\n2019-01-25,266.7,265.11,265.78,265.62,260.66,260.66,254.83069696453728,254.83069696453728,254.83069696453728,251.13812718579948\n2019-01-28,263.83,261.8,263.76,263.38,266.97,-266.97,256.1660202984382,256.1660202984382,256.1660202984382,252.72131446721954\n2019-01-29,264.55,262.48,263.41,263.93,266.8666,-266.8666,257.35445806561,257.35445806561,257.35445806561,254.1461830204976\n2019-01-30,268.52,264.25,267.58,265.09,261.8,261.8,258.4121676783929,258.4121676783929,258.4121676783929,255.42856471844783\n2019-01-31,270.39,267.27,269.93,267.5,261.9344,261.9344,259.62510755698577,259.62510755698577,259.62510755698577,256.8686225994186\n2019-02-01,271.2,269.19,270.06,270.13,262.272624,262.272624,261.0245435745776,261.0245435745776,261.0245435745776,258.49118788748837\n2019-02-04,272.02,269.36,271.96,270.14,262.80826656,262.80826656,262.4491074741367,262.4491074741367,262.4491074741367,260.14333346211487\n2019-02-05,273.44,271.89,273.1,272.47,263.5452052352,263.5452052352,263.88474135301624,263.88474135301624,263.88474135301624,261.8060667774188\n2019-02-06,273.34,271.92,272.74,272.8,264.53468471168003,264.53468471168003,265.4135827365336,265.4135827365336,265.4135827365336,263.55115676080595\n2019-02-07,271.54,268.3,270.14,270.93,265.42521624051204,265.42521624051204,266.69780949868823,266.69780949868823,266.69780949868823,265.03448324668506\n2019-02-08,270.51,267.83,270.47,268.72,266.22669461646086,266.22669461646086,267.7765599788981,267.7765599788981,267.7765599788981,266.2953107596823\n2019-02-11,271.49,270.04,270.62,271.17,266.9480251548148,266.9480251548148,267.83,267.83,267.83,267.36701414572997\n2019-02-12,274.52,272.34,274.1,272.43,267.5972226393333,267.5972226393333,267.83,267.83,267.83,267.83\n2019-02-13,275.93,274.56,274.99,275.06,268.4279559226133,268.4279559226133,268.96729999999997,268.96729999999997,268.96729999999997,268.9004\n2019-02-14,275.64,272.87,274.38,273.77,269.4782420934474,269.4782420934474,270.22058599999997,270.22058599999997,270.22058599999997,270.095432\n2019-02-15,277.4,276.13,277.37,276.38,270.3814882003648,270.3814882003648,271.24828052,271.24828052,271.24828052,271.08730856\n2019-02-19,278.58,276.47,277.85,276.52,271.50445008830644,271.50445008830644,272.41710722119996,272.41710722119996,272.41710722119996,272.2235930192\n2019-02-20,278.92,277.25,278.41,277.85,272.7780490724113,272.7780490724113,273.64968577696,273.64968577696,273.64968577696,273.431310345552\n2019-02-21,278.1,276.35,277.42,277.75,274.00643925792906,274.00643925792906,274.7564517637984,274.7564517637984,274.7564517637984,274.5290482764416\n2019-02-22,279.35,277.82,279.14,278.15,274.98915140634324,274.98915140634324,275.6307968934007,275.6307968934007,275.6307968934007,275.4072386211533\n2019-02-25,281.31,279.43,279.52,280.69,275.8613211250746,275.8613211250746,276.35,276.35,276.35,276.2352185107111\n2019-02-26,280.29,278.9,279.32,279.13,276.95105690005965,276.95105690005965,277.49080000000004,277.49080000000004,277.49080000000004,277.35167043835463\n2019-02-27,279.59,277.48,279.2,278.53,281.31,-281.31,-281.31,-281.31,-281.31,-286.9362\n2019-02-28,279.45,278.32,278.68,278.97,281.2334,-281.2334,-281.1951,-281.1951,-281.1951,-286.652514\n2019-03-01,280.87,278.82,280.42,280.44,281.15833200000003,-281.15833200000003,-281.08364700000004,-281.08364700000004,-281.08364700000004,-286.37733858\n2019-03-04,281.87,276.84,279.4,281.65,276.84,276.84,276.84,276.84,276.84,-286.1104184226\n2019-03-05,279.76,278.41,279.02,279.55,276.84,276.84,276.84,276.84,276.84,-285.64689750147\n2019-03-06,279.16,276.97,277.33,279.16,276.84,276.84,276.84,276.84,276.84,-285.2065526263965\n2019-03-07,276.97,274.07,275.01,276.84,281.87,-281.87,-281.87,-281.87,-281.87,-284.7882249950767\n2019-03-08,274.65,272.43,274.46,272.92,281.714,-281.714,-281.636,-281.636,-281.636,-284.0379492454213\n2019-03-11,278.62,275.23,278.44,275.24,281.34264,-281.34264,-281.1757,-281.1757,-281.1757,-282.9932338133334\n2019-03-12,280.07,278.85,279.49,279.09,280.9861344,-280.9861344,-280.73841500000003,-280.73841500000003,-280.73841500000003,-282.0425427701334\n2019-03-13,282.36,280.3,281.34,280.49,272.43,272.43,272.43,272.43,272.43,266.9814\n2019-03-14,281.84,280.67,281.16,281.33,272.6286,272.6286,272.6286,272.6286,272.6286,267.288972\n2019-03-15,282.2,280.34,281.31,280.56,272.82322800000003,272.82322800000003,272.82322800000003,272.82322800000003,272.82322800000003,267.59039256\n2019-03-18,282.65,281.3,282.33,281.53,273.01396344000005,273.01396344000005,273.01396344000005,273.01396344000005,273.01396344000005,267.8857847088\n2019-03-19,284.36,281.42,282.4,283.49,273.3994049024001,273.3994049024001,273.30304453680003,273.30304453680003,273.30304453680003,268.32871116753597\n2019-03-20,283.5,280.32,281.55,282.16,274.0570406082561,274.0570406082561,273.745322755328,273.745322755328,273.745322755328,268.96996272083453\n2019-03-21,285.18,280.6,284.73,280.63,274.6752181717607,274.6752181717607,274.1699098451149,274.1699098451149,274.1699098451149,269.58556421200115\n2019-03-22,283.8,279.18,279.25,283.22,275.51560071801987,275.51560071801987,274.72041435285917,274.72041435285917,274.72041435285917,270.3652860014011\n2019-03-25,280.19,277.64,279.04,278.89,276.28875266057827,276.28875266057827,275.2433936352162,275.2433936352162,275.2433936352162,271.10602170133103\n2019-03-26,282.18,279.57,281.12,280.97,277.000052447732,277.000052447732,275.74022395345537,275.74022395345537,275.74022395345537,271.8097206162645\n2019-03-27,281.75,277.93,279.65,281.13,277.64,277.64,276.2122127557826,276.2122127557826,276.2122127557826,272.4782345854513\n2019-03-28,281.21,279.07,280.71,280.36,277.93,277.93,276.6606021179935,276.6606021179935,276.6606021179935,273.1133228561787\n2019-03-29,282.84,281.14,282.48,282.41,277.93,277.93,277.0865720120938,277.0865720120938,277.0865720120938,273.71665671336973\n2019-04-01,286.16,284.41,285.83,284.7,278.51,278.51,277.4912434114891,277.4912434114891,277.4912434114891,274.2898238777012\n2019-04-02,286.23,285.1,285.97,286.04,279.275,279.275,278.01136880679974,278.01136880679974,278.01136880679974,275.00203444503916\n2019-04-03,287.75,285.75,286.42,287.33,280.1096,280.1096,278.58667299032373,278.58667299032373,278.58667299032373,275.78799203388644\n2019-04-04,287.46,286.01,287.18,286.8,281.179256,281.179256,279.31973915109785,279.31973915109785,279.31973915109785,276.7449526711755\n2019-04-05,288.63,287.6,288.57,287.95,282.09916016,282.09916016,279.99416001901,279.99416001901,279.99416001901,277.6253564574815\n2019-04-08,288.9,287.37,288.79,288.1,283.1440945344,283.1440945344,280.7713856172991,280.7713856172991,280.7713856172991,278.61577437630814\n2019-04-09,288.08,286.7,287.31,287.72,284.180157518208,284.180157518208,281.58424705556916,281.58424705556916,281.58424705556916,279.64419693867734\n2019-04-10,288.38,287.32,288.29,287.77,285.02972916493053,285.02972916493053,282.31582235001224,282.31582235001224,282.31582235001224,280.5697772448096\n2019-04-11,288.84,287.58,288.21,288.84,285.726377915243,285.726377915243,282.974240115011,282.974240115011,282.974240115011,281.40279952032864\n2019-04-12,290.47,289.26,290.16,290.01,286.29762989049925,286.29762989049925,283.5668161035099,283.5668161035099,283.5668161035099,282.15251956829576\n2019-04-15,290.35,289.08,289.97,290.27,287.13210391239943,287.13210391239943,284.3261663321238,284.3261663321238,284.3261663321238,283.0674424157832\n2019-04-16,291.01,289.5,290.16,290.96,287.7996831299196,287.7996831299196,285.0019880355902,285.0019880355902,285.0019880355902,283.88172375004706\n2019-04-17,291.42,288.99,289.45,291.41,288.44174650393563,288.44174650393563,285.7229494713194,285.7229494713194,285.7229494713194,284.7371169000414\n2019-04-18,290.32,288.66,290.02,290.12,291.42,-291.42,286.46356604004785,286.46356604004785,286.46356604004785,285.60589170303604\n2019-04-22,290.44,289.07,290.27,289.17,291.42,-291.42,287.1079024548416,287.1079024548416,287.1079024548416,286.3617257816413\n2019-04-23,293.13,290.42,292.88,290.68,288.66,288.66,287.6684751357122,287.6684751357122,287.6684751357122,287.01930143002795\n2019-04-24,293.15,292.08,292.23,292.76,288.74940000000004,288.74940000000004,288.4330886167125,288.4330886167125,288.4330886167125,287.874799229824\n2019-04-25,292.78,290.73,292.05,292.12,288.925424,288.925424,289.14062532420564,289.14062532420564,289.14062532420564,288.6660793453504\n2019-04-26,293.49,291.25,293.41,292.12,289.09440704,289.09440704,289.7420315255748,289.7420315255748,289.7420315255748,289.3386674435478\n2019-04-29,294.45,293.41,293.87,293.53,289.35814261760004,289.35814261760004,290.34170648148284,290.34170648148284,290.34170648148284,290.0028806525802\n2019-04-30,294.34,291.92,294.02,293.52,289.76549120819203,289.76549120819203,291.0401163796308,291.0401163796308,291.0401163796308,290.75889094164154\n2019-05-01,294.95,291.8,291.81,294.76,290.14025191153667,290.14025191153667,291.61979659509353,291.61979659509353,291.61979659509353,291.38637948156247\n2019-05-02,292.7,289.55,291.18,291.68,294.95,-294.95,-294.95,-294.95,-294.95,-300.849\n2019-05-03,294.34,292.57,294.03,292.8,294.95,-294.95,-294.95,-294.95,-294.95,-300.51003\n2019-05-06,293.31,288.93,292.82,289.24,294.842,-294.842,-294.788,-294.788,-294.788,-300.1812291\n2019-05-07,290.81,285.82,287.93,290.15,294.60552,-294.60552,-294.49510000000004,-294.49510000000004,-294.49510000000004,-299.618667645\n2019-05-08,289.43,286.88,287.53,287.56,294.0783888,-294.0783888,-293.88784300000003,-293.88784300000003,-293.88784300000003,-298.65276090985003\n2019-05-09,287.33,283.31,286.66,285.2,293.58288547200004,-293.58288547200004,-293.32309399,-293.32309399,-293.32309399,-297.75446764616055\n2019-05-10,288.94,282.3,288.1,285.64,292.76105463424005,-292.76105463424005,-292.42191553090004,-292.42191553090004,-292.42191553090004,-296.4544655580061\n2019-05-13,283.49,279.93,280.86,282.39,291.71494917081606,-291.71494917081606,-291.30850482250105,-291.30850482250105,-291.30850482250105,-294.8974743466255\n2019-05-14,285.1,281.85,283.4,282.01,290.3007552703181,-290.3007552703181,-289.8292991955759,-289.8292991955759,-289.8292991955759,-292.95170268156414\n2019-05-15,285.76,281.36,285.06,281.6,289.05626463787996,-289.05626463787996,-288.54239030015106,-288.54239030015106,-288.54239030015106,-291.2588813329608\n2019-05-16,289.21,285.77,287.7,285.83,279.93,279.93,279.93,279.93,279.93,-289.7861267596759\n2019-05-17,288.6,285.13,285.84,285.13,280.11560000000003,280.11560000000003,280.11560000000003,280.11560000000003,280.11560000000003,-289.21\n2019-05-20,285.43,283.12,283.95,284.06,280.29748800000004,280.29748800000004,280.29748800000004,280.29748800000004,280.29748800000004,-289.21\n2019-05-21,286.93,285.55,286.51,285.83,280.47573824000006,280.47573824000006,280.47573824000006,280.47573824000006,280.47573824000006,-288.6\n2019-05-22,286.67,285.1,285.63,285.43,280.65042347520006,280.65042347520006,280.65042347520006,280.65042347520006,280.65042347520006,-287.47290000000004\n2019-05-23,283.21,280.58,282.14,283.16,289.21,-289.21,-289.21,-289.21,-289.21,-286.93\n2019-05-24,284.19,282.09,282.78,283.75,289.0374,-289.0374,-288.9511,-288.9511,-288.9511,-286.67\n2019-05-28,284.14,280.15,280.15,283.01,288.868252,-288.868252,-288.699967,-288.699967,-288.699967,-285.79380000000003\n2019-05-29,279.35,276.72,278.27,278.91,288.51952192,-288.51952192,-288.27246865,-288.27246865,-288.27246865,-285.03150600000004\n2019-05-30,280.04,277.81,279.03,279.08,287.8115506048,-287.8115506048,-287.4637958445,-287.4637958445,-287.4637958445,-284.14\n2019-05-31,277.12,275.25,275.27,276.2,287.146057568512,-287.146057568512,-286.711730135385,-286.711730135385,-286.711730135385,-283.027\n2019-06-03,276.55,273.09,274.57,275.3,286.194372963031,-286.194372963031,-285.68017442320036,-285.68017442320036,-285.68017442320036,-281.70491\n2019-06-04,280.68,276.62,280.53,277.11,284.8839356667279,-284.8839356667279,-284.2952552366483,-284.2952552366483,-284.2952552366483,267.6282\n2019-06-05,282.99,280.32,282.96,282.34,283.7045421000551,-283.7045421000551,-283.062677160617,-283.062677160617,-283.062677160617,267.889236\n2019-06-06,285.55,282.57,284.8,283.29,273.09,273.09,273.09,273.09,273.09,268.34225892\n2019-06-07,288.85,285.75,287.65,285.95,273.33919999999995,273.33919999999995,273.33919999999995,273.33919999999995,273.33919999999995,269.0305685632\n2019-06-10,290.82,288.88,288.97,289.35,273.95963199999994,273.95963199999994,273.80452399999996,273.80452399999996,273.80452399999996,270.02154013504\n2019-06-11,291.4,288.19,288.9,290.95,274.97125407999994,274.97125407999994,274.48514303999997,274.48514303999997,274.48514303999997,271.26944772693764\n2019-06-12,289.26,287.82,288.39,288.64,276.2855537535999,276.2855537535999,275.33088588799995,275.33088588799995,275.33088588799995,272.678586386052\n2019-06-13,289.98,288.62,289.58,289.37,277.49470945331194,277.49470945331194,276.13434159359997,276.13434159359997,276.13434159359997,273.98908533902835\n2019-06-14,289.92,288.41,289.26,289.27,278.607132697047,278.607132697047,276.89762451392,276.89762451392,276.89762451392,275.20784936529634\n2019-06-17,290.22,289.18,289.37,289.53,279.63056208128324,279.63056208128324,277.622743288224,277.622743288224,277.622743288224,276.3412999097256\n2019-06-18,293.56,291.0,292.4,291.38,280.5721171147806,280.5721171147806,278.3116061238128,278.3116061238128,278.3116061238128,277.3954089160448\n2019-06-19,293.65,291.49,293.06,292.53,281.8709054033026,281.8709054033026,279.226509756384,279.226509756384,279.226509756384,278.6885762027612\n2019-06-20,296.31,293.61,295.86,296.02,283.28439675490625,283.28439675490625,280.23615407343715,280.23615407343715,280.23615407343715,280.0351043445127\n2019-06-21,295.51,293.76,294.0,294.14,285.10798120921936,285.10798120921936,281.5220617475622,281.5220617475622,281.5220617475622,281.66259391006145\n2019-06-24,294.58,293.47,293.64,294.18,286.67626383992865,286.67626383992865,282.70509680775723,282.70509680775723,282.70509680775723,283.1273345190553\n2019-06-25,293.73,290.64,290.76,293.67,288.02498690233864,288.02498690233864,283.79348906313663,283.79348906313663,283.79348906313663,284.44560106714977\n2019-06-26,292.31,290.35,290.47,291.78,289.1848887360112,289.1848887360112,284.7948099380857,284.7948099380857,284.7948099380857,285.6320409604348\n2019-06-27,292.06,290.93,291.5,291.29,290.18240431296965,290.18240431296965,285.71602514303885,285.71602514303885,285.71602514303885,286.6998368643913\n2019-06-28,293.55,292.02,293.0,292.57,290.35,290.35,286.56354313159574,286.56354313159574,286.56354313159574,287.66085317795216\n2019-07-01,296.91,294.33,295.66,296.68,290.93,290.93,287.3432596810681,287.3432596810681,287.3432596810681,288.5257678601569\n2019-07-02,296.49,294.69,296.43,295.59,291.8868,291.8868,288.204266309772,288.204266309772,288.204266309772,289.44803339553965\n2019-07-03,298.82,297.02,298.8,297.19,292.690512,292.690512,288.9877823418925,288.9877823418925,288.9877823418925,290.26884972203027\n2019-07-05,298.64,296.02,298.46,297.46,293.79381984,293.79381984,289.97100410770327,289.97100410770327,289.97100410770327,291.2949877553866\n2019-07-08,297.35,296.23,296.82,297.01,294.6985322688,294.6985322688,290.85590369693296,290.85590369693296,290.85590369693296,292.19798922474024\n2019-07-09,297.52,295.48,297.19,295.51,295.440396460416,295.440396460416,291.65231332723965,291.65231332723965,291.65231332723965,292.99263051777143\n2019-07-10,299.66,297.79,298.61,298.4,295.48,295.48,292.3690819945157,292.3690819945157,292.3690819945157,293.69191485563886\n2019-07-11,299.58,298.2,299.31,299.34,295.48,295.48,293.17108297511896,293.17108297511896,293.17108297511896,294.4677659244058\n2019-07-12,300.73,299.51,300.65,299.86,296.31600000000003,296.31600000000003,293.88486384785585,293.88486384785585,293.88486384785585,295.14275635423303\n2019-07-15,301.13,300.22,300.75,301.12,297.1988,297.1988,294.70628018611313,294.70628018611313,294.70628018611313,295.9249704646404\n2019-07-16,300.88,299.44,299.71,300.64,297.98504,297.98504,295.54136376191843,295.54136376191843,295.54136376191843,296.70572489494435\n2019-07-17,299.93,297.74,297.74,299.77,301.13,-301.13,296.267886472869,296.267886472869,296.267886472869,297.3693661607027\n2019-07-18,299.24,296.7,298.83,297.18,301.0622,-301.0622,-301.13,-301.13,-301.13,-307.1526\n2019-07-19,300.07,296.97,297.17,300.01,300.887712,-300.887712,-300.9971,-300.9971,-300.9971,-306.839022\n2019-07-22,298.49,297.05,297.9,297.61,300.72020352000004,-300.72020352000004,-300.868187,-300.868187,-300.868187,-306.53485134\n2019-07-23,300.03,298.23,300.03,299.15,300.55939537920005,-300.55939537920005,-300.74314139,-300.74314139,-300.74314139,-306.23980579979997\n2019-07-24,301.44,299.09,301.44,299.16,296.7,296.7,296.7,296.7,296.7,-305.953611625806\n2019-07-25,301.0,299.12,300.0,300.97,296.7948,296.7948,296.7948,296.7948,296.7948,-305.6760032770318\n2019-07-26,302.23,300.62,302.01,300.77,296.887704,296.887704,296.887704,296.887704,296.887704,-305.4067231787208\n2019-07-29,301.93,300.85,301.46,301.85,297.10139584,297.10139584,297.04797288,297.04797288,297.04797288,-305.1455214833592\n2019-07-30,301.17,299.49,300.72,299.9,297.3065400064,297.3065400064,297.2034336936,297.2034336936,297.2034336936,-304.8921558388584\n2019-07-31,301.2,295.2,297.43,300.98,302.23,-302.23,-302.23,-302.23,-302.23,-304.64639116369267\n2019-08-01,300.87,293.96,294.84,297.56,302.0894,-302.0894,-302.01910000000004,-302.01910000000004,-302.01910000000004,-304.17407160550806\n2019-08-02,294.12,290.9,292.62,293.86,301.764224,-301.764224,-301.616145,-301.616145,-301.616145,-303.4590865931225\n2019-08-05,288.2,281.73,283.82,288.07,301.11237056,-301.11237056,-300.87,-300.87,-300.87,-302.32876879974145\n2019-08-06,288.03,284.28,287.8,285.93,299.5617809152,-299.5617809152,-299.1474,-299.1474,-299.1474,-300.0629042317699\n2019-08-07,288.82,282.06,287.97,284.4,298.13523844198403,-298.13523844198403,-297.579834,-297.579834,-297.579834,-298.0462847662752\n2019-08-08,293.62,289.02,293.62,289.62,296.8228193666253,-296.8228193666253,-296.15334894,-296.15334894,-296.15334894,-296.25149344198496\n2019-08-09,293.24,289.65,291.62,292.59,295.6153938172953,-295.6153938172953,-294.8552475354,-294.8552475354,-294.8552475354,-294.65412916336663\n2019-08-12,290.56,287.02,288.1,289.9,294.5045623119117,-294.5045623119117,-293.673975257214,-293.673975257214,-293.673975257214,-293.62\n2019-08-13,294.15,287.36,292.55,287.78,281.73,281.73,281.73,281.73,281.73,276.09540000000004\n2019-08-14,288.74,283.76,283.9,288.05,281.9784,281.9784,281.9784,281.9784,281.9784,276.456492\n2019-08-15,285.63,282.39,284.65,284.89,282.221832,282.221832,282.221832,282.221832,282.221832,276.81036216\n2019-08-16,289.33,286.44,288.85,286.49,282.39,282.39,282.39,282.39,282.39,277.1571549168\n2019-08-19,293.08,291.44,292.33,292.23,282.39,282.39,282.39,282.39,282.39,277.497011818464\n2019-08-20,292.36,289.95,290.09,291.78,282.6252,282.6252,282.6252,282.6252,282.6252,277.8300715820947\n2019-08-21,292.86,291.72,292.45,292.47,282.855696,282.855696,282.855696,282.855696,282.855696,278.15647015045283\n2019-08-22,293.93,290.4,292.36,293.24,283.08158208000003,283.08158208000003,283.08158208000003,283.08158208000003,283.08158208000003,278.47634074744377\n2019-08-23,292.76,283.47,284.85,290.95,283.30295043840005,283.30295043840005,283.30295043840005,283.30295043840005,283.30295043840005,278.7898139324949\n2019-08-26,288.0,285.58,288.0,287.24,283.47,283.47,283.47,283.47,283.47,279.097017653845\n2019-08-27,289.95,286.04,286.87,289.55,283.47,283.47,283.47,283.47,283.47,279.3980773007681\n2019-08-28,289.06,285.25,288.89,286.1,283.6836,283.6836,283.6836,283.6836,283.6836,279.69311575475274\n2019-08-29,293.16,290.62,292.58,291.77,283.892928,283.892928,283.892928,283.892928,283.892928,279.9822534396577\n2019-08-30,294.24,291.43,292.45,294.21,284.09806943999996,284.09806943999996,284.09806943999996,284.09806943999996,284.09806943999996,280.2656083708646\n2019-09-03,291.58,289.28,290.74,290.56,284.5037466624,284.5037466624,284.40232735679996,284.40232735679996,284.40232735679996,280.6848401197386\n2019-09-04,294.06,292.31,294.04,293.15,284.893196795904,284.893196795904,284.69745753609595,284.69745753609595,284.69745753609595,281.0914949161465\n2019-09-05,298.82,296.65,297.82,296.78,285.2670689240678,285.2670689240678,284.98373381001306,284.98373381001306,284.98373381001306,281.4859500686621\n2019-09-06,298.75,297.42,298.05,298.21,286.08024478862376,286.08024478862376,285.53718445761257,285.53718445761257,285.53718445761257,282.1793120659156\n2019-09-09,299.23,297.16,298.2,299.15,286.84463010130634,286.84463010130634,286.0684970793081,286.0684970793081,286.0684970793081,282.844939583279\n2019-09-10,298.2,295.97,298.13,297.33,287.8354596932018,287.8354596932018,286.7265722253427,286.7265722253427,286.7265722253427,283.66419260411504\n2019-09-11,300.33,297.75,300.25,298.49,288.74702291774565,288.74702291774565,287.35174361407553,287.35174361407553,287.35174361407553,284.4424829739093\n2019-09-12,302.44,300.41,301.29,301.24,289.90532062597106,289.90532062597106,288.130438997231,288.130438997231,288.130438997231,285.39573399547476\n2019-09-13,302.17,300.68,301.09,301.78,291.40948215085456,291.40948215085456,289.1321082674248,289.1321082674248,289.1321082674248,286.58883261579155\n2019-09-16,300.64,299.45,300.16,299.8,292.733144292752,292.733144292752,290.0636606887051,290.0636606887051,290.0636606887051,287.6984143326861\n2019-09-17,301.02,299.77,300.92,299.91,293.89796697762176,293.89796697762176,290.93000444049574,290.93000444049574,290.93000444049574,288.7303253293981\n2019-09-18,301.22,298.25,301.1,300.47,294.92301094030717,294.92301094030717,291.73570412966103,291.73570412966103,291.73570412966103,289.69000255634023\n2019-09-19,302.63,300.72,301.08,301.5,295.8250496274703,295.8250496274703,292.48500484058474,292.48500484058474,292.48500484058474,290.5825023773964\n2019-09-20,300.67,297.41,298.28,300.34,296.77774267962445,296.77774267962445,293.296604453338,293.296604453338,293.296604453338,291.5463021872047\n2019-09-23,299.0,297.28,298.21,297.57,302.63,-302.63,294.04327609707093,294.04327609707093,294.04327609707093,292.4329980122283\n2019-09-24,299.84,294.82,295.87,299.41,302.52299999999997,-302.52299999999997,294.73021400930526,294.73021400930526,294.73021400930526,293.2487581712501\n2019-09-25,298.1,294.33,297.62,295.94,302.21488,-302.21488,-302.63,-302.63,-302.63,293.99925751755006\n2019-09-26,297.86,295.45,297.0,297.62,301.7417872,-301.7417872,-302.381,-302.381,-302.381,294.33\n2019-09-27,297.94,293.69,295.4,297.87,301.297079968,-301.297079968,-302.13946999999996,-302.13946999999996,-302.13946999999996,-308.6826\n2019-09-30,297.55,295.92,296.77,295.98,300.68851357056,-300.68851357056,-301.71699649999994,-301.71699649999994,-301.71699649999994,-308.232822\n2019-10-01,298.45,293.0,293.24,297.67,300.1286324849152,-300.1286324849152,-301.3156466749999,-301.3156466749999,-301.3156466749999,-307.79653734\n2019-10-02,291.51,286.64,288.06,291.49,299.41576923642367,-299.41576923642367,-300.7335514077499,-300.7335514077499,-300.7335514077499,-307.056710473\n2019-10-03,290.42,284.82,290.42,287.81,298.45,-298.45,-299.46513178105243,-299.46513178105243,-299.46513178105243,-305.62754073989\n2019-10-04,294.63,291.08,294.35,291.21,296.54179999999997,-296.54179999999997,-297.85416728513667,-297.85416728513667,-297.85416728513667,-303.7548620732999\n2019-10-07,295.26,292.77,293.08,293.5,284.82,284.82,-296.42040888377164,-296.42040888377164,-296.42040888377164,-302.0507244867029\n2019-10-08,291.85,288.49,288.53,291.03,285.0288,285.0288,-295.26,-295.26,-295.26,-300.4999592828996\n2019-10-09,292.3,290.06,291.27,290.78,285.233424,285.233424,-295.26,-295.26,-295.26,-299.0887629474387\n2019-10-10,294.21,291.0,293.24,291.14,285.43395552000004,285.43395552000004,284.82,284.82,284.82,-297.8045742821692\n2019-10-11,298.72,296.15,296.28,296.28,285.6304764096,285.6304764096,285.0078,285.0078,285.0078,279.1236\n2019-10-14,296.67,295.58,295.95,295.93,286.15405735321605,286.15405735321605,285.41916599999996,285.41916599999996,285.41916599999996,279.515528\n2019-10-15,299.7,296.97,298.88,297.05,286.6566950590874,286.6566950590874,285.81819102,285.81819102,285.81819102,279.89961744000004\n2019-10-16,299.16,297.92,298.4,298.4,287.43929335554213,287.43929335554213,286.37346337919996,286.37346337919996,286.37346337919996,280.49362891680005\n2019-10-17,300.24,298.52,299.28,299.7,288.1749357542096,288.1749357542096,286.90652484403194,286.90652484403194,286.90652484403194,281.069820049296\n2019-10-18,299.4,297.0,297.97,298.71,289.14014089387285,289.14014089387285,287.5731986018303,287.5731986018303,287.5731986018303,281.8366272473242\n2019-10-21,300.21,298.94,299.99,299.48,290.02812962236305,290.02812962236305,288.2065386717388,288.2065386717388,288.2065386717388,282.5727621574312\n2019-10-22,300.9,298.92,299.01,300.63,290.845079252574,290.845079252574,288.8082117381519,288.8082117381519,288.8082117381519,283.279451671134\n2019-10-23,299.94,298.5,299.88,298.74,291.85057132731663,291.85057132731663,289.5337190338628,289.5337190338628,289.5337190338628,284.1604790875773\n2019-10-24,301.07,299.47,300.37,300.88,292.755514194585,292.755514194585,290.215695891831,290.215695891831,290.215695891831,284.99745513319846\n2019-10-25,302.19,299.69,301.6,299.74,293.7532524912348,293.7532524912348,290.9754971794028,290.9754971794028,290.9754971794028,285.96180782520656\n2019-10-28,303.85,302.91,303.3,302.91,294.93439714246193,294.93439714246193,291.8726574050506,291.8726574050506,291.8726574050506,287.0977812774421\n2019-10-29,304.22,302.86,303.21,303.03,296.36089359966803,296.36089359966803,292.950618238596,292.950618238596,292.950618238596,288.4379587752467\n2019-10-30,304.55,301.99,304.14,303.42,297.7755327517278,297.7755327517278,294.0775564147364,294.0775564147364,294.0775564147364,289.8583424854745\n2019-10-31,304.13,301.74,303.33,304.11,299.13042620138225,299.13042620138225,295.2295252091154,295.2295252091154,295.2295252091154,291.32750823692703\n2019-11-01,306.19,304.75,306.14,304.92,300.2143409611058,300.2143409611058,296.2547774361127,296.2547774361127,296.2547774361127,292.64975741323434\n2019-11-04,308.0,306.96,307.37,307.87,301.40947276888465,301.40947276888465,297.44700414377917,297.44700414377917,297.44700414377917,294.1391840977786\n2019-11-05,307.91,306.71,307.03,307.58,302.7275782151077,302.7275782151077,298.81889360508785,298.81889360508785,298.81889360508785,295.8024820060451\n2019-11-06,307.4,306.07,307.1,307.06,303.78206257208615,303.78206257208615,300.0124374364264,300.0124374364264,300.0124374364264,297.2661841653197\n2019-11-07,309.45,307.66,308.18,308.6,304.6256500576689,304.6256500576689,301.050820569691,301.050820569691,301.050820569691,298.55424206548133\n2019-11-08,308.97,307.04,308.94,307.82,305.5905200461351,305.5905200461351,302.22670568993425,302.22670568993425,302.22670568993425,299.9706905969688\n2019-11-11,308.54,307.27,308.35,307.43,306.3624160369081,306.3624160369081,303.23796689334347,303.23796689334347,303.23796689334347,301.20300081936284\n2019-11-12,309.99,308.15,309.0,308.75,306.9799328295265,306.9799328295265,304.10765152827537,304.10765152827537,304.10765152827537,302.2751107128457\n2019-11-13,309.54,307.67,309.1,307.9,307.27,307.27,304.99000379903407,304.99000379903407,304.99000379903407,303.3551952130473\n2019-11-14,309.64,308.09,309.55,308.77,307.67,307.67,305.74000322917897,305.74000322917897,305.74000322917897,304.2840678832207\n2019-11-15,311.83,310.26,311.79,310.98,307.67,307.67,306.37750274480214,306.37750274480214,306.37750274480214,305.0828983795698\n2019-11-18,312.28,311.03,312.02,311.52,308.09,308.09,307.2499023056338,307.2499023056338,307.2499023056338,306.09496362263434\n2019-11-19,312.69,311.22,311.93,312.68,308.928,308.928,308.105018913676,308.105018913676,308.105018913676,307.08456944301287\n2019-11-20,311.82,309.07,310.77,311.3,312.69,-312.69,308.9303155092143,308.9303155092143,308.9303155092143,308.03749263770067\n2019-11-21,311.01,309.39,310.27,310.85,312.69,-312.69,309.07,309.07,309.07,308.8284188892915\n2019-11-22,311.23,309.85,310.96,311.06,312.6176,-312.6176,309.07,309.07,309.07,309.07\n2019-11-25,313.37,311.98,313.37,311.99,309.07,309.07,309.39,309.39,309.39,309.39\n2019-11-26,314.28,313.06,314.08,313.42,309.156,309.156,309.85,309.85,309.85,309.85\n2019-11-27,315.48,314.37,315.48,314.67,309.36096,309.36096,310.736,310.736,310.736,310.6917\n2019-11-29,315.13,314.06,314.31,314.89,309.72810239999995,309.72810239999995,311.73224,311.73224,311.73224,311.64936\n2019-12-02,314.66,311.18,311.64,314.63,310.07321625599997,310.07321625599997,-315.48,-315.48,-315.48,-321.7896\n2019-12-03,309.64,307.13,309.55,308.64,315.48,-315.48,-315.351,-315.351,-315.351,-321.471312\n2019-12-04,312.11,310.32,311.46,310.63,315.31300000000005,-315.31300000000005,-314.93995,-314.93995,-314.93995,-320.7542464\n2019-12-05,312.24,310.59,312.02,312.22,315.14934000000005,-315.14934000000005,-314.54945250000003,-314.54945250000003,-314.54945250000003,-320.07303408\n2019-12-06,315.31,314.1,314.87,314.14,307.13,307.13,307.13,307.13,307.13,-319.425882376\n2019-12-09,315.18,313.8,313.88,314.41,307.29359999999997,307.29359999999997,307.29359999999997,307.29359999999997,307.29359999999997,-318.8110882572\n2019-12-10,314.54,312.81,313.53,313.8,307.45392799999996,307.45392799999996,307.45392799999996,307.45392799999996,307.45392799999996,-318.22703384434004\n2019-12-11,314.7,313.6,314.42,314.05,307.61104944,307.61104944,307.61104944,307.61104944,307.61104944,-317.672182152123\n2019-12-12,317.99,314.17,317.13,314.45,307.7650284512,307.7650284512,307.7650284512,307.7650284512,307.7650284512,300.9874\n2019-12-13,318.66,316.03,317.32,316.88,308.174027313152,308.174027313152,308.071777597664,308.071777597664,308.071777597664,301.327452\n2019-12-16,320.15,319.18,319.5,319.18,308.8031856743629,308.8031856743629,308.4953064937574,308.4953064937574,308.4953064937574,301.84742844\n2019-12-17,320.24,319.48,319.57,319.98,309.71093082041386,309.71093082041386,309.07804116906954,309.07804116906954,309.07804116906954,302.57953130239997\n2019-12-18,320.25,319.53,319.59,320.0,310.7638377383725,310.7638377383725,309.74775869892534,309.74775869892534,309.74775869892534,303.46255473727996\n2019-12-19,320.98,319.76,320.9,319.78,311.9021772097678,311.9021772097678,310.4829155900006,310.4829155900006,310.4829155900006,304.46980145304315\n2019-12-20,321.45,320.4,320.73,320.54,313.1730724004003,313.1730724004003,311.32268234280053,311.32268234280053,311.32268234280053,305.62551535133014\n2019-12-23,321.65,321.07,321.22,321.63,314.49738081633626,314.49738081633626,312.2341409319485,312.2341409319485,312.2341409319485,306.8914741232237\n2019-12-24,321.52,320.9,321.23,321.43,315.78485226939574,315.78485226939574,313.17572683875363,313.17572683875363,313.17572683875363,308.2197414521336\n2019-12-26,322.94,321.64,322.94,321.69,316.8405788609045,316.8405788609045,314.0231541548783,314.0231541548783,314.0231541548783,309.42846472144157\n2019-12-27,323.8,322.29,322.86,323.77,318.06046308872357,318.06046308872357,315.00400719784164,315.00400719784164,315.00400719784164,310.7796182492974\n2019-12-30,323.1,320.55,321.08,322.94,319.2083704709789,319.2083704709789,316.05952633410067,316.05952633410067,316.05952633410067,312.2118602418747\n2019-12-31,322.125,320.15,321.86,320.5,320.1266963767831,320.1266963767831,316.98838317400856,316.98838317400856,316.98838317400856,313.4865556152685\n2020-01-02,324.87,322.535,324.87,323.58,320.15,320.15,317.80577719312754,317.80577719312754,317.80577719312754,314.621034497589\n2020-01-03,323.64,321.11,322.41,321.19,320.15,320.15,318.72412615802097,318.72412615802097,318.72412615802097,315.8509103578783\n2020-01-06,323.73,320.36,323.64,320.44,324.87,-324.87,319.52308975747826,319.52308975747826,319.52308975747826,316.9332011149329\n2020-01-07,323.535,322.24,322.73,323.02,324.7798,-324.7798,320.2181880890061,320.2181880890061,320.2181880890061,317.88561698114097\n2020-01-08,325.78,322.68,324.45,322.99,320.36,320.36,320.36,320.36,320.36,318.72374294340403\n2020-01-09,326.73,325.52,326.65,326.2,320.46840000000003,320.46840000000003,321.1188,321.1188,321.1188,319.6410563607615\n2020-01-10,327.46,325.205,325.71,327.36,320.71886400000005,320.71886400000005,321.96048,321.96048,321.96048,320.6335084702549\n2020-01-13,327.96,325.92,327.95,326.4,321.1233321600001,321.1233321600001,322.8404032,322.8404032,322.8404032,321.6574821997167\n2020-01-14,328.62,326.85,327.45,327.48,321.67026558720005,321.67026558720005,323.710734656,323.710734656,323.710734656,322.665885047762\n2020-01-15,329.02,327.26,328.19,327.34,322.36523902848006,322.36523902848006,324.59440241792,324.59440241792,324.59440241792,323.6780845896425\n2020-01-16,330.92,329.45,330.92,329.67,323.1638103450625,323.1638103450625,325.4352659585152,325.4352659585152,325.4352659585152,324.63962936350686\n2020-01-17,332.18,331.07,331.95,331.72,324.2496768967537,324.2496768967537,326.53221276681217,326.53221276681217,326.53221276681217,325.83289978444054\n2020-01-21,332.18,330.82,331.3,330.92,325.5185285932731,325.5185285932731,327.7182480857816,327.7182480857816,327.7182480857816,327.10231982755244\n2020-01-22,332.95,331.17,331.34,332.26,326.58436401834945,326.58436401834945,328.65521598776746,328.65521598776746,328.65521598776746,328.11785586204195\n2020-01-23,331.92,329.41,331.72,330.6,327.7301784950465,327.7301784950465,-332.95,-332.95,-332.95,329.1326061310131\n2020-01-24,332.53,327.36,328.77,332.46,332.95,-332.95,-332.95,-332.95,-332.95,-339.609\n2020-01-27,325.12,322.68,323.5,323.05,332.8382,-332.8382,-332.6705,-332.6705,-332.6705,-339.24152999999995\n2020-01-28,327.85,324.55,326.89,325.06,332.53,-332.53,-332.53,-332.53,-332.53,-338.41345349999995\n2020-01-29,328.62,326.4,326.62,328.4,332.13599999999997,-332.13599999999997,-331.84049999999996,-331.84049999999996,-331.84049999999996,-337.62678082499997\n2020-01-30,327.9,323.54,327.68,324.37,331.75775999999996,-331.75775999999996,-331.19926499999997,-331.19926499999997,-331.19926499999997,-336.87944178375\n2020-01-31,327.17,320.74,321.73,326.97,331.3946496,-331.3946496,-330.60291644999995,-330.60291644999995,-330.60291644999995,-336.1694696945625\n2020-02-03,326.15,323.22,324.12,323.35,330.75537062399997,-330.75537062399997,-329.71525396949994,-329.71525396949994,-329.71525396949994,-335.0894068159431\n2020-02-04,330.01,327.735,329.06,328.07,330.15444838656,-330.15444838656,320.74,320.74,320.74,-334.0849483388271\n2020-02-05,333.08,330.68,332.86,332.29,320.74,320.74,320.9254,320.9254,320.9254,-333.15080195510916\n2020-02-06,334.19,332.805,333.98,333.98,320.9868,320.9868,321.29003800000004,321.29003800000004,321.29003800000004,314.3252\n2020-02-07,333.62,331.6,332.2,332.81,321.514928,321.514928,321.80603648000005,321.80603648000005,321.80603648000005,314.722496\n2020-02-10,334.72,331.19,334.68,331.19,322.02193088,322.02193088,322.30139502080004,322.30139502080004,322.30139502080004,315.11184607999996\n2020-02-11,337.02,334.75,335.26,336.16,322.78381502720003,322.78381502720003,322.92232526976005,322.92232526976005,322.92232526976005,315.7000906976\n2020-02-12,337.65,336.43,337.42,336.86,323.922709825024,323.922709825024,323.76818575357447,323.76818575357447,323.76818575357447,316.552887069696\n2020-02-13,338.12,335.57,337.06,335.92,325.2954388425216,325.2954388425216,324.73991275082426,324.73991275082426,324.73991275082426,317.6077427162112\n2020-02-14,337.72,336.2,337.6,337.48,326.834386181419,326.834386181419,325.8103197307583,325.8103197307583,325.8103197307583,318.8384781532385\n2020-02-18,337.17,335.21,336.73,336.52,328.1886598396487,328.1886598396487,326.7950941522976,326.7950941522976,326.7950941522976,319.9953694640442\n2020-02-19,339.065,337.48,338.34,337.81,329.3804206588909,329.3804206588909,327.7010866201138,327.7010866201138,327.7010866201138,321.0828472962015\n2020-02-20,338.635,333.69,336.95,337.77,330.7362617666462,330.7362617666462,328.7238388243036,328.7238388243036,328.7238388243036,322.3415979854674\n2020-02-21,335.81,332.58,333.48,335.41,331.9022851193157,331.9022851193157,329.65454333011627,329.65454333011627,329.65454333011627,323.51223612648465\n2020-02-24,325.84,321.24,322.42,323.17,339.065,-339.065,-339.065,-339.065,-339.065,-345.8463\n2020-02-25,324.61,311.69,312.65,323.96,338.7085,-338.7085,-338.53025,-338.53025,-338.53025,-345.108111\n2020-02-26,318.11,310.7,311.5,314.19,337.62776,-337.62776,-337.1882375,-337.1882375,-337.1882375,-343.43720545\n2020-02-27,309.64,297.51,297.51,305.45,336.0120944,-336.0120944,-335.33406087500003,-335.33406087500003,-335.33406087500003,-341.1456010685\n2020-02-28,296.26,285.54,296.26,288.62,332.93192684800005,-332.93192684800005,-331.92989539625,-331.92989539625,-331.92989539625,-337.21839697233503\n2020-03-02,309.15,294.46,309.09,298.0,328.19273416320004,-328.19273416320004,-326.8270069026625,-326.8270069026625,-326.8270069026625,-331.5337733053782\n2020-03-03,313.8,297.57,300.24,309.55,323.92746074688006,-323.92746074688006,-322.2854361433696,-322.2854361433696,-322.2854361433696,-326.4744582417866\n2020-03-04,313.1,303.33,312.86,306.11,320.08871467219205,-320.08871467219205,-318.243438167599,-318.243438167599,-318.243438167599,-321.97166783519003\n2020-03-05,308.47,300.02,302.46,304.95,316.63384320497283,-316.63384320497283,-314.6460599691631,-314.6460599691631,-314.6460599691631,-317.96418437331914\n2020-03-06,298.78,290.24,297.46,293.08,313.52445888447556,-313.52445888447556,-313.1,-313.1,-313.1,-314.39752409225406\n2020-03-09,284.14,273.46,274.23,275.6,310.72601299602803,-310.72601299602803,-310.0684,-310.0684,-310.0684,-311.2231964421061\n2020-03-10,288.52,273.5,288.42,284.76,306.25409143650467,-306.25409143650467,-305.309308,-305.309308,-305.309308,-306.3139809046323\n2020-03-11,281.91,270.89,274.36,280.73,302.3188004641241,-302.3188004641241,-301.16889796,-301.16889796,-301.16889796,-302.04296338703006\n2020-03-12,266.64,247.72,248.11,256.05,297.9187683991467,-297.9187683991467,-296.627063266,-296.627063266,-296.627063266,-297.37001887897554\n2020-03-13,271.06,249.58,269.32,263.34,289.88696545528325,-289.88696545528325,-288.31286251078,-288.31286251078,-288.31286251078,-288.9295156695497\n2020-03-16,256.9,237.37,239.85,240.78,283.1402509824379,-283.1402509824379,-281.4120758839474,-281.4120758839474,-281.4120758839474,-281.92389800572624\n2020-03-17,255.99,237.08,252.8,245.04,274.9016058055991,-274.9016058055991,-273.0440814659974,-273.0440814659974,-273.0440814659974,-273.4586573846383\n2020-03-18,246.03,228.08,240.0,236.25,267.33728464447927,-267.33728464447927,-265.491624358138,-265.491624358138,-265.491624358138,-265.81913933386426\n2020-03-19,247.38,232.25,240.51,239.26,259.4858277155834,-259.4858277155834,-256.88695075576624,-256.88695075576624,-256.88695075576624,-257.13913728707547\n2020-03-20,244.46,228.62,228.8,242.59,253.20466217246673,-253.20466217246673,-250.26135208194,-250.26135208194,-250.26135208194,-250.45553571104813\n2020-03-23,229.39,218.27,222.95,228.0,248.1797297379734,-248.1797297379734,-247.38,-247.38,-247.38,-247.38\n2020-03-24,244.1,233.8,243.15,234.99,244.46,-244.46,-244.46,-244.46,-244.46,-244.46\n2020-03-25,256.35,239.76,246.79,245.0,218.27,218.27,218.27,218.27,218.27,213.90460000000002\n2020-03-26,262.8,249.05,261.2,249.26,219.0316,219.0316,219.0316,219.0316,219.0316,214.753508\n2020-03-27,260.8,251.05,253.42,253.22,220.782336,220.782336,220.344652,220.344652,220.344652,216.19490276000002\n2020-03-30,262.39,253.53,261.65,255.68,222.46304256,222.46304256,221.61831244,221.61831244,221.61831244,217.59305567720003\n2020-03-31,263.33,256.22,257.75,260.7,224.0765208576,224.0765208576,222.8537630668,222.8537630668,222.8537630668,218.94926400688402\n2020-04-01,251.44,243.9,246.15,247.95,226.431729606144,226.431729606144,224.472812544128,224.472812544128,224.472812544128,220.72449344660865\n2020-04-02,252.67,244.6,251.83,245.2,228.64562582977535,228.64562582977535,226.0271000423629,226.0271000423629,226.0271000423629,222.4287137087443\n2020-04-03,253.31,245.23,248.19,250.81,230.72668827998882,230.72668827998882,227.51921604066837,227.51921604066837,227.51921604066837,224.06476516039453\n2020-04-06,266.97,256.725,264.86,258.05,232.6828869831895,232.6828869831895,228.95164739904163,228.95164739904163,228.95164739904163,225.63537455397875\n2020-04-07,275.0,264.89,265.13,274.3,235.42585602453434,235.42585602453434,230.85256502908956,230.85256502908956,230.85256502908956,227.70210582627982\n2020-04-08,276.0,265.56,274.03,268.05,239.3832704220809,239.3832704220809,233.5014111273442,233.5014111273442,233.5014111273442,230.53997947670302\n2020-04-09,281.2,275.48,278.2,277.81,243.7772779714312,243.7772779714312,236.4763123484301,236.4763123484301,236.4763123484301,233.7221809133338\n2020-04-13,277.41,271.41,275.66,277.15,249.01645905543083,249.01645905543083,240.0542073605557,240.0542073605557,240.0542073605557,237.5204064402671\n2020-04-14,284.75,279.91,283.79,281.08,253.5221547876705,253.5221547876705,243.34587077171125,243.34587077171125,243.34587077171125,241.01477392504572\n2020-04-15,279.58,275.46,277.76,277.52,258.5186100216432,258.5186100216432,247.07224240225725,247.07224240225725,247.07224240225725,244.9509442717916\n2020-04-16,280.03,275.76,279.1,279.05,262.7156324181803,262.7156324181803,250.4632405860541,250.4632405860541,250.4632405860541,248.53285928733035\n2020-04-17,287.3,282.4,286.64,285.41,266.2411312312714,266.2411312312714,253.54904893330922,253.54904893330922,253.54904893330922,251.79240195147062\n2020-04-20,286.29,281.36,281.59,282.6,270.0317276096426,270.0317276096426,256.9241440399783,256.9241440399783,256.9241440399783,255.34316175632355\n2020-04-21,278.04,272.04,273.04,276.48,287.3,-287.3,259.9617296359804,259.9617296359804,259.9617296359804,258.5388455806912\n2020-04-22,281.0,276.91,279.1,278.38,286.9948,-286.9948,262.6955566723824,262.6955566723824,262.6955566723824,261.4149610226221\n2020-04-23,283.93,278.751,279.08,280.46,286.695704,-286.695704,265.15600100514416,265.15600100514416,265.15600100514416,264.0034649203599\n2020-04-24,283.69,278.5,282.97,280.69,286.40258991999997,-286.40258991999997,267.3704009046297,267.3704009046297,267.3704009046297,266.33311842832387\n2020-04-27,288.27,284.62,287.05,285.02,272.04,272.04,269.36336081416675,269.36336081416675,269.36336081416675,268.42980658549146\n2020-04-28,291.4,285.405,285.73,291.0,272.3646,272.3646,271.44309112460843,271.44309112460843,271.44309112460843,270.6122278610874\n2020-04-29,294.87,290.41,293.21,291.59,273.126016,273.126016,273.8379201896554,273.8379201896554,273.8379201896554,273.10676051775687\n2020-04-30,292.23,288.59,290.48,291.69,274.43065504,274.43065504,276.57209056500017,276.57209056500017,276.57209056500017,275.93598165044847\n2020-05-01,286.04,281.53,282.79,285.16,275.6570157376,275.6570157376,278.95081879155015,278.95081879155015,278.95081879155015,278.3974040358902\n2020-05-04,283.9,279.16,283.57,280.46,276.809794793344,276.809794793344,-294.87,-294.87,-294.87,-300.7674\n2020-05-05,289.25,285.75,286.19,286.66,277.89340710574334,277.89340710574334,-294.3987,-294.3987,-294.3987,-300.11917800000003\n2020-05-06,288.46,284.15,284.25,288.01,278.9120026793987,278.9120026793987,-293.94153900000003,-293.94153900000003,-293.94153900000003,-299.49040266000003\n2020-05-07,289.78,287.15,287.68,287.79,279.8694825186348,279.8694825186348,-293.49809283,-293.49809283,-293.49809283,-298.88049058020005\n2020-05-08,292.85,289.87,292.44,291.05,280.7695135675167,280.7695135675167,-293.0679500451,-293.0679500451,-293.0679500451,-298.28887586279404\n2020-05-11,294.0,289.88,292.5,290.37,281.6155427534657,281.6155427534657,279.16,279.16,279.16,-297.71500958691024\n2020-05-12,294.22,286.55,286.67,293.75,282.41081018825776,282.41081018825776,279.45680000000004,279.45680000000004,279.45680000000004,-297.15835929930296\n2020-05-13,287.19,278.965,281.6,285.95,294.87,-294.87,-294.22,-294.22,-294.22,-296.6184085203239\n2020-05-14,285.1,276.38,284.97,278.84,294.5519,-294.5519,-294.22,-294.22,-294.22,-295.7357380943077\n2020-05-15,286.33,281.34,286.28,282.32,293.825024,-293.825024,-293.32800000000003,-293.32800000000003,-293.32800000000003,-294.38083642770613\n2020-05-18,296.675,292.7,295.0,293.09,276.38,276.38,276.38,276.38,276.38,270.8524\n2020-05-19,296.205,291.97,291.97,294.41,276.78589999999997,276.78589999999997,276.78589999999997,276.78589999999997,276.78589999999997,271.368852\n2020-05-20,297.87,295.58,296.93,295.83,277.183682,277.183682,277.183682,277.183682,277.183682,271.87497496000003\n2020-05-21,297.67,293.69,294.88,296.8,278.01113472,278.01113472,277.80427154,277.80427154,277.80427154,272.65482571120003\n2020-05-22,295.63,293.23,295.44,294.56,278.80548933119996,278.80548933119996,278.4062433938,278.4062433938,278.4062433938,273.411280939864\n2020-05-26,302.19,298.7,299.08,301.96,279.56806975795195,279.56806975795195,278.990156091986,278.990156091986,278.990156091986,274.14504251166807\n2020-05-27,303.57,296.87,303.53,302.14,280.92538557247485,280.92538557247485,279.9181498483066,279.9181498483066,279.9181498483066,275.26684081120135\n2020-05-28,306.83,302.26,302.97,304.69,282.73695472667686,282.73695472667686,281.10074235589127,281.10074235589127,281.10074235589127,276.68199877064126\n2020-05-29,304.96,299.47,304.32,302.46,285.1462592540092,285.1462592540092,282.6444978145378,282.6444978145378,282.6444978145378,278.4908788444028\n2020-06-01,306.205,303.06,305.55,303.63,287.31463332860824,287.31463332860824,284.0956279456655,284.0956279456655,284.0956279456655,280.19122611373865\n2020-06-02,308.13,305.1,308.08,306.52,289.2661699957474,289.2661699957474,285.45969026892556,285.45969026892556,285.45969026892556,281.7895525469143\n2020-06-03,313.21,309.94,312.18,310.26,291.52982959625774,291.52982959625774,287.0466119501008,287.0466119501008,287.0466119501008,283.6333838686303\n2020-06-04,313.0,309.08,311.36,311.12,294.5650534527817,294.5650534527817,289.1396829940927,289.1396829940927,289.1396829940927,285.99951315913984\n2020-06-05,321.275,317.17,319.34,317.41,297.17534596939225,297.17534596939225,291.0653083545653,291.0653083545653,291.0653083545653,288.1763521064087\n2020-06-08,323.41,319.63,323.2,320.3,301.0312906142895,301.0312906142895,293.7841806026544,293.7841806026544,293.7841806026544,291.1552304168319\n2020-06-09,322.365,319.36,320.79,320.26,305.0594583037174,305.0594583037174,296.7467625423889,296.7467625423889,296.7467625423889,294.3807073751487\n2020-06-10,322.39,318.23,319.0,321.4,308.3625558090483,308.3625558090483,299.41308628815005,299.41308628815005,299.41308628815005,297.28363663763383\n2020-06-11,312.14,300.01,300.61,311.31,323.41,-323.41,-323.41,-323.41,-323.41,299.89627297387045\n2020-06-12,309.08,298.6,304.21,308.32,322.942,-322.942,-322.708,-322.708,-322.708,-329.87820000000005\n2020-06-15,308.28,296.74,307.05,298.01,321.96832,-321.96832,-321.50260000000003,-321.50260000000003,-321.50260000000003,-328.939854\n2020-06-16,315.64,307.68,312.96,315.56,320.4546208,-320.4546208,-319.769218,-319.769218,-319.769218,-327.3298613\n2020-06-17,314.389,310.86,311.66,314.04,319.03174355199997,-319.03174355199997,-318.15717274,-318.15717274,-318.15717274,-325.800368235\n2020-06-18,312.3,309.52,311.78,309.98,317.69423893887995,-317.69423893887995,-316.65797064820003,-316.65797064820003,-316.65797064820003,-324.34734982325\n2020-06-19,314.38,306.53,308.64,314.1,316.43698460254717,-316.43698460254717,-315.263712702826,-315.263712702826,-315.263712702826,-322.9669823320875\n2020-06-22,311.05,306.75,310.62,307.95,315.25516552639436,-315.25516552639436,-314.38,-314.38,-314.38,-321.65563321548314\n2020-06-23,314.5,311.62,312.05,313.5,296.74,296.74,296.74,296.74,296.74,-320.409851554709\n2020-06-24,310.5,302.11,304.09,309.84,297.09520000000003,297.09520000000003,297.09520000000003,297.09520000000003,297.09520000000003,-319.22635897697353\n2020-06-25,307.64,301.28,307.35,303.47,297.44329600000003,297.44329600000003,297.44329600000003,297.44329600000003,297.44329600000003,-318.10204102812486\n2020-06-26,306.38,299.42,300.05,306.17,297.78443008000005,297.78443008000005,297.78443008000005,297.78443008000005,297.78443008000005,-317.0339389767186\n2020-06-29,304.46,298.93,304.46,301.42,298.11874147840007,298.11874147840007,298.11874147840007,298.11874147840007,298.11874147840007,-316.0192420278827\n2020-06-30,310.2,303.83,308.36,304.01,298.44636664883205,298.44636664883205,298.44636664883205,298.44636664883205,298.44636664883205,-315.05527992648854\n2020-07-01,311.89,309.07,310.52,309.57,298.7674393158554,298.7674393158554,298.7674393158554,298.7674393158554,298.7674393158554,-314.1395159301641\n2020-07-02,315.7,311.51,312.23,314.24,299.08209052953833,299.08209052953833,299.08209052953833,299.08209052953833,299.08209052953833,290.8052\n2020-07-06,317.68,315.56,317.05,316.38,299.7468069083568,299.7468069083568,299.5806278136522,299.5806278136522,299.5806278136522,291.30309600000004\n2020-07-07,317.52,313.37,313.78,315.38,300.8227984938554,300.8227984938554,300.3046027011061,300.3046027011061,300.3046027011061,292.09440312000004\n2020-07-08,316.3,312.7,316.18,314.59,301.83423058422403,301.83423058422403,300.9996185930618,300.9996185930618,300.9996185930618,292.86197102640006\n2020-07-09,317.1,310.68,314.38,316.85,302.7849767491706,302.7849767491706,301.66683384933935,301.66683384933935,301.66683384933935,293.60651189560804\n2020-07-10,317.87,312.761,317.59,314.26,303.6786781442204,303.6786781442204,302.3073604953658,302.3073604953658,302.3073604953658,294.3287165387398\n2020-07-13,322.71,314.14,314.84,320.06,304.81398389268276,304.81398389268276,303.0854924705975,303.0854924705975,303.0854924705975,295.2703678771902\n2020-07-14,319.76,312.0,318.92,313.25,306.6035855034145,306.6035855034145,304.2629629223616,304.2629629223616,304.2629629223616,296.6423494833307\n2020-07-15,323.035,319.27,321.85,322.48,308.214226953073,308.214226953073,305.3697851470199,305.3697851470199,305.3697851470199,297.94573200916415\n2020-07-16,321.28,319.09,320.79,319.78,309.9927197187043,309.9927197187043,306.6063501867285,306.6063501867285,306.6063501867285,299.4510880886143\n2020-07-17,322.56,319.74,321.72,321.82,311.5577933524598,311.5577933524598,307.7563556736575,307.7563556736575,307.7563556736575,300.86612280329746\n2020-07-20,325.13,320.62,324.32,321.41,312.9350581501646,312.9350581501646,308.8258607765015,308.8258607765015,308.8258607765015,302.1962554350996\n2020-07-21,326.92,323.94,325.01,326.48,314.6423500091415,314.6423500091415,310.1301919143814,310.1301919143814,310.1301919143814,303.80161755464263\n2020-07-22,327.2,324.5,326.86,324.62,316.6067740076789,316.6067740076789,311.64127464208707,311.64127464208707,311.64127464208707,305.6510881502712\n2020-07-23,327.23,321.49,322.96,326.45,318.5135546862967,318.5135546862967,313.1971471778784,313.1971471778784,313.1971471778784,307.5904902167468\n2020-07-24,321.99,319.25,320.88,320.93,327.23,-327.23,314.74076098831176,314.74076098831176,314.74076098831176,309.5544411950721\n2020-07-27,323.41,320.78,323.22,321.63,327.23,-327.23,316.1145772795975,316.1145772795975,316.1145772795975,311.3219970755649\n2020-07-28,323.64,320.85,321.17,322.45,327.0704,-327.0704,317.33727377884173,317.33727377884173,317.33727377884173,312.91279736800846\n2020-07-29,325.73,322.08,325.12,322.14,326.913992,-326.913992,318.42547366316916,318.42547366316916,318.42547366316916,314.3445176312076\n2020-07-30,324.405,319.64,323.96,321.9,326.76071216,-326.76071216,319.39397156022056,319.39397156022056,319.39397156022056,315.6330658680869\n2020-07-31,326.61,321.34,326.52,326.0,326.6104979168,-326.6104979168,319.64,319.64,319.64,316.79275928127817\n2020-08-03,329.62,327.73,328.79,328.31,319.25,319.25,319.64,319.64,319.64,317.83648335315036\n2020-08-04,330.06,327.86,330.06,327.88,319.4574,319.4574,320.8376,320.8376,320.8376,319.13267018430383\n2020-08-05,332.39,331.19,332.11,331.46,319.881504,319.881504,322.036512,322.036512,322.036512,320.4439497621874\n2020-08-06,334.46,331.14,334.33,331.52,320.63201376,320.63201376,323.48600032,323.48600032,323.48600032,321.99693629310303\n2020-08-07,334.88,332.3,334.57,333.29,321.7382526592,321.7382526592,325.132100272,325.132100272,325.132100272,323.74176521206863\n2020-08-10,335.77,332.96,335.57,335.0,323.05242739327997,323.05242739327997,326.69176422848,326.69176422848,326.69176422848,325.4125004302583\n2020-08-11,337.54,332.01,332.8,336.86,324.57853610608635,324.57853610608635,328.2350643096384,328.2350643096384,328.2350643096384,327.069700361417\n2020-08-12,338.28,335.43,337.44,335.47,326.39314105123424,326.39314105123424,329.9099527339035,329.9099527339035,329.9099527339035,328.84965129997613\n2020-08-13,338.25,335.83,336.83,336.58,328.29503848303676,328.29503848303676,331.50026171446183,331.50026171446183,331.50026171446183,330.5471140659804\n2020-08-14,337.41,335.67,336.84,336.43,329.89263232575087,329.89263232575087,332.7884119887141,332.7884119887141,332.7884119887141,331.93903353410394\n2020-08-17,338.34,337.49,337.91,337.91,331.23461115363074,331.23461115363074,333.8318137108584,333.8318137108584,333.8318137108584,333.0804074979652\n2020-08-18,339.1,336.62,338.64,338.32,332.5135811459772,332.5135811459772,334.7334509686867,334.7334509686867,334.7334509686867,334.0797300733518\n2020-08-19,339.61,336.63,337.23,339.11,333.83086491678176,333.83086491678176,335.6504262652625,335.6504262652625,335.6504262652625,335.08378405868143\n2020-08-20,338.795,335.22,338.28,335.33,334.9866919334254,334.9866919334254,-339.61,-339.61,-339.61,-346.4022\n2020-08-21,339.71,337.55,339.48,337.86,335.22,335.22,335.22,335.22,335.22,-346.066734\n2020-08-24,343.0,341.06,342.92,342.13,335.22,335.22,335.22,335.22,335.22,-345.74133198\n2020-08-25,344.21,342.27,344.12,343.53,336.776,336.776,335.45340000000004,335.45340000000004,335.45340000000004,-345.42569202059997\n2020-08-26,347.86,344.17,347.57,344.72,338.2628,338.2628,335.803664,335.803664,335.803664,328.5156\n2020-08-27,349.9,346.54,348.33,348.5,340.18224000000004,340.18224000000004,336.40648080000005,336.40648080000005,336.40648080000005,328.902488\n2020-08-28,350.71,348.16,350.58,349.45,342.12579200000005,342.12579200000005,337.21609195200006,337.21609195200006,337.21609195200006,329.53241336\n2020-08-31,351.29,349.1,349.31,350.35,343.84263360000006,343.84263360000006,338.16066551536005,338.16066551536005,338.16066551536005,330.37951682560004\n2020-09-01,352.69,349.24,352.6,350.24,345.33210688,345.33210688,339.21101227413124,339.21101227413124,339.21101227413124,331.42504098432005\n2020-09-02,358.7,353.43,357.7,354.64,346.80368550400004,346.80368550400004,340.4241211694594,340.4241211694594,340.4241211694594,332.7009385252608\n2020-09-03,356.38,342.61,345.39,355.85,358.7,-358.7,342.25170905251343,342.25170905251343,342.25170905251343,334.52087282849254\n2020-09-04,347.809,334.88,342.57,346.07,358.7,-358.7,-358.7,-358.7,-358.7,-365.87399999999997\n2020-09-08,338.05,332.88,333.21,336.74,357.74719999999996,-357.74719999999996,-357.98539999999997,-357.98539999999997,-357.98539999999997,-364.94417999999996\n2020-09-09,342.46,336.62,339.79,337.52,356.25516799999997,-356.25516799999997,-356.73013,-356.73013,-356.73013,-363.34097099999997\n2020-09-10,342.52,332.86,333.89,341.75,354.85265791999996,-354.85265791999996,-355.5376235,-355.5376235,-355.5376235,-361.81792244999997\n2020-09-11,336.97,331.0,334.06,335.79,353.09324528639996,-353.09324528639996,-353.950189855,-353.950189855,-353.950189855,-359.79086787849997\n2020-09-14,340.37,336.93,338.46,337.52,350.88392075775994,-350.88392075775994,-351.88467276805,-351.88467276805,-351.88467276805,-357.199689769435\n2020-09-15,342.02,339.02,340.17,341.11,348.89552868198393,-348.89552868198393,-350.00505221892547,-350.00505221892547,-350.00505221892547,-354.8417176901859\n2020-09-16,343.06,338.53,338.82,341.5,347.10597581378556,-347.10597581378556,-348.2945975192222,-348.2945975192222,-348.2945975192222,-352.69596309806917\n2020-09-17,337.69,333.0,335.84,333.52,345.495378232407,-345.495378232407,-346.73808374249217,-346.73808374249217,-346.73808374249217,-350.7433264192429\n2020-09-18,335.49,327.97,330.65,335.35,344.0458404091663,-344.0458404091663,-345.32165620566786,-345.32165620566786,-345.32165620566786,-348.96642704151105\n2020-09-21,327.09,321.73,326.97,325.71,342.1167395600664,-342.1167395600664,-343.4129740230444,-343.4129740230444,-343.4129740230444,-346.6568200669448\n2020-09-22,330.9,325.87,330.3,328.55,339.2625960216571,-339.2625960216571,-340.5941874000486,-340.5941874000486,-340.5941874000486,-343.416333458242\n2020-09-23,331.2,322.1,322.64,330.92,336.8080325786251,-336.8080325786251,-338.1418430380423,-338.1418430380423,-338.1418430380423,-340.5971101086705\n2020-09-24,326.79,319.8,323.5,321.22,334.6971080176176,-334.6971080176176,-336.0083034430968,-336.0083034430968,-336.0083034430968,-338.1443857945433\n2020-09-25,329.57,321.64,328.73,322.57,332.3135707347988,-332.3135707347988,-333.5770579266323,-333.5770579266323,-333.5770579266323,-335.39272792536184\n2020-09-28,334.96,332.16,334.19,333.22,319.8,319.8,319.8,319.8,319.8,313.404\n2020-09-29,334.77,331.63,332.37,334.0,320.1032,320.1032,320.1032,320.1032,320.1032,313.83512\n2020-09-30,338.29,332.88,334.89,333.1,320.40033600000004,320.40033600000004,320.40033600000004,320.40033600000004,320.40033600000004,314.2576176\n2020-10-01,338.71,335.01,337.04,337.63,321.11592256000006,321.11592256000006,320.93702592000005,320.93702592000005,320.93702592000005,314.978589072\n2020-10-02,335.915,331.19,333.84,331.71,322.1715672064,322.1715672064,321.64794488320007,321.64794488320007,321.64794488320007,315.92784550912\n2020-10-05,339.95,336.01,339.76,336.01,323.16387317401603,323.16387317401603,322.33042708787207,322.33042708787207,322.33042708787207,316.83913168875523\n2020-10-06,342.17,334.38,334.93,339.87,324.50676332009476,324.50676332009476,323.21140573347844,323.21140573347844,323.21140573347844,317.9946751043175\n2020-10-07,341.63,338.09,340.76,338.12,326.2730869880853,326.2730869880853,324.34892138946975,324.34892138946975,324.34892138946975,319.44519459805844\n2020-10-08,343.85,341.87,343.78,342.88,327.8627782892768,327.8627782892768,325.4181861061016,325.4181861061016,325.4181861061016,320.8086829221749\n2020-10-09,347.35,344.89,346.85,345.53,329.78124489456354,329.78124489456354,326.7084130786745,326.7084130786745,326.7084130786745,322.4215751176227\n2020-10-12,354.02,349.06,352.43,349.55,332.24087060932465,332.24087060932465,328.3597400323805,328.3597400323805,328.3597400323805,324.41584910821285\n2020-10-13,352.38,349.1,350.13,352.31,335.7255313118327,335.7255313118327,330.66916342946627,330.66916342946627,330.66916342946627,327.08022268847367\n2020-10-14,351.93,347.15,347.93,350.73,338.65264630193946,338.65264630193946,332.7707387208143,332.7707387208143,332.7707387208143,329.50480264651105\n2020-10-15,348.02,343.13,347.5,343.72,341.11142289362914,341.11142289362914,334.683172235941,334.683172235941,334.683172235941,331.7111704083251\n2020-10-16,350.75,347.11,347.29,348.99,343.13,343.13,336.42348673470633,336.42348673470633,336.42348673470633,333.71896507157584\n2020-10-19,349.32,341.06,342.01,348.57,354.02,-354.02,338.00717292858275,338.00717292858275,338.00717292858275,335.546058215134\n2020-10-20,346.88,342.65,343.38,343.42,353.76079999999996,-353.76079999999996,339.4483273650103,339.4483273650103,339.4483273650103,337.20871297577196\n2020-10-21,345.67,342.41,342.73,343.36,353.506784,-353.506784,340.7597779021594,340.7597779021594,340.7597779021594,338.7217288079525\n2020-10-22,345.24,340.65,344.61,342.92,353.25784832,-353.25784832,-354.02,-354.02,-354.02,340.0985732152368\n2020-10-23,345.99,343.15,345.78,345.91,352.7535343872,-352.7535343872,-353.6189,-353.6189,-353.6189,340.65\n2020-10-26,342.98,335.63,339.39,342.14,352.269393011712,-352.269393011712,-353.229833,-353.229833,-353.229833,-361.1004\n2020-10-27,340.115,337.99,338.22,339.74,351.27102943100925,-351.27102943100925,-352.34984134999996,-352.34984134999996,-352.34984134999996,-360.33628799999997\n2020-10-28,332.84,326.13,326.66,332.11,350.3325676651487,-350.3325676651487,-351.51384928249996,-351.51384928249996,-351.51384928249996,-359.59509935999995\n2020-10-29,333.39,325.1,329.98,326.99,348.3963622519368,-348.3963622519368,-349.73697983272496,-349.73697983272496,-349.73697983272496,-357.92184439199997\n2020-10-30,329.68,322.6,326.54,328.28,346.06672602674314,-346.06672602674314,-347.5196516477797,-347.5196516477797,-347.5196516477797,-355.62431528456\n2020-11-02,332.35,327.24,330.2,330.2,343.250718903534,-343.250718903534,-344.7784899665239,-344.7784899665239,-344.7784899665239,-352.6521269089496\n2020-11-03,338.25,333.17,336.03,333.72,340.7726326351099,-340.7726326351099,-342.3388560702063,-342.3388560702063,-342.3388560702063,-349.9474354871441\n2020-11-04,347.92,339.6,343.54,340.8,322.6,322.6,322.6,322.6,322.6,316.148\n2020-11-05,352.19,348.875,350.24,349.28,323.1064,323.1064,323.1064,323.1064,323.1064,316.78344000000004\n2020-11-06,351.5,347.65,350.16,349.97,324.269744,324.269744,323.978908,323.978908,323.978908,317.8456368\n2020-11-09,364.37,354.06,354.56,364.36,325.38655424,325.38655424,324.82524076,324.82524076,324.82524076,318.87596769600003\n2020-11-10,355.18,350.59,354.04,353.52,327.7255609856,327.7255609856,326.4070311296,326.4070311296,326.4070311296,320.69572898816006\n2020-11-11,357.56,355.07,356.67,356.43,329.924227326464,329.924227326464,327.925549884416,327.925549884416,327.925549884416,322.44269982863364\n2020-11-12,356.42,351.26,353.21,355.57,331.99097368687615,331.99097368687615,329.3833278890394,329.3833278890394,329.3833278890394,324.1197918354883\n2020-11-13,358.9,354.71,358.1,355.3,333.9337152656636,333.9337152656636,330.7827947734778,330.7827947734778,330.7827947734778,325.7298001620687\n2020-11-16,362.59,359.59,362.57,361.1,335.75989234972377,335.75989234972377,332.12628298253867,332.12628298253867,332.12628298253867,327.275408155586\n2020-11-17,361.92,358.34,360.62,359.97,337.47649880874036,337.47649880874036,333.4160316632371,333.4160316632371,333.4160316632371,328.7591918293625\n2020-11-18,361.5,356.24,356.28,360.98,339.09010888021595,339.09010888021595,334.65419039670763,334.65419039670763,334.65419039670763,330.18362415618805\n2020-11-19,358.18,354.15,357.78,355.68,340.606902347403,340.606902347403,335.84282278083936,335.84282278083936,335.84282278083936,331.55107918994054\n2020-11-20,357.71,355.25,355.33,357.45,342.0326882065588,342.0326882065588,336.9839098696058,336.9839098696058,336.9839098696058,332.8638360223429\n2020-11-23,358.82,354.865,357.46,357.25,343.3729269141653,343.3729269141653,338.0793534748216,338.0793534748216,338.0793534748216,334.1240825814492\n2020-11-24,363.81,359.29,363.22,360.3,344.6327512993154,344.6327512993154,339.1309793358287,339.1309793358287,339.1309793358287,335.3339192781913\n2020-11-25,363.16,361.485,362.66,363.16,345.81698622135644,345.81698622135644,340.14054016239555,340.14054016239555,340.14054016239555,336.49536250706365\n2020-11-27,364.18,362.58,363.67,363.84,346.9301670480751,346.9301670480751,341.10971855589975,341.10971855589975,341.10971855589975,337.6103480067811\n2020-11-30,363.12,359.18,362.06,362.84,347.9765570251906,347.9765570251906,342.0401298136638,342.0401298136638,342.0401298136638,338.68073408650986\n2020-12-01,367.65,364.93,366.02,365.6,348.9601636036791,348.9601636036791,342.9333246211172,342.9333246211172,342.9333246211172,339.7083047230495\n2020-12-02,366.95,364.2,366.79,364.8,350.4553505153848,350.4553505153848,344.16915839006134,344.16915839006134,344.16915839006134,341.105389486897\n2020-12-03,368.19,365.5,366.69,366.66,351.830922474154,351.830922474154,345.34320047055826,345.34320047055826,345.34320047055826,342.43262001255215\n2020-12-04,369.85,367.22,369.85,367.3,353.46683022673864,353.46683022673864,346.71400844232477,346.71400844232477,346.71400844232477,343.978062811799\n2020-12-07,369.62,367.72,369.09,368.97,355.43281059953,355.43281059953,348.333527851362,348.333527851362,348.333527851362,345.78909841497307\n2020-12-08,370.77,367.67,370.17,367.67,357.1628733275864,357.1628733275864,349.83968090176666,349.83968090176666,349.83968090176666,347.47336152592493\n2020-12-09,371.05,365.95,366.85,370.91,359.0678710617243,359.0678710617243,351.5141064296253,351.5141064296253,351.5141064296253,349.3370926038509\n2020-12-10,367.855,364.45,366.73,365.39,360.9850116918484,360.9850116918484,353.27233685095905,353.27233685095905,353.27233685095905,351.29125426950435\n2020-12-11,366.58,363.265,366.3,364.93,362.59540982115266,362.59540982115266,354.87232653437275,354.87232653437275,354.87232653437275,353.06954138524895\n2020-12-14,369.8,364.49,364.66,368.61,363.265,363.265,356.3283171462792,356.3283171462792,356.3283171462792,354.68778266057654\n2020-12-15,369.59,365.92,369.59,367.46,363.265,363.265,357.65326860311404,357.65326860311404,357.65326860311404,356.1603822211247\n2020-12-16,371.16,368.88,370.17,369.81,364.49,364.49,358.8589744288338,358.8589744288338,358.8589744288338,357.5004478212235\n2020-12-17,372.459,371.05,372.24,371.93,365.6906,365.6906,360.08907698595044,360.08907698595044,360.08907698595044,358.8664030391011\n2020-12-18,371.15,367.02,369.18,370.98,372.459,-372.459,361.4497685174959,361.4497685174959,361.4497685174959,360.3615887048\n2020-12-21,378.46,362.03,367.86,364.98,362.03,362.03,-378.46,-378.46,-378.46,361.692303947272\n2020-12-22,368.33,366.04,367.24,368.23,362.03,362.03,-378.46,-378.46,-378.46,362.03\n2020-12-23,369.61,367.39,367.57,368.33,362.03,362.03,-378.46,-378.46,-378.46,362.03\n2020-12-24,369.0,367.45,369.0,368.06,362.35859999999997,362.35859999999997,-377.96709999999996,-377.96709999999996,-377.96709999999996,364.0016\n2020-12-28,372.59,371.07,372.17,371.81,362.68062799999996,362.68062799999996,-377.48898699999995,-377.48898699999995,-377.48898699999995,365.736608\n2020-12-29,374.0,370.83,371.46,373.85,362.99621543999996,362.99621543999996,-377.02521738999997,-377.02521738999997,-377.02521738999997,367.26341504\n2020-12-30,373.08,371.58,371.99,372.38,363.3054911312,363.3054911312,-376.5753608683,-376.5753608683,-376.5753608683,368.6070052352\n2020-12-31,374.642,371.24,373.88,371.85,363.608581308576,363.608581308576,-376.139000042251,-376.139000042251,-376.139000042251,369.789364606976\n2021-01-04,375.45,364.83,368.79,375.3,363.9056096824045,363.9056096824045,-375.71573004098343,-375.71573004098343,-375.71573004098343,-386.0292\n2021-01-05,372.48,368.05,371.33,368.05,364.1966974887564,364.1966974887564,-375.45,-375.45,-375.45,-385.393224\n2021-01-06,376.98,369.12,373.55,369.67,364.4819635389813,364.4819635389813,362.03,362.03,362.03,-384.77632728\n2021-01-07,379.89,375.92,379.1,376.18,364.76152426820164,364.76152426820164,362.32899999999995,362.32899999999995,362.32899999999995,-384.1779374616\n2021-01-08,381.49,377.11,381.26,380.63,365.36666329747356,365.36666329747356,362.85582999999997,362.85582999999997,362.85582999999997,-383.59749933775197\n2021-01-11,380.57,377.72,378.69,377.84,366.33406349962513,366.33406349962513,363.60119679999997,363.60119679999997,363.60119679999997,-383.0344743576194\n2021-01-12,379.85,376.36,378.77,378.84,367.2434196896476,367.2434196896476,364.316748928,364.316748928,364.316748928,-382.4883401268908\n2021-01-13,380.86,377.85,379.79,378.65,368.09821450826877,368.09821450826877,365.00367897088,365.00367897088,365.00367897088,-381.9585899230841\n2021-01-14,381.13,378.1,378.46,380.63,368.90172163777265,368.90172163777265,365.6631318120448,365.6631318120448,365.6631318120448,-381.4447322253916\n2021-01-15,377.58,373.72,375.7,376.71,369.6570183395063,369.6570183395063,366.296206539563,366.296206539563,366.296206539563,-381.13\n2021-01-19,379.23,376.78,378.65,378.24,370.3669972391359,370.3669972391359,366.9039582779805,366.9039582779805,366.9039582779805,-381.13\n2021-01-20,384.79,380.69,383.89,381.1,371.03437740478773,371.03437740478773,367.4873999468613,367.4873999468613,367.4873999468613,357.5334\n2021-01-21,384.95,383.25,384.24,384.5,372.13482721240473,372.13482721240473,368.3525299495182,368.3525299495182,368.3525299495182,358.078532\n2021-01-22,384.08,381.84,382.88,382.24,373.41634449116424,373.41634449116424,369.3483781525471,369.3483781525471,369.3483781525471,358.88467604\n2021-01-25,384.77,378.46,384.39,383.6,374.5697100420478,374.5697100420478,370.2844754633943,370.2844754633943,370.2844754633943,359.6666357588\n2021-01-26,385.85,383.55,383.79,385.41,375.60773903784303,375.60773903784303,371.16440693559065,371.16440693559065,371.16440693559065,360.425136686036\n2021-01-27,380.32,372.01,374.41,380.24,385.85,-385.85,-385.85,-385.85,-385.85,361.44213121859457\n2021-01-28,381.93,375.89,377.63,376.27,385.85,-385.85,-385.85,-385.85,-385.85,362.4184459698508\n2021-01-29,376.67,368.27,370.07,375.57,385.57320000000004,-385.57320000000004,-385.4348,-385.4348,-385.4348,363.35570813105676\n2021-02-01,377.34,371.42,376.23,373.84,384.881072,-384.881072,-384.57656,-384.57656,-384.57656,364.2554798058145\n2021-02-02,383.22,379.6,381.55,379.68,384.21662912,-384.21662912,-383.76123199999995,-383.76123199999995,-383.76123199999995,365.1192606135819\n2021-02-03,383.7,380.48,381.85,382.43,368.27,368.27,368.27,368.27,368.27,365.94849018903864\n2021-02-04,386.24,382.78,386.19,383.03,368.5786,368.5786,368.5786,368.5786,368.5786,366.7445505814771\n2021-02-05,388.47,386.485,387.71,388.27,369.285056,369.285056,369.10844199999997,369.10844199999997,369.10844199999997,367.71932305240324\n2021-02-08,390.54,388.36,390.51,389.3,370.43615264,370.43615264,369.88290431999997,369.88290431999997,369.88290431999997,368.96436366925906\n2021-02-09,390.89,389.17,390.25,389.55,372.0444604288,372.0444604288,370.91575910399996,370.91575910399996,370.91575910399996,370.47465821241093\n2021-02-10,392.28,387.51,390.08,392.1,373.92901438591997,373.92901438591997,372.11421355775997,372.11421355775997,372.11421355775997,372.1078855554181\n2021-02-11,391.69,388.12,390.71,391.34,376.1311326596096,376.1311326596096,373.52581860871675,373.52581860871675,373.52581860871675,373.92337585543044\n2021-02-12,392.89,389.77,392.64,389.88,378.06899674045644,378.06899674045644,374.8386113061066,374.8386113061066,374.8386113061066,375.5754720284417\n2021-02-16,394.16,391.54,392.3,394.06,380.14393719679254,380.14393719679254,376.28272240161806,376.28272240161806,376.28272240161806,377.30692482559755\n2021-02-17,392.63,389.33,392.39,390.43,382.3865072453057,382.3865072453057,377.89167738547246,377.89167738547246,377.89167738547246,379.1607630947818\n2021-02-18,391.515,387.74,390.72,389.56,384.27026608605684,384.27026608605684,379.3558264207799,379.3558264207799,379.3558264207799,380.81067915435585\n2021-02-19,392.38,389.55,390.03,392.1,385.8526235122877,385.8526235122877,380.6882020429097,380.6882020429097,380.6882020429097,382.2791044473767\n2021-02-22,389.62,386.74,387.03,387.06,394.16,-394.16,381.9006638590478,381.9006638590478,381.9006638590478,383.5860029581653\n2021-02-23,388.945,380.2,387.5,384.72,394.01160000000004,-394.01160000000004,-394.16,-394.16,-394.16,-402.0432\n2021-02-24,392.23,385.27,391.77,386.23,393.45913600000006,-393.45913600000006,-393.74120000000005,-393.74120000000005,-393.74120000000005,-401.387904\n2021-02-25,391.87,380.7789,382.33,390.51,392.92877056000003,-392.92877056000003,-393.33496400000007,-393.33496400000007,-393.33496400000007,-400.75226688\n2021-02-26,385.58,378.23,380.36,384.44,392.41961973760004,-392.41961973760004,-392.9409150800001,-392.9409150800001,-392.9409150800001,-400.1356988736\n2021-03-01,390.92,385.55,389.58,385.65,391.87,-391.87,-392.2053693260001,-392.2053693260001,-392.2053693260001,-399.04041392992\n2021-03-02,390.07,386.0,386.54,389.87,391.0516,-391.0516,-391.5066008597001,-391.5066008597001,-391.5066008597001,-397.999893233424\n2021-03-03,386.83,381.31,381.42,385.83,390.92,-390.92,-390.92,-390.92,-390.92,-397.0113985717528\n2021-03-04,384.0,371.88,376.7,381.22,390.15860000000004,-390.15860000000004,-390.2855,-390.2855,-390.2855,-396.0723286431652\n2021-03-05,384.76,372.65,383.63,380.41,388.69631200000003,-388.69631200000003,-388.997115,-388.997115,-388.997115,-394.3788656381436\n2021-03-08,387.68,381.42,381.72,384.69,371.88,371.88,-387.79891695000003,-387.79891695000003,-387.79891695000003,-392.80394504347356\n2021-03-09,389.91,385.31,387.17,385.88,372.19599999999997,372.19599999999997,371.88,371.88,371.88,-391.3392688904304\n2021-03-10,391.4,388.1702,389.58,389.59,372.90455999999995,372.90455999999995,372.2406,372.2406,372.2406,364.4424\n2021-03-11,395.65,391.74,393.53,392.24,374.01428639999995,374.01428639999995,372.815382,372.815382,372.815382,364.981552\n2021-03-12,394.21,391.2,394.06,392.09,375.74514348799994,375.74514348799994,373.72876672,373.72876672,373.72876672,365.90160544\n2021-03-15,396.685,392.04,396.41,394.4,377.33753200895995,377.33753200895995,374.6056160512,374.6056160512,374.6056160512,366.7940572768\n2021-03-16,397.83,395.08,395.91,397.06,379.27227880806396,379.27227880806396,375.70958524864,375.70958524864,375.70958524864,367.989694985728\n2021-03-17,398.12,393.3,397.26,394.56,381.4992053510963,381.4992053510963,377.0368101337216,377.0368101337216,377.0368101337216,369.48171023644164\n2021-03-18,396.72,390.865,391.48,394.49,383.82611660194283,383.82611660194283,378.51263342436107,378.51263342436107,378.51263342436107,371.20000762225516\n2021-03-19,391.569,387.15,389.48,389.94,385.82726027767086,385.82726027767086,379.8851490846558,379.8851490846558,379.8851490846558,372.81520716491985\n2021-03-22,394.05,389.98,392.59,390.01,387.15,387.15,381.1615886487299,381.1615886487299,381.1615886487299,374.33349473502466\n2021-03-23,393.46,388.66,389.5,391.89,387.15,387.15,382.3486774433188,382.3486774433188,382.3486774433188,375.7606850509232\n2021-03-24,392.75,387.48,387.52,390.92,398.12,-398.12,383.4526700222865,383.4526700222865,383.4526700222865,377.1022439478678\n2021-03-25,390.55,383.9,389.7,385.99,397.9072,-397.9072,-398.12,-398.12,-398.12,378.36330931099576\n2021-03-26,396.41,390.29,395.98,390.98,397.346912,-397.346912,-397.6934,-397.6934,-397.6934,379.54871075233604\n2021-03-29,396.7499,392.81,395.78,394.35,396.80903551999995,-396.80903551999995,-397.279598,-397.279598,-397.279598,380.6629881071959\n2021-03-30,395.78,393.0299,394.73,394.35,396.7499,-396.7499,-396.87821006,-396.87821006,-396.87821006,381.71040882076414\n2021-03-31,398.0,395.33,396.33,395.35,383.9,383.9,383.9,383.9,383.9,382.6949842915183"
  },
  {
    "path": "Tests/TestData/spy_si.csv",
    "content": "time,open,high,low,close,Volume,SI\n1993-01-29T14:30:00Z,43.9688,43.96899,43.75,43.938,1003200,0\n1993-02-01T14:30:00Z,43.96875,44.25,43.96875,44.25,480500,2.850911854\n1993-02-02T14:30:00Z,44.21875,44.375,44.125,44.34375,201300,0.552591463\n1993-02-03T14:30:00Z,44.40625,44.84375,44.375,44.8125,529400,4.261363636\n1993-02-04T14:30:00Z,44.96875,45.09375,44.875,45,531500,1.5234375\n1993-02-05T14:30:00Z,44.96875,45.0625,44.71875,44.96875,492100,-0.1171875\n1993-02-08T14:30:00Z,44.96875,45.125,44.90625,44.96875,596100,0\n1993-02-09T14:30:00Z,44.8125,44.8125,44.5625,44.65625,122100,-3.022693452\n1993-02-10T14:30:00Z,44.65625,44.75,44.53125,44.71875,379600,0.165719697\n1993-02-11T14:30:00Z,44.78125,45.125,44.78125,44.9375,19500,2.03125\n1993-02-12T14:30:00Z,44.875,44.875,44.59375,44.59375,42500,-2.721354167\n1993-02-16T14:30:00Z,44.46875,44.46875,43.40625,43.46875,374800,-10.52645016\n1993-02-17T14:30:00Z,43.46875,43.53125,43.28125,43.4375,210900,-0.695800781\n1993-02-18T14:30:00Z,43.9375,43.9375,42.8125,43.40625,378100,-1.050646552\n1993-02-19T14:30:00Z,43.40625,43.5625,43.34375,43.5625,34900,0.282118056\n1993-02-22T14:30:00Z,43.6875,43.78125,43.5625,43.71875,513600,1.118607955\n1993-02-23T14:30:00Z,43.84375,43.875,43.46875,43.6875,373700,-0.383254717\n1993-02-24T14:30:00Z,43.71875,44.25,43.71875,44.25,26300,4.734375\n1993-02-25T14:30:00Z,44.21875,44.375,44.125,44.34375,44500,0.589923469\n1993-02-26T14:30:00Z,44.4375,44.4375,44.1875,44.40625,66200,0.271267361\n1993-03-01T14:30:00Z,44.5625,44.5625,44.21875,44.28125,66500,-0.911458333\n1993-03-02T14:30:00Z,44.3125,44.9375,44.25,44.9375,182400,4.862677191\n1993-03-03T14:30:00Z,45,45.15625,44.9375,45.125,280100,1.481119792\n1993-03-04T14:30:00Z,45.1875,45.1875,44.875,44.875,89500,-1.704545455\n1993-03-05T14:30:00Z,44.9375,45.125,44.71875,44.75,40000,-0.95766129\n1993-03-08T14:30:00Z,44.84375,45.75,44.84375,45.75,50800,8.7890625\n1993-03-09T14:30:00Z,45.65625,45.6875,45.5,45.59375,169300,0.137061404\n1993-03-10T14:30:00Z,45.59375,45.6875,45.40625,45.6875,194400,0.493421053\n1993-03-11T14:30:00Z,45.71875,45.84375,45.5,45.5625,70900,-0.573470745\n1993-03-12T14:30:00Z,45.1875,45.21875,44.8125,45.09375,643600,-4.212816456\n1993-03-15T14:30:00Z,45.0625,45.3125,45.0625,45.3125,310800,1.6015625\n1993-03-16T14:30:00Z,45.3125,45.4375,45.3125,45.3125,30800,0.260416667\n1993-03-17T14:30:00Z,45.25,45.25,44.96875,45.03125,21800,-2.685546875\n1993-03-18T14:30:00Z,45.21875,45.5,45.21875,45.3125,59300,1.864346591\n1993-03-19T14:30:00Z,45.28125,45.28125,45.03125,45.03125,66900,-2.327913851\n1993-03-22T14:30:00Z,44.59375,44.875,44.5625,44.78125,183400,-1.414331897\n1993-03-23T14:30:00Z,44.90625,44.9375,44.8125,44.875,55200,0.651041667\n1993-03-24T14:30:00Z,44.8125,45.0625,44.59375,44.875,37200,0.086449795\n1993-03-25T14:30:00Z,44.90625,45.25,44.84375,45.15625,110100,2.34375\n1993-03-26T14:30:00Z,45.125,45.15625,44.875,44.90625,101500,-1.518110795\n1993-03-29T14:30:00Z,44.9375,45.3125,44.9375,45.09375,87100,1.202713816\n1993-03-30T14:30:00Z,45.15625,45.21875,45.09375,45.21875,56000,0.930059524\n1993-03-31T14:30:00Z,45.34375,45.46875,45.1875,45.1875,111600,-0.493421053\n1993-04-01T14:30:00Z,45.25,45.25,44.9375,45.03125,129500,-1.354166667\n1993-04-02T14:30:00Z,44.65625,44.65625,44.09375,44.09375,59400,-9.272603155\n1993-04-05T13:30:00Z,44.4375,44.4375,44.1875,44.3125,172200,0.076729911\n1993-04-06T13:30:00Z,44.40625,44.40625,44.0625,44.1875,129700,-1.106770833\n1993-04-07T13:30:00Z,44.25,44.34375,44.15625,44.34375,28000,0.598538306\n1993-04-08T13:30:00Z,44.53125,44.53125,44.09375,44.28125,180800,-0.556144068\n1993-04-12T13:30:00Z,44.71875,44.9375,44.65625,44.90625,348500,5.066636029\n1993-04-13T13:30:00Z,44.875,45.15625,44.84375,45,146100,0.883152174\n1993-04-14T13:30:00Z,45.03125,45.0625,44.90625,44.9375,119600,-0.244140625\n1993-04-15T13:30:00Z,44.90625,45.03125,44.75,44.9375,148600,-0.030048077\n1993-04-16T13:30:00Z,44.96875,45.03125,44.875,44.9375,47900,-0.027901786\n1993-04-19T13:30:00Z,44.9375,45.0625,44.71875,44.75,157000,-1.124131944\n1993-04-20T13:30:00Z,44.6875,44.75,44.25,44.53125,279500,-1.964285714\n1993-04-21T13:30:00Z,44.625,44.625,44.375,44.5,67900,-0.448690878\n1993-04-22T13:30:00Z,44.3125,44.6875,43.9375,43.9375,97700,-3.515625\n1993-04-23T13:30:00Z,43.84375,43.96875,43.6875,43.75,106000,-1.3671875\n1993-04-26T13:30:00Z,43.78125,43.9375,43.28125,43.40625,62600,-2.390894397\n1993-04-27T13:30:00Z,43.34375,43.875,43.34375,43.875,156800,3.002929688\n1993-04-28T13:30:00Z,43.8125,43.90625,43.71875,43.78125,85900,0.071455793\n1993-04-29T13:30:00Z,43.875,43.96875,43.625,43.96875,85000,0.755208333\n1993-04-30T13:30:00Z,44.125,44.28125,44.03125,44.03125,88500,0.250400641\n1993-05-03T13:30:00Z,44.09375,44.3125,43.90625,44.3125,80500,1.502130682\n1993-05-04T13:30:00Z,44.40625,44.625,44.34375,44.46875,149100,1.345486111\n1993-05-05T13:30:00Z,44.46875,44.75,44.46875,44.59375,109000,1.202713816\n1993-05-06T13:30:00Z,44.53125,44.5625,44.40625,44.4375,54700,-0.991586538\n1993-05-07T13:30:00Z,44.46875,44.46875,44.28125,44.34375,68000,-0.831886574\n1993-05-10T13:30:00Z,44.40625,44.6875,44.40625,44.4375,113900,0.48828125\n1993-05-11T13:30:00Z,44.4375,44.625,44.3125,44.625,42600,1.057545732\n1993-05-12T13:30:00Z,44.4375,44.59375,44.4375,44.5625,31000,0.251116071\n1993-05-13T13:30:00Z,44.375,44.375,44,44.03125,129100,-4.724121094\n1993-05-14T13:30:00Z,44.03125,44.15625,43.96875,44,63500,-0.379464286\n1993-05-17T13:30:00Z,44.125,44.15625,43.9375,44.15625,34000,0.707165948\n1993-05-18T13:30:00Z,44.1875,44.21875,43.96875,44.125,105200,-0.248579545\n1993-05-19T13:30:00Z,44.125,45.03125,43.84375,45.03125,50200,6.326095779\n1993-05-20T13:30:00Z,45.03125,45.15625,44.9375,45.15625,98200,0.726425439\n1993-05-21T13:30:00Z,45.1875,45.25,44.71875,44.75,221400,-2.886284722\n1993-05-24T13:30:00Z,44.84375,45.09375,44.84375,44.9375,30500,0.661057692\n1993-05-25T13:30:00Z,45.125,45.125,45.03125,45.03125,191800,0.502232143\n1993-05-26T13:30:00Z,45.15625,45.625,45.125,45.59375,102400,4.930971747\n1993-05-27T13:30:00Z,45.65625,45.65625,45.375,45.4375,53800,-0.546875\n1993-05-28T13:30:00Z,45.40625,45.40625,45,45.21875,79100,-2.106813525\n1993-06-01T13:30:00Z,45.375,45.8125,45.3125,45.65625,28300,3.3203125\n1993-06-02T13:30:00Z,45.53125,45.75,45.34375,45.59375,20300,0.160092213\n1993-06-03T13:30:00Z,45.5,45.5,45.34375,45.4375,21600,-1.227678571\n1993-06-04T13:30:00Z,45.3125,45.3125,45.09375,45.28125,32000,-1.356907895\n1993-06-07T13:30:00Z,45.375,45.375,45.125,45.125,121400,-1.094933712\n1993-06-08T13:30:00Z,45,45,44.71875,44.71875,104500,-3.80859375\n1993-06-09T13:30:00Z,44.875,45.0625,44.8125,44.875,43300,0.502825798\n1993-06-10T13:30:00Z,44.84375,44.9375,44.75,44.90625,17900,0.260416667\n1993-06-11T13:30:00Z,45.0625,45.15625,44.90625,45.09375,647400,1.286764706\n1993-06-14T13:30:00Z,45.15625,45.1875,45.03125,45.03125,64200,-0.418526786\n1993-06-15T13:30:00Z,45.09375,45.125,44.9375,44.9375,142400,-0.544084821\n1993-06-16T13:30:00Z,44.9375,45.03125,44.8125,45.03125,330900,0.307765152\n1993-06-17T13:30:00Z,45.125,45.1875,45.03125,45.1875,37400,1.146399457\n1993-06-18T13:30:00Z,44.84375,44.84375,44.5,44.5,58500,-6.824448529\n1993-06-21T13:30:00Z,44.625,44.625,44.53125,44.59375,29300,-0.03125\n1993-06-22T13:30:00Z,44.65625,44.65625,44.5625,44.625,137500,0.030048077\n1993-06-23T13:30:00Z,44.625,44.625,44.21875,44.21875,227600,-3.78464033\n1993-06-24T13:30:00Z,44.34375,44.8125,44.34375,44.8125,243700,4.260706019\n1993-06-25T13:30:00Z,44.78125,44.90625,44.75,44.78125,44800,0.184151786\n1993-06-28T13:30:00Z,45,45.28125,44.9375,45.28125,439900,4.74537037\n1993-06-29T13:30:00Z,45.21875,45.21875,45,45.0625,207500,-1.243330793\n1993-06-30T13:30:00Z,45.125,45.21875,45,45.0625,437600,-0.266335227\n1993-07-01T13:30:00Z,45.125,45.125,44.875,44.9375,605700,-1.034007353\n1993-07-02T13:30:00Z,44.78125,44.8125,44.53125,44.6875,285400,-2.234375\n1993-07-06T13:30:00Z,44.625,44.75,44.15625,44.21875,246400,-3.740605222\n1993-07-07T13:30:00Z,44.1875,44.40625,44.1875,44.34375,343700,0.371570122\n1993-07-08T13:30:00Z,44.375,44.9375,44.3125,44.84375,248200,4.322150735\n1993-07-09T13:30:00Z,44.84375,44.96875,44.75,44.96875,378200,0.708575581\n1993-07-12T13:30:00Z,44.90625,44.96875,44.84375,44.9375,373700,0.078125\n1993-07-13T13:30:00Z,44.96875,45.09375,44.65625,44.90625,389600,-0.215871711\n1993-07-14T13:30:00Z,44.9375,45.1875,44.90625,45.0625,617300,1.202713816\n1993-07-15T13:30:00Z,45.03125,45.03125,44.78125,44.875,443800,-1.387746711\n1993-07-16T13:30:00Z,44.90625,44.9375,44.6875,44.75,216400,-0.981841216\n1993-07-19T13:30:00Z,44.75,44.75,44.59375,44.71875,188200,-0.4296875\n1993-07-20T13:30:00Z,44.6875,44.84375,44.46875,44.84375,68500,0.797193878\n1993-07-21T13:30:00Z,44.78125,44.8125,44.65625,44.8125,142700,0.130208333\n1993-07-22T13:30:00Z,44.75,44.8125,44.5,44.5,632400,-2.620045732\n1993-07-23T13:30:00Z,44.59375,44.71875,44.5625,44.71875,286200,1.196289063\n1993-07-26T13:30:00Z,44.84375,45.0625,44.84375,44.96875,121300,2.36328125\n1993-07-27T13:30:00Z,45,45.03125,44.78125,44.9375,92800,-0.130208333\n1993-07-28T13:30:00Z,44.84375,44.9375,44.78125,44.84375,30800,-0.621448864\n1993-07-29T13:30:00Z,44.9375,45.21875,44.875,45.09375,331000,2.139945652\n1993-07-30T13:30:00Z,45.09375,45.09375,44.78125,44.84375,75300,-1.866319444\n1993-08-02T13:30:00Z,44.90625,45.125,44.90625,44.96875,41300,0.52734375\n1993-08-03T13:30:00Z,45.0625,45.1875,44.84375,45,81600,0.059442935\n1993-08-04T13:30:00Z,45,45.09375,44.875,45,434000,-0.052083333\n1993-08-05T13:30:00Z,45,45,44.84375,44.90625,36800,-0.87890625\n1993-08-06T13:30:00Z,45.03125,45.0625,44.90625,44.96875,402300,0.042459239\n1993-08-09T13:30:00Z,45.09375,45.34375,45,45.21875,828200,1.85546875\n1993-08-10T13:30:00Z,45.1875,45.21875,45.125,45.1875,604900,0\n1993-08-11T13:30:00Z,45.15625,45.3125,45.15625,45.1875,542200,0.078125\n1993-08-12T13:30:00Z,45.3125,45.3125,44.90625,45.0625,303700,-1.028154481\n1993-08-13T13:30:00Z,45.09375,45.15625,45.09375,45.125,103500,0.065104167\n1993-08-16T13:30:00Z,45.15625,45.5,45.15625,45.375,241800,2.34375\n1993-08-17T13:30:00Z,45.34375,45.53125,45.34375,45.53125,369300,1.228578629\n1993-08-18T13:30:00Z,45.6875,45.875,45.65625,45.78125,414300,2.250744048\n1993-08-19T13:30:00Z,45.8125,45.8125,45.71875,45.78125,28500,0.026041667\n1993-08-20T13:30:00Z,45.6875,45.8125,45.65625,45.8125,80700,0.40922619\n1993-08-23T13:30:00Z,45.625,45.75,45.625,45.71875,15600,-0.09765625\n1993-08-24T13:30:00Z,45.71875,46.21875,45.71875,46.21875,273400,4.617537313\n1993-08-25T13:30:00Z,46.21875,46.4375,46.15625,46.25,242300,0.578425481\n1993-08-26T13:30:00Z,46.28125,46.53125,46.09375,46.28125,120000,0.154194079\n1993-08-27T13:30:00Z,46.15625,46.25,46.15625,46.25,25700,0.111607143\n1993-08-30T13:30:00Z,46.28125,46.5,46.28125,46.4375,183500,1.751893939\n1993-08-31T13:30:00Z,46.40625,46.5625,46.34375,46.5625,66500,0.733901515\n1993-09-01T13:30:00Z,46.40625,46.59375,46.40625,46.5,136500,0.101023707\n1993-09-02T13:30:00Z,46.53125,46.59375,46.3125,46.34375,472400,-0.871394231\n1993-09-03T13:30:00Z,46.3125,46.4375,46.25,46.375,630500,0.0390625\n1993-09-07T13:30:00Z,46.375,46.4375,46,46.0625,196400,-2.34375\n1993-09-08T13:30:00Z,46.0625,46.0625,45.59375,45.90625,269900,-1.674107143\n1993-09-09T13:30:00Z,45.71875,46.03125,45.71875,46,239200,0.651041667\n1993-09-10T13:30:00Z,46.125,46.4375,46.0625,46.40625,106500,3.541239754\n1993-09-13T13:30:00Z,46.5625,46.5625,46.4375,46.4375,66900,0.180844907\n1993-09-14T13:30:00Z,46.3125,46.3125,46.09375,46.25,184500,-1.71875\n1993-09-15T13:30:00Z,46.0625,46.40625,45.90625,46.375,101000,1.106770833\n1993-09-16T13:30:00Z,46.3125,46.34375,46.15625,46.28125,54300,-0.151909722\n1993-09-17T13:30:00Z,45.875,45.90625,45.75,45.8125,200900,-4.796006944\n1993-09-20T13:30:00Z,45.875,45.96875,45.4375,45.4375,57800,-2.611607143\n1993-09-21T13:30:00Z,45.5,45.5625,44.8125,45.28125,318200,-1.704545455\n1993-09-22T13:30:00Z,45.4375,45.71875,45.375,45.65625,439700,2.638432018\n1993-09-23T13:30:00Z,45.78125,45.9375,45.71875,45.90625,88500,2.118389423\n1993-09-24T13:30:00Z,45.84375,45.875,45.71875,45.78125,53500,-0.721153846\n1993-09-27T13:30:00Z,46.125,46.28125,46.125,46.28125,274600,5.113636364\n1993-09-28T13:30:00Z,46.3125,46.3125,46.15625,46.1875,158300,-0.46875\n1993-09-29T13:30:00Z,46.1875,46.3125,45.96875,46.03125,221000,-0.968424479\n1993-09-30T13:30:00Z,46.03125,46.125,45.84375,45.9375,99300,-0.657393293\n1993-10-01T13:30:00Z,45.875,46.21875,45.8125,46.15625,22700,1.374289773\n1993-10-04T13:30:00Z,46.21875,46.21875,46.09375,46.21875,1038500,0.265625\n1993-10-05T13:30:00Z,46.3125,46.3125,46,46.15625,436500,-0.615234375\n1993-10-06T13:30:00Z,46.1875,46.375,46.125,46.125,209200,-0.480363176\n1993-10-07T13:30:00Z,46.1875,46.1875,45.96875,46,59400,-0.9765625\n1993-10-08T13:30:00Z,46.125,46.15625,45.71875,46.0625,54400,-0.056703629\n1993-10-11T13:30:00Z,46.15625,46.25,46.15625,46.15625,467100,0.5859375\n1993-10-12T13:30:00Z,46.21875,46.25,46.1875,46.21875,26200,0.46875\n1993-10-13T13:30:00Z,46.25,46.25,46.15625,46.21875,139100,-0.065104167\n1993-10-14T13:30:00Z,46.40625,46.8125,46.28125,46.8125,108100,5.134310788\n1993-10-15T13:30:00Z,47.03125,47.15625,46.90625,47.0625,1502500,1.979932598\n1993-10-18T13:30:00Z,47.03125,47.03125,46.875,46.9375,722400,-1.069972826\n1993-10-19T13:30:00Z,46.875,46.96875,46.59375,46.59375,880100,-2.738204657\n1993-10-20T13:30:00Z,46.75,46.75,46.5625,46.65625,230400,-0.207149621\n1993-10-21T13:30:00Z,46.6875,46.6875,46.53125,46.59375,56200,-0.577445652\n1993-10-22T13:30:00Z,46.65625,46.84375,46.375,46.375,390700,-1.215277778\n1993-10-25T13:30:00Z,46.40625,46.5625,46.28125,46.5,114500,0.338541667\n1993-10-26T13:30:00Z,46.46875,46.5,46.3125,46.46875,186200,-0.043402778\n1993-10-27T13:30:00Z,46.40625,46.53125,46.40625,46.5,118400,0.244140625\n1993-10-28T13:30:00Z,46.5625,46.96875,46.5625,46.84375,129600,3.227621822\n1993-10-29T13:30:00Z,46.8125,46.875,46.78125,46.84375,80700,0.204613095\n1993-11-01T14:30:00Z,46.78125,47,46.78125,46.96875,36400,0.9765625\n1993-11-02T14:30:00Z,46.90625,47,46.65625,46.9375,262100,0.15625\n1993-11-03T14:30:00Z,46.90625,46.90625,46.125,46.34375,479100,-5.472542476\n1993-11-04T14:30:00Z,46.34375,46.34375,45.8125,45.84375,130400,-4.401344477\n1993-11-05T14:30:00Z,45.71875,46.0625,45.53125,46.0625,363200,0.790550595\n1993-11-08T14:30:00Z,46.09375,46.25,45.96875,46.125,367600,0.523603723\n1993-11-09T14:30:00Z,46.4375,46.46875,46.125,46.15625,246900,-0.620659722\n1993-11-10T14:30:00Z,46.15625,46.5,46.03125,46.5,46500,1.774796196\n1993-11-11T14:30:00Z,46.5,46.625,46.34375,46.375,88900,-0.270113032\n1993-11-12T14:30:00Z,46.46875,46.75,46.4375,46.59375,108200,1.5625\n1993-11-15T14:30:00Z,46.6875,46.6875,46.4375,46.5625,243300,-0.217013889\n1993-11-16T14:30:00Z,46.65625,46.8125,46.46875,46.78125,492600,1.041666667\n1993-11-17T14:30:00Z,46.8125,46.8125,46.40625,46.53125,39600,-1.925223214\n1993-11-18T14:30:00Z,46.46875,46.5625,46.28125,46.40625,240800,-1.006944444\n1993-11-19T14:30:00Z,46.25,46.375,46.21875,46.3125,106000,-0.48828125\n1993-11-22T14:30:00Z,46.1875,46.21875,45.875,46.03125,165300,-2.313701923\n1993-11-23T14:30:00Z,46.28125,46.3125,46.03125,46.28125,89700,1.157583841\n1993-11-24T14:30:00Z,46.40625,46.5,46.34375,46.46875,77200,1.595052083\n1993-11-26T14:30:00Z,46.59375,46.59375,46.46875,46.5,1019800,0\n1993-11-29T14:30:00Z,46.625,46.71875,46.3125,46.3125,517500,-1.168323864\n1993-11-30T14:30:00Z,46.28125,46.5625,46.25,46.34375,230000,-0.0625\n1993-12-01T14:30:00Z,46.59375,46.625,46.40625,46.40625,379200,-0.103400735\n1993-12-02T14:30:00Z,46.5,46.5625,46.40625,46.53125,352000,0.450721154\n1993-12-03T14:30:00Z,46.5,46.71875,46.5,46.71875,306000,1.575969828\n1993-12-06T14:30:00Z,46.78125,46.9375,46.78125,46.875,99500,1.455393145\n1993-12-07T14:30:00Z,46.875,46.90625,46.78125,46.84375,88800,-0.092516447\n1993-12-08T14:30:00Z,46.84375,46.84375,46.78125,46.84375,146700,-0.043402778\n1993-12-09T14:30:00Z,46.84375,46.90625,46.625,46.6875,416500,-1.139322917\n1993-12-10T14:30:00Z,46.71875,46.71875,46.5,46.59375,412900,-0.887784091\n1993-12-13T14:30:00Z,46.59375,46.875,46.53125,46.875,273200,1.831054688\n1993-12-14T14:30:00Z,46.90625,46.90625,46.53125,46.53125,41900,-2.223821272\n1993-12-15T14:30:00Z,46.59375,46.625,46.46875,46.46875,82600,-0.512695313\n1993-12-16T14:30:00Z,46.65625,46.65625,46.5625,46.625,78200,0.745738636\n1993-12-17T14:30:00Z,46.40625,46.59375,46.375,46.5625,104700,0.050403226\n1993-12-20T14:30:00Z,46.53125,46.65625,46.5,46.625,68800,0.4453125\n1993-12-21T14:30:00Z,46.5625,46.5625,46.40625,46.46875,205700,-1.164641204\n1993-12-22T14:30:00Z,46.59375,46.8125,46.5,46.78125,410300,2.339409722\n1993-12-23T14:30:00Z,46.75,46.84375,46.6875,46.75,533800,0.045072115\n1993-12-27T14:30:00Z,46.75,47,46.75,47,447100,2.34375\n1993-12-28T14:30:00Z,46.96875,47.125,46.9375,47.09375,880600,0.68359375\n1993-12-29T14:30:00Z,47.125,47.15625,47,47.03125,266700,-0.244140625\n1993-12-30T14:30:00Z,47,47,46.75,46.84375,219900,-1.7578125\n1993-12-31T14:30:00Z,46.9375,47,46.5625,46.59375,312900,-1.700179303\n1994-01-03T14:30:00Z,46.59375,46.65625,46.40625,46.46875,960900,-0.953851744\n1994-01-04T14:30:00Z,46.53125,46.65625,46.46875,46.65625,164300,1.171875\n1994-01-05T14:30:00Z,46.71875,46.78125,46.53125,46.75,710900,0.390625\n1994-01-06T14:30:00Z,46.8125,46.84375,46.6875,46.75,201000,-0.083705357\n1994-01-07T14:30:00Z,46.84375,47.0625,46.71875,47.03125,775500,1.953125\n1994-01-10T14:30:00Z,47.09375,47.59375,46.96875,47.59375,593700,4.496729651\n1994-01-11T14:30:00Z,47.5625,47.5625,47.34375,47.5,295200,0\n1994-01-12T14:30:00Z,47.53125,47.53125,47.1875,47.34375,158400,-1.44361413\n1994-01-13T14:30:00Z,47.21875,47.3125,47.15625,47.21875,244300,-0.920758929\n1994-01-14T14:30:00Z,47.375,47.5,47.375,47.40625,137200,1.7578125\n1994-01-17T14:30:00Z,47.40625,47.46875,47.3125,47.40625,17700,0.027901786\n1994-01-18T14:30:00Z,47.46875,47.53125,47.375,47.46875,166400,0.3125\n1994-01-19T14:30:00Z,47.40625,47.46875,47.25,47.34375,200800,-0.9765625\n1994-01-20T14:30:00Z,47.40625,47.5,47.375,47.46875,281100,0.87890625\n1994-01-21T14:30:00Z,47.53125,47.53125,47.34375,47.375,85600,-0.600961538\n1994-01-24T14:30:00Z,47.34375,47.5625,47.1875,47.1875,373800,-0.862323113\n1994-01-25T14:30:00Z,47.21875,47.25,47.09375,47.1875,310400,-0.1640625\n1994-01-26T14:30:00Z,47.1875,47.34375,47.125,47.3125,145100,0.774515086\n1994-01-27T14:30:00Z,47.40625,47.8125,47.34375,47.75,344500,3.882575758\n1994-01-28T14:30:00Z,47.9375,48.03125,47.875,47.875,356500,1.036658654\n1994-01-31T14:30:00Z,48.0625,48.3125,48,48.21875,313800,2.84375\n1994-02-01T14:30:00Z,48.15625,48.15625,47.90625,47.96875,303600,-1.85785061\n1994-02-02T14:30:00Z,48.125,48.28125,48.09375,48.28125,307600,2.261513158\n1994-02-03T14:30:00Z,48.1875,48.1875,47.90625,48.0625,466100,-1.54587766\n1994-02-04T14:30:00Z,48.0625,48.125,46.96875,46.96875,1403200,-9.624280428\n1994-02-07T14:30:00Z,46.84375,47.3125,46.84375,47.1875,516400,0.339226974\n1994-02-08T14:30:00Z,47.28125,47.28125,47.03125,47.21875,188200,0.249818314\n1994-02-09T14:30:00Z,47.25,47.4375,47.1875,47.40625,144600,1.286764706\n1994-02-10T14:30:00Z,47.375,47.40625,47,47,883900,-3.162691886\n1994-02-11T14:30:00Z,47.03125,47.28125,46.8125,47.15625,519400,0.390625\n1994-02-14T14:30:00Z,47.0625,47.375,47,47.21875,2742100,0.578425481\n1994-02-15T14:30:00Z,47.3125,47.5,47.25,47.46875,374700,2.118389423\n1994-02-16T14:30:00Z,47.53125,47.53125,47.34375,47.4375,287600,-0.134698276\n1994-02-17T14:30:00Z,47.65625,47.6875,47.03125,47.15625,342400,-2.072108477\n1994-02-18T14:30:00Z,47.1875,47.21875,46.75,46.875,313300,-2.405427632\n1994-02-22T14:30:00Z,47,47.34375,47,47.34375,154500,3.402217742\n1994-02-23T14:30:00Z,47.40625,47.4375,47.0625,47.21875,391700,-0.506488347\n1994-02-24T14:30:00Z,47.0625,47.0625,46.5625,46.59375,770800,-5.947265625\n1994-02-25T14:30:00Z,46.65625,46.8125,46.5625,46.8125,531300,0.669049202\n1994-02-28T14:30:00Z,46.9375,47.0625,46.8125,46.8125,333000,-0.126689189\n1994-03-01T14:30:00Z,46.8125,46.90625,46.375,46.625,423600,-1.519097222\n1994-03-02T14:30:00Z,46.0625,46.6875,45.9375,46.6875,581500,1.769301471\n1994-03-03T14:30:00Z,46.625,46.625,46.4375,46.5625,223200,0\n1994-03-04T14:30:00Z,46.5625,46.8125,46.40625,46.6875,595800,0.636574074\n1994-03-07T14:30:00Z,46.875,47,46.875,46.9375,539800,2.44140625\n1994-03-08T14:30:00Z,46.96875,46.96875,46.6875,46.75,880300,-1.480263158\n1994-03-09T14:30:00Z,46.8125,47,46.59375,46.96875,2500100,0.820974576\n1994-03-10T14:30:00Z,46.96875,46.96875,46.46875,46.59375,207400,-3.03442029\n1994-03-11T14:30:00Z,46.6875,46.90625,46.4375,46.84375,576600,0.813802083\n1994-03-14T14:30:00Z,47.03125,47.03125,46.84375,46.90625,345900,0.202047414\n1994-03-15T14:30:00Z,47.03125,47.125,46.84375,46.875,748600,-0.615234375\n1994-03-16T14:30:00Z,46.96875,47.25,46.8125,47.25,455500,2.34375\n1994-03-17T14:30:00Z,47.09375,47.3125,47.09375,47.25,133000,0.501478041\n1994-03-18T14:30:00Z,46.75,47.03125,46.71875,46.96875,365500,-0.956700212\n1994-03-21T14:30:00Z,46.8125,46.9375,46.71875,46.84375,324800,-0.295608108\n1994-03-22T14:30:00Z,46.84375,47.0625,46.75,46.96875,435700,0.833650915\n1994-03-23T14:30:00Z,46.9375,47.0625,46.90625,46.9375,698500,0\n1994-03-24T14:30:00Z,46.75,46.84375,46.15625,46.375,1200500,-4.986702128\n1994-03-25T14:30:00Z,46.40625,46.53125,45.9375,45.9375,100900,-3.045099432\n1994-03-28T14:30:00Z,46,46.0625,45.59375,46,1117200,-0.200520833\n1994-03-29T14:30:00Z,46,46.03125,45.09375,45.09375,338400,-8.212890625\n1994-03-30T14:30:00Z,45.125,45.25,44.46875,44.46875,1123900,-4.572432171\n1994-03-31T14:30:00Z,44.46875,44.6875,43.53125,44.59375,788800,0.104012574\n1994-04-04T13:30:00Z,43.34375,44.03125,43.34375,43.90625,2627300,-2.9296875\n1994-04-05T13:30:00Z,44.34375,44.8125,44.34375,44.8125,1179000,8.763266509\n1994-04-06T13:30:00Z,44.875,44.90625,44.5,44.8125,516500,0.320662313\n1994-04-07T13:30:00Z,44.78125,45.125,44.53125,45.03125,666100,1.051682692\n1994-04-08T13:30:00Z,44.9375,44.9375,44.46875,44.6875,242400,-2.470439189\n1994-04-11T13:30:00Z,44.8125,45.0625,44.70312,44.875,203300,0.852267769\n1994-04-12T13:30:00Z,44.92187,45,44.71875,44.8125,1409200,-0.334078947\n1994-04-13T13:30:00Z,44.79687,44.90625,44.25,44.578,364100,-1.909430634\n1994-04-14T13:30:00Z,44.5,44.82812,44.40625,44.59375,419900,0.025937313\n1994-04-15T13:30:00Z,44.57812,44.78125,44.51562,44.59375,387300,0.126697133\n1994-04-18T13:30:00Z,44.64062,44.76562,44.15625,44.29687,369100,-2.072581144\n1994-04-19T13:30:00Z,44.25,44.53125,43.98437,44.35937,472200,0.096442139\n1994-04-20T13:30:00Z,44.40625,44.51562,44.07812,44.3125,508000,-0.251102566\n1994-04-21T13:30:00Z,44.5,44.96875,44.34375,44.90625,200300,4.777113971\n1994-04-22T13:30:00Z,45.01562,45.04687,44.73437,44.85937,301800,-0.060819576\n1994-04-25T13:30:00Z,44.84375,45.35937,44.84375,45.32812,394600,3.785231303\n1994-04-26T13:30:00Z,45.26562,45.34375,45.1875,45.28125,399000,0.259969921\n1994-04-28T13:30:00Z,45.1875,45.25,44.8125,44.95312,287000,-2.829559569\n1994-04-29T13:30:00Z,44.875,45.15625,44.8125,45.09375,481900,0.603976583\n1994-05-02T13:30:00Z,45.09375,45.71875,44.9375,45.375,275000,2.22692757\n1994-05-03T13:30:00Z,45.39062,45.40625,45.0625,45.32812,183400,-0.036875\n1994-05-04T13:30:00Z,45.42187,45.42187,45.07812,45.25,401900,-0.781217391\n1994-05-05T13:30:00Z,45.29687,45.375,45.1875,45.1875,659800,-0.542892775\n1994-05-06T13:30:00Z,44.96875,44.96875,44.59375,44.75,216300,-4.164182882\n1994-05-09T13:30:00Z,44.625,44.75,44.28125,44.35937,499300,-3.235816231\n1994-05-10T13:30:00Z,44.57812,44.84375,44.54687,44.70312,583400,2.251085936\n1994-05-11T13:30:00Z,44.65625,44.71875,44.17187,44.29687,210600,-3.185692043\n1994-05-12T13:30:00Z,44.57812,44.625,44.40625,44.51562,305200,0.551280936\n1994-05-13T13:30:00Z,44.64062,44.64062,44.29687,44.51562,321300,-0.297214674\n1994-05-16T13:30:00Z,44.60937,44.75,44.51562,44.53125,450400,-0.301544874\n1994-05-17T13:30:00Z,44.5625,45.1875,44.5,45.1875,470200,5.506534597\n1994-05-18T13:30:00Z,45.21875,45.6875,45.01562,45.51562,824800,2.387928979\n1994-05-19T13:30:00Z,45.42187,45.85937,45.42187,45.73437,531000,1.886032279\n1994-05-20T13:30:00Z,45.65625,45.6875,45.5,45.5625,370400,-0.712592312\n1994-05-23T13:30:00Z,45.51562,45.53125,45.34375,45.48437,262700,-0.707196121\n1994-05-24T13:30:00Z,45.60937,45.84375,45.60937,45.67187,549600,1.554984098\n1994-05-25T13:30:00Z,45.5,45.82812,45.34375,45.79687,738200,1.185591446\n1994-05-26T13:30:00Z,45.78125,45.9375,45.73437,45.82812,369600,0.408502839\n1994-05-27T13:30:00Z,45.75,45.875,45.67187,45.875,162000,0.550433574\n1994-05-31T13:30:00Z,45.73437,45.90625,45.65625,45.8125,160000,0.037989583\n1994-06-01T13:30:00Z,45.70312,46.01562,45.5625,46.01562,200500,1.252580186\n1994-06-02T13:30:00Z,46.04687,46.04687,45.89062,45.96875,55100,-0.026016667\n1994-06-03T13:30:00Z,46,46.39062,45.85937,46.23437,550400,1.739065782\n1994-06-06T13:30:00Z,46.32812,46.46875,46.1875,46.21875,99300,-0.050486177\n1994-06-07T13:30:00Z,46.14062,46.21875,46.03125,46.15625,120600,-0.44742533\n1994-06-08T13:30:00Z,46.26562,46.26562,45.78125,45.78125,131900,-2.943754608\n1994-06-09T13:30:00Z,45.98437,46.03125,45.89062,46.03125,80500,0.752330361\n1994-06-10T13:30:00Z,46.07812,46.20312,46.07812,46.10937,83100,0.707372138\n1994-06-13T13:30:00Z,46.04687,46.1875,46.03125,46.17187,109700,0.395300595\n1994-06-14T13:30:00Z,46.3125,46.54687,46.3125,46.53125,161000,3.488432937\n1994-06-15T13:30:00Z,46.54687,46.5625,46.3125,46.34375,142800,-1.051671474\n1994-06-16T13:30:00Z,46.34375,46.46875,46.29687,46.4375,44000,0.315240305\n1994-06-17T13:30:00Z,46.15625,46.20312,45.8125,45.875,403800,-4.997725725\n1994-06-20T13:30:00Z,45.54687,45.625,45.4375,45.48437,137400,-3.515660714\n1994-06-21T13:30:00Z,45.45312,45.45312,44.90625,45.09375,139200,-3.6620625\n1994-06-22T13:30:00Z,45.21875,45.42187,45.17187,45.26562,279900,0.570799142\n1994-06-23T13:30:00Z,45.34375,45.40625,44.9375,45,922500,-1.817320023\n1994-06-24T13:30:00Z,44.78125,44.78125,44,44.0625,353800,-8.85\n1994-06-27T13:30:00Z,44.23437,44.82812,44.01562,44.82812,371200,4.257606791\n1994-06-28T13:30:00Z,44.84375,44.84375,44.25,44.60937,5382301,-0.912833224\n1994-06-29T13:30:00Z,44.67187,45.01562,44.625,44.75,311800,0.672779618\n1994-06-30T13:30:00Z,44.82812,44.84375,44.3125,44.46875,271900,-2.191354956\n1994-07-01T13:30:00Z,44.6875,44.6875,44.375,44.5625,406900,-0.199101347\n1994-07-05T13:30:00Z,44.65625,44.85937,44.51562,44.79687,112000,1.352886068\n1994-07-06T13:30:00Z,44.625,44.8125,44.46875,44.73437,174800,0.14797246\n1994-07-07T13:30:00Z,44.73437,44.92187,44.6875,44.92187,66700,1.381790461\n1994-07-08T13:30:00Z,44.64062,44.98437,44.625,44.90625,148400,0.749354775\n1994-07-11T13:30:00Z,44.9375,45.01562,44.53125,44.75,124000,-0.78125\n1994-07-12T13:30:00Z,44.76562,44.82812,44.51562,44.8125,257300,0.159235734\n1994-07-13T13:30:00Z,44.82812,45.03125,44.82812,44.89062,532700,0.743522565\n1994-07-14T13:30:00Z,45.10937,45.46875,45.07812,45.375,494200,4.573107101\n1994-07-15T13:30:00Z,45.34375,45.48437,45.32812,45.39062,49100,0.323771758\n1994-07-18T13:30:00Z,45.39062,45.57812,45.39062,45.46875,72300,0.758313582\n1994-07-19T13:30:00Z,45.54687,45.5625,45.375,45.375,609500,-0.453259056\n1994-07-20T13:30:00Z,45.40625,45.40625,45.0625,45.17187,185300,-1.834791284\n1994-07-21T13:30:00Z,45.17187,45.29687,45.07812,45.26562,86300,0.231069381\n1994-07-22T13:30:00Z,45.375,45.40625,45.25,45.34375,151600,0.42038587\n1994-07-25T13:30:00Z,45.35937,45.45312,45.3125,45.40625,120900,0.359793369\n1994-07-26T13:30:00Z,45.39062,45.42187,45.3125,45.35937,489600,-0.245741481\n1994-07-27T13:30:00Z,45.35937,45.35937,45.17187,45.35937,83200,-0.046875\n1994-07-28T13:30:00Z,45.35937,45.57812,45.35937,45.45312,828200,0.87890625\n1994-07-29T13:30:00Z,45.76562,46.04687,45.75,45.90625,459100,4.329509549\n1994-08-01T13:30:00Z,45.9375,46.15625,45.89062,46.125,486300,1.80597546\n1994-08-02T13:30:00Z,46.28125,46.375,46.03125,46.1875,505500,0.25\n1994-08-03T13:30:00Z,46.17187,46.23437,46.09375,46.20312,144100,0.027884778\n1994-08-04T13:30:00Z,46.17187,46.21875,45.92187,45.9375,231700,-2.163382768\n1994-08-05T13:30:00Z,45.70312,45.84375,45.65625,45.78125,138400,-1.0546695\n1994-08-08T13:30:00Z,45.82812,45.9375,45.78125,45.89062,328600,0.889729784\n1994-08-09T13:30:00Z,45.71875,45.96875,45.71875,45.96875,105900,0.88464522\n1994-08-10T13:30:00Z,46,46.1875,45.9375,46.14062,840300,1.332975\n1994-08-11T13:30:00Z,46.03125,46.23437,45.73437,45.96875,876200,-0.796916095\n1994-08-12T13:30:00Z,46.04687,46.34375,46.04687,46.32812,184100,3.229110371\n1994-08-15T13:30:00Z,46.375,46.48437,46.3125,46.3125,325900,0.094528161\n1994-08-16T13:30:00Z,46.34375,46.6875,46.15625,46.64062,1089500,1.975414286\n1994-08-17T13:30:00Z,46.70312,46.73437,46.57812,46.60937,133700,-0.009934376\n1994-08-18T13:30:00Z,46.45312,46.5625,46.40625,46.45312,620000,-1.123033053\n1994-08-19T13:30:00Z,46.46875,46.51562,46.3125,46.42187,103200,-0.236636834\n1994-08-22T13:30:00Z,46.4375,46.4375,46.28125,46.375,79700,-0.470072811\n1994-08-23T13:30:00Z,46.57812,46.85937,46.51562,46.64062,268600,1.981489938\n1994-08-24T13:30:00Z,46.6875,47.14062,46.67187,47.14062,254700,4.63865625\n1994-08-25T13:30:00Z,47.09375,47.20312,46.89062,47.01562,147400,-0.18636752\n1994-08-26T13:30:00Z,47.125,47.78125,47.125,47.6875,339500,6.115821043\n1994-08-29T13:30:00Z,47.8125,47.98437,47.64062,47.65625,350300,0.119705645\n1994-08-30T13:30:00Z,47.64062,47.85937,47.57812,47.78125,36000,0.619278201\n1994-08-31T13:30:00Z,47.70312,47.89062,47.59375,47.65625,356200,-0.399807457\n1994-09-01T13:30:00Z,47.5,47.53125,47.32812,47.5,294600,-1.242015337\n1994-09-02T13:30:00Z,47.71875,47.71875,47.21875,47.29687,99600,-1.455714844\n1994-09-06T13:30:00Z,47.26562,47.35937,47.125,47.3125,229800,-0.209881268\n1994-09-07T13:30:00Z,47.42187,47.42187,47.21875,47.26562,27900,-0.360442086\n1994-09-08T13:30:00Z,47.35937,47.5625,47.34375,47.5,284800,1.660217106\n1994-09-09T13:30:00Z,47.03125,47.125,46.8125,47,488400,-3.857759237\n1994-09-12T13:30:00Z,47,47.0625,46.78125,46.85937,129400,-1.034663851\n1994-09-13T13:30:00Z,46.95312,47.125,46.85937,47,389200,0.711528641\n1994-09-14T13:30:00Z,46.84375,47.10937,46.84375,47.04687,423500,0.563916075\n1994-09-15T13:30:00Z,47.17187,47.64062,47.17187,47.64062,779800,5.603768746\n1994-09-16T13:30:00Z,47,47.14062,46.84375,47.01562,571300,-3.750023456\n1994-09-19T13:30:00Z,47.125,47.32812,47.01562,47.0625,167300,0.120586896\n1994-09-20T13:30:00Z,46.8125,46.85937,46.17187,46.17187,355600,-8.484789477\n1994-09-21T13:30:00Z,46.3125,46.3125,45.73437,46.17187,397500,-0.853594626\n1994-09-22T13:30:00Z,46.28125,46.28125,46.01562,46.0625,266400,-0.824341637\n1994-09-23T13:30:00Z,46.07812,46.17187,45.82812,45.90625,176600,-1.091466299\n1994-09-26T13:30:00Z,46.07812,46.17187,45.98437,46.14062,223000,1.371403592\n1994-09-27T13:30:00Z,46.14062,46.26562,46,46.10937,479500,-0.097654514\n1994-09-28T13:30:00Z,46.35937,46.53125,46.32812,46.46875,324000,3.344180268\n1994-09-29T13:30:00Z,46.46875,46.46875,46.09375,46.23437,195900,-1.888683453\n1994-09-30T13:30:00Z,46.21875,46.4375,46.17187,46.17187,5200,-0.565953322\n1994-10-03T13:30:00Z,46.20312,46.25,45.98437,46.0625,72600,-0.80871417\n1994-10-04T13:30:00Z,46.29687,46.29687,45.34375,45.375,84200,-5.379988569\n1994-10-05T13:30:00Z,45.29687,45.39062,45,45.39062,461900,-0.633864869\n1994-10-06T13:30:00Z,45.42187,45.45312,45.17187,45.25,345200,-0.911424679\n1994-10-07T13:30:00Z,45.25,45.57812,45.20312,45.45312,188700,1.284087661\n1994-10-10T13:30:00Z,45.65625,46.01562,45.64062,45.9375,213600,4.572992206\n1994-10-11T13:30:00Z,46.14062,46.75,46.14062,46.625,461400,6.49999545\n1994-10-12T13:30:00Z,46.6875,46.75,46.57812,46.6875,162400,0.489576222\n1994-10-13T13:30:00Z,47.21875,47.32812,46.79687,46.84375,1564500,-0.213540911\n1994-10-14T13:30:00Z,47,47.0625,46.6875,47.04687,72800,0.387347917\n1994-10-17T13:30:00Z,47,47.0625,46.90625,46.95312,282300,-0.551875473\n1994-10-18T13:30:00Z,46.90625,46.90625,46.6875,46.84375,132100,-0.996055385\n1994-10-19T13:30:00Z,46.67187,47.23437,46.65625,47.0625,136700,1.638315194\n1994-10-20T13:30:00Z,47.0625,47.0625,46.60937,46.75,290300,-1.908099137\n1994-10-21T13:30:00Z,46.625,46.6875,46.35937,46.5625,87800,-1.656670799\n1994-10-24T13:30:00Z,46.57812,46.76562,46.15625,46.17187,149600,-2.475626055\n1994-10-25T13:30:00Z,46.01562,46.3125,46,46.21875,91800,0.121625589\n1994-10-26T13:30:00Z,46.39062,46.4375,46.17187,46.39062,201000,0.9620597\n1994-10-27T13:30:00Z,46.5625,46.67187,46.45312,46.67187,210300,2.362042969\n1994-10-28T13:30:00Z,46.76562,47.70312,46.76562,47.65625,192100,9.2822967\n1994-10-31T14:30:00Z,47.54687,47.59375,47.46875,47.48437,36300,0.060394131\n1994-11-01T14:30:00Z,47.28125,47.28125,46.9375,46.95312,435200,-5.271781241\n1994-11-02T14:30:00Z,46.8125,47.23437,46.6875,46.6875,115600,-1.146395811\n1994-11-03T14:30:00Z,46.84375,47.01562,46.78125,46.9375,87000,1.743165391\n1994-11-04T14:30:00Z,47.15625,47.15625,46.32812,46.32812,124400,-4.472521045\n1994-11-07T14:30:00Z,46.3125,46.59375,46.3125,46.46875,115000,0.039857148\n1994-11-08T14:30:00Z,46.625,46.98437,46.54687,46.82812,308300,3.124937974\n1994-11-09T14:30:00Z,47.32812,47.32812,46.5,46.90625,318500,-0.291646518\n1994-11-10T14:30:00Z,46.9375,47.03125,46.54687,46.57812,172100,-2.335383953\n1994-11-11T14:30:00Z,46.51562,46.5625,46.28125,46.40625,302200,-1.54936046\n1994-11-14T14:30:00Z,46.60937,46.85937,46.60937,46.84375,181400,3.941510336\n1994-11-15T14:30:00Z,46.79687,47.09375,46.32812,46.6875,316900,-0.595643439\n1994-11-16T14:30:00Z,46.76562,46.84375,46.60937,46.84375,106900,0.626754079\n1994-11-17T14:30:00Z,46.875,46.875,46.34375,46.53125,104700,-2.63739827\n1994-11-18T14:30:00Z,46.54687,46.625,46.26562,46.46875,269300,-0.699009147\n1994-11-21T14:30:00Z,46.4375,46.57812,46,46,283100,-3.465869578\n1994-11-22T14:30:00Z,45.82812,46,45,45,483600,-8.582732394\n1994-11-23T14:30:00Z,45.03125,45.26562,44.60937,45.25,601600,0.430846071\n1994-11-25T14:30:00Z,45.28125,45.53125,45.28125,45.46875,77300,2.015053354\n1994-11-28T14:30:00Z,45.45312,45.6875,45.34375,45.67187,79900,1.257795\n1994-11-29T14:30:00Z,45.65625,45.75,45.5,45.65625,105500,0.137733974\n1994-11-30T14:30:00Z,45.89062,45.95312,45.59375,45.59375,218800,-1.089063386\n1994-12-01T14:30:00Z,45.64062,45.64062,45.04687,45.14062,439000,-3.977699147\n1994-12-02T14:30:00Z,45.04687,45.5625,45.04687,45.5625,318500,2.283052684\n1994-12-05T14:30:00Z,45.65625,45.8125,45.5,45.60937,139200,0.539246261\n1994-12-06T14:30:00Z,45.4375,45.65625,45.35937,45.64062,249900,0.613101507\n1994-12-07T14:30:00Z,45.35937,45.5,45.26562,45.3125,531900,-1.983124895\n1994-12-08T14:30:00Z,45.5,45.5625,44.75,44.875,261500,-3.249036918\n1994-12-09T14:30:00Z,44.875,45.07812,44.6875,45.04687,235900,0.235749031\n1994-12-12T14:30:00Z,44.95312,45.34375,44.95312,45.34375,151100,2.290128561\n1994-12-13T14:30:00Z,45.3125,45.53125,45.3125,45.51562,70900,1.374392718\n1994-12-14T14:30:00Z,45.45312,45.95312,45.45312,45.75,203300,2.152628999\n1994-12-15T14:30:00Z,45.8125,46.03125,45.8125,45.89062,130100,1.376560958\n1994-12-16T14:30:00Z,45.67187,45.84375,45.625,45.75,266100,-0.520305497\n1994-12-19T14:30:00Z,45.75,45.84375,45.60937,45.8125,1120200,0.392136021\n1994-12-20T14:30:00Z,45.85937,45.89062,45.67187,45.67187,675600,-0.820360417\n1994-12-21T14:30:00Z,45.70312,46.26562,45.70312,46.15625,544500,3.942915625\n1994-12-22T14:30:00Z,46.15625,46.20312,45.96875,46.01562,222000,-0.329202989\n1994-12-23T14:30:00Z,45.98437,46.17187,45.98437,46.0625,125800,0.222750942\n1994-12-27T14:30:00Z,46.21875,46.40625,46.1875,46.3125,95200,2.260044179\n1994-12-28T14:30:00Z,46.35937,46.35937,45.96875,46.07812,358200,-1.824193019\n1994-12-29T14:30:00Z,46.25,46.25,46.0625,46.10937,220100,-0.455752841\n1994-12-30T14:30:00Z,46.20312,46.25,45.5625,45.5625,2209500,-4.267766098\n1995-01-03T14:30:00Z,45.70312,45.84375,45.6875,45.78125,324300,0.45306335\n1995-01-04T14:30:00Z,45.98437,46,45.75,46,351800,1.248314863\n1995-01-05T14:30:00Z,46.03125,46.10937,45.95312,46,89800,-0.050011043\n1995-01-06T14:30:00Z,46.09375,46.25,45.90625,46.04687,448400,0.069411111\n1995-01-09T14:30:00Z,46.03125,46.09375,46,46.09375,36800,0.184489713\n1995-01-10T14:30:00Z,46.20312,46.39062,46.14062,46.14062,229800,0.200557478\n1995-01-11T14:30:00Z,46.29687,46.29687,45.8125,46.17187,222400,-0.192259735\n1995-01-12T14:30:00Z,46.125,46.21875,46.03125,46.1875,40300,0.062796874\n1995-01-13T14:30:00Z,46.4375,46.73437,46.375,46.73437,170600,5.183872483\n1995-01-16T14:30:00Z,46.71875,47.03125,46.71875,47.01562,105100,2.41776255\n1995-01-17T14:30:00Z,46.92187,47.0625,46.85937,47.03125,89500,0.508927978\n1995-01-18T14:30:00Z,47,47.07812,46.875,46.98437,84500,-0.115891716\n1995-01-19T14:30:00Z,46.82812,46.875,46.6875,46.71875,139100,-2.444430572\n1995-01-20T14:30:00Z,46.65625,46.67187,46.45312,46.54687,78700,-1.56397599\n1995-01-23T14:30:00Z,46.23437,46.6875,46.20312,46.6875,53700,1.426833718\n1995-01-24T14:30:00Z,46.67187,46.75,46.64062,46.75,32400,0.376914859\n1995-01-25T14:30:00Z,46.51562,47.04687,46.51562,46.875,15700,1.092218044\n1995-01-26T14:30:00Z,46.84375,46.98437,46.75,46.92187,9800,0.423559116\n1995-01-27T14:30:00Z,47.23437,47.23437,46.92187,47.10937,91200,0.850179671\n1995-01-30T14:30:00Z,47.01562,47.04687,46.84375,46.90625,26600,-1.80659375\n1995-01-31T14:30:00Z,47,47.17187,46.92187,47.09375,127500,1.205319361\n1995-02-01T14:30:00Z,47.15625,47.32812,47,47.07812,380200,-0.130238657\n1995-02-02T14:30:00Z,47.0625,47.35937,47.0625,47.35937,131700,2.278652006\n1995-02-03T14:30:00Z,47.65625,48.10937,47.57812,48.03125,405100,6.121961525\n1995-02-06T14:30:00Z,48.01562,48.375,47.96875,48.23437,405400,1.745583984\n1995-02-07T14:30:00Z,48.3125,48.3125,48.14062,48.29687,702900,0.282853672\n1995-02-08T14:30:00Z,48.23437,48.46875,48.20312,48.29687,521500,0.108974375\n1995-02-09T14:30:00Z,48.21875,48.29687,48.125,48.29687,390700,0.31329872\n1995-02-10T14:30:00Z,48.23437,48.35937,48.09375,48.35937,148300,0.643453744\n1995-02-13T14:30:00Z,48.32812,48.46875,48.32812,48.375,79700,0.279686467\n1995-02-14T14:30:00Z,48.53125,48.53125,48.25,48.4375,170200,0.091149611\n1995-02-15T14:30:00Z,48.4375,48.76562,48.39062,48.70312,431500,1.930079045\n1995-02-16T14:30:00Z,48.64062,48.6875,48.5,48.64062,99300,0.018941969\n1995-02-17T14:30:00Z,48.59375,48.625,48.4375,48.45312,49100,-1.6757777\n1995-02-21T14:30:00Z,48.45312,48.53125,48.42187,48.4375,168000,-0.197934851\n1995-02-22T14:30:00Z,48.48437,48.79687,48.45312,48.79687,386400,3.233353135\n1995-02-23T14:30:00Z,48.98437,49.15625,48.85937,48.875,402800,0.561565805\n1995-02-24T14:30:00Z,48.9375,49.01562,48.8125,49,307600,0.491592251\n1995-02-27T14:30:00Z,48.85937,49,48.53125,48.60937,280900,-3.02422379\n1995-02-28T14:30:00Z,48.5625,49.01562,48.5625,49.01562,493500,2.80837193\n1995-03-01T14:30:00Z,48.96875,49.03125,48.65625,48.70312,237900,-1.52734366\n1995-03-02T14:30:00Z,48.6875,48.76562,48.54687,48.76562,488600,0.120384746\n1995-03-03T14:30:00Z,48.60937,48.78125,48.48437,48.78125,290000,0.672769804\n1995-03-06T14:30:00Z,48.45312,48.8125,48.39062,48.8125,85700,1.333560064\n1995-03-07T14:30:00Z,48.64062,48.75,48.21875,48.4375,180900,-2.199871533\n1995-03-08T14:30:00Z,48.51562,48.625,48.34375,48.5625,155900,0.344683651\n1995-03-09T14:30:00Z,48.54687,48.59375,48.42187,48.54687,63500,-0.018718113\n1995-03-10T14:30:00Z,48.59375,49.39062,48.53125,49.26562,192100,6.471968337\n1995-03-13T14:30:00Z,49.23437,49.39062,49.17187,49.21875,261300,0.228864376\n1995-03-14T14:30:00Z,49.35937,49.64062,49.35937,49.57812,223300,3.44798452\n1995-03-15T14:30:00Z,49.5,49.57812,49.29687,49.48437,278500,-0.245289244\n1995-03-16T14:30:00Z,49.4375,49.8125,49.4375,49.78125,20400,2.515957229\n1995-03-17T14:30:00Z,49.4375,49.625,49.40625,49.5625,89900,-0.430484694\n1995-03-20T14:30:00Z,49.625,49.625,49.46875,49.5625,91700,0\n1995-03-21T14:30:00Z,49.5625,49.875,49.35937,49.4375,104400,-0.74677606\n1995-03-22T14:30:00Z,49.53125,49.53125,49.32812,49.48437,74900,-0.022808889\n1995-03-23T14:30:00Z,49.42187,49.65625,49.35937,49.51562,220500,0.231158688\n1995-03-24T14:30:00Z,49.67187,50.21875,49.67187,50.21875,134000,6.777155198\n1995-03-27T14:30:00Z,50.29687,50.42187,50.17187,50.42187,132100,1.32077635\n1995-03-28T14:30:00Z,50.29687,50.42187,50.23437,50.42187,121900,0.502232143\n1995-03-29T14:30:00Z,50.375,50.89062,50.125,50.40625,246100,0.114908809\n1995-03-30T14:30:00Z,50.51562,50.51562,50.10937,50.3125,298400,-0.840215212\n1995-03-31T14:30:00Z,49.92187,50.17187,49.54687,50.10937,541300,-1.027209176\n1995-04-03T13:30:00Z,50.09375,50.23437,50.0625,50.23437,193300,0.864966199\n1995-04-04T13:30:00Z,50.25,50.5625,50.25,50.5625,66900,2.997352441\n1995-04-05T13:30:00Z,50.45312,50.60937,50.42187,50.5625,107200,0.439477022\n1995-04-06T13:30:00Z,50.6875,50.79687,50.59375,50.75,352500,1.464842262\n1995-04-07T13:30:00Z,50.85937,50.85937,50.46875,50.70312,361400,-0.473284671\n1995-04-10T13:30:00Z,50.625,50.79687,50.59375,50.79687,285400,0.396908396\n1995-04-11T13:30:00Z,50.92187,50.9375,50.59375,50.625,250300,-0.910431921\n1995-04-12T13:30:00Z,50.78125,50.79687,50.60937,50.79687,144400,0.432857945\n1995-04-13T13:30:00Z,50.89062,51.09375,50.85937,51.07812,243400,2.608411626\n1995-04-17T13:30:00Z,51.26562,51.3125,50.625,50.78125,178900,-1.898013631\n1995-04-18T13:30:00Z,50.82812,50.82812,50.48437,50.60937,329500,-1.606040296\n1995-04-19T13:30:00Z,50.60937,50.71875,50.29687,50.5625,223000,-0.51225897\n1995-04-20T13:30:00Z,50.70312,50.78125,50.4375,50.64062,207900,0.135202399\n1995-04-21T13:30:00Z,50.65625,50.90625,50.65625,50.89062,145000,2.134492092\n1995-04-24T13:30:00Z,50.85937,51.48437,50.85937,51.48437,169000,5.237726006\n1995-04-25T13:30:00Z,51.40625,51.48437,51.3125,51.34375,293200,-0.051136196\n1995-04-26T13:30:00Z,51.25,51.42187,51.125,51.39062,204400,0.444310234\n1995-04-27T13:30:00Z,51.3125,51.54687,51.28125,51.51562,502200,0.849741683\n1995-04-28T13:30:00Z,51.5,51.67187,51.17187,51.59375,130800,0.685687726\n1995-05-01T13:30:00Z,51.54687,51.65625,51.45312,51.45312,518700,-0.636477334\n1995-05-02T13:30:00Z,51.5,51.64062,51.39062,51.5625,228400,0.502253571\n1995-05-03T13:30:00Z,51.73437,52.28125,51.73437,52.28125,724700,6.981823986\n1995-05-04T13:30:00Z,52.34375,52.6875,52.125,52.25,311400,0.212774759\n1995-05-05T13:30:00Z,52.46875,52.46875,52.07812,52.1875,314900,-0.748074693\n1995-05-08T13:30:00Z,52.14062,52.73437,52.09375,52.5625,183100,2.478973135\n1995-05-09T13:30:00Z,52.78125,52.84375,52.4375,52.51562,180600,-0.254970751\n1995-05-10T13:30:00Z,52.65625,52.67187,52.32812,52.57812,330300,-0.122778197\n1995-05-11T13:30:00Z,52.65625,52.71875,52.48437,52.71875,351700,0.5273625\n1995-05-12T13:30:00Z,52.51562,52.875,52.5,52.75,94600,0.5742275\n1995-05-15T13:30:00Z,52.89062,53,52.78125,53,147200,1.937511733\n1995-05-16T13:30:00Z,52.98437,53.15625,52.89062,53.03125,221600,0.273444167\n1995-05-17T13:30:00Z,53.03125,53.04687,52.78125,52.82812,189200,-1.650585698\n1995-05-18T13:30:00Z,52.73437,52.76562,52.0625,52.0625,577800,-7.022940104\n1995-05-19T13:30:00Z,51.98437,52.1875,51.90625,52.09375,363900,-0.178321148\n1995-05-22T13:30:00Z,52.26562,52.75,52.23437,52.67187,216000,5.40773445\n1995-05-23T13:30:00Z,52.76562,53.15625,52.60937,53.15625,136800,3.64744665\n1995-05-24T13:30:00Z,53.25,53.42187,52.79687,53.125,370800,0.01214508\n1995-05-25T13:30:00Z,52.96875,53.21875,52.71875,53.17187,379900,0.560051471\n1995-05-26T13:30:00Z,52.96875,52.98437,52.35937,52.5625,518600,-5.02655385\n1995-05-30T13:30:00Z,52.6875,52.82812,52.375,52.54687,61500,-0.56119652\n1995-05-31T13:30:00Z,52.57812,53.64062,52.45312,53.64062,564500,8.888886679\n1995-06-01T13:30:00Z,53.40625,53.90625,53.25,53.5,810100,0.455184852\n1995-06-02T13:30:00Z,53.28125,53.92187,53.09375,53.54687,112900,0.628915104\n1995-06-05T13:30:00Z,53.54687,54.04687,53.5,53.875,257200,2.846398435\n1995-06-06T13:30:00Z,53.82812,54.01562,53.78125,53.78125,165800,-0.097643519\n1995-06-07T13:30:00Z,53.67187,53.70312,53.4375,53.5,41900,-2.572825246\n1995-06-08T13:30:00Z,53.48437,53.64062,53.375,53.375,141100,-0.634127163\n1995-06-09T13:30:00Z,53.26562,53.32812,52.75,53.0625,304900,-2.741646782\n1995-06-12T13:30:00Z,53.23437,53.57812,53.20312,53.35937,378500,2.004615793\n1995-06-13T13:30:00Z,53.60937,53.96875,53.5625,53.9375,120000,5.46457656\n1995-06-14T13:30:00Z,53.85937,53.95312,53.6875,53.89062,389400,0.228215945\n1995-06-15T13:30:00Z,53.96875,54.23437,53.875,54.125,274500,1.87422366\n1995-06-16T13:30:00Z,53.70312,53.96875,53.70312,53.96875,325100,0.107638263\n1995-06-19T13:30:00Z,54.125,54.60937,54.09375,54.57812,134600,5.605418788\n1995-06-20T13:30:00Z,54.42187,54.60937,54.39062,54.4375,287800,-0.068912024\n1995-06-21T13:30:00Z,54.60937,54.65625,54.40625,54.40625,158200,-0.694086968\n1995-06-22T13:30:00Z,54.64062,55.15625,54.64062,55.125,297000,6.241085731\n1995-06-23T13:30:00Z,55,55.03125,54.84375,55.01562,315400,0.096551858\n1995-06-26T13:30:00Z,54.85937,54.95312,54.35937,54.35937,132900,-5.884870392\n1995-06-27T13:30:00Z,54.34375,54.70312,54.21875,54.25,127700,-0.991577046\n1995-06-28T13:30:00Z,54.25,54.75,54.07812,54.53125,212600,1.79071746\n1995-06-29T13:30:00Z,54.53125,54.67187,54.0625,54.4375,89200,-0.30307335\n1995-06-30T13:30:00Z,54.54687,54.73437,54.29687,54.40625,714100,-0.503159428\n1995-07-03T13:30:00Z,54.46875,54.60937,54.46875,54.60937,9500,1.461128427\n1995-07-05T13:30:00Z,54.76562,55.0625,54.64062,54.8125,409300,1.568191846\n1995-07-06T13:30:00Z,54.82812,55.51562,54.71875,55.51562,202500,5.753192292\n1995-07-07T13:30:00Z,55.40625,55.78125,55.375,55.76562,481700,1.727485219\n1995-07-10T13:30:00Z,55.8125,55.95312,55.70312,55.79687,400400,0.390613506\n1995-07-11T13:30:00Z,55.75,55.79687,55.45312,55.53125,420500,-2.341523884\n1995-07-12T13:30:00Z,55.64062,56.3125,55.53125,56.21875,203400,5.384798481\n1995-07-13T13:30:00Z,56.14062,56.26562,56.03125,56.09375,215600,-0.012069707\n1995-07-14T13:30:00Z,55.79687,56.09375,55.75,56.04687,543700,0.401335202\n1995-07-17T13:30:00Z,56.125,56.42187,56.07812,56.35937,171500,2.734361111\n1995-07-18T13:30:00Z,56.26562,56.26562,55.82812,55.875,221200,-3.79802583\n1995-07-19T13:30:00Z,55.65625,55.71875,54.20312,55.26562,486600,-5.5745684\n1995-07-20T13:30:00Z,55.32812,55.57812,55.03125,55.46875,318900,0.532692493\n1995-07-21T13:30:00Z,55.42187,55.625,55.1875,55.40625,94000,-0.130732092\n1995-07-24T13:30:00Z,55.48437,55.875,55.48437,55.8125,108400,3.827083562\n1995-07-25T13:30:00Z,55.875,56.3125,55.70312,56.23437,107400,3.089633088\n1995-07-26T13:30:00Z,56.20312,56.46875,56.17187,56.1875,167800,0.133192838\n1995-07-27T13:30:00Z,56.45312,56.70312,56.45312,56.65625,187700,4.720083333\n1995-07-28T13:30:00Z,56.70312,56.70312,56.25,56.29687,415600,-2.578465894\n1995-07-31T13:30:00Z,56.34375,56.39062,56.03125,56.15625,342500,-1.209916727\n1995-08-01T13:30:00Z,56.23437,56.23437,55.75,56.0625,141000,-1.082833721\n1995-08-02T13:30:00Z,56.39062,56.79687,55.84375,55.9375,240400,-1.817919863\n1995-08-03T13:30:00Z,55.54687,55.95312,55.45312,55.92187,1193600,0.289221728\n1995-08-04T13:30:00Z,56.03125,56.07812,55.92187,55.98437,240500,0.518789063\n1995-08-07T13:30:00Z,56.10937,56.28125,56.07812,56.10937,193100,0.803098825\n1995-08-08T13:30:00Z,56.14062,56.3125,55.9375,56.10937,951900,-0.052898437\n1995-08-09T13:30:00Z,56.29687,56.29687,56.04687,56.09375,107100,-0.568147727\n1995-08-10T13:30:00Z,56.15625,56.28125,55.73437,55.96875,280800,-1.01294728\n1995-08-11T13:30:00Z,55.92187,55.98437,55.42187,55.65625,257200,-2.760678285\n1995-08-14T13:30:00Z,55.79687,56.15625,55.67187,56.15625,254800,3.430957357\n1995-08-15T13:30:00Z,56.14062,56.14062,55.65625,56.04687,44400,-0.356564524\n1995-08-16T13:30:00Z,56,56.20312,55.9375,56.20312,374900,0.791812683\n1995-08-17T13:30:00Z,56.23437,56.23437,55.90625,56.10937,353800,-0.516476625\n1995-08-18T13:30:00Z,56.39062,56.40625,56.125,56.17187,85400,-0.452557443\n1995-08-21T13:30:00Z,56.40625,56.64062,56,56.01562,266700,-1.711750371\n1995-08-22T13:30:00Z,56.09375,56.21875,55.8125,56.125,220200,0.068900265\n1995-08-23T13:30:00Z,56.17187,56.20312,55.92187,55.92187,176500,-1.40683446\n1995-08-24T13:30:00Z,55.9375,56.09375,55.75,55.98437,167400,0.061969351\n1995-08-25T13:30:00Z,56.07812,56.39062,56.07812,56.29687,195000,2.966695519\n1995-08-28T13:30:00Z,56.45312,56.45312,56,56.09375,293000,-1.198882478\n1995-08-29T13:30:00Z,56.15625,56.25,55.76562,56.23437,1133100,0.320851008\n1995-08-30T13:30:00Z,56.28125,56.42187,56.21875,56.35937,437400,0.966290282\n1995-08-31T13:30:00Z,56.34375,56.5,56.29687,56.40625,491900,0.385507214\n1995-09-01T13:30:00Z,56.39062,56.75,56.34375,56.65625,629900,2.029092593\n1995-09-05T13:30:00Z,56.82812,57.21875,56.73437,57.1875,272200,4.633167564\n1995-09-06T13:30:00Z,57.23437,57.35937,57.21875,57.29687,214500,1.00598408\n1995-09-07T13:30:00Z,57.35937,57.39062,57.25,57.32812,258800,0.11719125\n1995-09-08T13:30:00Z,57.54687,57.54687,57.17187,57.54687,107300,0.753348214\n1995-09-11T13:30:00Z,57.64062,57.8125,57.64062,57.70312,260700,1.422985332\n1995-09-12T13:30:00Z,57.71875,57.96875,57.57812,57.96875,139500,1.6601875\n1995-09-13T13:30:00Z,57.90625,58.3125,57.89062,58.23437,239800,2.183033917\n1995-09-14T13:30:00Z,58.4375,58.8125,58.28125,58.76562,457600,4.411314767\n1995-09-15T13:30:00Z,58.40625,58.57812,58.20312,58.4375,431200,-1.47105653\n1995-09-18T13:30:00Z,58.23437,58.26562,57.9375,58.21875,307500,-1.620361454\n1995-09-19T13:30:00Z,58.32812,58.53125,58.125,58.5,549600,1.729933844\n1995-09-20T13:30:00Z,58.59375,58.78125,58.54687,58.78125,290800,2.442651364\n1995-09-21T13:30:00Z,58.70312,58.75,58.0625,58.29687,508500,-3.837106771\n1995-09-22T13:30:00Z,57.82812,58.375,57.78125,58.3125,449900,0.724220154\n1995-09-25T13:30:00Z,58.375,58.375,58.01562,58.21875,130000,-0.196102378\n1995-09-26T13:30:00Z,58.39062,58.53125,58.0625,58.20312,466600,-0.570932692\n1995-09-27T13:30:00Z,57.95312,58.1875,57.59375,58.15625,654400,0.045930523\n1995-09-28T13:30:00Z,58.20312,58.59375,58.15625,58.59375,456200,3.8281362\n1995-09-29T13:30:00Z,58.54687,58.90625,58.40625,58.48437,606600,-0.140432713\n1995-10-02T13:30:00Z,58.48437,58.625,58.04687,58.1875,293100,-2.122686072\n1995-10-03T13:30:00Z,58.1875,58.34375,57.95312,58.25,839700,0.061552812\n1995-10-04T13:30:00Z,58.28125,58.28125,58.10937,58.1875,248800,-0.439457031\n1995-10-05T13:30:00Z,58.25,58.35937,58.09375,58.35937,268800,0.754819645\n1995-10-06T13:30:00Z,58.39062,58.57812,58.39062,58.40625,75300,0.486665775\n1995-10-09T13:30:00Z,58.1875,58.21875,57.8125,57.92187,358200,-4.51644713\n1995-10-10T13:30:00Z,57.32812,57.89062,57.26562,57.89062,360800,1.065037482\n1995-10-11T13:30:00Z,58.09375,58.09375,57.875,58.07812,228100,1.131557744\n1995-10-12T13:30:00Z,58.125,58.46875,58.125,58.4375,199800,3.366604467\n1995-10-13T13:30:00Z,58.70312,58.85937,58.625,58.625,488100,1.470494661\n1995-10-16T13:30:00Z,58.45312,58.5625,58.34375,58.34375,443600,-2.318260751\n1995-10-17T13:30:00Z,58.40625,58.79687,58.29687,58.73437,146000,2.831973148\n1995-10-18T13:30:00Z,59.01562,59.09375,58.71875,58.90625,228100,0.979113522\n1995-10-19T13:30:00Z,58.875,59.1875,58.79687,59.1875,500600,1.724945972\n1995-10-20T13:30:00Z,59.14062,59.1875,58.82812,58.82812,748400,-2.246125\n1995-10-23T13:30:00Z,58.54687,58.8125,58.54687,58.70312,533000,-0.624995556\n1995-10-24T13:30:00Z,58.78125,58.84375,58.625,58.76562,172200,0.319605113\n1995-10-25T13:30:00Z,58.8125,58.89062,58.28125,58.28125,302700,-3.721477573\n1995-10-26T13:30:00Z,58.375,58.42187,57.28125,57.75,606800,-4.792963604\n1995-10-27T13:30:00Z,57.6875,58.1875,57.42187,58.1875,905800,1.575732979\n1995-10-30T14:30:00Z,58.32812,58.59375,58.32812,58.5625,488700,3.399756984\n1995-10-31T14:30:00Z,58.71875,58.84375,58.3125,58.3125,508200,-1.175749164\n1995-11-01T14:30:00Z,58.28125,58.78125,58.23437,58.78125,415700,2.788476239\n1995-11-02T14:30:00Z,58.6875,59.15625,58.6875,59.15625,326000,2.898848684\n1995-11-03T14:30:00Z,59.23437,59.25,59.0625,59.23437,615000,0.375591346\n1995-11-06T14:30:00Z,59.21875,59.21875,59.01562,59.03125,311200,-1.924134603\n1995-11-07T14:30:00Z,59,59,58.625,58.8125,358200,-2.085658482\n1995-11-08T14:30:00Z,58.89062,59.375,58.89062,59.34375,357200,4.382487638\n1995-11-09T14:30:00Z,59.57812,59.57812,59.28125,59.5625,503700,1.157923384\n1995-11-10T14:30:00Z,59.23437,59.60937,59.21875,59.53125,795600,0.616908288\n1995-11-13T14:30:00Z,59.42187,59.65625,59.3125,59.46875,818500,0.115009002\n1995-11-14T14:30:00Z,59.35937,59.48437,59.07812,59.07812,341800,-3.034696824\n1995-11-15T14:30:00Z,59.14062,59.6875,59.10937,59.67187,584700,4.525508573\n1995-11-16T14:30:00Z,59.67187,60.0625,59.65625,60,577700,2.830686142\n1995-11-17T14:30:00Z,60.09375,60.20312,60.01562,60.1875,267000,1.448315066\n1995-11-20T14:30:00Z,60.28125,60.29687,59.85937,59.875,448800,-2.189850636\n1995-11-21T14:30:00Z,59.9375,60.35937,59.92187,60.35937,119200,3.195470366\n1995-11-22T14:30:00Z,60.3125,60.375,60.17187,60.17187,351600,-0.57852778\n1995-11-24T14:30:00Z,60.23437,60.32812,60.1875,60.32812,62400,0.893450232\n1995-11-27T14:30:00Z,60.45312,60.64062,60.34375,60.34375,273000,-0.092962018\n1995-11-28T14:30:00Z,60.29687,60.98437,60.15625,60.98437,479000,4.479236064\n1995-11-29T14:30:00Z,61.09375,61.09375,60.84375,61.04687,549200,0.439432292\n1995-11-30T14:30:00Z,61.04687,61.20312,60.84375,60.90625,286200,-0.761686316\n1995-12-01T14:30:00Z,60.98437,61.07812,60.84375,60.98437,465200,0.171236308\n1995-12-04T14:30:00Z,61.125,61.73437,61.04687,61.73437,631700,6.878380435\n1995-12-05T14:30:00Z,61.67187,62.20312,61.625,62.14062,567700,3.180378148\n1995-12-06T14:30:00Z,62.29687,62.53125,62,62.28125,272800,0.941305347\n1995-12-07T14:30:00Z,62.20312,62.28125,61.90625,61.95312,289700,-2.827029945\n1995-12-08T14:30:00Z,62.21875,62.23437,61.76562,62.15625,296900,0.361919118\n1995-12-11T14:30:00Z,62.28125,62.54687,62.15625,62.42187,186500,1.924908908\n1995-12-12T14:30:00Z,62.14062,62.35937,62.14062,62.23437,299400,-0.650160384\n1995-12-13T14:30:00Z,62.3125,62.70312,62.3125,62.625,390700,3.687417974\n1995-12-14T14:30:00Z,62.6875,62.79687,62.01562,62.17187,395000,-2.804566193\n1995-12-15T14:30:00Z,61.875,61.875,61.59375,61.8125,416700,-3.360558438\n1995-12-18T14:30:00Z,61.26562,61.26562,60.60937,60.625,862300,-12.11825127\n1995-12-19T14:30:00Z,60.65625,61.34375,60.57812,61.26562,1022600,3.809784146\n1995-12-20T14:30:00Z,61.45312,61.51562,60.67187,60.67187,1349800,-3.099732811\n1995-12-21T14:30:00Z,61.03125,61.17187,60.75,60.98437,857600,0.446418367\n1995-12-22T14:30:00Z,61.3125,61.375,61.14062,61.20312,332800,1.147131124\n1995-12-26T14:30:00Z,61.45312,61.53125,61.32812,61.5,432200,2.0508125\n1995-12-27T14:30:00Z,61.65625,61.65625,61.35937,61.46875,151800,-0.358473752\n1995-12-28T14:30:00Z,61.34375,61.65625,61.25,61.40625,256200,-0.235721983\n1995-12-29T14:30:00Z,61.46875,61.53125,61.25,61.48437,339200,0.3340625\n1996-01-02T14:30:00Z,61.40625,62.14062,61.34375,62.14062,514400,5.262026435\n1996-01-03T14:30:00Z,62.34375,62.5,62,62.3125,610300,1.116659363\n1996-01-04T14:30:00Z,62.39062,62.625,61.21875,61.71875,1129700,-4.532101174\n1996-01-05T14:30:00Z,61.3125,61.75,61.17187,61.59375,302400,-0.697906996\n1996-01-08T14:30:00Z,61.8125,61.90625,61.73437,61.82812,179900,1.9530625\n1996-01-09T14:30:00Z,62.0625,62.0625,60.625,60.76562,415500,-8.905234603\n1996-01-10T14:30:00Z,60.6875,60.8125,59.64062,59.96875,787700,-6.957769889\n1996-01-11T14:30:00Z,60.0625,60.32812,59.78125,60.32812,513200,0.96603185\n1996-01-12T14:30:00Z,60.48437,60.5,59.67187,60.23437,390400,-0.698522181\n1996-01-15T14:30:00Z,60.25,60.45312,59.85937,60.10937,154100,-0.920767857\n1996-01-16T14:30:00Z,60.40625,60.89062,59.89062,60.84375,454500,4.330053734\n1996-01-17T14:30:00Z,60.70312,61.125,60.45312,60.65625,407600,-0.317377031\n1996-01-18T14:30:00Z,60.89062,60.90625,60.375,60.85937,425500,0.569065159\n1996-01-19T14:30:00Z,60.85937,61.42187,60.79687,61.26562,169800,3.342013889\n1996-01-22T14:30:00Z,61.21875,61.42187,61.10937,61.28125,288100,0.350100236\n1996-01-23T14:30:00Z,61.25,61.42187,61.125,61.42187,362100,0.756824609\n1996-01-24T14:30:00Z,61.51562,62.04687,61.48437,61.92187,1506500,4.577263587\n1996-01-25T14:30:00Z,61.96875,62,61.625,61.70312,298400,-0.973353996\n1996-01-26T14:30:00Z,61.65625,62.26562,61.57812,62.23437,726300,3.515601684\n1996-01-29T14:30:00Z,62.1875,62.48437,62.14062,62.48437,254800,1.737492448\n1996-01-30T14:30:00Z,62.60937,63.14062,62.53125,63.01562,272100,4.690754852\n1996-01-31T14:30:00Z,63,63.6875,62.96875,63.67187,498000,5.598987202\n1996-02-01T14:30:00Z,63.60937,63.90625,63.5625,63.90625,373900,1.576719262\n1996-02-02T14:30:00Z,63.875,64.01562,63.5,63.64062,496200,-1.328419042\n1996-02-05T14:30:00Z,63.53125,64.25,63.4375,64.15625,295300,3.364581635\n1996-02-06T14:30:00Z,64.1875,64.82812,64.09375,64.76562,301600,4.972714595\n1996-02-07T14:30:00Z,64.75,65.14062,64.6875,65.14062,585100,2.803323433\n1996-02-08T14:30:00Z,65.04687,65.90625,64.92187,65.84375,1526600,5.303448114\n1996-02-09T14:30:00Z,65.8125,66.375,65.51562,65.82812,804600,0.600328559\n1996-02-12T14:30:00Z,65.95312,66.625,65.89062,66.32812,626500,4.474835586\n1996-02-13T14:30:00Z,66.04687,66.6875,66,66.1875,1045900,0.067405313\n1996-02-14T14:30:00Z,66.14062,66.35937,65.57812,65.60937,431400,-3.772190546\n1996-02-15T14:30:00Z,65.46875,65.90625,65.125,65.20312,889500,-2.22521234\n1996-02-16T14:30:00Z,65.07812,65.23437,64.73437,64.9375,606100,-2.081051442\n1996-02-20T14:30:00Z,64.4375,64.625,63.875,64.29687,492300,-5.262953046\n1996-02-21T14:30:00Z,64.42187,65.14062,64.42187,65.09375,434000,7.090153618\n1996-02-22T14:30:00Z,65.45312,66.32812,65.40625,66.125,721400,9.504507345\n1996-02-23T14:30:00Z,66.5,66.60937,65.32812,65.9375,1430400,-1.033683492\n1996-02-26T14:30:00Z,65.75,65.89062,64.96875,65,1408400,-8.101974587\n1996-02-27T14:30:00Z,65.15625,65.17187,64.5,64.79687,601000,-2.073902975\n1996-02-28T14:30:00Z,65.3125,65.73437,64.5,64.5,865900,-3.508704626\n1996-02-29T14:30:00Z,64.125,64.95312,63.875,63.875,914300,-2.905880242\n1996-03-01T14:30:00Z,64.64062,64.89062,63.60937,64.89062,1452600,5.0928383\n1996-03-04T14:30:00Z,65.03125,65.65625,64.8125,65.26562,652600,2.928851562\n1996-03-05T14:30:00Z,65.10937,65.875,65.07812,65.875,402000,4.678181405\n1996-03-06T14:30:00Z,65.78125,65.96875,65.29687,65.29687,624700,-2.632329783\n1996-03-07T14:30:00Z,65.42187,65.65625,65.23437,65.625,534200,1.2765858\n1996-03-08T14:30:00Z,64.1875,64.875,62,63.5,2289900,-16.59669371\n1996-03-11T14:30:00Z,63.25,64.32812,63.0625,64.23437,1511400,3.797411476\n1996-03-12T14:30:00Z,63.8125,64.04687,62.90625,63.73437,1385300,-1.642656588\n1996-03-13T14:30:00Z,64.15625,64.4375,63.79687,64.17187,1019300,2.706207705\n1996-03-14T14:30:00Z,64.26562,64.8125,64.23437,64.45312,725600,2.473747016\n1996-03-15T14:30:00Z,64.0625,64.32812,63.75,64.125,869200,-1.597979662\n1996-03-18T14:30:00Z,64.71875,65.35937,64.57812,65.35937,917600,11.83720377\n1996-03-19T14:30:00Z,65.9375,66,65,65.21875,858500,-1.172858902\n1996-03-20T14:30:00Z,65.53125,65.53125,64.64062,65.14062,744300,-1.529741713\n1996-03-21T14:30:00Z,65.21875,65.25,64.76562,64.98437,650800,-1.494336302\n1996-03-22T14:30:00Z,65.01562,65.32812,64.9375,65.15625,344500,0.878094287\n1996-03-25T14:30:00Z,65.75,65.8125,64.85937,65.03125,802400,-1.864329613\n1996-03-26T14:30:00Z,64.92187,65.51562,64.85937,65.34375,969400,1.244885222\n1996-03-27T14:30:00Z,65.4375,65.48437,64.6875,64.75,809600,-3.781970263\n1996-03-28T14:30:00Z,64.51562,65.03125,64.5,65,1001300,0.8007875\n1996-03-29T14:30:00Z,65.1875,65.1875,64.375,64.6875,457700,-1.846880372\n1996-04-01T14:30:00Z,65,65.45312,64.79687,65.4375,773400,4.829860239\n1996-04-02T14:30:00Z,65.51562,65.5625,65.29687,65.5625,638800,0.604267334\n1996-04-03T14:30:00Z,65.32812,65.60937,65.17187,65.5625,288000,0.700604844\n1996-04-04T14:30:00Z,65.5625,65.71875,65.5,65.51562,934900,-0.041285025\n1996-04-08T13:30:00Z,63.875,64.39062,63.59375,64.39062,2217200,-7.699853591\n1996-04-09T13:30:00Z,64.64062,64.64062,64.01562,64.14062,1180900,-1.153665125\n1996-04-10T13:30:00Z,64.03125,64.3125,62.75,63,939500,-9.174203414\n1996-04-11T13:30:00Z,63.15625,63.46875,62.125,62.92187,1276000,-1.547281707\n1996-04-12T13:30:00Z,63.35937,63.8125,63.17187,63.71875,411300,6.199581988\n1996-04-15T13:30:00Z,64.04687,64.32812,63.84375,64.25,484200,4.3226495\n1996-04-16T13:30:00Z,64.375,64.65625,64.23437,64.4375,429700,1.447882714\n1996-04-17T13:30:00Z,64.375,64.5625,63.84375,64.28125,525300,-0.947473404\n1996-04-18T13:30:00Z,64.4375,64.57812,64.09375,64.375,818600,0.142727367\n1996-04-19T13:30:00Z,64.6875,64.85937,64.42187,64.53125,885100,0.397026673\n1996-04-22T13:30:00Z,65.125,65.28125,64.59375,65.03125,828900,2.56121134\n1996-04-23T13:30:00Z,64.92187,65.28125,64.78125,65.23437,225400,1.002783582\n1996-04-24T13:30:00Z,65.5625,65.5625,64.85937,65,699000,-1.3124766\n1996-04-25T13:30:00Z,65.14062,65.5625,64.75,65.29687,475500,0.864479508\n1996-04-26T13:30:00Z,65.46875,65.8125,65.23437,65.4375,563300,0.856682933\n1996-04-29T13:30:00Z,65.15625,65.5625,65.15625,65.4375,219900,0.563826651\n1996-04-30T13:30:00Z,65.4375,65.5625,65.125,65.39062,184400,-2.88462E-05\n1996-05-01T13:30:00Z,65.375,65.79687,65.28125,65.53125,561900,0.996842274\n1996-05-02T13:30:00Z,65.01562,65.375,64.09375,64.40625,1299600,-8.934166899\n1996-05-03T13:30:00Z,64.78125,64.98437,63.75,64.3125,1329300,-1.421107461\n1996-05-06T13:30:00Z,64.5625,64.5625,63.6875,64.25,647500,-1.322588583\n1996-05-07T13:30:00Z,64.25,64.25,63.76562,63.98437,582100,-2.564876941\n1996-05-08T13:30:00Z,63.67187,64.78125,63.07812,64.78125,1694700,4.113640272\n1996-05-09T13:30:00Z,64.5625,65.0625,64.5,64.73437,593400,0.662231572\n1996-05-10T13:30:00Z,65.375,65.59375,65.0625,65.375,925100,4.97328275\n1996-05-13T13:30:00Z,65.53125,66.64062,65.46875,66.35937,867500,9.076349937\n1996-05-14T13:30:00Z,66.625,66.9375,66.5625,66.76562,632300,3.613286071\n1996-05-15T13:30:00Z,66.78125,67.3125,66.64062,66.6875,466100,-0.43431106\n1996-05-16T13:30:00Z,66.3125,66.9375,66.28125,66.82812,514400,1.400834052\n1996-05-17T13:30:00Z,67,67.29687,67,67.1875,427700,3.33228587\n1996-05-20T13:30:00Z,67.65625,67.75,66.98437,67.64062,788500,2.129611895\n1996-05-21T13:30:00Z,67.75,67.875,67.5,67.54687,352700,-0.770203967\n1996-05-22T13:30:00Z,67.625,68.1875,67.39062,68.1875,1218100,4.114632824\n1996-05-23T13:30:00Z,68.28125,68.4375,67.53125,67.90625,967900,-1.285564366\n1996-05-24T13:30:00Z,67.96875,68.32812,67.9375,68.17187,659100,1.441913345\n1996-05-28T13:30:00Z,68.375,68.375,67.3125,67.48437,456400,-5.220319787\n1996-05-29T13:30:00Z,67.625,67.6875,66.8125,67.03125,649600,-3.720969628\n1996-05-30T13:30:00Z,66.9375,67.71875,66.75,67.375,895800,1.592548077\n1996-05-31T13:30:00Z,67.35937,67.64062,66.875,66.875,923500,-2.260048629\n1996-06-03T13:30:00Z,66.89062,67.10937,66.70312,67.0625,503100,0.423179475\n1996-06-04T13:30:00Z,67.375,67.59375,67.25,67.53125,627100,4.07615403\n1996-06-05T13:30:00Z,67.5625,68.20312,67.42187,68.125,428000,4.679094643\n1996-06-06T13:30:00Z,68.5,68.5,67.5,67.625,523300,-2.729023973\n1996-06-07T13:30:00Z,66.1875,67.64062,66.1875,67.625,1422800,2.686923924\n1996-06-10T13:30:00Z,67.53125,67.73437,67.29687,67.40625,548800,0.201060049\n1996-06-11T13:30:00Z,67.65625,68.03125,67.34375,67.34375,688700,-1.358695652\n1996-06-12T13:30:00Z,67.5625,67.73437,67.10937,67.21875,1120600,-1.302066667\n1996-06-13T13:30:00Z,67.375,67.46875,66.82812,67.21875,1502000,-0.551288545\n1996-06-14T13:30:00Z,67.25,67.25,66.71875,66.9375,1468200,-2.61130137\n1996-06-17T13:30:00Z,66.96875,67.21875,66.71875,66.89062,1101000,-0.498861486\n1996-06-18T13:30:00Z,66.84375,67.03125,66.32812,66.34375,718000,-3.971653488\n1996-06-19T13:30:00Z,66.65625,67,66.42187,66.64062,552100,0.906616683\n1996-06-20T13:30:00Z,66.70312,66.92187,66.1875,66.59375,1234400,-0.404549509\n1996-06-21T13:30:00Z,66.5625,66.8125,66.375,66.8125,573300,0.930612797\n1996-06-24T13:30:00Z,66.96875,67.21875,66.84375,66.9375,416500,0.963092672\n1996-06-25T13:30:00Z,67.125,67.17187,66.78125,66.85937,454400,-0.80424845\n1996-06-26T13:30:00Z,66.78125,66.92187,66.39062,66.40625,838200,-3.46581383\n1996-06-27T13:30:00Z,66.40625,67.04687,66.15625,66.875,1090500,2.478601875\n1996-06-28T13:30:00Z,67.15625,67.5,66.96875,67.10937,1060800,1.843356742\n1996-07-01T13:30:00Z,67.28125,67.70312,67.1875,67.6875,471300,5.041792161\n1996-07-02T13:30:00Z,67.625,67.64062,67.32812,67.4375,389400,-1.24338352\n1996-07-03T13:30:00Z,67.40625,67.5,67.0625,67.29687,308300,-1.17191129\n1996-07-05T13:30:00Z,66.125,66.4375,65.375,65.57812,842900,-15.96416215\n1996-07-08T13:30:00Z,65.625,65.98437,65.125,65.3125,942000,-1.588136494\n1996-07-09T13:30:00Z,65.60937,65.8125,65.375,65.57812,739200,0.982114286\n1996-07-10T13:30:00Z,65.5625,65.84375,64.92187,65.84375,1132300,1.757825105\n1996-07-11T13:30:00Z,65.5625,65.6875,63.875,64.51562,1587400,-11.1772134\n1996-07-12T13:30:00Z,64.625,64.90625,64.07812,64.5625,1312000,-0.617426567\n1996-07-15T13:30:00Z,64.71875,64.71875,62.65625,62.65625,1951300,-16.93050987\n1996-07-16T13:30:00Z,62.84375,63.5,60.375,62.8125,4141000,-1.46861588\n1996-07-17T13:30:00Z,63.75,64,63,63.5625,1340500,4.368905142\n1996-07-18T13:30:00Z,63.75,64.54687,63.32812,64.4375,1432500,5.696585648\n1996-07-19T13:30:00Z,64.28125,64.375,63.625,63.96875,1216000,-2.414190574\n1996-07-22T13:30:00Z,63.53125,63.75,63.01562,63.5,519800,-3.634798082\n1996-07-23T13:30:00Z,63.59375,63.9375,62.57812,62.6875,1479800,-5.366638945\n1996-07-24T13:30:00Z,61.9375,63.1875,61.625,62.8125,2463400,1.246929585\n1996-07-25T13:30:00Z,63.4375,63.5625,63.125,63.375,1989800,4.326923077\n1996-07-26T13:30:00Z,63.5625,63.8125,63.39062,63.71875,642300,2.49450354\n1996-07-29T13:30:00Z,63.625,63.71875,62.9375,63.01562,1297900,-5.76641369\n1996-07-30T13:30:00Z,63.4375,63.6875,62.9375,63.625,1868200,2.563192472\n1996-07-31T13:30:00Z,63.67187,64.26562,63.51562,64.09375,767100,3.650604473\n1996-08-01T13:30:00Z,64.15625,65.39062,64.0625,65.15625,1168600,9.430608882\n1996-08-02T13:30:00Z,66,66.59375,65.75,66.5625,1098500,12.51755618\n1996-08-05T13:30:00Z,66.57812,66.59375,65.96875,66.17187,710200,-2.196293367\n1996-08-06T13:30:00Z,66.15625,66.51562,65.79687,66.375,640000,0.602692857\n1996-08-07T13:30:00Z,66.625,66.75,66.125,66.54687,917800,0.646525862\n1996-08-08T13:30:00Z,66.5625,66.5625,66.1875,66.4375,925100,-1.089649085\n1996-08-09T13:30:00Z,66.67187,66.76562,66.0625,66.21875,648800,-1.520946526\n1996-08-12T13:30:00Z,66.25,66.85937,66,66.70312,764200,2.46020243\n1996-08-13T13:30:00Z,66.57812,66.625,66,66.17187,805200,-3.511207422\n1996-08-14T13:30:00Z,66.1875,66.46875,66,66.40625,533800,0.787968322\n1996-08-15T13:30:00Z,66.23437,66.625,66.20312,66.28125,632600,-0.134468876\n1996-08-16T13:30:00Z,66.46875,66.875,66.46875,66.84375,475100,5.523910171\n1996-08-19T13:30:00Z,66.85937,66.92187,66.625,66.875,436400,0.46485845\n1996-08-20T13:30:00Z,66.89062,66.90625,66.67187,66.82812,645700,-0.395447108\n1996-08-21T13:30:00Z,66.65625,66.8125,66.375,66.59375,266400,-1.727978652\n1996-08-22T13:30:00Z,66.75,67.34375,66.71875,67.21875,584800,5.625\n1996-08-23T13:30:00Z,67.09375,67.20312,66.64062,66.85937,757100,-1.888809538\n1996-08-26T13:30:00Z,66.70312,66.78125,66.42187,66.53125,784700,-2.82779731\n1996-08-27T13:30:00Z,66.71875,66.84375,66.5,66.78125,389400,1.20345086\n1996-08-28T13:30:00Z,66.9375,67,66.65625,66.67187,227600,-0.861951087\n1996-08-29T13:30:00Z,66.59375,66.59375,65.625,66.01562,680200,-6.162287511\n1996-08-30T13:30:00Z,66,66.01562,65.125,65.32812,1500900,-6.280594332\n1996-09-03T13:30:00Z,64.46875,65.84375,64.375,65.75,1782000,3.255746246\n1996-09-04T13:30:00Z,65.75,66.75,65.48437,65.8125,930200,1.631768255\n1996-09-05T13:30:00Z,65.5,65.76562,65.01562,65.01562,616600,-6.459883308\n1996-09-06T13:30:00Z,65.25,66.17187,65.14062,65.9375,804900,6.808320165\n1996-09-09T13:30:00Z,66.1875,66.73437,66.07812,66.71875,719200,6.756090539\n1996-09-10T13:30:00Z,66.625,66.90625,66.375,66.6875,669900,0.4296875\n1996-09-11T13:30:00Z,66.5625,67.125,66.40625,67.0625,713500,2.385305851\n1996-09-12T13:30:00Z,67.25,67.73437,67.15625,67.53125,713300,4.111731839\n1996-09-13T13:30:00Z,68.3125,68.625,68.125,68.5625,2008800,9.668848536\n1996-09-16T13:30:00Z,68.65625,69.15625,68.5625,68.8125,1220200,2.208891369\n1996-09-17T13:30:00Z,68.875,68.98437,68.23437,68.65625,604700,-1.037485767\n1996-09-18T13:30:00Z,68.5625,68.75,68.21875,68.48437,225500,-1.239618333\n1996-09-19T13:30:00Z,68.375,68.79687,68.28125,68.75,410000,1.582483717\n1996-09-20T13:30:00Z,68.59375,68.78125,68.375,68.64062,948400,0.036585938\n1996-09-23T13:30:00Z,68.46875,68.75,68.15625,68.625,466800,0.371109435\n1996-09-24T13:30:00Z,68.5625,69.25,68.3125,68.60937,1269800,0.18747\n1996-09-25T13:30:00Z,68.9375,68.9375,68.5,68.65625,1353300,-0.374480118\n1996-09-26T13:30:00Z,68.75,69.1875,68.39062,68.625,773200,-0.628163608\n1996-09-27T13:30:00Z,68.71875,68.71875,68.375,68.6875,407600,0.065104167\n1996-09-30T13:30:00Z,68.78125,69.0625,68.57812,68.625,578200,-0.706838058\n1996-10-01T13:30:00Z,68.70312,69.04687,68.4375,69,561400,1.969599148\n1996-10-02T13:30:00Z,69.25,69.59375,69.15625,69.46875,609000,4.104148587\n1996-10-03T13:30:00Z,69.5,69.53125,69.20312,69.40625,342200,-0.237166545\n1996-10-04T13:30:00Z,69.6875,70.34375,69.5,70.34375,754100,7.962740385\n1996-10-07T13:30:00Z,70.3125,70.625,70.25,70.42187,235100,0.968046196\n1996-10-08T13:30:00Z,70.45312,70.6875,70.01562,70.14062,386200,-1.489390755\n1996-10-09T13:30:00Z,70.25,70.375,69.51562,69.59375,528800,-3.971312153\n1996-10-10T13:30:00Z,69.59375,69.85937,69.375,69.45312,1562200,-0.960098894\n1996-10-11T13:30:00Z,69.71875,70.3125,69.71875,70.3125,331300,7.905181755\n1996-10-14T13:30:00Z,70.3125,70.6875,70.29687,70.40625,201600,1.256781821\n1996-10-15T13:30:00Z,71.125,71.125,69.95312,70.3125,776900,-1.790995368\n1996-10-16T13:30:00Z,70.5,70.65625,69.9375,70.65625,590100,0.556144068\n1996-10-17T13:30:00Z,70.875,71.03125,70.54687,70.84375,792500,0.944487247\n1996-10-18T13:30:00Z,70.875,71.3125,70.71875,71.21875,695800,2.625304383\n1996-10-21T13:30:00Z,71.28125,71.625,70.9375,71.125,879200,-0.282118056\n1996-10-22T13:30:00Z,71.0625,71.07812,70.59375,70.625,848900,-4.601025498\n1996-10-23T13:30:00Z,70.46875,70.89062,70.1875,70.85937,735900,1.077956153\n1996-10-24T13:30:00Z,70.85937,70.98437,70.21875,70.25,379300,-3.786468449\n1996-10-25T13:30:00Z,70.23437,70.5625,70.125,70.3125,568300,-0.168137774\n1996-10-28T14:30:00Z,70.375,70.73437,69.8125,69.84375,975400,-2.372930614\n1996-10-29T14:30:00Z,70.0625,70.57812,69.70312,70.40625,815900,2.739655523\n1996-10-30T14:30:00Z,70.625,70.625,70.09375,70.17187,495400,-1.186732595\n1996-10-31T14:30:00Z,70.26562,70.875,70.1875,70.84375,726300,4.606872808\n1996-11-01T14:30:00Z,70.98437,71.15625,70.26562,70.59375,821300,-1.049886468\n1996-11-04T14:30:00Z,70.6875,71.0625,70.53125,71.0625,1608400,2.602155793\n1996-11-05T14:30:00Z,71.29687,71.79687,71.28125,71.46875,764000,3.741736967\n1996-11-06T14:30:00Z,71.59375,72.875,71.53125,72.84375,1665000,12.66302603\n1996-11-07T14:30:00Z,72.625,73.29687,72.53125,73.01562,1446300,1.785379884\n1996-11-08T14:30:00Z,73.03125,73.4375,72.75,73.42187,1355700,2.348141642\n1996-11-11T14:30:00Z,73.25,73.51562,73.21875,73.34375,655900,0.21369367\n1996-11-12T14:30:00Z,73.54687,73.59375,73.01562,73.125,719900,-1.384944252\n1996-11-13T14:30:00Z,73.20312,73.5625,73.01562,73.45312,481900,1.457217671\n1996-11-14T14:30:00Z,73.1875,73.9375,73.15625,73.9375,558800,3.30770544\n1996-11-15T14:30:00Z,74.125,74.5,73.71875,74.03125,2250900,0.850554435\n1996-11-18T14:30:00Z,74.17187,74.25,73.73437,74.04687,1518200,-0.242036705\n1996-11-19T14:30:00Z,74.14062,74.59375,74.03125,74.57812,1029300,4.137578947\n1996-11-20T14:30:00Z,74.5625,75.01562,74.3125,74.70312,730000,1.025388522\n1996-11-21T14:30:00Z,74.79687,74.84375,74.375,74.59375,653000,-0.715354246\n1996-11-22T14:30:00Z,74.70312,75.25,74.70312,75.17187,965100,4.789216871\n1996-11-25T14:30:00Z,75.25,76.15625,75.07812,76.125,2058800,7.760832324\n1996-11-26T14:30:00Z,76.28125,76.6875,75.46875,75.875,2861800,-0.668733016\n1996-11-27T14:30:00Z,76.0625,76.1875,75.64062,75.73437,872000,-1.223657733\n1996-11-29T14:30:00Z,76,76.21875,75.85937,76.01562,1073400,1.243767277\n1996-12-02T14:30:00Z,75.92187,76.125,75.39062,76.04687,1350600,0.516690497\n1996-12-03T14:30:00Z,76.0625,76.57812,74.75,74.75,1777800,-8.377889913\n1996-12-04T14:30:00Z,74.875,75.0625,74.09375,74.95312,2365100,-0.271814006\n1996-12-05T14:30:00Z,74.84375,75.14062,74.53125,74.75,1697700,-0.966233399\n1996-12-06T14:30:00Z,73.25,74.75,72.65625,74.3125,3401800,0.43458833\n1996-12-09T14:30:00Z,74.6875,75.42187,74.57812,75.40625,1864600,9.593627798\n1996-12-10T14:30:00Z,75.5625,75.67187,74.96875,75.04687,1331600,-1.355119401\n1996-12-11T14:30:00Z,73.625,74.625,73.3125,74.35937,1847900,-2.947020772\n1996-12-12T14:30:00Z,74.78125,74.875,72.9375,73.125,2540200,-7.871990194\n1996-12-13T14:30:00Z,73.0625,73.57812,72.40625,73.3125,1678300,-0.287677939\n1996-12-16T14:30:00Z,73.5,73.6875,72.0625,72.375,1831100,-6.655092593\n1996-12-17T14:30:00Z,72.15625,73.28125,71.875,72.95312,2023200,2.333778356\n1996-12-18T14:30:00Z,73.375,73.76562,73.26562,73.53125,1666800,5.07815468\n1996-12-19T14:30:00Z,74.1875,75.125,73.89062,75.04687,2269300,13.60249575\n1996-12-20T14:30:00Z,75.125,75.71875,74.75,74.84375,1543200,-0.457331238\n1996-12-23T14:30:00Z,75.09375,75.20312,74.32812,74.65625,1263700,-1.62466064\n1996-12-24T14:30:00Z,74.84375,75.20312,74.79687,75.20312,633000,3.600199111\n1996-12-26T14:30:00Z,75.4375,75.82812,75.375,75.78125,1384300,5.216475204\n1996-12-27T14:30:00Z,75.78125,76.03125,75.5,75.875,410400,0.645272943\n1996-12-30T14:30:00Z,76.125,76.125,75.15625,75.21875,694100,-4.916646161\n1996-12-31T14:30:00Z,75.28125,75.375,73.84375,73.84375,1378100,-11.34375\n1997-01-02T14:30:00Z,74.375,74.375,72.75,74.03125,2031900,-1.18417815\n1997-01-03T14:30:00Z,74.375,75.125,74.07812,75.09375,2123200,7.898262061\n1997-01-06T14:30:00Z,75.09375,75.4375,74.3125,74.4375,1374100,-3.011555015\n1997-01-07T14:30:00Z,74.4375,75.46875,74.125,75.34375,939000,5.109496438\n1997-01-08T14:30:00Z,75.75,75.78125,74.6875,74.6875,1802200,-2.985160873\n1997-01-09T14:30:00Z,75.0625,75.875,74.9375,75.3125,1415700,2.706801471\n1997-01-10T14:30:00Z,74.25,76.25,74.25,76.125,2369500,5.835700758\n1997-01-13T14:30:00Z,76.5,76.5,75.64062,76.01562,1364600,0.267103222\n1997-01-14T14:30:00Z,76.6875,77.39062,76.5,76.96875,2111200,6.666212253\n1997-01-15T14:30:00Z,76.71875,77.20312,76.375,76.78125,1583900,-0.354961215\n1997-01-16T14:30:00Z,77.03125,77.29687,76.5,77.09375,1308400,1.425400599\n1997-01-17T14:30:00Z,77.20312,77.75,77.10937,77.5625,1604000,4.1015625\n1997-01-20T14:30:00Z,77.75,78.09375,77.46875,77.65625,1889900,0.635037141\n1997-01-21T14:30:00Z,77.375,78.54687,77.10937,78.28125,2785800,4.018506016\n1997-01-22T14:30:00Z,78.3125,78.84375,77.875,78.84375,1201600,3.102022059\n1997-01-23T14:30:00Z,79.0625,79.6875,76.90625,77.75,2601100,-6.720216153\n1997-01-24T14:30:00Z,77.875,77.90625,76.75,76.75,2176000,-7.960526316\n1997-01-27T14:30:00Z,76.875,77.23437,76.375,76.53125,2108500,-1.783219289\n1997-01-28T14:30:00Z,77.625,77.84375,76,76.75,4376000,-1.295230263\n1997-01-29T14:30:00Z,76.875,77.5,76.59375,77.5,1122700,3.515625\n1997-01-30T14:30:00Z,77.875,78.53125,77.40625,78.5,2126300,7.388528963\n1997-01-31T14:30:00Z,78.9375,79.40625,78.375,78.40625,3208100,-0.968852796\n1997-02-03T14:30:00Z,78.71875,78.89062,78.35937,78.64062,755000,0.284889339\n1997-02-04T14:30:00Z,78.75,79.20312,78.4375,79.125,654100,2.920972906\n1997-02-05T14:30:00Z,79.23437,79.46875,77.125,77.64062,2255400,-11.21797436\n1997-02-06T14:30:00Z,77.78125,78.20312,77.40625,78.15625,2483100,0.89615816\n1997-02-07T14:30:00Z,78.8125,79.25,77.78125,79.21875,2321000,5.947265625\n1997-02-10T14:30:00Z,79.25,79.53125,78.42187,78.46875,1670000,-4.273572677\n1997-02-11T14:30:00Z,78.78125,79.375,78.125,79.375,1664300,3.949535473\n1997-02-12T14:30:00Z,79.375,80.64062,79.26562,80.5,2675400,9.532714744\n1997-02-13T14:30:00Z,80.8125,81.5625,80.6875,81.375,1104800,7.63671875\n1997-02-14T14:30:00Z,81.1875,81.46875,80.90625,81.1875,1112900,-0.1953125\n1997-02-18T14:30:00Z,81.34375,81.9375,80.75,81.875,833100,3.762335526\n1997-02-19T14:30:00Z,81.65625,82,81.15625,81.32812,648100,-2.6594095\n1997-02-20T14:30:00Z,81.03125,81.35937,80.15625,80.34375,1193900,-8.036572557\n1997-02-21T14:30:00Z,80.40625,80.76562,80.14062,80.375,1844400,-0.516997549\n1997-02-24T14:30:00Z,79.96875,81.375,79.96875,81.32812,787300,7.182287293\n1997-02-25T14:30:00Z,81.40625,81.53125,80.875,81.39062,1653900,1.121684864\n1997-02-26T14:30:00Z,81.3125,81.4375,79.625,80.59375,1597800,-7.048213496\n1997-02-27T14:30:00Z,80.8125,80.8125,79.375,79.39062,1813100,-9.861901268\n1997-02-28T14:30:00Z,79.25,79.875,79.0625,79.15625,2961200,-1.650363514\n1997-03-03T14:30:00Z,78.75,79.75,78.6875,79.6875,1210400,3.337174011\n1997-03-04T14:30:00Z,79.90625,80.125,79.09375,79.25,1478700,-1.557677469\n1997-03-05T14:30:00Z,79.71875,80.59375,79.45312,80.59375,1254800,9.658185955\n1997-03-06T14:30:00Z,80.625,80.90625,79.875,80.125,1528500,-1.796875\n1997-03-07T14:30:00Z,80.4375,81.15625,80.25,80.84375,1859300,4.695870536\n1997-03-10T14:30:00Z,80.9375,81.6875,80.54687,81.6875,1074900,5.605077675\n1997-03-11T14:30:00Z,81.75,81.79687,81.25,81.25,624600,-1.861714803\n1997-03-12T14:30:00Z,81.3125,81.34375,80.29687,80.53125,1055600,-6.274745728\n1997-03-13T14:30:00Z,80.25,80.46875,79.0625,79.28125,2514100,-10.84872159\n1997-03-14T14:30:00Z,79.64062,80.03125,79.25,79.6875,1642700,0.858790076\n1997-03-17T14:30:00Z,79.25,80.03125,78.4375,79.90625,3013500,2.718221728\n1997-03-18T14:30:00Z,80,80.10937,78.71875,79.04687,1352500,-5.594431937\n1997-03-19T14:30:00Z,78.84375,79.5,78.0625,78.78125,1510000,-1.964709272\n1997-03-20T14:30:00Z,78.75,79,77.875,78.375,1808200,-3.026005993\n1997-03-21T14:30:00Z,78.6875,78.75,78.34375,78.4375,2810600,-0.732421875\n1997-03-24T14:30:00Z,78.5,79.57812,78.09375,79.53125,2145600,7.128898043\n1997-03-25T14:30:00Z,79.34375,79.96875,78.53125,78.75,2125800,-3.024193548\n1997-03-26T14:30:00Z,79.0625,79.65625,78.6875,79.09375,1335300,1.069438374\n1997-03-27T14:30:00Z,79.375,79.375,76.15625,77,2898500,-18.62609715\n1997-03-31T14:30:00Z,75.6875,75.6875,75.6875,75.6875,4270699,-12.50976563\n1997-04-01T14:30:00Z,75.25,76.1875,75.04687,75.85937,3210900,1.672844336\n1997-04-02T14:30:00Z,75.625,75.9375,74.4375,74.5,2672700,-9.516936056\n1997-04-03T14:30:00Z,74.4375,75.125,74.1875,74.90625,2284200,1.151842949\n1997-04-04T14:30:00Z,74.5,75.85937,74.15625,75.84375,3706700,5.650217237\n1997-04-07T13:30:00Z,76.1875,76.625,76.14062,76.14062,2596200,3.071400844\n1997-04-08T13:30:00Z,76.125,76.78125,75.84375,76.6875,1822700,3.443727075\n1997-04-09T13:30:00Z,77,77.04687,75.84375,76.0625,2453200,-3.740475401\n1997-04-10T13:30:00Z,76.09375,76.54687,75.6875,75.78125,1996500,-1.859643323\n1997-04-11T13:30:00Z,75.0625,75.3125,73.375,73.375,4221602,-22.24527995\n1997-04-14T13:30:00Z,73.73437,74.45312,73.3125,74.35937,3988500,3.773410513\n1997-04-15T13:30:00Z,75.25,75.64062,74.5,75.625,2760400,9.426385808\n1997-04-16T13:30:00Z,75.375,76.60937,75.25,76.5,2273300,6.483104297\n1997-04-17T13:30:00Z,76.5,77,76,76.1875,1386000,-0.457317073\n1997-04-18T13:30:00Z,76.8125,76.98437,76.25,76.5625,1702100,1.014539577\n1997-04-21T13:30:00Z,76.75,76.90625,75.46875,76.0625,2809400,-4.130045573\n1997-04-22T13:30:00Z,76.10937,77.73437,76,77.73437,3215000,12.67606937\n1997-04-23T13:30:00Z,77.65625,78.03125,77.1875,77.8125,2047700,1.538085547\n1997-04-24T13:30:00Z,78.04687,78.28125,76.875,77.42187,2689900,-2.692165541\n1997-04-25T13:30:00Z,77.0625,77.20312,76.42187,76.53125,1606200,-7.835791045\n1997-04-28T13:30:00Z,76.5,77.8125,76.375,77.28125,1666500,5.139342351\n1997-04-29T13:30:00Z,78.59375,79.78125,78.29687,79.71875,3197400,22.82363463\n1997-04-30T13:30:00Z,79.25,80.6875,79.21875,80.09375,3372200,3.730119978\n1997-05-01T13:30:00Z,80.21875,80.53125,79.3125,80,2149500,0.026682036\n1997-05-02T13:30:00Z,80.28125,81.67187,80.0625,81.4375,1448300,12.08642303\n1997-05-05T13:30:00Z,81.65625,83.5625,81.29687,83.375,3636200,16.04306875\n1997-05-06T13:30:00Z,82.96875,83.46875,82.5,83.3125,1721100,2.108065642\n1997-05-07T13:30:00Z,83,83,81.40625,81.5,2327200,-16.07130984\n1997-05-08T13:30:00Z,81.3125,83.21875,81.1875,82.0625,2923700,2.511160714\n1997-05-09T13:30:00Z,82.96875,83.125,81.65625,82.625,2558200,2.317954009\n1997-05-12T13:30:00Z,82.9375,84.25,82.875,84,2357900,11.65717365\n1997-05-13T13:30:00Z,83.9375,84.09375,83.01562,83.65625,1195100,-1.001545692\n1997-05-14T13:30:00Z,84.23437,84.5,83.4375,83.8125,2772000,-0.581884914\n1997-05-15T13:30:00Z,83.8125,84.59375,83.51562,84.375,884100,3.045710235\n1997-05-16T13:30:00Z,84.125,84.3125,83,83.21875,1934200,-8.503289474\n1997-05-19T13:30:00Z,83.3125,83.90625,83.0625,83.46875,1375800,0.407732664\n1997-05-20T13:30:00Z,83.28125,84.6875,82.75,84.46875,1756400,6.292459239\n1997-05-21T13:30:00Z,84.6875,84.98437,83.65625,84.28125,1208000,-0.292969651\n1997-05-22T13:30:00Z,84.375,84.46875,83.5625,84,907600,-2.542090601\n1997-05-23T13:30:00Z,84.375,85.21875,84.15625,84.78125,644400,5.495945411\n1997-05-27T13:30:00Z,84.375,85.53125,84.26562,85.125,1531000,2.812489714\n1997-05-28T13:30:00Z,85.125,85.45312,84.51562,85.10937,716700,0.555399088\n1997-05-29T13:30:00Z,85.09375,85.25,84.5,84.60937,1282700,-3.769108226\n1997-05-30T13:30:00Z,83.21875,85.5625,83.125,85.15625,2143300,5.056500535\n1997-06-02T13:30:00Z,85.34375,85.5,84.71875,84.78125,1479100,-0.371334877\n1997-06-03T13:30:00Z,84.40625,85.4375,84.34375,84.5,1562100,-1.246044304\n1997-06-04T13:30:00Z,84.53125,84.75,84.07812,84.40625,1063100,-0.503645255\n1997-06-05T13:30:00Z,84.59375,85.3125,84.42187,84.71875,1180800,2.094269578\n1997-06-06T13:30:00Z,84.59375,86.4375,84.59375,86.375,1511100,14.77050781\n1997-06-09T13:30:00Z,86.4375,86.875,86.34375,86.8125,1823400,3.425\n1997-06-10T13:30:00Z,86.84375,87.40625,86.5,87.07812,1217500,1.76846582\n1997-06-11T13:30:00Z,87,87.40625,86.82812,87.28125,1673800,1.295916639\n1997-06-12T13:30:00Z,87.875,89,87.5625,88.96875,4273301,15.01869816\n1997-06-13T13:30:00Z,89.0625,90,88.90625,89.71875,2132900,6.371651786\n1997-06-16T13:30:00Z,89.75,90,89.46875,89.75,800400,0.493767556\n1997-06-17T13:30:00Z,89.4375,90.23437,88.9375,89.625,2048100,-0.12236493\n1997-06-18T13:30:00Z,89.125,89.625,88.96875,89.3125,1971900,-1.002604167\n1997-06-19T13:30:00Z,89.60937,90.5,89.375,90.23437,2029900,7.903784091\n1997-06-20T13:30:00Z,89.9375,90.34375,89.5,89.57812,1396900,-3.119649658\n1997-06-23T13:30:00Z,89.40625,89.90625,87.34375,87.40625,3991500,-17.17319519\n1997-06-24T13:30:00Z,88.25,89.875,88,89.625,4895102,13.89574196\n1997-06-25T13:30:00Z,89.48437,90.25,87.9375,89,4708898,-2.078344853\n1997-06-26T13:30:00Z,88.84375,89.625,87.6875,88.5625,2569900,-2.786257384\n1997-06-27T13:30:00Z,88.96875,89.71875,88.6875,88.90625,2617900,1.503513003\n1997-06-30T13:30:00Z,88.90625,89.46875,87.875,88.3125,2384900,-3.629399272\n1997-07-01T13:30:00Z,88.5,89.5625,88.39062,89.34375,1749000,7.498190233\n1997-07-02T13:30:00Z,89.5625,90.8125,89.21875,90.8125,1961800,11.72297754\n1997-07-03T13:30:00Z,91.875,92.15625,91.46875,92.0625,2539100,10.47334559\n1997-07-07T13:30:00Z,92.375,92.5,90.90625,91.125,1158600,-6.675967262\n1997-07-08T13:30:00Z,91.25,92.1875,91.1875,92.07812,3396500,5.212081395\n1997-07-09T13:30:00Z,92.3125,92.375,90.03125,91.0625,5390301,-7.189889865\n1997-07-10T13:30:00Z,91.125,91.84375,90.48437,91.46875,2072200,0.775771629\n1997-07-11T13:30:00Z,91.59375,92.1875,91.375,91.78125,2260400,2.4609375\n1997-07-14T13:30:00Z,91.89062,92.3125,91.21875,92.0625,3186400,1.27622774\n1997-07-15T13:30:00Z,92.3125,92.76562,91.46875,92.53125,2983100,2.037110384\n1997-07-16T13:30:00Z,93.125,94.09375,92.89062,93.75,2621300,10.77401319\n1997-07-17T13:30:00Z,93.625,93.8125,92.78125,93.28125,1794800,-2.469675164\n1997-07-18T13:30:00Z,93.01562,93.21875,91.0625,91.29687,3961900,-17.87011748\n1997-07-21T13:30:00Z,91.28125,91.59375,90.6875,91.3125,3810300,-1.135872807\n1997-07-22T13:30:00Z,91.6875,93.79687,91.625,93.73437,4243398,22.95341776\n1997-07-23T13:30:00Z,93.9375,94.48437,93.53125,93.65625,3204300,0.937516\n1997-07-24T13:30:00Z,93.9375,94.26562,92.6875,94.09375,4152699,1.635631442\n1997-07-25T13:30:00Z,94.5625,94.8125,93.625,94.03125,2364800,-1.058668392\n1997-07-28T13:30:00Z,94.25,94.5625,93.5,93.96875,2794700,-0.933159722\n1997-07-29T13:30:00Z,93.625,94.46875,93.42187,94.28125,2737100,1.744845338\n1997-07-30T13:30:00Z,94.5,95.625,94.40625,95.40625,4839801,10.12352196\n1997-07-31T13:30:00Z,95.40625,96.03125,95.03125,95.3125,2138700,0.273686306\n1997-08-01T13:30:00Z,95.5,95.71875,93.8125,94.9375,7077699,-3.302125506\n1997-08-04T13:30:00Z,94.78125,95.54687,94.40625,95.1875,2339500,0.928921308\n1997-08-05T13:30:00Z,95.09375,95.6875,94.90625,95.25,1467000,0.857300885\n1997-08-06T13:30:00Z,95.4375,96.53125,95.0625,96.03125,2478200,5.933249676\n1997-08-07T13:30:00Z,96.5,96.625,95.125,95.3125,3641900,-3.999740818\n1997-08-08T13:30:00Z,94.3125,94.75,92.40625,93.375,7167602,-16.80418616\n1997-08-11T13:30:00Z,93.75,94.28125,92.625,94.0625,6355898,1.825606921\n1997-08-12T13:30:00Z,94.21875,94.54687,92.46875,92.5625,6160801,-10.39404584\n1997-08-13T13:30:00Z,93.6875,93.84375,91.46875,92.28125,6982301,-4.015121674\n1997-08-14T13:30:00Z,93.09375,93.3125,91.71875,92.625,3462700,-0.802428464\n1997-08-15T13:30:00Z,92.125,92.125,89.625,89.78125,4907102,-27.02656676\n1997-08-18T13:30:00Z,90.375,91.78125,89.34375,91.78125,5638898,8.753229974\n1997-08-19T13:30:00Z,92.21875,92.90625,91.53125,92.84375,3802800,7.03125\n1997-08-20T13:30:00Z,92.9375,94.3125,92.60937,94.25,3558200,10.95388336\n1997-08-21T13:30:00Z,94.125,94.25,92.09375,92.59375,5392602,-11.35760613\n1997-08-22T13:30:00Z,91,92.73437,90.5625,92.5625,7172898,1.824712096\n1997-08-25T13:30:00Z,92.78125,93.40625,91.84375,92.21875,3888000,-0.6328125\n1997-08-26T13:30:00Z,92,92.5625,90.70312,90.85937,4290000,-9.805722678\n1997-08-27T13:30:00Z,91,91.96875,90.40625,91.40625,5484301,1.744413262\n1997-08-28T13:30:00Z,91.1875,91.9375,90,90.01562,4287898,-8.081928879\n1997-08-29T13:30:00Z,90.125,91.10937,89.71875,90.375,2652300,0.777188506\n1997-09-02T13:30:00Z,90.6875,93.35937,90.59375,93.3125,7294000,27.38322879\n1997-09-03T13:30:00Z,93.29687,94,92.75,92.8125,2812500,-0.193705943\n1997-09-04T13:30:00Z,93.0625,93.71875,92.75,93.40625,2473700,3.34972472\n1997-09-05T13:30:00Z,93.96875,94.4375,92.59375,93.14062,3663300,-1.983198128\n1997-09-08T13:30:00Z,93.71875,94,93.3125,93.54687,803500,0.620545311\n1997-09-09T13:30:00Z,93.21875,94.28125,92.90625,93.59375,1885200,0.619581496\n1997-09-10T13:30:00Z,93.125,93.5,91.65625,91.65625,3623700,-15.73265256\n1997-09-11T13:30:00Z,91.78125,91.90625,90.25,91.1875,7055898,-4.920517616\n1997-09-12T13:30:00Z,92,92.96875,90.9375,92.65625,6708000,8.419438844\n1997-09-15T13:30:00Z,92.65625,93.3125,92.1875,92.5,2060500,-0.223721591\n1997-09-16T13:30:00Z,93.3125,95.28125,93.03125,94.8125,6979000,20.57231938\n1997-09-17T13:30:00Z,95.375,95.5,94.5,94.8125,2220000,0.29296875\n1997-09-18T13:30:00Z,95,96.375,94.96875,95.21875,5045398,2.253605769\n1997-09-19T13:30:00Z,94.65625,95.35937,94.40625,95.03125,1566400,0.275558538\n1997-09-22T13:30:00Z,95.5,96.20312,95.21875,95.5625,3259000,4.1015625\n1997-09-23T13:30:00Z,95.5625,95.70312,94.75,95.125,1872800,-3.358132252\n1997-09-24T13:30:00Z,95.375,96.10937,94.28125,94.34375,2793100,-4.465399628\n1997-09-25T13:30:00Z,94.25,94.75,93.625,93.6875,6327801,-3.883077331\n1997-09-26T13:30:00Z,94.4375,94.8125,94.1875,94.46875,3995800,4.543269231\n1997-09-29T13:30:00Z,94.5,95.5625,94.15625,95.375,2065000,6.533796616\n1997-09-30T13:30:00Z,95,95.6875,94.375,94.375,4137602,-4.464285714\n1997-10-01T13:30:00Z,95.25,95.8125,94.78125,95.625,3567500,8.277738764\n1997-10-02T13:30:00Z,95.53125,96.1875,95.3125,96.15625,2577500,3.402217742\n1997-10-03T13:30:00Z,97.46875,97.75,95.34375,96.64062,6499898,0.880663491\n1997-10-06T13:30:00Z,97.3125,97.60937,96.90625,97.28125,2272100,2.426435024\n1997-10-07T13:30:00Z,97.53125,98.5,97.20312,98.1875,1832800,7.161041045\n1997-10-08T13:30:00Z,98.35937,98.375,96.73437,97.5,4439398,-4.796561251\n1997-10-09T13:30:00Z,96.78125,97.60937,96.21875,97.15625,3607800,-1.850955198\n1997-10-10T13:30:00Z,96.3125,96.98437,96.25,96.875,2858100,0.580931076\n1997-10-13T13:30:00Z,97.34375,97.54687,96.71875,96.96875,1760300,0.203187541\n1997-10-14T13:30:00Z,97.46875,97.5,96.1875,97,2235700,-1.030815972\n1997-10-15T13:30:00Z,96.3125,97.0625,96.28125,96.78125,2601700,-0.5078125\n1997-10-16T13:30:00Z,97.3125,97.5,95,95.25,9488102,-10.40170243\n1997-10-17T13:30:00Z,95.01562,95.375,93,94.28125,8151301,-9.007589189\n1997-10-20T13:30:00Z,94.84375,95.75,94.15625,95.625,3636400,8.009541622\n1997-10-21T13:30:00Z,96.21875,97.5,96.03125,97.48437,5225398,16.86710774\n1997-10-22T13:30:00Z,97.34375,97.39062,96.53125,96.84375,4485199,-2.797692516\n1997-10-23T13:30:00Z,94.9375,95.75,94.28125,94.9375,8054102,-15.19730839\n1997-10-24T13:30:00Z,96.15625,96.15625,93.67187,94,6778699,-6.417686376\n1997-10-27T14:30:00Z,93.01562,93.9375,86.84375,87.1875,10840699,-59.90895903\n1997-10-28T14:30:00Z,84.375,92.875,84.375,92.21875,19548000,26.76126837\n1997-10-29T14:30:00Z,92.5,93.75,91.28125,91.96875,10184199,3.122588735\n1997-10-30T14:30:00Z,90.625,92.5625,89.75,89.9375,9772898,-11.80734002\n1997-10-31T14:30:00Z,91.8125,92.5,90.4375,92.0625,7072699,13.39671777\n1997-11-03T14:30:00Z,93.1875,94.375,92.875,94,5548500,17.66493056\n1997-11-04T14:30:00Z,93.875,94.4375,93.28125,94,3455700,0.877783764\n1997-11-05T14:30:00Z,94.1875,95.28125,93.84375,94.3125,4774898,2.214926862\n1997-11-06T14:30:00Z,94.03125,94.34375,93.5,93.95312,3679800,-2.131042411\n1997-11-07T14:30:00Z,92.375,93.25,91.4375,92.9375,10606801,-5.428360051\n1997-11-10T14:30:00Z,93.625,93.84375,92,92.375,4347898,-3.091166339\n1997-11-11T14:30:00Z,92.6875,93.0625,92.03125,92.40625,3212400,-1.349018895\n1997-11-12T14:30:00Z,91.625,92.71875,90.375,90.5,6775301,-13.35267496\n1997-11-13T14:30:00Z,91.46875,92.15625,90.09375,91.8125,8589602,5.313802083\n1997-11-14T14:30:00Z,92.3125,93.39062,91.60937,93.0625,5827898,9.037873431\n1997-11-17T14:30:00Z,94.375,95.3125,94.03125,94.78125,5149898,15.1875\n1997-11-18T14:30:00Z,94.8125,95.09375,93.89062,94.1875,3433600,-3.433178834\n1997-11-19T14:30:00Z,93.6875,95.0625,93.6875,94.65625,4387801,2.845982143\n1997-11-20T14:30:00Z,95.3125,96.53125,95.28125,96.09375,4822699,13.44358766\n1997-11-21T14:30:00Z,96.625,96.8125,95.65625,96.75,5436500,3.038069003\n1997-11-24T14:30:00Z,96,96.34375,94.625,95,4337199,-15.0875\n1997-11-25T14:30:00Z,95.625,95.8125,94.65625,95.25,4525000,-0.677083333\n1997-11-26T14:30:00Z,95.875,95.98437,95.3125,95.53125,2681100,0.089996888\n1997-11-28T14:30:00Z,95.75,96.25,95.59375,95.625,1564700,-0.317629419\n1997-12-01T14:30:00Z,96.21875,98.09375,96.03125,98.09375,4850898,22.67219388\n1997-12-02T14:30:00Z,97.6875,97.98437,97.25,97.5,1974900,-0.917121388\n1997-12-03T14:30:00Z,97.625,98.53125,96.875,97.78125,3302500,1.182626147\n1997-12-04T14:30:00Z,98.5,98.71875,97.375,97.6875,2872500,-1.953125\n1997-12-05T14:30:00Z,97.375,99,97.125,98.9375,3458800,7.216282895\n1997-12-08T14:30:00Z,98.96875,99,98.25,98.65625,2289200,-0.176583904\n1997-12-09T14:30:00Z,98.21875,98.59375,97.625,98.0625,1703000,-4.483695652\n1997-12-10T14:30:00Z,97.5625,97.84375,96.46875,97.21875,3558400,-6.896033654\n1997-12-11T14:30:00Z,96.3125,96.59375,95.3125,95.5625,5072801,-15.01726017\n1997-12-12T14:30:00Z,96.4375,96.5,94.90625,95.75,4478398,-1.130756579\n1997-12-15T14:30:00Z,96.25,97.10937,95.875,96.71875,4674699,5.965340786\n1997-12-16T14:30:00Z,97.21875,97.8125,96.875,97.3125,2885800,4.573006466\n1997-12-17T14:30:00Z,97.84375,97.875,96.70312,96.8125,2236300,-3.161394456\n1997-12-18T14:30:00Z,96.9375,96.9375,95.21875,95.875,4658301,-8.701056077\n1997-12-19T14:30:00Z,94.53125,95.875,92.375,94.78125,8556000,-7.170643154\n1997-12-22T14:30:00Z,95.4375,95.90625,94.5625,95.39062,5136801,3.24215\n1997-12-23T14:30:00Z,95.4375,95.625,93.53125,93.6875,4436500,-14.2945245\n1997-12-24T14:30:00Z,94.4375,94.4375,93.25,93.40625,2019200,-3.560697115\n1997-12-26T14:30:00Z,94.125,94.125,93.40625,93.78125,941800,-0.2515625\n1997-12-29T14:30:00Z,94.59375,95.71875,94.4375,95.625,2080000,16.23883929\n1997-12-30T14:30:00Z,95.9375,97.25,95.84375,97.125,3616000,13.46709802\n1997-12-31T14:30:00Z,96.875,97.625,96.6875,97.0625,4359500,0.830696203\n1998-01-02T14:30:00Z,97.3125,97.65625,96.53125,97.5625,2360900,2.127604167\n1998-01-05T14:30:00Z,97.84375,98.4375,96.78125,97.78125,4191801,0.795454545\n1998-01-06T14:30:00Z,97.25,97.28125,96.1875,96.21875,3154900,-15.34213362\n1998-01-07T14:30:00Z,96.09375,96.71875,95.21875,96.46875,4424199,0.638888889\n1998-01-08T14:30:00Z,96.3125,96.3125,95.375,95.625,3831000,-6.73965669\n1998-01-09T14:30:00Z,95.25,95.5,91.90625,92.3125,10258801,-30.07254464\n1998-01-12T14:30:00Z,91.125,94.1875,90.90625,94,12097898,6.976532101\n1998-01-13T14:30:00Z,94.625,95.375,94.21875,95.3125,5224898,10.28543307\n1998-01-14T14:30:00Z,95.6875,95.96875,94.71875,95.75,3770400,1.847956731\n1998-01-15T14:30:00Z,95.5,95.75,94.8125,94.95312,2875400,-6.483780738\n1998-01-16T14:30:00Z,96.25,96.6875,95.65625,96.3125,4374801,8.944991502\n1998-01-20T14:30:00Z,96.6875,98.01562,96.5,97.875,5091699,14.22682743\n1998-01-21T14:30:00Z,97.21875,97.6875,96.15625,96.9375,4699398,-4.366742886\n1998-01-22T14:30:00Z,96.15625,96.875,95.875,96.07812,4543398,-5.840027482\n1998-01-23T14:30:00Z,96.5,96.78125,95,95.9375,6350301,-1.651659984\n1998-01-26T14:30:00Z,96.375,96.73437,95.40625,95.875,4362898,-1.536523183\n1998-01-27T14:30:00Z,95.8125,97.5,95.65625,96.84375,7044199,7.01264881\n1998-01-28T14:30:00Z,97.40625,98.10937,97.1875,97.71875,4268602,7.544366783\n1998-01-29T14:30:00Z,97.84375,99.5625,97.5625,98.25,8007699,4.505404135\n1998-01-30T14:30:00Z,98.78125,98.96875,98,98.3125,3649100,-0.295107208\n1998-02-02T14:30:00Z,99.90625,100.5,99.75,99.9375,5756301,13.1330819\n1998-02-03T14:30:00Z,100,100.8125,99.71875,100.6875,2763000,5.46875\n1998-02-04T14:30:00Z,100.28125,101.15625,99.9375,100.5625,3374000,0.632022472\n1998-02-05T14:30:00Z,101.3125,101.59375,100.03125,100.5,5076199,-1.572779605\n1998-02-06T14:30:00Z,101,101.625,100.6875,101.625,5701199,7.03125\n1998-02-09T14:30:00Z,101.71875,101.75,100.71875,101.28125,2322200,-1.937705592\n1998-02-10T14:30:00Z,101.4375,102.46875,101.1875,102.25,3660400,6.754740169\n1998-02-11T14:30:00Z,102.09375,102.34375,101.70312,102.15625,4073200,0.569663291\n1998-02-12T14:30:00Z,101.71875,102.9375,100.875,102.59375,5024699,3.431919643\n1998-02-13T14:30:00Z,102.1875,102.51562,101.875,102,2101300,-2.343756522\n1998-02-17T14:30:00Z,102.8125,103.09375,102.15625,102.5,3055500,1.91004136\n1998-02-18T14:30:00Z,102.3125,103.48437,102.28125,103.4375,3007400,6.827592955\n1998-02-19T14:30:00Z,103.25,103.40625,102.75,102.89062,3387800,-2.007590164\n1998-02-20T14:30:00Z,103.07812,103.71875,102.375,103.65625,3707000,3.483468267\n1998-02-23T14:30:00Z,104.25,104.25,103.34375,104.0625,3227800,1.614053377\n1998-02-24T14:30:00Z,103.90625,104.09375,102.9375,103.25,3386800,-6.939935065\n1998-02-25T14:30:00Z,103.75,104.875,103.625,104.53125,3481800,9.561737805\n1998-02-26T14:30:00Z,104.4375,105.21875,104.1875,105.125,3187600,3.968451433\n1998-02-27T14:30:00Z,104.96875,105.53125,104.53125,105.125,3442900,0.791666667\n1998-03-02T14:30:00Z,105.25,105.75,104.625,104.90625,4252301,-1.179739933\n1998-03-03T14:30:00Z,104.53125,105.625,104.53125,105.5,3349200,3.778197434\n1998-03-04T14:30:00Z,105.09375,105.40625,104.4375,104.8125,4404102,-3.093458851\n1998-03-05T14:30:00Z,103.5,104.4375,103.15625,103.84375,7268000,-5.832606282\n1998-03-06T14:30:00Z,104.5625,105.9375,104.4375,105.9375,6896301,19.92754798\n1998-03-09T14:30:00Z,105.53125,106.21875,105.25,105.5625,3362800,-0.051153274\n1998-03-10T14:30:00Z,106.21875,106.84375,105.9375,106.5625,5481898,8.575742465\n1998-03-11T14:30:00Z,106.96875,107.3125,106.78125,107.0625,3439600,4.08266129\n1998-03-12T14:30:00Z,107.09375,107.59375,106.5,107.5,3191300,2.089707168\n1998-03-13T14:30:00Z,107.84375,108,106.875,107.09375,2879400,-2.164609873\n1998-03-16T14:30:00Z,107.84375,108.375,107.53125,108.25,3223600,7.507324219\n1998-03-17T14:30:00Z,108.3125,108.5625,107.65625,108.5625,4581898,1.984920058\n1998-03-18T14:30:00Z,108.25,108.96875,108.03125,108.96875,1944100,2.749633789\n1998-03-19T14:30:00Z,108.96875,109.375,108.65625,109.25,2554800,1.700067935\n1998-03-20T14:30:00Z,109.5625,110.1875,108.875,109.875,3123300,3.608315678\n1998-03-23T14:30:00Z,109.71875,110.3125,109.40625,109.625,4453102,-0.651041667\n1998-03-24T14:30:00Z,110.0625,110.8125,109.9375,110.5625,3333600,8.191550926\n1998-03-25T14:30:00Z,111.40625,111.53125,109.1875,110.15625,4597602,-3.154667722\n1998-03-26T14:30:00Z,109.875,110.75,109.625,110.09375,3333500,-0.685716712\n1998-03-27T14:30:00Z,110.75,110.78125,109,109.625,2611300,-3.636136968\n1998-03-30T14:30:00Z,109.625,110.09375,108.96875,109.5625,3108700,-1.09375\n1998-03-31T14:30:00Z,110.15625,111.1875,109.75,109.9375,5926500,1.641414141\n1998-04-01T14:30:00Z,110.3125,111.07812,109.40625,110.82812,2929000,4.516011523\n1998-04-02T14:30:00Z,110.9375,112.25,110.75,112.03125,3920900,10.25069199\n1998-04-03T14:30:00Z,112.34375,112.8125,111.84375,112.59375,3787600,3.777270047\n1998-04-06T13:30:00Z,113.25,113.375,111.6875,111.6875,4550500,-5.259486607\n1998-04-07T13:30:00Z,111.75,111.9375,110.15625,110.9375,5583699,-6.816265737\n1998-04-08T13:30:00Z,111.21875,111.28125,109.75,110.3125,4854801,-5.482826577\n1998-04-09T13:30:00Z,110.5625,111.28125,110.53125,111.1875,4481199,5.357745054\n1998-04-13T13:30:00Z,111.375,111.375,110,110.875,4350199,-1.969068878\n1998-04-14T13:30:00Z,111.125,111.8125,110.90625,111.8125,3279100,6.471548507\n1998-04-15T13:30:00Z,111.96875,112.125,111.15625,112.125,3867200,2.022688356\n1998-04-16T13:30:00Z,111.3125,111.5,110.5,110.8125,7177898,-11.44779624\n1998-04-17T13:30:00Z,110.71875,112.4375,110.4375,112.28125,5688801,10.15625\n1998-04-20T13:30:00Z,112,112.5625,111.875,112.25,3688300,1.140738225\n1998-04-21T13:30:00Z,112.4375,113.15625,111.90625,112.78125,4573199,3.304036458\n1998-04-22T13:30:00Z,112.875,113.4375,112.8125,113.09375,2386100,2.866683468\n1998-04-23T13:30:00Z,112.625,113,111.75,112,5062000,-8.3984375\n1998-04-24T13:30:00Z,111.75,112.46875,110.34375,110.8125,11039699,-8.22452911\n1998-04-27T13:30:00Z,109.375,109.6875,107.625,108.71875,14510199,-18.50665984\n1998-04-28T13:30:00Z,109.78125,109.8125,108.125,108.5625,6511398,-3.432390559\n1998-04-29T13:30:00Z,109.03125,109.96875,108.4375,109.3125,7703102,2.805019947\n1998-04-30T13:30:00Z,110.5625,111.92187,110.40625,111.34375,8684500,19.05657009\n1998-05-01T13:30:00Z,111.75,112.59375,111.3125,112.59375,4008800,9.879298942\n1998-05-04T13:30:00Z,112.71875,113.3125,112.15625,112.3125,4537199,-0.8984375\n1998-05-05T13:30:00Z,112,112.15625,111.125,111.53125,5146398,-6.847278226\n1998-05-06T13:30:00Z,112.125,112.125,110.1875,110.21875,5526102,-9.739632842\n1998-05-07T13:30:00Z,110.5,110.5625,109.34375,109.34375,6940398,-6.224798387\n1998-05-08T13:30:00Z,110,111.375,110,111.125,7951000,13.09359681\n1998-05-11T13:30:00Z,111.5625,112.21875,110.375,110.75,6336301,-1.608455882\n1998-05-12T13:30:00Z,110.8125,111.96875,110.34375,111.9375,6045199,6.4453125\n1998-05-13T13:30:00Z,112.0625,112.5625,111.59375,112.21875,4441500,2.001953125\n1998-05-14T13:30:00Z,111.53125,112.6875,111.34375,111.65625,4187500,-1.822916667\n1998-05-15T13:30:00Z,112,112.21875,110.8125,111.03125,6716102,-3.955078125\n1998-05-18T13:30:00Z,110.71875,111.59375,109.82812,110.59375,4847199,-2.779597893\n1998-05-19T13:30:00Z,111,111.6875,110.78125,111.34375,5918699,5.903764205\n1998-05-20T13:30:00Z,112.09375,112.5,110.875,112.40625,5716602,5.510666381\n1998-05-21T13:30:00Z,112.375,112.78125,111.3125,111.6875,6301500,-4.350142045\n1998-05-22T13:30:00Z,111.75,112.0625,110.9375,111.25,4862199,-3.106174699\n1998-05-26T13:30:00Z,112.09375,112.09375,109.1875,109.46875,6899301,-13.68798325\n1998-05-27T13:30:00Z,109.3125,109.90625,107.57812,109.625,10202602,-1.361053348\n1998-05-28T13:30:00Z,109.875,110.375,109.0625,110.125,4907602,2.37008427\n1998-05-29T13:30:00Z,110.625,110.8125,109.03125,109.03125,4772602,-6.778005826\n1998-06-01T13:30:00Z,108.96875,110.21875,108.5625,109.53125,6092199,1.382782795\n1998-06-02T13:30:00Z,110,110.34375,109.15625,109.625,6701102,0.179227941\n1998-06-03T13:30:00Z,109.875,110.1875,107.875,107.875,6445102,-12.92613636\n1998-06-04T13:30:00Z,108.25,110.0625,108.0625,109.875,6566301,12.18938253\n1998-06-05T13:30:00Z,110.375,112,109.875,112,8463199,17.54436728\n1998-06-08T13:30:00Z,111.9375,112.46875,111.65625,111.875,4159898,0.600961538\n1998-06-09T13:30:00Z,111.71875,112.42187,111.40625,112.21875,2725300,1.916125768\n1998-06-10T13:30:00Z,111.625,113.0625,111.25,111.5,6186898,-2.05078125\n1998-06-11T13:30:00Z,111.4375,111.875,109.375,109.40625,8056602,-16.47858796\n1998-06-12T13:30:00Z,109.875,110.4375,108.25,110.4375,9779000,2.157495471\n1998-06-15T13:30:00Z,108.8125,109.90625,107.5,107.53125,10234199,-22.23524306\n1998-06-16T13:30:00Z,108.40625,109.21875,107.75,109.1875,7471500,9.592013889\n1998-06-17T13:30:00Z,110.15625,111.78125,109.9375,111.46875,12057699,21.03749494\n1998-06-18T13:30:00Z,111.1875,111.4375,110.75,110.96875,3844600,-1.225142045\n1998-06-19T13:30:00Z,111.0625,111.23437,109.625,110.0625,3549100,-7.37329827\n1998-06-22T13:30:00Z,110.25,111.0625,110.0625,110.59375,5438301,2.265625\n1998-06-23T13:30:00Z,111.09375,112.0625,111,111.90625,5004602,12.25727059\n1998-06-24T13:30:00Z,112.15625,113.6875,111.60937,113.40625,8291898,11.36154402\n1998-06-25T13:30:00Z,113.90625,114.4375,112.8125,113.21875,5854801,-0.727696573\n1998-06-26T13:30:00Z,113.3125,113.84375,113.125,113.6875,4833102,2.124451754\n1998-06-29T13:30:00Z,114.25,114.6875,113.79687,114.09375,5953398,2.537587879\n1998-06-30T13:30:00Z,113.90625,114.1875,113.0625,113.3125,4284801,-6.185769715\n1998-07-01T13:30:00Z,114.0625,114.9375,113.625,114.625,3489500,9.076841787\n1998-07-02T13:30:00Z,114.71875,114.875,114.25,114.84375,3503900,1.291454082\n1998-07-06T13:30:00Z,114.78125,116,114.5625,116,3144400,8.841007314\n1998-07-07T13:30:00Z,115.98437,116.125,115.28125,115.78125,4920699,-0.061108418\n1998-07-08T13:30:00Z,115.875,116.9375,115.75,116.625,6875000,6.816235587\n1998-07-09T13:30:00Z,116.28125,116.71875,115.625,115.84375,6942500,-3.963414634\n1998-07-10T13:30:00Z,116.03125,116.9375,115.0625,116.46875,7849699,2.529835138\n1998-07-13T13:30:00Z,116.5625,116.84375,116.0625,116.5,6555102,0.311814693\n1998-07-14T13:30:00Z,116.9375,118.15625,116.9375,117.8125,6983602,12.35509073\n1998-07-15T13:30:00Z,118.0625,118.28125,117.53125,117.59375,4977500,-0.708795363\n1998-07-16T13:30:00Z,117.6875,118.59375,117.0625,118.40625,6315602,3.998815166\n1998-07-17T13:30:00Z,118.625,119,118.3125,118.5625,3539500,1.303842905\n1998-07-20T13:30:00Z,118.75,119.23437,117.9375,118.5625,2338400,-0.349933625\n1998-07-21T13:30:00Z,119,119,116.28125,116.5,5518602,-17.31881179\n1998-07-22T13:30:00Z,116.34375,116.98437,115.53125,116.5,10417301,-1.593342649\n1998-07-23T13:30:00Z,116.3125,116.59375,113.90625,114.1875,15110898,-19.83401236\n1998-07-24T13:30:00Z,114.96875,115.09375,112.875,114.09375,11540500,-3.169389205\n1998-07-27T13:30:00Z,113.625,115,112.84375,114.90625,9600000,4.060444079\n1998-07-28T13:30:00Z,114.4375,114.65625,111.875,112.96875,13693000,-13.80760064\n1998-07-29T13:30:00Z,113.71875,114.125,112.25,112.53125,7462398,-4.50715919\n1998-07-30T13:30:00Z,113.625,114.59375,113.40625,114.21875,6821602,11.31859756\n1998-07-31T13:30:00Z,114.34375,114.5,111.3125,111.78125,7680500,-19.44022614\n1998-08-03T13:30:00Z,111.78125,112.42187,111.03125,111.3125,10486500,-3.100969172\n1998-08-04T13:30:00Z,112.21875,112.21875,107,107,15091602,-35.55602581\n1998-08-05T13:30:00Z,107.9375,108.875,105.59375,108.46875,21718400,1.098008944\n1998-08-06T13:30:00Z,108.125,109.5,107.5625,108.9375,13084398,3.137529481\n1998-08-07T13:30:00Z,109.6875,110.59375,108.46875,109.125,12083801,0.486315017\n1998-08-10T13:30:00Z,108.75,109.65625,108.1875,108.5,6273000,-3.242566748\n1998-08-11T13:30:00Z,106.78125,107.4375,105.5,106.875,14287102,-12.15277778\n1998-08-12T13:30:00Z,107.75,108.875,107.5,108.6875,11158398,16.83789954\n1998-08-13T13:30:00Z,108.8125,109.65625,107.375,107.375,9073898,-5.859375\n1998-08-14T13:30:00Z,108.34375,108.71875,105.78125,106.125,8628500,-8.21423282\n1998-08-17T13:30:00Z,106,108.9375,105.5,108.375,11290000,12.69340142\n1998-08-18T13:30:00Z,109,110.59375,108.78125,110.375,7603898,17.43778069\n1998-08-19T13:30:00Z,111.09375,111.09375,109.625,110.09375,6258602,-1.131465517\n1998-08-20T13:30:00Z,109.6875,110.40625,109.15625,109.4375,7402801,-4.028320313\n1998-08-21T13:30:00Z,108.1875,108.71875,105.5,108.5625,16685398,-5.069742489\n1998-08-24T13:30:00Z,109.25,109.9375,108.3125,109.25,7201699,3.90625\n1998-08-25T13:30:00Z,110.375,111.25,108.64062,109.5,9688301,-0.898201872\n1998-08-26T13:30:00Z,108.28125,109.625,107.75,108.875,9339699,-2.856809701\n1998-08-27T13:30:00Z,107,107.5625,103.46875,103.75,24887808,-45.5370938\n1998-08-28T13:30:00Z,104.96875,105.71875,102.15625,103.375,23735904,-5.581054688\n1998-08-31T13:30:00Z,103.75,104.01562,95,96,22563104,-64.76728025\n1998-09-01T13:30:00Z,96.0625,100.5625,93.625,100.0625,24748496,13.2537412\n1998-09-02T13:30:00Z,99.8125,101.75,98.78125,99.34375,13843199,0.12456939\n1998-09-03T13:30:00Z,97.625,99.375,96.75,98.5625,17311296,-2.540175392\n1998-09-04T13:30:00Z,99.4375,99.8125,95.75,97.75,17783808,-5.816761364\n1998-09-08T13:30:00Z,100.875,103,99.8125,103,14746500,41.65088384\n1998-09-09T13:30:00Z,102.75,103.125,100.4375,100.5,12109699,-15.39365898\n1998-09-10T13:30:00Z,98.4375,99.34375,96.8125,98.5,19889296,-15.88763298\n1998-09-11T13:30:00Z,98.1875,101.6875,97,101.6875,20379808,20.9808451\n1998-09-14T13:30:00Z,102.875,104.45312,102.09375,103.4375,10686801,14.61380876\n1998-09-15T13:30:00Z,102.875,104.3125,102.28125,104.0625,8337898,4.52310027\n1998-09-16T13:30:00Z,104.75,105.25,103.15625,105,11024898,4.220281863\n1998-09-17T13:30:00Z,102.25,103.03125,101.78125,102,12945199,-26.82291667\n1998-09-18T13:30:00Z,102.375,102.40625,101.09375,102.09375,7019199,-0.450550426\n1998-09-21T13:30:00Z,99.625,103.40625,98.9375,102.03125,8834602,4.651530228\n1998-09-22T13:30:00Z,103.5,103.65625,102.15625,102.875,7270102,5.316448556\n1998-09-23T13:30:00Z,103.875,107,103.78125,107,13688500,37.25127551\n1998-09-24T13:30:00Z,106.3125,106.8125,103.25,104.375,11129500,-14.85475352\n1998-09-25T13:30:00Z,103.125,105.42187,102.625,104.25,10247398,-0.156250238\n1998-09-28T13:30:00Z,105.3125,106.3125,104.25,105.1875,8847801,6.359375\n1998-09-29T13:30:00Z,105.375,105.9375,103.375,104.9375,10618102,-2.18373494\n1998-09-30T13:30:00Z,103.5,104.3125,101.375,101.75,7908398,-27.65079942\n1998-10-01T13:30:00Z,100.03125,101.54687,98.09375,98.8125,13335602,-22.80685748\n1998-10-02T13:30:00Z,98.875,100.875,97.21875,100.71875,14351801,8.212370562\n1998-10-05T13:30:00Z,99.59375,99.96875,96.34375,98.6875,12807199,-12.40285683\n1998-10-06T13:30:00Z,100.75,101.28125,97.53125,98.59375,12621000,-5.700899435\n1998-10-07T13:30:00Z,98.625,100.03125,95.75,97.125,14348500,-10.16859552\n1998-10-08T13:30:00Z,94.5625,96.75,92.21875,96.59375,20625008,0.65843079\n1998-10-09T13:30:00Z,97,98.78125,94.0625,98.53125,12708500,9.719205437\n1998-10-12T13:30:00Z,100.625,101.4375,99.6875,99.96875,9508500,9.998086275\n1998-10-13T13:30:00Z,99.5625,100.40625,98.75,99.625,6256801,-1.994199303\n1998-10-14T13:30:00Z,98.9375,101.8125,98.84375,100.5625,8176898,8.088596204\n1998-10-15T13:30:00Z,100.125,107.25,99.9375,105.96875,20541104,47.29646382\n1998-10-16T13:30:00Z,106.125,106.75,105,106,16573898,2.695882755\n1998-10-19T13:30:00Z,105.6875,106.8125,105.5,106.375,7915898,2.598110465\n1998-10-20T13:30:00Z,107.5625,108.79687,106.09375,107,14611602,2.714736719\n1998-10-21T13:30:00Z,106.875,107.625,105.875,106.625,9178398,-2.382489669\n1998-10-22T13:30:00Z,106.78125,108.46875,106.15625,108.21875,8277500,10.91694079\n1998-10-23T13:30:00Z,107.96875,108,106.78125,106.84375,6237199,-8.402054398\n1998-10-26T14:30:00Z,107.71875,108.46875,106.78125,107.625,5838602,2.337549603\n1998-10-27T14:30:00Z,108.4375,108.96875,106.28125,107,10089699,-4.235523235\n1998-10-28T14:30:00Z,106.5625,107.53125,106.03125,106.8125,5650602,-1.373752626\n1998-10-29T14:30:00Z,107.09375,109.4375,106.625,109.40625,9625602,21.75611413\n1998-10-30T14:30:00Z,110.125,110.90625,109.5,110,9872801,5.120192308\n1998-11-02T14:30:00Z,110.8125,111.875,110.1875,111.875,6501398,15.35560345\n1998-11-03T14:30:00Z,111.59375,111.8125,110.75,111.0625,6866000,-4.202586207\n1998-11-04T14:30:00Z,112.46875,113.09375,111.09375,112.25,8233602,5.5859375\n1998-11-05T14:30:00Z,111.53125,113.9375,111.125,113.78125,6841500,9.569780313\n1998-11-06T14:30:00Z,113.46875,114.5625,113.3125,114.125,5224801,3.325363685\n1998-11-09T14:30:00Z,113.9375,114.25,112.5,113.3125,6188699,-5.098852041\n1998-11-10T14:30:00Z,113,113.9375,112.25,113,14015199,-1.688294492\n1998-11-11T14:30:00Z,113.8125,114,111.89062,112.25,10922398,-5.033286217\n1998-11-12T14:30:00Z,112.3125,113.125,111.6875,112.125,5457398,-1.822916667\n1998-11-13T14:30:00Z,112.21875,113.21875,112.125,113.21875,5524602,9.270654966\n1998-11-16T14:30:00Z,114.21875,114.35937,112.89062,114.0625,6023699,4.212517045\n1998-11-17T14:30:00Z,113.65625,115.625,113,114.0625,9058898,0.601402126\n1998-11-18T14:30:00Z,114.3125,115,113.5,114.75,4567699,3.687118902\n1998-11-19T14:30:00Z,115.28125,115.90625,114.625,115.75,5249301,6.982970506\n1998-11-20T14:30:00Z,116.35937,116.75,115.84375,116.625,5562000,6.569357664\n1998-11-23T14:30:00Z,117.46875,119.625,117.15625,119.375,7151301,25.23535275\n1998-11-24T14:30:00Z,119,119.65625,118.45312,118.625,5323699,-1.581126689\n1998-11-25T14:30:00Z,118.9375,119.1875,118.21875,118.625,4393500,-0.827205882\n1998-11-27T14:30:00Z,119.46875,119.71875,119.01562,119.5,4557898,5.68748544\n1998-11-30T14:30:00Z,119.01562,119.375,116.125,116.125,8705398,-30.57351353\n1998-12-01T14:30:00Z,116.125,118.03125,115.21875,117.625,8950602,5.147407621\n1998-12-02T14:30:00Z,117.21875,117.90625,116,117.28125,7495500,0.278253425\n1998-12-03T14:30:00Z,117.25,118.3125,115.09375,115.34375,12145301,-12.15277778\n1998-12-04T14:30:00Z,116.625,118.5,116.5,118.375,10007199,22.14823769\n1998-12-07T14:30:00Z,118.0625,119.46875,118,118.9375,4290000,5.154969262\n1998-12-08T14:30:00Z,118.53125,119.75,117.5,118.40625,10102602,-1.36471519\n1998-12-09T14:30:00Z,118.6875,118.96875,117.875,118.625,5327898,0.48828125\n1998-12-10T14:30:00Z,118.84375,118.84375,116.71875,116.89062,5966602,-15.17525274\n1998-12-11T14:30:00Z,116.4375,117.34375,115.5625,117.125,8198199,0.328614653\n1998-12-14T14:30:00Z,116.15625,116.40625,113.75,113.75,9521398,-29.15900735\n1998-12-15T14:30:00Z,114.6875,116.75,114.53125,116.6875,9631500,19.47992701\n1998-12-16T14:30:00Z,117.125,117.125,115.75,116.53125,7260000,0.146484375\n1998-12-17T14:30:00Z,117.21875,118.59375,117.03125,118.39062,6914699,15.09892978\n1998-12-18T14:30:00Z,118.3125,119.125,117.875,118.5,4802398,1.475744313\n1998-12-21T14:30:00Z,119.25,121.34375,119,120.15625,8580699,14.51322115\n1998-12-22T14:30:00Z,120.40625,121.21875,119.1875,120.6875,5461102,2.642463235\n1998-12-23T14:30:00Z,121.1875,123.21875,120.8125,123.21875,7791000,22.53786058\n1998-12-24T14:30:00Z,123.15625,123.25,122.5,122.6875,1507100,-0.920758929\n1998-12-28T14:30:00Z,123.25,123.3125,122,122.375,4203602,-2.60630123\n1998-12-29T14:30:00Z,122.71875,124.48437,122.125,124.3125,3935800,12.86398593\n1998-12-30T14:30:00Z,123.9375,124.75,123.03125,123.3125,6810699,-3.457247463\n1998-12-31T14:30:00Z,123.3125,123.9375,122.46875,123.3125,6790500,-0.507061298\n1999-01-04T14:30:00Z,123.375,125.21875,121.71875,123.03125,9450398,-1.542445592\n1999-01-05T14:30:00Z,122.9375,124.875,122.9375,124.4375,8031000,11.79038972\n1999-01-06T14:30:00Z,125.8125,127.75,125.75,127.4375,7737699,28.6001933\n1999-01-07T14:30:00Z,126.375,127.21875,125.78125,126.8125,5504898,0\n1999-01-08T14:30:00Z,128.1875,128.29687,126.1875,127.75,6221898,3.462666694\n1999-01-11T14:30:00Z,127.6875,127.6875,125.21875,126.53125,7578301,-11.55735404\n1999-01-12T14:30:00Z,126.21875,126.21875,123.75,124.25,7768801,-21.20423509\n1999-01-13T14:30:00Z,120.40625,125.125,120.375,123.375,10810602,0.541402757\n1999-01-14T14:30:00Z,123.625,123.90625,120.90625,121.21875,11400699,-10.79111756\n1999-01-15T14:30:00Z,122.375,124.40625,122.0625,124.375,7812699,21.03121375\n1999-01-19T14:30:00Z,125.29687,125.625,123.5,125.1875,6535102,3.743497024\n1999-01-20T14:30:00Z,126.09375,127.9375,125.03125,126.1875,6534398,5.973295488\n1999-01-21T14:30:00Z,125.57812,125.84375,122.59375,122.84375,6937500,-30.55908234\n1999-01-22T14:30:00Z,122.125,123.84375,121.78125,122.5625,7522301,-1.804207436\n1999-01-25T14:30:00Z,123.28125,124,121.90625,123.8125,5700301,6.62677305\n1999-01-26T14:30:00Z,124.125,126.0625,123.625,126.0625,6047000,18.33681611\n1999-01-27T14:30:00Z,126.375,126.625,124.15625,124.59375,7399398,-7.564484127\n1999-01-28T14:30:00Z,125.25,126.96875,125.1875,126.6875,5961699,13.92463235\n1999-01-29T14:30:00Z,127.34375,128.29687,125.40625,127.65625,6456801,4.594062056\n1999-02-01T14:30:00Z,128.6875,128.6875,126.90625,126.90625,9426801,-5.416228992\n1999-02-02T14:30:00Z,127.07812,127.21875,124.76562,126.125,9194500,-7.861452998\n1999-02-03T14:30:00Z,125.6875,127.9375,125.65625,127.40625,10290699,8.553183313\n1999-02-04T14:30:00Z,127.375,127.5,124.78125,125.5,7761102,-12.57948201\n1999-02-05T14:30:00Z,125.65625,125.65625,123.21875,124.0625,7516102,-13.26129872\n1999-02-08T14:30:00Z,125.09375,125.09375,123.34375,124.3125,8528398,-1.6171875\n1999-02-09T14:30:00Z,124.375,124.5,121.51562,121.53125,8985699,-24.18060448\n1999-02-10T14:30:00Z,122.125,123,121.32812,122.3125,6936699,0.632042731\n1999-02-11T14:30:00Z,123.0625,126.09375,122.5,125.125,9181801,24.62163311\n1999-02-12T14:30:00Z,124.8125,125.5,122.625,123.625,10676602,-7.272465438\n1999-02-16T14:30:00Z,124.75,125.625,122.875,122.875,6915500,-8.141025641\n1999-02-17T14:30:00Z,123.1875,125.35937,122.25,122.75,7858102,-3.525857547\n1999-02-18T14:30:00Z,123.1875,124.375,122.21875,123.71875,9048898,5.043103448\n1999-02-19T14:30:00Z,124,125.75,123.375,124.25,5312199,3.994475273\n1999-02-22T14:30:00Z,124.4375,127.71875,124.28125,127.5625,10695801,30.44791667\n1999-02-23T14:30:00Z,127.59375,128.5,126.59375,127.5,7770699,1.513671875\n1999-02-24T14:30:00Z,127.84375,128.84375,125,125.25,7271000,-14.42550505\n1999-02-25T14:30:00Z,124.53125,125.28125,122.6875,124.0625,11633000,-10.22684488\n1999-02-26T14:30:00Z,124.75,124.84375,122.8125,123.5625,9621301,-4.403409091\n1999-03-01T14:30:00Z,123.65625,124.3125,122.375,123.90625,7607199,0.570913462\n1999-03-02T14:30:00Z,124.5,125.3125,122.3125,122.8125,9651500,-6.098533163\n1999-03-03T14:30:00Z,123.09375,123.5625,121.78125,123.46875,7881398,1.234208777\n1999-03-04T14:30:00Z,124.0625,125.48437,123.26562,125.03125,8256398,11.66131503\n1999-03-05T14:30:00Z,127.5,128.125,126.5625,127.54687,10703102,20.92272093\n1999-03-08T14:30:00Z,128.28125,128.79687,127.25,128.375,4802199,4.444742134\n1999-03-09T14:30:00Z,128.125,129.9375,127.75,128.0625,7893398,-1.414807862\n1999-03-10T14:30:00Z,128.46875,129.25,127.78125,129.1875,3960100,7.34375\n1999-03-11T14:30:00Z,129.6875,131.1875,128.875,130.625,6583699,10.46238245\n1999-03-12T14:30:00Z,131,131.03125,129.21875,129.375,5286500,-7.849773378\n1999-03-15T14:30:00Z,129.9375,131.25,129.5,131.21875,5394398,10.97601232\n1999-03-16T14:30:00Z,131.125,131.65625,130.46875,130.71875,4547500,-1.190090674\n1999-03-17T14:30:00Z,130.6875,130.9375,129.625,130.15625,4524102,-4.494345649\n1999-03-18T14:30:00Z,129.78125,132.375,129.75,132.25,3506300,16.06708127\n1999-03-19T14:30:00Z,132.3125,132.625,129.6875,129.6875,5526699,-14.67805632\n1999-03-22T14:30:00Z,130.0625,130.59375,129.42187,129.9375,4603801,-1.452319746\n1999-03-23T14:30:00Z,129.3125,129.53125,125.70312,126.1875,9713801,-34.81144658\n1999-03-24T14:30:00Z,126.84375,127.17187,125.625,126.90625,6280898,-0.082581553\n1999-03-25T14:30:00Z,128.0625,129.5,127.75,129.5,6639602,24.66378348\n1999-03-26T14:30:00Z,128.625,129.125,127.71875,128.5625,6159699,-3.4734375\n1999-03-29T14:30:00Z,129.15625,131.4375,129.15625,131.15625,5863898,24.78821536\n1999-03-30T14:30:00Z,129.9375,131.21875,129.5625,130.46875,5401398,0.360903533\n1999-03-31T14:30:00Z,131.15625,131.60937,128.3125,128.375,7413602,-13.1695985\n1999-04-01T14:30:00Z,129.6875,129.6875,128.125,129.34375,7683602,0.368998702\n1999-04-05T13:30:00Z,130.9375,132.59375,130.25,132.40625,5791102,26.1475271\n1999-04-06T13:30:00Z,132.1875,132.98437,131.15625,132.09375,5381301,0.027802554\n1999-04-07T13:30:00Z,132.6875,133.375,131.375,133.15625,6248602,5.039665782\n1999-04-08T13:30:00Z,133.1875,134.9375,132.28125,134.84375,5909102,10.56833187\n1999-04-09T13:30:00Z,134.4375,135.5,133.59375,134.875,4365801,2.235900673\n1999-04-12T13:30:00Z,133.46875,136.40625,133.21875,136.3125,8213199,9.321312204\n1999-04-13T13:30:00Z,136.25,136.46875,134.5,135.4375,10071398,-2.410942055\n1999-04-14T13:30:00Z,136.0625,136.0625,132.6875,133.15625,11551699,-18.91375546\n1999-04-15T13:30:00Z,133.4375,133.5625,131,132.65625,11150000,-6.626243319\n1999-04-16T13:30:00Z,132.90625,132.90625,131.1875,131.53125,6476199,-9.629304847\n1999-04-19T13:30:00Z,132.6875,134.53125,128.375,129.5,12487199,-12.04458383\n1999-04-20T13:30:00Z,129.8125,131.1875,129,131.125,9049602,5.24582788\n1999-04-21T13:30:00Z,131.0625,135.625,130.40625,134.875,5772199,30.34330986\n1999-04-22T13:30:00Z,135.125,136.375,134.39062,136.15625,6897398,8.776580806\n1999-04-23T13:30:00Z,135.875,136.75,135,135.8125,4593102,-0.421783804\n1999-04-26T13:30:00Z,136.5,136.8125,135.46875,136.59375,3606500,3.735632184\n1999-04-27T13:30:00Z,137.125,137.5,135.84375,137.25,5147199,2.502725291\n1999-04-28T13:30:00Z,136.4375,137.25,135,135.375,5544301,-14.64041096\n1999-04-29T13:30:00Z,135.5625,136.0625,133.8125,134.34375,9824301,-7.40003882\n1999-04-30T13:30:00Z,135.09375,135.625,131.5,133.25,10991898,-9.309895833\n1999-05-03T13:30:00Z,133.4375,135.84375,133.09375,135.6875,10709699,15.65874012\n1999-05-04T13:30:00Z,135.125,135.8125,133.125,133.75,10509301,-10.16376202\n1999-05-05T13:30:00Z,133.9375,135.0625,131.84375,134.8125,10032301,3.866844846\n1999-05-06T13:30:00Z,134.4375,135.125,132.375,133.98437,13507199,-4.289717763\n1999-05-07T13:30:00Z,134.5,135.125,133.4375,135,8680699,4.561913116\n1999-05-10T13:30:00Z,134.84375,135.71875,133.53125,134.32812,5580102,-3.194312922\n1999-05-11T13:30:00Z,135.3125,136.875,134.71875,135.6875,7000602,9.099591411\n1999-05-12T13:30:00Z,135.75,137.21875,131.5,136.75,13865801,7.457577285\n1999-05-13T13:30:00Z,137.25,138,136.8125,137.34375,4485699,4.737367021\n1999-05-14T13:30:00Z,134.5625,135.875,133.5,133.78125,8370102,-30.13413731\n1999-05-17T13:30:00Z,133.625,134.48437,132.375,134.1875,6268102,1.876990301\n1999-05-18T13:30:00Z,134.53125,134.98437,132.625,133.9375,8218602,-1.586917236\n1999-05-19T13:30:00Z,134.46875,135,133.25,134.90625,5052398,3.634580761\n1999-05-20T13:30:00Z,135.125,135.59375,130.0625,134.09375,4675398,-6.541075139\n1999-05-21T13:30:00Z,134.125,134.6875,132.59375,133.34375,6414602,-5.575166113\n1999-05-24T13:30:00Z,133.84375,133.84375,130.39062,131.125,7952000,-19.08939822\n1999-05-25T13:30:00Z,131.375,132.34375,128.4375,129,15406398,-14.62215183\n1999-05-26T13:30:00Z,129.3125,131,128.09375,130.4375,12575898,5.022321429\n1999-05-27T13:30:00Z,129.84375,130.28125,128,128.5625,14515398,-12.890625\n1999-05-28T13:30:00Z,129,130.75,128.59375,130.20312,8748000,10.54316027\n1999-06-01T13:30:00Z,130.125,130.15625,128.375,129.75,6705301,-1.844213454\n1999-06-02T13:30:00Z,129.75,130.1875,128.01562,129.875,6981898,0.448545562\n1999-06-03T13:30:00Z,130.6875,130.875,129.78125,130.59375,6076602,3.90625\n1999-06-04T13:30:00Z,131.46875,133.35937,130.9375,133.21875,9787199,22.96088155\n1999-06-07T13:30:00Z,133.4375,134.1875,132.90625,133.5625,5299102,2.972301136\n1999-06-08T13:30:00Z,133.375,133.79687,131.59375,132.25,4895699,-10.15354108\n1999-06-09T13:30:00Z,132.40625,133.09375,131.8125,132.125,7409699,-1.845703125\n1999-06-10T13:30:00Z,131.4375,131.46875,129.59375,130.90625,7040699,-10.81870168\n1999-06-11T13:30:00Z,131.21875,131.73437,129.09375,129.8125,12824301,-7.881836393\n1999-06-14T13:30:00Z,130.6875,130.75,129.54687,129.9375,6823500,-2.26718806\n1999-06-15T13:30:00Z,130.46875,131.65625,130.07812,130.8125,5700898,5.028251132\n1999-06-16T13:30:00Z,132.375,133.875,132.375,133.3125,7865801,24.6996184\n1999-06-17T13:30:00Z,132.875,135.5625,132.625,134.5625,8162801,10.32173645\n1999-06-18T13:30:00Z,134.0625,134.6875,133.375,134.3125,2875100,1.270411036\n1999-06-21T13:30:00Z,134.46875,135.25,133.65625,134.625,4646398,1.603036557\n1999-06-22T13:30:00Z,134,135.1875,133.5,133.6875,5862398,-4.295107466\n1999-06-23T13:30:00Z,133,133.625,132.125,133.03125,9629199,-4.361347087\n1999-06-24T13:30:00Z,132.875,132.9375,130.65625,132.03125,9176898,-8.985681438\n1999-06-25T13:30:00Z,132.59375,133.01562,131.25,131.70312,4087000,-3.064028625\n1999-06-28T13:30:00Z,132.6875,133.625,132.5,133.3125,5028898,11.68928761\n1999-06-29T13:30:00Z,133,135.1875,132.78125,134.5625,6956199,10.00381098\n1999-06-30T13:30:00Z,134.625,137.5,133.84375,137,16856096,18.21760376\n1999-07-01T13:30:00Z,137,138.5,136.0625,138.03125,9939500,6.620489691\n1999-07-02T13:30:00Z,138.125,139.5,137.90625,139.40625,3772800,11.27126187\n1999-07-06T13:30:00Z,139.25,140.75,138.59375,139.375,11221102,1.192207216\n1999-07-07T13:30:00Z,139.0625,139.71875,138.51562,139.5625,3230700,2.03965946\n1999-07-08T13:30:00Z,139.0625,140.625,138.75,139.67187,7101500,1.789831055\n1999-07-09T13:30:00Z,140,140.59375,139.5625,140.5,2934700,5.9899627\n1999-07-12T13:30:00Z,140.9375,140.9375,139.5,139.875,4436301,-4.125\n1999-07-13T13:30:00Z,139.375,139.92187,138.65625,139.375,6477602,-3.808606186\n1999-07-14T13:30:00Z,140,140.21875,138.75,140.15625,4382500,3.085521941\n1999-07-15T13:30:00Z,140.78125,141.375,140.3125,141.04687,3348600,6.860464818\n1999-07-16T13:30:00Z,141.25,142.15625,140.75,141.8125,2281500,5.241621906\n1999-07-19T13:30:00Z,142.1875,142.25,140.5625,140.875,4287000,-6.209935897\n1999-07-20T13:30:00Z,140.125,140.40625,137.53125,137.98437,7060102,-26.07559602\n1999-07-21T13:30:00Z,138.09375,138.90625,137.3125,137.82812,4793699,-2.230704711\n1999-07-22T13:30:00Z,137.4375,138,135.46875,136.01562,7804102,-14.70172765\n1999-07-23T13:30:00Z,136.65625,137,135.125,135.75,4603000,-2.963040754\n1999-07-26T13:30:00Z,134.875,136.125,134.625,134.75,4333398,-5.249575792\n1999-07-27T13:30:00Z,136,137.20312,135.375,135.875,5908500,7.279959206\n1999-07-28T13:30:00Z,136.25,137.3125,135.59375,136.3125,3955500,2.24609375\n1999-07-29T13:30:00Z,134.9375,135.25,133.3125,134.40625,7760602,-16.27358491\n1999-07-30T13:30:00Z,134.8125,135.34375,132.5625,132.75,5994301,-11.15271029\n1999-08-02T13:30:00Z,132.75,134.75,132.5,133.0625,6065500,-0.211864407\n1999-08-03T13:30:00Z,133.71875,133.84375,131.375,132.4375,5445398,-4.91756135\n1999-08-04T13:30:00Z,132.71875,133.875,130.4375,130.625,6497898,-10.57692308\n1999-08-05T13:30:00Z,130.875,131.9375,128.84375,131.8125,10322000,3.486517954\n1999-08-06T13:30:00Z,131.21875,132,129.5,130.375,7537699,-8.589285714\n1999-08-09T13:30:00Z,130.59375,131.79687,129.75,130.09375,5565898,-2.921235924\n1999-08-10T13:30:00Z,129.875,130.15625,127,128.65625,9793301,-12.79854911\n1999-08-11T13:30:00Z,129.6875,130.53125,128.625,130.21875,8003398,8.074757067\n1999-08-12T13:30:00Z,130.6875,131.8125,129.90625,130.14062,7036801,-1.06864296\n1999-08-13T13:30:00Z,131.625,133.25,131.125,133.15625,5857699,25.71853346\n1999-08-16T13:30:00Z,133.125,133.96875,132.25,133.75,3927000,3.47423908\n1999-08-17T13:30:00Z,134.4375,134.84375,133.125,134.625,4808000,4.1015625\n1999-08-18T13:30:00Z,134.20312,134.375,133.25,133.65625,4355500,-7.920728916\n1999-08-19T13:30:00Z,132.375,133.23437,131.6875,132.5625,6448102,-7.382818995\n1999-08-20T13:30:00Z,133.0625,134.125,132.6875,133.90625,3663700,11.44255051\n1999-08-23T13:30:00Z,134.8125,136.54687,134.65625,136.46875,5637801,24.00095185\n1999-08-24T13:30:00Z,136.0625,137.96875,135.375,136.96875,9279500,4.261363636\n1999-08-25T13:30:00Z,137.1875,138.78125,136.15625,138.375,6005301,8.845248288\n1999-08-26T13:30:00Z,138.28125,138.42187,136.5,136.71875,4322301,-11.30614344\n1999-08-27T13:30:00Z,136.875,137.0625,135.0625,135.0625,6247398,-12.78722426\n1999-08-30T13:30:00Z,135.34375,135.5,132,132.5625,4652000,-21.03199111\n1999-08-31T13:30:00Z,132.9375,133.75,130.875,132.0625,11453699,-4.823406729\n1999-09-01T13:30:00Z,132.9375,133.73437,132.3125,133.6875,6863898,10.54168804\n1999-09-02T13:30:00Z,132.125,132.67187,130.65625,132.10937,10896301,-9.773003609\n1999-09-03T13:30:00Z,134.875,136.5,134.6875,135.96875,9160801,38.9012441\n1999-09-07T13:30:00Z,136.0625,136.625,135.21875,135.46875,4560801,-1.460755814\n1999-09-08T13:30:00Z,134.84375,136.0625,134.03125,134.8125,6159602,-3.381216398\n1999-09-09T13:30:00Z,134.75,135.25,133.6875,134.75,6177801,-0.31483209\n1999-09-10T13:30:00Z,136.25,136.35937,134.9375,135.875,2934500,6.221811763\n1999-09-13T13:30:00Z,135.125,135.46875,134.5,134.95312,2320500,-7.479796296\n1999-09-14T13:30:00Z,134.0625,134.5625,133.375,134.0625,3736000,-6.458381775\n1999-09-15T13:30:00Z,135.4375,135.4375,131.875,131.9375,6984500,-14.87116228\n1999-09-16T13:30:00Z,132.5,132.8125,130.3125,132.45312,15377602,-1.15200463\n1999-09-17T13:30:00Z,132.625,133.9375,132.15625,133.75,8542301,9.560357782\n1999-09-20T13:30:00Z,133.9375,134,133.09375,133.5625,2803900,-0.323807566\n1999-09-21T13:30:00Z,132.25,132.46875,130.15625,130.75,9335199,-26.3578869\n1999-09-22T13:30:00Z,131.25,131.84375,129.75,130.60156,13009102,-2.34715981\n1999-09-23T13:30:00Z,131.8125,131.8125,127.625,127.875,12204199,-20.77542882\n1999-09-24T13:30:00Z,127.75,128.375,126.3125,127.75,13792898,-3.555689103\n1999-09-27T13:30:00Z,128.75,129.75,128.28125,128.59375,6970301,5.518018018\n1999-09-28T13:30:00Z,127.9375,128.8125,125.5625,128.34375,11063398,-0.495008165\n1999-09-29T13:30:00Z,128.4375,129.125,126.75,126.8125,7580301,-9.018262027\n1999-09-30T13:30:00Z,127.4375,129.4375,126.96875,128.75,7498898,12.15277778\n1999-10-01T13:30:00Z,127.9375,128.5625,126.625,128.46875,11127102,1.75910596\n1999-10-04T13:30:00Z,129.1875,130.875,128.75,130.75,6341602,20.03575428\n1999-10-05T13:30:00Z,130.71875,131.96875,128.6875,130.625,11976000,0.767952128\n1999-10-06T13:30:00Z,130.75,132.8125,130.6875,132.625,10308199,18.2781698\n1999-10-07T13:30:00Z,132.85937,133,131.5,131.875,6535602,-2.762267857\n1999-10-08T13:30:00Z,131.75,133.875,131.23437,133.875,9674301,12.19552408\n1999-10-11T13:30:00Z,133.59375,134.125,133.3125,133.65625,4282000,0.89934593\n1999-10-12T13:30:00Z,133.125,133.3125,131.1875,131.59375,8686102,-18.76583615\n1999-10-13T13:30:00Z,130.6875,131.3125,128.1875,128.1875,10469301,-29.40352315\n1999-10-14T13:30:00Z,128.48437,129.1875,126.75,128.15625,10562199,-2.406521684\n1999-10-15T13:30:00Z,126,126.75,124.5,124.875,14238699,-29.55704306\n1999-10-18T13:30:00Z,124.9375,125.9375,123.4375,125.78125,9758801,3.381759129\n1999-10-19T13:30:00Z,127.1875,128.25,125.9375,127,14392898,7.923353041\n1999-10-20T13:30:00Z,127.75,129.46875,127.125,128.25,9759398,9.139878583\n1999-10-21T13:30:00Z,127.21875,129,126.625,129,9105398,7.172851563\n1999-10-22T13:30:00Z,129.75,131.21875,129.5625,130.09375,8309602,9.957095287\n1999-10-25T13:30:00Z,129.3125,130.46875,128.75,129.4375,8114301,-2.363196699\n1999-10-26T13:30:00Z,130.1875,130.6875,127.8125,127.8125,6256301,-9.719422043\n1999-10-27T13:30:00Z,128.375,130.3125,128.25,130.125,5433301,14.09646739\n1999-10-28T13:30:00Z,132.4375,134.85937,132.1875,134.5625,10509699,42.43072577\n1999-10-29T13:30:00Z,135.84375,137.6875,135.71875,137,10988602,22.50555203\n1999-11-01T14:30:00Z,136.5,137,135.5625,135.5625,4006500,-8.415229072\n1999-11-02T14:30:00Z,135.96875,137.25,134.59375,134.59375,6516898,-6.898226351\n1999-11-03T14:30:00Z,136,136.375,135.125,135.5,7221301,1.871060924\n1999-11-04T14:30:00Z,136.75,137.35937,135.76562,136.53125,7910000,5.00147669\n1999-11-05T14:30:00Z,138.625,139.10937,136.78125,137.875,7431500,5.873065448\n1999-11-08T14:30:00Z,137,138.375,136.75,138,4649199,1.697198276\n1999-11-09T14:30:00Z,138.5,138.6875,136.28125,136.70312,4533699,-7.867102941\n1999-11-10T14:30:00Z,136.25,138.39062,136.07812,137.71875,6405602,4.967634951\n1999-11-11T14:30:00Z,138.1875,138.5,137.46875,138.5,4794102,4.555473115\n1999-11-12T14:30:00Z,139.25,139.98437,137.125,139.75,11802898,4.984096582\n1999-11-15T14:30:00Z,139.84375,140.25,139.40625,140.07812,2187500,1.839693548\n1999-11-16T14:30:00Z,140.5625,143,140.09375,141.25,7544801,9.670827446\n1999-11-17T14:30:00Z,142.25,142.9375,141.3125,141.5625,9458102,0.811298077\n1999-11-18T14:30:00Z,142.4375,143,141.625,142.625,4491000,5.604115099\n1999-11-19T14:30:00Z,142.40625,142.96875,142,142.49609,4832102,-0.14275\n1999-11-22T14:30:00Z,142.4375,143,141.5,142.46875,4155398,0.043937883\n1999-11-23T14:30:00Z,142.84375,142.84375,140.375,141.21875,5917898,-10.85678726\n1999-11-24T14:30:00Z,140.75,142.4375,140,142.0625,4458102,2.9296875\n1999-11-26T14:30:00Z,142.46875,142.875,141.25,141.375,1693400,-2.35625\n1999-11-29T14:30:00Z,140.875,141.92187,140.4375,140.9375,7348602,-2.265631444\n1999-11-30T14:30:00Z,140.75,142.3125,139,139.39062,7681898,-8.044518192\n1999-12-01T14:30:00Z,139.3125,140.5,139,140.40625,6980199,4.607706596\n1999-12-02T14:30:00Z,140.625,141.375,140.375,141.25,6698301,6.797593942\n1999-12-03T14:30:00Z,143.03125,145.34375,143.03125,143.84375,10044898,24.03888081\n1999-12-06T14:30:00Z,143.53125,143.71875,142.25,142.78125,3138800,-7.089315878\n1999-12-07T14:30:00Z,143.28125,143.3125,141.375,141.625,10714000,-8.982938879\n1999-12-08T14:30:00Z,141.34375,142.0625,140.5,140.71875,4611199,-5.808423913\n1999-12-09T14:30:00Z,141.8125,142.21875,139.375,141.40625,6474699,1.025390625\n1999-12-10T14:30:00Z,142.28125,142.8125,140.875,141.875,5127301,0.707165948\n1999-12-13T14:30:00Z,141.4375,142.71875,141.28125,142.125,4210801,1.686429251\n1999-12-14T14:30:00Z,141.625,142.48437,140.625,140.75,5739000,-7.572134024\n1999-12-15T14:30:00Z,140.375,142.20312,140.03125,141.48437,6879000,4.066104195\n1999-12-16T14:30:00Z,142.1875,142.65625,141.15625,142.125,5854801,3.654094397\n1999-12-17T14:30:00Z,143,143.3125,142.0625,142.6875,4775398,2.29070216\n1999-12-20T14:30:00Z,142.5625,143.1875,141.09375,141.65625,4608699,-7.166142086\n1999-12-21T14:30:00Z,141.59375,144.0625,141.34375,143.8125,7981301,15.51775945\n1999-12-22T14:30:00Z,143.625,144.1875,142.96875,144.1875,5377500,3.600805341\n1999-12-23T14:30:00Z,145.01562,146.48437,145,146.48437,5721699,22.41658763\n1999-12-27T14:30:00Z,146.5,146.78125,145.0625,146.28125,2691000,0.233005618\n1999-12-28T14:30:00Z,145.875,146.5,145.48437,146.1875,4084500,0.036353845\n1999-12-29T14:30:00Z,146.3125,146.8125,145.3125,146.8125,3001000,3.302908416\n1999-12-30T14:30:00Z,147.125,147.5625,146.1875,146.64062,3641300,-0.90334375\n1999-12-31T14:30:00Z,146.84375,147.5,146.25,146.875,3172700,0.504991794\n2000-01-03T14:30:00Z,148.25,148.25,143.875,145.4375,8164301,-12.13235294\n2000-01-04T14:30:00Z,143.53125,144.0625,139.64062,139.75,8089801,-51.61867872\n2000-01-05T14:30:00Z,139.9375,141.53125,137.25,140,12177898,-1.985239163\n2000-01-06T14:30:00Z,139.625,141.5,137.75,137.75,6227199,-11.84517635\n2000-01-07T14:30:00Z,140.3125,145.75,140.0625,145.75,8066602,70.08547009\n2000-01-10T14:30:00Z,146.25,146.90625,145.03125,146.25,5741602,4.154400664\n2000-01-11T14:30:00Z,145.8125,146.09375,143.5,144.3125,7433699,-17.2880117\n2000-01-12T14:30:00Z,144.59375,144.59375,142.875,143.0625,6911699,-10.25827892\n2000-01-13T14:30:00Z,144.46875,145.75,143.28125,145,5158301,10.32631102\n2000-01-14T14:30:00Z,146.53125,147.46875,145.96875,146.96875,7437301,16.91002652\n2000-01-18T14:30:00Z,145.34375,146.625,145.1875,145.8125,6488500,-5.262784091\n2000-01-19T14:30:00Z,145.3125,146.46875,145,146.25,6152898,3.277016626\n2000-01-20T14:30:00Z,146.96875,146.96875,143.8125,144.75,5800102,-10.67108295\n2000-01-21T14:30:00Z,145.5,145.5,144.0625,144.4375,6244801,-3.290441176\n2000-01-24T14:30:00Z,145.65625,145.84375,139.40625,140.34375,7896898,-32.91129443\n2000-01-25T14:30:00Z,140.51562,141.9375,139,141.9375,9942500,2.280440247\n2000-01-26T14:30:00Z,141,141.54687,140.09375,140.8125,5158102,-4.964283798\n2000-01-27T14:30:00Z,141.84375,142.21875,138.125,140.25,10919898,-5.704599057\n2000-01-28T14:30:00Z,139.4375,140.0625,135.53125,135.875,11916199,-38.48203003\n2000-01-31T14:30:00Z,135.8125,139.67187,135,139.625,10768602,20.33087063\n2000-02-01T14:30:00Z,139.75,141.6875,138.53125,140.9375,8419801,8.969522338\n2000-02-02T14:30:00Z,141.28125,142.25,140.375,141.0625,6205898,1.180305755\n2000-02-03T14:30:00Z,140.875,143.25,140,143.1875,7997500,13.34866283\n2000-02-04T14:30:00Z,143.1875,144,142.125,142.59375,4925398,-0.84593949\n2000-02-07T14:30:00Z,142.5625,142.78125,141.4375,142.375,5845801,-2.23228894\n2000-02-08T14:30:00Z,143.96875,144.5625,143.625,144.3125,4936500,17.52123786\n2000-02-09T14:30:00Z,144.46875,144.46875,141.26562,141.28125,8511500,-26.2802047\n2000-02-10T14:30:00Z,141.625,142.5625,140.875,141.5625,6690602,-1.762726022\n2000-02-11T14:30:00Z,141.84375,141.9375,138.03125,138.6875,9849199,-25.14784612\n2000-02-14T14:30:00Z,139.78125,139.78125,138.3125,139.5,8528801,-0.354806445\n2000-02-15T14:30:00Z,139.25,141.21875,137.79687,141.09375,11078301,7.521923654\n2000-02-16T14:30:00Z,140.375,140.9375,138.79687,139.1875,8845398,-10.9235525\n2000-02-17T14:30:00Z,140.4375,140.4375,138.21875,138.28125,7584199,-7.084627329\n2000-02-18T14:30:00Z,138.875,138.875,134.625,135.3125,9650898,-25.23737\n2000-02-22T14:30:00Z,135.1875,136.34375,133.53125,134.96875,16415398,-4.039754747\n2000-02-23T14:30:00Z,135.625,137.46875,134.5,136.5625,12119000,10.37629199\n2000-02-24T14:30:00Z,136.6875,137.03125,133.09375,133.8125,17375008,-20.54292486\n2000-02-25T14:30:00Z,135.1875,136.71875,133.125,133.32812,10559898,-8.983345109\n2000-02-28T14:30:00Z,133.375,136.6875,132.71875,136.125,13397801,17.55536314\n2000-02-29T14:30:00Z,136.0625,137.4375,135.75,137.4375,8242500,9.282483553\n2000-03-01T14:30:00Z,137.625,139,137.21875,138.4375,6866000,8.042279412\n2000-03-02T14:30:00Z,138.6875,139.125,137.34375,138.53125,7600199,0.753567913\n2000-03-03T14:30:00Z,140.4375,141.71875,139.71875,141.125,12770301,21.93179711\n2000-03-06T14:30:00Z,140.8125,141.34375,138.75,139.8125,11966898,-8.805614407\n2000-03-07T14:30:00Z,140,140.15625,135.21875,137.04687,20061808,-24.86267564\n2000-03-08T14:30:00Z,136.46875,137.84375,135.03125,136.875,11808398,-2.508423794\n2000-03-09T14:30:00Z,137.25,140.875,136.125,140.875,5500898,30.47504026\n2000-03-10T14:30:00Z,140.1875,142,139.53125,140.1875,7924500,0.544343171\n2000-03-13T14:30:00Z,136.6875,140.46875,136.5,138.59375,10540398,-3.720164862\n2000-03-14T14:30:00Z,139.28125,140.09375,136.15625,136.625,8263699,-9.733821903\n2000-03-15T14:30:00Z,136.875,140.4375,136.0625,139.8125,10300801,18.87778585\n2000-03-16T14:30:00Z,141.625,146.84375,140.875,146.34375,25601392,58.46719762\n2000-03-17T14:30:00Z,145.8125,148,145.4375,146.9375,10272898,6.461622521\n2000-03-20T14:30:00Z,146.875,147.34375,144.78125,146.78125,12502102,0.370235234\n2000-03-21T14:30:00Z,145.53125,149.75,144.5,149.1875,13612801,14.81626157\n2000-03-22T14:30:00Z,149.5625,150.84375,148.6875,150.09375,8259801,7.032740935\n2000-03-23T14:30:00Z,149.15625,153.46875,149.15625,152.5,11653898,19.98160149\n2000-03-24T14:30:00Z,152.875,155.75,151.71875,153.5625,11462898,9.35744382\n2000-03-27T14:30:00Z,153.375,153.78125,151.8125,151.9375,8798602,-11.09717153\n2000-03-28T14:30:00Z,151.25,152.98437,150.59375,151.0625,6334301,-4.05607094\n2000-03-29T14:30:00Z,151.5625,152.48437,149.65625,151.21875,6747500,-0.193189195\n2000-03-30T14:30:00Z,150.15625,151.92187,147.125,148.6875,9491898,-17.56220548\n2000-03-31T14:30:00Z,149.625,152.3125,148.4375,150.375,9249102,9.054155157\n2000-04-03T13:30:00Z,150.125,151.25,148.6875,151.25,8508199,6.232244318\n2000-04-04T13:30:00Z,151.75,153,141.39062,145.75,21056400,-42.59224457\n2000-04-05T13:30:00Z,147.875,150.8125,147.625,149.1875,8227898,14.58984375\n2000-04-06T13:30:00Z,150.25,151.6875,149,150.48437,6378500,9.026839378\n2000-04-07T13:30:00Z,151.5625,152.125,150.5,151.4375,6023602,5.754537679\n2000-04-10T13:30:00Z,151.75,153.10937,150.3125,150.84375,9624199,-3.983398962\n2000-04-11T13:30:00Z,150,151.625,148.375,150.40625,9006398,-2.045733848\n2000-04-12T13:30:00Z,150.375,151.15625,146.15625,146.28125,10779699,-31.60652757\n2000-04-13T13:30:00Z,147.46875,148.15625,141.125,144.25,12226801,-18.66077382\n2000-04-14T13:30:00Z,142.625,142.8125,133.5,138.375,29603808,-54.5928713\n2000-04-17T13:30:00Z,135.1875,140.75,134.6875,140.75,23918192,13.24184485\n2000-04-18T13:30:00Z,140.5625,144.46875,139.78125,144.46875,10955699,27.0063464\n2000-04-19T13:30:00Z,144.5,145.125,142.53125,143.125,6553699,-3.57716767\n2000-04-20T13:30:00Z,143.5625,143.9375,142.375,143.8125,8537602,1.248719262\n2000-04-24T13:30:00Z,141.5,143.3125,140.5,142.25,12893102,-7.453125\n2000-04-25T13:30:00Z,144.625,148.15625,144.4375,148.15625,14102000,58.02429199\n2000-04-26T13:30:00Z,147.96875,148.75,146,146.48437,7711102,-5.680471371\n2000-04-27T13:30:00Z,143,147.34375,143,146,15595301,2.977031082\n2000-04-28T13:30:00Z,147,147.85937,145.0625,145.09375,8743398,-3.634786787\n2000-05-01T13:30:00Z,146.5625,148.48437,145.84375,147.0625,7328301,10.57199864\n2000-05-02T13:30:00Z,145.5,147.125,144.125,144.125,9411898,-20.5625\n2000-05-03T13:30:00Z,144,144,139.78125,141.625,12180699,-23.66316512\n2000-05-04T13:30:00Z,142,142.35937,140.75,141.8125,5963602,-1.241137569\n2000-05-05T13:30:00Z,141.0625,144,140.9375,143.53125,7862398,12.77873744\n2000-05-08T13:30:00Z,142.75,143.375,141.84375,142.45312,5064102,-2.886548684\n2000-05-09T13:30:00Z,143.0625,143.40625,140.26562,141.3125,5619801,-8.887516136\n2000-05-10T13:30:00Z,140.5,140.96875,137.75,138.125,10293898,-27.99107143\n2000-05-11T13:30:00Z,140.125,141.5,139.125,141.28125,7091102,19.09839527\n2000-05-12T13:30:00Z,141.8125,143.46875,141.625,142.8125,5960801,13.76456568\n2000-05-15T13:30:00Z,142.75,145.60937,142,145.28125,4441301,18.0466289\n2000-05-16T13:30:00Z,146.5625,147.71875,145.3125,146.5625,8192000,9.545835997\n2000-05-17T13:30:00Z,145.6875,146.1875,144.46875,145.15625,5906898,-11.47701076\n2000-05-18T13:30:00Z,145.625,146.3125,143.8125,143.8125,4325301,-7.600959755\n2000-05-19T13:30:00Z,142.5625,143.23437,140.40625,141.125,6518398,-23.01270074\n2000-05-22T13:30:00Z,141.25,141.46875,137,140.0625,10839398,-10.76304612\n2000-05-23T13:30:00Z,140.4375,140.8125,137.5625,138,7979199,-15.7626652\n2000-05-24T13:30:00Z,138,140.6875,136.5,140.25,11084500,9.684191775\n2000-05-25T13:30:00Z,140.6875,141.8125,137.71875,137.84375,8278898,-11.09545407\n2000-05-26T13:30:00Z,138.8125,139.6875,137.32812,138,4814000,-3.606566169\n2000-05-30T13:30:00Z,140,142.9375,139.46875,142.71875,5362602,41.14583333\n2000-05-31T13:30:00Z,142.5625,144,142.09375,142.8125,6056500,2.782170506\n2000-06-01T13:30:00Z,143.6875,145.4375,143,145.3125,8961602,21.34789157\n2000-06-02T13:30:00Z,148.9375,149.09375,147.48437,147.84375,8962199,18.21570478\n2000-06-05T13:30:00Z,147.46875,148.21875,146.875,147.125,6998102,-4.358205012\n2000-06-06T13:30:00Z,146.625,147.78125,145.90625,146.46875,4858898,-3.186472859\n2000-06-07T13:30:00Z,146.625,148,146,147.48437,4919500,6.600180316\n2000-06-08T13:30:00Z,147.5,147.75,146.0625,146.90625,5723102,-3.083865797\n2000-06-09T13:30:00Z,147.5,147.96875,145.625,146.59375,3085300,-2.937034679\n2000-06-12T13:30:00Z,146.96875,146.96875,144.875,144.875,3436800,-13.85271991\n2000-06-13T13:30:00Z,144.8125,147.75,144.625,147.59375,6551500,17.66093415\n2000-06-14T13:30:00Z,148.25,148.875,147.1875,147.84375,6407102,2.49423668\n2000-06-15T13:30:00Z,148.125,148.75,146.84375,148.15625,5776199,0.705252918\n2000-06-16T13:30:00Z,148.3125,148.3125,145.875,146.59375,5526199,-14.07560403\n2000-06-19T13:30:00Z,146.46875,149.15625,146.25,148.46875,5090500,11.73979069\n2000-06-20T13:30:00Z,148.1875,148.875,147,147.9375,5662301,-0.603926809\n2000-06-21T13:30:00Z,146.9375,148.4375,146.89062,147.84375,3112700,1.206957415\n2000-06-22T13:30:00Z,147.5625,147.6875,145,145.625,7486500,-17.58781413\n2000-06-23T13:30:00Z,145.8125,146.125,143.875,144.375,4469898,-9.8125\n2000-06-26T13:30:00Z,145.375,146.25,144.875,146.23437,5194801,11.39574803\n2000-06-27T13:30:00Z,145.98437,146.71875,145.01562,145.15625,4076600,-5.072919053\n2000-06-28T13:30:00Z,145.625,146.98437,145.3125,145.5625,5320102,0.980663623\n2000-06-29T13:30:00Z,144.75,145.75,143.51562,144.1875,6339199,-9.505888598\n2000-06-30T13:30:00Z,143.9375,145.59375,143.89062,145.28125,7396602,7.746271366\n2000-07-03T13:30:00Z,145.4375,147.4375,145.1875,147.28125,1431900,16.97802587\n2000-07-05T13:30:00Z,146.375,146.65625,144.375,144.625,2714800,-18.25697331\n2000-07-06T13:30:00Z,144.9375,146.46875,144.21875,145.75,5382898,4.689771076\n2000-07-07T13:30:00Z,146.6875,148.78125,146.25,148.09375,3021300,20.6315445\n2000-07-10T13:30:00Z,147.875,148.90625,147.53125,147.84375,2814500,0.252757353\n2000-07-11T13:30:00Z,147.46875,149.125,147.15625,148.15625,5420699,2.627068923\n2000-07-12T13:30:00Z,149.28125,150.125,148.6875,149.125,5800699,6.97265625\n2000-07-13T13:30:00Z,149.98437,150.375,149.1875,149.78125,5354102,3.20265528\n2000-07-14T13:30:00Z,150.4375,151.25,149.67187,151.25,5335199,10.28035283\n2000-07-17T13:30:00Z,150.98437,151.98437,150.6875,151,3933000,-0.119519116\n2000-07-18T13:30:00Z,150.625,150.625,149.34375,149.76562,4245602,-11.66956735\n2000-07-19T13:30:00Z,149.46875,149.90625,148.25,148.6875,8294199,-8.523360238\n2000-07-20T13:30:00Z,149,150.625,148.8125,150.625,4283000,14.94251179\n2000-07-21T13:30:00Z,149.75,149.75,147.6875,147.6875,5370398,-22.50504032\n2000-07-24T13:30:00Z,148.125,148.85937,146.5625,146.84375,5625301,-5.20832037\n2000-07-25T13:30:00Z,147.75,147.84375,146.78125,147.3125,4488801,-0.31779661\n2000-07-26T13:30:00Z,146.96875,147.15625,145.64062,145.875,11773301,-12.84582926\n2000-07-27T13:30:00Z,145.9375,146.625,144.6875,145.375,7640000,-3.540470406\n2000-07-28T13:30:00Z,145.71875,145.90625,141.51562,142.09375,6217102,-27.86402744\n2000-07-31T13:30:00Z,142.9375,144.125,142.0625,142.90625,5235000,-0.467722039\n2000-08-01T13:30:00Z,143.625,144.71875,143.125,143.875,3939600,7.189997146\n2000-08-02T13:30:00Z,143.875,145.40625,143.625,144.59375,7432898,5.920617055\n2000-08-03T13:30:00Z,142.875,145.8125,142.625,145.59375,4544801,9.278476653\n2000-08-04T13:30:00Z,146.3125,146.71875,145.40625,146.375,3679600,5.266544118\n2000-08-07T13:30:00Z,146.71875,148.4375,146.375,148.125,4134500,15.31367481\n2000-08-08T13:30:00Z,147.5,148.8125,147.5,148.6875,3591700,3.893412559\n2000-08-09T13:30:00Z,149.14062,149.21875,147.375,147.4375,5350898,-6.915763686\n2000-08-10T13:30:00Z,147.53125,147.85937,146.28125,146.71875,4188398,-5.592498924\n2000-08-11T13:30:00Z,146.625,148,145.5625,147.32812,5080898,2.298077293\n2000-08-14T13:30:00Z,147.78125,149.5625,147.0625,149.28125,2917200,15.02500889\n2000-08-15T13:30:00Z,149.34375,149.8125,148.5625,149.15625,5547602,0.431941106\n2000-08-16T13:30:00Z,149.3125,149.9375,147.84375,148.625,5136898,-3.532732664\n2000-08-17T13:30:00Z,148.6875,150.4375,148.34375,150.1875,5612801,10.703125\n2000-08-18T13:30:00Z,150.375,150.375,149.21875,149.6875,4620801,-1.853475765\n2000-08-21T13:30:00Z,150.03125,150.71875,149.40625,150.5625,2359900,4.206414474\n2000-08-22T13:30:00Z,150.5625,151.3125,150.09375,150.3125,3017900,-0.839956647\n2000-08-23T13:30:00Z,149.8125,151.28125,149.28125,150.84375,5477500,3.076171875\n2000-08-24T13:30:00Z,151.15625,151.54687,150.5,151.3125,4522398,2.710390627\n2000-08-25T13:30:00Z,151.15625,151.625,150.9375,151.25,2820400,0.075604839\n2000-08-28T13:30:00Z,151.25,152.90625,151.25,151.76562,5497398,4.910927616\n2000-08-29T13:30:00Z,151.4375,151.875,150.90625,151.79687,3528200,1.662910368\n2000-08-30T13:30:00Z,151.3125,151.5,150.34375,150.34375,3948600,-12.03302194\n2000-08-31T13:30:00Z,151.0625,153.09375,150.90625,152.34375,4820801,15.20623199\n2000-09-01T13:30:00Z,153.25,153.59375,152,152.375,3152900,-0.350765306\n2000-09-05T13:30:00Z,151.875,152.20312,150.8125,151.28125,3450400,-9.270606989\n2000-09-06T13:30:00Z,151.1875,151.78125,149.53125,149.78125,4164102,-10.72373779\n2000-09-07T13:30:00Z,150.25,151.07812,149.82812,150.84375,4078800,5.026937722\n2000-09-08T13:30:00Z,150.28125,150.5,149.32812,149.8125,3476100,-7.092093055\n2000-09-11T13:30:00Z,149.75,151.1875,148.6875,149.59375,3933800,-1.359608209\n2000-09-12T13:30:00Z,149.75,150.25,148.4375,148.46875,4742500,-7.043611551\n2000-09-13T13:30:00Z,148,149.34375,147.65625,148.89062,4555102,1.489522374\n2000-09-14T13:30:00Z,149.875,149.9375,148.15625,148.46875,3391400,-2.946252752\n2000-09-15T13:30:00Z,148.1875,148.25,146.03125,146.09375,4075700,-21.45248724\n2000-09-18T13:30:00Z,146.375,146.96875,144.20312,144.65625,5104301,-10.13236925\n2000-09-19T13:30:00Z,145.125,146.3125,144.70312,145.96875,6547801,6.548139553\n2000-09-20T13:30:00Z,145.6875,146.03125,143.15625,144.89062,6498500,-7.209299051\n2000-09-21T13:30:00Z,144.46875,145.5625,143.75,145.1875,5346602,1.619581943\n2000-09-22T13:30:00Z,142.625,145.3125,142.42187,145.28125,7587398,9.016431723\n2000-09-25T13:30:00Z,145.9375,146.0625,143.71875,144.15625,9715398,-4.388189935\n2000-09-26T13:30:00Z,144.375,145,142.40625,142.40625,5281199,-11.4436054\n2000-09-27T13:30:00Z,143.5625,143.96875,142.125,143.15625,6049301,0.228626672\n2000-09-28T13:30:00Z,143.1875,146.32812,142.89062,146.125,6842801,24.28791184\n2000-09-29T13:30:00Z,145.46875,145.96875,143.625,143.625,8311699,-13.30445545\n2000-10-02T13:30:00Z,144.28125,144.90625,143.14062,143.84375,5517801,-1.657753953\n2000-10-03T13:30:00Z,144.53125,145.75,142.28125,142.5,9347199,-8.22018286\n2000-10-04T13:30:00Z,142.875,144.25,141.75,143.6875,6149000,3.948863636\n2000-10-05T13:30:00Z,143.40625,144.84375,143.3125,144.1875,4566898,4.557291667\n2000-10-06T13:30:00Z,143.875,144.64062,139.75,141.0625,10014898,-23.64453649\n2000-10-09T13:30:00Z,141.3125,141.3125,139.375,140,4508000,-9.673169379\n2000-10-10T13:30:00Z,140.09375,141.25,137.6875,137.6875,6104699,-14.27899096\n2000-10-11T13:30:00Z,137.625,138.625,135.125,136.53125,10366000,-8.999255952\n2000-10-12T13:30:00Z,137.28125,137.59375,132.78125,133.125,12336801,-26.53369816\n2000-10-13T13:30:00Z,132.9375,137.65625,132.875,137.5625,11776801,27.78811871\n2000-10-16T13:30:00Z,137.40625,138.23437,136.6875,138.1875,5659000,4.393974891\n2000-10-17T13:30:00Z,138.4375,138.5625,134.40625,134.75,7831699,-27.62111479\n2000-10-18T13:30:00Z,132.625,136.125,130.15625,134.25,10897301,-2.5390625\n2000-10-19T13:30:00Z,136.84375,139.45312,136.4375,139.28125,8767301,47.93537142\n2000-10-20T13:30:00Z,138.375,141.1875,138.375,139.90625,7373500,6.96347032\n2000-10-23T13:30:00Z,139.9375,141.03125,138.9375,140.53125,5290000,3.704160095\n2000-10-24T13:30:00Z,140.96875,141.9375,139,139.59375,5750699,-4.579212816\n2000-10-25T13:30:00Z,138.75,139.5625,136.125,136.3125,9136102,-27.65721451\n2000-10-26T13:30:00Z,137.125,137.65625,134.03125,136.6875,9345801,-1.525743773\n2000-10-27T13:30:00Z,137.875,139.28125,136.625,139.28125,9762898,18.68379237\n2000-10-30T14:30:00Z,138.4375,141.09375,138.15625,140.53125,10154102,9.121696853\n2000-10-31T14:30:00Z,141.01562,143.6875,140.0625,142.95312,7752398,18.61204367\n2000-11-01T14:30:00Z,142.25,143.25,141.21875,142.46875,6753602,0.471317741\n2000-11-02T14:30:00Z,143.15625,143.90625,142.51562,142.70312,11395102,0.382267301\n2000-11-03T14:30:00Z,143.46875,143.75,142.375,142.78125,5187102,-1.665785264\n2000-11-06T14:30:00Z,143.15625,144.29687,143.03125,143.78125,4042500,6.915038378\n2000-11-07T14:30:00Z,143.14062,144,142.5625,143.75,5231301,2.053665441\n2000-11-08T14:30:00Z,144.0625,144.0625,140.5625,140.5625,6123301,-26.10083652\n2000-11-09T14:30:00Z,140,141.21875,137.25,140.03125,10635301,-5.943800403\n2000-11-10T14:30:00Z,139,139.46875,136.53125,136.625,8569500,-31.09110169\n2000-11-13T14:30:00Z,135.625,136.98437,133.01562,135.5625,17285296,-8.343601027\n2000-11-14T14:30:00Z,137.46875,139.625,137,139.125,7668898,33.06686047\n2000-11-15T14:30:00Z,139.0625,140.10937,137.75,139.5625,8837699,3.413298407\n2000-11-16T14:30:00Z,139.5625,139.875,137.3125,137.375,6684102,-16.51526163\n2000-11-17T14:30:00Z,137.3125,139,135.75,136.64062,6551102,-4.325830247\n2000-11-20T14:30:00Z,135.75,136.375,134.3125,134.6875,5458500,-16.33049671\n2000-11-21T14:30:00Z,134.875,136.1875,133.51562,135.375,7684301,2.144278265\n2000-11-22T14:30:00Z,134.34375,134.875,132.125,132.14062,5736898,-27.3711425\n2000-11-24T14:30:00Z,133.625,134.96875,133.625,134.84375,3411600,18.51377575\n2000-11-27T14:30:00Z,136.46875,136.6875,135.3125,136.03125,5992000,7.66661352\n2000-11-28T14:30:00Z,135.125,136.59375,133.64062,133.6875,5336102,-15.475035\n2000-11-29T14:30:00Z,134.375,135.90625,133.26562,133.4375,6914102,-4.983512202\n2000-11-30T14:30:00Z,132.5,133.5,129.75,132.28125,11201602,-8.676470588\n2000-12-01T14:30:00Z,133.1875,134.0625,131,132.21875,7587199,-2.1484375\n2000-12-04T14:30:00Z,131.875,133.875,131.5,133.34375,6996398,6.396338619\n2000-12-05T14:30:00Z,134.875,138.25,134.40625,137.71875,8883398,39.85822951\n2000-12-06T14:30:00Z,137.78125,138.34375,135.03125,135.51562,12888000,-10.95876917\n2000-12-07T14:30:00Z,134.875,135.875,133.65625,133.65625,6529102,-12.66416599\n2000-12-08T14:30:00Z,137.0625,139.125,133.875,133.96875,10276102,-9.287446121\n2000-12-11T14:30:00Z,137.375,139.5625,136.71875,138.625,6405602,31.56879646\n2000-12-12T14:30:00Z,138.1875,138.8125,137.375,138.03125,5022898,-1.604352679\n2000-12-13T14:30:00Z,139.25,139.40625,136.03125,136.14062,6070500,-12.75746453\n2000-12-14T14:30:00Z,135.875,136.5,134.03125,134.40625,7778398,-13.18354219\n2000-12-15T14:30:00Z,133.125,133.125,130.5625,130.96875,9065301,-32.85481059\n2000-12-18T14:30:00Z,132.0625,133.46875,131.76562,132.71875,7235398,9.106870076\n2000-12-19T14:30:00Z,132.46875,134.96875,130.01562,130.01562,9616699,-12.43234716\n2000-12-20T14:30:00Z,128.625,128.9375,126.09375,126.25,9994199,-34.1438339\n2000-12-21T14:30:00Z,126,128.85937,125.53125,127.125,14331500,3.508619513\n2000-12-22T14:30:00Z,129,131.10937,128.84375,130.9375,10182898,37.0108307\n2000-12-26T14:30:00Z,130.84375,132.34375,130.28125,132.34375,4665301,9.112586273\n2000-12-27T14:30:00Z,132,133.73437,131.25,133.3125,4854102,6.079223745\n2000-12-28T14:30:00Z,132.8125,133.875,132.59375,133.71875,8358699,3.314623786\n2000-12-29T14:30:00Z,134.0625,134.28125,131.1875,131.1875,8774602,-17.83042279\n2001-01-02T14:30:00Z,132,132.15625,127.5625,128.8125,8737398,-19.99080882\n2001-01-03T14:30:00Z,128.3125,136,127.65625,135,19431600,42.92534722\n2001-01-04T14:30:00Z,134.9375,135.46875,133,133.54687,9219000,-1.438701887\n2001-01-05T14:30:00Z,133.46875,133.625,129.1875,129.1875,12911398,-38.98963994\n2001-01-08T14:30:00Z,129.875,130.1875,127.6875,130.1875,6625301,0.225656455\n2001-01-09T14:30:00Z,131.04687,131.5,129.42187,129.84375,5702398,-3.29906572\n2001-01-10T14:30:00Z,129,132.125,128.8125,132.125,8746102,13.98037294\n2001-01-11T14:30:00Z,131.09375,133.48437,131.09375,132.25,7245301,3.975996107\n2001-01-12T14:30:00Z,132.6875,133.71875,131.28125,132,7244000,-1.025810351\n2001-01-16T14:30:00Z,132,133.1875,131.51562,132.84375,8542199,4.402795264\n2001-01-17T14:30:00Z,134.84375,135.04687,132.64062,133.45312,7851398,0.657608302\n2001-01-18T14:30:00Z,133.4375,135.70312,132.9375,134.78125,8106898,7.46356106\n2001-01-19T14:30:00Z,136.1875,136.1875,133.875,134.01562,7782500,-5.029753872\n2001-01-22T14:30:00Z,134.25,135.78125,133.5625,134.90625,7050898,2.700278879\n2001-01-23T14:30:00Z,134.46875,136.65625,134.15625,135.96875,8463102,8.114919355\n2001-01-24T14:30:00Z,136.25,137.3125,135.84375,136.375,6199898,3.843352754\n2001-01-25T14:30:00Z,136.25,137.25,135.65625,136.03125,10818301,-1.419771635\n2001-01-26T14:30:00Z,135.15625,136.125,134.45312,135.875,7136801,0.847974637\n2001-01-29T14:30:00Z,135.5,136.89999,135.37,136.60001,6705898,5.450792311\n2001-01-30T14:30:00Z,136.3,137.92,135.78999,137.8,7069102,7.632413163\n2001-01-31T14:30:00Z,137.39999,138.7,136.60001,137.02,9706898,-1.803007411\n2001-02-01T14:30:00Z,137.10001,137.95,136.25,137.92999,8239602,3.982887598\n2001-02-02T14:30:00Z,137.39999,137.99001,134.75,134.8,8276500,-24.34274202\n2001-02-05T14:30:00Z,134.8,135.94,134.75,135.78999,4352898,3.233311968\n2001-02-06T14:30:00Z,135.3,136.7,135.22,135.39,7106699,-0.353905179\n2001-02-07T14:30:00Z,134.72,135.39999,133.67999,134.69,5748699,-4.247424408\n2001-02-08T14:30:00Z,134.8,135.39999,133.10001,133.12,5943301,-10.41125174\n2001-02-09T14:30:00Z,133.35001,133.35001,131.25999,131.84,9913000,-11.37026261\n2001-02-12T14:30:00Z,131.7,133.5,131.7,133.35001,5804398,9.326828414\n2001-02-13T14:30:00Z,133.7,134.17,132,132.25999,6587602,-4.565991103\n2001-02-14T14:30:00Z,132.64999,132.64999,130.66,132.06,8400102,-3.638233553\n2001-02-15T14:30:00Z,132.84,133.52,132.5,133.34,5928602,9.092149941\n2001-02-16T14:30:00Z,131,131.28999,129.3,130.39999,6434898,-25.04912548\n2001-02-20T14:30:00Z,131.03999,131.14,128.10001,128.39,5760000,-15.70419356\n2001-02-21T14:30:00Z,127.89999,128.84,125.5,125.62,10910801,-20.63477761\n2001-02-22T14:30:00Z,126.35001,126.53999,123.02,125.81,21281600,-2.582536163\n2001-02-23T14:30:00Z,125.08,125.53999,121.8,124.96001,20173008,-6.531175947\n2001-02-26T14:30:00Z,125.8,127.62,124.5,127.62,11502602,18.68323834\n2001-02-27T14:30:00Z,126.8,127.84,125.50999,126.44,11415000,-4.285350524\n2001-02-28T14:30:00Z,126.75,126.84,123.27,123.95,14831102,-21.54474044\n2001-03-01T14:30:00Z,124.05,124.60001,121.75,124.60001,14672000,0.871534517\n2001-03-02T14:30:00Z,122.5,125.64999,122.3,123.61,12564301,-1.226293363\n2001-03-05T14:30:00Z,124.14999,124.78,123.81,124.74001,5293199,9.239092764\n2001-03-06T14:30:00Z,126.35001,127.75,125.49001,126.08,6917000,9.144179448\n2001-03-07T14:30:00Z,126.89999,127.03999,125.75999,126.98,6371699,3.884935626\n2001-03-08T14:30:00Z,126.60001,127.24001,126.14,127.12,6055000,1.968716309\n2001-03-09T14:30:00Z,126.10001,126.10001,123.11,123.36,10020301,-34.52137787\n2001-03-12T14:30:00Z,122.34,122.5,117.75,118.08,13972898,-48.39401606\n2001-03-13T14:30:00Z,119.39999,120.44,117.53,120.02,12887199,4.397188365\n2001-03-14T14:30:00Z,117.05,119.28999,115.75,117.64999,19883392,-12.58791319\n2001-03-15T14:30:00Z,118.45,118.86,117.36,117.67999,10370301,-0.939626897\n2001-03-16T14:30:00Z,117.13,117.39999,114.81,115.00999,58515392,-24.07524848\n2001-03-19T14:30:00Z,115.75999,117.69,114.82001,117.35001,10067801,12.83366756\n2001-03-20T14:30:00Z,117.89999,118.46001,114.11,114.2,15086898,-19.63151515\n2001-03-21T14:30:00Z,114.17999,115.25999,111.89999,112.25999,19004704,-12.83191458\n2001-03-22T14:30:00Z,112.02,112.60001,108.03999,111.12,28625600,-10.83249397\n2001-03-23T14:30:00Z,113.25,114.66,111.5,114.48,12861699,23.20804196\n2001-03-26T14:30:00Z,115.7,116.27,114.77,115.94,9943801,10.81506082\n2001-03-27T14:30:00Z,115.62,118.64999,115.28,118.31,12881199,18.64111165\n2001-03-28T14:30:00Z,116.89999,116.95,114.89999,115.03999,10953301,-22.09553457\n2001-03-29T14:30:00Z,114.7,116.5,109.34,115.48,12061398,1.705371598\n2001-03-30T14:30:00Z,115.55,116.69,114.5,116.69,9183602,6.262447589\n2001-04-02T13:30:00Z,116.3,117.38,113.8,114.2,10561000,-15.21175614\n2001-04-03T13:30:00Z,113.98,114.14999,110.06,110.39,12836000,-34.18403468\n2001-04-04T13:30:00Z,110.578,112.10001,109.3,110.85001,14884500,-0.871435042\n2001-04-05T13:30:00Z,113.3,115.49001,112.5,115.05,21517600,38.4101196\n2001-04-06T13:30:00Z,113.991,114.39999,112.06,113.3,14937801,-9.986760656\n2001-04-09T13:30:00Z,114,114.99001,112.78,114.56,9034301,6.06089727\n2001-04-10T13:30:00Z,115.45,117.75,115.17,116.64999,17873296,18.65217386\n2001-04-11T13:30:00Z,118.78,118.99001,116.14,116.73,12722301,-2.994626501\n2001-04-12T13:30:00Z,116.3,118.94,115.96001,118.85001,9233199,11.40010091\n2001-04-16T13:30:00Z,118.28999,118.89,116.91,117.60001,7348699,-4.43537142\n2001-04-17T13:30:00Z,117.31,119.66,117.02,119.25999,10924699,11.27265154\n2001-04-18T13:30:00Z,121.06,126,120.69,124,32491008,43.32173723\n2001-04-19T13:30:00Z,124.25,125.84,123.58,125.64999,13810398,11.84551836\n2001-04-20T13:30:00Z,124.89999,125.39999,123.66,124.5,7626699,-5.615057436\n2001-04-23T13:30:00Z,123.64999,123.89,121.91,122.24001,8451801,-20.80267308\n2001-04-24T13:30:00Z,122.52,123.64999,121.10001,121.58,10045301,-4.501120595\n2001-04-25T13:30:00Z,121.42,123.67,120.95,123.17,8249000,9.857656514\n2001-04-26T13:30:00Z,123.73,125.22,123.5,123.72,10590398,5.420142626\n2001-04-27T13:30:00Z,124.92,125.84,124.2,125.78,8048898,17.50830013\n2001-04-30T13:30:00Z,126.45,127.27,124.67,124.91,10764898,-4.714142984\n2001-05-01T13:30:00Z,125.07001,127.14999,124.60001,127.05,10578102,13.09370368\n2001-05-02T13:30:00Z,127.41,127.69,126,126.82001,9572898,-0.090065535\n2001-05-03T13:30:00Z,126.13,126.14999,124.22,125.21001,9926199,-14.93655091\n2001-05-04T13:30:00Z,123.64999,127.35001,123.44,127.34,12145301,12.09885286\n2001-05-07T13:30:00Z,126.86,127.38,126.23,126.24001,7185199,-1.631800128\n2001-05-08T13:30:00Z,126.86,127.10001,125.56,126.17999,6952602,-1.760019314\n2001-05-09T13:30:00Z,125.25,126.55,125.06,125.64999,9507398,-2.10844336\n2001-05-10T13:30:00Z,127.25999,127.5,125.77,126.02,6872398,-0.917586005\n2001-05-11T13:30:00Z,126,126.49001,124.39999,125.14999,7736602,-6.771138909\n2001-05-14T13:30:00Z,124.89999,125.44,124.46001,125.39999,7914000,1.03966862\n2001-05-15T13:30:00Z,125.55,126.5,124.85001,125.98,9782199,3.563471485\n2001-05-16T13:30:00Z,124.84,129.2,124.62,128.95,14916199,22.03553333\n2001-05-17T13:30:00Z,129.005,130.08,128.56,129.14999,11828898,3.603981968\n2001-05-18T13:30:00Z,129.09,129.74001,128.10001,129.74001,6683301,3.724155814\n2001-05-21T13:30:00Z,129.84,131.84,129.14999,131.64999,11532102,13.69992457\n2001-05-22T13:30:00Z,131.83,132.09,131.07001,131.48,8343199,0.264655047\n2001-05-23T13:30:00Z,131.05,131.05,129.25,129.25,12331000,-21.32884958\n2001-05-24T13:30:00Z,129.47,130,128.55,129.63,7905398,0.024671053\n2001-05-25T13:30:00Z,129.64999,129.7,127.89999,128.10001,7425000,-13.30983952\n2001-05-29T13:30:00Z,128.226,128.35001,126.89999,127.08,9012301,-8.083762616\n2001-05-30T13:30:00Z,126.59,127.09,125,125.3,10041801,-14.83252683\n2001-05-31T13:30:00Z,125.42999,126.75999,125.25999,125.95,9875199,2.941534379\n2001-06-01T13:30:00Z,126.2,127.10001,125.12,126.73,8848301,4.002537381\n2001-06-04T13:30:00Z,126.8,127.42999,126.08,127.34,5634699,2.987962292\n2001-06-05T13:30:00Z,127.49001,129.23,127.27,128.8,9115602,12.68642766\n2001-06-06T13:30:00Z,128.83,128.83,127.36,127.73,12064898,-6.471509696\n2001-06-07T13:30:00Z,127.05,128.35001,127,128.19,7355301,2.119794647\n2001-06-08T13:30:00Z,127.7,127.87,126.14,127,8170602,-7.39295977\n2001-06-11T13:30:00Z,126.71001,126.99001,125.41,126.10001,7012199,-7.79182481\n2001-06-12T13:30:00Z,124.86,126.74001,124.03999,125.88,9368500,0.620574417\n2001-06-13T13:30:00Z,126.17,126.58,124.64999,124.8,7629398,-5.312661899\n2001-06-14T13:30:00Z,124.17999,124.3,121.75,122,12603301,-25.67444262\n2001-06-15T13:30:00Z,120.91,122.39999,120.39999,121.85001,16821296,-0.884024075\n2001-06-18T13:30:00Z,121.64999,122.44,120.91,121.25999,11368801,-1.830811678\n2001-06-19T13:30:00Z,122.38,122.89,120.89,121.78999,7732301,0.667813543\n2001-06-20T13:30:00Z,121.19,122.86,121.10001,122.42999,8787199,3.900336764\n2001-06-21T13:30:00Z,122.22,124.31,122.14999,123.82001,12259102,11.89284673\n2001-06-22T13:30:00Z,123.49001,123.599,122.16,122.85001,12212000,-4.736467896\n2001-06-25T13:30:00Z,123.28,123.44,121.5,121.72,8406801,-8.317066072\n2001-06-26T13:30:00Z,120.89999,122.39,120.571,121.55,8006398,-0.763946511\n2001-06-27T13:30:00Z,121.60001,122.24001,120.91,121.48,10105102,0.093900386\n2001-06-28T13:30:00Z,122,123.94,121.92999,122.14999,10271000,4.853341959\n2001-06-29T13:30:00Z,122.8,124.00999,122.25999,122.60001,9824199,2.445023161\n2001-07-02T13:30:00Z,122.8,124.32001,122.62,124.13,8522301,13.10149808\n2001-07-03T13:30:00Z,123.98,124.10001,123.05,124.10001,3303100,1.750960641\n2001-07-05T13:30:00Z,123.07001,123.64999,121.66,121.67999,5517801,-20.95626272\n2001-07-06T13:30:00Z,121.31,121.49001,119.05,119.05,11666199,-23.42292289\n2001-07-09T13:30:00Z,119.491,120.53999,119.2,119.7,8339301,0.891270616\n2001-07-10T13:30:00Z,120.28999,120.64,118.21001,118.25999,8630699,-9.014258221\n2001-07-11T13:30:00Z,118.10001,118.89,117.09,118.38,15329699,-0.784308437\n2001-07-12T13:30:00Z,119.5,121.47,119.31,121.19,12004801,26.69353653\n2001-07-13T13:30:00Z,120.84,122.32001,120.62,122.24001,10433602,7.228952028\n2001-07-16T13:30:00Z,121.77,122.28,120.28999,120.71001,6915301,-8.906254707\n2001-07-17T13:30:00Z,120.2,121.95,119.83,121.84,7470301,5.475304089\n2001-07-18T13:30:00Z,120.56,121.64,120.06,121.00999,7709301,-1.038058313\n2001-07-19T13:30:00Z,122.17999,122.98,120.75999,122.07001,10082898,5.899070931\n2001-07-20T13:30:00Z,121.14999,121.94,120.92,121.34,6705801,-4.280233848\n2001-07-23T13:30:00Z,121.8,121.88,118.95,118.95,8065199,-18.90073775\n2001-07-24T13:30:00Z,119,119.2,116.75,117.8,12271000,-10.70652174\n2001-07-25T13:30:00Z,117.92,119.48,117.46001,119.10001,12088898,7.196219596\n2001-07-26T13:30:00Z,119.06,120.85001,118.56,120.35001,12930000,9.266186152\n2001-07-27T13:30:00Z,120.83,121.35001,119.91,120.81,8481801,2.739315679\n2001-07-30T13:30:00Z,121.19,121.35001,120.3,120.85001,8547699,-0.431827956\n2001-07-31T13:30:00Z,121,122.67999,120.8,121.35001,11918602,3.434188274\n2001-08-01T13:30:00Z,121.97,122.7,121.55,122.11,11940801,5.787887922\n2001-08-02T13:30:00Z,123.23,123.25,121.89,122.61,11070199,1.149193548\n2001-08-03T13:30:00Z,122.36,122.36,120.89999,121.94,10816500,-6.357220469\n2001-08-06T13:30:00Z,121.35001,121.50999,120.10001,120.3,8550398,-15.08967744\n2001-08-07T13:30:00Z,120.27,121.2,119.911,120.77,8865102,1.65866535\n2001-08-08T13:30:00Z,120.12,121.16,118.42999,118.53,15183801,-14.90675405\n2001-08-09T13:30:00Z,118.7,118.97,117.86,118.88,14118500,0.118055556\n2001-08-10T13:30:00Z,118.8,119.84,117.34,119.28999,11173301,2.647291012\n2001-08-13T13:30:00Z,119.60001,119.85001,118.819,119.32001,7435398,0.037982254\n2001-08-14T13:30:00Z,120.14,120.35001,118.8,119.27,13178102,-2.205465938\n2001-08-15T13:30:00Z,119.23,119.61,118.08,118.24001,8520602,-7.416155758\n2001-08-16T13:30:00Z,117.8,118.75,117,118.64999,10734699,2.279345702\n2001-08-17T13:30:00Z,117.64999,117.87,116.00999,116.75,11604602,-14.32223673\n2001-08-20T13:30:00Z,116.8,117.89999,116.55,117.83,10417398,6.25199079\n2001-08-21T13:30:00Z,117.8,118.53999,115.8,115.82001,14481398,-11.60813829\n2001-08-22T13:30:00Z,116.75,117.42999,115.78,117.02,11752898,3.94049827\n2001-08-23T13:30:00Z,116.96001,117.52,116.49001,116.60001,8745301,-1.60715801\n2001-08-24T13:30:00Z,117.21001,119.13,116.74001,119.02,11688301,20.06007793\n2001-08-27T13:30:00Z,118.97,119.2,118.25999,118.31,7428102,-2.0040636\n2001-08-28T13:30:00Z,118.28,118.49001,116.58,116.58,12046602,-14.30369613\n2001-08-29T13:30:00Z,117.13,117.17999,115.17,115.53999,16181801,-8.179245988\n2001-08-30T13:30:00Z,114.85001,115.74001,112.03999,113.32001,17693104,-18.05769332\n2001-08-31T13:30:00Z,113.39999,114.77,113.13,114.14999,15985699,3.685376314\n2001-09-04T13:30:00Z,113.85001,116.17,113.37,113.42,24475392,-3.201145345\n2001-09-05T13:30:00Z,113.7,114.19,111.95,113.7,21477696,0.675109305\n2001-09-06T13:30:00Z,112.64999,113.3,110.77,110.77,21654096,-25.95944448\n2001-09-07T13:30:00Z,110.02,111.25,108.63,108.72,33133904,-13.7212786\n2001-09-10T13:30:00Z,107.7,110.35001,107.7,110.05,23408704,7.465146756\n2001-09-17T13:30:00Z,101,106.39999,100,104.3,32393808,-25.03591846\n2001-09-18T13:30:00Z,104.33,105.3,103.36,104.05,22029200,0.983273056\n2001-09-19T13:30:00Z,104.10001,104.5,98.56,101.95,42772096,-18.52649485\n2001-09-20T13:30:00Z,100.39999,101.81,98.569,98.71001,36212800,-25.38099776\n2001-09-21T13:30:00Z,94.05,98.99001,93.8,97.28,49783504,-1.298609005\n2001-09-24T13:30:00Z,99.729,101.16,99.06,100.7,25549808,30.0961817\n2001-09-25T13:30:00Z,100.75101,102,99.89999,101.75,25466192,6.215741529\n2001-09-26T13:30:00Z,102.35001,102.39999,100.42999,101.39,18587504,-2.19379063\n2001-09-27T13:30:00Z,101.25,102.28999,100,102.27,20536800,3.948866758\n2001-09-28T13:30:00Z,102.98,109.92,102.5,104.44,21787696,19.36436938\n2001-10-01T13:30:00Z,103.89999,104.32001,102.83,104.27,20457600,1.996757352\n2001-10-02T13:30:00Z,104,105.58,103.64999,105.58,19833600,8.875650568\n2001-10-03T13:30:00Z,104.60001,107.881,104.35001,107.35001,32070192,12.96737098\n2001-10-04T13:30:00Z,108.28999,108.97,106.75,107.44,32675504,1.227511554\n2001-10-05T13:30:00Z,107.25,107.62,105.521,107.23,29830192,-2.244115293\n2001-10-08T13:30:00Z,106.27901,107.3,105.87,106.53,12971199,-3.432608014\n2001-10-09T13:30:00Z,106.61,106.75,105.60001,105.96001,15976301,-3.988767935\n2001-10-10T13:30:00Z,105.8,108.55,105.52,108.32001,19987392,17.53116065\n2001-10-11T13:30:00Z,108.95,110.3,108.95,110,23008608,15.28666371\n2001-10-12T13:30:00Z,109.14999,109.89,107.3,109.5,31361504,-0.362718186\n2001-10-15T13:30:00Z,108.63,109.45,108.06,109.3,16875008,1.33279146\n2001-10-16T13:30:00Z,109.8,110.619,108.95,109.99001,15883602,4.275685016\n2001-10-17T13:30:00Z,111.07001,111.14999,107.64999,107.64999,28601696,-16.50103559\n2001-10-18T13:30:00Z,107.82001,108.16,106.75,107.42,16517398,-3.191182663\n2001-10-19T13:30:00Z,107,107.91,106.00999,107.35001,21916096,0.022086347\n2001-10-22T13:30:00Z,107.3,109.57001,107.21001,109.47,17570896,18.66528571\n2001-10-23T13:30:00Z,109.96001,110.28,108.379,108.91,22064496,-1.513896447\n2001-10-24T13:30:00Z,108.98,109.45,108.22,108.62,16065398,-2.116523779\n2001-10-25T13:30:00Z,107.45,110.60001,106.74001,110.57001,27504000,10.71465807\n2001-10-26T13:30:00Z,109.95,111.78999,109.67,110.32001,18623296,1.879950659\n2001-10-29T14:30:00Z,110.16,110.55,107.45,107.45,18733808,-23.21912405\n2001-10-30T14:30:00Z,107.35001,107.7,105.56,106.16,26197904,-10.74342158\n2001-10-31T14:30:00Z,106.89999,107.86,105.8,105.8,28130496,-5.442056132\n2001-11-01T14:30:00Z,106.60001,109.00999,105.69901,108.50999,29807296,18.96590596\n2001-11-02T14:30:00Z,108.44,109.38,107.87,109.25,17577904,4.438990963\n2001-11-05T14:30:00Z,110.12,111.09,109.95,110.67999,15991301,12.99472821\n2001-11-06T14:30:00Z,110.35001,112.48,109.85001,112.39999,23245904,11.71712496\n2001-11-07T14:30:00Z,111.77,113.12,111.64,112.25,19716800,1.436320339\n2001-11-08T14:30:00Z,112.87,114.08,111.89999,112.60001,22747808,1.665964088\n2001-11-09T14:30:00Z,112.25,112.96001,111.44,112.72,15897500,1.31296299\n2001-11-12T14:30:00Z,111,112.64999,110,112.03,26071600,-0.34879634\n2001-11-13T14:30:00Z,113.44,114.55,113.17999,114.55,15347102,23.83053614\n2001-11-14T14:30:00Z,115.17,115.39999,113.71001,114.66,17591392,0.357766264\n2001-11-15T14:30:00Z,114.37,115.17999,113.92999,114.87,19472400,1.10130819\n2001-11-16T14:30:00Z,115.08,115.10001,113.39999,114.36,18135392,-3.750498111\n2001-11-19T14:30:00Z,114.92,115.85001,114.45,115.77,13682500,9.484428365\n2001-11-20T14:30:00Z,115.37,115.8,114.64,114.8,16223000,-5.364412568\n2001-11-21T14:30:00Z,114.50101,114.67,113.50999,114.03999,11471102,-6.680056865\n2001-11-23T14:30:00Z,114.03999,115.75,114,115.67999,6716898,13.43495057\n2001-11-26T14:30:00Z,115.75,116.34,115.07001,115.92999,13729199,1.841544444\n2001-11-27T14:30:00Z,115.62,116.89999,114.09,115.42999,19266400,-2.215439428\n2001-11-28T14:30:00Z,114.74001,115.17,113.25,113.34,20247200,-18.43183417\n2001-11-29T14:30:00Z,113.662,114.92,113,114.87,17265104,7.760773529\n2001-11-30T14:30:00Z,114.39999,114.912,114.02,114.05,13680398,-3.083363432\n2001-12-03T14:30:00Z,113.64999,114.08,113.00999,113.37,15220398,-5.096086175\n2001-12-04T14:30:00Z,113.918,115.3,113.35001,115.28999,17245808,15.14383095\n2001-12-05T14:30:00Z,115.61,118,115.56,117.39999,25204000,19.43344196\n2001-12-06T14:30:00Z,117.349,117.94,116.92999,117.34,17969200,0.886907443\n2001-12-07T14:30:00Z,116.89999,117.09,115.7,116.56,18908000,-6.433027682\n2001-12-10T14:30:00Z,115.85001,116.39,114.35001,114.38,13862801,-18.75003684\n2001-12-11T14:30:00Z,114.89999,115.72,113.89999,114.14999,20833296,-3.723312295\n2001-12-12T14:30:00Z,114.55,114.78,113.11,114.28,16172398,-0.673578988\n2001-12-13T14:30:00Z,113.45,113.7,112.03999,112.06,19031904,-20.69639625\n2001-12-14T14:30:00Z,112.33,113.49001,112,113.13,16722699,5.459787379\n2001-12-17T14:30:00Z,112.99001,114.36,112.89999,114.3,13947301,9.377744148\n2001-12-18T14:30:00Z,114.63,115.14999,114.34,114.98,13663898,5.427224106\n2001-12-19T14:30:00Z,114.09,115.92,114,115.78999,20147392,5.331679016\n2001-12-20T14:30:00Z,115.5,115.8,114.55,114.64999,14867898,-5.274626902\n2001-12-21T14:30:00Z,115.03,115.07001,114.2,114.95,14042199,0.123427558\n2001-12-24T14:30:00Z,114.83,115.03999,114.61,114.73,5728801,-1.369474877\n2001-12-26T14:30:00Z,114.64999,116.21001,114.64999,115.36,10307898,5.60252\n2001-12-27T14:30:00Z,115.30099,116.08,115.259,116.06,9407301,5.665017113\n2001-12-28T14:30:00Z,116.28999,116.75,115.92,116,10593801,-0.064460034\n2001-12-31T14:30:00Z,116.14999,116.39,114.23,114.3,14619500,-13.36664914\n2002-01-02T14:30:00Z,115.11,115.75,113.81,115.53,18651904,3.687253121\n2002-01-03T14:30:00Z,115.64999,116.95,115.53999,116.84,15731801,11.73601033\n2002-01-04T14:30:00Z,117.17,117.98,116.55,117.62,20140608,5.372108181\n2002-01-07T14:30:00Z,117.7,117.99001,116.56,116.78999,13106500,-5.035890772\n2002-01-08T14:30:00Z,116.798,117.06,115.97,116.52,12687000,-2.4758847\n2002-01-09T14:30:00Z,116.67999,117.78,115.34,115.57001,16616898,-4.94083682\n2002-01-10T14:30:00Z,115.69501,116.35001,115.3,116.08,12823398,1.560691862\n2002-01-11T14:30:00Z,116.21001,116.28,114.7,114.94,13708398,-8.637915008\n2002-01-14T14:30:00Z,114.64999,114.84,113.96001,114.22,12301301,-6.149511044\n2002-01-15T14:30:00Z,114.55,115.39,113.89999,115.14999,20221392,5.138122884\n2002-01-16T14:30:00Z,114.3,114.39999,112.69,112.82001,17076704,-20.08712423\n2002-01-17T14:30:00Z,113.75999,114.24001,113.39999,113.67,17391104,2.57372234\n2002-01-18T14:30:00Z,113,113.85001,112.67,113.14999,17028192,-2.429883493\n2002-01-22T14:30:00Z,113.75,113.92999,112.02,112.37,11689801,-5.194841431\n2002-01-23T14:30:00Z,112.63,113.55,112.02,113.23,12438898,3.205666667\n2002-01-24T14:30:00Z,113.64,114.25,113.32001,113.58,12162398,2.66334517\n2002-01-25T14:30:00Z,113.12,114.17999,113.03999,113.55,12810699,0.551938853\n2002-01-28T14:30:00Z,113.89999,114.19,112.92,113.86,10589500,1.154279492\n2002-01-29T14:30:00Z,113.851,114.13,110.05,110.28,27735296,-31.29684901\n2002-01-30T14:30:00Z,110.39,113.39,108.39999,111.87,34711808,4.748884346\n2002-01-31T14:30:00Z,112.14999,113.3,111.62,113.17999,19909200,9.569621037\n2002-02-01T14:30:00Z,113.09,113.3,112.17,112.64999,15838500,-2.240653716\n2002-02-04T14:30:00Z,112.23,112.23,109.44901,109.85001,24243904,-26.45114254\n2002-02-05T14:30:00Z,109.39999,110.49899,108.53,109.17,33614000,-4.472567632\n2002-02-06T14:30:00Z,109.64999,109.74001,108.06,108.7,29581008,-4.002740546\n2002-02-07T14:30:00Z,108.72,109.86,108,108.02,23450000,-4.381105043\n2002-02-08T14:30:00Z,108.63,110.75,108.3,110.09,19278096,16.19857595\n2002-02-11T14:30:00Z,110.05,111.64,109.82001,111.44,18792096,10.68511755\n2002-02-12T14:30:00Z,110.96001,111.71001,110.03,111.09,13942500,0.271632292\n2002-02-13T14:30:00Z,111.481,112.53999,111.35001,112.27,16783808,10.76783944\n2002-02-14T14:30:00Z,112.50999,112.97,111.591,112.06,20458000,-0.659879064\n2002-02-15T14:30:00Z,112.14999,112.24001,110.71001,110.89,18392096,-9.824389954\n2002-02-19T14:30:00Z,110.14999,110.298,108.61,108.75999,15988102,-19.46287757\n2002-02-20T14:30:00Z,109.05,110.59,107.82001,110.59,29242896,8.264091916\n2002-02-21T14:30:00Z,109.931,110.63,108.25999,108.3,26292608,-14.38014791\n2002-02-22T14:30:00Z,108.35001,109.94,107.87,109.64,26572896,6.524774997\n2002-02-25T14:30:00Z,109.748,111.81,109.7,111.45,17458704,16.43196992\n2002-02-26T14:30:00Z,111.60001,112.03999,110.57001,111.22,22362000,0.015944329\n2002-02-27T14:30:00Z,111.961,112.86,110.64999,111.64999,28597904,0.798128264\n2002-02-28T14:30:00Z,111.834,112.75,111.03,111.14999,23755504,-3.517386457\n2002-03-01T14:30:00Z,111.72,113.85001,111.50999,113.74001,26179504,21.50304701\n2002-03-04T14:30:00Z,113.901,115.99001,113.64999,115.75,27184800,17.00087197\n2002-03-05T14:30:00Z,115.33,116.39999,114.97,115.38,22733008,0.302072544\n2002-03-06T14:30:00Z,115.10001,117.14999,115.07899,116.75,20143808,11.72079456\n2002-03-07T14:30:00Z,117.36099,117.5,115.57001,116.5,19331808,-0.843746151\n2002-03-08T14:30:00Z,117.381,117.907,116.48,116.99001,19930304,0.424454035\n2002-03-11T14:30:00Z,116.89101,117.89999,116.42999,117.24001,15622102,1.185372006\n2002-03-12T14:30:00Z,116.10899,117.25,115.94,117.17,17154896,3.185158246\n2002-03-13T14:30:00Z,116.631,116.75,115.64,116.03999,17175504,-6.998891442\n2002-03-14T14:30:00Z,116.03999,116.42999,115.63,115.88,11169602,-1.048336558\n2002-03-15T14:30:00Z,115.97,116.95,115.89999,116.64999,21221904,6.505022858\n2002-03-18T14:30:00Z,117.10001,117.567,116.10001,116.67,17557504,-0.087519596\n2002-03-19T14:30:00Z,117.30099,117.74001,116.82001,117.45,17913008,4.531149136\n2002-03-20T14:30:00Z,116.5,116.58,115.19,115.24001,17115008,-21.25844726\n2002-03-21T14:30:00Z,115.3,115.83,114.12,115.28999,26886704,-0.933420598\n2002-03-22T14:30:00Z,115.5,115.94,114.7,115.03999,15235398,-1.577636162\n2002-03-25T14:30:00Z,115.091,115.36,113.3,113.61,17499600,-11.42738369\n2002-03-26T14:30:00Z,113.521,115.02,113.47,114.27,19948608,3.048406783\n2002-03-27T14:30:00Z,114.033,115.00999,113.75999,114.57001,19020496,2.431981833\n2002-03-28T14:30:00Z,114.97,115.77,114.5,114.52,17535904,-0.751768256\n2002-04-01T14:30:00Z,114.23,115.10001,113.5,114.57001,17711808,0.400235984\n2002-04-02T14:30:00Z,113.98,114.95,113.77,113.94,15594500,-2.233254727\n2002-04-03T14:30:00Z,114.011,114.217,112.16,113.14,25660704,-6.703525641\n2002-04-04T14:30:00Z,112.60001,113.39999,112.23,112.67,23561008,-2.675244687\n2002-04-05T14:30:00Z,113.19,113.63,112.17999,112.69,19404896,-0.868830313\n2002-04-08T13:30:00Z,111.32001,113.03,111.23,112.92999,16471102,4.360944156\n2002-04-09T13:30:00Z,113.189,113.189,111.92999,112.14,15122699,-3.430605836\n2002-04-10T13:30:00Z,112.101,113.53999,112.092,113.41,17204096,8.504410848\n2002-04-11T13:30:00Z,112.89301,113.052,110.5,110.59,25459104,-21.67248845\n2002-04-12T13:30:00Z,111.02901,111.64999,110.03999,111.42,14950602,1.363153401\n2002-04-15T13:30:00Z,111.62,111.86,110.2,110.57001,17402896,-5.540577323\n2002-04-16T13:30:00Z,111.702,113.32001,111.67,113.2,15097000,21.75214638\n2002-04-17T13:30:00Z,113.39,113.67,112.60001,112.96001,12920398,-0.20894137\n2002-04-18T13:30:00Z,112.89999,113.46001,111.14999,112.47,25211008,-3.80205566\n2002-04-19T13:30:00Z,113.2,113.24001,112.56,112.88,10602500,0.82377899\n2002-04-22T13:30:00Z,112.38,112.42999,110.84,111,13923301,-17.82986235\n2002-04-23T13:30:00Z,111.09,111.48,110.17,110.52,16968608,-3.479229607\n2002-04-24T13:30:00Z,110.56,111.81,109.39999,109.41,18903296,-5.772443105\n2002-04-25T13:30:00Z,109.21001,109.741,108.72,109.47,25455504,-0.321352933\n2002-04-26T13:30:00Z,109.78999,110.00999,107.28999,107.39,19769904,-15.72875447\n2002-04-29T13:30:00Z,107.931,108.25999,106.63,106.86,17725008,-4.061026603\n2002-04-30T13:30:00Z,107.02,108.64,106.64,107.86,19474496,5.652643038\n2002-05-01T13:30:00Z,107.97,109.25,106.8,109.17999,24580496,6.972812852\n2002-05-02T13:30:00Z,109.10001,109.91,107.78,108.75999,15667301,-1.034211302\n2002-05-03T13:30:00Z,108.60001,108.75999,107.2,107.58,18186000,-10.52048126\n2002-05-06T13:30:00Z,107.647,107.998,105.31,105.47,23636000,-16.64849647\n2002-05-07T13:30:00Z,106.10899,106.32201,104.89999,105.10001,21921200,-3.842211863\n2002-05-08T13:30:00Z,107.05299,109.36,106.78999,109.00999,27918496,33.66000011\n2002-05-09T13:30:00Z,108.64999,109.10001,107.58,107.75,18087008,-5.429980573\n2002-05-10T13:30:00Z,107.97,108.05,105.60001,105.72,18959504,-16.97895977\n2002-05-13T13:30:00Z,106.22,107.95,105.799,107.87,14686898,12.21366464\n2002-05-14T13:30:00Z,109.62,110.37,109,110.22,34212304,20.38405218\n2002-05-15T13:30:00Z,109.5,110.91,109.28999,109.78999,29537808,-0.443377792\n2002-05-16T13:30:00Z,109.7,110.48,109.33,110.36,28095008,3.430681351\n2002-05-17T13:30:00Z,110.66,111.25,110.10001,110.89999,27823696,3.489744456\n2002-05-20T13:30:00Z,110.64,110.69,109.492,109.7,13833801,-10.39465248\n2002-05-21T13:30:00Z,110.11,110.487,108.32001,108.7,16877296,-6.966048464\n2002-05-22T13:30:00Z,108.22,109.12,108,108.94,15844301,0.735356537\n2002-05-23T13:30:00Z,109.261,110.36,108.48,110.10001,13880199,7.580434769\n2002-05-24T13:30:00Z,109.98,110.2,108.61,108.69,11875898,-9.548021629\n2002-05-28T13:30:00Z,109.05,109.13,107.45,108.10001,24237104,-5.369792135\n2002-05-29T13:30:00Z,107.629,108.02,107.13,107.3,14779102,-6.241738749\n2002-05-30T13:30:00Z,106.55099,107.50999,105.89999,107,18218096,-0.815646984\n2002-05-31T13:30:00Z,107.39999,108.56,106.85001,107.22,19826304,1.296210919\n2002-06-03T13:30:00Z,107.09,107.60001,104.13,104.37,26073904,-23.37822586\n2002-06-04T13:30:00Z,104.14999,105.2,103.55,104.63,25859808,-0.400739941\n2002-06-05T13:30:00Z,104.95,105.67,104.35001,105.61,19718304,6.454906015\n2002-06-06T13:30:00Z,105.543,105.60001,103.14999,103.46001,23364704,-17.76035482\n2002-06-07T13:30:00Z,101.789,103.92,101.72,103.34,24011600,0.538577398\n2002-06-10T13:30:00Z,103.243,104.46001,103.02,103.74001,18760192,3.968748504\n2002-06-11T13:30:00Z,104.131,104.53999,101.73,101.96001,19990800,-11.7362591\n2002-06-12T13:30:00Z,101.71001,102.81,100.78,102.58,31268304,1.468384899\n2002-06-13T13:30:00Z,102.13,103,101.34,101.55,21050896,-4.55094847\n2002-06-14T13:30:00Z,100.31,101.56,98.5,101.39999,39267504,1.486845261\n2002-06-17T13:30:00Z,101.92101,104.34,101.85001,104.12,17648496,25.16849025\n2002-06-18T13:30:00Z,103.74001,105.03,103.631,104.97,21775104,5.880109131\n2002-06-19T13:30:00Z,103.5,104.42999,102.24001,102.52,21541392,-16.23024152\n2002-06-20T13:30:00Z,102.265,103.05,100.96001,101.21001,25692000,-8.695582677\n2002-06-21T13:30:00Z,100.47,100.92999,98.687,99.28,31190704,-16.61488076\n2002-06-24T13:30:00Z,98.61,100.69,97.25,99.8,37173296,2.775125418\n2002-06-25T13:30:00Z,100.30299,100.89,97.53999,97.56,33389200,-12.83351835\n2002-06-26T13:30:00Z,95.2,98.14999,95.19501,97.72,37918496,2.981031641\n2002-06-27T13:30:00Z,98.5,99.49001,96.57001,99.42999,31728800,8.740935739\n2002-06-28T13:30:00Z,99.243,100.5,98.88,98.96001,28184304,-1.368118293\n2002-07-01T13:30:00Z,99.187,99.8,96.89,97.03,20282896,-13.36513286\n2002-07-02T13:30:00Z,96.869,97.2,94.77,94.97,34218400,-16.88173571\n2002-07-03T13:30:00Z,94.62,95.84,93.72701,95.50999,30566896,1.531783049\n2002-07-05T13:30:00Z,96.78,99.53,96.668,99.31,19014800,36.26282674\n2002-07-08T13:30:00Z,98.98,99.7,97.56,98.07001,19120896,-4.191498535\n2002-07-09T13:30:00Z,97.73,98.34,95.00999,95.60001,28623296,-20.22712232\n2002-07-10T13:30:00Z,96,96.07001,92.03999,92.12,50525392,-29.02871845\n2002-07-11T13:30:00Z,91.763,93.35001,90.32001,92.87,59532896,0.937963539\n2002-07-12T13:30:00Z,93.33299,93.89,91.52,91.85001,39026096,-4.733129073\n2002-07-15T13:30:00Z,91.64301,92.39999,87.89,92.34,77320192,2.371895674\n2002-07-16T13:30:00Z,91.127,92.38,89.87,90.56,53282400,-10.86536747\n2002-07-17T13:30:00Z,92.46001,93.3,89.75,90.74001,48996096,-3.811822984\n2002-07-18T13:30:00Z,90.703,91.10001,87.75,87.8,32701808,-23.83651617\n2002-07-19T13:30:00Z,86.767,87.55299,84.3,84.71001,77690624,-25.83162162\n2002-07-22T13:30:00Z,84.10699,85.91299,81.45,82.2,78249376,-16.28352189\n2002-07-23T13:30:00Z,82.55,83.24001,79.75,79.95,74499632,-15.54407374\n2002-07-24T13:30:00Z,78.13699,85.12,77.67999,84.72,106946000,29.60246716\n2002-07-25T13:30:00Z,84.27499,85.85001,81.60001,84,87194880,2.607126399\n2002-07-26T13:30:00Z,84.653,85.92999,83.8,85.60001,41210496,10.99830365\n2002-07-29T13:30:00Z,87.508,90.34,87.3,89.77,53496304,39.75413457\n2002-07-30T13:30:00Z,89.323,91.39999,88.72,90.94,47559008,7.985494024\n2002-07-31T13:30:00Z,90.49699,91.55,89.25,91.16,44707696,3.733072825\n2002-08-01T13:30:00Z,90.88,91.35001,88.33,88.78,66576320,-18.12325233\n2002-08-02T13:30:00Z,88.5,88.91701,85.62,86.78999,51775696,-17.41434383\n2002-08-05T13:30:00Z,86.498,86.933,83.55,83.77,47196400,-25.56944193\n2002-08-06T13:30:00Z,85.233,87.89999,85.05,86.59,65087696,17.42591191\n2002-08-07T13:30:00Z,87.879,88.5,85.77,88.10001,43696496,7.622283844\n2002-08-08T13:30:00Z,88.423,91.10001,87.8,90.95,48373600,23.29591854\n2002-08-09T13:30:00Z,90.10001,91.94,89.35001,91.28999,41880400,4.862962896\n2002-08-12T13:30:00Z,89.99699,91.27,89.55,90.62,25855696,-0.327134752\n2002-08-13T13:30:00Z,90.14999,91.66,88.64999,88.97,49637104,-8.106219606\n2002-08-14T13:30:00Z,89.02,92.63,88.02,92.22,57431904,21.24275949\n2002-08-15T13:30:00Z,92.847,93.99001,92.2,93.5,45552096,10.27874667\n2002-08-16T13:30:00Z,92.82001,94.08,92,93.22,36517296,0.34789786\n2002-08-19T13:30:00Z,93.46001,95.75,93.10001,95.39999,33672304,18.68745557\n2002-08-20T13:30:00Z,94.82201,95.39999,93.62,94.39,30512096,-3.639573193\n2002-08-21T13:30:00Z,95.063,95.78,93.57001,95.75,39632608,5.979693434\n2002-08-22T13:30:00Z,95.493,97.14999,95.07001,96.67999,38403808,6.587468434\n2002-08-23T13:30:00Z,96.017,96.14999,94.14999,94.60001,33717504,-15.38029845\n2002-08-26T13:30:00Z,94.91,95.64,93.5,95.25999,33831104,1.32506161\n2002-08-27T13:30:00Z,95.7,96.25,93.505,94.16,35340704,-6.902602104\n2002-08-28T13:30:00Z,93.287,93.49001,91.8,92.10001,38973808,-18.59649824\n2002-08-29T13:30:00Z,91.27,93.058,90.81,92.14,42967104,0.564728444\n2002-08-30T13:30:00Z,91.686,93.39,91.39999,91.78,30370896,-0.337979783\n2002-09-03T13:30:00Z,90.735,91,88.14999,88.28,76682192,-32.70169051\n2002-09-04T13:30:00Z,88.61501,90.25,88.06,89.53999,51099504,4.868921311\n2002-09-05T13:30:00Z,88.49001,89.42999,87.5,88.78,67318320,-2.207702936\n2002-09-06T13:30:00Z,89.75,90.57001,89.347,90,38622896,10.04323404\n2002-09-09T13:30:00Z,89.10001,91.351,88.8,90.66,34074896,4.854292005\n2002-09-10T13:30:00Z,91.14,91.78,90.56,91.7,41426704,7.434783284\n2002-09-11T13:30:00Z,92.47,93.33,91.10001,91.13,27745600,-4.728395478\n2002-09-12T13:30:00Z,90.75301,90.843,88.99001,89.45,43631504,-15.29680064\n2002-09-13T13:30:00Z,88.698,89.89999,88.25,89.67,41131008,1.44343519\n2002-09-16T13:30:00Z,89.317,89.89,88.466,89.89,28167600,3.383315837\n2002-09-17T13:30:00Z,90.89,91.19,87.75,87.83,47762096,-12.86549396\n2002-09-18T13:30:00Z,87.017,88.5,86.283,86.95,54829504,-5.442319542\n2002-09-19T13:30:00Z,85.995,86.8,84.7,84.7,48514000,-18.69813648\n2002-09-20T13:30:00Z,84.92,85.2,84.05,84.35001,46325696,-2.642823367\n2002-09-23T13:30:00Z,83.64999,84.06599,82.69,83.66,46904896,-5.170372227\n2002-09-24T13:30:00Z,82.44,83.64999,81.85001,82.31,69554496,-8.840332056\n2002-09-25T13:30:00Z,83.373,84.77,82.03999,84.35001,59294496,13.8917979\n2002-09-26T13:30:00Z,85.02,85.97,84.45,85.73,53670800,11.04574024\n2002-09-27T13:30:00Z,85,85.63,82.75,82.75,64776608,-23.53972245\n2002-09-30T13:30:00Z,82,82.8,80.00999,81.78999,73095312,-8.313560912\n2002-10-01T13:30:00Z,82.438,85.77,81.47,85.72,67274816,31.53891789\n2002-10-02T13:30:00Z,84.69,85.53,82.60001,83.14999,56846800,-12.77610526\n2002-10-03T13:30:00Z,83.14,84.60001,81.95,82.31,55548896,-4.897059577\n2002-10-04T13:30:00Z,82.8,82.92,79.58,80.8,68628368,-13.07042812\n2002-10-07T13:30:00Z,80.065,81.2,78.55,79.13,53211104,-11.77455357\n2002-10-08T13:30:00Z,79.81,81.31,78.2,80.37,79531632,5.241168224\n2002-10-09T13:30:00Z,79.09,79.7,77.78,78.10001,79893872,-17.74193933\n2002-10-10T13:30:00Z,77.94,81.07001,77.07001,80.63,76752128,15.85294153\n2002-10-11T13:30:00Z,82.10001,84.73,81.82001,84.16,82321680,32.09643204\n2002-10-14T13:30:00Z,83.2,84.85001,83.03999,84.63,40638400,5.118279217\n2002-10-15T13:30:00Z,86.991,88.72,86.856,88.7,82538320,40.49216524\n2002-10-16T13:30:00Z,87.41701,87.8,85.924,86.55,63526896,-13.58795033\n2002-10-17T13:30:00Z,88.87,89.3,87.85001,88.27,68584368,8.926659641\n2002-10-18T13:30:00Z,87.64999,89.11,86.92999,88.64,47559104,2.570036851\n2002-10-21T13:30:00Z,88.121,90.5,87.57001,90.17,45970704,10.25125286\n2002-10-22T13:30:00Z,89.05,90.00999,88.52,89.52,41214704,0.481639108\n2002-10-23T13:30:00Z,88.77,90.27,87.67999,90.2,55112496,6.424295582\n2002-10-24T13:30:00Z,90.75,90.89999,88.10001,88.36,55149808,-11.12976809\n2002-10-25T13:30:00Z,88.215,90.39,87.944,90.2,43724496,9.317089699\n2002-10-28T14:30:00Z,91.14999,91.28999,88.85001,89.61,39427008,-2.482024383\n2002-10-29T14:30:00Z,89.08,89.49001,87,88.57001,59529808,-9.337203131\n2002-10-30T14:30:00Z,88.67999,89.96001,88.23,89.42999,41703008,5.179658343\n2002-10-31T14:30:00Z,89.66,90.3,88.19,88.52,41621104,-4.359833175\n2002-11-01T14:30:00Z,88.35001,90.82001,88.05,90.27,51889504,11.41058612\n2002-11-04T14:30:00Z,91.8,92.94,90.89999,91.13,49081808,5.915654671\n2002-11-05T14:30:00Z,90.84,92.07001,90.84,91.85001,37282192,4.445740438\n2002-11-06T14:30:00Z,92.48,93.07001,90.78999,93.03999,65270000,5.186090523\n2002-11-07T14:30:00Z,92.02699,92.22,90.22,90.75999,51574096,-19.16978509\n2002-11-08T14:30:00Z,90.53,91.57001,89.52,89.64999,37911104,-6.112674956\n2002-11-11T14:30:00Z,89.515,89.56,87.8,88.25999,33580800,-12.7758383\n2002-11-12T14:30:00Z,88.66,89.92999,88.37,88.96001,37769392,2.902061684\n2002-11-13T14:30:00Z,88.32001,89.74899,87.45,89.05,63905008,2.106910681\n2002-11-14T14:30:00Z,90.07001,91,89.759,90.73,31938704,15.02870636\n2002-11-15T14:30:00Z,90,91.55,89.95,91.39999,39166192,4.457108473\n2002-11-18T14:30:00Z,92.14999,92.14999,90.35001,90.48,29019392,-4.288442482\n2002-11-19T14:30:00Z,90.02,91.10001,89.75999,90.36,32813696,-0.940964581\n2002-11-20T14:30:00Z,89.98,92.42,89.95,92.37,36815296,16.57876712\n2002-11-21T14:30:00Z,92.60001,94.19,92.42999,94.09,55170800,14.59091421\n2002-11-22T14:30:00Z,93.48,94.27,93.27299,93.42,32514096,-1.221117891\n2002-11-25T14:30:00Z,93.42999,94.25999,92.77,93.48,34059296,0.244202204\n2002-11-26T14:30:00Z,93.07401,93.45,91.62,91.7,42290400,-15.36126684\n2002-11-27T14:30:00Z,92.52,94.64999,92.42999,94.28,37773008,19.62106093\n2002-11-29T14:30:00Z,94.8,94.95,93.77,93.98,19385696,-0.697916667\n2002-12-02T14:30:00Z,95.47,96.05,93.22,94.13,49794400,-3.09050659\n2002-12-03T14:30:00Z,93.25,93.39999,92.35001,92.87,34433296,-11.34753351\n2002-12-04T14:30:00Z,91.77,93.14,91.42999,92.45,64137200,-0.872577403\n2002-12-05T14:30:00Z,92.7,92.80099,91.10001,91.42999,36778192,-6.696876102\n2002-12-06T14:30:00Z,90.12,92.17,89.98,92.03,50132096,4.472511742\n2002-12-09T14:30:00Z,91.07001,91.46001,89.48,89.5,36804096,-16.48957283\n2002-12-10T14:30:00Z,90.02,91.10001,89.75999,90.7,33449104,6.16104102\n2002-12-11T14:30:00Z,90.42,91.62,90.16,90.78,39206096,1.516871166\n2002-12-12T14:30:00Z,91.2,91.49001,90.2,90.77,34480496,-0.434106229\n2002-12-13T14:30:00Z,89.91,90.48,89.27,89.34,36873392,-11.68269231\n2002-12-16T14:30:00Z,89.82001,91.78999,89.66,91.64999,37112304,19.40410129\n2002-12-17T14:30:00Z,91.37199,91.74001,90.74001,90.85001,32399904,-2.354854478\n2002-12-18T14:30:00Z,90.32001,90.39999,89.33,89.8,35643104,-9.600128399\n2002-12-19T14:30:00Z,89.35001,90.7,88.60001,89.16,39287200,-2.90920359\n2002-12-20T14:30:00Z,89.2,90.02,89.10001,89.99001,31181104,6.541786823\n2002-12-23T14:30:00Z,89.59,90.47,89.31,90.02,22645504,1.385353457\n2002-12-24T14:30:00Z,89.59,89.86,89.25,89.355,10937000,-4.073275862\n2002-12-26T14:30:00Z,89.7,90.61,88.84,89.39,17489200,-0.766682331\n2002-12-27T14:30:00Z,88.96001,89.28999,87.38,87.38,22213008,-17.74171547\n2002-12-30T14:30:00Z,87.797,88.47,87.22,88.11,29972192,2.035453878\n2002-12-31T14:30:00Z,87.99001,88.42999,87.11,88.23,34037504,1.422524924\n2003-01-02T14:30:00Z,88.85001,91.3,88.53999,91.07001,44641392,25.86284176\n2003-01-03T14:30:00Z,90.91,91.38699,90.5,91.35001,32226000,2.606482188\n2003-01-06T14:30:00Z,91.24001,93.49001,91.17599,92.96001,41005696,14.23564898\n2003-01-07T14:30:00Z,92.89999,93.37,92.2,92.73,38655104,0.341395898\n2003-01-08T14:30:00Z,92.2,92.39999,91.05,91.39,38736704,-12.05060297\n2003-01-09T14:30:00Z,91.821,93.17999,91.41,92.81,34851200,9.661028807\n2003-01-10T14:30:00Z,91.95,93.64,91.8,93.06,37771600,3.182334711\n2003-01-13T14:30:00Z,93.53999,93.86,92.44,93.03,31676096,-0.022076583\n2003-01-14T14:30:00Z,92.69,93.83,92.41,93.33,30902800,1.5912869\n2003-01-15T14:30:00Z,93.53999,93.57001,91.91,92.39999,33542000,-6.53435352\n2003-01-16T14:30:00Z,92.5,92.92999,91.455,92.02,45374496,-3.036972156\n2003-01-17T14:30:00Z,90.99001,92.3,90.14999,90.66,35621008,-8.469609716\n2003-01-21T14:30:00Z,90.87,90.92,88.95,89.25,42370304,-11.98926455\n2003-01-22T14:30:00Z,88.77,89.8,88,88.17,42808608,-6.324404762\n2003-01-23T14:30:00Z,88.75,89.38,87.95,88.71001,56080800,1.771036986\n2003-01-24T14:30:00Z,88.59,88.67999,86.17,86.38,68700816,-21.57387113\n2003-01-27T14:30:00Z,85.73,86.8,84.5,85.2,58287504,-8.228089395\n2003-01-28T14:30:00Z,85.63,86.39999,85.13,85.83,46956704,3.195183321\n2003-01-29T14:30:00Z,85.44,87.17999,84.77,86.48,53780192,4.184437233\n2003-01-30T14:30:00Z,86.78999,86.88,84.39999,84.42999,49883392,-14.09130464\n2003-01-31T14:30:00Z,84.14999,86.215,84.14999,86.06,55321600,8.383023334\n2003-02-03T14:30:00Z,86.14,86.817,85.92,86.23,39799200,2.383700614\n2003-02-04T14:30:00Z,85.31,85.75,84.3,85.38,43757296,-5.582208029\n2003-02-05T14:30:00Z,85.754,86.53999,84.489,84.85001,55297904,-3.380463995\n2003-02-06T14:30:00Z,84.37,84.89,83.64999,84.45,53655904,-2.998026614\n2003-02-07T14:30:00Z,84.91,84.99001,82.97,83.42,43168192,-7.95768158\n2003-02-10T14:30:00Z,83.466,84.13,82.64999,84.00999,45470400,1.271613732\n2003-02-11T14:30:00Z,84.37,84.707,82.834,83.42999,46468704,-3.343905604\n2003-02-12T14:30:00Z,83.16,83.62,82.09,82.10001,35906304,-9.940668994\n2003-02-13T14:30:00Z,82.14999,82.66,81,82.35001,58064496,0.303619226\n2003-02-14T14:30:00Z,82.37,84.2,81.82899,84.14999,59588304,13.08577084\n2003-02-18T14:30:00Z,84.53,85.8,84.39,85.63,39512896,12.92336062\n2003-02-19T14:30:00Z,85.32001,85.47,84.28,85.17999,31440304,-1.33809466\n2003-02-20T14:30:00Z,85.21001,85.42,84.05,84.33,29299296,-6.660282125\n2003-02-21T14:30:00Z,84.38,85.74001,83.46001,85.17999,60965200,3.630710431\n2003-02-24T14:30:00Z,84.92999,85,83.59,83.8,30648800,-10.20045925\n2003-02-25T14:30:00Z,82.95,84.49001,82.22,84.47,56901296,4.439394277\n2003-02-26T14:30:00Z,84.024,84.53,83.08,83.24001,37799392,-5.896035348\n2003-02-27T14:30:00Z,83.7,84.75,83.16,84.34,51829008,6.467731741\n2003-02-28T14:30:00Z,84.47,85.23,84.16,84.89999,43888800,4.228336636\n2003-03-03T14:30:00Z,85.25999,85.78,83.72,84.09,42935392,-4.380692409\n2003-03-04T14:30:00Z,83.95,84.00999,82.64999,82.75,31475392,-11.87154349\n2003-03-05T14:30:00Z,82.61,83.53999,82.36,83.45,44105200,2.735625747\n2003-03-06T14:30:00Z,82.87,83.52,82.47,82.75,41412400,-2.673611111\n2003-03-07T14:30:00Z,81.61,83.99001,81.42999,83.32001,63582704,4.443579949\n2003-03-10T14:30:00Z,82.60001,82.86,81.10001,81.32001,41027504,-12.69842174\n2003-03-11T14:30:00Z,81.48,82,80.48,80.52,48114496,-4.565300272\n2003-03-12T14:30:00Z,80.38,81.10001,79.383,81.06,62475392,2.323953378\n2003-03-13T14:30:00Z,82.17999,83.91,81.53,83.86,72161184,24.36829948\n2003-03-14T14:30:00Z,84.2,84.77,83.35001,84.13,63963808,2.024642339\n2003-03-17T14:30:00Z,83.46001,86.95,83.22,86.78,88287008,20.18818529\n2003-03-18T14:30:00Z,87.15401,87.35001,86.28,87.28999,51081008,2.639993707\n2003-03-19T14:30:00Z,87.28,88.16,86.67999,87.96001,49659200,3.749607169\n2003-03-20T14:30:00Z,87.33,88.59,86.35001,88.14999,67461632,3.214905687\n2003-03-21T14:30:00Z,88.8,89.88,87.92999,89.67,71263632,10.83764956\n2003-03-24T14:30:00Z,88.02,88.14,86.35001,86.69,65430400,-25.65217937\n2003-03-25T14:30:00Z,86.74001,88.25999,86.44,87.52,61177600,4.04577453\n2003-03-26T14:30:00Z,87.56,87.85001,86.8,87.08,45757808,-1.753010524\n2003-03-27T14:30:00Z,86.39999,87.66,85.99001,87.14999,53291392,1.236863928\n2003-03-28T14:30:00Z,86.47,87.28,86.25,86.71001,32600704,-0.612044021\n2003-03-31T14:30:00Z,85.35001,86.59,84.39999,84.74001,60785904,-13.84374936\n2003-04-01T14:30:00Z,85.25,86.39,84.91,86.03999,53780096,9.26155653\n2003-04-02T14:30:00Z,87.53999,88.77,87.5,88.12,50498096,19.93551429\n2003-04-03T14:30:00Z,88.87,88.99001,87.64999,87.7,49009392,-3.148969228\n2003-04-04T14:30:00Z,88.42999,88.59,87.62,88.22,36261808,0.539749752\n2003-04-07T13:30:00Z,90.34,90.85001,87.97,88.05,69821184,-7.665223576\n2003-04-08T13:30:00Z,88.3,88.64999,87.71001,88.19,39741392,-1.208673524\n2003-04-09T13:30:00Z,88.36,89.10001,86.77,87.03,55678000,-6.973856951\n2003-04-10T13:30:00Z,87.095,87.63,85.71001,87.50999,42126000,1.300162959\n2003-04-11T13:30:00Z,88.16,88.701,86.86,87.14999,47735504,-2.913827165\n2003-04-14T13:30:00Z,87.47,89,87,88.95,36947504,11.74225043\n2003-04-15T13:30:00Z,88.84,89.78,88.42,89.78,49957008,5.007586705\n2003-04-16T13:30:00Z,89.91,90.06599,88.03,88.25,51809296,-10.23438566\n2003-04-17T13:30:00Z,88.3,89.72,88.194,89.56,37483392,7.218411901\n2003-04-21T13:30:00Z,89.86,90.16,89.06,89.64999,32082800,0.795013251\n2003-04-22T13:30:00Z,89.10001,91.56,88.89,91.34,59860608,12.09102965\n2003-04-23T13:30:00Z,91.62,92.35001,91.24001,92.17999,44250608,6.350305632\n2003-04-24T13:30:00Z,91.53,92.08,90.96001,91.36,50017296,-4.452710008\n2003-04-25T13:30:00Z,91.3,91.47,90.02,90.23,43923696,-9.581448911\n2003-04-28T13:30:00Z,90.44,92.19,90.3,91.78999,46469104,10.99278962\n2003-04-29T13:30:00Z,92.14,92.8,91.39999,91.78999,52340192,0.590353746\n2003-04-30T13:30:00Z,91.91,92.57001,91.41,91.91,48912496,0.127035301\n2003-05-01T13:30:00Z,91.92,92.731,90.5,91.89999,50405808,-0.079059699\n2003-05-02T13:30:00Z,91.56,93.47,91.491,93.21001,50236608,10.53475432\n2003-05-05T13:30:00Z,93.47,93.78,92.5,93.03,35453296,0.032754013\n2003-05-06T13:30:00Z,93.03999,94.38,93,93.91,44584096,6.823644086\n2003-05-07T13:30:00Z,93.42,94.14,92.972,93.39,41442000,-1.343432505\n2003-05-08T13:30:00Z,92.52,93.33701,92.28,92.45,40754800,-6.247536675\n2003-05-09T13:30:00Z,92.83,93.8,92.61,93.73,33639696,11.22269417\n2003-05-12T13:30:00Z,93.5,95.12,93.28,94.88,35680704,8.6875\n2003-05-13T13:30:00Z,94.534,95.189,94.25999,94.71001,39295904,0.799993378\n2003-05-14T13:30:00Z,95.09,95.24001,93.91,94.50999,32232096,-1.623085945\n2003-05-15T13:30:00Z,94.89,95.33,94.25,95.11,43932096,2.363830891\n2003-05-16T13:30:00Z,94.89,95.45,94.25999,94.87,38905904,-0.832081419\n2003-05-19T13:30:00Z,94.14999,94.8905,92.33,92.64999,43235296,-18.40899776\n2003-05-20T13:30:00Z,92.82001,93.03,91.597,92.46001,55450896,-2.711755013\n2003-05-21T13:30:00Z,92.11,92.88,91.91,92.64999,49848400,1.199822817\n2003-05-22T13:30:00Z,92.95,94.05,92.67999,93.57001,38456704,7.857877141\n2003-05-23T13:30:00Z,93.53,93.98,93.14,93.75999,26157696,1.24242731\n2003-05-27T13:30:00Z,93.3,95.84,93.17999,95.39999,43732608,13.1435053\n2003-05-28T13:30:00Z,95.85001,96.47,95.42999,95.67,37749808,2.984003735\n2003-05-29T13:30:00Z,95.88,96.82001,95.08,95.42,50978400,-2.113984233\n2003-05-30T13:30:00Z,95.901,97.09,95.56,96.95,52537600,11.80380831\n2003-06-02T13:30:00Z,97.53,98.45,96.67,97.35001,50700608,2.626996878\n2003-06-03T13:30:00Z,97.14999,97.84,96.85001,97.75,39551808,1.977673341\n2003-06-04T13:30:00Z,97.66,99.35001,97.569,99.16,49432704,11.96272389\n2003-06-05T13:30:00Z,98.584,99.64999,98.27,99.64999,46407104,4.430960611\n2003-06-06T13:30:00Z,100.39999,101.39999,99.13,99.25999,60397600,-2.990428139\n2003-06-09T13:30:00Z,98.769,99.10001,97.77,98.25,38388800,-8.540466649\n2003-06-10T13:30:00Z,98.46001,99.25999,98.19,99.25,30105504,6.657092357\n2003-06-11T13:30:00Z,99.16,100.39,98.71001,100.3,37617296,6.897340029\n2003-06-12T13:30:00Z,100.754,100.89999,99.62,100.61,36488608,1.420296615\n2003-06-13T13:30:00Z,100.61,100.74899,98.95,99.56,48635296,-9.108564624\n2003-06-16T13:30:00Z,99.96001,101.7,99.8,101.66,36338608,15.74819085\n2003-06-17T13:30:00Z,102.07001,102.179,101.23,101.66,36818192,0.519360968\n2003-06-18T13:30:00Z,101.28999,102.14,101,101.57001,35550096,-0.174237325\n2003-06-19T13:30:00Z,101.64,101.73,99.84,100.02,43559904,-12.63304032\n2003-06-20T13:30:00Z,100.39,100.5,99.42,99.44,41551696,-3.686868687\n2003-06-23T13:30:00Z,99.45,99.66,97.92,98.42,34317808,-8.51517067\n2003-06-24T13:30:00Z,98.22301,99.09,98.02,98.52,36220896,-0.028405603\n2003-06-25T13:30:00Z,98.53,99.44,97.53,97.53,47856800,-4.414756019\n2003-06-26T13:30:00Z,97.78,98.979,96.96001,98.8,33543504,6.106709373\n2003-06-27T13:30:00Z,98.74699,99.19,97.58,97.66,54211104,-5.840361595\n2003-06-30T13:30:00Z,98.22,98.67,97.47,97.63,33863696,-2.559520973\n2003-07-01T13:30:00Z,97.25301,98.85001,96.42999,98.53,51416400,4.130999491\n2003-07-02T13:30:00Z,98.77,99.78999,98.57001,99.77,34678000,10.40027408\n2003-07-03T13:30:00Z,99.07001,99.85001,97.90401,98.74001,30868400,-5.018618767\n2003-07-07T13:30:00Z,99.653,100.89999,99.64999,100.7,31426608,18.13328459\n2003-07-08T13:30:00Z,100.5,101.28999,100.17,101.14999,33158192,2.766725662\n2003-07-09T13:30:00Z,100.92,101.39999,100.03,100.58,36629296,-2.637810362\n2003-07-10T13:30:00Z,99.84,100.03999,98.63,99.3,49815600,-11.28986909\n2003-07-11T13:30:00Z,99.39,100.45,99.39,100.24001,40076400,7.129623236\n2003-07-14T13:30:00Z,101.2,101.89999,99.91499,100.73,42141504,2.207131164\n2003-07-15T13:30:00Z,101.38,101.46001,99.95,100.50999,63620400,-2.313970805\n2003-07-16T13:30:00Z,100.81,100.87,99.23,99.92,40194192,-5.394265536\n2003-07-17T13:30:00Z,99.14999,99.88,98.16,98.5,48913600,-11.02799745\n2003-07-18T13:30:00Z,99.02,99.8,98.46001,99.50999,35701696,5.907843451\n2003-07-21T13:30:00Z,99.45,99.494,97.85001,98.28,35092304,-9.89550369\n2003-07-22T13:30:00Z,98.69,99.41,97.91,99.17,50006704,3.299773361\n2003-07-23T13:30:00Z,99.21001,99.45,98.28,99.24001,37298304,0.884006298\n2003-07-24T13:30:00Z,99.99001,100.34,98.37,98.49001,41173296,-5.188796065\n2003-07-25T13:30:00Z,98.66,100.28999,98.03999,100.23,43325104,9.214140477\n2003-07-28T13:30:00Z,100.37,100.98,99.67,99.86,34416304,-0.640143172\n2003-07-29T13:30:00Z,100.14,100.27,98.67999,99.39999,53569808,-4.111610977\n2003-07-30T13:30:00Z,99.60001,99.78999,98.92999,99.16,28417600,-1.813086721\n2003-07-31T13:30:00Z,99.98,100.94,99.05,99.39,59112000,-0.973450189\n2003-08-01T13:30:00Z,99.19,99.53,98.24001,98.50999,49324496,-6.837563108\n2003-08-04T13:30:00Z,98.31,99,97,98.50999,55544400,-0.304465735\n2003-08-05T13:30:00Z,98.411,98.75999,96.34,96.42,61736704,-16.66756504\n2003-08-06T13:30:00Z,96.69,98.06,96.423,96.98,51180000,0.994411937\n2003-08-07T13:30:00Z,97.17,98.07001,96.758,98,43546800,7.417741994\n2003-08-08T13:30:00Z,98.32001,98.547,97.75999,98.28,27359504,1.607071353\n2003-08-11T13:30:00Z,98.25999,99.03999,97.84,98.64999,34633904,2.178654775\n2003-08-12T13:30:00Z,98.71001,99.59,98.42,99.55,43347008,6.570359344\n2003-08-13T13:30:00Z,99.82001,99.849,98.53,99.03999,36155504,-2.876978829\n2003-08-14T13:30:00Z,99.10001,99.75,98.45,99.31,36247392,0.534286675\n2003-08-15T13:30:00Z,99.36,99.78999,99.12,99.62,12567199,2.044965095\n2003-08-18T13:30:00Z,99.92999,100.60001,99.74001,100.48,22882096,7.46199829\n2003-08-19T13:30:00Z,100.687,100.94,100,100.86,37456800,1.681673592\n2003-08-20T13:30:00Z,100.28999,100.89,100.164,100.45,23206192,-1.621502437\n2003-08-21T13:30:00Z,101.05,101.52,100.39999,100.77,46550496,1.268319711\n2003-08-22T13:30:00Z,101.75,101.81799,99.73,99.77,52045008,-6.252517968\n2003-08-25T13:30:00Z,99.71001,100,99.28,99.92999,23485808,-0.567180041\n2003-08-26T13:30:00Z,99.5,100.39,98.83,100.11,45076608,2.298769114\n2003-08-27T13:30:00Z,100.05,100.36,99.57001,100.14,18987808,0.81464873\n2003-08-28T13:30:00Z,100.39999,101,99.66,100.75999,27426400,3.244685321\n2003-08-29T13:30:00Z,100.61,101.48,100.48,101.44,28721200,4.892311067\n2003-09-02T13:30:00Z,101.64,102.88,101.05,102.8,50860608,9.485889571\n2003-09-03T13:30:00Z,103.03,103.7,102.78,103.36,44923904,4.718491736\n2003-09-04T13:30:00Z,103.10001,103.55,102.75999,103.41,28404400,1.235658294\n2003-09-05T13:30:00Z,102.94,103.549,102.39999,102.83,31654496,-2.869341912\n2003-09-08T13:30:00Z,103.03999,103.88,102.92999,103.67999,32655392,7.296889675\n2003-09-09T13:30:00Z,103.37,103.46001,102.67999,103,35083504,-4.196329083\n2003-09-10T13:30:00Z,102.53999,102.8,101.55,101.96001,45944704,-8.936724437\n2003-09-11T13:30:00Z,102.10001,102.75999,101.84,102.25999,38797008,1.103156972\n2003-09-12T13:30:00Z,101.91,102.64,101.35001,102.45,42441200,2.138156398\n2003-09-15T13:30:00Z,102.52,102.63,101.95,102.09,21321904,-1.687116564\n2003-09-16T13:30:00Z,102.23199,103.64,102.17,103.58,37946496,12.31678033\n2003-09-17T13:30:00Z,103.48,103.785,103.05,103.38,32072400,0.268838721\n2003-09-18T13:30:00Z,103.39999,104.7,103.17,104.60001,30295008,9.523418006\n2003-09-19T13:30:00Z,104.27,104.60001,103.39999,103.67,34381600,-4.650025\n2003-09-22T13:30:00Z,102.85001,102.96001,102.03,102.55,36700608,-10.14285752\n2003-09-23T13:30:00Z,102.59,103.28999,102.36,102.94,32513200,2.254949975\n2003-09-24T13:30:00Z,103.118,103.22,101.07001,101.11,41717504,-14.34623042\n2003-09-25T13:30:00Z,101.41,101.88,100.2,100.28,53174496,-4.944632218\n2003-09-26T13:30:00Z,100.44,100.66,99.84599,99.95,42916096,-2.121296061\n2003-09-29T13:30:00Z,100.3,100.99001,99.78999,100.92999,36785200,5.762654463\n2003-09-30T13:30:00Z,100.48,100.75999,99.25,99.95,70775872,-6.515654623\n2003-10-01T13:30:00Z,100.24001,102.17999,100.2,102.08,65802816,18.17322277\n2003-10-02T13:30:00Z,101.92999,102.56,101.63,102.45,44638800,2.352527612\n2003-10-03T13:30:00Z,103.67,104.28,103.08,103.39,48820496,6.466192966\n2003-10-06T13:30:00Z,103.48199,103.99001,103.2,103.86,20242496,2.568348697\n2003-10-07T13:30:00Z,103.25999,104.31,102.91,104.25999,42619392,3.951013276\n2003-10-08T13:30:00Z,104.33,104.39,103.41,104,30943808,-0.755791413\n2003-10-09T13:30:00Z,104.88,105.22,103.83,104.28,40094800,-0.530772496\n2003-10-10T13:30:00Z,104.27,104.60001,103.91,104.57001,22686000,0.798394885\n2003-10-13T13:30:00Z,104.715,105.28999,104.50999,104.89999,23829504,2.618222245\n2003-10-14T13:30:00Z,104.8,105.42999,104.36,105.27,38504400,1.969073211\n2003-10-15T13:30:00Z,105.86,105.89,104.64,104.99001,39881200,-1.720363574\n2003-10-16T13:30:00Z,104.67999,105.73,104.64999,105.41,32793504,2.022832599\n2003-10-17T13:30:00Z,105.47,105.63,103.98,104.25999,32801200,-7.669474104\n2003-10-20T13:30:00Z,104.44701,105.03999,103.94,105.03999,27778096,2.690345269\n2003-10-21T13:30:00Z,104.82001,105.28,104.32001,104.86,26763696,-0.047709675\n2003-10-22T13:30:00Z,104.03,104.19,103.19,103.53999,34121696,-12.06730507\n2003-10-23T13:30:00Z,102.89,103.95,102.84,103.35001,46399808,-0.292765254\n2003-10-24T13:30:00Z,102.83,103.58,102.17999,103.58,51735104,3.475242056\n2003-10-27T14:30:00Z,103.74001,104.17999,103.27,103.63,32499008,0.623554514\n2003-10-28T14:30:00Z,103.98,105.14999,103.82001,105.03999,35035200,12.50851675\n2003-10-29T14:30:00Z,104.77,105.42999,103.87,105.17999,30965296,2.444143881\n2003-10-30T14:30:00Z,105.78999,105.97,104.8,105.39999,39144800,0.494717573\n2003-10-31T14:30:00Z,105.39999,105.74001,105.22,105.3,25764704,-0.851705334\n2003-11-03T14:30:00Z,105.75,106.61,105.71001,105.99001,37599200,5.687941098\n2003-11-04T14:30:00Z,105.99001,106.27,105.58,105.75999,31433760,-0.973864464\n2003-11-05T14:30:00Z,105.53999,105.97,104.89999,105.84,33637008,0.822375977\n2003-11-06T14:30:00Z,105.60001,106.44,105.10001,106.39999,28409392,3.382865546\n2003-11-07T14:30:00Z,106.64,106.72,105.57001,105.61,31737008,-4.245990465\n2003-11-10T14:30:00Z,105.74001,105.84,105.00999,105.17999,25538304,-3.336300788\n2003-11-11T14:30:00Z,105.09,105.33,104.8,105.14999,26809008,-0.49628734\n2003-11-12T14:30:00Z,105.23,106.47,105.16,106.33,28053696,10.8243563\n2003-11-13T14:30:00Z,106.00999,106.53999,105.78,106.36,29723600,1.594234908\n2003-11-14T14:30:00Z,106.39999,106.95,105.28999,105.46001,49162704,-4.907918219\n2003-11-17T14:30:00Z,104.91,105.14,104.03999,104.92999,44438704,-4.482175288\n2003-11-18T14:30:00Z,105.24001,105.45,103.7,103.84,41167600,-7.818846875\n2003-11-19T14:30:00Z,104.03,105.00999,103.92,104.72,29836704,4.323241186\n2003-11-20T14:30:00Z,103.91,105.24001,103.75,103.78,53631696,-3.03579001\n2003-11-21T14:30:00Z,104.24001,104.33,103.62,104.21001,30025504,1.77087963\n2003-11-24T14:30:00Z,104.69,105.78,104.67999,105.59,28967104,13.32072195\n2003-11-25T14:30:00Z,105.71001,106.42,105.45,105.99001,37582304,3.320911611\n2003-11-26T14:30:00Z,106.42,106.45,105.39,106.37,33076304,1.41038855\n2003-11-28T14:30:00Z,106.31,106.66,106.201,106.45,10507801,0.528565748\n2003-12-01T14:30:00Z,106.92999,107.67999,106.8,107.60001,38710704,10.72033574\n2003-12-02T14:30:00Z,107.42999,107.77,107.07001,107.33,35369904,-0.582316036\n2003-12-03T14:30:00Z,107.64999,108.08,107.07001,107.16,39108096,-1.992743723\n2003-12-04T14:30:00Z,107.17,107.72,106.94,107.60001,36094896,2.065170541\n2003-12-05T14:30:00Z,107.12,107.8,106.62,106.85001,28842704,-3.698781288\n2003-12-08T14:30:00Z,106.74001,107.64,106.67999,107.57001,32493104,5.12962375\n2003-12-09T14:30:00Z,107.89999,107.92999,106.53999,106.74001,43621504,-4.84580888\n2003-12-10T14:30:00Z,106.8,106.98,105.96001,106.73,36924800,-1.246693187\n2003-12-11T14:30:00Z,106.67999,108.10001,106.67,107.92999,45474304,10.6919787\n2003-12-12T14:30:00Z,107.99001,108.2,106.64999,108.14,34144896,2.56645065\n2003-12-15T14:30:00Z,109.17,109.23,107.48,107.60001,38688192,-4.906864817\n2003-12-16T14:30:00Z,107.67999,108.5,107.52,108.16,32905296,1.670056207\n2003-12-17T14:30:00Z,108.06,108.5,107.8,108.5,23204896,1.86585483\n2003-12-18T14:30:00Z,108.55,109.73,108.39,109.72,29790496,10.15280172\n2003-12-19T14:30:00Z,109.3,109.37,108.58,108.89999,41466608,-4.122102883\n2003-12-22T14:30:00Z,108.83,109.66,108.78,109.66,27635200,5.210550803\n2003-12-23T14:30:00Z,109.48,109.95,109.38,109.73,24755808,0.938303859\n2003-12-24T14:30:00Z,109.52,109.88,109.42999,109.62,8055801,0.009146468\n2003-12-26T14:30:00Z,109.71001,110.08,109.63,109.7,8308398,0.598928385\n2003-12-29T14:30:00Z,110.10001,111.27,109.7843,111.16,22547600,12.74364577\n2003-12-30T14:30:00Z,111.09,111.27,110.85001,111.17999,19581696,0.933331586\n2003-12-31T14:30:00Z,111.22,111.52,110.84,111.28,31503392,0.461336829\n2004-01-02T14:30:00Z,111.74001,112.19,110.73,111.23,38075600,-1.118239619\n2004-01-05T14:30:00Z,111.78,112.52,111.59,112.44,27967392,9.202616636\n2004-01-06T14:30:00Z,112.16,112.73,112,112.55,20501200,1.444134078\n2004-01-07T14:30:00Z,112.35001,113.06,111.89,112.92999,30180000,2.497715976\n2004-01-08T14:30:00Z,113.25,113.41,112.77,113.38,37044608,2.522380716\n2004-01-09T14:30:00Z,112.83,113.5,112.27,112.39,54092304,-6.470420792\n2004-01-12T14:30:00Z,112.55,113.25,112.36,113.22,33566496,5.670625\n2004-01-13T14:30:00Z,113.09,113.23,111.75999,112.56,54286400,-4.22118634\n2004-01-14T14:30:00Z,112.75999,113.66,112.67,113.5,30141392,6.875029193\n2004-01-15T14:30:00Z,113.57001,114.06,112.58,113.78,38432608,1.968456879\n2004-01-16T14:30:00Z,114.03999,114.31,113.63,114.23,31925808,2.702025647\n2004-01-20T14:30:00Z,114.53,114.64999,113.82001,114.2,29879504,-0.441230132\n2004-01-21T14:30:00Z,114.13,115.3,113.72,115.10001,30743008,5.386340226\n2004-01-22T14:30:00Z,115.14,115.38,114.58,114.8,29914000,-0.709267934\n2004-01-23T14:30:00Z,115,115.37,113.95,114.42999,49968608,-2.612179194\n2004-01-26T14:30:00Z,114.44,115.92999,114.38,115.87,30474096,11.14761679\n2004-01-27T14:30:00Z,115.85001,116.5,114.64999,114.67999,35353008,-4.896321464\n2004-01-28T14:30:00Z,114.98,115.28,112.94,113.37,52884096,-9.945416118\n2004-01-29T14:30:00Z,113.56,113.85001,112.56,113.48,60119904,-0.9945473\n2004-01-30T14:30:00Z,113.52,113.72,113.09,113.48,30992800,-0.15\n2004-02-02T14:30:00Z,113.7,114.67999,113.12,113.97,38850192,2.937892319\n2004-02-03T14:30:00Z,113.74001,114.14,113.44,113.78,25155904,-0.442407573\n2004-02-04T14:30:00Z,113.19,113.73,112.78999,112.85001,39597600,-6.917245027\n2004-02-05T14:30:00Z,113.08,113.53999,112.78,113.17999,35990704,1.505411141\n2004-02-06T14:30:00Z,113.42,114.7,113.2,114.45,37237296,11.20205627\n2004-02-09T14:30:00Z,114.67,114.87,114.28999,114.48,24859904,0.603351005\n2004-02-10T14:30:00Z,114.28,115.14,114.25999,114.85001,27933296,2.701856988\n2004-02-11T14:30:00Z,114.8,116.39,114.17,116.07001,42976896,8.137932063\n2004-02-12T14:30:00Z,115.98,116.27,115.58,115.64999,27828496,-0.813203319\n2004-02-13T14:30:00Z,115.82001,116.2,114.75,115.13,44741904,-3.477719755\n2004-02-17T14:30:00Z,115.85001,116.42999,115.77,116.17,23988000,7.243702102\n2004-02-18T14:30:00Z,116.2,116.60001,115.35001,115.66,28660400,-2.69735023\n2004-02-19T14:30:00Z,116.33,116.39,115.06,115.23,51183104,-3.472482935\n2004-02-20T14:30:00Z,115.48,115.5616,114.32001,114.88,46728800,-3.468887232\n2004-02-23T14:30:00Z,115.22,115.25999,114.17,114.59,36361600,-2.701886709\n2004-02-24T14:30:00Z,114.27,114.99001,113.89999,114.39,43958896,-1.028430281\n2004-02-25T14:30:00Z,114.46001,115.06,114.32001,114.87,31234304,3.888416164\n2004-02-26T14:30:00Z,114.61,115.28999,114.34,114.94,29685600,1.062207835\n2004-02-27T14:30:00Z,115.19,115.74001,114.63,115.02,39275008,0.324948926\n2004-03-01T14:30:00Z,115.42999,116.34,115.25,116.16,33192800,9.671876754\n2004-03-02T14:30:00Z,115.94,116.97,115.23,115.48,38607392,-2.19951819\n2004-03-03T14:30:00Z,115.25,115.87,114.92,115.69,31355392,1.035211268\n2004-03-04T14:30:00Z,115.72,116.10001,115.52,115.99001,21073296,2.024079363\n2004-03-05T14:30:00Z,115.42,116.95,115.28,116.38,55923008,3.237345792\n2004-03-08T14:30:00Z,116.34,116.62,114.91,114.96001,39289600,-8.81050625\n2004-03-09T14:30:00Z,115.10001,115.21001,114.24001,114.5,39749504,-3.781418786\n2004-03-10T14:30:00Z,114.72,114.77,112.56,112.58,67802816,-16.13241101\n2004-03-11T14:30:00Z,112.39999,113.27,111.10001,111.12,89377632,-9.010583796\n2004-03-12T14:30:00Z,111.73,112.71001,111.58,112.58,54026608,9.257286147\n2004-03-15T14:30:00Z,112.27,112.35001,110.89999,111.2,57687296,-10.05693702\n2004-03-16T14:30:00Z,111.78,112.06,110.84,111.78999,60105504,1.18334916\n2004-03-17T14:30:00Z,112.17999,113.25999,112.10001,113.03999,41879200,11.73289749\n2004-03-18T14:30:00Z,112.71001,113.27,111.92999,113.07001,60025008,1.89617832\n2004-03-19T14:30:00Z,112.41,112.57001,111.03999,111.06,48643296,-17.60650354\n2004-03-22T14:30:00Z,110.53999,110.57001,109.10001,109.64999,62759008,-13.08559118\n2004-03-23T14:30:00Z,110.25,110.39999,109.36,109.46001,54104304,-2.99807449\n2004-03-24T14:30:00Z,109.58,110.14,108.85001,109.55,51594800,-0.350019223\n2004-03-25T14:30:00Z,110.08,111.3,109.78999,111,49982096,12.70749937\n2004-03-26T14:30:00Z,110.955,111.78999,110.8,111.03,37413104,1.204016145\n2004-03-29T14:30:00Z,111.63,112.74001,111.58,112.59,44116800,15.1352488\n2004-03-30T14:30:00Z,112.3,113.07001,112.22,112.97,39061392,2.628471012\n2004-03-31T14:30:00Z,112.99001,113.39999,112.38,113.10001,48596496,1.094645534\n2004-04-01T14:30:00Z,113.07001,113.87,113.05,113.78,45114304,6.033206675\n2004-04-02T14:30:00Z,114.81,114.84,113.89999,114.64,50997696,5.359050989\n2004-04-05T13:30:00Z,114.46001,115.38,114.44,115.27,30280096,4.672050254\n2004-04-06T13:30:00Z,114.83,115.17999,114.62,114.89999,28480096,-0.666696401\n2004-04-07T13:30:00Z,114.98,114.98,114.11,114.63,45898400,-2.378279939\n2004-04-08T13:30:00Z,115.41,115.41,113.74001,114.37,46937808,-2.745628442\n2004-04-12T13:30:00Z,114.58,115.08,114.57001,114.82001,23087200,1.581263757\n2004-04-13T13:30:00Z,115.25999,115.3,113.02,113.21001,56235504,-12.37980315\n2004-04-14T13:30:00Z,112.61,113.64,112.55,113.39,62334304,0.148000754\n2004-04-15T13:30:00Z,113.45,113.78,112.36,112.96001,61621008,-1.913252902\n2004-04-16T13:30:00Z,113.36,114.05,112.98,113.83,47059296,5.566079415\n2004-04-19T13:30:00Z,113.57001,113.99001,113.27,113.83,28278000,1.034295113\n2004-04-20T13:30:00Z,114.08,114.32001,111.78,111.92,53345104,-14.38636723\n2004-04-21T13:30:00Z,112.2,112.95,111.87,112.67,50301296,1.768325617\n2004-04-22T13:30:00Z,112.48,114.67,112.44,114.25,62142800,13.7513312\n2004-04-23T13:30:00Z,114.42,114.57001,113.78999,114.36,29422096,1.228789841\n2004-04-26T13:30:00Z,114.5,114.94,113.60001,114.2,35565200,-1.13929231\n2004-04-27T13:30:00Z,114.23,115.12,113.96001,114.3,43490496,0.279354489\n2004-04-28T13:30:00Z,113.89,114.00999,112.5,112.82001,50173504,-13.43603793\n2004-04-29T13:30:00Z,112.72,113.32001,111.16,111.83,69703376,-7.276443726\n2004-04-30T13:30:00Z,112.12,112.38,110.89999,110.96001,48683904,-5.71005374\n2004-05-03T13:30:00Z,111.37,112.28999,111.35001,112.14999,33764608,7.524874408\n2004-05-04T13:30:00Z,112.25,113.25999,111.66,112.06,51193904,0.038678281\n2004-05-05T13:30:00Z,112.41,112.96001,112.16,112.78,34430304,5.374303455\n2004-05-06T13:30:00Z,112.02,112.58949,111,111.81,55006896,-6.150143903\n2004-05-07T13:30:00Z,111.22,112.23,109.96001,109.96001,60957104,-12.60789047\n2004-05-10T13:30:00Z,109.44,109.75,108.36,108.83,75336320,-9.668596798\n2004-05-11T13:30:00Z,109.46001,110.05,109.33,109.75,48348704,6.198462695\n2004-05-12T13:30:00Z,109.61,110.53999,108.06,110.45,90896000,4.934697954\n2004-05-13T13:30:00Z,109.75999,110.81,109.63,109.99001,57500704,-0.497678058\n2004-05-14T13:30:00Z,109.98,110.74001,109.27,110.03999,54131808,0.421886201\n2004-05-17T13:30:00Z,108.89,109.5,108.41,109.10001,55069504,-6.075283707\n2004-05-18T13:30:00Z,109.49001,109.94,109.33,109.64999,30203104,4.608295166\n2004-05-19T13:30:00Z,110.5,111.17999,109.14999,109.27,55014304,-4.411672341\n2004-05-20T13:30:00Z,109.45,109.87,109.03999,109.62,38126192,0.420325975\n2004-05-21T13:30:00Z,109.97,110.55,109.47,109.81,47486608,0.789671492\n2004-05-24T13:30:00Z,110.53,110.75999,109.67999,110.27,40976800,1.53737221\n2004-05-25T13:30:00Z,109.89999,111.98,109.60001,111.85001,51714096,10.88433439\n2004-05-26T13:30:00Z,111.66,112.28999,111.50999,112.24001,35982704,2.532934041\n2004-05-27T13:30:00Z,112.53999,113.03,112.06,112.87,45311904,4.16248296\n2004-05-28T13:30:00Z,112.73,112.88,112.36,112.86,23369008,0.727447967\n2004-06-01T13:30:00Z,112.46001,112.86,111.87,112.71001,41059200,0.045445599\n2004-06-02T13:30:00Z,113.03,113.48,112.46001,113.13,39780496,2.367296552\n2004-06-03T13:30:00Z,112.81,113.19,112.07001,112.09,38719008,-7.955780454\n2004-06-04T13:30:00Z,112.98,113.58,112.71001,112.98,32759904,4.861690668\n2004-06-07T13:30:00Z,113.5,114.81,113.42,114.7,31673600,16.48136646\n2004-06-08T13:30:00Z,114.37,114.92,114.17,114.86,32852400,2.224107143\n2004-06-09T13:30:00Z,114.50999,114.7,113.72,113.78999,36802496,-7.878231501\n2004-06-10T13:30:00Z,114.03999,114.35001,113.92999,114.35001,21718608,2.794949224\n2004-06-14T13:30:00Z,113.82001,113.85001,112.87,113.22,34634896,-9.568381267\n2004-06-15T13:30:00Z,113.89999,114.44501,113.50999,114.02,37446000,4.419450143\n2004-06-16T13:30:00Z,114,114.2,113.7,114,26638704,0.037745105\n2004-06-17T13:30:00Z,113.78999,114.07001,113.33,113.83,28473904,-0.848777804\n2004-06-18T13:30:00Z,113.27,114.22,113.17999,113.63,31803104,-0.038680938\n2004-06-21T13:30:00Z,113.75,114.14,113.13,113.2,24740800,-1.782102273\n2004-06-22T13:30:00Z,113.13,113.88,112.67,113.77,37337392,2.373376623\n2004-06-23T13:30:00Z,113.58,114.84,113.42,114.75,35760304,7.301226266\n2004-06-24T13:30:00Z,114.5,114.92999,114.25999,114.39,39410608,-0.389780682\n2004-06-25T13:30:00Z,114.41,114.94,113.67999,113.84,32872704,-2.972712955\n2004-06-28T13:30:00Z,114.53,114.61,113.41,113.45,41277392,-3.844622905\n2004-06-29T13:30:00Z,113.5,114.17,113.42,113.92,28426896,1.808823529\n2004-06-30T13:30:00Z,114.07001,114.78999,113.64999,114.53,52610400,4.127189759\n2004-07-01T13:30:00Z,114.25,114.39999,112.58,112.94,57778192,-12.97975141\n2004-07-02T13:30:00Z,113.16,113.28999,112.60001,112.88,34620496,-1.134050086\n2004-07-06T13:30:00Z,112.37,112.45,111.63,111.89,38710608,-9.191176471\n2004-07-07T13:30:00Z,111.81,112.57001,111.75,112.22,30039296,1.876337419\n2004-07-08T13:30:00Z,111.75,112.32001,111.2,111.42,45292000,-4.497662596\n2004-07-09T13:30:00Z,111.67,111.94,111.38,111.73,27411392,1.302529183\n2004-07-12T13:30:00Z,111.52,112.03999,111,111.78,35691296,0.843313681\n2004-07-13T13:30:00Z,111.92,112.02,111.60001,111.86,26816096,0.355677437\n2004-07-14T13:30:00Z,111.25999,112.39,111.12,111.52,54236096,-0.809806907\n2004-07-15T13:30:00Z,111.74001,111.91,110.7,110.8,38432800,-4.522060006\n2004-07-16T13:30:00Z,111.57001,111.67,110.44,110.71001,40873200,-2.802228473\n2004-07-19T13:30:00Z,110.75,110.96001,109.99001,110.24001,39598096,-3.569601266\n2004-07-20T13:30:00Z,110.53,111.89999,110.25,111.64,47290096,10.63685408\n2004-07-21T13:30:00Z,111.82001,112.06,109.45,109.58,56264192,-13.7586276\n2004-07-22T13:30:00Z,109.36,110.39,108.77,109.88,72660128,-5.80561E-06\n2004-07-23T13:30:00Z,109.62,109.71001,108.69,108.96001,49610608,-6.74482163\n2004-07-26T13:30:00Z,109.21001,109.42999,108.21001,108.75,49687904,-2.047683875\n2004-07-27T13:30:00Z,109.05,110.11,108.97,109.77,51311392,7.877259382\n2004-07-28T13:30:00Z,109.55,110.37,108.59,110.10001,66079120,2.953819196\n2004-07-29T13:30:00Z,110.53999,110.87,110,110.57001,52353600,2.973493862\n2004-07-30T13:30:00Z,110.32001,110.89999,110.10001,110.84,41589696,1.955301801\n2004-08-02T13:30:00Z,110.19,113.61,110.05,111.07001,38802608,3.753448724\n2004-08-03T13:30:00Z,110.92999,111.06,110.16,110.21001,40988096,-5.055514213\n2004-08-04T13:30:00Z,109.89,110.75,109.64,110.2,40787008,-0.096672856\n2004-08-05T13:30:00Z,110.28999,110.38,108.27,108.39999,50819296,-14.70941229\n2004-08-06T13:30:00Z,107.63,107.965,106.62,106.85001,74748624,-13.18855014\n2004-08-09T13:30:00Z,107.02,107.48,106.87,107,37481104,-0.265755321\n2004-08-10T13:30:00Z,107.31,108.41,107.25999,108.22,56101696,11.45277645\n2004-08-11T13:30:00Z,107.66,108.33,107.10001,108.16,53001200,2.005141652\n2004-08-12T13:30:00Z,107.62,107.95,106.63,106.98,50037808,-8.482862903\n2004-08-13T13:30:00Z,107.12,107.35001,106.59,107.19,41640800,0.225201357\n2004-08-16T13:30:00Z,107.14,108.64,107.10001,108.3,45747008,9.935356728\n2004-08-17T13:30:00Z,108.75,109.28,108.53,108.91,40775104,5.196969697\n2004-08-18T13:30:00Z,108.53999,110.17,108.49001,110.03,43204192,8.722093951\n2004-08-19T13:30:00Z,109.81,110.02,109.17999,109.71001,39968800,0.010985001\n2004-08-20T13:30:00Z,109.61,110.63,109.50999,110.48,44893696,5.925623304\n2004-08-23T13:30:00Z,110.55,110.77,110.05,110.2,33850304,-0.680833333\n2004-08-24T13:30:00Z,110.69,110.73,109.85001,110.35001,30553600,-0.368008003\n2004-08-25T13:30:00Z,110.33,111.27,109.89999,111.10001,38582000,4.149447683\n2004-08-26T13:30:00Z,110.99001,111.31,110.85001,111.10001,26634096,0.592685213\n2004-08-27T13:30:00Z,111.23,111.63,111.05,111.45,24904704,2.658074332\n2004-08-30T13:30:00Z,111.23,111.34,110.45,110.53,26729808,-7.59375\n2004-08-31T13:30:00Z,110.66,111.16,110.10001,111.11,44207808,2.008619503\n2004-09-01T13:30:00Z,110.94,111.64,110.48,111.32001,52792608,1.585876473\n2004-09-02T13:30:00Z,111.24001,112.7,111.24001,112.58,42831392,11.23181663\n2004-09-03T13:30:00Z,112.27,112.82001,112.00999,112.12,30491600,-0.622279927\n2004-09-07T13:30:00Z,112.53999,113.13,112.32001,112.86,37352496,5.746270759\n2004-09-08T13:30:00Z,112.62,113.06,112.31,112.58,33004800,-0.91113148\n2004-09-09T13:30:00Z,112.57001,112.88,112.03,112.48,34332400,-0.619569404\n2004-09-10T13:30:00Z,112.52,113.27,112.08,113.06,27914608,3.369699367\n2004-09-13T13:30:00Z,113.31,113.74001,113.00999,113.42999,44537904,2.775914501\n2004-09-14T13:30:00Z,113.3,113.69,113.19,113.66,28067296,1.349137851\n2004-09-15T13:30:00Z,113.3,113.36,112.67999,112.8,38458800,-6.79075635\n2004-09-16T13:30:00Z,112.94,113.37,112.8,113.14,23917504,1.614658273\n2004-09-17T13:30:00Z,112.91,113.36,112.69,113.14999,33694496,0.703066406\n2004-09-20T13:30:00Z,112.67,112.99001,112.28,112.47,37189808,-4.605794981\n2004-09-21T13:30:00Z,112.75,113.47,112.53999,112.96001,40929392,3.355987163\n2004-09-22T13:30:00Z,112.5,112.52,111.47,111.55,49169200,-12.90377607\n2004-09-23T13:30:00Z,111.60001,111.7,110.95,110.95,44090304,-4.414575949\n2004-09-24T13:30:00Z,111.17,111.73,111.13,111.46001,35011600,2.816412195\n2004-09-27T13:30:00Z,111.10001,111.2,110.58,110.75,39672096,-5.433226484\n2004-09-28T13:30:00Z,110.91,111.50999,110.41,111.28,41702304,2.509972826\n2004-09-29T13:30:00Z,111.21001,111.85001,111,111.84,33866704,3.657002478\n2004-09-30T13:30:00Z,111.55,111.98,111.25999,111.75999,43592096,0.75385164\n2004-10-01T13:30:00Z,112.25999,113.64999,112.21001,113.64999,62844304,18.14012575\n2004-10-04T13:30:00Z,114.09,114.44,113.8,113.84,33587104,1.91697348\n2004-10-05T13:30:00Z,113.85001,114.16,113.53999,113.89999,37162704,0.065874493\n2004-10-06T13:30:00Z,113.77,114.67999,113.67999,114.62,42297808,5.573199744\n2004-10-07T13:30:00Z,114.38,114.39999,113.36,113.45,39410304,-8.221819163\n2004-10-08T13:30:00Z,113.14999,113.7,112.35001,112.50999,51882800,-6.484030211\n2004-10-11T13:30:00Z,112.78,113.02,112.64,112.97,20246192,2.081171334\n2004-10-12T13:30:00Z,112.2,112.83,111.94,112.53,41855296,-1.453629032\n2004-10-13T13:30:00Z,113,113.07001,111.32001,111.53999,54434304,-6.757765262\n2004-10-14T13:30:00Z,111.75,111.92999,110.58,110.64,64549392,-6.367282219\n2004-10-15T13:30:00Z,111.03999,111.74001,110.57001,111.25999,63483392,2.149151662\n2004-10-18T13:30:00Z,110.89,111.89999,110.7,111.67999,43762608,2.772914525\n2004-10-19T13:30:00Z,112.02,112.23,110.59,110.74001,56057808,-5.12547177\n2004-10-20T13:30:00Z,110.38,110.82001,109.75,110.52,57174896,-2.092219489\n2004-10-21T13:30:00Z,110.78999,111.32001,110.21001,111.24001,53261696,4.279616813\n2004-10-22T13:30:00Z,111.19,111.25,109.86,109.99001,48759808,-9.973983343\n2004-10-25T13:30:00Z,109.75,110.12,109.35001,109.86,44055392,-1.401913574\n2004-10-26T13:30:00Z,110.10001,111.60001,109.88,111.53999,54483296,15.0206808\n2004-10-27T13:30:00Z,111.38,113.10001,111.12,112.88,73928496,10.20846323\n2004-10-28T13:30:00Z,112.78,113.56,112.49001,113.22,54427008,2.750019031\n2004-10-29T13:30:00Z,113.17999,113.64,112.89999,113.2,48824800,0.308835337\n2004-11-01T14:30:00Z,113.56,113.84,113.2,113.50999,36770896,1.798365123\n2004-11-02T14:30:00Z,113.67,114.57001,113.22,113.55,56258496,-0.157992587\n2004-11-03T14:30:00Z,115.03,115.36,114.24001,114.98,77030000,10.40450804\n2004-11-04T14:30:00Z,114.78,116.67,114.67999,116.55,55456704,12.8832846\n2004-11-05T14:30:00Z,117.05,117.64,116.49001,117.28,63308496,5.507785763\n2004-11-08T14:30:00Z,116.98,117.23,116.72,117.11,34161200,-0.280590717\n2004-11-09T14:30:00Z,117.08,117.5,116.75999,116.88,44713200,-0.938701441\n2004-11-10T14:30:00Z,117.06,117.55,116.75999,116.97,45270192,-0.024925299\n2004-11-11T14:30:00Z,117.17999,118.12,117.10001,117.86,38408000,7.836552027\n2004-11-12T14:30:00Z,117.97,119,117.67999,118.78999,55641808,7.220517236\n2004-11-15T14:30:00Z,118.5,118.77,118.23,118.73,35299392,1.205323231\n2004-11-16T14:30:00Z,118.36,118.41,117.73,117.88,40136704,-7.190111421\n2004-11-17T14:30:00Z,118.37,119.14,118.07001,118.58,54935008,4.197973533\n2004-11-18T14:30:00Z,118.49001,118.8,118.23,118.74001,31910704,1.186029116\n2004-11-19T14:30:00Z,118.7,118.72,117.14,117.42,54280096,-11.48269966\n2004-11-22T14:30:00Z,117.17,118.12,117.03,117.98,37566496,2.001329787\n2004-11-23T14:30:00Z,117.92999,118.25999,117.37,118.16,41973008,1.736160342\n2004-11-24T14:30:00Z,118.27,118.59,118.05,118.44,29732800,1.900369402\n2004-11-26T14:30:00Z,118.50999,118.98,118.3,118.35001,15490000,-0.59549481\n2004-11-29T14:30:00Z,118.78999,119.00999,117.48,117.81,61760608,-3.705890104\n2004-11-30T14:30:00Z,118,118.24001,117.64,117.89,54476096,-0.699706252\n2004-12-01T14:30:00Z,118.16,119.5,118.10001,119.23,49909904,12.13085116\n2004-12-02T14:30:00Z,119.10001,119.87,119.00999,119.33,60177104,1.711718743\n2004-12-03T14:30:00Z,119.27,120.14,119.09,119.25,49073696,-0.148572711\n2004-12-06T14:30:00Z,119.21001,119.64,118.84,119.21001,33045104,-0.143213509\n2004-12-07T14:30:00Z,119.49001,119.62,118.03999,118.10001,52105696,-8.353926953\n2004-12-08T14:30:00Z,118.21001,118.82001,118.00999,118.78999,43901104,2.458804168\n2004-12-09T14:30:00Z,118.14,119.46001,117.73,119.21001,60953104,3.886690301\n2004-12-10T14:30:00Z,118.88,119.56,118.85001,119.33,47852800,1.409840101\n2004-12-13T14:30:00Z,119.75999,120.39999,119.35001,120.37,38708896,8.313090226\n2004-12-14T14:30:00Z,120.17999,120.96001,120.17999,120.78999,41736096,3.469952132\n2004-12-15T14:30:00Z,120.7,121.11,120.31,120.88,46759296,1.047253772\n2004-12-16T14:30:00Z,120.72,121.24001,120.03999,120.81,51650192,0.084336999\n2004-12-17T14:30:00Z,119.46001,119.97,119.16,119.44,71183008,-11.17706213\n2004-12-20T14:30:00Z,119.75,120.28999,119.17,119.47,47201392,-0.543064593\n2004-12-21T14:30:00Z,119.60001,120.48,119.07001,120.39,33197600,5.310191919\n2004-12-22T14:30:00Z,120.38,121.08,120.05,120.67999,31507904,2.239632489\n2004-12-23T14:30:00Z,120.87,121.28,120.09,120.77,25647696,0.34093768\n2004-12-27T14:30:00Z,121.2,121.36,120.39,120.52,29984304,-2.279208543\n2004-12-28T14:30:00Z,120.64,121.33,120.60001,121.17999,23429296,4.093026093\n2004-12-29T14:30:00Z,121.08,121.39999,120.95,121.36,23770192,1.118049263\n2004-12-30T14:30:00Z,121.39999,121.57001,121.03999,121.13,21079696,-0.983314618\n2004-12-31T14:30:00Z,121.3,121.66,120.8,120.87,28655600,-1.937496294\n2005-01-03T14:30:00Z,121.56,121.75999,119.89999,120.3,55997600,-4.028869361\n2005-01-04T14:30:00Z,120.46001,120.53999,118.44,118.73,69258880,-13.23765652\n2005-01-05T14:30:00Z,118.74001,119.25,118,118.00999,65871680,-4.11511805\n2005-01-06T14:30:00Z,118.44,119.14999,118.25999,118.61,48281808,2.989839813\n2005-01-07T14:30:00Z,118.97,119.23,118.13,118.44,55853600,-1.331236324\n2005-01-10T14:30:00Z,118.34,119.46001,118.34,119,56796496,3.855545939\n2005-01-11T14:30:00Z,118.64,118.74001,117.99001,118.17999,63353392,-5.346056081\n2005-01-12T14:30:00Z,118.39999,118.84,117.52,118.57001,74303376,1.034936134\n2005-01-13T14:30:00Z,118.64,118.73,117.5,117.62,55780000,-7.449600026\n2005-01-14T14:30:00Z,117.97,118.53,117.75999,118.24001,42033600,2.597098016\n2005-01-18T14:30:00Z,118.05,119.62,117.95,119.47,57437008,9.965163989\n2005-01-19T14:30:00Z,119.42999,119.52,118.21001,118.22,54907808,-7.09455725\n2005-01-20T14:30:00Z,117.89,118.2,117.28999,117.5,72090000,-5.788741838\n2005-01-21T14:30:00Z,117.78999,118,116.64999,116.78,63274704,-4.853740108\n2005-01-24T14:30:00Z,117.09,117.34,116.37,116.55,58554800,-2.154393976\n2005-01-25T14:30:00Z,116.91,117.47,116.72,116.88,68335312,1.067010309\n2005-01-26T14:30:00Z,117.32001,117.60001,117.03999,117.23,57442896,2.067513638\n2005-01-27T14:30:00Z,117.19,117.75,116.98,117.42999,56600496,1.219955931\n2005-01-28T14:30:00Z,117.49001,117.55,116.61,117.42999,60814096,0.153684447\n2005-01-31T14:30:00Z,117.97,118.25,117.71001,118.16,54141296,5.973088324\n2005-02-01T14:30:00Z,118.25,119.08,118.10001,118.91,52014000,6.309672114\n2005-02-02T14:30:00Z,119.06,119.59,118.89999,119.27,52606304,3.131542321\n2005-02-03T14:30:00Z,119.06,119.16,118.57001,118.96001,49143104,-1.928669454\n2005-02-04T14:30:00Z,119,120.42999,118.98,120.23,50015008,11.5075084\n2005-02-07T14:30:00Z,120.25,120.52,119.96001,120.07001,46212800,0.120169613\n2005-02-08T14:30:00Z,120.17,120.64999,120.07001,120.21001,39454800,0.667044512\n2005-02-09T14:30:00Z,120.42,120.49001,119.25,119.31,55382896,-6.93603889\n2005-02-10T14:30:00Z,119.66,120.02,119.25999,119.74001,46020608,0.823399594\n2005-02-11T14:30:00Z,119.7,121.03999,119.46001,120.77,53271104,8.048754245\n2005-02-14T14:30:00Z,120.69,120.86,120.48,120.67999,32548896,0.482824807\n2005-02-15T14:30:00Z,120.8,121.42999,120.67999,121.13,44440096,3.81544102\n2005-02-16T14:30:00Z,120.92999,121.46001,120.67,121.21001,51789008,0.996830982\n2005-02-17T14:30:00Z,121.23,121.33,120.22,120.23,58153808,-7.393607707\n2005-02-18T14:30:00Z,120.17,120.48,119.89999,120.39,49544192,0.049699702\n2005-02-22T14:30:00Z,119.89999,120.47,118.58,118.60001,80842192,-13.87150964\n2005-02-23T14:30:00Z,118.92999,119.57001,118.62469,119.45,68308688,3.71032156\n2005-02-24T14:30:00Z,119.24001,120.32001,118.98,120.24001,69306368,5.252612967\n2005-02-25T14:30:00Z,120.27,121.67,120.17999,121.42999,61173392,10.37545779\n2005-02-28T14:30:00Z,121.14999,121.3,120.03999,120.63,69426688,-4.141954211\n2005-03-01T14:30:00Z,120.78,121.52,120.78,121.23,47569296,4.090964692\n2005-03-02T14:30:00Z,120.75999,121.92999,120.64999,121.17,64233296,0.809025695\n2005-03-03T14:30:00Z,121.66,121.89999,120.7,121.22,62098608,-0.236433703\n2005-03-04T14:30:00Z,122.05,122.83,121.78999,122.73,56172608,12.201177\n2005-03-07T14:30:00Z,122.66,123.25,122.59,122.78999,43808192,1.155061747\n2005-03-08T14:30:00Z,122.67,123,122.11,122.33,44665808,-2.752642453\n2005-03-09T14:30:00Z,121.97,122.28999,120.96001,120.97,73601376,-11.60565507\n2005-03-10T14:30:00Z,121.2,121.5,120.39999,121.24001,65303392,0.105596209\n2005-03-11T14:30:00Z,121.31,121.72,120.16,120.39,58132704,-5.589247072\n2005-03-14T14:30:00Z,120.61,121.16,120.28,121.14,36338704,3.403434685\n2005-03-15T14:30:00Z,121.42,121.46001,120.08,120.14,62465808,-6.603055517\n2005-03-16T14:30:00Z,119.7,119.88,118.89999,119.12,76723872,-8.833925549\n2005-03-17T14:30:00Z,119.31,119.74001,118.98,119.36,62726400,0.513814764\n2005-03-18T14:30:00Z,119.11,119.53,118.14999,118.53999,61884192,-5.933323976\n2005-03-21T14:30:00Z,118.71001,118.78,117.75999,118.10001,61430608,-3.721660789\n2005-03-22T14:30:00Z,118.37,118.92999,116.89999,116.89999,93324624,-7.17374499\n2005-03-23T14:30:00Z,116.94501,117.72,116.75,117,71946000,-0.919626085\n2005-03-24T14:30:00Z,117.46001,117.99001,117.06,117.14,52019200,-0.03976213\n2005-03-28T14:30:00Z,117.42,117.94,117.31,117.31,46941504,0.220109371\n2005-03-29T14:30:00Z,117.14,117.89999,116.25,116.53,73040192,-4.393655104\n2005-03-30T14:30:00Z,116.78,118.2,116.77,118.17999,62896704,13.47209967\n2005-03-31T14:30:00Z,118.19,118.46001,117.87,117.96001,65048800,0.030962684\n2005-04-01T14:30:00Z,118.63,118.99001,116.91,117.42999,97394816,-3.645924342\n2005-04-04T13:30:00Z,117.36,117.86,116.74001,117.63,71609504,0.106314271\n2005-04-05T13:30:00Z,117.78,118.38,117.67,118.19,50079904,4.893221003\n2005-04-06T13:30:00Z,118.45,118.95,118.17999,118.60001,53311696,3.198469072\n2005-04-07T13:30:00Z,118.41,119.25999,118.32001,119.24001,47225504,4.610268597\n2005-04-08T13:30:00Z,119.17,119.21001,118,118,64288800,-8.750907388\n2005-04-11T13:30:00Z,118.28999,118.42,117.83,118.09,45858000,-0.899772663\n2005-04-12T13:30:00Z,117.89,119.06,117.07001,118.7,86547680,3.015621726\n2005-04-13T13:30:00Z,118.56,118.8,117.13,117.3,66058192,-9.576685581\n2005-04-14T13:30:00Z,117.44,117.5,115.77,115.77,99638816,-12.53178484\n2005-04-15T13:30:00Z,115.74001,116.2,114.10001,114.14999,134028816,-11.74354236\n2005-04-18T13:30:00Z,114.12,114.96001,113.96001,114.5,100314816,0.516240998\n2005-04-19T13:30:00Z,115.10001,115.71001,114.83,115.41,68397120,7.695138365\n2005-04-20T13:30:00Z,115.39999,115.63,113.55,113.8,114822128,-12.56793273\n2005-04-21T13:30:00Z,114.78999,116.21001,114.38,116.00999,87459504,14.46475389\n2005-04-22T13:30:00Z,115.74001,116.5,114.27,115.57001,89839504,-0.94369576\n2005-04-25T13:30:00Z,115.86,116.5,115.72,116.33,52363504,6.168601044\n2005-04-26T13:30:00Z,115.96001,116.77,115.14999,115.2,75363808,-5.910648806\n2005-04-27T13:30:00Z,114.86,116.07001,114.44,115.64999,85186128,1.956859241\n2005-04-28T13:30:00Z,115.27,115.67999,114.2,114.2,74218192,-9.656727137\n2005-04-29T13:30:00Z,115.07001,115.87,113.97,115.75,104283312,7.813052624\n2005-05-02T13:30:00Z,116.07001,116.41,115.52,116.39999,56057104,3.833058274\n2005-05-03T13:30:00Z,116.07001,116.85001,115.69,116.60001,86824192,1.955375305\n2005-05-04T13:30:00Z,116.64999,117.75,116.28,117.5,82477632,6.537069715\n2005-05-05T13:30:00Z,117.67,118,116.74001,117.46001,97322816,0.217796631\n2005-05-06T13:30:00Z,117.92999,117.99001,117.06,117.09,69602880,-2.840476568\n2005-05-09T13:30:00Z,117.21001,118.08,117.05,117.82001,43971808,4.116754142\n2005-05-10T13:30:00Z,117.36,117.5,116.39,116.60001,75030624,-9.09457403\n2005-05-11T13:30:00Z,116.92999,117.39999,115.85001,117.24001,92009312,1.738520684\n2005-05-12T13:30:00Z,117.32001,117.59,115.41,115.95,95571312,-9.613661639\n2005-05-13T13:30:00Z,116.3,116.62,114.8,115.72,85440496,-2.866695747\n2005-05-16T13:30:00Z,115.7,116.84,115.66,116.8,49351008,7.845283019\n2005-05-17T13:30:00Z,116.42999,117.7,116.16,117.58,61411904,5.051668388\n2005-05-18T13:30:00Z,118.07001,119.08,118.00999,118.78999,78052688,11.07396845\n2005-05-19T13:30:00Z,119.02,119.41,118.7,119.28999,62850096,3.548488685\n2005-05-20T13:30:00Z,119.34,119.39,118.74001,119.12,46424800,-1.018019697\n2005-05-23T13:30:00Z,119.21001,120.03999,119.19,119.78,51291600,5.444117092\n2005-05-24T13:30:00Z,119.44,119.83,119.2,119.5,50997600,-0.504463202\n2005-05-25T13:30:00Z,119.35001,119.87,118.83,119.41,48481008,-0.17863359\n2005-05-26T13:30:00Z,119.78999,120.21001,119.62,120.05,43554192,5.528197326\n2005-05-27T13:30:00Z,120.06,120.25,119.8,120.25,24641504,1.092235293\n2005-05-31T13:30:00Z,120.08,120.17,119.39999,119.48,44926800,-6.334730973\n2005-06-01T13:30:00Z,119.52,120.92,119.45,120.5,69917680,7.555555556\n2005-06-02T13:30:00Z,120.23,120.84,120.10001,120.75999,40481008,1.954247633\n2005-06-03T13:30:00Z,120.55,120.89,119.73,120.14999,61052000,-3.374406672\n2005-06-06T13:30:00Z,120.02,120.2,119.55,120.03999,36332000,-1.000017499\n2005-06-07T13:30:00Z,120.39,121.25,120.00999,120.13,66684192,-0.212555321\n2005-06-08T13:30:00Z,120.42999,120.59,119.67,119.91,50022192,-1.590721447\n2005-06-09T13:30:00Z,119.74001,120.58,119.44,120.48,57162896,2.670764731\n2005-06-10T13:30:00Z,120.56,120.64999,119.60001,120.2,36504096,-1.224715885\n2005-06-13T13:30:00Z,119.94,121.08,119.81,120.58,49501696,2.466911765\n2005-06-14T13:30:00Z,120.45,121.2,120.38,120.86,34001600,2.550382653\n2005-06-15T13:30:00Z,121.16,121.24001,120.23,121.09,53889904,1.052939974\n2005-06-16T13:30:00Z,121.09,121.64,120.92,121.39999,46642304,2.085735169\n2005-06-17T13:30:00Z,121.53999,121.89999,120.49001,121.36,53732800,-0.200686125\n2005-06-20T13:30:00Z,121.08,121.84,120.94,121.39999,42228096,0.492025111\n2005-06-21T13:30:00Z,121.5,121.64999,121.03,121.47,40059200,0.44600283\n2005-06-22T13:30:00Z,121.67999,121.94,121.07001,121.57001,46678400,0.125602571\n2005-06-23T13:30:00Z,121.32001,121.60001,119.83,119.86,62813392,-14.92865136\n2005-06-24T13:30:00Z,119.88,120.0078,118.84,118.98,59186608,-7.049597673\n2005-06-27T13:30:00Z,118.97,119.41,118.75,119.14999,51163600,0.10623976\n2005-06-28T13:30:00Z,119.39999,120.24001,119.37,120.14999,42615392,9.437846337\n2005-06-29T13:30:00Z,120.37,120.39999,119.75999,119.83,43059008,-1.185582326\n2005-06-30T13:30:00Z,120.22,120.32001,118.95,119.17999,62301600,-4.769126119\n2005-07-01T13:30:00Z,119.45,119.8,119.21001,119.53,49786400,0.582411251\n2005-07-05T13:30:00Z,119.25,120.64999,119.19,120.49001,51550192,7.567622078\n2005-07-06T13:30:00Z,120.39,120.64999,119.41,119.48,54068800,-5.029942282\n2005-07-07T13:30:00Z,118.28999,119.95,118.25999,119.95,103262368,4.264863107\n2005-07-08T13:30:00Z,119.97,121.32001,119.72,121.32001,64550608,10.45355976\n2005-07-11T13:30:00Z,121.33,122.10001,121.31,121.94,49762496,5.458609938\n2005-07-12T13:30:00Z,121.89,122.63,121.64,122.25999,52165008,2.481754103\n2005-07-13T13:30:00Z,122.27,122.52,121.99001,122.42999,41266000,0.928393393\n2005-07-14T13:30:00Z,122.98,123.44,122.49001,122.91,64775808,3.001615354\n2005-07-15T13:30:00Z,122.78999,123.03999,122.36,122.84,56137808,-0.307999487\n2005-07-18T13:30:00Z,122.5,122.63,122.05,122.35001,56816304,-3.910928411\n2005-07-19T13:30:00Z,122.71001,123.11,122.41,123.02,59507296,4.873684638\n2005-07-20T13:30:00Z,122.59,123.73,122.3,123.44,69602496,2.753728447\n2005-07-21T13:30:00Z,123.55,123.61,122.47,122.72,100791120,-4.135050832\n2005-07-22T13:30:00Z,122.88,123.56,122.63,123.53999,55933008,4.349930769\n2005-07-25T13:30:00Z,123.41,123.95,122.85001,123.19,57591504,-1.005637038\n2005-07-26T13:30:00Z,123.23,123.53,122.37,123.34,42847504,0.632716049\n2005-07-27T13:30:00Z,123.5,123.89,123.05,123.78999,45262704,2.466619236\n2005-07-28T13:30:00Z,123.99001,124.64,123.64,124.57001,48448496,5.659403053\n2005-07-29T13:30:00Z,124.41,124.63,123.5,123.74001,62446304,-5.350023774\n2005-08-01T13:30:00Z,123.83,124.03999,123.45,123.64999,42940704,-0.860161055\n2005-08-02T13:30:00Z,123.87,124.60001,123.74001,124.39,46241200,5.968843996\n2005-08-03T13:30:00Z,124.25,124.74001,124.12,124.72,37197600,2.027114222\n2005-08-04T13:30:00Z,124.23,124.31,123.57001,123.72,51043696,-7.694858452\n2005-08-05T13:30:00Z,123.45,123.98,122.67,122.88,53711104,-5.717934783\n2005-08-08T13:30:00Z,123.17,123.41,122.38,122.64999,48227008,-1.786956023\n2005-08-09T13:30:00Z,123.06,123.59,122.87,123.39,47522304,4.742897842\n2005-08-10T13:30:00Z,123.82001,124.5,122.82001,123.33,73115632,-0.875822522\n2005-08-11T13:30:00Z,123.27,124.03,123.00999,123.82001,58860304,2.460360116\n2005-08-12T13:30:00Z,123.57001,123.69,122.75,123.06,54814608,-5.136438656\n2005-08-15T13:30:00Z,123.22,123.87,122.83,123.82001,36227504,4.043541261\n2005-08-16T13:30:00Z,123.44,123.52,122.09,122.21001,72265008,-12.96872187\n2005-08-17T13:30:00Z,122.19,122.87,122.03,122.2,62507696,-1.1233784\n2005-08-18T13:30:00Z,122.05,122.56,121.84,122.19,53546096,0.194636678\n2005-08-19T13:30:00Z,122.63,122.82001,122.2,122.47,39955808,1.401989648\n2005-08-22T13:30:00Z,122.58,123.23,121.88,122.47,69948320,-0.324640288\n2005-08-23T13:30:00Z,122.5,122.61,121.14999,122.24001,56743296,-2.149078304\n2005-08-24T13:30:00Z,121.94,122.73,121.09,121.14999,79135312,-6.534252159\n2005-08-25T13:30:00Z,121.35001,121.67,121.21001,121.59,35642000,1.713674905\n2005-08-26T13:30:00Z,121.48,121.49001,120.67999,120.75999,61962304,-6.985823733\n2005-08-29T13:30:00Z,120.41,121.78,120.38,121.69,56183392,5.608462447\n2005-08-30T13:30:00Z,121.25,121.3,120.39,121.05,74179872,-2.394736842\n2005-08-31T13:30:00Z,121.19,122.66,120.74001,122.58,102979312,11.10966934\n2005-09-01T13:30:00Z,122.50999,123.14999,121.14,122.49001,74582624,0.9449372\n2005-09-02T13:30:00Z,122.85001,122.88,122.03999,122.27,47656304,-1.714226545\n2005-09-06T13:30:00Z,122.66,123.8,122.64999,123.7,57253808,11.62303126\n2005-09-07T13:30:00Z,123.63,124.13,123.46001,123.91,41754304,1.762787772\n2005-09-08T13:30:00Z,123.66,124,123.31,123.5,39070800,-2.072368421\n2005-09-09T13:30:00Z,123.83,124.74001,123.8,124.60001,44112304,9.910493326\n2005-09-12T13:30:00Z,124.45,124.67,124.27,124.35001,33024608,-0.374192513\n2005-09-13T13:30:00Z,124.13,124.42,123.52,123.66,58479008,-5.327823353\n2005-09-14T13:30:00Z,123.75,123.92,123.02,123.21001,55195392,-3.292324324\n2005-09-15T13:30:00Z,123.50999,123.64999,122.89999,123.14999,73655808,-1.165258939\n2005-09-16T13:30:00Z,123.28,123.74001,122.87,123.5,75425808,1.421295743\n2005-09-19T13:30:00Z,123.47,123.55,122.64,123.09,53373696,-3.035621762\n2005-09-20T13:30:00Z,123.21001,123.61,121.87,122.05,84997120,-7.126383174\n2005-09-21T13:30:00Z,121.78999,121.87,120.78,120.91,94497808,-10.09733327\n2005-09-22T13:30:00Z,120.95,121.66,120.44,121.34,84600368,1.318369802\n2005-09-23T13:30:00Z,121.24001,121.89,120.89999,121.44,59368704,0.940349112\n2005-09-26T13:30:00Z,122.02,122.24001,121.08,121.58,70425808,-0.123978054\n2005-09-27T13:30:00Z,121.52,121.99001,121.02,121.55,66151376,-0.405088842\n2005-09-28T13:30:00Z,121.91,122.12,121.2,121.67,58708496,0.028807278\n2005-09-29T13:30:00Z,121.55,122.86,121.08,122.66,66645632,6.002547554\n2005-09-30T13:30:00Z,122.62,123.03999,122.45,123.03999,47827104,2.374923811\n2005-10-03T13:30:00Z,122.96001,123.34,122.45,122.60001,51015104,-1.908513119\n2005-10-04T13:30:00Z,122.78999,123.03,121.16,121.22,60779696,-10.3546867\n2005-10-05T13:30:00Z,121.25,121.31,119.57001,119.63,106061184,-13.50416166\n2005-10-06T13:30:00Z,119.78,120.25999,118.17,119.2,141120816,-4.114495449\n2005-10-07T13:30:00Z,119.7,120.05,119.13,119.61,75663120,1.09741784\n2005-10-10T13:30:00Z,119.67999,119.71001,118.3,118.60001,52678608,-8.987497469\n2005-10-11T13:30:00Z,118.99001,119.39,118.32001,118.42999,75640688,-2.653073307\n2005-10-12T13:30:00Z,118.39,119.13,117.41,117.5,100520496,-5.19245832\n2005-10-13T13:30:00Z,117.46001,118.08,116.88,117.42999,99073120,-0.83770826\n2005-10-14T13:30:00Z,118.12,118.81,117.56,118.67,88654368,9.83155125\n2005-10-17T13:30:00Z,118.77,119.27,118.45,119.11,68967808,2.927545692\n2005-10-18T13:30:00Z,118.94,118.96001,117.8,117.82001,75013312,-10.94754542\n2005-10-19T13:30:00Z,117.56,119.8,117.12,119.78,116569184,11.66419323\n2005-10-20T13:30:00Z,119.49001,119.81,117.3,117.67,132087632,-12.46576754\n2005-10-21T13:30:00Z,118.28999,118.78,117.50999,118.13,96580624,-0.301618195\n2005-10-24T13:30:00Z,118.44,120.09,118.41,119.96001,72345120,16.79449267\n2005-10-25T13:30:00Z,119.72,120.24001,118.94,119.72,77054816,0.531222796\n2005-10-26T13:30:00Z,119.50999,120.53999,119.19,119.37,82692496,-1.594417829\n2005-10-27T13:30:00Z,119.2,119.37,117.92999,118.10001,68286816,-11.31855834\n2005-10-28T13:30:00Z,118.42999,119.95,118.10001,119.8,72959872,11.48087423\n2005-10-31T14:30:00Z,120.28999,121.3,120.13,120.13,80144880,3.311326101\n2005-11-01T14:30:00Z,120.58,120.89999,120.22,120.49001,66996128,1.730099551\n2005-11-02T14:30:00Z,120.17,121.75,120.13,121.75,74690880,9.720792098\n2005-11-03T14:30:00Z,122.14999,122.66,121.75,122.27,84900880,4.2493034\n2005-11-04T14:30:00Z,122.39999,122.46001,121.55,122.11,59156400,-1.316435952\n2005-11-07T14:30:00Z,122.39999,122.62,121.85001,122.23,46765696,-0.141850584\n2005-11-08T14:30:00Z,121.95,122.42,121.78999,122.23,42153696,0.398713723\n2005-11-09T14:30:00Z,122.08,122.95,121.86,122.39,57668704,1.493534483\n2005-11-10T14:30:00Z,122.34,123.86,121.75,123.34,79143376,6.4155\n2005-11-11T14:30:00Z,123.35001,123.84,122.42999,123.75999,34867008,2.997875577\n2005-11-14T14:30:00Z,123.75999,124.02,123.38,123.69,45092800,-0.007964491\n2005-11-15T14:30:00Z,123.58,124.09,122.86,123.24001,69592496,-2.650859396\n2005-11-16T14:30:00Z,123.37,123.55,122.98,123.49001,51133904,0.66555669\n2005-11-17T14:30:00Z,123.75,124.64999,123.14,124.64,55717504,7.650032387\n2005-11-18T14:30:00Z,125.03999,125.756,124.33,125.13,72437184,3.205093949\n2005-11-21T14:30:00Z,125.14999,125.91,124.98,125.75999,50021200,4.900539303\n2005-11-22T14:30:00Z,125.56,126.52,125.42,126.3,66439872,4.029532061\n2005-11-23T14:30:00Z,126.25,127.41,126.21001,127.03,50854704,6.536825176\n2005-11-25T14:30:00Z,126.98,127.22,126.81,127.13,15270000,0.840909091\n2005-11-28T14:30:00Z,127.25,127.27,126.03999,126.23,54503296,-7.37685859\n2005-11-29T14:30:00Z,126.64999,126.98,126.09,126.09,51809504,-2.763352893\n2005-11-30T14:30:00Z,126.16,126.52,125.28999,125.41,56075392,-4.361335385\n2005-12-01T14:30:00Z,126.02,127.03,125.98,126.69,65510800,9.493226601\n2005-12-02T14:30:00Z,126.77,127.08,126.5,126.85001,46724704,1.198418478\n2005-12-05T14:30:00Z,126.64,126.73,126.17999,126.58,59367104,-1.86116482\n2005-12-06T14:30:00Z,127.05,127.74001,126.63,126.82001,57942800,0.693572774\n2005-12-07T14:30:00Z,126.78999,126.87,125.67999,126.08,66826000,-6.582505015\n2005-12-08T14:30:00Z,126.22,126.82001,125.48,126,62586704,-1.120059641\n2005-12-09T14:30:00Z,126.16,126.78,125.82001,126.33,50744704,1.729081075\n2005-12-12T14:30:00Z,126.71001,126.86,125.96001,126.45,48393808,0.114207777\n2005-12-13T14:30:00Z,126.39999,127.7,126.28999,127.31,88650880,6.620719846\n2005-12-14T14:30:00Z,127.19,128.09,127.14,127.81,64374896,4.295383396\n2005-12-15T14:30:00Z,127.84,128,127.17999,127.44,55903104,-1.675970952\n2005-12-16T14:30:00Z,127.27,128.57001,126.36,126.36,46239008,-4.998805065\n2005-12-19T14:30:00Z,126.73,126.87,125.69,125.71001,48819504,-4.127952709\n2005-12-20T14:30:00Z,125.86,126.59,125.48,125.83,46604704,-0.604420063\n2005-12-21T14:30:00Z,126.17,126.75999,125.8,126.03,51801200,0.735949306\n2005-12-22T14:30:00Z,126.31,126.69,126.08,126.69,32250496,5.017723881\n2005-12-23T14:30:00Z,126.78999,126.86,126.42,126.75999,27977296,0.473099299\n2005-12-27T14:30:00Z,126.92,127.05,125.38,125.47,44500704,-10.39871824\n2005-12-28T14:30:00Z,125.73,125.99001,125.5,125.75,30764304,-0.271615925\n2005-12-29T14:30:00Z,125.72,125.96001,125.06,125.19,33033600,-3.907415388\n2005-12-30T14:30:00Z,124.8,125.06,124.36,124.50999,44646096,-5.534383357\n2006-01-03T14:30:00Z,125.10001,127,124.39,126.7,73388816,16.92591712\n2006-01-04T14:30:00Z,126.86,127.49001,126.7,127.3,52243200,5.061996589\n2006-01-05T14:30:00Z,127.17,127.59,126.88,127.38,47310496,0.944359756\n2006-01-06T14:30:00Z,128.03999,128.58,127.36,128.44,62892608,7.735785855\n2006-01-09T14:30:00Z,128.42,129.06,128.38,128.77,43532704,3.005611761\n2006-01-10T14:30:00Z,128.39,128.98,128.25999,128.89999,44961392,1.865085841\n2006-01-11T14:30:00Z,129.02,129.44,128.73,129.31,49603904,2.750462502\n2006-01-12T14:30:00Z,129.08,129.28,128.44,128.8,40509296,-3.385613208\n2006-01-13T14:30:00Z,128.57001,128.89999,128.2,128.67999,44858896,-0.657573475\n2006-01-17T14:30:00Z,128.2,128.42,127.81,128.33,52181600,-1.824275195\n2006-01-18T14:30:00Z,127.58,128.89999,127.16,127.82001,75066496,-1.474823024\n2006-01-19T14:30:00Z,128.09,128.77,127.81,128.31,78049184,3.84181825\n2006-01-20T14:30:00Z,128.28,128.31,125.97,125.97,115312000,-21.00626305\n2006-01-23T14:30:00Z,126.21001,126.82001,126.13,126.42,67094816,-0.088726035\n2006-01-24T14:30:00Z,126.63,127.14999,126.42,126.55,53013904,0.830857921\n2006-01-25T14:30:00Z,127.03999,127.17999,125.84,126.66,87790624,-0.326272849\n2006-01-26T14:30:00Z,127.28,127.67,126.75999,127.36,71360816,3.859306761\n2006-01-27T14:30:00Z,127.66,128.66,127.45,128.53999,65790880,10.4508848\n2006-01-30T14:30:00Z,128.44,128.81,128.35001,128.44,33710192,0.297829235\n2006-01-31T14:30:00Z,128.32001,128.53999,127.49001,127.5,73131184,-7.634021898\n2006-02-01T14:30:00Z,127.82001,128.42999,127.72,128.39,63562896,5.500548328\n2006-02-02T14:30:00Z,128.10001,128.14,126.8,126.89999,83628624,-12.03952407\n2006-02-03T14:30:00Z,126.58,128.39,126.14,126.27,86042496,-3.962378015\n2006-02-06T14:30:00Z,126.44,126.8,126.17,126.60001,45513392,1.55682818\n2006-02-07T14:30:00Z,126.38,126.66,125.39999,125.48,71227632,-8.827028587\n2006-02-08T14:30:00Z,125.88,128.10001,125.60001,126.62,59426304,7.555446153\n2006-02-09T14:30:00Z,126.92,127.60001,126.37,126.41,62024304,-1.212017936\n2006-02-10T14:30:00Z,126.42999,127.13,125.45,126.64,64509696,0.688813278\n2006-02-13T14:30:00Z,126.57001,126.78999,125.95,126.41,52309200,-1.244245225\n2006-02-14T14:30:00Z,126.46001,128.03,123.64,127.75,90992496,7.601052743\n2006-02-15T14:30:00Z,127.66,128.32001,127.24001,128.2,85473504,2.648106324\n2006-02-16T14:30:00Z,128.34,129.21001,128.17999,129.16,61035392,8.154715423\n2006-02-17T14:30:00Z,129.09,129.16,128.58,128.81,40344400,-1.316082803\n2006-02-21T14:30:00Z,129.12,129.39999,128.28999,128.49001,46461808,-2.203040785\n2006-02-22T14:30:00Z,128.77,129.64999,128.64999,129.27,42338400,5.111535723\n2006-02-23T14:30:00Z,129.27,129.64,128.28,129.08,43450192,-0.666666667\n2006-02-24T14:30:00Z,129.11,129.48,128.75999,129.41,36782704,1.408776433\n2006-02-27T14:30:00Z,129.39999,130.03999,129.28,129.46001,35880096,0.731004636\n2006-02-28T14:30:00Z,129.2,129.91,128.13,128.23,74397008,-7.872623092\n2006-03-01T14:30:00Z,128.60001,129.49001,128.5,129.37,48646304,7.385487697\n2006-03-02T14:30:00Z,128.89999,129.42,128.61,129.36,60644496,1.954505498\n2006-03-03T14:30:00Z,128.66,130.07001,128.64999,128.75999,73429808,-1.257567988\n2006-03-06T14:30:00Z,129.14,129.17999,127.85001,128.17,57479104,-4.407232662\n2006-03-07T14:30:00Z,127.92,128.06,127.39999,127.97,61784704,-2.09840612\n2006-03-08T14:30:00Z,127.7,128.44,127.17999,128.24001,66705120,2.143855329\n2006-03-09T14:30:00Z,128.33,128.67999,127.38,127.38,56523600,-4.494877369\n2006-03-10T14:30:00Z,127.72,128.84,127.44,128.59,60491104,7.702211394\n2006-03-13T14:30:00Z,128.84,129.16,128.53,128.83,45713296,1.90210177\n2006-03-14T14:30:00Z,128.71001,130.23,128.61,130.17999,69879184,11.23063174\n2006-03-15T14:30:00Z,130.14999,130.86,129.85001,130.75999,53407504,3.864421051\n2006-03-16T14:30:00Z,130.98,131.47,130.84,131.03,67083632,2.414396988\n2006-03-17T14:30:00Z,130.67999,130.89999,130.38,130.62,47286800,-2.906632587\n2006-03-20T14:30:00Z,130.64,130.89999,130.21001,130.41,45541200,-1.235815815\n2006-03-21T14:30:00Z,130.34,130.99001,129.45,129.59,87404128,-4.704195905\n2006-03-22T14:30:00Z,129.50999,130.50999,129.45,130.38,51606896,4.782073528\n2006-03-23T14:30:00Z,130.24001,130.39349,129.66,130.11,46836400,-0.556009905\n2006-03-24T14:30:00Z,129.99001,130.57001,129.74001,130.21001,43213696,0.591702814\n2006-03-27T14:30:00Z,130.03,130.28,129.74001,130.02,32523200,-0.691237458\n2006-03-28T14:30:00Z,129.92999,130.53,129.05,129.22,82081680,-4.733432336\n2006-03-29T14:30:00Z,129.41,130.5,129.28999,130.03,61532704,5.300531985\n2006-03-30T14:30:00Z,130.11,130.98,129.55,129.8,70572320,-0.86159306\n2006-03-31T14:30:00Z,130.02,130.24001,129.37,129.83,62925696,-0.413593425\n2006-04-03T13:30:00Z,130.07001,130.87,129.49001,129.73,61627696,-1.445742177\n2006-04-04T13:30:00Z,129.72,130.73,129.36,130.56,54810192,5.004276195\n2006-04-05T13:30:00Z,130.61,131.28,130.38,131.00999,50610704,3.486425676\n2006-04-06T13:30:00Z,130.85001,131.21001,130.19,130.87,57911008,-0.137262753\n2006-04-07T13:30:00Z,131.06,131.39999,129.35001,129.53999,80183312,-9.638809153\n2006-04-10T13:30:00Z,129.71001,130.08,129.25999,129.74001,41537008,-0.464017041\n2006-04-11T13:30:00Z,129.85001,130.06,128.25,128.64,72805312,-8.69777966\n2006-04-12T13:30:00Z,128.77,129.13,128.61,128.88,43051904,-0.027934756\n2006-04-13T13:30:00Z,128.59,129.25,128.31,128.71001,51076896,-0.303723837\n2006-04-17T13:30:00Z,128.78999,129.31,128.02,128.66,64169600,-0.27771053\n2006-04-18T13:30:00Z,128.95,130.94,128.84,130.7,92662192,18.48175785\n2006-04-19T13:30:00Z,130.72,131.07001,130.24001,130.95,87273312,1.820226701\n2006-04-20T13:30:00Z,131,131.86,130.60001,131.13,86022496,1.305868545\n2006-04-21T13:30:00Z,131.73,131.78999,130.62,131.14999,72359312,-0.814754826\n2006-04-24T13:30:00Z,130.92999,131.07001,130.38,130.91,52547296,-2.17239683\n2006-04-25T13:30:00Z,131.03999,131.12,129.92,130.37,84360368,-4.518643063\n2006-04-26T13:30:00Z,130.5,131.14,130.3,130.39999,67266880,-0.895688482\n2006-04-27T13:30:00Z,129.89999,131.63,129.59,131.03,124605376,4.355706213\n2006-04-28T13:30:00Z,130.78999,131.75,130.71001,131.47,55855104,3.615357932\n2006-05-01T13:30:00Z,131.47,131.8,130.32001,130.39999,65006608,-6.250975477\n2006-05-02T13:30:00Z,131.00999,131.46001,130.74001,131.38,49087696,5.136992042\n2006-05-03T13:30:00Z,131.22,131.32001,130.45,130.89,60824608,-3.294198501\n2006-05-04T13:30:00Z,131.08,131.62,130.34,131.36,42930496,1.766399083\n2006-05-05T13:30:00Z,132.05,132.8,131.85001,132.52,62589504,10.4229661\n2006-05-08T13:30:00Z,132.50999,132.77,132.36,132.36,30017296,-0.348030213\n2006-05-09T13:30:00Z,132.42,132.77,132.31,132.62,29865008,1.661139315\n2006-05-10T13:30:00Z,132.41,132.75,131.89,132.55,64406896,0.250686813\n2006-05-11T13:30:00Z,132.50999,132.55,130.52,130.95,80654688,-14.40780826\n2006-05-12T13:30:00Z,130.48,130.72,129.19,129.24001,91733376,-14.70262617\n2006-05-15T13:30:00Z,128.78999,129.74001,128.61,129.5,84040368,0.833986433\n2006-05-16T13:30:00Z,129.75999,130,129.00999,129.31,62136400,-0.635679757\n2006-05-17T13:30:00Z,128.67,129.10001,126.77,126.85001,144779632,-21.70141528\n2006-05-18T13:30:00Z,127.38,127.75,126.11,126.21001,87923872,-4.510674983\n2006-05-19T13:30:00Z,126.87,127.49001,125.8,127.10001,124320880,2.875177017\n2006-05-22T13:30:00Z,126.28,127.17,125.5,126.13,110877376,-5.716423982\n2006-05-23T13:30:00Z,127.17999,127.63,125.17,125.17,91990624,-7.516873123\n2006-05-24T13:30:00Z,125.67999,126.89,124.75999,126.17,168394368,3.03207327\n2006-05-25T13:30:00Z,126.92,127.73,126.42999,127.73,78992128,13.10985575\n2006-05-26T13:30:00Z,128,128.38,127.50999,128.38,62990704,3.948826817\n2006-05-30T13:30:00Z,127.97,128,126.05,126.10001,72445504,-20.32876133\n2006-05-31T13:30:00Z,126.58,127.50999,126.2,127.50999,86932688,6.787052425\n2006-06-01T13:30:00Z,127.38,128.94,127.27,128.73,73728000,9.99461563\n2006-06-02T13:30:00Z,129.25,129.42999,128.32001,129,91702688,1.45833265\n2006-06-05T13:30:00Z,128.78999,128.86,126.77,127.12,86119184,-17.41792421\n2006-06-06T13:30:00Z,127.21001,127.38,125.75999,126.81,130874816,-3.869349791\n2006-06-07T13:30:00Z,126.91,127.64999,125.78999,125.86,108703120,-5.122819678\n2006-06-08T13:30:00Z,125.58,126.5,123.87,125.75,204960320,-1.236225151\n2006-06-09T13:30:00Z,126.36,126.96001,125.28999,125.35001,94976320,-3.80877112\n2006-06-12T13:30:00Z,125.88,125.92999,123.82001,123.99001,95878192,-10.35185395\n2006-06-13T13:30:00Z,123.78,124.84,122.55,122.55,185695872,-8.23447821\n2006-06-14T13:30:00Z,122.84,123.63,122.34,123.5,163652000,4.10915493\n2006-06-15T13:30:00Z,123.92,126.36,123.86,126.12,134446320,24.40927065\n2006-06-16T13:30:00Z,125.19,125.56,124.46001,124.64999,94263008,-6.397095969\n2006-06-19T13:30:00Z,125.39999,125.48,123.55,123.67,95817376,-6.591900162\n2006-06-20T13:30:00Z,124.00999,124.81,123.72,124.09,65518304,0.126650245\n2006-06-21T13:30:00Z,124,125.7,123.96001,125.00999,75038688,8.261504932\n2006-06-22T13:30:00Z,124.95,125.06,124.03999,124.46001,74994128,-2.584479733\n2006-06-23T13:30:00Z,124.33,125.3,124.03,124.44,54112496,-0.329917221\n2006-06-26T13:30:00Z,124.53999,125.06,124.25,124.99001,37905200,3.713152239\n2006-06-27T13:30:00Z,125.00999,125.28999,123.77,123.91,69780880,-7.087943512\n2006-06-28T13:30:00Z,124.19,124.77,123.64999,124.75,62368096,3.255816501\n2006-06-29T13:30:00Z,125.2,127.35001,125.17,127.27,110696624,23.73270498\n2006-06-30T13:30:00Z,127.47,127.66,126.96001,127.23,54229904,0.715739965\n2006-07-03T13:30:00Z,127.42999,128.00999,127.31,127.8,23936192,4.235185361\n2006-07-05T13:30:00Z,127.28999,127.45,126.52,127.07001,69653504,-4.993576214\n2006-07-06T13:30:00Z,127.2,127.85001,127.08,127.44,51289504,2.554940512\n2006-07-07T13:30:00Z,127.19,127.56,126.28999,126.61,81628368,-5.7283902\n2006-07-10T13:30:00Z,126.94,127.42999,126.41,126.85001,60956400,0.220022274\n2006-07-11T13:30:00Z,126.61,127.41,125.94,127.41,73640816,3.572566914\n2006-07-12T13:30:00Z,127.21001,127.39999,125.72,126.05,82561376,-9.750053879\n2006-07-13T13:30:00Z,125.5,125.67999,124,124,102454192,-18.3715559\n2006-07-14T13:30:00Z,124.16,124.25999,122.83,123.52,103243184,-4.760241054\n2006-07-17T13:30:00Z,123.5,124.10001,123.14999,123.34,81289632,-1.371620556\n2006-07-18T13:30:00Z,123.74001,124.05,122.39,123.97,123697008,2.462298713\n2006-07-19T13:30:00Z,124.17999,126.25999,123.724,125.69,134399184,13.97588527\n2006-07-20T13:30:00Z,126.12,126.3,124.66,124.83,112337808,-3.597648655\n2006-07-21T13:30:00Z,125.14999,125.19,123.82001,123.95,101722192,-6.722720389\n2006-07-24T13:30:00Z,124.44,126.32001,124.44,126.21001,92889872,17.37809039\n2006-07-25T13:30:00Z,125.98,127.3,125.72,126.66,95483872,4.151430283\n2006-07-26T13:30:00Z,126.59,127.45,126.17999,126.83,84528128,1.577245991\n2006-07-27T13:30:00Z,127.33,127.69,126.2,126.71001,87257184,-1.2830125\n2006-07-28T13:30:00Z,126.99001,128.14,126.86,127.98,82137184,9.529294124\n2006-07-31T13:30:00Z,127.66,127.96001,126.55,127.85001,49589104,1.139027059\n2006-08-01T13:30:00Z,127.34,127.38,126.60001,127.22,65220896,-4.724330969\n2006-08-02T13:30:00Z,127.58,128.46001,127.55,128.08,64787504,7.574653171\n2006-08-03T13:30:00Z,127.33,128.55,127.14999,128.42,63704496,3.849606314\n2006-08-04T13:30:00Z,129.06,129.42999,127.48,128.2,96296624,-1.072196121\n2006-08-07T13:30:00Z,127.89999,128.08,127.39999,127.95,45434400,-2.303643417\n2006-08-08T13:30:00Z,128.09,128.46001,126.95,127.41,90898128,-3.561126345\n2006-08-09T13:30:00Z,128.2,128.60001,126.61,126.98,78916128,-4.166393038\n2006-08-10T13:30:00Z,126.53,127.5,126.28,127.37,69324320,1.448770492\n2006-08-11T13:30:00Z,127.17,127.2,126.39,127.00999,47489392,-1.274970023\n2006-08-14T13:30:00Z,127.63,128.16,126.92,127.11,58044496,-1.123012333\n2006-08-15T13:30:00Z,128.21001,128.87,127.89999,128.63,68149808,11.77249909\n2006-08-16T13:30:00Z,129.32001,129.89,129.03999,129.78999,71759184,10.18301496\n2006-08-17T13:30:00Z,129.58,130.37,129.49001,130.03,70994816,2.116941139\n2006-08-18T13:30:00Z,130.19,130.69,129.59,130.69,58288400,3.478608247\n2006-08-21T13:30:00Z,130.17999,130.28,129.8,130.13,42133696,-3.158916281\n2006-08-22T13:30:00Z,129.94,130.52,129.67999,130.12,60840496,0.222701853\n2006-08-23T13:30:00Z,130.17999,130.44,129.19,129.75999,66610128,-2.356463803\n2006-08-24T13:30:00Z,129.99001,130.10001,129.39999,129.64999,57982896,-1.076088172\n2006-08-25T13:30:00Z,129.64,130.25,129.55,129.81,41757904,0.764362966\n2006-08-28T13:30:00Z,129.64999,130.82001,129.64,130.42999,52679504,5.434645856\n2006-08-29T13:30:00Z,130.49001,130.83,129.81,130.58,61817008,1.243823045\n2006-08-30T13:30:00Z,130.87,131.03999,130.55,130.66,50053104,-0.014038452\n2006-08-31T13:30:00Z,130.85001,130.99001,130.58,130.64,38523008,-0.791583223\n2006-09-01T13:30:00Z,131.14,131.58,130.84,131.42,48800000,5.710401722\n2006-09-05T13:30:00Z,131.50999,131.85001,131.2,131.67,52348896,1.493088204\n2006-09-06T13:30:00Z,131.11,131.16,130.33,130.50999,53795600,-10.57118068\n2006-09-07T13:30:00Z,130.06,130.57001,129.35001,129.91,86300624,-4.365752983\n2006-09-08T13:30:00Z,130.08,130.46001,129.83,130.28,45107696,2.227301136\n2006-09-11T13:30:00Z,129.86,130.69,129.48,130.41,68497184,1.805555556\n2006-09-12T13:30:00Z,130.56,131.84,130.3681,131.69,69888128,11.00944063\n2006-09-13T13:30:00Z,131.64,132.45,131.52,132.22,62913008,4.319072165\n2006-09-14T13:30:00Z,131.96001,132.24001,131.75,132.23,57812192,1.341491177\n2006-09-15T13:30:00Z,132.31,132.39,131.67999,131.96001,76715680,-1.668970234\n2006-09-18T13:30:00Z,131.78999,132.39,131.64999,132.14,64155504,0.868732685\n2006-09-19T13:30:00Z,132.12,132.13,131.07001,131.81,92097808,-2.306513654\n2006-09-20T13:30:00Z,132.25,132.77,132.06,132.50999,75212816,4.947846575\n2006-09-21T13:30:00Z,132.61,132.75,131.42,131.87,88947008,-4.61484866\n2006-09-22T13:30:00Z,131.67,131.67999,131,131.47,65969184,-3.87990302\n2006-09-25T13:30:00Z,131.73,132.85001,131.05,132.48,92298320,6.223997945\n2006-09-26T13:30:00Z,132.5,133.60001,132.39999,133.58,74016624,9.219769242\n2006-09-27T13:30:00Z,133.49001,133.97,133.27,133.74001,82433872,1.394677191\n2006-09-28T13:30:00Z,133.74001,133.99001,133.28,133.69,58601600,-0.04657727\n2006-09-29T13:30:00Z,133.8,133.94,133.48,133.58,47991696,-0.768853406\n2006-10-02T13:30:00Z,133.53999,133.83,132.34,133.08,52444496,-3.937677184\n2006-10-03T13:30:00Z,132.89,133.87,132.64999,133.36,73108688,1.479401684\n2006-10-04T13:30:00Z,133.23,135,133.08,134.92,80893312,12.6898773\n2006-10-05T13:30:00Z,134.92,135.41,134.75,135.17999,60640000,2.298600751\n2006-10-06T13:30:00Z,134.95,135.10001,134.39999,135.00999,65001808,-0.454233734\n2006-10-09T13:30:00Z,134.85001,135.3,134.64,135.09,41177904,0.736565459\n2006-10-10T13:30:00Z,135.11,135.45,134.84,135.27,56428496,1.07462248\n2006-10-11T13:30:00Z,134.84,135.42999,134.3,135.11,104076320,0.077725023\n2006-10-12T13:30:00Z,135.45,136.39,135.39999,136.28,59172896,10.99371728\n2006-10-13T13:30:00Z,136.16,136.71001,136.03999,136.63,53945296,2.42717349\n2006-10-16T13:30:00Z,136.52,137.05,136.42,136.84,42275904,1.711956522\n2006-10-17T13:30:00Z,136.47,136.7,135.67,136.41,90785376,-2.354872881\n2006-10-18T13:30:00Z,137.03999,137.37,136.10001,136.59,87371184,-0.280134476\n2006-10-19T13:30:00Z,136.39,136.88,136.23,136.81,64081808,0.936895695\n2006-10-20T13:30:00Z,136.81,136.95,136.33,136.84,48099504,0.620689655\n2006-10-23T13:30:00Z,136.56,137.8,136.39,137.47,66234000,4.624338624\n2006-10-24T13:30:00Z,137.28,137.92999,137.22,137.88,53355392,2.874968166\n2006-10-25T13:30:00Z,137.74001,138.41,137.50999,138.35001,80750816,2.918158518\n2006-10-26T13:30:00Z,138.66,139,137.98,138.78,66848368,2.226077159\n2006-10-27T13:30:00Z,138.61,138.75,137.63,137.91,80239376,-7.341738197\n2006-10-30T14:30:00Z,137.66,138.2,137.39999,137.81,49718096,-0.653852268\n2006-10-31T14:30:00Z,138.07001,138.25999,137.25,137.78999,71297184,-0.40937861\n2006-11-01T14:30:00Z,138.22,138.31,136.72,136.86,83006496,-6.767968508\n2006-11-02T14:30:00Z,136.50999,137.00999,136.36,136.78,60703904,-0.899614516\n2006-11-03T14:30:00Z,137.27,137.39,135.62,136.53999,71346368,-2.120794734\n2006-11-06T14:30:00Z,136.96001,138.28,136.95,138.08,63312704,12.14140813\n2006-11-07T14:30:00Z,138.2,138.98,138,138.61,63363200,4.53124783\n2006-11-08T14:30:00Z,138,139.05,136.86,138.91,87519632,4.091125954\n2006-11-09T14:30:00Z,139.00999,139.14,137.89999,138.17999,95917680,-3.946711927\n2006-11-10T14:30:00Z,138.14,138.34,137.72,138.24001,48992000,-0.338652003\n2006-11-13T14:30:00Z,138.17999,139.03999,138.07001,138.58,59403504,2.839162373\n2006-11-14T14:30:00Z,138.97,139.74001,138.12,139.62,96704192,6.175164243\n2006-11-15T14:30:00Z,139.57001,140.45,139.53,140.02,76518192,3.773792436\n2006-11-16T14:30:00Z,140.44,140.67999,139.49001,140.38,76740128,1.401386612\n2006-11-17T14:30:00Z,139.92999,140.42999,139.73,140.42,56357296,1.534140775\n2006-11-20T14:30:00Z,140.3,140.74001,139.94099,140.5,69185504,0.98276034\n2006-11-21T14:30:00Z,140.49001,140.67,140.28999,140.64,51371392,0.808870723\n2006-11-22T14:30:00Z,140.75,141.16,140.5,140.92,45508704,1.875443102\n2006-11-24T14:30:00Z,140.24001,140.84,140.2,140.35001,30998192,-2.942844291\n2006-11-27T14:30:00Z,140.28,140.35001,138.38,138.42,84547376,-17.45946524\n2006-11-28T14:30:00Z,138.24001,139.16,138.11,139.02,106667680,1.602707508\n2006-11-29T14:30:00Z,139.47,140.53,139.08279,140.47,91542000,12.09571204\n2006-11-30T14:30:00Z,140.44,141.05,139.75999,140.53,83997680,1.02293796\n2006-12-01T14:30:00Z,140.53,140.66,138.97,140.22,126156688,-2.519343066\n2006-12-04T14:30:00Z,140.25,141.55,140.23,141.28999,87814496,8.964371881\n2006-12-05T14:30:00Z,141.56,141.96001,141.25999,141.89999,73380688,4.536478338\n2006-12-06T14:30:00Z,141.87,142.07001,141.5,141.78,53324000,-0.305303757\n2006-12-07T14:30:00Z,142.03,142.3,141.11,141.16,62850304,-3.721262887\n2006-12-08T14:30:00Z,141.13,141.89999,140.78,141.42,79624624,0.648360572\n2006-12-11T14:30:00Z,141.42,142.09,141.34,141.83,39779296,3.50018997\n2006-12-12T14:30:00Z,141.69,141.87,140.89,141.72,77453504,0.040704388\n2006-12-13T14:30:00Z,142.23,142.34,141.56,141.87,55568400,-0.110714286\n2006-12-14T14:30:00Z,141.86,143.24001,141.84,143.12,64779200,10.28649934\n2006-12-15T14:30:00Z,142.64,142.89,142.24001,142.34,70858816,-3.131937854\n2006-12-18T14:30:00Z,142.53999,142.88,141.75,141.95,48956800,-2.32571084\n2006-12-19T14:30:00Z,141.55,142.56,141.19,142.22,65077504,1.432053018\n2006-12-20T14:30:00Z,142.28,142.66,142.00999,142.14,41473200,0.058867781\n2006-12-21T14:30:00Z,142.27,142.42999,141.32001,141.62,48698400,-3.938885395\n2006-12-22T14:30:00Z,141.64,141.64999,140.67,140.75,62073200,-7.67854095\n2006-12-26T14:30:00Z,140.81,141.61,140.78,141.58,32697600,4.99736534\n2006-12-27T14:30:00Z,141.87,142.60001,141.83,142.50999,39732496,8.455951697\n2006-12-28T14:30:00Z,142.41,142.7,141.99001,142.21001,37291104,-0.896446073\n2006-12-29T14:30:00Z,142.10001,142.53999,141.42999,141.62,45466704,-3.698431194\n2007-01-03T14:30:00Z,142.25,142.86,140.57001,141.37,94808496,-2.60478793\n2007-01-04T14:30:00Z,141.23,142.05,140.61,141.67,69634624,0.858433735\n2007-01-05T14:30:00Z,141.33,141.39999,140.38,140.53999,76688880,-9.018658918\n2007-01-08T14:30:00Z,140.82001,141.41,140.25,141.19,69655808,2.553556762\n2007-01-09T14:30:00Z,141.31,141.60001,140.39999,141.07001,75681120,-0.56341887\n2007-01-10T14:30:00Z,140.58,141.57001,140.3,141.53999,72447376,3.220336985\n2007-01-11T14:30:00Z,141.56,142.62,141.5,142.16,55532496,5.757454058\n2007-01-12T14:30:00Z,142.12,143.24001,142.11,143.24001,57631200,9.439545883\n2007-01-16T14:30:00Z,143.07001,143.44,142.73,142.96001,44988304,-0.177078309\n2007-01-17T14:30:00Z,142.85001,143.46001,142.73,143.02,51597008,0.484667694\n2007-01-18T14:30:00Z,143.17,143.25999,142.31,142.53999,68234368,-3.364572759\n2007-01-19T14:30:00Z,142.53999,143.10001,142.46001,142.82001,56983904,1.152195844\n2007-01-22T14:30:00Z,143.07001,143.10001,141.92999,142.38,60261696,-3.207461544\n2007-01-23T14:30:00Z,142.25999,143.08,142.06,142.8,54077200,1.898590097\n2007-01-24T14:30:00Z,142.97,143.98,142.91,143.95,56469392,10.38937894\n2007-01-25T14:30:00Z,143.84,143.92,142.00999,142.25999,73607312,-12.48828188\n2007-01-26T14:30:00Z,142.57001,142.64999,141.58,142.16,74585632,-2.030690004\n2007-01-29T14:30:00Z,142.19,142.8,141.74001,142.05,66216000,-0.972057884\n2007-01-30T14:30:00Z,142.35001,142.86,142.06,142.78999,70410624,5.57465625\n2007-01-31T14:30:00Z,142.63,144.13,142.39999,143.75,91887872,7.419215573\n2007-02-01T14:30:00Z,144.14999,144.66,143.91,144.61,69316128,7.019732827\n2007-02-02T14:30:00Z,144.73,144.95,144.38,144.81,49607696,1.101281108\n2007-02-05T14:30:00Z,144.7,144.94,144.34,144.85001,45735200,0.639688004\n2007-02-06T14:30:00Z,144.97,145.03,144.33,144.89,57082192,0.165223804\n2007-02-07T14:30:00Z,145.12,145.36,144.57001,145.21001,55694192,1.251227253\n2007-02-08T14:30:00Z,144.78,145.12,144.27,145.02,70646000,-0.304204087\n2007-02-09T14:30:00Z,145.06,145.33,143.39,143.94,79084880,-8.048125\n2007-02-12T14:30:00Z,143.94,144.03999,143.19,143.45,65657056,-4.210490801\n2007-02-13T14:30:00Z,143.77,144.89999,143.75999,144.66,64107072,9.797696266\n2007-02-14T14:30:00Z,144.8,145.89999,144.78,145.61,66062368,8.717015028\n2007-02-15T14:30:00Z,145.67,145.95,145.42999,145.8,38721696,1.345569611\n2007-02-16T14:30:00Z,145.44,145.75999,145.23,145.73,39842800,0.657462725\n2007-02-20T14:30:00Z,145.56,146.2,144.06,146.03999,56923904,2.93658178\n2007-02-21T14:30:00Z,145.61,146.07001,145.35001,145.98,63973392,1.257818289\n2007-02-22T14:30:00Z,146.05,146.42,145.17,145.87,79079680,-0.405377095\n2007-02-23T14:30:00Z,145.74001,145.78999,144.75,145.3,71971376,-5.195609758\n2007-02-26T14:30:00Z,145.83,145.95,144.75,145.17,70074752,-1.767657051\n2007-02-27T14:30:00Z,143.88,144.2,139,139.5,274909952,-52.89983974\n2007-02-28T14:30:00Z,140.39,141.98,139.8,140.92999,177549680,2.737888321\n2007-03-01T14:30:00Z,139.34,141.25,138.05,140.50999,212841120,1.619145517\n2007-03-02T14:30:00Z,140.05,140.66,138.66,138.67,162600320,-11.28501435\n2007-03-05T14:30:00Z,137.92999,139.58,137.33,137.35001,144137008,-6.309424855\n2007-03-06T14:30:00Z,138.78,140.12,137.717,139.7,143379312,16.89098601\n2007-03-07T14:30:00Z,139.59,140.46001,139.39999,139.56,115224496,0.276162143\n2007-03-08T14:30:00Z,140.53999,141.16,140.07001,140.74001,117892256,9.40868543\n2007-03-09T14:30:00Z,141.31,141.42,140.08,140.78,107765632,-0.535077437\n2007-03-12T13:30:00Z,140.42,141.34,140.16,140.99001,80371808,1.070282381\n2007-03-13T13:30:00Z,140.17999,140.77,138.03999,138.25,190080624,-22.02303428\n2007-03-14T13:30:00Z,138.42999,139.36,136.75,139.28,231826880,2.948185993\n2007-03-15T13:30:00Z,138.97,139.99001,138.8,139.47,132413680,2.064523935\n2007-03-16T13:30:00Z,139.31,139.63,138.12,138.53,122046192,-6.218463303\n2007-03-19T13:30:00Z,139.25999,140.33,138.5466,140.2,96213120,11.01389553\n2007-03-20T13:30:00Z,140.08,141.05,139.96001,140.97,83351248,5.813722177\n2007-03-21T13:30:00Z,141.10001,143.64999,140.82001,143.28999,153296944,19.96002026\n2007-03-22T13:30:00Z,143.48,143.67999,142.78999,143.17999,118950624,0.624980435\n2007-03-23T13:30:00Z,143.28,143.81,143.14999,143.39,74425744,1.017896167\n2007-03-26T13:30:00Z,143.5,143.64999,142.09,143.2,113811504,-1.599419524\n2007-03-27T13:30:00Z,143.12,143.16,142.39,142.86,100535184,-3.18966763\n2007-03-28T13:30:00Z,142.14,142.47,141.25999,141.82001,152962064,-8.60533538\n2007-03-29T13:30:00Z,142.53999,142.61,141.19,141.97,139480064,-0.707708784\n2007-03-30T13:30:00Z,142.24001,142.84,140.56,142,128208496,-0.845791701\n2007-04-02T13:30:00Z,142.16,142.46001,140.89,142.16,79428368,0.425599593\n2007-04-03T13:30:00Z,142.97,143.98,142.91,143.69,82499312,14.87802768\n2007-04-04T13:30:00Z,143.69,143.95,143.16,143.85001,64006528,1.434329575\n2007-04-05T13:30:00Z,143.67,144.44,143.61,144.24001,46843232,3.030503324\n2007-04-09T13:30:00Z,144.64999,144.8,144.14999,144.44,51137744,1.048849585\n2007-04-10T13:30:00Z,144.33,144.85001,144.27,144.61,56632064,1.043254428\n2007-04-11T13:30:00Z,144.82001,144.86,143.53999,144.02,106552256,-4.426292572\n2007-04-12T13:30:00Z,143.74001,144.92,143.34,144.66,116447120,2.844073428\n2007-04-13T13:30:00Z,144.89999,145.32001,144.36,145.32001,85181568,3.813119614\n2007-04-16T13:30:00Z,145.83,146.86,145.82001,146.7,83206816,13.24723879\n2007-04-17T13:30:00Z,146.97,147.39999,146.64999,147.09,108442368,3.018367733\n2007-04-18T13:30:00Z,146.60001,147.7,146.57001,147.27,88348256,1.791216681\n2007-04-19T13:30:00Z,146.55,147.39999,146.36,147.23,103342944,2.202003773\n2007-04-20T13:30:00Z,148.22,148.62,147.0439,148.62,124128320,8.756657694\n2007-04-23T13:30:00Z,148.37,148.73,147.97,148.06,77569312,-2.905159884\n2007-04-24T13:30:00Z,148.23,148.39999,147.32001,148.12,114473504,-0.289687916\n2007-04-25T13:30:00Z,148.73,149.66,148.0233,149.48,109158944,9.875428134\n2007-04-26T13:30:00Z,149.49001,149.8,149.10001,149.64999,88749440,1.170703509\n2007-04-27T13:30:00Z,149.09,149.74001,148.84,149.53,108191744,0.75400297\n2007-04-30T13:30:00Z,149.64,149.74001,148.21001,148.28999,101012752,-9.080037156\n2007-05-01T13:30:00Z,148.42,149.47,147.67,148.67,134434624,0.577954076\n2007-05-02T13:30:00Z,148.89999,149.95,148.75,149.53999,87181808,7.692836852\n2007-05-03T13:30:00Z,149.97,150.39999,149.05,150.35001,87844064,4.129255409\n2007-05-04T13:30:00Z,150.75,151.12,150.22,150.92,96412256,3.627420063\n2007-05-07T13:30:00Z,150.88,151.2,150.81,150.95,63688656,0.434971098\n2007-05-08T13:30:00Z,150.58,150.92,150.13,150.75,81533936,-0.607522796\n2007-05-09T13:30:00Z,150.64,152.82001,150.37,151.16,102947872,3.698285375\n2007-05-10T13:30:00Z,150.73,151.02,149.27,149.58,153698560,-12.26682692\n2007-05-11T13:30:00Z,149.75,150.92999,149.72,150.86,113413120,8.329835936\n2007-05-14T13:30:00Z,150.86,151.3,149.78999,150.53,108062320,-0.813726829\n2007-05-15T13:30:00Z,150.7,151.66499,150.19,150.57001,180931808,-0.489547285\n2007-05-16T13:30:00Z,150.8,151.63,150.38,151.60001,114667008,7.219039291\n2007-05-17T13:30:00Z,151.38,151.96001,151.11,151.3,101566000,-0.408358681\n2007-05-18T13:30:00Z,152.00999,152.62,151.81,152.62,99182256,12.20395507\n2007-05-21T13:30:00Z,152.58,153.23,152.4993,152.53999,174706432,0.226571589\n2007-05-22T13:30:00Z,152.7,153.16,152.38,152.42,82254320,-1.32434747\n2007-05-23T13:30:00Z,152.95,153.5,152.36,152.44,133950624,-1.701446281\n2007-05-24T13:30:00Z,152.53,153.21001,150.74001,151.06,187770320,-9.172828621\n2007-05-25T13:30:00Z,151.49001,152.02,151.17999,151.69,83309120,1.715945894\n2007-05-29T13:30:00Z,151.94,152.5,151.45,152.24001,83960816,3.451769919\n2007-05-30T13:30:00Z,151.46001,153.53999,151.34,153.48,131273376,8.303426413\n2007-05-31T13:30:00Z,153.66,153.89,153.12,153.32001,115777808,0.351741499\n2007-06-01T13:30:00Z,153.88,154.39999,153.50999,154.08,107774432,4.888937956\n2007-06-04T13:30:00Z,153.53999,154.39,153.48,154.10001,78047568,1.367265625\n2007-06-05T13:30:00Z,153.74001,153.89999,152.86,153.49001,127943056,-3.602523769\n2007-06-06T13:30:00Z,152.91,152.95,151.75,151.84,164138128,-15.94892788\n2007-06-07T13:30:00Z,151.56,152.5,149.06,149.10001,232486192,-19.85874629\n2007-06-08T13:30:00Z,149.5,151.19,149.09,151.03999,176982320,10.07938779\n2007-06-11T13:30:00Z,150.92999,151.95,150.7,151.3,102527504,2.887312041\n2007-06-12T13:30:00Z,150.67,151.53999,149.55,149.64999,235736560,-10.85882325\n2007-06-13T13:30:00Z,150.5,152.07001,149.722,151.89,193250624,15.36005291\n2007-06-14T13:30:00Z,152.06,153.12,152.03,152.86,146645312,8.758395522\n2007-06-15T13:30:00Z,153.14,153.66,152.92999,153.07001,154416368,1.943072834\n2007-06-18T13:30:00Z,153.38,153.39,152.66,152.89,88635680,-1.516999221\n2007-06-19T13:30:00Z,152.55,153.38,152.36,153.27,111117440,1.790344639\n2007-06-20T13:30:00Z,153.58,153.58,150.96001,151.14,177234432,-16.34530012\n2007-06-21T13:30:00Z,151.08,152.11,150.25,151.98,205265680,1.66902834\n2007-06-22T13:30:00Z,151.52,151.77,149.85001,150.55,205153120,-9.999164163\n2007-06-25T13:30:00Z,150.24001,151.25,149.02,149.83,232036432,-4.515375758\n2007-06-26T13:30:00Z,150.21001,150.46001,148.28,148.28999,198318256,-11.04569492\n2007-06-27T13:30:00Z,148.13,150.57001,148.06,150.39999,209169056,13.17767741\n2007-06-28T13:30:00Z,150.38,151.41,149.67,150.38,157701504,1.497802408\n2007-06-29T13:30:00Z,150.89999,151.64999,149.14999,150.42999,199697632,-0.587402125\n2007-07-02T13:30:00Z,150.87,151.92,150.77,151.78999,103352000,11.0292424\n2007-07-03T13:30:00Z,152.17999,152.5,151.99001,152.34,54047488,4.543298307\n2007-07-05T13:30:00Z,152.39999,152.56,151.63,152.17999,89254432,-1.05222232\n2007-07-06T13:30:00Z,152.38,153.17,151.92999,152.98,81106368,4.993061589\n2007-07-09T13:30:00Z,153.16,153.36,152.62,153,72343568,0.240168539\n2007-07-10T13:30:00Z,152.28999,152.61,150.77,150.92,180356128,-18.84077967\n2007-07-11T13:30:00Z,150.75,152.05,150.52,151.99001,175533632,5.082432603\n2007-07-12T13:30:00Z,152.37,154.75,152.34,154.39,133863120,22.16569725\n2007-07-13T13:30:00Z,154.57001,155.46001,154.39,154.85001,111793872,4.691921599\n2007-07-16T13:30:00Z,154.99001,155.53,154.58,154.83,98370368,-0.125060661\n2007-07-17T13:30:00Z,154.92999,156,154.67999,154.75,126120752,-1.129112209\n2007-07-18T13:30:00Z,154.23,154.8,153.3,154.47,237719120,-1.202454919\n2007-07-19T13:30:00Z,155.2,155.53,154.75,155.07001,145213120,4.022422832\n2007-07-20T13:30:00Z,154.89,155.2484,152.28999,153.5,245501872,-13.3469457\n2007-07-23T13:30:00Z,154.17999,154.72,153.3,153.97,121181808,0.07551662\n2007-07-24T13:30:00Z,153.12,154.28,150.75999,151.3,256825632,-20.3994556\n2007-07-25T13:30:00Z,152.02,152.39,150.25,151.61,265201056,-0.918834297\n2007-07-26T13:30:00Z,150.19,150.8,146.39,148.02,467454208,-31.69617438\n2007-07-27T13:30:00Z,148.21001,148.87,145.05,145.11,422916864,-21.28573044\n2007-07-30T13:30:00Z,145.92999,147.81,145.28999,147.38,282213376,11.06719621\n2007-07-31T13:30:00Z,148.33,149.46001,145.03999,145.72,316607488,-7.958496503\n2007-08-01T13:30:00Z,145.17999,147.00999,143.95,146.42999,467658496,2.033687801\n2007-08-02T13:30:00Z,146.75999,147.75999,145.25999,147.60001,294674176,5.623033111\n2007-08-03T13:30:00Z,147.28,147.58,143.2,143.8,359378688,-31.86416347\n2007-08-06T13:30:00Z,144.21001,146.83,142.53,146.21001,324726272,9.303953457\n2007-08-07T13:30:00Z,145.94,149,145.23,147.77,280677376,12.14899349\n2007-08-08T13:30:00Z,148.41,150.59,147.34,149.83,274739968,15.34313891\n2007-08-09T13:30:00Z,147.42999,149.95,145.28999,145.39,357626368,-28.88420007\n2007-08-10T13:30:00Z,144.39,146.5,143.12,144.71001,411013376,-3.756525992\n2007-08-13T13:30:00Z,146.5,146.89,145.02,145.23,181944192,-0.226591718\n2007-08-14T13:30:00Z,145.7,146.06,142.72,143.00999,264096560,-16.65261902\n2007-08-15T13:30:00Z,142.72,144.46001,140.62,141.03999,323735040,-11.52788787\n2007-08-16T13:30:00Z,139.78999,142.94,137,142.10001,546451200,7.126464524\n2007-08-17T13:30:00Z,145.5,148.35001,141.386,144.71001,388157184,14.46425842\n2007-08-20T13:30:00Z,145.17,145.47,143.28999,144.64,187079936,-1.987825749\n2007-08-21T13:30:00Z,144.60001,145.97,144.14,144.92999,157000816,1.365918471\n2007-08-22T13:30:00Z,146.00999,146.8,145.33,146.64999,172226192,14.15508871\n2007-08-23T13:30:00Z,147.34,147.64999,145.61,146.52,203853744,-1.122692035\n2007-08-24T13:30:00Z,146.48,148.33,146.28,148.33,128886256,12.69207317\n2007-08-27T13:30:00Z,147.85001,148.33,146.73,146.95,112992128,-6.630327273\n2007-08-28T13:30:00Z,146.16,146.25,143.46001,143.72,219626128,-30.30413882\n2007-08-29T13:30:00Z,144.37,146.74001,143.96001,146.53999,207614496,17.7187918\n2007-08-30T13:30:00Z,145.45,147.19,145.31,146.14999,191681632,1.594585624\n2007-08-31T13:30:00Z,147.64999,148.5,146.83,147.59,185474624,10.65443639\n2007-09-04T13:30:00Z,147.45,149.98,147.39999,149.08,120054688,13.18181637\n2007-09-05T13:30:00Z,148.2,148.36,147,147.78999,166256624,-6.645215041\n2007-09-06T13:30:00Z,147.95,148.61,147.12,148.13,127860432,1.053999229\n2007-09-07T13:30:00Z,146.48,146.89,145.25999,146.07001,235429056,-17.3511748\n2007-09-10T13:30:00Z,146.52,146.72,144.33,145.78999,192354688,-3.261529413\n2007-09-11T13:30:00Z,146.24001,147.7,146.13,147.49001,162048256,13.30368623\n2007-09-12T13:30:00Z,147.28999,148.44,146.98,147.87,149577680,3.291115744\n2007-09-13T13:30:00Z,148.55,149.45,148.2,148.91,153905248,8.640626978\n2007-09-14T13:30:00Z,147.96001,149.09,147.74001,148.89999,121903056,2.792862712\n2007-09-17T13:30:00Z,148.31,148.8905,147.63,148.10001,109853056,-3.544715763\n2007-09-18T13:30:00Z,148.83,152.5,148.13409,152.46001,263372816,37.9597715\n2007-09-19T13:30:00Z,153.41,154.39,148.10001,153.36,193766752,6.748589266\n2007-09-20T13:30:00Z,153.34,153.42999,152.11,152.28,175178752,-9.512852817\n2007-09-21T13:30:00Z,152.71001,153.11771,151.74001,151.97,141459312,-3.011962541\n2007-09-24T13:30:00Z,152.42,152.82001,151.36,151.69,139314944,-2.680490365\n2007-09-25T13:30:00Z,150.81,151.66,150.47,151.39,142289568,-1.057882883\n2007-09-26T13:30:00Z,152.25,152.77,151.39,152.19,135546944,5.175\n2007-09-27T13:30:00Z,152.91,153.10001,152.19,153.09,102704064,5.994933501\n2007-09-28T13:30:00Z,152.85001,153.19,151.98,152.58,133367008,-3.316760707\n2007-10-01T13:30:00Z,152.60001,154.75,152.5,154.3,148120256,14.64509943\n2007-10-02T13:30:00Z,154.61,154.64999,153.81,154.09,112689008,-0.108949817\n2007-10-03T13:30:00Z,153.81,154.41,153.00999,153.78,119037872,-2.007358408\n2007-10-04T13:30:00Z,154.11,154.25999,153.59,154.02,76764944,0.83025326\n2007-10-05T13:30:00Z,155.03,156.10001,154.63,155.85001,134583008,16.03764852\n2007-10-08T13:30:00Z,155.39,155.49001,154.77,155.02,71270128,-4.947999457\n2007-10-09T13:30:00Z,155.60001,156.5,155.03,156.48,94001120,10.66623844\n2007-10-10T13:30:00Z,156.03999,156.44,155.41,156.22,101668560,0.263301084\n2007-10-11T13:30:00Z,156.92999,157.52,154.53999,155.47,233513568,-4.980974769\n2007-10-12T13:30:00Z,155.46001,156.35001,155.27,156.33,124539376,3.539804724\n2007-10-15T13:30:00Z,156.27,156.36,153.94,155.00999,161094752,-9.812134478\n2007-10-16T13:30:00Z,154.41,156.48,153.47,153.78,166428752,-5.384149805\n2007-10-17T13:30:00Z,154.98,155.09,152.47,154.25,216672560,-0.154759226\n2007-10-18T13:30:00Z,153.45,154.19,153.08,153.69,148428368,-3.441989603\n2007-10-19T13:30:00Z,153.09,156.48,149.66,149.67,297148672,-20.75772166\n2007-10-22T13:30:00Z,148.86,150.75999,148.66,150.53999,261945376,1.971083447\n2007-10-23T13:30:00Z,151.46001,151.95,150.25,151.75999,179986432,7.440752509\n2007-10-24T13:30:00Z,151.21001,151.74001,148,151.48,326582016,-0.430064778\n2007-10-25T13:30:00Z,151.64999,152.28999,149.88,151.84,237346064,2.109001559\n2007-10-26T13:30:00Z,153.06,153.62,151.89999,153.62,176488496,13.04359804\n2007-10-29T13:30:00Z,153.92999,154.44,153.55,154.13,106819248,3.731820995\n2007-10-30T13:30:00Z,153.45,153.75,152.87,153.06,132970816,-8.542932103\n2007-10-31T13:30:00Z,153.98,155.27,152.84,154.64999,220927568,9.986997651\n2007-11-01T13:30:00Z,153.28999,153.41,150.59,151.03,332966400,-32.2330078\n2007-11-02T13:30:00Z,151.53,152,149.21001,151.2,331219456,-1.898646884\n2007-11-05T14:30:00Z,149.64,151.16,148,150.05,226765936,-6.298850575\n2007-11-06T14:30:00Z,150.86,152.11,149.89999,152.07001,177729632,15.18555839\n2007-11-07T14:30:00Z,150.44,152.10719,147.55,147.91,306449152,-29.77784233\n2007-11-08T14:30:00Z,147.99001,149.3,145.07001,147.16,374404352,-6.561576765\n2007-11-09T14:30:00Z,145.69,147.53999,144.89,145.14,277731328,-12.42496847\n2007-11-12T14:30:00Z,145.21001,146.61,143.7,143.7,243016816,-7.03195724\n2007-11-13T14:30:00Z,145.37,148.31,145.22,148.08,191073376,36.51396935\n2007-11-14T14:30:00Z,149.22,149.39999,146.78,147.67,230524880,-1.269706134\n2007-11-15T14:30:00Z,146.57001,147.49001,144.52,145.53999,263051680,-17.31766524\n2007-11-16T14:30:00Z,146.31,146.47,144.57001,145.78999,308757248,-0.751680044\n2007-11-19T14:30:00Z,145.28,145.36,143.19,143.75999,267712624,-18.86679385\n2007-11-20T14:30:00Z,144.02,145.53,142.11,144.64,414724608,2.358092816\n2007-11-21T14:30:00Z,143.08,143.91,141.67,141.67999,259160320,-23.57313077\n2007-11-23T14:30:00Z,143.07001,144.34,142.7,144.13,77684624,17.48952991\n2007-11-26T14:30:00Z,144.42999,144.88,140.66,140.95,214165440,-22.50954617\n2007-11-27T14:30:00Z,141.74001,143.23,140.95,142.57001,293832192,5.270298826\n2007-11-28T14:30:00Z,144.19,147.47,144.14,147.13,259068752,44.19270385\n2007-11-29T14:30:00Z,146.62,147.72,146.10001,147.17999,199180560,2.911169209\n2007-11-30T14:30:00Z,149.03999,149.87,147.33,148.66,222886496,8.726734198\n2007-12-03T14:30:00Z,148.19,148.45,147.28999,147.67999,145927872,-8.373714966\n2007-12-04T14:30:00Z,146.66,147.54089,146.31,146.36,136528560,-9.579117988\n2007-12-05T14:30:00Z,147.92999,149.2,147.83,148.81,171036688,22.92033888\n2007-12-06T14:30:00Z,148.63,151.21001,148.57001,150.94,154542560,18.38294077\n2007-12-07T14:30:00Z,151.42,151.5,150.55,150.91,148980064,0.670212766\n2007-12-10T14:30:00Z,151.28,152.25,150.86,152.08,123914368,7.961079077\n2007-12-11T14:30:00Z,152.14,152.89,147.83,147.91,250346368,-30.72867158\n2007-12-12T14:30:00Z,151.06,151.77,147.2,149.37,322435584,-1.896990227\n2007-12-13T14:30:00Z,148.32001,149.39,147.3,149.06,237607056,-1.866630224\n2007-12-14T14:30:00Z,147.92999,149.10001,147.10001,147.17,159152880,-11.68929899\n2007-12-17T14:30:00Z,146.61,146.87,144.86,145.07001,177269312,-18.79938057\n2007-12-18T14:30:00Z,146.10001,146.48,143.96001,145.88,245569248,0.955531704\n2007-12-19T14:30:00Z,145.94,146.89,144.94,145.88,198917120,-0.267619757\n2007-12-20T14:30:00Z,146.84,146.86,145.17999,146.8,214813744,3.197989982\n2007-12-21T14:30:00Z,147.37,148.42,147.09,148.13,146090320,11.59090909\n2007-12-24T14:30:00Z,148.82001,149.48,148.48,149.23,45601328,9.241040522\n2007-12-26T14:30:00Z,148.64999,149.67999,148.5,149.55,67118064,3.103962149\n2007-12-27T14:30:00Z,149.02,149.03,147.32001,147.67,122981680,-14.79467221\n2007-12-28T14:30:00Z,148.53999,148.61,146.89999,147.3,116398064,-3.809032984\n2007-12-31T14:30:00Z,147.10001,147.6062,146.06,146.21001,108126752,-7.703195983\n2008-01-02T14:30:00Z,146.53,146.99001,143.88,144.92999,204935504,-10.0616845\n2008-01-03T14:30:00Z,144.91,145.49001,144.07001,144.86,125133248,-1.461823714\n2008-01-04T14:30:00Z,143.34,143.44,140.91,141.31,232330816,-34.74466756\n2008-01-07T14:30:00Z,141.81,142.23,140.10001,141.19,234990944,-2.688080393\n2008-01-08T14:30:00Z,142.08,142.89999,138.44,138.91,326366720,-14.97159257\n2008-01-09T14:30:00Z,139.09,140.78999,137.7,140.37,301910784,3.957007817\n2008-01-10T14:30:00Z,139.67999,142.8,139.37,141.28999,335701248,8.2822095\n2008-01-11T14:30:00Z,140.78,141.8985,139,140.14999,267076560,-4.563438967\n2008-01-14T14:30:00Z,141.16,141.86,140.39999,141.28,170365632,6.332803029\n2008-01-15T14:30:00Z,139.78999,141.4903,137.89999,138.17,240456496,-22.69871572\n2008-01-16T14:30:00Z,137.36,139.12,136.28,136.98,378956032,-6.497780959\n2008-01-17T14:30:00Z,137.81,137.88,132.92999,133.42999,398404864,-29.2762912\n2008-01-18T14:30:00Z,134.74001,135.02,131.10001,132.06,348561408,-11.04883018\n2008-01-22T14:30:00Z,127.21001,132.42661,126,130.72,435925248,-1.36098865\n2008-01-23T14:30:00Z,127.09,134.19,126.84,133.86,511912960,21.81836754\n2008-01-24T14:30:00Z,134.48,135.46001,133.31,134.99001,259949248,8.009176904\n2008-01-25T14:30:00Z,136.50999,136.75999,132.60001,133.03999,269603840,-12.3943171\n2008-01-28T14:30:00Z,133.25999,135.52,132.06,135.24001,217934560,8.31874296\n2008-01-29T14:30:00Z,136.10001,136.45,134.88,135.91,168968816,3.91850504\n2008-01-30T14:30:00Z,135.58,138.53999,134.60001,134.91,334939136,-5.699034024\n2008-01-31T14:30:00Z,133.39999,138.53999,133.2,137.37,343680768,17.62066338\n2008-02-01T14:30:00Z,137.94,139.61,137.52,139.58,206843680,17.83530971\n2008-02-04T14:30:00Z,139.21001,139.3,137.64,137.82001,124694256,-11.21968495\n2008-02-05T14:30:00Z,135.94,136.25,133.67,134.13,286882560,-34.53104091\n2008-02-06T14:30:00Z,134.58,135.25,132.41,133.05,250792880,-7.501328778\n2008-02-07T14:30:00Z,131.8,134.78999,131.73,133.92999,297541632,4.935940764\n2008-02-08T14:30:00Z,133.09,134.22,132.10001,133.07001,221643504,-1.455183755\n2008-02-11T14:30:00Z,133.10001,134.23,132.03999,133.75,188576256,3.30288023\n2008-02-12T14:30:00Z,134.91,136.31,133.98,134.99001,256654368,8.851475409\n2008-02-13T14:30:00Z,136.00999,137.10001,135.14,136.37,181967744,10.13924136\n2008-02-14T14:30:00Z,136.95,137,134.78999,135.17,215207120,-8.586953468\n2008-02-15T14:30:00Z,134.55,136.10001,133.36,135.14,154110256,-0.639322953\n2008-02-19T14:30:00Z,136.69,136.89,134.61,135.52,145190000,-0.259075695\n2008-02-20T14:30:00Z,133.99001,137.60001,133.75999,135.92,220709376,3.373849862\n2008-02-21T14:30:00Z,136.66,137.00999,134.07001,134.78999,201051184,-5.346349154\n2008-02-22T14:30:00Z,134.97,135.85001,132.86,135.62,205491008,2.398549897\n2008-02-25T14:30:00Z,135.53999,137.64999,134.78,137.33,190107008,11.57878401\n2008-02-26T14:30:00Z,136.75,138.95,136.5,138.36,212420624,7.975950948\n2008-02-27T14:30:00Z,137.56,139.14,137.41,138.22,168395808,1.649692263\n2008-02-28T14:30:00Z,137.24001,137.96001,136.55,136.87,170831056,-8.386736219\n2008-02-29T14:30:00Z,135.60001,137.0249,132.78,133.82001,252715120,-23.76551162\n2008-03-03T14:30:00Z,133.14,133.81,132.24001,133.5,195613632,-2.859895074\n2008-03-04T14:30:00Z,132.23,133.39999,130.99001,132.99001,282513152,-0.245986619\n2008-03-05T14:30:00Z,133.41,134.77,132.34,133.83,270681344,5.265200725\n2008-03-06T14:30:00Z,132.98,133.22,130.55,131.06,247912128,-24.12743506\n2008-03-07T14:30:00Z,129.63,131.74001,128.58,129.71001,326434560,-7.622167934\n2008-03-10T13:30:00Z,129.81,129.92999,127.59,128,235683376,-14.56954273\n2008-03-11T13:30:00Z,130.72,132.72,127.71519,132.60001,341875712,27.50103852\n2008-03-12T13:30:00Z,132.73,133.77,131.16,131.36,229161120,-4.251671366\n2008-03-13T13:30:00Z,129.61,132.64,128.60001,131.64999,351881472,3.808121817\n2008-03-14T13:30:00Z,132.77,132.81,127.78,129.61,484687872,-13.5781197\n2008-03-17T13:30:00Z,126.57001,129.25999,126.07001,128.3,405310976,-6.576295327\n2008-03-18T13:30:00Z,130.62,133.69,129.98,133.63,334416384,49.13676766\n2008-03-19T13:30:00Z,134.14,134.64999,130.03999,130.32001,345971456,-18.69267579\n2008-03-20T13:30:00Z,130.05,132.91,129.25999,132.08,245320624,6.397604096\n2008-03-24T13:30:00Z,133.31,135.81,133.24001,134.72,209110368,24.55544198\n2008-03-25T13:30:00Z,134.86,135.55,133.77,134.85001,192947184,1.329540592\n2008-03-26T13:30:00Z,134.46001,135.08839,133.11,133.2,196934192,-12.53098225\n2008-03-27T13:30:00Z,134.2,134.44,132.36,132.78,225153120,-4.675890474\n2008-03-28T13:30:00Z,132.99001,133.36,131.06,131.50999,180918688,-9.575881356\n2008-03-31T13:30:00Z,131.28999,132.73,131.09,131.97,166692128,1.631266154\n2008-04-01T13:30:00Z,133.71001,136.84,133.50999,136.61,254547248,44.62256188\n2008-04-02T13:30:00Z,137.06,137.67,135.98,136.7,210910816,1.741972171\n2008-04-03T13:30:00Z,135.94,137.44,135.71001,137.03999,175884752,2.719716695\n2008-04-04T13:30:00Z,137.12,137.96001,136.12,136.89,204473056,0.027207646\n2008-04-07T13:30:00Z,137.87,138.57001,136.74001,136.96001,154381312,-2.461520612\n2008-04-08T13:30:00Z,136.19,137.1554,135.95,136.82001,148937248,-0.231253238\n2008-04-09T13:30:00Z,136.61,136.8,134.89,135.83,195610560,-7.098204519\n2008-04-10T13:30:00Z,135.39,136.67,134.89999,136.02,192967808,0.916989926\n2008-04-11T13:30:00Z,134.45,135.9837,133.00999,133.38,222973312,-18.02490263\n2008-04-14T13:30:00Z,133.19,133.53999,132.55,132.92999,160521936,-3.496237793\n2008-04-15T13:30:00Z,133.58,133.69,132.33,133.24001,172389120,0.250077852\n2008-04-16T13:30:00Z,134.53999,136.92999,134.39999,136.85001,189268816,33.78172944\n2008-04-17T13:30:00Z,136.02,137.25,135.66,137.05,179707504,4.435058901\n2008-04-18T13:30:00Z,138.94,139.56,138.25999,138.48,218530560,10.57316919\n2008-04-21T13:30:00Z,138.23,138.98,136.87,138.55,118587376,0.52008427\n2008-04-22T13:30:00Z,138.19,138.37,136.64,137.94,162166064,-4.115296053\n2008-04-23T13:30:00Z,138.09,138.78,137.12,137.72,193309008,-1.424891147\n2008-04-24T13:30:00Z,138.08,139.74001,137.03999,138.32001,229381376,2.837013198\n2008-04-25T13:30:00Z,139.41,139.89,137.91,139.60001,190788064,6.902403995\n2008-04-28T13:30:00Z,139.88,140.25,139.38,139.63,105616496,-0.210349563\n2008-04-29T13:30:00Z,139.39,139.73,138.61,139.08,125514064,-4.137684989\n2008-04-30T13:30:00Z,139.28999,140.59,138.25999,138.25999,208395808,-5.537074872\n2008-05-01T13:30:00Z,138.39,141.12,138.27,141.12,187279504,22.78534146\n2008-05-02T13:30:00Z,142.33,142.37,140.56,141.50999,181585504,2.07649511\n2008-05-05T13:30:00Z,141.05,141.61,140.41,140.83,118510368,-4.868682618\n2008-05-06T13:30:00Z,140.00999,142.2,139.69,142.05,179339808,7.293998173\n2008-05-07T13:30:00Z,141.89,142.03999,139.13,139.52,199267248,-17.07773637\n2008-05-08T13:30:00Z,139.74001,140.32001,138.98,139.16,178321184,-3.214784222\n2008-05-09T13:30:00Z,138.60001,139.39,138.45,138.89999,152589632,-1.043004365\n2008-05-12T13:30:00Z,139.25,140.56,138.73,140.46001,150911440,12.1996895\n2008-05-13T13:30:00Z,140.8,140.89,139.73,140.48,159141872,0.506927125\n2008-05-14T13:30:00Z,141.07001,142.2,140.46201,140.77,181910752,0.354757864\n2008-05-15T13:30:00Z,141.03999,142.63,140.83,142.53,166927008,14.82873595\n2008-05-16T13:30:00Z,142.86,142.87,141.61,142.66,204236816,1.41769423\n2008-05-19T13:30:00Z,142.81,144.3,142.3,143.05,165704064,2.3\n2008-05-20T13:30:00Z,142.27,142.34,141,141.89,178552000,-9.417735043\n2008-05-21T13:30:00Z,141.81,142.12,139,139.49001,252724816,-20.53442195\n2008-05-22T13:30:00Z,139.42999,140.17,139,139.50999,170820320,-1.262882875\n2008-05-23T13:30:00Z,139.05,139.6631,137.52,137.64,181436192,-14.6907348\n2008-05-27T13:30:00Z,137.8,139,137.53,138.66,168322816,5.118655693\n2008-05-28T13:30:00Z,139.17,140,138,139.3,181288064,3.478555305\n2008-05-29T13:30:00Z,139.13,140.92999,139.08,140,173927184,6.318138891\n2008-05-30T13:30:00Z,140.47,140.74001,139.94,140.35001,117361936,2.306894866\n2008-06-02T13:30:00Z,139.83,139.86,138,138.89999,181069872,-13.38061175\n2008-06-03T13:30:00Z,139.3,139.62,137.23,138.09,272049920,-6.556943225\n2008-06-04T13:30:00Z,137.7,139.16,137.46001,138.02,246726368,-0.709663344\n2008-06-05T13:30:00Z,138.58,140.89,138.32001,140.78,237867008,25.24067007\n2008-06-06T13:30:00Z,139.55,139.8,136.22,136.28999,384276224,-34.36048214\n2008-06-09T13:30:00Z,136.86,137.5,135.41,136.62,228263872,-1.574970622\n2008-06-10T13:30:00Z,135.67,137.10001,135.35001,135.94,260234816,-2.653121374\n2008-06-11T13:30:00Z,135.97,136.2592,133.92999,133.94,284064256,-15.44957586\n2008-06-12T13:30:00Z,134.60001,135.87,133.52,134.45,252791744,-0.306068788\n2008-06-13T13:30:00Z,135.17,136.52,134.418,136.14999,244727056,13.01598963\n2008-06-16T13:30:00Z,135.55,136.92999,135.46001,136.23,185833376,1.890352242\n2008-06-17T13:30:00Z,137.07001,137.12,135.37,135.57001,191743808,-3.592418945\n2008-06-18T13:30:00Z,134.69,135.5235,133.71001,134.25,266970560,-10.06535168\n2008-06-19T13:30:00Z,134.14999,135.24001,132,134.42,304310784,0.818581978\n2008-06-20T13:30:00Z,132.84,133.09,131.22,131.58,289275648,-26.14789035\n2008-06-23T13:30:00Z,132.09,132.23,131.32001,131.45,165115680,-2.537010506\n2008-06-24T13:30:00Z,131.05,132.44,130.19,131.19,267300624,-1.143672199\n2008-06-25T13:30:00Z,131.72,133.39999,131.239,131.81,287853824,4.354311999\n2008-06-26T13:30:00Z,130.57001,131.42,128.08,128.23,297775104,-30.97960936\n2008-06-27T13:30:00Z,128.28,128.86,127.035,127.53,303423232,-5.144452619\n2008-06-30T13:30:00Z,127.89,128.91,127.3,127.98,258888192,1.475486787\n2008-07-01T13:30:00Z,126.52,128.47,125.92999,128.38,388621824,6.762506598\n2008-07-02T13:30:00Z,128.78999,129.16,125.95,126.17999,291223296,-12.56330663\n2008-07-03T13:30:00Z,127.11,127.11,124.99001,126.31,239359632,-2.47463618\n2008-07-07T13:30:00Z,126.78999,127.34,123.92,125.02,372427264,-9.800134755\n2008-07-08T13:30:00Z,124.99001,127.39,124.2,127.24001,376225280,11.83578692\n2008-07-09T13:30:00Z,127.5,127.74001,124.39,124.78999,336789760,-14.7623084\n2008-07-10T13:30:00Z,124.42999,125.78999,123.58,125.3,436475648,0.700624006\n2008-07-11T13:30:00Z,123.97,125.89999,122.49001,123.84,481124608,-6.330242289\n2008-07-14T13:30:00Z,125.25999,125.5,122.39999,122.72,322720768,-8.023401561\n2008-07-15T13:30:00Z,121.8,123.49001,120.02,120.99001,502502400,-11.38693527\n2008-07-16T13:30:00Z,121.45,124.57001,121.10001,123.96001,371642880,24.14585263\n2008-07-17T13:30:00Z,125.14,126.25999,124.09,125.2,375490560,9.528851218\n2008-07-18T13:30:00Z,126.17,126.41589,125.14999,125.98,267030000,4.152953978\n2008-07-21T13:30:00Z,126.50999,126.8,125.19,126.05,222863008,-0.641575792\n2008-07-22T13:30:00Z,125.14999,127.8,124.85001,127.48,296904192,8.849981291\n2008-07-23T13:30:00Z,127.89,129.14999,127.55,128.17,311698432,6.648458366\n2008-07-24T13:30:00Z,128.34,128.41,125.16,125.50999,248634496,-22.69407973\n2008-07-25T13:30:00Z,125.89,126.49001,125.17,125.48,219131008,-2.847274369\n2008-07-28T13:30:00Z,125.50999,126.06,123.42,123.64,205202880,-13.50875046\n2008-07-29T13:30:00Z,123.98,126.38,123.64,126.28,261505568,17.73901782\n2008-07-30T13:30:00Z,127.11,128.60001,126.28,128.53,354710016,17.70554193\n2008-07-31T13:30:00Z,127.39999,128.57001,126.63,126.83,277402112,-8.43403324\n2008-08-01T13:30:00Z,127.12,127.28,125.46001,126.16,248703568,-5.639235441\n2008-08-04T13:30:00Z,126.03999,126.14,124.75999,124.99001,188251744,-10.38717305\n2008-08-05T13:30:00Z,126.02,128.56,124.9736,128.36,251624320,24.79707548\n2008-08-06T13:30:00Z,128.02,129.3,127.48,128.92999,209555376,3.932915541\n2008-08-07T13:30:00Z,127.96001,129.0549,126.53999,127.00999,246312432,-11.80612946\n2008-08-08T13:30:00Z,126.58,129.92999,126.38,129.37,260811632,16.94905637\n2008-08-11T13:30:00Z,129.47,131.50999,129.23,130.71001,249425808,11.93760417\n2008-08-12T13:30:00Z,130.28011,130.7028,128.73,129.35001,213200816,-8.200116341\n2008-08-13T13:30:00Z,128.78999,129.64999,127.67,128.57001,256467184,-5.327185423\n2008-08-14T13:30:00Z,127.84,130.28,127.75,129.53999,239556064,7.297156644\n2008-08-15T13:30:00Z,129.92999,130.5,129.3,130.17,181005376,4.33855956\n2008-08-18T13:30:00Z,130.42999,130.48,127.66,128.39,172275056,-14.92485939\n2008-08-19T13:30:00Z,127.42,128.1181,126.53,126.99001,194673632,-11.05747374\n2008-08-20T13:30:00Z,127.39,127.95,126.34,127.58,225498128,2.01742297\n2008-08-21T13:30:00Z,126.75,128.44,126.60001,127.8,180609808,2.571676125\n2008-08-22T13:30:00Z,128.67,129.64999,127.8,129.64999,167715248,14.24436099\n2008-08-25T13:30:00Z,128.8,129.64999,126.75,127.02,171936880,-18.8741718\n2008-08-26T13:30:00Z,127.02,127.87,126.58,127.39,159117184,0.336815562\n2008-08-27T13:30:00Z,127.55,128.83,127.3,128.63,171032752,10.38674884\n2008-08-28T13:30:00Z,129.28,130.34,128.63,130.19,167537056,12.33380682\n2008-08-29T13:30:00Z,129.73,130.14,128.50999,128.78999,189210000,-9.161444113\n2008-09-02T13:30:00Z,130.03,130.71001,127.52,127.99001,252469568,-7.19996989\n2008-09-03T13:30:00Z,127.88,128.5,126.92999,127.88,251949680,-1.974813643\n2008-09-04T13:30:00Z,126.97,127.23,123.96001,124.03,340438528,-36.25591935\n2008-09-05T13:30:00Z,123.28999,124.95,122,124.42,289514752,0.757479902\n2008-09-08T13:30:00Z,128.03999,128.24001,124.42,126.99001,364148736,13.54529576\n2008-09-09T13:30:00Z,127.10001,127.36,122.8,123.22,377326848,-32.4324813\n2008-09-10T13:30:00Z,123.89,124.89999,122.55,123.72,298916608,-1.755272508\n2008-09-11T13:30:00Z,122.12,125.74001,121.60001,125.50999,375369216,10.90560935\n2008-09-12T13:30:00Z,124.28999,126.21001,123.83,126.09,297851136,7.572015179\n2008-09-15T13:30:00Z,121.63,125.65199,119.89,120.09,483607040,-38.08116908\n2008-09-16T13:30:00Z,117.2,122.32001,117,122.10001,581744128,13.79466946\n2008-09-17T13:30:00Z,119.64,121.8517,116,116.61,624095488,-30.60234801\n2008-09-18T13:30:00Z,118.05,121.78999,113.8,120.07001,776114688,13.74022046\n2008-09-19T13:30:00Z,126.7,128,116.52,124.12,501146880,13.50195686\n2008-09-22T13:30:00Z,124.4505,124.75,120.36,121.31,249966432,-23.45449355\n2008-09-23T13:30:00Z,120.85001,122.02,118.28,118.55,328230144,-19.64896536\n2008-09-24T13:30:00Z,119.35001,120,117.78999,118.92999,311871232,-1.317953297\n2008-09-25T13:30:00Z,119.39999,121.91,118.4369,120.78999,328252928,12.75292648\n2008-09-26T13:30:00Z,118.83,121.5,118.50999,120.85001,285917440,6.052335798\n2008-09-29T13:30:00Z,119.17999,121.17999,110.97,111.38,459562240,-74.14048199\n2008-09-30T13:30:00Z,113.50999,116.8,110.5321,115.99001,328510208,16.07628498\n2008-10-01T13:30:00Z,115.27,116.69,113.95,116.06,333084928,4.117182582\n2008-10-02T13:30:00Z,114.95,115.11,111.06,111.85001,365632512,-36.8083973\n2008-10-03T13:30:00Z,112.86,115.45,109.67999,110.34,461832448,-12.18676177\n2008-10-06T13:30:00Z,107.14999,107.62,100.64,104.72,610790912,-50.45321314\n2008-10-07T13:30:00Z,106.84,107.33,99.64999,100.03,540213504,-33.27429066\n2008-10-08T13:30:00Z,97.52,102.17999,96.81,97.50999,725787904,-12.02953124\n2008-10-09T13:30:00Z,99.66,100.62,90.25,90.7,534758400,-49.39947148\n2008-10-10T13:30:00Z,86.75999,93.94,83.58,88.5,871546880,-12.60831567\n2008-10-13T13:30:00Z,93.87,101.35001,89.94791,101.35001,456904704,108.8541138\n2008-10-14T13:30:00Z,104.7,105.53,97.11,99.85001,546688512,-5.292265934\n2008-10-15T13:30:00Z,97.46001,97.8,89.71001,90.02,484627456,-90.59064722\n2008-10-16T13:30:00Z,91.28999,94.77,86.53999,93.77,708811264,9.209299713\n2008-10-17T13:30:00Z,91.99001,98.59,91.64999,93.21001,476770048,2.669853596\n2008-10-20T13:30:00Z,95.35001,99.10001,94.08949,98.81,321294080,48.83582763\n2008-10-21T13:30:00Z,96.97,98.64,95.22,95.86,356502016,-13.5549405\n2008-10-22T13:30:00Z,93.2,95.86,87.53,90.64,516167936,-40.99373729\n2008-10-23T13:30:00Z,90.28999,92.45,85.81,91.69,634666496,4.602785156\n2008-10-24T13:30:00Z,84.06,89.92,84,87.03999,545812480,-18.87577618\n2008-10-27T13:30:00Z,85.97,89.50999,83.7,83.95,400238592,-10.68427037\n2008-10-28T13:30:00Z,87.34,94.24001,84.53,93.75999,639939328,76.61779998\n2008-10-29T13:30:00Z,93.77,97.17,92.10001,93.08,531381504,1.851905505\n2008-10-30T13:30:00Z,95.78,96.53999,92.89999,96.3,414582016,18.76051955\n2008-10-31T13:30:00Z,95.08,98.57001,94.48,96.83,411500032,5.160629581\n2008-11-03T14:30:00Z,96.78,97.69,95.95,97.11,205566752,2.229047072\n2008-11-04T14:30:00Z,99.06,100.86,96.7142,100.41,346977536,22.49075426\n2008-11-05T14:30:00Z,99.2,100.7114,95,96.19,390404096,-30.11536705\n2008-11-06T14:30:00Z,94.46001,95.44,90.06,90.86,477982720,-46.4077561\n2008-11-07T14:30:00Z,91.64999,94,90.5,93.86,380518656,14.29503144\n2008-11-10T14:30:00Z,95.21001,95.53,90.92,92.63,301903104,-7.002971609\n2008-11-11T14:30:00Z,90.75999,92.1377,88.64999,89.77,418596608,-22.72283905\n2008-11-12T14:30:00Z,88.23,90.1516,85.12,85.82001,454330624,-29.74175939\n2008-11-13T14:30:00Z,86.13,91.73,82.09,91.17,753800960,26.20870056\n2008-11-14T14:30:00Z,89.41,92.06,86.52,86.62,540352256,-20.02320772\n2008-11-17T14:30:00Z,86.38,88.56,85.16,85.47,415543808,-6.813377059\n2008-11-18T14:30:00Z,85.14999,87.22,82.91,87.08,524140544,8.277703581\n2008-11-19T14:30:00Z,85.91,86.87,80.92,81.5,558809344,-43.00513136\n2008-11-20T14:30:00Z,80.13,82.50999,75.05,75.45,814180352,-44.69101935\n2008-11-21T14:30:00Z,77.46001,80.89999,74.34,79.52,718768640,17.31764324\n2008-11-24T14:30:00Z,81.92,86.985,80.3614,85.03,523461888,46.78401113\n2008-11-25T14:30:00Z,87.3,87.50999,83.82001,85.66,454188288,2.038333307\n2008-11-26T14:30:00Z,84.3,89.19,84.24001,88.97,370320384,21.54802294\n2008-11-28T14:30:00Z,88.63,90.13,88.48,90.09,119905312,7.764640639\n2008-12-01T14:30:00Z,87.50999,87.55,81.86,82.11,370826752,-72.43379595\n2008-12-02T14:30:00Z,83.47,85.49001,82.03799,85.27,469785344,11.9218583\n2008-12-03T14:30:00Z,83.39999,87.83,83.14,87.32001,520103680,13.88333074\n2008-12-04T14:30:00Z,86.06,88.05,83.74001,85.3,444341504,-6.006170493\n2008-12-05T14:30:00Z,83.64999,88.42,82.24001,87.92999,472064256,14.02039956\n2008-12-08T14:30:00Z,90.34,92.38,88.0815,91,413016832,22.83552708\n2008-12-09T14:30:00Z,90.37,92.13,88.98,89.5,370862592,-6.740950226\n2008-12-10T14:30:00Z,90.32001,91.36,89,90.11,396381184,1.296655432\n2008-12-11T14:30:00Z,89.53999,91,87.37,87.94,366329600,-14.0557324\n2008-12-12T14:30:00Z,85.55,89.07001,85.2,88.99001,415140864,9.50503007\n2008-12-15T14:30:00Z,89.02,89.14999,86.28999,87.75,256846128,-4.604399712\n2008-12-16T14:30:00Z,88.3,92.02,88.17999,91.88,377699840,34.19475078\n2008-12-17T14:30:00Z,90.84,92.42999,90.06,90.99001,288101888,0.278766742\n2008-12-18T14:30:00Z,91.39999,91.67,88.21001,89.28999,374829312,-13.50020524\n2008-12-19T14:30:00Z,89.10001,90.62,88.09,88.19,301523456,-5.661772639\n2008-12-22T14:30:00Z,88.58,88.67,85.49001,87.06,244192192,-10.48651533\n2008-12-23T14:30:00Z,87.53,87.92999,85.8,86.16,221772560,-6.165114204\n2008-12-24T14:30:00Z,86.45,86.87,86,86.66,62142416,0.960695876\n2008-12-26T14:30:00Z,87.24001,87.3,86.5,87.16,74775808,2.404668622\n2008-12-29T14:30:00Z,87.24001,87.33,85.60001,86.91,128419184,-2.423608065\n2008-12-30T14:30:00Z,87.50999,89.05,86.8766,88.97,168555680,16.05248717\n2008-12-31T14:30:00Z,89.08,90.97,88.87,90.24001,194141808,11.23232887\n2009-01-02T14:30:00Z,90.44,93.44,89.85001,92.96001,227638496,22.0103217\n2009-01-05T14:30:00Z,92.63,94.5533,91.89,92.85001,240697632,1.904973521\n2009-01-06T14:30:00Z,93.64,94.45,92.67999,93.47,328481792,3.232793269\n2009-01-07T14:30:00Z,92,92.25999,90.2,90.67,281047552,-26.47633006\n2009-01-08T14:30:00Z,90.16,91.09,89.67,91.04201,263834368,1.71367689\n2009-01-09T14:30:00Z,91.16,91.32001,85.36,89.09,331160832,-15.89605563\n2009-01-12T14:30:00Z,88.84,88.91,86.41,86.95,278008320,-19.41814159\n2009-01-13T14:30:00Z,86.73,87.88,86.2,87.11,356731648,-0.330792683\n2009-01-14T14:30:00Z,85.53999,85.75,83.16,84.37,435967232,-23.6970287\n2009-01-15T14:30:00Z,84.12,85.25,81.72,84.39999,533808896,-0.53083443\n2009-01-16T14:30:00Z,85.86,85.98759,83.05,85.06,399307008,1.088746186\n2009-01-20T14:30:00Z,84.23,85.05901,80.05,80.57001,420108544,-39.18933379\n2009-01-21T14:30:00Z,81.94,84.24001,80.47,84.05,364767232,17.72325401\n2009-01-22T14:30:00Z,82.42,84.03999,81.17,82.75,427940352,-3.213818095\n2009-01-23T14:30:00Z,80.89999,83.99001,80.57001,83.11,386800640,6.019888339\n2009-01-26T14:30:00Z,83.59,85.36,82.81,83.67999,318269440,5.291790408\n2009-01-27T14:30:00Z,84.13,85.14999,83.3,84.53,274112000,5.262338283\n2009-01-28T14:30:00Z,86.39999,87.95,86.07001,87.39,330317312,26.85486042\n2009-01-29T14:30:00Z,86.11,87.4901,84.47,84.55,294591488,-18.8358527\n2009-01-30T14:30:00Z,84.98,85.39999,82.21001,82.83,383464192,-13.01136485\n2009-02-02T14:30:00Z,81.57001,83.17999,81.31,82.58,288488960,-1.114769947\n2009-02-03T14:30:00Z,83.10001,84.36,82.22,83.74001,278480640,8.056077775\n2009-02-04T14:30:00Z,84.3,85.37,83.03999,83.33,322993920,-3.007164002\n2009-02-05T14:30:00Z,82.7,85.28999,77.73,84.57001,417679872,8.668774327\n2009-02-06T14:30:00Z,84.86,87.34,84.67999,86.979,366101504,21.41133405\n2009-02-09T14:30:00Z,86.96001,87.74001,86.32001,87.10001,240075120,1.758256083\n2009-02-10T14:30:00Z,86.27,87.03,82.45,83.11,536212736,-34.5938497\n2009-02-11T14:30:00Z,83.45,84.05,82.39999,83.60001,324674560,-0.541713712\n2009-02-12T14:30:00Z,82.17,83.82001,81.05,83.66,469302272,4.782624075\n2009-02-13T14:30:00Z,83.55,84.24001,82.74001,82.75999,293998336,-2.832792306\n2009-02-17T14:30:00Z,80.16,82.95799,79.17,79.22,478910720,-23.68724819\n2009-02-18T14:30:00Z,79.78999,79.94,78.28,79.03,362970112,-2.4956969\n2009-02-19T14:30:00Z,79.84,80.14999,78.02,78.181,316869632,-5.637688013\n2009-02-20T14:30:00Z,76.73,78.34,75.77,77.42,477176576,-4.19410807\n2009-02-23T14:30:00Z,78.27,78.27,74.59,74.64999,379644672,-20.23567075\n2009-02-24T14:30:00Z,75.28999,77.95,74.7003,77.48,426412288,14.90193064\n2009-02-25T14:30:00Z,77.14,78.42,75.63,76.87199,462039552,-0.673872388\n2009-02-26T14:30:00Z,77.82001,79.6667,75.53,75.62,363371264,-10.05125319\n2009-02-27T14:30:00Z,74.00999,75.68719,73.81,73.92999,470568960,-10.62653309\n2009-03-02T14:30:00Z,72.52,73.9169,70.37,70.60001,426453248,-26.83591727\n2009-03-03T14:30:00Z,71.61,71.7,69.64,70.07001,443761152,-4.817854029\n2009-03-04T14:30:00Z,71.23,72.87,70.07291,71.73,462763264,8.382899035\n2009-03-05T14:30:00Z,70.10001,71.73,68.17,68.8,485551104,-20.86129206\n2009-03-06T14:30:00Z,69.39999,70.45,67.10001,68.92,490495232,-1.286552456\n2009-03-09T13:30:00Z,67.95,70,67.73,68.11,379907328,-2.64513097\n2009-03-10T13:30:00Z,69.50999,72.37,69.37,72.17,406230784,39.39342864\n2009-03-11T13:30:00Z,73,73.75,71.83,72.64,356809984,3.648216854\n2009-03-12T13:30:00Z,72.62,75.75,71.97,75.5,409818624,21.14518734\n2009-03-13T13:30:00Z,76.00999,76.98,74.73,76.09,337474560,4.204561027\n2009-03-16T13:30:00Z,76.96001,77.97,75.81,75.86,360821248,-4.096339052\n2009-03-17T13:30:00Z,76.07001,78.36,75.45,78.17999,357075200,15.20788396\n2009-03-18T13:30:00Z,77.81,80.89999,77.07001,79.92999,473552384,13.02068973\n2009-03-19T13:30:00Z,80.92999,81,78.69,78.94,428597248,-3.970447928\n2009-03-20T13:30:00Z,78.75999,78.91,76.53,76.71001,371165696,-19.54079212\n2009-03-23T13:30:00Z,78.74001,82.28999,78.31,82.22,420247296,44.3967897\n2009-03-24T13:30:00Z,81.24001,82.36,80.50999,80.60001,330843904,-4.204257421\n2009-03-25T13:30:00Z,81.23,82.7,79.06,81.45,441995008,2.763110198\n2009-03-26T13:30:00Z,82.25,83.3,81.32001,83.11,422025216,12.18755989\n2009-03-27T13:30:00Z,82.05,82.53,81.31,81.61,322343680,-9.815217391\n2009-03-30T13:30:00Z,79.8,79.87,77.96001,78.78999,324108544,-27.11464919\n2009-03-31T13:30:00Z,79.56,81.08,79.05,79.52,364238336,2.714231847\n2009-04-01T13:30:00Z,78.53,81.42,78.33,81.06,377018368,10.70665323\n2009-04-02T13:30:00Z,83.08,84.61,81.12959,83.42999,476230912,16.99745966\n2009-04-03T13:30:00Z,83.49001,84.28,82.67,84.25999,284646144,4.076321909\n2009-04-06T13:30:00Z,83.34,84.2747,82.28999,83.60001,264866560,-1.90851229\n2009-04-07T13:30:00Z,82.25,82.64999,81.50999,81.64999,259071936,-16.98923641\n2009-04-08T13:30:00Z,82.06,82.94,81.53999,82.53,230402752,5.019593895\n2009-04-09T13:30:00Z,84.67,85.82001,84.33,85.81,269653504,32.53505139\n2009-04-13T13:30:00Z,84.92,86.53999,84.58,85.83,224847440,2.602461481\n2009-04-14T13:30:00Z,85.03,85.75999,84.08,84.35001,276598784,-8.9667179\n2009-04-15T13:30:00Z,83.84,85.42,83.61,85.25,250726064,4.846684229\n2009-04-16T13:30:00Z,85.92999,87.14999,84.77,86.5,335202816,8.202776188\n2009-04-17T13:30:00Z,86.83,87.64999,86.14,87.08,262648944,3.686171798\n2009-04-20T13:30:00Z,85.53999,87.0489,83.34,83.42999,293690112,-28.65595565\n2009-04-21T13:30:00Z,82.82001,85.13,82.75,85.06,300478464,8.121841627\n2009-04-22T13:30:00Z,84.28999,86.34,84.07001,84.53999,340395008,0.46639782\n2009-04-23T13:30:00Z,84.71001,85.42,83.63,85.37,324903680,3.753263579\n2009-04-24T13:30:00Z,86.03,87.31,85.69,86.66,287703040,11.03406029\n2009-04-27T13:30:00Z,85.67999,87.00999,85.53999,85.84,289581568,-2.505377208\n2009-04-28T13:30:00Z,84.97,86.59,84.75999,85.57001,247927872,0.252737616\n2009-04-29T13:30:00Z,86.52,88.36,86.3,87.39,311505664,16.28619306\n2009-04-30T13:30:00Z,88.55,89.02,86.92,87.42,301419776,-1.39569849\n2009-05-01T13:30:00Z,87.44,88.21001,86.72,87.89,236110320,1.149073648\n2009-05-04T13:30:00Z,88.55,90.94,88.38,90.88,287119872,27.88319409\n2009-05-05T13:30:00Z,90.57001,90.92999,89.84,90.57001,243036256,1.059088545\n2009-05-06T13:30:00Z,91.67999,92.2,90.61,92.14101,291941120,11.39927176\n2009-05-07T13:30:00Z,93.00999,93.14999,90.28,90.86,317800448,-8.73056097\n2009-05-08T13:30:00Z,92.03,93.22,90.911,92.98,299081728,10.56691793\n2009-05-11T13:30:00Z,91.7,92.11,91.03999,91.24001,247923568,-12.05530465\n2009-05-12T13:30:00Z,91.63,91.83,89.85001,90.97,282431232,-2.964995092\n2009-05-13T13:30:00Z,89.74001,90.00999,88.5,88.67999,269618944,-21.38345855\n2009-05-14T13:30:00Z,88.72,90.12,88.5,89.44,260098624,4.08226951\n2009-05-15T13:30:00Z,89.37,90,88.14999,88.71001,271502592,-3.495024193\n2009-05-18T13:30:00Z,89.55,91.34,88.57021,91.23,242217248,17.89481846\n2009-05-19T13:30:00Z,91.17999,91.97,90.81,91.12,206102192,0.819634889\n2009-05-20T13:30:00Z,91.95,92.8,90.41,90.50999,285898240,-5.87220205\n2009-05-21T13:30:00Z,89.46001,89.8,88.25999,89.21001,258988368,-11.13136715\n2009-05-22T13:30:00Z,89.46001,90,88.67999,89.02,166811872,-1.687520004\n2009-05-26T13:30:00Z,88.36,91.56,88.32001,91.3,236318432,17.2492805\n2009-05-27T13:30:00Z,91.44,91.75,89.53,89.67,246313504,-6.663705584\n2009-05-28T13:30:00Z,90.46001,91.34,89.10001,90.92,289094912,4.036866517\n2009-05-29T13:30:00Z,91.42,93.7,90.67999,92.53,258641376,12.63631955\n2009-06-01T13:30:00Z,93.67,95.17,93.42999,94.77,276246784,20.51211649\n2009-06-02T13:30:00Z,94.39999,95.37,87.53,94.85001,230874432,3.234245841\n2009-06-03T13:30:00Z,94.03999,94.13,92.75999,93.64999,235403936,-9.092445402\n2009-06-04T13:30:00Z,94,94.67,93.3,94.53,210102256,4.550556538\n2009-06-05T13:30:00Z,95.49001,95.67,93.8,94.55,284257792,-1.129699438\n2009-06-08T13:30:00Z,93.84,95.10001,93.03999,94.16,238565120,-1.9121774\n2009-06-09T13:30:00Z,94.69,95.145,94.02,94.64,225125440,2.733272822\n2009-06-10T13:30:00Z,95.48,95.49001,93.19,94.39999,296100352,-3.105788597\n2009-06-11T13:30:00Z,94.58,96.11,94.56,94.82001,275414016,1.518879449\n2009-06-12T13:30:00Z,94.39999,95.14,94,95.08,184373008,2.818767825\n2009-06-15T13:30:00Z,93.96001,94.02,92.39999,92.89999,224190432,-18.33845804\n2009-06-16T13:30:00Z,93.23,93.28999,91.58,91.64,227319008,-9.691069471\n2009-06-17T13:30:00Z,91.60001,92.33,90.83,91.55,223445312,-1.367355237\n2009-06-18T13:30:00Z,91.69,92.67,91.25,92.21899,211725056,4.500430191\n2009-06-19T13:30:00Z,92.58,92.7,91.52,92.03999,215655568,-1.054537754\n2009-06-22T13:30:00Z,91.14,91.19,89.25,89.28,251913568,-26.67925374\n2009-06-23T13:30:00Z,89.47,89.88,88.85001,89.35001,188309680,-1.141274356\n2009-06-24T13:30:00Z,90.16,91.08,89.60001,90.118,211577632,4.741587684\n2009-06-25T13:30:00Z,89.67,92.17,89.57001,92.08,279410944,15.50747657\n2009-06-26T13:30:00Z,91.77,92.24001,91.27,91.84,167579008,1.279701719\n2009-06-29T13:30:00Z,92.11,92.82001,91.60001,92.7,168481248,5.803342045\n2009-06-30T13:30:00Z,92.72,93.06,91.27,91.95,228888192,-4.555241935\n2009-07-01T13:30:00Z,92.34,93.23,92.21001,92.33,173041056,1.087527328\n2009-07-02T13:30:00Z,91.13,92.3624,89.75999,89.81,212309808,-19.62413487\n2009-07-06T13:30:00Z,88.94,89.92999,88.66,89.8,174499568,0.404299402\n2009-07-07T13:30:00Z,89.71001,89.82001,88,88.06,197088880,-12.99136429\n2009-07-08T13:30:00Z,88.59,88.8,87,88,248050496,-2.298168731\n2009-07-09T13:30:00Z,88.61,88.89999,87.91,88.17,163777568,-0.976646086\n2009-07-10T13:30:00Z,87.7,88.49001,87.35001,87.96001,173520256,-0.778929001\n2009-07-13T13:30:00Z,88.31,90.17,87.59,90.10201,217413376,16.20418021\n2009-07-14T13:30:00Z,90.38,90.69,89.73,90.61,181555376,2.795329199\n2009-07-15T13:30:00Z,91.81,93.50999,90.6795,93.25999,220877808,21.28604532\n2009-07-16T13:30:00Z,93,94.50999,92.82001,94.14999,231174496,6.956122616\n2009-07-17T13:30:00Z,94.06,94.32001,93.53999,94.13,138561680,1.080366218\n2009-07-20T13:30:00Z,94.67999,95.28999,94.19,95.131,164179376,7.859727318\n2009-07-21T13:30:00Z,95.87,95.89999,94.42,95.57001,217718256,1.212355378\n2009-07-22T13:30:00Z,94.96001,96.13,94.89,95.55,196067568,0.646358167\n2009-07-23T13:30:00Z,95.61,98.08,95.53,97.661,258795504,19.25051292\n2009-07-24T13:30:00Z,97.2,98.14,96.69,98.06,154003008,4.148641097\n2009-07-27T13:30:00Z,97.88,98.39999,97.34,98.35001,159259376,2.611838132\n2009-07-28T13:30:00Z,97.66,98.37,97.06,97.89,186685680,-1.284966883\n2009-07-29T13:30:00Z,97.44,98.088,96.98,97.65199,194399312,-0.363624249\n2009-07-30T13:30:00Z,98.83,99.83,98.60001,98.67,225575376,7.677957158\n2009-07-31T13:30:00Z,98.64999,99.47,98.38,98.81,207357936,0.796482301\n2009-08-03T13:30:00Z,99.85001,100.53,99.31,100.44,175776880,13.98919745\n2009-08-04T13:30:00Z,99.99001,100.84,99.78,100.7,176714496,2.604793436\n2009-08-05T13:30:00Z,100.77,100.855,99.58,100.41,184726368,-1.409653029\n2009-08-06T13:30:00Z,100.87,101.02,99.42,99.89,193203744,-4.027366864\n2009-08-07T13:30:00Z,100.94,102.03,100.39,101.202,220684368,7.505035129\n2009-08-10T13:30:00Z,100.74001,101.22,100.27,100.99001,130898624,-0.123268587\n2009-08-11T13:30:00Z,100.53999,100.61,99.46001,99.73,157301008,-10.92620941\n2009-08-12T13:30:00Z,99.56,101.56,99.50999,100.8,219052368,7.553053583\n2009-08-13T13:30:00Z,101.25999,101.61,100.25999,101.57001,176449504,3.766416317\n2009-08-14T13:30:00Z,101.52,101.60001,99.7,100.78999,199691248,-6.309285502\n2009-08-17T13:30:00Z,98.85001,98.95,98.11501,98.31,237892624,-25.30458959\n2009-08-18T13:30:00Z,98.53,99.44,98.35001,99.09,173461440,5.247235311\n2009-08-19T13:30:00Z,98.31,100.3,98.21001,99.96001,192812752,6.223032811\n2009-08-20T13:30:00Z,100.09,101.22,99.87,100.99001,174131248,8.45580547\n2009-08-21T13:30:00Z,101.82001,103.13,101.62,102.97,224604944,18.13766069\n2009-08-24T13:30:00Z,103.39,103.95,102.59,102.96001,191278880,0.23240646\n2009-08-25T13:30:00Z,103.37,104.25999,102.94,103.16,215310560,-0.071189327\n2009-08-26T13:30:00Z,102.84,103.64,102.49001,103.17,194620624,0.42658242\n2009-08-27T13:30:00Z,103.11,103.72,101.94,103.39999,196230000,1.888277013\n2009-08-28T13:30:00Z,104.23,104.35001,102.67,103.38,147024368,-1.262032134\n2009-08-31T13:30:00Z,102.37,102.58,101.78999,102.46001,176051568,-7.705435366\n2009-09-01T13:30:00Z,101.95,103.24001,99.99001,100.2,321276672,-14.68274953\n2009-09-02T13:30:00Z,99.78,100.44,99.57001,99.82001,171805008,-2.401584215\n2009-09-03T13:30:00Z,100.39999,100.77,99.59,100.64999,143572256,4.814715332\n2009-09-04T13:30:00Z,100.85001,102.09,100.55,102.06,142687808,11.66781582\n2009-09-08T13:30:00Z,103,103.05,102.39,102.94,132909008,6.324695426\n2009-09-09T13:30:00Z,103.12,104.08,102.8,103.73,154612496,5.942084942\n2009-09-10T13:30:00Z,103.8,104.86,103.22,104.78999,162902368,6.727538529\n2009-09-11T13:30:00Z,104.99001,105.3,104.28,104.77,152383632,0.29550083\n2009-09-14T13:30:00Z,103.88,105.46001,103.14999,105.28,149593744,4.944740219\n2009-09-15T13:30:00Z,105.45,106.11,104.75999,105.72,196795872,2.822593691\n2009-09-16T13:30:00Z,106.10001,107.34,105.72881,107.32001,206406256,13.70082423\n2009-09-17T13:30:00Z,107.17,108.06,106.57001,107.16,229170880,0.365574808\n2009-09-18T13:30:00Z,107.14999,107.16,106.36,106.72,153799056,-4.096542056\n2009-09-21T13:30:00Z,105.89,107,105.66,106.45,151892000,-0.446232852\n2009-09-22T13:30:00Z,107.08,107.37,106.60001,107.07001,143126624,4.407470342\n2009-09-23T13:30:00Z,107.32001,108.03,105.99001,106.17999,225947312,-4.833351795\n2009-09-24T13:30:00Z,106.41,106.64,104.55,105.00999,228636688,-9.243782513\n2009-09-25T13:30:00Z,104.78,105.36,104.09,104.45,204058944,-3.815512438\n2009-09-28T13:30:00Z,104.85001,106.55,104.83,106.32001,118285744,16.61628294\n2009-09-29T13:30:00Z,106.50999,107.02,105.78,106,133733808,-0.564741155\n2009-09-30T13:30:00Z,106.36,106.46001,104.62,105.59,254382944,-4.043969813\n2009-10-01T13:30:00Z,105.34,105.73309,102.95,103,281840640,-21.91708199\n2009-10-02T13:30:00Z,102.02,103.10001,101.99001,102.49001,224748752,-3.202714787\n2009-10-05T13:30:00Z,102.89999,104.32001,102.60001,104.02,149874944,13.3411991\n2009-10-06T13:30:00Z,104.77,106.11,104.71001,105.50999,202491008,13.8042574\n2009-10-07T13:30:00Z,105.27,105.91,105.07001,105.8,159200256,1.985319942\n2009-10-08T13:30:00Z,106.55,107.17,105.84489,106.61,183305744,5.626163386\n2009-10-09T13:30:00Z,106.64,107.25999,106.36,107.25999,135008256,4.328807556\n2009-10-12T13:30:00Z,107.75999,108.09,107.28,107.67999,118031008,2.846488054\n2009-10-13T13:30:00Z,107.39,107.7132,106.75999,107.46001,157692688,-1.211050287\n2009-10-14T13:30:00Z,108.72,109.42,107.4174,109.31,191421504,13.11339299\n2009-10-15T13:30:00Z,108.78,109.71001,108.73,109.71001,173873568,3.25528543\n2009-10-16T13:30:00Z,108.8,109.27,108.23,108.89,192069376,-3.36228011\n2009-10-19T13:30:00Z,109.07001,110.13,108.73,109.78999,159530368,6.987149385\n2009-10-20T13:30:00Z,109.95,109.985,108.67999,109.211,180921008,-3.5901792\n2009-10-21T13:30:00Z,109.03999,110.31,108.14999,108.23,225787440,-4.601347139\n2009-10-22T13:30:00Z,108.19,109.67999,107.5,109.33,238443936,5.582043846\n2009-10-23T13:30:00Z,109.69,109.75999,107.63,108.08,240033184,-7.787299326\n2009-10-26T13:30:00Z,108.2,109.31,106.61,106.91,242028192,-6.566730459\n2009-10-27T13:30:00Z,107.03,107.39,106.16,106.42,253266320,-3.374094203\n2009-10-28T13:30:00Z,106.14999,106.4783,104.35001,104.41,248821376,-17.20137081\n2009-10-29T13:30:00Z,105.19,106.86,104.94,106.64999,198110560,14.8156615\n2009-10-30T13:30:00Z,106.3,106.62,103.44,103.56,325607936,-23.07744499\n2009-11-02T14:30:00Z,104.13,105.41,103.08,104.32001,254489744,0.652006115\n2009-11-03T14:30:00Z,103.74001,104.8,103.53999,104.64999,228362496,3.103914874\n2009-11-04T14:30:00Z,105.50999,106.33,104.64999,104.92,247996688,1.114737658\n2009-11-05T14:30:00Z,105.66,106.88,105.44,106.8501,180015184,15.76524089\n2009-11-06T14:30:00Z,106.25999,107.39999,106.05,107.13,170954064,3.072981289\n2009-11-09T14:30:00Z,107.95,109.63,107.87,109.57001,159495632,23.07983099\n2009-11-10T14:30:00Z,109.31,109.92999,108.97,109.59,171899744,1.552211596\n2009-11-11T14:30:00Z,110.31,110.82001,109.62,110.14999,169466192,3.290281057\n2009-11-12T14:30:00Z,110,110.57001,108.75,109.03,157144496,-7.738432706\n2009-11-13T14:30:00Z,109.31,110.09,108.75,109.62,150962944,2.103672986\n2009-11-16T14:30:00Z,110.38,111.69,110.32001,111.21001,210922128,14.98893617\n2009-11-17T14:30:00Z,110.92,111.39,110.5,111.339,147134064,2.207626719\n2009-11-18T14:30:00Z,111.25999,111.42999,110.57001,111.27,156486752,0.203037297\n2009-11-19T14:30:00Z,110.50999,111.30589,109.13,109.82001,208734496,-11.00554035\n2009-11-20T14:30:00Z,109.25,109.75999,109.00999,109.42999,134196000,-2.511474024\n2009-11-23T14:30:00Z,110.72,111.74001,110.60001,110.82001,148010128,12.11305487\n2009-11-24T14:30:00Z,111,111.20219,110.00999,110.99001,138420064,0.79028487\n2009-11-25T14:30:00Z,111.17,111.5,110.82001,111.38,109564752,2.300099361\n2009-11-27T14:30:00Z,108.39999,110.32001,108.28999,109.57001,126001808,-8.667354362\n2009-11-30T14:30:00Z,109.48,110.2,108.12,109.94,160874816,3.409177944\n2009-12-01T14:30:00Z,110.92,111.66,110.73,111.3,159613632,12.4296875\n2009-12-02T14:30:00Z,111.28,112.00999,110.92,111.25,132315056,0.112341138\n2009-12-03T14:30:00Z,111.55,112.17999,110.28999,110.38,167324816,-4.624554101\n2009-12-04T14:30:00Z,111.84,112.38,110.03999,111.00999,274907904,-0.368066028\n2009-12-07T14:30:00Z,110.91,111.53,110.49001,110.84,127973808,-1.074656886\n2009-12-08T14:30:00Z,110.03999,110.77251,109.27,109.61,169863632,-9.236161549\n2009-12-09T14:30:00Z,109.58,110.17999,109.02,110.021,155063376,1.524479901\n2009-12-10T14:30:00Z,110.7,111.12,110.45,110.64,138014624,4.828322129\n2009-12-11T14:30:00Z,111.11,111.36,110.61,111.11,124854000,2.676470588\n2009-12-14T14:30:00Z,111.87,112,105.476,111.87,107141504,4.102007971\n2009-12-15T14:30:00Z,111.46001,111.92,111,111.35001,120408752,-3.398378397\n2009-12-16T14:30:00Z,111.8,112.13,111.27,111.52,155358128,0.013677289\n2009-12-17T14:30:00Z,110.72,110.92999,110.08,110.17999,183390064,-12.44460677\n2009-12-18T14:30:00Z,110.2,110.3,109.28,110.21001,174591120,-0.486896945\n2009-12-21T14:30:00Z,110.75999,111.7,110.75999,111.33,118104256,10.76567194\n2009-12-22T14:30:00Z,111.57001,111.97,111.425,111.73,91707440,3.387729974\n2009-12-23T14:30:00Z,112,112.11,111.5,111.95,111783056,0.858648014\n2009-12-24T14:30:00Z,112.19,112.60001,111.9948,112.48,39677472,4.204664286\n2009-12-28T14:30:00Z,112.89999,112.99001,112.32001,112.72,87508432,0.955216962\n2009-12-29T14:30:00Z,113.00999,113.03,112.55,112.562,80572496,-1.575813159\n2009-12-30T14:30:00Z,112.23,112.64999,112.17,112.52,73138368,-0.037237062\n2009-12-31T14:30:00Z,112.77,112.8,111.39,111.44,90637872,-7.967643339\n2010-01-04T14:30:00Z,112.37,113.39,111.50999,113.33,118944560,11.04871013\n2010-01-05T14:30:00Z,113.25999,113.67999,112.85001,113.63,111579872,2.032719945\n2010-01-06T14:30:00Z,113.52,113.99001,113.42999,113.71001,116074368,0.922467953\n2010-01-07T14:30:00Z,113.5,114.33,113.17999,114.19,131091056,2.823230577\n2010-01-08T14:30:00Z,113.89,114.62,113.66,114.57001,126402752,2.610557119\n2010-01-11T14:30:00Z,115.08,115.13,114.235,114.73,106375680,0.509354732\n2010-01-12T14:30:00Z,113.97,114.21001,113.22,113.66,163333440,-9.26106351\n2010-01-13T14:30:00Z,113.95,114.94,113.37,114.62,161821936,5.91198786\n2010-01-14T14:30:00Z,114.49001,115.14,114.42,114.92999,115783744,2.554152113\n2010-01-15T14:30:00Z,114.73,114.84,113.2,113.64,212283120,-10.39081033\n2010-01-19T14:30:00Z,113.62,115.13,113.59,115.06,139172624,9.595086207\n2010-01-20T14:30:00Z,114.28,114.45,112.98,113.89,216490128,-6.119437939\n2010-01-21T14:30:00Z,113.92,114.27,111.56,111.7,344859392,-17.62282947\n2010-01-22T14:30:00Z,111.2,111.74159,109.09,109.21001,345942272,-20.55213024\n2010-01-25T14:30:00Z,110.21001,110.41,109.41,109.77,186937440,-0.739492614\n2010-01-26T14:30:00Z,109.34,110.47,109.03999,109.31,211168752,-1.733174548\n2010-01-27T14:30:00Z,109.17,110.08,108.33,109.83,271863552,2.93616643\n2010-01-28T14:30:00Z,110.19,110.25,107.91,108.57001,316103936,-9.125676647\n2010-01-29T14:30:00Z,109.03999,109.8,107.22,107.39,310677504,-6.812249162\n2010-02-01T14:30:00Z,108.14999,109.07001,107.50079,109.06,187864880,8.826923295\n2010-02-02T14:30:00Z,109.25999,110.59,108.88,110.38,216327872,10.40155585\n2010-02-03T14:30:00Z,109.88,110.48151,109.50999,109.83,172730624,-1.281692773\n2010-02-04T14:30:00Z,108.98,109.03,106.42,106.44,356715520,-32.94711538\n2010-02-05T14:30:00Z,106.56,106.88,104.58,106.66,493585664,-1.445698467\n2010-02-08T14:30:00Z,106.74001,107.33,105.80991,105.89,224166816,-4.023267053\n2010-02-09T14:30:00Z,107.13,108.14999,106.27,107.22,337820416,7.193979622\n2010-02-10T14:30:00Z,107.05,107.60001,106.11,107.00999,240511504,-0.951818707\n2010-02-11T14:30:00Z,106.87,108.25,106.25,108.13,223591568,6.709029902\n2010-02-12T14:30:00Z,106.99001,108.1012,106.50999,108.03999,304622080,3.953740933\n2010-02-16T14:30:00Z,108.86,109.85001,107.821,109.74001,159317440,11.86068013\n2010-02-17T14:30:00Z,110.27,110.41,109.74001,110.25999,168845056,3.458087956\n2010-02-18T14:30:00Z,110.08,111.14,110.035,110.91,193708496,5.276608998\n2010-02-19T14:30:00Z,110.62,111.57001,110.36,111.14,222684816,2.029778339\n2010-02-22T14:30:00Z,111.55,111.58,110.83,111.16,132346816,-0.140625\n2010-02-23T14:30:00Z,110.86,111.2,109.52,109.81,207496944,-11.37447257\n2010-02-24T14:30:00Z,110.14,111,109.86,110.82001,176350624,5.666124562\n2010-02-25T14:30:00Z,109.24001,110.75,108.94,110.67,259634688,4.285914103\n2010-02-26T14:30:00Z,110.77,111.12,110.11,110.74001,173589248,1.055792607\n2010-03-01T14:30:00Z,111.2,112,111.17,111.89,147709632,11.12968546\n2010-03-02T14:30:00Z,112.37,112.74001,112,112.2,160992368,2.182658157\n2010-03-03T14:30:00Z,112.49001,112.97,112.02,112.3,150784944,-0.181856738\n2010-03-04T14:30:00Z,112.45,112.8,112.03,112.64101,135770368,1.487046293\n2010-03-05T14:30:00Z,113.37,114.34,113.10001,114.25,176118752,14.67441979\n2010-03-08T14:30:00Z,114.25999,114.52,114.07001,114.27,114631120,0.617092699\n2010-03-09T14:30:00Z,113.92999,114.99001,113.87,114.46001,154556688,1.834170974\n2010-03-10T14:30:00Z,114.50999,115.27499,114.41,114.97,186088816,4.45534846\n2010-03-11T14:30:00Z,114.7,115.48,114.35001,115.45,160875872,3.019053579\n2010-03-12T14:30:00Z,115.95,115.97,115.14,115.46001,162074752,-0.15167199\n2010-03-15T13:30:00Z,115.25999,115.575,114.60001,115.49001,146816816,0.110256096\n2010-03-16T13:30:00Z,115.81,116.52,115.49001,116.41,168673008,7.562144395\n2010-03-17T13:30:00Z,116.75999,117.48,116.4198,117.10001,177468064,5.558808946\n2010-03-18T13:30:00Z,117.11,117.27,116.57001,117.03751,196509056,-0.057979669\n2010-03-19T13:30:00Z,116.96001,117.293,115.52,115.97,226641120,-8.369867264\n2010-03-22T13:30:00Z,115.31,116.8,115.24001,116.5925,184477680,2.916628371\n2010-03-23T13:30:00Z,116.75999,117.50999,116.38,117.41,182941568,5.783784566\n2010-03-24T13:30:00Z,116.97,117.42641,115.58,116.84,196183312,-2.690107288\n2010-03-25T13:30:00Z,117.63,118.1666,116.50999,116.64999,223396256,-3.497486838\n2010-03-26T13:30:00Z,116.87,117.42,116.12,116.582,205808496,-1.423496058\n2010-03-29T13:30:00Z,117.16991,117.53,116.6886,117.32001,134513504,4.542030102\n2010-03-30T13:30:00Z,117.46001,117.83,116.91,117.39999,145772368,0.29125594\n2010-03-31T13:30:00Z,116.95,117.52,116.61,117,161078688,-2.081692464\n2010-04-01T13:30:00Z,117.8,118.25,117.10001,117.8,161215184,5.235202001\n2010-04-05T13:30:00Z,118.25,118.84,117.92,118.75999,105847632,8.05857398\n2010-04-06T13:30:00Z,118.42,119.25,118.28999,119.03999,110384128,2.020552157\n2010-04-07T13:30:00Z,118.8,119.3567,117.81,118.36,184576320,-3.365511956\n2010-04-08T13:30:00Z,117.95,118.97,117.60001,118.77251,158704000,2.290785167\n2010-04-09T13:30:00Z,119.02,119.60001,118.8,119.55,133006496,6.332370524\n2010-04-12T13:30:00Z,119.7,120.05,119.56,119.74001,110278944,1.705751992\n2010-04-13T13:30:00Z,119.62,120.03999,119,119.83,125125056,0.902961806\n2010-04-14T13:30:00Z,120.27,121.19,120.08,121.19,161609008,12.36213592\n2010-04-15T13:30:00Z,120.99001,121.5654,120.95,121.28999,144615248,1.332094955\n2010-04-16T13:30:00Z,120.86,121.285,118.75,119.36,366879744,-15.82939373\n2010-04-19T13:30:00Z,119.00999,119.92999,118.47,119.81,217947744,1.4399072\n2010-04-20T13:30:00Z,120.56,120.98,119.871,120.88,157707936,7.80655003\n2010-04-21T13:30:00Z,120.95,121.23,119.99001,120.66,192910064,-1.200989922\n2010-04-22T13:30:00Z,119.81,121.17,119.12,121.02,239188560,4.047261484\n2010-04-23T13:30:00Z,120.94,121.86,120.63,121.8125,177335440,5.245717781\n2010-04-26T13:30:00Z,121.85001,122.12,121.23,121.35001,143457184,-1.624182812\n2010-04-27T13:30:00Z,120.64999,121.33459,118.25,118.48,355853824,-24.57040123\n2010-04-28T13:30:00Z,119.05,119.67999,118.27,119.38,300677632,2.00704798\n2010-04-29T13:30:00Z,120.10001,121.11,120.07001,120.8575,193774880,14.28466899\n2010-04-30T13:30:00Z,120.88,121.00999,118.78,118.8125,270000896,-15.50687877\n2010-05-03T13:30:00Z,119.38,120.67999,119.2,120.35001,182747808,8.022198229\n2010-05-04T13:30:00Z,119.00999,119.03,116.92,117.52,360353280,-23.71470631\n2010-05-05T13:30:00Z,116.56,117.8,115.97,116.82001,328973312,-4.145430003\n2010-05-06T13:30:00Z,116.25999,117,105,112.942,647356416,-33.50554852\n2010-05-07T13:30:00Z,112.64,113.77,109.41,111.25999,637558784,-13.61854176\n2010-05-10T13:30:00Z,115.81,116.64999,114.91,116.16,396159488,40.75248837\n2010-05-11T13:30:00Z,115.07001,117.36,114.91,115.83,317849600,0.423322044\n2010-05-12T13:30:00Z,116.28999,117.62,116.09,117.45,235607008,14.45307519\n2010-05-13T13:30:00Z,117.13,117.67999,115.89,115.99001,234456064,-8.156197378\n2010-05-14T13:30:00Z,115.12,115.33,112.87,113.89,345602048,-19.02448331\n2010-05-17T13:30:00Z,114.2,114.52,111.77,113.95,325944064,-1.614268193\n2010-05-18T13:30:00Z,114.88,115.22,112.03,112.39999,360595968,-10.52426749\n2010-05-19T13:30:00Z,111.77,112.77,110.36,111.75999,394759424,-5.323020876\n2010-05-20T13:30:00Z,109.38,109.89,107.47,107.53999,530423552,-41.06724158\n2010-05-21T13:30:00Z,105.91,109.38,105.36121,109.11501,500909312,8.262388345\n2010-05-24T13:30:00Z,108.52,109.39,107.61,107.71001,269822976,-3.675946924\n2010-05-25T13:30:00Z,105.11,107.87,104.38,107.81799,396505088,7.098976827\n2010-05-26T13:30:00Z,108.48,109.47,106.85001,107.17,349719296,-1.960399209\n2010-05-27T13:30:00Z,109.19,110.8,108.78011,110.75999,300870400,29.12891928\n2010-05-28T13:30:00Z,110.64,110.724,108.85001,109.369,297933312,-8.538293123\n2010-06-01T13:30:00Z,108.35001,109.95,107.37,107.53,277909248,-11.06665354\n2010-06-02T13:30:00Z,108.08,110.34,107.50909,110.33,240243632,21.51987453\n2010-06-03T13:30:00Z,110.64999,111.06,109.58,110.71001,226618256,2.231915545\n2010-06-04T13:30:00Z,108.61,109.33,106.465,106.82001,398475520,-35.44922712\n2010-06-07T13:30:00Z,107.2,107.61,105.41,105.49001,264609056,-8.762616277\n2010-06-08T13:30:00Z,105.57001,106.83,104.64999,106.62,357774336,3.94251257\n2010-06-09T13:30:00Z,107.24001,108.28,105.60001,106.05,268023248,-3.182176751\n2010-06-10T13:30:00Z,107.86,109.28,106.0426,109.14999,317890560,19.6882525\n2010-06-11T13:30:00Z,108.19,109.75,108.12,109.67999,214128128,5.266976334\n2010-06-14T13:30:00Z,110.52,111.12,109.39999,109.509,207196000,-1.307499017\n2010-06-15T13:30:00Z,110.28,112.10001,110.09,112,238268624,19.65036055\n2010-06-16T13:30:00Z,111.42,112.42,111.2,111.96001,216373936,2.000045455\n2010-06-17T13:30:00Z,112.28,112.33,111.05,112.14,263185744,0.98474042\n2010-06-18T13:30:00Z,111.83,112.13,111.37,111.729,174006560,-2.986757813\n2010-06-21T13:30:00Z,113.12,113.2,110.78999,111.41,213140624,-4.527485643\n2010-06-22T13:30:00Z,111.41,111.89999,109.41,109.57001,239355312,-13.65679488\n2010-06-23T13:30:00Z,109.64,110.03,108.48,109.23,254698752,-3.406310907\n2010-06-24T13:30:00Z,108.69,108.83,107.14,107.42,268691968,-16.70098808\n2010-06-25T13:30:00Z,107.74001,108.42,106.77,107.86749,238726496,0.615406607\n2010-06-28T13:30:00Z,108.03,108.32001,107.14,107.53,169333248,-2.084612306\n2010-06-29T13:30:00Z,106.02,107.5114,103.55,104.21001,373760512,-26.41938542\n2010-06-30T13:30:00Z,103.92,104.88,102.88,103.22,284101632,-6.075574236\n2010-07-01T13:30:00Z,103.14999,103.49001,101.13,102.75999,382924800,-4.276908424\n2010-07-02T13:30:00Z,103.11,103.42,101.62,102.2,233385120,-4.177297349\n2010-07-06T13:30:00Z,103.64,104.37,101.88,102.87,256936432,0.286971021\n2010-07-07T13:30:00Z,103.13,106.24001,103.02,106.1075,253769680,27.38125274\n2010-07-08T13:30:00Z,107,107.28,105.91,107.16,210842064,6.504983557\n2010-07-09T13:30:00Z,107.13,107.97,106.92999,107.96001,144999872,5.882828342\n2010-07-12T13:30:00Z,107.60001,108.24001,107.14999,108.03,131283568,1.921569398\n2010-07-13T13:30:00Z,109.14999,110.09,108.92999,109.66,213025872,14.93649627\n2010-07-14T13:30:00Z,109.31,110.08,108.86,109.651,184426752,1.072363502\n2010-07-15T13:30:00Z,109.61,110.06,108.17,109.67999,232337872,0.699332474\n2010-07-16T13:30:00Z,109.09,109.2059,106.45,106.66,282693376,-28.28167828\n2010-07-19T13:30:00Z,107.05,107.63,106.22,107.28999,186709008,0.428161245\n2010-07-20T13:30:00Z,105.87,108.56,105.82001,108.48,258162320,8.383541723\n2010-07-21T13:30:00Z,109.03999,109.07001,106.63,107.07001,264526944,-6.514910219\n2010-07-22T13:30:00Z,108.34,109.94,108.33,109.461,274781440,16.14207888\n2010-07-23T13:30:00Z,109.24001,110.57001,108.92999,110.41,222020816,6.548609855\n2010-07-26T13:30:00Z,110.60001,111.67,110.28999,111.56,182126496,9.052054139\n2010-07-27T13:30:00Z,112.17,112.28999,111.11,111.55,204855568,-0.257049028\n2010-07-28T13:30:00Z,111.32001,111.66,110.46001,110.83,163056192,-5.631011345\n2010-07-29T13:30:00Z,111.52,111.82001,109.41,110.28999,220149008,-4.476964206\n2010-07-30T13:30:00Z,109.17,110.86,108.98,110.27,220070496,0.832806477\n2010-08-02T13:30:00Z,111.99001,112.94,111.53999,112.75999,188263184,22.75548808\n2010-08-03T13:30:00Z,112.48,112.77,111.85001,112.22,146657248,-2.441105386\n2010-08-04T13:30:00Z,112.53,113.11,112.16,112.97,158171632,4.959667488\n2010-08-05T13:30:00Z,112.25,112.91,112.08,112.85001,140473744,1.663101482\n2010-08-06T13:30:00Z,111.74001,112.57001,110.92,112.392,239728256,0.11184224\n2010-08-09T13:30:00Z,112.92,113.17999,112.32001,112.992,120800368,3.846626881\n2010-08-10T13:30:00Z,112.03,112.98,111.3701,112.375,242916192,-2.646047608\n2010-08-11T13:30:00Z,110.64999,110.69,109.12,109.3,273408256,-29.82863926\n2010-08-12T13:30:00Z,107.64999,109.02,107.60001,108.63,239542560,-2.89768732\n2010-08-13T13:30:00Z,108.28999,108.96001,108.17999,108.31,158698496,-0.178333128\n2010-08-16T13:30:00Z,107.57001,108.61,107.17999,108.25999,147895248,1.476394913\n2010-08-17T13:30:00Z,109.19,110.39,108.88,109.59,172270256,11.37500839\n2010-08-18T13:30:00Z,109.53999,110.38,108.91,109.78999,182922064,1.336552946\n2010-08-19T13:30:00Z,109.22,109.49001,107.42999,107.88,265847568,-16.34007221\n2010-08-20T13:30:00Z,107.56,107.93761,106.74989,107.53,209714128,-3.246973344\n2010-08-23T13:30:00Z,108.03999,108.57001,107.07001,107.1236,163490256,-3.760313105\n2010-08-24T13:30:00Z,105.95,106.39,104.97,105.53,280795648,-13.57217237\n2010-08-25T13:30:00Z,104.95,106.34,104.28999,105.94,272330752,2.877040014\n2010-08-26T13:30:00Z,106.44,106.58,104.88,105.23,224492688,-3.631418485\n2010-08-27T13:30:00Z,105.89,106.97,104.31,106.86,272704000,6.653481013\n2010-08-30T13:30:00Z,106.58,106.91,105.3,105.311,167238560,-10.21578947\n2010-08-31T13:30:00Z,104.92,105.98,104.49001,105.31,273933056,-0.349936289\n2010-09-01T13:30:00Z,106.73,108.61,106.66,108.46001,267834944,31.15541667\n2010-09-02T13:30:00Z,108.72,109.49001,108.49001,109.47,156112128,8.082962184\n2010-09-03T13:30:00Z,110.53999,110.99001,109.95,110.89,212197248,11.53921193\n2010-09-07T13:30:00Z,110.37,110.50999,109.55,109.64,141973680,-10.33763023\n2010-09-08T13:30:00Z,109.86,110.85001,109.81,110.41,150268944,4.988650302\n2010-09-09T13:30:00Z,111.64999,111.67999,110.62,110.92,147017872,1.72159923\n2010-09-10T13:30:00Z,111.12,111.61,110.87,111.48199,127818944,2.620172243\n2010-09-13T13:30:00Z,112.58,112.95,112.13,112.72,178503440,10.39397953\n2010-09-14T13:30:00Z,112.5,113.28999,112.08,112.64999,209823568,0.128466895\n2010-09-15T13:30:00Z,112.32001,113.21001,111.98,113.08,168608320,2.799875937\n2010-09-16T13:30:00Z,112.73,113.12,112.35001,113.05,199962880,1.520820421\n2010-09-17T13:30:00Z,113.03999,113.14999,112.17999,112.49001,195836816,-3.909762796\n2010-09-20T13:30:00Z,112.88,114.46001,112.52161,114.21001,214786688,13.22968543\n2010-09-21T13:30:00Z,114.3,114.84,113.50999,113.98,268632320,-0.151338712\n2010-09-22T13:30:00Z,113.8,114.44,113.10001,113.42,191322368,-3.21477484\n2010-09-23T13:30:00Z,112.49001,113.67,112.17999,112.498,202354256,-4.953187717\n2010-09-24T13:30:00Z,113.75,114.89999,113.64999,114.82001,209671680,23.47971694\n2010-09-27T13:30:00Z,114.86,114.99001,114.16,114.27,128799440,-2.170594441\n2010-09-28T13:30:00Z,114.42,115.03999,113.17999,114.67,209207440,1.28106717\n2010-09-29T13:30:00Z,114.38,114.91,114.02,114.47,179665744,-0.394520997\n2010-09-30T13:30:00Z,115.05,115.78999,113.59,114.13,287106560,-2.886099108\n2010-10-01T13:30:00Z,114.99001,115.12,113.92999,114.61,174638624,0.261420034\n2010-10-04T13:30:00Z,114.37,114.85001,113.17999,113.75,166153184,-6.405606108\n2010-10-05T13:30:00Z,114.8,116.32001,114.67,116.03999,229634064,19.53727301\n2010-10-06T13:30:00Z,116.02,116.33,115.56,116.03,148626496,0.847227366\n2010-10-07T13:30:00Z,116.5,116.53,115.19,115.89,164860000,-1.730446927\n2010-10-08T13:30:00Z,116.05,116.86,115.61,116.53751,177760064,3.19341377\n2010-10-11T13:30:00Z,116.72,116.97,116.25,116.64999,103098320,0.640072062\n2010-10-12T13:30:00Z,116.27,117.35001,115.64999,117.00999,182210000,2.592733501\n2010-10-13T13:30:00Z,117.66,118.55,117.38,117.92,194347120,7.656334162\n2010-10-14T13:30:00Z,117.80991,118.00999,116.72,117.46001,217764256,-3.154672728\n2010-10-15T13:30:00Z,118.28,118.35001,116.75999,117.7,243704944,-0.455894243\n2010-10-18T13:30:00Z,117.74001,118.67,117.31,118.28,141502192,2.839888497\n2010-10-19T13:30:00Z,117.19,117.85001,116.02,116.73,280604672,-10.65854755\n2010-10-20T13:30:00Z,116.94,118.44,116.87,117.87,200051744,9.073717949\n2010-10-21T13:30:00Z,118.39999,119.09,117.21001,118.13,221546128,1.290408771\n2010-10-22T13:30:00Z,118.31,118.53,118,118.347,108212320,0.702942272\n2010-10-25T13:30:00Z,119.14,119.75999,118.61,118.7,151145680,0.973268375\n2010-10-26T13:30:00Z,118.10001,118.84,117.87,118.72,158982880,1.056688947\n2010-10-27T13:30:00Z,117.89,118.50999,117.25999,118.38,190023936,0.362569557\n2010-10-28T13:30:00Z,119.06,119.11,117.83,118.39999,168576000,-0.61000869\n2010-10-29T13:30:00Z,118.28,118.72,118.07001,118.49001,144305504,0.07597328\n2010-11-01T13:30:00Z,119.07001,119.75,117.85001,118.53,174074688,-0.715956575\n2010-11-02T13:30:00Z,119.42,119.75,119.10001,119.47501,158345872,5.96826891\n2010-11-03T13:30:00Z,119.675,120.02,118.45,119.95,226702752,2.533164213\n2010-11-04T13:30:00Z,121.28,122.32001,119.9724,122.25999,215039312,17.50453809\n2010-11-05T13:30:00Z,122.34,122.92,122.17999,122.72501,180654128,3.77962779\n2010-11-08T14:30:00Z,122.34,122.69,121.94,122.49001,155901632,-0.362069938\n2010-11-09T14:30:00Z,122.82001,122.95,121.12,121.61,186621568,-6.636894061\n2010-11-10T14:30:00Z,121.58,122.16,120.66,122.10001,221387376,1.474120268\n2010-11-11T14:30:00Z,121.05,121.82001,120.67999,121.63499,158017568,-0.267649986\n2010-11-12T14:30:00Z,120.82001,121.35001,119.64999,120.198,239068816,-9.992007533\n2010-11-15T14:30:00Z,120.58,121.05,119.98,120.03,163940688,-2.600586953\n2010-11-16T14:30:00Z,119.28999,119.49001,117.59,118.16,300332032,-17.0012844\n2010-11-17T14:30:00Z,118.21001,118.71001,117.86,118.218,172308816,-0.669303404\n2010-11-18T14:30:00Z,119.36,120.39,119.35001,119.9575,197723680,17.2241847\n2010-11-19T14:30:00Z,119.89999,120.34,119.25,120.28999,156852816,2.414936901\n2010-11-22T14:30:00Z,119.69,120.24001,118.77,120.19,181592192,1.47650206\n2010-11-23T14:30:00Z,118.77,119.015,117.99001,118.44749,222308944,-14.07657459\n2010-11-24T14:30:00Z,119.2,120.23,119.17999,120.2,140159056,16.16438391\n2010-11-26T14:30:00Z,119.16,119.81,118.8,118.8,76007680,-7.998281787\n2010-11-29T14:30:00Z,118.5,119.48,117.74001,119.162,223642256,2.182983138\n2010-11-30T14:30:00Z,117.98,119.17,117.81,118.49249,233930624,-1.372411832\n2010-12-01T14:30:00Z,120.2,121.24001,120.19,121.00999,221037120,25.84514617\n2010-12-02T14:30:00Z,121.2,122.64999,121.13,122.56,191213568,13.98782989\n2010-12-03T14:30:00Z,122.14,123.03,122.11,122.89,151288816,2.436259921\n2010-12-06T14:30:00Z,122.63,123.03999,122.5,122.75999,103050432,0.410393528\n2010-12-07T14:30:00Z,123.94,124.00999,122.75999,122.83,206580944,-2.756416801\n2010-12-08T14:30:00Z,122.98,123.38,122.41,123.28,138019184,0.888652305\n2010-12-09T14:30:00Z,123.97,124.02,123.14999,123.75999,123705056,2.202284235\n2010-12-10T14:30:00Z,124.14,124.60001,123.73,124.48,117571632,4.766351744\n2010-12-13T14:30:00Z,125.05,125.2,124.52,124.56,133812624,-0.458598726\n2010-12-14T14:30:00Z,124.75,125.23,124.28999,124.67,147249568,-0.206909817\n2010-12-15T14:30:00Z,124.44,124.92999,123.89,124.09801,160823008,-3.509044307\n2010-12-16T14:30:00Z,124.17999,124.91,123.75,124.82001,185035184,3.897431473\n2010-12-17T14:30:00Z,124.08,124.46001,123.82001,124.3,141075248,-1.594411508\n2010-12-20T14:30:00Z,124.64,124.89999,123.98,124.60001,119085440,1.288510971\n2010-12-21T14:30:00Z,124.99001,125.47,124.87,125.39,94965440,7.152583123\n2010-12-22T14:30:00Z,125.48,125.82001,125.41,125.78,78878064,3.307708602\n2010-12-23T14:30:00Z,125.64,125.78,125.28999,125.60001,70079248,-0.677464778\n2010-12-27T14:30:00Z,125.13,125.77,125.03999,125.64999,58125968,1.418848792\n2010-12-28T14:30:00Z,125.89999,125.95,125.5,125.83,55309008,0.889082497\n2010-12-29T14:30:00Z,125.98,126.2,125.89999,125.92,58033040,0.27882648\n2010-12-30T14:30:00Z,125.8,126.13,125.53,125.72,76616880,-1.010670732\n2010-12-31T14:30:00Z,125.53,125.87,125.33,125.75,91270256,0.522321429\n2011-01-03T14:30:00Z,126.71001,127.60001,125.6969,127.05,138725184,9.005035468\n2011-01-04T14:30:00Z,127.33,127.37,126.19,126.98,137409680,-0.679853863\n2011-01-05T14:30:00Z,126.58,127.72501,126.46001,127.64,133975248,3.795626271\n2011-01-06T14:30:00Z,127.69,127.83,127.00999,127.39,122519008,-0.489922616\n2011-01-07T14:30:00Z,127.56,127.77,126.14999,127.14,156034560,-2.446170487\n2011-01-10T14:30:00Z,126.58,127.16,126.2,126.98,122401632,-0.358568075\n2011-01-11T14:30:00Z,127.44,127.74001,126.95,127.42999,110286944,2.908633399\n2011-01-12T14:30:00Z,128.21001,128.72,127.4621,128.58,107929120,8.416562782\n2011-01-13T14:30:00Z,128.63,128.69,128.05,128.36749,129229120,-1.136281822\n2011-01-14T14:30:00Z,128.19,129.33,128.10001,129.3,117677872,6.601949095\n2011-01-18T14:30:00Z,129.17999,129.64,129.03,129.52,114401248,1.598251408\n2011-01-19T14:30:00Z,129.41,129.53571,127.91,128.25,151958320,-10.3818072\n2011-01-20T14:30:00Z,127.96001,128.39999,127.13,128.08,175745632,-1.794905737\n2011-01-21T14:30:00Z,128.88,129.17,128.23,128.37,151462880,0.423728735\n2011-01-24T14:30:00Z,128.285,129.25,128.25999,129.10001,113715440,4.970946569\n2011-01-25T14:30:00Z,128.75999,129.28,128.11,129.17,167552128,2.156341901\n2011-01-26T14:30:00Z,129.49001,130.05,129.23,129.67,141281440,3.998662733\n2011-01-27T14:30:00Z,129.7,130.21001,129.47,129.99001,123302624,2.192748558\n2011-01-28T14:30:00Z,130.14,130.35001,127.50999,127.72,295637248,-18.13438083\n2011-01-31T14:30:00Z,128.07001,128.78,127.75,128.67999,149249120,2.649919697\n2011-02-01T14:30:00Z,129.46001,130.97,129.3801,130.74001,167194192,19.51148138\n2011-02-02T14:30:00Z,130.39999,130.84,130.33,130.485,118323632,0.331882718\n2011-02-03T14:30:00Z,130.25999,130.98,129.57001,130.78,145886624,2.302500493\n2011-02-04T14:30:00Z,130.83,131.2,130.23,131.14999,134634688,2.06245625\n2011-02-07T14:30:00Z,131.44,132.39999,131.42999,131.97,112439008,7.648437155\n2011-02-08T14:30:00Z,132.09,132.64,131.73,132.57001,99072688,3.906385192\n2011-02-09T14:30:00Z,132.21001,132.63,131.61,132.269,146436624,-0.797440768\n2011-02-10T14:30:00Z,131.60001,132.47,131.3,132.321,162708496,2.18399903\n2011-02-11T14:30:00Z,131.8,133.28,131.77,133.11,137716432,5.759708831\n2011-02-14T14:30:00Z,133.03,133.53999,132.88,133.42999,101691120,2.306416237\n2011-02-15T14:30:00Z,133.02,133.22,132.3167,133.00999,119575376,-2.040456376\n2011-02-16T14:30:00Z,133.46001,134.00999,133.19,133.85001,130183440,7.072057047\n2011-02-17T14:30:00Z,133.46001,134.42999,133.34,134.25,109810432,2.724356891\n2011-02-18T14:30:00Z,134.37,134.69,134.06,134.53,130002320,1.852716322\n2011-02-22T14:30:00Z,133.12,134.56149,131.47,131.83,233116368,-20.18468046\n2011-02-23T14:30:00Z,131.75,132.07001,130.21001,131.02,227610128,-6.947122065\n2011-02-24T14:30:00Z,130.88,131.44,129.7,130.92999,260467056,-1.062157997\n2011-02-25T14:30:00Z,131.48,132.41,131.39999,132.33,141693808,13.51646747\n2011-02-28T14:30:00Z,132.82001,133.32001,132.38,133.14999,141600752,6.292500567\n2011-03-01T14:30:00Z,133.57001,133.69,130.89,130.92999,258582256,-16.94267753\n2011-03-02T14:30:00Z,130.75,131.82001,130.35001,131.21001,200277808,-0.391681004\n2011-03-03T14:30:00Z,132.39999,133.62,132.39,133.47,176485184,22.6520476\n2011-03-04T14:30:00Z,133.37,133.63,131.60001,132.47,277371392,-6.015412727\n2011-03-07T14:30:00Z,132.86,133.15939,130.735,131.42999,216888944,-8.104049482\n2011-03-08T14:30:00Z,131.64,133,131.07001,132.58,174706432,5.4157265\n2011-03-09T14:30:00Z,132.32001,132.8,131.60001,132.39,153903440,0.341440968\n2011-03-10T14:30:00Z,131,131.17999,129.81,129.9375,301665792,-24.00552151\n2011-03-11T14:30:00Z,129.52,131.31,129.49001,130.84,225758496,5.334040971\n2011-03-14T13:30:00Z,129.99001,130.48,129.06,130.05,235607744,-2.478655764\n2011-03-15T13:30:00Z,126.59,129.33,126.5,128.56,359794688,-3.392180639\n2011-03-16T13:30:00Z,128.14999,128.57001,125.28,126.175,469160704,-15.60865602\n2011-03-17T13:30:00Z,128,128.39,127.10001,127.85001,254521632,6.818004157\n2011-03-18T13:30:00Z,128.84,128.88,127.50999,127.75999,230654368,-3.05300993\n2011-03-21T13:30:00Z,129.35001,130.00999,129.2,129.74001,154065312,14.88296989\n2011-03-22T13:30:00Z,129.72,129.89,129.17,129.28999,129743440,-2.473202792\n2011-03-23T13:30:00Z,128.92999,130,128.32001,129.66,148648752,2.128241709\n2011-03-24T13:30:00Z,130.39999,131.09,129.67,130.89999,159238320,9.298835752\n2011-03-25T13:30:00Z,131.24001,131.87,130.89211,131.3,155770000,3.050850493\n2011-03-28T13:30:00Z,131.58,131.92,130.94,130.98,109839056,-2.356171435\n2011-03-29T13:30:00Z,130.87,131.89999,130.44,131.86,129844560,4.374979619\n2011-03-30T13:30:00Z,132.55,133.16,132.36,132.77,135895872,7.937138728\n2011-03-31T13:30:00Z,132.60001,132.96001,132.45,132.59,132756496,-0.460186545\n2011-04-01T13:30:00Z,133.41,133.77,132.83,133.14999,154038944,2.967224489\n2011-04-04T13:30:00Z,133.42999,133.67,132.88,133.25999,100773312,-0.152058766\n2011-04-05T13:30:00Z,133,133.83,132.94,133.24001,121083808,0.219770947\n2011-04-06T13:30:00Z,133.88,134,133.12,133.66,120453632,1.869613379\n2011-04-07T13:30:00Z,133.42,133.97749,132.66,133.32001,170973184,-2.026358116\n2011-04-08T13:30:00Z,133.91,133.99001,132.31,132.86,148014816,-3.739417844\n2011-04-11T13:30:00Z,133,133.45,132.14,132.46001,121518496,-2.668478537\n2011-04-12T13:30:00Z,131.72,131.98,130.99001,131.47,161480688,-8.413558248\n2011-04-13T13:30:00Z,132.08,132.17999,130.96001,131.46001,162172944,-1.32341501\n2011-04-14T13:30:00Z,130.7,131.75999,130.27,131.56,161271248,1.695471945\n2011-04-15T13:30:00Z,131.8,132.37,131.41,132.03999,170146624,3.511371543\n2011-04-18T13:30:00Z,130.59,132.03011,129.50999,130.56,210908192,-8.777684406\n2011-04-19T13:30:00Z,130.75999,131.35001,130.44,131.31,124321872,5.475683678\n2011-04-20T13:30:00Z,132.88,133.39,132.78999,133.10001,156473008,17.92730494\n2011-04-21T13:30:00Z,133.78999,133.84,133.1046,133.78,136214496,4.259118784\n2011-04-25T13:30:00Z,133.67999,133.86,133.2,133.64,65231072,-0.889113261\n2011-04-26T13:30:00Z,134.05,135.06,133.91,134.791,146658432,10.35877265\n2011-04-27T13:30:00Z,135.05,135.87,134.5,135.67,143104816,5.958912353\n2011-04-28T13:30:00Z,135.42999,136.28999,135.41,136.11,124865744,3.500599945\n2011-04-29T13:30:00Z,136.16,136.57001,135.98,136.42999,115094368,2.364274435\n2011-05-02T13:30:00Z,137.07001,137.17999,135.95,136.22,126310064,-2.050227483\n2011-05-03T13:30:00Z,135.96001,136.19,135.045,135.73,138445808,-4.374178337\n2011-05-04T13:30:00Z,135.67,135.73,134.23,134.83,182821184,-8.291534644\n2011-05-05T13:30:00Z,134.08,134.95,133.02,133.61,227065680,-8.801547897\n2011-05-06T13:30:00Z,134.94,135.63,133.22,134.2,222951248,0.511993076\n2011-05-09T13:30:00Z,134.19,135.11,133.98,134.72,114134432,2.595057034\n2011-05-10T13:30:00Z,135.17,136.11,135,135.87,114887008,10.25847649\n2011-05-11T13:30:00Z,135.67,135.69,133.82001,134.44,193745632,-11.22218752\n2011-05-12T13:30:00Z,134.08,135.36,133.39,135.08,171648128,2.398806257\n2011-05-13T13:30:00Z,135.14999,135.34,133.56,134.03999,157499056,-6.294381773\n2011-05-16T13:30:00Z,133.56,134.61,132.97,133.19,141770624,-4.577415825\n2011-05-17T13:30:00Z,132.69,133.35001,132.12,133.17,192852320,0.644725749\n2011-05-18T13:30:00Z,133.24001,134.5,132.95,134.36,135228128,9.307984094\n2011-05-19T13:30:00Z,134.8,135.03,133.94,134.67999,119584880,1.650496967\n2011-05-20T13:30:00Z,134.33,134.6781,133.36,133.61,182638320,-8.928408285\n2011-05-23T13:30:00Z,131.98,133.64751,131.59,132.06,168800000,-9.535711572\n2011-05-24T13:30:00Z,132.44,132.73,131.7,131.95,147200320,-1.336011905\n2011-05-25T13:30:00Z,131.42,132.94,131.38,132.39,151102192,2.951244428\n2011-05-26T13:30:00Z,132.03,133.24001,131.78,133,164984624,4.173574513\n2011-05-27T13:30:00Z,133.37,133.87,132.9588,133.50999,120921872,3.87645158\n2011-05-31T13:30:00Z,134.77,134.92,133.84,134.89999,164731184,10.25830186\n2011-06-01T13:30:00Z,134.50999,134.9234,131.75999,131.87,233094256,-26.51224799\n2011-06-02T13:30:00Z,131.96001,132.24001,130.96001,131.73,200466752,-2.682487751\n2011-06-03T13:30:00Z,130.14999,131.42,130.08,130.42,234690128,-8.186866346\n2011-06-06T13:30:00Z,130.09,130.36,128.87,129.045,179951120,-11.16728999\n2011-06-07T13:30:00Z,129.7,130.07001,128.85001,128.96001,161805936,-3.097671044\n2011-06-08T13:30:00Z,128.75999,129.19,128.17999,128.42,198696320,-3.65123153\n2011-06-09T13:30:00Z,128.77,129.92999,128.46001,129.39999,160964368,7.250354469\n2011-06-10T13:30:00Z,128.85001,128.92999,127.25999,127.60001,238629312,-14.70429828\n2011-06-13T13:30:00Z,127.89,128.24001,127.05,127.7,207599744,-0.818656781\n2011-06-14T13:30:00Z,128.87,129.77,128.82001,129.32001,160570368,14.93125199\n2011-06-15T13:30:00Z,128.24001,129.2991,126.67999,127.02,300957952,-16.83375991\n2011-06-16T13:30:00Z,127.06,127.97,126.32001,127.3,308038400,0.288516532\n2011-06-17T13:30:00Z,127.92999,127.94,126.62,127.05,234996064,-1.940201993\n2011-06-20T13:30:00Z,126.62,127.97,126.58,127.7,159478944,3.464300022\n2011-06-21T13:30:00Z,128.36,129.7,127.75349,129.45,193157248,14.29284678\n2011-06-22T13:30:00Z,129.05,129.81,128.59,128.67,176886432,-2.511934673\n2011-06-23T13:30:00Z,127.16,128.63609,126.19,128.30099,334286848,0.645226139\n2011-06-24T13:30:00Z,128.27,128.37,126.62,126.81,226129376,-9.992530961\n2011-06-27T13:30:00Z,126.89,128.42999,126.64,127.94,168908192,6.060895584\n2011-06-28T13:30:00Z,128.45,129.63,128.27,129.61,165556256,14.84659091\n2011-06-29T13:30:00Z,130.2,130.92999,129.6321,130.72,244295376,8.564984458\n2011-06-30T13:30:00Z,131.14,132.17999,130.705,131.97,223496496,10.20521175\n2011-07-01T13:30:00Z,132.09,134.10001,131.78,133.92,202385632,16.18306091\n2011-07-05T13:30:00Z,133.78,134.08,133.39,133.81,165935936,1.046432462\n2011-07-06T13:30:00Z,133.49001,134.14,133.11,133.97,143332688,1.71835241\n2011-07-07T13:30:00Z,135.16,135.7,134.88,135.36,170464192,12.47894564\n2011-07-08T13:30:00Z,133.83,135.3558,133.39,134.39999,194171504,-3.813616724\n2011-07-11T13:30:00Z,132.75,133.17999,131.66,131.97,195918560,-20.17696103\n2011-07-12T13:30:00Z,131.69,132.78,131.36,131.39999,214675632,-2.8526012\n2011-07-13T13:30:00Z,132.09,133.22,131.519,131.84,204062560,1.50492454\n2011-07-14T13:30:00Z,132.17,132.78,130.67999,130.92999,226111744,-5.339088967\n2011-07-15T13:30:00Z,131.66,131.87,130.77,131.69,220124624,1.937548427\n2011-07-18T13:30:00Z,131.08,131.28,129.63,130.61,196872064,-9.038422819\n2011-07-19T13:30:00Z,131.34,132.89,131.31,132.73,166554880,18.77380952\n2011-07-20T13:30:00Z,133.07001,133.14999,132.42,132.64999,137145312,0.140030448\n2011-07-21T13:30:00Z,133.39999,134.82001,132.6693,134.49001,245270320,13.65036355\n2011-07-22T13:30:00Z,134.52,134.72,133.75999,134.58,126019312,1.452970146\n2011-07-25T13:30:00Z,133.3,134.49001,133.16,133.83,136653680,-3.000888486\n2011-07-26T13:30:00Z,133.74001,133.96001,133.03,133.33,131278128,-2.69411582\n2011-07-27T13:30:00Z,132.59,132.63,130.42999,130.60001,249020000,-26.15386361\n2011-07-28T13:30:00Z,130.60001,131.77,130.00999,130.22,207939872,-3.457848285\n2011-07-29T13:30:00Z,128.91,130.55,127.96671,129.33,307042560,-4.075136918\n2011-08-01T13:30:00Z,130.84,130.96001,127.53,128.78,325790720,-4.694116848\n2011-08-02T13:30:00Z,127.81,128.5,125.49001,125.49001,346653696,-27.85606339\n2011-08-03T13:30:00Z,125.66,126.31,123.53,126.17,371029504,1.294251056\n2011-08-04T13:30:00Z,124.42,124.62,120.06,120.25999,520721920,-54.9656369\n2011-08-05T13:30:00Z,121.75999,122.07001,116.86,120.08,655561472,-7.003922892\n2011-08-08T13:30:00Z,116.91,120.1218,112.02,112.25999,702263808,-62.45308043\n2011-08-09T13:30:00Z,114.07001,117.64,110.27,117.48,717828608,22.70898915\n2011-08-10T13:30:00Z,115.25999,116.28,111.95,112.28999,662607360,-34.8016732\n2011-08-11T13:30:00Z,113.25999,118.92,112.317,117.33,487979776,35.65753605\n2011-08-12T13:30:00Z,118.39999,119.215,117.28,118.12,313731584,6.653786994\n2011-08-15T13:30:00Z,119.19,120.74001,119,120.62,258810560,22.88864037\n2011-08-16T13:30:00Z,119.47,120.69,118.31,119.59,294095104,-3.230308219\n2011-08-17T13:30:00Z,120.25,121.2,118.72,119.67,238201056,-0.721613546\n2011-08-18T13:30:00Z,116.5,119.714,113.39,114.50999,512956160,-38.22470069\n2011-08-19T13:30:00Z,112.96001,115.88,112.5,112.64,428281344,-8.188654778\n2011-08-22T13:30:00Z,115.17,115.23,112.41,112.73,275090688,-6.75410296\n2011-08-23T13:30:00Z,113.14999,116.5665,112.58,116.44,331136512,24.75281693\n2011-08-24T13:30:00Z,116.19,118.24001,115.92,118.08,246869680,12.19871555\n2011-08-25T13:30:00Z,118.73,119.39999,115.87,116.28,312365312,-8.808618198\n2011-08-26T13:30:00Z,115.69,118.50999,113.85001,117.97,314495744,6.387533505\n2011-08-29T13:30:00Z,119.56,121.42999,118.0569,121.36,190977184,26.36301059\n2011-08-30T13:30:00Z,120.83,122.42999,119.25999,121.67999,241315680,4.332666523\n2011-08-31T13:30:00Z,122.46001,123.50999,121.3,122.22,301828352,2.986288822\n2011-09-01T13:30:00Z,122.28999,123.39999,120.78,120.94,254585872,-6.766801586\n2011-09-02T13:30:00Z,118.42,120.8726,117.42999,117.85001,255517184,-21.35472671\n2011-09-06T13:30:00Z,114.39,117.16,114.38,116.99001,285142784,1.97466184\n2011-09-07T13:30:00Z,118.75999,120.34,118.36,120.28999,209803120,29.77970614\n2011-09-08T13:30:00Z,119.57001,120.94,118.77,119.03999,250568192,-4.214994797\n2011-09-09T13:30:00Z,117.67999,119.05701,115.28,115.92,380195072,-24.84023126\n2011-09-12T13:30:00Z,114.47,116.75999,114.05,116.67,305793536,5.231577655\n2011-09-13T13:30:00Z,117.05,118.17999,116.22,117.74001,272514560,7.388358619\n2011-09-14T13:30:00Z,118.34,120.8,116.72,119.37,319389440,10.42254513\n2011-09-15T13:30:00Z,120.64999,121.47,119.4034,121.42999,326777088,15.18105188\n2011-09-16T13:30:00Z,121.28999,121.97,120.32001,121.521,284528128,1.509742667\n2011-09-19T13:30:00Z,119.53,120.92999,118.72,120.31,241516944,-5.212762929\n2011-09-20T13:30:00Z,120.82001,121.99001,120.00999,120.17,218932128,-1.303468187\n2011-09-21T13:30:00Z,120.23,120.60001,116.44,116.63,316251136,-29.67651095\n2011-09-22T13:30:00Z,113.25,114.21001,111.3,112.86,513920000,-32.28389464\n2011-09-23T13:30:00Z,112.11,114.16,112.02,113.53999,307242496,4.711537709\n2011-09-26T13:30:00Z,114.61,116.39999,112.98,116.24001,260673632,18.32470384\n2011-09-27T13:30:00Z,118.53,119.56,116.84,117.53999,311753728,7.340291961\n2011-09-28T13:30:00Z,117.78,118.49001,114.97,115.145,286696704,-16.88305799\n2011-09-29T13:30:00Z,117.05,117.63,113.92999,116.05,298108928,-0.904168774\n2011-09-30T13:30:00Z,114.45,115.45,113.07001,113.14999,288685568,-24.15538684\n2011-10-03T13:30:00Z,112.49001,113.95,109.81,109.92999,365136640,-22.55806898\n2011-10-04T13:30:00Z,108.35001,112.58,107.42999,112.34,459177472,10.76992854\n2011-10-05T13:30:00Z,112.62,114.72,111.58,114.42,284108032,14.29977307\n2011-10-06T13:30:00Z,114.36,116.66,113.50999,116.49001,257800752,13.94168627\n2011-10-07T13:30:00Z,117.17,117.245,115.06,115.71001,312657920,-3.214863763\n2011-10-10T13:30:00Z,117.67999,119.63,117.67,119.58,230666192,33.02493434\n2011-10-11T13:30:00Z,118.87,120.03999,118.75,119.7,209087936,2.968504381\n2011-10-12T13:30:00Z,120.60001,122.14,120.33,120.75,281544704,8.711918006\n2011-10-13T13:30:00Z,120.03999,120.87,119.12,120.50999,212538816,0.18515629\n2011-10-14T13:30:00Z,121.91,122.60001,121.23,122.57001,211397568,17.72914361\n2011-10-17T13:30:00Z,121.99001,122.54919,119.92999,120.23,202311568,-18.03759488\n2011-10-18T13:30:00Z,120.14,123.5,119.2,122.58,318857984,13.49563084\n2011-10-19T13:30:00Z,122.38,123.08,120.71001,121.13,226601248,-5.745689059\n2011-10-20T13:30:00Z,121.42999,122.10001,119.82001,121.66,262075632,1.050092153\n2011-10-21T13:30:00Z,123.09,124.12,122.72,123.97,278999296,21.71838825\n2011-10-24T13:30:00Z,124.17,125.8,124.06,125.49001,203215568,13.69085863\n2011-10-25T13:30:00Z,124.89,124.95,122.78,123.049,268596736,-18.53653745\n2011-10-26T13:30:00Z,124.35001,124.77,122.21001,124.3,289053696,2.727115943\n2011-10-27T13:30:00Z,127.63,129.42,124.3187,128.63,390025728,30.09083177\n2011-10-28T13:30:00Z,128,128.85001,127.8,128.60001,225906496,2.075043894\n2011-10-31T13:30:00Z,127.16,128.6239,125.32001,125.5,228146624,-22.43560092\n2011-11-01T13:30:00Z,122.03,123.50999,121.52,122.002,416565760,-28.73066725\n2011-11-02T13:30:00Z,123.83,124.39999,122.7905,123.99001,245529376,15.36217189\n2011-11-03T13:30:00Z,125.27,126.5,123.595,126.25,291174912,14.86173033\n2011-11-04T13:30:00Z,125.23,125.7,124.00999,125.481,249401504,-2.524434236\n2011-11-07T14:30:00Z,125.39,126.39,124.2,126.25999,196617184,4.537502871\n2011-11-08T14:30:00Z,126.92,128.02,125.71001,127.88,224426192,10.08619324\n2011-11-09T14:30:00Z,124.89,125.8,122.86,123.161,337981952,-39.72803614\n2011-11-10T14:30:00Z,124.78999,124.94,123.02,124.32001,231866496,2.324526597\n2011-11-11T14:30:00Z,125.83,126.99001,125.78999,126.66,189924320,21.4436495\n2011-11-14T14:30:00Z,126.19,127.45,124.92,125.46001,159258256,-5.39274863\n2011-11-15T14:30:00Z,125.17,126.75,124.72,126.08299,184709376,3.268625177\n2011-11-16T14:30:00Z,124.81,126.34,123.89999,124.08,235782432,-10.94126475\n2011-11-17T14:30:00Z,123.85001,124.16,121.23,122.105,331219712,-17.34039006\n2011-11-18T14:30:00Z,122.5,122.75,121.47,121.979,215580368,-1.932536742\n2011-11-21T14:30:00Z,120.2,120.35001,118.64999,119.661,229611632,-21.38048401\n2011-11-22T14:30:00Z,119.39999,120.10001,118.52,119.19,216494816,-2.955807391\n2011-11-23T14:30:00Z,118.07001,119.19,116.56,116.56,224531632,-21.0639329\n2011-11-25T14:30:00Z,116.38,117.7,116.2,116.34,99557008,-2.343381866\n2011-11-28T14:30:00Z,119.53999,120.17999,118.82001,119.71001,210686000,31.67844439\n2011-11-29T14:30:00Z,120.05,121,119.61,120.05,199241504,2.152761792\n2011-11-30T14:30:00Z,123.49001,125.22,119.9971,124.99001,324439552,35.20236806\n2011-12-01T14:30:00Z,124.85001,125.64,124.42999,124.97,176954752,1.063621445\n2011-12-02T14:30:00Z,126.12,126.5,124.78,124.86,221109680,-3.87966206\n2011-12-05T14:30:00Z,126.84,127.17999,125.44,126.22,225263872,4.544775911\n2011-12-06T14:30:00Z,126.21001,127.11,125.75999,126.25999,178842064,-0.332712906\n2011-12-07T14:30:00Z,125.84,127.25999,124.97,126.73,237802496,3.247774076\n2011-12-08T14:30:00Z,125.89999,126.17999,123.64999,123.95,240862752,-22.4609867\n2011-12-09T14:30:00Z,124.50999,126.37,124.39999,126.05,209111312,13.43351066\n2011-12-12T14:30:00Z,124.95,124.97,123.16,124.21001,215826064,-12.05254708\n2011-12-13T14:30:00Z,124.86,125.57001,122.45,123.05,245159680,-7.488704073\n2011-12-14T14:30:00Z,122.56,123.03,121.47,121.74001,238618816,-10.60731242\n2011-12-15T14:30:00Z,123.03,123.2,121.99001,122.185,199109120,-1.081417564\n2011-12-16T14:30:00Z,122.23,122.95,121.3,121.59,220481312,-3.346982035\n2011-12-19T14:30:00Z,122.06,122.32001,120.03,120.28999,183902944,-9.332164461\n2011-12-20T14:30:00Z,122.17999,124.14,120.37019,123.92999,225418064,23.04450136\n2011-12-21T14:30:00Z,123.92999,124.36,122.75,124.17,194230880,2.872587683\n2011-12-22T14:30:00Z,124.63,125.39999,124.23241,125.27,119465312,9.038401413\n2011-12-23T14:30:00Z,125.67,126.42999,125.41,126.39,92187184,9.511994096\n2011-12-27T14:30:00Z,126.17,126.82001,126.06,126.49001,86075680,1.258037482\n2011-12-28T14:30:00Z,126.50999,126.53,124.73,124.83,119107008,-14.15965072\n2011-12-29T14:30:00Z,125.24001,126.25,124.8566,126.12,123507120,6.364615823\n2011-12-30T14:30:00Z,126.02,126.33,125.5,125.5,95599008,-2.435729311\n2012-01-03T14:30:00Z,127.75999,128.38,127.42999,127.495,193697808,15.24939548\n2012-01-04T14:30:00Z,127.2,127.81,126.71001,127.7,127186432,1.635423879\n2012-01-05T14:30:00Z,127.00999,128.23,126.42999,128.03999,173894944,4.040878683\n2012-01-06T14:30:00Z,128.2,128.22,127.28999,127.71001,148049936,-1.253180236\n2012-01-09T14:30:00Z,128,128.17999,127.41,128.02,99530128,0.649991773\n2012-01-10T14:30:00Z,129.39,129.64999,128.95,129.13,115281936,8.57667667\n2012-01-11T14:30:00Z,128.73,129.37,128.52,129.2,111540688,1\n2012-01-12T14:30:00Z,129.57001,129.7,128.53999,129.50999,118983632,1.28345754\n2012-01-13T14:30:00Z,128.64,129.05,127.72,128.84,179836128,-4.155298413\n2012-01-17T14:30:00Z,130.08,130.32001,128.89571,129.34,132209184,1.108415077\n2012-01-18T14:30:00Z,129.31,130.84,129.08,130.77,163395120,9.519601542\n2012-01-19T14:30:00Z,131.22,131.57001,130.8,131.46001,126328816,5.108780305\n2012-01-20T14:30:00Z,131.24001,131.95,130.92,131.53999,138230128,0.897865198\n2012-01-23T14:30:00Z,131.50999,132.25,130.98,131.61,129295744,0.643399465\n2012-01-24T14:30:00Z,130.8,131.5,130.60001,131.46001,103083248,1.320581693\n2012-01-25T14:30:00Z,131.25999,132.87,130.75,132.56,198613184,7.385460533\n2012-01-26T14:30:00Z,133.14999,133.39999,131.36,131.88,184880496,-3.139521056\n2012-01-27T14:30:00Z,131.24001,132.05,131.14999,131.82001,135259056,-0.327856039\n2012-01-30T14:30:00Z,130.50999,131.44,130.06,131.37,147311744,0.801719419\n2012-01-31T14:30:00Z,132.02,132.17999,130.67999,131.32001,157211936,-0.546041388\n2012-02-01T14:30:00Z,132.28999,133.14,132.13,132.47,166234432,7.619079964\n2012-02-02T14:30:00Z,132.73,133.02,132.21001,132.67999,113090368,0.924665458\n2012-02-03T14:30:00Z,134,134.62,133.77,134.53999,160598496,18.24127325\n2012-02-06T14:30:00Z,133.98,134.5134,133.83,134.45,107694432,1.493960545\n2012-02-07T14:30:00Z,134.17,135.02,133.64,134.78999,135528064,2.594586185\n2012-02-08T14:30:00Z,134.86,135.22,134.31,135.19,139361376,2.028152648\n2012-02-09T14:30:00Z,135.41,135.59,134.56,135.36,148602816,0.805196629\n2012-02-10T14:30:00Z,134.16,134.47,133.84,134.36099,167907504,-7.958291954\n2012-02-13T14:30:00Z,135.32001,135.52,134.74001,135.36,115841808,7.595473022\n2012-02-14T14:30:00Z,135,135.27,134.25,135.19,165996128,-0.419493853\n2012-02-15T14:30:00Z,135.63,135.83,134.28999,134.56,195195120,-3.959664723\n2012-02-16T14:30:00Z,134.57001,136.17,134.33,136.049,186567744,9.362995107\n2012-02-17T14:30:00Z,136.52,136.6275,135.96001,136.41,129869376,2.355535309\n2012-02-21T14:30:00Z,136.73,137.05,136.05,136.47,134042256,-0.379562044\n2012-02-22T14:30:00Z,136.25999,136.55,135.78999,136.032,124455248,-3.178467306\n2012-02-23T14:30:00Z,135.96001,136.73,135.5,136.631,137704256,2.974429122\n2012-02-24T14:30:00Z,136.92999,137.2,136.63,136.92999,105539056,2.249869006\n2012-02-27T14:30:00Z,136.02,137.53,135.8,137.16,145728816,3.265907875\n2012-02-28T14:30:00Z,137.2,137.72,136.92999,137.55901,129355808,2.811418033\n2012-02-29T14:30:00Z,137.75999,138.19,136.53999,137.02,185934688,-2.999097156\n2012-03-01T14:30:00Z,137.31,137.99001,136.9312,137.73,145026128,3.582546812\n2012-03-02T14:30:00Z,137.64,137.82001,137,137.312,120638256,-2.352744835\n2012-03-05T14:30:00Z,137.10001,137.2,136.28,136.75,140765008,-4.992988894\n2012-03-06T14:30:00Z,135.35001,135.42999,134.36,134.75,202129808,-19.62225163\n2012-03-07T14:30:00Z,135.06,135.91,134.92999,135.69,143692128,6.566543136\n2012-03-08T14:30:00Z,136.52,137.32001,136.24001,137.03999,116968816,11.90499463\n2012-03-09T14:30:00Z,137.3,137.92999,137.13,137.57001,122836752,4.535740179\n2012-03-12T13:30:00Z,137.55,137.75999,137.09,137.58,104003504,0.376252343\n2012-03-13T13:30:00Z,138.32001,140.13,138.09,140.062,184090432,23.26075529\n2012-03-14T13:30:00Z,140.10001,140.44501,139.48,139.91,145163504,0.489566438\n2012-03-15T13:30:00Z,140.12,140.78,139.75999,140.72,165118432,5.41195551\n2012-03-16T13:30:00Z,140.36,140.48,140,140.3,152893376,-1.8\n2012-03-19T13:30:00Z,140.21001,141.28,140.11,140.85001,125291008,4.419355485\n2012-03-20T13:30:00Z,140.05,140.61,139.64,140.44,121729632,-0.332811919\n2012-03-21T13:30:00Z,140.52,140.64999,139.92,140.21001,122388368,-1.129108811\n2012-03-22T13:30:00Z,139.17999,139.55,138.74001,139.2,135216688,-8.131100782\n2012-03-23T13:30:00Z,139.32001,139.81,138.55,139.64999,120520944,1.991046584\n2012-03-26T13:30:00Z,140.64999,141.61,140.60001,141.61,120163936,19.713559\n2012-03-27T13:30:00Z,141.74001,141.83,141.08,141.17,119868432,-1.622794671\n2012-03-28T13:30:00Z,141.10001,141.32001,139.64,140.47,148562000,-6.073300166\n2012-03-29T13:30:00Z,139.64,140.49339,139.09,140.23,164963632,-0.566396509\n2012-03-30T13:30:00Z,140.92,141.05,140.05,140.81,135486688,3.003540305\n2012-04-02T13:30:00Z,140.64,142.21001,140.36,141.84,151741056,7.468389067\n2012-04-03T13:30:00Z,141.64,141.8826,140.42999,141.25999,155806624,-2.363353264\n2012-04-04T13:30:00Z,140.22,140.339,139.34,139.86,146895936,-12.93009819\n2012-04-05T13:30:00Z,139.38,140.2,139.25999,139.78999,137439376,0.163781479\n2012-04-09T13:30:00Z,138.03,139.84441,137.84,138.22,127555872,-7.939203104\n2012-04-10T13:30:00Z,137.95,138.34,135.75999,135.89999,235360256,-19.29564463\n2012-04-11T13:30:00Z,137.28999,137.53999,136.75,137,154132944,2.625620659\n2012-04-12T13:30:00Z,137.13,138.89999,137.03,138.78999,154321504,15.45412415\n2012-04-13T13:30:00Z,138.47,138.8168,137.00999,137.14,169246624,-9.513612931\n2012-04-16T13:30:00Z,137.84,138.03999,136.58,137.05,147825184,-2.565362376\n2012-04-17T13:30:00Z,137.84,139.36,137.698,139.082,147877568,16.23598866\n2012-04-18T13:30:00Z,138.46001,139.08,138.38,138.61,123884192,-0.375225593\n2012-04-19T13:30:00Z,138.63,139.14999,137.07001,137.72,198666752,-5.943217741\n2012-04-20T13:30:00Z,138.33,138.83,137.87,137.95,143199568,-1.030321782\n2012-04-23T13:30:00Z,136.53999,136.91,135.94,136.78999,171844880,-8.956309543\n2012-04-24T13:30:00Z,136.91,137.66,136.8,137.31,137484192,4.587519239\n2012-04-25T13:30:00Z,138.64999,139.25,138.53,139.19,150255008,19.0778396\n2012-04-26T13:30:00Z,138.89,140.32001,138.81,140.16,136292688,7.470384819\n2012-04-27T13:30:00Z,140.58,140.78999,139.8,140.39,130725008,1.362679997\n2012-04-30T13:30:00Z,140.11,140.21001,139.49001,139.87,115092192,-4.509815837\n2012-05-01T13:30:00Z,139.78999,141.66,139.63,140.74001,138837312,6.878546053\n2012-05-02T13:30:00Z,139.92,140.46001,139.46001,140.325,121080944,0.145160998\n2012-05-03T13:30:00Z,140.34,140.45,138.99001,139.25,143762688,-8.116609484\n2012-05-04T13:30:00Z,138.515,139.30119,136.92,137,193931312,-17.9994649\n2012-05-07T13:30:00Z,136.50999,137.56,136.46001,137.10001,127765872,0.038509136\n2012-05-08T13:30:00Z,136.28,136.77,134.92,136.55,213383872,-1.685436065\n2012-05-09T13:30:00Z,135.10001,136.61,134.49001,135.74001,220778192,-2.486654725\n2012-05-10T13:30:00Z,136.67999,136.85001,135.71001,136.02,150600944,0.586992548\n2012-05-11T13:30:00Z,135.17,136.87,135.11,135.61,153032368,-1.048857612\n2012-05-14T13:30:00Z,134.31,135.6144,133.91,134.11,163909936,-8.725336199\n2012-05-15T13:30:00Z,134.02,134.81,133.13,133.34,207629248,-4.106936416\n2012-05-16T13:30:00Z,133.94,134.55,132.8,132.82899,207265568,-4.870387858\n2012-05-17T13:30:00Z,132.86,133.02,130.78999,130.86,247992944,-16.49904037\n2012-05-18T13:30:00Z,131.37,131.60001,129.55,129.74001,319631104,-7.818180983\n2012-05-21T13:30:00Z,130.16,132.02,129.95,131.97,177861056,15.05003312\n2012-05-22T13:30:00Z,132.31,133.23,131.34,132.2,197531120,2.10952508\n2012-05-23T13:30:00Z,131.25,132.46001,129.99001,132.27,204958320,3.055604292\n2012-05-24T13:30:00Z,132.63,132.84,131.42,132.53,167357632,1.474813433\n2012-05-25T13:30:00Z,132.48,132.85001,131.78,132.10001,135465568,-2.76104071\n2012-05-29T13:30:00Z,133.16,133.92999,131.17,133.7,152883440,7.110803408\n2012-05-30T13:30:00Z,132.56,133.6924,131.49001,131.75999,162370368,-13.00903894\n2012-05-31T13:30:00Z,131.71001,132.45,130.34,131.47,196186192,-2.343586073\n2012-06-01T13:30:00Z,129.41,131.5042,128.16,128.16,253245008,-24.27781961\n2012-06-04T13:30:00Z,128.39,128.74001,127.13499,128.10001,202548256,-1.728884509\n2012-06-05T13:30:00Z,127.85001,129.25999,127.78,129.07001,164149376,7.039802051\n2012-06-06T13:30:00Z,129.97,132.03,129.92999,131.97,184202752,27.43987732\n2012-06-07T13:30:00Z,133.47,133.53,131.78,132.05,184772688,-0.563333333\n2012-06-08T13:30:00Z,131.71001,133.125,131.28999,133.10001,143915632,4.264423307\n2012-06-11T13:30:00Z,134.17,134.25,131.28,131.41499,169756064,-9.30929286\n2012-06-12T13:30:00Z,131.78999,133.00999,131.16,132.92,181931744,5.423732634\n2012-06-13T13:30:00Z,132.53,133.36,131.62,132.07001,172223872,-3.203726726\n2012-06-14T13:30:00Z,132.34,134,131.98,133.47,230616256,10.45219908\n2012-06-15T13:30:00Z,133.38,134.25999,133.10001,134.14,169444432,4.560989039\n2012-06-18T13:30:00Z,133.58,134.73,133.28,134.39999,131365440,2.818548399\n2012-06-19T13:30:00Z,135.08,136.25,134.3714,135.7,137382560,10.07206894\n2012-06-20T13:30:00Z,135.71001,136.10001,134.27,135.48,206466624,-0.81047183\n2012-06-21T13:30:00Z,135.64,135.78,132.33,132.44,205272320,-26.36693216\n2012-06-22T13:30:00Z,133.13,133.71001,132.62,133.46001,130029184,1.543467268\n2012-06-25T13:30:00Z,132.05,132.10001,130.85001,131.32001,146375680,-19.63570674\n2012-06-26T13:30:00Z,131.7,132.38,130.92999,131.98,141633936,2.505868561\n2012-06-27T13:30:00Z,132.42,133.42999,131.96671,133.173,108087936,9.690249844\n2012-06-28T13:30:00Z,132.28999,132.99001,131.28,132.78999,169242688,0.32846167\n2012-06-29T13:30:00Z,135.2,136.27,134.85001,136.105,212251056,32.878577\n2012-07-02T13:30:00Z,136.48,136.64999,135.52,136.50999,129524432,1.742167108\n2012-07-03T13:30:00Z,136.48,137.50999,136.34,137.412,80450192,7.301072729\n2012-07-05T13:30:00Z,136.89999,137.8,136.28999,136.78999,126177440,-1.7863626\n2012-07-06T13:30:00Z,135.47,135.77,134.85001,135.49001,151192000,-10.96012631\n2012-07-09T13:30:00Z,135.38,135.57001,134.7,135.32001,103780432,-1.100313031\n2012-07-10T13:30:00Z,136.00999,136.23,133.67999,134.14,167884816,-8.51178481\n2012-07-11T13:30:00Z,134.21001,134.60001,133.38,134.16,141734000,-1.330001126\n2012-07-12T13:30:00Z,133.38,134.2269,132.60001,133.50999,143583120,-3.553607986\n2012-07-13T13:30:00Z,133.86,135.89,133.84,135.75,129644128,21.29502644\n2012-07-16T13:30:00Z,135.44,135.83,134.89999,135.42999,97525184,0.558657892\n2012-07-17T13:30:00Z,135.97,136.64,134.55,136.36,138860192,4.056880757\n2012-07-18T13:30:00Z,136.03999,137.64,135.96001,137.37,113349632,7.977563868\n2012-07-19T13:30:00Z,137.64999,138.17999,137.21001,137.73,129847184,2.847081198\n2012-07-20T13:30:00Z,136.95,137.16,136.32001,136.47,142904432,-11.39080428\n2012-07-23T13:30:00Z,134.47,136.38519,133.84,135.09,145210816,-7.224354085\n2012-07-24T13:30:00Z,135.19,135.25,133.03,133.925,173301120,-8.904078947\n2012-07-25T13:30:00Z,134.21001,134.56,133.25,133.96001,129122256,-1.053850884\n2012-07-26T13:30:00Z,135.89,136.46001,135.25999,136.17,156526432,18.68854607\n2012-07-27T13:30:00Z,136.89,139.07001,136.1364,138.675,236768880,20.92437241\n2012-07-30T13:30:00Z,138.52,139.339,138.27,138.67999,106781936,1.454958093\n2012-07-31T13:30:00Z,138.49001,138.87,137.71001,137.71001,120575808,-6.668593555\n2012-08-01T13:30:00Z,138.7,138.73,137.39999,137.59,138293744,-3.636867545\n2012-08-02T13:30:00Z,136.55,137.57001,135.58,136.64,199556560,-6.522557031\n2012-08-03T13:30:00Z,138.56,139.64,136.6794,139.349,157825008,19.519282\n2012-08-06T13:30:00Z,139.72,140.17,139.56,139.62,86327744,2.351295878\n2012-08-07T13:30:00Z,140.17999,140.92,140.03,140.32001,109545056,5.404720982\n2012-08-08T13:30:00Z,139.85001,140.64999,139.81,140.49001,89754624,1.912566644\n2012-08-09T13:30:00Z,140.28999,140.89,140.14999,140.61,90291632,1.222164199\n2012-08-10T13:30:00Z,140.03999,140.89,139.81,140.84,99792624,3.06037056\n2012-08-13T13:30:00Z,140.60001,140.84,140.03999,140.77,79426880,1.0749875\n2012-08-14T13:30:00Z,141.28999,141.38,140.37,140.78999,102379376,-0.679233353\n2012-08-15T13:30:00Z,140.64,141.19,140.55,140.95,71085808,0.620963236\n2012-08-16T13:30:00Z,141.14999,142.16,140.8,141.99001,112014192,8.088692174\n2012-08-17T13:30:00Z,142.23,142.3,141.86,142.17999,90813680,1.117684193\n2012-08-20T13:30:00Z,141.98,142.22,141.59,142.19,78255680,0.588308994\n2012-08-21T13:30:00Z,142.53999,143.09,141.45,141.75999,105581008,-2.550808715\n2012-08-22T13:30:00Z,141.39999,142.05,141.07001,141.82001,133243440,0.275370425\n2012-08-23T13:30:00Z,141.47,141.48,140.44,140.66499,111466368,-9.526981378\n2012-08-24T13:30:00Z,140.31,141.83,140.22,141.50999,99481184,4.999898033\n2012-08-27T13:30:00Z,141.89,142.08,141.34,141.53999,68785872,0.530934419\n2012-08-28T13:30:00Z,141.17999,141.84,140.97,141.39999,75689568,-0.437174119\n2012-08-29T13:30:00Z,141.52,141.89,141.12,141.50999,65421296,0.593932954\n2012-08-30T13:30:00Z,140.89999,140.94,140.19,140.49001,96589808,-9.760574274\n2012-08-31T13:30:00Z,141.28999,141.82001,140.36,141.16,151970368,2.673291445\n2012-09-04T13:30:00Z,141.03999,141.46001,140.13,141.03,120226192,-0.791359291\n2012-09-05T13:30:00Z,141.09,141.47,140.63,140.91,100660256,-0.693614076\n2012-09-06T13:30:00Z,141.75999,143.78,141.75,143.77,158272432,27.4634628\n2012-09-07T13:30:00Z,144.00999,144.39,143.88,144.33,107272000,4.437663202\n2012-09-10T13:30:00Z,144.19,144.44,143.46001,143.50999,86458432,-5.54013398\n2012-09-11T13:30:00Z,143.60001,144.37,143.56,143.91,88760000,2.059101549\n2012-09-12T13:30:00Z,144.39,144.55,143.89999,144.39,87640880,3.06524675\n2012-09-13T13:30:00Z,144.37,147.03999,143.99001,146.59,225470128,17.97443528\n2012-09-14T13:30:00Z,146.88,148.11,146.75999,147.24001,169777008,6.611864041\n2012-09-17T13:30:00Z,146.94,147.19,146.37,146.74001,119427744,-2.965875775\n2012-09-18T13:30:00Z,146.49001,146.81,146.25,146.62,98326496,-0.527227316\n2012-09-19T13:30:00Z,146.78999,147.17,146.41,146.7,128318256,0.292795679\n2012-09-20T13:30:00Z,146.03,146.78999,145.63,146.71001,154009744,1.852259141\n2012-09-21T13:30:00Z,146.64,146.67,145.81,145.87,108737440,-5.651848321\n2012-09-24T13:30:00Z,145.14999,145.98,145.03999,145.645,95682000,-0.778677175\n2012-09-25T13:30:00Z,145.96001,146.24001,144.06,144.10001,133165120,-10.11039397\n2012-09-26T13:30:00Z,144.065,144.11,142.95,143.295,146502128,-7.320300193\n2012-09-27T13:30:00Z,143.89,144.97,143.50999,144.64,111830256,9.085778521\n2012-09-28T13:30:00Z,144.09,144.56,143.46001,143.97,150696064,-3.013886051\n2012-10-01T13:30:00Z,144.52,145.69,144.00819,144.345,135911120,1.59923566\n2012-10-02T13:30:00Z,144.92,145.14999,143.83,144.5,113422128,-0.36431414\n2012-10-03T13:30:00Z,144.89,145.42999,144.13,145.09,121283008,2.420142448\n2012-10-04T13:30:00Z,145.64,146.34,145.44,146.125,124311632,9.21875\n2012-10-05T13:30:00Z,146.91,147.16,145.7,146.14,124842064,-1.017613636\n2012-10-08T13:30:00Z,145.60001,146.12309,145.31,145.642,78415568,-3.424953713\n2012-10-09T13:30:00Z,145.53,145.64999,144.14999,144.2,148872816,-12.94276677\n2012-10-10T13:30:00Z,144.17999,144.32001,143.09,143.28,124247440,-7.559029422\n2012-10-11T13:30:00Z,144.28,144.49001,143.327,143.36,123601440,-3.241450298\n2012-10-12T13:30:00Z,143.46001,143.95,142.58,142.89,124181872,-3.001187109\n2012-10-15T13:30:00Z,143.23,144.23,142.77,144.08,107689056,7.695567753\n2012-10-16T13:30:00Z,144.75999,145.64,144.66,145.53999,108815440,13.56443676\n2012-10-17T13:30:00Z,145.64,146.32001,145.42,146.2,128834064,5.053210132\n2012-10-18T13:30:00Z,145.82001,146.52,145.33,145.82001,148108432,-0.981162124\n2012-10-19T13:30:00Z,145.55,145.56,143.05,143.3896,185645120,-23.02179543\n2012-10-22T13:30:00Z,143.14999,143.67,142.28,143.41,125578624,-1.400204562\n2012-10-23T13:30:00Z,141.86,142.06,140.83,141.42,192056320,-17.55738111\n2012-10-24T13:30:00Z,141.92999,142.10001,140.8,141.02,120179312,-2.908695018\n2012-10-25T13:30:00Z,142.02,142.28,140.57001,141.42999,134457312,-0.457311821\n2012-10-26T13:30:00Z,141.3,141.84,140.39,141.35001,146023440,-0.823842902\n2012-10-31T13:30:00Z,141.85001,142.03,140.67999,141.35001,103438496,-0.740800199\n2012-11-01T13:30:00Z,141.64999,143.00999,141.52,142.83,100995568,11.8701518\n2012-11-02T13:30:00Z,143.67999,143.72,141.41,141.56,137702128,-6.933029215\n2012-11-05T14:30:00Z,141.35001,142.17,140.92999,141.8486,98378432,0.017568796\n2012-11-06T14:30:00Z,142.28,143.52,142.13,142.96001,107068064,9.945913405\n2012-11-07T14:30:00Z,141.66,141.67999,139.06,139.72,264304432,-28.71001852\n2012-11-08T14:30:00Z,139.7,140.41,137.92999,138.03999,181517248,-11.30077723\n2012-11-09T14:30:00Z,137.62,139.44,137.55,138.16,201055184,-0.09487449\n2012-11-12T14:30:00Z,138.59,138.81,137.96001,138.265,97677440,0.31964157\n2012-11-13T14:30:00Z,137.53999,139.25,137.36,137.78999,123018192,-1.346832911\n2012-11-14T14:30:00Z,138.21001,138.42999,135.62,135.9299,191504944,-13.87006629\n2012-11-15T14:30:00Z,135.98,136.4901,135.17999,135.7,178128368,-2.343116632\n2012-11-16T14:30:00Z,135.89999,136.64,134.7,136.37,239483808,2.596408582\n2012-11-19T14:30:00Z,137.89999,139.14999,136.4057,139.13,151495744,21.07278925\n2012-11-20T14:30:00Z,138.91,139.42,138.08,139.19,119807376,2.021535722\n2012-11-21T14:30:00Z,139.31,139.57001,139.03,139.45,81710752,1.557392502\n2012-11-23T14:30:00Z,140.13,141.39999,140.03999,141.35001,65409152,18.35343374\n2012-11-26T14:30:00Z,140.64999,141.35629,140.19,141.05,100124320,1.010162621\n2012-11-27T14:30:00Z,140.91,141.39,140.24001,140.33,128646192,-3.685466488\n2012-11-28T14:30:00Z,139.75999,141.53999,139,141.46001,177086432,5.681065386\n2012-11-29T14:30:00Z,141.99001,142.50999,141.37,142.12,151085872,4.822165966\n2012-11-30T14:30:00Z,142.14,142.42,141.66,142.155,136568320,0.272073808\n2012-12-03T14:30:00Z,142.8,142.92,141.34,141.45,124656320,-4.426376283\n2012-12-04T14:30:00Z,141.44,141.87,140.87,141.25,127622496,-1.714252336\n2012-12-05T14:30:00Z,141.37,142.16,140.37,141.5,147300432,0.82797619\n2012-12-06T14:30:00Z,141.37,142.03999,141.16,141.98,103220560,3.023607279\n2012-12-07T14:30:00Z,142.53,142.69,141.67,142.41499,108726320,2.00580677\n2012-12-10T14:30:00Z,142.21001,142.81,142.14999,142.47301,98840688,0.576257873\n2012-12-11T14:30:00Z,143.06,144.11,142.99001,143.44,152570368,8.662052155\n2012-12-12T14:30:00Z,144,144.55,143.31,143.50999,145880000,-0.415808287\n2012-12-13T14:30:00Z,143.42,143.83,142.27499,142.63,135714944,-6.430292015\n2012-12-14T14:30:00Z,142.32001,142.58,141.88,142.1051,137701680,-4.216742886\n2012-12-17T14:30:00Z,142.47,143.85001,142.42999,143.77,143735744,15.07135662\n2012-12-18T14:30:00Z,144,145.5,143.78999,145.37,177762752,13.79978289\n2012-12-19T14:30:00Z,145.53,145.58,144.24001,144.28999,150895312,-5.698319064\n2012-12-20T14:30:00Z,144.38,145.14,143.98,145.12,168486944,3.216471039\n2012-12-21T14:30:00Z,142.17,144.0881,141.94,142.78999,245883808,-12.80108216\n2012-12-24T14:30:00Z,142.48,142.56,142.19,142.35001,53874544,-2.050639268\n2012-12-26T14:30:00Z,142.64,142.71001,141.35001,141.75,106947680,-4.836218288\n2012-12-27T14:30:00Z,141.78999,142.08,139.92,141.5616,167920560,-2.520786595\n2012-12-28T14:30:00Z,140.64,141.42,139.87,140.03,148806624,-11.93226453\n2012-12-31T14:30:00Z,139.66,142.56,139.53999,142.41,243952192,17.95566641\n2013-01-02T14:30:00Z,145.11,146.14999,144.73,146.06,192058944,34.42761469\n2013-01-03T14:30:00Z,145.99001,146.37,145.34,145.7341,144761744,-0.76812426\n2013-01-04T14:30:00Z,145.97,146.61,145.67,146.37,116817680,4.209051733\n2013-01-07T14:30:00Z,145.85001,146.4442,145.42999,145.9695,110002432,-1.269465067\n2013-01-08T14:30:00Z,145.71001,145.91,144.98,145.54961,121265056,-2.93849559\n2013-01-09T14:30:00Z,145.87,146.32001,145.64,145.92,90745568,2.235345843\n2013-01-10T14:30:00Z,146.73,147.09,145.97,147.08,130735376,8.512823974\n2013-01-11T14:30:00Z,147.03999,147.14999,146.61,147.07001,113917312,0.433118456\n2013-01-14T14:30:00Z,146.89,147.07001,146.42999,146.97,89567120,-0.324352825\n2013-01-15T14:30:00Z,146.28999,147.21001,146.2,147.07001,93172560,2.382958661\n2013-01-16T14:30:00Z,146.77,147.28,146.61,147.05,104849504,1.046965407\n2013-01-17T14:30:00Z,147.7,148.42,147.14461,148,133833440,7.193337378\n2013-01-18T14:30:00Z,147.97,148.49001,147.42999,148.33,169905936,1.836178272\n2013-01-22T14:30:00Z,148.33,149.13,147.98,149.13,111797312,5.201612903\n2013-01-23T14:30:00Z,149.13,149.5,148.86,149.37,104596064,1.541666667\n2013-01-24T14:30:00Z,149.14999,150.14,149.00999,149.41,146426320,0.930159463\n2013-01-25T14:30:00Z,149.88,150.25,149.3726,150.25,147211568,6.072260128\n2013-01-28T14:30:00Z,150.28999,150.33,149.50999,150.07001,113357632,-1.000928584\n2013-01-29T14:30:00Z,149.77,150.85001,149.67,150.66,105694368,3.868385654\n2013-01-30T14:30:00Z,150.64,150.94,149.92999,150.07001,137447632,-2.415399139\n2013-01-31T14:30:00Z,149.89,150.38,149.60001,149.7,108975808,-1.934501314\n2013-02-01T14:30:00Z,150.64999,151.42,150.39,151.24001,131173008,13.50849912\n2013-02-04T14:30:00Z,150.32001,151.2679,149.42999,149.535,159073568,-11.11089212\n2013-02-05T14:30:00Z,150.35001,151.48,150.28999,151.05,113912320,11.50138328\n2013-02-06T14:30:00Z,150.52,151.25999,150.41,151.16,138762752,2.360994646\n2013-02-07T14:30:00Z,151.205,151.35001,149.86,150.96001,162490000,-0.800110681\n2013-02-08T14:30:00Z,151.22,151.89,151.22,151.8,103133680,7.212833766\n2013-02-11T14:30:00Z,151.74001,151.89999,151.3938,151.77,73774944,0.506802632\n2013-02-12T14:30:00Z,151.78,152.3,151.61,152.02,65392608,1.792781291\n2013-02-13T14:30:00Z,152.33,152.61,151.72,152.151,82322560,0.393980263\n2013-02-14T14:30:00Z,151.69,152.47,151.52,152.28999,80834192,1.562969873\n2013-02-15T14:30:00Z,152.42999,152.59,151.55,152.11,215226432,-0.738388369\n2013-02-19T14:30:00Z,152.37,153.28,152.1629,153.25,95105376,8.96472616\n2013-02-20T14:30:00Z,153.14,153.19,151.25999,151.34,160574816,-14.77666932\n2013-02-21T14:30:00Z,150.96001,151.4218,149.94,150.42,183256944,-7.428327855\n2013-02-22T14:30:00Z,151.14999,151.89,150.4913,151.89,106356496,9.981639223\n2013-02-25T14:30:00Z,152.63,152.86,149,149,245824752,-20.18353631\n2013-02-26T14:30:00Z,149.72,150.2,148.73,150.02,186596192,0.82807571\n2013-02-27T14:30:00Z,149.89,152.33,149.75999,151.91,150781872,16.2387146\n2013-02-28T14:30:00Z,151.89999,152.87,151.41,151.61,126865936,0.183221374\n2013-03-01T14:30:00Z,151.09,152.34,150.41,152.11,170634752,3.511249702\n2013-03-04T14:30:00Z,151.75999,152.92,151.52,152.92,99010192,5.031926171\n2013-03-05T14:30:00Z,153.66,154.7,153.64,154.28999,121663056,12.8489496\n2013-03-06T14:30:00Z,154.84,154.92,154.16,154.5,94469872,0.847629694\n2013-03-07T14:30:00Z,154.7,154.98,154.52,154.776,86101312,1.237837838\n2013-03-08T14:30:00Z,155.46001,155.64999,154.66,155.44,123487632,3.643438612\n2013-03-11T13:30:00Z,155.325,156.03999,155.13,156.03,83746688,3.842170325\n2013-03-12T13:30:00Z,155.92,156.10001,155.21001,155.67999,105755680,-1.411983367\n2013-03-13T13:30:00Z,155.75999,156.12,155.23,155.905,92550880,0.70314453\n2013-03-14T13:30:00Z,156.31,156.8,155.90781,156.73,126329872,6.444410155\n2013-03-15T13:30:00Z,155.85001,156.03999,155.31,155.83,138601056,-6.054618346\n2013-03-18T13:30:00Z,154.34,155.64,154.2,154.97,126704256,-3.638403489\n2013-03-19T13:30:00Z,155.3,155.50999,153.59,154.61,167567248,-2.273025382\n2013-03-20T13:30:00Z,155.52,155.95,155.25999,155.69,113759248,6.99970737\n2013-03-21T13:30:00Z,154.75999,155.6389,154.10001,154.35899,128604944,-9.208149534\n2013-03-22T13:30:00Z,154.85001,155.60001,154.73,155.60001,111163504,10.17237979\n2013-03-25T13:30:00Z,156.00999,156.27,154.35001,154.95,151322256,-3.679232315\n2013-03-26T13:30:00Z,155.59,156.23,155.42,156.19,86856560,7.786289668\n2013-03-27T13:30:00Z,155.25999,156.245,155,156.19,99950560,3.278924507\n2013-03-28T13:30:00Z,156.09,156.85001,155.75,156.67,102932816,3.103449663\n2013-04-01T13:30:00Z,156.59,156.91,155.67,156.05,99194064,-3.361913357\n2013-04-02T13:30:00Z,156.61,157.21001,156.37,156.82001,101504320,4.726967164\n2013-04-03T13:30:00Z,156.91,157.03,154.82001,155.23,154167312,-13.1354441\n2013-04-04T13:30:00Z,155.42999,156.17,155.09,155.86,131884944,1.664602917\n2013-04-05T13:30:00Z,153.95,155.35001,153.77,155.158,159665936,0.063900091\n2013-04-08T13:30:00Z,155.27,156.22,154.75,156.21001,86571120,6.832336096\n2013-04-09T13:30:00Z,156.5,157.32001,155.98,156.75,101922128,3.964221216\n2013-04-10T13:30:00Z,157.17,158.87,157.13,158.67,135711008,18.17095358\n2013-04-11T13:30:00Z,158.7,159.71001,158.53999,159.19,110142496,4.796100536\n2013-04-12T13:30:00Z,158.67999,159.03999,157.92,158.8,116359808,-1.250093217\n2013-04-15T13:30:00Z,158,158.13,155.10001,155.118,217258944,-34.69087159\n2013-04-16T13:30:00Z,156.28999,157.49001,155.91,157.41,147507808,11.71873824\n2013-04-17T13:30:00Z,156.28999,156.32001,154.28,155.11,226834752,-17.82123722\n2013-04-18T13:30:00Z,155.37,155.41,153.55,154.14,167583120,-8.505799021\n2013-04-19T13:30:00Z,154.5,155.55,154.12,155.48,149687568,7.722032374\n2013-04-22T13:30:00Z,155.78,156.53999,154.75,156.17,106553440,3.678730301\n2013-04-23T13:30:00Z,156.95,157.92999,156.17,157.78,166141248,12.56930984\n2013-04-24T13:30:00Z,157.83,158.3,157.53999,157.88,96781184,1.11691352\n2013-04-25T13:30:00Z,158.34,159.27,158.10001,158.52,131060560,4.990710796\n2013-04-26T13:30:00Z,158.33,158.60001,157.73,158.24001,95918752,-1.510831507\n2013-04-29T13:30:00Z,158.67,159.64999,158.42,159.3,88572688,8.878083025\n2013-04-30T13:30:00Z,159.27,159.72,158.61,159.67999,116010624,2.526206361\n2013-05-01T13:30:00Z,159.33,159.41,158.10001,158.28,138874128,-11.62978297\n2013-05-02T13:30:00Z,158.67999,159.89,158.53,159.75,96407568,10.03373766\n2013-05-03T13:30:00Z,161.14,161.88,159.782,161.368,144202256,11.17713588\n2013-05-06T13:30:00Z,161.49001,162.00999,161.42,161.78,66882064,3.660703076\n2013-05-07T13:30:00Z,162.13,162.64999,161.67,162.5999,90359184,5.824184679\n2013-05-08T13:30:00Z,162.42,163.39,162.33,163.34,97419184,5.525679991\n2013-05-09T13:30:00Z,163.27,163.7,162.47,162.881,106738560,-1.577247432\n2013-05-10T13:30:00Z,162.99001,163.5498,162.50999,163.41,103202880,2.359149121\n2013-05-13T13:30:00Z,163.2,163.81,162.82001,163.53999,81843184,1.363803383\n2013-05-14T13:30:00Z,163.67,165.35001,163.67,165.23,119000816,15.79434114\n2013-05-15T13:30:00Z,164.96001,166.45,164.91,166.11501,120718432,7.318854275\n2013-05-16T13:30:00Z,165.78,166.36,165.09,165.34,109913568,-2.902660636\n2013-05-17T13:30:00Z,165.95,167.03999,165.73,166.94,129801008,13.05921457\n2013-05-20T13:30:00Z,166.78,167.58,166.61,166.92999,85071184,1.026644764\n2013-05-21T13:30:00Z,167.08,167.8,166.5,167.17,95804192,1.311146143\n2013-05-22T13:30:00Z,167.34,169.07001,165.17,165.92999,244031744,-6.126545885\n2013-05-23T13:30:00Z,164.16,165.91,163.94,165.45,211064320,-0.999755091\n2013-05-24T13:30:00Z,164.47,165.38049,163.98,165.308,151573872,3.133506993\n2013-05-28T13:30:00Z,167.03999,167.78,165.81,166.3,143679744,5.28564174\n2013-05-29T13:30:00Z,165.42,165.8,164.34,165.22,160363312,-8.823874108\n2013-05-30T13:30:00Z,165.35001,166.59,165.22,165.83,107793744,4.823913512\n2013-05-31T13:30:00Z,165.37,166.31,163.13,163.44501,176850000,-16.50420995\n2013-06-03T13:30:00Z,163.83,164.46001,162.6599,164.35001,168390688,1.901318246\n2013-06-04T13:30:00Z,164.44,165.10001,162.73,163.56,157631440,-4.4550356\n2013-06-05T13:30:00Z,163.09,163.42,161.13,161.272,211737680,-20.11460756\n2013-06-06T13:30:00Z,161.2,162.74001,160.25,162.73,200225440,5.510627585\n2013-06-07T13:30:00Z,163.85001,164.95,163.14,164.8,188337744,16.94222862\n2013-06-10T13:30:00Z,165.31,165.39999,164.37,164.8,105667056,-0.051782192\n2013-06-11T13:30:00Z,163.3,164.53999,162.739,163.09801,159505376,-12.0802139\n2013-06-12T13:30:00Z,164.22,164.39,161.60001,161.75,177363504,-8.68027547\n2013-06-13T13:30:00Z,161.66,164.5,161.3,164.21001,163587744,14.03596308\n2013-06-14T13:30:00Z,164.03,164.67,162.91,163.175,141197440,-2.795925135\n2013-06-17T13:30:00Z,164.28999,165.22,163.21919,164.44,136295568,6.435926291\n2013-06-18T13:30:00Z,164.53,165.99001,164.52,165.735,114695504,12.11328352\n2013-06-19T13:30:00Z,165.60001,165.89,163.38,163.45,206149440,-16.0146021\n2013-06-20T13:30:00Z,161.86,163.4668,158.98,159.39999,321255936,-32.34815084\n2013-06-21T13:30:00Z,159.64,159.75999,157.47,159.07001,271956736,-5.107251299\n2013-06-24T13:30:00Z,157.41,158.42999,155.73,157.06,222334752,-15.36344757\n2013-06-25T13:30:00Z,158.48,160.10001,157.42,158.575,162262128,9.508056694\n2013-06-26T13:30:00Z,159.87,160.5,159.25,160.14,134847936,12.87129073\n2013-06-27T13:30:00Z,161.10001,161.82001,160.95,161.08,129483680,7.801625197\n2013-06-28T13:30:00Z,160.63,161.39999,159.86,160.42,160402816,-3.800192598\n2013-07-01T13:30:00Z,161.25999,162.48,161.08,161.36,131954816,6.77159993\n2013-07-02T13:30:00Z,161.12,162.3,160.5,161.21001,154863632,-0.257477558\n2013-07-03T13:30:00Z,160.48,161.77,160.22,161.28,75216320,1.937884439\n2013-07-05T13:30:00Z,162.47,163.08,161.3,163.02,122416880,12.52198492\n2013-07-08T13:30:00Z,163.86,164.39,163.0838,163.94501,108092432,6.41209741\n2013-07-09T13:30:00Z,164.98,165.33,164.27,165.13,119297872,8.917143804\n2013-07-10T13:30:00Z,164.97,165.75,164.63,165.192,121410368,0.704697624\n2013-07-11T13:30:00Z,167.11,167.61,165.1774,167.44,135592192,14.99345133\n2013-07-12T13:30:00Z,167.39,167.9332,167.13,167.50999,104212624,0.739511135\n2013-07-15T13:30:00Z,167.97,168.39,167.67999,168.155,69450560,5.116728295\n2013-07-16T13:30:00Z,168.25999,168.36,167.07001,167.52499,88702064,-4.827480409\n2013-07-17T13:30:00Z,168.16,168.48,167.73,167.9501,92873872,0.785719454\n2013-07-18T13:30:00Z,168.31,169.27,168.2,168.87,103620256,7.588062697\n2013-07-19T13:30:00Z,168.52,169.23,168.31,169.17,103831632,2.525943396\n2013-07-22T13:30:00Z,169.41,169.74001,169.00999,169.5,79428560,2.145472756\n2013-07-23T13:30:00Z,169.8,169.83,169.05,169.14,80829632,-2.339369159\n2013-07-24T13:30:00Z,169.78999,169.86,168.17999,168.52,112914000,-4.617892992\n2013-07-25T13:30:00Z,168.22,169.08,167.94,168.92999,111156560,1.112963959\n2013-07-26T13:30:00Z,168.22,169.16,167.52,169.11,107814496,3.891090462\n2013-07-29T13:30:00Z,168.67999,169.06,168.11,168.59,79845120,-1.787552192\n2013-07-30T13:30:00Z,169.10001,169.28,168.19,168.588,85216944,-1.087343595\n2013-07-31T13:30:00Z,168.94,169.85001,168.49001,168.71001,142388624,-0.641327194\n2013-08-01T13:30:00Z,169.99001,170.81,169.89999,170.66,110438368,18.71083584\n2013-08-02T13:30:00Z,170.28,170.9725,170.05,170.95,91116624,2.771929953\n2013-08-05T13:30:00Z,170.57001,170.96001,170.35001,170.7,54072640,-0.084427853\n2013-08-06T13:30:00Z,170.37,170.7402,169.35001,169.73,87494944,-7.45778588\n2013-08-07T13:30:00Z,169.19,169.42999,168.55,169.17999,84854624,-4.43130906\n2013-08-08T13:30:00Z,169.98,170.17999,168.92999,169.8,102181248,2.6322677\n2013-08-09T13:30:00Z,169.58,170.10001,168.72,169.31,91856432,-3.173661939\n2013-08-12T13:30:00Z,168.46001,169.31,168.38,169.11099,68593184,0.343680451\n2013-08-13T13:30:00Z,169.41,169.89999,168.41,169.61,80806000,2.272841287\n2013-08-14T13:30:00Z,169.53,169.8,168.7,168.74001,79829184,-6.008893207\n2013-08-15T13:30:00Z,167.41,167.42999,166.09,166.38,152931744,-23.21033319\n2013-08-16T13:30:00Z,166.06,166.63,165.5,165.83,130868128,-3.656756757\n2013-08-19T13:30:00Z,165.64,166.21001,164.75999,164.77,96437568,-6.88709986\n2013-08-20T13:30:00Z,165.03999,166.2,164.86,165.58,89294368,4.8103828\n2013-08-21T13:30:00Z,165.12,166.03,164.19,164.56,159530496,-5.124507833\n2013-08-22T13:30:00Z,164.89999,166.3,164.89,166.06,101471376,12.30178098\n2013-08-23T13:30:00Z,166.55,166.83,165.77,166.62,90893568,3.154864181\n2013-08-26T13:30:00Z,166.78999,167.3,165.89,166,89705056,-3.188140762\n2013-08-27T13:30:00Z,164.36,166.0024,163.21001,163.33,158621744,-19.72719333\n2013-08-28T13:30:00Z,163.25999,164.49001,163.05,163.91,108112944,2.765492821\n2013-08-29T13:30:00Z,163.55,165.03999,163.39999,164.17,119200432,2.870039362\n2013-08-30T13:30:00Z,164.50999,164.53,163.17,163.64999,134928944,-3.279744224\n2013-09-03T13:30:00Z,165.23,165.58,163.7,164.39,142375056,0.597493727\n2013-09-04T13:30:00Z,164.42999,166.03,164.13499,165.75,97389376,8.81352167\n2013-09-05T13:30:00Z,165.85001,166.39999,165.73,165.96001,63090432,2.417219222\n2013-09-06T13:30:00Z,166.50999,166.98,164.48,166.03999,159756432,-0.466693559\n2013-09-09T13:30:00Z,166.45,167.73,166.45,167.634,87559248,13.63413291\n2013-09-10T13:30:00Z,168.64,168.89999,168.25999,168.87,105847744,10.43381644\n2013-09-11T13:30:00Z,168.64,169.39999,168.35001,169.39999,94545808,2.893716902\n2013-09-12T13:30:00Z,169.34,169.56,168.72,168.95,83209008,-1.877373186\n2013-09-13T13:30:00Z,169.13,169.46001,168.74001,169.33,72727744,1.491428326\n2013-09-16T13:30:00Z,171.16,171.24001,170.03999,170.31,126187504,4.499786801\n2013-09-17T13:30:00Z,170.46001,171.11,170.46001,171.07001,82523184,4.546744249\n2013-09-18T13:30:00Z,171.00999,173.52,170.58,173.05099,203460624,15.6168542\n2013-09-19T13:30:00Z,173.52,173.60001,172.58501,172.75999,146616816,-0.361652639\n2013-09-20T13:30:00Z,172.33,172.33,170.58,170.72,132867936,-19.18869192\n2013-09-23T13:30:00Z,170.49001,170.64999,169.39,169.92999,104616432,-7.210815054\n2013-09-24T13:30:00Z,169.89999,170.53,169.21001,169.53,106333008,-2.234503801\n2013-09-25T13:30:00Z,169.64,169.98,168.89,169.03999,117306496,-2.98524944\n2013-09-26T13:30:00Z,169.32001,170.17,169.05,169.69,77146880,3.794387852\n2013-09-27T13:30:00Z,168.84,169.14,168.47,168.909,99141680,-4.80653598\n2013-09-30T13:30:00Z,167.48,168.53999,167.14999,168.00999,143937376,-4.259825643\n2013-10-01T13:30:00Z,168.14,169.5,167.9671,169.34,127160432,11.53312047\n2013-10-02T13:30:00Z,168.35001,169.34219,167.83,169.17999,113349744,2.890217775\n2013-10-03T13:30:00Z,168.78999,168.94,166.84,167.62,176698432,-11.67282673\n2013-10-04T13:30:00Z,167.75,169.06,167.53,168.89,96878368,7.641998137\n2013-10-07T13:30:00Z,167.42,168.45,167.25,167.42999,96295120,-7.033814516\n2013-10-08T13:30:00Z,167.39999,167.62,165.36,165.48,178014944,-16.62562624\n2013-10-09T13:30:00Z,165.8,166.2,164.53,165.60001,168972816,-1.270301986\n2013-10-10T13:30:00Z,167.28999,169.25999,167.23,169.17,195954752,35.24093334\n2013-10-11T13:30:00Z,168.91,170.32001,168.77,170.25999,105039744,7.952481652\n2013-10-14T13:30:00Z,169.21001,171.08,169.08,170.94,112106368,5.939402408\n2013-10-15T13:30:00Z,170.50999,171.14999,169.47,169.7,155484496,-5.273319147\n2013-10-16T13:30:00Z,170.72,172.16,170.63499,172.07001,161676064,19.91054979\n2013-10-17T13:30:00Z,171.37,173.32001,171.34,173.22,129389184,8.132684357\n2013-10-18T13:30:00Z,173.86,174.50999,173.50999,174.388,138315680,9.501919349\n2013-10-21T13:30:00Z,174.45,174.75,174.00999,174.39999,104103568,0.322369582\n2013-10-22T13:30:00Z,174.91,175.92999,174.42619,175.41,126663248,7.799967941\n2013-10-23T13:30:00Z,174.81,174.89,173.96001,174.57001,105484368,-5.754415909\n2013-10-24T13:30:00Z,174.92,175.37,174.50999,175.14999,70350432,3.450893405\n2013-10-25T13:30:00Z,175.50999,176,175.17,175.95,93625056,6.37809087\n2013-10-28T13:30:00Z,175.89,176.47,175.7,176.23,84979018,2.068185176\n2013-10-29T13:30:00Z,176.63,177.24,176.38,177.17,87401344,8.01439951\n2013-10-30T13:30:00Z,177.38,177.51,175.66,176.29,140001834,-6.133186398\n2013-10-31T13:30:00Z,176.15,176.89,175.53,175.79,133795417,-2.77143951\n2013-11-01T13:30:00Z,176.02,176.61,175.22,176.21,142805050,1.471706081\n2013-11-04T14:30:00Z,176.69,176.9,175.9825,176.83,85676773,3.295822539\n2013-11-05T14:30:00Z,176.14,176.75,175.57,176.27,85824778,-2.886454183\n2013-11-06T14:30:00Z,177.03,177.5,176.54,177.17,87347728,6.835227273\n2013-11-07T14:30:00Z,177.5,177.64,174.76,174.93,157000422,-18.03366209\n2013-11-08T14:30:00Z,174.87,177.31,174.85,177.29,136712623,14.0359589\n2013-11-11T14:30:00Z,177.12,177.53,176.91,177.32,62614326,1.425\n2013-11-12T14:30:00Z,176.94,177.36,176.37,176.96,83989617,-1.712740385\n2013-11-13T14:30:00Z,176.09,178.4261,176.09,178.38,103844266,10.05904543\n2013-11-14T14:30:00Z,178.54,179.42,178.25,179.27,103435238,6.817073171\n2013-11-15T14:30:00Z,179.56,180.12,179.33,180.05,102818190,6.398846633\n2013-11-18T14:30:00Z,180.35,180.5,179.02,179.42,104796009,-3.906688768\n2013-11-19T14:30:00Z,179.33,179.87,178.72,179.03,93891416,-2.444620253\n2013-11-20T14:30:00Z,179.39,179.93,177.98,178.47,124908601,-3.548611111\n2013-11-21T14:30:00Z,178.97,180.05,178.86,179.91,92841271,10.27244582\n2013-11-22T14:30:00Z,179.98,180.83,179.77,180.81,81295887,6.882239382\n2013-11-25T14:30:00Z,181.13,181.17,180.37,180.63,79485709,-0.607320099\n2013-11-26T14:30:00Z,180.72,181.22,180.405,180.68,86993560,-0.372672872\n2013-11-27T14:30:00Z,180.87,181.24,180.65,181.12,58800056,3.2375\n2013-11-29T14:30:00Z,181.32,181.75,180.8,181,55870903,-0.845833333\n2013-12-02T14:30:00Z,181.09,181.43,180.25,180.53,99725781,-3.087797619\n2013-12-03T14:30:00Z,179.94,180.39,179.17,179.75,116563302,-6.033216783\n2013-12-04T14:30:00Z,179.1,180.48,178.35,179.73,123032637,0.994546498\n2013-12-05T14:30:00Z,179.41,179.74,178.7701,178.94,106934067,-4.616336538\n2013-12-06T14:30:00Z,180.67,181.11,180.15,180.94,127727518,16.26290862\n2013-12-09T14:30:00Z,181.47,181.67,181.16,181.4,70123608,3.268409091\n2013-12-10T14:30:00Z,180.98,181.36,180.635,180.75,80976207,-4.906659836\n2013-12-11T14:30:00Z,180.81,180.85,178.5,178.72,130590810,-18.29731308\n2013-12-12T14:30:00Z,178.64,178.86,177.76,178.13,115564840,-5.057010786\n2013-12-13T14:30:00Z,178.5,178.66,177.77,178.11,107807610,-1.115018428\n2013-12-16T14:30:00Z,178.95,179.81,178.9,179.216,96194790,8.647727273\n2013-12-17T14:30:00Z,179.36,179.41,178.25,178.65,89886224,-4.206313698\n2013-12-18T14:30:00Z,178.92,181.73,177.32,181.7,234906482,17.88623978\n2013-12-19T14:30:00Z,181.19,181.7,180.71,181.49,136298872,2.331787834\n2013-12-20T14:30:00Z,180.67,181.99,180.5683,181.56,197086908,2.270841685\n2013-12-23T14:30:00Z,182.41,182.64,182.065,182.53,85597541,8.051785714\n2013-12-24T14:30:00Z,182.54,183.01,182.53,182.93,45368841,3.676470588\n2013-12-26T14:30:00Z,183.34,183.96,183.32,183.855,63365227,8.836461126\n2013-12-27T14:30:00Z,184.1,184.18,183.66,183.845,61813841,-0.027396435\n2013-12-30T14:30:00Z,183.87,184.02,183.58,183.82,56857458,-0.373991935\n2013-12-31T14:30:00Z,184.07,184.69,183.93,184.69,86247638,7.671638973\n2014-01-02T14:30:00Z,183.98,184.07,182.48,182.92,119636836,-14.41742701\n2014-01-03T14:30:00Z,183.21,183.6,182.63,182.885,81390502,-1.59159919\n2014-01-06T14:30:00Z,183.47,183.56,182.08,182.36,108028139,-3.742218775\n2014-01-07T14:30:00Z,183.09,183.79,182.95,183.48,86144169,6.564712389\n2014-01-08T14:30:00Z,183.45,183.83,182.89,183.52,96582234,0.61310241\n2014-01-09T14:30:00Z,184.1,184.13,182.795,183.64,90683302,-0.309900647\n2014-01-10T14:30:00Z,183.95,184.22,183.01,184.14,102026318,1.426415094\n2014-01-13T14:30:00Z,183.71,184.18,181.34,181.685,149891938,-20.72727273\n2014-01-14T14:30:00Z,182.28,183.77,181.95,183.67,105016055,11.52076449\n2014-01-15T14:30:00Z,184.1,184.94,183.7102,184.66,98525721,8.037377144\n2014-01-16T14:30:00Z,184.28,184.6618,183.83,184.42,72290520,-0.160140976\n2014-01-17T14:30:00Z,184.1,184.45,183.32,183.635,107848616,-5.798015021\n2014-01-21T14:30:00Z,184.7,184.77,183.05,184.18,88621138,0.651910313\n2014-01-22T14:30:00Z,184.49,184.57,183.91,184.3,61270816,-0.323971519\n2014-01-23T14:30:00Z,183.36,183.4,181.82,182.79,132496880,-13.74669073\n2014-01-24T14:30:00Z,181.6,181.66,178.83,178.89,208677093,-37.76342756\n2014-01-27T14:30:00Z,179.06,179.52,177.12,178.01,180843004,-7.485834687\n2014-01-28T14:30:00Z,178.14,179.3,178.12,179.07,110463152,6.797266277\n2014-01-29T14:30:00Z,177.56,178.55,176.88,177.35,216597269,-10.07969653\n2014-01-30T14:30:00Z,178.86,179.81,178.26,179.23,118938051,15.03873026\n2014-01-31T14:30:00Z,177.02,179.29,176.92,178.18,194677861,-2.213261421\n2014-02-03T14:30:00Z,177.95,178.37,173.83,174.17,254837004,-31.57802795\n2014-02-04T14:30:00Z,174.95,175.84,174.1055,175.385,165012351,1.898966692\n2014-02-05T14:30:00Z,174.79,175.56,173.71,175.17,164230470,0.447610881\n2014-02-06T14:30:00Z,175.58,177.48,175.2209,177.48,132877526,20.35587086\n2014-02-07T14:30:00Z,178.31,179.87,177.73,179.68,170787197,18.31751825\n2014-02-10T14:30:00Z,179.7,180.07,179.21,180.01,92218729,2.021439709\n2014-02-11T14:30:00Z,180.16,182.439,180.0389,181.98,117814009,18.01671189\n2014-02-12T14:30:00Z,182.22,182.83,181.705,182.07,94717638,1.580300633\n2014-02-13T14:30:00Z,180.84,183.2,180.83,183.01,100542155,6.397975078\n2014-02-14T14:30:00Z,182.84,184.36,182.67,184.02,96498305,8.097354423\n2014-02-18T14:30:00Z,184.19,184.49,183.65,184.24,80460878,1.397577093\n2014-02-19T14:30:00Z,183.76,184.95,182.87,183.02,126524261,-6.455122461\n2014-02-20T14:30:00Z,183.27,184.52,182.6,184.1,104998099,5.83432304\n2014-02-21T14:30:00Z,184.49,184.89,183.8,183.89,118116359,-1.151131985\n2014-02-24T14:30:00Z,184.28,186.15,184.2,184.91,114063868,7.42267184\n2014-02-25T14:30:00Z,185.03,185.59,184.23,184.84,117084901,-0.021004942\n2014-02-26T14:30:00Z,185.11,185.6,184.33,184.85,98677144,-0.603889943\n2014-02-27T14:30:00Z,184.59,185.87,184.37,185.82,93880780,6.191693291\n2014-02-28T14:30:00Z,185.79,187.15,185.05,186.29,150842000,3.547702492\n2014-03-03T14:30:00Z,184.69,185.45,183.75,184.98,167748455,-7.354120267\n2014-03-04T14:30:00Z,186.75,187.98,186.75,187.58,167545852,26.46428571\n2014-03-05T14:30:00Z,187.72,188.07,187.45,187.75,88376859,1.45260574\n2014-03-06T14:30:00Z,188.21,188.61,187.7796,188.18,82516500,2.6632315\n2014-03-07T14:30:00Z,188.87,188.96,187.43,188.26,114513432,-0.737195122\n2014-03-10T13:30:00Z,187.94,188.23,187.08,188.16,74939176,-0.797675522\n2014-03-11T13:30:00Z,188.44,188.71,186.8,187.23,99009013,-6.402035623\n2014-03-12T13:30:00Z,186.32,187.35,185.9,187.28,104824323,1.079083452\n2014-03-13T13:30:00Z,187.84,187.99,184.66,185.18,155014237,-14.6320028\n2014-03-14T13:30:00Z,184.8,185.8,184.44,184.66,153919598,-2.866358025\n2014-03-17T13:30:00Z,185.59,186.77,185.51,186.33,98359454,15.37263808\n2014-03-18T13:30:00Z,186.71,187.91,186.51,187.66,101804519,11.73208955\n2014-03-19T13:30:00Z,187.7,187.94,185.47,186.66,176267253,-6.483552632\n2014-03-20T13:30:00Z,186.25,187.89,185.92,187.747,117240972,5.431235987\n2014-03-21T13:30:00Z,187.72,189.0239,186.03,186.2,163127905,-6.157927479\n2014-03-24T13:30:00Z,186.82,187.07,184.62,185.43,121411145,-6.437941696\n2014-03-25T13:30:00Z,186.37,186.94,185.27,186.31,103851737,2.350604089\n2014-03-26T13:30:00Z,187.03,187.34,184.92,184.97,119842897,-8.50911191\n2014-03-27T13:30:00Z,184.77,185.34,183.9,184.58,142382757,-3.420716113\n2014-03-28T13:30:00Z,185.105,186.42,185,185.49,101641547,7.232488823\n2014-03-31T13:30:00Z,186.65,187.3,185.5216,187.01,99744911,10.74880485\n2014-04-01T13:30:00Z,187.62,188.36,187.0015,188.25,89193125,9.582110804\n2014-04-02T13:30:00Z,188.5,189.13,188.14,188.88,78773818,4.685185185\n2014-04-03T13:30:00Z,189.17,189.22,188.05,188.63,77435320,-1.742835968\n2014-04-04T13:30:00Z,189.64,189.7,186.1,186.4,169380705,-16.87090027\n2014-04-07T13:30:00Z,185.9,186.26,183.96,184.34,140802699,-17.50393082\n2014-04-08T13:30:00Z,184.21,185.4,183.59,185.1,112659755,2.454261364\n2014-04-09T13:30:00Z,185.6,187.15,185.06,187.09,100253612,16.38614865\n2014-04-10T13:30:00Z,187.09,187.17,182.93,183.155,172959331,-31.17181572\n2014-04-11T13:30:00Z,182.17,183.42,181.31,181.51,167250792,-11.02806818\n2014-04-14T13:30:00Z,182.93,183.37,181.44,182.9401,132381601,7.047968377\n2014-04-15T13:30:00Z,183.32,184.33,181.51,184.2,157092533,5.391090408\n2014-04-16T13:30:00Z,185.47,186.14,184.65,186.125,105196633,15.49305556\n2014-04-17T13:30:00Z,185.88,186.91,185.56,186.39,105254649,2.216117878\n2014-04-21T13:30:00Z,186.44,187.1,186.21,187.04,68329343,4.699170762\n2014-04-22T13:30:00Z,187.23,188.4,187.13,187.89,85790307,7.716723549\n2014-04-23T13:30:00Z,187.81,187.92,187.3,187.45,73869384,-2.137340764\n2014-04-24T13:30:00Z,188.37,188.39,186.93,187.83,88169916,0.075806452\n2014-04-25T13:30:00Z,187.21,187.33,185.87,186.29,100380205,-14.17547425\n2014-04-28T13:30:00Z,187.05,187.69,184.96,186.875,135121094,0.790751689\n2014-04-29T13:30:00Z,187.48,188.04,187.08,187.75,84097551,6.359781073\n2014-04-30T13:30:00Z,187.44,188.5,187.18,188.31,101507717,3.589527027\n2014-05-01T13:30:00Z,188.22,188.84,187.73,188.325,93019095,0.778248588\n2014-05-02T13:30:00Z,188.31,189.14,187.78,188.06,98121662,-1.336592651\n2014-05-05T13:30:00Z,187.14,188.55,186.62,188.42,75882739,4.234629862\n2014-05-06T13:30:00Z,188,188.13,186.74,186.78,85454226,-10.9245283\n2014-05-07T13:30:00Z,187.43,187.97,186.01,187.88,106500480,3.349337748\n2014-05-08T13:30:00Z,187.67,189.05,187.08,187.675,93617513,-0.316026411\n2014-05-09T13:30:00Z,187.69,188.04,186.83,187.96,83678568,1.836719556\n2014-05-12T13:30:00Z,188.76,189.88,187.9992,189.785,86940045,14.66537934\n2014-05-13T13:30:00Z,190.03,190.42,189.77,189.96,66453965,1.735301724\n2014-05-14T13:30:00Z,189.79,189.88,188.79,189.06,72366848,-8.172794118\n2014-05-15T13:30:00Z,188.67,188.72,186.48,187.4,154956399,-15.40971553\n2014-05-16T13:30:00Z,187.51,188.13,186.72,188.05,97457678,1.591262663\n2014-05-19T13:30:00Z,187.69,188.89,187.52,188.74,63839398,4.709302326\n2014-05-20T13:30:00Z,188.645,188.67,187.07,187.55,111644478,-8.113471673\n2014-05-21T13:30:00Z,188.1,189.22,188.06,189.13,89093285,11.25643042\n2014-05-22T13:30:00Z,189.18,189.98,188.86,189.59,61549345,3.557735935\n2014-05-23T13:30:00Z,189.75,190.48,189.5858,190.35,60156088,6.487816043\n2014-05-27T13:30:00Z,191.05,191.58,190.95,191.52,72010355,11.06857639\n2014-05-28T13:30:00Z,191.52,191.82,191.06,191.38,66722865,-0.303062678\n2014-05-29T13:30:00Z,191.82,192.4,191.33,192.37,64376573,7.096153846\n2014-05-30T13:30:00Z,192.19,192.8,192.03,192.68,76315640,2.050792011\n2014-06-02T13:30:00Z,192.95,192.99,191.97,192.895,64655648,1.20404814\n2014-06-03T13:30:00Z,192.4,192.9,192.25,192.8,65047193,0.554201977\n2014-06-04T13:30:00Z,192.47,193.3,192.265,193.19,55529372,2.504129956\n2014-06-05T13:30:00Z,193.41,194.65,192.7,194.45,92102592,8.396713615\n2014-06-06T13:30:00Z,194.87,195.43,194.78,195.375,78696219,8.190406977\n2014-06-09T13:30:00Z,195.35,196.05,195.17,195.58,65118828,1.870923913\n2014-06-10T13:30:00Z,195.33,195.64,194.92,195.6,57129440,1.127411576\n2014-06-11T13:30:00Z,194.9,195.12,194.48,194.92,68772479,-4.451187335\n2014-06-12T13:30:00Z,194.65,194.8,193.11,193.54,106350200,-12.44052707\n2014-06-13T13:30:00Z,193.9,194.32,193.3,194.13,82017278,1.606213873\n2014-06-16T13:30:00Z,193.89,194.7,193.66,194.29,87424332,1.355210706\n2014-06-17T13:30:00Z,194.02,194.97,193.81,194.83,84833876,3.524801587\n2014-06-18T13:30:00Z,194.83,196.37,194.4,196.255,105266767,10.36708861\n2014-06-19T13:30:00Z,196.43,196.6,195.8,196.48,85928920,1.491047297\n2014-06-20T13:30:00Z,196.03,196.1039,195.7,195.94,100587108,-4.617317396\n2014-06-23T13:30:00Z,195.97,196.05,195.52,195.88,70611486,-0.605769231\n2014-06-24T13:30:00Z,195.53,196.5,194.48,194.7,96236917,-6.929314565\n2014-06-25T13:30:00Z,194.25,195.781,194.25,195.58,82781912,5.197862741\n2014-06-26T13:30:00Z,195.61,195.63,194.13,195.44,84311822,0.531633697\n2014-06-27T13:30:00Z,194.98,195.88,194.885,195.82,71453616,2.532605422\n2014-06-30T13:30:00Z,195.7,196.165,195.53,195.72,70504228,0.306213018\n2014-07-01T13:30:00Z,196.19,197.63,196.13,197.03,90470121,12.11202485\n2014-07-02T13:30:00Z,197.05,197.48,196.96,197.23,52474832,1.926369863\n2014-07-03T13:30:00Z,197.79,198.29,197.64,198.2,52938832,8.980555556\n2014-07-07T13:30:00Z,197.82,197.98,197.22,197.51,61696447,-4.676413882\n2014-07-08T13:30:00Z,197.15,197.22,195.76,196.24,108142552,-11.71758915\n2014-07-09T13:30:00Z,196.73,197.295,196.31,197.12,72992322,4.479521543\n2014-07-10T13:30:00Z,195.22,196.86,195.06,196.34,99040407,-0.777897657\n2014-07-11T13:30:00Z,196.22,196.75,195.78,196.61,64243410,2.086\n2014-07-14T13:30:00Z,197.61,197.86,197.44,197.6,58657919,9.069202413\n2014-07-15T13:30:00Z,197.72,198.1,196.36,197.23,111346230,-2.746413199\n2014-07-16T13:30:00Z,198.11,198.26,197.42,197.96,80073242,3.241578014\n2014-07-17T13:30:00Z,197.35,198.1,195.43,195.71,145398459,-18.14860342\n2014-07-18T13:30:00Z,196.35,197.91,196.24,197.7099,124330419,13.30935501\n2014-07-21T13:30:00Z,197.09,197.5,196.43,197.34,67591618,0.502031835\n2014-07-22T13:30:00Z,198.01,198.56,197.87,198.2,67677602,7.625\n2014-07-23T13:30:00Z,198.495,198.85,198.1,198.64,65611830,2.852664577\n2014-07-24T13:30:00Z,198.83,199.06,198.45,198.65,56888093,-0.17770793\n2014-07-25T13:30:00Z,198.09,198.26,197.33,197.72,76837257,-8.179487179\n2014-07-28T13:30:00Z,197.76,198.09,196.62,197.8,69258785,0.033\n2014-07-29T13:30:00Z,198.17,198.45,196.92,196.95,80466351,-5.178571429\n2014-07-30T13:30:00Z,197.65,197.91,196.16,196.98,104222452,-1.781021898\n2014-07-31T13:30:00Z,195.61,195.78,192.97,193.09,183479441,-37.25222746\n2014-08-01T13:30:00Z,192.56,193.76,191.57,192.5,189260864,-4.210992908\n2014-08-04T13:30:00Z,192.87,194.3,192.05,193.89,91340487,9.362582781\n2014-08-05T13:30:00Z,193.1,193.6,191.31,192.01,152690379,-13.00789963\n2014-08-06T13:30:00Z,191.11,192.89,191.08,192.07,94818317,0.746623649\n2014-08-07T13:30:00Z,192.935,193.13,190.55,191.03,135733421,-5.903812057\n2014-08-08T13:30:00Z,191.46,193.37,190.95,193.24,117014384,13.24897497\n2014-08-11T13:30:00Z,193.965,194.66,193.71,193.795,74543691,4.981978528\n2014-08-12T13:30:00Z,193.61,194.15,192.94,193.53,73631640,-1.482597305\n2014-08-13T13:30:00Z,194.29,195.06,193.96,194.84,69046544,11.20997191\n2014-08-14T13:30:00Z,195.16,195.76,194.98,195.76,57370793,7.90443038\n2014-08-15T13:30:00Z,196.47,196.65,194.31,195.72,139950669,-0.964482932\n2014-08-18T13:30:00Z,196.8,197.45,196.69,197.36,75424360,13.07689791\n2014-08-19T13:30:00Z,197.84,198.54,197.4426,198.39,59134709,8.334147963\n2014-08-20T13:30:00Z,198.12,199.16,198.08,198.92,72762541,4.219584189\n2014-08-21T13:30:00Z,199.09,199.76,198.93,199.5,67790690,4.996376812\n2014-08-22T13:30:00Z,199.34,199.69,198.74,199.19,76107359,-1.274940618\n2014-08-25T13:30:00Z,200.14,200.5949,199.1502,200.2,63855022,5.938858833\n2014-08-26T13:30:00Z,200.33,200.82,200.28,200.33,47298324,0.944327731\n2014-08-27T13:30:00Z,200.43,200.57,199.94,200.25,47873708,-0.657738095\n2014-08-28T13:30:00Z,199.59,200.27,199.39,200.14,58330373,0.697297297\n2014-08-29T13:30:00Z,200.45,200.73,199.82,200.71,65906598,2.948239857\n2014-09-02T13:30:00Z,200.97,200.995,199.86,200.61,72425793,-0.951822917\n2014-09-03T13:30:00Z,201.38,201.41,200.22,200.5,57461742,-2.5\n2014-09-04T13:30:00Z,200.84,201.58,199.66,200.2101,85236442,-2.601746495\n2014-09-05T13:30:00Z,200.17,201.19,199.41,201.11,102176784,3.832485766\n2014-09-08T13:30:00Z,200.92,201.21,200,200.59,64145745,-2.160467128\n2014-09-09T13:30:00Z,200.41,200.55,198.91,199.32,88590876,-11.43400287\n2014-09-10T13:30:00Z,199.43,200.2,198.77,200.07,67251103,2.576358297\n2014-09-11T13:30:00Z,199.27,200.33,199.12,200.3,66823558,3.922217153\n2014-09-12T13:30:00Z,200.1,200.12,198.56,199.13,117478516,-7.967398427\n2014-09-15T13:30:00Z,199.16,199.32,198.38,198.981,76401421,-1.906712474\n2014-09-16T13:30:00Z,198.61,200.84,198.5,200.48,116200722,11.64067447\n2014-09-17T13:30:00Z,200.77,201.68,199.75,200.75,151265896,2.275808133\n2014-09-18T13:30:00Z,201.36,201.85,201.1,201.82,94990300,9.573252688\n2014-09-19T13:30:00Z,201.52,201.899,200.29,200.7,121649147,-7.848571636\n2014-09-22T13:30:00Z,200.35,200.38,198.73,199.15,125552758,-14.39004342\n2014-09-23T13:30:00Z,198.43,199.26,197.95,198.01,111393319,-7.686335404\n2014-09-24T13:30:00Z,198.04,199.69,197.52,199.56,107275635,10.17692308\n2014-09-25T13:30:00Z,199.04,199.05,196.27,196.34,150300028,-25.22895315\n2014-09-26T13:30:00Z,196.7,198.39,196.42,197.9,103546740,7.086243017\n2014-09-29T13:30:00Z,196.2,197.89,196.05,197.54,95111605,3.288170163\n2014-09-30T13:30:00Z,197.69,198.3,196.61,197.02,131302082,-1.492592593\n2014-10-01T13:30:00Z,196.7,196.77,193.91,194.35,177797862,-24.74003767\n2014-10-02T13:30:00Z,194.18,195.055,192.35,194.38,157285182,-1.73690205\n2014-10-03T13:30:00Z,195.68,196.94,195.08,196.52,121568769,18.47787611\n2014-10-06T13:30:00Z,197.34,197.6,195.582,196.29,104778335,-1.651144524\n2014-10-07T13:30:00Z,195.28,195.72,193.22,193.26,147913498,-27.0891612\n2014-10-08T13:30:00Z,193.37,196.92,192.36,196.64,186461453,20.36846002\n2014-10-09T13:30:00Z,196.33,196.6,192.58,192.74,210704601,-25.47947761\n2014-10-10T13:30:00Z,192.69,193.65,190.49,190.54,221908954,-14.46106747\n2014-10-13T13:30:00Z,190.46,191.15,187.3,187.4099,230938833,-23.96607692\n2014-10-14T13:30:00Z,188.42,189.82,187.04,187.7,215846527,-3.539543639\n2014-10-15T13:30:00Z,185.16,187.694,181.92,186.43,380714600,-4.942399698\n2014-10-16T13:30:00Z,183.06,187.58,182.89,186.27,270391490,7.787381428\n2014-10-17T13:30:00Z,188.42,189.75,187.62,188.47,214624921,18.2531185\n2014-10-20T13:30:00Z,188.13,190.45,188.07,190.3,130010813,15.14224138\n2014-10-21T13:30:00Z,191.68,194.2,191.48,194.07,154948579,34.84628488\n2014-10-22T13:30:00Z,194.41,194.91,192.61,192.69,151822409,-5.172670406\n2014-10-23T13:30:00Z,194.62,196.2,194.26,194.93,154944169,13.66313391\n2014-10-24T13:30:00Z,195.25,196.49,194.49,196.43,117927286,10.17238267\n2014-10-27T13:30:00Z,195.73,196.45,195.03,196.16,82953689,1.224489796\n2014-10-28T13:30:00Z,196.82,198.42,196.73,198.41,106735936,21.382503\n2014-10-29T13:30:00Z,198.55,199.12,196.8,198.11,142557417,-0.453599356\n2014-10-30T13:30:00Z,197.58,199.95,197.4,199.38,113329976,8.906015038\n2014-10-31T13:30:00Z,201.78,201.82,200.77,201.66,146902554,18.5501139\n2014-11-03T14:30:00Z,201.92,202.45,201.305,201.77,93734143,0.021010638\n2014-11-04T14:30:00Z,201.23,201.6,200.06,201.07,93342777,-5.255357143\n2014-11-05T14:30:00Z,202.54,202.59,201.45,202.34,91708574,7.835766423\n2014-11-06T14:30:00Z,202.39,203.26,201.64,203.15,107089076,3.925149701\n2014-11-07T14:30:00Z,203.17,203.5999,202.61,203.34,89539712,1.330091533\n2014-11-10T14:30:00Z,203.38,204.04,203.13,203.98,66318964,4.512795276\n2014-11-11T14:30:00Z,204.055,204.31,203.65,204.175,54499375,1.03125\n2014-11-12T14:30:00Z,203.35,204.24,203.31,203.96,90120295,0.67578125\n2014-11-13T14:30:00Z,204.16,204.83,203.21,204.19,85357918,1.219411142\n2014-11-14T14:30:00Z,204.1,204.49,203.72,204.24,80417514,0.481712219\n2014-11-17T14:30:00Z,203.85,204.58,203.65,204.37,80440954,1.624028497\n2014-11-18T14:30:00Z,204.44,205.92,204.44,205.55,76068107,10.98309271\n2014-11-19T14:30:00Z,205.31,205.55,204.3,205.22,82373009,-0.498670213\n2014-11-20T14:30:00Z,204.26,205.71,204.18,205.58,72840326,4.176328502\n2014-11-21T14:30:00Z,207.64,207.8445,205.98,206.68,142327285,5.61514669\n2014-11-24T14:30:00Z,207.17,207.39,206.91,207.26,65880759,2.046032934\n2014-11-25T14:30:00Z,207.54,207.79,206.8,207.11,79108301,-1.120524691\n2014-11-26T14:30:00Z,207.29,207.76,207.03,207.64,62167832,2.898320896\n2014-11-28T14:30:00Z,207.49,207.87,206.91,207.2,57890088,-2.166915274\n2014-12-01T14:30:00Z,206.4,206.54,205.38,205.76,103968354,-13.3406\n2014-12-02T14:30:00Z,205.81,207.34,205.782,207.085,74507192,10.29478745\n2014-12-03T14:30:00Z,207.3,208.15,207.1,207.89,68951968,6.861801771\n2014-12-04T14:30:00Z,207.54,208.265,206.7,207.66,91316591,-0.097718978\n2014-12-05T14:30:00Z,207.87,208.47,207.55,208,91025470,2.318092105\n2014-12-08T14:30:00Z,207.52,208.12,205.93,206.61,108588152,-10.55082958\n2014-12-09T14:30:00Z,204.37,206.6,203.91,206.47,125180054,3.940868263\n2014-12-10T14:30:00Z,205.91,205.98,202.93,203.1601,159856394,-24.09337205\n2014-12-11T14:30:00Z,203.88,206.19,203.71,204.19,159012805,2.736348663\n2014-12-12T14:30:00Z,202.64,203.819,200.85,200.89,202330191,-26.46513382\n2014-12-15T14:30:00Z,201.98,202.53,198.78,199.51,189965750,-9.613097015\n2014-12-16T14:30:00Z,198.58,202.395,197.86,197.91,259543848,-8.932511524\n2014-12-17T14:30:00Z,198.44,202.34,198.29,201.79,253910092,33.84376773\n2014-12-18T14:30:00Z,204.74,212.97,203.92,206.78,257633887,43.68583086\n2014-12-19T14:30:00Z,206.43,207.33,205.6109,206.52,245084590,0.966994807\n2014-12-22T14:30:00Z,206.75,207.47,206.46,207.47,148318934,7.662681598\n2014-12-23T14:30:00Z,208.17,208.23,207.3991,207.75,122167931,1.174695816\n2014-12-24T14:30:00Z,208.02,208.34,207.72,207.77,42963399,-1.068103448\n2014-12-26T14:30:00Z,208.31,208.85,208.25,208.44,57326703,5.029778393\n2014-12-29T14:30:00Z,208.22,208.97,208.14,208.72,79643948,2.160326087\n2014-12-30T14:30:00Z,208.21,208.37,207.51,207.6,73540761,-8.475215517\n2014-12-31T14:30:00Z,207.99,208.19,205.39,205.54,130333829,-16.08144581\n2015-01-02T14:30:00Z,206.38,206.88,204.18,205.43,121465865,-3.072830189\n2015-01-05T14:30:00Z,204.17,204.37,201.35,201.72,169632646,-34.82475248\n2015-01-06T14:30:00Z,202.09,202.72,198.855,199.82,209151408,-14.58694514\n2015-01-07T14:30:00Z,201.42,202.72,200.88,202.31,125346709,14.60797872\n2015-01-08T14:30:00Z,204.01,206.16,203.99,205.9,147217784,35.41449149\n2015-01-09T14:30:00Z,206.4,206.42,203.51,204.25,158567288,-9.947293052\n2015-01-12T14:30:00Z,204.41,204.6,201.92,202.65,144396067,-13.65729409\n2015-01-13T14:30:00Z,204.12,205.48,200.51,202.08,214553306,-6.636899261\n2015-01-14T14:30:00Z,199.65,201.1,198.57,200.86,192991092,-6.99141289\n2015-01-15T14:30:00Z,201.63,202.01,198.88,199.0199,176613906,-10.24844683\n2015-01-16T14:30:00Z,198.77,201.82,198.55,201.63,211879605,15.11390743\n2015-01-20T14:30:00Z,202.4,202.72,200.17,202.055,130991069,2.703962481\n2015-01-21T14:30:00Z,201.5,203.66,200.94,203.08,122942707,6.179607461\n2015-01-22T14:30:00Z,203.99,206.26,202.33,206.1,174356029,20.54132948\n2015-01-23T14:30:00Z,205.79,206.1,204.81,204.97,117516753,-4.491488996\n2015-01-26T14:30:00Z,204.71,205.56,203.85,205.45,92009711,2.35770235\n2015-01-27T14:30:00Z,202.97,204.12,201.74,202.74,134044598,-18.95201238\n2015-01-28T14:30:00Z,204.17,204.29,199.91,200.14,168514312,-18.62419014\n2015-01-29T14:30:00Z,200.38,202.3,198.68,201.9902,173585424,4.80719611\n2015-01-30T14:30:00Z,200.57,202.17,199.13,199.45,197729724,-14.00818167\n2015-02-02T14:30:00Z,200.05,202.03,197.86,201.92,163106969,11.32373596\n2015-02-03T14:30:00Z,203,204.85,202.55,204.84,124212881,25.58997364\n2015-02-04T14:30:00Z,203.92,205.38,203.51,204.06,134306728,-0.891899142\n2015-02-05T14:30:00Z,204.86,206.3,204.77,206.12,97953181,19.86979167\n2015-02-06T14:30:00Z,206.56,207.24,204.92,205.55,125672026,-2.163187856\n2015-02-09T14:30:00Z,204.77,205.64,204.135,204.63,87219016,-6.25226707\n2015-02-10T14:30:00Z,205.88,207.12,204.6801,206.81,96164183,16.24757495\n2015-02-11T14:30:00Z,206.61,207.45,205.83,206.93,91087785,1.694500675\n2015-02-12T14:30:00Z,207.89,208.99,206.9727,208.92,97545949,15.70900101\n2015-02-13T14:30:00Z,209.07,209.84,208.76,209.78,93670430,6.330373832\n2015-02-17T14:30:00Z,209.4,210.32,209.1,210.11,76968199,2.622987478\n2015-02-18T14:30:00Z,209.66,210.22,209.3401,210.13,80652941,1.968163361\n2015-02-19T14:30:00Z,209.41,210.42,209.24,209.98,91462491,1.082490366\n2015-02-20T14:30:00Z,209.48,211.33,208.73,211.239,140896392,7.017661805\n2015-02-23T14:30:00Z,210.94,211.21,210.48,211.209,74411054,2.180102122\n2015-02-24T14:30:00Z,211.12,212.05,210.76,211.81,72472263,3.924034122\n2015-02-25T14:30:00Z,211.66,212.24,211.22,211.63,73061687,-0.069575472\n2015-02-26T14:30:00Z,211.52,211.71,210.65,211.38,72697868,-1.879098361\n2015-02-27T14:30:00Z,211.26,211.58,210.6,210.66,108075972,-5.067118227\n2015-03-02T14:30:00Z,210.78,212.06,210.72,211.99,87491428,10.27549342\n2015-03-03T14:30:00Z,211.47,212.054,210.08,211.12,110325809,-3.89351801\n2015-03-04T14:30:00Z,210.4,210.49,209.06,210.2301,114497192,-7.46398704\n2015-03-05T14:30:00Z,210.62,210.8,209.85,210.46,76872957,0.385535577\n2015-03-06T14:30:00Z,209.42,209.94,207.1,207.5,188127982,-26.48407643\n2015-03-09T13:30:00Z,207.74,208.79,207.5459,208.36,89818893,3.184296385\n2015-03-10T13:30:00Z,206.71,206.81,204.93,204.98,157121263,-31.20262456\n2015-03-11T13:30:00Z,205.29,205.5,204.4,204.5,110145718,-3.092781403\n2015-03-12T13:30:00Z,205.26,207.175,205.2,207.1,93993523,22.02102948\n2015-03-13T13:30:00Z,206.77,207.9338,204.58,205.8272,162410893,-5.303411296\n2015-03-16T13:30:00Z,206.71,208.69,205.8641,208.58,136099192,20.05379758\n2015-03-17T13:30:00Z,207.69,208.42,206.98,207.96,94510422,-0.088050314\n2015-03-18T13:30:00Z,207.39,211.27,206.62,210.46,228808524,17.99056041\n2015-03-19T13:30:00Z,209.96,210.4697,209.03,209.5,117917302,-1.710807244\n2015-03-20T13:30:00Z,209.71,211.02,209.4903,210.41,177715081,6.613668146\n2015-03-23T13:30:00Z,210.42,211.11,210,210,71784536,-1.515077821\n2015-03-24T13:30:00Z,209.85,210.4,208.74,208.82,77805321,-8.031161473\n2015-03-25T13:30:00Z,209.07,209.35,205.71,205.76,159521708,-24.79870911\n2015-03-26T13:30:00Z,204.96,206.37,204.12,205.27,153067241,-3.871852153\n2015-03-27T13:30:00Z,205.13,205.95,204.9,205.74,118938966,3.213414634\n2015-03-30T13:30:00Z,206.98,208.61,206.96,208.25,96180365,24.51768135\n2015-03-31T13:30:00Z,207.26,208.1,206.36,206.43,126768703,-10.62155627\n2015-04-01T13:30:00Z,206.39,206.42,204.51,205.7,137303584,-7.250883392\n2015-04-02T13:30:00Z,205.62,206.98,205.4,206.435,86900906,4.427960057\n2015-04-06T13:30:00Z,205.37,208.45,205.21,207.83,114368155,10.34470281\n2015-04-07T13:30:00Z,207.855,208.76,207.24,207.28,81236337,-0.605752342\n2015-04-08T13:30:00Z,207.55,208.51,207.08,207.975,89351939,3.730788324\n2015-04-09T13:30:00Z,207.78,209.18,207.19,208.9,85548854,5.716923822\n2015-04-10T13:30:00Z,209.2,210.09,208.96,210.04,72722915,9.503472222\n2015-04-13T13:30:00Z,209.87,210.63,209.03,209.09,74436594,-3.940953039\n2015-04-14T13:30:00Z,208.85,209.71,208.1,209.49,75099866,1.799688366\n2015-04-15T13:30:00Z,210.05,211.04,209.95,210.43,99529320,8.443834459\n2015-04-16T13:30:00Z,210.03,210.98,209.7928,210.37,68934864,0.63672789\n2015-04-17T13:30:00Z,208.94,209.23,207.01,207.95,191113230,-20.67130435\n2015-04-20T13:30:00Z,209.06,210.25,208.96,209.85,92189481,14.41018972\n2015-04-21T13:30:00Z,210.67,210.86,209.24,209.6,72559831,-2.040491747\n2015-04-22T13:30:00Z,210.01,210.85,208.9,210.63,78264616,3.778537204\n2015-04-23T13:30:00Z,210.15,211.94,210.01,211.16,102585942,4.672961631\n2015-04-24T13:30:00Z,211.66,211.97,211.11,211.6499,61327387,3.355356742\n2015-04-27T13:30:00Z,212.33,212.48,210.54,210.77,79358126,-5.936620853\n2015-04-28T13:30:00Z,210.74,211.5,209.3301,211.44,86863531,2.214776456\n2015-04-29T13:30:00Z,210.37,211.29,209.6,210.57,125684903,-3.527061856\n2015-04-30T13:30:00Z,209.88,210.35,207.62,208.46,161304890,-17.67192907\n2015-05-01T13:30:00Z,209.4,210.77,209.28,210.72,103399711,16.4222561\n2015-05-04T13:30:00Z,211.23,212.02,211.1,211.32,70927235,5.501302083\n2015-05-05T13:30:00Z,211.03,211.46,208.73,208.9,113326156,-20.36302225\n2015-05-06T13:30:00Z,209.56,209.93,206.76,208.04,135060151,-7.775742741\n2015-05-07T13:30:00Z,207.92,209.38,207.52,208.87,88244940,3.458426339\n2015-05-08T13:30:00Z,210.88,211.86,210.78,211.62,155877260,27.60980473\n2015-05-11T13:30:00Z,211.57,211.89,210.52,210.605,75708065,-5.802853698\n2015-05-12T13:30:00Z,209.61,210.63,208.62,209.98,119727592,-3.75425111\n2015-05-13T13:30:00Z,210.47,211.22,209.74,210.02,94667943,-0.455882353\n2015-05-14T13:30:00Z,211.24,212.32,210.91,212.21,95934006,18.72220457\n2015-05-15T13:30:00Z,212.44,212.61,211.86,212.44,76510099,1.190176322\n2015-05-18T13:30:00Z,212.24,213.4,212.16,213.1,74549685,5.274193548\n2015-05-19T13:30:00Z,213.24,213.57,212.69,213.03,72114610,0.107305936\n2015-05-20T13:30:00Z,213.15,213.78,212.504,212.88,76857530,-1.190840233\n2015-05-21T13:30:00Z,212.71,213.75,212.51,213.5,64764585,3.940368069\n2015-05-22T13:30:00Z,213.04,213.54,212.91,212.99,57433495,-1.503965257\n2015-05-26T13:30:00Z,212.4,212.9089,210.2,210.7,124308584,-19.90322734\n2015-05-27T13:30:00Z,211.25,212.98,210.7612,212.7,93213981,12.25508525\n2015-05-28T13:30:00Z,212.33,212.59,211.63,212.46,74974560,0.91027677\n2015-05-29T13:30:00Z,212.38,212.43,210.82,211.14,124919611,-11.79600302\n2015-06-01T13:30:00Z,211.94,212.34,210.62,211.57,93338750,-0.240147783\n2015-06-02T13:30:00Z,211.02,212.19,210.27,211.36,91531012,-0.534937888\n2015-06-03T13:30:00Z,212,212.67,211.3301,211.92,87820909,3.476340445\n2015-06-04T13:30:00Z,211.07,211.859,209.75,210.1292,151882820,-14.32682334\n2015-06-05T13:30:00Z,209.95,210.58,208.98,209.77,121704676,-2.678565279\n2015-06-08T13:30:00Z,209.64,209.82,208.39,208.48,89063330,-11.19788136\n2015-06-09T13:30:00Z,208.45,209.1,207.69,208.45,105034690,-0.929411765\n2015-06-10T13:30:00Z,209.37,211.41,209.2987,210.95,134551285,24.00370714\n2015-06-11T13:30:00Z,211.48,212.09,211.2,211.63,73876447,5.811170213\n2015-06-12T13:30:00Z,210.64,211.482,209.68,210.01,135382369,-12.0855925\n2015-06-15T13:30:00Z,208.64,209.45,207.79,209.11,124384184,-5.440852205\n2015-06-16T13:30:00Z,208.93,210.35,208.72,210.25,85308227,8.503934192\n2015-06-17T13:30:00Z,210.59,211.32,209.36,210.59,126708635,1.956604803\n2015-06-18T13:30:00Z,211.31,213.34,210.6315,212.78,165867949,18.42023908\n2015-06-19T13:30:00Z,211.46,211.55,210.36,210.81,130478689,-13.4193038\n2015-06-22T13:30:00Z,211.905,212.59,211.64,211.89,70696027,6.627659574\n2015-06-23T13:30:00Z,212.14,212.44,211.57,212.04,68476797,0.378665951\n2015-06-24T13:30:00Z,211.72,212.17,210.47,210.5,92307318,-12.37228261\n2015-06-25T13:30:00Z,211.1,211.25,209.77,209.86,97107361,-4.109768908\n2015-06-26T13:30:00Z,210.29,210.58,209.16,209.82,104174840,-1.521676301\n2015-06-29T13:30:00Z,208.045,209.828,205.33,205.42,202621332,-35.44672842\n2015-06-30T13:30:00Z,207.26,207.32,205.28,205.85,182925106,-4.101471952\n2015-07-01T13:30:00Z,207.73,208.03,206.56,207.5,135979873,7.399110218\n2015-07-02T13:30:00Z,208.07,208.27,206.81,207.31,104373652,-1.990012356\n2015-07-06T13:30:00Z,205.77,207.65,205.53,206.72,117975369,-1.468885281\n2015-07-07T13:30:00Z,206.96,208.17,204.11,208.02,173820249,7.847840314\n2015-07-08T13:30:00Z,206.42,206.7645,204.25,204.53,164020059,-28.8372221\n2015-07-09T13:30:00Z,207.04,207.35,204.77,204.9,144113107,-6.513888889\n2015-07-10T13:30:00Z,207.29,207.98,206.49,207.48,129456890,14.60815603\n2015-07-13T13:30:00Z,208.99,209.9,208.94,209.77,106069400,23.74298561\n2015-07-14T13:30:00Z,209.72,211.05,209.65,210.68,81709575,7.94984326\n2015-07-15T13:30:00Z,210.73,211.28,210.04,210.61,97914141,0.297297297\n2015-07-16T13:30:00Z,211.87,212.3,211.58,212.3,106683266,16.03618421\n2015-07-17T13:30:00Z,212.29,212.55,211.8,212.48,89029973,1.393950437\n2015-07-20T13:30:00Z,212.75,213.18,212.21,212.59,70446821,0.333230958\n2015-07-21T13:30:00Z,212.43,212.74,211.39,211.75,77965048,-6.582733813\n2015-07-22T13:30:00Z,210.93,211.77,210.89,211.37,88667920,-1.689285714\n2015-07-23T13:30:00Z,211.53,211.65,209.75,210.18,90509128,-8.840485075\n2015-07-24T13:30:00Z,210.3,210.37,207.6,208,117754979,-19.03087289\n2015-07-27T13:30:00Z,206.94,207.55,206.26,206.79,132361082,-9.678229665\n2015-07-28T13:30:00Z,207.79,209.5,206.8,209.33,123544845,20.21074521\n2015-07-29T13:30:00Z,209.48,211.04,209.31,210.77,105791255,12.48138298\n2015-07-30T13:30:00Z,210.16,211.02,209.42,210.82,91304374,3.083143693\n2015-07-31T13:30:00Z,211.42,211.45,210.16,210.5,103266857,-1.743556701\n2015-08-03T13:30:00Z,210.46,210.53,208.65,209.79,113965728,-6.98681872\n2015-08-04T13:30:00Z,209.7,210.2483,208.8,209.38,81820823,-2.82416218\n2015-08-05T13:30:00Z,210.45,211.31,209.73,210.07,85786817,2.760899183\n2015-08-06T13:30:00Z,210.29,210.415,207.65,208.35,116030803,-14.72836538\n2015-08-07T13:30:00Z,208.16,208.34,206.87,207.95,117857956,-4.672193878\n2015-08-10T13:30:00Z,209.28,210.67,209.28,210.57,80270676,25.91340451\n2015-08-11T13:30:00Z,208.97,209.47,207.76,208.67,126081377,-11.74800339\n2015-08-12T13:30:00Z,207.11,209.14,205.36,208.92,172123672,5.795719844\n2015-08-13T13:30:00Z,208.73,209.55,208.01,208.66,89383253,0.449576537\n2015-08-14T13:30:00Z,208.43,209.5087,208.26,209.42,72786528,5.184144734\n2015-08-17T13:30:00Z,208.71,210.59,208.16,210.59,79072643,6.933823529\n2015-08-18T13:30:00Z,210.26,210.68,209.699,209.98,71692678,-1.074603722\n2015-08-19T13:30:00Z,209.09,210.01,207.35,208.32,172945975,-12.7345467\n2015-08-20T13:30:00Z,206.51,207.17,203.9,203.97,194327884,-39.76973684\n2015-08-21T13:30:00Z,201.73,203.9404,197.52,197.63,346588470,-51.45827735\n2015-08-24T13:30:00Z,187.49,195.84,182.4,189.55,507244330,-50.04160563\n2015-08-25T13:30:00Z,195.43,195.45,186.92,187.27,369833070,-23.8291183\n2015-08-26T13:30:00Z,192.08,194.79,188.37,194.46,339256990,33.07214206\n2015-08-27T13:30:00Z,197.02,199.42,195.21,199.27,274143910,39.07915058\n2015-08-28T13:30:00Z,198.5,199.835,197.92,199.28,160414352,3.277938951\n2015-08-31T13:30:00Z,198.11,199.125,197.01,197.67,163298816,-9.715837696\n2015-09-01T13:30:00Z,193.12,194.77,190.73,191.77,256000392,-51.77890625\n2015-09-02T13:30:00Z,194.62,195.46,192.42,195.41,160269331,23.0313555\n2015-09-03T13:30:00Z,196.26,198.05,194.96,195.55,152087836,-0.0878327\n2015-09-04T13:30:00Z,192.85,193.86,191.61,192.59,207080961,-24.58737586\n2015-09-08T13:30:00Z,195.94,197.61,195.17,197.43,116025739,45.63636364\n2015-09-09T13:30:00Z,199.32,199.47,194.35,194.79,149347735,-15.88541193\n2015-09-10T13:30:00Z,194.56,197.22,194.25,195.85,158611063,2.11940128\n2015-09-11T13:30:00Z,195.375,196.82,194.53,196.74,119691212,5.984210526\n2015-09-14T13:30:00Z,196.95,197.01,195.43,196.01,79451983,-3.65960475\n2015-09-15T13:30:00Z,196.61,198.99,195.9612,198.46,113806176,17.91853055\n2015-09-16T13:30:00Z,198.82,200.41,198.41,200.18,99581557,14.16719543\n2015-09-17T13:30:00Z,200.02,202.89,199.28,199.73,276046620,-1.093433544\n2015-09-18T13:30:00Z,195.71,197.56,194.96,195.45,223657456,-35.56474551\n2015-09-21T13:30:00Z,196.44,197.68,195.21,196.46,105726209,5.250616371\n2015-09-22T13:30:00Z,193.88,194.46,192.56,193.91,153890876,-21.22848537\n2015-09-23T13:30:00Z,194.11,194.67,192.91,193.6,92790620,-1.97135785\n2015-09-24T13:30:00Z,192.15,193.45,190.56,192.9,159378840,-2.780113177\n2015-09-25T13:30:00Z,194.64,195,191.81,192.85,155054777,-2.94365285\n2015-09-28T13:30:00Z,191.78,191.91,187.64,188.01,178515871,-45.02256024\n2015-09-29T13:30:00Z,188.27,189.74,186.93,188.12,159045572,-2.614881746\n2015-09-30T13:30:00Z,190.37,191.825,189.44,191.63,163452044,30.81865876\n2015-10-01T13:30:00Z,192.08,192.49,189.82,192.13,131078964,3.183417085\n2015-10-02T13:30:00Z,189.77,195.03,189.12,195,211003342,17.46251055\n2015-10-05T13:30:00Z,196.46,198.74,196.33,198.47,126320842,30.84219909\n2015-10-06T13:30:00Z,198.31,198.98,197,197.79,110274530,-1.619146526\n2015-10-07T13:30:00Z,198.9,199.825,197.48,199.41,124307295,8.967361111\n2015-10-08T13:30:00Z,198.95,201.55,198.59,201.21,153055231,13.24504049\n2015-10-09T13:30:00Z,201.38,201.9,200.58,201.33,107069240,1.50994695\n2015-10-12T13:30:00Z,201.42,201.76,200.91,201.52,56395585,0.708876812\n2015-10-13T13:30:00Z,200.65,202.16,200.05,200.25,88038718,-6.218237705\n2015-10-14T13:30:00Z,200.18,200.87,198.94,199.29,99106161,-6.070043103\n2015-10-15T13:30:00Z,200.08,202.36,199.64,202.35,134142195,24.44982959\n2015-10-16T13:30:00Z,202.83,203.29,201.92,203.27,114580052,5.177580645\n2015-10-19T13:30:00Z,202.5,203.37,202.13,203.37,76523897,3.404166667\n2015-10-20T13:30:00Z,202.85,203.84,202.5471,203.09,78448484,0.195795609\n2015-10-21T13:30:00Z,203.61,203.79,201.65,201.85,102038033,-8.427272727\n2015-10-22T13:30:00Z,202.98,205.51,201.85,205.26,174911723,22.93079268\n2015-10-23T13:30:00Z,207.25,207.95,206.3,207.51,144442340,18.10104927\n2015-10-26T13:30:00Z,207.3,207.37,206.56,207,69032965,-3.738425926\n2015-10-27T13:30:00Z,206.2,207,205.79,206.6,77905770,-1.618433852\n2015-10-28T13:30:00Z,207,208.98,206.21,208.95,135906725,17.75152439\n2015-10-29T13:30:00Z,208.35,209.27,208.21,208.83,90525498,1.815630048\n2015-10-30T13:30:00Z,209.06,209.44,207.74,207.93,131076942,-5.034512363\n2015-11-02T14:30:00Z,208.32,210.62,208.17,210.39,86270811,18.93432296\n2015-11-03T14:30:00Z,209.97,211.66,209.7,211,95246052,5.262298184\n2015-11-04T14:30:00Z,211.35,211.5,209.7201,210.36,96224477,-3.445298696\n2015-11-05T14:30:00Z,210.43,210.98,209.09,210.15,78408744,-2.21878655\n2015-11-06T14:30:00Z,209.74,210.32,208.46,210.04,110471473,-0.164183938\n2015-11-09T14:30:00Z,209.31,209.49,206.95,208.08,131008660,-16.70631488\n2015-11-10T14:30:00Z,207.51,208.6,207.19,208.56,75874602,2.25900655\n2015-11-11T14:30:00Z,208.88,208.94,207.66,207.74,67845971,-4.111628849\n2015-11-12T14:30:00Z,206.5,207.06,204.82,204.84,121315200,-25.57547993\n2015-11-13T14:30:00Z,204.35,204.67,202.435,202.54,153577050,-19.89510969\n2015-11-16T14:30:00Z,202.32,205.69,202.18,205.62,117645231,21.25256309\n2015-11-17T14:30:00Z,205.99,207.04,204.88,205.47,121123744,1.233877722\n2015-11-18T14:30:00Z,206.04,208.9,205.99,208.73,121342544,29.07054924\n2015-11-19T14:30:00Z,208.59,209.05,208.2,208.55,88220465,1.028017241\n2015-11-20T14:30:00Z,209.45,210.12,208.86,209.3108,94011519,4.690719298\n2015-11-23T14:30:00Z,209.38,209.98,208.52,209.07,64931172,-1.423762711\n2015-11-24T14:30:00Z,207.87,209.83,207.41,209.35,98874365,3.91529029\n2015-11-25T14:30:00Z,209.5,209.74,209.01,209.32,51980062,0.553977273\n2015-11-27T14:30:00Z,209.43,209.8,208.86,209.56,37317779,0.791878173\n2015-11-30T14:30:00Z,209.75,209.89,208.56,208.69,112822700,-6.27293578\n2015-12-01T14:30:00Z,209.44,210.82,209.11,210.68,97858418,14.28732838\n2015-12-02T14:30:00Z,210.615,211,208.23,208.529,108441259,-14.33806818\n2015-12-03T14:30:00Z,208.83,209.15,204.7511,205.61,166224154,-24.23619516\n2015-12-04T14:30:00Z,206.08,209.97,205.93,209.62,192913879,27.08666334\n2015-12-07T14:30:00Z,209.23,209.7295,207.2,208.35,102027111,-3.654451603\n2015-12-08T14:30:00Z,206.49,208.289,205.78,206.949,103372367,-8.09964441\n2015-12-09T14:30:00Z,206.19,208.68,204.18,205.34,162401537,-7.197577401\n2015-12-10T14:30:00Z,205.42,207.43,205.14,205.87,116128884,2.831730769\n2015-12-11T14:30:00Z,203.35,204.14,201.51,201.88,211173305,-34.84147609\n2015-12-14T14:30:00Z,202.07,203.05,199.95,202.9008,182385177,3.717719899\n2015-12-15T14:30:00Z,204.7,206.11,204.58,205.0308,154069569,19.48004821\n2015-12-16T14:30:00Z,206.365,208.39,204.8,208.03,197017008,22.37667874\n2015-12-17T14:30:00Z,208.4,208.48,204.84,204.86,173092476,-22.23538136\n2015-12-18T14:30:00Z,202.77,202.93,199.83,200.0208,251393535,-45.08455051\n2015-12-21T14:30:00Z,201.41,201.88,200.09,201.67,99094290,5.051107926\n2015-12-22T14:30:00Z,202.715,203.85,201.55,203.5,111026246,13.1785148\n2015-12-23T14:30:00Z,204.69,206.07,204.58,206.02,110987228,24.39588012\n2015-12-24T14:30:00Z,205.72,206.33,205.42,205.68,48542150,-0.082997988\n2015-12-28T14:30:00Z,204.86,205.26,203.94,205.21,65899939,-2.153814935\n2015-12-29T14:30:00Z,206.51,207.79,206.47,207.4,92640672,21.54616564\n2015-12-30T14:30:00Z,207.11,207.21,205.76,205.93,63317679,-10.65594059\n2015-12-31T14:30:00Z,205.13,205.89,203.87,203.87,114877859,-16.45904711\n2016-01-04T14:30:00Z,200.49,201.03,198.59,201.0192,222353534,-22.93164072\n2016-01-05T14:30:00Z,201.4,201.9,200.05,201.36,110845849,1.384580159\n2016-01-06T14:30:00Z,198.34,200.06,197.6,198.82,152112604,-17.39903846\n2016-01-07T14:30:00Z,195.33,197.44,193.59,194.05,213436073,-37.10662554\n2016-01-08T14:30:00Z,195.19,195.85,191.58,191.923,209817228,-13.72390387\n2016-01-11T14:30:00Z,193.01,193.41,189.82,192.11,187941323,-3.220505829\n2016-01-12T14:30:00Z,193.82,194.55,191.14,193.6608,172330490,5.228211829\n2016-01-13T14:30:00Z,194.45,194.86,188.38,188.83,221168886,-38.88128516\n2016-01-14T14:30:00Z,189.55,193.26,187.66,191.93,240795609,11.40306031\n2016-01-15T14:30:00Z,186.77,188.76,185.52,187.81,324846450,-22.21177352\n2016-01-19T14:30:00Z,189.96,190.11,186.2,188.06,195244373,-1.516786571\n2016-01-20T14:30:00Z,185.03,187.495,181.02,185.65,286547840,-15.66539924\n2016-01-21T14:30:00Z,186.21,188.87,184.64,186.69,195772941,6.585946408\n2016-01-22T14:30:00Z,189.78,190.76,188.88,190.52,168319598,35.50565428\n2016-01-25T14:30:00Z,189.92,190.15,187.41,187.64,130371686,-23.96875\n2016-01-26T14:30:00Z,188.42,190.53,188.02,190.2,141036757,15.90825688\n2016-01-27T14:30:00Z,189.58,191.56,187.06,188.13,185681707,-9.326339737\n2016-01-28T14:30:00Z,189.96,190.2,187.16,189.11,143798780,0.731952608\n2016-01-29T14:30:00Z,190.02,193.88,189.88,193.7208,210529336,40.51971044\n2016-02-01T14:30:00Z,192.53,194.58,191.84,193.65,136061564,4.536252319\n2016-02-02T14:30:00Z,191.96,191.97,189.54,190.16,182564890,-29.73961268\n2016-02-03T14:30:00Z,191.41,191.78,187.1,191.3,205054934,2.367324561\n2016-02-04T14:30:00Z,190.71,192.75,189.96,191.6,139531794,2.307841615\n2016-02-05T14:30:00Z,190.99,191.6696,187.2,187.95,180788308,-28.99687773\n2016-02-08T14:30:00Z,185.77,186.12,182.8,185.42,191526694,-22.32826577\n2016-02-09T14:30:00Z,183.36,186.94,183.2,185.43,184513136,3.471015676\n2016-02-10T14:30:00Z,186.41,188.34,185.12,185.27,148214057,-1.034071906\n2016-02-11T14:30:00Z,182.34,184.1,181.09,182.86,219058885,-16.39545747\n2016-02-12T14:30:00Z,184.96,186.65,183.96,186.63,127632393,33.28199184\n2016-02-16T14:30:00Z,188.77,189.81,187.63,189.78,120250668,26.13105327\n2016-02-17T14:30:00Z,191.16,193.32,191.01,192.88,136009496,29.33172699\n2016-02-18T14:30:00Z,193.2,193.27,191.72,192.09,102342997,-3.350378788\n2016-02-19T14:30:00Z,191.17,192.18,190.45,192,114792988,0.24252802\n2016-02-22T14:30:00Z,193.87,194.95,193.79,194.78,103640292,28.0535221\n2016-02-23T14:30:00Z,194,194.32,192.18,192.32,111455289,-19.22160731\n2016-02-24T14:30:00Z,190.63,193.53,189.32,193.2,150812152,7.066684665\n2016-02-25T14:30:00Z,193.73,195.55,192.83,195.54,110728317,16.98071561\n2016-02-26T14:30:00Z,196.57,196.68,194.9,195.0892,129833663,-2.357553191\n2016-02-29T14:30:00Z,195.11,196.23,193.33,193.56,125918102,-8.991813345\n2016-03-01T14:30:00Z,195.01,198.21,194.4542,198.11,141799687,36.16668074\n2016-03-02T14:30:00Z,197.74,199.06,197.25,199,102414960,5.271397485\n2016-03-03T14:30:00Z,198.79,199.795,198.11,199.775,95172197,4.401328125\n2016-03-04T14:30:00Z,200.01,201.35,199.03,200.43,129293601,4.262588285\n2016-03-07T14:30:00Z,199.34,201.07,199.25,200.59,100218998,3.40974026\n2016-03-08T14:30:00Z,199.32,199.92,198.21,198.4,123974866,-14.748807\n2016-03-09T14:30:00Z,199.36,199.79,198.43,199.38,94801213,4.113707165\n2016-03-10T14:30:00Z,199.96,201.07,197.38,199.54,156838697,-0.152232747\n2016-03-11T14:30:00Z,201.26,202.81,201.12,202.76,137964528,30.55742263\n2016-03-14T13:30:00Z,202.16,203.04,201.77,202.5,73611974,1.07199848\n2016-03-15T13:30:00Z,201.36,202.2,201.05,202.17,93169090,1.046931408\n2016-03-16T13:30:00Z,201.6,203.82,201.55,203.34,129303179,9.353197674\n2016-03-17T13:30:00Z,203.24,205.23,202.77,204.63,134278505,9.874352332\n2016-03-18T13:30:00Z,204.17,204.78,203.8,204.38,138372404,0.791313559\n2016-03-21T13:30:00Z,204.07,204.94,203.8,204.67,72926659,1.953092243\n2016-03-22T13:30:00Z,203.76,205.23,203.57,204.56,97471939,1.671270718\n2016-03-23T13:30:00Z,204.11,204.33,203.01,203.2092,81052455,-9.487232416\n2016-03-24T13:30:00Z,202,203.16,201.74,203.12,84360853,1.350594083\n2016-03-28T13:30:00Z,203.61,203.86,202.705,203.24,62408185,0.692944251\n2016-03-29T13:30:00Z,202.76,205.25,202.4,205.1208,92922863,12.67435641\n2016-03-30T13:30:00Z,206.3,206.87,205.59,206.02,86365310,7.008891819\n2016-03-31T13:30:00Z,205.91,206.41,205.33,205.52,94584110,-2.86875\n2016-04-01T13:30:00Z,204.35,207.14,203.98,206.92,114423478,8.042498081\n2016-04-04T13:30:00Z,206.83,207.07,205.89,206.25,63496969,-1.121484911\n2016-04-05T13:30:00Z,204.67,206.2642,203.89,204.1892,99662158,-14.32258257\n2016-04-06T13:30:00Z,204.29,206.49,203.98,206.42,91839761,17.36184625\n2016-04-07T13:30:00Z,205.14,205.56,203.09,203.95,113859037,-15.3554716\n2016-04-08T13:30:00Z,205.34,205.85,203.87,204.4992,95040598,-0.879610318\n2016-04-11T13:30:00Z,205.25,206.07,203.91,204.0201,83757486,-5.402275916\n2016-04-12T13:30:00Z,204.22,206.25,203.7,205.92,115350567,11.91253534\n2016-04-13T13:30:00Z,207,208.1,206.84,208.0008,96336433,19.09532634\n2016-04-14T13:30:00Z,208.07,208.6,207.6,208.01,65212883,0.687172452\n2016-04-15T13:30:00Z,208.01,208.1721,207.4,207.78,75761615,-1.743742854\n2016-04-18T13:30:00Z,207.14,209.28,207,209.2392,82530960,9.831417112\n2016-04-19T13:30:00Z,209.74,210.2,208.94,209.9,88316060,4.258139848\n2016-04-20T13:30:00Z,209.95,210.92,209.39,210.1,81100314,1.27906051\n2016-04-21T13:30:00Z,210.12,210.25,208.65,208.97,85695041,-9.228530534\n2016-04-22T13:30:00Z,208.55,209.29,207.91,208.97,99251724,-0.307908546\n2016-04-25T13:30:00Z,208.26,208.66,207.54,208.61,66166494,-0.518115942\n2016-04-26T13:30:00Z,209.04,209.52,208.36,208.9192,75864174,1.533231463\n2016-04-27T13:30:00Z,208.47,209.81,208.05,209.35,77329437,2.61425567\n2016-04-28T13:30:00Z,208.46,209.76,206.96,207.4475,97216169,-10.82597786\n2016-04-29T13:30:00Z,206.72,207.13,205.03,206.3308,142424137,-9.410294694\n2016-05-02T13:30:00Z,206.92,208.18,206.41,207.97,62188015,12.52724147\n2016-05-03T13:30:00Z,206.52,206.8,205.28,206.1592,106422142,-12.27614308\n2016-05-04T13:30:00Z,204.99,205.85,204.42,205.01,92243810,-7.979208264\n2016-05-05T13:30:00Z,205.56,205.98,204.47,204.97,67619222,-1.320544554\n2016-05-06T13:30:00Z,204.06,205.77,203.88,205.72,89315004,4.789647239\n2016-05-09T13:30:00Z,205.57,206.4,205.36,205.8892,74374922,2.172611684\n2016-05-10T13:30:00Z,206.72,208.5,206.64,208.45,77472207,24.70742398\n2016-05-11T13:30:00Z,207.91,208.54,206.5,206.5,81726989,-10.95519464\n2016-05-12T13:30:00Z,207.29,207.4899,205.37,206.56,89586308,-1.878172525\n2016-05-13T13:30:00Z,206.21,206.86,204.38,204.76,96474630,-13.85528169\n2016-05-16T13:30:00Z,204.96,207.34,204.89,206.78,77486827,14.38781494\n2016-05-17T13:30:00Z,206.46,206.8,204.23,204.8508,114924940,-12.00607438\n2016-05-18T13:30:00Z,204.44,206.3,203.63,204.91,123493379,-0.318691453\n2016-05-19T13:30:00Z,204.06,204.54,202.78,204.2,115430507,-3.3725\n2016-05-20T13:30:00Z,204.92,206.1,204.86,205.49,104990408,11.91199377\n2016-05-23T13:30:00Z,205.51,205.84,204.985,205.21,58682576,-0.909696115\n2016-05-24T13:30:00Z,206.17,208.24,206.14,207.87,93537808,24.64026989\n2016-05-25T13:30:00Z,208.67,209.77,207.8691,209.28,79221525,10.92587815\n2016-05-26T13:30:00Z,209.44,209.71,208.97,209.34,55280699,0.489320728\n2016-05-27T13:30:00Z,209.53,210.25,209.47,210.24,64211214,8.040948276\n2016-05-31T13:30:00Z,210.56,210.69,209.18,209.84,109879380,-2.286851852\n2016-06-01T13:30:00Z,209.12,210.48,208.89,210.27,69936215,2.767478814\n2016-06-02T13:30:00Z,209.8,210.93,209.2399,210.91,63044749,4.826314883\n2016-06-03T13:30:00Z,210.25,210.69,208.86,210.28,101757126,-1.950042277\n2016-06-06T13:30:00Z,210.7,211.77,210.51,211.35,64887045,9.447219711\n2016-06-07T13:30:00Z,211.525,212.34,211.5,211.68,60974761,3.273201856\n2016-06-08T13:30:00Z,211.84,212.52,211.6899,212.37,66170920,5.970688373\n2016-06-09T13:30:00Z,211.51,212.22,211.19,212.08,73786869,0.759848485\n2016-06-10T13:30:00Z,210.46,210.86,209.43,210.07,113829158,-15.65184708\n2016-06-13T13:30:00Z,209.36,210.37,208.35,208.4492,117751153,-11.03531287\n2016-06-14T13:30:00Z,208,208.74,206.9199,208.04,125059286,-2.879386323\n2016-06-15T13:30:00Z,208.54,209.36,207.53,207.75,109124496,-3.026494565\n2016-06-16T13:30:00Z,206.73,208.57,205.59,208.37,149533065,5.278914241\n2016-06-17T13:30:00Z,207.17,207.2,205.75,206.52,117055748,-11.82080777\n2016-06-20T13:30:00Z,208.82,209.61,207.75,207.85,82789603,4.997452607\n2016-06-21T13:30:00Z,208.3,208.92,207.78,208.44,72461663,2.019552441\n2016-06-22T13:30:00Z,208.65,209.5,207.93,208.1,95560471,-2.394080997\n2016-06-23T13:30:00Z,209.81,210.87,209.27,210.81,102731356,22.90318891\n2016-06-24T13:30:00Z,203.63,206.905,202.72,203.13,333444400,-60.79373777\n2016-06-27T13:30:00Z,201.59,201.6,198.65,199.6,248988660,-33.90625\n2016-06-28T13:30:00Z,201.48,203.23,201.12,203.1997,159382399,26.69309855\n2016-06-29T13:30:00Z,204.84,206.93,204.72,206.66,137328614,32.91522856\n2016-06-30T13:30:00Z,207.21,209.54,206.56,209.475,165021948,23.069869\n2016-07-01T13:30:00Z,209.36,210.49,209.29,209.9208,106055333,4.642026716\n2016-07-05T13:30:00Z,208.95,209.08,207.71,208.41,109803713,-11.74194059\n2016-07-06T13:30:00Z,207.83,209.8,207.06,209.66,96021491,6.134130435\n2016-07-07T13:30:00Z,209.87,210.6495,208.63,209.526,85593827,0.393734861\n2016-07-08T13:30:00Z,211.05,212.94,210.7785,212.65,133970972,28.49702479\n2016-07-11T13:30:00Z,213.19,214.07,212.95,213.4,73633937,6.669535928\n2016-07-12T13:30:00Z,214.53,215.3,213.4308,214.95,101275629,11.11116489\n2016-07-13T13:30:00Z,215.44,215.45,214.35,214.92,87324129,-0.575726141\n2016-07-14T13:30:00Z,216.4,216.67,215.66,216.12,91230870,6.73634106\n2016-07-15T13:30:00Z,216.78,217.0125,215.308,215.83,107155401,-2.624815089\n2016-07-18T13:30:00Z,215.97,216.6,215.67,216.4092,58725918,2.31370985\n2016-07-19T13:30:00Z,215.92,216.23,215.63,216.19,54345728,0.155956968\n2016-07-20T13:30:00Z,216.75,217.37,216.24,217.085,58159457,6.816973415\n2016-07-21T13:30:00Z,216.96,217.22,215.75,216.265,67777310,-5.819815969\n2016-07-22T13:30:00Z,216.41,217.3,216.1,217.24,62787477,5.727109873\n2016-07-25T13:30:00Z,217,217.06,215.97,216.65,55873147,-3.189301802\n2016-07-26T13:30:00Z,216.53,217.17,215.76,216.75,70080493,0.455029215\n2016-07-27T13:30:00Z,217.19,217.27,215.62,216.52,84083893,-2.112536657\n2016-07-28T13:30:00Z,216.29,217.11,215.75,216.77,65035718,1.016059738\n2016-07-29T13:30:00Z,216.46,217.54,216.13,217.12,79519436,2.516339869\n2016-08-01T13:30:00Z,217.19,217.65,216.405,216.94,73311422,-0.443705674\n2016-08-02T13:30:00Z,216.65,216.83,214.57,215.5492,92295506,-12.48361987\n2016-08-03T13:30:00Z,215.48,216.245,215.13,216.18,53993626,2.207220544\n2016-08-04T13:30:00Z,216.31,216.78,214.25,216.4097,46585528,2.026990527\n2016-08-05T13:30:00Z,217.21,218.23,217.07,218.18,71892161,17.12247565\n2016-08-08T13:30:00Z,218.4,218.52,217.74,218.05,39906479,-0.16809291\n2016-08-09T13:30:00Z,218.13,218.76,217.8,218.18,51251728,0.285948687\n2016-08-10T13:30:00Z,218.31,218.4038,217.23,217.64,57941092,-4.316862303\n2016-08-11T13:30:00Z,218.26,218.94,217.95,218.65,72504270,6.422619048\n2016-08-12T13:30:00Z,218.29,218.71,217.99,218.46,61313544,-0.037844037\n2016-08-15T13:30:00Z,218.89,219.5,218.88,219.09,49813482,5.755014327\n2016-08-16T13:30:00Z,218.6,218.68,217.96,217.96,53213621,-10.14102564\n2016-08-17T13:30:00Z,218,218.53,217.02,218.37,75134339,1.530314371\n2016-08-18T13:30:00Z,218.34,218.9,218.21,218.86,52989266,3.56649361\n2016-08-19T13:30:00Z,218.31,218.75,217.74,218.54,75443004,-0.439330544\n2016-08-22T13:30:00Z,218.26,218.8,217.83,218.53,61368766,0.7881691\n2016-08-23T13:30:00Z,219.25,219.6,218.9,218.97,53399159,2.580216535\n2016-08-24T13:30:00Z,218.8,218.91,217.36,217.85,71728949,-10.15397727\n2016-08-25T13:30:00Z,217.4,218.19,217.22,217.7,69224776,-0.774456522\n2016-08-26T13:30:00Z,217.92,219.12,216.25,217.29,122506348,-2.000212224\n2016-08-29T13:30:00Z,217.44,218.665,217.4,218.3608,70502167,7.990006345\n2016-08-30T13:30:00Z,218.26,218.59,217.35,218,58114543,-1.119807169\n2016-08-31T13:30:00Z,217.61,217.75,216.465,217.38,85269453,-5.203389831\n2016-09-01T13:30:00Z,217.37,217.73,216.03,217.39,97844207,-0.180032006\n2016-09-02T13:30:00Z,218.39,218.87,217.7,218.37,79293856,6.781015038\n2016-09-06T13:30:00Z,218.7,219.12,217.86,219.0308,56702089,3.04298419\n2016-09-07T13:30:00Z,218.84,219.22,218.3,219.01,76554855,0.669159021\n2016-09-08T13:30:00Z,218.62,218.94,218.15,218.51,74102880,-3.175432277\n2016-09-09T13:30:00Z,216.97,217.03,213.25,213.28,221589073,-51.34572567\n2016-09-12T13:30:00Z,212.39,216.81,212.31,216.34,168110913,16.73250922\n2016-09-13T13:30:00Z,214.84,215.1499,212.5,213.23,182828839,-16.60031424\n2016-09-14T13:30:00Z,213.29,214.7,212.5,213.15,134185491,-1.9504683\n2016-09-15T13:30:00Z,212.96,215.73,212.75,215.28,145736123,17.40858209\n2016-09-16T13:30:00Z,213.48,213.69,212.57,213.37,155236354,-9.402179359\n2016-09-19T13:30:00Z,214.13,214.88,213.03,213.41,80250490,-1.746754328\n2016-09-20T13:30:00Z,214.41,214.59,213.38,213.42,69665279,-3.528327338\n2016-09-21T13:30:00Z,214.24,216.03,213.44,215.82,110284425,16.85672739\n2016-09-22T13:30:00Z,217,217.53,216.71,217.18,76678713,11.87857681\n2016-09-23T13:30:00Z,216.72,216.88,215.88,215.99,73630921,-10.2667364\n2016-09-26T13:30:00Z,215.02,215.23,214.01,214.24,89827305,-16.12394811\n2016-09-27T13:30:00Z,214.05,215.68,213.62,215.57,78494829,7.563192905\n2016-09-28T13:30:00Z,215.83,216.82,214.71,216.64,87411015,5.820155622\n2016-09-29T13:30:00Z,216.4,216.87,214.04,214.68,128070615,-14.02617477\n2016-09-30T13:30:00Z,215.65,217.12,215.36,216.3,117202914,9.131916996\n2016-10-03T13:30:00Z,215.82,216.04,215.04,215.78,83512057,-2.300048356\n2016-10-04T13:30:00Z,215.91,216.17,213.99,214.68,119948052,-8.812071918\n2016-10-05T13:30:00Z,215.41,216.13,215.33,215.63,72815963,4.760580279\n2016-10-06T13:30:00Z,215.37,216.04,214.735,215.78,62927376,1.686351103\n2016-10-07T13:30:00Z,216.1,216.3,214.19,215.04,89788255,-5.243855932\n2016-10-10T13:30:00Z,216.155,216.7,215.985,216.16,51855023,6.125\n2016-10-11T13:30:00Z,215.66,215.74,212.58,213.43,130367373,-25.51098443\n2016-10-12T13:30:00Z,213.59,214.32,213.01,213.71,73866117,-0.647841365\n2016-10-13T13:30:00Z,212.16,213.59,211.21,213.01,101356960,-1.549848178\n2016-10-14T13:30:00Z,214.15,214.69,213.03,213.12,93346237,-1.073705179\n2016-10-17T13:30:00Z,213.09,213.39,212.17,212.38,58275674,-5.435173435\n2016-10-18T13:30:00Z,214.24,214.31,213.27,213.71,76869656,6.439379699\n2016-10-19T13:30:00Z,214.02,214.64,213.6,214.28,66519224,2.813299574\n2016-10-20T13:30:00Z,213.87,214.53,213.11,213.88,73639830,-1.625\n2016-10-21T13:30:00Z,212.96,214.08,212.76,213.98,89089092,3.241965974\n2016-10-24T13:30:00Z,215,215.32,214.48,214.89,60146592,6.911710037\n2016-10-25T13:30:00Z,214.68,214.98,213.98,214.17,66542329,-5.549118005\n2016-10-26T13:30:00Z,213.21,214.42,212.93,213.74,75705478,-1.401468315\n2016-10-27T13:30:00Z,214.58,214.62,213.08,213.17,77220213,-3.757100149\n2016-10-28T13:30:00Z,213.14,213.93,211.71,212.54,140623183,-4.549198251\n2016-10-31T13:30:00Z,212.93,213.19,212.36,212.55,61272507,-1.367984694\n2016-11-01T13:30:00Z,212.93,212.99,209.6,211.01,122781818,-13.72892755\n2016-11-02T13:30:00Z,210.65,211.1,209.23,209.74,103330806,-10.43856383\n2016-11-03T13:30:00Z,209.99,210.24,208.46,208.78,88939346,-7.143212951\n2016-11-04T13:30:00Z,208.91,209.89,208.38,208.55,109122059,-2.727155172\n2016-11-07T14:30:00Z,211.45,213.19,211.3,213.15,109794861,46.33084948\n2016-11-08T14:30:00Z,212.69,214.77,212.38,214.11,106772138,7.535301954\n2016-11-09T14:30:00Z,212.37,217.1,212.34,216.3792,258428972,16.9111828\n2016-11-10T14:30:00Z,217.3,218.31,215.22,216.92,172113313,3.990062862\n2016-11-11T14:30:00Z,216.08,216.7,215.32,216.42,100552732,-2.681388013\n2016-11-14T14:30:00Z,217.03,217.27,215.72,216.59,94579982,0.113723242\n2016-11-15T14:30:00Z,217.04,218.28,216.8,218.28,91652580,13.70943953\n2016-11-16T14:30:00Z,217.56,218.14,217.42,217.87,65617697,0.26875\n2016-11-17T14:30:00Z,218.05,219.06,217.92,218.99,69797191,9.981514085\n2016-11-18T14:30:00Z,219.07,219.27,218.29,218.5,86265751,-1.944444444\n2016-11-21T14:30:00Z,219.17,220.18,219,220.15,72402638,13.33783784\n2016-11-22T14:30:00Z,220.51,220.79,219.73,220.58,67428957,2.176245211\n2016-11-23T14:30:00Z,219.98,220.76,219.75,220.7,56620237,2.511709246\n2016-11-25T14:30:00Z,221.1,221.56,221.01,221.52,37872255,7.348870057\n2016-11-28T14:30:00Z,221.16,221.48,220.36,220.48,76572511,-7.424698795\n2016-11-29T14:30:00Z,220.52,221.44,220.17,220.91,69886690,1.895833333\n2016-11-30T14:30:00Z,221.63,221.82,220.31,220.38,113291793,-3.741543546\n2016-12-01T14:30:00Z,220.73,220.73,219.15,219.57,79040487,-6.915703435\n2016-12-02T14:30:00Z,219.67,220.25,219.26,219.68,74840347,-0.581054688\n2016-12-05T14:30:00Z,220.65,221.4,220.42,221,67837821,11.90249538\n2016-12-06T14:30:00Z,221.22,221.7441,220.662,221.7,59877377,4.085599511\n2016-12-07T14:30:00Z,221.52,224.67,221.38,224.6,110738050,24.82258065\n2016-12-08T14:30:00Z,224.57,225.7,224.26,225.15,99714387,5.008484163\n2016-12-09T14:30:00Z,225.41,226.53,225.37,226.51,88005766,12.52606007\n2016-12-12T14:30:00Z,226.4,226.96,225.76,226.25,102016125,-0.190677966\n2016-12-13T14:30:00Z,227.02,228.34,227,227.76,110477485,13.73332739\n2016-12-14T14:30:00Z,227.41,228.23,225.365,225.88,142501812,-12.07315574\n2016-12-15T14:30:00Z,226.16,227.81,225.8904,226.81,124972554,4.561405647\n2016-12-16T14:30:00Z,226.01,226.08,224.67,225.04,156420152,-14.445\n2016-12-19T14:30:00Z,225.25,226.02,225.08,225.53,90341147,1.973752599\n2016-12-20T14:30:00Z,226.15,226.57,225.88,226.4,89838810,7.403743316\n2016-12-21T14:30:00Z,226.25,226.45,225.77,225.77,67909039,-4.28219697\n2016-12-22T14:30:00Z,225.6,225.74,224.92,225.38,56219071,-3.44895288\n2016-12-23T14:30:00Z,225.43,225.72,225.21,225.71,36697822,1.560840708\n2016-12-27T14:30:00Z,226.02,226.73,226,226.27,42672487,5.093253968\n2016-12-28T14:30:00Z,226.57,226.59,224.27,224.4,64095014,-15.17576076\n2016-12-29T14:30:00Z,224.48,224.89,223.84,224.35,48696080,-1.445054945\n2016-12-30T14:30:00Z,224.73,224.83,222.73,223.53,108998328,-6.896395076\n2017-01-03T14:30:00Z,225.04,225.83,223.8837,225.24,91366522,8.957864763\n2017-01-04T14:30:00Z,225.62,226.75,225.61,226.58,78744433,12.835\n2017-01-05T14:30:00Z,226.27,226.58,225.48,226.4,78379012,0.641324627\n2017-01-06T14:30:00Z,226.53,227.75,225.9,227.21,71559922,5.300049801\n2017-01-09T14:30:00Z,226.91,227.0701,226.4163,226.46,46939676,-4.468031469\n2017-01-10T14:30:00Z,226.48,227.45,226.01,226.46,63771939,-0.488224638\n2017-01-11T14:30:00Z,226.36,227.1,225.59,227.1,74650016,3.607054455\n2017-01-12T14:30:00Z,226.5,226.75,224.955,226.53,72113181,-2.301769142\n2017-01-13T14:30:00Z,226.73,227.4,226.69,227.05,62717865,4.6875\n2017-01-17T14:30:00Z,226.31,226.78,225.8,226.25,61240814,-4.903242678\n2017-01-18T14:30:00Z,226.535,226.8,225.9,226.75,54793302,2.225922131\n2017-01-19T14:30:00Z,226.84,227,225.41,225.91,66608787,-6.375190114\n2017-01-20T14:30:00Z,226.7,227.31,225.9719,226.74,129168623,3.373684868\n2017-01-23T14:30:00Z,226.35,226.805,225.27,226.15,75061645,-4.04368932\n2017-01-24T14:30:00Z,226.4,228.08,226.27,227.6,95555295,12.56510417\n2017-01-25T14:30:00Z,228.7,229.57,228.51,229.57,84437712,18.35003444\n2017-01-26T14:30:00Z,229.4,229.71,229.01,229.33,59970719,-0.219346049\n2017-01-27T14:30:00Z,229.42,229.59,228.76,228.97,59711118,-2.532632743\n2017-01-30T14:30:00Z,228.17,228.2,226.41,227.55,79737252,-12.88743169\n2017-01-31T14:30:00Z,226.98,227.6,226.32,227.53,75880805,0.535714286\n2017-02-01T14:30:00Z,228.255,228.59,226.94,227.62,79117651,-0.333566434\n2017-02-02T14:30:00Z,227.2,228.1,226.82,227.77,69657560,0.960034752\n2017-02-03T14:30:00Z,228.82,229.55,228.46,229.34,80563168,13.91065769\n2017-02-06T14:30:00Z,228.87,229.326,228.54,228.93,57790108,-1.354279523\n2017-02-07T14:30:00Z,229.38,229.6556,228.72,228.94,57931151,-0.930280875\n2017-02-08T14:30:00Z,228.61,229.39,228.31,229.24,51566218,1.670955882\n2017-02-09T14:30:00Z,229.56,230.95,229.52,230.6,65955245,12.60537265\n2017-02-10T14:30:00Z,231,231.77,230.6216,231.51,66015892,7.342384794\n2017-02-13T14:30:00Z,232.08,233.07,232.05,232.77,55182050,11.91666667\n2017-02-14T14:30:00Z,232.56,233.71,232.16,233.7,71108983,5.70446299\n2017-02-15T14:30:00Z,233.45,235.14,233.39,234.92,86785826,9.906633907\n2017-02-16T14:30:00Z,234.96,235.155,233.85,234.72,84722437,0.189928999\n2017-02-17T14:30:00Z,233.95,235.09,233.93,235.09,77204104,3.56147541\n2017-02-21T14:30:00Z,235.52,236.69,235.51,236.49,88946051,12.95522388\n2017-02-22T14:30:00Z,236.02,236.54,235.83,236.28,62115185,0.703740157\n2017-02-23T14:30:00Z,236.88,236.9,235.56,236.44,74615902,0.016014235\n2017-02-24T14:30:00Z,235.46,236.7932,235.41,236.74,82381612,3.578304983\n2017-02-27T14:30:00Z,236.64,237.31,236.35,237.11,56515440,2.574462891\n2017-02-28T14:30:00Z,236.67,236.95,236.015,236.47,96961938,-3.761796358\n2017-03-01T14:30:00Z,238.39,240.32,238.37,239.78,149158170,32.26006356\n2017-03-02T14:30:00Z,239.56,239.57,238.21,238.27,70245978,-9.785431034\n2017-03-03T14:30:00Z,238.17,238.61,237.73,238.42,81974300,-0.133316008\n2017-03-06T14:30:00Z,237.5,238.12,237.01,237.71,55391533,-3.614957467\n2017-03-07T14:30:00Z,237.36,237.77,236.76,237,65103737,-4.680147059\n2017-03-08T14:30:00Z,237.34,237.64,236.4,236.56,78168795,-2.766917293\n2017-03-09T14:30:00Z,236.7,237.24,235.74,236.86,90683918,0.559365782\n2017-03-10T14:30:00Z,237.97,238.02,236.59,237.69,81991652,3.600340136\n2017-03-13T13:30:00Z,237.62,237.86,237.24,237.81,57256824,0.591032609\n2017-03-14T13:30:00Z,237.18,237.24,236.19,236.9,59880778,-7.341998192\n2017-03-15T13:30:00Z,237.56,239.44,237.29,238.95,96081750,17.58410973\n2017-03-16T13:30:00Z,239.11,239.2,238.1,238.48,78343951,-1.605677893\n2017-03-17T13:30:00Z,237.75,237.97,237.03,237.03,89002111,-13.18334104\n2017-03-20T13:30:00Z,237.03,237.36,236.32,236.77,52536979,-2.073258197\n2017-03-21T13:30:00Z,237.47,237.61,233.58,233.73,131809275,-24.22199328\n2017-03-22T13:30:00Z,233.77,234.61,233.05,234.28,97569204,-0.286573146\n2017-03-23T13:30:00Z,234,235.34,233.6,234.03,100410277,-0.381358768\n2017-03-24T13:30:00Z,234.38,235.04,232.96,233.86,112504853,-1.353517964\n2017-03-27T13:30:00Z,231.93,233.92,231.61,233.62,87454452,2.737576844\n2017-03-28T13:30:00Z,233.27,235.81,233.14,235.32,93483915,13.93093169\n2017-03-29T13:30:00Z,234.99,235.81,234.725,235.54,60786374,2.345314945\n2017-03-30T13:30:00Z,235.47,236.52,235.27,236.29,56737890,5.727702703\n2017-03-31T13:30:00Z,235.9,236.51,235.68,235.74,73733094,-1.565519324\n2017-04-03T13:30:00Z,235.8,236.03,233.91,235.33,85546486,-3.627170139\n2017-04-04T13:30:00Z,235,235.58,234.555,235.48,56466195,1.15529267\n2017-04-05T13:30:00Z,236.26,237.39,234.54,234.78,108800604,-5.305555556\n2017-04-06T13:30:00Z,234.94,236.04,234.425,235.44,69135757,2.14231738\n2017-04-07T13:30:00Z,235.15,236,234.64,235.2,74412311,-0.303030303\n2017-04-10T13:30:00Z,235.36,236.255,234.73,235.34,67615302,0.611128049\n2017-04-11T13:30:00Z,234.9,235.18,233.34,235.06,88045276,-1.331168831\n2017-04-12T13:30:00Z,234.74,234.96,233.77,234.03,81864436,-8.471923828\n2017-04-13T13:30:00Z,233.64,234.49,232.51,232.51,92880394,-9.962340672\n2017-04-17T13:30:00Z,233.11,234.57,232.88,234.57,68405367,14.96364426\n2017-04-18T13:30:00Z,233.72,234.49,233.08,233.87,83225821,-1.334022039\n2017-04-19T13:30:00Z,234.52,234.95,233.18,233.44,68699868,-3.482365145\n2017-04-20T13:30:00Z,234.15,235.845,233.78,235.34,92572186,13.35111028\n2017-04-21T13:30:00Z,235.25,235.31,234.13,234.59,110389847,-3.964928811\n2017-04-24T13:30:00Z,237.18,237.41,236.61,237.17,119209877,21.50696203\n2017-04-25T13:30:00Z,237.91,238.95,237.81,238.55,75050935,12.91260684\n2017-04-26T13:30:00Z,238.51,239.53,238.35,238.4,84702455,-0.205690299\n2017-04-27T13:30:00Z,238.77,238.95,237.98,238.6,57410326,0.301535088\n2017-04-28T13:30:00Z,238.9,238.93,237.93,238.08,63532845,-3.90632494\n2017-05-01T13:30:00Z,238.68,239.17,238.195,238.68,66882521,2.17449495\n2017-05-02T13:30:00Z,238.84,238.98,238.3,238.77,57375732,0.192095588\n2017-05-03T13:30:00Z,238.29,238.8775,237.7,238.48,73137731,-1.189199791\n2017-05-04T13:30:00Z,238.83,238.9225,237.78,238.76,61462732,1.075367647\n2017-05-05T13:30:00Z,239.19,239.72,238.68,239.7,62001269,6.680851064\n2017-05-08T13:30:00Z,239.75,239.92,239.17,239.66,48385730,0.160434473\n2017-05-09T13:30:00Z,239.96,240.19,239.04,239.44,51363200,-1.660714286\n2017-05-10T13:30:00Z,239.39,239.87,239.15,239.87,54293799,1.707352941\n2017-05-11T13:30:00Z,239.35,239.57,238.13,239.38,62358346,-2.257675439\n2017-05-12T13:30:00Z,239.09,239.4273,238.67,238.98,53912730,-2.5964713\n2017-05-15T13:30:00Z,239.47,240.44,239.45,240.3,61918937,12.43987026\n2017-05-16T13:30:00Z,240.64,240.67,239.63,240.08,51241791,-0.981838677\n2017-05-17T13:30:00Z,238.1,238.64,235.75,235.82,172174107,-39.98033333\n2017-05-18T13:30:00Z,235.73,237.75,235.43,236.77,107047656,3.756487889\n2017-05-19T13:30:00Z,237.33,239.08,237.27,238.31,115011373,14.25080819\n2017-05-22T13:30:00Z,238.9,239.71,238.82,239.52,61010602,11.11061151\n2017-05-23T13:30:00Z,239.95,240.24,239.51,240.05,48341683,3.737288136\n2017-05-24T13:30:00Z,240.32,240.73,239.93,240.61,49181099,3.760606061\n2017-05-25T13:30:00Z,241.2,242.08,240.96,241.76,64071661,10.09449269\n2017-05-26T13:30:00Z,241.54,241.9,241.45,241.71,46629905,0.574682203\n2017-05-30T13:30:00Z,241.34,241.79,241.16,241.5,35201897,-0.447258364\n2017-05-31T13:30:00Z,241.84,241.88,240.64,241.44,91796016,-0.923828125\n2017-06-01T13:30:00Z,241.97,243.38,241.64,243.36,68962024,15.71875\n2017-06-02T13:30:00Z,243.42,244.35,243.08,244.17,88666128,5.86234544\n2017-06-05T13:30:00Z,243.97,244.3,243.76,243.99,44698825,0.061640893\n2017-06-06T13:30:00Z,243.34,243.98,243.12,243.21,50375430,-5.25\n2017-06-07T13:30:00Z,243.6,243.92,242.83,243.66,54144311,1.769070156\n2017-06-08T13:30:00Z,243.77,244.33,243.17,243.78,65950691,0.49893617\n2017-06-09T13:30:00Z,244.09,245.01,241.95,243.41,132256362,-2.642295918\n2017-06-12T13:30:00Z,243.13,243.42,242.38,243.36,86108102,-0.558626033\n2017-06-13T13:30:00Z,243.98,244.61,243.5799,244.55,60066953,9.99762536\n2017-06-14T13:30:00Z,244.86,244.87,243.29,244.24,78602311,-2.183055152\n2017-06-15T13:30:00Z,242.68,243.91,242.36,243.77,66464888,-0.502673797\n2017-06-16T13:30:00Z,242.77,242.83,241.6337,242.64,84553097,-6.352952696\n2017-06-19T13:30:00Z,243.59,244.73,243.48,244.66,65123802,19.35398311\n2017-06-20T13:30:00Z,244.25,244.26,242.99,243.01,56906368,-12.02940647\n2017-06-21T13:30:00Z,243.42,243.59,242.41,242.95,55977569,-1.522651007\n2017-06-22T13:30:00Z,242.96,243.53,242.64,242.84,44148059,-1.03442928\n2017-06-23T13:30:00Z,242.91,243.51,242.47,243.13,66986801,1.448014019\n2017-06-26T13:30:00Z,243.9,244.38,243.045,243.29,56700477,-0.505845324\n2017-06-27T13:30:00Z,243.04,243.38,241.31,241.33,82247666,-16.52320022\n2017-06-28T13:30:00Z,242.5,243.715,242.23,243.49,70042599,14.05446429\n2017-06-29T13:30:00Z,243.66,243.72,239.955,241.35,106949719,-16.78023754\n2017-06-30T13:30:00Z,242.28,242.71,241.575,241.8,86820694,-1.711643836\n2017-07-03T13:30:00Z,242.88,243.38,242.21,242.21,39153806,-0.297240803\n2017-07-05T13:30:00Z,242.63,243.01,241.7,242.77,54427596,1.565143824\n2017-07-06T13:30:00Z,241.89,242.03,240.34,240.55,66115317,-20.69704654\n2017-07-07T13:30:00Z,241.21,242.28,240.5645,242.11,57972268,8.801330337\n2017-07-10T13:30:00Z,241.95,242.8,241.76,242.37,36663274,2.369318182\n2017-07-11T13:30:00Z,242.16,242.55,240.85,242.19,50354614,-0.315789474\n2017-07-12T13:30:00Z,243.3,244.2,243.3,244.01,59610405,18.74711538\n2017-07-13T13:30:00Z,244.02,244.55,243.76,244.42,39471637,2.747093023\n2017-07-14T13:30:00Z,244.43,245.97,244.31,245.56,60262692,9.935191761\n2017-07-17T13:30:00Z,245.47,245.91,245.33,245.53,33531917,0.716485507\n2017-07-18T13:30:00Z,245.06,245.72,244.67,245.66,42742498,2.245892019\n2017-07-19T13:30:00Z,246.02,247,246.01,246.99,51034260,12.51473384\n2017-07-20T13:30:00Z,247.28,247.42,246.47,247.1,47135183,0.715408805\n2017-07-21T13:30:00Z,246.44,246.91,246.18,246.88,88711019,-0.297413793\n2017-07-24T13:30:00Z,246.79,246.98,246.28,246.82,46622256,0.300925926\n2017-07-25T13:30:00Z,247.68,247.8,247.16,247.42,54915591,3.577599388\n2017-07-26T13:30:00Z,247.75,247.79,247.13,247.43,47575422,-0.685775862\n2017-07-27T13:30:00Z,247.96,248,245.68,247.2,70766568,-3.14453125\n2017-07-28T13:30:00Z,246.65,247.06,246.13,246.91,50088359,-1.966911765\n2017-07-31T13:30:00Z,247.37,247.48,246.53,246.77,65838659,-1.316194581\n2017-08-01T13:30:00Z,247.46,247.5,246.716,247.32,55050401,1.612018201\n2017-08-02T13:30:00Z,247.47,247.6,246.37,247.44,47211216,0.328557312\n2017-08-03T13:30:00Z,247.31,247.34,246.64,246.96,40855997,-4.372937294\n2017-08-04T13:30:00Z,247.52,247.79,246.97,247.41,60191838,1.748116438\n2017-08-07T13:30:00Z,247.49,247.87,247.37,247.87,31995021,3.392772512\n2017-08-08T13:30:00Z,247.51,248.91,246.83,247.26,61719353,-1.912643678\n2017-08-09T13:30:00Z,246.47,247.31,246.06,247.25,62632619,1.814285714\n2017-08-10T13:30:00Z,246.29,246.44,243.7,243.76,120479470,-30.29191617\n2017-08-11T13:30:00Z,244.02,244.8,243.75,244.12,74869947,-0.859583952\n2017-08-14T13:30:00Z,245.59,246.79,245.55,246.54,73291919,24.60984848\n2017-08-15T13:30:00Z,246.98,247,246.16,246.51,55242746,-0.07337587\n2017-08-16T13:30:00Z,247.11,247.57,246.45,246.94,56715544,1.217929293\n2017-08-17T13:30:00Z,246.24,246.6,243.09,243.09,128490396,-35.34230188\n2017-08-18T13:30:00Z,242.9,244.189,242.2,242.71,136747986,-3.123283585\n2017-08-21T13:30:00Z,242.64,243.2,241.83,242.9,65469736,1.057319224\n2017-08-22T13:30:00Z,243.57,245.62,243.55,245.44,63140101,24.46341463\n2017-08-23T13:30:00Z,244.33,245.05,244.16,244.56,50203837,-1.533011272\n2017-08-24T13:30:00Z,245,245.18,243.75,243.99,50741671,-3.462920168\n2017-08-25T13:30:00Z,244.9,245.61,244.39,244.56,64445912,0.89293722\n2017-08-28T13:30:00Z,245.17,245.2,244.09,244.57,40565606,-1.255230126\n2017-08-29T13:30:00Z,243.06,245.15,242.93,244.85,51135715,4.433016878\n2017-08-30T13:30:00Z,244.83,246.32,244.62,246.01,62030805,9.401411525\n2017-08-31T13:30:00Z,246.72,247.77,246.0473,247.49,103803880,11.66793528\n2017-09-01T13:30:00Z,247.92,248.33,247.67,247.84,62006989,2.799071618\n2017-09-05T13:30:00Z,247.26,247.52,244.95,246.06,91398777,-15.76363636\n2017-09-06T13:30:00Z,246.84,247.28,246.23,246.9,57916867,3.028745645\n2017-09-07T13:30:00Z,247.25,247.27,246.4,246.87,58034730,-0.723870056\n2017-09-08T13:30:00Z,246.54,247.11,246.3,246.58,63832825,-1.436809392\n2017-09-11T13:30:00Z,248.04,249.3,248.02,249.21,71364848,27.2761194\n2017-09-12T13:30:00Z,249.63,250.09,249.42,250.05,56896027,6.916861827\n2017-09-13T13:30:00Z,249.72,250.21,249.59,250.17,59228002,1.784482759\n2017-09-14T13:30:00Z,249.8,250.32,249.6,250.09,95446349,0.759572072\n2017-09-15T13:30:00Z,248.69,249.29,248.57,249.19,95432382,-4.600628931\n2017-09-18T13:30:00Z,249.61,250.12,249.28,249.72,46235238,4.086014851\n2017-09-19T13:30:00Z,250,250.07,249.6,249.97,47108148,1.154208543\n2017-09-20T13:30:00Z,250.07,250.19,248.92,250.06,59574083,0.398116438\n2017-09-21T13:30:00Z,249.88,249.98,249.185,249.39,48211398,-5.99113806\n2017-09-22T13:30:00Z,249.05,249.63,249.02,249.44,51214032,0.386732082\n2017-09-25T13:30:00Z,249.15,249.5532,248.08,248.93,57064357,-2.82756096\n2017-09-26T13:30:00Z,249.42,249.7,248.805,249.08,54081959,-0.379934211\n2017-09-27T13:30:00Z,249.88,250.49,248.87,250.05,81001426,5.01356305\n2017-09-28T13:30:00Z,249.73,250.44,249.63,250.35,44778841,2.009164223\n2017-09-29T13:30:00Z,250.34,251.32,250.13,251.23,85578002,6.671003717\n2017-10-02T13:30:00Z,251.49,252.32,251.2926,252.32,59022985,9.185602365\n2017-10-03T13:30:00Z,252.46,252.89,252.23,252.86,66810169,3.891030259\n2017-10-04T13:30:00Z,252.69,253.44,252.56,253.16,55953619,2.348852041\n2017-10-05T13:30:00Z,253.54,254.68,253.196,254.66,63522757,12.77323248\n2017-10-06T13:30:00Z,254.15,254.7008,253.85,254.37,80645998,0.4476919\n2017-10-09T13:30:00Z,254.63,254.7,253.65,253.95,35803138,-2.871040724\n2017-10-10T13:30:00Z,254.6,255.05,253.98,254.62,43057363,2.793824701\n2017-10-11T13:30:00Z,254.51,255.02,254.32,255.02,47674325,2.340425532\n2017-10-12T13:30:00Z,254.66,255.06,254.365,254.64,47080269,-1.306515957\n2017-10-13T13:30:00Z,255.14,255.27,254.64,254.95,54800435,1.302165354\n2017-10-16T13:30:00Z,255.21,255.51,254.82,255.29,38521675,1.577966102\n2017-10-17T13:30:00Z,255.23,255.52,254.98,255.47,31560964,1.107142857\n2017-10-18T13:30:00Z,255.9,255.95,255.5,255.72,40888330,1.257142857\n2017-10-19T13:30:00Z,254.83,255.83,254.35,255.79,61903788,2.83545082\n2017-10-20T13:30:00Z,256.7,257.14,255.7744,257.11,89176377,9.275154148\n2017-10-23T13:30:00Z,257.48,257.51,256.02,256.11,63915306,-6.76972135\n2017-10-24T13:30:00Z,256.6,256.83,256.15,256.56,66935910,0.377697842\n2017-10-25T13:30:00Z,256.18,256.31,254,255.29,103715291,-11.28834356\n2017-10-26T13:30:00Z,255.99,256.3,255.48,255.62,69797972,-0.430082418\n2017-10-27T13:30:00Z,256.47,257.89,255.6254,257.71,85562544,15.73683416\n2017-10-30T13:30:00Z,257.07,257.6,256.41,256.75,54285687,-4.232315113\n2017-10-31T13:30:00Z,257.18,257.44,256.805,257.15,60304781,1.771464646\n2017-11-01T13:30:00Z,258.04,258.43,257.07,257.49,54202736,0.336380256\n2017-11-02T13:30:00Z,257.41,257.75,256.19,257.59,56449535,0.25128866\n2017-11-03T13:30:00Z,257.77,258.5,257.3,258.45,59589730,5.6875\n2017-11-06T14:30:00Z,258.3,259,258.22,258.85,49652598,3.057565789\n2017-11-07T14:30:00Z,258.97,259.35,258.09,258.67,57502161,-0.654293381\n2017-11-08T14:30:00Z,258.47,259.22,258.15,259.11,50469579,2.056495633\n2017-11-09T14:30:00Z,257.73,258.39,256.36,258.17,95085497,-3.774509804\n2017-11-10T14:30:00Z,257.73,258.2926,257.37,258.09,59984662,1.016850668\n2017-11-13T14:30:00Z,257.31,258.59,257.27,258.33,50228648,3.053191489\n2017-11-14T14:30:00Z,257.41,257.85,256.52,257.73,61315152,-1.146746575\n2017-11-15T14:30:00Z,256.62,257.22,255.63,256.44,80811525,-8.863636364\n2017-11-16T14:30:00Z,257.52,259.04,257.4748,258.62,67777027,20.5072617\n2017-11-17T14:30:00Z,258.22,258.5882,257.77,257.86,75756833,-3.185296637\n2017-11-20T14:30:00Z,258.14,258.525,257.86,258.3,48075514,2.367135762\n2017-11-21T14:30:00Z,259.18,260.2,259.18,259.99,69176799,16.90208333\n2017-11-22T14:30:00Z,260,260.15,259.57,259.76,45033392,-0.494808307\n2017-11-24T14:30:00Z,260.32,260.48,260.16,260.36,27746365,4.344827586\n2017-11-27T14:30:00Z,260.41,260.75,260,260.23,52274922,-0.673519737\n2017-11-28T14:30:00Z,260.76,262.9,260.655,262.87,98971719,24.33941059\n2017-11-29T14:30:00Z,263.02,263.63,262.2,262.71,77512102,0.515644955\n2017-11-30T14:30:00Z,263.76,266.05,263.67,265.01,127894389,20.23542553\n2017-12-01T14:30:00Z,264.76,265.31,260.76,264.46,164390902,-2.116805913\n2017-12-04T14:30:00Z,266.31,266.8,264.08,264.14,94040560,-7.744186047\n2017-12-05T14:30:00Z,264.43,265.15,263.04,263.19,77994544,-5.475377003\n2017-12-06T14:30:00Z,262.87,263.73,262.71,263.24,75898566,-0.190319549\n2017-12-07T14:30:00Z,263.09,264.43,262.94,264.07,77218569,6.638526856\n2017-12-08T14:30:00Z,264.99,265.52,264.72,265.51,76563873,12.86610401\n2017-12-11T14:30:00Z,265.58,266.38,265.4793,266.31,83077533,6.831825458\n2017-12-12T14:30:00Z,266.57,267.32,266.345,266.78,85195750,4.069547872\n2017-12-13T14:30:00Z,267.06,267.56,266.65,266.75,102905409,-0.671103896\n2017-12-14T14:30:00Z,267.09,267.22,265.6,265.66,100666692,-7.97082106\n2017-12-15T14:30:00Z,265.45,267.04,265.39,266.51,144610290,4.393057285\n2017-12-18T14:30:00Z,268.1,268.6,267.98,268.2,83676072,16.16685957\n2017-12-19T14:30:00Z,268.48,268.53,267.09,267.17,82382876,-7.860921502\n2017-12-20T14:30:00Z,268.27,268.33,266.69,267.03,76751500,-4.007306226\n2017-12-21T14:30:00Z,267.74,268.385,267.3,267.58,67032339,0.885620915\n2017-12-22T14:30:00Z,267.6,267.635,266.9,267.51,78720873,-0.85\n2017-12-26T14:30:00Z,267.05,267.4377,266.885,267.19,45244433,-1.741151754\n2017-12-27T14:30:00Z,267.38,267.73,267.01,267.32,57750986,0.603476821\n2017-12-28T14:30:00Z,267.89,267.92,267.45,267.87,45116139,3.579545455\n2017-12-29T14:30:00Z,268.53,268.55,266.64,266.86,96007424,-7.42656658\n2018-01-02T14:30:00Z,267.84,268.81,267.4,268.77,86655749,11.37403159\n2018-01-03T14:30:00Z,268.96,270.64,268.96,270.47,90070416,15.64640411\n2018-01-04T14:30:00Z,271.2,272.16,270.5447,271.61,80636408,8.961853188\n2018-01-05T14:30:00Z,272.51,273.56,271.95,273.42,83523995,15.32744024\n2018-01-08T14:30:00Z,273.31,274.1,272.98,273.92,57319192,3.256493506\n2018-01-09T14:30:00Z,274.4,275.25,274.081,274.54,57253957,4.995207739\n2018-01-10T14:30:00Z,273.68,274.42,272.92,274.12,69574318,-1.047413793\n2018-01-11T14:30:00Z,274.75,276.12,274.56,276.12,62361455,18.48544974\n2018-01-12T14:30:00Z,276.42,278.11,276.0819,277.92,90816076,15.17568073\n2018-01-16T14:30:00Z,279.35,280.09,276.18,276.97,106555142,-5.586420653\n2018-01-17T14:30:00Z,278.03,280.05,276.97,279.61,113258799,14.85\n2018-01-18T14:30:00Z,279.48,279.96,278.58,279.14,100728006,-0.888556338\n2018-01-19T14:30:00Z,279.8,280.41,279.14,280.41,140920098,8.728321033\n2018-01-22T14:30:00Z,280.17,282.69,280.11,282.69,91322408,19.25640439\n2018-01-23T14:30:00Z,282.74,283.62,282.37,283.29,97084700,4.653091755\n2018-01-24T14:30:00Z,284.02,284.7,281.84,283.18,134816117,-1.186665972\n2018-01-25T14:30:00Z,284.16,284.27,282.405,283.3,84587313,-1.707228916\n2018-01-26T14:30:00Z,284.25,286.6285,283.96,286.58,107743119,27.38360627\n2018-01-29T14:30:00Z,285.93,286.43,284.5,284.68,90118337,-9.75942029\n2018-01-30T14:30:00Z,282.6,284.736,281.22,281.76,131796419,-20.63087698\n2018-01-31T14:30:00Z,282.73,283.3,280.68,281.9,118948131,-1.649514134\n2018-02-01T14:30:00Z,281.07,283.06,280.68,281.58,90102470,-0.803019324\n2018-02-02T14:30:00Z,280.08,280.23,275.41,275.45,173174790,-57.04643731\n2018-02-05T14:30:00Z,273.45,275.85,263.31,263.93,294681820,-96.59210166\n2018-02-06T14:30:00Z,259.94,269.7,258.7,269.13,355026780,19.98530923\n2018-02-07T14:30:00Z,268.5,272.36,267.58,267.67,167376100,1.20511745\n2018-02-08T14:30:00Z,268.01,268.17,257.59,257.63,246449505,-90.15643105\n2018-02-09T14:30:00Z,260.8,263.61,252.92,261.5,283565310,4.571650358\n2018-02-12T14:30:00Z,263.83,267.01,261.6644,265.34,143735976,29.31871118\n2018-02-13T14:30:00Z,263.97,266.62,263.31,266,81223640,7.061991525\n2018-02-14T14:30:00Z,264.31,270,264.3,269.59,120735685,27.1345147\n2018-02-15T14:30:00Z,271.57,273.04,268.77,273.03,111200286,21.17676655\n2018-02-16T14:30:00Z,272.32,275.32,272.27,273.11,160420135,3.520497804\n2018-02-20T14:30:00Z,272.03,273.67,270.5,271.4,86369662,-8.852589087\n2018-02-21T14:30:00Z,271.9,274.72,269.94,270.05,98883740,-10.22265823\n2018-02-22T14:30:00Z,271.1,273.05,269.64,270.4,110511290,-2.239347966\n2018-02-23T14:30:00Z,271.79,274.71,271.25,274.71,92766428,37.12199815\n2018-02-26T14:30:00Z,275.93,278.01,275.26,277.9,86491406,26.9415779\n2018-02-27T14:30:00Z,278.11,278.92,274.36,274.43,99099165,-21.09593023\n2018-02-28T14:30:00Z,275.68,276.19,271.29,271.65,121907767,-19.27094072\n2018-03-01T14:30:00Z,271.41,273.17,266,267.7,176855077,-29.41808698\n2018-03-02T14:30:00Z,265.8,269.72,264.82,269.08,139083217,6.463320463\n2018-03-05T14:30:00Z,267.73,272.89,267.61,272.19,97307387,24.04672131\n2018-03-06T14:30:00Z,273.3,273.39,271.18,272.88,79213163,3.597744361\n2018-03-07T14:30:00Z,270.42,273.18,270.2,272.78,87063502,5.29376013\n2018-03-08T14:30:00Z,273.55,274.24,272.42,274.1,66901150,8.273080913\n2018-03-09T14:30:00Z,275.7,278.87,275.34,278.87,113625335,45.14464286\n2018-03-12T13:30:00Z,279.2,279.91,278.0801,278.52,71924793,0.254061165\n2018-03-13T13:30:00Z,279.84,280.41,276.03,276.72,91968937,-12.07376374\n2018-03-14T13:30:00Z,277.81,278.02,274.67,275.3,105895079,-10.71844734\n2018-03-15T13:30:00Z,275.88,276.61,274.43,275,83433038,-3.988034283\n2018-03-16T13:30:00Z,274.5,275.39,274.14,274.2,100343673,-4.278061224\n2018-03-19T13:30:00Z,273.35,273.38,268.62,270.49,109208442,-34.67552431\n2018-03-20T13:30:00Z,270.94,271.67,270.18,270.95,59757271,-0.8361678\n2018-03-21T13:30:00Z,270.9,273.27,270.19,270.43,78709578,-3.53974047\n2018-03-22T13:30:00Z,267.91,268.87,263.36,263.67,148785916,-62.04869782\n2018-03-23T13:30:00Z,264.17,265.02,257.83,258.05,183534751,-43.09212121\n2018-03-26T13:30:00Z,262.13,265.43,259.41,265.11,141956102,39.34356015\n2018-03-27T13:30:00Z,266.17,266.77,258.84,260.6,129941445,-29.58825648\n2018-03-28T13:30:00Z,260.75,262.64,258.58,259.83,146452306,-6.132393398\n2018-03-29T13:30:00Z,261.12,265.26,259.8389,263.15,124244790,24.63304851\n2018-04-02T13:30:00Z,262.55,263.13,254.67,257.47,186286343,-45.53188527\n2018-04-03T13:30:00Z,258.87,261.31,256.84,260.77,119956861,12.45993031\n2018-04-04T13:30:00Z,256.75,264.355,256.6,263.56,123715339,21.12234204\n2018-04-05T13:30:00Z,265.55,266.64,264.32,265.64,82652618,16.73580352\n2018-04-06T13:30:00Z,263.42,265.11,258,259.72,179521209,-50.00920919\n2018-04-09T13:30:00Z,261.37,264.84,259.9356,261,105442932,0.916256821\n2018-04-10T13:30:00Z,264.27,266.04,262.98,265.15,105573736,34.19945685\n2018-04-11T13:30:00Z,263.47,265.64,263.39,263.76,91140243,-4.564777328\n2018-04-12T13:30:00Z,265.26,267,265.06,265.93,68890480,19.60352113\n2018-04-13T13:30:00Z,267.41,267.54,264.01,265.15,85079176,-5.655172414\n2018-04-16T13:30:00Z,267,268.2,266.07,267.33,63405287,10.75475436\n2018-04-17T13:30:00Z,269.33,270.87,268.75,270.19,64682036,25.6194206\n2018-04-18T13:30:00Z,270.69,271.3,269.87,270.39,57303857,1.117591185\n2018-04-19T13:30:00Z,269.65,269.88,267.72,268.89,77655909,-13.10203313\n2018-04-20T13:30:00Z,268.81,269.06,265.61,266.61,99953133,-20.10576923\n2018-04-23T13:30:00Z,267.26,267.89,265.35,266.57,65557954,-2.420711974\n2018-04-24T13:30:00Z,267.73,267.9762,261.28,262.98,112885452,-29.54286746\n2018-04-25T13:30:00Z,262.91,264.13,260.85,263.63,103840948,-0.528924175\n2018-04-26T13:30:00Z,264.79,267.2452,264.29,266.31,67731942,23.6043807\n2018-04-27T13:30:00Z,267,267.34,265.5,266.56,57053647,1.188907658\n2018-04-30T13:30:00Z,267.26,267.89,264.43,264.51,82182324,-13.18198529\n2018-05-01T13:30:00Z,263.87,265.1,262.11,264.98,74203365,1.376614548\n2018-05-02T13:30:00Z,264.76,265.68,262.76,263.2,86368943,-9.904515246\n2018-05-03T13:30:00Z,262.26,263.36,259.05,262.62,136311479,-4.359707447\n2018-05-04T13:30:00Z,261.52,266.7892,261.15,266.02,91222075,26.10662047\n2018-05-07T13:30:00Z,266.89,268.02,266.11,266.92,55304907,8.279220779\n2018-05-08T13:30:00Z,266.5,267.325,265.15,266.92,67499247,1.102448454\n2018-05-09T13:30:00Z,267.68,269.865,267.09,269.5,59666143,22.31719013\n2018-05-10T13:30:00Z,270.34,272.39,270.22,272.02,72063931,23.08490369\n2018-05-11T13:30:00Z,272.16,273.15,271.58,272.85,59871511,5.660646985\n2018-05-14T13:30:00Z,273.34,274.08,272.36,272.98,54790606,0.49760568\n2018-05-15T13:30:00Z,271.59,271.61,270.03,271.1,87036036,-17.34142781\n2018-05-16T13:30:00Z,271.14,272.76,271.11,272.24,53942631,9.149261603\n2018-05-17T13:30:00Z,271.94,273.23,271.13,272.01,56536400,0.233684211\n2018-05-18T13:30:00Z,271.62,272.03,270.93,271.33,64367959,-4.877516779\n2018-05-21T13:30:00Z,273.01,273.98,271.3512,273.37,58025875,13.11551634\n2018-05-22T13:30:00Z,273.96,274.25,272.24,272.61,52966358,-4.523363095\n2018-05-23T13:30:00Z,271.17,273.39,270.99,273.36,64694184,5.575684932\n2018-05-24T13:30:00Z,272.91,273.22,270.78,272.8,76043827,-0.35598937\n2018-05-25T13:30:00Z,272.15,272.86,271.58,272.15,56374755,-3.951003824\n2018-05-29T13:30:00Z,270.31,271.17,267.76,269.02,115908607,-26.55809295\n2018-05-30T13:30:00Z,270.5,273.11,270.42,272.61,69678449,29.76266835\n2018-05-31T13:30:00Z,272.15,272.49,270.255,270.94,93519941,-9.11284876\n2018-06-01T13:30:00Z,272.41,273.94,272.33,273.6,71258411,21.23082454\n2018-06-04T13:30:00Z,274.53,275.185,274.26,274.9,45392351,11.37384259\n2018-06-05T13:30:00Z,275.05,275.53,274.18,275.1,51135038,0.990467938\n2018-06-06T13:30:00Z,275.79,277.52,275.09,277.4,62732215,19.30488741\n2018-06-07T13:30:00Z,277.95,278.28,276.34,277.37,72969402,0.23332444\n2018-06-08T13:30:00Z,276.85,278.25,276.66,278.19,72139719,4.263688761\n2018-06-11T13:30:00Z,278.44,279.37,278.31,278.56,58892515,3.87757732\n2018-06-12T13:30:00Z,279.03,279.33,278.19,278.92,72329028,1.377938034\n2018-06-13T13:30:00Z,279.19,279.48,277.8,278.03,79070610,-6.13909224\n2018-06-14T13:30:00Z,279.01,279.33,278.0599,278.73,77097620,1.392812927\n2018-06-15T13:30:00Z,276.6,277.51,275.35,277.13,120143175,-10.4509243\n2018-06-18T13:30:00Z,275.49,276.7,274.95,276.56,52917581,0.633343266\n2018-06-19T13:30:00Z,274,275.75,273.53,275.5,97531510,-0.278251945\n2018-06-20T13:30:00Z,276.27,276.72,275.59,275.97,53785486,3.418951613\n2018-06-21T13:30:00Z,275.96,275.98,273.68,274.24,71061404,-16.06013158\n2018-06-22T13:30:00Z,275.66,275.785,274.49,274.74,56612003,-2.035641892\n2018-06-25T13:30:00Z,273.44,273.6162,269.1,271,137854162,-34.4657222\n2018-06-26T13:30:00Z,271.64,272.56,270.79,271.6,68683211,-0.12289916\n2018-06-27T13:30:00Z,272.26,273.865,269.18,269.35,105110674,-11.967918\n2018-06-28T13:30:00Z,269.29,271.75,268.49,270.89,76650517,6.065830721\n2018-06-29T13:30:00Z,272.12,273.66,271.1495,271.28,97592499,2.106940219\n2018-07-02T13:30:00Z,269.51,272.04,269.24,271.86,63554774,6.544435216\n2018-07-03T13:30:00Z,272.87,272.98,270.42,270.9,42187071,-3.881652105\n2018-07-05T13:30:00Z,272.17,273.18,270.96,273.11,56925919,11.36622607\n2018-07-06T13:30:00Z,273.14,275.84,272.715,275.42,66493696,18.71289063\n2018-07-09T13:30:00Z,276.55,277.96,276.5,277.9,50550399,23.00948444\n2018-07-10T13:30:00Z,278.41,279.01,278.08,278.9,51966829,8.087361878\n2018-07-11T13:30:00Z,277.15,278.04,276.52,276.86,77054739,-14.80322678\n2018-07-12T13:30:00Z,278.28,279.43,277.6,279.37,60124687,21.08092684\n2018-07-13T13:30:00Z,279.17,279.93,278.66,279.59,48234964,2.020968395\n2018-07-16T13:30:00Z,279.64,279.803,278.84,279.34,48201038,-1.294768258\n2018-07-17T13:30:00Z,278.47,280.91,278.41,280.47,52315500,7.830946602\n2018-07-18T13:30:00Z,280.56,281.18,280.06,281.06,44593465,3.670524691\n2018-07-19T13:30:00Z,280.31,280.74,279.46,280,61412117,-6.96485623\n2018-07-20T13:30:00Z,279.77,280.48,279.5,279.68,82372729,-1.307624113\n2018-07-23T13:30:00Z,279.45,280.43,279.06,280.2,47047565,2.937051167\n2018-07-24T13:30:00Z,281.79,282.56,280.63,281.61,68026935,9.532958199\n2018-07-25T13:30:00Z,281.33,284.37,281.28,284.01,78882927,20.33133971\n2018-07-26T13:30:00Z,283.2,284.11,283.09,283.34,57919495,0.23816568\n2018-07-27T13:30:00Z,283.71,283.82,280.38,281.42,76783177,-16.13093525\n2018-07-30T13:30:00Z,281.51,281.69,279.36,279.95,63742508,-12.52013351\n2018-07-31T13:30:00Z,280.81,282.02,280.38,281.33,68570493,7.203507795\n2018-08-01T13:30:00Z,281.56,282.13,280.1315,280.86,53853326,-2.428250529\n2018-08-02T13:30:00Z,279.39,282.58,279.16,282.39,63426363,8.537204451\n2018-08-03T13:30:00Z,282.53,283.6577,282.33,283.6,53935386,9.514461604\n2018-08-06T13:30:00Z,283.64,284.99,283.2015,284.64,39400887,7.637478721\n2018-08-07T13:30:00Z,285.39,286.01,285.24,285.58,43196646,8.335464015\n2018-08-08T13:30:00Z,285.39,285.91,284.94,285.46,42114551,-0.147420147\n2018-08-09T13:30:00Z,285.53,285.97,284.915,285.07,35716976,-1.913534382\n2018-08-10T13:30:00Z,283.45,284.055,282.36,283.16,77076044,-15.85949299\n2018-08-13T13:30:00Z,283.47,284.16,281.77,282.1,65732909,-6.411992386\n2018-08-14T13:30:00Z,282.92,284.17,282.4833,283.9,43842031,11.34510717\n2018-08-15T13:30:00Z,282.38,282.54,280.16,281.78,102887320,-15.38294251\n2018-08-16T13:30:00Z,283.4,285.04,283.36,284.06,69967919,19.13072519\n2018-08-17T13:30:00Z,283.83,285.5601,283.37,285.06,65618481,7.086158762\n2018-08-20T13:30:00Z,285.57,285.97,285.06,285.67,39807490,4.519635524\n2018-08-21T13:30:00Z,286.25,287.31,285.7135,286.34,67271983,4.615852731\n2018-08-22T13:30:00Z,285.88,286.76,285.575,286.17,44993333,-0.009899068\n2018-08-23T13:30:00Z,285.97,286.94,285.43,285.79,49204851,-1.208827014\n2018-08-24T13:30:00Z,286.44,287.67,286.38,287.51,57487399,15.9309816\n2018-08-27T13:30:00Z,288.86,289.9,288.68,289.78,57072377,21.60441797\n2018-08-28T13:30:00Z,290.3,290.4175,289.4,289.92,46943472,0.5748998\n2018-08-29T13:30:00Z,290.16,291.74,289.8854,291.48,61485514,12.39837659\n2018-08-30T13:30:00Z,290.94,291.36,289.63,290.3,61229501,-6.381191038\n2018-08-31T13:30:00Z,289.84,290.81,289.29,290.31,66140838,0.31938244\n2018-09-04T13:30:00Z,289.84,290.21,288.68,289.81,57594367,-2.38558542\n2018-09-05T13:30:00Z,289.41,289.64,287.89,289.03,72452437,-6.366350068\n2018-09-06T13:30:00Z,289.15,289.49,287,288.16,65909863,-7.165860735\n2018-09-07T13:30:00Z,286.98,288.7,286.71,287.6,73524824,-2.015013966\n2018-09-10T13:30:00Z,288.74,289.04,287.88,288.1,50210903,2.072164948\n2018-09-11T13:30:00Z,287.37,289.55,286.975,289.05,50530492,5.401051188\n2018-09-12T13:30:00Z,289.06,289.8,288.23,289.12,59810758,1.33919598\n2018-09-13T13:30:00Z,290.32,291.0384,289.995,290.83,51034222,15.87017849\n2018-09-14T13:30:00Z,291.06,291.27,290,290.88,55079875,0.324798748\n2018-09-17T13:30:00Z,290.82,290.86,289.03,289.34,68244043,-14.26143899\n2018-09-18T13:30:00Z,289.58,291.58,289.55,290.91,61930407,10.42315369\n2018-09-19T13:30:00Z,290.97,291.69,290.825,291.22,49080562,3.124478079\n2018-09-20T13:30:00Z,292.64,293.94,291.2363,293.58,100360646,17.72397138\n2018-09-21T13:30:00Z,293.09,293.22,291.81,291.99,105597145,-11.54743151\n2018-09-24T13:30:00Z,291.34,291.5,290.37,291.02,53409645,-8.621590909\n2018-09-25T13:30:00Z,291.53,291.65,290.4833,290.75,44370037,-2.337170129\n2018-09-26T13:30:00Z,290.91,292.24,289.41,289.88,79739674,-4.864049587\n2018-09-27T13:30:00Z,290.41,291.91,290.1,290.69,59249455,4.034945465\n2018-09-28T13:30:00Z,289.99,291.28,289.95,290.72,70091385,1.536160714\n2018-10-01T13:30:00Z,292.11,292.93,290.98,291.73,62078937,6.120234807\n2018-10-02T13:30:00Z,291.56,292.355,291.14,291.56,47258227,-0.790195611\n2018-10-03T13:30:00Z,292.74,293.21,291.32,291.72,64694594,-1.909722222\n2018-10-04T13:30:00Z,291.18,291.24,287.66,289.44,111545910,-21.20291411\n2018-10-05T13:30:00Z,289.69,290.27,286.22,287.82,105961360,-13.41666667\n2018-10-08T13:30:00Z,287.05,288.22,285.5,287.82,87742172,-0.375294118\n2018-10-09T13:30:00Z,287.39,288.86,286.77,287.4,74338982,-0.639717963\n2018-10-10T13:30:00Z,286.83,286.91,277.88,278.3,214756170,-85.69859876\n2018-10-11T13:30:00Z,277.08,278.9,270.36,272.17,274840490,-49.83424104\n2018-10-12T13:30:00Z,276.77,277.09,272.37,275.95,183186492,10.8940678\n2018-10-15T13:30:00Z,275.55,277.04,274.3,274.4,102263717,-8.158955857\n2018-10-16T13:30:00Z,276.6,280.82,276.07,280.4,118255834,52.01388889\n2018-10-17T13:30:00Z,280.44,281.15,277.56,280.45,110625987,3.929240088\n2018-10-18T13:30:00Z,279.4,280.07,274.97,276.4,134557525,-35.90021256\n2018-10-19T13:30:00Z,277.13,279.3,275.47,276.25,139901634,-5.302947598\n2018-10-22T13:30:00Z,277,277.36,274.41,275.01,82415812,-8.90615142\n2018-10-23T13:30:00Z,270.95,274.87,268.61,273.61,146352719,-3.324789454\n2018-10-24T13:30:00Z,273.33,273.76,264.7,265.32,177806697,-66.59595116\n2018-10-25T13:30:00Z,267.38,271.81,266.23,270.08,138061545,20.72914075\n2018-10-26T13:30:00Z,265.92,271,262.29,265.33,201574596,-22.6706846\n2018-10-29T13:30:00Z,268.8,270.25,259.85,263.86,160749101,-13.27299123\n2018-10-30T13:30:00Z,263.67,268.12,263.12,267.77,157115995,20.17692462\n2018-10-31T13:30:00Z,270.65,273.23,270.12,270.63,128296325,24.90289548\n2018-11-01T13:30:00Z,271.6,273.73,270.38,273.51,99495037,22.1181073\n2018-11-02T13:30:00Z,274.75,275.23,269.59,271.89,122634107,-10.30261545\n2018-11-05T14:30:00Z,272.44,274.01,271.35,273.39,65622482,4.946666667\n2018-11-06T14:30:00Z,273.32,275.3,273.25,275.12,60085894,14.96427596\n2018-11-07T14:30:00Z,277.56,281.1,277.08,281.01,102752099,55.3081422\n2018-11-08T14:30:00Z,280.11,281.22,279.22,280.5,65584886,2.139792576\n2018-11-09T14:30:00Z,279.03,279.24,276.18,277.76,98812561,-23.36435644\n2018-11-12T14:30:00Z,277.19,277.46,271.99,272.57,99673574,-47.48102632\n2018-11-13T14:30:00Z,273.09,275.325,271.25,272.06,98176610,-7.177222753\n2018-11-14T14:30:00Z,274.16,274.61,268.45,270.2,125335931,-14.40589696\n2018-11-15T14:30:00Z,268.78,273.54,267.0102,273.02,135101437,10.96521849\n2018-11-16T14:30:00Z,271.79,274.75,271.21,273.73,126668040,6.738315217\n2018-11-19T14:30:00Z,273.05,273.38,268.07,269.1,103061706,-36.2638191\n2018-11-20T14:30:00Z,265.36,267,263.15,264.12,136021311,-41.60894374\n2018-11-21T14:30:00Z,265.86,267.15,265.01,265.02,75563743,1.112046632\n2018-11-23T14:30:00Z,263.18,264.8234,263.07,263.25,42807878,-11.49764151\n2018-11-26T14:30:00Z,265.78,267.75,265.34,267.5,79981362,41.52942765\n2018-11-27T14:30:00Z,266.34,268.4,265.66,268.4,75502441,8.561514196\n2018-11-28T14:30:00Z,269.6,274.58,268.3272,274.58,127629633,52.42037664\n2018-11-29T14:30:00Z,273.71,275.55,272.43,273.98,82346420,2.401202749\n2018-11-30T14:30:00Z,273.81,276.28,273.45,275.65,98204190,13.18431838\n2018-12-03T14:30:00Z,280.28,280.4,277.505,279.3,103017719,25.09486281\n2018-12-04T14:30:00Z,278.37,278.85,269.9,270.25,177986013,-83.29153397\n2018-12-06T14:30:00Z,265.92,269.97,262.44,269.84,204185411,-2.415463918\n2018-12-07T14:30:00Z,269.46,271.22,262.63,263.57,161018923,-38.77635188\n2018-12-10T14:30:00Z,263.37,265.1613,258.62,264.07,151445885,-2.403178735\n2018-12-11T14:30:00Z,267.66,267.87,262.48,264.13,121504431,-6.529649596\n2018-12-12T14:30:00Z,267.47,269,265.37,265.46,97976706,-3.306167803\n2018-12-13T14:30:00Z,266.52,267.49,264.12,265.37,96662717,-3.825088767\n2018-12-14T14:30:00Z,262.96,264.03,259.85,260.47,116961071,-43.19635036\n2018-12-17T14:30:00Z,259.4,260.65,253.525,255.36,165492257,-43.43426307\n2018-12-18T14:30:00Z,257.2,257.95,253.28,255.08,134515094,-6.697293134\n2018-12-19T14:30:00Z,255.17,259.4,249.35,251.26,214992763,-21.34194825\n2018-12-20T14:30:00Z,249.86,251.62,244.65,247.17,252053377,-33.33330057\n2018-12-21T14:30:00Z,246.74,249.71,239.98,240.7,255345633,-43.90072999\n2018-12-24T14:30:00Z,239.04,240.8355,234.27,234.34,147311588,-50.8595443\n2018-12-26T14:30:00Z,235.97,246.18,233.76,246.18,218485360,85.83891136\n2018-12-27T14:30:00Z,242.57,248.29,238.96,248.07,186267342,27.3142489\n2018-12-28T14:30:00Z,249.58,251.4,246.45,247.75,153100189,0.460671937\n2018-12-31T14:30:00Z,249.56,250.19,247.47,249.92,144299370,9.082808812\n2019-01-02T14:30:00Z,245.98,251.21,245.95,250.18,126925199,11.36273364\n2019-01-03T14:30:00Z,248.23,248.57,243.67,244.21,144140692,-41.74158031\n2019-01-04T14:30:00Z,247.59,253.11,247.17,252.39,142628834,63.21772997\n2019-01-07T14:30:00Z,252.69,255.95,251.69,254.38,103139100,16.44299451\n2019-01-08T14:30:00Z,256.82,257.31,254,256.77,102512587,13.67611353\n2019-01-09T14:30:00Z,257.56,258.91,256.19,257.97,95006554,6.815988106\n2019-01-10T14:30:00Z,256.26,259.16,255.5,258.88,96823923,9.529194352\n2019-01-11T14:30:00Z,257.68,259.0098,257.03,258.98,73858110,6.165671968\n2019-01-14T14:30:00Z,256.86,258.3,256.41,257.4,70908227,-6.192392368\n2019-01-15T14:30:00Z,257.82,260.7,257.81,260.35,85208271,27.77670279\n2019-01-16T14:30:00Z,260.83,261.9666,260.6,260.98,77636710,6.36211366\n2019-01-17T14:30:00Z,260.01,263.92,259.96,262.96,96118435,16.05370544\n2019-01-18T14:30:00Z,264.98,266.98,262.998,266.46,127900303,26.3922523\n2019-01-22T14:30:00Z,264.82,265.06,261.06,262.86,115531183,-28.02514793\n2019-01-23T14:30:00Z,264.01,264.79,260.66,263.41,86030287,-0.714285714\n2019-01-24T14:30:00Z,263.21,264.2,262.08,263.55,59204139,0.585903084\n2019-01-25T14:30:00Z,265.61,266.7,263.6595,265.78,96883358,14.85732254\n2019-01-28T14:30:00Z,263.39,263.83,261.79,263.76,85613655,-14.61994072\n2019-01-29T14:30:00Z,263.92,264.55,262.48,263.41,66136334,-1.895953757\n2019-01-30T14:30:00Z,265.1,268.52,264.25,267.58,92473671,35.02020628\n2019-01-31T14:30:00Z,267.51,270.47,267.27,269.93,104012073,19.76472513\n2019-02-01T14:30:00Z,270.15,271.2,269.18,270.06,85782524,2.086428571\n2019-02-04T14:30:00Z,270.11,272.03,269.36,271.96,60744844,12.81551764\n2019-02-05T14:30:00Z,272.44,273.44,271.88,273.1,79552774,8.838380717\n2019-02-06T14:30:00Z,272.79,273.34,271.92,272.74,58347791,-1.023659306\n2019-02-07T14:30:00Z,270.94,271.55,268.29,270.14,95481961,-21.66390595\n2019-02-08T14:30:00Z,268.75,270.58,267.83,270.47,75788861,4.845127119\n2019-02-11T14:30:00Z,271.2,271.49,270.03,270.62,68021423,0.978174603\n2019-02-12T14:30:00Z,272.42,274.52,272.34,274.1,72270221,31.95153061\n2019-02-13T14:30:00Z,275.03,275.93,274.56,274.99,65277204,7.30414604\n2019-02-14T14:30:00Z,273.78,275.64,272.87,274.38,83234396,-1.525179856\n2019-02-15T14:30:00Z,276.36,277.41,276.13,277.37,97088659,29.94671909\n2019-02-19T14:30:00Z,276.4813,278.58,276.47,277.85,59120804,4.535419312\n2019-02-20T14:30:00Z,277.81,278.92,277.25,278.41,76610767,3.995450352\n2019-02-21T14:30:00Z,277.7,278.1,276.345,277.42,64214727,-6.139866505\n2019-02-22T14:30:00Z,278.11,279.36,277.4029,279.14,78114616,12.94984214\n2019-02-25T14:30:00Z,280.73,281.31,279.43,279.52,69030699,0.193113363\n2019-02-26T14:30:00Z,279.13,280.3,278.9,279.32,56844101,-1.16685022\n2019-02-27T14:30:00Z,278.52,279.59,277.48,279.2,56921570,1.425840093\n2019-02-28T14:30:00Z,278.96,279.45,278.32,278.68,69268293,-2.073076923\n2019-03-01T14:30:00Z,280.44,280.88,278.82,280.42,78880548,10.375\n2019-03-04T14:30:00Z,281.6,281.87,276.84,279.4,106494637,-9.443272095\n2019-03-05T14:30:00Z,279.54,279.76,278.41,279.02,59114559,-3.875328947\n2019-03-06T14:30:00Z,279.15,279.16,276.97,277.33,75039771,-15.07677802\n2019-03-07T14:30:00Z,276.83,276.99,274.07,275.01,94885089,-21.17965444\n2019-03-08T14:30:00Z,272.94,274.65,272.42,274.46,85795799,-1.384271379\n2019-03-11T13:30:00Z,275.26,278.62,275.23,278.44,65098897,37.2322503\n2019-03-12T13:30:00Z,279.06,280.07,278.85,279.49,79667530,9.453265766\n2019-03-13T13:30:00Z,280.48,282.38,280.3,281.34,80639153,16.63422131\n2019-03-14T13:30:00Z,281.37,281.84,280.6662,281.16,67518366,-0.212260585\n2019-03-15T13:30:00Z,280.54,282.21,280.33,281.31,81308979,1.638502587\n2019-03-18T13:30:00Z,281.55,282.66,281.3,282.33,62199806,8.70923913\n2019-03-19T13:30:00Z,283.51,284.36,281.41,282.4,90268121,-1.16991256\n2019-03-20T13:30:00Z,282.16,283.5,280.32,281.55,84609210,-5.386117137\n2019-03-21T13:30:00Z,280.64,285.18,280.59,284.73,79550375,24.26617686\n2019-03-22T13:30:00Z,283.22,283.8034,279.18,279.25,122659286,-36.57994807\n2019-03-25T13:30:00Z,278.87,280.1853,277.64,279.04,85575197,-3.178484863\n2019-03-26T13:30:00Z,280.99,282.18,279.56,281.12,68125920,14.68937126\n2019-03-27T13:30:00Z,281.11,281.76,277.93,279.65,72224722,-11.18822816\n2019-03-28T13:30:00Z,280.35,281.21,279.07,280.71,56238545,3.405688623\n2019-03-29T13:30:00Z,282.39,282.84,281.14,282.48,82186806,12.64853491\n2019-04-01T13:30:00Z,284.7,286.16,284.4,285.83,77617945,33.02187785\n2019-04-02T13:30:00Z,286.04,286.23,285.09,285.97,40070351,1.259885764\n2019-04-03T13:30:00Z,287.32,287.76,285.75,286.42,68243202,-0.096562885\n2019-04-04T13:30:00Z,286.78,287.459,286.01,287.18,48997505,2.851198477\n2019-04-05T13:30:00Z,287.92,288.63,287.6,288.57,58621729,12.27495336\n2019-04-08T13:30:00Z,288.1,288.91,287.37,288.79,53566335,3.204845815\n2019-04-09T13:30:00Z,287.72,288.08,286.7,287.31,66142316,-10.35755242\n2019-04-10T13:30:00Z,287.77,288.3899,287.31,288.29,52601499,6.493076846\n2019-04-11T13:30:00Z,288.83,288.84,287.578,288.21,55093100,-0.831178161\n2019-04-12T13:30:00Z,290,290.47,288.261,290.16,69727782,11.08364721\n2019-04-15T13:30:00Z,290.24,290.35,289.075,289.97,49596685,-1.46970057\n2019-04-16T13:30:00Z,290.95,291.01,289.5,290.16,52153197,-1.122820919\n2019-04-17T13:30:00Z,291.4,291.425,288.99,289.45,58268295,-5.653757122\n2019-04-18T13:30:00Z,290.1,290.32,288.66,290.02,68708513,0.107610594\n2019-04-22T13:30:00Z,289.17,290.435,289.07,290.27,40160140,3.343862816\n2019-04-23T13:30:00Z,290.68,293.14,290.42,292.88,52246633,23.283693\n2019-04-24T13:30:00Z,292.79,293.16,292.07,292.23,50392914,-1.173018293\n2019-04-25T13:30:00Z,292.12,292.78,290.73,292.05,57770862,-1.519691781\n2019-04-26T13:30:00Z,292.1,293.49,291.2401,293.41,50916423,7.928684837\n2019-04-29T13:30:00Z,293.51,294.45,293.41,293.87,57197747,4.598720293\n2019-04-30T13:30:00Z,293.49,294.34,291.92,294.02,81112081,2.452066733\n2019-05-01T13:30:00Z,294.72,294.95,291.8,291.81,71671870,-14.93174029\n2019-05-02T13:30:00Z,291.68,292.7,289.52,291.18,65030170,-5.887995841\n2019-05-03T13:30:00Z,292.82,294.34,291.2998,294.03,56543653,20.39239093\n2019-05-06T13:30:00Z,289.25,293.31,288.9,292.82,107198069,5.546543864\n2019-05-07T13:30:00Z,290.15,290.81,285.81,287.93,144729908,-32.442529\n2019-05-08T13:30:00Z,287.53,289.43,286.87,287.53,91568287,-2.874197432\n2019-05-09T13:30:00Z,285.23,287.33,283.3,286.66,103471104,-0.992206416\n2019-05-10T13:30:00Z,285.62,288.94,282.3,288.1,112429293,11.82877814\n2019-05-13T13:30:00Z,282.42,283.49,279.93,280.86,127290527,-58.26715497\n2019-05-14T13:30:00Z,281.99,285.1,281.85,283.4,77003230,18.29685611\n2019-05-15T13:30:00Z,281.59,285.77,281.36,285.06,73956407,11.65561024\n2019-05-16T13:30:00Z,285.84,289.21,285.76,287.7,76749643,24.65938002\n2019-05-17T13:30:00Z,285.14,288.6,285.1207,285.84,100353024,-4.270986772\n2019-05-20T13:30:00Z,284.06,285.43,283.12,283.95,62877610,-11.18587361\n2019-05-21T13:30:00Z,285.83,286.93,285.55,286.51,46847085,24.23570215\n2019-05-22T13:30:00Z,285.45,286.69,285.1,285.63,49482472,-3.104403409\n2019-05-23T13:30:00Z,283.16,283.21,280.57,282.14,98733847,-32.11216303\n2019-05-24T13:30:00Z,283.74,284.2,282.09,282.78,55268095,-0.51717759\n2019-05-28T13:30:00Z,283.09,284.15,280.13,280.15,70029356,-16.87353286\n2019-05-29T13:30:00Z,278.91,279.36,276.71,278.27,104972927,-16.69378307\n2019-05-30T13:30:00Z,279.11,280.04,277.805,279.03,62523780,2.586638831\n2019-05-31T13:30:00Z,276.2,277.12,275.24,275.27,86862782,-35.22011821\n2019-06-03T13:30:00Z,275.31,276.5521,273.09,274.57,96427952,-4.80337858\n2019-06-04T13:30:00Z,277.12,280.68,276.62,280.53,77231889,54.2016129\n2019-06-05T13:30:00Z,282.33,282.99,280.32,282.96,71169717,15.70235983\n2019-06-06T13:30:00Z,283.29,285.55,282.57,284.8,69430381,14.20114542\n2019-06-07T13:30:00Z,285.93,288.85,285.74,287.65,74272199,26.14399084\n2019-06-10T13:30:00Z,289.37,290.82,288.8734,288.97,60799053,10.27653683\n2019-06-11T13:30:00Z,290.99,291.4,288.1805,288.9,58641325,-5.55891324\n2019-06-12T13:30:00Z,288.64,289.26,287.815,288.39,47096312,-3.989477446\n2019-06-13T13:30:00Z,289.4,289.98,288.62,289.58,48945156,7.869207317\n2019-06-14T13:30:00Z,289.26,289.93,288.41,289.26,52324716,-1.284944089\n2019-06-17T13:30:00Z,289.52,290.22,289.18,289.37,39205709,0.201923077\n2019-06-18T13:30:00Z,291.39,293.57,290.99,292.4,85434823,26.78610503\n2019-06-19T13:30:00Z,292.55,293.65,291.47,293.06,78674377,3.749678828\n2019-06-20T13:30:00Z,296.04,296.3093,293.1255,295.86,116570017,17.23189088\n2019-06-21T13:30:00Z,294.13,295.52,293.76,294,83309466,-13.09177215\n2019-06-24T13:30:00Z,294.23,294.58,293.47,293.64,47582730,-2.181345733\n2019-06-25T13:30:00Z,293.7,293.73,290.64,290.76,82028656,-26.0472973\n2019-06-26T13:30:00Z,291.75,292.31,290.345,290.47,51584902,-5.973958333\n2019-06-27T13:30:00Z,291.31,292.06,290.89,291.5,40355239,4.705698529\n2019-06-28T13:30:00Z,292.58,293.55,292.01,293,59350929,12.2214213\n2019-07-01T13:30:00Z,296.68,296.92,294.33,295.66,79107474,16.44270833\n2019-07-02T13:30:00Z,295.61,296.49,294.68,296.43,61504544,2.743644068\n2019-07-03T13:30:00Z,297.18,298.82,297.02,298.8,40898896,21.98410326\n2019-07-05T13:30:00Z,297.44,298.64,296.01,298.46,51677326,3.218800161\n2019-07-08T13:30:00Z,297.01,298.2579,296.22,296.82,45841772,-8.655151528\n2019-07-09T13:30:00Z,295.54,297.52,295.48,297.19,41101279,4.603742515\n2019-07-10T13:30:00Z,298.37,299.66,297.78,298.61,58595558,11.64897343\n2019-07-11T13:30:00Z,299.32,299.58,298.2,299.31,50889481,3.178602431\n2019-07-12T13:30:00Z,299.85,300.73,299.51,300.65,40354410,11.65997164\n2019-07-15T13:30:00Z,301.13,301.13,300.19,300.75,33910261,0.289473684\n2019-07-16T13:30:00Z,300.65,300.88,299.44,299.71,40567964,-8.560871336\n2019-07-17T13:30:00Z,299.75,299.93,297.74,297.74,44102443,-16.29819588\n2019-07-18T13:30:00Z,297.19,299.25,296.7,298.83,51701687,4.351607289\n2019-07-19T13:30:00Z,300.04,300.07,296.96,297.17,71081238,-8.915039063\n2019-07-22T13:30:00Z,297.61,298.5,297.04,297.9,43687404,0.601248565\n2019-07-23T13:30:00Z,299.14,300.03,298.22,300.03,44657973,17.25573745\n2019-07-24T13:30:00Z,299.19,301.44,299.09,301.44,47213232,9.446246356\n2019-07-25T13:30:00Z,300.94,301,299.11,300,55394092,-7.34255145\n2019-07-26T13:30:00Z,300.76,302.23,300.62,302.01,45084077,15.52204176\n2019-07-29T13:30:00Z,301.88,301.93,300.85,301.46,38126462,-2.264834206\n2019-07-30T13:30:00Z,299.91,301.17,299.49,300.72,45849045,-2.806994819\n2019-07-31T13:30:00Z,300.99,301.2,295.2,297.43,104245162,-27.07436518\n2019-08-01T13:30:00Z,297.6,300.87,293.96,294.84,142646576,-13.51298077\n2019-08-02T13:30:00Z,293.85,294.12,290.9,292.62,116749695,-20.3286007\n2019-08-05T13:30:00Z,288.09,288.21,281.72,283.82,178745449,-85.07584699\n2019-08-06T13:30:00Z,285.91,288.04,284.28,287.8,120711682,20.11696738\n2019-08-07T13:30:00Z,284.4,288.82,282.04,287.97,140572265,12.04963806\n2019-08-08T13:30:00Z,289.62,293.62,289.01,293.62,87713904,50.0883406\n2019-08-09T13:30:00Z,292.58,293.24,289.65,291.62,93729958,-7.682531381\n2019-08-12T13:30:00Z,289.96,291.6052,287.02,288.07,65527632,-28.16936018\n2019-08-13T13:30:00Z,287.74,294.15,287.36,292.55,94792972,33.5524957\n2019-08-14T13:30:00Z,288.07,288.74,283.76,283.9,135622053,-64.75322643\n2019-08-15T13:30:00Z,284.88,285.64,282.39,284.65,101929845,-1.032396622\n2019-08-16T13:30:00Z,286.48,289.33,284.7138,288.85,85825286,33.11572913\n2019-08-19T13:30:00Z,292.19,293.08,291.44,292.33,53640153,31.04673104\n2019-08-20T13:30:00Z,291.77,292.36,289.95,290.09,51652752,-18.52530675\n2019-08-21T13:30:00Z,292.48,292.86,291.72,292.45,49723430,14.03223684\n2019-08-22T13:30:00Z,293.23,293.93,290.4,292.36,51739292,-1.928666078\n2019-08-23T13:30:00Z,290.92,292.76,283.47,284.85,149318151,-62.89680844\n2019-08-26T13:30:00Z,287.27,288,285.58,288,72620598,9.140216444\n2019-08-27T13:30:00Z,289.54,289.95,286.03,286.87,68262998,-6.85028184\n2019-08-28T13:30:00Z,286.14,289.07,285.25,288.89,59852324,8.35724234\n2019-08-29T13:30:00Z,291.72,293.16,290.61,292.58,57998913,31.31181361\n2019-08-30T13:30:00Z,294.22,294.2399,291.42,292.45,62961780,-2.734686481\n2019-09-03T13:30:00Z,290.57,291.58,289.27,290.74,69252354,-12.89147059\n2019-09-04T13:30:00Z,293.14,294.055,292.31,294.04,47003957,30.54455175\n2019-09-05T13:30:00Z,296.79,298.83,296.64,297.82,83356779,36.42462988\n2019-09-06T13:30:00Z,298.17,298.76,297.42,298.05,49584290,1.572183099\n2019-09-09T13:30:00Z,299.14,299.24,297.16,298.2,51260290,-1.233708531\n2019-09-10T13:30:00Z,297.36,298.2,295.97,298.13,57947101,0.452332657\n2019-09-11T13:30:00Z,298.47,300.34,297.75,300.25,68821066,15.89740566\n2019-09-12T13:30:00Z,301.25,302.46,300.41,301.29,72908745,8.072936893\n2019-09-13T13:30:00Z,301.78,302.17,300.68,301.09,62104838,-1.961666667\n2019-09-16T13:30:00Z,299.84,301.1378,299.45,300.16,58191175,-5.19304682\n2019-09-17T13:30:00Z,299.94,301.02,299.75,300.92,42904427,5.29537037\n2019-09-18T13:30:00Z,300.49,301.22,298.24,301.1,74192091,3.791472868\n2019-09-19T13:30:00Z,301.53,302.63,300.7103,301.08,78099215,-0.426856119\n2019-09-20T13:30:00Z,300.36,300.67,297.41,298.28,97455979,-25.3418501\n2019-09-23T13:30:00Z,297.55,299,297.27,298.21,47541321,-0.729444444\n2019-09-24T13:30:00Z,299.41,299.84,294.81,295.87,97367568,-16.13691049\n2019-09-25T13:30:00Z,295.96,298.11,294.33,297.62,73434081,5.08681672\n2019-09-26T13:30:00Z,297.63,297.86,295.45,297,58722357,-2.496460177\n2019-09-27T13:30:00Z,297.83,297.9465,293.69,295.4,84781110,-13.9314893\n2019-09-30T13:30:00Z,295.97,297.55,295.92,296.77,52562761,6.254692192\n2019-10-01T13:30:00Z,297.74,298.455,293,293.24,89900420,-23.25\n2019-10-02T13:30:00Z,291.5,291.51,286.64,288.06,124523974,-48.25528426\n2019-10-03T13:30:00Z,287.81,290.45,284.82,290.42,85906799,8.752118644\n2019-10-04T13:30:00Z,291.14,294.63,290.82,294.35,66700681,34.91873324\n2019-10-07T13:30:00Z,293.47,295.26,292.77,293.08,60656561,-1.986996963\n2019-10-08T13:30:00Z,291.04,291.85,288.49,288.53,101575470,-41.57838398\n2019-10-09T13:30:00Z,290.75,292.3,288.6559,291.27,65707329,12.89684771\n2019-10-10T13:30:00Z,291.18,294.21,291,293.24,57255974,17.21968563\n2019-10-11T13:30:00Z,296.27,298.74,296.1448,296.28,101228577,26.82132994\n2019-10-14T13:30:00Z,295.93,296.67,295.57,295.95,40546668,-1.277919501\n2019-10-15T13:30:00Z,297.1,299.7,296.97,298.88,47832356,27.62663713\n2019-10-16T13:30:00Z,298.37,299.16,297.92,298.4,50563596,-0.071216617\n2019-10-17T13:30:00Z,299.68,300.24,298.515,299.28,46784885,4.416899441\n2019-10-18T13:30:00Z,298.69,299.395,296.99,297.97,64338028,-10.11302395\n2019-10-21T13:30:00Z,299.42,300.21,298.935,299.99,39460901,15.35483871\n2019-10-22T13:30:00Z,300.58,300.9,298.91,299.01,49126038,-5.135697538\n2019-10-23T13:30:00Z,298.73,299.94,298.495,299.88,34991829,3.329336735\n2019-10-24T13:30:00Z,300.91,301.07,299.4601,300.37,35857459,1.989317619\n2019-10-25T13:30:00Z,299.74,302.2,299.6806,301.6,45205412,8.725488811\n2019-10-28T13:30:00Z,302.94,303.85,302.91,303.3,42146965,16.00804005\n2019-10-29T13:30:00Z,303,304.23,302.86,303.21,44284921,0.41802226\n2019-10-30T13:30:00Z,303.43,304.55,301.99,304.14,49643928,4.287679426\n2019-10-31T13:30:00Z,304.13,304.13,301.73,303.33,69053791,-6.022083737\n2019-11-01T13:30:00Z,304.92,306.19,304.74,306.14,71141515,24.44055202\n2019-11-04T14:30:00Z,307.85,308,306.96,307.37,60606916,8.577991453\n2019-11-05T14:30:00Z,307.59,307.9195,306.71,307.03,43033885,-2.295975931\n2019-11-06T14:30:00Z,307.03,307.4,306.06,307.1,46487108,-0.143369932\n2019-11-07T14:30:00Z,308.57,309.65,307.66,308.18,54272274,6.287909836\n2019-11-08T14:30:00Z,307.8,309.0036,307.03,308.94,49068797,4.277240959\n2019-11-11T14:30:00Z,307.42,308.54,307.27,308.35,35934909,0.951566952\n2019-11-12T14:30:00Z,308.75,309.99,308.15,309,46484624,4.982810615\n2019-11-13T14:30:00Z,307.91,309.54,307.66,309.1,54459018,3.265926641\n2019-11-14T14:30:00Z,308.79,309.64,308.09,309.55,52001874,3.852418809\n2019-11-15T14:30:00Z,311.02,311.84,310.26,311.79,62706192,18.95985294\n2019-11-18T14:30:00Z,311.53,312.28,311.03,312.02,49327980,2.198006932\n2019-11-19T14:30:00Z,312.68,312.69,311.22,311.93,67927818,-1.075353218\n2019-11-20T14:30:00Z,311.28,311.85,309.06,310.77,79696276,-9.526045982\n2019-11-21T14:30:00Z,310.89,311.01,309.39,310.27,54664690,-4.627145923\n2019-11-22T14:30:00Z,311.09,311.24,309.85,310.96,44850228,1.844255663\n2019-11-25T14:30:00Z,311.98,313.37,311.98,313.37,48762676,23.948011\n2019-11-26T14:30:00Z,313.41,314.28,313.06,314.08,37727953,5.052531898\n2019-11-27T14:30:00Z,314.61,315.48,314.37,315.48,44793179,12.31766257\n2019-11-29T14:30:00Z,314.86,315.13,314.06,314.31,36592740,-7.448931624\n2019-12-02T14:30:00Z,314.59,314.66,311.17,311.64,76110027,-23.16859063\n2019-12-03T14:30:00Z,308.65,309.64,307.13,309.55,75172709,-15.77770012\n2019-12-04T14:30:00Z,310.7,312.12,310.32,311.46,49190402,16.76231846\n2019-12-05T14:30:00Z,312.23,312.25,310.58,312.02,40781669,1.907258065\n2019-12-06T14:30:00Z,314.12,315.31,314.11,314.87,48956767,28.39370239\n2019-12-09T14:30:00Z,314.44,315.18,313.8,313.88,34904315,-4.618321372\n2019-12-10T14:30:00Z,313.82,314.55,312.81,313.53,53109165,-2.25880984\n2019-12-11T14:30:00Z,314.03,314.7,313.4393,314.42,53521450,5.553485036\n2019-12-12T14:30:00Z,314.43,317.99,314.17,317.13,96585802,23.6794432\n2019-12-13T14:30:00Z,316.87,318.67,316.02,317.32,81546487,3.155263158\n2019-12-16T14:30:00Z,319.22,320.15,317.2542,319.5,82836128,14.30204559\n2019-12-17T14:30:00Z,319.92,320.25,319.48,319.57,61131769,-0.1953125\n2019-12-18T14:30:00Z,320,320.25,319.53,319.59,48199955,-1.434210526\n2019-12-19T14:30:00Z,319.8,320.98,319.5246,320.9,85388424,9.800552828\n2019-12-20T14:30:00Z,320.46,321.9742,319.3873,320.73,149338215,0.792847409\n2019-12-23T14:30:00Z,321.59,321.65,321.06,321.22,53015641,2.604103343\n2019-12-24T14:30:00Z,321.47,321.52,320.9,321.23,20270007,-0.568421053\n2019-12-26T14:30:00Z,321.65,322.95,321.64,322.94,31024188,15.66428571\n2019-12-27T14:30:00Z,323.74,323.8,322.28,322.86,42554820,-0.576153324\n2019-12-30T14:30:00Z,322.95,323.1,320.55,321.08,49782730,-15.29749549\n2019-12-31T14:30:00Z,320.53,322.13,320.15,321.86,57106998,2.620978039\n2020-01-02T14:30:00Z,323.54,324.89,322.53,324.87,59253833,25.0675578\n2020-01-03T14:30:00Z,321.16,323.64,321.1,322.41,77783566,-10.15129928\n2020-01-06T14:30:00Z,320.49,323.73,320.36,323.64,55761948,10.84669891\n2020-01-07T14:30:00Z,323.02,323.54,322.24,322.73,42854811,-1.09502924\n2020-01-08T14:30:00Z,322.94,325.78,322.67,324.45,68434153,14.39046544\n2020-01-09T14:30:00Z,326.16,326.73,325.52,326.65,48569601,18.94964664\n2020-01-10T14:30:00Z,327.2899,327.46,325.2,325.71,53057389,-6.114382214\n2020-01-13T14:30:00Z,326.39,327.96,325.92,327.95,47262010,14.53337693\n2020-01-14T14:30:00Z,327.47,328.62,326.844,327.45,63036384,-0.382963989\n2020-01-15T14:30:00Z,327.35,329.02,327.26,328.19,72056598,6.421211048\n2020-01-16T14:30:00Z,329.7,330.92,329.45,330.92,54050328,26.22159091\n2020-01-17T14:30:00Z,331.7,332.18,330.8539,331.95,95846017,7.048924039\n2020-01-21T14:30:00Z,330.9,332.18,330.82,331.3,77742415,-1.923879613\n2020-01-22T14:30:00Z,332.24,332.95,331.17,331.34,48914899,-1.700465426\n2020-01-23T14:30:00Z,330.63,332.1682,329.41,331.72,52004140,2.830433762\n2020-01-24T14:30:00Z,332.44,332.53,327.36,328.77,87578442,-22.5935921\n2020-01-27T14:30:00Z,323.03,325.12,322.66,323.5,84062463,-43.69266579\n2020-01-28T14:30:00Z,325.06,327.85,323.6038,326.89,63833953,27.22998432\n2020-01-29T14:30:00Z,328.38,328.63,326.4,326.62,54040889,-2.802209302\n2020-01-30T14:30:00Z,324.36,327.91,323.54,327.68,75491844,9.124740125\n2020-01-31T14:30:00Z,327,327.17,320.73,321.73,113845576,-44.76515781\n2020-02-03T14:30:00Z,323.35,326.16,323.22,324.12,69242293,8.066872814\n2020-02-04T14:30:00Z,328.07,330.01,327.72,329.06,62573190,48.37416083\n2020-02-05T14:30:00Z,332.27,333.09,330.67,332.86,65951146,31.49797516\n2020-02-06T14:30:00Z,333.91,334.19,332.8,333.98,50359688,7.041971545\n2020-02-07T14:30:00Z,332.82,333.9941,331.6,332.2,64139443,-12.78339588\n2020-02-10T14:30:00Z,331.23,334.75,331.19,334.68,42070006,17.37466353\n2020-02-11T14:30:00Z,336.16,337.02,334.684,335.26,54864533,4.535326511\n2020-02-12T14:30:00Z,336.83,337.65,336.43,337.42,43992662,16.40917488\n2020-02-13T14:30:00Z,335.8621,338.12,335.56,337.06,54501922,1.659272853\n2020-02-14T14:30:00Z,337.51,337.73,336.2,337.6,64582210,2.598588734\n2020-02-18T14:30:00Z,336.51,337.6677,335.21,336.73,57342526,-4.441741089\n2020-02-19T14:30:00Z,337.79,339.08,337.48,338.34,48814692,14.03633005\n2020-02-20T14:30:00Z,337.7423,338.64,333.6817,336.95,74163362,-9.41940703\n2020-02-21T14:30:00Z,335.47,335.81,332.58,333.48,113788208,-31.85538939\n2020-02-24T14:30:00Z,323.14,325.85,321.24,322.42,161088409,-102.1786215\n2020-02-25T14:30:00Z,323.94,324.61,311.69,312.65,218913168,-79.83509065\n2020-02-26T14:30:00Z,314.18,318.11,310.7,311.5,194773819,-17.71698632\n2020-02-27T14:30:00Z,305.46,311.5637,297.51,297.51,284353460,-110.6649696\n2020-02-28T14:30:00Z,288.7,297.892,285.54,296.26,385764020,2.830348426\n2020-03-02T14:30:00Z,298.21,309.16,294.46,309.09,238703625,97.97468354\n2020-03-03T14:30:00Z,309.5,313.84,297.57,300.24,300139150,-40.79620853\n2020-03-04T14:30:00Z,306.12,313.1,303.33,312.86,176613448,80.64036134\n2020-03-05T14:30:00Z,304.98,308.47,300.01,302.46,186366809,-64.92035555\n2020-03-06T14:30:00Z,293.15,298.78,290.23,297.46,228667168,-24.10347663\n2020-03-09T13:30:00Z,275.3,284.19,273.45,274.23,309417350,-184.5030738\n2020-03-10T13:30:00Z,284.64,288.52,273.5,288.42,276444060,92.37965045\n2020-03-11T13:30:00Z,280.7,281.94,270.88,274.36,256416563,-117.1035175\n2020-03-12T13:30:00Z,256,266.66,247.68,248.11,392220670,-217.0516076\n2020-03-13T13:30:00Z,263.09,271.4754,248.5237,269.32,329566100,129.8879035\n2020-03-16T13:30:00Z,241.18,256.9,237.36,239.85,297240030,-209.0398471\n2020-03-17T13:30:00Z,245.04,256.17,237.07,252.8,262070471,86.59436511\n2020-03-18T13:30:00Z,236.25,248.37,228.02,240,327597130,-56.78644664\n2020-03-19T13:30:00Z,239.25,247.38,232.22,240.51,289322040,6.275411555\n2020-03-20T13:30:00Z,242.53,244.47,228.5,228.8,347158790,-84.1658735\n2020-03-23T13:30:00Z,228.19,229.6833,218.26,222.95,326025170,-52.77919651\n2020-03-24T13:30:00Z,234.42,244.1,233.8,243.15,235494475,180.453203\n2020-03-25T13:30:00Z,244.87,256.35,239.75,246.79,299430255,29.79136164\n2020-03-26T13:30:00Z,249.52,262.8,249.05,261.2,257632816,135.0452881\n2020-03-27T13:30:00Z,253.27,260.81,251.05,253.42,224341217,-23.57657767\n2020-03-30T13:30:00Z,255.7,262.43,253.53,261.65,170961866,70.40236656\n2020-03-31T13:30:00Z,260.56,263.33,256.22,257.75,194881060,-15.06907895\n2020-04-01T13:30:00Z,247.98,257.6591,243.9,246.15,189554623,-78.86785003\n2020-04-02T13:30:00Z,245.19,252.68,244.59,251.83,177660430,40.78862606\n2020-04-03T13:30:00Z,250.76,253.32,245.22,248.19,135561171,-13.82021644\n2020-04-06T13:30:00Z,257.84,267,248.1698,264.86,188061238,117.9537169\n2020-04-07T13:30:00Z,274.21,275.03,264.89,265.13,201427189,-13.42230793\n2020-04-08T13:30:00Z,267.96,276,265.2542,274.03,153774487,50.20805615\n2020-04-09T13:30:00Z,277.58,281.2,275.47,278.2,190282705,33.73240901\n2020-04-13T13:30:00Z,277.14,277.51,271.41,275.66,115139268,-20.09351326\n2020-04-14T13:30:00Z,280.98,284.9,275.5106,283.79,134143350,54.2327141\n2020-04-15T13:30:00Z,277.57,279.26,275.46,277.76,121775006,-40.25371721\n2020-04-16T13:30:00Z,279.15,280.03,275.76,279.1,131798325,4.477236537\n2020-04-17T13:30:00Z,285.38,287.3,282.4,286.64,146684784,63.70619048\n2020-04-20T13:30:00Z,282.61,286.7912,281.35,281.59,100224647,-30.12626603\n2020-04-21T13:30:00Z,276.73,278.04,272.02,273.04,126385698,-79.13082298\n2020-04-22T13:30:00Z,278.35,281,276.91,279.1,93524584,39.47418136\n2020-04-23T13:30:00Z,280.49,283.94,278.75,279.08,104709693,-3.023593677\n2020-04-24T13:30:00Z,280.73,283.7,278.5,282.97,85165953,24.22067762\n2020-04-27T13:30:00Z,285.12,288.27,284.62,287.05,77896608,36.875\n2020-04-28T13:30:00Z,291.02,291.4,285.4,285.73,105283871,-14.60554859\n2020-04-29T13:30:00Z,291.53,294.88,290.41,293.21,118745579,49.2062135\n2020-04-30T13:30:00Z,291.71,293.3239,288.59,290.48,122901701,-16.38746871\n2020-05-01T13:30:00Z,285.31,290.6572,281.52,282.79,125180028,-54.89004415\n2020-05-04T13:30:00Z,280.74,283.9,279.13,283.57,80873213,6.629513889\n2020-05-05T13:30:00Z,286.64,289.25,283.7134,286.19,79569938,17.43860635\n2020-05-06T13:30:00Z,288.04,288.46,283.78,284.25,73632628,-12.40672274\n2020-05-07T13:30:00Z,287.75,289.78,287.13,287.68,75250412,16.79240074\n2020-05-08T13:30:00Z,291.09,292.95,289.86,292.44,76622128,42.51075789\n2020-05-11T13:30:00Z,290.34,294,289.88,292.5,79514231,5.3034212\n2020-05-12T13:30:00Z,293.79,294.24,286.52,286.67,95870786,-40.04464286\n2020-05-13T13:30:00Z,286.06,287.19,278.965,281.6,144721099,-43.70402299\n2020-05-14T13:30:00Z,278.95,285.11,276.37,284.97,121977890,17.46318493\n2020-05-15T13:30:00Z,282.37,286.33,281.34,286.28,111146276,16.6619515\n2020-05-18T13:30:00Z,293.05,296.75,292.7,295,120320229,84.78078528\n2020-05-19T13:30:00Z,294.35,296.205,291.95,291.97,95189316,-15.00280047\n2020-05-20T13:30:00Z,295.82,297.87,295.57,296.93,85861691,38.64217252\n2020-05-21T13:30:00Z,296.79,297.67,293.6886,294.88,78293925,-12.97418127\n2020-05-22T13:30:00Z,294.57,295.63,293.22,295.44,63958200,1.859415584\n2020-05-26T13:30:00Z,301.93,302.19,298.69,299.08,88951442,19.20844057\n2020-05-27T13:30:00Z,302.12,303.57,296.87,303.53,104817449,16.81857083\n2020-05-28T13:30:00Z,304.65,306.84,302.24,302.97,90767807,-4.375599445\n2020-05-29T13:30:00Z,302.46,304.96,299.47,304.32,119265702,6.884517767\n2020-06-01T13:30:00Z,303.62,306.205,303.06,305.55,56779836,8.680921053\n2020-06-02T13:30:00Z,306.55,308.13,305.1,308.08,74267162,17.34154804\n2020-06-03T13:30:00Z,310.24,313.22,309.94,312.18,92567574,38.14078661\n2020-06-04T13:30:00Z,311.11,313,309.08,311.36,75794363,-0.923666288\n2020-06-05T13:30:00Z,317.23,321.275,317.16,319.34,150524674,79.65534484\n2020-06-08T13:30:00Z,320.22,323.41,319.63,323.2,73641217,33.57864262\n2020-06-09T13:30:00Z,320.3,323.2849,319.36,320.79,77479228,-7.297800809\n2020-06-10T13:30:00Z,321.42,322.39,318.2209,319,95000766,-10.76606809\n2020-06-11T13:30:00Z,311.46,312.15,300.01,300.61,209243560,-179.2423469\n2020-06-12T13:30:00Z,308.24,309.08,298.6,304.21,194678879,-4.524315425\n2020-06-15T13:30:00Z,298.02,308.28,296.74,307.05,135782724,23.61816348\n2020-06-16T13:30:00Z,315.48,315.64,307.67,312.96,137627502,35.19301601\n2020-06-17T13:30:00Z,314.07,314.39,310.86,311.66,83398944,-9.891075721\n2020-06-18T13:30:00Z,310.005,312.3,309.51,311.78,80828658,1.604182019\n2020-06-19T13:30:00Z,314.17,314.38,306.53,308.64,135549624,-21.60630181\n2020-06-22T13:30:00Z,307.99,311.05,306.75,310.62,74649389,5.069429169\n2020-06-23T13:30:00Z,313.49,314.5,311.6101,312.05,68471246,8.203410061\n2020-06-24T13:30:00Z,309.84,310.51,302.1,304.09,132813492,-72.97579271\n2020-06-25T13:30:00Z,303.47,307.64,301.28,307.35,89467968,10.70605563\n2020-06-26T13:30:00Z,306.16,306.39,299.42,300.05,127961017,-55.24276277\n2020-06-29T13:30:00Z,301.41,304.61,298.93,304.46,79773260,17.42819979\n2020-06-30T13:30:00Z,303.99,310.2,303.82,308.36,113394772,34.39328841\n2020-07-01T13:30:00Z,309.57,311.89,309.07,310.52,72396542,19.27076011\n2020-07-02T13:30:00Z,314.24,315.7,311.51,312.23,69344217,6.19876841\n2020-07-06T13:30:00Z,316.37,317.68,315.56,317.05,61713828,37.00200437\n2020-07-07T13:30:00Z,315.38,317.52,313.37,313.78,82909963,-20.76388889\n2020-07-08T13:30:00Z,314.61,316.3,312.7,316.18,54638596,10.9659375\n2020-07-09T13:30:00Z,316.84,317.1,310.68,314.38,83354158,-13.30848624\n2020-07-10T13:30:00Z,314.31,317.88,312.76,317.59,57550365,16.15355275\n2020-07-13T13:30:00Z,320.13,322.71,314.13,314.84,102997484,-15.57446809\n2020-07-14T13:30:00Z,313.3,319.76,312,318.92,93656951,18.84950454\n2020-07-15T13:30:00Z,322.41,323.04,319.265,321.85,87196524,19.50794021\n2020-07-16T13:30:00Z,319.79,321.28,319.09,320.79,54622520,-4.617590822\n2020-07-17T13:30:00Z,321.88,322.57,319.735,321.72,62774911,3.966774716\n2020-07-20T13:30:00Z,321.43,325.13,320.62,324.32,56308749,18.75968407\n2020-07-21T13:30:00Z,326.45,326.93,323.94,325.01,57498967,3.04280303\n2020-07-22T13:30:00Z,324.62,327.2,324.5,326.86,57792915,11.67463235\n2020-07-23T13:30:00Z,326.47,327.23,321.48,322.96,75737989,-27.15045563\n2020-07-24T13:30:00Z,320.95,321.99,319.246,320.88,73766597,-16.91547699\n2020-07-27T13:30:00Z,321.63,323.41,320.775,323.22,48292970,18.5845311\n2020-07-28T13:30:00Z,322.43,323.64,320.85,321.17,57494979,-10.60691176\n2020-07-29T13:30:00Z,322.12,325.73,322.075,325.12,48454159,33.09157716\n2020-07-30T13:30:00Z,321.9,324.41,319.64,323.96,61861714,3.614468085\n2020-07-31T13:30:00Z,325.9,326.63,321.33,326.52,85210755,9.714047721\n2020-08-03T13:30:00Z,328.32,329.62,327.73,328.79,53077948,19.44811321\n2020-08-04T13:30:00Z,327.86,330.06,327.86,330.06,41917893,8.519754585\n2020-08-05T13:30:00Z,331.47,332.39,331.18,332.11,42866354,18.32866379\n2020-08-06T13:30:00Z,331.4799,334.46,331.13,334.33,43679447,16.01337303\n2020-08-07T13:30:00Z,333.28,334.88,332.3,334.57,57308270,6.155943672\n2020-08-10T13:30:00Z,335.06,335.77,332.955,335.57,44282089,5.0750249\n2020-08-11T13:30:00Z,336.85,337.54,332.01,332.8,69600882,-18.3564958\n2020-08-12T13:30:00Z,335.44,338.28,332.8377,337.44,53826128,24.48261414\n2020-08-13T13:30:00Z,336.61,338.2514,335.83,336.83,41816146,0\n2020-08-14T13:30:00Z,336.41,337.42,335.62,336.84,47260390,1.141509434\n2020-08-17T13:30:00Z,337.94,338.34,336.8517,337.91,35480974,6.80450629\n2020-08-18T13:30:00Z,338.34,339.1,336.61,338.64,38733908,2.838463463\n2020-08-19T13:30:00Z,339.05,339.61,336.62,337.23,68054244,-9.247349103\n2020-08-20T13:30:00Z,335.36,338.8,335.22,338.28,42207826,6.398001859\n2020-08-21T13:30:00Z,337.92,339.72,337.55,339.48,55106628,8.410344828\n2020-08-24T13:30:00Z,342.12,343,339.4504,342.92,48588662,23.62168748\n2020-08-25T13:30:00Z,343.53,344.21,342.27,344.12,38463381,6.385952103\n2020-08-26T13:30:00Z,344.76,347.86,344.17,347.57,50790237,30.27402913\n2020-08-27T13:30:00Z,348.51,349.9,346.53,348.33,58034142,4.907803867\n2020-08-28T13:30:00Z,349.44,350.72,348.15,350.58,48588940,15.85145793\n2020-08-31T13:30:00Z,350.35,351.3,349.06,349.31,66099183,-5.662376238\n2020-09-01T13:30:00Z,350.21,352.71,349.24,352.6,54999325,24.07004021\n2020-09-02T13:30:00Z,354.67,358.75,353.43,357.7,69540035,43.7789923\n2020-09-03T13:30:00Z,355.87,356.38,342.59,345.39,148011129,-104.280238\n2020-09-04T13:30:00Z,346.13,347.83,334.87,342.57,139156281,-30.4695122\n2020-09-08T13:30:00Z,336.71,342.64,332.88,333.21,114465322,-68.23943662\n2020-09-09T13:30:00Z,337.55,342.46,336.61,339.79,91462290,46.83327151\n2020-09-10T13:30:00Z,341.82,342.53,332.85,333.89,90569548,-39.41448975\n2020-09-11T13:30:00Z,335.82,336.97,331,334.06,84680194,-6.517525935\n2020-09-14T13:30:00Z,337.49,340.38,334.2208,338.46,65605686,26.28563088\n2020-09-15T13:30:00Z,341.12,342.02,338.4683,340.17,52920862,8.654909369\n2020-09-16T13:30:00Z,341.51,343.06,338.52,338.82,82211256,-11.08702904\n2020-09-17T13:30:00Z,333.56,337.6996,332.991,335.84,91523339,-15.40631101\n2020-09-18T13:30:00Z,335.37,335.49,327.97,330.65,105877942,-41.54007864\n2020-09-21T13:30:00Z,325.7,327.13,321.73,326.97,99450829,-28.24265588\n2020-09-22T13:30:00Z,328.57,330.9,325.86,330.3,63612107,20.68843327\n2020-09-23T13:30:00Z,330.9,331.2,322.1,322.64,93112240,-61.06182796\n2020-09-24T13:30:00Z,321.22,326.797,319.8,323.5,76681332,-0.186358558\n2020-09-25T13:30:00Z,322.58,329.58,321.64,328.73,71069426,39.62984724\n2020-09-28T13:30:00Z,333.22,334.96,332.15,334.19,64584614,48.09737412\n2020-09-29T13:30:00Z,333.97,334.77,331.6209,332.37,51531594,-11.25581446\n2020-09-30T13:30:00Z,333.09,338.29,332.88,334.89,104081136,18.42374279\n2020-10-01T13:30:00Z,337.69,338.74,335.01,337.04,88698745,12.91089328\n2020-10-02T13:30:00Z,331.7,337.0126,331.19,333.84,89431112,-13.97271642\n2020-10-05T13:30:00Z,336.06,339.96,336.01,339.76,45713108,57.03164273\n2020-10-06T13:30:00Z,339.91,342.17,334.38,334.93,90128883,-24.67376649\n2020-10-07T13:30:00Z,338.12,341.63,338.09,340.76,56999597,38.84868421\n2020-10-08T13:30:00Z,342.85,343.85,341.86,343.78,45242476,25.01572266\n2020-10-09T13:30:00Z,345.56,347.35,344.89,346.85,59528606,27.12196882\n2020-10-12T13:30:00Z,349.59,354.02,349.06,352.43,80388533,51.37213796\n2020-10-13T13:30:00Z,352.28,352.4651,349.09,350.13,73255513,-13.61824068\n2020-10-14T13:30:00Z,350.75,351.93,347.14,347.93,57958749,-14.54836344\n2020-10-15T13:30:00Z,343.71,348.02,343.13,347.5,60357659,4.075067024\n2020-10-16T13:30:00Z,348.96,350.75,347.1,347.29,89501868,-0.430770799\n2020-10-19T13:30:00Z,348.65,349.33,341.04,342.01,68425614,-40.45318332\n2020-10-20T13:30:00Z,343.46,346.88,342.64,343.38,60051880,-1.616150442\n2020-10-21T13:30:00Z,343.33,348.6847,342.4,342.73,63574979,-5.100915785\n2020-10-22T13:30:00Z,342.96,345.24,340.65,344.61,55399292,8.456025844\n2020-10-23T13:30:00Z,345.93,345.99,343.13,345.78,49143511,4.261077158\n2020-10-26T13:30:00Z,342.13,342.98,335.62,339.39,91473002,-56.28204035\n2020-10-27T13:30:00Z,339.76,340.12,337.99,338.22,65994108,-8.159413854\n2020-10-28T13:30:00Z,332.1,332.84,326.13,326.66,127094307,-113.2472215\n2020-10-29T13:30:00Z,326.91,333.395,325.09,329.98,90596689,15.22169232\n2020-10-30T13:30:00Z,328.28,329.69,322.6,326.54,120448685,-20.41834583\n2020-11-02T14:30:00Z,330.2,332.36,327.24,330.2,86068299,19.86610923\n2020-11-03T14:30:00Z,333.69,338.25,330.2935,336.03,93294192,44.00556024\n2020-11-04T14:30:00Z,340.86,347.94,339.59,343.54,126959700,65.54529281\n2020-11-05T14:30:00Z,349.24,352.19,348.86,350.24,82039749,63.88466592\n2020-11-06T14:30:00Z,349.93,351.51,347.65,350.16,74972973,1.122490876\n2020-11-09T14:30:00Z,363.97,364.38,354.06,354.56,172304203,-1.784349016\n2020-11-10T14:30:00Z,353.49,355.18,350.51,354.04,85552022,-9.362651299\n2020-11-11T14:30:00Z,356.4,357.56,355.06,356.67,58649048,20.28752979\n2020-11-12T14:30:00Z,355.58,356.7182,351.26,353.21,68118563,-28.01033693\n2020-11-13T14:30:00Z,355.27,358.9,354.71,358.1,62959429,36.71952666\n2020-11-16T14:30:00Z,360.98,362.78,359.59,362.57,74541138,37.62964459\n2020-11-17T14:30:00Z,359.97,361.92,358.34,360.62,66111009,-7.54259878\n2020-11-18T14:30:00Z,360.91,361.5,356.24,356.28,70591299,-32.77679806\n2020-11-19T14:30:00Z,355.6,358.18,354.15,357.78,59940947,3.676174699\n2020-11-20T14:30:00Z,357.5,357.72,355.25,355.33,70411890,-15.52688834\n2020-11-23T14:30:00Z,357.28,358.82,354.865,357.46,63230608,8.135735131\n2020-11-24T14:30:00Z,360.21,363.81,359.29,363.22,62415877,52.94080748\n2020-11-25T14:30:00Z,363.13,363.16,361.48,362.66,45330890,-0.187690355\n2020-11-27T14:30:00Z,363.84,364.18,362.58,363.67,28514072,4.466521106\n2020-11-30T14:30:00Z,362.83,363.12,359.17,362.06,83872709,-13.42816344\n2020-12-01T14:30:00Z,365.57,367.68,364.93,366.02,74504969,32.03576528\n2020-12-02T14:30:00Z,364.82,366.96,364.2,366.79,45927000,7.395234987\n2020-12-03T14:30:00Z,366.68,368.19,365.5,366.69,62881998,1.092890809\n2020-12-04T14:30:00Z,367.32,369.85,367.22,369.85,50749859,30.17881795\n2020-12-07T14:30:00Z,369.02,369.62,367.72,369.09,48944269,-0.465120397\n2020-12-08T14:30:00Z,367.72,370.78,367.67,370.17,42458859,7.84377498\n2020-12-09T14:30:00Z,370.88,371.05,365.95,366.85,74098312,-21.80410284\n2020-12-10T14:30:00Z,365.37,367.86,364.43,366.73,57735353,-1.52528169\n2020-12-11T14:30:00Z,364.9,366.7402,363.26,366.3,57698614,3.463005864\n2020-12-14T14:30:00Z,368.64,369.8,364.47,364.66,69216174,-12.63204225\n2020-12-15T14:30:00Z,367.4,369.59,365.92,369.59,64071099,29.27042021\n2020-12-16T14:30:00Z,369.82,371.16,368.8676,370.17,58420517,4.500433554\n2020-12-17T14:30:00Z,371.94,372.46,371.05,372.24,64119472,17.04572581\n2020-12-18T14:30:00Z,370.97,371.15,367.02,369.18,136542328,-26.64947368\n2020-12-21T14:30:00Z,364.97,378.46,362.03,367.86,96386745,-1.108280255\n2020-12-22T14:30:00Z,368.21,368.3317,366.03,367.24,48388462,-1.446611914\n2020-12-23T14:30:00Z,368.28,369.62,367.2172,367.57,46201402,-1.504200847\n2020-12-24T14:30:00Z,368.08,369.03,367.45,369,26457853,8.891358464\n2020-12-28T14:30:00Z,371.74,372.59,371.07,372.17,39000402,29.12443896\n2020-12-29T14:30:00Z,373.81,374,370.83,371.46,53680451,-6.202946224\n2020-12-30T14:30:00Z,372.34,373.1,371.57,371.99,49455259,-1.096950518\n2020-12-31T14:30:00Z,371.78,374.66,371.232,373.88,78520702,13.5403481\n2021-01-04T14:30:00Z,375.31,375.45,364.82,368.79,110210810,-39.72125728\n2021-01-05T14:30:00Z,368.1,372.5,368.05,371.33,66426229,9.62967722\n2021-01-06T14:30:00Z,369.71,376.98,369.12,373.55,107997675,20.15674575\n2021-01-07T14:30:00Z,376.1,379.9,375.91,379.1,68766812,51.85919657\n2021-01-08T14:30:00Z,380.59,381.49,377.1,381.26,71677208,9.430386673\n2021-01-11T14:30:00Z,377.85,380.58,377.7189,378.69,51176719,-13.02512681\n2021-01-12T14:30:00Z,378.89,379.86,376.36,378.77,52547716,0.902796496\n2021-01-13T14:30:00Z,378.69,380.86,377.85,379.79,45303619,6.6171875\n2021-01-14T14:30:00Z,380.59,381.13,378.1,378.46,49989113,-6.775340393\n2021-01-15T14:30:00Z,376.72,377.58,373.7,375.7,107159962,-23.3125966\n2021-01-19T14:30:00Z,378.34,379.23,376.75,378.65,51229172,19.2877684\n2021-01-20T14:30:00Z,381.11,384.79,380.69,383.89,61836062,49.52386965\n2021-01-21T14:30:00Z,384.49,384.95,383.25,384.24,47955809,2.544885177\n2021-01-22T14:30:00Z,382.25,384.1256,381.835,382.88,52136931,-6.906654514\n2021-01-25T14:30:00Z,383.67,384.77,378.46,384.39,70401971,8.660175879\n2021-01-26T14:30:00Z,385.41,385.85,383.54,383.79,42665281,-4.50753012\n2021-01-27T14:30:00Z,380.22,380.32,372.01,374.41,123351078,-89.40681818\n2021-01-28T14:30:00Z,376.36,381.93,375.89,377.63,94198104,13.71606438\n2021-01-29T14:30:00Z,375.63,376.67,368.27,370.07,126765121,-63.74734982\n2021-02-01T14:30:00Z,373.72,377.34,370.376,376.23,75817597,32.18066739\n2021-02-02T14:30:00Z,379.65,383.22,376.3181,381.55,64450662,39.78827763\n2021-02-03T14:30:00Z,382.435,383.7,380.48,381.85,52427090,1.754693843\n2021-02-04T14:30:00Z,382.96,386.24,381.9655,386.19,47142555,35.58726764\n2021-02-05T14:30:00Z,388.2,388.47,386.1444,387.71,48669773,9.471649485\n2021-02-08T14:30:00Z,389.27,390.56,388.35,390.51,38365185,22.14390905\n2021-02-09T14:30:00Z,389.61,390.89,389.17,390.25,35551059,1.526477833\n2021-02-10T14:30:00Z,392.12,392.28,387.5,390.08,59154370,-3.583628543\n2021-02-11T14:30:00Z,391.24,391.69,388.1,390.71,42913288,-0.437652439\n2021-02-12T14:30:00Z,389.85,392.9,389.77,392.64,50593270,13.39382184\n2021-02-16T14:30:00Z,393.96,394.17,391.53,392.3,50972366,-1.353792135\n2021-02-17T14:30:00Z,390.42,392.66,389.33,392.39,52806681,3.271361816\n2021-02-18T14:30:00Z,389.59,391.515,387.74,390.72,59712773,-3.783375399\n2021-02-19T14:30:00Z,392.07,392.38,389.55,390.03,83240971,-4.758333333\n2021-02-22T14:30:00Z,387.06,389.62,386.74,387.03,67413570,-20.16211752\n2021-02-23T14:30:00Z,384.66,388.945,380.2,387.5,107284127,9.181287489\n2021-02-24T14:30:00Z,386.33,392.23,385.27,391.77,72433946,29.67812907\n2021-02-25T14:30:00Z,390.41,391.88,380.7789,382.33,146670499,-66.81399114\n2021-02-26T14:30:00Z,384.35,385.58,378.23,380.36,152701639,-16.36772946\n2021-03-01T14:30:00Z,385.59,390.92,380.572,389.58,105348798,58.88791861\n2021-03-02T14:30:00Z,389.82,390.07,386,386.54,79595332,-16.2596818\n2021-03-03T14:30:00Z,385.79,386.83,381.31,381.42,119940211,-41.89052642\n2021-03-04T14:30:00Z,381.22,384,371.88,376.7,183433020,-36.42935194\n2021-03-05T14:30:00Z,380.46,384.76,372.64,383.63,152039624,28.07693396\n2021-03-08T14:30:00Z,384.66,387.68,381.42,381.72,123149245,-9.286932825\n2021-03-09T14:30:00Z,385.85,389.91,381.7299,387.17,113633556,30.84431281\n2021-03-10T14:30:00Z,389.69,391.4,388.1702,389.58,109899410,17.48434383\n2021-03-11T14:30:00Z,392.23,395.65,391.74,393.53,86245040,34.57283881\n2021-03-12T14:30:00Z,392.07,394.21,391.2,394.06,64653565,8.078148426\n2021-03-15T13:30:00Z,394.33,396.685,392.03,396.41,73592302,12.3783206\n2021-03-16T13:30:00Z,397.07,397.83,395.08,395.91,73722506,-1.519877676\n2021-03-17T13:30:00Z,394.53,398.12,393.3,397.26,97959265,7.741254892\n2021-03-18T13:30:00Z,394.475,396.72,390.75,391.48,115349101,-38.7625948\n2021-03-19T13:30:00Z,389.88,391.569,387.15,389.48,113624490,-15.44202929\n2021-03-22T13:30:00Z,390.03,394.07,389.97,392.59,73778646,27.68714848\n2021-03-23T13:30:00Z,391.91,393.46,388.66,389.5,90686552,-16.50292969\n2021-03-24T13:30:00Z,391,392.75,387.47,387.52,97588644,-14.92575967\n2021-03-25T13:30:00Z,385.98,390.55,383.9,389.7,116128622,9.537400266\n2021-03-26T13:30:00Z,390.93,396.41,390.29,395.98,114409114,55.58360279\n2021-03-29T13:30:00Z,394.4,396.75,392.81,395.78,108107626,6.673984863\n2021-03-30T13:30:00Z,394.42,395.45,393.02,394.73,76262249,-3.227040816\n2021-03-31T13:30:00Z,395.34,398,395.31,396.33,112734214,14.52182134\n2021-04-01T13:30:00Z,398.4,400.67,398.18,400.61,99682876,41.71510239\n2021-04-05T13:30:00Z,403.46,406.94,403.38,406.36,91684764,55.79050136\n2021-04-06T13:30:00Z,405.76,407.24,405.4,406.12,62020953,1.555555556\n2021-04-07T13:30:00Z,405.94,406.96,405.45,406.59,55836280,2.90390625\n2021-04-08T13:30:00Z,407.93,408.58,406.93,408.52,57863114,14.97832598\n2021-04-09T13:30:00Z,408.39,411.67,408.26,411.49,61104559,25.83033204\n2021-04-12T13:30:00Z,410.85,411.93,410.2,411.64,56704899,4.248502994\n2021-04-13T13:30:00Z,411.53,413.529,411.12,412.86,55222003,9.432770238"
  },
  {
    "path": "Tests/TestData/spy_sm.csv",
    "content": "date,open,high,low,close,mid_bb,bb high,bb low,kc high,kc low,squeeze on\n19980102 00:00,973100,975300,965300,973600,,,,,,-1\n19980105 00:00,978400,984400,967800,977500,,,,,,-1\n19980106 00:00,972500,972800,961900,966300,,,,,,-1\n19980107 00:00,960900,965000,952200,964700,,,,,,-1\n19980108 00:00,963100,963100,955000,957800,,,,,,-1\n19980109 00:00,952500,955000,919100,924700,,,,,,-1\n19980112 00:00,911300,941900,909100,940600,,,,,,-1\n19980113 00:00,946300,956300,942200,952200,,,,,,-1\n19980114 00:00,956900,959700,947200,958100,,,,,,-1\n19980115 00:00,955000,957500,948100,949400,,,,,,-1\n19980116 00:00,962500,966900,956600,962300,,,,,,-1\n19980120 00:00,966900,980000,965000,980000,,,,,,-1\n19980121 00:00,972200,976900,961600,971600,,,,,,-1\n19980122 00:00,961600,968800,958800,963000,,,,,,-1\n19980123 00:00,965000,967800,950000,956600,,,,,,-1\n19980126 00:00,963800,967300,937500,957500,,,,,,-1\n19980127 00:00,958100,980000,956600,970000,,,,,,-1\n19980128 00:00,974100,981100,971700,978800,,,,,,-1\n19980129 00:00,978400,995600,975600,987500,,,,,,-1\n19980130 00:00,987800,989700,980000,983100,963765.0,993374.2738850516,934155.7261149484,,,-1\n19980202 00:00,999100,1005000,997500,1002500,965210.0,999108.2536423339,931311.7463576661,993841.5873015873,938971.5873015873,-1\n19980203 00:00,1000000,1008100,997200,1006900,966680.0,1004861.8071861456,928498.1928138544,997000.7615268329,942985.7615268329,-1\n19980204 00:00,1002800,1011600,998800,1005900,968660.0,1010490.390865972,926829.609134028,1000166.0064607854,946571.0064607854,-1\n19980205 00:00,1013100,1015900,1000300,1003800,970615.0,1015093.321685963,926136.678314037,1003449.7598137264,949629.7598137264,-1\n19980206 00:00,1010000,1015000,1006900,1012800,973365.0,1021021.4906387368,925708.5093612632,1006898.1557044826,952853.1557044826,-1\n19980209 00:00,1017200,1017500,1007200,1011400,977700.0,1022551.3990863161,932848.6009136839,1007830.791669135,958045.791669135,-1\n19980210 00:00,1014400,1024700,1011900,1020500,981695.0,1026849.112769492,936540.887230508,1009805.914684773,962945.914684773,-1\n19980211 00:00,1020900,1031900,1017000,1021300,985150.0,1031311.3041410227,938988.6958589773,1013272.0180481279,966532.0180481279,-1\n19980212 00:00,1017200,1029400,1008800,1026600,988575.0,1036337.1555208723,940812.8444791277,1016898.3734721157,968943.3734721157,-1\n19980213 00:00,1021900,1029400,1018800,1021600,992185.0,1038448.2586400915,945921.7413599085,1019833.4490144539,971788.4490144539,-1\n19980217 00:00,1028100,1030900,1021600,1023400,995240.0,1041274.8737372006,949205.1262627994,1022026.9300606964,975211.9300606964,-1\n19980218 00:00,1023100,1034700,1022800,1034100,997945.0,1046375.4645858369,949514.5354141631,1024631.3494199952,978686.3494199952,-1\n19980219 00:00,1032500,1034100,1027500,1030000,1000865.0,1049630.736947164,952099.263052836,1026496.3002688845,982321.3002688845,-1\n19980220 00:00,1030800,1037500,1023800,1035600,1004495.0,1052243.7371560757,956746.2628439243,1029220.1050051813,984910.1050051813,-1\n19980223 00:00,1042500,1042500,1033400,1040000,1008665.0,1053427.9433795412,963902.056620459,1031574.1029411957,988569.1029411957,-1\n19980224 00:00,1039100,1040900,1029400,1031900,1012385.0,1051535.5951423475,973234.4048576525,1032486.8471055262,992226.8471055262,-1\n19980225 00:00,1037500,1048800,1036300,1044800,1016125.0,1052562.1719539263,979687.8280460736,1034946.3140478571,995661.3140478571,-1\n19980226 00:00,1044400,1051600,1041900,1050600,1019715.0,1054860.2571480137,984569.7428519864,1037958.4111226643,998883.4111226643,-1\n19980227 00:00,1049700,1055300,1043100,1052000,1022940.0,1057501.388860982,988378.6111390182,1040393.6418093947,1002488.6418093947,-1\n19980302 00:00,1052500,1057500,1046300,1048100,1026190.0,1057196.4444914279,995183.5555085721,1043286.3505259603,1005156.3505259603,-1\n19980303 00:00,1045300,1054700,1045000,1054100,1028770.0,1060048.177696279,997491.8223037211,1044947.0949203133,1008647.0949203133,-1\n19980304 00:00,1050900,1054100,1040600,1049700,1030910.0,1061763.8425483764,1000056.1574516236,1047174.1176263152,1010484.1176263152,-1\n19980305 00:00,1035000,1044400,1031600,1037500,1032490.0,1061222.5529669747,1003757.4470330254,1048429.1619793646,1010944.1619793646,-1\n19980306 00:00,1045600,1058800,1044400,1057500,1035175.0,1062692.2582209783,1007657.7417790217,1051130.94814006,1012790.9481400601,-1\n19980309 00:00,1055300,1062200,1052500,1054400,1037255.0,1063969.9003367035,1010540.0996632965,1053342.8022854512,1015227.8022854512,-1\n19980310 00:00,1062200,1068400,1053800,1066600,1040015.0,1066880.314068516,1013149.6859314841,1056393.6861947733,1017633.6861947733,-1\n19980311 00:00,1069700,1073100,1067300,1072500,1042615.0,1071417.6578634682,1013812.342136532,1059117.3033825727,1021377.3033825727,-1\n19980312 00:00,1070900,1075900,1065000,1072500,1045175.0,1075026.8927373122,1015323.1072626876,1061758.83004455,1024618.8300445499,-1\n19980313 00:00,1078400,1080000,1068800,1072200,1047455.0,1078234.959389187,1016675.0406108131,1063956.4811514183,1028226.4811514182,-1\n19980316 00:00,1078400,1082800,1075300,1082500,1050500.0,1082472.6758342183,1018527.3241657818,1067204.9115179498,1031474.9115179498,-1\n19980317 00:00,1083100,1085000,1076600,1084700,1053565.0,1086302.1516781775,1020827.8483218225,1070257.4199448116,1034662.4199448116,-1\n19980318 00:00,1082500,1089400,1080000,1087800,1056250.0,1090912.861970703,1021587.1380292971,1073238.816458004,1038018.8164580041,-1\n19980319 00:00,1089700,1093800,1086600,1093400,1059420.0,1095468.99998613,1023371.00001387,1076677.8974302576,1041367.8974302576,-1\n19980320 00:00,1095600,1101900,1088800,1100000,1062640.0,1101031.7386946722,1024248.2613053276,1080240.240532138,1045020.2405321379,-1\n19980323 00:00,1097200,1103100,1094100,1095000,1065390.0,1104767.6027711185,1026012.3972288815,1083544.146195744,1048339.1461957439,-1\n19980324 00:00,1100600,1108100,1099400,1105900,1069090.0,1109086.644859288,1029093.3551407121,1087333.1957644033,1051888.1957644033,-1\n19980325 00:00,1114100,1115300,1091900,1101900,1071945.0,1112742.3761411197,1031147.6238588804,1091003.8041043014,1054583.8041043014,-1\n19980326 00:00,1098800,1107500,1096300,1101300,1074480.0,1115952.1882711777,1033007.8117288224,1093869.275141987,1057224.275141987,-1\n19980327 00:00,1107500,1107800,1090000,1095300,1076645.0,1117715.888716949,1035574.1112830511,1096399.1060808455,1058914.1060808455,-1\n19980330 00:00,1096300,1100900,1089700,1093400,1078910.0,1118400.246897177,1039419.7531028229,1098019.1118509236,1060534.1118509236,-1\n19980331 00:00,1101600,1111900,1097500,1100900,1081250.0,1120123.9244224196,1042376.0755775803,1100979.7519921055,1062174.7519921055,-1\n19980401 00:00,1103100,1110800,1094100,1109800,1084255.0,1122189.1785201684,1046320.8214798317,1103440.9660880954,1064155.9660880954,-1\n19980402 00:00,1109400,1122500,1107500,1120300,1088395.0,1122936.075547817,1053853.924452183,1106348.2947146262,1067528.2947146262,-1\n19980403 00:00,1123400,1128100,1118400,1121900,1091615.0,1126042.156432096,1057187.843567904,1108893.6952179952,1071813.6952179952,-1\n19980406 00:00,1132500,1133800,1120600,1122500,1095020.0,1127464.3893454631,1062575.6106545369,1112516.1607527894,1074911.1607527894,-1\n19980407 00:00,1117500,1119400,1101600,1110000,1097190.0,1127474.3788115259,1066905.6211884741,1114571.486712841,1076021.486712841,-1\n19980408 00:00,1112200,1112800,1097500,1101300,1098630.0,1126742.4242995868,1070517.5757004132,1116047.694327491,1076177.694327491,-1\n19980409 00:00,1105600,1112800,1105300,1110000,1100505.0,1126303.1762921335,1074706.8237078665,1117354.9774074126,1077394.9774074126,-1\n19980413 00:00,1113800,1113800,1100000,1110000,1102395.0,1124957.2228514834,1079832.7771485166,1118555.5351146432,1078205.5351146432,-1\n19980414 00:00,1111300,1117200,1109100,1116900,1104115.0,1125565.8065116443,1082664.1934883557,1119893.6984370581,1079918.6984370581,-1\n19980415 00:00,1119700,1121300,1111600,1120200,1105890.0,1126478.627929029,1085301.372070971,1121685.8462049575,1081515.8462049575,-1\n19980416 00:00,1113100,1115000,1105000,1109100,1106955.0,1125822.0585942802,1088087.9414057198,1122892.1941854376,1081852.1941854376,-1\n19980417 00:00,1107200,1124100,1104400,1122200,1108395.0,1127300.181829329,1089489.818170671,1125213.2947392054,1082298.2947392054,-1\n19980420 00:00,1120000,1125600,1118800,1124100,1109600.0,1129268.0451494295,1089931.9548505705,1126557.7031767415,1084587.7031767415,-1\n19980421 00:00,1124400,1131600,1119100,1126300,1111165.0,1130918.0023034473,1091411.9976965527,1128733.9139853057,1086238.9139853057,-1\n19980422 00:00,1128800,1134400,1128100,1130000,1112370.0,1133578.0267823294,1091161.9732176706,1130582.4301136893,1088837.4301136893,-1\n19980423 00:00,1126300,1130000,1117500,1120900,1113320.0,1134267.5153657899,1092372.4846342101,1131011.603436195,1090901.603436195,-1\n19980424 00:00,1117500,1124700,1103400,1108800,1113695.0,1134027.8773172908,1093362.1226827092,1131897.0459660813,1090272.0459660813,-1\n19980427 00:00,1093800,1106600,1076300,1085900,1113225.0,1135571.800665867,1090878.199334133,1130953.3987312163,1087123.3987312163,-1\n19980428 00:00,1097800,1098100,1081300,1086300,1112870.0,1136645.2055721923,1089094.7944278077,1129423.709963164,1084753.709963164,-1\n19980429 00:00,1090300,1099700,1084400,1095300,1112590.0,1137044.6846227874,1088135.3153772126,1127854.6264746087,1083664.6264746087,-1\n19980430 00:00,1105600,1119200,1104100,1114400,1112820.0,1137251.913555839,1088388.086444161,1129042.9160167095,1083772.9160167095,-1\n19980501 00:00,1117500,1123100,1113100,1121900,1112900.0,1137439.6006487473,1088360.3993512527,1129902.0827452769,1085382.0827452769,-1\n19980504 00:00,1127200,1133100,1121600,1122500,1112930.0,1137514.9628838443,1088345.0371161557,1131760.0589917584,1086970.0589917584,-1\n19980505 00:00,1120000,1121600,1111300,1116600,1112635.0,1136892.969824369,1088377.030175631,1132289.5771830196,1087799.5771830196,-1\n19980506 00:00,1121300,1121300,1104700,1105000,1112385.0,1136848.628103779,1087921.371896221,1131994.5777687638,1088149.5777687638,-1\n19980507 00:00,1105000,1105600,1094100,1095900,1112115.0,1137173.9923979398,1087056.0076020602,1130610.6497272942,1087335.6497272942,-1\n19980508 00:00,1100000,1113800,1100000,1110000,1112115.0,1137173.9923979398,1087056.0076020602,1130991.619594536,1086756.619594536,-1\n19980511 00:00,1115600,1122200,1103800,1108600,1112045.0,1137135.0358708391,1086954.9641291609,1131589.87804585,1086664.87804585,-1\n19980512 00:00,1108100,1118800,1102500,1116400,1112020.0,1137091.6253960528,1086948.3746039472,1132532.4293430706,1086377.4293430706,-1\n19980513 00:00,1120600,1125600,1115900,1120600,1112040.0,1137138.3186687874,1086941.6813312126,1133603.3884532542,1087448.3884532542,-1\n19980514 00:00,1115300,1126900,1113400,1119700,1112570.0,1137844.659245972,1087295.340754028,1134378.1847910394,1088478.1847910394,-1\n19980515 00:00,1120000,1122200,1108100,1110000,1111960.0,1136861.6786582752,1087058.3213417248,1134149.151318877,1089089.151318877,-1\n19980518 00:00,1107200,1115900,1098300,1108400,1111175.0,1135479.0634462635,1086870.9365537365,1134570.0257964442,1087890.0257964442,-1\n19980519 00:00,1110000,1116900,1107800,1110600,1110390.0,1133682.3936082146,1087097.6063917854,1134366.1344507511,1088196.1344507511,-1\n19980520 00:00,1120900,1125000,1108800,1122800,1110030.0,1132299.0008756567,1087760.9991243433,1135696.0660903621,1088311.0660903621,-1\n19980521 00:00,1123800,1127800,1113100,1116900,1109830.0,1131774.3933614034,1087885.6066385966,1136552.7899547722,1088837.7899547722,-1\n19980522 00:00,1117500,1120600,1109400,1111600,1109970.0,1131922.047740473,1088017.952259527,1135906.8496416193,1089706.8496416193,-1\n19980526 00:00,1120900,1120900,1094400,1095300,1110440.0,1130643.405653503,1090236.594346497,1134573.6576122586,1089273.6576122586,1\n19980527 00:00,1093100,1099100,1075800,1096300,1110940.0,1129122.8930591366,1092757.1069408634,1133011.28545871,1086736.28545871,1\n19980528 00:00,1098800,1103800,1087300,1100000,1111175.0,1128651.0264362355,1093698.9735637645,1131878.3852562932,1085423.3852562932,1\n19980529 00:00,1106300,1108100,1093800,1093800,1110145.0,1129104.5859659435,1091185.4140340565,1130197.9834858526,1085182.9834858526,1\n19980601 00:00,1089700,1102200,1085600,1095000,1108800.0,1128047.5452980374,1089552.4547019626,1129414.5247411681,1083409.5247411681,1\n19980602 00:00,1100000,1103400,1091600,1095900,1107470.0,1126420.894437994,1088519.105562006,1128537.4668293109,1082487.4668293109,1\n19980603 00:00,1098800,1101900,1082200,1085000,1105890.0,1126709.6926009967,1085070.3073990033,1127669.0176074717,1080344.0176074717,1\n19980604 00:00,1082500,1100600,1080600,1099100,1105595.0,1126622.9314246553,1084567.0685753447,1126917.0476766014,1079082.0476766014,1\n19980605 00:00,1103800,1118800,1098800,1118100,1106705.0,1127911.6475426927,1085498.3524573073,1128402.2098026394,1079292.2098026394,1\n19980608 00:00,1119400,1124700,1116600,1118800,1107145.0,1128963.2011174157,1085326.7988825843,1129208.7453769913,1081568.7453769913,1\n19980609 00:00,1117200,1124200,1114100,1122800,1107855.0,1130715.6627200525,1084994.3372799475,1130012.714071246,1083617.714071246,-1\n19980610 00:00,1116300,1130600,1112500,1113800,1107725.0,1130418.7766799622,1085031.2233200378,1131304.9952708099,1084639.9952708099,1\n19980611 00:00,1114400,1118800,1092800,1096600,1106525.0,1128904.6224275567,1084145.3775724433,1132028.5274672406,1082918.5274672406,1\n19980612 00:00,1098800,1104400,1082500,1102500,1105665.0,1127261.5992693293,1084068.4007306707,1131610.255010043,1081240.255010043,1\n19980615 00:00,1088100,1099100,1078800,1080000,1104165.0,1128359.8982225591,1079970.1017774409,1130381.8180249596,1078571.8180249596,1\n19980616 00:00,1084100,1091600,1077500,1090600,1103275.0,1128083.0531279664,1078466.9468720336,1128413.5893241698,1077128.5893241698,1\n19980617 00:00,1101600,1117800,1099400,1112500,1103370.0,1128303.7602458994,1078436.2397541006,1130450.0331980584,1076450.0331980584,1\n19980618 00:00,1111900,1114400,1107500,1111600,1102810.0,1126442.1729851488,1079177.8270148512,1130487.450671259,1077882.450671259,1\n19980619 00:00,1110600,1112300,1096300,1100300,1101980.0,1124723.755186864,1079236.244813136,1130468.9236232026,1077668.9236232026,1\n19980622 00:00,1102500,1110600,1100600,1103800,1101590.0,1123924.3591804197,1079255.6408195803,1130490.09756385,1077825.09756385,1\n19980623 00:00,1110900,1121900,1110000,1119700,1102810.0,1126273.8360035182,1079346.1639964818,1131102.2311291976,1079697.2311291976,-1\n19980624 00:00,1121600,1136900,1116100,1134700,1104730.0,1131761.9144716018,1077698.0855283982,1133184.5980057819,1082154.5980057819,-1\n19980625 00:00,1139100,1144700,1128100,1130000,1106230.0,1135298.2713624323,1077161.7286375677,1135725.1521639614,1084680.1521639614,-1\n19980626 00:00,1133100,1138400,1131300,1134100,1108245.0,1139118.449758652,1077371.550241348,1137606.209100727,1087446.209100727,-1\n19980629 00:00,1142500,1146900,1138000,1138900,1110440.0,1143406.0067342103,1077473.9932657897,1140058.3955355785,1090468.3955355785,-1\n19980630 00:00,1139100,1141900,1130600,1133600,1112325.0,1146052.4294899567,1078597.5705100433,1141935.4927861583,1092420.4927861583,-1\n19980701 00:00,1140600,1149400,1136300,1149400,1115545.0,1150497.0514419398,1080592.9485580602,1144295.8823620798,1095365.8823620798,-1\n19980702 00:00,1147200,1148800,1142500,1146300,1117905.0,1154435.1779355097,1081374.8220644903,1145792.9808672785,1098827.9808672785,-1\n19980706 00:00,1147800,1158400,1145600,1157800,1119890.0,1160349.9505684325,1079430.0494315675,1148264.6811021408,1102379.6811021408,-1\n19980707 00:00,1159800,1161300,1152800,1155600,1121730.0,1165068.9939892471,1078391.0060107529,1151270.3463940003,1105325.3463940003,-1\n19980708 00:00,1158800,1169400,1157500,1168100,1123995.0,1171823.3796505798,1076166.6203494202,1155043.2895945718,1108543.2895945718,-1\n19980709 00:00,1162800,1167200,1156300,1160000,1126305.0,1176351.9169879623,1076258.0830120377,1157368.2540776285,1111813.2540776285,-1\n19980710 00:00,1160300,1169100,1150600,1165300,1129740.0,1180584.2877814213,1078895.7122185787,1159384.4124194416,1114954.4124194416,-1\n19980713 00:00,1165600,1168400,1160600,1167500,1132990.0,1184755.3513462432,1081224.6486537568,1161025.06361759,1118710.06361759,-1\n19980714 00:00,1169400,1181600,1169400,1178100,1137895.0,1187177.9575005397,1088612.0424994603,1163781.1686698832,1122906.1686698832,-1\n19980715 00:00,1180600,1182800,1174400,1175600,1142145.0,1188980.1353152737,1095309.8646847263,1166616.1764156085,1126596.1764156085,-1\n19980716 00:00,1176900,1185900,1170600,1184400,1145740.0,1193939.2282095887,1097540.7717904113,1168932.6119950744,1130697.6119950744,-1\n19980717 00:00,1186300,1190000,1183100,1187500,1149535.0,1198332.8390915007,1100737.1609084993,1172461.331487607,1134226.331487607,-1\n19980720 00:00,1187500,1192300,1179400,1185000,1153770.0,1199335.605449725,1108204.394550275,1175297.6729332318,1137527.6729332318,-1\n19980721 00:00,1190000,1190000,1162800,1165300,1156845.0,1196412.5359354105,1117277.4640645895,1178116.3469395908,1137811.3469395908,-1\n19980722 00:00,1163400,1195900,1155300,1166300,1159175.0,1195033.1022922297,1123316.8977077703,1181188.2424691536,1137508.2424691536,-1\n19980723 00:00,1163100,1168400,1138800,1141900,1159535.0,1194537.3584919644,1124532.6415080356,1180929.3622339962,1135929.3622339962,-1\n19980724 00:00,1149700,1150900,1128800,1141600,1160115.0,1193486.98076231,1126743.01923769,1179627.9547196473,1133802.9547196473,-1\n19980727 00:00,1136300,1150000,1128400,1149800,1160900.0,1192477.6503242403,1129322.3496757597,1179286.324111427,1131481.324111427,-1\n19980728 00:00,1144400,1146600,1118800,1133100,1160610.0,1193084.2913702517,1128135.7086297483,1178503.658323037,1127968.658323037,-1\n19980729 00:00,1137200,1141300,1122500,1126600,1160260.0,1194016.7415489114,1126503.2584510886,1176865.8892763986,1125205.8892763986,-1\n19980730 00:00,1136300,1145900,1134100,1143400,1159960.0,1194200.642517336,1125719.357482664,1176185.2887103923,1124000.2887103923,-1\n19980731 00:00,1143400,1145000,1113100,1120600,1158675.0,1196600.4466025122,1120749.5533974878,1175787.9596268628,1119852.9596268628,-1\n19980803 00:00,1117800,1124200,1110300,1113800,1156475.0,1199154.9660262284,1113795.0339737716,1172849.4634719235,1116749.4634719235,-1\n19980804 00:00,1122200,1122200,1072500,1076100,1152500.0,1207729.0865396124,1097270.9134603876,1170745.8637761849,1108465.8637761849,-1\n19980805 00:00,1079400,1088800,1055900,1081600,1148175.0,1210881.6144836412,1085468.3855163588,1166066.694210199,1100921.694210199,-1\n19980806 00:00,1081300,1095200,1075600,1090900,1144720.0,1211895.072757683,1077544.927242317,1162245.8979362117,1095930.8979362117,-1\n19980807 00:00,1096900,1105900,1084700,1090300,1140970.0,1211424.5271788833,1070515.4728211167,1159071.72511689,1092351.72511689,-1\n19980810 00:00,1087500,1096600,1081900,1085900,1136890.0,1210122.694884184,1063657.305115816,1156010.3306613131,1088255.3306613131,-1\n19980811 00:00,1067800,1074400,1055000,1070600,1131515.0,1207585.2642298553,1055444.7357701447,1151987.8388522991,1081712.8388522991,-1\n19980812 00:00,1077500,1088100,1075000,1085000,1126985.0,1202804.7408331102,1051165.2591668898,1149417.9256282707,1077777.9256282707,-1\n19980813 00:00,1088100,1096600,1076300,1076400,1121585.0,1195642.1745342745,1047527.8254657255,1146888.3612827212,1074498.3612827212,-1\n19980814 00:00,1083400,1087200,1057800,1064800,1115450.0,1186933.2987487288,1043966.7012512713,1144693.95385897,1068928.95385897,-1\n19980817 00:00,1060000,1089400,1055000,1085000,1110450.0,1175472.0116575917,1045427.9883424082,1143416.4741263697,1064426.4741263697,-1\n19980818 00:00,1090000,1105900,1087800,1102500,1107310.0,1167304.6630959788,1047315.3369040212,1142449.865479414,1064404.865479414,-1\n19980819 00:00,1110900,1110900,1096300,1100000,1103995.0,1157568.5559768062,1050421.4440231938,1140402.0211480411,1066257.0211480411,-1\n19980820 00:00,1096900,1104100,1091600,1092500,1101525.0,1152365.8448002194,1050684.1551997806,1138427.8207212435,1066847.8207212435,-1\n19980821 00:00,1081900,1087200,1055000,1083800,1098635.0,1146520.4581266588,1050749.5418733412,1136982.3933509663,1063092.3933509663,-1\n19980824 00:00,1092500,1099400,1083100,1090600,1095675.0,1137475.8552544084,1053874.1447455916,1135727.3638254774,1062632.3638254774,-1\n19980825 00:00,1103800,1112500,1086400,1095000,1093770.0,1131885.0941229325,1055654.9058770675,1135244.321238924,1062884.321238924,-1\n19980826 00:00,1082800,1096300,1077500,1085000,1091690.0,1126836.487733485,1056543.512266515,1134025.496993947,1061665.496993947,-1\n19980827 00:00,1070000,1078400,1038900,1042500,1086645.0,1119548.0986382742,1053741.9013617258,1131789.8941056347,1055409.8941056347,-1\n19980828 00:00,1049700,1057200,1021600,1030000,1082115.0,1119687.238421473,1044542.7615785272,1126607.0867304949,1049672.0867304949,-1\n19980831 00:00,1037500,1040200,950000,962500,1074550.0,1136546.1127813673,1012553.8872186329,1122433.7530736222,1034053.7530736222,-1\n19980901 00:00,960600,1005600,936300,996900,1070590.0,1141203.1404201796,999976.8595798204,1114509.1099237534,1023189.1099237534,-1\n19980902 00:00,998100,1017500,987800,990000,1066010.0,1144603.992136804,987416.0078631961,1107562.8454865706,1016722.8454865706,-1\n19980903 00:00,976300,993800,966900,985200,1060725.0,1145856.8947281218,975593.1052718783,1100474.518932294,1008539.5189322941,-1\n19980904 00:00,994400,998100,957800,976300,1055025.0,1146502.0982268238,963547.901773176,1094563.4933196947,999763.4933196947,-1\n19980908 00:00,1008800,1029700,998100,1025900,1052025.0,1143190.0124773753,960859.9875226247,1094678.9939559142,994073.9939559142,-1\n19980909 00:00,1027500,1031300,1004800,1007500,1048870.0,1141599.3502619315,956140.6497380683,1091506.788182335,991561.7881823351,-1\n19980910 00:00,984400,993400,968100,982500,1043745.0,1139210.1239982434,948279.8760017565,1087415.8639110015,984185.8639110016,-1\n19980911 00:00,981900,1015000,970000,1012500,1040550.0,1135706.3870688668,945393.6129311332,1085779.3927448746,978844.3927448745,-1\n19980914 00:00,1028800,1044500,1020900,1031600,1038890.0,1133452.802411942,944327.197588058,1085976.4347056802,978651.4347056801,-1\n19980915 00:00,1028800,1043100,1022800,1042000,1036740.0,1128937.297140426,944542.702859574,1085266.8139400599,980056.8139400597,-1\n19980916 00:00,1047500,1052500,1031600,1050000,1034115.0,1121539.6481262578,946690.3518737422,1086413.3078505304,981203.3078505303,-1\n19980917 00:00,1022500,1030300,1017800,1022300,1030230.0,1112342.4131906985,948117.5868093015,1086748.3896425432,978898.3896425433,-1\n19980918 00:00,1023800,1024100,1010900,1019700,1026590.0,1103636.1913400006,949543.8086599993,1085411.3604702377,977456.3604702376,-1\n19980921 00:00,996300,1034100,989400,1021900,1023495.0,1095935.3333785813,951054.6666214187,1084398.9293143419,975363.929314342,-1\n19980922 00:00,1035000,1036600,1021600,1030000,1020465.0,1086182.0076920732,954747.9923079269,1084255.5789034523,975415.5789034523,-1\n19980923 00:00,1038800,1070000,1037800,1066300,1019030.0,1079192.815758573,958867.184241427,1087983.5793253458,977058.5793253457,-1\n19980924 00:00,1063100,1068100,1032500,1043800,1016970.0,1070401.1931365938,963538.8068634061,1090730.4606594397,977285.4606594398,-1\n19980925 00:00,1031300,1054200,1026300,1043000,1016995.0,1070474.3969674304,963515.6030325696,1090047.2421839377,979332.2421839376,-1\n19980928 00:00,1053100,1063100,1042500,1049100,1017950.0,1072983.7896205594,962916.2103794406,1090529.5683251498,982064.5683251498,-1\n19980929 00:00,1053800,1059400,1033800,1049400,1022295.0,1072654.5264076223,971935.4735923777,1086754.6888021198,987979.6888021197,-1\n19980930 00:00,1035000,1043100,1013800,1018400,1023370.0,1072416.0232842583,974323.9767157418,1083058.8851066798,989338.8851066798,-1\n19981001 00:00,1000300,1015500,980900,986300,1023185.0,1072758.1893264898,973611.8106735102,1079647.1658901707,984757.1658901706,-1\n19981002 00:00,988800,1008800,972200,1003100,1024080.0,1071476.2698954253,976683.7301045747,1076803.0310434876,980458.0310434877,-1\n19981005 00:00,995900,1000000,963400,990000,1024765.0,1069712.003237146,979817.9967628542,1072551.9487218857,976296.9487218857,1\n19981006 00:00,1007500,1012800,975300,985300,1022735.0,1070849.3336231522,974620.6663768478,1068188.8663039282,974318.8663039283,-1\n19981007 00:00,986300,1000300,957500,972200,1020970.0,1073570.9923860757,968369.0076139242,1065164.9663384748,968849.9663384748,-1\n19981008 00:00,945600,967500,922200,962200,1019955.0,1076146.9736261328,963763.0263738672,1059638.620337985,961733.6203379851,-1\n19981009 00:00,970000,995600,940600,986300,1018645.0,1076663.0135819903,960626.9864180097,1056910.577131193,957505.5771311929,-1\n19981012 00:00,1006300,1014400,996900,997800,1016955.0,1075333.0943505352,958576.9056494647,1056220.4824837777,957400.4824837777,-1\n19981013 00:00,995600,1004100,987500,995300,1014620.0,1072538.3079863354,956701.6920136646,1054878.4920884972,956613.4920884973,-1\n19981014 00:00,989400,1018100,988400,1005000,1012370.0,1068069.5547558507,956670.4452441494,1055356.3341118149,955771.334111815,-1\n19981015 00:00,1001300,1072500,999400,1050300,1013770.0,1071758.0711870985,955781.9288129015,1061773.31022815,956053.3102281501,-1\n19981016 00:00,1061300,1067500,1050000,1056600,1015615.0,1076515.3210172164,954714.6789827837,1066773.907666739,960408.907666739,-1\n19981019 00:00,1056900,1068100,1055000,1063400,1017690.0,1082035.9990986232,953344.000901377,1069030.1228095894,967405.1228095893,-1\n19981020 00:00,1075600,1088000,1060900,1065000,1019440.0,1086860.305546623,952019.694453377,1074993.0873039141,971553.0873039141,-1\n19981021 00:00,1068800,1076300,1058800,1071300,1019690.0,1087836.662427444,951543.3375725561,1077641.4837511606,977576.4837511604,-1\n19981022 00:00,1067800,1084700,1061600,1080000,1021500.0,1093902.0994170748,949097.9005829251,1081258.6837113674,983068.6837113674,-1\n19981023 00:00,1079700,1080000,1067800,1071300,1022915.0,1097999.0402482445,947830.9597517555,1083973.5312944117,988138.5312944117,-1\n19981026 00:00,1077200,1085600,1067800,1075500,1024235.0,1101994.5595409337,946475.4404590664,1087596.2902187535,992181.2902187535,-1\n19981027 00:00,1084400,1089700,1062800,1066300,1025080.0,1104269.206335207,945890.7936647929,1090840.8895629994,995230.8895629992,-1\n19981028 00:00,1065600,1078100,1060300,1067800,1027550.0,1108806.3966712775,946293.6033287225,1091953.2651601739,999013.2651601739,-1\n19981029 00:00,1070900,1089700,1066300,1089700,1032720.0,1115953.9978614508,949486.0021385492,1094364.0256211096,1003539.0256211096,-1\n19981030 00:00,1101300,1109100,1095000,1100000,1037565.0,1124535.4150846712,950594.5849153288,1098065.9438159247,1009820.9438159247,-1\n19981102 00:00,1108100,1117500,1101900,1114800,1043805.0,1134074.9612274205,953535.0387725795,1101872.9967858365,1016957.9967858365,-1\n19981103 00:00,1115900,1118100,1107500,1111300,1050105.0,1140749.657316358,959460.3426836418,1104892.1161395663,1024012.1161395663,-1\n19981104 00:00,1124700,1130900,1110900,1118400,1057415.0,1145288.278646014,969541.7213539861,1108478.73999929,1031018.7399992901,-1\n19981105 00:00,1115300,1138100,1111300,1137300,1066170.0,1149105.2542649987,983234.7457350012,1112372.193332691,1038392.193332691,-1\n19981106 00:00,1134700,1145000,1133100,1142800,1073995.0,1154815.3062355,993174.6937645,1115322.3415867204,1047807.3415867204,-1\n19981109 00:00,1139400,1142500,1125000,1131400,1080675.0,1157169.2056629127,1004180.7943370872,1119445.2534990963,1053475.2534990963,-1\n19981110 00:00,1130000,1139400,1125000,1126900,1087255.0,1155429.4079548917,1019080.5920451083,1123468.1658642618,1057828.1658642618,-1\n19981111 00:00,1138100,1140600,1118900,1123800,1093195.0,1151680.4332291384,1034709.5667708616,1126403.2611787766,1061963.2611787766,-1\n19981112 00:00,1123100,1131300,1116900,1120300,1096695.0,1152824.1893759388,1040565.8106240612,1124729.3394792106,1069094.3394792106,-1\n19981113 00:00,1122200,1130600,1121300,1127700,1100250.0,1154753.8897694468,1045746.1102305533,1127010.4341319841,1072455.4341319841,-1\n19981116 00:00,1142200,1143600,1128900,1138400,1104000.0,1158165.708709478,1049834.291290522,1130766.503897192,1075791.503897192,-1\n19981117 00:00,1136600,1156300,1130000,1143400,1107920.0,1161573.8013564742,1054266.1986435258,1134511.6781292055,1079656.6781292055,-1\n19981118 00:00,1143100,1149400,1135000,1147500,1111730.0,1165262.9468645244,1058197.0531354756,1137791.7960851542,1083401.7960851542,-1\n19981119 00:00,1152800,1159100,1146300,1155000,1115480.0,1170093.4269204927,1060866.5730795073,1141102.140902441,1088257.140902441,-1\n19981120 00:00,1163600,1167500,1158400,1166300,1120230.0,1175171.2085778972,1065288.7914221028,1145828.1671657006,1092938.1671657006,-1\n19981123 00:00,1174700,1192200,1171600,1191600,1126035.0,1185215.4452500993,1066854.5547499007,1152697.5877530943,1098592.5877530943,-1\n19981124 00:00,1190000,1196600,1184500,1186900,1132065.0,1190238.3366758346,1073891.6633241654,1157653.1349512122,1105768.1349512122,-1\n19981125 00:00,1189400,1191900,1181600,1188800,1138115.0,1193391.5872680289,1082838.4127319711,1162397.5586066523,1111637.5586066523,-1\n19981127 00:00,1194700,1197200,1190000,1195000,1143380.0,1199263.793715173,1087496.206284827,1166705.8069933204,1118195.8069933204,-1\n19981130 00:00,1190200,1193800,1166600,1166900,1146725.0,1199758.1547241912,1093691.8452758088,1170553.7460098295,1120693.7460098295,-1\n19981201 00:00,1161300,1180300,1152200,1178100,1149890.0,1202477.8655204792,1097302.1344795208,1173689.341627941,1122239.341627941,-1\n19981202 00:00,1172200,1179100,1160000,1175000,1153075.0,1203603.9174631715,1102546.0825368285,1176555.6344887721,1123830.6344887721,-1\n19981203 00:00,1172500,1183100,1151900,1152800,1154795.0,1202762.5087950167,1106827.4912049833,1178577.2407279366,1124172.2407279366,-1\n19981204 00:00,1166300,1188800,1155900,1179700,1156915.0,1205347.851454359,1108482.148545641,1181498.2178014664,1125713.2178014664,-1\n19981207 00:00,1180600,1195300,1180000,1192500,1159400.0,1209743.3411684206,1109056.6588315794,1185171.998645771,1128831.998645771,-1\n19981208 00:00,1185300,1197500,1175000,1184700,1162065.0,1211837.0915775097,1112292.9084224903,1188260.8162350627,1131215.8162350627,-1\n19981209 00:00,1186900,1189700,1178800,1188100,1165125.0,1213374.9274610854,1116875.0725389146,1190454.984530136,1133934.984530136,-1\n19981210 00:00,1188400,1188400,1167200,1168100,1167340.0,1211709.4669789935,1122970.5330210065,1191595.7399717104,1135150.7399717104,-1\n19981211 00:00,1164400,1173400,1155600,1170600,1169855.0,1208622.5366769673,1131087.4633230327,1192151.701244246,1135196.701244246,-1\n19981214 00:00,1161600,1164100,1139100,1144700,1170705.0,1206358.5818677451,1135051.4181322549,1192372.7296971749,1132237.7296971749,-1\n19981215 00:00,1146900,1167500,1145300,1166300,1172100.0,1204635.3961094683,1139564.6038905317,1192642.1125831583,1131472.1125831583,-1\n19981216 00:00,1171300,1171300,1157500,1164100,1173135.0,1203173.793251394,1143096.206748606,1191918.2209085717,1132623.2209085717,-1\n19981217 00:00,1172200,1185600,1170200,1185000,1175010.0,1203027.7015474145,1146992.2984525855,1194164.6205045807,1133804.6205045807,-1\n19981218 00:00,1183100,1191300,1178800,1190200,1176770.0,1203948.4547022085,1149591.5452977915,1196311.839186684,1135996.839186684,-1\n19981221 00:00,1192500,1213400,1190000,1203100,1178610.0,1207624.7479740907,1149595.2520259093,1200559.084660968,1138609.084660968,-1\n19981222 00:00,1204100,1212200,1191900,1205300,1179295.0,1210096.0048537382,1148493.9951462618,1203334.2512011933,1142224.2512011933,-1\n19981223 00:00,1211900,1231900,1208100,1228100,1181355.0,1218725.3880097598,1143984.6119902402,1209176.108229651,1145891.108229651,-1\n19981224 00:00,1231600,1238800,1222800,1226900,1183260.0,1225518.8878225635,1141001.1121774365,1214552.7883982558,1150412.7883982558,-1\n19981228 00:00,1232500,1233100,1220000,1226300,1184825.0,1230856.939998223,1138793.060001777,1219094.2291857235,1154249.2291857235,-1\n19981229 00:00,1227200,1244400,1221300,1243100,1188635.0,1240363.2234375007,1136906.7765624993,1223420.056564861,1159370.056564861,-1\n19981230 00:00,1239400,1247500,1230300,1233800,1191420.0,1246470.5440481745,1136369.4559518255,1226964.9321301123,1164549.9321301123,-1\n19981231 00:00,1233100,1239400,1224700,1228800,1194110.0,1250917.9888748052,1137302.0111251948,1229988.1925621652,1168233.1925621652,-1\n19990104 00:00,1233800,1252200,1217200,1228800,1197910.0,1253306.4222671464,1142513.5777328536,1233475.348826086,1171150.348826086,-1\n19990105 00:00,1229400,1248800,1229400,1244400,1201145.0,1259393.1407428598,1142896.8592571402,1235947.1410013794,1176022.1410013794,-1\n19990106 00:00,1258100,1276300,1257500,1275000,1205270.0,1271608.136844503,1138931.863155497,1243228.2466202956,1180858.2466202956,-1\n19990107 00:00,1263800,1272200,1257800,1269400,1209505.0,1280687.2583232648,1138322.7416767352,1248013.9294818547,1186438.9294818547,-1\n19990108 00:00,1281900,1285000,1259700,1275000,1213850.0,1289729.3911414687,1137970.6088585313,1254427.9203248527,1190692.9203248527,-1\n19990111 00:00,1276900,1276900,1252200,1262800,1218585.0,1294272.575598641,1142897.424401359,1258633.8723574064,1194373.8723574064,-1\n19990112 00:00,1262200,1262200,1238100,1240000,1222055.0,1294936.0942563296,1149173.9057436704,1261081.1622916218,1195786.1622916218,-1\n19990113 00:00,1204100,1251300,1203800,1233100,1226475.0,1290202.1331537832,1162747.8668462168,1262373.1944543244,1194678.1944543244,-1\n19990114 00:00,1236300,1239100,1209100,1211600,1228740.0,1286711.3170455873,1170768.6829544127,1262094.8743475634,1193319.8743475634,-1\n19990115 00:00,1223800,1247800,1220300,1243100,1232690.0,1282728.381268782,1182651.618731218,1264666.2355208113,1192531.2355208113,-1\n19990119 00:00,1253000,1274700,1235000,1252800,1236080.0,1281729.6045985066,1190430.3954014934,1268466.2765823214,1193601.2765823214,-1\n19990120 00:00,1260900,1279400,1250300,1256300,1239385.0,1280627.806645523,1198142.193354477,1272660.4407173384,1195305.4407173384,-1\n19990121 00:00,1255800,1258400,1232200,1235900,1241025.0,1278831.3420605592,1203218.6579394408,1273649.843188703,1195874.843188703,-1\n19990122 00:00,1221300,1238400,1217800,1225600,1242040.0,1276933.1167997357,1207146.8832002643,1272958.4692342235,1195138.4692342235,-1\n19990125 00:00,1232800,1240000,1219100,1236300,1242450.0,1276867.7570448744,1208032.2429551256,1272316.8293071545,1195351.8293071545,-1\n19990126 00:00,1241300,1257200,1236300,1255000,1243855.0,1277911.2167599397,1209798.7832400603,1274176.2979445683,1196476.2979445683,-1\n19990127 00:00,1263800,1266300,1244100,1244700,1244775.0,1277864.9909338157,1211685.0090661843,1276418.1981403236,1197353.1981403236,-1\n19990128 00:00,1252500,1269700,1251900,1266600,1245950.0,1280361.1900404505,1211538.8099595495,1279022.377682515,1199672.377682515,-1\n19990129 00:00,1273400,1283000,1254100,1278800,1248200.0,1284944.7955498463,1211455.2044501537,1283006.4766333865,1201901.4766333865,-1\n19990201 00:00,1286900,1286900,1270000,1270900,1250305.0,1287186.4574007047,1213423.5425992953,1286359.9867952862,1204924.9867952862,-1\n19990202 00:00,1270800,1272200,1247700,1262800,1252005.0,1287885.5504417086,1216124.4495582914,1287025.5832909732,1207165.5832909732,-1\n19990203 00:00,1256900,1279400,1256600,1271900,1253380.0,1290087.5795987695,1216672.4204012305,1289350.2896442139,1209070.2896442139,-1\n19990204 00:00,1273800,1275000,1248100,1248400,1252050.0,1287431.4358103229,1216668.5641896771,1289733.0398368284,1210203.0398368284,1\n19990205 00:00,1256600,1256600,1232200,1240000,1250580.0,1285394.3418722802,1215765.6581277198,1289603.0677888764,1208993.0677888764,1\n19990208 00:00,1250900,1250900,1233400,1243800,1249020.0,1282068.9092104414,1215971.0907895586,1288389.680380412,1208949.680380412,1\n19990209 00:00,1243800,1245000,1215600,1218600,1246810.0,1281735.5150284143,1211884.4849715857,1286621.2584394203,1206476.2584394203,1\n19990210 00:00,1221300,1230000,1213300,1226900,1246155.0,1282044.8578988549,1210265.1421011451,1283816.614778523,1204871.614778523,1\n19990211 00:00,1230600,1256900,1225000,1256900,1247345.0,1283002.0035196454,1211687.9964803546,1282829.7149583462,1206224.7149583462,-1\n19990212 00:00,1248100,1255000,1226300,1235000,1248515.0,1280777.7509676407,1216252.2490323593,1282326.0913115195,1205631.0913115195,1\n19990216 00:00,1247500,1256300,1233800,1243800,1248550.0,1280790.6885782545,1216309.3114217455,1281360.9476945493,1206720.9476945493,1\n19990217 00:00,1231900,1253600,1222500,1227500,1247285.0,1280722.5402803496,1213847.4597196504,1279810.4606125287,1206460.4606125287,-1\n19990218 00:00,1231900,1243800,1222200,1239400,1246440.0,1279777.570397376,1213102.429602624,1278485.8532526053,1206260.8532526053,-1\n19990219 00:00,1240000,1257500,1233800,1239400,1246615.0,1279765.6425277097,1213464.3574722903,1278412.0021491826,1206562.0021491826,-1\n19990222 00:00,1244400,1277200,1242800,1276900,1249180.0,1283352.4801558212,1215007.5198441788,1281906.4146429112,1207476.4146429112,-1\n19990223 00:00,1275900,1285000,1265900,1275000,1251115.0,1286511.8515549053,1215718.1484450947,1284686.5180102529,1210526.5180102529,-1\n19990224 00:00,1278400,1288400,1254100,1254100,1251070.0,1286449.2651139053,1215690.7348860947,1287398.833755308,1211228.833755308,1\n19990225 00:00,1245300,1252800,1225900,1247500,1251210.0,1286509.399428319,1215910.600571681,1287158.6273659137,1210088.6273659137,1\n19990226 00:00,1247500,1248400,1228100,1239100,1249835.0,1284769.8694000707,1214900.1305999293,1285845.1469818584,1209480.1469818584,1\n19990301 00:00,1236600,1243100,1208800,1237800,1247785.0,1280416.4127797128,1215153.5872202872,1284558.4663169195,1207383.4663169195,1\n19990302 00:00,1245000,1253100,1223100,1228100,1245645.0,1277537.4740338533,1213752.5259661467,1284473.8901597527,1205333.8901597527,1\n19990303 00:00,1230900,1235600,1217800,1231300,1244070.0,1275526.3888582273,1212613.6111417727,1282383.7180810461,1204248.7180810461,1\n19990304 00:00,1240600,1252300,1232700,1250000,1242975.0,1271903.178304207,1214046.821695793,1282409.0782638036,1204544.0782638036,1\n19990305 00:00,1275000,1281300,1259200,1278100,1244460.0,1277153.8159290103,1211766.1840709897,1285538.1343021716,1207013.1343021716,1\n19990308 00:00,1282800,1288000,1272500,1285200,1246720.0,1283820.2210236003,1209619.7789763997,1288263.4310352982,1211073.4310352982,-1\n19990309 00:00,1281300,1299400,1274400,1282500,1248655.0,1288851.8394279948,1208458.1605720052,1292232.1122065396,1213917.1122065396,-1\n19990310 00:00,1284700,1292200,1277800,1290300,1252240.0,1293840.2115379237,1210639.7884620763,1294315.8792979803,1218250.8792979803,-1\n19990311 00:00,1296900,1311900,1288800,1302200,1256005.0,1301222.849351777,1210787.150648223,1299051.4304759505,1222026.4304759505,-1\n19990312 00:00,1310000,1310300,1292200,1295300,1257925.0,1306283.7375765746,1209566.2624234254,1301704.7863036378,1226749.7863036378,-1\n19990315 00:00,1299400,1311900,1295000,1311600,1261755.0,1314204.80362213,1209305.19637787,1304671.5130048785,1231771.5130048785,-1\n19990316 00:00,1311300,1316600,1304700,1309800,1265055.0,1320774.0263734031,1209335.9736265969,1307890.337163144,1236580.337163144,-1\n19990317 00:00,1306900,1309400,1296300,1302500,1268805.0,1324002.0098827826,1213607.9901172174,1309474.9082269715,1240804.9082269715,-1\n19990318 00:00,1297800,1323400,1297500,1321600,1272915.0,1330912.1818280853,1214917.8181719147,1313514.2423640853,1244199.2423640853,-1\n19990319 00:00,1323100,1326300,1298400,1300600,1275975.0,1333026.3759693839,1218923.6240306161,1316646.0605516327,1246701.0605516327,-1\n19990322 00:00,1300600,1305900,1294200,1299100,1277085.0,1335022.1478414324,1219147.8521585676,1316408.5389117945,1250378.5389117945,-1\n19990323 00:00,1293100,1296300,1257000,1264100,1276540.0,1334749.7723754353,1218330.2276245647,1317092.8844122586,1247612.8844122586,-1\n19990324 00:00,1268400,1271600,1256300,1269400,1277305.0,1334711.6363759453,1219898.3636240547,1314088.2446269642,1247458.2446269642,-1\n19990325 00:00,1280600,1292500,1277500,1291300,1279495.0,1335511.4431216407,1223478.5568783593,1314308.2927577295,1248443.2927577295,-1\n19990326 00:00,1286300,1291300,1277200,1284700,1281775.0,1334653.3084071341,1228896.6915928659,1314131.3124950887,1249196.3124950887,-1\n19990329 00:00,1291600,1314400,1291600,1312200,1285495.0,1335884.8590988305,1235105.1409011695,1316110.3938447628,1251865.3938447628,-1\n19990330 00:00,1299400,1312200,1295600,1303400,1289260.0,1332707.8722148738,1245812.1277851262,1316985.9118912932,1254750.9118912932,-1\n19990331 00:00,1311600,1316100,1284400,1286300,1292010.0,1326467.9105576645,1257552.0894423355,1318955.2298064083,1254635.2298064083,-1\n19990401 00:00,1296900,1296900,1281300,1293800,1294200.0,1322762.8429957523,1265637.1570042477,1318918.938078814,1255408.938078814,-1\n19990405 00:00,1309400,1323800,1302500,1323800,1296485.0,1326789.1432810763,1266180.8567189237,1321634.3963570222,1258319.3963570222,-1\n19990406 00:00,1321900,1329800,1311600,1319400,1298195.0,1329598.7243014264,1266791.2756985736,1324721.636386512,1261001.636386512,-1\n19990407 00:00,1326900,1333800,1313800,1328800,1300510.0,1333718.7879935417,1267301.2120064583,1327451.8773655745,1264481.8773655745,-1\n19990408 00:00,1331900,1347800,1322800,1345300,1303260.0,1341377.6284676788,1265142.3715323212,1332310.349362504,1267750.349362504,-1\n19990409 00:00,1344400,1356900,1335900,1348800,1305590.0,1348552.6768253562,1262627.3231746438,1336645.1970422654,1272400.1970422654,-1\n19990412 00:00,1334700,1362500,1332200,1360600,1308855.0,1357713.9183261357,1259996.0816738643,1342059.6227207799,1275984.6227207799,-1\n19990413 00:00,1362500,1364700,1340300,1351900,1310870.0,1363215.2041738306,1258524.7958261694,1346743.8253188008,1279543.8253188008,-1\n19990414 00:00,1360600,1360600,1326900,1330300,1311895.0,1364914.750093715,1258875.249906285,1350866.7149709784,1280396.7149709784,-1\n19990415 00:00,1334400,1335600,1310000,1326300,1313085.0,1366275.9494181105,1259894.0505818895,1352568.0198943773,1280283.0198943773,-1\n19990416 00:00,1329100,1329100,1311900,1321300,1313070.0,1366251.5043036581,1259888.4956963419,1352328.9624441192,1281348.9624441192,-1\n19990419 00:00,1326900,1345300,1283800,1289100,1312495.0,1366446.477273565,1258543.522726435,1353823.0295129332,1277803.0295129332,-1\n19990420 00:00,1298100,1310300,1288800,1306300,1312855.0,1366539.5778599405,1259170.4221400595,1353223.4552736063,1275733.4552736063,-1\n19990421 00:00,1310600,1337800,1257800,1336900,1316495.0,1366186.6280675125,1266803.3719324875,1355718.8008031042,1272543.8008031042,-1\n19990422 00:00,1351300,1362500,1343900,1359700,1321010.0,1369150.0415454744,1272869.9584545256,1360418.4785043958,1275698.4785043958,-1\n19990423 00:00,1358800,1367500,1350000,1357500,1324320.0,1372934.878381006,1275705.121618994,1363834.1789642947,1279954.1789642947,-1\n19990426 00:00,1365000,1368100,1354700,1361300,1328150.0,1375734.5142877386,1280565.4857122614,1367540.9635073778,1283765.9635073778,-1\n19990427 00:00,1371300,1375000,1358400,1365600,1330820.0,1380472.6978119013,1281167.3021880987,1370432.7368241355,1288622.7368241355,-1\n19990428 00:00,1364400,1372500,1350000,1353400,1333320.0,1382227.978899153,1284412.021100847,1373647.1983964401,1290952.1983964401,-1\n19990429 00:00,1355600,1360600,1338100,1345600,1336285.0,1380384.9897959172,1292185.0102040828,1374461.9890253507,1293146.9890253507,-1\n19990430 00:00,1350900,1356300,1315000,1334700,1338330.0,1377922.7821704915,1298737.2178295085,1376535.0932451584,1291365.0932451584,-1\n19990503 00:00,1334400,1357200,1330300,1356300,1339955.0,1379696.4883968881,1300213.5116031119,1377634.330396413,1292929.330396413,-1\n19990504 00:00,1351300,1358100,1331300,1333100,1340640.0,1379400.8771830567,1301879.1228169433,1378808.044961834,1292813.044961834,-1\n19990505 00:00,1339400,1350000,1318400,1349700,1341685.0,1380239.0801991178,1303130.9198008822,1380016.7232194373,1292281.7232194373,-1\n19990506 00:00,1344400,1351300,1323800,1335000,1341170.0,1379792.278544902,1302547.721455098,1380256.6781509195,1292146.6781509195,1\n19990507 00:00,1345000,1349800,1334400,1346300,1341045.0,1379583.784360693,1302506.215639307,1380531.7564222605,1293261.7564222605,1\n19990510 00:00,1348400,1357200,1335300,1342200,1340125.0,1377616.8591163468,1302633.1408836532,1380663.9700963309,1294653.9700963309,1\n19990511 00:00,1353100,1368800,1257800,1357200,1340390.0,1378283.7936870933,1302496.2063129067,1386232.7189760453,1287232.7189760453,1\n19990512 00:00,1357500,1372200,1315000,1366300,1342190.0,1381393.1070197248,1302986.8929802752,1389369.8806608664,1286844.8806608664,1\n19990513 00:00,1372500,1380000,1368100,1370200,1344385.0,1384684.1947810375,1304085.8052189625,1391778.2650423711,1291038.2650423711,1\n19990514 00:00,1345600,1362500,1333100,1343000,1345470.0,1384368.7968965622,1306571.2031034378,1393727.1207526214,1290002.1207526214,1\n19990517 00:00,1336300,1344800,1323100,1343100,1348170.0,1377317.2880385122,1319022.7119614878,1390278.8235380861,1292523.8235380861,1\n19990518 00:00,1345300,1349800,1326300,1336300,1349670.0,1372432.3461005231,1326907.6538994769,1390054.0943122366,1291999.0943122366,1\n19990519 00:00,1344700,1348800,1332500,1348100,1350230.0,1372247.0025207791,1328212.9974792209,1385477.2361237695,1296977.2361237695,1\n19990520 00:00,1351300,1355900,1300600,1343100,1349400.0,1371176.6847798282,1327623.3152201718,1386940.2374453153,1293985.2374453153,1\n19990521 00:00,1341300,1346900,1195800,1334200,1348235.0,1370637.7029619196,1325832.2970380804,1392373.310069571,1279378.310069571,1\n19990524 00:00,1338400,1338400,1303900,1310900,1345715.0,1372568.6980693536,1318861.3019306464,1392227.9551423104,1276067.9551423104,1\n19990525 00:00,1313800,1323400,1286900,1288400,1341855.0,1377060.7083439603,1306649.2916560397,1390426.999097011,1271281.999097011,1\n19990526 00:00,1293100,1310000,1280900,1306600,1339515.0,1377455.283341061,1301574.716658939,1387904.110294121,1267769.110294121,1\n19990527 00:00,1298400,1302800,1280000,1284400,1336455.0,1381200.2556144225,1291709.7443855775,1384519.234710554,1263769.234710554,1\n19990528 00:00,1290000,1307500,1285900,1305900,1335015.0,1381704.925037421,1288325.074962579,1380832.561563517,1262812.561563517,-1\n19990601 00:00,1301300,1301600,1283800,1298800,1332140.0,1380291.6521004213,1283988.3478995787,1377892.6350654042,1260592.6350654042,-1\n19990602 00:00,1297500,1301900,1206300,1297800,1330375.0,1380791.1035781228,1279958.8964218772,1378235.8761702864,1250615.8761702864,-1\n19990603 00:00,1306900,1309100,1297800,1302800,1328030.0,1378992.4606941226,1277067.5393058774,1375647.4197096243,1251072.4197096243,-1\n19990604 00:00,1314700,1331900,1309400,1319400,1327250.0,1378239.3910534338,1276260.6089465662,1376422.0305309298,1251607.0305309298,-1\n19990607 00:00,1334400,1341900,1329100,1337500,1326810.0,1377283.513846373,1276336.486153627,1379064.2577819524,1253184.2577819524,1\n19990608 00:00,1333800,1338000,1315900,1321600,1325780.0,1375793.9020673253,1275766.0979326747,1379940.4395804966,1254030.4395804966,1\n19990609 00:00,1324100,1330900,1318100,1321600,1324000.0,1371903.736806224,1276096.263193776,1373199.0485093382,1262019.0485093382,1\n19990610 00:00,1314400,1315000,1295900,1309100,1321140.0,1365282.8771151134,1276997.1228848866,1369794.4169052741,1263339.4169052741,1\n19990611 00:00,1312200,1322200,1290900,1298100,1317535.0,1356540.14196872,1278529.85803128,1369892.1708508036,1260797.1708508036,1\n19990614 00:00,1306900,1307500,1295500,1297800,1315275.0,1353342.9852369416,1277207.0147630584,1366573.6704523144,1261243.6704523144,1\n19990615 00:00,1304700,1316600,1300800,1305900,1313415.0,1349443.6705277893,1277386.3294722107,1365771.2177108242,1260876.2177108242,1\n19990616 00:00,1323800,1338800,1321600,1334800,1313340.0,1349183.571250644,1277496.428749356,1368229.5144367774,1261924.5144367774,1\n19990617 00:00,1328800,1355600,1326300,1346600,1313265.0,1348822.4619454201,1277707.5380545799,1371847.9733793065,1263592.9733793065,1\n19990618 00:00,1340600,1346900,1333800,1343100,1313265.0,1348822.4619454201,1277707.5380545799,1370925.4679781026,1269000.4679781026,1\n19990621 00:00,1344700,1350000,1336600,1349400,1314025.0,1351913.1973706852,1276136.8026293148,1363014.1932500293,1281744.1932500293,-1\n19990622 00:00,1340000,1351900,1333400,1337000,1315330.0,1354474.8642863913,1276185.1357136087,1363565.381194471,1284695.381194471,-1\n19990623 00:00,1330000,1336300,1321300,1332800,1317550.0,1355346.8517207452,1279753.1482792548,1362577.0909219817,1286827.0909219817,-1\n19990624 00:00,1328800,1338100,1306600,1316900,1318065.0,1355530.251900928,1280599.748099072,1362360.0663897295,1286250.0663897295,-1\n19990625 00:00,1325900,1330200,1312500,1316600,1319675.0,1353836.9598383934,1285513.0401616066,1361260.3378446759,1286485.3378446759,-1\n19990628 00:00,1326900,1336300,1324700,1333800,1321070.0,1355146.5080370628,1286993.4919629372,1361741.2580499449,1287476.2580499449,-1\n19990629 00:00,1330000,1351300,1327800,1351300,1323695.0,1358583.7646671531,1288806.2353328469,1363642.2493467755,1289167.2493467755,-1\n19990630 00:00,1346300,1375000,1338400,1367500,1327180.0,1364840.4620258436,1289519.5379741564,1362445.3684566063,1296820.3684566063,-1\n19990701 00:00,1370000,1385000,1360600,1380600,1331070.0,1373609.9153736816,1288530.0846263184,1367786.6428893104,1300196.6428893104,-1\n19990702 00:00,1381300,1393000,1379100,1391900,1334695.0,1384393.1076098478,1284996.8923901522,1371790.2959474714,1306480.2959474714,-1\n19990706 00:00,1392500,1407500,1385900,1387200,1337180.0,1391906.4323704734,1282453.5676295266,1376903.5614127915,1311728.5614127915,-1\n19990707 00:00,1390600,1397200,1385200,1395600,1340880.0,1400665.0683699534,1281094.9316300466,1380750.8809607795,1317090.8809607795,-1\n19990708 00:00,1390600,1406300,1387500,1395600,1344580.0,1408172.5027027559,1280987.4972972441,1385729.051028007,1321169.051028007,-1\n19990709 00:00,1400000,1404700,1393800,1402200,1349235.0,1415337.7767949274,1283132.2232050726,1389074.6969618476,1326734.6969618476,-1\n19990712 00:00,1409400,1409400,1395000,1400600,1354360.0,1419699.341900573,1289020.658099427,1391975.0036004018,1332170.0036004018,-1\n19990713 00:00,1393800,1399200,1386600,1395000,1359220.0,1421391.2666752094,1297048.7333247906,1395127.6223051255,1335022.6223051255,-1\n19990714 00:00,1400000,1402200,1387500,1398400,1363845.0,1423158.6906624432,1304531.3093375568,1397768.523355431,1338278.523355431,-1\n19990715 00:00,1407800,1488800,1403100,1411300,1367670.0,1428835.876107516,1306504.123892484,1408402.5925596757,1340287.5925596757,-1\n19990716 00:00,1412500,1421600,1407500,1420000,1371340.0,1435731.657844786,1306948.342155214,1411264.647236532,1345429.647236532,-1\n19990719 00:00,1421900,1422500,1405600,1410000,1374685.0,1439807.5698203011,1309562.4301796989,1414821.3474997196,1348416.3474997196,-1\n19990720 00:00,1401300,1404100,1375300,1378000,1376115.0,1440201.6686604945,1312028.3313395055,1416817.0524997462,1347217.0524997462,-1\n19990721 00:00,1380900,1389100,1370000,1378800,1378205.0,1439727.954252864,1316682.045747136,1416603.2855950084,1346913.2855950084,-1\n19990722 00:00,1374400,1380000,1354700,1361400,1379635.0,1438124.7691908593,1321145.2308091407,1415762.1790304044,1344632.1790304044,-1\n19990723 00:00,1366600,1370000,1351300,1357500,1381665.0,1433774.7409319985,1329555.2590680015,1412840.5429322706,1343630.5429322706,-1\n19990726 00:00,1348800,1361300,1346300,1350000,1383335.0,1428701.4314223635,1337968.5685776365,1410190.2134466574,1341385.2134466574,-1\n19990727 00:00,1360000,1372000,1353800,1365000,1384895.0,1425204.6750172959,1344585.3249827041,1409201.97883269,1340051.97883269,-1\n19990728 00:00,1362500,1373100,1355900,1367300,1385695.0,1423885.3377832666,1347504.6622167334,1407853.893547037,1339648.893547037,-1\n19990729 00:00,1349400,1352500,1333100,1343800,1384510.0,1426195.8681089887,1342824.1318910113,1404757.8878123984,1336912.8878123984,-1\n19990730 00:00,1348100,1353400,1328800,1330900,1382025.0,1429824.1579423738,1334225.8420576262,1401617.13659217,1333742.13659217,-1\n19990802 00:00,1327500,1347500,1325000,1329400,1378900.0,1431626.3880803532,1326173.6119196468,1399051.377551646,1329886.377551646,-1\n19990803 00:00,1337200,1338400,1313800,1323600,1375720.0,1433490.7746183136,1317949.2253816864,1395542.8336578384,1325927.8336578384,-1\n19990804 00:00,1327200,1338800,1305300,1306900,1371285.0,1435526.5838845838,1307043.4161154162,1392990.0637856633,1320150.0637856633,-1\n19990805 00:00,1308800,1317200,1288400,1315600,1367285.0,1434849.051832317,1299720.948167683,1389025.4545362352,1314685.4545362352,-1\n19990806 00:00,1312200,1320000,1295000,1300600,1362205.0,1433669.969740426,1290740.030259574,1385639.5779137367,1309184.5779137367,-1\n19990809 00:00,1305900,1318000,1297200,1300500,1357200.0,1431184.511892693,1283215.488107307,1382102.554620365,1304687.554620365,-1\n19990810 00:00,1298800,1301600,1270000,1282200,1351560.0,1430209.2314012032,1272910.7685987968,1377823.0256089016,1297768.0256089016,-1\n19990811 00:00,1296900,1305300,1286300,1305300,1346905.0,1424932.0844002261,1268877.9155997739,1374755.0390429746,1293440.0390429746,-1\n19990812 00:00,1306900,1318100,1300000,1300200,1341350.0,1415993.968276077,1266706.031723923,1366666.1067531675,1296196.1067531675,-1\n19990813 00:00,1316300,1332500,1311300,1331900,1336945.0,1402326.969226997,1271563.030773003,1367440.842617945,1294240.842617945,-1\n19990816 00:00,1331300,1339700,1322500,1333800,1333135.0,1389271.5219799017,1276998.4780200983,1367573.738559093,1294328.738559093,-1\n19990817 00:00,1344400,1351600,1331300,1347000,1331585.0,1384287.6858898103,1278882.3141101897,1367669.8110772746,1296584.8110772746,-1\n19990818 00:00,1342000,1343800,1334100,1335600,1329425.0,1377552.7830364127,1281297.2169635873,1367748.2417683278,1297593.2417683278,-1\n19990819 00:00,1323800,1332300,1316900,1328800,1327795.0,1373634.4360785559,1281955.5639214441,1366617.933028487,1297452.933028487,-1\n19990820 00:00,1330600,1339100,1326900,1338800,1326860.0,1370967.8405728505,1282752.1594271495,1366406.4235337104,1298216.4235337104,-1\n19990823 00:00,1348100,1364500,1346600,1363900,1327555.0,1373499.2042046655,1281610.7957953345,1369687.2006574841,1299892.2006574841,-1\n19990824 00:00,1360600,1379700,1353800,1365000,1327555.0,1373499.2042046655,1281610.7957953345,1372967.983134549,1302587.983134549,-1\n19990825 00:00,1371900,1387800,1279100,1384400,1328410.0,1377788.9793333155,1279031.0206666845,1381035.7545820524,1296930.7545820524,-1\n19990826 00:00,1382800,1384200,1365000,1365000,1329470.0,1380988.7771594007,1277951.2228405993,1383013.063669476,1301128.063669476,-1\n19990827 00:00,1368800,1370600,1351300,1351600,1330505.0,1382921.008050976,1278088.991949024,1384116.7798279386,1303026.7798279386,-1\n19990830 00:00,1353400,1355000,1323900,1326600,1330365.0,1382807.0165516164,1277922.9834483836,1383961.2928601985,1301581.2928601985,-1\n19990831 00:00,1329400,1337500,1307500,1325000,1330435.0,1382844.437127296,1278025.562872704,1382515.0586195446,1299325.0586195446,-1\n19990901 00:00,1329400,1335600,1323100,1335600,1331870.0,1383183.4329391436,1280556.5670608564,1380036.5609732387,1299996.5609732387,-1\n19990902 00:00,1321300,1326700,1306600,1322500,1332215.0,1383177.8207618063,1281252.1792381937,1378011.8884995969,1297941.8884995969,-1\n19990903 00:00,1348800,1362800,1346900,1361900,1335280.0,1385638.4193556549,1284921.5806443451,1380990.1610234447,1298625.1610234447,-1\n19990907 00:00,1360600,1366300,1342800,1355200,1338015.0,1386424.514560673,1289605.485439327,1382617.3282275612,1299847.3282275612,-1\n19990908 00:00,1348400,1360600,1335000,1349100,1341360.0,1382593.9374787323,1300126.0625212677,1382834.090618587,1300964.090618587,-1\n19990909 00:00,1347500,1352500,1336900,1351300,1343660.0,1381591.16924114,1305728.83075886,1382747.8677025312,1302002.8677025312,1\n19990910 00:00,1362500,1363600,1349400,1354500,1346375.0,1378856.3100105275,1313893.6899894725,1383737.0787149884,1303577.0787149884,1\n19990913 00:00,1351300,1354700,1345000,1348100,1347185.0,1378982.8159627356,1315387.1840372644,1382576.325186577,1305806.325186577,1\n19990914 00:00,1340600,1345600,1333800,1340600,1347525.0,1378885.4767183154,1316164.5232816846,1381959.6513592838,1305624.6513592838,1\n19990915 00:00,1354400,1354400,1320600,1320800,1346215.0,1379672.5118620617,1312757.4881379383,1381842.740118717,1303482.740118717,1\n19990916 00:00,1325000,1328100,1303100,1323800,1345625.0,1380207.7052151794,1311042.2947848206,1380433.1537582043,1300258.1537582043,1\n19990917 00:00,1326300,1339400,1321600,1337200,1346045.0,1379998.4666860397,1312091.5333139603,1379640.6708605976,1299600.6708605976,-1\n19990920 00:00,1339400,1340000,1330900,1336300,1345920.0,1379997.4177425462,1311842.5822574538,1379037.9482389535,1299462.9482389535,-1\n19990921 00:00,1322500,1324700,1301600,1309100,1343180.0,1379754.942241923,1306605.057758077,1377098.6198352436,1296173.6198352436,-1\n19990922 00:00,1312500,1318400,1297500,1311600,1340510.0,1378105.845515163,1302914.154484837,1374107.4814382363,1293932.4814382363,-1\n19990923 00:00,1318100,1342500,1237800,1280000,1335290.0,1375928.400559077,1294651.599440923,1369307.1657457058,1289732.1657457058,-1\n19990924 00:00,1277500,1283800,1263100,1280600,1331070.0,1375812.6910232275,1286327.3089767725,1364291.6817064323,1284521.6817064323,-1\n19990927 00:00,1287500,1297500,1282800,1282800,1327630.0,1375965.0431881465,1279294.9568118535,1360615.8072582006,1281205.8072582006,-1\n19990928 00:00,1279400,1288100,1255600,1281900,1325395.0,1377685.8204181192,1273104.1795818808,1356367.3970431339,1276747.3970431339,-1\n19990929 00:00,1284400,1291300,1267800,1267800,1322535.0,1380543.7674407929,1264526.2325592071,1351982.36716601,1273337.36716601,-1\n19990930 00:00,1274400,1294400,1269700,1283800,1319945.0,1379979.3726543386,1259910.6273456614,1350180.1972771836,1269420.1972771836,-1\n19991001 00:00,1279400,1285600,1266300,1283400,1317990.0,1380075.7439353028,1255904.2560646972,1346465.3769015789,1267160.3769015789,-1\n19991004 00:00,1291900,1306300,1287500,1306300,1315210.0,1374077.9845077102,1256342.0154922898,1344514.7060855555,1267819.7060855555,-1\n19991005 00:00,1307200,1319700,1286900,1301900,1312545.0,1368693.2136848539,1256396.7863151461,1344894.6943948676,1266804.6943948676,-1\n19991006 00:00,1307500,1328100,1306900,1326300,1311405.0,1365423.6069794474,1257386.3930205526,1346328.6123890071,1268148.6123890071,-1\n19991007 00:00,1328600,1330000,1315000,1320000,1309840.0,1360875.9246021858,1258804.0753978142,1347657.7127964033,1269567.7127964033,-1\n19991008 00:00,1317500,1338800,1312300,1337200,1308975.0,1357477.4071567587,1260472.5928432413,1350563.1290380156,1270628.1290380156,-1\n19991011 00:00,1335900,1341300,1333100,1338100,1308475.0,1355538.611208661,1261411.388791339,1353012.950082014,1273302.950082014,-1\n19991012 00:00,1331300,1333100,1311900,1314100,1307150.0,1351959.44096951,1262340.55903049,1354528.5024551556,1273033.5024551556,-1\n19991013 00:00,1306900,1313100,1282500,1286600,1305440.0,1350643.8228471885,1260236.1771528115,1352485.9466657757,1271320.9466657757,-1\n19991014 00:00,1284800,1291900,1267500,1284100,1303455.0,1348746.1238544595,1258163.8761455405,1349513.6342849082,1268438.6342849082,-1\n19991015 00:00,1260000,1267500,1245000,1248100,1299000.0,1347548.8207889749,1250451.1792110251,1345830.8675276153,1261560.8675276153,-1\n19991018 00:00,1249400,1257500,1234400,1255600,1294965.0,1343855.869290697,1246074.130709303,1341687.610302763,1255317.610302763,-1\n19991019 00:00,1271900,1282500,1259400,1260800,1292550.0,1343151.165994471,1241948.834005529,1338156.3299564682,1252956.3299564682,-1\n19991020 00:00,1277500,1292500,1271300,1292200,1291580.0,1341421.3322454367,1241738.6677545633,1337992.7112304554,1251172.7112304554,-1\n19991021 00:00,1272200,1288800,1266300,1286300,1291895.0,1341518.7634606648,1242271.2365393352,1330738.3260339042,1255738.3260339042,-1\n19991022 00:00,1297500,1312200,1295600,1303400,1293035.0,1342616.0155200555,1243453.9844799445,1332127.8505386116,1256347.8505386116,-1\n19991025 00:00,1293100,1304700,1287500,1295000,1293645.0,1343007.0289291274,1244282.9710708726,1332292.7774714422,1256467.7774714422,-1\n19991026 00:00,1301900,1306900,1281900,1282500,1293675.0,1343009.1615921464,1244340.8384078536,1331354.3780297176,1256654.3780297176,-1\n19991027 00:00,1283800,1303100,1282500,1301300,1295350.0,1343312.0891955302,1247387.9108044698,1331292.016630062,1257027.016630062,-1\n19991028 00:00,1324400,1345000,1321900,1345000,1298410.0,1350652.2396150855,1246167.7603849145,1336683.1340938655,1259853.1340938655,-1\n19991029 00:00,1358400,1376900,1357200,1365600,1302520.0,1361845.5627870483,1243194.4372129517,1344132.7562436562,1265412.7562436562,-1\n19991101 00:00,1365000,1370000,1356300,1359400,1305175.0,1369483.129346141,1240866.870653859,1348883.4461252128,1271543.4461252128,-1\n19991102 00:00,1359700,1372500,1347500,1348100,1307485.0,1374421.9636299706,1240548.0363700294,1352662.2449069386,1276492.2449069386,-1\n19991103 00:00,1360000,1363800,1351300,1356900,1309015.0,1378934.676057602,1239095.323942398,1355946.7533285,1281351.7533285,-1\n19991104 00:00,1367500,1373600,1357700,1364700,1311250.0,1385174.3532267953,1237325.6467732047,1360520.3561861033,1285670.3561861033,-1\n19991105 00:00,1386300,1391100,1367800,1372200,1313000.0,1390851.5253543565,1235148.4746456435,1365649.8063906014,1290814.8063906014,-1\n19991108 00:00,1370000,1383800,1367500,1379400,1315065.0,1397524.6452817982,1232605.3547182018,1370892.3248295917,1294842.3248295917,-1\n19991109 00:00,1385000,1386900,1362800,1367200,1317720.0,1403246.7350014017,1232193.2649985983,1374490.317702964,1298755.317702964,-1\n19991110 00:00,1362500,1383900,1360800,1377500,1322265.0,1410317.4451676386,1234212.5548323614,1377418.89855665,1302958.89855665,-1\n19991111 00:00,1381900,1385600,1374700,1383800,1327250.0,1417360.099322995,1237139.900677005,1380328.090757604,1307893.090757604,-1\n19991112 00:00,1392500,1399700,1371300,1397500,1334720.0,1422073.845937085,1247366.154062915,1383848.3916378322,1313018.3916378322,-1\n19991115 00:00,1398400,1402500,1394100,1398100,1341845.0,1425385.6601601879,1258304.3398398121,1387488.74322788,1318863.74322788,-1\n19991116 00:00,1405600,1426300,1400900,1424400,1350025.0,1432249.0810225327,1267800.9189774673,1393683.7438728437,1324863.7438728437,-1\n19991117 00:00,1422500,1429400,1413100,1415600,1356195.0,1438655.8628380762,1273734.1371619238,1398251.8793770173,1331741.8793770173,-1\n19991118 00:00,1424400,1430000,1416300,1428100,1363285.0,1444867.6274399152,1281702.3725600848,1403084.9146744441,1338299.9146744441,-1\n19991119 00:00,1424100,1429700,1420000,1425000,1369365.0,1450311.6805990215,1288418.3194009785,1407032.5418483065,1344677.5418483065,-1\n19991122 00:00,1424400,1430000,1415000,1424700,1375850.0,1452599.6319209414,1299100.3680790586,1411379.7600849757,1349354.7600849757,-1\n19991123 00:00,1428400,1428400,1400600,1408800,1382165.0,1447013.1695963733,1317316.8304036267,1414659.5448387875,1352214.5448387875,-1\n19991124 00:00,1407500,1424400,1400000,1420600,1388130.0,1443362.0595306747,1332897.9404693253,1417950.5405684267,1354935.5405684267,-1\n19991126 00:00,1424700,1428800,1412500,1414400,1391600.0,1444215.587044145,1338984.412955855,1418954.933530164,1360049.933530164,-1\n19991129 00:00,1408800,1419200,1404400,1410000,1393820.0,1445600.2896863276,1342039.7103136724,1419738.8684320531,1363398.8684320531,-1\n19991130 00:00,1407500,1423100,1390000,1392500,1395475.0,1444806.972391138,1346143.027608862,1422174.611121064,1362924.611121064,-1\n19991201 00:00,1393100,1405000,1390000,1401300,1398135.0,1442443.5668917422,1353826.4331082578,1422016.7116492167,1364266.7116492167,-1\n19991202 00:00,1406300,1413600,1403800,1411300,1400855.0,1441206.6282199367,1360503.3717800633,1423325.99307945,1366085.99307945,-1\n19991203 00:00,1430300,1454100,1430300,1436900,1404465.0,1444145.4372455748,1364784.5627544252,1429638.4778655341,1368483.4778655341,-1\n19991206 00:00,1435300,1437200,1422500,1427500,1407230.0,1445201.9949436423,1369258.0050563577,1431618.662513261,1372218.662513261,-1\n19991207 00:00,1432800,1433100,1413800,1419400,1409230.0,1445293.7269288686,1373166.2730711314,1433765.6946548552,1373915.6946548552,-1\n19991208 00:00,1413400,1420600,1406300,1406300,1411185.0,1441741.784843959,1380628.215156041,1433718.8824655039,1375338.8824655039,-1\n19991209 00:00,1418100,1422200,1393800,1410000,1412810.0,1439201.2788625334,1386418.7211374666,1434510.457151329,1375335.457151329,-1\n19991210 00:00,1422800,1428100,1408800,1420000,1414620.0,1437542.0068929403,1391697.9931070597,1436477.9532956467,1376042.9532956467,-1\n19991213 00:00,1414400,1427200,1412800,1421300,1415810.0,1437490.8579166047,1394129.1420833953,1436777.751394474,1378442.751394474,-1\n19991214 00:00,1416300,1424800,1406300,1408100,1416310.0,1436760.4180886357,1395859.5819113643,1438054.9099918257,1378204.9099918257,1\n19991215 00:00,1403800,1422000,1400000,1418000,1415990.0,1436121.8553541396,1395858.1446458604,1438085.4741195883,1379165.4741195883,1\n19991216 00:00,1421900,1426600,1411600,1423800,1416400.0,1436815.3863544143,1395984.6136455857,1439134.754362167,1380409.754362167,1\n19991217 00:00,1430000,1433100,1420600,1423800,1416185.0,1436189.4270100396,1396180.5729899604,1440521.8809308496,1382081.8809308496,1\n19991220 00:00,1425600,1431900,1410900,1416900,1415780.0,1435378.0203081842,1396181.9796918158,1442188.2494136258,1382053.2494136258,1\n19991221 00:00,1415900,1440600,1413400,1433400,1416215.0,1436939.5048191748,1395490.4951808252,1444723.495501217,1382758.495501217,1\n19991222 00:00,1436300,1441900,1429700,1437500,1417650.0,1440030.3932047675,1395269.6067952325,1445708.321326498,1386083.321326498,1\n19991223 00:00,1450200,1464400,1449700,1460900,1419665.0,1448939.7860794917,1390390.2139205083,1449937.4891366728,1389937.4891366728,1\n19991227 00:00,1465000,1467800,1450600,1458100,1421850.0,1455433.061206507,1388266.938793493,1453709.3552506405,1393574.3552506405,-1\n19991228 00:00,1458800,1465000,1454800,1461400,1424420.0,1461651.148249819,1387188.851750181,1456865.1309410557,1397420.1309410557,-1\n19991229 00:00,1463100,1468100,1452500,1463400,1427965.0,1465859.6051569348,1390070.3948430652,1458808.8883117489,1401988.8883117489,-1\n19991230 00:00,1471300,1478800,1461900,1466300,1431215.0,1470527.353020393,1391902.646979607,1462627.6846630108,1405522.6846630108,-1\n19991231 00:00,1468400,1475000,1462500,1468800,1434090.0,1475509.8454849846,1392670.1545150154,1465946.6353300256,1408811.6353300256,-1\n20000103 00:00,1482500,1482500,1438800,1455600,1435025.0,1477487.495216367,1392562.504783633,1468070.09069542,1410800.09069542,-1\n20000104 00:00,1435300,1440600,1396400,1400600,1433680.0,1478641.2989136213,1388718.7010863787,1468845.5185656976,1404900.5185656976,-1\n20000105 00:00,1399400,1415300,1372500,1402800,1432850.0,1479419.2387741092,1386280.7612258908,1466797.889813409,1399327.889813409,-1\n20000106 00:00,1396300,1415000,1392500,1403400,1432705.0,1479620.7745326664,1385789.2254673336,1464610.0749105446,1395910.0749105446,-1\n20000107 00:00,1403100,1444400,1400600,1444400,1434425.0,1480397.8996257577,1388452.1003742423,1465721.2582523974,1394711.2582523974,-1\n20000110 00:00,1462500,1469100,1450300,1458100,1436330.0,1482907.638411581,1389752.361588419,1468883.4400061374,1397063.4400061374,-1\n20000111 00:00,1458100,1460900,1435000,1440900,1437310.0,1483403.726254231,1391216.273745769,1470948.4695293624,1397403.4695293624,-1\n20000112 00:00,1445900,1446300,1428800,1433400,1438575.0,1482741.0899333414,1394408.9100666586,1471063.0597329151,1397668.0597329151,-1\n20000113 00:00,1444700,1457500,1432800,1451300,1440240.0,1483682.7623431107,1396797.2376568893,1472487.8873773995,1398687.8873773995,-1\n20000114 00:00,1465300,1474700,1459700,1465000,1442300.0,1486332.442584985,1398267.557415015,1476058.7235001868,1400998.7235001868,-1\n20000118 00:00,1453400,1466300,1451900,1456300,1443925.0,1487503.016246727,1400346.983753273,1478071.5038017563,1402726.5038017563,-1\n20000119 00:00,1453100,1464700,1450000,1456900,1445925.0,1488004.0149599537,1403845.9850400463,1479199.0986777795,1404799.0986777795,-1\n20000120 00:00,1469700,1469700,1438100,1445000,1446505.0,1488195.4533436613,1404814.5466563387,1480379.9781687846,1405319.9781687846,-1\n20000121 00:00,1455000,1455000,1440900,1441300,1446695.0,1488253.993009937,1405136.006990063,1480797.0834225512,1405452.0834225512,-1\n20000124 00:00,1456600,1458400,1394100,1400600,1443680.0,1489236.3650876582,1398123.6349123418,1481180.6945251653,1400225.6945251653,-1\n20000125 00:00,1405200,1420000,1390000,1410000,1441275.0,1488577.5105042006,1393972.4894957994,1478899.1204434035,1396024.1204434035,-1\n20000126 00:00,1410000,1415500,1400900,1406700,1438540.0,1487178.355235349,1389901.644764651,1476394.6804011746,1392859.6804011746,-1\n20000127 00:00,1418400,1422200,1381300,1400000,1435370.0,1485359.5629106716,1385380.4370893284,1475105.464807412,1387775.464807412,-1\n20000128 00:00,1394400,1400600,1355300,1364700,1430290.0,1486887.2402154028,1373692.7597845972,1471720.4999051187,1380130.4999051187,-1\n20000131 00:00,1358100,1394400,1350000,1394400,1426570.0,1482327.5860309608,1370812.4139690392,1469701.0475332027,1373326.0475332027,-1\n20000201 00:00,1397500,1416900,1385300,1401900,1423885.0,1478959.9044483965,1368810.0955516035,1466874.796974485,1372314.796974485,-1\n20000202 00:00,1412800,1422500,1403800,1413000,1424505.0,1478790.9641159666,1370219.0358840334,1463361.244881677,1374591.244881677,-1\n20000203 00:00,1408800,1429700,1400000,1428400,1425785.0,1479163.1331633094,1372406.8668366906,1462415.927908819,1375610.927908819,-1\n20000204 00:00,1431900,1440000,1421300,1427800,1427005.0,1479386.9234087486,1374623.0765912514,1463148.6966794075,1376913.6966794075,-1\n20000207 00:00,1425600,1427800,1414400,1427200,1426145.0,1477917.559334072,1374372.440665928,1461164.1382654957,1379489.1382654957,-1\n20000208 00:00,1439700,1445600,1436300,1442800,1425380.0,1475672.2498999597,1375087.7501000403,1462714.4981132261,1381984.4981132261,-1\n20000209 00:00,1444700,1444700,1413800,1414100,1424040.0,1474034.0156418746,1374045.9843581254,1463265.736388157,1381785.736388157,-1\n20000210 00:00,1416300,1425600,1408800,1418800,1423310.0,1473162.1774850406,1373457.8225149594,1462756.8170496023,1381381.8170496023,-1\n20000211 00:00,1418400,1419400,1380300,1391300,1420310.0,1470284.7896443796,1370335.2103556204,1461449.2630448781,1377914.2630448781,-1\n20000214 00:00,1397800,1397800,1383100,1392500,1416685.0,1463590.8322599654,1369779.1677400346,1458077.864977112,1375847.864977112,-1\n20000215 00:00,1392500,1412200,1378000,1407500,1414245.0,1457596.4232753667,1370893.5767246333,1457874.338153895,1372674.338153895,-1\n20000216 00:00,1403800,1409400,1388000,1390900,1410945.0,1450705.4564863131,1371184.5435136869,1456550.7107106668,1370345.7107106668,1\n20000217 00:00,1404400,1404400,1382200,1390600,1408225.0,1445670.099812926,1370779.900187074,1453841.1192144128,1369046.1192144128,1\n20000218 00:00,1388800,1388800,1346300,1351900,1403755.0,1445443.3904702496,1362066.6095297504,1451428.9491305004,1362103.9491305004,-1\n20000222 00:00,1351900,1441900,1333400,1354200,1401435.0,1448398.1887758912,1354471.8112241088,1451861.4301656908,1355906.4301656908,-1\n20000223 00:00,1356300,1374700,1345000,1365200,1399195.0,1448524.4425267507,1349865.5574732493,1447815.0638007044,1351905.0638007044,-1\n20000224 00:00,1366900,1370300,1330900,1356900,1396705.0,1449194.064575395,1344215.935424605,1445183.6291530184,1345553.6291530184,-1\n20000225 00:00,1351900,1375300,1331300,1337500,1393580.0,1452017.2689300245,1335142.7310699755,1440908.0057416197,1340813.0057416197,-1\n20000228 00:00,1333800,1366900,1327200,1350600,1392875.0,1453004.6224834316,1332745.3775165684,1436428.2750360686,1337173.2750360686,-1\n20000229 00:00,1360600,1374400,1357500,1369100,1391610.0,1452616.1931282391,1330603.8068717609,1432997.4869373955,1336832.4869373955,-1\n20000301 00:00,1376300,1390000,1372200,1383100,1390670.0,1451592.3144668683,1329747.6855331317,1431895.1469116118,1337335.1469116118,-1\n20000302 00:00,1386900,1391300,1373400,1387200,1389380.0,1449442.9203419215,1329317.0796580785,1431630.8868882838,1337475.8868882838,-1\n20000303 00:00,1404400,1417200,1397200,1413100,1388615.0,1447037.8474143464,1330192.1525856536,1433997.5087719392,1339797.5087719392,-1\n20000306 00:00,1408100,1413400,1387500,1393900,1386920.0,1442599.7126429367,1331240.2873570633,1435620.2857142943,1340340.2857142943,-1\n20000307 00:00,1400000,1401600,1352200,1359400,1383530.0,1437207.1497007804,1329852.8502992196,1436709.4648526155,1336029.4648526155,-1\n20000308 00:00,1364700,1378400,1350300,1370500,1379915.0,1426394.3836017647,1333435.6163982353,1435535.1110571283,1333400.1110571283,1\n20000309 00:00,1372500,1405900,1361300,1405900,1379505.0,1424903.0385038825,1334106.9614961175,1437187.9179405763,1332997.9179405763,1\n20000310 00:00,1401900,1420000,1395300,1400000,1378565.0,1421374.31090312,1335755.68909688,1439685.854327188,1334310.854327188,1\n20000313 00:00,1366900,1404700,1356900,1388800,1378440.0,1421114.2264136095,1335765.7735863905,1440002.0031214242,1333322.0031214242,1\n20000314 00:00,1392800,1400900,1361600,1365000,1377065.0,1419610.4709693054,1334519.5290306946,1440815.701236844,1330445.701236844,1\n20000315 00:00,1368800,1404400,1325000,1395000,1376440.0,1417520.7692235673,1335359.2307764327,1443174.2058809542,1326024.2058809542,1\n20000316 00:00,1416300,1466900,1408800,1463100,1380050.0,1435688.781438849,1324411.218561151,1452834.7973843555,1328109.7973843555,-1\n20000317 00:00,1458100,1480000,1454400,1466900,1383865.0,1451124.0596128134,1316605.9403871866,1460387.6738239406,1335152.6738239406,-1\n20000320 00:00,1468800,1473400,1447800,1459800,1389260.0,1462446.2664712444,1316073.7335287556,1464943.5699676923,1342513.5699676923,-1\n20000321 00:00,1455300,1497200,1445000,1497200,1396410.0,1481475.313730098,1311344.686269902,1467965.9680660074,1353980.9680660074,-1\n20000322 00:00,1495600,1508400,1486900,1500000,1403150.0,1498048.6933524376,1308251.3066475624,1475680.4790438479,1362925.4790438479,-1\n20000323 00:00,1491600,1534700,1491600,1526300,1411620.0,1518035.0853967613,1305204.9146032387,1485313.2508809417,1372003.2508809417,-1\n20000324 00:00,1528800,1557500,1517200,1532800,1421385.0,1534437.7005427114,1308332.2994572886,1495242.9015906933,1382487.9015906933,-1\n20000327 00:00,1533800,1537800,1520000,1525000,1430105.0,1546817.766653867,1313392.233346133,1502051.315724913,1392581.315724913,-1\n20000328 00:00,1512500,1529800,1507500,1510000,1437150.0,1555284.0848358339,1319015.9151641661,1508457.8967669848,1399212.8967669848,-1\n20000329 00:00,1515600,1524800,1496600,1510300,1443510.0,1563007.9815729118,1324012.0184270882,1514408.3748526687,1404068.3748526687,-1\n20000330 00:00,1501600,1519400,1471300,1488800,1448590.0,1566711.1903089364,1330468.8096910636,1519904.6407397161,1405034.6407397161,-1\n20000331 00:00,1496300,1523100,1484400,1505600,1453215.0,1572651.9000769863,1333778.0999230137,1524547.33368514,1408372.33368514,-1\n20000403 00:00,1501300,1510300,1486900,1507700,1458905.0,1577335.308198535,1340474.691801465,1527709.6907944917,1411909.6907944917,-1\n20000404 00:00,1517500,1530000,1413900,1500000,1465935.0,1576323.2471099165,1355546.7528900835,1533806.505956921,1408001.505956921,-1\n20000405 00:00,1478800,1508100,1476300,1488800,1471850.0,1573479.769260783,1370220.230739217,1536004.2593578491,1409644.2593578491,-1\n20000406 00:00,1502500,1516900,1490000,1503100,1476710.0,1574483.0208186286,1378936.9791813714,1537672.3854507525,1413787.3854507525,-1\n20000407 00:00,1515600,1521300,1505000,1517800,1482600.0,1575236.8609140012,1389963.1390859988,1540896.3249316332,1417986.3249316332,-1\n20000410 00:00,1517500,1531100,1503100,1507800,1488550.0,1571056.351270675,1406043.648729325,1542702.6273190966,1422762.6273190966,-1\n20000411 00:00,1500000,1516300,1483800,1500600,1495330.0,1555326.2032132035,1435333.7967867965,1543859.3612252143,1424939.3612252143,-1\n20000412 00:00,1503800,1511600,1465600,1466300,1498895.0,1540174.94549415,1457615.05450585,1541046.4855529717,1427136.4855529717,1\n20000413 00:00,1474700,1481600,1437800,1440000,1497740.0,1543958.6715516576,1451521.3284483424,1535990.5901034824,1426295.5901034824,-1\n20000414 00:00,1426300,1428100,1335000,1358100,1492300.0,1567979.8255811944,1416620.1744188056,1531716.0894587063,1410111.0894587063,-1\n20000417 00:00,1351900,1401300,1266900,1400600,1489340.0,1573974.0215279884,1404705.9784720116,1528957.3349070835,1391032.3349070835,-1\n20000418 00:00,1405600,1442200,1397800,1442200,1486590.0,1573565.5574859972,1399614.4425140028,1525268.0649159327,1388513.0649159327,-1\n20000419 00:00,1445000,1451300,1425300,1430000,1483090.0,1573202.527430985,1392977.472569015,1523571.542860447,1386141.542860447,-1\n20000420 00:00,1435600,1439400,1423800,1433800,1478465.0,1568726.7587907526,1388203.2412092474,1519363.975286436,1386058.975286436,-1\n20000424 00:00,1415000,1432800,1405000,1430000,1473325.0,1562323.9859492793,1384326.0140507207,1515633.7157353468,1384053.7157353468,-1\n20000425 00:00,1446300,1479700,1444400,1478800,1471015.0,1556871.9106129494,1385158.0893870506,1519720.465030393,1383355.465030393,-1\n20000426 00:00,1479700,1487500,1460000,1463800,1468705.0,1552708.0350642165,1384701.9649357835,1521910.0239163875,1384765.0239163875,-1\n20000427 00:00,1430000,1473400,1430000,1465000,1466440.0,1548248.957944714,1384631.042055286,1523316.291479906,1383891.291479906,-1\n20000428 00:00,1470000,1478600,1450600,1452200,1464610.0,1545972.593370664,1383247.406629336,1522462.39864055,1386052.39864055,-1\n20000501 00:00,1465600,1484800,1436300,1471900,1462925.0,1542191.0551560377,1383658.9448439623,1524157.011468434,1386277.011468434,-1\n20000502 00:00,1455000,1471300,1445000,1446300,1459855.0,1536664.6732189378,1383045.3267810622,1524322.6532333451,1385917.6532333451,-1\n20000503 00:00,1440000,1440000,1397800,1416300,1455670.0,1532395.1744866052,1378944.8255133948,1515720.5751476297,1387455.5751476297,-1\n20000504 00:00,1420000,1423600,1407500,1413100,1451885.0,1529166.1044175741,1374603.8955824259,1511033.0997367443,1385123.0997367443,-1\n20000505 00:00,1410600,1440000,1409400,1433400,1448400.0,1522342.761647101,1374457.238352899,1509270.304523721,1382985.304523721,-1\n20000508 00:00,1427500,1433800,1418400,1425300,1443775.0,1511046.2382820474,1376503.7617179526,1507127.497743684,1381262.497743684,-1\n20000509 00:00,1430600,1434100,1402700,1416300,1439200.0,1500623.383169604,1377776.616830396,1504859.164625238,1378484.164625238,-1\n20000510 00:00,1405000,1409700,1377500,1385900,1433465.0,1492248.1361871753,1374681.8638128247,1500508.9664069612,1373188.9664069612,1\n20000511 00:00,1401300,1415000,1391300,1411100,1430705.0,1488232.3665310694,1373177.6334689306,1496284.4219872507,1371499.4219872507,1\n20000512 00:00,1418100,1434700,1415600,1424100,1429910.0,1487340.9637739086,1372479.0362260914,1493903.5246551316,1372148.5246551316,1\n20000515 00:00,1427500,1455900,1420000,1453800,1434695.0,1482544.1577773318,1386845.8422226682,1489693.1492911507,1378303.1492911507,1\n20000516 00:00,1465600,1477200,1453100,1470000,1438165.0,1485685.238846201,1390644.761153799,1484541.4604697714,1389696.4604697714,-1\n20000517 00:00,1456900,1461900,1444700,1452500,1438680.0,1486585.6823351886,1390774.3176648114,1484624.6150282058,1392644.6150282058,-1\n20000518 00:00,1456300,1463100,1439400,1440600,1439210.0,1486954.105395326,1391465.894604674,1485315.4850255195,1393680.4850255195,-1\n20000519 00:00,1425600,1432300,1404100,1408800,1437960.0,1487481.203539494,1388438.796460506,1484556.192800867,1389786.192800867,-1\n20000522 00:00,1412500,1414700,1370000,1404100,1436665.0,1488262.1811245538,1385067.8188754462,1481853.0236452287,1384698.0236452287,-1\n20000523 00:00,1404400,1408100,1375600,1375600,1431505.0,1485786.5060586936,1377223.4939413064,1476101.8626631433,1381526.8626631433,-1\n20000524 00:00,1380000,1406900,1276300,1404100,1428520.0,1481928.373875264,1375111.626124736,1477512.359869828,1367472.359869828,-1\n20000525 00:00,1406900,1418100,1377200,1388800,1424710.0,1478036.9875391438,1371383.0124608562,1474677.9684536539,1365012.9684536539,-1\n20000526 00:00,1388100,1396900,1373300,1383100,1421255.0,1475946.4792266584,1366563.5207733416,1470975.3841564804,1361970.3841564804,-1\n20000530 00:00,1400000,1426900,1394700,1426300,1418975.0,1468598.2959405156,1369351.7040594844,1470574.6729669743,1362274.6729669743,1\n20000531 00:00,1425600,1440000,1420900,1424100,1417865.0,1465963.4937394094,1369766.5062605906,1471123.8310971037,1363993.8310971037,1\n20000601 00:00,1436900,1453800,1430000,1451700,1419635.0,1469928.1913880995,1369341.8086119005,1472343.1487703954,1368033.1487703954,1\n20000602 00:00,1489400,1490900,1474800,1480900,1423025.0,1479819.150226938,1366230.849773062,1479981.5393636911,1372206.5393636911,-1\n20000605 00:00,1474700,1482200,1468800,1472500,1424980.0,1485629.108814557,1364330.891185443,1483301.6308528634,1378106.6308528634,-1\n20000606 00:00,1466300,1477800,1459100,1463400,1426885.0,1489805.5618220307,1363964.4381779693,1486983.6580732258,1381293.6580732258,-1\n20000607 00:00,1466300,1480000,1460000,1475600,1429850.0,1496001.749787893,1363698.250212107,1489721.8017487915,1385741.8017487915,-1\n20000608 00:00,1475000,1477500,1460600,1465600,1433835.0,1498502.0325591024,1369167.9674408976,1490952.4634870018,1390257.4634870018,-1\n20000609 00:00,1475000,1479700,1455300,1463400,1436450.0,1501457.030389028,1371442.969610972,1493031.2368057,1393041.2368057,-1\n20000612 00:00,1469700,1469700,1451300,1452800,1437885.0,1503005.1742933786,1372764.8257066214,1494060.0079035698,1394850.0079035698,-1\n20000613 00:00,1448100,1477500,1446300,1474700,1438930.0,1505688.373257592,1372171.626742408,1495775.2849286266,1397270.2849286266,-1\n20000614 00:00,1482500,1488800,1471900,1475000,1439180.0,1506437.4932628328,1371922.5067371672,1498287.0831893922,1400862.0831893922,-1\n20000615 00:00,1481300,1487500,1468400,1482500,1440680.0,1510353.5990171314,1371006.4009828686,1500668.948282466,1404173.948282466,-1\n20000616 00:00,1483100,1483100,1458800,1468800,1442090.0,1512833.222996977,1371346.777003023,1502410.3182873104,1405825.3182873104,-1\n20000619 00:00,1464700,1491600,1462500,1486600,1445980.0,1517524.7999508001,1374435.2000491999,1504342.5101964555,1408867.5101964555,-1\n20000620 00:00,1481900,1488800,1470000,1478100,1449680.0,1519818.7938305186,1379541.2061694814,1504529.6917650471,1412939.6917650471,-1\n20000621 00:00,1469400,1484400,1468900,1479500,1454875.0,1517259.096531087,1392490.903468913,1505051.3877874236,1416011.3877874236,-1\n20000622 00:00,1475600,1476900,1450000,1455300,1457435.0,1515313.9866877436,1399556.0133122564,1497488.120696558,1423613.120696558,-1\n20000623 00:00,1458100,1461300,1438800,1443800,1460185.0,1509325.1780623554,1411044.8219376446,1494909.6488841872,1423794.6488841872,-1\n20000626 00:00,1453800,1462500,1448800,1457500,1463905.0,1498145.7053081563,1429664.2946918437,1494248.2934348995,1423868.2934348995,-1\n20000627 00:00,1459800,1467200,1453100,1455600,1465370.0,1495283.3481910669,1435456.6518089331,1491980.3210442741,1426055.3210442741,-1\n20000628 00:00,1456300,1469800,1452200,1456300,1466980.0,1490649.6092067445,1443310.3907932555,1491907.393643232,1426207.393643232,1\n20000629 00:00,1447500,1457500,1435200,1444400,1466615.0,1491414.0544174572,1441815.9455825428,1490080.2609153052,1425490.2609153052,-1\n20000630 00:00,1439400,1455300,1438900,1453800,1465260.0,1489748.3972525767,1440771.6027474233,1487565.315431308,1426395.315431308,-1\n20000703 00:00,1454400,1474400,1451600,1472800,1465275.0,1489781.4787352243,1440768.5212647757,1489154.7298346756,1426574.7298346756,-1\n20000705 00:00,1463800,1466600,1443800,1450900,1464650.0,1489940.907457029,1439359.092542971,1489536.938104389,1425411.938104389,-1\n20000706 00:00,1449400,1464700,1442200,1458800,1463810.0,1488703.2038918256,1438916.7961081744,1489510.9995547647,1425010.9995547647,1\n20000707 00:00,1466900,1487800,1462200,1480900,1464575.0,1490557.7538956131,1438592.2461043869,1492295.2297558982,1425980.2297558982,1\n20000710 00:00,1478800,1489100,1476300,1479700,1465390.0,1492184.0963646844,1438595.9036353156,1493574.0173981937,1428999.0173981937,1\n20000711 00:00,1474700,1491300,1471600,1483800,1466940.0,1494223.6507821076,1439656.3492178924,1495666.4522491593,1430896.4522491593,1\n20000712 00:00,1492800,1501300,1486900,1495900,1468000.0,1497926.5099869664,1438073.4900130336,1497631.1948920966,1434916.1948920966,-1\n20000713 00:00,1499800,1503800,1491900,1498800,1469190.0,1501898.708320568,1436481.291679432,1500293.620775389,1438328.620775389,-1\n20000714 00:00,1504400,1512500,1496700,1508800,1470505.0,1507128.7887171712,1433881.2112828288,1503540.2997491616,1442070.2997491616,-1\n20000717 00:00,1509800,1519800,1506900,1510600,1472595.0,1513150.7628457411,1432039.2371542589,1506459.3981857493,1446699.3981857493,-1\n20000718 00:00,1506300,1506300,1493400,1496900,1473110.0,1514614.549148256,1431605.450851744,1507689.495183932,1449714.495183932,-1\n20000719 00:00,1494700,1499100,1482500,1484400,1473425.0,1515171.1794659104,1431678.8205340896,1508473.5115156209,1450828.5115156209,-1\n20000720 00:00,1490000,1505000,1488100,1498100,1474355.0,1517409.3133727622,1431300.6866272378,1510514.64533953,1452104.64533953,-1\n20000721 00:00,1497500,1497500,1478800,1482500,1475715.0,1517987.036856532,1433442.963143468,1510221.742608781,1453341.742608781,-1\n20000724 00:00,1481300,1488600,1465600,1466600,1476855.0,1516787.8173311125,1436922.1826688875,1509480.0290269924,1452525.0290269924,-1\n20000725 00:00,1477500,1478400,1467800,1474400,1477700.0,1516662.2381287317,1438737.7618712683,1508251.1770561677,1452331.1770561677,-1\n20000726 00:00,1469700,1471600,1456400,1461600,1478000.0,1516364.7755108771,1439635.2244891229,1506915.9459079613,1450410.9459079613,-1\n20000727 00:00,1459400,1466300,1446900,1455000,1477935.0,1516450.7253599097,1439419.2746400903,1504898.8716945047,1448123.8716945047,-1\n20000728 00:00,1457200,1459100,1415200,1422500,1476840.0,1520064.4560405333,1433615.5439594667,1502305.0902632822,1442290.0902632822,-1\n20000731 00:00,1429400,1441300,1420600,1434400,1475870.0,1521898.8214057237,1429841.1785942763,1498799.2483334458,1438139.2483334458,-1\n20000801 00:00,1436300,1447200,1431300,1440000,1474230.0,1522844.19957173,1425615.80042827,1495522.772301689,1435897.772301689,-1\n20000802 00:00,1438800,1454100,1436300,1442700,1473820.0,1523344.1193763202,1424295.8806236798,1492650.0479554965,1434705.0479554965,-1\n20000803 00:00,1428800,1458100,1426300,1455000,1473630.0,1523411.6472206374,1423848.3527793626,1491708.4164041793,1432368.4164041793,-1\n20000804 00:00,1463100,1467200,1454100,1465300,1472850.0,1522640.4207654444,1423059.5792345556,1490531.305318067,1433576.305318067,-1\n20000807 00:00,1467200,1484400,1463800,1481300,1472930.0,1522769.3057736561,1423090.6942263439,1492492.133383013,1434367.133383013,-1\n20000808 00:00,1475000,1488100,1475000,1485600,1473020.0,1522943.9261276594,1423096.0738723406,1493851.4540132023,1436716.4540132023,-1\n20000809 00:00,1491400,1492200,1473800,1476900,1472070.0,1520927.9614801928,1423212.0385198072,1495412.5456944846,1438142.5456944846,-1\n20000810 00:00,1475300,1478600,1462800,1465600,1470410.0,1517755.0271939936,1423064.9728060064,1495916.7080092956,1438061.7080092956,-1\n20000811 00:00,1466300,1480000,1455600,1474400,1468690.0,1512714.3523518518,1424665.6476481482,1496848.4501036485,1437703.4501036485,-1\n20000814 00:00,1477800,1495000,1470600,1493800,1467850.0,1509203.7664548224,1426496.2335451776,1499538.6373953645,1438668.6373953645,-1\n20000815 00:00,1493400,1498100,1473400,1490200,1467515.0,1508021.9018810375,1427008.0981189625,1501827.7751037425,1439832.7751037425,-1\n20000816 00:00,1493100,1499400,1478400,1483800,1467485.0,1507942.6951889254,1427027.3048110746,1503716.7965224336,1441061.7965224336,-1\n20000817 00:00,1486900,1504400,1483400,1499400,1467550.0,1508207.9143587076,1426892.0856412924,1505970.0381234717,1443255.0381234717,-1\n20000818 00:00,1503800,1503800,1491600,1496700,1468260.0,1510406.098277302,1426113.901722698,1507604.5979847284,1445954.5979847284,-1\n20000821 00:00,1500300,1507200,1494100,1503600,1470110.0,1514963.4903881515,1425256.5096118485,1509229.1203988811,1449064.1203988811,-1\n20000822 00:00,1505600,1513100,1500900,1502300,1471505.0,1518490.209374866,1424519.790625134,1511762.616868829,1451537.616868829,-1\n20000823 00:00,1498100,1512800,1491900,1509100,1473880.0,1523358.3023152573,1424401.6976847427,1514165.8200241786,1453505.8200241786,-1\n20000824 00:00,1511600,1515500,1500900,1514400,1476850.0,1528521.0944339288,1425178.9055660712,1516323.0435139395,1456383.0435139395,-1\n20000825 00:00,1511600,1516300,1509400,1510900,1481270.0,1528523.0676252875,1434016.9323747125,1516009.658417374,1461619.658417374,-1\n20000828 00:00,1512500,1529100,1512500,1517800,1485440.0,1530058.668738545,1440821.331261455,1518773.143330005,1464758.143330005,-1\n20000829 00:00,1514400,1518800,1509100,1515000,1489190.0,1530377.0804986223,1448002.9195013777,1520454.2725366713,1467369.2725366713,-1\n20000830 00:00,1513100,1517800,1504500,1506300,1492370.0,1528177.9935210003,1456562.0064789997,1521604.5402315916,1469194.5402315916,-1\n20000831 00:00,1510600,1530900,1508400,1522500,1495745.0,1529492.7391835365,1461997.2608164635,1523464.584019059,1472134.584019059,-1\n20000901 00:00,1532500,1535900,1520000,1525600,1498760.0,1531857.335240167,1465662.664759833,1526471.449033117,1474721.449033117,-1\n20000905 00:00,1518800,1522000,1508100,1512500,1500320.0,1532915.8034108686,1467724.1965891314,1527534.5253156773,1476249.5253156773,-1\n20000906 00:00,1511900,1519500,1496900,1496900,1500885.0,1532825.77488102,1468944.22511898,1528489.054650692,1475779.054650692,-1\n20000907 00:00,1502500,1510800,1498300,1507500,1502415.0,1532490.6562688164,1472339.3437311836,1528475.2954776103,1476440.2954776103,-1\n20000908 00:00,1502800,1505000,1493300,1497500,1504010.0,1529072.5537405908,1478947.4462594092,1527987.8863845046,1476192.8863845046,-1\n20000911 00:00,1497500,1511900,1486900,1494700,1505025.0,1526611.928915434,1483438.071084566,1527627.4527605835,1475742.4527605835,1\n20000912 00:00,1497500,1502500,1484400,1487500,1504710.0,1527111.4195978737,1482308.5804021263,1526181.782656401,1475241.782656401,-1\n20000913 00:00,1480000,1498400,1476600,1488800,1504640.0,1527230.2988028047,1482049.7011971953,1524747.2874827755,1474242.2874827755,-1\n20000914 00:00,1498800,1499400,1481600,1485300,1504715.0,1527036.4045257014,1482393.5954742986,1523485.5616907652,1473460.5616907652,-1\n20000915 00:00,1481900,1482500,1460300,1467500,1503120.0,1530677.401909469,1475562.598090531,1521083.3653392638,1470458.3653392638,-1\n20000918 00:00,1463800,1469700,1442000,1446900,1500630.0,1537487.8946767175,1463772.1053232825,1518159.751179969,1465209.751179969,-1\n20000919 00:00,1451300,1463100,1447000,1460800,1498490.0,1539180.38707115,1457799.61292885,1515085.7669406068,1461670.7669406068,-1\n20000920 00:00,1456900,1460300,1431600,1452200,1495985.0,1541330.9711551093,1450639.0288448907,1512518.3923113425,1456553.3923113425,-1\n20000921 00:00,1444700,1455600,1437500,1450300,1493045.0,1542082.8007255627,1444007.1992744373,1508809.7359007385,1453264.7359007385,-1\n20000922 00:00,1426300,1451600,1421300,1451600,1489905.0,1541067.465734169,1438742.534265831,1506221.784862573,1448321.784862573,-1\n20000925 00:00,1459400,1460600,1437200,1441300,1486425.0,1540770.9980127332,1432079.0019872668,1504515.9402724868,1444140.9402724868,-1\n20000926 00:00,1443800,1450000,1426300,1428900,1481980.0,1539767.5626757178,1424192.4373242822,1501189.223738599,1439989.223738599,-1\n20000927 00:00,1435600,1439700,1421300,1428100,1477635.0,1537854.872965658,1417415.127034342,1497947.5119539707,1435442.5119539707,-1\n20000928 00:00,1431900,1463300,1428900,1461900,1475415.0,1534507.3099903872,1416322.6900096128,1498130.169545656,1432340.169545656,-1\n20000929 00:00,1454700,1459700,1437500,1437800,1471180.0,1528274.1187864388,1414085.8812135612,1496188.010541308,1430428.010541308,-1\n20001002 00:00,1442800,1449100,1431400,1438100,1466805.0,1519811.8476708434,1413798.1523291566,1494058.75556912,1428028.75556912,-1\n20001003 00:00,1445300,1457500,1425300,1426300,1462495.0,1513933.7587330798,1411056.2412669202,1492811.056626029,1424576.056626029,-1\n20001004 00:00,1428800,1442500,1417500,1435800,1459440.0,1509583.7693038727,1409296.2306961273,1490442.4639314867,1421847.4639314867,-1\n20001005 00:00,1434100,1448400,1433100,1438800,1456005.0,1501726.4380788705,1410283.5619211295,1489019.372128488,1420214.372128488,-1\n20001006 00:00,1438800,1446400,1397500,1410000,1451630.0,1497377.2665850103,1405882.7334149897,1488131.3763702193,1414121.3763702193,-1\n20001009 00:00,1413100,1413100,1393800,1404400,1447115.0,1492792.1397966205,1401437.8602033795,1483193.427827024,1410038.427827024,-1\n20001010 00:00,1400900,1412500,1385600,1388800,1442180.0,1490583.7436568702,1393776.2563431298,1478997.9426371485,1404522.9426371485,-1\n20001011 00:00,1376300,1386300,1351300,1365600,1436020.0,1490143.5106030642,1381896.4893969358,1473125.2417510708,1396295.2417510708,-1\n20001012 00:00,1372800,1433800,1327800,1331600,1428335.0,1494577.89471332,1362092.10528668,1473044.0282509688,1382984.0282509688,-1\n20001013 00:00,1329400,1376600,1328800,1375600,1423740.0,1491216.526288777,1356263.473711223,1468308.2477826225,1374828.2477826225,-1\n20001016 00:00,1374100,1390000,1366900,1374700,1420130.0,1489948.768250378,1350311.231749622,1463737.7003747537,1370947.7003747537,-1\n20001017 00:00,1384400,1385600,1344100,1354800,1414830.0,1487528.6409776688,1342131.3590223312,1460316.8479581105,1363731.8479581105,-1\n20001018 00:00,1326300,1361300,1301600,1344100,1409425.0,1486167.9443010888,1332682.0556989112,1455332.187835116,1354172.187835116,-1\n20001019 00:00,1368400,1394500,1364400,1390500,1406435.0,1481209.3077533988,1331660.6922466012,1455695.7493111365,1349690.7493111365,-1\n20001020 00:00,1383800,1411900,1383800,1398800,1403795.0,1475676.8607160388,1331913.1392839612,1455099.6462021393,1349424.6462021393,-1\n20001023 00:00,1399400,1410300,1389400,1400000,1401730.0,1471526.1345634556,1331933.8654365444,1454687.1798971738,1349387.1798971738,-1\n20001024 00:00,1409700,1419400,1390000,1401300,1400350.0,1469025.162904794,1331674.837095206,1455260.345303792,1349105.345303792,-1\n20001025 00:00,1387500,1395600,1363900,1369200,1397405.0,1466119.1753934368,1328690.8246065632,1454213.9632113674,1345208.9632113674,-1\n20001026 00:00,1371300,1376600,1340000,1367500,1392685.0,1455768.0016724,1329601.9983276,1450667.0778261577,1341452.0778261577,-1\n20001027 00:00,1378800,1388400,1366300,1383800,1389985.0,1449642.5317960775,1330327.4682039225,1448917.4751760475,1340047.4751760475,-1\n20001030 00:00,1384400,1410900,1381600,1402500,1388205.0,1444014.1560588405,1332395.8439411595,1450154.2235719794,1339544.2235719794,-1\n20001031 00:00,1410200,1436900,1400600,1429700,1388375.0,1444665.9184504924,1332084.0815495076,1453085.6070413147,1341860.6070413147,-1\n20001101 00:00,1422500,1432500,1412200,1424100,1387790.0,1442312.7255371555,1333267.2744628445,1455157.8904976975,1344637.8904976975,-1\n20001102 00:00,1431600,1439100,1425200,1430300,1387365.0,1440402.9213393587,1334327.0786606413,1458148.2898153772,1347673.2898153772,-1\n20001103 00:00,1434700,1437500,1423800,1431100,1388420.0,1443995.6277517402,1332844.3722482598,1458164.4050710555,1352969.4050710555,-1\n20001106 00:00,1431600,1443000,1430300,1437000,1390050.0,1449201.9568568952,1330898.0431431048,1460640.8109373043,1356435.8109373043,-1\n20001107 00:00,1431400,1440000,1425600,1436600,1392440.0,1454963.3844253493,1329916.6155746507,1462134.5829115293,1359804.5829115293,-1\n20001108 00:00,1440600,1440600,1410300,1412500,1394785.0,1456620.1121936396,1332949.8878063604,1462562.5591421772,1361312.5591421772,-1\n20001109 00:00,1400000,1412200,1372500,1404100,1398410.0,1453090.0109729324,1343729.9890270676,1456120.0931921287,1364770.0931921287,-1\n20001110 00:00,1390000,1394700,1368800,1369700,1398115.0,1453344.965598396,1342885.034401604,1452067.187491291,1362592.187491291,-1\n20001113 00:00,1356300,1369800,1330200,1353800,1397070.0,1454768.287669566,1339371.712330434,1447965.3521746602,1356015.3521746602,-1\n20001114 00:00,1374700,1396300,1370000,1387500,1398705.0,1453288.568040208,1344121.431959792,1446384.128158026,1354284.128158026,-1\n20001115 00:00,1390600,1401100,1377500,1391300,1401065.0,1449765.237165747,1352364.762834253,1442689.2508731345,1356004.2508731345,-1\n20001116 00:00,1385800,1398800,1373100,1377700,1400425.0,1449992.4843017072,1350857.5156982928,1439298.965075693,1356318.965075693,-1\n20001117 00:00,1373100,1390000,1357500,1374700,1399220.0,1450042.7744224968,1348397.2255775032,1437367.793798643,1353727.793798643,-1\n20001120 00:00,1357500,1363800,1343800,1346900,1396565.0,1452261.6165938291,1340868.3834061709,1433922.7658178199,1348782.7658178199,-1\n20001121 00:00,1348800,1361900,1335200,1351600,1394080.0,1453048.6221646734,1335111.3778353266,1429740.6373272338,1345005.6373272338,-1\n20001122 00:00,1343400,1348800,1324400,1325000,1391870.0,1457355.6350660203,1326384.3649339797,1423771.846470672,1340566.846470672,-1\n20001124 00:00,1336300,1349700,1335600,1348400,1390915.0,1458323.2272426742,1323506.7727573258,1419298.1388702905,1337878.1388702905,-1\n20001127 00:00,1364700,1366900,1353100,1355000,1389475.0,1458637.3271731078,1320312.6728268922,1417099.1097715327,1336219.1097715327,-1\n20001128 00:00,1351300,1365900,1338100,1338100,1386255.0,1458614.5321985984,1313895.4678014016,1414196.853285355,1333541.853285355,-1\n20001129 00:00,1343800,1359100,1332700,1346400,1382090.0,1453551.2034603392,1310628.7965396608,1410806.4783692895,1331636.4783692895,-1\n20001130 00:00,1325000,1335000,1297500,1316300,1376700.0,1450883.5022090492,1302516.4977909508,1407717.6867785635,1324257.6867785635,-1\n20001201 00:00,1331900,1340600,1310000,1318800,1371125.0,1445116.6177685014,1297133.3822314986,1404806.3197837798,1319006.3197837798,-1\n20001204 00:00,1318800,1338800,1315000,1330000,1366070.0,1436719.8435950144,1295420.1564049856,1402328.2972646896,1315013.2972646896,-1\n20001205 00:00,1348800,1381900,1344100,1381300,1363285.0,1426534.9256916558,1300035.0743083442,1406261.5546680526,1313066.5546680526,-1\n20001206 00:00,1377800,1383400,1350300,1355300,1359220.0,1412812.8204146787,1305627.1795853213,1407981.7637472856,1311981.7637472856,-1\n20001207 00:00,1348800,1358800,1343800,1349800,1356085.0,1403864.4213024813,1308305.5786975187,1405959.810057068,1312254.810057068,-1\n20001208 00:00,1370600,1391300,1360900,1376600,1354710.0,1398280.58181847,1311139.41818153,1407706.5344960773,1313776.5344960773,-1\n20001211 00:00,1373800,1488800,1367200,1386300,1355540.0,1400820.0795052305,1310259.9204947695,1419260.7931154985,1312385.7931154985,-1\n20001212 00:00,1381900,1392500,1373800,1377500,1356725.0,1402990.66221292,1310459.33778708,1419164.0905965623,1315424.0905965623,-1\n20001213 00:00,1392500,1394100,1362500,1365300,1355615.0,1399896.7016384872,1311333.2983615128,1418982.0740318103,1316877.0740318103,-1\n20001214 00:00,1358800,1365000,1341900,1341900,1353145.0,1394610.671343896,1311679.328656104,1417221.400314495,1315146.400314495,-1\n20001215 00:00,1331300,1332500,1305600,1314500,1349985.0,1393084.3863065357,1306885.6136934643,1413383.0129829557,1309718.0129829557,-1\n20001218 00:00,1110000,1334700,1110000,1323800,1347440.0,1390412.2422035434,1304467.7577964566,1417761.4561909281,1285266.4561909281,1\n20001219 00:00,1324700,1349700,1305000,1305600,1345375.0,1392061.3523955343,1298688.6476044657,1415804.6508394112,1281239.6508394112,1\n20001220 00:00,1286300,1289400,1239400,1266900,1341140.0,1398861.6562478936,1283418.3437521064,1410834.882505499,1270344.882505499,1\n20001221 00:00,1260000,1288600,1255300,1276900,1338735.0,1402624.820002877,1274845.179997123,1404912.3936954516,1263507.3936954516,1\n20001222 00:00,1290000,1308600,1288400,1308600,1336745.0,1401775.8380693344,1271714.1619306656,1402357.0863593768,1259902.0863593768,1\n20001226 00:00,1308400,1319400,1302800,1318900,1334940.0,1399847.7622476695,1270032.2377523305,1400554.625753722,1258384.625753722,1\n20001227 00:00,1320000,1336600,1312500,1331300,1334600.0,1399509.228927788,1269690.771072212,1400022.8756819388,1258407.8756819388,1\n20001228 00:00,1328100,1338100,1325900,1336100,1334085.0,1398774.6367279952,1269395.3632720048,1399353.2367281034,1259868.2367281034,1\n20001229 00:00,1340600,1342800,1318800,1322500,1334395.0,1398799.548752398,1269990.451247602,1397335.5078333633,1261585.5078333633,-1\n20010102 00:00,1320000,1321600,1275600,1282500,1332580.0,1400585.488013836,1264574.511986164,1395107.8007381223,1256912.8007381223,-1\n20010103 00:00,1283100,1360000,1276600,1350000,1333580.0,1401991.3031596388,1265168.6968403612,1399849.8355884599,1252714.8355884599,-1\n20010104 00:00,1349400,1354700,1330000,1334100,1331220.0,1396046.2477704827,1266393.7522295173,1399078.184580035,1256023.184580035,1\n20010105 00:00,1334700,1336300,1292800,1302500,1328580.0,1393568.9405976124,1263591.0594023876,1398237.4844613015,1253622.4844613015,1\n20010108 00:00,1298800,1300600,1276300,1297500,1325965.0,1391534.391487187,1260395.608512813,1395795.2637189552,1249500.2637189552,1\n20010109 00:00,1310500,1315000,1296300,1301300,1322200.0,1384260.7444363988,1260139.2555636012,1392328.3338409595,1249453.3338409595,1\n20010110 00:00,1290000,1318100,1288100,1316600,1318715.0,1373372.7085139873,1264057.2914860127,1384192.5401418204,1255057.5401418204,1\n20010111 00:00,1310900,1334800,1310900,1327700,1316225.0,1364054.6508454746,1268395.3491545254,1385043.647429901,1255128.647429901,1\n20010112 00:00,1326900,1337200,1312800,1319100,1313915.0,1356179.7974087184,1271650.2025912816,1384784.3318016564,1255949.3318016564,1\n20010116 00:00,1320000,1331900,1315200,1325800,1313110.0,1353795.8648672975,1272424.1351327025,1384656.4192491176,1256826.4192491176,1\n20010117 00:00,1348400,1350500,1326400,1329400,1313855.0,1355156.403123865,1272553.596876135,1385185.6491619002,1259095.6491619002,1\n20010118 00:00,1334400,1357000,1329400,1350500,1315190.0,1359320.121232555,1271059.878767445,1372640.5476544176,1276115.5476544176,-1\n20010119 00:00,1361900,1361900,1338800,1344800,1317150.0,1362856.21401954,1271443.78598046,1373317.876449235,1280032.876449235,-1\n20010122 00:00,1342500,1357800,1335600,1346300,1321120.0,1362241.1186618262,1279998.8813381738,1371912.2850413714,1285227.2850413714,-1\n20010123 00:00,1344700,1366600,1341600,1361300,1325340.0,1364729.3081939756,1285950.6918060244,1373949.8055136218,1288509.8055136218,-1\n20010124 00:00,1362500,1373100,1358400,1366900,1328255.0,1370762.9980709513,1285747.0019290487,1375998.951020261,1293108.951020261,-1\n20010125 00:00,1362500,1372500,1356600,1360600,1330340.0,1374851.5445699203,1285828.4554300797,1378677.820764363,1295892.820764363,-1\n20010126 00:00,1351600,1361300,1344500,1357800,1331665.0,1377761.4326168522,1285568.5673831478,1379772.9886280745,1298082.9886280745,-1\n20010129 00:00,1355000,1369000,1353700,1366500,1333185.0,1381707.1712209997,1284662.8287790003,1382304.4103460356,1300149.4103460356,-1\n20010130 00:00,1363000,1379200,1357900,1377500,1335935.0,1387839.5383372207,1284030.4616627793,1384988.236344826,1303238.236344826,-1\n20010131 00:00,1374000,1387000,1366000,1370600,1340340.0,1388149.3881993904,1292530.6118006096,1385942.8884389694,1308077.8884389694,-1\n20010201 00:00,1371000,1375600,1362500,1374800,1341580.0,1391564.2215103926,1291595.7784896074,1382951.9387463692,1315631.9387463692,-1\n20010202 00:00,1374000,1379900,1350000,1350800,1342415.0,1392429.4489122892,1292400.5510877108,1384383.97632608,1316283.97632608,-1\n20010205 00:00,1348000,1359000,1347500,1358900,1345235.0,1392196.1019887736,1298273.8980112264,1382441.0579458184,1319141.0579458184,-1\n20010206 00:00,1353000,1367000,1352200,1354200,1348070.0,1389705.854740836,1306434.145259164,1382253.576236693,1320663.576236693,-1\n20010207 00:00,1347200,1354200,1336800,1342200,1350115.0,1385978.9247712796,1314251.0752287204,1381483.8308808175,1320088.8308808175,-1\n20010208 00:00,1348000,1354000,1334800,1334800,1351025.0,1384269.0596197275,1317780.9403802725,1379760.8469874063,1319985.8469874063,-1\n20010209 00:00,1333500,1333500,1312600,1318300,1350555.0,1385335.1365724748,1315774.8634275252,1376927.9488616216,1317407.9488616216,-1\n20010212 00:00,1317000,1335000,1317000,1331400,1351170.0,1384088.7545329407,1318251.2454670593,1374603.3823033718,1316043.3823033718,-1\n20010213 00:00,1337000,1341700,1320000,1321200,1350940.0,1384620.0475059047,1317259.9524940953,1373293.6157347967,1313983.6157347967,-1\n20010214 00:00,1326500,1326500,1306600,1321500,1350545.0,1385391.3757082426,1315698.6242917574,1370510.890426721,1311920.890426721,-1\n20010215 00:00,1328400,1335200,1319900,1329600,1349500.0,1385522.7705764007,1313477.2294235993,1368351.956417827,1311606.956417827,-1\n20010216 00:00,1310000,1312900,1293000,1304600,1347490.0,1388481.0185284533,1306498.9814715467,1365890.222473272,1307120.222473272,-1\n20010220 00:00,1310400,1311400,1281000,1283200,1344335.0,1394001.9417218335,1294668.0582781665,1362253.9314440715,1302253.9314440715,-1\n20010221 00:00,1279000,1288400,1255200,1256000,1339070.0,1401190.660009372,1276949.339990628,1356609.8268620963,1295379.8268620963,-1\n20010222 00:00,1263500,1265400,1230200,1255200,1333485.0,1404097.6128959975,1262872.3871040025,1350935.1211291982,1286630.1211291982,-1\n20010223 00:00,1250800,1255400,1218000,1248900,1327900.0,1406291.6577194282,1249508.3422805718,1345117.5302280048,1277587.5302280048,-1\n20010226 00:00,1258000,1272100,1245000,1272100,1323615.0,1404335.091055449,1242894.908944551,1341291.3765554964,1272216.3765554964,-1\n20010227 00:00,1268000,1278400,1255100,1263500,1318465.0,1400712.0735041678,1236217.9264958322,1337978.3089470365,1267703.3089470365,-1\n20010228 00:00,1267500,1268400,1232700,1241500,1311665.0,1395732.336701004,1227597.663298996,1333790.93031716,1261355.93031716,-1\n20010301 00:00,1240500,1245000,1217500,1244900,1305380.0,1389678.0331917654,1221081.9668082346,1328395.2464774305,1254985.2464774305,-1\n20010302 00:00,1225000,1256500,1223000,1237700,1298525.0,1381413.3797645967,1215636.6202354033,1324913.4769716435,1248443.4769716435,-1\n20010305 00:00,1241500,1247800,1238100,1244000,1293185.0,1375674.2786972949,1210695.7213027051,1319297.1934505347,1245797.1934505347,-1\n20010306 00:00,1263500,1277500,1254900,1258700,1288175.0,1366138.013666738,1210211.986333262,1319152.2226457219,1242352.2226457219,-1\n20010307 00:00,1269000,1269000,1257600,1266400,1283785.0,1356063.0263980692,1211506.9736019308,1317333.5189016848,1241043.5189016848,-1\n20010308 00:00,1266000,1272400,1261000,1269000,1280125.0,1347443.5524205624,1212806.4475794376,1315767.1520221592,1240377.1520221592,-1\n20010309 00:00,1261000,1261000,1231100,1236700,1275220.0,1340141.6943709883,1210298.3056290117,1313823.0978613186,1235628.0978613186,-1\n20010312 00:00,1223400,1245000,1177000,1184400,1268525.0,1341422.2667526018,1195627.7332473982,1310344.5488586533,1225279.5488586533,-1\n20010313 00:00,1194000,1204400,1175300,1202000,1262055.0,1334449.9576973424,1189660.0423026576,1304137.80611021,1217407.80611021,-1\n20010314 00:00,1170500,1192900,1157500,1172000,1254595.0,1331671.4419261813,1177518.5580738187,1297596.4277505074,1207446.4277505074,-1\n20010315 00:00,1184500,1188600,1175100,1177100,1247375.0,1325080.2347014023,1169669.7652985977,1290467.5219329987,1200812.5219329987,-1\n20010316 00:00,1171300,1185000,1144600,1153100,1238550.0,1316984.3419682987,1160115.6580317013,1284279.5436536656,1190859.5436536656,-1\n20010319 00:00,1157600,1176900,1148200,1173000,1231970.0,1309207.299279558,1154732.700720442,1276874.0712422053,1184639.0712422053,-1\n20010320 00:00,1179000,1184600,1141500,1142500,1224935.0,1307661.7133397672,1142208.2866602328,1270725.9454096144,1176585.9454096144,-1\n20010321 00:00,1141800,1152600,1119000,1123400,1218305.0,1310699.5122829273,1125910.4877170727,1261995.06171981,1167795.06171981,-1\n20010322 00:00,1120200,1157000,1080400,1119000,1211495.0,1311751.1215088635,1111238.8784911365,1255948.151079828,1155538.151079828,-1\n20010323 00:00,1132500,1144800,1115000,1142500,1206175.0,1309181.385724381,1103168.614275619,1248554.99383413,1149284.99383413,-1\n20010326 00:00,1157000,1162700,1147700,1155000,1200320.0,1300956.7050335016,1099683.2949664984,1243867.335691197,1145632.335691197,-1\n20010327 00:00,1156200,1186500,1152500,1185100,1196400.0,1292910.455392149,1099889.544607851,1242760.3275301307,1142920.3275301307,-1\n20010328 00:00,1169000,1175000,1149000,1154500,1192050.0,1287877.43865929,1096222.56134071,1239615.0582415469,1139715.0582415469,-1\n20010329 00:00,1147000,1166000,1093400,1149800,1187295.0,1281586.2822057267,1093003.7177942733,1237924.6955518757,1131259.6955518757,-1\n20010330 00:00,1155500,1166500,1145000,1161200,1183470.0,1275450.326157282,1091489.673842718,1234450.8356580464,1129585.8356580464,-1\n20010402 00:00,1163000,1173800,1138000,1145400,1178540.0,1267535.7841698134,1089544.2158301866,1233557.5417858516,1124837.5417858516,-1\n20010403 00:00,1139800,1141500,1101000,1106700,1170940.0,1257173.877333679,1084706.122666321,1228394.3235205323,1118039.3235205323,-1\n20010404 00:00,1105800,1121000,1093000,1103100,1162775.0,1241942.8185881106,1083607.1814118894,1223209.1498519103,1110364.1498519103,-1\n20010405 00:00,1133000,1154900,1125000,1152200,1156935.0,1219358.8504099194,1094511.1495900806,1224072.1673263316,1105167.1673263316,-1\n20010406 00:00,1139900,1144000,1120600,1130500,1151625.0,1203115.0330161091,1100134.9669838909,1220464.4609143,1102504.4609143,-1\n20010409 00:00,1140000,1154800,1127800,1140000,1149405.0,1198838.7728683539,1099971.2271316461,1215425.8614621444,1103615.8614621444,-1\n20010410 00:00,1154500,1177500,1151700,1170900,1147850.0,1192270.5583035604,1103429.4416964396,1216739.58894194,1103669.58894194,-1\n20010411 00:00,1187800,1189900,1161400,1169600,1147730.0,1191901.2168725291,1103558.7831274709,1216818.5169792157,1106148.5169792157,-1\n20010412 00:00,1163000,1186300,1159600,1185500,1148150.0,1193572.3072949846,1102727.6927050154,1219066.4756796078,1106881.4756796078,-1\n20010416 00:00,1182900,1188900,1169100,1182300,1149610.0,1197390.786933662,1101829.213066338,1219152.5256148833,1110057.5256148833,-1\n20010417 00:00,1173100,1196600,1170200,1194200,1150670.0,1201333.04767777,1100006.95232223,1221112.8803182277,1112362.8803182277,-1\n20010418 00:00,1210600,1260000,1206900,1241400,1155615.0,1219661.6166163366,1091568.3833836634,1229421.2964783965,1117266.2964783965,-1\n20010419 00:00,1242500,1258300,1200000,1257200,1162305.0,1238326.614689508,1086283.385310492,1237479.1491947398,1121619.1491947398,-1\n20010420 00:00,1249000,1254000,1236600,1243600,1168535.0,1249595.1326177055,1087474.8673822945,1239487.1667317487,1132027.1667317487,-1\n20010423 00:00,1236500,1263000,1219100,1227000,1172760.0,1256708.8510939847,1088811.1489060153,1245364.6191065027,1135789.6191065027,-1\n20010424 00:00,1225200,1237000,1211000,1211300,1175575.0,1260720.1437252883,1090429.8562747117,1248579.5760169947,1138134.5760169947,-1\n20010425 00:00,1214200,1236700,1209500,1231000,1177870.0,1266328.2862144639,1089411.7137855361,1251153.0290947412,1141728.0290947412,-1\n20010426 00:00,1237300,1252200,1235000,1237400,1182015.0,1273424.3928434053,1090605.6071565947,1254330.081879369,1147140.081879369,-1\n20010427 00:00,1249200,1256800,1242000,1255500,1187300.0,1282779.8408042241,1091820.1591957759,1255168.4867797466,1155958.4867797466,-1\n20010430 00:00,1264500,1272700,1246700,1252100,1191845.0,1290522.9504246009,1093167.0495753991,1260420.5753404056,1160535.5753404056,-1\n20010501 00:00,1250700,1269700,1246000,1269500,1198050.0,1299824.073319289,1096275.926680711,1264394.5284825892,1166324.5284825892,-1\n20010502 00:00,1274100,1276900,1260000,1268900,1206160.0,1303267.4332891153,1109052.5667108847,1267402.5495794856,1173457.5495794856,-1\n20010503 00:00,1261300,1261500,1242200,1251600,1213585.0,1300176.091343163,1126993.908656837,1270289.4893020743,1176539.4893020743,-1\n20010504 00:00,1236500,1272000,1234400,1269500,1219450.0,1304491.742691457,1134408.257308543,1272578.6649240989,1180958.6649240989,-1\n20010507 00:00,1268600,1274700,1255300,1265700,1226210.0,1302986.9470609506,1149433.0529390494,1275326.9666773593,1185536.9666773593,-1\n20010508 00:00,1268600,1271000,1255600,1265200,1232470.0,1299964.8916585543,1164975.1083414457,1277647.5730255472,1189597.5730255472,-1\n20010509 00:00,1252500,1266000,1250600,1258700,1236860.0,1298972.0085007723,1174747.9914992277,1278353.0025786697,1193618.0025786697,-1\n20010510 00:00,1272600,1275000,1257700,1259900,1241375.0,1295943.741051998,1186806.258948002,1280200.0975711774,1197145.0975711774,-1\n20010511 00:00,1260000,1264900,1244000,1248200,1244510.0,1292711.116169649,1196308.883830351,1281069.2946278907,1198884.2946278907,-1\n20010514 00:00,1249000,1254400,1244600,1252300,1248010.0,1286900.4564128527,1209119.5435871473,1281315.1554569805,1200630.1554569805,-1\n20010515 00:00,1255500,1265000,1248500,1253000,1250950.0,1281012.767670326,1220887.232329674,1281956.2120801252,1202756.2120801252,1\n20010516 00:00,1248400,1292000,1246200,1289600,1253360.0,1287434.353992409,1219285.646007591,1283654.0331518594,1207454.0331518594,-1\n20010517 00:00,1290100,1300800,1285600,1293100,1255155.0,1293379.0487128196,1216930.9512871804,1284956.069677079,1215221.069677079,-1\n20010518 00:00,1290900,1297200,1281000,1296200,1257785.0,1299541.976662589,1216028.023337411,1288566.8408189446,1219491.8408189446,-1\n20010521 00:00,1298400,1318000,1291500,1317700,1262320.0,1309115.2818134478,1215524.7181865522,1292503.49089968,1226038.49089968,-1\n20010522 00:00,1318300,1320900,1310700,1313700,1267440.0,1313181.814568292,1221698.185431708,1296635.5393854247,1232540.5393854247,-1\n20010523 00:00,1310500,1310500,1292900,1292900,1270535.0,1314330.7201105314,1226739.2798894686,1299410.646745543,1236275.646745543,-1\n20010524 00:00,1294700,1300000,1249000,1297000,1273515.0,1315977.1843526685,1231052.8156473315,1302993.9184840627,1235388.9184840627,-1\n20010525 00:00,1296500,1297000,1280100,1282300,1274855.0,1316644.7343853726,1233065.2656146274,1304451.6802157392,1237221.6802157392,-1\n20010529 00:00,1282300,1283500,1269000,1273000,1275900.0,1316386.3433765017,1235413.6566234983,1304001.5598777323,1238496.5598777323,-1\n20010530 00:00,1265900,1275300,1250000,1252900,1275070.0,1316711.282401002,1233428.717598998,1302993.077984615,1237248.077984615,-1\n20010531 00:00,1254300,1267600,1252600,1261000,1274675.0,1316691.0862051668,1232658.9137948332,1301924.808652747,1236464.808652747,-1\n20010601 00:00,1262000,1271000,1251200,1266400,1275415.0,1316285.1003179585,1234544.8996820415,1300804.6284635966,1236379.6284635966,-1\n20010604 00:00,1268000,1272700,1258900,1271700,1275525.0,1316342.637119265,1234707.362880735,1298941.013054365,1238086.013054365,-1\n20010605 00:00,1274900,1292300,1272700,1288700,1276675.0,1317616.415461608,1235733.584538392,1300559.8848269652,1239524.8848269652,-1\n20010606 00:00,1288300,1288300,1273600,1275300,1277180.0,1317790.6193008677,1236569.3806991323,1301396.8402402701,1240406.8402402701,-1\n20010607 00:00,1270500,1282900,1270000,1282400,1278365.0,1318123.6858434733,1238606.3141565267,1301926.6252967524,1241311.6252967524,-1\n20010608 00:00,1277000,1278700,1261400,1270000,1278870.0,1317928.1156739544,1239811.8843260456,1302053.0974907125,1240883.0974907125,-1\n20010611 00:00,1267100,1277500,1254100,1259400,1279430.0,1317006.167979186,1241853.832020814,1301497.6040788987,1239952.6040788987,-1\n20010612 00:00,1248600,1268800,1240400,1261300,1279880.0,1316344.9201288032,1243415.0798711968,1301569.5782936066,1237234.5782936066,-1\n20010613 00:00,1261700,1265800,1246700,1247400,1279600.0,1316961.209830518,1242238.790169482,1300231.0470275488,1235506.0470275488,-1\n20010614 00:00,1241800,1243000,1222400,1224800,1276360.0,1320342.6965976395,1232377.3034023605,1295070.86794556,1233465.86794556,-1\n20010615 00:00,1209100,1224000,1204000,1216200,1272515.0,1322944.565732812,1222085.434267188,1290773.2456015383,1228328.2456015383,-1\n20010618 00:00,1216500,1224400,1209500,1210800,1268245.0,1324099.8287975176,1212390.1712024824,1286423.2936394871,1224173.2936394871,-1\n20010619 00:00,1223800,1228900,1208600,1214600,1263090.0,1318766.4187066662,1207413.5812933338,1282345.7577373139,1221025.7577373139,-1\n20010620 00:00,1211900,1228600,1211000,1226000,1258705.0,1311485.772067108,1205924.227932892,1280060.8443020142,1217630.8443020142,-1\n20010621 00:00,1222200,1274700,1221500,1238600,1255990.0,1307012.6185137532,1204967.3814862468,1282118.224209759,1214828.224209759,-1\n20010622 00:00,1234900,1236000,1221600,1227500,1252515.0,1301310.256941633,1203719.743058367,1277653.3139675597,1215463.3139675597,-1\n20010625 00:00,1232800,1234400,1215000,1221300,1249465.0,1298057.3152360534,1200872.6847639466,1275651.1332722367,1213086.1332722367,-1\n20010626 00:00,1209000,1229000,1200300,1218400,1246735.0,1295863.6993518046,1197606.3006481954,1274004.834865357,1209309.834865357,-1\n20010627 00:00,1216000,1251500,1209100,1213100,1244745.0,1295896.2453416337,1193593.7546583663,1273659.6521797674,1206399.6521797674,-1\n20010628 00:00,1220000,1239400,1219300,1228900,1243140.0,1294164.637186363,1192115.362813637,1273475.7567340753,1204520.7567340753,-1\n20010629 00:00,1228000,1240100,1222600,1232000,1241420.0,1291502.8753168187,1191337.1246831813,1272595.4862514648,1203985.4862514648,-1\n20010702 00:00,1228000,1243200,1226200,1239000,1239785.0,1287903.573337122,1191666.426662878,1272630.0431164047,1203540.0431164047,-1\n20010703 00:00,1239800,1241000,1230500,1240800,1237390.0,1279982.5298614674,1194797.4701385326,1271810.4755180168,1204235.4755180168,-1\n20010705 00:00,1230700,1236500,1221100,1221300,1234690.0,1274051.244899012,1195328.755100988,1271039.0016591582,1202774.0016591582,-1\n20010706 00:00,1213100,1215800,1190500,1191900,1230165.0,1267291.1780957857,1193038.8219042143,1268809.4538820954,1197859.4538820954,-1\n20010709 00:00,1194900,1205400,1192000,1201000,1226715.0,1261116.9926748436,1192313.0073251564,1265021.4503377688,1195196.4503377688,-1\n20010710 00:00,1202900,1206400,1182100,1183500,1222920.0,1258777.1387592484,1187062.8612407516,1261332.5423690923,1191372.5423690923,-1\n20010711 00:00,1181000,1190400,1170900,1182700,1218990.0,1254386.0393264557,1183593.9606735443,1256377.498651401,1187752.498651401,-1\n20010712 00:00,1195000,1214700,1193100,1211600,1217200.0,1250208.4837579674,1184191.5162420326,1255859.4432242834,1185299.4432242834,-1\n20010713 00:00,1208400,1223200,1206200,1219000,1216910.0,1249747.7770258584,1184072.2229741416,1254836.00418705,1185476.00418705,-1\n20010716 00:00,1217700,1222800,1202900,1206000,1216400.0,1249581.0789456882,1183218.9210543118,1253855.2339470135,1184630.2339470135,-1\n20010717 00:00,1202000,1219400,1198300,1216700,1216695.0,1249776.4434388827,1183613.5565611173,1253579.65611079,1183424.65611079,1\n20010718 00:00,1205600,1216400,1200600,1211000,1216515.0,1249679.1538411581,1183350.8461588419,1252391.4348938894,1182866.4348938894,1\n20010719 00:00,1221800,1229800,1207600,1218300,1216130.0,1249022.436820643,1183237.563179357,1252825.742681773,1182610.742681773,1\n20010720 00:00,1211500,1219400,1209200,1214500,1214925.0,1246160.484628864,1183689.515371136,1249281.5449660486,1185516.5449660486,-1\n20010723 00:00,1218000,1218800,1192200,1193600,1213230.0,1245222.0052513124,1181237.9947486876,1248490.524810552,1183285.524810552,-1\n20010724 00:00,1190000,1192000,1167500,1173900,1210860.0,1246878.9616729855,1174841.0383270145,1245365.5938762135,1179155.5938762135,-1\n20010725 00:00,1179200,1194800,1174600,1193000,1209590.0,1246241.597509522,1172938.402490478,1242419.2674753044,1177379.2674753044,-1\n20010726 00:00,1190600,1208500,1185600,1207500,1209310.0,1245935.6139880274,1172684.3860119726,1240064.7737474977,1177949.7737474977,-1\n20010727 00:00,1208300,1216000,1199100,1210000,1208365.0,1243878.4495649184,1172851.5504350816,1239298.7635493234,1178593.7635493234,-1\n20010730 00:00,1211900,1213500,1203000,1208200,1207175.0,1240995.4597839827,1173354.5402160173,1238705.8654335148,1179050.8654335148,-1\n20010731 00:00,1210000,1226800,1201800,1214600,1205955.0,1236717.4755180723,1175192.5244819277,1239831.7353922278,1178976.7353922278,-1\n20010801 00:00,1219700,1227000,1209000,1219600,1204895.0,1232028.7041334205,1177761.2958665795,1241263.6732913808,1179283.6732913808,-1\n20010802 00:00,1232300,1233500,1214600,1223800,1205020.0,1232475.9720279577,1177564.0279720423,1242507.767898551,1180647.767898551,-1\n20010803 00:00,1223600,1223700,1202000,1218700,1206360.0,1233739.7297283958,1178980.2702716042,1242139.647146308,1181629.647146308,-1\n20010806 00:00,1213500,1215100,1201000,1204500,1206535.0,1233820.0343595166,1179249.9656404834,1241976.7442434852,1180836.7442434852,-1\n20010807 00:00,1202700,1215300,1199100,1208300,1207775.0,1232930.9833836802,1182619.0166163198,1241003.5225695025,1181078.5225695025,1\n20010808 00:00,1201200,1211600,1184300,1186500,1207965.0,1232407.8537613756,1183522.1462386244,1239978.266451772,1178883.266451772,1\n20010809 00:00,1187000,1189700,1178600,1187400,1206755.0,1232707.6087320717,1180802.3912679283,1236106.2490119208,1178146.2490119208,1\n20010810 00:00,1188000,1198400,1173400,1194400,1205525.0,1231371.2279646373,1179678.7720353627,1234954.5427568173,1175794.5427568173,1\n20010813 00:00,1196000,1198500,1188200,1194900,1204970.0,1231225.064273393,1178714.935726607,1233138.5545577554,1175418.5545577554,1\n20010814 00:00,1201400,1203500,1188000,1191100,1203690.0,1230028.7850896735,1177351.2149103265,1231758.6922189216,1174878.6922189216,1\n20010815 00:00,1192300,1196100,1181600,1182800,1202280.0,1229891.0557567072,1174668.9442432928,1230068.6580393417,1173428.6580393417,1\n20010816 00:00,1178000,1187500,1170000,1186200,1200675.0,1228105.8494217733,1173244.1505782267,1227762.3175911503,1171827.3175911503,-1\n20010817 00:00,1176500,1178700,1160100,1166400,1198270.0,1228700.9776379268,1167839.0223620732,1225964.8349634218,1167644.8349634218,-1\n20010820 00:00,1168000,1176600,1165500,1175600,1197370.0,1229326.6644066616,1165413.3355933384,1222493.9379827785,1166498.9379827785,-1\n20010821 00:00,1178000,1185400,1080500,1161300,1196740.0,1230940.608181727,1162539.391818273,1223442.372460609,1155627.372460609,-1\n20010822 00:00,1167500,1174300,1157800,1170500,1195615.0,1231663.9819551122,1159566.0180448878,1221016.9877818208,1153861.9877818208,-1\n20010823 00:00,1169600,1175200,1165200,1167000,1193590.0,1231254.8324037157,1155925.1675962843,1218306.0445010124,1153086.0445010124,-1\n20010824 00:00,1172100,1191000,1166500,1190000,1192590.0,1229513.6997062862,1155666.3002937138,1218571.6593104398,1152211.6593104398,-1\n20010827 00:00,1189700,1192000,1182600,1184900,1191425.0,1227770.8869750071,1155079.1130249929,1218594.7155665883,1152399.7155665883,-1\n20010828 00:00,1182800,1184900,1165900,1166400,1189015.0,1225286.5466998583,1152743.4533001417,1216897.3617031036,1151602.3617031036,-1\n20010829 00:00,1171300,1171800,1151700,1154000,1185735.0,1222213.940499965,1149256.059500035,1214665.9859853478,1149055.9859853478,-1\n20010830 00:00,1148500,1159100,1120100,1132800,1181185.0,1220153.411566293,1142216.588433707,1211932.7571613465,1143307.7571613465,-1\n20010831 00:00,1134000,1147700,1131300,1139200,1177210.0,1216279.2666939117,1138140.7333060883,1207887.7326697896,1140072.7326697896,-1\n20010904 00:00,1138500,1167900,1134400,1136500,1173810.0,1214585.9684127795,1133034.0315872205,1206433.345431397,1136248.345431397,-1\n20010905 00:00,1137000,1141900,1119500,1136500,1170220.0,1210860.1574800098,1129579.8425199902,1203211.915707772,1132096.915707772,-1\n20010906 00:00,1126500,1133000,1110900,1111000,1166445.0,1213805.4676919475,1119084.5323080525,1198383.9951641746,1127523.9951641746,-1\n20010907 00:00,1100200,1112500,1086900,1091300,1161640.0,1218139.500882751,1105140.499117249,1193180.6384818722,1120145.6384818722,-1\n20010910 00:00,1077000,1110700,1075500,1098300,1156835.0,1217560.5226408138,1096109.4773591862,1188057.0856105827,1113492.0856105827,-1\n20010917 00:00,1010000,1065100,1000000,1043000,1149240.0,1225126.39930844,1073353.60069156,1183729.3472984638,1095964.3472984638,-1\n20010918 00:00,1043300,1053000,1033600,1039000,1141635.0,1228856.1046708308,1054413.8953291692,1174690.4015240069,1086340.4015240069,-1\n20010919 00:00,1041000,1045000,985600,1020200,1133505.0,1233272.2987506427,1033737.7012493573,1167240.5616963236,1072155.5616963236,-1\n20010920 00:00,1004000,1018500,985700,989600,1123675.0,1238363.166346838,1008986.8336531619,1156918.9208998482,1059283.9208998482,-1\n20010921 00:00,940500,997000,938000,968500,1113780.0,1244976.42678061,982583.5732193899,1146027.555417323,1043457.555417323,-1\n20010924 00:00,997300,1011600,990600,1004800,1105240.0,1241371.4129802524,969108.5870197477,1139626.6771236097,1032256.6771236097,-1\n20010925 00:00,1007500,1020000,999000,1014000,1097875.0,1236983.5601248175,958766.4398751823,1126196.8745404088,1031411.8745404088,-1\n20010926 00:00,1023500,1024000,1004300,1010000,1089850.0,1229789.6798624322,949910.3201375678,1120147.5690286239,1024882.5690286239,-1\n20010927 00:00,1012500,1022500,1000000,1020500,1082525.0,1220872.213560664,944177.7864393359,1115543.951343358,1018403.951343358,-1\n20010928 00:00,1029800,1099200,1025000,1042500,1075150.0,1205275.378001372,945024.6219986278,1118522.5432789112,1013252.5432789112,-1\n20011001 00:00,1039000,1043200,1024200,1040000,1067905.0,1188572.9157854316,947237.0842145685,1116377.0629666338,1009667.0629666338,-1\n20011002 00:00,1040000,1053800,1030700,1053800,1062275.0,1174228.0950889701,950321.9049110299,1115072.9379221925,1007747.9379221925,-1\n20011003 00:00,1046000,1078800,1043500,1073400,1058245.0,1162218.986650508,954271.0133494921,1116577.023199444,1006972.0231994439,-1\n20011004 00:00,1082900,1089700,1043700,1071000,1055155.0,1153609.2832994075,956700.7167005924,1117707.6241645762,1007052.6241645762,-1\n20011005 00:00,1072500,1076200,1055200,1072600,1051825.0,1142913.1084445165,960736.8915554835,1118587.8504346164,1007242.8504346164,-1\n20011008 00:00,1062800,1073000,1058700,1065300,1048265.0,1131021.8311379792,965508.1688620208,1117409.8805519545,1008944.8805519545,-1\n20011009 00:00,1066100,1067500,1056000,1058700,1044375.0,1116851.6134694496,971898.3865305504,1116359.614150181,1009529.614150181,-1\n20011010 00:00,1058000,1085500,1055200,1084000,1043025.0,1111375.7095793453,974674.2904206547,1117850.7223263541,1010315.7223263541,-1\n20011011 00:00,1089500,1103000,1089500,1100100,1043465.0,1113153.313941435,973776.686058565,1120541.4471841617,1013996.4471841617,-1\n20011012 00:00,1091500,1098900,1073000,1094500,1043275.0,1112382.5647089377,974167.4352910623,1121984.523642813,1016654.5236428131,-1\n20011015 00:00,1086300,1094500,1071900,1093000,1045775.0,1118199.8265444937,973350.1734555063,1117940.0848831802,1023965.0848831802,-1\n20011016 00:00,1098000,1106200,1089500,1100600,1048855.0,1125008.6991878925,972701.3008121076,1120386.5450530362,1026816.5450530362,-1\n20011017 00:00,1110700,1111500,1079000,1079000,1051795.0,1127836.6589771686,975753.3410228314,1119914.9296511598,1030379.9296511598,-1\n20011018 00:00,1078200,1081600,1067400,1072100,1055920.0,1126793.735614824,985046.2643851758,1118254.5792081922,1031764.5792081922,-1\n20011019 00:00,1070000,1079200,1060100,1075500,1061270.0,1120064.7310564476,1002475.2689435524,1114937.3573788404,1034432.3573788404,-1\n20011022 00:00,1073000,1094900,1072100,1092600,1065660.0,1119865.844703316,1011454.1552966841,1114543.2836602207,1037083.2836602207,-1\n20011023 00:00,1099600,1106100,1083800,1088000,1069360.0,1118853.207614783,1019866.7923852172,1116242.693152898,1038587.693152898,-1\n20011024 00:00,1089800,1099400,1081200,1087700,1073245.0,1115098.9591914553,1031391.0408085447,1117274.777931987,1039844.7779319871,-1\n20011025 00:00,1074500,1103300,1067400,1103100,1077375.0,1113505.0913367236,1041244.9086632762,1119489.9578114804,1040049.9578114804,1\n20011026 00:00,1099500,1118000,1096400,1107700,1080635.0,1115327.0898765123,1045942.9101234878,1117835.7157976886,1046960.7157976886,-1\n20011029 00:00,1101600,1105500,1080600,1082300,1082750.0,1112006.8282628176,1053493.1717371824,1119116.401594734,1047026.401594734,1\n20011030 00:00,1073500,1077000,1055600,1062000,1083160.0,1110976.9300966156,1055343.0699033844,1117652.6173158705,1045022.6173158705,1\n20011031 00:00,1069000,1078600,1060100,1062700,1082625.0,1111561.2661724004,1053688.7338275996,1115039.8283651527,1044929.8283651527,1\n20011101 00:00,1066000,1090100,1054300,1086700,1083410.0,1111890.442412294,1054929.557587706,1113993.7336002176,1045413.7336002176,1\n20011102 00:00,1084400,1093800,1078700,1090600,1084310.0,1112503.3254512483,1056116.6745487517,1114312.7827811493,1046617.7827811493,1\n20011105 00:00,1101200,1110900,1007400,1105800,1086335.0,1114593.6110769797,1058076.3889230203,1120453.7082305637,1039378.7082305637,1\n20011106 00:00,1103500,1124500,1098500,1122900,1089545.0,1119074.5428342533,1060015.4571657467,1124911.0931609862,1041661.0931609862,1\n20011107 00:00,1117700,1131200,1115600,1119600,1091325.0,1123478.2502245107,1059171.7497754893,1127508.3303202575,1046463.3303202575,1\n20011108 00:00,1128700,1226600,1104500,1123500,1092495.0,1127423.5255915562,1057566.4744084438,1141388.211559598,1044878.2115595981,1\n20011109 00:00,1122500,1129600,1114400,1124400,1093990.0,1131591.1116856935,1056388.8883143065,1143321.1199824936,1048596.1199824936,1\n20011112 00:00,1110000,1126500,1100000,1121600,1095420.0,1134890.6270535446,1055949.3729464554,1145525.4974444783,1050215.4974444783,1\n20011113 00:00,1134400,1144300,1131800,1143900,1097585.0,1142349.685858386,1052820.314141614,1149987.8310211946,1053777.8310211946,-1\n20011114 00:00,1151700,1154000,1137000,1146200,1100945.0,1149548.7231084204,1052341.2768915796,1153001.5693366365,1059116.5693366365,-1\n20011115 00:00,1143700,1151800,1139300,1146000,1104640.0,1155110.7202247006,1054169.2797752994,1156649.3960664805,1063019.3960664805,-1\n20011116 00:00,1150800,1151000,1134000,1143100,1108020.0,1159280.1443618725,1056759.8556381275,1159621.9535839586,1066306.9535839586,-1\n20011119 00:00,1149200,1155700,1144500,1155300,1111155.0,1165815.8991876277,1056494.1008123723,1162558.7516553276,1070773.7516553276,-1\n20011120 00:00,1153700,1158000,1111500,1148100,1114160.0,1169994.1257655208,1058325.8742344792,1166519.822926249,1071104.822926249,-1\n20011121 00:00,1145000,1146700,1135100,1141500,1116850.0,1172509.4466375655,1061190.5533624345,1168252.4588380347,1073617.4588380347,-1\n20011123 00:00,1140400,1186300,1140000,1155200,1119455.0,1177136.555977626,1061773.444022374,1172800.557996317,1076605.557996317,-1\n20011126 00:00,1157500,1163400,1150700,1162200,1122180.0,1182473.0377406878,1061886.9622593122,1175377.211203017,1080517.211203017,-1\n20011127 00:00,1156200,1169000,1140900,1154000,1125765.0,1184656.9442708422,1066873.0557291578,1177993.7466439996,1082983.7466439996,-1\n20011128 00:00,1147400,1151700,1132500,1133400,1129335.0,1180479.3555047866,1078190.6444952134,1178433.3898207615,1084203.3898207615,-1\n20011129 00:00,1136600,1145600,1130000,1144800,1133440.0,1174769.5245556976,1092110.4754443024,1179055.4082505303,1085260.4082505303,1\n20011130 00:00,1144000,1149100,1140200,1143000,1136255.0,1171720.2773850707,1100789.7226149293,1178175.2503219084,1088415.2503219084,1\n20011203 00:00,1136500,1140800,1130100,1133600,1138405.0,1167107.4371787484,1109702.5628212516,1178156.7344182346,1088726.7344182346,1\n20011204 00:00,1139200,1150000,1133500,1150000,1140615.0,1165485.9690201248,1115744.0309798752,1172684.9025688788,1096304.9025688788,1\n20011205 00:00,1156100,1180000,1155600,1176400,1143290.0,1171277.3471411637,1115302.6528588363,1176429.8324829538,1099449.8324829538,1\n20011206 00:00,1173500,1179400,1169300,1173000,1145960.0,1174579.3920270854,1117340.6079729146,1179442.11034172,1103287.11034172,1\n20011207 00:00,1169000,1170900,1157000,1164500,1148010.0,1175760.9567402638,1120259.0432597362,1173653.0601504452,1113413.0601504452,-1\n20011210 00:00,1158500,1163900,1144600,1144600,1149020.0,1174649.5610574977,1123390.4389425023,1174719.8718821488,1113774.8718821488,1\n20011211 00:00,1149000,1157200,1139000,1141900,1150035.0,1172673.928861587,1127396.071138413,1174267.4634489282,1114567.4634489282,1\n20011212 00:00,1145500,1147800,1131100,1142900,1149985.0,1172682.2487319498,1127287.7512680502,1173453.8955014113,1114653.8955014113,1\n20011213 00:00,1134500,1137000,1122800,1123600,1148855.0,1174279.9070794762,1123430.0929205238,1172138.4054536577,1112873.4054536577,-1\n20011214 00:00,1123300,1134900,1120000,1129000,1148005.0,1174851.7856548973,1121158.2143451027,1170933.716045373,1111308.716045373,-1\n20011217 00:00,1129900,1143600,1129000,1139900,1147845.0,1174844.5166623404,1120845.4833376596,1170408.838326766,1111143.838326766,-1\n20011218 00:00,1146300,1151500,1143400,1149300,1147545.0,1174339.0646412596,1120750.9353587404,1171028.1553115183,1111913.1553115183,-1\n20011219 00:00,1140900,1159200,1140000,1155000,1147890.0,1174880.7317425816,1120899.2682574184,1169926.307186612,1114906.307186612,-1\n20011220 00:00,1155000,1158000,1146300,1146900,1148160.0,1174997.2427793916,1121322.7572206084,1170589.158883125,1115764.158883125,-1\n20011221 00:00,1150300,1151000,1142000,1146600,1147730.0,1174377.1837161079,1121082.8162838921,1168111.3421640974,1118881.3421640974,-1\n20011224 00:00,1148300,1150400,1146100,1147300,1146985.0,1172792.2296072245,1121177.7703927755,1167903.9127516437,1119933.9127516437,-1\n20011226 00:00,1146500,1162100,1146500,1152500,1146910.0,1172643.8609617755,1121176.1390382245,1167897.9448705348,1121802.9448705348,-1\n20011227 00:00,1153000,1163300,1152600,1159300,1148205.0,1173694.6429947538,1122715.3570052462,1168385.8786923885,1123895.8786923885,-1"
  },
  {
    "path": "Tests/TestData/spy_sortino.csv",
    "content": "time,open,high,low,close,returns,numerator_rf_0_period_15,numerator_rf_0.01_period_15,downside_returns_0,downside_returns_0.01,squared_downside_return_0,squared_downside_return_0.01,denominator_rf_0_period_15,denominator_rf_0.01_period_15,sortino_rf_0_period_15,sortino_rf_0.01_period_15\n2020-11-17T14:30:00Z,460.17,462.00,433.01,441.61,,,,,,,,,,,\n2020-11-18T14:30:00Z,448.35,496.00,443.50,486.64,0.1019677996,,,0,0,0,0,,,,\n2020-11-19T14:30:00Z,492.00,508.61,487.57,499.27,0.0259534769,,,0,0,0,0,,,,\n2020-11-20T14:30:00Z,497.99,502.50,489.06,489.61,-0.01934824844,,,-0.01934824844,-0.02934824844,0.0003743547178,0.0008613196867,,,,\n2020-11-23T14:30:00Z,503.50,526.00,501.79,521.85,0.06584832826,,,0,0,0,0,,,,\n2020-11-24T14:30:00Z,540.40,559.99,526.20,555.38,0.06425217975,,,0,0,0,0,,,,\n2020-11-25T14:30:00Z,550.06,574.00,545.37,574.00,0.0335265944,,,0,0,0,0,,,,\n2020-11-27T14:30:00Z,581.16,598.78,578.45,585.76,0.02048780488,,,0,0,0,0,,,,\n2020-11-30T14:30:00Z,602.21,607.80,554.51,567.60,-0.03100245834,,,-0.03100245834,-0.04100245834,0.0009611524234,0.00168120159,,,,\n2020-12-01T14:30:00Z,597.59,597.85,572.05,584.76,0.03023255814,,,0,0,0,0,,,,\n2020-12-02T14:30:00Z,556.44,571.54,541.21,568.82,-0.02725904645,,,-0.02725904645,-0.03725904645,0.0007430556132,0.001388236542,,,,\n2020-12-03T14:30:00Z,590.02,598.97,582.43,593.38,0.04317710348,,,0,0,0,0,,,,\n2020-12-04T14:30:00Z,591.01,599.04,585.50,599.04,0.009538575618,,,0,-0.0004614243824,0,0.0000002129124606,,,,\n2020-12-07T14:30:00Z,604.92,648.79,603.05,641.76,0.07131410256,,,0,0,0,0,,,,\n2020-12-08T14:30:00Z,625.51,651.28,618.50,649.88,0.01265270506,,,0,0,0,0,,,,\n2020-12-09T14:30:00Z,653.69,654.32,588.00,604.48,-0.0698590509,0.0220988283,0.0120988283,-0.0698590509,-0.0798590509,0.004880286993,0.006377468011,0.02153887918,0.02621505769,1.025997134,0.4615220935\n2020-12-10T14:30:00Z,574.37,627.75,566.34,627.07,0.03737096347,0.01779237256,0.007792372559,0,0,0,0,0.02153887918,0.02621505769,0.8260584224,0.2972479654\n2020-12-11T14:30:00Z,615.01,624.00,596.80,609.99,-0.02723778844,0.0142462882,0.004246288203,-0.02723778844,-0.03723778844,0.0007418971194,0.001386652888,0.02265795941,0.02792262121,0.6287542469,0.1520734092\n2020-12-14T14:30:00Z,619.00,642.75,610.20,639.83,0.04891883473,0.01879742708,0.008797427081,0,0,0,0,0.02210036523,0.02687473652,0.850548255,0.3273493333\n2020-12-15T14:30:00Z,643.28,646.90,623.80,633.25,-0.01028398168,0.01372193975,0.003721939752,-0.01028398168,-0.02028398168,0.0001057602792,0.0004114399129,0.02225930881,0.02738029931,0.6164584835,0.1359349549\n2020-12-16T14:30:00Z,628.23,632.50,605.00,622.77,-0.01654954599,0.008335158036,-0.001664841964,-0.01654954599,-0.02654954599,0.0002738874726,0.0007048783924,0.02266574493,0.02822539076,0.3677425145,-0.05898384113\n2020-12-17T14:30:00Z,628.19,658.82,619.50,655.90,0.05319780979,0.009646572395,-0.0003534276055,0,0,0,0,0.02266574493,0.02822539076,0.4256013832,-0.01252161958\n2020-12-18T14:30:00Z,668.90,695.00,628.54,695.00,0.05961274585,0.01225490179,0.002254901792,0,0,0,0,0.02266574493,0.02822539076,0.5406794186,0.07988912578\n2020-12-21T14:30:00Z,666.24,668.50,646.07,649.86,-0.06494964029,0.009991756329,-0.000008243670526,-0.06494964029,-0.07494964029,0.004218455774,0.005617448579,0.02703496902,0.03254364991,0.3695863798,-0.0002533111851\n2020-12-22T14:30:00Z,648.00,649.88,614.23,640.34,-0.01464930908,0.006999631848,-0.003000368152,-0.01464930908,-0.02464930908,0.0002146022566,0.0006075884382,0.02729828506,0.03316014242,0.2564128784,-0.09048116001\n2020-12-23T14:30:00Z,632.20,651.50,622.57,645.98,0.008807820845,0.009404089667,-0.0005959103325,0,-0.001192179155,0,0.000001421291137,0.02637535452,0.03173548007,0.3565483701,-0.01877741667\n2020-12-24T14:30:00Z,642.99,666.09,641.00,661.77,0.02444348122,0.008155181517,-0.001844818483,0,0,0,0,0.02637535452,0.03173548007,0.3091970388,-0.0581311037\n2020-12-28T14:30:00Z,674.51,681.40,660.80,663.69,0.002901310123,0.007712697151,-0.002287302849,0,-0.007098689877,0,0.00005039139797,0.02637535452,0.0317881413,0.2924206059,-0.0719545955\n2020-12-29T14:30:00Z,661.00,669.90,655.00,665.99,0.003465473338,0.003189455202,-0.006810544798,0,-0.006534526662,0,0.00004270003869,0.02637535452,0.03183288546,0.120925586,-0.2139468257\n2020-12-30T14:30:00Z,672.00,696.60,668.36,694.78,0.04322887731,0.005227866686,-0.004772133314,0,0,0,0,0.02637535452,0.03183288546,0.1982102906,-0.1499120562\n2020-12-31T14:30:00Z,699.99,718.72,691.12,705.67,0.01567402631,0.01093007183,0.0009300718332,0,0,0,0,0.01924335886,0.02425217645,0.5679918934,0.03835003572\n2021-01-04T14:30:00Z,719.46,744.49,717.19,729.77,0.03415194071,0.01071547032,0.0007154703156,0,0,0,0,0.01924335886,0.02425217645,0.5568399153,0.02950128279\n2021-01-05T14:30:00Z,723.66,740.84,719.20,735.11,0.007317373967,0.01301914781,0.00301914781,0,-0.002682626033,0,0.000007196482432,0.017912204,0.0222756437,0.7268311487,0.1355358279\n2021-01-06T14:30:00Z,758.49,774.00,749.10,755.98,0.02839030893,0.01165057942,0.001650579423,0,0,0,0,0.017912204,0.0222756437,0.6504269058,0.07409794506\n2021-01-07T14:30:00Z,777.63,816.99,775.20,816.04,0.0794465462,0.01763261462,0.007632614615,0,0,0,0,0.01771429837,0.02165121185,0.9953888234,0.3525259772\n2021-01-08T14:30:00Z,856.00,884.49,838.39,880.02,0.07840301946,0.02396278565,0.01396278565,0,0,0,0,0.01719119548,0.0205373582,1.393898736,0.6798725284\n2021-01-11T14:30:00Z,849.40,854.43,803.62,811.19,-0.0782141315,0.01520198956,0.00520198956,-0.0782141315,-0.0882141315,0.006117450366,0.007781732996,0.02652107137,0.03066863677,0.5732042024,0.1696191976\n2021-01-12T14:30:00Z,831.00,868.00,827.34,849.44,0.04715294814,0.01437133638,0.00437133638,0,0,0,0,0.02652107137,0.03066863677,0.5418837038,0.1425344208\n2021-01-13T14:30:00Z,852.76,860.47,832.00,854.41,0.005850913543,0.0190913733,0.009091373302,0,-0.004149086457,0,0.00001721491843,0.02054596898,0.02381630473,0.9292028678,0.3817289628\n2021-01-14T14:30:00Z,843.39,863.00,838.75,845.00,-0.01101344788,0.01933376405,0.009333764049,-0.01101344788,-0.02101344788,0.0001212960341,0.0004415649917,0.02039402919,0.02358279333,0.948011002,0.3957870435\n2021-01-15T14:30:00Z,852.00,859.90,819.10,826.16,-0.02229585799,0.01726018546,0.00726018546,-0.02229585799,-0.03229585799,0.0004971052834,0.001043022443,0.02119095984,0.02501176159,0.8145070158,0.2902708565\n2021-01-19T14:30:00Z,837.80,850.00,833.00,844.55,0.02225961073,0.01711459409,0.007114594094,0,0,0,0,0.02119095984,0.02501176159,0.8076365688,0.2844499404\n2021-01-20T14:30:00Z,858.74,859.50,837.28,850.45,0.006985968859,0.01738690468,0.007386904676,0,-0.003014031141,0,0.000009084383718,0.02119095984,0.02495665076,0.8204868873,0.2959894238\n2021-01-21T14:30:00Z,855.00,855.72,841.42,844.99,-0.006420130519,0.01672786442,0.006727864419,-0.006420130519,-0.01642013052,0.00004121807588,0.0002696206863,0.0212556969,0.02525791876,0.7869826381,0.2663665396\n2021-01-22T14:30:00Z,834.31,848.00,828.62,846.64,0.001952685831,0.01397611832,0.00397611832,0,-0.008047314169,0,0.00006475926534,0.0212556969,0.02534323863,0.6575234107,0.1568906949\n2021-01-25T14:30:00Z,855.00,900.40,838.82,880.80,0.04034772749,0.01562103173,0.005621031732,0,0,0,0,0.0212556969,0.02534323863,0.734910354,0.2217961095\n2021-01-26T14:30:00Z,891.38,895.90,871.60,883.09,0.002599909173,0.01351756296,0.003517562963,0,-0.007400090827,0,0.00005476134424,0.0212556969,0.02541516281,0.6359501186,0.138404109\n2021-01-27T14:30:00Z,870.35,891.50,858.66,864.16,-0.02143609372,0.01160066512,0.001600665117,-0.02143609372,-0.03143609372,0.0004595061138,0.0009882279881,0.02196448022,0.02667081928,0.5281556859,0.06001559609\n2021-01-28T14:30:00Z,820.00,848.00,801.00,835.43,-0.03324615812,0.007491567314,-0.002508432686,-0.03324615812,-0.04324615812,0.00110530703,0.001870230192,0.02358231386,0.0289139173,0.3176773645,-0.08675520026\n2021-01-29T14:30:00Z,830.00,842.41,780.10,793.53,-0.05015381301,-0.001148456633,-0.01114845663,-0.05015381301,-0.06015381301,0.002515404959,0.003618481219,0.02690388802,0.03282143652,-0.04268738527,-0.3396699784\n2021-02-01T14:30:00Z,814.29,842.00,795.56,839.81,0.05832167656,-0.002487212827,-0.01248721283,0,0,0,0,0.02690388802,0.03282143652,-0.09244808128,-0.3804590582\n2021-02-02T14:30:00Z,844.68,880.50,842.20,872.79,0.03927078744,0.005345115102,-0.004654884898,0,0,0,0,0.01777608411,0.02363185341,0.300691371,-0.1969750242\n2021-02-03T14:30:00Z,877.02,878.08,853.06,854.69,-0.02073809278,0.0008190457076,-0.009180954292,-0.02073809278,-0.03073809278,0.0004300684923,0.0009448303479,0.01856503162,0.02492896278,0.04411765755,-0.3682846484\n2021-02-04T14:30:00Z,855.00,856.50,833.42,849.99,-0.005499069838,0.00006238014884,-0.009937619851,-0.005499069838,-0.01549906984,0.00003023976909,0.0002402211658,0.01861924767,0.02522538936,0.003350304478,-0.3939530807\n2021-02-05T14:30:00Z,845.00,864.77,838.97,852.23,0.002635325121,0.0009722983487,-0.009027701651,0,-0.007364674879,0,0.00005423843607,0.0184008147,0.02470826781,0.05283996196,-0.3653716934\n2021-02-08T14:30:00Z,869.67,877.77,854.75,863.42,0.01313025826,0.003334039432,-0.006665960568,0,0,0,0,0.01747711731,0.02325862568,0.1907659812,-0.286601653\n2021-02-09T14:30:00Z,855.12,859.80,841.75,849.46,-0.0161682611,0.0007721813101,-0.00922781869,-0.0161682611,-0.0261682611,0.000261412667,0.0006847778891,0.01796878239,0.02422014715,0.04297349111,-0.3809976312\n2021-02-10T14:30:00Z,843.64,844.82,800.02,804.82,-0.05255103242,-0.003196952109,-0.01319695211,-0.05255103242,-0.06255103242,0.002761611008,0.003912631657,0.02251631722,0.02910072186,-0.1419837924,-0.4534922595\n2021-02-11T14:30:00Z,812.44,829.88,801.73,811.66,0.008498794762,-0.00220235709,-0.01220235709,0,-0.001501205238,0,0.000002253617168,0.02245521475,0.02879283837,-0.09807775676,-0.4237983395\n2021-02-12T14:30:00Z,801.26,817.33,785.33,816.12,0.005494911663,-0.001966208701,-0.0119662087,0,-0.004505088337,0,0.00002029582093,0.02245521475,0.02874131716,-0.08756134035,-0.416341695\n2021-02-16T14:30:00Z,818.00,821.00,792.44,796.22,-0.02438366907,-0.006281635138,-0.01628163514,-0.02438366907,-0.03438366907,0.0005945633172,0.001182236699,0.02332111112,0.03008120828,-0.2693540246,-0.5412560222\n2021-02-17T14:30:00Z,779.09,799.84,762.01,798.15,0.002423953179,-0.006293365538,-0.01629336554,0,-0.007576046821,0,0.00005739648544,0.02332111112,0.03008412817,-0.2698570195,-0.5415934092\n2021-02-18T14:30:00Z,780.90,794.69,776.27,787.38,-0.01349370419,-0.005763872903,-0.0157638729,-0.01349370419,-0.02349370419,0.0001820800528,0.0005519541366,0.02292115078,0.02959678774,-0.2514652496,-0.532621075\n2021-02-19T14:30:00Z,795.00,796.79,777.37,781.30,-0.007721811578,-0.0040622498,-0.0140622498,-0.007721811578,-0.01772181158,0.00005962637404,0.0003140626056,0.02134636056,0.02778894274,-0.1903017513,-0.5060375967\n2021-02-22T14:30:00Z,762.64,768.50,710.20,714.50,-0.08549852809,-0.006418564139,-0.01641856414,-0.08549852809,-0.09549852809,0.007309998306,0.009119968868,0.02784432915,0.03374894342,-0.2305160273,-0.4864912046\n2021-02-23T14:30:00Z,662.13,713.61,619.00,698.84,-0.02191742477,-0.01176783756,-0.02176783756,-0.02191742477,-0.03191742477,0.0004803735087,0.001018722004,0.02841358067,0.03474055242,-0.4141624281,-0.6265829426\n2021-02-24T14:30:00Z,711.85,745.00,694.17,742.02,0.061788106,-0.01026668299,-0.02026668299,0,0,0,0,0.02841358067,0.03474055242,-0.3613301368,-0.5833725022\n2021-02-25T14:30:00Z,726.15,737.21,670.58,682.22,-0.08059081965,-0.01425686478,-0.02425686478,-0.08059081965,-0.09059081965,0.006494880213,0.008206696606,0.03480879699,0.04112214001,-0.4095764868,-0.5898736003\n2021-02-26T14:30:00Z,700.00,706.70,659.51,675.50,-0.009850194952,-0.01454693979,-0.02454693979,-0.009850194952,-0.01985019495,0.00009702634059,0.0003940302396,0.03487269399,0.0412466282,-0.4171441356,-0.5951259742\n2021-03-01T14:30:00Z,690.11,719.00,685.05,718.43,0.06355292376,-0.01048576655,-0.02048576655,0,0,0,0,0.03487269399,0.04120277226,-0.3006870232,-0.4971938883\n2021-03-02T14:30:00Z,718.28,721.11,685.00,686.44,-0.04452765057,-0.01432962714,-0.02432962714,-0.04452765057,-0.05452765057,0.001982711665,0.002973264677,0.0367190082,0.04354177404,-0.390250931,-0.5587651783\n2021-03-03T14:30:00Z,687.99,700.70,651.71,653.20,-0.04842375153,-0.01647999316,-0.02647999316,-0.04842375153,-0.05842375153,0.002344859712,0.003413334743,0.03856399919,0.04558278049,-0.4273413938,-0.5809209723\n2021-03-04T14:30:00Z,655.80,668.50,600.00,621.44,-0.04862216779,-0.01621806886,-0.02621806886,-0.04862216779,-0.05862216779,0.002364115201,0.003436558556,0.03821887378,0.04523330267,-0.4243471158,-0.5796187169\n2021-03-05T14:30:00Z,626.06,627.84,539.49,597.95,-0.03779930484,-0.01930460883,-0.02930460883,-0.03779930484,-0.04779930484,0.001428787446,0.002284773543,0.03944533951,0.04688517533,-0.4894015128,-0.6250293109\n2021-03-08T14:30:00Z,600.55,620.13,558.79,563.00,-0.05844970315,-0.02356758315,-0.03356758315,-0.05844970315,-0.06844970315,0.003416367799,0.004685361862,0.04223378579,0.05009215576,-0.5580267719,-0.670116561\n2021-03-09T14:30:00Z,608.18,678.09,595.21,673.58,0.1964120782,-0.008847866669,-0.01884786667,0,0,0,0,0.04176188583,0.04929917128,-0.2118646343,-0.3823160954\n2021-03-10T14:30:00Z,700.30,717.85,655.06,669.59,-0.005923572553,-0.009404368384,-0.01940436838,-0.005923572553,-0.01592357255,0.00003508871179,0.0002535601628,0.04178988341,0.0494316282,-0.2250393544,-0.3925496507"
  },
  {
    "path": "Tests/TestData/spy_sr.txt",
    "content": "time,open,high,low,close,Volume,Volume MA,SR_10\n2020-11-17T14:30:00Z,460.17,462,433.01,441.61,61188281,30180491,0.1440941293739855\n2020-11-18T14:30:00Z,448.35,496,443.5001,486.64,78044024,32464169.15,0.36158342967615115\n2020-11-19T14:30:00Z,492,508.6112,487.57,499.27,62475346,33588276.9,0.33224673239685143\n2020-11-20T14:30:00Z,497.99,502.5,489.06,489.61,32911922,33548024,0.3299575098901586\n2020-11-23T14:30:00Z,503.5,526,501.79,521.85,50260304,34649081.15,0.5223367788471587\n2020-11-24T14:30:00Z,540.4,559.99,526.2,555.38,53648494,36197180.55,0.760706913215649\n2020-11-25T14:30:00Z,550.06,574,545.37,574,48930162,37371118.2,0.8076943764233607\n2020-11-27T14:30:00Z,581.16,598.78,578.45,585.76,37561078,38116406.7,0.9487177415231541\n2020-11-30T14:30:00Z,602.21,607.8,554.51,567.6,63003052,39137177.35,0.8216171309889051\n2020-12-01T14:30:00Z,597.59,597.85,572.05,584.76,40382832,39705263.05,0.9327089055675304\n2020-12-02T14:30:00Z,556.44,571.54,541.21,568.82,47775653,40376459.95,0.6406259918432791\n2020-12-03T14:30:00Z,590.02,598.97,582.43,593.38,42552003,40896907.25,0.612411268815947\n2020-12-04T14:30:00Z,591.01,599.04,585.5,599.04,29401314,40946246.8,0.5619341868329836\n2020-12-07T14:30:00Z,604.9197,648.7856,603.05,641.76,56309709,42676431.55,0.8147304172204625\n2020-12-08T14:30:00Z,625.505,651.28,618.5,649.88,64265029,44148031.75,0.7056161571063808\n2020-12-09T14:30:00Z,653.69,654.32,588,604.48,71291190,46198380.05,0.23663747268029475\n2020-12-10T14:30:00Z,574.37,627.75,566.34,627.07,67083153,48684651.6,0.24485509308244677\n2020-12-11T14:30:00Z,615.01,624,596.8,609.99,46474974,50011375.3,0.12009316326095966\n2020-12-14T14:30:00Z,619,642.7499,610.2001,639.83,52040649,51621890.2,0.3161547604019086\n2020-12-15T14:30:00Z,643.28,646.9,623.8,633.25,45223559,52541136.4,0.2162736582356367\n2020-12-16T14:30:00Z,628.23,632.5,605,622.77,42095813,51586513,0.24751522688828648\n2020-12-17T14:30:00Z,628.19,658.82,619.5,655.9,56270144,50497819,0.26633305190222123\n2020-12-18T14:30:00Z,668.9,695,628.54,695,222126194,58480361.4,0.3661608202407233\n2020-12-21T14:30:00Z,666.24,668.5,646.07,649.86,58045264,59737028.5,0.050516408899428836\n2020-12-22T14:30:00Z,648,649.88,614.23,640.34,51861644,59817095.5,-0.009756689009538626\n2020-12-23T14:30:00Z,632.2,651.4999,622.5701,645.98,33172972,58793319.4,0.19007650089496927\n2020-12-24T14:30:00Z,642.99,666.09,641,661.77,22865568,57490089.7,0.16028934776830983\n2020-12-28T14:30:00Z,674.51,681.4,660.8,663.69,32278561,57225963.85,0.2494803844860087\n2020-12-29T14:30:00Z,661,669.9,655,665.99,22910811,55221351.8,0.13458427427144976\n2020-12-30T14:30:00Z,672,696.6,668.3603,694.78,42846021,55344511.25,0.2796184577329051\n2020-12-31T14:30:00Z,699.99,718.72,691.12,705.67,49649928,55438225,0.38201344460183123\n2021-01-04T14:30:00Z,719.46,744.4899,717.1895,729.77,48638189,55742534.3,0.34460350009530677\n2021-01-05T14:30:00Z,723.66,740.84,719.2,735.11,32245165,55884726.85,0.21221789173057876\n2021-01-06T14:30:00Z,758.49,774,749.1,755.98,44699965,55304239.65,0.9378256086061927\n2021-01-07T14:30:00Z,777.63,816.99,775.2,816.04,51498948,54665935.6,1.107682027605073\n2021-01-08T14:30:00Z,856,884.49,838.39,880.02,75055528,54854152.5,1.1878133310510421\n2021-01-11T14:30:00Z,849.4,854.43,803.6222,811.19,59554146,54477702.15,0.5044624432494265\n2021-01-12T14:30:00Z,831,868,827.34,849.44,46270720,54467489.45,0.6064274970161481\n2021-01-13T14:30:00Z,852.76,860.47,832,854.41,33312496,53531081.8,0.6137292319466389\n2021-01-14T14:30:00Z,843.39,863,838.75,845,31266327,52833220.2,0.47606842953835615\n2021-01-15T14:30:00Z,852,859.9,819.1,826.16,38777596,52667309.35,0.37262757106835187\n2021-01-19T14:30:00Z,837.8,850,833,844.55,25366980,51122151.15,0.3488347278419764\n2021-01-20T14:30:00Z,858.74,859.5,837.28,850.45,25665883,41299135.6,0.3480512135979892\n2021-01-21T14:30:00Z,855,855.7199,841.4201,844.99,20598133,39426779.05,0.269496733330148\n2021-01-22T14:30:00Z,834.31,848,828.62,846.64,20066497,37837021.7,0.11332952100887304\n2021-01-25T14:30:00Z,855,900.4,838.8201,880.8,41173397,38237042.95,0.019734432534883068\n2021-01-26T14:30:00Z,891.38,895.9,871.6,883.09,23131603,38250344.7,0.4198328684557451\n2021-01-27T14:30:00Z,870.35,891.5,858.66,864.16,27333955,38003114.4,0.10365178114495162\n2021-01-28T14:30:00Z,820,848,801,835.43,26378048,38176476.25,-0.09698693503427784\n2021-01-29T14:30:00Z,830.0003,842.41,780.1,793.53,34990754,37783712.9,-0.23393981994375024\n2021-02-01T14:30:00Z,814.29,842,795.5601,839.81,25391385,36570785.75,0.06824414920675173\n2021-02-02T14:30:00Z,844.68,880.5,842.2006,872.79,24346213,35356186.95,0.11736496552575758\n2021-02-03T14:30:00Z,877.02,878.08,853.0646,854.69,18343510,34661104.2,0.03147921436891805\n2021-02-04T14:30:00Z,855,856.5,833.42,849.99,15812661,33216739,0.03426099140404068\n2021-02-05T14:30:00Z,845,864.77,838.97,852.23,18566637,31570123.45,0.03630655376051695\n2021-02-08T14:30:00Z,869.67,877.77,854.75,863.42,20161719,28825433,-0.04866433474444558\n2021-02-09T14:30:00Z,855.12,859.8,841.75,849.46,15157651,26605608.25,-0.10818099694515063\n2021-02-10T14:30:00Z,843.635,844.82,800.02,804.82,36216090,26102876.75,-0.18918131918768752\n2021-02-11T14:30:00Z,812.44,829.8799,801.725,811.66,21622753,25518389.6,-0.06967022082183509\n2021-02-12T14:30:00Z,801.26,817.33,785.3306,816.12,23768313,25143488.9,0.11044283497218557\n2021-02-16T14:30:00Z,818,821,792.44,796.22,19802324,24194725.3,-0.211679340441236\n2021-02-17T14:30:00Z,779.09,799.84,762.01,798.15,26078898,24230321.2,-0.45898046109724744\n2021-02-18T14:30:00Z,780.9,794.69,776.27,787.38,17957058,23844879.95,-0.4284403315260756\n2021-02-19T14:30:00Z,795,796.7899,777.37,781.3,18958255,23762886.05,-0.44077762792460323\n2021-02-22T14:30:00Z,762.64,768.5,710.2,714.5,37269716,24623047,-0.5822794527798194\n2021-02-23T14:30:00Z,662.13,713.6099,619,698.84,66606882,25894721.25,-0.7475973043053032\n2021-02-24T14:30:00Z,711.85,745,694.17,742.02,36766950,26576488.6,-0.34418897023339323\n2021-02-25T14:30:00Z,726.15,737.2066,670.58,682.22,39023855,27160983.6,-0.38104000857905806\n2021-02-26T14:30:00Z,700,706.7,659.51,675.5,41089173,27896539.85,-0.43364841810712945\n2021-03-01T14:30:00Z,690.11,719,685.05,718.43,27136239,27503814.1,-0.24810941384468957\n2021-03-02T14:30:00Z,718.28,721.11,685,686.44,23732158,27420852.75,-0.28557854674125926\n2021-03-03T14:30:00Z,687.99,700.7,651.705,653.2,30207960,27713940.1,-0.3865537474637406\n2021-03-04T14:30:00Z,655.8,668.5,600,621.44,65919530,30092741.1,-0.4521087046555055\n2021-03-05T14:30:00Z,626.06,627.8419,539.49,597.95,89396459,33771931,-0.5140085031884993\n2021-03-08T14:30:00Z,600.55,620.125,558.79,563,51786958,35432947.05,-0.48591409636614935\n2021-03-09T14:30:00Z,608.18,678.09,595.21,673.58,67523328,37801027.5,-0.008102798833163222\n2021-03-10T14:30:00Z,700.3,717.85,655.06,669.59,58329337,39959611.8,-0.09558007456640351"
  },
  {
    "path": "Tests/TestData/spy_stc.txt",
    "content": "time,open,high,low,close,STC\n725898600,43.9688,43.96899,43.75,43.938,0\n728577000,43.96875,45.125,42.8125,44.40625,0\n730996200,44.5625,45.84375,44.21875,45.1875,0\n733674600,45.25,45.25,43.28125,44.03125,0\n736435800,44.09375,45.65625,43.84375,45.21875,0\n738941400,45.375,45.8125,44.21875,45.0625,0\n741533400,45.125,45.21875,44.15625,44.84375,0\n744298200,44.90625,46.5625,44.84375,46.5625,0\n746890200,46.40625,46.59375,44.8125,45.9375,0\n749482200,45.875,47.15625,45.71875,46.84375,0\n752164200,46.78125,47,45.53125,46.34375,0\n754756200,46.59375,47.15625,46.375,46.59375,0\n757607400,46.59375,48.3125,46.40625,48.21875,0\n760113000,48.15625,48.28125,46.5625,46.8125,0\n762532200,46.8125,47.3125,43.53125,44.59375,0\n765210600,43.34375,45.35937,43.34375,45.09375,0\n767885400,45.09375,45.9375,44.17187,45.8125,0\n770477400,45.70312,46.5625,44,44.46875,0\n773069400,44.6875,46.04687,44.375,45.90625,0\n775747800,45.9375,47.98437,45.65625,47.65625,0\n778426200,47.5,47.71875,45.73437,46.17187,0\n781191000,46.20312,47.70312,45,47.48437,0\n783700200,47.28125,47.32812,44.60937,45.59375,50\n786292200,45.64062,46.40625,44.6875,45.5625,75\n789057000,45.70312,47.23437,45.6875,47.09375,87.5\n791649000,47.15625,49.15625,47,49.01562,93.75\n794068200,48.96875,50.89062,48.21875,50.10937,96.875\n796915800,50.09375,51.67187,50.0625,51.59375,98.4375\n799335000,51.54687,53.64062,51.39062,53.64062,99.21875\n802013400,53.40625,55.15625,52.75,54.40625,99.609375\n804778200,54.46875,56.70312,54.20312,56.15625,99.8046875\n807283800,56.23437,56.79687,55.42187,56.40625,99.90234375\n809962200,56.39062,58.90625,56.34375,58.48437,99.95117188\n812640600,58.48437,59.1875,57.26562,58.3125,99.97558594\n815236200,58.28125,61.20312,58.23437,60.90625,99.98779297\n817828200,60.98437,62.79687,60.57812,61.48437,99.99389648\n820506600,61.40625,63.6875,59.64062,63.67187,99.99694824\n823185000,63.60937,66.6875,63.4375,63.875,99.99847412\n825690600,64.64062,66,62,64.6875,99.99923706\n828369000,65,65.8125,62.125,65.39062,99.99961853\n830957400,65.375,68.4375,63.07812,66.875,99.99980927\n833808600,66.89062,68.5,66.15625,67.10937,99.99990463\n836227800,67.28125,67.70312,60.375,64.09375,99.99995232\n838906200,64.15625,67.34375,64.0625,65.32812,99.99997616\n841671000,64.46875,69.25,64.375,68.625,99.99998808\n844176600,68.70312,71.625,68.4375,70.84375,99.99999404\n846858600,70.98437,76.6875,70.26562,76.01562,99.99999702\n849537000,75.92187,76.57812,71.875,73.84375,99.99999851\n852129000,74.375,79.6875,72.75,78.40625,99.99999925\n854980200,78.71875,82,77.125,79.15625,49.99999963\n857399400,78.75,81.79687,75.6875,75.6875,24.99999981\n859905000,75.25,80.6875,73.3125,80.09375,12.49999991\n862493400,80.21875,85.5625,79.3125,85.15625,6.249999953\n865258200,85.34375,90.5,84.07812,88.3125,3.124999977\n867763800,88.5,96.03125,88.39062,95.3125,1.562499988\n870442200,95.5,96.625,89.34375,90.375,0.7812499942\n873120600,90.6875,96.375,90.25,94.375,0.5651073338\n875712600,95.25,98.5,84.375,92.0625,0.6420252541\n878567400,93.1875,96.8125,90.09375,95.625,50.32101263\n880986600,96.21875,99,92.375,97.0625,75.16050631\n883665000,97.3125,99.5625,90.90625,98.3125,87.58025316\n886429800,99.90625,105.53125,99.71875,105.125,93.79012658\n888849000,105.25,111.53125,103.15625,109.9375,96.89506329\n891441000,110.3125,113.4375,107.625,111.34375,98.44753164\n894029400,111.75,113.3125,107.57812,109.03125,99.22376582\n896707800,108.96875,114.6875,107.5,113.3125,99.61188291\n899299800,114.0625,119.23437,111.3125,111.78125,99.80594146\n902151000,111.78125,112.42187,95,96,90.72960849\n904656600,96.0625,107,93.625,101.75,55.47564138\n907248600,100.03125,110.90625,92.21875,110,27.73782069\n910017000,110.8125,119.71875,110.1875,116.125,15.41509039\n912522600,116.125,124.75,113.75,123.3125,33.67425981\n915201000,123.375,128.29687,120.375,127.65625,55.0141118\n917879400,128.6875,128.84375,121.32812,123.5625,71.78917144\n920298600,123.65625,132.625,121.78125,128.375,83.22926808\n922977000,129.6875,137.5,128.125,133.25,90.47559981\n925738200,133.4375,138,128,130.20312,95.23779991\n928243800,130.125,137.5,128.01562,137,97.61889995\n930835800,137,142.25,132.5625,132.75,98.80944998\n933600600,132.75,138.78125,127,132.0625,99.40472499\n936192600,132.9375,136.625,125.5625,128.75,86.09490582\n938784600,127.9375,137.6875,123.4375,137,74.7899551\n941466600,136.5,143,134.59375,139.39062,71.04939646\n944058600,139.3125,147.5625,139,146.875,77.71214847\n946909800,148.25,148.25,135,139.625,76.39195277\n949415400,139.75,144.5625,132.71875,137.4375,38.19597638\n951921000,137.625,155.75,135.03125,150.375,44.23709009\n954768600,150.125,153.10937,133.5,145.09375,59.82719789\n957187800,146.5625,148.48437,136.5,142.8125,29.91359894\n959866200,143.6875,149.15625,143,145.28125,14.95679947\n962631000,145.4375,151.98437,141.51562,142.90625,7.478399736\n965136600,143.625,153.09375,142.625,152.34375,3.739199868\n967815000,153.25,153.59375,142.125,143.625,1.869599934\n970493400,144.28125,145.75,130.15625,142.95312,0.934799967\n973089000,142.25,144.29687,129.75,132.28125,0.4673999835\n975681000,133.1875,139.5625,125.53125,131.1875,0.2336999917\n978445800,132,138.7,127.5625,137.02,0.1168499959\n981037800,137.10001,137.99001,121.8,123.95,0.05842499794\n983457000,124.05,127.75,108.03999,116.69,0.02921249897\n986218200,116.3,127.27,109.3,124.91,0.01460624948\n988723800,125.07001,132.09,123.44,125.95,0.007303124742\n991402200,126.2,129.23,120.39999,122.60001,0.003651562371\n994080600,122.8,124.32001,116.75,121.35001,0.001825781185\n996672600,121.97,123.25,112.03999,114.14999,0.0009128905927\n999610200,113.85001,116.17,93.8,104.44,0.0004564452964\n1001943000,103.89999,111.78999,102.83,105.8,0.0002282226482\n1004625000,106.60001,116.89999,105.69901,114.05,0.0001141113241\n1007389800,113.64999,118,112,114.3,0.00005705566205\n1009981800,115.11,117.99001,108.39999,113.17999,0.00002852783102\n1012573800,113.09,113.3,107.82001,111.14999,0.00001426391551\n1014993000,111.72,117.907,111.50999,114.52,0.000007131957756\n1017671400,114.23,115.10001,106.63,107.86,0.000003565978878\n1020259800,107.97,111.25,104.89999,107.22,0.000001782989439\n1023111000,107.09,107.60001,95.19501,98.96001,8.91E-07\n1025530200,99.187,99.8,77.67999,91.16,4.46E-07\n1028208600,90.88,97.14999,83.55,91.78,2.23E-07\n1031059800,90.735,93.33,80.00999,81.78999,1.11E-07\n1033479000,82.438,91.28999,77.07001,88.52,5.57E-08\n1036161000,88.35001,94.95,87.45,93.98,2.79E-08\n1038839400,95.47,96.05,87.11,88.23,1.39E-08\n1041517800,88.85001,93.86,84.14999,86.06,6.96E-09\n1044282600,86.14,86.817,81,84.89999,3.48E-09\n1046701800,85.25999,89.88,79.383,84.74001,1.74E-09\n1049207400,85.25,92.8,84.91,91.91,8.71E-10\n1051795800,91.92,97.09,90.5,96.95,50\n1054560600,97.53,102.179,96.67,97.63,75\n1057066200,97.25301,101.89999,96.42999,99.39,87.5\n1059744600,99.19,101.81799,96.34,101.44,93.75\n1062509400,101.64,104.7,99.25,99.95,96.875\n1065015000,100.24001,105.97,100.2,105.3,98.4375\n1067869800,105.75,106.95,103.62,106.45,99.21875\n1070289000,106.92999,111.52,105.96001,111.28,99.609375\n1073053800,111.74001,116.5,110.73,113.48,99.8046875\n1075732200,113.7,116.60001,112.78,115.02,99.90234375\n1078151400,115.42999,116.97,108.85001,113.10001,99.95117188\n1080829800,113.07001,115.41,110.89999,110.96001,99.97558594\n1083591000,111.37,113.25999,108.06,112.86,99.98779297\n1086096600,112.46001,114.94,111.87,114.53,99.99389648\n1088688600,114.25,114.39999,108.21001,110.84,99.99694824\n1091453400,110.19,113.61,106.59,111.11,99.99847412\n1094045400,110.94,113.74001,110.41,111.75999,99.99923706\n1096637400,112.25999,114.67999,109.35001,113.2,99.99961853\n1099319400,113.56,119.14,113.2,117.89,99.99980927\n1101911400,118.16,121.66,117.73,120.87,99.99990463\n1104762600,121.56,121.75999,116.37,118.16,99.99995232\n1107268200,118.25,121.67,118.10001,120.63,99.99997616\n1109687400,120.78,123.25,116.25,117.96001,99.99998808\n1112365800,118.63,119.25999,113.55,115.75,99.99999404\n1115040600,116.07001,120.25,114.8,119.48,99.99999702\n1117632600,119.52,121.94,118.75,119.17999,99.99999851\n1120224600,119.45,124.64,118.25999,123.74001,99.99999925\n1122903000,123.83,124.74001,120.38,122.58,99.99999963\n1125581400,122.50999,124.74001,120.44,123.03999,99.99999981\n1128346200,122.96001,123.34,116.88,120.13,99.99999991\n1130855400,120.58,127.41,120.13,125.41,99.99999995\n1133447400,126.02,128.57001,124.36,124.50999,99.99999998\n1136298600,125.10001,129.44,124.39,127.5,99.99999999\n1138804200,127.82001,130.03999,123.64,128.23,99.99999999\n1141223400,128.60001,131.47,127.17999,129.83,100\n1144071000,130.07001,131.86,128.02,131.47,100\n1146490200,131.47,132.8,124.75999,127.50999,100\n1149168600,127.38,129.42999,122.34,127.23,100\n1151933400,127.42999,128.14,122.39,127.85001,100\n1154439000,127.34,131.03999,126.28,130.64,100\n1157117400,131.14,133.99001,129.35001,133.58,100\n1159795800,133.53999,139,132.34,137.78999,100\n1162391400,138.22,141.16,135.62,140.53,100\n1164983400,140.53,143.24001,138.97,141.62,100\n1167834600,142.25,144.13,140.25,143.75,100\n1170340200,144.14999,146.42,139,140.92999,100\n1172759400,139.34,143.81,136.75,142,100\n1175520600,142.16,149.8,140.89,148.28999,100\n1178026200,148.42,153.89,147.67,153.32001,100\n1180704600,153.88,154.39999,148.06,150.42999,100\n1183383000,150.87,156,145.03999,145.72,100\n1185975000,145.17999,150.59,137,147.59,100\n1188912600,147.45,154.39,144.33,152.58,100\n1191245400,152.60001,157.52,148,154.64999,100\n1193923800,153.28999,153.41,140.66,148.66,50\n1196692200,148.19,152.89,143.96001,146.21001,25\n1199284200,146.53,146.99001,126,137.37,12.5\n1201876200,137.94,139.61,131.73,133.82001,6.25\n1204554600,133.14,135.81,126.07001,131.97,3.125\n1207056600,133.71001,140.59,132.33,138.25999,1.5625\n1209648600,138.39,144.3,137.52,140.35001,0.78125\n1212413400,139.83,140.89,127.035,127.98,0.390625\n1214919000,126.52,129.16,120.02,126.83,0.1953125\n1217597400,127.12,131.50999,124.75999,128.78999,0.09765625\n1220362200,130.03,130.71001,110.5321,115.99001,0.048828125\n1222867800,115.27,116.69,83.58,96.83,0.0244140625\n1225722600,96.78,100.86,74.34,90.09,0.01220703125\n1228141800,87.50999,92.42999,81.86,90.24001,0.006103515625\n1230906600,90.44,94.5533,80.05,82.83,0.003051757812\n1233585000,81.57001,87.74001,73.81,73.92999,0.001525878906\n1236004200,72.52,83.3,67.10001,79.52,0.0007629394531\n1238592600,78.53,89.02,78.33,87.42,0.0003814697266\n1241184600,87.44,93.7,86.72,92.53,0.0001907348633\n1243863000,93.67,96.11,87.53,91.95,0.00009536743164\n1246455000,92.34,99.83,87,98.81,0.00004768371582\n1249306200,99.85001,104.35001,98.11501,102.46001,50.00002384\n1251811800,101.95,108.06,99.57001,105.59,75.00001192\n1254403800,105.34,110.31,101.99001,103.56,87.50000596\n1257172200,104.13,111.74001,103.08,109.94,93.75000298\n1259677800,110.92,113.03,105.476,111.44,96.87500149\n1262615400,112.37,115.14,107.22,107.39,98.43750075\n1265034600,108.14999,111.58,104.58,110.74001,99.21875037\n1267453800,111.2,118.1666,111.17,117,99.60937519\n1270128600,117.8,122.12,117.10001,118.8125,99.80468759\n1272893400,119.38,120.67999,104.38,109.369,99.9023438\n1275399000,108.35001,113.2,102.88,103.22,99.81575967\n1277991000,103.14999,112.28999,101.13,110.27,99.90787983\n1280755800,111.99001,113.17999,104.28999,105.31,99.95393992\n1283347800,106.73,115.78999,106.66,114.13,99.97696996\n1285939800,114.99001,119.75999,113.17999,118.49001,99.98848498\n1288618200,119.07001,122.95,117.59,118.49249,99.99424249\n1291213800,120.2,126.2,120.19,125.75,99.99712124\n1294065000,126.71001,130.35001,125.6969,128.67999,99.99856062\n1296570600,129.46001,134.69,129.3801,133.14999,99.99928031\n1298989800,133.57001,133.69,125.28,132.59,99.99964016\n1301664600,133.41,136.57001,129.50999,136.42999,99.99982008\n1304343000,137.07001,137.17999,131.38,134.89999,99.99991004\n1306935000,134.50999,134.9234,126.19,131.97,99.99995502\n1309527000,132.09,135.7,127.96671,129.33,99.99997751\n1312205400,130.84,130.96001,110.27,122.22,49.99998875\n1314883800,122.28999,123.39999,111.3,113.14999,24.99999438\n1317648600,112.49001,129.42,107.42999,125.5,12.49999719\n1320154200,122.03,128.02,116.2,124.99001,6.249998594\n1322749800,124.85001,127.25999,120.03,125.5,4.77006344\n1325601000,127.75999,133.39999,126.42999,131.32001,28.20837878\n1328106600,132.28999,138.19,132.13,137.02,52.01667792\n1330612200,137.31,141.83,134.36,140.81,69.96539821\n1333373400,140.64,142.21001,135.75999,139.87,81.96204372\n1335879000,139.78999,141.66,129.55,131.47,90.98102186\n1338557400,129.41,136.27,127.13499,136.105,95.49051093\n1341235800,136.48,139.339,132.60001,137.71001,97.74525547\n1343827800,138.7,143.09,135.58,141.16,98.87262773\n1346765400,141.03999,148.11,140.13,143.97,99.43631387\n1349098200,144.52,147.16,140.39,141.35001,99.71815693\n1351776600,141.64999,143.72,134.7,142.155,99.85907847\n1354545000,142.8,145.58,139.53999,142.41,99.92953923\n1357137000,145.11,150.94,144.73,149.7,99.96476962\n1359729000,150.64999,153.28,148.73,151.61,99.98238481\n1362148200,151.09,156.85001,150.41,156.67,99.9911924\n1364823000,156.59,159.72,153.55,159.67999,99.9955962\n1367415000,159.33,169.07001,158.10001,163.44501,99.9977981\n1370266200,163.83,165.99001,155.73,160.42,99.99889905\n1372685400,161.25999,169.86,160.22,168.71001,99.99944953\n1375363800,169.99001,170.9725,163.05,163.64999,99.99972476\n1378215000,165.23,173.60001,163.7,168.00999,99.99986238\n1380634200,168.14,177.51,164.53,175.79,99.99993119\n1383312600,176.02,181.75,174.76,181,99.9999656\n1385994600,181.09,184.69,177.32,184.69,99.9999828\n1388673000,183.98,184.94,176.88,178.18,99.9999914\n1391437800,177.95,187.15,173.71,186.29,99.9999957\n1393857000,184.69,189.0239,183.75,187.01,99.99999785\n1396359000,187.62,189.7,181.31,188.31,99.99999892\n1398951000,188.22,192.8,186.01,192.68,99.99999946\n1401715800,192.95,196.6,191.97,195.72,99.99999973\n1404221400,196.19,199.06,192.97,193.09,99.99999987\n1406899800,192.56,200.82,190.55,200.71,99.99999993\n1409664600,200.97,201.899,196.05,197.02,99.99999997\n1412170200,196.7,201.82,181.92,201.66,99.99999998\n1415025000,201.92,207.87,200.06,207.2,99.99999999\n1417444200,206.4,212.97,197.86,205.54,100\n1420209000,206.38,206.88,198.55,199.45,50\n1422887400,200.05,212.24,197.86,210.66,50.00000001\n1425306600,210.78,212.06,204.12,206.43,62.50000001\n1427895000,206.39,212.48,204.51,208.46,75.00000002\n1430487000,209.4,213.78,206.76,211.14,84.37500002\n1433165400,211.94,213.34,205.28,205.85,42.18750001\n1435757400,207.73,213.18,204.11,210.5,21.09375001\n1438608600,210.46,211.31,182.4,197.67,10.546875\n1441114200,193.12,202.89,186.93,191.63,5.273437501\n1443706200,192.08,209.44,189.12,207.93,2.636718751\n1446474600,208.32,211.66,202.18,208.69,1.318359375\n1448980200,209.44,211,199.83,203.87,0.6591796877\n1451917800,200.49,201.9,181.02,193.7208,0.3295898438\n1454337000,192.53,196.68,181.09,193.56,0.1647949219\n1456842600,195.01,206.87,194.4542,205.52,0.08239746096\n1459517400,204.35,210.92,203.09,206.3308,0.04119873048\n1462195800,206.92,210.69,202.78,209.84,0.02059936524\n1464787800,209.12,212.52,198.65,209.475,0.01029968262\n1467379800,209.36,217.54,207.06,217.12,8.055798934\n1470058200,217.19,219.6,214.25,217.38,39.33012963\n1472736600,217.37,219.22,212.31,216.3,69.66506482\n1475501400,215.82,216.7,211.21,212.55,59.61754483\n1478007000,212.93,221.82,208.38,220.38,79.80877241\n1480602600,220.73,228.34,219.15,223.53,89.90438621\n1483453800,225.04,229.71,223.8837,227.53,94.9521931\n1485959400,228.255,237.31,226.82,236.47,97.47609655\n1488378600,238.39,240.32,231.61,235.74,98.73804828\n1491226200,235.8,239.53,232.51,238.08,99.36902414\n1493645400,238.68,242.08,235.43,241.44,99.68451207\n1496323800,241.97,245.01,239.955,241.8,99.84225603\n1499088600,242.88,248,240.34,246.77,99.92112802\n1501594200,247.46,248.91,241.83,247.49,99.96056401\n1504272600,247.92,251.32,244.95,251.23,99.980282\n1506951000,251.49,257.89,251.2926,257.15,99.990141\n1509543000,258.04,266.05,255.63,265.01,99.9950705\n1512138600,264.76,268.6,260.76,266.86,99.99753525\n1514903400,267.84,286.6285,267.4,281.9,99.99876763\n1517495400,281.07,283.06,252.92,271.65,99.99938381\n1519914600,271.41,280.41,257.83,263.15,99.99969191\n1522675800,262.55,271.3,254.67,264.51,99.99984595\n1525181400,263.87,274.25,259.05,270.94,99.99992298\n1527859800,272.41,279.48,268.49,271.28,99.99996149\n1530538200,269.51,284.37,269.24,281.33,99.99998074\n1533130200,281.56,291.74,279.16,290.31,99.99999037\n1536067800,289.84,293.94,286.71,290.72,99.99999519\n1538400600,292.11,293.21,259.85,270.63,49.99999759\n1541079000,271.6,281.22,263.07,275.65,24.9999988\n1543847400,280.28,280.4,233.76,249.92,12.4999994\n1546439400,245.98,270.47,243.67,269.93,6.249999699\n1549031400,270.15,281.31,267.83,278.68,3.12499985\n1551450600,280.44,285.18,272.42,282.48,1.562499925\n1554125400,284.7,294.45,284.4,294.02,3.61841958\n1556717400,294.72,294.95,275.24,275.27,1.927238874\n1559568600,275.31,296.3093,273.09,293,2.004220563\n1561987800,296.68,302.23,294.33,297.43,7.206892152\n1564666200,297.6,300.87,281.72,292.45,14.831625\n1567517400,290.57,302.63,289.27,296.77,57.4158125\n1569936600,297.74,304.55,284.82,303.33,78.70790625\n1572615000,304.92,315.48,304.74,314.31,89.35395313\n1575297000,314.59,323.8,307.13,321.86,94.67697656\n1577975400,323.54,332.95,320.36,321.73,97.33848828\n1580740200,323.35,339.08,285.54,296.26,94.02843598\n1583159400,298.21,313.84,218.26,257.75,67.73908043\n1585747800,247.98,294.88,243.9,290.48,37.8700447\n1588339800,285.31,306.84,276.37,304.32,18.93502235\n1591018200,303.62,323.41,296.74,308.36,9.467511176\n1593610200,309.57,327.23,309.07,326.52,9.003587296\n1596461400,328.32,351.3,327.73,349.31,22.69778676\n1598967000,350.21,358.75,319.8,334.89,41.61746731\n1601559000,337.69,354.02,322.6,326.54,58.29043346\n1604327400,330.2,364.38,327.24,362.06,78.15353008\n1606833000,365.57,378.46,362.03,373.88,89.07676504\n1609770600,375.31,385.85,364.82,370.07,94.53838252\n1612189800,373.72,394.17,370.376,380.36,97.26919126\n1614609000,385.59,398.12,371.88,396.33,98.63459563\n1617283800,398.4,420.72,398.18,417.3,99.31729781\n1620048600,419.43,422.815,404,420.04,99.65864891\n1622554200,422.57,428.78,414.7,428.06,99.82932445\n1625146200,428.87,441.8,421.97,438.51,99.91466223\n1627911000,440.34,453.07,436.1,451.56,99.95733111\n1630503000,452.56,454.05,428.78,429.14,99.97866556\n1633095000,430.98,459.56,426.36,459.25,99.98933278\n1635773400,460.3,473.54,455.3,455.56,99.99466639\n1638369000,461.64,479,448.92,474.96,99.99733319\n1641220200,476.3,479.98,420.76,449.91,99.9986666\n1643725800,450.68,458.12,410.64,436.63,49.9993333\n1646145000,435.04,462.07,415.12,451.64,27.17443367\n1648819800,453.31,457.83,411.21,412,13.58721684\n1651498200,412.07,429.66,380.54,412.93,6.793608418\n1654090200,415.17,417.44,362.17,377.25,3.396804209\n1656682200,376.56,413.03,371.04,411.99,1.698402104\n1659360600,409.15,431.73,395.04,395.18,0.8492010522\n1662039000,392.89,411.73,357.04,357.18,0.4246005261\n1664803800,361.08,389.52,348.11,386.21,0.212300263\n1667309400,390.14,407.68,368.79,407.68,0.1061501315\n1669905000,408.77,410.49,374.77,382.43,0.05307506576\n1672756200,384.37,408.16,377.831,406.48,0.02653753288\n1675261800,405.211,418.31,393.64,396.26,0.01326876644\n1677681000,395.41,409.7,380.65,409.39,0.00663438322\n1680528600,408.85,411.92,405.678,409.61,0.00331719161"
  },
  {
    "path": "Tests/TestData/spy_swiss.txt",
    "content": "Date,Open,High,Low,Close,Last,Gauss,Butter,HP,2PHP,BP,BS\n06/16/2006 12:00:00 AM,125.19,125.56,124.46,125.01,124.65,18.26,18.19,-0.06,-1.06,0.06,9.72\n06/19/2006 12:00:00 AM,125.4,125.48,123.55,124.515,123.67,40.75,40.72,-0.36,-1.5,-0.02,29.4\n06/20/2006 12:00:00 AM,124.01,124.81,123.72,124.265,124.09,61.53,61.57,-0.42,-1.33,0.04,57.15\n06/21/2006 12:00:00 AM,124,125.7,123.96,124.83,125.01,78.71,78.71,0.05,-0.68,-0.01,90.36\n06/22/2006 12:00:00 AM,124.95,125.06,124.04,124.55,124.46,91.96,91.96,-0.14,-0.74,0.04,124.01\n06/23/2006 12:00:00 AM,124.33,125.3,124.03,124.665,124.44,101.8,101.79,-0.03,-0.47,-0.02,156.04\n06/26/2006 12:00:00 AM,124.54,125.06,124.25,124.655,124.99,108.89,108.88,-0.03,-0.35,0.05,183.02\n06/27/2006 12:00:00 AM,125.01,125.29,123.77,124.53,123.91,113.88,113.89,-0.1,-0.31,-0.03,202.7\n06/28/2006 12:00:00 AM,124.19,124.77,123.65,124.21,124.75,117.29,117.35,-0.28,-0.34,0.03,213.58\n06/29/2006 12:00:00 AM,125.2,127.35,125.17,126.26,127.27,119.91,119.75,1.1,0.83,0.03,217.61\n06/30/2006 12:00:00 AM,127.47,127.66,126.96,127.31,127.23,121.99,121.59,1.47,0.67,0.12,211.75\n07/03/2006 12:00:00 AM,127.43,128.01,127.31,127.66,127.8,123.61,123.1,1.29,0.18,0.06,197.56\n07/05/2006 12:00:00 AM,127.29,127.45,126.52,126.985,127.07,124.72,124.3,0.51,-0.52,0.1,176.61\n07/06/2006 12:00:00 AM,127.2,127.85,127.08,127.465,127.44,125.55,125.2,0.68,-0.16,0.05,153.34\n07/07/2006 12:00:00 AM,127.19,127.56,126.29,126.925,126.61,126.06,125.83,0.15,-0.49,0.09,128.05\n07/10/2006 12:00:00 AM,126.94,127.43,126.41,126.92,126.85,126.38,126.25,0.1,-0.29,0.02,104.71\n07/11/2006 12:00:00 AM,126.61,127.41,125.94,126.675,127.41,126.55,126.5,-0.08,-0.28,0.08,84.67\n07/12/2006 12:00:00 AM,127.21,127.4,125.72,126.56,126.05,126.61,126.63,-0.13,-0.18,0,69.96\n07/13/2006 12:00:00 AM,125.5,125.68,124,124.84,124,126.38,126.61,-1.19,-0.88,0.01,59.96\n07/14/2006 12:00:00 AM,124.16,124.26,122.83,123.545,123.52,125.88,126.36,-1.69,-0.81,-0.09,57.14\n07/17/2006 12:00:00 AM,123.5,124.1,123.15,123.625,123.34,125.36,125.9,-1.18,-0.01,-0.02,62.13\n07/18/2006 12:00:00 AM,123.75,124.05,122.39,123.22,123.97,124.84,125.38,-1.11,0.06,-0.09,72.18\n07/19/2006 12:00:00 AM,124.18,126.26,124.15,125.205,125.69,124.7,124.95,0.46,1.22,0.04,88.78\n07/20/2006 12:00:00 AM,126.12,126.3,124.66,125.48,124.83,124.76,124.76,0.51,0.67,-0.02,106.17\n07/21/2006 12:00:00 AM,125.15,125.19,123.82,124.505,123.95,124.75,124.75,-0.25,-0.23,0.01,123.11\n07/24/2006 12:00:00 AM,124.44,126.32,124.44,125.38,126.21,124.83,124.78,0.37,0.34,-0.02,140.95\n07/25/2006 12:00:00 AM,125.98,127.3,125.72,126.51,126.66,125.11,124.88,0.99,0.63,0.08,156.48\n07/26/2006 12:00:00 AM,126.59,127.45,126.18,126.815,126.83,125.47,125.13,0.91,0.25,0.02,167.41\n07/27/2006 12:00:00 AM,127.33,127.69,126.2,126.945,126.71,125.82,125.47,0.75,-0.01,0.08,173.65\n07/28/2006 12:00:00 AM,126.99,128.14,126.86,127.5,127.98,126.2,125.83,0.9,0.09,0.03,175.5\n07/31/2006 12:00:00 AM,127.68,127.96,127.45,127.705,127.85,126.56,126.19,0.78,-0.05,0.1,172.33\n08/01/2006 12:00:00 AM,127.34,127.38,126.6,126.99,127.22,126.76,126.52,0.11,-0.53,0.01,164.23\n08/02/2006 12:00:00 AM,127.58,128.46,127.55,128.005,128.08,127.02,126.78,0.73,0.18,0.1,154.77\n08/03/2006 12:00:00 AM,127.33,128.55,127.15,127.85,128.42,127.24,127.01,0.43,-0.13,0.03,142.21\n08/04/2006 12:00:00 AM,129.06,129.43,127.48,128.455,128.2,127.5,127.25,0.7,0.14,0.11,129.79\n08/07/2006 12:00:00 AM,127.9,128.08,127.4,127.74,127.95,127.64,127.47,0.05,-0.41,0.02,116.72\n08/08/2006 12:00:00 AM,128.09,128.46,126.95,127.705,127.41,127.7,127.62,0.02,-0.24,0.08,106.15\n08/09/2006 12:00:00 AM,128.2,128.6,126.61,127.605,126.98,127.71,127.69,-0.05,-0.17,0.01,98.21\n08/10/2006 12:00:00 AM,126.53,127.5,126.28,126.89,127.37,127.59,127.68,-0.49,-0.41,0.05,92.94\n08/11/2006 12:00:00 AM,127.17,127.2,126.39,126.795,127.01,127.43,127.58,-0.42,-0.15,-0.02,91.82\n08/14/2006 12:00:00 AM,127.63,128.16,126.92,127.54,127.11,127.39,127.46,0.17,0.38,0.07,94.9\n08/15/2006 12:00:00 AM,128.21,128.87,127.9,128.385,128.63,127.51,127.43,0.66,0.57,0.03,100.99\n08/16/2006 12:00:00 AM,129.34,129.89,129.04,129.465,129.79,127.85,127.57,1.17,0.67,0.12,109.53\n08/17/2006 12:00:00 AM,129.58,130.37,129.49,129.93,130.03,128.28,127.87,1.14,0.32,0.07,118.85\n08/18/2006 12:00:00 AM,130.19,130.69,129.59,130.14,130.69,128.72,128.28,0.97,0.02,0.13,128.41\n08/21/2006 12:00:00 AM,130.18,130.28,129.8,130.04,130.13,129.08,128.7,0.64,-0.25,0.06,137.24\n08/22/2006 12:00:00 AM,129.94,130.52,129.68,130.1,130.12,129.36,129.06,0.5,-0.24,0.12,145.01\n08/23/2006 12:00:00 AM,130.18,130.44,129.19,129.815,129.76,129.54,129.34,0.18,-0.36,0.04,150.56\n08/24/2006 12:00:00 AM,129.99,130.1,129.4,129.75,129.65,129.64,129.52,0.09,-0.25,0.1,154.01\n08/25/2006 12:00:00 AM,129.64,130.25,129.55,129.9,129.81,129.71,129.63,0.16,-0.07,0.03,155.16\n08/28/2006 12:00:00 AM,129.65,130.82,129.64,130.23,130.43,129.82,129.72,0.33,0.09,0.1,154.02\n08/29/2006 12:00:00 AM,130.49,130.83,129.81,130.32,130.58,129.93,129.82,0.3,0.03,0.04,150.45\n08/30/2006 12:00:00 AM,130.87,131.04,130.55,130.795,130.66,130.1,129.94,0.52,0.18,0.11,145.57\n08/31/2006 12:00:00 AM,130.85,130.99,130.58,130.785,130.64,130.26,130.1,0.37,-0.02,0.04,139.11\n09/01/2006 12:00:00 AM,131.14,131.58,130.84,131.21,131.42,130.47,130.27,0.54,0.12,0.11,132.67\n09/05/2006 12:00:00 AM,131.51,131.85,131.2,131.525,131.67,130.7,130.47,0.59,0.1,0.06,126.39\n09/06/2006 12:00:00 AM,131.12,131.16,130.33,130.745,130.51,130.79,130.66,-0.07,-0.45,0.09,119.91\n09/07/2006 12:00:00 AM,130.06,130.57,129.62,130.095,129.91,130.73,130.75,-0.46,-0.53,0.01,114.98\n09/08/2006 12:00:00 AM,130.08,130.46,129.83,130.145,130.28,130.62,130.72,-0.3,-0.15,0.07,112.46\n09/11/2006 12:00:00 AM,129.86,130.69,129.48,130.085,130.41,130.5,130.61,-0.26,-0.03,0,111.67\n09/12/2006 12:00:00 AM,130.56,131.84,130.37,131.105,131.69,130.54,130.54,0.46,0.53,0.09,113.73\n09/13/2006 12:00:00 AM,131.64,132.45,131.52,131.985,132.22,130.77,130.59,0.9,0.6,0.05,117.17\n09/14/2006 12:00:00 AM,131.96,132.24,131.75,131.995,132.23,131.03,130.78,0.66,0.13,0.11,120.96\n09/15/2006 12:00:00 AM,132.31,132.39,131.68,132.035,131.96,131.28,131.03,0.5,-0.06,0.05,125.6\n09/18/2006 12:00:00 AM,131.79,132.39,131.65,132.02,132.14,131.48,131.27,0.36,-0.15,0.1,130.51\n09/19/2006 12:00:00 AM,132.12,132.13,131.07,131.6,131.81,131.58,131.46,-0.01,-0.35,0.02,134.88\n09/20/2006 12:00:00 AM,132.25,132.77,132.06,132.415,132.51,131.74,131.59,0.51,0.21,0.11,139.86\n09/21/2006 12:00:00 AM,132.61,132.75,131.42,132.085,131.87,131.85,131.72,0.16,-0.15,0.03,142.73\n09/22/2006 12:00:00 AM,131.67,131.68,131,131.34,131.47,131.82,131.81,-0.36,-0.47,0.06,144\n09/25/2006 12:00:00 AM,131.73,132.85,131.05,131.95,132.48,131.82,131.83,0.13,0.13,0.02,145.32\n09/26/2006 12:00:00 AM,132.5,133.6,132.4,133,133.58,132,131.87,0.76,0.55,0.11,145.71\n09/27/2006 12:00:00 AM,133.49,133.97,133.27,133.62,133.74,132.3,132.03,0.95,0.42,0.06,144.45\n09/28/2006 12:00:00 AM,133.74,133.99,133.28,133.635,133.69,132.61,132.3,0.7,0.02,0.12,141.65\n09/29/2006 12:00:00 AM,133.8,133.94,133.48,133.71,133.58,132.89,132.6,0.56,-0.1,0.06,138.33\n10/02/2006 12:00:00 AM,133.54,133.83,132.95,133.39,133.08,133.07,132.87,0.2,-0.33,0.1,134.38\n10/03/2006 12:00:00 AM,132.89,133.87,132.65,133.26,133.36,133.17,133.05,0.06,-0.27,0.03,130.77\n10/04/2006 12:00:00 AM,133.23,135,133.08,134.04,134.92,133.33,133.18,0.54,0.22,0.11,128.49\n10/05/2006 12:00:00 AM,134.92,135.41,134.75,135.08,135.18,133.65,133.37,1.06,0.5,0.08,127.13\n10/06/2006 12:00:00 AM,134.95,135.1,134.4,134.75,135.01,133.93,133.64,0.56,-0.12,0.12,125.28\n10/09/2006 12:00:00 AM,134.85,135.3,134.64,134.97,135.09,134.19,133.93,0.54,-0.07,0.06,124.98\n10/10/2006 12:00:00 AM,135.11,135.45,134.84,135.145,135.27,134.43,134.19,0.51,-0.07,0.12,125.6\n10/11/2006 12:00:00 AM,134.84,135.43,134.3,134.865,135.11,134.58,134.41,0.19,-0.27,0.05,126.64\n10/12/2006 12:00:00 AM,135.45,136.39,135.4,135.895,136.28,134.83,134.61,0.79,0.31,0.14,129.67\n10/13/2006 12:00:00 AM,136.16,136.71,136.04,136.375,136.63,135.15,134.85,0.88,0.23,0.09,132.58\n10/16/2006 12:00:00 AM,136.52,137.05,136.42,136.735,136.84,135.51,135.16,0.87,0.11,0.15,135.55\n10/17/2006 12:00:00 AM,136.47,136.7,135.67,136.185,136.41,135.74,135.48,0.28,-0.39,0.07,137.57\n10/18/2006 12:00:00 AM,137.05,137.37,136.1,136.735,136.59,135.98,135.74,0.56,0,0.14,140.4\n10/19/2006 12:00:00 AM,136.39,136.88,136.23,136.555,136.81,136.15,135.96,0.29,-0.2,0.07,142.01\n10/20/2006 12:00:00 AM,136.81,136.95,136.33,136.64,136.84,136.29,136.14,0.26,-0.12,0.12,143.25\n10/23/2006 12:00:00 AM,136.56,137.8,136.39,137.095,137.47,136.46,136.3,0.48,0.11,0.07,144.15\n10/24/2006 12:00:00 AM,137.28,137.93,137.22,137.575,137.88,136.69,136.47,0.66,0.19,0.14,144.35\n10/25/2006 12:00:00 AM,137.74,138.41,137.51,137.96,138.35,136.96,136.7,0.72,0.15,0.08,143.81\n10/26/2006 12:00:00 AM,138.66,139,137.98,138.49,138.78,137.29,136.97,0.86,0.18,0.15,142.88\n10/27/2006 12:00:00 AM,138.61,138.75,137.63,138.19,137.91,137.54,137.27,0.43,-0.23,0.08,140.79\n10/30/2006 12:00:00 AM,137.66,138.2,137.4,137.8,137.81,137.68,137.51,0.07,-0.4,0.12,138.49\n10/31/2006 12:00:00 AM,138.07,138.26,137.25,137.755,137.79,137.74,137.66,0.02,-0.24,0.05,136.6\n11/01/2006 12:00:00 AM,138.22,138.31,136.72,137.515,136.86,137.73,137.72,-0.14,-0.24,0.1,134.74\n11/02/2006 12:00:00 AM,136.51,137.01,136.36,136.685,136.78,137.58,137.7,-0.63,-0.48,0.01,132.69\n11/03/2006 12:00:00 AM,137.27,137.39,136.2,136.795,136.54,137.4,137.57,-0.39,-0.06,0.07,132.06\n11/06/2006 12:00:00 AM,136.96,138.28,136.95,137.615,138.08,137.37,137.44,0.24,0.45,0.04,132.6\n11/07/2006 12:00:00 AM,138.2,138.98,138,138.49,138.61,137.52,137.41,0.73,0.61,0.12,133.64\n11/08/2006 12:00:00 AM,138,139.05,137.79,138.42,138.91,137.71,137.53,0.49,0.13,0.05,134.16\n11/09/2006 12:00:00 AM,139.01,139.14,137.9,138.52,138.18,137.9,137.71,0.42,0.01,0.11,135.21\n11/10/2006 12:00:00 AM,138.14,138.34,137.72,138.03,138.24,137.99,137.87,-0.01,-0.32,0.03,135.95\n11/13/2006 12:00:00 AM,138.18,139.04,138.07,138.555,138.58,138.11,138,0.33,0.08,0.1,137.82\n11/14/2006 12:00:00 AM,138.97,139.74,138.12,138.93,139.62,138.27,138.12,0.48,0.15,0.05,139.5\n11/15/2006 12:00:00 AM,139.57,140.45,139.53,139.99,140.02,138.59,138.31,1.02,0.49,0.13,141.69\n11/16/2006 12:00:00 AM,140.44,140.68,140.1,140.39,140.38,138.97,138.6,1,0.23,0.08,142.94\n11/17/2006 12:00:00 AM,139.93,140.43,139.73,140.08,140.42,139.28,138.95,0.53,-0.24,0.12,143.19\n11/20/2006 12:00:00 AM,140.3,140.74,139.94,140.34,140.5,139.55,139.27,0.55,-0.12,0.07,143.68\n11/21/2006 12:00:00 AM,140.49,140.67,140.29,140.48,140.64,139.79,139.54,0.49,-0.11,0.12,143.71\n11/22/2006 12:00:00 AM,140.75,141.16,140.5,140.83,140.92,140.03,139.79,0.58,0.01,0.07,143.63\n11/24/2006 12:00:00 AM,140.24,140.84,140.2,140.52,140.35,140.2,140.01,0.22,-0.26,0.11,142.65\n11/27/2006 12:00:00 AM,140.28,140.35,138.38,139.365,138.42,140.14,140.14,-0.57,-0.73,0.02,140.71\n11/28/2006 12:00:00 AM,138.24,139.16,138.11,138.635,139.02,139.9,140.09,-0.88,-0.6,0.05,139.17\n11/29/2006 12:00:00 AM,139.47,140.53,139.08,139.805,140.47,139.79,139.93,0.1,0.45,0.03,139.52\n11/30/2006 12:00:00 AM,140.44,141.05,139.76,140.405,140.53,139.84,139.83,0.46,0.51,0.1,139.32\n12/01/2006 12:00:00 AM,140.53,140.66,138.97,139.815,140.22,139.86,139.83,-0.04,-0.11,0.02,138.08\n12/04/2006 12:00:00 AM,140.25,141.55,140.23,140.89,141.29,140.01,139.89,0.65,0.46,0.11,138.7\n12/05/2006 12:00:00 AM,141.56,141.96,141.26,141.61,141.9,140.31,140.05,0.93,0.45,0.07,139.14\n12/06/2006 12:00:00 AM,141.87,142.07,141.5,141.785,141.78,140.63,140.31,0.79,0.11,0.12,139.26\n12/07/2006 12:00:00 AM,142.03,142.3,141.11,141.705,141.16,140.92,140.62,0.52,-0.15,0.06,139.37\n12/08/2006 12:00:00 AM,141.13,141.9,140.78,141.34,141.42,141.08,140.89,0.15,-0.37,0.1,139.41\n12/11/2006 12:00:00 AM,141.42,142.09,141.34,141.715,141.83,141.24,141.08,0.35,-0.04,0.05,140.36\n12/12/2006 12:00:00 AM,141.68,141.87,140.89,141.38,141.72,141.32,141.22,0.04,-0.25,0.09,140.68\n12/13/2006 12:00:00 AM,142.23,142.34,141.56,141.95,141.87,141.44,141.33,0.39,0.14,0.05,141.93\n12/14/2006 12:00:00 AM,141.86,143.24,141.84,142.54,143.12,141.65,141.47,0.66,0.28,0.12,143.13\n12/15/2006 12:00:00 AM,142.64,142.89,142.24,142.565,142.34,141.86,141.65,0.49,0.02,0.06,143.65\n12/18/2006 12:00:00 AM,142.54,142.88,141.75,142.315,141.95,142.01,141.85,0.2,-0.21,0.1,143.76\n12/19/2006 12:00:00 AM,141.55,142.56,141.19,141.875,142.22,142.05,141.98,-0.13,-0.36,0.03,143.55\n12/20/2006 12:00:00 AM,142.28,142.66,142.01,142.335,142.14,142.1,142.05,0.2,0.06,0.09,144.07\n12/21/2006 12:00:00 AM,142.27,142.43,141.32,141.875,141.62,142.09,142.09,-0.15,-0.22,0.02,143.49\n12/22/2006 12:00:00 AM,141.64,141.65,140.67,141.16,140.75,141.95,142.06,-0.57,-0.42,0.05,142.56\n12/26/2006 12:00:00 AM,140.81,141.61,140.78,141.195,141.58,141.79,141.94,-0.39,-0.08,0,142.27\n12/27/2006 12:00:00 AM,141.87,142.6,141.83,142.215,142.51,141.79,141.83,0.37,0.54,0.08,142.85\n12/28/2006 12:00:00 AM,142.41,142.7,141.99,142.345,142.21,141.87,141.81,0.35,0.27,0.03,142.48\n12/29/2006 12:00:00 AM,142.1,142.54,141.43,141.985,141.62,141.92,141.86,0.02,-0.11,0.07,141.64\n01/03/2007 12:00:00 AM,142.25,142.86,140.57,141.715,141.37,141.91,141.9,-0.15,-0.19,0,140.97\n01/04/2007 12:00:00 AM,141.23,142.05,140.61,141.33,141.67,141.82,141.89,-0.36,-0.25,0.04,140.3\n01/05/2007 12:00:00 AM,141.33,141.4,140.38,140.89,140.54,141.65,141.8,-0.54,-0.26,-0.03,139.72\n01/08/2007 12:00:00 AM,140.82,141.41,140.25,140.83,141.19,141.46,141.64,-0.43,-0.05,0.03,139.65\n01/09/2007 12:00:00 AM,141.31,141.47,140.4,140.935,141.07,141.32,141.47,-0.25,0.12,-0.02,139.86\n01/10/2007 12:00:00 AM,140.58,141.57,140.3,140.935,141.54,141.2,141.33,-0.18,0.12,0.03,140.05\n01/11/2007 12:00:00 AM,141.56,142.62,141.5,142.06,142.16,141.29,141.25,0.59,0.64,0.01,141.41\n01/12/2007 12:00:00 AM,142.12,143.24,142.11,142.675,143.24,141.52,141.32,0.82,0.5,0.08,142.25\n01/16/2007 12:00:00 AM,143.07,143.44,142.73,143.085,142.96,141.84,141.54,0.86,0.27,0.04,142.89\n01/17/2007 12:00:00 AM,142.85,143.46,142.73,143.095,143.02,142.14,141.84,0.63,-0.04,0.09,143.11\n01/18/2007 12:00:00 AM,143.17,143.26,142.31,142.785,142.54,142.35,142.12,0.26,-0.31,0.02,143.01\n01/19/2007 12:00:00 AM,142.54,143.1,142.46,142.78,142.82,142.5,142.34,0.18,-0.22,0.07,143.19\n01/22/2007 12:00:00 AM,143.07,143.1,141.93,142.515,142.38,142.55,142.47,-0.03,-0.28,0.01,143.07\n01/23/2007 12:00:00 AM,142.26,143.08,142.06,142.57,142.8,142.58,142.54,0.01,-0.11,0.06,143.21\n01/24/2007 12:00:00 AM,142.97,143.98,142.91,143.445,143.95,142.71,142.61,0.56,0.37,0.03,144.08\n01/25/2007 12:00:00 AM,143.84,143.92,142.01,142.965,142.26,142.8,142.7,0.1,-0.15,0.07,143.52\n01/26/2007 12:00:00 AM,142.57,142.65,141.58,142.115,142.16,142.74,142.76,-0.47,-0.51,-0.02,142.59\n01/29/2007 12:00:00 AM,142.19,142.63,141.74,142.185,142.05,142.63,142.73,-0.29,-0.13,0.04,142.55\n01/30/2007 12:00:00 AM,142.35,142.86,142.06,142.46,142.79,142.56,142.64,-0.04,0.13,-0.01,142.69\n01/31/2007 12:00:00 AM,142.63,144.13,142.4,143.265,143.75,142.64,142.6,0.48,0.47,0.07,143.31\n02/01/2007 12:00:00 AM,144.15,144.66,143.91,144.285,144.61,142.91,142.69,1,0.63,0.05,144.09\n02/02/2007 12:00:00 AM,144.74,144.95,144.38,144.665,144.81,143.27,142.93,0.97,0.29,0.11,144.23\n02/05/2007 12:00:00 AM,144.7,144.94,144.34,144.64,144.85,143.61,143.27,0.69,-0.07,0.05,144\n02/06/2007 12:00:00 AM,144.97,145.03,144.33,144.68,144.89,143.89,143.59,0.53,-0.17,0.1,143.91\n02/07/2007 12:00:00 AM,145.12,145.36,144.57,144.965,145.21,144.16,143.89,0.56,-0.06,0.05,144.14\n02/08/2007 12:00:00 AM,144.78,145.12,144.27,144.695,145.02,144.34,144.14,0.24,-0.28,0.09,143.9\n02/09/2007 12:00:00 AM,145.07,145.33,143.39,144.36,143.94,144.41,144.31,-0.04,-0.35,0.02,143.68\n02/12/2007 12:00:00 AM,143.94,144.04,143.19,143.615,143.45,144.32,144.37,-0.5,-0.52,0.05,143.14\n02/13/2007 12:00:00 AM,143.77,144.9,143.76,144.33,144.66,144.29,144.34,0.09,0.18,0.02,144.1\n02/14/2007 12:00:00 AM,144.8,145.9,144.78,145.34,145.61,144.43,144.33,0.71,0.57,0.1,145.3\n02/15/2007 12:00:00 AM,145.67,145.95,145.43,145.69,145.8,144.67,144.45,0.74,0.32,0.05,145.8\n02/16/2007 12:00:00 AM,145.44,145.76,145.23,145.495,145.73,144.88,144.66,0.41,-0.09,0.09,145.73\n02/20/2007 12:00:00 AM,145.56,146.2,145.03,145.615,146.04,145.07,144.87,0.38,-0.08,0.04,145.94\n02/21/2007 12:00:00 AM,145.61,146.07,145.35,145.71,145.98,145.23,145.06,0.33,-0.07,0.09,146.09\n02/22/2007 12:00:00 AM,146.05,146.42,145.17,145.795,145.87,145.38,145.23,0.3,-0.07,0.04,146.18\n02/23/2007 12:00:00 AM,145.74,145.79,144.75,145.27,145.3,145.42,145.35,-0.12,-0.35,0.07,145.64\n02/26/2007 12:00:00 AM,145.84,145.95,144.75,145.35,145.17,145.42,145.41,-0.04,-0.11,0.02,145.68\n02/27/2007 12:00:00 AM,143.88,144.2,139,141.6,139.5,144.87,145.28,-2.41,-1.84,-0.05,141.98\n02/28/2007 12:00:00 AM,140.39,141.98,139.8,140.89,140.93,144.07,144.81,-2.21,-0.77,-0.12,141.41\n03/01/2007 12:00:00 AM,139.34,141.25,138.05,139.65,140.51,143.12,144.03,-2.39,-0.51,-0.1,140.31\n03/02/2007 12:00:00 AM,140.05,140.66,138.66,139.66,138.67,142.26,143.14,-1.73,0.26,-0.14,140.44\n03/05/2007 12:00:00 AM,137.93,139.58,137.33,138.455,137.35,141.37,142.25,-2.03,-0.06,-0.12,139.3\n03/06/2007 12:00:00 AM,138.78,140.12,137.72,138.92,139.7,140.67,141.42,-1.18,0.62,-0.15,139.77\n03/07/2007 12:00:00 AM,139.74,140.46,139.4,139.93,139.56,140.3,140.75,-0.21,1.05,-0.06,140.66\n03/08/2007 12:00:00 AM,140.54,141.16,140.07,140.615,140.74,140.2,140.37,0.28,0.91,-0.08,141.11\n03/09/2007 12:00:00 AM,141.31,141.42,140.08,140.75,140.78,140.25,140.24,0.29,0.46,-0.03,140.95\n03/12/2007 12:00:00 AM,140.42,141.34,140.16,140.75,140.99,140.34,140.26,0.21,0.15,-0.07,140.65\n03/13/2007 12:00:00 AM,140.24,140.77,138.04,139.405,138.25,140.23,140.29,-0.7,-0.63,-0.06,139.08\n03/14/2007 12:00:00 AM,138.43,139.36,136.75,138.055,139.28,139.88,140.17,-1.37,-0.84,-0.15,137.63\n03/15/2007 12:00:00 AM,139.06,139.99,138.8,139.395,139.47,139.67,139.91,-0.14,0.49,-0.05,138.91\n03/16/2007 12:00:00 AM,139.31,139.63,138.12,138.875,138.53,139.48,139.67,-0.43,0.04,-0.11,138.36\n03/19/2007 12:00:00 AM,139.26,140.33,139.15,139.74,140.2,139.44,139.52,0.24,0.52,-0.03,139.24\n03/20/2007 12:00:00 AM,140.08,141.05,139.96,140.505,140.97,139.58,139.48,0.66,0.58,-0.05,140.01\n03/21/2007 12:00:00 AM,141.1,143.65,140.82,142.235,143.29,140.02,139.66,1.58,0.98,0.05,141.72\n03/22/2007 12:00:00 AM,143.47,143.68,142.79,143.235,143.18,140.66,140.07,1.78,0.64,0.03,142.66\n03/23/2007 12:00:00 AM,143.28,143.81,143.15,143.48,143.39,141.32,140.67,1.45,0.06,0.09,142.87\n03/26/2007 12:00:00 AM,143.5,143.65,142.09,142.87,143.2,141.79,141.27,0.67,-0.58,0.01,142.3\n03/27/2007 12:00:00 AM,143.12,143.16,142.39,142.775,142.86,142.12,141.76,0.42,-0.5,0.06,142.31\n03/28/2007 12:00:00 AM,142.23,142.47,141.26,141.865,141.82,142.21,142.06,-0.27,-0.78,-0.02,141.58\n03/29/2007 12:00:00 AM,142.54,142.61,141.19,141.9,141.97,142.19,142.18,-0.17,-0.32,0.03,141.83\n03/30/2007 12:00:00 AM,142.17,142.84,140.56,141.7,142,142.12,142.18,-0.25,-0.21,-0.03,141.85\n04/02/2007 12:00:00 AM,142.16,142.46,140.89,141.675,142.16,142.02,142.11,-0.2,-0.06,0.02,142.02\n04/03/2007 12:00:00 AM,142.97,143.98,142.91,143.445,143.69,142.2,142.09,0.98,0.87,0.03,143.89\n04/04/2007 12:00:00 AM,143.69,143.95,143.16,143.555,143.85,142.46,142.22,0.78,0.3,0.08,144\n04/05/2007 12:00:00 AM,143.67,144.44,143.61,144.025,144.24,142.79,142.48,0.87,0.21,0.04,144.4\n04/09/2007 12:00:00 AM,144.59,144.8,144.15,144.475,144.44,143.16,142.8,0.92,0.14,0.1,144.73\n04/10/2007 12:00:00 AM,144.33,144.85,144.27,144.56,144.61,143.51,143.15,0.72,-0.08,0.05,144.65\n04/11/2007 12:00:00 AM,144.82,144.86,143.54,144.2,144.02,143.74,143.48,0.29,-0.37,0.08,144.14\n04/12/2007 12:00:00 AM,143.74,144.92,143.34,144.13,144.66,143.89,143.72,0.17,-0.29,0.03,143.95\n04/13/2007 12:00:00 AM,144.9,145.32,144.36,144.84,145.32,144.08,143.9,0.58,0.16,0.09,144.55\n04/16/2007 12:00:00 AM,145.87,146.86,145.82,146.34,146.7,144.49,144.13,1.37,0.68,0.09,145.9\n04/17/2007 12:00:00 AM,146.97,147.4,146.65,147.025,147.09,145.01,144.52,1.43,0.4,0.15,146.42\n04/18/2007 12:00:00 AM,146.6,147.7,146.57,147.135,147.27,145.52,145.01,1.11,-0.05,0.1,146.41\n04/19/2007 12:00:00 AM,146.55,147.4,146.36,146.88,147.23,145.92,145.49,0.65,-0.38,0.13,146.11\n04/20/2007 12:00:00 AM,148.22,148.62,147.69,148.155,148.62,146.39,145.94,1.28,0.27,0.11,147.39\n04/23/2007 12:00:00 AM,148.37,148.73,147.97,148.35,148.06,146.86,146.39,1.05,-0.03,0.16,147.62\n04/24/2007 12:00:00 AM,148.23,148.4,147.32,147.86,148.12,147.19,146.82,0.45,-0.47,0.09,147.24\n04/25/2007 12:00:00 AM,148.73,149.66,148.02,148.84,149.48,147.55,147.2,0.95,0.13,0.16,148.36\n04/26/2007 12:00:00 AM,149.49,149.8,149.1,149.45,149.65,147.97,147.56,1.08,0.17,0.12,149.11\n04/27/2007 12:00:00 AM,149.03,149.74,148.84,149.29,149.53,148.32,147.95,0.68,-0.21,0.16,149.09\n04/30/2007 12:00:00 AM,149.64,149.74,148.21,148.975,148.29,148.55,148.29,0.3,-0.4,0.09,148.95\n05/01/2007 12:00:00 AM,148.52,148.73,147.67,148.2,148.67,148.59,148.5,-0.28,-0.63,0.11,148.37\n05/02/2007 12:00:00 AM,148.9,149.95,148.75,149.35,149.54,148.71,148.61,0.53,0.29,0.09,149.67\n05/03/2007 12:00:00 AM,149.97,150.4,149.73,150.065,150.35,148.96,148.74,0.84,0.39,0.15,150.45\n05/04/2007 12:00:00 AM,150.75,151.12,150.22,150.67,150.92,149.3,148.98,1,0.32,0.12,151.03\n05/07/2007 12:00:00 AM,150.88,151.2,150.81,151.005,150.95,149.68,149.31,0.94,0.12,0.17,151.28\n05/08/2007 12:00:00 AM,150.56,150.92,150.13,150.525,150.75,149.95,149.65,0.38,-0.37,0.1,150.7\n05/09/2007 12:00:00 AM,150.64,151.52,150.37,150.945,151.16,150.2,149.94,0.54,-0.07,0.15,151.02\n05/10/2007 12:00:00 AM,150.73,151.02,149.27,150.145,149.58,150.28,150.16,-0.12,-0.53,0.07,150.12\n05/11/2007 12:00:00 AM,149.75,150.93,149.72,150.325,150.86,150.32,150.27,0.03,-0.16,0.12,150.23\n05/14/2007 12:00:00 AM,150.86,151.3,149.79,150.545,150.53,150.37,150.33,0.16,0.03,0.07,150.38\n05/15/2007 12:00:00 AM,150.7,151.66,150.19,150.925,150.57,150.47,150.38,0.36,0.17,0.12,150.69\n05/16/2007 12:00:00 AM,150.8,151.63,150.38,151.005,151.6,150.59,150.47,0.31,0.06,0.07,150.72\n05/17/2007 12:00:00 AM,151.38,151.96,151.11,151.535,151.3,150.77,150.6,0.56,0.22,0.13,151.21\n05/18/2007 12:00:00 AM,151.94,152.62,151.81,152.215,152.62,151.05,150.79,0.84,0.32,0.1,151.84\n05/21/2007 12:00:00 AM,152.58,153.23,152.5,152.865,152.54,151.42,151.07,1.03,0.3,0.16,152.44\n05/22/2007 12:00:00 AM,152.7,153.16,152.38,152.77,152.42,151.76,151.41,0.69,-0.11,0.1,152.33\n05/23/2007 12:00:00 AM,152.95,153.5,152.36,152.93,152.44,152.06,151.75,0.6,-0.13,0.14,152.5\n05/24/2007 12:00:00 AM,152.53,153.21,150.74,151.975,151.06,152.16,152.01,-0.17,-0.65,0.06,151.63\n05/25/2007 12:00:00 AM,151.49,152.02,151.18,151.6,151.69,152.12,152.13,-0.36,-0.48,0.09,151.41\n05/29/2007 12:00:00 AM,151.94,152.5,151.45,151.975,152.24,152.08,152.12,-0.03,0.02,0.05,151.94\n05/30/2007 12:00:00 AM,151.46,153.54,151.34,152.44,153.48,152.12,152.1,0.28,0.25,0.11,152.54\n05/31/2007 12:00:00 AM,153.66,153.89,153.12,153.505,153.32,152.34,152.16,0.88,0.58,0.09,153.67\n06/01/2007 12:00:00 AM,153.88,154.4,153.51,153.955,154.08,152.66,152.36,0.93,0.33,0.14,154.11\n06/04/2007 12:00:00 AM,153.54,154.39,153.48,153.935,154.1,152.96,152.65,0.66,-0.03,0.09,154.06\n06/05/2007 12:00:00 AM,153.72,153.9,152.86,153.38,153.49,153.14,152.93,0.13,-0.43,0.11,153.49\n06/06/2007 12:00:00 AM,152.91,152.95,151.75,152.35,151.84,153.1,153.09,-0.56,-0.74,0.03,152.47\n06/07/2007 12:00:00 AM,151.56,152.5,149.06,150.78,149.1,152.74,153.02,-1.41,-1.01,0.02,150.99\n06/08/2007 12:00:00 AM,149.42,151.19,149.09,150.14,151.04,152.22,152.7,-1.43,-0.52,-0.04,150.47\n06/11/2007 12:00:00 AM,150.93,151.95,150.7,151.325,151.3,151.9,152.27,-0.29,0.61,0.04,151.73\n06/12/2007 12:00:00 AM,150.67,151.54,149.55,150.545,149.65,151.57,151.9,-0.7,0.02,-0.03,150.96\n06/13/2007 12:00:00 AM,150.44,152.07,149.72,150.895,151.89,151.35,151.6,-0.29,0.33,0.03,151.3\n06/14/2007 12:00:00 AM,152.08,153.12,152.03,152.575,152.86,151.44,151.43,0.86,1.03,0.03,152.87\n06/15/2007 12:00:00 AM,153.24,153.66,152.93,153.295,153.07,151.75,151.5,1.08,0.69,0.1,153.38\n06/18/2007 12:00:00 AM,153.36,153.39,152.66,153.025,152.89,152.05,151.75,0.62,-0.01,0.04,152.9\n06/19/2007 12:00:00 AM,152.64,153.38,152.36,152.87,153.27,152.29,152.04,0.35,-0.22,0.08,152.56\n06/20/2007 12:00:00 AM,153.58,153.58,150.96,152.27,151.14,152.38,152.25,-0.13,-0.48,0.01,151.85\n06/21/2007 12:00:00 AM,151.08,152.11,150.25,151.18,151.98,152.23,152.32,-0.79,-0.75,0.02,150.74\n06/22/2007 12:00:00 AM,151.52,151.77,149.85,150.81,150.55,151.97,152.2,-0.81,-0.39,-0.04,150.44\n06/25/2007 12:00:00 AM,150.24,151.25,149.02,150.135,149.83,151.6,151.95,-1.02,-0.35,-0.01,149.9\n06/26/2007 12:00:00 AM,150.21,150.46,148.28,149.37,148.29,151.14,151.58,-1.23,-0.32,-0.08,149.33\n06/27/2007 12:00:00 AM,148.24,150.57,148.06,149.315,150.4,150.69,151.14,-0.93,0.07,-0.03,149.48\n06/28/2007 12:00:00 AM,150.38,151.41,149.67,150.54,150.38,150.5,150.76,0.11,0.83,-0.04,150.85\n06/29/2007 12:00:00 AM,150.83,151.65,149.15,150.4,150.43,150.41,150.53,-0.01,0.34,0.01,150.78\n07/02/2007 12:00:00 AM,150.87,151.92,150.77,151.345,151.79,150.52,150.46,0.59,0.62,-0.01,151.74\n07/03/2007 12:00:00 AM,152.18,152.5,151.99,152.245,152.34,150.81,150.56,1,0.62,0.06,152.55\n07/05/2007 12:00:00 AM,152.43,152.56,151.63,152.095,152.18,151.11,150.81,0.63,0.03,0.01,152.27\n07/06/2007 12:00:00 AM,152.38,153.17,151.93,152.55,152.98,151.43,151.11,0.75,0.08,0.07,152.57\n07/09/2007 12:00:00 AM,153.16,153.36,152.62,152.99,153,151.78,151.44,0.83,0.09,0.03,152.84\n07/10/2007 12:00:00 AM,152.26,152.61,150.77,151.69,150.92,151.9,151.73,-0.23,-0.76,0.03,151.42\n07/11/2007 12:00:00 AM,150.75,152.05,150.52,151.285,151.99,151.86,151.86,-0.42,-0.54,-0.02,150.98\n07/12/2007 12:00:00 AM,152.37,154.75,152.34,153.545,154.39,152.09,151.93,1.13,0.89,0.09,153.18\n07/13/2007 12:00:00 AM,154.57,155.46,154.39,154.925,154.85,152.59,152.16,1.7,0.89,0.08,154.43\n07/16/2007 12:00:00 AM,154.99,155.53,154.58,155.055,154.83,153.14,152.6,1.32,0.16,0.13,154.43\n07/17/2007 12:00:00 AM,155.01,155.48,154.68,155.08,154.75,153.64,153.13,0.97,-0.19,0.08,154.4\n07/18/2007 12:00:00 AM,154.31,154.8,153.3,154.05,154.47,153.88,153.57,0.05,-0.8,0.08,153.4\n07/19/2007 12:00:00 AM,155.2,155.53,154.75,155.14,155.07,154.16,153.89,0.73,0.1,0.07,154.59\n07/20/2007 12:00:00 AM,154.89,155.25,152.83,154.04,153.5,154.25,154.12,-0.17,-0.62,0.07,153.63\n07/23/2007 12:00:00 AM,154.28,154.72,153.3,154.01,153.97,154.25,154.23,-0.14,-0.29,0.03,153.81\n07/24/2007 12:00:00 AM,153.12,153.5,150.76,152.13,151.3,153.94,154.17,-1.3,-1.01,0.01,152.2\n07/25/2007 12:00:00 AM,152.02,152.39,150.25,151.32,151.61,153.44,153.89,-1.46,-0.62,-0.06,151.72\n07/26/2007 12:00:00 AM,150.19,150.8,146.39,148.595,148.02,152.54,153.34,-2.8,-1.3,-0.1,149.37\n07/27/2007 12:00:00 AM,148.21,148.87,145.08,146.975,145.11,151.38,152.48,-3.06,-0.84,-0.18,148.17\n07/30/2007 12:00:00 AM,145.93,147.81,145.29,146.55,147.38,150.24,151.39,-2.5,0.03,-0.14,148.08\n07/31/2007 12:00:00 AM,148.32,149.46,145.04,147.25,145.72,149.36,150.31,-1.37,0.89,-0.15,148.95\n08/01/2007 12:00:00 AM,145.21,147.01,143.95,145.48,146.43,148.46,149.36,-2.12,-0.09,-0.16,147.2\n08/02/2007 12:00:00 AM,146.77,147.76,145.26,146.51,147.6,147.83,148.53,-0.88,0.89,-0.16,148.12\n08/03/2007 12:00:00 AM,147.28,147.58,143.2,145.39,143.8,147.24,147.84,-1.36,0.1,-0.14,146.74\n08/06/2007 12:00:00 AM,144.21,146.83,142.53,144.68,146.21,146.63,147.24,-1.44,-0.01,-0.2,145.71\n08/07/2007 12:00:00 AM,145.94,149,145.23,147.115,147.77,146.48,146.75,0.51,1.44,-0.07,147.7\n08/08/2007 12:00:00 AM,148.41,150.59,147.34,148.965,149.83,146.78,146.59,1.55,1.51,-0.05,148.95\n08/09/2007 12:00:00 AM,147.43,148.95,145.29,147.12,145.39,146.94,146.74,-0.05,-0.45,-0.06,146.53\n08/10/2007 12:00:00 AM,144.24,146.5,143.12,144.81,144.71,146.7,146.84,-1.51,-1.35,-0.17,143.87\n08/13/2007 12:00:00 AM,146.5,146.89,145.02,145.955,145.23,146.49,146.71,-0.37,0.15,-0.08,144.81\n08/14/2007 12:00:00 AM,145.7,146.06,142.72,144.39,143.01,146.11,146.45,-1.26,-0.59,-0.17,143.18\n08/15/2007 12:00:00 AM,142.72,144.46,140.62,142.54,141.04,145.44,146.04,-2.1,-0.93,-0.17,141.48\n08/16/2007 12:00:00 AM,139.79,142.94,137.25,140.095,142.1,144.4,145.35,-3.08,-1.2,-0.28,139.41\n08/17/2007 12:00:00 AM,145.56,145.81,142.32,144.065,144.71,143.96,144.55,0.29,1.93,-0.1,143.75\n08/20/2007 12:00:00 AM,145.17,145.47,143.29,144.38,144.64,143.85,144.04,0.41,1.1,-0.12,144.31\n08/21/2007 12:00:00 AM,144.6,145.97,144.14,145.055,144.93,143.99,143.91,0.73,0.79,-0.06,145.2\n08/22/2007 12:00:00 AM,146.01,146.8,145.33,146.065,146.65,144.34,144.04,1.17,0.72,-0.06,146.34\n08/23/2007 12:00:00 AM,147.34,147.65,145.61,146.63,146.52,144.81,144.37,1.21,0.38,0,146.95\n08/24/2007 12:00:00 AM,146.48,148.33,146.28,147.305,148.33,145.35,144.83,1.31,0.24,-0.02,147.6\n08/27/2007 12:00:00 AM,147.85,148.33,146.73,147.53,146.95,145.88,145.35,1.1,-0.06,0.03,147.75\n08/28/2007 12:00:00 AM,146.16,146.25,143.46,144.855,143.72,145.93,145.76,-0.91,-1.55,-0.1,145.06\n08/29/2007 12:00:00 AM,144.37,146.74,143.96,145.35,146.54,145.87,145.9,-0.34,-0.38,-0.03,145.58\n08/30/2007 12:00:00 AM,145.45,147.19,145.31,146.25,146.15,145.9,145.89,0.32,0.32,-0.05,146.45\n08/31/2007 12:00:00 AM,147.65,148.5,146.83,147.665,147.59,146.17,145.96,1.14,0.78,0.04,147.74\n09/04/2007 12:00:00 AM,147.45,149.98,147.4,148.69,149.08,146.64,146.22,1.48,0.66,0.03,148.57\n09/05/2007 12:00:00 AM,148.2,148.36,147,147.68,147.79,146.97,146.6,0.43,-0.46,0.04,147.38\n09/06/2007 12:00:00 AM,147.95,148.61,147.12,147.865,148.13,147.23,146.95,0.43,-0.24,0,147.46\n09/07/2007 12:00:00 AM,146.48,146.89,145.26,146.075,146.07,147.16,147.15,-0.83,-1.07,-0.01,145.65\n09/10/2007 12:00:00 AM,146.52,146.72,144.33,145.525,145.79,146.89,147.11,-0.95,-0.64,-0.07,145.2\n09/11/2007 12:00:00 AM,146.24,147.7,146.13,146.915,147.49,146.79,146.93,0.19,0.55,0.02,146.68\n09/12/2007 12:00:00 AM,147.29,148.44,146.98,147.71,147.87,146.89,146.84,0.65,0.64,0,147.53\n09/13/2007 12:00:00 AM,148.55,149.45,148.2,148.825,148.91,147.21,146.95,1.18,0.73,0.07,148.64\n09/14/2007 12:00:00 AM,147.96,149.09,147.74,148.415,148.9,147.51,147.2,0.6,-0.07,0.02,148.23\n09/17/2007 12:00:00 AM,148.31,148.89,147.63,148.26,148.1,147.73,147.49,0.33,-0.24,0.05,148.11\n09/18/2007 12:00:00 AM,148.82,152.5,148.13,150.315,152.46,148.19,147.79,1.55,0.78,0.07,150.15\n09/19/2007 12:00:00 AM,153.41,154.39,152.71,153.55,153.36,149.15,148.32,3.19,1.62,0.2,153.23\n09/20/2007 12:00:00 AM,153.34,153.43,152.11,152.77,152.28,150.05,149.14,1.82,-0.21,0.13,152.26\n09/21/2007 12:00:00 AM,152.71,152.89,151.74,152.315,151.97,150.72,149.99,1.03,-0.72,0.15,151.71\n09/24/2007 12:00:00 AM,152.42,152.82,151.36,152.09,151.69,151.18,150.67,0.61,-0.71,0.09,151.47\n09/25/2007 12:00:00 AM,150.81,151.66,150.47,151.065,151.39,151.33,151.1,-0.21,-0.98,0.09,150.53\n09/26/2007 12:00:00 AM,152.25,152.77,151.39,152.08,152.19,151.5,151.34,0.49,0.04,0.08,151.68\n09/27/2007 12:00:00 AM,152.88,153.1,152.19,152.645,153.09,151.74,151.52,0.72,0.2,0.13,152.36\n09/28/2007 12:00:00 AM,152.85,153.19,151.98,152.585,152.58,151.95,151.73,0.48,-0.06,0.08,152.42\n10/01/2007 12:00:00 AM,152.6,154.75,152.5,153.625,154.3,152.27,151.98,1.01,0.37,0.15,153.56\n10/02/2007 12:00:00 AM,154.61,154.65,153.81,154.23,154.09,152.68,152.29,1.12,0.28,0.12,154.21\n10/03/2007 12:00:00 AM,153.81,154.41,153.49,153.95,153.78,153.03,152.67,0.64,-0.22,0.14,153.97\n10/04/2007 12:00:00 AM,154.11,154.26,153.59,153.925,154.02,153.29,153.01,0.45,-0.26,0.09,153.98\n10/05/2007 12:00:00 AM,155.03,156.1,154.63,155.365,155.85,153.69,153.32,1.24,0.46,0.17,155.42\n10/08/2007 12:00:00 AM,155.39,155.49,154.77,155.13,155.02,154.05,153.68,0.75,-0.13,0.12,155.13\n10/09/2007 12:00:00 AM,155.6,156.5,155.03,155.765,156.48,154.44,154.06,0.95,0.08,0.17,155.71\n10/10/2007 12:00:00 AM,156.04,156.44,155.41,155.925,156.22,154.81,154.44,0.79,-0.08,0.12,155.79\n10/11/2007 12:00:00 AM,156.93,157.52,154.54,156.03,155.47,155.13,154.8,0.64,-0.15,0.16,155.83\n10/12/2007 12:00:00 AM,155.46,156.35,155.27,155.81,156.33,155.35,155.1,0.33,-0.32,0.1,155.57\n10/15/2007 12:00:00 AM,156.27,156.36,153.94,155.15,155.01,155.4,155.31,-0.18,-0.54,0.12,154.93\n10/16/2007 12:00:00 AM,154.41,154.52,153.47,153.995,153.77,155.22,155.34,-0.87,-0.78,0.03,153.86\n10/17/2007 12:00:00 AM,154.98,155.09,152.47,153.78,154.25,154.94,155.19,-0.77,-0.31,0.06,153.78\n10/18/2007 12:00:00 AM,153.45,154.19,153.08,153.635,153.69,154.64,154.93,-0.65,-0.06,0.02,153.78\n10/19/2007 12:00:00 AM,153.1,153.15,149.66,151.405,149.66,154.05,154.57,-1.89,-0.94,-0.01,151.74\n10/22/2007 12:00:00 AM,148.84,150.76,148.66,149.71,150.54,153.2,153.99,-2.45,-0.89,-0.1,150.31\n10/23/2007 12:00:00 AM,151.3,151.95,150.25,151.1,151.76,152.56,153.25,-0.9,0.73,-0.02,151.9\n10/24/2007 12:00:00 AM,151.21,151.74,148.84,150.29,151.48,151.99,152.58,-1.17,0.2,-0.08,151.19\n10/25/2007 12:00:00 AM,151.68,152.29,149.88,151.085,151.84,151.64,152.04,-0.34,0.73,-0.01,151.99\n10/26/2007 12:00:00 AM,153.06,153.62,151.9,152.76,153.62,151.67,151.73,0.82,1.25,0,153.51\n10/29/2007 12:00:00 AM,153.93,154.44,153.55,153.995,154.13,152.02,151.75,1.38,1.05,0.08,154.44\n10/30/2007 12:00:00 AM,153.45,153.75,152.87,153.31,153.06,152.34,152.01,0.57,-0.09,0.02,153.41\n10/31/2007 12:00:00 AM,153.98,155.27,152.84,154.055,154.65,152.72,152.35,0.89,0.17,0.07,153.82\n11/01/2007 12:00:00 AM,153.3,153.41,150.59,152,151.03,152.75,152.63,-0.66,-1.1,-0.03,151.51\n11/02/2007 12:00:00 AM,151.53,152,149.21,150.605,151.2,152.45,152.67,-1.37,-1.1,-0.03,150.03\n11/05/2007 12:00:00 AM,149.64,151.16,148.97,150.065,150.05,151.99,152.41,-1.34,-0.54,-0.09,149.52\n11/06/2007 12:00:00 AM,150.86,152.11,149.9,151.005,152.07,151.67,152.03,-0.38,0.47,-0.01,150.53\n11/07/2007 12:00:00 AM,150.44,151.13,147.55,149.34,147.91,151.21,151.63,-1.33,-0.46,-0.1,149\n11/08/2007 12:00:00 AM,147.99,149.3,145.07,147.185,147.16,150.44,151.13,-2.34,-0.99,-0.12,147.12\n11/09/2007 12:00:00 AM,145.51,147.54,144.89,146.215,145.14,149.53,150.41,-2.32,-0.47,-0.18,146.51\n11/12/2007 12:00:00 AM,145.21,146.61,143.7,145.155,143.7,148.55,149.51,-2.36,-0.25,-0.17,145.82\n11/13/2007 12:00:00 AM,145.26,148.31,145.22,146.765,148.08,147.91,148.63,-0.69,1.14,-0.15,147.7\n11/14/2007 12:00:00 AM,149.22,149.4,146.78,148.09,147.67,147.69,148.02,0.34,1.37,-0.06,149.1\n11/15/2007 12:00:00 AM,146.79,147.49,144.52,146.005,145.54,147.36,147.67,-1.08,-0.37,-0.16,147.01\n11/16/2007 12:00:00 AM,146.28,146.47,144.57,145.52,145.79,146.97,147.35,-1.09,-0.21,-0.12,146.5\n11/19/2007 12:00:00 AM,145.28,145.36,143.19,144.275,143.76,146.42,146.93,-1.59,-0.49,-0.19,145.2\n11/20/2007 12:00:00 AM,143.64,145.53,142.11,143.82,144.64,145.84,146.41,-1.44,-0.14,-0.16,144.65\n11/21/2007 12:00:00 AM,143.08,143.91,141.67,142.79,141.68,145.17,145.82,-1.7,-0.27,-0.22,143.51\n11/23/2007 12:00:00 AM,143.03,144.34,142.7,143.52,144.13,144.67,145.21,-0.77,0.57,-0.14,144.06\n11/26/2007 12:00:00 AM,144.39,144.88,140.66,142.77,140.95,144.2,144.68,-1.04,0.1,-0.2,143.1\n11/27/2007 12:00:00 AM,141.74,143.23,140.95,142.09,142.57,143.72,144.2,-1.19,-0.07,-0.17,142.24\n11/28/2007 12:00:00 AM,144.19,147.47,144.14,145.805,147.13,143.84,143.87,1.5,1.98,-0.08,145.67\n11/29/2007 12:00:00 AM,146.62,147.72,146.1,146.91,147.18,144.33,143.93,1.8,1.23,-0.01,146.38\n11/30/2007 12:00:00 AM,149.04,149.25,147.33,148.29,148.66,145.1,144.4,2.18,0.89,0,147.36\n12/03/2007 12:00:00 AM,148.19,148.45,147.29,147.87,147.68,145.8,145.08,1.32,-0.23,0.02,146.62\n12/04/2007 12:00:00 AM,146.66,147.54,146.31,146.925,146.36,146.23,145.73,0.36,-0.87,-0.04,145.54\n12/05/2007 12:00:00 AM,147.93,149.2,147.83,148.515,148.81,146.73,146.24,1.27,0.22,0.04,147.11\n12/06/2007 12:00:00 AM,148.63,151.21,148.57,149.89,150.94,147.38,146.76,1.8,0.5,0.05,148.52\n12/07/2007 12:00:00 AM,151.42,151.5,150.55,151.025,150.91,148.16,147.41,2.03,0.42,0.12,149.73\n12/10/2007 12:00:00 AM,151.28,152.25,150.86,151.555,152.08,148.95,148.16,1.81,0.04,0.09,150.41\n12/11/2007 12:00:00 AM,152.14,152.89,147.83,150.36,147.91,149.46,148.88,0.56,-0.93,0.08,149.48\n12/12/2007 12:00:00 AM,151.54,151.77,147.2,149.485,149.37,149.66,149.38,-0.15,-1.02,0.02,149\n12/13/2007 12:00:00 AM,148.32,149.39,147.3,148.345,149.06,149.54,149.58,-0.84,-1.03,0.02,148.34\n12/14/2007 12:00:00 AM,148.04,149.1,147.1,148.1,147.17,149.29,149.51,-0.76,-0.45,-0.03,148.59\n12/17/2007 12:00:00 AM,146.61,146.87,144.86,145.865,145.07,148.69,149.2,-1.98,-1.12,-0.06,146.85\n12/18/2007 12:00:00 AM,146.1,146.48,143.96,145.22,145.88,147.96,148.66,-1.85,-0.45,-0.11,146.66\n12/19/2007 12:00:00 AM,145.94,146.89,144.94,145.915,145.88,147.38,147.99,-0.9,0.51,-0.05,147.65\n12/20/2007 12:00:00 AM,146.84,146.86,145.18,146.02,146.8,146.96,147.42,-0.59,0.52,-0.08,147.84\n12/21/2007 12:00:00 AM,147.37,148.42,147.09,147.755,148.13,146.91,147.05,0.68,1.23,0.02,149.42\n12/24/2007 12:00:00 AM,148.73,149.48,148.48,148.98,149.23,147.2,147,1.27,1.07,0.02,150.26\n12/26/2007 12:00:00 AM,148.8,149.68,148.5,149.09,149.55,147.58,147.22,0.99,0.33,0.05,149.84\n12/27/2007 12:00:00 AM,149.02,149.03,147.32,148.175,147.67,147.82,147.55,0.14,-0.5,-0.01,148.38\n12/28/2007 12:00:00 AM,148.54,148.61,146.9,147.755,147.3,147.9,147.78,-0.17,-0.5,0.01,147.48\n12/31/2007 12:00:00 AM,147.1,147.61,146.06,146.835,146.21,147.77,147.85,-0.71,-0.67,-0.05,146.17\n01/02/2008 12:00:00 AM,146.53,146.99,143.88,145.435,144.93,147.38,147.71,-1.4,-0.86,-0.06,144.53\n01/03/2008 12:00:00 AM,144.91,145.49,144.07,144.78,144.86,146.85,147.35,-1.44,-0.46,-0.11,143.81\n01/04/2008 12:00:00 AM,143.34,143.44,140.91,142.175,141.31,145.97,146.77,-2.7,-1.17,-0.15,141.33\n01/07/2008 12:00:00 AM,141.81,142.23,140.1,141.165,141.19,144.93,145.93,-2.61,-0.5,-0.2,140.63\n01/08/2008 12:00:00 AM,142.08,142.9,138.44,140.67,138.91,143.91,144.94,-2.21,0.07,-0.17,140.52\n01/09/2008 12:00:00 AM,139.01,140.79,137.7,139.245,140.37,142.84,143.9,-2.51,-0.17,-0.24,139.53\n01/10/2008 12:00:00 AM,139.68,142.8,139.37,141.085,141.29,142.18,142.94,-0.65,1.33,-0.13,141.74\n01/11/2008 12:00:00 AM,140.78,141.57,139,140.285,140.15,141.65,142.21,-0.98,0.44,-0.19,141.19\n01/14/2008 12:00:00 AM,141.16,141.7,140.4,141.05,141.28,141.36,141.71,-0.23,0.79,-0.12,142.11\n01/15/2008 12:00:00 AM,139.75,140.1,137.9,139,138.17,140.9,141.31,-1.47,-0.54,-0.21,140.14\n01/16/2008 12:00:00 AM,137.37,139.12,136.28,137.7,136.98,140.26,140.86,-1.9,-0.61,-0.2,138.91\n01/17/2008 12:00:00 AM,137.57,137.88,132.93,135.405,133.43,139.31,140.18,-2.84,-1.02,-0.29,136.68\n01/18/2008 12:00:00 AM,134.19,135.02,131.1,133.06,132.06,138.03,139.23,-3.56,-1.05,-0.31,134.41\n01/22/2008 12:00:00 AM,126.4,132.43,126,129.215,130.72,136.26,137.91,-5.03,-1.63,-0.45,130.7\n01/23/2008 12:00:00 AM,127.17,134.19,126.84,130.515,133.86,134.74,136.32,-2.83,0.85,-0.34,132.06\n01/24/2008 12:00:00 AM,134.26,135.46,133.31,134.385,134.99,134.11,134.96,0.41,2.9,-0.24,135.69\n01/25/2008 12:00:00 AM,136.49,136.76,132.6,134.68,133.04,133.95,134.23,0.49,1.55,-0.18,135.5\n01/28/2008 12:00:00 AM,133.26,135.52,132.06,133.79,135.24,133.87,133.97,-0.21,0.24,-0.23,134.1\n01/29/2008 12:00:00 AM,136.1,136.45,134.88,135.665,135.91,134.1,133.95,1.04,1.03,-0.13,135.43\n01/30/2008 12:00:00 AM,135.58,138.54,134.6,136.57,134.91,134.55,134.15,1.33,0.71,-0.13,135.77\n01/31/2008 12:00:00 AM,133.42,138.54,133.2,135.87,137.3,134.91,134.53,0.52,-0.28,-0.11,134.6\n02/01/2008 12:00:00 AM,137.92,139.61,137.52,138.565,139.52,135.58,134.99,2.09,1.01,-0.05,136.92\n02/04/2008 12:00:00 AM,139.21,139.3,137.64,138.47,137.76,136.26,135.59,1.46,0.02,-0.02,136.55\n02/05/2008 12:00:00 AM,135.86,136.25,133.67,134.96,134.13,136.33,136.11,-1.17,-1.99,-0.16,133.07\n02/06/2008 12:00:00 AM,134.58,135.25,132.41,133.83,133.05,135.99,136.23,-1.57,-1.33,-0.15,132.29\n02/07/2008 12:00:00 AM,132.1,134.79,131.73,133.26,133.93,135.46,135.94,-1.5,-0.62,-0.19,132.25\n02/08/2008 12:00:00 AM,133.24,134.22,132.1,133.16,133.07,134.93,135.46,-1.16,-0.03,-0.15,132.76\n02/11/2008 12:00:00 AM,133.1,134.23,132.04,133.135,133.75,134.46,134.94,-0.86,0.23,-0.17,133.35\n02/12/2008 12:00:00 AM,134.91,136.31,133.98,135.145,134.99,134.38,134.56,0.66,1.27,-0.07,135.86\n02/13/2008 12:00:00 AM,136.06,137.1,135.14,136.12,136.37,134.6,134.46,1.1,0.99,-0.07,137.14\n02/14/2008 12:00:00 AM,136.95,137,134.79,135.895,135.17,134.88,134.62,0.65,0.16,-0.04,137.09\n02/15/2008 12:00:00 AM,134.55,135.22,133.91,134.565,135.14,134.94,134.83,-0.37,-0.7,-0.11,135.85\n02/19/2008 12:00:00 AM,136.69,136.89,134.61,135.75,135.52,135.08,134.96,0.48,0.27,-0.03,137.01\n02/20/2008 12:00:00 AM,133.99,136.55,133.76,135.155,135.92,135.14,135.06,-0.03,-0.25,-0.08,136.25\n02/21/2008 12:00:00 AM,136.66,137.01,134.07,135.54,134.79,135.23,135.15,0.23,0.06,-0.03,136.38\n02/22/2008 12:00:00 AM,134.97,135.85,132.86,134.355,135.62,135.13,135.18,-0.59,-0.58,-0.1,134.9\n02/25/2008 12:00:00 AM,135.54,137.65,134.78,136.215,137.33,135.25,135.19,0.76,0.71,-0.01,136.42\n02/26/2008 12:00:00 AM,136.73,138.95,136.5,137.725,138.36,135.66,135.32,1.51,0.93,0.01,137.48\n02/27/2008 12:00:00 AM,137.56,139.14,137.41,138.275,138.22,136.2,135.69,1.45,0.42,0.06,137.57\n02/28/2008 12:00:00 AM,137.24,137.96,136.55,137.255,136.87,136.56,136.15,0.4,-0.58,-0.01,136.2\n02/29/2008 12:00:00 AM,135.6,135.68,132.78,134.23,133.82,136.35,136.42,-1.63,-1.84,-0.07,133.07\n03/03/2008 12:00:00 AM,133.14,133.81,132.24,133.025,133.5,135.79,136.26,-1.95,-1.18,-0.13,132\n03/04/2008 12:00:00 AM,132.23,133.4,130.99,132.195,132.99,135.05,135.75,-1.95,-0.58,-0.12,131.46\n03/05/2008 12:00:00 AM,133.41,134.77,132.34,133.555,133.83,134.55,135.11,-0.55,0.78,-0.1,133.15\n03/06/2008 12:00:00 AM,132.98,133.22,130.55,131.885,131.06,133.97,134.53,-1.46,-0.26,-0.12,131.83\n03/07/2008 12:00:00 AM,129.73,131.74,128.58,130.16,129.71,133.19,133.92,-2.16,-0.65,-0.19,130.55\n03/10/2008 12:00:00 AM,129.81,129.93,127.59,128.76,128,132.25,133.15,-2.46,-0.54,-0.19,129.62\n03/11/2008 12:00:00 AM,130.72,132.72,128.95,130.835,132.6,131.68,132.34,-0.47,1.23,-0.15,132.04\n03/12/2008 12:00:00 AM,132.73,133.77,131.16,132.465,131.36,131.58,131.8,0.7,1.52,-0.06,133.76\n03/13/2008 12:00:00 AM,129.61,132.64,128.6,130.62,131.65,131.4,131.56,-0.67,-0.25,-0.14,131.89\n03/14/2008 12:00:00 AM,132.77,132.81,127.78,130.295,129.61,131.17,131.39,-0.69,-0.17,-0.11,131.48\n03/17/2008 12:00:00 AM,126.35,129.26,126.07,127.665,128.3,130.57,131.08,-2.18,-1.21,-0.22,128.75\n03/18/2008 12:00:00 AM,130.62,133.69,129.98,131.835,133.63,130.53,130.71,1.07,1.82,-0.05,132.68\n03/19/2008 12:00:00 AM,134.14,134.65,130.04,132.345,130.32,130.78,130.6,1.1,0.96,-0.06,132.74\n03/20/2008 12:00:00 AM,130.04,132.91,129.26,131.085,132.08,130.92,130.75,0,-0.35,-0.06,131.04\n03/24/2008 12:00:00 AM,133.31,135.81,133.24,134.525,134.72,131.5,131.03,2.19,1.44,0.01,134.01\n03/25/2008 12:00:00 AM,134.86,135.55,133.77,134.66,134.85,132.18,131.52,1.68,0.34,0.05,133.64\n03/26/2008 12:00:00 AM,134.46,135.09,133.11,134.1,133.2,132.72,132.14,0.86,-0.47,0,132.71\n03/27/2008 12:00:00 AM,134.2,134.44,132.36,133.4,132.78,133.03,132.66,0.18,-0.77,0.01,131.84\n03/28/2008 12:00:00 AM,132.99,133.36,131.06,132.21,131.51,133.02,132.95,-0.63,-1.01,-0.06,130.7\n03/31/2008 12:00:00 AM,131.29,132.73,131.09,131.91,131.97,132.86,132.98,-0.65,-0.53,-0.03,130.63\n04/01/2008 12:00:00 AM,133.61,136.84,133.51,135.175,136.61,133.14,132.97,1.61,1.44,0.04,134.14\n04/02/2008 12:00:00 AM,137.06,137.67,135.98,136.825,136.7,133.78,133.23,2.22,1.2,0.12,135.97\n04/03/2008 12:00:00 AM,135.94,137.44,135.71,136.575,137.04,134.43,133.78,1.45,0.03,0.07,135.93\n04/04/2008 12:00:00 AM,136.95,137.96,136.12,137.04,136.89,135.06,134.43,1.35,-0.08,0.11,136.65\n04/07/2008 12:00:00 AM,137.87,138.57,136.74,137.655,136.96,135.68,135.06,1.37,-0.04,0.09,137.5\n04/08/2008 12:00:00 AM,136.19,136.92,135.95,136.435,136.82,136.03,135.62,0.22,-0.89,0.08,136.54\n04/09/2008 12:00:00 AM,136.61,136.8,134.89,135.845,135.83,136.13,135.97,-0.21,-0.79,0.03,136.24\n04/10/2008 12:00:00 AM,135.39,136.67,134.9,135.785,136.02,136.12,136.11,-0.19,-0.38,0.05,136.43\n04/11/2008 12:00:00 AM,134.48,135.11,133.01,134.06,133.38,135.82,136.05,-1.24,-0.96,-0.03,134.93\n04/14/2008 12:00:00 AM,133.19,133.54,132.55,133.045,132.93,135.3,135.76,-1.55,-0.71,-0.03,134.14\n04/15/2008 12:00:00 AM,133.58,133.69,132.33,133.01,133.24,134.76,135.29,-1.15,-0.04,-0.06,134.23\n04/16/2008 12:00:00 AM,134.54,136.93,134.4,135.665,136.85,134.69,134.88,0.86,1.51,0.05,136.82\n04/17/2008 12:00:00 AM,136.02,137.25,135.66,136.455,137.05,134.92,134.77,1.13,0.99,0.04,137.33\n04/18/2008 12:00:00 AM,138.94,139.56,138.26,138.91,138.48,135.59,135.03,2.38,1.44,0.15,139.33\n04/21/2008 12:00:00 AM,138.23,138.98,137.85,138.415,138.55,136.26,135.59,1.42,-0.01,0.09,138.32\n04/22/2008 12:00:00 AM,138.19,138.31,136.9,137.605,137.94,136.71,136.21,0.51,-0.71,0.09,137.07\n04/23/2008 12:00:00 AM,138.09,138.78,137.12,137.95,137.72,137.06,136.69,0.59,-0.32,0.07,137.07\n04/24/2008 12:00:00 AM,138.08,139.74,137.04,138.39,138.32,137.39,137.06,0.71,-0.08,0.11,137.24\n04/25/2008 12:00:00 AM,139.41,139.89,137.91,138.9,139.6,137.74,137.4,0.84,0.06,0.09,137.58\n04/28/2008 12:00:00 AM,139.88,140.25,139.38,139.815,139.63,138.17,137.76,1.19,0.29,0.14,138.42\n04/29/2008 12:00:00 AM,139.39,139.73,138.61,139.17,139.08,138.49,138.14,0.46,-0.4,0.08,137.83\n04/30/2008 12:00:00 AM,139.29,140.59,138.26,139.425,138.26,138.74,138.47,0.49,-0.18,0.11,138.27\n05/01/2008 12:00:00 AM,138.39,141.12,138.27,139.695,141.12,138.98,138.74,0.53,-0.06,0.09,138.81\n05/02/2008 12:00:00 AM,142.33,142.37,140.56,141.465,141.51,139.43,139.03,1.51,0.71,0.16,140.85\n05/05/2008 12:00:00 AM,141.05,141.61,140.41,141.01,140.83,139.84,139.42,0.81,-0.16,0.11,140.67\n05/06/2008 12:00:00 AM,140.01,142.2,139.69,140.945,142.05,140.15,139.81,0.55,-0.29,0.13,140.92\n05/07/2008 12:00:00 AM,141.89,142.04,139.13,140.585,139.52,140.34,140.12,0.17,-0.43,0.08,140.86\n05/08/2008 12:00:00 AM,139.74,140.32,138.98,139.65,139.16,140.31,140.28,-0.47,-0.7,0.08,140.22\n05/09/2008 12:00:00 AM,138.6,139.39,138.45,138.92,138.9,140.09,140.26,-0.81,-0.6,0.02,139.77\n05/12/2008 12:00:00 AM,139.25,140.56,138.73,139.645,140.46,139.95,140.11,-0.13,0.22,0.07,140.68\n05/13/2008 12:00:00 AM,140.8,140.89,139.73,140.31,140.48,139.94,139.98,0.33,0.47,0.06,141.37\n05/14/2008 12:00:00 AM,141.09,142.2,140.46,141.33,140.77,140.14,139.99,0.89,0.67,0.12,142.26\n05/15/2008 12:00:00 AM,141.04,142.63,140.83,141.73,142.53,140.45,140.17,0.9,0.35,0.09,142.41\n05/16/2008 12:00:00 AM,142.86,142.87,141.61,142.24,142.66,140.83,140.47,0.98,0.23,0.13,142.6\n05/19/2008 12:00:00 AM,142.81,144.3,142.3,143.3,143.05,141.34,140.86,1.39,0.41,0.13,143.27\n05/20/2008 12:00:00 AM,142.27,142.34,141,141.67,141.89,141.58,141.27,-0.03,-0.86,0.1,141.29\n05/21/2008 12:00:00 AM,141.81,142.12,139,140.56,139.49,141.52,141.5,-0.73,-0.97,0.03,139.98\n05/22/2008 12:00:00 AM,139.43,140.17,139,139.585,139.51,141.22,141.46,-1.15,-0.81,0.03,138.93\n05/23/2008 12:00:00 AM,139.05,139.66,137.52,138.59,137.64,140.72,141.17,-1.47,-0.64,-0.03,137.99\n05/27/2008 12:00:00 AM,137.8,139,137.53,138.265,138.66,140.17,140.71,-1.27,-0.16,-0.01,137.81\n05/28/2008 12:00:00 AM,139.17,139.55,138,138.775,139.3,139.76,140.2,-0.6,0.44,-0.03,138.5\n05/29/2008 12:00:00 AM,139.13,140.93,139.08,140.005,140,139.63,139.83,0.35,0.95,0.04,139.86\n05/30/2008 12:00:00 AM,140.47,140.74,139.94,140.34,140.35,139.69,139.68,0.46,0.58,0.02,140.3\n06/02/2008 12:00:00 AM,139.83,139.86,138,138.93,138.9,139.6,139.65,-0.56,-0.48,0.01,139.01\n06/03/2008 12:00:00 AM,139.3,139.62,137.23,138.425,138.09,139.4,139.57,-0.73,-0.38,-0.04,138.68\n06/04/2008 12:00:00 AM,137.77,139.16,137.46,138.31,138.02,139.16,139.39,-0.6,-0.1,-0.01,138.72\n06/05/2008 12:00:00 AM,138.58,140.89,138.32,139.605,140.78,139.13,139.21,0.39,0.69,0,140.08\n06/06/2008 12:00:00 AM,139.55,139.8,136.22,138.01,136.29,138.96,139.1,-0.73,-0.49,-0.02,138.52\n06/09/2008 12:00:00 AM,136.86,137.5,135.41,136.455,136.62,138.53,138.89,-1.52,-0.84,-0.09,137.04\n06/10/2008 12:00:00 AM,135.67,137.1,135.35,136.225,135.94,138.03,138.51,-1.25,-0.23,-0.07,136.88\n06/11/2008 12:00:00 AM,135.97,136.26,133.93,135.095,133.94,137.41,138,-1.63,-0.39,-0.13,135.79\n06/12/2008 12:00:00 AM,134.6,135.87,133.52,134.695,134.45,136.77,137.4,-1.44,-0.04,-0.1,135.42\n06/13/2008 12:00:00 AM,135.17,136.52,134.42,135.47,136.15,136.34,136.82,-0.55,0.66,-0.1,136.13\n06/16/2008 12:00:00 AM,135.55,136.93,135.46,136.195,136.23,136.16,136.4,0.06,0.8,-0.04,136.7\n06/17/2008 12:00:00 AM,137.07,137.12,135.37,136.245,135.57,136.1,136.19,0.08,0.42,-0.07,136.52\n06/18/2008 12:00:00 AM,134.69,135.52,133.71,134.615,134.25,135.86,136.05,-0.98,-0.59,-0.09,134.7\n06/19/2008 12:00:00 AM,134.15,135.24,133.5,134.37,134.42,135.55,135.84,-0.87,-0.23,-0.12,134.33\n06/20/2008 12:00:00 AM,132.85,133.09,131.22,132.155,131.58,134.94,135.47,-2.04,-1,-0.15,132.07\n06/23/2008 12:00:00 AM,132.04,132.23,131.32,131.775,131.45,134.24,134.92,-1.73,-0.27,-0.18,131.74\n06/24/2008 12:00:00 AM,131.05,132.44,130.19,131.315,131.19,133.55,134.24,-1.55,0.01,-0.15,131.35\n06/25/2008 12:00:00 AM,131.72,133.4,131.24,132.32,131.81,133.1,133.61,-0.48,0.81,-0.14,132.41\n06/26/2008 12:00:00 AM,130.57,131.42,128.08,129.75,128.23,132.44,133.05,-1.99,-0.7,-0.18,129.92\n06/27/2008 12:00:00 AM,128.28,128.86,127.04,127.95,127.53,131.54,132.38,-2.59,-0.81,-0.26,128.32\n06/30/2008 12:00:00 AM,127.89,128.91,127.3,128.105,127.98,130.69,131.55,-1.78,0.2,-0.21,128.67\n07/01/2008 12:00:00 AM,126.52,128.47,125.93,127.2,128.38,129.86,130.69,-1.87,0.05,-0.25,127.93\n07/02/2008 12:00:00 AM,128.79,129.16,125.95,127.555,126.18,129.2,129.9,-1.13,0.59,-0.2,128.38\n07/03/2008 12:00:00 AM,127.11,127.11,124.99,126.05,126.31,128.49,129.19,-1.78,-0.18,-0.26,126.92\n07/07/2008 12:00:00 AM,126.79,127.34,123.92,125.63,125.02,127.8,128.5,-1.56,0.07,-0.23,126.52\n07/08/2008 12:00:00 AM,124.99,127.39,124.2,125.795,127.24,127.25,127.84,-1.03,0.43,-0.24,126.62\n07/09/2008 12:00:00 AM,127.5,127.74,124.39,126.065,124.79,126.86,127.29,-0.58,0.56,-0.19,126.75\n07/10/2008 12:00:00 AM,124.43,125.79,123.58,124.685,125.3,126.4,126.84,-1.3,-0.26,-0.25,125.2\n07/11/2008 12:00:00 AM,123.93,125.75,122.49,124.12,123.85,125.89,126.39,-1.3,-0.15,-0.22,124.49\n07/14/2008 12:00:00 AM,125.26,125.5,122.4,123.95,122.72,125.41,125.89,-1.05,0.11,-0.24,124.17\n07/15/2008 12:00:00 AM,121.8,123.49,120.02,121.755,120.99,124.69,125.35,-2.16,-0.78,-0.27,121.88\n07/16/2008 12:00:00 AM,121.45,124.57,121.1,122.835,123.96,124.15,124.74,-0.88,0.56,-0.25,122.9\n07/17/2008 12:00:00 AM,125.14,126.26,124.09,125.175,125.2,124.09,124.27,0.85,1.59,-0.13,125.07\n07/18/2008 12:00:00 AM,126.17,126.42,125.15,125.785,125.98,124.32,124.16,1,0.93,-0.13,125.44\n07/21/2008 12:00:00 AM,126.51,126.8,125.19,125.995,126.05,124.65,124.34,0.86,0.35,-0.09,125.43\n07/22/2008 12:00:00 AM,125.15,127.8,124.85,126.325,127.48,125.02,124.66,0.84,0.13,-0.1,125.6\n07/23/2008 12:00:00 AM,127.89,129.15,127.55,128.35,128.17,125.65,125.08,1.9,0.84,-0.01,127.46\n07/24/2008 12:00:00 AM,128.34,128.41,125.16,126.785,125.51,126.05,125.59,0.38,-0.73,-0.08,125.82\n07/25/2008 12:00:00 AM,125.89,126.49,125.17,125.83,125.48,126.18,125.98,-0.33,-0.93,-0.08,124.96\n07/28/2008 12:00:00 AM,125.51,126.06,123.42,124.74,123.64,126.01,126.1,-0.93,-0.93,-0.14,124.1\n07/29/2008 12:00:00 AM,123.98,126.38,123.64,125.01,126.28,125.8,126,-0.51,-0.15,-0.09,124.68\n07/30/2008 12:00:00 AM,127.02,128.6,126.28,127.44,128.53,125.96,125.9,1.18,1.2,-0.04,127.34\n07/31/2008 12:00:00 AM,127.4,128.57,126.63,127.6,126.83,126.26,126,0.96,0.46,0,127.65\n08/01/2008 12:00:00 AM,127.12,127.28,125.46,126.37,126.16,126.39,126.22,-0.09,-0.56,-0.07,126.59\n08/04/2008 12:00:00 AM,126.04,126.14,124.76,125.45,124.99,126.31,126.34,-0.65,-0.71,-0.07,125.88\n08/05/2008 12:00:00 AM,126.01,128.56,125.9,127.23,128.36,126.41,126.35,0.66,0.62,-0.04,127.78\n08/06/2008 12:00:00 AM,128.02,129.3,127.48,128.39,128.93,126.73,126.46,1.22,0.74,0.03,128.92\n08/07/2008 12:00:00 AM,127.96,129.05,126.54,127.795,127.01,127.02,126.72,0.51,-0.16,-0.02,128.23\n08/08/2008 12:00:00 AM,126.58,129.93,126.38,128.155,129.37,127.29,127.01,0.6,-0.02,0.02,128.47\n08/11/2008 12:00:00 AM,129.45,131.51,129.23,130.37,130.71,127.84,127.36,1.84,0.92,0.06,130.47\n08/12/2008 12:00:00 AM,130.28,130.34,128.73,129.535,129.35,128.3,127.82,0.81,-0.31,0.06,129.37\n08/13/2008 12:00:00 AM,128.79,129.65,127.67,128.66,128.57,128.53,128.24,0.03,-0.76,0,128.32\n08/14/2008 12:00:00 AM,127.84,130.28,127.75,129.015,129.54,128.69,128.51,0.25,-0.23,0.04,128.56\n08/15/2008 12:00:00 AM,129.93,130.5,129.3,129.9,130.17,128.92,128.71,0.74,0.26,0.04,129.34\n08/18/2008 12:00:00 AM,130.43,130.48,127.66,129.07,128.39,129.04,128.89,0.01,-0.41,0.04,128.47\n08/19/2008 12:00:00 AM,127.42,127.69,126.53,127.11,126.99,128.8,128.95,-1.24,-1.15,-0.05,126.6\n08/20/2008 12:00:00 AM,127.39,127.95,126.34,127.145,127.58,128.47,128.77,-0.88,-0.31,-0.02,126.84\n08/21/2008 12:00:00 AM,126.75,128.44,126.6,127.52,127.8,128.2,128.48,-0.4,0.22,-0.04,127.42\n08/22/2008 12:00:00 AM,128.67,129.65,127.8,128.725,129.65,128.18,128.26,0.48,0.79,0.03,128.78\n08/25/2008 12:00:00 AM,128.8,128.84,126.75,127.795,127.02,128.11,128.17,-0.25,-0.13,-0.03,127.98\n08/26/2008 12:00:00 AM,127.02,127.87,126.58,127.225,127.39,127.96,128.09,-0.54,-0.29,-0.02,127.56\n08/27/2008 12:00:00 AM,127.55,128.83,127.3,128.065,128.63,127.91,127.98,0.14,0.36,-0.02,128.5\n08/28/2008 12:00:00 AM,129.19,130.34,129.11,129.725,130.19,128.16,127.99,1.16,0.95,0.06,130.14\n08/29/2008 12:00:00 AM,129.68,130.14,128.51,129.325,128.79,128.43,128.17,0.59,0.05,0.02,129.64\n09/02/2008 12:00:00 AM,130.06,130.71,127.52,129.115,127.99,128.63,128.41,0.29,-0.21,0.04,129.33\n09/03/2008 12:00:00 AM,127.88,128.5,126.93,127.715,127.88,128.57,128.56,-0.68,-0.84,-0.03,127.86\n09/04/2008 12:00:00 AM,126.97,127.23,123.96,125.595,124.03,128.12,128.47,-1.84,-1.31,-0.07,125.77\n09/05/2008 12:00:00 AM,123.29,124.95,122,123.475,124.42,127.26,128.02,-2.69,-1.29,-0.16,123.79\n09/08/2008 12:00:00 AM,128.04,128.24,124.42,126.33,126.99,126.8,127.36,-0.14,1.28,-0.03,126.72\n09/09/2008 12:00:00 AM,127.1,127.36,122.8,125.08,123.22,126.37,126.81,-0.89,0.11,-0.1,125.46\n09/10/2008 12:00:00 AM,123.89,124.9,122.55,123.725,123.72,125.82,126.34,-1.51,-0.4,-0.11,124.14\n09/11/2008 12:00:00 AM,122.12,125.74,121.6,123.67,125.51,125.3,125.83,-1.13,0.08,-0.13,124.12\n09/12/2008 12:00:00 AM,124.29,126.21,123.83,125.02,126.09,125.06,125.37,0.04,0.93,-0.05,125.42\n09/15/2008 12:00:00 AM,121.81,124.28,119.89,122.085,120.09,124.53,124.99,-1.84,-0.93,-0.16,122.45\n09/16/2008 12:00:00 AM,117.2,122.32,117,119.66,122.1,123.62,124.44,-2.88,-1.26,-0.2,120.12\n09/17/2008 12:00:00 AM,119.64,120.38,116,118.19,116.61,122.48,123.56,-3.03,-0.75,-0.26,118.81\n09/18/2008 12:00:00 AM,118.05,121.79,113.8,117.795,120.07,121.36,122.48,-2.45,0.07,-0.23,118.57\n09/19/2008 12:00:00 AM,126.91,127.53,123.33,125.43,124.12,121.53,121.68,3.08,4.21,-0.01,126.05\n09/22/2008 12:00:00 AM,124.45,124.75,120.36,122.555,121.31,121.74,121.54,0.41,0.15,-0.07,122.83\n09/23/2008 12:00:00 AM,120.85,122.02,118.28,120.15,118.55,121.59,121.65,-1.24,-1.19,-0.17,120.23\n09/24/2008 12:00:00 AM,119.18,120,117.79,118.895,118.93,121.14,121.51,-1.7,-0.98,-0.17,118.9\n09/25/2008 12:00:00 AM,119.56,121.91,118.44,120.175,120.79,120.83,121.17,-0.42,0.45,-0.15,120.11\n09/26/2008 12:00:00 AM,118.83,121.5,118.51,120.005,120.85,120.59,120.84,-0.41,0.24,-0.12,119.85\n09/29/2008 12:00:00 AM,119.18,119.34,110.97,115.155,111.38,119.7,120.43,-3.39,-2.11,-0.28,115.07\n09/30/2008 12:00:00 AM,113.51,116.74,112.71,114.725,115.99,118.64,119.66,-2.73,-0.59,-0.25,114.89\n10/01/2008 12:00:00 AM,115.18,116.69,113.95,115.32,116.06,117.75,118.68,-1.61,0.57,-0.25,115.69\n10/02/2008 12:00:00 AM,114.95,115.11,111.06,113.085,111.85,116.73,117.71,-2.59,-0.43,-0.27,113.66\n10/03/2008 12:00:00 AM,112.86,115.45,109.68,112.565,110.34,115.73,116.73,-2.21,0.08,-0.3,113.37\n10/06/2008 12:00:00 AM,107.15,107.62,100.64,104.13,104.72,113.65,115.46,-6.98,-3.52,-0.51,105.34\n10/07/2008 12:00:00 AM,106.84,107.33,99.65,103.49,100.03,111.38,113.6,-5.48,-0.66,-0.53,105.25\n10/08/2008 12:00:00 AM,97.52,102.18,96.81,99.495,97.51,108.77,111.3,-6.52,-1.07,-0.59,101.74\n10/09/2008 12:00:00 AM,99.66,100.62,90.25,95.435,90.7,105.83,108.69,-7.33,-1.1,-0.71,98.17\n10/10/2008 12:00:00 AM,86.76,93.94,83.58,88.76,88.5,102.21,105.66,-9.57,-2.2,-0.84,92.02\n10/13/2008 12:00:00 AM,93.87,101.35,93.17,97.26,101.35,100.11,102.59,-1.54,4.95,-0.56,100.65\n10/14/2008 12:00:00 AM,104.7,105.53,97.11,101.32,99.85,99.48,100.48,1.46,4.83,-0.38,104.13\n10/15/2008 12:00:00 AM,97.46,97.8,89.71,93.755,90.02,98.41,99.37,-3.75,-1.47,-0.61,95.86\n10/16/2008 12:00:00 AM,91.29,94.77,86.54,90.655,93.77,96.87,98.29,-4.7,-1.53,-0.64,92.22\n10/17/2008 12:00:00 AM,91.99,98.59,91.65,95.12,93.21,96.02,97.04,-0.57,2.29,-0.49,95.99\n10/20/2008 12:00:00 AM,95.35,99.1,94.09,96.595,98.81,95.78,96.17,0.52,1.98,-0.39,96.55\n10/21/2008 12:00:00 AM,96.97,98.64,95.22,96.93,95.86,95.86,95.86,0.59,1.03,-0.39,95.97\n10/22/2008 12:00:00 AM,93.2,95.86,87.53,91.695,90.64,95.28,95.7,-2.9,-2.14,-0.5,90.12\n10/23/2008 12:00:00 AM,90.29,92.45,85.81,89.13,91.69,94.16,95.15,-3.74,-1.77,-0.57,87.37\n10/24/2008 12:00:00 AM,84.06,89.92,84,86.96,87.04,92.68,94.07,-4.1,-1.18,-0.58,85.33\n10/27/2008 12:00:00 AM,85.97,89.51,83.7,86.605,83.95,91.23,92.69,-3.2,0.09,-0.58,85.33\n10/28/2008 12:00:00 AM,87.34,94.24,84.53,89.385,93.76,90.41,91.39,-0.56,2.05,-0.43,88.49\n10/29/2008 12:00:00 AM,93.77,97.17,92.1,94.635,93.08,90.71,90.69,2.94,3.69,-0.28,93.94\n10/30/2008 12:00:00 AM,95.78,96.54,92.9,94.72,96.3,91.41,90.81,2.19,1.3,-0.23,94.12\n10/31/2008 12:00:00 AM,95.08,98.57,94.48,96.525,96.83,92.43,91.49,2.74,1.02,-0.19,96\n11/03/2008 12:00:00 AM,96.78,97.69,95.95,96.82,97.11,93.45,92.43,2.18,0.05,-0.14,96.36\n11/04/2008 12:00:00 AM,99.06,100.86,98.19,99.525,100.41,94.73,93.52,3.3,0.82,-0.08,99.08\n11/05/2008 12:00:00 AM,99.2,100.71,95,97.855,96.19,95.68,94.65,1.34,-1.1,-0.1,97.43\n11/06/2008 12:00:00 AM,94.46,95.44,90.06,92.75,90.86,95.61,95.43,-2.28,-3.31,-0.27,92.6\n11/07/2008 12:00:00 AM,91.65,94,90.86,92.43,93.86,95.12,95.51,-1.86,-1.38,-0.24,92.71\n11/10/2008 12:00:00 AM,95.21,95.53,90.92,93.225,92.63,94.66,95.13,-0.84,0.09,-0.23,93.87\n11/11/2008 12:00:00 AM,90.76,92.14,88.65,90.395,89.77,93.86,94.57,-2.42,-1.1,-0.27,91.38\n11/12/2008 12:00:00 AM,88.23,90.15,85.12,87.635,85.82,92.64,93.75,-3.51,-1.36,-0.37,89.02\n11/13/2008 12:00:00 AM,86.13,91.73,82.09,86.91,91.17,91.34,92.62,-3.01,-0.28,-0.34,88.64\n11/14/2008 12:00:00 AM,89.41,92.06,86.52,89.29,86.62,90.55,91.47,-0.67,1.65,-0.28,91.14\n11/17/2008 12:00:00 AM,86.38,88.56,85.16,86.86,85.47,89.7,90.53,-2.04,-0.15,-0.31,88.64\n11/18/2008 12:00:00 AM,85.15,87.22,82.91,85.065,87.08,88.7,89.66,-2.62,-0.51,-0.37,86.74\n11/19/2008 12:00:00 AM,85.91,86.87,80.92,83.895,81.5,87.62,88.68,-2.65,-0.28,-0.36,85.41\n11/20/2008 12:00:00 AM,80.13,82.51,75.05,78.78,75.45,85.92,87.47,-5.18,-2.03,-0.52,80.18\n11/21/2008 12:00:00 AM,77.46,80.9,74.34,77.62,79.52,84.05,85.88,-4.5,-0.52,-0.5,78.98\n11/24/2008 12:00:00 AM,81.89,86.99,81.17,84.08,85.03,83.35,84.34,0.84,3.78,-0.3,85.11\n11/25/2008 12:00:00 AM,87.3,87.51,83.82,85.665,85.66,83.42,83.54,1.62,2.54,-0.2,86.04\n11/26/2008 12:00:00 AM,84.3,89.19,84.24,86.715,88.97,83.92,83.53,1.85,1.44,-0.19,86.36\n11/28/2008 12:00:00 AM,88.63,90.13,88.48,89.305,90.09,84.9,84.04,2.99,1.54,-0.07,88.19\n12/01/2008 12:00:00 AM,87.51,87.55,81.86,84.705,82.11,85.25,84.74,-0.76,-2.08,-0.23,83.04\n12/02/2008 12:00:00 AM,83.47,85.49,82.04,83.765,85.27,85.16,85.14,-1.15,-1.41,-0.22,81.91\n12/03/2008 12:00:00 AM,83.4,87.83,83.14,85.485,87.32,85.18,85.19,0.26,0.33,-0.18,83.61\n12/04/2008 12:00:00 AM,86.06,88.05,83.74,85.895,85.3,85.29,85.2,0.45,0.31,-0.13,84.11\n12/05/2008 12:00:00 AM,83.65,88.42,82.24,85.33,87.93,85.34,85.27,-0.03,-0.2,-0.17,83.8\n12/08/2008 12:00:00 AM,90.34,92.38,89.8,91.09,91,86.2,85.54,3.64,2.65,0.04,89.79\n12/09/2008 12:00:00 AM,90.37,92.13,88.98,90.555,89.5,87.16,86.22,2.31,0.35,0,89.44\n12/10/2008 12:00:00 AM,90.32,91.36,89,90.18,90.11,87.97,87.12,1.44,-0.51,0.01,89.36\n12/11/2008 12:00:00 AM,89.54,91,87.37,89.185,87.94,88.46,87.89,0.41,-1.06,-0.04,88.77\n12/12/2008 12:00:00 AM,85.55,89.07,85.2,87.135,88.99,88.45,88.33,-1.01,-1.61,-0.08,87.23\n12/15/2008 12:00:00 AM,89.02,89.15,86.29,87.72,87.75,88.34,88.42,-0.36,-0.33,-0.08,88.33\n12/16/2008 12:00:00 AM,88.3,92.02,88.18,90.1,91.88,88.55,88.42,1.25,1.06,0.02,91.05\n12/17/2008 12:00:00 AM,90.84,92.43,90.06,91.245,90.99,89.03,88.62,1.64,0.85,0.03,92.31\n12/18/2008 12:00:00 AM,91.4,91.67,88.21,89.94,89.29,89.34,88.99,0.36,-0.53,0.01,91.02\n12/19/2008 12:00:00 AM,89.1,90.62,88.09,89.355,88.19,89.47,89.3,-0.11,-0.63,-0.03,90.4\n12/22/2008 12:00:00 AM,88.58,88.67,85.49,87.08,87.06,89.16,89.36,-1.53,-1.39,-0.07,88.09\n12/23/2008 12:00:00 AM,87.52,87.93,85.8,86.865,86.16,88.71,89.13,-1.25,-0.49,-0.1,87.81\n12/24/2008 12:00:00 AM,86.45,86.87,86,86.435,86.66,88.21,88.7,-1.18,-0.18,-0.08,87.26\n12/26/2008 12:00:00 AM,87.24,87.3,86.5,86.9,87.16,87.82,88.24,-0.56,0.4,-0.09,87.52\n12/29/2008 12:00:00 AM,87.24,87.33,85.6,86.465,86.91,87.48,87.83,-0.68,0.13,-0.07,86.84\n12/30/2008 12:00:00 AM,87.51,89.05,86.88,87.965,88.97,87.42,87.55,0.46,0.93,-0.05,88.04\n12/31/2008 12:00:00 AM,89.08,90.97,88.87,89.92,90.24,87.76,87.52,1.58,1.32,0.04,89.61\n01/02/2009 12:00:00 AM,90.44,93.44,89.85,91.645,92.96,88.46,87.85,2.24,1.16,0.07,90.88\n01/05/2009 12:00:00 AM,92.63,93.66,91.89,92.775,92.85,89.36,88.51,2.35,0.65,0.12,91.57\n01/06/2009 12:00:00 AM,93.64,94.45,92.68,93.565,93.47,90.31,89.37,2.21,0.2,0.11,92\n01/07/2009 12:00:00 AM,92,92.26,90.2,91.23,90.67,90.81,90.2,0.12,-1.5,0.06,89.53\n01/08/2009 12:00:00 AM,90.16,91.09,89.67,90.38,91.04,90.94,90.72,-0.45,-1.22,0.01,88.81\n01/09/2009 12:00:00 AM,91.16,91.32,88.67,89.995,89.09,90.85,90.89,-0.58,-0.71,0.02,88.73\n01/12/2009 12:00:00 AM,88.84,88.91,86.41,87.66,86.95,90.35,90.75,-1.9,-1.34,-0.08,86.89\n01/13/2009 12:00:00 AM,86.73,87.88,86.2,87.04,87.11,89.68,90.31,-1.78,-0.57,-0.07,86.89\n01/14/2009 12:00:00 AM,85.54,85.75,83.69,84.72,84.37,88.69,89.6,-2.77,-1,-0.16,85.26\n01/15/2009 12:00:00 AM,84.12,85.25,81.72,83.485,84.4,87.56,88.66,-2.8,-0.5,-0.16,84.73\n01/16/2009 12:00:00 AM,85.86,85.99,83.05,84.52,85.06,86.68,87.62,-1.37,0.84,-0.15,86.32\n01/20/2009 12:00:00 AM,84.23,85.06,80.05,82.555,80.57,85.74,86.67,-2.25,-0.2,-0.17,84.73\n01/21/2009 12:00:00 AM,81.94,84.24,80.47,82.355,84.05,84.89,85.77,-1.76,0.28,-0.19,84.74\n01/22/2009 12:00:00 AM,82.42,84.04,81.17,82.605,82.75,84.23,84.94,-1.12,0.63,-0.15,84.96\n01/23/2009 12:00:00 AM,80.9,83.99,80.57,82.28,83.11,83.7,84.26,-1.02,0.4,-0.17,84.38\n01/26/2009 12:00:00 AM,83.59,85.36,82.81,84.085,83.68,83.55,83.79,0.41,1.27,-0.09,85.71\n01/27/2009 12:00:00 AM,84.13,85.15,83.3,84.225,84.53,83.59,83.59,0.39,0.62,-0.1,85.19\n01/28/2009 12:00:00 AM,86.4,87.95,86.07,87.01,87.39,84.11,83.71,2.05,1.55,0.02,87.17\n01/29/2009 12:00:00 AM,86.11,86.36,84.46,85.41,84.55,84.49,84.07,0.47,-0.42,-0.06,84.77\n01/30/2009 12:00:00 AM,84.98,85.4,82.21,83.805,82.83,84.54,84.41,-0.68,-1.11,-0.08,82.56\n02/02/2009 12:00:00 AM,81.57,83.18,81.31,82.245,82.58,84.22,84.45,-1.49,-1.19,-0.15,80.66\n02/03/2009 12:00:00 AM,83.1,84.36,82.22,83.29,83.74,83.97,84.24,-0.41,0.2,-0.08,81.54\n02/04/2009 12:00:00 AM,84.3,85.37,83.04,84.205,83.33,83.9,84.01,0.28,0.63,-0.07,82.41\n02/05/2009 12:00:00 AM,82.7,85.29,82.12,83.705,84.57,83.85,83.91,-0.11,0.03,-0.06,82.03\n02/06/2009 12:00:00 AM,84.86,87.34,84.68,86.01,86.98,84.14,83.94,1.38,1.14,-0.01,84.55\n02/09/2009 12:00:00 AM,86.96,87.74,86.32,87.03,87.1,84.68,84.2,1.66,0.78,0.05,85.81\n02/10/2009 12:00:00 AM,86.27,87.03,82.45,84.74,83.11,84.89,84.6,-0.26,-1.05,-0.05,83.89\n02/11/2009 12:00:00 AM,83.45,84.05,82.4,83.225,83.6,84.73,84.8,-1.15,-1.23,-0.07,82.93\n02/12/2009 12:00:00 AM,82.17,83.82,81.05,82.435,83.66,84.33,84.67,-1.34,-0.77,-0.11,82.76\n02/13/2009 12:00:00 AM,83.55,84.24,82.74,83.49,82.76,84.06,84.36,-0.3,0.4,-0.05,84.35\n02/17/2009 12:00:00 AM,80.16,80.62,79.17,79.895,79.22,83.35,83.95,-2.51,-1.43,-0.18,81.26\n02/18/2009 12:00:00 AM,79.79,79.94,78.28,79.11,79.03,82.45,83.3,-2.32,-0.58,-0.17,80.95\n02/19/2009 12:00:00 AM,79.84,80.15,78.02,79.085,78.18,81.62,82.47,-1.7,0.19,-0.19,81.22\n02/20/2009 12:00:00 AM,76.73,78.34,75.77,77.055,77.42,80.64,81.58,-2.53,-0.5,-0.21,79.33\n02/23/2009 12:00:00 AM,78.27,78.27,74.59,76.43,74.65,79.65,80.64,-2.24,-0.02,-0.24,78.7\n02/24/2009 12:00:00 AM,75.29,77.95,74.7,76.325,77.48,78.78,79.68,-1.69,0.42,-0.21,78.4\n02/25/2009 12:00:00 AM,77.14,78.42,75.63,77.025,76.87,78.2,78.85,-0.78,0.91,-0.2,78.7\n02/26/2009 12:00:00 AM,77.82,78.38,75.53,76.955,75.62,77.79,78.24,-0.61,0.59,-0.16,78.07\n02/27/2009 12:00:00 AM,74.01,75.69,73.81,74.75,73.93,77.19,77.74,-1.85,-0.63,-0.25,75.31\n03/02/2009 12:00:00 AM,72.52,72.92,70.37,71.645,70.6,76.15,77.08,-3.32,-1.44,-0.3,71.79\n03/03/2009 12:00:00 AM,71.61,71.7,69.64,70.67,70.07,74.96,76.11,-3.03,-0.52,-0.34,70.54\n03/04/2009 12:00:00 AM,71.83,72.87,70.07,71.47,71.73,73.99,75.01,-1.69,0.76,-0.27,71.09\n03/05/2009 12:00:00 AM,70.1,70.87,68.17,69.52,68.8,72.97,73.98,-2.47,-0.18,-0.34,68.99\n03/06/2009 12:00:00 AM,69.4,70.45,67.1,68.775,68.92,71.97,72.97,-2.27,0.06,-0.32,68.22\n03/09/2009 12:00:00 AM,67.95,70,67.73,68.865,68.11,71.13,72.01,-1.59,0.55,-0.32,68.37\n03/10/2009 12:00:00 AM,69.51,72.37,69.37,70.87,72.17,70.77,71.25,0.12,1.57,-0.21,70.41\n03/11/2009 12:00:00 AM,73,73.75,71.83,72.79,72.64,70.93,70.9,1.31,1.68,-0.17,72.29\n03/12/2009 12:00:00 AM,72.62,75.75,71.97,73.86,75.5,71.42,71.01,1.63,1.08,-0.1,73.28\n03/13/2009 12:00:00 AM,76.01,76.98,74.73,75.855,76.09,72.25,71.51,2.46,1.13,-0.06,75.16\n03/16/2009 12:00:00 AM,76.96,77.97,75.81,76.89,75.86,73.25,72.29,2.44,0.53,0,76.06\n03/17/2009 12:00:00 AM,76.07,78.36,75.45,76.905,78.18,74.16,73.23,1.79,-0.27,-0.02,75.99\n03/18/2009 12:00:00 AM,77.81,80.9,77.07,78.985,79.93,75.22,74.2,2.62,0.46,0.07,78.02\n03/19/2009 12:00:00 AM,80.93,81,78.69,79.845,78.94,76.29,75.22,2.45,0.08,0.07,78.83\n03/20/2009 12:00:00 AM,78.76,78.91,76.53,77.72,76.71,76.91,76.18,0.43,-1.5,0.02,76.8\n03/23/2009 12:00:00 AM,78.74,82.29,78.31,80.3,82.22,77.65,76.94,1.95,0.36,0.07,79.54\n03/24/2009 12:00:00 AM,81.24,82.36,80.51,81.435,80.6,78.48,77.67,2.14,0.33,0.13,80.78\n03/25/2009 12:00:00 AM,81.23,82.7,79.06,80.88,81.45,79.15,78.44,1.2,-0.54,0.08,80.37\n03/26/2009 12:00:00 AM,82.25,83.3,81.32,82.31,83.11,79.86,79.16,1.78,0.16,0.14,81.96\n03/27/2009 12:00:00 AM,82.05,82.53,81.31,81.92,81.61,80.44,79.83,1.05,-0.47,0.1,81.72\n03/30/2009 12:00:00 AM,79.8,79.87,77.96,78.915,78.79,80.43,80.29,-1.15,-1.89,0.02,78.98\n03/31/2009 12:00:00 AM,79.56,81.08,79.05,80.065,79.52,80.38,80.42,-0.1,-0.17,0.04,80.43\n04/01/2009 12:00:00 AM,78.53,81.42,78.33,79.875,81.06,80.28,80.37,-0.2,-0.13,0.05,80.45\n04/02/2009 12:00:00 AM,83.08,84.61,82.73,83.67,83.43,80.74,80.42,2.27,1.81,0.14,84.29\n04/03/2009 12:00:00 AM,83.49,84.62,82.67,83.645,84.26,81.34,80.78,1.64,0.46,0.15,84.12\n04/06/2009 12:00:00 AM,83.34,83.81,82.29,83.05,83.6,81.82,81.31,0.81,-0.39,0.1,83.37\n04/07/2009 12:00:00 AM,82.25,82.65,81.51,82.08,81.65,82.04,81.76,-0.03,-0.84,0.09,82.28\n04/08/2009 12:00:00 AM,82.06,82.94,81.54,82.24,82.53,82.15,82.01,0.08,-0.35,0.07,82.32\n04/09/2009 12:00:00 AM,84.67,85.82,84.33,85.075,85.81,82.62,82.24,1.86,1.17,0.17,84.95\n04/13/2009 12:00:00 AM,84.92,86.54,84.58,85.56,85.83,83.23,82.66,1.66,0.45,0.15,85.15\n04/14/2009 12:00:00 AM,85.03,85.76,84.08,84.92,84.35,83.71,83.2,0.8,-0.42,0.15,84.29\n04/15/2009 12:00:00 AM,83.84,85.42,83.61,84.515,85.25,84.01,83.67,0.32,-0.58,0.1,83.76\n04/16/2009 12:00:00 AM,85.93,87.15,84.77,85.96,86.5,84.41,84.04,1.16,0.32,0.16,85.14\n04/17/2009 12:00:00 AM,86.83,87.65,86.14,86.895,87.08,84.93,84.44,1.43,0.38,0.16,86.01\n04/20/2009 12:00:00 AM,85.54,85.66,83.34,84.5,83.43,85.06,84.83,-0.48,-1.25,0.1,83.69\n04/21/2009 12:00:00 AM,82.82,85.13,82.75,83.94,85.06,84.95,85,-0.71,-0.81,0.06,83.36\n04/22/2009 12:00:00 AM,84.29,86.34,84.07,85.205,84.54,84.94,84.97,0.29,0.35,0.11,84.88\n04/23/2009 12:00:00 AM,84.71,85.42,83.63,84.525,85.37,84.88,84.93,-0.22,-0.19,0.06,84.45\n04/24/2009 12:00:00 AM,86.03,87.31,85.69,86.5,86.66,85.09,84.95,1.1,0.9,0.14,86.63\n04/27/2009 12:00:00 AM,85.68,87.01,85.54,86.275,85.84,85.35,85.1,0.65,0.14,0.1,86.53\n04/28/2009 12:00:00 AM,84.97,86.59,84.76,85.675,85.57,85.49,85.32,0.09,-0.36,0.1,86.05\n04/29/2009 12:00:00 AM,86.52,88.36,86.3,87.33,87.39,85.81,85.54,1.12,0.59,0.12,87.75\n04/30/2009 12:00:00 AM,88.55,89.02,86.92,87.97,87.42,86.25,85.84,1.22,0.37,0.16,88.32\n05/01/2009 12:00:00 AM,87.44,88.21,86.72,87.465,87.89,86.6,86.23,0.57,-0.31,0.11,87.71\n05/04/2009 12:00:00 AM,88.55,90.97,88.38,89.675,90.88,87.18,86.66,1.82,0.77,0.19,89.75\n05/05/2009 12:00:00 AM,90.57,90.93,89.84,90.385,90.57,87.87,87.21,1.77,0.36,0.18,90.2\n05/06/2009 12:00:00 AM,91.68,92.2,90.61,91.405,92.14,88.65,87.89,1.94,0.29,0.22,90.95\n05/07/2009 12:00:00 AM,93.01,93.15,90.28,91.715,90.86,89.39,88.64,1.61,-0.11,0.2,91\n05/08/2009 12:00:00 AM,92.03,93.22,91.44,92.33,92.98,90.11,89.39,1.56,-0.11,0.23,91.42\n05/11/2009 12:00:00 AM,91.7,92.11,91.04,91.575,91.24,90.59,90.05,0.65,-0.74,0.17,90.56\n05/12/2009 12:00:00 AM,91.63,91.83,89.85,90.84,90.97,90.82,90.53,0.01,-0.87,0.16,89.88\n05/13/2009 12:00:00 AM,89.74,90.01,88.5,89.255,88.68,90.67,90.72,-1.01,-1.19,0.08,88.5\n05/14/2009 12:00:00 AM,88.72,90.12,88.5,89.31,89.44,90.42,90.64,-0.7,-0.36,0.1,88.87\n05/15/2009 12:00:00 AM,89.37,90,88.15,89.075,88.71,90.13,90.41,-0.65,-0.13,0.06,88.98\n05/18/2009 12:00:00 AM,89.55,91.34,89.37,90.355,91.23,90.05,90.18,0.34,0.7,0.12,90.56\n05/19/2009 12:00:00 AM,91.18,91.97,90.81,91.39,91.12,90.21,90.11,0.91,0.8,0.12,91.78\n05/20/2009 12:00:00 AM,91.95,92.8,90.41,91.605,90.51,90.48,90.24,0.79,0.33,0.14,92.1\n05/21/2009 12:00:00 AM,89.46,89.8,88.26,89.03,89.21,90.37,90.39,-1.06,-1.23,0.04,89.65\n05/22/2009 12:00:00 AM,89.46,90,88.68,89.34,89.02,90.18,90.35,-0.57,-0.27,0.06,90.08\n05/26/2009 12:00:00 AM,88.36,91.56,88.32,89.94,91.3,90.07,90.2,-0.04,0.28,0.06,90.7\n05/27/2009 12:00:00 AM,91.44,91.75,89.53,90.64,89.67,90.11,90.11,0.42,0.49,0.1,91.31\n05/28/2009 12:00:00 AM,90.46,91.34,89.1,90.22,90.92,90.14,90.11,0.04,-0.03,0.06,90.73\n05/29/2009 12:00:00 AM,91.42,93.17,90.68,91.925,92.53,90.42,90.2,1.11,0.79,0.13,92.2\n06/01/2009 12:00:00 AM,93.67,95.17,93.43,94.3,94.43,91.09,90.52,2.32,1.3,0.17,94.2\n06/02/2009 12:00:00 AM,94.4,95.37,94.16,94.765,94.85,91.88,91.12,1.98,0.4,0.19,94.24\n06/03/2009 12:00:00 AM,94.04,94.13,92.76,93.445,93.65,92.41,91.81,0.6,-0.86,0.12,92.59\n06/04/2009 12:00:00 AM,94,94.67,93.3,93.985,94.53,92.84,92.39,0.78,-0.32,0.15,92.93\n06/05/2009 12:00:00 AM,95.49,95.67,93.8,94.735,94.55,93.29,92.85,1.04,0.03,0.15,93.55\n06/08/2009 12:00:00 AM,93.84,95.1,93.04,94.07,94.16,93.57,93.25,0.34,-0.52,0.14,92.88\n06/09/2009 12:00:00 AM,94.69,95.14,94.02,94.58,94.64,93.82,93.56,0.57,-0.09,0.12,93.5\n06/10/2009 12:00:00 AM,95.48,95.49,93.19,94.34,94.4,94,93.8,0.26,-0.27,0.13,93.45\n06/11/2009 12:00:00 AM,94.58,96.11,94.56,95.335,94.82,94.26,94.02,0.82,0.29,0.13,94.69\n06/12/2009 12:00:00 AM,94.4,95.14,94,94.57,95.08,94.4,94.23,0.11,-0.38,0.12,94.21\n06/15/2009 12:00:00 AM,93.96,94.02,92.4,93.21,92.9,94.28,94.34,-0.79,-0.86,0.05,93.22\n06/16/2009 12:00:00 AM,93.23,93.29,91.58,92.435,91.64,93.97,94.24,-1.06,-0.64,0.05,92.85\n06/17/2009 12:00:00 AM,91.6,92.33,90.83,91.58,91.55,93.5,93.93,-1.32,-0.5,0,92.39\n06/18/2009 12:00:00 AM,91.69,92.67,91.25,91.96,92.22,93.1,93.52,-0.72,0.21,0.03,93.08\n06/19/2009 12:00:00 AM,92.58,92.7,91.52,92.11,92.04,92.8,93.12,-0.42,0.35,0.01,93.39\n06/22/2009 12:00:00 AM,91.14,91.19,89.25,90.22,89.28,92.31,92.75,-1.51,-0.63,-0.03,91.59\n06/23/2009 12:00:00 AM,89.47,89.88,88.85,89.365,89.35,91.69,92.28,-1.64,-0.41,-0.07,90.77\n06/24/2009 12:00:00 AM,90.16,91.08,89.6,90.34,90.12,91.26,91.74,-0.57,0.6,-0.02,91.64\n06/25/2009 12:00:00 AM,89.67,92.17,89.57,90.87,92.08,91.04,91.31,-0.08,0.69,-0.02,91.9\n06/26/2009 12:00:00 AM,91.77,92.24,91.27,91.755,91.84,91.06,91.1,0.51,0.79,0.03,92.4\n06/29/2009 12:00:00 AM,92.11,92.82,91.6,92.21,92.7,91.23,91.1,0.66,0.51,0.02,92.38\n06/30/2009 12:00:00 AM,92.72,93.06,91.27,92.165,91.95,91.44,91.24,0.45,0.09,0.04,91.87\n07/01/2009 12:00:00 AM,92.34,93.23,92.21,92.72,92.33,91.7,91.45,0.68,0.2,0.03,91.99\n07/02/2009 12:00:00 AM,91.13,91.16,89.76,90.46,89.81,91.62,91.61,-0.95,-1.13,-0.02,89.45\n07/06/2009 12:00:00 AM,88.94,89.93,88.66,89.295,89.8,91.25,91.55,-1.43,-0.95,-0.07,88.22\n07/07/2009 12:00:00 AM,89.71,89.82,88,88.91,88.06,90.77,91.22,-1.28,-0.37,-0.06,87.93\n07/08/2009 12:00:00 AM,88.59,88.8,87,87.9,88,90.16,90.74,-1.58,-0.39,-0.11,87.13\n07/09/2009 12:00:00 AM,88.61,88.9,87.91,88.405,88.17,89.68,90.19,-0.82,0.38,-0.07,87.93\n07/10/2009 12:00:00 AM,87.7,88.49,87.35,87.92,87.96,89.23,89.69,-0.91,0.15,-0.1,87.77\n07/13/2009 12:00:00 AM,88.31,90.17,87.59,88.88,90.1,89.01,89.29,-0.05,0.73,-0.04,89.03\n07/14/2009 12:00:00 AM,90.38,90.69,89.73,90.21,90.61,89.1,89.09,0.81,1.02,-0.02,90.56\n07/15/2009 12:00:00 AM,91.81,93.51,91.68,92.595,93.26,89.65,89.22,2.11,1.48,0.08,92.98\n07/16/2009 12:00:00 AM,93,94.51,92.82,93.665,94.16,90.44,89.71,2.21,0.82,0.08,93.95\n07/17/2009 12:00:00 AM,94.06,94.32,93.54,93.93,94.13,91.26,90.45,1.78,0.06,0.11,94.05\n07/20/2009 12:00:00 AM,94.68,95.29,94.19,94.74,95.13,92.07,91.26,1.81,0.02,0.11,94.66\n07/21/2009 12:00:00 AM,95.87,95.9,94.42,95.16,95.57,92.84,92.06,1.58,-0.18,0.13,94.86\n07/22/2009 12:00:00 AM,94.96,96.13,94.89,95.51,95.55,93.52,92.82,1.37,-0.27,0.11,95.01\n07/23/2009 12:00:00 AM,95.61,98.08,95.53,96.805,97.66,94.26,93.53,1.82,0.19,0.17,96.12\n07/24/2009 12:00:00 AM,97.2,98.14,96.69,97.415,98.06,95,94.26,1.71,0.01,0.16,96.56\n07/27/2009 12:00:00 AM,97.88,98.4,97.34,97.87,98.35,95.71,94.99,1.53,-0.13,0.18,96.9\n07/28/2009 12:00:00 AM,97.66,98.37,97.06,97.715,97.89,96.27,95.67,1.02,-0.46,0.15,96.72\n07/29/2009 12:00:00 AM,97.44,98.09,96.98,97.535,97.65,96.67,96.23,0.62,-0.53,0.15,96.63\n07/30/2009 12:00:00 AM,98.83,99.83,98.6,99.215,98.67,97.19,96.7,1.52,0.41,0.17,98.43\n07/31/2009 12:00:00 AM,98.65,99.47,98.38,98.925,98.81,97.64,97.17,0.92,-0.23,0.17,98.28\n08/03/2009 12:00:00 AM,99.85,100.53,99.31,99.92,100.44,98.15,97.66,1.3,0.17,0.17,99.45\n08/04/2009 12:00:00 AM,99.99,100.84,99.78,100.31,100.7,98.66,98.15,1.19,0.01,0.19,100.01\n08/05/2009 12:00:00 AM,100.77,100.86,99.58,100.22,100.41,99.08,98.64,0.81,-0.28,0.16,100.09\n08/06/2009 12:00:00 AM,100.87,101.02,99.42,100.22,99.89,99.41,99.06,0.59,-0.31,0.17,100.27\n08/07/2009 12:00:00 AM,100.94,102.03,100.39,101.21,101.2,99.8,99.42,1.06,0.2,0.17,101.4\n08/10/2009 12:00:00 AM,100.74,101.22,100.27,100.745,100.99,100.08,99.77,0.47,-0.33,0.17,101.02\n08/11/2009 12:00:00 AM,100.54,100.61,99.46,100.035,99.73,100.19,100.04,-0.11,-0.6,0.12,100.41\n08/12/2009 12:00:00 AM,99.56,101.56,99.51,100.535,100.8,100.28,100.18,0.24,-0.04,0.14,100.97\n08/13/2009 12:00:00 AM,101.26,101.61,100.26,100.935,101.57,100.41,100.29,0.43,0.13,0.13,101.36\n08/14/2009 12:00:00 AM,101.52,101.6,99.7,100.65,100.79,100.49,100.4,0.13,-0.15,0.13,101.02\n08/17/2009 12:00:00 AM,98.85,98.95,98.11,98.53,98.31,100.24,100.41,-1.26,-1.11,0.04,98.88\n08/18/2009 12:00:00 AM,98.53,99.44,98.35,98.895,99.09,99.94,100.23,-0.68,-0.13,0.07,99.26\n08/19/2009 12:00:00 AM,98.31,100.3,98.21,99.255,99.96,99.73,99.96,-0.26,0.26,0.06,99.57\n08/20/2009 12:00:00 AM,100.09,101.22,99.87,100.545,100.99,99.77,99.79,0.63,0.82,0.11,100.73\n08/21/2009 12:00:00 AM,101.82,103.13,101.62,102.375,102.97,100.16,99.86,1.62,1.17,0.14,102.33\n08/24/2009 12:00:00 AM,103.39,103.95,102.59,103.27,102.96,100.77,100.22,1.75,0.68,0.18,102.93\n08/25/2009 12:00:00 AM,103.37,104.26,102.94,103.6,103.16,101.41,100.78,1.48,0.13,0.16,102.98\n08/26/2009 12:00:00 AM,102.84,103.64,102.49,103.065,103.17,101.9,101.37,0.74,-0.51,0.15,102.24\n08/27/2009 12:00:00 AM,103.11,103.72,101.94,102.83,103.4,102.22,101.86,0.38,-0.54,0.12,101.92\n08/28/2009 12:00:00 AM,104.23,104.35,102.67,103.51,103.38,102.53,102.22,0.71,-0.04,0.15,102.59\n08/31/2009 12:00:00 AM,102.37,102.58,101.79,102.185,102.46,102.6,102.47,-0.33,-0.79,0.08,101.37\n09/01/2009 12:00:00 AM,101.95,103.24,99.99,101.615,100.2,102.48,102.55,-0.6,-0.61,0.08,101.02\n09/02/2009 12:00:00 AM,99.78,100.44,99.57,100.005,99.82,102.08,102.41,-1.46,-0.94,0.01,99.75\n09/03/2009 12:00:00 AM,100.4,100.77,99.59,100.18,100.65,101.64,102.07,-0.95,-0.08,0.03,100.31\n09/04/2009 12:00:00 AM,100.85,102.09,100.55,101.32,102.06,101.43,101.7,0.04,0.72,0.04,101.76\n09/08/2009 12:00:00 AM,103,103.05,102.39,102.72,102.94,101.54,101.51,0.92,1.04,0.1,103.33\n09/09/2009 12:00:00 AM,103.12,104.08,102.8,103.44,103.73,101.86,101.59,1.12,0.69,0.1,104.09\n09/10/2009 12:00:00 AM,103.8,104.86,103.22,104.04,104.79,102.3,101.89,1.2,0.4,0.13,104.62\n09/11/2009 12:00:00 AM,104.99,105.3,104.28,104.79,104.77,102.83,102.32,1.35,0.3,0.13,105.21\n09/14/2009 12:00:00 AM,103.88,105.46,103.7,104.58,105.28,103.29,102.81,0.85,-0.24,0.13,104.8\n09/15/2009 12:00:00 AM,105.45,106.11,104.76,105.435,105.72,103.78,103.3,1.16,0.1,0.13,105.42\n09/16/2009 12:00:00 AM,106.1,107.34,105.73,106.535,107.32,104.37,103.8,1.54,0.33,0.18,106.24\n09/17/2009 12:00:00 AM,107.17,108.06,106.57,107.315,107.16,105.02,104.38,1.62,0.22,0.17,106.73\n09/18/2009 12:00:00 AM,107.15,107.16,106.36,106.76,106.72,105.53,104.98,0.82,-0.5,0.16,105.95\n09/21/2009 12:00:00 AM,105.89,106.72,105.66,106.19,106.45,105.82,105.47,0.23,-0.7,0.12,105.28\n09/22/2009 12:00:00 AM,107.08,107.37,106.6,106.985,107.07,106.1,105.81,0.68,-0.03,0.15,106.07\n09/23/2009 12:00:00 AM,107.32,108.03,105.99,107.01,106.18,106.34,106.09,0.51,-0.13,0.13,106.14\n09/24/2009 12:00:00 AM,106.41,106.64,104.55,105.595,105.01,106.32,106.27,-0.53,-0.84,0.09,104.9\n09/25/2009 12:00:00 AM,104.78,105.36,104.09,104.725,104.45,106.08,106.27,-0.94,-0.73,0.04,104.32\n09/28/2009 12:00:00 AM,104.85,106.55,104.83,105.69,106.32,105.93,106.1,-0.07,0.3,0.09,105.6\n09/29/2009 12:00:00 AM,106.51,107.02,105.78,106.4,106,105.94,105.97,0.4,0.52,0.09,106.56\n09/30/2009 12:00:00 AM,106.36,106.46,104.62,105.54,105.59,105.89,105.93,-0.26,-0.22,0.07,105.93\n10/01/2009 12:00:00 AM,105.34,105.73,102.95,104.34,103,105.64,105.84,-0.95,-0.63,0.01,104.97\n10/02/2009 12:00:00 AM,102.02,103.1,101.99,102.545,102.49,105.1,105.57,-1.83,-0.98,-0.02,103.43\n10/05/2009 12:00:00 AM,102.9,104.32,102.6,103.46,104.02,104.65,105.12,-0.75,0.32,-0.01,104.52\n10/06/2009 12:00:00 AM,104.77,106.11,104.71,105.41,105.51,104.59,104.75,0.7,1.27,0.07,106.46\n10/07/2009 12:00:00 AM,105.27,105.91,105.07,105.49,105.8,104.7,104.63,0.56,0.55,0.05,106.36\n10/08/2009 12:00:00 AM,106.55,107.17,106.15,106.66,106.61,105.03,104.75,1.15,0.72,0.1,107.24\n10/09/2009 12:00:00 AM,106.64,107.26,106.36,106.81,107.26,105.41,105.04,0.93,0.19,0.08,107.03\n10/12/2009 12:00:00 AM,107.76,108.09,107.28,107.685,107.68,105.89,105.43,1.23,0.31,0.12,107.51\n10/13/2009 12:00:00 AM,107.39,107.71,106.76,107.235,107.46,106.27,105.87,0.61,-0.33,0.08,106.69\n10/14/2009 12:00:00 AM,108.72,109.42,108.26,108.84,109.31,106.79,106.31,1.46,0.46,0.14,107.97\n10/15/2009 12:00:00 AM,108.78,109.71,108.73,109.22,109.71,107.34,106.8,1.31,0.11,0.13,108.06\n10/16/2009 12:00:00 AM,108.8,109.27,108.23,108.75,108.89,107.76,107.31,0.65,-0.45,0.12,107.44\n10/19/2009 12:00:00 AM,109.07,110.13,108.73,109.43,109.79,108.16,107.76,0.91,-0.04,0.12,108.09\n10/20/2009 12:00:00 AM,109.95,109.99,108.68,109.335,109.21,108.49,108.14,0.6,-0.25,0.13,108.08\n10/21/2009 12:00:00 AM,109.04,110.31,108.15,109.23,108.23,108.72,108.47,0.37,-0.3,0.1,108.17\n10/22/2009 12:00:00 AM,108.19,109.68,107.5,108.59,109.33,108.79,108.68,-0.14,-0.53,0.09,107.85\n10/23/2009 12:00:00 AM,109.69,109.76,107.63,108.695,108.08,108.8,108.78,-0.04,-0.19,0.07,108.33\n10/26/2009 12:00:00 AM,108.2,109.31,106.61,107.96,106.91,108.68,108.77,-0.49,-0.43,0.06,108.01\n10/27/2009 12:00:00 AM,107.03,107.39,106.16,106.775,106.42,108.36,108.63,-1.11,-0.67,0,107.27\n10/28/2009 12:00:00 AM,106.15,106.48,104.35,105.415,104.41,107.81,108.3,-1.67,-0.75,-0.02,106.35\n10/29/2009 12:00:00 AM,105.19,106.86,104.94,105.9,106.65,107.32,107.82,-0.91,0.21,-0.02,107.19\n10/30/2009 12:00:00 AM,106.3,106.62,103.44,105.03,103.56,106.8,107.31,-1.21,-0.1,-0.03,106.54\n11/02/2009 12:00:00 AM,104.13,105.41,103.08,104.245,104.32,106.22,106.78,-1.38,-0.16,-0.07,105.87\n11/03/2009 12:00:00 AM,103.74,104.8,103.54,104.17,104.65,105.71,106.24,-1.05,0.17,-0.05,105.78\n11/04/2009 12:00:00 AM,105.51,106.33,104.65,105.49,104.92,105.48,105.78,0.08,0.94,-0.02,106.89\n11/05/2009 12:00:00 AM,105.66,106.88,105.44,106.16,106.85,105.49,105.54,0.48,0.79,0.02,107.17\n11/06/2009 12:00:00 AM,106.26,107.4,106.05,106.725,107.13,105.67,105.53,0.71,0.57,0.01,107.24\n11/09/2009 12:00:00 AM,107.95,109.63,107.87,108.75,109.57,106.19,105.76,1.81,1.09,0.09,108.66\n11/10/2009 12:00:00 AM,109.31,109.93,108.97,109.45,109.59,106.87,106.23,1.76,0.5,0.09,108.73\n11/11/2009 12:00:00 AM,110.31,110.82,109.62,110.22,110.15,107.61,106.89,1.77,0.24,0.13,108.93\n11/12/2009 12:00:00 AM,110,110.57,108.75,109.66,109.03,108.2,107.57,0.93,-0.53,0.08,107.94\n11/13/2009 12:00:00 AM,109.31,110.09,108.75,109.42,109.62,108.6,108.15,0.52,-0.6,0.09,107.5\n11/16/2009 12:00:00 AM,110.38,111.69,110.32,111.005,111.21,109.1,108.63,1.39,0.34,0.12,109.03\n11/17/2009 12:00:00 AM,110.92,111.39,110.5,110.945,111.34,109.57,109.09,0.97,-0.14,0.12,109.06\n11/18/2009 12:00:00 AM,111.26,111.43,110.57,111,111.27,109.95,109.55,0.74,-0.25,0.1,109.38\n11/19/2009 12:00:00 AM,110.51,110.56,109.13,109.845,109.82,110.08,109.89,-0.2,-0.83,0.08,108.66\n11/20/2009 12:00:00 AM,109.26,109.76,109.01,109.385,109.43,110.03,110.04,-0.44,-0.6,0.04,108.77\n11/23/2009 12:00:00 AM,110.72,111.74,110.6,111.17,110.82,110.18,110.08,0.82,0.65,0.11,111.11\n11/24/2009 12:00:00 AM,111,111.2,110.01,110.605,110.99,110.3,110.17,0.24,-0.09,0.07,111.03\n11/25/2009 12:00:00 AM,111.17,111.5,110.82,111.16,111.38,110.47,110.31,0.52,0.17,0.1,112.01\n11/27/2009 12:00:00 AM,108.4,110.32,108.29,109.305,109.46,110.36,110.4,-0.8,-0.9,0.02,110.5\n11/30/2009 12:00:00 AM,109.48,110.2,109.02,109.61,109.94,110.21,110.35,-0.39,-0.15,0.04,111.07\n12/01/2009 12:00:00 AM,110.92,111.66,110.73,111.195,111.3,110.3,110.27,0.73,0.77,0.07,112.71\n12/02/2009 12:00:00 AM,111.28,112.01,110.92,111.465,111.25,110.5,110.33,0.7,0.38,0.09,112.83\n12/03/2009 12:00:00 AM,111.55,112.18,110.29,111.235,110.38,110.69,110.5,0.36,-0.06,0.06,112.33\n12/04/2009 12:00:00 AM,111.84,112.38,110.04,111.21,111.01,110.83,110.68,0.25,-0.12,0.08,111.95\n12/07/2009 12:00:00 AM,110.91,111.53,110.49,111.01,110.84,110.92,110.82,0.05,-0.21,0.05,111.36\n12/08/2009 12:00:00 AM,110.04,110.04,109.27,109.655,109.61,110.76,110.86,-0.82,-0.77,0.02,109.65\n12/09/2009 12:00:00 AM,109.58,110.18,109.02,109.6,110.02,110.53,110.74,-0.63,-0.25,0,109.3\n12/10/2009 12:00:00 AM,110.7,111.12,110.45,110.785,110.64,110.48,110.58,0.29,0.58,0.05,110.21\n12/11/2009 12:00:00 AM,111.11,111.36,110.61,110.985,111.11,110.54,110.51,0.34,0.34,0.04,110.16\n12/14/2009 12:00:00 AM,111.87,112,111.37,111.685,111.87,110.73,110.57,0.69,0.44,0.08,110.68\n12/15/2009 12:00:00 AM,111.46,111.92,111,111.46,111.35,110.91,110.72,0.36,-0.03,0.05,110.36\n12/16/2009 12:00:00 AM,111.8,112.13,111.27,111.7,111.52,111.09,110.91,0.41,0.02,0.07,110.62\n12/17/2009 12:00:00 AM,110.72,110.93,110.08,110.505,110.18,111.07,111.04,-0.46,-0.65,0.01,109.57\n12/18/2009 12:00:00 AM,110.2,110.3,109.28,109.79,110.21,110.88,111.03,-0.79,-0.58,0.01,109.15\n12/21/2009 12:00:00 AM,110.76,111.7,110.76,111.23,111.33,110.86,110.92,0.34,0.56,0.03,110.89\n12/22/2009 12:00:00 AM,111.57,111.97,111.43,111.7,111.73,110.97,110.89,0.55,0.45,0.06,111.63\n12/23/2009 12:00:00 AM,112,112.11,111.5,111.805,111.95,111.14,110.99,0.47,0.17,0.05,111.97\n12/24/2009 12:00:00 AM,112.19,112.61,112.18,112.395,112.56,111.38,111.16,0.71,0.27,0.08,112.75\n12/28/2009 12:00:00 AM,112.9,112.99,112.32,112.655,112.72,111.66,111.39,0.68,0.11,0.06,113.12\n12/29/2009 12:00:00 AM,113.01,113.03,112.55,112.79,112.56,111.94,111.66,0.58,-0.03,0.08,113.31\n12/30/2009 12:00:00 AM,112.23,112.65,112.17,112.41,112.52,112.11,111.91,0.18,-0.32,0.05,112.93\n12/31/2009 12:00:00 AM,112.77,112.8,111.39,112.095,111.44,112.17,112.08,-0.07,-0.36,0.05,112.6\n01/04/2010 12:00:00 AM,112.37,113.39,112.33,112.86,113.33,112.3,112.19,0.44,0.2,0.06,113.28\n01/05/2010 12:00:00 AM,113.26,113.68,112.85,113.265,113.63,112.49,112.31,0.58,0.21,0.08,113.53\n01/06/2010 12:00:00 AM,113.52,113.99,113.43,113.71,113.71,112.74,112.5,0.7,0.2,0.07,113.78\n01/07/2010 12:00:00 AM,113.5,114.33,113.18,113.755,114.19,112.98,112.74,0.54,-0.02,0.09,113.62\n01/08/2010 12:00:00 AM,113.89,114.62,113.66,114.14,114.57,113.24,112.99,0.64,0.06,0.08,113.82\n01/11/2010 12:00:00 AM,115.08,115.13,114.24,114.685,114.73,113.55,113.26,0.81,0.16,0.11,114.18\n01/12/2010 12:00:00 AM,113.97,114.21,113.22,113.715,113.66,113.7,113.51,-0.03,-0.55,0.05,113.11\n01/13/2010 12:00:00 AM,113.95,114.94,113.37,114.155,114.62,113.82,113.69,0.26,-0.07,0.08,113.52\n01/14/2010 12:00:00 AM,114.49,115.14,114.42,114.78,114.93,114,113.83,0.59,0.21,0.08,114.15\n01/15/2010 12:00:00 AM,114.73,114.84,113.2,114.02,113.64,114.08,113.98,-0.06,-0.37,0.07,113.45\n01/19/2010 12:00:00 AM,113.62,115.13,113.59,114.36,115.06,114.15,114.08,0.17,-0.01,0.06,113.92\n01/20/2010 12:00:00 AM,114.28,114.45,112.98,113.715,113.89,114.11,114.12,-0.28,-0.35,0.05,113.45\n01/21/2010 12:00:00 AM,113.92,114.27,111.56,112.915,111.7,113.92,114.07,-0.72,-0.5,0.01,112.88\n01/22/2010 12:00:00 AM,111.2,111.74,109.09,110.415,109.21,113.34,113.82,-2.11,-1.29,-0.05,110.7\n01/25/2010 12:00:00 AM,110.21,110.41,109.41,109.91,109.77,112.61,113.3,-1.86,-0.46,-0.08,110.56\n01/26/2010 12:00:00 AM,109.34,110.47,109.04,109.755,109.31,111.92,112.62,-1.45,0.1,-0.07,110.71\n01/27/2010 12:00:00 AM,109.17,110.08,108.33,109.205,109.83,111.26,111.93,-1.4,0.11,-0.1,110.37\n01/28/2010 12:00:00 AM,110.19,110.25,107.91,109.08,108.57,110.69,111.28,-1.1,0.3,-0.08,110.36\n01/29/2010 12:00:00 AM,109.04,109.8,107.22,108.51,107.39,110.15,110.7,-1.16,0.11,-0.11,109.79\n02/01/2010 12:00:00 AM,108.15,109.07,107.5,108.285,109.06,109.67,110.17,-0.99,0.19,-0.09,109.47\n02/02/2010 12:00:00 AM,109.26,110.59,108.88,109.735,110.38,109.5,109.75,0.21,0.99,-0.06,110.68\n02/03/2010 12:00:00 AM,109.88,110.48,109.51,109.995,109.83,109.51,109.55,0.32,0.59,-0.03,110.58\n02/04/2010 12:00:00 AM,108.98,109.03,106.42,107.725,106.44,109.25,109.44,-1.22,-0.86,-0.11,107.97\n02/05/2010 12:00:00 AM,106.56,106.88,104.58,105.73,106.66,108.64,109.16,-2.15,-1.16,-0.15,105.77\n02/08/2010 12:00:00 AM,106.74,107.33,105.81,106.57,105.89,108.1,108.66,-1.03,0.25,-0.13,106.44\n02/09/2010 12:00:00 AM,107.13,108.15,106.27,107.21,107.22,107.77,108.15,-0.34,0.66,-0.09,106.89\n02/10/2010 12:00:00 AM,107.05,107.6,106.11,106.855,107.01,107.51,107.78,-0.47,0.24,-0.11,106.38\n02/11/2010 12:00:00 AM,106.87,108.25,106.25,107.25,108.13,107.37,107.54,-0.09,0.41,-0.08,106.67\n02/12/2010 12:00:00 AM,106.99,108.1,106.51,107.305,108.04,107.31,107.39,-0.03,0.25,-0.09,106.67\n02/16/2010 12:00:00 AM,108.86,109.85,108.42,109.135,109.74,107.55,107.38,1.14,1,-0.01,108.45\n02/17/2010 12:00:00 AM,110.27,110.41,109.74,110.075,110.26,108.01,107.61,1.43,0.71,0,109.33\n02/18/2010 12:00:00 AM,110.08,111.14,110.04,110.59,110.91,108.56,108.04,1.37,0.3,0.04,109.81\n02/19/2010 12:00:00 AM,110.62,111.57,110.36,110.965,111.14,109.13,108.57,1.23,0.03,0.03,110.2\n02/22/2010 12:00:00 AM,111.55,111.58,110.83,111.205,111.16,109.64,109.12,1.05,-0.14,0.05,110.5\n02/23/2010 12:00:00 AM,110.86,111.2,109.52,110.36,109.81,109.95,109.59,0.22,-0.71,0.01,109.81\n02/24/2010 12:00:00 AM,110.14,111,109.86,110.43,110.82,110.13,109.92,0.21,-0.38,0.02,110.09\n02/25/2010 12:00:00 AM,109.24,110.75,108.94,109.845,110.67,110.16,110.09,-0.22,-0.51,-0.01,109.76\n02/26/2010 12:00:00 AM,110.77,111.12,110.11,110.615,110.74,110.24,110.17,0.33,0.16,0.03,110.76\n03/01/2010 12:00:00 AM,111.2,112,111.17,111.585,111.89,110.46,110.28,0.86,0.49,0.04,111.89\n03/02/2010 12:00:00 AM,112.37,112.74,112,112.37,112.2,110.83,110.5,1.12,0.45,0.08,112.74\n03/03/2010 12:00:00 AM,112.49,112.97,112.02,112.495,112.3,111.21,110.83,0.89,0.06,0.06,112.86\n03/04/2010 12:00:00 AM,112.45,112.8,112.03,112.415,112.64,111.53,111.2,0.6,-0.2,0.07,112.74\n03/05/2010 12:00:00 AM,113.38,114.34,113.1,113.72,114.25,111.98,111.56,1.27,0.39,0.09,113.94\n03/08/2010 12:00:00 AM,114.26,114.52,114.07,114.295,114.27,112.48,111.99,1.29,0.21,0.12,114.34\n03/09/2010 12:00:00 AM,113.93,114.99,113.87,114.43,114.46,112.96,112.48,1.02,-0.1,0.1,114.28\n03/10/2010 12:00:00 AM,114.51,115.28,114.41,114.845,114.97,113.42,112.96,1.01,-0.07,0.12,114.52\n03/11/2010 12:00:00 AM,114.7,115.48,114.35,114.915,115.45,113.81,113.4,0.78,-0.21,0.1,114.43\n03/12/2010 12:00:00 AM,115.95,115.97,115.14,115.555,115.46,114.22,113.81,0.97,0.04,0.13,114.95\n03/15/2010 12:00:00 AM,115.26,115.57,114.6,115.085,115.49,114.5,114.19,0.41,-0.4,0.09,114.42\n03/16/2010 12:00:00 AM,115.81,116.52,115.49,116.005,116.41,114.83,114.51,0.88,0.15,0.13,115.33\n03/17/2010 12:00:00 AM,116.76,117.48,116.71,117.095,117.1,115.28,114.86,1.33,0.42,0.14,116.41\n03/18/2010 12:00:00 AM,117.11,117.27,116.57,116.92,117.04,115.7,115.27,0.86,-0.14,0.14,116.27\n03/19/2010 12:00:00 AM,116.96,117.29,115.52,116.405,115.97,115.96,115.66,0.3,-0.5,0.1,115.87\n03/22/2010 12:00:00 AM,115.31,116.8,115.24,116.02,116.59,116.07,115.92,-0.03,-0.5,0.1,115.67\n03/23/2010 12:00:00 AM,116.76,117.51,116.38,116.945,117.41,116.24,116.08,0.57,0.2,0.11,116.78\n03/24/2010 12:00:00 AM,116.97,117.43,116.6,117.015,116.84,116.41,116.24,0.46,0.03,0.12,117.02\n03/25/2010 12:00:00 AM,117.63,118.1,116.51,117.305,116.65,116.61,116.42,0.52,0.06,0.11,117.45\n03/26/2010 12:00:00 AM,116.87,117.42,116.12,116.77,116.58,116.71,116.59,0.03,-0.33,0.1,117.04\n03/29/2010 12:00:00 AM,117.17,117.53,116.97,117.25,117.32,116.83,116.72,0.33,0.06,0.09,117.62\n03/30/2010 12:00:00 AM,117.46,117.83,116.91,117.37,117.4,116.95,116.83,0.32,0.02,0.1,117.77\n03/31/2010 12:00:00 AM,116.95,117.52,116.61,117.065,117,117.02,116.94,0.04,-0.2,0.07,117.47\n04/01/2010 12:00:00 AM,117.8,118.25,117.1,117.675,117.8,117.14,117.03,0.41,0.19,0.1,118.03\n04/05/2010 12:00:00 AM,118.25,118.84,117.92,118.38,118.76,117.36,117.16,0.75,0.35,0.1,118.62\n04/06/2010 12:00:00 AM,118.42,119.25,118.29,118.77,119.04,117.66,117.38,0.79,0.21,0.12,118.85\n04/07/2010 12:00:00 AM,118.8,119.36,117.81,118.585,118.36,117.9,117.64,0.46,-0.15,0.1,118.49\n04/08/2010 12:00:00 AM,117.95,118.97,117.6,118.285,118.77,118.05,117.88,0.14,-0.32,0.1,118.05\n04/09/2010 12:00:00 AM,119.02,119.6,118.8,119.2,119.55,118.28,118.07,0.69,0.24,0.1,118.85\n04/12/2010 12:00:00 AM,119.7,120.05,119.56,119.805,119.74,118.59,118.3,0.88,0.27,0.13,119.32\n04/13/2010 12:00:00 AM,119.62,120.04,119,119.52,119.83,118.84,118.57,0.46,-0.18,0.1,118.95\n04/14/2010 12:00:00 AM,120.27,121.19,120.08,120.635,121.19,119.2,118.87,1.04,0.34,0.14,120.01\n04/15/2010 12:00:00 AM,120.99,121.57,120.95,121.26,121.29,119.64,119.22,1.16,0.26,0.14,120.6\n04/16/2010 12:00:00 AM,120.86,121.29,118.75,120.02,119.36,119.86,119.58,0.05,-0.7,0.11,119.4\n04/19/2010 12:00:00 AM,119.01,119.93,118.47,119.2,119.81,119.85,119.8,-0.49,-0.77,0.06,118.74\n04/20/2010 12:00:00 AM,120.56,120.98,120.17,120.575,120.88,119.95,119.88,0.52,0.37,0.11,120.29\n04/21/2010 12:00:00 AM,120.95,121.23,119.99,120.61,120.66,120.09,119.96,0.4,0.11,0.09,120.48\n04/22/2010 12:00:00 AM,119.81,121.17,119.12,120.145,121.02,120.15,120.07,0,-0.24,0.09,120.18\n04/23/2010 12:00:00 AM,120.94,121.86,120.63,121.245,121.81,120.33,120.18,0.7,0.4,0.1,121.42\n04/26/2010 12:00:00 AM,121.85,122.12,121.23,121.675,121.35,120.6,120.35,0.78,0.27,0.12,121.91\n04/27/2010 12:00:00 AM,120.65,121.33,118.25,119.79,118.48,120.58,120.53,-0.63,-0.92,0.04,120.11\n04/28/2010 12:00:00 AM,119.05,119.68,118.27,118.975,119.38,120.34,120.52,-0.98,-0.73,0.03,119.42\n04/29/2010 12:00:00 AM,120.1,121.11,120.07,120.59,120.86,120.28,120.39,0.32,0.61,0.06,121.09\n04/30/2010 12:00:00 AM,120.88,121.01,118.78,119.895,118.81,120.21,120.28,-0.21,-0.07,0.05,120.37\n05/03/2010 12:00:00 AM,119.38,120.68,119.2,119.94,120.35,120.14,120.21,-0.13,0.03,0.04,120.37\n05/04/2010 12:00:00 AM,119.01,119.03,116.92,117.975,117.52,119.8,120.07,-1.34,-0.89,-0.01,118.37\n05/05/2010 12:00:00 AM,116.54,117.8,115.97,116.885,116.82,119.24,119.74,-1.67,-0.7,-0.06,117.31\n05/06/2010 12:00:00 AM,116.26,117,105,111,112.94,117.82,119.02,-4.96,-2.81,-0.22,111.63\n05/07/2010 12:00:00 AM,112.64,113.77,109.58,111.675,111.26,116.39,117.82,-3.17,-0.07,-0.2,112.59\n05/10/2010 12:00:00 AM,115.81,116.65,114.91,115.78,116.16,115.75,116.59,0.31,2.62,-0.05,116.73\n05/11/2010 12:00:00 AM,115.07,117.36,114.91,116.135,115.83,115.56,115.86,0.45,1.47,-0.05,116.9\n05/12/2010 12:00:00 AM,116.29,117.62,116.09,116.855,117.45,115.68,115.64,0.79,1,-0.01,117.33\n05/13/2010 12:00:00 AM,117.13,117.68,115.89,116.785,115.99,115.89,115.7,0.53,0.29,-0.03,116.93\n05/14/2010 12:00:00 AM,115.12,115.33,112.87,114.1,113.89,115.7,115.79,-1.33,-1.27,-0.09,114\n05/17/2010 12:00:00 AM,114.2,114.52,111.77,113.145,113.95,115.26,115.64,-1.57,-0.85,-0.13,112.94\n05/18/2010 12:00:00 AM,114.88,115.22,112.03,113.625,112.4,114.85,115.27,-0.84,0.11,-0.09,113.35\n05/19/2010 12:00:00 AM,111.77,112.77,110.36,111.565,111.76,114.22,114.8,-1.92,-0.75,-0.16,111.3\n05/20/2010 12:00:00 AM,109.38,109.89,107.47,108.68,107.54,113.17,114.11,-3.23,-1.36,-0.23,108.61\n05/21/2010 12:00:00 AM,105.91,109.38,105.36,107.37,109.11,111.92,113.12,-3.18,-0.64,-0.27,107.61\n05/24/2010 12:00:00 AM,108.52,109.39,107.61,108.5,107.71,110.94,111.99,-1.59,0.89,-0.2,109.01\n05/25/2010 12:00:00 AM,105.11,107.87,104.38,106.125,107.82,109.87,110.92,-2.67,-0.33,-0.28,106.88\n05/26/2010 12:00:00 AM,108.48,109.47,106.85,108.16,107.17,109.21,109.97,-0.64,1.36,-0.19,109.09\n05/27/2010 12:00:00 AM,109.19,110.8,108.78,109.79,110.76,109.04,109.33,0.57,1.61,-0.14,110.68\n05/28/2010 12:00:00 AM,110.64,110.72,108.85,109.785,109.37,109.08,109.09,0.41,0.69,-0.12,110.5\n06/01/2010 12:00:00 AM,108.35,109.95,107.37,108.66,107.53,109.04,109.06,-0.42,-0.29,-0.16,109.18\n06/02/2010 12:00:00 AM,108.08,110.34,107.51,108.925,110.33,109.01,109.04,-0.13,0.04,-0.13,109.24\n06/03/2010 12:00:00 AM,110.65,111.06,109.58,110.32,110.71,109.19,109.06,0.79,0.7,-0.09,110.36\n06/04/2010 12:00:00 AM,108.61,109.33,106.46,107.895,106.82,109.07,109.11,-0.97,-0.98,-0.15,107.71\n06/07/2010 12:00:00 AM,107.2,107.61,105.41,106.51,105.49,108.65,108.99,-1.59,-0.98,-0.19,106.24\n06/08/2010 12:00:00 AM,105.57,106.83,104.65,105.74,106.62,108.06,108.6,-1.64,-0.54,-0.19,105.49\n06/09/2010 12:00:00 AM,107.24,108.28,105.6,106.94,106.05,107.67,108.11,-0.43,0.65,-0.16,106.71\n06/10/2010 12:00:00 AM,107.86,109.28,107.69,108.485,109.15,107.65,107.76,0.67,1.17,-0.09,108.22\n06/11/2010 12:00:00 AM,108.19,109.75,108.12,108.935,109.68,107.82,107.7,0.77,0.68,-0.08,108.59\n06/14/2010 12:00:00 AM,110.52,111.12,109.4,110.26,109.51,108.25,107.88,1.41,0.81,-0.02,109.83\n06/15/2010 12:00:00 AM,110.28,112.1,110.09,111.095,112,108.82,108.28,1.55,0.5,-0.01,110.56\n06/16/2010 12:00:00 AM,111.42,112.42,111.2,111.81,111.96,109.48,108.84,1.58,0.26,0.03,111.17\n06/17/2010 12:00:00 AM,112.28,112.33,111.05,111.69,112.14,110.05,109.46,1.07,-0.27,0.01,111\n06/18/2010 12:00:00 AM,111.83,112.13,111.37,111.75,111.73,110.52,110.03,0.82,-0.35,0.02,111.08\n06/21/2010 12:00:00 AM,113.12,113.2,110.79,111.995,111.41,110.91,110.5,0.75,-0.24,0.02,111.4\n06/22/2010 12:00:00 AM,111.41,111.9,109.41,110.655,109.57,111.03,110.84,-0.31,-0.92,-0.01,110.22\n06/23/2010 12:00:00 AM,109.64,110.03,108.48,109.255,109.23,110.81,110.94,-1.11,-1.07,-0.07,109.09\n06/24/2010 12:00:00 AM,108.69,108.83,107.14,107.985,107.42,110.32,110.74,-1.62,-0.91,-0.09,108.18\n06/25/2010 12:00:00 AM,107.74,108.42,106.77,107.595,107.87,109.73,110.29,-1.42,-0.3,-0.11,108.15\n06/28/2010 12:00:00 AM,108.03,108.32,107.14,107.73,107.53,109.21,109.75,-0.95,0.23,-0.09,108.58\n06/29/2010 12:00:00 AM,106.02,106.07,103.55,104.81,104.21,108.37,109.13,-2.55,-1.06,-0.18,105.95\n06/30/2010 12:00:00 AM,103.92,104.88,102.88,103.88,103.22,107.4,108.34,-2.44,-0.45,-0.19,105.29\n07/01/2010 12:00:00 AM,103.15,103.49,101.13,102.31,102.76,106.28,107.36,-2.78,-0.45,-0.24,103.92\n07/02/2010 12:00:00 AM,103.11,103.42,101.62,102.52,102.2,105.31,106.32,-1.88,0.46,-0.2,104.21\n07/06/2010 12:00:00 AM,103.64,104.37,101.88,103.125,102.87,104.61,105.38,-0.98,0.93,-0.19,104.7\n07/07/2010 12:00:00 AM,103.13,106.24,103.02,104.63,106.11,104.35,104.72,0.24,1.4,-0.12,105.89\n07/08/2010 12:00:00 AM,107,107.28,105.91,106.595,107.16,104.58,104.48,1.43,1.6,-0.06,107.33\n07/09/2010 12:00:00 AM,107.13,107.97,106.93,107.45,107.96,105.09,104.65,1.58,0.91,-0.02,107.53\n07/12/2010 12:00:00 AM,107.6,108.24,107.15,107.695,108.03,105.66,105.1,1.31,0.22,-0.02,107.13\n07/13/2010 12:00:00 AM,109.15,110.09,108.93,109.51,109.66,106.44,105.71,2.1,0.68,0.05,108.32\n07/14/2010 12:00:00 AM,109.31,110.08,108.86,109.47,109.65,107.18,106.43,1.5,-0.13,0.03,107.76\n07/15/2010 12:00:00 AM,109.61,110.06,108.17,109.115,109.68,107.75,107.14,0.87,-0.57,0.03,107.09\n07/16/2010 12:00:00 AM,109.09,109.21,106.45,107.83,106.66,107.98,107.66,-0.19,-1.1,-0.02,105.75\n07/19/2010 12:00:00 AM,107.05,107.63,106.22,106.925,107.29,107.91,107.9,-0.71,-0.96,-0.04,105.05\n07/20/2010 12:00:00 AM,105.87,108.56,105.82,107.19,108.48,107.78,107.89,-0.35,-0.21,-0.04,105.72\n07/21/2010 12:00:00 AM,109.04,109.07,106.63,107.85,107.07,107.74,107.8,0.17,0.3,0,106.86\n07/22/2010 12:00:00 AM,108.34,109.94,108.33,109.135,109.46,107.93,107.8,0.94,0.75,0.02,108.63\n07/23/2010 12:00:00 AM,109.24,110.57,108.93,109.75,110.41,108.27,107.97,1.07,0.49,0.05,109.7\n07/26/2010 12:00:00 AM,110.6,111.67,110.29,110.98,111.56,108.79,108.31,1.56,0.61,0.07,111.3\n07/27/2010 12:00:00 AM,112.17,112.29,111.11,111.7,111.55,109.42,108.82,1.59,0.33,0.1,112.28\n07/28/2010 12:00:00 AM,111.32,111.66,110.46,111.06,110.83,109.9,109.38,0.75,-0.48,0.07,111.82\n07/29/2010 12:00:00 AM,111.52,111.82,109.41,110.615,110.29,110.18,109.85,0.26,-0.62,0.06,111.51\n07/30/2010 12:00:00 AM,109.17,110.86,108.98,109.92,110.27,110.25,110.13,-0.25,-0.71,0.02,110.89\n08/02/2010 12:00:00 AM,111.99,112.94,111.54,112.24,112.76,110.57,110.32,1.29,0.8,0.11,113.14\n08/03/2010 12:00:00 AM,112.48,112.77,111.85,112.31,112.22,110.95,110.59,0.98,0.19,0.09,112.99\n08/04/2010 12:00:00 AM,112.53,113.11,112.16,112.635,112.97,111.34,110.95,0.92,0.05,0.11,113.03\n08/05/2010 12:00:00 AM,112.25,112.91,112.08,112.495,112.85,111.65,111.32,0.58,-0.23,0.08,112.57\n08/06/2010 12:00:00 AM,111.74,112.57,110.92,111.745,112.39,111.79,111.61,-0.06,-0.6,0.07,111.55\n08/09/2010 12:00:00 AM,112.92,113.18,112.32,112.75,112.99,111.98,111.8,0.6,0.19,0.08,112.31\n08/10/2010 12:00:00 AM,112.04,112.98,111.37,112.175,112.38,112.08,111.96,0.07,-0.29,0.07,111.53\n08/11/2010 12:00:00 AM,110.65,110.69,109.12,109.905,109.3,111.8,111.99,-1.39,-1.25,-0.01,109.22\n08/12/2010 12:00:00 AM,107.65,109.02,107.6,108.31,108.63,111.19,111.72,-2.03,-1.1,-0.05,107.77\n08/13/2010 12:00:00 AM,108.29,108.96,108.18,108.57,108.31,110.57,111.19,-1.31,0,-0.05,108.25\n08/16/2010 12:00:00 AM,107.57,108.61,107.18,107.895,108.26,109.94,110.57,-1.38,-0.03,-0.06,107.83\n08/17/2010 12:00:00 AM,109.19,110.39,108.88,109.635,109.59,109.66,110.03,0.1,1.12,-0.01,109.79\n08/18/2010 12:00:00 AM,109.54,110.38,108.91,109.645,109.79,109.55,109.7,0.08,0.57,0,109.93\n08/19/2010 12:00:00 AM,109.22,109.49,107.43,108.46,107.88,109.35,109.53,-0.69,-0.3,-0.05,108.88\n08/20/2010 12:00:00 AM,107.56,107.94,106.75,107.345,107.53,108.98,109.31,-1.21,-0.55,-0.07,107.92\n08/23/2010 12:00:00 AM,108.04,108.57,107.07,107.82,107.12,108.67,108.99,-0.58,0.19,-0.06,108.51\n08/24/2010 12:00:00 AM,105.95,106.39,104.97,105.68,105.53,108.11,108.61,-1.78,-0.8,-0.11,106.46\n08/25/2010 12:00:00 AM,104.95,106.34,104.29,105.315,105.94,107.49,108.1,-1.53,-0.21,-0.13,106.18\n08/26/2010 12:00:00 AM,106.44,106.58,104.88,105.73,105.23,107,107.52,-0.85,0.41,-0.09,106.59\n08/27/2010 12:00:00 AM,105.89,106.97,104.31,105.64,106.86,106.61,107.03,-0.67,0.35,-0.1,106.41\n08/30/2010 12:00:00 AM,106.58,106.91,105.3,106.105,105.31,106.39,106.65,-0.19,0.54,-0.07,106.7\n08/31/2010 12:00:00 AM,104.92,105.98,104.49,105.235,105.31,106.14,106.38,-0.69,-0.1,-0.11,105.63\n09/01/2010 12:00:00 AM,106.73,108.61,106.66,107.635,108.46,106.26,106.23,1.02,1.23,-0.01,107.75\n09/02/2010 12:00:00 AM,108.72,109.49,108.49,108.99,109.47,106.7,106.34,1.61,1.06,0.02,108.72\n09/03/2010 12:00:00 AM,110.54,110.99,109.95,110.47,110.89,107.42,106.77,2.11,0.9,0.07,109.78\n09/07/2010 12:00:00 AM,110.37,110.51,109.55,110.03,109.64,108.08,107.41,1.25,-0.21,0.04,108.97\n09/08/2010 12:00:00 AM,109.85,110.85,109.81,110.33,110.41,108.66,108.06,1.1,-0.25,0.06,109.04\n09/09/2010 12:00:00 AM,111.64,111.68,110.62,111.15,110.92,109.24,108.66,1.32,0.02,0.07,109.73\n09/10/2010 12:00:00 AM,111.12,111.61,110.87,111.24,111.48,109.76,109.23,1.02,-0.23,0.08,109.8\n09/13/2010 12:00:00 AM,112.58,112.95,112.13,112.54,112.72,110.36,109.78,1.57,0.29,0.1,111.18\n09/14/2010 12:00:00 AM,112.5,113.29,112.08,112.685,112.65,110.93,110.35,1.23,-0.11,0.11,111.48\n09/15/2010 12:00:00 AM,112.32,113.21,111.98,112.595,113.08,111.39,110.9,0.84,-0.36,0.09,111.65\n09/16/2010 12:00:00 AM,112.73,113.12,112.35,112.735,113.05,111.76,111.37,0.7,-0.29,0.1,112.13\n09/17/2010 12:00:00 AM,113.04,113.15,112.18,112.665,112.49,112.04,111.74,0.46,-0.32,0.08,112.42\n09/20/2010 12:00:00 AM,112.88,114.46,112.52,113.49,114.21,112.35,112.05,0.86,0.14,0.12,113.6\n09/21/2010 12:00:00 AM,114.3,114.84,113.51,114.175,113.98,112.74,112.37,1.06,0.23,0.12,114.55\n09/22/2010 12:00:00 AM,113.8,114.44,113.1,113.77,113.42,113.04,112.72,0.51,-0.29,0.11,114.35\n09/23/2010 12:00:00 AM,112.49,113.67,112.18,112.925,112.5,113.14,112.99,-0.16,-0.66,0.07,113.69\n09/24/2010 12:00:00 AM,113.75,114.9,113.65,114.275,114.82,113.34,113.16,0.74,0.35,0.11,115.12\n09/27/2010 12:00:00 AM,114.86,114.99,114.16,114.575,114.27,113.6,113.35,0.73,0.18,0.11,115.36\n09/28/2010 12:00:00 AM,114.42,115.04,113.18,114.11,114.67,113.77,113.58,0.23,-0.28,0.1,114.78\n09/29/2010 12:00:00 AM,114.39,114.91,114.02,114.465,114.47,113.94,113.77,0.4,-0.02,0.09,114.96\n09/30/2010 12:00:00 AM,115.05,115.79,113.59,114.69,114.13,114.11,113.94,0.43,0.02,0.1,114.95\n10/01/2010 12:00:00 AM,114.99,115.12,113.93,114.525,114.61,114.24,114.1,0.21,-0.15,0.08,114.55\n10/04/2010 12:00:00 AM,114.37,114.85,113.18,114.015,113.75,114.25,114.21,-0.17,-0.36,0.07,113.83\n10/05/2010 12:00:00 AM,114.8,116.32,114.67,115.495,116.04,114.44,114.3,0.82,0.56,0.1,115.1\n10/06/2010 12:00:00 AM,116.02,116.33,115.56,115.945,116.03,114.73,114.47,0.88,0.34,0.12,115.34\n10/07/2010 12:00:00 AM,116.5,116.53,115.19,115.86,115.89,115.01,114.73,0.58,-0.05,0.1,115.1\n10/08/2010 12:00:00 AM,116.05,116.86,115.61,116.235,116.54,115.29,115.01,0.66,0.03,0.12,115.39\n10/11/2010 12:00:00 AM,116.72,116.97,116.25,116.61,116.65,115.59,115.3,0.72,0.05,0.11,115.74\n10/12/2010 12:00:00 AM,116.27,117.35,115.65,116.5,117.01,115.84,115.58,0.45,-0.18,0.11,115.69\n10/13/2010 12:00:00 AM,117.66,118.55,117.38,117.965,117.92,116.25,115.88,1.26,0.51,0.14,117.24\n10/14/2010 12:00:00 AM,117.81,118.01,116.72,117.365,117.46,116.56,116.22,0.54,-0.28,0.12,116.76\n10/15/2010 12:00:00 AM,118.28,118.35,116.76,117.555,117.7,116.83,116.55,0.51,-0.17,0.11,117.14\n10/18/2010 12:00:00 AM,117.73,118.67,117.26,117.965,118.54,117.1,116.83,0.63,0,0.13,117.75\n10/19/2010 12:00:00 AM,117.19,117.85,116.02,116.935,116.73,117.18,117.05,-0.2,-0.62,0.08,116.94\n10/20/2010 12:00:00 AM,116.94,118.44,116.87,117.655,117.87,117.28,117.18,0.32,0.07,0.11,117.88\n10/21/2010 12:00:00 AM,118.4,119.09,117.21,118.15,118.13,117.44,117.29,0.54,0.22,0.1,118.52\n10/22/2010 12:00:00 AM,118.31,118.53,118,118.265,118.35,117.62,117.45,0.47,0.06,0.11,118.72\n10/25/2010 12:00:00 AM,119.14,119.76,118.61,119.185,118.7,117.92,117.65,0.93,0.37,0.12,119.65\n10/26/2010 12:00:00 AM,118.1,118.84,117.87,118.355,118.72,118.1,117.89,0.14,-0.4,0.1,118.77\n10/27/2010 12:00:00 AM,117.89,118.51,117.26,117.885,118.38,118.14,118.06,-0.19,-0.46,0.07,118.26\n10/28/2010 12:00:00 AM,119.06,119.11,117.83,118.47,118.4,118.2,118.14,0.23,0.09,0.09,118.77\n10/29/2010 12:00:00 AM,118.28,118.72,118.07,118.395,118.49,118.25,118.2,0.12,-0.03,0.07,118.58\n11/01/2010 12:00:00 AM,119.07,119.75,117.85,118.8,118.53,118.35,118.26,0.35,0.16,0.09,118.85\n11/02/2010 12:00:00 AM,119.42,119.75,119.1,119.425,119.47,118.55,118.38,0.65,0.31,0.1,119.31\n11/03/2010 12:00:00 AM,119.68,120.02,118.45,119.235,119.95,118.72,118.54,0.35,-0.07,0.1,118.96\n11/04/2010 12:00:00 AM,121.28,122.32,120.94,121.63,122.26,119.21,118.8,1.78,1.04,0.15,121.17\n11/05/2010 12:00:00 AM,122.34,122.92,122.18,122.55,122.72,119.89,119.26,1.88,0.6,0.18,121.85\n11/08/2010 12:00:00 AM,122.34,122.69,121.94,122.315,122.49,120.5,119.87,1.22,-0.21,0.15,121.44\n11/09/2010 12:00:00 AM,122.82,122.95,121.12,122.035,121.61,120.96,120.46,0.7,-0.5,0.15,121.1\n11/10/2010 12:00:00 AM,121.58,122.16,120.66,121.41,122.1,121.2,120.9,0.11,-0.71,0.11,120.53\n11/11/2010 12:00:00 AM,121.05,121.82,120.68,121.25,121.64,121.3,121.16,-0.02,-0.46,0.11,120.53\n11/12/2010 12:00:00 AM,120.82,121.35,119.65,120.5,120.2,121.22,121.25,-0.49,-0.58,0.07,120.02\n11/15/2010 12:00:00 AM,120.58,121.05,119.98,120.515,120.03,121.09,121.21,-0.35,-0.18,0.07,120.34\n11/16/2010 12:00:00 AM,119.29,119.49,117.59,118.54,118.16,120.66,121.01,-1.51,-0.95,0,118.72\n11/17/2010 12:00:00 AM,118.21,118.71,117.86,118.285,118.22,120.16,120.64,-1.26,-0.28,0,118.85\n11/18/2010 12:00:00 AM,119.36,120.39,119.35,119.87,119.96,119.92,120.22,0.09,0.89,0.04,120.7\n11/19/2010 12:00:00 AM,119.9,120.34,119.25,119.795,120.29,119.81,119.95,0.02,0.42,0.05,120.75\n11/22/2010 12:00:00 AM,119.69,120.24,118.77,119.505,120.19,119.73,119.82,-0.17,0.07,0.02,120.5\n11/23/2010 12:00:00 AM,118.77,119.01,117.99,118.5,118.45,119.51,119.69,-0.76,-0.41,0,119.48\n11/24/2010 12:00:00 AM,119.2,120.23,119.18,119.705,120.2,119.46,119.55,0.21,0.52,0.03,120.57\n11/26/2010 12:00:00 AM,119.16,119.81,118.8,119.305,118.8,119.42,119.46,-0.1,0.03,0.03,119.95\n11/29/2010 12:00:00 AM,118.5,119.48,117.74,118.61,119.16,119.28,119.39,-0.52,-0.3,-0.01,119.03\n11/30/2010 12:00:00 AM,117.98,119.17,117.81,118.49,118.49,119.12,119.28,-0.45,-0.11,0,118.68\n12/01/2010 12:00:00 AM,120.2,121.24,120.19,120.715,121.01,119.29,119.2,1.09,1.1,0.06,120.6\n12/02/2010 12:00:00 AM,121.2,122.65,121.13,121.89,122.56,119.73,119.35,1.54,0.9,0.1,121.4\n12/03/2010 12:00:00 AM,122.14,123.03,122.11,122.57,122.89,120.32,119.77,1.55,0.46,0.1,121.72\n12/06/2010 12:00:00 AM,122.63,123.04,122.5,122.77,122.76,120.9,120.31,1.25,-0.01,0.11,121.64\n12/07/2010 12:00:00 AM,123.94,124.01,122.76,123.385,122.83,121.48,120.9,1.3,0.01,0.12,122.07\n12/08/2010 12:00:00 AM,122.98,123.38,122.41,122.895,123.28,121.91,121.44,0.63,-0.51,0.1,121.52\n12/09/2010 12:00:00 AM,123.97,124.02,123.15,123.585,123.76,122.32,121.91,0.9,-0.07,0.11,122.29\n12/10/2010 12:00:00 AM,124.14,124.6,123.73,124.165,124.48,122.75,122.32,1.02,0.06,0.13,123.02\n12/13/2010 12:00:00 AM,125.05,125.2,124.52,124.86,124.56,123.22,122.76,1.19,0.15,0.13,123.93\n12/14/2010 12:00:00 AM,124.75,125.23,124.29,124.76,124.67,123.62,123.2,0.8,-0.22,0.13,124.1\n12/15/2010 12:00:00 AM,124.44,124.93,123.89,124.41,124.1,123.89,123.59,0.36,-0.44,0.1,124.08\n12/16/2010 12:00:00 AM,124.18,124.91,123.75,124.33,124.82,124.06,123.87,0.21,-0.34,0.11,124.36\n12/17/2010 12:00:00 AM,124.08,124.46,123.82,124.14,124.3,124.13,124.04,0.03,-0.3,0.08,124.51\n12/20/2010 12:00:00 AM,124.64,124.9,123.98,124.44,124.6,124.21,124.13,0.21,-0.01,0.1,125.09\n12/21/2010 12:00:00 AM,124.99,125.47,124.87,125.17,125.39,124.38,124.23,0.62,0.31,0.1,125.99\n12/22/2010 12:00:00 AM,125.48,125.82,125.41,125.615,125.78,124.62,124.4,0.73,0.25,0.12,126.48\n12/23/2010 12:00:00 AM,125.64,125.78,125.29,125.535,125.6,124.85,124.62,0.48,-0.06,0.1,126.35\n12/27/2010 12:00:00 AM,125.13,125.77,125.04,125.405,125.65,125.02,124.83,0.27,-0.19,0.1,126.1\n12/28/2010 12:00:00 AM,125.9,125.95,125.5,125.725,125.83,125.18,125.02,0.4,0,0.09,126.24\n12/29/2010 12:00:00 AM,125.98,126.2,125.9,126.05,125.92,125.37,125.19,0.5,0.07,0.11,126.32\n12/30/2010 12:00:00 AM,125.8,126.13,125.53,125.83,125.72,125.51,125.36,0.22,-0.17,0.09,125.85\n12/31/2010 12:00:00 AM,125.53,125.87,125.33,125.6,125.75,125.58,125.5,0.01,-0.24,0.08,125.39\n01/03/2011 12:00:00 AM,126.71,127.6,126.66,127.13,127.05,125.83,125.63,0.98,0.61,0.12,126.69\n01/04/2011 12:00:00 AM,127.33,127.37,126.19,126.78,126.98,126.07,125.83,0.49,-0.06,0.11,126.13\n01/05/2011 12:00:00 AM,126.58,127.72,126.46,127.09,127.64,126.3,126.07,0.55,0.01,0.1,126.3\n01/06/2011 12:00:00 AM,127.69,127.83,127.01,127.42,127.39,126.56,126.31,0.61,0.05,0.12,126.56\n01/07/2011 12:00:00 AM,127.56,127.77,126.15,126.96,127.14,126.71,126.53,0.15,-0.32,0.08,126.11\n01/10/2011 12:00:00 AM,126.58,127.16,126.2,126.68,126.98,126.77,126.69,-0.07,-0.33,0.08,125.95\n01/11/2011 12:00:00 AM,127.44,127.74,126.95,127.345,127.43,126.87,126.78,0.37,0.17,0.09,126.79\n01/12/2011 12:00:00 AM,128.21,128.72,127.99,128.355,128.58,127.13,126.91,0.92,0.5,0.12,127.96\n01/13/2011 12:00:00 AM,128.63,128.69,127.99,128.34,128.37,127.4,127.13,0.66,0.06,0.1,128.1\n01/14/2011 12:00:00 AM,128.19,129.33,128.1,128.715,129.3,127.7,127.41,0.71,0.07,0.12,128.64\n01/18/2011 12:00:00 AM,129.18,129.64,129.03,129.335,129.52,128.05,127.71,0.91,0.18,0.12,129.38\n01/19/2011 12:00:00 AM,129.41,129.5,127.91,128.705,128.25,128.28,128.02,0.26,-0.4,0.11,128.87\n01/20/2011 12:00:00 AM,127.96,128.4,127.13,127.765,128.08,128.29,128.23,-0.41,-0.71,0.06,128.07\n01/21/2011 12:00:00 AM,128.88,129.17,128.23,128.7,128.37,128.36,128.31,0.3,0.17,0.1,129.11\n01/24/2011 12:00:00 AM,128.29,129.25,128.26,128.755,129.1,128.44,128.36,0.25,0.06,0.08,129.19\n01/25/2011 12:00:00 AM,128.76,129.28,128.11,128.695,129.17,128.51,128.44,0.15,-0.04,0.08,129.12\n01/26/2011 12:00:00 AM,129.49,130.05,129.23,129.64,129.67,128.7,128.54,0.71,0.4,0.1,129.98\n01/27/2011 12:00:00 AM,129.7,130.21,129.47,129.84,129.99,128.94,128.71,0.64,0.16,0.11,130.04\n01/28/2011 12:00:00 AM,130.14,130.35,127.51,128.93,127.72,129.03,128.9,-0.11,-0.49,0.06,129\n01/31/2011 12:00:00 AM,128.07,128.78,127.75,128.265,128.68,128.95,128.99,-0.51,-0.55,0.05,128.25\n02/01/2011 12:00:00 AM,129.46,130.97,129.38,130.175,130.74,129.1,129.01,0.85,0.74,0.09,130.05\n02/02/2011 12:00:00 AM,130.4,130.84,130.33,130.585,130.49,129.38,129.13,0.88,0.41,0.11,130.29\n02/03/2011 12:00:00 AM,130.26,130.98,129.57,130.275,130.78,129.61,129.37,0.44,-0.12,0.09,129.85\n02/04/2011 12:00:00 AM,130.83,131.2,130.23,130.715,131.15,129.86,129.61,0.6,0.05,0.1,130.2\n02/07/2011 12:00:00 AM,131.44,132.4,131.43,131.915,131.97,130.26,129.9,1.2,0.47,0.12,131.32\n02/08/2011 12:00:00 AM,132.09,132.64,131.73,132.185,132.57,130.69,130.27,1.04,0.12,0.14,131.53\n02/09/2011 12:00:00 AM,132.21,132.63,131.61,132.12,132.27,131.06,130.68,0.72,-0.19,0.12,131.46\n02/10/2011 12:00:00 AM,131.6,132.47,131.3,131.885,132.32,131.33,131.04,0.37,-0.36,0.11,131.29\n02/11/2011 12:00:00 AM,131.8,133.28,131.77,132.525,133.11,131.6,131.33,0.68,0.04,0.11,132.04\n02/14/2011 12:00:00 AM,133.03,133.54,132.88,133.21,133.43,131.94,131.62,0.93,0.21,0.14,132.83\n02/15/2011 12:00:00 AM,133.02,133.22,132.32,132.77,133.01,132.19,131.92,0.39,-0.29,0.11,132.52\n02/16/2011 12:00:00 AM,133.46,134.01,133.19,133.6,133.85,132.49,132.21,0.81,0.17,0.14,133.48\n02/17/2011 12:00:00 AM,133.46,134.43,133.34,133.885,134.25,132.81,132.5,0.77,0.06,0.13,133.87\n02/18/2011 12:00:00 AM,134.37,134.69,134.06,134.375,134.53,133.16,132.82,0.87,0.1,0.14,134.43\n02/22/2011 12:00:00 AM,133.12,133.86,131.47,132.665,131.83,133.22,133.09,-0.45,-0.94,0.07,132.82\n02/23/2011 12:00:00 AM,131.75,132.07,130.21,131.14,131.02,132.94,133.14,-1.3,-1.12,0.03,131.48\n02/24/2011 12:00:00 AM,130.88,131.44,129.7,130.57,130.93,132.49,132.9,-1.31,-0.56,0,131.11\n02/25/2011 12:00:00 AM,131.48,132.41,131.4,131.905,132.33,132.23,132.54,-0.1,0.64,0.05,132.56\n02/28/2011 12:00:00 AM,132.82,133.32,132.38,132.85,133.15,132.22,132.29,0.53,0.82,0.07,133.48\n03/01/2011 12:00:00 AM,133.57,133.69,130.89,132.29,130.93,132.23,132.23,0.03,0.05,0.06,132.82\n03/02/2011 12:00:00 AM,130.75,131.82,130.35,131.085,131.21,132.06,132.19,-0.75,-0.56,0.01,131.53\n03/03/2011 12:00:00 AM,132.4,133.62,132.39,133.005,133.47,132.14,132.12,0.68,0.78,0.08,133.31\n03/04/2011 12:00:00 AM,133.37,133.63,131.6,132.615,132.47,132.24,132.14,0.25,0.08,0.05,132.71\n03/07/2011 12:00:00 AM,132.86,133.16,130.74,131.95,131.43,132.23,132.21,-0.25,-0.34,0.04,131.87\n03/08/2011 12:00:00 AM,131.64,133,131.07,132.035,132.58,132.2,132.23,-0.12,-0.09,0.03,131.81\n03/09/2011 12:00:00 AM,132.32,132.8,131.6,132.2,132.39,132.19,132.21,0.02,0.06,0.04,131.86\n03/10/2011 12:00:00 AM,131,131.18,129.81,130.495,129.94,131.94,132.13,-1.07,-0.79,-0.02,130.13\n03/11/2011 12:00:00 AM,129.52,131.31,129.49,130.4,130.84,131.62,131.92,-0.84,-0.22,-0.02,130.09\n03/14/2011 12:00:00 AM,129.99,130.48,129.06,129.77,130.05,131.22,131.6,-1.01,-0.23,-0.04,129.57\n03/15/2011 12:00:00 AM,126.59,129.33,126.5,127.915,128.56,130.59,131.16,-1.92,-0.79,-0.09,127.91\n03/16/2011 12:00:00 AM,128.15,128.57,125.28,126.925,126.18,129.81,130.56,-2.02,-0.47,-0.12,127.19\n03/17/2011 12:00:00 AM,128,128.39,127.1,127.745,127.85,129.22,129.86,-0.95,0.58,-0.08,128.25\n03/18/2011 12:00:00 AM,128.84,128.88,127.51,128.195,127.76,128.84,129.27,-0.4,0.72,-0.07,128.83\n03/21/2011 12:00:00 AM,129.35,130.01,129.2,129.605,129.74,128.81,128.92,0.61,1.13,-0.01,130.25\n03/22/2011 12:00:00 AM,129.72,129.89,129.17,129.53,129.29,128.9,128.84,0.39,0.41,-0.03,130.08\n03/23/2011 12:00:00 AM,128.93,130,128.32,129.16,129.66,128.97,128.89,0.05,-0.06,-0.03,129.58\n03/24/2011 12:00:00 AM,130.4,131.09,129.67,130.38,130.9,129.21,129.01,0.81,0.52,0,130.62\n03/25/2011 12:00:00 AM,131.24,131.87,130.89,131.38,131.3,129.61,129.25,1.23,0.57,0.04,131.35\n03/28/2011 12:00:00 AM,131.58,131.92,130.94,131.43,130.98,130.03,129.62,0.92,0.05,0.03,131.13\n03/29/2011 12:00:00 AM,130.87,131.9,130.44,131.17,131.86,130.36,130.01,0.51,-0.31,0.03,130.64\n03/30/2011 12:00:00 AM,132.55,133.16,132.36,132.76,132.77,130.84,130.4,1.38,0.49,0.07,132.03\n03/31/2011 12:00:00 AM,132.6,132.96,132.45,132.705,132.59,131.29,130.83,0.97,-0.07,0.07,131.81\n04/01/2011 12:00:00 AM,133.41,133.77,132.83,133.3,133.15,131.76,131.29,1.08,0.04,0.08,132.31\n04/04/2011 12:00:00 AM,133.43,133.67,132.88,133.275,133.26,132.16,131.74,0.77,-0.22,0.08,132.28\n04/05/2011 12:00:00 AM,133,133.83,132.94,133.385,133.24,132.49,132.14,0.63,-0.22,0.07,132.48\n04/06/2011 12:00:00 AM,133.88,134,133.12,133.56,133.66,132.77,132.48,0.57,-0.16,0.08,132.81\n04/07/2011 12:00:00 AM,133.42,133.98,132.66,133.32,133.32,132.96,132.75,0.26,-0.31,0.06,132.79\n04/08/2011 12:00:00 AM,133.91,133.99,132.31,133.15,132.86,133.06,132.94,0.08,-0.29,0.06,132.89\n04/11/2011 12:00:00 AM,133,133.45,132.14,132.795,132.46,133.06,133.03,-0.17,-0.33,0.04,132.83\n04/12/2011 12:00:00 AM,131.72,131.98,130.99,131.485,131.47,132.83,133,-0.96,-0.75,0,131.85\n04/13/2011 12:00:00 AM,132.08,132.18,130.96,131.57,131.46,132.56,132.82,-0.64,-0.14,0,132.24\n04/14/2011 12:00:00 AM,130.7,131.76,130.27,131.015,131.56,132.23,132.54,-0.82,-0.19,-0.01,131.92\n04/15/2011 12:00:00 AM,131.8,132.37,131.41,131.89,132.04,132.05,132.27,-0.04,0.5,0.01,132.93\n04/18/2011 12:00:00 AM,130.59,130.81,129.51,130.16,130.56,131.71,132.01,-1.13,-0.55,-0.04,131.25\n04/19/2011 12:00:00 AM,130.76,131.35,130.44,130.895,131.31,131.46,131.73,-0.35,0.3,-0.02,131.95\n04/20/2011 12:00:00 AM,132.88,133.39,132.79,133.09,133.1,131.6,131.56,1.14,1.28,0.06,133.93\n04/21/2011 12:00:00 AM,133.79,133.84,133.35,133.595,133.78,131.95,131.65,1.15,0.66,0.06,134.07\n04/25/2011 12:00:00 AM,133.68,133.86,133.2,133.53,133.64,132.31,131.95,0.79,0.06,0.06,133.61\n04/26/2011 12:00:00 AM,134.05,135.06,133.91,134.485,134.79,132.77,132.33,1.19,0.3,0.08,134.15\n04/27/2011 12:00:00 AM,135.05,135.87,134.5,135.185,135.67,133.29,132.78,1.31,0.23,0.11,134.45\n04/28/2011 12:00:00 AM,135.43,136.29,135.41,135.85,136.11,133.87,133.31,1.37,0.15,0.11,134.76\n04/29/2011 12:00:00 AM,136.17,136.57,135.98,136.275,136.43,134.44,133.87,1.27,-0.01,0.13,134.93\n05/02/2011 12:00:00 AM,137.07,137.18,135.95,136.565,136.22,134.97,134.43,1.11,-0.14,0.12,135.08\n05/03/2011 12:00:00 AM,135.96,136.19,135.04,135.615,135.73,135.26,134.91,0.2,-0.76,0.09,134.16\n05/04/2011 12:00:00 AM,135.67,135.73,134.23,134.98,134.83,135.34,135.21,-0.26,-0.73,0.06,133.74\n05/05/2011 12:00:00 AM,134.08,134.95,133.02,133.985,133.61,135.17,135.28,-0.82,-0.79,0.03,133.12\n05/06/2011 12:00:00 AM,134.94,135.63,133.68,134.655,134.2,135.03,135.17,-0.17,0.1,0.04,134.23\n05/09/2011 12:00:00 AM,134.19,135.11,133.98,134.545,134.72,134.9,135.03,-0.19,0.05,0.05,134.55\n05/10/2011 12:00:00 AM,135.16,136.11,135,135.555,135.87,134.95,134.95,0.5,0.56,0.06,135.94\n05/11/2011 12:00:00 AM,135.66,135.69,133.82,134.755,134.44,134.94,134.94,-0.14,-0.19,0.05,135.46\n05/12/2011 12:00:00 AM,134.09,135.36,133.39,134.375,135.08,134.85,134.92,-0.35,-0.25,0.02,135.35\n05/13/2011 12:00:00 AM,135.15,135.34,133.56,134.45,134.04,134.76,134.85,-0.2,-0.02,0.03,135.59\n05/16/2011 12:00:00 AM,133.56,134.61,132.97,133.79,133.19,134.58,134.74,-0.57,-0.28,0,134.99\n05/17/2011 12:00:00 AM,132.69,133.35,132.12,132.735,133.17,134.25,134.54,-1.08,-0.53,-0.02,133.94\n05/18/2011 12:00:00 AM,133.24,134.5,132.95,133.725,134.36,134.04,134.28,-0.16,0.43,0,134.82\n05/19/2011 12:00:00 AM,134.8,135.03,133.94,134.485,134.68,134.03,134.09,0.37,0.63,0.03,135.31\n05/20/2011 12:00:00 AM,134.33,134.68,133.36,134.02,133.61,134.02,134.03,-0.03,0.02,0.01,134.52\n05/23/2011 12:00:00 AM,131.98,132.46,131.59,132.025,132.06,133.73,133.95,-1.29,-0.94,-0.04,132.23\n05/24/2011 12:00:00 AM,132.44,132.73,131.7,132.215,131.95,133.39,133.72,-0.82,-0.13,-0.05,132.19\n05/25/2011 12:00:00 AM,131.42,132.94,131.38,132.16,132.39,133.09,133.4,-0.63,0.08,-0.04,131.92\n05/26/2011 12:00:00 AM,132.03,133.24,131.78,132.51,133,132.89,133.11,-0.23,0.35,-0.03,132.07\n05/27/2011 12:00:00 AM,133.37,133.87,132.96,133.415,133.51,132.89,132.94,0.41,0.66,0.01,132.8\n05/31/2011 12:00:00 AM,134.76,134.92,133.84,134.38,134.9,133.1,132.94,0.91,0.71,0.03,133.6\n06/01/2011 12:00:00 AM,134.51,134.6,131.76,133.18,131.87,133.2,133.07,-0.1,-0.41,0,132.32\n06/02/2011 12:00:00 AM,131.96,132.24,130.96,131.6,131.73,133,133.13,-1.08,-0.95,-0.06,130.84\n06/03/2011 12:00:00 AM,130.15,131.42,130.08,130.75,130.42,132.6,132.95,-1.33,-0.68,-0.07,130.23\n06/06/2011 12:00:00 AM,130.09,130.36,128.87,129.615,129.04,132.01,132.55,-1.69,-0.61,-0.11,129.42\n06/07/2011 12:00:00 AM,129.7,130.07,128.85,129.46,128.96,131.41,132.01,-1.32,-0.02,-0.1,129.64\n06/08/2011 12:00:00 AM,128.76,129.19,128.18,128.685,128.42,130.78,131.4,-1.46,-0.09,-0.13,129.22\n06/09/2011 12:00:00 AM,128.77,129.93,128.46,129.195,129.4,130.31,130.82,-0.73,0.51,-0.1,130.02\n06/10/2011 12:00:00 AM,128.84,128.93,127.26,128.095,127.6,129.81,130.3,-1.23,-0.11,-0.13,129.14\n06/13/2011 12:00:00 AM,127.89,128.24,127.05,127.645,127.7,129.3,129.81,-1.18,-0.02,-0.13,128.84\n06/14/2011 12:00:00 AM,128.87,129.77,128.82,129.295,129.32,129.11,129.38,0.19,1.03,-0.08,130.48\n06/15/2011 12:00:00 AM,128.25,128.65,126.68,127.665,127.02,128.82,129.08,-0.9,-0.29,-0.12,128.73\n06/16/2011 12:00:00 AM,127.09,127.97,126.32,127.145,127.3,128.47,128.8,-0.98,-0.22,-0.13,128.06\n06/17/2011 12:00:00 AM,127.93,127.94,126.62,127.28,127.05,128.16,128.48,-0.63,0.15,-0.11,127.98\n06/20/2011 12:00:00 AM,126.62,127.97,126.58,127.275,127.7,127.91,128.17,-0.46,0.2,-0.12,127.7\n06/21/2011 12:00:00 AM,128.36,129.7,127.75,128.725,129.45,127.94,127.98,0.59,0.89,-0.06,128.81\n06/22/2011 12:00:00 AM,129.05,129.81,128.59,129.2,128.67,128.13,127.98,0.73,0.55,-0.05,128.9\n06/23/2011 12:00:00 AM,127.16,128.64,126.19,127.415,128.3,128.1,128.07,-0.61,-0.73,-0.09,126.82\n06/24/2011 12:00:00 AM,128.27,128.37,126.62,127.495,126.81,128,128.08,-0.39,-0.23,-0.09,126.73\n06/27/2011 12:00:00 AM,126.9,128.43,126.64,127.535,127.94,127.89,128,-0.26,-0.02,-0.07,126.68\n06/28/2011 12:00:00 AM,128.45,129.63,128.27,128.95,129.61,128.01,127.95,0.71,0.72,-0.04,128.05\n06/29/2011 12:00:00 AM,130.18,130.93,129.63,130.28,130.72,128.38,128.07,1.37,0.86,0.02,129.34\n06/30/2011 12:00:00 AM,131.14,132.18,130.71,131.445,131.97,128.97,128.44,1.73,0.7,0.04,130.48\n07/01/2011 12:00:00 AM,132.01,134.1,131.78,132.94,133.92,129.78,129.03,2.21,0.7,0.09,131.96\n07/05/2011 12:00:00 AM,133.78,134.08,133.39,133.735,133.81,130.66,129.8,2.11,0.26,0.1,132.76\n07/06/2011 12:00:00 AM,133.48,134.14,133.11,133.625,133.97,131.43,130.63,1.47,-0.37,0.1,132.73\n07/07/2011 12:00:00 AM,135.16,135.7,134.88,135.29,135.36,132.29,131.46,2.12,0.28,0.14,134.51\n07/08/2011 12:00:00 AM,133.83,134.44,133.39,133.915,134.4,132.86,132.22,0.67,-0.96,0.1,133.31\n07/11/2011 12:00:00 AM,132.75,133.18,131.66,132.42,131.97,133.01,132.75,-0.47,-1.35,0.04,132.12\n07/12/2011 12:00:00 AM,131.69,132.78,131.36,132.07,131.4,132.93,132.95,-0.56,-0.75,0.03,132.14\n07/13/2011 12:00:00 AM,132.09,133.22,131.52,132.37,131.84,132.82,132.92,-0.22,-0.11,0.03,132.79\n07/14/2011 12:00:00 AM,132.17,132.78,130.68,131.73,130.93,132.62,132.79,-0.57,-0.29,0.02,132.44\n07/15/2011 12:00:00 AM,131.66,131.87,130.77,131.32,131.69,132.35,132.6,-0.67,-0.21,0,132.27\n07/18/2011 12:00:00 AM,131.08,131.28,129.63,130.455,130.61,131.97,132.32,-1.04,-0.37,-0.02,131.58\n07/19/2011 12:00:00 AM,131.34,132.89,131.31,132.1,132.73,131.85,132.03,0.29,0.83,0.02,133.26\n07/20/2011 12:00:00 AM,133.07,133.15,132.42,132.785,132.65,131.93,131.9,0.65,0.7,0.05,133.79\n07/21/2011 12:00:00 AM,133.4,134.82,132.67,133.745,134.49,132.23,131.99,1.08,0.68,0.07,134.47\n07/22/2011 12:00:00 AM,134.52,134.72,133.76,134.24,134.58,132.64,132.26,1.1,0.35,0.09,134.58\n07/25/2011 12:00:00 AM,133.3,134.49,133.16,133.825,133.83,132.97,132.62,0.54,-0.26,0.06,133.77\n07/26/2011 12:00:00 AM,133.74,133.96,133.03,133.495,133.33,133.17,132.94,0.18,-0.41,0.06,133.1\n07/27/2011 12:00:00 AM,132.59,132.63,130.43,131.53,130.6,133.01,133.08,-1.12,-1.19,-0.02,130.92\n07/28/2011 12:00:00 AM,130.6,131.77,130.01,130.89,130.22,132.64,132.96,-1.22,-0.68,-0.03,130.22\n07/29/2011 12:00:00 AM,128.91,130.55,128.36,129.455,129.33,132.03,132.58,-1.8,-0.77,-0.08,128.85\n08/01/2011 12:00:00 AM,130.84,130.96,127.53,129.245,128.78,131.39,132.02,-1.44,-0.1,-0.07,128.81\n08/02/2011 12:00:00 AM,127.81,128.5,125.49,126.995,125.49,130.51,131.33,-2.48,-0.81,-0.14,126.84\n08/03/2011 12:00:00 AM,125.66,126.31,123.53,124.92,126.17,129.35,130.44,-3.12,-0.88,-0.19,125.17\n08/04/2011 12:00:00 AM,124.42,124.62,120.06,122.34,120.26,127.89,129.27,-3.91,-1.02,-0.27,123.09\n08/05/2011 12:00:00 AM,121.76,122.07,116.86,119.465,120.08,126.1,127.81,-4.67,-1.06,-0.33,120.78\n08/08/2011 12:00:00 AM,116.91,118.38,112.02,115.2,112.26,123.82,125.98,-6.11,-1.59,-0.45,117.14\n08/09/2011 12:00:00 AM,114.07,117.64,110.27,113.955,117.48,121.51,123.81,-5.23,-0.11,-0.45,116.46\n08/10/2011 12:00:00 AM,115.26,116.28,111.95,114.115,112.29,119.55,121.6,-3.7,1.14,-0.43,116.95\n08/11/2011 12:00:00 AM,113.26,118.92,112.32,115.62,117.33,118.23,119.71,-1.73,2.09,-0.35,118.44\n08/12/2011 12:00:00 AM,118.4,119.21,117.28,118.245,118.12,117.73,118.43,0.41,2.68,-0.26,120.67\n08/15/2011 12:00:00 AM,119.19,120.74,119,119.87,120.62,117.85,117.88,1.34,2.04,-0.18,121.55\n08/16/2011 12:00:00 AM,119.47,120.69,118.31,119.5,119.59,118.13,117.89,0.74,0.54,-0.19,120.29\n08/17/2011 12:00:00 AM,120.25,121.2,118.72,119.96,119.67,118.51,118.16,0.83,0.29,-0.16,119.84\n08/18/2011 12:00:00 AM,116.5,116.64,113.39,115.015,114.51,118.14,118.33,-2.55,-2.43,-0.31,114.18\n08/19/2011 12:00:00 AM,112.96,115.88,112.5,114.19,112.64,117.43,118.06,-2.38,-1.15,-0.31,112.94\n08/22/2011 12:00:00 AM,115.17,115.23,112.41,113.82,112.73,116.63,117.41,-1.96,-0.27,-0.31,112.34\n08/23/2011 12:00:00 AM,113.15,116.57,112.58,114.575,116.44,116.02,116.67,-0.94,0.64,-0.26,113.01\n08/24/2011 12:00:00 AM,116.19,118.24,115.92,117.08,118.08,115.94,116.15,0.91,1.73,-0.17,115.48\n08/25/2011 12:00:00 AM,118.73,119.4,115.87,117.635,116.28,116.16,116.02,1.01,0.96,-0.14,116.06\n08/26/2011 12:00:00 AM,115.69,118.51,113.85,116.18,117.97,116.25,116.13,-0.19,-0.43,-0.18,114.8\n08/29/2011 12:00:00 AM,119.56,121.43,119.48,120.455,121.36,116.9,116.39,2.58,1.84,-0.03,119.31\n08/30/2011 12:00:00 AM,120.83,122.43,119.94,121.185,121.68,117.77,116.95,2.34,0.74,-0.02,120.22\n08/31/2011 12:00:00 AM,122.46,123.51,121.3,122.405,122.22,118.78,117.8,2.48,0.45,0.03,121.64\n09/01/2011 12:00:00 AM,122.29,123.4,120.78,122.09,120.94,119.65,118.74,1.6,-0.46,0.01,121.55\n09/02/2011 12:00:00 AM,118.42,119.08,117.43,118.255,117.85,119.78,119.46,-1.28,-2.42,-0.1,118.11\n09/06/2011 12:00:00 AM,114.39,117.16,114.38,115.77,116.99,119.24,119.61,-2.51,-2.17,-0.18,116.2\n09/07/2011 12:00:00 AM,118.76,120.34,118.36,119.35,120.29,119.05,119.33,0.45,1.14,-0.05,120.25\n09/08/2011 12:00:00 AM,119.57,120.94,118.77,119.855,119.04,119.1,119.11,0.65,0.77,-0.04,120.98\n09/09/2011 12:00:00 AM,117.68,118.1,115.28,116.69,115.92,118.76,119,-1.54,-1.24,-0.13,118.01\n09/12/2011 12:00:00 AM,114.47,116.76,114.05,115.405,116.67,118.14,118.69,-1.94,-0.93,-0.17,116.91\n09/13/2011 12:00:00 AM,117.05,118.18,116.22,117.2,117.74,117.77,118.21,-0.27,0.8,-0.09,118.72\n09/14/2011 12:00:00 AM,118.33,120.8,116.72,118.76,119.37,117.77,117.86,0.8,1.23,-0.05,120.05\n09/15/2011 12:00:00 AM,120.64,121.47,119.4,120.435,121.43,118.16,117.87,1.65,1.27,0.01,121.29\n09/16/2011 12:00:00 AM,121.3,121.97,120.32,121.145,121.52,118.75,118.21,1.65,0.64,0.03,121.44\n09/19/2011 12:00:00 AM,119.53,120.93,118.72,119.825,120.31,119.13,118.7,0.36,-0.67,-0.01,119.58\n09/20/2011 12:00:00 AM,120.82,121.99,120.01,121,120.17,119.55,119.14,1.01,0.13,0.02,120.27\n09/21/2011 12:00:00 AM,120.23,120.6,116.44,118.52,116.63,119.56,119.44,-0.85,-1.34,-0.05,117.45\n09/22/2011 12:00:00 AM,113.25,114.21,111.3,112.755,112.86,118.57,119.31,-4.29,-3.27,-0.23,111.72\n09/23/2011 12:00:00 AM,112.11,114.16,112.02,113.09,113.54,117.39,118.52,-2.9,-0.62,-0.2,112.35\n09/26/2011 12:00:00 AM,114.61,116.4,112.98,114.69,116.24,116.55,117.47,-1.09,1.09,-0.14,114.24\n09/27/2011 12:00:00 AM,118.53,119.56,116.84,118.2,117.54,116.46,116.74,1.44,2.5,-0.02,117.91\n09/28/2011 12:00:00 AM,117.78,118.49,114.97,116.73,115.14,116.47,116.49,0.11,0.29,-0.07,116.55\n09/29/2011 12:00:00 AM,117.05,117.63,113.93,115.78,116.05,116.37,116.45,-0.52,-0.35,-0.09,115.8\n09/30/2011 12:00:00 AM,114.45,115.45,113.07,114.26,113.15,116.03,116.31,-1.35,-0.81,-0.14,114.54\n10/03/2011 12:00:00 AM,112.49,113.95,109.81,111.88,109.93,115.29,115.93,-2.49,-1.28,-0.19,112.49\n10/04/2011 12:00:00 AM,108.35,112.58,107.43,110.005,112.34,114.24,115.21,-3.01,-1.03,-0.25,111\n10/05/2011 12:00:00 AM,112.62,114.72,111.58,113.15,114.42,113.68,114.36,-0.18,1.61,-0.13,114.38\n10/06/2011 12:00:00 AM,114.36,116.66,113.51,115.085,116.49,113.67,113.81,1.1,1.81,-0.07,116.26\n10/07/2011 12:00:00 AM,117.17,117.25,115.06,116.155,115.71,114.03,113.76,1.48,1.2,-0.03,117.07\n10/10/2011 12:00:00 AM,117.68,119.63,117.67,118.65,119.58,114.84,114.14,2.66,1.48,0.04,119.13\n10/11/2011 12:00:00 AM,118.87,120.04,118.75,119.395,119.7,115.82,114.88,2.41,0.53,0.07,119.32\n10/12/2011 12:00:00 AM,120.6,122.14,120.33,121.235,120.75,116.98,115.86,2.92,0.62,0.12,120.57\n10/13/2011 12:00:00 AM,120.04,120.87,119.12,119.995,120.51,117.86,116.91,1.33,-0.91,0.08,118.82\n10/14/2011 12:00:00 AM,121.91,122.6,121.23,121.915,122.57,118.79,117.88,2.19,0.15,0.12,120.35\n10/17/2011 12:00:00 AM,121.99,122.55,119.93,121.24,120.23,119.51,118.74,1.16,-0.71,0.1,119.42\n10/18/2011 12:00:00 AM,120.14,123.5,119.2,121.35,122.58,120.05,119.46,0.91,-0.56,0.09,119.48\n10/19/2011 12:00:00 AM,122.38,123.08,120.71,121.895,121.13,120.52,120.03,1.01,-0.21,0.11,120.14\n10/20/2011 12:00:00 AM,121.43,122.1,119.82,120.96,121.66,120.77,120.47,0.14,-0.75,0.07,119.49\n10/21/2011 12:00:00 AM,123.09,124.12,122.72,123.42,123.97,121.25,120.83,1.67,0.77,0.15,122.3\n10/24/2011 12:00:00 AM,124.17,125.8,124.06,124.93,125.49,121.97,121.31,2.17,0.79,0.18,124.14\n10/25/2011 12:00:00 AM,124.89,124.95,122.78,123.865,123.05,122.52,121.93,0.9,-0.55,0.14,123.43\n10/26/2011 12:00:00 AM,124.35,124.77,122.21,123.49,124.3,122.87,122.47,0.42,-0.65,0.11,123.49\n10/27/2011 12:00:00 AM,127.63,129.42,126.61,128.015,128.53,123.76,123.01,3.18,1.74,0.25,128.29\n10/28/2011 12:00:00 AM,128,128.85,127.8,128.325,128.6,124.76,123.79,2.51,0.39,0.24,128.68\n10/31/2011 12:00:00 AM,127.16,127.26,125.32,126.29,125.5,125.37,124.66,0.53,-1.3,0.17,126.74\n11/01/2011 12:00:00 AM,122.03,123.51,121.52,122.515,122,125.19,125.17,-2.02,-2.59,0.04,123.19\n11/02/2011 12:00:00 AM,123.83,124.4,122.79,123.595,123.99,124.88,125.16,-0.78,-0.38,0.08,124.5\n11/03/2011 12:00:00 AM,125.27,126.5,123.6,125.05,126.25,124.79,124.93,0.36,0.69,0.11,126.01\n11/04/2011 12:00:00 AM,125.23,125.7,124.01,124.855,125.48,124.77,124.81,0.14,0.21,0.1,125.74\n11/07/2011 12:00:00 AM,125.39,126.39,124.2,125.295,126.26,124.83,124.79,0.38,0.3,0.1,126.01\n11/08/2011 12:00:00 AM,126.92,128.02,125.71,126.865,127.88,125.16,124.9,1.28,0.83,0.15,127.3\n11/09/2011 12:00:00 AM,124.89,125.47,122.86,124.165,123.16,125.13,125.07,-0.79,-1.13,0.05,124.32\n11/10/2011 12:00:00 AM,124.79,124.94,123.02,123.98,124.32,124.96,125.1,-0.69,-0.51,0.05,123.95\n11/11/2011 12:00:00 AM,125.83,126.99,125.79,126.39,126.66,125.1,125.04,1.03,1.04,0.12,126.12\n11/14/2011 12:00:00 AM,126.19,126.36,124.92,125.64,125.46,125.23,125.1,0.27,-0.03,0.09,125.12\n11/15/2011 12:00:00 AM,125.17,126.75,124.72,125.735,126.08,125.36,125.23,0.26,-0.03,0.08,125.05\n11/16/2011 12:00:00 AM,124.81,126.34,123.9,125.12,124.08,125.37,125.33,-0.2,-0.36,0.07,124.36\n11/17/2011 12:00:00 AM,123.85,124.16,121.23,122.695,122.11,124.98,125.27,-1.69,-1.3,-0.02,122.03\n11/18/2011 12:00:00 AM,122.5,122.75,121.47,122.11,121.98,124.42,124.94,-1.6,-0.59,-0.03,121.69\n11/21/2011 12:00:00 AM,120.2,120.35,118.65,119.5,119.66,123.48,124.32,-2.83,-1.2,-0.11,119.45\n11/22/2011 12:00:00 AM,119.4,120.1,118.52,119.31,119.19,122.52,123.47,-2.17,-0.1,-0.1,119.69\n11/23/2011 12:00:00 AM,118.07,118.21,116.56,117.385,116.56,121.4,122.48,-2.81,-0.5,-0.16,118.2\n11/25/2011 12:00:00 AM,116.38,117.71,116.2,116.955,116.34,120.32,121.41,-2.31,0.14,-0.16,118.17\n11/28/2011 12:00:00 AM,119.54,120.18,118.82,119.5,119.71,119.79,120.46,-0.06,1.78,-0.08,120.92\n11/29/2011 12:00:00 AM,120.05,121,119.61,120.305,120.05,119.66,119.89,0.47,1.32,-0.04,121.67\n11/30/2011 12:00:00 AM,123.49,125.22,123.22,124.22,124.99,120.28,119.85,2.83,2.43,0.07,125.27\n12/01/2011 12:00:00 AM,124.85,125.64,124.43,125.035,124.97,121.21,120.36,2.58,1.02,0.1,125.54\n12/02/2011 12:00:00 AM,126.12,126.5,124.78,125.64,124.86,122.21,121.23,2.26,0.24,0.1,125.54\n12/05/2011 12:00:00 AM,126.84,127.18,125.44,126.31,126.22,123.19,122.21,2.07,-0.07,0.13,125.61\n12/06/2011 12:00:00 AM,126.21,127.11,125.76,126.435,126.26,124.04,123.16,1.58,-0.43,0.11,125.22\n12/07/2011 12:00:00 AM,125.84,127.26,124.97,126.115,126.73,124.67,123.99,0.95,-0.72,0.11,124.54\n12/08/2011 12:00:00 AM,125.9,126.18,123.65,124.915,123.95,124.94,124.58,-0.08,-1.15,0.06,123.19\n12/09/2011 12:00:00 AM,124.51,126.37,124.4,125.385,126.05,125.11,124.92,0.24,-0.35,0.07,123.71\n12/12/2011 12:00:00 AM,124.95,124.97,123.16,124.065,124.21,125.02,125.05,-0.66,-0.84,0.02,122.62\n12/13/2011 12:00:00 AM,124.86,125.57,122.45,124.01,123.05,124.84,125,-0.52,-0.31,0.03,122.96\n12/14/2011 12:00:00 AM,122.56,123.03,121.47,122.25,121.74,124.39,124.78,-1.5,-0.87,-0.04,121.73\n12/15/2011 12:00:00 AM,123.03,123.2,121.99,122.595,122.18,123.96,124.4,-0.87,0.05,-0.02,122.66\n12/16/2011 12:00:00 AM,122.23,122.95,121.3,122.125,121.59,123.53,123.96,-0.93,0,-0.04,122.74\n12/19/2011 12:00:00 AM,122.06,122.32,120.03,121.175,120.29,123.02,123.51,-1.28,-0.25,-0.06,122.29\n12/20/2011 12:00:00 AM,122.18,124.14,122.17,123.155,123.93,122.84,123.1,0.33,1.09,0,124.6\n12/21/2011 12:00:00 AM,123.93,124.36,122.75,123.555,124.17,122.88,122.9,0.49,0.69,0.02,125.1\n12/22/2011 12:00:00 AM,124.63,125.4,124.23,124.815,125.27,123.18,122.95,1.16,0.85,0.05,126.26\n12/23/2011 12:00:00 AM,125.67,126.43,125.41,125.92,126.39,123.69,123.23,1.55,0.71,0.09,127.06\n12/27/2011 12:00:00 AM,126.17,126.82,126.06,126.44,126.49,124.29,123.71,1.46,0.27,0.09,127.14\n12/28/2011 12:00:00 AM,126.51,126.53,124.73,125.63,124.83,124.71,124.25,0.54,-0.57,0.07,125.86\n12/29/2011 12:00:00 AM,125.24,126.25,125.18,125.715,126.12,125.02,124.68,0.45,-0.38,0.06,125.5\n12/30/2011 12:00:00 AM,126.02,126.33,125.5,125.915,125.5,125.27,125.01,0.45,-0.2,0.07,125.29\n01/03/2012 12:00:00 AM,127.76,128.38,127.43,127.905,127.5,125.75,125.33,1.6,0.76,0.12,126.89\n01/04/2012 12:00:00 AM,127.2,127.81,126.71,127.26,127.7,126.15,125.73,0.75,-0.25,0.1,125.94\n01/05/2012 12:00:00 AM,127.01,128.23,126.43,127.33,128.04,126.48,126.13,0.59,-0.25,0.09,125.86\n01/06/2012 12:00:00 AM,128.2,128.22,127.29,127.755,127.71,126.79,126.48,0.7,-0.05,0.1,126.27\n01/09/2012 12:00:00 AM,128,128.18,127.41,127.795,128.02,127.06,126.78,0.53,-0.15,0.09,126.42\n01/10/2012 12:00:00 AM,129.39,129.65,128.95,129.3,129.13,127.48,127.1,1.35,0.54,0.14,128.12\n01/11/2012 12:00:00 AM,128.73,129.37,128.52,128.945,129.2,127.86,127.47,0.75,-0.17,0.11,128.02\n01/12/2012 12:00:00 AM,129.57,129.7,128.54,129.12,129.51,128.19,127.85,0.66,-0.16,0.12,128.53\n01/13/2012 12:00:00 AM,128.64,129.05,127.72,128.385,128.84,128.34,128.15,0.01,-0.57,0.08,128.18\n01/17/2012 12:00:00 AM,130.08,130.32,129.06,129.69,129.34,128.6,128.37,0.84,0.33,0.12,129.85\n01/18/2012 12:00:00 AM,129.31,130.84,129.08,129.96,130.77,128.89,128.61,0.78,0.13,0.12,130.4\n01/19/2012 12:00:00 AM,131.22,131.57,130.8,131.185,131.46,129.34,128.93,1.35,0.49,0.15,131.8\n01/20/2012 12:00:00 AM,131.24,131.95,130.92,131.435,131.54,129.82,129.35,1.14,0.09,0.15,132.11\n01/23/2012 12:00:00 AM,131.51,132.25,130.98,131.615,131.61,130.26,129.81,0.94,-0.11,0.15,132.27\n01/24/2012 12:00:00 AM,130.8,131.5,130.6,131.05,131.46,130.55,130.22,0.32,-0.52,0.12,131.64\n01/25/2012 12:00:00 AM,131.26,132.87,130.75,131.81,132.56,130.84,130.55,0.72,0.03,0.14,132.27\n01/26/2012 12:00:00 AM,133.15,133.4,131.36,132.38,131.88,131.18,130.85,0.89,0.14,0.14,132.64\n01/27/2012 12:00:00 AM,131.24,132.05,131.15,131.6,131.82,131.37,131.14,0.15,-0.48,0.12,131.65\n01/30/2012 12:00:00 AM,130.51,131.44,130.06,130.75,131.37,131.35,131.32,-0.43,-0.68,0.08,130.65\n01/31/2012 12:00:00 AM,132.02,132.18,130.68,131.43,131.32,131.35,131.36,0.12,0.07,0.1,131.2\n02/01/2012 12:00:00 AM,132.29,133.14,132.13,132.635,132.47,131.54,131.4,0.85,0.6,0.12,132.25\n02/02/2012 12:00:00 AM,132.73,133.02,132.21,132.615,132.68,131.77,131.55,0.61,0.13,0.12,132.09\n02/03/2012 12:00:00 AM,134,134.62,133.77,134.195,134.54,132.21,131.83,1.45,0.69,0.16,133.53\n02/06/2012 12:00:00 AM,133.98,134.51,133.83,134.17,134.45,132.67,132.22,1.04,0.04,0.15,133.4\n02/07/2012 12:00:00 AM,134.17,135.02,133.64,134.33,134.79,133.08,132.66,0.85,-0.12,0.14,133.52\n02/08/2012 12:00:00 AM,134.86,135.22,134.31,134.765,135.19,133.49,133.08,0.9,-0.04,0.15,133.98\n02/09/2012 12:00:00 AM,135.41,135.59,134.56,135.075,135.36,133.87,133.48,0.85,-0.06,0.15,134.37\n02/10/2012 12:00:00 AM,134.16,134.47,133.84,134.155,134.36,134.06,133.82,0.03,-0.65,0.12,133.61\n02/13/2012 12:00:00 AM,135.32,135.52,134.74,135.13,135.36,134.29,134.07,0.64,0.13,0.13,134.78\n02/14/2012 12:00:00 AM,135,135.27,134.25,134.76,135.19,134.45,134.27,0.23,-0.24,0.12,134.61\n02/15/2012 12:00:00 AM,135.63,135.83,134.29,135.06,134.56,134.6,134.44,0.36,-0.02,0.12,135.11\n02/16/2012 12:00:00 AM,134.57,136.17,134.33,135.25,136.05,134.75,134.6,0.38,0.01,0.12,135.48\n02/17/2012 12:00:00 AM,136.52,136.63,135.96,136.295,136.41,135.03,134.78,0.94,0.43,0.14,136.62\n02/21/2012 12:00:00 AM,136.73,137.05,136.05,136.55,136.47,135.36,135.04,0.85,0.15,0.15,136.9\n02/22/2012 12:00:00 AM,136.26,136.55,135.79,136.17,136.03,135.61,135.34,0.37,-0.28,0.12,136.52\n02/23/2012 12:00:00 AM,135.96,136.73,135.5,136.115,136.63,135.77,135.59,0.24,-0.25,0.12,136.44\n02/24/2012 12:00:00 AM,136.93,137.2,136.63,136.915,136.93,136,135.79,0.68,0.21,0.13,137.16\n02/27/2012 12:00:00 AM,136.02,137.53,135.8,136.665,137.16,136.19,135.99,0.34,-0.15,0.12,136.8\n02/28/2012 12:00:00 AM,137.2,137.72,136.93,137.325,137.56,136.43,136.2,0.66,0.17,0.13,137.33\n02/29/2012 12:00:00 AM,137.76,138.19,136.54,137.365,137.02,136.65,136.42,0.51,-0.03,0.13,137.22\n03/01/2012 12:00:00 AM,137.31,137.99,137.12,137.555,137.73,136.87,136.65,0.49,-0.03,0.12,137.28\n03/02/2012 12:00:00 AM,137.64,137.82,137,137.41,137.31,137.03,136.86,0.26,-0.18,0.11,137.04\n03/05/2012 12:00:00 AM,137.1,137.2,136.28,136.74,136.75,137.05,137,-0.23,-0.47,0.08,136.34\n03/06/2012 12:00:00 AM,135.35,135.43,134.36,134.895,134.75,136.74,136.97,-1.35,-1.07,0.02,134.58\n03/07/2012 12:00:00 AM,135.06,135.91,134.93,135.42,135.69,136.43,136.74,-0.64,-0.01,0.03,135.26\n03/08/2012 12:00:00 AM,136.52,137.32,136.24,136.78,137.04,136.37,136.49,0.4,0.79,0.08,136.72\n03/09/2012 12:00:00 AM,137.3,137.93,137.13,137.53,137.57,136.51,136.42,0.77,0.69,0.09,137.5\n03/12/2012 12:00:00 AM,137.55,137.76,137.09,137.425,137.58,136.7,136.52,0.49,0.15,0.09,137.41\n03/13/2012 12:00:00 AM,138.32,140.13,138.09,139.11,140.06,137.12,136.76,1.43,0.77,0.13,139.06\n03/14/2012 12:00:00 AM,140.1,140.45,139.48,139.965,139.91,137.7,137.16,1.58,0.5,0.15,139.82\n03/15/2012 12:00:00 AM,140.12,140.78,139.76,140.27,140.72,138.3,137.7,1.34,0.06,0.15,140\n03/16/2012 12:00:00 AM,140.36,140.48,140,140.24,140.3,138.81,138.27,0.96,-0.28,0.14,139.88\n03/19/2012 12:00:00 AM,140.21,141.28,140.11,140.695,140.85,139.28,138.8,0.99,-0.13,0.14,140.27\n03/20/2012 12:00:00 AM,140.05,140.61,139.64,140.125,140.44,139.58,139.24,0.35,-0.55,0.12,139.68\n03/21/2012 12:00:00 AM,140.52,140.65,139.92,140.285,140.21,139.8,139.56,0.36,-0.28,0.11,139.88\n03/22/2012 12:00:00 AM,139.18,139.55,138.74,139.145,139.2,139.79,139.74,-0.47,-0.75,0.08,138.84\n03/23/2012 12:00:00 AM,139.32,139.81,138.55,139.18,139.65,139.69,139.77,-0.32,-0.27,0.07,139.03\n03/26/2012 12:00:00 AM,140.65,141.61,140.6,141.105,141.61,139.86,139.76,1,0.86,0.13,141.06\n03/27/2012 12:00:00 AM,141.74,141.83,141.08,141.455,141.17,140.16,139.9,0.95,0.42,0.13,141.45\n03/28/2012 12:00:00 AM,141.1,141.32,139.64,140.48,140.47,140.32,140.13,0.07,-0.45,0.1,140.52\n03/29/2012 12:00:00 AM,139.64,140.49,139.09,139.79,140.23,140.31,140.28,-0.39,-0.58,0.06,139.93\n03/30/2012 12:00:00 AM,140.92,141.05,140.05,140.55,140.81,140.33,140.32,0.2,0.15,0.09,140.76\n04/02/2012 12:00:00 AM,140.64,142.21,140.36,141.285,141.84,140.48,140.36,0.61,0.39,0.1,141.5\n04/03/2012 12:00:00 AM,141.64,141.88,140.43,141.155,141.26,140.64,140.49,0.36,0.02,0.1,141.33\n04/04/2012 12:00:00 AM,140.22,140.34,139.34,139.84,139.86,140.58,140.59,-0.57,-0.7,0.04,140.01\n04/05/2012 12:00:00 AM,139.38,140.2,139.26,139.73,139.79,140.44,140.56,-0.49,-0.29,0.04,139.92\n04/09/2012 12:00:00 AM,138.03,138.78,137.84,138.31,138.22,140.07,140.38,-1.26,-0.72,-0.01,138.55\n04/10/2012 12:00:00 AM,137.95,138.34,135.76,137.05,135.9,139.49,140.02,-1.72,-0.7,-0.04,137.4\n04/11/2012 12:00:00 AM,137.29,137.54,136.75,137.145,137,138.92,139.49,-1.19,0.06,-0.04,137.59\n04/12/2012 12:00:00 AM,137.13,138.9,137.03,137.965,138.79,138.57,138.98,-0.34,0.68,-0.01,138.44\n04/13/2012 12:00:00 AM,138.47,138.82,137.01,137.915,137.14,138.34,138.6,-0.28,0.41,-0.01,138.34\n04/16/2012 12:00:00 AM,137.84,138.04,136.58,137.31,137.05,138.1,138.34,-0.59,-0.02,-0.03,137.67\n04/17/2012 12:00:00 AM,137.84,139.36,137.7,138.53,139.08,138.07,138.15,0.35,0.69,0.01,138.78\n04/18/2012 12:00:00 AM,138.46,139.08,138.38,138.73,138.61,138.16,138.1,0.38,0.37,0.02,138.81\n04/19/2012 12:00:00 AM,138.63,139.15,137.07,138.11,137.72,138.18,138.14,-0.12,-0.2,-0.01,138.03\n04/20/2012 12:00:00 AM,138.33,138.83,137.87,138.35,137.95,138.22,138.18,0.07,0.03,0.01,138.14\n04/23/2012 12:00:00 AM,136.54,136.91,135.94,136.425,136.79,137.97,138.15,-1.18,-0.93,-0.06,136.17\n04/24/2012 12:00:00 AM,136.91,137.66,136.8,137.23,137.31,137.77,137.98,-0.34,0.15,-0.02,136.99\n04/25/2012 12:00:00 AM,138.65,139.25,138.53,138.89,139.19,137.85,137.84,0.81,0.95,0.02,138.61\n04/26/2012 12:00:00 AM,138.89,140.32,138.81,139.565,140.16,138.14,137.9,1.02,0.64,0.05,139.2\n04/27/2012 12:00:00 AM,140.58,140.79,139.8,140.295,140.39,138.56,138.17,1.2,0.46,0.06,139.84\n04/30/2012 12:00:00 AM,140.11,140.21,139.49,139.85,139.87,138.91,138.54,0.59,-0.24,0.05,139.35\n05/01/2012 12:00:00 AM,139.79,141.66,139.63,140.645,140.74,139.3,138.92,0.94,0.12,0.06,140.14\n05/02/2012 12:00:00 AM,139.92,140.46,139.46,139.96,140.32,139.54,139.26,0.24,-0.47,0.05,139.49\n05/03/2012 12:00:00 AM,140.34,140.45,138.99,139.72,139.25,139.66,139.51,0.02,-0.41,0.03,139.36\n05/04/2012 12:00:00 AM,138.51,138.66,136.92,137.79,137,139.43,139.57,-1.21,-1.14,-0.02,137.63\n05/07/2012 12:00:00 AM,136.51,137.56,136.46,137.01,137.1,138.99,139.38,-1.38,-0.7,-0.05,137.14\n05/08/2012 12:00:00 AM,136.28,136.77,134.92,135.845,136.55,138.36,138.95,-1.74,-0.61,-0.08,136.29\n05/09/2012 12:00:00 AM,135.1,136.61,134.49,135.55,135.74,137.71,138.36,-1.45,-0.07,-0.09,136.3\n05/10/2012 12:00:00 AM,136.68,136.85,135.71,136.28,136.02,137.26,137.76,-0.59,0.63,-0.06,137.22\n05/11/2012 12:00:00 AM,135.17,136.87,135.11,135.99,135.61,136.9,137.28,-0.61,0.32,-0.07,137.01\n05/14/2012 12:00:00 AM,134.31,135.61,133.91,134.76,134.11,136.45,136.87,-1.23,-0.29,-0.1,135.81\n05/15/2012 12:00:00 AM,134.02,134.81,133.13,133.97,133.34,135.91,136.43,-1.4,-0.27,-0.12,135.01\n05/16/2012 12:00:00 AM,133.94,134.55,132.8,133.675,132.83,135.38,135.91,-1.2,0.01,-0.12,134.63\n05/17/2012 12:00:00 AM,132.86,133.02,130.79,131.905,130.86,134.67,135.34,-2,-0.59,-0.17,132.76\n05/18/2012 12:00:00 AM,131.37,131.6,129.55,130.575,129.74,133.8,134.63,-2.3,-0.52,-0.19,131.35\n05/21/2012 12:00:00 AM,130.16,132.02,129.95,130.985,131.97,133.06,133.83,-1.41,0.41,-0.18,131.64\n05/22/2012 12:00:00 AM,132.31,133.23,131.34,132.285,132.2,132.66,133.15,-0.2,1.13,-0.12,132.71\n05/23/2012 12:00:00 AM,131.25,132.46,129.99,131.225,132.27,132.3,132.67,-0.82,0.12,-0.15,131.38\n05/24/2012 12:00:00 AM,132.63,132.84,131.42,132.13,132.53,132.14,132.35,-0.02,0.65,-0.11,132.03\n05/25/2012 12:00:00 AM,132.48,132.85,131.78,132.315,132.1,132.1,132.17,0.1,0.41,-0.1,131.95\n05/29/2012 12:00:00 AM,133.16,133.93,132.75,133.34,133.7,132.27,132.15,0.73,0.66,-0.06,132.73\n05/30/2012 12:00:00 AM,132.56,132.62,131.49,132.055,131.76,132.3,132.24,-0.29,-0.44,-0.1,131.27\n05/31/2012 12:00:00 AM,131.71,132.45,130.34,131.395,131.47,132.18,132.26,-0.63,-0.5,-0.11,130.58\n06/01/2012 12:00:00 AM,129.41,129.86,128.16,129.01,128.16,131.67,132.08,-1.98,-1.27,-0.18,128.34\n06/04/2012 12:00:00 AM,128.39,128.74,127.14,127.94,128.1,130.93,131.61,-2.12,-0.75,-0.2,127.58\n06/05/2012 12:00:00 AM,127.85,129.26,127.78,128.52,129.07,130.3,130.96,-1.17,0.34,-0.17,128.49\n06/06/2012 12:00:00 AM,129.97,132.03,129.93,130.98,131.97,130.16,130.42,0.72,1.61,-0.08,131.18\n06/07/2012 12:00:00 AM,133.47,133.53,131.78,132.655,132.05,130.47,130.27,1.59,1.48,-0.03,132.92\n06/08/2012 12:00:00 AM,131.71,133.13,131.29,132.21,133.1,130.84,130.48,0.87,0.2,-0.04,132.47\n06/11/2012 12:00:00 AM,134.17,134.25,131.28,132.765,131.41,131.26,130.85,0.99,0.17,-0.02,133\n06/12/2012 12:00:00 AM,131.79,133.01,131.16,132.085,132.92,131.54,131.23,0.28,-0.46,-0.04,132.27\n06/13/2012 12:00:00 AM,132.53,133.36,131.62,132.49,132.07,131.79,131.54,0.46,-0.12,-0.03,132.63\n06/14/2012 12:00:00 AM,132.34,134,131.98,132.99,133.47,132.06,131.8,0.66,0.08,-0.01,133.04\n06/15/2012 12:00:00 AM,133.38,134.26,133.1,133.68,134.14,132.4,132.08,0.92,0.23,0.01,133.6\n06/18/2012 12:00:00 AM,133.58,134.73,133.28,134.005,134.4,132.76,132.4,0.87,0.08,0.02,133.79\n06/19/2012 12:00:00 AM,135.08,136.25,134.37,135.31,135.7,133.27,132.8,1.46,0.48,0.06,134.93\n06/20/2012 12:00:00 AM,135.71,136.1,134.27,135.185,135.48,133.75,133.26,0.98,-0.12,0.06,134.65\n06/21/2012 12:00:00 AM,135.64,135.78,132.33,134.055,132.44,133.97,133.69,0,-0.81,0.01,133.47\n06/22/2012 12:00:00 AM,133.13,133.71,132.62,133.165,133.46,133.94,133.91,-0.57,-0.84,-0.01,132.65\n06/25/2012 12:00:00 AM,132.05,132.1,130.85,131.475,131.32,133.57,133.86,-1.49,-1.11,-0.07,131.15\n06/26/2012 12:00:00 AM,131.7,132.38,130.93,131.655,131.98,133.15,133.56,-0.97,-0.16,-0.05,131.58\n06/27/2012 12:00:00 AM,132.42,133.43,131.97,132.7,133.17,132.92,133.2,-0.04,0.64,-0.02,132.84\n06/28/2012 12:00:00 AM,132.29,132.99,131.28,132.135,132.79,132.72,132.93,-0.39,0.08,-0.03,132.44\n06/29/2012 12:00:00 AM,135.2,136.27,134.85,135.56,136.1,133.06,132.85,1.9,1.76,0.07,135.91\n07/02/2012 12:00:00 AM,136.48,136.65,135.52,136.085,136.51,133.63,133.12,1.71,0.76,0.09,136.32\n07/03/2012 12:00:00 AM,136.48,137.51,136.34,136.925,137.37,134.33,133.66,1.78,0.42,0.1,136.99\n07/05/2012 12:00:00 AM,136.9,137.4,136.29,136.845,136.79,134.96,134.31,1.24,-0.21,0.1,136.72\n07/06/2012 12:00:00 AM,135.47,135.77,134.85,135.31,135.49,135.26,134.88,-0.07,-1.12,0.04,135.07\n07/09/2012 12:00:00 AM,135.38,135.57,134.7,135.135,135.32,135.35,135.21,-0.17,-0.65,0.04,134.86\n07/10/2012 12:00:00 AM,136.01,136.23,133.68,134.955,134.14,135.33,135.32,-0.23,-0.38,0.02,134.68\n07/11/2012 12:00:00 AM,134.21,134.6,133.38,133.99,134.16,135.12,135.28,-0.79,-0.6,0,133.78\n07/12/2012 12:00:00 AM,133.38,134.23,132.6,133.415,133.51,134.8,135.09,-0.94,-0.4,-0.02,133.33\n07/13/2012 12:00:00 AM,133.86,135.89,133.84,134.865,135.75,134.68,134.85,0.24,0.69,0.03,134.88\n07/16/2012 12:00:00 AM,135.44,135.83,134.9,135.365,135.43,134.74,134.72,0.49,0.56,0.03,135.42\n07/17/2012 12:00:00 AM,135.97,136.64,134.55,135.595,136.36,134.88,134.76,0.51,0.3,0.05,135.65\n07/18/2012 12:00:00 AM,136.04,137.64,135.96,136.8,137.37,135.22,134.93,1.13,0.62,0.07,136.81\n07/19/2012 12:00:00 AM,137.65,138.18,137.21,137.695,137.73,135.71,135.26,1.39,0.5,0.1,137.6\n07/20/2012 12:00:00 AM,136.95,137.16,136.32,136.74,136.47,136.05,135.67,0.4,-0.5,0.06,136.55\n07/23/2012 12:00:00 AM,134.47,135.46,133.84,134.65,135.09,135.97,135.94,-1.04,-1.35,0,134.49\n07/24/2012 12:00:00 AM,135.19,135.25,133.03,134.14,133.93,135.68,135.92,-1.08,-0.72,-0.02,134.1\n07/25/2012 12:00:00 AM,134.21,134.56,133.25,133.905,133.96,135.3,135.66,-0.93,-0.25,-0.02,134\n07/26/2012 12:00:00 AM,135.89,136.46,135.26,135.86,136.17,135.24,135.38,0.57,1.02,0.03,136.02\n07/27/2012 12:00:00 AM,136.89,139.07,136.14,137.605,138.68,135.56,135.34,1.52,1.25,0.09,137.7\n07/30/2012 12:00:00 AM,138.52,139.34,138.27,138.805,138.68,136.16,135.63,1.87,0.9,0.12,138.75\n07/31/2012 12:00:00 AM,138.49,138.87,137.71,138.29,137.71,136.7,136.15,1.03,-0.19,0.1,138.07\n08/01/2012 12:00:00 AM,138.7,138.73,137.4,138.065,137.59,137.1,136.67,0.61,-0.44,0.08,137.73\n08/02/2012 12:00:00 AM,136.55,137.57,135.58,136.575,136.64,137.18,137.02,-0.51,-1.07,0.04,136.22\n08/03/2012 12:00:00 AM,138.56,139.64,138.49,139.065,139.35,137.49,137.24,1.22,0.74,0.1,138.69\n08/06/2012 12:00:00 AM,139.72,140.17,139.56,139.865,139.62,137.95,137.53,1.39,0.52,0.13,139.41\n08/07/2012 12:00:00 AM,140.18,140.92,140.03,140.475,140.32,138.5,137.97,1.4,0.27,0.13,139.95\n08/08/2012 12:00:00 AM,139.85,140.65,139.81,140.23,140.49,138.96,138.47,0.86,-0.28,0.12,139.67\n08/09/2012 12:00:00 AM,140.29,140.89,140.15,140.52,140.61,139.36,138.94,0.81,-0.19,0.12,139.98\n08/10/2012 12:00:00 AM,140.04,140.89,139.81,140.35,140.84,139.66,139.34,0.48,-0.35,0.11,139.88\n08/13/2012 12:00:00 AM,140.6,140.84,140.04,140.44,140.77,139.89,139.64,0.41,-0.23,0.1,140.08\n08/14/2012 12:00:00 AM,141.29,141.38,140.37,140.875,140.79,140.12,139.89,0.57,0.01,0.12,140.64\n08/15/2012 12:00:00 AM,140.64,141.19,140.55,140.87,140.95,140.32,140.11,0.41,-0.11,0.1,140.76\n08/16/2012 12:00:00 AM,141.15,142.16,140.8,141.48,141.99,140.56,140.33,0.69,0.16,0.12,141.48\n08/17/2012 12:00:00 AM,142.23,142.3,141.86,142.08,142.18,140.88,140.58,0.88,0.23,0.13,142.14\n08/20/2012 12:00:00 AM,141.98,142.22,141.59,141.905,142.19,141.15,140.87,0.53,-0.15,0.12,142.01\n08/21/2012 12:00:00 AM,142.54,143.09,141.45,142.27,141.76,141.42,141.15,0.62,-0.01,0.12,142.4\n08/22/2012 12:00:00 AM,141.4,142.05,141.07,141.56,141.82,141.54,141.38,0,-0.47,0.1,141.71\n08/23/2012 12:00:00 AM,141.47,141.48,140.44,140.96,140.66,141.5,141.5,-0.38,-0.53,0.07,141.15\n08/24/2012 12:00:00 AM,140.31,141.83,140.22,141.025,141.51,141.42,141.49,-0.24,-0.15,0.07,141.26\n08/27/2012 12:00:00 AM,141.89,142.08,141.34,141.71,141.54,141.43,141.44,0.26,0.31,0.08,141.94\n08/28/2012 12:00:00 AM,141.18,141.84,140.97,141.405,141.4,141.43,141.43,0,-0.03,0.07,141.59\n08/29/2012 12:00:00 AM,141.52,141.89,141.12,141.505,141.51,141.44,141.43,0.06,0.03,0.06,141.64\n08/30/2012 12:00:00 AM,140.9,140.94,140.19,140.565,140.49,141.32,141.41,-0.55,-0.44,0.04,140.67\n08/31/2012 12:00:00 AM,141.29,141.82,140.36,141.09,141.16,141.24,141.33,-0.07,0.14,0.05,141.17\n09/04/2012 12:00:00 AM,141.04,141.46,140.13,140.795,141.03,141.14,141.23,-0.24,-0.05,0.04,140.83\n09/05/2012 12:00:00 AM,141.09,141.47,140.63,141.05,140.91,141.09,141.15,-0.01,0.15,0.04,141.04\n09/06/2012 12:00:00 AM,141.76,143.78,141.75,142.765,143.77,141.32,141.16,1.08,0.9,0.1,142.66\n09/07/2012 12:00:00 AM,144.01,144.39,143.88,144.135,144.33,141.81,141.39,1.66,0.89,0.13,143.85\n09/10/2012 12:00:00 AM,144.19,144.44,143.46,143.95,143.51,142.32,141.82,1.09,0.01,0.12,143.49\n09/11/2012 12:00:00 AM,143.6,144.37,143.56,143.965,143.91,142.75,142.3,0.8,-0.23,0.11,143.39\n09/12/2012 12:00:00 AM,144.39,144.55,143.9,144.225,144.39,143.13,142.74,0.75,-0.17,0.11,143.59\n09/13/2012 12:00:00 AM,144.37,147.04,143.99,145.515,146.59,143.62,143.16,1.36,0.37,0.14,144.83\n09/14/2012 12:00:00 AM,146.88,148.11,146.76,147.435,147.24,144.37,143.69,2.21,0.82,0.2,146.68\n09/17/2012 12:00:00 AM,146.94,147.19,146.37,146.78,146.74,145.01,144.34,1.19,-0.35,0.16,145.98\n09/18/2012 12:00:00 AM,146.49,146.81,146.25,146.53,146.62,145.47,144.96,0.71,-0.56,0.15,145.8\n09/19/2012 12:00:00 AM,146.79,147.17,146.41,146.79,146.7,145.84,145.45,0.68,-0.31,0.14,146.19\n09/20/2012 12:00:00 AM,146.03,146.79,145.63,146.21,146.71,146.04,145.8,0.12,-0.57,0.12,145.8\n09/21/2012 12:00:00 AM,146.64,146.67,145.81,146.24,145.87,146.14,146.01,0.11,-0.3,0.11,146.07\n09/24/2012 12:00:00 AM,145.15,145.98,145.04,145.51,145.65,146.09,146.1,-0.39,-0.51,0.09,145.59\n09/25/2012 12:00:00 AM,145.96,146.24,144.06,145.15,144.1,145.93,146.06,-0.51,-0.34,0.06,145.5\n09/26/2012 12:00:00 AM,144.07,144.11,142.95,143.53,143.29,145.52,145.87,-1.4,-0.83,0.02,144.16\n09/27/2012 12:00:00 AM,143.89,144.97,143.51,144.24,144.64,145.18,145.54,-0.57,0.22,0.03,145.1\n09/28/2012 12:00:00 AM,144.09,144.56,143.46,144.01,143.97,144.88,145.19,-0.56,0.14,0.03,144.99\n10/01/2012 12:00:00 AM,144.52,145.69,144.01,144.85,144.35,144.76,144.92,0.13,0.6,0.05,145.83\n10/02/2012 12:00:00 AM,144.92,145.15,143.83,144.49,144.5,144.67,144.77,-0.14,0.11,0.04,145.36\n10/03/2012 12:00:00 AM,144.89,145.43,144.13,144.78,145.09,144.66,144.69,0.09,0.22,0.04,145.47\n10/04/2012 12:00:00 AM,145.64,146.34,145.44,145.89,146.13,144.83,144.7,0.77,0.62,0.08,146.3\n10/05/2012 12:00:00 AM,146.91,147.16,145.7,146.43,146.14,145.13,144.86,0.9,0.41,0.08,146.49\n10/08/2012 12:00:00 AM,145.6,145.88,145.31,145.595,145.64,145.31,145.1,0.12,-0.38,0.06,145.33\n10/09/2012 12:00:00 AM,145.53,145.65,144.15,144.9,144.2,145.32,145.27,-0.35,-0.57,0.03,144.4\n10/10/2012 12:00:00 AM,144.18,144.32,143.09,143.705,143.28,145.09,145.26,-1.02,-0.79,0,143.09\n10/11/2012 12:00:00 AM,144.28,144.49,143.33,143.91,143.36,144.83,145.08,-0.61,-0.09,0,143.28\n10/12/2012 12:00:00 AM,143.46,143.95,142.58,143.265,142.89,144.5,144.81,-0.85,-0.22,-0.02,142.69\n10/15/2012 12:00:00 AM,143.23,144.23,142.77,143.5,144.08,144.23,144.51,-0.47,0.19,-0.02,143.04\n10/16/2012 12:00:00 AM,144.76,145.64,144.66,145.15,145.54,144.26,144.3,0.71,0.99,0.04,144.79\n10/17/2012 12:00:00 AM,145.64,146.32,145.42,145.87,146.2,144.51,144.31,0.97,0.71,0.06,145.56\n10/18/2012 12:00:00 AM,145.82,146.52,145.33,145.925,145.82,144.81,144.52,0.74,0.18,0.06,145.67\n10/19/2012 12:00:00 AM,145.55,145.56,143.05,144.305,143.39,144.85,144.74,-0.49,-0.85,0,144.18\n10/22/2012 12:00:00 AM,143.15,143.67,142.28,142.975,143.41,144.59,144.77,-1.2,-0.98,-0.03,143.07\n10/23/2012 12:00:00 AM,141.86,142.06,140.83,141.445,141.42,144.03,144.52,-1.85,-0.98,-0.08,141.82\n10/24/2012 12:00:00 AM,141.93,142.1,140.8,141.45,141.02,143.44,144.03,-1.34,-0.11,-0.07,142.1\n10/25/2012 12:00:00 AM,142.02,142.28,140.57,141.425,141.43,142.92,143.46,-0.99,0.23,-0.08,142.28\n10/26/2012 12:00:00 AM,141.3,141.84,140.39,141.115,141.35,142.46,142.94,-0.92,0.19,-0.07,142.08\n10/31/2012 12:00:00 AM,141.85,142.03,140.68,141.355,141.35,142.12,142.49,-0.51,0.41,-0.07,142.34\n11/01/2012 12:00:00 AM,141.65,143.01,141.52,142.265,142.83,142.01,142.18,0.21,0.75,-0.03,143.14\n11/02/2012 12:00:00 AM,143.68,143.72,141.41,142.565,141.56,142.05,142.05,0.34,0.48,-0.03,143.22\n11/05/2012 12:00:00 AM,141.35,142.17,140.93,141.55,141.85,141.99,142.03,-0.4,-0.32,-0.05,141.95\n11/06/2012 12:00:00 AM,142.28,143.52,142.13,142.825,142.96,142.09,142.03,0.52,0.51,-0.01,142.95\n11/07/2012 12:00:00 AM,141.66,141.68,139.06,140.37,139.72,141.88,142.02,-1.18,-1.02,-0.08,140.25\n11/08/2012 12:00:00 AM,139.7,140.41,137.93,139.17,138.04,141.4,141.81,-1.62,-0.86,-0.12,138.95\n11/09/2012 12:00:00 AM,137.62,139.44,137.55,138.495,138.16,140.8,141.37,-1.61,-0.42,-0.13,138.26\n11/12/2012 12:00:00 AM,138.59,138.81,137.96,138.385,138.26,140.21,140.8,-1.24,0.08,-0.13,138.18\n11/13/2012 12:00:00 AM,137.54,139.25,137.36,138.305,137.79,139.71,140.23,-0.95,0.27,-0.12,138.15\n11/14/2012 12:00:00 AM,138.21,138.43,135.62,137.025,135.93,139.13,139.69,-1.51,-0.27,-0.16,136.98\n11/15/2012 12:00:00 AM,135.98,136.49,135.18,135.835,135.7,138.42,139.1,-1.85,-0.39,-0.18,135.97\n11/16/2012 12:00:00 AM,135.9,136.64,134.7,135.67,136.37,137.75,138.43,-1.45,0.11,-0.18,136\n11/19/2012 12:00:00 AM,137.9,139.15,137.82,138.485,139.13,137.6,137.88,0.74,1.71,-0.07,138.89\n11/20/2012 12:00:00 AM,138.91,139.42,138.08,138.75,139.19,137.71,137.67,0.71,0.85,-0.07,139.09\n11/21/2012 12:00:00 AM,139.31,139.57,139.03,139.3,139.45,137.99,137.75,0.86,0.53,-0.04,139.52\n11/23/2012 12:00:00 AM,140.13,141.4,140.04,140.72,141.35,138.49,138.05,1.53,0.75,0,140.75\n11/26/2012 12:00:00 AM,140.65,141.11,140.19,140.65,141.05,139,138.49,1.07,0.01,0,140.46\n11/27/2012 12:00:00 AM,140.91,141.39,140.24,140.815,140.33,139.46,138.99,0.88,-0.16,0,140.43\n11/28/2012 12:00:00 AM,139.76,141.54,139,140.27,141.46,139.75,139.42,0.29,-0.54,-0.01,139.75\n11/29/2012 12:00:00 AM,141.99,142.51,141.37,141.94,142.12,140.18,139.79,1.28,0.45,0.04,141.31\n11/30/2012 12:00:00 AM,142.14,142.42,141.66,142.04,142.15,140.62,140.18,0.99,0.01,0.04,141.31\n12/03/2012 12:00:00 AM,142.8,142.92,141.34,142.13,141.45,141.01,140.61,0.78,-0.16,0.04,141.37\n12/04/2012 12:00:00 AM,141.44,141.87,140.87,141.37,141.25,141.21,140.96,0.08,-0.61,0.02,140.68\n12/05/2012 12:00:00 AM,141.37,142.16,140.37,141.265,141.5,141.29,141.18,-0.01,-0.38,0.01,140.72\n12/06/2012 12:00:00 AM,141.37,142.04,141.16,141.6,141.98,141.37,141.29,0.21,-0.03,0.02,141.25\n12/07/2012 12:00:00 AM,142.53,142.69,141.67,142.18,142.41,141.52,141.39,0.52,0.23,0.03,142.01\n12/10/2012 12:00:00 AM,142.21,142.81,142.15,142.48,142.47,141.71,141.53,0.57,0.16,0.05,142.47\n12/11/2012 12:00:00 AM,143.06,144.11,142.99,143.55,143.44,142.06,141.75,1.09,0.48,0.07,143.65\n12/12/2012 12:00:00 AM,144,144.55,143.31,143.93,143.51,142.46,142.07,1.04,0.2,0.08,144.08\n12/13/2012 12:00:00 AM,143.42,143.83,142.27,143.05,142.63,142.7,142.42,0.19,-0.54,0.05,143.25\n12/14/2012 12:00:00 AM,142.32,142.58,141.88,142.23,142.11,142.73,142.65,-0.38,-0.71,0.02,142.5\n12/17/2012 12:00:00 AM,142.47,143.85,142.43,143.14,143.77,142.79,142.74,0.3,0.15,0.04,143.46\n12/18/2012 12:00:00 AM,144,145.5,143.79,144.645,145.37,143.09,142.85,1.18,0.74,0.09,144.9\n12/19/2012 12:00:00 AM,145.53,145.58,144.24,144.91,144.29,143.47,143.11,1.02,0.27,0.09,145.03\n12/20/2012 12:00:00 AM,144.38,145.14,143.98,144.56,145.12,143.77,143.45,0.52,-0.25,0.08,144.54\n12/21/2012 12:00:00 AM,142.17,143.1,141.94,142.52,142.79,143.71,143.68,-0.92,-1.21,0.01,142.45\n12/24/2012 12:00:00 AM,142.48,142.56,142.19,142.375,142.35,143.49,143.67,-0.76,-0.5,0.01,142.33\n12/26/2012 12:00:00 AM,142.64,142.71,141.35,142.03,141.75,143.19,143.47,-0.77,-0.25,-0.01,142.02\n12/27/2012 12:00:00 AM,141.79,142.08,139.92,141,141.56,142.76,143.16,-1.22,-0.45,-0.03,141.07\n12/28/2012 12:00:00 AM,140.64,141.42,139.87,140.645,140.03,142.28,142.75,-1.11,-0.13,-0.05,140.83\n12/31/2012 12:00:00 AM,139.66,142.56,139.54,141.05,142.41,141.92,142.31,-0.55,0.37,-0.03,141.32\n01/02/2013 12:00:00 AM,145.11,146.15,144.73,145.44,146.06,142.3,142.11,2.4,2.41,0.1,145.62\n01/03/2013 12:00:00 AM,145.99,146.37,145.34,145.855,145.73,142.96,142.37,2.01,0.94,0.11,145.78\n01/04/2013 12:00:00 AM,145.97,146.61,145.67,146.14,146.37,143.68,142.97,1.64,0.18,0.11,145.82\n01/07/2013 12:00:00 AM,145.85,146.11,145.43,145.77,145.97,144.26,143.64,0.95,-0.45,0.1,145.25\n01/08/2013 12:00:00 AM,145.71,145.91,144.98,145.445,145.55,144.65,144.21,0.49,-0.6,0.08,144.81\n01/09/2013 12:00:00 AM,145.87,146.32,145.64,145.98,145.92,145,144.64,0.69,-0.16,0.09,145.29\n01/10/2013 12:00:00 AM,146.73,147.09,145.97,146.53,147.08,145.35,145,0.85,0.04,0.1,145.82\n01/11/2013 12:00:00 AM,147.04,147.15,146.61,146.88,147.07,145.71,145.35,0.84,0.01,0.11,146.19\n01/14/2013 12:00:00 AM,146.89,147.07,146.43,146.75,146.97,146,145.69,0.53,-0.23,0.09,146.14\n01/15/2013 12:00:00 AM,146.29,147.21,146.2,146.705,147.07,146.21,145.98,0.36,-0.25,0.09,146.23\n01/16/2013 12:00:00 AM,146.77,147.28,146.61,146.945,147.05,146.4,146.21,0.41,-0.08,0.09,146.64\n01/17/2013 12:00:00 AM,147.7,148.42,147.41,147.915,148,146.69,146.43,0.92,0.34,0.12,147.76\n01/18/2013 12:00:00 AM,147.97,148.49,147.43,147.96,148.33,146.99,146.7,0.69,0.01,0.11,147.93\n01/22/2013 12:00:00 AM,148.33,149.13,147.98,148.555,149.13,147.33,147,0.88,0.15,0.13,148.63\n01/23/2013 12:00:00 AM,149.13,149.5,148.86,149.18,149.37,147.73,147.35,1.04,0.19,0.13,149.3\n01/24/2013 12:00:00 AM,149.15,150.14,149.01,149.575,149.41,148.15,147.74,1.01,0.07,0.14,149.7\n01/25/2013 12:00:00 AM,149.88,150.25,149.37,149.81,150.25,148.56,148.15,0.88,-0.06,0.13,149.91\n01/28/2013 12:00:00 AM,150.29,150.33,149.51,149.92,150.07,148.91,148.54,0.71,-0.16,0.14,149.98\n01/29/2013 12:00:00 AM,149.77,150.85,149.67,150.26,150.66,149.24,148.9,0.73,-0.07,0.13,150.26\n01/30/2013 12:00:00 AM,150.64,150.94,149.93,150.435,150.07,149.54,149.23,0.64,-0.1,0.13,150.36\n01/31/2013 12:00:00 AM,149.89,150.38,149.6,149.99,149.7,149.72,149.51,0.18,-0.39,0.11,149.86\n02/01/2013 12:00:00 AM,150.65,151.42,150.39,150.905,151.24,149.96,149.74,0.72,0.2,0.13,150.72\n02/04/2013 12:00:00 AM,150.32,150.58,149.43,150.005,149.54,150.06,149.93,-0.05,-0.47,0.09,149.79\n02/05/2013 12:00:00 AM,150.35,151.48,150.29,150.885,151.05,150.22,150.08,0.52,0.19,0.12,150.66\n02/06/2013 12:00:00 AM,150.52,151.26,150.41,150.835,151.16,150.37,150.22,0.35,-0.02,0.11,150.6\n02/07/2013 12:00:00 AM,151.21,151.35,149.86,150.605,150.96,150.46,150.36,0.11,-0.19,0.1,150.39\n02/08/2013 12:00:00 AM,151.22,151.89,151.22,151.555,151.8,150.66,150.49,0.68,0.34,0.12,151.36\n02/11/2013 12:00:00 AM,151.74,151.9,151.39,151.645,151.77,150.87,150.66,0.55,0.08,0.12,151.45\n02/12/2013 12:00:00 AM,151.78,152.3,151.61,151.955,152.02,151.12,150.88,0.6,0.07,0.11,151.77\n02/13/2013 12:00:00 AM,152.33,152.61,151.72,152.165,152.15,151.36,151.12,0.57,0.01,0.12,151.99\n02/14/2013 12:00:00 AM,151.69,152.47,151.52,151.995,152.29,151.55,151.35,0.31,-0.19,0.1,151.84\n02/15/2013 12:00:00 AM,152.43,152.59,151.55,152.07,152.11,151.69,151.54,0.27,-0.13,0.1,151.96\n02/19/2013 12:00:00 AM,152.37,153.28,152.16,152.72,153.25,151.9,151.71,0.61,0.19,0.11,152.64\n02/20/2013 12:00:00 AM,153.14,153.19,151.26,152.225,151.34,152.03,151.88,0.13,-0.26,0.1,152.17\n02/21/2013 12:00:00 AM,150.96,150.96,149.94,150.45,150.42,151.84,151.95,-1.04,-1.01,0.03,150.5\n02/22/2013 12:00:00 AM,151.15,151.89,150.49,151.19,151.89,151.68,151.85,-0.28,0.06,0.06,151.36\n02/25/2013 12:00:00 AM,152.63,152.86,149,150.93,149,151.51,151.68,-0.37,-0.02,0.04,151.18\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,149.465,150.02,151.14,151.46,-1.2,-0.63,0,149.82\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.045,151.91,150.99,151.2,0.13,0.69,0.04,151.47\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,152.14,151.61,151.1,151.06,0.79,0.86,0.08,152.5\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,151.375,152.11,151.18,151.09,0.09,-0.09,0.04,151.63\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.22,152.92,151.36,151.21,0.6,0.33,0.07,152.36\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.17,154.29,151.84,151.44,1.68,0.97,0.12,154.09\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.54,154.5,152.42,151.87,1.46,0.32,0.13,154.2\n03/07/2013 12:00:00 AM,154.7,154.98,154.52,154.75,154.78,152.98,152.42,1.19,-0.05,0.12,154.17\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.155,155.44,153.51,152.97,1.12,-0.09,0.14,154.4\n03/11/2013 12:00:00 AM,155.32,156.04,155.13,155.585,156.03,154.02,153.51,1.09,-0.08,0.13,154.7\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.655,155.68,154.45,154,0.84,-0.24,0.13,154.72\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.675,155.9,154.79,154.43,0.62,-0.29,0.12,154.78\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.51,156.73,155.18,154.8,0.98,0.12,0.15,155.71\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.675,155.83,155.39,155.14,0.18,-0.53,0.11,155.04\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.92,154.97,155.41,155.34,-0.35,-0.67,0.08,154.55\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.55,154.61,155.29,155.38,-0.49,-0.44,0.06,154.5\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.605,155.69,155.29,155.32,0.32,0.39,0.09,155.84\n03/21/2013 12:00:00 AM,154.76,155.64,154.1,154.87,154.36,155.23,155.27,-0.24,-0.2,0.06,155.33\n03/22/2013 12:00:00 AM,154.85,155.6,154.73,155.165,155.6,155.2,155.24,0.01,0.09,0.07,155.82\n03/25/2013 12:00:00 AM,156.01,156.27,154.35,155.31,154.95,155.2,155.2,0.1,0.12,0.07,156.06\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,155.825,156.19,155.29,155.22,0.4,0.29,0.08,156.58\n03/27/2013 12:00:00 AM,155.26,156.24,155,155.62,156.19,155.38,155.29,0.16,-0.03,0.07,156.3\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.3,156.67,155.54,155.4,0.55,0.27,0.09,156.83\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.29,156.05,155.72,155.54,0.39,0.02,0.08,156.6\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.79,156.82,155.94,155.73,0.6,0.16,0.09,156.86\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.925,155.23,156.02,155.9,-0.11,-0.46,0.06,155.77\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.63,155.86,156,155.99,-0.27,-0.36,0.05,155.31\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,154.56,155.16,155.78,155.95,-0.88,-0.63,0.01,154.16\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,155.485,156.21,155.65,155.8,-0.05,0.3,0.04,155.05\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.65,156.75,155.75,155.71,0.71,0.73,0.07,156.17\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158,158.67,156.11,155.82,1.37,0.88,0.11,157.43\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.125,159.19,156.69,156.17,1.71,0.7,0.13,158.46\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.48,158.8,157.18,156.67,0.83,-0.32,0.11,157.77\n04/15/2013 12:00:00 AM,158,158.13,155.1,156.615,155.12,157.28,157.08,-0.58,-1.24,0.04,156.01\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,156.7,157.41,157.23,157.24,-0.37,-0.48,0.05,156.3\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.3,155.11,156.93,157.17,-1.16,-0.83,0,155.18\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.48,154.14,156.46,156.89,-1.36,-0.57,-0.02,154.69\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,154.835,155.48,156.04,156.47,-0.77,0.18,-0.01,155.36\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,155.645,156.17,155.82,156.09,-0.04,0.65,0.02,156.37\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.05,157.78,155.92,155.9,0.87,1.02,0.05,157.83\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.92,157.88,156.25,155.98,1.18,0.76,0.08,158.61\n04/25/2013 12:00:00 AM,158.34,159.27,158.1,158.685,158.52,156.73,156.29,1.35,0.5,0.09,159.18\n04/26/2013 12:00:00 AM,158.33,158.6,157.73,158.165,158.24,157.12,156.71,0.65,-0.29,0.08,158.41\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.035,159.3,157.55,157.13,1.02,0.12,0.09,159.02\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.165,159.68,157.95,157.55,0.83,-0.1,0.1,158.88\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.755,158.28,158.22,157.92,0.34,-0.42,0.07,158.24\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.21,159.75,158.47,158.22,0.54,-0.07,0.09,158.54\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.46,161.37,159,158.54,1.82,0.93,0.15,160.62\n05/06/2013 12:00:00 AM,161.31,162.01,161.42,161.715,161.79,159.6,159.02,1.49,0.22,0.15,160.71\n05/07/2013 12:00:00 AM,162,162.65,161.67,162.16,162.6,160.2,159.6,1.36,0.01,0.15,161.09\n05/08/2013 12:00:00 AM,162.57,163.39,162.19,162.79,163.34,160.81,160.2,1.39,0.02,0.17,161.72\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,163.085,162.88,161.37,160.8,1.2,-0.14,0.16,162.09\n05/10/2013 12:00:00 AM,162.99,163.55,162.51,163.03,163.41,161.83,161.35,0.84,-0.35,0.15,162.19\n05/13/2013 12:00:00 AM,163.2,163.81,162.82,163.315,163.54,162.22,161.82,0.79,-0.22,0.15,162.69\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,164.51,165.23,162.71,162.25,1.33,0.3,0.18,164.11\n05/15/2013 12:00:00 AM,164.96,166.45,164.91,165.68,166.12,163.33,162.74,1.71,0.44,0.2,165.45\n05/16/2013 12:00:00 AM,165.78,166.36,165.09,165.725,165.34,163.91,163.32,1.27,-0.1,0.2,165.64\n05/17/2013 12:00:00 AM,165.95,167.04,165.73,166.385,166.94,164.5,163.91,1.35,-0.01,0.2,166.43\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,167.095,166.93,165.1,164.5,1.43,0.06,0.21,167.21\n05/21/2013 12:00:00 AM,167.08,167.8,166.5,167.15,167.17,165.63,165.08,1.07,-0.24,0.2,167.3\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,167.12,165.93,166.05,165.6,0.76,-0.36,0.19,167.28\n05/23/2013 12:00:00 AM,164.16,165.91,163.94,164.925,165.45,166.05,165.94,-0.84,-1.39,0.11,165.16\n05/24/2013 12:00:00 AM,164.47,165.38,163.98,164.68,165.31,165.84,166,-0.77,-0.64,0.1,165.03\n05/28/2013 12:00:00 AM,167.06,167.78,165.81,166.795,166.3,165.91,165.91,0.79,0.86,0.15,167.16\n05/29/2013 12:00:00 AM,165.42,165.8,164.34,165.07,165.22,165.81,165.87,-0.53,-0.53,0.1,165.41\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.905,165.83,165.78,165.83,0.15,0.25,0.11,166.21\n05/31/2013 12:00:00 AM,165.37,166.31,163.13,164.72,163.45,165.62,165.75,-0.65,-0.46,0.07,164.98\n06/03/2013 12:00:00 AM,163.83,164.46,162.66,163.56,164.35,165.26,165.57,-1.21,-0.65,0.03,163.82\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.915,163.56,164.92,165.26,-0.65,0.09,0.04,164.17\n06/05/2013 12:00:00 AM,163.09,163.42,161.13,162.275,161.27,164.41,164.88,-1.52,-0.59,-0.02,162.55\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,161.495,162.73,163.79,164.38,-1.6,-0.35,-0.03,161.83\n06/07/2013 12:00:00 AM,163.85,164.95,163.14,164.045,164.8,163.59,163.89,0.46,1.38,0.04,164.36\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.885,164.8,163.7,163.66,0.87,1.02,0.07,165.04\n06/11/2013 12:00:00 AM,163.3,164.54,162.74,163.64,163.1,163.73,163.68,-0.16,-0.26,0.02,163.64\n06/12/2013 12:00:00 AM,164.22,164.39,161.6,162.995,161.75,163.64,163.7,-0.53,-0.42,0.01,162.91\n06/13/2013 12:00:00 AM,161.66,164.5,161.3,162.9,164.21,163.5,163.63,-0.44,-0.16,0,162.77\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.79,163.18,163.48,163.53,0.24,0.43,0.03,163.6\n06/17/2013 12:00:00 AM,164.29,165.22,163.55,164.385,164.44,163.61,163.52,0.56,0.45,0.04,164.12\n06/18/2013 12:00:00 AM,164.53,165.99,164.52,165.255,165.74,163.9,163.65,0.96,0.53,0.07,164.89\n06/19/2013 12:00:00 AM,165.6,165.89,163.38,164.635,163.45,164.12,163.88,0.3,-0.23,0.04,164.21\n06/20/2013 12:00:00 AM,161.86,162.1,158.98,160.54,159.4,163.68,163.95,-2.39,-2.15,-0.08,160.24\n06/21/2013 12:00:00 AM,159.64,159.76,157.47,158.615,159.07,162.77,163.56,-2.96,-1.53,-0.14,158.64\n06/24/2013 12:00:00 AM,157.41,158.43,155.73,157.08,157.06,161.59,162.7,-3.13,-0.88,-0.17,157.52\n06/25/2013 12:00:00 AM,158.48,160.1,157.42,158.76,158.57,160.73,161.67,-1.2,1.03,-0.12,159.54\n06/26/2013 12:00:00 AM,159.87,160.5,159.25,159.875,160.14,160.28,160.83,-0.16,1.34,-0.07,160.82\n06/27/2013 12:00:00 AM,161.1,161.82,160.95,161.385,161.08,160.26,160.39,0.84,1.45,-0.02,162.31\n06/28/2013 12:00:00 AM,160.63,161.4,159.86,160.63,160.42,160.31,160.28,0.13,0.2,-0.04,161.43\n07/01/2013 12:00:00 AM,161.26,162.48,161.08,161.78,161.36,160.55,160.36,0.83,0.6,-0.01,162.37\n07/02/2013 12:00:00 AM,161.12,162.3,160.5,161.4,161.21,160.76,160.54,0.36,-0.06,-0.01,161.71\n07/03/2013 12:00:00 AM,160.48,161.77,160.22,160.995,161.34,160.88,160.74,0,-0.32,-0.03,161.05\n07/05/2013 12:00:00 AM,162.47,163.08,161.3,162.19,163.02,161.11,160.91,0.76,0.39,0.01,161.96\n07/08/2013 12:00:00 AM,163.86,164.39,163.58,163.985,163.95,161.62,161.18,1.7,0.89,0.06,163.43\n07/09/2013 12:00:00 AM,164.98,165.33,164.27,164.8,165.13,162.28,161.66,1.75,0.49,0.09,163.91\n07/10/2013 12:00:00 AM,164.97,165.75,164.63,165.19,165.19,162.96,162.28,1.52,0.06,0.09,164.03\n07/11/2013 12:00:00 AM,167.11,167.61,166.53,167.07,167.44,163.82,163,2.3,0.6,0.15,165.7\n07/12/2013 12:00:00 AM,167.39,167.93,167.13,167.53,167.51,164.69,163.82,1.97,0.04,0.15,166.02\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.035,168.15,165.51,164.67,1.75,-0.16,0.16,166.51\n07/16/2013 12:00:00 AM,168.26,168.36,167.07,167.715,167.52,166.14,165.46,1.07,-0.61,0.13,166.31\n07/17/2013 12:00:00 AM,168.16,168.48,167.73,168.105,167.95,166.67,166.12,1.02,-0.35,0.14,166.95\n07/18/2013 12:00:00 AM,168.31,169.27,168.2,168.735,168.87,167.18,166.67,1.15,-0.09,0.15,167.89\n07/19/2013 12:00:00 AM,168.52,169.23,168.31,168.77,169.17,167.6,167.16,0.85,-0.26,0.15,168.28\n07/22/2013 12:00:00 AM,169.41,169.74,169.01,169.375,169.5,168.02,167.6,1.01,-0.01,0.15,169.24\n07/23/2013 12:00:00 AM,169.8,169.83,169.05,169.44,169.14,168.39,168.01,0.77,-0.17,0.15,169.63\n07/24/2013 12:00:00 AM,169.79,169.86,168.18,169.02,168.52,168.62,168.36,0.29,-0.44,0.12,169.51\n07/25/2013 12:00:00 AM,168.22,169.08,167.94,168.51,168.93,168.69,168.58,-0.11,-0.52,0.1,169.27\n07/26/2013 12:00:00 AM,168.22,169.16,167.52,168.34,169.11,168.67,168.67,-0.19,-0.32,0.09,169.29\n07/29/2013 12:00:00 AM,168.68,169.06,168.11,168.585,168.59,168.65,168.67,0.02,0.01,0.09,169.63\n07/30/2013 12:00:00 AM,169.1,169.28,168.19,168.735,168.59,168.65,168.66,0.11,0.09,0.09,169.76\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,169.17,168.71,168.73,168.67,0.36,0.24,0.1,170.05\n08/01/2013 12:00:00 AM,169.99,170.81,169.9,170.355,170.66,169,168.78,1.01,0.62,0.13,170.98\n08/02/2013 12:00:00 AM,170.28,170.97,170.05,170.51,170.95,169.32,169.01,0.83,0.18,0.13,170.78\n08/05/2013 12:00:00 AM,170.57,170.96,170.35,170.655,170.7,169.64,169.32,0.7,-0.01,0.12,170.57\n08/06/2013 12:00:00 AM,170.37,170.74,169.35,170.045,169.73,169.82,169.6,0.12,-0.45,0.1,169.64\n08/07/2013 12:00:00 AM,169.19,169.43,168.55,168.99,169.18,169.77,169.76,-0.59,-0.76,0.06,168.38\n08/08/2013 12:00:00 AM,169.98,170.18,168.93,169.555,169.8,169.72,169.77,-0.07,0,0.08,168.82\n08/09/2013 12:00:00 AM,169.58,170.1,168.72,169.41,169.31,169.65,169.71,-0.14,-0.04,0.06,168.62\n08/12/2013 12:00:00 AM,168.46,169.31,168.38,168.845,169.11,169.51,169.63,-0.46,-0.26,0.05,168.1\n08/13/2013 12:00:00 AM,169.41,169.9,168.41,169.155,169.61,169.4,169.52,-0.14,0.12,0.05,168.52\n08/14/2013 12:00:00 AM,169.53,169.8,168.7,169.25,168.74,169.34,169.41,-0.04,0.14,0.05,168.78\n08/15/2013 12:00:00 AM,167.41,167.43,166.09,166.76,166.38,168.94,169.26,-1.61,-1.11,-0.03,166.55\n08/16/2013 12:00:00 AM,166.06,166.63,165.5,166.065,165.83,168.37,168.9,-1.62,-0.56,-0.05,166.23\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,165.485,164.77,167.73,168.35,-1.54,-0.22,-0.07,166.01\n08/20/2013 12:00:00 AM,165.04,166.2,164.86,165.53,165.58,167.16,167.75,-1.09,0.24,-0.06,166.37\n08/21/2013 12:00:00 AM,165.12,166.03,164.19,165.11,164.56,166.65,167.17,-1.06,0.16,-0.07,166.18\n08/22/2013 12:00:00 AM,164.9,166.3,164.89,165.595,166.06,166.3,166.69,-0.46,0.54,-0.05,166.77\n08/23/2013 12:00:00 AM,166.55,166.83,165.77,166.3,166.62,166.16,166.35,0.11,0.71,-0.03,167.43\n08/26/2013 12:00:00 AM,166.79,167.3,165.89,166.595,166,166.18,166.2,0.27,0.48,-0.01,167.54\n08/27/2013 12:00:00 AM,164.36,166,163.21,164.605,163.33,165.95,166.12,-1.07,-0.77,-0.08,165.34\n08/28/2013 12:00:00 AM,163.26,164.49,163.05,163.77,163.91,165.55,165.91,-1.31,-0.59,-0.09,164.33\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.22,164.17,165.2,165.56,-0.67,0.18,-0.08,164.57\n08/30/2013 12:00:00 AM,164.51,164.53,163.17,163.85,163.65,164.87,165.2,-0.72,0.06,-0.08,163.97\n09/03/2013 12:00:00 AM,165.23,165.58,163.7,164.64,164.39,164.71,164.91,-0.02,0.56,-0.06,164.51\n09/04/2013 12:00:00 AM,164.43,166.03,164.13,165.08,165.75,164.7,164.75,0.27,0.5,-0.03,164.7\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,166.065,165.96,164.9,164.75,0.82,0.66,-0.01,165.44\n09/06/2013 12:00:00 AM,166.51,166.98,164.48,165.73,166.04,165.1,164.9,0.38,0,-0.01,164.92\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.09,167.63,165.46,165.14,1.14,0.56,0.03,166.14\n09/10/2013 12:00:00 AM,168.64,168.9,168.26,168.58,168.87,166.06,165.52,1.78,0.75,0.07,167.51\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,168.875,169.4,166.7,166.07,1.48,0.14,0.07,167.74\n09/12/2013 12:00:00 AM,169.34,169.56,168.72,169.14,168.95,167.3,166.69,1.24,-0.12,0.08,168.03\n09/13/2013 12:00:00 AM,169.13,169.46,168.74,169.1,169.33,167.79,167.27,0.88,-0.35,0.07,168.12\n09/16/2013 12:00:00 AM,171.16,171.24,170.04,170.64,170.31,168.39,167.82,1.62,0.37,0.12,169.82\n09/17/2013 12:00:00 AM,170.46,171.11,170.46,170.785,171.07,168.97,168.39,1.27,-0.08,0.11,170.15\n09/18/2013 12:00:00 AM,171.01,173.52,170.58,172.05,173.05,169.64,169,1.73,0.3,0.15,171.6\n09/19/2013 12:00:00 AM,173.52,173.6,172.59,173.095,172.76,170.4,169.67,1.92,0.29,0.17,172.79\n09/20/2013 12:00:00 AM,172.33,172.33,170.58,171.455,170.72,170.85,170.33,0.35,-1.03,0.11,171.34\n09/23/2013 12:00:00 AM,170.49,170.65,169.39,170.02,169.93,170.9,170.75,-0.66,-1.29,0.06,170.18\n09/24/2013 12:00:00 AM,169.9,170.53,169.21,169.87,169.53,170.76,170.85,-0.57,-0.59,0.05,170.33\n09/25/2013 12:00:00 AM,169.64,169.98,168.89,169.435,169.04,170.52,170.74,-0.69,-0.37,0.03,170.15\n09/26/2013 12:00:00 AM,169.32,170.17,169.05,169.61,169.69,170.29,170.53,-0.39,0.06,0.04,170.5\n09/27/2013 12:00:00 AM,168.84,169.14,168.47,168.805,168.91,169.99,170.27,-0.8,-0.25,0.01,169.79\n09/30/2013 12:00:00 AM,167.48,168.54,167.15,167.845,168.01,169.56,169.96,-1.19,-0.41,-0.02,168.89\n10/01/2013 12:00:00 AM,168.14,169.5,167.97,168.735,169.34,169.28,169.6,-0.3,0.47,0.01,169.73\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,168.585,169.18,169.07,169.3,-0.31,0.24,0.01,169.42\n10/03/2013 12:00:00 AM,168.79,168.94,166.84,167.89,167.62,168.81,169.06,-0.67,-0.14,-0.02,168.52\n10/04/2013 12:00:00 AM,167.75,169.06,167.53,168.295,168.89,168.64,168.83,-0.23,0.26,0,168.69\n10/07/2013 12:00:00 AM,167.42,168.45,167.25,167.85,167.43,168.46,168.64,-0.45,-0.03,-0.02,167.98\n10/08/2013 12:00:00 AM,167.4,167.62,165.36,166.49,165.48,168.1,168.42,-1.19,-0.57,-0.06,166.41\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.365,165.6,167.57,168.06,-1.58,-0.59,-0.09,165.18\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,168.245,169.17,167.46,167.68,0.68,1.41,0.01,167.92\n10/11/2013 12:00:00 AM,168.91,170.32,168.77,169.545,170.26,167.73,167.55,1.32,1.21,0.04,168.99\n10/14/2013 12:00:00 AM,169.21,171.08,169.08,170.08,170.94,168.17,167.77,1.3,0.59,0.06,169.31\n10/15/2013 12:00:00 AM,170.51,171.15,169.47,170.31,169.7,168.65,168.18,1.09,0.12,0.06,169.39\n10/16/2013 12:00:00 AM,170.72,172.16,170.63,171.395,172.07,169.24,168.68,1.49,0.33,0.09,170.38\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,172.33,173.22,169.91,169.26,1.67,0.3,0.11,171.26\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.01,174.39,170.77,169.96,2.29,0.59,0.16,172.91\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.38,174.4,171.62,170.77,1.9,-0.01,0.16,173.29\n10/22/2013 12:00:00 AM,174.91,175.93,174.43,175.18,175.41,172.47,171.62,1.89,-0.03,0.18,174.17\n10/23/2013 12:00:00 AM,174.81,174.89,173.96,174.425,174.57,173.08,172.41,0.89,-0.78,0.14,173.59\n10/24/2013 12:00:00 AM,174.92,175.37,174.51,174.94,175.15,173.58,173.05,0.97,-0.34,0.15,174.35\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.585,175.95,174.07,173.58,1.12,-0.06,0.16,175.25\n10/28/2013 12:00:00 AM,175.89,176.47,175.7,176.085,176.23,174.55,174.07,1.13,-0.02,0.17,175.98\n10/29/2013 12:00:00 AM,176.63,177.24,176.38,176.81,177.17,175.06,174.55,1.28,0.11,0.18,176.9\n10/30/2013 12:00:00 AM,177.38,177.51,175.66,176.585,176.29,175.48,175.04,0.79,-0.31,0.16,176.83\n10/31/2013 12:00:00 AM,176.15,176.89,175.53,176.21,175.79,175.75,175.44,0.33,-0.5,0.14,176.6\n11/01/2013 12:00:00 AM,176.02,176.61,175.22,175.915,176.21,175.87,175.71,0.06,-0.46,0.12,176.42\n11/04/2013 12:00:00 AM,176.69,176.9,176.11,176.505,176.83,176.01,175.88,0.42,0.05,0.13,177.07\n11/05/2013 12:00:00 AM,176.14,176.75,175.57,176.16,176.27,176.09,176,0.08,-0.21,0.12,176.71\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.02,177.17,176.25,176.11,0.61,0.29,0.13,177.49\n11/07/2013 12:00:00 AM,177.5,177.64,174.76,176.2,174.93,176.31,176.23,-0.08,-0.36,0.1,176.55\n11/08/2013 12:00:00 AM,174.87,177.31,174.85,176.08,177.29,176.3,176.29,-0.14,-0.22,0.09,176.32\n11/11/2013 12:00:00 AM,177.12,177.53,176.91,177.22,177.32,176.43,176.33,0.63,0.47,0.12,177.29\n11/12/2013 12:00:00 AM,176.94,177.36,176.37,176.865,176.96,176.54,176.42,0.23,-0.05,0.1,176.75\n11/13/2013 12:00:00 AM,176.09,178.43,176.09,177.26,178.38,176.69,176.55,0.42,0.11,0.11,176.99\n11/14/2013 12:00:00 AM,178.54,179.42,178.25,178.835,179.27,177.06,176.74,1.31,0.72,0.15,178.37\n11/15/2013 12:00:00 AM,179.56,180.12,179.33,179.725,180.05,177.59,177.1,1.52,0.52,0.17,179.06\n11/18/2013 12:00:00 AM,180.35,180.5,179.02,179.76,179.42,178.11,177.59,1.12,-0.04,0.16,178.93\n11/19/2013 12:00:00 AM,179.33,179.87,178.72,179.295,179.03,178.48,178.07,0.52,-0.48,0.14,178.41\n11/20/2013 12:00:00 AM,179.39,179.93,177.98,178.955,178.47,178.69,178.44,0.16,-0.52,0.12,178.12\n11/21/2013 12:00:00 AM,178.97,180.05,178.86,179.455,179.91,178.88,178.69,0.44,-0.06,0.13,178.75\n11/22/2013 12:00:00 AM,179.98,180.83,179.77,180.3,180.81,179.16,178.91,0.85,0.29,0.14,179.74\n11/25/2013 12:00:00 AM,181.13,181.17,180.37,180.77,180.63,179.51,179.18,0.92,0.2,0.15,180.35\n11/26/2013 12:00:00 AM,180.72,181.22,180.4,180.81,180.68,179.83,179.5,0.69,-0.07,0.14,180.56\n11/27/2013 12:00:00 AM,180.87,181.24,180.65,180.945,181.12,180.11,179.82,0.59,-0.11,0.14,180.86\n11/29/2013 12:00:00 AM,181.32,181.75,180.8,181.275,180.95,180.39,180.11,0.64,-0.02,0.14,181.35\n12/02/2013 12:00:00 AM,181.09,181.43,180.25,180.84,180.53,180.56,180.36,0.19,-0.35,0.12,181.06\n12/03/2013 12:00:00 AM,179.94,180.39,179.17,179.78,179.75,180.51,180.51,-0.54,-0.72,0.08,180.15\n12/04/2013 12:00:00 AM,179.1,180.48,178.35,179.415,179.73,180.34,180.48,-0.62,-0.43,0.06,179.94\n12/05/2013 12:00:00 AM,179.41,179.74,178.77,179.255,178.94,180.11,180.32,-0.56,-0.15,0.05,179.9\n12/06/2013 12:00:00 AM,180.67,181.11,180.15,180.63,180.94,180.1,180.16,0.47,0.71,0.09,181.28\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.415,181.4,180.29,180.15,0.84,0.65,0.11,181.94\n12/10/2013 12:00:00 AM,180.98,181.36,180.63,180.995,180.75,180.46,180.28,0.34,-0.04,0.09,181.35\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,179.675,178.72,180.41,180.41,-0.59,-0.73,0.04,179.89\n12/12/2013 12:00:00 AM,178.62,178.86,177.76,178.31,178.13,180.09,180.34,-1.3,-0.91,0,178.45\n12/13/2013 12:00:00 AM,178.5,178.66,177.77,178.215,178.11,179.69,180.07,-1,-0.24,0,178.31\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.355,179.22,179.49,179.74,0,0.64,0.04,179.38\n12/17/2013 12:00:00 AM,179.36,179.41,178.25,178.83,178.65,179.32,179.5,-0.34,0.09,0.01,178.76\n12/18/2013 12:00:00 AM,178.92,181.73,177.32,179.525,181.7,179.28,179.35,0.2,0.45,0.04,179.37\n12/19/2013 12:00:00 AM,181.19,181.7,180.71,181.205,181.49,179.55,179.36,1.21,0.99,0.08,180.91\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.28,181.56,179.9,179.57,0.93,0.29,0.08,180.83\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.355,182.53,180.4,179.94,1.36,0.45,0.11,181.77\n12/24/2013 12:00:00 AM,182.54,183.01,182.45,182.73,182.96,180.93,180.41,1.23,0.12,0.12,182.02\n12/26/2013 12:00:00 AM,183.34,183.96,183.32,183.64,183.85,181.52,180.94,1.47,0.23,0.13,182.85\n12/27/2013 12:00:00 AM,184.1,184.18,183.66,183.92,183.85,182.1,181.52,1.25,-0.07,0.14,183.09\n12/30/2013 12:00:00 AM,183.87,184.02,183.58,183.8,183.82,182.57,182.08,0.83,-0.36,0.12,183.01\n12/31/2013 12:00:00 AM,184.07,184.69,183.93,184.31,184.69,183,182.56,0.93,-0.12,0.13,183.62\n01/02/2014 12:00:00 AM,183.98,184.07,182.48,183.275,182.92,183.21,182.95,0.01,-0.75,0.09,182.75\n01/03/2014 12:00:00 AM,183.21,183.6,182.63,183.115,182.88,183.27,183.17,-0.09,-0.46,0.08,182.84\n01/06/2014 12:00:00 AM,183.47,183.56,182.08,182.82,182.36,183.23,183.25,-0.25,-0.35,0.07,182.82\n01/07/2014 12:00:00 AM,183.09,183.79,182.95,183.37,183.48,183.24,183.24,0.17,0.15,0.08,183.62\n01/08/2014 12:00:00 AM,183.45,183.83,182.89,183.36,183.52,183.26,183.24,0.11,0.05,0.07,183.8\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.46,183.64,183.29,183.26,0.15,0.06,0.08,184.04\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,183.615,184.14,183.35,183.3,0.21,0.08,0.07,184.26\n01/13/2014 12:00:00 AM,183.72,184.18,181.34,182.76,181.68,183.29,183.32,-0.4,-0.41,0.05,183.43\n01/14/2014 12:00:00 AM,182.28,183.77,181.95,182.86,183.67,183.2,183.29,-0.22,-0.08,0.04,183.51\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.325,184.66,183.33,183.26,0.77,0.71,0.09,184.84\n01/16/2014 12:00:00 AM,184.28,184.66,183.83,184.245,184.42,183.52,183.35,0.51,0.17,0.08,184.55\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.885,183.63,183.64,183.5,0.14,-0.19,0.07,183.98\n01/21/2014 12:00:00 AM,184.7,184.77,183.05,183.91,184.18,183.73,183.63,0.12,-0.12,0.06,183.8\n01/22/2014 12:00:00 AM,184.49,184.57,183.91,184.24,184.3,183.84,183.73,0.3,0.07,0.07,183.94\n01/23/2014 12:00:00 AM,183.36,183.4,181.82,182.61,182.79,183.7,183.77,-0.82,-0.8,0.01,182.2\n01/24/2014 12:00:00 AM,181.6,181.66,178.83,180.245,178.89,183.14,183.59,-2.1,-1.37,-0.06,179.9\n01/27/2014 12:00:00 AM,179.06,179.52,177.12,178.32,178.01,182.22,183.05,-2.75,-1.18,-0.12,178.19\n01/28/2014 12:00:00 AM,178.14,179.3,178.12,178.71,179.07,181.36,182.24,-1.75,0.17,-0.09,178.84\n01/29/2014 12:00:00 AM,177.56,178.55,176.88,177.715,177.35,180.5,181.36,-1.91,0,-0.12,178.1\n01/30/2014 12:00:00 AM,178.86,179.81,178.26,179.035,179.23,179.96,180.58,-0.55,1.04,-0.07,179.61\n01/31/2014 12:00:00 AM,177.02,179.29,176.92,178.105,178.18,179.48,179.97,-0.99,0.21,-0.1,178.8\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,176.1,174.17,178.8,179.43,-1.99,-0.65,-0.15,176.92\n02/04/2014 12:00:00 AM,174.95,175.84,174.11,174.975,175.38,177.99,178.77,-2.17,-0.46,-0.18,175.93\n02/05/2014 12:00:00 AM,174.79,175.56,173.71,174.635,175.17,177.18,177.99,-1.79,0.05,-0.18,175.68\n02/06/2014 12:00:00 AM,175.58,177.48,175.22,176.35,177.48,176.76,177.28,-0.21,1.22,-0.12,177.33\n02/07/2014 12:00:00 AM,178.31,179.87,177.73,178.8,179.68,176.89,176.9,1.41,1.84,-0.03,179.5\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,179.64,180.01,177.34,176.97,1.56,1.04,-0.01,179.92\n02/11/2014 12:00:00 AM,180.16,182.44,180.04,181.24,181.98,178.09,177.42,2.15,0.94,0.05,181.01\n02/12/2014 12:00:00 AM,182.22,182.83,181.71,182.27,182.07,178.98,178.12,2.22,0.5,0.07,181.51\n02/13/2014 12:00:00 AM,180.84,183.2,180.83,182.015,183.01,179.77,178.95,1.45,-0.36,0.06,180.81\n02/14/2014 12:00:00 AM,182.83,184.36,182.67,183.515,184.02,180.61,179.78,2.01,0.2,0.1,181.96\n02/18/2014 12:00:00 AM,184.19,184.49,183.65,184.07,184.24,181.44,180.61,1.81,-0.06,0.11,182.28\n02/19/2014 12:00:00 AM,183.76,184.95,182.87,183.91,183.02,182.12,181.4,1.21,-0.5,0.1,182.05\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,183.56,184.1,182.59,182.07,0.66,-0.68,0.09,181.83\n02/21/2014 12:00:00 AM,184.49,184.89,183.8,184.345,183.89,183.02,182.58,0.98,-0.11,0.1,182.89\n02/24/2014 12:00:00 AM,184.28,186.15,184.2,185.175,184.91,183.5,183.03,1.24,0.15,0.12,184.06\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.91,184.84,183.89,183.48,0.73,-0.3,0.11,184.21\n02/26/2014 12:00:00 AM,185.11,185.6,184.33,184.965,184.85,184.2,183.87,0.57,-0.27,0.1,184.72\n02/27/2014 12:00:00 AM,184.59,185.87,184.37,185.12,185.82,184.45,184.18,0.51,-0.18,0.1,185.33\n02/28/2014 12:00:00 AM,185.79,187.15,185.05,186.1,186.29,184.79,184.47,0.99,0.28,0.13,186.67\n03/03/2014 12:00:00 AM,184.69,185.45,183.75,184.6,184.98,184.89,184.73,-0.23,-0.77,0.07,185.48\n03/04/2014 12:00:00 AM,186.75,187.98,186.75,187.365,187.58,185.29,184.96,1.59,0.98,0.15,188.41\n03/05/2014 12:00:00 AM,187.72,188.07,187.45,187.76,187.75,185.8,185.32,1.41,0.37,0.15,188.77\n03/06/2014 12:00:00 AM,188.21,188.61,187.78,188.195,188.18,186.35,185.81,1.3,0.1,0.16,189.04\n03/07/2014 12:00:00 AM,188.87,188.96,187.43,188.195,188.26,186.83,186.33,0.94,-0.22,0.15,188.8\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,187.655,188.16,187.13,186.78,0.34,-0.57,0.13,187.99\n03/11/2014 12:00:00 AM,188.44,188.71,186.8,187.755,187.23,187.34,187.11,0.31,-0.32,0.12,187.82\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,186.625,187.28,187.31,187.28,-0.49,-0.76,0.08,186.46\n03/13/2014 12:00:00 AM,187.84,187.99,184.66,186.325,185.18,187.16,187.28,-0.55,-0.42,0.06,186.01\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,185.12,184.66,186.8,187.11,-1.17,-0.66,0.03,184.73\n03/17/2014 12:00:00 AM,185.59,186.77,185.51,186.14,186.33,186.57,186.83,-0.2,0.4,0.05,185.73\n03/18/2014 12:00:00 AM,186.71,187.91,186.51,187.21,187.66,186.57,186.63,0.54,0.78,0.08,186.75\n03/19/2014 12:00:00 AM,187.7,187.94,185.47,186.705,186.66,186.59,186.58,0.07,0.05,0.06,186.23\n03/20/2014 12:00:00 AM,186.26,187.89,185.92,186.905,187.75,186.65,186.6,0.18,0.11,0.07,186.47\n03/21/2014 12:00:00 AM,187.72,188.17,186.03,187.1,186.2,186.73,186.66,0.25,0.11,0.07,186.73\n03/24/2014 12:00:00 AM,186.82,187.07,184.62,185.845,185.43,186.64,186.69,-0.62,-0.6,0.03,185.6\n03/25/2014 12:00:00 AM,186.37,186.94,185.27,186.105,186.31,186.52,186.63,-0.28,-0.06,0.03,186.04\n03/26/2014 12:00:00 AM,187.03,187.34,184.92,186.13,184.97,186.42,186.53,-0.19,0.04,0.03,186.22\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.62,184.58,186.12,186.37,-1.1,-0.66,-0.02,184.9\n03/28/2014 12:00:00 AM,185.1,186.42,185,185.71,185.49,185.94,186.15,-0.1,0.41,0.02,186.16\n03/31/2014 12:00:00 AM,186.65,187.3,185.52,186.41,187.01,185.95,185.99,0.37,0.58,0.04,186.91\n04/01/2014 12:00:00 AM,187.62,188.36,187,187.68,188.25,186.2,186.01,1.08,0.83,0.08,188.13\n04/02/2014 12:00:00 AM,188.51,189.13,188.14,188.635,188.88,186.65,186.25,1.39,0.65,0.1,188.92\n04/03/2014 12:00:00 AM,189.17,189.22,188.05,188.635,188.63,187.11,186.65,1.01,0.03,0.09,188.71\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,187.9,186.4,187.41,187.07,0.27,-0.56,0.06,187.8\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,185.11,184.34,187.18,187.28,-1.58,-1.69,-0.02,184.96\n04/08/2014 12:00:00 AM,184.21,185.4,183.59,184.495,185.1,186.7,187.12,-1.54,-0.83,-0.04,184.41\n04/09/2014 12:00:00 AM,185.6,187.15,185.06,186.105,187.09,186.43,186.76,-0.09,0.68,0.01,186.06\n04/10/2014 12:00:00 AM,187.09,187.17,182.93,185.05,183.15,186.13,186.42,-0.74,-0.12,-0.02,185.04\n04/11/2014 12:00:00 AM,182.17,183.42,181.31,182.365,181.51,185.46,186.04,-2.25,-1.18,-0.1,182.49\n04/14/2014 12:00:00 AM,182.93,183.37,181.44,182.405,182.94,184.76,185.45,-1.61,-0.11,-0.1,182.73\n04/15/2014 12:00:00 AM,183.32,184.33,181.51,182.92,184.2,184.23,184.8,-0.84,0.54,-0.07,183.39\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,185.395,186.13,184.19,184.35,0.97,1.64,0,185.86\n04/17/2014 12:00:00 AM,185.88,186.91,185.56,186.235,186.39,184.48,184.27,1.24,1.04,0.03,186.55\n04/21/2014 12:00:00 AM,186.43,187.1,186.21,186.655,187.04,184.9,184.51,1.17,0.46,0.04,186.76\n04/22/2014 12:00:00 AM,187.23,188.4,187.13,187.765,187.89,185.48,184.94,1.55,0.5,0.07,187.62\n04/23/2014 12:00:00 AM,187.81,187.92,187.3,187.61,187.45,186.02,185.47,1.03,-0.16,0.06,187.22\n04/24/2014 12:00:00 AM,188.37,188.39,186.93,187.66,187.83,186.46,185.99,0.78,-0.29,0.06,187.07\n04/25/2014 12:00:00 AM,187.21,187.33,185.87,186.6,186.29,186.65,186.4,-0.11,-0.83,0.02,185.91\n04/28/2014 12:00:00 AM,187.05,187.69,184.96,186.325,186.88,186.67,186.61,-0.25,-0.54,0.02,185.65\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.56,187.75,186.81,186.7,0.6,0.37,0.05,186.93\n04/30/2014 12:00:00 AM,187.44,188.5,187.18,187.84,188.31,187.02,186.83,0.62,0.21,0.06,187.27\n05/01/2014 12:00:00 AM,188.22,188.84,187.73,188.285,188.32,187.28,187.03,0.73,0.2,0.07,187.8\n05/02/2014 12:00:00 AM,188.31,189.14,187.78,188.46,188.06,187.55,187.28,0.64,0.03,0.07,188.09\n05/05/2014 12:00:00 AM,187.14,188.55,186.62,187.585,188.42,187.66,187.51,-0.09,-0.54,0.04,187.37\n05/06/2014 12:00:00 AM,188,188.13,186.74,187.435,186.78,187.67,187.64,-0.16,-0.33,0.03,187.42\n05/07/2014 12:00:00 AM,187.43,187.97,186.01,186.99,187.88,187.57,187.64,-0.4,-0.34,0.01,187.18\n05/08/2014 12:00:00 AM,187.67,189.05,187.08,188.065,187.68,187.61,187.61,0.39,0.43,0.05,188.42\n05/09/2014 12:00:00 AM,187.69,188.04,186.83,187.435,187.96,187.6,187.6,-0.12,-0.15,0.02,187.89\n05/12/2014 12:00:00 AM,188.76,189.88,188.75,189.315,189.79,187.84,187.66,1.11,0.84,0.08,189.78\n05/13/2014 12:00:00 AM,190.02,190.42,189.77,190.095,189.96,188.27,187.89,1.31,0.58,0.1,190.45\n05/14/2014 12:00:00 AM,189.79,189.88,188.79,189.335,189.06,188.58,188.24,0.46,-0.34,0.07,189.55\n05/15/2014 12:00:00 AM,188.67,188.72,186.48,187.6,187.4,188.56,188.5,-0.77,-1.11,0.01,187.74\n05/16/2014 12:00:00 AM,187.51,188.13,186.72,187.425,188.05,188.39,188.52,-0.67,-0.5,0.01,187.54\n05/19/2014 12:00:00 AM,187.69,188.89,187.52,188.205,188.74,188.29,188.41,0.01,0.27,0.03,188.26\n05/20/2014 12:00:00 AM,188.65,188.67,187.07,187.87,187.55,188.2,188.29,-0.21,-0.01,0.02,187.86\n05/21/2014 12:00:00 AM,188.1,189.22,188.06,188.64,189.13,188.22,188.23,0.34,0.41,0.04,188.55\n05/22/2014 12:00:00 AM,189.18,189.98,188.86,189.42,189.59,188.41,188.26,0.74,0.52,0.06,189.22\n05/23/2014 12:00:00 AM,189.75,190.48,189.59,190.035,190.35,188.72,188.44,0.93,0.4,0.08,189.71\n05/27/2014 12:00:00 AM,191.05,191.58,190.95,191.265,191.52,189.21,188.76,1.46,0.59,0.11,190.79\n05/28/2014 12:00:00 AM,191.52,191.82,191.06,191.44,191.38,189.72,189.21,1.17,0.08,0.11,190.83\n05/29/2014 12:00:00 AM,191.82,192.4,191.33,191.865,192.37,190.23,189.72,1.12,-0.01,0.12,191.17\n05/30/2014 12:00:00 AM,192.19,192.8,192.03,192.415,192.68,190.74,190.23,1.17,0.01,0.12,191.67\n06/02/2014 12:00:00 AM,192.95,192.99,191.97,192.48,192.9,191.19,190.73,0.89,-0.21,0.12,191.75\n06/03/2014 12:00:00 AM,192.4,192.9,192.25,192.575,192.8,191.57,191.17,0.71,-0.25,0.11,191.92\n06/04/2014 12:00:00 AM,192.47,193.3,192.26,192.78,193.19,191.89,191.55,0.64,-0.18,0.12,192.24\n06/05/2014 12:00:00 AM,193.41,194.65,192.7,193.675,194.45,192.27,191.9,1.04,0.21,0.13,193.27\n06/06/2014 12:00:00 AM,194.87,195.43,194.78,195.105,195.38,192.83,192.31,1.66,0.58,0.17,194.79\n06/09/2014 12:00:00 AM,195.35,196.05,195.17,195.61,195.58,193.45,192.84,1.53,0.19,0.18,195.35\n06/10/2014 12:00:00 AM,195.33,195.64,194.92,195.28,195.6,193.95,193.42,0.9,-0.38,0.16,195.09\n06/11/2014 12:00:00 AM,194.9,195.12,194.48,194.8,194.92,194.27,193.91,0.35,-0.61,0.13,194.72\n06/12/2014 12:00:00 AM,194.65,194.8,193.11,193.955,193.54,194.34,194.21,-0.28,-0.79,0.1,194.03\n06/13/2014 12:00:00 AM,193.9,194.32,193.3,193.81,194.13,194.29,194.31,-0.3,-0.41,0.09,194.05\n06/16/2014 12:00:00 AM,193.9,194.7,193.66,194.18,194.29,194.26,194.3,0.02,0.05,0.1,194.55\n06/17/2014 12:00:00 AM,194.01,194.97,193.81,194.39,194.83,194.26,194.27,0.15,0.13,0.09,194.82\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,195.385,196.26,194.43,194.3,0.74,0.52,0.12,195.8\n06/19/2014 12:00:00 AM,196.43,196.6,195.8,196.2,196.48,194.75,194.47,1.06,0.51,0.14,196.5\n06/20/2014 12:00:00 AM,196.03,196.1,195.7,195.9,195.94,195.04,194.74,0.58,-0.1,0.12,196.06\n06/23/2014 12:00:00 AM,195.97,196.05,195.52,195.785,195.88,195.26,195.02,0.35,-0.23,0.11,195.8\n06/24/2014 12:00:00 AM,195.53,196.5,194.48,195.49,194.7,195.38,195.24,0.06,-0.33,0.1,195.38\n06/25/2014 12:00:00 AM,194.25,195.78,194.25,195.015,195.58,195.37,195.35,-0.26,-0.41,0.07,194.83\n06/26/2014 12:00:00 AM,195.61,195.63,194.13,194.88,195.44,195.3,195.35,-0.27,-0.22,0.07,194.65\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.38,195.82,195.28,195.31,0.12,0.19,0.08,195.13\n06/30/2014 12:00:00 AM,195.7,196.16,195.53,195.845,195.72,195.36,195.3,0.38,0.3,0.09,195.56\n07/01/2014 12:00:00 AM,196.19,197.63,196.13,196.88,197.03,195.61,195.4,0.94,0.57,0.11,196.55\n07/02/2014 12:00:00 AM,197.05,197.48,196.96,197.22,197.23,195.94,195.63,0.9,0.26,0.12,196.83\n07/03/2014 12:00:00 AM,197.79,198.29,197.64,197.965,198.2,196.36,195.96,1.13,0.3,0.13,197.53\n07/07/2014 12:00:00 AM,197.82,197.98,197.22,197.6,197.51,196.7,196.34,0.59,-0.26,0.11,197.15\n07/08/2014 12:00:00 AM,197.15,197.22,195.76,196.49,196.24,196.8,196.64,-0.28,-0.79,0.07,196.11\n07/09/2014 12:00:00 AM,196.73,197.29,196.31,196.8,197.12,196.84,196.79,-0.01,-0.2,0.08,196.55\n07/10/2014 12:00:00 AM,195.22,196.86,195.06,195.96,196.34,196.73,196.8,-0.54,-0.5,0.05,195.87\n07/11/2014 12:00:00 AM,196.22,196.75,195.78,196.265,196.61,196.62,196.73,-0.2,0.01,0.06,196.35\n07/14/2014 12:00:00 AM,197.61,197.86,197.44,197.65,197.6,196.72,196.67,0.74,0.72,0.09,197.84\n07/15/2014 12:00:00 AM,197.72,198.1,196.36,197.23,197.23,196.84,196.73,0.27,0.02,0.08,197.47\n07/16/2014 12:00:00 AM,198.11,198.26,197.42,197.84,197.96,197.03,196.86,0.58,0.24,0.09,198.1\n07/17/2014 12:00:00 AM,197.35,198.1,195.43,196.765,195.71,197.06,196.99,-0.26,-0.51,0.05,197.03\n07/18/2014 12:00:00 AM,196.35,197.91,196.24,197.075,197.71,197.08,197.06,0.01,-0.06,0.06,197.35\n07/21/2014 12:00:00 AM,197.09,197.5,196.43,196.965,197.34,197.07,197.07,-0.06,-0.08,0.05,197.21\n07/22/2014 12:00:00 AM,198.01,198.56,197.87,198.215,198.2,197.23,197.11,0.75,0.57,0.08,198.38\n07/23/2014 12:00:00 AM,198.49,198.85,198.1,198.475,198.64,197.47,197.25,0.71,0.26,0.09,198.5\n07/24/2014 12:00:00 AM,198.83,199.06,198.45,198.755,198.65,197.75,197.48,0.69,0.12,0.09,198.63\n07/25/2014 12:00:00 AM,198.09,198.26,197.33,197.795,197.72,197.87,197.71,-0.11,-0.55,0.06,197.56\n07/28/2014 12:00:00 AM,197.76,198.09,196.62,197.355,197.8,197.84,197.83,-0.36,-0.47,0.04,197.08\n07/29/2014 12:00:00 AM,198.17,198.45,196.92,197.685,196.95,197.8,197.84,-0.05,-0.01,0.05,197.41\n07/30/2014 12:00:00 AM,197.65,197.91,196.16,197.035,196.98,197.68,197.78,-0.45,-0.3,0.02,196.79\n07/31/2014 12:00:00 AM,195.61,195.78,192.97,194.375,193.09,197.15,197.58,-2.02,-1.32,-0.06,194.28\n08/01/2014 12:00:00 AM,192.57,193.76,191.57,192.665,192.5,196.29,197.07,-2.56,-1.07,-0.11,192.86\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.175,193.89,195.51,196.31,-1.53,0.24,-0.08,193.66\n08/05/2014 12:00:00 AM,193.1,193.6,191.31,192.455,192.01,194.76,195.52,-1.57,0.12,-0.1,193.17\n08/06/2014 12:00:00 AM,191.1,192.89,191.08,191.985,192.07,194.07,194.78,-1.44,0.18,-0.11,192.88\n08/07/2014 12:00:00 AM,192.93,193.13,190.55,191.84,191.03,193.48,194.1,-1.14,0.33,-0.11,192.84\n08/08/2014 12:00:00 AM,191.46,193.37,190.95,192.16,193.24,193.07,193.53,-0.62,0.56,-0.09,193.16\n08/11/2014 12:00:00 AM,193.96,194.66,193.71,194.185,193.79,193.07,193.17,0.84,1.38,-0.03,195.02\n08/12/2014 12:00:00 AM,193.61,194.15,192.94,193.545,193.53,193.14,193.09,0.2,0.22,-0.04,194.11\n08/13/2014 12:00:00 AM,194.29,195.06,193.96,194.51,194.84,193.37,193.18,0.76,0.51,-0.01,194.75\n08/14/2014 12:00:00 AM,195.16,195.76,194.98,195.37,195.76,193.75,193.41,1.1,0.5,0.02,195.22\n08/15/2014 12:00:00 AM,196.47,196.65,194.31,195.48,195.72,194.14,193.75,0.87,0.06,0.02,194.96\n08/18/2014 12:00:00 AM,196.8,197.45,196.69,197.07,197.36,194.72,194.19,1.64,0.59,0.07,196.19\n08/19/2014 12:00:00 AM,197.84,198.54,197.44,197.99,198.39,195.42,194.75,1.78,0.39,0.09,196.79\n08/20/2014 12:00:00 AM,198.12,199.16,198.08,198.62,198.92,196.16,195.43,1.69,0.12,0.11,197.18\n08/21/2014 12:00:00 AM,199.09,199.76,198.93,199.345,199.5,196.9,196.16,1.69,0.04,0.12,197.77\n08/22/2014 12:00:00 AM,199.34,199.69,198.74,199.215,199.19,197.52,196.87,1.15,-0.4,0.11,197.65\n08/25/2014 12:00:00 AM,200.14,200.59,199.86,200.225,200.2,198.16,197.53,1.48,0.03,0.13,198.79\n08/26/2014 12:00:00 AM,200.33,200.82,200.28,200.55,200.33,198.75,198.15,1.28,-0.13,0.14,199.34\n08/27/2014 12:00:00 AM,200.43,200.57,199.94,200.255,200.25,199.19,198.71,0.74,-0.47,0.12,199.36\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,199.83,200.14,199.46,199.15,0.27,-0.6,0.1,199.34\n08/29/2014 12:00:00 AM,200.45,200.73,199.82,200.275,200.71,199.68,199.45,0.48,-0.14,0.1,200.21\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.425,200.61,199.87,199.67,0.44,-0.09,0.11,200.75\n09/03/2014 12:00:00 AM,201.38,201.41,200.22,200.815,200.5,200.08,199.87,0.57,0.06,0.11,201.46\n09/04/2014 12:00:00 AM,200.84,201.58,199.66,200.62,200.21,200.24,200.07,0.29,-0.17,0.1,201.5\n09/05/2014 12:00:00 AM,200.17,201.19,199.41,200.3,201.11,200.31,200.22,0.01,-0.29,0.08,201.33\n09/08/2014 12:00:00 AM,200.92,201.21,200,200.605,200.59,200.38,200.31,0.2,0,0.09,201.67\n09/09/2014 12:00:00 AM,200.41,200.55,198.91,199.73,199.32,200.31,200.35,-0.41,-0.45,0.05,200.76\n09/10/2014 12:00:00 AM,199.44,200.2,198.77,199.485,200.07,200.16,200.29,-0.46,-0.26,0.05,200.41\n09/11/2014 12:00:00 AM,199.27,200.33,199.12,199.725,200.3,200.04,200.17,-0.18,0.09,0.05,200.46\n09/12/2014 12:00:00 AM,200.1,200.12,198.56,199.34,199.13,199.9,200.04,-0.37,-0.09,0.04,199.84\n09/15/2014 12:00:00 AM,199.16,199.32,198.38,198.85,198.98,199.69,199.88,-0.58,-0.2,0.02,199.1\n09/16/2014 12:00:00 AM,198.61,200.84,198.5,199.67,200.48,199.6,199.72,0.1,0.42,0.04,199.66\n09/17/2014 12:00:00 AM,200.77,201.68,199.75,200.715,200.75,199.73,199.66,0.74,0.7,0.07,200.4\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.475,201.82,200.04,199.78,1.02,0.57,0.09,200.85\n09/19/2014 12:00:00 AM,201.52,201.9,200.29,201.095,200.7,200.31,200.03,0.5,-0.11,0.07,200.23\n09/22/2014 12:00:00 AM,200.35,200.38,198.73,199.555,199.15,200.3,200.24,-0.62,-0.91,0.02,198.6\n09/23/2014 12:00:00 AM,198.43,199.26,197.95,198.605,198.01,200.05,200.24,-1.05,-0.8,-0.01,197.73\n09/24/2014 12:00:00 AM,198.04,199.69,197.52,198.605,199.56,199.74,200.04,-0.77,-0.18,-0.01,197.92\n09/25/2014 12:00:00 AM,199.04,199.05,196.27,197.66,196.34,199.32,199.72,-1.16,-0.38,-0.04,197.25\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.405,197.9,198.88,199.32,-1,-0.06,-0.04,197.33\n09/29/2014 12:00:00 AM,196.2,197.89,196.05,196.97,197.54,198.43,198.88,-1.01,-0.02,-0.05,197.23\n09/30/2014 12:00:00 AM,197.69,198.3,196.61,197.455,197.02,198.12,198.47,-0.42,0.44,-0.03,198.01\n10/01/2014 12:00:00 AM,196.7,196.77,193.91,195.34,194.35,197.59,198.07,-1.65,-0.69,-0.1,196.17\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,193.7,194.38,196.82,197.53,-2.25,-0.8,-0.14,194.82\n10/03/2014 12:00:00 AM,195.68,196.94,195.08,196.01,196.52,196.41,196.91,-0.16,1.17,-0.06,197.27\n10/06/2014 12:00:00 AM,197.34,197.6,195.58,196.59,196.29,196.28,196.48,0.25,0.92,-0.04,197.78\n10/07/2014 12:00:00 AM,195.28,195.72,193.22,194.47,193.26,195.97,196.23,-1.17,-0.6,-0.1,195.53\n10/08/2014 12:00:00 AM,193.37,196.92,192.36,194.64,196.64,195.65,195.97,-0.74,0,-0.09,195.54\n10/09/2014 12:00:00 AM,196.33,196.6,192.58,194.59,192.74,195.38,195.66,-0.57,0.13,-0.09,195.24\n10/10/2014 12:00:00 AM,192.69,193.65,190.49,192.07,190.54,194.79,195.3,-2.02,-1.02,-0.16,192.51\n10/13/2014 12:00:00 AM,190.46,191.15,187.3,189.225,187.41,193.75,194.68,-3.28,-1.47,-0.24,189.59\n10/14/2014 12:00:00 AM,188.42,189.82,187.04,188.43,187.7,192.58,193.72,-2.89,-0.44,-0.25,188.79\n10/15/2014 12:00:00 AM,185.16,187.69,181.92,184.805,186.43,191,192.48,-4.41,-1.34,-0.34,185.27\n10/16/2014 12:00:00 AM,183.06,187.58,182.89,185.235,186.27,189.55,191.03,-2.93,0.45,-0.31,185.85\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.685,188.47,188.87,189.74,0.07,2.51,-0.19,189.27\n10/20/2014 12:00:00 AM,188.13,190.45,188.07,189.26,190.3,188.67,188.99,0.42,1.56,-0.16,189.63\n10/21/2014 12:00:00 AM,191.68,194.2,191.48,192.84,194.07,189.2,188.85,2.58,2.4,-0.04,192.85\n10/22/2014 12:00:00 AM,194.41,194.91,192.61,193.76,192.69,190.07,189.29,2.46,1.1,-0.01,193.29\n10/23/2014 12:00:00 AM,194.62,196.2,194.26,195.23,194.93,191.16,190.12,2.72,0.71,0.04,194.29\n10/24/2014 12:00:00 AM,195.25,196.49,194.49,195.49,196.43,192.2,191.15,2.15,-0.12,0.04,194.14\n10/27/2014 12:00:00 AM,195.73,196.45,195.03,195.74,196.16,193.12,192.17,1.72,-0.43,0.05,194.11\n10/28/2014 12:00:00 AM,196.82,198.42,196.73,197.575,198.41,194.12,193.14,2.42,0.28,0.1,195.78\n10/29/2014 12:00:00 AM,198.55,199.12,196.8,197.96,198.11,195.06,194.11,2,-0.19,0.11,196.12\n10/30/2014 12:00:00 AM,197.58,199.95,197.4,198.675,199.38,195.95,195.05,1.91,-0.18,0.12,196.92\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.295,201.66,197.07,196.01,3.06,0.76,0.19,199.7\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.875,201.77,198.2,197.07,2.59,0.03,0.2,200.47\n11/04/2014 12:00:00 AM,201.23,201.6,200.06,200.83,201.07,199.01,198.12,1.22,-1.03,0.16,199.76\n11/05/2014 12:00:00 AM,202.54,202.59,201.45,202.02,202.34,199.76,199,1.64,-0.21,0.19,201.36\n11/06/2014 12:00:00 AM,202.39,203.26,201.64,202.45,203.15,200.44,199.75,1.47,-0.23,0.18,202.18\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.105,203.34,201.09,200.44,1.48,-0.1,0.2,203.2\n11/10/2014 12:00:00 AM,203.38,204.04,203.13,203.585,203.98,201.7,201.08,1.38,-0.12,0.2,203.98\n11/11/2014 12:00:00 AM,204.05,204.31,203.65,203.98,204.18,202.27,201.69,1.26,-0.15,0.2,204.6\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.775,203.96,202.7,202.24,0.78,-0.43,0.18,204.53\n11/13/2014 12:00:00 AM,204.16,204.83,203.21,204.02,204.19,203.06,202.69,0.72,-0.25,0.18,204.83\n11/14/2014 12:00:00 AM,204.1,204.49,203.72,204.105,204.24,203.35,203.05,0.58,-0.23,0.17,204.88\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.115,204.37,203.57,203.34,0.43,-0.22,0.16,204.79\n11/18/2014 12:00:00 AM,204.44,205.92,204.44,205.18,205.55,203.89,203.6,0.99,0.32,0.18,205.65\n11/19/2014 12:00:00 AM,205.31,205.55,204.3,204.925,205.22,204.17,203.88,0.56,-0.15,0.16,205.14\n11/20/2014 12:00:00 AM,204.27,205.71,204.18,204.945,205.58,204.38,204.15,0.42,-0.18,0.15,204.91\n11/21/2014 12:00:00 AM,207.63,207.84,205.98,206.91,206.68,204.84,204.44,1.55,0.77,0.21,206.58\n11/24/2014 12:00:00 AM,207.17,207.39,206.91,207.15,207.26,205.35,204.85,1.28,0.19,0.2,206.51\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.295,207.11,205.83,205.34,1.02,-0.1,0.19,206.41\n11/26/2014 12:00:00 AM,207.29,207.76,207.03,207.395,207.64,206.24,205.81,0.81,-0.22,0.18,206.35\n11/28/2014 12:00:00 AM,207.48,207.87,206.91,207.39,207.2,206.56,206.22,0.58,-0.28,0.17,206.3\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.96,205.76,206.6,206.49,-0.49,-0.95,0.12,204.97\n12/02/2014 12:00:00 AM,205.81,207.34,205.78,206.56,207.09,206.61,206.59,0.03,-0.09,0.13,205.79\n12/03/2014 12:00:00 AM,207.3,208.15,207.1,207.625,207.89,206.76,206.64,0.7,0.47,0.15,207.08\n12/04/2014 12:00:00 AM,207.54,208.26,206.7,207.48,207.66,206.92,206.76,0.42,0.04,0.14,207.17\n12/05/2014 12:00:00 AM,207.87,208.47,207.55,208.01,208,207.14,206.94,0.64,0.19,0.15,207.94\n12/08/2014 12:00:00 AM,207.54,208.12,205.93,207.025,206.61,207.21,207.11,-0.16,-0.5,0.11,207.19\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,205.255,206.47,206.95,207.13,-1.25,-1.07,0.05,205.72\n12/10/2014 12:00:00 AM,205.91,205.98,202.93,204.455,203.16,206.49,206.9,-1.41,-0.67,0.02,205.24\n12/11/2014 12:00:00 AM,203.88,206.19,203.71,204.95,204.19,206.09,206.5,-0.71,0.2,0.04,205.96\n12/12/2014 12:00:00 AM,202.64,203.82,200.85,202.335,200.89,205.38,206.01,-2.18,-0.98,-0.04,203.53\n12/15/2014 12:00:00 AM,201.98,202.53,198.78,200.655,199.51,204.43,205.32,-2.66,-0.84,-0.1,202.04\n12/16/2014 12:00:00 AM,198.58,202.4,197.86,200.13,197.91,203.43,204.42,-2.26,-0.11,-0.1,201.63\n12/17/2014 12:00:00 AM,198.44,202.34,198.29,200.315,201.79,202.6,203.47,-1.53,0.52,-0.09,201.79\n12/18/2014 12:00:00 AM,204.74,212.97,203.92,208.445,206.78,203.13,202.94,4.07,4.48,0.16,209.5\n12/19/2014 12:00:00 AM,206.43,207.33,205.61,206.47,206.52,203.83,203.17,1.7,0.51,0.09,206.85\n12/22/2014 12:00:00 AM,206.75,207.47,206.46,206.965,207.47,204.55,203.83,1.55,0.1,0.1,206.72\n12/23/2014 12:00:00 AM,208.17,208.23,207.4,207.815,207.75,205.3,204.56,1.67,0.1,0.12,206.96\n12/24/2014 12:00:00 AM,208.02,208.34,207.72,208.03,207.77,205.99,205.28,1.35,-0.22,0.12,206.65\n12/26/2014 12:00:00 AM,208.31,208.85,208.25,208.55,208.44,206.62,205.97,1.31,-0.16,0.13,206.79\n12/29/2014 12:00:00 AM,208.22,208.97,208.14,208.555,208.72,207.15,206.6,0.96,-0.36,0.12,206.59\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.94,207.6,207.46,207.1,0.3,-0.68,0.09,205.98\n12/31/2014 12:00:00 AM,207.99,208.19,205.39,206.79,205.54,207.49,207.39,-0.51,-0.96,0.06,205.08\n01/02/2015 12:00:00 AM,206.38,206.88,204.18,205.53,205.43,207.21,207.41,-1.17,-0.98,0.01,204.29\n01/05/2015 12:00:00 AM,204.17,204.37,201.35,202.86,201.72,206.47,207.09,-2.55,-1.52,-0.07,202.3\n01/06/2015 12:00:00 AM,202.11,202.72,198.85,200.785,199.82,205.36,206.38,-3.18,-1.22,-0.13,201.06\n01/07/2015 12:00:00 AM,201.42,202.72,200.88,201.8,202.31,204.41,205.4,-1.66,0.55,-0.09,202.86\n01/08/2015 12:00:00 AM,204.01,206.16,203.99,205.075,205.9,204.15,204.58,0.88,2.23,0.01,206.65\n01/09/2015 12:00:00 AM,206.4,206.42,203.51,204.965,204.25,204.17,204.22,0.57,0.92,0.01,206.77\n01/12/2015 12:00:00 AM,204.41,204.6,201.92,203.26,202.65,204.04,204.13,-0.67,-0.47,-0.04,205.17\n01/13/2015 12:00:00 AM,204.12,205.48,200.51,202.995,202.08,203.84,204.02,-0.66,-0.25,-0.05,204.88\n01/14/2015 12:00:00 AM,199.65,201.1,198.57,199.835,200.86,203.18,203.73,-2.49,-1.51,-0.14,201.62\n01/15/2015 12:00:00 AM,201.63,202.01,198.88,200.445,199.02,202.53,203.18,-1.42,0.03,-0.11,202.05\n01/16/2015 12:00:00 AM,198.77,201.82,198.55,200.185,201.63,201.94,202.54,-1.2,0.2,-0.12,201.45\n01/20/2015 12:00:00 AM,202.4,202.72,200.17,201.445,202.05,201.64,202.01,-0.07,0.96,-0.07,202.25\n01/21/2015 12:00:00 AM,201.48,203.66,200.94,202.3,203.08,201.62,201.71,0.5,0.92,-0.04,202.52\n01/22/2015 12:00:00 AM,203.99,206.26,202.33,204.295,206.1,202.01,201.72,1.63,1.31,0.02,203.87\n01/23/2015 12:00:00 AM,205.79,206.1,204.81,205.455,204.97,202.66,202.07,1.92,0.87,0.06,204.36\n01/26/2015 12:00:00 AM,204.72,205.56,203.85,204.705,205.45,203.2,202.63,0.92,-0.34,0.03,203.08\n01/27/2015 12:00:00 AM,202.97,204.12,201.74,202.93,202.74,203.37,203.11,-0.46,-1.24,-0.03,201.03\n01/28/2015 12:00:00 AM,204.17,204.29,199.91,202.1,200.14,203.25,203.3,-0.86,-0.95,-0.05,200.21\n01/29/2015 12:00:00 AM,200.38,202.3,198.68,200.49,201.99,202.8,203.17,-1.65,-1.07,-0.1,198.86\n01/30/2015 12:00:00 AM,200.57,202.17,199.13,200.65,199.45,202.32,202.79,-1.1,-0.12,-0.08,199.46\n02/02/2015 12:00:00 AM,200.05,202.03,197.86,199.945,201.92,201.78,202.3,-1.25,-0.15,-0.1,199.3\n02/03/2015 12:00:00 AM,203,204.85,202.55,203.7,204.84,201.86,201.94,1.48,1.99,0.02,203.53\n02/04/2015 12:00:00 AM,203.92,205.38,203.51,204.445,204.06,202.27,201.94,1.55,1.08,0.04,204.61\n02/05/2015 12:00:00 AM,204.86,206.3,204.77,205.535,206.12,202.9,202.32,1.82,0.74,0.07,205.94\n02/06/2015 12:00:00 AM,206.56,207.24,204.92,206.08,205.55,203.61,202.92,1.67,0.24,0.08,206.62\n02/09/2015 12:00:00 AM,204.76,205.64,204.13,204.885,204.63,204.06,203.54,0.45,-0.82,0.04,205.52\n02/10/2015 12:00:00 AM,205.87,207.12,204.68,205.9,206.81,204.5,204.06,0.98,-0.04,0.07,206.57\n02/11/2015 12:00:00 AM,206.61,207.45,205.83,206.64,206.93,204.99,204.51,1.18,0.12,0.09,207.23\n02/12/2015 12:00:00 AM,207.89,208.99,206.97,207.98,208.92,205.61,205.02,1.71,0.46,0.12,208.37\n02/13/2015 12:00:00 AM,209.07,209.84,208.76,209.3,209.78,206.38,205.65,2.08,0.51,0.16,209.39\n02/17/2015 12:00:00 AM,209.4,210.32,209.1,209.71,210.11,207.17,206.38,1.77,0.02,0.16,209.45\n02/18/2015 12:00:00 AM,209.66,210.22,209.34,209.78,210.13,207.85,207.14,1.33,-0.33,0.15,209.21\n02/19/2015 12:00:00 AM,209.41,210.42,209.24,209.83,209.98,208.4,207.81,1,-0.43,0.15,209.01\n02/20/2015 12:00:00 AM,209.48,211.33,208.73,210.03,211.24,208.84,208.37,0.85,-0.33,0.14,209.05\n02/23/2015 12:00:00 AM,210.94,211.21,210.48,210.845,211.21,209.31,208.85,1.14,0.05,0.16,209.78\n02/24/2015 12:00:00 AM,211.12,212.05,210.76,211.405,211.81,209.79,209.31,1.18,0.06,0.17,210.31\n02/25/2015 12:00:00 AM,211.66,212.24,211.22,211.73,211.63,210.26,209.79,1.07,-0.05,0.17,210.69\n02/26/2015 12:00:00 AM,211.52,211.71,210.65,211.18,211.38,210.57,210.22,0.43,-0.51,0.14,210.3\n02/27/2015 12:00:00 AM,211.26,211.58,210.6,211.09,210.66,210.77,210.54,0.25,-0.39,0.13,210.46\n03/02/2015 12:00:00 AM,210.78,212.06,210.72,211.39,211.99,210.93,210.76,0.37,-0.1,0.13,211.05\n03/03/2015 12:00:00 AM,211.47,211.59,210.08,210.835,211.12,210.98,210.9,-0.08,-0.38,0.11,210.8\n03/04/2015 12:00:00 AM,210.4,210.49,209.06,209.775,210.23,210.82,210.93,-0.73,-0.68,0.07,210.09\n03/05/2015 12:00:00 AM,210.61,210.8,209.85,210.325,210.46,210.69,210.83,-0.18,0.08,0.08,210.95\n03/06/2015 12:00:00 AM,209.42,209.94,207.1,208.52,207.5,210.32,210.63,-1.28,-0.77,0.02,209.41\n03/09/2015 12:00:00 AM,207.74,208.79,207.55,208.17,208.36,209.87,210.3,-1.15,-0.28,0.01,209.29\n03/10/2015 12:00:00 AM,206.71,206.81,204.93,205.87,204.98,209.11,209.79,-2.3,-0.99,-0.06,207.19\n03/11/2015 12:00:00 AM,205.29,205.5,204.4,204.95,204.5,208.21,209.08,-2.26,-0.46,-0.09,206.42\n03/12/2015 12:00:00 AM,205.26,207.18,205.2,206.19,207.1,207.58,208.28,-0.85,0.85,-0.04,207.66\n03/13/2015 12:00:00 AM,206.77,206.93,204.58,205.755,205.83,207.07,207.61,-0.9,0.42,-0.05,207.06\n03/16/2015 12:00:00 AM,206.71,208.69,206.68,207.685,208.58,206.96,207.17,0.58,1.33,0.01,208.66\n03/17/2015 12:00:00 AM,207.69,208.42,206.98,207.7,207.96,207.03,207.01,0.43,0.56,0.01,208.22\n03/18/2015 12:00:00 AM,207.39,211.27,206.62,208.945,210.46,207.34,207.09,1.1,0.78,0.05,208.94\n03/19/2015 12:00:00 AM,209.96,210.47,209.03,209.75,209.5,207.81,207.38,1.32,0.54,0.07,209.2\n03/20/2015 12:00:00 AM,209.71,211.02,209.49,210.255,210.41,208.34,207.82,1.28,0.22,0.08,209.2\n03/23/2015 12:00:00 AM,210.42,211.11,210,210.555,210,208.87,208.34,1.12,-0.03,0.08,209.1\n03/24/2015 12:00:00 AM,209.85,210.4,208.74,209.57,208.82,209.17,208.81,0.19,-0.73,0.05,207.91\n03/25/2015 12:00:00 AM,209.07,209.35,205.71,207.53,205.76,209.05,209.07,-1.16,-1.4,-0.02,205.92\n03/26/2015 12:00:00 AM,204.96,206.37,204.12,205.245,205.27,208.45,208.93,-2.3,-1.57,-0.08,203.96\n03/27/2015 12:00:00 AM,205.13,205.95,204.9,205.425,205.74,207.78,208.43,-1.56,-0.22,-0.08,204.64\n03/30/2015 12:00:00 AM,206.98,208.61,206.96,207.785,208.25,207.52,207.88,0.37,1.36,0,207.46\n03/31/2015 12:00:00 AM,207.26,208.1,206.36,207.23,206.43,207.38,207.55,-0.08,0.38,-0.02,207.32\n04/01/2015 12:00:00 AM,206.39,206.42,204.51,205.465,205.7,207.05,207.33,-1.18,-0.63,-0.07,206\n04/02/2015 12:00:00 AM,205.62,206.98,205.4,206.19,206.43,206.8,207.07,-0.4,0.26,-0.04,207.13\n04/06/2015 12:00:00 AM,205.37,208.45,205.21,206.83,207.83,206.7,206.84,0.12,0.53,-0.02,208.02\n04/07/2015 12:00:00 AM,207.85,208.76,207.24,208,207.28,206.86,206.77,0.83,0.8,0.02,209.25\n04/08/2015 12:00:00 AM,207.55,208.51,207.08,207.795,207.98,207.05,206.87,0.47,0.14,0.01,208.96\n04/09/2015 12:00:00 AM,207.78,209.18,207.19,208.185,208.9,207.29,207.07,0.59,0.14,0.02,209.15\n04/10/2015 12:00:00 AM,209.2,210.09,208.96,209.525,210.04,207.71,207.34,1.28,0.58,0.06,210.16\n04/13/2015 12:00:00 AM,209.87,210.63,209.03,209.83,209.09,208.18,207.72,1.13,0.17,0.07,210.04\n04/14/2015 12:00:00 AM,208.85,209.71,208.1,208.905,209.49,208.46,208.13,0.23,-0.6,0.03,208.72\n04/15/2015 12:00:00 AM,210.05,211.04,209.95,210.495,210.43,208.87,208.5,1.18,0.39,0.08,209.94\n04/16/2015 12:00:00 AM,210.03,210.98,209.79,210.385,210.37,209.25,208.86,0.79,-0.1,0.07,209.48\n04/17/2015 12:00:00 AM,208.94,209.23,207.01,208.12,207.95,209.23,209.15,-0.87,-1.3,0,207.05\n04/20/2015 12:00:00 AM,209.06,210.25,208.96,209.605,209.85,209.27,209.24,0.31,0.22,0.04,208.51\n04/21/2015 12:00:00 AM,210.67,210.86,209.24,210.05,209.6,209.4,209.29,0.51,0.28,0.05,208.97\n04/22/2015 12:00:00 AM,210.01,210.85,208.9,209.875,210.63,209.52,209.4,0.26,-0.04,0.05,208.91\n04/23/2015 12:00:00 AM,210.15,211.94,210.01,210.975,211.16,209.78,209.56,0.89,0.45,0.08,210.17\n04/24/2015 12:00:00 AM,211.66,211.97,211.11,211.54,211.65,210.14,209.81,1.01,0.32,0.09,210.92\n04/27/2015 12:00:00 AM,212.33,212.48,210.54,211.51,210.77,210.47,210.13,0.71,-0.06,0.08,211.1\n04/28/2015 12:00:00 AM,210.74,211.5,209.33,210.415,211.44,210.59,210.42,-0.18,-0.71,0.05,210.28\n04/29/2015 12:00:00 AM,210.37,211.29,209.6,210.445,210.57,210.62,210.57,-0.11,-0.31,0.04,210.62\n04/30/2015 12:00:00 AM,209.88,210.35,207.62,208.985,208.46,210.39,210.55,-1.01,-0.83,0,209.47\n05/01/2015 12:00:00 AM,209.4,210.77,209.28,210.025,210.72,210.25,210.41,-0.07,0.29,0.03,210.77\n05/04/2015 12:00:00 AM,211.23,212.02,211.1,211.56,211.32,210.39,210.32,0.92,0.91,0.07,212.4\n05/05/2015 12:00:00 AM,211.03,211.46,208.73,210.095,208.9,210.4,210.35,-0.26,-0.42,0.02,210.94\n05/06/2015 12:00:00 AM,209.56,209.93,206.76,208.345,208.04,210.1,210.32,-1.3,-1,-0.03,209.21\n05/07/2015 12:00:00 AM,207.92,209.38,207.52,208.45,208.87,209.75,210.09,-0.88,-0.19,-0.03,209.31\n05/08/2015 12:00:00 AM,210.88,211.86,210.78,211.32,211.62,209.84,209.86,1.19,1.47,0.06,212\n05/11/2015 12:00:00 AM,211.57,211.89,210.52,211.205,210.6,210.08,209.88,0.79,0.46,0.06,211.57\n05/12/2015 12:00:00 AM,209.61,210.63,208.62,209.625,209.98,210.1,210.02,-0.43,-0.69,0.01,209.7\n05/13/2015 12:00:00 AM,210.47,211.22,209.74,210.48,210.02,210.16,210.11,0.23,0.13,0.03,210.31\n05/14/2015 12:00:00 AM,211.24,212.32,210.91,211.615,212.21,210.4,210.21,0.89,0.56,0.06,211.17\n05/15/2015 12:00:00 AM,212.44,212.61,211.86,212.235,212.44,210.76,210.43,1.04,0.4,0.08,211.51\n05/18/2015 12:00:00 AM,212.24,213.4,212.16,212.78,213.1,211.19,210.78,1.1,0.24,0.09,211.84\n05/19/2015 12:00:00 AM,213.24,213.57,212.69,213.13,213.03,211.64,211.2,1.02,0.05,0.1,212.04\n05/20/2015 12:00:00 AM,213.15,213.78,212.5,213.14,212.88,212.03,211.62,0.75,-0.19,0.09,212\n05/21/2015 12:00:00 AM,212.71,213.75,212.51,213.13,213.5,212.34,212.01,0.54,-0.26,0.08,212.06\n05/22/2015 12:00:00 AM,213.04,213.54,212.91,213.225,212.99,212.59,212.32,0.45,-0.2,0.08,212.31\n05/26/2015 12:00:00 AM,212.4,212.5,210.2,211.35,210.7,212.5,212.5,-0.87,-1.09,0.02,210.73\n05/27/2015 12:00:00 AM,211.25,212.98,210.76,211.87,212.7,212.38,212.49,-0.3,-0.13,0.04,211.62\n05/28/2015 12:00:00 AM,212.33,212.59,211.63,212.11,212.46,212.29,212.39,-0.06,0.13,0.04,212.21\n05/29/2015 12:00:00 AM,212.38,212.43,210.82,211.625,211.14,212.16,212.28,-0.35,-0.14,0.02,212.06\n06/01/2015 12:00:00 AM,211.94,212.34,210.62,211.48,211.57,212.01,212.15,-0.35,-0.06,0.02,212.2\n06/02/2015 12:00:00 AM,211.02,212.19,210.27,211.23,211.36,211.84,212,-0.41,-0.07,0.01,212.16\n06/03/2015 12:00:00 AM,212,212.67,211.33,212,211.92,211.8,211.87,0.19,0.42,0.03,213.02\n06/04/2015 12:00:00 AM,211.07,211.86,209.75,210.805,210.13,211.64,211.77,-0.62,-0.39,-0.01,211.83\n06/05/2015 12:00:00 AM,209.95,210.58,208.98,209.78,209.77,211.3,211.59,-1.11,-0.56,-0.04,210.78\n06/08/2015 12:00:00 AM,209.64,209.82,208.39,209.105,208.48,210.86,211.28,-1.23,-0.38,-0.06,210.04\n06/09/2015 12:00:00 AM,208.45,209.1,207.69,208.395,208.45,210.33,210.84,-1.35,-0.27,-0.07,209.22\n06/10/2015 12:00:00 AM,209.37,211.41,209.3,210.355,210.95,210.13,210.41,0.27,1.09,-0.01,210.96\n06/11/2015 12:00:00 AM,211.48,212.09,211.2,211.645,211.63,210.27,210.21,1.02,1.13,0.03,211.89\n06/12/2015 12:00:00 AM,210.64,210.84,209.68,210.26,210.01,210.33,210.25,-0.14,-0.3,-0.01,210.14\n06/15/2015 12:00:00 AM,208.64,209.45,207.79,208.62,209.11,210.1,210.26,-1.15,-0.92,-0.06,208.27\n06/16/2015 12:00:00 AM,208.93,210.35,208.72,209.535,210.25,209.93,210.11,-0.25,0.19,-0.03,209.02\n06/17/2015 12:00:00 AM,210.59,211.32,209.36,210.34,210.59,209.92,209.97,0.33,0.54,-0.01,209.66\n06/18/2015 12:00:00 AM,211.31,213.34,211.17,212.255,212.78,210.26,210.01,1.46,1.12,0.05,211.41\n06/19/2015 12:00:00 AM,211.46,211.55,210.36,210.955,210.81,210.49,210.24,0.23,-0.35,0.01,210.01\n06/22/2015 12:00:00 AM,211.9,212.59,211.64,212.115,211.89,210.82,210.52,0.91,0.31,0.05,211.18\n06/23/2015 12:00:00 AM,212.14,212.44,211.57,212.005,212.04,211.12,210.81,0.59,-0.09,0.04,211.13\n06/24/2015 12:00:00 AM,211.72,212.17,210.47,211.32,210.5,211.26,211.08,-0.01,-0.5,0.02,210.61\n06/25/2015 12:00:00 AM,211.1,211.25,209.77,210.51,209.86,211.2,211.21,-0.52,-0.65,-0.01,210.06\n06/26/2015 12:00:00 AM,210.29,210.58,209.16,209.87,209.82,210.99,211.16,-0.79,-0.53,-0.03,209.76\n06/29/2015 12:00:00 AM,208.04,208.82,205.33,207.075,205.42,210.33,210.88,-2.35,-1.43,-0.11,207.4\n06/30/2015 12:00:00 AM,207.26,207.32,205.28,206.3,205.85,209.5,210.29,-2.2,-0.6,-0.13,207.11\n07/01/2015 12:00:00 AM,207.73,208.03,206.56,207.295,207.5,208.85,209.54,-0.97,0.64,-0.09,208.47\n07/02/2015 12:00:00 AM,208.07,208.27,206.81,207.54,207.31,208.42,208.91,-0.55,0.67,-0.08,208.92\n07/06/2015 12:00:00 AM,205.77,207.65,205.53,206.59,206.72,207.98,208.42,-1,0.01,-0.1,208.04\n07/07/2015 12:00:00 AM,206.96,208.17,204.11,206.14,208.02,207.55,207.98,-1.01,0,-0.11,207.57\n07/08/2015 12:00:00 AM,206.42,206.76,204.25,205.505,204.53,207.08,207.54,-1.14,-0.1,-0.12,206.81\n07/09/2015 12:00:00 AM,207.04,207.35,204.77,206.06,204.9,206.76,207.12,-0.48,0.45,-0.1,207.13\n07/10/2015 12:00:00 AM,207.29,207.98,206.49,207.235,207.48,206.7,206.83,0.4,0.89,-0.06,207.93\n07/13/2015 12:00:00 AM,208.99,209.9,208.94,209.42,209.77,207.08,206.81,1.68,1.41,0.01,209.59\n07/14/2015 12:00:00 AM,209.72,211.05,209.65,210.35,210.68,207.7,207.14,1.82,0.8,0.04,209.92\n07/15/2015 12:00:00 AM,210.73,211.28,210.04,210.66,210.61,208.37,207.71,1.52,0.16,0.05,209.66\n07/16/2015 12:00:00 AM,211.87,212.3,211.58,211.94,212.3,209.15,208.4,1.92,0.35,0.08,210.46\n07/17/2015 12:00:00 AM,212.29,212.55,211.8,212.175,212.48,209.89,209.14,1.54,-0.12,0.09,210.34\n07/20/2015 12:00:00 AM,212.75,213.18,212.21,212.695,212.59,210.58,209.87,1.45,-0.15,0.1,210.67\n07/21/2015 12:00:00 AM,212.43,212.74,211.39,212.065,211.75,211.06,210.52,0.65,-0.69,0.07,210.07\n07/22/2015 12:00:00 AM,210.93,211.77,210.89,211.33,211.37,211.28,210.99,0.01,-0.84,0.04,209.58\n07/23/2015 12:00:00 AM,211.53,211.65,209.75,210.7,210.18,211.28,211.23,-0.4,-0.73,0.02,209.39\n07/24/2015 12:00:00 AM,210.3,210.37,207.6,208.985,208,210.95,211.2,-1.38,-1.1,-0.03,208.29\n07/27/2015 12:00:00 AM,206.94,207.55,206.26,206.905,206.79,210.23,210.85,-2.33,-1.25,-0.09,206.97\n07/28/2015 12:00:00 AM,207.79,209.5,206.8,208.15,209.33,209.65,210.26,-0.9,0.46,-0.05,208.94\n07/29/2015 12:00:00 AM,209.48,211.04,209.31,210.175,210.77,209.51,209.76,0.64,1.42,0.02,211.48\n07/30/2015 12:00:00 AM,210.16,211.02,209.42,210.22,210.82,209.56,209.56,0.49,0.63,0.02,211.81\n07/31/2015 12:00:00 AM,211.42,211.45,210.16,210.805,210.5,209.76,209.59,0.73,0.5,0.03,212.5\n08/03/2015 12:00:00 AM,210.46,210.53,208.65,209.59,209.79,209.81,209.72,-0.24,-0.49,-0.01,211.24\n08/04/2015 12:00:00 AM,209.7,210.25,208.8,209.525,209.38,209.79,209.79,-0.22,-0.24,-0.01,211.02\n08/05/2015 12:00:00 AM,210.45,211.31,209.73,210.52,210.07,209.89,209.82,0.47,0.39,0.02,211.69\n08/06/2015 12:00:00 AM,210.29,210.41,207.65,209.03,208.35,209.8,209.84,-0.6,-0.61,-0.02,209.81\n08/07/2015 12:00:00 AM,208.16,208.34,206.87,207.605,207.95,209.45,209.73,-1.35,-0.87,-0.07,208.03\n08/10/2015 12:00:00 AM,209.28,210.67,209.28,209.975,210.57,209.39,209.52,0.53,0.97,0.01,209.99\n08/11/2015 12:00:00 AM,208.97,209.47,207.76,208.615,208.67,209.25,209.37,-0.48,-0.25,-0.03,208.22\n08/12/2015 12:00:00 AM,207.11,209.14,205.36,207.25,208.92,208.91,209.2,-1.22,-0.68,-0.07,206.59\n08/13/2015 12:00:00 AM,208.73,209.55,208.01,208.78,208.66,208.76,208.96,0.09,0.63,-0.02,207.92\n08/14/2015 12:00:00 AM,208.43,209.51,208.26,208.885,209.42,208.72,208.79,0.13,0.36,-0.02,207.88\n08/17/2015 12:00:00 AM,208.71,210.59,208.16,209.375,210.59,208.8,208.75,0.41,0.39,0,208.31\n08/18/2015 12:00:00 AM,210.26,210.68,209.7,210.19,209.98,209.03,208.84,0.82,0.5,0.03,209.13\n08/19/2015 12:00:00 AM,209.09,210.01,207.35,208.68,208.32,209.07,208.99,-0.37,-0.64,-0.02,207.74\n08/20/2015 12:00:00 AM,206.51,207.17,203.9,205.535,203.97,208.57,208.94,-2.27,-1.76,-0.12,204.94\n08/21/2015 12:00:00 AM,201.73,202.92,197.52,200.22,197.63,207.16,208.34,-5.03,-2.97,-0.27,200.27\n08/24/2015 12:00:00 AM,187.28,195.84,182.95,189.395,189.55,204.03,206.73,-10.55,-5.63,-0.59,190.53\n08/25/2015 12:00:00 AM,195.43,195.45,186.92,191.185,187.27,200.95,204.04,-6.53,0.2,-0.5,193.51\n08/26/2015 12:00:00 AM,192.08,194.79,188.37,191.58,194.46,198.41,201.09,-4.49,1.73,-0.45,194.74\n08/27/2015 12:00:00 AM,197.02,199.42,195.21,197.315,199.27,197.28,198.77,0.39,4.61,-0.25,200.77\n08/28/2015 12:00:00 AM,198.5,199.84,197.92,198.88,199.28,197.08,197.52,1.28,3.05,-0.19,202.06\n08/31/2015 12:00:00 AM,198.11,199.13,197.01,198.07,197.67,197.15,197.15,0.41,0.87,-0.2,200.66\n09/01/2015 12:00:00 AM,193.12,194.77,190.73,192.75,191.77,196.54,196.98,-3.09,-2.24,-0.35,194.74\n09/02/2015 12:00:00 AM,194.62,195.46,192.42,193.94,195.41,195.92,196.54,-1.48,0.01,-0.3,195.29\n09/03/2015 12:00:00 AM,196.26,198.05,194.96,196.505,195.55,195.77,196.04,0.55,1.52,-0.2,197.02\n09/04/2015 12:00:00 AM,192.85,193.86,191.61,192.735,192.59,195.27,195.68,-2,-1.15,-0.3,192.46\n09/08/2015 12:00:00 AM,195.94,197.61,195.17,196.39,197.43,195.24,195.39,0.88,1.55,-0.17,195.39\n09/09/2015 12:00:00 AM,199.32,199.47,194.35,196.91,194.79,195.48,195.31,0.97,0.85,-0.15,195.2\n09/10/2015 12:00:00 AM,194.56,197.22,194.25,195.735,195.85,195.6,195.45,-0.05,-0.35,-0.17,193.55\n09/11/2015 12:00:00 AM,195.38,196.82,194.53,195.675,196.74,195.66,195.59,-0.07,-0.22,-0.17,193.28\n09/14/2015 12:00:00 AM,196.95,197.01,195.43,196.22,196.01,195.77,195.67,0.3,0.15,-0.14,193.84\n09/15/2015 12:00:00 AM,196.61,198.99,195.96,197.475,198.46,196.06,195.81,1.01,0.61,-0.09,195.28\n09/16/2015 12:00:00 AM,198.82,200.41,198.41,199.41,200.18,196.66,196.13,1.97,1.02,-0.03,197.5\n09/17/2015 12:00:00 AM,200.02,202.89,199.28,201.085,199.73,197.53,196.72,2.5,0.9,0.02,199.52\n09/18/2015 12:00:00 AM,195.71,197.56,194.96,196.26,195.45,197.68,197.35,-1.26,-2.38,-0.12,195.26\n09/21/2015 12:00:00 AM,196.44,197.68,195.21,196.445,196.46,197.56,197.61,-0.8,-0.89,-0.11,196.21\n09/22/2015 12:00:00 AM,193.88,194.46,192.56,193.51,193.91,196.92,197.43,-2.45,-1.68,-0.19,194.1\n09/23/2015 12:00:00 AM,194.11,194.67,192.91,193.79,193.6,196.22,196.9,-1.6,-0.2,-0.18,195.18\n09/24/2015 12:00:00 AM,192.15,193.45,190.56,192.005,192.9,195.34,196.17,-2.3,-0.6,-0.22,194.06\n09/25/2015 12:00:00 AM,194.64,195,191.81,193.405,192.85,194.72,195.4,-0.78,0.86,-0.16,195.9\n09/28/2015 12:00:00 AM,191.78,191.91,187.64,189.775,188.01,193.76,194.63,-2.88,-1.11,-0.26,192.52\n09/29/2015 12:00:00 AM,188.27,189.74,186.93,188.335,188.12,192.6,193.71,-3.01,-0.65,-0.29,191.2\n09/30/2015 12:00:00 AM,190.37,191.82,189.44,190.63,191.63,191.87,192.71,-0.72,1.4,-0.2,193.32\n10/01/2015 12:00:00 AM,192.08,192.49,189.82,191.155,192.13,191.49,191.96,-0.19,1.13,-0.18,193.33\n10/02/2015 12:00:00 AM,189.77,195.03,189.12,192.075,195,191.43,191.57,0.45,1.06,-0.14,193.52\n10/05/2015 12:00:00 AM,196.46,198.74,196.33,197.535,198.47,192.3,191.66,3.8,3.04,0.04,197.96\n10/06/2015 12:00:00 AM,198.31,198.98,197,197.99,197.79,193.46,192.37,3.05,0.96,0.05,197.24\n10/07/2015 12:00:00 AM,198.9,199.82,197.48,198.65,199.41,194.66,193.47,2.64,0.13,0.06,196.83\n10/08/2015 12:00:00 AM,198.95,201.55,198.59,200.07,201.21,195.91,194.67,2.82,0.15,0.11,197.36\n10/09/2015 12:00:00 AM,201.38,201.9,200.58,201.24,201.33,197.17,195.91,2.79,0.02,0.13,197.87\n10/12/2015 12:00:00 AM,201.42,201.76,200.91,201.335,201.52,198.25,197.12,2.09,-0.55,0.13,197.63\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,201.105,200.25,199.09,198.19,1.37,-0.84,0.11,197.43\n10/14/2015 12:00:00 AM,200.18,200.87,198.94,199.905,199.29,199.52,198.99,0.23,-1.29,0.07,196.66\n10/15/2015 12:00:00 AM,200.08,202.36,199.64,201,202.35,199.91,199.51,0.87,-0.18,0.1,198.47\n10/16/2015 12:00:00 AM,202.83,203.29,201.92,202.605,203.27,200.45,199.94,1.65,0.52,0.14,200.9\n10/19/2015 12:00:00 AM,202.5,203.37,202.13,202.75,203.37,200.99,200.45,1.29,0.01,0.14,201.93\n10/20/2015 12:00:00 AM,202.85,203.84,202.55,203.195,203.09,201.52,200.99,1.22,-0.04,0.15,203.27\n10/21/2015 12:00:00 AM,203.61,203.79,201.65,202.72,201.85,201.9,201.48,0.59,-0.5,0.12,203.62\n10/22/2015 12:00:00 AM,202.98,205.51,201.85,203.68,205.26,202.3,201.9,1.04,0.09,0.14,205.26\n10/23/2015 12:00:00 AM,207.25,207.95,206.3,207.125,207.51,203.16,202.41,2.95,1.49,0.24,209.06\n10/26/2015 12:00:00 AM,207.3,207.37,206.56,206.965,207,204.04,203.17,2.04,0.08,0.22,208.95\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.395,206.6,204.72,203.99,1.12,-0.66,0.19,208.26\n10/28/2015 12:00:00 AM,207,208.98,206.21,207.595,208.95,205.4,204.72,1.58,-0.01,0.22,209.15\n10/29/2015 12:00:00 AM,208.34,209.27,208.21,208.74,208.83,206.15,205.42,1.87,0.22,0.24,209.79\n10/30/2015 12:00:00 AM,209.06,209.44,207.74,208.59,207.93,206.79,206.12,1.27,-0.34,0.22,209.03\n11/02/2015 12:00:00 AM,208.32,210.62,208.17,209.395,210.39,207.42,206.79,1.43,-0.05,0.23,209.2\n11/03/2015 12:00:00 AM,209.97,211.66,209.7,210.68,211,208.13,207.44,1.86,0.29,0.26,209.85\n11/04/2015 12:00:00 AM,211.35,211.5,209.72,210.61,210.36,208.77,208.11,1.31,-0.26,0.24,209.22\n11/05/2015 12:00:00 AM,210.43,210.98,209.09,210.035,210.15,209.19,208.71,0.58,-0.68,0.21,208.27\n11/06/2015 12:00:00 AM,209.74,210.32,208.46,209.39,210.04,209.39,209.14,0.01,-0.77,0.17,207.48\n11/09/2015 12:00:00 AM,209.31,209.49,206.95,208.22,208.08,209.29,209.31,-0.74,-0.94,0.13,206.41\n11/10/2015 12:00:00 AM,207.51,208.6,207.19,207.895,208.56,209.05,209.25,-0.74,-0.47,0.11,206.4\n11/11/2015 12:00:00 AM,208.88,208.94,207.66,208.3,207.74,208.85,209.06,-0.28,0.13,0.12,207.23\n11/12/2015 12:00:00 AM,206.5,207.06,204.82,205.94,204.84,208.35,208.77,-1.71,-0.98,0.04,205.44\n11/13/2015 12:00:00 AM,204.35,204.67,202.43,203.55,202.54,207.45,208.25,-2.76,-1.28,-0.04,203.78\n11/16/2015 12:00:00 AM,202.32,205.69,202.18,203.935,205.62,206.6,207.46,-1.76,0.12,-0.02,204.88\n11/17/2015 12:00:00 AM,205.99,207.04,204.88,205.96,205.47,206.18,206.71,0.01,1.42,0.04,207.42\n11/18/2015 12:00:00 AM,206.04,208.9,205.99,207.445,208.73,206.2,206.29,0.95,1.45,0.08,209.14\n11/19/2015 12:00:00 AM,208.59,209.05,208.2,208.625,208.55,206.57,206.29,1.44,1.11,0.11,210.3\n11/20/2015 12:00:00 AM,209.45,210.12,208.86,209.49,209.31,207.13,206.62,1.6,0.66,0.13,210.92\n11/23/2015 12:00:00 AM,209.38,209.98,208.52,209.25,209.07,207.66,207.12,1.01,-0.13,0.12,210.3\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,208.62,209.35,208,207.61,0.33,-0.6,0.09,209.24\n11/25/2015 12:00:00 AM,209.5,209.74,209.01,209.375,209.32,208.33,208,0.72,-0.03,0.11,209.53\n11/27/2015 12:00:00 AM,209.43,209.8,208.86,209.33,209.56,208.6,208.32,0.5,-0.19,0.1,209.01\n11/30/2015 12:00:00 AM,209.75,209.89,208.56,209.225,208.69,208.8,208.58,0.29,-0.25,0.09,208.49\n12/01/2015 12:00:00 AM,209.44,210.82,209.11,209.965,210.68,209.04,208.81,0.68,0.16,0.11,208.9\n12/02/2015 12:00:00 AM,210.62,211,208.23,209.615,208.53,209.22,209.03,0.27,-0.22,0.09,208.32\n12/03/2015 12:00:00 AM,208.83,209.15,204.75,206.95,205.61,208.96,209.11,-1.5,-1.44,0,205.66\n12/04/2015 12:00:00 AM,206.08,209.97,205.93,207.95,209.62,208.71,208.96,-0.45,0.05,0.04,206.83\n12/07/2015 12:00:00 AM,209.23,209.73,207.2,208.465,208.35,208.58,208.74,0,0.38,0.05,207.57\n12/08/2015 12:00:00 AM,206.49,208.29,205.78,207.035,206.95,208.3,208.54,-0.91,-0.47,0,206.47\n12/09/2015 12:00:00 AM,206.19,208.68,204.18,206.43,205.34,207.92,208.28,-1.05,-0.34,-0.02,206.28\n12/10/2015 12:00:00 AM,205.42,207.43,205.14,206.285,205.87,207.54,207.92,-0.85,-0.02,-0.02,206.57\n12/11/2015 12:00:00 AM,203.35,204.14,201.51,202.825,201.88,206.71,207.43,-2.82,-1.48,-0.12,203.6\n12/14/2015 12:00:00 AM,202.07,203.05,199.95,201.5,202.9,205.63,206.64,-2.89,-0.8,-0.16,202.8\n12/15/2015 12:00:00 AM,204.7,206.11,204.54,205.325,205.03,205.17,205.78,0.33,2.04,-0.03,206.92\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,206.595,208.03,205.2,205.29,1.05,1.6,0.01,208.17\n12/17/2015 12:00:00 AM,208.4,208.48,204.84,206.66,204.86,205.43,205.25,0.8,0.63,0.01,208.02\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,201.38,200.02,204.92,205.25,-2.78,-2.39,-0.15,202.57\n12/21/2015 12:00:00 AM,201.41,201.88,200.09,200.985,201.67,204.16,204.86,-2.27,-0.86,-0.15,202.07\n12/22/2015 12:00:00 AM,202.71,203.85,201.55,202.7,203.5,203.65,204.22,-0.56,0.86,-0.09,203.55\n12/23/2015 12:00:00 AM,204.69,206.07,204.58,205.325,206.02,203.7,203.79,1.27,1.82,-0.01,205.74\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.875,205.68,204.04,203.77,1.27,0.93,0.01,205.74\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,204.6,205.21,204.25,204.01,0.11,-0.41,-0.03,203.99\n12/29/2015 12:00:00 AM,206.51,207.79,206.47,207.13,207.4,204.75,204.32,1.69,0.95,0.05,206.09\n12/30/2015 12:00:00 AM,207.11,207.21,205.76,206.485,205.93,205.2,204.74,0.82,-0.18,0.03,205.08\n12/31/2015 12:00:00 AM,205.13,205.89,203.87,204.88,203.87,205.32,205.11,-0.43,-1.05,-0.02,203.34\n01/04/2016 12:00:00 AM,200.49,201.03,198.59,199.81,201.02,204.56,205.1,-3.54,-2.88,-0.18,198.49\n01/05/2016 12:00:00 AM,201.4,201.9,200.05,200.975,201.36,203.75,204.55,-1.83,-0.18,-0.13,200.11\n01/06/2016 12:00:00 AM,198.34,200.06,197.6,198.83,198.82,202.72,203.69,-2.69,-0.71,-0.19,198.5\n01/07/2016 12:00:00 AM,195.33,197.44,193.59,195.515,194.05,201.27,202.62,-4.07,-1.36,-0.28,195.88\n01/08/2016 12:00:00 AM,195.19,195.85,191.58,193.715,191.92,199.62,201.22,-4.1,-0.69,-0.32,194.86\n01/11/2016 12:00:00 AM,193.01,193.41,189.82,191.615,192.11,197.82,199.58,-4.32,-0.48,-0.36,193.5\n01/12/2016 12:00:00 AM,193.82,194.55,191.14,192.845,193.66,196.4,197.91,-2.35,1.27,-0.3,195.28\n01/13/2016 12:00:00 AM,194.45,194.86,188.38,191.62,188.83,195.17,196.45,-2.49,0.57,-0.32,194.33\n01/14/2016 12:00:00 AM,189.55,193.26,187.66,190.46,191.93,194.01,195.19,-2.55,0.26,-0.34,193.25\n01/15/2016 12:00:00 AM,186.77,188.76,185.52,187.14,187.81,192.56,193.93,-3.96,-0.93,-0.42,189.87\n01/19/2016 12:00:00 AM,189.96,190.11,186.2,188.155,188.06,191.37,192.62,-2.23,0.82,-0.36,190.65\n01/20/2016 12:00:00 AM,185.03,187.49,181.02,184.255,185.65,189.87,191.29,-4.11,-0.98,-0.46,186.37\n01/21/2016 12:00:00 AM,186.21,188.87,184.64,186.755,186.69,188.84,189.99,-1.39,1.53,-0.36,188.36\n01/22/2016 12:00:00 AM,189.78,190.76,188.88,189.82,190.52,188.6,189.04,0.94,2.54,-0.24,190.63\n01/25/2016 12:00:00 AM,189.92,190.15,187.41,188.78,187.64,188.53,188.64,0.02,0.59,-0.26,188.69\n01/26/2016 12:00:00 AM,188.42,190.53,188.02,189.275,190.2,188.61,188.57,0.33,0.49,-0.23,188.38\n01/27/2016 12:00:00 AM,189.58,191.56,187.06,189.31,188.13,188.74,188.62,0.26,0.17,-0.22,187.72\n01/28/2016 12:00:00 AM,189.96,190.2,187.16,188.68,189.11,188.79,188.72,-0.21,-0.3,-0.22,186.61\n01/29/2016 12:00:00 AM,190.02,193.88,189.88,191.88,193.72,189.25,188.89,1.88,1.39,-0.11,189.47\n02/01/2016 12:00:00 AM,192.53,194.58,191.84,193.21,193.65,190.01,189.33,2.22,0.94,-0.06,190.58\n02/02/2016 12:00:00 AM,191.96,191.97,189.54,190.755,190.16,190.41,189.92,0.05,-1.17,-0.14,188.2\n02/03/2016 12:00:00 AM,191.41,191.78,187.1,189.44,191.3,190.42,190.31,-0.8,-1.27,-0.17,187.31\n02/04/2016 12:00:00 AM,190.71,192.75,189.96,191.355,191.6,190.56,190.45,0.64,0.43,-0.1,189.81\n02/05/2016 12:00:00 AM,190.99,191.67,187.2,189.435,187.95,190.45,190.5,-0.76,-0.82,-0.15,188.59\n02/08/2016 12:00:00 AM,185.77,186.12,182.8,184.46,185.42,189.53,190.25,-3.72,-2.64,-0.29,184.56\n02/09/2016 12:00:00 AM,183.36,186.94,183.2,185.07,185.43,188.53,189.51,-2.31,-0.28,-0.26,186.18\n02/10/2016 12:00:00 AM,186.41,188.34,185.12,186.73,185.27,187.88,188.62,-0.62,1.17,-0.19,188.61\n02/11/2016 12:00:00 AM,182.34,184.1,181.09,182.595,182.86,186.87,187.79,-3.09,-1.22,-0.3,185.1\n02/12/2016 12:00:00 AM,184.96,186.65,183.96,185.305,186.63,186.25,186.97,-0.52,1.31,-0.21,188.2\n02/16/2016 12:00:00 AM,188.77,189.81,187.63,188.72,189.78,186.37,186.43,1.8,2.43,-0.09,191.52\n02/17/2016 12:00:00 AM,191.16,193.32,191.01,192.165,192.88,187.27,186.57,3.5,2.51,0.02,194.41\n02/18/2016 12:00:00 AM,193.2,193.27,191.72,192.495,192.09,188.37,187.32,2.75,0.69,0.03,193.88\n02/19/2016 12:00:00 AM,191.17,192.18,190.45,191.315,192,189.22,188.31,1.25,-0.83,-0.01,191.79\n02/22/2016 12:00:00 AM,193.87,194.95,193.79,194.37,194.78,190.3,189.28,2.85,0.74,0.09,193.89\n02/23/2016 12:00:00 AM,194,194.32,192.18,193.25,192.32,191.14,190.24,1.36,-0.77,0.05,191.86\n02/24/2016 12:00:00 AM,190.63,193.53,189.32,191.425,193.2,191.5,191.02,-0.17,-1.57,-0.01,189.4\n02/25/2016 12:00:00 AM,193.73,195.55,192.83,194.19,195.54,192.04,191.55,1.63,0.55,0.07,191.73\n02/26/2016 12:00:00 AM,196.57,196.68,194.9,195.79,195.09,192.79,192.09,2.21,0.72,0.12,193.03\n02/29/2016 12:00:00 AM,195.11,196.23,193.33,194.78,193.56,193.36,192.74,0.96,-0.57,0.08,191.97\n03/01/2016 12:00:00 AM,195.01,198.21,194.45,196.33,198.11,194.02,193.38,1.68,0.25,0.12,193.73\n03/02/2016 12:00:00 AM,197.74,199.06,197.25,198.155,199,194.87,194.07,2.39,0.65,0.17,195.9\n03/03/2016 12:00:00 AM,198.79,199.79,198.11,198.95,199.77,195.79,194.89,2.24,0.22,0.19,197.15\n03/04/2016 12:00:00 AM,200.01,201.35,199.03,200.19,200.43,196.79,195.81,2.42,0.24,0.21,198.93\n03/07/2016 12:00:00 AM,199.34,201.07,199.25,200.16,200.59,197.66,196.76,1.74,-0.4,0.2,199.48\n03/08/2016 12:00:00 AM,199.32,199.92,198.21,199.065,198.4,198.2,197.58,0.56,-1.09,0.15,199.04\n03/09/2016 12:00:00 AM,199.36,199.79,198.43,199.11,199.38,198.54,198.15,0.44,-0.65,0.15,199.72\n03/10/2016 12:00:00 AM,199.96,201.07,197.38,199.225,199.54,198.77,198.51,0.39,-0.36,0.14,200.38\n03/11/2016 12:00:00 AM,201.26,202.81,201.12,201.965,202.76,199.32,198.85,2.03,1.06,0.22,203.43\n03/14/2016 12:00:00 AM,202.16,203.04,201.77,202.405,202.5,199.98,199.35,1.75,0.35,0.21,203.93\n03/15/2016 12:00:00 AM,201.36,202.53,201.05,201.79,202.17,200.5,199.95,0.88,-0.48,0.19,203.23\n03/16/2016 12:00:00 AM,201.6,203.82,201.55,202.685,203.34,201.02,200.5,1.21,0,0.2,203.9\n03/17/2016 12:00:00 AM,203.24,205.23,202.77,204,204.63,201.65,201.05,1.72,0.38,0.23,204.82\n03/18/2016 12:00:00 AM,204.17,204.78,203.8,204.29,204.38,202.28,201.65,1.43,-0.02,0.22,204.61\n03/21/2016 12:00:00 AM,204.07,204.94,203.8,204.37,204.67,202.82,202.26,1.09,-0.27,0.21,204.18\n03/22/2016 12:00:00 AM,203.76,205.23,203.57,204.4,204.56,203.26,202.8,0.81,-0.35,0.2,203.75\n03/23/2016 12:00:00 AM,204.11,204.33,203.01,203.67,203.21,203.49,203.21,0.13,-0.69,0.17,202.67\n03/24/2016 12:00:00 AM,202,203.16,201.74,202.45,203.12,203.42,203.41,-0.69,-0.96,0.12,201.27\n03/28/2016 12:00:00 AM,203.61,203.86,202.71,203.285,203.24,203.38,203.43,0.03,0.07,0.14,202.07\n03/29/2016 12:00:00 AM,202.76,205.25,202.4,203.825,205.12,203.43,203.4,0.37,0.3,0.15,202.64\n03/30/2016 12:00:00 AM,206.3,206.87,205.59,206.23,206.02,203.85,203.52,1.8,1.24,0.21,205.1\n03/31/2016 12:00:00 AM,205.91,206.41,205.33,205.87,205.52,204.31,203.86,1.08,0.1,0.19,204.84\n04/01/2016 12:00:00 AM,204.35,207.14,203.98,205.56,206.92,204.67,204.29,0.59,-0.33,0.17,204.74\n04/04/2016 12:00:00 AM,206.83,207.07,205.89,206.48,206.25,205.07,204.68,1.01,0.14,0.18,205.91\n04/05/2016 12:00:00 AM,204.67,205.26,203.89,204.575,204.19,205.15,204.99,-0.48,-1.05,0.12,204.33\n04/06/2016 12:00:00 AM,204.29,206.49,203.98,205.235,206.42,205.19,205.14,0.07,-0.12,0.13,205.36\n04/07/2016 12:00:00 AM,205.14,205.56,203.09,204.325,203.95,205.08,205.16,-0.53,-0.5,0.09,204.79\n04/08/2016 12:00:00 AM,205.34,205.85,203.87,204.86,204.5,205.01,205.09,-0.04,0.12,0.1,205.61\n04/11/2016 12:00:00 AM,205.25,206.07,203.91,204.99,204.02,204.98,205.02,0.05,0.14,0.1,205.92\n04/12/2016 12:00:00 AM,204.22,206.25,203.7,204.975,205.92,204.97,204.98,0.03,0.06,0.09,205.98\n04/13/2016 12:00:00 AM,207,208.1,206.84,207.47,208,205.33,205.06,1.61,1.22,0.17,208.37\n04/14/2016 12:00:00 AM,208.07,208.6,207.6,208.1,208.01,205.87,205.37,1.57,0.59,0.17,208.73\n04/15/2016 12:00:00 AM,208.01,208.17,207.4,207.785,207.78,206.36,205.86,0.94,-0.18,0.16,208.08\n04/18/2016 12:00:00 AM,207.14,209.28,207,208.14,209.24,206.8,206.35,0.91,-0.13,0.16,208.1\n04/19/2016 12:00:00 AM,209.74,210.2,208.94,209.57,209.9,207.38,206.83,1.57,0.42,0.19,209.17\n04/20/2016 12:00:00 AM,209.95,210.92,209.39,210.155,210.1,208,207.39,1.51,0.16,0.2,209.38\n04/21/2016 12:00:00 AM,210.12,210.25,208.65,209.45,208.97,208.45,207.96,0.65,-0.57,0.17,208.41\n04/22/2016 12:00:00 AM,208.55,209.29,207.91,208.6,208.97,208.65,208.39,-0.07,-0.84,0.13,207.45\n04/25/2016 12:00:00 AM,208.26,208.66,207.54,208.1,208.61,208.64,208.6,-0.37,-0.65,0.11,207\n04/26/2016 12:00:00 AM,209.04,209.52,208.36,208.94,208.92,208.68,208.65,0.27,0.16,0.12,207.99\n04/27/2016 12:00:00 AM,208.47,209.81,208.05,208.93,209.35,208.73,208.68,0.19,0.03,0.12,208.17\n04/28/2016 12:00:00 AM,208.46,209.76,206.96,208.36,207.45,208.7,208.71,-0.23,-0.28,0.09,207.88\n04/29/2016 12:00:00 AM,206.72,207.13,205.03,206.08,206.33,208.3,208.61,-1.62,-1.18,0.02,205.99\n05/02/2016 12:00:00 AM,206.92,208.18,206.41,207.295,207.97,208,208.33,-0.4,0.32,0.05,207.61\n05/03/2016 12:00:00 AM,206.52,206.8,205.28,206.04,206.16,207.6,207.98,-1.09,-0.34,0.01,206.71\n05/04/2016 12:00:00 AM,204.99,205.85,204.42,205.135,205.01,207.09,207.58,-1.37,-0.37,-0.02,206.14\n05/05/2016 12:00:00 AM,205.56,205.98,204.47,205.225,204.97,206.62,207.1,-0.94,0.15,-0.01,206.48\n05/06/2016 12:00:00 AM,204.06,205.77,203.88,204.825,205.72,206.18,206.63,-0.94,0.09,-0.02,206.2\n05/09/2016 12:00:00 AM,205.57,206.4,205.36,205.88,205.89,205.97,206.24,-0.01,0.75,0.01,207.21\n05/10/2016 12:00:00 AM,206.72,208.5,206.64,207.57,208.45,206.12,206.06,1.07,1.19,0.06,208.66\n05/11/2016 12:00:00 AM,207.91,208.54,206.5,207.52,206.5,206.38,206.15,0.75,0.36,0.06,208.22\n05/12/2016 12:00:00 AM,207.29,207.49,205.37,206.43,206.56,206.49,206.34,-0.15,-0.51,0.02,206.74\n05/13/2016 12:00:00 AM,206.21,206.86,204.38,205.62,204.76,206.4,206.44,-0.63,-0.63,-0.01,205.59\n05/16/2016 12:00:00 AM,204.96,207.34,204.89,206.115,206.78,206.33,206.41,-0.14,0.04,0.01,205.78\n05/17/2016 12:00:00 AM,206.46,206.8,204.23,205.515,204.85,206.18,206.31,-0.48,-0.24,-0.01,204.93\n05/18/2016 12:00:00 AM,204.44,206.3,203.63,204.965,204.91,205.95,206.16,-0.7,-0.28,-0.03,204.23\n05/19/2016 12:00:00 AM,204.06,204.54,202.78,203.66,204.2,205.52,205.9,-1.34,-0.62,-0.06,202.91\n05/20/2016 12:00:00 AM,204.92,206.1,204.86,205.48,205.49,205.36,205.59,0.18,0.84,-0.01,204.78\n05/23/2016 12:00:00 AM,205.51,205.84,204.99,205.415,205.21,205.3,205.38,0.09,0.37,-0.01,204.77\n05/24/2016 12:00:00 AM,206.17,208.24,206.14,207.19,207.87,205.56,205.38,1.2,1.01,0.05,206.6\n05/25/2016 12:00:00 AM,208.67,209.77,208.62,209.195,209.28,206.18,205.65,2.15,1.22,0.11,208.61\n05/26/2016 12:00:00 AM,209.44,209.71,208.97,209.34,209.34,206.89,206.2,1.65,0.24,0.1,208.74\n05/27/2016 12:00:00 AM,209.53,210.25,209.47,209.86,210.24,207.59,206.89,1.53,0,0.11,209.28\n05/31/2016 12:00:00 AM,210.56,210.69,209.18,209.935,209.84,208.2,207.56,1.16,-0.3,0.11,209.42\n06/01/2016 12:00:00 AM,209.12,210.48,208.89,209.685,210.27,208.65,208.16,0.68,-0.52,0.1,209.28\n06/02/2016 12:00:00 AM,209.8,210.93,209.24,210.085,210.91,209.03,208.63,0.75,-0.22,0.1,209.82\n06/03/2016 12:00:00 AM,210.25,210.69,208.86,209.775,210.28,209.28,209,0.35,-0.42,0.09,209.66\n"
  },
  {
    "path": "Tests/TestData/spy_t3.txt",
    "content": "Date,Open,High,Low,Close,Volume,T3_5\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.727373071709\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,155.939965049421\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.169311620439\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,156.208505071597\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,156.163316021061\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,156.009379955485\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.923455704891\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.982818104731\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,156.361209337946\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,156.983897071722\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,157.627090751181\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,157.741629004728\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,157.689872441889\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,157.341207445412\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.710781230176\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,156.135407080014\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,155.796587949259\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,155.857415684049\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,156.1946309493\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,156.714959374113\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,157.24131679748\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,157.80705609375\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,158.387197399952\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.745156848669\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,159.057250299217\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,159.528616445385\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,160.128814949054\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,160.829300903617\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,161.593206490445\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,162.249512272259\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,162.79695180988\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,163.230962029484\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,163.741981183126\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,164.379060655653\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,164.936461115711\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,165.529522100722\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,166.09595000462\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,166.596772070258\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,166.846998109108\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,166.823544564867\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,166.61191387248\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,166.436121775993\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,166.211618374853\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,166.033279502192\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,165.638658031163\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,165.210190397582\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,164.748017150637\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,164.046847461115\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,163.409339412933\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,163.178009982\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,163.281515476424\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,163.365814180951\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,163.208753314817\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,163.172453975243\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,163.162738191544\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,163.301399906158\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,163.690965303475\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,163.942835066812\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,163.540057034833\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,162.65209035184\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,161.364370111779\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,160.165980251\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,159.424912170696\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,159.218621180511\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,159.297032878042\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,159.60645318546\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,159.999872277155\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,160.387467594432\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,160.92067051311\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,161.624228431008\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,162.498947148184\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,163.390636035447\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,164.430528122743\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,165.479312143115\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,166.46679510188\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,167.2208492908\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.766541713175\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,168.23453512449\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,168.658345909132\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,169.047974897555\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,169.32835328561\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,169.420099080179\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,169.415643985613\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,169.386612212878\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,169.29348819607\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,169.160054607522\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,169.031655436549\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,169.15360400852\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,169.490838035304\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,169.88415783607\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,170.124999810217\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,170.144115519855\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,170.086037084739\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.955825924035\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.77179931094\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.635333212968\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.45819006615\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,168.982447370031\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,168.265170283588\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,167.366355470933\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,166.560824369579\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,165.83106794412\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,165.399131730707\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,165.303036748076\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,165.358132125613\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,165.156505633371\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,164.818233314068\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,164.491142689854\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,164.176018680675\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,163.991409411965\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,164.089228186254\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,164.40248297361\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,164.811589317613\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,165.400789603713\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,166.198125034625\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,167.103671809232\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,167.906280656126\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,168.565035915766\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,169.171495278602\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,169.784142131157\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,170.572933688923\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,171.376427993308\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,171.82906626972\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,171.856236913227\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,171.558327655503\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,171.052309263697\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,170.567319091628\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,170.093805608514\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.567412226555\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,169.207014579733\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,169.006753319954\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,168.741185036641\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,168.572201557745\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,168.34096098469\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,167.841205244623\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,167.210844961907\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,167.014434016207\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,167.335205954936\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,168.030105981294\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,168.707061742998\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,169.507254741029\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,170.45880620874\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,171.541849226954\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,172.584504296019\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,173.574800118648\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,174.323659665528\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,174.874582975909\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,175.343239470249\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,175.75996995214\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,176.20949828095\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,176.537039153792\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,176.662414595438\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,176.680993874291\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,176.718110490353\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,176.715274970931\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,176.778429170799\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,176.628974422923\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,176.588139588348\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,176.67834340102\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,176.797675347023\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,177.067122545065\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,177.523641011143\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,178.140837163563\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,178.70900050101\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,179.100679203084\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,179.253153919828\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,179.399367426381\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,179.671824775862\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,179.991439450359\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,180.293132607141\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,180.588235079894\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,180.833190834956\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,180.95589716341\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,180.884479399299\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,180.685334273678\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,180.348085875226\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,180.193137571896\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,180.276311932154\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,180.427015884933\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,180.332620754983\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.973442884746\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.487443480875\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.132449422165\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,178.875810940165\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.056519964836\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,179.521220420597\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,180.088054715167\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,180.736831120781\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,181.409737426526\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,182.122041027929\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,182.783830351238\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.322161782164\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,183.813855408683\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,184.028890004631\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,184.002566014215\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,183.775427170799\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,183.585810236294\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,183.484305146367\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183.466781594066\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,183.556966135406\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,183.417756503515\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,183.323807837536\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,183.43362361883\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,183.655072666128\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.809931563033\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,183.938908172906\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,184.059939856037\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.989542655951\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,183.320649546369\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,182.183447823821\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,181.033771757391\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,179.883445649183\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,179.07824731123\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,178.511434685488\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,177.664170472381\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,176.788620713034\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,176.018710965628\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,175.695754897365\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,176.003612453567\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,176.737661834001\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,177.84822457469\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,179.073946335001\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,180.303272348608\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,181.502864912861\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,182.575694014951\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,183.294470413059\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,183.802873303935\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,184.127193452635\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,184.423596985432\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,184.685817734831\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,184.892887744057\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,185.148135564332\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,185.473980374041\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,185.653671656765\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,185.985088356976\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,186.444075500013\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,186.972497286513\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,187.481125734242\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,187.891633124749\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,188.07229660994\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,188.072712530209\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,187.724562156057\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,187.107650304959\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,186.60160622321\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,186.439954349845\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,186.427697906789\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,186.59694137375\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,186.682803903599\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,186.570584791751\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,186.43343062334\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,186.172241346937\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,185.800356724381\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,185.510847195307\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,185.516153146223\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,185.88371824075\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.517365973101\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,187.1976018167\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,187.532727882804\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,187.310859358839\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.826242567224\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,186.521409114965\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,185.977654993135\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,185.076718793957\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,184.2020991141\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,183.656413881837\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,183.64918907483\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,184.03992909071\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,184.681486740297\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,185.481101699948\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,186.224875393791\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,186.861942012842\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.177820268609\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,187.294507888544\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,187.401314911156\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,187.588661609447\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,187.819383672755\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,188.011358642903\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,188.18371098003\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,188.135460915105\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,188.048255641181\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,187.955457695242\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,187.906026341337\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,188.109290887635\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,188.500653789191\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,188.845110314103\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,188.88591866828\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,188.766851470906\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,188.670712646127\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,188.492129193109\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,188.446384356888\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.578516177112\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.900012797054\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,189.439613566686\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,190.04157718368\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,190.702821338043\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,191.363842187478\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,191.966933801129\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.445742759867\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.828535532991\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,193.26135523749\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,193.809753400169\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,194.400238095133\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,194.937110427564\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,195.282637984298\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,195.284608029552\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,195.115500240567\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,194.907865804781\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.782616141776\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,194.906267771185\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,195.220480552532\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,195.539707465089\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,195.784728993595\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,195.805004872879\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,195.76106430629\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.695169689427\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.673480404664\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.679758120282\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.850932208502\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,196.15108988062\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,196.602583963806\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,197.019774969178\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,197.187734309083\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,197.249280972546\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,197.17420596532\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,197.048680110985\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,197.03596734502\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,197.07795137473\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,197.221304239622\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,197.155214411647\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,197.144973354646\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,197.175367888781\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,197.32377536708\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,197.592669338659\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,197.906459438672\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,198.090450443394\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,198.152752510762\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,198.036522738824\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.816896004957\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,197.116712109094\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,196.061505714435\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,195.090920681029\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,194.137521551686\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,193.291734635397\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,192.499318415647\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,192.075869301501\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,192.048116547259\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,192.241537558076\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,192.673711378651\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,193.319855955504\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.021033516977\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,194.845704085064\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,195.791759374283\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,196.771650482635\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,197.717528396829\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,198.490579831739\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,199.165423134715\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,199.733485114576\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,200.159962487514\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,200.430248981957\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,200.635383363153\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.778681137974\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.851440147883\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.833265753009\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.859080607824\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.869107703642\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,200.705526918516\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,200.51037978922\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,200.368432033582\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,200.150978853708\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.86850666397\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.753824932112\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,199.82730272487\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.135086014858\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.429301644159\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.457079989087\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,200.141662346276\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,199.820342742551\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,199.216270460932\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,198.63653681323\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,198.149115576963\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,197.721929779961\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,197.060261236512\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,196.279038492364\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,195.784075407956\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,195.566556556937\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,195.1870944991\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,195.067897006636\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,194.746114050716\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,193.997188044221\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,192.667894145083\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,191.140663112136\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,189.584677639575\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,188.1950131249\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,187.353432166179\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,187.224336026137\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,188.017707393658\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,189.168832376141\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,190.577365295783\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,192.15473172336\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,193.622012942196\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,195.078934735669\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,196.356627834884\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,197.502950010004\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,198.717349394115\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,199.885614961156\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,200.789455844507\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,201.536058192238\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,202.213439958158\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,202.805433808309\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,203.344645666824\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,203.814514168736\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,204.154691278769\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,204.387713765656\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,204.533684623729\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,204.623468809157\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,204.807058710822\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,205.011279641586\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,205.22947250446\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,205.555885912392\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,205.994224641006\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,206.432763080981\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,206.862365263119\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,207.184417664709\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,207.217277012416\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,207.190606274761\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,207.263956814384\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,207.389044262893\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,207.559504678828\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,207.57301733755\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,207.43436449833\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,206.83133918358\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,206.07360067035\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,204.974930162419\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,203.59159717334\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,202.009011946393\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,200.946961136887\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,201.032913377327\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,201.892318090075\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,203.172617181683\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,204.543543292761\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,205.769161430853\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,206.81411346013\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.665469975062\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,208.17405898334\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,208.149513649849\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,207.753323917352\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,206.767039352656\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,205.262711881394\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,203.907670572732\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,203.328880543054\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,203.202609257554\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,203.116203652393\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,202.923319907645\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,202.521795732757\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,201.807762940651\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,201.271269469396\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,201.043145401217\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,201.172958467205\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,201.870226316074\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,202.745569044358\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,203.62125126899\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,204.056502943942\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,203.795132534404\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,203.310459376058\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,202.533262174916\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,201.936253547631\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,201.939573085807\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,202.290479796273\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,203.006982709553\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,203.805352773195\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,204.408425181074\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,205.033071283927\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,205.657913657941\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,206.442455737382\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,207.366663939651\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,208.307268203269\n"
  },
  {
    "path": "Tests/TestData/spy_tdd.csv",
    "content": "date,open,high,low,close,tdd\n19980102 00:00,973100,975300,965300,973600,\n19980105 00:00,978400,984400,967800,977500,\n19980106 00:00,972500,972800,961900,966300,\n19980107 00:00,960900,965000,952200,964700,0.006683882798144525\n19980108 00:00,963100,963100,955000,957800,0.007856650593644847\n19980109 00:00,952500,955000,919100,924700,0.02039754993829824\n19980112 00:00,911300,941900,909100,940600,0.020375135625230804\n19980113 00:00,946300,956300,942200,952200,0.019952280131735868\n19980114 00:00,956900,959700,947200,958100,0.0\n19980115 00:00,955000,957500,948100,949400,0.005242612819068744\n19980116 00:00,962500,966900,956600,962300,0.005242612819068744\n19980120 00:00,966900,980000,965000,980000,0.005242612819068744\n19980121 00:00,972200,976900,961600,971600,0.00494871659305393\n19980122 00:00,961600,968800,958800,963000,0.007113749619283539\n19980123 00:00,965000,967800,950000,956600,0.008082579297133163\n19980126 00:00,963800,967300,937500,957500,0.006390484502451933\n19980127 00:00,958100,980000,956600,970000,0.0038370111348012687\n19980128 00:00,974100,981100,971700,978800,0.0\n19980129 00:00,978400,995600,975600,987500,0.0\n19980130 00:00,987800,989700,980000,983100,0.0025724974019588195\n19980202 00:00,999100,1005000,997500,1002500,0.0025724974019588195\n19980203 00:00,1000000,1008100,997200,1006900,0.0025724974019588195\n19980204 00:00,1002800,1011600,998800,1005900,0.0005733938516135187\n19980205 00:00,1013100,1015900,1000300,1003800,0.0013347609607653641\n19980206 00:00,1010000,1015000,1006900,1012800,0.0013347609607653641\n19980209 00:00,1017200,1017500,1007200,1011400,0.0014455898607557214\n19980210 00:00,1014400,1024700,1011900,1020500,0.0007980750166523533\n19980211 00:00,1020900,1031900,1017000,1021300,0.0007980750166523533\n19980212 00:00,1017200,1029400,1008800,1026600,0.0\n19980213 00:00,1021900,1029400,1018800,1021600,0.002811953385883643\n19980217 00:00,1028100,1030900,1021600,1023400,0.002811953385883643\n19980218 00:00,1023100,1034700,1022800,1034100,0.002811953385883643\n19980219 00:00,1032500,1034100,1027500,1030000,0.0022890785259427936\n19980220 00:00,1030800,1037500,1023800,1035600,0.0022890785259427936\n19980223 00:00,1042500,1042500,1033400,1040000,0.0022890785259427936\n19980224 00:00,1039100,1040900,1029400,1031900,0.004496670365803838\n19980225 00:00,1037500,1048800,1036300,1044800,0.004496670365803838\n19980226 00:00,1044400,1051600,1041900,1050600,0.004496670365803838\n19980227 00:00,1049700,1055300,1043100,1052000,0.0\n19980302 00:00,1052500,1057500,1046300,1048100,0.0021403669675281035\n19980303 00:00,1045300,1054700,1045000,1054100,0.0021403669675281035\n19980304 00:00,1050900,1054100,1040600,1049700,0.0032232109294324848\n19980305 00:00,1035000,1044400,1031600,1037500,0.007129824650035391\n19980306 00:00,1045600,1058800,1044400,1057500,0.007129824650035391\n19980309 00:00,1055300,1062200,1052500,1054400,0.00692032748434124\n19980310 00:00,1062200,1068400,1053800,1066600,0.0016924688742201565\n19980311 00:00,1069700,1073100,1067300,1072500,0.0016924688742201565\n19980312 00:00,1070900,1075900,1065000,1072500,0.0\n19980313 00:00,1078400,1080000,1068800,1072200,0.00016149657879427237\n19980316 00:00,1078400,1082800,1075300,1082500,0.00016149657879427237\n19980317 00:00,1083100,1085000,1076600,1084700,0.00016149657879427237\n19980318 00:00,1082500,1089400,1080000,1087800,0.0\n19980319 00:00,1089700,1093800,1086600,1093400,0.0\n19980320 00:00,1095600,1101900,1088800,1100000,0.0\n19980323 00:00,1097200,1103100,1094100,1095000,0.0026243194054073747\n19980324 00:00,1100600,1108100,1099400,1105900,0.0026243194054073747\n19980325 00:00,1114100,1115300,1091900,1101900,0.003353783058606782\n19980326 00:00,1098800,1107500,1096300,1101300,0.002111786045596085\n19980327 00:00,1107500,1107800,1090000,1095300,0.003788614013282762\n19980330 00:00,1096300,1100900,1089700,1093400,0.003315996258761735\n19980331 00:00,1101600,1111900,1097500,1100900,0.0033010603369747157\n19980401 00:00,1103100,1110800,1094100,1109800,0.0010015205984299333\n19980402 00:00,1109400,1122500,1107500,1120300,0.0\n19980403 00:00,1123400,1128100,1118400,1121900,0.0\n19980406 00:00,1132500,1133800,1120600,1122500,0.0\n19980407 00:00,1117500,1119400,1101600,1110000,0.006429290302779811\n19980408 00:00,1112200,1112800,1097500,1101300,0.007862124890140463\n19980409 00:00,1105600,1112800,1105300,1110000,0.007862124890140463\n19980413 00:00,1113800,1113800,1100000,1110000,0.004525177785540328\n19980414 00:00,1111300,1117200,1109100,1116900,0.0\n19980415 00:00,1119700,1121300,1111600,1120200,0.0\n19980416 00:00,1113100,1115000,1105000,1109100,0.005720931965724734\n19980417 00:00,1107200,1124100,1104400,1122200,0.005720931965724734\n19980420 00:00,1120000,1125600,1118800,1124100,0.005720931965724734\n19980421 00:00,1124400,1131600,1119100,1126300,0.0\n19980422 00:00,1128800,1134400,1128100,1130000,0.0\n19980423 00:00,1126300,1130000,1117500,1120900,0.00464945792002263\n19980424 00:00,1117500,1124700,1103400,1108800,0.0077756495372785775\n19980427 00:00,1093800,1106600,1076300,1085900,0.014235248009168231\n19980428 00:00,1097800,1098100,1081300,1086300,0.013454546701114347\n19980429 00:00,1090300,1099700,1084400,1095300,0.011923990949172493\n19980430 00:00,1105600,1119200,1104100,1114400,0.0\n19980501 00:00,1117500,1123100,1113100,1121900,0.0\n19980504 00:00,1127200,1133100,1121600,1122500,0.0\n19980505 00:00,1120000,1121600,1111300,1116600,0.0030346250229120434\n19980506 00:00,1121300,1121300,1104700,1105000,0.0067218925309760185\n19980507 00:00,1105000,1105600,1094100,1095900,0.008233500405824264\n19980508 00:00,1100000,1113800,1100000,1110000,0.007653860457509295\n19980511 00:00,1115600,1122200,1103800,1108600,0.004810088328132507\n19980512 00:00,1108100,1118800,1102500,1116400,0.0007281895287076286\n19980513 00:00,1120600,1125600,1115900,1120600,0.0007281895287076286\n19980514 00:00,1115300,1126900,1113400,1119700,0.0004636937732202872\n19980515 00:00,1120000,1122200,1108100,1110000,0.005023053741749631\n19980518 00:00,1107200,1115900,1098300,1108400,0.005091527606610143\n19980519 00:00,1110000,1116900,1107800,1110600,0.005070368966214387\n19980520 00:00,1120900,1125000,1108800,1122800,0.0008322166042372899\n19980521 00:00,1123800,1127800,1113100,1116900,0.003033814203971138\n19980522 00:00,1117500,1120600,1109400,1111600,0.004087776114547724\n19980526 00:00,1120900,1120900,1094400,1095300,0.00940123009284852\n19980527 00:00,1093100,1099100,1075800,1096300,0.008898263798880295\n19980528 00:00,1098800,1103800,1087300,1100000,0.008466003407512527\n19980529 00:00,1106300,1108100,1093800,1093800,0.003254156062705178\n19980601 00:00,1089700,1102200,1085600,1095000,0.003254156062705178\n19980602 00:00,1100000,1103400,1091600,1095900,0.003254156062705178\n19980603 00:00,1098800,1101900,1082200,1085000,0.005742419868753451\n19980604 00:00,1082500,1100600,1080600,1099100,0.005742419868753451\n19980605 00:00,1103800,1118800,1098800,1118100,0.005742419868753451\n19980608 00:00,1119400,1124700,1116600,1118800,0.0\n19980609 00:00,1117200,1124200,1114100,1122800,0.0\n19980610 00:00,1116300,1130600,1112500,1113800,0.004627852175549219\n19980611 00:00,1114400,1118800,1092800,1096600,0.010045327814643823\n19980612 00:00,1098800,1104400,1082500,1102500,0.010045327814643823\n19980615 00:00,1088100,1099100,1078800,1080000,0.014775744914083067\n19980616 00:00,1084100,1091600,1077500,1090600,0.011782658554890335\n19980617 00:00,1101600,1117800,1099400,1112500,0.011782658554890335\n19980618 00:00,1111900,1114400,1107500,1111600,0.00046706988069270184\n19980619 00:00,1110600,1112300,1096300,1100300,0.005887625594545278\n19980622 00:00,1102500,1110600,1100600,1103800,0.005887625594545278\n19980623 00:00,1110900,1121900,1110000,1119700,0.005869069846925861\n19980624 00:00,1121600,1136900,1116100,1134700,0.0\n19980625 00:00,1139100,1144700,1128100,1130000,0.002391421754817345\n19980626 00:00,1133100,1138400,1131300,1134100,0.002391421754817345\n19980629 00:00,1142500,1146900,1138000,1138900,0.002391421754817345\n19980630 00:00,1139100,1141900,1130600,1133600,0.0026867647964746956\n19980701 00:00,1140600,1149400,1136300,1149400,0.0026867647964746956\n19980702 00:00,1147200,1148800,1142500,1146300,0.0031053848002507473\n19980706 00:00,1147800,1158400,1145600,1157800,0.0015571479332589636\n19980707 00:00,1159800,1161300,1152800,1155600,0.0019047939396810553\n19980708 00:00,1158800,1169400,1157500,1168100,0.0010970552705278863\n19980709 00:00,1162800,1167200,1156300,1160000,0.0041511296338914904\n19980710 00:00,1160300,1169100,1150600,1165300,0.004003541803301058\n19980713 00:00,1165600,1168400,1160600,1167500,0.004003541803301058\n19980714 00:00,1169400,1181600,1169400,1178100,0.0\n19980715 00:00,1180600,1182800,1174400,1175600,0.001225172458173357\n19980716 00:00,1176900,1185900,1170600,1184400,0.001225172458173357\n19980717 00:00,1186300,1190000,1183100,1187500,0.001225172458173357\n19980720 00:00,1187500,1192300,1179400,1185000,0.0012154742509255189\n19980721 00:00,1190000,1190000,1162800,1165300,0.009674799245502672\n19980722 00:00,1163400,1195900,1155300,1166300,0.009674799245502672\n19980723 00:00,1163100,1168400,1138800,1141900,0.015427848270014767\n19980724 00:00,1149700,1150900,1128800,1141600,0.012079616994239636\n19980727 00:00,1136300,1150000,1128400,1149800,0.012079616994239636\n19980728 00:00,1144400,1146600,1118800,1133100,0.00838696008109297\n19980729 00:00,1137200,1141300,1122500,1126600,0.009015938176645429\n19980730 00:00,1136300,1145900,1134100,1143400,0.009015938176645429\n19980731 00:00,1143400,1145000,1113100,1120600,0.01197959117381564\n19980803 00:00,1117800,1124200,1110300,1113800,0.01203394432709135\n19980804 00:00,1122200,1122200,1072500,1076100,0.022950239535941885\n19980805 00:00,1079400,1088800,1055900,1081600,0.0198537638532253\n19980806 00:00,1081300,1095200,1075600,1090900,0.019542202503545394\n19980807 00:00,1096900,1105900,1084700,1090300,0.0003175452942650696\n19980810 00:00,1087500,1096600,1081900,1085900,0.0023514863193157616\n19980811 00:00,1067800,1074400,1055000,1070600,0.008467742203993753\n19980812 00:00,1077500,1088100,1075000,1085000,0.008461786041929155\n19980813 00:00,1088100,1096600,1076300,1076400,0.00933354565320945\n19980814 00:00,1083400,1087200,1057800,1064800,0.0077236040240690985\n19980817 00:00,1060000,1089400,1055000,1085000,0.0077236040240690985\n19980818 00:00,1090000,1105900,1087800,1102500,0.00622190925548092\n19980819 00:00,1110900,1110900,1096300,1100000,0.0013091842838767252\n19980820 00:00,1096900,1104100,1091600,1092500,0.004148473364714414\n19980821 00:00,1081900,1087200,1055000,1083800,0.0061926037051729475\n19980824 00:00,1092500,1099400,1083100,1090600,0.00605263390270483\n19980825 00:00,1103800,1112500,1086400,1095000,0.00459766347089223\n19980826 00:00,1082800,1096300,1077500,1085000,0.0052726051980787735\n19980827 00:00,1070000,1078400,1038900,1042500,0.023221611403332308\n19980828 00:00,1049700,1057200,1021600,1030000,0.02423151931326568\n19980831 00:00,1037500,1040200,950000,962500,0.04461988009454136\n19980901 00:00,960600,1005600,936300,996900,0.03846414991987581\n19980902 00:00,998100,1017500,987800,990000,0.03804650299866568\n19980903 00:00,976300,993800,966900,985200,0.00487901511980142\n19980904 00:00,994400,998100,957800,976300,0.007141943679597398\n19980908 00:00,1008800,1029700,998100,1025900,0.005919333247246081\n19980909 00:00,1027500,1031300,1004800,1007500,0.011594378572822483\n19980910 00:00,984400,993400,968100,982500,0.01767682620817326\n19980911 00:00,981900,1015000,970000,1012500,0.01767682620817326\n19980914 00:00,1028800,1044500,1020900,1031600,0.014326309409171862\n19980915 00:00,1028800,1043100,1022800,1042000,0.0\n19980916 00:00,1047500,1052500,1031600,1050000,0.0\n19980917 00:00,1022500,1030300,1017800,1022300,0.015231049958621564\n19980918 00:00,1023800,1024100,1010900,1019700,0.015301665986051254\n19980921 00:00,996300,1034100,989400,1021900,0.015301665986051254\n19980922 00:00,1035000,1036600,1021600,1030000,0.001468366135080731\n19980923 00:00,1038800,1070000,1037800,1066300,0.0\n19980924 00:00,1063100,1068100,1032500,1043800,0.012182670033542712\n19980925 00:00,1031300,1054200,1026300,1043000,0.01219070360180144\n19980928 00:00,1053100,1063100,1042500,1049100,0.01219070360180144\n19980929 00:00,1053800,1059400,1033800,1049400,0.0004424987692581618\n19980930 00:00,1035000,1043100,1013800,1018400,0.01705532527623249\n19981001 00:00,1000300,1015500,980900,986300,0.02494102872556214\n19981002 00:00,988800,1008800,972200,1003100,0.02494102872556214\n19981005 00:00,995900,1000000,963400,990000,0.01969825141122241\n19981006 00:00,1007500,1012800,975300,985300,0.008022665010735201\n19981007 00:00,986300,1000300,957500,972200,0.011103426896176726\n19981008 00:00,945600,967500,922200,962200,0.01008477526255491\n19981009 00:00,970000,995600,940600,986300,0.00970514571092415\n19981012 00:00,1006300,1014400,996900,997800,0.00593859565099389\n19981013 00:00,995600,1004100,987500,995300,0.0014465581007958252\n19981014 00:00,989400,1018100,988400,1005000,0.0014465581007958252\n19981015 00:00,1001300,1072500,999400,1050300,0.0014465581007958252\n19981016 00:00,1061300,1067500,1050000,1056600,0.0\n19981019 00:00,1056900,1068100,1055000,1063400,0.0\n19981020 00:00,1075600,1088000,1060900,1065000,0.0\n19981021 00:00,1068800,1076300,1058800,1071300,0.0\n19981022 00:00,1067800,1084700,1061600,1080000,0.0\n19981023 00:00,1079700,1080000,1067800,1071300,0.0046508771684720075\n19981026 00:00,1077200,1085600,1067800,1075500,0.0046508771684720075\n19981027 00:00,1084400,1089700,1062800,1066300,0.006783942886182902\n19981028 00:00,1065600,1078100,1060300,1067800,0.004938747072565815\n19981029 00:00,1070900,1089700,1066300,1089700,0.004938747072565815\n19981030 00:00,1101300,1109100,1095000,1100000,0.0\n19981102 00:00,1108100,1117500,1101900,1114800,0.0\n19981103 00:00,1115900,1118100,1107500,1111300,0.0018126353984245724\n19981104 00:00,1124700,1130900,1110900,1118400,0.0018126353984245724\n19981105 00:00,1115300,1138100,1111300,1137300,0.0018126353984245724\n19981106 00:00,1134700,1145000,1133100,1142800,0.0\n19981109 00:00,1139400,1142500,1125000,1131400,0.00575935690301167\n19981110 00:00,1130000,1139400,1125000,1126900,0.006200270776622957\n19981111 00:00,1138100,1140600,1118900,1123800,0.006400457707587035\n19981112 00:00,1123100,1131300,1116900,1120300,0.0033209785094718415\n19981113 00:00,1122200,1130600,1121300,1127700,0.0023991107713478644\n19981116 00:00,1142200,1143600,1128900,1138400,0.0017981188308984768\n19981117 00:00,1136600,1156300,1130000,1143400,0.0\n19981118 00:00,1143100,1149400,1135000,1147500,0.0\n19981119 00:00,1152800,1159100,1146300,1155000,0.0\n19981120 00:00,1163600,1167500,1158400,1166300,0.0\n19981123 00:00,1174700,1192200,1171600,1191600,0.0\n19981124 00:00,1190000,1196600,1184500,1186900,0.0022772291584350806\n19981125 00:00,1189400,1191900,1181600,1188800,0.0022772291584350806\n19981127 00:00,1194700,1197200,1190000,1195000,0.0022772291584350806\n19981130 00:00,1190200,1193800,1166600,1166900,0.013576186246216308\n19981201 00:00,1161300,1180300,1152200,1178100,0.013576186246216308\n19981202 00:00,1172200,1179100,1160000,1175000,0.01366092396978762\n19981203 00:00,1172500,1183100,1151900,1152800,0.011013518909288512\n19981204 00:00,1166300,1188800,1155900,1179700,0.011013518909288512\n19981207 00:00,1180600,1195300,1180000,1192500,0.01090823487319972\n19981208 00:00,1185300,1197500,1175000,1184700,0.0037763791192277144\n19981209 00:00,1186900,1189700,1178800,1188100,0.0037763791192277144\n19981210 00:00,1188400,1188400,1167200,1168100,0.01042677965916762\n19981211 00:00,1164400,1173400,1155600,1170600,0.0097188834136794\n19981214 00:00,1161600,1164100,1139100,1144700,0.016050998568379424\n19981215 00:00,1146900,1167500,1145300,1166300,0.012774108980019929\n19981216 00:00,1171300,1171300,1157500,1164100,0.012820448968613474\n19981217 00:00,1172200,1185600,1170200,1185000,0.001089059926448721\n19981218 00:00,1183100,1191300,1178800,1190200,0.001089059926448721\n19981221 00:00,1192500,1213400,1190000,1203100,0.0\n19981222 00:00,1204100,1212200,1191900,1205300,0.0\n19981223 00:00,1211900,1231900,1208100,1228100,0.0\n19981224 00:00,1231600,1238800,1222800,1226900,0.0005641399910655369\n19981228 00:00,1232500,1233100,1220000,1226300,0.00063085111245837\n19981229 00:00,1227200,1244400,1221300,1243100,0.00063085111245837\n19981230 00:00,1239400,1247500,1230300,1233800,0.004328547053093749\n19981231 00:00,1233100,1239400,1224700,1228800,0.00491232208994971\n19990104 00:00,1233800,1252200,1217200,1228800,0.00491232208994971\n19990105 00:00,1229400,1248800,1229400,1244400,0.002339723898482861\n19990106 00:00,1258100,1276300,1257500,1275000,0.0\n19990107 00:00,1263800,1272200,1257800,1269400,0.002535812947028933\n19990108 00:00,1281900,1285000,1259700,1275000,0.002535812947028933\n19990111 00:00,1276900,1276900,1252200,1262800,0.006078642205915579\n19990112 00:00,1262200,1262200,1238100,1240000,0.011797539732306843\n19990113 00:00,1204100,1251300,1203800,1233100,0.01222715108486487\n19990114 00:00,1236300,1239100,1209100,1211600,0.014843132622004963\n19990115 00:00,1223800,1247800,1220300,1243100,0.010566749077378906\n19990119 00:00,1253000,1274700,1235000,1252800,0.010066524035014986\n19990120 00:00,1260900,1279400,1250300,1256300,0.0\n19990121 00:00,1255800,1258400,1232200,1235900,0.009375105859642085\n19990122 00:00,1221300,1238400,1217800,1225600,0.010537765614080754\n19990125 00:00,1232800,1240000,1219100,1236300,0.010537765614080754\n19990126 00:00,1241300,1257200,1236300,1255000,0.004811641534633203\n19990127 00:00,1263800,1266300,1244100,1244700,0.004738412567851105\n19990128 00:00,1252500,1269700,1251900,1266600,0.004738412567851105\n19990129 00:00,1273400,1283000,1254100,1278800,0.004738412567851105\n19990201 00:00,1286900,1286900,1270000,1270900,0.003566677452766696\n19990202 00:00,1270800,1272200,1247700,1262800,0.0051245894952314216\n19990203 00:00,1256900,1279400,1256600,1271900,0.0051245894952314216\n19990204 00:00,1273800,1275000,1248100,1248400,0.011284121241385723\n19990205 00:00,1256600,1256600,1232200,1240000,0.011352646036485392\n19990208 00:00,1250900,1250900,1233400,1243800,0.011352646036485392\n19990209 00:00,1243800,1245000,1215600,1218600,0.012325607024537751\n19990210 00:00,1221300,1230000,1213300,1226900,0.011697400533509034\n19990211 00:00,1230600,1256900,1225000,1256900,0.011697400533509034\n19990212 00:00,1248100,1255000,1226300,1235000,0.01005964746221085\n19990216 00:00,1247500,1256300,1233800,1243800,0.01005964746221085\n19990217 00:00,1231900,1253600,1222500,1227500,0.012587435100983525\n19990218 00:00,1231900,1243800,1222200,1239400,0.007566175741912618\n19990219 00:00,1240000,1257500,1233800,1239400,0.007566175741912618\n19990222 00:00,1244400,1277200,1242800,1276900,0.0\n19990223 00:00,1275900,1285000,1265900,1275000,0.0008590849020755692\n19990224 00:00,1278400,1288400,1254100,1254100,0.009502927394927023\n19990225 00:00,1245300,1252800,1225900,1247500,0.009976861576964435\n19990226 00:00,1247500,1248400,1228100,1239100,0.010673000158035791\n19990301 00:00,1236600,1243100,1208800,1237800,0.00497114015228883\n19990302 00:00,1245000,1253100,1223100,1228100,0.005995853358568142\n19990303 00:00,1230900,1235600,1217800,1231300,0.004564763430995733\n19990304 00:00,1240600,1252300,1232700,1250000,0.00452439619578231\n19990305 00:00,1275000,1281300,1259200,1278100,0.0\n19990308 00:00,1282800,1288000,1272500,1285200,0.0\n19990309 00:00,1281300,1299400,1274400,1282500,0.0012129207335916466\n19990310 00:00,1284700,1292200,1277800,1290300,0.0012129207335916466\n19990311 00:00,1296900,1311900,1288800,1302200,0.0012129207335916466\n19990312 00:00,1310000,1310300,1292200,1295300,0.0030592204403382243\n19990315 00:00,1299400,1311900,1295000,1311600,0.0030592204403382243\n19990316 00:00,1311300,1316600,1304700,1309800,0.003160162838370744\n19990317 00:00,1306900,1309400,1296300,1302500,0.0033139025998029548\n19990318 00:00,1297800,1323400,1297500,1321600,0.0033139025998029548\n19990319 00:00,1323100,1326300,1298400,1300600,0.009721953962101848\n19990322 00:00,1300600,1305900,1294200,1299100,0.009198131086195655\n19990323 00:00,1293100,1296300,1257000,1264100,0.018070912188536018\n19990324 00:00,1268400,1271600,1256300,1269400,0.015569060005764522\n19990325 00:00,1280600,1292500,1277500,1291300,0.015554814426631414\n19990326 00:00,1286300,1291300,1277200,1284700,0.002950911311586403\n19990329 00:00,1291600,1314400,1291600,1312200,0.002950911311586403\n19990330 00:00,1299400,1312200,1295600,1303400,0.004868196869387953\n19990331 00:00,1311600,1316100,1284400,1286300,0.008506792375413318\n19990401 00:00,1296900,1296900,1281300,1293800,0.008506792375413318\n19990405 00:00,1309400,1323800,1302500,1323800,0.007574566213858064\n19990406 00:00,1321900,1329800,1311600,1319400,0.0019189765708070342\n19990407 00:00,1326900,1333800,1313800,1328800,0.0019189765708070342\n19990408 00:00,1331900,1347800,1322800,1345300,0.0019189765708070342\n19990409 00:00,1344400,1356900,1335900,1348800,0.0\n19990412 00:00,1334700,1362500,1332200,1360600,0.0\n19990413 00:00,1362500,1364700,1340300,1351900,0.0036917149360206807\n19990414 00:00,1360600,1360600,1326900,1330300,0.00993591470902856\n19990415 00:00,1334400,1335600,1310000,1326300,0.010086431372265047\n19990416 00:00,1329100,1329100,1311900,1321300,0.009635594732647104\n19990419 00:00,1326900,1345300,1283800,1289100,0.014342791962393128\n19990420 00:00,1298100,1310300,1288800,1306300,0.014237344715717411\n19990421 00:00,1310600,1337800,1257800,1336900,0.014069990666696414\n19990422 00:00,1351300,1362500,1343900,1359700,0.0\n19990423 00:00,1358800,1367500,1350000,1357500,0.0009341550284747838\n19990426 00:00,1365000,1368100,1354700,1361300,0.0009341550284747838\n19990427 00:00,1371300,1375000,1358400,1365600,0.0009341550284747838\n19990428 00:00,1364400,1372500,1350000,1353400,0.005157932984851676\n19990429 00:00,1355600,1360600,1338100,1345600,0.006138078342275131\n19990430 00:00,1350900,1356300,1315000,1334700,0.007716772264509316\n19990503 00:00,1334400,1357200,1330300,1356300,0.005739712667553952\n19990504 00:00,1351300,1358100,1331300,1333100,0.010927199273992789\n19990505 00:00,1339400,1350000,1318400,1349700,0.009875784299343285\n19990506 00:00,1344400,1351300,1323800,1335000,0.011707746185494\n19990507 00:00,1345000,1349800,1334400,1346300,0.00628810028679521\n19990510 00:00,1348400,1357200,1335300,1342200,0.006529292386108906\n19990511 00:00,1353100,1368800,1257800,1357200,0.0017582530666845808\n19990512 00:00,1357500,1372200,1315000,1366300,0.0017582530666845808\n19990513 00:00,1372500,1380000,1368100,1370200,0.0\n19990514 00:00,1345600,1362500,1333100,1343000,0.011461047527337464\n19990517 00:00,1336300,1344800,1323100,1343100,0.011461047527337464\n19990518 00:00,1345300,1349800,1326300,1336300,0.011827932067788349\n19990519 00:00,1344700,1348800,1332500,1348100,0.002923074849593794\n19990520 00:00,1351300,1355900,1300600,1343100,0.0036234980576542635\n19990521 00:00,1341300,1346900,1195800,1334200,0.004384294031175197\n19990524 00:00,1338400,1338400,1303900,1310900,0.010994621804490257\n19990525 00:00,1313800,1323400,1286900,1288400,0.0146456407150599\n19990526 00:00,1293100,1310000,1280900,1306600,0.014137118850753087\n19990527 00:00,1298400,1302800,1280000,1284400,0.01394367224217672\n19990528 00:00,1290000,1307500,1285900,1305900,0.009809563734891854\n19990601 00:00,1301300,1301600,1283800,1298800,0.010299548636591892\n19990602 00:00,1297500,1301900,1206300,1297800,0.0031702941101903145\n19990603 00:00,1306900,1309100,1297800,1302800,0.0031702941101903145\n19990604 00:00,1314700,1331900,1309400,1319400,0.0004445259233058514\n19990607 00:00,1334400,1341900,1329100,1337500,0.0\n19990608 00:00,1333800,1338000,1315900,1321600,0.006863453667375718\n19990609 00:00,1324100,1330900,1318100,1321600,0.006863453667375718\n19990610 00:00,1314400,1315000,1295900,1309100,0.008770768680226717\n19990611 00:00,1312200,1322200,1290900,1298100,0.007304424566388389\n19990614 00:00,1306900,1307500,1295500,1297800,0.0073056431426854\n19990615 00:00,1304700,1316600,1300800,1305900,0.004853146889435092\n19990616 00:00,1323800,1338800,1321600,1334800,0.00013342969012931281\n19990617 00:00,1328800,1355600,1326300,1346600,0.0\n19990618 00:00,1340600,1346900,1333800,1343100,0.0015006133537529326\n19990621 00:00,1344700,1350000,1336600,1349400,0.0015006133537529326\n19990622 00:00,1340000,1351900,1333400,1337000,0.005513564838043425\n19990623 00:00,1330000,1336300,1321300,1332800,0.0056068654612495845\n19990624 00:00,1328800,1338100,1306600,1316900,0.00888125889531404\n19990625 00:00,1325900,1330200,1312500,1316600,0.007123657878300446\n19990628 00:00,1326900,1336300,1324700,1333800,0.006888912690139548\n19990629 00:00,1330000,1351300,1327800,1351300,0.0001315248543981196\n19990630 00:00,1346300,1375000,1338400,1367500,0.0\n19990701 00:00,1370000,1385000,1360600,1380600,0.0\n19990702 00:00,1381300,1393000,1379100,1391900,0.0\n19990706 00:00,1392500,1407500,1385900,1387200,0.00194952673697191\n19990707 00:00,1390600,1397200,1385200,1395600,0.00194952673697191\n19990708 00:00,1390600,1406300,1387500,1395600,0.00194952673697191\n19990709 00:00,1400000,1404700,1393800,1402200,0.0\n19990712 00:00,1409400,1409400,1395000,1400600,0.0006587936319379523\n19990713 00:00,1393800,1399200,1386600,1395000,0.002400577824470804\n19990714 00:00,1400000,1402200,1387500,1398400,0.002400577824470804\n19990715 00:00,1407800,1488800,1403100,1411300,0.002308411757433881\n19990716 00:00,1412500,1421600,1407500,1420000,0.0\n19990719 00:00,1421900,1422500,1405600,1410000,0.00406584696612412\n19990720 00:00,1401300,1404100,1375300,1378000,0.013719304759250123\n19990721 00:00,1380900,1389100,1370000,1378800,0.013719304759250123\n19990722 00:00,1374400,1380000,1354700,1361400,0.014992450180591492\n19990723 00:00,1366600,1370000,1351300,1357500,0.007471335175388627\n19990726 00:00,1348800,1361300,1346300,1350000,0.008123764453441144\n19990727 00:00,1360000,1372000,1353800,1365000,0.003593076398118804\n19990728 00:00,1362500,1373100,1355900,1367300,0.003189780492760355\n19990729 00:00,1349400,1352500,1333100,1343800,0.009923009819320004\n19990730 00:00,1348100,1353400,1328800,1330900,0.011365906820943884\n19990802 00:00,1327500,1347500,1325000,1329400,0.011384518300381959\n19990803 00:00,1337200,1338400,1313800,1323600,0.006122582186510652\n19990804 00:00,1327200,1338800,1305300,1306900,0.0077351197171309635\n19990805 00:00,1308800,1317200,1288400,1315600,0.007707701211709963\n19990806 00:00,1312200,1320000,1295000,1300600,0.009818159565376612\n19990809 00:00,1305900,1318000,1297200,1300500,0.006582890658559582\n19990810 00:00,1298800,1301600,1270000,1282200,0.010456429742663031\n19990811 00:00,1296900,1305300,1286300,1305300,0.008124311915964329\n19990812 00:00,1306900,1318100,1300000,1300200,0.008431552336578938\n19990813 00:00,1316300,1332500,1311300,1331900,0.0022557928237701068\n19990816 00:00,1331300,1339700,1322500,1333800,0.0022557928237701068\n19990817 00:00,1344400,1351600,1331300,1347000,0.0\n19990818 00:00,1342000,1343800,1334100,1335600,0.004886260630112661\n19990819 00:00,1323800,1332300,1316900,1328800,0.005702292516546954\n19990820 00:00,1330600,1339100,1326900,1338800,0.005702292516546954\n19990823 00:00,1348100,1364500,1346600,1363900,0.002939489241157111\n19990824 00:00,1360600,1379700,1353800,1365000,0.0\n19990825 00:00,1371900,1387800,1279100,1384400,0.0\n19990826 00:00,1382800,1384200,1365000,1365000,0.008090577305893309\n19990827 00:00,1368800,1370600,1351300,1351600,0.009878307273254394\n19990830 00:00,1353400,1355000,1323900,1326600,0.014547244303849164\n19990831 00:00,1329400,1337500,1307500,1325000,0.0121099034127312\n19990901 00:00,1329400,1335600,1323100,1335600,0.010701693661448356\n19990902 00:00,1321300,1326700,1306600,1322500,0.005705491822792331\n19990903 00:00,1348800,1362800,1346900,1361900,0.005662839567523302\n19990907 00:00,1360600,1366300,1342800,1355200,0.0063352373450614365\n19990908 00:00,1348400,1360600,1335000,1349100,0.0038498081287281424\n19990909 00:00,1347500,1352500,1336900,1351300,0.0038498081287281424\n19990910 00:00,1362500,1363600,1349400,1354500,0.002598757852757294\n19990913 00:00,1351300,1354700,1345000,1348100,0.002727974693845377\n19990914 00:00,1340600,1345600,1333800,1340600,0.0042141347895656295\n19990915 00:00,1354400,1354400,1320600,1320800,0.009511661425280003\n19990916 00:00,1325000,1328100,1303100,1323800,0.00911207205518585\n19990917 00:00,1326300,1339400,1321600,1337200,0.008527178375320424\n19990920 00:00,1339400,1340000,1330900,1336300,0.00038858453654698136\n19990921 00:00,1322500,1324700,1301600,1309100,0.011758220447798054\n19990922 00:00,1312500,1318400,1297500,1311600,0.011758220447798054\n19990923 00:00,1318100,1342500,1237800,1280000,0.018209640149044536\n19990924 00:00,1277500,1283800,1263100,1280600,0.01390993329246125\n19990927 00:00,1287500,1297500,1282800,1282800,0.01390993329246125\n19990928 00:00,1279400,1288100,1255600,1281900,0.0004050633319852442\n19990929 00:00,1284400,1291300,1267800,1267800,0.006363352983531848\n19990930 00:00,1274400,1294400,1269700,1283800,0.006363352983531848\n19991001 00:00,1279400,1285600,1266300,1283400,0.006352994927806884\n19991004 00:00,1291900,1306300,1287500,1306300,0.00017988791686857967\n19991005 00:00,1307200,1319700,1286900,1301900,0.0019529866710888471\n19991006 00:00,1307500,1328100,1306900,1326300,0.0019446843638018434\n19991007 00:00,1328600,1330000,1315000,1320000,0.0033619651513373183\n19991008 00:00,1317500,1338800,1312300,1337200,0.002742446426822442\n19991011 00:00,1335900,1341300,1333100,1338100,0.002742446426822442\n19991012 00:00,1331300,1333100,1311900,1314100,0.010355284702601492\n19991013 00:00,1306900,1313100,1282500,1286600,0.015912570042251852\n19991014 00:00,1284800,1291900,1267500,1284100,0.01595206691344899\n19991015 00:00,1260000,1267500,1245000,1248100,0.02022936790646068\n19991018 00:00,1249400,1257500,1234400,1255600,0.016224961072905622\n19991019 00:00,1271900,1282500,1259400,1260800,0.01618613012290831\n19991020 00:00,1277500,1292500,1271300,1292200,0.0\n19991021 00:00,1272200,1288800,1266300,1286300,0.0026360985824321103\n19991022 00:00,1297500,1312200,1295600,1303400,0.0026360985824321103\n19991025 00:00,1293100,1304700,1287500,1295000,0.004560006869061372\n19991026 00:00,1301900,1306900,1281900,1282500,0.006700867688107031\n19991027 00:00,1283800,1303100,1282500,1301300,0.006700867688107031\n19991028 00:00,1324400,1345000,1321900,1345000,0.005572879046231898\n19991029 00:00,1358400,1376900,1357200,1365600,0.0\n19991101 00:00,1365000,1370000,1356300,1359400,0.0026212446316459257\n19991102 00:00,1359700,1372500,1347500,1348100,0.00546840237595743\n19991103 00:00,1360000,1363800,1351300,1356900,0.00546840237595743\n19991104 00:00,1367500,1373600,1357700,1364700,0.004799218803768409\n19991105 00:00,1386300,1391100,1367800,1372200,0.0\n19991108 00:00,1370000,1383800,1367500,1379400,0.0\n19991109 00:00,1385000,1386900,1362800,1367200,0.005106331219452987\n19991110 00:00,1362500,1383900,1360800,1377500,0.005106331219452987\n19991111 00:00,1381900,1385600,1374700,1383800,0.005106331219452987\n19991112 00:00,1392500,1399700,1371300,1397500,0.0\n19991115 00:00,1398400,1402500,1394100,1398100,0.0\n19991116 00:00,1405600,1426300,1400900,1424400,0.0\n19991117 00:00,1422500,1429400,1413100,1415600,0.003566892985726396\n19991118 00:00,1424400,1430000,1416300,1428100,0.003566892985726396\n19991119 00:00,1424100,1429700,1420000,1425000,0.0037806607062764036\n19991122 00:00,1424400,1430000,1415000,1424700,0.0012591439873600088\n19991123 00:00,1428400,1428400,1400600,1408800,0.006565246446988842\n19991124 00:00,1407500,1424400,1400000,1420600,0.006444516359304348\n19991126 00:00,1424700,1428800,1412500,1414400,0.006918541028345558\n19991129 00:00,1408800,1419200,1404400,1410000,0.0030943510976597036\n19991130 00:00,1407500,1423100,1390000,1392500,0.007805266883172318\n19991201 00:00,1393100,1405000,1390000,1401300,0.0073873539569618875\n19991202 00:00,1406300,1413600,1403800,1411300,0.007165694830367722\n19991203 00:00,1430300,1454100,1430300,1436900,0.0\n19991206 00:00,1435300,1437200,1422500,1427500,0.0037769451808633094\n19991207 00:00,1432800,1433100,1413800,1419400,0.004999770739854334\n19991208 00:00,1413400,1420600,1406300,1406300,0.007306896538593581\n19991209 00:00,1418100,1422200,1393800,1410000,0.006255031744640813\n19991210 00:00,1422800,1428100,1408800,1420000,0.005328511009147613\n19991213 00:00,1414400,1427200,1412800,1421300,0.0\n19991214 00:00,1416300,1424800,1406300,1408100,0.005362009113700849\n19991215 00:00,1403800,1422000,1400000,1418000,0.005362009113700849\n19991216 00:00,1421900,1426600,1411600,1423800,0.005362009113700849\n19991217 00:00,1430000,1433100,1420600,1423800,0.0\n19991220 00:00,1425600,1431900,1410900,1416900,0.0027979469429754013\n19991221 00:00,1415900,1440600,1413400,1433400,0.0027979469429754013\n19991222 00:00,1436300,1441900,1429700,1437500,0.0027979469429754013\n19991223 00:00,1450200,1464400,1449700,1460900,0.0\n19991227 00:00,1465000,1467800,1450600,1458100,0.0011065649625100335\n19991228 00:00,1458800,1465000,1454800,1461400,0.0011065649625100335\n19991229 00:00,1463100,1468100,1452500,1463400,0.0011065649625100335\n19991230 00:00,1471300,1478800,1461900,1466300,0.0\n19991231 00:00,1468400,1475000,1462500,1468800,0.0\n20000103 00:00,1482500,1482500,1438800,1455600,0.005188605360364265\n20000104 00:00,1435300,1440600,1396400,1400600,0.022423790171342866\n20000105 00:00,1399400,1415300,1372500,1402800,0.022423790171342866\n20000106 00:00,1396300,1415000,1392500,1403400,0.021815241004004796\n20000107 00:00,1403100,1444400,1400600,1444400,0.0\n20000110 00:00,1462500,1469100,1450300,1458100,0.0\n20000111 00:00,1458100,1460900,1435000,1440900,0.00681052371583673\n20000112 00:00,1445900,1446300,1428800,1433400,0.007444070555495137\n20000113 00:00,1444700,1457500,1432800,1451300,0.007444070555495137\n20000114 00:00,1465300,1474700,1459700,1465000,0.00300515443051021\n20000118 00:00,1453400,1466300,1451900,1456300,0.0034286329979179215\n20000119 00:00,1453100,1464700,1450000,1456900,0.0034286329979179215\n20000120 00:00,1469700,1469700,1438100,1445000,0.0058304732280283576\n20000121 00:00,1455000,1455000,1440900,1441300,0.004942101995224871\n20000124 00:00,1456600,1458400,1394100,1400600,0.01703604139249737\n20000125 00:00,1405200,1420000,1390000,1410000,0.01637033330444252\n20000126 00:00,1410000,1415500,1400900,1406700,0.01635934589419224\n20000127 00:00,1418400,1422200,1381300,1400000,0.0030639300225542955\n20000128 00:00,1394400,1400600,1355300,1364700,0.014876415401914566\n20000131 00:00,1358100,1394400,1350000,1394400,0.014814920564085874\n20000201 00:00,1397500,1416900,1385300,1401900,0.01455747464456701\n20000202 00:00,1412800,1422500,1403800,1413000,0.0\n20000203 00:00,1408800,1429700,1400000,1428400,0.0\n20000204 00:00,1431900,1440000,1421300,1427800,0.00024251621500546048\n20000207 00:00,1425600,1427800,1414400,1427200,0.00034304179048022423\n20000208 00:00,1439700,1445600,1436300,1442800,0.00034304179048022423\n20000209 00:00,1444700,1444700,1413800,1414100,0.011487142921697627\n20000210 00:00,1416300,1425600,1408800,1418800,0.01148458048637531\n20000211 00:00,1418400,1419400,1380300,1391300,0.016035076667938273\n20000214 00:00,1397800,1397800,1383100,1392500,0.011190535947783102\n20000215 00:00,1392500,1412200,1378000,1407500,0.011190535947783102\n20000216 00:00,1403800,1409400,1388000,1390900,0.006809246514065893\n20000217 00:00,1404400,1404400,1382200,1390600,0.006810385095452518\n20000218 00:00,1388800,1388800,1346300,1351900,0.01745123687329479\n20000222 00:00,1351900,1441900,1333400,1354200,0.016067975302399652\n20000223 00:00,1356300,1374700,1345000,1365200,0.016067492749632158\n20000224 00:00,1366900,1370300,1330900,1356900,0.0035101137080822435\n20000225 00:00,1351900,1375300,1331300,1337500,0.008969863391434294\n20000228 00:00,1333800,1366900,1327200,1350600,0.008969863391434294\n20000229 00:00,1360600,1374400,1357500,1369100,0.008254547293299993\n20000301 00:00,1376300,1390000,1372200,1383100,0.0\n20000302 00:00,1386900,1391300,1373400,1387200,0.0\n20000303 00:00,1404400,1417200,1397200,1413100,0.0\n20000306 00:00,1408100,1413400,1387500,1393900,0.007844544029750745\n20000307 00:00,1400000,1401600,1352200,1359400,0.01630140829979311\n20000308 00:00,1364700,1378400,1350300,1370500,0.01630140829979311\n20000309 00:00,1372500,1405900,1361300,1405900,0.01428982300526727\n20000310 00:00,1401900,1420000,1395300,1400000,0.0024229081643209346\n20000313 00:00,1366900,1404700,1356900,1388800,0.005215727878835936\n20000314 00:00,1392800,1400900,1361600,1365000,0.01118468503156992\n20000315 00:00,1368800,1404400,1325000,1395000,0.010919097732078928\n20000316 00:00,1416300,1466900,1408800,1463100,0.009894107435709287\n20000317 00:00,1458100,1480000,1454400,1466900,0.0\n20000320 00:00,1468800,1473400,1447800,1459800,0.0027944555942779874\n20000321 00:00,1455300,1497200,1445000,1497200,0.0027944555942779874\n20000322 00:00,1495600,1508400,1486900,1500000,0.0027944555942779874\n20000323 00:00,1491600,1534700,1491600,1526300,0.0\n20000324 00:00,1528800,1557500,1517200,1532800,0.0\n20000327 00:00,1533800,1537800,1520000,1525000,0.0029379776224419977\n20000328 00:00,1512500,1529800,1507500,1510000,0.00639383357883262\n20000329 00:00,1515600,1524800,1496600,1510300,0.00639383357883262\n20000330 00:00,1501600,1519400,1471300,1488800,0.009989994834461452\n20000331 00:00,1496300,1523100,1484400,1505600,0.008218917292972893\n20000403 00:00,1501300,1510300,1486900,1507700,0.008218917292972893\n20000404 00:00,1517500,1530000,1413900,1500000,0.002948595259507961\n20000405 00:00,1478800,1508100,1476300,1488800,0.005222826601381315\n20000406 00:00,1502500,1516900,1490000,1503100,0.005222826601381315\n20000407 00:00,1515600,1521300,1505000,1517800,0.00431088200994918\n20000410 00:00,1517500,1531100,1503100,1507800,0.0038038626247833968\n20000411 00:00,1500000,1516300,1483800,1500600,0.004697884372592508\n20000412 00:00,1503800,1511600,1465600,1466300,0.014008054117475653\n20000413 00:00,1474700,1481600,1437800,1440000,0.01699979967075978\n20000414 00:00,1426300,1428100,1335000,1358100,0.03687340031064769\n20000417 00:00,1351900,1401300,1266900,1400600,0.03443097715559922\n20000418 00:00,1405600,1442200,1397800,1442200,0.03283679656015997\n20000419 00:00,1445000,1451300,1425300,1430000,0.004883978147353633\n20000420 00:00,1435600,1439400,1423800,1433800,0.004883978147353633\n20000424 00:00,1415000,1432800,1405000,1430000,0.005118066601231326\n20000425 00:00,1446300,1479700,1444400,1478800,0.0015301513620592391\n20000426 00:00,1479700,1487500,1460000,1463800,0.006052873453336879\n20000427 00:00,1430000,1473400,1430000,1465000,0.005856271326646211\n20000428 00:00,1470000,1478600,1450600,1452200,0.007729304178465533\n20000501 00:00,1465600,1484800,1436300,1471900,0.005044425560155108\n20000502 00:00,1455000,1471300,1445000,1446300,0.011237396696849701\n20000503 00:00,1440000,1440000,1397800,1416300,0.015628535639345176\n20000504 00:00,1420000,1423600,1407500,1413100,0.015682881374668743\n20000505 00:00,1410600,1440000,1409400,1433400,0.012046572662857654\n20000508 00:00,1427500,1433800,1418400,1425300,0.0035136683718431016\n20000509 00:00,1430600,1434100,1402700,1416300,0.004892343571470656\n20000510 00:00,1405000,1409700,1377500,1385900,0.013323220874291832\n20000511 00:00,1401300,1415000,1391300,1411100,0.012917584565990826\n20000512 00:00,1418100,1434700,1415600,1424100,0.012392465002728687\n20000515 00:00,1427500,1455900,1420000,1453800,0.0\n20000516 00:00,1465600,1477200,1453100,1470000,0.0\n20000517 00:00,1456900,1461900,1444700,1452500,0.006873217490352664\n20000518 00:00,1456300,1463100,1439400,1440600,0.008343557475669948\n20000519 00:00,1425600,1432300,1404100,1408800,0.015232775237846451\n20000522 00:00,1412500,1414700,1370000,1404100,0.013729761058165065\n20000523 00:00,1404400,1408100,1375600,1375600,0.01742023848777335\n20000524 00:00,1380000,1406900,1276300,1404100,0.011876119689273927\n20000525 00:00,1406900,1418100,1377200,1388800,0.013300799515019742\n20000526 00:00,1388100,1396900,1373300,1383100,0.006722652415367555\n20000530 00:00,1400000,1426900,1394700,1426300,0.006722652415367555\n20000531 00:00,1425600,1440000,1420900,1424100,0.0025314114508553135\n20000601 00:00,1436900,1453800,1430000,1451700,0.0008905353657836151\n20000602 00:00,1489400,1490900,1474800,1480900,0.0008905353657836151\n20000605 00:00,1474700,1482200,1468800,1472500,0.0032748614094083605\n20000606 00:00,1466300,1477800,1459100,1463400,0.004843075195894032\n20000607 00:00,1466300,1480000,1460000,1475600,0.004843075195894032\n20000608 00:00,1475000,1477500,1460600,1465600,0.005295230946652486\n20000609 00:00,1475000,1479700,1455300,1463400,0.00400748085166516\n20000612 00:00,1469700,1469700,1451300,1452800,0.005792139369883471\n20000613 00:00,1448100,1477500,1446300,1474700,0.004270839238840513\n20000614 00:00,1482500,1488800,1471900,1475000,0.004181982269652893\n20000615 00:00,1481300,1487500,1468400,1482500,0.0\n20000616 00:00,1483100,1483100,1458800,1468800,0.005335378541583745\n20000619 00:00,1464700,1491600,1462500,1486600,0.005335378541583745\n20000620 00:00,1481900,1488800,1470000,1478100,0.006274057767451219\n20000621 00:00,1469400,1484400,1468900,1479500,0.0033011417248162336\n20000622 00:00,1475600,1476900,1450000,1455300,0.01000399996393745\n20000623 00:00,1458100,1461300,1438800,1443800,0.010487952173740708\n20000626 00:00,1453800,1462500,1448800,1457500,0.010487952173740708\n20000627 00:00,1459800,1467200,1453100,1455600,0.004623972496640291\n20000628 00:00,1456300,1469800,1452200,1456300,0.0007526349992866429\n20000629 00:00,1447500,1457500,1435200,1444400,0.004777413738453784\n20000630 00:00,1439400,1455300,1438900,1453800,0.004717756096516198\n20000703 00:00,1454400,1474400,1451600,1472800,0.004717756096516198\n20000705 00:00,1463800,1466600,1443800,1450900,0.008584988386239003\n20000706 00:00,1449400,1464700,1442200,1458800,0.008584988386239003\n20000707 00:00,1466900,1487800,1462200,1480900,0.008584988386239003\n20000710 00:00,1478800,1489100,1476300,1479700,0.0004678373442011943\n20000711 00:00,1474700,1491300,1471600,1483800,0.0004678373442011943\n20000712 00:00,1492800,1501300,1486900,1495900,0.0004678373442011943\n20000713 00:00,1499800,1503800,1491900,1498800,0.0\n20000714 00:00,1504400,1512500,1496700,1508800,0.0\n20000717 00:00,1509800,1519800,1506900,1510600,0.0\n20000718 00:00,1506300,1506300,1493400,1496900,0.005236130469944281\n20000719 00:00,1494700,1499100,1482500,1484400,0.007117667236049973\n20000720 00:00,1490000,1505000,1488100,1498100,0.007117667236049973\n20000721 00:00,1497500,1497500,1478800,1482500,0.007706423739943524\n20000724 00:00,1481300,1488600,1465600,1466600,0.008630621158422211\n20000725 00:00,1477500,1478400,1467800,1474400,0.008630621158422211\n20000726 00:00,1469700,1471600,1456400,1461600,0.00796652868301224\n20000727 00:00,1459400,1466300,1446900,1455000,0.005649750356828376\n20000728 00:00,1457200,1459100,1415200,1422500,0.014079421396375353\n20000731 00:00,1429400,1441300,1420600,1434400,0.013157025002064704\n20000801 00:00,1436300,1447200,1431300,1440000,0.012896140033445268\n20000802 00:00,1438800,1454100,1436300,1442700,0.0\n20000803 00:00,1428800,1458100,1426300,1455000,0.0\n20000804 00:00,1463100,1467200,1454100,1465300,0.0\n20000807 00:00,1467200,1484400,1463800,1481300,0.0\n20000808 00:00,1475000,1488100,1475000,1485600,0.0\n20000809 00:00,1491400,1492200,1473800,1476900,0.0033810900255450355\n20000810 00:00,1475300,1478600,1462800,1465600,0.005562840318778158\n20000811 00:00,1466300,1480000,1455600,1474400,0.005562840318778158\n20000814 00:00,1477800,1495000,1470600,1493800,0.004417399987705862\n20000815 00:00,1493400,1498100,1473400,1490200,0.0013913917318801958\n20000816 00:00,1493100,1499400,1478400,1483800,0.0028432716085667374\n20000817 00:00,1486900,1504400,1483400,1499400,0.0028432716085667374\n20000818 00:00,1503800,1503800,1491600,1496700,0.002688696153754414\n20000821 00:00,1500300,1507200,1494100,1503600,0.0010396463430785816\n20000822 00:00,1505600,1513100,1500900,1502300,0.001153272484656692\n20000823 00:00,1498100,1512800,1491900,1509100,0.000499172219969774\n20000824 00:00,1511600,1515500,1500900,1514400,0.000499172219969774\n20000825 00:00,1511600,1516300,1509400,1510900,0.0013343409549416913\n20000828 00:00,1512500,1529100,1512500,1517800,0.0013343409549416913\n20000829 00:00,1514400,1518800,1509100,1515000,0.0017072974140739223\n20000830 00:00,1513100,1517800,1504500,1506300,0.0034823533771601097\n20000831 00:00,1510600,1530900,1508400,1522500,0.0034823533771601097\n20000901 00:00,1532500,1535900,1520000,1525600,0.003315476793366171\n20000905 00:00,1518800,1522000,1508100,1512500,0.004957582935490357\n20000906 00:00,1511900,1519500,1496900,1496900,0.007748387027101986\n20000907 00:00,1502500,1510800,1498300,1507500,0.007748387027101986\n20000908 00:00,1502800,1505000,1493300,1497500,0.007080087808487091\n20000911 00:00,1497500,1511900,1486900,1494700,0.003979086981127233\n20000912 00:00,1497500,1502500,1484400,1487500,0.0048546569607026005\n20000913 00:00,1480000,1498400,1476600,1488800,0.00298327400513393\n20000914 00:00,1498800,1499400,1481600,1485300,0.003094637884509044\n20000915 00:00,1481900,1482500,1460300,1467500,0.007050900255965321\n20000918 00:00,1463800,1469700,1442000,1446900,0.010742383218819655\n20000919 00:00,1451300,1463100,1447000,1460800,0.010656292722446276\n20000920 00:00,1456900,1460300,1431600,1452200,0.008788434764897898\n20000921 00:00,1444700,1455600,1437500,1450300,0.003481893815757646\n20000922 00:00,1426300,1451600,1421300,1451600,0.003481893815757646\n20000925 00:00,1459400,1460600,1437200,1441300,0.0041657175809744155\n20000926 00:00,1443800,1450000,1426300,1428900,0.0064385644152491\n20000927 00:00,1435600,1439700,1421300,1428100,0.0064466733276858645\n20000928 00:00,1431900,1463300,1428900,1461900,0.004977649621780211\n20000929 00:00,1454700,1459700,1437500,1437800,0.00952333498604965\n20001002 00:00,1442800,1449100,1431400,1438100,0.009517847655427824\n20001003 00:00,1445300,1457500,1425300,1426300,0.010631631132154077\n20001004 00:00,1428800,1442500,1417500,1435800,0.004737315330253501\n20001005 00:00,1434100,1448400,1433100,1438800,0.004737315330253501\n20001006 00:00,1438800,1446400,1397500,1410000,0.011556635913720588\n20001009 00:00,1413100,1413100,1393800,1404400,0.01178192620585688\n20001010 00:00,1400900,1412500,1385600,1388800,0.013414268892808884\n20001011 00:00,1376300,1386300,1351300,1365600,0.011807055282197908\n20001012 00:00,1372800,1433800,1327800,1331600,0.018460140547204684\n20001013 00:00,1329400,1376600,1328800,1375600,0.017310342694881218\n20001016 00:00,1374100,1390000,1366900,1374700,0.014379529596909996\n20001017 00:00,1384400,1385600,1344100,1354800,0.008366188327266422\n20001018 00:00,1326300,1361300,1301600,1344100,0.00952812105108372\n20001019 00:00,1368400,1394500,1364400,1390500,0.009520630514799311\n20001020 00:00,1383800,1411900,1383800,1398800,0.004559822763750342\n20001023 00:00,1399400,1410300,1389400,1400000,0.0\n20001024 00:00,1409700,1419400,1390000,1401300,0.0\n20001025 00:00,1387500,1395600,1363900,1369200,0.013225536031532831\n20001026 00:00,1371300,1376600,1340000,1367500,0.013244948506827626\n20001027 00:00,1378800,1388400,1366300,1383800,0.013244948506827626\n20001030 00:00,1384400,1410900,1381600,1402500,0.0007168386339631718\n20001031 00:00,1410200,1436900,1400600,1429700,0.0\n20001101 00:00,1422500,1432500,1412200,1424100,0.0022614265282660164\n20001102 00:00,1431600,1439100,1425200,1430300,0.0022614265282660164\n20001103 00:00,1434700,1437500,1423800,1431100,0.0022614265282660164\n20001106 00:00,1431600,1443000,1430300,1437000,0.0\n20001107 00:00,1431400,1440000,1425600,1436600,0.00016070988703953913\n20001108 00:00,1440600,1440600,1410300,1412500,0.009686799947276323\n20001109 00:00,1400000,1412200,1372500,1404100,0.010277287755728252\n20001110 00:00,1390000,1394700,1368800,1369700,0.017483561268915603\n20001113 00:00,1356300,1369800,1330200,1353800,0.016024506918536584\n20001114 00:00,1374700,1396300,1370000,1387500,0.01565235674225251\n20001115 00:00,1390600,1401100,1377500,1391300,0.00670210212463682\n20001116 00:00,1385800,1398800,1373100,1377700,0.005643616517630226\n20001117 00:00,1373100,1390000,1357500,1374700,0.005781952166816491\n20001120 00:00,1357500,1363800,1343800,1346900,0.01302876588548804\n20001121 00:00,1348800,1361900,1335200,1351600,0.0117430120965955\n20001122 00:00,1343400,1348800,1324400,1325000,0.016291824320144675\n20001124 00:00,1336300,1349700,1335600,1348400,0.011362472003879898\n20001127 00:00,1364700,1366900,1353100,1355000,0.011362472003879898\n20001128 00:00,1351300,1365900,1338100,1338100,0.007200900036387206\n20001129 00:00,1343800,1359100,1332700,1346400,0.007200900036387206\n20001130 00:00,1325000,1335000,1297500,1316300,0.01478000550424807\n20001201 00:00,1331900,1340600,1310000,1318800,0.01290719184685662\n20001204 00:00,1318800,1338800,1315000,1330000,0.01290719184685662\n20001205 00:00,1348800,1381900,1344100,1381300,0.0\n20001206 00:00,1377800,1383400,1350300,1355300,0.01086737638379084\n20001207 00:00,1348800,1358800,1343800,1349800,0.011117075841182355\n20001208 00:00,1370600,1391300,1360900,1376600,0.011117075841182355\n20001211 00:00,1373800,1488800,1367200,1386300,0.0023429694389013093\n20001212 00:00,1381900,1392500,1373800,1377500,0.003664922721538445\n20001213 00:00,1392500,1394100,1362500,1365300,0.0062911252305628855\n20001214 00:00,1358800,1365000,1341900,1341900,0.011725800422545549\n20001215 00:00,1331300,1332500,1305600,1314500,0.016218466616143\n20001218 00:00,1110000,1334700,1110000,1323800,0.01539129823202607\n20001219 00:00,1324700,1349700,1305000,1305600,0.014212008180853218\n20001220 00:00,1286300,1289400,1239400,1266900,0.018864754615623473\n20001221 00:00,1260000,1288600,1255300,1276900,0.018864754615623473\n20001222 00:00,1290000,1308600,1288400,1308600,0.01711355347551971\n20001226 00:00,1308400,1319400,1302800,1318900,0.0\n20001227 00:00,1320000,1336600,1312500,1331300,0.0\n20001228 00:00,1328100,1338100,1325900,1336100,0.0\n20001229 00:00,1340600,1342800,1318800,1322500,0.005876778430490945\n20010102 00:00,1320000,1321600,1275600,1282500,0.018424754789070248\n20010103 00:00,1283100,1360000,1276600,1350000,0.018424754789070248\n20010104 00:00,1349400,1354700,1330000,1334100,0.018739630397738787\n20010105 00:00,1334700,1336300,1292800,1302500,0.015272640707947479\n20010108 00:00,1298800,1300600,1276300,1297500,0.01543261513727858\n20010109 00:00,1310500,1315000,1296300,1301300,0.01385376940936249\n20010110 00:00,1290000,1318100,1288100,1316600,0.0022163158126281193\n20010111 00:00,1310900,1334800,1310900,1327700,0.0\n20010112 00:00,1326900,1337200,1312800,1319100,0.0037397095089483938\n20010116 00:00,1320000,1331900,1315200,1325800,0.0037397095089483938\n20010117 00:00,1348400,1350500,1326400,1329400,0.0037397095089483938\n20010118 00:00,1334400,1357000,1329400,1350500,0.0\n20010119 00:00,1361900,1361900,1338800,1344800,0.002436798618571528\n20010122 00:00,1342500,1357800,1335600,1346300,0.002436798618571528\n20010123 00:00,1344700,1366600,1341600,1361300,0.002436798618571528\n20010124 00:00,1362500,1373100,1358400,1366900,0.0\n20010125 00:00,1362500,1372500,1356600,1360600,0.0026609896085263486\n20010126 00:00,1351600,1361300,1344500,1357800,0.0029141959332187007\n20010129 00:00,1355000,1369000,1353700,1366500,0.0029141959332187007\n20010130 00:00,1363000,1379200,1357900,1377500,0.0011881381403284735\n20010131 00:00,1374000,1387000,1366000,1370600,0.0028919904590986437\n20010201 00:00,1371000,1375600,1362500,1374800,0.0028919904590986437\n20010202 00:00,1374000,1379900,1350000,1350800,0.010485555644353415\n20010205 00:00,1348000,1359000,1347500,1358900,0.010078852531678107\n20010206 00:00,1353000,1367000,1352200,1354200,0.010274763113661215\n20010207 00:00,1347200,1354200,1336800,1342200,0.0054919779123664865\n20010208 00:00,1348000,1354000,1334800,1334800,0.006347764474618571\n20010209 00:00,1333500,1333500,1312600,1318300,0.009340309526051414\n20010212 00:00,1317000,1335000,1317000,1331400,0.007814540891124976\n20010213 00:00,1337000,1341700,1320000,1321200,0.008396365400316276\n20010214 00:00,1326500,1326500,1306600,1321500,0.004423143116820008\n20010215 00:00,1328400,1335200,1319900,1329600,0.004423143116820008\n20010216 00:00,1310000,1312900,1293000,1304600,0.010855713545232138\n20010220 00:00,1310400,1311400,1281000,1283200,0.014406181642853715\n20010221 00:00,1279000,1288400,1255200,1256000,0.018902621817645956\n20010222 00:00,1263500,1265400,1230200,1255200,0.01547894786460915\n20010223 00:00,1250800,1255400,1218000,1248900,0.012581870453347358\n20010226 00:00,1258000,1272100,1245000,1272100,0.0029210309910655914\n20010227 00:00,1268000,1278400,1255100,1263500,0.004861261488401433\n20010228 00:00,1267500,1268400,1232700,1241500,0.010783939521068668\n20010301 00:00,1240500,1245000,1217500,1244900,0.010783939521068668\n20010302 00:00,1225000,1256500,1223000,1237700,0.010592859707141454\n20010305 00:00,1241500,1247800,1238100,1244000,0.0033391613287535463\n20010306 00:00,1263500,1277500,1254900,1258700,0.0033391613287535463\n20010307 00:00,1269000,1269000,1257600,1266400,0.0\n20010308 00:00,1266000,1272400,1261000,1269000,0.0\n20010309 00:00,1261000,1261000,1231100,1236700,0.014695361461642947\n20010312 00:00,1223400,1245000,1177000,1184400,0.028497380608421215\n20010313 00:00,1194000,1204400,1175300,1202000,0.028497380608421215\n20010314 00:00,1170500,1192900,1157500,1172000,0.028351149433539325\n20010315 00:00,1184500,1188600,1175100,1177100,0.01440974049558133\n20010316 00:00,1171300,1185000,1144600,1153100,0.01860678128480259\n20010319 00:00,1157600,1176900,1148200,1173000,0.011771647659970269\n20010320 00:00,1179000,1184600,1141500,1142500,0.019077069397142335\n20010321 00:00,1141800,1152600,1119000,1123400,0.01784723106307513\n20010322 00:00,1120200,1157000,1080400,1119000,0.017989917211677628\n20010323 00:00,1132500,1144800,1115000,1142500,0.009913336125145451\n20010326 00:00,1157000,1162700,1147700,1155000,0.0022612971198453986\n20010327 00:00,1156200,1186500,1152500,1185100,0.0\n20010328 00:00,1169000,1175000,1149000,1154500,0.014907533741627359\n20010329 00:00,1147000,1166000,1093400,1149800,0.01509168582224755\n20010330 00:00,1155500,1166500,1145000,1161200,0.01509168582224755\n20010402 00:00,1163000,1173800,1138000,1145400,0.00819986171632629\n20010403 00:00,1139800,1141500,1101000,1106700,0.021029528048431716\n20010404 00:00,1105800,1121000,1093000,1103100,0.021113223342719544\n20010405 00:00,1133000,1154900,1125000,1152200,0.019597318348497417\n20010406 00:00,1139900,1144000,1120600,1130500,0.011034544581213047\n20010409 00:00,1140000,1154800,1127800,1140000,0.010873546989598056\n20010410 00:00,1154500,1177500,1151700,1170900,0.010873546989598056\n20010411 00:00,1187800,1189900,1161400,1169600,0.0006410072166252477\n20010412 00:00,1163000,1186300,1159600,1185500,0.0006410072166252477\n20010416 00:00,1182900,1188900,1169100,1182300,0.0016851112213861074\n20010417 00:00,1173100,1196600,1170200,1194200,0.001558431768373493\n20010418 00:00,1210600,1260000,1206900,1241400,0.001558431768373493\n20010419 00:00,1242500,1258300,1200000,1257200,0.0\n20010420 00:00,1249000,1254000,1236600,1243600,0.006245596294128944\n20010423 00:00,1236500,1263000,1219100,1227000,0.009919689072816025\n20010424 00:00,1225200,1237000,1211000,1211300,0.012368291136586775\n20010425 00:00,1214200,1236700,1209500,1231000,0.010675539919373339\n20010426 00:00,1237300,1252200,1235000,1237400,0.007387448432173675\n20010427 00:00,1249200,1256800,1242000,1255500,0.0\n20010430 00:00,1264500,1272700,1246700,1252100,0.0015635132737911131\n20010501 00:00,1250700,1269700,1246000,1269500,0.0015635132737911131\n20010502 00:00,1274100,1276900,1260000,1268900,0.0015871460309404264\n20010503 00:00,1261300,1261500,1242200,1251600,0.00787623870343485\n20010504 00:00,1236500,1272000,1234400,1269500,0.00787623870343485\n20010507 00:00,1268600,1274700,1255300,1265700,0.008058988844258258\n20010508 00:00,1268600,1271000,1255600,1265200,0.0017431701778716743\n20010509 00:00,1252500,1266000,1250600,1258700,0.0034404513900275244\n20010510 00:00,1272600,1275000,1257700,1259900,0.0029749087250770206\n20010511 00:00,1260000,1264900,1244000,1248200,0.0061273259079510055\n20010514 00:00,1249000,1254400,1244600,1252300,0.005361535161138687\n20010515 00:00,1255500,1265000,1248500,1253000,0.005361535161138687\n20010516 00:00,1248400,1292000,1246200,1289600,0.0\n20010517 00:00,1290100,1300800,1285600,1293100,0.0\n20010518 00:00,1290900,1297200,1281000,1296200,0.0\n20010521 00:00,1298400,1318000,1291500,1317700,0.0\n20010522 00:00,1318300,1320900,1310700,1313700,0.0017526000430739188\n20010523 00:00,1310500,1310500,1292900,1292900,0.009307760901120433\n20010524 00:00,1294700,1300000,1249000,1297000,0.009307760901120433\n20010525 00:00,1296500,1297000,1280100,1282300,0.011241952881522336\n20010529 00:00,1282300,1283500,1269000,1273000,0.00776865927313731\n20010530 00:00,1265900,1275300,1250000,1252900,0.011977251770623136\n20010531 00:00,1254300,1267600,1252600,1261000,0.01003174269346908\n20010601 00:00,1262000,1271000,1251200,1266400,0.009116056881941488\n20010604 00:00,1268000,1272700,1258900,1271700,0.0\n20010605 00:00,1274900,1292300,1272700,1288700,0.0\n20010606 00:00,1288300,1288300,1273600,1275300,0.0060033317351912705\n20010607 00:00,1270500,1282900,1270000,1282400,0.0060033317351912705\n20010608 00:00,1277000,1278700,1261400,1270000,0.008197899947305895\n20010611 00:00,1267100,1277500,1254100,1259400,0.0073747328583600915\n20010612 00:00,1248600,1268800,1240400,1261300,0.0073747328583600915\n20010613 00:00,1261700,1265800,1246700,1247400,0.00798147902251133\n20010614 00:00,1241800,1243000,1222400,1224800,0.012243354452910485\n20010615 00:00,1209100,1224000,1204000,1216200,0.012897046340541394\n20010618 00:00,1216500,1224400,1209500,1210800,0.01150748822583283\n20010619 00:00,1223800,1228900,1208600,1214600,0.004796399825491405\n20010620 00:00,1211900,1228600,1211000,1226000,0.002563469374793624\n20010621 00:00,1222200,1274700,1221500,1238600,0.0\n20010622 00:00,1234900,1236000,1221600,1227500,0.005174057797517253\n20010625 00:00,1232800,1234400,1215000,1221300,0.005939258644400506\n20010626 00:00,1209000,1229000,1200300,1218400,0.0060954277947742105\n20010627 00:00,1216000,1251500,1209100,1213100,0.004085433967498132\n20010628 00:00,1220000,1239400,1219300,1228900,0.0028612674725985473\n20010629 00:00,1228000,1240100,1222600,1232000,0.002511454716599649\n20010702 00:00,1228000,1243200,1226200,1239000,0.0\n20010703 00:00,1239800,1241000,1230500,1240800,0.0\n20010705 00:00,1230700,1236500,1221100,1221300,0.009073444752738287\n20010706 00:00,1213100,1215800,1190500,1191900,0.01659796711734475\n20010709 00:00,1194900,1205400,1192000,1201000,0.01659796711734475\n20010710 00:00,1202900,1206400,1182100,1183500,0.01624617838050147\n20010711 00:00,1181000,1190400,1170900,1182700,0.008421728269247386\n20010712 00:00,1195000,1214700,1193100,1211600,0.008421728269247386\n20010713 00:00,1208400,1223200,1206200,1219000,0.00039026634165753934\n20010716 00:00,1217700,1222800,1202900,1206000,0.006157139868306123\n20010717 00:00,1202000,1219400,1198300,1216700,0.006157139868306123\n20010718 00:00,1205600,1216400,1200600,1211000,0.006725040140768717\n20010719 00:00,1221800,1229800,1207600,1218300,0.0027047723632619767\n20010720 00:00,1211500,1219400,1209200,1214500,0.0032494188109974263\n20010723 00:00,1218000,1218800,1192200,1193600,0.010097344571284177\n20010724 00:00,1190000,1192000,1167500,1173900,0.013883730885739815\n20010725 00:00,1179200,1194800,1174600,1193000,0.013766446681531423\n20010726 00:00,1190600,1208500,1185600,1207500,0.009528988189540568\n20010727 00:00,1208300,1216000,1199100,1210000,0.0\n20010730 00:00,1211900,1213500,1203000,1208200,0.0008588681690424182\n20010731 00:00,1210000,1226800,1201800,1214600,0.0008588681690424182\n20010801 00:00,1219700,1227000,1209000,1219600,0.0008588681690424182\n20010802 00:00,1232300,1233500,1214600,1223800,0.0\n20010803 00:00,1223600,1223700,1202000,1218700,0.0024060192620257294\n20010806 00:00,1213500,1215100,1201000,1204500,0.0071444686960851125\n20010807 00:00,1202700,1215300,1199100,1208300,0.0071444686960851125\n20010808 00:00,1201200,1211600,1184300,1186500,0.01239990375080351\n20010809 00:00,1187000,1189700,1178600,1187400,0.010416482552622534\n20010810 00:00,1188000,1198400,1173400,1194400,0.010416482552622534\n20010813 00:00,1196000,1198500,1188200,1194900,0.0\n20010814 00:00,1201400,1203500,1188000,1191100,0.0018360791889869873\n20010815 00:00,1192300,1196100,1181600,1182800,0.004422346374626652\n20010816 00:00,1178000,1187500,1170000,1186200,0.004422346374626652\n20010817 00:00,1176500,1178700,1160100,1166400,0.010443168860848243\n20010820 00:00,1168000,1176600,1165500,1175600,0.009637106162497536\n20010821 00:00,1178000,1185400,1080500,1161300,0.011924545758956295\n20010822 00:00,1167500,1174300,1157800,1170500,0.007022889460200452\n20010823 00:00,1169600,1175200,1165200,1167000,0.00723196783896468\n20010824 00:00,1172100,1191000,1166500,1190000,0.0017263784213273953\n20010827 00:00,1189700,1192000,1182600,1184900,0.0030170898947855123\n20010828 00:00,1182800,1184900,1165900,1166400,0.00934767769686934\n20010829 00:00,1171300,1171800,1151700,1154000,0.011182656588658888\n20010830 00:00,1148500,1159100,1120100,1132800,0.015212686074591988\n20010831 00:00,1134000,1147700,1131300,1139200,0.012254353849107202\n20010904 00:00,1138500,1167900,1134400,1136500,0.010694339219990894\n20010905 00:00,1137000,1141900,1119500,1136500,0.0013683687910919715\n20010906 00:00,1126500,1133000,1110900,1111000,0.01302625641197219\n20010907 00:00,1100200,1112500,1086900,1091300,0.016511092724770242\n20010910 00:00,1077000,1110700,1075500,1098300,0.016511092724770242\n20010917 00:00,1010000,1065100,1000000,1043000,0.030819868235502965\n20010918 00:00,1043300,1053000,1033600,1039000,0.029154101928473824\n20010919 00:00,1041000,1045000,985600,1020200,0.03096928288359246\n20010920 00:00,1004000,1018500,985700,989600,0.020345020319684277\n20010921 00:00,940500,997000,938000,968500,0.02367606731928014\n20010924 00:00,997300,1011600,990600,1004800,0.021246678343660053\n20010925 00:00,1007500,1020000,999000,1014000,0.0123101158851062\n20010926 00:00,1023500,1024000,1004300,1010000,0.0022775158547914346\n20010927 00:00,1012500,1022500,1000000,1020500,0.0022775158547914346\n20010928 00:00,1029800,1099200,1025000,1042500,0.0022775158547914346\n20011001 00:00,1039000,1043200,1024200,1040000,0.0013845330196393818\n20011002 00:00,1040000,1053800,1030700,1053800,0.0013845330196393818\n20011003 00:00,1046000,1078800,1043500,1073400,0.0013845330196393818\n20011004 00:00,1082900,1089700,1043700,1071000,0.0012908893665502857\n20011005 00:00,1072500,1076200,1055200,1072600,0.0012908893665502857\n20011008 00:00,1062800,1073000,1058700,1065300,0.0041359946422250965\n20011009 00:00,1066100,1067500,1056000,1058700,0.005313618346724825\n20011010 00:00,1058000,1085500,1055200,1084000,0.005313618346724825\n20011011 00:00,1089500,1103000,1089500,1100100,0.0035769377420928872\n20011012 00:00,1091500,1098900,1073000,1094500,0.0029389705549149256\n20011015 00:00,1086300,1094500,1071900,1093000,0.003043620833805936\n20011016 00:00,1098000,1106200,1089500,1100600,0.003043620833805936\n20011017 00:00,1110700,1111500,1079000,1079000,0.011358472905298874\n20011018 00:00,1078200,1081600,1067400,1072100,0.01191721549837177\n20011019 00:00,1070000,1079200,1060100,1075500,0.01191721549837177\n20011022 00:00,1073000,1094900,1072100,1092600,0.003692045280267331\n20011023 00:00,1099600,1106100,1083800,1088000,0.002430726009767769\n20011024 00:00,1089800,1099400,1081200,1087700,0.0024359335483620202\n20011025 00:00,1074500,1103300,1067400,1103100,0.0024359335483620202\n20011026 00:00,1099500,1118000,1096400,1107700,0.00015919584628388758\n20011029 00:00,1101600,1105500,1080600,1082300,0.013238870486067072\n20011030 00:00,1073500,1077000,1055600,1062000,0.01710364311654275\n20011031 00:00,1069000,1078600,1060100,1062700,0.01710364311654275\n20011101 00:00,1066000,1090100,1054300,1086700,0.010828984999121681\n20011102 00:00,1084400,1093800,1078700,1090600,0.0\n20011105 00:00,1101200,1110900,1007400,1105800,0.0\n20011106 00:00,1103500,1124500,1098500,1122900,0.0\n20011107 00:00,1117700,1131200,1115600,1119600,0.0016967280152514002\n20011108 00:00,1128700,1226600,1104500,1123500,0.0016967280152514002\n20011109 00:00,1122500,1129600,1114400,1124400,0.0016967280152514002\n20011112 00:00,1110000,1126500,1100000,1121600,0.0014377274579606576\n20011113 00:00,1134400,1144300,1131800,1143900,0.0014377274579606576\n20011114 00:00,1151700,1154000,1137000,1146200,0.0014377274579606576\n20011115 00:00,1143700,1151800,1139300,1146000,0.0001007416278467123\n20011116 00:00,1150800,1151000,1134000,1143100,0.0014644776590139318\n20011119 00:00,1149200,1155700,1144500,1155300,0.0014644776590139318\n20011120 00:00,1153700,1158000,1111500,1148100,0.0038834392061436497\n20011121 00:00,1145000,1146700,1135100,1141500,0.004895112807894945\n20011123 00:00,1140400,1186300,1140000,1155200,0.004895112807894945\n20011126 00:00,1157500,1163400,1150700,1162200,0.003318972020426389\n20011127 00:00,1156200,1169000,1140900,1154000,0.004073543458402121\n20011128 00:00,1147400,1151700,1132500,1133400,0.011082084630817638\n20011129 00:00,1136600,1145600,1130000,1144800,0.011082084630817638\n20011130 00:00,1144000,1149100,1140200,1143000,0.010346154562681963\n20011203 00:00,1136500,1140800,1130100,1133600,0.00483411239173293\n20011204 00:00,1139200,1150000,1133500,1150000,0.00483411239173293\n20011205 00:00,1156100,1180000,1155600,1176400,0.004748112450028415\n20011206 00:00,1173500,1179400,1169300,1173000,0.0016686423965018237\n20011207 00:00,1169000,1170900,1157000,1164500,0.004504186172803425\n20011210 00:00,1158500,1163900,1144600,1144600,0.01084578069399073\n20011211 00:00,1149000,1157200,1139000,1141900,0.0108028421579215\n20011212 00:00,1145500,1147800,1131100,1142900,0.009959822943059573\n20011213 00:00,1134500,1137000,1122800,1123600,0.00984429936903484\n20011214 00:00,1123300,1134900,1120000,1129000,0.009749637059550082\n20011217 00:00,1129900,1143600,1129000,1139900,0.009749637059550082\n20011218 00:00,1146300,1151500,1143400,1149300,0.0\n20011219 00:00,1140900,1159200,1140000,1155000,0.0\n20011220 00:00,1155000,1158000,1146300,1146900,0.00404894993977141\n20011221 00:00,1150300,1151000,1142000,1146600,0.0040517653830282165\n20011224 00:00,1148300,1150400,1146100,1147300,0.0040517653830282165\n20011226 00:00,1146500,1162100,1146500,1152500,0.00015102021166350535\n20011227 00:00,1153000,1163300,1152600,1159300,0.0\n20011228 00:00,1162900,1167500,1159500,1162100,0.0\n20011231 00:00,1161500,1164000,1148500,1148900,0.006557975693402513\n20020102 00:00,1151100,1156500,1138100,1155900,0.006557975693402513\n20020103 00:00,1156500,1168300,1150000,1167600,0.006557975693402513\n20020104 00:00,1171700,1179800,1133600,1174100,0.0\n20020107 00:00,1177000,1179900,1157100,1167000,0.0034913439325835313\n20020108 00:00,1168000,1170600,1159700,1163600,0.0038754207295274095\n20020109 00:00,1166800,1199100,1153400,1157000,0.0050737505600822585\n20020110 00:00,1157000,1163500,1153000,1159600,0.0036815027217628393\n20020111 00:00,1162100,1162800,1147100,1147700,0.006769640354406685\n20020114 00:00,1146500,1148400,1141000,1141200,0.006767253442166706\n20020115 00:00,1145500,1153900,1139000,1148800,0.006767253442166706\n20020116 00:00,1143000,1144000,1130000,1130500,0.009760968072589391\n20020117 00:00,1137600,1142400,1134000,1141300,0.00919699680202834\n20020118 00:00,1130000,1138700,1113600,1130800,0.01062065433341145\n20020122 00:00,1137500,1139500,1120200,1122500,0.006794981240661684\n20020123 00:00,1126300,1135600,1120200,1131400,0.006794981240661684\n20020124 00:00,1136400,1142500,1133200,1135400,0.004237714214957431\n20020125 00:00,1131200,1141800,1130400,1135900,0.0\n20020128 00:00,1139000,1141900,989200,1136300,0.0\n20020129 00:00,1138500,1144100,1100500,1102800,0.017021239125101183\n20020130 00:00,1103900,1133900,1084000,1116100,0.017021239125101183\n20020131 00:00,1121500,1132700,1116200,1132400,0.017021239125101183\n20020201 00:00,1130900,1137000,1115500,1126000,0.003263018123290013\n20020204 00:00,1122300,1151800,1094500,1097000,0.01522340237760739\n20020205 00:00,1094000,1105000,1085300,1092700,0.015390696591081195\n20020206 00:00,1096500,1097400,1080600,1087000,0.015339382550094037\n20020207 00:00,1087200,1098600,1081600,1083800,0.004132889856272431\n20020208 00:00,1086300,1100500,1083000,1099700,0.0034582100797816715\n20020211 00:00,1100500,1116300,1098200,1115900,0.0016996512064459967\n20020212 00:00,1109600,1117100,1106200,1111100,0.0024834494955732755\n20020213 00:00,1114800,1125400,1113500,1122600,0.0024834494955732755\n20020214 00:00,1125100,1129700,1115900,1119800,0.002870751763709249\n20020215 00:00,1121500,1122400,1107100,1108300,0.006101574563029733\n20020219 00:00,1101500,1103000,1002000,1087400,0.012480663218581297\n20020220 00:00,1090500,1103800,1078200,1103200,0.01239730858226379\n20020221 00:00,1099300,1109900,1084000,1086000,0.014126721209759288\n20020222 00:00,1083500,1099400,1078700,1093700,0.009001472652340081\n20020225 00:00,1097500,1118100,1097000,1115000,0.009001472652340081\n20020226 00:00,1116000,1120400,1101900,1113600,0.0007249241048120575\n20020227 00:00,1119600,1128600,1106500,1115500,0.0007249241048120575\n20020228 00:00,1118300,1127500,1111400,1111900,0.0019993084324735097\n20020301 00:00,1117200,1137300,1115100,1136600,0.0018632550148656836\n20020304 00:00,1139000,1159900,1136500,1159300,0.0018632550148656836\n20020305 00:00,1153300,1164000,1149700,1152100,0.0035857171898260485\n20020306 00:00,1151000,1177100,1150800,1168100,0.0035857171898260485\n20020307 00:00,1173600,1175000,1125300,1163300,0.004299532294324584\n20020308 00:00,1173800,1273000,1164800,1168900,0.002372469216771\n20020311 00:00,1168900,1179000,1164300,1173400,0.002372469216771\n20020312 00:00,1161100,1171200,1159400,1171000,0.0011808766371698201\n20020313 00:00,1166300,1167500,1150000,1159000,0.006033179697820131\n20020314 00:00,1160400,1164300,1156300,1158600,0.0060364692533145725\n20020315 00:00,1159700,1169500,1062200,1167900,0.0059198387996632715\n20020318 00:00,1171000,1175700,1158500,1167600,0.0002483909611032974\n20020319 00:00,1173000,1177400,1168200,1173500,0.00014830471851777185\n20020320 00:00,1165000,1172500,1153900,1154300,0.009447372182984637\n20020321 00:00,1153000,1159000,1141200,1156000,0.009446208068547785\n20020322 00:00,1155000,1159400,1147000,1150900,0.009783595256737353\n20020325 00:00,1150900,1153600,1133800,1134300,0.008708250224585835\n20020326 00:00,1135200,1150200,1134700,1140800,0.008708250224585835\n20020327 00:00,1140300,1150100,1130000,1146700,0.008327408522502237\n20020328 00:00,1149700,1157700,1146800,1149100,0.0\n20020401 00:00,1142300,1151000,1129600,1148300,0.0004019495390755082\n20020402 00:00,1139800,1441200,1137700,1139300,0.004542899574624481\n20020403 00:00,1140100,1162000,1121500,1127400,0.007550100341439269\n20020404 00:00,1126000,1155300,1122300,1128900,0.007539393326643619\n20020405 00:00,1131900,1136700,1121800,1125300,0.006305225505238696\n20020408 00:00,1113200,1128800,1112300,1128100,0.001841138248810909\n20020409 00:00,1131900,1131900,1119300,1120500,0.004303348436477695\n20020410 00:00,1121000,1135400,1120900,1133500,0.0038896037991677924\n20020411 00:00,1128900,1130500,1105000,1107200,0.013949213570233718\n20020412 00:00,1110300,1119700,1105700,1113300,0.013395952430248922\n20020415 00:00,1116200,1119700,1102000,1106300,0.01387910548064298\n20020416 00:00,1117000,1133200,1116700,1131200,0.003630155289973418\n20020417 00:00,1133900,1136700,1126000,1130500,0.003647693811723853\n20020418 00:00,1129000,1134600,1111500,1127600,0.0015235230077942498\n20020419 00:00,1132000,1132400,1125600,1128500,0.0015235230077942498\n20020422 00:00,1123800,1126100,1108400,1111400,0.008872984047008788\n20020423 00:00,1110900,1119000,1101700,1103800,0.009598096681924548\n20020424 00:00,1105600,1112400,1095100,1095900,0.010449790582261184\n20020425 00:00,1092100,1104300,1087200,1094300,0.005776874401812557\n20020426 00:00,1097900,1100100,1079000,1079500,0.008874516038202199\n20020429 00:00,1079300,1082600,1066300,1069200,0.00959316538780204\n20020430 00:00,1070200,1087500,1066400,1079800,0.009556060969801305\n20020501 00:00,1079700,1092500,1068000,1089600,0.005508761253036701\n20020502 00:00,1091000,1099100,1082000,1087700,0.0010067598306353605\n20020503 00:00,1086000,1089500,1072000,1076700,0.0059249511048652835\n20020506 00:00,1076500,1089000,1055100,1056200,0.012487643515704484\n20020507 00:00,1061100,1063200,1050000,1052300,0.012628241531763158\n20020508 00:00,1070500,1093600,1067900,1091600,0.011197365937848263\n20020509 00:00,1086500,1091000,1075800,1076500,0.008266069410487664\n20020510 00:00,1079700,1080500,1057200,1059800,0.012000136339049353\n20020513 00:00,1062200,1079500,1057800,1078200,0.012000136339049353\n20020514 00:00,1096200,1102600,1090000,1100900,0.008956571756123294\n20020515 00:00,1095000,1109100,1092900,1095500,0.002831947909550373\n20020516 00:00,1097000,1104300,1093300,1103500,0.002831947909550373\n20020517 00:00,1106600,1111700,1101000,1111100,0.002831947909550373\n20020520 00:00,1106400,1106900,1094900,1096400,0.0076384204455831805\n20020521 00:00,1101100,1104900,1082900,1084800,0.009780499289832044\n20020522 00:00,1082200,1091200,1080000,1090500,0.009780499289832044\n20020523 00:00,1092600,1102400,1084800,1101600,0.0061084121877049155\n20020524 00:00,1099800,1102100,1086600,1088500,0.006865730325330521\n20020528 00:00,1090500,1099400,1074500,1079000,0.008516374015722722\n20020529 00:00,1076300,1080200,1072500,1072500,0.0091991959139433\n20020530 00:00,1065500,1075100,1059000,1070100,0.006257487182610358\n20020531 00:00,1074000,1085600,1070800,1072300,0.003710225379275346\n20020603 00:00,1070900,1088800,1042500,1043000,0.015828589676355684\n20020604 00:00,1041500,1052000,1032800,1044100,0.015775774398261683\n20020605 00:00,1049500,1056200,1043500,1055000,0.015775774398261683\n20020606 00:00,1055400,1246700,1031500,1034200,0.01138282995179548\n20020607 00:00,1017900,1039200,1017200,1032600,0.011417821438033745\n20020610 00:00,1032400,1044600,1030200,1035600,0.011417821438033745\n20020611 00:00,1041300,1045400,1017600,1018900,0.009353051127456838\n20020612 00:00,1017100,1029700,1007800,1026400,0.009310302718681652\n20020613 00:00,1021300,1030000,1013400,1015000,0.011304951627851959\n20020614 00:00,1003100,1015600,985000,1012900,0.006522811308407818\n20020617 00:00,1019200,1042900,1004700,1041900,0.006522811308407818\n20020618 00:00,1037400,1047400,1029200,1042400,0.0011945177983233404\n20020619 00:00,1035000,1044800,1022600,1025400,0.009415727720859204\n20020620 00:00,1022700,1030500,1009600,1012000,0.012065685021504131\n20020621 00:00,1004700,1012000,986900,991900,0.016645598078873912\n20020624 00:00,986100,1006900,972500,996900,0.013726616731374649\n20020625 00:00,1003000,1008900,975400,979000,0.015458453554025888\n20020626 00:00,952000,981500,952000,976200,0.010497392824184092\n20020627 00:00,985000,994500,965700,994500,0.010497392824184092\n20020628 00:00,992400,1005000,990200,992500,0.0020186064703136505\n20020701 00:00,991900,1015000,969500,970800,0.012676460869291833\n20020702 00:00,968700,980800,947700,950200,0.017629047461974294\n20020703 00:00,946200,958400,937300,956900,0.017590770094656687\n20020705 00:00,967800,995500,966700,993000,0.01225114909899701\n20020708 00:00,989800,997000,975600,980300,0.007384036675436306\n20020709 00:00,977300,983400,950100,956100,0.01605185776786017\n20020710 00:00,960000,960700,922000,922900,0.02568248724337558\n20020711 00:00,917600,933500,900600,931500,0.024598092474457465\n20020712 00:00,933300,938900,915200,924600,0.020499217254315864\n20020715 00:00,916400,1016000,878900,921000,0.004831480637591035\n20020716 00:00,911300,923800,898700,905800,0.010683398913922866\n20020717 00:00,924600,933000,897500,910000,0.009790051967221805\n20020718 00:00,907000,911000,882400,883300,0.019435789257213034\n20020719 00:00,867700,884000,843000,848000,0.028623867549199714\n20020722 00:00,841100,859100,814500,822100,0.033619532047639025\n20020723 00:00,825500,832400,788500,800000,0.032927225657605086\n20020724 00:00,781400,849400,776800,847500,0.023491157759483135\n20020725 00:00,842800,858500,816000,842000,0.015966401619905424\n20020726 00:00,846500,856900,838000,856000,0.003746815906245335\n20020729 00:00,875100,903400,845400,902300,0.003746815906245335\n20020730 00:00,893200,914000,887000,907000,0.0\n20020731 00:00,905000,914500,889300,913800,0.0\n20020801 00:00,908800,913500,884600,886400,0.017311662700586313\n20020802 00:00,885000,889200,852900,866600,0.021587395385953858\n20020805 00:00,865000,869300,836000,837300,0.029104311468237352\n20020806 00:00,852300,879000,848800,864000,0.023395881701301635\n20020807 00:00,878800,885000,857700,881500,0.019520381822358657\n20020808 00:00,884200,911000,878000,909800,0.0\n20020809 00:00,901000,919400,893500,912600,0.0\n20020812 00:00,900000,912700,895500,907000,0.0035428024407866835\n20020813 00:00,901500,916600,886700,887500,0.012908403505557019\n20020814 00:00,890200,926300,880100,924100,0.012908403505557019\n20020815 00:00,928500,939900,903000,934000,0.012412712512897116\n20020816 00:00,928200,940800,920000,932200,0.001112666471671664\n20020819 00:00,934600,957500,931000,955200,0.001112666471671664\n20020820 00:00,948200,958000,936200,942700,0.007636849321863815\n20020821 00:00,950600,957500,931000,955000,0.007555358422184188\n20020822 00:00,954900,975000,950700,967600,0.007555358422184188\n20020823 00:00,960200,961500,922500,945200,0.013365694532707318\n20020826 00:00,949100,956400,935000,952800,0.013365694532707318\n20020827 00:00,957000,962500,935100,939000,0.015766005920019293\n20020828 00:00,932900,951500,918000,923000,0.012911451412607251\n20020829 00:00,912700,930600,908100,923000,0.012911451412607251\n20020830 00:00,916900,933900,914000,921000,0.009916930013949108\n20020903 00:00,907400,913500,881500,882100,0.024417439052421868\n20020904 00:00,886200,902500,880600,897500,0.024417439052421868\n20020905 00:00,884900,894300,875000,884700,0.025738031512260773\n20020906 00:00,897500,913700,893500,898600,0.00823407626253728\n20020909 00:00,891000,920200,882700,908000,0.00823407626253728\n20020910 00:00,911400,916100,905600,915500,0.0\n20020911 00:00,924700,937000,909200,915000,0.00031531964456016733\n20020912 00:00,907500,908400,889900,892600,0.014137556209809206\n20020913 00:00,887000,899000,882500,895400,0.014137556209809206\n20020916 00:00,893200,898300,884700,897300,0.01413403937688265\n20020917 00:00,908900,911900,877500,879700,0.01132437839935076\n20020918 00:00,870200,885000,861000,874900,0.011754389256618944\n20020919 00:00,860000,868000,847800,848500,0.02101602729765565\n20020920 00:00,849200,852000,840500,846600,0.017751148255457025\n20020923 00:00,836500,840700,826900,835900,0.01893212838323195\n20020924 00:00,824400,836500,818500,821500,0.012403235365312107\n20020925 00:00,833700,847700,820400,841100,0.012335673487257979\n20020926 00:00,850200,859800,844500,858700,0.009945979036165363\n20020927 00:00,850000,857000,828000,828500,0.020305086909894837\n20020930 00:00,820000,828000,800100,816000,0.022094664115557966\n20021001 00:00,824400,851000,810900,850000,0.022094664115557966\n20021002 00:00,846900,855300,825800,830500,0.015852764866498822\n20021003 00:00,831400,848400,819500,820500,0.014958629555214237\n20021004 00:00,828000,829200,795800,803900,0.018978918674029874\n20021007 00:00,800700,812000,785500,788200,0.01766081604453407\n20021008 00:00,798100,813100,782000,801100,0.016235034682448336\n20021009 00:00,790900,798500,777800,780000,0.018930965263924293\n20021010 00:00,779400,810700,770700,806600,0.015206704131695302\n20021011 00:00,821000,847300,801800,839000,0.015206704131695302\n20021014 00:00,832000,848500,830300,844700,0.0\n20021015 00:00,869900,897500,868600,884200,0.0\n20021016 00:00,874200,882600,859200,863700,0.01338575041663346\n20021017 00:00,888700,900300,878500,881800,0.01338575041663346\n20021018 00:00,871500,891100,869300,886500,0.01338575041663346\n20021021 00:00,881200,905000,875700,902900,0.0\n20021022 00:00,890500,900100,885200,893200,0.0062025668525189735\n20021023 00:00,887700,899900,866500,899700,0.0062025668525189735\n20021024 00:00,907000,909000,881000,885800,0.010864398602763765\n20021025 00:00,882200,901600,879400,900400,0.00891982743329534\n20021028 00:00,911500,912900,888300,894200,0.009765664318334996\n20021029 00:00,890800,899200,870000,886000,0.006620859695196466\n20021030 00:00,886800,899600,882300,894500,0.006620859695196466\n20021031 00:00,896600,903000,881900,888600,0.006521710707804191\n20021101 00:00,883500,908200,880500,905300,0.0038081236313234324\n20021104 00:00,918000,929400,909000,911500,0.0038081236313234324\n20021105 00:00,908400,920700,908400,919700,0.0\n20021106 00:00,924800,930700,900400,927700,0.0\n20021107 00:00,920000,922200,902200,905700,0.013691609272579246\n20021108 00:00,905300,915700,895200,898700,0.014400408372352317\n20021111 00:00,895200,900300,878000,880500,0.018549371034214272\n20021112 00:00,886600,899100,883600,887500,0.012514751347588553\n20021113 00:00,883200,899000,874500,886800,0.011701058530651844\n20021114 00:00,900700,910000,891900,908700,0.0004553748602058835\n20021115 00:00,900000,915500,899100,913800,0.0004553748602058835\n20021118 00:00,921500,926100,903500,905000,0.005559950064421884\n20021119 00:00,900200,911000,897600,902300,0.005820651777927505\n20021120 00:00,899800,920700,897400,919400,0.005820651777927505\n20021121 00:00,926000,965800,924300,939000,0.0017224814660906265\n20021122 00:00,934800,942700,930000,936200,0.0017215982467848189\n20021125 00:00,934300,942600,927700,938000,0.0017215982467848189\n20021126 00:00,930700,934500,916200,918500,0.012125325945132485\n20021127 00:00,925200,946500,915700,943500,0.012002484274198007\n20021129 00:00,948000,948000,937100,939800,0.012214166457532268\n20021202 00:00,954700,960500,932200,938900,0.0023306504887721114\n20021203 00:00,932500,934000,923500,925500,0.008563222968258075\n20021204 00:00,918100,931400,914300,923700,0.008334472139215694\n20021205 00:00,927000,929500,911000,911600,0.011240845935044616\n20021206 00:00,901200,921700,899800,918100,0.0076458983404254135\n20021209 00:00,910700,914600,896200,896900,0.015327520360993116\n20021210 00:00,900200,911000,897600,909200,0.013331691217536292\n20021211 00:00,904200,916200,901600,910400,0.013331691217536292\n20021212 00:00,912000,914900,902000,907500,0.0018390990560741662\n20021213 00:00,899100,910000,893600,895000,0.00816236926057196\n20021216 00:00,898200,916800,896600,916800,0.00816236926057196\n20021217 00:00,913700,917400,907400,909300,0.009249299770836508\n20021218 00:00,903400,909000,846600,896400,0.009454913838284874\n20021219 00:00,893500,907000,886000,890800,0.010119516345119544\n20021220 00:00,892000,900200,891000,896900,0.008949695604668491\n20021223 00:00,895900,906000,893100,899300,0.003606828990921359\n20021224 00:00,896100,900000,892500,893300,0.0038519977928808784\n20021226 00:00,897700,906100,888400,890300,0.004312465266821938\n20021227 00:00,889600,899800,875200,876800,0.009759125994020587\n20021230 00:00,878000,884700,872200,880900,0.008966752654713363\n20021231 00:00,879900,884300,870800,881800,0.008754609271099579\n20030102 00:00,888500,911900,885400,911300,0.0\n20030103 00:00,909100,913900,896800,911300,0.0\n20030106 00:00,912400,937000,910900,931300,0.0\n20030107 00:00,929000,933700,922000,925600,0.003533658900870696\n20030108 00:00,922000,924000,910500,912000,0.009189659750739704\n20030109 00:00,918200,931800,910900,930000,0.009189659750739704\n20030110 00:00,919500,936400,918000,929700,0.008485150982601322\n20030113 00:00,935500,938600,924400,928800,0.0005891200296874835\n20030114 00:00,926900,938300,922000,934400,0.0005891200296874835\n20030115 00:00,935400,935700,915100,921200,0.008175188686410578\n20030116 00:00,925000,933300,914600,918300,0.008356122140903635\n20030117 00:00,909900,923000,901500,904800,0.01191072385692398\n20030121 00:00,908700,909200,878800,890300,0.012686649116961006\n20030122 00:00,887700,900000,880100,880400,0.014101936860657298\n20030123 00:00,887500,894300,879500,890600,0.011261618785048924\n20030124 00:00,885900,887600,861700,863300,0.018826289917717304\n20030127 00:00,857000,869400,845000,850300,0.019717968872319233\n20030128 00:00,856900,878500,846500,861200,0.019717968872319233\n20030129 00:00,854500,871800,847700,867800,0.008694026988839487\n20030130 00:00,867900,868800,846300,848000,0.013173006833319395\n20030131 00:00,841500,862200,841500,858400,0.013173006833319395\n20030203 00:00,861000,886900,858900,862700,0.013173006833319395\n20030204 00:00,853100,854400,843000,851400,0.007562371672473396\n20030205 00:00,857500,865400,844200,846400,0.008287676991403783\n20030206 00:00,843900,852200,836500,841700,0.008886165313869508\n20030207 00:00,849100,849900,829700,832900,0.007629571620734286\n20030210 00:00,834700,841300,826500,839400,0.006834781526478985\n20030211 00:00,843700,848800,828300,832100,0.007851540558422158\n20030212 00:00,831600,836200,822200,822200,0.008508534365998752\n20030213 00:00,821500,829500,810000,821000,0.008550158053645139\n20030214 00:00,823700,839100,818300,838800,0.006920578591771729\n20030218 00:00,845300,857700,844900,855500,0.0008426420859006695\n20030219 00:00,853200,854700,839000,849300,0.0041841866381948575\n20030220 00:00,852200,854200,805000,840900,0.007079176159452683\n20030221 00:00,843800,857400,834600,853400,0.007079176159452683\n20030224 00:00,849300,855100,835900,836300,0.012901204603600632\n20030225 00:00,829500,844900,822200,843200,0.011568654327563396\n20030226 00:00,840200,845300,830800,831900,0.01391757747525558\n20030227 00:00,837000,855000,829900,841700,0.007737260486056431\n20030228 00:00,844700,852300,834500,846200,0.007737260486056431\n20030303 00:00,852600,857800,837200,839300,0.0047077722257248805\n20030304 00:00,839500,840100,826500,827300,0.009502833828888016\n20030305 00:00,826100,835400,823600,835000,0.009502833828888016\n20030306 00:00,828600,835200,824700,827000,0.009936710678567821\n20030307 00:00,816400,840700,814300,833700,0.005531499585050325\n20030310 00:00,826300,828600,811000,812300,0.015818500970460923\n20030311 00:00,814900,820800,805200,805500,0.015588040025351888\n20030312 00:00,804100,810100,793800,809700,0.015588040025351888\n20030313 00:00,821900,838300,815300,837800,0.004833167340255382\n20030314 00:00,841900,847700,833500,839000,0.0\n20030317 00:00,834600,869500,832200,868300,0.0\n20030318 00:00,871500,873200,861000,871900,0.0\n20030319 00:00,873100,881600,866800,879900,0.0\n20030320 00:00,873200,885900,863500,881300,0.0\n20030321 00:00,887900,898800,877900,897400,0.0\n20030324 00:00,879900,881400,855800,865800,0.020330140969904358\n20030325 00:00,867400,886700,855900,876700,0.020330140969904358\n20030326 00:00,875600,878500,862300,872000,0.020564405776058694\n20030327 00:00,864300,885000,859900,871000,0.0031652058483936634\n20030328 00:00,864700,872800,862500,865900,0.004631075302645063\n20030331 00:00,853500,869600,844000,849800,0.011274064092950072\n20030401 00:00,852600,868500,849100,860700,0.011254605553970032\n20030402 00:00,875600,887700,870500,883900,0.010734887786064162\n20030403 00:00,888400,889900,878000,878800,0.003331243775163561\n20030404 00:00,884300,885900,875700,881200,0.003331243775163561\n20030407 00:00,903400,909200,881900,882000,0.003331243775163561\n20030408 00:00,883000,888900,862000,881100,0.0005891329277445232\n20030409 00:00,883600,898100,867700,868600,0.008211919504188788\n20030410 00:00,870700,889000,857100,874500,0.008211919504188788\n20030411 00:00,881900,887100,868600,871700,0.008396772116037239\n20030414 00:00,874700,888700,864600,888500,0.0018485771912303565\n20030415 00:00,888600,894700,883900,894200,0.0018485771912303565\n20030416 00:00,899100,900700,880300,882300,0.007683368601382822\n20030417 00:00,883500,897200,872900,896600,0.007683368601382822\n20030421 00:00,898600,901600,890600,895000,0.007752138808285614\n20030422 00:00,891000,915600,888900,915100,0.0010302926954086785\n20030423 00:00,916000,931100,912400,922000,0.0010302926954086785\n20030424 00:00,915300,920800,901800,914200,0.0048843081341421605\n20030425 00:00,913000,914700,900200,901500,0.009390687654104106\n20030428 00:00,904400,921900,901700,918700,0.009390687654104106\n20030429 00:00,921400,936600,914000,921500,0.008020508005587677\n20030430 00:00,919300,925700,913200,918500,0.0018795993571013555\n20030501 00:00,919200,927300,905000,919200,0.0018795993571013555\n20030502 00:00,915600,934700,909000,933000,0.0018795993571013555\n20030505 00:00,934700,939700,920500,929500,0.0021658370226834834\n20030506 00:00,931000,944200,920500,937900,0.0021658370226834834\n20030507 00:00,934200,941400,924000,933300,0.0035649869856133414\n20030508 00:00,925200,933800,922100,923400,0.0067472059193155525\n20030509 00:00,928300,938000,922000,937200,0.0067472059193155525\n20030512 00:00,935000,963000,922400,949000,0.00612425550731522\n20030513 00:00,945300,959700,916000,946400,0.0015817815594236257\n20030514 00:00,951000,952400,922400,943600,0.002328038775546375\n20030515 00:00,948900,953300,942500,951300,0.002328038775546375\n20030516 00:00,948900,954500,940500,948600,0.0023670442556931637\n20030519 00:00,942000,949200,920800,925100,0.014396462305667884\n20030520 00:00,928200,942100,916000,924500,0.014401331360534989\n20030521 00:00,921100,929200,919100,927800,0.014307801301605827\n20030522 00:00,929500,940500,921400,936800,0.0003744569900700153\n20030523 00:00,935300,953600,928600,937200,0.0\n20030527 00:00,933000,958400,931800,956200,0.0\n20030528 00:00,958500,977300,949800,958300,0.0\n20030529 00:00,958800,968200,923200,953700,0.002771377687855854\n20030530 00:00,959000,970900,951700,969300,0.002771377687855854\n20030602 00:00,975300,988400,960800,971700,0.002771377687855854\n20030603 00:00,971500,979000,968500,977100,0.0\n20030604 00:00,976600,993500,947200,991400,0.0\n20030605 00:00,985800,995900,981400,995600,0.0\n20030606 00:00,1004400,1014000,991300,992200,0.0019716662467303666\n20030609 00:00,987800,999200,977700,981100,0.006753201804446748\n20030610 00:00,984600,998300,977200,990400,0.006753201804446748\n20030611 00:00,991600,1011900,982800,1003300,0.0064589679379206556\n20030612 00:00,1007500,1014000,996200,1005200,0.0\n20030613 00:00,1006000,1007500,989500,994400,0.006203126648674856\n20030616 00:00,999600,1016600,998000,1016600,0.006203126648674856\n20030617 00:00,1020500,1021800,1007300,1016800,0.006203126648674856\n20030618 00:00,1012900,1021400,1010000,1015400,0.0007949354611186643\n20030619 00:00,1016400,1017300,998400,1000200,0.00867910909443826\n20030620 00:00,1003900,1005000,995000,997500,0.008817934166497454\n20030623 00:00,994500,996600,979200,983600,0.011910105044778735\n20030624 00:00,982200,990900,980200,986500,0.00819485142585556\n20030625 00:00,985300,995900,976700,978000,0.009459046124095217\n20030626 00:00,977800,990000,969600,988900,0.004974634858704311\n20030627 00:00,987500,991900,976600,978600,0.007804399966432869\n20030630 00:00,982200,989300,967200,976900,0.006096523038897314\n20030701 00:00,972500,988500,964300,985600,0.006096523038897314\n20030702 00:00,987700,996800,985700,996300,0.0010029587754162405\n20030703 00:00,990700,998500,979000,988000,0.004809803507250717\n20030707 00:00,996500,1009000,996100,1007500,0.004809803507250717\n20030708 00:00,1005000,1012900,1001700,1010200,0.004809803507250717\n20030709 00:00,1009200,1014000,1000300,1005500,0.0026861475600784505\n20030710 00:00,998400,1007700,986300,992100,0.00814958449927604\n20030711 00:00,993900,1004500,993900,1001400,0.00814958449927604\n20030714 00:00,1012000,1019000,996100,1007200,0.007694175641114836\n20030715 00:00,1013800,1019100,999500,1003800,0.001948958414659204\n20030716 00:00,1008100,1008700,977600,997600,0.0040638581639368555\n20030717 00:00,991500,999800,981600,985100,0.00829754056323885\n20030718 00:00,990200,999800,984600,995800,0.008065403926433144\n20030721 00:00,994500,994900,978500,982400,0.010615720551379491\n20030722 00:00,986900,999100,979100,991200,0.00776912392763708\n20030723 00:00,992100,998300,982800,992300,0.00776912392763708\n20030724 00:00,999900,1003400,983700,985000,0.00424736164978764\n20030725 00:00,986600,1002900,980400,1002300,0.00424736164978764\n20030728 00:00,1003700,1009800,996700,1000400,0.004386102828547327\n20030729 00:00,1001400,1003000,986800,993200,0.004296975835222082\n20030730 00:00,996000,997900,989300,991100,0.00446701232498717\n20030731 00:00,999800,1009400,989000,994100,0.004330863894546123\n20030801 00:00,991900,996800,982400,983800,0.006105287930146971\n20030804 00:00,983100,997100,970000,987200,0.005982001581986878\n20030805 00:00,984100,988500,968400,968500,0.01246555191301545\n20030806 00:00,967100,980600,964200,971000,0.010936436420022275\n20030807 00:00,971700,979800,966700,978800,0.010936436420022275\n20030808 00:00,983200,985500,977600,982200,0.0\n20030811 00:00,982600,996900,978400,985100,0.0\n20030812 00:00,987100,995600,984200,995400,0.0\n20030813 00:00,998200,998500,985300,988900,0.0037701192985057086\n20030814 00:00,991000,997500,985100,995400,0.0037701192985057086\n20030815 00:00,993600,997900,991200,995400,0.0037701192985057086\n20030818 00:00,999300,1007800,997400,1005000,0.0\n20030819 00:00,1006900,1009400,996000,1008200,0.0\n20030820 00:00,1002900,1008900,1001600,1005000,0.0018324944072672278\n20030821 00:00,1010500,1044500,1002000,1009100,0.0018324944072672278\n20030822 00:00,1017500,1020000,997400,997700,0.00677497192841171\n20030825 00:00,997300,1016300,992800,998200,0.006522438874999214\n20030826 00:00,995000,1004600,988300,1001800,0.006522438874999214\n20030827 00:00,1000500,1003600,995700,1002400,0.0\n20030828 00:00,1004000,1010000,996600,1008500,0.0\n20030829 00:00,1006100,1014600,1000000,1014000,0.0\n20030902 00:00,1016400,1028800,1002800,1027700,0.0\n20030903 00:00,1030300,1037000,1012500,1031900,0.0\n20030904 00:00,1031000,1035500,1004300,1034300,0.0\n20030905 00:00,1029400,1205200,1015300,1026700,0.004242349459384302\n20030908 00:00,1030400,1038800,1027300,1038000,0.004242349459384302\n20030909 00:00,1033700,1034600,1026800,1029300,0.00643537560428292\n20030910 00:00,1025400,1036000,1015500,1016900,0.008473101276882413\n20030911 00:00,1021000,1028500,1014200,1022500,0.008473101276882413\n20030912 00:00,1019100,1026400,1004600,1025200,0.006955351537891158\n20030915 00:00,1025200,1026300,1010800,1021200,0.0022526346827531464\n20030916 00:00,1022300,1036400,1021700,1035500,0.0022526346827531464\n20030917 00:00,1034800,1037900,1025800,1032200,0.0029085623897769685\n20030918 00:00,1034000,1055000,1031700,1045900,0.0018399380862634323\n20030919 00:00,1042700,1046000,1034000,1038600,0.004429876519239275\n20030922 00:00,1028500,1038700,1002900,1024900,0.00861613598955747\n20030923 00:00,1025900,1032900,1023600,1030900,0.00861613598955747\n20030924 00:00,1031200,1032200,1010700,1012000,0.013039876479520401\n20030925 00:00,1014100,1018800,1002700,1005900,0.011142259202434458\n20030926 00:00,1004400,1006600,998400,1000200,0.011612633994028718\n20030929 00:00,1003000,1009900,987500,1008700,0.004776427038513696\n20030930 00:00,1005300,1007600,959100,998600,0.006642487185839049\n20031001 00:00,1002400,1021200,1000100,1020000,0.0057809435102758044\n20031002 00:00,1019300,1028500,1016300,1023200,0.0057809435102758044\n20031003 00:00,1036700,1042800,1023200,1032600,0.0\n20031006 00:00,1034800,1039900,1032000,1037200,0.0\n20031007 00:00,1032600,1042600,1029100,1041900,0.0\n20031008 00:00,1043300,1043900,1026000,1037100,0.0026598342375566105\n20031009 00:00,1048800,1052200,1036500,1041700,0.0026598342375566105\n20031010 00:00,1042700,1044800,1039100,1042000,0.0026598342375566105\n20031013 00:00,1047200,1052900,1017000,1048600,0.0\n20031014 00:00,1048000,1053600,1036700,1052900,0.0\n20031015 00:00,1058600,1058900,1046400,1050200,0.0014805259063652675\n20031016 00:00,1046800,1059800,1046500,1053300,0.0014805259063652675\n20031017 00:00,1054700,1059100,1039800,1042300,0.006208591243619179\n20031020 00:00,1044500,1048300,1039400,1047800,0.006029481592220515\n20031021 00:00,1048700,1052800,1043200,1049600,0.006029481592220515\n20031022 00:00,1040300,1045400,1027000,1034000,0.008581044397254363\n20031023 00:00,1028900,1039500,1026800,1037400,0.008581044397254363\n20031024 00:00,1028300,1037600,1021800,1032800,0.008954789489466512\n20031027 00:00,1037400,1044400,1032700,1034400,0.002560064814220422\n20031028 00:00,1039800,1050700,1038200,1050200,0.002560064814220422\n20031029 00:00,1047700,1060800,1037300,1052500,0.0\n20031030 00:00,1057900,1059700,1042400,1050900,0.0008776821194331325\n20031031 00:00,1054000,1057400,1052200,1054200,0.0008776821194331325\n20031103 00:00,1057500,1066100,1042000,1063200,0.0008776821194331325\n20031104 00:00,1059800,1062700,1038400,1057800,0.0029323659270353336\n20031105 00:00,1055200,1059700,1049000,1056300,0.003044510905468224\n20031106 00:00,1056400,1064000,1051000,1062600,0.003044510905468224\n20031107 00:00,1066400,1067200,1056500,1058100,0.0025784472329120236\n20031110 00:00,1057300,1067500,1050100,1051800,0.00421842282072325\n20031111 00:00,1050800,1053400,1048000,1050800,0.004253986401981419\n20031112 00:00,1052100,1064700,1051600,1063800,0.0034811329906810945\n20031113 00:00,1060100,1065400,1057800,1063500,0.0005725545374498978\n20031114 00:00,1064000,1069500,1025600,1055400,0.00440032136824789\n20031117 00:00,1049100,1055100,1040400,1048600,0.00576198574419178\n20031118 00:00,1052400,1054600,1039000,1039100,0.007780318122207068\n20031119 00:00,1040300,1055300,1039200,1047800,0.0064184913666215275\n20031120 00:00,1040000,1056300,1038000,1039000,0.0071324089103702165\n20031121 00:00,1042400,1049100,1026500,1040400,0.004848904723104352\n20031124 00:00,1046800,1057700,1046800,1057200,0.004848904723104352\n20031125 00:00,1057300,1064200,1040600,1060100,0.0\n20031126 00:00,1064200,1064500,1044000,1064000,0.0\n20031128 00:00,1062800,1066600,1062000,1065400,0.0\n20031201 00:00,1068500,1076800,1003500,1075700,0.0\n20031202 00:00,1073800,1077700,1070700,1072700,0.0016101615762469594\n20031203 00:00,1076500,1080800,1070800,1071100,0.001825981208054922\n20031204 00:00,1071700,1077200,1069400,1076800,0.001825981208054922\n20031205 00:00,1071500,1078000,1000600,1068100,0.0047435218078717735\n20031208 00:00,1067400,1076400,1066800,1075200,0.004664698497353015\n20031209 00:00,1079000,1079300,1055200,1066200,0.006716747833035341\n20031210 00:00,1067700,1069800,1007000,1065400,0.0048521081553904305\n20031211 00:00,1067000,1081000,1066700,1078400,0.0048521081553904305\n20031212 00:00,1079700,1087000,1066500,1081300,0.0004332022278669222\n20031215 00:00,1091700,1094500,1074800,1075200,0.0032570393434353997\n20031216 00:00,1076800,1085000,1002400,1081700,0.0032570393434353997\n20031217 00:00,1080600,1083800,1078000,1083400,0.0032570393434353997\n20031218 00:00,1085500,1097200,1083900,1096000,0.0\n20031219 00:00,1093000,1097000,1085800,1090400,0.0029499648790710705\n20031222 00:00,1087900,1094700,1086500,1094600,0.0029499648790710705\n20031223 00:00,1094800,1099500,1084200,1097900,0.0029499648790710705\n20031224 00:00,1095200,1098800,1094300,1095800,0.001104322402129737\n20031226 00:00,1097100,1100800,1096300,1096700,0.001104322402129737\n20031229 00:00,1101000,1111700,1090000,1111500,0.001104322402129737\n20031230 00:00,1110900,1112700,1101500,1111700,0.0\n20031231 00:00,1112300,1115200,1108400,1111500,0.00010386799841495737\n20040102 00:00,1117400,1199100,1107300,1110000,0.0007860429595428296\n20040105 00:00,1116900,1124500,1111700,1123700,0.0007860429595428296\n20040106 00:00,1121800,1127300,1112300,1126300,0.0007791501608497048\n20040107 00:00,1123900,1129200,1118900,1129000,0.0\n20040108 00:00,1132600,1134100,1121900,1133200,0.0\n20040109 00:00,1128200,1139800,1121900,1125100,0.004126841846484248\n20040112 00:00,1125500,1131200,1123600,1131100,0.004126841846484248\n20040113 00:00,1130900,1132300,1111300,1124700,0.005263325880258736\n20040114 00:00,1127600,1134200,1126700,1133100,0.0032667683872457005\n20040115 00:00,1135700,1140600,1125800,1135300,0.0032667683872457005\n20040116 00:00,1140400,1143100,1130800,1142500,0.0\n20040120 00:00,1145300,1146500,1138200,1142100,0.00020213576164186109\n20040121 00:00,1141300,1153000,1137200,1150600,0.00020213576164186109\n20040122 00:00,1151400,1153800,1145800,1147300,0.0016681721966441243\n20040123 00:00,1150000,1153700,1139500,1143600,0.0024917333261142557\n20040126 00:00,1143900,1159100,1143900,1158000,0.0024917333261142557\n20040127 00:00,1157500,1165000,1147000,1147000,0.005791775180295541\n20040128 00:00,1149800,1153700,1129400,1132300,0.00921022116643237\n20040129 00:00,1135600,1138500,1125600,1137500,0.00921022116643237\n20040130 00:00,1135200,1152900,1130900,1134400,0.007564787967629913\n20040202 00:00,1137000,1163600,1131200,1138300,0.0015734380962530482\n20040203 00:00,1137400,1149700,1134400,1139500,0.0015734380962530482\n20040204 00:00,1131900,1139400,1127900,1130300,0.0046613624190825365\n20040205 00:00,1131700,1135400,1127800,1132600,0.0046613624190825365\n20040206 00:00,1134200,1146900,1132000,1146600,0.0046613624190825365\n20040209 00:00,1146700,1148700,1142900,1143400,0.0016113037340020986\n20040210 00:00,1142800,1151400,1142600,1149000,0.0016113037340020986\n20040211 00:00,1148500,1163900,1050100,1161900,0.0016113037340020986\n20040212 00:00,1159700,1167400,1146400,1156700,0.0025838896632980704\n20040213 00:00,1158200,1162000,1147500,1151200,0.0037699951518285705\n20040217 00:00,1158500,1164300,1157700,1161400,0.0037699951518285705\n20040218 00:00,1162000,1166000,1153500,1156600,0.003637322769930405\n20040219 00:00,1163300,1163900,1150000,1152200,0.003243124274313382\n20040220 00:00,1154500,1155600,1143200,1150000,0.003425363150513874\n20040223 00:00,1152200,1156100,1141700,1145500,0.003338164643514403\n20040224 00:00,1142700,1149900,1130300,1144500,0.0025638368678631055\n20040225 00:00,1144600,1150600,1143200,1149100,0.002314735801502293\n20040226 00:00,1146100,1152900,1143400,1150400,0.0005040159486596344\n20040227 00:00,1151900,1160800,1145500,1150800,0.0\n20040301 00:00,1154300,1163400,1144400,1160700,0.0\n20040302 00:00,1159400,1169700,1151900,1154900,0.002885010391401569\n20040303 00:00,1152500,1164000,1142500,1157000,0.002885010391401569\n20040304 00:00,1157200,1161000,1150400,1160500,0.002885010391401569\n20040305 00:00,1154200,1169500,1150800,1162900,0.0\n20040308 00:00,1163400,1166200,1152200,1152700,0.005064040541520506\n20040309 00:00,1151000,1166500,1049700,1146600,0.00591433208803217\n20040310 00:00,1147200,1156200,1114500,1129800,0.010321813560052184\n20040311 00:00,1123900,1156500,1111500,1113500,0.012258791432417045\n20040312 00:00,1117300,1127000,1115800,1126900,0.01187194802642506\n20040315 00:00,1122600,1126900,1109000,1110300,0.011904351636563292\n20040316 00:00,1117800,1149300,1108400,1117300,0.00850476037673957\n20040317 00:00,1122000,1132600,1115600,1130000,0.00850476037673957\n20040318 00:00,1126700,1139400,1119300,1129100,0.0004598364975846853\n20040319 00:00,1124100,1133300,1107000,1112900,0.008296407802927827\n20040322 00:00,1105400,1105700,1053500,1097400,0.011553766157879251\n20040323 00:00,1102500,1109300,1093600,1096500,0.011554317890729115\n20040324 00:00,1096200,1104700,1088500,1094100,0.008153542298975525\n20040325 00:00,1100800,1113000,1097900,1111100,0.0013494895415337332\n20040326 00:00,1109600,1117900,1108000,1111700,0.0012636941596489756\n20040329 00:00,1116300,1145000,1115800,1124900,0.0\n20040330 00:00,1123000,1130700,1122200,1129700,0.0\n20040331 00:00,1129900,1134000,1116000,1128800,0.0004599586104901152\n20040401 00:00,1130700,1181800,1130500,1134900,0.0004599586104901152\n20040402 00:00,1148100,1155500,1120100,1144400,0.0004599586104901152\n20040405 00:00,1144600,1157900,1144400,1153300,0.0\n20040406 00:00,1148300,1151800,1141000,1150800,0.0012515179684159184\n20040407 00:00,1149400,1149800,1141100,1144900,0.0032137034652745364\n20040408 00:00,1154100,1154100,1137400,1142300,0.0034708712413261\n20040412 00:00,1145800,1150800,1145000,1148800,0.0032373831945873626\n20040413 00:00,1152600,1153000,1130700,1133100,0.007998512459205666\n20040414 00:00,1126100,1143200,1125500,1131900,0.00791397502498388\n20040415 00:00,1134500,1137800,1120300,1131700,0.007914632500986412\n20040416 00:00,1134300,1140500,1129800,1137200,0.000619889729507745\n20040419 00:00,1135500,1166300,1132700,1138900,0.00010201435978257449\n20040420 00:00,1141100,1143200,1121100,1121400,0.008871393195906989\n20040421 00:00,1122000,1129500,1118700,1128100,0.008871393195906989\n20040422 00:00,1124800,1146700,1122400,1144400,0.008871393195906989\n20040423 00:00,1144200,1146100,1133400,1144400,0.0\n20040426 00:00,1145000,1149400,1136000,1139100,0.0026738521729334054\n20040427 00:00,1142300,1151200,1125200,1142200,0.0026738521729334054\n20040428 00:00,1138800,1143300,1125000,1125800,0.008710299872549098\n20040429 00:00,1127200,1135000,1111600,1118400,0.00911711222250903\n20040430 00:00,1121700,1123800,1111000,1111300,0.009826271154507191\n20040503 00:00,1113900,1147000,1111400,1121400,0.005275961180190007\n20040504 00:00,1122500,1132600,1116600,1123600,0.003665224348396226\n20040505 00:00,1124200,1129600,1121600,1125800,0.0\n20040506 00:00,1120200,1129900,1110000,1118500,0.0037436995603875173\n20040507 00:00,1112200,1125000,1017700,1103000,0.008833378673074252\n20040510 00:00,1094400,1103000,1083600,1091300,0.010748696016134466\n20040511 00:00,1094600,1100500,1091700,1100100,0.010075672664830834\n20040512 00:00,1095900,1103000,1080600,1103000,0.006124205031295239\n20040513 00:00,1097600,1110800,1094400,1101500,0.0007851544911917071\n20040514 00:00,1099600,1115400,1092700,1100200,0.0010395985685646197\n20040517 00:00,1088900,1098900,1062900,1088500,0.006227182326435491\n20040518 00:00,1095100,1099400,1093300,1097000,0.006177485908655076\n20040519 00:00,1105000,1111800,1093000,1094100,0.006326652191443364\n20040520 00:00,1094500,1098700,1090400,1095200,0.0015262678036918002\n20040521 00:00,1099700,1105500,1003200,1099300,0.0015262678036918002\n20040524 00:00,1105200,1109700,1089800,1100900,0.0\n20040525 00:00,1099200,1119800,1096000,1119200,0.0\n20040526 00:00,1116600,1130000,1109000,1120900,0.0\n20040527 00:00,1125300,1130300,1120600,1127200,0.0\n20040528 00:00,1127400,1129000,1120800,1127100,5.121986064494605e-05\n20040601 00:00,1125000,1136300,1118700,1126800,0.00016198435470281025\n20040602 00:00,1130300,1137300,1124600,1131200,0.00016198435470281025\n20040603 00:00,1127900,1131900,1120400,1122500,0.004443029085930932\n20040604 00:00,1130000,1135800,1126700,1129000,0.0044403707054010986\n20040607 00:00,1134800,1147000,1134200,1146500,0.0044403707054010986\n20040608 00:00,1143700,1149200,1141700,1148500,0.0\n20040609 00:00,1145200,1148600,1129800,1137700,0.005429153597952066\n20040610 00:00,1140400,1143200,1139300,1143000,0.005429153597952066\n20040614 00:00,1138400,1138500,1112300,1131900,0.00780461837370481\n20040615 00:00,1139600,1144500,1135100,1139500,0.005606813637799535\n20040616 00:00,1140200,1142000,1137000,1139900,0.005606813637799535\n20040617 00:00,1138500,1140700,1133300,1138600,0.0006584396437814834\n20040618 00:00,1132700,1142200,1131800,1137100,0.001006013651197597\n20040621 00:00,1137800,1141400,1131800,1133100,0.002266461856113198\n20040622 00:00,1131300,1138200,1126700,1137900,0.0021687108107613143\n20040623 00:00,1136100,1148400,1134200,1147000,0.0020309568874843607\n20040624 00:00,1145600,1149300,1142600,1144400,0.001308727724405401\n20040625 00:00,1144100,1149400,1139500,1141300,0.002039291993454603\n20040628 00:00,1145200,1146100,1134300,1136800,0.0030562709522121943\n20040629 00:00,1135300,1141700,1134200,1139900,0.002761887737890281\n20040630 00:00,1140700,1147900,1136500,1144500,0.0022764183048745645\n20040701 00:00,1142900,1144100,1125800,1132000,0.006305704119589651\n20040702 00:00,1131300,1142000,1126000,1128000,0.0066275139264267355\n20040706 00:00,1123700,1177400,1116300,1119600,0.007899932057282849\n20040707 00:00,1118100,1125700,1117500,1121400,0.004758888742750279\n20040708 00:00,1118100,1144500,1112000,1112200,0.00639690227964265\n20040709 00:00,1117000,1119400,1113800,1116400,0.004736599319194354\n20040712 00:00,1115100,1120400,1110000,1117800,0.004736599319194354\n20040713 00:00,1119000,1120200,1116300,1118900,0.0\n20040714 00:00,1112600,1144100,1111200,1114900,0.002063992382481457\n20040715 00:00,1117400,1119100,1110100,1110400,0.003112951344198556\n20040716 00:00,1115700,1119400,1104400,1105300,0.004089274234410207\n20040719 00:00,1107500,1116400,1099900,1104500,0.003554816588312773\n20040720 00:00,1105300,1113100,1102500,1112500,0.0026844588765964636\n20040721 00:00,1118100,1120600,1097600,1097900,0.0075884259302549445\n20040722 00:00,1094000,1103900,1087700,1100100,0.007576911397904272\n20040723 00:00,1096300,1100800,1086900,1089200,0.009493875066441058\n20040726 00:00,1091900,1099500,1082100,1088500,0.005732517236263863\n20040727 00:00,1090500,1101100,1089700,1098800,0.005732517236263863\n20040728 00:00,1095500,1103700,1077200,1100300,0.00037104773084164946\n20040729 00:00,1105400,1116300,1100000,1105500,0.0\n20040730 00:00,1103200,1108500,1005100,1106700,0.0\n20040802 00:00,1102000,1136100,1018100,1111000,0.0\n20040803 00:00,1109300,1118500,1100000,1103800,0.0037416039047392757\n20040804 00:00,1098900,1107500,1004500,1102800,0.0037779873425246575\n20040805 00:00,1102700,1109200,1083700,1085200,0.009958601837116663\n20040806 00:00,1076300,1104400,1066200,1068300,0.012884693230661513\n20040809 00:00,1070200,1102700,1068500,1070100,0.012874072046867623\n20040810 00:00,1073100,1180000,1047700,1083600,0.008991171718857972\n20040811 00:00,1076900,1083300,1047900,1080900,0.0014385804049575326\n20040812 00:00,1076800,1079500,1067700,1068500,0.00677774605410659\n20040813 00:00,1071000,1073500,1065900,1070700,0.00677774605410659\n20040816 00:00,1071400,1095300,1070300,1085300,0.006623316993201343\n20040817 00:00,1087500,1092800,1085300,1087100,0.0\n20040818 00:00,1085200,1101300,1080800,1100800,0.0\n20040819 00:00,1098100,1100200,1083400,1096100,0.0024650674647449665\n20040820 00:00,1096200,1106300,1004200,1104400,0.0024650674647449665\n20040823 00:00,1105500,1107700,1014600,1102200,0.0027201632180396864\n20040824 00:00,1106400,1107300,1098500,1101900,0.0011607863018821025\n20040825 00:00,1103300,1112700,1099000,1111200,0.0011607863018821025\n20040826 00:00,1109600,1113100,1103900,1111600,0.00015714487457529113\n20040827 00:00,1112000,1116300,1103400,1114600,0.0\n20040830 00:00,1112300,1113400,1105100,1105800,0.0045583010666326055\n20040831 00:00,1106600,1110800,1101000,1110700,0.0045583010666326055\n20040901 00:00,1109500,1116400,1104800,1113100,0.0045583010666326055\n20040902 00:00,1112400,1126600,1112400,1125500,0.0\n20040903 00:00,1123000,1128200,1113000,1120900,0.002359672357416526\n20040907 00:00,1125700,1131300,1120300,1128100,0.002359672357416526\n20040908 00:00,1126200,1139300,1116200,1123500,0.003333237283597948\n20040909 00:00,1125700,1128800,1120300,1125000,0.0023542338784436354\n20040910 00:00,1125200,1132700,1120800,1130900,0.0023542338784436354\n20040913 00:00,1132800,1137400,1130100,1132900,0.0\n20040914 00:00,1133000,1136900,1123600,1136100,0.0\n20040915 00:00,1133000,1133600,1123500,1127400,0.004421219383812848\n20040916 00:00,1128500,1133700,1128000,1131000,0.004421219383812848\n20040917 00:00,1129500,1133600,1126900,1131100,0.004421219383812848\n20040920 00:00,1126900,1129900,1122800,1125200,0.0030115521069920955\n20040921 00:00,1127500,1134700,1125400,1132400,0.0030115521069920955\n20040922 00:00,1124800,1136000,1115000,1116300,0.00874353534346599\n20040923 00:00,1116000,1117000,1110400,1111400,0.008590840314388368\n20040924 00:00,1111700,1125800,1110000,1113500,0.008590840314388368\n20040927 00:00,1111000,1118000,1105800,1106700,0.004342103303237981\n20040928 00:00,1109100,1115100,1098000,1113500,0.0035258031706237\n20040929 00:00,1112100,1117900,1110000,1117400,0.0035258031706237\n20040930 00:00,1115500,1119800,1058800,1117400,0.0\n20041001 00:00,1122700,1135200,1117800,1134900,0.0\n20041004 00:00,1141000,1144400,1134900,1138500,0.0\n20041005 00:00,1138500,1141600,1130000,1138300,0.00010142297218964988\n20041006 00:00,1137700,1197900,1136800,1145600,0.00010142297218964988\n20041007 00:00,1143800,1188200,1133600,1133800,0.005947733857692728\n20041008 00:00,1131500,1137700,1123500,1125800,0.00720836863713541\n20041011 00:00,1127800,1130200,1126400,1128700,0.00720836863713541\n20041012 00:00,1122000,1129500,1119400,1125300,0.004429447781057989\n20041013 00:00,1130000,1130700,1113200,1116700,0.004742728420790742\n20041014 00:00,1116800,1119300,1105800,1107000,0.006902472094764122\n20041015 00:00,1110200,1126700,1105700,1111700,0.006679778466390831\n20041018 00:00,1109100,1119600,1107000,1118000,0.005015042187820672\n20041019 00:00,1120200,1144700,1007500,1107200,0.005577265569989227\n20041020 00:00,1104000,1108800,1097500,1107100,0.005577509331863338\n20041021 00:00,1107900,1113200,1102100,1110400,0.005577509331863338\n20041022 00:00,1111800,1112500,1009400,1099500,0.005667673181897999\n20041025 00:00,1097500,1101200,1093500,1098700,0.005682980654353368\n20041026 00:00,1101300,1114300,1098800,1114000,0.005682980654353368\n20041027 00:00,1113600,1131000,1111200,1129700,0.00042008205125213075\n20041028 00:00,1127600,1135600,1124900,1131700,0.0\n20041029 00:00,1131200,1160000,1105100,1133800,0.0\n20041101 00:00,1135600,1138400,1132000,1134900,0.0\n20041102 00:00,1136600,1145700,1132200,1135000,0.0\n20041103 00:00,1150000,1153600,1140000,1147700,0.0\n20041104 00:00,1147800,1166700,1146800,1165500,0.0\n20041105 00:00,1170200,1188400,1164900,1171000,0.0\n20041108 00:00,1170100,1172300,1167200,1170000,0.0004930403665154746\n20041109 00:00,1170800,1175000,1167600,1170000,0.0004930403665154746\n20041110 00:00,1170600,1175500,1167600,1169400,0.000575109058472291\n20041111 00:00,1171800,1181200,1171000,1179900,0.0002960770611228968\n20041112 00:00,1179700,1189900,1173500,1189100,0.0002960770611228968\n20041115 00:00,1185000,1187300,1182300,1186700,0.0011652852123918364\n20041116 00:00,1183700,1186300,1177300,1177600,0.004578094970405402\n20041117 00:00,1183600,1191400,1180700,1184000,0.004578094970405402\n20041118 00:00,1185300,1188000,1182300,1186600,0.004427308881457465\n20041119 00:00,1186800,1188700,1114700,1173200,0.006519883370251996\n20041122 00:00,1171800,1181200,1170300,1179500,0.006519883370251996\n20041123 00:00,1179300,1182600,1173700,1179700,0.006519883370251996\n20041124 00:00,1182700,1185900,1180400,1185400,0.0\n20041126 00:00,1184900,1189800,1182600,1184000,0.0006818714162860554\n20041129 00:00,1187900,1190100,1174800,1181300,0.0014826884026486141\n20041130 00:00,1180000,1182400,1176400,1177700,0.002300890430767892\n20041201 00:00,1181600,1194700,1181000,1194700,0.0021975322855537997\n20041202 00:00,1191000,1199500,1104000,1193800,0.0018124290779730449\n20041203 00:00,1193100,1201400,1190900,1194300,0.0004349336588856553\n20041206 00:00,1192200,1196400,1188000,1193400,0.0006151920918679096\n20041207 00:00,1194900,1196200,1180500,1180700,0.00615946812062076\n20041208 00:00,1182100,1188300,1180100,1186200,0.00615946812062076\n20041209 00:00,1181400,1194600,1177300,1193000,0.006144082804347472\n20041210 00:00,1189100,1195600,1188500,1191700,0.0006291327325620595\n20041213 00:00,1197600,1203100,1193500,1202900,0.0006291327325620595\n20041214 00:00,1202000,1209600,1201800,1208000,0.0006291327325620595\n20041215 00:00,1207000,1211100,1203100,1209700,0.0\n20041216 00:00,1207200,1288800,1200400,1207000,0.0012886217465586317\n20041217 00:00,1194500,1200000,1188800,1194200,0.006256823835327786\n20041220 00:00,1197300,1203800,1071400,1192700,0.006298710129882189\n20041221 00:00,1196000,1209200,1188900,1204000,0.006165484838565146\n20041222 00:00,1203800,1210800,1200500,1209100,0.0007251929356761503\n20041223 00:00,1208700,1212800,1200900,1209900,0.0\n20041227 00:00,1212200,1213600,1204100,1204200,0.002719973993206735\n20041228 00:00,1206200,1213000,1206000,1212500,0.002719973993206735\n20041229 00:00,1210800,1213300,1209500,1212700,0.002719973993206735\n20041230 00:00,1214000,1215700,1212100,1212300,0.00019043465628421657\n20041231 00:00,1213000,1216600,1210300,1210400,0.0009246851092283356\n20050103 00:00,1215600,1217600,1199000,1200600,0.004765095023260145\n20050104 00:00,1204600,1205400,1184400,1187400,0.00793491622213054\n20050105 00:00,1187500,1197700,1182900,1183200,0.008143375916311101\n20050106 00:00,1184400,1191500,1180400,1187100,0.0066680944268123305\n20050107 00:00,1189700,1192300,1181300,1185600,0.0021685634634007536\n20050110 00:00,1183400,1194600,1165700,1189400,0.0007295302870730405\n20050111 00:00,1186500,1187400,1179900,1182900,0.003238426360019847\n20050112 00:00,1183900,1188400,1173400,1188000,0.003155184756795475\n20050113 00:00,1186100,1187300,1175000,1176800,0.006291406627776605\n20050114 00:00,1179500,1185300,1177600,1184200,0.0054430328408449705\n20050118 00:00,1180600,1196000,1179500,1195700,0.0054430328408449705\n20050119 00:00,1194200,1198800,1183900,1184000,0.005649408839607439\n20050120 00:00,1179000,1188000,1172900,1175700,0.00694956726048369\n20050121 00:00,1177800,1180000,1167400,1168000,0.007911650733978018\n20050124 00:00,1170700,1173400,1163700,1164200,0.0058486455212727745\n20050125 00:00,1169100,1174700,1164000,1168700,0.0042220835570310495\n20050126 00:00,1173100,1176000,1168400,1174100,0.0018783656018155355\n20050127 00:00,1171800,1177500,1169800,1174600,0.0\n20050128 00:00,1174900,1176500,1166100,1171300,0.0016220465591058727\n20050131 00:00,1179500,1182500,1171600,1180700,0.0016220465591058727\n20050201 00:00,1182800,1190800,1178200,1189100,0.0016220465591058727\n20050202 00:00,1190600,1195900,1189000,1193400,0.0\n20050203 00:00,1190700,1193900,1185700,1190500,0.0014029795380006154\n20050204 00:00,1190300,1204300,1189800,1203300,0.0014029795380006154\n20050207 00:00,1202200,1205200,1199600,1202300,0.001482755930666773\n20050208 00:00,1201700,1206500,1200700,1203400,0.00047980575848885753\n20050209 00:00,1204200,1204900,1192500,1193000,0.005012581646731362\n20050210 00:00,1196600,1200200,1192600,1198300,0.004989565231487511\n20050211 00:00,1197100,1210400,1194600,1207200,0.004989565231487511\n20050214 00:00,1206800,1208600,1204800,1207800,0.0\n20050215 00:00,1208000,1214300,1200500,1212000,0.0\n20050216 00:00,1209300,1214600,1206700,1211900,4.763616082424795e-05\n20050217 00:00,1212300,1213300,1202400,1202900,0.004287872852573208\n20050218 00:00,1201700,1204800,1199000,1203500,0.004287872852573208\n20050222 00:00,1199000,1209200,1185800,1186700,0.009128935727604037\n20050223 00:00,1189700,1195700,1186200,1193300,0.008059397193507045\n20050224 00:00,1192400,1203200,1189800,1202600,0.008059397193507045\n20050225 00:00,1202700,1216700,1121800,1213800,0.0\n20050228 00:00,1211600,1216500,1200200,1205400,0.003995503593007788\n20050301 00:00,1207800,1219100,1206200,1213000,0.003995503593007788\n20050302 00:00,1207600,1219300,1200100,1212900,0.003995787084621091\n20050303 00:00,1216600,1219000,1207000,1213600,4.7596889463252004e-05\n20050304 00:00,1220500,1229000,1202400,1225600,4.7596889463252004e-05\n20050307 00:00,1226500,1232500,1219000,1227800,0.0\n20050308 00:00,1226700,1230000,1220500,1222000,0.002727342858201552\n20050309 00:00,1219600,1222900,1209800,1210100,0.006248905371260018\n20050310 00:00,1212100,1262700,1204000,1212000,0.006248905371260018\n20050311 00:00,1213100,1217200,1201600,1204100,0.0067655391729975365\n20050314 00:00,1206300,1210600,1202800,1210400,0.003763256705113922\n20050315 00:00,1214200,1214600,1201300,1201700,0.005602065941484739\n20050316 00:00,1197000,1201600,1189000,1191800,0.006312241826344498\n20050317 00:00,1193100,1197400,1174900,1194100,0.006312241826344498\n20050318 00:00,1191100,1192200,1181000,1188100,0.0055712872116261665\n20050321 00:00,1187100,1188800,1177600,1182600,0.0039445118391560246\n20050322 00:00,1183600,1189300,1170600,1171300,0.006781831093385286\n20050323 00:00,1169500,1190600,1166200,1170600,0.006139739357668684\n20050324 00:00,1174700,1179900,1154300,1171400,0.005527486936682761\n20050328 00:00,1174200,1179400,1173300,1173600,0.0003450398603540678\n20050329 00:00,1171400,1179000,1162500,1164200,0.004624311972036861\n20050330 00:00,1167900,1181300,1164900,1181200,0.004624311972036861\n20050331 00:00,1181900,1186600,1100900,1179500,0.004698372825182812\n20050401 00:00,1186200,1197400,1169100,1172200,0.003668598315284364\n20050404 00:00,1173500,1178600,1167400,1175900,0.003668598315284364\n20050405 00:00,1178000,1188200,1171100,1180900,0.0035732572828183528\n20050406 00:00,1184500,1189500,1181400,1184000,0.0\n20050407 00:00,1184100,1192300,1181200,1191500,0.0\n20050408 00:00,1191500,1192400,1180800,1181000,0.005087853819967321\n20050411 00:00,1182900,1184200,1178300,1181800,0.005087853819967321\n20050412 00:00,1178900,1190600,1170700,1187600,0.005087853819967321\n20050413 00:00,1185500,1188000,1171300,1174200,0.0065143934044635966\n20050414 00:00,1174200,1178700,1161300,1162700,0.008626171132098423\n20050415 00:00,1157400,1168200,1141600,1142800,0.013117001400605847\n20050418 00:00,1141500,1149600,1139600,1146100,0.011385007875068727\n20050419 00:00,1150700,1155300,1146200,1152900,0.009881543267286115\n20050420 00:00,1154000,1159100,1136000,1138200,0.007361478842126405\n20050421 00:00,1147900,1177500,1136300,1159900,0.007361478842126405\n20050422 00:00,1157400,1165000,1142700,1152800,0.008165851946370926\n20050425 00:00,1158600,1165000,1152500,1162700,0.0035340864826677804\n20050426 00:00,1159800,1168300,1152200,1152200,0.00629875447131586\n20050427 00:00,1148600,1168000,1100000,1156800,0.005213879613392163\n20050428 00:00,1152700,1156800,1143500,1144000,0.008245968710260043\n20050429 00:00,1150800,1157900,1139700,1157000,0.006388384721323637\n20050502 00:00,1160700,1169800,1155200,1163300,0.006388384721323637\n20050503 00:00,1160500,1169300,1156900,1162500,0.0003970430803332533\n20050504 00:00,1166500,1177500,1162200,1176200,0.0003970430803332533\n20050505 00:00,1176600,1197800,1166900,1173600,0.001336572367945478\n20050506 00:00,1179300,1191700,1166700,1172000,0.0014994450809642996\n20050509 00:00,1172100,1180300,1170500,1180100,0.0014994450809642996\n20050510 00:00,1173800,1199800,1163900,1166900,0.0065057386810919845\n20050511 00:00,1169300,1182700,1158500,1172000,0.006457947253031981\n20050512 00:00,1173100,1175900,1159500,1160900,0.0084619717013539\n20050513 00:00,1163000,1166500,1148000,1156000,0.005986521877281712\n20050516 00:00,1157000,1168500,1156600,1167900,0.005986521877281712\n20050517 00:00,1164300,1177000,1161600,1175900,0.002436916460529911\n20050518 00:00,1180600,1198400,1176300,1187900,0.0\n20050519 00:00,1190000,1194100,1187000,1193800,0.0\n20050520 00:00,1193200,1193900,1187400,1191500,0.001112335080529514\n20050523 00:00,1192000,1200400,1191800,1196500,0.001112335080529514\n20050524 00:00,1194400,1198300,1192000,1196500,0.001112335080529514\n20050525 00:00,1193600,1194700,1188300,1193200,0.0015923576166533599\n20050526 00:00,1197900,1202100,1177700,1200500,0.0015923576166533599\n20050527 00:00,1200800,1202500,1198000,1201800,0.0015923576166533599\n20050531 00:00,1200600,1201700,1175100,1194500,0.003506953707009693\n20050601 00:00,1195200,1209200,1194000,1205400,0.003506953707009693\n20050602 00:00,1202300,1208400,1201000,1207100,0.003506953707009693\n20050603 00:00,1205500,1208900,1197300,1199400,0.0036828738901169217\n20050606 00:00,1200100,1202200,1195500,1201400,0.0036828738901169217\n20050607 00:00,1203900,1215100,1200500,1200700,0.0036982052158274666\n20050608 00:00,1204500,1239500,1196700,1198500,0.0011100568193997621\n20050609 00:00,1197400,1205800,1193400,1204900,0.0011100568193997621\n20050610 00:00,1205700,1206500,1192400,1202100,0.0017085515878687502\n20050613 00:00,1199500,1210800,1120400,1204900,0.001341672133563726\n20050614 00:00,1204500,1212000,1203800,1208200,0.001341672133563726\n20050615 00:00,1211600,1212400,1202300,1210600,0.0\n20050616 00:00,1211000,1216400,1209200,1214800,0.0\n20050617 00:00,1215400,1219300,1212000,1216000,0.0\n20050620 00:00,1210800,1221800,1209400,1215000,0.0004747946292677978\n20050621 00:00,1214900,1216500,1210300,1213000,0.0010623721678855503\n20050622 00:00,1216900,1219400,1210700,1213700,0.0010623721678855503\n20050623 00:00,1213100,1216000,1199700,1200000,0.006585944368919724\n20050624 00:00,1198800,1200100,1190500,1190900,0.00785114259384396\n20050627 00:00,1189700,1194100,1187500,1190400,0.007854883715601172\n20050628 00:00,1194100,1202400,1193700,1201800,0.0043849446562331165\n20050629 00:00,1203700,1204000,1198100,1199400,0.0011781767575846397\n20050630 00:00,1202000,1203200,1189500,1190600,0.0043901261508790266\n20050701 00:00,1194600,1198000,1192100,1195000,0.0043901261508790266\n20050705 00:00,1192600,1206500,1191900,1204800,0.004236019984049279\n20050706 00:00,1203900,1206500,1194500,1194900,0.004744163068540279\n20050707 00:00,1182900,1204000,1181800,1197700,0.004744163068540279\n20050708 00:00,1199700,1213200,1197200,1212200,0.004744163068540279\n20050711 00:00,1213300,1220600,1213100,1220200,0.0\n20050712 00:00,1219000,1226300,1216400,1222200,0.0\n20050713 00:00,1222700,1225200,1219900,1223400,0.0\n20050714 00:00,1229800,1234400,1223700,1227400,0.0\n20050715 00:00,1227900,1230400,1223600,1227700,0.0\n20050718 00:00,1225000,1228300,1220500,1222000,0.002680538025886537\n20050719 00:00,1227100,1231100,1221700,1230000,0.002680538025886537\n20050720 00:00,1225900,1238900,1223000,1235400,0.002680538025886537\n20050721 00:00,1235500,1238900,1224700,1227000,0.003925645346602621\n20050722 00:00,1228800,1252500,1226300,1234300,0.003925645346602621\n20050725 00:00,1234100,1239500,1228500,1229300,0.004569525692553188\n20050726 00:00,1232300,1235300,1229500,1232300,0.0023387761046326956\n20050727 00:00,1234800,1238500,1230500,1237900,0.0023387761046326956\n20050728 00:00,1239900,1249300,1236400,1245000,0.0\n20050729 00:00,1244100,1246300,1234000,1235600,0.004359110466170692\n20050801 00:00,1238000,1240400,1218900,1235500,0.004359360894006737\n20050802 00:00,1238700,1282800,1237400,1244600,0.004359360894006737\n20050803 00:00,1242400,1247400,1241000,1246400,4.672630861035491e-05\n20050804 00:00,1242200,1246900,1236000,1236600,0.004539499870072499\n20050805 00:00,1234600,1323000,1226700,1227700,0.006154136698271574\n20050808 00:00,1231700,1234100,1223800,1224200,0.006370442015671107\n20050809 00:00,1230500,1235900,1228700,1233400,0.004469392845190443\n20050810 00:00,1238300,1245000,1228200,1231200,0.0019415577551458092\n20050811 00:00,1232700,1240300,1222200,1239700,0.0010298123822095084\n20050812 00:00,1235700,1293000,1227500,1232400,0.0035522868268155986\n20050815 00:00,1232000,1238700,1220200,1236500,0.003399739424928859\n20050816 00:00,1234400,1235200,1158800,1221300,0.007869491254750413\n20050817 00:00,1221900,1228700,1220300,1222900,0.007097229350329437\n20050818 00:00,1220400,1225600,1218400,1221100,0.007147925466808995\n20050819 00:00,1226300,1228200,1222000,1222700,0.0008498082300607521\n20050822 00:00,1225800,1232300,1218800,1224700,0.0008498082300607521\n20050823 00:00,1225100,1226100,1216700,1220500,0.001979971528208099\n20050824 00:00,1219400,1227300,1211900,1212400,0.004312989848972685\n20050825 00:00,1213400,1216700,1212100,1215300,0.004312989848972685\n20050826 00:00,1214800,1222400,1206800,1208200,0.005104763680100067\n20050829 00:00,1204100,1217800,1203800,1216000,0.0033729835524120293\n20050830 00:00,1212500,1216200,1203900,1211800,0.00391836728576028\n20050831 00:00,1211900,1233300,1200000,1223900,0.0019941374429247125\n20050901 00:00,1224900,1231500,1196200,1225400,0.0019941374429247125\n20050902 00:00,1228300,1228800,1221000,1221300,0.0019317252355781746\n20050906 00:00,1226700,1237600,1056800,1237500,0.0019317252355781746\n20050907 00:00,1236300,1241300,1228600,1240200,0.0019317252355781746\n20050908 00:00,1236600,1240000,1233100,1235800,0.002048331869403608\n20050909 00:00,1238300,1247400,1238000,1244800,0.002048331869403608\n20050912 00:00,1244400,1246700,1242700,1244300,0.0020614177883717705\n20050913 00:00,1241300,1244200,1235200,1235500,0.004089745385003972\n20050914 00:00,1237500,1239200,1230200,1231800,0.004440214463790191\n20050915 00:00,1234900,1236500,1229000,1232200,0.00443415433126211\n20050916 00:00,1232800,1237400,1228700,1237000,0.0017290133516807576\n20050919 00:00,1234500,1237000,1226400,1229600,0.0034538334616032395\n20050920 00:00,1232100,1237000,1218700,1221000,0.005313660168223693\n20050921 00:00,1218100,1313700,1208600,1208900,0.007808355942463859\n20050922 00:00,1209500,1216600,1204400,1214400,0.007002960584190121\n20050923 00:00,1212400,1218900,1209000,1215600,0.005721489154131432\n20050926 00:00,1220400,1227800,1210000,1214700,0.00042745577679390473\n20050927 00:00,1215200,1219900,1210200,1215000,0.00042745577679390473\n20050928 00:00,1219100,1221200,1212000,1216800,0.00042745577679390473\n20050929 00:00,1215700,1228600,1210800,1228100,0.0\n20050930 00:00,1226100,1229700,1206900,1228200,0.0\n20051003 00:00,1229500,1233400,1224500,1226800,0.0006581097352756138\n20051004 00:00,1227900,1230300,1213300,1213800,0.006153287223145941\n20051005 00:00,1213100,1226700,1120900,1196300,0.01035139365508429\n20051006 00:00,1197800,1202600,1181700,1191500,0.010587002273540548\n20051007 00:00,1197000,1200500,1191300,1196700,0.008640299874025566\n20051010 00:00,1196900,1197100,1171900,1187700,0.0049213744946780755\n20051011 00:00,1189900,1193900,1183200,1185400,0.004483701964228624\n20051012 00:00,1183900,1191300,1174100,1178500,0.005603353017301308\n20051013 00:00,1174600,1180800,1168800,1177700,0.0035633714410420814\n20051014 00:00,1181200,1188100,1175600,1187500,0.0033834279478919876\n20051017 00:00,1187600,1192700,1180000,1190700,0.00039192211739646533\n20051018 00:00,1189500,1189600,1178700,1179000,0.005673131896799057\n20051019 00:00,1175600,1196600,1166500,1196400,0.005673131896799057\n20051020 00:00,1195100,1198100,1173000,1177200,0.01086425662907948\n20051021 00:00,1182700,1187800,1175100,1180200,0.009265400508559713\n20051024 00:00,1184400,1200600,1184100,1200400,0.009265400508559713\n20051025 00:00,1197100,1202400,1189400,1197400,0.0014428947080713996\n20051026 00:00,1195000,1205400,1191900,1192400,0.00280965141485005\n20051027 00:00,1192100,1193700,1092200,1179700,0.006760712861465369\n20051028 00:00,1184200,1199500,1181000,1199000,0.006604944606626373\n20051031 00:00,1202900,1213000,1179600,1207100,0.006149235507135369\n20051101 00:00,1205600,1209000,1202200,1203000,0.001961010772659671\n20051102 00:00,1201700,1216600,1200000,1216300,0.001961010772659671\n20051103 00:00,1221500,1226600,1217500,1221500,0.001961010772659671\n20051104 00:00,1224000,1224600,1215500,1221100,0.000189062716066982\n20051107 00:00,1224000,1226200,1218500,1224400,0.000189062716066982\n20051108 00:00,1219500,1224900,1217900,1220700,0.0017549019781839845\n20051109 00:00,1220800,1229500,1200500,1222500,0.0017446880071885166\n20051110 00:00,1223600,1235200,1210000,1233500,0.0017446880071885166\n20051111 00:00,1233500,1238400,1232800,1236500,0.0\n20051114 00:00,1237600,1240200,1233700,1236700,0.0\n20051115 00:00,1235700,1240900,1228600,1231600,0.0023809221095391973\n20051116 00:00,1233900,1235500,1229800,1234700,0.0023809221095391973\n20051117 00:00,1237600,1246200,1232400,1245300,0.0023809221095391973\n20051118 00:00,1250200,1260600,1243300,1250900,0.0\n20051121 00:00,1251600,1259100,1249800,1257800,0.0\n20051122 00:00,1255600,1265200,1254200,1263700,0.0\n20051123 00:00,1262500,1274100,1255500,1268800,0.0\n20051125 00:00,1269800,1272200,1268100,1270500,0.0\n20051128 00:00,1272500,1296900,1255600,1261500,0.004089848424011513\n20051129 00:00,1266300,1269800,1260900,1261200,0.004092152449204506\n20051130 00:00,1261400,1265200,1250100,1253300,0.0054611742773093596\n20051201 00:00,1260200,1273200,1254100,1269100,0.003619055727086273\n20051202 00:00,1267700,1270800,1265000,1268700,0.0036210256100331737\n20051205 00:00,1266400,1269000,1233400,1266400,0.0010623672301014817\n20051206 00:00,1270400,1277400,1266000,1267300,0.0010623672301014817\n20051207 00:00,1267700,1268700,1256800,1261500,0.0028420848806487483\n20051208 00:00,1262200,1268200,1254800,1260300,0.002698807248466566\n20051209 00:00,1261700,1267800,1258200,1264100,0.002698807248466566\n20051212 00:00,1267100,1268600,1259600,1265000,0.000549203585436048\n20051213 00:00,1264000,1373200,1262900,1271700,0.0\n20051214 00:00,1272000,1280900,1217100,1277600,0.0\n20051215 00:00,1278400,1280000,1271800,1275300,0.001039375093249922\n20051216 00:00,1272700,1285700,1264900,1266000,0.00433666636901077\n20051219 00:00,1267300,1268700,1256900,1257800,0.005726335710261783\n20051220 00:00,1258600,1262200,1254800,1257700,0.005631405423038526\n20051221 00:00,1261700,1267600,1258000,1261200,0.0037398332084448557\n20051222 00:00,1263100,1266600,1260800,1266600,4.590159557875991e-05\n20051223 00:00,1268000,1268600,1263000,1267500,0.0\n20051227 00:00,1269200,1270500,1254800,1255100,0.005648239319882718\n20051228 00:00,1257400,1259900,1255000,1256100,0.005648239319882718\n20051229 00:00,1257200,1259600,1252500,1253100,0.005814121128640189\n20051230 00:00,1250000,1253100,1245000,1245500,0.003763328213762899\n20060103 00:00,1251000,1270000,1243900,1267500,0.003763328213762899\n20060104 00:00,1268300,1274900,1267000,1272700,0.0035016056546494155\n20060105 00:00,1271700,1275900,1268800,1272300,0.00018145683010598163\n20060106 00:00,1280400,1285800,1272800,1284100,0.00018145683010598163\n20060109 00:00,1284200,1290600,1257800,1289200,0.00018145683010598163\n20060110 00:00,1284000,1289700,1282600,1288800,0.00017913443040322\n20060111 00:00,1290200,1294400,1287300,1293500,0.00017913443040322\n20060112 00:00,1290800,1292800,1284400,1285900,0.003396966189759762\n20060113 00:00,1285700,1289000,1282000,1287200,0.003392239695277306\n20060117 00:00,1282000,1284200,1261100,1282500,0.0039939173227158805\n20060118 00:00,1275900,1282600,1265300,1277900,0.0029550517987292553\n20060119 00:00,1280900,1287700,1278100,1283700,0.0029550517987292553\n20060120 00:00,1282800,1284700,1208900,1261200,0.010329191323332026\n20060123 00:00,1262100,1268200,1261200,1263300,0.010119483568408989\n20060124 00:00,1266300,1271500,1259100,1266200,0.010119483568408989\n20060125 00:00,1270400,1278800,1258400,1264700,0.0006839562500271901\n20060126 00:00,1272800,1276700,1264400,1274100,0.0006839562500271901\n20060127 00:00,1276500,1286600,1274500,1283100,0.0006839562500271901\n20060130 00:00,1284400,1288100,1283500,1285300,0.0\n20060131 00:00,1283400,1285400,1276500,1279500,0.002605330709795246\n20060201 00:00,1278200,1283500,1277200,1282300,0.002605330709795246\n20060202 00:00,1281000,1281500,1268000,1271100,0.005676012029315671\n20060203 00:00,1266100,1286000,1261400,1264100,0.005961420287326423\n20060206 00:00,1264400,1268000,1261700,1265600,0.005961420287326423\n20060207 00:00,1263900,1266600,1254000,1255700,0.005523195935139662\n20060208 00:00,1258900,1277500,1256000,1266300,0.004516251315563631\n20060209 00:00,1269100,1373300,1263700,1265000,0.004554979400605502\n20060210 00:00,1264400,1271300,1255500,1268200,0.00059271527279987\n20060213 00:00,1265700,1267900,1259500,1264600,0.0017427923724006097\n20060214 00:00,1264600,1280300,1261900,1277100,0.0016389062995447667\n20060215 00:00,1276600,1283200,1272400,1281400,0.0016389062995447667\n20060216 00:00,1283400,1291200,1281800,1290800,0.0\n20060217 00:00,1290700,1299800,1285600,1288800,0.0008945619293300886\n20060221 00:00,1291200,1294000,1282900,1285200,0.001844200475291541\n20060222 00:00,1287700,1296500,1286500,1294300,0.001844200475291541\n20060223 00:00,1292700,1296400,1285400,1290100,0.0024720106858558627\n20060224 00:00,1291400,1294800,1287600,1292300,0.0018735000622702946\n20060227 00:00,1294000,1300400,1292800,1296900,0.0018735000622702946\n20060228 00:00,1291900,1296800,1281300,1282600,0.006366033502514982\n20060301 00:00,1286000,1294900,1285000,1293900,0.006366033502514982\n20060302 00:00,1288800,1294300,1286100,1292200,0.006411067741296353\n20060303 00:00,1286700,1300700,1286500,1289900,0.0012772759443555992\n20060306 00:00,1291400,1291800,1278500,1281500,0.003970817469243062\n20060307 00:00,1279100,1299000,1274000,1278600,0.004110839338090033\n20060308 00:00,1277000,1284400,1271800,1281700,0.003980323259976074\n20060309 00:00,1283400,1286800,1275700,1275700,0.003001969054010322\n20060310 00:00,1277000,1288400,1273700,1285200,0.0027027398105155184\n20060313 00:00,1288400,1291600,1285300,1288200,0.0027027398105155184\n20060314 00:00,1287100,1302300,1285600,1301200,0.0\n20060315 00:00,1301500,1308600,1298500,1307700,0.0\n20060316 00:00,1309800,1314700,1307100,1310100,0.0\n20060317 00:00,1306800,1311100,1303800,1305800,0.001894974549664449\n20060320 00:00,1306400,1309000,1302100,1303900,0.0020728359457085244\n20060321 00:00,1303400,1309900,1294500,1295900,0.00410420794365608\n20060322 00:00,1295100,1305100,1294500,1304200,0.0036405486263602757\n20060323 00:00,1302400,1308800,1296600,1300800,0.0038488038604366885\n20060324 00:00,1299900,1305700,1289600,1301500,0.0015051302831197173\n20060327 00:00,1300300,1302800,1297400,1300800,0.0015368283788312958\n20060328 00:00,1299300,1305300,1285500,1292200,0.003829655060123801\n20060329 00:00,1294000,1305000,1291400,1302100,0.003829655060123801\n20060330 00:00,1301100,1309800,1295500,1299500,0.003987338666225102\n20060331 00:00,1300300,1302400,1293700,1294900,0.00234644803219379\n20060403 00:00,1300700,1308700,1294900,1296900,0.00234644803219379\n20060404 00:00,1297300,1307300,1293600,1305300,0.002043717767042939\n20060405 00:00,1306200,1312800,1300000,1310500,0.0\n20060406 00:00,1308500,1312100,1300000,1308200,0.0010132816628280505\n20060407 00:00,1310600,1314000,1293500,1294700,0.006043530268313234\n20060410 00:00,1297100,1300800,1292600,1296000,0.006043530268313234\n20060411 00:00,1298600,1300600,1282500,1286500,0.007308102237504069\n20060412 00:00,1287700,1291300,1286100,1288400,0.00423212002878195\n20060413 00:00,1285900,1292500,1281000,1288600,0.00423212002878195\n20060417 00:00,1287900,1299000,1280200,1285200,0.0015233516337457358\n20060418 00:00,1289600,1309400,1285400,1307300,0.0015233516337457358\n20060419 00:00,1307200,1394100,1302400,1309900,0.0015233516337457358\n20060420 00:00,1310000,1343400,1306000,1311500,0.0\n20060421 00:00,1317400,1320300,1306200,1311000,0.00022011066305359194\n20060424 00:00,1309200,1311400,1303800,1308300,0.001209252141275404\n20060425 00:00,1310500,1311200,1299200,1302300,0.0029108545756317346\n20060426 00:00,1305000,1311400,1302000,1305800,0.0029025205695199325\n20060427 00:00,1299000,1316300,1295900,1311600,0.0026477884393011943\n20060428 00:00,1307900,1317500,1307100,1311400,8.803755248391006e-05\n20060501 00:00,1314600,1318800,1303200,1305600,0.0025549955971371887\n20060502 00:00,1310000,1314600,1307400,1313800,0.0025549955971371887\n20060503 00:00,1312000,1313200,1304500,1308200,0.0035463216382834043\n20060504 00:00,1310600,1316200,1309700,1312900,0.0024609236622483897\n20060505 00:00,1320400,1328000,1313100,1327100,0.0024609236622483897\n20060508 00:00,1325200,1327700,1323700,1325600,0.0006525698167315323\n20060509 00:00,1324300,1327700,1323100,1325300,0.000665522225023506\n20060510 00:00,1324100,1333300,1318900,1324300,0.0007954242838759948\n20060511 00:00,1325000,1325500,1305200,1307800,0.00720780867337877\n20060512 00:00,1304600,1307800,1291900,1292500,0.009877141226317382\n20060515 00:00,1287900,1297100,1286300,1296200,0.009867529520869904\n20060516 00:00,1297600,1307900,1290100,1293600,0.006853002839282314\n20060517 00:00,1286700,1290900,1269500,1272000,0.009709667635572827\n20060518 00:00,1273800,1277500,1263600,1263600,0.010431407101322584\n20060519 00:00,1268700,1274800,1258300,1269600,0.01036692295703924\n20060522 00:00,1262800,1271700,1255000,1269800,0.003812690456912654\n20060523 00:00,1271800,1276300,1258100,1259000,0.004910523631475784\n20060524 00:00,1256800,1267300,1247600,1260800,0.004910523631475784\n20060525 00:00,1269200,1276600,1264500,1276300,0.004910523631475784\n20060526 00:00,1280000,1283700,1275100,1283000,0.0\n20060530 00:00,1279700,1280500,1262600,1262800,0.009090004238215463\n20060531 00:00,1265800,1273800,1262000,1273000,0.009090004238215463\n20060601 00:00,1273800,1289400,1272700,1288200,0.009090004238215463\n20060602 00:00,1292500,1294300,1283200,1291300,0.0\n20060605 00:00,1287900,1288600,1267700,1269000,0.00997050337096618\n20060606 00:00,1272100,1279500,1257600,1267500,0.009993831675147993\n20060607 00:00,1269100,1276500,1259100,1259100,0.010701246741459928\n20060608 00:00,1255800,1265000,1230000,1261400,0.0038866109081253223\n20060609 00:00,1263600,1266700,1253400,1255300,0.004736592550123455\n20060612 00:00,1258900,1259300,1239800,1240000,0.007570580725028945\n20060613 00:00,1237800,1248400,1226700,1227300,0.009606218819048329\n20060614 00:00,1228400,1236300,1223400,1234900,0.009191525514514371\n20060615 00:00,1239000,1263600,1238700,1259700,0.00591318420863569\n20060616 00:00,1251900,1255600,1244600,1250000,0.004445739153083541\n20060619 00:00,1254000,1257500,1235500,1238200,0.007033429458705996\n20060620 00:00,1240100,1248000,1237200,1238800,0.007033429458705996\n20060621 00:00,1240000,1257000,1239600,1251300,0.005450186541150069\n20060622 00:00,1249500,1250600,1240400,1244500,0.0031375224410528715\n20060623 00:00,1243300,1252900,1240300,1243900,0.0031498456144655076\n20060626 00:00,1245400,1250500,1242500,1250400,0.0031498456144655076\n20060627 00:00,1250100,1252900,1237700,1238700,0.00540943613015754\n20060628 00:00,1241800,1247100,1236500,1245800,0.005402269793281021\n20060629 00:00,1251900,1272800,1251700,1272300,0.005402269793281021\n20060630 00:00,1274700,1276600,1269700,1270100,0.0009983263320106634\n20060703 00:00,1274300,1280100,1273100,1279000,0.0009983263320106634\n20060705 00:00,1272900,1274500,1265200,1270300,0.00405214940694276\n20060706 00:00,1272000,1278500,1270800,1273700,0.003927245771657371\n20060707 00:00,1272000,1275600,1263000,1265300,0.00547001735945796\n20060710 00:00,1269400,1274300,1264100,1267400,0.0038076016810809827\n20060711 00:00,1266100,1274100,1259400,1272700,0.0038076016810809827\n20060712 00:00,1272100,1274000,1257200,1259600,0.005942711185970065\n20060713 00:00,1254800,1256800,1241300,1242100,0.009982838918344753\n20060714 00:00,1241500,1242600,1228300,1236300,0.010340463472800694\n20060717 00:00,1235000,1241000,1231500,1234300,0.008513619621519248\n20060718 00:00,1237500,1240500,1223900,1236800,0.002853149563228789\n20060719 00:00,1241800,1262600,1241500,1259700,0.0009339970382425633\n20060720 00:00,1261200,1263000,1249200,1249600,0.004629068602695278\n20060721 00:00,1251500,1251600,1238800,1241100,0.006070541881259292\n20060724 00:00,1244400,1263200,1244400,1261300,0.006070541881259292\n20060725 00:00,1259800,1273000,1257200,1269700,0.0039272385468244585\n20060726 00:00,1265900,1274400,1261800,1269000,0.0003182997467375934\n20060727 00:00,1273300,1276900,1262000,1263700,0.002432230660463412\n20060728 00:00,1269900,1281400,1268600,1278500,0.002432230660463412\n20060731 00:00,1276800,1279400,1265500,1276700,0.0025446332971184294\n20060801 00:00,1273400,1273800,1266000,1271600,0.00244537663049083\n20060802 00:00,1275800,1284600,1275500,1279100,0.00244537663049083\n20060803 00:00,1273300,1285400,1271500,1281200,0.002306325975457924\n20060804 00:00,1290600,1294300,1274900,1280000,0.0005407589158816447\n20060807 00:00,1279000,1280700,1274000,1277600,0.0012100806605782285\n20060808 00:00,1281000,1284500,1269500,1273300,0.0022891574564583715\n20060809 00:00,1282000,1286000,1266100,1267800,0.003341726795720808\n20060810 00:00,1265300,1275000,1262900,1272800,0.0031615285823851902\n20060811 00:00,1271700,1272000,1263900,1268400,0.0031941832494510594\n20060814 00:00,1276300,1281600,1269200,1270500,0.0019958683095807547\n20060815 00:00,1282200,1288700,1279100,1287100,0.0019958683095807547\n20060816 00:00,1293400,1298900,1290400,1297500,0.0\n20060817 00:00,1295700,1303700,1294900,1300300,0.0\n20060818 00:00,1301900,1304800,1295900,1304600,0.0\n20060821 00:00,1301800,1302500,1291400,1301100,0.0015489237637311705\n20060822 00:00,1299500,1305200,1296800,1301300,0.0015489237637311705\n20060823 00:00,1301800,1304400,1291900,1295700,0.002927834846422444\n20060824 00:00,1299900,1301000,1294000,1298700,0.002484562750681577\n20060825 00:00,1296400,1302900,1295500,1298400,0.0024881396861206268\n20060828 00:00,1296600,1308200,1296400,1304800,0.0001333680455508313\n20060829 00:00,1304900,1308300,1298100,1307500,0.0001333680455508313\n20060830 00:00,1308700,1310400,1305500,1307400,4.4156808351038e-05\n20060831 00:00,1308500,1309900,1305800,1307100,0.00013964570102663044\n20060901 00:00,1311400,1315800,1308400,1314800,0.00013964570102663044\n20060905 00:00,1315100,1318500,1312000,1317200,0.00013248055740926198\n20060906 00:00,1311000,1311600,1303300,1304300,0.005654280650278018\n20060907 00:00,1300600,1305700,1293500,1298200,0.006265925951910302\n20060908 00:00,1300800,1304600,1298300,1303000,0.006265925951910302\n20060911 00:00,1298600,1306900,1294800,1303800,0.002700173765281527\n20060912 00:00,1305700,1318300,1305400,1316400,0.0\n20060913 00:00,1316200,1324500,1315200,1322500,0.0\n20060914 00:00,1319400,1322200,1317500,1320500,0.0008731194997196308\n20060915 00:00,1323400,1323900,1316800,1318200,0.0013317603008970143\n20060918 00:00,1318000,1326500,1316600,1320200,0.0013317603008970143\n20060919 00:00,1321200,1321400,1310700,1317500,0.0015509524231523237\n20060920 00:00,1322400,1328600,1304600,1324100,0.001180764828671407\n20060921 00:00,1326000,1327500,1314300,1317000,0.003313361061865492\n20060922 00:00,1316700,1316800,1310000,1313900,0.003380976415174408\n20060925 00:00,1317300,1328500,1310500,1325400,0.003380976415174408\n20060926 00:00,1324900,1335800,1324000,1335400,0.001358986966201879\n20060927 00:00,1334800,1339700,1332500,1336400,0.0\n20060928 00:00,1337400,1339800,1332500,1337800,0.0\n20060929 00:00,1337900,1339400,1334800,1334800,0.001294700857803026\n20061002 00:00,1335400,1338300,1329500,1330700,0.002195723710020158\n20061003 00:00,1328900,1337900,1326600,1334400,0.002195723710020158\n20061004 00:00,1332200,1350000,1330800,1349500,0.0017734013362882058\n20061005 00:00,1349000,1354100,1253500,1353000,0.0\n20061006 00:00,1349600,1350900,1344100,1350300,0.0011521402267641975\n20061009 00:00,1348500,1353000,1346400,1350900,0.0011521402267641975\n20061010 00:00,1351100,1354500,1348400,1353300,0.0011521402267641975\n20061011 00:00,1348400,1354300,1343000,1349900,0.0014505216250976951\n20061012 00:00,1354700,1363900,1354000,1362700,0.0014505216250976951\n20061013 00:00,1361600,1367100,1360400,1365500,0.0014505216250976951\n20061016 00:00,1365200,1370500,1364200,1368900,0.0\n20061017 00:00,1364700,1367000,1356700,1364500,0.0018557536594596853\n20061018 00:00,1370600,1373400,1361100,1365800,0.0018557536594596853\n20061019 00:00,1364100,1368700,1362300,1367500,0.0018557536594596853\n20061020 00:00,1368100,1369400,1360000,1368600,0.0\n20061023 00:00,1365600,1378000,1363900,1376800,0.0\n20061024 00:00,1373000,1378300,1372200,1377600,0.0\n20061025 00:00,1377400,1384100,1375900,1382000,0.0\n20061026 00:00,1386600,1399200,1379800,1388600,0.0\n20061027 00:00,1386100,1387500,1376400,1379100,0.003949897419920389\n20061030 00:00,1376600,1382000,1374000,1378700,0.003953445524267409\n20061031 00:00,1380700,1382500,1372500,1377900,0.003967614415564026\n20061101 00:00,1382200,1383000,1367200,1368900,0.0037896195694183325\n20061102 00:00,1365000,1370100,1363600,1368100,0.003800923563962473\n20061103 00:00,1372600,1373900,1356200,1366000,0.003888466352883966\n20061106 00:00,1369600,1382800,1369500,1380800,0.0009482766575689087\n20061107 00:00,1382000,1389800,1344400,1384300,0.0008862185259105127\n20061108 00:00,1380000,1390500,1368600,1387400,0.0\n20061109 00:00,1390100,1391400,1379000,1380900,0.002704898911440525\n20061110 00:00,1381400,1383400,1377200,1382700,0.002704898911440525\n20061113 00:00,1381800,1390400,1380700,1386800,0.002704898911440525\n20061114 00:00,1389700,1397300,1381200,1395500,0.0\n20061115 00:00,1395700,1404500,1395300,1399700,0.0\n20061116 00:00,1404400,1452000,1394900,1402300,0.0\n20061117 00:00,1399200,1404200,1397300,1403900,0.0\n20061120 00:00,1403000,1407400,1401000,1403700,8.224948631521968e-05\n20061121 00:00,1404900,1406700,1402900,1405800,8.224948631521968e-05\n20061122 00:00,1407500,1411600,1400000,1409200,8.224948631521968e-05\n20061124 00:00,1402400,1408400,1402000,1404600,0.001884623359546058\n20061127 00:00,1402900,1403500,1384400,1384900,0.008313958668787454\n20061128 00:00,1382400,1391500,1381100,1390300,0.008313958668787454\n20061129 00:00,1394700,1405300,1394200,1403600,0.008097536880987908\n20061130 00:00,1404400,1410500,1397600,1404600,0.0\n20061201 00:00,1405300,1406600,1389700,1400600,0.0016441699250736973\n20061204 00:00,1402500,1415500,1400800,1413300,0.0016441699250736973\n20061205 00:00,1415600,1419600,1412600,1418800,0.0016441699250736973\n20061206 00:00,1418700,1420700,1415000,1417500,0.0005290071538951978\n20061207 00:00,1420300,1423000,1411100,1412200,0.002222573227431051\n20061208 00:00,1411300,1419000,1407800,1414100,0.002222573227431051\n20061211 00:00,1414200,1420900,1413400,1417400,0.002158699419192255\n20061212 00:00,1416800,1418700,1408900,1416200,0.000488796615653671\n20061213 00:00,1422300,1423300,1415600,1418400,0.000488796615653671\n20061214 00:00,1418700,1432400,1418400,1429800,0.000488796615653671\n20061215 00:00,1426500,1428900,1422400,1423800,0.00242278753331779\n20061218 00:00,1425400,1435000,1417500,1419400,0.003008863924364163\n20061219 00:00,1415300,1425600,1411900,1422800,0.003008863924364163\n20061220 00:00,1422900,1426600,1420500,1421300,0.0018851658218115945\n20061221 00:00,1422700,1424300,1413200,1416200,0.0021592516382781587\n20061222 00:00,1416400,1416500,1407800,1408500,0.003810030530137188\n20061226 00:00,1408200,1415800,1407800,1415400,0.0037610962695191525\n20061227 00:00,1418700,1426000,1418300,1425900,0.0031391025792685636\n20061228 00:00,1424100,1427000,1419900,1421900,0.0016196094233526526\n20061229 00:00,1421000,1425400,1414700,1415200,0.0031660909532352957\n20070103 00:00,1422700,1428400,1405800,1414500,0.003178943972796723\n20070104 00:00,1412300,1420500,1406100,1416700,0.0027354250305880986\n20070105 00:00,1413300,1413900,1403800,1407600,0.003719518204370341\n20070108 00:00,1408200,1414100,1402500,1411700,0.0037085391752845406\n20070109 00:00,1413100,1416000,1404000,1411300,0.0037121455422679957\n20070110 00:00,1405700,1415300,1403000,1414000,0.00016359007414879856\n20070111 00:00,1415600,1426200,1415000,1422700,0.00016359007414879856\n20070112 00:00,1421200,1430300,1420800,1429700,0.0\n20070116 00:00,1430500,1434400,1427300,1430300,0.0\n20070117 00:00,1428700,1434600,1427300,1429400,0.0003632910873737568\n20070118 00:00,1431800,1432500,1423100,1424500,0.002012229760113369\n20070119 00:00,1425500,1431000,1424600,1429300,0.002012229760113369\n20070122 00:00,1430700,1459500,1419300,1422100,0.003517905378458467\n20070123 00:00,1422500,1430800,1420600,1427500,0.002908362092048772\n20070124 00:00,1429700,1439800,1429100,1439100,0.002908362092048772\n20070125 00:00,1438400,1439200,1344000,1423500,0.006258539503410547\n20070126 00:00,1425900,1426500,1415800,1421900,0.006292093028514998\n20070129 00:00,1421900,1426300,1417400,1419600,0.006361021535026318\n20070130 00:00,1423600,1428300,1420600,1427600,0.001137223924000119\n20070131 00:00,1426100,1441300,1424100,1438100,0.0009338952240918301\n20070201 00:00,1441500,1446600,1439100,1445700,0.0\n20070202 00:00,1447300,1449000,1443800,1447900,0.0\n20070205 00:00,1446900,1449300,1443400,1447000,0.00035887508962680016\n20070206 00:00,1449700,1450300,1443300,1447900,0.00035887508962680016\n20070207 00:00,1451200,1453600,1445700,1450300,0.00035887508962680016\n20070208 00:00,1448000,1451200,1442700,1448800,0.0005971353539160422\n20070209 00:00,1450600,1453300,1433900,1439200,0.003871945489417101\n20070212 00:00,1439300,1440400,1431900,1434200,0.00436064291399613\n20070213 00:00,1437700,1445500,1437600,1445100,0.004319564329013775\n20070214 00:00,1448000,1458900,1447800,1456400,0.0020058027695581703\n20070215 00:00,1456700,1459500,1454300,1458300,0.0\n20070216 00:00,1454300,1457400,1452300,1456800,0.0005938595650993569\n20070220 00:00,1455600,1462000,1440600,1461000,0.0005938595650993569\n20070221 00:00,1456100,1460700,1453500,1458900,0.001020464738485643\n20070222 00:00,1460500,1464200,1451700,1458300,0.000863168445255187\n20070223 00:00,1457300,1457900,1447500,1453600,0.002051216086432147\n20070226 00:00,1458300,1459500,1447500,1452100,0.001968187443019033\n20070227 00:00,1438900,1442000,1391000,1400000,0.020806729109597702\n20070228 00:00,1403900,1419800,1398000,1409300,0.020723357560294777\n20070301 00:00,1393500,1412500,1380500,1405900,0.020761568339894433\n20070302 00:00,1400500,1406500,1389000,1389800,0.006756791716863532\n20070305 00:00,1379200,1395100,1376600,1376900,0.008623931353288176\n20070306 00:00,1387800,1401200,1384400,1398000,0.00851070309368704\n20070307 00:00,1397400,1404600,1394000,1394600,0.00553981707634041\n20070308 00:00,1405500,1411600,1400700,1405400,0.001404142285582775\n20070309 00:00,1413300,1414100,1400800,1406200,0.001404142285582775\n20070312 00:00,1404200,1413400,1401600,1410100,0.0\n20070313 00:00,1402400,1407700,1381200,1381500,0.011709962200427864\n20070314 00:00,1384300,1392400,1367500,1391400,0.011709962200427864\n20070315 00:00,1390400,1399900,1388000,1395700,0.011709962200427864\n20070316 00:00,1393100,1396300,1381200,1384800,0.004508933104654947\n20070319 00:00,1392600,1403300,1391500,1400700,0.004508933104654947\n20070320 00:00,1400800,1410400,1399600,1409300,0.004508933104654947\n20070321 00:00,1411000,1436500,1408200,1433300,0.0\n20070322 00:00,1434700,1436400,1427900,1433100,8.056237622128711e-05\n20070323 00:00,1432800,1437900,1431500,1435000,8.056237622128711e-05\n20070326 00:00,1435000,1436500,1421200,1435900,8.056237622128711e-05\n20070327 00:00,1431300,1431600,1424000,1427100,0.0035383260455942086\n20070328 00:00,1422300,1424700,1412600,1415400,0.0059097023094076915\n20070329 00:00,1425400,1426100,1411900,1421200,0.0059097023094076915\n20070330 00:00,1421700,1428400,1405600,1419400,0.004789523367559803\n20070402 00:00,1421600,1424600,1414800,1423000,0.0007312345092466204\n20070403 00:00,1429700,1439800,1429100,1436600,0.0007312345092466204\n20070404 00:00,1436900,1439500,1431600,1437900,0.0\n20070405 00:00,1436700,1444400,1436100,1442800,0.0\n20070409 00:00,1445900,1447800,1441500,1444200,0.0\n20070410 00:00,1443300,1448500,1442700,1448000,0.0\n20070411 00:00,1448200,1448600,1435400,1438300,0.0038676088474719527\n20070412 00:00,1437400,1448000,1433400,1447400,0.0038676088474719527\n20070413 00:00,1449000,1452900,1443700,1452600,0.0038676088474719527\n20070416 00:00,1458700,1468600,1458400,1467800,0.0\n20070417 00:00,1469600,1474000,1466500,1470700,0.0\n20070418 00:00,1466000,1476400,1465700,1471500,0.0\n20070419 00:00,1465400,1474000,1463600,1470300,0.00047082590759603226\n20070420 00:00,1482000,1484800,1476900,1484700,0.00047082590759603226\n20070423 00:00,1483700,1487300,1479700,1481200,0.0014401695439503386\n20070424 00:00,1482300,1484000,1473300,1480400,0.0013962980436095695\n20070425 00:00,1487300,1496500,1481600,1494600,0.0013962980436095695\n20070426 00:00,1494900,1498000,1491000,1493900,0.000412740889417827\n20070427 00:00,1490300,1497400,1488400,1494000,0.00027040357850443994\n20070430 00:00,1496300,1497400,1482100,1482300,0.00452949630235321\n20070501 00:00,1485200,1494700,1476700,1486100,0.004521417770762109\n20070502 00:00,1489000,1499500,1487500,1496200,0.004521417770762109\n20070503 00:00,1499500,1504000,1490500,1502600,0.0\n20070504 00:00,1507500,1511100,1502200,1506400,0.0\n20070507 00:00,1508800,1512000,1508100,1509500,0.0\n20070508 00:00,1505700,1509200,1501300,1508600,0.0003442300379401794\n20070509 00:00,1506400,1528200,1504400,1513800,0.0003442300379401794\n20070510 00:00,1507300,1510200,1492700,1493300,0.007826097390309778\n20070511 00:00,1497500,1508200,1497200,1508100,0.007818523264887892\n20070514 00:00,1508600,1513000,1497900,1505500,0.007881627909773207\n20070515 00:00,1507000,1516600,1501900,1503800,0.0011898647167586953\n20070516 00:00,1508000,1516300,1503800,1516100,0.0011898647167586953\n20070517 00:00,1513800,1519600,1511100,1514400,0.0009187647676764085\n20070518 00:00,1519400,1525000,1518100,1524900,0.000647381741060851\n20070521 00:00,1525800,1532300,1525000,1527100,0.000647381741060851\n20070522 00:00,1527100,1531600,1524000,1526000,0.0004158766918398135\n20070523 00:00,1529500,1535000,1523700,1523800,0.0009304648547068117\n20070524 00:00,1525300,1532000,1507400,1510100,0.005273507461179759\n20070525 00:00,1514900,1520200,1511900,1518600,0.005257083556526656\n20070529 00:00,1519400,1525000,1514500,1520800,0.005190772206259298\n20070530 00:00,1514600,1533800,1513400,1533700,0.0\n20070531 00:00,1536600,1538900,1531200,1533500,7.528855306636795e-05\n20070601 00:00,1538800,1544000,1535100,1539600,7.528855306636795e-05\n20070604 00:00,1535300,1543900,1535000,1542400,7.528855306636795e-05\n20070605 00:00,1537200,1539000,1528600,1534400,0.002994555338120455\n20070606 00:00,1529100,1529500,1517600,1521000,0.005864251566241425\n20070607 00:00,1515500,1520600,1492500,1493600,0.011939978483618684\n20070608 00:00,1494200,1511900,1490900,1510500,0.011558361670938119\n20070611 00:00,1509600,1519500,1507000,1513000,0.01040065573688083\n20070612 00:00,1506700,1515400,1496700,1496700,0.006219966548440751\n20070613 00:00,1504500,1519800,1501900,1519500,0.006219966548440751\n20070614 00:00,1520600,1531200,1520300,1527100,0.006219966548440751\n20070615 00:00,1532500,1536600,1529300,1530400,0.0\n20070618 00:00,1533600,1533900,1526600,1529000,0.0005281562838901281\n20070619 00:00,1526400,1533800,1523600,1532000,0.0005281562838901281\n20070620 00:00,1535900,1535900,1509600,1510200,0.008232518033331752\n20070621 00:00,1510800,1521100,1502500,1519800,0.00821555866079233\n20070622 00:00,1515000,1517700,1498500,1502400,0.010544555430844703\n20070625 00:00,1502400,1512500,1490200,1496100,0.00703942285897723\n20070626 00:00,1502100,1504600,1488200,1490700,0.007341391291968757\n20070627 00:00,1482400,1505600,1480600,1505500,0.003194335764530408\n20070628 00:00,1503700,1514100,1503100,1504000,0.002161817333219532\n20070629 00:00,1508300,1516500,1491500,1499800,0.00171182749627528\n20070702 00:00,1508400,1518000,1507700,1518000,0.00171182749627528\n20070703 00:00,1521700,1525000,1519900,1522400,0.00161228133683276\n20070705 00:00,1524300,1525600,1516300,1524300,0.0\n20070706 00:00,1523800,1531600,1519300,1529600,0.0\n20070709 00:00,1531500,1533600,1526200,1530800,0.0\n20070710 00:00,1522700,1526000,1508700,1508900,0.008259714459924733\n20070711 00:00,1507500,1518900,1505300,1518400,0.008259714459924733\n20070712 00:00,1523600,1547500,1523400,1547500,0.008259714459924733\n20070713 00:00,1545700,1554600,1544000,1551100,0.0\n20070716 00:00,1549900,1555300,1545800,1549000,0.0007816617660358717\n20070717 00:00,1550200,1554800,1546800,1548600,0.0007957530310249756\n20070718 00:00,1543200,1548000,1533000,1545900,0.0012831597343368267\n20070719 00:00,1552000,1555300,1547600,1552200,0.00101759706531664\n20070720 00:00,1548700,1549900,1528300,1533300,0.0071016730521373675\n20070723 00:00,1542800,1547200,1538400,1540600,0.007029970421133801\n20070724 00:00,1531200,1535000,1507600,1511200,0.01306956300180888\n20070725 00:00,1520300,1523900,1502700,1517500,0.011017848834334014\n20070726 00:00,1501600,1507500,1464000,1485500,0.016420046878479956\n20070727 00:00,1482600,1488700,1459000,1460400,0.015600985246930533\n20070730 00:00,1458900,1478100,1453600,1472700,0.015600985246930533\n20070731 00:00,1483300,1488800,1453900,1453900,0.012226469572364415\n20070801 00:00,1452100,1470100,1439600,1466200,0.007370262144880105\n20070802 00:00,1467700,1477600,1461000,1472900,0.007370262144880105\n20070803 00:00,1472600,1475800,1432400,1433500,0.015444090302173417\n20070806 00:00,1442200,1468300,1427600,1467600,0.015444090302173417\n20070807 00:00,1459400,1489700,1456000,1476800,0.015444090302173417\n20070808 00:00,1484100,1505800,1479200,1498600,0.0\n20070809 00:00,1474100,1489500,1456500,1457200,0.015949753866575836\n20070810 00:00,1442400,1464600,1431200,1455400,0.01596569005810805\n20070813 00:00,1465100,1468900,1452800,1455100,0.01596613359810723\n20070814 00:00,1457000,1458400,1427500,1427700,0.010895707223696064\n20070815 00:00,1427000,1444300,1406300,1409000,0.013243625031758022\n20070816 00:00,1397900,1419200,1372500,1417300,0.013243090309318643\n20070817 00:00,1455600,1458100,1423300,1447400,0.007562127921724442\n20070820 00:00,1451300,1454500,1433000,1447500,0.0\n20070821 00:00,1445900,1458200,1441400,1449500,0.0\n20070822 00:00,1460100,1468000,1453300,1466600,0.0\n20070823 00:00,1473300,1476500,1456100,1465700,0.000354299224240179\n20070824 00:00,1464900,1482500,1462800,1481600,0.000354299224240179\n20070827 00:00,1478700,1479100,1468100,1469200,0.004845006916467037\n20070828 00:00,1461600,1462400,1434600,1436500,0.013728561637352454\n20070829 00:00,1443900,1467400,1439600,1467100,0.013728561637352454\n20070830 00:00,1454500,1471800,1453100,1461500,0.013037694367848875\n20070831 00:00,1476700,1485000,1468300,1474700,0.0022037771845558854\n20070904 00:00,1474700,1499800,1474000,1492000,0.0022037771845558854\n20070905 00:00,1481800,1483600,1470000,1475500,0.006384905791976445\n20070906 00:00,1479500,1486100,1471300,1482600,0.006384905791976445\n20070907 00:00,1464800,1468900,1452600,1458400,0.011383186872191491\n20070910 00:00,1465100,1467100,1443400,1455100,0.009514021555989226\n20070911 00:00,1462300,1477000,1461300,1476400,0.009514021555989226\n20070912 00:00,1472800,1484300,1469900,1476400,0.0013064014593566896\n20070913 00:00,1485700,1494500,1482000,1488100,0.0\n20070914 00:00,1479500,1490900,1477400,1489300,0.0\n20070917 00:00,1482900,1486500,1476300,1481300,0.0031013242150789255\n20070918 00:00,1488300,1525000,1483700,1523900,0.0031013242150789255\n20070919 00:00,1534100,1543700,1527100,1533600,0.0031013242150789255\n20070920 00:00,1533500,1534300,1521100,1523400,0.0038399665791172526\n20070921 00:00,1527000,1528800,1522500,1522700,0.0038491197629555987\n20070924 00:00,1524300,1528100,1513600,1515500,0.004718945541944022\n20070925 00:00,1508100,1516500,1504700,1516400,0.0027428276830847227\n20070926 00:00,1522700,1527700,1516400,1523700,0.002729967779710596\n20070927 00:00,1528900,1530800,1523600,1529400,0.0\n20070928 00:00,1528500,1531900,1519800,1524700,0.0017742554368976383\n20071001 00:00,1526100,1547400,1526000,1545200,0.0017742554368976383\n20071002 00:00,1546200,1546500,1538100,1544300,0.0018058417941805235\n20071003 00:00,1538100,1544100,1534500,1538000,0.002379195639004134\n20071004 00:00,1541000,1542600,1535900,1541600,0.002379195639004134\n20071005 00:00,1550200,1561000,1546400,1556000,0.002355310947286576\n20071008 00:00,1553900,1554900,1547700,1551900,0.001521295696450782\n20071009 00:00,1556000,1564000,1550300,1564000,0.001521295696450782\n20071010 00:00,1560400,1564400,1554100,1560300,0.002044479967915589\n20071011 00:00,1569200,1575200,1545400,1553500,0.002862983575109733\n20071012 00:00,1554700,1562300,1552700,1560600,0.002862983575109733\n20071015 00:00,1562700,1563600,1539400,1548300,0.005199766599587637\n20071016 00:00,1544100,1545100,1534800,1537700,0.006027439292657563\n20071017 00:00,1550000,1550900,1524700,1540300,0.006027439292657563\n20071018 00:00,1534400,1541900,1530800,1538200,0.004030280664161431\n20071019 00:00,1531000,1531500,1499100,1499700,0.014472069471715593\n20071022 00:00,1488300,1507600,1486600,1506000,0.014472069471715593\n20071023 00:00,1513000,1519500,1502600,1519400,0.014450647096476813\n20071024 00:00,1512100,1517100,1488400,1515600,0.0014439456515207203\n20071025 00:00,1516800,1522900,1498900,1513200,0.0017090453896571281\n20071026 00:00,1530600,1535000,1519000,1534500,0.0017090453896571281\n20071029 00:00,1539200,1544400,1535600,1540000,0.000914252207742857\n20071030 00:00,1534300,1537500,1528700,1530600,0.003524086058689896\n20071031 00:00,1539800,1552600,1528500,1547900,0.003524086058689896\n20071101 00:00,1533300,1534000,1505900,1507800,0.015366433309051348\n20071102 00:00,1515400,1515500,1492200,1511100,0.014956874342337381\n20071105 00:00,1496300,1511400,1489700,1501900,0.015364368132979565\n20071106 00:00,1508400,1520900,1499000,1520900,0.003515070132052516\n20071107 00:00,1504300,1511300,1475600,1475900,0.01744039138476233\n20071108 00:00,1479800,1484000,1450700,1475300,0.017084104393748592\n20071109 00:00,1455100,1475400,1449000,1452600,0.01925573885693587\n20071112 00:00,1452000,1466100,1439300,1439900,0.010220158189177344\n20071113 00:00,1452600,1483000,1452200,1481900,0.010217462703418745\n20071114 00:00,1492200,1493900,1468100,1471000,0.006596496506662389\n20071115 00:00,1467900,1474900,1445200,1453600,0.00804197515538277\n20071116 00:00,1462800,1464600,1445800,1460400,0.00804197515538277\n20071119 00:00,1452800,1453600,1432000,1435600,0.01194842049738031\n20071120 00:00,1436400,1455200,1421200,1442000,0.009804359542524446\n20071121 00:00,1430800,1439100,1417400,1418100,0.013700128789094636\n20071123 00:00,1430100,1443400,1427100,1441800,0.009569120272976482\n20071126 00:00,1443800,1448700,1407800,1408200,0.01651050241074753\n20071127 00:00,1417400,1432300,1409500,1430900,0.013454687921189791\n20071128 00:00,1442100,1474700,1441400,1472600,0.013454687921189791\n20071129 00:00,1466100,1477200,1461100,1472700,0.0\n20071130 00:00,1490400,1492500,1473400,1484600,0.0\n20071203 00:00,1482100,1484400,1473000,1475600,0.0035000353109973102\n20071204 00:00,1466600,1473400,1463100,1465500,0.005278898080940064\n20071205 00:00,1479200,1490000,1478300,1488600,0.005278898080940064\n20071206 00:00,1486300,1512100,1485700,1511100,0.003951774002992157\n20071207 00:00,1514200,1515000,1506200,1507500,0.0013754622255857838\n20071210 00:00,1512500,1522400,1508600,1520300,0.0013754622255857838\n20071211 00:00,1521200,1528800,1479600,1482400,0.014458506175150185\n20071212 00:00,1515200,1517200,1472000,1491300,0.014392932449047437\n20071213 00:00,1483200,1493700,1473000,1493000,0.014392932449047437\n20071214 00:00,1480500,1491000,1471700,1471800,0.008198141799611565\n20071217 00:00,1466200,1468700,1449400,1450700,0.011649818941087794\n20071218 00:00,1460900,1464700,1439600,1458200,0.011649818941087794\n20071219 00:00,1459300,1468900,1449400,1456300,0.00831111714004134\n20071220 00:00,1468400,1468500,1451800,1465400,0.0007522737014540324\n20071221 00:00,1473600,1482700,1470900,1482000,0.0007522737014540324\n20071224 00:00,1487300,1494800,1485400,1492000,0.0\n20071226 00:00,1488400,1496200,1485000,1494800,0.0\n20071227 00:00,1490100,1490300,1473200,1475200,0.007570287179633863\n20071228 00:00,1485400,1486100,1469000,1475400,0.007570287179633863\n20071231 00:00,1471000,1473300,1462600,1464200,0.008747446869195784\n20080102 00:00,1465300,1469900,1438800,1445600,0.008543937130194868\n20080103 00:00,1449200,1454900,1441300,1444600,0.008553266608930701\n20080104 00:00,1433400,1434400,1409200,1409300,0.015905545783242533\n20080107 00:00,1418100,1422300,1401100,1414600,0.01411368498037901\n20080108 00:00,1420800,1429000,1386300,1388100,0.01777679174390617\n20080109 00:00,1390200,1407900,1377000,1407800,0.010815624299112878\n20080110 00:00,1397000,1428000,1393700,1418000,0.010815624299112878\n20080111 00:00,1407600,1415700,1392900,1400300,0.007206699410900132\n20080114 00:00,1411600,1417000,1404100,1414600,0.007206699410900132\n20080115 00:00,1397400,1401000,1379100,1379500,0.016036188627757703\n20080116 00:00,1373800,1391200,1362800,1371400,0.014721246124825416\n20080117 00:00,1375800,1377000,1329300,1332300,0.02208334961354768\n20080118 00:00,1341800,1350100,1311100,1324900,0.017109498355974872\n20080122 00:00,1264500,1322500,1260000,1310200,0.01795207490359813\n20080123 00:00,1271200,1338800,1268400,1336200,0.007163640880021048\n20080124 00:00,1342800,1354500,1333200,1349900,0.006405803424475426\n20080125 00:00,1365000,1367600,1326000,1329800,0.008596740803549531\n20080128 00:00,1332900,1353300,1320600,1353200,0.008596740803549531\n20080129 00:00,1361000,1364500,1348900,1360700,0.008596740803549531\n20080130 00:00,1355800,1385400,1351500,1353700,0.0029701270554328024\n20080131 00:00,1334000,1385400,1332000,1374400,0.0029701270554328024\n20080201 00:00,1379200,1396100,1375200,1394500,0.0029701270554328024\n20080204 00:00,1391900,1393000,1378900,1380200,0.005920479633855623\n20080205 00:00,1358700,1362500,1336800,1337200,0.018936599027773695\n20080206 00:00,1345700,1352500,1324100,1327200,0.019422577171390325\n20080207 00:00,1320800,1347800,1317300,1337800,0.018498227614658476\n20080208 00:00,1332400,1342100,1321100,1331200,0.005172501594598224\n20080211 00:00,1331000,1342200,1320400,1339100,0.0028483418871666703\n20080212 00:00,1349100,1363000,1339800,1349200,0.0028483418871666703\n20080213 00:00,1360200,1370600,1351600,1367100,0.0\n20080214 00:00,1369400,1370000,1347900,1350100,0.007179397685775491\n20080215 00:00,1345500,1351500,1339100,1350700,0.007179397685775491\n20080219 00:00,1366700,1368800,1346100,1350300,0.007181433327558053\n20080220 00:00,1340000,1365500,1337700,1361100,0.00017097809112002875\n20080221 00:00,1366600,1370000,1340700,1344800,0.006916234202557098\n20080222 00:00,1349800,1356500,1328700,1356400,0.006914120481809495\n20080225 00:00,1355500,1376500,1347800,1373100,0.006914120481809495\n20080226 00:00,1367500,1389500,1365000,1383500,0.0\n20080227 00:00,1375800,1391400,1374200,1381200,0.0009598161323716314\n20080228 00:00,1372500,1379600,1365600,1370000,0.00477904632563535\n20080229 00:00,1356000,1356800,1327800,1332500,0.016510184944466124\n20080303 00:00,1331600,1338100,1322400,1333900,0.016482261977426367\n20080304 00:00,1322600,1334000,1309900,1329200,0.0159337779502309\n20080305 00:00,1334300,1347600,1323400,1337000,0.0020342951234659516\n20080306 00:00,1329800,1332100,1306600,1308200,0.012601845583737455\n20080307 00:00,1297200,1317400,1285800,1297100,0.013366608801521537\n20080310 00:00,1297900,1299200,1275900,1278600,0.015699469686961724\n20080311 00:00,1307100,1324500,1289600,1323900,0.00958150264754043\n20080312 00:00,1327500,1337700,1311600,1313100,0.009486300306509377\n20080313 00:00,1296100,1326100,1286000,1319200,0.0047098594359452845\n20080314 00:00,1327700,1328100,1277800,1292600,0.012558192026962484\n20080317 00:00,1263500,1292500,1260800,1279000,0.013131091801257797\n20080318 00:00,1306000,1333800,1299800,1333200,0.013131091801257797\n20080319 00:00,1341500,1346500,1302400,1303600,0.014184957586909313\n20080320 00:00,1300300,1329000,1292600,1327300,0.012818457821791886\n20080324 00:00,1333100,1358100,1332400,1347700,0.012818457821791886\n20080325 00:00,1348300,1355400,1337700,1350500,0.0\n20080326 00:00,1344600,1345800,1334600,1338300,0.005215604060802243\n20080327 00:00,1342000,1344400,1323700,1324500,0.007914890011080747\n20080328 00:00,1329900,1333500,1310800,1314000,0.009142975849251297\n20080331 00:00,1312800,1327300,1310900,1319400,0.007509426187195373\n20080401 00:00,1336000,1368400,1335200,1368000,0.004576955701390029\n20080402 00:00,1370600,1376600,1359900,1366600,0.000590855538644345\n20080403 00:00,1359400,1374300,1357100,1368000,0.000590855538644345\n20080404 00:00,1369500,1379600,1361200,1369700,0.000590855538644345\n20080407 00:00,1378700,1385700,1367500,1370500,0.0\n20080408 00:00,1361800,1369200,1359500,1364700,0.002443364875081979\n20080409 00:00,1366200,1368000,1349000,1353900,0.00518133692282945\n20080410 00:00,1354000,1366700,1349000,1359400,0.00518133692282945\n20080411 00:00,1344600,1350300,1330100,1332900,0.012146886826197282\n20080414 00:00,1331900,1335400,1325500,1328100,0.011445236936946619\n20080415 00:00,1335700,1336900,1323300,1335200,0.011445236936946619\n20080416 00:00,1345300,1365000,1345100,1362300,0.002079136688506442\n20080417 00:00,1360100,1368200,1356700,1364800,0.0\n20080418 00:00,1389500,1395600,1382600,1389600,0.0\n20080421 00:00,1382200,1389800,1378500,1387800,0.0007478630429917459\n20080422 00:00,1381900,1383000,1369000,1376900,0.004595856464800777\n20080423 00:00,1380800,1387800,1371200,1379800,0.004595856464800777\n20080424 00:00,1380900,1397400,1370400,1387900,0.00453460003903081\n20080425 00:00,1394000,1398900,1379100,1397600,0.0\n20080428 00:00,1398900,1402400,1393900,1396200,0.0005783417121246964\n20080429 00:00,1394000,1397300,1386200,1390700,0.002346716573610059\n20080430 00:00,1393000,1405800,1383600,1384300,0.003544932099256607\n20080501 00:00,1383900,1410200,1382700,1409300,0.0034974368403670325\n20080502 00:00,1423300,1423500,1405700,1413400,0.0026569653575994777\n20080505 00:00,1410500,1415500,1404100,1407100,0.002573444669516532\n20080506 00:00,1400200,1421900,1396900,1418400,0.002573444669516532\n20080507 00:00,1418900,1420400,1391400,1392800,0.010733380922218939\n20080508 00:00,1397500,1403200,1389800,1398400,0.010420309426998339\n20080509 00:00,1386000,1393900,1384500,1389300,0.011076932230170844\n20080512 00:00,1392400,1405300,1387300,1404700,0.0037570705446407543\n20080513 00:00,1408200,1408800,1397400,1404000,0.0037680705529453138\n20080514 00:00,1411000,1422000,1408800,1409600,0.0002877092535293721\n20080515 00:00,1410400,1426300,1408300,1425500,0.0002877092535293721\n20080516 00:00,1428600,1428700,1416100,1426500,0.0\n20080519 00:00,1428000,1442200,1423300,1428300,0.0\n20080520 00:00,1422700,1423400,1410700,1416300,0.004850663887331446\n20080521 00:00,1418100,1421200,1390400,1393100,0.010628805050818558\n20080522 00:00,1394300,1401600,1392400,1395700,0.010628805050818558\n20080523 00:00,1390400,1392000,1375700,1378600,0.011810124616600772\n20080527 00:00,1378000,1390000,1375300,1387400,0.007073647347669722\n20080528 00:00,1391800,1393700,1380500,1393700,0.007073647347669722\n20080529 00:00,1391300,1409200,1390800,1400300,0.0\n20080530 00:00,1404700,1407400,1400600,1401000,0.0\n20080602 00:00,1398200,1398400,1380300,1388300,0.005233653403788896\n20080603 00:00,1393300,1396200,1372300,1380100,0.006246603812799583\n20080604 00:00,1377900,1391600,1374600,1380400,0.006246603812799583\n20080605 00:00,1385700,1408200,1383200,1406400,0.0034101218809730527\n20080606 00:00,1395800,1398000,1363500,1363800,0.017487998768115784\n20080609 00:00,1368600,1375000,1354200,1366200,0.017487998768115784\n20080610 00:00,1356600,1371000,1355200,1361400,0.017605247758231996\n20080611 00:00,1359700,1360800,1339400,1339500,0.009506412191206834\n20080612 00:00,1346000,1357700,1335200,1344500,0.009506412191206834\n20080613 00:00,1351800,1364200,1346100,1364000,0.009287476785112974\n20080616 00:00,1355200,1369300,1354600,1363900,4.2327732345306085e-05\n20080617 00:00,1370600,1371100,1354500,1355000,0.0037676821556422227\n20080618 00:00,1347000,1350800,1337200,1343200,0.006282887706174509\n20080619 00:00,1341500,1352400,1335200,1347100,0.006282745123866899\n20080620 00:00,1328400,1330900,1312300,1315900,0.014285929816490127\n20080623 00:00,1320400,1322200,1313200,1316300,0.013371931110323133\n20080624 00:00,1310500,1324400,1302000,1312400,0.013480901397083406\n20080625 00:00,1317300,1334000,1316200,1320000,0.0017106024841141954\n20080626 00:00,1305900,1307500,1281700,1282100,0.016664977118451264\n20080627 00:00,1282900,1288600,1270400,1278000,0.016679451742351897\n20080630 00:00,1278900,1289100,1273000,1278400,0.016679451742351897\n20080701 00:00,1265200,1284500,1259400,1283700,0.0018462960016203402\n20080702 00:00,1287900,1291500,1260400,1260700,0.010344360981040253\n20080703 00:00,1270900,1271200,1250500,1263800,0.010344360981040253\n20080707 00:00,1267800,1273400,1239200,1250900,0.011905273564756357\n20080708 00:00,1250000,1273900,1242100,1272800,0.0058931939171911266\n20080709 00:00,1274900,1277400,1243900,1244300,0.014207649959728905\n20080710 00:00,1244400,1257900,1236000,1253800,0.012927783368875201\n20080711 00:00,1239200,1257400,1224900,1240200,0.014364779854444575\n20080714 00:00,1252800,1255000,1224100,1228200,0.008392063602254243\n20080715 00:00,1218100,1234600,1200300,1214300,0.010635838344393246\n20080716 00:00,1215600,1245700,1211100,1244700,0.008596612114895916\n20080717 00:00,1251500,1262600,1241100,1259000,0.006534089514521914\n20080718 00:00,1261700,1262800,1251500,1259200,0.0\n20080721 00:00,1265100,1267900,1255500,1259900,0.0\n20080722 00:00,1251700,1278000,1248900,1276900,0.0\n20080723 00:00,1279000,1291400,1275800,1282200,0.0\n20080724 00:00,1283700,1284100,1251600,1254300,0.01256283926874947\n20080725 00:00,1259000,1263300,1251800,1257200,0.01256283926874947\n20080728 00:00,1254900,1260600,1234300,1235600,0.016006903006974712\n20080729 00:00,1239900,1263000,1238500,1262700,0.009919476467145952\n20080730 00:00,1270200,1284700,1265100,1284500,0.009919476467145952\n20080731 00:00,1274400,1285700,1266300,1268500,0.007191595412249148\n20080801 00:00,1271300,1272800,1254600,1261100,0.007941216191047238\n20080804 00:00,1260400,1261400,1247600,1249200,0.009630346768295247\n20080805 00:00,1260200,1284700,1259000,1284200,0.006405039758200701\n20080806 00:00,1280500,1293000,1276800,1290900,0.005447996355052369\n20080807 00:00,1279500,1284400,1265400,1268600,0.009973592844471805\n20080808 00:00,1266000,1299300,1263900,1296200,0.009973592844471805\n20080811 00:00,1294500,1315000,1292300,1306500,0.009973592844471805\n20080812 00:00,1302900,1303500,1287300,1292400,0.006230875465421929\n20080813 00:00,1287800,1296500,1276700,1288200,0.006507237468897613\n20080814 00:00,1278300,1302800,1277500,1295200,0.006507237468897613\n20080815 00:00,1299200,1305000,1293000,1300500,0.0018762543566979626\n20080818 00:00,1304400,1304700,1276600,1282400,0.008035401670382344\n20080819 00:00,1274200,1276900,1265400,1270000,0.009784337056115082\n20080820 00:00,1273800,1279400,1263400,1277100,0.009784337056115082\n20080821 00:00,1267500,1284400,1266100,1279800,0.005582613332775554\n20080822 00:00,1286900,1296400,1285600,1295100,0.0\n20080825 00:00,1287900,1288300,1267600,1270800,0.01083284035310625\n20080826 00:00,1270400,1278700,1265900,1274400,0.01083284035310625\n20080827 00:00,1275500,1288300,1273000,1284600,0.01083284035310625\n20080828 00:00,1291900,1303400,1291300,1303100,0.0\n20080829 00:00,1296800,1301300,1286100,1286900,0.007177556872743426\n20080902 00:00,1300600,1307000,1275200,1281000,0.007650078055220041\n20080903 00:00,1278900,1285000,1269300,1279600,0.007676055949116681\n20080904 00:00,1269700,1272200,1240000,1240700,0.01776120434363324\n20080905 00:00,1233000,1249500,1221100,1246400,0.017562858769198237\n20080908 00:00,1280500,1282400,1251000,1272500,0.017551520374708085\n20080909 00:00,1271000,1273600,1229200,1229400,0.01955504644563682\n20080910 00:00,1238900,1248900,1226000,1236000,0.01955504644563682\n20080911 00:00,1221200,1255300,1216000,1255100,0.01955504644563682\n20080912 00:00,1242900,1259800,1238300,1257400,0.0\n20080915 00:00,1217900,1242600,1201400,1203600,0.02470291433306969\n20080916 00:00,1172500,1220900,1171600,1218500,0.02470291433306969\n20080917 00:00,1197000,1203700,1160300,1163500,0.03590771780822948\n20080918 00:00,1179500,1217900,1138200,1205500,0.026060127045900227\n20080919 00:00,1276000,1279900,1233300,1250500,0.026060127045900227\n20080922 00:00,1244400,1247500,1203600,1207000,0.020083755865452784\n20080923 00:00,1208600,1220200,1185000,1187000,0.022245875449578154\n20080924 00:00,1191600,1196800,1178000,1188100,0.022245875449578154\n20080925 00:00,1195700,1218900,1190700,1210000,0.009566698743821447\n20080926 00:00,1191400,1215000,1185100,1213300,0.0\n20080929 00:00,1191400,1193400,1109700,1130200,0.03954323528365441\n20080930 00:00,1135100,1167400,1127100,1165400,0.03954323528365441\n20081001 00:00,1152100,1166900,1139500,1160000,0.03963362477918778\n20081002 00:00,1149500,1151100,1110600,1113600,0.023248442738650933\n20081003 00:00,1128400,1154400,1096900,1099700,0.024339758952637305\n20081006 00:00,1071200,1076200,1006500,1062800,0.03099307932856434\n20081007 00:00,1068400,1073200,996500,997400,0.04110287432954896\n20081008 00:00,975000,1021800,968100,983900,0.041213828241810184\n20081009 00:00,996400,1006200,909000,917200,0.05343378139581976\n20081010 00:00,870700,939300,835800,904500,0.040704652942367005\n20081013 00:00,939500,1009200,931700,1006800,0.039947485964246306\n20081014 00:00,1046600,1055300,971100,999100,0.009132671626742986\n20081015 00:00,974600,977700,905000,907500,0.05311677458933308\n20081016 00:00,912100,947700,865400,944100,0.05311677458933308\n20081017 00:00,920400,985800,916600,940900,0.052969085129267346\n20081020 00:00,954300,985500,943700,984900,0.001956912256547848\n20081021 00:00,970300,986400,952300,955000,0.01763634218697437\n20081022 00:00,932000,935000,875300,903900,0.03551865029474299\n20081023 00:00,903900,924400,858100,910400,0.03551865029474299\n20081024 00:00,840100,898600,838100,875400,0.038039806777115215\n20081027 00:00,859800,895100,846800,848200,0.028539032144025048\n20081028 00:00,873900,941300,845400,937700,0.028539032144025048\n20081029 00:00,936100,971700,921000,923600,0.01992940760314582\n20081030 00:00,958200,965100,929100,954400,0.008681495996132828\n20081031 00:00,950300,985700,944800,971300,0.008681495996132828\n20081103 00:00,968400,976900,959500,967400,0.0023181983422624684\n20081104 00:00,990300,1008600,982000,1002800,0.0023181983422624684\n20081105 00:00,992100,1002000,950900,957000,0.026470515041003225\n20081106 00:00,945000,954400,901100,908100,0.039567933306098445\n20081107 00:00,916500,934100,908600,931300,0.039567933306098445\n20081110 00:00,952100,955300,909200,921700,0.0300952934662779\n20081111 00:00,907100,920300,886500,901600,0.013926314932383938\n20081112 00:00,882300,889500,851200,857300,0.03160201641441296\n20081113 00:00,860900,916500,821000,910500,0.031036558697274765\n20081114 00:00,893800,920600,872300,876800,0.03551605455002354\n20081117 00:00,864100,885500,851600,853000,0.026499938771155026\n20081118 00:00,851300,870000,829100,861700,0.026499938771155026\n20081119 00:00,858900,868600,809300,813400,0.03595659913932264\n20081120 00:00,800700,825100,750800,759500,0.05010949284626476\n20081121 00:00,774400,805300,743400,802700,0.05010949284626476\n20081124 00:00,819200,869800,811700,848900,0.03825815036798728\n20081125 00:00,872300,875000,838300,860600,0.0\n20081126 00:00,843400,891500,842400,890200,0.0\n20081128 00:00,886600,900400,884800,898200,0.0\n20081201 00:00,874600,875400,819700,821300,0.049430233467693444\n20081202 00:00,834400,854900,822400,852700,0.049430233467693444\n20081203 00:00,834400,878200,831400,874100,0.049430233467693444\n20081204 00:00,860400,880500,837400,850000,0.015918249041837324\n20081205 00:00,835800,884200,822500,879700,0.015918249041837324\n20081208 00:00,904000,923800,898000,910600,0.015918249041837324\n20081209 00:00,903600,921300,889800,895500,0.009573895305033338\n20081210 00:00,903400,913600,890000,902500,0.009573895305033338\n20081211 00:00,895100,910000,873700,880300,0.01712752797734731\n20081212 00:00,855600,889000,852100,884700,0.014201857037129877\n20081215 00:00,890100,891400,862900,874800,0.015602345618347445\n20081216 00:00,883500,920200,881800,918700,0.006460684599273536\n20081217 00:00,908500,924300,900700,910200,0.008383010975812453\n20081218 00:00,913600,916700,882100,892000,0.012720423425330824\n20081219 00:00,891000,903800,880900,882800,0.014045213625045867\n20081222 00:00,886500,886700,854900,865700,0.017140642652230607\n20081223 00:00,874900,879300,858000,861900,0.012920893518657366\n20081224 00:00,864700,868600,860000,865600,0.011466936629589138\n20081226 00:00,872800,873000,865000,871000,0.0025342855757428313\n20081229 00:00,873300,873300,856100,868900,0.001392004093338929\n20081230 00:00,876700,890500,870900,888700,0.001392004093338929\n20081231 00:00,890700,909700,888700,903300,0.001392004093338929\n20090102 00:00,905000,934400,898600,930300,0.0\n20090105 00:00,926000,936600,918900,928400,0.0011791524362681728\n20090106 00:00,936900,944500,926800,934400,0.0011791524362681728\n20090107 00:00,920000,922600,902000,906200,0.017464165202936453\n20090108 00:00,901600,910900,896700,910100,0.017424312490525968\n20090109 00:00,912700,913100,888100,890100,0.021554174411372775\n20090112 00:00,888600,889100,864100,869400,0.01847304512891147\n20090113 00:00,866800,877700,862100,870500,0.01847304512891147\n20090114 00:00,856100,857500,836900,842100,0.02313164371473876\n20090115 00:00,841500,852500,817200,844400,0.01883601107982237\n20090116 00:00,859000,859600,830500,850200,0.01883601107982237\n20090120 00:00,842900,844600,804700,805400,0.03042259710620472\n20090121 00:00,819900,842400,804700,840200,0.03042259710620472\n20090122 00:00,824300,840400,811700,828400,0.0314846253970752\n20090123 00:00,808800,839900,805800,831100,0.008108466051461087\n20090126 00:00,835700,853600,828100,837300,0.008108466051461087\n20090127 00:00,840800,851400,833000,845900,0.0\n20090128 00:00,864200,879500,860700,873800,0.0\n20090129 00:00,861300,863500,844700,845700,0.01856665434221616\n20090130 00:00,850000,852500,822100,826900,0.022570921848655213\n20090202 00:00,815100,831800,813100,825200,0.022602110124248807\n20090203 00:00,830900,843600,822200,837200,0.01288932615016534\n20090204 00:00,843200,853700,830400,833300,0.002939793563498106\n20090205 00:00,827400,852900,821300,845700,0.0026895198875293335\n20090206 00:00,848600,873400,846900,870000,0.0026895198875293335\n20090209 00:00,869800,877400,863200,871300,0.0\n20090210 00:00,862600,870300,824500,829200,0.02789675924811573\n20090211 00:00,834500,840500,824100,836300,0.02789675924811573\n20090212 00:00,821500,838200,810000,836100,0.027897100934862033\n20090213 00:00,835100,842300,827400,827400,0.0060091780577313245\n20090217 00:00,801700,806200,791700,791900,0.02548994235199654\n20090218 00:00,798100,799400,782800,789700,0.025539983617234384\n20090219 00:00,797700,801500,780200,782800,0.025330762865551793\n20090220 00:00,767000,783300,757700,773800,0.00849013524942226\n20090223 00:00,782600,782600,745900,746500,0.022009378532908012\n20090224 00:00,752700,779500,748400,774700,0.021423463826273408\n20090225 00:00,771900,784200,756300,768300,0.020920145758288315\n20090226 00:00,778300,783800,755400,755400,0.010803752090733384\n20090227 00:00,740200,755800,738200,739300,0.016374941872816122\n20090302 00:00,725000,729200,703800,705800,0.030492883455098742\n20090303 00:00,715600,717000,696400,700700,0.029210420005101045\n20090304 00:00,713200,728700,704100,716700,0.026492092683937343\n20090305 00:00,700600,708600,681700,687900,0.023572448091159624\n20090306 00:00,694500,704500,671000,688400,0.023200345685309338\n20090309 00:00,679700,700000,677300,681100,0.023994577821850577\n20090310 00:00,695100,723600,693700,721600,0.006122395358925456\n20090311 00:00,730300,737400,718400,726100,0.006122395358925456\n20090312 00:00,725800,757500,719700,755300,0.0\n20090313 00:00,759500,763800,747300,761500,0.0\n20090316 00:00,769800,779600,758100,759600,0.0014405325166911163\n20090317 00:00,760000,782900,754500,782400,0.0014405325166911163\n20090318 00:00,777700,809000,770700,798900,0.0014405325166911163\n20090319 00:00,809700,810000,786900,788400,0.007588155997610536\n20090320 00:00,787600,788600,765300,766500,0.017742089999056142\n20090323 00:00,791100,822700,784000,822200,0.017742089999056142\n20090324 00:00,812100,823600,805100,806000,0.019662336386330668\n20090325 00:00,812800,827000,790600,813200,0.011375668159659359\n20090326 00:00,823000,833000,814800,831100,0.011375668159659359\n20090327 00:00,820800,825300,813200,816100,0.010420231064666592\n20090330 00:00,797300,798800,779600,787600,0.022695837093589938\n20090331 00:00,795500,810700,790500,794400,0.022695837093589938\n20090401 00:00,785100,814200,783300,810000,0.020162336321412018\n20090402 00:00,831600,846100,827300,833900,0.0\n20090403 00:00,835100,842800,826700,842700,0.0\n20090406 00:00,833800,838100,822900,834800,0.00541244467378433\n20090407 00:00,822200,826500,815100,816100,0.014019860101944476\n20090408 00:00,820400,829400,815400,824900,0.014019860101944476\n20090409 00:00,847300,858200,843400,858200,0.012932977999336357\n20090413 00:00,849500,865400,845800,858300,0.0\n20090414 00:00,850500,857600,840800,843800,0.009753674593090508\n20090415 00:00,838900,854200,836100,853100,0.009753674593090508\n20090416 00:00,859700,871500,847800,866200,0.009753674593090508\n20090417 00:00,868500,876500,861400,871400,0.0\n20090420 00:00,855300,856600,833400,834100,0.024713294744977115\n20090421 00:00,827900,851300,827600,850800,0.024713294744977115\n20090422 00:00,843200,863400,840700,845700,0.024954446112188545\n20090423 00:00,847400,854200,836300,853700,0.003460844349867318\n20090424 00:00,860400,873100,856900,866800,0.003460844349867318\n20090427 00:00,857500,870100,855400,858400,0.005594995686655354\n20090428 00:00,849700,865900,847600,855600,0.005903439904442062\n20090429 00:00,865300,883600,863000,873600,0.005903439904442062\n20090430 00:00,885800,890200,869400,875500,0.0018832487811404211\n20090501 00:00,874800,882000,867200,878400,0.0\n20090504 00:00,885400,909300,883800,909200,0.0\n20090505 00:00,906100,909200,898400,905600,0.0022860327420618463\n20090506 00:00,917100,922000,906100,921100,0.0022860327420618463\n20090507 00:00,930900,931500,902900,909000,0.007921376340021297\n20090508 00:00,920600,932200,914400,929900,0.00758434291303277\n20090511 00:00,916800,921000,910400,911400,0.01376423350312825\n20090512 00:00,916300,918200,898500,910100,0.01151564372019672\n20090513 00:00,897000,900000,885000,888000,0.01814291840844069\n20090514 00:00,887200,901100,885000,894500,0.014043988816186384\n20090515 00:00,893500,899900,881500,887300,0.014769966889174377\n20090518 00:00,895900,913100,893700,912400,0.004647201719581105\n20090519 00:00,912000,919700,908200,911200,0.004708829851783097\n20090520 00:00,919600,928000,904100,905100,0.00393893797862891\n20090521 00:00,894600,898000,882600,892400,0.009007986452623051\n20090522 00:00,894100,900000,886800,890400,0.009068708425336726\n20090526 00:00,883300,915600,883200,913000,0.008203830498910504\n20090527 00:00,914500,917500,895300,897100,0.01013753705500942\n20090528 00:00,904200,913400,891000,909300,0.01005462133638011\n20090529 00:00,914400,926800,906800,924100,0.01005462133638011\n20090601 00:00,936800,951700,934300,947800,0.0\n20090602 00:00,944300,953600,941600,948800,0.0\n20090603 00:00,940500,941300,927600,936400,0.007545471477604749\n20090604 00:00,940000,946700,933000,946000,0.007545471477604749\n20090605 00:00,955000,956600,938000,945300,0.0075575559735615375\n20090608 00:00,938300,951000,930400,943000,0.0014682716016919558\n20090609 00:00,946700,951400,940200,946200,0.0014682716016919558\n20090610 00:00,954800,954900,932000,943400,0.0022118486032352857\n20090611 00:00,946000,961100,945700,948500,0.0017084979430680358\n20090612 00:00,943800,951300,940000,950900,0.0017084979430680358\n20090615 00:00,940000,940200,924200,928800,0.013418278419487598\n20090616 00:00,931800,932900,915800,916400,0.015474581694535073\n20090617 00:00,916000,923300,908300,915200,0.015493038784982512\n20090618 00:00,916500,926700,912600,920800,0.0077449373819344575\n20090619 00:00,925500,927000,915200,920400,0.0007965392025137103\n20090622 00:00,911300,911800,892600,892700,0.017377518860295236\n20090623 00:00,894900,898700,888500,893600,0.017377518860295236\n20090624 00:00,901900,910800,896000,901500,0.017375708883694725\n20090625 00:00,896600,921700,895700,920000,0.0\n20090626 00:00,917600,922400,912800,918900,0.0006903101044658561\n20090629 00:00,921300,928200,916000,926800,0.0006903101044658561\n20090630 00:00,927200,930600,912700,919200,0.00478448294172579\n20090701 00:00,923800,932300,922200,923400,0.004734421715409117\n20090702 00:00,911600,911600,897600,898500,0.016272530880673118\n20090706 00:00,889900,899300,886600,898000,0.015571889311716006\n20090707 00:00,897300,898200,880000,881100,0.018987965669843156\n20090708 00:00,885500,888000,870100,880000,0.010894120509860489\n20090709 00:00,885800,889000,879100,882000,0.010889381857118918\n20090710 00:00,877700,884900,873500,879500,0.0017881838941060067\n20090713 00:00,882700,901700,875900,901300,0.0016364803548458906\n20090714 00:00,903900,906900,897300,906300,0.0016364803548458906\n20090715 00:00,918300,935100,916800,932500,0.0\n20090716 00:00,930100,945100,928200,941200,0.0\n20090717 00:00,940600,943200,935400,941700,0.0\n20090720 00:00,947300,952800,941900,950700,0.0\n20090721 00:00,958900,959000,944200,955700,0.0\n20090722 00:00,949600,961300,948900,955500,0.00012082249015166472\n20090723 00:00,956000,980800,955300,977000,0.00012082249015166472\n20090724 00:00,971200,981400,966900,981000,0.00012082249015166472\n20090727 00:00,979600,984000,973400,983500,0.0\n20090728 00:00,976800,983700,970600,981100,0.0014088872862786923\n20090729 00:00,973800,979300,969800,976800,0.002896212353458044\n20090730 00:00,988300,998300,986000,987000,0.002896212353458044\n20090731 00:00,986700,994700,983800,988100,0.0025304313092603887\n20090803 00:00,998800,1005300,993100,1004500,0.0\n20090804 00:00,1000300,1008400,997800,1006800,0.0\n20090805 00:00,1007800,1008500,995800,1003700,0.0017776974915453036\n20090806 00:00,1008200,1010200,994200,998900,0.0032838529565361587\n20090807 00:00,1009600,1020200,1004000,1012000,0.0032838529565361587\n20090810 00:00,1007400,1012200,1002700,1009800,0.003032949253708854\n20090811 00:00,1005200,1006100,994600,996600,0.007650715607455024\n20090812 00:00,995400,1015600,995300,1007700,0.007650715607455024\n20090813 00:00,1013100,1016100,1002600,1015700,0.0075470623423480225\n20090814 00:00,1016000,1016000,997000,1007300,0.004774778242781194\n20090817 00:00,988500,989400,981200,982700,0.01488641438337207\n20090818 00:00,985300,994400,983600,991600,0.01488641438337207\n20090819 00:00,983600,1003000,982500,1000100,0.014099887443725577\n20090820 00:00,1000200,1012200,998700,1010100,0.0\n20090821 00:00,1018200,1031300,1016200,1029700,0.0\n20090824 00:00,1034100,1039500,1025900,1029600,5.6069755189795824e-05\n20090825 00:00,1033400,1042100,1029400,1031400,5.6069755189795824e-05\n20090826 00:00,1028200,1036400,1024900,1031700,5.6069755189795824e-05\n20090827 00:00,1030700,1037100,1019400,1034300,0.0\n20090828 00:00,1042200,1043500,1026700,1033300,0.0005582038762348002\n20090831 00:00,1023400,1025800,1017900,1025500,0.00439380619556247\n20090901 00:00,1018900,1032400,999900,1002000,0.013940871026287853\n20090902 00:00,997600,1004300,995700,998000,0.014119077775616492\n20090903 00:00,1003600,1007700,996000,1006500,0.013429609671065944\n20090904 00:00,1008800,1020900,1005500,1020800,0.0023047914937709578\n20090908 00:00,1030300,1030500,1023900,1028900,0.0\n20090909 00:00,1031300,1040800,1028000,1037600,0.0\n20090910 00:00,1037900,1048600,1032200,1048200,0.0\n20090911 00:00,1049800,1053000,1042800,1047900,0.00016524048917849384\n20090914 00:00,1038700,1054600,1038700,1053400,0.00016524048917849384\n20090915 00:00,1054600,1061100,1047700,1057400,0.00016524048917849384\n20090916 00:00,1061200,1073400,1057300,1073300,0.0\n20090917 00:00,1072000,1080600,1065700,1071600,0.0009144651612991236\n20090918 00:00,1071400,1071600,1063700,1067200,0.0025408696209617454\n20090921 00:00,1059100,1067100,1056700,1064400,0.0029581410171313433\n20090922 00:00,1070400,1073700,1066000,1070800,0.0028132457670820422\n20090923 00:00,1072900,1080300,1059900,1061400,0.005289786068084072\n20090924 00:00,1064000,1066400,1045500,1049500,0.008221149735023746\n20090925 00:00,1047600,1053600,1040900,1044500,0.008669087941914233\n20090928 00:00,1048500,1065500,1048300,1063200,0.007033194789358176\n20090929 00:00,1065000,1070200,1057800,1060300,0.0031695020928643796\n20090930 00:00,1063700,1064600,1046200,1055600,0.003004928173382799\n20091001 00:00,1052900,1053800,1029500,1030500,0.014053226261595834\n20091002 00:00,1020000,1031000,1019900,1025400,0.014254037520981548\n20091005 00:00,1028600,1043200,1026000,1040100,0.014022408960662572\n20091006 00:00,1047800,1061100,1047200,1055500,0.0028573375767754297\n20091007 00:00,1052800,1059100,1050700,1057700,0.0\n20091008 00:00,1065900,1071700,1061500,1066400,0.0\n20091009 00:00,1066100,1072600,1063600,1072500,0.0\n20091012 00:00,1077900,1080900,1072800,1077600,0.0\n20091013 00:00,1074200,1076500,1067600,1075000,0.0013930128989356192\n20091014 00:00,1087400,1094200,1082600,1093100,0.0013930128989356192\n20091015 00:00,1088300,1097000,1087300,1096500,0.0013930128989356192\n20091016 00:00,1087400,1092700,1082300,1088600,0.004159659942177902\n20091019 00:00,1090200,1101300,1087300,1098600,0.004159659942177902\n20091020 00:00,1099800,1099900,1086800,1092000,0.005416029422212297\n20091021 00:00,1090500,1103100,1081500,1081500,0.006545925778805824\n20091022 00:00,1081600,1096800,1075100,1093400,0.006545925778805824\n20091023 00:00,1097200,1097400,1076400,1080800,0.008665083126045046\n20091026 00:00,1082000,1093100,1066200,1068300,0.009426139689630917\n20091027 00:00,1070100,1073900,1061600,1064000,0.00970837525664363\n20091028 00:00,1061300,1064700,1043500,1043800,0.013043402834219758\n20091029 00:00,1052000,1068600,1049400,1066500,0.01120461392439037\n20091030 00:00,1063000,1066200,1034400,1035600,0.019998996491457893\n20091102 00:00,1040600,1054100,1030800,1043600,0.01672772931829295\n20091103 00:00,1036900,1048000,1035500,1046500,0.01672772931829295\n20091104 00:00,1055600,1063300,1046500,1049100,0.0\n20091105 00:00,1056300,1068800,1054400,1068600,0.0\n20091106 00:00,1062000,1073900,1060500,1071600,0.0\n20091109 00:00,1080000,1096300,1078800,1096300,0.0\n20091110 00:00,1093300,1099200,1089700,1095700,0.0003159811744173958\n20091111 00:00,1103000,1108200,1096200,1101500,0.0003159811744173958\n20091112 00:00,1100200,1105700,1087500,1089900,0.006088335086064698\n20091113 00:00,1092700,1100900,1087500,1096100,0.006080129934271162\n20091116 00:00,1103900,1116900,1103200,1112200,0.006080129934271162\n20091117 00:00,1109100,1113900,1105000,1113200,0.0\n20091118 00:00,1112900,1114300,1105800,1112700,0.0002593200993485373\n20091119 00:00,1104800,1105500,1091400,1097700,0.007787417664902602\n20091120 00:00,1092900,1097600,1090100,1094300,0.007990106762762135\n20091123 00:00,1106900,1116300,1106000,1109200,0.007985897517900607\n20091124 00:00,1110500,1111400,1101000,1109900,0.0017882763188892567\n20091125 00:00,1111300,1115000,1108200,1113700,0.0\n20091127 00:00,1084100,1103200,1082900,1095000,0.009694217503677804\n20091130 00:00,1095300,1101500,1090200,1098800,0.009694217503677804\n20091201 00:00,1110400,1116600,1107300,1112500,0.009694217503677804\n20091202 00:00,1112700,1120100,1109200,1113200,0.0\n20091203 00:00,1115700,1121800,1102900,1103800,0.004875217867752848\n20091204 00:00,1118800,1123800,1100400,1110100,0.004875217867752848\n20091207 00:00,1109100,1115200,1105000,1108000,0.004996060377307895\n20091208 00:00,1100400,1102500,1092700,1096100,0.00629623593942415\n20091209 00:00,1095600,1101800,1090200,1099700,0.00629623593942415\n20091210 00:00,1107400,1111100,1104500,1106500,0.006200783577036618\n20091211 00:00,1111600,1113600,1106100,1111800,0.0\n20091214 00:00,1118800,1119900,1113700,1119000,0.0\n20091215 00:00,1114600,1119200,1110000,1113000,0.0030957118991400863\n20091216 00:00,1117800,1121300,1112700,1114900,0.0030957118991400863\n20091217 00:00,1106900,1109300,1100800,1101300,0.0076930995720460625\n20091218 00:00,1101600,1103000,1092800,1101900,0.007042751512224309\n20091221 00:00,1108300,1117000,1107600,1113300,0.007042751512224309\n20091222 00:00,1115700,1119600,1114300,1117400,0.0\n20091223 00:00,1120300,1121100,1115000,1119700,0.0\n20091224 00:00,1122000,1126000,1121800,1126000,0.0\n20091228 00:00,1129500,1129800,1123200,1126700,0.0\n20091229 00:00,1130300,1130300,1125500,1126200,0.00025621295339912025\n20091230 00:00,1121800,1126400,1121700,1124500,0.0009083920649945774\n20091231 00:00,1127400,1128000,1114300,1114400,0.005264589725495348\n20100104 00:00,1123300,1133900,1123300,1133300,0.0052583514432093335\n20100105 00:00,1132900,1136800,1129200,1136500,0.005185627139897938\n20100106 00:00,1135500,1139900,1134300,1137300,0.0\n20100107 00:00,1135500,1143300,1131800,1142100,0.0\n20100108 00:00,1138700,1146200,1136600,1146200,0.0\n20100111 00:00,1151100,1151300,1142400,1147400,0.0\n20100112 00:00,1139800,1142100,1132200,1136700,0.0053840403349563965\n20100113 00:00,1139500,1149400,1133700,1146400,0.0053840403349563965\n20100114 00:00,1145100,1151300,1144200,1149400,0.0053840403349563965\n20100115 00:00,1147100,1148400,1132000,1136700,0.0063792834685125034\n20100119 00:00,1136200,1151300,1135800,1151200,0.0063792834685125034\n20100120 00:00,1142800,1142900,1129800,1138600,0.008979253930741563\n20100121 00:00,1138900,1142700,1115600,1116500,0.012865141862480502\n20100122 00:00,1112500,1116200,1090900,1092100,0.018019741893742818\n20100125 00:00,1102000,1104100,1094100,1097800,0.01687540679023795\n20100126 00:00,1093600,1104600,1090400,1092900,0.012877891315296834\n20100127 00:00,1091600,1100700,1083400,1098100,0.0025769869912818343\n20100128 00:00,1102100,1102500,1079100,1085400,0.007157322234059174\n20100129 00:00,1090800,1098000,1072200,1073700,0.00912789575229161\n20100201 00:00,1081500,1090700,1080800,1090600,0.00912789575229161\n20100202 00:00,1092800,1105900,1088800,1104100,0.006223510364398955\n20100203 00:00,1099100,1104200,1095100,1098200,0.0030851975257846407\n20100204 00:00,1089500,1090300,1064300,1064900,0.017776388623052218\n20100205 00:00,1065300,1068800,1045800,1066600,0.017776388623052218\n20100208 00:00,1067200,1073300,1058100,1058700,0.018021321098324602\n20100209 00:00,1071500,1081400,1062700,1072000,0.004276267697916815\n20100210 00:00,1070800,1076000,1061100,1070100,0.0043969972976609355\n20100211 00:00,1069000,1082500,1062500,1081300,0.0010232887233771277\n20100212 00:00,1070000,1080600,1065100,1080400,0.001130506535677254\n20100216 00:00,1088500,1098500,1084200,1097500,0.0004805467883756947\n20100217 00:00,1102700,1104100,1097500,1102600,0.0004805467883756947\n20100218 00:00,1101000,1111400,1100400,1109100,0.0\n20100219 00:00,1106600,1115700,1103600,1111800,0.0\n20100222 00:00,1115600,1115700,1108300,1111500,0.00015578798413105186\n20100223 00:00,1108800,1112000,1095200,1098100,0.006962151310085811\n20100224 00:00,1101300,1110000,1098600,1108400,0.006962151310085811\n20100225 00:00,1092200,1107500,1089400,1106700,0.007016509304119242\n20100226 00:00,1108000,1111200,1101100,1107600,0.0008855065478368442\n20100301 00:00,1112000,1120000,1111700,1118600,0.0008855065478368442\n20100302 00:00,1124200,1127400,1120000,1121900,0.0\n20100303 00:00,1124900,1129700,1120200,1123000,0.0\n20100304 00:00,1124700,1128000,1120300,1126600,0.0\n20100305 00:00,1133900,1143400,1131000,1142300,0.0\n20100308 00:00,1142800,1145200,1140700,1142900,0.0\n20100309 00:00,1139300,1149900,1138700,1144600,0.0\n20100310 00:00,1145100,1152700,1144200,1149900,0.0\n20100311 00:00,1147000,1154800,1143500,1154500,0.0\n20100312 00:00,1159300,1159700,1151400,1154600,0.0\n20100315 00:00,1152500,1155800,1146000,1155000,0.0\n20100316 00:00,1158000,1165100,1154900,1164100,0.0\n20100317 00:00,1167600,1174800,1167100,1171300,0.0\n20100318 00:00,1171100,1172700,1165700,1170300,0.0004929140862201151\n20100319 00:00,1168900,1169700,1155200,1159300,0.0054490280689729505\n20100322 00:00,1152900,1168000,1152400,1165900,0.0054490280689729505\n20100323 00:00,1167400,1175100,1163800,1174000,0.005426687995459189\n20100324 00:00,1169700,1173200,1166000,1168500,0.002704792572864534\n20100325 00:00,1176700,1181000,1165100,1166200,0.002933828733939318\n20100326 00:00,1169000,1174200,1161200,1166600,0.002933828733939318\n20100329 00:00,1171900,1175300,1169700,1173200,0.001136419015092952\n20100330 00:00,1174300,1178300,1169100,1174000,0.0\n20100331 00:00,1169300,1175200,1166100,1169900,0.0020162999179535596\n20100401 00:00,1178300,1182100,1171000,1178200,0.0020162999179535596\n20100405 00:00,1182600,1188400,1179200,1187600,0.0020162999179535596\n20100406 00:00,1184400,1192500,1182900,1190400,0.0\n20100407 00:00,1188100,1190800,1178100,1183600,0.003298035811903117\n20100408 00:00,1179200,1189700,1176000,1187800,0.003298035811903117\n20100409 00:00,1190100,1196000,1188000,1195500,0.003298035811903117\n20100412 00:00,1197200,1200500,1195600,1197400,0.0\n20100413 00:00,1196400,1200300,1190000,1198700,0.0\n20100414 00:00,1202900,1211900,1200800,1211900,0.0\n20100415 00:00,1210200,1215300,1209500,1213200,0.0\n20100416 00:00,1208600,1210800,1187600,1194000,0.009137096248302657\n20100419 00:00,1190200,1199200,1184700,1198100,0.009137096248302657\n20100420 00:00,1205400,1209800,1201700,1208800,0.009137096248302657\n20100421 00:00,1209700,1212200,1199900,1206600,0.0010507698479625888\n20100422 00:00,1198400,1211700,1191300,1210200,0.0010507698479625888\n20100423 00:00,1209500,1218600,1206300,1217900,0.0010507698479625888\n20100426 00:00,1218500,1221200,1212300,1213500,0.0020858372480781467\n20100427 00:00,1206900,1212700,1182500,1184300,0.014048276927648184\n20100428 00:00,1190600,1196800,1182800,1193500,0.014048276927648184\n20100429 00:00,1201200,1211100,1200700,1208500,0.01389256519187231\n20100430 00:00,1208900,1210100,1187800,1188600,0.009507050357363309\n20100503 00:00,1193900,1206800,1192000,1203600,0.009507050357363309\n20100504 00:00,1190200,1190300,1169200,1175800,0.016377227383104084\n20100505 00:00,1165100,1178000,1159700,1168200,0.013847598173354634\n20100506 00:00,1162500,1170000,1061300,1127400,0.024461264095082404\n20100507 00:00,1127700,1137600,1095800,1110000,0.022358980184856957\n20100510 00:00,1158700,1166500,1149200,1161700,0.022045353024993358\n20100511 00:00,1150700,1173600,1149200,1158300,0.009069476465764595\n20100512 00:00,1163300,1176100,1160900,1174700,0.001689757179344678\n20100513 00:00,1172000,1176700,1158900,1160200,0.007324154858912839\n20100514 00:00,1151000,1153300,1128700,1139200,0.012648922904082862\n20100517 00:00,1141800,1145100,1117800,1139100,0.01264902443387768\n20100518 00:00,1149000,1152200,1120300,1124300,0.01286390515425074\n20100519 00:00,1117500,1127700,1103700,1117400,0.008296243035453336\n20100520 00:00,1094400,1098900,1074800,1075500,0.02318445919704844\n20100521 00:00,1059600,1093800,1056400,1090300,0.02193738695694385\n20100524 00:00,1085000,1093800,1076100,1077000,0.022766093631134396\n20100525 00:00,1051800,1078700,1043800,1078000,0.007042794258664631\n20100526 00:00,1085300,1094700,1068600,1071700,0.007809332247177513\n20100527 00:00,1092200,1108000,1087900,1107900,0.003374124949809518\n20100528 00:00,1106700,1106800,1088500,1094400,0.007802427587169878\n20100601 00:00,1083400,1099500,1073800,1075200,0.012332429912179092\n20100602 00:00,1080600,1103400,1076100,1102800,0.012332429912179092\n20100603 00:00,1106800,1110600,1095900,1107000,0.010128952091046098\n20100604 00:00,1086400,1093300,1064700,1069400,0.01961009044401982\n20100607 00:00,1071700,1076100,1054100,1054900,0.021114872796222102\n20100608 00:00,1056100,1068300,1046500,1065700,0.021114872796222102\n20100609 00:00,1072600,1082800,1056600,1059900,0.008435375633429307\n20100610 00:00,1078600,1092800,1076900,1091900,0.0031421896981325297\n20100611 00:00,1082100,1097500,1081300,1096800,0.0031421896981325297\n20100614 00:00,1105900,1111200,1094000,1095700,0.0005790347338699447\n20100615 00:00,1103600,1121000,1100900,1119500,0.0005790347338699447\n20100616 00:00,1114600,1124200,1112000,1119600,0.0005790347338699447\n20100617 00:00,1122900,1123300,1110600,1121400,0.0\n20100618 00:00,1118100,1121300,1113700,1116600,0.002471269210014474\n20100621 00:00,1131400,1132000,1107900,1114100,0.0027889284219656304\n20100622 00:00,1114300,1119000,1094200,1095700,0.009934762542463726\n20100623 00:00,1096200,1100200,1084800,1092600,0.00976015050639462\n20100624 00:00,1086800,1088300,1071400,1074700,0.01352983713557171\n20100625 00:00,1077400,1084200,1067700,1079500,0.009598703448008103\n20100628 00:00,1080300,1083200,1071500,1074900,0.009773413158943693\n20100629 00:00,1060400,1060600,1035600,1042000,0.01784168391892367\n20100630 00:00,1039000,1048800,1028800,1032200,0.018649672916436502\n20100701 00:00,1031800,1034900,1011400,1028100,0.018628386645226272\n20100702 00:00,1031200,1034200,1016200,1022000,0.006817505954818145\n20100706 00:00,1036500,1043700,1018800,1028600,0.004122350375295046\n20100707 00:00,1031100,1062400,1030300,1061500,0.0034255779029828686\n20100708 00:00,1069300,1072800,1059100,1071700,0.0\n20100709 00:00,1071300,1079600,1069300,1079300,0.0\n20100712 00:00,1076200,1082400,1071500,1080300,0.0\n20100713 00:00,1091700,1100900,1089300,1096600,0.0\n20100714 00:00,1093200,1100700,1088700,1096700,0.0\n20100715 00:00,1095800,1100600,1081700,1096800,0.0\n20100716 00:00,1090600,1091600,1064500,1066300,0.016055053984576566\n20100719 00:00,1070800,1076300,1062200,1072900,0.016055053984576566\n20100720 00:00,1058500,1085600,1058200,1084800,0.016055053984576566\n20100721 00:00,1090500,1090700,1066300,1070700,0.007504276175860709\n20100722 00:00,1083300,1099400,1083300,1094800,0.007504276175860709\n20100723 00:00,1092600,1105600,1089300,1104100,0.007504276175860709\n20100726 00:00,1105600,1116700,1102900,1115700,0.0\n20100727 00:00,1121500,1122900,1111100,1115500,0.0001034956115782865\n20100728 00:00,1113700,1116600,1104600,1108000,0.0038831607299861085\n20100729 00:00,1115100,1118200,1094200,1102900,0.004705436235634789\n20100730 00:00,1092000,1108600,1089800,1102700,0.0047054628079539924\n20100802 00:00,1120100,1129400,1115400,1127600,0.0026595402466870082\n20100803 00:00,1125000,1127700,1118500,1122200,0.002766872860882177\n20100804 00:00,1125000,1131100,1121600,1129700,0.0027648913210571186\n20100805 00:00,1123100,1129100,1120800,1128500,0.002832090059167852\n20100806 00:00,1117600,1125700,1109200,1124100,0.0023331225637234273\n20100809 00:00,1129400,1131800,1123200,1130100,0.0023331225637234273\n20100810 00:00,1120800,1129800,1113800,1123900,0.0038859097382106657\n20100811 00:00,1106900,1106900,1091200,1093000,0.016186353113112405\n20100812 00:00,1076200,1090200,1076000,1086000,0.01660331606289263\n20100813 00:00,1082700,1089500,1081800,1082800,0.016386924585626093\n20100816 00:00,1075600,1086100,1071800,1082600,0.004071558190171582\n20100817 00:00,1091600,1103900,1088800,1095900,0.0017045553420198818\n20100818 00:00,1095300,1103800,1089100,1097800,0.0001066402418155686\n20100819 00:00,1092300,1094900,1074300,1078800,0.009992398537623308\n20100820 00:00,1075200,1077000,1067500,1075300,0.010166445851855967\n20100823 00:00,1080000,1085700,1070700,1071300,0.010390820647473277\n20100824 00:00,1058800,1063900,1049800,1055600,0.008928140819484235\n20100825 00:00,1049300,1063400,1043000,1058800,0.008729439029428961\n20100826 00:00,1064000,1065800,1048800,1052300,0.009173500816213489\n20100827 00:00,1058300,1069700,1043100,1068200,0.003544367916256645\n20100830 00:00,1065400,1069100,1053000,1053400,0.008749304077442009\n20100831 00:00,1048800,1059800,1044900,1054700,0.007999236083136557\n20100901 00:00,1067400,1086100,1066700,1084400,0.007999236083136557\n20100902 00:00,1086900,1094900,1084900,1094700,0.0\n20100903 00:00,1105800,1109900,1099500,1109200,0.0\n20100907 00:00,1103900,1105100,1095500,1096800,0.006454330452534605\n20100908 00:00,1098500,1108500,1098100,1104100,0.006454330452534605\n20100909 00:00,1116300,1116800,1106200,1109400,0.006454330452534605\n20100910 00:00,1111300,1116100,1108700,1115400,0.0\n20100913 00:00,1126100,1129500,1121300,1127200,0.0\n20100914 00:00,1125400,1132900,1120800,1126500,0.00035853902451449417\n20100915 00:00,1122800,1132100,1119800,1131400,0.00035853902451449417\n20100916 00:00,1127100,1131200,1123500,1131000,0.00041257090510805937\n20100917 00:00,1130000,1131500,1121800,1125100,0.0030187272940901465\n20100920 00:00,1128700,1144600,1126200,1142300,0.0030187272940901465\n20100921 00:00,1143000,1148400,1135100,1140000,0.003228377193533688\n20100922 00:00,1138100,1144300,1131000,1134300,0.003112025494853611\n20100923 00:00,1124500,1136700,1121900,1125000,0.005664976960028711\n20100924 00:00,1137300,1149000,1136500,1147900,0.005544420132923787\n20100927 00:00,1148200,1149900,1141700,1143200,0.005291066936695234\n20100928 00:00,1144200,1150400,1131900,1146700,0.0023639221754432204\n20100929 00:00,1144400,1149000,1140200,1144100,0.002702182935203779\n20100930 00:00,1150800,1157900,1135900,1141200,0.001963493326711938\n20101001 00:00,1149900,1151200,1139300,1146100,0.001963493326711938\n20101004 00:00,1143600,1148500,1131800,1137500,0.0045727658155055575\n20101005 00:00,1148400,1163200,1146700,1160500,0.004332267965300415\n20101006 00:00,1160500,1163300,1155600,1160600,0.004332267965300415\n20101007 00:00,1165000,1165300,1151900,1158900,0.0008456793534571583\n20101008 00:00,1160400,1168600,1156100,1165600,0.0008456793534571583\n20101011 00:00,1167700,1169700,1162500,1166600,0.0008456793534571583\n20101012 00:00,1162800,1173500,1156500,1169900,0.0\n20101013 00:00,1176200,1185500,1173800,1178800,0.0\n20101014 00:00,1178100,1180100,1167200,1175500,0.0016162672958311554\n20101015 00:00,1182700,1183500,1167600,1177200,0.0016162672958311554\n20101018 00:00,1177700,1186600,1175200,1185500,0.0016162672958311554\n20101019 00:00,1172200,1178500,1160200,1167100,0.008960982668147696\n20101020 00:00,1169700,1184400,1168700,1178700,0.008960982668147696\n20101021 00:00,1184200,1190800,1172100,1181200,0.008960982668147696\n20101022 00:00,1182900,1185300,1180000,1183800,0.0\n20101025 00:00,1191900,1197600,1186100,1186900,0.0\n20101026 00:00,1180800,1188400,1178700,1187300,0.0\n20101027 00:00,1178400,1185100,1172600,1183800,0.0017019505956065702\n20101028 00:00,1190400,1191100,1178300,1184000,0.0017019505956065702\n20101029 00:00,1182700,1187100,1180700,1185300,0.0017019505956065702\n20101101 00:00,1191500,1197500,1178500,1185300,0.0\n20101102 00:00,1194100,1197500,1191000,1194900,0.0\n20101103 00:00,1196300,1200200,1184500,1200100,0.0\n20101104 00:00,1213000,1223200,1211300,1222600,0.0\n20101105 00:00,1223600,1229200,1221800,1227400,0.0\n20101108 00:00,1223300,1226900,1219400,1225400,0.0009407695440599934\n20101109 00:00,1228200,1229400,1211200,1216000,0.004527649855374951\n20101110 00:00,1215600,1221600,1206600,1220900,0.004527649855374951\n20101111 00:00,1210300,1218200,1206900,1216600,0.004873333051494357\n20101112 00:00,1208100,1213500,1196500,1201800,0.007311927980158138\n20101115 00:00,1205700,1210500,1199800,1200400,0.00734279486544453\n20101116 00:00,1193300,1194900,1175900,1181200,0.011621458607219186\n20101117 00:00,1182100,1187000,1178600,1182100,0.009258985825954738\n20101118 00:00,1193500,1203900,1193500,1200200,0.009234526131656765\n20101119 00:00,1199200,1203400,1192500,1202600,0.0\n20101122 00:00,1197200,1202400,1187700,1201900,0.00033605952804984147\n20101123 00:00,1187900,1190200,1179900,1184200,0.008509093036399929\n20101124 00:00,1192500,1202300,1191700,1201900,0.008509093036399929\n20101126 00:00,1191400,1198100,1190300,1192700,0.00958240182420841\n20101129 00:00,1185100,1194800,1177400,1191600,0.004451317575836127\n20101130 00:00,1179600,1191700,1178100,1184800,0.005537993497289025\n20101201 00:00,1202500,1212400,1201900,1210000,0.0033374654381940075\n20101202 00:00,1211700,1226500,1211400,1225700,0.003294714527097592\n20101203 00:00,1221500,1230300,1221100,1228600,0.0\n20101206 00:00,1226400,1230400,1225000,1227400,0.0005639104045478909\n20101207 00:00,1239700,1240100,1227600,1228300,0.0005639104045478909\n20101208 00:00,1229700,1233800,1224100,1232900,0.0005639104045478909\n20101209 00:00,1239400,1240200,1231600,1238200,0.0\n20101210 00:00,1241200,1246000,1237300,1245000,0.0\n20101213 00:00,1250400,1252000,1245200,1245600,0.0\n20101214 00:00,1247900,1252300,1242900,1246500,0.0\n20101215 00:00,1244900,1249300,1238900,1241200,0.0024548386896951447\n20101216 00:00,1242200,1249100,1237500,1248200,0.0024548386896951447\n20101217 00:00,1240500,1244600,1238200,1243800,0.003188775133481507\n20101220 00:00,1246200,1249000,1239900,1245700,0.0020352036407902357\n20101221 00:00,1250000,1254700,1248800,1253900,0.0020352036407902357\n20101222 00:00,1255400,1258200,1254100,1257900,0.0\n20101223 00:00,1256300,1257700,1252900,1256100,0.0008261630372377063\n20101227 00:00,1250900,1257700,1250400,1256500,0.0008261630372377063\n20101228 00:00,1259300,1259500,1255000,1258000,0.0008261630372377063\n20101229 00:00,1259600,1262000,1259000,1259200,0.0\n20101230 00:00,1258100,1261300,1255300,1257200,0.0009170112280648398\n20101231 00:00,1255300,1258700,1253400,1257800,0.0009170112280648398\n20110103 00:00,1267300,1276000,1266600,1270100,0.0009170112280648398\n20110104 00:00,1273000,1273700,1261900,1269300,0.0003636565745624277\n20110105 00:00,1265700,1277200,1264700,1276400,0.0003636565745624277\n20110106 00:00,1277000,1278300,1270100,1273900,0.0011878529813112901\n20110107 00:00,1275500,1277700,1261600,1271300,0.0016331800262016952\n20110110 00:00,1265900,1271600,1262000,1270100,0.0017217053366731462\n20110111 00:00,1274500,1277400,1269500,1274300,0.0012982760358803325\n20110112 00:00,1282500,1287100,1279900,1286400,0.0005449699701310356\n20110113 00:00,1286100,1286900,1280500,1284500,0.0008527406028142624\n20110114 00:00,1281700,1293300,1281100,1292800,0.0008527406028142624\n20110118 00:00,1292100,1296400,1290300,1295300,0.0008527406028142624\n20110119 00:00,1294300,1295000,1279100,1282700,0.00561616103743478\n20110120 00:00,1279300,1283900,1271400,1281400,0.005646560919417606\n20110121 00:00,1288500,1291700,1282300,1283600,0.005646560919417606\n20110124 00:00,1283100,1292500,1282600,1291600,0.0005851370935889311\n20110125 00:00,1287700,1292000,1281100,1291600,0.0\n20110126 00:00,1294400,1300500,1292300,1296900,0.0\n20110127 00:00,1296500,1302100,1294700,1300300,0.0\n20110128 00:00,1301700,1303500,1275100,1277200,0.0102567032363919\n20110131 00:00,1280500,1287800,1277600,1286700,0.0102567032363919\n20110201 00:00,1294400,1309700,1293900,1307100,0.0102567032363919\n20110202 00:00,1304600,1308400,1303300,1304800,0.0010159173889802912\n20110203 00:00,1302700,1309800,1295700,1307600,0.0010159173889802912\n20110204 00:00,1308500,1312000,1302300,1311700,0.0010159173889802912\n20110207 00:00,1314400,1324000,1314300,1320000,0.0\n20110208 00:00,1321300,1326400,1317300,1325900,0.0\n20110209 00:00,1322000,1326300,1316100,1323200,0.001175688759945683\n20110210 00:00,1316100,1324700,1313000,1323300,0.001175688759945683\n20110211 00:00,1318000,1332800,1317700,1331500,0.001175688759945683\n20110214 00:00,1330700,1335400,1328900,1334300,0.0\n20110215 00:00,1330500,1332200,1326600,1330400,0.0016875260809709627\n20110216 00:00,1334700,1340100,1331900,1338200,0.0016875260809709627\n20110217 00:00,1334300,1344300,1333400,1342200,0.0016875260809709627\n20110218 00:00,1343200,1346900,1340600,1345700,0.0\n20110222 00:00,1331100,1338600,1314800,1318000,0.01188422564951521\n20110223 00:00,1317200,1320700,1302100,1310100,0.012377825025363082\n20110224 00:00,1308600,1314400,1297000,1309200,0.012384177882669451\n20110225 00:00,1314700,1324100,1314000,1323200,0.0034832517194431953\n20110228 00:00,1328400,1333200,1323800,1331500,0.0003966225801623325\n20110301 00:00,1336800,1336800,1308900,1308900,0.009799561459771313\n20110302 00:00,1307900,1318100,1306000,1311600,0.009799561459771313\n20110303 00:00,1323900,1336200,1323900,1334700,0.009799561459771313\n20110304 00:00,1333700,1334800,1316000,1324700,0.004325693183409185\n20110307 00:00,1328000,1331500,1307400,1313700,0.006457228743165312\n20110308 00:00,1316700,1330000,1310700,1325600,0.006457228743165312\n20110309 00:00,1323400,1327900,1316000,1323900,0.00485102024182392\n20110310 00:00,1310400,1310400,1298100,1299300,0.010753533475825897\n20110311 00:00,1294900,1313100,1294900,1308400,0.010753533475825897\n20110314 00:00,1300300,1304800,1290600,1300500,0.011280176459935348\n20110315 00:00,1267000,1293300,1265100,1285600,0.007477125440999826\n20110316 00:00,1281800,1285700,1252800,1262100,0.012933918901995262\n20110317 00:00,1280100,1283900,1271000,1278500,0.01245528576748848\n20110318 00:00,1288400,1288800,1275100,1277600,0.01056144095959037\n20110321 00:00,1294100,1300100,1292000,1297400,0.00040642568812722076\n20110322 00:00,1297600,1298800,1291700,1293000,0.0019997605808234\n20110323 00:00,1289600,1300000,1283200,1296400,0.001958024652716471\n20110324 00:00,1304600,1310800,1296800,1309000,0.001958024652716471\n20110325 00:00,1312200,1318600,1309500,1312900,0.0\n20110328 00:00,1315700,1319200,1309400,1309400,0.0015391316491459592\n20110329 00:00,1308900,1318900,1304400,1318600,0.0015391316491459592\n20110330 00:00,1325800,1331500,1323600,1327000,0.0015391316491459592\n20110331 00:00,1326300,1329600,1324600,1325100,0.0008266507245367548\n20110401 00:00,1334500,1337700,1328400,1331500,0.0008266507245367548\n20110404 00:00,1334800,1336700,1328800,1332400,0.0008266507245367548\n20110405 00:00,1329500,1338300,1329400,1332400,0.0\n20110406 00:00,1338500,1340000,1331200,1336600,0.0\n20110407 00:00,1333900,1339400,1326600,1333200,0.0014686450061684323\n20110408 00:00,1338800,1339900,1323100,1328600,0.0024749165184273204\n20110411 00:00,1330100,1334500,1321400,1324700,0.0029995738731662613\n20110412 00:00,1317100,1319700,1309900,1314500,0.00515782147222038\n20110413 00:00,1320900,1321800,1309700,1314500,0.004757607457562748\n20110414 00:00,1306900,1317600,1302700,1315600,0.004445514264161058\n20110415 00:00,1317800,1323700,1314100,1321200,0.0\n20110418 00:00,1305300,1308100,1295100,1305300,0.006948129942563638\n20110419 00:00,1307500,1313500,1304400,1312800,0.006948129942563638\n20110420 00:00,1328800,1333900,1328000,1331600,0.006948129942563638\n20110421 00:00,1337500,1338300,1333500,1337400,0.0\n20110425 00:00,1336600,1338500,1332000,1336200,0.0005180352348045181\n20110426 00:00,1340500,1350500,1339100,1347900,0.0005180352348045181\n20110427 00:00,1350500,1358700,1345000,1356300,0.0005180352348045181\n20110428 00:00,1354200,1362900,1354100,1360400,0.0\n20110429 00:00,1361400,1365700,1359800,1365400,0.0\n20110502 00:00,1371000,1371800,1359500,1362500,0.0012262456281308658\n20110503 00:00,1359400,1361900,1350500,1357100,0.002596074198212136\n20110504 00:00,1357000,1357300,1342400,1348600,0.004451532626097888\n20110505 00:00,1340900,1349400,1330200,1336300,0.006785331747521558\n20110506 00:00,1348800,1356200,1336800,1342000,0.0063878638073937705\n20110509 00:00,1342000,1351100,1339800,1347200,0.005265763244129009\n20110510 00:00,1351500,1361100,1350100,1358700,0.0\n20110511 00:00,1356400,1356900,1338200,1344500,0.00603398382460636\n20110512 00:00,1340700,1353600,1333900,1351000,0.00603398382460636\n20110513 00:00,1351700,1353300,1335700,1340400,0.007545135863672436\n20110516 00:00,1335400,1346000,1329700,1331900,0.005824476466744147\n20110517 00:00,1327000,1333500,1321200,1331700,0.005825121652179915\n20110518 00:00,1332600,1345000,1329500,1343800,0.003662229902263165\n20110519 00:00,1347900,1350200,1339400,1346600,8.669573829711838e-05\n20110520 00:00,1343100,1345200,1333600,1336700,0.004244592057758303\n20110523 00:00,1319900,1324600,1315900,1320400,0.00822087654458889\n20110524 00:00,1324200,1327300,1317000,1319500,0.00823029015086216\n20110525 00:00,1313800,1329300,1313800,1323700,0.007051320034617194\n20110526 00:00,1320000,1332400,1317800,1330100,0.00039352865970210575\n20110527 00:00,1333900,1338700,1331900,1335400,0.0\n20110531 00:00,1347800,1349000,1338400,1348900,0.0\n20110601 00:00,1345200,1346000,1317600,1318500,0.013011674833838409\n20110602 00:00,1319800,1322300,1309600,1316900,0.013030523507708268\n20110603 00:00,1301600,1314200,1300800,1304000,0.014204928744905443\n20110606 00:00,1300900,1303600,1288700,1290500,0.00825850290831252\n20110607 00:00,1296700,1300700,1288500,1288500,0.008277235198590945\n20110608 00:00,1287700,1291900,1281800,1284000,0.00637125270257276\n20110609 00:00,1287700,1299300,1284600,1294000,0.0022059713007497486\n20110610 00:00,1288300,1289300,1272600,1275600,0.008453609558065902\n20110613 00:00,1278900,1282400,1270500,1276700,0.008209617428971474\n20110614 00:00,1288800,1297700,1288200,1293200,0.008209617428971474\n20110615 00:00,1282600,1286500,1266800,1270200,0.010268370083019932\n20110616 00:00,1270900,1279700,1263200,1272800,0.010268370083019932\n20110617 00:00,1279100,1279400,1266200,1270200,0.010335877013070704\n20110620 00:00,1266000,1279700,1265800,1277000,0.00117937672838861\n20110621 00:00,1283400,1297000,1281900,1294200,0.00117937672838861\n20110622 00:00,1290500,1298100,1285900,1287000,0.003211962554601513\n20110623 00:00,1270900,1283700,1261900,1282900,0.0037012977518651683\n20110624 00:00,1282800,1283700,1266200,1268100,0.007619853120729273\n20110627 00:00,1269100,1284300,1266400,1279400,0.0069098088344993576\n20110628 00:00,1284300,1296300,1282700,1296100,0.006660522241800976\n20110629 00:00,1301600,1309200,1297100,1307500,0.0\n20110630 00:00,1311500,1321800,1309900,1319700,0.0\n20110701 00:00,1319500,1341000,1317800,1339600,0.0\n20110705 00:00,1338000,1340800,1333900,1337100,0.0010774676567438526\n20110706 00:00,1334800,1341400,1331100,1339400,0.0010774676567438526\n20110707 00:00,1351300,1357000,1348800,1354600,0.0010774676567438526\n20110708 00:00,1338400,1344400,1333900,1344000,0.004517874541126573\n20110711 00:00,1327300,1331800,1316600,1319600,0.011413865119912634\n20110712 00:00,1316900,1327800,1313600,1314300,0.011647033493984393\n20110713 00:00,1321100,1332200,1315200,1318500,0.010735091934428632\n20110714 00:00,1321700,1327800,1306800,1309400,0.004610344022303548\n20110715 00:00,1316400,1318700,1307700,1317400,0.003984745885191927\n20110718 00:00,1310600,1312800,1296300,1305800,0.006459270881428452\n20110719 00:00,1313500,1328900,1313100,1327800,0.005083697527402225\n20110720 00:00,1330800,1331500,1324200,1326500,0.005115027084563614\n20110721 00:00,1333900,1348200,1331400,1345200,0.0005652623512174257\n20110722 00:00,1345000,1347200,1337700,1346100,0.0005652623512174257\n20110725 00:00,1333300,1344900,1331600,1338300,0.0033454662355538725\n20110726 00:00,1337500,1339600,1330300,1333600,0.003911947587256761\n20110727 00:00,1325800,1326000,1304300,1306000,0.0125728365558642\n20110728 00:00,1306200,1317600,1300100,1301600,0.012274673503911121\n20110729 00:00,1289000,1305500,1283600,1290500,0.013068989466850218\n20110801 00:00,1309500,1309600,1275300,1287100,0.005508118785202318\n20110802 00:00,1277700,1285000,1254900,1254900,0.015335599939413932\n20110803 00:00,1256600,1263100,1235300,1262100,0.014523724035264349\n20110804 00:00,1244200,1246200,1200700,1201800,0.031137143820083136\n20110805 00:00,1219000,1220700,1168700,1199800,0.027601088598241657\n20110808 00:00,1169800,1183500,1120200,1122600,0.04628037017559078\n20110809 00:00,1142500,1174900,1102700,1173700,0.03716148175419541\n20110810 00:00,1151800,1162800,1119600,1123500,0.04460752043206143\n20110811 00:00,1134500,1189200,1128500,1172800,0.02469368962538913\n20110812 00:00,1185500,1192100,1172800,1181500,0.02469368962538913\n20110815 00:00,1192400,1207400,1190000,1205500,0.0\n20110816 00:00,1193400,1206900,1183100,1195600,0.0047414082662607295\n20110817 00:00,1203100,1211900,1187200,1196700,0.0047414082662607295\n20110818 00:00,1165000,1166400,1133900,1146100,0.024868254696987148\n20110819 00:00,1129100,1158800,1125000,1126800,0.026276881453710578\n20110822 00:00,1151200,1152300,1124100,1127300,0.026276881453710578\n20110823 00:00,1131700,1165400,1125800,1164600,0.009722415317476484\n20110824 00:00,1161800,1182400,1159300,1181300,0.0\n20110825 00:00,1188000,1194000,1158700,1163100,0.008895094302252759\n20110826 00:00,1156600,1185100,1138600,1180400,0.008895094302252759\n20110829 00:00,1195200,1214200,1194400,1213800,0.008895094302252759\n20110830 00:00,1208600,1224300,1192600,1216200,0.0\n20110831 00:00,1224800,1235100,1213000,1220600,0.0\n20110901 00:00,1222500,1234000,1207800,1209600,0.005203058300086748\n20110902 00:00,1184700,1190700,1174300,1178400,0.015774746361268993\n20110906 00:00,1144300,1171600,1143800,1169900,0.016315204519245025\n20110907 00:00,1188500,1203300,1183700,1202700,0.015463314095972172\n20110908 00:00,1195900,1209300,1187800,1190200,0.007304111477812875\n20110909 00:00,1176800,1181000,1152800,1158600,0.016461381908027095\n20110912 00:00,1144900,1167600,1140500,1166600,0.016461381908027095\n20110913 00:00,1170800,1181800,1162200,1175800,0.015328741813470142\n20110914 00:00,1183200,1207800,1167200,1193600,0.0\n20110915 00:00,1205500,1214700,1195700,1214700,0.0\n20110916 00:00,1213100,1219500,1203200,1215800,0.0\n20110919 00:00,1195600,1209300,1187200,1203100,0.006030883713364227\n20110920 00:00,1208300,1219900,1200100,1201700,0.006068189761729802\n20110921 00:00,1202600,1205900,1165000,1165100,0.01860186964563171\n20110922 00:00,1132800,1142100,1113000,1128000,0.025448872731908448\n20110923 00:00,1121600,1141600,1120200,1135400,0.025440003040578293\n20110926 00:00,1146400,1164000,1129800,1162500,0.018384426218294683\n20110927 00:00,1185300,1195600,1168400,1176000,0.0\n20110928 00:00,1178300,1184800,1149700,1151600,0.01197903619747182\n20110929 00:00,1171200,1176300,1139400,1160200,0.01197903619747182\n20110930 00:00,1144500,1154400,1130800,1131700,0.018564463322790714\n20111003 00:00,1125000,1139500,1098200,1099300,0.02177976109764575\n20111004 00:00,1084300,1125800,1074300,1121300,0.02177976109764575\n20111005 00:00,1125900,1147200,1115800,1145000,0.016529246904430393\n20111006 00:00,1143500,1166600,1135200,1165100,0.0\n20111007 00:00,1171600,1172500,1150600,1157500,0.003766081920728852\n20111010 00:00,1177200,1195900,1176700,1195900,0.003766081920728852\n20111011 00:00,1188500,1200400,1187500,1196800,0.003766081920728852\n20111012 00:00,1206000,1221300,1203300,1206700,0.0\n20111013 00:00,1200300,1208700,1191200,1204700,0.0009569077139133468\n20111014 00:00,1218600,1225800,1212300,1225600,0.0009569077139133468\n20111017 00:00,1219900,1220600,1199300,1202400,0.010970766239445968\n20111018 00:00,1200800,1235000,1192000,1226100,0.010928954181787963\n20111019 00:00,1223300,1230800,1207200,1211400,0.012936612825571684\n20111020 00:00,1213600,1220900,1198200,1216900,0.006921987567969567\n20111021 00:00,1230700,1241200,1227200,1239100,0.006921987567969567\n20111024 00:00,1241400,1258000,1240600,1254900,0.0\n20111025 00:00,1249300,1249400,1227800,1230800,0.011087848822591407\n20111026 00:00,1243500,1247700,1222100,1243300,0.011087848822591407\n20111027 00:00,1277000,1294200,1266100,1285300,0.011087848822591407\n20111028 00:00,1279800,1288500,1278000,1286800,0.0\n20111031 00:00,1272300,1272600,1253600,1254500,0.014492084002816982\n20111101 00:00,1220000,1235100,1215200,1220800,0.021226539687203005\n20111102 00:00,1238800,1244000,1228000,1239900,0.021226539687203005\n20111103 00:00,1253100,1265000,1236000,1262400,0.015509528953121061\n20111104 00:00,1252300,1257000,1240100,1254500,0.0036130126161264845\n20111107 00:00,1254300,1263900,1242000,1262800,0.0036130126161264845\n20111108 00:00,1269300,1280200,1257100,1278600,0.0036130126161264845\n20111109 00:00,1249100,1254600,1228700,1231900,0.021087327992457015\n20111110 00:00,1248000,1249400,1230200,1243200,0.021087327992457015\n20111111 00:00,1258600,1269900,1258000,1266200,0.021087327992457015\n20111114 00:00,1262100,1263500,1249200,1254600,0.005289261666877001\n20111115 00:00,1251200,1267500,1247200,1261200,0.005289261666877001\n20111116 00:00,1248100,1263400,1239000,1240500,0.010852241984334592\n20111117 00:00,1238400,1241600,1212300,1221800,0.012866327664625987\n20111118 00:00,1224600,1227500,1214700,1219900,0.012897615345679174\n20111121 00:00,1202100,1203400,1186600,1196200,0.014225576840329811\n20111122 00:00,1193900,1201000,1185300,1191900,0.011442326910353951\n20111123 00:00,1180700,1182000,1165600,1165600,0.017100227846923475\n20111125 00:00,1163800,1177000,1162000,1162000,0.013030121244933133\n20111128 00:00,1195300,1201800,1188200,1197000,0.012863775903937204\n20111129 00:00,1200900,1208600,1196100,1200800,0.0017831682988012061\n20111130 00:00,1235000,1252200,1232200,1251100,0.0\n20111201 00:00,1248500,1256400,1244300,1249800,0.0005999163535660897\n20111202 00:00,1261400,1265000,1247800,1248600,0.0008168218648359085\n20111205 00:00,1268000,1271800,1254500,1262100,0.0008168218648359085\n20111206 00:00,1261700,1271100,1257600,1262600,0.0005543449536146042\n20111207 00:00,1258400,1272600,1249700,1267500,0.0\n20111208 00:00,1258800,1261800,1236500,1239800,0.012617437835544502\n20111209 00:00,1245200,1263700,1244100,1260300,0.012617437835544502\n20111212 00:00,1249100,1249700,1231600,1242400,0.015047962207048201\n20111213 00:00,1249000,1255700,1224500,1231100,0.009737363755159522\n20111214 00:00,1225900,1230200,1214700,1217100,0.011744074594821893\n20111215 00:00,1231200,1232000,1219900,1221500,0.008407250385103322\n20111216 00:00,1222100,1229500,1213000,1215700,0.007114939254378179\n20111219 00:00,1220600,1223200,1200300,1203200,0.006538817931552593\n20111220 00:00,1222300,1241400,1221700,1238800,0.006538817931552593\n20111221 00:00,1239400,1243600,1227500,1241700,0.005936397437583578\n20111222 00:00,1246400,1253900,1243600,1253300,0.0\n20111223 00:00,1256400,1264300,1254100,1263900,0.0\n20111227 00:00,1261500,1268200,1260600,1264900,0.0\n20111228 00:00,1265300,1265300,1247300,1249200,0.007166099475276383\n20111229 00:00,1252100,1262500,1251800,1261000,0.007166099475276383\n20111230 00:00,1259900,1263300,1255000,1255000,0.007674605996415224\n20120103 00:00,1277500,1283800,1274400,1274900,0.0027471067526865524\n20120104 00:00,1271800,1278100,1267200,1276300,0.0027471067526865524\n20120105 00:00,1270100,1282300,1264300,1281000,0.0\n20120106 00:00,1282200,1282200,1272900,1278200,0.0012619678015074057\n20120109 00:00,1280400,1281800,1274100,1279900,0.0012619678015074057\n20120110 00:00,1293700,1296500,1289500,1291300,0.0012619678015074057\n20120111 00:00,1287500,1293700,1285200,1292500,0.0\n20120112 00:00,1295400,1297000,1285400,1295100,0.0\n20120113 00:00,1286600,1290100,1277200,1290100,0.002228979496523903\n20120117 00:00,1301000,1303200,1290600,1293100,0.002228979496523903\n20120118 00:00,1293500,1308400,1290800,1308000,0.002228979496523903\n20120119 00:00,1312400,1315700,1308100,1314800,0.0\n20120120 00:00,1312300,1319500,1309200,1319500,0.0\n20120123 00:00,1315000,1322500,1309800,1315800,0.0016189435361891487\n20120124 00:00,1307700,1315000,1306000,1314600,0.0017024164406671692\n20120125 00:00,1312400,1328700,1307500,1325700,0.0017024164406671692\n20120126 00:00,1331500,1334000,1313700,1319000,0.0029650169899610615\n20120127 00:00,1311500,1320500,1311500,1317300,0.0030112784809438737\n20120130 00:00,1305000,1314400,1300600,1313800,0.0033794859877360407\n20120131 00:00,1320200,1321800,1306800,1312100,0.001861437919986298\n20120201 00:00,1323100,1331400,1321300,1324700,0.0017062342239094193\n20120202 00:00,1327500,1330200,1322100,1326800,0.0007470661117539595\n20120203 00:00,1340300,1346200,1337700,1345700,0.0\n20120206 00:00,1339900,1345000,1338300,1344600,0.00047193675864503525\n20120207 00:00,1342000,1350200,1336400,1347900,0.00047193675864503525\n20120208 00:00,1348800,1352200,1343100,1351900,0.00047193675864503525\n20120209 00:00,1353900,1355800,1345700,1353400,0.0\n20120210 00:00,1341400,1344700,1338400,1344300,0.0038819916134369375\n20120213 00:00,1352900,1355200,1347400,1353600,0.0038819916134369375\n20120214 00:00,1349900,1352700,1342500,1351900,0.003949130157564314\n20120215 00:00,1356400,1358300,1342900,1345400,0.0028690669369073195\n20120216 00:00,1345600,1361700,1343400,1360400,0.0028690669369073195\n20120217 00:00,1365200,1365700,1359600,1364100,0.002775927768128256\n20120221 00:00,1367500,1370500,1360500,1364600,0.0\n20120222 00:00,1362000,1365500,1357900,1360200,0.0018616013369737343\n20120223 00:00,1359500,1367300,1355000,1366100,0.0018616013369737343\n20120224 00:00,1369500,1372000,1366300,1369300,0.0018616013369737343\n20120227 00:00,1360400,1375300,1358000,1371600,0.0\n20120228 00:00,1371900,1377200,1369300,1375600,0.0\n20120229 00:00,1377300,1381900,1367200,1368700,0.0028959849210587665\n20120301 00:00,1373200,1379900,1371200,1377700,0.0028959849210587665\n20120302 00:00,1376300,1378200,1370000,1373200,0.0034558640671894687\n20120305 00:00,1370500,1371900,1362800,1367500,0.0030495178946782168\n20120306 00:00,1352900,1354300,1343600,1346700,0.009296056652195019\n20120307 00:00,1350600,1359100,1349300,1356900,0.009102768891547654\n20120308 00:00,1365000,1373200,1362400,1370200,0.008781634807418072\n20120309 00:00,1373600,1379300,1371300,1375700,0.0\n20120312 00:00,1375600,1377600,1370900,1375800,0.0\n20120313 00:00,1383800,1401200,1380900,1400600,0.0\n20120314 00:00,1400700,1404500,1394800,1399100,0.0006183245778841016\n20120315 00:00,1401200,1407800,1397600,1407200,0.0006183245778841016\n20120316 00:00,1403200,1404800,1400000,1402700,0.0019470622726132007\n20120319 00:00,1402000,1412800,1401100,1408800,0.0018462736010185841\n20120320 00:00,1400500,1406100,1396400,1404100,0.00266809710225579\n20120321 00:00,1404600,1406500,1399200,1401600,0.0021832871192260872\n20120322 00:00,1391700,1395500,1387400,1391600,0.004662053111198253\n20120323 00:00,1393700,1398100,1385500,1396900,0.004245553353143227\n20120326 00:00,1406200,1416100,1406000,1416100,0.0041192228109990315\n20120327 00:00,1417400,1418300,1410800,1411300,0.0019569813516773075\n20120328 00:00,1410900,1413200,1396400,1404300,0.003468457420935961\n20120329 00:00,1396200,1404200,1390900,1402200,0.003574298655283551\n20120330 00:00,1409100,1410500,1400600,1407200,0.0029909588540046913\n20120402 00:00,1406400,1422100,1403700,1417900,0.0008633736134003985\n20120403 00:00,1416000,1418800,1404300,1412600,0.0021580904342372942\n20120404 00:00,1401700,1403300,1393400,1398400,0.0061919980798303504\n20120405 00:00,1394000,1402000,1392600,1397800,0.0061969512578667054\n20120409 00:00,1379400,1387800,1378400,1382300,0.00864479097145453\n20120410 00:00,1379400,1383400,1357600,1358400,0.01186158646869964\n20120411 00:00,1373300,1375400,1367500,1369000,0.01185899948910891\n20120412 00:00,1371300,1389000,1370300,1388500,0.009982399937518677\n20120413 00:00,1384600,1384800,1370100,1371300,0.0071519082679593685\n20120416 00:00,1378300,1380400,1365800,1369300,0.007201307995777153\n20120417 00:00,1378600,1393600,1377000,1390900,0.007201307995777153\n20120418 00:00,1384900,1390800,1383800,1385900,0.0022397681526565108\n20120419 00:00,1386000,1391400,1370700,1377500,0.004068529459115184\n20120420 00:00,1382400,1388300,1378700,1379500,0.004068529459115184\n20120423 00:00,1365500,1369100,1359400,1367900,0.005984560704002973\n20120424 00:00,1368700,1376500,1368000,1373100,0.004854848222254167\n20120425 00:00,1385600,1392500,1385300,1392400,0.004854848222254167\n20120426 00:00,1389100,1403200,1388200,1401700,0.0\n20120427 00:00,1405600,1407800,1398000,1404200,0.0\n20120430 00:00,1401300,1402100,1394900,1397700,0.0026725372096087384\n20120501 00:00,1398100,1416600,1396300,1407400,0.0026725372096087384\n20120502 00:00,1399300,1404600,1394600,1402800,0.003271597674764479\n20120503 00:00,1404000,1404500,1389900,1392500,0.00464020032777034\n20120504 00:00,1385200,1386600,1369200,1369600,0.010567881746882076\n20120507 00:00,1364800,1375600,1364700,1371000,0.010398039642514463\n20120508 00:00,1363100,1367700,1349200,1365000,0.009825113911185254\n20120509 00:00,1351000,1366000,1344900,1357400,0.004088708309403845\n20120510 00:00,1367500,1368500,1357100,1359500,0.004088708309403845\n20120511 00:00,1351600,1368700,1351100,1355600,0.0036161426513683123\n20120514 00:00,1343200,1350300,1339100,1341300,0.006311559716524789\n20120515 00:00,1340500,1348100,1331300,1333500,0.007148998428709053\n20120516 00:00,1339200,1345400,1328000,1328800,0.007246093319152945\n20120517 00:00,1328800,1330200,1308100,1308700,0.009575116656680925\n20120518 00:00,1314000,1316000,1295500,1297400,0.010259733324493765\n20120521 00:00,1301400,1320200,1299500,1320200,0.010055908122310974\n20120522 00:00,1323400,1332300,1313400,1322000,0.004985144068039098\n20120523 00:00,1312600,1324600,1299900,1322700,0.0\n20120524 00:00,1326700,1328400,1314200,1325300,0.0\n20120525 00:00,1324800,1328500,1317800,1321000,0.0018732408945260587\n20120529 00:00,1331600,1339300,1327500,1337000,0.0018732408945260587\n20120530 00:00,1325900,1326200,1314900,1317300,0.008710759639798768\n20120531 00:00,1317100,1324500,1303400,1314900,0.008571741490836246\n20120601 00:00,1294100,1298500,1281600,1281600,0.016948804760982882\n20120604 00:00,1284400,1287400,1271400,1281000,0.014661744104889988\n20120605 00:00,1278800,1292600,1277900,1290300,0.014623962871430408\n20120606 00:00,1299800,1320300,1299300,1320200,0.00027029506984531506\n20120607 00:00,1334900,1335300,1317800,1320500,0.0\n20120608 00:00,1317200,1331200,1312900,1331200,0.0\n20120611 00:00,1341900,1342500,1312800,1314500,0.007242900762820556\n20120612 00:00,1318000,1330100,1311600,1330100,0.007242900762820556\n20120613 00:00,1325000,1333600,1316200,1321000,0.008249973734223757\n20120614 00:00,1323800,1340000,1319800,1335700,0.003949994323453551\n20120615 00:00,1333500,1342600,1331100,1341000,0.003949994323453551\n20120618 00:00,1335900,1347300,1332900,1344300,0.0\n20120619 00:00,1351300,1362500,1349300,1356900,0.0\n20120620 00:00,1357600,1361000,1344600,1354400,0.0010637303213015413\n20120621 00:00,1356700,1357800,1323300,1324400,0.012832489689828365\n20120622 00:00,1331100,1337100,1326200,1334200,0.012832489689828365\n20120625 00:00,1321000,1321000,1308500,1312600,0.015840064906053154\n20120626 00:00,1316900,1323800,1309300,1320000,0.009346998811644393\n20120627 00:00,1324000,1334300,1323100,1331700,0.009346998811644393\n20120628 00:00,1323200,1329900,1312800,1327900,0.0016474664135470325\n20120629 00:00,1352400,1362700,1348500,1362700,0.0016474664135470325\n20120702 00:00,1365300,1366500,1355200,1364600,0.0016474664135470325\n20120703 00:00,1365100,1375100,1363400,1374700,0.0\n20120705 00:00,1369300,1374000,1362900,1368400,0.0026458912460134254\n20120706 00:00,1355600,1357600,1348500,1355900,0.005900451597484658\n20120709 00:00,1354100,1355700,1347000,1353200,0.0060114128143369736\n20120710 00:00,1360800,1362300,1336800,1341400,0.007381252555540379\n20120711 00:00,1342300,1346000,1333800,1341600,0.005164136009067016\n20120712 00:00,1333900,1340900,1326000,1335100,0.005759435350512186\n20120713 00:00,1338800,1358800,1338400,1357500,0.0027972396763063312\n20120716 00:00,1354200,1358300,1349000,1353900,0.003188855687029122\n20120717 00:00,1360100,1366400,1345500,1363600,0.0015310946365250013\n20120718 00:00,1360200,1376400,1359600,1374100,0.0015310946365250013\n20120719 00:00,1376300,1381800,1372100,1377400,0.0\n20120720 00:00,1369800,1371600,1363200,1364700,0.005323325409255303\n20120723 00:00,1344500,1354600,1338500,1350900,0.007900805876765924\n20120724 00:00,1352000,1352500,1330300,1340300,0.009107463203991972\n20120725 00:00,1342600,1345600,1332500,1339500,0.007397759685164422\n20120726 00:00,1359100,1364600,1352600,1361700,0.004543336689034635\n20120727 00:00,1369100,1390700,1366500,1388000,0.0003446095764766715\n20120730 00:00,1385700,1393300,1382700,1386800,0.0004991500886365728\n20120731 00:00,1385100,1388700,1377100,1377100,0.0040690194999955225\n20120801 00:00,1387200,1387300,1374000,1375900,0.004100003690331167\n20120802 00:00,1365400,1375600,1355900,1366400,0.005696658280138375\n20120803 00:00,1386000,1396400,1385000,1393900,0.004017977934273804\n20120806 00:00,1397000,1401700,1395600,1396200,0.0039863562448589325\n20120807 00:00,1402000,1409200,1401500,1403200,0.0\n20120808 00:00,1398200,1406400,1398100,1404900,0.0\n20120809 00:00,1403000,1408900,1401500,1406300,0.0\n20120810 00:00,1400700,1408900,1398100,1408400,0.0\n20120813 00:00,1406000,1408400,1400400,1407700,0.00028695341411013963\n20120814 00:00,1412800,1413800,1403700,1407900,0.00028695341411013963\n20120815 00:00,1406400,1411900,1405500,1409500,0.00028695341411013963\n20120816 00:00,1410900,1421600,1408000,1420100,0.0\n20120817 00:00,1422500,1423000,1418600,1422200,0.0\n20120820 00:00,1420100,1422200,1416000,1422200,0.0\n20120821 00:00,1425200,1430900,1414500,1417600,0.001867396454979781\n20120822 00:00,1413800,1420500,1410700,1418200,0.001867396454979781\n20120823 00:00,1414500,1414800,1404400,1406800,0.005002556534904162\n20120824 00:00,1403000,1418100,1402200,1415200,0.004640948433762357\n20120827 00:00,1419000,1420800,1413400,1415400,0.004640948433762357\n20120828 00:00,1411700,1418400,1409700,1414000,0.0005710685155189161\n20120829 00:00,1414800,1418900,1411200,1415100,0.0005710685155189161\n20120830 00:00,1409000,1409400,1401900,1404900,0.004200524019239857\n20120831 00:00,1413200,1418200,1403600,1412400,0.00416152409422245\n20120904 00:00,1410900,1414600,1401300,1408700,0.004427845149397999\n20120905 00:00,1411000,1414700,1406300,1409400,0.0015124582243002311\n20120906 00:00,1417900,1437800,1417600,1437800,0.0015124582243002311\n20120907 00:00,1440200,1443900,1438800,1443900,0.0\n20120910 00:00,1442100,1444400,1434600,1435100,0.0035187217735776046\n20120911 00:00,1436300,1443700,1435600,1438900,0.0035187217735776046\n20120912 00:00,1443800,1445500,1439000,1443900,0.0035187217735776046\n20120913 00:00,1443300,1470400,1441500,1467000,0.0\n20120914 00:00,1468900,1481100,1467600,1472400,0.0\n20120917 00:00,1469500,1471900,1463700,1467400,0.0019605754862456765\n20120918 00:00,1465300,1468100,1462500,1466200,0.0020166243477363903\n20120919 00:00,1467600,1471700,1464100,1467400,0.0020166243477363903\n20120920 00:00,1460000,1467900,1456300,1467500,0.0004721414222621765\n20120921 00:00,1466400,1470000,1458100,1458900,0.003383449618419623\n20120924 00:00,1451600,1459800,1450500,1455900,0.0035857004834029638\n20120925 00:00,1459600,1462400,1440600,1441900,0.006609086331919073\n20120926 00:00,1441100,1441100,1429600,1432900,0.006724494888768966\n20120927 00:00,1438800,1449700,1435100,1447200,0.006618860541874831\n20120928 00:00,1440100,1445500,1434600,1439300,0.004787424686379058\n20121001 00:00,1445000,1456900,1440200,1442400,0.003151649479407139\n20121002 00:00,1449000,1451500,1438300,1445000,0.003151649479407139\n20121003 00:00,1448800,1454300,1441300,1450700,0.0\n20121004 00:00,1456300,1463300,1454400,1462700,0.0\n20121005 00:00,1469200,1471500,1457000,1461300,0.0005526016113116211\n20121008 00:00,1455800,1458900,1453100,1456600,0.0019374194966233378\n20121009 00:00,1455200,1456400,1441500,1442500,0.005915084432785093\n20121010 00:00,1442000,1443200,1430900,1432800,0.007053760590694252\n20121011 00:00,1442800,1444900,1433600,1433600,0.006804947663704645\n20121012 00:00,1434400,1439500,1425900,1428400,0.0044111548945906295\n20121015 00:00,1432300,1442300,1427700,1440100,0.002094183454091807\n20121016 00:00,1447600,1456400,1446600,1455800,0.002094183454091807\n20121017 00:00,1456300,1463200,1454200,1461600,0.0\n20121018 00:00,1458500,1465200,1453300,1458600,0.0011850374983366529\n20121019 00:00,1455000,1455600,1430500,1433000,0.010202176622738169\n20121022 00:00,1432000,1436700,1422800,1434100,0.010202176622738169\n20121023 00:00,1418800,1420600,1408300,1413500,0.01309422963144333\n20121024 00:00,1419400,1421000,1408000,1410500,0.008383332900026838\n20121025 00:00,1420700,1422800,1405700,1414300,0.008383332900026838\n20121026 00:00,1413200,1418400,1403900,1413500,0.0012681358245782764\n20121031 00:00,1418400,1420300,1406800,1411800,0.000767337427516817\n20121101 00:00,1416600,1430100,1415200,1429100,0.000767337427516817\n20121102 00:00,1437200,1437200,1414100,1415600,0.005497966657625173\n20121105 00:00,1413700,1421700,1409300,1419000,0.005453942085270414\n20121106 00:00,1422700,1435200,1421300,1429300,0.005453942085270414\n20121107 00:00,1416500,1416800,1390700,1397800,0.012724084152713385\n20121108 00:00,1397200,1404100,1379500,1379500,0.014799858800379422\n20121109 00:00,1376100,1394400,1375600,1381600,0.014799858800379422\n20121112 00:00,1385500,1388100,1379600,1382400,0.007558670715531686\n20121113 00:00,1375200,1392500,1373600,1378000,0.0018376310651290052\n20121114 00:00,1382100,1384300,1356200,1359800,0.007843680386939379\n20121115 00:00,1359500,1364900,1351800,1357000,0.007933262618665376\n20121116 00:00,1359200,1366400,1347000,1363500,0.007717497511835442\n20121119 00:00,1379200,1391500,1378300,1391500,0.001188837147912162\n20121120 00:00,1388900,1394200,1380800,1392800,0.0\n20121121 00:00,1393100,1395700,1390300,1394500,0.0\n20121123 00:00,1401400,1414000,1400400,1413300,0.0\n20121126 00:00,1406900,1411700,1401900,1411700,0.0006536194938819769\n20121127 00:00,1409100,1413800,1402400,1403800,0.003296355391975776\n20121128 00:00,1397700,1415400,1390000,1414800,0.003296355391975776\n20121129 00:00,1420200,1425000,1413700,1421600,0.0032309039644386277\n20121130 00:00,1421700,1424200,1416700,1420600,0.00040612708862523556\n20121203 00:00,1428100,1429200,1413400,1414700,0.0024319866946529187\n20121204 00:00,1414400,1418700,1408700,1412200,0.002637330037914463\n20121205 00:00,1414100,1421600,1403800,1415000,0.002605872313980617\n20121206 00:00,1413700,1420400,1411600,1419100,0.0010202697907500126\n20121207 00:00,1425200,1426900,1416700,1424000,0.0\n20121210 00:00,1422200,1428100,1421500,1425200,0.0\n20121211 00:00,1430700,1441100,1429900,1434200,0.0\n20121212 00:00,1440100,1445500,1433100,1435400,0.0\n20121213 00:00,1434400,1438300,1422800,1426600,0.0035395585682518444\n20121214 00:00,1423200,1425800,1418800,1421200,0.0041598614696968395\n20121217 00:00,1425000,1438500,1424300,1437900,0.0041598614696968395\n20121218 00:00,1440000,1455000,1437900,1454100,0.0021853998693564755\n20121219 00:00,1455500,1455800,1442400,1442700,0.004526368935260085\n20121220 00:00,1443600,1451400,1439900,1451400,0.004526368935260085\n20121221 00:00,1422000,1431000,1419400,1427700,0.01045788856653913\n20121224 00:00,1424500,1425600,1421900,1423300,0.00959403002918091\n20121226 00:00,1426200,1427100,1413500,1416500,0.009982684672130936\n20121227 00:00,1417500,1420700,1399200,1415900,0.003291562271924839\n20121228 00:00,1406500,1414200,1398700,1398700,0.00754040241906567\n20121231 00:00,1397200,1425600,1395400,1425200,0.007017769416209008\n20130102 00:00,1452800,1461500,1447300,1461500,0.0070135070485638695\n20130103 00:00,1459900,1463700,1453400,1457300,0.0016591660147769168\n20130104 00:00,1459700,1466100,1456700,1464500,0.0016591660147769168\n20130107 00:00,1458700,1461100,1454300,1459200,0.0026680536329814395\n20130108 00:00,1457200,1459100,1449800,1455300,0.0025974568456337476\n20130109 00:00,1458900,1463200,1456400,1459900,0.0025974568456337476\n20130110 00:00,1467200,1470900,1459700,1470700,0.0015430825451202789\n20130111 00:00,1470600,1471500,1466100,1470700,0.0\n20130114 00:00,1468900,1470700,1464300,1469600,0.00043182518263994613\n20130115 00:00,1462900,1472100,1462000,1470700,0.00043182518263994613\n20130116 00:00,1467800,1472800,1466100,1470500,0.0004389047558087169\n20130117 00:00,1476600,1484200,1474300,1479700,7.851366957088765e-05\n20130118 00:00,1480000,1484900,1474300,1483300,7.851366957088765e-05\n20130122 00:00,1483400,1491300,1479800,1491000,0.0\n20130123 00:00,1491200,1494900,1488600,1493700,0.0\n20130124 00:00,1491200,1501400,1490100,1494200,0.0\n20130125 00:00,1498800,1502500,1494600,1502500,0.0\n20130128 00:00,1503300,1503300,1495100,1500700,0.000691667543787873\n20130129 00:00,1497800,1508500,1496700,1506600,0.000691667543787873\n20130130 00:00,1506400,1509300,1499300,1500800,0.0023277755190127688\n20130131 00:00,1499300,1503800,1496000,1497000,0.002660284586788729\n20130201 00:00,1506600,1514100,1503900,1512800,0.002660284586788729\n20130204 00:00,1503100,1505800,1494300,1495300,0.006836872700312697\n20130205 00:00,1503600,1514800,1502900,1510800,0.006678761046284031\n20130206 00:00,1505300,1512600,1504100,1511800,0.006678761046284031\n20130207 00:00,1512100,1513500,1498700,1509600,0.0008401710492242085\n20130208 00:00,1512400,1518900,1512200,1518000,0.0008401710492242085\n20130211 00:00,1517600,1519000,1514000,1517700,0.0008478834793122277\n20130212 00:00,1517800,1523000,1516100,1520000,0.00011410084371336412\n20130213 00:00,1523200,1526100,1517200,1521500,0.00011410084371336412\n20130214 00:00,1517100,1524700,1515200,1523100,0.0\n20130215 00:00,1524300,1525900,1515500,1521700,0.0005306876612602222\n20130219 00:00,1523800,1532800,1523600,1532000,0.0005306876612602222\n20130220 00:00,1531000,1531900,1512600,1512600,0.007330328599137064\n20130221 00:00,1509000,1509600,1499400,1504000,0.008014196183700886\n20130222 00:00,1511400,1518900,1507700,1518900,0.008014196183700886\n20130225 00:00,1526000,1528600,1490000,1490100,0.011428745942139065\n20130226 00:00,1497000,1501900,1487300,1500200,0.010947190567292925\n20130227 00:00,1498900,1523300,1497700,1519100,0.010947190567292925\n20130228 00:00,1518700,1528700,1515300,1515300,0.0014442308096376869\n20130301 00:00,1510900,1523400,1504200,1521100,0.0014442308096376869\n20130304 00:00,1517600,1529200,1515200,1529200,0.0014442308096376869\n20130305 00:00,1536500,1547000,1536400,1542900,0.0\n20130306 00:00,1548300,1549200,1541600,1545000,0.0\n20130307 00:00,1546900,1549800,1545200,1548200,0.0\n20130308 00:00,1554700,1556400,1546600,1554400,0.0\n20130311 00:00,1553500,1560400,1551400,1560300,0.0\n20130312 00:00,1559300,1561000,1552200,1556400,0.0014430981540982455\n20130313 00:00,1557500,1561200,1552400,1558400,0.0014430981540982455\n20130314 00:00,1563100,1568000,1562200,1567300,0.0014430981540982455\n20130315 00:00,1558700,1560400,1553100,1558800,0.0031311665208395545\n20130318 00:00,1542900,1556400,1542000,1549700,0.0046004637452891715\n20130319 00:00,1552900,1555100,1535900,1546100,0.004791981831568846\n20130320 00:00,1555100,1559500,1552600,1556300,0.0036275178969730013\n20130321 00:00,1547900,1553100,1541000,1543400,0.004969982303478082\n20130322 00:00,1548500,1556000,1547300,1556000,0.004785593055674444\n20130325 00:00,1559900,1562700,1543500,1550700,0.005173899060857969\n20130326 00:00,1556000,1562200,1554200,1561500,0.0019665529734607997\n20130327 00:00,1552700,1562500,1550000,1561600,0.0019665529734607997\n20130328 00:00,1561300,1568500,1558500,1565500,0.0\n20130401 00:00,1566000,1569100,1556800,1560500,0.0018439804190023424\n20130402 00:00,1565900,1572100,1563700,1568200,0.0018439804190023424\n20130403 00:00,1569200,1570300,1548200,1551500,0.006418858346470326\n20130404 00:00,1554300,1561700,1550900,1558500,0.006148290712579205\n20130405 00:00,1539800,1553500,1537700,1551800,0.006630381687161987\n20130408 00:00,1552500,1562200,1547600,1562100,0.002482031956092695\n20130409 00:00,1564800,1573200,1559800,1567500,0.002482031956092695\n20130410 00:00,1571700,1588700,1571300,1587300,0.0\n20130411 00:00,1586900,1597100,1585400,1592200,0.0\n20130412 00:00,1587100,1590400,1579200,1587800,0.0015954912601648006\n20130415 00:00,1580200,1581300,1551200,1551700,0.01322316338540781\n20130416 00:00,1563200,1574900,1559100,1574200,0.01322316338540781\n20130417 00:00,1563100,1563200,1542800,1550400,0.015763853153683696\n20130418 00:00,1553300,1554100,1535500,1541400,0.009350139248927386\n20130419 00:00,1544400,1555500,1541200,1554800,0.009350139248927386\n20130422 00:00,1557800,1565400,1547500,1562000,0.0033514915007137464\n20130423 00:00,1569600,1579300,1561800,1577900,0.0\n20130424 00:00,1578200,1582900,1575400,1579000,0.0\n20130425 00:00,1582500,1592700,1581000,1586100,0.0\n20130426 00:00,1583400,1586000,1577300,1582600,0.0012740217780490928\n20130429 00:00,1586500,1596500,1584200,1593000,0.0012740217780490928\n20130430 00:00,1592900,1597200,1586100,1596800,0.0012740217780490928\n20130501 00:00,1593200,1594100,1581000,1583200,0.004917311911935712\n20130502 00:00,1586700,1598900,1585300,1597200,0.004917311911935712\n20130503 00:00,1611300,1618800,1610400,1613200,0.004917311911935712\n20130506 00:00,1614600,1620100,1614200,1617800,0.0\n20130507 00:00,1620900,1626500,1616700,1626300,0.0\n20130508 00:00,1624200,1633900,1623300,1633400,0.0\n20130509 00:00,1632900,1637000,1624700,1629300,0.001449207850910655\n20130510 00:00,1630300,1634900,1625100,1634100,0.001449207850910655\n20130513 00:00,1632300,1638100,1628200,1635400,0.001449207850910655\n20130514 00:00,1637200,1653500,1636700,1652800,0.0\n20130515 00:00,1650100,1664500,1649100,1661500,0.0\n20130516 00:00,1657900,1663600,1651100,1653400,0.0028146477161817176\n20130517 00:00,1659700,1670400,1657400,1669700,0.0028146477161817176\n20130520 00:00,1668100,1675800,1666100,1669700,0.0028146477161817176\n20130521 00:00,1670900,1678000,1665000,1671100,0.0\n20130522 00:00,1673400,1690700,1651700,1659200,0.004111344744992262\n20130523 00:00,1642000,1659100,1639400,1654500,0.004424688389794594\n20130524 00:00,1644800,1653300,1639800,1653300,0.004444459261111852\n20130528 00:00,1670900,1677800,1658100,1663000,0.0016882128158225286\n20130529 00:00,1654100,1658000,1643400,1652200,0.0037727894889897006\n20130530 00:00,1653800,1665900,1652300,1658900,0.003749478597262736\n20130531 00:00,1653600,1663100,1632400,1632400,0.009955878182394929\n20130603 00:00,1638800,1644600,1626600,1643800,0.00922284775063299\n20130604 00:00,1644300,1651000,1627300,1635600,0.00966207896292224\n20130605 00:00,1631000,1634200,1611300,1611800,0.008881122083636306\n20130606 00:00,1611900,1627400,1602500,1626400,0.008881122083636306\n20130607 00:00,1638300,1649500,1631400,1648100,0.00840115945629316\n20130610 00:00,1653000,1654000,1643800,1648000,3.503126443718724e-05\n20130611 00:00,1632700,1645400,1627400,1631200,0.005885713792748817\n20130612 00:00,1642300,1643800,1616000,1617500,0.007625908905623706\n20130613 00:00,1616500,1645000,1613000,1642200,0.007625828443348492\n20130614 00:00,1640300,1646600,1629100,1631700,0.006094260941289467\n20130617 00:00,1643000,1652200,1635500,1645000,0.003691497884844186\n20130618 00:00,1645600,1659900,1645200,1656900,0.003691497884844186\n20130619 00:00,1656100,1658900,1633800,1635400,0.007491719951461761\n20130620 00:00,1618700,1621000,1589800,1592700,0.016833501475768023\n20130621 00:00,1596200,1597600,1574800,1590500,0.016852381746087584\n20130624 00:00,1574100,1584300,1557300,1569900,0.016846191175240662\n20130625 00:00,1585200,1591700,1574300,1586500,0.007520189692368299\n20130626 00:00,1599300,1605000,1592600,1601700,0.007477784058664749\n20130627 00:00,1611500,1618200,1609500,1611300,0.0\n20130628 00:00,1606500,1614000,1598600,1600100,0.004013109299896857\n20130701 00:00,1612800,1624800,1610800,1614000,0.004013109299896857\n20130702 00:00,1610900,1623000,1605000,1611600,0.004103911735226697\n20130703 00:00,1605100,1617600,1602200,1613400,0.0008585134114344161\n20130705 00:00,1625300,1630800,1613000,1630500,0.0008585134114344161\n20130708 00:00,1639200,1643900,1635800,1639400,0.0\n20130709 00:00,1650000,1653300,1642700,1650800,0.0\n20130710 00:00,1650300,1657500,1646300,1652100,0.0\n20130711 00:00,1671100,1676000,1665300,1675100,0.0\n20130712 00:00,1674300,1678500,1671300,1675100,0.0\n20130715 00:00,1679600,1683900,1676800,1682200,0.0\n20130716 00:00,1682500,1683500,1670700,1675000,0.0024711223030349245\n20130717 00:00,1681600,1684700,1677300,1679700,0.0024711223030349245\n20130718 00:00,1682900,1692700,1682000,1688800,0.0024711223030349245\n20130719 00:00,1684800,1692300,1683100,1692300,0.0\n20130722 00:00,1693900,1697400,1690100,1695000,0.0\n20130723 00:00,1697900,1698300,1690500,1691400,0.0012262306602257634\n20130724 00:00,1698000,1698500,1681800,1685500,0.0023578737251180406\n20130725 00:00,1681700,1690800,1679400,1689300,0.0023578737251180406\n20130726 00:00,1682400,1691600,1675200,1691100,0.002013933184473684\n20130729 00:00,1687000,1690600,1681100,1685300,0.001980149938678889\n20130730 00:00,1691500,1692800,1681900,1686000,0.001980149938678889\n20130731 00:00,1689400,1698500,1684900,1686600,0.001980149938678889\n20130801 00:00,1700000,1708100,1699000,1706500,0.0\n20130802 00:00,1703000,1709600,1700500,1709500,0.0\n20130805 00:00,1706100,1709600,1703500,1708000,0.0005065957319592886\n20130806 00:00,1703400,1705200,1693500,1697300,0.0036521954346223806\n20130807 00:00,1692300,1694300,1685500,1691800,0.0041034964931477\n20130808 00:00,1700000,1701800,1689300,1698100,0.004072105626532311\n20130809 00:00,1695600,1701000,1687300,1693000,0.002550856545935691\n20130812 00:00,1684700,1693100,1683800,1691000,0.0018633038390581478\n20130813 00:00,1694000,1699000,1684100,1696900,0.0018633038390581478\n20130814 00:00,1695600,1697900,1687000,1687400,0.0033034391105180917\n20130815 00:00,1674300,1674300,1660900,1662700,0.009048219436831597\n20130816 00:00,1660400,1666300,1655000,1658700,0.009154203783390786\n20130819 00:00,1656400,1662100,1647600,1647600,0.009395716442647709\n20130820 00:00,1650300,1662000,1648600,1655900,0.004105695847865401\n20130821 00:00,1651500,1660300,1641900,1645600,0.005274889199808803\n20130822 00:00,1649500,1662900,1648900,1660600,0.003591223970440922\n20130823 00:00,1665500,1668300,1657700,1666700,0.003591223970440922\n20130826 00:00,1667700,1673000,1658900,1659700,0.0024248226341437736\n20130827 00:00,1643300,1649800,1632100,1632900,0.009632945876621368\n20130828 00:00,1633100,1644900,1630600,1639100,0.009632945876621368\n20130829 00:00,1635300,1650400,1634000,1642200,0.009322761471520157\n20130830 00:00,1644600,1645300,1631700,1636500,0.0020039559946297045\n20130903 00:00,1652300,1655800,1637000,1643800,0.0020039559946297045\n20130904 00:00,1644600,1660300,1641350,1657600,0.0020039559946297045\n20130905 00:00,1658500,1664000,1657300,1658600,0.0\n20130906 00:00,1664800,1669800,1644800,1660400,0.0\n20130909 00:00,1664500,1677300,1664400,1676700,0.0\n20130910 00:00,1686400,1689000,1682600,1688400,0.0\n20130911 00:00,1686600,1694000,1683500,1693700,0.0\n20130912 00:00,1693500,1695600,1687200,1690400,0.0011249075328131995\n20130913 00:00,1691300,1694600,1687400,1693300,0.0011249075328131995\n20130916 00:00,1711600,1712400,1700400,1703800,0.0011249075328131995\n20130917 00:00,1704700,1711100,1704600,1710700,0.0\n20130918 00:00,1709700,1735200,1705800,1731400,0.0\n20130919 00:00,1735300,1736000,1725900,1728100,0.001100413473677782\n20130920 00:00,1723000,1723300,1705800,1706200,0.007398976490529572\n20130923 00:00,1705000,1706400,1694000,1699400,0.007748515746024625\n20130924 00:00,1699200,1705200,1692100,1695700,0.007772304015634564\n20130925 00:00,1696100,1699300,1689000,1691100,0.00305413813583314\n20130926 00:00,1693200,1701700,1690500,1696900,0.0020082620829383973\n20130927 00:00,1688500,1691400,1684700,1689500,0.002965151553146288\n20130930 00:00,1674600,1685400,1671500,1681000,0.0038440039727149146\n20131001 00:00,1681500,1695000,1680000,1694000,0.0038440039727149146\n20131002 00:00,1683400,1692100,1678300,1691100,0.0030682456290125493\n20131003 00:00,1687700,1689400,1668400,1676200,0.005182067370854961\n20131004 00:00,1677400,1690600,1675300,1688900,0.005182067370854961\n20131007 00:00,1674300,1684500,1672500,1674200,0.007150489130117882\n20131008 00:00,1674500,1676200,1653700,1654800,0.008367212430017708\n20131009 00:00,1658200,1662000,1645300,1655700,0.008367212430017708\n20131010 00:00,1673200,1692400,1672300,1692400,0.006690117800907167\n20131011 00:00,1689000,1703200,1687700,1703000,0.0\n20131014 00:00,1692400,1710700,1690800,1710400,0.0\n20131015 00:00,1705200,1711500,1694700,1697200,0.004455696651837622\n20131016 00:00,1707200,1721600,1706400,1720500,0.004455696651837622\n20131017 00:00,1713800,1733200,1713400,1732700,0.004455696651837622\n20131018 00:00,1738500,1745100,1735100,1743600,0.0\n20131021 00:00,1744700,1747500,1740100,1744500,0.0\n20131022 00:00,1749400,1759300,1746600,1753500,0.0\n20131023 00:00,1748000,1748900,1739700,1746200,0.002403568272075412\n20131024 00:00,1748900,1753700,1745100,1752400,0.002403568272075412\n20131025 00:00,1755100,1759600,1751700,1759300,0.002403568272075412\n20131028 00:00,1759000,1764700,1757000,1762400,0.0\n20131029 00:00,1766400,1772200,1763800,1772200,0.0\n20131030 00:00,1773700,1775100,1756600,1763300,0.002899456830937641\n20131031 00:00,1761800,1768900,1755300,1757300,0.003502332114024171\n20131101 00:00,1760500,1766000,1752200,1761400,0.003502332114024171\n20131104 00:00,1767100,1769000,1761500,1768600,0.0019645560115339215\n20131105 00:00,1761600,1767500,1755700,1762800,0.0018933798265858993\n20131106 00:00,1770600,1775000,1765400,1771800,0.0018933798265858993\n20131107 00:00,1775200,1776400,1747600,1749700,0.007446143472681772\n20131108 00:00,1748500,1773100,1748500,1773100,0.00720140024217783\n20131111 00:00,1771400,1775300,1769100,1772900,0.007201694695496642\n20131112 00:00,1769400,1773600,1763700,1769800,0.0010116227471744358\n20131113 00:00,1761100,1784000,1760900,1783200,0.0010116227471744358\n20131114 00:00,1785300,1794200,1782500,1793200,0.001009524414511703\n20131115 00:00,1795400,1801200,1793300,1801200,0.0\n20131118 00:00,1803900,1805000,1790200,1795000,0.001987326043179954\n20131119 00:00,1793400,1798700,1787200,1790300,0.002496953562356997\n20131120 00:00,1794100,1799300,1779800,1785100,0.0030078059834430983\n20131121 00:00,1789800,1800500,1788600,1799700,0.0022577493288969907\n20131122 00:00,1799600,1808300,1797700,1808100,0.0016769376081025814\n20131125 00:00,1811400,1811700,1803700,1807100,0.0003193132399699095\n20131126 00:00,1807500,1812200,1804100,1806400,0.0003898424266844422\n20131127 00:00,1808800,1812400,1806500,1811200,0.0003898424266844422\n20131129 00:00,1813400,1817500,1808000,1809300,0.0006456285891772509\n20131202 00:00,1811300,1814300,1802500,1805400,0.0013840482731142362\n20131203 00:00,1799500,1803900,1791700,1798500,0.00260470355406262\n20131204 00:00,1792100,1804800,1783500,1796700,0.0025983745084017995\n20131205 00:00,1794200,1797400,1787800,1790100,0.0031146010090497968\n20131206 00:00,1807300,1811100,1801600,1809500,0.0021981465973264997\n20131209 00:00,1814800,1816700,1811600,1814000,0.0021208391922143332\n20131210 00:00,1809600,1813600,1806400,1807500,0.0020687854188161754\n20131211 00:00,1808100,1808500,1785000,1787200,0.006806236758703789\n20131212 00:00,1786400,1788600,1777600,1781300,0.007068070226378648\n20131213 00:00,1784700,1786600,1777700,1781100,0.006758842038298154\n20131216 00:00,1789200,1798100,1789000,1792200,0.0019070815379112916\n20131217 00:00,1793700,1794100,1782500,1785400,0.002191552498940819\n20131218 00:00,1789400,1817300,1773300,1817000,0.002190593589158268\n20131219 00:00,1812000,1817000,1807200,1815000,0.0022809117587483316\n20131220 00:00,1806700,1819900,1806600,1815800,0.000635498370049132\n20131223 00:00,1824100,1826400,1820700,1825400,0.000635498370049132\n20131224 00:00,1825700,1830000,1825300,1829300,0.0\n20131226 00:00,1833700,1839600,1833300,1838400,0.0\n20131227 00:00,1841600,1841800,1836600,1838400,0.0\n20131230 00:00,1839200,1840200,1835800,1838200,6.281008150454215e-05\n20131231 00:00,1841200,1846800,1839300,1846700,6.281008150454215e-05\n20140102 00:00,1839100,1840600,1824800,1829200,0.005471541392319393\n20140103 00:00,1832400,1836000,1826300,1828800,0.005472637358899988\n20140106 00:00,1835200,1835600,1820800,1823600,0.005713556151793117\n20140107 00:00,1831200,1837900,1829600,1834300,0.0016464822495754806\n20140108 00:00,1834600,1838300,1829000,1835200,0.0016416346236800496\n20140109 00:00,1841000,1841400,1828000,1836400,0.0\n20140110 00:00,1839600,1842100,1830100,1841400,0.0\n20140113 00:00,1836900,1841800,1813400,1816600,0.00777576120120711\n20140114 00:00,1822700,1837700,1819500,1837200,0.00777576120120711\n20140115 00:00,1841000,1849400,1840100,1846900,0.00777576120120711\n20140116 00:00,1843000,1845000,1838400,1843900,0.0009378151538085065\n20140117 00:00,1841000,1844500,1833300,1836500,0.0024996352713680483\n20140121 00:00,1847200,1847700,1830500,1841800,0.0024996352713680483\n20140122 00:00,1845100,1845700,1839100,1843000,0.002317041049950204\n20140123 00:00,1833500,1834000,1818300,1827900,0.004730325048704991\n20140124 00:00,1815700,1816500,1788300,1788300,0.013372430543321054\n20140127 00:00,1790500,1795100,1771300,1780100,0.013631962757782414\n20140128 00:00,1782500,1793000,1781300,1791000,0.012784929939704827\n20140129 00:00,1776200,1785500,1768800,1772800,0.00643661822679162\n20140130 00:00,1788800,1798100,1782600,1792300,0.005866987660106776\n20140131 00:00,1770200,1792900,1769200,1781800,0.0067721344667356995\n20140203 00:00,1779400,1783700,1738300,1741500,0.013489200686538345\n20140204 00:00,1749400,1758400,1743400,1753600,0.013489200686538345\n20140205 00:00,1747800,1755600,1737100,1751700,0.0130732393716475\n20140206 00:00,1756100,1774800,1755800,1774800,0.0006255505881958802\n20140207 00:00,1782800,1798700,1777400,1797400,0.0006255505881958802\n20140210 00:00,1797100,1800700,1792100,1800100,0.0\n20140211 00:00,1802300,1824400,1800700,1819800,0.0\n20140212 00:00,1822600,1828300,1817100,1821600,0.0\n20140213 00:00,1808700,1832000,1808300,1830000,0.0\n20140214 00:00,1829000,1843600,1826800,1840100,0.0\n20140218 00:00,1842000,1844900,1836500,1842600,0.0\n20140219 00:00,1837800,1849500,1828700,1830500,0.0037913482346654346\n20140220 00:00,1833000,1845200,1826200,1841000,0.0037913482346654346\n20140221 00:00,1844200,1848900,1838000,1839600,0.0038166852133672932\n20140224 00:00,1843000,1861500,1842100,1849100,0.0004390496343647638\n20140225 00:00,1850300,1855800,1842300,1848400,0.0004904431139225209\n20140226 00:00,1851000,1856000,1843300,1848500,0.0002185631866490466\n20140227 00:00,1845800,1858700,1843800,1858700,0.0002185631866490466\n20140228 00:00,1857800,1871500,1850500,1863000,0.0\n20140303 00:00,1846500,1854500,1837500,1849800,0.004090726544982886\n20140304 00:00,1868100,1879800,1867500,1875800,0.004090726544982886\n20140305 00:00,1877500,1880700,1874500,1876100,0.004090726544982886\n20140306 00:00,1882200,1886100,1878900,1882100,0.0\n20140307 00:00,1889600,1889600,1874300,1882600,0.0\n20140310 00:00,1879900,1882300,1870800,1882100,0.00015333853957014577\n20140311 00:00,1884800,1887000,1868000,1872300,0.003010141919879194\n20140312 00:00,1863200,1873500,1859000,1872800,0.003010141919879194\n20140313 00:00,1878800,1879900,1846600,1851800,0.007137861719324295\n20140314 00:00,1848000,1857900,1844400,1846600,0.006673834238607425\n20140317 00:00,1856200,1867700,1855200,1863300,0.006673834238607425\n20140318 00:00,1867400,1879100,1865100,1876600,0.0016212449507431181\n20140319 00:00,1877100,1879400,1854800,1866600,0.0030765760907472367\n20140320 00:00,1862500,1878900,1859200,1877500,0.0030765760907472367\n20140321 00:00,1876900,1881700,1860300,1861900,0.005698951271672745\n20140324 00:00,1868400,1870700,1846200,1854000,0.005386434640471966\n20140325 00:00,1864000,1869400,1852700,1863100,0.005386434640471966\n20140326 00:00,1870000,1873400,1849500,1849700,0.004821211395869199\n20140327 00:00,1847700,1853400,1839100,1845800,0.004327237013355782\n20140328 00:00,1851400,1864200,1850000,1855000,0.004327237013355782\n20140331 00:00,1866600,1873000,1864700,1870400,0.0012173141859974966\n20140401 00:00,1876500,1883600,1874500,1882700,0.0\n20140402 00:00,1885000,1891300,1881400,1888600,0.0\n20140403 00:00,1891300,1892100,1880600,1886000,0.0007948272264603774\n20140404 00:00,1896400,1897000,1861000,1863800,0.006842279562096421\n20140407 00:00,1859000,1862600,1839600,1843400,0.009313998801829431\n20140408 00:00,1841800,1854000,1835900,1851300,0.009280022810346827\n20140409 00:00,1856100,1871500,1850800,1871500,0.006319318323569221\n20140410 00:00,1870700,1871700,1829400,1831700,0.012278140910364499\n20140411 00:00,1821600,1834200,1813100,1814800,0.01338387986890217\n20140414 00:00,1829200,1833700,1814500,1829400,0.01338387986890217\n20140415 00:00,1833300,1843300,1815200,1842400,0.0053268655070724666\n20140416 00:00,1854900,1861400,1846500,1861400,0.0\n20140417 00:00,1858700,1869100,1855600,1863900,0.0\n20140421 00:00,1864500,1871000,1862100,1870400,0.0\n20140422 00:00,1872400,1884000,1871300,1878900,0.0\n20140423 00:00,1878000,1879200,1873000,1874400,0.0013827644959036242\n20140424 00:00,1883900,1883900,1869300,1878100,0.0013827644959036242\n20140425 00:00,1872000,1873300,1858700,1862900,0.004872965813831602\n20140428 00:00,1870800,1876900,1849700,1868800,0.004672660716512583\n20140429 00:00,1874800,1880400,1870800,1877000,0.004672660716512583\n20140430 00:00,1874600,1885000,1871800,1884300,0.0\n20140501 00:00,1882500,1888400,1877300,1882900,0.00042896055663401073\n20140502 00:00,1883300,1891400,1877900,1880600,0.0008254559502609144\n20140505 00:00,1871600,1885500,1866300,1884400,0.0008254559502609144\n20140506 00:00,1880300,1881300,1867400,1868100,0.0050436118097573115\n20140507 00:00,1874100,1879700,1860200,1878900,0.0049940614454419795\n20140508 00:00,1877100,1890400,1870800,1877000,0.005028072368375347\n20140509 00:00,1877100,1880400,1868300,1880000,0.0005838338982704234\n20140512 00:00,1887700,1898800,1887500,1898100,0.0005838338982704234\n20140513 00:00,1900000,1904200,1897800,1899600,0.0\n20140514 00:00,1898200,1898800,1887900,1890400,0.002796179446485862\n20140515 00:00,1886800,1887200,1864800,1874000,0.005736393828398582\n20140516 00:00,1875000,1881300,1867200,1881100,0.005736393828398582\n20140519 00:00,1877000,1888900,1875200,1887000,0.005008751806342511\n20140520 00:00,1886700,1886700,1870700,1875500,0.003518562848797377\n20140521 00:00,1881000,1892200,1880600,1891300,0.003518562848797377\n20140522 00:00,1892000,1899800,1888600,1896000,0.003518562848797377\n20140523 00:00,1897600,1904800,1896800,1903800,0.0\n20140527 00:00,1910600,1915800,1909500,1915700,0.0\n20140528 00:00,1915500,1918200,1910600,1913800,0.0005726186310279632\n20140529 00:00,1918500,1924000,1913400,1924000,0.0005726186310279632\n20140530 00:00,1922100,1928000,1920400,1926300,0.0005726186310279632\n20140602 00:00,1929800,1929900,1919700,1929100,0.0\n20140603 00:00,1924300,1929000,1922600,1928100,0.00029928478004748616\n20140604 00:00,1924800,1933000,1922700,1931900,0.00029928478004748616\n20140605 00:00,1934300,1946500,1927000,1944600,0.00029928478004748616\n20140606 00:00,1948800,1954300,1947800,1954100,0.0\n20140609 00:00,1953600,1960500,1951700,1955700,0.0\n20140610 00:00,1953600,1956000,1949200,1955900,0.0\n20140611 00:00,1948700,1951100,1944800,1949200,0.0019777324012324256\n20140612 00:00,1946800,1948000,1931100,1935400,0.004540860252714921\n20140613 00:00,1938900,1943200,1933000,1941600,0.004540860252714921\n20140616 00:00,1938800,1947000,1936600,1942900,0.004087540383140164\n20140617 00:00,1940000,1949700,1938100,1948300,0.0\n20140618 00:00,1948300,1963700,1944000,1962600,0.0\n20140619 00:00,1964600,1966000,1958000,1964800,0.0\n20140620 00:00,1960000,1960600,1957100,1959400,0.00158677293038679\n20140623 00:00,1960000,1960500,1955200,1958800,0.0015965915102704885\n20140624 00:00,1955200,1965000,1944800,1947100,0.0038002007225123677\n20140625 00:00,1942800,1957800,1942500,1955800,0.003453067795276432\n20140626 00:00,1956000,1956300,1941300,1954500,0.0034698259111512458\n20140627 00:00,1950100,1958800,1948900,1957900,0.00038375874319792534\n20140630 00:00,1957100,1961700,1955300,1957200,0.00043575111507385237\n20140701 00:00,1962100,1976300,1961300,1970600,0.0002064176865175427\n20140702 00:00,1970300,1974800,1969600,1972200,0.0002064176865175427\n20140703 00:00,1978100,1982900,1976500,1982500,0.0\n20140707 00:00,1978400,1979800,1972200,1975100,0.002155052707189513\n20140708 00:00,1971200,1972200,1957600,1962800,0.004191854047932554\n20140709 00:00,1967500,1973000,1963100,1971200,0.004191854047932554\n20140710 00:00,1952400,1968600,1950600,1963500,0.004244249192641382\n20140711 00:00,1962400,1967500,1957900,1966000,0.0022552744890219755\n20140714 00:00,1976300,1978600,1974400,1976000,0.0022552744890219755\n20140715 00:00,1977300,1981000,1963700,1972300,0.0010810708481789276\n20140716 00:00,1981300,1982600,1974200,1979600,0.0010810708481789276\n20140717 00:00,1973200,1981000,1954300,1957100,0.006650578029891198\n20140718 00:00,1963800,1979100,1962400,1977400,0.006562124195174089\n20140721 00:00,1970800,1975000,1964300,1973400,0.006665242620130068\n20140722 00:00,1980400,1985600,1978700,1982000,0.0011678977833308678\n20140723 00:00,1985100,1988500,1981000,1986400,0.0011678977833308678\n20140724 00:00,1988200,1990600,1984500,1986500,0.0\n20140725 00:00,1981100,1982600,1973300,1977400,0.0026447960984774914\n20140728 00:00,1977800,1980900,1966200,1978000,0.0026447960984774914\n20140729 00:00,1982100,1984500,1969300,1969300,0.0036665426595181563\n20140730 00:00,1976600,1979100,1961600,1969800,0.002539407149620697\n20140731 00:00,1956300,1957800,1930400,1930900,0.011680997129703321\n20140801 00:00,1925800,1937500,1915800,1924800,0.011546594528125302\n20140804 00:00,1929100,1943000,1920500,1938800,0.011546594528125302\n20140805 00:00,1931100,1936000,1913200,1920100,0.005859720441090195\n20140806 00:00,1910800,1928900,1910800,1920700,0.005568624940089753\n20140807 00:00,1929600,1931200,1905500,1909900,0.0064458337317497135\n20140808 00:00,1914300,1933700,1909500,1932400,0.0032464116766012323\n20140811 00:00,1939900,1946600,1937100,1938000,0.0032464116766012323\n20140812 00:00,1936300,1941500,1929400,1935400,0.0007745669246094225\n20140813 00:00,1943000,1950600,1939600,1948900,0.0007745669246094225\n20140814 00:00,1951900,1957600,1949800,1957600,0.0007745669246094225\n20140815 00:00,1964900,1966500,1943200,1957100,0.00014746379985434722\n20140818 00:00,1968100,1974500,1966900,1973200,0.00014746379985434722\n20140819 00:00,1978500,1985400,1976500,1983900,0.00014746379985434722\n20140820 00:00,1981500,1991600,1980800,1989200,0.0\n20140821 00:00,1990600,1997600,1989300,1995000,0.0\n20140822 00:00,1993200,1996900,1987400,1991900,0.0008971357566354913\n20140825 00:00,2001500,2005300,1998600,2002000,0.0008971357566354913\n20140826 00:00,2003500,2008200,2002800,2003300,0.0008971357566354913\n20140827 00:00,2004500,2005700,1999400,2002500,0.00023055968419690418\n20140828 00:00,1995900,2002600,1993900,2001400,0.00039209627624690446\n20140829 00:00,2004400,2007300,1998200,2007100,0.00039209627624690446\n20140902 00:00,2009900,2010000,1998600,2006100,0.00042816646799381867\n20140903 00:00,2013500,2014100,2002200,2005000,0.0004277450818544484\n20140904 00:00,2008600,2015800,1996600,2002200,0.0009127128414847738\n20140905 00:00,2001900,2011900,1994200,2011100,0.0008661985503143148\n20140908 00:00,2009400,2012100,2000000,2005900,0.001696645780340908\n20140909 00:00,2004200,2005500,1989200,1993200,0.003948469320641882\n20140910 00:00,1994600,2002000,1987700,2000700,0.003948469320641882\n20140911 00:00,1992800,2003300,1991200,2003000,0.003655390806475021\n20140912 00:00,2001200,2001200,1985600,1991200,0.003401264691182001\n20140915 00:00,1991700,1993100,1983800,1990200,0.0034136011827247386\n20140916 00:00,1986400,2008400,1985000,2005200,0.0034136011827247386\n20140917 00:00,2008000,2016800,1997500,2007500,0.00028995091863682804\n20140918 00:00,2013600,2018500,2011000,2018200,0.0\n20140919 00:00,2015500,2017300,2002900,2007000,0.0032040050614031146\n20140922 00:00,2003600,2003700,1987400,1991500,0.0054906345972490014\n20140923 00:00,1984100,1992600,1979500,1980100,0.006408565633148855\n20140924 00:00,1980600,1996900,1975200,1995700,0.0055501409928829576\n20140925 00:00,1990500,1990500,1963200,1963300,0.009938814104800197\n20140926 00:00,1967000,1983900,1964200,1979000,0.009373226798488685\n20140929 00:00,1962000,1978900,1960500,1974900,0.009449238135831145\n20140930 00:00,1977000,1983000,1966100,1970200,0.0018217144605818414\n20141001 00:00,1967500,1967700,1939100,1943700,0.007976412940247125\n20141002 00:00,1941800,1950500,1923500,1944200,0.007886218527380699\n20141003 00:00,1957100,1969400,1950800,1965200,0.007765598484176787\n20141006 00:00,1973600,1976000,1955900,1963000,0.0006463314635747884\n20141007 00:00,1952900,1957200,1932500,1933000,0.008847129196558941\n20141008 00:00,1933600,1969200,1923600,1966100,0.008847129196558941\n20141009 00:00,1963600,1966000,1925800,1927000,0.014480539192405013\n20141010 00:00,1927100,1936500,1905100,1905400,0.013180046342722828\n20141013 00:00,1904400,1911500,1873000,1874500,0.01616719039735324\n20141014 00:00,1884600,1898200,1870400,1878300,0.011381826773470596\n20141015 00:00,1851900,1868800,1819200,1864300,0.01030450799916672\n20141016 00:00,1830200,1875800,1829000,1862700,0.004331741161515861\n20141017 00:00,1884800,1897500,1876200,1884700,0.004331741161515861\n20141020 00:00,1880900,1904500,1880700,1903000,0.0004954998823705151\n20141021 00:00,1917000,1942000,1914800,1940700,0.0\n20141022 00:00,1944400,1949100,1926100,1926900,0.0041054432497639294\n20141023 00:00,1946400,1962000,1942600,1949300,0.0041054432497639294\n20141024 00:00,1952300,1964900,1944900,1964300,0.0041054432497639294\n20141027 00:00,1957500,1964500,1950300,1961600,0.0007935884166430992\n20141028 00:00,1968400,1984200,1967300,1984100,0.0007935884166430992\n20141029 00:00,1985900,1991200,1968000,1981100,0.0011797674784289256\n20141030 00:00,1975900,1999500,1974100,1993800,0.0008729654793452283\n20141031 00:00,2017800,2018100,2007800,2016600,0.0008729654793452283\n20141103 00:00,2019600,2024500,2013100,2017700,0.0\n20141104 00:00,2012200,2016000,2000600,2010700,0.002002999397495846\n20141105 00:00,2025500,2025900,2014500,2023400,0.002002999397495846\n20141106 00:00,2024100,2032600,2016400,2031500,0.002002999397495846\n20141107 00:00,2031600,2035900,2026100,2033400,0.0\n20141110 00:00,2034000,2040400,2031300,2039800,0.0\n20141111 00:00,2040700,2043000,2036600,2041600,0.0\n20141112 00:00,2033500,2042400,2033100,2039600,0.0005655860787515755\n20141113 00:00,2041400,2048300,2032100,2041900,0.0005655860787515755\n20141114 00:00,2041300,2044800,2037200,2042400,0.0005655860787515755\n20141117 00:00,2038500,2045800,2036600,2043700,0.0\n20141118 00:00,2044600,2059200,2044400,2055500,0.0\n20141119 00:00,2053000,2055500,2043000,2052200,0.0009269062944907621\n20141120 00:00,2042500,2057100,2041900,2055800,0.0009269062944907621\n20141121 00:00,2076000,2077200,2059800,2067200,0.0009269062944907621\n20141124 00:00,2071900,2073900,2069100,2072600,0.0\n20141125 00:00,2075100,2077900,2068000,2072500,2.7856328726688488e-05\n20141126 00:00,2072700,2077600,2070300,2076400,2.7856328726688488e-05\n20141128 00:00,2075000,2078700,2069100,2072000,0.0012237524498858645\n20141201 00:00,2063800,2065400,2053800,2058000,0.00408836332862892\n20141202 00:00,2058000,2073400,2057900,2070900,0.00408836332862892\n20141203 00:00,2072800,2081500,2071100,2079100,0.0039010153323623606\n20141204 00:00,2075500,2082700,2067000,2076400,0.0007497694804540678\n20141205 00:00,2078800,2084700,2075500,2080000,0.0007497694804540678\n20141208 00:00,2075500,2081200,2059300,2066100,0.003930429972269859\n20141209 00:00,2043700,2066000,2039100,2064700,0.0038780375285413326\n20141210 00:00,2059400,2059800,2029300,2031600,0.010035317978214255\n20141211 00:00,2038900,2061900,2037100,2042300,0.009263988419183895\n20141212 00:00,2026500,2038100,2008500,2009400,0.01312141345347466\n20141215 00:00,2020000,2025300,1987800,1995100,0.01016783314803984\n20141216 00:00,1985500,2023900,1978600,1979000,0.011184448962493035\n20141217 00:00,1984800,2023400,1983000,2017900,0.00621199158311414\n20141218 00:00,2047800,2129700,2039300,2068400,0.004659084423814807\n20141219 00:00,2064600,2073300,2056200,2063300,0.0014235575192743767\n20141222 00:00,2067100,2074700,2064600,2074700,0.0014235575192743767\n20141223 00:00,2082000,2082300,2075100,2077500,0.0014235575192743767\n20141224 00:00,2080300,2083400,2077200,2078100,0.0\n20141226 00:00,2082900,2088400,2082500,2084400,0.0\n20141229 00:00,2082500,2089700,2081500,2087200,0.0\n20141230 00:00,2082100,2083700,2075100,2076000,0.003098085001400845\n20141231 00:00,2079600,2081800,2054000,2055000,0.0066110991451191784\n20150102 00:00,2064000,2068800,2041800,2054300,0.006614023644002946\n20150105 00:00,2042000,2043700,2013500,2017600,0.011854655210297495\n20150106 00:00,2021300,2027200,1988600,1998200,0.011715071035135369\n20150107 00:00,2014600,2027200,2008800,2023100,0.011713420188033606\n20150108 00:00,2040000,2061600,2039900,2059000,0.005551444896054075\n20150109 00:00,2063900,2064100,2035200,2041900,0.004794895387636044\n20150112 00:00,2044200,2045900,2019300,2026500,0.00647700437291339\n20150113 00:00,2041500,2054800,2005200,2020800,0.006677479922926582\n20150114 00:00,1996700,2011000,1985700,2009400,0.005675025846432161\n20150115 00:00,2016400,2020000,1988800,1989700,0.006729362069610059\n20150116 00:00,1987500,2018200,1985500,2016300,0.006530479414986174\n20150120 00:00,2024300,2027100,2001700,2020800,0.005660296756761016\n20150121 00:00,2015100,2036600,2009400,2030600,0.0\n20150122 00:00,2040200,2062600,2023300,2060500,0.0\n20150123 00:00,2058000,2061000,2048100,2049700,0.00302615040390581\n20150126 00:00,2047300,2055600,2038500,2054400,0.00302615040390581\n20150127 00:00,2030000,2041200,2017500,2027900,0.008038670220282505\n20150128 00:00,2041600,2049500,1999100,2001400,0.010601144988132463\n20150129 00:00,2003400,2023000,1986800,2020100,0.010601144988132463\n20150130 00:00,2005600,2021700,1991300,1994700,0.0104699764974389\n20150202 00:00,2000700,2020200,1978600,2019000,0.0072593915337936105\n20150203 00:00,2029400,2048500,2025500,2048400,0.0072593915337936105\n20150204 00:00,2039100,2053800,2035100,2040600,0.0021984632394449885\n20150205 00:00,2048300,2063000,2047700,2061800,0.0021984632394449885\n20150206 00:00,2065700,2072400,2049200,2055300,0.002854149889964083\n20150209 00:00,2047700,2056400,2041400,2046300,0.003115218435065734\n20150210 00:00,2058900,2071200,2048200,2067700,0.003115218435065734\n20150211 00:00,2066000,2074500,2058300,2069300,0.0025281722486773647\n20150212 00:00,2079100,2089900,2076800,2089200,0.0\n20150213 00:00,2090800,2098400,2087600,2097800,0.0\n20150217 00:00,2093800,2103200,2091000,2101600,0.0\n20150218 00:00,2096300,2102200,2093500,2101500,2.7471938960314565e-05\n20150219 00:00,2094300,2104200,2092400,2099800,0.0004678524477436113\n20150220 00:00,2094300,2113300,2087300,2112800,0.0004678524477436113\n20150223 00:00,2109700,2112100,2104800,2111900,0.0005278409877282991\n20150224 00:00,2111100,2120500,2107600,2118100,0.0002459367863832842\n20150225 00:00,2116400,2122400,2112200,2116100,0.0005980659307302999\n20150226 00:00,2115500,2117100,2106500,2113700,0.0008520401169894366\n20150227 00:00,2112500,2115800,2106400,2106600,0.0021182585420211554\n20150302 00:00,2107900,2120600,2107200,2119900,0.002046905297331029\n20150303 00:00,2114600,2115900,2100800,2111200,0.003061899584018422\n20150304 00:00,2104200,2104900,2090600,2102100,0.0034361615722041214\n20150305 00:00,2105900,2108000,2098500,2105100,0.0034361615722041214\n20150306 00:00,2093800,2099400,2071000,2075000,0.008622243855959895\n20150309 00:00,2077600,2087900,2075800,2083600,0.008255305259896319\n20150310 00:00,2067000,2068100,2049700,2050000,0.012443150764105468\n20150311 00:00,2052900,2055000,2044000,2045000,0.009416203197835185\n20150312 00:00,2052400,2071800,2052000,2071300,0.009416203197835185\n20150313 00:00,2067600,2069300,2045800,2058400,0.0038616268078397954\n20150316 00:00,2066800,2086900,2066800,2086400,0.0035957217556830067\n20150317 00:00,2076500,2084200,2069800,2079900,0.004020507841568416\n20150318 00:00,2073500,2112600,2066200,2104200,0.0017986851752936199\n20150319 00:00,2100400,2102900,2090300,2095000,0.003099570269616315\n20150320 00:00,2096600,2110200,2096100,2104500,0.0025242954455586834\n20150323 00:00,2104300,2111100,2100000,2100000,0.0028100072952726048\n20150324 00:00,2098700,2104000,2087400,2088200,0.0034711149339549745\n20150325 00:00,2090100,2093500,2057100,2057600,0.009144740867177996\n20150326 00:00,2049600,2063700,2041200,2052700,0.009164747216459315\n20150327 00:00,2051600,2059500,2049100,2057500,0.008571349144673227\n20150330 00:00,2069600,2086100,2069600,2082400,0.0013749107304768281\n20150331 00:00,2072600,2081000,2063600,2064300,0.005018267322479946\n20150401 00:00,2064200,2064200,2045100,2057000,0.005417702248484597\n20150402 00:00,2055800,2069800,2054000,2064000,0.005417702248484597\n20150406 00:00,2053900,2084500,2052100,2078400,0.0020416882066968535\n20150407 00:00,2078600,2087500,2072500,2072800,0.0015556011871930185\n20150408 00:00,2075300,2085000,2070800,2080200,0.0015556011871930185\n20150409 00:00,2078200,2091800,2071900,2089200,0.0015556011871930185\n20150410 00:00,2092100,2100900,2089600,2100600,0.0\n20150413 00:00,2098400,2106200,2090300,2090600,0.0027485017099382176\n20150414 00:00,2088600,2097100,2081000,2094900,0.0027485017099382176\n20150415 00:00,2100700,2110400,2099500,2104700,0.0027485017099382176\n20150416 00:00,2100400,2109800,2098000,2104000,0.00019202032994382326\n20150417 00:00,2089800,2092300,2070100,2079800,0.006643401369564943\n20150420 00:00,2090900,2102500,2089600,2098500,0.006643401369564943\n20150421 00:00,2106500,2108600,2092400,2096000,0.006676151341425234\n20150422 00:00,2100400,2108500,2089000,2106600,0.0006878130440667224\n20150423 00:00,2101700,2119300,2100100,2112100,0.0006878130440667224\n20150424 00:00,2117000,2119700,2111100,2116700,0.0\n20150427 00:00,2123400,2124800,2105400,2107400,0.0025366643848743716\n20150428 00:00,2107100,2115000,2093400,2114400,0.0025366643848743716\n20150429 00:00,2103200,2112900,2096000,2105300,0.0035509096194819363\n20150430 00:00,2099000,2103500,2076200,2085200,0.006046333453424356\n20150501 00:00,2094100,2107700,2092800,2107200,0.006046333453424356\n20150504 00:00,2112200,2120200,2111000,2113900,0.005512155232371384\n20150505 00:00,2110100,2114600,2087300,2089200,0.006746086214571998\n20150506 00:00,2095400,2099300,2067600,2080400,0.007171033151451194\n20150507 00:00,2079100,2093800,2075300,2088700,0.007171033151451194\n20150508 00:00,2108400,2118500,2107900,2116500,0.002431879364765795\n20150511 00:00,2115400,2118900,2105300,2106000,0.0028642465516140318\n20150512 00:00,2095900,2106300,2086300,2099800,0.0033305996453916217\n20150513 00:00,2104900,2112200,2097400,2100600,0.0033305996453916217\n20150514 00:00,2112400,2123200,2109100,2122500,0.0016997016471869191\n20150515 00:00,2124300,2126100,2118700,2124400,0.0\n20150518 00:00,2122400,2134000,2121700,2131000,0.0\n20150519 00:00,2132600,2135700,2126900,2130300,0.00018965048729833214\n20150520 00:00,2131600,2137800,2125100,2128800,0.00044858874949853646\n20150521 00:00,2127400,2137500,2125100,2135000,0.00044858874949853646\n20150522 00:00,2130200,2135400,2129100,2130000,0.001411899986779222\n20150526 00:00,2123900,2125000,2102100,2107100,0.006352750773243718\n20150527 00:00,2112300,2129800,2108500,2126700,0.006352750773243718\n20150528 00:00,2123400,2125900,2116300,2125000,0.006224326291438229\n20150529 00:00,2124000,2124300,2108200,2111300,0.0037507130300578986\n20150601 00:00,2119500,2123400,2106200,2115400,0.0037507130300578986\n20150602 00:00,2110200,2121900,2102700,2113900,0.003744657086119908\n20150603 00:00,2119700,2126700,2113400,2119200,0.0004093908498555416\n20150604 00:00,2111200,2117700,2097500,2102700,0.004513827956512903\n20150605 00:00,2099300,2105800,2089800,2097600,0.004708288721714553\n20150608 00:00,2096300,2098200,2083900,2084800,0.005880502812601601\n20150609 00:00,2084400,2091000,2076900,2084700,0.0037913108941051194\n20150610 00:00,2093800,2114000,2093100,2109500,0.0035232226103083103\n20150611 00:00,2114900,2120900,2112000,2116300,2.7693316826057428e-05\n20150612 00:00,2106200,2108400,2096800,2100100,0.004419540878359345\n20150615 00:00,2086200,2094400,2077900,2091100,0.005064998273084471\n20150616 00:00,2089000,2103500,2087200,2102500,0.005064998273084471\n20150617 00:00,2105800,2113200,2093900,2105900,0.0024742404755519185\n20150618 00:00,2112300,2133400,2111800,2127800,0.0\n20150619 00:00,2114200,2115500,2104500,2108100,0.005345333350425637\n20150622 00:00,2119500,2125900,2116500,2118900,0.005345333350425637\n20150623 00:00,2121800,2124400,2115700,2120400,0.005345333350425637\n20150624 00:00,2117100,2121700,2104800,2105000,0.00419316833876639\n20150625 00:00,2111300,2112500,2097700,2098600,0.004545763338354039\n20150626 00:00,2102800,2105800,2091600,2098200,0.004547095138196573\n20150629 00:00,2080200,2088200,2053300,2054200,0.012234324011146058\n20150630 00:00,2073200,2073200,2052800,2058500,0.01210774051582764\n20150701 00:00,2077900,2080300,2065600,2075000,0.012107240417664419\n20150702 00:00,2080700,2082700,2068200,2073100,0.0005286580778121755\n20150706 00:00,2057400,2076500,2055400,2067200,0.0017260781293232659\n20150707 00:00,2069300,2081600,2041200,2080200,0.0017260781293232659\n20150708 00:00,2063400,2067600,2042500,2045300,0.009824716192258397\n20150709 00:00,2070300,2073500,2048800,2049000,0.009686339964771643\n20150710 00:00,2072800,2079800,2064900,2074800,0.009686339964771643\n20150713 00:00,2090000,2099000,2089400,2097700,0.0\n20150714 00:00,2096900,2110500,2096600,2106800,0.0\n20150715 00:00,2107100,2112800,2100500,2106100,0.00019182892938710193\n20150716 00:00,2118200,2123000,2115500,2123000,0.00019182892938710193\n20150717 00:00,2123400,2125500,2118000,2124800,0.00019182892938710193\n20150720 00:00,2127700,2131800,2122100,2125900,0.0\n20150721 00:00,2124500,2127400,2113900,2117500,0.0022812654693037805\n20150722 00:00,2109100,2117700,2108900,2113700,0.002505526861534337\n20150723 00:00,2115400,2116500,2097500,2101800,0.004104030405532766\n20150724 00:00,2102500,2103700,2076000,2080000,0.006891936140365403\n20150727 00:00,2069800,2075500,2062600,2067900,0.007596423323694508\n20150728 00:00,2078000,2095000,2068000,2093300,0.006865875515701008\n20150729 00:00,2094400,2110400,2093200,2107700,0.003358624162112734\n20150730 00:00,2102000,2110200,2094200,2108200,0.0\n20150731 00:00,2114400,2114500,2101600,2105000,0.0008763499010562862\n20150803 00:00,2105300,2105300,2086500,2097900,0.0021354599558830434\n20150804 00:00,2097000,2102400,2088000,2093800,0.0024152290496049504\n20150805 00:00,2104000,2113100,2097300,2100700,0.002250631514258669\n20150806 00:00,2102700,2104100,2076500,2083500,0.004859994046450373\n20150807 00:00,2081600,2083400,2068700,2079500,0.004855409705498387\n20150810 00:00,2092900,2106700,2092800,2105700,0.004855409705498387\n20150811 00:00,2089600,2094700,2077600,2086700,0.005326119405200533\n20150812 00:00,2071400,2091400,2053600,2089200,0.005209505207105873\n20150813 00:00,2087500,2095500,2080200,2086600,0.005258821241804975\n20150814 00:00,2084300,2095000,2082600,2094200,0.0007185098123171447\n20150817 00:00,2087300,2105900,2081600,2105900,0.0007185098123171447\n20150818 00:00,2102900,2106800,2097000,2099800,0.0016723665141064185\n20150819 00:00,2091000,2100100,2073500,2083200,0.004860987337925502\n20150820 00:00,2065400,2071700,2039100,2039700,0.01299894615958444\n20150821 00:00,2018100,2029200,1975400,1978300,0.021638590810045214\n20150824 00:00,1874900,1958400,1829500,1895000,0.03222409183061748\n20150825 00:00,1954500,1954500,1870600,1872700,0.030646519245858844\n20150826 00:00,1922100,1947900,1883700,1944600,0.025241955572904685\n20150827 00:00,1970500,1994100,1952100,1992700,0.0067941482865059135\n20150828 00:00,1985000,1998300,1979200,1992800,0.0\n20150831 00:00,1981400,1991200,1970200,1976700,0.004664461729201621\n20150901 00:00,1930700,1947600,1907300,1917700,0.01785271554990808\n20150902 00:00,1946900,1954400,1924300,1954100,0.01785271554990808\n20150903 00:00,1962500,1980500,1949600,1955500,0.017232592645413023\n20150904 00:00,1928800,1938600,1916100,1925900,0.008739231893639936\n20150908 00:00,1959700,1976100,1951800,1974300,0.008739231893639936\n20150909 00:00,1993300,1994600,1943500,1947900,0.01166087912720259\n20150910 00:00,1945000,1972200,1942500,1958500,0.007720228489391722\n20150911 00:00,1953200,1967600,1945400,1967400,0.007720228489391722\n20150914 00:00,1969500,1970000,1954400,1960100,0.002142247110442367\n20150915 00:00,1965900,1989900,1960900,1984600,0.002142247110442367\n20150916 00:00,1988200,2004000,1984100,2001800,0.002142247110442367\n20150917 00:00,1999600,2028400,1992800,1997300,0.0012978700226562512\n20150918 00:00,1957400,1975600,1949600,1954500,0.012439887461951593\n20150921 00:00,1964500,1976800,1952200,1964600,0.012439887461951593\n20150922 00:00,1939000,1944600,1925700,1939100,0.01446458534748253\n20150923 00:00,1941300,1946700,1929100,1936000,0.007550484852323893\n20150924 00:00,1921300,1934500,1905600,1929000,0.007833746845850432\n20150925 00:00,1946100,1950000,1918100,1928500,0.0022873760091496266\n20150928 00:00,1917500,1919000,1876400,1880100,0.014640255393249273\n20150929 00:00,1882400,1897400,1869300,1881200,0.014490662850258625\n20150930 00:00,1904000,1918200,1894400,1916300,0.014489890084925013\n20151001 00:00,1920300,1924900,1898200,1921300,0.0\n20151002 00:00,1897500,1950000,1891200,1950000,0.0\n20151005 00:00,1964700,1987400,1963300,1984700,0.0\n20151006 00:00,1982700,1989800,1970000,1977900,0.0019781235604824166\n20151007 00:00,1988500,1998300,1974900,1994100,0.0019781235604824166\n20151008 00:00,1989600,2015500,1985900,2012100,0.0019781235604824166\n20151009 00:00,2014000,2019000,2005800,2013300,0.0\n20151012 00:00,2014300,2017600,2009100,2015200,0.0\n20151013 00:00,2006300,2021600,2000500,2002500,0.0036385214463617657\n20151014 00:00,2001600,2008700,1989400,1992900,0.004571616153585978\n20151015 00:00,2000500,2023500,1996400,2023500,0.004571616153585978\n20151016 00:00,2028200,2032800,2019200,2032700,0.0027678215152162054\n20151019 00:00,2025300,2033700,2021300,2033700,0.0\n20151020 00:00,2028600,2038400,2025500,2031100,0.0007381180606249667\n20151021 00:00,2036400,2037900,2016500,2018500,0.0036568794386363\n20151022 00:00,2030000,2055100,2028100,2052600,0.0036568794386363\n20151023 00:00,2072400,2079500,2063000,2075100,0.0035816126196589406\n20151026 00:00,2072700,2073700,2065600,2070000,0.0014189611936133593\n20151027 00:00,2062000,2070000,2058000,2066000,0.0018050295850213852\n20151028 00:00,2070000,2089700,2062100,2089500,0.0018050295850213852\n20151029 00:00,2083600,2092700,2082100,2088300,0.0011638819204026658\n20151030 00:00,2090700,2094400,2078300,2079300,0.0025102161554730793\n20151102 00:00,2083600,2106200,2081800,2103900,0.0025102161554730793\n20151103 00:00,2099800,2116600,2097000,2110000,0.002488221243454784\n20151104 00:00,2113700,2114900,2097300,2103600,0.0017512046079685257\n20151105 00:00,2104400,2109800,2090900,2101500,0.0018436135677612506\n20151106 00:00,2097400,2103200,2084700,2100400,0.0018682182092560529\n20151109 00:00,2093300,2094900,2069500,2080800,0.0054267393678671255\n20151110 00:00,2075400,2086000,2071900,2085600,0.005396045474094498\n20151111 00:00,2089000,2089400,2076700,2077400,0.005846263066849605\n20151112 00:00,2065100,2070600,2048200,2049000,0.008212853727603487\n20151113 00:00,2043600,2046700,2024400,2025300,0.010585202687827507\n20151116 00:00,2023000,2056500,2021900,2056500,0.010338941075560599\n20151117 00:00,2059700,2070300,2048800,2054000,0.006714771585758155\n20151118 00:00,2060300,2089000,2060100,2086800,0.0007018602834787538\n20151119 00:00,2085500,2090500,2082000,2085400,0.0008016458993605539\n20151120 00:00,2094700,2101200,2088600,2093800,0.00038733485569557855\n20151123 00:00,2094000,2099800,2085300,2090900,0.0008885240514451521\n20151124 00:00,2078700,2098300,2074100,2093700,0.0007996541124509975\n20151125 00:00,2094800,2097400,2090100,2093000,0.0008226220048321812\n20151127 00:00,2094000,2098000,2088700,2095300,0.00019302917726168875\n20151130 00:00,2097900,2098900,2085600,2086900,0.0023226164120318\n20151201 00:00,2094200,2108200,2091200,2106800,0.0023145813302118266\n20151202 00:00,2106000,2110000,2082300,2085400,0.006304717611508398\n20151203 00:00,2089000,2091500,2047600,2055800,0.01007710088586949\n20151204 00:00,2061000,2099700,2059400,2096600,0.01007710088586949\n20151207 00:00,2092000,2092400,2072000,2082700,0.009044728813457316\n20151208 00:00,2064800,2080400,2057800,2069900,0.005219377393156209\n20151209 00:00,2062000,2086800,2041800,2053300,0.006977140464841672\n20151210 00:00,2054400,2074300,2051500,2058600,0.005833451344996264\n20151211 00:00,2033800,2041400,2015100,2018800,0.012084439817302587\n20151214 00:00,2021000,2030000,1999700,2030000,0.011162217387422055\n20151215 00:00,2046900,2061100,2045500,2050600,0.011162217387422055\n20151216 00:00,2063700,2083900,2048300,2080200,0.0\n20151217 00:00,2083700,2084800,2048400,2048600,0.008770439624263125\n20151218 00:00,2027700,2028900,1999800,2000200,0.016216704886965843\n20151221 00:00,2014300,2018800,2000900,2017000,0.016216704886965843\n20151222 00:00,2027000,2038500,2015500,2035600,0.013640414443413997\n20151223 00:00,2047000,2060700,2045800,2060500,0.0\n20151224 00:00,2057200,2063300,2054300,2056500,0.0011207964458910503\n20151228 00:00,2048600,2052500,2039500,2052200,0.0016472752529020647\n20151229 00:00,2065300,2077900,2064700,2074000,0.0016472752529020647\n20151230 00:00,2070900,2072100,2057600,2059300,0.0042664676156513835\n20151231 00:00,2051700,2058900,2038900,2038900,0.007032557732873039\n20160104 00:00,2005300,2010300,1985900,2010100,0.010768684184629552\n20160105 00:00,2013900,2019000,2000500,2013500,0.009960880695931968\n20160106 00:00,1983300,2000500,1976000,1988500,0.010857944314650744\n20160107 00:00,1953200,1974300,1935900,1939900,0.01582720704274045\n20160108 00:00,1952100,1958500,1915800,1919500,0.01695177306445345\n20160111 00:00,1930500,1934000,1898300,1921100,0.015361489058381394\n20160112 00:00,1938500,1945500,1911400,1936600,0.00607141888317357\n20160113 00:00,1945300,1948600,1883800,1888700,0.014280221983983826\n20160114 00:00,1895500,1932600,1876600,1918900,0.014280221983983826\n20160115 00:00,1867900,1887600,1855200,1878300,0.01879213738807129\n20160119 00:00,1899500,1901100,1862100,1880600,0.012215551060033757\n20160120 00:00,1850000,1874900,1810200,1858100,0.014033326302403627\n20160121 00:00,1861900,1888700,1846500,1867000,0.006907572613403464\n20160122 00:00,1897800,1907600,1888800,1905500,0.006907572613403464\n20160125 00:00,1899100,1901500,1874100,1876300,0.00884735127805671\n20160126 00:00,1884400,1905300,1880300,1902400,0.00884735127805671\n20160127 00:00,1895800,1915600,1870600,1881400,0.010903814410244425\n20160128 00:00,1900000,1902000,1871700,1891700,0.0063731894727618345\n20160129 00:00,1900300,1938700,1898800,1938700,0.0063731894727618345\n20160201 00:00,1925000,1945800,1918500,1936500,0.0006551661382458228\n20160202 00:00,1919000,1919600,1895400,1901100,0.010574511085896252\n20160203 00:00,1913700,1917800,1871100,1912300,0.010574511085896252\n20160204 00:00,1907200,1927400,1899600,1915300,0.01055419547085607\n20160205 00:00,1909700,1910800,1872000,1879800,0.010701161466209834\n20160208 00:00,1857500,1861200,1828100,1853500,0.0134075657302225\n20160209 00:00,1833800,1869300,1832100,1853500,0.0134075657302225\n20160210 00:00,1864400,1883200,1851200,1853100,0.00807858195716891\n20160211 00:00,1823800,1841000,1810900,1830300,0.00710464135662038\n20160212 00:00,1849300,1866500,1839700,1866500,0.00710464135662038\n20160216 00:00,1887800,1898100,1876400,1898100,0.007103548722423762\n20160217 00:00,1911200,1933200,1910100,1928700,0.0\n20160218 00:00,1932200,1932600,1917200,1920500,0.0024546441682765153\n20160219 00:00,1911500,1921800,1904500,1920000,0.002459242126574844\n20160222 00:00,1939000,1949500,1938000,1948300,0.002459242126574844\n20160223 00:00,1939900,1943200,1921800,1923300,0.007409909846542339\n20160224 00:00,1906200,1935300,1893200,1932300,0.007408385120228204\n20160225 00:00,1937300,1955500,1928300,1955500,0.007408385120228204\n20160226 00:00,1965200,1966800,1949000,1951000,0.001328599443289855\n20160229 00:00,1950800,1962300,1934400,1935600,0.004746967581441649\n20160301 00:00,1950500,1982100,1944600,1982100,0.004746967581441649\n20160302 00:00,1977000,1990600,1972500,1990300,0.004557249690169266\n20160303 00:00,1987000,1997900,1981100,1997700,0.0\n20160304 00:00,2000000,2013500,1990300,2003600,0.0\n20160307 00:00,1994000,2010700,1992700,2006300,0.0\n20160308 00:00,1993000,1999200,1982200,1983600,0.006532348657032598\n20160309 00:00,1993600,1997900,1984300,1994100,0.006532348657032598\n20160310 00:00,1999000,2010500,1973800,1995400,0.006532348657032598\n20160311 00:00,2012500,2028100,2011300,2027600,0.0\n20160314 00:00,2022000,2030300,2017700,2025300,0.0006549149828053467\n20160315 00:00,2013200,2022000,2010600,2022000,0.0011462470555078982\n20160316 00:00,2016200,2038200,2015600,2033900,0.0011462470555078982\n20160317 00:00,2032600,2052200,2027700,2047900,0.0009407277382737257\n20160318 00:00,2042000,2047800,2038000,2045200,0.0007611923076380827\n20160321 00:00,2041100,2049400,2038100,2046900,0.0007611923076380827\n20160322 00:00,2037400,2052300,2035700,2046200,0.0007863824108491397\n20160323 00:00,2041100,2043300,2030100,2032200,0.003955133511283146\n20160324 00:00,2019800,2031600,2017400,2031100,0.003967460693328803\n20160328 00:00,2036200,2038500,2027100,2032700,0.003962544736179461\n20160329 00:00,2027500,2052300,2024100,2052300,0.0003125112174532741\n20160330 00:00,2063500,2068700,2055900,2061000,0.0\n20160331 00:00,2058700,2064100,2053300,2055600,0.0015127081288811063\n20160401 00:00,2043500,2071400,2039900,2069100,0.0015127081288811063\n20160404 00:00,2068400,2070700,2058900,2062900,0.00229809351949445\n20160405 00:00,2046400,2052500,2039000,2041400,0.006261031262727558\n20160406 00:00,2042700,2064900,2039800,2064600,0.006261031262727558\n20160407 00:00,2051800,2055600,2030900,2038900,0.009373254499932279\n20160408 00:00,2053200,2058400,2038800,2044800,0.0071868167771836425\n20160411 00:00,2052300,2060700,2039100,2039900,0.0073187741940201004\n20160412 00:00,2042000,2062500,2037000,2059900,0.001383517370417261\n20160413 00:00,2070200,2081000,2068400,2080400,0.001383517370417261\n20160414 00:00,2080300,2086000,2076000,2080200,5.550377515762236e-05\n20160415 00:00,2080000,2081100,2074000,2078000,0.0006131176936576552\n20160418 00:00,2071100,2092700,2070000,2092500,0.0006131176936576552\n20160419 00:00,2097000,2102000,2089400,2099100,0.0006106002270056362\n20160420 00:00,2099000,2109200,2094000,2100700,0.0\n20160421 00:00,2101300,2102500,2086600,2089000,0.003215593920844806\n20160422 00:00,2085300,2092900,2079200,2089600,0.003215593920844806\n20160425 00:00,2082800,2086200,2075400,2085900,0.0033741872376405017\n20160426 00:00,2090200,2095200,2083700,2090000,0.0010222990026807067\n20160427 00:00,2084600,2098100,2080600,2093800,0.0010222990026807067\n20160428 00:00,2084900,2097600,2069700,2074200,0.005404558828979222\n20160429 00:00,2067100,2071300,2050300,2063000,0.006239236808910557\n20160502 00:00,2069000,2081800,2064100,2080300,0.006239236808910557\n20160503 00:00,2065000,2067900,2052800,2061300,0.006125726985974825\n20160504 00:00,2050000,2058300,2044200,2049600,0.006208447119223332\n20160505 00:00,2055700,2059800,2044700,2049500,0.006208511022820185\n20160506 00:00,2040400,2057700,2038800,2057000,0.003277178334413105\n20160509 00:00,2055800,2064000,2053700,2058900,2.8168924140813772e-05\n20160510 00:00,2066400,2084600,2066400,2084600,0.0\n20160511 00:00,2078900,2083300,2065000,2065000,0.005428410858733889\n20160512 00:00,2072900,2074800,2053700,2065500,0.005428410858733889\n20160513 00:00,2062300,2068600,2043800,2047200,0.007458768939915036\n20160516 00:00,2049500,2073400,2048900,2068100,0.0051152311431470286\n20160517 00:00,2064400,2068000,2042300,2048200,0.007551744955953479\n20160518 00:00,2044400,2063000,2036400,2049100,0.00555547137801533\n20160519 00:00,2040000,2045400,2027800,2042400,0.005867450014654422\n20160520 00:00,2049500,2060900,2048600,2054900,0.001887778441057273\n20160523 00:00,2054800,2058400,2049900,2051600,0.002103179620351643\n20160524 00:00,2061500,2082400,2061400,2078700,0.0009271769372357429\n20160525 00:00,2086400,2097700,2086200,2092600,0.0009271769372357429\n20160526 00:00,2094700,2097100,2089700,2093400,0.0\n20160527 00:00,2095500,2102100,2094700,2102100,0.0\n20160531 00:00,2105300,2106900,2091800,2100800,0.0003570502592391069\n20160601 00:00,2091500,2104800,2088900,2103000,0.0003570502592391069\n20160602 00:00,2098000,2109200,2092400,2109200,0.0003570502592391069\n20160603 00:00,2103200,2106900,2088600,2102800,0.0017518688236362633\n20160606 00:00,2107100,2117600,2105100,2113900,0.0017518688236362633\n20160607 00:00,2115600,2123400,2115000,2117000,0.0017518688236362633\n20160608 00:00,2118000,2125200,2116900,2123900,0.0\n20160609 00:00,2114900,2122200,2111900,2120400,0.0009514223561201756\n20160610 00:00,2104300,2108600,2094400,2100300,0.005554984760586883\n20160613 00:00,2093400,2103700,2083500,2084200,0.007102453913871274\n20160614 00:00,2079700,2087400,2069200,2080900,0.007097556177167081\n20160615 00:00,2085700,2092000,2075300,2077800,0.004600263862306448\n20160616 00:00,2067400,2085700,2055900,2083500,0.0012551620192348739\n20160617 00:00,2071400,2072000,2057500,2065300,0.005116144770888376\n20160620 00:00,2088400,2096000,2077500,2079100,0.005043328485361743\n20160621 00:00,2082600,2089200,2077900,2084100,0.005043328485361743\n20160622 00:00,2086900,2094900,2079400,2080300,0.0010526994975867882\n20160623 00:00,2098300,2108700,2092700,2108700,0.0010526994975867882\n20160624 00:00,2040000,2069000,2027200,2031300,0.02121781759161959\n20160627 00:00,2015900,2015900,1986500,1995300,0.02353263559256702\n20160628 00:00,2016600,2032200,2011200,2032200,0.02353263559256702\n20160629 00:00,2048300,2069300,2047200,2067100,0.010232171363573314\n20160630 00:00,2071800,2095400,2065600,2095300,0.0\n20160701 00:00,2092900,2104900,2092900,2097900,0.0\n20160705 00:00,2089000,2090800,2077100,2083900,0.003852854649246729\n20160706 00:00,2078700,2098000,2070600,2097700,0.003852854649246729\n20160707 00:00,2098900,2106400,2086300,2095400,0.003904512143276901\n20160708 00:00,2110000,2129400,2107800,2127000,0.0006330293269467396\n20160711 00:00,2131600,2140700,2129500,2134500,0.0006330293269467396\n20160712 00:00,2145100,2153000,2142500,2150000,0.0\n20160713 00:00,2154200,2154500,2143500,2149300,0.00018797450624781213\n20160714 00:00,2163400,2166600,2156600,2161100,0.00018797450624781213\n20160715 00:00,2167900,2168200,2153100,2158400,0.0007454110777878969\n20160718 00:00,2159500,2166000,2156700,2164100,0.0007213204973448385\n20160719 00:00,2158800,2162300,2156500,2161800,0.0009470037376143531\n20160720 00:00,2167500,2173700,2162400,2171300,0.00061360640411077\n20160721 00:00,2169200,2172200,2157500,2162200,0.0024962862316073777\n20160722 00:00,2163900,2173000,2161000,2172500,0.0024196967022639044\n20160725 00:00,2170000,2170600,2159700,2166400,0.002912540592457043\n20160726 00:00,2165300,2171700,2157600,2167500,0.0016210985694161874\n20160727 00:00,2171700,2172700,2156200,2165100,0.0017425958295553467\n20160728 00:00,2162600,2171100,2157500,2168000,0.0006392805748812307\n20160729 00:00,2164500,2175400,2161300,2171500,0.0006392805748812307\n20160801 00:00,2171500,2176500,2164100,2169300,0.0005849277422137352\n20160802 00:00,2166400,2168300,2145800,2155200,0.0037979698397705495\n20160803 00:00,2154500,2162400,2151300,2162300,0.0037979698397705495\n20160804 00:00,2163000,2167800,2158300,2164300,0.0037526569840841406\n20160805 00:00,2171900,2182300,2170700,2181400,0.0\n20160808 00:00,2183900,2185200,2177400,2180500,0.00023820264154702928\n20160809 00:00,2181200,2187600,2178000,2182200,0.00023820264154702928\n20160810 00:00,2182900,2184000,2172300,2176300,0.0015790482520636315\n20160811 00:00,2182500,2189400,2179500,2186800,0.0015609781817518232\n20160812 00:00,2182600,2187100,2179900,2184100,0.001716041506840306\n20160815 00:00,2188900,2195000,2188800,2190900,0.0007128432992555375\n20160816 00:00,2185600,2186800,2179600,2179600,0.0030619320037082597\n20160817 00:00,2179800,2185300,2170200,2183800,0.002977798184236024\n20160818 00:00,2183100,2189000,2182200,2189000,0.002977798184236024\n20160819 00:00,2183400,2187500,2177400,2185600,0.0008967523596366788\n20160822 00:00,2182500,2188000,2178300,2185100,0.0009064270804892216\n20160823 00:00,2192300,2196000,2189000,2189300,0.0009064270804892216\n20160824 00:00,2188000,2189100,2173600,2178800,0.0027721511061197177\n20160825 00:00,2174000,2181900,2172200,2176600,0.002829704603017023\n20160826 00:00,2179000,2191100,2162500,2172800,0.0030038669075998625\n20160829 00:00,2174300,2186600,2174000,2183400,0.0011644053852258886\n20160830 00:00,2182500,2185900,2173500,2179800,0.0013864248313088829\n20160831 00:00,2176400,2177500,2164700,2174400,0.001718092916896968\n20160901 00:00,2173800,2177300,2160300,2173700,0.001728117220025435\n20160902 00:00,2183600,2188700,2177000,2183600,0.0014422910841839123\n20160906 00:00,2187200,2190900,2178600,2190900,0.00018586515288484363\n20160907 00:00,2188400,2192200,2183100,2190100,0.0002108175705654134\n20160908 00:00,2186000,2189400,2181600,2185100,0.0013348438970405866\n20160909 00:00,2170000,2170200,2132500,2133200,0.013777906990402301\n20160912 00:00,2123900,2168100,2123100,2164000,0.013776294022273098\n20160913 00:00,2148500,2151400,2125000,2132400,0.016097435705598545\n20160914 00:00,2132900,2146900,2125000,2131500,0.008434328758444876\n20160915 00:00,2130000,2157300,2127600,2152800,0.008434328758444876\n20160916 00:00,2135000,2136900,2125800,2133700,0.005128140417123838\n20160919 00:00,2141000,2148700,2130300,2134100,0.005122347706020901\n20160920 00:00,2144300,2145900,2133800,2134200,0.005122347706020901\n20160921 00:00,2142200,2160300,2134400,2158200,0.0\n20160922 00:00,2169900,2175300,2167100,2171800,0.0\n20160923 00:00,2167300,2168800,2158800,2159900,0.003163490286102075\n20160926 00:00,2150200,2152300,2140100,2142400,0.005647096422066\n20160927 00:00,2140300,2156800,2136200,2155700,0.005647096422066\n20160928 00:00,2158100,2168200,2147100,2166400,0.0046778229134767845\n20160929 00:00,2163900,2168700,2140500,2146800,0.005223442243406877\n20160930 00:00,2156700,2171200,2153600,2163000,0.005223442243406877\n20161003 00:00,2158100,2160400,2150400,2157800,0.005404707565182555\n20161004 00:00,2158600,2161700,2139900,2146800,0.003254072046739283\n20161005 00:00,2153700,2161300,2153300,2156300,0.003254072046739283\n20161006 00:00,2153900,2160400,2147400,2157800,0.0029432074154629186\n20161007 00:00,2160600,2163000,2141900,2150400,0.0019799758976750625\n20161010 00:00,2161400,2167000,2159900,2161600,0.0019799758976750625\n20161011 00:00,2156400,2157400,2125800,2134300,0.007555705010320959\n20161012 00:00,2136100,2143200,2130100,2137100,0.007291664669169522\n20161013 00:00,2121500,2135900,2112100,2130100,0.007532901242759131\n20161014 00:00,2141400,2146900,2130300,2131200,0.0018910916121507681\n20161017 00:00,2130700,2133800,2121700,2123800,0.002755903337512325\n20161018 00:00,2142400,2142900,2132700,2137100,0.0020046884346861934\n20161019 00:00,2140000,2146400,2136000,2142800,0.0020046884346861934\n20161020 00:00,2138500,2145300,2131100,2138800,0.0010777492424670816\n20161021 00:00,2129500,2140800,2127600,2139800,0.0010777492424670816\n20161024 00:00,2149800,2153100,2144800,2148900,0.0010777492424670816\n20161025 00:00,2147000,2149800,2139800,2141700,0.0019344417786613425\n20161026 00:00,2132200,2144200,2129300,2137400,0.002255161374071134\n20161027 00:00,2145700,2146200,2130900,2131700,0.0027306308791336734\n20161028 00:00,2131300,2139300,2117200,2125400,0.0025740471749832313\n20161031 00:00,2129500,2131900,2123700,2125500,0.0022982669625104925\n20161101 00:00,2129000,2129900,2096000,2110100,0.004517723307558491\n20161102 00:00,2106700,2111000,2092400,2097400,0.005438123724856067\n20161103 00:00,2100100,2102400,2084600,2087800,0.00604619361562225\n20161104 00:00,2089100,2098800,2084000,2085500,0.004411644557553524\n20161107 00:00,2114700,2131900,2113000,2131500,0.0027180513392898163\n20161108 00:00,2127200,2147700,2123800,2141100,0.0006360310466214178\n20161109 00:00,2124700,2171000,2123400,2164400,0.0\n20161110 00:00,2173500,2183100,2152300,2169200,0.0\n20161111 00:00,2161300,2167000,2153200,2164200,0.0013307907735331755\n20161114 00:00,2169900,2172700,2157200,2165900,0.0013307907735331755\n20161115 00:00,2170000,2182800,2168100,2182800,0.0013307907735331755\n20161116 00:00,2175200,2181400,2174200,2178700,0.0010844493786317602\n20161117 00:00,2180400,2190600,2179200,2189900,0.0010844493786317602\n20161118 00:00,2190400,2192600,2182900,2185000,0.0016866830772621852\n20161121 00:00,2191900,2201800,2190000,2201500,0.0012918472619887474\n20161122 00:00,2204900,2207900,2197300,2205800,0.0012918472619887474\n20161123 00:00,2200000,2207600,2197500,2207000,0.0\n20161125 00:00,2211200,2215400,2210100,2215200,0.0\n20161128 00:00,2211900,2214800,2203700,2204800,0.002710564644082725\n20161129 00:00,2205800,2214400,2201700,2209100,0.002710564644082725\n20161130 00:00,2216500,2218200,2203100,2203800,0.0030439823014579742\n20161201 00:00,2207300,2207300,2191500,2195700,0.00253410600834906\n20161202 00:00,2197000,2202500,2192600,2196800,0.00253410600834906\n20161205 00:00,2206700,2214000,2204200,2210000,0.0021220333879825577\n20161206 00:00,2212400,2217400,2206700,2217000,0.0\n20161207 00:00,2215000,2246700,2213800,2246000,0.0\n20161208 00:00,2245800,2257000,2242700,2251500,0.0\n20161209 00:00,2254400,2265100,2253700,2265100,0.0\n20161212 00:00,2264200,2269600,2257600,2262500,0.0006627127720158333\n20161213 00:00,2270100,2283400,2270000,2277600,0.0006627127720158333\n20161214 00:00,2274100,2282200,2253700,2258800,0.004811482063892829\n20161215 00:00,2261300,2278100,2260100,2268100,0.004765623929032744\n20161216 00:00,2259900,2260800,2246700,2250400,0.006558307541150097\n20161219 00:00,2252400,2260100,2250800,2255300,0.004505577251733317\n20161220 00:00,2261600,2265700,2258800,2264000,0.004505577251733317\n20161221 00:00,2262700,2264500,2257700,2257700,0.0016065842296354414\n20161222 00:00,2256100,2257400,2249200,2253800,0.001890971922326381\n20161223 00:00,2254200,2257200,2252100,2257100,0.001890971922326381\n20161227 00:00,2260000,2267300,2260000,2262700,0.0009973273906363066\n20161228 00:00,2265900,2265900,2242800,2244000,0.00477148982801342\n20161229 00:00,2244700,2248900,2238400,2243500,0.004773223672540319\n20161230 00:00,2247100,2248300,2227300,2235300,0.005218877341650281\n20170103 00:00,2250700,2258300,2238900,2252400,0.002114134699671515\n20170104 00:00,2256400,2267500,2256100,2265800,0.002110217163964748\n20170105 00:00,2262800,2265800,2254900,2264000,0.0004586594070709367\n20170106 00:00,2265300,2277500,2259000,2272100,0.0004586594070709367\n20170109 00:00,2269000,2270700,2264200,2264600,0.0019601971945589548\n20170110 00:00,2264700,2274400,2260100,2264600,0.0019057818841258128\n20170111 00:00,2263800,2271000,2255900,2271000,0.0019057818841258128\n20170112 00:00,2265000,2267500,2249600,2265300,0.0014490957879263985\n20170113 00:00,2267500,2274000,2266900,2270500,0.0014490957879263985\n20170117 00:00,2263000,2267800,2258000,2262500,0.002497622652155609\n20170118 00:00,2265200,2268000,2259000,2267500,0.0020342665287456283\n20170119 00:00,2268300,2270000,2254100,2259100,0.0029517335189719923\n20170120 00:00,2267300,2273100,2260500,2267400,0.002138805848376143\n20170123 00:00,2263700,2268000,2252700,2261500,0.00261370696180052\n20170124 00:00,2264000,2280800,2262800,2276000,0.0015023227433266502\n20170125 00:00,2287000,2295700,2285100,2295700,0.0015023227433266502\n20170126 00:00,2294200,2297100,2290200,2293300,0.0006035808886418831\n20170127 00:00,2294400,2295900,2287600,2289700,0.0010889094121079115\n20170130 00:00,2281800,2282000,2264200,2275500,0.0037424625588798944\n20170131 00:00,2270100,2275900,2263200,2275300,0.0036938179654486996\n20170201 00:00,2282800,2285800,2269500,2276200,0.0035809045426020637\n20170202 00:00,2272400,2280900,2268300,2277700,5.07449148924911e-05\n20170203 00:00,2288500,2295500,2284600,2293400,0.0\n20170206 00:00,2288900,2293200,2285500,2289300,0.001032151436154821\n20170207 00:00,2293600,2296500,2287200,2289400,0.001032151436154821\n20170208 00:00,2285900,2293900,2283100,2292400,0.001032151436154821\n20170209 00:00,2295700,2309500,2295200,2306000,0.0\n20170210 00:00,2310000,2317700,2308800,2315100,0.0\n20170213 00:00,2320900,2330700,2320500,2327700,0.0\n20170214 00:00,2325500,2337100,2321600,2337000,0.0\n20170215 00:00,2334300,2351400,2333900,2349200,0.0\n20170216 00:00,2349300,2351500,2338500,2347200,0.0004915292603351051\n20170217 00:00,2339700,2350900,2339400,2350900,0.0004915292603351051\n20170221 00:00,2355100,2366800,2355100,2364900,0.0004915292603351051\n20170222 00:00,2360200,2365400,2358300,2362800,0.0005126794220889746\n20170223 00:00,2369000,2369000,2355700,2364400,0.0005126794220889746\n20170224 00:00,2354200,2367900,2354100,2367400,0.0005126794220889746\n20170227 00:00,2366100,2373100,2363500,2371100,0.0\n20170228 00:00,2367100,2369500,2360200,2364700,0.0015583660422645966\n20170301 00:00,2384000,2403200,2383700,2397800,0.0015583660422645966\n20170302 00:00,2395700,2395700,2382100,2382700,0.003955723960131459\n20170303 00:00,2381900,2386100,2377300,2384200,0.003635828286247123\n20170306 00:00,2374800,2381200,2370100,2377100,0.00402185103584742\n20170307 00:00,2373900,2377700,2367700,2370000,0.0024351101845115583\n20170308 00:00,2373100,2376300,2364100,2365600,0.0026605780021814692\n20170309 00:00,2367100,2372400,2357400,2368600,0.00203042775744907\n20170310 00:00,2379500,2380200,2365900,2376900,0.0010718739174828467\n20170313 00:00,2375900,2378500,2372400,2378100,0.0\n20170314 00:00,2372200,2372400,2361900,2369000,0.0022092794456186086\n20170315 00:00,2375600,2394300,2372900,2389500,0.0022092794456186086\n20170316 00:00,2391200,2392000,2381000,2384800,0.0024840554755695353\n20170317 00:00,2377500,2379700,2370300,2370300,0.0036895062455765382\n20170320 00:00,2370100,2373600,2363300,2367700,0.003743464314124815\n20170321 00:00,2374900,2376100,2335800,2337300,0.008226452759265836\n20170322 00:00,2337300,2346100,2330500,2342800,0.007439871275845997\n20170323 00:00,2339800,2353400,2336000,2340300,0.0074384260946326435\n20170324 00:00,2343500,2350400,2329600,2338600,0.0007452877367641404\n20170327 00:00,2319700,2339200,2316100,2336200,0.0009521135798431267\n20170328 00:00,2333200,2358100,2331400,2353200,0.0007259155390198618\n20170329 00:00,2350000,2358100,2347300,2355400,0.0005925086145792983\n20170330 00:00,2355000,2365200,2352700,2362900,0.0\n20170331 00:00,2359100,2365100,2356800,2357400,0.001343868331517616\n20170403 00:00,2357900,2360300,2339200,2353300,0.0016775753887264722\n20170404 00:00,2350000,2355800,2345600,2354800,0.0016775753887264722\n20170405 00:00,2362600,2373900,2345500,2347800,0.001988423902097843\n20170406 00:00,2349600,2360400,2344300,2354400,0.0017162612044875861\n20170407 00:00,2351800,2360000,2346400,2352000,0.00181436569897819\n20170410 00:00,2353600,2362500,2347300,2353400,0.0005885323844950564\n20170411 00:00,2349000,2351800,2333400,2350600,0.0009045549523196455\n20170412 00:00,2348000,2349500,2337700,2340300,0.002621465525847314\n20170413 00:00,2336500,2344900,2325100,2325100,0.00457529198354739\n20170417 00:00,2331200,2345700,2328800,2345700,0.004523433147571261\n20170418 00:00,2337100,2344900,2330800,2338700,0.004126701620755238\n20170419 00:00,2345200,2349500,2331800,2334400,0.0020236853447015454\n20170420 00:00,2341400,2358500,2337800,2353400,0.0020236853447015454\n20170421 00:00,2352200,2353000,2341300,2345900,0.0021242056527205587\n20170424 00:00,2371700,2374100,2366100,2371700,0.0018399451937291507\n20170425 00:00,2379300,2389500,2378100,2385500,0.0018399451937291507\n20170426 00:00,2385300,2395300,2383500,2384000,0.0003630372684068323\n20170427 00:00,2387400,2389500,2379800,2386000,0.0003630372684068323\n20170428 00:00,2389300,2389300,2379300,2380800,0.001309590790657963\n20170501 00:00,2386600,2391700,2382000,2386800,0.0012582654651240549\n20170502 00:00,2388200,2389800,2383000,2387700,0.0012582654651240549\n20170503 00:00,2382900,2387300,2377000,2384800,0.0007012253552162789\n20170504 00:00,2388100,2389200,2377800,2387600,0.0007012253552162789\n20170505 00:00,2391600,2397200,2386900,2397000,0.0007012253552162789\n20170508 00:00,2397700,2399200,2391700,2396600,9.63454767107999e-05\n20170509 00:00,2399400,2401900,2390400,2394400,0.0005386746037600787\n20170510 00:00,2393700,2398700,2391600,2398700,0.0005386746037600787\n20170511 00:00,2393100,2395700,2381400,2393800,0.0012930050080759562\n20170512 00:00,2390500,2392100,2386700,2389800,0.001523713408573661\n20170515 00:00,2394900,2404400,2394500,2403000,0.001523713408573661\n20170516 00:00,2406400,2406700,2396300,2400800,0.0011000555214494495\n20170517 00:00,2380900,2386400,2357500,2358200,0.010258179570844763\n20170518 00:00,2357000,2377500,2354300,2367700,0.010258179570844763\n20170519 00:00,2373600,2390800,2372700,2383100,0.010244552427306744\n20170522 00:00,2388700,2397100,2388200,2395200,0.0\n20170523 00:00,2399800,2402400,2395200,2400500,0.0\n20170524 00:00,2403300,2407300,2399300,2406100,0.0\n20170525 00:00,2412200,2420800,2409700,2417600,0.0\n20170526 00:00,2415900,2419000,2414500,2417100,0.00011940566454117559\n20170530 00:00,2413200,2417900,2411600,2415000,0.0005156237278864617\n20170531 00:00,2418400,2418800,2406400,2414400,0.0005352038552226275\n20170601 00:00,2419700,2433600,2416500,2433600,0.0005217139579507562\n20170602 00:00,2434500,2443500,2430800,2441700,0.00014344106066824567\n20170605 00:00,2440200,2443000,2437600,2439900,0.0004256175961589838\n20170606 00:00,2433400,2439800,2431200,2432100,0.0018941414796149276\n20170607 00:00,2436100,2439200,2428300,2436600,0.0018941414796149276\n20170608 00:00,2438000,2443300,2431700,2437800,0.0018457035532928022\n20170609 00:00,2440700,2450100,2419500,2434100,0.0008762802510467135\n20170612 00:00,2430900,2434200,2423800,2433600,0.0008842692741067193\n20170613 00:00,2439800,2446100,2435800,2445500,0.0008842692741067193\n20170614 00:00,2448600,2448700,2433000,2442400,0.0007414158216712117\n20170615 00:00,2426900,2439100,2423700,2437700,0.0013304095677376857\n20170616 00:00,2428300,2428300,2416400,2426400,0.0029887560124751927\n20170619 00:00,2436100,2447300,2434800,2446600,0.0028977629565299073\n20170620 00:00,2442300,2442600,2429900,2430100,0.004724766983126882\n20170621 00:00,2434600,2435900,2424200,2429500,0.003896289336476354\n20170622 00:00,2429600,2435300,2426400,2428400,0.003905048471577719\n20170623 00:00,2428800,2435100,2424700,2431300,0.0002977472161149759\n20170626 00:00,2439300,2443800,2430500,2432900,0.00026140576090081494\n20170627 00:00,2430100,2433800,2413100,2413300,0.004651266092365755\n20170628 00:00,2425100,2437100,2422400,2434900,0.004651266092365755\n20170629 00:00,2436200,2437200,2399600,2413500,0.006883480791868312\n20170630 00:00,2423000,2427100,2415800,2418000,0.00507425182170028\n20170703 00:00,2429000,2433800,2422100,2422100,0.00507425182170028\n20170705 00:00,2426100,2430100,2417000,2427700,0.0\n20170706 00:00,2418600,2420300,2403400,2405500,0.005279555124607523\n20170707 00:00,2411800,2422800,2410200,2421100,0.005279555124607523\n20170710 00:00,2419800,2428000,2417800,2423700,0.005279555124607523\n20170711 00:00,2421200,2425500,2408500,2421900,0.0004287785140658502\n20170712 00:00,2433100,2442000,2433100,2440100,0.0004287785140658502\n20170713 00:00,2440200,2445500,2437600,2444200,0.0004287785140658502\n20170714 00:00,2444000,2459700,2443100,2455600,0.0\n20170717 00:00,2454400,2459100,2453400,2455300,7.053472909140674e-05\n20170718 00:00,2450600,2457200,2446700,2456600,7.053472909140674e-05\n20170719 00:00,2460100,2470000,2460100,2469900,7.053472909140674e-05\n20170720 00:00,2472500,2474200,2464700,2471000,0.0\n20170721 00:00,2464300,2469100,2461800,2468800,0.0005140309964456271\n20170724 00:00,2468100,2469800,2462900,2468200,0.0005328378929611323\n20170725 00:00,2477000,2478000,2471600,2474200,0.0005328378929611323\n20170726 00:00,2477800,2477900,2471300,2474300,0.00014031519828006773\n20170727 00:00,2479600,2480000,2456800,2472000,0.0005366793109712431\n20170728 00:00,2467000,2470600,2461400,2469100,0.0008641623176730771\n20170731 00:00,2473800,2474800,2465300,2467700,0.0009240901574417486\n20170801 00:00,2474500,2475000,2468000,2473200,0.000752275173228618\n20170802 00:00,2474700,2476000,2463700,2474400,0.0003273623493846099\n20170803 00:00,2473100,2473400,2466400,2469600,0.0011199811235492144\n20170804 00:00,2475200,2477900,2469700,2474100,0.0011199811235492144\n20170807 00:00,2475000,2478700,2473700,2478700,0.0011199811235492144\n20170808 00:00,2474900,2489000,2468300,2472600,0.0014208402154583886\n20170809 00:00,2464600,2473100,2460600,2472500,0.0014210320675150138\n20170810 00:00,2463000,2464300,2437000,2437600,0.008272419751564591\n20170811 00:00,2440000,2448000,2437500,2441200,0.008149487200322\n20170814 00:00,2455500,2467900,2455500,2465400,0.008149453749127605\n20170815 00:00,2470000,2470000,2461600,2465100,7.02543525419218e-05\n20170816 00:00,2470900,2475700,2464600,2469400,7.02543525419218e-05\n20170817 00:00,2462600,2466000,2430900,2430900,0.009001645083827257\n20170818 00:00,2429500,2441900,2422000,2427100,0.009046503042274404\n20170821 00:00,2426400,2432000,2418300,2429000,0.009046503042274404\n20170822 00:00,2436000,2456200,2435500,2454400,0.0009025180068783556\n20170823 00:00,2443400,2450500,2441800,2445600,0.0020700303002235305\n20170824 00:00,2450000,2451800,2437500,2439900,0.0024689616721539024\n20170825 00:00,2448900,2456100,2443900,2445600,0.0024689616721539024\n20170828 00:00,2451700,2451900,2440900,2445700,0.0013456397343722705\n20170829 00:00,2431300,2451500,2429300,2448500,0.0\n20170830 00:00,2448600,2463200,2446200,2460100,0.0\n20170831 00:00,2467500,2477700,2466100,2474900,0.0\n20170901 00:00,2479800,2483300,2476700,2478400,0.0\n20170905 00:00,2472700,2475200,2449500,2460600,0.004146560196729878\n20170906 00:00,2468700,2472800,2462300,2469000,0.004146560196729878\n20170907 00:00,2472700,2472700,2464000,2468700,0.00414715357280529\n20170908 00:00,2465400,2471000,2463000,2465800,0.0006818360503984951\n20170911 00:00,2480400,2493000,2480300,2492100,0.0006818360503984951\n20170912 00:00,2496400,2500700,2494200,2500500,0.0006782175965690196\n20170913 00:00,2497300,2502100,2496000,2501700,0.0\n20170914 00:00,2498300,2503200,2496000,2500900,0.00018462654009342492\n20170915 00:00,2487000,2492900,2485700,2491900,0.002085899862916966\n20170918 00:00,2496200,2501100,2492800,2497200,0.002085899862916966\n20170919 00:00,2500000,2500700,2496000,2499700,0.0020777129924053873\n20170920 00:00,2500700,2501900,2489200,2500600,0.0\n20170921 00:00,2498700,2499800,2491900,2493900,0.0015469274588380808\n20170922 00:00,2490600,2496300,2490200,2494400,0.0015469274588380808\n20170925 00:00,2491600,2495500,2480800,2489300,0.0019458725967266938\n20170926 00:00,2494500,2496900,2488100,2490800,0.0011804387319063383\n20170927 00:00,2498900,2504900,2488800,2500500,0.0011804387319063383\n20170928 00:00,2497300,2504300,2496400,2503500,0.0\n20170929 00:00,2503700,2513100,2501300,2512300,0.0\n20171002 00:00,2515000,2523200,2514000,2523200,0.0\n20171003 00:00,2524800,2528900,2522300,2528600,0.0\n20171004 00:00,2527200,2534400,2525600,2531600,0.0\n20171005 00:00,2535400,2546800,2534100,2546600,0.0\n20171006 00:00,2541600,2544600,2538600,2543700,0.0006574710518533997\n20171009 00:00,2546500,2547000,2536500,2539500,0.0011580244091928442\n20171010 00:00,2545900,2550500,2539800,2546200,0.0011580244091928442\n20171011 00:00,2545300,2550200,2543200,2550200,0.0009532850299156178\n20171012 00:00,2546800,2550600,2543700,2546400,0.0008602976327035339\n20171013 00:00,2551500,2552700,2547600,2549500,0.0008602976327035339\n20171016 00:00,2552000,2555000,2548200,2552900,0.0008602976327035339\n20171017 00:00,2552400,2555200,2549800,2554700,0.0\n20171018 00:00,2559200,2559500,2555000,2557200,0.0\n20171019 00:00,2548300,2558200,2543500,2557900,0.0\n20171020 00:00,2567300,2571400,2564200,2571100,0.0\n20171023 00:00,2575100,2575100,2560200,2561100,0.0022455379767011225\n20171024 00:00,2565600,2568300,2561500,2565600,0.0022455379767011225\n20171025 00:00,2562300,2563100,2540000,2552900,0.0036345977712051755\n20171026 00:00,2560100,2563000,2555600,2556200,0.0028579468423402593\n20171027 00:00,2564700,2578900,2561600,2577100,0.0028579468423402593\n20171030 00:00,2570900,2576000,2564100,2567500,0.00215069752210642\n20171031 00:00,2572100,2574400,2568100,2571500,0.00215069752210642\n20171101 00:00,2581000,2584300,2570700,2574900,0.00215069752210642\n20171102 00:00,2574300,2577500,2561900,2575900,0.0\n20171103 00:00,2578200,2585000,2573100,2584500,0.0\n20171106 00:00,2583100,2590000,2582200,2588500,0.0\n20171107 00:00,2590000,2593500,2580900,2586700,0.00040147980859233436\n20171108 00:00,2584600,2592200,2581500,2591100,0.00040147980859233436\n20171109 00:00,2577400,2583900,2563600,2581700,0.0021326440340274848\n20171110 00:00,2577100,2582100,2573700,2580900,0.0021021397910929544\n20171113 00:00,2573200,2585900,2572700,2583300,0.0021021397910929544\n20171114 00:00,2574400,2578500,2565200,2577300,0.0013528416453515585\n20171115 00:00,2566200,2572200,2556300,2564400,0.0031857457473854207\n20171116 00:00,2575200,2590400,2574800,2586200,0.0031857457473854207\n20171117 00:00,2582000,2584400,2577800,2578600,0.0033510304718852497\n20171120 00:00,2581500,2585200,2578600,2583000,0.0016966445154439562\n20171121 00:00,2591900,2602000,2591000,2599900,0.0016966445154439562\n20171122 00:00,2600700,2601500,2595800,2597600,0.0005107525747667615\n20171124 00:00,2603200,2604800,2601600,2603600,0.0005107525747667615\n20171127 00:00,2603800,2607500,2600000,2602300,0.0005864906095924057\n20171128 00:00,2607900,2629000,2606600,2628700,0.00028827598323342036\n20171129 00:00,2630500,2636300,2622000,2627100,0.00045452659679417085\n20171130 00:00,2638000,2660500,2636700,2650100,0.0003514134099377761\n20171201 00:00,2648000,2653100,2607600,2644600,0.001248696899643235\n20171204 00:00,2663800,2667900,2641200,2641400,0.00138700982934565\n20171205 00:00,2644000,2651500,2630400,2631900,0.002497115605060514\n20171206 00:00,2628400,2637300,2627200,2632400,0.0021908522959209744\n20171207 00:00,2630800,2644300,2629400,2640700,0.002076485029643915\n20171208 00:00,2650000,2655200,2647200,2655100,0.0\n20171211 00:00,2656000,2663800,2654900,2663100,0.0\n20171212 00:00,2666000,2673200,2663500,2667800,0.0\n20171213 00:00,2670500,2675600,2666600,2667500,6.492431245101918e-05\n20171214 00:00,2670900,2672100,2656000,2656600,0.0023600751652343836\n20171215 00:00,2655400,2670400,2653900,2665100,0.0023600751652343836\n20171218 00:00,2681000,2686000,2679800,2682000,0.0023591819809435782\n20171219 00:00,2685100,2685300,2670900,2671700,0.002217266134471695\n20171220 00:00,2682500,2683300,2666900,2670300,0.0022378110426132373\n20171221 00:00,2677300,2683900,2673000,2675800,0.0022378110426132373\n20171222 00:00,2676100,2676300,2669000,2675100,0.00033814400788275393\n20171226 00:00,2670200,2673800,2668900,2671900,0.0007069586693972815\n20171227 00:00,2673500,2677300,2670200,2673200,0.0007069586693972815\n20171228 00:00,2678700,2679200,2674500,2678700,0.0006906361860890678\n20171229 00:00,2685500,2685500,2666400,2668600,0.002176890924260015\n20180102 00:00,2678600,2688100,2674000,2687700,0.002176890924260015\n20180103 00:00,2689900,2706400,2689500,2704700,0.002176890924260015\n20180104 00:00,2712200,2721600,2711000,2716100,0.0\n20180105 00:00,2725600,2735600,2719500,2734200,0.0\n20180108 00:00,2733200,2741000,2729800,2739200,0.0\n20180109 00:00,2744300,2752400,2740900,2745400,0.0\n20180110 00:00,2737100,2744200,2729200,2741200,0.0008832487544971273\n20180111 00:00,2747500,2761200,2745600,2761200,0.0008832487544971273\n20180112 00:00,2764300,2781100,2762700,2779200,0.0008832487544971273\n20180116 00:00,2794200,2800900,2761800,2769700,0.001973527474561516\n20180117 00:00,2780700,2800500,2771900,2796100,0.001973527474561516\n20180118 00:00,2795100,2799600,2785800,2791400,0.0021992346837785637\n20180119 00:00,2797000,2804100,2791400,2804100,0.0009704753997322364\n20180122 00:00,2801600,2826900,2801200,2826900,0.0009704753997322364\n20180123 00:00,2827600,2836200,2823800,2832900,0.0\n20180124 00:00,2840300,2847000,2818400,2831800,0.00022418203823238125\n20180125 00:00,2841600,2842700,2824100,2833000,0.00022418203823238125\n20180126 00:00,2843200,2865800,2839700,2865800,0.00022418203823238125\n20180129 00:00,2859900,2864200,2845000,2846800,0.0038277811133376007\n20180130 00:00,2832000,2832900,2812200,2817600,0.007051346379263274\n20180131 00:00,2827500,2833000,2806800,2819000,0.007051346379263274\n20180201 00:00,2811000,2830600,2806900,2815800,0.005958112336240278\n20180202 00:00,2800000,2802300,2754100,2754500,0.012585997524247676\n20180205 00:00,2734700,2758400,2633100,2639300,0.027229525591613953\n20180206 00:00,2597300,2697000,2587000,2691300,0.027221637328453\n20180207 00:00,2684600,2723600,2676400,2676700,0.02434850163954757\n20180208 00:00,2680000,2681600,2576000,2576300,0.021881079720061793\n20180209 00:00,2609400,2636000,2529300,2615000,0.021881079720061793\n20180212 00:00,2638900,2669800,2618800,2653400,0.021655757846093478\n20180213 00:00,2640000,2666200,2633100,2660000,0.0\n20180214 00:00,2644000,2700000,2639700,2695900,0.0\n20180215 00:00,2715600,2730300,2687700,2730300,0.0\n20180216 00:00,2722700,2753200,2722700,2731100,0.0\n20180220 00:00,2720000,2736700,2705000,2714000,0.0036149132595447416\n20180221 00:00,2718500,2747100,2699800,2700500,0.004616836470014891\n20180222 00:00,2710900,2730500,2696500,2704000,0.004616836470014891\n20180223 00:00,2718400,2747100,2712600,2747100,0.0028718602188872577\n20180226 00:00,2759000,2780100,2752600,2779000,0.0\n20180227 00:00,2781100,2789200,2743600,2744300,0.0072090875641885556\n20180228 00:00,2756500,2761800,2713200,2716500,0.009283165942224865\n20180301 00:00,2715000,2731700,2660000,2677000,0.012516195956608165\n20180302 00:00,2657500,2697200,2648200,2690800,0.010231530565662035\n20180305 00:00,2677500,2728900,2676100,2721900,0.008395117111352938\n20180306 00:00,2732800,2733800,2711800,2728800,0.0\n20180307 00:00,2703900,2731700,2702100,2727800,0.00021157661579804558\n20180308 00:00,2735200,2742400,2724200,2741000,0.00021157661579804558\n20180309 00:00,2756900,2788700,2753400,2788700,0.00021157661579804558\n20180312 00:00,2792000,2799100,2780900,2785200,0.0007246121641494844\n20180313 00:00,2798400,2804000,2760300,2767200,0.0038009686421636517\n20180314 00:00,2778100,2780200,2746700,2753000,0.004819225385347068\n20180315 00:00,2758500,2766000,2744300,2750000,0.004805798647551208\n20180316 00:00,2744500,2753800,2741600,2742000,0.0034632841999531878\n20180319 00:00,2733400,2733800,2686300,2704900,0.008014954838263732\n20180320 00:00,2709100,2716700,2701800,2709500,0.007990223460263323\n20180321 00:00,2708800,2732600,2701900,2704300,0.007889897105224251\n20180322 00:00,2678500,2688600,2633700,2636700,0.014474627982783693\n20180323 00:00,2641700,2650200,2578300,2580500,0.01899871409037693\n20180326 00:00,2621600,2654300,2594100,2651100,0.018966375380200746\n20180327 00:00,2661700,2667700,2588700,2606000,0.015744950547339112\n20180328 00:00,2607600,2626400,2585800,2598300,0.009968816834233885\n20180329 00:00,2611200,2652600,2602800,2631500,0.009968816834233885\n20180402 00:00,2625600,2631300,2546700,2574700,0.012578120937485294\n20180403 00:00,2589200,2613100,2568400,2607700,0.012461902067250933\n20180404 00:00,2567600,2643600,2566000,2635600,0.012461902067250933\n20180405 00:00,2655500,2666400,2643300,2656400,0.0\n20180406 00:00,2634200,2651000,2580000,2597200,0.012866712820368081\n20180409 00:00,2613700,2648400,2605400,2610000,0.012866712820368081\n20180410 00:00,2642500,2660400,2629900,2651500,0.012866712820368081\n20180411 00:00,2634200,2656400,2633900,2637600,0.0030266523634681457\n20180412 00:00,2652800,2670000,2650600,2659300,0.0030266523634681457\n20180413 00:00,2674500,2675400,2640100,2651500,0.0034681870871445014\n20180416 00:00,2670000,2681900,2660700,2673300,0.0016934276312108977\n20180417 00:00,2693300,2708700,2687500,2701900,0.0016934276312108977\n20180418 00:00,2706800,2713000,2698700,2703900,0.0\n20180419 00:00,2695900,2698600,2677200,2688900,0.0032028751203241473\n20180420 00:00,2688700,2690600,2656200,2666100,0.005850180057590458\n20180423 00:00,2672800,2678800,2653500,2665700,0.005850821300872673\n20180424 00:00,2677600,2679700,2612800,2629800,0.009188606686442698\n20180425 00:00,2629400,2641300,2608500,2636300,0.007775879060807324\n20180426 00:00,2648600,2672400,2642900,2663100,0.007775396580225699\n20180427 00:00,2670000,2673300,2655000,2665600,0.0\n20180430 00:00,2672600,2678900,2644400,2645100,0.004440156256898001\n20180501 00:00,2638700,2651000,2621200,2649800,0.004440156256898001\n20180502 00:00,2647700,2656800,2627700,2632000,0.005895467448134538\n20180503 00:00,2622800,2633600,2590500,2626200,0.004081695255442098\n20180504 00:00,2615200,2667800,2611500,2660200,0.004081695255442098\n20180507 00:00,2669100,2680200,2661100,2669200,0.0012722764290652557\n20180508 00:00,2664800,2673200,2651500,2669200,0.0\n20180509 00:00,2676700,2698600,2671000,2695000,0.0\n20180510 00:00,2703400,2723900,2702300,2720200,0.0\n20180511 00:00,2722500,2731400,2715800,2728500,0.0\n20180514 00:00,2733400,2740700,2723700,2729800,0.0\n20180515 00:00,2715200,2716100,2700300,2711000,0.003976183259127036\n20180516 00:00,2711100,2727500,2711000,2722400,0.003976183259127036\n20180517 00:00,2719300,2732300,2711400,2720100,0.004005989651474656\n20180518 00:00,2716100,2720200,2709300,2713300,0.0015235156491044347\n20180521 00:00,2729900,2739800,2726000,2733700,0.0015235156491044347\n20180522 00:00,2739400,2742500,2722500,2726100,0.002158593609737025\n20180523 00:00,2711900,2733900,2709900,2733600,0.0016051000643235167\n20180524 00:00,2729500,2732200,2707800,2728000,0.0019938004941856785\n20180525 00:00,2721500,2728600,2715800,2721500,0.0018141969839784511\n20180529 00:00,2702600,2711700,2677600,2690200,0.006883486857954676\n20180530 00:00,2705000,2731000,2704300,2726100,0.0067811132662352015\n20180531 00:00,2722000,2724800,2702600,2709400,0.007523313092959009\n20180601 00:00,2724900,2739400,2723300,2736000,0.0035368289848012454\n20180604 00:00,2745100,2751800,2742700,2749000,0.0035368289848012454\n20180605 00:00,2750200,2755300,2741900,2751000,0.0\n20180606 00:00,2759000,2775200,2750900,2774000,0.0\n20180607 00:00,2779800,2782800,2763400,2773700,6.243874576671111e-05\n20180608 00:00,2767800,2782500,2766700,2781900,6.243874576671111e-05\n20180611 00:00,2784200,2793700,2783100,2785600,6.243874576671111e-05\n20180612 00:00,2790500,2793300,2782000,2789200,0.0\n20180613 00:00,2792100,2794800,2778000,2780300,0.001842254910292426\n20180614 00:00,2790100,2793300,2780600,2787300,0.001842254910292426\n20180615 00:00,2766500,2775000,2753500,2771300,0.0037917897332248843\n20180618 00:00,2754700,2767000,2749500,2765600,0.003520497612242418\n20180619 00:00,2739800,2757500,2735300,2755000,0.0041582083166722735\n20180620 00:00,2762700,2767200,2755900,2759700,0.002511360224728698\n20180621 00:00,2759800,2759800,2736800,2742400,0.004242177070950166\n20180622 00:00,2756700,2757800,2744900,2747400,0.003619291827727826\n20180625 00:00,2734500,2736100,2691100,2710000,0.008652707845384676\n20180626 00:00,2716100,2725600,2707900,2716000,0.00785939436110214\n20180627 00:00,2722700,2738700,2691800,2693500,0.00920034232922743\n20180628 00:00,2692600,2717500,2684900,2708900,0.004782909078338194\n20180629 00:00,2720800,2736600,2711900,2712800,0.004782909078338194\n20180702 00:00,2695100,2720400,2692400,2718600,0.0\n20180703 00:00,2728800,2729800,2704200,2709000,0.0020387561922387888\n20180705 00:00,2721600,2731800,2709600,2731100,0.0020387561922387888\n20180706 00:00,2731400,2758400,2727200,2754200,0.0020387561922387888\n20180709 00:00,2765600,2779600,2765100,2779000,0.0\n20180710 00:00,2784000,2790100,2780900,2789000,0.0\n20180711 00:00,2771700,2780300,2765200,2768600,0.004222999459113814\n20180712 00:00,2782900,2794300,2776100,2793700,0.004222999459113814\n20180713 00:00,2791900,2799300,2786600,2795900,0.004222999459113814\n20180716 00:00,2796600,2798000,2788400,2793400,0.0005162472452427234\n20180717 00:00,2784800,2809100,2784100,2804700,0.0005162472452427234\n20180718 00:00,2805700,2811800,2800600,2810600,0.0005162472452427234\n20180719 00:00,2803100,2807400,2794600,2800000,0.002177439996232152\n20180720 00:00,2798000,2804800,2795100,2796800,0.0022752184701367285\n20180723 00:00,2794600,2804100,2790600,2802000,0.0022752184701367285\n20180724 00:00,2817900,2825500,2806400,2816100,0.0006598288790738403\n20180725 00:00,2813700,2843600,2812800,2840100,0.0\n20180726 00:00,2831500,2841100,2830900,2833400,0.0013620107755256963\n20180727 00:00,2837300,2838200,2803800,2814200,0.0041426083892558505\n20180730 00:00,2815100,2816800,2793600,2799500,0.005124082444117231\n20180731 00:00,2807000,2820200,2803800,2813300,0.004939751769214958\n20180801 00:00,2814800,2821300,2801400,2808600,0.003166284584980717\n20180802 00:00,2794400,2825800,2791600,2823900,0.0009645420912065174\n20180803 00:00,2825500,2836500,2823400,2836000,0.0009645420912065174\n20180806 00:00,2836400,2849700,2832100,2846400,0.0\n20180807 00:00,2854000,2860100,2852500,2855800,0.0\n20180808 00:00,2853900,2859100,2849400,2854600,0.0002426011355933727\n20180809 00:00,2855400,2859700,2849200,2850700,0.0008252498422326716\n20180810 00:00,2834200,2840500,2823600,2831600,0.003955357931721407\n20180813 00:00,2834900,2841600,2817700,2821000,0.00450079790302037\n20180814 00:00,2829400,2841700,2825000,2839000,0.004431139782574988\n20180815 00:00,2823500,2825100,2801600,2817800,0.004822719677898181\n20180816 00:00,2833800,2850400,2833600,2840600,0.004311315853053916\n20180817 00:00,2837600,2855600,2833800,2850600,0.004311315853053916\n20180820 00:00,2855800,2859700,2850600,2856700,0.0\n20180821 00:00,2862600,2873100,2861100,2863400,0.0\n20180822 00:00,2858900,2867600,2855800,2861700,0.00034277273787189697\n20180823 00:00,2859400,2869400,2854400,2857900,0.0008397916666666517\n20180824 00:00,2864600,2876700,2863800,2875100,0.0008397916666666517\n20180827 00:00,2888600,2899000,2886800,2897800,0.0007666530464131453\n20180828 00:00,2903000,2904100,2894000,2899200,0.0\n20180829 00:00,2901600,2917400,2898900,2914800,0.0\n20180830 00:00,2909400,2913600,2896300,2903000,0.0023372900975839003\n20180831 00:00,2898400,2908100,2892900,2903100,0.0023372900975839003\n20180904 00:00,2898500,2902100,2886900,2898100,0.0025400184682944243\n20180905 00:00,2894100,2896400,2878900,2890300,0.00184481616817155\n20180906 00:00,2891700,2894900,2870000,2881600,0.0025344657823004237\n20180907 00:00,2869600,2886900,2867100,2876000,0.002587206388071652\n20180910 00:00,2887400,2890400,2878800,2881000,0.00206858865392436\n20180911 00:00,2873700,2895500,2869800,2890500,0.0011220021888748964\n20180912 00:00,2890500,2898000,2882400,2891200,0.0\n20180913 00:00,2903000,2910300,2900000,2908300,0.0\n20180914 00:00,2911100,2912700,2900000,2908800,0.0\n20180917 00:00,2908200,2908600,2890400,2893400,0.0030566536528878765\n20180918 00:00,2895500,2915700,2895500,2909100,0.0030566536528878765\n20180919 00:00,2909800,2916700,2908300,2912200,0.0030566536528878765\n20180920 00:00,2926400,2939400,2925100,2935800,0.0\n20180921 00:00,2931700,2932200,2918100,2919900,0.0031268714762978187\n20180924 00:00,2914100,2915000,2903700,2910200,0.003668236155729884\n20180925 00:00,2915300,2916500,2904900,2907500,0.0037071385660622696\n20180926 00:00,2908900,2922400,2894100,2898800,0.0026363030680505812\n20180927 00:00,2904100,2919100,2901000,2906900,0.001808718497084013\n20180928 00:00,2900100,2912800,2899500,2907200,0.0017275829207049915\n20181001 00:00,2921200,2929300,2909800,2917300,0.0\n20181002 00:00,2915700,2923600,2911500,2915600,0.00033643967285583004\n20181003 00:00,2927400,2932100,2913200,2917200,0.00033643967285583004\n20181004 00:00,2912200,2912400,2876600,2894400,0.004524929302230804\n20181005 00:00,2896500,2902700,2862300,2878200,0.005550133832770653\n20181008 00:00,2870600,2882200,2855000,2878200,0.005550133832770653\n20181009 00:00,2874300,2888600,2867700,2874000,0.0033394596918487154\n20181010 00:00,2869100,2869100,2778900,2783000,0.0183001531906685\n20181011 00:00,2771500,2789000,2703900,2721700,0.022284953727487577\n20181012 00:00,2768600,2770800,2723700,2759500,0.02226902251172534\n20181015 00:00,2755400,2770400,2743000,2744000,0.013124035235463533\n20181016 00:00,2765600,2808200,2760700,2804000,0.0032429531336978217\n20181017 00:00,2804400,2811500,2775600,2804500,0.0032429531336978217\n20181018 00:00,2794100,2800700,2749700,2764000,0.008337559601419069\n20181019 00:00,2771600,2793000,2754700,2762500,0.008343444825297322\n20181022 00:00,2770000,2773500,2744200,2750100,0.008736657115660212\n20181023 00:00,2708700,2748700,2686100,2736100,0.003931000844752688\n20181024 00:00,2733300,2737600,2647000,2653200,0.017926414054007737\n20181025 00:00,2673100,2718100,2662300,2700800,0.017738100654576594\n20181026 00:00,2659200,2687800,2623000,2653300,0.020226394987157625\n20181029 00:00,2688100,2702500,2598600,2638600,0.010645978693107731\n20181030 00:00,2637300,2681200,2631200,2677700,0.010645978693107731\n20181031 00:00,2707100,2732300,2701300,2706300,0.0031986767259968396\n20181101 00:00,2716400,2737300,2703800,2735100,0.0\n20181102 00:00,2747500,2752300,2696000,2718900,0.0034196462143511737\n20181105 00:00,2724800,2740100,2713500,2733900,0.0034196462143511737\n20181106 00:00,2733600,2753000,2732500,2751200,0.0034196462143511737\n20181107 00:00,2775500,2811000,2770800,2810100,0.0\n20181108 00:00,2801100,2812100,2792200,2805000,0.0010478226301082192\n20181109 00:00,2790000,2792300,2761800,2777600,0.005736227390959506\n20181112 00:00,2772400,2774600,2720000,2725700,0.012218148497078135\n20181113 00:00,2730600,2753300,2712500,2720600,0.01222097374571136\n20181114 00:00,2741800,2746100,2684500,2702000,0.01153802870706706\n20181115 00:00,2687600,2735400,2670200,2730200,0.0040923414360540585\n20181116 00:00,2717400,2747400,2701800,2737300,0.0039471862849838266\n20181119 00:00,2731700,2733700,2680800,2691000,0.00976557829374919\n20181120 00:00,2654100,2670000,2631600,2641200,0.014474995258093624\n20181121 00:00,2657800,2671500,2650200,2650200,0.014474995258093624\n20181123 00:00,2631600,2648200,2631000,2632500,0.011359027090229805\n20181126 00:00,2658000,2675500,2653400,2675000,0.0038559730453008928\n20181127 00:00,2663400,2684000,2656600,2684000,0.0038559730453008928\n20181128 00:00,2696100,2745800,2685400,2745800,0.0\n20181129 00:00,2737100,2755500,2724400,2739800,0.001261600122054675\n20181130 00:00,2738100,2762800,2734500,2756500,0.001261600122054675\n20181203 00:00,2803800,2804000,2775100,2793000,0.001261600122054675\n20181204 00:00,2783400,2788400,2699000,2702500,0.018707554372238165\n20181206 00:00,2659700,2699600,2624400,2698400,0.018728048536913202\n20181207 00:00,2694500,2712200,2626400,2635700,0.02303714910189561\n20181210 00:00,2633700,2651600,2586200,2640700,0.013443870281757498\n20181211 00:00,2676200,2678600,2624800,2641300,0.0134153060621811\n20181212 00:00,2674500,2689500,2653800,2654600,0.0\n20181213 00:00,2664500,2674900,2641200,2653700,0.00019574144589417194\n20181214 00:00,2629200,2640300,2598500,2604700,0.01066244546481305\n20181217 00:00,2593900,2606500,2535300,2553600,0.015555750793657086\n20181218 00:00,2571900,2579400,2533500,2550800,0.015567396454721235\n20181219 00:00,2551800,2593900,2493500,2512600,0.014263643984983565\n20181220 00:00,2497800,2516200,2446600,2471700,0.0127860034518284\n20181221 00:00,2467500,2496900,2399900,2407000,0.019785877738776353\n20181224 00:00,2390000,2402900,2343400,2343400,0.02344029906041256\n20181226 00:00,2359000,2461800,2337600,2461800,0.02147378951274128\n20181227 00:00,2425700,2481800,2389600,2480700,0.01525528754485259\n20181228 00:00,2497300,2513200,2464500,2477500,0.0007447578753605088\n20181231 00:00,2495000,2501600,2474800,2499200,0.0007447578753605088\n20190102 00:00,2460600,2512100,2459600,2501800,0.0007447578753605088\n20190103 00:00,2483000,2485700,2436700,2442100,0.013777204840762907\n20190104 00:00,2475900,2531100,2471700,2523900,0.013777204840762907\n20190107 00:00,2527600,2559300,2517000,2543800,0.013777204840762907\n20190108 00:00,2568600,2573100,2540100,2567700,0.0\n20190109 00:00,2575600,2589100,2562000,2579700,0.0\n20190110 00:00,2563100,2591500,2555200,2588800,0.0\n20190111 00:00,2576500,2589800,2570300,2589800,0.0\n20190114 00:00,2568700,2583000,2564100,2574000,0.0035223315519329755\n20190115 00:00,2578200,2607000,2578200,2603500,0.0035223315519329755\n20190116 00:00,2608200,2619600,2606000,2609800,0.0035223315519329755\n20190117 00:00,2600000,2639200,2599700,2629600,0.0\n20190118 00:00,2650000,2669700,2641100,2664600,0.0\n20190122 00:00,2647700,2650400,2610600,2628600,0.007800273846290835\n20190123 00:00,2640000,2647600,2606600,2634100,0.007800273846290835\n20190124 00:00,2632100,2641900,2620900,2635500,0.007800273846290835\n20190125 00:00,2656200,2667000,2651100,2657800,0.0\n20190128 00:00,2633800,2638300,2618000,2637600,0.004388018450459204\n20190129 00:00,2639300,2645500,2624800,2634100,0.004454396740827419\n20190130 00:00,2650900,2685200,2642500,2675800,0.004454396740827419\n20190131 00:00,2675000,2703900,2672700,2699300,0.0007661229686698693\n20190201 00:00,2701300,2712000,2691900,2700600,0.0\n20190204 00:00,2701400,2720200,2693600,2719600,0.0\n20190205 00:00,2724700,2734400,2718900,2731000,0.0\n20190206 00:00,2728000,2733400,2719200,2727400,0.0007610622369398215\n20190207 00:00,2709300,2715400,2683000,2701400,0.00555618603226845\n20190208 00:00,2687200,2705100,2678300,2704700,0.00555618603226845\n20190211 00:00,2711700,2714900,2700400,2706200,0.005503815721540755\n20190212 00:00,2724300,2745200,2723400,2741000,0.0\n20190213 00:00,2750600,2759300,2745600,2749900,0.0\n20190214 00:00,2737700,2756400,2728700,2743800,0.001280714441273034\n20190215 00:00,2763800,2774000,2761300,2773700,0.001280714441273034\n20190219 00:00,2765200,2785800,2764700,2778500,0.001280714441273034\n20190220 00:00,2778500,2789200,2772500,2784100,0.0\n20190221 00:00,2777500,2781000,2763500,2774200,0.002053003722918477\n20190222 00:00,2781500,2793500,2778200,2791400,0.002053003722918477\n20190225 00:00,2806900,2813100,2794300,2795200,0.002053003722918477\n20190226 00:00,2791300,2802900,2789000,2793200,0.00041310122294620254\n20190227 00:00,2785300,2795900,2774800,2792000,0.0004818460055930567\n20190228 00:00,2789700,2794500,2783200,2786800,0.001178317947145473\n20190301 00:00,2804400,2808700,2788200,2804200,0.0011035309529711767\n20190304 00:00,2816500,2818700,2768400,2794000,0.002359340244615899\n20190305 00:00,2795500,2797600,2784100,2790200,0.0022420557605943177\n20190306 00:00,2791600,2791600,2769700,2773300,0.004153979739969559\n20190307 00:00,2768400,2769700,2740700,2750100,0.006014352242816592\n20190308 00:00,2729200,2746500,2724300,2744600,0.00607363844942957\n20190311 00:00,2752400,2786200,2752300,2784400,0.004965918884549549\n20190312 00:00,2790900,2800700,2788500,2794900,0.0011546585507955797\n20190313 00:00,2804900,2823600,2803000,2813400,0.0\n20190314 00:00,2813300,2818400,2806700,2811600,0.0003693859687713639\n20190315 00:00,2805600,2822000,2803400,2813100,0.0003693859687713639\n20190318 00:00,2815300,2826500,2813000,2823300,0.0003693859687713639\n20190319 00:00,2834900,2843600,2814200,2824000,0.0\n20190320 00:00,2821600,2835000,2803200,2815500,0.001737775243665629\n20190321 00:00,2806300,2851800,2806000,2847300,0.001737775243665629\n20190322 00:00,2832200,2838000,2791800,2792500,0.011246922355434593\n20190325 00:00,2788900,2801900,2776400,2790400,0.011120337593176698\n20190326 00:00,2809700,2821800,2795700,2811200,0.011120337593176698\n20190327 00:00,2811300,2817500,2779300,2796500,0.0030500733063724326\n20190328 00:00,2803600,2812100,2790700,2807100,0.0030190128617983716\n20190329 00:00,2824100,2828400,2811400,2824800,0.0030190128617983716\n20190401 00:00,2847000,2861600,2844100,2858300,0.0\n20190402 00:00,2860400,2862300,2851000,2859700,0.0\n20190403 00:00,2873300,2877500,2857500,2864200,0.0\n20190404 00:00,2868000,2874600,2860100,2871800,0.0\n20190405 00:00,2879500,2886300,2876000,2885700,0.0\n20190408 00:00,2881000,2889000,2873700,2887900,0.0\n20190409 00:00,2877200,2880800,2867000,2873100,0.002958822668377212\n20190410 00:00,2877700,2883800,2873200,2882900,0.002958822668377212\n20190411 00:00,2888400,2888400,2875800,2882100,0.0029631571048611585\n20190412 00:00,2900100,2904700,2892600,2901600,0.00016021374843101582\n20190415 00:00,2902700,2903500,2890800,2899700,0.0004106023879217663\n20190416 00:00,2909600,2910100,2895000,2901600,0.0003780553871865071\n20190417 00:00,2914100,2914200,2889900,2894500,0.0014624435789173205\n20190418 00:00,2901200,2903200,2886600,2900200,0.0014127332889600078\n20190422 00:00,2891700,2904400,2890700,2902700,0.0014127332889600078\n20190423 00:00,2906800,2931300,2904200,2928800,0.0\n20190424 00:00,2927600,2931500,2920800,2922300,0.0012813359566145046\n20190425 00:00,2921200,2927800,2907300,2920500,0.0013297698836518177\n20190426 00:00,2921200,2934900,2912500,2934100,0.0013297698836518177\n20190429 00:00,2935300,2944500,2934100,2938700,0.0003556207386446427\n20190430 00:00,2935200,2943400,2919200,2940200,0.0\n20190501 00:00,2947600,2949500,2918000,2918100,0.0043396506867188645\n20190502 00:00,2916800,2927000,2895500,2911800,0.004515112475822169\n20190503 00:00,2928000,2943400,2925700,2940300,0.004515112475822169\n20190506 00:00,2892400,2933100,2889300,2928200,0.0026830396672546976\n20190507 00:00,2901500,2908100,2858200,2879300,0.009929994393524079\n20190508 00:00,2875600,2894300,2868800,2875300,0.00996233433769848\n20190509 00:00,2852000,2873300,2833100,2866600,0.00983131934277799\n20190510 00:00,2856400,2889400,2823000,2881000,0.0019222592524781063\n20190513 00:00,2823900,2834900,2799300,2808600,0.014613696667072568\n20190514 00:00,2820100,2851000,2818500,2834000,0.014508906452387674\n20190515 00:00,2816000,2857600,2813600,2850600,0.014508906452387674\n20190516 00:00,2858300,2892100,2857700,2877000,0.0\n20190517 00:00,2851300,2886000,2851300,2858400,0.00373260862249811\n20190520 00:00,2840600,2854300,2831200,2839500,0.0053390649789426745\n20190521 00:00,2858300,2869300,2855500,2865100,0.0053390649789426745\n20190522 00:00,2854300,2866700,2851000,2856300,0.0042092566181774\n20190523 00:00,2831600,2832100,2805800,2821400,0.007273881960210512\n20190524 00:00,2837500,2841900,2820900,2827800,0.007273881960210512\n20190528 00:00,2830100,2841400,2801500,2801500,0.008865549412074087\n20190529 00:00,2789100,2793500,2767200,2782700,0.006621504692582592\n20190530 00:00,2790800,2800400,2778100,2790300,0.006621504692582592\n20190531 00:00,2762000,2771200,2752500,2752700,0.008691295034199327\n20190603 00:00,2753000,2765500,2730900,2745700,0.007917261582879542\n20190604 00:00,2771100,2806800,2766200,2805300,0.007917261582879542\n20190605 00:00,2823400,2829900,2803200,2829600,0.0014681773837786137\n20190606 00:00,2832900,2855500,2825700,2848000,0.0\n20190607 00:00,2859500,2888500,2857500,2876500,0.0\n20190610 00:00,2893500,2908200,2888800,2889700,0.0\n20190611 00:00,2909500,2914000,2881900,2889000,0.00013985714379787764\n20190612 00:00,2886400,2892600,2878200,2883900,0.0010287570459765459\n20190613 00:00,2893700,2899800,2886200,2895800,0.0010287570459765459\n20190614 00:00,2892700,2899200,2884100,2892600,0.001202424734562865\n20190617 00:00,2895300,2902200,2891800,2893700,0.0006380001593365692\n20190618 00:00,2913800,2935600,2910000,2924000,0.0006380001593365692\n20190619 00:00,2925300,2936500,2914900,2930600,0.0\n20190620 00:00,2960200,2963100,2936100,2958600,0.0\n20190621 00:00,2941400,2955100,2937600,2940000,0.0036296609906465906\n20190624 00:00,2941800,2945800,2934700,2936400,0.0036978683941505637\n20190625 00:00,2936700,2937300,2906400,2907600,0.006763089656598149\n20190626 00:00,2917800,2923100,2903500,2904700,0.005735550178243925\n20190627 00:00,2912900,2920600,2909300,2915000,0.005691813778903684\n20190628 00:00,2925700,2935500,2920200,2930000,0.0005758411681971227\n20190701 00:00,2966800,2969100,2943300,2956600,0.0\n20190702 00:00,2955900,2964900,2946900,2964300,0.0\n20190703 00:00,2971900,2988200,2970200,2988000,0.0\n20190705 00:00,2974600,2986400,2960200,2984600,0.0006569581376320996\n20190708 00:00,2970100,2973500,2962300,2968200,0.003239774621635682\n20190709 00:00,2955100,2975200,2954800,2971900,0.003239774621635682\n20190710 00:00,2984000,2996600,2977900,2986100,0.003172466801149161\n20190711 00:00,2993400,2995800,2982000,2993100,0.0\n20190712 00:00,2998600,3007300,2995100,3006500,0.0\n20190715 00:00,3011200,3011300,3002200,3007500,0.0\n20190716 00:00,3006400,3008800,2994400,2997100,0.001996489708918411\n20190717 00:00,2997700,2999300,2977400,2977400,0.0042880653409545005\n20190718 00:00,2971800,2992400,2967000,2988300,0.0042880653409545005\n20190719 00:00,3000100,3000700,2969700,2971700,0.004968655098566256\n20190722 00:00,2976100,2984900,2970500,2979000,0.0032071794895250773\n20190723 00:00,2991500,3000300,2982300,3000300,0.0032071794895250773\n20190724 00:00,2991600,3014400,2990900,3014400,0.0\n20190725 00:00,3009700,3010000,2991200,3000000,0.0027580426872116197\n20190726 00:00,3007700,3022300,3006200,3020100,0.0027580426872116197\n20190729 00:00,3018500,3019300,3008500,3014600,0.002951661636350135\n20190730 00:00,2999000,3011700,2994900,3007200,0.0017646692705552657\n20190731 00:00,3009800,3012000,2952000,2974300,0.006558321353937499\n20190801 00:00,2975600,3008700,2939600,2948400,0.008196468410906004\n20190802 00:00,2938600,2941200,2909000,2926200,0.00916904420354313\n20190805 00:00,2880700,2882000,2817300,2838200,0.018591349624065227\n20190806 00:00,2859300,2880300,2842800,2878000,0.017898666387855356\n20190807 00:00,2844000,2888200,2820600,2879700,0.017362731080817123\n20190808 00:00,2896200,2936200,2890200,2936200,0.0\n20190809 00:00,2925900,2932400,2896500,2916200,0.0039326358503482504\n20190812 00:00,2899000,2905600,2870200,2881000,0.008001956215876786\n20190813 00:00,2877800,2941500,2873600,2925500,0.008001956215876786\n20190814 00:00,2880500,2887400,2837600,2839000,0.01843854410791845\n20190815 00:00,2848900,2856300,2823900,2846500,0.017070859095847792\n20190816 00:00,2864900,2893300,2864400,2888500,0.017070859095847792\n20190819 00:00,2922300,2930800,2914400,2923300,0.0\n20190820 00:00,2917800,2923600,2899500,2900900,0.004423988653182252\n20190821 00:00,2924700,2928600,2917200,2924500,0.004423988653182252\n20190822 00:00,2932400,2939300,2904000,2923600,0.004427555147118999\n20190823 00:00,2909500,2927600,2834700,2848500,0.014831754251096858\n20190826 00:00,2872400,2880000,2855800,2880000,0.014831754251096858\n20190827 00:00,2895500,2899500,2860400,2868700,0.015002697754227844\n20190828 00:00,2861000,2890600,2852500,2888900,0.0022652979311953763\n20190829 00:00,2917700,2931600,2906200,2925800,0.0022652979311953763\n20190830 00:00,2942100,2942400,2914300,2924500,0.0002565299576001165\n20190903 00:00,2905600,2915800,2892800,2907400,0.003385588342150699\n20190904 00:00,2931500,2940600,2923100,2940400,0.003385588342150699\n20190905 00:00,2967800,2988200,2966500,2978200,0.003375855566128445\n20190906 00:00,2982100,2987500,2974200,2980500,0.0\n20190909 00:00,2991500,2992300,2971600,2982000,0.0\n20190910 00:00,2973300,2982000,2959700,2981300,0.00013552823220415867\n20190911 00:00,2984900,3003300,2977500,3002500,0.00013552823220415867\n20190912 00:00,3012400,3024400,3004100,3012900,0.00013552823220415867\n20190913 00:00,3017800,3021700,3006800,3010900,0.0003832521950211325\n20190916 00:00,2998000,3006400,2994500,3001600,0.0018240241976585786\n20190917 00:00,2999100,3010200,2997700,3009200,0.0018240241976585786\n20190918 00:00,3004700,3012200,2982500,3011000,0.001783306487582969\n20190919 00:00,3015000,3026300,3007200,3010800,3.834940346657977e-05\n20190920 00:00,3003400,3006700,2974100,2982800,0.005369410080482684\n20190923 00:00,2975700,2990000,2972800,2982100,0.00537111931190619\n20190924 00:00,2994100,2998400,2948200,2958700,0.007026495806484019\n20190925 00:00,2959400,2981000,2943300,2976200,0.004532388926702418\n20190926 00:00,2976200,2978600,2954500,2970000,0.004687297318767236\n20190927 00:00,2978700,2979400,2936900,2954000,0.003334750183039497\n20190930 00:00,2959800,2975500,2959200,2967700,0.003334750183039497\n20191001 00:00,2976700,2984500,2930000,2932400,0.0075389358675821555\n20191002 00:00,2914900,2915100,2866400,2880600,0.012295347528089928\n20191003 00:00,2878100,2904200,2848200,2904200,0.012295347528089928\n20191004 00:00,2912100,2946300,2910800,2943500,0.010198725939170145\n20191007 00:00,2935000,2952600,2927700,2930800,0.0024910305482276794\n20191008 00:00,2910300,2918500,2884900,2885300,0.00930294265983094\n20191009 00:00,2907800,2923000,2900600,2912700,0.00930294265983094\n20191010 00:00,2911400,2942100,2910000,2932400,0.00896323094313088\n20191011 00:00,2962800,2987200,2961500,2962800,0.0\n20191014 00:00,2959300,2966700,2955800,2959500,0.0006430592305676336\n20191015 00:00,2970500,2997000,2969700,2988800,0.0006430592305676336\n20191016 00:00,2984000,2991600,2979200,2984000,0.0011283908551833802\n20191017 00:00,2997000,3002400,2985200,2992800,0.0009272220597263867\n20191018 00:00,2987100,2994000,2970000,2979700,0.002691892512959696\n20191021 00:00,2994800,3002100,2989400,2999900,0.0025271613627319534\n20191022 00:00,3006300,3009000,2989200,2990100,0.0031533821110011477\n20191023 00:00,2987400,2999400,2985000,2998800,0.0018860737484777284\n20191024 00:00,3008800,3010700,2994700,3003700,0.0018860737484777284\n20191025 00:00,2997400,3021900,2996900,3016000,0.0\n20191028 00:00,3029100,3038500,3029100,3033000,0.0\n20191029 00:00,3030300,3042200,3028600,3032100,0.00017132055465568762\n20191030 00:00,3034200,3045500,3019900,3041400,0.00017132055465568762\n20191031 00:00,3041100,3041300,3017400,3033300,0.001547141211607727\n20191101 00:00,3049200,3061900,3047500,3061400,0.0015376264813690916\n20191104 00:00,3078700,3080000,3069600,3073700,0.0015376264813690916\n20191105 00:00,3075800,3079100,3067100,3070300,0.0006386410239270921\n20191106 00:00,3070600,3074000,3060700,3071000,0.0006386410239270921\n20191107 00:00,3086000,3094500,3076600,3081800,0.0006386410239270921\n20191108 00:00,3078200,3089700,3070400,3089400,0.0\n20191111 00:00,3074300,3085400,3072700,3083500,0.001102598105851897\n20191112 00:00,3087500,3099900,3081500,3090000,0.001102598105851897\n20191113 00:00,3079000,3095400,3076700,3091000,0.001102598105851897\n20191114 00:00,3087700,3096400,3080900,3095500,0.0\n20191115 00:00,3109800,3118300,3102600,3117900,0.0\n20191118 00:00,3115200,3122800,3110300,3120200,0.0\n20191119 00:00,3126800,3126900,3112200,3119300,0.0001665326717103364\n20191120 00:00,3113000,3118200,3090700,3107700,0.002153489172005158\n20191121 00:00,3108500,3110100,3093900,3102700,0.0023452880620881784\n20191122 00:00,3110600,3112300,3098500,3109600,0.0023393680692499717\n20191125 00:00,3119900,3133700,3119800,3133700,0.0009289028368079524\n20191126 00:00,3134200,3142800,3130600,3140800,0.0\n20191127 00:00,3146700,3154800,3143700,3154800,0.0\n20191129 00:00,3148900,3151300,3140600,3143100,0.0021411811048302745\n20191202 00:00,3146300,3146600,3111800,3116400,0.005351497137172899\n20191203 00:00,3086400,3096400,3071300,3095500,0.006605354372335617\n20191204 00:00,3106300,3121100,3103200,3114600,0.0062486838502560735\n20191205 00:00,3122200,3122400,3105900,3120200,0.0038719742735410212\n20191206 00:00,3141400,3153100,3141000,3148700,0.0\n20191209 00:00,3144100,3151800,3138000,3138800,0.0018152785800417295\n20191210 00:00,3138000,3145400,3128100,3135300,0.001926058415981767\n20191211 00:00,3140500,3147000,3136000,3144200,0.001926058415981767\n20191212 00:00,3144500,3179900,3141700,3171300,0.0006437893278207362\n20191213 00:00,3168800,3186600,3160300,3173200,0.0\n20191216 00:00,3191800,3201500,3191800,3195000,0.0\n20191217 00:00,3199800,3202400,3194800,3195700,0.0\n20191218 00:00,3200000,3202500,3195300,3195900,0.0\n20191219 00:00,3197800,3209800,3197600,3209000,0.0\n20191220 00:00,3205400,3214500,3204000,3207300,0.0003058571073924176\n20191223 00:00,3216300,3216500,3210700,3212200,0.0003058571073924176\n20191224 00:00,3214300,3215200,3209000,3212300,0.0003058571073924176\n20191226 00:00,3216900,3229400,3216400,3229400,0.0\n20191227 00:00,3237700,3238000,3222900,3228600,0.00014302353853707625\n20191230 00:00,3229400,3231000,3205500,3210800,0.003186273849198251\n20191231 00:00,3205000,3221250,3201500,3218600,0.003186273849198251\n20200102 00:00,3235800,3248700,3225350,3248700,0.0031830622534768267\n20200103 00:00,3211900,3236400,3211100,3224100,0.004371846160638059\n20200106 00:00,3204400,3237300,3203600,3236400,0.004371846160638059\n20200107 00:00,3230200,3235350,3222400,3227300,0.004663516037461772\n20200108 00:00,3229900,3257800,3226800,3244500,0.0016233739493343505\n20200109 00:00,3262000,3267300,3255200,3266500,0.0016233739493343505\n20200110 00:00,3273600,3274600,3252050,3257100,0.0016614396235672835\n20200113 00:00,3264000,3279600,3259200,3279500,0.0016614396235672835\n20200114 00:00,3274800,3286200,3268500,3274500,0.0018802144479765702\n20200115 00:00,3273400,3290200,3272600,3281900,0.0008802413007922551\n20200116 00:00,3296700,3309200,3294500,3309200,0.0008802413007922551\n20200117 00:00,3317200,3321800,3310700,3319500,0.0\n20200121 00:00,3309200,3321800,3308200,3313000,0.0011305247024348513\n20200122 00:00,3322600,3329500,3311700,3313400,0.0011305247024348513\n20200123 00:00,3306000,3319200,3294100,3317200,0.0011305247024348513\n20200124 00:00,3324600,3325300,3273600,3287700,0.0051344003801682275\n20200127 00:00,3230500,3251200,3226800,3235000,0.010583465832906964\n20200128 00:00,3250600,3278500,3245500,3268900,0.010583465832906964\n20200129 00:00,3284000,3286200,3264000,3266200,0.009266881262869975\n20200130 00:00,3243700,3279000,3235400,3276800,0.00047687164697973055\n20200131 00:00,3269700,3271700,3207400,3217300,0.010494342828103851\n20200203 00:00,3233500,3261500,3232200,3241200,0.01048350250756309\n20200204 00:00,3280700,3300100,3277350,3290600,0.01048350250756309\n20200205 00:00,3322900,3330800,3306800,3328600,0.0\n20200206 00:00,3339800,3341900,3328050,3339800,0.0\n20200207 00:00,3328100,3336200,3316000,3322000,0.003077080900525571\n20200210 00:00,3311900,3347200,3311900,3346800,0.003077080900525571\n20200211 00:00,3361600,3370200,3347500,3352600,0.003077080900525571\n20200212 00:00,3368600,3376500,3364300,3374200,0.0\n20200213 00:00,3359200,3381200,3355700,3370600,0.0006159862987026988\n20200214 00:00,3374800,3377200,3362000,3376000,0.0006159862987026988\n20200218 00:00,3365200,3371700,3352100,3367300,0.0016103125618329923\n20200219 00:00,3378100,3390650,3374800,3383400,0.0014878398524732707\n20200220 00:00,3377700,3386350,3336900,3369500,0.0027999450713963605\n20200221 00:00,3354100,3358100,3325800,3334800,0.0064013621725550855\n20200224 00:00,3231700,3258400,3212400,3224200,0.020189737897553014\n20200225 00:00,3239600,3246100,3116900,3126500,0.026609617054014646\n20200226 00:00,3141900,3181100,3107000,3115000,0.026023645208863872\n20200227 00:00,3054500,3096400,2975100,2975100,0.03135181261206879\n20200228 00:00,2886200,2962600,2855400,2962600,0.026129451523710504\n20200302 00:00,2980000,3091500,2944600,3090900,0.02604301123231395\n20200303 00:00,3095500,3138000,2975700,3002400,0.016707976050284904\n20200304 00:00,3061100,3131000,3033300,3128600,0.016530945298547955\n20200305 00:00,3049500,3084700,3000200,3024600,0.02533000490597004\n20200306 00:00,2930800,2987800,2902400,2974600,0.021434307681544508\n20200309 00:00,2756000,2841400,2734600,2742300,0.049923424141783274\n20200310 00:00,2847600,2885200,2735000,2884200,0.04608699688597107\n20200311 00:00,2807300,2819100,2708900,2743600,0.053151224903883375\n20200312 00:00,2560500,2666400,2477200,2481100,0.06199605069777857\n20200313 00:00,2633400,2710600,2495800,2693200,0.06199605069777857\n20200316 00:00,2407800,2569000,2373700,2398500,0.08391996684551857\n20200317 00:00,2450400,2559900,2370800,2528000,0.06317582219299822\n20200318 00:00,2362500,2460300,2280800,2400000,0.06961141009287468\n20200319 00:00,2392600,2473800,2322500,2405100,0.02923292502225956\n20200320 00:00,2425900,2444600,2286200,2288000,0.04055544742478522\n20200323 00:00,2280000,2293900,2182700,2229500,0.03175044961828629\n20200324 00:00,2349900,2441000,2338000,2431500,0.03175044961828629\n20200325 00:00,2450000,2563500,2397600,2467900,0.01476179665541654\n20200326 00:00,2492600,2628000,2490500,2612000,0.0\n20200327 00:00,2532200,2608000,2510500,2534200,0.0171967270072561\n20200330 00:00,2556800,2623900,2535300,2616500,0.0171967270072561\n20200331 00:00,2607000,2633300,2562200,2577500,0.019229781126923508\n20200401 00:00,2479500,2514400,2439000,2461500,0.027371564808807345\n20200402 00:00,2452000,2526700,2446000,2518300,0.027371564808807345\n20200403 00:00,2508100,2533100,2452300,2481900,0.0272907814378256\n20200406 00:00,2580500,2669700,2567250,2648600,0.008345133541874446\n20200407 00:00,2743000,2750000,2648900,2651300,0.008345133541874446\n20200408 00:00,2680500,2760000,2655600,2740300,0.0\n20200409 00:00,2778100,2812000,2754800,2782000,0.0\n20200413 00:00,2771500,2774100,2714100,2756600,0.005271278518122396\n20200414 00:00,2810800,2847500,2799100,2837900,0.005271278518122396\n20200415 00:00,2775200,2795800,2754600,2777600,0.01335216761395612\n20200416 00:00,2790500,2800300,2757600,2791000,0.01226759971532981\n20200417 00:00,2854100,2873000,2824000,2866400,0.01226759971532981\n20200420 00:00,2826000,2862900,2813600,2815900,0.010171709668600372\n20200421 00:00,2764800,2780400,2720400,2730400,0.020267549304667155\n20200422 00:00,2783800,2810000,2769100,2791000,0.020267549304667155\n20200423 00:00,2804600,2839300,2787510,2790800,0.017530304871877494\n20200424 00:00,2806900,2836900,2785000,2829700,4.1372287294159684e-05\n20200427 00:00,2850200,2882700,2846200,2870500,4.1372287294159684e-05\n20200428 00:00,2910000,2914000,2854050,2857300,0.0026549463693792477\n20200429 00:00,2915900,2948700,2904100,2932100,0.0026549463693792477\n20200430 00:00,2916900,2922300,2885900,2904800,0.005995441830086912\n20200501 00:00,2851600,2860400,2815300,2827900,0.01620217977854081\n20200504 00:00,2804600,2839000,2791600,2835700,0.01620217977854081\n20200505 00:00,2866600,2892500,2857500,2861900,0.015284438068260174\n20200506 00:00,2880100,2884600,2841500,2842500,0.003913692030566675\n20200507 00:00,2877900,2897800,2871500,2876800,0.003913692030566675\n20200508 00:00,2910500,2928500,2898700,2924400,0.003913692030566675\n20200511 00:00,2903700,2940000,2898800,2925000,0.0\n20200512 00:00,2937500,2942200,2865500,2866700,0.011507528442309477\n20200513 00:00,2859500,2871900,2789650,2816000,0.01538460918752714\n20200514 00:00,2788400,2851000,2763800,2849700,0.01538460918752714\n20200515 00:00,2823200,2863300,2813400,2862800,0.01021092498270274\n20200518 00:00,2930900,2966750,2927000,2950000,0.0\n20200519 00:00,2944100,2962050,2919700,2919700,0.005930072256422235\n20200520 00:00,2958300,2978700,2955800,2969300,0.005930072256422235\n20200521 00:00,2968000,2976700,2936900,2948800,0.007145214421961455\n20200522 00:00,2945600,2956300,2932300,2954400,0.003986017080923922\n20200526 00:00,3019600,3021900,2987000,2990800,0.003986017080923922\n20200527 00:00,3021400,3035700,2968700,3035300,0.0\n20200528 00:00,3046900,3068300,3022600,3029700,0.0010651868044219456\n20200529 00:00,3024600,3049600,2994700,3043200,0.0010651868044219456\n20200601 00:00,3036300,3062050,3030600,3055500,0.0010651868044219456\n20200602 00:00,3065200,3081300,3051000,3080800,0.0\n20200603 00:00,3102600,3132100,3099400,3121800,0.0\n20200604 00:00,3111200,3130000,3090800,3113600,0.0015165200228569734\n20200605 00:00,3174100,3212750,3171700,3193400,0.0015165200228569734\n20200608 00:00,3203000,3234100,3196300,3232000,0.0015165200228569734\n20200609 00:00,3202600,3223650,3193600,3207900,0.0043051180344894704\n20200610 00:00,3214000,3223900,3182300,3190000,0.005377057392371605\n20200611 00:00,3113100,3121400,3000100,3006100,0.03371515107042224\n20200612 00:00,3083200,3090800,2986000,3042100,0.03343915923599916\n20200615 00:00,2980100,3082800,2967400,3070500,0.03328360956237373\n20200616 00:00,3155600,3156400,3076800,3129600,0.0\n20200617 00:00,3140400,3143890,3108600,3116600,0.0023982469003914716\n20200618 00:00,3099800,3123000,3095200,3117800,0.0023982469003914716\n20200619 00:00,3141000,3143800,3065300,3086400,0.00628977783618926\n20200622 00:00,3079500,3110500,3067500,3106200,0.005814612371721811\n20200623 00:00,3135000,3145000,3116200,3120500,0.005814612371721811\n20200624 00:00,3098400,3105000,3021100,3040900,0.014727473618809207\n20200625 00:00,3034700,3076400,3012800,3073500,0.014727473618809207\n20200626 00:00,3061700,3063800,2994200,3000500,0.020123167029469532\n20200629 00:00,3014200,3044600,2989300,3044600,0.01371289072745818\n20200630 00:00,3040100,3102000,3038300,3083600,0.01371289072745818\n20200701 00:00,3095700,3118900,3090700,3105200,0.0\n20200702 00:00,3142400,3157000,3115100,3122300,0.0\n20200706 00:00,3163800,3176800,3155600,3170500,0.0\n20200707 00:00,3153800,3175200,3133700,3137800,0.005954692888345956\n20200708 00:00,3145900,3163000,3127000,3161800,0.005954692888345956\n20200709 00:00,3168500,3171000,3106800,3143800,0.006801590314118804\n20200710 00:00,3142600,3178700,3127610,3175900,0.0032868318190313337\n20200713 00:00,3200600,3227100,3141400,3148400,0.005982959892580127\n20200714 00:00,3132500,3197600,3120000,3189200,0.004999254511387231\n20200715 00:00,3224800,3230350,3192700,3218500,0.004999254511387231\n20200716 00:00,3197800,3212800,3190900,3207900,0.0019014798363865236\n20200717 00:00,3218200,3225600,3197400,3217200,0.0019014798363865236\n20200720 00:00,3214100,3251300,3206200,3243200,0.0019014798363865236\n20200721 00:00,3264800,3269200,3239400,3250100,0.0\n20200722 00:00,3246200,3272000,3245000,3268600,0.0\n20200723 00:00,3264500,3272300,3214900,3229600,0.00688877822260155\n20200724 00:00,3209300,3219900,3192500,3208800,0.00782825829972054\n20200727 00:00,3216300,3234100,3207800,3232200,0.00782825829972054\n20200728 00:00,3224500,3236400,3208500,3211700,0.0052187321995312615\n20200729 00:00,3221400,3257300,3220800,3251200,0.003661803266625646\n20200730 00:00,3219000,3244050,3196400,3239600,0.004201444807808078\n20200731 00:00,3260000,3266100,3213400,3265200,0.002059935753752336\n20200803 00:00,3283100,3296200,3277300,3287900,0.002059935753752336\n20200804 00:00,3278800,3300600,3278600,3300600,0.0\n20200805 00:00,3314600,3323900,3311900,3321100,0.0\n20200806 00:00,3315200,3344600,3311400,3343300,0.0\n20200807 00:00,3332900,3348800,3323000,3345700,0.0\n20200810 00:00,3350000,3357700,3329600,3355700,0.0\n20200811 00:00,3368600,3375400,3320100,3328000,0.00476580220417574\n20200812 00:00,3354700,3382800,3354300,3374400,0.00476580220417574\n20200813 00:00,3365800,3382500,3358300,3368300,0.004878746262963056\n20200814 00:00,3364300,3374100,3356700,3368400,0.0010436926985706288\n20200817 00:00,3379100,3383400,3374900,3379100,0.0010436926985706288\n20200818 00:00,3383200,3391000,3366200,3386400,0.0\n20200819 00:00,3391100,3396100,3366300,3372300,0.0024039212129617882\n20200820 00:00,3353300,3387950,3352200,3382800,0.0024039212129617882\n20200821 00:00,3378600,3397100,3375500,3394800,0.0024039212129617882\n20200824 00:00,3421300,3430000,3410600,3429200,0.0\n20200825 00:00,3435300,3442100,3422700,3441200,0.0\n20200826 00:00,3447200,3478600,3441700,3475700,0.0\n20200827 00:00,3485000,3499000,3465400,3483300,0.0\n20200828 00:00,3494500,3507100,3481600,3505800,0.0\n20200831 00:00,3503500,3512900,3491000,3493100,0.0020914907920327047\n20200901 00:00,3502400,3526900,3492400,3526000,0.0020914907920327047\n20200902 00:00,3546400,3587000,3534300,3577000,0.0020914907920327047\n20200903 00:00,3558500,3563800,3426100,3453900,0.019869113261739686\n20200904 00:00,3460700,3478090,3348800,3425700,0.02042063531878285\n20200908 00:00,3367400,3380500,3328800,3332100,0.025804049883848393\n20200909 00:00,3375200,3424600,3366200,3397900,0.016464122466754678\n20200910 00:00,3417500,3425200,3328600,3338900,0.01869078935864158\n20200911 00:00,3357900,3369700,3310000,3340600,0.010024917120041185\n20200914 00:00,3375200,3403700,3369300,3384600,0.010024917120041185\n20200915 00:00,3411100,3420200,3390200,3401700,0.0\n20200916 00:00,3415000,3430600,3385300,3388200,0.0022912745492135993\n20200917 00:00,3335200,3376900,3330000,3358400,0.005570933399681655\n20200918 00:00,3353500,3354900,3279700,3306500,0.010518641317179158\n20200921 00:00,3257100,3270900,3217300,3269700,0.012111199688210091\n20200922 00:00,3285500,3309000,3258700,3303000,0.010995262525464573\n20200923 00:00,3309200,3312000,3221000,3226400,0.014851398472296351\n20200924 00:00,3212200,3267900,3198000,3235000,0.013389352291833266\n20200925 00:00,3225700,3295700,3216400,3287300,0.013389352291833266\n20200928 00:00,3332200,3349600,3321600,3341900,0.0\n20200929 00:00,3340000,3347700,3316300,3323700,0.0031442517427963963\n20200930 00:00,3331000,3382900,3328800,3348900,0.0031442517427963963\n20201001 00:00,3376300,3387100,3350100,3370400,0.0031442517427963963\n20201002 00:00,3317100,3359150,3311900,3338400,0.005481607113122472\n20201005 00:00,3360100,3399500,3360100,3397600,0.005481607113122472\n20201006 00:00,3398700,3421700,3343800,3349300,0.009869757665596012\n20201007 00:00,3381200,3416300,3380900,3407600,0.008207563574834882\n20201008 00:00,3428800,3438500,3418700,3437800,0.008207563574834882\n20201009 00:00,3455300,3473500,3448900,3468500,0.0\n20201012 00:00,3495500,3540200,3490600,3524300,0.0\n20201013 00:00,3523100,3523800,3491000,3501300,0.003767856366189422\n20201014 00:00,3507300,3519300,3471500,3479300,0.005230394974802247\n20201015 00:00,3437200,3480200,3431300,3475000,0.005278841289563702\n20201016 00:00,3489900,3507500,3471100,3472900,0.0037136446509772733\n20201019 00:00,3485700,3493200,3410600,3420100,0.008813568198894998\n20201020 00:00,3434200,3468800,3426500,3433800,0.00878463719390888\n20201021 00:00,3433600,3456700,3424100,3427300,0.008845480959015271\n20201022 00:00,3429200,3452400,3406500,3446100,0.0010928932231733157\n20201023 00:00,3459100,3459900,3431500,3457800,0.0010928932231733157\n20201026 00:00,3421400,3429800,3356300,3393900,0.010669408930885877\n20201027 00:00,3397400,3401150,3379900,3382200,0.010853465832308213\n20201028 00:00,3321100,3328400,3261300,3266600,0.022521048536787037\n20201029 00:00,3269900,3333900,3251000,3299800,0.019833339110241884\n20201030 00:00,3282800,3296800,3226000,3265400,0.020630703031171347\n20201102 00:00,3302000,3323500,3272400,3302000,0.006018803945730984\n20201103 00:00,3337200,3382500,3331700,3360300,0.006018803945730984\n20201104 00:00,3408000,3479200,3396000,3435400,0.0\n20201105 00:00,3492800,3521900,3488750,3502400,0.0\n20201106 00:00,3499700,3515000,3476500,3501600,0.0001318753470053883\n20201109 00:00,3643600,3643700,3540600,3545600,0.0001318753470053883\n20201110 00:00,3535200,3551800,3505900,3540400,0.0008569535074886069\n20201111 00:00,3564300,3575600,3550700,3566700,0.0008467456565281184\n20201112 00:00,3555700,3564200,3512600,3532100,0.005664430166376498\n20201113 00:00,3553000,3589000,3547100,3581000,0.005600784847046604\n20201116 00:00,3611000,3625900,3595900,3625700,0.005600784847046604\n20201117 00:00,3599700,3619200,3583400,3606200,0.003105146661113059\n20201118 00:00,3609800,3615000,3562400,3562800,0.007610582854427167\n20201119 00:00,3556800,3581800,3541500,3577800,0.007610582854427167\n20201120 00:00,3574500,3577100,3552500,3553300,0.007994357309910943\n20201123 00:00,3572500,3588200,3548650,3574600,0.003953569678334673\n20201124 00:00,3603000,3638100,3592900,3632200,0.003953569678334673\n20201125 00:00,3631600,3631600,3614850,3626600,0.0008901386232756911\n20201127 00:00,3638400,3641800,3625800,3636700,0.0008901386232756911\n20201130 00:00,3628400,3631200,3591800,3620600,0.002706545802873168\n20201201 00:00,3656000,3676500,3649300,3660200,0.0025559818885123615\n20201202 00:00,3648000,3669500,3642000,3667900,0.0025559818885123615\n20201203 00:00,3666600,3681900,3655000,3666900,0.0001574062185963956\n20201204 00:00,3673000,3698500,3672200,3698500,0.0001574062185963956\n20201207 00:00,3689700,3696200,3677200,3690900,0.001196786142703205\n20201208 00:00,3676700,3707700,3676700,3701700,0.001186389629807004\n20201209 00:00,3709100,3710500,3659500,3668500,0.005312340034673667\n20201210 00:00,3653900,3678550,3644500,3667300,0.0051816120169211385\n20201211 00:00,3649300,3665800,3632650,3663000,0.005225645847198979\n20201214 00:00,3686100,3698000,3644900,3646600,0.0026787543511175953\n20201215 00:00,3674600,3695900,3659200,3695900,0.0026720887092334567\n20201216 00:00,3698100,3711600,3688800,3701700,0.0025849152101309896\n20201217 00:00,3719300,3724590,3710500,3722400,0.0\n20201218 00:00,3709800,3711500,3670200,3691800,0.004746109562970838\n20201221 00:00,3649800,3784600,3620300,3678600,0.005175609733744067\n20201222 00:00,3682300,3683300,3660400,3672400,0.0052662909700036415\n20201223 00:00,3683300,3696100,3673900,3675700,0.0022821622635164794\n20201224 00:00,3680600,3690000,3674500,3690000,0.0009730798860913528\n20201228 00:00,3718100,3725900,3710700,3721700,0.0\n20201229 00:00,3738500,3740000,3708300,3714600,0.001101428624350802\n20201230 00:00,3723800,3730800,3715800,3719900,0.001101428624350802\n20201231 00:00,3718500,3746420,3712400,3738800,0.001101428624350802\n20210104 00:00,3753000,3754500,3648300,3687900,0.007860042982173928\n20210105 00:00,3680500,3724800,3680500,3713300,0.007860042982173928\n20210106 00:00,3696700,3769800,3691200,3735500,0.007860042982173928\n20210107 00:00,3761800,3798900,3759200,3791000,0.0\n20210108 00:00,3806300,3814900,3771100,3812600,0.0\n20210111 00:00,3778400,3805700,3777200,3786900,0.003891806619675118\n20210112 00:00,3788400,3798500,3763600,3787700,0.003891806619675118\n20210113 00:00,3786500,3808600,3778500,3797900,0.003891806619675118\n20210114 00:00,3806300,3811300,3781000,3784600,0.002021843276606032\n20210115 00:00,3767100,3775800,3737200,3757000,0.0046707318257175525\n20210119 00:00,3782400,3792300,3767800,3786500,0.0046707318257175525\n20210120 00:00,3811000,3847900,3806900,3838900,0.004210449566568136\n20210121 00:00,3845000,3849500,3832500,3842400,0.0\n20210122 00:00,3822400,3840800,3818400,3828800,0.0020435050127469503\n20210125 00:00,3836000,3847700,3784600,3843900,0.0020435050127469503\n20210126 00:00,3854100,3858500,3835500,3837900,0.0022333974791478146\n20210127 00:00,3802400,3803200,3720100,3744100,0.014139448503874177\n20210128 00:00,3762700,3819300,3758900,3776300,0.014139448503874177\n20210129 00:00,3755700,3766700,3682700,3700700,0.01824024650164398\n20210201 00:00,3738400,3773400,3714200,3762300,0.011558319082365206\n20210202 00:00,3796800,3832200,3796000,3815500,0.011558319082365206\n20210203 00:00,3824300,3837000,3804800,3818500,0.0\n20210204 00:00,3830300,3862400,3827800,3861900,0.0\n20210205 00:00,3882700,3884700,3864850,3877100,0.0\n20210208 00:00,3893000,3905400,3883600,3905100,0.0\n20210209 00:00,3895500,3908900,3891700,3902500,0.00038439750579832035\n20210210 00:00,3921000,3922800,3875100,3900800,0.00045936461112796586\n20210211 00:00,3913400,3916900,3881200,3907100,0.00045936461112796586\n20210212 00:00,3898800,3928900,3897700,3926400,0.0002515042812613287\n20210216 00:00,3940600,3941600,3915400,3923000,0.0004999467489926309\n20210217 00:00,3904300,3926300,3893300,3923900,0.0004999467489926309\n20210218 00:00,3895600,3915150,3877400,3907200,0.0025075299542766188\n20210219 00:00,3921000,3923800,3895500,3900300,0.00266032147321683\n20210222 00:00,3870600,3896200,3867400,3870300,0.005176692199441482\n20210223 00:00,3847200,3889450,3802000,3875000,0.004556356264384084\n20210224 00:00,3862300,3922300,3852700,3917700,0.004440814315742071\n20210225 00:00,3905100,3918700,3807789,3823300,0.013911699571560035\n20210226 00:00,3844400,3855800,3782300,3803600,0.014226215417366087\n20210301 00:00,3856500,3909200,3855500,3895800,0.014226215417366087\n20210302 00:00,3898700,3900700,3860000,3865400,0.005398782768644218\n20210303 00:00,3858300,3868300,3813100,3814200,0.00887581287070967\n20210304 00:00,3812200,3840000,3718800,3767000,0.01139409324934116\n20210305 00:00,3804100,3847600,3726500,3836300,0.010465578136139108\n20210308 00:00,3846900,3876800,3814200,3817200,0.007701167176040228\n20210309 00:00,3858800,3899100,3853100,3871700,0.0028744858695935595\n20210310 00:00,3895900,3914000,3881702,3895800,0.0028744858695935595\n20210311 00:00,3922400,3956500,3917400,3935300,0.0\n20210312 00:00,3920900,3942100,3912000,3940600,0.0\n20210315 00:00,3944000,3966850,3920400,3964100,0.0\n20210316 00:00,3970600,3978300,3950800,3959100,0.0007282236436891143\n20210317 00:00,3945600,3981200,3933000,3972600,0.0007282236436891143\n20210318 00:00,3944900,3967200,3908650,3914800,0.008431759141320811\n20210319 00:00,3899400,3915690,3871500,3894800,0.008903047739200996\n20210322 00:00,3900100,3940500,3899800,3925900,0.008903047739200996\n20210323 00:00,3918900,3934600,3886600,3895000,0.005417552261794818\n20210324 00:00,3909200,3927500,3874800,3875200,0.00540958912119034\n20210325 00:00,3859900,3905500,3839000,3897000,0.00540958912119034\n20210326 00:00,3909800,3964100,3902900,3959800,0.002934925630283581\n20210329 00:00,3943500,3967499,3928100,3957800,0.0002916057726095515\n20210330 00:00,3943500,3957800,3930299,3947300,0.0015592148233472426\n20210331 00:00,3953500,3980000,3953300,3963300,0.0015592148233472426\n"
  },
  {
    "path": "Tests/TestData/spy_tema.txt",
    "content": "time,open,high,low,close,TEMA_5\n725898600,43.9688,43.96899,43.75,43.938,NaN\n728577000,43.96875,45.125,42.8125,44.40625,NaN\n730996200,44.5625,45.84375,44.21875,45.1875,NaN\n733674600,45.25,45.25,43.28125,44.03125,NaN\n736435800,44.09375,45.65625,43.84375,45.21875,NaN\n738941400,45.375,45.8125,44.21875,45.0625,NaN\n741533400,45.125,45.21875,44.15625,44.84375,NaN\n744298200,44.90625,46.5625,44.84375,46.5625,NaN\n746890200,46.40625,46.59375,44.8125,45.9375,NaN\n749482200,45.875,47.15625,45.71875,46.84375,NaN\n752164200,46.78125,47,45.53125,46.34375,NaN\n754756200,46.59375,47.15625,46.375,46.59375,NaN\n757607400,46.59375,48.3125,46.40625,48.21875,47.790901367271246\n760113000,48.15625,48.28125,46.5625,46.8125,47.26184694063122\n762532200,46.8125,47.3125,43.53125,44.59375,45.42064694250915\n765210600,43.34375,45.35937,43.34375,45.09375,44.97534836929405\n767885400,45.09375,45.9375,44.17187,45.8125,45.3470480569111\n770477400,45.70312,46.5625,44,44.46875,44.616647382173575\n773069400,44.6875,46.04687,44.375,45.90625,45.35238020529356\n775747800,45.9375,47.98437,45.65625,47.65625,46.94488369566267\n778426200,47.5,47.71875,45.73437,46.17187,46.582379304911285\n781191000,46.20312,47.70312,45,47.48437,47.302727446803765\n783700200,47.28125,47.32812,44.60937,45.59375,46.25012173021846\n786292200,45.64062,46.40625,44.6875,45.5625,45.73906888096858\n789057000,45.70312,47.23437,45.6875,47.09375,46.605866920698844\n791649000,47.15625,49.15625,47,49.01562,48.34613288313394\n794068200,48.96875,50.89062,48.21875,50.10937,49.834331392289734\n796915800,50.09375,51.67187,50.0625,51.59375,51.43065321320055\n799335000,51.54687,53.64062,51.39062,53.64062,53.4318565353878\n802013400,53.40625,55.15625,52.75,54.40625,54.6709829027422\n804778200,54.46875,56.70312,54.20312,56.15625,56.24445026591563\n807283800,56.23437,56.79687,55.42187,56.40625,56.903927116438076\n809962200,56.39062,58.90625,56.34375,58.48437,58.4544536272826\n812640600,58.48437,59.1875,57.26562,58.3125,58.82356006699315\n815236200,58.28125,61.20312,58.23437,60.90625,60.6296118506282\n817828200,60.98437,62.79687,60.57812,61.48437,61.65748283483072\n820506600,61.40625,63.6875,59.64062,63.67187,63.4642947034885\n823185000,63.60937,66.6875,63.4375,63.875,64.21188024961106\n825690600,64.64062,66,62,64.6875,64.92080469748359\n828369000,65,65.8125,62.125,65.39062,65.55951490022309\n830957400,65.375,68.4375,63.07812,66.875,66.73763990738988\n833808600,66.89062,68.5,66.15625,67.10937,67.28044171003299\n836227800,67.28125,67.70312,60.375,64.09375,65.26166981027892\n838906200,64.15625,67.34375,64.0625,65.32812,65.17294842418491\n841671000,64.46875,69.25,64.375,68.625,67.45626057097064\n844176600,68.70312,71.625,68.4375,70.84375,69.98977689051819\n846858600,70.98437,76.6875,70.26562,76.01562,74.62557181209324\n849537000,75.92187,76.57812,71.875,73.84375,74.90691275415351\n852129000,74.375,79.6875,72.75,78.40625,77.96165217085478\n854980200,78.71875,82,77.125,79.15625,79.56263639160655\n857399400,78.75,81.79687,75.6875,75.6875,77.52845144552631\n859905000,75.25,80.6875,73.3125,80.09375,79.51873834546012\n862493400,80.21875,85.5625,79.3125,85.15625,83.81092443513893\n865258200,85.34375,90.5,84.07812,88.3125,87.69325743056108\n867763800,88.5,96.03125,88.39062,95.3125,93.99370475366582\n870442200,95.5,96.625,89.34375,90.375,92.84037721032841\n873120600,90.6875,96.375,90.25,94.375,94.69548361741677\n875712600,95.25,98.5,84.375,92.0625,93.54406199251888\n878567400,93.1875,96.8125,90.09375,95.625,95.28018352043124\n880986600,96.21875,99,92.375,97.0625,96.86277953007189\n883665000,97.3125,99.5625,90.90625,98.3125,98.2377216232781\n886429800,99.90625,105.53125,99.71875,105.125,103.4358656569585\n888849000,105.25,111.53125,103.15625,109.9375,108.84050012141932\n891441000,110.3125,113.4375,107.625,111.34375,111.79643947749491\n894029400,111.75,113.3125,107.57812,109.03125,110.99140380256657\n896707800,108.96875,114.6875,107.5,113.3125,113.24862907852345\n899299800,114.0625,119.23437,111.3125,111.78125,112.85002589510475\n902151000,111.78125,112.42187,95,96,101.30349933071649\n904656600,96.0625,107,93.625,101.75,100.31118756530026\n907248600,100.03125,110.90625,92.21875,110,106.00660591782439\n910017000,110.8125,119.71875,110.1875,116.125,112.99840599471999\n912522600,116.125,124.75,113.75,123.3125,121.01307819242975\n915201000,123.375,128.29687,120.375,127.65625,127.20037792310674\n917879400,128.6875,128.84375,121.32812,123.5625,126.4476607732612\n920298600,123.65625,132.625,121.78125,128.375,128.9329519282852\n922977000,129.6875,137.5,128.125,133.25,133.0043199879575\n925738200,133.4375,138,128,130.20312,132.18842874509357\n928243800,130.125,137.5,128.01562,137,136.19961659610613\n930835800,137,142.25,132.5625,132.75,134.6191800470378\n933600600,132.75,138.78125,127,132.0625,133.12757240892486\n936192600,132.9375,136.625,125.5625,128.75,129.98408745027518\n938784600,127.9375,137.6875,123.4375,137,134.3982057766617\n941466600,136.5,143,134.59375,139.39062,138.01919714819357\n944058600,139.3125,147.5625,139,146.875,144.72149398684564\n946909800,148.25,148.25,135,139.625,142.25065422844398\n949415400,139.75,144.5625,132.71875,137.4375,139.28806007389198\n951921000,137.625,155.75,135.03125,150.375,146.955690505961\n954768600,150.125,153.10937,133.5,145.09375,146.44531883293834\n957187800,146.5625,148.48437,136.5,142.8125,144.33599405019294\n959866200,143.6875,149.15625,143,145.28125,144.99449906564178\n962631000,145.4375,151.98437,141.51562,142.90625,143.544480163008\n965136600,143.625,153.09375,142.625,152.34375,149.51876536447674\n967815000,153.25,153.59375,142.125,143.625,145.91872356809597\n970493400,144.28125,145.75,130.15625,142.95312,143.73243114296602\n973089000,142.25,144.29687,129.75,132.28125,135.29175948831568\n975681000,133.1875,139.5625,125.53125,131.1875,131.04813776914955\n978445800,132,138.7,127.5625,137.02,133.74390915179407\n981037800,137.10001,137.99001,121.8,123.95,126.12860038570452\n983457000,124.05,127.75,108.03999,116.69,118.05180716728346\n986218200,116.3,127.27,109.3,124.91,120.89293505045539\n988723800,125.07001,132.09,123.44,125.95,123.45971251066754\n991402200,126.2,129.23,120.39999,122.60001,122.55235041103408\n994080600,122.8,124.32001,116.75,121.35001,121.46187563760938\n996672600,121.97,123.25,112.03999,114.14999,116.0845925821859\n999610200,113.85001,116.17,93.8,104.44,107.12665554712497\n1001943000,103.89999,111.78999,102.83,105.8,104.60329450692336\n1004625000,106.60001,116.89999,105.69901,114.05,109.88611275314257\n1007389800,113.64999,118,112,114.3,112.7757307702762\n1009981800,115.11,117.99001,108.39999,113.17999,113.36428031619144\n1012573800,113.09,113.3,107.82001,111.14999,112.18088301368651\n1014993000,111.72,117.907,111.50999,114.52,114.01480064882924\n1017671400,114.23,115.10001,106.63,107.86,110.10153959531836\n1020259800,107.97,111.25,104.89999,107.22,107.92656958884561\n1023111000,107.09,107.60001,95.19501,98.96001,101.27621953914203\n1025530200,99.187,99.8,77.67999,91.16,93.12042098806575\n1028208600,90.88,97.14999,83.55,91.78,90.46338913545193\n1031059800,90.735,93.33,80.00999,81.78999,82.86768237248792\n1033479000,82.438,91.28999,77.07001,88.52,84.91394470898534\n1036161000,88.35001,94.95,87.45,93.98,90.27123859108363\n1038839400,95.47,96.05,87.11,88.23,88.88504938425731\n1041517800,88.85001,93.86,84.14999,86.06,86.86443093121362\n1044282600,86.14,86.817,81,84.89999,85.29804485855335\n1046701800,85.25999,89.88,79.383,84.74001,84.66058495971293\n1049207400,85.25,92.8,84.91,91.91,89.58322223578841\n1051795800,91.92,97.09,90.5,96.95,95.32323781671612\n1054560600,97.53,102.179,96.67,97.63,98.11605634414781\n1057066200,97.25301,101.89999,96.42999,99.39,100.22986144698181\n1059744600,99.19,101.81799,96.34,101.44,102.22371823264537\n1062509400,101.64,104.7,99.25,99.95,101.6764527120255\n1065015000,100.24001,105.97,100.2,105.3,104.881240061111\n1067869800,105.75,106.95,103.62,106.45,106.81386709363848\n1070289000,106.92999,111.52,105.96001,111.28,110.74280750195136\n1073053800,111.74001,116.5,110.73,113.48,113.66601148975096\n1075732200,113.7,116.60001,112.78,115.02,115.63238841205224\n1078151400,115.42999,116.97,108.85001,113.10001,114.74723002353323\n1080829800,113.07001,115.41,110.89999,110.96001,112.53305260573785\n1083591000,111.37,113.25999,108.06,112.86,112.72901804292833\n1086096600,112.46001,114.94,111.87,114.53,113.92389039629013\n1088688600,114.25,114.39999,108.21001,110.84,111.78851306296852\n1091453400,110.19,113.61,106.59,111.11,111.01488131397339\n1094045400,110.94,113.74001,110.41,111.75999,111.18622421696362\n1096637400,112.25999,114.67999,109.35001,113.2,112.33884388580526\n1099319400,113.56,119.14,113.2,117.89,116.17564550128074\n1101911400,118.16,121.66,117.73,120.87,119.8891211450326\n1104762600,121.56,121.75999,116.37,118.16,119.40815018044798\n1107268200,118.25,121.67,118.10001,120.63,120.70544120493567\n1109687400,120.78,123.25,116.25,117.96001,119.21383621224669\n1112365800,118.63,119.25999,113.55,115.75,116.86763605656371\n1115040600,116.07001,120.25,114.8,119.48,118.44214418714984\n1117632600,119.52,121.94,118.75,119.17999,118.93968102843596\n1120224600,119.45,124.64,118.25999,123.74001,122.34026530557986\n1122903000,123.83,124.74001,120.38,122.58,122.92824233240067\n1125581400,122.50999,124.74001,120.44,123.03999,123.35677456208325\n1128346200,122.96001,123.34,116.88,120.13,121.36301943817446\n1130855400,120.58,127.41,120.13,125.41,124.13166607724553\n1133447400,126.02,128.57001,124.36,124.50999,124.66093610717202\n1136298600,125.10001,129.44,124.39,127.5,126.88796394488314\n1138804200,127.82001,130.03999,123.64,128.23,128.248131917906\n1141223400,128.60001,131.47,127.17999,129.83,129.79962631142618\n1144071000,130.07001,131.86,128.02,131.47,131.449658641906\n1146490200,131.47,132.8,124.75999,127.50999,129.18629202943816\n1149168600,127.38,129.42999,122.34,127.23,127.85108773972054\n1151933400,127.42999,128.14,122.39,127.85001,127.6747986674216\n1154439000,127.34,131.03999,126.28,130.64,129.58185206097522\n1157117400,131.14,133.99001,129.35001,133.58,132.47985485863887\n1159795800,133.53999,139,132.34,137.78999,136.6168032411394\n1162391400,138.22,141.16,135.62,140.53,140.1488043184567\n1164983400,140.53,143.24001,138.97,141.62,142.1492309401761\n1167834600,142.25,144.13,140.25,143.75,144.1720718975623\n1170340200,144.14999,146.42,139,140.92999,142.7303634507288\n1172759400,139.34,143.81,136.75,142,142.57552539068604\n1175520600,142.16,149.8,140.89,148.28999,146.77153896486317\n1178026200,148.42,153.89,147.67,153.32001,151.96916991273133\n1180704600,153.88,154.39999,148.06,150.42999,151.8967913214039\n1183383000,150.87,156,145.03999,145.72,148.19738319319958\n1185975000,145.17999,150.59,137,147.59,147.6999053394106\n1188912600,147.45,154.39,144.33,152.58,150.9564231090452\n1191245400,152.60001,157.52,148,154.64999,153.7799678227872\n1193923800,153.28999,153.41,140.66,148.66,150.64024345259878\n1196692200,148.19,152.89,143.96001,146.21001,147.41243554416133\n1199284200,146.53,146.99001,126,137.37,139.818970284202\n1201876200,137.94,139.61,131.73,133.82001,134.24070271769963\n1204554600,133.14,135.81,126.07001,131.97,130.9660815139926\n1207056600,133.71001,140.59,132.33,138.25999,134.5086961552603\n1209648600,138.39,144.3,137.52,140.35001,137.96691739340443\n1212413400,139.83,140.89,127.035,127.98,130.95810036171886\n1214919000,126.52,129.16,120.02,126.83,127.24326231897561\n1217597400,127.12,131.50999,124.75999,128.78999,127.342581531483\n1220362200,130.03,130.71001,110.5321,115.99001,118.72137970780402\n1222867800,115.27,116.69,83.58,96.83,101.85619435703093\n1225722600,96.78,100.86,74.34,90.09,90.50724437224407\n1228141800,87.50999,92.42999,81.86,90.24001,86.82071951520363\n1230906600,90.44,94.5533,80.05,82.83,81.20582634357245\n1233585000,81.57001,87.74001,73.81,73.92999,73.5658001845754\n1236004200,72.52,83.3,67.10001,79.52,75.2092413970404\n1238592600,78.53,89.02,78.33,87.42,82.41173035348325\n1241184600,87.44,93.7,86.72,92.53,89.66433889893499\n1243863000,93.67,96.11,87.53,91.95,92.47836811086721\n1246455000,92.34,99.83,87,98.81,98.31331557233469\n1249306200,99.85001,104.35001,98.11501,102.46001,103.06861815208642\n1251811800,101.95,108.06,99.57001,105.59,106.82898757390946\n1254403800,105.34,110.31,101.99001,103.56,106.45413778128433\n1257172200,104.13,111.74001,103.08,109.94,110.23588269427056\n1259677800,110.92,113.03,105.476,111.44,112.47780022057961\n1262615400,112.37,115.14,107.22,107.39,110.12713100621609\n1265034600,108.14999,111.58,104.58,110.74001,111.0811673314432\n1267453800,111.2,118.1666,111.17,117,115.67068227551079\n1270128600,117.8,122.12,117.10001,118.8125,118.689980999828\n1272893400,119.38,120.67999,104.38,109.369,113.01480558236551\n1275399000,108.35001,113.2,102.88,103.22,105.96983865400058\n1277991000,103.14999,112.28999,101.13,110.27,107.93763460553693\n1280755800,111.99001,113.17999,104.28999,105.31,105.52838969681103\n1283347800,106.73,115.78999,106.66,114.13,110.84988544668408\n1285939800,114.99001,119.75999,113.17999,118.49001,116.35196488444589\n1288618200,119.07001,122.95,117.59,118.49249,118.62423537977554\n1291213800,120.2,126.2,120.19,125.75,124.45157326819627\n1294065000,126.71001,130.35001,125.6969,128.67999,128.70584784763878\n1296570600,129.46001,134.69,129.3801,133.14999,133.23344959835674\n1298989800,133.57001,133.69,125.28,132.59,134.28438970154954\n1301664600,133.41,136.57001,129.50999,136.42999,136.92108633792384\n1304343000,137.07001,137.17999,131.38,134.89999,136.54253110292439\n1306935000,134.50999,134.9234,126.19,131.97,133.92603218537232\n1309527000,132.09,135.7,127.96671,129.33,130.69678477808225\n1312205400,130.84,130.96001,110.27,122.22,124.24257289505307\n1314883800,122.28999,123.39999,111.3,113.14999,115.20862043721786\n1317648600,112.49001,129.42,107.42999,125.5,120.39805398564857\n1320154200,122.03,128.02,116.2,124.99001,122.79760120909648\n1322749800,124.85001,127.25999,120.03,125.5,124.4151550113187\n1325601000,127.75999,133.39999,126.42999,131.32001,129.29072107292313\n1328106600,132.28999,138.19,132.13,137.02,135.3671802667833\n1330612200,137.31,141.83,134.36,140.81,140.41900503228203\n1333373400,140.64,142.21001,135.75999,139.87,141.52605743416348\n1335879000,139.78999,141.66,129.55,131.47,135.6226060154423\n1338557400,129.41,136.27,127.13499,136.105,136.01369249860204\n1341235800,136.48,139.339,132.60001,137.71001,137.24126769784803\n1343827800,138.7,143.09,135.58,141.16,140.130224957691\n1346765400,141.03999,148.11,140.13,143.97,143.24467298450378\n1349098200,144.52,147.16,140.39,141.35001,142.55276200996707\n1351776600,141.64999,143.72,134.7,142.155,142.59879336139315\n1354545000,142.8,145.58,139.53999,142.41,142.6567745567572\n1357137000,145.11,150.94,144.73,149.7,147.7107911531287\n1359729000,150.64999,153.28,148.73,151.61,151.1125624117346\n1362148200,151.09,156.85001,150.41,156.67,155.87311426574414\n1364823000,156.59,159.72,153.55,159.67999,159.70081713899145\n1367415000,159.33,169.07001,158.10001,163.44501,163.57066671231945\n1370266200,163.83,165.99001,155.73,160.42,162.64300294768563\n1372685400,161.25999,169.86,160.22,168.71001,167.63018535716495\n1375363800,169.99001,170.9725,163.05,163.64999,165.87173136551047\n1378215000,165.23,173.60001,163.7,168.00999,167.80522498004112\n1380634200,168.14,177.51,164.53,175.79,173.8759808378209\n1383312600,176.02,181.75,174.76,181,179.8780961809234\n1385994600,181.09,184.69,177.32,184.69,184.62643272032003\n1388673000,183.98,184.94,176.88,178.18,181.55347226246687\n1391437800,177.95,187.15,173.71,186.29,185.43521087737324\n1393857000,184.69,189.0239,183.75,187.01,187.30510547007063\n1396359000,187.62,189.7,181.31,188.31,188.6779956258561\n1398951000,188.22,192.8,186.01,192.68,192.03146866269157\n1401715800,192.95,196.6,191.97,195.72,195.32341885241064\n1404221400,196.19,199.06,192.97,193.09,194.55650782148624\n1406899800,192.56,200.82,190.55,200.71,199.26259603611138\n1409664600,200.97,201.899,196.05,197.02,198.44049093317753\n1412170200,196.7,201.82,181.92,201.66,201.04611539494326\n1415025000,201.92,207.87,200.06,207.2,205.85086392671985\n1417444200,206.4,212.97,197.86,205.54,206.48112686260498\n1420209000,206.38,206.88,198.55,199.45,202.12846934734443\n1422887400,200.05,212.24,197.86,210.66,207.92384033765117\n1425306600,210.78,212.06,204.12,206.43,207.3659813566519\n1427895000,206.39,212.48,204.51,208.46,208.34416651416728\n1430487000,209.4,213.78,206.76,211.14,210.5118661343249\n1433165400,211.94,213.34,205.28,205.85,207.57957879987922\n1435757400,207.73,213.18,204.11,210.5,209.45568172115262\n1438608600,210.46,211.31,182.4,197.67,201.21358908226617\n1441114200,193.12,202.89,186.93,191.63,193.43095921777456\n1443706200,192.08,209.44,189.12,207.93,201.89029794694324\n1446474600,208.32,211.66,202.18,208.69,206.4829729612288\n1448980200,209.44,211,199.83,203.87,205.0913884280961\n1451917800,200.49,201.9,181.02,193.7208,197.2424271143889\n1454337000,192.53,196.68,181.09,193.56,193.7822542390878\n1456842600,195.01,206.87,194.4542,205.52,200.9990763043522\n1459517400,204.35,210.92,203.09,206.3308,204.93087350899884\n1462195800,206.92,210.69,202.78,209.84,209.0309057941467\n1464787800,209.12,212.52,198.65,209.475,210.33128433314005\n1467379800,209.36,217.54,207.06,217.12,215.975323461936\n1470058200,217.19,219.6,214.25,217.38,218.27068434461765\n1472736600,217.37,219.22,212.31,216.3,218.07020683869544\n1475501400,215.82,216.7,211.21,212.55,214.9577452066225\n1478007000,212.93,221.82,208.38,220.38,218.8768988785747\n1480602600,220.73,228.34,219.15,223.53,222.65575432274775\n1483453800,225.04,229.71,223.8837,227.53,226.86053094269155\n1485959400,228.255,237.31,226.82,236.47,234.639507641297\n1488378600,238.39,240.32,231.61,235.74,237.0414938250046\n1491226200,235.8,239.53,232.51,238.08,239.15046811129972\n1493645400,238.68,242.08,235.43,241.44,241.9106504237182\n1496323800,241.97,245.01,239.955,241.8,242.89074894348266\n1499088600,242.88,248,240.34,246.77,246.386324910541\n1501594200,247.46,248.91,241.83,247.49,248.03295505902156\n1504272600,247.92,251.32,244.95,251.23,250.99658770205738\n1506951000,251.49,257.89,251.2926,257.15,256.09444270632036\n1509543000,258.04,266.05,255.63,265.01,263.4420884940522\n1512138600,264.76,268.6,260.76,266.86,267.41798306917565\n1514903400,267.84,286.6285,267.4,281.9,279.1048682074137\n1517495400,281.07,283.06,252.92,271.65,276.2526740986086\n1519914600,271.41,280.41,257.83,263.15,268.23566705227324\n1522675800,262.55,271.3,254.67,264.51,265.3132851456353\n1525181400,263.87,274.25,259.05,270.94,268.54869543597556\n1527859800,272.41,279.48,268.49,271.28,270.2398749895553\n1530538200,269.51,284.37,269.24,281.33,277.99468499651675\n1533130200,281.56,291.74,279.16,290.31,287.5117427287302\n1536067800,289.84,293.94,286.71,290.72,291.48460916271375\n1538400600,292.11,293.21,259.85,270.63,278.43680135275525\n1541079000,271.6,281.22,263.07,275.65,275.9009364822565\n1543847400,280.28,280.4,233.76,249.92,256.7904664683102\n1546439400,245.98,270.47,243.67,269.93,262.98577358331704\n1549031400,270.15,281.31,267.83,278.68,272.5941656480741\n1551450600,280.44,285.18,272.42,282.48,279.73336399048407\n1554125400,284.7,294.45,284.4,294.02,290.82362521563005\n1556717400,294.72,294.95,275.24,275.27,282.004369747081\n1559568600,275.31,296.3093,273.09,293,290.1330507593914\n1561987800,296.68,302.23,294.33,297.43,296.51949747545393\n1564666200,297.6,300.87,281.72,292.45,295.2943701597434\n1567517400,290.57,302.63,289.27,296.77,297.27957354018264\n1569936600,297.74,304.55,284.82,303.33,302.37872686010127\n1572615000,304.92,315.48,304.74,314.31,311.9248727509941\n1575297000,314.59,323.8,307.13,321.86,320.8350203670924\n1577975400,323.54,332.95,320.36,321.73,323.8376109506672\n1580740200,323.35,339.08,285.54,296.26,306.3677496343946\n1583159400,298.21,313.84,218.26,257.75,271.2072092211121\n1585747800,247.98,294.88,243.9,290.48,279.5700443965625\n1588339800,285.31,306.84,276.37,304.32,294.257217130722\n1591018200,303.62,323.41,296.74,308.36,304.0750296500606\n1593610200,309.57,327.23,309.07,326.52,321.04711628036233\n1596461400,328.32,351.3,327.73,349.31,343.9078129178947\n1598967000,350.21,358.75,319.8,334.89,342.5102203212502\n1601559000,337.69,354.02,322.6,326.54,334.5380578720815\n1604327400,330.2,364.38,327.24,362.06,355.0951739581686\n1606833000,365.57,378.46,362.03,373.88,371.5648545524508\n1609770600,375.31,385.85,364.82,370.07,374.7048276412935\n1612189800,373.72,394.17,370.376,380.36,381.8439748298878\n1614609000,385.59,398.12,371.88,396.33,394.927025264703\n1617283800,398.4,420.72,398.18,417.3,414.0901811684573\n1620048600,419.43,422.815,404,420.04,422.81365452616643\n1622554200,422.57,428.78,414.7,428.06,430.5054453505979\n1625146200,428.87,441.8,421.97,438.51,439.59607167918347\n1627911000,440.34,453.07,436.1,451.56,451.243002750508\n1630503000,452.56,454.05,428.78,429.14,439.0624863289485\n1633095000,430.98,459.56,426.36,459.25,453.76536059920005\n1635773400,460.3,473.54,455.3,455.56,456.8460735747673\n1638369000,461.64,479,448.92,474.96,470.9286993369564\n1641220200,476.3,479.98,420.76,449.91,458.5194074184304\n1643725800,450.68,458.12,410.64,436.63,442.9471634467761\n1646145000,435.04,462.07,415.12,451.64,446.70584273177997\n1648819800,453.31,457.83,411.21,412,420.8345512140603\n1651498200,412.07,429.66,380.54,412.93,410.83639758479205\n1654090200,415.17,417.44,362.17,377.25,382.689569175068\n1656682200,376.56,413.03,371.04,411.99,396.56566044865343\n1659360600,409.15,431.73,395.04,395.18,392.59749461493243\n1662039000,392.89,411.73,357.04,357.18,365.1969439427914\n1664803800,361.08,389.52,348.11,386.21,374.9777944578666\n1667309400,390.14,407.68,368.79,407.68,395.86188428532466\n1669905000,408.77,410.49,374.77,382.43,387.7483963876542\n1672756200,384.37,408.16,377.831,406.48,401.09584912313227\n1675261800,405.211,418.31,393.64,396.26,399.66032062874785\n1677681000,395.41,409.7,380.65,409.39,407.87273765262415\n1680528600,408.85,411.92,405.678,409.61,411.19011420710535\n"
  },
  {
    "path": "Tests/TestData/spy_tr.txt",
    "content": "Date,Open,High,Low,Close,Volume,TR\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,3.86000000000001\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,1.47\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,2.57000000000002\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,1.46000000000001\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,1.93000000000001\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,1.39999999999998\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,1.78\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,0.759999999999991\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.47999999999999\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,0.990000000000009\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,0.909999999999997\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0.889999999999986\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.890000000000015\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.900000000000006\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,1.41999999999999\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,1.63000000000002\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,1.91999999999999\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,1.33999999999997\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,1.59\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,1.23999999999998\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,1.92000000000002\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,1.28\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,1.24000000000001\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,1.09999999999999\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,1.24000000000001\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,1.16\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,2.21000000000001\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,1.07999999999998\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,2.09\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,1.47\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,1.34\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,2.12\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,1.17000000000002\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,1.27000000000001\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,3.70000000000002\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,2.37\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,3.13\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,1.85999999999999\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,1.43000000000001\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,1.78999999999999\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,1.76000000000002\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0.760000000000019\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1.39000000000001\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.870000000000005\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,1.41\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,1.10999999999999\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,1.58000000000001\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,1.60999999999999\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,2.13\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.639999999999986\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.980000000000018\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,1.05999999999997\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1.22999999999999\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,1.04000000000002\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,0.990000000000009\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1.81\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1.53999999999999\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1.27000000000001\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1.69999999999999\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.969999999999999\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1.30000000000001\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,3.90000000000001\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1.99000000000001\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1.47\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,2.47\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,1.96000000000001\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,1.37\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,3.18000000000001\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,1.80000000000001\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,2.37\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,2.43000000000001\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,2.49000000000001\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,2.22\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,1.03\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,2.06\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,2.78999999999999\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,3.19999999999999\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,1.75999999999999\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,2.03999999999999\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1.55000000000001\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,2.50999999999999\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,4.47\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,2.28999999999999\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,3.34\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,2.10999999999999\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,1.93000000000001\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,1.68000000000001\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,1.53999999999999\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,2.06\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,1.80000000000001\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1.55000000000001\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1.80000000000001\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,1.36999999999998\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,1.38000000000002\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,1.12\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,2.42000000000002\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0.800000000000011\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0.879999999999995\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,1.29000000000002\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,0.95999999999998\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,1.32000000000002\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.919999999999987\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.730000000000018\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.780000000000001\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,1.68000000000001\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,1.14000000000001\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,1.63999999999999\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,1\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,1.09\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1.35999999999999\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,2.09999999999999\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.919999999999987\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.610000000000014\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,1.34999999999999\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,1.17999999999998\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,1.25\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,1.38\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.930000000000007\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,1.49000000000001\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,1.10000000000002\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,2.65000000000001\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,1.13\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,1.45000000000002\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,1.42999999999998\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,1.84\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,1.74000000000001\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,1.06\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,1.41000000000003\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,2.78999999999999\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,1.44\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,1.63999999999999\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,1.36000000000001\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1.93000000000001\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1.89000000000001\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.670000000000016\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,2.5\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1.69\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1.27000000000001\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1.05000000000001\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,0.840000000000003\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0.719999999999999\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1.91\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.800000000000011\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,2.94\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1.00999999999999\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,2.17999999999998\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1.33000000000001\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,1.31999999999999\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,1.09\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,1.13\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,1.22\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,1.75999999999999\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,1.5\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,1.50999999999999\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,2.34\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,1.53\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,1.63999999999999\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,2.25999999999999\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,1.66999999999999\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,3.66\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,1.54999999999998\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,2\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,1.68000000000001\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,2.46000000000001\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1.97999999999999\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1.28999999999999\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,0.740000000000009\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,1.53\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1.44999999999999\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0.860000000000014\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,0.849999999999994\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.77000000000001\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1.01000000000002\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,1.84999999999999\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,1.35999999999999\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,1.39000000000001\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.917500000000018\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,1.26000000000002\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,1.22999999999999\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,2.88\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,2.46000000000001\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.620000000000005\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.990000000000009\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,2.31999999999999\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,1.16999999999999\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.849999999999994\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,1.47999999999999\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,1.15000000000001\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,1.95000000000002\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,1.58000000000001\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,1.06\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.799999999999983\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.819999999999993\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.590000000000003\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0.949999999999989\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,1.18000000000001\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,1.36000000000001\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,2.13\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.969999999999999\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,2.17000000000002\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0.72999999999999\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.77000000000001\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,2.34999999999999\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,1.10000000000002\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.889999999999986\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,1.69999999999999\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,1.16\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,4.41\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.989999999999981\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,1.42000000000002\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,1.07999999999998\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.47999999999999\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,1.03\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0.52000000000001\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0.439999999999998\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0.870000000000005\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,2.21000000000001\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.969999999999999\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,1.47999999999999\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,1.42999999999998\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.940000000000026\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,1.34\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,1.21000000000001\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,2.84\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,2.09\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,1.27000000000001\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.829999999999984\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,1.13\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,1.72\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.659999999999997\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,2.48000000000002\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,3.95999999999998\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,2.40000000000001\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,1.29000000000002\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,2.19\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,2.46000000000001\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,2.37\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,4.53999999999999\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,1.72999999999999\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,1.84999999999999\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,2.31\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,2.39000000000001\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0.859999999999985\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,2.43000000000001\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,1.12\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,2.36999999999998\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,1.69000000000003\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0.840000000000003\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,2.07999999999998\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,1.92000000000002\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,1.08999999999997\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,2.26000000000002\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,1.36000000000001\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,1.26999999999998\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,1.5\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,2.09999999999999\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,2.53999999999999\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,3\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.620000000000005\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0.860000000000014\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,1.53\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,1.17999999999998\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,1.91\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,1.44999999999999\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,3.33000000000001\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,1.36000000000001\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,2.11000000000001\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,1.57999999999998\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,2.47\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,1.97\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,2.99000000000001\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,2.44999999999999\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,1.66999999999999\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,2.42000000000002\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,1.44\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,1.83999999999997\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,1.81\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,1.35000000000002\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.990000000000009\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,1.16999999999999\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,3.59999999999999\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,2.44\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,1.81\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,2.09\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,4.23999999999998\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,2.10999999999999\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,1.93000000000001\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,2.82000000000002\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,1.94\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,1.34999999999999\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.889999999999986\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,1.36000000000001\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.619999999999976\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,1.45999999999998\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,1.96000000000001\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,2.72999999999999\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,1.16\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,1.31999999999999\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,1.11000000000001\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,1.35999999999999\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,1.93000000000001\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,1.67999999999998\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,1.96000000000001\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,1.97\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,1.20999999999998\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,1.91999999999999\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.649999999999977\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,1.17000000000002\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,2.58000000000001\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,1.41\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,1.36999999999998\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,1.67000000000002\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,1.66999999999999\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,1.11999999999998\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.889999999999986\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,1.23000000000002\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0.759999999999991\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,1.06999999999999\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.77000000000001\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,1.02000000000001\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.650000000000006\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1.04000000000002\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1.95000000000002\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.980000000000018\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.880000000000024\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.719999999999999\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,1.12\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,1.80999999999997\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,1.01999999999998\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,1.03999999999999\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,1.16\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,1.97\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.799999999999983\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.780000000000001\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0.530000000000001\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,2.02000000000001\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,1.53\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,1.5\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,1\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.629999999999995\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,1.91\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.519999999999982\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,1.06\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.97999999999999\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,1.75\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,1.04999999999998\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,2.06\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.969999999999999\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,1.25\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,1.73999999999998\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,1.03\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,2.66999999999999\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,2.19999999999999\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,1.28\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,1.22\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.75\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.610000000000014\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,1.31999999999999\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,1.47\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,1.53\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,1.75\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,4.00999999999999\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,2.19\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,2.25\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,2.57999999999998\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,1.80999999999997\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,2.57999999999998\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,2.42000000000002\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,1.41999999999999\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,1.21000000000001\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,1.53\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.919999999999987\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,2.34\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,1.72999999999999\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,1.17999999999998\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,1.07999999999998\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.840000000000003\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,0.949999999999989\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,1.44\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0.620000000000005\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0.629999999999995\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.880000000000024\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.909999999999997\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,1.13\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,1.19\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,1.92000000000002\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,1.78\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,1.21000000000001\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,1.68000000000001\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,1.42999999999998\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,1.21000000000001\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,1.74000000000001\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.939999999999998\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,2.34\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,1.93000000000001\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,1.09999999999999\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,1.61000000000001\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,1.97\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,1.31\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,2.16999999999999\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,3.28999999999999\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,2.04999999999998\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,1.84999999999999\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,1.69\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,3.11000000000001\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,2.70000000000002\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,2.56\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,2.01999999999998\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,3.06999999999999\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,4.55999999999997\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,4.05999999999997\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,3.16\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,3.84999999999999\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,2.78\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,5.78\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,4.69000000000003\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,3.47999999999999\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,2.38\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,3.89999999999998\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,2.29999999999998\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,3.50999999999999\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,2\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,1.41999999999999\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,2.25999999999999\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,2.31999999999999\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,2.21000000000001\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,2.44\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,1.14999999999998\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,1.71000000000001\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,1.52000000000001\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,1.62\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.989999999999981\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.909999999999997\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.659999999999997\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.930000000000007\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,1.62\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.77000000000001\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.930000000000007\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,1.54999999999998\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,1.25\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,1.53\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,2.25999999999999\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.70999999999998\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.989999999999981\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.72999999999999\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0.960000000000008\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,1.81999999999999\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,1.58000000000001\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,1.06\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,1.56\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.919999999999987\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,2.19\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,2.70000000000002\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,3.53999999999999\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,3.03\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,3.34\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,3.75\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,4.53999999999999\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,4.43000000000001\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,11.18\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,1.72\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,1.00999999999999\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,0.829999999999984\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,0.620000000000005\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,1.07999999999998\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.830000000000013\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,1.21000000000001\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,2.80000000000001\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,2.69999999999999\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,4.08000000000001\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,3.87\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,2.90000000000001\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,3.84999999999999\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,2.91\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,2.68000000000001\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,4.97\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,3.51000000000002\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,3.13\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,3.26999999999998\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,2.55000000000001\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,2.72\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,3.92999999999998\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,1.28999999999999\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,1.71000000000001\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,3.70999999999998\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,4.38\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,3.62\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,3.03999999999999\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,4.16999999999999\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,2.93000000000001\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,1.87\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,2.24000000000001\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,2.32000000000002\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1.50999999999999\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,2.49000000000001\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,1.61999999999998\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,2.06\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,1.08000000000001\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,1.22\n"
  },
  {
    "path": "Tests/TestData/spy_trima.txt",
    "content": "Date,Open,High,Low,Close,Volume,TRIMA_5,TRIMA_6\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,150.597777777778,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,151.122222222222,150.9175\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,151.756666666667,151.395\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,152.398888888889,152.094166666667\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,153.074444444444,152.775\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,153.844444444444,153.436666666667\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,154.444444444444,154.11\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,154.948888888889,154.6875\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,155.346666666667,155.140833333333\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,155.667777777778,155.4775\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,155.896666666667,155.776666666667\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,156.042222222222,155.960833333333\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,156.033333333333,155.9925\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,155.711111111111,155.809166666667\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,155.356666666667,155.555833333333\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,155.037777777778,155.239166666667\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,155.064444444444,155.0825\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,155.024444444444,155.040833333333\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,155.255555555556,155.163333333333\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,155.442222222222,155.385833333333\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.902222222222,155.669166666667\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,156.143333333333,156.0025\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,156.388888888889,156.235833333333\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,156.283333333333,156.3\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,156.172222222222,156.205\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.806666666667,155.983333333333\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.71,155.790833333333\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.733333333333,155.7925\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,156.331111111111,156.1025\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,157.151111111111,156.799166666667\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,158.1,157.585\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,158.264444444444,158.000833333333\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,157.9,157.975833333333\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,156.897777777778,157.395\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.181111111111,156.561666666667\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,155.447777777778,155.863333333333\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,155.242222222222,155.401666666667\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,155.55,155.550833333333\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,156.338888888889,155.981666666667\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,157.271111111111,156.769166666667\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,157.85,157.506666666667\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,158.32,158.059166666667\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,158.657777777777,158.508333333333\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,158.948888888888,158.765\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,159.132222222222,159.020833333333\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,159.374444444444,159.299166666667\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,160.001111111111,159.7725\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,160.894444444444,160.48\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,161.818888888888,161.314166666667\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,162.476666666666,162.099166666667\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,162.907777777777,162.66\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,163.142222222222,163\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,163.515555555555,163.371666666667\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,164.099999999999,163.8775\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,164.862222222222,164.465833333333\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,165.553333333333,165.18\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,166.033333333333,165.765833333333\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,166.516666666666,166.278333333333\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,166.697777777777,166.556666666667\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,166.624444444444,166.569166666667\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,166.14111111111,166.359166666667\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,165.81111111111,166.0275\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,165.619999999999,165.760833333333\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.693333333333,165.660833333334\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,165.408888888888,165.478333333334\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,165.053333333332,165.1925\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,164.387777777777,164.736666666667\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,163.796666666666,164.055833333333\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,163.122222222221,163.4775\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,162.837777777777,163.075\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,163.187777777777,163.155833333333\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,163.758888888888,163.449166666667\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,163.853333333332,163.623333333333\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,163.489999999999,163.645\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,163.094444444443,163.379166666667\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,163.336666666666,163.306666666667\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,163.814444444443,163.615833333333\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,164.313333333332,163.996666666667\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,163.953333333332,163.950833333333\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,162.682222222221,163.125\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,160.67111111111,161.639166666667\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,159.127777777776,160.061666666667\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,158.444444444443,158.993333333333\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,158.917777777776,158.815833333333\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,159.688888888888,159.325\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,160.476666666665,160.005\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,160.832222222221,160.606666666667\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,161.077777777776,160.945\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,161.372222222221,161.2675\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,161.956666666665,161.716666666667\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,162.873333333332,162.475833333333\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,163.846666666665,163.344166666667\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,164.903333333332,164.365\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,165.796666666665,165.355833333333\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,166.777777777776,166.2725\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,167.379999999998,167.015\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,167.766666666665,167.503333333334\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,167.904444444443,167.853333333333\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,168.216666666665,168.094166666667\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,168.652222222221,168.4575\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,169.037777777776,168.806666666667\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,169.167777777776,169.041666666667\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,169.062222222221,169.091666666667\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,168.923333333332,169.01\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,168.864444444443,168.911666666667\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,168.83111111111,168.839166666667\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,168.756666666665,168.780833333334\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,168.904444444443,168.8975\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,169.352222222221,169.205\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,170.065555555554,169.706666666667\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,170.445555555554,170.164166666667\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,170.366666666665,170.301666666667\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,169.966666666665,170.1675\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.623333333332,169.8325\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.468888888887,169.569166666667\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.393333333332,169.4375\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.301111111109,169.333333333334\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,168.913333333332,169.036666666667\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,168.126666666665,168.430833333334\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,166.962222222221,167.51\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,166.012222222221,166.57\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,165.341111111109,165.751666666667\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,165.254444444443,165.355833333334\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,165.37222222222,165.3775\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,165.791111111109,165.585833333334\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,165.763333333332,165.6725\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,165.318888888887,165.425833333334\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,164.511111111109,164.94\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,164.04222222222,164.360833333334\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,163.927777777776,164.049166666667\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,164.19222222222,164.095\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,164.677777777776,164.485833333334\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,165.293333333332,164.9875\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,165.94222222222,165.605833333334\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,166.657777777776,166.335\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,167.563333333331,167.151666666667\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,168.406666666665,167.940833333334\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,168.977777777776,168.611666666667\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,169.276666666665,169.115833333334\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,169.664444444443,169.516666666667\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,170.414444444442,170.1175\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,171.335555555554,170.884166666667\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,171.98222222222,171.545833333334\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,171.868888888887,171.770833333334\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,171.124444444442,171.416666666667\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,170.23222222222,170.718333333334\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,169.659999999998,170.029166666667\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,169.377777777776,169.548333333333\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.167777777776,169.250833333333\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,168.945555555553,169.064166666667\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,168.82222222222,168.92\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,168.769999999998,168.795\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,168.706666666665,168.718333333333\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,168.418888888887,168.525\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,167.936666666665,168.130833333333\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,167.138888888887,167.495\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,166.728888888887,167.041666666667\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,167.087777777776,167.1325\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,168.405555555553,167.846666666667\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,169.588888888887,168.879166666667\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,170.44222222222,169.9175\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,170.955555555553,170.7475\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,171.931111111109,171.523333333333\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,172.964444444442,172.449166666667\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,173.987777777776,173.406666666667\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,174.509999999998,174.189166666667\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,174.856666666664,174.643333333334\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,175.019999999998,174.948333333334\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,175.347777777776,175.209166666667\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,175.816666666664,175.623333333334\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,176.263333333331,176.003333333334\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,176.476666666664,176.301666666667\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,176.358888888887,176.381666666667\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,176.263333333331,176.338333333334\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,176.269999999998,176.306666666667\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,176.489999999998,176.391666666667\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,176.438888888887,176.398333333334\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,176.447777777775,176.445\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,176.366666666664,176.464166666667\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,176.72222222222,176.5725\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,177.085555555553,176.93\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,177.648888888886,177.365\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,178.329999999997,178.045\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,179.005555555553,178.6425\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,179.437777777775,179.129166666667\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,179.351111111108,179.321666666667\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,179.203333333331,179.2975\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,179.279999999997,179.335\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,179.772222222219,179.5725\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,180.295555555553,180.005833333334\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,180.655555555553,180.424166666667\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,180.816666666664,180.725\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,180.875555555553,180.833333333334\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,180.747777777775,180.763333333334\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,180.437777777775,180.561666666667\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,179.967777777775,180.196666666667\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.782222222219,179.943333333334\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,179.92333333333,179.943333333334\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,180.442222222219,180.2\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,180.582222222219,180.404166666667\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,180.17333333333,180.236666666667\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.269999999997,179.71\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,178.668888888886,179.074166666667\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,178.488888888886,178.666666666667\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.001111111108,178.830833333334\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,179.709999999997,179.404166666667\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,180.684444444441,180.178333333334\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,181.352222222219,180.978333333334\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,181.927777777774,181.599166666667\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,182.434444444441,182.221666666667\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,182.995555555552,182.711666666667\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,183.495555555552,183.206666666667\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,183.834444444441,183.651666666667\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,183.92333333333,183.828333333334\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,183.808888888885,183.816666666667\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,183.342222222219,183.536666666667\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,183.041111111107,183.233333333334\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,182.915555555552,183.060833333334\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,183.191111111107,183.073333333334\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,183.477777777774,183.335\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,183.488888888885,183.396666666667\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,183.361111111107,183.4075\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,183.217777777774,183.355\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,183.583333333329,183.475833333334\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.941111111107,183.746666666667\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,184.187777777774,183.975\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,184.116666666663,184.15\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.956666666663,184.026666666667\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,183.262222222218,183.465833333334\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,181.882222222218,182.420833333334\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,180.182222222218,181.075833333334\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,178.898888888885,179.6725\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,178.449999999996,178.811666666667\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,178.315555555552,178.400833333334\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,177.998888888885,178.035\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,177.118888888885,177.476666666667\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,176.003333333329,176.565833333334\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,175.608888888885,176.005\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,176.119999999996,176.0675\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,177.503333333329,176.854166666667\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,179.018888888885,178.266666666667\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,180.322222222218,179.6025\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,181.421111111107,180.83\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,182.246666666662,181.824166666667\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,183.047777777773,182.624166666667\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,183.516666666662,183.225833333334\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,183.767777777773,183.584166666667\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,183.738888888885,183.743333333334\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,183.918888888884,183.879166666667\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,184.172222222218,184.075833333334\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,184.571111111107,184.345833333334\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,184.861111111107,184.720833333334\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,185.229999999995,185.059166666667\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,185.506666666662,185.346666666667\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,185.877777777773,185.700833333334\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,186.249999999995,186.100833333334\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,186.963333333329,186.646666666667\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,187.556666666662,187.238333333334\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,188.033333333329,187.7175\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,188.048888888884,187.995833333334\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,187.879999999995,187.925833333334\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,187.33444444444,187.550833333334\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,186.608888888884,186.9275\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,185.886666666662,186.304166666667\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,185.771111111106,185.969166666667\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,186.163333333328,186.049166666667\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,186.818888888884,186.461666666667\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,187.036666666662,186.831666666667\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,186.895555555551,186.8925\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,186.436666666662,186.666666666667\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,186.003333333328,186.22\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,185.612222222217,185.824166666667\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,185.289999999995,185.4625\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,185.331111111106,185.390833333334\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,185.874444444439,185.7275\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.885555555551,186.4175\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,187.849999999995,187.310833333334\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,188.201111111106,187.88\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,187.671111111106,187.765\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.568888888884,187.073333333334\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,185.748888888884,186.304166666667\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,185.301111111106,185.59\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,184.846666666662,184.955\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,183.854444444439,184.268333333334\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,183.111111111106,183.611666666667\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,183.278888888884,183.438333333334\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,184.291111111106,183.851666666667\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,185.502222222217,184.8475\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,186.397777777773,185.903333333334\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,187.027777777773,186.663333333334\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,187.429999999995,187.201666666667\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,187.457777777773,187.37\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,187.304444444439,187.343333333334\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,187.054444444439,187.221666666667\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,187.206666666662,187.2025\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,187.582222222217,187.436666666667\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,188.001111111106,187.744166666667\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,188.207777777773,188.0675\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,188.083333333328,188.094166666667\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,187.904444444439,187.985833333334\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,187.631111111106,187.79\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,187.659999999995,187.683333333334\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,187.921111111106,187.864166666667\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,188.517777777773,188.25\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,189.10555555555,188.789166666667\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,189.21555555555,189.030833333334\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,188.859999999995,188.954166666667\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,188.346666666661,188.660833333334\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,188.11555555555,188.288333333334\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,188.216666666661,188.205\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.447777777772,188.351666666667\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.973333333328,188.758333333334\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,189.644444444439,189.351666666667\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,190.419999999994,190.004166666667\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,191.108888888883,190.754166666667\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,191.661111111105,191.3675\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,192.183333333328,191.908333333334\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,192.528888888883,192.335833333334\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,192.802222222217,192.6375\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,193.078888888883,192.971666666667\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,193.594444444439,193.394166666667\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,194.318888888883,193.98\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,194.998888888883,194.619166666667\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,195.341111111105,195.090833333334\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,195.191111111105,195.1775\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,194.749999999994,194.9425\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,194.289999999994,194.559166666667\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,194.199999999994,194.321666666667\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,194.509999999994,194.431666666667\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,195.133333333327,194.846666666667\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,195.736666666661,195.406666666667\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,196.061111111105,195.8275\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,195.944444444439,195.9225\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,195.664444444439,195.805\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,195.377777777772,195.558333333334\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,195.413333333328,195.436666666667\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.504444444439,195.475\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.821111111105,195.675833333334\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,196.169999999994,196.030833333334\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,196.778888888883,196.499166666667\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,197.264444444439,196.995833333334\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,197.483333333328,197.2775\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,197.306666666661,197.351666666667\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,196.946666666661,197.121666666667\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,196.737777777772,196.8825\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,196.702222222217,196.765833333334\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,196.89555555555,196.813333333334\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,197.197777777772,197.070833333334\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,197.236666666661,197.14\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,197.229999999994,197.209166666667\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,197.004444444439,197.1525\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,197.26555555555,197.190833333334\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,197.576666666661,197.464166666667\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,198.102222222217,197.806666666667\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,198.297777777772,198.160833333334\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,198.296666666661,198.2375\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,197.961111111105,198.095\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.596666666661,197.781666666667\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,196.802222222217,197.115833333334\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,195.702222222217,196.149166666667\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,194.341111111105,195.066666666667\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,193.383333333328,193.955833333334\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,192.872222222217,193.201666666667\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,192.386666666661,192.58\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,192.157777777772,192.318333333334\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,192.167777777772,192.29\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,192.773333333328,192.505833333334\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,193.419999999995,193.093333333334\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,194.094444444439,193.7425\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.734444444439,194.430833333334\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,195.476666666661,195.120833333334\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,196.292222222217,195.896666666667\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,197.219999999995,196.775\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,198.10555555555,197.649166666667\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,198.787777777773,198.38\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,199.256666666661,198.998333333334\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,199.579999999995,199.419166666667\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,199.932222222217,199.75\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,200.13555555555,200.009166666667\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,200.288888888884,200.193333333334\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,200.364444444439,200.338333333334\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,200.486666666662,200.425\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,200.511111111106,200.475\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,200.551111111106,200.535\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,200.561111111106,200.5725\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,200.527777777773,200.505833333334\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,200.323333333328,200.394166666667\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,200.076666666662,200.216666666667\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.907777777773,200.015833333334\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.733333333328,199.798333333334\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.611111111106,199.6825\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,199.689999999995,199.725833333334\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.205555555551,200.021666666667\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.725555555551,200.426666666667\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.887777777773,200.683333333334\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,200.311111111106,200.4875\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,199.583333333328,199.96\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,198.721111111106,199.180000000001\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,198.269999999995,198.524166666667\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,197.721111111106,198.017500000001\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,197.559999999995,197.662500000001\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,197.016666666662,197.245833333334\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,196.346666666662,196.575000000001\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,195.545555555551,196.030833333334\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,195.35444444444,195.591666666667\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,195.389999999995,195.355\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,195.49444444444,195.391666666667\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,194.988888888884,195.174166666667\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,194.305555555551,194.568333333334\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,192.583333333329,193.286666666667\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,190.695555555551,191.575\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,188.653333333329,189.816666666667\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,187.509999999996,188.19\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,187.012222222218,187.396666666667\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,187.401111111107,187.345833333334\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,188.783333333329,188.2875\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,190.548888888885,189.675833333334\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,192.398888888885,191.385833333334\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,193.64444444444,192.97\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,194.806666666663,194.193333333334\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,195.841111111107,195.355\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,196.799999999996,196.270833333334\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,197.731111111107,197.258333333334\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,198.636666666663,198.2275\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,199.762222222218,199.211666666667\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,200.717777777774,200.196666666667\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,201.387777777774,200.970000000001\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,201.804444444441,201.5875\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,202.285555555552,202.089166666667\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,202.87333333333,202.586666666667\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,203.422222222219,203.113333333334\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,203.787777777774,203.576666666667\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,203.994444444441,203.868333333334\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,204.09333333333,204.028333333334\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,204.168888888885,204.136666666667\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,204.372222222219,204.306666666667\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,204.677777777774,204.540833333334\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,205.072222222219,204.870833333334\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,205.441111111108,205.260833333334\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,205.927777777774,205.7075\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,206.449999999997,206.2\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,206.95333333333,206.671666666667\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,207.22333333333,207.044166666667\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,207.17333333333,207.134166666667\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,206.955555555552,207.050833333334\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,206.821111111108,206.945\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,207.047777777775,207.0025\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,207.436666666664,207.248333333334\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,207.606666666664,207.433333333334\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,207.43333333333,207.461666666667\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,206.621111111108,206.928333333334\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.682222222219,206.1175\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,204.255555555553,204.948333333334\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,202.961111111108,203.574166666667\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,201.237777777775,202.08\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,200.234444444442,200.8625\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,200.444444444442,200.715833333334\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,202.308888888886,201.590833333334\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,204.704444444442,203.4625\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,206.399999999997,205.34\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,207.277777777775,206.715833333334\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,207.63222222222,207.455\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.986666666664,207.801666666667\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,208.183333333331,208.053333333334\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,207.949999999998,207.959166666667\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,207.243333333331,207.51\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,205.90222222222,206.49\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,204.247777777776,205.0075\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,202.61222222222,203.506666666667\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,202.094444444442,202.628333333334\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,202.704444444442,202.609166666667\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,203.698888888887,203.095\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,203.804444444442,203.5225\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,203.041111111109,203.319166666667\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,201.836666666665,202.444166666667\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,201.006666666664,201.503333333334\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,200.685555555553,200.98\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,201.218888888887,201.0775\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,202.298888888887,201.85\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,203.571111111109,202.903333333334\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,204.655555555553,204.055\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,204.869999999998,204.588333333334\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,204.223333333331,204.346666666667\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,202.928888888887,203.573333333333\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,201.64222222222,202.328333333333\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,201.089999999998,201.511666666667\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,201.238888888887,201.335\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,202.265555555554,201.830833333333\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,203.561111111109,202.950833333333\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,204.618888888887,203.981666666667\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,205.227777777776,204.8225\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,205.446666666665,205.336666666667\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,205.739999999998,205.615833333333\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,206.446666666665,206.193333333333\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,207.406666666665,206.970833333333\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,208.566666666665,207.955833333333\n"
  },
  {
    "path": "Tests/TestData/spy_trix.txt",
    "content": "time,open,high,low,close,TRIX_5\n725898600,43.9688,43.96899,43.75,43.938,NaN\n728577000,43.96875,45.125,42.8125,44.40625,NaN\n730996200,44.5625,45.84375,44.21875,45.1875,NaN\n733674600,45.25,45.25,43.28125,44.03125,NaN\n736435800,44.09375,45.65625,43.84375,45.21875,NaN\n738941400,45.375,45.8125,44.21875,45.0625,NaN\n741533400,45.125,45.21875,44.15625,44.84375,NaN\n744298200,44.90625,46.5625,44.84375,46.5625,NaN\n746890200,46.40625,46.59375,44.8125,45.9375,NaN\n749482200,45.875,47.15625,45.71875,46.84375,NaN\n752164200,46.78125,47,45.53125,46.34375,NaN\n754756200,46.59375,47.15625,46.375,46.59375,NaN\n757607400,46.59375,48.3125,46.40625,48.21875,NaN\n760113000,48.15625,48.28125,46.5625,46.8125,0.6114294465186841\n762532200,46.8125,47.3125,43.53125,44.59375,0.33371555416091064\n765210600,43.34375,45.35937,43.34375,45.09375,0.09168598435321723\n767885400,45.09375,45.9375,44.17187,45.8125,-0.02275936591463139\n770477400,45.70312,46.5625,44,44.46875,-0.17730485115373623\n773069400,44.6875,46.04687,44.375,45.90625,-0.1817964575684071\n775747800,45.9375,47.98437,45.65625,47.65625,0.007513582072526035\n778426200,47.5,47.71875,45.73437,46.17187,0.08529716197268983\n781191000,46.20312,47.70312,45,47.48437,0.2123884324860226\n783700200,47.28125,47.32812,44.60937,45.59375,0.16053618116656582\n786292200,45.64062,46.40625,44.6875,45.5625,0.06107291256402999\n789057000,45.70312,47.23437,45.6875,47.09375,0.09412542882861737\n791649000,47.15625,49.15625,47,49.01562,0.3083818856862279\n794068200,48.96875,50.89062,48.21875,50.10937,0.5953668625101395\n796915800,50.09375,51.67187,50.0625,51.59375,0.9218397804959376\n799335000,51.54687,53.64062,51.39062,53.64062,1.2959125418901702\n802013400,53.40625,55.15625,52.75,54.40625,1.5874405913975769\n804778200,54.46875,56.70312,54.20312,56.15625,1.8431363581213467\n807283800,56.23437,56.79687,55.42187,56.40625,1.9589330597054406\n809962200,56.39062,58.90625,56.34375,58.48437,2.075028500317331\n812640600,58.48437,59.1875,57.26562,58.3125,2.058862803205251\n815236200,58.28125,61.20312,58.23437,60.90625,2.1089011693049553\n817828200,60.98437,62.79687,60.57812,61.48437,2.1145286373625938\n820506600,61.40625,63.6875,59.64062,63.67187,2.1664613600849414\n823185000,63.60937,66.6875,63.4375,63.875,2.1386701150580416\n825690600,64.64062,66,62,64.6875,2.0604380558873396\n828369000,65,65.8125,62.125,65.39062,1.9497351149127575\n830957400,65.375,68.4375,63.07812,66.875,1.8736452441765314\n833808600,66.89062,68.5,66.15625,67.10937,1.7656656321434638\n836227800,67.28125,67.70312,60.375,64.09375,1.4250916909387745\n838906200,64.15625,67.34375,64.0625,65.32812,1.130620709310255\n841671000,64.46875,69.25,64.375,68.625,1.0784990817103777\n844176600,68.70312,71.625,68.4375,70.84375,1.1955661309621066\n846858600,70.98437,76.6875,70.26562,76.01562,1.578139217058213\n849537000,75.92187,76.57812,71.875,73.84375,1.7411267807442046\n852129000,74.375,79.6875,72.75,78.40625,1.9790778821824624\n854980200,78.71875,82,77.125,79.15625,2.128423977735903\n857399400,78.75,81.79687,75.6875,75.6875,1.9361297680244232\n859905000,75.25,80.6875,73.3125,80.09375,1.85588972288514\n862493400,80.21875,85.5625,79.3125,85.15625,2.012916197681396\n865258200,85.34375,90.5,84.07812,88.3125,2.2656385984050065\n867763800,88.5,96.03125,88.39062,95.3125,2.7208299671581115\n870442200,95.5,96.625,89.34375,90.375,2.7414326701377076\n873120600,90.6875,96.375,90.25,94.375,2.7079567368168393\n875712600,95.25,98.5,84.375,92.0625,2.4477735188607213\n878567400,93.1875,96.8125,90.09375,95.625,2.2566767524094513\n880986600,96.21875,99,92.375,97.0625,2.106452342673051\n883665000,97.3125,99.5625,90.90625,98.3125,1.9753762671204855\n886429800,99.90625,105.53125,99.71875,105.125,2.0888821925279206\n888849000,105.25,111.53125,103.15625,109.9375,2.3460169386459517\n891441000,110.3125,113.4375,107.625,111.34375,2.524274509651534\n894029400,111.75,113.3125,107.57812,109.03125,2.4309502443306945\n896707800,108.96875,114.6875,107.5,113.3125,2.3510151002922552\n899299800,114.0625,119.23437,111.3125,111.78125,2.1413618349111534\n902151000,111.78125,112.42187,95,96,1.2934800338113281\n904656600,96.0625,107,93.625,101.75,0.6584788900729828\n907248600,100.03125,110.90625,92.21875,110,0.5201998136879452\n910017000,110.8125,119.71875,110.1875,116.125,0.7584599353141146\n912522600,116.125,124.75,113.75,123.3125,1.2650412322261595\n915201000,123.375,128.29687,120.375,127.65625,1.8086060392768875\n917879400,128.6875,128.84375,121.32812,123.5625,1.9934686785814277\n920298600,123.65625,132.625,121.78125,128.375,2.104224414209039\n922977000,129.6875,137.5,128.125,133.25,2.23467493001622\n925738200,133.4375,138,128,130.20312,2.1409849801102783\n928243800,130.125,137.5,128.01562,137,2.1370096567758003\n930835800,137,142.25,132.5625,132.75,1.9384353322024377\n933600600,132.75,138.78125,127,132.0625,1.6422494806082781\n936192600,132.9375,136.625,125.5625,128.75,1.2370202063727531\n938784600,127.9375,137.6875,123.4375,137,1.1051525537705522\n941466600,136.5,143,134.59375,139.39062,1.1117462921044252\n944058600,139.3125,147.5625,139,146.875,1.326326830916074\n946909800,148.25,148.25,135,139.625,1.2821134735618536\n949415400,139.75,144.5625,132.71875,137.4375,1.0649230649728827\n951921000,137.625,155.75,135.03125,150.375,1.1737932166347855\n954768600,150.125,153.10937,133.5,145.09375,1.1542689613056976\n957187800,146.5625,148.48437,136.5,142.8125,0.9964071731831934\n959866200,143.6875,149.15625,143,145.28125,0.8691905991433301\n962631000,145.4375,151.98437,141.51562,142.90625,0.688227747813806\n965136600,143.625,153.09375,142.625,152.34375,0.7622417357267247\n967815000,153.25,153.59375,142.125,143.625,0.6323380900491002\n970493400,144.28125,145.75,130.15625,142.95312,0.4367195413496418\n973089000,142.25,144.29687,129.75,132.28125,-0.018642350433243277\n975681000,133.1875,139.5625,125.53125,131.1875,-0.4600324358520347\n978445800,132,138.7,127.5625,137.02,-0.6183888672479586\n981037800,137.10001,137.99001,121.8,123.95,-0.971613012096338\n983457000,124.05,127.75,108.03999,116.69,-1.455253435927837\n986218200,116.3,127.27,109.3,124.91,-1.5947475472362902\n988723800,125.07001,132.09,123.44,125.95,-1.511761380818767\n991402200,126.2,129.23,120.39999,122.60001,-1.4200203889789507\n994080600,122.8,124.32001,116.75,121.35001,-1.334457131103495\n996672600,121.97,123.25,112.03999,114.14999,-1.4305597046764407\n999610200,113.85001,116.17,93.8,104.44,-1.7918668068379737\n1001943000,103.89999,111.78999,102.83,105.8,-2.052779245029643\n1004625000,106.60001,116.89999,105.69901,114.05,-1.907704677470443\n1007389800,113.64999,118,112,114.3,-1.5959020057080378\n1009981800,115.11,117.99001,108.39999,113.17999,-1.2865298837448866\n1012573800,113.09,113.3,107.82001,111.14999,-1.0730878613828934\n1014993000,111.72,117.907,111.50999,114.52,-0.7978203123761267\n1017671400,114.23,115.10001,106.63,107.86,-0.7574430402883127\n1020259800,107.97,111.25,104.89999,107.22,-0.7930716268094581\n1023111000,107.09,107.60001,95.19501,98.96001,-1.0839243066296267\n1025530200,99.187,99.8,77.67999,91.16,-1.6011367780864334\n1028208600,90.88,97.14999,83.55,91.78,-1.9921594240673586\n1031059800,90.735,93.33,80.00999,81.78999,-2.5291378774514324\n1033479000,82.438,91.28999,77.07001,88.52,-2.678115848748931\n1036161000,88.35001,94.95,87.45,93.98,-2.3872540227582397\n1038839400,95.47,96.05,87.11,88.23,-2.1536241369695253\n1041517800,88.85001,93.86,84.14999,86.06,-2.0048247716151253\n1044282600,86.14,86.817,81,84.89999,-1.8972511301556596\n1046701800,85.25999,89.88,79.383,84.74001,-1.771979797013449\n1049207400,85.25,92.8,84.91,91.91,-1.3259022590242335\n1051795800,91.92,97.09,90.5,96.95,-0.6373660221992503\n1054560600,97.53,102.179,96.67,97.63,0.0027070844627138536\n1057066200,97.25301,101.89999,96.42999,99.39,0.5315645504935875\n1059744600,99.19,101.81799,96.34,101.44,0.9478040532573522\n1062509400,101.64,104.7,99.25,99.95,1.1204995472210044\n1065015000,100.24001,105.97,100.2,105.3,1.3436798599102202\n1067869800,105.75,106.95,103.62,106.45,1.510310943420317\n1070289000,106.92999,111.52,105.96001,111.28,1.7393903778226918\n1073053800,111.74001,116.5,110.73,113.48,1.9331300685805424\n1075732200,113.7,116.60001,112.78,115.02,2.038927913771611\n1078151400,115.42999,116.97,108.85001,113.10001,1.9354004965967646\n1080829800,113.07001,115.41,110.89999,110.96001,1.6474460595372493\n1083591000,111.37,113.25999,108.06,112.86,1.3891413551203584\n1086096600,112.46001,114.94,111.87,114.53,1.2125694150726223\n1088688600,114.25,114.39999,108.21001,110.84,0.9327802652041209\n1091453400,110.19,113.61,106.59,111.11,0.6722396147135706\n1094045400,110.94,113.74001,110.41,111.75999,0.4827656648316114\n1096637400,112.25999,114.67999,109.35001,113.2,0.39381660604628127\n1099319400,113.56,119.14,113.2,117.89,0.49925353171146697\n1101911400,118.16,121.66,117.73,120.87,0.7132558902476369\n1104762600,121.56,121.75999,116.37,118.16,0.7841315840011016\n1107268200,118.25,121.67,118.10001,120.63,0.8450295973730393\n1109687400,120.78,123.25,116.25,117.96001,0.7669791653766901\n1112365800,118.63,119.25999,113.55,115.75,0.5691624779862858\n1115040600,116.07001,120.25,114.8,119.48,0.4872831311233337\n1117632600,119.52,121.94,118.75,119.17999,0.4325045061427023\n1120224600,119.45,124.64,118.25999,123.74001,0.5284382822500898\n1122903000,123.83,124.74001,120.38,122.58,0.5858238142615427\n1125581400,122.50999,124.74001,120.44,123.03999,0.6086556289673862\n1128346200,122.96001,123.34,116.88,120.13,0.5011875558086843\n1130855400,120.58,127.41,120.13,125.41,0.5293921233802726\n1133447400,126.02,128.57001,124.36,124.50999,0.5414103832700282\n1136298600,125.10001,129.44,124.39,127.5,0.6166826192477428\n1138804200,127.82001,130.03999,123.64,128.23,0.6887428855467159\n1141223400,128.60001,131.47,127.17999,129.83,0.7624615310792583\n1144071000,130.07001,131.86,128.02,131.47,0.8365945918501418\n1146490200,131.47,132.8,124.75999,127.50999,0.7400372421017035\n1149168600,127.38,129.42999,122.34,127.23,0.583539324518094\n1151933400,127.42999,128.14,122.39,127.85001,0.4473866701256164\n1154439000,127.34,131.03999,126.28,130.64,0.41794144651061366\n1157117400,131.14,133.99001,129.35001,133.58,0.497290175149379\n1159795800,133.53999,139,132.34,137.78999,0.6905695228276526\n1162391400,138.22,141.16,135.62,140.53,0.9173580515142084\n1164983400,140.53,143.24001,138.97,141.62,1.0873625914523832\n1167834600,142.25,144.13,140.25,143.75,1.211794926118208\n1170340200,144.14999,146.42,139,140.92999,1.1619564012705477\n1172759400,139.34,143.81,136.75,142,1.0600203995119755\n1175520600,142.16,149.8,140.89,148.28999,1.1013461201155517\n1178026200,148.42,153.89,147.67,153.32001,1.2645034249502467\n1180704600,153.88,154.39999,148.06,150.42999,1.2894878220083208\n1183383000,150.87,156,145.03999,145.72,1.0928991117497013\n1185975000,145.17999,150.59,137,147.59,0.8931859346852578\n1188912600,147.45,154.39,144.33,152.58,0.8406769457038656\n1191245400,152.60001,157.52,148,154.64999,0.8647022093810205\n1193923800,153.28999,153.41,140.66,148.66,0.718218993457169\n1196692200,148.19,152.89,143.96001,146.21001,0.4726268503129914\n1199284200,146.53,146.99001,126,137.37,0.023504207413345163\n1201876200,137.94,139.61,131.73,133.82001,-0.4589427018067093\n1204554600,133.14,135.81,126.07001,131.97,-0.8602661024455455\n1207056600,133.71001,140.59,132.33,138.25999,-0.9483034586885551\n1209648600,138.39,144.3,137.52,140.35001,-0.8321468344247201\n1212413400,139.83,140.89,127.035,127.98,-0.9731674828229684\n1214919000,126.52,129.16,120.02,126.83,-1.1545656378497893\n1217597400,127.12,131.50999,124.75999,128.78999,-1.2126353633423277\n1220362200,130.03,130.71001,110.5321,115.99001,-1.5195653293331155\n1222867800,115.27,116.69,83.58,96.83,-2.3009379660227953\n1225722600,96.78,100.86,74.34,90.09,-3.1701062432084517\n1228141800,87.50999,92.42999,81.86,90.24001,-3.7837715465556836\n1230906600,90.44,94.5533,80.05,82.83,-4.2987075853387315\n1233585000,81.57001,87.74001,73.81,73.92999,-4.836001974567397\n1236004200,72.52,83.3,67.10001,79.52,-4.966110796714543\n1238592600,78.53,89.02,78.33,87.42,-4.5203734650516765\n1241184600,87.44,93.7,86.72,92.53,-3.6460360728911643\n1243863000,93.67,96.11,87.53,91.95,-2.721389343300247\n1246455000,92.34,99.83,87,98.81,-1.6405145256783722\n1249306200,99.85001,104.35001,98.11501,102.46001,-0.5721329098261644\n1251811800,101.95,108.06,99.57001,105.59,0.3616772830636775\n1254403800,105.34,110.31,101.99001,103.56,0.9101917463027361\n1257172200,104.13,111.74001,103.08,109.94,1.4079457458352558\n1259677800,110.92,113.03,105.476,111.44,1.7528083959376484\n1262615400,112.37,115.14,107.22,107.39,1.7320493718688375\n1265034600,108.14999,111.58,104.58,110.74001,1.669112725710029\n1267453800,111.2,118.1666,111.17,117,1.7725452500796732\n1270128600,117.8,122.12,117.10001,118.8125,1.88505702862603\n1272893400,119.38,120.67999,104.38,109.369,1.5578395708334778\n1275399000,108.35001,113.2,102.88,103.22,0.9244546683272739\n1277991000,103.14999,112.28999,101.13,110.27,0.5823852328894815\n1280755800,111.99001,113.17999,104.28999,105.31,0.22217996343390703\n1283347800,106.73,115.78999,106.66,114.13,0.242747733303656\n1285939800,114.99001,119.75999,113.17999,118.49001,0.5083769864221264\n1288618200,119.07001,122.95,117.59,118.49249,0.7556429692441121\n1291213800,120.2,126.2,120.19,125.75,1.1449888661987444\n1294065000,126.71001,130.35001,125.6969,128.67999,1.519673360034752\n1296570600,129.46001,134.69,129.3801,133.14999,1.8695632215246136\n1298989800,133.57001,133.69,125.28,132.59,2.0176004368002625\n1301664600,133.41,136.57001,129.50999,136.42999,2.1043212292083138\n1304343000,137.07001,137.17999,131.38,134.89999,2.0142377860915293\n1306935000,134.50999,134.9234,126.19,131.97,1.7293774067261836\n1309527000,132.09,135.7,127.96671,129.33,1.3221621811294393\n1312205400,130.84,130.96001,110.27,122.22,0.7320921858116303\n1314883800,122.28999,123.39999,111.3,113.14999,-0.04389865076588532\n1317648600,112.49001,129.42,107.42999,125.5,-0.31404559891641187\n1320154200,122.03,128.02,116.2,124.99001,-0.3700969066829272\n1322749800,124.85001,127.25999,120.03,125.5,-0.31950168877141993\n1325601000,127.75999,133.39999,126.42999,131.32001,-0.06715177300735975\n1328106600,132.28999,138.19,132.13,137.02,0.35036178515877947\n1330612200,137.31,141.83,134.36,140.81,0.8039035381625635\n1333373400,140.64,142.21001,135.75999,139.87,1.086174792205952\n1335879000,139.78999,141.66,129.55,131.47,0.9570989091440189\n1338557400,129.41,136.27,127.13499,136.105,0.8405103413648201\n1341235800,136.48,139.339,132.60001,137.71001,0.7715675725977998\n1343827800,138.7,143.09,135.58,141.16,0.801606556477735\n1346765400,141.03999,148.11,140.13,143.97,0.8989578120078658\n1349098200,144.52,147.16,140.39,141.35001,0.8818888288507917\n1351776600,141.64999,143.72,134.7,142.155,0.8242849944211021\n1354545000,142.8,145.58,139.53999,142.41,0.7454949135586475\n1357137000,145.11,150.94,144.73,149.7,0.8490034801999359\n1359729000,150.64999,153.28,148.73,151.61,0.9947313008754994\n1362148200,151.09,156.85001,150.41,156.67,1.2073144339847452\n1364823000,156.59,159.72,153.55,159.67999,1.4108062231862213\n1367415000,159.33,169.07001,158.10001,163.44501,1.5951321997570516\n1370266200,163.83,165.99001,155.73,160.42,1.5808607719879815\n1372685400,161.25999,169.86,160.22,168.71001,1.6577096613874545\n1375363800,169.99001,170.9725,163.05,163.64999,1.5466081825782438\n1378215000,165.23,173.60001,163.7,168.00999,1.4569511807211961\n1380634200,168.14,177.51,164.53,175.79,1.5246242818296603\n1383312600,176.02,181.75,174.76,181,1.6777592877126282\n1385994600,181.09,184.69,177.32,184.69,1.8281475852998754\n1388673000,183.98,184.94,176.88,178.18,1.7124075015153606\n1391437800,177.95,187.15,173.71,186.29,1.6662765811969473\n1393857000,184.69,189.0239,183.75,187.01,1.600140860863389\n1396359000,187.62,189.7,181.31,188.31,1.5099584499896423\n1398951000,188.22,192.8,186.01,192.68,1.469953384871749\n1401715800,192.95,196.6,191.97,195.72,1.4593735773485357\n1404221400,196.19,199.06,192.97,193.09,1.346873060598791\n1406899800,192.56,200.82,190.55,200.71,1.3380818381866184\n1409664600,200.97,201.899,196.05,197.02,1.2331367145032703\n1412170200,196.7,201.82,181.92,201.66,1.1729973837836376\n1415025000,201.92,207.87,200.06,207.2,1.2040710166603927\n1417444200,206.4,212.97,197.86,205.54,1.1723566325622836\n1420209000,206.38,206.88,198.55,199.45,0.9684951849461026\n1422887400,200.05,212.24,197.86,210.66,0.9458750123329731\n1425306600,210.78,212.06,204.12,206.43,0.8644628145258032\n1427895000,206.39,212.48,204.51,208.46,0.7924076756709393\n1430487000,209.4,213.78,206.76,211.14,0.761213645858049\n1433165400,211.94,213.34,205.28,205.85,0.6236366085701371\n1435757400,207.73,213.18,204.11,210.5,0.5529986525801049\n1438608600,210.46,211.31,182.4,197.67,0.26678273195533364\n1441114200,193.12,202.89,186.93,191.63,-0.1262237809693988\n1443706200,192.08,209.44,189.12,207.93,-0.15023141131872625\n1446474600,208.32,211.66,202.18,208.69,-0.0393189879969611\n1448980200,209.44,211,199.83,203.87,-0.002904295554281375\n1451917800,200.49,201.9,181.02,193.7208,-0.18201177727335746\n1454337000,192.53,196.68,181.09,193.56,-0.3754053648882964\n1456842600,195.01,206.87,194.4542,205.52,-0.29236022620381874\n1459517400,204.35,210.92,203.09,206.3308,-0.12209627996114918\n1462195800,206.92,210.69,202.78,209.84,0.09908917376594105\n1464787800,209.12,212.52,198.65,209.475,0.26723827090399627\n1467379800,209.36,217.54,207.06,217.12,0.5048106486925595\n1470058200,217.19,219.6,214.25,217.38,0.6847926119981951\n1472736600,217.37,219.22,212.31,216.3,0.7536921649366806\n1475501400,215.82,216.7,211.21,212.55,0.6756429729926169\n1478007000,212.93,221.82,208.38,220.38,0.6893554007255892\n1480602600,220.73,228.34,219.15,223.53,0.7548450827425369\n1483453800,225.04,229.71,223.8837,227.53,0.8584611735724993\n1485959400,228.255,237.31,226.82,236.47,1.0668177177672284\n1488378600,238.39,240.32,231.61,235.74,1.1934423971962902\n1491226200,235.8,239.53,232.51,238.08,1.2542598055738465\n1493645400,238.68,242.08,235.43,241.44,1.2860409390991638\n1496323800,241.97,245.01,239.955,241.8,1.2554582043927243\n1499088600,242.88,248,240.34,246.77,1.246995705538145\n1501594200,247.46,248.91,241.83,247.49,1.2090488656676452\n1504272600,247.92,251.32,244.95,251.23,1.1848617730906252\n1506951000,251.49,257.89,251.2926,257.15,1.2175585353158238\n1509543000,258.04,266.05,255.63,265.01,1.3313995249102566\n1512138600,264.76,268.6,260.76,266.86,1.411739494594403\n1514903400,267.84,286.6285,267.4,281.9,1.6316373332550014\n1517495400,281.07,283.06,252.92,271.65,1.60932468105231\n1519914600,271.41,280.41,257.83,263.15,1.3355643261254702\n1522675800,262.55,271.3,254.67,264.51,1.033669551652329\n1525181400,263.87,274.25,259.05,270.94,0.8574861059377101\n1527859800,272.41,279.48,268.49,271.28,0.7359256646007971\n1530538200,269.51,284.37,269.24,281.33,0.7760520248059842\n1533130200,281.56,291.74,279.16,290.31,0.9475467722320751\n1536067800,289.84,293.94,286.71,290.72,1.078641686796154\n1538400600,292.11,293.21,259.85,270.63,0.8438406118668442\n1541079000,271.6,281.22,263.07,275.65,0.6038257373381714\n1543847400,280.28,280.4,233.76,249.92,0.05481145270556705\n1546439400,245.98,270.47,243.67,269.93,-0.17327990247877526\n1549031400,270.15,281.31,267.83,278.68,-0.12371441252248415\n1551450600,280.44,285.18,272.42,282.48,0.05182788425216157\n1554125400,284.7,294.45,284.4,294.02,0.37369062845735096\n1556717400,294.72,294.95,275.24,275.27,0.3859333286154605\n1559568600,275.31,296.3093,273.09,293,0.5282486984746344\n1561987800,296.68,302.23,294.33,297.43,0.7096543018987741\n1564666200,297.6,300.87,281.72,292.45,0.7599296951666026\n1567517400,290.57,302.63,289.27,296.77,0.7863687408696921\n1569936600,297.74,304.55,284.82,303.33,0.8541774723415908\n1572615000,304.92,315.48,304.74,314.31,1.0247374815617845\n1575297000,314.59,323.8,307.13,321.86,1.2347761578324754\n1577975400,323.54,332.95,320.36,321.73,1.34719054323154\n1580740200,323.35,339.08,285.54,296.26,1.0279017370539434\n1583159400,298.21,313.84,218.26,257.75,0.15620300974171755\n1585747800,247.98,294.88,243.9,290.48,-0.2482773112255401\n1588339800,285.31,306.84,276.37,304.32,-0.23281418023544279\n1591018200,303.62,323.41,296.74,308.36,-0.037410532730834146\n1593610200,309.57,327.23,309.07,326.52,0.3883634534006019\n1596461400,328.32,351.3,327.73,349.31,1.0369240716616885\n1598967000,350.21,358.75,319.8,334.89,1.3542628724021624\n1601559000,337.69,354.02,322.6,326.54,1.3331390443671187\n1604327400,330.2,364.38,327.24,362.06,1.5933009313169977\n1606833000,365.57,378.46,362.03,373.88,1.9334978284178\n1609770600,375.31,385.85,364.82,370.07,2.0747094597899336\n1612189800,373.72,394.17,370.376,380.36,2.1502339047759325\n1614609000,385.59,398.12,371.88,396.33,2.27255160129072\n1617283800,398.4,420.72,398.18,417.3,2.5030480541323854\n1620048600,419.43,422.815,404,420.04,2.6173085970865095\n1622554200,422.57,428.78,414.7,428.06,2.636619296705875\n1625146200,428.87,441.8,421.97,438.51,2.6160304303718873\n1627911000,440.34,453.07,436.1,451.56,2.6057223698866694\n1630503000,452.56,454.05,428.78,429.14,2.2759403822554076\n1633095000,430.98,459.56,426.36,459.25,2.139716830792828\n1635773400,460.3,473.54,455.3,455.56,1.9715829590270033\n1638369000,461.64,479,448.92,474.96,1.9340359880777587\n1641220200,476.3,479.98,420.76,449.91,1.6433502098259747\n1643725800,450.68,458.12,410.64,436.63,1.183138351682609\n1646145000,435.04,462.07,415.12,451.64,0.8825821973318203\n1648819800,453.31,457.83,411.21,412,0.33888839343001886\n1651498200,412.07,429.66,380.54,412.93,-0.13695828951002392\n1654090200,415.17,417.44,362.17,377.25,-0.7671996014241153\n1656682200,376.56,413.03,371.04,411.99,-0.9659988734283277\n1659360600,409.15,431.73,395.04,395.18,-1.0954347683609502\n1662039000,392.89,411.73,357.04,357.18,-1.4634839093521945\n1664803800,361.08,389.52,348.11,386.21,-1.5128895683196901\n1667309400,390.14,407.68,368.79,407.68,-1.2079023897638235\n1669905000,408.77,410.49,374.77,382.43,-1.0527435905613658\n1672756200,384.37,408.16,377.831,406.48,-0.726140964020786\n1675261800,405.211,418.31,393.64,396.26,-0.4968242834456763\n1677681000,395.41,409.7,380.65,409.39,-0.21612952606530128\n1680528600,408.85,411.92,405.678,409.61,0.017745871010243826\n"
  },
  {
    "path": "Tests/TestData/spy_tsf.csv",
    "content": ",date,time,open,high,low,close,volume,tsf\n0,01/02/1998,00:00,973100,975300,965300,973600,2150000,0.0\n1,01/05/1998,00:00,978400,984400,967800,977500,4030800,0.0\n2,01/06/1998,00:00,972500,972800,961900,966300,2821800,0.0\n3,01/07/1998,00:00,960900,965000,952200,964700,5225400,0.0\n4,01/08/1998,00:00,963100,963100,955000,957800,3249100,954660.0\n5,01/09/1998,00:00,952500,955000,919100,924700,10000200,923970.0\n6,01/12/1998,00:00,911300,941900,909100,940600,11953200,923400.0\n7,01/13/1998,00:00,946300,956300,942200,952200,5006400,935340.0\n8,01/14/1998,00:00,956900,959700,947200,958100,3738000,955110.0\n9,01/15/1998,00:00,955000,957500,948100,949400,2726400,965070.0\n10,01/16/1998,00:00,962500,966900,956600,962300,4185400,964700.0\n11,01/20/1998,00:00,966900,980000,965000,980000,4373400,978340.0\n12,01/21/1998,00:00,972200,976900,961600,971600,4526300,981560.0\n13,01/22/1998,00:00,961600,968800,958800,963000,4484300,976210.0\n14,01/23/1998,00:00,965000,967800,950000,956600,6231300,958180.0\n15,01/26/1998,00:00,963800,967300,937500,957500,4280800,947740.0\n16,01/27/1998,00:00,958100,980000,956600,970000,6639000,961130.0\n17,01/28/1998,00:00,974100,981100,971700,978800,4089900,978680.0\n18,01/29/1998,00:00,978400,995600,975600,987500,7706300,995010.0\n19,01/30/1998,00:00,987800,989700,980000,983100,3333000,995990.0\n20,02/02/1998,00:00,999100,1005000,997500,1002500,5587200,1005170.0\n21,02/03/1998,00:00,1000000,1008100,997200,1006900,2656800,1013120.0\n22,02/04/1998,00:00,1002800,1011600,998800,1005900,3283800,1015360.0\n23,02/05/1998,00:00,1013100,1015900,1000300,1003800,4970800,1013880.0\n24,02/06/1998,00:00,1010000,1015000,1006900,1012800,5531800,1011630.0\n25,02/09/1998,00:00,1017200,1017500,1007200,1011400,2277100,1012930.0\n26,02/10/1998,00:00,1014400,1024700,1011900,1020500,3624500,1021920.0\n27,02/11/1998,00:00,1020900,1031900,1017000,1021300,4020500,1026770.0\n28,02/12/1998,00:00,1017200,1029400,1008800,1026600,5102800,1029770.0\n29,02/13/1998,00:00,1021900,1029400,1018800,1021600,1889500,1028230.0\n30,02/17/1998,00:00,1028100,1030900,1021600,1023400,2945300,1024510.0\n31,02/18/1998,00:00,1023100,1034700,1022800,1034100,2919600,1032120.0\n32,02/19/1998,00:00,1032500,1034100,1027500,1030000,3330600,1032930.0\n33,02/20/1998,00:00,1030800,1037500,1023800,1035600,3594700,1039320.0\n34,02/23/1998,00:00,1042500,1042500,1033400,1040000,3131700,1043030.0\n35,02/24/1998,00:00,1039100,1040900,1029400,1031900,3241700,1036000.0\n36,02/25/1998,00:00,1037500,1048800,1036300,1044800,3348400,1044230.0\n37,02/26/1998,00:00,1044400,1051600,1041900,1050600,3604100,1051020.0\n38,02/27/1998,00:00,1049700,1055300,1043100,1052000,3335400,1056670.0\n39,03/02/1998,00:00,1052500,1057500,1046300,1048100,4126000,1057360.0\n40,03/03/1998,00:00,1045300,1054700,1045000,1054100,3177500,1054750.0\n41,03/04/1998,00:00,1050900,1054100,1040600,1049700,4395900,1050990.0\n42,03/05/1998,00:00,1035000,1044400,1031600,1037500,7153500,1040060.0\n43,03/06/1998,00:00,1045600,1058800,1044400,1057500,6702600,1050040.0\n44,03/09/1998,00:00,1055300,1062200,1052500,1054400,3282800,1053160.0\n45,03/10/1998,00:00,1062200,1068400,1053800,1066600,5582900,1068350.0\n46,03/11/1998,00:00,1069700,1073100,1067300,1072500,3426500,1081430.0\n47,03/12/1998,00:00,1070900,1075900,1065000,1072500,3057400,1079130.0\n48,03/13/1998,00:00,1078400,1080000,1068800,1072200,2743800,1080090.0\n49,03/16/1998,00:00,1078400,1082800,1075300,1082500,3073800,1082710.0\n50,03/17/1998,00:00,1083100,1085000,1076600,1084700,4577900,1087200.0\n51,03/18/1998,00:00,1082500,1089400,1080000,1087800,1820900,1092870.0\n52,03/19/1998,00:00,1089700,1093800,1086600,1093400,2450000,1098430.0\n53,03/20/1998,00:00,1095600,1101900,1088800,1100000,2828600,1102790.0\n54,03/23/1998,00:00,1097200,1103100,1094100,1095000,4383400,1102020.0\n55,03/24/1998,00:00,1100600,1108100,1099400,1105900,3293800,1107760.0\n56,03/25/1998,00:00,1114100,1115300,1091900,1101900,4484900,1106110.0\n57,03/26/1998,00:00,1098800,1107500,1096300,1101300,3319600,1103670.0\n58,03/27/1998,00:00,1107500,1107800,1090000,1095300,2512200,1098680.0\n59,03/30/1998,00:00,1096300,1100900,1089700,1093400,2776500,1090080.0\n60,03/31/1998,00:00,1101600,1111900,1097500,1100900,5726500,1095590.0\n61,04/01/1998,00:00,1103100,1110800,1094100,1109800,2828500,1106920.0\n62,04/02/1998,00:00,1109400,1122500,1107500,1120300,3947500,1123860.0\n63,04/03/1998,00:00,1123400,1128100,1118400,1121900,3726100,1132180.0\n64,04/06/1998,00:00,1132500,1133800,1120600,1122500,4029500,1131670.0\n65,04/07/1998,00:00,1117500,1119400,1101600,1110000,5200100,1117680.0\n66,04/08/1998,00:00,1112200,1112800,1097500,1101300,4762900,1100230.0\n67,04/09/1998,00:00,1105600,1112800,1105300,1110000,4367800,1099640.0\n68,04/13/1998,00:00,1113800,1113800,1100000,1110000,4216000,1103260.0\n69,04/14/1998,00:00,1111300,1117200,1109100,1116900,3219500,1116390.0\n70,04/15/1998,00:00,1119700,1121300,1111600,1120200,3811700,1125090.0\n71,04/16/1998,00:00,1113100,1115000,1105000,1109100,7242500,1115760.0\n72,04/17/1998,00:00,1107200,1124100,1104400,1122200,5414800,1120660.0\n73,04/20/1998,00:00,1120000,1125600,1118800,1124100,3606300,1123420.0\n74,04/21/1998,00:00,1124400,1131600,1119100,1126300,4573300,1128540.0\n75,04/22/1998,00:00,1128800,1134400,1128100,1130000,2288400,1136110.0\n76,04/23/1998,00:00,1126300,1130000,1117500,1120900,4848500,1125690.0\n77,04/24/1998,00:00,1117500,1124700,1103400,1108800,11129100,1111220.0\n78,04/27/1998,00:00,1093800,1106600,1076300,1085900,14372900,1083780.0\n79,04/28/1998,00:00,1097800,1098100,1081300,1086300,6213200,1069660.0\n80,04/29/1998,00:00,1090300,1099700,1084400,1095300,7582100,1077330.0\n81,04/30/1998,00:00,1105600,1119200,1104100,1114400,8226200,1104320.0\n82,05/01/1998,00:00,1117500,1123100,1113100,1121900,3768600,1130790.0\n83,05/04/1998,00:00,1127200,1133100,1121600,1122500,4332900,1137780.0\n84,05/05/1998,00:00,1120000,1121600,1111300,1116600,4969800,1129350.0\n85,05/06/1998,00:00,1121300,1121300,1104700,1105000,5221600,1108850.0\n86,05/07/1998,00:00,1105000,1105600,1094100,1095900,6769900,1091530.0\n87,05/08/1998,00:00,1100000,1113800,1100000,1110000,7888200,1096290.0\n88,05/11/1998,00:00,1115600,1122200,1103800,1108600,6219300,1103920.0\n89,05/12/1998,00:00,1108100,1118800,1102500,1116400,5983800,1117830.0\n90,05/13/1998,00:00,1120600,1125600,1115900,1120600,4355500,1127040.0\n91,05/14/1998,00:00,1115300,1126900,1113400,1119700,4229300,1124480.0\n92,05/15/1998,00:00,1120000,1122200,1108100,1110000,6807000,1116890.0\n93,05/18/1998,00:00,1107200,1115900,1098300,1108400,4751100,1107040.0\n94,05/19/1998,00:00,1110000,1116900,1107800,1110600,5877900,1104470.0\n95,05/20/1998,00:00,1120900,1125000,1108800,1122800,5775400,1116340.0\n96,05/21/1998,00:00,1123800,1127800,1113100,1116900,6427100,1122200.0\n97,05/22/1998,00:00,1117500,1120600,1109400,1111600,4659700,1117870.0\n98,05/26/1998,00:00,1120900,1120900,1094400,1095300,6262300,1098900.0\n99,05/27/1998,00:00,1093100,1099100,1075800,1096300,10286000,1086200.0\n100,05/28/1998,00:00,1098800,1103800,1087300,1100000,4778900,1089290.0\n101,05/29/1998,00:00,1106300,1108100,1093800,1093800,4583900,1090130.0\n102,06/01/1998,00:00,1089700,1102200,1085600,1095000,5829200,1095150.0\n103,06/02/1998,00:00,1100000,1103400,1091600,1095900,6477900,1094460.0\n104,06/03/1998,00:00,1098800,1101900,1082200,1085000,6262700,1085570.0\n105,06/04/1998,00:00,1082500,1100600,1080600,1099100,6317300,1093940.0\n106,06/05/1998,00:00,1103800,1118800,1098800,1118100,8140300,1113440.0\n107,06/08/1998,00:00,1119400,1124700,1116600,1118800,4056700,1127050.0\n108,06/09/1998,00:00,1117200,1124200,1114100,1122800,2680400,1137350.0\n109,06/10/1998,00:00,1116300,1130600,1112500,1113800,6336300,1124750.0\n110,06/11/1998,00:00,1114400,1118800,1092800,1096600,7897100,1099620.0\n111,06/12/1998,00:00,1098800,1104400,1082500,1102500,9700700,1093260.0\n112,06/15/1998,00:00,1088100,1099100,1078800,1080000,9754800,1074070.0\n113,06/16/1998,00:00,1084100,1091600,1077500,1090600,7245000,1077800.0\n114,06/17/1998,00:00,1101600,1117800,1099400,1112500,11964800,1102410.0\n115,06/18/1998,00:00,1111900,1114400,1107500,1111600,3749600,1114650.0\n116,06/19/1998,00:00,1110600,1112300,1096300,1100300,3538200,1117480.0\n117,06/22/1998,00:00,1102500,1110600,1100600,1103800,5357100,1108020.0\n118,06/23/1998,00:00,1110900,1121900,1110000,1119700,5205600,1111560.0\n119,06/24/1998,00:00,1121600,1136900,1116100,1134700,8222700,1133700.0\n120,06/25/1998,00:00,1139100,1144700,1128100,1130000,5837700,1144790.0\n121,06/26/1998,00:00,1133100,1138400,1131300,1134100,4753900,1145730.0\n122,06/29/1998,00:00,1142500,1146900,1138000,1138900,6537200,1142820.0\n123,06/30/1998,00:00,1139100,1141900,1130600,1133600,4126100,1136270.0\n124,07/01/1998,00:00,1140600,1149400,1136300,1149400,3241200,1148690.0\n125,07/02/1998,00:00,1147200,1148800,1142500,1146300,3432900,1150930.0\n126,07/06/1998,00:00,1147800,1158400,1145600,1157800,3042100,1160350.0\n127,07/07/1998,00:00,1159800,1161300,1152800,1155600,4847300,1164260.0\n128,07/08/1998,00:00,1158800,1169400,1157500,1168100,6773100,1169450.0\n129,07/09/1998,00:00,1162800,1167200,1156300,1160000,7258600,1168870.0\n130,07/10/1998,00:00,1160300,1169100,1150600,1165300,7739800,1167180.0\n131,07/13/1998,00:00,1165600,1168400,1160600,1167500,6846100,1169600.0\n132,07/14/1998,00:00,1169400,1181600,1169400,1178100,7119900,1176050.0\n133,07/15/1998,00:00,1180600,1182800,1174400,1175600,4908000,1182500.0\n134,07/16/1998,00:00,1176900,1185900,1170600,1184400,6239600,1188070.0\n135,07/17/1998,00:00,1186300,1190000,1183100,1187500,3478600,1192510.0\n136,07/20/1998,00:00,1187500,1192300,1179400,1185000,2238300,1189830.0\n137,07/21/1998,00:00,1190000,1190000,1162800,1165300,5107200,1173560.0\n138,07/22/1998,00:00,1163400,1195900,1155300,1166300,10611500,1160180.0\n139,07/23/1998,00:00,1163100,1168400,1138800,1141900,14881000,1136230.0\n140,07/24/1998,00:00,1149700,1150900,1128800,1141600,11706000,1126960.0\n141,07/27/1998,00:00,1136300,1150000,1128400,1149800,9360300,1136270.0\n142,07/28/1998,00:00,1144400,1146600,1118800,1133100,13422500,1128990.0\n143,07/29/1998,00:00,1137200,1141300,1122500,1126600,6932100,1126870.0\n144,07/30/1998,00:00,1136300,1145900,1134100,1143400,6617400,1133020.0\n145,07/31/1998,00:00,1143400,1145000,1113100,1120600,7679600,1120270.0\n146,08/03/1998,00:00,1117800,1124200,1110300,1113800,10349100,1114120.0\n147,08/04/1998,00:00,1122200,1122200,1072500,1076100,14468800,1076920.0\n148,08/05/1998,00:00,1079400,1088800,1055900,1081600,21457200,1056670.0\n149,08/06/1998,00:00,1081300,1095200,1075600,1090900,13163000,1069120.0\n150,08/07/1998,00:00,1096900,1105900,1084700,1090300,11718400,1080880.0\n151,08/10/1998,00:00,1087500,1096600,1081900,1085900,6055400,1093450.0\n152,08/11/1998,00:00,1067800,1074400,1055000,1070600,14385600,1075760.0\n153,08/12/1998,00:00,1077500,1088100,1075000,1085000,10997500,1075090.0\n154,08/13/1998,00:00,1088100,1096600,1076300,1076400,8529600,1073030.0\n155,08/14/1998,00:00,1083400,1087200,1057800,1064800,7995800,1065620.0\n156,08/17/1998,00:00,1060000,1089400,1055000,1085000,11035000,1078940.0\n157,08/18/1998,00:00,1090000,1105900,1087800,1102500,7245000,1095820.0\n158,08/19/1998,00:00,1110900,1110900,1096300,1100000,6054300,1111210.0\n159,08/20/1998,00:00,1096900,1104100,1091600,1092500,7590600,1110080.0\n160,08/21/1998,00:00,1081900,1087200,1055000,1083800,16427600,1089040.0\n161,08/24/1998,00:00,1092500,1099400,1083100,1090600,7902200,1081880.0\n162,08/25/1998,00:00,1103800,1112500,1086400,1095000,9623400,1088810.0\n163,08/26/1998,00:00,1082800,1096300,1077500,1085000,9090300,1088240.0\n164,08/27/1998,00:00,1070000,1078400,1038900,1042500,24042400,1052920.0\n165,08/28/1998,00:00,1049700,1057200,1021600,1030000,23196400,1016510.0\n166,08/31/1998,00:00,1037500,1040200,950000,962500,22799800,947000.0\n167,09/01/1998,00:00,960600,1005600,936300,996900,24391500,946520.0\n168,09/02/1998,00:00,998100,1017500,987800,990000,13984400,962950.0\n169,09/03/1998,00:00,976300,993800,966900,985200,16873300,974290.0\n170,09/04/1998,00:00,994400,998100,957800,976300,16414800,986950.0\n171,09/08/1998,00:00,1008800,1029700,998100,1025900,14307900,1008150.0\n172,09/09/1998,00:00,1027500,1031300,1004800,1007500,12026000,1019690.0\n173,09/10/1998,00:00,984400,993400,968100,982500,19666100,1003220.0\n174,09/11/1998,00:00,981900,1015000,970000,1012500,20203300,1009640.0\n175,09/14/1998,00:00,1028800,1044500,1020900,1031600,10318300,1016920.0\n176,09/15/1998,00:00,1028800,1043100,1022800,1042000,8166200,1050650.0\n177,09/16/1998,00:00,1047500,1052500,1031600,1050000,11125300,1073070.0\n178,09/17/1998,00:00,1022500,1030300,1017800,1022300,12549700,1043080.0\n179,09/18/1998,00:00,1023800,1024100,1010900,1019700,6667900,1020070.0\n180,09/21/1998,00:00,996300,1034100,989400,1021900,8552400,1010030.0\n181,09/22/1998,00:00,1035000,1036600,1021600,1030000,7070200,1016660.0\n182,09/23/1998,00:00,1038800,1070000,1037800,1066300,12804500,1061530.0\n183,09/24/1998,00:00,1063100,1068100,1032500,1043800,10809300,1064120.0\n184,09/25/1998,00:00,1031300,1054200,1026300,1043000,10051500,1057800.0\n185,09/28/1998,00:00,1053100,1063100,1042500,1049100,8368600,1050910.0\n186,09/29/1998,00:00,1053800,1059400,1033800,1049400,10488400,1041770.0\n187,09/30/1998,00:00,1035000,1043100,1013800,1018400,7537300,1027420.0\n188,10/01/1998,00:00,1000300,1015500,980900,986300,12833400,986010.0\n189,10/02/1998,00:00,988800,1008800,972200,1003100,14014100,974730.0\n190,10/05/1998,00:00,995900,1000000,963400,990000,12408900,969210.0\n191,10/06/1998,00:00,1007500,1012800,975300,985300,12216900,977870.0\n192,10/07/1998,00:00,986300,1000300,957500,972200,13942400,973580.0\n193,10/08/1998,00:00,945600,967500,922200,962200,20019400,952680.0\n194,10/09/1998,00:00,970000,995600,940600,986300,11865900,970050.0\n195,10/12/1998,00:00,1006300,1014400,996900,997800,9127600,992490.0\n196,10/13/1998,00:00,995600,1004100,987500,995300,5916200,1007300.0\n197,10/14/1998,00:00,989400,1018100,988400,1005000,8056200,1017700.0\n198,10/15/1998,00:00,1001300,1072500,999400,1050300,19735400,1047500.0\n199,10/16/1998,00:00,1061300,1067500,1050000,1056600,16305900,1072780.0\n200,10/19/1998,00:00,1056900,1068100,1055000,1063400,7627400,1090460.0\n201,10/20/1998,00:00,1075600,1088000,1060900,1065000,14236900,1087990.0\n202,10/21/1998,00:00,1068800,1076300,1058800,1071300,8997900,1076440.0\n203,10/22/1998,00:00,1067800,1084700,1061600,1080000,8012900,1083670.0\n204,10/23/1998,00:00,1079700,1080000,1067800,1071300,6188800,1079440.0\n205,10/26/1998,00:00,1077200,1085600,1067800,1075500,5654900,1078920.0\n206,10/27/1998,00:00,1084400,1089700,1062800,1066300,9865800,1068530.0\n207,10/28/1998,00:00,1065600,1078100,1060300,1067800,5499700,1063360.0\n208,10/29/1998,00:00,1070900,1089700,1066300,1089700,8847200,1082850.0\n209,10/30/1998,00:00,1101300,1109100,1095000,1100000,9498800,1101580.0\n210,11/02/1998,00:00,1108100,1117500,1101900,1114800,6351000,1126480.0\n211,11/03/1998,00:00,1115900,1118100,1107500,1111300,6573900,1130350.0\n212,11/04/1998,00:00,1124700,1130900,1110900,1118400,7788100,1127450.0\n213,11/05/1998,00:00,1115300,1138100,1111300,1137300,6686200,1139820.0\n214,11/06/1998,00:00,1134700,1145000,1133100,1142800,5136100,1149520.0\n215,11/09/1998,00:00,1139400,1142500,1125000,1131400,5908800,1147620.0\n216,11/10/1998,00:00,1130000,1139400,1125000,1126900,9142100,1134690.0\n217,11/11/1998,00:00,1138100,1140600,1118900,1123800,10735000,1119570.0\n218,11/12/1998,00:00,1123100,1131300,1116900,1120300,5396300,1113260.0\n219,11/13/1998,00:00,1122200,1130600,1121300,1127700,5531900,1121820.0\n220,11/16/1998,00:00,1142200,1143600,1128900,1138400,5934200,1135490.0\n221,11/17/1998,00:00,1136600,1156300,1130000,1143400,8944500,1147910.0\n222,11/18/1998,00:00,1143100,1149400,1135000,1147500,4538000,1156490.0\n223,11/19/1998,00:00,1152800,1159100,1146300,1155000,5115600,1161510.0\n224,11/20/1998,00:00,1163600,1167500,1158400,1166300,5351500,1170340.0\n225,11/23/1998,00:00,1174700,1192200,1171600,1191600,6442400,1195320.0\n226,11/24/1998,00:00,1190000,1196600,1184500,1186900,5121600,1204080.0\n227,11/25/1998,00:00,1189400,1191900,1181600,1188800,4268500,1204180.0\n228,11/27/1998,00:00,1194700,1197200,1190000,1195000,4562000,1202100.0\n229,11/30/1998,00:00,1190200,1193800,1166600,1166900,7991700,1173450.0\n230,12/01/1998,00:00,1161300,1180300,1152200,1178100,8773600,1171290.0\n231,12/02/1998,00:00,1172200,1179100,1160000,1175000,7322100,1167410.0\n232,12/03/1998,00:00,1172500,1183100,1151900,1152800,11737800,1150670.0\n233,12/04/1998,00:00,1166300,1188800,1155900,1179700,10616800,1170590.0\n234,12/07/1998,00:00,1180600,1195300,1180000,1192500,4105700,1185670.0\n235,12/08/1998,00:00,1185300,1197500,1175000,1184700,9996400,1194670.0\n236,12/09/1998,00:00,1186900,1189700,1178800,1188100,5259600,1202240.0\n237,12/10/1998,00:00,1188400,1188400,1167200,1168100,5844400,1174340.0\n238,12/11/1998,00:00,1164400,1173400,1155600,1170600,8669100,1162680.0\n239,12/14/1998,00:00,1161600,1164100,1139100,1144700,9276400,1141990.0\n240,12/15/1998,00:00,1146900,1167500,1145300,1166300,9482100,1147460.0\n241,12/16/1998,00:00,1171300,1171300,1157500,1164100,7183500,1159070.0\n242,12/17/1998,00:00,1172200,1185600,1170200,1185000,6720200,1180600.0\n243,12/18/1998,00:00,1183100,1191300,1178800,1190200,4027900,1202970.0\n244,12/21/1998,00:00,1192500,1213400,1190000,1203100,8465700,1211650.0\n245,12/22/1998,00:00,1204100,1212200,1191900,1205300,5581100,1219690.0\n246,12/23/1998,00:00,1211900,1231900,1208100,1228100,7558200,1232730.0\n247,12/24/1998,00:00,1231600,1238800,1222800,1226900,1557500,1240240.0\n248,12/28/1998,00:00,1232500,1233100,1220000,1226300,4031000,1238340.0\n249,12/29/1998,00:00,1227200,1244400,1221300,1243100,3747300,1248080.0\n250,12/30/1998,00:00,1239400,1247500,1230300,1233800,6962800,1239920.0\n251,12/31/1998,00:00,1233100,1239400,1224700,1228800,6480500,1235170.0\n252,01/04/1999,00:00,1233800,1252200,1217200,1228800,9480700,1229370.0\n253,01/05/1999,00:00,1229400,1248800,1229400,1244400,7840800,1235060.0\n254,01/06/1999,00:00,1258100,1276300,1257500,1275000,7648500,1271560.0\n255,01/07/1999,00:00,1263800,1272200,1257800,1269400,5364300,1287500.0\n256,01/08/1999,00:00,1281900,1285000,1259700,1275000,6076900,1293740.0\n257,01/11/1999,00:00,1276900,1276900,1252200,1262800,7455600,1276360.0\n258,01/12/1999,00:00,1262200,1262200,1238100,1240000,7434300,1241460.0\n259,01/13/1999,00:00,1204100,1251300,1203800,1233100,10563100,1223780.0\n260,01/14/1999,00:00,1236300,1239100,1209100,1211600,11370000,1197550.0\n261,01/15/1999,00:00,1223800,1247800,1220300,1243100,7757900,1217780.0\n262,01/19/1999,00:00,1253000,1274700,1235000,1252800,6270400,1246800.0\n263,01/20/1999,00:00,1260900,1279400,1250300,1256300,6222800,1265660.0\n264,01/21/1999,00:00,1255800,1258400,1232200,1235900,6408000,1258480.0\n265,01/22/1999,00:00,1221300,1238400,1217800,1225600,7249900,1227170.0\n266,01/25/1999,00:00,1232800,1240000,1219100,1236300,5008100,1222270.0\n267,01/26/1999,00:00,1241300,1257200,1236300,1255000,5893300,1241160.0\n268,01/27/1999,00:00,1263800,1266300,1244100,1244700,7089500,1253600.0\n269,01/28/1999,00:00,1252500,1269700,1251900,1266600,5763500,1272760.0\n270,01/29/1999,00:00,1273400,1283000,1254100,1278800,5990400,1285260.0\n271,02/01/1999,00:00,1286900,1286900,1270000,1270900,9098500,1282970.0\n272,02/02/1999,00:00,1270800,1272200,1247700,1262800,9197400,1276910.0\n273,02/03/1999,00:00,1256900,1279400,1256600,1271900,10155700,1268580.0\n274,02/04/1999,00:00,1273800,1275000,1248100,1248400,6727600,1248620.0\n275,02/05/1999,00:00,1256600,1256600,1232200,1240000,7444000,1235940.0\n276,02/08/1999,00:00,1250900,1250900,1233400,1243800,8364900,1232410.0\n277,02/09/1999,00:00,1243800,1245000,1215600,1218600,8502300,1211180.0\n278,02/10/1999,00:00,1221300,1230000,1213300,1226900,6492100,1216220.0\n279,02/11/1999,00:00,1230600,1256900,1225000,1256900,8880800,1242310.0\n280,02/12/1999,00:00,1248100,1255000,1226300,1235000,10496300,1242450.0\n281,02/16/1999,00:00,1247500,1256300,1233800,1243800,6590400,1253790.0\n282,02/17/1999,00:00,1231900,1253600,1222500,1227500,7447000,1234450.0\n283,02/18/1999,00:00,1231900,1243800,1222200,1239400,8844800,1227770.0\n284,02/19/1999,00:00,1240000,1257500,1233800,1239400,5219200,1238340.0\n285,02/22/1999,00:00,1244400,1277200,1242800,1276900,10212200,1268830.0\n286,02/23/1999,00:00,1275900,1285000,1265900,1275000,7631500,1291390.0\n287,02/24/1999,00:00,1278400,1288400,1254100,1254100,6777300,1276460.0\n288,02/25/1999,00:00,1245300,1252800,1225900,1247500,11219400,1256600.0\n289,02/26/1999,00:00,1247500,1248400,1228100,1239100,9233600,1227590.0\n290,03/01/1999,00:00,1236600,1243100,1208800,1237800,7594300,1223880.0\n291,03/02/1999,00:00,1245000,1253100,1223100,1228100,9311200,1222810.0\n292,03/03/1999,00:00,1230900,1235600,1217800,1231300,7558900,1223740.0\n293,03/04/1999,00:00,1240600,1252300,1232700,1250000,7787300,1241850.0\n294,03/05/1999,00:00,1275000,1281300,1259200,1278100,10091200,1275810.0\n295,03/08/1999,00:00,1282800,1288000,1272500,1285200,4553000,1302840.0\n296,03/09/1999,00:00,1281300,1299400,1274400,1282500,7703600,1306700.0\n297,03/10/1999,00:00,1284700,1292200,1277800,1290300,3748200,1302720.0\n298,03/11/1999,00:00,1296900,1311900,1288800,1302200,6543200,1303650.0\n299,03/12/1999,00:00,1310000,1310300,1292200,1295300,4963300,1303070.0\n300,03/15/1999,00:00,1299400,1311900,1295000,1311600,5257400,1315340.0\n301,03/16/1999,00:00,1311300,1316600,1304700,1309800,4422900,1316360.0\n302,03/17/1999,00:00,1306900,1309400,1296300,1302500,4380300,1308810.0\n303,03/18/1999,00:00,1297800,1323400,1297500,1321600,3537400,1321210.0\n304,03/19/1999,00:00,1323100,1326300,1298400,1300600,5265200,1306160.0\n305,03/22/1999,00:00,1300600,1305900,1294200,1299100,4422000,1299730.0\n306,03/23/1999,00:00,1293100,1296300,1257000,1264100,9302400,1267790.0\n307,03/24/1999,00:00,1268400,1271600,1256300,1269400,5950500,1248690.0\n308,03/25/1999,00:00,1280600,1292500,1277500,1291300,6432000,1270410.0\n309,03/26/1999,00:00,1286300,1291300,1277200,1284700,5881500,1281240.0\n310,03/29/1999,00:00,1291600,1314400,1291600,1312200,5395500,1317790.0\n311,03/30/1999,00:00,1299400,1312200,1295600,1303400,5090200,1318870.0\n312,03/31/1999,00:00,1311600,1316100,1284400,1286300,7029600,1298190.0\n313,04/01/1999,00:00,1296900,1296900,1281300,1293800,7473900,1293770.0\n314,04/05/1999,00:00,1309400,1323800,1302500,1323800,5533700,1307980.0\n315,04/06/1999,00:00,1321900,1329800,1311600,1319400,5022000,1326190.0\n316,04/07/1999,00:00,1326900,1333800,1313800,1328800,6056300,1343600.0\n317,04/08/1999,00:00,1331900,1347800,1322800,1345300,5645500,1354620.0\n318,04/09/1999,00:00,1344400,1356900,1335900,1348800,4132000,1355990.0\n319,04/12/1999,00:00,1334700,1362500,1332200,1360600,7944600,1371300.0\n320,04/13/1999,00:00,1362500,1364700,1340300,1351900,10581100,1365530.0\n321,04/14/1999,00:00,1360600,1360600,1326900,1330300,11566600,1339310.0\n322,04/15/1999,00:00,1334400,1335600,1310000,1326300,11010600,1320990.0\n323,04/16/1999,00:00,1329100,1329100,1311900,1321300,6139800,1306820.0\n324,04/19/1999,00:00,1326900,1345300,1283800,1289100,12557100,1283400.0\n325,04/20/1999,00:00,1298100,1310300,1288800,1306300,8576400,1289100.0\n326,04/21/1999,00:00,1310600,1337800,1257800,1336900,5330700,1317840.0\n327,04/22/1999,00:00,1351300,1362500,1343900,1359700,6576600,1360040.0\n328,04/23/1999,00:00,1358800,1367500,1350000,1357500,4218900,1386960.0\n329,04/26/1999,00:00,1365000,1368100,1354700,1361300,3304000,1383520.0\n330,04/27/1999,00:00,1371300,1375000,1358400,1365600,4907600,1373900.0\n331,04/28/1999,00:00,1364400,1372500,1350000,1353400,5446900,1358150.0\n332,04/29/1999,00:00,1355600,1360600,1338100,1345600,9593600,1347170.0\n333,04/30/1999,00:00,1350900,1356300,1315000,1334700,10538700,1330160.0\n334,05/03/1999,00:00,1334400,1357200,1330300,1356300,10658900,1339930.0\n335,05/04/1999,00:00,1351300,1358100,1331300,1333100,10221800,1335650.0\n336,05/05/1999,00:00,1339400,1350000,1318400,1349700,9747000,1345860.0\n337,05/06/1999,00:00,1344400,1351300,1323800,1335000,13134000,1339960.0\n338,05/07/1999,00:00,1345000,1349800,1334400,1346300,8344100,1338650.0\n339,05/10/1999,00:00,1348400,1357200,1335300,1342200,5372100,1345700.0\n340,05/11/1999,00:00,1353100,1368800,1257800,1357200,6679600,1352740.0\n341,05/12/1999,00:00,1357500,1372200,1315000,1366300,15070800,1371450.0\n342,05/13/1999,00:00,1372500,1380000,1368100,1370200,4174600,1378010.0\n343,05/14/1999,00:00,1345600,1362500,1333100,1343000,8210400,1360160.0\n344,05/17/1999,00:00,1336300,1344800,1323100,1343100,6277500,1340510.0\n345,05/18/1999,00:00,1345300,1349800,1326300,1336300,8114700,1325650.0\n346,05/19/1999,00:00,1344700,1348800,1332500,1348100,4273700,1332870.0\n347,05/20/1999,00:00,1351300,1355900,1300600,1343100,4349700,1344280.0\n348,05/21/1999,00:00,1341300,1346900,1195800,1334200,6117400,1337660.0\n349,05/24/1999,00:00,1338400,1338400,1303900,1310900,7687100,1315110.0\n350,05/25/1999,00:00,1313800,1323400,1286900,1288400,9523800,1279460.0\n351,05/26/1999,00:00,1293100,1310000,1280900,1306600,12776900,1281000.0\n352,05/27/1999,00:00,1298400,1302800,1280000,1284400,13998900,1273730.0\n353,05/28/1999,00:00,1290000,1307500,1285900,1305900,8348100,1295040.0\n354,06/01/1999,00:00,1301300,1301600,1283800,1298800,6391500,1302850.0\n355,06/02/1999,00:00,1297500,1301900,1206300,1297800,6812100,1297740.0\n356,06/03/1999,00:00,1306900,1309100,1297800,1302800,5933500,1306550.0\n357,06/04/1999,00:00,1314700,1331900,1309400,1319400,9507800,1314240.0\n358,06/07/1999,00:00,1334400,1341900,1329100,1337500,5078600,1340960.0\n359,06/08/1999,00:00,1333800,1338000,1315900,1321600,5000500,1340510.0\n360,06/09/1999,00:00,1324100,1330900,1318100,1321600,7428700,1332520.0\n361,06/10/1999,00:00,1314400,1315000,1295900,1309100,6785900,1310890.0\n362,06/11/1999,00:00,1312200,1322200,1290900,1298100,12587100,1290190.0\n363,06/14/1999,00:00,1306900,1307500,1295500,1297800,6542000,1288310.0\n364,06/15/1999,00:00,1304700,1316600,1300800,1305900,5438900,1293690.0\n365,06/16/1999,00:00,1323800,1338800,1321600,1334800,7562200,1326900.0\n366,06/17/1999,00:00,1328800,1355600,1326300,1346600,8476400,1356840.0\n367,06/18/1999,00:00,1340600,1346900,1333800,1343100,2601000,1365030.0\n368,06/21/1999,00:00,1344700,1350000,1336600,1349400,4452000,1364550.0\n369,06/22/1999,00:00,1340000,1351900,1333400,1337000,5603600,1344340.0\n370,06/23/1999,00:00,1330000,1336300,1321300,1332800,9474700,1331670.0\n371,06/24/1999,00:00,1328800,1338100,1306600,1316900,9029400,1315140.0\n372,06/25/1999,00:00,1325900,1330200,1312500,1316600,3966300,1304830.0\n373,06/28/1999,00:00,1326900,1336300,1324700,1333800,5175700,1320640.0\n374,06/29/1999,00:00,1330000,1351300,1327800,1351300,6514400,1346450.0\n375,06/30/1999,00:00,1346300,1375000,1338400,1367500,16362400,1377990.0\n376,07/01/1999,00:00,1370000,1385000,1360600,1380600,9586200,1398470.0\n377,07/02/1999,00:00,1381300,1393000,1379100,1391900,3637300,1408670.0\n378,07/06/1999,00:00,1392500,1407500,1385900,1387200,10954800,1404560.0\n379,07/07/1999,00:00,1390600,1397200,1385200,1395600,3052600,1403400.0\n380,07/08/1999,00:00,1390600,1406300,1387500,1395600,7133500,1400290.0\n381,07/09/1999,00:00,1400000,1404700,1393800,1402200,2770400,1403200.0\n382,07/12/1999,00:00,1409400,1409400,1395000,1400600,4233900,1406260.0\n383,07/13/1999,00:00,1393800,1399200,1386600,1395000,6359600,1398940.0\n384,07/14/1999,00:00,1400000,1402200,1387500,1398400,4246900,1397880.0\n385,07/15/1999,00:00,1407800,1488800,1403100,1411300,3236000,1406300.0\n386,07/16/1999,00:00,1412500,1421600,1407500,1420000,2078000,1421590.0\n387,07/19/1999,00:00,1421900,1422500,1405600,1410000,4029000,1422420.0\n388,07/20/1999,00:00,1401300,1404100,1375300,1378000,6843600,1390910.0\n389,07/21/1999,00:00,1380900,1389100,1370000,1378800,4599000,1367520.0\n390,07/22/1999,00:00,1374400,1380000,1354700,1361400,7580400,1345120.0\n391,07/23/1999,00:00,1366600,1370000,1351300,1357500,4432000,1340660.0\n392,07/26/1999,00:00,1348800,1361300,1346300,1350000,4026700,1341950.0\n393,07/27/1999,00:00,1360000,1372000,1353800,1365000,5722800,1350840.0\n394,07/28/1999,00:00,1362500,1373100,1355900,1367300,3803200,1366030.0\n395,07/29/1999,00:00,1349400,1352500,1333100,1343800,7638800,1353690.0\n396,07/30/1999,00:00,1348100,1353400,1328800,1330900,5569700,1333580.0\n397,08/02/1999,00:00,1327500,1347500,1325000,1329400,5783300,1315000.0\n398,08/03/1999,00:00,1337200,1338400,1313800,1323600,5268700,1308460.0\n399,08/04/1999,00:00,1327200,1338800,1305300,1306900,5986000,1302590.0\n400,08/05/1999,00:00,1308800,1317200,1288400,1315600,9910600,1305350.0\n401,08/06/1999,00:00,1312200,1320000,1295000,1300600,7129800,1295540.0\n402,08/09/1999,00:00,1305900,1318000,1297200,1300500,5162600,1293690.0\n403,08/10/1999,00:00,1298800,1301600,1270000,1282200,9971000,1281810.0\n404,08/11/1999,00:00,1296900,1305300,1286300,1305300,7796900,1289140.0\n405,08/12/1999,00:00,1306900,1318100,1300000,1300200,6292100,1298960.0\n406,08/13/1999,00:00,1316300,1332500,1311300,1331900,5609100,1328260.0\n407,08/16/1999,00:00,1331300,1339700,1322500,1333800,3637600,1349620.0\n408,08/17/1999,00:00,1344400,1351600,1331300,1347000,4708500,1358740.0\n409,08/18/1999,00:00,1342000,1343800,1334100,1335600,4046500,1355470.0\n410,08/19/1999,00:00,1323800,1332300,1316900,1328800,6345700,1334100.0\n411,08/20/1999,00:00,1330600,1339100,1326900,1338800,3054700,1334340.0\n412,08/23/1999,00:00,1348100,1364500,1346600,1363900,5284900,1353920.0\n413,08/24/1999,00:00,1360600,1379700,1353800,1365000,9108100,1374590.0\n414,08/25/1999,00:00,1371900,1387800,1279100,1384400,5894000,1397400.0\n415,08/26/1999,00:00,1382800,1384200,1365000,1365000,4057900,1385290.0\n416,08/27/1999,00:00,1368800,1370600,1351300,1351600,5935300,1358600.0\n417,08/30/1999,00:00,1353400,1355000,1323900,1326600,4286300,1325640.0\n418,08/31/1999,00:00,1329400,1337500,1307500,1325000,11968000,1303360.0\n419,09/01/1999,00:00,1329400,1335600,1323100,1335600,6137800,1315140.0\n420,09/02/1999,00:00,1321300,1326700,1306600,1322500,11370700,1317500.0\n421,09/03/1999,00:00,1348800,1362800,1346900,1361900,9796800,1354750.0\n422,09/07/1999,00:00,1360600,1366300,1342800,1355200,4507400,1366050.0\n423,09/08/1999,00:00,1348400,1360600,1335000,1349100,6999800,1362770.0\n424,09/09/1999,00:00,1347500,1352500,1336900,1351300,5950500,1361440.0\n425,09/10/1999,00:00,1362500,1363600,1349400,1354500,2671700,1348790.0\n426,09/13/1999,00:00,1351300,1354700,1345000,1348100,2130600,1349000.0\n427,09/14/1999,00:00,1340600,1345600,1333800,1340600,3558700,1342660.0\n428,09/15/1999,00:00,1354400,1354400,1320600,1320800,6522800,1320590.0\n429,09/16/1999,00:00,1325000,1328100,1303100,1323800,15114200,1310950.0\n430,09/17/1999,00:00,1326300,1339400,1321600,1337200,8371300,1322520.0\n431,09/20/1999,00:00,1339400,1340000,1330900,1336300,2602800,1334080.0\n432,09/21/1999,00:00,1322500,1324700,1301600,1309100,9018700,1322170.0\n433,09/22/1999,00:00,1312500,1318400,1297500,1311600,12758600,1307850.0\n434,09/23/1999,00:00,1318100,1342500,1237800,1280000,11455200,1273110.0\n435,09/24/1999,00:00,1277500,1283800,1263100,1280600,13686000,1261370.0\n436,09/27/1999,00:00,1287500,1297500,1282800,1282800,6797200,1267740.0\n437,09/28/1999,00:00,1279400,1288100,1255600,1281900,11184900,1270400.0\n438,09/29/1999,00:00,1284400,1291300,1267800,1267800,7351000,1271690.0\n439,09/30/1999,00:00,1274400,1294400,1269700,1283800,7185300,1276800.0\n440,10/01/1999,00:00,1279400,1285600,1266300,1283400,10818900,1280870.0\n441,10/04/1999,00:00,1291900,1306300,1287500,1306300,6202900,1303960.0\n442,10/05/1999,00:00,1307200,1319700,1286900,1301900,11376700,1315850.0\n443,10/06/1999,00:00,1307500,1328100,1306900,1326300,11399000,1331390.0\n444,10/07/1999,00:00,1328600,1330000,1315000,1320000,5986000,1335540.0\n445,10/08/1999,00:00,1317500,1338800,1312300,1337200,9560400,1342310.0\n446,10/11/1999,00:00,1335900,1341300,1333100,1338100,3970800,1349690.0\n447,10/12/1999,00:00,1331300,1333100,1311900,1314100,8223800,1325250.0\n448,10/13/1999,00:00,1306900,1313100,1282500,1286600,10731100,1292230.0\n449,10/14/1999,00:00,1284800,1291900,1267500,1284100,10461400,1264710.0\n450,10/15/1999,00:00,1260000,1267500,1245000,1248100,14030700,1231200.0\n451,10/18/1999,00:00,1249400,1257500,1234400,1255600,9088500,1231050.0\n452,10/19/1999,00:00,1271900,1282500,1259400,1260800,17208700,1243010.0\n453,10/20/1999,00:00,1277500,1292500,1271300,1292200,8467400,1276830.0\n454,10/21/1999,00:00,1272200,1288800,1266300,1286300,9352900,1302500.0\n455,10/22/1999,00:00,1297500,1312200,1295600,1303400,8087900,1315990.0\n456,10/25/1999,00:00,1293100,1304700,1287500,1295000,7667400,1311420.0\n457,10/26/1999,00:00,1301900,1306900,1281900,1282500,5696200,1288670.0\n458,10/27/1999,00:00,1283800,1303100,1282500,1301300,5049600,1296430.0\n459,10/28/1999,00:00,1324400,1345000,1321900,1345000,10053700,1332290.0\n460,10/29/1999,00:00,1358400,1376900,1357200,1365600,10480000,1378990.0\n461,11/01/1999,00:00,1365000,1370000,1356300,1359400,3631400,1396190.0\n462,11/02/1999,00:00,1359700,1372500,1347500,1348100,5787700,1376280.0\n463,11/03/1999,00:00,1360000,1363800,1351300,1356900,7310900,1356890.0\n464,11/04/1999,00:00,1367500,1373600,1357700,1364700,7695600,1357650.0\n465,11/05/1999,00:00,1386300,1391100,1367800,1372200,7618700,1372920.0\n466,11/08/1999,00:00,1370000,1383800,1367500,1379400,4517900,1387630.0\n467,11/09/1999,00:00,1385000,1386900,1362800,1367200,4361300,1378670.0\n468,11/10/1999,00:00,1362500,1383900,1360800,1377500,6173600,1378380.0\n469,11/11/1999,00:00,1381900,1385600,1374700,1383800,4724400,1382410.0\n470,11/12/1999,00:00,1392500,1399700,1371300,1397500,15589200,1396920.0\n471,11/15/1999,00:00,1398400,1402500,1394100,1398100,2101000,1409360.0\n472,11/16/1999,00:00,1405600,1426300,1400900,1424400,7442900,1428690.0\n473,11/17/1999,00:00,1422500,1429400,1413100,1415600,9129600,1431030.0\n474,11/18/1999,00:00,1424400,1430000,1416300,1428100,11360400,1436350.0\n475,11/19/1999,00:00,1424100,1429700,1420000,1425000,4641100,1435490.0\n476,11/22/1999,00:00,1424400,1430000,1415000,1424700,4149600,1426560.0\n477,11/23/1999,00:00,1428400,1428400,1400600,1408800,5948300,1415340.0\n478,11/24/1999,00:00,1407500,1424400,1400000,1420600,4357200,1412080.0\n479,11/26/1999,00:00,1424700,1428800,1412500,1414400,1694900,1411110.0\n480,11/29/1999,00:00,1408800,1419200,1404400,1410000,7653200,1408560.0\n481,11/30/1999,00:00,1407500,1423100,1390000,1392500,8403900,1396300.0\n482,12/01/1999,00:00,1393100,1405000,1390000,1401300,6790400,1389610.0\n483,12/02/1999,00:00,1406300,1413600,1403800,1411300,6706200,1401430.0\n484,12/03/1999,00:00,1430300,1454100,1430300,1436900,9860300,1432180.0\n485,12/06/1999,00:00,1435300,1437200,1422500,1427500,2950200,1445580.0\n486,12/07/1999,00:00,1432800,1433100,1413800,1419400,10334900,1435000.0\n487,12/08/1999,00:00,1413400,1420600,1406300,1406300,4357000,1412030.0\n488,12/09/1999,00:00,1418100,1422200,1393800,1410000,6029100,1397520.0\n489,12/10/1999,00:00,1422800,1428100,1408800,1420000,4698200,1409320.0\n490,12/13/1999,00:00,1414400,1427200,1412800,1421300,3919800,1420650.0\n491,12/14/1999,00:00,1416300,1424800,1406300,1408100,5625700,1417610.0\n492,12/15/1999,00:00,1403800,1422000,1400000,1418000,6539200,1416710.0\n493,12/16/1999,00:00,1421900,1426600,1411600,1423800,5503200,1419530.0\n494,12/17/1999,00:00,1430000,1433100,1420600,1423800,4355000,1425210.0\n495,12/20/1999,00:00,1425600,1431900,1410900,1416900,4888100,1425140.0\n496,12/21/1999,00:00,1415900,1440600,1413400,1433400,7829500,1430350.0\n497,12/22/1999,00:00,1436300,1441900,1429700,1437500,5250700,1438180.0\n498,12/23/1999,00:00,1450200,1464400,1449700,1460900,5566200,1462940.0\n499,12/27/1999,00:00,1465000,1467800,1450600,1458100,2602500,1474330.0\n500,12/28/1999,00:00,1458800,1465000,1454800,1461400,3867500,1473240.0\n501,12/29/1999,00:00,1463100,1468100,1452500,1463400,2773900,1471950.0\n502,12/30/1999,00:00,1471300,1478800,1461900,1466300,8143700,1466850.0\n503,12/31/1999,00:00,1468400,1475000,1462500,1468800,3374600,1471490.0\n504,01/03/2000,00:00,1482500,1482500,1438800,1455600,8369900,1461240.0\n505,01/04/2000,00:00,1435300,1440600,1396400,1400600,7719000,1410050.0\n506,01/05/2000,00:00,1399400,1415300,1372500,1402800,12274000,1380260.0\n507,01/06/2000,00:00,1396300,1415000,1392500,1403400,5504600,1371160.0\n508,01/07/2000,00:00,1403100,1444400,1400600,1444400,7274800,1415480.0\n509,01/10/2000,00:00,1462500,1469100,1450300,1458100,5418700,1468840.0\n510,01/11/2000,00:00,1458100,1460900,1435000,1440900,7312200,1469190.0\n511,01/12/2000,00:00,1445900,1446300,1428800,1433400,6673300,1452990.0\n512,01/13/2000,00:00,1444700,1457500,1432800,1451300,4894900,1442350.0\n513,01/14/2000,00:00,1465300,1474700,1459700,1465000,6884500,1457000.0\n514,01/18/2000,00:00,1453400,1466300,1451900,1456300,6286200,1468100.0\n515,01/19/2000,00:00,1453100,1464700,1450000,1456900,5864600,1468180.0\n516,01/20/2000,00:00,1469700,1469700,1438100,1445000,5355400,1448690.0\n517,01/21/2000,00:00,1455000,1455000,1440900,1441300,6032100,1435290.0\n518,01/24/2000,00:00,1456600,1458400,1394100,1400600,7533500,1401920.0\n519,01/25/2000,00:00,1405200,1420000,1390000,1410000,9404300,1389300.0\n520,01/26/2000,00:00,1410000,1415500,1400900,1406700,4763400,1388350.0\n521,01/27/2000,00:00,1418400,1422200,1381300,1400000,10971900,1388770.0\n522,01/28/2000,00:00,1394400,1400600,1355300,1364700,11564300,1371860.0\n523,01/31/2000,00:00,1358100,1394400,1350000,1394400,10425300,1373200.0\n524,02/01/2000,00:00,1397500,1416900,1385300,1401900,8251400,1388980.0\n525,02/02/2000,00:00,1412800,1422500,1403800,1413000,5839200,1413760.0\n526,02/03/2000,00:00,1408800,1429700,1400000,1428400,7523800,1444280.0\n527,02/04/2000,00:00,1431900,1440000,1421300,1427800,4647000,1441090.0\n528,02/07/2000,00:00,1425600,1427800,1414400,1427200,5642200,1439280.0\n529,02/08/2000,00:00,1439700,1445600,1436300,1442800,4592600,1445360.0\n530,02/09/2000,00:00,1444700,1444700,1413800,1414100,7938600,1423980.0\n531,02/10/2000,00:00,1416300,1425600,1408800,1418800,6527200,1416810.0\n532,02/11/2000,00:00,1418400,1419400,1380300,1391300,8090000,1390100.0\n533,02/14/2000,00:00,1397800,1397800,1383100,1392500,8924900,1374880.0\n534,02/15/2000,00:00,1392500,1412200,1378000,1407500,10099600,1392990.0\n535,02/16/2000,00:00,1403800,1409400,1388000,1390900,8551800,1388320.0\n536,02/17/2000,00:00,1404400,1404400,1382200,1390600,7025200,1393660.0\n537,02/18/2000,00:00,1388800,1388800,1346300,1351900,8648300,1357250.0\n538,02/22/2000,00:00,1351900,1441900,1333400,1354200,15990100,1335340.0\n539,02/23/2000,00:00,1356300,1374700,1345000,1365200,11623500,1344220.0\n540,02/24/2000,00:00,1366900,1370300,1330900,1356900,17172800,1347530.0\n541,02/25/2000,00:00,1351900,1375300,1331300,1337500,10057600,1345310.0\n542,02/28/2000,00:00,1333800,1366900,1327200,1350600,13374200,1342410.0\n543,02/29/2000,00:00,1360600,1374400,1357500,1369100,7501300,1356310.0\n544,03/01/2000,00:00,1376300,1390000,1372200,1383100,6431500,1384640.0\n545,03/02/2000,00:00,1386900,1391300,1373400,1387200,7552200,1405070.0\n546,03/03/2000,00:00,1404400,1417200,1397200,1413100,19871000,1423550.0\n547,03/06/2000,00:00,1408100,1413400,1387500,1393900,12200000,1413160.0\n548,03/07/2000,00:00,1400000,1401600,1352200,1359400,17667900,1375130.0\n549,03/08/2000,00:00,1364700,1378400,1350300,1370500,11415800,1358690.0\n550,03/09/2000,00:00,1372500,1405900,1361300,1405900,5019700,1377220.0\n551,03/10/2000,00:00,1401900,1420000,1395300,1400000,7541900,1403550.0\n552,03/13/2000,00:00,1366900,1404700,1356900,1388800,10611500,1411410.0\n553,03/14/2000,00:00,1392800,1400900,1361600,1365000,7658200,1377610.0\n554,03/15/2000,00:00,1368800,1404400,1325000,1395000,9382100,1373900.0\n555,03/16/2000,00:00,1416300,1466900,1408800,1463100,22099800,1442100.0\n556,03/17/2000,00:00,1458100,1480000,1454400,1466900,9838300,1492050.0\n557,03/20/2000,00:00,1468800,1473400,1447800,1459800,12307100,1508410.0\n558,03/21/2000,00:00,1455300,1497200,1445000,1497200,12668600,1516730.0\n559,03/22/2000,00:00,1495600,1508400,1486900,1500000,8026500,1508630.0\n560,03/23/2000,00:00,1491600,1534700,1491600,1526300,10541800,1537740.0\n561,03/24/2000,00:00,1528800,1557500,1517200,1532800,11529700,1555750.0\n562,03/27/2000,00:00,1533800,1537800,1520000,1525000,8327400,1542780.0\n563,03/28/2000,00:00,1512500,1529800,1507500,1510000,5989100,1524430.0\n564,03/29/2000,00:00,1515600,1524800,1496600,1510300,6497400,1504440.0\n565,03/30/2000,00:00,1501600,1519400,1471300,1488800,9297700,1482570.0\n566,03/31/2000,00:00,1496300,1523100,1484400,1505600,8466800,1489940.0\n567,04/03/2000,00:00,1501300,1510300,1486900,1507700,7490200,1501690.0\n568,04/04/2000,00:00,1517500,1530000,1413900,1500000,19282600,1501970.0\n569,04/05/2000,00:00,1478800,1508100,1476300,1488800,8021800,1496500.0\n570,04/06/2000,00:00,1502500,1516900,1490000,1503100,5914800,1493870.0\n571,04/07/2000,00:00,1515600,1521300,1505000,1517800,5785800,1510470.0\n572,04/10/2000,00:00,1517500,1531100,1503100,1507800,9456200,1516880.0\n573,04/11/2000,00:00,1500000,1516300,1483800,1500600,13823200,1512110.0\n574,04/12/2000,00:00,1503800,1511600,1465600,1466300,9981900,1471880.0\n575,04/13/2000,00:00,1474700,1481600,1437800,1440000,11909800,1427370.0\n576,04/14/2000,00:00,1426300,1428100,1335000,1358100,27304000,1346560.0\n577,04/17/2000,00:00,1351900,1401300,1266900,1400600,23564600,1340660.0\n578,04/18/2000,00:00,1405600,1442200,1397800,1442200,10593700,1395160.0\n579,04/19/2000,00:00,1445000,1451300,1425300,1430000,6276600,1433410.0\n580,04/20/2000,00:00,1435600,1439400,1423800,1433800,8187000,1467180.0\n581,04/24/2000,00:00,1415000,1432800,1405000,1430000,12621000,1442440.0\n582,04/25/2000,00:00,1446300,1479700,1444400,1478800,13812600,1464920.0\n583,04/26/2000,00:00,1479700,1487500,1460000,1463800,7411100,1481060.0\n584,04/27/2000,00:00,1430000,1473400,1430000,1465000,15325600,1483140.0\n585,04/28/2000,00:00,1470000,1478600,1450600,1452200,8173500,1467140.0\n586,05/01/2000,00:00,1465600,1484800,1436300,1471900,6737100,1458720.0\n587,05/02/2000,00:00,1455000,1471300,1445000,1446300,8785100,1451410.0\n588,05/03/2000,00:00,1440000,1440000,1397800,1416300,11442100,1419350.0\n589,05/04/2000,00:00,1420000,1423600,1407500,1413100,5713300,1399820.0\n590,05/05/2000,00:00,1410600,1440000,1409400,1433400,7416300,1403140.0\n591,05/08/2000,00:00,1427500,1433800,1418400,1425300,4530300,1419410.0\n592,05/09/2000,00:00,1430600,1434100,1402700,1416300,5299000,1424540.0\n593,05/10/2000,00:00,1405000,1409700,1377500,1385900,9882100,1393350.0\n594,05/11/2000,00:00,1401300,1415000,1391300,1411100,6838500,1389200.0\n595,05/12/2000,00:00,1418100,1434700,1415600,1424100,5805300,1410260.0\n596,05/15/2000,00:00,1427500,1455900,1420000,1453800,4193500,1452200.0\n597,05/16/2000,00:00,1465600,1477200,1453100,1470000,7907600,1492250.0\n598,05/17/2000,00:00,1456900,1461900,1444700,1452500,5507300,1480910.0\n599,05/18/2000,00:00,1456300,1463100,1439400,1440600,4718200,1457710.0\n600,05/19/2000,00:00,1425600,1432300,1404100,1408800,5731800,1409320.0\n601,05/22/2000,00:00,1412500,1414700,1370000,1404100,10008900,1382550.0\n602,05/23/2000,00:00,1404400,1408100,1375600,1375600,7422700,1359230.0\n603,05/24/2000,00:00,1380000,1406900,1276300,1404100,10710100,1374780.0\n604,05/25/2000,00:00,1406900,1418100,1377200,1388800,7101900,1384280.0\n605,05/26/2000,00:00,1388100,1396900,1373300,1383100,4605900,1382500.0\n606,05/30/2000,00:00,1400000,1426900,1394700,1426300,5037500,1419700.0\n607,05/31/2000,00:00,1425600,1440000,1420900,1424100,5541700,1428530.0\n608,06/01/2000,00:00,1436900,1453800,1430000,1451700,8473400,1464840.0\n609,06/02/2000,00:00,1489400,1490900,1474800,1480900,8538300,1499520.0\n610,06/05/2000,00:00,1474700,1482200,1468800,1472500,6629400,1495860.0\n611,06/06/2000,00:00,1466300,1477800,1459100,1463400,4847700,1488340.0\n612,06/07/2000,00:00,1466300,1480000,1460000,1475600,4402800,1477910.0\n613,06/08/2000,00:00,1475000,1477500,1460600,1465600,5458000,1463350.0\n614,06/09/2000,00:00,1475000,1479700,1455300,1463400,2865600,1463300.0\n615,06/12/2000,00:00,1469700,1469700,1451300,1452800,3294200,1454140.0\n616,06/13/2000,00:00,1448100,1477500,1446300,1474700,6277200,1462040.0\n617,06/14/2000,00:00,1482500,1488800,1471900,1475000,6227300,1475330.0\n618,06/15/2000,00:00,1481300,1487500,1468400,1482500,5566200,1487800.0\n619,06/16/2000,00:00,1483100,1483100,1458800,1468800,5010200,1482700.0\n620,06/19/2000,00:00,1464700,1491600,1462500,1486600,4748700,1482800.0\n621,06/20/2000,00:00,1481900,1488800,1470000,1478100,8314200,1481290.0\n622,06/21/2000,00:00,1469400,1484400,1468900,1479500,2953900,1480090.0\n623,06/22/2000,00:00,1475600,1476900,1450000,1455300,7127200,1463430.0\n624,06/23/2000,00:00,1458100,1461300,1438800,1443800,4198700,1436140.0\n625,06/26/2000,00:00,1453800,1462500,1448800,1457500,4770700,1439770.0\n626,06/27/2000,00:00,1459800,1467200,1453100,1455600,3585500,1444660.0\n627,06/28/2000,00:00,1456300,1469800,1452200,1456300,5585500,1457840.0\n628,06/29/2000,00:00,1447500,1457500,1435200,1444400,6081000,1451520.0\n629,06/30/2000,00:00,1439400,1455300,1438900,1453800,6673700,1447940.0\n630,07/03/2000,00:00,1454400,1474400,1451600,1472800,1436600,1466150.0\n631,07/05/2000,00:00,1463800,1466600,1443800,1450900,2447900,1460920.0\n632,07/06/2000,00:00,1449400,1464700,1442200,1458800,5394400,1463910.0\n633,07/07/2000,00:00,1466900,1487800,1462200,1480900,2796000,1475500.0\n634,07/10/2000,00:00,1478800,1489100,1476300,1479700,2468600,1481760.0\n635,07/11/2000,00:00,1474700,1491300,1471600,1483800,5233700,1496830.0\n636,07/12/2000,00:00,1492800,1501300,1486900,1495900,5507100,1502950.0\n637,07/13/2000,00:00,1499800,1503800,1491900,1498800,5108200,1503420.0\n638,07/14/2000,00:00,1504400,1512500,1496700,1508800,5512500,1515360.0\n639,07/17/2000,00:00,1509800,1519800,1506900,1510600,3566600,1519530.0\n640,07/18/2000,00:00,1506300,1506300,1493400,1496900,3678300,1506340.0\n641,07/19/2000,00:00,1494700,1499100,1482500,1484400,8163200,1487690.0\n642,07/20/2000,00:00,1490000,1505000,1488100,1498100,4139400,1485480.0\n643,07/21/2000,00:00,1497500,1497500,1478800,1482500,5062300,1478000.0\n644,07/24/2000,00:00,1481300,1488600,1465600,1466600,5520000,1466950.0\n645,07/25/2000,00:00,1477500,1478400,1467800,1474400,4247400,1465750.0\n646,07/26/2000,00:00,1469700,1471600,1456400,1461600,11008600,1452310.0\n647,07/27/2000,00:00,1459400,1466300,1446900,1455000,7169400,1450020.0\n648,07/28/2000,00:00,1457200,1459100,1415200,1422500,5674800,1423740.0\n649,07/31/2000,00:00,1429400,1441300,1420600,1434400,4837700,1413850.0\n650,08/01/2000,00:00,1436300,1447200,1431300,1440000,3742800,1423560.0\n651,08/02/2000,00:00,1438800,1454100,1436300,1442700,7275200,1436790.0\n652,08/03/2000,00:00,1428800,1458100,1426300,1455000,4363300,1460910.0\n653,08/04/2000,00:00,1463100,1467200,1454100,1465300,3492400,1470520.0\n654,08/07/2000,00:00,1467200,1484400,1463800,1481300,4067300,1488420.0\n655,08/08/2000,00:00,1475000,1488100,1475000,1485600,3161200,1499610.0\n656,08/09/2000,00:00,1491400,1492200,1473800,1476900,5205000,1492050.0\n657,08/10/2000,00:00,1475300,1478600,1462800,1465600,3987200,1473800.0\n658,08/11/2000,00:00,1466300,1480000,1455600,1474400,4739000,1466620.0\n659,08/14/2000,00:00,1477800,1495000,1470600,1493800,2682600,1483430.0\n660,08/15/2000,00:00,1493400,1498100,1473400,1490200,4731200,1496620.0\n661,08/16/2000,00:00,1493100,1499400,1478400,1483800,4843200,1497220.0\n662,08/17/2000,00:00,1486900,1504400,1483400,1499400,5401400,1500320.0\n663,08/18/2000,00:00,1503800,1503800,1491600,1496700,4350300,1497280.0\n664,08/21/2000,00:00,1500300,1507200,1494100,1503600,2058200,1506650.0\n665,08/22/2000,00:00,1505600,1513100,1500900,1502300,2831300,1509520.0\n666,08/23/2000,00:00,1498100,1512800,1491900,1509100,5518000,1509720.0\n667,08/24/2000,00:00,1511600,1515500,1500900,1514400,4636200,1517490.0\n668,08/25/2000,00:00,1511600,1516300,1509400,1510900,2700900,1516070.0\n669,08/28/2000,00:00,1512500,1529100,1512500,1517800,5721600,1520740.0\n670,08/29/2000,00:00,1514400,1518800,1509100,1515000,3375600,1518000.0\n671,08/30/2000,00:00,1513100,1517800,1504500,1506300,3854400,1509250.0\n672,08/31/2000,00:00,1510600,1530900,1508400,1522500,5246300,1518010.0\n673,09/01/2000,00:00,1532500,1535900,1520000,1525600,2983800,1524370.0\n674,09/05/2000,00:00,1518800,1522000,1508100,1512500,3202700,1520670.0\n675,09/06/2000,00:00,1511900,1519500,1496900,1496900,3930600,1504120.0\n676,09/07/2000,00:00,1502500,1510800,1498300,1507500,4187500,1495390.0\n677,09/08/2000,00:00,1502800,1505000,1493300,1497500,3067500,1489640.0\n678,09/11/2000,00:00,1497500,1511900,1486900,1494700,3726500,1491320.0\n679,09/12/2000,00:00,1497500,1502500,1484400,1487500,4628300,1487340.0\n680,09/13/2000,00:00,1480000,1498400,1476600,1488800,4335400,1480980.0\n681,09/14/2000,00:00,1498800,1499400,1481600,1485300,3442900,1481670.0\n682,09/15/2000,00:00,1481900,1482500,1460300,1467500,3880800,1467780.0\n683,09/18/2000,00:00,1463800,1469700,1442000,1446900,4960300,1444450.0\n684,09/19/2000,00:00,1451300,1463100,1447000,1460800,6372400,1441540.0\n685,09/20/2000,00:00,1456900,1460300,1431600,1452200,6594700,1440670.0\n686,09/21/2000,00:00,1444700,1455600,1437500,1450300,4911900,1446810.0\n687,09/22/2000,00:00,1426300,1451600,1421300,1451600,7241600,1452030.0\n688,09/25/2000,00:00,1459400,1460600,1437200,1441300,9551700,1439360.0\n689,09/26/2000,00:00,1443800,1450000,1426300,1428900,4889400,1428180.0\n690,09/27/2000,00:00,1435600,1439700,1421300,1428100,5471600,1419910.0\n691,09/28/2000,00:00,1431900,1463300,1428900,1461900,6598400,1444580.0\n692,09/29/2000,00:00,1454700,1459700,1437500,1437800,7669100,1447400.0\n693,10/02/2000,00:00,1442800,1449100,1431400,1438100,5182100,1447390.0\n694,10/03/2000,00:00,1445300,1457500,1425300,1426300,8184100,1430220.0\n695,10/04/2000,00:00,1428800,1442500,1417500,1435800,5717600,1420870.0\n696,10/05/2000,00:00,1434100,1448400,1433100,1438800,4038600,1435270.0\n697,10/06/2000,00:00,1438800,1446400,1397500,1410000,9717900,1416690.0\n698,10/09/2000,00:00,1413100,1413100,1393800,1404400,4323000,1402180.0\n699,10/10/2000,00:00,1400900,1412500,1385600,1388800,5724500,1377040.0\n700,10/11/2000,00:00,1376300,1386300,1351300,1365600,10570900,1351240.0\n701,10/12/2000,00:00,1372800,1433800,1327800,1331600,11288200,1321400.0\n702,10/13/2000,00:00,1329400,1376600,1328800,1375600,10629900,1338760.0\n703,10/16/2000,00:00,1374100,1390000,1366900,1374700,5407400,1361800.0\n704,10/17/2000,00:00,1384400,1385600,1344100,1354800,7302200,1366910.0\n705,10/18/2000,00:00,1326300,1361300,1301600,1344100,9962600,1357420.0\n706,10/19/2000,00:00,1368400,1394500,1364400,1390500,8309100,1367700.0\n707,10/20/2000,00:00,1383800,1411900,1383800,1398800,6603800,1397750.0\n708,10/23/2000,00:00,1399400,1410300,1389400,1400000,5066000,1421170.0\n709,10/24/2000,00:00,1409700,1419400,1390000,1401300,5115800,1424110.0\n710,10/25/2000,00:00,1387500,1395600,1363900,1369200,7817300,1379930.0\n711,10/26/2000,00:00,1371300,1376600,1340000,1367500,8644800,1359340.0\n712,10/27/2000,00:00,1378800,1388400,1366300,1383800,9866200,1364500.0\n713,10/30/2000,00:00,1384400,1410900,1381600,1402500,8510100,1389960.0\n714,10/31/2000,00:00,1410200,1436900,1400600,1429700,8131100,1437340.0\n715,11/01/2000,00:00,1422500,1432500,1412200,1424100,6349600,1449250.0\n716,11/02/2000,00:00,1431600,1439100,1425200,1430300,4360600,1448460.0\n717,11/03/2000,00:00,1434700,1437500,1423800,1431100,4853300,1440880.0\n718,11/06/2000,00:00,1431600,1443000,1430300,1437000,3814400,1436920.0\n719,11/07/2000,00:00,1431400,1440000,1425600,1436600,5032700,1441330.0\n720,11/08/2000,00:00,1440600,1440600,1410300,1412500,5889100,1420470.0\n721,11/09/2000,00:00,1400000,1412200,1372500,1404100,9700200,1400710.0\n722,11/10/2000,00:00,1390000,1394700,1368800,1369700,8316000,1361850.0\n723,11/13/2000,00:00,1356300,1369800,1330200,1353800,16883900,1332820.0\n724,11/14/2000,00:00,1374700,1396300,1370000,1387500,7432300,1355430.0\n725,11/15/2000,00:00,1390600,1401100,1377500,1391300,7877100,1378940.0\n726,11/16/2000,00:00,1385800,1398800,1373100,1377700,6418000,1392050.0\n727,11/17/2000,00:00,1373100,1390000,1357500,1374700,6429800,1386600.0\n728,11/20/2000,00:00,1357500,1363800,1343800,1346900,5017900,1346280.0\n729,11/21/2000,00:00,1348800,1361900,1335200,1351600,4344600,1335380.0\n730,11/22/2000,00:00,1343400,1348800,1324400,1325000,5285300,1316630.0\n731,11/24/2000,00:00,1336300,1349700,1335600,1348400,3412100,1326970.0\n732,11/27/2000,00:00,1364700,1366900,1353100,1355000,5997600,1349280.0\n733,11/28/2000,00:00,1351300,1365900,1338100,1338100,4190100,1344520.0\n734,11/29/2000,00:00,1343800,1359100,1332700,1346400,6534900,1352330.0\n735,11/30/2000,00:00,1325000,1335000,1297500,1316300,10401100,1319000.0\n736,12/01/2000,00:00,1331900,1340600,1310000,1318800,7233600,1306660.0\n737,12/04/2000,00:00,1318800,1338800,1315000,1330000,6328000,1316780.0\n738,12/05/2000,00:00,1348800,1381900,1344100,1381300,8270800,1363610.0\n739,12/06/2000,00:00,1377800,1383400,1350300,1355300,12544800,1382490.0\n740,12/07/2000,00:00,1348800,1358800,1343800,1349800,5966200,1373230.0\n741,12/08/2000,00:00,1370600,1391300,1360900,1376600,8949000,1377110.0\n742,12/11/2000,00:00,1373800,1488800,1367200,1386300,5943200,1379250.0\n743,12/12/2000,00:00,1381900,1392500,1373800,1377500,4619700,1393370.0\n744,12/13/2000,00:00,1392500,1394100,1362500,1365300,5580800,1380670.0\n745,12/14/2000,00:00,1358800,1365000,1341900,1341900,7348300,1342400.0\n746,12/15/2000,00:00,1331300,1332500,1305600,1314500,8490700,1303340.0\n747,12/18/2000,00:00,1110000,1334700,1110000,1323800,6906100,1297140.0\n748,12/19/2000,00:00,1324700,1349700,1305000,1305600,9054500,1288970.0\n749,12/20/2000,00:00,1286300,1289400,1239400,1266900,9490400,1262870.0\n750,12/21/2000,00:00,1260000,1288600,1255300,1276900,14252300,1257910.0\n751,12/22/2000,00:00,1290000,1308600,1288400,1308600,8862700,1278630.0\n752,12/26/2000,00:00,1308400,1319400,1302800,1318900,4395100,1315870.0\n753,12/27/2000,00:00,1320000,1336600,1312500,1331300,5193500,1351760.0\n754,12/28/2000,00:00,1328100,1338100,1325900,1336100,7872300,1356690.0\n755,12/29/2000,00:00,1340600,1342800,1318800,1322500,7564700,1336980.0\n756,01/02/2001,00:00,1320000,1321600,1275600,1282500,8348100,1293780.0\n757,01/03/2001,00:00,1283100,1360000,1276600,1350000,17057200,1319620.0\n758,01/04/2001,00:00,1349400,1354700,1330000,1334100,8331000,1332090.0\n759,01/05/2001,00:00,1334700,1336300,1292800,1302500,12281600,1321800.0\n760,01/08/2001,00:00,1298800,1300600,1276300,1297500,6134300,1308070.0\n761,01/09/2001,00:00,1310500,1315000,1296300,1301300,5161100,1276880.0\n762,01/10/2001,00:00,1290000,1318100,1288100,1316600,8509500,1299540.0\n763,01/11/2001,00:00,1310900,1334800,1310900,1327700,6271200,1329970.0\n764,01/12/2001,00:00,1326900,1337200,1312800,1319100,6402300,1333320.0\n765,01/16/2001,00:00,1320000,1331900,1315200,1325800,7763000,1333550.0\n766,01/17/2001,00:00,1348400,1350500,1326400,1329400,7793500,1330830.0\n767,01/18/2001,00:00,1334400,1357000,1329400,1350500,8764500,1347270.0\n768,01/19/2001,00:00,1361900,1361900,1338800,1344800,7353300,1356750.0\n769,01/22/2001,00:00,1342500,1357800,1335600,1346300,7091800,1356280.0\n770,01/23/2001,00:00,1344700,1366600,1341600,1361300,8381500,1364340.0\n771,01/24/2001,00:00,1362500,1373100,1358400,1366900,5708800,1368750.0\n772,01/25/2001,00:00,1362500,1372500,1356600,1360600,10440400,1371640.0\n773,01/26/2001,00:00,1351600,1361300,1344500,1357800,7049800,1365270.0\n774,01/29/2001,00:00,1355000,1369000,1353700,1366500,6346400,1363010.0\n775,01/30/2001,00:00,1363000,1379200,1357900,1377500,6535400,1373990.0\n776,01/31/2001,00:00,1374000,1387000,1366000,1370600,9018400,1378510.0\n777,02/01/2001,00:00,1371000,1375600,1362500,1374800,7899200,1380870.0\n778,02/02/2001,00:00,1374000,1379900,1350000,1350800,7931800,1357810.0\n779,02/05/2001,00:00,1348000,1359000,1347500,1358900,3758500,1349420.0\n780,02/06/2001,00:00,1353000,1367000,1352200,1354200,6830900,1347250.0\n781,02/07/2001,00:00,1347200,1354200,1336800,1342200,5602500,1337640.0\n782,02/08/2001,00:00,1348000,1354000,1334800,1334800,5591600,1333570.0\n783,02/09/2001,00:00,1333500,1333500,1312600,1318300,9406500,1311500.0\n784,02/12/2001,00:00,1317000,1335000,1317000,1331400,5507600,1315330.0\n785,02/13/2001,00:00,1337000,1341700,1320000,1321200,5986900,1315960.0\n786,02/14/2001,00:00,1326500,1326500,1306600,1321500,8150200,1318330.0\n787,02/15/2001,00:00,1328400,1335200,1319900,1329600,5417200,1328210.0\n788,02/16/2001,00:00,1310000,1312900,1293000,1304600,10245800,1308100.0\n789,02/20/2001,00:00,1310400,1311400,1281000,1283200,5457000,1284150.0\n790,02/21/2001,00:00,1279000,1288400,1255200,1256000,10237700,1245760.0\n791,02/22/2001,00:00,1263500,1265400,1230200,1255200,21327100,1226500.0\n792,02/23/2001,00:00,1250800,1255400,1218000,1248900,15540300,1227760.0\n793,02/26/2001,00:00,1258000,1272100,1245000,1272100,9555900,1254290.0\n794,02/27/2001,00:00,1268000,1278400,1255100,1263500,10871500,1268710.0\n795,02/28/2001,00:00,1267500,1268400,1232700,1241500,13986800,1252400.0\n796,03/01/2001,00:00,1240500,1245000,1217500,1244900,13921800,1242600.0\n797,03/02/2001,00:00,1225000,1256500,1223000,1237700,12367500,1225720.0\n798,03/05/2001,00:00,1241500,1247800,1238100,1244000,4718700,1233480.0\n799,03/06/2001,00:00,1263500,1277500,1254900,1258700,6597400,1255410.0\n800,03/07/2001,00:00,1269000,1269000,1257600,1266400,6407800,1269540.0\n801,03/08/2001,00:00,1266000,1272400,1261000,1269000,5554000,1280660.0\n802,03/09/2001,00:00,1261000,1261000,1231100,1236700,9754500,1253670.0\n803,03/12/2001,00:00,1223400,1245000,1177000,1184400,11973300,1189550.0\n804,03/13/2001,00:00,1194000,1204400,1175300,1202000,12711300,1167680.0\n805,03/14/2001,00:00,1170500,1192900,1157500,1172000,17316500,1144210.0\n806,03/15/2001,00:00,1184500,1188600,1175100,1177100,8083600,1154960.0\n807,03/16/2001,00:00,1171300,1185000,1144600,1153100,35979400,1151470.0\n808,03/19/2001,00:00,1157600,1176900,1148200,1173000,9638200,1152370.0\n809,03/20/2001,00:00,1179000,1184600,1141500,1142500,13717000,1144610.0\n810,03/21/2001,00:00,1141800,1152600,1119000,1123400,18086400,1118420.0\n811,03/22/2001,00:00,1120200,1157000,1080400,1119000,25414600,1106860.0\n812,03/23/2001,00:00,1132500,1144800,1115000,1142500,12191600,1114730.0\n813,03/26/2001,00:00,1157000,1162700,1147700,1155000,9392300,1149710.0\n814,03/27/2001,00:00,1156200,1186500,1152500,1185100,12432000,1192820.0\n815,03/28/2001,00:00,1169000,1175000,1149000,1154500,10194300,1185300.0\n816,03/29/2001,00:00,1147000,1166000,1093400,1149800,11463600,1161610.0\n817,03/30/2001,00:00,1155500,1166500,1145000,1161200,8495500,1154250.0\n818,04/02/2001,00:00,1163000,1173800,1138000,1145400,10040900,1137390.0\n819,04/03/2001,00:00,1139800,1141500,1101000,1106700,12365600,1113520.0\n820,04/04/2001,00:00,1105800,1121000,1093000,1103100,14720900,1088870.0\n821,04/05/2001,00:00,1133000,1154900,1125000,1152200,15035600,1115630.0\n822,04/06/2001,00:00,1139900,1144000,1120600,1130500,14400500,1132290.0\n823,04/09/2001,00:00,1140000,1154800,1127800,1140000,8617400,1154700.0\n824,04/10/2001,00:00,1154500,1177500,1151700,1170900,15812700,1176360.0\n825,04/11/2001,00:00,1187800,1189900,1161400,1169600,12328300,1175200.0\n826,04/12/2001,00:00,1163000,1186300,1159600,1185500,8316200,1201180.0\n827,04/16/2001,00:00,1182900,1188900,1169100,1182300,6587800,1199420.0\n828,04/17/2001,00:00,1173100,1196600,1170200,1194200,9952300,1198290.0\n829,04/18/2001,00:00,1210600,1260000,1206900,1241400,19909300,1240290.0\n830,04/19/2001,00:00,1242500,1258300,1200000,1257200,13370400,1272870.0\n831,04/20/2001,00:00,1249000,1254000,1236600,1243600,7779700,1279420.0\n832,04/23/2001,00:00,1236500,1263000,1219100,1227000,8156500,1253020.0\n833,04/24/2001,00:00,1225200,1237000,1211000,1211300,9259600,1208980.0\n834,04/25/2001,00:00,1214200,1236700,1209500,1231000,7959200,1208610.0\n835,04/26/2001,00:00,1237300,1252200,1235000,1237400,9880700,1227540.0\n836,04/27/2001,00:00,1249200,1256800,1242000,1255500,7258700,1257370.0\n837,04/30/2001,00:00,1264500,1272700,1246700,1252100,8758500,1269290.0\n838,05/01/2001,00:00,1250700,1269700,1246000,1269500,10205900,1276610.0\n839,05/02/2001,00:00,1274100,1276900,1260000,1268900,9164600,1279780.0\n840,05/03/2001,00:00,1261300,1261500,1242200,1251600,9322200,1262220.0\n841,05/04/2001,00:00,1236500,1272000,1234400,1269500,12084200,1267390.0\n842,05/07/2001,00:00,1268600,1274700,1255300,1265700,6651400,1262940.0\n843,05/08/2001,00:00,1268600,1271000,1255600,1265200,6522000,1266190.0\n844,05/09/2001,00:00,1252500,1266000,1250600,1258700,9240800,1265110.0\n845,05/10/2001,00:00,1272600,1275000,1257700,1259900,6503700,1255940.0\n846,05/11/2001,00:00,1260000,1264900,1244000,1248200,7394500,1247450.0\n847,05/14/2001,00:00,1249000,1254400,1244600,1252300,7793600,1245970.0\n848,05/15/2001,00:00,1255500,1265000,1248500,1253000,8986500,1248720.0\n849,05/16/2001,00:00,1248400,1292000,1246200,1289600,12431300,1279860.0\n850,05/17/2001,00:00,1290100,1300800,1285600,1293100,11930400,1305370.0\n851,05/18/2001,00:00,1290900,1297200,1281000,1296200,6030000,1315210.0\n852,05/21/2001,00:00,1298400,1318000,1291500,1317700,11722200,1330720.0\n853,05/22/2001,00:00,1318300,1320900,1310700,1313700,7704800,1323900.0\n854,05/23/2001,00:00,1310500,1310500,1292900,1292900,11528900,1307850.0\n855,05/24/2001,00:00,1294700,1300000,1249000,1297000,7410400,1296540.0\n856,05/25/2001,00:00,1296500,1297000,1280100,1282300,7097400,1274470.0\n857,05/29/2001,00:00,1282300,1283500,1269000,1273000,8350400,1264180.0\n858,05/30/2001,00:00,1265900,1275300,1250000,1252900,9937200,1248420.0\n859,05/31/2001,00:00,1254300,1267600,1252600,1261000,9468700,1242820.0\n860,06/01/2001,00:00,1262000,1271000,1251200,1266400,8898100,1253980.0\n861,06/04/2001,00:00,1268000,1272700,1258900,1271700,5421400,1268270.0\n862,06/05/2001,00:00,1274900,1292300,1272700,1288700,8082500,1292830.0\n863,06/06/2001,00:00,1288300,1288300,1273600,1275300,12487900,1287890.0\n864,06/07/2001,00:00,1270500,1282900,1270000,1282400,6862800,1287580.0\n865,06/08/2001,00:00,1277000,1278700,1261400,1270000,7278100,1274710.0\n866,06/11/2001,00:00,1267100,1277500,1254100,1259400,7055200,1255990.0\n867,06/12/2001,00:00,1248600,1268800,1240400,1261300,9128400,1254380.0\n868,06/13/2001,00:00,1261700,1265800,1246700,1247400,8230500,1240490.0\n869,06/14/2001,00:00,1241800,1243000,1222400,1224800,12436500,1221860.0\n870,06/15/2001,00:00,1209100,1224000,1204000,1216200,16676600,1204950.0\n871,06/18/2001,00:00,1216500,1224400,1209500,1210800,7895700,1192440.0\n872,06/19/2001,00:00,1223800,1228900,1208600,1214600,7655100,1198880.0\n873,06/20/2001,00:00,1211900,1228600,1211000,1226000,8120400,1218720.0\n874,06/21/2001,00:00,1222200,1274700,1221500,1238600,11993900,1239240.0\n875,06/22/2001,00:00,1234900,1236000,1221600,1227500,11803800,1240720.0\n876,06/25/2001,00:00,1232800,1234400,1215000,1221300,8064300,1230070.0\n877,06/26/2001,00:00,1209000,1229000,1200300,1218400,8014800,1216610.0\n878,06/27/2001,00:00,1216000,1251500,1209100,1213100,9785600,1205750.0\n879,06/28/2001,00:00,1220000,1239400,1219300,1228900,9986900,1220220.0\n880,06/29/2001,00:00,1228000,1240100,1222600,1232000,9113800,1232310.0\n881,07/02/2001,00:00,1228000,1243200,1226200,1239000,8031000,1244310.0\n882,07/03/2001,00:00,1239800,1241000,1230500,1240800,3305300,1250410.0\n883,07/05/2001,00:00,1230700,1236500,1221100,1221300,4818400,1230480.0\n884,07/06/2001,00:00,1213100,1215800,1190500,1191900,9531300,1195630.0\n885,07/09/2001,00:00,1194900,1205400,1192000,1201000,8274300,1181330.0\n886,07/10/2001,00:00,1202900,1206400,1182100,1183500,8339800,1167230.0\n887,07/11/2001,00:00,1181000,1190400,1170900,1182700,14904100,1170400.0\n888,07/12/2001,00:00,1195000,1214700,1193100,1211600,11252600,1200470.0\n889,07/13/2001,00:00,1208400,1223200,1206200,1219000,9992900,1218790.0\n890,07/16/2001,00:00,1217700,1222800,1202900,1206000,6321000,1224950.0\n891,07/17/2001,00:00,1202000,1219400,1198300,1216700,7384300,1225920.0\n892,07/18/2001,00:00,1205600,1216400,1200600,1211000,6678700,1211810.0\n893,07/19/2001,00:00,1221800,1229800,1207600,1218300,9143600,1215280.0\n894,07/20/2001,00:00,1211500,1219400,1209200,1214500,8514700,1218880.0\n895,07/23/2001,00:00,1218000,1218800,1192200,1193600,7405300,1198010.0\n896,07/24/2001,00:00,1190000,1192000,1167500,1173900,11894500,1172590.0\n897,07/25/2001,00:00,1179200,1194800,1174600,1193000,11752400,1171300.0\n898,07/26/2001,00:00,1190600,1208500,1185600,1207500,12583600,1192120.0\n899,07/27/2001,00:00,1208300,1216000,1199100,1210000,8333200,1215520.0\n900,07/30/2001,00:00,1211900,1213500,1203000,1208200,8736400,1224200.0\n901,07/31/2001,00:00,1210000,1226800,1201800,1214600,11528000,1219830.0\n902,08/01/2001,00:00,1219700,1227000,1209000,1219600,11666400,1220620.0\n903,08/02/2001,00:00,1232300,1233500,1214600,1223800,10605300,1226940.0\n904,08/03/2001,00:00,1223600,1223700,1202000,1218700,10527700,1226040.0\n905,08/06/2001,00:00,1213500,1215100,1201000,1204500,7974000,1209910.0\n906,08/07/2001,00:00,1202700,1215300,1199100,1208300,8373000,1202410.0\n907,08/08/2001,00:00,1201200,1211600,1184300,1186500,14886400,1182860.0\n908,08/09/2001,00:00,1187000,1189700,1178600,1187400,13918500,1176900.0\n909,08/10/2001,00:00,1188000,1198400,1173400,1194400,11299200,1183890.0\n910,08/13/2001,00:00,1196000,1198500,1188200,1194900,7194100,1188630.0\n911,08/14/2001,00:00,1201400,1203500,1188000,1191100,13026500,1195870.0\n912,08/15/2001,00:00,1192300,1196100,1181600,1182800,8303100,1186370.0\n913,08/16/2001,00:00,1178000,1187500,1170000,1186200,10275800,1181330.0\n914,08/17/2001,00:00,1176500,1178700,1160100,1166400,10893500,1165710.0\n915,08/20/2001,00:00,1168000,1176600,1165500,1175600,9717400,1166200.0\n916,08/21/2001,00:00,1178000,1185400,1080500,1161300,13952900,1158380.0\n917,08/22/2001,00:00,1167500,1174300,1157800,1170500,11224700,1161050.0\n918,08/23/2001,00:00,1169600,1175200,1165200,1167000,8169600,1166990.0\n919,08/24/2001,00:00,1172100,1191000,1166500,1190000,11056100,1183230.0\n920,08/27/2001,00:00,1189700,1192000,1182600,1184900,6219700,1194750.0\n921,08/28/2001,00:00,1182800,1184900,1165900,1166400,11146700,1178670.0\n922,08/29/2001,00:00,1171300,1171800,1151700,1154000,15345700,1157580.0\n923,08/30/2001,00:00,1148500,1159100,1120100,1132800,16303700,1122030.0\n924,08/31/2001,00:00,1134000,1147700,1131300,1139200,15875800,1117960.0\n925,09/04/2001,00:00,1138500,1167900,1134400,1136500,22807100,1123400.0\n926,09/05/2001,00:00,1137000,1141900,1119500,1136500,20800000,1130410.0\n927,09/06/2001,00:00,1126500,1133000,1110900,1111000,20895800,1117310.0\n928,09/07/2001,00:00,1100200,1112500,1086900,1091300,30316100,1086510.0\n929,09/10/2001,00:00,1077000,1110700,1075500,1098300,23040200,1078240.0\n930,09/17/2001,00:00,1010000,1065100,1000000,1043000,32337700,1036110.0\n931,09/18/2001,00:00,1043300,1053000,1033600,1039000,21762400,1018830.0\n932,09/19/2001,00:00,1041000,1045000,985600,1020200,43139900,997910.0\n933,09/20/2001,00:00,1004000,1018500,985700,989600,37685200,965960.0\n934,09/21/2001,00:00,940500,997000,938000,968500,49249900,952540.0\n935,09/24/2001,00:00,997300,1011600,990600,1004800,24672600,968390.0\n936,09/25/2001,00:00,1007500,1020000,999000,1014000,25190100,1000260.0\n937,09/26/2001,00:00,1023500,1024000,1004300,1010000,17174200,1023270.0\n938,09/27/2001,00:00,1012500,1022500,1000000,1020500,19974800,1036320.0\n939,09/28/2001,00:00,1029800,1099200,1025000,1042500,21208700,1042930.0\n940,10/01/2001,00:00,1039000,1043200,1024200,1040000,21059700,1050750.0\n941,10/02/2001,00:00,1040000,1053800,1030700,1053800,18549500,1065490.0\n942,10/03/2001,00:00,1046000,1078800,1043500,1073400,30475800,1081170.0\n943,10/04/2001,00:00,1082900,1089700,1043700,1071000,31695300,1083260.0\n944,10/05/2001,00:00,1072500,1076200,1055200,1072600,28749400,1086880.0\n945,10/08/2001,00:00,1062800,1073000,1058700,1065300,11713400,1073880.0\n946,10/09/2001,00:00,1066100,1067500,1056000,1058700,15220700,1057670.0\n947,10/10/2001,00:00,1058000,1085500,1055200,1084000,18755600,1073950.0\n948,10/11/2001,00:00,1089500,1103000,1089500,1100100,24722000,1098250.0\n949,10/12/2001,00:00,1091500,1098900,1073000,1094500,30699900,1110460.0\n950,10/15/2001,00:00,1086300,1094500,1071900,1093000,25426400,1109790.0\n951,10/16/2001,00:00,1098000,1106200,1089500,1100600,15043500,1102270.0\n952,10/17/2001,00:00,1110700,1111500,1079000,1079000,27566600,1082610.0\n953,10/18/2001,00:00,1078200,1081600,1067400,1072100,16793600,1070200.0\n954,10/19/2001,00:00,1070000,1079200,1060100,1075500,22435500,1064990.0\n955,10/22/2001,00:00,1073000,1094900,1072100,1092600,17101100,1078110.0\n956,10/23/2001,00:00,1099600,1106100,1083800,1088000,21806000,1092990.0\n957,10/24/2001,00:00,1089800,1099400,1081200,1087700,15508500,1096290.0\n958,10/25/2001,00:00,1074500,1103300,1067400,1103100,26339700,1104470.0\n959,10/26/2001,00:00,1099500,1118000,1096400,1107700,18892000,1109410.0\n960,10/29/2001,00:00,1101600,1105500,1080600,1082300,17805500,1096340.0\n961,10/30/2001,00:00,1073500,1077000,1055600,1062000,25662200,1066900.0\n962,10/31/2001,00:00,1069000,1078600,1060100,1062700,27388000,1045610.0\n963,11/01/2001,00:00,1066000,1090100,1054300,1086700,28591900,1061800.0\n964,11/02/2001,00:00,1084400,1093800,1078700,1090600,16378300,1089250.0\n965,11/05/2001,00:00,1101200,1110900,1007400,1105800,15885700,1116210.0\n966,11/06/2001,00:00,1103500,1124500,1098500,1122900,22531600,1135590.0\n967,11/07/2001,00:00,1117700,1131200,1115600,1119600,19023300,1134550.0\n968,11/08/2001,00:00,1128700,1226600,1104500,1123500,21245000,1136360.0\n969,11/09/2001,00:00,1122500,1129600,1114400,1124400,16170300,1130580.0\n970,11/12/2001,00:00,1110000,1126500,1100000,1121600,25038200,1123060.0\n971,11/13/2001,00:00,1134400,1144300,1131800,1143900,14030800,1140610.0\n972,11/14/2001,00:00,1151700,1154000,1137000,1146200,17418000,1151390.0\n973,11/15/2001,00:00,1143700,1151800,1139300,1146000,20437200,1156760.0\n974,11/16/2001,00:00,1150800,1151000,1134000,1143100,17188100,1153690.0\n975,11/19/2001,00:00,1149200,1155700,1144500,1155300,12517900,1152810.0\n976,11/20/2001,00:00,1153700,1158000,1111500,1148100,15890300,1151670.0\n977,11/21/2001,00:00,1145000,1146700,1135100,1141500,10996400,1145600.0\n978,11/23/2001,00:00,1140400,1186300,1140000,1155200,7265300,1151760.0\n979,11/26/2001,00:00,1157500,1163400,1150700,1162200,13697200,1158730.0\n980,11/27/2001,00:00,1156200,1169000,1140900,1154000,18924400,1161950.0\n981,11/28/2001,00:00,1147400,1151700,1132500,1133400,19443200,1144040.0\n982,11/29/2001,00:00,1136600,1145600,1130000,1144800,15954000,1135040.0\n983,11/30/2001,00:00,1144000,1149100,1140200,1143000,12983000,1133200.0\n984,12/03/2001,00:00,1136500,1140800,1130100,1133600,14533800,1132400.0\n985,12/04/2001,00:00,1139200,1150000,1133500,1150000,14970000,1147560.0\n986,12/05/2001,00:00,1156100,1180000,1155600,1176400,23817500,1170620.0\n987,12/06/2001,00:00,1173500,1179400,1169300,1173000,16930400,1186040.0\n988,12/07/2001,00:00,1169000,1170900,1157000,1164500,17768300,1184940.0\n989,12/10/2001,00:00,1158500,1163900,1144600,1144600,13238000,1154890.0\n990,12/11/2001,00:00,1149000,1157200,1139000,1141900,19660800,1130860.0\n991,12/12/2001,00:00,1145500,1147800,1131100,1142900,15487100,1128540.0\n992,12/13/2001,00:00,1134500,1137000,1122800,1123600,17341600,1118450.0\n993,12/14/2001,00:00,1123300,1134900,1120000,1129000,15363600,1121550.0\n994,12/17/2001,00:00,1129900,1143600,1129000,1139900,13616800,1130090.0\n995,12/18/2001,00:00,1146300,1151500,1143400,1149300,12932400,1145670.0\n996,12/19/2001,00:00,1140900,1159200,1140000,1155000,19767600,1164290.0\n997,12/20/2001,00:00,1155000,1158000,1146300,1146900,13673400,1159290.0\n998,12/21/2001,00:00,1150300,1151000,1142000,1146600,12542200,1150840.0\n999,12/24/2001,00:00,1148300,1150400,1146100,1147300,7822400,1145300.0\n1000,12/26/2001,00:00,1146500,1162100,1146500,1152500,9195600,1148280.0\n1001,12/27/2001,00:00,1153000,1163300,1152600,1159300,8636700,1159730.0\n1002,12/28/2001,00:00,1162900,1167500,1159500,1162100,9602500,1166460.0\n1003,12/31/2001,00:00,1161500,1164000,1148500,1148900,12333600,1157860.0\n1004,01/02/2002,00:00,1151100,1156500,1138100,1155900,16855900,1154660.0\n1005,01/03/2002,00:00,1156500,1168300,1150000,1167600,14579900,1161880.0\n1006,01/04/2002,00:00,1171700,1179800,1133600,1174100,19708000,1174530.0\n1007,01/07/2002,00:00,1177000,1179900,1157100,1167000,11601500,1179020.0\n1008,01/08/2002,00:00,1168000,1170600,1159700,1163600,12006100,1170080.0\n1009,01/09/2002,00:00,1166800,1199100,1153400,1157000,15074900,1156350.0\n1010,01/10/2002,00:00,1157000,1163500,1153000,1159600,13162200,1152560.0\n1011,01/11/2002,00:00,1162100,1162800,1147100,1147700,12628100,1146200.0\n1012,01/14/2002,00:00,1146500,1148400,1141000,1141200,11640600,1137590.0\n1013,01/15/2002,00:00,1145500,1153900,1139000,1148800,16475400,1140420.0\n1014,01/16/2002,00:00,1143000,1144000,1130000,1130500,15926800,1128430.0\n1015,01/17/2002,00:00,1137600,1142400,1134000,1141300,16033000,1134850.0\n1016,01/18/2002,00:00,1130000,1138700,1113600,1130800,15778700,1130030.0\n1017,01/22/2002,00:00,1137500,1139500,1120200,1122500,11249800,1119090.0\n1018,01/23/2002,00:00,1126300,1135600,1120200,1131400,11791000,1126200.0\n1019,01/24/2002,00:00,1136400,1142500,1133200,1135400,11323700,1128920.0\n1020,01/25/2002,00:00,1131200,1141800,1130400,1135900,11634500,1138130.0\n1021,01/28/2002,00:00,1139000,1141900,989200,1136300,9808100,1141930.0\n1022,01/29/2002,00:00,1138500,1144100,1100500,1102800,27316700,1111470.0\n1023,01/30/2002,00:00,1103900,1133900,1084000,1116100,34240300,1103790.0\n1024,01/31/2002,00:00,1121500,1132700,1116200,1132400,17736200,1116540.0\n1025,02/01/2002,00:00,1130900,1137000,1115500,1126000,15398900,1125420.0\n1026,02/04/2002,00:00,1122300,1151800,1094500,1097000,24526300,1114350.0\n1027,02/05/2002,00:00,1094000,1105000,1085300,1092700,35497300,1088180.0\n1028,02/06/2002,00:00,1096500,1097400,1080600,1087000,29039000,1069790.0\n1029,02/07/2002,00:00,1087200,1098600,1081600,1083800,23921700,1068980.0\n1030,02/08/2002,00:00,1086300,1100500,1083000,1099700,17609700,1090990.0\n1031,02/11/2002,00:00,1100500,1116300,1098200,1115900,17618500,1113550.0\n1032,02/12/2002,00:00,1109600,1117100,1106200,1111100,13050700,1123590.0\n1033,02/13/2002,00:00,1114800,1125400,1113500,1122600,16158600,1133320.0\n1034,02/14/2002,00:00,1125100,1129700,1115900,1119800,19646600,1127890.0\n1035,02/15/2002,00:00,1121500,1122400,1107100,1108300,17842600,1113590.0\n1036,02/19/2002,00:00,1101500,1103000,1002000,1087400,14698200,1091330.0\n1037,02/20/2002,00:00,1090500,1103800,1078200,1103200,28524400,1086900.0\n1038,02/21/2002,00:00,1099300,1109900,1084000,1086000,23205400,1079130.0\n1039,02/22/2002,00:00,1083500,1099400,1078700,1093700,26396200,1086540.0\n1040,02/25/2002,00:00,1097500,1118100,1097000,1115000,16472600,1110770.0\n1041,02/26/2002,00:00,1116000,1120400,1101900,1113600,21362600,1117240.0\n1042,02/27/2002,00:00,1119600,1128600,1106500,1115500,26777200,1128430.0\n1043,02/28/2002,00:00,1118300,1127500,1111400,1111900,22479100,1121010.0\n1044,03/01/2002,00:00,1117200,1137300,1115100,1136600,25086800,1130970.0\n1045,03/04/2002,00:00,1139000,1159900,1136500,1159300,26297000,1161130.0\n1046,03/05/2002,00:00,1153300,1164000,1149700,1152100,21551900,1171260.0\n1047,03/06/2002,00:00,1151000,1177100,1150800,1168100,19031000,1183970.0\n1048,03/07/2002,00:00,1173600,1175000,1125300,1163300,18622500,1174540.0\n1049,03/08/2002,00:00,1173800,1273000,1164800,1168900,19918100,1171460.0\n1050,03/11/2002,00:00,1168900,1179000,1164300,1173400,14648900,1178180.0\n1051,03/12/2002,00:00,1161100,1171200,1159400,1171000,16309200,1173710.0\n1052,03/13/2002,00:00,1166300,1167500,1150000,1159000,16205200,1165170.0\n1053,03/14/2002,00:00,1160400,1164300,1156300,1158600,10434100,1155680.0\n1054,03/15/2002,00:00,1159700,1169500,1062200,1167900,21148600,1158960.0\n1055,03/18/2002,00:00,1171000,1175700,1158500,1167600,16975000,1165450.0\n1056,03/19/2002,00:00,1173000,1177400,1168200,1173500,17720100,1176720.0\n1057,03/20/2002,00:00,1165000,1172500,1153900,1154300,16332900,1163480.0\n1058,03/21/2002,00:00,1153000,1159000,1141200,1156000,26674700,1152730.0\n1059,03/22/2002,00:00,1155000,1159400,1147000,1150900,15162300,1145190.0\n1060,03/25/2002,00:00,1150900,1153600,1133800,1134300,16756100,1129260.0\n1061,03/26/2002,00:00,1135200,1150200,1134700,1140800,19121200,1132650.0\n1062,03/27/2002,00:00,1140300,1150100,1130000,1146700,18290300,1137130.0\n1063,03/28/2002,00:00,1149700,1157700,1146800,1149100,16005200,1147000.0\n1064,04/01/2002,00:00,1142300,1151000,1129600,1148300,14408500,1154730.0\n1065,04/02/2002,00:00,1139800,1441200,1137700,1139300,14373500,1144420.0\n1066,04/03/2002,00:00,1140100,1162000,1121500,1127400,24583000,1127640.0\n1067,04/04/2002,00:00,1126000,1155300,1122300,1128900,22450100,1120210.0\n1068,04/05/2002,00:00,1131900,1136700,1121800,1125300,19653800,1116920.0\n1069,04/08/2002,00:00,1113200,1128800,1112300,1128100,15283800,1122450.0\n1070,04/09/2002,00:00,1131900,1131900,1119300,1120500,13036600,1121660.0\n1071,04/10/2002,00:00,1121000,1135400,1120900,1133500,17406700,1128580.0\n1072,04/11/2002,00:00,1128900,1130500,1105000,1107200,24076100,1113680.0\n1073,04/12/2002,00:00,1110300,1119700,1105700,1113300,14083200,1107650.0\n1074,04/15/2002,00:00,1116200,1119700,1102000,1106300,16132400,1101580.0\n1075,04/16/2002,00:00,1117000,1133200,1116700,1131200,13535800,1116650.0\n1076,04/17/2002,00:00,1133900,1136700,1126000,1130500,12254200,1137050.0\n1077,04/18/2002,00:00,1129000,1134600,1111500,1127600,24116800,1137620.0\n1078,04/19/2002,00:00,1132000,1132400,1125600,1128500,10213300,1137060.0\n1079,04/22/2002,00:00,1123800,1126100,1108400,1111400,13095800,1113360.0\n1080,04/23/2002,00:00,1110900,1119000,1101700,1103800,15862500,1099480.0\n1081,04/24/2002,00:00,1105600,1112400,1095100,1095900,17114100,1087010.0\n1082,04/25/2002,00:00,1092100,1104300,1087200,1094300,25129800,1081610.0\n1083,04/26/2002,00:00,1097900,1100100,1079000,1079500,17209600,1074990.0\n1084,04/29/2002,00:00,1079300,1082600,1066300,1069200,16865400,1062860.0\n1085,04/30/2002,00:00,1070200,1087500,1066400,1079800,18604700,1066550.0\n1086,05/01/2002,00:00,1079700,1092500,1068000,1089600,23395700,1079750.0\n1087,05/02/2002,00:00,1091000,1099100,1082000,1087700,14990800,1092200.0\n1088,05/03/2002,00:00,1086000,1089500,1072000,1076700,17107800,1087470.0\n1089,05/06/2002,00:00,1076500,1089000,1055100,1056200,20615700,1059970.0\n1090,05/07/2002,00:00,1061100,1063200,1050000,1052300,20654000,1040670.0\n1091,05/08/2002,00:00,1070500,1093600,1067900,1091600,26506300,1067920.0\n1092,05/09/2002,00:00,1086500,1091000,1075800,1076500,15747600,1081160.0\n1093,05/10/2002,00:00,1079700,1080500,1057200,1059800,17174700,1076700.0\n1094,05/13/2002,00:00,1062200,1079500,1057800,1078200,13380700,1077680.0\n1095,05/14/2002,00:00,1096200,1102600,1090000,1100900,18675600,1087490.0\n1096,05/15/2002,00:00,1095000,1109100,1092900,1095500,27642300,1105910.0\n1097,05/16/2002,00:00,1097000,1104300,1093300,1103500,18318500,1118990.0\n1098,05/17/2002,00:00,1106600,1111700,1101000,1111100,26024300,1118360.0\n1099,05/20/2002,00:00,1106400,1106900,1094900,1096400,12980900,1103460.0\n1100,05/21/2002,00:00,1101100,1104900,1082900,1084800,15775700,1089710.0\n1101,05/22/2002,00:00,1082200,1091200,1080000,1090500,14899600,1081570.0\n1102,05/23/2002,00:00,1092600,1102400,1084800,1101600,12756400,1089410.0\n1103,05/24/2002,00:00,1099800,1102100,1086600,1088500,10518500,1092660.0\n1104,05/28/2002,00:00,1090500,1099400,1074500,1079000,22840100,1084800.0\n1105,05/29/2002,00:00,1076300,1080200,1072500,1072500,13926300,1068840.0\n1106,05/30/2002,00:00,1065500,1075100,1059000,1070100,18078000,1058640.0\n1107,05/31/2002,00:00,1074000,1085600,1070800,1072300,17164100,1064090.0\n1108,06/03/2002,00:00,1070900,1088800,1042500,1043000,25052400,1045720.0\n1109,06/04/2002,00:00,1041500,1052000,1032800,1044100,25161300,1035230.0\n1110,06/05/2002,00:00,1049500,1056200,1043500,1055000,18265200,1039380.0\n1111,06/06/2002,00:00,1055400,1246700,1031500,1034200,19173400,1030460.0\n1112,06/07/2002,00:00,1017900,1039200,1017200,1032600,21968400,1032570.0\n1113,06/10/2002,00:00,1032400,1044600,1030200,1035600,18162400,1028480.0\n1114,06/11/2002,00:00,1041300,1045400,1017600,1018900,20164600,1014020.0\n1115,06/12/2002,00:00,1017100,1029700,1007800,1026400,28666100,1020750.0\n1116,06/13/2002,00:00,1021300,1030000,1013400,1015000,20605000,1012380.0\n1117,06/14/2002,00:00,1003100,1015600,985000,1012900,36963600,1006970.0\n1118,06/17/2002,00:00,1019200,1042900,1004700,1041900,16406300,1032770.0\n1119,06/18/2002,00:00,1037400,1047400,1029200,1042400,15992500,1045390.0\n1120,06/19/2002,00:00,1035000,1044800,1022600,1025400,19380200,1042610.0\n1121,06/20/2002,00:00,1022700,1030500,1009600,1012000,23810000,1021430.0\n1122,06/21/2002,00:00,1004700,1012000,986900,991900,27083500,983600.0\n1123,06/24/2002,00:00,986100,1006900,972500,996900,35515100,976370.0\n1124,06/25/2002,00:00,1003000,1008900,975400,979000,30054700,968670.0\n1125,06/26/2002,00:00,952000,981500,952000,976200,35590000,965850.0\n1126,06/27/2002,00:00,985000,994500,965700,994500,31061400,983050.0\n1127,06/28/2002,00:00,992400,1005000,990200,992500,20632900,989830.0\n1128,07/01/2002,00:00,991900,1015000,969500,970800,18535000,982570.0\n1129,07/02/2002,00:00,968700,980800,947700,950200,33423400,954130.0\n1130,07/03/2002,00:00,946200,958400,937300,956900,30051200,937730.0\n1131,07/05/2002,00:00,967800,995500,966700,993000,19291300,968810.0\n1132,07/08/2002,00:00,989800,997000,975600,980300,18365500,988780.0\n1133,07/09/2002,00:00,977300,983400,950100,956100,26169900,977860.0\n1134,07/10/2002,00:00,960000,960700,922000,922900,47057800,930370.0\n1135,07/11/2002,00:00,917600,933500,900600,931500,55775500,902640.0\n1136,07/12/2002,00:00,933300,938900,915200,924600,35065500,902280.0\n1137,07/15/2002,00:00,916400,1016000,878900,921000,75907900,910670.0\n1138,07/16/2002,00:00,911300,923800,898700,905800,50090100,907750.0\n1139,07/17/2002,00:00,924600,933000,897500,910000,45753500,900040.0\n1140,07/18/2002,00:00,907000,911000,882400,883300,28861700,880860.0\n1141,07/19/2002,00:00,867700,884000,843000,848000,64420100,843070.0\n1142,07/22/2002,00:00,841100,859100,814500,822100,73962000,805020.0\n1143,07/23/2002,00:00,825500,832400,788500,800000,65162600,768320.0\n1144,07/24/2002,00:00,781400,849400,776800,847500,98931400,804300.0\n1145,07/25/2002,00:00,842800,858500,816000,842000,85709600,835940.0\n1146,07/26/2002,00:00,846500,856900,838000,856000,38022600,866460.0\n1147,07/29/2002,00:00,875100,903400,845400,902300,49081500,913490.0\n1148,07/30/2002,00:00,893200,914000,887000,907000,45504900,924750.0\n1149,07/31/2002,00:00,905000,914500,889300,913800,44683000,942600.0\n1150,08/01/2002,00:00,908800,913500,884600,886400,59773800,914790.0\n1151,08/02/2002,00:00,885000,889200,852900,866600,49173500,867620.0\n1152,08/05/2002,00:00,865000,869300,836000,837300,44063900,826240.0\n1153,08/06/2002,00:00,852300,879000,848800,864000,58414400,829010.0\n1154,08/07/2002,00:00,878800,885000,857700,881500,39145700,863440.0\n1155,08/08/2002,00:00,884200,911000,878000,909800,45784100,911020.0\n1156,08/09/2002,00:00,901000,919400,893500,912600,40215000,939960.0\n1157,08/12/2002,00:00,900000,912700,895500,907000,25204200,930110.0\n1158,08/13/2002,00:00,901500,916600,886700,887500,46577700,902440.0\n1159,08/14/2002,00:00,890200,926300,880100,924100,52910500,909250.0\n1160,08/15/2002,00:00,928500,939900,903000,934000,43290900,931010.0\n1161,08/16/2002,00:00,928200,940800,920000,932200,35341900,946030.0\n1162,08/19/2002,00:00,934600,957500,931000,955200,31944500,969650.0\n1163,08/20/2002,00:00,948200,958000,936200,942700,29017300,955160.0\n1164,08/21/2002,00:00,950600,957500,931000,955000,39314900,959570.0\n1165,08/22/2002,00:00,954900,975000,950700,967600,36382900,971720.0\n1166,08/23/2002,00:00,960200,961500,922500,945200,26890400,954610.0\n1167,08/26/2002,00:00,949100,956400,935000,952800,31061600,955780.0\n1168,08/27/2002,00:00,957000,962500,935100,939000,33956800,937880.0\n1169,08/28/2002,00:00,932900,951500,918000,923000,38884800,916900.0\n1170,08/29/2002,00:00,912700,930600,908100,923000,43642300,914340.0\n1171,08/30/2002,00:00,916900,933900,914000,921000,28912000,907880.0\n1172,09/03/2002,00:00,907400,913500,881500,882100,47441000,882880.0\n1173,09/04/2002,00:00,886200,902500,880600,897500,48415200,881750.0\n1174,09/05/2002,00:00,884900,894300,875000,884700,48908200,871630.0\n1175,09/06/2002,00:00,897500,913700,893500,898600,34957300,884120.0\n1176,09/09/2002,00:00,891000,920200,882700,908000,32916400,910050.0\n1177,09/10/2002,00:00,911400,916100,905600,915500,36657700,918650.0\n1178,09/11/2002,00:00,924700,937000,909200,915000,24306100,927610.0\n1179,09/12/2002,00:00,907500,908400,889900,892600,48311100,904440.0\n1180,09/13/2002,00:00,887000,899000,882500,895400,42509400,890870.0\n1181,09/16/2002,00:00,893200,898300,884700,897300,24897000,886360.0\n1182,09/17/2002,00:00,908900,911900,877500,879700,44418100,876230.0\n1183,09/18/2002,00:00,870200,885000,861000,874900,49351800,872650.0\n1184,09/19/2002,00:00,860000,868000,847800,848500,44725900,844300.0\n1185,09/20/2002,00:00,849200,852000,840500,846600,43886200,829620.0\n1186,09/23/2002,00:00,836500,840700,826900,835900,44616900,822350.0\n1187,09/24/2002,00:00,824400,836500,818500,821500,64501200,809660.0\n1188,09/25/2002,00:00,833700,847700,820400,841100,56135500,826750.0\n1189,09/26/2002,00:00,850200,859800,844500,858700,52674900,849580.0\n1190,09/27/2002,00:00,850000,857000,828000,828500,58450400,843860.0\n1191,09/30/2002,00:00,820000,828000,800100,816000,69973300,826080.0\n1192,10/01/2002,00:00,824400,851000,810900,850000,60049200,831390.0\n1193,10/02/2002,00:00,846900,855300,825800,830500,54398600,826270.0\n1194,10/03/2002,00:00,831400,848400,819500,820500,54268700,828650.0\n1195,10/04/2002,00:00,828000,829200,795800,803900,65678900,808070.0\n1196,10/07/2002,00:00,800700,812000,785500,788200,49064700,773560.0\n1197,10/08/2002,00:00,798100,813100,782000,801100,73542900,781510.0\n1198,10/09/2002,00:00,790900,798500,777800,780000,78213900,773600.0\n1199,10/10/2002,00:00,779400,810700,770700,806600,72425800,795120.0\n1200,10/11/2002,00:00,821000,847300,801800,839000,74412000,835110.0\n1201,10/14/2002,00:00,832000,848500,830300,844700,38471500,858140.0\n1202,10/15/2002,00:00,869900,897500,868600,884200,68613100,904850.0\n1203,10/16/2002,00:00,874200,882600,859200,863700,57091900,895460.0\n1204,10/17/2002,00:00,888700,900300,878500,881800,55143700,894060.0\n1205,10/18/2002,00:00,871500,891100,869300,886500,45093200,896540.0\n1206,10/21/2002,00:00,881200,905000,875700,902900,42064100,901880.0\n1207,10/22/2002,00:00,890500,900100,885200,893200,38383100,909650.0\n1208,10/23/2002,00:00,887700,899900,866500,899700,52322200,905570.0\n1209,10/24/2002,00:00,907000,909000,881000,885800,51738000,892240.0\n1210,10/25/2002,00:00,882200,901600,879400,900400,38908200,892680.0\n1211,10/28/2002,00:00,911500,912900,888300,894200,38074900,895470.0\n1212,10/29/2002,00:00,890800,899200,870000,886000,57023000,887520.0\n1213,10/30/2002,00:00,886800,899600,882300,894500,38636800,893080.0\n1214,10/31/2002,00:00,896600,903000,881900,888600,35755600,885750.0\n1215,11/01/2002,00:00,883500,908200,880500,905300,48012400,901160.0\n1216,11/04/2002,00:00,918000,929400,909000,911500,44177600,915720.0\n1217,11/05/2002,00:00,908400,920700,908400,919700,30931400,925910.0\n1218,11/06/2002,00:00,924800,930700,900400,927700,63379600,938340.0\n1219,11/07/2002,00:00,920000,922200,902200,905700,45962500,919080.0\n1220,11/08/2002,00:00,905300,915700,895200,898700,36903700,900780.0\n1221,11/11/2002,00:00,895200,900300,878000,880500,31852200,874240.0\n1222,11/12/2002,00:00,886600,899100,883600,887500,36401700,868340.0\n1223,11/13/2002,00:00,883200,899000,874500,886800,60231700,877140.0\n1224,11/14/2002,00:00,900700,910000,891900,908700,28761400,900330.0\n1225,11/15/2002,00:00,900000,915500,899100,913800,33334000,921800.0\n1226,11/18/2002,00:00,921500,926100,903500,905000,25907100,918960.0\n1227,11/19/2002,00:00,900200,911000,897600,902300,30986600,911510.0\n1228,11/20/2002,00:00,899800,920700,897400,919400,34245800,912810.0\n1229,11/21/2002,00:00,926000,965800,924300,939000,54281600,935340.0\n1230,11/22/2002,00:00,934800,942700,930000,936200,39499700,950110.0\n1231,11/25/2002,00:00,934300,942600,927700,938000,32286500,953440.0\n1232,11/26/2002,00:00,930700,934500,916200,918500,39862600,929380.0\n1233,11/27/2002,00:00,925200,946500,915700,943500,33837800,932430.0\n1234,11/29/2002,00:00,948000,948000,937100,939800,20285500,939010.0\n1235,12/02/2002,00:00,954700,960500,932200,938900,42283000,942670.0\n1236,12/03/2002,00:00,932500,934000,923500,925500,31785300,936060.0\n1237,12/04/2002,00:00,918100,931400,914300,923700,63588800,918110.0\n1238,12/05/2002,00:00,927000,929500,911000,911600,34786300,906420.0\n1239,12/06/2002,00:00,901200,921700,899800,918100,47964000,906910.0\n1240,12/09/2002,00:00,910700,914600,896200,896900,33704600,896320.0\n1241,12/10/2002,00:00,900200,911000,897600,909200,31434700,898790.0\n1242,12/11/2002,00:00,904200,916200,901600,910400,35787600,905850.0\n1243,12/12/2002,00:00,912000,914900,902000,907500,33138900,906110.0\n1244,12/13/2002,00:00,899100,910000,893600,895000,34552900,902150.0\n1245,12/16/2002,00:00,898200,916800,896600,916800,34515200,907720.0\n1246,12/17/2002,00:00,913700,917400,907400,909300,31189300,909930.0\n1247,12/18/2002,00:00,903400,909000,846600,896400,33084000,902630.0\n1248,12/19/2002,00:00,893500,907000,886000,890800,37939400,893020.0\n1249,12/20/2002,00:00,892000,900200,891000,896900,27739500,884550.0\n1250,12/23/2002,00:00,895900,906000,893100,899300,20291700,892690.0\n1251,12/24/2002,00:00,896100,900000,892500,893300,11260600,896030.0\n1252,12/26/2002,00:00,897700,906100,888400,890300,16532700,892740.0\n1253,12/27/2002,00:00,889600,899800,875200,876800,21248800,876560.0\n1254,12/30/2002,00:00,878000,884700,872200,880900,27752900,872130.0\n1255,12/31/2002,00:00,879900,884300,870800,881800,29418400,874900.0\n1256,01/02/2003,00:00,888500,911900,885400,911300,40792000,902320.0\n1257,01/03/2003,00:00,909100,913900,896800,911300,29192500,922240.0\n1258,01/06/2003,00:00,912400,937000,910900,931300,37793700,942410.0\n1259,01/07/2003,00:00,929000,933700,922000,925600,37236200,944540.0\n1260,01/08/2003,00:00,922000,924000,910500,912000,36077300,923010.0\n1261,01/09/2003,00:00,918200,931800,910900,930000,31914000,927470.0\n1262,01/10/2003,00:00,919500,936400,918000,929700,39609900,926080.0\n1263,01/13/2003,00:00,935500,938600,924400,928800,29576600,932450.0\n1264,01/14/2003,00:00,926900,938300,922000,934400,21777100,940060.0\n1265,01/15/2003,00:00,935400,935700,915100,921200,32379000,924950.0\n1266,01/16/2003,00:00,925000,933300,914600,918300,40043700,917360.0\n1267,01/17/2003,00:00,909900,923000,901500,904800,34847000,902270.0\n1268,01/21/2003,00:00,908700,909200,878800,890300,37621400,882420.0\n1269,01/22/2003,00:00,887700,900000,880100,880400,40523500,870120.0\n1270,01/23/2003,00:00,887500,894300,879500,890600,42524800,872940.0\n1271,01/24/2003,00:00,885900,887600,861700,863300,61025800,861070.0\n1272,01/27/2003,00:00,857000,869400,845000,850300,57425600,845850.0\n1273,01/28/2003,00:00,856900,878500,846500,861200,44568500,845550.0\n1274,01/29/2003,00:00,854500,871800,847700,867800,48968100,852330.0\n1275,01/30/2003,00:00,867900,868800,846300,848000,46355700,854190.0\n1276,01/31/2003,00:00,841500,862200,841500,858400,50426300,858040.0\n1277,02/03/2003,00:00,861000,886900,858900,862700,37270000,857700.0\n1278,02/04/2003,00:00,853100,854400,843000,851400,39714400,852230.0\n1279,02/05/2003,00:00,857500,865400,844200,846400,51490200,850320.0\n1280,02/06/2003,00:00,843900,852200,836500,841700,52470600,837210.0\n1281,02/07/2003,00:00,849100,849900,829700,832900,40984200,826230.0\n1282,02/10/2003,00:00,834700,841300,826500,839400,43562000,831110.0\n1283,02/11/2003,00:00,843700,848800,828300,832100,45084300,829230.0\n1284,02/12/2003,00:00,831600,836200,822200,822200,35247100,821720.0\n1285,02/13/2003,00:00,821500,829500,810000,821000,47069400,817220.0\n1286,02/14/2003,00:00,823700,839100,818300,838800,57097600,827010.0\n1287,02/18/2003,00:00,845300,857700,844900,855500,36249100,852940.0\n1288,02/19/2003,00:00,853200,854700,839000,849300,29998000,863970.0\n1289,02/20/2003,00:00,852200,854200,805000,840900,27850500,856190.0\n1290,02/21/2003,00:00,843800,857400,834600,853400,63271800,851960.0\n1291,02/24/2003,00:00,849300,855100,835900,836300,29643900,836790.0\n1292,02/25/2003,00:00,829500,844900,822200,843200,53471300,839580.0\n1293,02/26/2003,00:00,840200,845300,830800,831900,37153800,832680.0\n1294,02/27/2003,00:00,837000,855000,829900,841700,48562900,832960.0\n1295,02/28/2003,00:00,844700,852300,834500,846200,41091800,845350.0\n1296,03/03/2003,00:00,852600,857800,837200,839300,41103000,842410.0\n1297,03/04/2003,00:00,839500,840100,826500,827300,29689500,833800.0\n1298,03/05/2003,00:00,826100,835400,823600,835000,41109200,828210.0\n1299,03/06/2003,00:00,828600,835200,824700,827000,40633100,822150.0\n1300,03/07/2003,00:00,816400,840700,814300,833700,61733800,829010.0\n1301,03/10/2003,00:00,826300,828600,811000,812300,38552200,817670.0\n1302,03/11/2003,00:00,814900,820800,805200,805500,47065100,800590.0\n1303,03/12/2003,00:00,804100,810100,793800,809700,65050000,798800.0\n1304,03/13/2003,00:00,821900,838300,815300,837800,68351300,821480.0\n1305,03/14/2003,00:00,841900,847700,833500,839000,62069400,846570.0\n1306,03/17/2003,00:00,834600,869500,832200,868300,79922400,878530.0\n1307,03/18/2003,00:00,871500,873200,861000,871900,48600400,891810.0\n1308,03/19/2003,00:00,873100,881600,866800,879900,46060100,894510.0\n1309,03/20/2003,00:00,873200,885900,863500,881300,66050700,896940.0\n1310,03/21/2003,00:00,887900,898800,877900,897400,65617700,900040.0\n1311,03/24/2003,00:00,879900,881400,855800,865800,66185400,880850.0\n1312,03/25/2003,00:00,867400,886700,855900,876700,59039700,873650.0\n1313,03/26/2003,00:00,875600,878500,862300,872000,44220500,866850.0\n1314,03/27/2003,00:00,864300,885000,859900,871000,51967900,862600.0\n1315,03/28/2003,00:00,864700,872800,862500,865900,31216600,868630.0\n1316,03/31/2003,00:00,853500,869600,844000,849800,55166100,849110.0\n1317,04/01/2003,00:00,852600,868500,849100,860700,52487500,850740.0\n1318,04/02/2003,00:00,875600,887700,870500,883900,45771800,872440.0\n1319,04/03/2003,00:00,888400,889900,878000,878800,46588000,885790.0\n1320,04/04/2003,00:00,884300,885900,875700,881200,34027100,895150.0\n1321,04/07/2003,00:00,903400,909200,881900,882000,65803200,889290.0\n1322,04/08/2003,00:00,883000,888900,862000,881100,37497500,880680.0\n1323,04/09/2003,00:00,883600,898100,867700,868600,54266200,872190.0\n1324,04/10/2003,00:00,870700,889000,857100,874500,36457100,869440.0\n1325,04/11/2003,00:00,881900,887100,868600,871700,44797600,867420.0\n1326,04/14/2003,00:00,874700,888700,864600,888500,33088500,882250.0\n1327,04/15/2003,00:00,888600,894700,883900,894200,41537300,899060.0\n1328,04/16/2003,00:00,899100,900700,880300,882300,49914000,893670.0\n1329,04/17/2003,00:00,883500,897200,872900,896600,35530800,899740.0\n1330,04/21/2003,00:00,898600,901600,890600,895000,30947000,895940.0\n1331,04/22/2003,00:00,891000,915600,888900,915100,55045400,912990.0\n1332,04/23/2003,00:00,916000,931100,912400,922000,42098700,931570.0\n1333,04/24/2003,00:00,915300,920800,901800,914200,48770700,927240.0\n1334,04/25/2003,00:00,913000,914700,900200,901500,42082300,913190.0\n1335,04/28/2003,00:00,904400,921900,901700,918700,44105500,910310.0\n1336,04/29/2003,00:00,921400,936600,914000,921500,47893600,916630.0\n1337,04/30/2003,00:00,919300,925700,913200,918500,43007600,923460.0\n1338,05/01/2003,00:00,919200,927300,905000,919200,47446800,926440.0\n1339,05/02/2003,00:00,915600,934700,909000,933000,46777300,930070.0\n1340,05/05/2003,00:00,934700,939700,920500,929500,34390100,933490.0\n1341,05/06/2003,00:00,931000,944200,920500,937900,42445700,942350.0\n1342,05/07/2003,00:00,934200,941400,924000,933300,39303700,940510.0\n1343,05/08/2003,00:00,925200,933800,922100,923400,39041600,926800.0\n1344,05/09/2003,00:00,928300,938000,922000,937200,32040000,932530.0\n1345,05/12/2003,00:00,935000,963000,922400,949000,33488000,943990.0\n1346,05/13/2003,00:00,945300,959700,916000,946400,36510100,953400.0\n1347,05/14/2003,00:00,951000,952400,922400,943600,31475800,954800.0\n1348,05/15/2003,00:00,948900,953300,942500,951300,43037600,952340.0\n1349,05/16/2003,00:00,948900,954500,940500,948600,35295200,949010.0\n1350,05/19/2003,00:00,942000,949200,920800,925100,43984300,931720.0\n1351,05/20/2003,00:00,928200,942100,916000,924500,52587100,919300.0\n1352,05/21/2003,00:00,921100,929200,919100,927800,43595100,914130.0\n1353,05/22/2003,00:00,929500,940500,921400,936800,37055000,926290.0\n1354,05/23/2003,00:00,935300,953600,928600,937200,25718600,941230.0\n1355,05/27/2003,00:00,933000,958400,931800,956200,40479600,958340.0\n1356,05/28/2003,00:00,958500,977300,949800,958300,35069300,967380.0\n1357,05/29/2003,00:00,958800,968200,923200,953700,49556400,964910.0\n1358,05/30/2003,00:00,959000,970900,951700,969300,46174600,973450.0\n1359,06/02/2003,00:00,975300,988400,960800,971700,47403200,974440.0\n1360,06/03/2003,00:00,971500,979000,968500,977100,31344400,982700.0\n1361,06/04/2003,00:00,976600,993500,947200,991400,46824600,997600.0\n1362,06/05/2003,00:00,985800,995900,981400,995600,42870100,1002710.0\n1363,06/06/2003,00:00,1004400,1014000,991300,992200,55486600,1003450.0\n1364,06/09/2003,00:00,987800,999200,977700,981100,36095100,990120.0\n1365,06/10/2003,00:00,984600,998300,977200,990400,27750200,985190.0\n1366,06/11/2003,00:00,991600,1011900,982800,1003300,35323300,996600.0\n1367,06/12/2003,00:00,1007500,1014000,996200,1005200,34887000,1008900.0\n1368,06/13/2003,00:00,1006000,1007500,989500,994400,43904700,1007300.0\n1369,06/16/2003,00:00,999600,1016600,998000,1016600,34397800,1015030.0\n1370,06/17/2003,00:00,1020500,1021800,1007300,1016800,34970300,1018780.0\n1371,06/18/2003,00:00,1012900,1021400,1010000,1015400,33837000,1022520.0\n1372,06/19/2003,00:00,1016400,1017300,998400,1000200,41701500,1011800.0\n1373,06/20/2003,00:00,1003900,1005000,995000,997500,36384800,992860.0\n1374,06/23/2003,00:00,994500,996600,979200,983600,33254600,977410.0\n1375,06/24/2003,00:00,982200,990900,980200,986500,35363600,974320.0\n1376,06/25/2003,00:00,985300,995900,976700,978000,43741400,972540.0\n1377,06/26/2003,00:00,977800,990000,969600,988900,30562500,980060.0\n1378,06/27/2003,00:00,987500,991900,976600,978600,49177600,980840.0\n1379,06/30/2003,00:00,982200,989300,967200,976900,29156600,976200.0\n1380,07/01/2003,00:00,972500,988500,964300,985600,48168800,982560.0\n1381,07/02/2003,00:00,987700,996800,985700,996300,32277800,991800.0\n1382,07/03/2003,00:00,990700,998500,979000,988000,31558400,996540.0\n1383,07/07/2003,00:00,996500,1009000,996100,1007500,26522100,1009940.0\n1384,07/08/2003,00:00,1005000,1012900,1001700,1010200,26654100,1015640.0\n1385,07/09/2003,00:00,1009200,1014000,1000300,1005500,32218300,1013680.0\n1386,07/10/2003,00:00,998400,1007700,986300,992100,49644400,1002520.0\n1387,07/11/2003,00:00,993900,1004500,993900,1001400,32413800,994250.0\n1388,07/14/2003,00:00,1012000,1019000,996100,1007200,40162200,1000250.0\n1389,07/15/2003,00:00,1013800,1019100,999500,1003800,38640700,1005510.0\n1390,07/16/2003,00:00,1008100,1008700,977600,997600,36831600,1004440.0\n1391,07/17/2003,00:00,991500,999800,981600,985100,46981700,986360.0\n1392,07/18/2003,00:00,990200,999800,984600,995800,33310400,985450.0\n1393,07/21/2003,00:00,994500,994900,978500,982400,32513000,979560.0\n1394,07/22/2003,00:00,986900,999100,979100,991200,47511800,985770.0\n1395,07/23/2003,00:00,992100,998300,982800,992300,36864600,992300.0\n1396,07/24/2003,00:00,999900,1003400,983700,985000,37033900,985830.0\n1397,07/25/2003,00:00,986600,1002900,980400,1002300,39276800,1000720.0\n1398,07/28/2003,00:00,1003700,1009800,996700,1000400,33516100,1002760.0\n1399,07/29/2003,00:00,1001400,1003000,986800,993200,52108100,999800.0\n1400,07/30/2003,00:00,996000,997900,989300,991100,27288900,995330.0\n1401,07/31/2003,00:00,999800,1009400,989000,994100,51122000,988510.0\n1402,08/01/2003,00:00,991900,996800,982400,983800,47944800,982830.0\n1403,08/04/2003,00:00,983100,997100,970000,987200,54147600,984090.0\n1404,08/05/2003,00:00,984100,988500,968400,968500,51537800,969310.0\n1405,08/06/2003,00:00,967100,980600,964200,971000,48456400,962470.0\n1406,08/07/2003,00:00,971700,979800,966700,978800,40462700,970000.0\n1407,08/08/2003,00:00,983200,985500,977600,982200,25756900,977630.0\n1408,08/11/2003,00:00,982600,996900,978400,985100,36860500,990440.0\n1409,08/12/2003,00:00,987100,995600,984200,995400,29867800,999030.0\n1410,08/13/2003,00:00,998200,998500,985300,988900,34206500,996100.0\n1411,08/14/2003,00:00,991000,997500,985100,995400,30134100,998460.0\n1412,08/15/2003,00:00,993600,997900,991200,995400,11731800,998220.0\n1413,08/18/2003,00:00,999300,1007800,997400,1005000,21228600,1003730.0\n1414,08/19/2003,00:00,1006900,1009400,996000,1008200,36117200,1013040.0\n1415,08/20/2003,00:00,1002900,1008900,1001600,1005000,19140800,1011400.0\n1416,08/21/2003,00:00,1010500,1044500,1002000,1009100,44924100,1012760.0\n1417,08/22/2003,00:00,1017500,1020000,997400,997700,49593900,1000890.0\n1418,08/25/2003,00:00,997300,1016300,992800,998200,22212200,995450.0\n1419,08/26/2003,00:00,995000,1004600,988300,1001800,43123200,997170.0\n1420,08/27/2003,00:00,1000500,1003600,995700,1002400,17611500,999050.0\n1421,08/28/2003,00:00,1004000,1010000,996600,1008500,25828500,1009460.0\n1422,08/29/2003,00:00,1006100,1014600,1000000,1014000,23586600,1016470.0\n1423,09/02/2003,00:00,1016400,1028800,1002800,1027700,46298000,1029900.0\n1424,09/03/2003,00:00,1030300,1037000,1012500,1031900,40191200,1040360.0\n1425,09/04/2003,00:00,1031000,1035500,1004300,1034300,26062300,1044130.0\n1426,09/05/2003,00:00,1029400,1205200,1015300,1026700,29648500,1036520.0\n1427,09/08/2003,00:00,1030400,1038800,1027300,1038000,32461700,1036340.0\n1428,09/09/2003,00:00,1033700,1034600,1026800,1029300,34210600,1031590.0\n1429,09/10/2003,00:00,1025400,1036000,1015500,1016900,42588100,1019380.0\n1430,09/11/2003,00:00,1021000,1028500,1014200,1022500,34663300,1017830.0\n1431,09/12/2003,00:00,1019100,1026400,1004600,1025200,40924400,1016660.0\n1432,09/15/2003,00:00,1025200,1026300,1010800,1021200,20062100,1020650.0\n1433,09/16/2003,00:00,1022300,1036400,1021700,1035500,35237000,1035030.0\n1434,09/17/2003,00:00,1034800,1037900,1025800,1032200,30704300,1036230.0\n1435,09/18/2003,00:00,1034000,1055000,1031700,1045900,29197800,1047720.0\n1436,09/19/2003,00:00,1042700,1046000,1034000,1038600,24909700,1048240.0\n1437,09/22/2003,00:00,1028500,1038700,1002900,1024900,33784400,1030980.0\n1438,09/23/2003,00:00,1025900,1032900,1023600,1030900,29146200,1027420.0\n1439,09/24/2003,00:00,1031200,1032200,1010700,1012000,39700500,1007810.0\n1440,09/25/2003,00:00,1014100,1018800,1002700,1005900,47503000,998970.0\n1441,09/26/2003,00:00,1004400,1006600,998400,1000200,39894100,992460.0\n1442,09/29/2003,00:00,1003000,1009900,987500,1008700,34534700,994680.0\n1443,09/30/2003,00:00,1005300,1007600,959100,998600,66541600,997880.0\n1444,10/01/2003,00:00,1002400,1021200,1000100,1020000,61422900,1014660.0\n1445,10/02/2003,00:00,1019300,1028500,1016300,1023200,42650800,1027330.0\n1446,10/03/2003,00:00,1036700,1042800,1023200,1032600,44559600,1038340.0\n1447,10/06/2003,00:00,1034800,1039900,1032000,1037200,21426800,1049260.0\n1448,10/07/2003,00:00,1032600,1042600,1029100,1041900,39712400,1048320.0\n1449,10/08/2003,00:00,1043300,1043900,1026000,1037100,37406500,1045530.0\n1450,10/09/2003,00:00,1048800,1052200,1036500,1041700,43192200,1043530.0\n1451,10/10/2003,00:00,1042700,1044800,1039100,1042000,20895700,1042800.0\n1452,10/13/2003,00:00,1047200,1052900,1017000,1048600,22789900,1047750.0\n1453,10/14/2003,00:00,1048000,1053600,1036700,1052900,34600000,1056010.0\n1454,10/15/2003,00:00,1058600,1058900,1046400,1050200,36984200,1055450.0\n1455,10/16/2003,00:00,1046800,1059800,1046500,1053300,31219000,1056660.0\n1456,10/17/2003,00:00,1054700,1059100,1039800,1042300,32168100,1045800.0\n1457,10/20/2003,00:00,1044500,1048300,1039400,1047800,25177800,1043870.0\n1458,10/21/2003,00:00,1048700,1052800,1043200,1049600,24689900,1046630.0\n1459,10/22/2003,00:00,1040300,1045400,1027000,1034000,31485700,1036010.0\n1460,10/23/2003,00:00,1028900,1039500,1026800,1037400,43512900,1035140.0\n1461,10/24/2003,00:00,1028300,1037600,1021800,1032800,50146300,1027660.0\n1462,10/27/2003,00:00,1037400,1044400,1032700,1034400,30493800,1028160.0\n1463,10/28/2003,00:00,1039800,1050700,1038200,1050200,32172100,1046580.0\n1464,10/29/2003,00:00,1047700,1060800,1037300,1052500,30289100,1055740.0\n1465,10/30/2003,00:00,1057900,1059700,1042400,1050900,36716900,1060450.0\n1466,10/31/2003,00:00,1054000,1057400,1052200,1054200,22457300,1060530.0\n1467,11/03/2003,00:00,1057500,1066100,1042000,1063200,36184684,1062510.0\n1468,11/04/2003,00:00,1059800,1062700,1038400,1057800,30356338,1062590.0\n1469,11/05/2003,00:00,1055200,1059700,1049000,1056300,34379600,1060800.0\n1470,11/06/2003,00:00,1056400,1064000,1051000,1062600,26891500,1061790.0\n1471,11/07/2003,00:00,1066400,1067200,1056500,1058100,30466600,1057980.0\n1472,11/10/2003,00:00,1057300,1067500,1050100,1051800,24000800,1054260.0\n1473,11/11/2003,00:00,1050800,1053400,1048000,1050800,25833400,1049380.0\n1474,11/12/2003,00:00,1052100,1064700,1051600,1063800,26023500,1055950.0\n1475,11/13/2003,00:00,1060100,1065400,1057800,1063500,26263200,1064440.0\n1476,11/14/2003,00:00,1064000,1069500,1025600,1055400,47567700,1063030.0\n1477,11/17/2003,00:00,1049100,1055100,1040400,1048600,43458300,1052580.0\n1478,11/18/2003,00:00,1052400,1054600,1039000,1039100,34193000,1034790.0\n1479,11/19/2003,00:00,1040300,1055300,1039200,1047800,27333500,1036570.0\n1480,11/20/2003,00:00,1040000,1056300,1038000,1039000,48251500,1035900.0\n1481,11/21/2003,00:00,1042400,1049100,1026500,1040400,28252200,1038030.0\n1482,11/24/2003,00:00,1046800,1057700,1046800,1057200,26789400,1053340.0\n1483,11/25/2003,00:00,1057300,1064200,1040600,1060100,37048100,1061740.0\n1484,11/26/2003,00:00,1064200,1064500,1044000,1064000,43671100,1073050.0\n1485,11/28/2003,00:00,1062800,1066600,1062000,1065400,10401800,1074460.0\n1486,12/01/2003,00:00,1068500,1076800,1003500,1075700,34785800,1077170.0\n1487,12/02/2003,00:00,1073800,1077700,1070700,1072700,31161900,1078650.0\n1488,12/03/2003,00:00,1076500,1080800,1070800,1071100,38845700,1076230.0\n1489,12/04/2003,00:00,1071700,1077200,1069400,1076800,34806300,1077800.0\n1490,12/05/2003,00:00,1071500,1078000,1000600,1068100,28144500,1069550.0\n1491,12/08/2003,00:00,1067400,1076400,1066800,1075200,25534900,1073380.0\n1492,12/09/2003,00:00,1079000,1079300,1055200,1066200,41477400,1068060.0\n1493,12/10/2003,00:00,1067700,1069800,1007000,1065400,30425000,1062930.0\n1494,12/11/2003,00:00,1067000,1081000,1066700,1078400,41272400,1073900.0\n1495,12/12/2003,00:00,1079700,1087000,1066500,1081300,32363800,1080620.0\n1496,12/15/2003,00:00,1091700,1094500,1074800,1075200,37584800,1083470.0\n1497,12/16/2003,00:00,1076800,1085000,1002400,1081700,31281800,1085220.0\n1498,12/17/2003,00:00,1080600,1083800,1078000,1083400,22379200,1083120.0\n1499,12/18/2003,00:00,1085500,1097200,1083900,1096000,27293400,1094800.0\n1500,12/19/2003,00:00,1093000,1097000,1085800,1090400,38548300,1098750.0\n1501,12/22/2003,00:00,1087900,1094700,1086500,1094600,26487100,1099060.0\n1502,12/23/2003,00:00,1094800,1099500,1084200,1097900,23343300,1100740.0\n1503,12/24/2003,00:00,1095200,1098800,1094300,1095800,8102900,1097070.0\n1504,12/26/2003,00:00,1097100,1100800,1096300,1096700,8278000,1099220.0\n1505,12/29/2003,00:00,1101000,1111700,1090000,1111500,18474600,1109080.0\n1506,12/30/2003,00:00,1110900,1112700,1101500,1111700,17554100,1115710.0\n1507,12/31/2003,00:00,1112300,1115200,1108400,1111500,28056500,1119360.0\n1508,01/02/2004,00:00,1117400,1199100,1107300,1110000,35070700,1116260.0\n1509,01/05/2004,00:00,1116900,1124500,1111700,1123700,25956100,1120490.0\n1510,01/06/2004,00:00,1121800,1127300,1112300,1126300,18416900,1129060.0\n1511,01/07/2004,00:00,1123900,1129200,1118900,1129000,27474700,1135490.0\n1512,01/08/2004,00:00,1132600,1134100,1121900,1133200,33802100,1139950.0\n1513,01/09/2004,00:00,1128200,1139800,1121900,1125100,40552100,1130370.0\n1514,01/12/2004,00:00,1125500,1131200,1123600,1131100,28825100,1130650.0\n1515,01/13/2004,00:00,1130900,1132300,1111300,1124700,44553600,1125410.0\n1516,01/14/2004,00:00,1127600,1134200,1126700,1133100,25360700,1129260.0\n1517,01/15/2004,00:00,1135700,1140600,1125800,1135300,38120800,1136580.0\n1518,01/16/2004,00:00,1140400,1143100,1130800,1142500,29709700,1143360.0\n1519,01/20/2004,00:00,1145300,1146500,1138200,1142100,27297000,1148800.0\n1520,01/21/2004,00:00,1141300,1153000,1137200,1150600,30519200,1153260.0\n1521,01/22/2004,00:00,1151400,1153800,1145800,1147300,27978800,1153190.0\n1522,01/23/2004,00:00,1150000,1153700,1139500,1143600,29245600,1147440.0\n1523,01/26/2004,00:00,1143900,1159100,1143900,1158000,28336100,1155760.0\n1524,01/27/2004,00:00,1157500,1165000,1147000,1147000,32571800,1150350.0\n1525,01/28/2004,00:00,1149800,1153700,1129400,1132300,48424700,1137660.0\n1526,01/29/2004,00:00,1135600,1138500,1125600,1137500,55569800,1132310.0\n1527,01/30/2004,00:00,1135200,1152900,1130900,1134400,27744000,1124830.0\n1528,02/02/2004,00:00,1137000,1163600,1131200,1138300,37615300,1133310.0\n1529,02/03/2004,00:00,1137400,1149700,1134400,1139500,22680000,1140960.0\n1530,02/04/2004,00:00,1131900,1139400,1127900,1130300,37534600,1133210.0\n1531,02/05/2004,00:00,1131700,1135400,1127800,1132600,34498800,1131540.0\n1532,02/06/2004,00:00,1134200,1146900,1132000,1146600,34866300,1140370.0\n1533,02/09/2004,00:00,1146700,1148700,1142900,1143400,22947000,1145710.0\n1534,02/10/2004,00:00,1142800,1151400,1142600,1149000,26564200,1154840.0\n1535,02/11/2004,00:00,1148500,1163900,1050100,1161900,41979200,1165000.0\n1536,02/12/2004,00:00,1159700,1167400,1146400,1156700,25685800,1163130.0\n1537,02/13/2004,00:00,1158200,1162000,1147500,1151200,42820400,1159430.0\n1538,02/17/2004,00:00,1158500,1164300,1157700,1161400,23040800,1160270.0\n1539,02/18/2004,00:00,1162000,1166000,1153500,1156600,26629100,1155790.0\n1540,02/19/2004,00:00,1163300,1163900,1150000,1152200,45058400,1154540.0\n1541,02/20/2004,00:00,1154500,1155600,1143200,1150000,45242500,1150800.0\n1542,02/23/2004,00:00,1152200,1156100,1141700,1145500,36514400,1141620.0\n1543,02/24/2004,00:00,1142700,1149900,1130300,1144500,44472000,1140490.0\n1544,02/25/2004,00:00,1144600,1150600,1143200,1149100,28553900,1144750.0\n1545,02/26/2004,00:00,1146100,1152900,1143400,1150400,27040800,1149220.0\n1546,02/27/2004,00:00,1151900,1160800,1145500,1150800,36024700,1153010.0\n1547,03/01/2004,00:00,1154300,1163400,1144400,1160700,32675900,1161330.0\n1548,03/02/2004,00:00,1159400,1169700,1151900,1154900,38210300,1159750.0\n1549,03/03/2004,00:00,1152500,1164000,1142500,1157000,30759200,1159950.0\n1550,03/04/2004,00:00,1157200,1161000,1150400,1160500,19519800,1161490.0\n1551,03/05/2004,00:00,1154200,1169500,1150800,1162900,54667200,1162200.0\n1552,03/08/2004,00:00,1163400,1166200,1152200,1152700,35524500,1158050.0\n1553,03/09/2004,00:00,1151000,1166500,1049700,1146600,37870300,1147360.0\n1554,03/10/2004,00:00,1147200,1156200,1114500,1129800,63572300,1127190.0\n1555,03/11/2004,00:00,1123900,1156500,1111500,1113500,82967500,1104590.0\n1556,03/12/2004,00:00,1117300,1127000,1115800,1126900,50845500,1108490.0\n1557,03/15/2004,00:00,1122600,1126900,1109000,1110300,59041900,1102770.0\n1558,03/16/2004,00:00,1117800,1149300,1108400,1117300,56252100,1111100.0\n1559,03/17/2004,00:00,1122000,1132600,1115600,1130000,37263700,1126620.0\n1560,03/18/2004,00:00,1126700,1139400,1119300,1129100,57846900,1129950.0\n1561,03/19/2004,00:00,1124100,1133300,1107000,1112900,42347600,1125020.0\n1562,03/22/2004,00:00,1105400,1105700,1053500,1097400,59212700,1100270.0\n1563,03/23/2004,00:00,1102500,1109300,1093600,1096500,50925500,1083570.0\n1564,03/24/2004,00:00,1096200,1104700,1088500,1094100,51507700,1080080.0\n1565,03/25/2004,00:00,1100800,1113000,1097900,1111100,45819300,1100330.0\n1566,03/26/2004,00:00,1109600,1117900,1108000,1111700,34724000,1115120.0\n1567,03/29/2004,00:00,1116300,1145000,1115800,1124900,42364300,1129980.0\n1568,03/30/2004,00:00,1123000,1130700,1122200,1129700,36690700,1139800.0\n1569,03/31/2004,00:00,1129900,1134000,1116000,1128800,44063000,1137260.0\n1570,04/01/2004,00:00,1130700,1181800,1130500,1134900,43460700,1141090.0\n1571,04/02/2004,00:00,1148100,1155500,1120100,1144400,49027100,1145800.0\n1572,04/05/2004,00:00,1144600,1157900,1144400,1153300,28795500,1157060.0\n1573,04/06/2004,00:00,1148300,1151800,1141000,1150800,25102800,1161160.0\n1574,04/07/2004,00:00,1149400,1149800,1141100,1144900,43731300,1153580.0\n1575,04/08/2004,00:00,1154100,1154100,1137400,1142300,45988200,1143360.0\n1576,04/12/2004,00:00,1145800,1150800,1145000,1148800,22187200,1142770.0\n1577,04/13/2004,00:00,1152600,1153000,1130700,1133100,51934900,1134530.0\n1578,04/14/2004,00:00,1126100,1143200,1125500,1131900,65752200,1129640.0\n1579,04/15/2004,00:00,1134500,1137800,1120300,1131700,59058100,1126130.0\n1580,04/16/2004,00:00,1134300,1140500,1129800,1137200,42013900,1129160.0\n1581,04/19/2004,00:00,1135500,1166300,1132700,1138900,27015500,1139630.0\n1582,04/20/2004,00:00,1141100,1143200,1121100,1121400,46026100,1128080.0\n1583,04/21/2004,00:00,1122000,1129500,1118700,1128100,50401500,1124560.0\n1584,04/22/2004,00:00,1124800,1146700,1122400,1144400,58743900,1135080.0\n1585,04/23/2004,00:00,1144200,1146100,1133400,1144400,28136900,1145640.0\n1586,04/26/2004,00:00,1145000,1149400,1136000,1139100,30358300,1150990.0\n1587,04/27/2004,00:00,1142300,1151200,1125200,1142200,42595100,1146510.0\n1588,04/28/2004,00:00,1138800,1143300,1125000,1125800,48133100,1127360.0\n1589,04/29/2004,00:00,1127200,1135000,1111600,1118400,64784500,1114390.0\n1590,04/30/2004,00:00,1121700,1123800,1111000,1111300,43933900,1103540.0\n1591,05/03/2004,00:00,1113900,1147000,1111400,1121400,32438000,1106990.0\n1592,05/04/2004,00:00,1122500,1132600,1116600,1123600,49564600,1119680.0\n1593,05/05/2004,00:00,1124200,1129600,1121600,1125800,31951000,1128230.0\n1594,05/06/2004,00:00,1120200,1129900,1110000,1118500,55153900,1125760.0\n1595,05/07/2004,00:00,1112200,1125000,1017700,1103000,56597900,1105890.0\n1596,05/10/2004,00:00,1094400,1103000,1083600,1091300,71688500,1086220.0\n1597,05/11/2004,00:00,1094600,1100500,1091700,1100100,45139000,1084160.0\n1598,05/12/2004,00:00,1095900,1103000,1080600,1103000,88509300,1093010.0\n1599,05/13/2004,00:00,1097600,1110800,1094400,1101500,55237300,1102390.0\n1600,05/14/2004,00:00,1099600,1115400,1092700,1100200,50676700,1104980.0\n1601,05/17/2004,00:00,1088900,1098900,1062900,1088500,50323900,1090860.0\n1602,05/18/2004,00:00,1095100,1099400,1093300,1097000,27587700,1090540.0\n1603,05/19/2004,00:00,1105000,1111800,1093000,1094100,52483500,1090860.0\n1604,05/20/2004,00:00,1094500,1098700,1090400,1095200,36316800,1093680.0\n1605,05/21/2004,00:00,1099700,1105500,1003200,1099300,45668000,1100760.0\n1606,05/24/2004,00:00,1105200,1109700,1089800,1100900,38977400,1101200.0\n1607,05/25/2004,00:00,1099200,1119800,1096000,1119200,47273500,1118510.0\n1608,05/26/2004,00:00,1116600,1130000,1109000,1120900,35125400,1128490.0\n1609,05/27/2004,00:00,1125300,1130300,1120600,1127200,42981900,1136240.0\n1610,05/28/2004,00:00,1127400,1129000,1120800,1127100,21270500,1137180.0\n1611,06/01/2004,00:00,1125000,1136300,1118700,1126800,38048600,1130660.0\n1612,06/02/2004,00:00,1130300,1137300,1124600,1131200,35038800,1132700.0\n1613,06/03/2004,00:00,1127900,1131900,1120400,1122500,32395900,1125370.0\n1614,06/04/2004,00:00,1130000,1135800,1126700,1129000,30328600,1127170.0\n1615,06/07/2004,00:00,1134800,1147000,1134200,1146500,29638400,1142360.0\n1616,06/08/2004,00:00,1143700,1149200,1141700,1148500,30447200,1153120.0\n1617,06/09/2004,00:00,1145200,1148600,1129800,1137700,33968300,1151810.0\n1618,06/10/2004,00:00,1140400,1143200,1139300,1143000,19793700,1146700.0\n1619,06/14/2004,00:00,1138400,1138500,1112300,1131900,30710200,1131110.0\n1620,06/15/2004,00:00,1139600,1144500,1135100,1139500,35119400,1132980.0\n1621,06/16/2004,00:00,1140200,1142000,1137000,1139900,24930800,1138670.0\n1622,06/17/2004,00:00,1138500,1140700,1133300,1138600,26144700,1138340.0\n1623,06/18/2004,00:00,1132700,1142200,1131800,1137100,30286600,1140250.0\n1624,06/21/2004,00:00,1137800,1141400,1131800,1133100,21889000,1132960.0\n1625,06/22/2004,00:00,1131300,1138200,1126700,1137900,35492200,1134470.0\n1626,06/23/2004,00:00,1136100,1148400,1134200,1147000,33526700,1144020.0\n1627,06/24/2004,00:00,1145600,1149300,1142600,1144400,33590600,1148450.0\n1628,06/25/2004,00:00,1144100,1149400,1139500,1141300,28221300,1147610.0\n1629,06/28/2004,00:00,1145200,1146100,1134300,1136800,38803300,1139110.0\n1630,06/29/2004,00:00,1135300,1141700,1134200,1139900,25858700,1135340.0\n1631,06/30/2004,00:00,1140700,1147900,1136500,1144500,45402600,1141020.0\n1632,07/01/2004,00:00,1142900,1144100,1125800,1132000,54746200,1135630.0\n1633,07/02/2004,00:00,1131300,1142000,1126000,1128000,32907500,1128590.0\n1634,07/06/2004,00:00,1123700,1177400,1116300,1119600,37407000,1115670.0\n1635,07/07/2004,00:00,1118100,1125700,1117500,1121400,26849200,1111520.0\n1636,07/08/2004,00:00,1118100,1144500,1112000,1112200,42989300,1108780.0\n1637,07/09/2004,00:00,1117000,1119400,1113800,1116400,28340700,1110340.0\n1638,07/12/2004,00:00,1115100,1120400,1110000,1117800,35749900,1114900.0\n1639,07/13/2004,00:00,1119000,1120200,1116300,1118900,24206700,1117520.0\n1640,07/14/2004,00:00,1112600,1144100,1111200,1114900,51054000,1118410.0\n1641,07/15/2004,00:00,1117400,1119100,1110100,1110400,33439800,1111210.0\n1642,07/16/2004,00:00,1115700,1119400,1104400,1105300,35916600,1103410.0\n1643,07/19/2004,00:00,1107500,1116400,1099900,1104500,38330500,1099280.0\n1644,07/20/2004,00:00,1105300,1113100,1102500,1112500,43557500,1106310.0\n1645,07/21/2004,00:00,1118100,1120600,1097600,1097900,50225500,1100780.0\n1646,07/22/2004,00:00,1094000,1103900,1087700,1100100,68211300,1098960.0\n1647,07/23/2004,00:00,1096300,1100800,1086900,1089200,47526400,1087940.0\n1648,07/26/2004,00:00,1091900,1099500,1082100,1088500,47699800,1080630.0\n1649,07/27/2004,00:00,1090500,1101100,1089700,1098800,49254500,1091960.0\n1650,07/28/2004,00:00,1095500,1103700,1077200,1100300,64194000,1098380.0\n1651,07/29/2004,00:00,1105400,1116300,1100000,1105500,49656000,1109780.0\n1652,07/30/2004,00:00,1103200,1108500,1005100,1106700,39101900,1112890.0\n1653,08/02/2004,00:00,1102000,1136100,1018100,1111000,36502400,1113700.0\n1654,08/03/2004,00:00,1109300,1118500,1100000,1103800,37293400,1109210.0\n1655,08/04/2004,00:00,1098900,1107500,1004500,1102800,39996100,1103470.0\n1656,08/05/2004,00:00,1102700,1109200,1083700,1085200,48165600,1086540.0\n1657,08/06/2004,00:00,1076300,1104400,1066200,1068300,69832900,1063020.0\n1658,08/09/2004,00:00,1070200,1102700,1068500,1070100,35622900,1055470.0\n1659,08/10/2004,00:00,1073100,1180000,1047700,1083600,50445900,1065950.0\n1660,08/11/2004,00:00,1076900,1083300,1047900,1080900,52934600,1079630.0\n1661,08/12/2004,00:00,1076800,1079500,1067700,1068500,46393500,1077640.0\n1662,08/13/2004,00:00,1071000,1073500,1065900,1070700,39483400,1070590.0\n1663,08/16/2004,00:00,1071400,1095300,1070300,1085300,42741600,1075760.0\n1664,08/17/2004,00:00,1087500,1092800,1085300,1087100,38877500,1087260.0\n1665,08/18/2004,00:00,1085200,1101300,1080800,1100800,39425800,1106780.0\n1666,08/19/2004,00:00,1098100,1100200,1083400,1096100,35353700,1107890.0\n1667,08/20/2004,00:00,1096200,1106300,1004200,1104400,44928200,1108900.0\n1668,08/23/2004,00:00,1105500,1107700,1014600,1102200,32167300,1108260.0\n1669,08/24/2004,00:00,1106400,1107300,1098500,1101900,28175700,1103570.0\n1670,08/25/2004,00:00,1103300,1112700,1099000,1111200,32871800,1111470.0\n1671,08/26/2004,00:00,1109600,1113100,1103900,1111600,25411100,1113280.0\n1672,08/27/2004,00:00,1112000,1116300,1103400,1114600,23741200,1118650.0\n1673,08/30/2004,00:00,1112300,1113400,1105100,1105800,24429400,1112380.0\n1674,08/31/2004,00:00,1106600,1110800,1101000,1110700,39554400,1108740.0\n1675,09/01/2004,00:00,1109500,1116400,1104800,1113100,48592800,1110890.0\n1676,09/02/2004,00:00,1112400,1126600,1112400,1125500,38976400,1122670.0\n1677,09/03/2004,00:00,1123000,1128200,1113000,1120900,27059500,1128700.0\n1678,09/07/2004,00:00,1125700,1131300,1120300,1128100,35207800,1132440.0\n1679,09/08/2004,00:00,1126200,1139300,1116200,1123500,31513900,1129240.0\n1680,09/09/2004,00:00,1125700,1128800,1120300,1125000,32230700,1125080.0\n1681,09/10/2004,00:00,1125200,1132700,1120800,1130900,26319500,1130750.0\n1682,09/13/2004,00:00,1132800,1137400,1130100,1132900,40108000,1133180.0\n1683,09/14/2004,00:00,1133000,1136900,1123600,1136100,26316500,1139610.0\n1684,09/15/2004,00:00,1133000,1133600,1123500,1127400,35820600,1133460.0\n1685,09/16/2004,00:00,1128500,1133700,1128000,1131000,21854300,1130070.0\n1686,09/17/2004,00:00,1129500,1133600,1126900,1131100,31200400,1129090.0\n1687,09/20/2004,00:00,1126900,1129900,1122800,1125200,35149300,1124730.0\n1688,09/21/2004,00:00,1127500,1134700,1125400,1132400,36802200,1130680.0\n1689,09/22/2004,00:00,1124800,1136000,1115000,1116300,47097600,1118770.0\n1690,09/23/2004,00:00,1116000,1117000,1110400,1111400,41857200,1108790.0\n1691,09/24/2004,00:00,1111700,1125800,1110000,1113500,33678500,1106440.0\n1692,09/27/2004,00:00,1111000,1118000,1105800,1106700,38491500,1099800.0\n1693,09/28/2004,00:00,1109100,1115100,1098000,1113500,36924500,1109190.0\n1694,09/29/2004,00:00,1112100,1117900,1110000,1117400,31233100,1116100.0\n1695,09/30/2004,00:00,1115500,1119800,1058800,1117400,36058300,1119250.0\n1696,10/01/2004,00:00,1122700,1135200,1117800,1134900,59600200,1136070.0\n1697,10/04/2004,00:00,1141000,1144400,1134900,1138500,31199200,1144590.0\n1698,10/05/2004,00:00,1138500,1141600,1130000,1138300,35789400,1148170.0\n1699,10/06/2004,00:00,1137700,1197900,1136800,1145600,40810300,1152880.0\n1700,10/07/2004,00:00,1143800,1188200,1133600,1133800,35343800,1139690.0\n1701,10/08/2004,00:00,1131500,1137700,1123500,1125800,49598900,1127430.0\n1702,10/11/2004,00:00,1127800,1130200,1126400,1128700,18952100,1122740.0\n1703,10/12/2004,00:00,1122000,1129500,1119400,1125300,37984800,1118130.0\n1704,10/13/2004,00:00,1130000,1130700,1113200,1116700,52363600,1115650.0\n1705,10/14/2004,00:00,1116800,1119300,1105800,1107000,62188900,1105820.0\n1706,10/15/2004,00:00,1110200,1126700,1105700,1111700,61272300,1102190.0\n1707,10/18/2004,00:00,1109100,1119600,1107000,1118000,41935800,1109860.0\n1708,10/19/2004,00:00,1120200,1144700,1007500,1107200,50433700,1109720.0\n1709,10/20/2004,00:00,1104000,1108800,1097500,1107100,54179800,1108910.0\n1710,10/21/2004,00:00,1107900,1113200,1102100,1110400,49232000,1106830.0\n1711,10/22/2004,00:00,1111800,1112500,1009400,1099500,45811600,1098300.0\n1712,10/25/2004,00:00,1097500,1101200,1093500,1098700,41245600,1097200.0\n1713,10/26/2004,00:00,1101300,1114300,1098800,1114000,47990100,1106570.0\n1714,10/27/2004,00:00,1113600,1131000,1111200,1129700,71710400,1126390.0\n1715,10/28/2004,00:00,1127600,1135600,1124900,1131700,52313400,1143340.0\n1716,10/29/2004,00:00,1131200,1160000,1105100,1133800,43958500,1147950.0\n1717,11/01/2004,00:00,1135600,1138400,1132000,1134900,35382400,1142590.0\n1718,11/02/2004,00:00,1136600,1145700,1132200,1135000,51994200,1137160.0\n1719,11/03/2004,00:00,1150000,1153600,1140000,1147700,72697500,1146580.0\n1720,11/04/2004,00:00,1147800,1166700,1146800,1165500,52191400,1166240.0\n1721,11/05/2004,00:00,1170200,1188400,1164900,1171000,58818600,1181630.0\n1722,11/08/2004,00:00,1170100,1172300,1167200,1170000,31567600,1185830.0\n1723,11/09/2004,00:00,1170800,1175000,1167600,1170000,41364900,1179570.0\n1724,11/10/2004,00:00,1170600,1175500,1167600,1169400,43129500,1171220.0\n1725,11/11/2004,00:00,1171800,1181200,1171000,1179900,35989400,1177220.0\n1726,11/12/2004,00:00,1179700,1189900,1173500,1189100,51980800,1190110.0\n1727,11/15/2004,00:00,1185000,1187300,1182300,1186700,33332800,1194950.0\n1728,11/16/2004,00:00,1183700,1186300,1177300,1177600,37279200,1187500.0\n1729,11/17/2004,00:00,1183600,1191400,1180700,1184000,52866900,1182470.0\n1730,11/18/2004,00:00,1185300,1188000,1182300,1186600,30321600,1182490.0\n1731,11/19/2004,00:00,1186800,1188700,1114700,1173200,52205900,1176220.0\n1732,11/22/2004,00:00,1171800,1181200,1170300,1179500,33744100,1178080.0\n1733,11/23/2004,00:00,1179300,1182600,1173700,1179700,39390300,1175890.0\n1734,11/24/2004,00:00,1182700,1185900,1180400,1185400,27437400,1182110.0\n1735,11/26/2004,00:00,1184900,1189800,1182600,1184000,15774700,1188610.0\n1736,11/29/2004,00:00,1187900,1190100,1174800,1181300,57211000,1184350.0\n1737,11/30/2004,00:00,1180000,1182400,1176400,1177700,44535700,1179190.0\n1738,12/01/2004,00:00,1181600,1194700,1181000,1194700,46255300,1188310.0\n1739,12/02/2004,00:00,1191000,1199500,1104000,1193800,56153800,1196200.0\n1740,12/03/2004,00:00,1193100,1201400,1190900,1194300,45404200,1200990.0\n1741,12/06/2004,00:00,1192200,1196400,1188000,1193400,31421600,1200080.0\n1742,12/07/2004,00:00,1194900,1196200,1180500,1180700,46933900,1182860.0\n1743,12/08/2004,00:00,1182100,1188300,1180100,1186200,41449400,1181040.0\n1744,12/09/2004,00:00,1181400,1194600,1177300,1193000,58418700,1186580.0\n1745,12/10/2004,00:00,1189100,1195600,1188500,1191700,45911300,1191670.0\n1746,12/13/2004,00:00,1197600,1203100,1193500,1202900,34960800,1205870.0\n1747,12/14/2004,00:00,1202000,1209600,1201800,1208000,37965000,1212410.0\n1748,12/15/2004,00:00,1207000,1211100,1203100,1209700,44604000,1215970.0\n1749,12/16/2004,00:00,1207200,1288800,1200400,1207000,48635000,1215080.0\n1750,12/17/2004,00:00,1194500,1200000,1188800,1194200,68764900,1198840.0\n1751,12/20/2004,00:00,1197300,1203800,1071400,1192700,43703500,1188490.0\n1752,12/21/2004,00:00,1196000,1209200,1188900,1204000,31313000,1193810.0\n1753,12/22/2004,00:00,1203800,1210800,1200500,1209100,28050900,1205600.0\n1754,12/23/2004,00:00,1208700,1212800,1200900,1209900,24642500,1216320.0\n1755,12/27/2004,00:00,1212200,1213600,1204100,1204200,26711200,1212650.0\n1756,12/28/2004,00:00,1206200,1213000,1206000,1212500,22136400,1211570.0\n1757,12/29/2004,00:00,1210800,1213300,1209500,1212700,18987600,1212620.0\n1758,12/30/2004,00:00,1214000,1215700,1212100,1212300,19640700,1214310.0\n1759,12/31/2004,00:00,1213000,1216600,1210300,1210400,26981200,1214080.0\n1760,01/03/2005,00:00,1215600,1217600,1199000,1200600,52549400,1201870.0\n1761,01/04/2005,00:00,1204600,1205400,1184400,1187400,63670100,1185990.0\n1762,01/05/2005,00:00,1187500,1197700,1182900,1183200,60465900,1174420.0\n1763,01/06/2005,00:00,1184400,1191500,1180400,1187100,45431000,1174540.0\n1764,01/07/2005,00:00,1189700,1192300,1181300,1185600,50053400,1179690.0\n1765,01/10/2005,00:00,1183400,1194600,1165700,1189400,54407600,1188460.0\n1766,01/11/2005,00:00,1186500,1187400,1179900,1182900,58837800,1186150.0\n1767,01/12/2005,00:00,1183900,1188400,1173400,1188000,69071600,1186330.0\n1768,01/13/2005,00:00,1186100,1187300,1175000,1176800,50964900,1178840.0\n1769,01/14/2005,00:00,1179500,1185300,1177600,1184200,38630900,1179310.0\n1770,01/18/2005,00:00,1180600,1196000,1179500,1195700,50021700,1192060.0\n1771,01/19/2005,00:00,1194200,1198800,1183900,1184000,48400500,1189010.0\n1772,01/20/2005,00:00,1179000,1188000,1172900,1175700,68647100,1182560.0\n1773,01/21/2005,00:00,1177800,1180000,1167400,1168000,59412000,1165800.0\n1774,01/24/2005,00:00,1170700,1173400,1163700,1164200,56278400,1153820.0\n1775,01/25/2005,00:00,1169100,1174700,1164000,1168700,64935300,1159490.0\n1776,01/26/2005,00:00,1173100,1176000,1168400,1174100,53178500,1169390.0\n1777,01/27/2005,00:00,1171800,1177500,1169800,1174600,51656700,1176850.0\n1778,01/28/2005,00:00,1174900,1176500,1166100,1171300,57898800,1176610.0\n1779,01/31/2005,00:00,1179500,1182500,1171600,1180700,47206900,1180240.0\n1780,02/01/2005,00:00,1182800,1190800,1178200,1189100,46500500,1188790.0\n1781,02/02/2005,00:00,1190600,1195900,1189000,1193400,50686700,1198440.0\n1782,02/03/2005,00:00,1190700,1193900,1185700,1190500,46890200,1200330.0\n1783,02/04/2005,00:00,1190300,1204300,1189800,1203300,45849500,1205380.0\n1784,02/07/2005,00:00,1202200,1205200,1199600,1202300,45326700,1206610.0\n1785,02/08/2005,00:00,1201700,1206500,1200700,1203400,37917800,1208120.0\n1786,02/09/2005,00:00,1204200,1204900,1192500,1193000,54087900,1200030.0\n1787,02/10/2005,00:00,1196600,1200200,1192600,1198300,43605900,1194270.0\n1788,02/11/2005,00:00,1197100,1210400,1194600,1207200,50744300,1202250.0\n1789,02/14/2005,00:00,1206800,1208600,1204800,1207800,28958400,1208840.0\n1790,02/15/2005,00:00,1208000,1214300,1200500,1212000,41621100,1217910.0\n1791,02/16/2005,00:00,1209300,1214600,1206700,1211900,56129400,1217040.0\n1792,02/17/2005,00:00,1212300,1213300,1202400,1202900,57162500,1207010.0\n1793,02/18/2005,00:00,1201700,1204800,1199000,1203500,43451100,1202310.0\n1794,02/22/2005,00:00,1199000,1209200,1185800,1186700,72140500,1185700.0\n1795,02/23/2005,00:00,1189700,1195700,1186200,1193300,65275900,1183640.0\n1796,02/24/2005,00:00,1192400,1203200,1189800,1202600,65798900,1194560.0\n1797,02/25/2005,00:00,1202700,1216700,1121800,1213800,56554200,1210930.0\n1798,02/28/2005,00:00,1211600,1216500,1200200,1205400,67296400,1217730.0\n1799,03/01/2005,00:00,1207800,1219100,1206200,1213000,45300400,1218280.0\n1800,03/02/2005,00:00,1207600,1219300,1200100,1212900,62001600,1215480.0\n1801,03/03/2005,00:00,1216600,1219000,1207000,1213600,59080400,1213870.0\n1802,03/04/2005,00:00,1220500,1229000,1202400,1225600,52150100,1226400.0\n1803,03/07/2005,00:00,1226500,1232500,1219000,1227800,41887600,1231270.0\n1804,03/08/2005,00:00,1226700,1230000,1220500,1222000,43070300,1230100.0\n1805,03/09/2005,00:00,1219600,1222900,1209800,1210100,67756000,1216640.0\n1806,03/10/2005,00:00,1212100,1262700,1204000,1212000,60990700,1206030.0\n1807,03/11/2005,00:00,1213100,1217200,1201600,1204100,51224300,1197980.0\n1808,03/14/2005,00:00,1206300,1210600,1202800,1210400,34761900,1202960.0\n1809,03/15/2005,00:00,1214200,1214600,1201300,1201700,56843000,1202140.0\n1810,03/16/2005,00:00,1197000,1201600,1189000,1191800,74274500,1191160.0\n1811,03/17/2005,00:00,1193100,1197400,1174900,1194100,61200800,1188840.0\n1812,03/18/2005,00:00,1191100,1192200,1181000,1188100,54654300,1181560.0\n1813,03/21/2005,00:00,1187100,1188800,1177600,1182600,61949700,1179090.0\n1814,03/22/2005,00:00,1183600,1189300,1170600,1171300,82219600,1169830.0\n1815,03/23/2005,00:00,1169500,1190600,1166200,1170600,65916200,1162200.0\n1816,03/24/2005,00:00,1174700,1179900,1154300,1171400,52311300,1163180.0\n1817,03/28/2005,00:00,1174200,1179400,1173300,1173600,43073500,1168530.0\n1818,03/29/2005,00:00,1171400,1179000,1162500,1164200,66357200,1166860.0\n1819,03/30/2005,00:00,1167900,1181300,1164900,1181200,59611200,1176400.0\n1820,03/31/2005,00:00,1181900,1186600,1100900,1179500,57864400,1181120.0\n1821,04/01/2005,00:00,1186200,1197400,1169100,1172200,88516200,1177890.0\n1822,04/04/2005,00:00,1173500,1178600,1167400,1175900,69490600,1178920.0\n1823,04/05/2005,00:00,1178000,1188200,1171100,1180900,45339100,1176680.0\n1824,04/06/2005,00:00,1184500,1189500,1181400,1184000,50798500,1183810.0\n1825,04/07/2005,00:00,1184100,1192300,1181200,1191500,45098800,1194910.0\n1826,04/08/2005,00:00,1191500,1192400,1180800,1181000,60256500,1188900.0\n1827,04/11/2005,00:00,1182900,1184200,1178300,1181800,40105700,1183480.0\n1828,04/12/2005,00:00,1178900,1190600,1170700,1187600,84091000,1184430.0\n1829,04/13/2005,00:00,1185500,1188000,1171300,1174200,64497900,1174820.0\n1830,04/14/2005,00:00,1174200,1178700,1161300,1162700,89278600,1164200.0\n1831,04/15/2005,00:00,1157400,1168200,1141600,1142800,122829900,1138950.0\n1832,04/18/2005,00:00,1141500,1149600,1139600,1146100,100906500,1128360.0\n1833,04/19/2005,00:00,1150700,1155300,1146200,1152900,62549700,1137980.0\n1834,04/20/2005,00:00,1154000,1159100,1136000,1138200,101141700,1136870.0\n1835,04/21/2005,00:00,1147900,1177500,1136300,1159900,79793700,1155870.0\n1836,04/22/2005,00:00,1157400,1165000,1142700,1152800,85639700,1156100.0\n1837,04/25/2005,00:00,1158600,1165000,1152500,1162700,49529900,1163560.0\n1838,04/26/2005,00:00,1159800,1168300,1152200,1152200,69995100,1162400.0\n1839,04/27/2005,00:00,1148600,1168000,1100000,1156800,81749300,1154840.0\n1840,04/28/2005,00:00,1152700,1156800,1143500,1144000,67658400,1146650.0\n1841,04/29/2005,00:00,1150800,1157900,1139700,1157000,96786200,1148660.0\n1842,05/02/2005,00:00,1160700,1169800,1155200,1163300,51204700,1161380.0\n1843,05/03/2005,00:00,1160500,1169300,1156900,1162500,79724100,1165930.0\n1844,05/04/2005,00:00,1166500,1177500,1162200,1176200,76940300,1181570.0\n1845,05/05/2005,00:00,1176600,1197800,1166900,1173600,95099800,1180350.0\n1846,05/06/2005,00:00,1179300,1191700,1166700,1172000,58802400,1178070.0\n1847,05/09/2005,00:00,1172100,1180300,1170500,1180100,40956400,1182180.0\n1848,05/10/2005,00:00,1173800,1199800,1163900,1166900,69692500,1170130.0\n1849,05/11/2005,00:00,1169300,1182700,1158500,1172000,91441800,1170430.0\n1850,05/12/2005,00:00,1173100,1175900,1159500,1160900,92240500,1161290.0\n1851,05/13/2005,00:00,1163000,1166500,1148000,1156000,82621400,1150920.0\n1852,05/16/2005,00:00,1157000,1168500,1156600,1167900,46345300,1160540.0\n1853,05/17/2005,00:00,1164300,1177000,1161600,1175900,56297900,1170980.0\n1854,05/18/2005,00:00,1180600,1198400,1176300,1187900,74431600,1191890.0\n1855,05/19/2005,00:00,1190000,1194100,1187000,1193800,60157700,1204980.0\n1856,05/20/2005,00:00,1193200,1193900,1187400,1191500,44961800,1202930.0\n1857,05/23/2005,00:00,1192000,1200400,1191800,1196500,49271200,1202560.0\n1858,05/24/2005,00:00,1194400,1198300,1192000,1196500,48619100,1199210.0\n1859,05/25/2005,00:00,1193600,1194700,1188300,1193200,46436700,1195440.0\n1860,05/26/2005,00:00,1197900,1202100,1177700,1200500,41089000,1200050.0\n1861,05/27/2005,00:00,1200800,1202500,1198000,1201800,22957300,1202080.0\n1862,05/31/2005,00:00,1200600,1201700,1175100,1194500,37515500,1198680.0\n1863,06/01/2005,00:00,1195200,1209200,1194000,1205400,67003900,1204600.0\n1864,06/02/2005,00:00,1202300,1208400,1201000,1207100,36378300,1206900.0\n1865,06/03/2005,00:00,1205500,1208900,1197300,1199400,54879800,1203980.0\n1866,06/06/2005,00:00,1200100,1202200,1195500,1201400,35188600,1203900.0\n1867,06/07/2005,00:00,1203900,1215100,1200500,1200700,64760100,1198270.0\n1868,06/08/2005,00:00,1204500,1239500,1196700,1198500,44024200,1196650.0\n1869,06/09/2005,00:00,1197400,1205800,1193400,1204900,55209900,1203410.0\n1870,06/10/2005,00:00,1205700,1206500,1192400,1202100,35179100,1203200.0\n1871,06/13/2005,00:00,1199500,1210800,1120400,1204900,49436000,1205820.0\n1872,06/14/2005,00:00,1204500,1212000,1203800,1208200,31230400,1209540.0\n1873,06/15/2005,00:00,1211600,1212400,1202300,1210600,49252400,1211390.0\n1874,06/16/2005,00:00,1211000,1216400,1209200,1214800,43565800,1217450.0\n1875,06/17/2005,00:00,1215400,1219300,1212000,1216000,47977100,1219540.0\n1876,06/20/2005,00:00,1210800,1221800,1209400,1215000,38514300,1218620.0\n1877,06/21/2005,00:00,1214900,1216500,1210300,1213000,37130200,1215380.0\n1878,06/22/2005,00:00,1216900,1219400,1210700,1213700,37307200,1212940.0\n1879,06/23/2005,00:00,1213100,1216000,1199700,1200000,58369200,1201550.0\n1880,06/24/2005,00:00,1198800,1200100,1190500,1190900,54003500,1188160.0\n1881,06/27/2005,00:00,1189700,1194100,1187500,1190400,47317200,1181200.0\n1882,06/28/2005,00:00,1194100,1202400,1193700,1201800,39080800,1189340.0\n1883,06/29/2005,00:00,1203700,1204000,1198100,1199400,39211300,1199410.0\n1884,06/30/2005,00:00,1202000,1203200,1189500,1190600,58278500,1197140.0\n1885,07/01/2005,00:00,1194600,1198000,1192100,1195000,45998200,1194840.0\n1886,07/05/2005,00:00,1192600,1206500,1191900,1204800,47048100,1198800.0\n1887,07/06/2005,00:00,1203900,1206500,1194500,1194900,50628400,1198500.0\n1888,07/07/2005,00:00,1182900,1204000,1181800,1197700,92297300,1200830.0\n1889,07/08/2005,00:00,1199700,1213200,1197200,1212200,59162200,1209110.0\n1890,07/11/2005,00:00,1213300,1220600,1213100,1220200,47110000,1220390.0\n1891,07/12/2005,00:00,1219000,1226300,1216400,1222200,48983200,1232570.0\n1892,07/13/2005,00:00,1222700,1225200,1219900,1223400,40981800,1233560.0\n1893,07/14/2005,00:00,1229800,1234400,1223700,1227400,57987700,1231160.0\n1894,07/15/2005,00:00,1227900,1230400,1223600,1227700,54614800,1230240.0\n1895,07/18/2005,00:00,1225000,1228300,1220500,1222000,48673800,1225710.0\n1896,07/19/2005,00:00,1227100,1231100,1221700,1230000,55803900,1228440.0\n1897,07/20/2005,00:00,1225900,1238900,1223000,1235400,64521900,1233990.0\n1898,07/21/2005,00:00,1235500,1238900,1224700,1227000,92944900,1232020.0\n1899,07/22/2005,00:00,1228800,1252500,1226300,1234300,47486400,1236220.0\n1900,07/25/2005,00:00,1234100,1239500,1228500,1229300,52796300,1230450.0\n1901,07/26/2005,00:00,1232300,1235300,1229500,1232300,40785000,1230490.0\n1902,07/27/2005,00:00,1234800,1238500,1230500,1237900,39685200,1238100.0\n1903,07/28/2005,00:00,1239900,1249300,1236400,1245000,44763500,1244760.0\n1904,07/29/2005,00:00,1244100,1246300,1234000,1235600,55057100,1243610.0\n1905,08/01/2005,00:00,1238000,1240400,1218900,1235500,38117000,1238490.0\n1906,08/02/2005,00:00,1238700,1282800,1237400,1244600,41215300,1240890.0\n1907,08/03/2005,00:00,1242400,1247400,1241000,1246400,34143400,1244960.0\n1908,08/04/2005,00:00,1242200,1246900,1236000,1236600,44221800,1243610.0\n1909,08/05/2005,00:00,1234600,1323000,1226700,1227700,45790400,1231080.0\n1910,08/08/2005,00:00,1231700,1234100,1223800,1224200,44866200,1218050.0\n1911,08/09/2005,00:00,1230500,1235900,1228700,1233400,44479300,1222140.0\n1912,08/10/2005,00:00,1238300,1245000,1228200,1231200,71679400,1229090.0\n1913,08/11/2005,00:00,1232700,1240300,1222200,1239700,52989200,1240540.0\n1914,08/12/2005,00:00,1235700,1293000,1227500,1232400,50323600,1238990.0\n1915,08/15/2005,00:00,1232000,1238700,1220200,1236500,35280100,1236860.0\n1916,08/16/2005,00:00,1234400,1235200,1158800,1221300,64281400,1225320.0\n1917,08/17/2005,00:00,1221900,1228700,1220300,1222900,57832500,1217150.0\n1918,08/18/2005,00:00,1220400,1225600,1218400,1221100,50023000,1215980.0\n1919,08/19/2005,00:00,1226300,1228200,1222000,1222700,36682500,1216560.0\n1920,08/22/2005,00:00,1225800,1232300,1218800,1224700,62703800,1224520.0\n1921,08/23/2005,00:00,1225100,1226100,1216700,1220500,50510600,1222020.0\n1922,08/24/2005,00:00,1219400,1227300,1211900,1212400,77192900,1214400.0\n1923,08/25/2005,00:00,1213400,1216700,1212100,1215300,32485000,1210990.0\n1924,08/26/2005,00:00,1214800,1222400,1206800,1208200,57181200,1204760.0\n1925,08/29/2005,00:00,1204100,1217800,1203800,1216000,51582300,1210520.0\n1926,08/30/2005,00:00,1212500,1216200,1203900,1211800,70465600,1212590.0\n1927,08/31/2005,00:00,1211900,1233300,1200000,1223900,92779400,1221280.0\n1928,09/01/2005,00:00,1224900,1231500,1196200,1225400,69968300,1229750.0\n1929,09/02/2005,00:00,1228300,1228800,1221000,1221300,41648500,1226940.0\n1930,09/06/2005,00:00,1226700,1237600,1056800,1237500,51230000,1238620.0\n1931,09/07/2005,00:00,1236300,1241300,1228600,1240200,36520600,1243070.0\n1932,09/08/2005,00:00,1236600,1240000,1233100,1235800,37655700,1243950.0\n1933,09/09/2005,00:00,1238300,1247400,1238000,1244800,39081200,1249510.0\n1934,09/12/2005,00:00,1244400,1246700,1242700,1244300,30005200,1245980.0\n1935,09/13/2005,00:00,1241300,1244200,1235200,1235500,53748300,1239850.0\n1936,09/14/2005,00:00,1237500,1239200,1230200,1231800,46358500,1233250.0\n1937,09/15/2005,00:00,1234900,1236500,1229000,1232200,62864900,1226410.0\n1938,09/16/2005,00:00,1232800,1237400,1228700,1237000,63891100,1230790.0\n1939,09/19/2005,00:00,1234500,1237000,1226400,1229600,51497100,1231240.0\n1940,09/20/2005,00:00,1232100,1237000,1218700,1221000,80588800,1223060.0\n1941,09/21/2005,00:00,1218100,1313700,1208600,1208900,85097800,1206960.0\n1942,09/22/2005,00:00,1209500,1216600,1204400,1214400,74745900,1202410.0\n1943,09/23/2005,00:00,1212400,1218900,1209000,1215600,54943900,1207520.0\n1944,09/26/2005,00:00,1220400,1227800,1210000,1214700,57798800,1213150.0\n1945,09/27/2005,00:00,1215200,1219900,1210200,1215000,63881400,1217470.0\n1946,09/28/2005,00:00,1219100,1221200,1212000,1216800,56814200,1216560.0\n1947,09/29/2005,00:00,1215700,1228600,1210800,1228100,60049900,1226170.0\n1948,09/30/2005,00:00,1226100,1229700,1206900,1228200,41435300,1232590.0\n1949,10/03/2005,00:00,1229500,1233400,1224500,1226800,44691500,1233480.0\n1950,10/04/2005,00:00,1227900,1230300,1213300,1213800,56378600,1220550.0\n1951,10/05/2005,00:00,1213100,1226700,1120900,1196300,104231600,1195240.0\n1952,10/06/2005,00:00,1197800,1202600,1181700,1191500,136216000,1180150.0\n1953,10/07/2005,00:00,1197000,1200500,1191300,1196700,58763800,1180270.0\n1954,10/10/2005,00:00,1196900,1197100,1171900,1187700,48756000,1181660.0\n1955,10/11/2005,00:00,1189900,1193900,1183200,1185400,68192700,1183840.0\n1956,10/12/2005,00:00,1183900,1191300,1174100,1178500,97431400,1176770.0\n1957,10/13/2005,00:00,1174600,1180800,1168800,1177700,89707700,1171040.0\n1958,10/14/2005,00:00,1181200,1188100,1175600,1187500,81680900,1180930.0\n1959,10/17/2005,00:00,1187600,1192700,1180000,1190700,68456100,1189840.0\n1960,10/18/2005,00:00,1189500,1189600,1178700,1179000,66284300,1186880.0\n1961,10/19/2005,00:00,1175600,1196600,1166500,1196400,108292500,1194930.0\n1962,10/20/2005,00:00,1195100,1198100,1173000,1177200,118135600,1181690.0\n1963,10/21/2005,00:00,1182700,1187800,1175100,1180200,84104000,1177860.0\n1964,10/24/2005,00:00,1184400,1200600,1184100,1200400,66492800,1194620.0\n1965,10/25/2005,00:00,1197100,1202400,1189400,1197400,74005400,1197880.0\n1966,10/26/2005,00:00,1195000,1205400,1191900,1192400,75247300,1203800.0\n1967,10/27/2005,00:00,1192100,1193700,1092200,1179700,64586100,1187320.0\n1968,10/28/2005,00:00,1184200,1199500,1181000,1199000,65048600,1187630.0\n1969,10/31/2005,00:00,1202900,1213000,1179600,1207100,69066300,1202920.0\n1970,11/01/2005,00:00,1205600,1209000,1202200,1203000,62551400,1210820.0\n1971,11/02/2005,00:00,1201700,1216600,1200000,1216300,66715600,1224180.0\n1972,11/03/2005,00:00,1221500,1226600,1217500,1221500,77189100,1225640.0\n1973,11/04/2005,00:00,1224000,1224600,1215500,1221100,55536400,1227750.0\n1974,11/07/2005,00:00,1224000,1226200,1218500,1224400,45570900,1231540.0\n1975,11/08/2005,00:00,1219500,1224900,1217900,1220700,36980200,1224310.0\n1976,11/09/2005,00:00,1220800,1229500,1200500,1222500,54993400,1222520.0\n1977,11/10/2005,00:00,1223600,1235200,1210000,1233500,76915500,1231310.0\n1978,11/11/2005,00:00,1233500,1238400,1232800,1236500,33417900,1238620.0\n1979,11/14/2005,00:00,1237600,1240200,1233700,1236700,39706000,1243780.0\n1980,11/15/2005,00:00,1235700,1240900,1228600,1231600,63667500,1238580.0\n1981,11/16/2005,00:00,1233900,1235500,1229800,1234700,44039900,1233850.0\n1982,11/17/2005,00:00,1237600,1246200,1232400,1245300,57967000,1241640.0\n1983,11/18/2005,00:00,1250200,1260600,1243300,1250900,63374300,1252470.0\n1984,11/21/2005,00:00,1251600,1259100,1249800,1257800,47473900,1264640.0\n1985,11/22/2005,00:00,1255600,1265200,1254200,1263700,60798500,1271630.0\n1986,11/23/2005,00:00,1262500,1274100,1255500,1268800,46390200,1275240.0\n1987,11/25/2005,00:00,1269800,1272200,1268100,1270500,14892900,1277400.0\n1988,11/28/2005,00:00,1272500,1296900,1255600,1261500,49611900,1268720.0\n1989,11/29/2005,00:00,1266300,1269800,1260900,1261200,47766200,1261450.0\n1990,11/30/2005,00:00,1261400,1265200,1250100,1253300,46009300,1250970.0\n1991,12/01/2005,00:00,1260200,1273200,1254100,1269100,58131400,1259820.0\n1992,12/02/2005,00:00,1267700,1270800,1265000,1268700,39385200,1269450.0\n1993,12/05/2005,00:00,1266400,1269000,1233400,1266400,49820100,1271480.0\n1994,12/06/2005,00:00,1270400,1277400,1266000,1267300,52902700,1272550.0\n1995,12/07/2005,00:00,1267700,1268700,1256800,1261500,62604400,1261620.0\n1996,12/08/2005,00:00,1262200,1268200,1254800,1260300,56442200,1258330.0\n1997,12/09/2005,00:00,1261700,1267800,1258200,1264100,45659800,1260440.0\n1998,12/12/2005,00:00,1267100,1268600,1259600,1265000,46001000,1263040.0\n1999,12/13/2005,00:00,1264000,1373200,1262900,1271700,81740400,1272050.0\n2000,12/14/2005,00:00,1272000,1280900,1217100,1277600,60029500,1280400.0\n2001,12/15/2005,00:00,1278400,1280000,1271800,1275300,51627500,1281240.0\n2002,12/16/2005,00:00,1272700,1285700,1264900,1266000,37921200,1272800.0\n2003,12/19/2005,00:00,1267300,1268700,1256900,1257800,44974100,1257860.0\n2004,12/20/2005,00:00,1258600,1262200,1254800,1257700,43769100,1249690.0\n2005,12/21/2005,00:00,1261700,1267600,1258000,1261200,45777800,1252650.0\n2006,12/22/2005,00:00,1263100,1266600,1260800,1266600,29111400,1263240.0\n2007,12/23/2005,00:00,1268000,1268600,1263000,1267500,25865800,1270650.0\n2008,12/27/2005,00:00,1269200,1270500,1254800,1255100,41540500,1261950.0\n2009,12/28/2005,00:00,1257400,1259900,1255000,1256100,25959800,1254790.0\n2010,12/29/2005,00:00,1257200,1259600,1252500,1253100,29960700,1248160.0\n2011,12/30/2005,00:00,1250000,1253100,1245000,1245500,37739700,1241660.0\n2012,01/03/2006,00:00,1251000,1270000,1243900,1267500,63518100,1259720.0\n2013,01/04/2006,00:00,1268300,1274900,1267000,1272700,48502600,1273260.0\n2014,01/05/2006,00:00,1271700,1275900,1268800,1272300,45892300,1281900.0\n2015,01/06/2006,00:00,1280400,1285800,1272800,1284100,54184700,1293020.0\n2016,01/09/2006,00:00,1284200,1290600,1257800,1289200,40835700,1293600.0\n2017,01/10/2006,00:00,1284000,1289700,1282600,1288800,39148700,1296150.0\n2018,01/11/2006,00:00,1290200,1294400,1287300,1293500,46839800,1299710.0\n2019,01/12/2006,00:00,1290800,1292800,1284400,1285900,37854500,1290670.0\n2020,01/13/2006,00:00,1285700,1289000,1282000,1287200,38762700,1286850.0\n2021,01/17/2006,00:00,1282000,1284200,1261100,1282500,43754700,1281910.0\n2022,01/18/2006,00:00,1275900,1282600,1265300,1277900,66875000,1275020.0\n2023,01/19/2006,00:00,1280900,1287700,1278100,1283700,69958300,1279330.0\n2024,01/20/2006,00:00,1282800,1284700,1208900,1261200,109067900,1263260.0\n2025,01/23/2006,00:00,1262100,1268200,1261200,1263300,49334000,1257190.0\n2026,01/24/2006,00:00,1266300,1271500,1259100,1266200,49548500,1257320.0\n2027,01/25/2006,00:00,1270400,1278800,1258400,1264700,76639000,1257920.0\n2028,01/26/2006,00:00,1272800,1276700,1264400,1274100,60096400,1274060.0\n2029,01/27/2006,00:00,1276500,1286600,1274500,1283100,59170500,1284530.0\n2030,01/30/2006,00:00,1284400,1288100,1283500,1285300,31808700,1291660.0\n2031,01/31/2006,00:00,1283400,1285400,1276500,1279500,61575800,1289580.0\n2032,02/01/2006,00:00,1278200,1283500,1277200,1282300,56094500,1284700.0\n2033,02/02/2006,00:00,1281000,1281500,1268000,1271100,74339500,1272160.0\n2034,02/03/2006,00:00,1266100,1286000,1261400,1264100,77976500,1261220.0\n2035,02/06/2006,00:00,1264400,1268000,1261700,1265600,42875400,1258720.0\n2036,02/07/2006,00:00,1263900,1266600,1254000,1255700,69103000,1250150.0\n2037,02/08/2006,00:00,1258900,1277500,1256000,1266300,54457300,1259160.0\n2038,02/09/2006,00:00,1269100,1373300,1263700,1265000,56317800,1264090.0\n2039,02/10/2006,00:00,1264400,1271300,1255500,1268200,60428900,1268510.0\n2040,02/13/2006,00:00,1265700,1267900,1259500,1264600,42303400,1269870.0\n2041,02/14/2006,00:00,1264600,1280300,1261900,1277100,86537400,1274600.0\n2042,02/15/2006,00:00,1276600,1283200,1272400,1281400,78200500,1283770.0\n2043,02/16/2006,00:00,1283400,1291200,1281800,1290800,54887500,1295020.0\n2044,02/17/2006,00:00,1290700,1299800,1285600,1288800,37046700,1299170.0\n2045,02/21/2006,00:00,1291200,1294000,1282900,1285200,42999700,1291740.0\n2046,02/22/2006,00:00,1287700,1296500,1286500,1294300,35191400,1294160.0\n2047,02/23/2006,00:00,1292700,1296400,1285400,1290100,38884600,1291070.0\n2048,02/24/2006,00:00,1291400,1294800,1287600,1292300,30177200,1293710.0\n2049,02/27/2006,00:00,1294000,1300400,1292800,1296900,32914200,1298180.0\n2050,02/28/2006,00:00,1291900,1296800,1281300,1282600,68489200,1286260.0\n2051,03/01/2006,00:00,1286000,1294900,1285000,1293900,43632800,1290530.0\n2052,03/02/2006,00:00,1288800,1294300,1286100,1292200,50923000,1290620.0\n2053,03/03/2006,00:00,1286700,1300700,1286500,1289900,62668500,1289780.0\n2054,03/06/2006,00:00,1291400,1291800,1278500,1281500,50413500,1286160.0\n2055,03/07/2006,00:00,1279100,1299000,1274000,1278600,55488700,1274830.0\n2056,03/08/2006,00:00,1277000,1284400,1271800,1281700,61905400,1275090.0\n2057,03/09/2006,00:00,1283400,1286800,1275700,1275700,48679100,1273020.0\n2058,03/10/2006,00:00,1277000,1288400,1273700,1285200,52312300,1281890.0\n2059,03/13/2006,00:00,1288400,1291600,1285300,1288200,41354000,1288690.0\n2060,03/14/2006,00:00,1287100,1302300,1285600,1301200,58883200,1301850.0\n2061,03/15/2006,00:00,1301500,1308600,1298500,1307700,44508400,1315600.0\n2062,03/16/2006,00:00,1309800,1314700,1307100,1310100,55354300,1319270.0\n2063,03/17/2006,00:00,1306800,1311100,1303800,1305800,41119400,1315830.0\n2064,03/20/2006,00:00,1306400,1309000,1302100,1303900,41646100,1306790.0\n2065,03/21/2006,00:00,1303400,1309900,1294500,1295900,84262000,1295740.0\n2066,03/22/2006,00:00,1295100,1305100,1294500,1304200,44408700,1297470.0\n2067,03/23/2006,00:00,1302400,1308800,1296600,1300800,44659100,1299210.0\n2068,03/24/2006,00:00,1299900,1305700,1289600,1301500,39306700,1301290.0\n2069,03/27/2006,00:00,1300300,1302800,1297400,1300800,29317100,1302770.0\n2070,03/28/2006,00:00,1299300,1305300,1285500,1292200,76689100,1292700.0\n2071,03/29/2006,00:00,1294000,1305000,1291400,1302100,53630400,1297470.0\n2072,03/30/2006,00:00,1301100,1309800,1295500,1299500,66169200,1298410.0\n2073,03/31/2006,00:00,1300300,1302400,1293700,1294900,53878400,1296550.0\n2074,04/03/2006,00:00,1300700,1308700,1294900,1296900,57388200,1297780.0\n2075,04/04/2006,00:00,1297300,1307300,1293600,1305300,52590200,1300880.0\n2076,04/05/2006,00:00,1306200,1312800,1300000,1310500,47959600,1311140.0\n2077,04/06/2006,00:00,1308500,1312100,1300000,1308200,53606800,1315220.0\n2078,04/07/2006,00:00,1310600,1314000,1293500,1294700,72472900,1302670.0\n2079,04/10/2006,00:00,1297100,1300800,1292600,1296000,38926200,1292620.0\n2080,04/11/2006,00:00,1298600,1300600,1282500,1286500,70269100,1281120.0\n2081,04/12/2006,00:00,1287700,1291300,1286100,1288400,40991400,1280420.0\n2082,04/13/2006,00:00,1285900,1292500,1281000,1288600,48734900,1284900.0\n2083,04/17/2006,00:00,1287900,1299000,1280200,1285200,60813700,1283090.0\n2084,04/18/2006,00:00,1289600,1309400,1285400,1307300,87769700,1302720.0\n2085,04/19/2006,00:00,1307200,1394100,1302400,1309900,79968700,1314390.0\n2086,04/20/2006,00:00,1310000,1343400,1306000,1311500,84361600,1321650.0\n2087,04/21/2006,00:00,1317400,1320300,1306200,1311000,68678100,1321720.0\n2088,04/24/2006,00:00,1309200,1311400,1303800,1308300,49851200,1310530.0\n2089,04/25/2006,00:00,1310500,1311200,1299200,1302300,82213100,1303080.0\n2090,04/26/2006,00:00,1305000,1311400,1302000,1305800,60106700,1301750.0\n2091,04/27/2006,00:00,1299000,1316300,1295900,1311600,125064500,1307410.0\n2092,04/28/2006,00:00,1307900,1317500,1307100,1311400,49519600,1312530.0\n2093,05/01/2006,00:00,1314600,1318800,1303200,1305600,59923900,1311000.0\n2094,05/02/2006,00:00,1310000,1314600,1307400,1313800,41447200,1312640.0\n2095,05/03/2006,00:00,1312000,1313200,1304500,1308200,56518300,1308800.0\n2096,05/04/2006,00:00,1310600,1316200,1309700,1312900,39683400,1312060.0\n2097,05/05/2006,00:00,1320400,1328000,1313100,1327100,57102700,1326150.0\n2098,05/08/2006,00:00,1325200,1327700,1323700,1325600,23221100,1330270.0\n2099,05/09/2006,00:00,1324300,1327700,1323100,1325300,23312900,1333890.0\n2100,05/10/2006,00:00,1324100,1333300,1318900,1324300,61544200,1329340.0\n2101,05/11/2006,00:00,1325000,1325500,1305200,1307800,73149600,1310050.0\n2102,05/12/2006,00:00,1304600,1307800,1291900,1292500,89797700,1289990.0\n2103,05/15/2006,00:00,1287900,1297100,1286300,1296200,79659600,1282220.0\n2104,05/16/2006,00:00,1297600,1307900,1290100,1293600,55124100,1280980.0\n2105,05/17/2006,00:00,1286700,1290900,1269500,1272000,128090900,1271270.0\n2106,05/18/2006,00:00,1273800,1277500,1263600,1263600,79315600,1258980.0\n2107,05/19/2006,00:00,1268700,1274800,1258300,1269600,117021900,1254040.0\n2108,05/22/2006,00:00,1262800,1271700,1255000,1269800,100274300,1258720.0\n2109,05/23/2006,00:00,1271800,1276300,1258100,1259000,72554200,1260860.0\n2110,05/24/2006,00:00,1256800,1267300,1247600,1260800,156200400,1259700.0\n2111,05/25/2006,00:00,1269200,1276600,1264500,1276300,66999400,1268420.0\n2112,05/26/2006,00:00,1280000,1283700,1275100,1283000,50860100,1282890.0\n2113,05/30/2006,00:00,1279700,1280500,1262600,1262800,62918600,1277320.0\n2114,05/31/2006,00:00,1265800,1273800,1262000,1273000,79211600,1274450.0\n2115,06/01/2006,00:00,1273800,1289400,1272700,1288200,63881900,1280800.0\n2116,06/02/2006,00:00,1292500,1294300,1283200,1291300,82438000,1292260.0\n2117,06/05/2006,00:00,1287900,1288600,1267700,1269000,76881400,1286070.0\n2118,06/06/2006,00:00,1272100,1279500,1257600,1267500,119624000,1268740.0\n2119,06/07/2006,00:00,1269100,1276500,1259100,1259100,99988100,1250420.0\n2120,06/08/2006,00:00,1255800,1265000,1230000,1261400,193070900,1248750.0\n2121,06/09/2006,00:00,1263600,1266700,1253400,1255300,83065000,1252410.0\n2122,06/12/2006,00:00,1258900,1259300,1239800,1240000,87631600,1239020.0\n2123,06/13/2006,00:00,1237800,1248400,1226700,1227300,165108700,1223120.0\n2124,06/14/2006,00:00,1228400,1236300,1223400,1234900,125590200,1219480.0\n2125,06/15/2006,00:00,1239000,1263600,1238700,1259700,114459700,1244550.0\n2126,06/16/2006,00:00,1251900,1255600,1244600,1250000,80280600,1258100.0\n2127,06/19/2006,00:00,1254000,1257500,1235500,1238200,89643700,1253090.0\n2128,06/20/2006,00:00,1240100,1248000,1237200,1238800,61113900,1240210.0\n2129,06/21/2006,00:00,1240000,1257000,1239600,1251300,70609600,1239200.0\n2130,06/22/2006,00:00,1249500,1250600,1240400,1244500,79935200,1245190.0\n2131,06/23/2006,00:00,1243300,1252900,1240300,1243900,49241400,1248470.0\n2132,06/26/2006,00:00,1245400,1250500,1242500,1250400,34554300,1250520.0\n2133,06/27/2006,00:00,1250100,1252900,1237700,1238700,64263700,1239970.0\n2134,06/28/2006,00:00,1241800,1247100,1236500,1245800,58413400,1243880.0\n2135,06/29/2006,00:00,1251900,1272800,1251700,1272300,92067200,1265880.0\n2136,06/30/2006,00:00,1274700,1276600,1269700,1270100,45804900,1277360.0\n2137,07/03/2006,00:00,1274300,1280100,1273100,1279000,23592200,1292650.0\n2138,07/05/2006,00:00,1272900,1274500,1265200,1270300,61318000,1284210.0\n2139,07/06/2006,00:00,1272000,1278500,1270800,1273700,46485300,1273980.0\n2140,07/07/2006,00:00,1272000,1275600,1263000,1265300,62152400,1267210.0\n2141,07/10/2006,00:00,1269400,1274300,1264100,1267400,52797000,1262680.0\n2142,07/11/2006,00:00,1266100,1274100,1259400,1272700,70836700,1269430.0\n2143,07/12/2006,00:00,1272100,1274000,1257200,1259600,79757400,1261500.0\n2144,07/13/2006,00:00,1254800,1256800,1241300,1242100,89803400,1245160.0\n2145,07/14/2006,00:00,1241500,1242600,1228300,1236300,93057100,1227780.0\n2146,07/17/2006,00:00,1235000,1241000,1231500,1234300,81501000,1218970.0\n2147,07/18/2006,00:00,1237500,1240500,1223900,1236800,110945600,1225800.0\n2148,07/19/2006,00:00,1241800,1262600,1241500,1259700,113164600,1252550.0\n2149,07/20/2006,00:00,1261200,1263000,1249200,1249600,102301600,1258940.0\n2150,07/21/2006,00:00,1251500,1251600,1238800,1241100,91040300,1252220.0\n2151,07/24/2006,00:00,1244400,1263200,1244400,1261300,82569500,1258820.0\n2152,07/25/2006,00:00,1259800,1273000,1257200,1269700,89318900,1265790.0\n2153,07/26/2006,00:00,1265900,1274400,1261800,1269000,80982700,1278360.0\n2154,07/27/2006,00:00,1273300,1276900,1262000,1263700,83523300,1276830.0\n2155,07/28/2006,00:00,1269900,1281400,1268600,1278500,73613600,1276960.0\n2156,07/31/2006,00:00,1276800,1279400,1265500,1276700,45112600,1278570.0\n2157,08/01/2006,00:00,1273400,1273800,1266000,1271600,59779400,1277360.0\n2158,08/02/2006,00:00,1275800,1284600,1275500,1279100,54742200,1281090.0\n2159,08/03/2006,00:00,1273300,1285400,1271500,1281200,57009300,1279760.0\n2160,08/04/2006,00:00,1290600,1294300,1274900,1280000,82405300,1282580.0\n2161,08/07/2006,00:00,1279000,1280700,1274000,1277600,40064500,1281770.0\n2162,08/08/2006,00:00,1281000,1284500,1269500,1273300,85261800,1273680.0\n2163,08/09/2006,00:00,1282000,1286000,1266100,1267800,69698700,1265930.0\n2164,08/10/2006,00:00,1265300,1275000,1262900,1272800,59427000,1267040.0\n2165,08/11/2006,00:00,1271700,1272000,1263900,1268400,44261200,1266310.0\n2166,08/14/2006,00:00,1276300,1281600,1269200,1270500,53400000,1269060.0\n2167,08/15/2006,00:00,1282200,1288700,1279100,1287100,58213500,1284210.0\n2168,08/16/2006,00:00,1293400,1298900,1290400,1297500,60369100,1299690.0\n2169,08/17/2006,00:00,1295700,1303700,1294900,1300300,62227600,1312000.0\n2170,08/18/2006,00:00,1301900,1304800,1295900,1304600,55412700,1316420.0\n2171,08/21/2006,00:00,1301800,1302500,1291400,1301100,37306500,1308650.0\n2172,08/22/2006,00:00,1299500,1305200,1296800,1301300,55297300,1303480.0\n2173,08/23/2006,00:00,1301800,1304400,1291900,1295700,62965500,1296850.0\n2174,08/24/2006,00:00,1299900,1301000,1294000,1298700,51483600,1295120.0\n2175,08/25/2006,00:00,1296400,1302900,1295500,1298400,39270800,1296640.0\n2176,08/28/2006,00:00,1296600,1308200,1296400,1304800,49560400,1302690.0\n2177,08/29/2006,00:00,1304900,1308300,1298100,1307500,57351500,1309930.0\n2178,08/30/2006,00:00,1308700,1310400,1305500,1307400,46878200,1311310.0\n2179,08/31/2006,00:00,1308500,1309900,1305800,1307100,29525300,1311040.0\n2180,09/01/2006,00:00,1311400,1315800,1308400,1314800,40424700,1314200.0\n2181,09/05/2006,00:00,1315100,1318500,1312000,1317200,47964900,1318840.0\n2182,09/06/2006,00:00,1311000,1311600,1303300,1304300,49301500,1311330.0\n2183,09/07/2006,00:00,1300600,1305700,1293500,1298200,80073400,1299830.0\n2184,09/08/2006,00:00,1300800,1304600,1298300,1303000,38018200,1294720.0\n2185,09/11/2006,00:00,1298600,1306900,1294800,1303800,65683400,1296870.0\n2186,09/12/2006,00:00,1305700,1318300,1305400,1316400,61896000,1314080.0\n2187,09/13/2006,00:00,1316200,1324500,1315200,1322500,58637400,1327380.0\n2188,09/14/2006,00:00,1319400,1322200,1317500,1320500,52366200,1329350.0\n2189,09/15/2006,00:00,1323400,1323900,1316800,1318200,65292400,1326150.0\n2190,09/18/2006,00:00,1318000,1326500,1316600,1320200,55715500,1320550.0\n2191,09/19/2006,00:00,1321200,1321400,1310700,1317500,82371900,1316690.0\n2192,09/20/2006,00:00,1322400,1328600,1304600,1324100,70440400,1322050.0\n2193,09/21/2006,00:00,1326000,1327500,1314300,1317000,81614100,1319850.0\n2194,09/22/2006,00:00,1316700,1316800,1310000,1313900,62386400,1314610.0\n2195,09/25/2006,00:00,1317300,1328500,1310500,1325400,84147600,1321260.0\n2196,09/26/2006,00:00,1324900,1335800,1324000,1335400,67666400,1332460.0\n2197,09/27/2006,00:00,1334800,1339700,1332500,1336400,72301000,1343710.0\n2198,09/28/2006,00:00,1337400,1339800,1332500,1337800,59890200,1347420.0\n2199,09/29/2006,00:00,1337900,1339400,1334800,1334800,40817300,1340320.0\n2200,10/02/2006,00:00,1335400,1338300,1329500,1330700,44652500,1331720.0\n2201,10/03/2006,00:00,1328900,1337900,1326600,1334400,68655400,1331490.0\n2202,10/04/2006,00:00,1332200,1350000,1330800,1349500,75263900,1344340.0\n2203,10/05/2006,00:00,1349000,1354100,1253500,1353000,54568200,1357040.0\n2204,10/06/2006,00:00,1349600,1350900,1344100,1350300,64091700,1360920.0\n2205,10/09/2006,00:00,1348500,1353000,1346400,1350900,37472800,1357760.0\n2206,10/10/2006,00:00,1351100,1354500,1348400,1353300,53759800,1353050.0\n2207,10/11/2006,00:00,1348400,1354300,1343000,1349900,91013400,1350520.0\n2208,10/12/2006,00:00,1354700,1363900,1354000,1362700,52652500,1360560.0\n2209,10/13/2006,00:00,1361600,1367100,1360400,1365500,45871200,1368040.0\n2210,10/16/2006,00:00,1365200,1370500,1364200,1368900,40366300,1374100.0\n2211,10/17/2006,00:00,1364700,1367000,1356700,1364500,85859100,1372920.0\n2212,10/18/2006,00:00,1370600,1373400,1361100,1365800,76340200,1367040.0\n2213,10/19/2006,00:00,1364100,1368700,1362300,1367500,58435000,1366710.0\n2214,10/20/2006,00:00,1368100,1369400,1360000,1368600,41403600,1367780.0\n2215,10/23/2006,00:00,1365600,1378000,1363900,1376800,58583800,1376860.0\n2216,10/24/2006,00:00,1373000,1378300,1372200,1377600,47700500,1381130.0\n2217,10/25/2006,00:00,1377400,1384100,1375900,1382000,65026300,1385900.0\n2218,10/26/2006,00:00,1386600,1399200,1379800,1388600,62481200,1392280.0\n2219,10/27/2006,00:00,1386100,1387500,1376400,1379100,69622200,1385500.0\n2220,10/30/2006,00:00,1376600,1382000,1374000,1378700,46718000,1380990.0\n2221,10/31/2006,00:00,1380700,1382500,1372500,1377900,62820600,1375830.0\n2222,11/01/2006,00:00,1382200,1383000,1367200,1368900,74753300,1366460.0\n2223,11/02/2006,00:00,1365000,1370100,1363600,1368100,49397500,1365000.0\n2224,11/03/2006,00:00,1372600,1373900,1356200,1366000,59368200,1361360.0\n2225,11/06/2006,00:00,1369600,1382800,1369500,1380800,61060900,1373210.0\n2226,11/07/2006,00:00,1382000,1389800,1344400,1384300,59784300,1386670.0\n2227,11/08/2006,00:00,1380000,1390500,1368600,1387400,77371400,1394390.0\n2228,11/09/2006,00:00,1390100,1391400,1379000,1380900,92487700,1390800.0\n2229,11/10/2006,00:00,1381400,1383400,1377200,1382700,43263600,1383340.0\n2230,11/13/2006,00:00,1381800,1390400,1380700,1386800,50853900,1384510.0\n2231,11/14/2006,00:00,1389700,1397300,1381200,1395500,83661000,1393290.0\n2232,11/15/2006,00:00,1395700,1404500,1395300,1399700,70170500,1404240.0\n2233,11/16/2006,00:00,1404400,1452000,1394900,1402300,58884800,1409030.0\n2234,11/17/2006,00:00,1399200,1404200,1397300,1403900,50228600,1409940.0\n2235,11/20/2006,00:00,1403000,1407400,1401000,1403700,56446500,1407200.0\n2236,11/21/2006,00:00,1404900,1406700,1402900,1405800,47757500,1407160.0\n2237,11/22/2006,00:00,1407500,1411600,1400000,1409200,38874400,1409690.0\n2238,11/24/2006,00:00,1402400,1408400,1402000,1404600,21623300,1407510.0\n2239,11/27/2006,00:00,1402900,1403500,1384400,1384900,75952500,1390000.0\n2240,11/28/2006,00:00,1382400,1391500,1381100,1390300,94228900,1382370.0\n2241,11/29/2006,00:00,1394700,1405300,1394200,1403600,79107800,1390870.0\n2242,11/30/2006,00:00,1404400,1410500,1397600,1404600,79790000,1403210.0\n2243,12/01/2006,00:00,1405300,1406600,1389700,1400600,114802600,1410510.0\n2244,12/04/2006,00:00,1402500,1415500,1400800,1413300,81558200,1415380.0\n2245,12/05/2006,00:00,1415600,1419600,1412600,1418800,63979700,1419910.0\n2246,12/06/2006,00:00,1418700,1420700,1415000,1417500,49723900,1424160.0\n2247,12/07/2006,00:00,1420300,1423000,1411100,1412200,55697300,1420700.0\n2248,12/08/2006,00:00,1411300,1419000,1407800,1414100,63778800,1413680.0\n2249,12/11/2006,00:00,1414200,1420900,1413400,1417400,34939300,1414140.0\n2250,12/12/2006,00:00,1416800,1418700,1408900,1416200,72746800,1416260.0\n2251,12/13/2006,00:00,1422300,1423300,1415600,1418400,48130900,1420010.0\n2252,12/14/2006,00:00,1418700,1432400,1418400,1429800,58885100,1428900.0\n2253,12/15/2006,00:00,1426500,1428900,1422400,1423800,55196600,1429040.0\n2254,12/18/2006,00:00,1425400,1435000,1417500,1419400,44417800,1425060.0\n2255,12/19/2006,00:00,1415300,1425600,1411900,1422800,56781500,1422360.0\n2256,12/20/2006,00:00,1422900,1426600,1420500,1421300,38432300,1418020.0\n2257,12/21/2006,00:00,1422700,1424300,1413200,1416200,43870900,1416710.0\n2258,12/22/2006,00:00,1416400,1416500,1407800,1408500,54236800,1409120.0\n2259,12/26/2006,00:00,1408200,1415800,1407800,1415400,25831300,1408560.0\n2260,12/27/2006,00:00,1418700,1426000,1418300,1425900,35903300,1419980.0\n2261,12/28/2006,00:00,1424100,1427000,1419900,1421900,33168800,1426220.0\n2262,12/29/2006,00:00,1421000,1425400,1414700,1415200,40461100,1423350.0\n2263,01/03/2007,00:00,1422700,1428400,1405800,1414500,103082600,1414830.0\n2264,01/04/2007,00:00,1412300,1420500,1406100,1416700,68197700,1411100.0\n2265,01/05/2007,00:00,1413300,1413900,1403800,1407600,69414700,1407050.0\n2266,01/08/2007,00:00,1408200,1414100,1402500,1411700,66512400,1408970.0\n2267,01/09/2007,00:00,1413100,1416000,1404000,1411300,71153200,1408940.0\n2268,01/10/2007,00:00,1405700,1415300,1403000,1414000,67224600,1411750.0\n2269,01/11/2007,00:00,1415600,1426200,1415000,1422700,52619600,1423210.0\n2270,01/12/2007,00:00,1421200,1430300,1420800,1429700,51861700,1432100.0\n2271,01/16/2007,00:00,1430500,1434400,1427300,1430300,42256900,1437710.0\n2272,01/17/2007,00:00,1428700,1434600,1427300,1429400,46167300,1436740.0\n2273,01/18/2007,00:00,1431800,1432500,1423100,1424500,61992100,1428310.0\n2274,01/19/2007,00:00,1425500,1431000,1424600,1429300,51748400,1426660.0\n2275,01/22/2007,00:00,1430700,1459500,1419300,1422100,58695700,1422170.0\n2276,01/23/2007,00:00,1422500,1430800,1420600,1427500,53361600,1424700.0\n2277,01/24/2007,00:00,1429700,1439800,1429100,1439100,56374000,1436720.0\n2278,01/25/2007,00:00,1438400,1439200,1344000,1423500,67120400,1429920.0\n2279,01/26/2007,00:00,1425900,1426500,1415800,1421900,70148700,1425500.0\n2280,01/29/2007,00:00,1421900,1426300,1417400,1419600,61032000,1416420.0\n2281,01/30/2007,00:00,1423600,1428300,1420600,1427600,67432100,1418270.0\n2282,01/31/2007,00:00,1426100,1441300,1424100,1438100,83878600,1436610.0\n2283,02/01/2007,00:00,1441500,1446600,1439100,1445700,63910200,1450410.0\n2284,02/02/2007,00:00,1447300,1449000,1443800,1447900,41581300,1458190.0\n2285,02/05/2007,00:00,1446900,1449300,1443400,1447000,38448100,1455840.0\n2286,02/06/2007,00:00,1449700,1450300,1443300,1447900,54230700,1451590.0\n2287,02/07/2007,00:00,1451200,1453600,1445700,1450300,53946900,1450520.0\n2288,02/08/2007,00:00,1448000,1451200,1442700,1448800,65985200,1449910.0\n2289,02/09/2007,00:00,1450600,1453300,1433900,1439200,74068700,1442230.0\n2290,02/12/2007,00:00,1439300,1440400,1431900,1434200,52040223,1432530.0\n2291,02/13/2007,00:00,1437700,1445500,1437600,1445100,57747043,1436020.0\n2292,02/14/2007,00:00,1448000,1458900,1447800,1456400,63401367,1451070.0\n2293,02/15/2007,00:00,1456700,1459500,1454300,1458300,35042400,1464760.0\n2294,02/16/2007,00:00,1454300,1457400,1452300,1456800,34840200,1467680.0\n2295,02/20/2007,00:00,1455600,1462000,1440600,1461000,51440200,1465180.0\n2296,02/21/2007,00:00,1456100,1460700,1453500,1458900,60179100,1460590.0\n2297,02/22/2007,00:00,1460500,1464200,1451700,1458300,73687100,1459290.0\n2298,02/23/2007,00:00,1457300,1457900,1447500,1453600,69286600,1454990.0\n2299,02/26/2007,00:00,1458300,1459500,1447500,1452100,64226939,1449850.0\n2300,02/27/2007,00:00,1438900,1442000,1391000,1400000,240160400,1407380.0\n2301,02/28/2007,00:00,1403900,1419800,1398000,1409300,157388600,1389180.0\n2302,03/01/2007,00:00,1393500,1412500,1380500,1405900,184864096,1382720.0\n2303,03/02/2007,00:00,1400500,1406500,1389000,1389800,136190700,1375810.0\n2304,03/05/2007,00:00,1379200,1395100,1376600,1376900,124971624,1376670.0\n2305,03/06/2007,00:00,1387800,1401200,1384400,1398000,124103700,1380500.0\n2306,03/07/2007,00:00,1397400,1404600,1394000,1394600,107667100,1388720.0\n2307,03/08/2007,00:00,1405500,1411600,1400700,1405400,98830200,1407610.0\n2308,03/09/2007,00:00,1413300,1414100,1400800,1406200,94249900,1416020.0\n2309,03/12/2007,00:00,1404200,1413400,1401600,1410100,70784500,1413600.0\n2310,03/13/2007,00:00,1402400,1407700,1381200,1381500,153621800,1393110.0\n2311,03/14/2007,00:00,1384300,1392400,1367500,1391400,218131100,1383110.0\n2312,03/15/2007,00:00,1390400,1399900,1388000,1395700,116295212,1385070.0\n2313,03/16/2007,00:00,1393100,1396300,1381200,1384800,103331708,1381780.0\n2314,03/19/2007,00:00,1392600,1403300,1391500,1400700,87263354,1400360.0\n2315,03/20/2007,00:00,1400800,1410400,1399600,1409300,76058944,1408620.0\n2316,03/21/2007,00:00,1411000,1436500,1408200,1433300,149067748,1434670.0\n2317,03/22/2007,00:00,1434700,1436400,1427900,1433100,113333402,1451000.0\n2318,03/23/2007,00:00,1432800,1437900,1431500,1435000,70644235,1450000.0\n2319,03/26/2007,00:00,1435000,1436500,1421200,1435900,110377931,1445790.0\n2320,03/27/2007,00:00,1431300,1431600,1424000,1427100,90033377,1430000.0\n2321,03/28/2007,00:00,1422300,1424700,1412600,1415400,142590430,1416310.0\n2322,03/29/2007,00:00,1425400,1426100,1411900,1421200,128167947,1412490.0\n2323,03/30/2007,00:00,1421700,1428400,1405600,1419400,115313800,1412130.0\n2324,04/02/2007,00:00,1421600,1424600,1414800,1423000,74548980,1419960.0\n2325,04/03/2007,00:00,1429700,1439800,1429100,1436600,73978508,1436380.0\n2326,04/04/2007,00:00,1436900,1439500,1431600,1437900,55336623,1442800.0\n2327,04/05/2007,00:00,1436700,1444400,1436100,1442800,43189240,1450450.0\n2328,04/09/2007,00:00,1445900,1447800,1441500,1444200,44716540,1451480.0\n2329,04/10/2007,00:00,1443300,1448500,1442700,1448000,53549739,1450630.0\n2330,04/11/2007,00:00,1448200,1448600,1435400,1438300,98582156,1444040.0\n2331,04/12/2007,00:00,1437400,1448000,1433400,1447400,109544751,1445130.0\n2332,04/13/2007,00:00,1449000,1452900,1443700,1452600,73851540,1450960.0\n2333,04/16/2007,00:00,1458700,1468600,1458400,1467800,73180718,1466990.0\n2334,04/17/2007,00:00,1469600,1474000,1466500,1470700,92046661,1480920.0\n2335,04/18/2007,00:00,1466000,1476400,1465700,1471500,79716663,1481890.0\n2336,04/19/2007,00:00,1465400,1474000,1463600,1470300,93454136,1478310.0\n2337,04/20/2007,00:00,1482000,1484800,1476900,1484700,111259258,1483020.0\n2338,04/23/2007,00:00,1483700,1487300,1479700,1481200,71438337,1485940.0\n2339,04/24/2007,00:00,1482300,1484000,1473300,1480400,106786997,1486230.0\n2340,04/25/2007,00:00,1487300,1496500,1481600,1494600,100169134,1495530.0\n2341,04/26/2007,00:00,1494900,1498000,1491000,1493900,83518805,1496500.0\n2342,04/27/2007,00:00,1490300,1497400,1488400,1494000,91329479,1500550.0\n2343,04/30/2007,00:00,1496300,1497400,1482100,1482300,92080774,1490000.0\n2344,05/01/2007,00:00,1485200,1494700,1476700,1486100,127418434,1481600.0\n2345,05/02/2007,00:00,1489000,1499500,1487500,1496200,82498312,1489510.0\n2346,05/03/2007,00:00,1499500,1504000,1490500,1502600,75972844,1501570.0\n2347,05/04/2007,00:00,1507500,1511100,1502200,1506400,84518329,1514130.0\n2348,05/07/2007,00:00,1508800,1512000,1508100,1509500,58016709,1517260.0\n2349,05/08/2007,00:00,1505700,1509200,1501300,1508600,74156636,1514170.0\n2350,05/09/2007,00:00,1506400,1528200,1504400,1513800,93550075,1515560.0\n2351,05/10/2007,00:00,1507300,1510200,1492700,1493300,140785030,1499750.0\n2352,05/11/2007,00:00,1497500,1508200,1497200,1508100,100530941,1501230.0\n2353,05/14/2007,00:00,1508600,1513000,1497900,1505500,104242001,1502290.0\n2354,05/15/2007,00:00,1507000,1516600,1501900,1503800,164645008,1502560.0\n2355,05/16/2007,00:00,1508000,1516300,1503800,1516100,106342127,1517750.0\n2356,05/17/2007,00:00,1513800,1519600,1511100,1514400,97297576,1516540.0\n2357,05/18/2007,00:00,1519400,1525000,1518100,1524900,89715341,1527760.0\n2358,05/21/2007,00:00,1525800,1532300,1525000,1527100,169217747,1533880.0\n2359,05/22/2007,00:00,1527100,1531600,1524000,1526000,74583722,1531450.0\n2360,05/23/2007,00:00,1529500,1535000,1523700,1523800,121227022,1529210.0\n2361,05/24/2007,00:00,1525300,1532000,1507400,1510100,175952900,1512510.0\n2362,05/25/2007,00:00,1514900,1520200,1511900,1518600,78518621,1511250.0\n2363,05/29/2007,00:00,1519400,1525000,1514500,1520800,78864194,1515180.0\n2364,05/30/2007,00:00,1514600,1533800,1513400,1533700,121948468,1530550.0\n2365,05/31/2007,00:00,1536600,1538900,1531200,1533500,92738217,1541910.0\n2366,06/01/2007,00:00,1538800,1544000,1535100,1539600,94158006,1545650.0\n2367,06/04/2007,00:00,1535300,1543900,1535000,1542400,68860762,1548730.0\n2368,06/05/2007,00:00,1537200,1539000,1528600,1534400,115048353,1539810.0\n2369,06/06/2007,00:00,1529100,1529500,1517600,1521000,141701715,1525120.0\n2370,06/07/2007,00:00,1515500,1520600,1492500,1493600,213266360,1492180.0\n2371,06/08/2007,00:00,1494200,1511900,1490900,1510500,159269911,1489000.0\n2372,06/11/2007,00:00,1509600,1519500,1507000,1513000,95929369,1498510.0\n2373,06/12/2007,00:00,1506700,1515400,1496700,1496700,203229576,1498200.0\n2374,06/13/2007,00:00,1504500,1519800,1501900,1519500,199710336,1518060.0\n2375,06/14/2007,00:00,1520600,1531200,1520300,1527100,130035045,1525270.0\n2376,06/15/2007,00:00,1532500,1536600,1529300,1530400,129793868,1536900.0\n2377,06/18/2007,00:00,1533600,1533900,1526600,1529000,82443861,1543190.0\n2378,06/19/2007,00:00,1526400,1533800,1523600,1532000,100350055,1535670.0\n2379,06/20/2007,00:00,1535900,1535900,1509600,1510200,171495940,1516080.0\n2380,06/21/2007,00:00,1510800,1521100,1502500,1519800,188604867,1512280.0\n2381,06/22/2007,00:00,1515000,1517700,1498500,1502400,186515531,1499060.0\n2382,06/25/2007,00:00,1502400,1512500,1490200,1496100,217859808,1488220.0\n2383,06/26/2007,00:00,1502100,1504600,1488200,1490700,177104734,1485030.0\n2384,06/27/2007,00:00,1482400,1505600,1480600,1505500,177953980,1490810.0\n2385,06/28/2007,00:00,1503700,1514100,1503100,1504000,142737708,1503520.0\n2386,06/29/2007,00:00,1508300,1516500,1491500,1499800,170502301,1505430.0\n2387,07/02/2007,00:00,1508400,1518000,1507700,1518000,88702331,1518270.0\n2388,07/03/2007,00:00,1521700,1525000,1519900,1522400,51988192,1524280.0\n2389,07/05/2007,00:00,1524300,1525600,1516300,1524300,76986388,1532660.0\n2390,07/06/2007,00:00,1523800,1531600,1519300,1529600,68311656,1538590.0\n2391,07/09/2007,00:00,1531500,1533600,1526200,1530800,68134745,1534860.0\n2392,07/10/2007,00:00,1522700,1526000,1508700,1508900,160715108,1517050.0\n2393,07/11/2007,00:00,1507500,1518900,1505300,1518400,148542017,1512650.0\n2394,07/12/2007,00:00,1523600,1547500,1523400,1547500,119573544,1534060.0\n2395,07/13/2007,00:00,1545700,1554600,1544000,1551100,96356361,1555100.0\n2396,07/16/2007,00:00,1549900,1555300,1545800,1549000,92650896,1568850.0\n2397,07/17/2007,00:00,1550200,1554800,1546800,1548600,109985438,1561490.0\n2398,07/18/2007,00:00,1543200,1548000,1533000,1545900,216371454,1546710.0\n2399,07/19/2007,00:00,1552000,1555300,1547600,1552200,128996829,1549090.0\n2400,07/20/2007,00:00,1548700,1549900,1528300,1533300,242445444,1537460.0\n2401,07/23/2007,00:00,1542800,1547200,1538400,1540600,105681900,1535540.0\n2402,07/24/2007,00:00,1531200,1535000,1507600,1511200,231005501,1512340.0\n2403,07/25/2007,00:00,1520300,1523900,1502700,1517500,246139539,1503510.0\n2404,07/26/2007,00:00,1501600,1507500,1464000,1485500,424889258,1482010.0\n2405,07/27/2007,00:00,1482600,1488700,1459000,1460400,358859128,1447210.0\n2406,07/30/2007,00:00,1458900,1478100,1453600,1472700,241553260,1449230.0\n2407,07/31/2007,00:00,1483300,1488800,1453900,1453900,270892856,1436000.0\n2408,08/01/2007,00:00,1452100,1470100,1439600,1466200,440958944,1454210.0\n2409,08/02/2007,00:00,1467700,1477600,1461000,1472900,269490793,1470770.0\n2410,08/03/2007,00:00,1472600,1475800,1432400,1433500,330332336,1442020.0\n2411,08/06/2007,00:00,1442200,1468300,1427600,1467600,297717655,1457230.0\n2412,08/07/2007,00:00,1459400,1489700,1456000,1476800,264111899,1468170.0\n2413,08/08/2007,00:00,1484100,1505800,1479200,1498600,254003397,1498290.0\n2414,08/09/2007,00:00,1474100,1489500,1456500,1457200,318863694,1490260.0\n2415,08/10/2007,00:00,1442400,1464600,1431200,1455400,373642344,1457920.0\n2416,08/13/2007,00:00,1465100,1468900,1452800,1455100,155532500,1442640.0\n2417,08/14/2007,00:00,1457000,1458400,1427500,1427700,259981792,1415630.0\n2418,08/15/2007,00:00,1427000,1444300,1406300,1409000,292967525,1403650.0\n2419,08/16/2007,00:00,1397900,1419200,1372500,1417300,503557150,1396210.0\n2420,08/17/2007,00:00,1455600,1458100,1423300,1447400,321464021,1423560.0\n2421,08/20/2007,00:00,1451300,1454500,1433000,1447500,177136236,1453180.0\n2422,08/21/2007,00:00,1445900,1458200,1441400,1449500,140401964,1467500.0\n2423,08/22/2007,00:00,1460100,1468000,1453300,1466600,155083872,1475870.0\n2424,08/23/2007,00:00,1473300,1476500,1456100,1465700,189807172,1472050.0\n2425,08/24/2007,00:00,1464900,1482500,1462800,1481600,115128829,1487500.0\n2426,08/27/2007,00:00,1478700,1479100,1468100,1469200,94133747,1482840.0\n2427,08/28/2007,00:00,1461600,1462400,1434600,1436500,201545328,1446910.0\n2428,08/29/2007,00:00,1443900,1467400,1439600,1467100,183933397,1451330.0\n2429,08/30/2007,00:00,1454500,1471800,1453100,1461500,175252806,1450490.0\n2430,08/31/2007,00:00,1476700,1485000,1468300,1474700,160229700,1472600.0\n2431,09/04/2007,00:00,1474700,1499800,1474000,1492000,107064171,1501940.0\n2432,09/05/2007,00:00,1481800,1483600,1470000,1475500,143102408,1488350.0\n2433,09/06/2007,00:00,1479500,1486100,1471300,1482600,114939005,1490160.0\n2434,09/07/2007,00:00,1464800,1468900,1452600,1458400,204773965,1464040.0\n2435,09/10/2007,00:00,1465100,1467100,1443400,1455100,168772272,1445450.0\n2436,09/11/2007,00:00,1462300,1477000,1461300,1476400,149098671,1461890.0\n2437,09/12/2007,00:00,1472800,1484300,1469900,1476400,144262146,1471460.0\n2438,09/13/2007,00:00,1485700,1494500,1482000,1488100,127665042,1495090.0\n2439,09/14/2007,00:00,1479500,1490900,1477400,1489300,107020941,1501090.0\n2440,09/17/2007,00:00,1482900,1486500,1476300,1481300,106507975,1489110.0\n2441,09/18/2007,00:00,1488300,1525000,1483700,1523900,236377628,1518260.0\n2442,09/19/2007,00:00,1534100,1543700,1527100,1533600,176040395,1540920.0\n2443,09/20/2007,00:00,1533500,1534300,1521100,1523400,147812692,1546450.0\n2444,09/21/2007,00:00,1527000,1528800,1522500,1522700,123062709,1541670.0\n2445,09/24/2007,00:00,1524300,1528100,1513600,1515500,130049917,1515510.0\n2446,09/25/2007,00:00,1508100,1516500,1504700,1516400,126499030,1509630.0\n2447,09/26/2007,00:00,1522700,1527700,1516400,1523700,115705154,1518630.0\n2448,09/27/2007,00:00,1528900,1530800,1523600,1529400,90743331,1528020.0\n2449,09/28/2007,00:00,1528500,1531900,1519800,1524700,114975085,1531360.0\n2450,10/01/2007,00:00,1526100,1547400,1526000,1545200,130896880,1545460.0\n2451,10/02/2007,00:00,1546200,1546500,1538100,1544300,106161969,1550560.0\n2452,10/03/2007,00:00,1538100,1544100,1534500,1538000,107188444,1547360.0\n2453,10/04/2007,00:00,1541000,1542600,1535900,1541600,72348145,1546740.0\n2454,10/05/2007,00:00,1550200,1561000,1546400,1556000,107716077,1550690.0\n2455,10/08/2007,00:00,1553900,1554900,1547700,1551900,64689303,1556320.0\n2456,10/09/2007,00:00,1556000,1564000,1550300,1564000,85168711,1568990.0\n2457,10/10/2007,00:00,1560400,1564400,1554100,1560300,92827348,1568380.0\n2458,10/11/2007,00:00,1569200,1575200,1545400,1553500,217693623,1558160.0\n2459,10/12/2007,00:00,1554700,1562300,1552700,1560600,108160497,1560130.0\n2460,10/15/2007,00:00,1562700,1563600,1539400,1548300,147452330,1548010.0\n2461,10/16/2007,00:00,1544100,1545100,1534800,1537700,149944098,1536960.0\n2462,10/17/2007,00:00,1550000,1550900,1524700,1540300,191822064,1533290.0\n2463,10/18/2007,00:00,1534400,1541900,1530800,1538200,124527600,1529180.0\n2464,10/19/2007,00:00,1531000,1531500,1499100,1499700,268517135,1503830.0\n2465,10/22/2007,00:00,1488300,1507600,1486600,1506000,242729590,1493180.0\n2466,10/23/2007,00:00,1513000,1519500,1502600,1519400,161146462,1498520.0\n2467,10/24/2007,00:00,1512100,1517100,1488400,1515600,301697347,1508130.0\n2468,10/25/2007,00:00,1516800,1522900,1498900,1513200,212700182,1521760.0\n2469,10/26/2007,00:00,1530600,1535000,1519000,1534500,147407625,1532980.0\n2470,10/29/2007,00:00,1539200,1544400,1535600,1540000,100917701,1542570.0\n2471,10/30/2007,00:00,1534300,1537500,1528700,1530600,120728222,1543820.0\n2472,10/31/2007,00:00,1539800,1552600,1528500,1547900,200718185,1552890.0\n2473,11/01/2007,00:00,1533300,1534000,1505900,1507800,297180006,1518510.0\n2474,11/02/2007,00:00,1515400,1515500,1492200,1511100,297848587,1503300.0\n2475,11/05/2007,00:00,1496300,1511400,1489700,1501900,209639996,1491600.0\n2476,11/06/2007,00:00,1508400,1520900,1499000,1520900,163741165,1499950.0\n2477,11/07/2007,00:00,1504300,1511300,1475600,1475900,270774443,1487320.0\n2478,11/08/2007,00:00,1479800,1484000,1450700,1475300,361286275,1467740.0\n2479,11/09/2007,00:00,1455100,1475400,1449000,1452600,259572995,1442060.0\n2480,11/12/2007,00:00,1452000,1466100,1439300,1439900,225811847,1417330.0\n2481,11/13/2007,00:00,1452600,1483000,1452200,1481900,173178279,1458100.0\n2482,11/14/2007,00:00,1492200,1493900,1468100,1471000,185943284,1470350.0\n2483,11/15/2007,00:00,1467900,1474900,1445200,1453600,241477765,1469730.0\n2484,11/16/2007,00:00,1462800,1464600,1445800,1460400,277070414,1465170.0\n2485,11/19/2007,00:00,1452800,1453600,1432000,1435600,249074173,1429540.0\n2486,11/20/2007,00:00,1436400,1455200,1421200,1442000,391931736,1429720.0\n2487,11/21/2007,00:00,1430800,1439100,1417400,1418100,232088105,1415120.0\n2488,11/23/2007,00:00,1430100,1443400,1427100,1441800,70919047,1423170.0\n2489,11/26/2007,00:00,1443800,1448700,1407800,1408200,196405849,1412640.0\n2490,11/27/2007,00:00,1417400,1432300,1409500,1430900,255983068,1418570.0\n2491,11/28/2007,00:00,1442100,1474700,1441400,1472600,222463103,1463750.0\n2492,11/29/2007,00:00,1466100,1477200,1461100,1472700,179804977,1483100.0\n2493,11/30/2007,00:00,1490400,1492500,1473400,1484600,198187551,1512180.0\n2494,12/03/2007,00:00,1482100,1484400,1473000,1475600,130665807,1497700.0\n2495,12/04/2007,00:00,1466600,1473400,1463100,1465500,126981771,1470810.0\n2496,12/05/2007,00:00,1479200,1490000,1478300,1488600,149205049,1481210.0\n2497,12/06/2007,00:00,1486300,1512100,1485700,1511100,135055501,1504880.0\n2498,12/07/2007,00:00,1514200,1515000,1506200,1507500,112768081,1522480.0\n2499,12/10/2007,00:00,1512500,1522400,1508600,1520300,100000048,1537150.0\n2500,12/11/2007,00:00,1521200,1528800,1479600,1482400,227167081,1501020.0\n2501,12/12/2007,00:00,1515200,1517200,1472000,1491300,259965196,1483110.0\n2502,12/13/2007,00:00,1483200,1493700,1473000,1493000,216356168,1481500.0\n2503,12/14/2007,00:00,1480500,1491000,1471700,1471800,133917954,1465840.0\n2504,12/17/2007,00:00,1466200,1468700,1449400,1450700,150430849,1452970.0\n2505,12/18/2007,00:00,1460900,1464700,1439600,1458200,232214158,1440450.0\n2506,12/19/2007,00:00,1459300,1468900,1449400,1456300,183399740,1439900.0\n2507,12/20/2007,00:00,1468400,1468500,1451800,1465400,178843379,1458320.0\n2508,12/21/2007,00:00,1473600,1482700,1470900,1482000,118912375,1483460.0\n2509,12/24/2007,00:00,1487300,1494800,1485400,1492000,43846385,1498770.0\n2510,12/26/2007,00:00,1488400,1496200,1485000,1494800,58150837,1509180.0\n2511,12/27/2007,00:00,1490100,1490300,1473200,1475200,104895088,1491600.0\n2512,12/28/2007,00:00,1485400,1486100,1469000,1475400,102741375,1474880.0\n2513,12/31/2007,00:00,1471000,1473300,1462600,1464200,80764439,1457820.0\n2514,01/02/2008,00:00,1465300,1469900,1438800,1445600,176004906,1438220.0\n2515,01/03/2008,00:00,1449200,1454900,1441300,1444600,111123658,1433700.0\n2516,01/04/2008,00:00,1433400,1434400,1409200,1409300,195816564,1402280.0\n2517,01/07/2008,00:00,1418100,1422300,1401100,1414600,220246505,1395010.0\n2518,01/08/2008,00:00,1420800,1429000,1386300,1388100,302929270,1376940.0\n2519,01/09/2008,00:00,1390200,1407900,1377000,1407800,283830252,1384440.0\n2520,01/10/2008,00:00,1397000,1428000,1393700,1418000,299678952,1410740.0\n2521,01/11/2008,00:00,1407600,1415700,1392900,1400300,246581793,1406150.0\n2522,01/14/2008,00:00,1411600,1417000,1404100,1414600,188219100,1419410.0\n2523,01/15/2008,00:00,1397400,1401000,1379100,1379500,212525079,1386040.0\n2524,01/16/2008,00:00,1373800,1391200,1362800,1371400,334802665,1362560.0\n2525,01/17/2008,00:00,1375800,1377000,1329300,1332300,356115323,1325860.0\n2526,01/18/2008,00:00,1341800,1350100,1311100,1324900,323776666,1296560.0\n2527,01/22/2008,00:00,1264500,1322500,1260000,1310200,372500628,1288130.0\n2528,01/23/2008,00:00,1271200,1338800,1268400,1336200,446511338,1307250.0\n2529,01/24/2008,00:00,1342800,1354500,1333200,1349900,237630863,1344650.0\n2530,01/25/2008,00:00,1365000,1367600,1326000,1329800,251958732,1345050.0\n2531,01/28/2008,00:00,1332900,1353300,1320600,1353200,193975813,1359740.0\n2532,01/29/2008,00:00,1361000,1364500,1348900,1360700,148947831,1361650.0\n2533,01/30/2008,00:00,1355800,1385400,1351500,1353700,305837123,1361010.0\n2534,01/31/2008,00:00,1334000,1385400,1332000,1374400,277681778,1381270.0\n2535,02/01/2008,00:00,1379200,1396100,1375200,1394500,174630458,1396190.0\n2536,02/04/2008,00:00,1391900,1393000,1378900,1380200,111342814,1396640.0\n2537,02/05/2008,00:00,1358700,1362500,1336800,1337200,238458618,1359840.0\n2538,02/06/2008,00:00,1345700,1352500,1324100,1327200,229340555,1317190.0\n2539,02/07/2008,00:00,1320800,1347800,1317300,1337800,267321299,1305460.0\n2540,02/08/2008,00:00,1332400,1342100,1321100,1331200,184790542,1313500.0\n2541,02/11/2008,00:00,1331000,1342200,1320400,1339100,169951567,1336840.0\n2542,02/12/2008,00:00,1349100,1363000,1339800,1349200,225752737,1350490.0\n2543,02/13/2008,00:00,1360200,1370600,1351600,1367100,162148026,1367860.0\n2544,02/14/2008,00:00,1369400,1370000,1347900,1350100,208822459,1367080.0\n2545,02/15/2008,00:00,1345500,1351500,1339100,1350700,132777717,1358470.0\n2546,02/19/2008,00:00,1366700,1368800,1346100,1350300,130677687,1349220.0\n2547,02/20/2008,00:00,1340000,1365500,1337700,1361100,205707963,1352320.0\n2548,02/21/2008,00:00,1366600,1370000,1340700,1344800,184158985,1351340.0\n2549,02/22/2008,00:00,1349800,1356500,1328700,1356400,189835912,1354430.0\n2550,02/25/2008,00:00,1355500,1376500,1347800,1373100,179679646,1369410.0\n2551,02/26/2008,00:00,1367500,1389500,1365000,1383500,180031190,1385710.0\n2552,02/27/2008,00:00,1375800,1391400,1374200,1381200,154524167,1397770.0\n2553,02/28/2008,00:00,1372500,1379600,1365600,1370000,146116746,1383430.0\n2554,02/29/2008,00:00,1356000,1356800,1327800,1332500,215606264,1339650.0\n2555,03/03/2008,00:00,1331600,1338100,1322400,1333900,175197297,1315850.0\n2556,03/04/2008,00:00,1322600,1334000,1309900,1329200,268720531,1307330.0\n2557,03/05/2008,00:00,1334300,1347600,1323400,1337000,251947217,1319730.0\n2558,03/06/2008,00:00,1329800,1332100,1306600,1308200,219263185,1314510.0\n2559,03/07/2008,00:00,1297200,1317400,1285800,1297100,283407216,1292700.0\n2560,03/10/2008,00:00,1297900,1299200,1275900,1278600,225098491,1267690.0\n2561,03/11/2008,00:00,1307100,1324500,1289600,1323900,288807446,1292220.0\n2562,03/12/2008,00:00,1327500,1337700,1311600,1313100,210821412,1315160.0\n2563,03/13/2008,00:00,1296100,1326100,1286000,1319200,320576788,1329990.0\n2564,03/14/2008,00:00,1327700,1328100,1277800,1292600,421607705,1312470.0\n2565,03/17/2008,00:00,1263500,1292500,1260800,1279000,353331235,1272470.0\n2566,03/18/2008,00:00,1306000,1333800,1299800,1333200,296899685,1307420.0\n2567,03/19/2008,00:00,1341500,1346500,1302400,1303600,315189081,1308340.0\n2568,03/20/2008,00:00,1300300,1329000,1292600,1327300,210173152,1335340.0\n2569,03/24/2008,00:00,1333100,1358100,1332400,1347700,195960254,1357610.0\n2570,03/25/2008,00:00,1348300,1355400,1337700,1350500,172378901,1356070.0\n2571,03/26/2008,00:00,1344600,1345800,1334600,1338300,176224612,1361260.0\n2572,03/27/2008,00:00,1342000,1344400,1323700,1324500,206430063,1333160.0\n2573,03/28/2008,00:00,1329900,1333500,1310800,1314000,160978488,1306980.0\n2574,03/31/2008,00:00,1312800,1327300,1310900,1319400,136632600,1303390.0\n2575,04/01/2008,00:00,1336000,1368400,1335200,1368000,223939346,1349130.0\n2576,04/02/2008,00:00,1370600,1376600,1359900,1366600,195202819,1379960.0\n2577,04/03/2008,00:00,1359400,1374300,1357100,1368000,154905062,1393760.0\n2578,04/04/2008,00:00,1369500,1379600,1361200,1369700,163249486,1388520.0\n2579,04/07/2008,00:00,1378700,1385700,1367500,1370500,140339108,1370990.0\n2580,04/08/2008,00:00,1361800,1369200,1359500,1364700,136136866,1367510.0\n2581,04/09/2008,00:00,1366200,1368000,1349000,1353900,175481616,1355400.0\n2582,04/10/2008,00:00,1354000,1366700,1349000,1359400,169304838,1352480.0\n2583,04/11/2008,00:00,1344600,1350300,1330100,1332900,197516165,1332130.0\n2584,04/14/2008,00:00,1331900,1335400,1325500,1328100,144406756,1319540.0\n2585,04/15/2008,00:00,1335700,1336900,1323300,1335200,151883965,1321290.0\n2586,04/16/2008,00:00,1345300,1365000,1345100,1362300,163122890,1346010.0\n2587,04/17/2008,00:00,1360100,1368200,1356700,1364800,162693949,1374060.0\n2588,04/18/2008,00:00,1389500,1395600,1382600,1389600,183614351,1401780.0\n2589,04/21/2008,00:00,1382200,1389800,1378500,1387800,103874439,1407690.0\n2590,04/22/2008,00:00,1381900,1383000,1369000,1376900,147890564,1391940.0\n2591,04/23/2008,00:00,1380800,1387800,1371200,1379800,174523494,1384970.0\n2592,04/24/2008,00:00,1380900,1397400,1370400,1387900,205416157,1380980.0\n2593,04/25/2008,00:00,1394000,1398900,1379100,1397600,178746207,1395180.0\n2594,04/28/2008,00:00,1398900,1402400,1393900,1396200,96149678,1404600.0\n2595,04/29/2008,00:00,1394000,1397300,1386200,1390700,127557013,1399470.0\n2596,04/30/2008,00:00,1393000,1405800,1383600,1384300,187426431,1387110.0\n2597,05/01/2008,00:00,1383900,1410200,1382700,1409300,174277769,1399070.0\n2598,05/02/2008,00:00,1423300,1423500,1405700,1413400,155583107,1414680.0\n2599,05/05/2008,00:00,1410500,1415500,1404100,1407100,112416820,1419530.0\n2600,05/06/2008,00:00,1400200,1421900,1396900,1418400,160469827,1426300.0\n2601,05/07/2008,00:00,1418900,1420400,1391400,1392800,176599218,1399800.0\n2602,05/08/2008,00:00,1397500,1403200,1389800,1398400,163850260,1392730.0\n2603,05/09/2008,00:00,1386000,1393900,1384500,1389300,136146489,1384520.0\n2604,05/12/2008,00:00,1392400,1405300,1387300,1404700,136486176,1391450.0\n2605,05/13/2008,00:00,1408200,1408800,1397400,1404000,140874412,1406450.0\n2606,05/14/2008,00:00,1411000,1422000,1408800,1409600,160657015,1412330.0\n2607,05/15/2008,00:00,1410400,1426300,1408300,1425500,153317955,1429810.0\n2608,05/16/2008,00:00,1428600,1428700,1416100,1426500,190670888,1433590.0\n2609,05/19/2008,00:00,1428000,1442200,1423300,1428300,156766647,1438430.0\n2610,05/20/2008,00:00,1422700,1423400,1410700,1416300,155971911,1426100.0\n2611,05/21/2008,00:00,1418100,1421200,1390400,1393100,230883524,1395440.0\n2612,05/22/2008,00:00,1394300,1401600,1392400,1395700,158574294,1382940.0\n2613,05/23/2008,00:00,1390400,1392000,1375700,1378600,166003660,1366400.0\n2614,05/27/2008,00:00,1378000,1390000,1375300,1387400,147828033,1372530.0\n2615,05/28/2008,00:00,1391800,1393700,1380500,1393700,162036690,1387570.0\n2616,05/29/2008,00:00,1391300,1409200,1390800,1400300,163649708,1398430.0\n2617,05/30/2008,00:00,1404700,1407400,1400600,1401000,102697673,1409510.0\n2618,06/02/2008,00:00,1398200,1398400,1380300,1388300,170549805,1396870.0\n2619,06/03/2008,00:00,1393300,1396200,1372300,1380100,254854683,1380920.0\n2620,06/04/2008,00:00,1377900,1391600,1374600,1380400,228312738,1371810.0\n2621,06/05/2008,00:00,1385700,1408200,1383200,1406400,218172776,1392110.0\n2622,06/06/2008,00:00,1395800,1398000,1363500,1363800,346563277,1376990.0\n2623,06/09/2008,00:00,1368600,1375000,1354200,1366200,216423204,1366060.0\n2624,06/10/2008,00:00,1356600,1371000,1355200,1361400,240148088,1352180.0\n2625,06/11/2008,00:00,1359700,1360800,1339400,1339500,262997245,1326600.0\n2626,06/12/2008,00:00,1346000,1357700,1335200,1344500,222258163,1335490.0\n2627,06/13/2008,00:00,1351800,1364200,1346100,1364000,216176831,1348730.0\n2628,06/16/2008,00:00,1355200,1369300,1354600,1363900,169113153,1363510.0\n2629,06/17/2008,00:00,1370600,1371100,1354500,1355000,171527978,1368500.0\n2630,06/18/2008,00:00,1347000,1350800,1337200,1343200,254184303,1350640.0\n2631,06/19/2008,00:00,1341500,1352400,1335200,1347100,293564153,1338290.0\n2632,06/20/2008,00:00,1328400,1330900,1312300,1315900,258290018,1313850.0\n2633,06/23/2008,00:00,1320400,1322200,1313200,1316300,145594140,1304090.0\n2634,06/24/2008,00:00,1310500,1324400,1302000,1312400,251628479,1299260.0\n2635,06/25/2008,00:00,1317300,1334000,1316200,1320000,259333519,1305030.0\n2636,06/26/2008,00:00,1305900,1307500,1281700,1282100,277734014,1290170.0\n2637,06/27/2008,00:00,1282900,1288600,1270400,1278000,270916380,1269690.0\n2638,06/30/2008,00:00,1278900,1289100,1273000,1278400,239562749,1261180.0\n2639,07/01/2008,00:00,1265200,1284500,1259400,1283700,345449083,1265550.0\n2640,07/02/2008,00:00,1287900,1291500,1260400,1260700,272417773,1265450.0\n2641,07/03/2008,00:00,1270900,1271200,1250500,1263800,210776761,1259090.0\n2642,07/07/2008,00:00,1267800,1273400,1239200,1250900,351738836,1245030.0\n2643,07/08/2008,00:00,1250000,1273900,1242100,1272800,340874944,1256900.0\n2644,07/09/2008,00:00,1274900,1277400,1243900,1244300,316371135,1251360.0\n2645,07/10/2008,00:00,1244400,1257900,1236000,1253800,396109468,1249140.0\n2646,07/11/2008,00:00,1239200,1257400,1224900,1240200,449501561,1240280.0\n2647,07/14/2008,00:00,1252800,1255000,1224100,1228200,298497953,1219870.0\n2648,07/15/2008,00:00,1218100,1234600,1200300,1214300,470793694,1210480.0\n2649,07/16/2008,00:00,1215600,1245700,1211100,1244700,329318028,1223010.0\n2650,07/17/2008,00:00,1251500,1262600,1241100,1259000,334500668,1253510.0\n2651,07/18/2008,00:00,1261700,1262800,1251500,1259200,225313674,1273090.0\n2652,07/21/2008,00:00,1265100,1267900,1255500,1259900,187264301,1279130.0\n2653,07/22/2008,00:00,1251700,1278000,1248900,1276900,274133491,1279530.0\n2654,07/23/2008,00:00,1279000,1291400,1275800,1282200,288521277,1286670.0\n2655,07/24/2008,00:00,1283700,1284100,1251600,1254300,235554635,1270250.0\n2656,07/25/2008,00:00,1259000,1263300,1251800,1257200,196081254,1257700.0\n2657,07/28/2008,00:00,1254900,1260600,1234300,1235600,184425740,1228960.0\n2658,07/29/2008,00:00,1239900,1263000,1238500,1262700,242317674,1241090.0\n2659,07/30/2008,00:00,1270200,1284700,1265100,1284500,334141761,1278630.0\n2660,07/31/2008,00:00,1274400,1285700,1266300,1268500,250939559,1283150.0\n2661,08/01/2008,00:00,1271300,1272800,1254600,1261100,224290180,1279520.0\n2662,08/04/2008,00:00,1260400,1261400,1247600,1249200,178404175,1250080.0\n2663,08/05/2008,00:00,1260200,1284700,1259000,1284200,237970461,1263530.0\n2664,08/06/2008,00:00,1280500,1293000,1276800,1290900,198361062,1291150.0\n2665,08/07/2008,00:00,1279500,1284400,1265400,1268600,225325052,1287810.0\n2666,08/08/2008,00:00,1266000,1299300,1263900,1296200,238479064,1301340.0\n2667,08/11/2008,00:00,1294500,1315000,1292300,1306500,232867329,1304250.0\n2668,08/12/2008,00:00,1302900,1303500,1287300,1292400,201072811,1303190.0\n2669,08/13/2008,00:00,1287800,1296500,1276700,1288200,245406882,1301000.0\n2670,08/14/2008,00:00,1278300,1302800,1277500,1295200,217081849,1289610.0\n2671,08/15/2008,00:00,1299200,1305000,1293000,1300500,166418947,1293800.0\n2672,08/18/2008,00:00,1304400,1304700,1276600,1282400,164317208,1289430.0\n2673,08/19/2008,00:00,1274200,1276900,1265400,1270000,169787570,1272500.0\n2674,08/20/2008,00:00,1273800,1279400,1263400,1277100,210797133,1265030.0\n2675,08/21/2008,00:00,1267500,1284400,1266100,1279800,170542446,1267950.0\n2676,08/22/2008,00:00,1286900,1296400,1285600,1295100,148657687,1291440.0\n2677,08/25/2008,00:00,1287900,1288300,1267600,1270800,160122280,1284440.0\n2678,08/26/2008,00:00,1270400,1278700,1265900,1274400,151392796,1275120.0\n2679,08/27/2008,00:00,1275500,1288300,1273000,1284600,151261792,1277610.0\n2680,08/28/2008,00:00,1291900,1303400,1291300,1303100,145659356,1294540.0\n2681,08/29/2008,00:00,1296800,1301300,1286100,1286900,164300951,1302230.0\n2682,09/02/2008,00:00,1300600,1307000,1275200,1281000,228921650,1290650.0\n2683,09/03/2008,00:00,1278900,1285000,1269300,1279600,242827927,1277410.0\n2684,09/04/2008,00:00,1269700,1272200,1240000,1240700,325766260,1238630.0\n2685,09/05/2008,00:00,1233000,1249500,1221100,1246400,255219981,1230530.0\n2686,09/08/2008,00:00,1280500,1282400,1251000,1272500,337437833,1248980.0\n2687,09/09/2008,00:00,1271000,1273600,1229200,1229400,342304701,1233140.0\n2688,09/10/2008,00:00,1238900,1248900,1226000,1236000,269667230,1237080.0\n2689,09/11/2008,00:00,1221200,1255300,1216000,1255100,330109363,1242150.0\n2690,09/12/2008,00:00,1242900,1259800,1238300,1257400,263335532,1248730.0\n2691,09/15/2008,00:00,1217900,1242600,1201400,1203600,423505847,1227240.0\n2692,09/16/2008,00:00,1172500,1220900,1171600,1218500,498530783,1208170.0\n2693,09/17/2008,00:00,1197000,1203700,1160300,1163500,539644642,1152990.0\n2694,09/18/2008,00:00,1179500,1217900,1138200,1205500,687599556,1166530.0\n2695,09/19/2008,00:00,1276000,1279900,1233300,1250500,423412122,1232560.0\n2696,09/22/2008,00:00,1244400,1247500,1203600,1207000,220080067,1228200.0\n2697,09/23/2008,00:00,1208600,1220200,1185000,1187000,296527384,1217250.0\n2698,09/24/2008,00:00,1191600,1196800,1178000,1188100,275213511,1178130.0\n2699,09/25/2008,00:00,1195700,1218900,1190700,1210000,279066804,1178550.0\n2700,09/26/2008,00:00,1191400,1215000,1185100,1213300,259352240,1211760.0\n2701,09/29/2008,00:00,1191400,1193400,1109700,1130200,422132892,1159200.0\n2702,09/30/2008,00:00,1135100,1167400,1127100,1165400,288617995,1143840.0\n2703,10/01/2008,00:00,1152100,1166900,1139500,1160000,307831997,1131410.0\n2704,10/02/2008,00:00,1149500,1151100,1110600,1113600,314691321,1105620.0\n2705,10/03/2008,00:00,1128400,1154400,1096900,1099700,421344201,1099940.0\n2706,10/06/2008,00:00,1071200,1076200,1006500,1062800,560836430,1040650.0\n2707,10/07/2008,00:00,1068400,1073200,996500,997400,483905229,973900.0\n2708,10/08/2008,00:00,975000,1021800,968100,983900,628550992,942970.0\n2709,10/09/2008,00:00,996400,1006200,909000,917200,489731456,879030.0\n2710,10/10/2008,00:00,870700,939300,835800,904500,791887655,854120.0\n2711,10/13/2008,00:00,939500,1009200,931700,1006800,398191241,943780.0\n2712,10/14/2008,00:00,1046600,1055300,971100,999100,492175724,998300.0\n2713,10/15/2008,00:00,974600,977700,905000,907500,441809518,969580.0\n2714,10/16/2008,00:00,912100,947700,865400,944100,663194641,946370.0\n2715,10/17/2008,00:00,920400,985800,916600,940900,442697520,903640.0\n2716,10/20/2008,00:00,954300,985500,943700,984900,278574190,956800.0\n2717,10/21/2008,00:00,970300,986400,952300,955000,302530501,987220.0\n2718,10/22/2008,00:00,932000,935000,875300,903900,457390740,925870.0\n2719,10/23/2008,00:00,903900,924400,858100,910400,593520712,896420.0\n2720,10/24/2008,00:00,840100,898600,838100,875400,507077944,846840.0\n2721,10/27/2008,00:00,859800,895100,846800,848200,361805538,825950.0\n2722,10/28/2008,00:00,873900,941300,845400,937700,586539158,896740.0\n2723,10/29/2008,00:00,936100,971700,921000,923600,491961890,925670.0\n2724,10/30/2008,00:00,958200,965100,929100,954400,384751908,977880.0\n2725,10/31/2008,00:00,950300,985700,944800,971300,382066156,1005910.0\n2726,11/03/2008,00:00,968400,976900,959500,967400,192755777,983010.0\n2727,11/04/2008,00:00,990300,1008600,982000,1002800,323448071,1015320.0\n2728,11/05/2008,00:00,992100,1002000,950900,957000,358790224,981590.0\n2729,11/06/2008,00:00,945000,954400,901100,908100,448081103,920280.0\n2730,11/07/2008,00:00,916500,934100,908600,931300,333639323,903250.0\n2731,11/10/2008,00:00,952100,955300,909200,921700,270329844,887810.0\n2732,11/11/2008,00:00,907100,920300,886500,901600,394940198,894780.0\n2733,11/12/2008,00:00,882300,889500,851200,857300,419693221,864610.0\n2734,11/13/2008,00:00,860900,916500,821000,910500,697477299,872680.0\n2735,11/14/2008,00:00,893800,920600,872300,876800,493637570,869310.0\n2736,11/17/2008,00:00,864100,885500,851600,853000,388638068,856530.0\n2737,11/18/2008,00:00,851300,870000,829100,861700,493249855,857250.0\n2738,11/19/2008,00:00,858900,868600,809300,813400,519670115,800290.0\n2739,11/20/2008,00:00,800700,825100,750800,759500,770818769,750620.0\n2740,11/21/2008,00:00,774400,805300,743400,802700,660786257,757220.0\n2741,11/24/2008,00:00,819200,869800,811700,848900,471391231,806350.0\n2742,11/25/2008,00:00,872300,875000,838300,860600,417610243,872160.0\n2743,11/26/2008,00:00,843400,891500,842400,890200,323021713,928170.0\n2744,11/28/2008,00:00,886600,900400,884800,898200,108195975,929810.0\n2745,12/01/2008,00:00,874600,875400,819700,821300,337001207,858560.0\n2746,12/02/2008,00:00,834400,854900,822400,852700,446305503,839190.0\n2747,12/03/2008,00:00,834400,878200,831400,874100,476978867,843990.0\n2748,12/04/2008,00:00,860400,880500,837400,850000,411156280,846180.0\n2749,12/05/2008,00:00,835800,884200,822500,879700,431229520,889790.0\n2750,12/08/2008,00:00,904000,923800,898000,910600,384623763,909840.0\n2751,12/09/2008,00:00,903600,921300,889800,895500,339702496,913000.0\n2752,12/10/2008,00:00,903400,913600,890000,902500,345648209,923900.0\n2753,12/11/2008,00:00,895100,910000,873700,880300,324318387,891650.0\n2754,12/12/2008,00:00,855600,889000,852100,884700,352878065,874620.0\n2755,12/15/2008,00:00,890100,891400,862900,874800,232084190,869800.0\n2756,12/16/2008,00:00,883500,920200,881800,918700,337674741,900270.0\n2757,12/17/2008,00:00,908500,924300,900700,910200,248346838,921880.0\n2758,12/18/2008,00:00,913600,916700,882100,892000,327981859,911080.0\n2759,12/19/2008,00:00,891000,903800,880900,882800,263071879,892490.0\n2760,12/22/2008,00:00,886500,886700,854900,865700,214633316,853860.0\n2761,12/23/2008,00:00,874900,879300,858000,861900,208760330,845650.0\n2762,12/24/2008,00:00,864700,868600,860000,865600,60804665,851490.0\n2763,12/26/2008,00:00,872800,873000,865000,871000,69614698,862290.0\n2764,12/29/2008,00:00,873300,873300,856100,868900,110883286,871270.0\n2765,12/30/2008,00:00,876700,890500,870900,888700,159248150,888290.0\n2766,12/31/2008,00:00,890700,909700,888700,903300,173715289,907430.0\n2767,01/02/2009,00:00,905000,934400,898600,930300,214236568,938340.0\n2768,01/05/2009,00:00,926000,936600,918900,928400,206399365,952100.0\n2769,01/06/2009,00:00,936900,944500,926800,934400,293506649,951970.0\n2770,01/07/2009,00:00,920000,922600,902000,906200,249972498,923490.0\n2771,01/08/2009,00:00,901600,910900,896700,910100,245799625,903100.0\n2772,01/09/2009,00:00,912700,913100,888100,890100,301818019,883570.0\n2773,01/12/2009,00:00,888600,889100,864100,869400,227448562,858210.0\n2774,01/13/2009,00:00,866800,877700,862100,870500,330756708,855630.0\n2775,01/14/2009,00:00,856100,857500,836900,842100,386919869,829760.0\n2776,01/15/2009,00:00,841500,852500,817200,844400,468049820,827690.0\n2777,01/16/2009,00:00,859000,859600,830500,850200,368389974,835970.0\n2778,01/20/2009,00:00,842900,844600,804700,805400,364223238,805890.0\n2779,01/21/2009,00:00,819900,842400,804700,840200,336621069,823620.0\n2780,01/22/2009,00:00,824300,840400,811700,828400,397576509,821120.0\n2781,01/23/2009,00:00,808800,839900,805800,831100,362037373,826500.0\n2782,01/26/2009,00:00,835700,853600,828100,837300,298668074,844890.0\n2783,01/27/2009,00:00,840800,851400,833000,845900,258161815,842670.0\n2784,01/28/2009,00:00,864200,879500,860700,873800,308654914,874980.0\n2785,01/29/2009,00:00,861300,863500,844700,845700,272661772,866470.0\n2786,01/30/2009,00:00,850000,852500,822100,826900,334101048,839620.0\n2787,02/02/2009,00:00,815100,831800,813100,825200,262320515,817010.0\n2788,02/03/2009,00:00,830900,843600,822200,837200,257121011,813650.0\n2789,02/04/2009,00:00,843200,853700,830400,833300,297968491,829310.0\n2790,02/05/2009,00:00,827400,852900,821300,845700,364376526,847370.0\n2791,02/06/2009,00:00,848600,873400,846900,870000,315637676,871710.0\n2792,02/09/2009,00:00,869800,877400,863200,871300,218051063,882970.0\n2793,02/10/2009,00:00,862600,870300,824500,829200,481916722,855120.0\n2794,02/11/2009,00:00,834500,840500,824100,836300,300434035,832620.0\n2795,02/12/2009,00:00,821500,838200,810000,836100,427359756,817740.0\n2796,02/13/2009,00:00,835100,842300,827400,827400,271057308,815790.0\n2797,02/17/2009,00:00,801700,806200,791700,791900,417596871,799130.0\n2798,02/18/2009,00:00,798100,799400,782800,789700,335062611,775060.0\n2799,02/19/2009,00:00,797700,801500,780200,782800,283119967,762290.0\n2800,02/20/2009,00:00,767000,783300,757700,773800,444706361,758230.0\n2801,02/23/2009,00:00,782600,782600,745900,746500,348341421,744930.0\n2802,02/24/2009,00:00,752700,779500,748400,774700,396714741,753610.0\n2803,02/25/2009,00:00,771900,784200,756300,768300,441636709,760790.0\n2804,02/26/2009,00:00,778300,783800,755400,755400,332689554,759240.0\n2805,02/27/2009,00:00,740200,755800,738200,739300,406261222,746730.0\n2806,03/02/2009,00:00,725000,729200,703800,705800,385024335,698660.0\n2807,03/03/2009,00:00,715600,717000,696400,700700,419242719,678460.0\n2808,03/04/2009,00:00,713200,728700,704100,716700,420665680,688780.0\n2809,03/05/2009,00:00,700600,708600,681700,687900,438558253,682510.0\n2810,03/06/2009,00:00,694500,704500,671000,688400,434093626,685620.0\n2811,03/09/2009,00:00,679700,700000,677300,681100,329682326,674710.0\n2812,03/10/2009,00:00,695100,723600,693700,721600,371711244,700040.0\n2813,03/11/2009,00:00,730300,737400,718400,726100,332178093,733900.0\n2814,03/12/2009,00:00,725800,757500,719700,755300,358429127,768140.0\n2815,03/13/2009,00:00,759500,763800,747300,761500,310083362,787470.0\n2816,03/16/2009,00:00,769800,779600,758100,759600,320386601,778240.0\n2817,03/17/2009,00:00,760000,782900,754500,782400,311355607,792050.0\n2818,03/18/2009,00:00,777700,809000,770700,798900,441475581,803970.0\n2819,03/19/2009,00:00,809700,810000,786900,788400,407724426,806090.0\n2820,03/20/2009,00:00,787600,788600,765300,766500,391019636,785100.0\n2821,03/23/2009,00:00,791100,822700,784000,822200,365790289,805840.0\n2822,03/24/2009,00:00,812100,823600,805100,806000,313719679,810800.0\n2823,03/25/2009,00:00,812800,827000,790600,813200,414247151,825990.0\n2824,03/26/2009,00:00,823000,833000,814800,831100,386807953,843860.0\n2825,03/27/2009,00:00,820800,825300,813200,816100,296952930,821590.0\n2826,03/30/2009,00:00,797300,798800,779600,787600,305114129,800630.0\n2827,03/31/2009,00:00,795500,810700,790500,794400,327264261,784150.0\n2828,04/01/2009,00:00,785100,814200,783300,810000,338214148,788670.0\n2829,04/02/2009,00:00,831600,846100,827300,833900,416144835,825800.0\n2830,04/03/2009,00:00,835100,842800,826700,842700,257432702,858630.0\n2831,04/06/2009,00:00,833800,838100,822900,834800,246697212,857210.0\n2832,04/07/2009,00:00,822200,826500,815100,816100,237625682,831430.0\n2833,04/08/2009,00:00,820400,829400,815400,824900,216767229,817100.0\n2834,04/09/2009,00:00,847300,858200,843400,858200,239538116,841670.0\n2835,04/13/2009,00:00,849500,865400,845800,858300,192944102,865190.0\n2836,04/14/2009,00:00,850500,857600,840800,843800,235242383,866900.0\n2837,04/15/2009,00:00,838900,854200,836100,853100,229423934,860260.0\n2838,04/16/2009,00:00,859700,871500,847800,866200,267945977,859160.0\n2839,04/17/2009,00:00,868500,876500,861400,871400,222571320,873140.0\n2840,04/20/2009,00:00,855300,856600,833400,834100,247170330,853390.0\n2841,04/21/2009,00:00,827900,851300,827600,850800,267436289,844110.0\n2842,04/22/2009,00:00,843200,863400,840700,845700,310130610,835160.0\n2843,04/23/2009,00:00,847400,854200,836300,853700,288723780,844000.0\n2844,04/24/2009,00:00,860400,873100,856900,866800,262958864,870710.0\n2845,04/27/2009,00:00,857500,870100,855400,858400,262642484,865970.0\n2846,04/28/2009,00:00,849700,865900,847600,855600,228247982,863390.0\n2847,04/29/2009,00:00,865300,883600,863000,873600,279418010,870200.0\n2848,04/30/2009,00:00,885800,890200,869400,875500,274331659,875760.0\n2849,05/01/2009,00:00,874800,882000,867200,878400,200655255,886270.0\n2850,05/04/2009,00:00,885400,909300,883800,909200,255326586,912060.0\n2851,05/05/2009,00:00,906100,909200,898400,905600,225570150,917770.0\n2852,05/06/2009,00:00,917100,922000,906100,921100,266625770,933480.0\n2853,05/07/2009,00:00,930900,931500,902900,909000,280867573,926590.0\n2854,05/08/2009,00:00,920600,932200,914400,929900,270335585,928400.0\n2855,05/11/2009,00:00,916800,921000,910400,911400,228667168,921520.0\n2856,05/12/2009,00:00,916300,918200,898500,910100,270140180,910420.0\n2857,05/13/2009,00:00,897000,900000,885000,888000,246186091,891140.0\n2858,05/14/2009,00:00,887200,901100,885000,894500,231484683,878520.0\n2859,05/15/2009,00:00,893500,899900,881500,887300,219327984,879120.0\n2860,05/18/2009,00:00,895900,913100,893700,912400,193916284,899630.0\n2861,05/19/2009,00:00,912000,919700,908200,911200,185180240,917970.0\n2862,05/20/2009,00:00,919600,928000,904100,905100,264998947,915630.0\n2863,05/21/2009,00:00,894600,898000,882600,892400,237713218,902550.0\n2864,05/22/2009,00:00,894100,900000,886800,890400,156576575,883460.0\n2865,05/26/2009,00:00,883300,915600,883200,913000,219235499,899090.0\n2866,05/27/2009,00:00,914500,917500,895300,897100,224229578,900980.0\n2867,05/28/2009,00:00,904200,913400,891000,909300,267221840,912590.0\n2868,05/29/2009,00:00,914400,926800,906800,924100,211070697,925890.0\n2869,06/01/2009,00:00,936800,951700,934300,947800,249479392,947240.0\n2870,06/02/2009,00:00,944300,953600,941600,948800,215142967,967990.0\n2871,06/03/2009,00:00,940500,941300,927600,936400,213928309,956950.0\n2872,06/04/2009,00:00,940000,946700,933000,946000,193801501,950340.0\n2873,06/05/2009,00:00,955000,956600,938000,945300,246374405,942520.0\n2874,06/08/2009,00:00,938300,951000,930400,943000,208098876,943090.0\n2875,06/09/2009,00:00,946700,951400,940200,946200,196817698,948360.0\n2876,06/10/2009,00:00,954800,954900,932000,943400,273297871,943490.0\n2877,06/11/2009,00:00,946000,961100,945700,948500,235728412,947320.0\n2878,06/12/2009,00:00,943800,951300,940000,950900,171740144,951830.0\n2879,06/15/2009,00:00,940000,940200,924200,928800,202851363,935370.0\n2880,06/16/2009,00:00,931800,932900,915800,916400,198767295,915490.0\n2881,06/17/2009,00:00,916000,923300,908300,915200,203008787,901630.0\n2882,06/18/2009,00:00,916500,926700,912600,920800,187412736,904280.0\n2883,06/19/2009,00:00,925500,927000,915200,920400,177671400,916600.0\n2884,06/22/2009,00:00,911300,911800,892600,892700,218156368,900440.0\n2885,06/23/2009,00:00,894900,898700,888500,893600,178329012,887150.0\n2886,06/24/2009,00:00,901900,910800,896000,901500,191834872,886180.0\n2887,06/25/2009,00:00,896600,921700,895700,920000,243790166,908040.0\n2888,06/26/2009,00:00,917600,922400,912800,918900,145646076,928980.0\n2889,06/29/2009,00:00,921300,928200,916000,926800,145470021,937300.0\n2890,06/30/2009,00:00,927200,930600,912700,919200,197335184,929940.0\n2891,07/01/2009,00:00,923800,932300,922200,923400,150650842,923790.0\n2892,07/02/2009,00:00,911600,911600,897600,898500,163342826,904100.0\n2893,07/06/2009,00:00,889900,899300,886600,898000,156432184,889690.0\n2894,07/07/2009,00:00,897300,898200,880000,881100,177457069,873560.0\n2895,07/08/2009,00:00,885500,888000,870100,880000,226760296,864940.0\n2896,07/09/2009,00:00,885800,889000,879100,882000,149577524,872620.0\n2897,07/10/2009,00:00,877700,884900,873500,879500,159588401,873290.0\n2898,07/13/2009,00:00,882700,901700,875900,901300,195240615,896750.0\n2899,07/14/2009,00:00,903900,906900,897300,906300,163668573,911390.0\n2900,07/15/2009,00:00,918300,935100,916800,932500,187131063,938660.0\n2901,07/16/2009,00:00,930100,945100,928200,941200,187206613,958540.0\n2902,07/17/2009,00:00,940600,943200,935400,941700,124450720,959310.0\n2903,07/20/2009,00:00,947300,952800,941900,950700,140762992,963880.0\n2904,07/21/2009,00:00,958900,959000,944200,955700,192789308,961130.0\n2905,07/22/2009,00:00,949600,961300,948900,955500,174355740,961740.0\n2906,07/23/2009,00:00,956000,980800,955300,977000,221948744,978740.0\n2907,07/24/2009,00:00,971200,981400,966900,981000,139178807,988550.0\n2908,07/27/2009,00:00,979600,984000,973400,983500,140972764,994870.0\n2909,07/28/2009,00:00,976800,983700,970600,981100,172827421,992930.0\n2910,07/29/2009,00:00,973800,979300,969800,976800,171353315,979790.0\n2911,07/30/2009,00:00,988300,998300,986000,987000,189613045,983470.0\n2912,07/31/2009,00:00,986700,994700,983800,988100,177642880,987830.0\n2913,08/03/2009,00:00,998800,1005300,993100,1004500,153669856,1004930.0\n2914,08/04/2009,00:00,1000300,1008400,997800,1006800,153552986,1015890.0\n2915,08/05/2009,00:00,1007800,1008500,995800,1003700,171448359,1013650.0\n2916,08/06/2009,00:00,1008200,1010200,994200,998900,175088254,1006640.0\n2917,08/07/2009,00:00,1009600,1020200,1004000,1012000,191014861,1007310.0\n2918,08/10/2009,00:00,1007400,1012200,1002700,1009800,120318516,1010530.0\n2919,08/11/2009,00:00,1005200,1006100,994600,996600,137773398,1003210.0\n2920,08/12/2009,00:00,995400,1015600,995300,1007700,201540302,1005660.0\n2921,08/13/2009,00:00,1013100,1016100,1002600,1015700,153246804,1009950.0\n2922,08/14/2009,00:00,1016000,1016000,997000,1007300,174916433,1011650.0\n2923,08/17/2009,00:00,988500,989400,981200,982700,193699832,993540.0\n2924,08/18/2009,00:00,985300,994400,983600,991600,157136658,981440.0\n2925,08/19/2009,00:00,983600,1003000,982500,1000100,171794756,985410.0\n2926,08/20/2009,00:00,1000200,1012200,998700,1010100,154136164,1005260.0\n2927,08/21/2009,00:00,1018200,1031300,1016200,1029700,189020639,1036590.0\n2928,08/24/2009,00:00,1034100,1039500,1025900,1029600,170094558,1043900.0\n2929,08/25/2009,00:00,1033400,1042100,1029400,1031400,190103102,1044810.0\n2930,08/26/2009,00:00,1028200,1036400,1024900,1031700,162232342,1039970.0\n2931,08/27/2009,00:00,1030700,1037100,1019400,1034300,173710311,1034730.0\n2932,08/28/2009,00:00,1042200,1043500,1026700,1033300,129111422,1035150.0\n2933,08/31/2009,00:00,1023400,1025800,1017900,1025500,148653664,1028180.0\n2934,09/01/2009,00:00,1018900,1032400,999900,1002000,293867399,1004900.0\n2935,09/02/2009,00:00,997600,1004300,995700,998000,148469967,987450.0\n2936,09/03/2009,00:00,1003600,1007700,996000,1006500,125510980,988730.0\n2937,09/04/2009,00:00,1008800,1020900,1005500,1020800,118252152,1009090.0\n2938,09/08/2009,00:00,1030300,1030500,1023900,1028900,116888694,1034220.0\n2939,09/09/2009,00:00,1031300,1040800,1028000,1037600,141198400,1048840.0\n2940,09/10/2009,00:00,1037900,1048600,1032200,1048200,143608830,1058460.0\n2941,09/11/2009,00:00,1049800,1053000,1042800,1047900,139201608,1058730.0\n2942,09/14/2009,00:00,1038700,1054600,1038700,1053400,134269629,1060990.0\n2943,09/15/2009,00:00,1054600,1061100,1047700,1057400,165775887,1062340.0\n2944,09/16/2009,00:00,1061200,1073400,1057300,1073300,185276009,1073950.0\n2945,09/17/2009,00:00,1072000,1080600,1065700,1071600,181885156,1080910.0\n2946,09/18/2009,00:00,1071400,1071600,1063700,1067200,133261025,1077120.0\n2947,09/21/2009,00:00,1059100,1067100,1056700,1064400,124441627,1069150.0\n2948,09/22/2009,00:00,1070400,1073700,1066000,1070800,119687389,1065800.0\n2949,09/23/2009,00:00,1072900,1080300,1059900,1061400,212641124,1062040.0\n2950,09/24/2009,00:00,1064000,1066400,1045500,1049500,193188006,1051140.0\n2951,09/25/2009,00:00,1047600,1053600,1040900,1044500,177450598,1039790.0\n2952,09/28/2009,00:00,1048500,1065500,1048300,1063200,106784561,1048250.0\n2953,09/29/2009,00:00,1065000,1070200,1057800,1060300,123081691,1059230.0\n2954,09/30/2009,00:00,1063700,1064600,1046200,1055600,213499050,1063020.0\n2955,10/01/2009,00:00,1052900,1053800,1029500,1030500,231472699,1040140.0\n2956,10/02/2009,00:00,1020000,1031000,1019900,1025400,189423487,1015380.0\n2957,10/05/2009,00:00,1028600,1043200,1026000,1040100,138731180,1021200.0\n2958,10/06/2009,00:00,1047800,1061100,1047200,1055500,188508421,1044240.0\n2959,10/07/2009,00:00,1052800,1059100,1050700,1057700,143388316,1067190.0\n2960,10/08/2009,00:00,1065900,1071700,1061500,1066400,161845863,1078900.0\n2961,10/09/2009,00:00,1066100,1072600,1063600,1072500,117476400,1081150.0\n2962,10/12/2009,00:00,1077900,1080900,1072800,1077600,106574589,1083640.0\n2963,10/13/2009,00:00,1074200,1076500,1067600,1075000,138026355,1083580.0\n2964,10/14/2009,00:00,1087400,1094200,1082600,1093100,172568984,1093690.0\n2965,10/15/2009,00:00,1088300,1097000,1087300,1096500,145631259,1101990.0\n2966,10/16/2009,00:00,1087400,1092700,1082300,1088600,167637899,1099210.0\n2967,10/19/2009,00:00,1090200,1101300,1087300,1098600,128660136,1103170.0\n2968,10/20/2009,00:00,1099800,1099900,1086800,1092000,161763105,1093730.0\n2969,10/21/2009,00:00,1090500,1103100,1081500,1081500,201818324,1083460.0\n2970,10/22/2009,00:00,1081600,1096800,1075100,1093400,211112710,1088570.0\n2971,10/23/2009,00:00,1097200,1097400,1076400,1080800,221826860,1079000.0\n2972,10/26/2009,00:00,1082000,1093100,1066200,1068300,224536815,1068770.0\n2973,10/27/2009,00:00,1070100,1073900,1061600,1064000,220340353,1059570.0\n2974,10/28/2009,00:00,1061300,1064700,1043500,1043800,227624458,1035260.0\n2975,10/29/2009,00:00,1052000,1068600,1049400,1066500,175392823,1048750.0\n2976,10/30/2009,00:00,1063000,1066200,1034400,1035600,301271541,1036770.0\n2977,11/02/2009,00:00,1040600,1054100,1030800,1043600,237753904,1036000.0\n2978,11/03/2009,00:00,1036900,1048000,1035500,1046500,200418258,1041950.0\n2979,11/04/2009,00:00,1055600,1063300,1046500,1049100,216842586,1041090.0\n2980,11/05/2009,00:00,1056300,1068800,1054400,1068600,155994141,1070130.0\n2981,11/06/2009,00:00,1062000,1073900,1060500,1071600,145539690,1079310.0\n2982,11/09/2009,00:00,1080000,1096300,1078800,1096300,138344762,1103050.0\n2983,11/10/2009,00:00,1093300,1099200,1089700,1095700,145893995,1112530.0\n2984,11/11/2009,00:00,1103000,1108200,1096200,1101500,160053341,1113710.0\n2985,11/12/2009,00:00,1100200,1105700,1087500,1089900,141333806,1103540.0\n2986,11/13/2009,00:00,1092700,1100900,1087500,1096100,139007106,1094040.0\n2987,11/16/2009,00:00,1103900,1116900,1103200,1112200,179317407,1107360.0\n2988,11/17/2009,00:00,1109100,1113900,1105000,1113200,126440382,1116290.0\n2989,11/18/2009,00:00,1112900,1114300,1105800,1112700,134068179,1123630.0\n2990,11/19/2009,00:00,1104800,1105500,1091400,1097700,172315485,1107490.0\n2991,11/20/2009,00:00,1092900,1097600,1090100,1094300,118297574,1090630.0\n2992,11/23/2009,00:00,1106900,1116300,1106000,1109200,133405287,1097500.0\n2993,11/24/2009,00:00,1110500,1111400,1101000,1109900,124477453,1106530.0\n2994,11/25/2009,00:00,1111300,1115000,1108200,1113700,96237873,1119240.0\n2995,11/27/2009,00:00,1084100,1103200,1082900,1095000,99909438,1106190.0\n2996,11/30/2009,00:00,1095300,1101500,1090200,1098800,141351888,1094610.0\n2997,12/01/2009,00:00,1110400,1116600,1107300,1112500,140569828,1103070.0\n2998,12/02/2009,00:00,1112700,1120100,1109200,1113200,114258270,1111590.0\n2999,12/03/2009,00:00,1115700,1121800,1102900,1103800,147669372,1114260.0\n3000,12/04/2009,00:00,1118800,1123800,1100400,1110100,233224453,1111850.0\n3001,12/07/2009,00:00,1109100,1115200,1105000,1108000,113045254,1105890.0\n3002,12/08/2009,00:00,1100400,1102500,1092700,1096100,143490416,1097240.0\n3003,12/09/2009,00:00,1095600,1101800,1090200,1099700,129731956,1096880.0\n3004,12/10/2009,00:00,1107400,1111100,1104500,1106500,113015960,1099430.0\n3005,12/11/2009,00:00,1111600,1113600,1106100,1111800,107129731,1109820.0\n3006,12/14/2009,00:00,1118800,1119900,1113700,1119000,97147444,1123990.0\n3007,12/15/2009,00:00,1114600,1119200,1110000,1113000,104679392,1121730.0\n3008,12/16/2009,00:00,1117800,1121300,1112700,1114900,126284285,1118440.0\n3009,12/17/2009,00:00,1106900,1109300,1100800,1101300,155962329,1104470.0\n3010,12/18/2009,00:00,1101600,1103000,1092800,1101900,139436292,1096250.0\n3011,12/21/2009,00:00,1108300,1117000,1107600,1113300,102759561,1105160.0\n3012,12/22/2009,00:00,1115700,1119600,1114300,1117400,83460870,1114860.0\n3013,12/23/2009,00:00,1120300,1121100,1115000,1119700,91884071,1126410.0\n3014,12/24/2009,00:00,1122000,1126000,1121800,1126000,31493323,1132040.0\n3015,12/28/2009,00:00,1129500,1129800,1123200,1126700,63559406,1131240.0\n3016,12/29/2009,00:00,1130300,1130300,1125500,1126200,71809827,1130580.0\n3017,12/30/2009,00:00,1121800,1126400,1121700,1124500,61798352,1127560.0\n3018,12/31/2009,00:00,1127400,1128000,1114300,1114400,77535777,1115940.0\n3019,01/04/2010,00:00,1123300,1133900,1123300,1133300,101612569,1125440.0\n3020,01/05/2010,00:00,1132900,1136800,1129200,1136500,101558482,1135800.0\n3021,01/06/2010,00:00,1135500,1139900,1134300,1137300,100357016,1143510.0\n3022,01/07/2010,00:00,1135500,1143300,1131800,1142100,109962379,1150540.0\n3023,01/08/2010,00:00,1138700,1146200,1136600,1146200,97392014,1148500.0\n3024,01/11/2010,00:00,1151100,1151300,1142400,1147400,90916057,1151110.0\n3025,01/12/2010,00:00,1139800,1142100,1132200,1136700,138519116,1143170.0\n3026,01/13/2010,00:00,1139500,1149400,1133700,1146400,145150327,1143490.0\n3027,01/14/2010,00:00,1145100,1151300,1144200,1149400,101472803,1146840.0\n3028,01/15/2010,00:00,1147100,1148400,1132000,1136700,190969038,1140710.0\n3029,01/19/2010,00:00,1136200,1151300,1135800,1151200,119055229,1149870.0\n3030,01/20/2010,00:00,1142800,1142900,1129800,1138600,188236070,1140320.0\n3031,01/21/2010,00:00,1138900,1142700,1115600,1116500,310936217,1119310.0\n3032,01/22/2010,00:00,1112500,1116200,1090900,1092100,314680278,1089850.0\n3033,01/25/2010,00:00,1102000,1104100,1094100,1097800,169260899,1073250.0\n3034,01/26/2010,00:00,1093600,1104600,1090400,1092900,193990092,1074550.0\n3035,01/27/2010,00:00,1091600,1100700,1083400,1098100,240013264,1088680.0\n3036,01/28/2010,00:00,1102100,1102500,1079100,1085400,280379510,1089330.0\n3037,01/29/2010,00:00,1090800,1098000,1072200,1073700,274003890,1072870.0\n3038,02/01/2010,00:00,1081500,1090700,1080800,1090600,167106965,1079440.0\n3039,02/02/2010,00:00,1092800,1105900,1088800,1104100,187474697,1095540.0\n3040,02/03/2010,00:00,1099100,1104200,1095100,1098200,149775695,1107200.0\n3041,02/04/2010,00:00,1089500,1090300,1064300,1064900,299639792,1083300.0\n3042,02/05/2010,00:00,1065300,1068800,1045800,1066600,428459550,1058720.0\n3043,02/08/2010,00:00,1067200,1073300,1058100,1058700,188743438,1041780.0\n3044,02/09/2010,00:00,1071500,1081400,1062700,1072000,308419675,1054500.0\n3045,02/10/2010,00:00,1070800,1076000,1061100,1070100,210589713,1071200.0\n3046,02/11/2010,00:00,1069000,1082500,1062500,1081300,191602096,1081980.0\n3047,02/12/2010,00:00,1070000,1080600,1065100,1080400,256579291,1088310.0\n3048,02/16/2010,00:00,1088500,1098500,1084200,1097500,139022359,1098650.0\n3049,02/17/2010,00:00,1102700,1104100,1097500,1102600,150780287,1110740.0\n3050,02/18/2010,00:00,1101000,1111400,1100400,1109100,155131400,1117520.0\n3051,02/19/2010,00:00,1106600,1115700,1103600,1111800,171665579,1122600.0\n3052,02/22/2010,00:00,1115600,1115700,1108300,1111500,119291196,1117660.0\n3053,02/23/2010,00:00,1108800,1112000,1095200,1098100,185594332,1104640.0\n3054,02/24/2010,00:00,1101300,1110000,1098600,1108400,160346043,1103250.0\n3055,02/25/2010,00:00,1092200,1107500,1089400,1106700,228064106,1103310.0\n3056,02/26/2010,00:00,1108000,1111200,1101100,1107600,153360353,1106700.0\n3057,03/01/2010,00:00,1112000,1120000,1111700,1118600,135190244,1119940.0\n3058,03/02/2010,00:00,1124200,1127400,1120000,1121900,145530949,1124310.0\n3059,03/03/2010,00:00,1124900,1129700,1120200,1123000,132804832,1129630.0\n3060,03/04/2010,00:00,1124700,1128000,1120300,1126600,119080489,1132260.0\n3061,03/05/2010,00:00,1133900,1143400,1131000,1142300,156885083,1142110.0\n3062,03/08/2010,00:00,1142800,1145200,1140700,1142900,103543953,1149730.0\n3063,03/09/2010,00:00,1139300,1149900,1138700,1144600,140701397,1153730.0\n3064,03/10/2010,00:00,1145100,1152700,1144200,1149900,162438448,1155930.0\n3065,03/11/2010,00:00,1147000,1154800,1143500,1154500,135307420,1156260.0\n3066,03/12/2010,00:00,1159300,1159700,1151400,1154600,142572159,1159290.0\n3067,03/15/2010,00:00,1152500,1155800,1146000,1155000,130011073,1159370.0\n3068,03/16/2010,00:00,1158000,1165100,1154900,1164100,162857046,1164290.0\n3069,03/17/2010,00:00,1167600,1174800,1167100,1171300,159132687,1172830.0\n3070,03/18/2010,00:00,1171100,1172700,1165700,1170300,166805098,1177370.0\n3071,03/19/2010,00:00,1168900,1169700,1155200,1159300,197632473,1168440.0\n3072,03/22/2010,00:00,1152900,1168000,1152400,1165900,165945786,1163660.0\n3073,03/23/2010,00:00,1167400,1175100,1163800,1174000,143575620,1168460.0\n3074,03/24/2010,00:00,1169700,1173200,1166000,1168500,179017686,1170930.0\n3075,03/25/2010,00:00,1176700,1181000,1165100,1166200,204212712,1171700.0\n3076,03/26/2010,00:00,1169000,1174200,1161200,1166600,182823304,1166320.0\n3077,03/29/2010,00:00,1171900,1175300,1169700,1173200,114886550,1168650.0\n3078,03/30/2010,00:00,1174300,1178300,1169100,1174000,133753684,1175100.0\n3079,03/31/2010,00:00,1169300,1175200,1166100,1169900,143074981,1174420.0\n3080,04/01/2010,00:00,1178300,1182100,1171000,1178200,132999598,1178350.0\n3081,04/05/2010,00:00,1182600,1188400,1179200,1187600,96085334,1186480.0\n3082,04/06/2010,00:00,1184400,1192500,1182900,1190400,100648392,1195170.0\n3083,04/07/2010,00:00,1188100,1190800,1178100,1183600,164373267,1193820.0\n3084,04/08/2010,00:00,1179200,1189700,1176000,1187800,135493462,1190080.0\n3085,04/09/2010,00:00,1190100,1196000,1188000,1195500,117269001,1192940.0\n3086,04/12/2010,00:00,1197200,1200500,1195600,1197400,96008284,1198710.0\n3087,04/13/2010,00:00,1196400,1200300,1190000,1198700,114417753,1204540.0\n3088,04/14/2010,00:00,1202900,1211900,1200800,1211900,139840404,1213680.0\n3089,04/15/2010,00:00,1210200,1215300,1209500,1213200,130211106,1218310.0\n3090,04/16/2010,00:00,1208600,1210800,1187600,1194000,336400729,1205350.0\n3091,04/19/2010,00:00,1190200,1199200,1184700,1198100,197140040,1197450.0\n3092,04/20/2010,00:00,1205400,1209800,1201700,1208800,135686200,1198810.0\n3093,04/21/2010,00:00,1209700,1212200,1199900,1206600,179302939,1204620.0\n3094,04/22/2010,00:00,1198400,1211700,1191300,1210200,217053442,1215810.0\n3095,04/23/2010,00:00,1209500,1218600,1206300,1217900,157952904,1220620.0\n3096,04/26/2010,00:00,1218500,1221200,1212300,1213500,128503526,1217610.0\n3097,04/27/2010,00:00,1206900,1212700,1182500,1184300,319490055,1194110.0\n3098,04/28/2010,00:00,1190600,1196800,1182800,1193500,260858013,1183780.0\n3099,04/29/2010,00:00,1201200,1211100,1200700,1208500,173403067,1191900.0\n3100,04/30/2010,00:00,1208900,1210100,1187800,1188600,243566503,1190000.0\n3101,05/03/2010,00:00,1193900,1206800,1192000,1203600,165779303,1205810.0\n3102,05/04/2010,00:00,1190200,1190300,1169200,1175800,315600227,1181910.0\n3103,05/05/2010,00:00,1165100,1178000,1159700,1168200,285775282,1160920.0\n3104,05/06/2010,00:00,1162500,1170000,1061300,1127400,569347387,1125380.0\n3105,05/07/2010,00:00,1127700,1137600,1095800,1110000,585016620,1086320.0\n3106,05/10/2010,00:00,1158700,1166500,1149200,1161700,339405817,1122700.0\n3107,05/11/2010,00:00,1150700,1173600,1149200,1158300,275150530,1149470.0\n3108,05/12/2010,00:00,1163300,1176100,1160900,1174700,198610922,1189290.0\n3109,05/13/2010,00:00,1172000,1176700,1158900,1160200,209054765,1187000.0\n3110,05/14/2010,00:00,1151000,1153300,1128700,1139200,309838200,1145890.0\n3111,05/17/2010,00:00,1141800,1145100,1117800,1139100,302412076,1132130.0\n3112,05/18/2010,00:00,1149000,1152200,1120300,1124300,336263031,1110930.0\n3113,05/19/2010,00:00,1117500,1127700,1103700,1117400,357395387,1105890.0\n3114,05/20/2010,00:00,1094400,1098900,1074800,1075500,461299151,1074370.0\n3115,05/21/2010,00:00,1059600,1093800,1056400,1090300,446458865,1065400.0\n3116,05/24/2010,00:00,1085000,1093800,1076100,1077000,236939723,1060390.0\n3117,05/25/2010,00:00,1051800,1078700,1043800,1078000,346668886,1064450.0\n3118,05/26/2010,00:00,1085300,1094700,1068600,1071700,305215403,1072530.0\n3119,05/27/2010,00:00,1092200,1108000,1087900,1107900,246903469,1093950.0\n3120,05/28/2010,00:00,1106700,1106800,1088500,1094400,227442685,1105210.0\n3121,06/01/2010,00:00,1083400,1099500,1073800,1075200,249503926,1090570.0\n3122,06/02/2010,00:00,1080600,1103400,1076100,1102800,207115458,1099250.0\n3123,06/03/2010,00:00,1106800,1110600,1095900,1107000,202921965,1099440.0\n3124,06/04/2010,00:00,1086400,1093300,1064700,1069400,303257186,1084300.0\n3125,06/07/2010,00:00,1071700,1076100,1054100,1054900,226645501,1059660.0\n3126,06/08/2010,00:00,1056100,1068300,1046500,1065700,328152629,1042070.0\n3127,06/09/2010,00:00,1072600,1082800,1056600,1059900,234619553,1042010.0\n3128,06/10/2010,00:00,1078600,1092800,1076900,1091900,262038971,1083360.0\n3129,06/11/2010,00:00,1082100,1097500,1081300,1096800,176469285,1106840.0\n3130,06/14/2010,00:00,1105900,1111200,1094000,1095700,185513847,1111070.0\n3131,06/15/2010,00:00,1103600,1121000,1100900,1119500,199033417,1129660.0\n3132,06/16/2010,00:00,1114600,1124200,1112000,1119600,183558599,1128130.0\n3133,06/17/2010,00:00,1122900,1123300,1110600,1121400,231754413,1132530.0\n3134,06/18/2010,00:00,1118100,1121300,1113700,1116600,147605456,1127670.0\n3135,06/21/2010,00:00,1131400,1132000,1107900,1114100,189325476,1114100.0\n3136,06/22/2010,00:00,1114300,1119000,1094200,1095700,209071401,1096950.0\n3137,06/23/2010,00:00,1096200,1100200,1084800,1092600,232709298,1084530.0\n3138,06/24/2010,00:00,1086800,1088300,1071400,1074700,233370748,1067150.0\n3139,06/25/2010,00:00,1077400,1084200,1067700,1079500,198008813,1064260.0\n3140,06/28/2010,00:00,1080300,1083200,1071500,1074900,147292823,1067070.0\n3141,06/29/2010,00:00,1060400,1060600,1035600,1042000,333792138,1042440.0\n3142,06/30/2010,00:00,1039000,1048800,1028800,1032200,240155366,1023910.0\n3143,07/01/2010,00:00,1031800,1034900,1011400,1028100,333948813,1007690.0\n3144,07/02/2010,00:00,1031200,1034200,1016200,1022000,184630972,1003930.0\n3145,07/06/2010,00:00,1036500,1043700,1018800,1028600,217611751,1019480.0\n3146,07/07/2010,00:00,1031100,1062400,1030300,1061500,221557775,1052210.0\n3147,07/08/2010,00:00,1069300,1072800,1059100,1071700,183720137,1080390.0\n3148,07/09/2010,00:00,1071300,1079600,1069300,1079300,124564547,1099930.0\n3149,07/12/2010,00:00,1076200,1082400,1071500,1080300,119020688,1100640.0\n3150,07/13/2010,00:00,1091700,1100900,1089300,1096600,183345379,1101520.0\n3151,07/14/2010,00:00,1093200,1100700,1088700,1096700,162674552,1105110.0\n3152,07/15/2010,00:00,1095800,1100600,1081700,1096800,201307149,1105360.0\n3153,07/16/2010,00:00,1090600,1091600,1064500,1066300,248223518,1079000.0\n3154,07/19/2010,00:00,1070800,1076300,1062200,1072900,161887549,1062520.0\n3155,07/20/2010,00:00,1058500,1085600,1058200,1084800,215127960,1069190.0\n3156,07/21/2010,00:00,1090500,1090700,1066300,1070700,230027718,1068190.0\n3157,07/22/2010,00:00,1083300,1099400,1083300,1094800,218860157,1094340.0\n3158,07/23/2010,00:00,1092600,1105600,1089300,1104100,192641111,1107180.0\n3159,07/26/2010,00:00,1105600,1116700,1102900,1115700,147222199,1122580.0\n3160,07/27/2010,00:00,1121500,1122900,1111100,1115500,179718422,1133310.0\n3161,07/28/2010,00:00,1113700,1116600,1104600,1108000,139676159,1118960.0\n3162,07/29/2010,00:00,1115100,1118200,1094200,1102900,188354458,1106210.0\n3163,07/30/2010,00:00,1092000,1108600,1089800,1102700,189667997,1097380.0\n3164,08/02/2010,00:00,1120100,1129400,1115400,1127600,145317471,1117010.0\n3165,08/03/2010,00:00,1125000,1127700,1118500,1122200,130643614,1128610.0\n3166,08/04/2010,00:00,1125000,1131100,1121600,1129700,132448474,1138950.0\n3167,08/05/2010,00:00,1123100,1129100,1120800,1128500,118412553,1138250.0\n3168,08/06/2010,00:00,1117600,1125700,1109200,1124100,192589474,1126210.0\n3169,08/09/2010,00:00,1129400,1131800,1123200,1130100,89710689,1129980.0\n3170,08/10/2010,00:00,1120800,1129800,1113800,1123900,206287943,1124260.0\n3171,08/11/2010,00:00,1106900,1106900,1091200,1093000,219264412,1098560.0\n3172,08/12/2010,00:00,1076200,1090200,1076000,1086000,187028334,1077430.0\n3173,08/13/2010,00:00,1082700,1089500,1081800,1082800,128491825,1063410.0\n3174,08/16/2010,00:00,1075600,1086100,1071800,1082600,128663908,1065820.0\n3175,08/17/2010,00:00,1091600,1103900,1088800,1095900,145307620,1088780.0\n3176,08/18/2010,00:00,1095300,1103800,1089100,1097800,154569684,1100030.0\n3177,08/19/2010,00:00,1092300,1094900,1074300,1078800,217668677,1089740.0\n3178,08/20/2010,00:00,1075200,1077000,1067500,1075300,164263849,1076570.0\n3179,08/23/2010,00:00,1080000,1085700,1070700,1071300,135275833,1062310.0\n3180,08/24/2010,00:00,1058800,1063900,1049800,1055600,228100949,1048190.0\n3181,08/25/2010,00:00,1049300,1063400,1043000,1058800,205812863,1050050.0\n3182,08/26/2010,00:00,1064000,1065800,1048800,1052300,180709953,1045110.0\n3183,08/27/2010,00:00,1058300,1069700,1043100,1068200,215621134,1058390.0\n3184,08/30/2010,00:00,1065400,1069100,1053000,1053400,129802797,1059160.0\n3185,08/31/2010,00:00,1048800,1059800,1044900,1054700,207994986,1055350.0\n3186,09/01/2010,00:00,1067400,1086100,1066700,1084400,218692218,1077810.0\n3187,09/02/2010,00:00,1086900,1094900,1084900,1094700,136593872,1096280.0\n3188,09/03/2010,00:00,1105800,1109900,1099500,1109200,164269500,1124760.0\n3189,09/07/2010,00:00,1103900,1105100,1095500,1096800,115959632,1120660.0\n3190,09/08/2010,00:00,1098500,1108500,1098100,1104100,122759786,1110290.0\n3191,09/09/2010,00:00,1116300,1116800,1106200,1109400,123066497,1110130.0\n3192,09/10/2010,00:00,1111300,1116100,1108700,1115400,101964504,1114480.0\n3193,09/13/2010,00:00,1126100,1129500,1121300,1127200,138847600,1132210.0\n3194,09/14/2010,00:00,1125400,1132900,1120800,1126500,169752501,1135300.0\n3195,09/15/2010,00:00,1122800,1132100,1119800,1131400,135433895,1138510.0\n3196,09/16/2010,00:00,1127100,1131200,1123500,1131000,165464005,1136920.0\n3197,09/17/2010,00:00,1130000,1131500,1121800,1125100,163422582,1128330.0\n3198,09/20/2010,00:00,1128700,1144600,1126200,1142300,165915393,1138850.0\n3199,09/21/2010,00:00,1143000,1148400,1135100,1140000,211066069,1142510.0\n3200,09/22/2010,00:00,1138100,1144300,1131000,1134300,162196256,1140990.0\n3201,09/23/2010,00:00,1124500,1136700,1121900,1125000,168335090,1130880.0\n3202,09/24/2010,00:00,1137300,1149000,1136500,1147900,154008044,1136760.0\n3203,09/27/2010,00:00,1148200,1149900,1141700,1143200,107216443,1144080.0\n3204,09/28/2010,00:00,1144200,1150400,1131900,1146700,174697792,1152320.0\n3205,09/29/2010,00:00,1144400,1149000,1140200,1144100,149678645,1152480.0\n3206,09/30/2010,00:00,1150800,1157900,1135900,1141200,232277380,1140870.0\n3207,10/01/2010,00:00,1149900,1151200,1139300,1146100,143224066,1144350.0\n3208,10/04/2010,00:00,1143600,1148500,1131800,1137500,143395829,1138200.0\n3209,10/05/2010,00:00,1148400,1163200,1146700,1160500,194332138,1154610.0\n3210,10/06/2010,00:00,1160500,1163300,1155600,1160600,121660574,1165140.0\n3211,10/07/2010,00:00,1165000,1165300,1151900,1158900,140415077,1167330.0\n3212,10/08/2010,00:00,1160400,1168600,1156100,1165600,136003134,1173000.0\n3213,10/11/2010,00:00,1167700,1169700,1162500,1166600,88810641,1167600.0\n3214,10/12/2010,00:00,1162800,1173500,1156500,1169900,143770924,1172210.0\n3215,10/13/2010,00:00,1176200,1185500,1173800,1178800,162739555,1181190.0\n3216,10/14/2010,00:00,1178100,1180100,1167200,1175500,176271612,1180880.0\n3217,10/15/2010,00:00,1182700,1183500,1167600,1177200,202366646,1181640.0\n3218,10/18/2010,00:00,1177700,1186600,1175200,1185500,119032748,1186260.0\n3219,10/19/2010,00:00,1172200,1178500,1160200,1167100,221000327,1172800.0\n3220,10/20/2010,00:00,1169700,1184400,1168700,1178700,169446252,1175690.0\n3221,10/21/2010,00:00,1184200,1190800,1172100,1181200,195073757,1178300.0\n3222,10/22/2010,00:00,1182900,1185300,1180000,1183800,95874689,1182470.0\n3223,10/25/2010,00:00,1191900,1197600,1186100,1186900,124389435,1192950.0\n3224,10/26/2010,00:00,1180800,1188400,1178700,1187300,136058914,1190450.0\n3225,10/27/2010,00:00,1178400,1185100,1172600,1183800,167955941,1187210.0\n3226,10/28/2010,00:00,1190400,1191100,1178300,1184000,143823805,1184350.0\n3227,10/29/2010,00:00,1182700,1187100,1180700,1185300,124560631,1183510.0\n3228,11/01/2010,00:00,1191500,1197500,1178500,1185300,145231041,1184390.0\n3229,11/02/2010,00:00,1194100,1197500,1191000,1194900,127371600,1193710.0\n3230,11/03/2010,00:00,1196300,1200200,1184500,1200100,188790367,1202460.0\n3231,11/04/2010,00:00,1213000,1223200,1211300,1222600,183902380,1224460.0\n3232,11/05/2010,00:00,1223600,1229200,1221800,1227400,149833645,1239630.0\n3233,11/08/2010,00:00,1223300,1226900,1219400,1225400,123981989,1240570.0\n3234,11/09/2010,00:00,1228200,1229400,1211200,1216000,161563427,1228680.0\n3235,11/10/2010,00:00,1215600,1221600,1206600,1220900,192884353,1218020.0\n3236,11/11/2010,00:00,1210300,1218200,1206900,1216600,141083466,1213430.0\n3237,11/12/2010,00:00,1208100,1213500,1196500,1201800,203211051,1202160.0\n3238,11/15/2010,00:00,1205700,1210500,1199800,1200400,135801020,1196050.0\n3239,11/16/2010,00:00,1193300,1194900,1175900,1181200,243870180,1175500.0\n3240,11/17/2010,00:00,1182100,1187000,1178600,1182100,144016027,1169540.0\n3241,11/18/2010,00:00,1193500,1203900,1193500,1200200,139883399,1186690.0\n3242,11/19/2010,00:00,1199200,1203400,1192500,1202600,119156212,1200320.0\n3243,11/22/2010,00:00,1197200,1202400,1187700,1201900,150117203,1212170.0\n3244,11/23/2010,00:00,1187900,1190200,1179900,1184200,175335182,1195970.0\n3245,11/24/2010,00:00,1192500,1202300,1191700,1201900,113831826,1193660.0\n3246,11/26/2010,00:00,1191400,1198100,1190300,1192700,56088364,1190720.0\n3247,11/29/2010,00:00,1185100,1194800,1177400,1191600,186493230,1190830.0\n3248,11/30/2010,00:00,1179600,1191700,1178100,1184800,185923239,1188310.0\n3249,12/01/2010,00:00,1202500,1212400,1201900,1210000,138468755,1198690.0\n3250,12/02/2010,00:00,1211700,1226500,1211400,1225700,153312536,1226280.0\n3251,12/03/2010,00:00,1221500,1230300,1221100,1228600,112949149,1242610.0\n3252,12/06/2010,00:00,1226400,1230400,1225000,1227400,84112951,1246440.0\n3253,12/07/2010,00:00,1239700,1240100,1227600,1228300,160822937,1235490.0\n3254,12/08/2010,00:00,1229700,1233800,1224100,1232900,120939312,1232810.0\n3255,12/09/2010,00:00,1239400,1240200,1231600,1238200,110524832,1238490.0\n3256,12/10/2010,00:00,1241200,1246000,1237300,1245000,96823273,1247890.0\n3257,12/13/2010,00:00,1250400,1252000,1245200,1245600,102916423,1252010.0\n3258,12/14/2010,00:00,1247900,1252300,1242900,1246500,127061129,1252020.0\n3259,12/15/2010,00:00,1244900,1249300,1238900,1241200,125961401,1245550.0\n3260,12/16/2010,00:00,1242200,1249100,1237500,1248200,157753417,1245900.0\n3261,12/17/2010,00:00,1240500,1244600,1238200,1243800,105024844,1244490.0\n3262,12/20/2010,00:00,1246200,1249000,1239900,1245700,91230312,1245380.0\n3263,12/21/2010,00:00,1250000,1254700,1248800,1253900,73500780,1253430.0\n3264,12/22/2010,00:00,1255400,1258200,1254100,1257900,62932866,1258750.0\n3265,12/23/2010,00:00,1256300,1257700,1252900,1256100,58830089,1262520.0\n3266,12/27/2010,00:00,1250900,1257700,1250400,1256500,51912786,1261160.0\n3267,12/28/2010,00:00,1259300,1259500,1255000,1258000,49262784,1258520.0\n3268,12/29/2010,00:00,1259600,1262000,1259000,1259200,46307819,1258890.0\n3269,12/30/2010,00:00,1258100,1261300,1255300,1257200,59362453,1258870.0\n3270,12/31/2010,00:00,1255300,1258700,1253400,1257800,71169974,1258280.0\n3271,01/03/2011,00:00,1267300,1276000,1266600,1270100,112417364,1267300.0\n3272,01/04/2011,00:00,1273000,1273700,1261900,1269300,117330516,1272650.0\n3273,01/05/2011,00:00,1265700,1277200,1264700,1276400,110956559,1281130.0\n3274,01/06/2011,00:00,1277000,1278300,1270100,1273900,98800243,1281050.0\n3275,01/07/2011,00:00,1275500,1277700,1261600,1271300,132033948,1274300.0\n3276,01/10/2011,00:00,1265900,1271600,1262000,1270100,102726986,1271150.0\n3277,01/11/2011,00:00,1274500,1277400,1269500,1274300,100122850,1270800.0\n3278,01/12/2011,00:00,1282500,1287100,1279900,1286400,90853228,1283600.0\n3279,01/13/2011,00:00,1286100,1286900,1280500,1284500,101801231,1290130.0\n3280,01/14/2011,00:00,1281700,1293300,1281100,1292800,96551177,1298300.0\n3281,01/18/2011,00:00,1292100,1296400,1290300,1295300,97195465,1301180.0\n3282,01/19/2011,00:00,1294300,1295000,1279100,1282700,138452706,1289360.0\n3283,01/20/2011,00:00,1279300,1283900,1271400,1281400,151691232,1282450.0\n3284,01/21/2011,00:00,1288500,1291700,1282300,1283600,131335477,1277470.0\n3285,01/24/2011,00:00,1283100,1292500,1282600,1291600,88339067,1284970.0\n3286,01/25/2011,00:00,1287700,1292000,1281100,1291600,148176299,1294580.0\n3287,01/26/2011,00:00,1294400,1300500,1292300,1296900,113752687,1300720.0\n3288,01/27/2011,00:00,1296500,1302100,1294700,1300300,107115837,1304410.0\n3289,01/28/2011,00:00,1301700,1303500,1275100,1277200,221182337,1285490.0\n3290,01/31/2011,00:00,1280500,1287800,1277600,1286700,123710397,1281690.0\n3291,02/01/2011,00:00,1294400,1309700,1293900,1307100,141489397,1295680.0\n3292,02/02/2011,00:00,1304600,1308400,1303300,1304800,101182676,1306890.0\n3293,02/03/2011,00:00,1302700,1309800,1295700,1307600,119265099,1320350.0\n3294,02/04/2011,00:00,1308500,1312000,1302300,1311700,96574018,1318730.0\n3295,02/07/2011,00:00,1314400,1324000,1314300,1320000,92312617,1320050.0\n3296,02/08/2011,00:00,1321300,1326400,1317300,1325900,84631958,1330380.0\n3297,02/09/2011,00:00,1322000,1326300,1316100,1323200,122808924,1331300.0\n3298,02/10/2011,00:00,1316100,1324700,1313000,1323300,131988116,1328740.0\n3299,02/11/2011,00:00,1318000,1332800,1317700,1331500,114245978,1330900.0\n3300,02/14/2011,00:00,1330700,1335400,1328900,1334300,75442998,1335170.0\n3301,02/15/2011,00:00,1330500,1332200,1326600,1330400,96473771,1336160.0\n3302,02/16/2011,00:00,1334700,1340100,1331900,1338200,112514786,1340150.0\n3303,02/17/2011,00:00,1334300,1344300,1333400,1342200,90526975,1342910.0\n3304,02/18/2011,00:00,1343200,1346900,1340600,1345700,109026773,1348540.0\n3305,02/22/2011,00:00,1331100,1338600,1314800,1318000,193712343,1329710.0\n3306,02/23/2011,00:00,1317200,1320700,1302100,1310100,192006664,1306720.0\n3307,02/24/2011,00:00,1308600,1314400,1297000,1309200,201673410,1294560.0\n3308,02/25/2011,00:00,1314700,1324100,1314000,1323200,104682889,1305100.0\n3309,02/28/2011,00:00,1328400,1333200,1323800,1331500,106909359,1330430.0\n3310,03/01/2011,00:00,1336800,1336800,1308900,1308900,169595915,1322550.0\n3311,03/02/2011,00:00,1307900,1318100,1306000,1311600,161826340,1314030.0\n3312,03/03/2011,00:00,1323900,1336200,1323900,1334700,135154955,1322910.0\n3313,03/04/2011,00:00,1333700,1334800,1316000,1324700,198750826,1325940.0\n3314,03/07/2011,00:00,1328000,1331500,1307400,1313700,160082351,1325530.0\n3315,03/08/2011,00:00,1316700,1330000,1310700,1325600,125693247,1324160.0\n3316,03/09/2011,00:00,1323400,1327900,1316000,1323900,123778259,1318310.0\n3317,03/10/2011,00:00,1310400,1310400,1298100,1299300,212776860,1305260.0\n3318,03/11/2011,00:00,1294900,1313100,1294900,1308400,171495590,1303110.0\n3319,03/14/2011,00:00,1300300,1304800,1290600,1300500,194998514,1291830.0\n3320,03/15/2011,00:00,1267000,1293300,1265100,1285600,236582783,1280920.0\n3321,03/16/2011,00:00,1281800,1285700,1252800,1262100,414607812,1262020.0\n3322,03/17/2011,00:00,1280100,1283900,1271000,1278500,193507431,1257560.0\n3323,03/18/2011,00:00,1288400,1288800,1275100,1277600,188607766,1264990.0\n3324,03/21/2011,00:00,1294100,1300100,1292000,1297400,133722411,1291970.0\n3325,03/22/2011,00:00,1297600,1298800,1291700,1293000,99916388,1305930.0\n3326,03/23/2011,00:00,1289600,1300000,1283200,1296400,126368332,1303940.0\n3327,03/24/2011,00:00,1304600,1310800,1296800,1309000,124919412,1313220.0\n3328,03/25/2011,00:00,1312200,1318600,1309500,1312900,130636077,1315840.0\n3329,03/28/2011,00:00,1315700,1319200,1309400,1309400,76324619,1318930.0\n3330,03/29/2011,00:00,1308900,1318900,1304400,1318600,112305617,1322700.0\n3331,03/30/2011,00:00,1325800,1331500,1323600,1327000,110691781,1327890.0\n3332,03/31/2011,00:00,1326300,1329600,1324600,1325100,107390884,1331200.0\n3333,04/01/2011,00:00,1334500,1337700,1328400,1331500,132462581,1337530.0\n3334,04/04/2011,00:00,1334800,1336700,1328800,1332400,87692371,1336550.0\n3335,04/05/2011,00:00,1329500,1338300,1329400,1332400,102189817,1335110.0\n3336,04/06/2011,00:00,1338500,1340000,1331200,1336600,102531525,1338770.0\n3337,04/07/2011,00:00,1333900,1339400,1326600,1333200,166665573,1335500.0\n3338,04/08/2011,00:00,1338800,1339900,1323100,1328600,122011059,1330600.0\n3339,04/11/2011,00:00,1330100,1334500,1321400,1324700,105116572,1324080.0\n3340,04/12/2011,00:00,1317100,1319700,1309900,1314500,147011475,1311710.0\n3341,04/13/2011,00:00,1320900,1321800,1309700,1314500,131494341,1307650.0\n3342,04/14/2011,00:00,1306900,1317600,1302700,1315600,132675697,1308720.0\n3343,04/15/2011,00:00,1317800,1323700,1314100,1321200,127204358,1316330.0\n3344,04/18/2011,00:00,1305300,1308100,1295100,1305300,175212323,1310710.0\n3345,04/19/2011,00:00,1307500,1313500,1304400,1312800,103007172,1309770.0\n3346,04/20/2011,00:00,1328800,1333900,1328000,1331600,123308092,1324380.0\n3347,04/21/2011,00:00,1337500,1338300,1333500,1337400,90235439,1339270.0\n3348,04/25/2011,00:00,1336600,1338500,1332000,1336200,51582371,1350580.0\n3349,04/26/2011,00:00,1340500,1350500,1339100,1347900,116407987,1355620.0\n3350,04/27/2011,00:00,1350500,1358700,1345000,1356300,95956938,1359850.0\n3351,04/28/2011,00:00,1354200,1362900,1354100,1360400,101543480,1367470.0\n3352,04/29/2011,00:00,1361400,1365700,1359800,1365400,85741363,1374510.0\n3353,05/02/2011,00:00,1371000,1371800,1359500,1362500,103821177,1369990.0\n3354,05/03/2011,00:00,1359400,1361900,1350500,1357100,108602242,1361450.0\n3355,05/04/2011,00:00,1357000,1357300,1342400,1348600,158575567,1349230.0\n3356,05/05/2011,00:00,1340900,1349400,1330200,1336300,188183223,1332350.0\n3357,05/06/2011,00:00,1348800,1356200,1336800,1342000,184218970,1330760.0\n3358,05/09/2011,00:00,1342000,1351100,1339800,1347200,101087402,1338320.0\n3359,05/10/2011,00:00,1351500,1361100,1350100,1358700,96564068,1355890.0\n3360,05/11/2011,00:00,1356400,1356900,1338200,1344500,169055758,1355670.0\n3361,05/12/2011,00:00,1340700,1353600,1333900,1351000,151731104,1353270.0\n3362,05/13/2011,00:00,1351700,1353300,1335700,1340400,137536979,1341970.0\n3363,05/16/2011,00:00,1335400,1346000,1329700,1331900,123693366,1327990.0\n3364,05/17/2011,00:00,1327000,1333500,1321200,1331700,169691578,1326490.0\n3365,05/18/2011,00:00,1332600,1345000,1329500,1343800,113414741,1332830.0\n3366,05/19/2011,00:00,1347900,1350200,1339400,1346600,107562279,1346170.0\n3367,05/20/2011,00:00,1343100,1345200,1333600,1336700,151825718,1345490.0\n3368,05/23/2011,00:00,1319900,1324600,1315900,1320400,146936625,1326930.0\n3369,05/24/2011,00:00,1324200,1327300,1317000,1319500,125130970,1310960.0\n3370,05/25/2011,00:00,1313800,1329300,1313800,1323700,126797102,1310480.0\n3371,05/26/2011,00:00,1320000,1332400,1317800,1330100,141163316,1323110.0\n3372,05/27/2011,00:00,1333900,1338700,1331900,1335400,104585597,1338000.0\n3373,05/31/2011,00:00,1347800,1349000,1338400,1348900,137873991,1352670.0\n3374,06/01/2011,00:00,1345200,1346000,1317600,1318500,191089527,1333840.0\n3375,06/02/2011,00:00,1319800,1322300,1309600,1316900,171255274,1316970.0\n3376,06/03/2011,00:00,1301600,1314200,1300800,1304000,175974272,1296300.0\n3377,06/06/2011,00:00,1300900,1303600,1288700,1290500,150447026,1276370.0\n3378,06/07/2011,00:00,1296700,1300700,1288500,1288500,140942241,1277760.0\n3379,06/08/2011,00:00,1287700,1291900,1281800,1284000,172442254,1272390.0\n3380,06/09/2011,00:00,1287700,1299300,1284600,1294000,124608303,1284250.0\n3381,06/10/2011,00:00,1288300,1289300,1272600,1275600,200759581,1279230.0\n3382,06/13/2011,00:00,1278900,1282400,1270500,1276700,166838405,1274160.0\n3383,06/14/2011,00:00,1288800,1297700,1288200,1293200,135441318,1285030.0\n3384,06/15/2011,00:00,1282600,1286500,1266800,1270200,253954829,1272940.0\n3385,06/16/2011,00:00,1270900,1279700,1263200,1272800,235033145,1274070.0\n3386,06/17/2011,00:00,1279100,1279400,1266200,1270200,196654705,1266600.0\n3387,06/20/2011,00:00,1266000,1279700,1265800,1277000,118761833,1266960.0\n3388,06/21/2011,00:00,1283400,1297000,1281900,1294200,156360187,1292540.0\n3389,06/22/2011,00:00,1290500,1298100,1285900,1287000,149249226,1295960.0\n3390,06/23/2011,00:00,1270900,1283700,1261900,1282900,235834402,1292880.0\n3391,06/24/2011,00:00,1282800,1283700,1266200,1268100,164159526,1273110.0\n3392,06/27/2011,00:00,1269100,1284300,1266400,1279400,136843451,1267770.0\n3393,06/28/2011,00:00,1284300,1296300,1282700,1296100,140874843,1287110.0\n3394,06/29/2011,00:00,1301600,1309200,1297100,1307500,194592323,1309960.0\n3395,06/30/2011,00:00,1311500,1321800,1309900,1319700,175250888,1333550.0\n3396,07/01/2011,00:00,1319500,1341000,1317800,1339600,177311326,1351660.0\n3397,07/05/2011,00:00,1338000,1340800,1333900,1337100,143543355,1354230.0\n3398,07/06/2011,00:00,1334800,1341400,1331100,1339400,120813267,1353020.0\n3399,07/07/2011,00:00,1351300,1357000,1348800,1354600,135298236,1358960.0\n3400,07/08/2011,00:00,1338400,1344400,1333900,1344000,141569480,1350830.0\n3401,07/11/2011,00:00,1327300,1331800,1316600,1319600,153549170,1329820.0\n3402,07/12/2011,00:00,1316900,1327800,1313600,1314300,183267791,1308820.0\n3403,07/13/2011,00:00,1321100,1332200,1315200,1318500,175157447,1299630.0\n3404,07/14/2011,00:00,1321700,1327800,1306800,1309400,203950283,1300070.0\n3405,07/15/2011,00:00,1316400,1318700,1307700,1317400,181930028,1313050.0\n3406,07/18/2011,00:00,1310600,1312800,1296300,1305800,156024657,1307650.0\n3407,07/19/2011,00:00,1313500,1328900,1313100,1327800,141053959,1320280.0\n3408,07/20/2011,00:00,1330800,1331500,1324200,1326500,116123946,1330760.0\n3409,07/21/2011,00:00,1333900,1348200,1331400,1345200,210672957,1347430.0\n3410,07/22/2011,00:00,1345000,1347200,1337700,1346100,104151486,1359680.0\n3411,07/25/2011,00:00,1333300,1344900,1331600,1338300,118778460,1348960.0\n3412,07/26/2011,00:00,1337500,1339600,1330300,1333600,110478321,1340130.0\n3413,07/27/2011,00:00,1325800,1326000,1304300,1306000,227669341,1306570.0\n3414,07/28/2011,00:00,1306200,1317600,1300100,1301600,174850267,1288730.0\n3415,07/29/2011,00:00,1289000,1305500,1283600,1290500,259846955,1275720.0\n3416,08/01/2011,00:00,1309500,1309600,1275300,1287100,282573772,1271210.0\n3417,08/02/2011,00:00,1277700,1285000,1254900,1254900,277202501,1253010.0\n3418,08/03/2011,00:00,1256600,1263100,1235300,1262100,330037238,1244860.0\n3419,08/04/2011,00:00,1244200,1246200,1200700,1201800,425131235,1198560.0\n3420,08/05/2011,00:00,1219000,1220700,1168700,1199800,563324602,1172830.0\n3421,08/08/2011,00:00,1169800,1183500,1120200,1122600,575520736,1110170.0\n3422,08/09/2011,00:00,1142500,1174900,1102700,1173700,488407780,1115200.0\n3423,08/10/2011,00:00,1151800,1162800,1119600,1123500,437511075,1109470.0\n3424,08/11/2011,00:00,1134500,1189200,1128500,1172800,370920501,1142550.0\n3425,08/12/2011,00:00,1185500,1192100,1172800,1181500,268509211,1189890.0\n3426,08/15/2011,00:00,1192400,1207400,1190000,1205500,212752002,1207880.0\n3427,08/16/2011,00:00,1193400,1206900,1183100,1195600,244497729,1228850.0\n3428,08/17/2011,00:00,1203100,1211900,1187200,1196700,208918724,1208990.0\n3429,08/18/2011,00:00,1165000,1166400,1133900,1146100,425616854,1161200.0\n3430,08/19/2011,00:00,1129100,1158800,1125000,1126800,356095922,1112070.0\n3431,08/22/2011,00:00,1151200,1152300,1124100,1127300,242458988,1096550.0\n3432,08/23/2011,00:00,1131700,1165400,1125800,1164600,281355605,1127400.0\n3433,08/24/2011,00:00,1161800,1182400,1159300,1181300,207713990,1181680.0\n3434,08/25/2011,00:00,1188000,1194000,1158700,1163100,257738746,1190600.0\n3435,08/26/2011,00:00,1156600,1185100,1138600,1180400,270142650,1194750.0\n3436,08/29/2011,00:00,1195200,1214200,1194400,1213800,161544072,1209890.0\n3437,08/30/2011,00:00,1208600,1224300,1192600,1216200,211257778,1227110.0\n3438,08/31/2011,00:00,1224800,1235100,1213000,1220600,245536971,1244060.0\n3439,09/01/2011,00:00,1222500,1234000,1207800,1209600,224361524,1227680.0\n3440,09/02/2011,00:00,1184700,1190700,1174300,1178400,203457102,1184500.0\n3441,09/06/2011,00:00,1144300,1171600,1143800,1169900,246122470,1158500.0\n3442,09/07/2011,00:00,1188500,1203300,1183700,1202700,179440332,1173590.0\n3443,09/08/2011,00:00,1195900,1209300,1187800,1190200,217993064,1185810.0\n3444,09/09/2011,00:00,1176800,1181000,1152800,1158600,324360564,1174170.0\n3445,09/12/2011,00:00,1144900,1167600,1140500,1166600,266243906,1162390.0\n3446,09/13/2011,00:00,1170800,1181800,1162200,1175800,233871130,1155560.0\n3447,09/14/2011,00:00,1183200,1207800,1167200,1193600,262265087,1184160.0\n3448,09/15/2011,00:00,1205500,1214700,1195700,1214700,249832457,1223620.0\n3449,09/16/2011,00:00,1213100,1219500,1203200,1215800,241561427,1234490.0\n3450,09/19/2011,00:00,1195600,1209300,1187200,1203100,203129673,1223640.0\n3451,09/20/2011,00:00,1208300,1219900,1200100,1201700,197070638,1207160.0\n3452,09/21/2011,00:00,1202600,1205900,1165000,1165100,265304249,1166090.0\n3453,09/22/2011,00:00,1132800,1142100,1113000,1128000,421358975,1118660.0\n3454,09/23/2011,00:00,1121600,1141600,1120200,1135400,256734677,1103930.0\n3455,09/26/2011,00:00,1146400,1164000,1129800,1162500,239547138,1126110.0\n3456,09/27/2011,00:00,1185300,1195600,1168400,1176000,256192520,1170290.0\n3457,09/28/2011,00:00,1178300,1184800,1149700,1151600,259939999,1177040.0\n3458,09/29/2011,00:00,1171200,1176300,1139400,1160200,269136509,1168750.0\n3459,09/30/2011,00:00,1144500,1154400,1130800,1131700,248418973,1133180.0\n3460,10/03/2011,00:00,1125000,1139500,1098200,1099300,311460260,1091770.0\n3461,10/04/2011,00:00,1084300,1125800,1074300,1121300,417972274,1096370.0\n3462,10/05/2011,00:00,1125900,1147200,1115800,1145000,256163233,1119260.0\n3463,10/06/2011,00:00,1143500,1166600,1135200,1165100,227492632,1166230.0\n3464,10/07/2011,00:00,1171600,1172500,1150600,1157500,248676622,1185700.0\n3465,10/10/2011,00:00,1177200,1195900,1176700,1195900,198271905,1205470.0\n3466,10/11/2011,00:00,1188500,1200400,1187500,1196800,178972455,1212380.0\n3467,10/12/2011,00:00,1206000,1221300,1203300,1206700,242813965,1221150.0\n3468,10/13/2011,00:00,1200300,1208700,1191200,1204700,195568141,1223880.0\n3469,10/14/2011,00:00,1218600,1225800,1212300,1225600,172262036,1226130.0\n3470,10/17/2011,00:00,1219900,1220600,1199300,1202400,171627600,1216270.0\n3471,10/18/2011,00:00,1200800,1235000,1192000,1226100,268361142,1224050.0\n3472,10/19/2011,00:00,1223300,1230800,1207200,1211400,214042358,1218210.0\n3473,10/20/2011,00:00,1213600,1220900,1198200,1216900,237363342,1213960.0\n3474,10/21/2011,00:00,1230700,1241200,1227200,1239100,235785897,1238440.0\n3475,10/24/2011,00:00,1241400,1258000,1240600,1254900,183187923,1255270.0\n3476,10/25/2011,00:00,1249300,1249400,1227800,1230800,251450068,1253660.0\n3477,10/26/2011,00:00,1243500,1247700,1222100,1243300,269728092,1250350.0\n3478,10/27/2011,00:00,1277000,1294200,1266100,1285300,311523237,1274920.0\n3479,10/28/2011,00:00,1279800,1288500,1278000,1286800,195357919,1295710.0\n3480,10/31/2011,00:00,1272300,1272600,1253600,1254500,196077055,1287410.0\n3481,11/01/2011,00:00,1220000,1235100,1215200,1220800,327694121,1235400.0\n3482,11/02/2011,00:00,1238800,1244000,1228000,1239900,223203130,1210420.0\n3483,11/03/2011,00:00,1253100,1265000,1236000,1262400,250528531,1233860.0\n3484,11/04/2011,00:00,1252300,1257000,1240100,1254500,222714743,1258900.0\n3485,11/07/2011,00:00,1254300,1263900,1242000,1262800,190854662,1277660.0\n3486,11/08/2011,00:00,1269300,1280200,1257100,1278600,198356191,1282980.0\n3487,11/09/2011,00:00,1249100,1254600,1228700,1231900,258953226,1246970.0\n3488,11/10/2011,00:00,1248000,1249400,1230200,1243200,212759650,1238150.0\n3489,11/11/2011,00:00,1258600,1269900,1258000,1266200,160894568,1247960.0\n3490,11/14/2011,00:00,1262100,1263500,1249200,1254600,132357162,1250790.0\n3491,11/15/2011,00:00,1251200,1267500,1247200,1261200,161096614,1272420.0\n3492,11/16/2011,00:00,1248100,1263400,1239000,1240500,208022997,1250020.0\n3493,11/17/2011,00:00,1238400,1241600,1212300,1221800,289968098,1217990.0\n3494,11/18/2011,00:00,1224600,1227500,1214700,1219900,194731409,1206960.0\n3495,11/21/2011,00:00,1202100,1203400,1186600,1196200,196378704,1182740.0\n3496,11/22/2011,00:00,1193900,1201000,1185300,1191900,211395413,1177220.0\n3497,11/23/2011,00:00,1180700,1182000,1165600,1165600,187557531,1156960.0\n3498,11/25/2011,00:00,1163800,1177000,1162000,1162000,82609855,1143200.0\n3499,11/28/2011,00:00,1195300,1201800,1188200,1197000,187351680,1174050.0\n3500,11/29/2011,00:00,1200900,1208600,1196100,1200800,179062421,1198220.0\n3501,11/30/2011,00:00,1235000,1252200,1232200,1251100,251880591,1258240.0\n3502,12/01/2011,00:00,1248500,1256400,1244300,1249800,159154203,1281050.0\n3503,12/02/2011,00:00,1261400,1265000,1247800,1248600,177337985,1275120.0\n3504,12/05/2011,00:00,1268000,1271800,1254500,1262100,162251741,1278510.0\n3505,12/06/2011,00:00,1261700,1271100,1257600,1262600,131839611,1265430.0\n3506,12/07/2011,00:00,1258400,1272600,1249700,1267500,198050354,1272940.0\n3507,12/08/2011,00:00,1258800,1261800,1236500,1239800,209396519,1252460.0\n3508,12/09/2011,00:00,1245200,1263700,1244100,1260300,165468493,1250540.0\n3509,12/12/2011,00:00,1249100,1249700,1231600,1242400,178947251,1240240.0\n3510,12/13/2011,00:00,1249000,1255700,1224500,1231100,208440687,1227160.0\n3511,12/14/2011,00:00,1225900,1230200,1214700,1217100,209648393,1215760.0\n3512,12/15/2011,00:00,1231200,1232000,1219900,1221500,165196209,1203610.0\n3513,12/16/2011,00:00,1222100,1229500,1213000,1215700,176091223,1206660.0\n3514,12/19/2011,00:00,1220600,1223200,1200300,1203200,155423430,1200560.0\n3515,12/20/2011,00:00,1222300,1241400,1221700,1238800,174072018,1226790.0\n3516,12/21/2011,00:00,1239400,1243600,1227500,1241700,172629737,1243230.0\n3517,12/22/2011,00:00,1246400,1253900,1243600,1253300,107292214,1264650.0\n3518,12/23/2011,00:00,1256400,1264300,1254100,1263900,70389081,1280950.0\n3519,12/27/2011,00:00,1261500,1268200,1260600,1264900,67901152,1274840.0\n3520,12/28/2011,00:00,1265300,1265300,1247300,1249200,99876424,1262580.0\n3521,12/29/2011,00:00,1252100,1262500,1251800,1261000,92793923,1258670.0\n3522,12/30/2011,00:00,1259900,1263300,1255000,1255000,68634754,1252290.0\n3523,01/03/2012,00:00,1277500,1283800,1274400,1274900,153839622,1268740.0\n3524,01/04/2012,00:00,1271800,1278100,1267200,1276300,97719637,1283710.0\n3525,01/05/2012,00:00,1270100,1282300,1264300,1281000,125717608,1288030.0\n3526,01/06/2012,00:00,1282200,1282200,1272900,1278200,107707317,1288830.0\n3527,01/09/2012,00:00,1280400,1281800,1274100,1279900,73574543,1281630.0\n3528,01/10/2012,00:00,1293700,1296500,1289500,1291300,89928567,1290010.0\n3529,01/11/2012,00:00,1287500,1293700,1285200,1292500,89885776,1295410.0\n3530,01/12/2012,00:00,1295400,1297000,1285400,1295100,90072240,1301320.0\n3531,01/13/2012,00:00,1286600,1290100,1277200,1290100,140555253,1297040.0\n3532,01/17/2012,00:00,1301000,1303200,1290600,1293100,100741169,1292780.0\n3533,01/18/2012,00:00,1293500,1308400,1290800,1308000,121911064,1304460.0\n3534,01/19/2012,00:00,1312400,1315700,1308100,1314800,94452469,1317410.0\n3535,01/20/2012,00:00,1312300,1319500,1309200,1319500,92111257,1329250.0\n3536,01/23/2012,00:00,1315000,1322500,1309800,1315800,104367886,1327310.0\n3537,01/24/2012,00:00,1307700,1315000,1306000,1314600,80446736,1318800.0\n3538,01/25/2012,00:00,1312400,1328700,1307500,1325700,142742589,1323150.0\n3539,01/26/2012,00:00,1331500,1334000,1313700,1319000,136612555,1321590.0\n3540,01/27/2012,00:00,1311500,1320500,1311500,1317300,103843754,1320700.0\n3541,01/30/2012,00:00,1305000,1314400,1300600,1313800,111244083,1315080.0\n3542,01/31/2012,00:00,1320200,1321800,1306800,1312100,123069314,1307860.0\n3543,02/01/2012,00:00,1323100,1331400,1321300,1324700,123870829,1319240.0\n3544,02/02/2012,00:00,1327500,1330200,1322100,1326800,87353028,1327910.0\n3545,02/03/2012,00:00,1340300,1346200,1337700,1345700,108928852,1348170.0\n3546,02/06/2012,00:00,1339900,1345000,1338300,1344600,78933992,1356580.0\n3547,02/07/2012,00:00,1342000,1350200,1336400,1347900,105743604,1357200.0\n3548,02/08/2012,00:00,1348800,1352200,1343100,1351900,101030602,1359100.0\n3549,02/09/2012,00:00,1353900,1355800,1345700,1353400,115253050,1355510.0\n3550,02/10/2012,00:00,1341400,1344700,1338400,1344300,120730639,1349890.0\n3551,02/13/2012,00:00,1352900,1355200,1347400,1353600,90078617,1351360.0\n3552,02/14/2012,00:00,1349900,1352700,1342500,1351900,124259501,1351080.0\n3553,02/15/2012,00:00,1356400,1358300,1342900,1345400,151754087,1347200.0\n3554,02/16/2012,00:00,1345600,1361700,1343400,1360400,133245607,1358320.0\n3555,02/17/2012,00:00,1365200,1365700,1359600,1364100,96651581,1363930.0\n3556,02/21/2012,00:00,1367500,1370500,1360500,1364600,95051314,1370510.0\n3557,02/22/2012,00:00,1362000,1365500,1357900,1360200,95836135,1369080.0\n3558,02/23/2012,00:00,1359500,1367300,1355000,1366100,111498117,1365330.0\n3559,02/24/2012,00:00,1369500,1372000,1366300,1369300,85773667,1368430.0\n3560,02/27/2012,00:00,1360400,1375300,1358000,1371600,108707496,1373290.0\n3561,02/28/2012,00:00,1371900,1377200,1369300,1375600,98896749,1379450.0\n3562,02/29/2012,00:00,1377300,1381900,1367200,1368700,137944326,1373710.0\n3563,03/01/2012,00:00,1373200,1379900,1371200,1377700,110411453,1376750.0\n3564,03/02/2012,00:00,1376300,1378200,1370000,1373200,88920412,1374950.0\n3565,03/05/2012,00:00,1370500,1371900,1362800,1367500,96836494,1369030.0\n3566,03/06/2012,00:00,1352900,1354300,1343600,1346700,144814675,1350500.0\n3567,03/07/2012,00:00,1350600,1359100,1349300,1356900,103577541,1343970.0\n3568,03/08/2012,00:00,1365000,1373200,1362400,1370200,85876391,1357920.0\n3569,03/09/2012,00:00,1373600,1379300,1371300,1375700,91438907,1375370.0\n3570,03/12/2012,00:00,1375600,1377600,1370900,1375800,78786035,1388160.0\n3571,03/13/2012,00:00,1383800,1401200,1380900,1400600,158323337,1403740.0\n3572,03/14/2012,00:00,1400700,1404500,1394800,1399100,128829330,1409090.0\n3573,03/15/2012,00:00,1401200,1407800,1397600,1407200,137226098,1417570.0\n3574,03/16/2012,00:00,1403200,1404800,1400000,1402700,124840231,1415200.0\n3575,03/19/2012,00:00,1402000,1412800,1401100,1408800,109925153,1409680.0\n3576,03/20/2012,00:00,1400500,1406100,1396400,1404100,111240920,1407860.0\n3577,03/21/2012,00:00,1404600,1406500,1399200,1401600,108863774,1401940.0\n3578,03/22/2012,00:00,1391700,1395500,1387400,1391600,125466549,1392940.0\n3579,03/23/2012,00:00,1393700,1398100,1385500,1396900,92667075,1389710.0\n3580,03/26/2012,00:00,1406200,1416100,1406000,1416100,99701237,1407850.0\n3581,03/27/2012,00:00,1417400,1418300,1410800,1411300,92318657,1416670.0\n3582,03/28/2012,00:00,1410900,1413200,1396400,1404300,129945172,1415980.0\n3583,03/29/2012,00:00,1396200,1404200,1390900,1402200,149350733,1405800.0\n3584,03/30/2012,00:00,1409100,1410500,1400600,1407200,116418788,1400150.0\n3585,04/02/2012,00:00,1406400,1422100,1403700,1417900,124770859,1413410.0\n3586,04/03/2012,00:00,1416000,1418800,1404300,1412600,135974247,1418530.0\n3587,04/04/2012,00:00,1401700,1403300,1393400,1398400,136665920,1407000.0\n3588,04/05/2012,00:00,1394000,1402000,1392600,1397800,104649640,1395290.0\n3589,04/09/2012,00:00,1379400,1387800,1378400,1382300,102847154,1376000.0\n3590,04/10/2012,00:00,1379400,1383400,1357600,1358400,218274578,1352550.0\n3591,04/11/2012,00:00,1373300,1375400,1367500,1369000,132627770,1351720.0\n3592,04/12/2012,00:00,1371300,1389000,1370300,1388500,139019808,1369630.0\n3593,04/13/2012,00:00,1384600,1384800,1370100,1371300,139193450,1376330.0\n3594,04/16/2012,00:00,1378300,1380400,1365800,1369300,135725445,1378530.0\n3595,04/17/2012,00:00,1378600,1393600,1377000,1390900,120502872,1385180.0\n3596,04/18/2012,00:00,1384900,1390800,1383800,1385900,112671125,1385500.0\n3597,04/19/2012,00:00,1386000,1391400,1370700,1377500,183200752,1387680.0\n3598,04/20/2012,00:00,1382400,1388300,1378700,1379500,126288466,1382720.0\n3599,04/23/2012,00:00,1365500,1369100,1359400,1367900,143801646,1364620.0\n3600,04/24/2012,00:00,1368700,1376500,1368000,1373100,120700892,1366220.0\n3601,04/25/2012,00:00,1385600,1392500,1385300,1392400,133661106,1385100.0\n3602,04/26/2012,00:00,1389100,1403200,1388200,1401700,114664137,1403590.0\n3603,04/27/2012,00:00,1405600,1407800,1398000,1404200,104637129,1418220.0\n3604,04/30/2012,00:00,1401300,1402100,1394900,1397700,92165955,1412120.0\n3605,05/01/2012,00:00,1398100,1416600,1396300,1407400,115353699,1408480.0\n3606,05/02/2012,00:00,1399300,1404600,1394600,1402800,103011706,1404380.0\n3607,05/03/2012,00:00,1404000,1404500,1389900,1392500,123832837,1395430.0\n3608,05/04/2012,00:00,1385200,1386600,1369200,1369600,158063698,1372670.0\n3609,05/07/2012,00:00,1364800,1375600,1364700,1371000,108876105,1356860.0\n3610,05/08/2012,00:00,1363100,1367700,1349200,1365000,191348137,1351050.0\n3611,05/09/2012,00:00,1351000,1366000,1344900,1357400,201963421,1348660.0\n3612,05/10/2012,00:00,1367500,1368500,1357100,1359500,129264219,1354360.0\n3613,05/11/2012,00:00,1351600,1368700,1351100,1355600,135521665,1350810.0\n3614,05/14/2012,00:00,1343200,1350300,1339100,1341300,140800618,1341000.0\n3615,05/15/2012,00:00,1340500,1348100,1331300,1333500,177460833,1329660.0\n3616,05/16/2012,00:00,1339200,1345400,1328000,1328800,187878911,1318690.0\n3617,05/17/2012,00:00,1328800,1330200,1308100,1308700,212866150,1301690.0\n3618,05/18/2012,00:00,1314000,1316000,1295500,1297400,279229262,1288160.0\n3619,05/21/2012,00:00,1301400,1320200,1299500,1320200,148240929,1300320.0\n3620,05/22/2012,00:00,1323400,1332300,1313400,1322000,168227548,1314790.0\n3621,05/23/2012,00:00,1312600,1324600,1299900,1322700,190382180,1329980.0\n3622,05/24/2012,00:00,1326700,1328400,1314200,1325300,150009412,1335010.0\n3623,05/25/2012,00:00,1324800,1328500,1317800,1321000,117560211,1323710.0\n3624,05/29/2012,00:00,1331600,1339300,1327500,1337000,136971363,1334090.0\n3625,05/30/2012,00:00,1325900,1326200,1314900,1317300,137463079,1324930.0\n3626,05/31/2012,00:00,1317100,1324500,1303400,1314900,177358856,1315750.0\n3627,06/01/2012,00:00,1294100,1298500,1281600,1281600,204865682,1284090.0\n3628,06/04/2012,00:00,1284400,1287400,1271400,1281000,165707651,1262050.0\n3629,06/05/2012,00:00,1278800,1292600,1277900,1290300,142793334,1270650.0\n3630,06/06/2012,00:00,1299800,1320300,1299300,1320200,158440296,1303390.0\n3631,06/07/2012,00:00,1334900,1335300,1317800,1320500,161308954,1333820.0\n3632,06/08/2012,00:00,1317200,1331200,1312900,1331200,122247149,1347820.0\n3633,06/11/2012,00:00,1341900,1342500,1312800,1314500,147440040,1333160.0\n3634,06/12/2012,00:00,1318000,1330100,1311600,1330100,158037459,1327440.0\n3635,06/13/2012,00:00,1325000,1333600,1316200,1321000,156244332,1323430.0\n3636,06/14/2012,00:00,1323800,1340000,1319800,1335700,205109009,1331150.0\n3637,06/15/2012,00:00,1333500,1342600,1331100,1341000,140129470,1346040.0\n3638,06/18/2012,00:00,1335900,1347300,1332900,1344300,114237240,1348940.0\n3639,06/19/2012,00:00,1351300,1362500,1349300,1356900,123471677,1363900.0\n3640,06/20/2012,00:00,1357600,1361000,1344600,1354400,187408947,1362450.0\n3641,06/21/2012,00:00,1356700,1357800,1323300,1324400,183348690,1337270.0\n3642,06/22/2012,00:00,1331100,1337100,1326200,1334200,113139172,1327030.0\n3643,06/25/2012,00:00,1321000,1321000,1308500,1312600,127618191,1303860.0\n3644,06/26/2012,00:00,1316900,1323800,1309300,1320000,130178242,1304940.0\n3645,06/27/2012,00:00,1324000,1334300,1323100,1331700,93079408,1324700.0\n3646,06/28/2012,00:00,1323200,1329900,1312800,1327900,155144041,1327230.0\n3647,06/29/2012,00:00,1352400,1362700,1348500,1362700,171534507,1363410.0\n3648,07/02/2012,00:00,1365300,1366500,1355200,1364600,109683533,1377440.0\n3649,07/03/2012,00:00,1365100,1375100,1363400,1374700,71720585,1389130.0\n3650,07/05/2012,00:00,1369300,1374000,1362900,1368400,106181413,1387560.0\n3651,07/06/2012,00:00,1355600,1357600,1348500,1355900,122598176,1362320.0\n3652,07/09/2012,00:00,1354100,1355700,1347000,1353200,89161246,1350880.0\n3653,07/10/2012,00:00,1360800,1362300,1336800,1341400,136359914,1334180.0\n3654,07/11/2012,00:00,1342300,1346000,1333800,1341600,128650992,1331670.0\n3655,07/12/2012,00:00,1333900,1340900,1326000,1335100,129050301,1329480.0\n3656,07/13/2012,00:00,1338800,1358800,1338400,1357500,110927086,1346450.0\n3657,07/16/2012,00:00,1354200,1358300,1349000,1353900,82751324,1358170.0\n3658,07/17/2012,00:00,1360100,1366400,1345500,1363600,120755154,1369180.0\n3659,07/18/2012,00:00,1360200,1376400,1359600,1374100,101000531,1382070.0\n3660,07/19/2012,00:00,1376300,1381800,1372100,1377400,115912986,1383300.0\n3661,07/20/2012,00:00,1369800,1371600,1363200,1364700,124504674,1377360.0\n3662,07/23/2012,00:00,1344500,1354600,1338500,1350900,118466395,1355700.0\n3663,07/24/2012,00:00,1352000,1352500,1330300,1340300,145582265,1333250.0\n3664,07/25/2012,00:00,1342600,1345600,1332500,1339500,103594503,1324500.0\n3665,07/26/2012,00:00,1359100,1364600,1352600,1361700,125654874,1346200.0\n3666,07/27/2012,00:00,1369100,1390700,1366500,1388000,186380497,1384760.0\n3667,07/30/2012,00:00,1385700,1393300,1382700,1386800,94642715,1405710.0\n3668,07/31/2012,00:00,1385100,1388700,1377100,1377100,101993870,1400710.0\n3669,08/01/2012,00:00,1387200,1387300,1374000,1375900,120308711,1383150.0\n3670,08/02/2012,00:00,1365400,1375600,1355900,1366400,162944408,1362610.0\n3671,08/03/2012,00:00,1386000,1396400,1385000,1393900,125877370,1381070.0\n3672,08/06/2012,00:00,1397000,1401700,1395600,1396200,73331353,1398760.0\n3673,08/07/2012,00:00,1402000,1409200,1401500,1403200,91323457,1412440.0\n3674,08/08/2012,00:00,1398200,1406400,1398100,1404900,77895539,1418810.0\n3675,08/09/2012,00:00,1403000,1408900,1401500,1406300,78981598,1410950.0\n3676,08/10/2012,00:00,1400700,1408900,1398100,1408400,91051646,1412050.0\n3677,08/13/2012,00:00,1406000,1408400,1400400,1407700,71864462,1409850.0\n3678,08/14/2012,00:00,1412800,1413800,1403700,1407900,85796080,1409260.0\n3679,08/15/2012,00:00,1406400,1411900,1405500,1409500,63862368,1409730.0\n3680,08/16/2012,00:00,1410900,1421600,1408000,1420100,94540455,1418280.0\n3681,08/17/2012,00:00,1422500,1423000,1418600,1422200,77899419,1425840.0\n3682,08/20/2012,00:00,1420100,1422200,1416000,1422200,65230362,1428770.0\n3683,08/21/2012,00:00,1425200,1430900,1414500,1417600,91504684,1423810.0\n3684,08/22/2012,00:00,1413800,1420500,1410700,1418200,113612822,1417540.0\n3685,08/23/2012,00:00,1414500,1414800,1404400,1406800,98981571,1406960.0\n3686,08/24/2012,00:00,1403000,1418100,1402200,1415200,84633688,1408560.0\n3687,08/27/2012,00:00,1419000,1420800,1413400,1415400,59637252,1412420.0\n3688,08/28/2012,00:00,1411700,1418400,1409700,1414000,67508199,1413980.0\n3689,08/29/2012,00:00,1414800,1418900,1411200,1415100,60586630,1417920.0\n3690,08/30/2012,00:00,1409000,1409400,1401900,1404900,87670205,1406650.0\n3691,08/31/2012,00:00,1413200,1418200,1403600,1412400,130393446,1407830.0\n3692,09/04/2012,00:00,1410900,1414600,1401300,1408700,101328393,1407030.0\n3693,09/05/2012,00:00,1411000,1414700,1406300,1409400,84134821,1407820.0\n3694,09/06/2012,00:00,1417900,1437800,1417600,1437800,131300165,1433480.0\n3695,09/07/2012,00:00,1440200,1443900,1438800,1443900,82439521,1450070.0\n3696,09/10/2012,00:00,1442100,1444400,1434600,1435100,72407250,1453170.0\n3697,09/11/2012,00:00,1436300,1443700,1435600,1438900,71392996,1449910.0\n3698,09/12/2012,00:00,1443800,1445500,1439000,1443900,76655733,1442080.0\n3699,09/13/2012,00:00,1443300,1470400,1441500,1467000,176699165,1462260.0\n3700,09/14/2012,00:00,1468900,1481100,1467600,1472400,149771595,1482270.0\n3701,09/17/2012,00:00,1469500,1471900,1463700,1467400,93464487,1483570.0\n3702,09/18/2012,00:00,1465300,1468100,1462500,1466200,81839586,1476880.0\n3703,09/19/2012,00:00,1467600,1471700,1464100,1467400,97491385,1466460.0\n3704,09/20/2012,00:00,1460000,1467900,1456300,1467500,126125706,1465240.0\n3705,09/21/2012,00:00,1466400,1470000,1458100,1458900,92863680,1460770.0\n3706,09/24/2012,00:00,1451600,1459800,1450500,1455900,81529919,1454450.0\n3707,09/25/2012,00:00,1459600,1462400,1440600,1441900,116957213,1439540.0\n3708,09/26/2012,00:00,1441100,1441100,1429600,1432900,128852225,1425560.0\n3709,09/27/2012,00:00,1438800,1449700,1435100,1447200,96575805,1433440.0\n3710,09/28/2012,00:00,1440100,1445500,1434600,1439300,127590894,1435070.0\n3711,10/01/2012,00:00,1445000,1456900,1440200,1442400,120196114,1442960.0\n3712,10/02/2012,00:00,1449000,1451500,1438300,1445000,102440134,1447180.0\n3713,10/03/2012,00:00,1448800,1454300,1441300,1450700,104035525,1448730.0\n3714,10/04/2012,00:00,1456300,1463300,1454400,1462700,110972345,1464550.0\n3715,10/05/2012,00:00,1469200,1471500,1457000,1461300,102439846,1469070.0\n3716,10/08/2012,00:00,1455800,1458900,1453100,1456600,70711413,1465400.0\n3717,10/09/2012,00:00,1455200,1456400,1441500,1442500,133493925,1448010.0\n3718,10/10/2012,00:00,1442000,1443200,1430900,1432800,112051156,1427600.0\n3719,10/11/2012,00:00,1442800,1444900,1433600,1433600,104250608,1421600.0\n3720,10/12/2012,00:00,1434400,1439500,1425900,1428400,106195956,1419190.0\n3721,10/15/2012,00:00,1432300,1442300,1427700,1440100,89763067,1432720.0\n3722,10/16/2012,00:00,1447600,1456400,1446600,1455800,93647156,1453890.0\n3723,10/17/2012,00:00,1456300,1463200,1454200,1461600,97927398,1468920.0\n3724,10/18/2012,00:00,1458500,1465200,1453300,1458600,126316151,1473470.0\n3725,10/19/2012,00:00,1455000,1455600,1430500,1433000,161433193,1446400.0\n3726,10/22/2012,00:00,1432000,1436700,1422800,1434100,112027680,1427020.0\n3727,10/23/2012,00:00,1418800,1420600,1408300,1413500,166634827,1403950.0\n3728,10/24/2012,00:00,1419400,1421000,1408000,1410500,101447368,1395230.0\n3729,10/25/2012,00:00,1420700,1422800,1405700,1414300,114919471,1402780.0\n3730,10/26/2012,00:00,1413200,1418400,1403900,1413500,118933565,1405060.0\n3731,10/31/2012,00:00,1418400,1420300,1406800,1411800,85205741,1412600.0\n3732,11/01/2012,00:00,1416600,1430100,1415200,1429100,89011864,1426250.0\n3733,11/02/2012,00:00,1437200,1437200,1414100,1415600,113381608,1422320.0\n3734,11/05/2012,00:00,1413700,1421700,1409300,1419000,85689537,1422240.0\n3735,11/06/2012,00:00,1422700,1435200,1421300,1429300,92986054,1428430.0\n3736,11/07/2012,00:00,1416500,1416800,1390700,1397800,225343099,1403490.0\n3737,11/08/2012,00:00,1397200,1404100,1379500,1379500,157175132,1380220.0\n3738,11/09/2012,00:00,1376100,1394400,1375600,1381600,176223379,1364060.0\n3739,11/12/2012,00:00,1385500,1388100,1379600,1382400,86603151,1361120.0\n3740,11/13/2012,00:00,1375200,1392500,1373600,1378000,109828367,1372850.0\n3741,11/14/2012,00:00,1382100,1384300,1356200,1359800,169918714,1363360.0\n3742,11/15/2012,00:00,1359500,1364900,1351800,1357000,160925393,1350220.0\n3743,11/16/2012,00:00,1359200,1366400,1347000,1363500,213614223,1350500.0\n3744,11/19/2012,00:00,1379200,1391500,1378300,1391500,125631368,1379170.0\n3745,11/20/2012,00:00,1388900,1394200,1380800,1392800,99716218,1403070.0\n3746,11/21/2012,00:00,1393100,1395700,1390300,1394500,66253719,1411150.0\n3747,11/23/2012,00:00,1401400,1414000,1400400,1413300,53475754,1421900.0\n3748,11/26/2012,00:00,1406900,1411700,1401900,1411700,86491321,1419030.0\n3749,11/27/2012,00:00,1409100,1413800,1402400,1403800,113949581,1414980.0\n3750,11/28/2012,00:00,1397700,1415400,1390000,1414800,153889115,1416950.0\n3751,11/29/2012,00:00,1420200,1425000,1413700,1421600,132400376,1418950.0\n3752,11/30/2012,00:00,1421700,1424200,1416700,1420600,115188920,1425180.0\n3753,12/03/2012,00:00,1428100,1429200,1413400,1414700,103003304,1423380.0\n3754,12/04/2012,00:00,1414400,1418700,1408700,1412200,110768908,1413150.0\n3755,12/05/2012,00:00,1414100,1421600,1403800,1415000,134509723,1410340.0\n3756,12/06/2012,00:00,1413700,1420400,1411600,1419100,81136204,1415510.0\n3757,12/07/2012,00:00,1425200,1426900,1416700,1424000,89962391,1424650.0\n3758,12/10/2012,00:00,1422200,1428100,1421500,1425200,77982728,1429600.0\n3759,12/11/2012,00:00,1430700,1441100,1429900,1434200,120603702,1436850.0\n3760,12/12/2012,00:00,1440100,1445500,1433100,1435400,120477188,1440420.0\n3761,12/13/2012,00:00,1434400,1438300,1422800,1426600,112947114,1433700.0\n3762,12/14/2012,00:00,1423200,1425800,1418800,1421200,104037074,1423840.0\n3763,12/17/2012,00:00,1425000,1438500,1424300,1437900,111442822,1429020.0\n3764,12/18/2012,00:00,1440000,1455000,1437900,1454100,145326291,1449650.0\n3765,12/19/2012,00:00,1455500,1455800,1442400,1442700,128974934,1456030.0\n3766,12/20/2012,00:00,1443600,1451400,1439900,1451400,111467367,1461020.0\n3767,12/21/2012,00:00,1422000,1431000,1419400,1427700,177975926,1435830.0\n3768,12/24/2012,00:00,1424500,1425600,1421900,1423300,38187479,1416860.0\n3769,12/26/2012,00:00,1426200,1427100,1413500,1416500,84610171,1408170.0\n3770,12/27/2012,00:00,1417500,1420700,1399200,1415900,153336787,1402300.0\n3771,12/28/2012,00:00,1406500,1414200,1398700,1398700,118554490,1396800.0\n3772,12/31/2012,00:00,1397200,1425600,1395400,1425200,207656929,1411720.0\n3773,01/02/2013,00:00,1452800,1461500,1447300,1461500,154762124,1453350.0\n3774,01/03/2013,00:00,1459900,1463700,1453400,1457300,125860852,1475400.0\n3775,01/04/2013,00:00,1459700,1466100,1456700,1464500,95968674,1490550.0\n3776,01/07/2013,00:00,1458700,1461100,1454300,1459200,82356729,1474840.0\n3777,01/08/2013,00:00,1457200,1459100,1449800,1455300,96448983,1456410.0\n3778,01/09/2013,00:00,1458900,1463200,1456400,1459900,76541810,1458040.0\n3779,01/10/2013,00:00,1467200,1470900,1459700,1470700,104550895,1465850.0\n3780,01/11/2013,00:00,1470600,1471500,1466100,1470700,78613039,1474680.0\n3781,01/14/2013,00:00,1468900,1470700,1464300,1469600,76595746,1477060.0\n3782,01/15/2013,00:00,1462900,1472100,1462000,1470700,76588670,1474470.0\n3783,01/16/2013,00:00,1467800,1472800,1466100,1470500,82147565,1470320.0\n3784,01/17/2013,00:00,1476600,1484200,1474300,1479700,105543278,1477910.0\n3785,01/18/2013,00:00,1480000,1484900,1474300,1483300,143478816,1485680.0\n3786,01/22/2013,00:00,1483400,1491300,1479800,1491000,85902251,1495060.0\n3787,01/23/2013,00:00,1491200,1494900,1488600,1493700,78754801,1500950.0\n3788,01/24/2013,00:00,1491200,1501400,1490100,1494200,117043379,1500200.0\n3789,01/25/2013,00:00,1498800,1502500,1494600,1502500,106824958,1505420.0\n3790,01/28/2013,00:00,1503300,1503300,1495100,1500700,93917764,1504880.0\n3791,01/29/2013,00:00,1497800,1508500,1496700,1506600,90136030,1509230.0\n3792,01/30/2013,00:00,1506400,1509300,1499300,1500800,107211861,1506150.0\n3793,01/31/2013,00:00,1499300,1503800,1496000,1497000,92861090,1498250.0\n3794,02/01/2013,00:00,1506600,1514100,1503900,1512800,107936504,1507960.0\n3795,02/04/2013,00:00,1503100,1505800,1494300,1495300,121333979,1499320.0\n3796,02/05/2013,00:00,1503600,1514800,1502900,1510800,100432126,1508830.0\n3797,02/06/2013,00:00,1505300,1512600,1504100,1511800,112965414,1513820.0\n3798,02/07/2013,00:00,1512100,1513500,1498700,1509600,134829859,1511090.0\n3799,02/08/2013,00:00,1512400,1518900,1512200,1518000,81972911,1522360.0\n3800,02/11/2013,00:00,1517600,1519000,1514000,1517700,56652554,1519580.0\n3801,02/12/2013,00:00,1517800,1523000,1516100,1520000,56302742,1522770.0\n3802,02/13/2013,00:00,1523200,1526100,1517200,1521500,73581411,1525100.0\n3803,02/14/2013,00:00,1517100,1524700,1515200,1523100,60435268,1524260.0\n3804,02/15/2013,00:00,1524300,1525900,1515500,1521700,188245249,1524130.0\n3805,02/19/2013,00:00,1523800,1532800,1523600,1532000,74071874,1530920.0\n3806,02/20/2013,00:00,1531000,1531900,1512600,1512600,139347892,1519510.0\n3807,02/21/2013,00:00,1509000,1509600,1499400,1504000,145971241,1504490.0\n3808,02/22/2013,00:00,1511400,1518900,1507700,1518900,89396944,1507760.0\n3809,02/25/2013,00:00,1526000,1528600,1490000,1490100,179800584,1488270.0\n3810,02/26/2013,00:00,1497000,1501900,1487300,1500200,171479227,1493550.0\n3811,02/27/2013,00:00,1498900,1523300,1497700,1519100,119804636,1509910.0\n3812,02/28/2013,00:00,1518700,1528700,1515300,1515300,102964805,1515260.0\n3813,03/01/2013,00:00,1510900,1523400,1504200,1521100,143240616,1532290.0\n3814,03/04/2013,00:00,1517600,1529200,1515200,1529200,82972461,1534980.0\n3815,03/05/2013,00:00,1536500,1547000,1536400,1542900,104395367,1543970.0\n3816,03/06/2013,00:00,1548300,1549200,1541600,1545000,83236231,1555060.0\n3817,03/07/2013,00:00,1546900,1549800,1545200,1548200,63019696,1558280.0\n3818,03/08/2013,00:00,1554700,1556400,1546600,1554400,97289907,1560650.0\n3819,03/11/2013,00:00,1553500,1560400,1551400,1560300,63325768,1563420.0\n3820,03/12/2013,00:00,1559300,1561000,1552200,1556400,92466418,1563330.0\n3821,03/13/2013,00:00,1557500,1561200,1552400,1558400,75940737,1562260.0\n3822,03/14/2013,00:00,1563100,1568000,1562200,1567300,104114468,1566530.0\n3823,03/15/2013,00:00,1558700,1560400,1553100,1558800,105586093,1562610.0\n3824,03/18/2013,00:00,1542900,1556400,1542000,1549700,110246166,1554220.0\n3825,03/19/2013,00:00,1552900,1555100,1535900,1546100,149589016,1543400.0\n3826,03/20/2013,00:00,1555100,1559500,1552600,1556300,95297590,1545230.0\n3827,03/21/2013,00:00,1547900,1553100,1541000,1543400,115911436,1543600.0\n3828,03/22/2013,00:00,1548500,1556000,1547300,1556000,91810945,1553270.0\n3829,03/25/2013,00:00,1559900,1562700,1543500,1550700,131779376,1553170.0\n3830,03/26/2013,00:00,1556000,1562200,1554200,1561500,75820229,1558890.0\n3831,03/27/2013,00:00,1552700,1562500,1550000,1561600,89094609,1567210.0\n3832,03/28/2013,00:00,1561300,1568500,1558500,1565500,83562253,1568030.0\n3833,04/01/2013,00:00,1566000,1569100,1556800,1560500,82034908,1567040.0\n3834,04/02/2013,00:00,1565900,1572100,1563700,1568200,89338807,1567150.0\n3835,04/03/2013,00:00,1569200,1570300,1548200,1551500,138206759,1556210.0\n3836,04/04/2013,00:00,1554300,1561700,1550900,1558500,108461458,1553940.0\n3837,04/05/2013,00:00,1539800,1553500,1537700,1551800,132353586,1549970.0\n3838,04/08/2013,00:00,1552500,1562200,1547600,1562100,75492357,1554850.0\n3839,04/09/2013,00:00,1564800,1573200,1559800,1567500,91965576,1568960.0\n3840,04/10/2013,00:00,1571700,1588700,1571300,1587300,114994657,1587430.0\n3841,04/11/2013,00:00,1586900,1597100,1585400,1592200,94630689,1603980.0\n3842,04/12/2013,00:00,1587100,1590400,1579200,1587800,100708097,1602210.0\n3843,04/15/2013,00:00,1580200,1581300,1551200,1551700,186156530,1567970.0\n3844,04/16/2013,00:00,1563200,1574900,1559100,1574200,126446312,1558630.0\n3845,04/17/2013,00:00,1563100,1563200,1542800,1550400,198134784,1542100.0\n3846,04/18/2013,00:00,1553300,1554100,1535500,1541400,148855136,1532870.0\n3847,04/19/2013,00:00,1544400,1555500,1541200,1554800,123372939,1546520.0\n3848,04/22/2013,00:00,1557800,1565400,1547500,1562000,90989989,1550560.0\n3849,04/23/2013,00:00,1569600,1579300,1561800,1577900,120401270,1579980.0\n3850,04/24/2013,00:00,1578200,1582900,1575400,1579000,81172344,1592510.0\n3851,04/25/2013,00:00,1582500,1592700,1581000,1586100,113027663,1595840.0\n3852,04/26/2013,00:00,1583400,1586000,1577300,1582600,83462024,1592340.0\n3853,04/29/2013,00:00,1586500,1596500,1584200,1593000,79783650,1593860.0\n3854,04/30/2013,00:00,1592900,1597200,1586100,1596800,101793690,1600250.0\n3855,05/01/2013,00:00,1593200,1594100,1581000,1583200,111301363,1590860.0\n3856,05/02/2013,00:00,1586700,1598900,1585300,1597200,82810536,1596380.0\n3857,05/03/2013,00:00,1611300,1618800,1610400,1613200,115367824,1608920.0\n3858,05/06/2013,00:00,1614600,1620100,1614200,1617800,58439339,1623240.0\n3859,05/07/2013,00:00,1620900,1626500,1616700,1626300,80144043,1639580.0\n3860,05/08/2013,00:00,1624200,1633900,1623300,1633400,83868841,1643230.0\n3861,05/09/2013,00:00,1632900,1637000,1624700,1629300,94159930,1638340.0\n3862,05/10/2013,00:00,1630300,1634900,1625100,1634100,91107266,1638860.0\n3863,05/13/2013,00:00,1632300,1638100,1628200,1635400,71774035,1637370.0\n3864,05/14/2013,00:00,1637200,1653500,1636700,1652800,91589504,1650470.0\n3865,05/15/2013,00:00,1650100,1664500,1649100,1661500,104178214,1667550.0\n3866,05/16/2013,00:00,1657900,1663600,1651100,1653400,99638286,1666850.0\n3867,05/17/2013,00:00,1659700,1670400,1657400,1669700,106565142,1675320.0\n3868,05/20/2013,00:00,1668100,1675800,1666100,1669700,78535046,1674020.0\n3869,05/21/2013,00:00,1670900,1678000,1665000,1671100,82655513,1675730.0\n3870,05/22/2013,00:00,1673400,1690700,1651700,1659200,207803061,1668520.0\n3871,05/23/2013,00:00,1642000,1659100,1639400,1654500,184821919,1652570.0\n3872,05/24/2013,00:00,1644800,1653300,1639800,1653300,116703919,1646740.0\n3873,05/28/2013,00:00,1670900,1677800,1658100,1663000,127445547,1653590.0\n3874,05/29/2013,00:00,1654100,1658000,1643400,1652200,146895581,1654790.0\n3875,05/30/2013,00:00,1653800,1665900,1652300,1658900,96487592,1658690.0\n3876,05/31/2013,00:00,1653600,1663100,1632400,1632400,137865958,1638190.0\n3877,06/03/2013,00:00,1638800,1644600,1626600,1643800,146747874,1632600.0\n3878,06/04/2013,00:00,1644300,1651000,1627300,1635600,140302603,1630090.0\n3879,06/05/2013,00:00,1631000,1634200,1611300,1611800,183592216,1609200.0\n3880,06/06/2013,00:00,1611900,1627400,1602500,1626400,168748465,1616800.0\n3881,06/07/2013,00:00,1638300,1649500,1631400,1648100,146431212,1632960.0\n3882,06/10/2013,00:00,1653000,1654000,1643800,1648000,83501459,1652310.0\n3883,06/11/2013,00:00,1632700,1645400,1627400,1631200,136509220,1651220.0\n3884,06/12/2013,00:00,1642300,1643800,1616000,1617500,152312512,1623830.0\n3885,06/13/2013,00:00,1616500,1645000,1613000,1642200,134784614,1624710.0\n3886,06/14/2013,00:00,1640300,1646600,1629100,1631700,113390558,1627640.0\n3887,06/17/2013,00:00,1643000,1652200,1635500,1645000,117546027,1646060.0\n3888,06/18/2013,00:00,1645600,1659900,1645200,1656900,89587973,1663140.0\n3889,06/19/2013,00:00,1656100,1658900,1633800,1635400,169087146,1645720.0\n3890,06/20/2013,00:00,1618700,1621000,1589800,1592700,271644171,1606060.0\n3891,06/21/2013,00:00,1596200,1597600,1574800,1590500,232959955,1572140.0\n3892,06/24/2013,00:00,1574100,1584300,1557300,1569900,201603786,1543410.0\n3893,06/25/2013,00:00,1585200,1591700,1574300,1586500,140715013,1558820.0\n3894,06/26/2013,00:00,1599300,1605000,1592600,1601700,120215759,1592460.0\n3895,06/27/2013,00:00,1611500,1618200,1609500,1611300,119294686,1614000.0\n3896,06/28/2013,00:00,1606500,1614000,1598600,1600100,130109066,1619460.0\n3897,07/01/2013,00:00,1612800,1624800,1610800,1614000,114653012,1618740.0\n3898,07/02/2013,00:00,1610900,1623000,1605000,1611600,119553837,1614490.0\n3899,07/03/2013,00:00,1605100,1617600,1602200,1613400,59696858,1614790.0\n3900,07/05/2013,00:00,1625300,1630800,1613000,1630500,97439875,1631980.0\n3901,07/08/2013,00:00,1639200,1643900,1635800,1639400,90672202,1642690.0\n3902,07/09/2013,00:00,1650000,1653300,1642700,1650800,106757402,1660460.0\n3903,07/10/2013,00:00,1650300,1657500,1646300,1652100,105437138,1666550.0\n3904,07/11/2013,00:00,1671100,1676000,1665300,1675100,113993351,1680150.0\n3905,07/12/2013,00:00,1674300,1678500,1671300,1675100,81255611,1687210.0\n3906,07/15/2013,00:00,1679600,1683900,1676800,1682200,61816116,1692800.0\n3907,07/16/2013,00:00,1682500,1683500,1670700,1675000,76492853,1687770.0\n3908,07/17/2013,00:00,1681600,1684700,1677300,1679700,79399399,1680150.0\n3909,07/18/2013,00:00,1682900,1692700,1682000,1688800,84464524,1687630.0\n3910,07/19/2013,00:00,1684800,1692300,1683100,1692300,89925668,1693800.0\n3911,07/22/2013,00:00,1693900,1697400,1690100,1695000,66244175,1701940.0\n3912,07/23/2013,00:00,1697900,1698300,1690500,1691400,68810946,1698320.0\n3913,07/24/2013,00:00,1698000,1698500,1681800,1685500,101293288,1688350.0\n3914,07/25/2013,00:00,1681700,1690800,1679400,1689300,88599506,1686050.0\n3915,07/26/2013,00:00,1682400,1691600,1675200,1691100,87678043,1687490.0\n3916,07/29/2013,00:00,1687000,1690600,1681100,1685300,69807907,1686540.0\n3917,07/30/2013,00:00,1691500,1692800,1681900,1686000,76066677,1686540.0\n3918,07/31/2013,00:00,1689400,1698500,1684900,1686600,119215193,1684510.0\n3919,08/01/2013,00:00,1700000,1708100,1699000,1706500,93280387,1700730.0\n3920,08/02/2013,00:00,1703000,1709600,1700500,1709500,69378174,1715450.0\n3921,08/05/2013,00:00,1706100,1709600,1703500,1708000,45392458,1719390.0\n3922,08/06/2013,00:00,1703400,1705200,1693500,1697300,71528242,1708450.0\n3923,08/07/2013,00:00,1692300,1694300,1685500,1691800,73391843,1690140.0\n3924,08/08/2013,00:00,1700000,1701800,1689300,1698100,84008835,1689240.0\n3925,08/09/2013,00:00,1695600,1701000,1687300,1693000,82562992,1688880.0\n3926,08/12/2013,00:00,1684700,1693100,1683800,1691000,59076849,1690820.0\n3927,08/13/2013,00:00,1694000,1699000,1684100,1696900,74561074,1695090.0\n3928,08/14/2013,00:00,1695600,1697900,1687000,1687400,70350361,1688030.0\n3929,08/15/2013,00:00,1674300,1674300,1660900,1662700,126229462,1666940.0\n3930,08/16/2013,00:00,1660400,1666300,1655000,1658700,106209007,1649700.0\n3931,08/19/2013,00:00,1656400,1662100,1647600,1647600,83024441,1632470.0\n3932,08/20/2013,00:00,1650300,1662000,1648600,1655900,77447684,1639030.0\n3933,08/21/2013,00:00,1651500,1660300,1641900,1645600,132890097,1643000.0\n3934,08/22/2013,00:00,1649500,1662900,1648900,1660600,82535506,1654220.0\n3935,08/23/2013,00:00,1665500,1668300,1657700,1666700,70964457,1668150.0\n3936,08/26/2013,00:00,1667700,1673000,1658900,1659700,71204095,1666310.0\n3937,08/27/2013,00:00,1643300,1649800,1632100,1632900,132014807,1645210.0\n3938,08/28/2013,00:00,1633100,1644900,1630600,1639100,83019406,1628760.0\n3939,08/29/2013,00:00,1635300,1650400,1634000,1642200,88993054,1627240.0\n3940,08/30/2013,00:00,1644600,1645300,1631700,1636500,105523797,1630950.0\n3941,09/03/2013,00:00,1652300,1655800,1637000,1643800,113549991,1644660.0\n3942,09/04/2013,00:00,1644600,1660300,1641350,1657600,83234247,1655420.0\n3943,09/05/2013,00:00,1658500,1664000,1657300,1658600,55584480,1663910.0\n3944,09/06/2013,00:00,1664800,1669800,1644800,1660400,131889423,1670160.0\n3945,09/09/2013,00:00,1664500,1677300,1664400,1676700,71813338,1680000.0\n3946,09/10/2013,00:00,1686400,1689000,1682600,1688400,91018703,1692250.0\n3947,09/11/2013,00:00,1686600,1694000,1683500,1693700,77547138,1705020.0\n3948,09/12/2013,00:00,1693500,1695600,1687200,1690400,74584175,1705020.0\n3949,09/13/2013,00:00,1691300,1694600,1687400,1693300,61972527,1699060.0\n3950,09/16/2013,00:00,1711600,1712400,1700400,1703800,94743068,1703040.0\n3951,09/17/2013,00:00,1704700,1711100,1704600,1710700,68422451,1712600.0\n3952,09/18/2013,00:00,1709700,1735200,1705800,1731400,162552414,1735740.0\n3953,09/19/2013,00:00,1735300,1736000,1725900,1728100,122855888,1742620.0\n3954,09/20/2013,00:00,1723000,1723300,1705800,1706200,110504216,1722700.0\n3955,09/23/2013,00:00,1705000,1706400,1694000,1699400,88854203,1700820.0\n3956,09/24/2013,00:00,1699200,1705200,1692100,1695700,86708329,1682130.0\n3957,09/25/2013,00:00,1696100,1699300,1689000,1691100,98740960,1678750.0\n3958,09/26/2013,00:00,1693200,1701700,1690500,1696900,67188223,1689790.0\n3959,09/27/2013,00:00,1688500,1691400,1684700,1689500,80759674,1688940.0\n3960,09/30/2013,00:00,1674600,1685400,1671500,1681000,121886292,1681540.0\n3961,10/01/2013,00:00,1681500,1695000,1680000,1694000,107332142,1687470.0\n3962,10/02/2013,00:00,1683400,1692100,1678300,1691100,87176914,1688370.0\n3963,10/03/2013,00:00,1687700,1689400,1668400,1676200,153254596,1681410.0\n3964,10/04/2013,00:00,1677400,1690600,1675300,1688900,84960871,1685640.0\n3965,10/07/2013,00:00,1674300,1684500,1672500,1674200,81489219,1672340.0\n3966,10/08/2013,00:00,1674500,1676200,1653700,1654800,153859703,1654660.0\n3967,10/09/2013,00:00,1658200,1662000,1645300,1655700,143898404,1647430.0\n3968,10/10/2013,00:00,1673200,1692400,1672300,1692400,157839488,1669750.0\n3969,10/11/2013,00:00,1689000,1703200,1687700,1703000,88751455,1704580.0\n3970,10/14/2013,00:00,1692400,1710700,1690800,1710400,94276399,1730810.0\n3971,10/15/2013,00:00,1705200,1711500,1694700,1697200,135988023,1722040.0\n3972,10/16/2013,00:00,1707200,1721600,1706400,1720500,130275941,1719820.0\n3973,10/17/2013,00:00,1713800,1733200,1713400,1732700,109465354,1733610.0\n3974,10/18/2013,00:00,1738500,1745100,1735100,1743600,123495408,1751450.0\n3975,10/21/2013,00:00,1744700,1747500,1740100,1744500,84701818,1763010.0\n3976,10/22/2013,00:00,1749400,1759300,1746600,1753500,112475864,1762300.0\n3977,10/23/2013,00:00,1748000,1748900,1739700,1746200,93453544,1755170.0\n3978,10/24/2013,00:00,1748900,1753700,1745100,1752400,62520580,1753830.0\n3979,10/25/2013,00:00,1755100,1759600,1751700,1759300,75063201,1759730.0\n3980,10/28/2013,00:00,1759000,1764700,1757000,1762400,68672145,1764030.0\n3981,10/29/2013,00:00,1766400,1772200,1763800,1772200,69837141,1777100.0\n3982,10/30/2013,00:00,1773700,1775100,1756600,1763300,119958891,1772330.0\n3983,10/31/2013,00:00,1761800,1768900,1755300,1757300,113070805,1761970.0\n3984,11/01/2013,00:00,1760500,1766000,1752200,1761400,111765973,1758250.0\n3985,11/04/2013,00:00,1767100,1769000,1761500,1768600,71643685,1761830.0\n3986,11/05/2013,00:00,1761600,1767500,1755700,1762800,74666522,1765770.0\n3987,11/06/2013,00:00,1770600,1775000,1765400,1771800,71899592,1773500.0\n3988,11/07/2013,00:00,1775200,1776400,1747600,1749700,130922217,1756800.0\n3989,11/08/2013,00:00,1748500,1773100,1748500,1773100,112039875,1763970.0\n3990,11/11/2013,00:00,1771400,1775300,1769100,1772900,53145668,1772510.0\n3991,11/12/2013,00:00,1769400,1773600,1763700,1769800,73699767,1773220.0\n3992,11/13/2013,00:00,1761100,1784000,1760900,1783200,84500144,1788850.0\n3993,11/14/2013,00:00,1785300,1794200,1782500,1793200,92770485,1793590.0\n3994,11/15/2013,00:00,1795400,1801200,1793300,1801200,88157314,1808060.0\n3995,11/18/2013,00:00,1803900,1805000,1790200,1795000,83432360,1809000.0\n3996,11/19/2013,00:00,1793400,1798700,1787200,1790300,85703243,1797380.0\n3997,11/20/2013,00:00,1794100,1799300,1779800,1785100,108921426,1784830.0\n3998,11/21/2013,00:00,1789800,1800500,1788600,1799700,70890848,1790390.0\n3999,11/22/2013,00:00,1799600,1808300,1797700,1808100,66142514,1806320.0\n4000,11/25/2013,00:00,1811400,1811700,1803700,1807100,66442019,1815040.0\n4001,11/26/2013,00:00,1807500,1812200,1804100,1806400,72012227,1816280.0\n4002,11/27/2013,00:00,1808800,1812400,1806500,1811200,51121354,1812890.0\n4003,11/29/2013,00:00,1813400,1817500,1808000,1809300,41250857,1810370.0\n4004,12/02/2013,00:00,1811300,1814300,1802500,1805400,76545928,1807730.0\n4005,12/03/2013,00:00,1799500,1803900,1791700,1798500,92867713,1799680.0\n4006,12/04/2013,00:00,1792100,1804800,1783500,1796700,107731159,1792280.0\n4007,12/05/2013,00:00,1794200,1797400,1787800,1790100,88220890,1785870.0\n4008,12/06/2013,00:00,1807300,1811100,1801600,1809500,99444907,1799980.0\n4009,12/09/2013,00:00,1814800,1816700,1811600,1814000,60060446,1814900.0\n4010,12/10/2013,00:00,1809600,1813600,1806400,1807500,62301715,1817210.0\n4011,12/11/2013,00:00,1808100,1808500,1785000,1787200,111930458,1799320.0\n4012,12/12/2013,00:00,1786400,1788600,1777600,1781300,94786627,1774940.0\n4013,12/13/2013,00:00,1784700,1786600,1777700,1781100,83056349,1766620.0\n4014,12/16/2013,00:00,1789200,1798100,1789000,1792200,74941906,1778850.0\n4015,12/17/2013,00:00,1793700,1794100,1782500,1785400,75948317,1787630.0\n4016,12/18/2013,00:00,1789400,1817300,1773300,1817000,207030899,1814110.0\n4017,12/19/2013,00:00,1812000,1817000,1807200,1815000,112655750,1825920.0\n4018,12/20/2013,00:00,1806700,1819900,1806600,1815800,133819141,1828120.0\n4019,12/23/2013,00:00,1824100,1826400,1820700,1825400,66321111,1835360.0\n4020,12/24/2013,00:00,1825700,1830000,1825300,1829300,38250253,1831000.0\n4021,12/26/2013,00:00,1833700,1839600,1833300,1838400,53110222,1842870.0\n4022,12/27/2013,00:00,1841600,1841800,1836600,1838400,53771801,1846920.0\n4023,12/30/2013,00:00,1839200,1840200,1835800,1838200,47180243,1844350.0\n4024,12/31/2013,00:00,1841200,1846800,1839300,1846700,68550651,1848580.0\n4025,01/02/2014,00:00,1839100,1840600,1824800,1829200,108167846,1835150.0\n4026,01/03/2014,00:00,1832400,1836000,1826300,1828800,71382847,1827800.0\n4027,01/06/2014,00:00,1835200,1835600,1820800,1823600,89901576,1819170.0\n4028,01/07/2014,00:00,1831200,1837900,1829600,1834300,75867995,1823400.0\n4029,01/08/2014,00:00,1834600,1838300,1829000,1835200,86342393,1835470.0\n4030,01/09/2014,00:00,1841000,1841400,1828000,1836400,79126576,1839700.0\n4031,01/10/2014,00:00,1839600,1842100,1830100,1841400,77972574,1845490.0\n4032,01/13/2014,00:00,1836900,1841800,1813400,1816600,122813410,1824020.0\n4033,01/14/2014,00:00,1822700,1837700,1819500,1837200,85261773,1828620.0\n4034,01/15/2014,00:00,1841000,1849400,1840100,1846900,83647160,1840740.0\n4035,01/16/2014,00:00,1843000,1845000,1838400,1843900,61950237,1847790.0\n4036,01/17/2014,00:00,1841000,1844500,1833300,1836500,89214819,1850170.0\n4037,01/21/2014,00:00,1847200,1847700,1830500,1841800,77312943,1840900.0\n4038,01/22/2014,00:00,1845100,1845700,1839100,1843000,53915460,1839450.0\n4039,01/23/2014,00:00,1833500,1834000,1818300,1827900,115258815,1830970.0\n4040,01/24/2014,00:00,1815700,1816500,1788300,1788300,175573279,1794410.0\n4041,01/27/2014,00:00,1790500,1795100,1771300,1780100,160064102,1762790.0\n4042,01/28/2014,00:00,1782500,1793000,1781300,1791000,90568738,1760520.0\n4043,01/29/2014,00:00,1776200,1785500,1768800,1772800,179260502,1759770.0\n4044,01/30/2014,00:00,1788800,1798100,1782600,1792300,96632848,1785110.0\n4045,01/31/2014,00:00,1770200,1792900,1769200,1781800,159765786,1785010.0\n4046,02/03/2014,00:00,1779400,1783700,1738300,1741500,222544720,1748880.0\n4047,02/04/2014,00:00,1749400,1758400,1743400,1753600,144004983,1741640.0\n4048,02/05/2014,00:00,1747800,1755600,1737100,1751700,146216400,1731360.0\n4049,02/06/2014,00:00,1756100,1774800,1755800,1774800,110630862,1759540.0\n4050,02/07/2014,00:00,1782800,1798700,1777400,1797400,132131649,1803700.0\n4051,02/10/2014,00:00,1797100,1800700,1792100,1800100,72626938,1817130.0\n4052,02/11/2014,00:00,1802300,1824400,1800700,1819800,103111329,1837210.0\n4053,02/12/2014,00:00,1822600,1828300,1817100,1821600,87336980,1837540.0\n4054,02/13/2014,00:00,1808700,1832000,1808300,1830000,86663567,1839790.0\n4055,02/14/2014,00:00,1829000,1843600,1826800,1840100,79238964,1849380.0\n4056,02/18/2014,00:00,1842000,1844900,1836500,1842600,68488244,1850050.0\n4057,02/19/2014,00:00,1837800,1849500,1828700,1830500,107451814,1842080.0\n4058,02/20/2014,00:00,1833000,1845200,1826200,1841000,89178782,1840560.0\n4059,02/21/2014,00:00,1844200,1848900,1838000,1839600,100978693,1837980.0\n4060,02/24/2014,00:00,1843000,1861500,1842100,1849100,93723541,1847190.0\n4061,02/25/2014,00:00,1850300,1855800,1842300,1848400,97120950,1854890.0\n4062,02/26/2014,00:00,1851000,1856000,1843300,1848500,84192425,1852460.0\n4063,02/27/2014,00:00,1845800,1858700,1843800,1858700,80283904,1860140.0\n4064,02/28/2014,00:00,1857800,1871500,1850500,1863000,127758775,1864970.0\n4065,03/03/2014,00:00,1846500,1854500,1837500,1849800,141848312,1858870.0\n4066,03/04/2014,00:00,1868100,1879800,1867500,1875800,149682598,1872870.0\n4067,03/05/2014,00:00,1877500,1880700,1874500,1876100,72001348,1878960.0\n4068,03/06/2014,00:00,1882200,1886100,1878900,1882100,71357422,1888710.0\n4069,03/07/2014,00:00,1889600,1889600,1874300,1882600,92692794,1894850.0\n4070,03/10/2014,00:00,1879900,1882300,1870800,1882100,66969564,1885470.0\n4071,03/11/2014,00:00,1884800,1887000,1868000,1872300,88435777,1876760.0\n4072,03/12/2014,00:00,1863200,1873500,1859000,1872800,93180936,1869710.0\n4073,03/13/2014,00:00,1878800,1879900,1846600,1851800,136495375,1851050.0\n4074,03/14/2014,00:00,1848000,1857900,1844400,1846600,133250737,1837670.0\n4075,03/17/2014,00:00,1856200,1867700,1855200,1863300,86212672,1848100.0\n4076,03/18/2014,00:00,1867400,1879100,1865100,1876600,88937577,1867950.0\n4077,03/19/2014,00:00,1877100,1879400,1854800,1866600,142453779,1878860.0\n4078,03/20/2014,00:00,1862500,1878900,1859200,1877500,100140419,1885650.0\n4079,03/21/2014,00:00,1876900,1881700,1860300,1861900,137887629,1868610.0\n4080,03/24/2014,00:00,1868400,1870700,1846200,1854000,110550534,1852350.0\n4081,03/25/2014,00:00,1864000,1869400,1852700,1863100,95520395,1855470.0\n4082,03/26/2014,00:00,1870000,1873400,1849500,1849700,102575862,1844920.0\n4083,03/27/2014,00:00,1847700,1853400,1839100,1845800,127599205,1843950.0\n4084,03/28/2014,00:00,1851400,1864200,1850000,1855000,88551960,1848930.0\n4085,03/31/2014,00:00,1866600,1873000,1864700,1870400,83948640,1862770.0\n4086,04/01/2014,00:00,1876500,1883600,1874500,1882700,77846445,1887900.0\n4087,04/02/2014,00:00,1885000,1891300,1881400,1888600,70718887,1902490.0\n4088,04/03/2014,00:00,1891300,1892100,1880600,1886000,69874589,1900600.0\n4089,04/04/2014,00:00,1896400,1897000,1861000,1863800,147905014,1875330.0\n4090,04/07/2014,00:00,1859000,1862600,1839600,1843400,126552113,1841880.0\n4091,04/08/2014,00:00,1841800,1854000,1835900,1851300,101526439,1831460.0\n4092,04/09/2014,00:00,1856100,1871500,1850800,1871500,90817021,1850750.0\n4093,04/10/2014,00:00,1870700,1871700,1829400,1831700,150960665,1841510.0\n4094,04/11/2014,00:00,1821600,1834200,1813100,1814800,147808432,1819500.0\n4095,04/14/2014,00:00,1829200,1833700,1814500,1829400,118011184,1809590.0\n4096,04/15/2014,00:00,1833300,1843300,1815200,1842400,146271143,1819810.0\n4097,04/16/2014,00:00,1854900,1861400,1846500,1861400,89620166,1862040.0\n4098,04/17/2014,00:00,1858700,1869100,1855600,1863900,89232723,1881440.0\n4099,04/21/2014,00:00,1864500,1871000,1862100,1870400,53096311,1884550.0\n4100,04/22/2014,00:00,1872400,1884000,1871300,1878900,76101182,1888000.0\n4101,04/23/2014,00:00,1878000,1879200,1873000,1874400,64174505,1882100.0\n4102,04/24/2014,00:00,1883900,1883900,1869300,1878100,80287334,1882860.0\n4103,04/25/2014,00:00,1872000,1873300,1858700,1862900,90739070,1868200.0\n4104,04/28/2014,00:00,1870800,1876900,1849700,1868800,120930399,1863110.0\n4105,04/29/2014,00:00,1874800,1880400,1870800,1877000,71643542,1871010.0\n4106,04/30/2014,00:00,1874600,1885000,1871800,1884300,85384290,1882170.0\n4107,05/01/2014,00:00,1882500,1888400,1877300,1882900,82539046,1891830.0\n4108,05/02/2014,00:00,1883300,1891400,1877900,1880600,80493271,1887570.0\n4109,05/05/2014,00:00,1871600,1885500,1866300,1884400,62112050,1885170.0\n4110,05/06/2014,00:00,1880300,1881300,1867400,1868100,70612290,1870790.0\n4111,05/07/2014,00:00,1874100,1879700,1860200,1878900,95472189,1872830.0\n4112,05/08/2014,00:00,1877100,1890400,1870800,1877000,87869466,1873990.0\n4113,05/09/2014,00:00,1877100,1880400,1868300,1880000,74953765,1877710.0\n4114,05/12/2014,00:00,1887700,1898800,1887500,1898100,71834301,1898750.0\n4115,05/13/2014,00:00,1900000,1904200,1897800,1899600,60592895,1905470.0\n4116,05/14/2014,00:00,1898200,1898800,1887900,1890400,64159354,1902940.0\n4117,05/15/2014,00:00,1886800,1887200,1864800,1874000,141261751,1882510.0\n4118,05/16/2014,00:00,1875000,1881300,1867200,1881100,85281290,1870760.0\n4119,05/19/2014,00:00,1877000,1888900,1875200,1887000,51306979,1876070.0\n4120,05/20/2014,00:00,1886700,1886700,1870700,1875500,94515421,1876560.0\n4121,05/21/2014,00:00,1881000,1892200,1880600,1891300,77745877,1890480.0\n4122,05/22/2014,00:00,1892000,1899800,1888600,1896000,57302105,1896410.0\n4123,05/23/2014,00:00,1897600,1904800,1896800,1903800,50524951,1906950.0\n4124,05/27/2014,00:00,1910600,1915800,1909500,1915700,56783233,1924330.0\n4125,05/28/2014,00:00,1915500,1918200,1910600,1913800,60654048,1923530.0\n4126,05/29/2014,00:00,1918500,1924000,1913400,1924000,55471647,1930460.0\n4127,05/30/2014,00:00,1922100,1928000,1920400,1926300,63232048,1932710.0\n4128,06/02/2014,00:00,1929800,1929900,1919700,1929100,55322323,1933570.0\n4129,06/03/2014,00:00,1924300,1929000,1922600,1928100,52564603,1934370.0\n4130,06/04/2014,00:00,1924800,1933000,1922700,1931900,48936106,1933160.0\n4131,06/05/2014,00:00,1934300,1946500,1927000,1944600,76105702,1943820.0\n4132,06/06/2014,00:00,1948800,1954300,1947800,1954100,61256519,1957510.0\n4133,06/09/2014,00:00,1953600,1960500,1951700,1955700,58266471,1966100.0\n4134,06/10/2014,00:00,1953600,1956000,1949200,1955900,50668363,1966170.0\n4135,06/11/2014,00:00,1948700,1951100,1944800,1949200,55834216,1955200.0\n4136,06/12/2014,00:00,1946800,1948000,1931100,1935400,87647599,1936890.0\n4137,06/13/2014,00:00,1938900,1943200,1933000,1941600,64621214,1932950.0\n4138,06/16/2014,00:00,1938800,1947000,1936600,1942900,67831890,1934920.0\n4139,06/17/2014,00:00,1940000,1949700,1938100,1948300,69206159,1945190.0\n4140,06/18/2014,00:00,1948300,1963700,1944000,1962600,93135373,1964490.0\n4141,06/19/2014,00:00,1964600,1966000,1958000,1964800,74988020,1971870.0\n4142,06/20/2014,00:00,1960000,1960600,1957100,1959400,77778094,1970450.0\n4143,06/23/2014,00:00,1960000,1960500,1955200,1958800,50217325,1964120.0\n4144,06/24/2014,00:00,1955200,1965000,1944800,1947100,88391670,1947440.0\n4145,06/25/2014,00:00,1942800,1957800,1942500,1955800,72492534,1948090.0\n4146,06/26/2014,00:00,1956000,1956300,1941300,1954500,69751995,1951280.0\n4147,06/27/2014,00:00,1950100,1958800,1948900,1957900,55840263,1956500.0\n4148,06/30/2014,00:00,1957100,1961700,1955300,1957200,59593898,1961190.0\n4149,07/01/2014,00:00,1962100,1976300,1961300,1970600,81724640,1968890.0\n4150,07/02/2014,00:00,1970300,1974800,1969600,1972200,46267119,1976910.0\n4151,07/03/2014,00:00,1978100,1982900,1976500,1982500,39315126,1987340.0\n4152,07/07/2014,00:00,1978400,1979800,1972200,1975100,55946614,1985830.0\n4153,07/08/2014,00:00,1971200,1972200,1957600,1962800,90890519,1968830.0\n4154,07/09/2014,00:00,1967500,1973000,1963100,1971200,65783629,1966250.0\n4155,07/10/2014,00:00,1952400,1968600,1950600,1963500,88163470,1958450.0\n4156,07/11/2014,00:00,1962400,1967500,1957900,1966000,55246470,1962470.0\n4157,07/14/2014,00:00,1976300,1978600,1974400,1976000,51736248,1974260.0\n4158,07/15/2014,00:00,1977300,1981000,1963700,1972300,100356883,1974210.0\n4159,07/16/2014,00:00,1981300,1982600,1974200,1979600,66890342,1983030.0\n4160,07/17/2014,00:00,1973200,1981000,1954300,1957100,124560916,1965940.0\n4161,07/18/2014,00:00,1963800,1979100,1962400,1977400,111817075,1968760.0\n4162,07/21/2014,00:00,1970800,1975000,1964300,1973400,60883796,1971960.0\n4163,07/22/2014,00:00,1980400,1985600,1978700,1982000,60031730,1980230.0\n4164,07/23/2014,00:00,1985100,1988500,1981000,1986400,54979732,1994220.0\n4165,07/24/2014,00:00,1988200,1990600,1984500,1986500,50510204,1990500.0\n4166,07/25/2014,00:00,1981100,1982600,1973300,1977400,69172823,1984890.0\n4167,07/28/2014,00:00,1977800,1980900,1966200,1978000,64463636,1976960.0\n4168,07/29/2014,00:00,1982100,1984500,1969300,1969300,71955637,1966710.0\n4169,07/30/2014,00:00,1976600,1979100,1961600,1969800,97604354,1963750.0\n4170,07/31/2014,00:00,1956300,1957800,1930400,1930900,156932334,1934720.0\n4171,08/01/2014,00:00,1925800,1937500,1915800,1924800,159252899,1911120.0\n4172,08/04/2014,00:00,1929100,1943000,1920500,1938800,81387375,1914920.0\n4173,08/05/2014,00:00,1931100,1936000,1913200,1920100,136260078,1909430.0\n4174,08/06/2014,00:00,1910800,1928900,1910800,1920700,86720027,1919530.0\n4175,08/07/2014,00:00,1929600,1931200,1905500,1909900,121255519,1908490.0\n4176,08/08/2014,00:00,1914300,1933700,1909500,1932400,101088602,1917480.0\n4177,08/11/2014,00:00,1939900,1946600,1937100,1938000,68566260,1938470.0\n4178,08/12/2014,00:00,1936300,1941500,1929400,1935400,67359712,1944530.0\n4179,08/13/2014,00:00,1943000,1950600,1939600,1948900,59607085,1957220.0\n4180,08/14/2014,00:00,1951900,1957600,1949800,1957600,51962205,1960850.0\n4181,08/15/2014,00:00,1964900,1966500,1943200,1957100,131789171,1965520.0\n4182,08/18/2014,00:00,1968100,1974500,1966900,1973200,62330394,1979580.0\n4183,08/19/2014,00:00,1978500,1985400,1976500,1983900,52380329,1989820.0\n4184,08/20/2014,00:00,1981500,1991600,1980800,1989200,67210020,1999200.0\n4185,08/21/2014,00:00,1990600,1997600,1989300,1995000,59306589,2007220.0\n4186,08/22/2014,00:00,1993200,1996900,1987400,1991900,67316596,2001190.0\n4187,08/25/2014,00:00,2001500,2005300,1998600,2002000,59522463,2004070.0\n4188,08/26/2014,00:00,2003500,2008200,2002800,2003300,40694869,2006840.0\n4189,08/27/2014,00:00,2004500,2005700,1999400,2002500,41413859,2006860.0\n4190,08/28/2014,00:00,1995900,2002600,1993900,2001400,47413129,2006070.0\n4191,08/29/2014,00:00,2004400,2007300,1998200,2007100,52731377,2005750.0\n4192,09/02/2014,00:00,2009900,2010000,1998600,2006100,62095645,2007140.0\n4193,09/03/2014,00:00,2013500,2014100,2002200,2005000,50973915,2007330.0\n4194,09/04/2014,00:00,2008600,2015800,1996600,2002200,69364467,2004210.0\n4195,09/05/2014,00:00,2001900,2011900,1994200,2011100,83243971,2007530.0\n4196,09/08/2014,00:00,2009400,2012100,2000000,2005900,59405002,2007770.0\n4197,09/09/2014,00:00,2004200,2005500,1989200,1993200,81235943,1997510.0\n4198,09/10/2014,00:00,1994600,2002000,1987700,2000700,63306991,1996350.0\n4199,09/11/2014,00:00,1992800,2003300,1991200,2003000,60058285,1996360.0\n4200,09/12/2014,00:00,2001200,2001200,1985600,1991200,104418519,1992920.0\n4201,09/15/2014,00:00,1991700,1993100,1983800,1990200,66547024,1991010.0\n4202,09/16/2014,00:00,1986400,2008400,1985000,2005200,104267737,1996920.0\n4203,09/17/2014,00:00,2008000,2016800,1997500,2007500,129557361,2006320.0\n4204,09/18/2014,00:00,2013600,2018500,2011000,2018200,82911266,2023850.0\n4205,09/19/2014,00:00,2015500,2017300,2002900,2007000,103522528,2019600.0\n4206,09/22/2014,00:00,2003600,2003700,1987400,1991500,100445733,1997510.0\n4207,09/23/2014,00:00,1984100,1992600,1979500,1980100,95589005,1976410.0\n4208,09/24/2014,00:00,1980600,1996900,1975200,1995700,96800805,1976930.0\n4209,09/25/2014,00:00,1990500,1990500,1963200,1963300,131462409,1962560.0\n4210,09/26/2014,00:00,1967000,1983900,1964200,1979000,89383462,1969380.0\n4211,09/29/2014,00:00,1962000,1978900,1960500,1974900,84163503,1970470.0\n4212,09/30/2014,00:00,1977000,1983000,1966100,1970200,106045623,1964800.0\n4213,10/01/2014,00:00,1967500,1967700,1939100,1943700,163982292,1951820.0\n4214,10/02/2014,00:00,1941800,1950500,1923500,1944200,145715250,1932160.0\n4215,10/03/2014,00:00,1957100,1969400,1950800,1965200,101990291,1946020.0\n4216,10/06/2014,00:00,1973600,1976000,1955900,1963000,97319437,1959390.0\n4217,10/07/2014,00:00,1952900,1957200,1932500,1933000,126487728,1949040.0\n4218,10/08/2014,00:00,1933600,1969200,1923600,1966100,170825947,1957780.0\n4219,10/09/2014,00:00,1963600,1966000,1925800,1927000,193080301,1928870.0\n4220,10/10/2014,00:00,1927100,1936500,1905100,1905400,195742635,1902540.0\n4221,10/13/2014,00:00,1904400,1911500,1873000,1874500,203655232,1867890.0\n4222,10/14/2014,00:00,1884600,1898200,1870400,1878300,195991419,1841830.0\n4223,10/15/2014,00:00,1851900,1868800,1819200,1864300,349938478,1844150.0\n4224,10/16/2014,00:00,1830200,1875800,1829000,1862700,179272051,1848360.0\n4225,10/17/2014,00:00,1884800,1897500,1876200,1884700,195960240,1874340.0\n4226,10/20/2014,00:00,1880900,1904500,1880700,1903000,102818615,1899540.0\n4227,10/21/2014,00:00,1917000,1942000,1914800,1940700,136732853,1949010.0\n4228,10/22/2014,00:00,1944400,1949100,1926100,1926900,134617023,1958920.0\n4229,10/23/2014,00:00,1946400,1962000,1942600,1949300,141433028,1966850.0\n4230,10/24/2014,00:00,1952300,1964900,1944900,1964300,101947411,1976200.0\n4231,10/27/2014,00:00,1957500,1964500,1950300,1961600,75533804,1972320.0\n4232,10/28/2014,00:00,1968400,1984200,1967300,1984100,92862874,1995250.0\n4233,10/29/2014,00:00,1985900,1991200,1968000,1981100,129853584,1993100.0\n4234,10/30/2014,00:00,1975900,1999500,1974100,1993800,106646609,2000530.0\n4235,10/31/2014,00:00,2017800,2018100,2007800,2016600,121383830,2023350.0\n4236,11/03/2014,00:00,2019600,2024500,2013100,2017700,80803486,2029470.0\n4237,11/04/2014,00:00,2012200,2016000,2000600,2010700,82190940,2028910.0\n4238,11/05/2014,00:00,2025500,2025900,2014500,2023400,82242532,2028430.0\n4239,11/06/2014,00:00,2024100,2032600,2016400,2031500,90435301,2030630.0\n4240,11/07/2014,00:00,2031600,2035900,2026100,2033400,70687484,2039000.0\n4241,11/10/2014,00:00,2034000,2040400,2031300,2039800,58529173,2048220.0\n4242,11/11/2014,00:00,2040700,2043000,2036600,2041600,48919008,2047350.0\n4243,11/12/2014,00:00,2033500,2042400,2033100,2039600,78536093,2044500.0\n4244,11/13/2014,00:00,2041400,2048300,2032100,2041900,79200441,2044300.0\n4245,11/14/2014,00:00,2041300,2044800,2037200,2042400,65017444,2042710.0\n4246,11/17/2014,00:00,2038500,2045800,2036600,2043700,60076767,2043940.0\n4247,11/18/2014,00:00,2044600,2059200,2044400,2055500,68462821,2054700.0\n4248,11/19/2014,00:00,2053000,2055500,2043000,2052200,77328648,2057250.0\n4249,11/20/2014,00:00,2042500,2057100,2041900,2055800,64783018,2060510.0\n4250,11/21/2014,00:00,2076000,2077200,2059800,2067200,121172657,2069070.0\n4251,11/24/2014,00:00,2071900,2073900,2069100,2072600,59414411,2075420.0\n4252,11/25/2014,00:00,2075100,2077900,2068000,2072500,66365644,2081280.0\n4253,11/26/2014,00:00,2072700,2077600,2070300,2076400,48377586,2082850.0\n4254,11/28/2014,00:00,2075000,2078700,2069100,2072000,47640169,2076160.0\n4255,12/01/2014,00:00,2063800,2065400,2053800,2058000,95613332,2061390.0\n4256,12/02/2014,00:00,2058000,2073400,2057900,2070900,68327439,2063480.0\n4257,12/03/2014,00:00,2072800,2081500,2071100,2079100,59313893,2072570.0\n4258,12/04/2014,00:00,2075500,2082700,2067000,2076400,80223355,2080250.0\n4259,12/05/2014,00:00,2078800,2084700,2075500,2080000,75793135,2087730.0\n4260,12/08/2014,00:00,2075500,2081200,2059300,2066100,98866205,2071890.0\n4261,12/09/2014,00:00,2043700,2066000,2039100,2064700,115507853,2061530.0\n4262,12/10/2014,00:00,2059400,2059800,2029300,2031600,146331601,2032290.0\n4263,12/11/2014,00:00,2038900,2061900,2037100,2042300,150279681,2023970.0\n4264,12/12/2014,00:00,2026500,2038100,2008500,2009400,177421306,2002080.0\n4265,12/15/2014,00:00,2020000,2025300,1987800,1995100,178323144,1980200.0\n4266,12/16/2014,00:00,1985500,2023900,1978600,1979000,222136276,1965760.0\n4267,12/17/2014,00:00,1984800,2023400,1983000,2017900,236495966,1984980.0\n4268,12/18/2014,00:00,2047800,2129700,2039300,2068400,227706451,2056200.0\n4269,12/19/2014,00:00,2064600,2073300,2056200,2063300,201656897,2092480.0\n4270,12/22/2014,00:00,2067100,2074700,2064600,2074700,122695539,2111700.0\n4271,12/23/2014,00:00,2082000,2082300,2075100,2077500,105506063,2098010.0\n4272,12/24/2014,00:00,2080300,2083400,2077200,2078100,37099900,2082480.0\n4273,12/26/2014,00:00,2082900,2088400,2082500,2084400,47217364,2089280.0\n4274,12/29/2014,00:00,2082500,2089700,2081500,2087200,68552412,2089950.0\n4275,12/30/2014,00:00,2082100,2083700,2075100,2076000,67744755,2082470.0\n4276,12/31/2014,00:00,2079600,2081800,2054000,2055000,104411039,2059760.0\n4277,01/02/2015,00:00,2064000,2068800,2041800,2054300,105957476,2043660.0\n4278,01/05/2015,00:00,2042000,2043700,2013500,2017600,151790532,2009750.0\n4279,01/06/2015,00:00,2021300,2027200,1988600,1998200,191309913,1982320.0\n4280,01/07/2015,00:00,2014600,2027200,2008800,2023100,110907078,1993670.0\n4281,01/08/2015,00:00,2040000,2061600,2039900,2059000,135532145,2034910.0\n4282,01/09/2015,00:00,2063900,2064100,2035200,2041900,138380098,2060780.0\n4283,01/12/2015,00:00,2044200,2045900,2019300,2026500,130060345,2052360.0\n4284,01/13/2015,00:00,2041500,2054800,2005200,2020800,195352135,2023130.0\n4285,01/14/2015,00:00,1996700,2011000,1985700,2009400,175802901,1995430.0\n4286,01/15/2015,00:00,2016400,2020000,1988800,1989700,156300011,1981210.0\n4287,01/16/2015,00:00,1987500,2018200,1985500,2016300,185662074,1997090.0\n4288,01/20/2015,00:00,2024300,2027100,2001700,2020800,120590234,2013470.0\n4289,01/21/2015,00:00,2015100,2036600,2009400,2030600,111421802,2035410.0\n4290,01/22/2015,00:00,2040200,2062600,2023300,2060500,143386079,2070350.0\n4291,01/23/2015,00:00,2058000,2061000,2048100,2049700,103145813,2067530.0\n4292,01/26/2015,00:00,2047300,2055600,2038500,2054400,80310454,2069090.0\n4293,01/27/2015,00:00,2030000,2041200,2017500,2027900,118119788,2041170.0\n4294,01/28/2015,00:00,2041600,2049500,1999100,2001400,143518567,1996780.0\n4295,01/29/2015,00:00,2003400,2023000,1986800,2020100,142243135,1997040.0\n4296,01/30/2015,00:00,2005600,2021700,1991300,1994700,168157021,1981540.0\n4297,02/02/2015,00:00,2000700,2020200,1978600,2019000,148086377,2005270.0\n4298,02/03/2015,00:00,2029400,2048500,2025500,2048400,111656466,2044590.0\n4299,02/04/2015,00:00,2039100,2053800,2035100,2040600,113368828,2052970.0\n4300,02/05/2015,00:00,2048300,2063000,2047700,2061800,86542389,2079640.0\n4301,02/06/2015,00:00,2065700,2072400,2049200,2055300,105345677,2070820.0\n4302,02/09/2015,00:00,2047700,2056400,2041400,2046300,77313286,2053630.0\n4303,02/10/2015,00:00,2058900,2071200,2048200,2067700,87817324,2065950.0\n4304,02/11/2015,00:00,2066000,2074500,2058300,2069300,77041314,2068300.0\n4305,02/12/2015,00:00,2079100,2089900,2076800,2089200,82340827,2092800.0\n4306,02/13/2015,00:00,2090800,2098400,2087600,2097800,77979039,2111410.0\n4307,02/17/2015,00:00,2093800,2103200,2091000,2101600,65018633,2114010.0\n4308,02/18/2015,00:00,2096300,2102200,2093500,2101500,68979537,2114920.0\n4309,02/19/2015,00:00,2094300,2104200,2092400,2099800,82658520,2105450.0\n4310,02/20/2015,00:00,2094300,2113300,2087300,2112800,123596635,2111160.0\n4311,02/23/2015,00:00,2109700,2112100,2104800,2111900,68459606,2115090.0\n4312,02/24/2015,00:00,2111100,2120500,2107600,2118100,65091020,2122410.0\n4313,02/25/2015,00:00,2116400,2122400,2112200,2116100,67297730,2123110.0\n4314,02/26/2015,00:00,2115500,2117100,2106500,2113700,65693818,2116320.0\n4315,02/27/2015,00:00,2112500,2115800,2106400,2106600,87493136,2108780.0\n4316,03/02/2015,00:00,2107900,2120600,2107200,2119900,75805733,2113110.0\n4317,03/03/2015,00:00,2114600,2115900,2100800,2111200,97220283,2112420.0\n4318,03/04/2015,00:00,2104200,2104900,2090600,2102100,99097965,2105120.0\n4319,03/05/2015,00:00,2105900,2108000,2098500,2105100,69813562,2102740.0\n4320,03/06/2015,00:00,2093800,2099400,2071000,2075000,151279849,2073890.0\n4321,03/09/2015,00:00,2077600,2087900,2075800,2083600,81466789,2070710.0\n4322,03/10/2015,00:00,2067000,2068100,2049700,2050000,137606860,2045450.0\n4323,03/11/2015,00:00,2052900,2055000,2044000,2045000,101445686,2028180.0\n4324,03/12/2015,00:00,2052400,2071800,2052000,2071300,83701264,2051180.0\n4325,03/13/2015,00:00,2067600,2069300,2045800,2058400,142726670,2052930.0\n4326,03/16/2015,00:00,2066800,2086900,2066800,2086400,122468254,2088080.0\n4327,03/17/2015,00:00,2076500,2084200,2069800,2079900,86273420,2093670.0\n4328,03/18/2015,00:00,2073500,2112600,2066200,2104200,201026638,2106230.0\n4329,03/19/2015,00:00,2100400,2102900,2090300,2095000,107031725,2112080.0\n4330,03/20/2015,00:00,2096600,2110200,2096100,2104500,143568202,2109390.0\n4331,03/23/2015,00:00,2104300,2111100,2100000,2100000,60797901,2108870.0\n4332,03/24/2015,00:00,2098700,2104000,2087400,2088200,66524763,2090280.0\n4333,03/25/2015,00:00,2090100,2093500,2057100,2057600,143214221,2061730.0\n4334,03/26/2015,00:00,2049600,2063700,2041200,2052700,135552421,2036800.0\n4335,03/27/2015,00:00,2051600,2059500,2049100,2057500,101603187,2035050.0\n4336,03/30/2015,00:00,2069600,2086100,2069600,2082400,79185641,2064170.0\n4337,03/31/2015,00:00,2072600,2081000,2063600,2064300,101521731,2075830.0\n4338,04/01/2015,00:00,2064200,2064200,2045100,2057000,123533228,2067400.0\n4339,04/02/2015,00:00,2055800,2069800,2054000,2064000,76346908,2061320.0\n4340,04/06/2015,00:00,2053900,2084500,2052100,2078400,94957784,2066730.0\n4341,04/07/2015,00:00,2078600,2087500,2072500,2072800,66012249,2078820.0\n4342,04/08/2015,00:00,2075300,2085000,2070800,2080200,79769143,2087040.0\n4343,04/09/2015,00:00,2078200,2091800,2071900,2089200,79714373,2092580.0\n4344,04/10/2015,00:00,2092100,2100900,2089600,2100600,64668878,2102480.0\n4345,04/13/2015,00:00,2098400,2106200,2090300,2090600,68313801,2103480.0\n4346,04/14/2015,00:00,2088600,2097100,2081000,2094900,66715857,2100340.0\n4347,04/15/2015,00:00,2100700,2110400,2099500,2104700,86369302,2103590.0\n4348,04/16/2015,00:00,2100400,2109800,2098000,2104000,60189683,2105230.0\n4349,04/17/2015,00:00,2089800,2092300,2070100,2079800,164756043,2091050.0\n4350,04/20/2015,00:00,2090900,2102500,2089600,2098500,77138230,2091070.0\n4351,04/21/2015,00:00,2106500,2108600,2092400,2096000,62036953,2089730.0\n4352,04/22/2015,00:00,2100400,2108500,2089000,2106600,72044468,2103400.0\n4353,04/23/2015,00:00,2101700,2119300,2100100,2112100,91675891,2120410.0\n4354,04/24/2015,00:00,2117000,2119700,2111100,2116700,49570752,2121730.0\n4355,04/27/2015,00:00,2123400,2124800,2105400,2107400,70031075,2117630.0\n4356,04/28/2015,00:00,2107100,2115000,2093400,2114400,80175010,2114710.0\n4357,04/29/2015,00:00,2103200,2112900,2096000,2105300,113900782,2106410.0\n4358,04/30/2015,00:00,2099000,2103500,2076200,2085200,139993578,2086270.0\n4359,05/01/2015,00:00,2094100,2107700,2092800,2107200,87366934,2095020.0\n4360,05/04/2015,00:00,2112200,2120200,2111000,2113900,63475146,2105470.0\n4361,05/05/2015,00:00,2110100,2114600,2087300,2089200,102623336,2099110.0\n4362,05/06/2015,00:00,2095400,2099300,2067600,2080400,122648566,2086900.0\n4363,05/07/2015,00:00,2079100,2093800,2075300,2088700,75342115,2074730.0\n4364,05/08/2015,00:00,2108400,2118500,2107900,2116500,125762691,2099150.0\n4365,05/11/2015,00:00,2115400,2118900,2105300,2106000,65829833,2117070.0\n4366,05/12/2015,00:00,2095900,2106300,2086300,2099800,101766611,2115110.0\n4367,05/13/2015,00:00,2104900,2112200,2097400,2100600,79703427,2104450.0\n4368,05/14/2015,00:00,2112400,2123200,2109100,2122500,82976922,2111060.0\n4369,05/15/2015,00:00,2124300,2126100,2118700,2124400,68168050,2128510.0\n4370,05/18/2015,00:00,2122400,2134000,2121700,2131000,68309200,2141520.0\n4371,05/19/2015,00:00,2132600,2135700,2126900,2130300,62912644,2142130.0\n4372,05/20/2015,00:00,2131600,2137800,2125100,2128800,70291407,2132950.0\n4373,05/21/2015,00:00,2127400,2137500,2125100,2135000,59049641,2135600.0\n4374,05/22/2015,00:00,2130200,2135400,2129100,2130000,48920652,2131830.0\n4375,05/26/2015,00:00,2123900,2125000,2102100,2107100,110549834,2112680.0\n4376,05/27/2015,00:00,2112300,2129800,2108500,2126700,83068343,2115890.0\n4377,05/28/2015,00:00,2123400,2125900,2116300,2125000,68137802,2117770.0\n4378,05/29/2015,00:00,2124000,2124300,2108200,2111300,101440890,2114170.0\n4379,06/01/2015,00:00,2119500,2123400,2106200,2115400,85386556,2117460.0\n4380,06/02/2015,00:00,2110200,2121900,2102700,2113900,80789780,2107900.0\n4381,06/03/2015,00:00,2119700,2126700,2113400,2119200,78010486,2114260.0\n4382,06/04/2015,00:00,2111200,2117700,2097500,2102700,133914464,2108480.0\n4383,06/05/2015,00:00,2099300,2105800,2089800,2097600,97753516,2095720.0\n4384,06/08/2015,00:00,2096300,2098200,2083900,2084800,80415421,2079700.0\n4385,06/09/2015,00:00,2084400,2091000,2076900,2084700,92083031,2071730.0\n4386,06/10/2015,00:00,2093800,2114000,2093100,2109500,122058028,2096070.0\n4387,06/11/2015,00:00,2114900,2120900,2112000,2116300,65279388,2117210.0\n4388,06/12/2015,00:00,2106200,2108400,2096800,2100100,120211197,2117740.0\n4389,06/15/2015,00:00,2086200,2094400,2077900,2091100,113025531,2101360.0\n4390,06/16/2015,00:00,2089000,2103500,2087200,2102500,75706432,2092140.0\n4391,06/17/2015,00:00,2105800,2113200,2093900,2105900,118475364,2097660.0\n4392,06/18/2015,00:00,2112300,2133400,2111800,2127800,153435733,2126540.0\n4393,06/19/2015,00:00,2114200,2115500,2104500,2108100,106014352,2124870.0\n4394,06/22/2015,00:00,2119500,2125900,2116500,2118900,61838092,2123140.0\n4395,06/23/2015,00:00,2121800,2124400,2115700,2120400,59750874,2122250.0\n4396,06/24/2015,00:00,2117100,2121700,2104800,2105000,77999419,2106050.0\n4397,06/25/2015,00:00,2111300,2112500,2097700,2098600,80464312,2100330.0\n4398,06/26/2015,00:00,2102800,2105800,2091600,2098200,84634171,2089260.0\n4399,06/29/2015,00:00,2080200,2088200,2053300,2054200,173766367,2053520.0\n4400,06/30/2015,00:00,2073200,2073200,2052800,2058500,147775137,2041680.0\n4401,07/01/2015,00:00,2077900,2080300,2065600,2075000,119981651,2050830.0\n4402,07/02/2015,00:00,2080700,2082700,2068200,2073100,91216426,2062980.0\n4403,07/06/2015,00:00,2057400,2076500,2055400,2067200,107837293,2077780.0\n4404,07/07/2015,00:00,2069300,2081600,2041200,2080200,160419568,2081480.0\n4405,07/08/2015,00:00,2063400,2067600,2042500,2045300,149493795,2052470.0\n4406,07/09/2015,00:00,2070300,2073500,2048800,2049000,129658638,2041930.0\n4407,07/10/2015,00:00,2072800,2079800,2064900,2074800,117226689,2058500.0\n4408,07/13/2015,00:00,2090000,2099000,2089400,2097700,95163867,2088750.0\n4409,07/14/2015,00:00,2096900,2110500,2096600,2106800,72962870,2126230.0\n4410,07/15/2015,00:00,2107100,2112800,2100500,2106100,88918067,2130740.0\n4411,07/16/2015,00:00,2118200,2123000,2115500,2123000,94346340,2133120.0\n4412,07/17/2015,00:00,2123400,2125500,2118000,2124800,79523761,2132800.0\n4413,07/20/2015,00:00,2127700,2131800,2122100,2125900,59688017,2134390.0\n4414,07/21/2015,00:00,2124500,2127400,2113900,2117500,69759154,2127170.0\n4415,07/22/2015,00:00,2109100,2117700,2108900,2113700,78346222,2113210.0\n4416,07/23/2015,00:00,2115400,2116500,2097500,2101800,82429587,2099280.0\n4417,07/24/2015,00:00,2102500,2103700,2076000,2080000,103477607,2075530.0\n4418,07/27/2015,00:00,2069800,2075500,2062600,2067900,115528777,2056310.0\n4419,07/28/2015,00:00,2078000,2095000,2068000,2093300,112137492,2068930.0\n4420,07/29/2015,00:00,2094400,2110400,2093200,2107700,93976149,2097670.0\n4421,07/30/2015,00:00,2102000,2110200,2094200,2108200,84772348,2120280.0\n4422,07/31/2015,00:00,2114400,2114500,2101600,2105000,87268759,2123150.0\n4423,08/03/2015,00:00,2105300,2105300,2086500,2097900,103970825,2104370.0\n4424,08/04/2015,00:00,2097000,2102400,2088000,2093800,75432078,2091090.0\n4425,08/05/2015,00:00,2104000,2113100,2097300,2100700,76059680,2093260.0\n4426,08/06/2015,00:00,2102700,2104100,2076500,2083500,102560139,2084120.0\n4427,08/07/2015,00:00,2081600,2083400,2068700,2079500,100231197,2076950.0\n4428,08/10/2015,00:00,2092900,2106700,2092800,2105700,71084411,2093420.0\n4429,08/11/2015,00:00,2089600,2094700,2077600,2086700,105506895,2089480.0\n4430,08/12/2015,00:00,2071400,2091400,2053600,2089200,161327951,2094500.0\n4431,08/13/2015,00:00,2087500,2095500,2080200,2086600,83612688,2088850.0\n4432,08/14/2015,00:00,2084300,2095000,2082600,2094200,64655468,2085550.0\n4433,08/17/2015,00:00,2087300,2105900,2081600,2105900,72957322,2105540.0\n4434,08/18/2015,00:00,2102900,2106800,2097000,2099800,64867959,2107290.0\n4435,08/19/2015,00:00,2091000,2100100,2073500,2083200,158175490,2093580.0\n4436,08/20/2015,00:00,2065400,2071700,2039100,2039700,168829568,2045050.0\n4437,08/21/2015,00:00,2018100,2029200,1975400,1978300,302127692,1966790.0\n4438,08/24/2015,00:00,1874900,1958400,1829500,1895000,422467681,1864850.0\n4439,08/25/2015,00:00,1954500,1954500,1870600,1872700,309260532,1804070.0\n4440,08/26/2015,00:00,1922100,1947900,1883700,1944600,286850037,1857320.0\n4441,08/27/2015,00:00,1970500,1994100,1952100,1992700,223431181,1960180.0\n4442,08/28/2015,00:00,1985000,1998300,1979200,1992800,125935492,2034240.0\n4443,08/31/2015,00:00,1981400,1991200,1970200,1976700,125137509,2032760.0\n4444,09/01/2015,00:00,1930700,1947600,1907300,1917700,218973748,1943960.0\n4445,09/02/2015,00:00,1946900,1954400,1924300,1954100,135717247,1921110.0\n4446,09/03/2015,00:00,1962500,1980500,1949600,1955500,132209917,1930200.0\n4447,09/04/2015,00:00,1928800,1938600,1916100,1925900,156708531,1926840.0\n4448,09/08/2015,00:00,1959700,1976100,1951800,1974300,101013620,1971000.0\n4449,09/09/2015,00:00,1993300,1994600,1943500,1947900,124972739,1953460.0\n4450,09/10/2015,00:00,1945000,1972200,1942500,1958500,129752786,1960820.0\n4451,09/11/2015,00:00,1953200,1967600,1945400,1967400,99026646,1974960.0\n4452,09/14/2015,00:00,1969500,1970000,1954400,1960100,67361661,1958970.0\n4453,09/15/2015,00:00,1965900,1989900,1960900,1984600,101089338,1986200.0\n4454,09/16/2015,00:00,1988200,2004000,1984100,2001800,87778654,2005620.0\n4455,09/17/2015,00:00,1999600,2028400,1992800,1997300,222001098,2012690.0\n4456,09/18/2015,00:00,1957400,1975600,1949600,1954500,187553370,1980110.0\n4457,09/21/2015,00:00,1964500,1976800,1952200,1964600,89174988,1954370.0\n4458,09/22/2015,00:00,1939000,1944600,1925700,1939100,126149228,1924030.0\n4459,09/23/2015,00:00,1941300,1946700,1929100,1936000,84630237,1916900.0\n4460,09/24/2015,00:00,1921300,1934500,1905600,1929000,138435508,1920760.0\n4461,09/25/2015,00:00,1946100,1950000,1918100,1928500,123731291,1914750.0\n4462,09/28/2015,00:00,1917500,1919000,1876400,1880100,140388758,1884890.0\n4463,09/29/2015,00:00,1882400,1897400,1869300,1881200,133559566,1863410.0\n4464,09/30/2015,00:00,1904000,1918200,1894400,1916300,138923111,1885210.0\n4465,10/01/2015,00:00,1920300,1924900,1898200,1921300,120401494,1912020.0\n4466,10/02/2015,00:00,1897500,1950000,1891200,1950000,171195207,1963750.0\n4467,10/05/2015,00:00,1964700,1987400,1963300,1984700,113013522,2002910.0\n4468,10/06/2015,00:00,1982700,1989800,1970000,1977900,98202913,2006020.0\n4469,10/07/2015,00:00,1988500,1998300,1974900,1994100,109575864,2017650.0\n4470,10/08/2015,00:00,1989600,2015500,1985900,2012100,135414276,2023840.0\n4471,10/09/2015,00:00,2014000,2019000,2005800,2013300,86171310,2023840.0\n4472,10/12/2015,00:00,2014300,2017600,2009100,2015200,49928236,2030660.0\n4473,10/13/2015,00:00,2006300,2021600,2000500,2002500,73963310,2013410.0\n4474,10/14/2015,00:00,2001600,2008700,1989400,1992900,87771536,1992440.0\n4475,10/15/2015,00:00,2000500,2023500,1996400,2023500,115541959,2008910.0\n4476,10/16/2015,00:00,2028200,2032800,2019200,2032700,99255980,2030160.0\n4477,10/19/2015,00:00,2025300,2033700,2021300,2033700,69118218,2047720.0\n4478,10/20/2015,00:00,2028600,2038400,2025500,2031100,69151520,2048760.0\n4479,10/21/2015,00:00,2036400,2037900,2016500,2018500,91935632,2024420.0\n4480,10/22/2015,00:00,2030000,2055100,2028100,2052600,150245339,2041100.0\n4481,10/23/2015,00:00,2072400,2079500,2063000,2075100,122715586,2073490.0\n4482,10/26/2015,00:00,2072700,2073700,2065600,2070000,60360403,2089780.0\n4483,10/27/2015,00:00,2062000,2070000,2058000,2066000,68555036,2090160.0\n4484,10/28/2015,00:00,2070000,2089700,2062100,2089500,120529088,2090050.0\n4485,10/29/2015,00:00,2083600,2092700,2082100,2088300,76891203,2091550.0\n4486,10/30/2015,00:00,2090700,2094400,2078300,2079300,106285063,2090890.0\n4487,11/02/2015,00:00,2083600,2106200,2081800,2103900,76512481,2105080.0\n4488,11/03/2015,00:00,2099800,2116600,2097000,2110000,88875760,2111180.0\n4489,11/04/2015,00:00,2113700,2114900,2097300,2103600,85726190,2115410.0\n4490,11/05/2015,00:00,2104400,2109800,2090900,2101500,70361947,2112890.0\n4491,11/06/2015,00:00,2097400,2103200,2084700,2100400,88269574,2099230.0\n4492,11/09/2015,00:00,2093300,2094900,2069500,2080800,116567529,2080780.0\n4493,11/10/2015,00:00,2075400,2086000,2071900,2085600,66317971,2077370.0\n4494,11/11/2015,00:00,2089000,2089400,2076700,2077400,61997358,2070240.0\n4495,11/12/2015,00:00,2065100,2070600,2048200,2049000,108620680,2046780.0\n4496,11/13/2015,00:00,2043600,2046700,2024400,2025300,138508160,2019340.0\n4497,11/16/2015,00:00,2023000,2056500,2021900,2056500,98680096,2025670.0\n4498,11/17/2015,00:00,2059700,2070300,2048800,2054000,106324660,2040650.0\n4499,11/18/2015,00:00,2060300,2089000,2060100,2086800,102442425,2085610.0\n4500,11/19/2015,00:00,2085500,2090500,2082000,2085400,76035735,2106750.0\n4501,11/20/2015,00:00,2094700,2101200,2088600,2093800,81212191,2107100.0\n4502,11/23/2015,00:00,2094000,2099800,2085300,2090900,60019105,2106420.0\n4503,11/24/2015,00:00,2078700,2098300,2074100,2093700,87434656,2095910.0\n4504,11/25/2015,00:00,2094800,2097400,2090100,2093000,47935311,2095890.0\n4505,11/27/2015,00:00,2094000,2098000,2088700,2095300,29568841,2094870.0\n4506,11/30/2015,00:00,2097900,2098900,2085600,2086900,88383711,2090040.0\n4507,12/01/2015,00:00,2094200,2108200,2091200,2106800,88004669,2101170.0\n4508,12/02/2015,00:00,2106000,2110000,2082300,2085400,97535582,2092370.0\n4509,12/03/2015,00:00,2089000,2091500,2047600,2055800,136133021,2061890.0\n4510,12/04/2015,00:00,2061000,2099700,2059400,2096600,163843653,2076820.0\n4511,12/07/2015,00:00,2092000,2092400,2072000,2082700,91156641,2074360.0\n4512,12/08/2015,00:00,2064800,2080400,2057800,2069900,88063594,2076850.0\n4513,12/09/2015,00:00,2062000,2086800,2041800,2053300,141598569,2062150.0\n4514,12/10/2015,00:00,2054400,2074300,2051500,2058600,104748495,2040600.0\n4515,12/11/2015,00:00,2033800,2041400,2015100,2018800,179403932,2014930.0\n4516,12/14/2015,00:00,2021000,2030000,1999700,2030000,149245578,2011830.0\n4517,12/15/2015,00:00,2046900,2061100,2045500,2050600,136119948,2032060.0\n4518,12/16/2015,00:00,2063700,2083900,2048300,2080200,173480390,2070140.0\n4519,12/17/2015,00:00,2083700,2084800,2048400,2048600,153094246,2078580.0\n4520,12/18/2015,00:00,2027700,2028900,1999800,2000200,210818406,2023440.0\n4521,12/21/2015,00:00,2014300,2018800,2000900,2017000,85939272,1995160.0\n4522,12/22/2015,00:00,2027000,2038500,2015500,2035600,94477624,2000080.0\n4523,12/23/2015,00:00,2047000,2060700,2045800,2060500,100768218,2050140.0\n4524,12/24/2015,00:00,2057200,2063300,2054300,2056500,37303088,2080790.0\n4525,12/28/2015,00:00,2048600,2052500,2039500,2052200,61014906,2071750.0\n4526,12/29/2015,00:00,2065300,2077900,2064700,2074000,82484583,2076310.0\n4527,12/30/2015,00:00,2070900,2072100,2057600,2059300,56653819,2065030.0\n4528,12/31/2015,00:00,2051700,2058900,2038900,2038900,88561987,2047750.0\n4529,01/04/2016,00:00,2005300,2010300,1985900,2010100,194050675,2011110.0\n4530,01/05/2016,00:00,2013900,2019000,2000500,2013500,95287082,1988100.0\n4531,01/06/2016,00:00,1983300,2000500,1976000,1988500,125322778,1971960.0\n4532,01/07/2016,00:00,1953200,1974300,1935900,1939900,186961947,1932300.0\n4533,01/08/2016,00:00,1952100,1958500,1915800,1919500,167303627,1897860.0\n4534,01/11/2016,00:00,1930500,1934000,1898300,1921100,170857466,1880360.0\n4535,01/12/2016,00:00,1938500,1945500,1911400,1936600,149409008,1904340.0\n4536,01/13/2016,00:00,1945300,1948600,1883800,1888700,188087693,1895570.0\n4537,01/14/2016,00:00,1895500,1932600,1876600,1918900,190012996,1906880.0\n4538,01/15/2016,00:00,1867900,1887600,1855200,1878300,270477512,1877730.0\n4539,01/19/2016,00:00,1899500,1901100,1862100,1880600,162816196,1863900.0\n4540,01/20/2016,00:00,1850000,1874900,1810200,1858100,227085634,1855070.0\n4541,01/21/2016,00:00,1861900,1888700,1846500,1867000,146780065,1843380.0\n4542,01/22/2016,00:00,1897800,1907600,1888800,1905500,138442684,1890140.0\n4543,01/25/2016,00:00,1899100,1901500,1874100,1876300,106621985,1889140.0\n4544,01/26/2016,00:00,1884400,1905300,1880300,1902400,122035268,1911230.0\n4545,01/27/2016,00:00,1895800,1915600,1870600,1881400,146285880,1894230.0\n4546,01/28/2016,00:00,1900000,1902000,1871700,1891700,112813076,1884710.0\n4547,01/29/2016,00:00,1900300,1938700,1898800,1938700,168702015,1932330.0\n4548,02/01/2016,00:00,1925000,1945800,1918500,1936500,110539586,1947790.0\n4549,02/02/2016,00:00,1919000,1919600,1895400,1901100,155214611,1935140.0\n4550,02/03/2016,00:00,1913700,1917800,1871100,1912300,163410140,1917140.0\n4551,02/04/2016,00:00,1907200,1927400,1899600,1915300,108163692,1899480.0\n4552,02/05/2016,00:00,1909700,1910800,1872000,1879800,146276261,1879240.0\n4553,02/08/2016,00:00,1857500,1861200,1828100,1853500,154383523,1854090.0\n4554,02/09/2016,00:00,1833800,1869300,1832100,1853500,146059137,1829060.0\n4555,02/10/2016,00:00,1864400,1883200,1851200,1853100,117266734,1825830.0\n4556,02/11/2016,00:00,1823800,1841000,1810900,1830300,163939145,1824220.0\n4557,02/12/2016,00:00,1849300,1866500,1839700,1866500,104243751,1852220.0\n4558,02/16/2016,00:00,1887800,1898100,1876400,1898100,96542669,1891080.0\n4559,02/17/2016,00:00,1911200,1933200,1910100,1928700,118038289,1941040.0\n4560,02/18/2016,00:00,1932200,1932600,1917200,1920500,90826534,1961600.0\n4561,02/19/2016,00:00,1911500,1921800,1904500,1920000,98439467,1945580.0\n4562,02/22/2016,00:00,1939000,1949500,1938000,1948300,88924304,1950630.0\n4563,02/23/2016,00:00,1939900,1943200,1921800,1923300,94280136,1933260.0\n4564,02/24/2016,00:00,1906200,1935300,1893200,1932300,125633728,1936950.0\n4565,02/25/2016,00:00,1937300,1955500,1928300,1955500,98561286,1952380.0\n4566,02/26/2016,00:00,1965200,1966800,1949000,1951000,111611131,1953360.0\n4567,02/29/2016,00:00,1950800,1962300,1934400,1935600,101903944,1952530.0\n4568,03/01/2016,00:00,1950500,1982100,1944600,1982100,120346342,1975210.0\n4569,03/02/2016,00:00,1977000,1990600,1972500,1990300,89104136,1993110.0\n4570,03/03/2016,00:00,1987000,1997900,1981100,1997700,89517942,2015770.0\n4571,03/04/2016,00:00,2000000,2013500,1990300,2003600,106711620,2027340.0\n4572,03/07/2016,00:00,1994000,2010700,1992700,2006300,83187387,2014510.0\n4573,03/08/2016,00:00,1993000,1999200,1982200,1983600,108213232,1994860.0\n4574,03/09/2016,00:00,1993600,1997900,1984300,1994100,80085909,1988900.0\n4575,03/10/2016,00:00,1999000,2010500,1973800,1995400,128146107,1988020.0\n4576,03/11/2016,00:00,2012500,2028100,2011300,2027600,115060016,2017720.0\n4577,03/14/2016,00:00,2022000,2030300,2017700,2025300,64367388,2040270.0\n4578,03/15/2016,00:00,2013200,2022000,2010600,2022000,83697700,2038590.0\n4579,03/16/2016,00:00,2016200,2038200,2015600,2033900,112017848,2042260.0\n4580,03/17/2016,00:00,2032600,2052200,2027700,2047900,116797254,2046100.0\n4581,03/18/2016,00:00,2042000,2047800,2038000,2045200,118003097,2054570.0\n4582,03/21/2016,00:00,2041100,2049400,2038100,2046900,65685245,2057510.0\n4583,03/22/2016,00:00,2037400,2052300,2035700,2046200,83178482,2051100.0\n4584,03/23/2016,00:00,2041100,2043300,2030100,2032200,69049169,2034560.0\n4585,03/24/2016,00:00,2019800,2031600,2017400,2031100,71333708,2027450.0\n4586,03/28/2016,00:00,2036200,2038500,2027100,2032700,53066451,2024770.0\n4587,03/29/2016,00:00,2027500,2052300,2024100,2052300,83887128,2042710.0\n4588,03/30/2016,00:00,2063500,2068700,2055900,2061000,76192165,2065500.0\n4589,03/31/2016,00:00,2058700,2064100,2053300,2055600,76146466,2069730.0\n4590,04/01/2016,00:00,2043500,2071400,2039900,2069100,92124925,2076970.0\n4591,04/04/2016,00:00,2068400,2070700,2058900,2062900,56532432,2068970.0\n4592,04/05/2016,00:00,2046400,2052500,2039000,2041400,81083900,2048430.0\n4593,04/06/2016,00:00,2042700,2064900,2039800,2064600,80656346,2055810.0\n4594,04/07/2016,00:00,2051800,2055600,2030900,2038900,102193798,2037770.0\n4595,04/08/2016,00:00,2053200,2058400,2038800,2044800,85480012,2038910.0\n4596,04/11/2016,00:00,2052300,2060700,2039100,2039900,73916328,2039080.0\n4597,04/12/2016,00:00,2042000,2062500,2037000,2059900,100704771,2047100.0\n4598,04/13/2016,00:00,2070200,2081000,2068400,2080400,85422095,2082210.0\n4599,04/14/2016,00:00,2080300,2086000,2076000,2080200,55930929,2094430.0\n4600,04/15/2016,00:00,2080000,2081100,2074000,2078000,69798928,2096630.0\n4601,04/18/2016,00:00,2071100,2092700,2070000,2092500,69184743,2097040.0\n4602,04/19/2016,00:00,2097000,2102000,2089400,2099100,81005196,2100950.0\n4603,04/20/2016,00:00,2099000,2109200,2094000,2100700,68129528,2108730.0\n4604,04/21/2016,00:00,2101300,2102500,2086600,2089000,66185715,2100920.0\n4605,04/22/2016,00:00,2085300,2092900,2079200,2089600,81454081,2089410.0\n4606,04/25/2016,00:00,2082800,2086200,2075400,2085900,54918433,2081610.0\n4607,04/26/2016,00:00,2090200,2095200,2083700,2090000,67103310,2083690.0\n4608,04/27/2016,00:00,2084600,2098100,2080600,2093800,65535983,2092660.0\n4609,04/28/2016,00:00,2084900,2097600,2069700,2074200,80393263,2079830.0\n4610,04/29/2016,00:00,2067100,2071300,2050300,2063000,110829381,2062900.0\n4611,05/02/2016,00:00,2069000,2081800,2064100,2080300,55377797,2065200.0\n4612,05/03/2016,00:00,2065000,2067900,2052800,2061300,89754991,2056850.0\n4613,05/04/2016,00:00,2050000,2058300,2044200,2049600,74239405,2050410.0\n4614,05/05/2016,00:00,2055700,2059800,2044700,2049500,57183088,2043430.0\n4615,05/06/2016,00:00,2040400,2057700,2038800,2057000,70502951,2042020.0\n4616,05/09/2016,00:00,2055800,2064000,2053700,2058900,60302710,2056040.0\n4617,05/10/2016,00:00,2066400,2084600,2066400,2084600,65978296,2083740.0\n4618,05/11/2016,00:00,2078900,2083300,2065000,2065000,72657913,2080580.0\n4619,05/12/2016,00:00,2072900,2074800,2053700,2065500,77898879,2073130.0\n4620,05/13/2016,00:00,2062300,2068600,2043800,2047200,83635846,2051490.0\n4621,05/16/2016,00:00,2049500,2073400,2048900,2068100,68003049,2050840.0\n4622,05/17/2016,00:00,2064400,2068000,2042300,2048200,100223310,2049500.0\n4623,05/18/2016,00:00,2044400,2063000,2036400,2049100,102872425,2046080.0\n4624,05/19/2016,00:00,2040000,2045400,2027800,2042400,104044038,2042420.0\n4625,05/20/2016,00:00,2049500,2060900,2048600,2054900,90968053,2042880.0\n4626,05/23/2016,00:00,2054800,2058400,2049900,2051600,52302088,2053020.0\n4627,05/24/2016,00:00,2061500,2082400,2061400,2078700,84293252,2075860.0\n4628,05/25/2016,00:00,2086400,2097700,2086200,2092600,71874969,2101300.0\n4629,05/26/2016,00:00,2094700,2097100,2089700,2093400,48058849,2109640.0\n4630,05/27/2016,00:00,2095500,2102100,2094700,2102100,53233980,2118390.0\n4631,05/31/2016,00:00,2105300,2106900,2091800,2100800,87775464,2109630.0\n4632,06/01/2016,00:00,2091500,2104800,2088900,2103000,64263039,2106840.0\n4633,06/02/2016,00:00,2098000,2109200,2092400,2109200,56601095,2111450.0\n4634,06/03/2016,00:00,2103200,2106900,2088600,2102800,89799792,2106520.0\n4635,06/06/2016,00:00,2107100,2117600,2105100,2113900,57500239,2113740.0\n4636,06/07/2016,00:00,2115600,2123400,2115000,2117000,52942760,2118990.0\n4637,06/08/2016,00:00,2118000,2125200,2116900,2123900,57416846,2126440.0\n4638,06/09/2016,00:00,2114900,2122200,2111900,2120400,72933317,2129160.0\n4639,06/10/2016,00:00,2104300,2108600,2094400,2100300,100123152,2107960.0\n4640,06/13/2016,00:00,2093400,2103700,2083500,2084200,99528764,2082400.0\n4641,06/14/2016,00:00,2079700,2087400,2069200,2080900,112987135,2065280.0\n4642,06/15/2016,00:00,2085700,2092000,2075300,2077800,94632612,2061340.0\n4643,06/16/2016,00:00,2067400,2085700,2055900,2083500,139759122,2073340.0\n4644,06/17/2016,00:00,2071400,2072000,2057500,2065300,108517057,2067780.0\n4645,06/20/2016,00:00,2088400,2096000,2077500,2079100,74625875,2072490.0\n4646,06/21/2016,00:00,2082600,2089200,2077900,2084100,66630510,2080420.0\n4647,06/22/2016,00:00,2086900,2094900,2079400,2080300,90582991,2082180.0\n4648,06/23/2016,00:00,2098300,2108700,2092700,2108700,86757627,2109900.0\n4649,06/24/2016,00:00,2040000,2069000,2027200,2031300,294018070,2055400.0\n4650,06/27/2016,00:00,2015900,2015900,1986500,1995300,216490003,1991960.0\n4651,06/28/2016,00:00,2016600,2032200,2011200,2032200,145242853,1986680.0\n4652,06/29/2016,00:00,2048300,2069300,2047200,2067100,122034443,2022230.0\n4653,06/30/2016,00:00,2071800,2095400,2065600,2095300,140612123,2104180.0\n4654,07/01/2016,00:00,2092900,2104900,2092900,2097900,92251985,2138050.0\n4655,07/05/2016,00:00,2089000,2090800,2077100,2083900,99629966,2115540.0\n4656,07/06/2016,00:00,2078700,2098000,2070600,2097700,87769094,2103320.0\n4657,07/07/2016,00:00,2098900,2106400,2086300,2095400,76391364,2094040.0\n4658,07/08/2016,00:00,2110000,2129400,2107800,2127000,114482147,2121290.0\n4659,07/11/2016,00:00,2131600,2140700,2129500,2134500,67609333,2146850.0\n4660,07/12/2016,00:00,2145100,2153000,2142500,2150000,91585333,2164030.0\n4661,07/13/2016,00:00,2154200,2154500,2143500,2149300,77887465,2170480.0\n4662,07/14/2016,00:00,2163400,2166600,2156600,2161100,81647966,2169280.0\n4663,07/15/2016,00:00,2167900,2168200,2153100,2158400,88704013,2168330.0\n4664,07/18/2016,00:00,2159500,2166000,2156700,2164100,48647808,2167770.0\n4665,07/19/2016,00:00,2158800,2162300,2156500,2161800,43905369,2167340.0\n4666,07/20/2016,00:00,2167500,2173700,2162400,2171300,52553592,2170480.0\n4667,07/21/2016,00:00,2169200,2172200,2157500,2162200,63005168,2168000.0\n4668,07/22/2016,00:00,2163900,2173000,2161000,2172500,52576045,2171540.0\n4669,07/25/2016,00:00,2170000,2170600,2159700,2166400,49718650,2169960.0\n4670,07/26/2016,00:00,2165300,2171700,2157600,2167500,64796484,2166960.0\n4671,07/27/2016,00:00,2171700,2172700,2156200,2165100,73524223,2166980.0\n4672,07/28/2016,00:00,2162600,2171100,2157500,2168000,59237051,2164810.0\n4673,07/29/2016,00:00,2164500,2175400,2161300,2171500,68771465,2170910.0\n4674,08/01/2016,00:00,2171500,2176500,2164100,2169300,65459572,2171280.0\n4675,08/02/2016,00:00,2166400,2168300,2145800,2155200,86422053,2160270.0\n4676,08/03/2016,00:00,2154500,2162400,2151300,2162300,46176692,2156950.0\n4677,08/04/2016,00:00,2163000,2167800,2158300,2164300,40200895,2158100.0\n4678,08/05/2016,00:00,2171900,2182300,2170700,2181400,61991590,2176490.0\n4679,08/08/2016,00:00,2183900,2185200,2177400,2180500,36959153,2189650.0\n4680,08/09/2016,00:00,2181200,2187600,2178000,2182200,48239720,2190940.0\n4681,08/10/2016,00:00,2182900,2184000,2172300,2176300,51678201,2184380.0\n4682,08/11/2016,00:00,2182500,2189400,2179500,2186800,65858201,2183420.0\n4683,08/12/2016,00:00,2182600,2187100,2179900,2184100,48330938,2185520.0\n4684,08/15/2016,00:00,2188900,2195000,2188800,2190900,43891571,2191620.0\n4685,08/16/2016,00:00,2185600,2186800,2179600,2179600,48785828,2186750.0\n4686,08/17/2016,00:00,2179800,2185300,2170200,2183800,69540455,2181890.0\n4687,08/18/2016,00:00,2183100,2189000,2182200,2189000,49012060,2186290.0\n4688,08/19/2016,00:00,2183400,2187500,2177400,2185600,68512765,2185420.0\n4689,08/22/2016,00:00,2182500,2188000,2178300,2185100,56032026,2188460.0\n4690,08/23/2016,00:00,2192300,2196000,2189000,2189300,49279171,2188690.0\n4691,08/24/2016,00:00,2188000,2189100,2173600,2178800,62792016,2180550.0\n4692,08/25/2016,00:00,2174000,2181900,2172200,2176600,61431694,2175790.0\n4693,08/26/2016,00:00,2179000,2191100,2162500,2172800,116455917,2169330.0\n4694,08/29/2016,00:00,2174300,2186600,2174000,2183400,60888768,2174840.0\n4695,08/30/2016,00:00,2182500,2185900,2173500,2179800,52513386,2180920.0\n4696,08/31/2016,00:00,2176400,2177500,2164700,2174400,71308010,2178180.0\n4697,09/01/2016,00:00,2173800,2177300,2160300,2173700,89011329,2174660.0\n4698,09/02/2016,00:00,2183600,2188700,2177000,2183600,70476391,2177270.0\n4699,09/06/2016,00:00,2187200,2190900,2178600,2190900,48541412,2189900.0\n4700,09/07/2016,00:00,2188400,2192200,2183100,2190100,72763936,2197120.0\n4701,09/08/2016,00:00,2186000,2189400,2181600,2185100,66880396,2193470.0\n4702,09/09/2016,00:00,2170000,2170200,2132500,2133200,199753948,2144600.0\n4703,09/12/2016,00:00,2123900,2168100,2123100,2164000,158990452,2139450.0\n4704,09/13/2016,00:00,2148500,2151400,2125000,2132400,166172973,2120010.0\n4705,09/14/2016,00:00,2132900,2146900,2125000,2131500,122562929,2116840.0\n4706,09/15/2016,00:00,2130000,2157300,2127600,2152800,125570649,2144790.0\n4707,09/16/2016,00:00,2135000,2136900,2125800,2133700,139164920,2130820.0\n4708,09/19/2016,00:00,2141000,2148700,2130300,2134100,75239623,2138580.0\n4709,09/20/2016,00:00,2144300,2145900,2133800,2134200,62864323,2133270.0\n4710,09/21/2016,00:00,2142200,2160300,2134400,2158200,102931692,2145990.0\n4711,09/22/2016,00:00,2169900,2175300,2167100,2171800,69951017,2176490.0\n4712,09/23/2016,00:00,2167300,2168800,2158800,2159900,63444583,2178400.0\n4713,09/26/2016,00:00,2150200,2152300,2140100,2142400,80230788,2158730.0\n4714,09/27/2016,00:00,2140300,2156800,2136200,2155700,68564482,2147280.0\n4715,09/28/2016,00:00,2158100,2168200,2147100,2166400,79072162,2154740.0\n4716,09/29/2016,00:00,2163900,2168700,2140500,2146800,115706725,2153580.0\n4717,09/30/2016,00:00,2156700,2171200,2153600,2163000,96329808,2164550.0\n4718,10/03/2016,00:00,2158100,2160400,2150400,2157800,75146488,2158180.0\n4719,10/04/2016,00:00,2158600,2161700,2139900,2146800,114252574,2147700.0\n4720,10/05/2016,00:00,2153700,2161300,2153300,2156300,63422919,2154980.0\n4721,10/06/2016,00:00,2153900,2160400,2147400,2157800,56891266,2152770.0\n4722,10/07/2016,00:00,2160600,2163000,2141900,2150400,79463848,2152680.0\n4723,10/10/2016,00:00,2161400,2167000,2159900,2161600,46875472,2161690.0\n4724,10/11/2016,00:00,2156400,2157400,2125800,2134300,119387206,2140020.0\n4725,10/12/2016,00:00,2136100,2143200,2130100,2137100,66340623,2130990.0\n4726,10/13/2016,00:00,2121500,2135900,2112100,2130100,91466314,2123170.0\n4727,10/14/2016,00:00,2141400,2146900,2130300,2131200,80852248,2119360.0\n4728,10/17/2016,00:00,2130700,2133800,2121700,2123800,53226160,2123230.0\n4729,10/18/2016,00:00,2142400,2142900,2132700,2137100,66888708,2129970.0\n4730,10/19/2016,00:00,2140000,2146400,2136000,2142800,57783289,2142390.0\n4731,10/20/2016,00:00,2138500,2145300,2131100,2138800,68059264,2145000.0\n4732,10/21/2016,00:00,2129500,2140800,2127600,2139800,78690483,2146570.0\n4733,10/24/2016,00:00,2149800,2153100,2144800,2148900,51206007,2147660.0\n4734,10/25/2016,00:00,2147000,2149800,2139800,2141700,58851733,2144770.0\n4735,10/26/2016,00:00,2132200,2144200,2129300,2137400,72529547,2141050.0\n4736,10/27/2016,00:00,2145700,2146200,2130900,2131700,68426767,2131590.0\n4737,10/28/2016,00:00,2131300,2139300,2117200,2125400,130649200,2119920.0\n4738,10/31/2016,00:00,2129500,2131900,2123700,2125500,54590230,2119020.0\n4739,11/01/2016,00:00,2129000,2129900,2096000,2110100,114185217,2107780.0\n4740,11/02/2016,00:00,2106700,2111000,2092400,2097400,91540186,2092850.0\n4741,11/03/2016,00:00,2100100,2102400,2084600,2087800,82365245,2078250.0\n4742,11/04/2016,00:00,2089100,2098800,2084000,2085500,95290592,2070570.0\n4743,11/07/2016,00:00,2114700,2131900,2113000,2131500,95548312,2111730.0\n4744,11/08/2016,00:00,2127200,2147700,2123800,2141100,97985548,2147990.0\n4745,11/09/2016,00:00,2124700,2171000,2123400,2164400,219161783,2184700.0\n4746,11/10/2016,00:00,2173500,2183100,2152300,2169200,159836491,2198430.0\n4747,11/11/2016,00:00,2161300,2167000,2153200,2164200,86128015,2182130.0\n4748,11/14/2016,00:00,2169900,2172700,2157200,2165900,85660687,2175780.0\n4749,11/15/2016,00:00,2170000,2182800,2168100,2182800,79608357,2179350.0\n4750,11/16/2016,00:00,2175200,2181400,2174200,2178700,59816015,2183440.0\n4751,11/17/2016,00:00,2180400,2190600,2179200,2189900,61742349,2195560.0\n4752,11/18/2016,00:00,2190400,2192600,2182900,2185000,79242591,2194050.0\n4753,11/21/2016,00:00,2191900,2201800,2190000,2201500,62050842,2200690.0\n4754,11/22/2016,00:00,2204900,2207900,2197300,2205800,60951795,2211920.0\n4755,11/23/2016,00:00,2200000,2207600,2197500,2207000,50177872,2214340.0\n4756,11/25/2016,00:00,2211200,2215400,2210100,2215200,30799433,2222670.0\n4757,11/28/2016,00:00,2211900,2214800,2203700,2204800,64260081,2211660.0\n4758,11/29/2016,00:00,2205800,2214400,2201700,2209100,60422740,2209700.0\n4759,11/30/2016,00:00,2216500,2218200,2203100,2203800,89052622,2204230.0\n4760,12/01/2016,00:00,2207300,2207300,2191500,2195700,73523163,2193720.0\n4761,12/02/2016,00:00,2197000,2202500,2192600,2196800,65214024,2193220.0\n4762,12/05/2016,00:00,2206700,2214000,2204200,2210000,62268605,2201520.0\n4763,12/06/2016,00:00,2212400,2217400,2206700,2217000,54251477,2216870.0\n4764,12/07/2016,00:00,2215000,2246700,2213800,2246000,100958910,2249340.0\n4765,12/08/2016,00:00,2245800,2257000,2242700,2251500,87138295,2267880.0\n4766,12/09/2016,00:00,2254400,2265100,2253700,2265100,75738981,2281330.0\n4767,12/12/2016,00:00,2264200,2269600,2257600,2262500,82237402,2281450.0\n4768,12/13/2016,00:00,2270100,2283400,2270000,2277600,98759427,2282800.0\n4769,12/14/2016,00:00,2274100,2282200,2253700,2258800,131328288,2271230.0\n4770,12/15/2016,00:00,2261300,2278100,2260100,2268100,109782020,2267110.0\n4771,12/16/2016,00:00,2259900,2260800,2246700,2250400,133572412,2253370.0\n4772,12/19/2016,00:00,2252400,2260100,2250800,2255300,77760990,2246140.0\n4773,12/20/2016,00:00,2261600,2265700,2258800,2264000,95464598,2258600.0\n4774,12/21/2016,00:00,2262700,2264500,2257700,2257700,58961932,2256940.0\n4775,12/22/2016,00:00,2256100,2257400,2249200,2253800,50253495,2259000.0\n4776,12/23/2016,00:00,2254200,2257200,2252100,2257100,30271966,2255600.0\n4777,12/27/2016,00:00,2260000,2267300,2260000,2262700,35839769,2258100.0\n4778,12/28/2016,00:00,2265900,2265900,2242800,2244000,55878521,2249510.0\n4779,12/29/2016,00:00,2244700,2248900,2238400,2243500,44831649,2242110.0\n4780,12/30/2016,00:00,2247100,2248300,2227300,2235300,86143160,2229680.0\n4781,01/03/2017,00:00,2250700,2258300,2238900,2252400,77920116,2238790.0\n4782,01/04/2017,00:00,2256400,2267500,2256100,2265800,70209892,2263950.0\n4783,01/05/2017,00:00,2262800,2265800,2254900,2264000,65938728,2273650.0\n4784,01/06/2017,00:00,2265300,2277500,2259000,2272100,62917568,2283480.0\n4785,01/09/2017,00:00,2269000,2270700,2264200,2264600,41106606,2272990.0\n4786,01/10/2017,00:00,2264700,2274400,2260100,2264600,56225536,2265680.0\n4787,01/11/2017,00:00,2263800,2271000,2255900,2271000,66005672,2269210.0\n4788,01/12/2017,00:00,2265000,2267500,2249600,2265300,67094792,2265360.0\n4789,01/13/2017,00:00,2267500,2274000,2266900,2270500,48194702,2270950.0\n4790,01/17/2017,00:00,2263000,2267800,2258000,2262500,52726727,2265370.0\n4791,01/18/2017,00:00,2265200,2268000,2259000,2267500,47432023,2264420.0\n4792,01/19/2017,00:00,2268300,2270000,2254100,2259100,60830945,2260360.0\n4793,01/20/2017,00:00,2267300,2273100,2260500,2267400,106233534,2262520.0\n4794,01/23/2017,00:00,2263700,2268000,2252700,2261500,64870592,2262970.0\n4795,01/24/2017,00:00,2264000,2280800,2262800,2276000,81566655,2272120.0\n4796,01/25/2017,00:00,2287000,2295700,2285100,2295700,65524898,2296480.0\n4797,01/26/2017,00:00,2294200,2297100,2290200,2293300,52160586,2304580.0\n4798,01/27/2017,00:00,2294400,2295900,2287600,2289700,45459870,2305350.0\n4799,01/30/2017,00:00,2281800,2282000,2264200,2275500,69104606,2283940.0\n4800,01/31/2017,00:00,2270100,2275900,2263200,2275300,63594548,2268320.0\n4801,02/01/2017,00:00,2282800,2285800,2269500,2276200,69036939,2267420.0\n4802,02/02/2017,00:00,2272400,2280900,2268300,2277700,64355660,2271890.0\n4803,02/03/2017,00:00,2288500,2295500,2284600,2293400,65321136,2291080.0\n4804,02/06/2017,00:00,2288900,2293200,2285500,2289300,52191634,2295940.0\n4805,02/07/2017,00:00,2293600,2296500,2287200,2289400,52308487,2296600.0\n4806,02/08/2017,00:00,2285900,2293900,2283100,2292400,44188553,2296060.0\n4807,02/09/2017,00:00,2295700,2309500,2295200,2306000,57358826,2302590.0\n4808,02/10/2017,00:00,2310000,2317700,2308800,2315100,53177237,2318900.0\n4809,02/13/2017,00:00,2320900,2330700,2320500,2327700,47492534,2335910.0\n4810,02/14/2017,00:00,2325500,2337100,2321600,2337000,63276400,2348910.0\n4811,02/15/2017,00:00,2334300,2351400,2333900,2349200,75351898,2359490.0\n4812,02/16/2017,00:00,2349300,2351500,2338500,2347200,77912159,2360950.0\n4813,02/17/2017,00:00,2339700,2350900,2339400,2350900,61031072,2359380.0\n4814,02/21/2017,00:00,2355100,2366800,2355100,2364900,68354069,2367090.0\n4815,02/22/2017,00:00,2360200,2365400,2358300,2362800,52965600,2368470.0\n4816,02/23/2017,00:00,2369000,2369000,2355700,2364400,66891920,2371930.0\n4817,02/24/2017,00:00,2354200,2367900,2354100,2367400,65260982,2371830.0\n4818,02/27/2017,00:00,2366100,2373100,2363500,2371100,47536121,2371220.0\n4819,02/28/2017,00:00,2367100,2369500,2360200,2364700,68854635,2369230.0\n4820,03/01/2017,00:00,2384000,2403200,2383700,2397800,118445158,2392310.0\n4821,03/02/2017,00:00,2395700,2395700,2382100,2382700,62429917,2393930.0\n4822,03/03/2017,00:00,2381900,2386100,2377300,2384200,59910203,2393360.0\n4823,03/06/2017,00:00,2374800,2381200,2370100,2377100,47626346,2384660.0\n4824,03/07/2017,00:00,2373900,2377700,2367700,2370000,51126013,2364000.0\n4825,03/08/2017,00:00,2373100,2376300,2364100,2365600,62858443,2361400.0\n4826,03/09/2017,00:00,2367100,2372400,2357400,2368600,78158975,2360290.0\n4827,03/10/2017,00:00,2379500,2380200,2365900,2376900,67005430,2371100.0\n4828,03/13/2017,00:00,2375900,2378500,2372400,2378100,44239339,2380090.0\n4829,03/14/2017,00:00,2372200,2372400,2361900,2369000,52143010,2376530.0\n4830,03/15/2017,00:00,2375600,2394300,2372900,2389500,78506663,2386590.0\n4831,03/16/2017,00:00,2391200,2392000,2381000,2384800,71500910,2387820.0\n4832,03/17/2017,00:00,2377500,2379700,2370300,2370300,66555644,2378400.0\n4833,03/20/2017,00:00,2370100,2373600,2363300,2367700,46808067,2369720.0\n4834,03/21/2017,00:00,2374900,2376100,2335800,2337300,119931847,2333470.0\n4835,03/22/2017,00:00,2337300,2346100,2330500,2342800,85892073,2325480.0\n4836,03/23/2017,00:00,2339800,2353400,2336000,2340300,89153899,2326210.0\n4837,03/24/2017,00:00,2343500,2350400,2329600,2338600,93360484,2328780.0\n4838,03/27/2017,00:00,2319700,2339200,2316100,2336200,78643223,2337120.0\n4839,03/28/2017,00:00,2333200,2358100,2331400,2353200,78046362,2347230.0\n4840,03/29/2017,00:00,2350000,2358100,2347300,2355400,48500109,2358180.0\n4841,03/30/2017,00:00,2355000,2365200,2352700,2362900,46797888,2369600.0\n4842,03/31/2017,00:00,2359100,2365100,2356800,2357400,55060512,2368650.0\n4843,04/03/2017,00:00,2357900,2360300,2339200,2353300,73352665,2357100.0\n4844,04/04/2017,00:00,2350000,2355800,2345600,2354800,47152999,2353520.0\n4845,04/05/2017,00:00,2362600,2373900,2345500,2347800,96925396,2345400.0\n4846,04/06/2017,00:00,2349600,2360400,2344300,2354400,59853359,2350090.0\n4847,04/07/2017,00:00,2351800,2360000,2346400,2352000,58063904,2351560.0\n4848,04/10/2017,00:00,2353600,2362500,2347300,2353400,62169916,2352900.0\n4849,04/11/2017,00:00,2349000,2351800,2333400,2350600,80178276,2353020.0\n4850,04/12/2017,00:00,2348000,2349500,2337700,2340300,66034492,2341260.0\n4851,04/13/2017,00:00,2336500,2344900,2325100,2325100,72058660,2324210.0\n4852,04/17/2017,00:00,2331200,2345700,2328800,2345700,56011057,2330750.0\n4853,04/18/2017,00:00,2337100,2344900,2330800,2338700,74664350,2334560.0\n4854,04/19/2017,00:00,2345200,2349500,2331800,2334400,59798136,2337380.0\n4855,04/20/2017,00:00,2341400,2358500,2337800,2353400,83135283,2353050.0\n4856,04/21/2017,00:00,2352200,2353000,2341300,2345900,92494914,2348150.0\n4857,04/24/2017,00:00,2371700,2374100,2366100,2371700,103888079,2372070.0\n4858,04/25/2017,00:00,2379300,2389500,2378100,2385500,67491880,2394330.0\n4859,04/26/2017,00:00,2385300,2395300,2383500,2384000,73538016,2398340.0\n4860,04/27/2017,00:00,2387400,2389500,2379800,2386000,45634569,2402370.0\n4861,04/28/2017,00:00,2389300,2389300,2379300,2380800,49721027,2387210.0\n4862,05/01/2017,00:00,2386600,2391700,2382000,2386800,44888079,2384440.0\n4863,05/02/2017,00:00,2388200,2389800,2383000,2387700,49086142,2387520.0\n4864,05/03/2017,00:00,2382900,2387300,2377000,2384800,61863616,2386570.0\n4865,05/04/2017,00:00,2388100,2389200,2377800,2387600,56277584,2389020.0\n4866,05/05/2017,00:00,2391600,2397200,2386900,2397000,49995690,2394870.0\n4867,05/08/2017,00:00,2397700,2399200,2391700,2396600,43249763,2399740.0\n4868,05/09/2017,00:00,2399400,2401900,2390400,2394400,46767168,2400540.0\n4869,05/10/2017,00:00,2393700,2398700,2391600,2398700,46195692,2400740.0\n4870,05/11/2017,00:00,2393100,2395700,2381400,2393800,54364403,2394810.0\n4871,05/12/2017,00:00,2390500,2392100,2386700,2389800,41779519,2390400.0\n4872,05/15/2017,00:00,2394900,2404400,2394500,2403000,51325482,2398430.0\n4873,05/16/2017,00:00,2406400,2406700,2396300,2400800,45582380,2401240.0\n4874,05/17/2017,00:00,2380900,2386400,2357500,2358200,144257251,2371060.0\n4875,05/18/2017,00:00,2357000,2377500,2354300,2367700,93498838,2357200.0\n4876,05/19/2017,00:00,2373600,2390800,2372700,2383100,97341700,2360690.0\n4877,05/22/2017,00:00,2388700,2397100,2388200,2395200,44766182,2385110.0\n4878,05/23/2017,00:00,2399800,2402400,2395200,2400500,44309601,2414570.0\n4879,05/24/2017,00:00,2403300,2407300,2399300,2406100,42561538,2418780.0\n4880,05/25/2017,00:00,2412200,2420800,2409700,2417600,57128563,2424470.0\n4881,05/26/2017,00:00,2415900,2419000,2414500,2417100,34160249,2425570.0\n4882,05/30/2017,00:00,2413200,2417900,2411600,2415000,30629121,2423260.0\n4883,05/31/2017,00:00,2418400,2418800,2406400,2414400,67558518,2418240.0\n4884,06/01/2017,00:00,2419700,2433600,2416500,2433600,58482273,2428330.0\n4885,06/02/2017,00:00,2434500,2443500,2430800,2441700,56727456,2444700.0\n4886,06/05/2017,00:00,2440200,2443000,2437600,2439900,33597787,2452050.0\n4887,06/06/2017,00:00,2433400,2439800,2431200,2432100,43156884,2444850.0\n4888,06/07/2017,00:00,2436100,2439200,2428300,2436600,43784238,2435700.0\n4889,06/08/2017,00:00,2438000,2443300,2431700,2437800,59231538,2434290.0\n4890,06/09/2017,00:00,2440700,2450100,2419500,2434100,115565354,2434330.0\n4891,06/12/2017,00:00,2430900,2434200,2423800,2433600,74220413,2434990.0\n4892,06/13/2017,00:00,2439800,2446100,2435800,2445500,53143874,2441600.0\n4893,06/14/2017,00:00,2448600,2448700,2433000,2442400,67840892,2444860.0\n4894,06/15/2017,00:00,2426900,2439100,2423700,2437700,57671192,2443460.0\n4895,06/16/2017,00:00,2428300,2428300,2416400,2426400,68393285,2430460.0\n4896,06/19/2017,00:00,2436100,2447300,2434800,2446600,51499196,2435580.0\n4897,06/20/2017,00:00,2442300,2442600,2429900,2430100,48023571,2431930.0\n4898,06/21/2017,00:00,2434600,2435900,2424200,2429500,50482105,2430250.0\n4899,06/22/2017,00:00,2429600,2435300,2426400,2428400,36622080,2428270.0\n4900,06/23/2017,00:00,2428800,2435100,2424700,2431300,56648578,2423490.0\n4901,06/26/2017,00:00,2439300,2443800,2430500,2432900,48970596,2432660.0\n4902,06/27/2017,00:00,2430100,2433800,2413100,2413300,72130894,2418710.0\n4903,06/28/2017,00:00,2425100,2437100,2422400,2434900,59025861,2426660.0\n4904,06/29/2017,00:00,2436200,2437200,2399600,2413500,97388588,2415100.0\n4905,06/30/2017,00:00,2423000,2427100,2415800,2418000,58187364,2413640.0\n4906,07/03/2017,00:00,2429000,2433800,2422100,2422100,32862520,2420570.0\n4907,07/05/2017,00:00,2426100,2430100,2417000,2427700,47672771,2421500.0\n4908,07/06/2017,00:00,2418600,2420300,2403400,2405500,57599572,2415470.0\n4909,07/07/2017,00:00,2411800,2422800,2410200,2421100,43893302,2415760.0\n4910,07/10/2017,00:00,2419800,2428000,2417800,2423700,31706829,2419000.0\n4911,07/11/2017,00:00,2421200,2425500,2408500,2421900,45825492,2421960.0\n4912,07/12/2017,00:00,2433100,2442000,2433100,2440100,46071933,2443460.0\n4913,07/13/2017,00:00,2440200,2445500,2437600,2444200,33501511,2448980.0\n4914,07/14/2017,00:00,2444000,2459700,2443100,2455600,47191923,2462930.0\n4915,07/17/2017,00:00,2454400,2459100,2453400,2455300,25751504,2468110.0\n4916,07/18/2017,00:00,2450600,2457200,2446700,2456600,36481728,2463590.0\n4917,07/19/2017,00:00,2460100,2470000,2460100,2469900,42449945,2472040.0\n4918,07/20/2017,00:00,2472500,2474200,2464700,2471000,38472135,2475300.0\n4919,07/21/2017,00:00,2464300,2469100,2461800,2468800,77627243,2476740.0\n4920,07/24/2017,00:00,2468100,2469800,2462900,2468200,32070018,2473530.0\n4921,07/25/2017,00:00,2477000,2478000,2471600,2474200,49230957,2472160.0\n4922,07/26/2017,00:00,2477800,2477900,2471300,2474300,41030559,2474900.0\n4923,07/27/2017,00:00,2479600,2480000,2456800,2472000,64357340,2475250.0\n4924,07/28/2017,00:00,2467000,2470600,2461400,2469100,40266001,2471440.0\n4925,07/31/2017,00:00,2473800,2474800,2465300,2467700,41852288,2466000.0\n4926,08/01/2017,00:00,2474500,2475000,2468000,2473200,39456990,2469310.0\n4927,08/02/2017,00:00,2474700,2476000,2463700,2474400,40002720,2473950.0\n4928,08/03/2017,00:00,2473100,2473400,2466400,2469600,35313680,2473110.0\n4929,08/04/2017,00:00,2475200,2477900,2469700,2474100,47115173,2474560.0\n4930,08/07/2017,00:00,2475000,2478700,2473700,2478700,26044202,2477210.0\n4931,08/08/2017,00:00,2474900,2489000,2468300,2472600,52101258,2475530.0\n4932,08/09/2017,00:00,2464600,2473100,2460600,2472500,55549945,2474790.0\n4933,08/10/2017,00:00,2463000,2464300,2437000,2437600,104046619,2443340.0\n4934,08/11/2017,00:00,2440000,2448000,2437500,2441200,61113729,2427520.0\n4935,08/14/2017,00:00,2455500,2467900,2455500,2465400,57898513,2444150.0\n4936,08/15/2017,00:00,2470000,2470000,2461600,2465100,47792878,2460260.0\n4937,08/16/2017,00:00,2470900,2475700,2464600,2469400,49448733,2481990.0\n4938,08/17/2017,00:00,2462600,2466000,2430900,2430900,115678588,2449420.0\n4939,08/18/2017,00:00,2429500,2441900,2422000,2427100,118659025,2418340.0\n4940,08/21/2017,00:00,2426400,2432000,2418300,2429000,52959492,2409950.0\n4941,08/22/2017,00:00,2436000,2456200,2435500,2454400,56390025,2432590.0\n4942,08/23/2017,00:00,2443400,2450500,2441800,2445600,41275750,2454410.0\n4943,08/24/2017,00:00,2450000,2451800,2437500,2439900,44822885,2451860.0\n4944,08/25/2017,00:00,2448900,2456100,2443900,2445600,53279580,2448510.0\n4945,08/28/2017,00:00,2451700,2451900,2440900,2445700,30596755,2441020.0\n4946,08/29/2017,00:00,2431300,2451500,2429300,2448500,45762826,2448540.0\n4947,08/30/2017,00:00,2448600,2463200,2446200,2460100,51768706,2460950.0\n4948,08/31/2017,00:00,2467500,2477700,2466100,2474900,74827764,2476860.0\n4949,09/01/2017,00:00,2479800,2483300,2476700,2478400,48254590,2489060.0\n4950,09/05/2017,00:00,2472700,2475200,2449500,2460600,80412244,2477250.0\n4951,09/06/2017,00:00,2468700,2472800,2462300,2469000,51824854,2469650.0\n4952,09/07/2017,00:00,2472700,2472700,2464000,2468700,51789141,2463780.0\n4953,09/08/2017,00:00,2465400,2471000,2463000,2465800,50483333,2463370.0\n4954,09/11/2017,00:00,2480400,2493000,2480300,2492100,58404461,2489180.0\n4955,09/12/2017,00:00,2496400,2500700,2494200,2500500,49393581,2505140.0\n4956,09/13/2017,00:00,2497300,2502100,2496000,2501700,42484385,2515970.0\n4957,09/14/2017,00:00,2498300,2503200,2496000,2500900,65581923,2516140.0\n4958,09/15/2017,00:00,2487000,2492900,2485700,2491900,68255555,2497420.0\n4959,09/18/2017,00:00,2496200,2501100,2492800,2497200,38706384,2493520.0\n4960,09/19/2017,00:00,2500000,2500700,2496000,2499700,38421723,2495970.0\n4961,09/20/2017,00:00,2500700,2501900,2489200,2500600,50752645,2500220.0\n4962,09/21/2017,00:00,2498700,2499800,2491900,2493900,43352855,2498880.0\n4963,09/22/2017,00:00,2490600,2496300,2490200,2494400,35884635,2493740.0\n4964,09/25/2017,00:00,2491600,2495500,2480800,2489300,50407468,2487480.0\n4965,09/26/2017,00:00,2494500,2496900,2488100,2490800,43026163,2486540.0\n4966,09/27/2017,00:00,2498900,2504900,2488800,2500500,62619261,2496660.0\n4967,09/28/2017,00:00,2497300,2504300,2496400,2503500,36427192,2504520.0\n4968,09/29/2017,00:00,2503700,2513100,2501300,2512300,59810909,2516890.0\n4969,10/02/2017,00:00,2515000,2523200,2514000,2523200,45157038,2529040.0\n4970,10/03/2017,00:00,2524800,2528900,2522300,2528600,48890886,2536390.0\n4971,10/04/2017,00:00,2527200,2534400,2525600,2531600,39214468,2541590.0\n4972,10/05/2017,00:00,2535400,2546800,2534100,2546600,57502282,2551560.0\n4973,10/06/2017,00:00,2541600,2544600,2538600,2543700,63350212,2552440.0\n4974,10/09/2017,00:00,2546500,2547000,2536500,2539500,27885527,2548170.0\n4975,10/10/2017,00:00,2545900,2550500,2539800,2546200,35938141,2548150.0\n4976,10/11/2017,00:00,2545300,2550200,2543200,2550200,35324039,2548150.0\n4977,10/12/2017,00:00,2546800,2550600,2543700,2546400,39362384,2550030.0\n4978,10/13/2017,00:00,2551500,2552700,2547600,2549500,39906982,2552420.0\n4979,10/16/2017,00:00,2552000,2555000,2548200,2552900,31623755,2552850.0\n4980,10/17/2017,00:00,2552400,2555200,2549800,2554700,29021655,2555390.0\n4981,10/18/2017,00:00,2559200,2559500,2555000,2557200,32340875,2560180.0\n4982,10/19/2017,00:00,2548300,2558200,2543500,2557900,51983499,2560770.0\n4983,10/20/2017,00:00,2567300,2571400,2564200,2571100,68864750,2570640.0\n4984,10/23/2017,00:00,2575100,2575100,2560200,2561100,50941227,2568410.0\n4985,10/24/2017,00:00,2565600,2568300,2561500,2565600,57258734,2568580.0\n4986,10/25/2017,00:00,2562300,2563100,2540000,2552900,84509571,2557070.0\n4987,10/26/2017,00:00,2560100,2563000,2555600,2556200,60425004,2549980.0\n4988,10/27/2017,00:00,2564700,2578900,2561600,2577100,68581031,2569360.0\n4989,10/30/2017,00:00,2570900,2576000,2564100,2567500,45270942,2572260.0\n4990,10/31/2017,00:00,2572100,2574400,2568100,2571500,42638839,2579590.0\n4991,11/01/2017,00:00,2581000,2584300,2570700,2574900,47993039,2578980.0\n4992,11/02/2017,00:00,2574300,2577500,2561900,2575900,48827159,2574880.0\n4993,11/03/2017,00:00,2578200,2585000,2573100,2584500,45788670,2586380.0\n4994,11/06/2017,00:00,2583100,2590000,2582200,2588500,40510098,2592140.0\n4995,11/07/2017,00:00,2590000,2593500,2580900,2586700,51927624,2592960.0\n4996,11/08/2017,00:00,2584600,2592200,2581500,2591100,40183247,2595120.0\n4997,11/09/2017,00:00,2577400,2583900,2563600,2581700,88196762,2585600.0\n4998,11/10/2017,00:00,2577100,2582100,2573700,2580900,46236809,2579720.0\n4999,11/13/2017,00:00,2573200,2585900,2572700,2583300,41967655,2579640.0\n5000,11/14/2017,00:00,2574400,2578500,2565200,2577300,50761825,2575060.0\n5001,11/15/2017,00:00,2566200,2572200,2556300,2564400,68119981,2566060.0\n5002,11/16/2017,00:00,2575200,2590400,2574800,2586200,68715102,2575930.0\n5003,11/17/2017,00:00,2582000,2584400,2577800,2578600,65649757,2577810.0\n5004,11/20/2017,00:00,2581500,2585200,2578600,2583000,38680440,2585580.0\n5005,11/21/2017,00:00,2591900,2602000,2591000,2599900,59121571,2602760.0\n5006,11/22/2017,00:00,2600700,2601500,2595800,2597600,36058663,2602290.0\n5007,11/24/2017,00:00,2603200,2604800,2601600,2603600,20775775,2611920.0\n5008,11/27/2017,00:00,2603800,2607500,2600000,2602300,43626677,2609970.0\n5009,11/28/2017,00:00,2607900,2629000,2606600,2628700,85200455,2625110.0\n5010,11/29/2017,00:00,2630500,2636300,2622000,2627100,70248234,2637090.0\n5011,11/30/2017,00:00,2638000,2660500,2636700,2650100,102291232,2657700.0\n5012,12/01/2017,00:00,2648000,2653100,2607600,2644600,144772948,2662360.0\n5013,12/04/2017,00:00,2663800,2667900,2641200,2641400,81628604,2651250.0\n5014,12/05/2017,00:00,2644000,2651500,2630400,2631900,72059111,2639290.0\n5015,12/06/2017,00:00,2628400,2637300,2627200,2632400,63603819,2625650.0\n5016,12/07/2017,00:00,2630800,2644300,2629400,2640700,66321314,2633160.0\n5017,12/08/2017,00:00,2650000,2655200,2647200,2655100,61507907,2651160.0\n5018,12/11/2017,00:00,2656000,2663800,2654900,2663100,59974834,2670170.0\n5019,12/12/2017,00:00,2666000,2673200,2663500,2667800,70771940,2679780.0\n5020,12/13/2017,00:00,2670500,2675600,2666600,2667500,84036820,2678730.0\n5021,12/14/2017,00:00,2670900,2672100,2656000,2656600,80249826,2664240.0\n5022,12/15/2017,00:00,2655400,2670400,2653900,2665100,121594778,2661860.0\n5023,12/18/2017,00:00,2681000,2686000,2679800,2682000,63715443,2675600.0\n5024,12/19/2017,00:00,2685100,2685300,2670900,2671700,65048769,2678720.0\n5025,12/20/2017,00:00,2682500,2683300,2666900,2670300,57876020,2679340.0\n5026,12/21/2017,00:00,2677300,2683900,2673000,2675800,58124382,2675890.0\n5027,12/22/2017,00:00,2676100,2676300,2669000,2675100,49690800,2672070.0\n5028,12/26/2017,00:00,2670200,2673800,2668900,2671900,39296365,2674520.0\n5029,12/27/2017,00:00,2673500,2677300,2670200,2673200,46121058,2673830.0\n5030,12/28/2017,00:00,2678700,2679200,2674500,2678700,40062616,2676110.0\n5031,12/29/2017,00:00,2685500,2685500,2666400,2668600,60907419,2671640.0\n5032,01/02/2018,00:00,2678600,2688100,2674000,2687700,60549562,2684120.0\n5033,01/03/2018,00:00,2689900,2706400,2689500,2704700,69993787,2704180.0\n5034,01/04/2018,00:00,2712200,2721600,2711000,2716100,70499774,2724430.0\n5035,01/05/2018,00:00,2725600,2735600,2719500,2734200,62838867,2750140.0\n5036,01/08/2018,00:00,2733200,2741000,2729800,2739200,45590194,2756130.0\n5037,01/09/2018,00:00,2744300,2752400,2740900,2745400,50588042,2759270.0\n5038,01/10/2018,00:00,2737100,2744200,2729200,2741200,52504885,2753640.0\n5039,01/11/2018,00:00,2747500,2761200,2745600,2761200,57132771,2761040.0\n5040,01/12/2018,00:00,2764300,2781100,2762700,2779200,72240014,2781980.0\n5041,01/16/2018,00:00,2794200,2800900,2761800,2769700,98395992,2785320.0\n5042,01/17/2018,00:00,2780700,2800500,2771900,2796100,86404443,2804970.0\n5043,01/18/2018,00:00,2795100,2799600,2785800,2791400,86824501,2802710.0\n5044,01/19/2018,00:00,2797000,2804100,2791400,2804100,115665358,2809550.0\n5045,01/22/2018,00:00,2801600,2826900,2801200,2826900,67806515,2834360.0\n5046,01/23/2018,00:00,2827600,2836200,2823800,2832900,78792149,2843010.0\n5047,01/24/2018,00:00,2840300,2847000,2818400,2831800,109450315,2850300.0\n5048,01/25/2018,00:00,2841600,2842700,2824100,2833000,68835239,2844550.0\n5049,01/26/2018,00:00,2843200,2865800,2839700,2865800,79736062,2861450.0\n5050,01/29/2018,00:00,2859900,2864200,2845000,2846800,75630192,2860600.0\n5051,01/30/2018,00:00,2832000,2832900,2812200,2817600,111230880,2834620.0\n5052,01/31/2018,00:00,2827500,2833000,2806800,2819000,95104527,2813580.0\n5053,02/01/2018,00:00,2811000,2830600,2806900,2815800,72849227,2794660.0\n5054,02/02/2018,00:00,2800000,2802300,2754100,2754500,149222076,2754820.0\n5055,02/05/2018,00:00,2734700,2758400,2633100,2639300,260184696,2642910.0\n5056,02/06/2018,00:00,2597300,2697000,2587000,2691300,317612443,2614410.0\n5057,02/07/2018,00:00,2684600,2723600,2676400,2676700,146912435,2613100.0\n5058,02/08/2018,00:00,2680000,2681600,2576000,2576300,210533683,2571920.0\n5059,02/09/2018,00:00,2609400,2636000,2529300,2615000,252255048,2590640.0\n5060,02/12/2018,00:00,2638900,2669800,2618800,2653400,125613495,2601290.0\n5061,02/13/2018,00:00,2640000,2666200,2633100,2660000,72719768,2649390.0\n5062,02/14/2018,00:00,2644000,2700000,2639700,2695900,104371989,2725380.0\n5063,02/15/2018,00:00,2715600,2730300,2687700,2730300,97354499,2752850.0\n5064,02/16/2018,00:00,2722700,2753200,2722700,2731100,133139606,2761850.0\n5065,02/20/2018,00:00,2720000,2736700,2705000,2714000,74302666,2749220.0\n5066,02/21/2018,00:00,2718500,2747100,2699800,2700500,78867162,2712230.0\n5067,02/22/2018,00:00,2710900,2730500,2696500,2704000,96644954,2691020.0\n5068,02/23/2018,00:00,2718400,2747100,2712600,2747100,71109438,2725940.0\n5069,02/26/2018,00:00,2759000,2780100,2752600,2779000,74117961,2781900.0\n5070,02/27/2018,00:00,2781100,2789200,2743600,2744300,84017988,2783760.0\n5071,02/28/2018,00:00,2756500,2761800,2713200,2716500,97944730,2744840.0\n5072,03/01/2018,00:00,2715000,2731700,2660000,2677000,157627163,2671970.0\n5073,03/02/2018,00:00,2657500,2697200,2648200,2690800,111706399,2648410.0\n5074,03/05/2018,00:00,2677500,2728900,2676100,2721900,82516773,2688950.0\n5075,03/06/2018,00:00,2732800,2733800,2711800,2728800,66749775,2727850.0\n5076,03/07/2018,00:00,2703900,2731700,2702100,2727800,75522183,2751140.0\n5077,03/08/2018,00:00,2735200,2742400,2724200,2741000,55014311,2753950.0\n5078,03/09/2018,00:00,2756900,2788700,2753400,2788700,93409685,2785380.0\n5079,03/12/2018,00:00,2792000,2799100,2780900,2785200,62503496,2806410.0\n5080,03/13/2018,00:00,2798400,2804000,2760300,2767200,77611771,2798880.0\n5081,03/14/2018,00:00,2778100,2780200,2746700,2753000,90187429,2767770.0\n5082,03/15/2018,00:00,2758500,2766000,2744300,2750000,68608453,2735940.0\n5083,03/16/2018,00:00,2744500,2753800,2741600,2742000,80466251,2728400.0\n5084,03/19/2018,00:00,2733400,2733800,2686300,2704900,95066872,2702740.0\n5085,03/20/2018,00:00,2709100,2716700,2701800,2709500,52033461,2692250.0\n5086,03/21/2018,00:00,2708800,2732600,2701900,2704300,71895340,2684970.0\n5087,03/22/2018,00:00,2678500,2688600,2633700,2636700,128018295,2636120.0\n5088,03/23/2018,00:00,2641700,2650200,2578300,2580500,152584561,2570700.0\n5089,03/26/2018,00:00,2621600,2654300,2594100,2651100,119051490,2584240.0\n5090,03/27/2018,00:00,2661700,2667700,2588700,2606000,116865500,2581060.0\n5091,03/28/2018,00:00,2607600,2626400,2585800,2598300,130160686,2599130.0\n5092,03/29/2018,00:00,2611200,2652600,2602800,2631500,101867581,2628240.0\n5093,04/02/2018,00:00,2625600,2631300,2546700,2574700,156224122,2574130.0\n5094,04/03/2018,00:00,2589200,2613100,2568400,2607700,112280149,2597580.0\n5095,04/04/2018,00:00,2567600,2643600,2566000,2635600,105850742,2624800.0\n5096,04/05/2018,00:00,2655500,2666400,2643300,2656400,74694497,2654390.0\n5097,04/06/2018,00:00,2634200,2651000,2580000,2597200,147082676,2642430.0\n5098,04/09/2018,00:00,2613700,2648400,2605400,2610000,91750575,2611240.0\n5099,04/10/2018,00:00,2642500,2660400,2629900,2651500,95382545,2625760.0\n5100,04/11/2018,00:00,2634200,2656400,2633900,2637600,80296381,2635550.0\n5101,04/12/2018,00:00,2652800,2670000,2650600,2659300,63531523,2676660.0\n5102,04/13/2018,00:00,2674500,2675400,2640100,2651500,74484642,2669220.0\n5103,04/16/2018,00:00,2670000,2681900,2660700,2673300,53229700,2671890.0\n5104,04/17/2018,00:00,2693300,2708700,2687500,2701900,54103741,2707500.0\n5105,04/18/2018,00:00,2706800,2713000,2698700,2703900,50299257,2719860.0\n5106,04/19/2018,00:00,2695900,2698600,2677200,2688900,66127959,2715520.0\n5107,04/20/2018,00:00,2688700,2690600,2656200,2666100,86632836,2678600.0\n5108,04/23/2018,00:00,2672800,2678800,2653500,2665700,56938463,2652240.0\n5109,04/24/2018,00:00,2677600,2679700,2612800,2629800,105344976,2619460.0\n5110,04/25/2018,00:00,2629400,2641300,2608500,2636300,85139536,2614910.0\n5111,04/26/2018,00:00,2648600,2672400,2642900,2663100,58733046,2641580.0\n5112,04/27/2018,00:00,2670000,2673300,2655000,2665600,49090356,2662030.0\n5113,04/30/2018,00:00,2672600,2678900,2644400,2645100,64203115,2665950.0\n5114,05/01/2018,00:00,2638700,2651000,2621200,2649800,60987801,2654680.0\n5115,05/02/2018,00:00,2647700,2656800,2627700,2632000,70609719,2627720.0\n5116,05/03/2018,00:00,2622800,2633600,2590500,2626200,120224810,2616170.0\n5117,05/04/2018,00:00,2615200,2667800,2611500,2660200,68817239,2644640.0\n5118,05/07/2018,00:00,2669100,2680200,2661100,2669200,47379307,2667580.0\n5119,05/08/2018,00:00,2664800,2673200,2651500,2669200,57615594,2686580.0\n5120,05/09/2018,00:00,2676700,2698600,2671000,2695000,52616842,2707940.0\n5121,05/10/2018,00:00,2703400,2723900,2702300,2720200,59562006,2726500.0\n5122,05/11/2018,00:00,2722500,2731400,2715800,2728500,49302696,2747300.0\n5123,05/14/2018,00:00,2733400,2740700,2723700,2729800,48164268,2754950.0\n5124,05/15/2018,00:00,2715200,2716100,2700300,2711000,75504782,2729380.0\n5125,05/16/2018,00:00,2711100,2727500,2711000,2722400,41303208,2718450.0\n5126,05/17/2018,00:00,2719300,2732300,2711400,2720100,49747414,2715100.0\n5127,05/18/2018,00:00,2716100,2720200,2709300,2713300,57758893,2712150.0\n5128,05/21/2018,00:00,2729900,2739800,2726000,2733700,49218301,2730990.0\n5129,05/22/2018,00:00,2739400,2742500,2722500,2726100,46039188,2729420.0\n5130,05/23/2018,00:00,2711900,2733900,2709900,2733600,52441278,2737300.0\n5131,05/24/2018,00:00,2729500,2732200,2707800,2728000,64497794,2735730.0\n5132,05/25/2018,00:00,2721500,2728600,2715800,2721500,43997689,2721830.0\n5133,05/29/2018,00:00,2702600,2711700,2677600,2690200,98456218,2694710.0\n5134,05/30/2018,00:00,2705000,2731000,2704300,2726100,61173533,2704040.0\n5135,05/31/2018,00:00,2722000,2724800,2702600,2709400,77780721,2705260.0\n5136,06/01/2018,00:00,2724900,2739400,2723300,2736000,61618180,2731100.0\n5137,06/04/2018,00:00,2745100,2751800,2742700,2749000,41517726,2760390.0\n5138,06/05/2018,00:00,2750200,2755300,2741900,2751000,43560811,2761120.0\n5139,06/06/2018,00:00,2759000,2775200,2750900,2774000,51074336,2787140.0\n5140,06/07/2018,00:00,2779800,2782800,2763400,2773700,62257297,2786860.0\n5141,06/08/2018,00:00,2767800,2782500,2766700,2781900,49348853,2792470.0\n5142,06/11/2018,00:00,2784200,2793700,2783100,2785600,44542078,2796370.0\n5143,06/12/2018,00:00,2790500,2793300,2782000,2789200,63125112,2793570.0\n5144,06/13/2018,00:00,2792100,2794800,2778000,2780300,66680720,2788290.0\n5145,06/14/2018,00:00,2790100,2793300,2780600,2787300,59029532,2786510.0\n5146,06/15/2018,00:00,2766500,2775000,2753500,2771300,95685257,2773590.0\n5147,06/18/2018,00:00,2754700,2767000,2749500,2765600,46078648,2761880.0\n5148,06/19/2018,00:00,2739800,2757500,2735300,2755000,73157804,2750210.0\n5149,06/20/2018,00:00,2762700,2767200,2755900,2759700,45977778,2746330.0\n5150,06/21/2018,00:00,2759800,2759800,2736800,2742400,63277398,2739690.0\n5151,06/22/2018,00:00,2756700,2757800,2744900,2747400,45162641,2739320.0\n5152,06/25/2018,00:00,2734500,2736100,2691100,2710000,115078014,2712210.0\n5153,06/26/2018,00:00,2716100,2725600,2707900,2716000,62816272,2699160.0\n5154,06/27/2018,00:00,2722700,2738700,2691800,2693500,89809831,2683100.0\n5155,06/28/2018,00:00,2692600,2717500,2684900,2708900,69724773,2687110.0\n5156,06/29/2018,00:00,2720800,2736600,2711900,2712800,71773644,2707790.0\n5157,07/02/2018,00:00,2695100,2720400,2692400,2718600,54236596,2717310.0\n5158,07/03/2018,00:00,2728800,2729800,2704200,2709000,35551259,2720770.0\n5159,07/05/2018,00:00,2721600,2731800,2709600,2731100,51422807,2728260.0\n5160,07/06/2018,00:00,2731400,2758400,2727200,2754200,53890390,2753730.0\n5161,07/09/2018,00:00,2765600,2779600,2765100,2779000,42066501,2788180.0\n5162,07/10/2018,00:00,2784000,2790100,2780900,2789000,45949582,2814830.0\n5163,07/11/2018,00:00,2771700,2780300,2765200,2768600,65023147,2797320.0\n5164,07/12/2018,00:00,2782900,2794300,2776100,2793700,52468803,2797480.0\n5165,07/13/2018,00:00,2791900,2799300,2786600,2795900,40862085,2796790.0\n5166,07/16/2018,00:00,2796600,2798000,2788400,2793400,37927451,2798950.0\n5167,07/17/2018,00:00,2784800,2809100,2784100,2804700,47922571,2812830.0\n5168,07/18/2018,00:00,2805700,2811800,2800600,2810600,35961053,2812440.0\n5169,07/19/2018,00:00,2803100,2807400,2794600,2800000,48872857,2808540.0\n5170,07/20/2018,00:00,2798000,2804800,2795100,2796800,61205760,2801730.0\n5171,07/23/2018,00:00,2794600,2804100,2790600,2802000,40201459,2797060.0\n5172,07/24/2018,00:00,2817900,2825500,2806400,2816100,55176993,2809000.0\n5173,07/25/2018,00:00,2813700,2843600,2812800,2840100,62755526,2840850.0\n5174,07/26/2018,00:00,2831500,2841100,2830900,2833400,46601066,2851070.0\n5175,07/27/2018,00:00,2837300,2838200,2803800,2814200,69312181,2833670.0\n5176,07/30/2018,00:00,2815100,2816800,2793600,2799500,53456799,2802930.0\n5177,07/31/2018,00:00,2807000,2820200,2803800,2813300,54314615,2793850.0\n5178,08/01/2018,00:00,2814800,2821300,2801400,2808600,48996782,2798650.0\n5179,08/02/2018,00:00,2794400,2825800,2791600,2823900,50365933,2820450.0\n5180,08/03/2018,00:00,2825500,2836500,2823400,2836000,41504629,2841340.0\n5181,08/06/2018,00:00,2836400,2849700,2832100,2846400,35260013,2853720.0\n5182,08/07/2018,00:00,2854000,2860100,2852500,2855800,38972125,2869210.0\n5183,08/08/2018,00:00,2853900,2859100,2849400,2854600,34117081,2867700.0\n5184,08/09/2018,00:00,2855400,2859700,2849200,2850700,31121962,2859980.0\n5185,08/10/2018,00:00,2834200,2840500,2823600,2831600,64276743,2837410.0\n5186,08/13/2018,00:00,2834900,2841600,2817700,2821000,54746417,2814960.0\n5187,08/14/2018,00:00,2829400,2841700,2825000,2839000,37456013,2821110.0\n5188,08/15/2018,00:00,2823500,2825100,2801600,2817800,90330173,2814500.0\n5189,08/16/2018,00:00,2833800,2850400,2833600,2840600,60613010,2834440.0\n5190,08/17/2018,00:00,2837600,2855600,2833800,2850600,55316391,2852040.0\n5191,08/20/2018,00:00,2855800,2859700,2850600,2856700,36225951,2861400.0\n5192,08/21/2018,00:00,2862600,2873100,2861100,2863400,57496192,2878010.0\n5193,08/22/2018,00:00,2858900,2867600,2855800,2861700,39705478,2871100.0\n5194,08/23/2018,00:00,2859400,2869400,2854400,2857900,41655271,2863940.0\n5195,08/24/2018,00:00,2864600,2876700,2863800,2875100,45762305,2872350.0\n5196,08/27/2018,00:00,2888600,2899000,2886800,2897800,51785180,2895840.0\n5197,08/28/2018,00:00,2903000,2904100,2894000,2899200,41169485,2912810.0\n5198,08/29/2018,00:00,2901600,2917400,2898900,2914800,51917476,2930330.0\n5199,08/30/2018,00:00,2909400,2913600,2896300,2903000,55221298,2919820.0\n5200,08/31/2018,00:00,2898400,2908100,2892900,2903100,52151495,2907900.0\n5201,09/04/2018,00:00,2898500,2902100,2886900,2898100,50641175,2899470.0\n5202,09/05/2018,00:00,2894100,2896400,2878900,2890300,62293382,2885690.0\n5203,09/06/2018,00:00,2891700,2894900,2870000,2881600,57093261,2878540.0\n5204,09/07/2018,00:00,2869600,2886900,2867100,2876000,59629388,2868610.0\n5205,09/10/2018,00:00,2887400,2890400,2878800,2881000,42190430,2870850.0\n5206,09/11/2018,00:00,2873700,2895500,2869800,2890500,42539380,2883820.0\n5207,09/12/2018,00:00,2890500,2898000,2882400,2891200,53961780,2894170.0\n5208,09/13/2018,00:00,2903000,2910300,2900000,2908300,44562244,2911840.0\n5209,09/14/2018,00:00,2911100,2912700,2900000,2908800,47621027,2917980.0\n5210,09/17/2018,00:00,2908200,2908600,2890400,2893400,59631885,2905460.0\n5211,09/18/2018,00:00,2895500,2915700,2895500,2909100,50345855,2908430.0\n5212,09/19/2018,00:00,2909800,2916700,2908300,2912200,42388455,2908790.0\n5213,09/20/2018,00:00,2926400,2939400,2925100,2935800,89443398,2933700.0\n5214,09/21/2018,00:00,2931700,2932200,2918100,2919900,86818431,2937990.0\n5215,09/24/2018,00:00,2914100,2915000,2903700,2910200,44500016,2920410.0\n5216,09/25/2018,00:00,2915300,2916500,2904900,2907500,38617967,2906620.0\n5217,09/26/2018,00:00,2908900,2922400,2894100,2898800,63273109,2888520.0\n5218,09/27/2018,00:00,2904100,2919100,2901000,2906900,49923097,2897440.0\n5219,09/28/2018,00:00,2900100,2912800,2899500,2907200,55605049,2904140.0\n5220,10/01/2018,00:00,2921200,2929300,2909800,2917300,55669774,2915940.0\n5221,10/02/2018,00:00,2915700,2923600,2911500,2915600,42173808,2922360.0\n5222,10/03/2018,00:00,2927400,2932100,2913200,2917200,55817020,2921540.0\n5223,10/04/2018,00:00,2912200,2912400,2876600,2894400,99293459,2902630.0\n5224,10/05/2018,00:00,2896500,2902700,2862300,2878200,90999928,2874720.0\n5225,10/08/2018,00:00,2870600,2882200,2855000,2878200,76849736,2862580.0\n5226,10/09/2018,00:00,2874300,2888600,2867700,2874000,66107852,2857620.0\n5227,10/10/2018,00:00,2869100,2869100,2778900,2783000,181989770,2793460.0\n5228,10/11/2018,00:00,2771500,2789000,2703900,2721700,246184984,2704560.0\n5229,10/12/2018,00:00,2768600,2770800,2723700,2759500,164510497,2686370.0\n5230,10/15/2018,00:00,2755400,2770400,2743000,2744000,90506955,2691390.0\n5231,10/16/2018,00:00,2765600,2808200,2760700,2804000,98163677,2781730.0\n5232,10/17/2018,00:00,2804400,2811500,2775600,2804500,96178817,2829770.0\n5233,10/18/2018,00:00,2794100,2800700,2749700,2764000,123177259,2796050.0\n5234,10/19/2018,00:00,2771600,2793000,2754700,2762500,117788143,2774900.0\n5235,10/22/2018,00:00,2770000,2773500,2744200,2750100,73429798,2732080.0\n5236,10/23/2018,00:00,2708700,2748700,2686100,2736100,125899322,2718230.0\n5237,10/24/2018,00:00,2733300,2737600,2647000,2653200,148689080,2658780.0\n5238,10/25/2018,00:00,2673100,2718100,2662300,2700800,119060991,2654450.0\n5239,10/26/2018,00:00,2659200,2687800,2623000,2653300,178385574,2630030.0\n5240,10/29/2018,00:00,2688100,2702500,2598600,2638600,145358219,2617930.0\n5241,10/30/2018,00:00,2637300,2681200,2631200,2677700,139865192,2660760.0\n5242,10/31/2018,00:00,2707100,2732300,2701300,2706300,109862120,2685960.0\n5243,11/01/2018,00:00,2716400,2737300,2703800,2735100,90496605,2751590.0\n5244,11/02/2018,00:00,2747500,2752300,2696000,2718900,105725403,2760720.0\n5245,11/05/2018,00:00,2724800,2740100,2713500,2733900,58423015,2751880.0\n5246,11/06/2018,00:00,2733600,2753000,2732500,2751200,50219235,2755660.0\n5247,11/07/2018,00:00,2775500,2811000,2770800,2810100,86619120,2804530.0\n5248,11/08/2018,00:00,2801100,2812100,2792200,2805000,56765848,2838340.0\n5249,11/09/2018,00:00,2790000,2792300,2761800,2777600,84222634,2817920.0\n5250,11/12/2018,00:00,2772400,2774600,2720000,2725700,88721475,2748870.0\n5251,11/13/2018,00:00,2730600,2753300,2712500,2720600,87233813,2690310.0\n5252,11/14/2018,00:00,2741800,2746100,2684500,2702000,112019431,2667280.0\n5253,11/15/2018,00:00,2687600,2735400,2670200,2730200,118697478,2695670.0\n5254,11/16/2018,00:00,2717400,2747400,2701800,2737300,107996462,2733000.0\n5255,11/19/2018,00:00,2731700,2733700,2680800,2691000,88067909,2709050.0\n5256,11/20/2018,00:00,2654100,2670000,2631600,2641200,121906074,2652100.0\n5257,11/21/2018,00:00,2657800,2671500,2650200,2650200,65299409,2613150.0\n5258,11/23/2018,00:00,2631600,2648200,2631000,2632500,37268417,2595320.0\n5259,11/26/2018,00:00,2658000,2675500,2653400,2675000,67846819,2645770.0\n5260,11/27/2018,00:00,2663400,2684000,2656600,2684000,68394857,2689700.0\n5261,11/28/2018,00:00,2696100,2745800,2685400,2745800,113271909,2750310.0\n5262,11/29/2018,00:00,2737100,2755500,2724400,2739800,70520259,2781040.0\n5263,11/30/2018,00:00,2738100,2762800,2734500,2756500,79834477,2785860.0\n5264,12/03/2018,00:00,2803800,2804000,2775100,2793000,87120547,2812430.0\n5265,12/04/2018,00:00,2783400,2788400,2699000,2702500,156127119,2737500.0\n5266,12/06/2018,00:00,2659700,2699600,2624400,2698400,183371757,2697000.0\n5267,12/07/2018,00:00,2694500,2712200,2626400,2635700,141538111,2616360.0\n5268,12/10/2018,00:00,2633700,2651600,2586200,2640700,144445674,2582640.0\n5269,12/11/2018,00:00,2676200,2678600,2624800,2641300,113002276,2609690.0\n5270,12/12/2018,00:00,2674500,2689500,2653800,2654600,86056529,2629540.0\n5271,12/13/2018,00:00,2664500,2674900,2641200,2653700,86351666,2660170.0\n5272,12/14/2018,00:00,2629200,2640300,2598500,2604700,104539987,2621120.0\n5273,12/17/2018,00:00,2593900,2606500,2535300,2553600,147122082,2553990.0\n5274,12/18/2018,00:00,2571900,2579400,2533500,2550800,119888002,2511170.0\n5275,12/19/2018,00:00,2551800,2593900,2493500,2512600,197525731,2474250.0\n5276,12/20/2018,00:00,2497800,2516200,2446600,2471700,223400311,2446580.0\n5277,12/21/2018,00:00,2467500,2496900,2399900,2407000,213445004,2387450.0\n5278,12/24/2018,00:00,2390000,2402900,2343400,2343400,126345859,2300980.0\n5279,12/26/2018,00:00,2359000,2461800,2337600,2461800,194254142,2370330.0\n5280,12/27/2018,00:00,2425700,2481800,2389600,2480700,162914215,2454760.0\n5281,12/28/2018,00:00,2497300,2513200,2464500,2477500,137837623,2517570.0\n5282,12/31/2018,00:00,2495000,2501600,2474800,2499200,109065742,2550710.0\n5283,01/02/2019,00:00,2460600,2512100,2459600,2501800,113049958,2513750.0\n5284,01/03/2019,00:00,2483000,2485700,2436700,2442100,120229906,2464390.0\n5285,01/04/2019,00:00,2475900,2531100,2471700,2523900,127632690,2499610.0\n5286,01/07/2019,00:00,2527600,2559300,2517000,2543800,92782393,2535550.0\n5287,01/08/2019,00:00,2568600,2573100,2540100,2567700,91402346,2585910.0\n5288,01/09/2019,00:00,2575600,2589100,2562000,2579700,81042188,2627140.0\n5289,01/10/2019,00:00,2563100,2591500,2555200,2588800,89194945,2610490.0\n5290,01/11/2019,00:00,2576500,2589800,2570300,2589800,63179848,2607890.0\n5291,01/14/2019,00:00,2568700,2583000,2564100,2574000,55596057,2586810.0\n5292,01/15/2019,00:00,2578200,2607000,2578200,2603500,75236655,2597000.0\n5293,01/16/2019,00:00,2608200,2619600,2606000,2609800,64108161,2609890.0\n5294,01/17/2019,00:00,2600000,2639200,2599700,2629600,81545544,2635960.0\n5295,01/18/2019,00:00,2650000,2669700,2641100,2664600,107074964,2678490.0\n5296,01/22/2019,00:00,2647700,2650400,2610600,2628600,94951142,2658720.0\n5297,01/23/2019,00:00,2640000,2647600,2606600,2634100,78007199,2647620.0\n5298,01/24/2019,00:00,2632100,2641900,2620900,2635500,52302743,2632870.0\n5299,01/25/2019,00:00,2656200,2667000,2651100,2657800,82960927,2642110.0\n5300,01/28/2019,00:00,2633800,2638300,2618000,2637600,78330632,2651230.0\n5301,01/29/2019,00:00,2639300,2645500,2624800,2634100,57549403,2640450.0\n5302,01/30/2019,00:00,2650900,2685200,2642500,2675800,83541451,2665230.0\n5303,01/31/2019,00:00,2675000,2703900,2672700,2699300,80400276,2697280.0\n5304,02/01/2019,00:00,2701300,2712000,2691900,2700600,72038042,2726840.0\n5305,02/04/2019,00:00,2701400,2720200,2693600,2719600,52322390,2744620.0\n5306,02/05/2019,00:00,2724700,2734400,2718900,2731000,66377266,2744470.0\n5307,02/06/2019,00:00,2728000,2733400,2719200,2727400,48360155,2741560.0\n5308,02/07/2019,00:00,2709300,2715400,2683000,2701400,87046957,2718820.0\n5309,02/08/2019,00:00,2687200,2705100,2678300,2704700,66123754,2699000.0\n5310,02/11/2019,00:00,2711700,2714900,2700400,2706200,59745218,2692450.0\n5311,02/12/2019,00:00,2724300,2745200,2723400,2741000,63150422,2725740.0\n5312,02/13/2019,00:00,2750600,2759300,2745600,2749900,58128429,2760630.0\n5313,02/14/2019,00:00,2737700,2756400,2728700,2743800,75153118,2765690.0\n5314,02/15/2019,00:00,2763800,2774000,2761300,2773700,79085885,2784260.0\n5315,02/19/2019,00:00,2765200,2785800,2764700,2778500,52093038,2787020.0\n5316,02/20/2019,00:00,2778500,2789200,2772500,2784100,67228767,2796930.0\n5317,02/21/2019,00:00,2777500,2781000,2763500,2774200,54799005,2792220.0\n5318,02/22/2019,00:00,2781500,2793500,2778200,2791400,69886502,2789710.0\n5319,02/25/2019,00:00,2806900,2813100,2794300,2795200,63299670,2796890.0\n5320,02/26/2019,00:00,2791300,2802900,2789000,2793200,51868143,2799380.0\n5321,02/27/2019,00:00,2785300,2795900,2774800,2792000,51380666,2800420.0\n5322,02/28/2019,00:00,2789700,2794500,2783200,2786800,55290567,2788000.0\n5323,03/01/2019,00:00,2804400,2808700,2788200,2804200,66469737,2797760.0\n5324,03/04/2019,00:00,2816500,2818700,2768400,2794000,92363298,2798180.0\n5325,03/05/2019,00:00,2795500,2797600,2784100,2790200,50799626,2794520.0\n5326,03/06/2019,00:00,2791600,2791600,2769700,2773300,65186339,2777400.0\n5327,03/07/2019,00:00,2768400,2769700,2740700,2750100,87135188,2743690.0\n5328,03/08/2019,00:00,2729200,2746500,2724300,2744600,75928240,2728770.0\n5329,03/11/2019,00:00,2752400,2786200,2752300,2784400,55683813,2756430.0\n5330,03/12/2019,00:00,2790900,2800700,2788500,2794900,67070688,2792710.0\n5331,03/13/2019,00:00,2804900,2823600,2803000,2813400,67192638,2830550.0\n5332,03/14/2019,00:00,2813300,2818400,2806700,2811600,58035218,2838680.0\n5333,03/15/2019,00:00,2805600,2822000,2803400,2813100,70500698,2825710.0\n5334,03/18/2019,00:00,2815300,2826500,2813000,2823300,53932917,2828210.0\n5335,03/19/2019,00:00,2834900,2843600,2814200,2824000,75871459,2826950.0\n5336,03/20/2019,00:00,2821600,2835000,2803200,2815500,76226168,2823110.0\n5337,03/21/2019,00:00,2806300,2851800,2806000,2847300,71740185,2842820.0\n5338,03/22/2019,00:00,2832200,2838000,2791800,2792500,112328040,2809030.0\n5339,03/25/2019,00:00,2788900,2801900,2776400,2790400,76291897,2786880.0\n5340,03/26/2019,00:00,2809700,2821800,2795700,2811200,59544156,2791730.0\n5341,03/27/2019,00:00,2811300,2817500,2779300,2796500,66485128,2782710.0\n5342,03/28/2019,00:00,2803600,2812100,2790700,2807100,51663386,2810130.0\n5343,03/29/2019,00:00,2824100,2828400,2811400,2824800,62399538,2825410.0\n5344,04/01/2019,00:00,2847000,2861600,2844100,2858300,63982897,2856330.0\n5345,04/02/2019,00:00,2860400,2862300,2851000,2859700,37196324,2882560.0\n5346,04/03/2019,00:00,2873300,2877500,2857500,2864200,58863047,2887550.0\n5347,04/04/2019,00:00,2868000,2874600,2860100,2871800,46049322,2885730.0\n5348,04/05/2019,00:00,2879500,2886300,2876000,2885700,52350041,2888010.0\n5349,04/08/2019,00:00,2881000,2889000,2873700,2887900,43533191,2897230.0\n5350,04/09/2019,00:00,2877200,2880800,2867000,2873100,58219574,2886710.0\n5351,04/10/2019,00:00,2877700,2883800,2873200,2882900,45338210,2883160.0\n5352,04/11/2019,00:00,2888400,2888400,2875800,2882100,50745623,2878680.0\n5353,04/12/2019,00:00,2900100,2904700,2892600,2901600,54347951,2896440.0\n5354,04/15/2019,00:00,2902700,2903500,2890800,2899700,40803641,2909450.0\n5355,04/16/2019,00:00,2909600,2910100,2895000,2901600,47250452,2910080.0\n5356,04/17/2019,00:00,2914100,2914200,2889900,2894500,46905428,2903340.0\n5357,04/18/2019,00:00,2901200,2903200,2886600,2900200,57128888,2897120.0\n5358,04/22/2019,00:00,2891700,2904400,2890700,2902700,34371097,2901120.0\n5359,04/23/2019,00:00,2906800,2931300,2904200,2928800,48067844,2924340.0\n5360,04/24/2019,00:00,2927600,2931500,2920800,2922300,39141617,2934960.0\n5361,04/25/2019,00:00,2921200,2927800,2907300,2920500,47913789,2932960.0\n5362,04/26/2019,00:00,2921200,2934900,2912500,2934100,40182622,2938030.0\n5363,04/29/2019,00:00,2935300,2944500,2934100,2938700,54400805,2938360.0\n5364,04/30/2019,00:00,2935200,2943400,2919200,2940200,65799876,2947360.0\n5365,05/01/2019,00:00,2947600,2949500,2918000,2918100,60258030,2930710.0\n5366,05/02/2019,00:00,2916800,2927000,2895500,2911800,60849168,2909020.0\n5367,05/03/2019,00:00,2928000,2943400,2925700,2940300,46544275,2922260.0\n5368,05/06/2019,00:00,2892400,2933100,2889300,2928200,87572687,2927180.0\n5369,05/07/2019,00:00,2901500,2908100,2858200,2879300,122126119,2897180.0\n5370,05/08/2019,00:00,2875600,2894300,2868800,2875300,76825136,2866780.0\n5371,05/09/2019,00:00,2852000,2873300,2833100,2866600,92353972,2837850.0\n5372,05/10/2019,00:00,2856400,2889400,2823000,2881000,98319928,2853950.0\n5373,05/13/2019,00:00,2823900,2834900,2799300,2808600,109539319,2821450.0\n5374,05/14/2019,00:00,2820100,2851000,2818500,2834000,71206743,2810920.0\n5375,05/15/2019,00:00,2816000,2857600,2813600,2850600,63998271,2824460.0\n5376,05/16/2019,00:00,2858300,2892100,2857700,2877000,64428827,2860440.0\n5377,05/17/2019,00:00,2851300,2886000,2851300,2858400,83049965,2888500.0\n5378,05/20/2019,00:00,2840600,2854300,2831200,2839500,54207516,2857540.0\n5379,05/21/2019,00:00,2858300,2869300,2855500,2865100,42481385,2855570.0\n5380,05/22/2019,00:00,2854300,2866700,2851000,2856300,44484176,2848850.0\n5381,05/23/2019,00:00,2831600,2832100,2805800,2821400,84366849,2830980.0\n5382,05/24/2019,00:00,2837500,2841900,2820900,2827800,47298776,2821890.0\n5383,05/28/2019,00:00,2830100,2841400,2801500,2801500,60527933,2787710.0\n5384,05/29/2019,00:00,2789100,2793500,2767200,2782700,92901721,2767810.0\n5385,05/30/2019,00:00,2790800,2800400,2778100,2790300,55710278,2772550.0\n5386,05/31/2019,00:00,2762000,2771200,2752500,2752700,72088865,2742580.0\n5387,06/03/2019,00:00,2753000,2765500,2730900,2745700,87492324,2732100.0\n5388,06/04/2019,00:00,2771100,2806800,2766200,2805300,68467401,2775520.0\n5389,06/05/2019,00:00,2823400,2829900,2803200,2829600,62528891,2824080.0\n5390,06/06/2019,00:00,2832900,2855500,2825700,2848000,59513845,2878610.0\n5391,06/07/2019,00:00,2859500,2888500,2857500,2876500,64257228,2912310.0\n5392,06/10/2019,00:00,2893500,2908200,2888800,2889700,54537978,2914530.0\n5393,06/11/2019,00:00,2909500,2914000,2881900,2889000,48746820,2914710.0\n5394,06/12/2019,00:00,2886400,2892600,2878200,2883900,40324747,2902710.0\n5395,06/13/2019,00:00,2893700,2899800,2886200,2895800,43570266,2896820.0\n5396,06/14/2019,00:00,2892700,2899200,2884100,2892600,44888094,2893980.0\n5397,06/17/2019,00:00,2895300,2902200,2891800,2893700,35295998,2896430.0\n5398,06/18/2019,00:00,2913800,2935600,2910000,2924000,77625000,2921430.0\n5399,06/19/2019,00:00,2925300,2936500,2914900,2930600,70013693,2937640.0\n5400,06/20/2019,00:00,2960200,2963100,2936100,2958600,86590076,2970570.0\n5401,06/21/2019,00:00,2941400,2955100,2937600,2940000,67991002,2967540.0\n5402,06/24/2019,00:00,2941800,2945800,2934700,2936400,38096535,2948180.0\n5403,06/25/2019,00:00,2936700,2937300,2906400,2907600,71876031,2914180.0\n5404,06/26/2019,00:00,2917800,2923100,2903500,2904700,44754247,2887400.0\n5405,06/27/2019,00:00,2912900,2920600,2909300,2915000,34194112,2896230.0\n5406,06/28/2019,00:00,2925700,2935500,2920200,2930000,48292420,2917120.0\n5407,07/01/2019,00:00,2966800,2969100,2943300,2956600,62311396,2959770.0\n5408,07/02/2019,00:00,2955900,2964900,2946900,2964300,54952846,2982360.0\n5409,07/03/2019,00:00,2971900,2988200,2970200,2988000,31250129,3004870.0\n5410,07/05/2019,00:00,2974600,2986400,2960200,2984600,41808407,3006880.0\n5411,07/08/2019,00:00,2970100,2973500,2962300,2968200,38037047,2985390.0\n5412,07/09/2019,00:00,2955100,2975200,2954800,2971900,35212296,2974020.0\n5413,07/10/2019,00:00,2984000,2996600,2977900,2986100,49211837,2974810.0\n5414,07/11/2019,00:00,2993400,2995800,2982000,2993100,46132132,2991250.0\n5415,07/12/2019,00:00,2998600,3007300,2995100,3006500,35952915,3014500.0\n5416,07/15/2019,00:00,3011200,3011300,3002200,3007500,28272073,3020500.0\n5417,07/16/2019,00:00,3006400,3008800,2994400,2997100,35700618,3008980.0\n5418,07/17/2019,00:00,2997700,2999300,2977400,2977400,35522550,2984080.0\n5419,07/18/2019,00:00,2971800,2992400,2967000,2988300,46198657,2975410.0\n5420,07/19/2019,00:00,3000100,3000700,2969700,2971700,63466815,2964280.0\n5421,07/22/2019,00:00,2976100,2984900,2970500,2979000,36969602,2970130.0\n5422,07/23/2019,00:00,2991500,3000300,2982300,3000300,40884695,2994290.0\n5423,07/24/2019,00:00,2991600,3014400,2990900,3014400,39298979,3014980.0\n5424,07/25/2019,00:00,3009700,3010000,2991200,3000000,47024731,3020680.0\n5425,07/26/2019,00:00,3007700,3022300,3006200,3020100,36417399,3027330.0\n5426,07/29/2019,00:00,3018500,3019300,3008500,3014600,33607291,3020170.0\n5427,07/30/2019,00:00,2999000,3011700,2994900,3007200,39992583,3011320.0\n5428,07/31/2019,00:00,3009800,3012000,2952000,2974300,93490663,2983950.0\n5429,08/01/2019,00:00,2975600,3008700,2939600,2948400,129413425,2937810.0\n5430,08/02/2019,00:00,2938600,2941200,2909000,2926200,98958651,2903460.0\n5431,08/05/2019,00:00,2880700,2882000,2817300,2838200,153207444,2823030.0\n5432,08/06/2019,00:00,2859300,2880300,2842800,2878000,101365146,2822180.0\n5433,08/07/2019,00:00,2844000,2888200,2820600,2879700,111953123,2838420.0\n5434,08/08/2019,00:00,2896200,2936200,2890200,2936200,72990577,2910110.0\n5435,08/09/2019,00:00,2925900,2932400,2896500,2916200,80339390,2953920.0\n5436,08/12/2019,00:00,2899000,2905600,2870200,2881000,56407758,2910970.0\n5437,08/13/2019,00:00,2877800,2941500,2873600,2925500,84048259,2918640.0\n5438,08/14/2019,00:00,2880500,2887400,2837600,2839000,117557987,2844050.0\n5439,08/15/2019,00:00,2848900,2856300,2823900,2846500,83862040,2827220.0\n5440,08/16/2019,00:00,2864900,2893300,2864400,2888500,68482425,2856900.0\n5441,08/19/2019,00:00,2922300,2930800,2914400,2923300,48006246,2898090.0\n5442,08/20/2019,00:00,2917800,2923600,2899500,2900900,44802403,2939820.0\n5443,08/21/2019,00:00,2924700,2928600,2917200,2924500,43174047,2947260.0\n5444,08/22/2019,00:00,2932400,2939300,2904000,2923600,46884642,2933580.0\n5445,08/23/2019,00:00,2909500,2927600,2834700,2848500,120191247,2866090.0\n5446,08/26/2019,00:00,2872400,2880000,2855800,2880000,59943714,2860160.0\n5447,08/27/2019,00:00,2895500,2899500,2860400,2868700,61103929,2842500.0\n5448,08/28/2019,00:00,2861000,2890600,2852500,2888900,53616521,2867180.0\n5449,08/29/2019,00:00,2917700,2931600,2906200,2925800,50484863,2931430.0\n5450,08/30/2019,00:00,2942100,2942400,2914300,2924500,53366859,2941410.0\n5451,09/03/2019,00:00,2905600,2915800,2892800,2907400,56717313,2936960.0\n5452,09/04/2019,00:00,2931500,2940600,2923100,2940400,41612831,2942780.0\n5453,09/05/2019,00:00,2967800,2988200,2966500,2978200,73400759,2971470.0\n5454,09/06/2019,00:00,2982100,2987500,2974200,2980500,42688556,3001040.0\n5455,09/09/2019,00:00,2991500,2992300,2971600,2982000,46732221,3014490.0\n5456,09/10/2019,00:00,2973300,2982000,2959700,2981300,52064073,2998160.0\n5457,09/11/2019,00:00,2984900,3003300,2977500,3002500,56792958,2999720.0\n5458,09/12/2019,00:00,3012400,3024400,3004100,3012900,67811540,3017430.0\n5459,09/13/2019,00:00,3017800,3021700,3006800,3010900,54558955,3024740.0\n5460,09/16/2019,00:00,2998000,3006400,2994500,3001600,49705444,3016540.0\n5461,09/17/2019,00:00,2999100,3010200,2997700,3009200,36323494,3008050.0\n5462,09/18/2019,00:00,3004700,3012200,2982500,3011000,69120166,3007470.0\n5463,09/19/2019,00:00,3015000,3026300,3007200,3010800,69121065,3011460.0\n5464,09/20/2019,00:00,3003400,3006700,2974100,2982800,76469577,2992280.0\n5465,09/23/2019,00:00,2975700,2990000,2972800,2982100,34996734,2974460.0\n5466,09/24/2019,00:00,2994100,2998400,2948200,2958700,86035930,2949090.0\n5467,09/25/2019,00:00,2959400,2981000,2943300,2976200,59649873,2954130.0\n5468,09/26/2019,00:00,2976200,2978600,2954500,2970000,50218277,2964510.0\n5469,09/27/2019,00:00,2978700,2979400,2936900,2954000,69755359,2954730.0\n5470,09/30/2019,00:00,2959800,2975500,2959200,2967700,43647624,2964060.0\n5471,10/01/2019,00:00,2976700,2984500,2930000,2932400,82358360,2933090.0\n5472,10/02/2019,00:00,2914900,2915100,2866400,2880600,112701810,2880820.0\n5473,10/03/2019,00:00,2878100,2904200,2848200,2904200,80754022,2871770.0\n5474,10/04/2019,00:00,2912100,2946300,2910800,2943500,51702655,2902700.0\n5475,10/07/2019,00:00,2935000,2952600,2927700,2930800,53449478,2936210.0\n5476,10/08/2019,00:00,2910300,2918500,2884900,2885300,84728916,2919680.0\n5477,10/09/2019,00:00,2907800,2923000,2900600,2912700,53598153,2902940.0\n5478,10/10/2019,00:00,2911400,2942100,2910000,2932400,51438836,2908850.0\n5479,10/11/2019,00:00,2962800,2987200,2961500,2962800,84666635,2958130.0\n5480,10/14/2019,00:00,2959300,2966700,2955800,2959500,33597139,2990090.0\n5481,10/15/2019,00:00,2970500,2997000,2969700,2988800,42092291,3005030.0\n5482,10/16/2019,00:00,2984000,2991600,2979200,2984000,44244959,3004260.0\n5483,10/17/2019,00:00,2997000,3002400,2985200,2992800,42407689,3002930.0\n5484,10/18/2019,00:00,2987100,2994000,2970000,2979700,52953828,2994280.0\n5485,10/21/2019,00:00,2994800,3002100,2989400,2999900,32012712,2994410.0\n5486,10/22/2019,00:00,3006300,3009000,2989200,2990100,45261515,2995090.0\n5487,10/23/2019,00:00,2987400,2999400,2985000,2998800,29921722,2998980.0\n5488,10/24/2019,00:00,3008800,3010700,2994700,3003700,32530924,3008510.0\n5489,10/25/2019,00:00,2997400,3021900,2996900,3016000,39239172,3015440.0\n5490,10/28/2019,00:00,3029100,3038500,3029100,3033000,36575627,3039220.0\n5491,10/29/2019,00:00,3030300,3042200,3028600,3032100,41162448,3045490.0\n5492,10/30/2019,00:00,3034200,3045500,3019900,3041400,42953304,3052690.0\n5493,10/31/2019,00:00,3041100,3041300,3017400,3033300,58711304,3044060.0\n5494,11/01/2019,00:00,3049200,3061900,3047500,3061400,60530013,3057640.0\n5495,11/04/2019,00:00,3078700,3080000,3069600,3073700,53557993,3079340.0\n5496,11/05/2019,00:00,3075800,3079100,3067100,3070300,38622636,3085480.0\n5497,11/06/2019,00:00,3070600,3074000,3060700,3071000,39751180,3087230.0\n5498,11/07/2019,00:00,3086000,3094500,3076600,3081800,49868008,3083070.0\n5499,11/08/2019,00:00,3078200,3089700,3070400,3089400,40602769,3090110.0\n5500,11/11/2019,00:00,3074300,3085400,3072700,3083500,29661437,3092640.0\n5501,11/12/2019,00:00,3087500,3099900,3081500,3090000,42687583,3095050.0\n5502,11/13/2019,00:00,3079000,3095400,3076700,3091000,48941059,3092840.0\n5503,11/14/2019,00:00,3087700,3096400,3080900,3095500,45780378,3095790.0\n5504,11/15/2019,00:00,3109800,3118300,3102600,3117900,48879480,3117870.0\n5505,11/18/2019,00:00,3115200,3122800,3110300,3120200,43348280,3129110.0\n5506,11/19/2019,00:00,3126800,3126900,3112200,3119300,61908885,3133170.0\n5507,11/20/2019,00:00,3113000,3118200,3090700,3107700,67573622,3119860.0\n5508,11/21/2019,00:00,3108500,3110100,3093900,3102700,45099359,3100690.0\n5509,11/22/2019,00:00,3110600,3112300,3098500,3109600,35054695,3100560.0\n5510,11/25/2019,00:00,3119900,3133700,3119800,3133700,40447004,3123810.0\n5511,11/26/2019,00:00,3134200,3142800,3130600,3140800,33060315,3148060.0\n5512,11/27/2019,00:00,3146700,3154800,3143700,3154800,39384378,3168940.0\n5513,11/29/2019,00:00,3148900,3151300,3140600,3143100,26816024,3162830.0\n5514,12/02/2019,00:00,3146300,3146600,3111800,3116400,66926781,3128070.0\n5515,12/03/2019,00:00,3086400,3096400,3071300,3095500,66499178,3091420.0\n5516,12/04/2019,00:00,3106300,3121100,3103200,3114600,39502096,3086480.0\n5517,12/05/2019,00:00,3122200,3122400,3105900,3120200,36852740,3103680.0\n5518,12/06/2019,00:00,3141400,3153100,3141000,3148700,41180679,3145870.0\n5519,12/09/2019,00:00,3144100,3151800,3138000,3138800,30852815,3159770.0\n5520,12/10/2019,00:00,3138000,3145400,3128100,3135300,43286945,3149520.0\n5521,12/11/2019,00:00,3140500,3147000,3136000,3144200,45117507,3147820.0\n5522,12/12/2019,00:00,3144500,3179900,3141700,3171300,84790876,3162840.0\n5523,12/13/2019,00:00,3168800,3186600,3160300,3173200,69090591,3184000.0\n5524,12/16/2019,00:00,3191800,3201500,3191800,3195000,66586561,3208320.0\n5525,12/17/2019,00:00,3199800,3202400,3194800,3195700,47875424,3213890.0\n5526,12/18/2019,00:00,3200000,3202500,3195300,3195900,42877236,3207730.0\n5527,12/19/2019,00:00,3197800,3209800,3197600,3209000,66460035,3215510.0\n5528,12/20/2019,00:00,3205400,3214500,3204000,3207300,121837660,3211950.0\n5529,12/23/2019,00:00,3216300,3216500,3210700,3212200,40678424,3217340.0\n5530,12/24/2019,00:00,3214300,3215200,3209000,3212300,16196485,3218140.0\n5531,12/26/2019,00:00,3216900,3229400,3216400,3229400,27791943,3227780.0\n5532,12/27/2019,00:00,3237700,3238000,3222900,3228600,36687383,3235900.0\n5533,12/30/2019,00:00,3229400,3231000,3205500,3210800,43131761,3222710.0\n5534,12/31/2019,00:00,3205000,3221250,3201500,3218600,39932115,3218140.0\n5535,01/02/2020,00:00,3235800,3248700,3225350,3248700,48912531,3235800.0\n5536,01/03/2020,00:00,3211900,3236400,3211100,3224100,60780998,3234830.0\n5537,01/06/2020,00:00,3204400,3237300,3203600,3236400,43759922,3244730.0\n5538,01/07/2020,00:00,3230200,3235350,3222400,3227300,35212108,3232550.0\n5539,01/08/2020,00:00,3229900,3257800,3226800,3244500,57728195,3234640.0\n5540,01/09/2020,00:00,3262000,3267300,3255200,3266500,44095946,3267630.0\n5541,01/10/2020,00:00,3273600,3274600,3252050,3257100,45653071,3270540.0\n5542,01/13/2020,00:00,3264000,3279600,3259200,3279500,40497334,3290080.0\n5543,01/14/2020,00:00,3274800,3286200,3268500,3274500,55569570,3286320.0\n5544,01/15/2020,00:00,3273400,3290200,3272600,3281900,59764758,3286360.0\n5545,01/16/2020,00:00,3296700,3309200,3294500,3309200,44147974,3312420.0\n5546,01/17/2020,00:00,3317200,3321800,3310700,3319500,74196426,3327330.0\n5547,01/21/2020,00:00,3309200,3321800,3308200,3313000,64018769,3334000.0\n5548,01/22/2020,00:00,3322600,3329500,3311700,3313400,43894937,3327440.0\n5549,01/23/2020,00:00,3306000,3319200,3294100,3317200,42424449,3317430.0\n5550,01/24/2020,00:00,3324600,3325300,3273600,3287700,76182796,3292340.0\n5551,01/27/2020,00:00,3230500,3251200,3226800,3235000,70764386,3238750.0\n5552,01/28/2020,00:00,3250600,3278500,3245500,3268900,56570669,3233080.0\n5553,01/29/2020,00:00,3284000,3286200,3264000,3266200,44285050,3238760.0\n5554,01/30/2020,00:00,3243700,3279000,3235400,3276800,69267283,3269740.0\n5555,01/31/2020,00:00,3269700,3271700,3207400,3217300,97365490,3244590.0\n5556,02/03/2020,00:00,3233500,3261500,3232200,3241200,60751881,3222790.0\n5557,02/04/2020,00:00,3280700,3300100,3277350,3290600,54266275,3262380.0\n5558,02/05/2020,00:00,3322900,3330800,3306800,3328600,53887796,3323970.0\n5559,02/06/2020,00:00,3339800,3341900,3328050,3339800,43537036,3383220.0\n5560,02/07/2020,00:00,3328100,3336200,3316000,3322000,54243541,3367680.0\n5561,02/10/2020,00:00,3311900,3347200,3311900,3346800,35723822,3357300.0\n5562,02/11/2020,00:00,3361600,3370200,3347500,3352600,49571204,3354460.0\n5563,02/12/2020,00:00,3368600,3376500,3364300,3374200,35993342,3376900.0\n5564,02/13/2020,00:00,3359200,3381200,3355700,3370600,47811785,3390620.0\n5565,02/14/2020,00:00,3374800,3377200,3362000,3376000,51819302,3386960.0\n5566,02/18/2020,00:00,3365200,3371700,3352100,3367300,49435726,3377500.0\n5567,02/19/2020,00:00,3378100,3390650,3374800,3383400,36863549,3378830.0\n5568,02/20/2020,00:00,3377700,3386350,3336900,3369500,68702515,3374920.0\n5569,02/21/2020,00:00,3354100,3358100,3325800,3334800,94782814,3342140.0\n5570,02/24/2020,00:00,3231700,3258400,3212400,3224200,137060852,3235400.0\n5571,02/25/2020,00:00,3239600,3246100,3116900,3126500,197728104,3089950.0\n5572,02/26/2020,00:00,3141900,3181100,3107000,3115000,173407681,3018810.0\n5573,02/27/2020,00:00,3054500,3096400,2975100,2975100,253785330,2906540.0\n5574,02/28/2020,00:00,2886200,2962600,2855400,2962600,346777226,2878300.0\n5575,03/02/2020,00:00,2980000,3091500,2944600,3090900,207524129,2986940.0\n5576,03/03/2020,00:00,3095500,3138000,2975700,3002400,276438674,2996380.0\n5577,03/04/2020,00:00,3061100,3131000,3033300,3128600,150015051,3135960.0\n5578,03/05/2020,00:00,3049500,3084700,3000200,3024600,162185198,3090330.0\n5579,03/06/2020,00:00,2930800,2987800,2902400,2974600,201271746,2981100.0\n5580,03/09/2020,00:00,2756000,2841400,2734600,2742300,280056192,2772240.0\n5581,03/10/2020,00:00,2847600,2885200,2735000,2884200,248563890,2719530.0\n5582,03/11/2020,00:00,2807300,2819100,2708900,2743600,232891616,2678140.0\n5583,03/12/2020,00:00,2560500,2666400,2477200,2481100,347822422,2469450.0\n5584,03/13/2020,00:00,2633400,2710600,2495800,2693200,287485966,2558490.0\n5585,03/16/2020,00:00,2407800,2569000,2373700,2398500,266357640,2333580.0\n5586,03/17/2020,00:00,2450400,2559900,2370800,2528000,235335708,2414740.0\n5587,03/18/2020,00:00,2362500,2460300,2280800,2400000,300967068,2401940.0\n5588,03/19/2020,00:00,2392600,2473800,2322500,2405100,263646203,2312550.0\n5589,03/20/2020,00:00,2425900,2444600,2286200,2288000,304651791,2300750.0\n5590,03/23/2020,00:00,2280000,2293900,2182700,2229500,281816983,2157420.0\n5591,03/24/2020,00:00,2349900,2441000,2338000,2431500,214693586,2317040.0\n5592,03/25/2020,00:00,2450000,2563500,2397600,2467900,278538590,2445130.0\n5593,03/26/2020,00:00,2492600,2628000,2490500,2612000,224153673,2671700.0\n5594,03/27/2020,00:00,2532200,2608000,2510500,2534200,193638954,2691990.0\n5595,03/30/2020,00:00,2556800,2623900,2535300,2616500,141153243,2663310.0\n5596,03/31/2020,00:00,2607000,2633300,2562200,2577500,165876305,2628730.0\n5597,04/01/2020,00:00,2479500,2514400,2439000,2461500,171513817,2483030.0\n5598,04/02/2020,00:00,2452000,2526700,2446000,2518300,158102646,2485560.0\n5599,04/03/2020,00:00,2508100,2533100,2452300,2481900,121365280,2432620.0\n5600,04/06/2020,00:00,2580500,2669700,2567250,2648600,161181089,2586340.0\n5601,04/07/2020,00:00,2743000,2750000,2648900,2651300,180252896,2705290.0\n5602,04/08/2020,00:00,2680500,2760000,2655600,2740300,138883582,2792100.0\n5603,04/09/2020,00:00,2778100,2812000,2754800,2782000,163674342,2868390.0\n5604,04/13/2020,00:00,2771500,2774100,2714100,2756600,105066645,2819770.0\n5605,04/14/2020,00:00,2810800,2847500,2799100,2837900,123049134,2870470.0\n5606,04/15/2020,00:00,2775200,2795800,2754600,2777600,109527503,2818030.0\n5607,04/16/2020,00:00,2790500,2800300,2757600,2791000,111598189,2800720.0\n5608,04/17/2020,00:00,2854100,2873000,2824000,2866400,129983603,2857710.0\n5609,04/20/2020,00:00,2826000,2862900,2813600,2815900,89823671,2831200.0\n5610,04/21/2020,00:00,2764800,2780400,2720400,2730400,115363846,2775410.0\n5611,04/22/2020,00:00,2783800,2810000,2769100,2791000,82718312,2758140.0\n5612,04/23/2020,00:00,2804600,2839300,2787510,2790800,97600252,2746070.0\n5613,04/24/2020,00:00,2806900,2836900,2785000,2829700,73686003,2817960.0\n5614,04/27/2020,00:00,2850200,2882700,2846200,2870500,68934756,2898150.0\n5615,04/28/2020,00:00,2910000,2914000,2854050,2857300,97598619,2891550.0\n5616,04/29/2020,00:00,2915900,2948700,2904100,2932100,104012097,2949140.0\n5617,04/30/2020,00:00,2916900,2922300,2885900,2904800,104971069,2942420.0\n5618,05/01/2020,00:00,2851600,2860400,2815300,2827900,112895959,2867210.0\n5619,05/04/2020,00:00,2804600,2839000,2791600,2835700,70791051,2827340.0\n5620,05/05/2020,00:00,2866600,2892500,2857500,2861900,72761195,2809630.0\n5621,05/06/2020,00:00,2880100,2884600,2841500,2842500,65961054,2827380.0\n5622,05/07/2020,00:00,2877900,2897800,2871500,2876800,69442289,2880340.0\n5623,05/08/2020,00:00,2910500,2928500,2898700,2924400,62554633,2925950.0\n5624,05/11/2020,00:00,2903700,2940000,2898800,2925000,62733856,2948550.0\n5625,05/12/2020,00:00,2937500,2942200,2865500,2866700,82244098,2916060.0\n5626,05/13/2020,00:00,2859500,2871900,2789650,2816000,126198350,2827990.0\n5627,05/14/2020,00:00,2788400,2851000,2763800,2849700,110802691,2798840.0\n5628,05/15/2020,00:00,2823200,2863300,2813400,2862800,91973272,2821620.0\n5629,05/18/2020,00:00,2930900,2966750,2927000,2950000,101361961,2933060.0\n5630,05/19/2020,00:00,2944100,2962050,2919700,2919700,79323689,2971950.0\n5631,05/20/2020,00:00,2958300,2978700,2955800,2969300,68822340,2999130.0\n5632,05/21/2020,00:00,2968000,2976700,2936900,2948800,70251827,2987510.0\n5633,05/22/2020,00:00,2945600,2956300,2932300,2954400,54086999,2959810.0\n5634,05/26/2020,00:00,3019600,3021900,2987000,2990800,80856468,2994790.0\n5635,05/27/2020,00:00,3021400,3035700,2968700,3035300,92634618,3031920.0\n5636,05/28/2020,00:00,3046900,3068300,3022600,3029700,80738978,3064610.0\n5637,05/29/2020,00:00,3024600,3049600,2994700,3043200,102897180,3075630.0\n5638,06/01/2020,00:00,3036300,3062050,3030600,3055500,47464891,3072090.0\n5639,06/02/2020,00:00,3065200,3081300,3051000,3080800,67599676,3083940.0\n5640,06/03/2020,00:00,3102600,3132100,3099400,3121800,79682933,3132740.0\n5641,06/04/2020,00:00,3111200,3130000,3090800,3113600,68818172,3145110.0\n5642,06/05/2020,00:00,3174100,3212750,3171700,3193400,123509914,3205600.0\n5643,06/08/2020,00:00,3203000,3234100,3196300,3232000,65325209,3260520.0\n5644,06/09/2020,00:00,3202600,3223650,3193600,3207900,68019755,3260920.0\n5645,06/10/2020,00:00,3214000,3223900,3182300,3190000,84532800,3237570.0\n5646,06/11/2020,00:00,3113100,3121400,3000100,3006100,183916982,3040900.0\n5647,06/12/2020,00:00,3083200,3090800,2986000,3042100,170715746,2961140.0\n5648,06/15/2020,00:00,2980100,3082800,2967400,3070500,125276263,2976510.0\n5649,06/16/2020,00:00,3155600,3156400,3076800,3129600,122098812,3070740.0\n5650,06/17/2020,00:00,3140400,3143890,3108600,3116600,74761010,3165530.0\n5651,06/18/2020,00:00,3099800,3123000,3095200,3117800,65220566,3154570.0\n5652,06/19/2020,00:00,3141000,3143800,3065300,3086400,114303869,3110180.0\n5653,06/22/2020,00:00,3079500,3110500,3067500,3106200,64819717,3088220.0\n5654,06/23/2020,00:00,3135000,3145000,3116200,3120500,60336017,3108360.0\n5655,06/24/2020,00:00,3098400,3105000,3021100,3040900,116094751,3058450.0\n5656,06/25/2020,00:00,3034700,3076400,3012800,3073500,81346026,3058170.0\n5657,06/26/2020,00:00,3061700,3063800,2994200,3000500,110191083,2990800.0\n5658,06/29/2020,00:00,3014200,3044600,2989300,3044600,68919256,2998340.0\n5659,06/30/2020,00:00,3040100,3102000,3038300,3083600,87954973,3065570.0\n5660,07/01/2020,00:00,3095700,3118900,3090700,3105200,62334610,3105430.0\n5661,07/02/2020,00:00,3142400,3157000,3115100,3122300,59836713,3162500.0\n5662,07/06/2020,00:00,3163800,3176800,3155600,3170500,52435296,3192390.0\n5663,07/07/2020,00:00,3153800,3175200,3133700,3137800,72195898,3175990.0\n5664,07/08/2020,00:00,3145900,3163000,3127000,3161800,49246242,3178130.0\n5665,07/09/2020,00:00,3168500,3171000,3106800,3143800,75016501,3157530.0\n5666,07/10/2020,00:00,3142600,3178700,3127610,3175900,50767516,3163000.0\n5667,07/13/2020,00:00,3200600,3227100,3141400,3148400,88782287,3164130.0\n5668,07/14/2020,00:00,3132500,3197600,3120000,3189200,80603945,3181640.0\n5669,07/15/2020,00:00,3224800,3230350,3192700,3218500,76618906,3223970.0\n5670,07/16/2020,00:00,3197800,3212800,3190900,3207900,48326537,3228210.0\n5671,07/17/2020,00:00,3218200,3225600,3197400,3217200,54472899,3243130.0\n5672,07/20/2020,00:00,3214100,3251300,3206200,3243200,49745039,3247210.0\n5673,07/21/2020,00:00,3264800,3269200,3239400,3250100,49755103,3256930.0\n5674,07/22/2020,00:00,3246200,3272000,3245000,3268600,46779160,3283690.0\n5675,07/23/2020,00:00,3264500,3272300,3214900,3229600,69166002,3256800.0\n5676,07/24/2020,00:00,3209300,3219900,3192500,3208800,60592047,3213270.0\n5677,07/27/2020,00:00,3216300,3234100,3207800,3232200,43728174,3209180.0\n5678,07/28/2020,00:00,3224500,3236400,3208500,3211700,50744355,3196820.0\n5679,07/29/2020,00:00,3221400,3257300,3220800,3251200,44530648,3240530.0\n5680,07/30/2020,00:00,3219000,3244050,3196400,3239600,54373583,3252880.0\n5681,07/31/2020,00:00,3260000,3266100,3213400,3265200,67655356,3268150.0\n5682,08/03/2020,00:00,3283100,3296200,3277300,3287900,46717604,3301040.0\n5683,08/04/2020,00:00,3278800,3300600,3278600,3300600,38139316,3313030.0\n5684,08/05/2020,00:00,3314600,3323900,3311900,3321100,37235538,3342400.0\n5685,08/06/2020,00:00,3315200,3344600,3311400,3343300,39913430,3360440.0\n5686,08/07/2020,00:00,3332900,3348800,3323000,3345700,50273179,3367210.0\n5687,08/10/2020,00:00,3350000,3357700,3329600,3355700,39093250,3373720.0\n5688,08/11/2020,00:00,3368600,3375400,3320100,3328000,60840577,3346620.0\n5689,08/12/2020,00:00,3354700,3382800,3354300,3374400,47937318,3362770.0\n5690,08/13/2020,00:00,3365800,3382500,3358300,3368300,37594791,3373590.0\n5691,08/14/2020,00:00,3364300,3374100,3356700,3368400,42748803,3378670.0\n5692,08/17/2020,00:00,3379100,3383400,3374900,3379100,29645911,3392500.0\n5693,08/18/2020,00:00,3383200,3391000,3366200,3386400,34414214,3385760.0\n5694,08/19/2020,00:00,3391100,3396100,3366300,3372300,58910587,3382700.0\n5695,08/20/2020,00:00,3353300,3387950,3352200,3382800,37450891,3384400.0\n5696,08/21/2020,00:00,3378600,3397100,3375500,3394800,43998909,3391420.0\n5697,08/24/2020,00:00,3421300,3430000,3410600,3429200,40778173,3425530.0\n5698,08/25/2020,00:00,3435300,3442100,3422700,3441200,33649645,3459320.0\n5699,08/26/2020,00:00,3447200,3478600,3441700,3475700,44752689,3494400.0\n5700,08/27/2020,00:00,3485000,3499000,3465400,3483300,53042146,3511890.0\n5701,08/28/2020,00:00,3494500,3507100,3481600,3505800,45300252,3525630.0\n5702,08/31/2020,00:00,3503500,3512900,3491000,3493100,53787099,3519990.0\n5703,09/01/2020,00:00,3502400,3526900,3492400,3526000,48071811,3529900.0\n5704,09/02/2020,00:00,3546400,3587000,3534300,3577000,65239809,3579320.0\n5705,09/03/2020,00:00,3558500,3563800,3426100,3453900,132142532,3505190.0\n5706,09/04/2020,00:00,3460700,3478090,3348800,3425700,121071294,3433070.0\n5707,09/08/2020,00:00,3367400,3380500,3328800,3332100,102804803,3301210.0\n5708,09/09/2020,00:00,3375200,3424600,3366200,3397900,81687944,3293320.0\n5709,09/10/2020,00:00,3417500,3425200,3328600,3338900,83084631,3312360.0\n5710,09/11/2020,00:00,3357900,3369700,3310000,3340600,73834123,3318020.0\n5711,09/14/2020,00:00,3375200,3403700,3369300,3384600,57267531,3373130.0\n5712,09/15/2020,00:00,3411100,3420200,3390200,3401700,47255792,3388730.0\n5713,09/16/2020,00:00,3415000,3430600,3385300,3388200,72445309,3418710.0\n5714,09/17/2020,00:00,3335200,3376900,3330000,3358400,82845183,3386460.0\n5715,09/18/2020,00:00,3353500,3354900,3279700,3306500,90698721,3308030.0\n5716,09/21/2020,00:00,3257100,3270900,3217300,3269700,88383996,3241190.0\n5717,09/22/2020,00:00,3285500,3309000,3258700,3303000,58131952,3247430.0\n5718,09/23/2020,00:00,3309200,3312000,3221000,3226400,82043108,3212550.0\n5719,09/24/2020,00:00,3212200,3267900,3198000,3235000,71764361,3212230.0\n5720,09/25/2020,00:00,3225700,3295700,3216400,3287300,60520195,3254440.0\n5721,09/28/2020,00:00,3332200,3349600,3321600,3341900,58415562,3320330.0\n5722,09/29/2020,00:00,3340000,3347700,3316300,3323700,44028300,3373310.0\n5723,09/30/2020,00:00,3331000,3382900,3328800,3348900,84868616,3386620.0\n5724,10/01/2020,00:00,3376300,3387100,3350100,3370400,80342903,3386400.0\n5725,10/02/2020,00:00,3317100,3359150,3311900,3338400,77980566,3356570.0\n5726,10/05/2020,00:00,3360100,3399500,3360100,3397600,41167062,3396990.0\n5727,10/06/2020,00:00,3398700,3421700,3343800,3349300,82966706,3369320.0\n5728,10/07/2020,00:00,3381200,3416300,3380900,3407600,44075564,3398250.0\n5729,10/08/2020,00:00,3428800,3438500,3418700,3437800,38281729,3448780.0\n5730,10/09/2020,00:00,3455300,3473500,3448900,3468500,50708118,3481250.0\n5731,10/12/2020,00:00,3495500,3540200,3490600,3524300,64619979,3560770.0\n5732,10/13/2020,00:00,3523100,3523800,3491000,3501300,65629877,3550070.0\n5733,10/14/2020,00:00,3507300,3519300,3471500,3479300,50761914,3516980.0\n5734,10/15/2020,00:00,3437200,3480200,3431300,3475000,54266254,3480080.0\n5735,10/16/2020,00:00,3489900,3507500,3471100,3472900,64891517,3451830.0\n5736,10/19/2020,00:00,3485700,3493200,3410600,3420100,59117764,3419080.0\n5737,10/20/2020,00:00,3434200,3468800,3426500,3433800,52953855,3412450.0\n5738,10/21/2020,00:00,3433600,3456700,3424100,3427300,55820362,3405470.0\n5739,10/22/2020,00:00,3429200,3452400,3406500,3446100,48736995,3426120.0\n5740,10/23/2020,00:00,3459100,3459900,3431500,3457800,40954601,3463330.0\n5741,10/26/2020,00:00,3421400,3429800,3356300,3393900,83377228,3416990.0\n5742,10/27/2020,00:00,3397400,3401150,3379900,3382200,52891143,3378740.0\n5743,10/28/2020,00:00,3321100,3328400,3261300,3266600,113415793,3258940.0\n5744,10/29/2020,00:00,3269900,3333900,3251000,3299800,78860838,3227070.0\n5745,10/30/2020,00:00,3282800,3296800,3226000,3265400,99522697,3219760.0\n5746,11/02/2020,00:00,3302000,3323500,3272400,3302000,73909088,3254720.0\n5747,11/03/2020,00:00,3337200,3382500,3331700,3360300,80997071,3355700.0\n5748,11/04/2020,00:00,3408000,3479200,3396000,3435400,113182021,3442410.0\n5749,11/05/2020,00:00,3492800,3521900,3488750,3502400,73813299,3555320.0\n5750,11/06/2020,00:00,3499700,3515000,3476500,3501600,60701935,3582730.0\n5751,11/09/2020,00:00,3643600,3643700,3540600,3545600,145206783,3600100.0\n5752,11/10/2020,00:00,3535200,3551800,3505900,3540400,73250171,3581040.0\n5753,11/11/2020,00:00,3564300,3575600,3550700,3566700,48425558,3581560.0\n5754,11/12/2020,00:00,3555700,3564200,3512600,3532100,60620567,3561910.0\n5755,11/13/2020,00:00,3553000,3589000,3547100,3581000,51387458,3571910.0\n5756,11/16/2020,00:00,3611000,3625900,3595900,3625700,63099795,3624650.0\n5757,11/17/2020,00:00,3599700,3619200,3583400,3606200,57359007,3634120.0\n5758,11/18/2020,00:00,3609800,3615000,3562400,3562800,58727952,3607540.0\n5759,11/19/2020,00:00,3556800,3581800,3541500,3577800,51165348,3569910.0\n5760,11/20/2020,00:00,3574500,3577100,3552500,3553300,50408452,3533200.0\n5761,11/23/2020,00:00,3572500,3588200,3548650,3574600,51739439,3553130.0\n5762,11/24/2020,00:00,3603000,3638100,3592900,3632200,56453154,3620820.0\n5763,11/25/2020,00:00,3631600,3631600,3614850,3626600,35940388,3645850.0\n5764,11/27/2020,00:00,3638400,3641800,3625800,3636700,23919941,3670320.0\n5765,11/30/2020,00:00,3628400,3631200,3591800,3620600,70776034,3647090.0\n5766,12/01/2020,00:00,3656000,3676500,3649300,3660200,67257271,3650260.0\n5767,12/02/2020,00:00,3648000,3669500,3642000,3667900,38543468,3674230.0\n5768,12/03/2020,00:00,3666600,3681900,3655000,3666900,54787910,3682770.0\n5769,12/04/2020,00:00,3673000,3698500,3672200,3698500,41677506,3711570.0\n5770,12/07/2020,00:00,3689700,3696200,3677200,3690900,41405227,3704480.0\n5771,12/08/2020,00:00,3676700,3707700,3676700,3701700,35566369,3712660.0\n5772,12/09/2020,00:00,3709100,3710500,3659500,3668500,62483119,3687220.0\n5773,12/10/2020,00:00,3653900,3678550,3644500,3667300,49958315,3659940.0\n5774,12/11/2020,00:00,3649300,3665800,3632650,3663000,48805237,3651220.0\n5775,12/14/2020,00:00,3686100,3698000,3644900,3646600,56272411,3634710.0\n5776,12/15/2020,00:00,3674600,3695900,3659200,3695900,52393172,3678490.0\n5777,12/16/2020,00:00,3698100,3711600,3688800,3701700,48533538,3705410.0\n5778,12/17/2020,00:00,3719300,3724590,3710500,3722400,53146880,3738090.0\n5779,12/18/2020,00:00,3709800,3711500,3670200,3691800,97825013,3726750.0\n5780,12/21/2020,00:00,3649800,3784600,3620300,3678600,75870057,3684730.0\n5781,12/22/2020,00:00,3682300,3683300,3660400,3672400,42023209,3662660.0\n5782,12/23/2020,00:00,3683300,3696100,3673900,3675700,38573967,3654340.0\n5783,12/24/2020,00:00,3680600,3690000,3674500,3690000,21624848,3679750.0\n5784,12/28/2020,00:00,3718100,3725900,3710700,3721700,32833964,3718820.0\n5785,12/29/2020,00:00,3738500,3740000,3708300,3714600,45884792,3734000.0\n5786,12/30/2020,00:00,3723800,3730800,3715800,3719900,43472434,3738280.0\n5787,12/31/2020,00:00,3718500,3746420,3712400,3738800,55021528,3745740.0\n5788,01/04/2021,00:00,3753000,3754500,3648300,3687900,94376649,3703560.0\n5789,01/05/2021,00:00,3680500,3724800,3680500,3713300,54611244,3704520.0\n5790,01/06/2021,00:00,3696700,3769800,3691200,3735500,92950127,3720790.0\n5791,01/07/2021,00:00,3761800,3798900,3759200,3791000,62270874,3778900.0\n5792,01/08/2021,00:00,3806300,3814900,3771100,3812600,63163985,3846190.0\n5793,01/11/2021,00:00,3778400,3805700,3777200,3786900,45616919,3835150.0\n5794,01/12/2021,00:00,3788400,3798500,3763600,3787700,46336265,3812830.0\n5795,01/13/2021,00:00,3786500,3808600,3778500,3797900,39076595,3791890.0\n5796,01/14/2021,00:00,3806300,3811300,3781000,3784600,41851848,3780440.0\n5797,01/15/2021,00:00,3767100,3775800,3737200,3757000,81635248,3763950.0\n5798,01/19/2021,00:00,3782400,3792300,3767800,3786500,43441293,3769750.0\n5799,01/20/2021,00:00,3811000,3847900,3806900,3838900,54390017,3818150.0\n5800,01/21/2021,00:00,3845000,3849500,3832500,3842400,42558878,3861130.0\n5801,01/22/2021,00:00,3822400,3840800,3818400,3828800,40128912,3870570.0\n5802,01/25/2021,00:00,3836000,3847700,3784600,3843900,62710822,3859510.0\n5803,01/26/2021,00:00,3854100,3858500,3835500,3837900,39595836,3838230.0\n5804,01/27/2021,00:00,3802400,3803200,3720100,3744100,101850739,3763170.0\n5805,01/28/2021,00:00,3762700,3819300,3758900,3776300,76978675,3744760.0\n5806,01/29/2021,00:00,3755700,3766700,3682700,3700700,110053148,3676180.0\n5807,02/01/2021,00:00,3738400,3773400,3714200,3762300,65567084,3705880.0\n5808,02/02/2021,00:00,3796800,3832200,3796000,3815500,55798392,3798420.0\n5809,02/03/2021,00:00,3824300,3837000,3804800,3818500,44014303,3834420.0\n5810,02/04/2021,00:00,3830300,3862400,3827800,3861900,41511995,3905360.0\n5811,02/05/2021,00:00,3882700,3884700,3864850,3877100,40406184,3909860.0\n5812,02/08/2021,00:00,3893000,3905400,3883600,3905100,34842630,3926960.0\n5813,02/09/2021,00:00,3895500,3908900,3891700,3902500,31350935,3936380.0\n5814,02/10/2021,00:00,3921000,3922800,3875100,3900800,54203861,3920440.0\n5815,02/11/2021,00:00,3913400,3916900,3881200,3907100,39710262,3915230.0\n5816,02/12/2021,00:00,3898800,3928900,3897700,3926400,40896380,3922540.0\n5817,02/16/2021,00:00,3940600,3941600,3915400,3923000,44689625,3931940.0\n5818,02/17/2021,00:00,3904300,3926300,3893300,3923900,45915151,3934870.0\n5819,02/18/2021,00:00,3895600,3915150,3877400,3907200,53102694,3916830.0\n5820,02/19/2021,00:00,3921000,3923800,3895500,3900300,69024514,3895760.0\n5821,02/22/2021,00:00,3870600,3896200,3867400,3870300,58902644,3866240.0\n5822,02/23/2021,00:00,3847200,3889450,3802000,3875000,99054818,3854930.0\n5823,02/24/2021,00:00,3862300,3922300,3852700,3917700,65524154,3892810.0\n5824,02/25/2021,00:00,3905100,3918700,3807789,3823300,138895516,3845340.0\n5825,02/26/2021,00:00,3844400,3855800,3782300,3803600,136480361,3802450.0\n5826,03/01/2021,00:00,3856500,3909200,3855500,3895800,94752970,3841330.0\n5827,03/02/2021,00:00,3898700,3900700,3860000,3865400,73195170,3851530.0\n5828,03/03/2021,00:00,3858300,3868300,3813100,3814200,109545489,3853540.0\n5829,03/04/2021,00:00,3812200,3840000,3718800,3767000,171790812,3782760.0\n5830,03/05/2021,00:00,3804100,3847600,3726500,3836300,136356393,3770520.0\n5831,03/08/2021,00:00,3846900,3876800,3814200,3817200,108618789,3797730.0\n5832,03/09/2021,00:00,3858800,3899100,3853100,3871700,100993909,3870840.0\n5833,03/10/2021,00:00,3895900,3914000,3881702,3895800,102850671,3925500.0\n5834,03/11/2021,00:00,3922400,3956500,3917400,3935300,78605803,3954240.0\n5835,03/12/2021,00:00,3920900,3942100,3912000,3940600,58694370,3985240.0\n5836,03/15/2021,00:00,3944000,3966850,3920400,3964100,67193193,3990380.0\n5837,03/16/2021,00:00,3970600,3978300,3950800,3959100,67508285,3985600.0\n5838,03/17/2021,00:00,3945600,3981200,3933000,3972600,83563811,3982270.0\n5839,03/18/2021,00:00,3944900,3967200,3908650,3914800,101153040,3937310.0\n5840,03/19/2021,00:00,3899400,3915690,3871500,3894800,94802448,3886210.0\n5841,03/22/2021,00:00,3900100,3940500,3899800,3925900,62207903,3890180.0\n5842,03/23/2021,00:00,3918900,3934600,3886600,3895000,80338274,3877390.0\n5843,03/24/2021,00:00,3909200,3927500,3874800,3875200,86478164,3877440.0\n5844,03/25/2021,00:00,3859900,3905500,3839000,3897000,102523995,3883690.0\n5845,03/26/2021,00:00,3909800,3964100,3902900,3959800,101407276,3931520.0\n5846,03/29/2021,00:00,3943500,3967499,3928100,3957800,93832458,3980020.0\n5847,03/30/2021,00:00,3943500,3957800,3930299,3947300,66174457,3988920.0\n5848,03/31/2021,00:00,3953500,3980000,3953300,3963300,90673494,3981070.0\n"
  },
  {
    "path": "Tests/TestData/spy_tsi.csv",
    "content": "time,open,high,low,close,TSI_25_13,Signal_7\n725898600,43.9688,43.96899,43.75,43.938,NaN,NaN\n728577000,43.96875,45.125,42.8125,44.40625,NaN,NaN\n730996200,44.5625,45.84375,44.21875,45.1875,NaN,NaN\n733674600,45.25,45.25,43.28125,44.03125,NaN,NaN\n736435800,44.09375,45.65625,43.84375,45.21875,NaN,NaN\n738941400,45.375,45.8125,44.21875,45.0625,NaN,NaN\n741533400,45.125,45.21875,44.15625,44.84375,NaN,NaN\n744298200,44.90625,46.5625,44.84375,46.5625,NaN,NaN\n746890200,46.40625,46.59375,44.8125,45.9375,NaN,NaN\n749482200,45.875,47.15625,45.71875,46.84375,NaN,NaN\n752164200,46.78125,47,45.53125,46.34375,NaN,NaN\n754756200,46.59375,47.15625,46.375,46.59375,NaN,NaN\n757607400,46.59375,48.3125,46.40625,48.21875,NaN,NaN\n760113000,48.15625,48.28125,46.5625,46.8125,NaN,NaN\n762532200,46.8125,47.3125,43.53125,44.59375,NaN,NaN\n765210600,43.34375,45.35937,43.34375,45.09375,NaN,NaN\n767885400,45.09375,45.9375,44.17187,45.8125,NaN,NaN\n770477400,45.70312,46.5625,44,44.46875,NaN,NaN\n773069400,44.6875,46.04687,44.375,45.90625,NaN,NaN\n775747800,45.9375,47.98437,45.65625,47.65625,NaN,NaN\n778426200,47.5,47.71875,45.73437,46.17187,NaN,NaN\n781191000,46.20312,47.70312,45,47.48437,NaN,NaN\n783700200,47.28125,47.32812,44.60937,45.59375,NaN,NaN\n786292200,45.64062,46.40625,44.6875,45.5625,NaN,NaN\n789057000,45.70312,47.23437,45.6875,47.09375,NaN,NaN\n791649000,47.15625,49.15625,47,49.01562,NaN,NaN\n794068200,48.96875,50.89062,48.21875,50.10937,NaN,NaN\n796915800,50.09375,51.67187,50.0625,51.59375,NaN,NaN\n799335000,51.54687,53.64062,51.39062,53.64062,NaN,NaN\n802013400,53.40625,55.15625,52.75,54.40625,NaN,NaN\n804778200,54.46875,56.70312,54.20312,56.15625,NaN,NaN\n807283800,56.23437,56.79687,55.42187,56.40625,NaN,NaN\n809962200,56.39062,58.90625,56.34375,58.48437,NaN,NaN\n812640600,58.48437,59.1875,57.26562,58.3125,NaN,NaN\n815236200,58.28125,61.20312,58.23437,60.90625,NaN,NaN\n817828200,60.98437,62.79687,60.57812,61.48437,NaN,NaN\n820506600,61.40625,63.6875,59.64062,63.67187,NaN,NaN\n823185000,63.60937,66.6875,63.4375,63.875,50.27465653531507,NaN\n825690600,64.64062,66,62,64.6875,53.26424774585063,NaN\n828369000,65,65.8125,62.125,65.39062,55.95896610826462,NaN\n830957400,65.375,68.4375,63.07812,66.875,58.72782427673607,NaN\n833808600,66.89062,68.5,66.15625,67.10937,61.036275767157456,NaN\n836227800,67.28125,67.70312,60.375,64.09375,58.244275603209736,NaN\n838906200,64.15625,67.34375,64.0625,65.32812,56.56208406013255,56.29547572809516\n841671000,64.46875,69.25,64.375,68.625,56.59193179081766,56.36958974377579\n844176600,68.70312,71.625,68.4375,70.84375,57.47265102541914,56.64535506418663\n846858600,70.98437,76.6875,70.26562,76.01562,59.9643347001402,57.47509997317502\n849537000,75.92187,76.57812,71.875,73.84375,58.95265852871204,57.84448961205928\n852129000,74.375,79.6875,72.75,78.40625,59.6475585779361,58.295256853528485\n854980200,78.71875,82,77.125,79.15625,60.362243970605455,58.812003632797726\n857399400,78.75,81.79687,75.6875,75.6875,57.036932980012686,58.368235969601464\n859905000,75.25,80.6875,73.3125,80.09375,55.89221263816009,57.74923013674112\n862493400,80.21875,85.5625,79.3125,85.15625,56.460936665600016,57.42715676895584\n865258200,85.34375,90.5,84.07812,88.3125,57.66500280198884,57.48661827721409\n867763800,88.5,96.03125,88.39062,95.3125,60.12369412417347,58.14588723895393\n870442200,95.5,96.625,89.34375,90.375,57.78813006329073,58.05644794503813\n873120600,90.6875,96.375,90.25,94.375,56.96990360122848,57.78481185908572\n875712600,95.25,98.5,84.375,92.0625,54.713951249650435,57.0170967067269\n878567400,93.1875,96.8125,90.09375,95.625,53.78578089514087,56.209267753830396\n880986600,96.21875,99,92.375,97.0625,53.38390471093428,55.50292699310637\n883665000,97.3125,99.5625,90.90625,98.3125,53.32637494246508,54.958788980446045\n886429800,99.90625,105.53125,99.71875,105.125,54.59906971518238,54.86885916413013\n888849000,105.25,111.53125,103.15625,109.9375,56.425102901733446,55.25792009853096\n891441000,110.3125,113.4375,107.625,111.34375,58.04197074886292,55.95393276111395\n894029400,111.75,113.3125,107.57812,109.03125,57.85983311046957,56.43040784845285\n896707800,108.96875,114.6875,107.5,113.3125,58.41112159134097,56.925586284174884\n899299800,114.0625,119.23437,111.3125,111.78125,57.914464899024246,57.172805937887226\n902151000,111.78125,112.42187,95,96,48.55019265940068,55.01715261826559\n904656600,96.0625,107,93.625,101.75,42.87950031333071,51.98273954203187\n907248600,100.03125,110.90625,92.21875,110,40.36744831350669,49.078916734900574\n910017000,110.8125,119.71875,110.1875,116.125,39.706490434699646,46.735810159850345\n912522600,116.125,124.75,113.75,123.3125,40.51138845649015,45.1797047340103\n915201000,123.375,128.29687,120.375,127.65625,41.829609173730134,44.342180843940255\n917879400,128.6875,128.84375,121.32812,123.5625,41.202881299940145,43.55735595794023\n920298600,123.65625,132.625,121.78125,128.375,41.49437163362272,43.04160987686085\n922977000,129.6875,137.5,128.125,133.25,42.464808896011974,42.897409631648635\n925738200,133.4375,138,128,130.20312,42.07956015862659,42.69294726339312\n928243800,130.125,137.5,128.01562,137,42.78799453322324,42.71670908085065\n930835800,137,142.25,132.5625,132.75,41.804667742570864,42.488698746280704\n933600600,132.75,138.78125,127,132.0625,40.792999659873075,42.0647739746788\n936192600,132.9375,136.625,125.5625,128.75,38.818361561795925,41.25317087145808\n938784600,127.9375,137.6875,123.4375,137,38.526345449160296,40.57146451588363\n941466600,136.5,143,134.59375,139.39062,38.663815331431174,40.09455221977052\n944058600,139.3125,147.5625,139,146.875,39.90524654718551,40.047225801624265\n946909800,148.25,148.25,135,139.625,38.39464853592883,39.634081485200404\n949415400,139.75,144.5625,132.71875,137.4375,36.48835150486526,38.84764899011662\n951921000,137.625,155.75,135.03125,150.375,36.96733158360708,38.377569638489234\n954768600,150.125,153.10937,133.5,145.09375,35.65301429168848,37.69643080178905\n957187800,146.5625,148.48437,136.5,142.8125,33.93391512291515,36.75580188207057\n959866200,143.6875,149.15625,143,145.28125,32.964190646762106,35.807899073243455\n962631000,145.4375,151.98437,141.51562,142.90625,31.47085433985726,34.72363788989691\n965136600,143.625,153.09375,142.625,152.34375,31.768399586931523,33.984828314155564\n967815000,153.25,153.59375,142.125,143.625,29.41916662095947,32.84341289085654\n970493400,144.28125,145.75,130.15625,142.95312,27.397449657983962,31.4819220826384\n973089000,142.25,144.29687,129.75,132.28125,22.823336394661663,29.317275660644214\n975681000,133.1875,139.5625,125.53125,131.1875,18.97136220433741,26.730797296567513\n978445800,132,138.7,127.5625,137.02,16.9809596891031,24.29333789470141\n981037800,137.10001,137.99001,121.8,123.95,12.161881565592239,21.260473812424117\n983457000,124.05,127.75,108.03999,116.69,6.790496305583413,17.64297943571394\n986218200,116.3,127.27,109.3,124.91,4.294819724910725,14.305939508013136\n988723800,125.07001,132.09,123.44,125.95,2.582874836998023,11.375173340259359\n991402200,126.2,129.23,120.39999,122.60001,0.5439334659721882,8.667363371687566\n994080600,122.8,124.32001,116.75,121.35001,-1.3330823063629305,6.167251952174942\n996672600,121.97,123.25,112.03999,114.14999,-4.286815963971542,3.5537349731383205\n999610200,113.85001,116.17,93.8,104.44,-8.500063958096137,0.5402852403297063\n1001943000,103.89999,111.78999,102.83,105.8,-11.513725448069696,-2.473217431770144\n1004625000,106.60001,116.89999,105.69901,114.05,-12.025023038023901,-4.861168833333584\n1007389800,113.64999,118,112,114.3,-12.373512586307827,-6.739254771577144\n1009981800,115.11,117.99001,108.39999,113.17999,-12.858967500738764,-8.26918295386755\n1012573800,113.09,113.3,107.82001,111.14999,-13.629935047735458,-9.609370977334526\n1014993000,111.72,117.907,111.50999,114.52,-13.438225518342268,-10.566584612586462\n1017671400,114.23,115.10001,106.63,107.86,-14.538428725976315,-11.559545640933926\n1020259800,107.97,111.25,104.89999,107.22,-15.557745142296541,-12.55909551627458\n1023111000,107.09,107.60001,95.19501,98.96001,-17.948430223373492,-13.906429193049307\n1025530200,99.187,99.8,77.67999,91.16,-21.28781820204591,-15.751776445298457\n1028208600,90.88,97.14999,83.55,91.78,-23.784806451440186,-17.76003394683389\n1031059800,90.735,93.33,80.00999,81.78999,-27.485604676188462,-20.191426629172533\n1033479000,82.438,91.28999,77.07001,88.52,-28.46304441803909,-22.259331076389174\n1036161000,88.35001,94.95,87.45,93.98,-27.66859644038,-23.61164741738688\n1038839400,95.47,96.05,87.11,88.23,-27.965372693275953,-24.70007873635915\n1041517800,88.85001,93.86,84.14999,86.06,-28.54324460095515,-25.66087020250815\n1044282600,86.14,86.817,81,84.89999,-29.18915049452091,-26.54294027551134\n1046701800,85.25999,89.88,79.383,84.74001,-29.73968512487499,-27.342126487852255\n1049207400,85.25,92.8,84.91,91.91,-28.061574954758843,-27.5219886045789\n1051795800,91.92,97.09,90.5,96.95,-25.228130264594522,-26.948524019582806\n1054560600,97.53,102.179,96.67,97.63,-22.738722524977657,-25.89607364593152\n1057066200,97.25301,101.89999,96.42999,99.39,-20.18758608821643,-24.468951756502747\n1059744600,99.19,101.81799,96.34,101.44,-17.487204490517875,-22.72351494000653\n1062509400,101.64,104.7,99.25,99.95,-15.555900640128042,-20.931611365036908\n1065015000,100.24001,105.97,100.2,105.3,-12.393575525243206,-18.79710240508848\n1067869800,105.75,106.95,103.62,106.45,-9.453836121048708,-16.461285834078538\n1070289000,106.92999,111.52,105.96001,111.28,-5.641306919849094,-13.756291105521177\n1073053800,111.74001,116.5,110.73,113.48,-1.8926330490661736,-10.790376591407426\n1075732200,113.7,116.60001,112.78,115.02,1.6267565088008034,-7.686093316355369\n1078151400,115.42999,116.97,108.85001,113.10001,3.9922181306858975,-4.766515454595052\n1080829800,113.07001,115.41,110.89999,110.96001,5.314163620593312,-2.2463456857979613\n1083591000,111.37,113.25999,108.06,112.86,6.944140963328666,0.051275976483695196\n1086096600,112.46001,114.94,111.87,114.53,8.773437964121566,2.231816473393163\n1088688600,114.25,114.39999,108.21001,110.84,9.048316110941904,3.9359413827803484\n1091453400,110.19,113.61,106.59,111.11,9.354893103479307,5.290679312955088\n1094045400,110.94,113.74001,110.41,111.75999,9.805853417481588,6.419472839086714\n1096637400,112.25999,114.67999,109.35001,113.2,10.626863137370599,7.4713204136576845\n1099319400,113.56,119.14,113.2,117.89,12.76477222030968,8.794683365320683\n1101911400,118.16,121.66,117.73,120.87,15.440343023741837,10.456098279925971\n1104762600,121.56,121.75999,116.37,118.16,16.507995384607536,11.969072556096362\n1107268200,118.25,121.67,118.10001,120.63,18.128835661010157,13.50901333232481\n1109687400,120.78,123.25,116.25,117.96001,18.28527119184201,14.703077797204111\n1112365800,118.63,119.25999,113.55,115.75,17.436120661501104,15.386338513278359\n1115040600,116.07001,120.25,114.8,119.48,17.908959284367352,16.016993706050606\n1117632600,119.52,121.94,118.75,119.17999,18.156820460841317,16.551950394748282\n1120224600,119.45,124.64,118.25999,123.74001,19.794087733987805,17.36248472955816\n1122903000,123.83,124.74001,120.38,122.58,20.571995889618222,18.164862519573177\n1125581400,122.50999,124.74001,120.44,123.03999,21.351467608982684,18.961513791925555\n1128346200,122.96001,123.34,116.88,120.13,20.567207015427684,19.362937097801087\n1130855400,120.58,127.41,120.13,125.41,21.62759752224667,19.929102203912482\n1133447400,126.02,128.57001,124.36,124.50999,22.029721742841662,20.454257088644777\n1136298600,125.10001,129.44,124.39,127.5,23.305339644051827,21.16702772749654\n1138804200,127.82001,130.03999,123.64,128.23,24.564667321020575,22.016437625877547\n1141223400,128.60001,131.47,127.17999,129.83,26.09498887989542,23.036075439382017\n1144071000,130.07001,131.86,128.02,131.47,27.85976735853301,24.241998419169764\n1146490200,131.47,132.8,124.75999,127.50999,27.11350805195025,24.959875827364886\n1149168600,127.38,129.42999,122.34,127.23,26.354889443586615,25.30862923142032\n1151933400,127.42999,128.14,122.39,127.85001,25.93601125377364,25.46547473700865\n1154439000,127.34,131.03999,126.28,130.64,26.526144046204987,25.730642064307734\n1157117400,131.14,133.99001,129.35001,133.58,27.990480566649072,26.29560168989307\n1159795800,133.53999,139,132.34,137.78999,30.54272232279638,27.357381848118898\n1162391400,138.22,141.16,135.62,140.53,33.42399325721502,28.874034700392926\n1164983400,140.53,143.24001,138.97,141.62,36.041888292353796,30.66599809838314\n1167834600,142.25,144.13,140.25,143.75,38.759068914080444,32.68926580230747\n1170340200,144.14999,146.42,139,140.92999,39.12176264851389,34.29739001385907\n1172759400,139.34,143.81,136.75,142,39.71372761147055,35.651474413261944\n1175520600,142.16,149.8,140.89,148.28999,41.918369803743275,37.218198260882275\n1178026200,148.42,153.89,147.67,153.32001,44.916399983436534,39.142748691520836\n1180704600,153.88,154.39999,148.06,150.42999,45.350851247511194,40.69477433051843\n1183383000,150.87,156,145.03999,145.72,42.73596594147406,41.20507223325734\n1185975000,145.17999,150.59,137,147.59,41.200877328349925,41.204023507030485\n1188912600,147.45,154.39,144.33,152.58,41.24642781104464,41.21462458303402\n1191245400,152.60001,157.52,148,154.64999,41.77735462708738,41.35530709404736\n1193923800,153.28999,153.41,140.66,148.66,38.80110848131515,40.716757440864306\n1196692200,148.19,152.89,143.96001,146.21001,35.215547102980175,39.34145485639327\n1199284200,146.53,146.99001,126,137.37,28.027339623223668,36.512926048100866\n1201876200,137.94,139.61,131.73,133.82001,21.05120258441534,32.64749518217948\n1204554600,133.14,135.81,126.07001,131.97,14.998767775067082,28.235313330401382\n1207056600,133.71001,140.59,132.33,138.25999,12.290580097201092,24.24913002210131\n1209648600,138.39,144.3,137.52,140.35001,10.867568720846288,20.903739696787554\n1212413400,139.83,140.89,127.035,127.98,5.302694970199067,17.003478515140433\n1214919000,126.52,129.16,120.02,126.83,0.8096084435615056,12.9550109972457\n1217597400,127.12,131.50999,124.75999,128.78999,-1.987019429921864,9.21950339045381\n1220362200,130.03,130.71001,110.5321,115.99001,-7.872341433565298,4.946542184449033\n1222867800,115.27,116.69,83.58,96.83,-16.966417331508275,-0.531697694540294\n1225722600,96.78,100.86,74.34,90.09,-24.69982185160523,-6.573728733806528\n1228141800,87.50999,92.42999,81.86,90.24001,-30.184104654402027,-12.476322713955403\n1230906600,90.44,94.5533,80.05,82.83,-35.48053476831988,-18.227375727546523\n1233585000,81.57001,87.74001,73.81,73.92999,-40.72247723793553,-23.851151105143774\n1236004200,72.52,83.3,67.10001,79.52,-42.7975894707955,-28.587760696556707\n1238592600,78.53,89.02,78.33,87.42,-41.845641467122945,-31.902230889198265\n1241184600,87.44,93.7,86.72,92.53,-39.56795871074121,-33.818662844584\n1243863000,93.67,96.11,87.53,91.95,-37.899604365941556,-34.83889822492338\n1246455000,92.34,99.83,87,98.81,-34.60334194395563,-34.780009154681444\n1249306200,99.85001,104.35001,98.11501,102.46001,-31.00216839810021,-33.835548965536134\n1251811800,101.95,108.06,99.57001,105.59,-27.303217548505433,-32.20246611127846\n1254403800,105.34,110.31,101.99001,103.56,-24.668198341188994,-30.318899168756094\n1257172200,104.13,111.74001,103.08,109.94,-20.87047631957735,-27.95679345646141\n1259677800,110.92,113.03,105.476,111.44,-17.43603087537327,-25.326602811189375\n1262615400,112.37,115.14,107.22,107.39,-15.388024875007991,-22.841958327144027\n1265034600,108.14999,111.58,104.58,110.74001,-12.880882198847257,-20.351689295069836\n1267453800,111.2,118.1666,111.17,117,-9.295050595352675,-17.587529620140547\n1270128600,117.8,122.12,117.10001,118.8125,-5.958245841679137,-14.680208675525193\n1272893400,119.38,120.67999,104.38,109.369,-5.275474776907975,-12.32902520087089\n1275399000,108.35001,113.2,102.88,103.22,-6.038350041433553,-10.756356411011556\n1277991000,103.14999,112.28999,101.13,110.27,-4.977391937004339,-9.311615292509751\n1280755800,111.99001,113.17999,104.28999,105.31,-5.188324850458791,-8.280792681997012\n1283347800,106.73,115.78999,106.66,114.13,-3.331300938318721,-7.043419746077439\n1285939800,114.99001,119.75999,113.17999,118.49001,-0.9199515005428649,-5.512552684693795\n1288618200,119.07001,122.95,117.59,118.49249,0.9803989193511735,-3.8893147836825532\n1291213800,120.2,126.2,120.19,125.75,4.044990323065779,-1.9057385069954702\n1294065000,126.71001,130.35001,125.6969,128.67999,7.086269734890344,0.3422635534759835\n1296570600,129.46001,134.69,129.3801,133.14999,10.417697091346342,2.8611219379435733\n1298989800,133.57001,133.69,125.28,132.59,12.962606101907037,5.386492978934439\n1301664600,133.41,136.57001,129.50999,136.42999,15.778347251185746,7.984456546997266\n1304343000,137.07001,137.17999,131.38,134.89999,17.672461165139378,10.406457701532794\n1306935000,134.50999,134.9234,126.19,131.97,18.42597878540182,12.41133797250005\n1309527000,132.09,135.7,127.96671,129.33,18.304193764542504,13.884551920510663\n1312205400,130.84,130.96001,110.27,122.22,16.188585456281704,14.460560304453423\n1314883800,122.28999,123.39999,111.3,113.14999,11.98205659294,13.840934376575067\n1317648600,112.49001,129.42,107.42999,125.5,11.275840260361468,13.199660847521667\n1320154200,122.03,128.02,116.2,124.99001,10.599539761249062,12.549630575953515\n1322749800,124.85001,127.25999,120.03,125.5,10.171750308136517,11.955160508999265\n1325601000,127.75999,133.39999,126.42999,131.32001,11.056150592106732,11.730408029776132\n1328106600,132.28999,138.19,132.13,137.02,12.942265292593605,12.033372345480501\n1330612200,137.31,141.83,134.36,140.81,15.20714916865405,12.826816551273888\n1333373400,140.64,142.21001,135.75999,139.87,16.762376400993332,13.81070651370375\n1335879000,139.78999,141.66,129.55,131.47,15.6861412179788,14.279565189772512\n1338557400,129.41,136.27,127.13499,136.105,15.75884834112985,14.649385977611846\n1341235800,136.48,139.339,132.60001,137.71001,16.13794366936139,15.021525400549233\n1343827800,138.7,143.09,135.58,141.16,17.135201467761494,15.549944417352298\n1346765400,141.03999,148.11,140.13,143.97,18.502762039000096,16.28814882276425\n1349098200,144.52,147.16,140.39,141.35001,18.849378128454987,16.928456149186935\n1351776600,141.64999,143.72,134.7,142.155,19.29624294913993,17.520402849175184\n1354545000,142.8,145.58,139.53999,142.41,19.71939265467104,18.070150300549148\n1357137000,145.11,150.94,144.73,149.7,21.5918559293101,18.950576707739387\n1359729000,150.64999,153.28,148.73,151.61,23.51597244806993,20.091925642822023\n1362148200,151.09,156.85001,150.41,156.67,26.11840384448997,21.59854519323901\n1364823000,156.59,159.72,153.55,159.67999,28.828344375735565,23.40599498886315\n1367415000,159.33,169.07001,158.10001,163.44501,31.75447155234268,25.49311412973303\n1370266200,163.83,165.99001,155.73,160.42,33.01592467771179,27.37381676672772\n1372685400,161.25999,169.86,160.22,168.71001,35.554265413016196,29.41892892829984\n1375363800,169.99001,170.9725,163.05,163.64999,35.66255918482242,30.979836492430486\n1378215000,165.23,173.60001,163.7,168.00999,36.51313853723303,32.363162003631125\n1380634200,168.14,177.51,164.53,175.79,38.502288245234546,33.897943564031976\n1383312600,176.02,181.75,174.76,181,40.88195416442437,35.643946214130075\n1385994600,181.09,184.69,177.32,184.69,43.29301942900097,37.5562145178478\n1388673000,183.98,184.94,176.88,178.18,42.7389087963855,38.85188808748222\n1391437800,177.95,187.15,173.71,186.29,43.49399861967885,40.01241572053138\n1393857000,184.69,189.0239,183.75,187.01,44.177671043151484,41.05372955118641\n1396359000,187.62,189.7,181.31,188.31,44.89931180652272,42.01512511502048\n1398951000,188.22,192.8,186.01,192.68,46.08175183783682,43.03178179572457\n1401715800,192.95,196.6,191.97,195.72,47.43992107716596,44.133816616084914\n1404221400,196.19,199.06,192.97,193.09,47.534582359013264,44.984008051817\n1406899800,192.56,200.82,190.55,200.71,48.632143728284014,45.89604197093375\n1409664600,200.97,201.899,196.05,197.02,48.09639899728911,46.44613122752259\n1412170200,196.7,201.82,181.92,201.66,48.288083886220136,46.90661939219698\n1415025000,201.92,207.87,200.06,207.2,49.16780024950263,47.47191460652339\n1417444200,206.4,212.97,197.86,205.54,49.23140719350627,47.91178775326911\n1420209000,206.38,206.88,198.55,199.45,46.965204534645096,47.6751419486131\n1422887400,200.05,212.24,197.86,210.66,46.695689110695305,47.430278739133655\n1425306600,210.78,212.06,204.12,206.43,44.958767043200844,46.812400815150454\n1427895000,206.39,212.48,204.51,208.46,43.88495772037768,46.08054004145726\n1430487000,209.4,213.78,206.76,211.14,43.40857639180947,45.41254912904532\n1433165400,211.94,213.34,205.28,205.85,41.17302440338067,44.35266794762916\n1435757400,207.73,213.18,204.11,210.5,40.07954624759975,43.284387522621806\n1438608600,210.46,211.31,182.4,197.67,34.931420192825236,41.19614569017266\n1441114200,193.12,202.89,186.93,191.63,29.112170787212087,38.175151964432516\n1443706200,192.08,209.44,189.12,207.93,27.385300398877444,35.47768907304375\n1446474600,208.32,211.66,202.18,208.69,26.226578926679895,33.164911536452784\n1448980200,209.44,211,199.83,203.87,24.03202912026223,30.881690932405146\n1451917800,200.49,201.9,181.02,193.7208,19.713169759669437,28.08956063922122\n1454337000,192.53,196.68,181.09,193.56,16.365869172803787,25.15863777261686\n1456842600,195.01,206.87,194.4542,205.52,15.841425774503657,22.829334773088558\n1459517400,204.35,210.92,203.09,206.3308,15.57639055323336,21.01609871812476\n1462195800,206.92,210.69,202.78,209.84,15.970368528652928,19.754666170756803\n1464787800,209.12,212.52,198.65,209.475,16.19772822225242,18.865431683630707\n1467379800,209.36,217.54,207.06,217.12,17.697106113104645,18.57335029099919\n1470058200,217.19,219.6,214.25,217.38,18.94621089560765,18.666565442151306\n1472736600,217.37,219.22,212.31,216.3,19.693603670293225,18.923324999186786\n1475501400,215.82,216.7,211.21,212.55,19.337247265084066,19.026805565661107\n1478007000,212.93,221.82,208.38,220.38,20.424715441955072,19.3762830347346\n1480602600,220.73,228.34,219.15,223.53,21.855099102639688,19.99598705171087\n1483453800,225.04,229.71,223.8837,227.53,23.709164432627176,20.924281396939946\n1485959400,228.255,237.31,226.82,236.47,26.712728305447726,22.37139312406689\n1488378600,238.39,240.32,231.61,235.74,28.90299173472435,24.004292776731255\n1491226200,235.8,239.53,232.51,238.08,31.054743237400157,25.76690539189848\n1493645400,238.68,242.08,235.43,241.44,33.33970050475256,27.660104170112\n1496323800,241.97,245.01,239.955,241.8,35.269503329011414,29.56245395983685\n1499088600,242.88,248,240.34,246.77,37.62832102604181,31.57892072638809\n1501594200,247.46,248.91,241.83,247.49,39.67983085862449,33.60414825944719\n1504272600,247.92,251.32,244.95,251.23,41.939846191248506,35.68807274239752\n1506951000,251.49,257.89,251.2926,257.15,44.65968079132867,37.93097475463031\n1509543000,258.04,266.05,255.63,265.01,47.94546893533852,40.43459829980736\n1512138600,264.76,268.6,260.76,266.86,50.81222432398135,43.02900480585086\n1514903400,267.84,286.6285,267.4,281.9,54.899546752239495,45.99664029244802\n1517495400,281.07,283.06,252.92,271.65,54.11388921533441,48.02595252316962\n1519914600,271.41,280.41,257.83,263.15,50.45628445735463,48.63353550671587\n1522675800,262.55,271.3,254.67,264.51,47.862507872392584,48.440778598135054\n1525181400,263.87,274.25,259.05,270.94,46.64165178119225,47.99099689389935\n1527859800,272.41,279.48,268.49,271.28,45.737181553457205,47.427543058788814\n1530538200,269.51,284.37,269.24,281.33,46.24723822367777,47.132466850011056\n1533130200,281.56,291.74,279.16,290.31,47.689035479398186,47.27160900735784\n1536067800,289.84,293.94,286.71,290.72,48.847136539610084,47.6654908904209\n1538400600,292.11,293.21,259.85,270.63,43.4769890746876,46.61836543648757\n1541079000,271.6,281.22,263.07,275.65,40.06741312469841,44.98062735854028\n1543847400,280.28,280.4,233.76,249.92,30.702272707808675,41.41103869585738\n1546439400,245.98,270.47,243.67,269.93,26.6801612242785,37.72831932796266\n1549031400,270.15,281.31,267.83,278.68,24.961482704210187,34.53661017202454\n1551450600,280.44,285.18,272.42,282.48,24.187758670323316,31.949397296599233\n1554125400,284.7,294.45,284.4,294.02,24.984366031248626,30.208139480261583\n1556717400,294.72,294.95,275.24,275.27,22.074819729603995,28.174809542597185\n1559568600,275.31,296.3093,273.09,293,21.940392395771532,26.616205255890772\n1561987800,296.68,302.23,294.33,297.43,22.3164883356442,25.541276025829127\n1564666200,297.6,300.87,281.72,292.45,21.780977982317744,24.60120151495128\n1567517400,290.57,302.63,289.27,296.77,21.81917882448184,23.90569584233392\n1569936600,297.74,304.55,284.82,303.33,22.524593468755114,23.560420248939216\n1572615000,304.92,315.48,304.74,314.31,24.185247915670878,23.716627165622132\n1575297000,314.59,323.8,307.13,321.86,26.223639317727017,24.34338020364835\n1577975400,323.54,332.95,320.36,321.73,27.81592239621639,25.211515751790362\n1580740200,323.35,339.08,285.54,296.26,24.88001802150417,25.128641319218815\n1583159400,298.21,313.84,218.26,257.75,16.836169089822643,23.055523261869773\n1585747800,247.98,294.88,243.9,290.48,14.283800791886236,20.86259264437389\n1588339800,285.31,306.84,276.37,304.32,13.777447500758665,19.091306358470085\n1591018200,303.62,323.41,296.74,308.36,13.775318882174611,17.762309489396216\n1593610200,309.57,327.23,309.07,326.52,15.35850361556444,17.161358020938273\n1596461400,328.32,351.3,327.73,349.31,18.404024063521923,17.472024531584186\n1598967000,350.21,358.75,319.8,334.89,19.039716548580206,17.86394753583319\n1601559000,337.69,354.02,322.6,326.54,18.598285654170617,18.04753206541755\n1604327400,330.2,364.38,327.24,362.06,20.840741729615395,18.74583448146701\n1606833000,365.57,378.46,362.03,373.88,23.309551704548838,19.886763787237467\n1609770600,375.31,385.85,364.82,370.07,24.780351552720127,21.110160728608133\n1612189800,373.72,394.17,370.376,380.36,26.57032981523576,22.47520300026504\n1614609000,385.59,398.12,371.88,396.33,28.940757164670007,24.09159154136628\n1617283800,398.4,420.72,398.18,417.3,32.000963462052376,26.068934521537805\n1620048600,419.43,422.815,404,420.04,34.53632267074308,28.185781558839125\n1622554200,422.57,428.78,414.7,428.06,36.97592008099042,30.38331618937695\n1625146200,428.87,441.8,421.97,438.51,39.465319072664485,32.653816910198834\n1627911000,440.34,453.07,436.1,451.56,42.107856959088444,35.01732692242123\n1630503000,452.56,454.05,428.78,429.14,41.55997454306354,36.65298882758181\n1633095000,430.98,459.56,426.36,459.25,42.56691064230693,38.13146928126309\n1635773400,460.3,473.54,455.3,455.56,42.91997591130689,39.328595938774036\n1638369000,461.64,479,448.92,474.96,44.08238876390879,40.517044145057724\n1641220200,476.3,479.98,420.76,449.91,42.133795611620904,40.92123201169852\n1643725800,450.68,458.12,410.64,436.63,39.16489038003768,40.48214660378331\n1646145000,435.04,462.07,415.12,451.64,37.57157809579362,39.75450447678589\n1648819800,453.31,457.83,411.21,412,32.26554808778875,37.882265379536605\n1651498200,412.07,429.66,380.54,412.93,28.270972525214777,35.47944216595615\n1654090200,415.17,417.44,362.17,377.25,21.901108995514797,32.08485887334581\n1656682200,376.56,413.03,371.04,411.99,19.039714520782102,28.82357278520488\n1659360600,409.15,431.73,395.04,395.18,15.534201114828566,25.501229867610803\n1662039000,392.89,411.73,357.04,357.18,10.020530062103399,21.631054916233953\n1664803800,361.08,389.52,348.11,386.21,7.615906582483263,18.12726783279628\n1667309400,390.14,407.68,368.79,407.68,7.0605533126354745,15.36058920275608\n1669905000,408.77,410.49,374.77,382.43,5.012718030925401,12.773621409798409\n1672756200,384.37,408.16,377.831,406.48,4.8196824940232155,10.78513668085461\n1675261800,405.211,418.31,393.64,396.26,4.050026158240648,9.101359050201118\n1677681000,395.41,409.7,380.65,409.39,4.180729254596653,7.871201601300002\n1680528600,408.85,411.92,405.678,409.12,4.267564496962297,6.970292325215576\n"
  },
  {
    "path": "Tests/TestData/spy_ultosc.txt",
    "content": "Date,Open,High,Low,Close,Volume,ULTOSC_7_14_28\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,58.8041548665016\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,58.4304354439235\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,60.321483547981\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,58.6724483569414\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,64.856179315412\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,64.9253405320996\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,70.0543068101939\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,55.2027973338831\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,59.2686759020247\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,51.1625731028588\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,48.5575611445486\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,48.6395971000793\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,50.9282845982332\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,54.3885165743899\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,61.8925642515565\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,56.7565013683947\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,61.6046594141425\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,66.6443870450833\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,66.0111988012549\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,58.182344481584\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,58.3431149697035\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,64.2019947018709\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,64.6146857262961\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,68.758578995208\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,71.5372834883253\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,65.6651152432561\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,72.7826368867801\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,70.6193283331216\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,74.0726587444274\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,75.4933859274375\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,68.4595485466715\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,70.0481646112835\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,69.3313864243383\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,67.8929426079526\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,55.2680510969505\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,54.8067754744111\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,55.9370859954468\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,55.557360948283\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,51.3615309638918\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,51.6858445557243\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,44.7756583528181\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,52.4342137387641\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,47.6694249042333\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,39.8525226430058\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,47.2769222636868\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,51.5193208259983\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,51.4012094806284\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,53.1780955033045\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,44.7662176331641\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,51.8452512490144\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,52.3127875083638\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,49.0181269507618\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,47.8648960304963\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,42.8529528541446\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,39.0930791012213\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,44.1042245920296\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,38.7000423374907\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,43.4724541194123\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,44.2683167495199\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,42.0542166623484\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,44.8811735023714\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,51.557297176487\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,50.2306750660292\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,52.1854660481217\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,55.4854949282635\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,54.1421069497244\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,56.3058497878454\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,58.838005414239\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,67.938134662735\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,69.6668775041416\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,71.4879038455812\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,65.5575400458087\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,63.1188650512434\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,61.7897473056659\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,65.7703182921953\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,61.7560464567179\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,59.8714327728251\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,52.4419247756215\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,56.8318666372308\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,63.3038179823225\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,60.6756918457163\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,56.7795200439587\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,50.7626010915961\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,59.4631162442306\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,66.5020950041397\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,65.2209914514057\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,57.5328964199697\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,57.5061197241665\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,59.8628333773123\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,61.7712647561988\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,59.4135657965888\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,60.8501526107395\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,54.8996317555448\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,47.0567273612195\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,44.839321286237\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,38.3838600730761\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,39.9928276886251\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,34.1308576746676\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,35.8657484218568\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,40.6727134714748\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,41.6068450693162\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,35.2506391500381\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,39.2232629186929\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,38.6993399721338\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,39.7019323295577\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,34.9262745450082\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,38.8079123862201\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,41.3170662680804\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,50.089021002071\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,55.1048719061247\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,59.5829007812434\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,64.8613174641335\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,65.2752063760863\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,64.3614136397961\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,64.2951906684524\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,69.9238870362447\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,70.4916049229399\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,64.8065984281622\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,54.0393409730777\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,54.3952796395315\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,50.2493403033198\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,47.6091393891025\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,46.2250309640212\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,36.8399918228967\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,38.6843859626319\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,47.7931587079761\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,53.2535706017258\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,51.6755841245069\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,57.901037156614\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,52.9379544160298\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,45.830865291903\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,47.907263117658\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,56.3684131566143\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,58.1165005284253\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,64.6095679670205\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,59.2405658816718\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,66.864205857635\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,75.3446760077636\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,77.6046583373192\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,73.7293331901522\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,71.1885291730338\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,67.2709581519814\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,72.454282784978\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,71.7916800402569\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,70.0639824087399\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,70.5218324613803\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,65.0656804379271\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,58.8761881779522\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,61.3086258911628\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,64.5077579198352\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,60.7913894791469\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,60.7760060087155\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,47.3881582598138\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,56.9517925578208\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,59.6756646460114\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,59.3855902323946\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,63.6804591507246\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,65.9257352720658\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,67.4270753331295\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,72.938444739753\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,65.3550880892304\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,60.0117334403977\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,63.1386368606866\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,60.9803643736355\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,56.8980617903591\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,52.9070546423372\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,59.0076097072876\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,56.7577498631033\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,57.4311971282666\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,50.8543619934958\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,48.4029447882112\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,45.6932964015589\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,53.9173724555572\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,54.0067576002178\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,54.169985280205\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,49.4023589364228\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,47.3502220285788\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,43.1338953509121\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,47.7264134850034\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,40.1481567872931\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,56.4401182468716\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,59.3166428169336\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,66.6111299065245\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,70.4728647308682\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,72.1572955443054\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,75.0363526141159\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,75.6569935555721\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,69.1561359919978\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,72.2776566689231\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,62.6028769963258\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,56.4924703659845\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,50.6225445223233\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,51.3326533696359\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,53.814206073131\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,52.3136454473885\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,53.5987034157211\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,48.4221039795485\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,55.8164452854999\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,60.3609320608242\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,59.3926973179066\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,56.3426118060775\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,56.9926092180846\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,54.325139122064\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,59.7570951450308\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,42.1572656133913\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,40.0414349073665\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,41.4410624938246\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,39.6077461499537\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,41.5418452042379\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,41.8410894237485\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,36.1923779238641\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,42.0343777345205\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,45.1841302302833\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,48.9598574184992\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,55.7123759626119\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,55.502572930507\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,58.5914228863031\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,68.7804046979852\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,73.5241126424183\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,74.7487668877886\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,72.2054449657679\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,62.6375633926115\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,62.7341255981557\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,56.9032410525058\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,59.6328737136868\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,53.8032352673559\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,49.6893325546313\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,52.336252235195\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,56.8472149591479\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,53.1732989982659\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,60.0206674109934\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,61.7347711149234\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,61.9281071434284\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,62.1759007196036\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,61.812707424225\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,58.9424702167207\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,63.4749888893199\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,50.0265878852858\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,48.1081126590319\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,52.0866697620986\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,54.9282831430837\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,51.4450562192391\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,57.6321423266829\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,48.1215037227565\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,48.7208134070668\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,51.6005037825693\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,43.311642868345\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,40.8525080101526\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,40.1842290209975\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,40.7365648510621\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,47.9208750016105\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,52.6506514041406\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,52.1907056631454\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,47.8716651694289\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,42.9292606620406\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,46.1612996000975\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,48.1242493870272\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,38.5149594480668\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,34.4739827383664\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,37.1582322552904\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,48.5818131896431\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,55.7647950288738\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,54.4437700915909\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,52.5295809736685\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,62.0329417499423\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,67.1612424380516\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,66.2854227234692\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,57.4463913184158\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,56.2213579106722\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,56.8584101954866\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,56.518281787619\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,58.9170356555735\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,58.132995048325\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,61.8641691937023\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,58.3555658041546\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,60.7105605343522\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,55.8894648673682\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,56.3378860904006\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,60.9820147124905\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,62.7027888556586\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,56.4598327100933\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,58.8353957344803\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,58.4194656483647\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,64.0539877419333\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,57.4638390256117\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,58.6274635610956\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,61.1750162319104\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,64.1354286970534\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,72.8237971115105\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,68.1357572236984\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,70.0624941997271\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,75.9956973687448\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,74.7236417396219\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,77.273587508646\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,78.9970818702482\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,81.4218703024998\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,84.6391017758694\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,80.1926640043997\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,82.5671610166759\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,76.6657791752273\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,68.1262906080995\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,67.3500930248223\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,62.96192509924\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,63.5216108590087\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,69.6525122519797\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,69.2598822952736\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,68.1731240525209\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,74.1902261164564\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,62.0297551979228\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,64.8684170616996\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,65.3667500130131\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,64.1466348007091\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,60.8714517067248\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,63.9237126342235\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,64.5441837553823\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,74.1545618862125\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,68.6998630503878\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,59.5878312798439\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,58.147603942884\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,59.6216911185006\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,60.866689138193\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,62.9711883843551\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,60.997015207132\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,62.7653714905582\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,55.2619199735463\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,58.5191897492655\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,59.4066963933513\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,58.8887183143586\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,58.5473890042887\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,57.5049674550767\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,54.3415032645823\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,65.3842373573261\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,52.5978086994482\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,49.8720086957996\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,36.0864104520684\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,35.3277163694218\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,41.3441760505723\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,39.6053957172109\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,39.5696336360865\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,37.5839573067401\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,42.9427616356419\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,47.9702536539441\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,48.4576539974222\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,48.58542910602\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,54.6362783408886\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,55.1229202551597\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,65.0334879112061\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,63.7971185730552\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,69.4017326539166\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,71.5614714743379\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,68.3557314722032\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,68.1948153475561\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,68.2314884606828\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,65.215895486291\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,63.7356891678\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,66.4599602924281\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,66.6529519842773\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,62.4175390603715\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,54.3281641434155\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,62.2542180356378\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,60.716303376586\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,54.1333410058002\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,56.2139865272948\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,59.2739907734735\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,58.2147687548541\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,61.7889803507927\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,62.9011045035434\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,62.8605628180184\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,68.4500871670388\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,61.7506932481993\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,54.3660161366348\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,52.1195036376978\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,57.8049995501839\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,43.66914070076\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,46.4004472729085\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,47.9981792543191\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,46.4277184315066\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,42.4783201359451\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,48.5706631790971\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,49.1664917521862\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,52.4707906808474\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,43.6338170991188\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,50.2800076991795\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,44.8015693493123\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,42.6565146964244\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,35.7141235132399\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,30.7496267546536\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,39.2895586413878\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,45.4180795782526\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,42.3311312273412\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,49.3122398297245\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,58.3970656602693\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,59.3614655477762\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,61.6134768290827\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,62.6152415395565\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,64.0775690137862\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,66.6852625423038\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,65.3254625202375\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,65.1844731100446\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,75.0329586878735\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,76.1744614525646\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,73.209825139323\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,73.6666184392158\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,73.2636045308213\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,75.0701189679224\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,74.114726510536\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,73.6005865727217\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,76.4273469150887\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,75.9537090088562\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,74.9991951463941\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,71.818943058983\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,73.3809078204768\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,72.0315819132783\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,74.0688954786573\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,70.8660169160984\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,72.7593634340884\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,69.4274733346122\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,69.2409622715589\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,64.8745421167302\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,56.7317315157709\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,57.1014192107157\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,59.5843425300824\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,58.8115407546842\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,59.6062421366192\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,53.6020827120869\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,61.8701429265581\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,53.2635082924304\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,47.3393350899541\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,39.1080488793232\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,34.6769420207711\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,28.8228964027096\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,36.8641881493129\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,36.5287573279785\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,39.0805239485871\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,40.4600903215207\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,42.8431643123121\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,43.9801965649675\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,50.1591086463156\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,46.2768045932937\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,45.0840557420708\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,36.0092912639228\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,34.152114994664\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,29.6119873441975\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,30.0918942474477\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,36.8730323013554\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,42.6383719586344\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,41.9444512537482\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,42.9646128195924\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,40.339528638173\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,46.1013727634739\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,44.0999066112709\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,46.3978077943666\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,44.3056632154778\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,48.8211628630319\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,56.9281153489685\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,59.1169298101179\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,62.6671073952719\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,64.1735397138757\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,51.9684782731494\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,54.1385740563375\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,48.4062770935149\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,50.836382980121\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,57.3779524517139\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,54.0724571167733\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,60.6630605829784\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,63.9107442764493\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,58.98990952565\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,66.5172674289625\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,61.6461306251004\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,61.4658434809517\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,65.9009695300533\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,65.9121763761519\n"
  },
  {
    "path": "Tests/TestData/spy_valueatrisk.csv",
    "content": "date,open,high,low,close,volume,returns,VaR_99,VaR_95,VaR_90\n19980102 00:00,973100,975300,965300,973600,2150000,,,,\n19980105 00:00,978400,984400,967800,977500,4030800,0.004005751848808581,,,\n19980106 00:00,972500,972800,961900,966300,2821800,-0.011457800511508909,-0.02916320236136352,-0.021711483431842052,-0.01773899964392718\n19980107 00:00,960900,965000,952200,964700,5225400,-0.0016558004760426348,-0.021236402834080122,-0.015904653341709717,-0.013062317416269103\n19980108 00:00,963100,963100,955000,957800,3249100,-0.00715248263708923,-0.019678056437544465,-0.015104298688512673,-0.01266604535666759\n19980109 00:00,952500,955000,919100,924700,10000200,-0.034558362915013574,-0.044649431958551616,-0.03454698697922089,-0.029161410942569375\n19980112 00:00,911300,941900,909100,940600,11953200,0.017194765870011786,-0.04593428978881169,-0.03411969023303674,-0.027821370927126447\n19980113 00:00,946300,956300,942200,952200,5006400,0.012332553689134551,-0.043093774351900156,-0.03136065839850206,-0.02510577769950709\n19980114 00:00,956900,959700,947200,958100,3738000,0.006196177273682046,-0.03973840175224159,-0.02864995657249823,-0.022738747477479133\n19980115 00:00,955000,957500,948100,949400,2726400,-0.009080471767038967,-0.038529749180768486,-0.028029521460429346,-0.02243188891645198\n19980116 00:00,962500,966900,956600,962300,4185400,0.01358752896566262,-0.03691038412048019,-0.02640781096109634,-0.02080892807224301\n19980120 00:00,966900,980000,965000,980000,4373400,0.018393432401538012,-0.035936925312241706,-0.025201481418842694,-0.019478456003371763\n19980121 00:00,972200,976900,961600,971600,4526300,-0.008571428571428563,-0.035556449360804904,-0.02515903367930497,-0.019616209852799923\n19980122 00:00,961600,968800,958800,963000,4484300,-0.008851379168382079,-0.035191149550500365,-0.02509876796637988,-0.019718556688477613\n19980123 00:00,965000,967800,950000,956600,6231300,-0.006645898234683312,-0.03446451534126372,-0.02470858154534858,-0.019507729338389075\n19980126 00:00,963800,967300,937500,957500,4280800,0.0009408321137360787,-0.03313776749571759,-0.023729437791610873,-0.018713892039763536\n19980127 00:00,958100,980000,956600,970000,6639000,0.01305483028720622,-0.03223084957233956,-0.022830472454542623,-0.017819166197030268\n19980128 00:00,974100,981100,971700,978800,4089900,0.009072164948453532,-0.031101814876719154,-0.0218734089433241,-0.016953779887875626\n19980129 00:00,978400,995600,975600,987500,7706300,0.008888434818144608,-0.03004205074905562,-0.02098595529784205,-0.016158184322848268\n19980130 00:00,987800,989700,980000,983100,3333000,-0.004455696202531612,-0.02958570509118869,-0.02074543509865893,-0.016032719877075833\n19980202 00:00,999100,1005000,997500,1002500,5587200,0.01973349608381647,-0.029465673311153465,-0.020380186570414748,-0.015536747207730978\n19980203 00:00,1000000,1008100,997200,1006900,2656800,0.004389027431421555,-0.028579487521604552,-0.019713980979931458,-0.014987812247382234\n19980204 00:00,1002800,1011600,998800,1005900,3283800,-0.000993147283742224,-0.02800165245362257,-0.019341065787419794,-0.014724139082223798\n19980205 00:00,1013100,1015900,1000300,1003800,4970800,-0.0020876826722338038,-0.027534829639107174,-0.019057483512078567,-0.014538241660275843\n19980206 00:00,1010000,1015000,1006900,1012800,5531800,0.00896592946802155,-0.026810566698942943,-0.01845308197067842,-0.013997737787036628\n19980209 00:00,1017200,1017500,1007200,1011400,2277100,-0.0013823064770932536,-0.02637115969820579,-0.018178732611761613,-0.0138113800462155\n19980210 00:00,1014400,1024700,1011900,1020500,3624500,0.008997429305912519,-0.025728783626353408,-0.01764112807416091,-0.013329628825840822\n19980211 00:00,1020900,1031900,1017000,1021300,4020500,0.0007839294463498625,-0.02523766213235814,-0.017305762458618035,-0.013077296092761257\n19980212 00:00,1017200,1029400,1008800,1026600,5102800,0.005189464408107414,-0.02465265314823371,-0.016857072195203958,-0.01270127683494105\n19980213 00:00,1021900,1029400,1018800,1021600,1889500,-0.004870446132865802,-0.024574595827774513,-0.016870862936185244,-0.012764031437613125\n19980217 00:00,1028100,1030900,1021600,1023400,2945300,0.0017619420516836737,-0.024115916424598694,-0.016546170155294825,-0.012510766429275632\n19980218 00:00,1023100,1034700,1022800,1034100,2919600,0.010455344928669064,-0.023660532897459334,-0.01614168083167135,-0.012133408617223899\n19980219 00:00,1032500,1034100,1027500,1030000,3330600,-0.003964800309447791,-0.023548855491430504,-0.01611737719951661,-0.012155683620614404\n19980220 00:00,1030800,1037500,1023800,1035600,3594700,0.005436893203883519,-0.02308265020315576,-0.015755630324685924,-0.01184962313946584\n19980223 00:00,1042500,1042500,1033400,1040000,3131700,0.004248744689069106,-0.022649925257716717,-0.015429682108782464,-0.011580597202974479\n19980224 00:00,1039100,1040900,1029400,1031900,3241700,-0.007788461538461577,-0.022867348471848927,-0.01566531598634013,-0.011825939117819786\n19980225 00:00,1037500,1048800,1036300,1044800,3348400,0.012501211357689668,-0.022572126227200926,-0.015368826666434156,-0.01152877432478231\n19980226 00:00,1044400,1051600,1041900,1050600,3604100,0.005551301684532994,-0.02217033302423459,-0.015056754855477247,-0.01126453265591176\n19980227 00:00,1049700,1055300,1043100,1052000,3335400,0.001332571863696952,-0.02186227288469761,-0.014844952766935215,-0.011104045378173829\n19980302 00:00,1052500,1057500,1046300,1048100,4126000,-0.0037072243346008005,-0.02179219766707958,-0.014838966615415766,-0.01113222487064433\n19980303 00:00,1045300,1054700,1045000,1054100,3177500,0.005724644594981454,-0.021432635097568452,-0.014557043524928082,-0.01089169109913658\n19980304 00:00,1050900,1054100,1040600,1049700,4395900,-0.004174177023052894,-0.021398546674279414,-0.014577326429952756,-0.010940959158096399\n19980305 00:00,1035000,1044400,1031600,1037500,7153500,-0.011622368295703511,-0.021940104544369142,-0.015054459199967975,-0.011383747145652517\n19980306 00:00,1045600,1058800,1044400,1057500,6702600,0.01927710843373487,-0.022081788876542482,-0.015033968576906986,-0.011276801654048124\n19980309 00:00,1055300,1062200,1052500,1054400,3282800,-0.0029314420803782104,-0.021974166397038343,-0.014990551016866397,-0.011267611498997663\n19980310 00:00,1062200,1068400,1053800,1066600,5582900,0.011570561456752726,-0.021725165645145414,-0.01475131230776611,-0.01103357689878788\n19980311 00:00,1069700,1073100,1067300,1072500,3426500,0.00553159572473283,-0.021413890339637105,-0.014509247650064965,-0.010828408181334272\n19980312 00:00,1070900,1075900,1065000,1072500,3057400,0.0,-0.021213633156375367,-0.014381091804745826,-0.010738689292477522\n19980313 00:00,1078400,1080000,1068800,1072200,2743800,-0.0002797202797202303,-0.021027907619394135,-0.014264357896039621,-0.010658734565516702\n19980316 00:00,1078400,1082800,1075300,1082500,3073800,0.009606416713299648,-0.020769372595900212,-0.014036444314135862,-0.010447145160816889\n19980317 00:00,1083100,1085000,1076600,1084700,4577900,0.0020323325635103195,-0.02053735284453889,-0.013873459025609453,-0.010320961888981243\n19980318 00:00,1082500,1089400,1080000,1087800,1820900,0.002857933069051244,-0.020297018269013013,-0.013699810652952352,-0.010182863684316158\n19980319 00:00,1089700,1093800,1086600,1093400,2450000,0.005148005148005064,-0.02003884712983336,-0.013500792602499067,-0.010015379926580175\n19980320 00:00,1095600,1101900,1088800,1100000,2828600,0.006036217303822866,-0.01978490071695863,-0.013300474039868754,-0.009843650172477344\n19980323 00:00,1097200,1103100,1094100,1095000,4383400,-0.004545454545454519,-0.01981119392848516,-0.01335647387670862,-0.009915486501349047\n19980324 00:00,1100600,1108100,1099400,1105900,3293800,0.009954337899543475,-0.01959996770665729,-0.013165944204592293,-0.009735990083301008\n19980325 00:00,1114100,1115300,1091900,1101900,4484900,-0.0036169635590921345,-0.01958543596446613,-0.013186952812830461,-0.009775945120843964\n19980326 00:00,1098800,1107500,1096300,1101300,3319600,-0.0005445140212360089,-0.01945587897856376,-0.01310974414208432,-0.009726643143204419\n19980327 00:00,1107500,1107800,1090000,1095300,2512200,-0.005448106782892981,-0.019523959297301982,-0.01319654637005406,-0.00982342595170926\n19980330 00:00,1096300,1100900,1089700,1093400,2776500,-0.0017346845613074313,-0.019432594622018996,-0.013150863837299236,-0.009802096400099686\n19980331 00:00,1101600,1111900,1097500,1100900,5726500,0.006859337845253277,-0.019219094704265707,-0.012976234777581554,-0.009648189250967902\n19980401 00:00,1103100,1110800,1094100,1109800,2828500,0.00808429466799887,-0.019017771232937686,-0.01280510856587105,-0.009493161086621321\n19980402 00:00,1109400,1122500,1107500,1120300,3947500,0.009461164173725,-0.018835369475119476,-0.012641783784330016,-0.009340006170543579\n19980403 00:00,1123400,1128100,1118400,1121900,3726100,0.0014281888779790197,-0.018679705015815562,-0.012535807234017825,-0.009260518060655924\n19980406 00:00,1132500,1133800,1120600,1122500,4029500,0.0005348070237989333,-0.01854634330110846,-0.012449561481445326,-0.009199389653155338\n19980407 00:00,1117500,1119400,1101600,1110000,5200100,-0.011135857461024523,-0.01894825733222876,-0.01279413502726023,-0.009513395198429529\n19980408 00:00,1112200,1112800,1097500,1101300,4762900,-0.007837837837837869,-0.019127771704448012,-0.012964991229474948,-0.009679635762252444\n19980409 00:00,1105600,1112800,1105300,1110000,4367800,0.007899754835194672,-0.01894768477939904,-0.012811468631656336,-0.009540274508985007\n19980413 00:00,1113800,1113800,1100000,1110000,4216000,0.0,-0.01882782136301423,-0.012735330016999582,-0.009487445424335664\n19980414 00:00,1111300,1117200,1109100,1116900,3219500,0.006216216216216264,-0.018647018436069723,-0.012589462744037709,-0.009360202219240391\n19980415 00:00,1119700,1121300,1111600,1120200,3811700,0.002954606500134238,-0.018485042978462464,-0.012471072296347672,-0.00926504677906068\n19980416 00:00,1113100,1115000,1105000,1109100,7242500,-0.009908944831280131,-0.018771668686035397,-0.012723050990879716,-0.009498555279144122\n19980417 00:00,1107200,1124100,1104400,1122200,5414800,0.011811378595257382,-0.01866792093525816,-0.012609271241129278,-0.00937942750786223\n19980420 00:00,1120000,1125600,1118800,1124100,3606300,0.0016931028337194842,-0.018528375037537893,-0.012511892009049536,-0.009304527169207173\n19980421 00:00,1124400,1131600,1119100,1126300,4573300,0.0019571212525575366,-0.01838793221195431,-0.012412798632321432,-0.009227477030659572\n19980422 00:00,1128800,1134400,1128100,1130000,2288400,0.003285092781674548,-0.01823553122968313,-0.01230005767955983,-0.009135878692876489\n19980423 00:00,1126300,1130000,1117500,1120900,4848500,-0.00805309734513271,-0.018411536600167793,-0.01246335259726721,-0.009292397715240477\n19980424 00:00,1117500,1124700,1103400,1108800,11129100,-0.01079489695780178,-0.018720845700941322,-0.012730322531080503,-0.00953679679581385\n19980427 00:00,1093800,1106600,1076300,1085900,14372900,-0.0206529581529582,-0.01971265750650915,-0.01351564510775579,-0.01021204072863356\n19980428 00:00,1097800,1098100,1081300,1086300,6213200,0.0003683580440188017,-0.019592076841887834,-0.013434367300397505,-0.010151715129050796\n19980429 00:00,1090300,1099700,1084400,1095300,7582100,0.008285004142501995,-0.01944890936655536,-0.013308030546536252,-0.010034350770527547\n19980430 00:00,1105600,1119200,1104100,1114400,8226200,0.0174381448005112,-0.019523672525697148,-0.013303299111411038,-0.009987241061350492\n19980501 00:00,1117500,1123100,1113100,1121900,3768600,0.006730078966259878,-0.019370343386217268,-0.013176953499125454,-0.009875280267565704\n19980504 00:00,1127200,1133100,1121600,1122500,4332900,0.0005348070237989333,-0.019258306058530107,-0.013102101588024676,-0.009820251764450838\n19980505 00:00,1120000,1121600,1111300,1116600,4969800,-0.005256124721603528,-0.019290515468944253,-0.013149331593204286,-0.00987548919311958\n19980506 00:00,1121300,1121300,1104700,1105000,5221600,-0.010388679921189303,-0.019528344546173797,-0.013359059328582137,-0.010070236207139\n19980507 00:00,1105000,1105600,1094100,1095900,6769900,-0.008235294117647007,-0.019660529548256558,-0.01348578907495326,-0.010194057776876198\n19980508 00:00,1100000,1113800,1100000,1110000,7888200,0.012866137421297497,-0.019599677953498415,-0.013404214104128991,-0.010101435250953276\n19980511 00:00,1115600,1122200,1103800,1108600,6219300,-0.0012612612612612484,-0.019521265481193747,-0.013358127914599496,-0.010072582083155073\n19980512 00:00,1108100,1118800,1102500,1116400,5983800,0.007035901136568601,-0.019383598476607405,-0.013242624989085124,-0.009968894746180769\n19980513 00:00,1120600,1125600,1115900,1120600,4355500,0.003762092439985709,-0.019248114739793345,-0.013139725517543038,-0.009883365825884415\n19980514 00:00,1115300,1126900,1113400,1119700,4229300,-0.0008031411743708583,-0.019166699402878677,-0.013089907821516204,-0.009850392715294906\n19980515 00:00,1120000,1122200,1108100,1110000,6807000,-0.008663034741448583,-0.01931267804398914,-0.0132257289690859,-0.009980798940643545\n19980518 00:00,1107200,1115900,1098300,1108400,4751100,-0.0014414414414414267,-0.01924259953914388,-0.013185337123602734,-0.00995623294341749\n19980519 00:00,1110000,1116900,1107800,1110600,5877900,0.001984843016961335,-0.01912570098320534,-0.013100968300971957,-0.00988920560124411\n19980520 00:00,1120900,1125000,1108800,1122800,5775400,0.010985053124437316,-0.01904200449042849,-0.013012357816278198,-0.009797975485642573\n19980521 00:00,1123800,1127800,1113100,1116900,6427100,-0.005254720342002139,-0.019067650474233012,-0.013051227550582759,-0.009843894752407182\n19980522 00:00,1117500,1120600,1109400,1111600,4659700,-0.004745277106276258,-0.019077156946175792,-0.013076719668564427,-0.00987790875914089\n19980526 00:00,1120900,1120900,1094400,1095300,6262300,-0.014663548038862939,-0.0194822271942594,-0.013411161812728466,-0.010174699322448846\n19980527 00:00,1093100,1099100,1075800,1096300,10286000,0.0009129918743722154,-0.01937968676287999,-0.013339633602562032,-0.010119703612657288\n19980528 00:00,1098800,1103800,1087300,1100000,4778900,0.0033749885980114414,-0.01925994539326215,-0.01324871161118033,-0.010044145125173633\n19980529 00:00,1106300,1108100,1093800,1093800,4583900,-0.0056363636363636616,-0.01928768210419118,-0.01328832554185408,-0.01009009075774431\n19980601 00:00,1089700,1102200,1085600,1095000,5829200,0.0010970927043334466,-0.019186986070401757,-0.013217399759065801,-0.010035035385606609\n19980602 00:00,1100000,1103400,1091600,1095900,6477900,0.0008219178082191636,-0.019090606517724464,-0.013150303319600742,-0.009983549665439405\n19980603 00:00,1098800,1101900,1082200,1085000,6262700,-0.00994616297107398,-0.019258176111286367,-0.013300144414203886,-0.010123939762847966\n19980604 00:00,1082500,1100600,1080600,1099100,6317300,0.012995391705069137,-0.01922664759016414,-0.013244608987529789,-0.01005560634365633\n19980605 00:00,1103800,1118800,1098800,1118100,8140300,0.017286871076335197,-0.019300113966919764,-0.013252077743957669,-0.010027892012896868\n19980608 00:00,1119400,1124700,1116600,1118800,4056700,0.0006260620695823782,-0.019209858663944934,-0.013190231930877901,-0.009981191193757217\n19980609 00:00,1117200,1124200,1114100,1122800,2680400,0.003575259206292536,-0.01909903005378272,-0.01310580361744712,-0.009910836780825593\n19980610 00:00,1116300,1130600,1112500,1113800,6336300,-0.00801567509796941,-0.019196974615254138,-0.01320025206435545,-0.010003421461996925\n19980611 00:00,1114400,1118800,1092800,1096600,7897100,-0.01544262883821157,-0.019589415514200455,-0.013522246272873788,-0.010287860800520271\n19980612 00:00,1098800,1104400,1082500,1102500,9700700,0.005380266277585255,-0.019478127949364245,-0.013432320325722075,-0.010209322652712297\n19980615 00:00,1088100,1099100,1078800,1080000,9754800,-0.020408163265306145,-0.020117470207275355,-0.013940782857687132,-0.010648013687066554\n19980616 00:00,1084100,1091600,1077500,1090600,7245000,0.00981481481481472,-0.020033947922254346,-0.013858791319279983,-0.01056683818401507\n19980617 00:00,1101600,1117800,1099400,1112500,11964800,0.02008068952869979,-0.02017939103736421,-0.013912712853965913,-0.010571969902832061\n19980618 00:00,1111900,1114400,1107500,1111600,3749600,-0.0008089887640448934,-0.020107452955208556,-0.013866998280808,-0.010540234985286638\n19980619 00:00,1110600,1112300,1096300,1100300,3538200,-0.010165527168046085,-0.02025404075494756,-0.013999333494633002,-0.01066497219829938\n19980622 00:00,1102500,1110600,1100600,1103800,5357100,0.0031809506498228224,-0.020148723773458797,-0.013919650928454628,-0.010598955244068575\n19980623 00:00,1110900,1121900,1110000,1119700,5205600,0.014404783475267191,-0.020135474459084236,-0.013877289404694524,-0.010541074109208232\n19980624 00:00,1121600,1136900,1116100,1134700,8222700,0.013396445476467012,-0.020100211393386674,-0.013822399739582778,-0.01047572157657261\n19980625 00:00,1139100,1144700,1128100,1130000,5837700,-0.004142063981669164,-0.02008719236057356,-0.013826552384991257,-0.010489028380101082\n19980626 00:00,1133100,1138400,1131300,1134100,4753900,0.0036283185840708665,-0.019984359032936515,-0.013748168265911333,-0.010423678043634149\n19980629 00:00,1142500,1146900,1138000,1138900,6537200,0.004232431002556991,-0.01988117593198034,-0.013668179284920846,-0.010356053762172737\n19980630 00:00,1139100,1141900,1130600,1133600,4126100,-0.004653613135481627,-0.01987993120417504,-0.01368154426349558,-0.01037720712115873\n19980701 00:00,1140600,1149400,1136300,1149400,3241200,0.013937896965419805,-0.01985695787053137,-0.013635394345496534,-0.010318701851799578\n19980702 00:00,1147200,1148800,1142500,1146300,3432900,-0.002697059335305396,-0.01982078489172087,-0.013619375217733362,-0.010313426667454937\n19980706 00:00,1147800,1158400,1145600,1157800,3042100,0.010032277763238229,-0.01974368983090875,-0.01354467496467586,-0.010240003077549971\n19980707 00:00,1159800,1161300,1152800,1155600,4847300,-0.0019001554672655185,-0.019696794238384035,-0.013519169399114921,-0.01022590045621443\n19980708 00:00,1158800,1169400,1157500,1168100,6773100,0.010816891658013139,-0.019629196412701597,-0.013449801923171457,-0.010155589586265005\n19980709 00:00,1162800,1167200,1156300,1160000,7258600,-0.006934337813543356,-0.019682055640072298,-0.013506249793354188,-0.010213950548651865\n19980710 00:00,1160300,1169100,1150600,1165300,7739800,0.004568965517241397,-0.01958575901085234,-0.013431021080257257,-0.010149953063683024\n19980713 00:00,1165600,1168400,1160600,1167500,6846100,0.0018879258560027257,-0.019501467382456214,-0.013370385004486424,-0.010101927675484674\n19980714 00:00,1169400,1181600,1169400,1178100,7119900,0.00907922912205561,-0.019420952615420713,-0.013296475520192854,-0.01003153944297946\n19980715 00:00,1180600,1182800,1174400,1175600,4908000,-0.0021220609455903094,-0.019381445671947172,-0.013276488115168326,-0.01002195783167443\n19980716 00:00,1176900,1185900,1170600,1184400,6239600,0.007485539299081356,-0.019293276680053012,-0.013200971624144386,-0.00995318634204667\n19980717 00:00,1186300,1190000,1183100,1187500,3478600,0.002617359000337771,-0.01920848073544083,-0.013138599069605798,-0.009902767613783588\n19980720 00:00,1187500,1192300,1179400,1185000,2238300,-0.002105263157894721,-0.01917079700344757,-0.013119745538988432,-0.009893952393842782\n19980721 00:00,1190000,1190000,1162800,1165300,5107200,-0.0166244725738397,-0.01953928680637686,-0.013419011211411192,-0.010156314938440863\n19980722 00:00,1163400,1195900,1155300,1166300,10611500,0.0008581481163649762,-0.019466713937280698,-0.01336874848329669,-0.010117945663930018\n19980723 00:00,1163100,1168400,1138800,1141900,14881000,-0.02092086084197886,-0.02001177736885138,-0.013801072682273157,-0.010490168995176729\n19980724 00:00,1149700,1150900,1128800,1141600,11706000,-0.000262720028023522,-0.019947676021032215,-0.013758787407891035,-0.010459513788818412\n19980727 00:00,1136300,1150000,1128400,1149800,9360300,0.007182901191310487,-0.019862346457663292,-0.013685980294625942,-0.010393382347367157\n19980728 00:00,1144400,1146600,1118800,1133100,13422500,-0.014524265089580823,-0.020122020077565073,-0.01390206664808066,-0.010586232490363837\n19980729 00:00,1137200,1141300,1122500,1126600,6932100,-0.005736475156649878,-0.020136892706841075,-0.01392660873571772,-0.010615929330473516\n19980730 00:00,1136300,1145900,1134100,1143400,6617400,0.014912124977809249,-0.020136398046930452,-0.013898084090677033,-0.010572462004078662\n19980731 00:00,1143400,1145000,1113100,1120600,7679600,-0.019940528249081657,-0.020595781534301662,-0.014265520170030181,-0.010890881260448123\n19980803 00:00,1117800,1124200,1110300,1113800,10349100,-0.006068177761913263,-0.02061275709039314,-0.014291731423824762,-0.010922016030513602\n19980804 00:00,1122200,1122200,1072500,1076100,14468800,-0.03384808762794034,-0.02178912955319699,-0.015192866243317138,-0.01167642268081174\n19980805 00:00,1079400,1088800,1055900,1081600,21457200,0.0051110491590000695,-0.021698442274568165,-0.015120069520540378,-0.011613163347159733\n19980806 00:00,1081300,1095200,1075600,1090900,13163000,0.008598372781065011,-0.021619659202622522,-0.015048949811752685,-0.011546128948914988\n19980807 00:00,1096900,1105900,1084700,1090300,11718400,-0.0005500045833715106,-0.02155482501629339,-0.01500576479849067,-0.011514485029707146\n19980810 00:00,1087500,1096600,1081900,1085900,6055400,-0.004035586535815816,-0.021531017856401883,-0.014998315094068605,-0.01151575542426875\n19980811 00:00,1067800,1074400,1055000,1070600,14385600,-0.014089695183718609,-0.02173094849406181,-0.015168313679972003,-0.011669797344137579\n19980812 00:00,1077500,1088100,1075000,1085000,10997500,0.01345040164393807,-0.021702591421128098,-0.015123795722800296,-0.011616664079378322\n19980813 00:00,1088100,1096600,1076300,1076400,8529600,-0.007926267281106014,-0.02174453066655616,-0.015169962521988545,-0.011665084571833014\n19980814 00:00,1083400,1087200,1057800,1064800,7995800,-0.010776662950576,-0.0218481052239449,-0.015264882913109642,-0.01175539145893963\n19980817 00:00,1060000,1089400,1055000,1085000,11035000,0.01897069872276491,-0.021917036172500657,-0.0152791690098453,-0.011740546587370998\n19980818 00:00,1090000,1105900,1087800,1102500,7245000,0.016129032258064502,-0.02192624077384854,-0.015256966488527804,-0.011701601045175598\n19980819 00:00,1110900,1110900,1096300,1100000,6054300,-0.0022675736961451642,-0.02188057578992092,-0.01523044056699224,-0.01168527808698143\n19980820 00:00,1096900,1104100,1091600,1092500,7590600,-0.006818181818181834,-0.021900502650516955,-0.015258603314659525,-0.01171783135557135\n19980821 00:00,1081900,1087200,1055000,1083800,16427600,-0.007963386727688815,-0.02194072074685855,-0.015303033914774007,-0.011764507625859734\n19980824 00:00,1092500,1099400,1083100,1090600,7902200,0.0062742203358552295,-0.021858251817626392,-0.015234613574876451,-0.011703576536952802\n19980825 00:00,1103800,1112500,1086400,1095000,9623400,0.0040344764349899975,-0.021775644879825543,-0.015170270622531963,-0.011648970047673325\n19980826 00:00,1082800,1096300,1077500,1085000,9090300,-0.0091324200913242,-0.021839048246295602,-0.015232901408577245,-0.011711188973952916\n19980827 00:00,1070000,1078400,1038900,1042500,24042400,-0.03917050691244239,-0.023151493616266332,-0.016232110993757275,-0.012543413721319726\n19980828 00:00,1049700,1057200,1021600,1030000,23196400,-0.011990407673860948,-0.023262737350062547,-0.016332886247173523,-0.012638608266581672\n19980831 00:00,1037500,1040200,950000,962500,22799800,-0.06553398058252424,-0.026421979787024947,-0.018682984951500305,-0.014557355441095148\n19980901 00:00,960600,1005600,936300,996900,24391500,0.03574025974025985,-0.02690287942949615,-0.018960305284189887,-0.014726148397039677\n19980902 00:00,998100,1017500,987800,990000,13984400,-0.006921456515197155,-0.026894315869252866,-0.018966685483977154,-0.014740495060003201\n19980903 00:00,976300,993800,966900,985200,16873300,-0.00484848484848488,-0.02685826108459459,-0.018949887436001706,-0.014733962707098137\n19980904 00:00,994400,998100,957800,976300,16414800,-0.009033698741372276,-0.026881919972582904,-0.018982419900011385,-0.014771225641650136\n19980908 00:00,1008800,1029700,998100,1025900,14307900,0.05080405613028782,-0.027979595008369947,-0.019671644843739587,-0.015242707352679637\n19980909 00:00,1027500,1031300,1004800,1007500,12026000,-0.017935471293498373,-0.02818906911373874,-0.019850949495698017,-0.015405928780660293\n19980910 00:00,984400,993400,968100,982500,19666100,-0.02481389578163773,-0.028596013449600836,-0.020181163069358913,-0.015695237468916684\n19980911 00:00,981900,1015000,970000,1012500,20203300,0.03053435114503822,-0.028835770169022407,-0.020299493494290645,-0.015748835985566628\n19980914 00:00,1028800,1044500,1020900,1031600,10318300,0.018864197530864102,-0.02882861044788211,-0.020263361259558615,-0.015697258611045126\n19980915 00:00,1028800,1043100,1022800,1042000,8166200,0.010081426909654967,-0.028739287475312476,-0.020184106855619027,-0.015623371723785744\n19980916 00:00,1047500,1052500,1031600,1050000,11125300,0.007677543186180413,-0.028642752331492494,-0.020103913534572623,-0.015551890167990686\n19980917 00:00,1022500,1030300,1017800,1022300,12549700,-0.026380952380952394,-0.02908699484047948,-0.02046226560420276,-0.015864454362217978\n19980918 00:00,1023800,1024100,1010900,1019700,6667900,-0.0025432847500733713,-0.029024688988567544,-0.02042295421422129,-0.015837401234805794\n19980921 00:00,996300,1034100,989400,1021900,8552400,0.0021574973031284195,-0.02893414690783225,-0.020355975176063773,-0.015782983567456735\n19980922 00:00,1035000,1036600,1021600,1030000,7070200,0.00792641158626095,-0.028840211954016502,-0.020277293003115815,-0.015712432595549903\n19980923 00:00,1038800,1070000,1037800,1066300,12804500,0.035242718446601984,-0.029180971521479523,-0.020462129978347357,-0.015814147813819394\n19980924 00:00,1063100,1068100,1032500,1043800,10809300,-0.021101003469942814,-0.029450878013553505,-0.020687677998581788,-0.01601604849685473\n19980925 00:00,1031300,1054200,1026300,1043000,10051500,-0.0007664303506418335,-0.029376461603714227,-0.02063701922061459,-0.01597805482452875\n19980928 00:00,1053100,1063100,1042500,1049100,8368600,0.005848513902205088,-0.02928042734662979,-0.0205605795833193,-0.015912061006537567\n19980929 00:00,1053800,1059400,1033800,1049400,10488400,0.0002859593937660776,-0.029200962580272386,-0.020504708183035927,-0.015868767142406304\n19980930 00:00,1035000,1043100,1013800,1018400,7537300,-0.02954068991804837,-0.02971901979269931,-0.02091803885616885,-0.016226268484958645\n19981001 00:00,1000300,1015500,980900,986300,12833400,-0.031520031421838124,-0.03029119226390547,-0.021372215811320372,-0.016617542467117358\n19981002 00:00,988800,1008800,972200,1003100,14014100,0.017033356990773685,-0.03025483863340618,-0.021320350138559915,-0.016557407382026303\n19981005 00:00,995900,1000000,963400,990000,12408900,-0.013059515501943952,-0.030326816071535652,-0.021391753590541678,-0.01662850484411663\n19981006 00:00,1007500,1012800,975300,985300,12216900,-0.0047474747474747225,-0.030283489044453583,-0.02136866719552622,-0.016616208655159965\n19981007 00:00,986300,1000300,957500,972200,13942400,-0.013295443012280472,-0.03035754294712616,-0.02144153898322828,-0.016688450261745393\n19981008 00:00,945600,967500,922200,962200,20019400,-0.01028594939312899,-0.030381449791382464,-0.021474173560889157,-0.01672573756178923\n19981009 00:00,970000,995600,940600,986300,11865900,0.02504676782373716,-0.030460208422604565,-0.021492075647222827,-0.01671119724922886\n19981012 00:00,1006300,1014400,996900,997800,9127600,0.0116597384163033,-0.030382307576649125,-0.021419709714235728,-0.01664178195786448\n19981013 00:00,995600,1004100,987500,995300,5916200,-0.0025055121266787106,-0.030320967497362936,-0.021380401223634878,-0.016614218425668837\n19981014 00:00,989400,1018100,988400,1005000,8056200,0.009745805284838704,-0.03023564967841688,-0.021305879791708053,-0.016545452507712357\n19981015 00:00,1001300,1072500,999400,1050300,19735400,0.04507462686567165,-0.03082197959820408,-0.02165412312258111,-0.01676677275902126\n19981016 00:00,1061300,1067500,1050000,1056600,16305900,0.005998286203941827,-0.030728381080411392,-0.021579810787224207,-0.016702741816156687\n19981019 00:00,1056900,1068100,1055000,1063400,7627400,0.006435737270490183,-0.030635436093988642,-0.021505401117472265,-0.016638213255136175\n19981020 00:00,1075600,1088000,1060900,1065000,14236900,0.001504607861576135,-0.030552988762711356,-0.021445687188386058,-0.016590618418638178\n19981021 00:00,1068800,1076300,1058800,1071300,8997900,0.005915492957746515,-0.03046142417799089,-0.021373144132849128,-0.016528215669924087\n19981022 00:00,1067800,1084700,1061600,1080000,8012900,0.008120974516941937,-0.03037190204405211,-0.021298939372516073,-0.01646217654478175\n19981023 00:00,1079700,1080000,1067800,1071300,6188800,-0.008055555555555594,-0.03037009589849714,-0.021310091147591324,-0.016480236139397093\n19981026 00:00,1077200,1085600,1067800,1075500,5654900,0.003920470456454828,-0.03028263370087003,-0.02124344441140737,-0.016424686048685543\n19981027 00:00,1084400,1089700,1062800,1066300,9865800,-0.008554160855416049,-0.030287125881081844,-0.021259600822678727,-0.016447060618373876\n19981028 00:00,1065600,1078100,1060300,1067800,5499700,0.0014067335646628099,-0.030208326176819414,-0.021202643321931676,-0.016401747115498702\n19981029 00:00,1070900,1089700,1066300,1089700,8847200,0.0205094587001311,-0.030206753687126497,-0.021173397409331968,-0.016357748603546673\n19981030 00:00,1101300,1109100,1095000,1100000,9498800,0.00945214279159412,-0.030123068605270798,-0.02110186122997852,-0.01629268895916288\n19981102 00:00,1108100,1117500,1101900,1114800,6351000,0.013454545454545386,-0.030056897602742157,-0.021037242950227984,-0.016228898430179852\n19981103 00:00,1115900,1118100,1107500,1111300,6573900,-0.0031395766056692143,-0.03000811271484617,-0.02100812538846454,-0.016210265447203148\n19981104 00:00,1124700,1130900,1110900,1118400,7788100,0.00638891388463958,-0.029921864647819145,-0.020939301953424524,-0.016150731018999467\n19981105 00:00,1115300,1138100,1111300,1137300,6686200,0.016899141630901227,-0.02988183656277633,-0.020888777105411687,-0.016094610385488223\n19981106 00:00,1134700,1145000,1133100,1142800,5136100,0.004836015123538262,-0.029797576541325782,-0.020823698870147435,-0.016039757889461992\n19981109 00:00,1139400,1142500,1125000,1131400,5908800,-0.009975498774938751,-0.029824299910610648,-0.02085732433951095,-0.016077062842837768\n19981110 00:00,1130000,1139400,1125000,1126900,9142100,-0.003977373165989007,-0.02978438527215719,-0.02083556189673689,-0.016064977268412262\n19981111 00:00,1138100,1140600,1118900,1123800,10735000,-0.0027509095749400636,-0.029734838074103515,-0.020805273477529647,-0.01604495563294527\n19981112 00:00,1123100,1131300,1116900,1120300,5396300,-0.003114433173162512,-0.02968832115166476,-0.020777572601762655,-0.016027285522034435\n19981113 00:00,1122200,1130600,1121300,1127700,5531900,0.006605373560653494,-0.02960569881762844,-0.020711294133126928,-0.015969719907566963\n19981116 00:00,1142200,1143600,1128900,1138400,5934200,0.009488339097277754,-0.029527552715254982,-0.02064441317882385,-0.015908844362016047\n19981117 00:00,1136600,1156300,1130000,1143400,8944500,0.004392129304286785,-0.029447518267751143,-0.020583057555821824,-0.015857446351239146\n19981118 00:00,1143100,1149400,1135000,1147500,4538000,0.0035857967465453555,-0.02936959170426107,-0.02052429928361045,-0.01580890662418049\n19981119 00:00,1152800,1159100,1146300,1155000,5115600,0.006535947712418277,-0.029289034065734392,-0.020459838031543814,-0.015753026296174637\n19981120 00:00,1163600,1167500,1158400,1166300,5351500,0.009783549783549894,-0.029213541231466064,-0.020394777661419953,-0.015693527434083195\n19981123 00:00,1174700,1192200,1171600,1191600,6442400,0.021692531938609205,-0.02922658440148135,-0.02037691559532281,-0.015659189900972408\n19981124 00:00,1190000,1196600,1184500,1186900,5121600,-0.003944276602886876,-0.02919081945643211,-0.020358014211975844,-0.0156492784199691\n19981125 00:00,1189400,1191900,1181600,1188800,4268500,0.001600808829724576,-0.029121381311474032,-0.020308091796360176,-0.015609759767452292\n19981127 00:00,1194700,1197200,1190000,1195000,4562000,0.005215343203230249,-0.029043539830662053,-0.020247590875738127,-0.015558503035302648\n19981130 00:00,1190200,1193800,1166600,1166900,7991700,-0.023514644351464442,-0.029320350271458576,-0.02047464828477394,-0.015759037287206748\n19981201 00:00,1161300,1180300,1152200,1178100,8773600,0.009598080383923291,-0.029246119173413604,-0.020411052907095217,-0.01570111177270018\n19981202 00:00,1172200,1179100,1160000,1175000,7322100,-0.0026313555725320237,-0.029200718785526023,-0.020383447524636736,-0.015682992841789523\n19981203 00:00,1172500,1183100,1151900,1152800,11737800,-0.018893617021276565,-0.029372544186179295,-0.020529928086735177,-0.015815962164237272\n19981204 00:00,1166300,1188800,1155900,1179700,10616800,0.02333448993754339,-0.029405705439092995,-0.02052505858611752,-0.01579081860963632\n19981207 00:00,1180600,1195300,1180000,1192500,4105700,0.010850216156649939,-0.02933585344301527,-0.02046322430858064,-0.015733258548185792\n19981208 00:00,1185300,1197500,1175000,1184700,9996400,-0.006540880503144608,-0.02932433170140374,-0.020464417957579428,-0.015741230724868497\n19981209 00:00,1186900,1189700,1178800,1188100,5259600,0.002869924875495977,-0.029253095471456565,-0.0204116294836868,-0.015698276681466762\n19981210 00:00,1188400,1188400,1167200,1168100,5844400,-0.016833599865331172,-0.029383390457849476,-0.02052570961294075,-0.01580371273037937\n19981211 00:00,1164400,1173400,1155600,1170600,8669100,0.0021402277202293707,-0.029314749211003584,-0.020475592357262516,-0.015763470545848746\n19981214 00:00,1161600,1164100,1139100,1144700,9276400,-0.022125405774816365,-0.02954544796267673,-0.020666880669183155,-0.01593374929816681\n19981215 00:00,1146900,1167500,1145300,1166300,9482100,0.01886957281383772,-0.02952850947234957,-0.02063280249895977,-0.015890534028012285\n19981216 00:00,1171300,1171300,1157500,1164100,7183500,-0.0018863071250964092,-0.02947923334500458,-0.020601272963536203,-0.015868465135074745\n19981217 00:00,1172200,1185600,1170200,1185000,6720200,0.017953784039171916,-0.029453781848756994,-0.020562544524639032,-0.015822658807179427\n19981218 00:00,1183100,1191300,1178800,1190200,4027900,0.004388185654008447,-0.029381122269653396,-0.020506961919378067,-0.015776179873484463\n19981221 00:00,1192500,1213400,1190000,1203100,8465700,0.010838514535372212,-0.02931417157436151,-0.020447706044494727,-0.015721026078887965\n19981222 00:00,1204100,1212200,1191900,1205300,5581100,0.0018286094256503294,-0.029248790580714383,-0.020400430448469863,-0.01568340240334057\n19981223 00:00,1211900,1231900,1208100,1228100,7558200,0.018916452335518086,-0.029231561587994562,-0.020366860595703955,-0.015641121298549776\n19981224 00:00,1231600,1238800,1222800,1226900,1557500,-0.0009771191271069624,-0.02917957551928706,-0.0203324828907961,-0.015616130547227717\n19981228 00:00,1232500,1233100,1220000,1226300,4031000,-0.00048903741136197,-0.029125292615731765,-0.020295885473425423,-0.015588961197100884\n19981229 00:00,1227200,1244400,1221300,1243100,3747300,0.013699747207045476,-0.029071599632961846,-0.020242997875149382,-0.015536502946318389\n19981230 00:00,1239400,1247500,1230300,1233800,6962800,-0.007481296758104716,-0.02907148773087212,-0.02025293399201798,-0.015551795624913229\n19981231 00:00,1233100,1239400,1224700,1228800,6480500,-0.0040525206678554415,-0.029040750294053164,-0.020237134621095356,-0.015543959681644983\n19990104 00:00,1233800,1252200,1217200,1228800,9480700,0.0,-0.028985205054796848,-0.020199036710543166,-0.015515162877465037\n19990105 00:00,1229400,1248800,1229400,1244400,7840800,0.0126953125,-0.028996452538978035,-0.020196887814020716,-0.015505872419959777\n19990106 00:00,1258100,1276300,1257500,1275000,7648500,0.024590163934426146,-0.0289941704963415,-0.020153369103630196,-0.01544037059457664\n19990107 00:00,1263800,1272200,1257800,1269400,5364300,-0.004392156862745078,-0.02901324538997348,-0.020170037054539666,-0.015455755413227093\n19990108 00:00,1281900,1285000,1259700,1275000,6076900,0.004411533007720125,-0.028946143654916476,-0.020109149519207628,-0.015398180644774183\n19990111 00:00,1276900,1276900,1252200,1262800,7455600,-0.009568627450980416,-0.02842729609284236,-0.01971324609391581,-0.015067818283873831\n19990112 00:00,1262200,1262200,1238100,1240000,7434300,-0.01805511561609119,-0.028610050420718132,-0.019883440701217888,-0.0152313173506125\n19990113 00:00,1204100,1251300,1203800,1233100,10563100,-0.005564516129032304,-0.02865203407662409,-0.019933930471929776,-0.015286341699652461\n19990114 00:00,1236300,1239100,1209100,1211600,11370000,-0.01743573108425922,-0.028859980072730766,-0.020108431241425556,-0.015443012942598523\n19990115 00:00,1223800,1247800,1220300,1243100,7757900,0.025998679432155836,-0.02890692174139759,-0.020100842584144428,-0.01540635437033177\n19990119 00:00,1253000,1274700,1235000,1252800,6270400,0.007803072962754509,-0.028890213242773626,-0.020095753110669422,-0.015407458956170081\n19990120 00:00,1260900,1279400,1250300,1256300,6222800,0.002793742017879852,-0.028845557722225572,-0.020082313636079756,-0.015410660640172862\n19990121 00:00,1255800,1258400,1232200,1235900,6408000,-0.016238159675236785,-0.028950258768117087,-0.020165255384422515,-0.015482002587507775\n19990122 00:00,1221300,1238400,1217800,1225600,7249900,-0.008334007605793392,-0.028944622569945084,-0.020160668851642815,-0.015477975627464658\n19990125 00:00,1232800,1240000,1219100,1236300,5008100,0.008730417754569286,-0.028883290113174653,-0.0200994287694767,-0.015416784789858293\n19990126 00:00,1241300,1257200,1236300,1255000,5893300,0.01512577853271857,-0.028897338490250883,-0.020092871957357816,-0.015399243427624368\n19990127 00:00,1263800,1266300,1244100,1244700,7089500,-0.008207171314741024,-0.028961746849653632,-0.020163128884386084,-0.015472618204412494\n19990128 00:00,1252500,1269700,1251900,1266600,5763500,0.017594601108700925,-0.02900273931932497,-0.020182205579117644,-0.015480011680618062\n19990129 00:00,1273400,1283000,1254100,1278800,5990400,0.009632085899257792,-0.029004129001776766,-0.020182323677182874,-0.015479451901752027\n19990201 00:00,1286900,1286900,1270000,1270900,9098500,-0.006177666562402262,-0.029018880451219125,-0.02019475551192214,-0.015490647158476284\n19990202 00:00,1270800,1272200,1247700,1262800,9197400,-0.006373436147611877,-0.02901710991679179,-0.020223852540204746,-0.015536199570221074\n19990203 00:00,1256900,1279400,1256600,1271900,10155700,0.007206208425720728,-0.02901562721264238,-0.020219529260354877,-0.015530361989976201\n19990204 00:00,1273800,1275000,1248100,1248400,6727600,-0.018476295306234736,-0.02921917111761,-0.020383769677903698,-0.015673649863815795\n19990205 00:00,1256600,1256600,1232200,1240000,7444000,-0.006728612624158914,-0.029255299956362623,-0.020414709725698314,-0.01570182378635065\n19990208 00:00,1250900,1250900,1233400,1243800,8364900,0.0030645161290323575,-0.029257190252880573,-0.020422906566216356,-0.015713382622139192\n19990209 00:00,1243800,1245000,1215600,1218600,8502300,-0.02026049204052094,-0.029489390428501235,-0.020609030224122055,-0.015874943058946853\n19990210 00:00,1221300,1230000,1213300,1226900,6492100,0.006811094698834674,-0.029487048253859324,-0.020609915759178792,-0.015877549274100528\n19990211 00:00,1230600,1256900,1225000,1256900,8880800,0.0244518705680985,-0.02959044400606773,-0.020655508538341562,-0.015892327502219594\n19990212 00:00,1248100,1255000,1226300,1235000,10496300,-0.017423820510780508,-0.029791591295405453,-0.02082401812137445,-0.016043438044789877\n19990216 00:00,1247500,1256300,1233800,1243800,6590400,0.007125506072874543,-0.02974638465025891,-0.020778109478128713,-0.01599715516895505\n19990217 00:00,1231900,1253600,1222500,1227500,7447000,-0.013105000803987799,-0.02987346629589663,-0.020885245650764602,-0.016093658483737405\n19990218 00:00,1231900,1243800,1222200,1239400,8844800,0.009694501018330026,-0.029871529955008,-0.020884761022040923,-0.01609394775739713\n19990219 00:00,1240000,1257500,1233800,1239400,5219200,0.0,-0.029848004297823777,-0.02086351809440813,-0.01607392174444148\n19990222 00:00,1244400,1277200,1242800,1276900,10212200,0.030256575762465765,-0.030044309000000404,-0.020973463639540647,-0.016137829542506452\n19990223 00:00,1275900,1285000,1265900,1275000,7631500,-0.0014879786984102195,-0.03006518884609529,-0.020994895668073905,-0.016159555937454374\n19990224 00:00,1278400,1288400,1254100,1254100,6777300,-0.01639215686274509,-0.03017694374935814,-0.021083914080602395,-0.01623645361090366\n19990225 00:00,1245300,1252800,1225900,1247500,11219400,-0.005262738218642871,-0.030212971388875687,-0.02113003787580118,-0.016287959629337552\n19990226 00:00,1247500,1248400,1228100,1239100,9233600,-0.006733466933867782,-0.03027332999899297,-0.02118699552132716,-0.016343104233224413\n19990301 00:00,1236600,1243100,1208800,1237800,7594300,-0.0010491485755790286,-0.030283770220359715,-0.021197146033835296,-0.016353100303012034\n19990302 00:00,1245000,1253100,1223100,1228100,9311200,-0.007836484084666306,-0.030318801953253094,-0.021226715560078754,-0.016379757947102086\n19990303 00:00,1230900,1235600,1217800,1231300,7558900,0.0026056510056184923,-0.030323695256137137,-0.021233801169811856,-0.016388012267504283\n19990304 00:00,1240600,1252300,1232700,1250000,7787300,0.015187200519775956,-0.03031087199851697,-0.02120222714172275,-0.016346442273061198\n19990305 00:00,1275000,1281300,1259200,1278100,10091200,0.022480000000000055,-0.0302836357952032,-0.021143326216047236,-0.016270661001062836\n19990308 00:00,1282800,1288000,1272500,1285200,4553000,0.005555120882560161,-0.030228605185592283,-0.021120368193425443,-0.016264800755887543\n19990309 00:00,1281300,1299400,1274400,1282500,7703600,-0.0021008403361344463,-0.030223361604894628,-0.021115695137327414,-0.016260431844342473\n19990310 00:00,1284700,1292200,1277800,1290300,3748200,0.006081871345029244,-0.030214787482271792,-0.02111601328401665,-0.01626549042689813\n19990311 00:00,1296900,1311900,1288800,1302200,6543200,0.00922266139657446,-0.030216855058448684,-0.021113184367178774,-0.01626005120775245\n19990312 00:00,1310000,1310300,1292200,1295300,4963300,-0.005298725234219037,-0.030250739994077055,-0.02114330253074885,-0.016288161319076344\n19990315 00:00,1299400,1311900,1295000,1311600,5257400,0.012583957384389777,-0.03024683594683332,-0.02112558833858933,-0.016263084989763563\n19990316 00:00,1311300,1316600,1304700,1309800,4422900,-0.0013723696248856276,-0.03026568907665509,-0.021151681183686166,-0.016293037300284592\n19990317 00:00,1306900,1309400,1296300,1302500,4380300,-0.005573369980149678,-0.030309578893029016,-0.02119155516273136,-0.016330770451309547\n19990318 00:00,1297800,1323400,1297500,1321600,3537400,0.01466410748560465,-0.03032745065932316,-0.02119046697780896,-0.016319574786550647\n19990319 00:00,1323100,1326300,1298400,1300600,5265200,-0.01588983050847459,-0.030500852166154793,-0.021337527359048696,-0.01645259281120677\n19990322 00:00,1300600,1305900,1294200,1299100,4422000,-0.0011533138551438338,-0.030521071840216848,-0.021360181476121325,-0.016476544720840224\n19990323 00:00,1293100,1296300,1257000,1264100,9302400,-0.026941728889230965,-0.030862937273847812,-0.02162793411808269,-0.01670478810780027\n19990324 00:00,1268400,1271600,1256300,1269400,5950500,0.004192706273237867,-0.030860478542115037,-0.021632893466664378,-0.01671370200754866\n19990325 00:00,1280600,1292500,1277500,1291300,6432000,0.017252245155191526,-0.0308652160382491,-0.02161198301053632,-0.01667911872297416\n19990326 00:00,1286300,1291300,1277200,1284700,5881500,-0.0051111283202973645,-0.03089437161542289,-0.021637906194907474,-0.01670331873070297\n19990329 00:00,1291600,1314400,1291600,1312200,5395500,0.02140577566747104,-0.030919871201994707,-0.02162471857074322,-0.016669507097648657\n19990330 00:00,1299400,1312200,1295600,1303400,5090200,-0.006706294772138355,-0.030956556842839753,-0.021656436718217997,-0.01669857709278883\n19990331 00:00,1311600,1316100,1284400,1286300,7029600,-0.013119533527696792,-0.03108845247914335,-0.02177291917758923,-0.016806842844570423\n19990401 00:00,1296900,1296900,1281300,1293800,7473900,0.005830677135971296,-0.03108784229918026,-0.021775107541779914,-0.016810523102294098\n19990405 00:00,1309400,1323800,1302500,1323800,5533700,0.023187509661462435,-0.031178229178785013,-0.0218230592913639,-0.01683585284108569\n19990406 00:00,1321900,1329800,1311600,1319400,5022000,-0.0033237649191720786,-0.031202523615608754,-0.021845760841092965,-0.016857705228598703\n19990407 00:00,1326900,1333800,1313800,1328800,6056300,0.0071244505078065234,-0.031190067094583156,-0.02182929305245988,-0.01683909904804686\n19990408 00:00,1331900,1347800,1322800,1345300,5645500,0.012417218543046449,-0.031093902044655723,-0.021733919092185687,-0.01674414681473956\n19990409 00:00,1344400,1356900,1335900,1348800,4132000,0.002601650189548721,-0.031027836542585285,-0.02167507147495307,-0.016689147025205825\n19990412 00:00,1334700,1362500,1332200,1360600,7944600,0.008748517200474426,-0.03102872345008914,-0.02167471189377874,-0.016688122945529505\n19990413 00:00,1362500,1364700,1340300,1351900,10581100,-0.006394237836248706,-0.031071737097971286,-0.02171255806599107,-0.01672321435558334\n19990414 00:00,1360600,1360600,1326900,1330300,11566600,-0.01597751312966933,-0.03124526818142779,-0.02186105377285851,-0.016858363795828946\n19990415 00:00,1334400,1335600,1310000,1326300,11010600,-0.0030068405622791783,-0.031272146456822046,-0.021886988252652277,-0.016883795141680393\n19990416 00:00,1329100,1329100,1311900,1321300,6139800,-0.003769886149438295,-0.03121630047575056,-0.021840365569305093,-0.016842089364221286\n19990419 00:00,1326900,1345300,1283800,1289100,12557100,-0.02436993869673809,-0.03152996928084672,-0.0221042065638525,-0.01707936733734178\n19990420 00:00,1298100,1310300,1288800,1306300,8576400,0.013342642153440387,-0.03153716285760741,-0.02209575040784358,-0.017062568366701704\n19990421 00:00,1310600,1337800,1257800,1336900,5330700,0.023424940672127414,-0.03162323563358497,-0.022131652513285815,-0.017071724673326863\n19990422 00:00,1351300,1362500,1343900,1359700,6576600,0.017054379534744646,-0.031654295210430054,-0.022137606736149992,-0.017064295324880543\n19990423 00:00,1358800,1367500,1350000,1357500,4218900,-0.0016180039714642769,-0.03160448987336324,-0.022094910978856075,-0.017025389658256153\n19990426 00:00,1365000,1368100,1354700,1361300,3304000,0.0027992633517495147,-0.031506432086684556,-0.02200977583188922,-0.01694714352270235\n19990427 00:00,1371300,1375000,1358400,1365600,4907600,0.0031587453169763524,-0.03125786244999747,-0.02180634294488106,-0.016767772869929618\n19990428 00:00,1364400,1372500,1350000,1353400,5446900,-0.008933801991798496,-0.031327520680185995,-0.021866408689362484,-0.016822724895775427\n19990429 00:00,1355600,1360600,1338100,1345600,9593600,-0.005763262893453525,-0.03138026807959887,-0.021920034836474107,-0.01687681950003364\n19990430 00:00,1350900,1356300,1315000,1334700,10538700,-0.008100475624256864,-0.03141664332191792,-0.021975442336327644,-0.016942373025954218\n19990503 00:00,1334400,1357200,1330300,1356300,10658900,0.01618341200269713,-0.03144626449847979,-0.021985396759749722,-0.016941843176049878\n19990504 00:00,1351300,1358100,1331300,1333100,10221800,-0.017105360171053574,-0.03162325418556984,-0.022131044442958384,-0.017070782552963414\n19990505 00:00,1339400,1350000,1318400,1349700,9747000,0.012452179131347885,-0.03158576641217594,-0.0220839529414906,-0.017018571339595896\n19990506 00:00,1344400,1351300,1323800,1335000,13134000,-0.010891309179817732,-0.03159159933663073,-0.02208866143268738,-0.01702268039958354\n19990507 00:00,1345000,1349800,1334400,1346300,8344100,0.00846441947565535,-0.03151682499196959,-0.022016378781010745,-0.016951726060216988\n19990510 00:00,1348400,1357200,1335300,1342200,5372100,-0.0030453836440614834,-0.03153732640766381,-0.022049371278608888,-0.01699137750735767\n19990511 00:00,1353100,1368800,1257800,1357200,6679600,0.011175681716584673,-0.03152175102035705,-0.022023900890742944,-0.016960632131307853\n19990512 00:00,1357500,1372200,1315000,1366300,15070800,0.006704980842911823,-0.031521750130439286,-0.022024284951079384,-0.016961221407200383\n19990513 00:00,1372500,1380000,1368100,1370200,4174600,0.0028544243577546258,-0.03152389639838034,-0.022026857628114536,-0.016964021401345772\n19990514 00:00,1345600,1362500,1333100,1343000,8210400,-0.01985111662531014,-0.03174086590560911,-0.02220240975866904,-0.01711749408165093\n19990517 00:00,1336300,1344800,1323100,1343100,6277500,7.446016381229548e-05,-0.03167649096613346,-0.022146736000345488,-0.017066458890802792\n19990518 00:00,1345300,1349800,1326300,1336300,8114700,-0.005062914153823206,-0.03170069988164649,-0.022168062915681068,-0.017086249422507967\n19990519 00:00,1344700,1348800,1332500,1348100,4273700,0.00883035246576358,-0.03169418527136925,-0.022155498938858667,-0.017070460550764662\n19990520 00:00,1351300,1355900,1300600,1343100,4349700,-0.0037089236703509165,-0.031725237695164776,-0.022194536193428777,-0.017113754489074637\n19990521 00:00,1341300,1346900,1195800,1334200,6117400,-0.006626461171915676,-0.03173681386804436,-0.022204315799859934,-0.017122576352579924\n19990524 00:00,1338400,1338400,1303900,1310900,7687100,-0.01746364862839156,-0.031887267569104844,-0.022325479598484323,-0.017228125812596345\n19990525 00:00,1313800,1323400,1286900,1288400,9523800,-0.01716378060874213,-0.031924695712857845,-0.02235484979859028,-0.017253200352760664\n19990526 00:00,1293100,1310000,1280900,1306600,12776900,0.014126047811238829,-0.031931079461718755,-0.02234400348740848,-0.01723316876032607\n19990527 00:00,1298400,1302800,1280000,1284400,13998900,-0.01699066278891781,-0.03211321315612481,-0.022496456593538095,-0.01736979925467186\n19990528 00:00,1290000,1307500,1285900,1305900,8348100,0.016739333540952916,-0.03209477862305412,-0.022457410992124033,-0.017319765968990583\n19990601 00:00,1301300,1301600,1283800,1298800,6391500,-0.005436863465809072,-0.032133381361612555,-0.02249230083347867,-0.01735267647858462\n19990602 00:00,1297500,1301900,1206300,1297800,6812100,-0.0007699414844472008,-0.032140478605257226,-0.022499169479165915,-0.01735942325954664\n19990603 00:00,1306900,1309100,1297800,1302800,5933500,0.0038526737555864,-0.03205094219433818,-0.022419821472158943,-0.01728550665296529\n19990604 00:00,1314700,1331900,1309400,1319400,9507800,0.012741786920478892,-0.03204994547094468,-0.022419411546384018,-0.017285409546829514\n19990607 00:00,1334400,1341900,1329100,1337500,5078600,0.013718356828861689,-0.03202971900654302,-0.022409258684146775,-0.017280626884631018\n19990608 00:00,1333800,1338000,1315900,1321600,5000500,-0.011887850467289685,-0.03213205504601276,-0.02249616301618427,-0.017359304630537947\n19990609 00:00,1324100,1330900,1318100,1321600,7428700,0.0,-0.03214381991721478,-0.02250863759744472,-0.017372157555604426\n19990610 00:00,1314400,1315000,1295900,1309100,6785900,-0.009458232445520576,-0.0321585088799085,-0.02252070043751245,-0.017382820419417622\n19990611 00:00,1312200,1322200,1290900,1298100,12587100,-0.00840271942555959,-0.032072028992436705,-0.022451370702768397,-0.01732263336763244\n19990614 00:00,1306900,1307500,1295500,1297800,6542000,-0.00023110700254214134,-0.03208760290990116,-0.022468905435611412,-0.017341213403898204\n19990615 00:00,1304700,1316600,1300800,1305900,5438900,0.006241331484049928,-0.03184360703240255,-0.02226540755640395,-0.01715930485772601\n19990616 00:00,1323800,1338800,1321600,1334800,7562200,0.022130331572095763,-0.031917104755869265,-0.022303057826035852,-0.017177844982364025\n19990617 00:00,1328800,1355600,1326300,1346600,8476400,0.008840275696733624,-0.031861259879556694,-0.02227663928304925,-0.017167113508787957\n19990618 00:00,1340600,1346900,1333800,1343100,2601000,-0.0025991385712164083,-0.03187138039838825,-0.022285876057181145,-0.017175879161890558\n19990621 00:00,1344700,1350000,1336600,1349400,4452000,0.004690641054277522,-0.03177700387903282,-0.022201876701047268,-0.017097411833071726\n19990622 00:00,1340000,1351900,1333400,1337000,5603600,-0.00918926930487629,-0.03185780524014268,-0.022273387811750107,-0.017163970345659068\n19990623 00:00,1330000,1336300,1321300,1332800,9474700,-0.003141361256544517,-0.031871801346845856,-0.022303680928351187,-0.017202951337933294\n19990624 00:00,1328800,1338100,1306600,1316900,9029400,-0.011929771908763542,-0.03197240812055072,-0.02240425667583579,-0.017303510545454683\n19990625 00:00,1325900,1330200,1312500,1316600,3966300,-0.00022780773027564205,-0.0319494272415203,-0.022383457692449427,-0.01728387472256255\n19990628 00:00,1326900,1336300,1324700,1333800,5175700,0.013063952605195217,-0.031959439571952034,-0.022379568177120134,-0.01727257418469872\n19990629 00:00,1330000,1351300,1327800,1351300,6514400,0.013120407857249994,-0.03197052793006947,-0.022377076114206158,-0.01726284244958419\n19990630 00:00,1346300,1375000,1338400,1367500,16362400,0.011988455561311229,-0.031935774549944104,-0.022333157457844328,-0.017214037818374748\n19990701 00:00,1370000,1385000,1360600,1380600,9586200,0.00957952468007317,-0.03192173874777765,-0.022328299925609904,-0.017214073187878966\n19990702 00:00,1381300,1393000,1379100,1391900,3637300,0.008184847167898024,-0.031892137124351676,-0.02229471993611281,-0.017178372346150404\n19990706 00:00,1392500,1407500,1385900,1387200,10954800,-0.003376679359149315,-0.03192341202808848,-0.022332420681174196,-0.01721949868344454\n19990707 00:00,1390600,1397200,1385200,1395600,3052600,0.006055363321799234,-0.03189836699279762,-0.022305464324637914,-0.017191523408624742\n19990708 00:00,1390600,1406300,1387500,1395600,7133500,0.0,-0.03190864118443273,-0.022325303196982966,-0.01721646117686431\n19990709 00:00,1400000,1404700,1393800,1402200,2770400,0.004729148753224388,-0.031847511736888566,-0.022268522758214764,-0.017161999178582046\n19990712 00:00,1409400,1409400,1395000,1400600,4233900,-0.001141064042219364,-0.031866879803202845,-0.02228885484562108,-0.017182845182065386\n19990713 00:00,1393800,1399200,1386600,1395000,6359600,-0.003998286448664845,-0.03189750414398087,-0.02231735053681651,-0.017210206098044918\n19990714 00:00,1400000,1402200,1387500,1398400,4246900,0.002437275985663012,-0.03190210658176447,-0.022328325873419305,-0.017224578803426746\n19990715 00:00,1407800,1488800,1403100,1411300,3236000,0.009224828375286043,-0.03187765906423967,-0.022297849580143345,-0.017190888592105973\n19990716 00:00,1412500,1421600,1407500,1420000,2078000,0.006164529157514309,-0.03187767160573082,-0.02229939410084736,-0.01719324980525962\n19990719 00:00,1421900,1422500,1405600,1410000,4029000,-0.007042253521126751,-0.03193518407246973,-0.022351287667205767,-0.01724214795661666\n19990720 00:00,1401300,1404100,1375300,1378000,6843600,-0.02269503546099294,-0.032194708852988425,-0.022558720989224887,-0.017421811514862405\n19990721 00:00,1380900,1389100,1370000,1378800,4599000,0.0005805515239476478,-0.03202755211728176,-0.022420531580766342,-0.017299064481372743\n19990722 00:00,1374400,1380000,1354700,1361400,7580400,-0.012619669277632695,-0.03213965315104628,-0.022515460815322363,-0.017384839493311103\n19990723 00:00,1366600,1370000,1351300,1357500,4432000,-0.002864698104891983,-0.03191784784702281,-0.022337642481622032,-0.017230470450726124\n19990726 00:00,1348800,1361300,1346300,1350000,4026700,-0.0055248618784530246,-0.031951454204468537,-0.022367521147767504,-0.017258361898432918\n19990727 00:00,1360000,1372000,1353800,1365000,5722800,0.011111111111111072,-0.0319575407752218,-0.022367258200818776,-0.01725471404709222\n19990728 00:00,1362500,1373100,1355900,1367300,3803200,0.0016849816849817678,-0.03181592464090123,-0.022248284952595943,-0.017147811637663178\n19990729 00:00,1349400,1352500,1333100,1343800,7638800,-0.017187157171067113,-0.03195408676806715,-0.02235928427562265,-0.017244330570313132\n19990730 00:00,1348100,1353400,1328800,1330900,5569700,-0.009599642803988728,-0.03202058306839095,-0.022434795290965568,-0.017324647296875807\n19990802 00:00,1327500,1347500,1325000,1329400,5783300,-0.0011270568788037671,-0.031805884680424876,-0.02226112157167469,-0.017172843676653095\n19990803 00:00,1337200,1338400,1313800,1323600,5268700,-0.004362870467880198,-0.03179235152687888,-0.022249570508500006,-0.017162349258521087\n19990804 00:00,1327200,1338800,1305300,1306900,5986000,-0.012617104865518258,-0.03136825586291304,-0.021925031284089794,-0.01689088320365172\n19990805 00:00,1308800,1317200,1288400,1315600,9910600,0.00665697451985614,-0.031367305241691346,-0.021922562029986516,-0.016887604371978636\n19990806 00:00,1312200,1320000,1295000,1300600,7129800,-0.011401641836424448,-0.031476553115870914,-0.022023055876683968,-0.016983431479017676\n19990809 00:00,1305900,1318000,1297200,1300500,5162600,-7.688759034296666e-05,-0.03147432532720694,-0.02202093071879473,-0.01698136103321469\n19990810 00:00,1298800,1301600,1270000,1282200,9971000,-0.014071510957324063,-0.031579994570844545,-0.022107311184644807,-0.017057458723000025\n19990811 00:00,1296900,1305300,1286300,1305300,7796900,0.018015910154422166,-0.031477061036358917,-0.02199720936136166,-0.01694353551148357\n19990812 00:00,1306900,1318100,1300000,1300200,6292100,-0.003907147782119091,-0.031500541663980496,-0.02203398930761851,-0.01698740527529374\n19990813 00:00,1316300,1332500,1311300,1331900,5609100,0.0243808644823873,-0.03153036212057171,-0.022017517456756484,-0.016946255166622685\n19990816 00:00,1331300,1339700,1322500,1333800,3637600,0.0014265335235377208,-0.03143618985183038,-0.021936746554129027,-0.016872628482681784\n19990817 00:00,1344400,1351600,1331300,1347000,4708500,0.00989653621232578,-0.03139088198920738,-0.021915260016513963,-0.016863841005282987\n19990818 00:00,1342000,1343800,1334100,1335600,4046500,-0.008463251670378646,-0.03144045956420314,-0.021978902177757234,-0.01693498094541196\n19990819 00:00,1323800,1332300,1316900,1328800,6345700,-0.005091344713986201,-0.0314602058495357,-0.02199614645698331,-0.016950891414440783\n19990820 00:00,1330600,1339100,1326900,1338800,3054700,0.00752558699578576,-0.03139829770361901,-0.02193569965109027,-0.016891223643506988\n19990823 00:00,1348100,1364500,1346600,1363900,5284900,0.01874813265610986,-0.03137129972194349,-0.021885558904806476,-0.01682874557504513\n19990824 00:00,1360600,1379700,1353800,1365000,9108100,0.0008065107412567052,-0.03138374073004233,-0.021900711494733802,-0.01684534369921162\n19990825 00:00,1371900,1387800,1279100,1384400,5894000,0.014212454212454206,-0.03139832346829182,-0.02189919054188505,-0.01683523792822649\n19990826 00:00,1382800,1384200,1365000,1365000,4057900,-0.014013290956370938,-0.03145853014039369,-0.021947433846132302,-0.016877103605338208\n19990827 00:00,1368800,1370600,1351300,1351600,5935300,-0.009816849816849826,-0.03083989569662364,-0.021475902715333315,-0.016483992706361306\n19990830 00:00,1353400,1355000,1323900,1326600,4286300,-0.01849659662622083,-0.030937412183331445,-0.0215524154804738,-0.01654930846525381\n19990831 00:00,1329400,1337500,1307500,1325000,11968000,-0.0012060907583295588,-0.029147549329444897,-0.020212105601593672,-0.015448653613879738\n19990901 00:00,1329400,1335600,1323100,1335600,6137800,0.008000000000000007,-0.028851553867141392,-0.020035068427628658,-0.015335032663249539\n19990902 00:00,1321300,1326700,1306600,1322500,11370700,-0.009808325846061727,-0.028882865317454907,-0.020060563254080812,-0.015357426669044312\n19990903 00:00,1348800,1362800,1346900,1361900,9796800,0.02979206049149341,-0.0290211684050724,-0.020118081928068108,-0.015371879471049933\n19990907 00:00,1360600,1366300,1342800,1355200,4507400,-0.004919597620970717,-0.028980446020381877,-0.020084506425233798,-0.015342113944487737\n19990908 00:00,1348400,1360600,1335000,1349100,6999800,-0.004501180637544233,-0.028328443248930173,-0.019687796696114656,-0.015081499991581492\n19990909 00:00,1347500,1352500,1336900,1351300,5950500,0.001630716774145835,-0.028116641794258202,-0.019515296244029017,-0.014929950758550092\n19990910 00:00,1362500,1363600,1349400,1354500,2671700,0.0023680899874194417,-0.02775775993449584,-0.019229948756386096,-0.014683804172586605\n19990913 00:00,1351300,1354700,1345000,1348100,2130600,-0.0047249907715023465,-0.027592566967562078,-0.019154136826145012,-0.014655640942271932\n19990914 00:00,1340600,1345600,1333800,1340600,3558700,-0.005563385505526264,-0.027589017568401014,-0.019180023884339443,-0.014697220466959574\n19990915 00:00,1354400,1354400,1320600,1320800,6522800,-0.014769506191257609,-0.027751226574294234,-0.019323603227627,-0.014830868406046934\n19990916 00:00,1325000,1328100,1303100,1323800,15114200,0.0022713506965474917,-0.027756598128081258,-0.0193336858187794,-0.014843462433786687\n19990917 00:00,1326300,1339400,1321600,1337200,8371300,0.010122374981115012,-0.027358860435292873,-0.019010029247282123,-0.014559298233929131\n19990920 00:00,1339400,1340000,1330900,1336300,2602800,-0.0006730481603349769,-0.027347543901462896,-0.018999853726326423,-0.014549730982714651\n19990921 00:00,1322500,1324700,1301600,1309100,9018700,-0.020354710768540007,-0.027610132559006236,-0.01921168817580516,-0.0147345085516787\n19990922 00:00,1312500,1318400,1297500,1311600,12758600,0.0019097089603543616,-0.027616485602874205,-0.01922317444175259,-0.014748731319322353\n19990923 00:00,1318100,1342500,1237800,1280000,11455200,-0.024092711192436722,-0.027643200741621864,-0.01931103997745355,-0.014869195905365808\n19990924 00:00,1277500,1283800,1263100,1280600,13686000,0.00046875000000001776,-0.027374564220001514,-0.019096024949761876,-0.014682766297673209\n19990927 00:00,1287500,1297500,1282800,1282800,6797200,0.0017179447134156867,-0.027363920421141375,-0.019085611162605865,-0.014672475128905559\n19990928 00:00,1279400,1288100,1255600,1281900,11184900,-0.0007015902712815825,-0.02738145776938888,-0.019105625406757462,-0.014693809797098433\n19990929 00:00,1284400,1291300,1267800,1267800,7351000,-0.01099929791715426,-0.02747961922997727,-0.019188149793918117,-0.01476799811827624\n19990930 00:00,1274400,1294400,1269700,1283800,7185300,0.012620287111531736,-0.027009820716046833,-0.01880696540143433,-0.014434053586038996\n19991001 00:00,1279400,1285600,1266300,1283400,10818900,-0.0003115750116841065,-0.02647517978554671,-0.018392666047651933,-0.014083907881507832\n19991004 00:00,1291900,1306300,1287500,1306300,6202900,0.017843228923172916,-0.026482293844646183,-0.018396754608582176,-0.014086383560559232\n19991005 00:00,1307200,1319700,1286900,1301900,11376700,-0.0033682921227895513,-0.026372947765604837,-0.01830817513091875,-0.014008874681248232\n19991006 00:00,1307500,1328100,1306900,1326300,11399000,0.018741838850910186,-0.026386114631045985,-0.01829017886420101,-0.013974265464088764\n19991007 00:00,1328600,1330000,1315000,1320000,5986000,-0.004750056548292192,-0.02628351689369504,-0.01820770284580329,-0.013902516259609105\n19991008 00:00,1317500,1338800,1312300,1337200,9560400,0.013030303030302948,-0.02619175513127863,-0.018115717551315493,-0.01381041180100118\n19991011 00:00,1335900,1341300,1333100,1338100,3970800,0.0006730481603349769,-0.026067766830065266,-0.018056385183785023,-0.013785547272472295\n19991012 00:00,1331300,1333100,1311900,1314100,8223800,-0.017935879231746554,-0.026286738006433486,-0.01824561406816224,-0.013958920651043785\n19991013 00:00,1306900,1313100,1282500,1286600,10731100,-0.02092687010120997,-0.02654503843710095,-0.018449660961665497,-0.014134045184637834\n19991014 00:00,1284800,1291900,1267500,1284100,10461400,-0.001943105860407246,-0.026565553464994854,-0.018477754367229777,-0.014166178595296106\n19991015 00:00,1260000,1267500,1245000,1248100,14030700,-0.028035199750798268,-0.026417008311167903,-0.018457713924214553,-0.01421464353811178\n19991018 00:00,1249400,1257500,1234400,1255600,9088500,0.006009133883502882,-0.026417010466594316,-0.018457702837963226,-0.01421462539277105\n19991019 00:00,1271900,1282500,1259400,1260800,17208700,0.004141446320484299,-0.026417847103328593,-0.018460961461921454,-0.014219175169156347\n19991020 00:00,1277500,1292500,1271300,1292200,8467400,0.024904822335025445,-0.026554623940758932,-0.018530467699688666,-0.014252819699162901\n19991021 00:00,1272200,1288800,1266300,1286300,9352900,-0.004565856678532709,-0.026597379985480448,-0.018572882934743355,-0.014295053249845292\n19991022 00:00,1297500,1312200,1295600,1303400,8087900,0.013293943870014813,-0.026617142211681797,-0.018580842402056583,-0.014296720710068716\n19991025 00:00,1293100,1304700,1287500,1295000,7667400,-0.0064446831364124435,-0.02660053195090617,-0.018567225436864954,-0.014284699459676909\n19991026 00:00,1301900,1306900,1281900,1282500,5696200,-0.009652509652509633,-0.026693435664589583,-0.018648691754132515,-0.014360068543236692\n19991027 00:00,1283800,1303100,1282500,1301300,5049600,0.014658869395711482,-0.026642082926901702,-0.018585397817335814,-0.014290408797380803\n19991028 00:00,1324400,1345000,1321900,1345000,10053700,0.03358180281257206,-0.02692925432639493,-0.018751040506951543,-0.014391264981450548\n19991029 00:00,1358400,1376900,1357200,1365600,10480000,0.015315985130111454,-0.026881852101500386,-0.018723561903147196,-0.014374407586326497\n19991101 00:00,1365000,1370000,1356300,1359400,3631400,-0.0045401288810779095,-0.026920943844032458,-0.01876746766938721,-0.014420879690791994\n19991102 00:00,1359700,1372500,1347500,1348100,5787700,-0.008312490804766814,-0.026978598505598063,-0.018833536461902285,-0.014491434025381637\n19991103 00:00,1360000,1363800,1351300,1356900,7310900,0.006527705659817418,-0.026946604101340196,-0.018799676628366065,-0.014456579738399727\n19991104 00:00,1367500,1373600,1357700,1364700,7695600,0.005748397081583034,-0.02694656036194432,-0.01880039029280428,-0.014457697172019293\n19991105 00:00,1386300,1391100,1367800,1372200,7618700,0.005495713343592001,-0.026900068840605765,-0.018780774578796428,-0.01445240885145155\n19991108 00:00,1370000,1383800,1367500,1379400,4517900,0.005247048535198973,-0.02689978862935313,-0.01878009863452592,-0.014451521943373534\n19991109 00:00,1385000,1386900,1362800,1367200,4361300,-0.008844425112367715,-0.02688629798437064,-0.01876924516462786,-0.014442074341754709\n19991110 00:00,1362500,1383900,1360800,1377500,6173600,0.007533645406670564,-0.026848977361068265,-0.01872947609246886,-0.01440100001057018\n19991111 00:00,1381900,1385600,1374700,1383800,4724400,0.004573502722323042,-0.026820077596100122,-0.018700527885018088,-0.014372025978611168\n19991112 00:00,1392500,1399700,1371300,1397500,15589200,0.009900274606156945,-0.02679343066019971,-0.018666557671806038,-0.014334151753362426\n19991115 00:00,1398400,1402500,1394100,1398100,2101000,0.0004293381037567823,-0.026805546179568252,-0.018682303541119168,-0.014351832948797716\n19991116 00:00,1405600,1426300,1400900,1424400,7442900,0.01881124383091337,-0.026864127396395012,-0.01871288589838199,-0.0143674892176305\n19991117 00:00,1422500,1429400,1413100,1415600,9129600,-0.0061780398764391675,-0.026921081394174522,-0.018765443104589274,-0.014417702510519976\n19991118 00:00,1424400,1430000,1416300,1428100,11360400,0.008830178016388857,-0.026921701730094397,-0.018759785206127852,-0.014408697708541076\n19991119 00:00,1424100,1429700,1420000,1425000,4641100,-0.0021707163363909876,-0.02694776039899724,-0.018788331450757145,-0.014438570070585426\n19991122 00:00,1424400,1430000,1415000,1424700,4149600,-0.0002105263157894388,-0.026957222209468855,-0.01880663941578496,-0.01446159388787394\n19991123 00:00,1428400,1428400,1400600,1408800,5948300,-0.011160244261949837,-0.02697366270056034,-0.01885645455883148,-0.01452920093438228\n19991124 00:00,1407500,1424400,1400000,1420600,4357200,0.008375922771152844,-0.026938729339360198,-0.018817432750191144,-0.01448799958953996\n19991126 00:00,1424700,1428800,1412500,1414400,1694900,-0.004364353090243522,-0.02697239229528408,-0.01884816868412156,-0.014517175138876447\n19991129 00:00,1408800,1419200,1404400,1410000,7653200,-0.0031108597285067763,-0.027003436883304442,-0.01887979796295681,-0.014549116114221598\n19991130 00:00,1407500,1423100,1390000,1392500,8403900,-0.012411347517730542,-0.026797357434655573,-0.018721181254160373,-0.01441580161641528\n19991201 00:00,1393100,1405000,1390000,1401300,6790400,0.006319569120287305,-0.026791915481317045,-0.01872114471613482,-0.01441864668529155\n19991202 00:00,1406300,1413600,1403800,1411300,6706200,0.007136230642974306,-0.02676442513966294,-0.01869035289644964,-0.014386094859884381\n19991203 00:00,1430300,1454100,1430300,1436900,9860300,0.018139304187628325,-0.026581294266638585,-0.01851781929618331,-0.01421921062651252\n19991206 00:00,1435300,1437200,1422500,1427500,2950200,-0.006541860950657674,-0.0265234977728967,-0.018511684833439245,-0.01424061700132965\n19991207 00:00,1432800,1433100,1413800,1419400,10334900,-0.005674255691768826,-0.02656567480681601,-0.01856071570963515,-0.014293301635482104\n19991208 00:00,1413400,1420600,1406300,1406300,4357000,-0.009229251796533777,-0.026594663987607306,-0.018584337815276995,-0.01431406257322143\n19991209 00:00,1418100,1422200,1393800,1410000,6029100,0.002631017563820004,-0.026595234967512447,-0.018585019254851214,-0.014314802898436502\n19991210 00:00,1422800,1428100,1408800,1420000,4698200,0.007092198581560183,-0.026393174084434822,-0.01841433793567303,-0.014160849908660084\n19991213 00:00,1414400,1427200,1412800,1421300,3919800,0.0009154929577463999,-0.02639736813883666,-0.018418727093318838,-0.014165343075123316\n19991214 00:00,1416300,1424800,1406300,1408100,5625700,-0.009287272215577236,-0.02617748957306385,-0.018248336943237065,-0.014021335016325659\n19991215 00:00,1403800,1422000,1400000,1418000,6539200,0.007030750656913609,-0.026110265428271426,-0.018214568282795635,-0.014005401350797236\n19991216 00:00,1421900,1426600,1411600,1423800,5503200,0.004090267983074769,-0.02608773284744271,-0.018191688857722512,-0.013982337024340836\n19991217 00:00,1430000,1433100,1420600,1423800,4355000,0.0,-0.02604172696401561,-0.018180031199902753,-0.013988990278494451\n19991220 00:00,1425600,1431900,1410900,1416900,4888100,-0.004846186262115415,-0.026085831149159338,-0.01822195005138401,-0.014029744136686586\n19991221 00:00,1415900,1440600,1413400,1433400,7829500,0.011645140800338849,-0.026089420483675775,-0.018223550214648776,-0.01403028388011757\n19991222 00:00,1436300,1441900,1429700,1437500,5250700,0.002860332077577743,-0.026086636066370728,-0.018220382120081473,-0.014026911248621468\n19991223 00:00,1450200,1464400,1449700,1460900,5566200,0.016278260869565297,-0.026061414407991472,-0.018205615900463046,-0.014017718784718433\n19991227 00:00,1465000,1467800,1450600,1458100,2602500,-0.001916626736942928,-0.02606680453065838,-0.018210519170979666,-0.014022362516155221\n19991228 00:00,1458800,1465000,1454800,1461400,3867500,0.002263219257938376,-0.026056171041865733,-0.018199801265510508,-0.014011599608468185\n19991229 00:00,1463100,1468100,1452500,1463400,2773900,0.0013685507048035728,-0.026037641444555535,-0.018201034658155188,-0.014023368577929301\n19991230 00:00,1471300,1478800,1461900,1466300,8143700,0.001981686483531586,-0.025973519166644806,-0.01814469617660344,-0.01397117960941433\n19991231 00:00,1468400,1475000,1462500,1468800,3374600,0.0017049716974697482,-0.025941676799483938,-0.018115488909825707,-0.013943377104900252\n20000103 00:00,1482500,1482500,1438800,1455600,8369900,-0.008986928104575131,-0.026015386734207117,-0.01817805297621921,-0.01399999935012999\n20000104 00:00,1435300,1440600,1396400,1400600,7719000,-0.03778510579829619,-0.026746759466854293,-0.018753855690385537,-0.014492868263096103\n20000105 00:00,1399400,1415300,1372500,1402800,12274000,0.0015707553905468519,-0.026608145028959536,-0.018682607489002936,-0.014457532753124497\n20000106 00:00,1396300,1415000,1392500,1403400,5504600,0.00042771599657820403,-0.026579651081508816,-0.018656857703558665,-0.014433245870291711\n20000107 00:00,1403100,1444400,1400600,1444400,7274800,0.029214764144221084,-0.026801610358974978,-0.018784961543914385,-0.014511315724414829\n20000110 00:00,1462500,1469100,1450300,1458100,5418700,0.009484907227914618,-0.026716336356791645,-0.018702518787709777,-0.014430382294965087\n20000111 00:00,1458100,1460900,1435000,1440900,7312200,-0.011796173101982,-0.026614543933992204,-0.01862327012478257,-0.01436315162700765\n20000112 00:00,1445900,1446300,1428800,1433400,6673300,-0.005205080158234399,-0.026611398760561157,-0.018620628478674458,-0.014360778409452202\n20000113 00:00,1444700,1457500,1432800,1451300,4894900,0.012487791265522574,-0.026416877903036536,-0.018448306106659346,-0.014200289967921699\n20000114 00:00,1465300,1474700,1459700,1465000,6884500,0.009439812581823137,-0.026258963254121564,-0.018355901336859458,-0.014142808272273457\n20000118 00:00,1453400,1466300,1451900,1456300,6286200,-0.005938566552901037,-0.026310851022519517,-0.018408563228806994,-0.014195882846620808\n20000119 00:00,1453100,1464700,1450000,1456900,5864600,0.00041200302135546707,-0.026318506694712227,-0.01841674493618745,-0.014204344981413375\n20000120 00:00,1469700,1469700,1438100,1445000,5355400,-0.008168028004667427,-0.02620330504674265,-0.01832590974816841,-0.014126499463031352\n20000121 00:00,1455000,1455000,1440900,1441300,6032100,-0.0025605536332179435,-0.026151929115614796,-0.018282872641259603,-0.014087907752457772\n20000124 00:00,1456600,1458400,1394100,1400600,7533500,-0.028238395892596913,-0.026605209158429316,-0.01864634177525072,-0.014403499023280239\n20000125 00:00,1405200,1420000,1390000,1410000,9404300,0.006711409395973256,-0.02656924805856128,-0.018630696904598894,-0.014398684659247925\n20000126 00:00,1410000,1415500,1400900,1406700,4763400,-0.002340425531914936,-0.026518809002932762,-0.018588213769042947,-0.014360442795243573\n20000127 00:00,1418400,1422200,1381300,1400000,10971900,-0.0047629203099452955,-0.02650213810230446,-0.01860241680324576,-0.014391104609862792\n20000128 00:00,1394400,1400600,1355300,1364700,11564300,-0.025214285714285745,-0.026867545785033305,-0.01890128812642016,-0.014654505645961578\n20000131 00:00,1358100,1394400,1350000,1394400,10425300,0.021763024840624423,-0.026920362287711913,-0.018906151639678313,-0.014633805597998959\n20000201 00:00,1397500,1416900,1385300,1401900,8251400,0.005378657487091321,-0.026864855598693914,-0.018853243790654006,-0.01458228318095886\n20000202 00:00,1412800,1422500,1403800,1413000,5839200,0.00791782580783229,-0.026866001893709232,-0.018853227039316228,-0.01458164641391384\n20000203 00:00,1408800,1429700,1400000,1428400,7523800,0.010898796886058104,-0.026648905397646225,-0.01866558001251403,-0.01440969879020343\n20000204 00:00,1431900,1440000,1421300,1427800,4647000,-0.0004200504060487553,-0.02660295097254743,-0.01862575414847302,-0.01437314003938496\n20000207 00:00,1425600,1427800,1414400,1427200,5642200,-0.0004202269225381805,-0.02661484487980513,-0.018638214741611692,-0.014385902730669888\n20000208 00:00,1439700,1445600,1436300,1442800,4592600,0.010930493273542563,-0.026358833293635545,-0.018420941696978995,-0.01418928105918723\n20000209 00:00,1444700,1444700,1413800,1414100,7938600,-0.019891876906016126,-0.02661788910394388,-0.01863514992828017,-0.014379581212068086\n20000210 00:00,1416300,1425600,1408800,1418800,6527200,0.0033236687645852303,-0.026478511187784604,-0.018561163408886017,-0.014340454604323238\n20000211 00:00,1418400,1419400,1380300,1391300,8090000,-0.019382576825486275,-0.026515876204344747,-0.01858985951715727,-0.014364529349663023\n20000214 00:00,1397800,1397800,1383100,1392500,8924900,0.0008625026953208437,-0.026523424589834414,-0.0186024772748993,-0.014379849570994719\n20000215 00:00,1392500,1412200,1378000,1407500,10099600,0.010771992818671361,-0.026395727057344626,-0.018484431596865435,-0.014266949260856789\n20000216 00:00,1403800,1409400,1388000,1390900,8551800,-0.011793960923623392,-0.026508732140760095,-0.01858931228971764,-0.014367498871162197\n20000217 00:00,1404400,1404400,1382200,1390600,7025200,-0.00021568768423319007,-0.026509696834414124,-0.018590245113736477,-0.014368414705596442\n20000218 00:00,1388800,1388800,1346300,1351900,8648300,-0.027829713792607458,-0.02670289930161134,-0.018794374079663907,-0.014578368547565891\n20000222 00:00,1351900,1441900,1333400,1354200,15990100,0.0017013092684370346,-0.026689751033987765,-0.018781370047797636,-0.014565441407248128\n20000223 00:00,1356300,1374700,1345000,1365200,11623500,0.00812287697533609,-0.02650442074848248,-0.018621833188235074,-0.014419654927612852\n20000224 00:00,1366900,1370300,1330900,1356900,17172800,-0.006079695282742437,-0.02651163800292392,-0.018627885876574133,-0.014425086790071946\n20000225 00:00,1351900,1375300,1331300,1337500,10057600,-0.014297295305475743,-0.026607630451270646,-0.0187045505531915,-0.014491447903098469\n20000228 00:00,1333800,1366900,1327200,1350600,13374200,0.009794392523364559,-0.026599077584033837,-0.01868589777064043,-0.014467410893065835\n20000229 00:00,1360600,1374400,1357500,1369100,7501300,0.013697615874426194,-0.02655612434400087,-0.018630494462116155,-0.014405370499097528\n20000301 00:00,1376300,1390000,1372200,1383100,6431500,0.010225695712511973,-0.026561702389657,-0.018625580261471777,-0.01439486292077455\n20000302 00:00,1386900,1391300,1373400,1387200,7552200,0.0029643554334466415,-0.026526697708712424,-0.01861503892313665,-0.014397362899863415\n20000303 00:00,1404400,1417200,1397200,1413100,19871000,0.018670703575547787,-0.026480609909066463,-0.01858688060516879,-0.014378762722234128\n20000306 00:00,1408100,1413400,1387500,1393900,12200000,-0.013587148821739392,-0.02662454594112537,-0.018710903738737784,-0.014492170363301362\n20000307 00:00,1400000,1401600,1352200,1359400,17667900,-0.024750699476289495,-0.026962229986965524,-0.01897599470190914,-0.014718562222716391\n20000308 00:00,1364700,1378400,1350300,1370500,11415800,0.008165367073708962,-0.026965197920550067,-0.018975671160784958,-0.014716484008604343\n20000309 00:00,1372500,1405900,1361300,1405900,5019700,0.025829989055089486,-0.027124004280657556,-0.01906865008365673,-0.014774370568265414\n20000310 00:00,1401900,1420000,1395300,1400000,7541900,-0.004196600042677301,-0.027115202652876393,-0.01906114565437752,-0.014767557670707596\n20000313 00:00,1366900,1404700,1356900,1388800,10611500,-0.008000000000000007,-0.02716531261186765,-0.01912050462427543,-0.014831847254095958\n20000314 00:00,1392800,1400900,1361600,1365000,7658200,-0.017137096774193505,-0.02734545200430282,-0.019266199150223644,-0.01495917934917547\n20000315 00:00,1368800,1404400,1325000,1395000,9382100,0.0219780219780219,-0.02740605646645601,-0.01927702172595898,-0.014943463385468146\n20000316 00:00,1416300,1466900,1408800,1463100,22099800,0.04881720430107528,-0.02808983368387348,-0.019720786729859364,-0.015259278766453886\n20000317 00:00,1458100,1480000,1454400,1466900,9838300,0.0025972250700567745,-0.02791637246785295,-0.019576649372100387,-0.015130773849027791\n20000320 00:00,1468800,1473400,1447800,1459800,12307100,-0.004840139068784555,-0.027940890003915635,-0.019598270470076666,-0.015150850866577824\n20000321 00:00,1455300,1497200,1445000,1497200,12668600,0.02561994793807365,-0.027680425742414663,-0.01935300605584974,-0.01491368943468907\n20000322 00:00,1495600,1508400,1486900,1500000,8026500,0.0018701576275714782,-0.027685607765703564,-0.019359369951979757,-0.014920683382857425\n20000323 00:00,1491600,1534700,1491600,1526300,10541800,0.0175333333333334,-0.027688043616791662,-0.019360765469776973,-0.014921524302826797\n20000324 00:00,1528800,1557500,1517200,1532800,11529700,0.004258664744807739,-0.027642454672675832,-0.019317639388566003,-0.014879711164717138\n20000327 00:00,1533800,1537800,1520000,1525000,8327400,-0.005088726513569952,-0.027597716786366206,-0.019316806721650686,-0.014902284207799519\n20000328 00:00,1512500,1529800,1507500,1510000,5989100,-0.00983606557377048,-0.027631458432288983,-0.019344302196769407,-0.014926449872375146\n20000329 00:00,1515600,1524800,1496600,1510300,6497400,0.0001986754966887272,-0.027505993078371056,-0.01924010920804355,-0.014833597102819576\n20000330 00:00,1501600,1519400,1471300,1488800,9297700,-0.01423558233463551,-0.02766024324156128,-0.0193724991128858,-0.014954333384825498\n20000331 00:00,1496300,1523100,1484400,1505600,8466800,0.011284255776464303,-0.027556222032615554,-0.019312787840996326,-0.014918243576421736\n20000403 00:00,1501300,1510300,1486900,1507700,7490200,0.0013947927736450705,-0.027531866298902613,-0.01929008177349299,-0.014896416939870517\n20000404 00:00,1517500,1530000,1413900,1500000,19282600,-0.005107116800424527,-0.02757636700296038,-0.019335765177044502,-0.014942730836145836\n20000405 00:00,1478800,1508100,1476300,1488800,8021800,-0.0074666666666666215,-0.02762536855786314,-0.01939352662264829,-0.015005162147068332\n20000406 00:00,1502500,1516900,1490000,1503100,5914800,0.009605051047823832,-0.02762773249694342,-0.01938705671363981,-0.014993982946331407\n20000407 00:00,1515600,1521300,1505000,1517800,5785800,0.009779788437229708,-0.027630563209989824,-0.019387859344349063,-0.014993704413851184\n20000410 00:00,1517500,1531100,1503100,1507800,9456200,-0.0065884833311371516,-0.02763237560241544,-0.01938936661099333,-0.014995049019070462\n20000411 00:00,1500000,1516300,1483800,1500600,13823200,-0.004775169120573075,-0.02749416201519788,-0.019278619591895075,-0.014898944325802741\n20000412 00:00,1503800,1511600,1465600,1466300,9981900,-0.022857523657203838,-0.0277773553390189,-0.019501928673311644,-0.015090329339181696\n20000413 00:00,1474700,1481600,1437800,1440000,11909800,-0.01793630225738252,-0.02795545486121528,-0.0196443228897383,-0.015213689189221977\n20000414 00:00,1426300,1428100,1335000,1358100,27304000,-0.05687500000000001,-0.029079180045635946,-0.02047664391856214,-0.015890663740972807\n20000417 00:00,1351900,1401300,1266900,1400600,23564600,0.0312937191664826,-0.02929644536103923,-0.02060939439388537,-0.015978359667777553\n20000418 00:00,1405600,1442200,1397800,1442200,10593700,0.029701556475796087,-0.02939083558367112,-0.020668836915049463,-0.016019171698605287\n20000419 00:00,1445000,1451300,1425300,1430000,6276600,-0.00845929829427261,-0.029418719556001626,-0.020718211632914457,-0.01608000305339304\n20000420 00:00,1435600,1439400,1423800,1433800,8187000,0.0026573426573426318,-0.029402467330351522,-0.020701750409183855,-0.01606343041355907\n20000424 00:00,1415000,1432800,1405000,1430000,12621000,-0.0026502999023573226,-0.029424935200931385,-0.020723971437751447,-0.01608551985156331\n20000425 00:00,1446300,1479700,1444400,1478800,13812600,0.03412587412587409,-0.029710717200974127,-0.02089003595836273,-0.01618776342687734\n20000426 00:00,1479700,1487500,1460000,1463800,7411100,-0.01014335948066003,-0.029724121524236504,-0.020900919630335805,-0.01619730334897519\n20000427 00:00,1430000,1473400,1430000,1465000,15325600,0.0008197841235142445,-0.029684424993357675,-0.020865199351393537,-0.016163702795227074\n20000428 00:00,1470000,1478600,1450600,1452200,8173500,-0.008737201365187741,-0.029690981932861397,-0.020870575645363605,-0.016168449691431865\n20000501 00:00,1465600,1484800,1436300,1471900,6737100,0.013565624569618517,-0.029674248465755934,-0.020861787316184502,-0.016163896885882108\n20000502 00:00,1455000,1471300,1445000,1446300,8785100,-0.017392485902574917,-0.029679021241497835,-0.020865495705558627,-0.01616703785482209\n20000503 00:00,1440000,1440000,1397800,1416300,11442100,-0.02074258452603195,-0.029917280775323442,-0.021072546450459195,-0.016357451309827836\n20000504 00:00,1420000,1423600,1407500,1413100,5713300,-0.002259408317446865,-0.029840663567655055,-0.02100833949852824,-0.01629986021930914\n20000505 00:00,1410600,1440000,1409400,1433400,7416300,0.01436557922298487,-0.029864027825791593,-0.021017999287314293,-0.01630221420619476\n20000508 00:00,1427500,1433800,1418400,1425300,4530300,-0.005650899958141498,-0.029883064707826635,-0.021034488262476336,-0.01631734490163077\n20000509 00:00,1430600,1434100,1402700,1416300,5299000,-0.006314460113660325,-0.02992570454125909,-0.02108496893886212,-0.016372005502381694\n20000510 00:00,1405000,1409700,1377500,1385900,9882100,-0.021464379015745272,-0.030189593582427156,-0.021304299178420392,-0.016567581609681626\n20000511 00:00,1401300,1415000,1391300,1411100,6838500,0.018183130095966504,-0.0302413066052069,-0.02132304370368911,-0.01656875075091974\n20000512 00:00,1418100,1434700,1415600,1424100,5805300,0.00921267096591305,-0.030010918125385342,-0.021126360412902577,-0.016390035571689294\n20000515 00:00,1427500,1455900,1420000,1453800,4193500,0.020855277017063356,-0.03007739563301836,-0.021149206234510255,-0.01638962150292612\n20000516 00:00,1465600,1477200,1453100,1470000,7907600,0.01114321089558401,-0.030042973541014754,-0.021106028594276013,-0.016341776312328065\n20000517 00:00,1456900,1461900,1444700,1452500,5507300,-0.011904761904761862,-0.03015396910014761,-0.021208612690376313,-0.01643987628861044\n20000518 00:00,1456300,1463100,1439400,1440600,4718200,-0.008192771084337358,-0.030191777108195005,-0.021240557395637124,-0.016468695288851563\n20000519 00:00,1425600,1432300,1404100,1408800,5731800,-0.02207413577675965,-0.030412719631243323,-0.021414733370782073,-0.016617940190358338\n20000522 00:00,1412500,1414700,1370000,1404100,10008900,-0.00333617262918795,-0.030250056015178925,-0.02128329844116384,-0.016503153157929815\n20000523 00:00,1404400,1408100,1375600,1375600,7422700,-0.020297699594046037,-0.03030459123860777,-0.021325500921141247,-0.016538781098007806\n20000524 00:00,1380000,1406900,1276300,1404100,10710100,0.02071823204419898,-0.03035745357330542,-0.021355214138749228,-0.016556153606953394\n20000525 00:00,1406900,1418100,1377200,1388800,7101900,-0.010896659782066775,-0.030271945051430146,-0.02128767081304958,-0.0164981874608588\n20000526 00:00,1388100,1396900,1373300,1383100,4605900,-0.004104262672811054,-0.03026716456457394,-0.021308521098291715,-0.016532701415865644\n20000530 00:00,1400000,1426900,1394700,1426300,5037500,0.031234184079242278,-0.030443445063689453,-0.021390531427537416,-0.016564456666379346\n20000531 00:00,1425600,1440000,1420900,1424100,5541700,-0.0015424524994741562,-0.030447380624431544,-0.021394212113316644,-0.01656800147925898\n20000601 00:00,1436900,1453800,1430000,1451700,8473400,0.019380661470402405,-0.03050609966843552,-0.021417678611973214,-0.016572674976434977\n20000602 00:00,1489400,1490900,1474800,1480900,8538300,0.0201143486946338,-0.030558181449166964,-0.02144593275932945,-0.016588226700607694\n20000605 00:00,1474700,1482200,1468800,1472500,6629400,-0.005672226348841902,-0.030587858811319407,-0.02148945750094318,-0.016639133428973118\n20000606 00:00,1466300,1477800,1459100,1463400,4847700,-0.006179966044142615,-0.0305274793936958,-0.021440130666226177,-0.016595698685306026\n20000607 00:00,1466300,1480000,1460000,1475600,4402800,0.008336750034167117,-0.0305155907771666,-0.02142203343329067,-0.01657429166193791\n20000608 00:00,1475000,1477500,1460600,1465600,5458000,-0.0067769043101111315,-0.03048883817332229,-0.021400000895939183,-0.016554775374568197\n20000609 00:00,1475000,1479700,1455300,1463400,2865600,-0.0015010917030567894,-0.03043504834692649,-0.02135394555069956,-0.016512843252613228\n20000612 00:00,1469700,1469700,1451300,1452800,3294200,-0.00724340576739102,-0.030483779740992704,-0.021396552964321643,-0.016552185994920955\n20000613 00:00,1448100,1477500,1446300,1474700,6277200,0.015074339207048482,-0.03051070043439049,-0.021405319118524092,-0.016551274031455166\n20000614 00:00,1482500,1488800,1471900,1475000,6227300,0.00020343120634702672,-0.03043546490077839,-0.021377613203180004,-0.01654890597973707\n20000615 00:00,1481300,1487500,1468400,1482500,5566200,0.005084745762711895,-0.03043337848820419,-0.021380503740342605,-0.016554449710388275\n20000616 00:00,1483100,1483100,1458800,1468800,5010200,-0.009241146711635784,-0.030489271457225967,-0.021427744317422334,-0.016597077729339934\n20000619 00:00,1464700,1491600,1462500,1486600,4748700,0.012118736383442297,-0.030500913948566195,-0.021427341145591902,-0.016590253059045497\n20000620 00:00,1481900,1488800,1470000,1478100,8314200,-0.005717745190367274,-0.03046796118285502,-0.021400006168633516,-0.016565912904483854\n20000621 00:00,1469400,1484400,1468900,1479500,2953900,0.0009471618970300355,-0.030447203853365936,-0.021380576772408608,-0.01654719142456836\n20000622 00:00,1475600,1476900,1450000,1455300,7127200,-0.01635687732342006,-0.03050988224556689,-0.021430040221210433,-0.01658961003594304\n20000623 00:00,1458100,1461300,1438800,1443800,4198700,-0.00790215075929357,-0.030564535986725854,-0.02147760467006334,-0.01663339520929992\n20000626 00:00,1453800,1462500,1448800,1457500,4770700,0.009488848871034739,-0.030551800919133332,-0.02147275629026288,-0.01663275119357849\n20000627 00:00,1459800,1467200,1453100,1455600,3585500,-0.001303602058319031,-0.030553832487821918,-0.021490960400246853,-0.01665957682548418\n20000628 00:00,1456300,1469800,1452200,1456300,5585500,0.00048090134652367666,-0.03055234864603436,-0.021503288591931013,-0.01667926816110378\n20000629 00:00,1447500,1457500,1435200,1444400,6081000,-0.008171393256883874,-0.030617810300244033,-0.021570208676605238,-0.016746965729662066\n20000630 00:00,1439400,1455300,1438900,1453800,6673700,0.006507892550539962,-0.03061617203587488,-0.02157099976815035,-0.016749051901855785\n20000703 00:00,1454400,1474400,1451600,1472800,1436600,0.013069197963956558,-0.03060315672814415,-0.02154267917270072,-0.016712572114156995\n20000705 00:00,1463800,1466600,1443800,1450900,2447900,-0.014869636067354697,-0.03075455064944082,-0.02167404783165762,-0.016833265379859547\n20000706 00:00,1449400,1464700,1442200,1458800,5394400,0.005444896271279864,-0.030742293645374695,-0.02165905186264618,-0.016816809278770682\n20000707 00:00,1466900,1487800,1462200,1480900,2796000,0.015149437894159679,-0.030770820709170525,-0.021667108618205075,-0.01681395338875425\n20000710 00:00,1478800,1489100,1476300,1479700,2468600,-0.0008103180498345575,-0.030769214046458142,-0.021665588133934186,-0.01681247884589164\n20000711 00:00,1474700,1491300,1471600,1483800,5233700,0.0027708319253902935,-0.030737965232474417,-0.02163562454224031,-0.01678320040144481\n20000712 00:00,1492800,1501300,1486900,1495900,5507100,0.008154737835287751,-0.030734913178212253,-0.021626820116902184,-0.016771329408371442\n20000713 00:00,1499800,1503800,1491900,1498800,5108200,0.0019386322615149165,-0.030737339817679555,-0.021637005968720972,-0.016785651667583584\n20000714 00:00,1504400,1512500,1496700,1508800,5512500,0.006672004270082743,-0.030737470904125593,-0.021636508722206547,-0.01678481945909294\n20000717 00:00,1509800,1519800,1506900,1510600,3566600,0.0011930010604452868,-0.030686093053406412,-0.02159060845415149,-0.01674183927008756\n20000718 00:00,1506300,1506300,1493400,1496900,3678300,-0.009069244009002997,-0.03047767295347261,-0.021427404418735942,-0.016602739751354803\n20000719 00:00,1494700,1499100,1482500,1484400,8163200,-0.00835059122185855,-0.030539802928194117,-0.02148171597821696,-0.016652883342601402\n20000720 00:00,1490000,1505000,1488100,1498100,4139400,0.009229318243061169,-0.030420793544356357,-0.021372170815358825,-0.01654838352092728\n20000721 00:00,1497500,1497500,1478800,1482500,5062300,-0.010413190040718279,-0.030488091716169383,-0.021428529259908496,-0.016598910037352862\n20000724 00:00,1481300,1488600,1465600,1466600,5520000,-0.010725126475548019,-0.030539719463125288,-0.021471078090717178,-0.01663661893155795\n20000725 00:00,1477500,1478400,1467800,1474400,4247400,0.005318423564707464,-0.030531182917899847,-0.021471776198819265,-0.01664223999917818\n20000726 00:00,1469700,1471600,1456400,1461600,11008600,-0.00868149755832881,-0.030600290121253173,-0.02153268959164007,-0.01669878530192346\n20000727 00:00,1459400,1466300,1446900,1455000,7169400,-0.004515599343185572,-0.030450728040468923,-0.021412210636892304,-0.01659381045405016\n20000728 00:00,1457200,1459100,1415200,1422500,5674800,-0.022336769759450203,-0.030646426718280512,-0.02156538688131306,-0.01672431814657498\n20000731 00:00,1429400,1441300,1420600,1434400,4837700,0.008365553602811993,-0.03063019415125276,-0.021542874571384554,-0.016698458128942866\n20000801 00:00,1436300,1447200,1431300,1440000,3742800,0.003904071388733943,-0.030593733695501762,-0.021507484871527073,-0.016663639245090123\n20000802 00:00,1438800,1454100,1436300,1442700,7275200,0.001875000000000071,-0.0304775089884937,-0.02140846088422124,-0.016573784897810143\n20000803 00:00,1428800,1458100,1426300,1455000,4363300,0.00852568101476403,-0.03047934188014336,-0.02140758449618285,-0.01657146420279514\n20000804 00:00,1463100,1467200,1454100,1465300,3492400,0.0070790378006873045,-0.030371425218180956,-0.02130979809109111,-0.01647907820015641\n20000807 00:00,1467200,1484400,1463800,1481300,4067300,0.010919265679383061,-0.030364849817281565,-0.02129236607486119,-0.01645585856246625\n20000808 00:00,1475000,1488100,1475000,1485600,3161200,0.0029028555998109606,-0.030223862850581925,-0.021172948242609083,-0.016347939155976383\n20000809 00:00,1491400,1492200,1473800,1476900,5205000,-0.0058562197092083546,-0.030227583885504065,-0.021203330185040198,-0.016392533929547835\n20000810 00:00,1475300,1478600,1462800,1465600,3987200,-0.007651161216060687,-0.030259075184956335,-0.021229948590880433,-0.016416554613834542\n20000811 00:00,1466300,1480000,1455600,1474400,4739000,0.006004366812227158,-0.030142878323930505,-0.02116915351770417,-0.016385294028759007\n20000814 00:00,1477800,1495000,1470600,1493800,2682600,0.013157894736842035,-0.030152251577364862,-0.02116214339421514,-0.016369549987655125\n20000815 00:00,1493400,1498100,1473400,1490200,4731200,-0.002409961172847752,-0.030173134908613886,-0.021191215144289607,-0.016402986953506032\n20000816 00:00,1493100,1499400,1478400,1483800,4843200,-0.004294725540195943,-0.03013643367396491,-0.021160419543571007,-0.016375339624383242\n20000817 00:00,1486900,1504400,1483400,1499400,5401400,0.010513546300040533,-0.03009839544732855,-0.021115384025755246,-0.016326573876531646\n20000818 00:00,1503800,1503800,1491600,1496700,4350300,-0.0018007202881152873,-0.030120220201983593,-0.021141656989640545,-0.016355218164297997\n20000821 00:00,1500300,1507200,1494100,1503600,2058200,0.004610142313088872,-0.030064943756842093,-0.021119008744619163,-0.01634996389202732\n20000822 00:00,1505600,1513100,1500900,1502300,2831300,-0.0008645916467145964,-0.03007216341704405,-0.02112605606425865,-0.016356919337550662\n20000823 00:00,1498100,1512800,1491900,1509100,5518000,0.0045263928642746976,-0.03004952119583885,-0.02112130668225457,-0.016361708561916263\n20000824 00:00,1511600,1515500,1500900,1514400,4636200,0.0035120270359816352,-0.029909059130092282,-0.021001619511089444,-0.016253096410179666\n20000825 00:00,1511600,1516300,1509400,1510900,2700900,-0.0023111463285789835,-0.029844253434615126,-0.020947073122851184,-0.016204019220668203\n20000828 00:00,1512500,1529100,1512500,1517800,5721600,0.004566814481434811,-0.029629062041127474,-0.020768110334951594,-0.016044369768351784\n20000829 00:00,1514400,1518800,1509100,1515000,3375600,-0.001844775332718429,-0.02963257205772918,-0.020771334566933766,-0.016047441649610767\n20000830 00:00,1513100,1517800,1504500,1506300,3854400,-0.005742574257425748,-0.029681817461638525,-0.020822129251057565,-0.016099062249284122\n20000831 00:00,1510600,1530900,1508400,1522500,5246300,0.010754829715196257,-0.02959832422809094,-0.020739190684317572,-0.01601641937336684\n20000901 00:00,1532500,1535900,1520000,1525600,2983800,0.002036124794745575,-0.02940364238679898,-0.020633805936884252,-0.01595863857624571\n20000905 00:00,1518800,1522000,1508100,1512500,3202700,-0.008586785527005758,-0.029437413935454668,-0.020661947293651603,-0.015983778498550653\n20000906 00:00,1511900,1519500,1496900,1496900,3930600,-0.010314049586776841,-0.02949357660688761,-0.020708414703838704,-0.016025077400842736\n20000907 00:00,1502500,1510800,1498300,1507500,4187500,0.007081301356135938,-0.029487030041485476,-0.020697449710896494,-0.016011756960528308\n20000908 00:00,1502800,1505000,1493300,1497500,3067500,-0.0066334991708125735,-0.029539770758470345,-0.020745204450736222,-0.016056853694401452\n20000911 00:00,1497500,1511900,1486900,1494700,3726500,-0.001869782971619327,-0.02952067917443702,-0.02072838653594162,-0.016041247864264807\n20000912 00:00,1497500,1502500,1484400,1487500,4628300,-0.00481702013782026,-0.029514669397369093,-0.020723269661058773,-0.016036606992232846\n20000913 00:00,1480000,1498400,1476600,1488800,4335400,0.0008739495798320007,-0.02936846688605315,-0.020601711319528555,-0.01592818636642518\n20000914 00:00,1498800,1499400,1481600,1485300,3442900,-0.002350886620096748,-0.02938876826904901,-0.020621438771141254,-0.015947607857341214\n20000915 00:00,1481900,1482500,1460300,1467500,3880800,-0.01198411095401597,-0.02949920082770368,-0.020725218993029797,-0.01604784174311522\n20000918 00:00,1463800,1469700,1442000,1446900,4960300,-0.014037478705281048,-0.029626995613797502,-0.02083111274793011,-0.016142060139326116\n20000919 00:00,1451300,1463100,1447000,1460800,6372400,0.00960674545580198,-0.029382359609278656,-0.020623312162016152,-0.015953896378769226\n20000920 00:00,1456900,1460300,1431600,1452200,6594700,-0.005887185104052617,-0.029427300754428537,-0.020664151744392976,-0.01599254943320865\n20000921 00:00,1444700,1455600,1437500,1450300,4911900,-0.001308359730064712,-0.029118783689860813,-0.020419527067538964,-0.01578198555182538\n20000922 00:00,1426300,1451600,1421300,1451600,7241600,0.0008963662690477658,-0.029117119314186375,-0.02041785316693644,-0.015780306573518938\n20000925 00:00,1459400,1460600,1437200,1441300,9551700,-0.007095618627721123,-0.02917288441601589,-0.02046752773324302,-0.0158267342978749\n20000926 00:00,1443800,1450000,1426300,1428900,4889400,-0.008603344203149899,-0.029233926794263787,-0.02051987365520401,-0.015874444171168622\n20000927 00:00,1435600,1439700,1421300,1428100,5471600,-0.0005598712296172037,-0.029144694707574005,-0.02044464608238673,-0.01580668235287622\n20000928 00:00,1431900,1463300,1428900,1461900,6598400,0.023667810377424603,-0.029241431170523243,-0.02050020141847939,-0.01584028418262315\n20000929 00:00,1454700,1459700,1437500,1437800,7669100,-0.016485395717901308,-0.029410192206738447,-0.020638326396595415,-0.015962077191528354\n20001002 00:00,1442800,1449100,1431400,1438100,5182100,0.00020865210738629791,-0.0293716918755692,-0.02063160449640714,-0.015972296255307085\n20001003 00:00,1445300,1457500,1425300,1426300,8184100,-0.008205270843474,-0.029412693049017034,-0.020666217451619846,-0.016003503675016816\n20001004 00:00,1428800,1442500,1417500,1435800,5717600,0.006660590338638528,-0.02935329635043904,-0.020638265035293032,-0.0159923140892056\n20001005 00:00,1434100,1448400,1433100,1438800,4038600,0.0020894274968659143,-0.029317528105876497,-0.02060502416305065,-0.01596042054979512\n20001006 00:00,1438800,1446400,1397500,1410000,9717900,-0.020016680567139233,-0.029540788811334772,-0.020801298134030324,-0.016142307992482608\n20001009 00:00,1413100,1413100,1393800,1404400,4323000,-0.003971631205673787,-0.029565706166219646,-0.020824315415668544,-0.01616431235210383\n20001010 00:00,1400900,1412500,1385600,1388800,5724500,-0.011107946454001705,-0.029465456763792,-0.0207454963094109,-0.016096917657436413\n20001011 00:00,1376300,1386300,1351300,1365600,10570900,-0.016705069124423932,-0.029390159541757492,-0.02068734932931975,-0.01604791340786465\n20001012 00:00,1372800,1433800,1327800,1331600,11288200,-0.02489748096074984,-0.02970849300025583,-0.020939112376773185,-0.016264188015518904\n20001013 00:00,1329400,1376600,1328800,1375600,10629900,0.03304295584259531,-0.02956081939827411,-0.02076369678174408,-0.016073983266649255\n20001016 00:00,1374100,1390000,1366900,1374700,5407400,-0.0006542599592904708,-0.029576630616736516,-0.02078262225631541,-0.01609456893962865\n20001017 00:00,1384400,1385600,1344100,1354800,7302200,-0.014475885647777686,-0.029724936550698577,-0.02090912491487756,-0.01620944835275323\n20001018 00:00,1326300,1361300,1301600,1344100,9962600,-0.00789784470032473,-0.02966176925600974,-0.020902594801494624,-0.0162331113111513\n20001019 00:00,1368400,1394500,1364400,1390500,8309100,0.034521240979093815,-0.029917096575458314,-0.0210376868835183,-0.016304106433007264\n20001020 00:00,1383800,1411900,1383800,1398800,6603800,0.005969075871988583,-0.02989791555158773,-0.02103263990545975,-0.016306594262471247\n20001023 00:00,1399400,1410300,1389400,1400000,5066000,0.0008578781812982328,-0.029852426564441162,-0.020991987623117558,-0.016268520409563125\n20001024 00:00,1409700,1419400,1390000,1401300,5115800,0.0009285714285713897,-0.029774387888055278,-0.020924509725134422,-0.016206672423468706\n20001025 00:00,1387500,1395600,1363900,1369200,7817300,-0.022907300363947725,-0.03004347762948611,-0.021158440782181237,-0.016421860515967217\n20001026 00:00,1371300,1376600,1340000,1367500,8644800,-0.0012416009348524826,-0.02978413988810785,-0.02101555663911507,-0.016341057355250835\n20001027 00:00,1378800,1388400,1366300,1383800,9866200,0.011919561243144416,-0.02976462920427921,-0.02100570982011701,-0.01633636230683499\n20001030 00:00,1384400,1410900,1381600,1402500,8510100,0.013513513513513598,-0.029749125890443952,-0.020973761068719364,-0.016295646553525486\n20001031 00:00,1410200,1436900,1400600,1429700,8131100,0.019393939393939297,-0.02974427761571721,-0.020938124793944343,-0.016243597309848812\n20001101 00:00,1422500,1432500,1412200,1424100,6349600,-0.003916905644540836,-0.029778159140087204,-0.020974222555944003,-0.016280876539928154\n20001102 00:00,1431600,1439100,1425200,1430300,4360600,0.004353626852046988,-0.02977891155006422,-0.02097637594856289,-0.0162837767912094\n20001103 00:00,1434700,1437500,1423800,1431100,4853300,0.0005593232189051722,-0.029788694530238875,-0.020989031518750662,-0.01629796372850379\n20001106 00:00,1431600,1443000,1430300,1437000,3814400,0.0041227028160155665,-0.029789574925689132,-0.020990961039839055,-0.01630045253458782\n20001107 00:00,1431400,1440000,1425600,1436600,5032700,-0.00027835768963113683,-0.029725904929753858,-0.02093598499639347,-0.01625011120504447\n20001108 00:00,1440600,1440600,1410300,1412500,5889100,-0.016775720451065013,-0.029907010492295886,-0.021092295662839548,-0.016393203804129744\n20001109 00:00,1400000,1412200,1372500,1404100,9700200,-0.005946902654867303,-0.029955155523814943,-0.021138566604372997,-0.016438475675226515\n20001110 00:00,1390000,1394700,1368800,1369700,8316000,-0.024499679510006422,-0.03027281205886651,-0.021403156333191946,-0.01667477568600466\n20001113 00:00,1356300,1369800,1330200,1353800,16883900,-0.011608381397386291,-0.030368293576942644,-0.02148466058149247,-0.016748828703507558\n20001114 00:00,1374700,1396300,1370000,1387500,7432300,0.024892894075934313,-0.03043863736432641,-0.021527327618185394,-0.016776741366818792\n20001115 00:00,1390600,1401100,1377500,1391300,7877100,0.002738738738738755,-0.03039239115800501,-0.021484263439149876,-0.016735373514755004\n20001116 00:00,1385800,1398800,1373100,1377700,6418000,-0.009775030546970487,-0.030472182149591787,-0.021562308238696024,-0.01681248742578568\n20001117 00:00,1373100,1390000,1357500,1374700,6429800,-0.002177542280612621,-0.030472219479193777,-0.02156234256779249,-0.016812520155323755\n20001120 00:00,1357500,1363800,1343800,1346900,5017900,-0.020222594020513518,-0.030694856471566292,-0.02174302265837509,-0.01697083317681425\n20001121 00:00,1348800,1361900,1335200,1351600,4344600,0.0034894943945356083,-0.03059816774319746,-0.02165762841662606,-0.016891459984089523\n20001122 00:00,1343400,1348800,1324400,1325000,5285300,-0.019680378810298937,-0.030818676520655914,-0.021846155037698763,-0.017062937035935772\n20001124 00:00,1336300,1349700,1335600,1348400,3412100,0.017660377358490464,-0.03083644040327922,-0.021833111665001976,-0.017033470429423173\n20001127 00:00,1364700,1366900,1353100,1355000,5997600,0.004894690002966495,-0.030810168655121442,-0.021805229796024592,-0.017004730210994752\n20001128 00:00,1351300,1365900,1338100,1338100,4190100,-0.012472324723247219,-0.03081093973541651,-0.02180584587647808,-0.017005263661606228\n20001129 00:00,1343800,1359100,1332700,1346400,6534900,0.006202824900978898,-0.030810884450414442,-0.021805942500285332,-0.01700544126743763\n20001130 00:00,1325000,1335000,1297500,1316300,10401100,-0.022355912061794436,-0.03108225860691186,-0.02203210283469473,-0.017207498280595503\n20001201 00:00,1331900,1340600,1310000,1318800,7233600,0.0018992630859226978,-0.031030419404673784,-0.02201432850653765,-0.01720788381076158\n20001204 00:00,1318800,1338800,1315000,1330000,6328000,0.00849256900212314,-0.030983380929875782,-0.021963592478909912,-0.017155176631402275\n20001205 00:00,1348800,1381900,1344100,1381300,8270800,0.03857142857142848,-0.031316517131969146,-0.02214770287001377,-0.01725984191410419\n20001206 00:00,1377800,1383400,1350300,1355300,12544800,-0.01882284804169987,-0.03144690417705876,-0.022251045957418922,-0.017348767967737846\n20001207 00:00,1348800,1358800,1343800,1349800,5966200,-0.0040581421087582115,-0.0314764088420806,-0.02227968339085632,-0.017376943083226577\n20001208 00:00,1370600,1391300,1360900,1376600,8949000,0.01985479330271156,-0.03154414124023075,-0.02231273754302715,-0.017391510390784896\n20001211 00:00,1373800,1488800,1367200,1386300,5943200,0.0070463460700276315,-0.031536589856143625,-0.02230027128768758,-0.01737642403576702\n20001212 00:00,1381900,1392500,1373800,1377500,4619700,-0.006347832359518191,-0.03150921039303303,-0.02227749547621596,-0.017356102413949356\n20001213 00:00,1392500,1394100,1362500,1365300,5580800,-0.008856624319419248,-0.031581880324335884,-0.022347345863289528,-0.017424449712427386\n20001214 00:00,1358800,1365000,1341900,1341900,7348300,-0.01713909030982197,-0.031759257998749006,-0.02249744025182633,-0.017559999482219195\n20001215 00:00,1331300,1332500,1305600,1314500,8490700,-0.020418809151203532,-0.031979587545345606,-0.022676961684022147,-0.01771776625962922\n20001218 00:00,1110000,1334700,1110000,1323800,6906100,0.007074933434766173,-0.031942922623041714,-0.022637179491885723,-0.01767632226247983\n20001219 00:00,1324700,1349700,1305000,1305600,9054500,-0.013748300347484532,-0.03205789540412843,-0.022747990929257448,-0.017784915302915216\n20001220 00:00,1286300,1289400,1239400,1266900,9490400,-0.02964154411764708,-0.03247331143147483,-0.02307949541527634,-0.01807168685674823\n20001221 00:00,1260000,1288600,1255300,1276900,14252300,0.0078932828163234,-0.03243598200963053,-0.023062848900399068,-0.01806606632304263\n20001222 00:00,1290000,1308600,1288400,1308600,8862700,0.024825749862949387,-0.032542547612022674,-0.023107108952748923,-0.018077111517212637\n20001226 00:00,1308400,1319400,1302800,1318900,4395100,0.00787100718324929,-0.03254052111562601,-0.0230991571464125,-0.018066000950072613\n20001227 00:00,1320000,1336600,1312500,1331300,5193500,0.00940177420577748,-0.03253915841750186,-0.023088855151195187,-0.018050933448652797\n20001228 00:00,1328100,1338100,1325900,1336100,7872300,0.003605498385037098,-0.032536046428666233,-0.023084767151562244,-0.018046325141275313\n20001229 00:00,1340600,1342800,1318800,1322500,7564700,-0.0101788788264352,-0.03261448248186194,-0.02315404046508929,-0.018110713832189658\n20010102 00:00,1320000,1321600,1275600,1282500,8348100,-0.03024574669187141,-0.032970976310203216,-0.023430813898252925,-0.01834498861767152\n20010103 00:00,1283100,1360000,1276600,1350000,17057200,0.05263157894736836,-0.03306686699692095,-0.023393505842211674,-0.018236672804737498\n20010104 00:00,1349400,1354700,1330000,1334100,8331000,-0.011777777777777776,-0.033163659842089535,-0.02347746106956407,-0.018313784345534805\n20010105 00:00,1334700,1336300,1292800,1302500,12281600,-0.023686380331309542,-0.033439420491032316,-0.02370047099808844,-0.018508673060196313\n20010108 00:00,1298800,1300600,1276300,1297500,6134300,-0.0038387715930902067,-0.03329184446900412,-0.02363455098518866,-0.01848628356361317\n20010109 00:00,1310500,1315000,1296300,1301300,5161100,0.0029287090558767215,-0.033289781586396734,-0.02364071389140729,-0.018496831607417257\n20010110 00:00,1290000,1318100,1288100,1316600,8509500,0.011757473295934906,-0.0332007187244457,-0.02355036089865151,-0.018405790850703305\n20010111 00:00,1310900,1334800,1310900,1327700,6271200,0.008430806623120235,-0.03316306215286382,-0.023507884167552288,-0.018360744510401306\n20010112 00:00,1326900,1337200,1312800,1319100,6402300,-0.006477366875047075,-0.03319801122293705,-0.023554641741656532,-0.018413797154309772\n20010116 00:00,1320000,1331900,1315200,1325800,7763000,0.005079220680767271,-0.03319375111914573,-0.02355669873656931,-0.018419221771166693\n20010117 00:00,1348400,1350500,1326400,1329400,7793500,0.0027153416804948094,-0.033151853981790505,-0.02351701516687019,-0.018380718246194236\n20010118 00:00,1334400,1357000,1329400,1350500,8764500,0.015871821874529957,-0.03317526277932727,-0.0235155946588656,-0.018366061327280817\n20010119 00:00,1361900,1361900,1338800,1344800,7353300,-0.00422065901517954,-0.03314410528955558,-0.023488975876917857,-0.018341862113679552\n20010122 00:00,1342500,1357800,1335600,1346300,7091800,0.0011154074955384008,-0.0331282087152344,-0.02347346289396197,-0.01832655362186111\n20010123 00:00,1344700,1366600,1341600,1361300,8381500,0.01114164747827373,-0.03275336797942269,-0.023162651571628758,-0.018049876142926816\n20010124 00:00,1362500,1373100,1358400,1366900,5708800,0.004113714831411208,-0.03275438149763732,-0.02316638796220593,-0.01805506408668508\n20010125 00:00,1362500,1372500,1356600,1360600,10440400,-0.004608969200380453,-0.032768532207471134,-0.023179030424329356,-0.018066902507535034\n20010126 00:00,1351600,1361300,1344500,1357800,7049800,-0.0020579156254593167,-0.03275177185528839,-0.023164035425119786,-0.018052848611463168\n20010129 00:00,1355000,1369000,1353700,1366500,6346400,0.006407423773751697,-0.03242897510664747,-0.022899040952605105,-0.01781866831846704\n20010130 00:00,1363000,1379200,1357900,1377500,6535400,0.008049762166117747,-0.03234831217434917,-0.022857949350537667,-0.017798672046120848\n20010131 00:00,1374000,1387000,1366000,1370600,9018400,-0.0050090744101632945,-0.03238844495501626,-0.02289840096705861,-0.0178392936328557\n20010201 00:00,1371000,1375600,1362500,1374800,7899200,0.003064351378958108,-0.032389952569920596,-0.022905109018754834,-0.01784877401816263\n20010202 00:00,1374000,1379900,1350000,1350800,7931800,-0.01745708466686069,-0.03256304156777834,-0.023060455550747743,-0.017994662107255005\n20010205 00:00,1348000,1359000,1347500,1358900,3758500,0.005996446550192491,-0.03254994753195576,-0.023043738284784985,-0.017976013310711466\n20010206 00:00,1353000,1367000,1352200,1354200,6830900,-0.0034586798145559428,-0.03256570699906512,-0.023058413232391144,-0.01799011010498349\n20010207 00:00,1347200,1354200,1336800,1342200,5602500,-0.00886132033673015,-0.03262865438827719,-0.023125928104505766,-0.018060059885332522\n20010208 00:00,1348000,1354000,1334800,1334800,5591600,-0.005513336313515138,-0.032451518094424904,-0.022983968351230875,-0.017936852615676548\n20010209 00:00,1333500,1333500,1312600,1318300,9406500,-0.012361402457297,-0.032559296845494724,-0.023078407395735873,-0.018024180311972428\n20010212 00:00,1317000,1335000,1317000,1331400,5507600,0.009937040127436791,-0.03235325369565904,-0.022898640170948753,-0.017858420685600538\n20010213 00:00,1337000,1341700,1320000,1321200,5986900,-0.0076611086074808155,-0.03240588270091416,-0.022945760282937027,-0.017902604026972684\n20010214 00:00,1326500,1326500,1306600,1321500,8150200,0.0002270663033605569,-0.03240804161474521,-0.02295954506031507,-0.017922586509188723\n20010215 00:00,1328400,1335200,1319900,1329600,5417200,0.006129398410896769,-0.03230439219175435,-0.022865423699663084,-0.017833544523313136\n20010216 00:00,1310000,1312900,1293000,1304600,10245800,-0.018802647412755724,-0.03249471538635482,-0.023021599524218495,-0.017971516511252204\n20010220 00:00,1310400,1311400,1281000,1283200,5457000,-0.01640349532423735,-0.0322814663635982,-0.022857538147951526,-0.017833676887321025\n20010221 00:00,1279000,1288400,1255200,1256000,10237700,-0.021197007481296715,-0.03251918608190787,-0.023052237759029513,-0.01800544263842005\n20010222 00:00,1263500,1265400,1230200,1255200,21327100,-0.0006369426751592355,-0.03253077615961514,-0.02307061572056177,-0.018027439195702367\n20010223 00:00,1250800,1255400,1218000,1248900,15540300,-0.005019120458890969,-0.03252280441980763,-0.023063746368553146,-0.01802115752255019\n20010226 00:00,1258000,1272100,1245000,1272100,9555900,0.018576347185523368,-0.03244297061502635,-0.02296908447120038,-0.017918590823915594\n20010227 00:00,1268000,1278400,1255100,1263500,10871500,-0.006760474805439842,-0.03249041778846985,-0.023021876955017565,-0.017974232872913866\n20010228 00:00,1267500,1268400,1232700,1241500,13986800,-0.01741195092995651,-0.03264761176336913,-0.023169185962183404,-0.018116272240358115\n20010301 00:00,1240500,1245000,1217500,1244900,13921800,0.002738622633910559,-0.0326434318926893,-0.02317493417067761,-0.01812731307112337\n20010302 00:00,1225000,1256500,1223000,1237700,12367500,-0.005783597076070346,-0.03268439234159597,-0.023214064776008434,-0.018165468193614833\n20010305 00:00,1241500,1247800,1238100,1244000,4718700,0.005090086450674658,-0.032627010112011974,-0.02318927969015755,-0.01815806052446966\n20010306 00:00,1263500,1277500,1254900,1258700,6597400,0.011816720257234792,-0.032517269953479595,-0.023082155877318634,-0.01805233147583873\n20010307 00:00,1269000,1269000,1257600,1266400,6407800,0.006117422737745182,-0.03220683645978116,-0.022826778927138917,-0.017826304965284465\n20010308 00:00,1266000,1272400,1261000,1269000,5554000,0.00205306380290593,-0.03220923533139514,-0.022835580513903105,-0.017838519815803422\n20010309 00:00,1261000,1261000,1231100,1236700,9754500,-0.02545311268715522,-0.03239540394332139,-0.023026827566971487,-0.018032474167053038\n20010312 00:00,1223400,1245000,1177000,1184400,11973300,-0.04228996523004769,-0.033125677150218996,-0.0235874531056189,-0.018502661161499387\n20010313 00:00,1194000,1204400,1175300,1202000,12711300,0.01485984464707868,-0.03309471249356993,-0.023538985216198603,-0.018444862363455525\n20010314 00:00,1170500,1192900,1157500,1172000,17316500,-0.024958402662229595,-0.03323185331021304,-0.023645043325726263,-0.01853435039683452\n20010315 00:00,1184500,1188600,1175100,1177100,8083600,0.004351535836177423,-0.03314223816125779,-0.023602171082626643,-0.01851639662388491\n20010316 00:00,1171300,1185000,1144600,1153100,35979400,-0.02038909183586779,-0.03272554008281115,-0.023387994243211172,-0.01841018310761257\n20010319 00:00,1157600,1176900,1148200,1173000,9638200,0.017257826727950842,-0.032773787120032156,-0.02340506478976472,-0.018410633582352905\n20010320 00:00,1179000,1184600,1141500,1142500,13717000,-0.026001705029838007,-0.03306518930205738,-0.02363570185780818,-0.018608876992980347\n20010321 00:00,1141800,1152600,1119000,1123400,18086400,-0.01671772428884022,-0.033079350601751045,-0.02369493152955501,-0.01869213244710333\n20010322 00:00,1120200,1157000,1080400,1119000,25414600,-0.003916681502581398,-0.033102185990433436,-0.023717804491095514,-0.01871502543859546\n20010323 00:00,1132500,1144800,1115000,1142500,12191600,0.021000893655049202,-0.03313583397140882,-0.023737564447968786,-0.01872738174120941\n20010326 00:00,1157000,1162700,1147700,1155000,9392300,0.010940919037199182,-0.03314809746647569,-0.02373846738761627,-0.018722228410800013\n20010327 00:00,1156200,1186500,1152500,1185100,12432000,0.026060606060606117,-0.03326304655731629,-0.02378353200327547,-0.018730037871331814\n20010328 00:00,1169000,1175000,1149000,1154500,10194300,-0.025820605856045953,-0.0335058999375641,-0.023973824235961613,-0.01889230995074356\n20010329 00:00,1147000,1166000,1093400,1149800,11463600,-0.0040710264183628775,-0.033525560549867536,-0.02399268881130324,-0.018910750161726404\n20010330 00:00,1155500,1166500,1145000,1161200,8495500,0.009914767785701883,-0.03341013139404419,-0.023882999765803766,-0.018804121147800598\n20010402 00:00,1163000,1173800,1138000,1145400,10040900,-0.013606613847743754,-0.03351259213620799,-0.023984380284329324,-0.018904925803101734\n20010403 00:00,1139800,1141500,1101000,1106700,12365600,-0.03378732320586697,-0.034003394278570874,-0.024372302562313434,-0.01923800320606936\n20010404 00:00,1105800,1121000,1093000,1103100,14720900,-0.0032529140688533076,-0.03399231873427569,-0.024362316073082244,-0.019228597288062983\n20010405 00:00,1133000,1154900,1125000,1152200,15035600,0.04451092376031185,-0.034445545356775895,-0.024622348661818155,-0.0193856388522703\n20010406 00:00,1139900,1144000,1120600,1130500,14400500,-0.01883353584447145,-0.034624978127281776,-0.02478227672742922,-0.01953516903187472\n20010409 00:00,1140000,1154800,1127800,1140000,8617400,0.008403361344537785,-0.034621499859651315,-0.024781417478815338,-0.019535705972607485\n20010410 00:00,1154500,1177500,1151700,1170900,15812700,0.027105263157894743,-0.03472965215767349,-0.02481871855421777,-0.019535236523400376\n20010411 00:00,1187800,1189900,1161400,1169600,12328300,-0.0011102570672132384,-0.03471031505423861,-0.024800785775679,-0.019518052385267326\n20010412 00:00,1163000,1186300,1159600,1185500,8316200,0.013594391244869941,-0.03447677558589251,-0.02459328598576884,-0.01932443425157739\n20010416 00:00,1182900,1188900,1169100,1182300,6587800,-0.002699283002952302,-0.034322607275350504,-0.02446656786979628,-0.019212349732756515\n20010417 00:00,1173100,1196600,1170200,1194200,9952300,0.010065127294256904,-0.033061588665653154,-0.02349714275781478,-0.018398372035431057\n20010418 00:00,1210600,1260000,1206900,1241400,19909300,0.03952436777759161,-0.03322296853281723,-0.023601679044820096,-0.018472605220190643\n20010419 00:00,1242500,1258300,1200000,1257200,13370400,0.012727565651683648,-0.03304842768174001,-0.023498001226857364,-0.018406704222968504\n20010420 00:00,1249000,1254000,1236600,1243600,7779700,-0.010817690104995226,-0.03307211224736481,-0.023517489087118183,-0.018423954835128747\n20010423 00:00,1236500,1263000,1219100,1227000,8156500,-0.013348343518816308,-0.03318698098886391,-0.02361731384765448,-0.018515759705080646\n20010424 00:00,1225200,1237000,1211000,1211300,9259600,-0.01279543602281985,-0.0332753008451846,-0.0236915543162337,-0.01858249450415251\n20010425 00:00,1214200,1236700,1209500,1231000,7959200,0.016263518533806698,-0.033041145444344396,-0.02354675850079158,-0.01848533595303102\n20010426 00:00,1237300,1252200,1235000,1237400,9880700,0.005199025182778261,-0.03296115543399248,-0.02347236596490091,-0.018413927410063445\n20010427 00:00,1249200,1256800,1242000,1255500,7258700,0.014627444641991172,-0.032982252898432964,-0.023471231827206503,-0.018400941687533975\n20010430 00:00,1264500,1272700,1246700,1252100,8758500,-0.0027080844285145567,-0.0329374237887726,-0.02343252647265193,-0.01836550088416672\n20010501 00:00,1250700,1269700,1246000,1269500,10205900,0.013896653621915167,-0.03293923857639834,-0.023433424809559934,-0.018365910664588224\n20010502 00:00,1274100,1276900,1260000,1268900,9164600,-0.00047262701851125133,-0.03277666370390041,-0.023298806525929965,-0.018246195935036683\n20010503 00:00,1261300,1261500,1242200,1251600,9322200,-0.01363385609583101,-0.032668865608964294,-0.023214323665792274,-0.018174142340297236\n20010504 00:00,1236500,1272000,1234400,1269500,12084200,0.014301693831895168,-0.03267369282838996,-0.023198484753957256,-0.01814728639035753\n20010507 00:00,1268600,1274700,1255300,1265700,6651400,-0.0029933044505711104,-0.032672496044138834,-0.0232178179878743,-0.0181775641009933\n20010508 00:00,1268600,1271000,1255600,1265200,6522000,-0.00039503831871690043,-0.032642384682853666,-0.023190417773475087,-0.018151609188967\n20010509 00:00,1252500,1266000,1250600,1258700,9240800,-0.0051375276636105305,-0.0326335054097421,-0.02318277148250923,-0.01814462019622064\n20010510 00:00,1272600,1275000,1257700,1259900,6503700,0.0009533645825057224,-0.032395461164382966,-0.02298840107188837,-0.01797353214529354\n20010511 00:00,1260000,1264900,1244000,1248200,7394500,-0.009286451305659194,-0.03241606459494967,-0.0230349017600642,-0.0180338385656738\n20010514 00:00,1249000,1254400,1244600,1252300,7793600,0.003284730011216208,-0.03241302327377683,-0.023039642518375786,-0.018042727921762706\n20010515 00:00,1255500,1265000,1248500,1253000,8986500,0.0005589714924538747,-0.03234051799240314,-0.023011971498403817,-0.01803895788064487\n20010516 00:00,1248400,1292000,1246200,1289600,12431300,0.029209896249002387,-0.03252028506599248,-0.02311807429808787,-0.018105790528488118\n20010517 00:00,1290100,1300800,1285600,1293100,11930400,0.0027140198511166336,-0.03242100562173642,-0.023030884267146744,-0.018025045319051025\n20010518 00:00,1290900,1297200,1281000,1296200,6030000,0.0023973397262393448,-0.032360798308786604,-0.022976003609528787,-0.01797300428168039\n20010521 00:00,1298400,1318000,1291500,1317700,11722200,0.016586946458879703,-0.03214238358942205,-0.02277662971251354,-0.017783780976603276\n20010522 00:00,1318300,1320900,1310700,1313700,7704800,-0.00303559231995143,-0.03214057962168561,-0.02277500479005622,-0.017782251502521735\n20010523 00:00,1310500,1310500,1292900,1292900,11528900,-0.01583314303113348,-0.0320689090774993,-0.02271913986764164,-0.017734812498588506\n20010524 00:00,1294700,1300000,1249000,1297000,7410400,0.003171165596720593,-0.03199440072509222,-0.022686856621713835,-0.01772503930068028\n20010525 00:00,1296500,1297000,1280100,1282300,7097400,-0.011333847340015413,-0.03199936698784259,-0.02269087626133265,-0.017728554299010428\n20010529 00:00,1282300,1283500,1269000,1273000,8350400,-0.007252592996958573,-0.03202349741309463,-0.02271159765934336,-0.017747458357213124\n20010530 00:00,1265900,1275300,1250000,1252900,9937200,-0.015789473684210575,-0.03195222156828988,-0.02271586603757071,-0.01779199908120445\n20010531 00:00,1254300,1267600,1252600,1261000,9468700,0.006465001197222486,-0.03193614915372228,-0.0226951934351273,-0.017768874135626406\n20010601 00:00,1262000,1271000,1251200,1266400,8898100,0.004282315622521793,-0.03186936230464285,-0.022665523110613803,-0.017758990493017643\n20010604 00:00,1268000,1272700,1258900,1271700,5421400,0.0041850915982311054,-0.03179417377556658,-0.022630878265501413,-0.017745959335803592\n20010605 00:00,1274900,1292300,1272700,1288700,8082500,0.013367932688527207,-0.03177532214272442,-0.022595415261832348,-0.017701640871813362\n20010606 00:00,1288300,1288300,1273600,1275300,12487900,-0.01039807558004191,-0.031814811829161266,-0.02262824008852722,-0.017730912686441606\n20010607 00:00,1270500,1282900,1270000,1282400,6862800,0.00556731749392303,-0.031811682886003785,-0.022629247177773475,-0.017734124679257827\n20010608 00:00,1277000,1278700,1261400,1270000,7278100,-0.00966936993137868,-0.03183857852733818,-0.02265162629431331,-0.01775409605314207\n20010611 00:00,1267100,1277500,1254100,1259400,7055200,-0.00834645669291334,-0.03188659533501616,-0.022693534398906274,-0.017792747630724297\n20010612 00:00,1248600,1268800,1240400,1261300,9128400,0.0015086549150389317,-0.031837552612212015,-0.02264868441360296,-0.01775013277826839\n20010613 00:00,1261700,1265800,1246700,1247400,8230500,-0.011020375802743176,-0.03189534426666115,-0.022719880924919406,-0.01782847536917913\n20010614 00:00,1241800,1243000,1222400,1224800,12436500,-0.018117684784351495,-0.03207314114256309,-0.022866890926326117,-0.01795907300171235\n20010615 00:00,1209100,1224000,1204000,1216200,16676600,-0.0070215545395166945,-0.03212365450330046,-0.02291667998208757,-0.01800847593317128\n20010618 00:00,1216500,1224400,1209500,1210800,7895700,-0.004440059200789381,-0.03208432193243573,-0.02288328854200493,-0.01797825168792475\n20010619 00:00,1223800,1228900,1208600,1214600,7655100,0.0031384208787579304,-0.03206861226127445,-0.022882620429138256,-0.017985602174127018\n20010620 00:00,1211900,1228600,1211000,1226000,8120400,0.00938580602667538,-0.03203478952156093,-0.022841148287824204,-0.017940052165124617\n20010621 00:00,1222200,1274700,1221500,1238600,11993900,0.010277324632952611,-0.03203777140246865,-0.022832410473548847,-0.017925066624713264\n20010622 00:00,1234900,1236000,1221600,1227500,11803800,-0.008961730986597805,-0.03194717278096029,-0.022759755614077008,-0.017861977518386227\n20010625 00:00,1232800,1234400,1215000,1221300,8064300,-0.0050509164969450016,-0.03192429653012114,-0.02274026635455951,-0.017844293851409503\n20010626 00:00,1209000,1229000,1200300,1218400,8014800,-0.0023745189552116797,-0.031937459170834334,-0.02276336402828276,-0.017872687854468054\n20010627 00:00,1216000,1251500,1209100,1213100,9785600,-0.004349967170059088,-0.031954161784287165,-0.022778715029135917,-0.017887318315645665\n20010628 00:00,1220000,1239400,1219300,1228900,9986900,0.013024482730195297,-0.03196788000456638,-0.022773832838964884,-0.01787252031549025\n20010629 00:00,1228000,1240100,1222600,1232000,9113800,0.0025225811701521383,-0.03190881692860034,-0.022719640478916038,-0.01782092451607387\n20010702 00:00,1228000,1243200,1226200,1239000,8031000,0.005681818181818121,-0.031908326111611394,-0.022720253743049385,-0.017822126361768106\n20010703 00:00,1239800,1241000,1230500,1240800,3305300,0.0014527845036320652,-0.03189184903714426,-0.02272210745636013,-0.01783375215021427\n20010705 00:00,1230700,1236500,1221100,1221300,4818400,-0.01571566731141194,-0.03190377230611531,-0.022731521349482024,-0.017841828304356364\n20010706 00:00,1213100,1215800,1190500,1191900,9531300,-0.024072709408007875,-0.032196482853560776,-0.022972797265282816,-0.01805568460834969\n20010709 00:00,1194900,1205400,1192000,1201000,8274300,0.007634868697038444,-0.03216388462463934,-0.02295848412300853,-0.01805111917810714\n20010710 00:00,1202900,1206400,1182100,1183500,8339800,-0.014571190674438017,-0.03228379177740249,-0.023059261752604022,-0.01814169892968646\n20010711 00:00,1181000,1190400,1170900,1182700,14904100,-0.0006759611322348924,-0.03229310483836292,-0.02306985343171947,-0.018152972235409112\n20010712 00:00,1195000,1214700,1193100,1211600,11252600,0.02443561342690459,-0.03241826559772315,-0.02313942259248707,-0.018192905720671206\n20010713 00:00,1208400,1223200,1206200,1219000,9992900,0.00610762627930006,-0.032415224417221396,-0.023132425924609522,-0.01818380039711002\n20010716 00:00,1217700,1222800,1202900,1206000,6321000,-0.010664479081214151,-0.032498577550811286,-0.023211514478198463,-0.018260615518880568\n20010717 00:00,1202000,1219400,1198300,1216700,7384300,0.008872305140961823,-0.03249845354610503,-0.023202499731821483,-0.01824686115101712\n20010718 00:00,1205600,1216400,1200600,1211000,6678700,-0.004684803156077888,-0.03246281793281915,-0.023172206585559456,-0.01821941605415691\n20010719 00:00,1221800,1229800,1207600,1218300,9143600,0.00602807597027244,-0.032401444666779626,-0.02311209739982897,-0.01815998074496173\n20010720 00:00,1211500,1219400,1209200,1214500,8514700,-0.0031191003857834465,-0.032418768374867506,-0.02313870103679757,-0.018191531477678345\n20010723 00:00,1218000,1218800,1192200,1193600,7405300,-0.017208727871552032,-0.03250606992941662,-0.023208327656494422,-0.018251735655007584\n20010724 00:00,1190000,1192000,1167500,1173900,11894500,-0.016504691689008033,-0.03257936295777818,-0.02326686843942971,-0.018302412070493504\n20010725 00:00,1179200,1194800,1174600,1193000,11752400,0.016270551154272006,-0.03262168105904948,-0.02328405794983626,-0.018306205622092758\n20010726 00:00,1190600,1208500,1185600,1207500,12583600,0.01215423302598495,-0.03257339599912348,-0.023225696599842974,-0.01824247263914966\n20010727 00:00,1208300,1216000,1199100,1210000,8333200,0.0020703933747412417,-0.03254471740933804,-0.023197763176163236,-0.018214936460763546\n20010730 00:00,1211900,1213500,1203000,1208200,8736400,-0.0014876033057851235,-0.03230215644832247,-0.023002022649438972,-0.018044155734311472\n20010731 00:00,1210000,1226800,1201800,1214600,11528000,0.005297136235722588,-0.03229892298585561,-0.023003303402973116,-0.018047842999691907\n20010801 00:00,1219700,1227000,1209000,1219600,11666400,0.004116581590647206,-0.032298740644518376,-0.023002927438080967,-0.018047363814799097\n20010802 00:00,1232300,1233500,1214600,1223800,10605300,0.0034437520498524776,-0.03229595057210165,-0.02299913105694579,-0.018043030974209735\n20010803 00:00,1223600,1223700,1202000,1218700,10527700,-0.004167347605817939,-0.03232246888686233,-0.023032636381178733,-0.01808026104733848\n20010806 00:00,1213500,1215100,1201000,1204500,7974000,-0.01165176007220814,-0.03241765733928808,-0.023121714012946236,-0.018166081023224787\n20010807 00:00,1202700,1215300,1199100,1208300,8373000,0.0031548360315483137,-0.03240762166429105,-0.02312364427401289,-0.01817439028052974\n20010808 00:00,1201200,1211600,1184300,1186500,14886400,-0.01804187701729698,-0.032587657518997074,-0.023275287266821435,-0.018310897143722145\n20010809 00:00,1187000,1189700,1178600,1187400,13918500,0.0007585335018962525,-0.032553497630251615,-0.023243444835038003,-0.018280290139669936\n20010810 00:00,1188000,1198400,1173400,1194400,11299200,0.005895233282802836,-0.032498527761535174,-0.023188830700869904,-0.018225865646273244\n20010813 00:00,1196000,1198500,1188200,1194900,7194100,0.0004186202277294271,-0.03250575254084652,-0.02320043235135545,-0.018239800590586133\n20010814 00:00,1201400,1203500,1188000,1191100,13026500,-0.0031801824420453206,-0.03250661661135656,-0.02322003604967834,-0.01826939431515427\n20010815 00:00,1192300,1196100,1181600,1182800,8303100,-0.006968348585341233,-0.03253671462226934,-0.023246616021993325,-0.01829409883411047\n20010816 00:00,1178000,1187500,1170000,1186200,10275800,0.002874535001690992,-0.0325087512726268,-0.023218510272204965,-0.018265917171331296\n20010817 00:00,1176500,1178700,1160100,1166400,10893500,-0.01669195751138086,-0.032658108232550956,-0.02335573967551281,-0.018396681419082288\n20010820 00:00,1168000,1176600,1165500,1175600,9717400,0.00788751714677649,-0.03264549017493805,-0.023335555605804113,-0.018372463936321654\n20010821 00:00,1178000,1185400,1080500,1161300,13952900,-0.012164001361007148,-0.03274479623248213,-0.023425270027585102,-0.018457065092569034\n20010822 00:00,1167500,1174300,1157800,1170500,11224700,0.00792215620425396,-0.032736376343535656,-0.023409102257171903,-0.018436766955215223\n20010823 00:00,1169600,1175200,1165200,1167000,8169600,-0.0029901751388295983,-0.03275765231872279,-0.023432883411314536,-0.018461883610989178\n20010824 00:00,1172100,1191000,1166500,1190000,11056100,0.019708654670094194,-0.03283027726944132,-0.02346540485405171,-0.018473026022015514\n20010827 00:00,1189700,1192000,1182600,1184900,6219700,-0.004285714285714337,-0.03284135178967451,-0.023475530541868146,-0.018482645890781527\n20010828 00:00,1182800,1184900,1165900,1166400,11146700,-0.015613131909865796,-0.03298414828802169,-0.0235999542461164,-0.018597275126480045\n20010829 00:00,1171300,1171800,1151700,1154000,15345700,-0.01063100137174211,-0.03305016604135224,-0.023656846211752458,-0.018649302168464096\n20010830 00:00,1148500,1159100,1120100,1132800,16303700,-0.018370883882149025,-0.033193944238942445,-0.023773185373264616,-0.018751013681375037\n20010831 00:00,1134000,1147700,1131300,1139200,15875800,0.005649717514124353,-0.03318253407417693,-0.023771052381747787,-0.01875382631658899\n20010904 00:00,1138500,1167900,1134400,1136500,22807100,-0.0023700842696628976,-0.03319736556303022,-0.02378666119329975,-0.0187698495159953\n20010905 00:00,1137000,1141900,1119500,1136500,20800000,0.0,-0.033144627283321335,-0.023739390379342445,-0.018725493387799035\n20010906 00:00,1126500,1133000,1110900,1111000,20895800,-0.02243730752309725,-0.03331716507424914,-0.023875477012547913,-0.018842148043702055\n20010907 00:00,1100200,1112500,1086900,1091300,30316100,-0.017731773177317778,-0.03348508950829164,-0.024023053462330666,-0.018978877058369086\n20010910 00:00,1077000,1110700,1075500,1098300,23040200,0.006414368184733732,-0.033442456821708044,-0.023977741912284096,-0.018932137416122933\n20010917 00:00,1010000,1065100,1000000,1043000,32337700,-0.05035054174633524,-0.03443002537284165,-0.02473236433873562,-0.019562577125471277\n20010918 00:00,1043300,1053000,1033600,1039000,21762400,-0.003835091083413178,-0.034424208899459734,-0.024727110300978246,-0.01955762292006418\n20010919 00:00,1041000,1045000,985600,1020200,43139900,-0.018094321462945095,-0.034588938247135055,-0.02486563316137337,-0.019682175199061458\n20010920 00:00,1004000,1018500,985700,989600,37685200,-0.02999411880023528,-0.034961922188888966,-0.025161487774430096,-0.01993691245238948\n20010921 00:00,940500,997000,938000,968500,49249900,-0.02132174616006466,-0.03508988896607237,-0.02526282205105144,-0.02002404904150878\n20010924 00:00,997300,1011600,990600,1004800,24672600,0.037480640165203916,-0.03531854286899788,-0.025364603722943923,-0.02005819559649976\n20010925 00:00,1007500,1020000,999000,1014000,25190100,0.009156050955414052,-0.0353172647958473,-0.0253642239813379,-0.020058294752116075\n20010926 00:00,1023500,1024000,1004300,1010000,17174200,-0.0039447731755424265,-0.03530514569860717,-0.025353397102014424,-0.0200481567493824\n20010927 00:00,1012500,1022500,1000000,1020500,19974800,0.010396039603960405,-0.035302163094523345,-0.025337682062493892,-0.020025654095644076\n20010928 00:00,1029800,1099200,1025000,1042500,21208700,0.02155805977462033,-0.03538315003450463,-0.02537092531562722,-0.020033445365983556\n20011001 00:00,1039000,1043200,1024200,1040000,21059700,-0.0023980815347721673,-0.03535398483506329,-0.025344843132136096,-0.020009006726887484\n20011002 00:00,1040000,1053800,1030700,1053800,18549500,0.013269230769230811,-0.03531513833325043,-0.02529195003760102,-0.019948625445748453\n20011003 00:00,1046000,1078800,1043500,1073400,30475800,0.018599354716264838,-0.03536061615891184,-0.02530183302308743,-0.019939532953648288\n20011004 00:00,1082900,1089700,1043700,1071000,31695300,-0.0022358859698154987,-0.03527107281365089,-0.025268633673750443,-0.019936370380050063\n20011005 00:00,1072500,1076200,1055200,1072600,28749400,0.0014939309056956063,-0.03512693339011702,-0.025145818634178897,-0.019824923290662735\n20011008 00:00,1062800,1073000,1058700,1065300,11713400,-0.006805892224501231,-0.035164663225391,-0.025180649961815918,-0.019858209434603768\n20011009 00:00,1066100,1067500,1056000,1058700,15220700,-0.006195437904815582,-0.0351489038102313,-0.025167170805209065,-0.019845945875393844\n20011010 00:00,1058000,1085500,1055200,1084000,18755600,0.02389723245489761,-0.03525804582660804,-0.025224302785960495,-0.019875351498604886\n20011011 00:00,1089500,1103000,1089500,1100100,24722000,0.014852398523985233,-0.03528325971403435,-0.02522729361655451,-0.019866495299833045\n20011012 00:00,1091500,1098900,1073000,1094500,30699900,-0.005090446323061548,-0.035114847724550965,-0.025090865732672503,-0.019747118024297124\n20011015 00:00,1086300,1094500,1071900,1093000,25426400,-0.0013704888076747634,-0.035101609402712466,-0.025078481737441875,-0.01973518946741991\n20011016 00:00,1098000,1106200,1089500,1100600,15043500,0.006953339432753891,-0.03501597547673531,-0.02499693796904433,-0.019655826146893346\n20011017 00:00,1110700,1111500,1079000,1079000,27566600,-0.019625658731600937,-0.03505948553134656,-0.02503109706704233,-0.01968500028452194\n20011018 00:00,1078200,1081600,1067400,1072100,16793600,-0.006394810009267893,-0.03481249071681967,-0.024834949329894725,-0.01951595893617703\n20011019 00:00,1070000,1079200,1060100,1075500,22435500,0.0031713459565338997,-0.034571354801870215,-0.024699178480179433,-0.019436357812858303\n20011022 00:00,1073000,1094900,1072100,1092600,17101100,0.01589958158995808,-0.03459516457934448,-0.02469676970274146,-0.019419972020812495\n20011023 00:00,1099600,1106100,1083800,1088000,21806000,-0.004210140948196939,-0.03449832404594294,-0.024616364449592903,-0.019348328354751736\n20011024 00:00,1089800,1099400,1081200,1087700,15508500,-0.0002757352941176183,-0.03445181803343191,-0.024574621605824153,-0.019309124738614458\n20011025 00:00,1074500,1103300,1067400,1103100,26339700,0.01415831571205306,-0.034203977364133005,-0.02442305643855213,-0.01920888368522709\n20011026 00:00,1099500,1118000,1096400,1107700,18892000,0.004170066177137111,-0.03420427400287877,-0.02442535749821014,-0.019212253294256507\n20011029 00:00,1101600,1105500,1080600,1082300,17805500,-0.022930396316692248,-0.034454511011114436,-0.024629942071176514,-0.019392500722907404\n20011030 00:00,1073500,1077000,1055600,1062000,25662200,-0.018756352212879968,-0.0346331815831358,-0.02477915522755388,-0.019526010240005512\n20011031 00:00,1069000,1078600,1060100,1062700,27388000,0.0006591337099812744,-0.034385604518741855,-0.024576709264536038,-0.019347623500133762\n20011101 00:00,1066000,1090100,1054300,1086700,28591900,0.022583984191210993,-0.03446742616400646,-0.024606864725919775,-0.019350235910069728\n20011102 00:00,1084400,1093800,1078700,1090600,16378300,0.003588846967884418,-0.03445467738310958,-0.024607534971376268,-0.0193580597888211\n20011105 00:00,1101200,1110900,1007400,1105800,15885700,0.013937282229965264,-0.0344569546014123,-0.024608652463377064,-0.019358559035021646\n20011106 00:00,1103500,1124500,1098500,1122900,22531600,0.015463917525773141,-0.034426453787663756,-0.024591655327919553,-0.01934876066049376\n20011107 00:00,1117700,1131200,1115600,1119600,19023300,-0.002938819129040926,-0.03442095466956483,-0.024586630144382355,-0.01934398812971773\n20011108 00:00,1128700,1226600,1104500,1123500,21245000,0.003483386923901488,-0.03442174137983176,-0.02458819803106098,-0.01934597245865086\n20011109 00:00,1122500,1129600,1114400,1124400,16170300,0.0008010680907877266,-0.03442102022196933,-0.024587407108939228,-0.019345144345460613\n20011112 00:00,1110000,1126500,1100000,1121600,25038200,-0.0024902170046247063,-0.034440115155694194,-0.024608595672357854,-0.01936744901512198\n20011113 00:00,1134400,1144300,1131800,1143900,14030800,0.019882310984308038,-0.03449765918838465,-0.024625845956908067,-0.019363218851636593\n20011114 00:00,1151700,1154000,1137000,1146200,17418000,0.0020106652679430237,-0.034343435908269306,-0.024494962892647958,-0.019244778370083683\n20011115 00:00,1143700,1151800,1139300,1146000,20437200,-0.00017448961786770134,-0.0343118378264848,-0.024465911003786204,-0.019217083847247435\n20011116 00:00,1150800,1151000,1134000,1143100,17188100,-0.002530541012216392,-0.03404296853264596,-0.02425026711484419,-0.019029814224707252\n20011119 00:00,1149200,1155700,1144500,1155300,12517900,0.010672732044440636,-0.03395602563205333,-0.024162892348537166,-0.018942209232385914\n20011120 00:00,1153700,1158000,1111500,1148100,15890300,-0.006232147494157347,-0.03387983266552044,-0.02414520216864318,-0.018955706671572696\n20011121 00:00,1145000,1146700,1135100,1141500,10996400,-0.005748628168278036,-0.03391812942466222,-0.02418214647480427,-0.018991929990054227\n20011123 00:00,1140400,1186300,1140000,1155200,7265300,0.012001752080595729,-0.03385647824975,-0.02411324060144567,-0.01891915666379824\n20011126 00:00,1157500,1163400,1150700,1162200,13697200,0.006059556786703668,-0.033837253953584626,-0.02409007248935774,-0.018893886118035202\n20011127 00:00,1156200,1169000,1140900,1154000,18924400,-0.007055584236792312,-0.03367303316174781,-0.023958653078978865,-0.018779953002737413\n20011128 00:00,1147400,1151700,1132500,1133400,19443200,-0.017850953206239195,-0.0338495348918378,-0.024108257267102917,-0.018915218210767734\n20011129 00:00,1136600,1145600,1130000,1144800,15954000,0.010058231868713685,-0.033649020324029486,-0.023931911974973567,-0.018751757470069866\n20011130 00:00,1144000,1149100,1140200,1143000,12983000,-0.0015723270440252124,-0.0336181422398775,-0.0239324372130118,-0.018769023702966757\n20011203 00:00,1136500,1140800,1130100,1133600,14533800,-0.008223972003499558,-0.033679469178191195,-0.023991048906632017,-0.01882618790968803\n20011204 00:00,1139200,1150000,1133500,1150000,14970000,0.014467184191954807,-0.03359979664548314,-0.023903399372857743,-0.018734285866162464\n20011205 00:00,1156100,1180000,1155600,1176400,23817500,0.022956521739130542,-0.033697119422311704,-0.023952735928891838,-0.01875804114545326\n20011206 00:00,1173500,1179400,1169300,1173000,16930400,-0.0028901734104046506,-0.03346522638870679,-0.023766146415903324,-0.018595602771669845\n20011207 00:00,1169000,1170900,1157000,1164500,17768300,-0.007246376811594235,-0.0335152080810553,-0.023812117832953793,-0.018639436325798054\n20011210 00:00,1158500,1163900,1144600,1144600,13238000,-0.017088879347359365,-0.03368084900302832,-0.023958972938627334,-0.018776276782315034\n20011211 00:00,1149000,1157200,1139000,1141900,19660800,-0.00235890267342298,-0.033342702627750145,-0.023767466039473648,-0.01866294284527685\n20011212 00:00,1145500,1147800,1131100,1142900,15487100,0.0008757334267448513,-0.03315577401263141,-0.02361239812348323,-0.018524859750098377\n20011213 00:00,1134500,1137000,1122800,1123600,17341600,-0.016886866742497175,-0.03329036512359398,-0.023722474497668233,-0.01862186740881854\n20011214 00:00,1123300,1134900,1120000,1129000,15363600,0.004805980776076968,-0.03322077985163491,-0.023690767955300295,-0.0186103538770339\n20011217 00:00,1129900,1143600,1129000,1139900,13616800,0.009654561558901653,-0.03322604361642633,-0.0236914577125296,-0.018608605247756926\n20011218 00:00,1146300,1151500,1143400,1149300,12932400,0.008246337398017278,-0.033183586714940407,-0.0236444729001969,-0.018559206622906325\n20011219 00:00,1140900,1159200,1140000,1155000,19767600,0.004959540589924316,-0.033116361610423695,-0.02358088004844006,-0.01849755011165544\n20011220 00:00,1155000,1158000,1146300,1146900,13673400,-0.007012987012987026,-0.03299874819397576,-0.023485949575631614,-0.018414711832168064\n20011221 00:00,1150300,1151000,1142000,1146600,12542200,-0.0002615746795709972,-0.03278660012763759,-0.02331251696836716,-0.018261918292877943\n20011224 00:00,1148300,1150400,1146100,1147300,7822400,0.0006105006105006083,-0.032793709071149806,-0.023325058175405308,-0.01827735541950089\n20011226 00:00,1146500,1162100,1146500,1152500,9195600,0.004532380371306655,-0.03267024222641808,-0.02321650944655175,-0.01817675948302085\n20011227 00:00,1153000,1163300,1152600,1159300,8636700,0.0059002169197397425,-0.0322539434775946,-0.02288084701117973,-0.017884083967973224\n20011228 00:00,1162900,1167500,1159500,1162100,9602500,0.0024152505822478965,-0.032255656018490675,-0.022888425995097127,-0.017894790330957835\n20011231 00:00,1161500,1164000,1148500,1148900,12333600,-0.01135874709577489,-0.032225907876091905,-0.022909456351115482,-0.017942890516587925\n20020102 00:00,1151100,1156500,1138100,1155900,16855900,0.006092784402471851,-0.032224031218093266,-0.022910196608108085,-0.017945025841279053\n20020103 00:00,1156500,1168300,1150000,1167600,14579900,0.010121982870490598,-0.032226150236281656,-0.022910857637375825,-0.017944909622048158\n20020104 00:00,1171700,1179800,1133600,1174100,19708000,0.005566974991435325,-0.03222502893868955,-0.022907784634171622,-0.01794079617180399\n20020107 00:00,1177000,1179900,1157100,1167000,11601500,-0.006047185077932005,-0.03218705447586753,-0.022876131609404507,-0.017912513082272884\n20020108 00:00,1168000,1170600,1159700,1163600,12006100,-0.0029134532990574558,-0.03177621514784429,-0.022553872654507787,-0.017637475996518128\n20020109 00:00,1166800,1199100,1153400,1157000,15074900,-0.005672052251632809,-0.03103869026794894,-0.022100179760061626,-0.017335092883258386\n20020110 00:00,1157000,1163500,1153000,1159600,13162200,0.0022471910112360494,-0.030940718572232153,-0.022014604676078773,-0.017256126387120013\n20020111 00:00,1162100,1162800,1147100,1147700,12628100,-0.010262159365298396,-0.03073001497147421,-0.021850020404686095,-0.017116128159557733\n20020114 00:00,1146500,1148400,1141000,1141200,11640600,-0.005663500914873221,-0.030742875755669214,-0.02186123489260515,-0.01712646501302383\n20020115 00:00,1145500,1153900,1139000,1148800,16475400,0.006659656501927902,-0.030741894480362728,-0.02185620391112997,-0.01711927514817515\n20020116 00:00,1143000,1144000,1130000,1130500,15926800,-0.01592966573816157,-0.03088365925261552,-0.02198862512084364,-0.017246715339272963\n20020117 00:00,1137600,1142400,1134000,1141300,16033000,0.00955329500221147,-0.030886783665807962,-0.021989529374951997,-0.017246436034788797\n20020118 00:00,1130000,1138700,1113600,1130800,15778700,-0.009200035047752575,-0.030911729658912757,-0.022010332598042363,-0.01726503076251386\n20020122 00:00,1137500,1139500,1120200,1122500,11249800,-0.00733993632826313,-0.03096612092426854,-0.022063227232796412,-0.01731712754903207\n20020123 00:00,1126300,1135600,1120200,1131400,11791000,0.007928730512249516,-0.030967199128576428,-0.02205792910023578,-0.017308430214881036\n20020124 00:00,1136400,1142500,1133200,1135400,11323700,0.003535442814212475,-0.03092608787669927,-0.02204320206777784,-0.017307768512166602\n20020125 00:00,1131200,1141800,1130400,1135900,11634500,0.0004403734366742462,-0.03090329638236764,-0.0220216688741984,-0.01728690611406209\n20020128 00:00,1139000,1141900,989200,1136300,9808100,0.0003521436746192208,-0.03090560854476636,-0.022024190979929956,-0.017289540139807536\n20020129 00:00,1138500,1144100,1100500,1102800,27316700,-0.029481650972454476,-0.03131143508141365,-0.02235835620162409,-0.017585502979666743\n20020130 00:00,1103900,1133900,1084000,1116100,34240300,0.012060210373594504,-0.031329310173286856,-0.02236175718311573,-0.017581187866472177\n20020131 00:00,1121500,1132700,1116200,1132400,17736200,0.014604426126691106,-0.031329800987231544,-0.022339768949872767,-0.017547216136352142\n20020201 00:00,1130900,1137000,1115500,1126000,15398900,-0.00565171317555635,-0.03135215667880974,-0.02235975336383257,-0.017565936430987965\n20020204 00:00,1122300,1151800,1094500,1097000,24526300,-0.025754884547069312,-0.03168140700893704,-0.02262993930461967,-0.017804635364372316\n20020205 00:00,1094000,1105000,1085300,1092700,35497300,-0.003919781221513263,-0.03170490663886524,-0.022660469215564024,-0.0178389130921124\n20020206 00:00,1096500,1097400,1080600,1087000,29039000,-0.005216436350324871,-0.03170634952120145,-0.022661730466270597,-0.0178400775156693\n20020207 00:00,1087200,1098600,1081600,1083800,23921700,-0.0029438822447102053,-0.031726399256009716,-0.02268289118759116,-0.017861830499788622\n20020208 00:00,1086300,1100500,1083000,1099700,17609700,0.01467060343236759,-0.031585408483892546,-0.022545855170418537,-0.017726902747843245\n20020211 00:00,1100500,1116300,1098200,1115900,17618500,0.014731290351914117,-0.03161826479328919,-0.022558932239792186,-0.01772943557754927\n20020212 00:00,1109600,1117100,1106200,1111100,13050700,-0.004301460704364213,-0.03162348064521673,-0.02256359984821392,-0.017733810919386712\n20020213 00:00,1114800,1125400,1113500,1122600,16158600,0.010350103501034935,-0.03156602990107967,-0.02250064609496271,-0.0176679235323394\n20020214 00:00,1125100,1129700,1115900,1119800,19646600,-0.0024942098699447524,-0.03154691873506971,-0.022483623781847303,-0.017652014778972755\n20020215 00:00,1121500,1122400,1107100,1108300,17842600,-0.010269691016252858,-0.03152300020832437,-0.02246428051010532,-0.01763511055874335\n20020219 00:00,1101500,1103000,1002000,1087400,14698200,-0.018857710006315975,-0.03171352650678791,-0.02263246633338586,-0.01779138675736975\n20020220 00:00,1090500,1103800,1078200,1103200,28524400,0.014530071730733951,-0.031688760565931194,-0.022589158582493944,-0.01773819443615787\n20020221 00:00,1099300,1109900,1084000,1086000,23205400,-0.015591007976794802,-0.031828559650507376,-0.022706392346604626,-0.0178433987114263\n20020222 00:00,1083500,1099400,1078700,1093700,26396200,0.0070902394106813205,-0.0318296011308011,-0.02270601176712082,-0.017842260037137105\n20020225 00:00,1097500,1118100,1097000,1115000,16472600,0.019475176008046047,-0.03170275444286653,-0.022571826947503863,-0.01770416328667338\n20020226 00:00,1116000,1120400,1101900,1113600,21362600,-0.0012556053811658696,-0.031555275258681736,-0.02244994201664421,-0.01759592255755557\n20020227 00:00,1119600,1128600,1106500,1115500,26777200,0.001706178160919558,-0.031316000439312125,-0.02225413720509339,-0.01742329144632194\n20020228 00:00,1118300,1127500,1111400,1111900,22479100,-0.003227252353204868,-0.03132906795380412,-0.0222663878374383,-0.017435106601816932\n20020301 00:00,1117200,1137300,1115100,1136600,25086800,0.022214227898192274,-0.031390150816571344,-0.022277918388860077,-0.017420220999417653\n20020304 00:00,1139000,1159900,1136500,1159300,26297000,0.019971845856062043,-0.031403524154881526,-0.022285751816617058,-0.017425101121357915\n20020305 00:00,1153300,1164000,1149700,1152100,21551900,-0.006210644354351813,-0.03139897778785042,-0.022281898120392163,-0.01742161668537674\n20020306 00:00,1151000,1177100,1150800,1168100,19031000,0.01388768336081947,-0.031241202360293246,-0.02213395704436701,-0.0172789182657635\n20020307 00:00,1173600,1175000,1125300,1163300,18622500,-0.004109237222840512,-0.03127084119765059,-0.02216287383132378,-0.017307450130323504\n20020308 00:00,1173800,1273000,1164800,1168900,19918100,0.004813891515516255,-0.031226391833304515,-0.022119126318132884,-0.017264076771386395\n20020311 00:00,1168900,1179000,1164300,1173400,14648900,0.0038497732911284555,-0.03122734767122585,-0.02212124399142143,-0.01726681381481009\n20020312 00:00,1161100,1171200,1159400,1171000,16309200,-0.002045338333049207,-0.031233703714509935,-0.022141852479131485,-0.017295020227905657\n20020313 00:00,1166300,1167500,1150000,1159000,16205200,-0.010247651579846306,-0.031319498450940376,-0.02222153813034762,-0.017371449148399342\n20020314 00:00,1160400,1164300,1156300,1158600,10434100,-0.0003451251078515627,-0.031327147869391864,-0.022229734538757755,-0.017379937155132422\n20020315 00:00,1159700,1169500,1062200,1167900,21148600,0.00802692905230451,-0.0309959041650411,-0.021956607330649285,-0.01713779163612367\n20020318 00:00,1171000,1175700,1158500,1167600,16975000,-0.00025687130747498177,-0.03019950374433641,-0.02134464640760948,-0.016624154726812057\n20020319 00:00,1173000,1177400,1168200,1173500,17720100,0.0050531003768414795,-0.030168746312710302,-0.02133429942538636,-0.016624688479641384\n20020320 00:00,1165000,1172500,1153900,1154300,16332900,-0.016361312313591836,-0.03000734004125804,-0.021210182491331536,-0.016520450353372313\n20020321 00:00,1153000,1159000,1141200,1156000,26674700,0.0014727540500736325,-0.03001277889017435,-0.0212173745891974,-0.016528577101765682\n20020322 00:00,1155000,1159400,1147000,1150900,15162300,-0.004411764705882337,-0.029806262042372092,-0.021052782633191096,-0.01638633515044215\n20020325 00:00,1150900,1153600,1133800,1134300,16756100,-0.01442349465635595,-0.029899835633767007,-0.021155773247721707,-0.01649434594516082\n20020326 00:00,1135200,1150200,1134700,1140800,19121200,0.005730406418055223,-0.029540402246050985,-0.020864746351586153,-0.01623978629656395\n20020327 00:00,1140300,1150100,1130000,1146700,18290300,0.005171809256661941,-0.029359503758543848,-0.020711395114793633,-0.016101120397194975\n20020328 00:00,1149700,1157700,1146800,1149100,16005200,0.002092962413883237,-0.029330891255597603,-0.02068417841435657,-0.016074647793910702\n20020401 00:00,1142300,1151000,1129600,1148300,14408500,-0.000696197023757672,-0.02925791123901492,-0.020657800121314806,-0.016073112707249388\n20020402 00:00,1139800,1441200,1137700,1139300,14373500,-0.007837673081947272,-0.029311879808844508,-0.02071778862924727,-0.016136310421909064\n20020403 00:00,1140100,1162000,1121500,1127400,24583000,-0.010445010093917295,-0.029245221219650633,-0.02071309460124614,-0.016164649472193843\n20020404 00:00,1126000,1155300,1122300,1128900,22450100,0.0013304949441192981,-0.02889164570691418,-0.020431534890906877,-0.01592148111963421\n20020405 00:00,1131900,1136700,1121800,1125300,19653800,-0.003188944990698883,-0.028885761616409836,-0.02042634911546242,-0.01591666761336422\n20020408 00:00,1113200,1128800,1112300,1128100,15283800,0.0024882253621256734,-0.028880693359000006,-0.02043139882062403,-0.015927111166933416\n20020409 00:00,1131900,1131900,1119300,1120500,13036600,-0.006736991401471548,-0.028801275502307027,-0.02036726027904279,-0.015871117971700568\n20020410 00:00,1121000,1135400,1120900,1133500,17406700,0.011601963409192395,-0.028238864380831587,-0.01991684091133094,-0.015480400993519744\n20020411 00:00,1128900,1130500,1105000,1107200,24076100,-0.02320247022496691,-0.028519563199774247,-0.02013850118138846,-0.015670588031625493\n20020412 00:00,1110300,1119700,1105700,1113300,14083200,0.0055093930635838895,-0.027929890484881,-0.01976690937168492,-0.015415254345519155\n20020415 00:00,1116200,1119700,1102000,1106300,16132400,-0.0062876134015988905,-0.02775829127626238,-0.019630995026139915,-0.015298363468434871\n20020416 00:00,1117000,1133200,1116700,1131200,13535800,0.02250745729006609,-0.027871078134832444,-0.019694345642127926,-0.015335359806430105\n20020417 00:00,1133900,1136700,1126000,1130500,12254200,-0.0006188118811880639,-0.027695717294406504,-0.019602584848610455,-0.015288165888576332\n20020418 00:00,1129000,1134600,1111500,1127600,24116800,-0.0025652366209641952,-0.0277034961465926,-0.019609776307849686,-0.015295044210809104\n20020419 00:00,1132000,1132400,1125600,1128500,10213300,0.0007981553742462122,-0.027681315258682497,-0.019608968641619505,-0.015305630529969683\n20020422 00:00,1123800,1126100,1108400,1111400,13095800,-0.015152857775808548,-0.02781611725050695,-0.01971875801424471,-0.01540208576785335\n20020423 00:00,1110900,1119000,1101700,1103800,15862500,-0.00683822206226381,-0.027859160183269557,-0.019768841566754923,-0.01545592264869878\n20020424 00:00,1105600,1112400,1095100,1095900,17114100,-0.0071570936763906134,-0.02743567981867009,-0.019523684524035762,-0.015305829109028592\n20020425 00:00,1092100,1104300,1087200,1094300,25129800,-0.0014599872251117585,-0.027422923314527583,-0.019531157790077285,-0.015324086790699493\n20020426 00:00,1097900,1100100,1079000,1079500,17209600,-0.013524627615827511,-0.027458963200802187,-0.019559786708338606,-0.015348764949335555\n20020429 00:00,1079300,1082600,1066300,1069200,16865400,-0.00954145437702636,-0.027410478830492965,-0.019521080191352503,-0.015315270969775262\n20020430 00:00,1070200,1087500,1066400,1079800,18604700,0.009913954358398813,-0.027302055397701634,-0.01941801966320173,-0.015215069386244146\n20020501 00:00,1079700,1092500,1068000,1089600,23395700,0.009075754769401811,-0.027255191882983715,-0.01939324028709678,-0.015202062982716367\n20020502 00:00,1091000,1099100,1082000,1087700,14990800,-0.0017437591776798822,-0.02727069705102088,-0.01941227415449796,-0.015222977986691345\n20020503 00:00,1086000,1089500,1072000,1076700,17107800,-0.010113082651466376,-0.02731410357047415,-0.019471725376628193,-0.015290982580448847\n20020506 00:00,1076500,1089000,1055100,1056200,20615700,-0.019039658214915933,-0.027514027073936926,-0.019632067288064263,-0.015430223691638274\n20020507 00:00,1061100,1063200,1050000,1052300,20654000,-0.0036924824843779236,-0.02750272335746052,-0.01964452203965088,-0.015455343994636416\n20020508 00:00,1070500,1093600,1067900,1091600,26506300,0.037346764230732576,-0.027925324217587862,-0.01989935924027363,-0.015620747009149024\n20020509 00:00,1086500,1091000,1075800,1076500,15747600,-0.013832905826310027,-0.027928182582034,-0.019901611650491768,-0.015622676387410411\n20020510 00:00,1079700,1080500,1057200,1059800,17174700,-0.015513237343241948,-0.0280469163474492,-0.020020222218512213,-0.015741221279355577\n20020513 00:00,1062200,1079500,1057800,1078200,13380700,0.0173617663710135,-0.02809065050546811,-0.020027482186204818,-0.015729036991149786\n20020514 00:00,1096200,1102600,1090000,1100900,18675600,0.021053607864960133,-0.02818728660697074,-0.020070875422053196,-0.015744046652331152\n20020515 00:00,1095000,1109100,1092900,1095500,27642300,-0.004905077663729718,-0.028185542789727125,-0.020069372229640448,-0.01574267173612536\n20020516 00:00,1097000,1104300,1093300,1103500,18318500,0.007302601551802734,-0.02818304583717936,-0.020060225862716767,-0.015729980591002547\n20020517 00:00,1106600,1111700,1101000,1111100,26024300,0.006887177163570568,-0.028109094423252715,-0.019989136633082744,-0.01566041718122405\n20020520 00:00,1106400,1106900,1094900,1096400,12980900,-0.013230132301322972,-0.02823300827102229,-0.020095948681537162,-0.015758112323744928\n20020521 00:00,1101100,1104900,1082900,1084800,15775700,-0.010580080262677871,-0.028316370380413552,-0.020167839166248865,-0.015823887327788128\n20020522 00:00,1082200,1091200,1080000,1090500,14899600,0.0052544247787611464,-0.02807928734021753,-0.020028056501515182,-0.01573597513317522\n20020523 00:00,1092600,1102400,1084800,1101600,12756400,0.010178817056396117,-0.028090787472296784,-0.02002751000865151,-0.015729006629130304\n20020524 00:00,1099800,1102100,1086600,1088500,10518500,-0.01189179375453886,-0.028193935568579766,-0.020117052174722917,-0.01581129552415161\n20020528 00:00,1090500,1099400,1074500,1079000,22840100,-0.008727606798346388,-0.028203123590426836,-0.02015297636642038,-0.015861472669065124\n20020529 00:00,1076300,1080200,1072500,1072500,13926300,-0.0060240963855421326,-0.028223893469438627,-0.02017113588121403,-0.01587824060835315\n20020530 00:00,1065500,1075100,1059000,1070100,18078000,-0.0022377622377622863,-0.028080998168718417,-0.020054296770698282,-0.015775291956420318\n20020531 00:00,1074000,1085600,1070800,1072300,17164100,0.002055882627791883,-0.028082530375870923,-0.020056676622571594,-0.015778123684557777\n20020603 00:00,1070900,1088800,1042500,1043000,25052400,-0.027324442786533565,-0.028379214536101857,-0.020285037163923686,-0.01597006115750177\n20020604 00:00,1041500,1052000,1032800,1044100,25161300,0.0010546500479386989,-0.028330903935077936,-0.020241221921671188,-0.015928642374376252\n20020605 00:00,1049500,1056200,1043500,1055000,18265200,0.010439613063882858,-0.028185605731863725,-0.020107997347872098,-0.015801854207742605\n20020606 00:00,1055400,1246700,1031500,1034200,19173400,-0.019715639810426566,-0.02841127180674102,-0.02029799003137925,-0.01597282953831171\n20020607 00:00,1017900,1039200,1017200,1032600,21968400,-0.0015470895378070226,-0.028424895216005584,-0.02031439910812815,-0.01599072364408877\n20020610 00:00,1032400,1044600,1030200,1035600,18162400,0.0029052876234747504,-0.028425701026326983,-0.020316456611240343,-0.015993448419996132\n20020611 00:00,1041300,1045400,1017600,1018900,20164600,-0.01612591734260327,-0.02855598026793938,-0.020442857202969855,-0.01611778131782515\n20020612 00:00,1017100,1029700,1007800,1026400,28666100,0.007360879379723295,-0.02847592800216015,-0.020365611424753398,-0.01604203166774363\n20020613 00:00,1021300,1030000,1013400,1015000,20605000,-0.011106780982073294,-0.028567354964246297,-0.02044963859943567,-0.016122114043142146\n20020614 00:00,1003100,1015600,985000,1012900,36963600,-0.002068965517241339,-0.028507446966684648,-0.02039844505990594,-0.016075566148943336\n20020617 00:00,1019200,1042900,1004700,1041900,16406300,0.028630664428867636,-0.028672764489712677,-0.020472348167142666,-0.016100736569380245\n20020618 00:00,1037400,1047400,1029200,1042400,15992500,0.00047989250407898254,-0.028675518674893912,-0.020475491444732312,-0.01610408727069306\n20020619 00:00,1035000,1044800,1022600,1025400,19380200,-0.01630851880276285,-0.02874928502735007,-0.02053379562289882,-0.016154148620960068\n20020620 00:00,1022700,1030500,1009600,1012000,23810000,-0.013068070996684167,-0.028671348787154,-0.020472820395223593,-0.01610221524629928\n20020621 00:00,1004700,1012000,986900,991900,27083500,-0.019861660079051435,-0.028847960582029028,-0.020612620893206406,-0.016222391778120796\n20020624 00:00,986100,1006900,972500,996900,35515100,0.005040830728904044,-0.028817735097051208,-0.020580228459279887,-0.016188844151728034\n20020625 00:00,1003000,1008900,975400,979000,30054700,-0.017955662553917118,-0.02900909585080089,-0.020740052385473266,-0.016331855911846094\n20020626 00:00,952000,981500,952000,976200,35590000,-0.0028600612870275377,-0.029019602785587476,-0.02076171698117838,-0.016359468615300455\n20020627 00:00,985000,994500,965700,994500,31061400,0.0187461585740627,-0.02908509499239153,-0.02079817862537486,-0.01638045417399192\n20020628 00:00,992400,1005000,990200,992500,20632900,-0.002011060834590239,-0.0290325847734125,-0.020752971020668108,-0.01633913956593204\n20020701 00:00,991900,1015000,969500,970800,18535000,-0.021863979848866455,-0.029261153344763743,-0.020934126266569784,-0.016495018943478913\n20020702 00:00,968700,980800,947700,950200,33423400,-0.021219612690564493,-0.029491657924585843,-0.021119012577920378,-0.01665558632470751\n20020703 00:00,946200,958400,937300,956900,30051200,0.007051147126920565,-0.02946566457879455,-0.02108738026487855,-0.01662094789909015\n20020705 00:00,967800,995500,966700,993000,19291300,0.037725990176612045,-0.029851302426571778,-0.021331331949277995,-0.016789367214070747\n20020708 00:00,989800,997000,975600,980300,18365500,-0.012789526686807662,-0.029961238942599486,-0.021426863086225337,-0.01687721889673421\n20020709 00:00,977300,983400,950100,956100,26169900,-0.024686320514128335,-0.030274705533451105,-0.021683803377099468,-0.01710402522625323\n20020710 00:00,960000,960700,922000,922900,47057800,-0.03472440121326226,-0.03083070867462206,-0.022118983036376348,-0.017474794334412548\n20020711 00:00,917600,933500,900600,931500,55775500,0.009318452703434899,-0.030692210158268275,-0.021991955338280952,-0.01735388168708551\n20020712 00:00,933300,938900,915200,924600,35065500,-0.007407407407407418,-0.030446714155830393,-0.02179900325431447,-0.017188940571629157\n20020715 00:00,916400,1016000,878900,921000,75907900,-0.0038935756002596023,-0.030468703328414806,-0.021827952419667025,-0.017221600083372517\n20020716 00:00,911300,923800,898700,905800,50090100,-0.01650380021715525,-0.03049693586548325,-0.021850160976354265,-0.017240597278408928\n20020717 00:00,924600,933000,897500,910000,45753500,0.004636785162287493,-0.03048730058489773,-0.021837172329718633,-0.017225820964740353\n20020718 00:00,907000,911000,882400,883300,28861700,-0.029340659340659325,-0.030755096060465913,-0.022089032256739655,-0.017469185709796806\n20020719 00:00,867700,884000,843000,848000,64420100,-0.03996377221781955,-0.03145931263046167,-0.02264050868170662,-0.017939236928629535\n20020722 00:00,841100,859100,814500,822100,73962000,-0.030542452830188638,-0.031810439315349374,-0.02291188204441922,-0.018168094090399857\n20020723 00:00,825500,832400,788500,800000,65162600,-0.02688237440700647,-0.0321420675162241,-0.02318792534246742,-0.018414505282430688\n20020724 00:00,781400,849400,776800,847500,98931400,0.059374999999999956,-0.03316244501704688,-0.023834918862937447,-0.01886244918459826\n20020725 00:00,842800,858500,816000,842000,85709600,-0.006489675516224147,-0.033202656882840624,-0.023877902510670235,-0.0189069104590264\n20020726 00:00,846500,856900,838000,856000,38022600,0.016627078384798155,-0.03323227653087765,-0.023875890584559856,-0.018888035857783574\n20020729 00:00,875100,903400,845400,902300,49081500,0.05408878504672887,-0.03387881289064213,-0.02425014449967711,-0.019117137009179455\n20020730 00:00,893200,914000,887000,907000,45504900,0.0052089105618973175,-0.03372591049803546,-0.024116792531777186,-0.018994207300348735\n20020731 00:00,905000,914500,889300,913800,44683000,0.0074972436604190396,-0.03368667791878727,-0.024099251808570903,-0.018988230425332556\n20020801 00:00,908800,913500,884600,886400,59773800,-0.029984679360910538,-0.03407172577455565,-0.024420487257319302,-0.019275447716022083\n20020802 00:00,885000,889200,852900,866600,49173500,-0.022337545126353775,-0.03431138147599211,-0.02461831062423499,-0.019450970420195918\n20020805 00:00,865000,869300,836000,837300,44063900,-0.033810293099469146,-0.03478248747876194,-0.02498898263017661,-0.019768101434061873\n20020806 00:00,852300,879000,848800,864000,58414400,0.03188821211035475,-0.035016377764225975,-0.025123443996799628,-0.019849557611965135\n20020807 00:00,878800,885000,857700,881500,39145700,0.02025462962962954,-0.03509011948589842,-0.025156823154778102,-0.01986141963659096\n20020808 00:00,884200,911000,878000,909800,45784100,0.03210436755530344,-0.035319080172100004,-0.025285393221633957,-0.01993647183574656\n20020809 00:00,901000,919400,893500,912600,40215000,0.0030775994724114852,-0.03529265105164133,-0.025258284270374964,-0.01990900046920348\n20020812 00:00,900000,912700,895500,907000,25204200,-0.006136313828621565,-0.035243445625346675,-0.025217081757508284,-0.019872064279872266\n20020813 00:00,901500,916600,886700,887500,46577700,-0.02149944873208376,-0.03546694619508908,-0.025403768947137712,-0.020039126392783116\n20020814 00:00,890200,926300,880100,924100,52910500,0.041239436619718406,-0.03569724745551758,-0.025497690799849575,-0.020060344887882615\n20020815 00:00,928500,939900,903000,934000,43290900,0.01071312628503418,-0.03569838394741487,-0.025486922305890093,-0.02004322989001462\n20020816 00:00,928200,940800,920000,932200,35341900,-0.001927194860813719,-0.03571568064380031,-0.025508245452469564,-0.020066699522293556\n20020819 00:00,934600,957500,931000,955200,31944500,0.024672816992061808,-0.035819509078645916,-0.025553462648810702,-0.020080671284265692\n20020820 00:00,948200,958000,936200,942700,29017300,-0.013086264656616442,-0.03590351566641613,-0.02562437550715439,-0.020144603923902504\n20020821 00:00,950600,957500,931000,955000,39314900,0.01304762915031299,-0.03587097284842704,-0.02557809772227338,-0.02009100407899457\n20020822 00:00,954900,975000,950700,967600,36382900,0.013193717277486972,-0.035885381935726365,-0.025576289840847248,-0.020080550991548155\n20020823 00:00,960200,961500,922500,945200,26890400,-0.02315006200909464,-0.03598695366143061,-0.025655613981630278,-0.02014801502713188\n20020826 00:00,949100,956400,935000,952800,31061600,0.008040626322471489,-0.0359871589274778,-0.025655581128843568,-0.020147855234075918\n20020827 00:00,957000,962500,935100,939000,33956800,-0.01448362720403018,-0.036014227516169055,-0.025677416611414507,-0.02016690096713805\n20020828 00:00,932900,951500,918000,923000,38884800,-0.017039403620873306,-0.036170898748612915,-0.025817209051497512,-0.020297695385469668\n20020829 00:00,912700,930600,908100,923000,43642300,0.0,-0.03615780444319725,-0.02580447463931014,-0.020285152831030592\n20020830 00:00,916900,933900,914000,921000,28912000,-0.0021668472372697867,-0.036115858460765406,-0.02580024648521804,-0.020301031911660057\n20020903 00:00,907400,913500,881500,882100,47441000,-0.04223669923995654,-0.03678051818852182,-0.026314314234623805,-0.020734819634638895\n20020904 00:00,886200,902500,880600,897500,48415200,0.01745833805690955,-0.036687384232006175,-0.026210018440178343,-0.02062457350569493\n20020905 00:00,884900,894300,875000,884700,48908200,-0.014261838440111418,-0.03672699330062845,-0.0262422449816635,-0.020652864449280665\n20020906 00:00,897500,913700,893500,898600,34957300,0.015711540635243493,-0.03658227846428494,-0.026100303500024007,-0.020512401432771714\n20020909 00:00,891000,920200,882700,908000,32916400,0.010460716670376069,-0.03658882499628987,-0.02609933954214074,-0.02050743366051993\n20020910 00:00,911400,916100,905600,915500,36657700,0.00825991189427322,-0.03657035483418369,-0.026073922938915674,-0.02047831393523813\n20020911 00:00,924700,937000,909200,915000,24306100,-0.0005461496450027692,-0.03657236836607293,-0.02607598150498158,-0.020480396508856982\n20020912 00:00,907500,908400,889900,892600,48311100,-0.024480874316939905,-0.03660839803790348,-0.026103832043215067,-0.020503886781234923\n20020913 00:00,887000,899000,882500,895400,42509400,0.0031369034281873986,-0.03644281280448125,-0.02596249483424198,-0.020375476104371296\n20020916 00:00,893200,898300,884700,897300,24897000,0.0021219566674111068,-0.03644705423622331,-0.025970483615461667,-0.020385462583731282\n20020917 00:00,908900,911900,877500,879700,44418100,-0.019614398751811035,-0.03568261202516438,-0.02539425139820533,-0.01990956441774228\n20020918 00:00,870200,885000,861000,874900,49351800,-0.005456405592815683,-0.03569310693732611,-0.025403556620310845,-0.019918235420481007\n20020919 00:00,860000,868000,847800,848500,44725900,-0.030174877128814726,-0.03591519433695801,-0.0255746278630603,-0.020062110138770267\n20020920 00:00,849200,852000,840500,846600,43886200,-0.0022392457277549127,-0.035540350828545404,-0.02527732865515917,-0.01980614951053653\n20020923 00:00,836500,840700,826900,835900,44616900,-0.012638790455941407,-0.035417657948068317,-0.025180484362894686,-0.019723085005001282\n20020924 00:00,824400,836500,818500,821500,64501200,-0.01722694102165334,-0.03527143916612037,-0.025140696474062564,-0.01974003503146558\n20020925 00:00,833700,847700,820400,841100,56135500,0.02385879488740117,-0.03537010951755102,-0.025193370038140928,-0.01976818787840723\n20020926 00:00,850200,859800,844500,858700,52674900,0.020924979193912785,-0.03541116475076856,-0.025193487616074,-0.019746481743788753\n20020927 00:00,850000,857000,828000,828500,58450400,-0.03516944218003959,-0.035921787305111814,-0.02560749449303691,-0.02010898316064483\n20020930 00:00,820000,828000,800100,816000,69973300,-0.015087507543753764,-0.03597685630836663,-0.02568903114017392,-0.020204629610797855\n20021001 00:00,824400,851000,810900,850000,60049200,0.04166666666666674,-0.03634976600852299,-0.025901473878437616,-0.02033152800544855\n20021002 00:00,846900,855300,825800,830500,54398600,-0.022941176470588243,-0.03658267279476274,-0.026108245579117846,-0.02052436718872401\n20021003 00:00,831400,848400,819500,820500,54268700,-0.012040939193257105,-0.03662718213656236,-0.02617533494069472,-0.020603493875291853\n20021004 00:00,828000,829200,795800,803900,65678900,-0.020231566118220634,-0.03680988292249628,-0.026325433957456557,-0.02073621300954357\n20021007 00:00,800700,812000,785500,788200,49064700,-0.019529792262719226,-0.03699393721542314,-0.026480010028436092,-0.020875074349480528\n20021008 00:00,798100,813100,782000,801100,73542900,0.016366404465871565,-0.036983160502206756,-0.026445452885157917,-0.020827839946930556\n20021009 00:00,790900,798500,777800,780000,78213900,-0.02633878417176383,-0.037246338403697406,-0.026654950197925267,-0.021008720336482486\n20021010 00:00,779400,810700,770700,806600,72425800,0.03410256410256407,-0.03738839601587293,-0.026743529069283564,-0.021068789888997193\n20021011 00:00,821000,847300,801800,839000,74412000,0.04016860897594832,-0.0377137317870946,-0.026944129345336135,-0.021202894134130817\n20021014 00:00,832000,848500,830300,844700,38471500,0.006793802145411254,-0.03767896779075341,-0.026905734072766262,-0.021162563041640155\n20021015 00:00,869900,897500,868600,884200,68613100,0.046762164081922686,-0.03814536652660466,-0.027179549735740643,-0.021333713381074298\n20021016 00:00,874200,882600,859200,863700,57091900,-0.02318479981904542,-0.03839222524482912,-0.02738912729152336,-0.021523416487109898\n20021017 00:00,888700,900300,878500,881800,55143700,0.020956350584693695,-0.038264178940659754,-0.02725141569911539,-0.02138055236530616\n20021018 00:00,871500,891100,869300,886500,45093200,0.005330006804264098,-0.03821842764019441,-0.02720543714569772,-0.021334452664180503\n20021021 00:00,881200,905000,875700,902900,42064100,0.018499717992103815,-0.03825794821045106,-0.027215561336264276,-0.021328905753508973\n20021022 00:00,890500,900100,885200,893200,38383100,-0.010743160925905437,-0.03831495465953995,-0.027286839738194093,-0.02140779248068813\n20021023 00:00,887700,899900,866500,899700,52322200,0.007277205553067656,-0.03828371104963178,-0.027251394961217937,-0.021370108077093504\n20021024 00:00,907000,909000,881000,885800,51738000,-0.01544959430921422,-0.03840649844121572,-0.027355851649376144,-0.021464792735084108\n20021025 00:00,882200,901600,879400,900400,38908200,0.01648227590878304,-0.03841852319666629,-0.027361652234498643,-0.02146727523803586\n20021028 00:00,911500,912900,888300,894200,38074900,-0.006885828520657444,-0.0384665711698157,-0.02740847704830432,-0.021513447990121417\n20021029 00:00,890800,899200,870000,886000,57023000,-0.009170208007157288,-0.03829105668255856,-0.027268382824563116,-0.021392236177795825\n20021030 00:00,886800,899600,882300,894500,38636800,0.00959367945823919,-0.03811394985460742,-0.027110202270026695,-0.021244145149584368\n20021031 00:00,896600,903000,881900,888600,35755600,-0.006595863610955877,-0.03815274291240816,-0.027146064876189886,-0.02127844554282306\n20021101 00:00,883500,908200,880500,905300,48012400,0.018793607922574784,-0.03812147558658807,-0.02712836343950806,-0.021267976031443314\n20021104 00:00,918000,929400,909000,911500,44177600,0.006848558488898648,-0.038119415947947086,-0.02712311780113417,-0.021261031948400892\n20021105 00:00,908400,920700,908400,919700,30931400,0.00899616017553484,-0.03810478218888785,-0.027118514918371864,-0.02126177648867547\n20021106 00:00,924800,930700,900400,927700,63379600,0.008698488637599144,-0.038082211098423975,-0.027110420641054265,-0.021261399746877952\n20021107 00:00,920000,922200,902200,905700,45962500,-0.02371456289748841,-0.03831572600059133,-0.0272996797627642,-0.021427066275784615\n20021108 00:00,905300,915700,895200,898700,36903700,-0.007728828530418452,-0.038369148143014765,-0.027350486124966857,-0.021476478175230688\n20021111 00:00,895200,900300,878000,880500,31852200,-0.020251474351841603,-0.038560274956472886,-0.027510096351998078,-0.021619287026657778\n20021112 00:00,886600,899100,883600,887500,36401700,0.007950028392958552,-0.03854001627511144,-0.027483635751270954,-0.021589520205665624\n20021113 00:00,883200,899000,874500,886800,60231700,-0.000788732394366165,-0.038499198865542754,-0.027478805395360153,-0.021603874414897827\n20021114 00:00,900700,910000,891900,908700,28761400,0.0246955345060893,-0.038593199650854,-0.027518898230731757,-0.021615229121630875\n20021115 00:00,900000,915500,899100,913800,33334000,0.0056124133377353225,-0.038581777702836016,-0.027504095114151455,-0.021598623516601252\n20021118 00:00,921500,926100,903500,905000,25907100,-0.009630115999124556,-0.03863139610941792,-0.027547431150756904,-0.021638610445018757\n20021119 00:00,900200,911000,897600,902300,30986600,-0.0029834254143646932,-0.038649251220755784,-0.027575930744036522,-0.021672784572234004\n20021120 00:00,899800,920700,897400,919400,34245800,0.018951568214562675,-0.03865201697111559,-0.027548610611647612,-0.02162942576707781\n20021121 00:00,926000,965800,924300,939000,54281600,0.021318251033282554,-0.038674962303860125,-0.027533369386713368,-0.02159382742954579\n20021122 00:00,934800,942700,930000,936200,39499700,-0.002981895633652809,-0.038690380282089334,-0.027561688981441134,-0.021629024828289406\n20021125 00:00,934300,942600,927700,938000,32286500,0.0019226660969877685,-0.03869575752788092,-0.027570300054077398,-0.021639359842050523\n20021126 00:00,930700,934500,916200,918500,39862600,-0.020788912579957408,-0.038852856500529165,-0.027697342289817444,-0.021750378942563008\n20021127 00:00,925200,946500,915700,943500,33837800,0.027218290691344516,-0.038810713445956914,-0.02761515259722618,-0.0216468405354274\n20021129 00:00,948000,948000,937100,939800,20285500,-0.0039215686274509665,-0.03883707720911315,-0.027650044496880008,-0.021686278753091644\n20021202 00:00,954700,960500,932200,938900,42283000,-0.0009576505639498079,-0.03883442382540192,-0.02764745385965686,-0.021683721565789113\n20021203 00:00,932500,934000,923500,925500,31785300,-0.014272020449462186,-0.03889456764478003,-0.02769700954893009,-0.02172763276208243\n20021204 00:00,918100,931400,914300,923700,63588800,-0.0019448946515396859,-0.038895166972209405,-0.02771651208534557,-0.02175721252926132\n20021205 00:00,927000,929500,911000,911600,34786300,-0.013099491176788991,-0.03892121286604798,-0.027776842478586215,-0.021835819862271115\n20021206 00:00,901200,921700,899800,918100,47964000,0.007130320315928085,-0.03889836392857068,-0.027749038381461776,-0.021805374187874243\n20021209 00:00,910700,914600,896200,896900,33704600,-0.023091166539592645,-0.03908937124028516,-0.02790251018494449,-0.021938835950810327\n20021210 00:00,900200,911000,897600,909200,31434700,0.01371390344520007,-0.03895240970199552,-0.027769863235025095,-0.021808489091985944\n20021211 00:00,904200,916200,901600,910400,35787600,0.0013198416190056683,-0.03893833690895417,-0.027755636528579788,-0.0217941803348745\n20021212 00:00,912000,914900,902000,907500,33138900,-0.0031854130052724194,-0.03895532811402763,-0.027772371246377908,-0.021810778320255214\n20021213 00:00,899100,910000,893600,895000,34552900,-0.01377410468319562,-0.038917376824598504,-0.027741919098267225,-0.02178432393663251\n20021216 00:00,898200,916800,896600,916800,34515200,0.024357541899441282,-0.03900861987919738,-0.02778370448968246,-0.02179974363081152\n20021217 00:00,913700,917400,907400,909300,31189300,-0.0081806282722513,-0.039064702859544026,-0.027844091309987582,-0.021862424812273115\n20021218 00:00,903400,909000,846600,896400,33084000,-0.014186737050478349,-0.039181035905908886,-0.027952423149389664,-0.02196649123785001\n20021219 00:00,893500,907000,886000,890800,37939400,-0.006247211066488179,-0.03922406060764031,-0.027995871607727735,-0.02201016559926706\n20021220 00:00,892000,900200,891000,896900,27739500,0.006847777278850442,-0.03917518121193239,-0.02794519831714835,-0.02195853598996961\n20021223 00:00,895900,906000,893100,899300,20291700,0.0026758835990634555,-0.03916689797817388,-0.027935926875046844,-0.02194873773765709\n20021224 00:00,896100,900000,892500,893300,11260600,-0.006671855887912859,-0.039204753723361525,-0.02797115855516151,-0.021982570538391123\n20021226 00:00,897700,906100,888400,890300,16532700,-0.0033583342662039106,-0.03922958596026468,-0.027997889117950116,-0.02201031309168493\n20021227 00:00,889600,899800,875200,876800,21248800,-0.015163428057958006,-0.039356983633153986,-0.028112452306177798,-0.02211803426363063\n20021230 00:00,878000,884700,872200,880900,27752900,0.004676094890510907,-0.039353744045114734,-0.028107533547015343,-0.022112220344555792\n20021231 00:00,879900,884300,870800,881800,29418400,0.0010216823703030897,-0.03927519566920434,-0.028037603550171215,-0.02204688477370152\n20030102 00:00,888500,911900,885400,911300,40792000,0.03345429802676336,-0.03948264533972662,-0.028152474352007257,-0.022112402123208242\n20030103 00:00,909100,913900,896800,911300,29192500,0.0,-0.039489578323216874,-0.028169142989319104,-0.02213426080154778\n20030106 00:00,912400,937000,910900,931300,37793700,0.02194666959288938,-0.03955751267288331,-0.028198135111278777,-0.022142492966013946\n20030107 00:00,929000,933700,922000,925600,37236200,-0.006120476752926041,-0.039558019608056966,-0.02819857874223518,-0.02214290284972638\n20030108 00:00,922000,924000,910500,912000,36077300,-0.014693171996542742,-0.03965711928499222,-0.028282341302504857,-0.02221848924985319\n20030109 00:00,918200,931800,910900,930000,31914000,0.019736842105263053,-0.03966633060665109,-0.028259316770661517,-0.02217827990378936\n20030110 00:00,919500,936400,918000,929700,39609900,-0.00032258064516133,-0.03967411649177411,-0.028267809130582508,-0.022187148882811\n20030113 00:00,935500,938600,924400,928800,29576600,-0.0009680542110358514,-0.03961202897374441,-0.02821310565227321,-0.022136381808753665\n20030114 00:00,926900,938300,922000,934400,21777100,0.00602928509905265,-0.039571203095243694,-0.02817064687357145,-0.022093052536996914\n20030115 00:00,935400,935700,915100,921200,32379000,-0.014126712328767166,-0.03968865978188307,-0.02827785891837005,-0.02219480320113819\n20030116 00:00,925000,933300,914600,918300,40043700,-0.003148067737733351,-0.03957543388740062,-0.02818294369044227,-0.022109649321796196\n20030117 00:00,909900,923000,901500,904800,34847000,-0.014701078079059182,-0.039696412818130807,-0.028296677651656,-0.022219521016569085\n20030121 00:00,908700,909200,878800,890300,37621400,-0.01602564102564108,-0.03976816360142293,-0.02835534398969076,-0.0222712120852532\n20030122 00:00,887700,900000,880100,880400,40523500,-0.011119847242502479,-0.0398007588980236,-0.02838278471140546,-0.02229590492216953\n20030123 00:00,887500,894300,879500,890600,42524800,0.011585642889595738,-0.03980763294181424,-0.028383393929497375,-0.022293174384863036\n20030124 00:00,885900,887600,861700,863300,61025800,-0.030653492027846396,-0.04018228101704271,-0.028688034449630303,-0.022560494136421777\n20030127 00:00,857000,869400,845000,850300,57425600,-0.015058496467045046,-0.04029768318851855,-0.028787647208155947,-0.022651689617328854\n20030128 00:00,856900,878500,846500,861200,44568500,0.012819005057038702,-0.04029995216104772,-0.028774758967060842,-0.02263072112173651\n20030129 00:00,854500,871800,847700,867800,48968100,0.007663725034835034,-0.03994793412255257,-0.028482682289838586,-0.02237059896240928\n20030130 00:00,867900,868800,846300,848000,46355700,-0.0228163171237612,-0.04017267460509655,-0.028682129358726917,-0.02255656220607038\n20030131 00:00,841500,862200,841500,858400,50426300,0.01226415094339628,-0.0401634483966829,-0.028678326463461214,-0.0225556504589761\n20030203 00:00,861000,886900,858900,862700,37270000,0.005009319664492029,-0.040124751287601026,-0.028638572236331386,-0.022515332686126537\n20030204 00:00,853100,854400,843000,851400,39714400,-0.013098411962443546,-0.03994530487065507,-0.02849698097778246,-0.022393921872444548\n20030205 00:00,857500,865400,844200,846400,51490200,-0.00587268029128496,-0.039957393196658045,-0.028507798291313096,-0.02240406161392928\n20030206 00:00,843900,852200,836500,841700,52470600,-0.005552930056710759,-0.03995956585027464,-0.02850972564335642,-0.022405858196611575\n20030207 00:00,849100,849900,829700,832900,40984200,-0.010455031483901589,-0.04001343908726118,-0.02855654852341863,-0.02244892255748569\n20030210 00:00,834700,841300,826500,839400,43562000,0.007804058110217227,-0.039994645587323185,-0.02855124275292524,-0.0224508070456509\n20030211 00:00,843700,848800,828300,832100,45084300,-0.008696688110555129,-0.04003591575607848,-0.028607657642642715,-0.022515295530073674\n20030212 00:00,831600,836200,822200,822200,35247100,-0.01189760846052157,-0.04009568829562024,-0.0286587504577374,-0.022561761216182995\n20030213 00:00,821500,829500,810000,821000,47069400,-0.0014594989053757779,-0.040106511507569755,-0.028680131527496138,-0.02258877064087285\n20030214 00:00,823700,839100,818300,838800,57097600,0.02168087697929355,-0.04015259936917618,-0.02868461498315889,-0.022571074941674783\n20030218 00:00,845300,857700,844900,855500,36249100,0.019909394372913614,-0.040128557552127624,-0.028632533414869894,-0.02250404548575432\n20030219 00:00,853200,854700,839000,849300,29998000,-0.007247223845704309,-0.040004646150045384,-0.02853142435459923,-0.022415092269528467\n20030220 00:00,852200,854200,805000,840900,27850500,-0.00989049805722364,-0.04005840173910443,-0.028597820982554832,-0.022488227788544493\n20030221 00:00,843800,857400,834600,853400,63271800,0.01486502556784397,-0.03994615704673869,-0.02848305326848417,-0.02237211506093881\n20030224 00:00,849300,855100,835900,836300,29643900,-0.020037497070541366,-0.04013748549270854,-0.028649868376639548,-0.022525862199411394\n20030225 00:00,829500,844900,822200,843200,53471300,0.008250627765155949,-0.04009052729272532,-0.028629714750422974,-0.022519997992285518\n20030226 00:00,840200,845300,830800,831900,37153800,-0.013401328273244806,-0.04018111644505157,-0.02870788538404733,-0.022591548359541833\n20030227 00:00,837000,855000,829900,841700,48562900,0.011780262050727242,-0.04018403912120214,-0.028698240912349647,-0.022575204387828153\n20030228 00:00,844700,852300,834500,846200,41091800,0.005346322917904267,-0.04015953342277792,-0.02867094741532591,-0.022546424725686638\n20030303 00:00,852600,857800,837200,839300,41103000,-0.00815410068541711,-0.04014570158037456,-0.028696470252464443,-0.0225929273968658\n20030304 00:00,839500,840100,826500,827300,29689500,-0.014297628976528087,-0.04020660658064009,-0.028779371095208346,-0.022687554141844247\n20030305 00:00,826100,835400,823600,835000,41109200,0.00930738547080856,-0.04016831815659453,-0.028734259649052296,-0.022638805367848153\n20030306 00:00,828600,835200,824700,827000,40633100,-0.009580838323353325,-0.040218161168004335,-0.028796783132518603,-0.022708088764046543\n20030307 00:00,816400,840700,814300,833700,61733800,0.008101571946795616,-0.04019132297885295,-0.028763612212220735,-0.02267154188820733\n20030310 00:00,826300,828600,811000,812300,38552200,-0.025668705769461453,-0.04046673519738071,-0.028993779062271574,-0.022877588599743454\n20030311 00:00,814900,820800,805200,805500,47065100,-0.008371291394804858,-0.04052151404024784,-0.02904671745610292,-0.022929545857003995\n20030312 00:00,804100,810100,793800,809700,65050000,0.005214152700186325,-0.040504377748426974,-0.029026162129616756,-0.02290716785578913\n20030313 00:00,821900,838300,815300,837800,68351300,0.03470421143633451,-0.040657581959909754,-0.02908222996108356,-0.022911452642500784\n20030314 00:00,841900,847700,833500,839000,62069400,0.001432322750059667,-0.040652161915015715,-0.029076331441779863,-0.022905299050259783\n20030317 00:00,834600,869500,832200,868300,79922400,0.034922526817640076,-0.040875111652132146,-0.02920270324782788,-0.022980185518620178\n20030318 00:00,871500,873200,861000,871900,48600400,0.004146032477254424,-0.04086470591666,-0.029190227525350766,-0.022966606293730242\n20030319 00:00,873100,881600,866800,879900,46060100,0.009175364147264498,-0.040866450841278906,-0.029186669215527174,-0.022960220849248782\n20030320 00:00,873200,885900,863500,881300,66050700,0.0015910898965791898,-0.04073279148241362,-0.02907129544705819,-0.022854595061358344\n20030321 00:00,887900,898800,877900,897400,65617700,0.018268467037331204,-0.04076392941359695,-0.029073786898509226,-0.02284181518046396\n20030324 00:00,879900,881400,855800,865800,66185400,-0.03521283708491196,-0.04119934209319392,-0.02941745294070689,-0.023136571429751895\n20030325 00:00,867400,886700,855900,876700,59039700,0.012589512589512575,-0.04109229406444594,-0.029310362011646697,-0.023029457630694\n20030326 00:00,875600,878500,862300,872000,44220500,-0.0053610128892437325,-0.04112988406255691,-0.029349833768903513,-0.02306993254678844\n20030327 00:00,864300,885000,859900,871000,51967900,-0.0011467889908256534,-0.04114498736604483,-0.02936785788997011,-0.023089513744898402\n20030328 00:00,864700,872800,862500,865900,31216600,-0.005855338691159617,-0.04118046189336559,-0.029402180070378224,-0.023123221613431385\n20030331 00:00,853500,869600,844000,849800,55166100,-0.018593371059013708,-0.04133427437057623,-0.02953173898041014,-0.023239851036545207\n20030401 00:00,852600,868500,849100,860700,52487500,0.012826547422922996,-0.04129094505858449,-0.0294770809896669,-0.023179153769078767\n20030402 00:00,875600,887700,870500,883900,45771800,0.026954804229115892,-0.04132495975105038,-0.029457654528018008,-0.02313123802591828\n20030403 00:00,888400,889900,878000,878800,46588000,-0.005769883470980841,-0.04135839177944339,-0.02948954685475381,-0.023162309543397947\n20030404 00:00,884300,885900,875700,881200,34027100,0.00273099681383715,-0.04133679709570269,-0.029467396408902433,-0.023139862822821836\n20030407 00:00,903400,909200,881900,882000,65803200,0.0009078529278256919,-0.04134094854462733,-0.029472168865287852,-0.0231449663359867\n20030408 00:00,883000,888900,862000,881100,37497500,-0.0010204081632653184,-0.04130894014364155,-0.02944289175983293,-0.023117145274072735\n20030409 00:00,883600,898100,867700,868600,54266200,-0.014186811939620902,-0.041417292039397625,-0.029549481443280158,-0.023222795528658784\n20030410 00:00,870700,889000,857100,874500,36457100,0.00679253971908822,-0.04118061228397044,-0.029347267349643855,-0.023038954951790758\n20030411 00:00,881900,887100,868600,871700,44797600,-0.0032018296169239457,-0.04120607813335309,-0.029375399738182085,-0.023068508862485897\n20030414 00:00,874700,888700,864600,888500,33088500,0.019272685556957603,-0.04120363721787321,-0.02934396043974283,-0.02302161063339301\n20030415 00:00,888600,894700,883900,894200,41537300,0.00641530669667989,-0.04113690381781739,-0.029315483188721566,-0.023013527593863773\n20030416 00:00,899100,900700,880300,882300,49914000,-0.013307984790874472,-0.04122896609050812,-0.029395327149994575,-0.023086858018531112\n20030417 00:00,883500,897200,872900,896600,35530800,0.016207639125014106,-0.041230728564193506,-0.029374750145866834,-0.02305437192144342\n20030421 00:00,898600,901600,890600,895000,30947000,-0.001784519295114917,-0.04124060423221483,-0.029384735094743104,-0.02306441512753909\n20030422 00:00,891000,915600,888900,915100,55045400,0.022458100558659266,-0.04117837242130182,-0.029297011703985652,-0.022963102269892434\n20030423 00:00,916000,931100,912400,922000,42098700,0.007540159545404768,-0.04112851983417364,-0.029245048592632897,-0.022910014045885076\n20030424 00:00,915300,920800,901800,914200,48770700,-0.008459869848156165,-0.041138704547052735,-0.029253764191356942,-0.0229179464652892\n20030425 00:00,913000,914700,900200,901500,42082300,-0.013891927368190782,-0.0412348081637978,-0.029336166572225333,-0.022993044768010083\n20030428 00:00,904400,921900,901700,918700,44105500,0.019079312257348935,-0.04116302550344625,-0.029247510793930117,-0.02289539399297428\n20030429 00:00,921400,936600,914000,921500,47893600,0.0030477849134646906,-0.04109448794886863,-0.029184416250512782,-0.022835201098665853\n20030430 00:00,919300,925700,913200,918500,43007600,-0.0032555615843733454,-0.041120243853127646,-0.02921793641823438,-0.022872860366509436\n20030501 00:00,919200,927300,905000,919200,47446800,0.000762112139357729,-0.041129288727570205,-0.029233996109894352,-0.02289265963127126\n20030502 00:00,915600,934700,909000,933000,46777300,0.015013054830287142,-0.04112613979055743,-0.029212290112638723,-0.022861060933866393\n20030505 00:00,934700,939700,920500,929500,34390100,-0.0037513397642015,-0.04107900702640861,-0.029171569277551483,-0.022823758274435984\n20030506 00:00,931000,944200,920500,937900,42445700,0.009037116729424532,-0.04089864833469412,-0.029011407136234554,-0.02267436283940319\n20030507 00:00,934200,941400,924000,933300,39303700,-0.004904574048406052,-0.04090601870793562,-0.029018027425383057,-0.022680583261497234\n20030508 00:00,925200,933800,922100,923400,39041600,-0.01060752169720347,-0.04074342510222486,-0.0289588110536232,-0.02267647691063236\n20030509 00:00,928300,938000,922000,937200,32040000,0.014944769330734298,-0.04064486996664729,-0.028855673660595698,-0.022570896733113913\n20030512 00:00,935000,963000,922400,949000,33488000,0.012590695689287168,-0.04051654280699605,-0.028732269052586204,-0.02245011631916984\n20030513 00:00,945300,959700,916000,946400,36510100,-0.002739726027397249,-0.04051390349112217,-0.02875377057755525,-0.02248448723706449\n20030514 00:00,951000,952400,922400,943600,31475800,-0.00295857988165682,-0.04048693945380511,-0.028762619331216783,-0.02251242765707951\n20030515 00:00,948900,953300,942500,951300,43037600,0.008160237388723957,-0.04044963569795434,-0.028721055340422644,-0.022468592550801105\n20030516 00:00,948900,954500,940500,948600,35295200,-0.0028382213812677692,-0.0404753186917875,-0.028751003149280523,-0.022500813916767674\n20030519 00:00,942000,949200,920800,925100,43984300,-0.02477335020029514,-0.04074443589983905,-0.02897808841174372,-0.022705492104567498\n20030520 00:00,928200,942100,916000,924500,52587100,-0.000648578532050581,-0.04065135897535453,-0.02889765214236834,-0.022631794521656888\n20030521 00:00,921100,929200,919100,927800,43595100,0.0035694970254191993,-0.04057235809295413,-0.02882534559290059,-0.02256305669630466\n20030522 00:00,929500,940500,921400,936800,37055000,0.009700366458288423,-0.04057369523104401,-0.028821122685570473,-0.022555869749334843\n20030523 00:00,935300,953600,928600,937200,25718600,0.000426985482493647,-0.04058210214160259,-0.0288384031739772,-0.022577880709257737\n20030527 00:00,933000,958400,931800,956200,40479600,0.020273154075971078,-0.04053432088722621,-0.028767228007611313,-0.022494234334974165\n20030528 00:00,958500,977300,949800,958300,35069300,0.002196193265007418,-0.04047383998091562,-0.028711765996279393,-0.02244144787798408\n20030529 00:00,958800,968200,923200,953700,49556400,-0.0048001669623291,-0.040465636406748,-0.02870454282774054,-0.022434747360058144\n20030530 00:00,959000,970900,951700,969300,46174600,0.01635734507706821,-0.04046508931327343,-0.028682539487819406,-0.02240130577455038\n20030602 00:00,975300,988400,960800,971700,47403200,0.0024760136180748127,-0.04046398727107489,-0.02868127188888121,-0.022399949917926872\n20030603 00:00,971500,979000,968500,977100,31344400,0.005557270762581057,-0.04014434217997898,-0.02841704107391992,-0.02216526024852486\n20030604 00:00,976600,993500,947200,991400,46824600,0.014635144816293133,-0.040148412777743316,-0.028404132098172413,-0.02214329952496729\n20030605 00:00,985800,995900,981400,995600,42870100,0.004236433326608946,-0.040148304824125645,-0.028411266866508526,-0.022154295361576898\n20030606 00:00,1004400,1014000,991300,992200,55486600,-0.0034150261149056282,-0.039982481106191244,-0.02827507133627936,-0.022033894508580936\n20030609 00:00,987800,999200,977700,981100,36095100,-0.011187260632936957,-0.040053644369261315,-0.028336594152775035,-0.02209027803868011\n20030610 00:00,984600,998300,977200,990400,27750200,0.00947915604933236,-0.04004964873804467,-0.028326127008586194,-0.022076360954872174\n20030611 00:00,991600,1011900,982800,1003300,35323300,0.01302504038772212,-0.039909178597152185,-0.028192919507329932,-0.02194702513993221\n20030612 00:00,1007500,1014000,996200,1005200,34887000,0.0018937506229443901,-0.0399174527450879,-0.0282051252267943,-0.02196132676563061\n20030613 00:00,1006000,1007500,989500,994400,43904700,-0.010744130521289308,-0.03991386427247616,-0.028202166407423106,-0.021958703612072063\n20030616 00:00,999600,1016600,998000,1016600,34397800,0.022325020112630822,-0.03994859718044658,-0.028198366831081866,-0.021934362510925086\n20030617 00:00,1020500,1021800,1007300,1016800,34970300,0.0001967342120794413,-0.03984213676481851,-0.02815614755552138,-0.021926389949424707\n20030618 00:00,1012900,1021400,1010000,1015400,33837000,-0.0013768686073957204,-0.03985000057640894,-0.02816386615029352,-0.02193403112964836\n20030619 00:00,1016400,1017300,998400,1000200,41701500,-0.014969470159543086,-0.03983333439705179,-0.0281505256384421,-0.021922463518838357\n20030620 00:00,1003900,1005000,995000,997500,36384800,-0.002699460107978391,-0.03974759020113932,-0.028077846515071447,-0.021856749337295377\n20030623 00:00,994500,996600,979200,983600,33254600,-0.0139348370927318,-0.03966950466662659,-0.02801574598656491,-0.02180317035634182\n20030624 00:00,982200,990900,980200,986500,35363600,0.0029483529890199645,-0.03967339959983289,-0.028020932386718406,-0.021809045232746082\n20030625 00:00,985300,995900,976700,978000,43741400,-0.00861632032437909,-0.03956840340811921,-0.02793583757061322,-0.02173455976633721\n20030626 00:00,977800,990000,969600,988900,30562500,0.011145194274028603,-0.039543038397150086,-0.027901622251606462,-0.021695626380864166\n20030627 00:00,987500,991900,976600,978600,49177600,-0.010415613307715677,-0.03959499114118813,-0.027972255742448365,-0.021776218508703298\n20030630 00:00,982200,989300,967200,976900,29156600,-0.0017371755569179914,-0.03959361330532551,-0.027970963150795294,-0.02177497136042291\n20030701 00:00,972500,988500,964300,985600,48168800,0.008905722182413811,-0.03936063125399086,-0.0277704629665403,-0.02159178713931622\n20030702 00:00,987700,996800,985700,996300,32277800,0.010856331168831224,-0.0391379826858868,-0.027575750627927897,-0.021411967501274075\n20030703 00:00,990700,998500,979000,988000,31558400,-0.008330824048981222,-0.03920692158003042,-0.027642375446315724,-0.02147735869443921\n20030707 00:00,996500,1009000,996100,1007500,26522100,0.019736842105263053,-0.03899731284701743,-0.027515082845383468,-0.021393948518926825\n20030708 00:00,1005000,1012900,1001700,1010200,26654100,0.00267990074441693,-0.03889093616905426,-0.027421885824773982,-0.021307777524884223\n20030709 00:00,1009200,1014000,1000300,1005500,32218300,-0.0046525440506830495,-0.03864593261042691,-0.027225366127419187,-0.021137104394570186\n20030710 00:00,998400,1007700,986300,992100,49644400,-0.013326703132769735,-0.03827109972074182,-0.02693546454193224,-0.020892479373082043\n20030711 00:00,993900,1004500,993900,1001400,32413800,0.009374055034774731,-0.03827115549545851,-0.026935439340847966,-0.02089241100409791\n20030714 00:00,1012000,1019000,996100,1007200,40162200,0.005791891352107115,-0.03820952122825124,-0.026876516610159076,-0.020834933783493534\n20030715 00:00,1013800,1019100,999500,1003800,38640700,-0.003375694996028633,-0.03820627912859504,-0.026873622242617475,-0.02083222479065552\n20030716 00:00,1008100,1008700,977600,997600,36831600,-0.006176529189081514,-0.03809709009216003,-0.0267844144073271,-0.020753668859759402\n20030717 00:00,991500,999800,981600,985100,46981700,-0.012530072173215667,-0.03820767366745127,-0.026882559166778182,-0.020845182532513138\n20030718 00:00,990200,999800,984600,995800,33310400,0.01086184143741753,-0.03782843291829272,-0.026567680703699085,-0.02056461536598481\n20030721 00:00,994500,994900,978500,982400,32513000,-0.013456517372966492,-0.03731406359030675,-0.026173179539797895,-0.020234015476811983\n20030722 00:00,986900,999100,979100,991200,47511800,0.008957654723126929,-0.036896935623830694,-0.025832329288139833,-0.019933828592674833\n20030723 00:00,992100,998300,982800,992300,36864600,0.0011097659402743432,-0.036564449381882864,-0.025564703136545863,-0.019700779115248306\n20030724 00:00,999900,1003400,983700,985000,37033900,-0.007356646175551762,-0.03585255586538772,-0.025138930433557326,-0.0194275363592143\n20030725 00:00,986600,1002900,980400,1002300,39276800,0.01756345177664964,-0.035824682312114546,-0.025091260949201118,-0.019369313737248126\n20030728 00:00,1003700,1009800,996700,1000400,33516100,-0.001895640027935741,-0.03582630973778332,-0.02511394399140546,-0.019403221450716\n20030729 00:00,1001400,1003000,986800,993200,52108100,-0.007197121151539365,-0.035235151239671914,-0.024767206883323095,-0.019186784481231633\n20030730 00:00,996000,997900,989300,991100,27288900,-0.0021143777688280574,-0.03525951178337703,-0.024792944309518162,-0.01921325591838725\n20030731 00:00,999800,1009400,989000,994100,51122000,0.003026939763898673,-0.035264294819928384,-0.02480152283164777,-0.01922385779983428\n20030801 00:00,991900,996800,982400,983800,47944800,-0.010361130670958674,-0.034940789550027496,-0.024549975066634425,-0.01901067031441389\n20030804 00:00,983100,997100,970000,987200,54147600,0.0034559869892254458,-0.03468095953798184,-0.02433627664176099,-0.018821564467962387\n20030805 00:00,984100,988500,968400,968500,51537800,-0.018942463533225262,-0.0343756527633099,-0.024103124643570402,-0.018626877914121456\n20030806 00:00,967100,980600,964200,971000,48456400,0.0025813113061434745,-0.034191489153515726,-0.02400697982621678,-0.01857765558932411\n20030807 00:00,971700,979800,966700,978800,40462700,0.008032955715757018,-0.034136798122858567,-0.023982517813618487,-0.018569308554397302\n20030808 00:00,983200,985500,977600,982200,25756900,0.0034736411932978495,-0.03394057110706498,-0.023877057474512495,-0.01851223559477176\n20030811 00:00,982600,996900,978400,985100,36860500,0.002952555487680808,-0.033940863013345514,-0.023877409229658173,-0.01851261925512599\n20030812 00:00,987100,995600,984200,995400,29867800,0.010455791290224337,-0.03389287761346812,-0.02382419290233855,-0.018456614339742786\n20030813 00:00,998200,998500,985300,988900,34206500,-0.006530038175607822,-0.03369683258094322,-0.02366817677238859,-0.018321937469637554\n20030814 00:00,991000,997500,985100,995400,30134100,0.006572959854383553,-0.03331877314914648,-0.02344116755519472,-0.01817545256292106\n20030815 00:00,993600,997900,991200,995400,11731800,0.0,-0.033327163261176976,-0.023459553655883772,-0.018199167488176085\n20030818 00:00,999300,1007800,997400,1005000,21228600,0.009644364074743894,-0.03330700151680687,-0.02343184646092639,-0.01816743784143087\n20030819 00:00,1006900,1009400,996000,1008200,36117200,0.003184079601989964,-0.033205265979430715,-0.023384894253807617,-0.018149690424958894\n20030820 00:00,1002900,1008900,1001600,1005000,19140800,-0.003173973417972653,-0.03311190512332277,-0.023307360204497266,-0.01808059358778879\n20030821 00:00,1010500,1044500,1002000,1009100,44924100,0.004079601990049753,-0.033099942321377855,-0.023309327045585516,-0.018089986270034504\n20030822 00:00,1017500,1020000,997400,997700,49593900,-0.011297195520761028,-0.033186452830165684,-0.023398964943986716,-0.018181291368266395\n20030825 00:00,997300,1016300,992800,998200,22212200,0.000501152651097625,-0.03291514343913745,-0.02317964038783154,-0.01798967973522383\n20030826 00:00,995000,1004600,988300,1001800,43123200,0.0036064916850331308,-0.032916871454104574,-0.02318601679846875,-0.01799853418839242\n20030827 00:00,1000500,1003600,995700,1002400,17611500,0.0005989219405071466,-0.03278574376653815,-0.023075769216736052,-0.017899417713817534\n20030828 00:00,1004000,1010000,996600,1008500,25828500,0.006085395051875553,-0.03260536310395868,-0.022921348134160198,-0.017758835587284014\n20030829 00:00,1006100,1014600,1000000,1014000,23586600,0.005453644025780857,-0.03259177400687594,-0.022905400134295328,-0.017741630065074575\n20030902 00:00,1016400,1028800,1002800,1027700,46298000,0.01351084812623271,-0.03258234454981708,-0.022880507928254544,-0.017708494724767963\n20030903 00:00,1030300,1037000,1012500,1031900,40191200,0.0040867957575168035,-0.031798887935359066,-0.022272711452785837,-0.017194342019403546\n20030904 00:00,1031000,1035500,1004300,1034300,26062300,0.0023258067642213387,-0.03176647273284911,-0.022267383479344916,-0.017203454147549115\n20030905 00:00,1029400,1205200,1015300,1026700,29648500,-0.00734796480711597,-0.03168622490272701,-0.02220260666041246,-0.017146924867434857\n20030908 00:00,1030400,1038800,1027300,1038000,32461700,0.011006136164410263,-0.031665131236272764,-0.022193162256201607,-0.01714369064182048\n20030909 00:00,1033700,1034600,1026800,1029300,34210600,-0.008381502890173365,-0.03173476728873574,-0.02226430248666976,-0.017215632744017318\n20030910 00:00,1025400,1036000,1015500,1016900,42588100,-0.012047022248129813,-0.031848472880364,-0.02236830496947583,-0.01731446253541446\n20030911 00:00,1021000,1028500,1014200,1022500,34663300,0.005506932835086964,-0.031832337658266784,-0.02234985988404262,-0.017294786070383955\n20030912 00:00,1019100,1026400,1004600,1025200,40924400,0.0026405867970660246,-0.031516086561033683,-0.0220947250075625,-0.017072232025040393\n20030915 00:00,1025200,1026300,1010800,1021200,20062100,-0.003901677721420249,-0.031548797651019554,-0.022126035753561847,-0.017102796252842188\n20030916 00:00,1022300,1036400,1021700,1035500,35237000,0.014003133568351034,-0.031560708421741204,-0.022120645633539052,-0.017088183091981592\n20030917 00:00,1034800,1037900,1025800,1032200,30704300,-0.003186866248189313,-0.03136227790586288,-0.021961247794506995,-0.016949593428544622\n20030918 00:00,1034000,1055000,1031700,1045900,29197800,0.013272621584964117,-0.03132746803734787,-0.021914863141897802,-0.016897038301364704\n20030919 00:00,1042700,1046000,1034000,1038600,24909700,-0.006979634764317844,-0.03093160885040379,-0.02160800521178927,-0.016637626611946035\n20030922 00:00,1028500,1038700,1002900,1024900,33784400,-0.013190833814750613,-0.031038725377018034,-0.02169647342928012,-0.016716153484847084\n20030923 00:00,1025900,1032900,1023600,1030900,29146200,0.005854229680944512,-0.030911770070545623,-0.021585211328330817,-0.01661325737369297\n20030924 00:00,1031200,1032200,1010700,1012000,39700500,-0.018333495004365097,-0.03093017440756599,-0.021599510540223646,-0.016625368158570398\n20030925 00:00,1014100,1018800,1002700,1005900,47503000,-0.006027667984189744,-0.03088541130994445,-0.021602603147679825,-0.016653972465324216\n20030926 00:00,1004400,1006600,998400,1000200,39894100,-0.005666567253206134,-0.03086621052189397,-0.02161993940127461,-0.016690786480622968\n20030929 00:00,1003000,1009900,987500,1008700,34534700,0.00849830033993193,-0.03026890213770222,-0.02114684705102821,-0.01628391323843929\n20030930 00:00,1005300,1007600,959100,998600,66541600,-0.010012887875483267,-0.030201537542998393,-0.021093317478908035,-0.01623775906566506\n20031001 00:00,1002400,1021200,1000100,1020000,61422900,0.021430002002803983,-0.02984800913081554,-0.02086687859174469,-0.016079071134023362\n20031002 00:00,1019300,1028500,1016300,1023200,42650800,0.0031372549019608176,-0.02954647139084438,-0.020623359359148555,-0.015866481353024393\n20031003 00:00,1036700,1042800,1023200,1032600,44559600,0.009186864738076617,-0.02942641124125496,-0.020513793364138746,-0.01576250975298971\n20031006 00:00,1034800,1039900,1032000,1037200,21426800,0.004454774355994617,-0.029171726707391755,-0.020305020162923237,-0.01557821171332411\n20031007 00:00,1032600,1042600,1029100,1041900,39712400,0.004531430775163825,-0.0289277450592945,-0.02010454116919956,-0.01540092382367518\n20031008 00:00,1043300,1043900,1026000,1037100,37406500,-0.004606968039159276,-0.028939868157877947,-0.0201374940654229,-0.015444981007944359\n20031009 00:00,1048800,1052200,1036500,1041700,43192200,0.004435444990839921,-0.02854889007921666,-0.019825276891458528,-0.015174750980836862\n20031010 00:00,1042700,1044800,1039100,1042000,20895700,0.00028799078429497804,-0.02828792787888707,-0.01968007141889079,-0.015091254991507186\n20031013 00:00,1047200,1052900,1017000,1048600,22789900,0.0063339731285989576,-0.027865186016914126,-0.01942050230782994,-0.014918672670173444\n20031014 00:00,1048000,1053600,1036700,1052900,34600000,0.004100705702841934,-0.027866825065719154,-0.019424791885488117,-0.01492437523495554\n20031015 00:00,1058600,1058900,1046400,1050200,36984200,-0.0025643460917466054,-0.027267497488285514,-0.01905837619011409,-0.014682124002069362\n20031016 00:00,1046800,1059800,1046500,1053300,31219000,0.002951818701199871,-0.026943239462020006,-0.018798724846023646,-0.014456914241183925\n20031017 00:00,1054700,1059100,1039800,1042300,32168100,-0.010443368461027225,-0.02695902315648092,-0.018846386442632902,-0.014521569829471441\n20031020 00:00,1044500,1048300,1039400,1047800,25177800,0.005276791710639994,-0.026959045013995517,-0.018846463758773028,-0.014521676710399622\n20031021 00:00,1048700,1052800,1043200,1049600,24689900,0.0017178850925749778,-0.02690243977430681,-0.01882594940896732,-0.014520402280444305\n20031022 00:00,1040300,1045400,1027000,1034000,31485700,-0.014862804878048808,-0.026962126389105487,-0.018872940090476346,-0.014560624806895071\n20031023 00:00,1028900,1039500,1026800,1037400,43512900,0.003288201160541515,-0.026963501091703004,-0.018878549233379983,-0.014568491314257302\n20031024 00:00,1028300,1037600,1021800,1032800,50146300,-0.004434162328899149,-0.02682842568183921,-0.01877023835745796,-0.014474448512343495\n20031027 00:00,1037400,1044400,1032700,1034400,30493800,0.0015491866769945517,-0.026789579783125895,-0.01876013168617492,-0.014479662616860466\n20031028 00:00,1039800,1050700,1038200,1050200,32172100,0.01527455529775712,-0.026763120342253394,-0.01871566233974361,-0.014425592256417371\n20031029 00:00,1047700,1060800,1037300,1052500,30289100,0.002190059036373926,-0.02668038405089377,-0.018643957182950026,-0.014359767756642702\n20031030 00:00,1057900,1059700,1042400,1050900,36716900,-0.001520190023752921,-0.026695593031556896,-0.018667630449715325,-0.014387953303008882\n20031031 00:00,1054000,1057400,1052200,1054200,22457300,0.0031401655723666266,-0.02663813951069352,-0.01861568972812646,-0.014338951434314384\n20031103 00:00,1057500,1066100,1042000,1063200,36184684,0.008537279453614044,-0.02657415937322907,-0.01858237513248324,-0.014321984525545114\n20031104 00:00,1059800,1062700,1038400,1057800,30356338,-0.005079006772009009,-0.026619588021521784,-0.018628361245215767,-0.014368267820507725\n20031105 00:00,1055200,1059700,1049000,1056300,34379600,-0.0014180374361882908,-0.02663496896925407,-0.01865134274461442,-0.014395301145875583\n20031106 00:00,1056400,1064000,1051000,1062600,26891500,0.005964214711729587,-0.026631280891934953,-0.01865191362447369,-0.014398142460047338\n20031107 00:00,1066400,1067200,1056500,1058100,30466600,-0.0042348955392433885,-0.02632759666381384,-0.018414547666572658,-0.014196130526604763\n20031110 00:00,1057300,1067500,1050100,1051800,24000800,-0.005954068613552632,-0.026309885499869567,-0.01839996178676624,-0.014183210724207815\n20031111 00:00,1050800,1053400,1048000,1050800,25833400,-0.0009507510933637331,-0.02605809402671348,-0.018199494829768747,-0.014010104676859623\n20031112 00:00,1052100,1064700,1051600,1063800,26023500,0.012371526456033566,-0.026073876110778466,-0.01820551369493915,-0.014010918806163928\n20031113 00:00,1060100,1065400,1057800,1063500,26263200,-0.0002820078962211259,-0.026071327569787788,-0.018203122679638455,-0.014008611767225673\n20031114 00:00,1064000,1069500,1025600,1055400,47567700,-0.007616361071932309,-0.02599603728658602,-0.018187450444456098,-0.014024721692839262\n20031117 00:00,1049100,1055100,1040400,1048600,43458300,-0.006443054765965517,-0.026054120902772347,-0.018242532988180998,-0.014078204375939766\n20031118 00:00,1052400,1054600,1039000,1039100,34193000,-0.009059698645813463,-0.026047264238714077,-0.018237021855199986,-0.014073410540597207\n20031119 00:00,1040300,1055300,1039200,1047800,27333500,0.008372630160716099,-0.02602109702059742,-0.018205318985075335,-0.014038756634870532\n20031120 00:00,1040000,1056300,1038000,1039000,48251500,-0.008398549341477435,-0.026026164928646744,-0.018240696344718456,-0.014090291851004985\n20031121 00:00,1042400,1049100,1026500,1040400,28252200,0.0013474494706449125,-0.025929488878939613,-0.018195556892561447,-0.014072626368302334\n20031124 00:00,1046800,1057700,1046800,1057200,26789400,0.016147635524798254,-0.025948300663336806,-0.018186620065968093,-0.014048896859867425\n20031125 00:00,1057300,1064200,1040600,1060100,37048100,0.002743094967839532,-0.025946236246521502,-0.018184206676290778,-0.014046297434048671\n20031126 00:00,1064200,1064500,1044000,1064000,43671100,0.0036788982171493956,-0.025666254071213923,-0.01795780071313882,-0.013848452751350125\n20031128 00:00,1062800,1066600,1062000,1065400,10401800,0.001315789473684159,-0.025477261256655916,-0.017854283826972336,-0.01379050276632468\n20031201 00:00,1068500,1076800,1003500,1075700,34785800,0.009667730429885557,-0.02544923834729472,-0.017818672773002985,-0.013750846500542948\n20031202 00:00,1073800,1077700,1070700,1072700,31161900,-0.0027888816584549225,-0.02546024605496913,-0.01782858459391722,-0.01376017410828042\n20031203 00:00,1076500,1080800,1070800,1071100,38845700,-0.001491563344830804,-0.025319481675101212,-0.017714199495339505,-0.0136598517069479\n20031204 00:00,1071700,1077200,1069400,1076800,34806300,0.005321631967136531,-0.025296873897148568,-0.017689767353807635,-0.013634447003942595\n20031205 00:00,1071500,1078000,1000600,1068100,28144500,-0.008079494799405618,-0.02522993447330522,-0.017636601899158787,-0.013588624401303855\n20031208 00:00,1067400,1076400,1066800,1075200,25534900,0.006647317666885089,-0.02522936039413972,-0.017636757477040046,-0.013589168956656805\n20031209 00:00,1079000,1079300,1055200,1066200,41477400,-0.008370535714285698,-0.024968722166052917,-0.017435359670670822,-0.013419351999899342\n20031210 00:00,1067700,1069800,1007000,1065400,30425000,-0.0007503282686175394,-0.024956130120453834,-0.017443270852516658,-0.013438193376428471\n20031211 00:00,1067000,1081000,1066700,1078400,41272400,0.01220198986296217,-0.02496823475041968,-0.01743917915631131,-0.013425467478672131\n20031212 00:00,1079700,1087000,1066500,1081300,32363800,0.00268916913946593,-0.02494003001343646,-0.017412407775592106,-0.013399460214873463\n20031215 00:00,1091700,1094500,1074800,1075200,37584800,-0.0056413576250808894,-0.024836140489559646,-0.017329498081051574,-0.013327734789720951\n20031216 00:00,1076800,1085000,1002400,1081700,31281800,0.0060453869047618625,-0.02468519223391403,-0.017244057097116405,-0.013277215489939669\n20031217 00:00,1080600,1083800,1078000,1083400,22379200,0.0015716002588517242,-0.024613029881196107,-0.017181697605284593,-0.013220081866972959\n20031218 00:00,1085500,1097200,1083900,1096000,27293400,0.011630053535166995,-0.024464808832666322,-0.017046885709646072,-0.013092418341123213\n20031219 00:00,1093000,1097000,1085800,1090400,38548300,-0.005109489051094873,-0.02445395988301237,-0.017037892332457834,-0.01308441416275032\n20031222 00:00,1087900,1094700,1086500,1094600,26487100,0.0038517975055025744,-0.02445437824318627,-0.017041670914341386,-0.013089984066393535\n20031223 00:00,1094800,1099500,1084200,1097900,23343300,0.0030147999269138914,-0.02445360947352794,-0.017040733367842054,-0.013088956545584786\n20031224 00:00,1095200,1098800,1094300,1095800,8102900,-0.0019127425084252137,-0.024413820645928203,-0.01700706812385603,-0.013058555761364285\n20031226 00:00,1097100,1100800,1096300,1096700,8278000,0.0008213177587150788,-0.02438958220148619,-0.01698507145543602,-0.013037754175446416\n20031229 00:00,1101000,1111700,1090000,1111500,18474600,0.013495030546184061,-0.024232366631729382,-0.016840596553676312,-0.012900071276651985\n20031230 00:00,1110900,1112700,1101500,1111700,17554100,0.0001799370220423313,-0.024244687880282327,-0.016854535053769392,-0.012914871927556828\n20031231 00:00,1112300,1115200,1108400,1111500,28056500,-0.00017990465053518978,-0.024250030218646905,-0.016859709201332455,-0.01291995641322596\n20040102 00:00,1117400,1199100,1107300,1110000,35070700,-0.0013495276653171517,-0.02393357732403243,-0.01667641880012853,-0.01280765444452129\n20040105 00:00,1116900,1124500,1111700,1123700,25956100,0.012342342342342327,-0.023941545795347772,-0.01666770516398381,-0.012790047638618001\n20040106 00:00,1121800,1127300,1112300,1126300,18416900,0.0023137848180119214,-0.023826384707854507,-0.01660910296859627,-0.012761596779328543\n20040107 00:00,1123900,1129200,1118900,1129000,27474700,0.002397229867708406,-0.023772530950281662,-0.016561123754651328,-0.012716749262854203\n20040108 00:00,1132600,1134100,1121900,1133200,33802100,0.0037201062887510794,-0.02359655557154137,-0.016415294512947976,-0.012586990815256228\n20040109 00:00,1128200,1139800,1121900,1125100,40552100,-0.007147899752912079,-0.023574491965086767,-0.016430947434251275,-0.012622750277945722\n20040112 00:00,1125500,1131200,1123600,1131100,28825100,0.005332859301395487,-0.023560465257255518,-0.016414455435410362,-0.012604944041589817\n20040113 00:00,1130900,1132300,1111300,1124700,44553600,-0.005658208823269395,-0.023596221152851506,-0.016445189015126593,-0.012633000243294501\n20040114 00:00,1127600,1134200,1126700,1133100,25360700,0.0074686583088823255,-0.023598049354614424,-0.016444808404172093,-0.012631442122453559\n20040115 00:00,1135700,1140600,1125800,1135300,38120800,0.0019415762068661913,-0.023435553396949884,-0.01631123585452262,-0.012513288534592337\n20040116 00:00,1140400,1143100,1130800,1142500,29709700,0.0063419360521448365,-0.02340373386509886,-0.016277705748622095,-0.012478846527995621\n20040120 00:00,1145300,1146500,1138200,1142100,27297000,-0.0003501094091903356,-0.023238731839132564,-0.016144357630211235,-0.012362372990574386\n20040121 00:00,1141300,1153000,1137200,1150600,30519200,0.0074424306102793825,-0.023034258481131355,-0.015972502661036673,-0.012207906763786283\n20040122 00:00,1151400,1153800,1145800,1147300,27978800,-0.002868068833651982,-0.022941787927007327,-0.01589752842297236,-0.012142259747072219\n20040123 00:00,1150000,1153700,1139500,1143600,29245600,-0.0032249629565065385,-0.022959286937753787,-0.015927118261708634,-0.012178295161470464\n20040126 00:00,1143900,1159100,1143900,1158000,28336100,0.012591815320041944,-0.02238964205667141,-0.015474076576811142,-0.011787414208995189\n20040127 00:00,1157500,1165000,1147000,1147000,32571800,-0.00949913644214162,-0.02229889690292118,-0.015403452183396917,-0.011727516118463727\n20040128 00:00,1149800,1153700,1129400,1132300,48424700,-0.012816041848299875,-0.022428480846817193,-0.01552487536507151,-0.011844588827995148\n20040129 00:00,1135600,1138500,1125600,1137500,55569800,0.004592422502870175,-0.022426624066453894,-0.015527132861185653,-0.01184903962967546\n20040130 00:00,1135200,1152900,1130900,1134400,27744000,-0.002725274725274729,-0.02208916264255646,-0.015265173887351158,-0.01162733073258965\n20040202 00:00,1137000,1163600,1131200,1138300,37615300,0.00343794076163606,-0.022069686743528227,-0.015261663702936863,-0.011632331811558505\n20040203 00:00,1137400,1149700,1134400,1139500,22680000,0.001054203637002482,-0.022078520823296966,-0.015272507633807258,-0.011644247186614188\n20040204 00:00,1131900,1139400,1127900,1130300,37534600,-0.008073716542343123,-0.022003722304297868,-0.015213779911736742,-0.011594086746919922\n20040205 00:00,1131700,1135400,1127800,1132600,34498800,0.0020348580023001883,-0.02194946213961314,-0.015166222656943142,-0.011550102788586675\n20040206 00:00,1134200,1146900,1132000,1146600,34866300,0.012360939431396822,-0.021914422172995697,-0.015120622920340242,-0.01149887367767858\n20040209 00:00,1146700,1148700,1142900,1143400,22947000,-0.0027908599337170825,-0.021827541432560032,-0.015050284066129783,-0.011437353241805247\n20040210 00:00,1142800,1151400,1142600,1149000,26564200,0.004897673605037678,-0.021825393478535404,-0.015052143972162533,-0.011441349723204396\n20040211 00:00,1148500,1163900,1050100,1161900,41979200,0.011227154046997478,-0.021745028868468852,-0.014972160702867828,-0.011361569745264095\n20040212 00:00,1159700,1167400,1146400,1156700,25685800,-0.0044754281779842975,-0.021649196388344668,-0.014895773796067357,-0.011295549201648516\n20040213 00:00,1158200,1162000,1147500,1151200,42820400,-0.004754906198668585,-0.021676153955503073,-0.014918665110768784,-0.011316272812211384\n20040217 00:00,1158500,1164300,1157700,1161400,23040800,0.008860319666434968,-0.02155979398877032,-0.014851296021112455,-0.011275020577844755\n20040218 00:00,1162000,1166000,1153500,1156600,26629100,-0.0041329429998278044,-0.02150540701341597,-0.014840790324527325,-0.011287907828598676\n20040219 00:00,1163300,1163900,1150000,1152200,45058400,-0.0038042538474839516,-0.021469618515219516,-0.014811483525206701,-0.011262056398964685\n20040220 00:00,1154500,1155600,1143200,1150000,45242500,-0.001909390730775895,-0.021383562734017873,-0.014741359528964543,-0.011200425578332436\n20040223 00:00,1152200,1156100,1141700,1145500,36514400,-0.003913043478260825,-0.021382544176036904,-0.014762468558813507,-0.011233330743375364\n20040224 00:00,1142700,1149900,1130300,1144500,44472000,-0.0008729812309035134,-0.021091369968654607,-0.014534314220030854,-0.011038772063352307\n20040225 00:00,1144600,1150600,1143200,1149100,28553900,0.004019222367846131,-0.021088377450622562,-0.014537117289308827,-0.011044664738779979\n20040226 00:00,1146100,1152900,1143400,1150400,27040800,0.0011313201636062864,-0.02092623533385697,-0.014405580081380728,-0.010929442894506553\n20040227 00:00,1151900,1160800,1145500,1150800,36024700,0.0003477051460361036,-0.020918893090668862,-0.014413678883601691,-0.010945773260898973\n20040301 00:00,1154300,1163400,1144400,1160700,32675900,0.00860271115745559,-0.020923925215387787,-0.01441345136831454,-0.010942741850986697\n20040302 00:00,1159400,1169700,1151900,1154900,38210300,-0.00499698457827169,-0.02088724153075062,-0.01438384392440136,-0.010916906724819432\n20040303 00:00,1152500,1164000,1142500,1157000,30759200,0.0018183392501516238,-0.020704257051139683,-0.014235729455972285,-0.01078738133032276\n20040304 00:00,1157200,1161000,1150400,1160500,19519800,0.0030250648228176136,-0.020699709506535748,-0.014239817193678776,-0.010796072505076018\n20040305 00:00,1154200,1169500,1150800,1162900,54667200,0.0020680741059888597,-0.020594960958463446,-0.014152212636534888,-0.010717607346058575\n20040308 00:00,1163400,1166200,1152200,1152700,35524500,-0.008771175509502127,-0.020690007860210646,-0.014239030230390352,-0.010800037926327666\n20040309 00:00,1151000,1166500,1049700,1146600,37870300,-0.0052919233104884444,-0.02027032440606352,-0.013918603670900474,-0.010532524850101706\n20040310 00:00,1147200,1156200,1114500,1129800,63572300,-0.0146520146520146,-0.020375737374377326,-0.014000437574870846,-0.01060178884211963\n20040311 00:00,1123900,1156500,1111500,1113500,82967500,-0.014427332271198412,-0.020569247764395625,-0.014160092787527017,-0.01074339598499753\n20040312 00:00,1117300,1127000,1115800,1126900,50845500,0.012034126627750386,-0.020159639830278936,-0.013896831460737929,-0.010558151493052023\n20040315 00:00,1122600,1126900,1109000,1110300,59041900,-0.014730677078711563,-0.020351137480604516,-0.014051019874269172,-0.01069245049050266\n20040316 00:00,1117800,1149300,1108400,1117300,56252100,0.006304602359722633,-0.01989728989817384,-0.013763392994694623,-0.010493435252558317\n20040317 00:00,1122000,1132600,1115600,1130000,37263700,0.011366687550344645,-0.019918399340878343,-0.013769924614911696,-0.010492195489549301\n20040318 00:00,1126700,1139400,1119300,1129100,57846900,-0.0007964601769911983,-0.019925787258736376,-0.013786740358487336,-0.010514037172129443\n20040319 00:00,1124100,1133300,1107000,1112900,42347600,-0.014347710565937422,-0.02010966713248074,-0.013935281964245688,-0.010643740077985778\n20040322 00:00,1105400,1105700,1053500,1097400,59212700,-0.013927576601671321,-0.02019565383591093,-0.01403350659550733,-0.010748488703290664\n20040323 00:00,1102500,1109300,1093600,1096500,50925500,-0.0008201202843083344,-0.019381110395236475,-0.0134175993935623,-0.010238473745203482\n20040324 00:00,1096200,1104700,1088500,1094100,51507700,-0.002188782489740082,-0.019373062872466842,-0.013429088892211095,-0.01026037835767808\n20040325 00:00,1100800,1113000,1097900,1111100,45819300,0.01553788501965081,-0.01938163661391556,-0.013410856355557527,-0.010227855493358796\n20040326 00:00,1109600,1117900,1108000,1111700,34724000,0.0005400054000539445,-0.019372610720272444,-0.013402513689591337,-0.010219877053539047\n20040329 00:00,1116300,1145000,1115800,1124900,42364300,0.011873706935324302,-0.019339121285325393,-0.013358225117433634,-0.010169831501294128\n20040330 00:00,1123000,1130700,1122200,1129700,36690700,0.004267045959640781,-0.01904737679123599,-0.013125371129044777,-0.009968371823583134\n20040331 00:00,1129900,1134000,1116000,1128800,44063000,-0.0007966716827476628,-0.019030492185424512,-0.013129269575191137,-0.009983349637825201\n20040401 00:00,1130700,1181800,1130500,1134900,43460700,0.005403968816442228,-0.01876444669441966,-0.012966213542037506,-0.009875196903562687\n20040402 00:00,1148100,1155500,1120100,1144400,49027100,0.008370781566657826,-0.018712091161253382,-0.012912757054331338,-0.009821153501065142\n20040405 00:00,1144600,1157900,1144400,1153300,28795500,0.007777001048584475,-0.018714913904500904,-0.012908886986969825,-0.009813715521133191\n20040406 00:00,1148300,1151800,1141000,1150800,25102800,-0.002167692707881752,-0.018732900403172468,-0.012925179685927086,-0.009829105261730286\n20040407 00:00,1149400,1149800,1141100,1144900,43731300,-0.0051268682655544184,-0.018767756275781144,-0.012954598365222062,-0.009855625393388842\n20040408 00:00,1154100,1154100,1137400,1142300,45988200,-0.002270940693510304,-0.018599322378727204,-0.012821654490411895,-0.009741601118113969\n20040412 00:00,1145800,1150800,1145000,1148800,22187200,0.005690274008579133,-0.01859752541082063,-0.012821665303306083,-0.009742575652263755\n20040413 00:00,1152600,1153000,1130700,1133100,51934900,-0.01366643454038996,-0.018747837141724236,-0.012940108753682802,-0.00984403024021301\n20040414 00:00,1126100,1143200,1125500,1131900,65752200,-0.001059041567381569,-0.018649268771124192,-0.012894050898623905,-0.009825965546685723\n20040415 00:00,1134500,1137800,1120300,1131700,59058100,-0.00017669405424503015,-0.018659970703336783,-0.012909280838460387,-0.009843609350631624\n20040416 00:00,1134300,1140500,1129800,1137200,42013900,0.004859945215162975,-0.018483220013195897,-0.012763188623167198,-0.00971386105483494\n20040419 00:00,1135500,1166300,1132700,1138900,27015500,0.0014948997537811426,-0.018413849769842446,-0.012731243437964408,-0.009701867029649243\n20040420 00:00,1141100,1143200,1121100,1121400,46026100,-0.01536570374923174,-0.01861111257437528,-0.012886506807840465,-0.009834740656319249\n20040421 00:00,1122000,1129500,1118700,1128100,50401500,0.005974674514000355,-0.018432773417551698,-0.012779573108791633,-0.009765872942590273\n20040422 00:00,1124800,1146700,1122400,1144400,58743900,0.0144490736636822,-0.018483287707780603,-0.012807257938674748,-0.009781387471638339\n20040423 00:00,1144200,1146100,1133400,1144400,28136900,0.0,-0.01840127567549154,-0.012739436537590331,-0.009721131043539876\n20040426 00:00,1145000,1149400,1136000,1139100,30358300,-0.004631247815449102,-0.01825879878383547,-0.012627932285851679,-0.009626138191533897\n20040427 00:00,1142300,1151200,1125200,1142200,42595100,0.00272144675621111,-0.01813988942295605,-0.01256287270107954,-0.00958978572314554\n20040428 00:00,1138800,1143300,1125000,1125800,48133100,-0.014358255997198421,-0.018337032070816005,-0.012722497448241856,-0.009729409816272518\n20040429 00:00,1127200,1135000,1111600,1118400,64784500,-0.006573103570794103,-0.018371594732366506,-0.012750791706767909,-0.009754362412341054\n20040430 00:00,1121700,1123800,1111000,1111300,43933900,-0.006348354792560795,-0.018428511200477827,-0.012799300528861616,-0.009798389149453374\n20040503 00:00,1113900,1147000,1111400,1121400,32438000,0.009088454962656423,-0.018376920351396497,-0.012769710264112909,-0.009780527314804166\n20040504 00:00,1122500,1132600,1116600,1123600,49564600,0.001961833422507553,-0.018343498871124148,-0.012739437999391751,-0.009751933885240384\n20040505 00:00,1124200,1129600,1121600,1125800,31951000,0.001957992168031275,-0.01833385271327392,-0.012740847013906468,-0.009759236371235668\n20040506 00:00,1120200,1129900,1110000,1118500,55153900,-0.00648427784686445,-0.018351624172188597,-0.012755248775891894,-0.00977184176025692\n20040507 00:00,1112200,1125000,1017700,1103000,56597900,-0.013857845328565044,-0.018412073708580036,-0.01280176831319421,-0.00981093526658966\n20040510 00:00,1094400,1103000,1083600,1091300,71688500,-0.0106074342701723,-0.0184708445901421,-0.012873026530133258,-0.009888850435811596\n20040511 00:00,1094600,1100500,1091700,1100100,45139000,0.0080637771465224,-0.01843920539613019,-0.012855918381180428,-0.00987948873321089\n20040512 00:00,1095900,1103000,1080600,1103000,88509300,0.002636123988728256,-0.018413722322014464,-0.01283165113127973,-0.009855869634700339\n20040513 00:00,1097600,1110800,1094400,1101500,55237300,-0.0013599274705349274,-0.01840230617336321,-0.012821720889534014,-0.0098467315244277\n20040514 00:00,1099600,1115400,1092700,1100200,50676700,-0.0011802088061734217,-0.01840910159351309,-0.012837383738228658,-0.009867121566467631\n20040517 00:00,1088900,1098900,1062900,1088500,50323900,-0.010634430103617531,-0.018504724049704355,-0.012914056948849914,-0.009933693004392945\n20040518 00:00,1095100,1099400,1093300,1097000,27587700,0.0078089113458887915,-0.018036463423172038,-0.012545095029611765,-0.00961766685858074\n20040519 00:00,1105000,1111800,1093000,1094100,52483500,-0.002643573381950759,-0.018049774072501946,-0.012556825527442169,-0.009628554983493754\n20040520 00:00,1094500,1098700,1090400,1095200,36316800,0.0010053925600950198,-0.018055255800792196,-0.012563682135982135,-0.009636144535607408\n20040521 00:00,1099700,1105500,1003200,1099300,45668000,0.0037436084733382113,-0.018037444957198116,-0.012558013543361873,-0.009636948932051614\n20040524 00:00,1105200,1109700,1089800,1100900,38977400,0.0014554716637860121,-0.018033686197039215,-0.012554160298103838,-0.009633045317136855\n20040525 00:00,1099200,1119800,1096000,1119200,47273500,0.016622763193750556,-0.017973189367640956,-0.012515629292504065,-0.009606224210924452\n20040526 00:00,1116600,1130000,1109000,1120900,35125400,0.001518942101501164,-0.017974934559325847,-0.012517650530970013,-0.009608392608907935\n20040527 00:00,1125300,1130300,1120600,1127200,42981900,0.005620483540012433,-0.017930391645815294,-0.012474042444920412,-0.009565282875918648\n20040528 00:00,1127400,1129000,1120800,1127100,21270500,-8.871540099364417e-05,-0.017852862557889187,-0.012438343473930946,-0.009551883385485148\n20040601 00:00,1125000,1136300,1118700,1126800,38048600,-0.00026616981634286496,-0.017862207969817974,-0.012448138929494847,-0.009561918757645642\n20040602 00:00,1130300,1137300,1124600,1131200,35038800,0.003904863329783348,-0.01786083045990781,-0.0124490858528196,-0.009564104827726886\n20040603 00:00,1127900,1131900,1120400,1122500,32395900,-0.007690947666195158,-0.017873606233335882,-0.012484072740788603,-0.009610932378670415\n20040604 00:00,1130000,1135800,1126700,1129000,30328600,0.00579064587973277,-0.017875608681391354,-0.012483681832474001,-0.009609265580931005\n20040607 00:00,1134800,1147000,1134200,1146500,29638400,0.015500442869796238,-0.017921464800965042,-0.012494115655767994,-0.009600815909150547\n20040608 00:00,1143700,1149200,1141700,1148500,30447200,0.0017444395987789019,-0.01778942011095881,-0.012385720031280424,-0.00950502751398292\n20040609 00:00,1145200,1148600,1129800,1137700,33968300,-0.009403569873748352,-0.017877179273425955,-0.012469721367614756,-0.009587025567110842\n20040610 00:00,1140400,1143200,1139300,1143000,19793700,0.0046585215786234535,-0.01782931630304233,-0.012445605606272968,-0.00957556935503804\n20040614 00:00,1138400,1138500,1112300,1131900,30710200,-0.00971128608923888,-0.01793564298242096,-0.012534274982687863,-0.009654825688579855\n20040615 00:00,1139600,1144500,1135100,1139500,35119400,0.006714374061312922,-0.017814188712205855,-0.012428105019373742,-0.009556803732718501\n20040616 00:00,1140200,1142000,1137000,1139900,24930800,0.0003510311540149136,-0.017620683475485455,-0.0123168307741963,-0.009489366524855287\n20040617 00:00,1138500,1140700,1133300,1138600,26144700,-0.0011404509167470822,-0.017627508486381394,-0.01232321088197477,-0.0094955094564281\n20040618 00:00,1132700,1142200,1131800,1137100,30286600,-0.0013174073423503074,-0.017627143202205736,-0.012322883483557269,-0.009495202254768083\n20040621 00:00,1137800,1141400,1131800,1133100,21889000,-0.003517720517104861,-0.01744830773534391,-0.012183124670904278,-0.009376275061879434\n20040622 00:00,1131300,1138200,1126700,1137900,35492200,0.004236166269526054,-0.017422696277410006,-0.012156953431598736,-0.009349805405196018\n20040623 00:00,1136100,1148400,1134200,1147000,33526700,0.007997187802091466,-0.01724163756254816,-0.012003439509895249,-0.009210975510801928\n20040624 00:00,1145600,1149300,1142600,1144400,33590600,-0.002266782911944154,-0.01726414565410041,-0.012025416458809165,-0.009232669309540724\n20040625 00:00,1144100,1149400,1139500,1141300,28221300,-0.0027088430618664727,-0.017195823832155236,-0.011970241891663484,-0.009184503495280189\n20040628 00:00,1145200,1146100,1134300,1136800,38803300,-0.003942872163322564,-0.01720110424713299,-0.011991515066592691,-0.009214302351361895\n20040629 00:00,1135300,1141700,1134200,1139900,25858700,0.0027269528501054907,-0.017077856534989146,-0.011889094252435572,-0.009122984279456237\n20040630 00:00,1140700,1147900,1136500,1144500,45402600,0.004035441705412701,-0.017058484861220025,-0.011868686857158766,-0.00910202474487614\n20040701 00:00,1142900,1144100,1125800,1132000,54746200,-0.010921799912625652,-0.01717636211949895,-0.011975081624810912,-0.009202298239263529\n20040702 00:00,1131300,1142000,1126000,1128000,32907500,-0.0035335689045936647,-0.017179013822335013,-0.011993684550992914,-0.00922940470358733\n20040706 00:00,1123700,1177400,1116300,1119600,37407000,-0.007446808510638281,-0.01716644501637476,-0.0119837700722093,-0.009220905236799842\n20040707 00:00,1118100,1125700,1117500,1121400,26849200,0.001607717041800738,-0.01701194488677393,-0.011895604952127301,-0.00916810306483452\n20040708 00:00,1118100,1144500,1112000,1112200,42989300,-0.008204030675940777,-0.01709799439953262,-0.011969099002890912,-0.009234903845267223\n20040709 00:00,1117000,1119400,1113800,1116400,28340700,0.0037762992267578177,-0.017055567035383096,-0.01192930216861981,-0.009196509336740622\n20040712 00:00,1115100,1120400,1110000,1117800,35749900,0.0012540308133286437,-0.016880380843394285,-0.01178848619617145,-0.009074016001149997\n20040713 00:00,1119000,1120200,1116300,1118900,24206700,0.0009840758633028468,-0.016864748705369532,-0.011787186646861673,-0.009080357101849647\n20040714 00:00,1112600,1144100,1111200,1114900,51054000,-0.0035749396728930183,-0.01689423771199803,-0.011818925759152164,-0.009113295737142533\n20040715 00:00,1117400,1119100,1110100,1110400,33439800,-0.004036236433760831,-0.016900258176325393,-0.011823950421556869,-0.009117789541227012\n20040716 00:00,1115700,1119400,1104400,1105300,35916600,-0.0045929394812680435,-0.016882510171803065,-0.01180956072578638,-0.009105190147425463\n20040719 00:00,1107500,1116400,1099900,1104500,38330500,-0.0007237853976296282,-0.01673119768615526,-0.011688850004014545,-0.009000793112740945\n20040720 00:00,1105300,1113100,1102500,1112500,43557500,0.007243096423721118,-0.01670662811630952,-0.011675684724057334,-0.008993707417524296\n20040721 00:00,1118100,1120600,1097600,1097900,50225500,-0.013123595505617924,-0.016699555579914174,-0.011670297042381077,-0.00898921792566436\n20040722 00:00,1094000,1103900,1087700,1100100,68211300,0.0020038254850167636,-0.01668319788236185,-0.011666814981925918,-0.008992599819702294\n20040723 00:00,1096300,1100800,1086900,1089200,47526400,-0.009908190164530484,-0.016793631563617625,-0.011757705758717036,-0.009073072346437434\n20040726 00:00,1091900,1099500,1082100,1088500,47699800,-0.0006426735218508783,-0.016729812203938123,-0.01170477713762487,-0.009025949537787443\n20040727 00:00,1090500,1101100,1089700,1098800,49254500,0.009462563160312465,-0.016627988589327982,-0.01164219949475611,-0.008984293777233107\n20040728 00:00,1095500,1103700,1077200,1100300,64194000,0.0013651255915543281,-0.016612309094679877,-0.011627322657005324,-0.00896984483290423\n20040729 00:00,1105400,1116300,1100000,1105500,49656000,0.004725983822593927,-0.0165398430946873,-0.011562224860951133,-0.008908674999105207\n20040730 00:00,1103200,1108500,1005100,1106700,39101900,0.0010854816824965585,-0.01652319582603342,-0.011546734557142444,-0.008893801468974403\n20040802 00:00,1102000,1136100,1018100,1111000,36502400,0.003885425137797105,-0.01652304682821302,-0.01154563123209726,-0.008892189395616961\n20040803 00:00,1109300,1118500,1100000,1103800,37293400,-0.006480648064806527,-0.016463782671281457,-0.011499217272368557,-0.008852625828467832\n20040804 00:00,1098900,1107500,1004500,1102800,39996100,-0.0009059612248595306,-0.016476649410008745,-0.011513385446904969,-0.008867487793618418\n20040805 00:00,1102700,1109200,1083700,1085200,48165600,-0.01595937613347842,-0.016396634145168336,-0.011453342540409979,-0.008818092077454136\n20040806 00:00,1076300,1104400,1066200,1068300,69832900,-0.015573166236638403,-0.016628848614633446,-0.011638635005819983,-0.00897837059612671\n20040809 00:00,1070200,1102700,1068500,1070100,35622900,0.0016849199663016012,-0.016618118905507514,-0.01163842801197642,-0.008983773222863234\n20040810 00:00,1073100,1180000,1047700,1083600,50445900,0.012615643397813292,-0.016670272350389526,-0.011664675883517502,-0.008996210929114021\n20040811 00:00,1076900,1083300,1047900,1080900,52934600,-0.002491694352159457,-0.016693082763197805,-0.011687132931187064,-0.009018479599135683\n20040812 00:00,1076800,1079500,1067700,1068500,46393500,-0.011471921546859054,-0.01680386889614598,-0.011790955328331467,-0.009118589654490835\n20040813 00:00,1071000,1073500,1065900,1070700,39483400,0.0020589611605053015,-0.01674204974882961,-0.011737261276867734,-0.009069227061561049\n20040816 00:00,1071400,1095300,1070300,1085300,42741600,0.013635939105258288,-0.016800695707038,-0.01177051653706629,-0.009088946634603145\n20040817 00:00,1087500,1092800,1085300,1087100,38877500,0.0016585275960563362,-0.01679506316307776,-0.011764606012347788,-0.009082887919371016\n20040818 00:00,1085200,1101300,1080800,1100800,39425800,0.012602336491583044,-0.0168231701987185,-0.01178104060932312,-0.009093099982485057\n20040819 00:00,1098100,1100200,1083400,1096100,35353700,-0.004269622093023284,-0.01686130499580586,-0.011816668780261112,-0.009127391880298031\n20040820 00:00,1096200,1106300,1004200,1104400,44928200,0.0075723017972813,-0.016843115840137958,-0.011791315691229064,-0.00909821972489808\n20040823 00:00,1105500,1107700,1014600,1102200,32167300,-0.0019920318725099584,-0.016862243144687563,-0.011811897906288008,-0.009119577547365984\n20040824 00:00,1106400,1107300,1098500,1101900,28175700,-0.00027218290691344293,-0.016733009880255684,-0.01170770660547243,-0.00902873602469209\n20040825 00:00,1103300,1112700,1099000,1111200,32871800,0.008439967329158637,-0.016741706510840317,-0.011704626847852265,-0.00901937831809583\n20040826 00:00,1109600,1113100,1103900,1111600,25411100,0.00035997120230391033,-0.016748332013337835,-0.011713085464270336,-0.009028814160761919\n20040827 00:00,1112000,1116300,1103400,1114600,23741200,0.002698812522490046,-0.01674317222850307,-0.011706996128371864,-0.009022229284630982\n20040830 00:00,1112300,1113400,1105100,1105800,24429400,-0.00789520904360308,-0.016821876470502987,-0.011778896508412778,-0.009090502551037716\n20040831 00:00,1106600,1110800,1101000,1110700,39554400,0.00443118104539697,-0.016820103953072204,-0.011778831839715006,-0.00909134833018\n20040901 00:00,1109500,1116400,1104800,1113100,48592800,0.0021607994958134924,-0.01675859153990209,-0.011748533490686,-0.009077690083243982\n20040902 00:00,1112400,1126600,1112400,1125500,38976400,0.011140059293863969,-0.01679500045000082,-0.011766077250886455,-0.00908517690183992\n20040903 00:00,1123000,1128200,1113000,1120900,27059500,-0.00408707241226125,-0.016830430173749765,-0.011798582849278486,-0.00911612365982425\n20040907 00:00,1125700,1131300,1120300,1128100,35207800,0.006423409760014209,-0.016761326161011638,-0.011733713575959344,-0.009053511910419667\n20040908 00:00,1126200,1139300,1116200,1123500,31513900,-0.0040776526903643084,-0.01676246469536624,-0.011752053244903126,-0.009081021440563998\n20040909 00:00,1125700,1128800,1120300,1125000,32230700,0.001335113484646211,-0.01667627038206142,-0.011679813797428301,-0.009016221280426302\n20040910 00:00,1125200,1132700,1120800,1130900,26319500,0.005244444444444385,-0.016524051068319324,-0.011552085465151001,-0.008901548999744501\n20040913 00:00,1132800,1137400,1130100,1132900,40108000,0.001768502962242513,-0.01652369650216736,-0.011556180632748408,-0.008908016303938459\n20040914 00:00,1133000,1136900,1123600,1136100,26316500,0.00282460940948015,-0.01652350414417863,-0.011555830701910333,-0.008907582371597464\n20040915 00:00,1133000,1133600,1123500,1127400,35820600,-0.007657776604172217,-0.01656802409769905,-0.01159167511918576,-0.008938801892602554\n20040916 00:00,1128500,1133700,1128000,1131000,21854300,0.0031931878658861823,-0.01649803083543432,-0.01155475249064444,-0.008919509096528732\n20040917 00:00,1129500,1133600,1126900,1131100,31200400,8.841732979658623e-05,-0.016476946037992737,-0.011536036934904475,-0.00890205657477305\n20040920 00:00,1126900,1129900,1122800,1125200,35149300,-0.005216161258951413,-0.016463215214210066,-0.011547821415466642,-0.008927443169667796\n20040921 00:00,1127500,1134700,1125400,1132400,36802200,0.006398862424457974,-0.016399241993722363,-0.011487036603135374,-0.008868358085926734\n20040922 00:00,1124800,1136000,1115000,1116300,47097600,-0.014217590957258941,-0.016421883611869043,-0.011504239039149572,-0.008882660914072579\n20040923 00:00,1116000,1117000,1110400,1111400,41857200,-0.00438950103018898,-0.016457431406076153,-0.011541281423462188,-0.008920500058840047\n20040924 00:00,1111700,1125800,1110000,1113500,33678500,0.0018895087277308598,-0.01615257955229679,-0.011302225774477216,-0.008716520123166876\n20040927 00:00,1111000,1118000,1105800,1106700,38491500,-0.006106870229007688,-0.01615356132407753,-0.01130301201151071,-0.00871720212135015\n20040928 00:00,1109100,1115100,1098000,1113500,36924500,0.006144393241167334,-0.016103788597399835,-0.011254089951851775,-0.008668733549131209\n20040929 00:00,1112100,1117900,1110000,1117400,31233100,0.00350246969016621,-0.016087402317976576,-0.01124831154038124,-0.008668610152814239\n20040930 00:00,1115500,1119800,1058800,1117400,36058300,0.0,-0.015976185614314357,-0.011158035500211317,-0.008589497502865836\n20041001 00:00,1122700,1135200,1117800,1134900,59600200,0.015661356720959363,-0.0158617303672218,-0.011083815415129672,-0.008536726633771023\n20041004 00:00,1141000,1144400,1134900,1138500,31199200,0.003172085646312439,-0.01586171676930412,-0.01108376531048321,-0.008536657067522532\n20041005 00:00,1138500,1141600,1130000,1138300,35789400,-0.00017566974088711884,-0.015848344300559508,-0.01108519404944486,-0.008545976275543843\n20041006 00:00,1137700,1197900,1136800,1145600,40810300,0.006413072125098784,-0.015853601406281313,-0.011086634617321834,-0.008545382261217982\n20041007 00:00,1143800,1188200,1133600,1133800,35343800,-0.010300279329608975,-0.015976670325398835,-0.011190892618011782,-0.008639612230899768\n20041008 00:00,1131500,1137700,1123500,1125800,49598900,-0.007055918151349427,-0.016006372257467278,-0.011214740354013226,-0.008660339116640036\n20041011 00:00,1127800,1130200,1126400,1128700,18952100,0.0025759459939598273,-0.016006005983105857,-0.011216643016138401,-0.008663451340410522\n20041012 00:00,1122000,1129500,1119400,1125300,37984800,-0.0030123150527154863,-0.016026493808165735,-0.011234965568129805,-0.00868061959334123\n20041013 00:00,1130000,1130700,1113200,1116700,52363600,-0.007642406469385965,-0.01609956587346742,-0.01130287878405813,-0.00874578264575778\n20041014 00:00,1116800,1119300,1105800,1107000,62188900,-0.008686307871406784,-0.01619305155237359,-0.011383842908634378,-0.008820071576053948\n20041015 00:00,1110200,1126700,1105700,1111700,61272300,0.00424570912375799,-0.016171424557959137,-0.0113606348747665,-0.00879602069590373\n20041018 00:00,1109100,1119600,1107000,1118000,41935800,0.005666996491859422,-0.01617509336424744,-0.011360072568199538,-0.008793202798729912\n20041019 00:00,1120200,1144700,1007500,1107200,50433700,-0.009660107334525936,-0.01616138361448885,-0.011349468505906127,-0.008784254366932288\n20041020 00:00,1104000,1108800,1097500,1107100,54179800,-9.031791907510023e-05,-0.01616619269002088,-0.011359107961344112,-0.0087964688800244\n20041021 00:00,1107900,1113200,1102100,1110400,49232000,0.0029807605455696162,-0.016164671467881767,-0.011356564302563144,-0.008793380164052959\n20041022 00:00,1111800,1112500,1009400,1099500,45811600,-0.009816282420749278,-0.016060914588218858,-0.01127733608145742,-0.008727228080061274\n20041025 00:00,1097500,1101200,1093500,1098700,41245600,-0.0007276034561164435,-0.016071441039611355,-0.011289447160011177,-0.00874018391749114\n20041026 00:00,1101300,1114300,1098800,1114000,47990100,0.013925548375352648,-0.01610631140161063,-0.01129275951932416,-0.008726672822345368\n20041027 00:00,1113600,1131000,1111200,1129700,71710400,0.014093357271095064,-0.016179054164704634,-0.011329610184752566,-0.008744389543318893\n20041028 00:00,1127600,1135600,1124900,1131700,52313400,0.001770381517216979,-0.0160882358742731,-0.011281095133345851,-0.00871842619210267\n20041029 00:00,1131200,1160000,1105100,1133800,43958500,0.0018556154457896046,-0.01608881504979334,-0.011281893427061167,-0.008719341296916983\n20041101 00:00,1135600,1138400,1132000,1134900,35382400,0.0009701887458104519,-0.016076968966668825,-0.011270622580765555,-0.008708377107246323\n20041102 00:00,1136600,1145700,1132200,1135000,51994200,8.811349017534553e-05,-0.016083904520829466,-0.011279074354050022,-0.008717637171335276\n20041103 00:00,1150000,1153600,1140000,1147700,72697500,0.01118942731277528,-0.0161066079672809,-0.011292043837705887,-0.008725417515443165\n20041104 00:00,1147800,1166700,1146800,1165500,52191400,0.015509279428421952,-0.016155279748627186,-0.011302523862690742,-0.00871553765643176\n20041105 00:00,1170200,1188400,1164900,1171000,58818600,0.00471900471900466,-0.016140734472503835,-0.011285105353175817,-0.008696587436827545\n20041108 00:00,1170100,1172300,1167200,1170000,31567600,-0.0008539709649871829,-0.016148851075029242,-0.011298770261615984,-0.008713210126620609\n20041109 00:00,1170800,1175000,1167600,1170000,41364900,0.0,-0.016118068912462823,-0.01127208261125716,-0.00868870524556883\n20041110 00:00,1170600,1175500,1167600,1169400,43129500,-0.0005128205128205332,-0.016070439057272557,-0.01123208036643695,-0.008652769251612638\n20041111 00:00,1171800,1181200,1171000,1179900,35989400,0.008978963571061982,-0.01607697202774455,-0.011225156394788048,-0.008638671433913479\n20041112 00:00,1179700,1189900,1173500,1189100,51980800,0.007797270955165692,-0.016037807591512424,-0.011202782521495142,-0.008625248547593762\n20041115 00:00,1185000,1187300,1182300,1186700,33332800,-0.002018333193171351,-0.016048357799562703,-0.011212260538984931,-0.008634154984263157\n20041116 00:00,1183700,1186300,1177300,1177600,37279200,-0.007668323923485265,-0.01604911387928424,-0.01121285553418001,-0.008634664105893237\n20041117 00:00,1183600,1191400,1180700,1184000,52866900,0.005434782608695565,-0.01598665148238741,-0.011154883448816565,-0.008579085788992849\n20041118 00:00,1185300,1188000,1182300,1186600,30321600,0.002195945945945965,-0.015883597127472702,-0.011068933945343652,-0.008502254818530895\n20041119 00:00,1186800,1188700,1114700,1173200,52205900,-0.011292769256699864,-0.016012451324001316,-0.011182901536339447,-0.008608286415201687\n20041122 00:00,1171800,1181200,1170300,1179500,33744100,0.005369928400954738,-0.015921484479725058,-0.011102577427504647,-0.008533635909249677\n20041123 00:00,1179300,1182600,1173700,1179700,39390300,0.00016956337431106583,-0.015925799651010628,-0.011106997760504354,-0.008538112303570057\n20041124 00:00,1182700,1185900,1180400,1185400,27437400,0.004831736882258131,-0.015821877016491723,-0.011046673394971153,-0.00850103001390753\n20041126 00:00,1184900,1189800,1182600,1184000,15774700,-0.0011810359372363965,-0.015835839479242945,-0.011061107349959028,-0.008515715319662111\n20041129 00:00,1187900,1190100,1174800,1181300,57211000,-0.002280405405405417,-0.015857533189857987,-0.011083373570645262,-0.008538286743348857\n20041130 00:00,1180000,1182400,1176400,1177700,44535700,-0.003047490053331048,-0.015882331680564608,-0.011105979686069169,-0.008559724111621939\n20041201 00:00,1181600,1194700,1181000,1194700,46255300,0.014434915513288571,-0.01593650284447851,-0.011138739849007,-0.008581070149166032\n20041202 00:00,1191000,1199500,1104000,1193800,56153800,-0.0007533271951117859,-0.01592248492454105,-0.011126462122744181,-0.008569720113711968\n20041203 00:00,1193100,1201400,1190900,1194300,45404200,0.00041883062489533884,-0.015912414587482666,-0.011117121047918382,-0.008560767805883886\n20041206 00:00,1192200,1196400,1188000,1193400,31421600,-0.0007535795026375469,-0.015921797606202603,-0.011130817685375894,-0.008576764017528823\n20041207 00:00,1194900,1196200,1180500,1180700,46933900,-0.01064186358304009,-0.01596499876828467,-0.011164341953681609,-0.008605129569569539\n20041208 00:00,1182100,1188300,1180100,1186200,41449400,0.004658253578385674,-0.015959187971637936,-0.01116254566176272,-0.008605473395266289\n20041209 00:00,1181400,1194600,1177300,1193000,58418700,0.005732591468555093,-0.015870475713209414,-0.011083426642295446,-0.008531468495991628\n20041210 00:00,1189100,1195600,1188500,1191700,45911300,-0.0010896898575021297,-0.015872444745033826,-0.011085213356598716,-0.008533158017499005\n20041213 00:00,1197600,1203100,1193500,1202900,34960800,0.00939833850801386,-0.015845289231666174,-0.011069272141506218,-0.008523195103320997\n20041214 00:00,1202000,1209600,1201800,1208000,37965000,0.004239753928007239,-0.015845293624685158,-0.011067472717555094,-0.008520434071217727\n20041215 00:00,1207000,1211100,1203100,1209700,44604000,0.0014072847682118361,-0.01579312104654625,-0.0110223899519974,-0.00847913085851282\n20041216 00:00,1207200,1288800,1200400,1207000,48635000,-0.002231958336777695,-0.01581027895554578,-0.011044143802258129,-0.008503334788053646\n20041217 00:00,1194500,1200000,1188800,1194200,68764900,-0.010604805302402598,-0.015938309274992724,-0.011148823031893644,-0.008595565638116153\n20041220 00:00,1197300,1203800,1071400,1192700,43703500,-0.0012560710098811212,-0.015907643456448222,-0.011142120555458436,-0.008601637930688442\n20041221 00:00,1196000,1209200,1188900,1204000,31313000,0.009474302003856794,-0.0158844026561631,-0.011108734629892807,-0.008562843676375533\n20041222 00:00,1203800,1210800,1200500,1209100,28050900,0.004235880398671066,-0.015884720007175467,-0.011108512523974046,-0.008562333987962925\n20041223 00:00,1208700,1212800,1200900,1209900,24642500,0.0006616491605326846,-0.015889627293852716,-0.011114717740953682,-0.008569231126784066\n20041227 00:00,1212200,1213600,1204100,1204200,26711200,-0.004711133151500069,-0.015914483315260537,-0.011135545375356073,-0.008587911242980004\n20041228 00:00,1206200,1213000,1206000,1212500,22136400,0.006892542766982146,-0.015918019481863506,-0.011130987934073465,-0.008579039129282172\n20041229 00:00,1210800,1213300,1209500,1212700,18987600,0.00016494845360814914,-0.01585736710854236,-0.011103599436958374,-0.008569383481487027\n20041230 00:00,1214000,1215700,1212100,1212300,19640700,-0.0003298425002061789,-0.015859690799751306,-0.0111058350227327,-0.00857157209858017\n20041231 00:00,1213000,1216600,1210300,1210400,26981200,-0.0015672688278478564,-0.01586747977613426,-0.011112955038530813,-0.008578335493965842\n20050103 00:00,1215600,1217600,1199000,1200600,52549400,-0.008096497025776639,-0.015939653151642474,-0.011171828758280843,-0.008630119216443572\n20050104 00:00,1204600,1205400,1184400,1187400,63670100,-0.010994502748625679,-0.016020370033139417,-0.01125602866391048,-0.008716175909350199\n20050105 00:00,1187500,1197700,1182900,1183200,60465900,-0.0035371399696816352,-0.016050127613211004,-0.011283870487285136,-0.008742996449918551\n20050106 00:00,1184400,1191500,1180400,1187100,45431000,0.0032961460446248037,-0.016049687162318506,-0.011282514089009541,-0.008741151763482285\n20050107 00:00,1189700,1192300,1181300,1185600,50053400,-0.0012635835228708148,-0.016062762602989715,-0.011297552591772883,-0.008757236767383074\n20050110 00:00,1183400,1194600,1165700,1189400,54407600,0.0032051282051281937,-0.01599151993023675,-0.011235144943622962,-0.008699539038157008\n20050111 00:00,1186500,1187400,1179900,1182900,58837800,-0.005464940306036614,-0.01603851829363271,-0.011280927595207598,-0.008744673598273496\n20050112 00:00,1183900,1188400,1173400,1188000,69071600,0.004311437991377121,-0.01598710365066032,-0.011232985109770204,-0.00869858210717007\n20050113 00:00,1186100,1187300,1175000,1176800,50964900,-0.009427609427609451,-0.01608078786754364,-0.011318866553758501,-0.00878030392180044\n20050114 00:00,1179500,1185300,1177600,1184200,38630900,0.0062882392929979325,-0.016086192110288302,-0.011317634718922286,-0.008775534418561175\n20050118 00:00,1180600,1196000,1179500,1195700,50021700,0.009711197432866081,-0.016107720279273558,-0.011328939584899604,-0.008781389279533997\n20050119 00:00,1194200,1198800,1183900,1184000,48400500,-0.009785063142928818,-0.016210549635146468,-0.011412613477849592,-0.008854851466080269\n20050120 00:00,1179000,1188000,1172900,1175700,68647100,-0.007010135135135154,-0.01626643324911243,-0.01146892708887582,-0.008911394306948213\n20050121 00:00,1177800,1180000,1167400,1168000,59412000,-0.006549289784809065,-0.016304345210400147,-0.011500012254248973,-0.00893884013268034\n20050124 00:00,1170700,1173400,1163700,1164200,56278400,-0.0032534246575341985,-0.016304582939820556,-0.011500213428065334,-0.008939021818839448\n20050125 00:00,1169100,1174700,1164000,1168700,64935300,0.0038653152379315436,-0.016245437920008116,-0.01146853912074996,-0.008921992046707057\n20050126 00:00,1173100,1176000,1168400,1174100,53178500,0.004620518524856676,-0.01614213597216673,-0.011379085189380588,-0.008839920441677437\n20050127 00:00,1171800,1177500,1169800,1174600,51656700,0.0004258581040796905,-0.015977902366657335,-0.01124756966041793,-0.008725846798255948\n20050128 00:00,1174900,1176500,1166100,1171300,57898800,-0.0028094670526136456,-0.015999992974117163,-0.01127179349172366,-0.008751207843300414\n20050131 00:00,1179500,1182500,1171600,1180700,47206900,0.008025271066336659,-0.015993030817374063,-0.011254373532988717,-0.008728212869020365\n20050201 00:00,1182800,1190800,1178200,1189100,46500500,0.00711442364698911,-0.016003346585434466,-0.011257393485674111,-0.008727343449525872\n20050202 00:00,1190600,1195900,1189000,1193400,50686700,0.003616180304431893,-0.016000450143354845,-0.011252367287685174,-0.008721181886542362\n20050203 00:00,1190700,1193900,1185700,1190500,46890200,-0.002430031841796576,-0.015936930174474725,-0.011200894544715019,-0.008676131475126752\n20050204 00:00,1190300,1204300,1189800,1203300,45849500,0.010751784964300626,-0.015973632672435113,-0.011216711905232046,-0.008680815046153489\n20050207 00:00,1202200,1205200,1199600,1202300,45326700,-0.0008310479514668234,-0.015928885973472688,-0.011200409046291632,-0.008679675493078761\n20050208 00:00,1201700,1206500,1200700,1203400,37917800,0.0009149130832570851,-0.015908449367254104,-0.011181651359666953,-0.008661812832277129\n20050209 00:00,1204200,1204900,1192500,1193000,54087900,-0.008642180488615536,-0.01599963012089377,-0.011261860942637604,-0.00873617372476048\n20050210 00:00,1196600,1200200,1192600,1198300,43605900,0.004442581726739281,-0.015956981454407954,-0.011239592988323622,-0.008724770652691052\n20050211 00:00,1197100,1210400,1194600,1207200,50744300,0.007427188517065808,-0.015930548600038306,-0.011207066930444164,-0.00868899633056705\n20050214 00:00,1206800,1208600,1204800,1207800,28958400,0.0004970178926442248,-0.01589331556006943,-0.011174635881806554,-0.008659125205739445\n20050215 00:00,1208000,1214300,1200500,1212000,41621100,0.003477396920019915,-0.015871637123815827,-0.011165565617930582,-0.008656776311904278\n20050216 00:00,1209300,1214600,1206700,1211900,56129400,-8.250825082511959e-05,-0.015843007843995064,-0.011140614604704257,-0.00863378616898885\n20050217 00:00,1212300,1213300,1202400,1202900,57162500,-0.007426355309844035,-0.015885658432931007,-0.011174981510365604,-0.008663737073748418\n20050218 00:00,1201700,1204800,1199000,1203500,43451100,0.000498794579765649,-0.015873180335907382,-0.011163359344682456,-0.008652571201895696\n20050222 00:00,1199000,1209200,1185800,1186700,72140500,-0.013959285417532219,-0.01603546015485974,-0.011289778539593159,-0.008759873230823983\n20050223 00:00,1189700,1195700,1186200,1193300,65275900,0.005561641526923511,-0.016028475435314535,-0.011277359819336988,-0.008744557664896093\n20050224 00:00,1192400,1203200,1189800,1202600,65798900,0.007793513785301354,-0.016042118533435967,-0.011282618673276693,-0.00874534690928653\n20050225 00:00,1202700,1216700,1121800,1213800,56554200,0.0093131548311991,-0.016063862765626866,-0.011288481768026914,-0.008742743828431715\n20050228 00:00,1211600,1216500,1200200,1205400,67296400,-0.00692041522491349,-0.016126406051081163,-0.011341152323573687,-0.008790151268196609\n20050301 00:00,1207800,1219100,1206200,1213000,45300400,0.006304961008793741,-0.016113521026399184,-0.011334713012866598,-0.008787148143758614\n20050302 00:00,1207600,1219300,1200100,1212900,62001600,-8.244023083259222e-05,-0.016076153179281495,-0.011302578846855964,-0.008757804033780087\n20050303 00:00,1216600,1219000,1207000,1213600,59080400,0.0005771291944924872,-0.016079466929843918,-0.011306364734394439,-0.00876184161579346\n20050304 00:00,1220500,1229000,1202400,1225600,52150100,0.009887936717205115,-0.016108704557910504,-0.011319059338015662,-0.008765717194296608\n20050307 00:00,1226500,1232500,1219000,1227800,41887600,0.0017950391644907526,-0.016109179197265486,-0.011319712332440786,-0.008766465269149664\n20050308 00:00,1226700,1230000,1220500,1222000,43070300,-0.004723896400065208,-0.016055736148417928,-0.011277220312339263,-0.008729811201950828\n20050309 00:00,1219600,1222900,1209800,1210100,67756000,-0.009738134206219273,-0.016118936357226835,-0.011327074923490468,-0.008772551324373098\n20050310 00:00,1212100,1262700,1204000,1212000,60990700,0.001570118172051993,-0.015908254719223837,-0.011159253653101461,-0.008627578757363943\n20050311 00:00,1213100,1217200,1201600,1204100,51224300,-0.006518151815181561,-0.01576294978060724,-0.011047320915493283,-0.008533436616627015\n20050314 00:00,1206300,1210600,1202800,1210400,34761900,0.005232123577775916,-0.015714030437366647,-0.011020639516887806,-0.008518610184019997\n20050315 00:00,1214200,1214600,1201300,1201700,56843000,-0.007187706543291483,-0.015569164819751371,-0.010909443116145797,-0.008425362718207747\n20050316 00:00,1197000,1201600,1189000,1191800,74274500,-0.008238329033868674,-0.015651994436479296,-0.010984914055494458,-0.008496910773874657\n20050317 00:00,1193100,1197400,1174900,1194100,61200800,0.0019298540023493516,-0.015607654519656757,-0.010964533507142283,-0.008489302876197768\n20050318 00:00,1191100,1192200,1181000,1188100,54654300,-0.0050247047985930715,-0.015642508684868536,-0.010994092551774137,-0.00851603911164187\n20050321 00:00,1187100,1188800,1177600,1182600,61949700,-0.0046292399629660475,-0.015474888013623829,-0.01086427811469909,-0.008406379038109186\n20050322 00:00,1183600,1189300,1170600,1171300,82219600,-0.009555217317774423,-0.015385409541775728,-0.010795929203225927,-0.008349294217086708\n20050323 00:00,1169500,1190600,1166200,1170600,65916200,-0.0005976265687697158,-0.015384223312523792,-0.010794831829668302,-0.00834824421217093\n20050324 00:00,1174700,1179900,1154300,1171400,52311300,0.000683410216982816,-0.015368712125721695,-0.01078052570446275,-0.008334580500843434\n20050328 00:00,1174200,1179400,1173300,1173600,43073500,0.0018780945876728516,-0.015263363717373375,-0.010721917976577114,-0.008300890056759061\n20050329 00:00,1171400,1179000,1162500,1164200,66357200,-0.008009543285616871,-0.015344272691230586,-0.010789063705974305,-0.008360698651462412\n20050330 00:00,1167900,1181300,1164900,1181200,59611200,0.01460230200996393,-0.015382655524552521,-0.010813030494553073,-0.008376980299931934\n20050331 00:00,1181900,1186600,1100900,1179500,57864400,-0.0014392143582797612,-0.015395760410606809,-0.0108289297934667,-0.008394369290000777\n20050401 00:00,1186200,1197400,1169100,1172200,88516200,-0.0061890631623569,-0.015444548816732287,-0.010869694401346565,-0.008430856440726171\n20050404 00:00,1173500,1178600,1167400,1175900,69490600,0.0031564579423306593,-0.015440701018336443,-0.010869586495501961,-0.008432742257762\n20050405 00:00,1178000,1188200,1171100,1180900,45339100,0.0042520622501913685,-0.015421968781193564,-0.01086112973726729,-0.00842976331931119\n20050406 00:00,1184500,1189500,1181400,1184000,50798500,0.002625116436616226,-0.01540623720906767,-0.01085599564946507,-0.008430278711188312\n20050407 00:00,1184100,1192300,1181200,1191500,45098800,0.0063344594594594295,-0.01539537826182352,-0.010838434171003325,-0.008409144138135677\n20050408 00:00,1191500,1192400,1180800,1181000,60256500,-0.008812421317666796,-0.015446346365445934,-0.010878755770358102,-0.008443790125460378\n20050411 00:00,1182900,1184200,1178300,1181800,40105700,0.000677392040643543,-0.015430780240594343,-0.010864322289417666,-0.008429960452797883\n20050412 00:00,1178900,1190600,1170700,1187600,84091000,0.004907767811812569,-0.015428317532195923,-0.010863490672489788,-0.008429998364697463\n20050413 00:00,1185500,1188000,1171300,1174200,64497900,-0.01128326035702254,-0.015377143935229086,-0.010824537772873925,-0.008397560273619457\n20050414 00:00,1174200,1178700,1161300,1162700,89278600,-0.009793902231306384,-0.015479195133618638,-0.010906847619430799,-0.008469346078562772\n20050415 00:00,1157400,1168200,1141600,1142800,122829900,-0.017115334996129716,-0.015749630765235976,-0.011117751120734405,-0.008648513221481411\n20050418 00:00,1141500,1149600,1139600,1146100,100906500,0.002887644382219001,-0.01574719082024868,-0.011118318716030775,-0.008650684125374276\n20050419 00:00,1150700,1155300,1146200,1152900,62549700,0.0059331646453189,-0.01575167628948993,-0.011116330773055436,-0.008645245230299678\n20050420 00:00,1154000,1159100,1136000,1138200,101141700,-0.012750455373406244,-0.01569084652750372,-0.011070280660558096,-0.00860707409425608\n20050421 00:00,1147900,1177500,1136300,1159900,79793700,0.019065190651906594,-0.015859467853714677,-0.011174287531941648,-0.00867663523886243\n20050422 00:00,1157400,1165000,1142700,1152800,85639700,-0.006121217346322982,-0.01582780196495949,-0.011175810672633707,-0.00869585132834426\n20050425 00:00,1158600,1165000,1152500,1162700,49529900,0.00858778625954204,-0.015842907186914622,-0.011176507716235056,-0.00868886742537944\n20050426 00:00,1159800,1168300,1152200,1152200,69995100,-0.009030704394942801,-0.015901452659894035,-0.011223016826538652,-0.008728959995278415\n20050427 00:00,1148600,1168000,1100000,1156800,81749300,0.003992362437076791,-0.01590204582941273,-0.011221958810252418,-0.008727021737949415\n20050428 00:00,1152700,1156800,1143500,1144000,67658400,-0.011065006915629283,-0.015832020120388125,-0.011168618501399274,-0.008682576354187097\n20050429 00:00,1150800,1157900,1139700,1157000,96786200,0.011363636363636465,-0.015815961132134584,-0.011136412755410743,-0.008641762831397498\n20050502 00:00,1160700,1169800,1155200,1163300,51204700,0.005445116681071838,-0.01575907956626688,-0.011082484693099602,-0.008589409270903582\n20050503 00:00,1160500,1169300,1156900,1162500,79724100,-0.000687698787930846,-0.015744774115838526,-0.011083734589404393,-0.008598951664992745\n20050504 00:00,1166500,1177500,1162200,1176200,76940300,0.011784946236559124,-0.01579457040030331,-0.011107524040980022,-0.008608876970187614\n20050505 00:00,1176600,1197800,1166900,1173600,95099800,-0.00221050841693593,-0.0158129270521198,-0.01112534900088147,-0.00862641848709656\n20050506 00:00,1179300,1191700,1166700,1172000,58802400,-0.0013633265167007913,-0.015764133858727415,-0.011084896552983937,-0.008590412459759273\n20050509 00:00,1172100,1180300,1170500,1180100,40956400,0.006911262798634743,-0.015576986495617914,-0.010928429500202454,-0.008450300966888057\n20050510 00:00,1173800,1199800,1163900,1166900,69692500,-0.011185492754851256,-0.015588064455906325,-0.010936934200365178,-0.008457433871599548\n20050511 00:00,1169300,1182700,1158500,1172000,91441800,0.004370554460536358,-0.015572923093630155,-0.010930521751619343,-0.008455674774357352\n20050512 00:00,1173100,1175900,1159500,1160900,92240500,-0.009470989761092174,-0.015681270231795323,-0.011021203358088566,-0.008536938951246797\n20050513 00:00,1163000,1166500,1148000,1156000,82621400,-0.004220863123438723,-0.01570429493614662,-0.011040808859970871,-0.008554721688944876\n20050516 00:00,1157000,1168500,1156600,1167900,46345300,0.010294117647058787,-0.01572574596211018,-0.01104263717296035,-0.008546089206257318\n20050517 00:00,1164300,1177000,1161600,1175900,56297900,0.006849901532665514,-0.015604695755565261,-0.010936722880952997,-0.008448243814282887\n20050518 00:00,1180600,1198400,1176300,1187900,74431600,0.01020494940045924,-0.01562327946096817,-0.010947077208677809,-0.00845421109121847\n20050519 00:00,1190000,1194100,1187000,1193800,60157700,0.004966748042764646,-0.015601374105858967,-0.010922742062072957,-0.008428580631758185\n20050520 00:00,1193200,1193900,1187400,1191500,44961800,-0.0019266208745183366,-0.015616271959684068,-0.010936684068369507,-0.008442013079274164\n20050523 00:00,1192000,1200400,1191800,1196500,49271200,0.004196391103650887,-0.015616681985034398,-0.010936447625867126,-0.008441432007151611\n20050524 00:00,1194400,1198300,1192000,1196500,48619100,0.0,-0.015621729176285494,-0.010941708225318486,-0.008446806373724863\n20050525 00:00,1193600,1194700,1188300,1193200,46436700,-0.0027580442958629048,-0.015524613208876685,-0.010895571868892695,-0.008427847059275514\n20050526 00:00,1197900,1202100,1177700,1200500,41089000,0.006118002011398005,-0.015528513842804945,-0.01089298349411473,-0.00842179941796738\n20050527 00:00,1200800,1202500,1198000,1201800,22957300,0.0010828821324448956,-0.015527556117598698,-0.010897581219821185,-0.008429358733998698\n20050531 00:00,1200600,1201700,1175100,1194500,37515500,-0.006074222000332807,-0.01557861392218297,-0.010940639901869024,-0.008468153113421322\n20050601 00:00,1195200,1209200,1194000,1205400,67003900,0.009125156969443271,-0.01559442845555824,-0.010940904363935956,-0.008460127890013325\n20050602 00:00,1202300,1208400,1201000,1207100,36378300,0.0014103202256512404,-0.01559629508226104,-0.010945124036377743,-0.00846560196243165\n20050603 00:00,1205500,1208900,1197300,1199400,54879800,-0.006378924695551347,-0.01557804372420305,-0.01093069413445894,-0.008453209264640207\n20050606 00:00,1200100,1202200,1195500,1201400,35188600,0.001667500416875134,-0.015575054103062438,-0.010933373401550837,-0.008458910595072405\n20050607 00:00,1203900,1215100,1200500,1200700,64760100,-0.0005826535708339797,-0.015480043712263138,-0.01088489226511294,-0.008435234031963515\n20050608 00:00,1204500,1239500,1196700,1198500,44024200,-0.0018322645123677317,-0.01549543051419525,-0.010899929426751732,-0.008450084801655702\n20050609 00:00,1197400,1205800,1193400,1204900,55209900,0.005340008343763136,-0.015391206055674895,-0.01080909792967978,-0.008366393042774246\n20050610 00:00,1205700,1206500,1192400,1202100,35179100,-0.00232384430243171,-0.015409951188386598,-0.010830468640029194,-0.008389163438846962\n20050613 00:00,1199500,1210800,1120400,1204900,49436000,0.002329257133349971,-0.015296644129400055,-0.010736357488756275,-0.008305285554946031\n20050614 00:00,1204500,1212000,1203800,1208200,31230400,0.0027388164992945274,-0.015287819306118812,-0.01073473938411265,-0.008307509325341274\n20050615 00:00,1211600,1212400,1202300,1210600,49252400,0.001986426088395943,-0.01528339611642739,-0.01072971082954683,-0.00830215805300093\n20050616 00:00,1211000,1216400,1209200,1214800,43565800,0.003469354039319361,-0.015270820136295132,-0.010715460107541092,-0.008287014532299445\n20050617 00:00,1215400,1219300,1212000,1216000,47977100,0.0009878169245967072,-0.015260238091043621,-0.010705298243463087,-0.008277076665250249\n20050620 00:00,1210800,1221800,1209400,1215000,38514300,-0.000822368421052655,-0.015240330414314543,-0.010688089136746213,-0.008261306156221431\n20050621 00:00,1214900,1216500,1210300,1213000,37130200,-0.0016460905349794386,-0.015255447472077624,-0.010705615742869603,-0.008280117283659709\n20050622 00:00,1216900,1219400,1210700,1213700,37307200,0.0005770816158285896,-0.015243365084046993,-0.010705698596723648,-0.008286685382947726\n20050623 00:00,1213100,1216000,1199700,1200000,58369200,-0.011287797643569242,-0.015366886185368299,-0.010803521474089752,-0.008370808632213822\n20050624 00:00,1198800,1200100,1190500,1190900,54003500,-0.007583333333333386,-0.015422263813732576,-0.010848342966189257,-0.00841000268713119\n20050627 00:00,1189700,1194100,1187500,1190400,47317200,-0.0004198505332101421,-0.015396702247562417,-0.010826174101573497,-0.008389642459160148\n20050628 00:00,1194100,1202400,1193700,1201800,39080800,0.009576612903225756,-0.015425581507035773,-0.01083863067779306,-0.008393344163705565\n20050629 00:00,1203700,1204000,1198100,1199400,39211300,-0.001997004493260124,-0.015442883259743589,-0.010857876574041738,-0.008413626475682013\n20050630 00:00,1202000,1203200,1189500,1190600,58278500,-0.007337001834250456,-0.015382440098365794,-0.010810972723015585,-0.008373940380905142\n20050701 00:00,1194600,1198000,1192100,1195000,45998200,0.0036956156559717623,-0.015352194234784771,-0.010781183451846137,-0.008344394517460786\n20050705 00:00,1192600,1206500,1191900,1204800,47048100,0.008200836820083657,-0.015292144973934184,-0.010720535242493332,-0.008283427010877725\n20050706 00:00,1203900,1206500,1194500,1194900,50628400,-0.008217131474103634,-0.015379906481472508,-0.010794008599093755,-0.008349283407083246\n20050707 00:00,1182900,1204000,1181800,1197700,92297300,0.0023432923257176164,-0.015291119858776497,-0.010718970565644092,-0.008281574695687244\n20050708 00:00,1199700,1213200,1197200,1212200,59162200,0.012106537530266248,-0.015345378110599186,-0.010747650311974123,-0.008296618635386655\n20050711 00:00,1213300,1220600,1213100,1220200,47110000,0.006599571027883222,-0.015350336947642318,-0.010744942372534958,-0.008289823565773964\n20050712 00:00,1219000,1226300,1216400,1222200,48983200,0.0016390755613833186,-0.015348581833227765,-0.010742939985136254,-0.008287689358062386\n20050713 00:00,1222700,1225200,1219900,1223400,40981800,0.0009818360333824216,-0.015320004429032445,-0.010717437037503429,-0.00826382539184669\n20050714 00:00,1229800,1234400,1223700,1227400,57987700,0.0032695765898316242,-0.01528309913493024,-0.010682850109817994,-0.00823047437671944\n20050715 00:00,1227900,1230400,1223600,1227700,54614800,0.00024441909727879185,-0.015246597230849842,-0.010651417939540575,-0.008201744862772982\n20050718 00:00,1225000,1228300,1220500,1222000,48673800,-0.004642828052455861,-0.015278920452970647,-0.010678828028325702,-0.008226535778356806\n20050719 00:00,1227100,1231100,1221700,1230000,55803900,0.00654664484451728,-0.015275493560525585,-0.010677214644068626,-0.008225889168604263\n20050720 00:00,1225900,1238900,1223000,1235400,64521900,0.004390243902439028,-0.015089542618353394,-0.010525377723423324,-0.008092238306603666\n20050721 00:00,1235500,1238900,1224700,1227000,92944900,-0.006799417192812074,-0.01515941372335027,-0.010585013998434084,-0.00814641843162052\n20050722 00:00,1228800,1252500,1226300,1234300,47486400,0.005949470252648803,-0.01504238423687138,-0.010483833552044453,-0.008053687049856656\n20050725 00:00,1234100,1239500,1228500,1229300,52796300,-0.0040508790407518536,-0.015069402879944628,-0.010506899176853088,-0.008074645335255683\n20050726 00:00,1232300,1235300,1229500,1232300,40785000,0.0024404132433091252,-0.015044096201049881,-0.01049716912482182,-0.008073219125367527\n20050727 00:00,1234800,1238500,1230500,1237900,39685200,0.004544347967215812,-0.015042389891618574,-0.010492266876633655,-0.008066613134053933\n20050728 00:00,1239900,1249300,1236400,1245000,44763500,0.005735519831973512,-0.015045023389475363,-0.010492955332404075,-0.0080662646950853\n20050729 00:00,1244100,1246300,1234000,1235600,55057100,-0.007550200803212892,-0.015123673675569188,-0.010558604176694793,-0.008124982518859701\n20050801 00:00,1238000,1240400,1218900,1235500,38117000,-8.09323405632778e-05,-0.015131451070395421,-0.010568714042230962,-0.00813633581590055\n20050802 00:00,1238700,1282800,1237400,1244600,41215300,0.007365439093484527,-0.015075950816393143,-0.01051337650908162,-0.008081085028635797\n20050803 00:00,1242400,1247400,1241000,1246400,34143400,0.0014462477904546578,-0.015065856701912706,-0.010503505019399426,-0.008071332219409774\n20050804 00:00,1242200,1246900,1236000,1236600,44221800,-0.007862644415917885,-0.014893705041421977,-0.010372372173696692,-0.007962066352089604\n20050805 00:00,1234600,1323000,1226700,1227700,45790400,-0.007197153485363095,-0.014720090583577688,-0.010239880391496554,-0.007851496916110132\n20050808 00:00,1231700,1234100,1223800,1224200,44866200,-0.0028508593304553687,-0.014745425929846092,-0.01026306662103344,-0.007873537459469771\n20050809 00:00,1230500,1235900,1228700,1233400,44479300,0.007515111909818684,-0.01469708877032176,-0.010234818924250355,-0.007855999380937497\n20050810 00:00,1238300,1245000,1228200,1231200,71679400,-0.0017836873682504084,-0.014691598752838654,-0.010230114138482337,-0.00785171319929122\n20050811 00:00,1232700,1240300,1222200,1239700,52989200,0.006903833658219671,-0.014544128672269205,-0.010104483302554475,-0.007737724783870567\n20050812 00:00,1235700,1293000,1227500,1232400,50323600,-0.005888521416471781,-0.014604020722171195,-0.010156069039048508,-0.007784882455422465\n20050815 00:00,1232000,1238700,1220200,1236500,35280100,0.003326841934436775,-0.014528505001931629,-0.010114659505951246,-0.007761654804488477\n20050816 00:00,1234400,1235200,1158800,1221300,64281400,-0.01229276182773964,-0.014699775613175857,-0.010251975232070956,-0.007880869306990737\n20050817 00:00,1221900,1228700,1220300,1222900,57832500,0.0013100794235649804,-0.014640065818380793,-0.010222884249850515,-0.007868101100455785\n20050818 00:00,1220400,1225600,1218400,1221100,50023000,-0.001471911031155404,-0.014615697151323126,-0.010202401991305106,-0.007849690671907477\n20050819 00:00,1226300,1228200,1222000,1222700,36682500,0.0013102939972156058,-0.01460461716579689,-0.010201847327005742,-0.00785474701740757\n20050822 00:00,1225800,1232300,1218800,1224700,62703800,0.00163572421689695,-0.01458704613077929,-0.010185206447463804,-0.007838602000307877\n20050823 00:00,1225100,1226100,1216700,1220500,50510600,-0.003429411284396222,-0.014609916841862408,-0.01020504750334643,-0.00785682795821368\n20050824 00:00,1219400,1227300,1211900,1212400,77192900,-0.006636624334289243,-0.014658822089091058,-0.010257152452249563,-0.007910638656239703\n20050825 00:00,1213400,1216700,1212100,1215300,32485000,0.0023919498515341253,-0.014653689456049283,-0.010251161260672829,-0.007904189770284883\n20050826 00:00,1214800,1222400,1206800,1208200,57181200,-0.005842178885871796,-0.01471120747870797,-0.010301758376187763,-0.007951097375810748\n20050829 00:00,1204100,1217800,1203800,1216000,51582300,0.00645588478728687,-0.01463185485243787,-0.010228968865038665,-0.007881806637047321\n20050830 00:00,1212500,1216200,1203900,1211800,70465600,-0.003453947368421084,-0.014661941063487671,-0.010259407777496952,-0.00791243357332138\n20050831 00:00,1211900,1233300,1200000,1223900,92779400,0.009985146063706818,-0.01469464056690385,-0.01027343241506415,-0.007916502709006634\n20050901 00:00,1224900,1231500,1196200,1225400,69968300,0.0012255903260069978,-0.014651536721800229,-0.010254481079742979,-0.007910426987279546\n20050902 00:00,1228300,1228800,1221000,1221300,41648500,-0.003345846254284357,-0.01464425456878585,-0.01024847054057563,-0.00790509434074873\n20050906 00:00,1226700,1237600,1056800,1237500,51230000,0.013264554163596065,-0.014709903106604558,-0.01028693488233736,-0.007929066888181497\n20050907 00:00,1236300,1241300,1228600,1240200,36520600,0.0021818181818182847,-0.014673003393372309,-0.010253568256668769,-0.007897583738419697\n20050908 00:00,1236600,1240000,1233100,1235800,37655700,-0.0035478148685695876,-0.014702913168525218,-0.010280392409792623,-0.00792276295785751\n20050909 00:00,1238300,1247400,1238000,1244800,39081200,0.00728273183362993,-0.014711890914048306,-0.010284370684359306,-0.007924076032956757\n20050912 00:00,1244400,1246700,1242700,1244300,30005200,-0.0004016709511568406,-0.014719617750393535,-0.010292356767609902,-0.007932200319773318\n20050913 00:00,1241300,1244200,1235200,1235500,53748300,-0.0070722494575262695,-0.014794113305462193,-0.01035653409000965,-0.007990877030517573\n20050914 00:00,1237500,1239200,1230200,1231800,46358500,-0.0029947389720760276,-0.014737799488455532,-0.010311296472279005,-0.007951544093635982\n20050915 00:00,1234900,1236500,1229000,1232200,62864900,0.00032472804026628665,-0.014743483022503352,-0.010318649576637647,-0.007959787239749454\n20050916 00:00,1232800,1237400,1228700,1237000,63891100,0.0038954715143646457,-0.014737194652470169,-0.01030977771960899,-0.007949538135363124\n20050919 00:00,1234500,1237000,1226400,1229600,51497100,-0.005982215036378302,-0.014746761885074514,-0.010317432795208045,-0.007956173847138167\n20050920 00:00,1232100,1237000,1218700,1221000,80588800,-0.006994144437215355,-0.014812208204671357,-0.010379276035456077,-0.008016096299117733\n20050921 00:00,1218100,1313700,1208600,1208900,85097800,-0.00990990990990992,-0.01471885989400605,-0.010308266126289706,-0.007956994909132206\n20050922 00:00,1209500,1216600,1204400,1214400,74745900,0.0045495905368517775,-0.01467986868794522,-0.010270305685936685,-0.0079195839661639\n20050923 00:00,1212400,1218900,1209000,1215600,54943900,0.000988142292490224,-0.014682066546785047,-0.010272907514960464,-0.007922401150197945\n20050926 00:00,1220400,1227800,1210000,1214700,57798800,-0.0007403751233958644,-0.014631503706898483,-0.010230918390669634,-0.00788498264196609\n20050927 00:00,1215200,1219900,1210200,1215000,63881400,0.0002469745616202612,-0.014631041498180437,-0.010237447239164877,-0.0078952383971929\n20050928 00:00,1219100,1221200,1212000,1216800,56814200,0.001481481481481417,-0.01463287423281054,-0.010241092448077272,-0.007899849829438527\n20050929 00:00,1215700,1228600,1210800,1228100,60049900,0.00928665351742275,-0.014652891875772452,-0.010244450416696032,-0.00789432658731034\n20050930 00:00,1226100,1229700,1206900,1228200,41435300,8.142659392551543e-05,-0.014546208395249564,-0.010187130852385921,-0.007863322744073172\n20051003 00:00,1229500,1233400,1224500,1226800,44691500,-0.001139879498453067,-0.014559003061495511,-0.010201189963264518,-0.00787805592570664\n20051004 00:00,1227900,1230300,1213300,1213800,56378600,-0.010596674274535367,-0.01468593819572075,-0.010303054212121599,-0.00796655497834314\n20051005 00:00,1213100,1226700,1120900,1196300,104231600,-0.014417531718569743,-0.014895237478174382,-0.010475255356416151,-0.008118979242458416\n20051006 00:00,1197800,1202600,1181700,1191500,136216000,-0.004012371478726018,-0.014803991084821116,-0.010403429634310969,-0.008057506608333754\n20051007 00:00,1197000,1200500,1191300,1196700,58763800,0.004364246747796896,-0.01473264881490247,-0.010339711035933013,-0.007997852161044457\n20051010 00:00,1196900,1197100,1171900,1187700,48756000,-0.007520681875156643,-0.014812083454010201,-0.010407612785854928,-0.008059605770416279\n20051011 00:00,1189900,1193900,1183200,1185400,68192700,-0.0019365159552074962,-0.014803649035618007,-0.010400398597115923,-0.008053042081590203\n20051012 00:00,1183900,1191300,1174100,1178500,97431400,-0.005820819976379288,-0.014778216454287786,-0.010380298822924265,-0.008035785207151258\n20051013 00:00,1174600,1180800,1168800,1177700,89707700,-0.0006788290199406521,-0.01468960221381828,-0.010308335201283334,-0.007972697968795963\n20051014 00:00,1181200,1188100,1175600,1187500,81680900,0.008321304237072225,-0.014708695093233748,-0.010317097084285725,-0.007975952435838075\n20051017 00:00,1187600,1192700,1180000,1190700,68456100,0.0026947368421053053,-0.014703789904214816,-0.010317084055022492,-0.007978547398838269\n20051018 00:00,1189500,1189600,1178700,1179000,66284300,-0.009826152683295564,-0.01470684268652646,-0.010319435562108254,-0.007980525058696024\n20051019 00:00,1175600,1196600,1166500,1196400,108292500,0.014758269720101858,-0.014797546786418765,-0.010366307014995097,-0.008004029489657123\n20051020 00:00,1195100,1198100,1173000,1177200,118135600,-0.016048144433299938,-0.015057055971164857,-0.010571914826624033,-0.008180902678727234\n20051021 00:00,1182700,1187800,1175100,1180200,84104000,0.0025484199796126372,-0.014939720370193307,-0.010474578448660224,-0.008094227812546217\n20051024 00:00,1184400,1200600,1184100,1200400,66492800,0.01711574309439068,-0.015065936913125024,-0.010543077757915058,-0.008131958278097574\n20051025 00:00,1197100,1202400,1189400,1197400,74005400,-0.002499166944351927,-0.015007386570661866,-0.010520772971881266,-0.00812897586407773\n20051026 00:00,1195000,1205400,1191900,1192400,75247300,-0.0041757140471020415,-0.014958858940701893,-0.01050769881945296,-0.00813480182933392\n20051027 00:00,1192100,1193700,1092200,1179700,64586100,-0.01065078832606503,-0.015089910650566161,-0.01061479886991174,-0.008229133338791373\n20051028 00:00,1184200,1199500,1181000,1199000,65048600,0.016360091548698774,-0.015213333945261474,-0.010685204585330833,-0.008271275578877963\n20051031 00:00,1202900,1213000,1179600,1207100,69066300,0.006755629691409526,-0.015219461874926194,-0.010682811879960535,-0.008264340554499195\n20051101 00:00,1205600,1209000,1202200,1203000,62551400,-0.0033965702924364516,-0.015242574050085653,-0.010703204325668928,-0.008283283122500974\n20051102 00:00,1201700,1216600,1200000,1216300,66715600,0.011055694098088154,-0.015241081917163342,-0.010702304769807247,-0.008282699467277617\n20051103 00:00,1221500,1226600,1217500,1221500,77189100,0.004275261037572919,-0.015133864541837447,-0.010639555660041551,-0.008243656225337228\n20051104 00:00,1224000,1224600,1215500,1221100,55536400,-0.00032746623004498154,-0.015139714079451317,-0.010649558041036466,-0.008255872471771912\n20051107 00:00,1224000,1226200,1218500,1224400,45570900,0.0027024813692573257,-0.015129249438026984,-0.010638024655161626,-0.008243769342185155\n20051108 00:00,1219500,1224900,1217900,1220700,36980200,-0.0030218882718066054,-0.01514849362543585,-0.010655144232173694,-0.008259756297256334\n20051109 00:00,1220800,1229500,1200500,1222500,54993400,0.0014745637748831975,-0.015141408747177633,-0.01064782453799275,-0.00825231142357587\n20051110 00:00,1223600,1235200,1210000,1233500,76915500,0.008997955010225045,-0.015141568044944223,-0.010647915092875005,-0.008252365331880854\n20051111 00:00,1233500,1238400,1232800,1236500,33417900,0.002432103769760774,-0.01512565442331783,-0.010642900223826149,-0.008253160547502695\n20051114 00:00,1237600,1240200,1233700,1236700,39706000,0.00016174686615455514,-0.015113595438992305,-0.010631839562174507,-0.008242632087974431\n20051115 00:00,1235700,1240900,1228600,1231600,63667500,-0.004123878062585962,-0.015069086111814622,-0.010596248701555159,-0.008211795628876547\n20051116 00:00,1233900,1235500,1229800,1234700,44039900,0.0025170509905814153,-0.015065072281822463,-0.010596802523313234,-0.008214784448881102\n20051117 00:00,1237600,1246200,1232400,1245300,57967000,0.008585081396290661,-0.015086521156310565,-0.010604540768420535,-0.008215213608198603\n20051118 00:00,1250200,1260600,1243300,1250900,63374300,0.0044969083754917705,-0.014942597223697944,-0.01048442352455458,-0.008107787622012192\n20051121 00:00,1251600,1259100,1249800,1257800,47473900,0.005516028459509048,-0.014943086932029628,-0.010484599935816614,-0.00810779701576568\n20051122 00:00,1255600,1265200,1254200,1263700,60798500,0.004690729845762354,-0.014938877122367706,-0.01047636758913514,-0.008097420269483575\n20051123 00:00,1262500,1274100,1255500,1268800,46390200,0.004035767982907279,-0.014937369661826218,-0.010476227034225738,-0.008098008406908712\n20051125 00:00,1269800,1272200,1268100,1270500,14892900,0.0013398486759141903,-0.01492659241511786,-0.01046567645046383,-0.008087578656324841\n20051128 00:00,1272500,1296900,1255600,1261500,49611900,-0.00708382526564344,-0.014979444032723858,-0.010508629298272504,-0.00812525450658274\n20051129 00:00,1266300,1269800,1260900,1261200,47766200,-0.00023781212841855748,-0.014960630121158313,-0.010492060640666276,-0.008109882785554164\n20051130 00:00,1261400,1265200,1250100,1253300,46009300,-0.006263875673961361,-0.014930198955689561,-0.010494606176831092,-0.008130008079336953\n20051201 00:00,1260200,1273200,1254100,1269100,58131400,0.012606718263783678,-0.014985031724710128,-0.010517845067369082,-0.008136404390161936\n20051202 00:00,1267700,1270800,1265000,1268700,39385200,-0.00031518398865337804,-0.014988163331718492,-0.01052091256297338,-0.008139437708213957\n20051205 00:00,1266400,1269000,1233400,1266400,49820100,-0.0018128793252936148,-0.014994676818329493,-0.010526749369022006,-0.008144913778358685\n20051206 00:00,1270400,1277400,1266000,1267300,52902700,0.0007106759317752065,-0.014865213593451733,-0.0104220147289561,-0.008053361855353403\n20051207 00:00,1267700,1268700,1256800,1261500,62604400,-0.004576659038901587,-0.014905049376687489,-0.0104609162182462,-0.008091765275998218\n20051208 00:00,1262200,1268200,1254800,1260300,56442200,-0.0009512485136742299,-0.014911244231587826,-0.010473066172569547,-0.008107089871788462\n20051209 00:00,1261700,1267800,1258200,1264100,45659800,0.003015155121796287,-0.014899135490551732,-0.010459732821755668,-0.008093103686033441\n20051212 00:00,1267100,1268600,1259600,1265000,46001000,0.0007119689897951975,-0.01487395310063531,-0.010452025277454534,-0.008094711917268071\n20051213 00:00,1264000,1373200,1262900,1271700,81740400,0.005296442687747094,-0.014876618868804828,-0.010452681735760208,-0.008094297219920332\n20051214 00:00,1272000,1280900,1217100,1277600,60029500,0.004639458991900547,-0.014876671839724806,-0.010448961838147154,-0.008088566020052972\n20051215 00:00,1278400,1280000,1271800,1275300,51627500,-0.0018002504696305044,-0.01487357008698897,-0.010446266877891063,-0.008086087919362587\n20051216 00:00,1272700,1285700,1264900,1266000,37921200,-0.007292401787814651,-0.014816911769657732,-0.010402355770410588,-0.008048972302285367\n20051219 00:00,1267300,1268700,1256900,1257800,44974100,-0.006477093206951001,-0.014868292684935435,-0.010444754208266259,-0.008086582214664994\n20051220 00:00,1258600,1262200,1254800,1257700,43769100,-7.950389569089111e-05,-0.014844904319477424,-0.010439323517118466,-0.008090724693243635\n20051221 00:00,1261700,1267600,1258000,1261200,45777800,0.002782857597201316,-0.014843756047897337,-0.010440200742877468,-0.00809268170413921\n20051222 00:00,1263100,1266600,1260800,1266600,29111400,0.004281636536631828,-0.014841205515741595,-0.010434189201340618,-0.008084825111307975\n20051223 00:00,1268000,1268600,1263000,1267500,25865800,0.000710563713879786,-0.014802479865406016,-0.010400505438397597,-0.008053829159877554\n20051227 00:00,1269200,1270500,1254800,1255100,41540500,-0.009783037475345147,-0.014907753359208116,-0.010494324581586027,-0.008141542031138092\n20051228 00:00,1257400,1259900,1255000,1256100,25959800,0.0007967492630069906,-0.01490553706968604,-0.010492023086809098,-0.008139195113755084\n20051229 00:00,1257200,1259600,1252500,1253100,29960700,-0.002388344877000237,-0.014918169520379554,-0.010503347888049925,-0.008149822811911345\n20051230 00:00,1250000,1253100,1245000,1245500,37739700,-0.0060649589019232675,-0.014961474523493515,-0.010539195357667015,-0.008181694698016185\n20060103 00:00,1251000,1270000,1243900,1267500,63518100,0.01766358892011244,-0.01502748918937097,-0.010555925604350494,-0.008172151603193283\n20060104 00:00,1268300,1274900,1267000,1272700,48502600,0.004102564102564044,-0.014888202171102425,-0.01043989205840472,-0.008068514397298523\n20060105 00:00,1271700,1275900,1268800,1272300,45892300,-0.00031429244912395404,-0.014865210832438656,-0.010419889431099871,-0.00805010504096006\n20060106 00:00,1280400,1285800,1272800,1284100,54184700,0.009274542167727828,-0.014892066011247658,-0.010431927703343613,-0.008054244475140498\n20060109 00:00,1284200,1290600,1257800,1289200,40835700,0.0039716532980298425,-0.014878781917559019,-0.010416449252243628,-0.008037596220224251\n20060110 00:00,1284000,1289700,1282600,1288800,39148700,-0.000310269934843288,-0.014887254532605919,-0.010426526443006023,-0.008048528804363204\n20060111 00:00,1290200,1294400,1287300,1293500,46839800,0.003646803227808748,-0.014834740765807042,-0.010378804116506267,-0.00800336077695726\n20060112 00:00,1290800,1292800,1284400,1285900,37854500,-0.00587553150367226,-0.014891587346522997,-0.010430839909531794,-0.00805283195686626\n20060113 00:00,1285700,1289000,1282000,1287200,38762700,0.0010109650828213912,-0.01478254534051868,-0.010341606644178524,-0.007974158657856268\n20060117 00:00,1282000,1284200,1261100,1282500,43754700,-0.0036513362336855204,-0.014808394463796755,-0.010371437968633159,-0.008006112879022883\n20060118 00:00,1275900,1282600,1265300,1277900,66875000,-0.003586744639376249,-0.014808996072803478,-0.010387321983985197,-0.008030143888648495\n20060119 00:00,1280900,1287700,1278100,1283700,69958300,0.004538696298614919,-0.014691952524089362,-0.01028791473022238,-0.007940138478465066\n20060120 00:00,1282800,1284700,1208900,1261200,109067900,-0.017527459686842772,-0.01492240527112899,-0.010463083494319176,-0.008085835555821003\n20060123 00:00,1262100,1268200,1261200,1263300,49334000,0.0016650808753568835,-0.014857681295526995,-0.010407771072178064,-0.00803554039800455\n20060124 00:00,1266300,1271500,1259100,1266200,49548500,0.002295575081136647,-0.014829182057929916,-0.010381169947961887,-0.008009951151008188\n20060125 00:00,1270400,1278800,1258400,1264700,76639000,-0.0011846469752013755,-0.014842078882426973,-0.010396159200048782,-0.008026055868500668\n20060126 00:00,1272800,1276700,1264400,1274100,60096400,0.007432592709733621,-0.014853620926838366,-0.010401051057672575,-0.008027402536155514\n20060127 00:00,1276500,1286600,1274500,1283100,59170500,0.007063809748057537,-0.014859130500186645,-0.010397230110908363,-0.008018607523644828\n20060130 00:00,1284400,1288100,1283500,1285300,31808700,0.0017145974592782665,-0.014835230829779639,-0.010375072600017606,-0.007997378751545714\n20060131 00:00,1283400,1285400,1276500,1279500,61575800,-0.0045125651598848515,-0.014860261233716872,-0.01040734548223466,-0.008033512572134575\n20060201 00:00,1278200,1283500,1277200,1282300,56094500,0.002188354826103911,-0.014849586580831433,-0.010405524402282748,-0.00803641129915287\n20060202 00:00,1281000,1281500,1268000,1271100,74339500,-0.008734305544724319,-0.01494863334251432,-0.010489913056308586,-0.00811298577022577\n20060203 00:00,1266100,1286000,1261400,1264100,77976500,-0.00550704114546452,-0.014979288654877432,-0.010515164992463948,-0.00813535718651876\n20060206 00:00,1264400,1268000,1261700,1265600,42875400,0.0011866149829917738,-0.014939515835345507,-0.010498162817685936,-0.008130493958201401\n20060207 00:00,1263900,1266600,1254000,1255700,69103000,-0.007822376738305992,-0.015012276105568644,-0.010557735567636761,-0.008183036489892513\n20060208 00:00,1258900,1277500,1256000,1266300,54457300,0.00844150672931443,-0.01503003441613984,-0.010561542107686981,-0.008179405392703395\n20060209 00:00,1269100,1373300,1263700,1265000,56317800,-0.0010266129669114221,-0.014945104961333519,-0.01049263941924076,-0.008119046514100295\n20060210 00:00,1264400,1271300,1255500,1268200,60428900,0.0025296442687747778,-0.014943911656019467,-0.010494019447159974,-0.00812179837644412\n20060213 00:00,1265700,1267900,1259500,1264600,42303400,-0.0028386689796562337,-0.014954479302542933,-0.010513425239552732,-0.008145915751696223\n20060214 00:00,1264600,1280300,1261900,1277100,86537400,0.009884548473825694,-0.014983394912050077,-0.010522957283252471,-0.008145114488188568\n20060215 00:00,1276600,1283200,1272400,1281400,78200500,0.0033670033670034627,-0.014983335910607949,-0.010523043896787685,-0.008145278728529388\n20060216 00:00,1283400,1291200,1281800,1290800,54887500,0.007335726549086985,-0.014989255204501725,-0.010518605577876958,-0.008135318804558603\n20060217 00:00,1290700,1299800,1285600,1288800,37046700,-0.0015494267121165528,-0.014926265680662982,-0.01046723674590271,-0.008090144920417555\n20060221 00:00,1291200,1294000,1282900,1285200,42999700,-0.0027932960893854997,-0.014946023592745378,-0.010485033659984346,-0.008106896433721218\n20060222 00:00,1287700,1296500,1286500,1294300,35191400,0.007080610021786393,-0.014750012530524593,-0.010321984707147723,-0.007961419459428408\n20060223 00:00,1292700,1296400,1285400,1290100,38884600,-0.0032449972958356055,-0.014774777017107815,-0.010349732114037426,-0.007990757050095866\n20060224 00:00,1291400,1294800,1287600,1292300,30177200,0.001705294163243165,-0.014760381186353843,-0.010346630942043425,-0.007993677018893456\n20060227 00:00,1294000,1300400,1292800,1296900,32914200,0.0035595449972916082,-0.014732561506050493,-0.010333649404665161,-0.00798860564060334\n20060228 00:00,1291900,1296800,1281300,1282600,68489200,-0.011026293469041604,-0.01480328254886215,-0.010388426020494163,-0.008034882341406662\n20060301 00:00,1286000,1294900,1285000,1293900,43632800,0.008810229221893007,-0.014819431119125535,-0.010396931597803324,-0.008039313467453103\n20060302 00:00,1288800,1294300,1286100,1292200,50923000,-0.0013138573305510048,-0.014826028694497723,-0.010403027942734734,-0.008045142608291228\n20060303 00:00,1286700,1300700,1286500,1289900,62668500,-0.0017799102306144121,-0.014838306905525055,-0.010414449321944758,-0.008056107213629956\n20060306 00:00,1291400,1291800,1278500,1281500,50413500,-0.006512132723466957,-0.014869220073955844,-0.010455371420902273,-0.00810236503641547\n20060307 00:00,1279100,1299000,1274000,1278600,55488700,-0.0022629730784237134,-0.014887784162759946,-0.01047321460902759,-0.00811982391505646\n20060308 00:00,1277000,1284400,1271800,1281700,61905400,0.002424526826216189,-0.014845647955995763,-0.010435112106617956,-0.008083871765512415\n20060309 00:00,1283400,1286800,1275700,1275700,48679100,-0.004681282671451958,-0.014771678115780063,-0.010376932924246591,-0.008034110524408082\n20060310 00:00,1277000,1288400,1273700,1285200,52312300,0.00744689190248482,-0.014784351768798644,-0.010379062226013808,-0.0080306186715402\n20060313 00:00,1288400,1291600,1285300,1288200,41354000,0.002334267040149385,-0.01471919995719887,-0.010322705579871746,-0.00797895069555911\n20060314 00:00,1287100,1302300,1285600,1301200,58883200,0.010091600683123758,-0.01475123690729955,-0.010339708369850117,-0.007987938830406813\n20060315 00:00,1301500,1308600,1298500,1307700,44508400,0.004995388871810613,-0.014677956507792475,-0.01027373251460615,-0.007925857000680683\n20060316 00:00,1309800,1314700,1307100,1310100,55354300,0.0018352833218628906,-0.01458620396301929,-0.01019714809507562,-0.00785735865259077\n20060317 00:00,1306800,1311100,1303800,1305800,41119400,-0.0032821921990687786,-0.014614851028599954,-0.010223462038556841,-0.00788242881731397\n20060320 00:00,1306400,1309000,1302100,1303900,41646100,-0.0014550467146576818,-0.014582074639288633,-0.010196137690069615,-0.007858010931616019\n20060321 00:00,1303400,1309900,1294500,1295900,84262000,-0.00613543983434317,-0.014600560272993597,-0.01021095896507345,-0.007870878750555421\n20060322 00:00,1295100,1305100,1294500,1304200,44408700,0.006404815186356938,-0.01449144113562944,-0.010115252556945217,-0.007782322618752062\n20060323 00:00,1302400,1308800,1296600,1300800,44659100,-0.0026069621223738793,-0.014505345519146205,-0.010127419527761005,-0.007793563381285866\n20060324 00:00,1299900,1305700,1289600,1301500,39306700,0.0005381303813039029,-0.014505885990889263,-0.010127970555970882,-0.007794120037109141\n20060327 00:00,1300300,1302800,1297400,1300800,29317100,-0.000537840952746782,-0.01451464915113615,-0.010136975070173375,-0.0078032532162122924\n20060328 00:00,1299300,1305300,1285500,1292200,76689100,-0.006611316113161125,-0.014493473195584828,-0.010120377108818718,-0.007789095766624036\n20060329 00:00,1294000,1305000,1291400,1302100,53630400,0.007661352731775262,-0.014413246958990687,-0.01007172156804125,-0.007757270446966166\n20060330 00:00,1301100,1309800,1295500,1299500,66169200,-0.001996774441287097,-0.014417182218035349,-0.010075152163478525,-0.007760432008101736\n20060331 00:00,1300300,1302400,1293700,1294900,53878400,-0.0035398230088495852,-0.014386328552874417,-0.010050257255984497,-0.00773871369227089\n20060403 00:00,1300700,1308700,1294900,1296900,57388200,0.0015445208124178489,-0.014388172869434385,-0.010053435138600741,-0.007742602494017173\n20060404 00:00,1297300,1307300,1293600,1305300,52590200,0.006476983576220174,-0.01439538706682948,-0.01005594953039504,-0.0077426114368362615\n20060405 00:00,1306200,1312800,1300000,1310500,47959600,0.003983758522944969,-0.014395697942557161,-0.010054589936602446,-0.007740361321923605\n20060406 00:00,1308500,1312100,1300000,1308200,53606800,-0.0017550553223960597,-0.014405623372268724,-0.010071011683365192,-0.0077602462312681775\n20060407 00:00,1310600,1314000,1293500,1294700,72472900,-0.010319523008714304,-0.014433447923406166,-0.010092437125876,-0.007778260332648589\n20060410 00:00,1297100,1300800,1292600,1296000,38926200,0.0010040936124198208,-0.014432367811291983,-0.010091293642899088,-0.007777083066899247\n20060411 00:00,1298600,1300600,1282500,1286500,70269100,-0.007330246913580196,-0.01450891934670599,-0.010159646210772168,-0.0078410647955147\n20060412 00:00,1287700,1291300,1286100,1288400,40991400,0.001476875242907072,-0.014360371238138415,-0.010039781218915666,-0.007736490667041435\n20060413 00:00,1285900,1292500,1281000,1288600,48734900,0.00015523129462891028,-0.014244661545158998,-0.009946402505979704,-0.007655016516935861\n20060417 00:00,1287900,1299000,1280200,1285200,60813700,-0.0026385224274406704,-0.013965709407727995,-0.009732339211131964,-0.007475545223962662\n20060418 00:00,1289600,1309400,1285400,1307300,87769700,0.01719576719576721,-0.014110924259924627,-0.009818380992547582,-0.0075300420603015865\n20060419 00:00,1307200,1394100,1302400,1309900,79968700,0.0019888319437006974,-0.014106674373885903,-0.009819961317292018,-0.007534730448841141\n20060420 00:00,1310000,1343400,1306000,1311500,84361600,0.0012214672875792143,-0.013920564048587861,-0.009672129125817995,-0.00740730418886906\n20060421 00:00,1317400,1320300,1306200,1311000,68678100,-0.00038124285169649497,-0.013741076559369842,-0.00956782794257806,-0.007343084547135995\n20060424 00:00,1309200,1311400,1303800,1308300,49851200,-0.002059496567505703,-0.013696632657493034,-0.009531682017350128,-0.007311362242554778\n20060425 00:00,1310500,1311200,1299200,1302300,82213100,-0.004586104104563171,-0.013718787317583853,-0.009562660996083978,-0.007347045432904819\n20060426 00:00,1305000,1311400,1302000,1305800,60106700,0.002687552791215575,-0.01360689466679973,-0.009469924560193245,-0.00726452110429048\n20060427 00:00,1299000,1316300,1295900,1311600,125064500,0.00444172155000766,-0.013607650508145665,-0.009469936608066607,-0.007264136638615854\n20060428 00:00,1307900,1317500,1307100,1311400,49519600,-0.00015248551387614384,-0.013461571008102092,-0.009353964877799987,-0.007164215249010284\n20060501 00:00,1314600,1318800,1303200,1305600,59923900,-0.0044227543083726895,-0.013452625284460508,-0.009365991194934043,-0.007187421683479508\n20060502 00:00,1310000,1314600,1307400,1313800,41447200,0.006280637254902022,-0.013456234610492807,-0.009367571904107964,-0.007187920944512667\n20060503 00:00,1312000,1313200,1304500,1308200,56518300,-0.004262444816562683,-0.013486805352417745,-0.00939334265538826,-0.007211132838541589\n20060504 00:00,1310600,1316200,1309700,1312900,39683400,0.003592722825256134,-0.013427767341484568,-0.009361122921034554,-0.007193209828197386\n20060505 00:00,1320400,1328000,1313100,1327100,57102700,0.010815751390052641,-0.01345320285018383,-0.00936396438083984,-0.007184006484141501\n20060508 00:00,1325200,1327700,1323700,1325600,23221100,-0.0011302840780649248,-0.013451647022110663,-0.009362593418226045,-0.007182734072620044\n20060509 00:00,1324300,1327700,1323100,1325300,23312900,-0.0002263126131563098,-0.013448514286754533,-0.009368675722509202,-0.007193728880436718\n20060510 00:00,1324100,1333300,1318900,1324300,61544200,-0.0007545461404965259,-0.013302257240349459,-0.009253138280372431,-0.007094567945664384\n20060511 00:00,1325000,1325500,1305200,1307800,73149600,-0.012459412519821744,-0.013487485550295244,-0.009403669270218417,-0.00722660192255481\n20060512 00:00,1304600,1307800,1291900,1292500,89797700,-0.011699036549931208,-0.013534297660306172,-0.009439358029810222,-0.007256360865197643\n20060515 00:00,1287900,1297100,1286300,1296200,79659600,0.002862669245647931,-0.01349375623630288,-0.009402458559555172,-0.007221402907009547\n20060516 00:00,1297600,1307900,1290100,1293600,55124100,-0.002005863292701693,-0.01347219981409061,-0.00940151553587824,-0.007231448809816553\n20060517 00:00,1286700,1290900,1269500,1272000,128090900,-0.016697588126159513,-0.013757982587681537,-0.009630952976766357,-0.007430848762334054\n20060518 00:00,1273800,1277500,1263600,1263600,79315600,-0.006603773584905714,-0.013785942383651611,-0.009670261935058648,-0.00747620791706529\n20060519 00:00,1268700,1274800,1258300,1269600,117021900,0.0047483380816715215,-0.013785268918739888,-0.009670039657074017,-0.007476226165161977\n20060522 00:00,1262800,1271700,1255000,1269800,100274300,0.0001575299306868505,-0.013773315593457906,-0.009659165218300212,-0.007465926876793505\n20060523 00:00,1271800,1276300,1258100,1259000,72554200,-0.008505276421483687,-0.01387044197785023,-0.00974260430492375,-0.007542069315623275\n20060524 00:00,1256800,1267300,1247600,1260800,156200400,0.001429706115965157,-0.013865844140467199,-0.009737691374971123,-0.007536988410987725\n20060525 00:00,1269200,1276600,1264500,1276300,66999400,0.012293781725888353,-0.013909646139630793,-0.00975116424740181,-0.007534292938183225\n20060526 00:00,1280000,1283700,1275100,1283000,50860100,0.005249549478962612,-0.013905967827408518,-0.00974957304414056,-0.007533814364986221\n20060530 00:00,1279700,1280500,1262600,1262800,62918600,-0.01574434918160561,-0.01416526050351512,-0.009952468361991328,-0.007706644459836566\n20060531 00:00,1265800,1273800,1262000,1273000,79211600,0.008077288565093488,-0.014125176253119306,-0.009907675726402136,-0.007659341801523104\n20060601 00:00,1273800,1289400,1272700,1288200,63881900,0.011940298507462588,-0.014157178118216233,-0.00992703021683511,-0.0076719540233214974\n20060602 00:00,1292500,1294300,1283200,1291300,82438000,0.0024064586244372244,-0.014155639871959662,-0.00992478459864894,-0.007669331307777129\n20060605 00:00,1287900,1288600,1267700,1269000,76881400,-0.017269418415550186,-0.014394092373297815,-0.010106043424416684,-0.007820100396730643\n20060606 00:00,1272100,1279500,1257600,1267500,119624000,-0.0011820330969266601,-0.014405379892021153,-0.010117336847158702,-0.007831396966883175\n20060607 00:00,1269100,1276500,1259100,1259100,99988100,-0.00662721893491125,-0.014463385240972177,-0.010165376473282917,-0.007874123903044336\n20060608 00:00,1255800,1265000,1230000,1261400,193070900,0.0018267016122628377,-0.014447691471228432,-0.01015002664054059,-0.007858957421844804\n20060609 00:00,1263600,1266700,1253400,1255300,83065000,-0.00483589662280004,-0.014487332704832705,-0.01018988446130857,-0.007898930704428323\n20060612 00:00,1258900,1259300,1239800,1240000,87631600,-0.012188321516768852,-0.014633650354400672,-0.010304806241524911,-0.00799711546286668\n20060613 00:00,1237800,1248400,1226700,1227300,165108700,-0.010241935483870979,-0.01475808940723331,-0.010407405185294951,-0.00808807152530987\n20060614 00:00,1228400,1236300,1223400,1234900,125590200,0.0061924549824818875,-0.014766256321026974,-0.010409164834981334,-0.008086415486209305\n20060615 00:00,1239000,1263600,1238700,1259700,114459700,0.02008259778119692,-0.014977473408732234,-0.010537470216321034,-0.00817052094368168\n20060616 00:00,1251900,1255600,1244600,1250000,80280600,-0.007700246090338925,-0.015057859038792368,-0.010607291681340045,-0.00823471069140759\n20060619 00:00,1254000,1257500,1235500,1238200,89643700,-0.009440000000000004,-0.015163332925679894,-0.01069398958818982,-0.00831139919277554\n20060620 00:00,1240100,1248000,1237200,1238800,61113900,0.0004845743821677573,-0.015157657722360746,-0.01068845761270656,-0.008305943571521606\n20060621 00:00,1240000,1257000,1239600,1251300,70609600,0.010090410074265366,-0.015178948589693844,-0.010689867911622514,-0.008296755612977963\n20060622 00:00,1249500,1250600,1240400,1244500,79935200,-0.005434348277791101,-0.015224455629140718,-0.010729032038255957,-0.008332538356261089\n20060623 00:00,1243300,1252900,1240300,1243900,49241400,-0.00048212133386904554,-0.015089788447584351,-0.010621253639418819,-0.00823909426799567\n20060626 00:00,1245400,1250500,1242500,1250400,34554300,0.005225500442157749,-0.015014165515813506,-0.010552894076459485,-0.008174606780073285\n20060627 00:00,1250100,1252900,1237700,1238700,64263700,-0.009357005758157344,-0.015113843653586074,-0.01063376120515293,-0.008245445829432565\n20060628 00:00,1241800,1247100,1236500,1245800,58413400,0.005731815613142732,-0.015088487010703923,-0.01062030220419878,-0.00823832941736568\n20060629 00:00,1251900,1272800,1251700,1272300,92067200,0.021271472146412007,-0.015303140983112579,-0.010745024926804268,-0.0083151101234715\n20060630 00:00,1274700,1276600,1269700,1270100,45804900,-0.0017291519295763447,-0.015243537233599107,-0.010696362819876397,-0.008272280965718923\n20060703 00:00,1274300,1280100,1273100,1279000,23592200,0.007007322258089976,-0.015253683456059073,-0.01069968694126621,-0.00827196825027189\n20060705 00:00,1272900,1274500,1265200,1270300,61318000,-0.006802189210320608,-0.015304117735100974,-0.010752787479393114,-0.008326490161251116\n20060706 00:00,1272000,1278500,1270800,1273700,46485300,0.0026765331024167782,-0.01521510094810899,-0.010677184090802178,-0.008258037405714508\n20060707 00:00,1272000,1275600,1263000,1265300,62152400,-0.006594959566616931,-0.01528019681653457,-0.010733600961632485,-0.008309827535041458\n20060710 00:00,1269400,1274300,1264100,1267400,52797000,0.0016596854500909863,-0.015224636764483867,-0.010706461301923759,-0.008297838681326958\n20060711 00:00,1266100,1274100,1259400,1272700,70836700,0.004181789490295129,-0.015216655663664022,-0.010703628864892355,-0.008297750977909699\n20060712 00:00,1272100,1274000,1257200,1259600,79757400,-0.010293077708808052,-0.015338845234572724,-0.010803894430379752,-0.008386328937231858\n20060713 00:00,1254800,1256800,1241300,1242100,89803400,-0.013893299460146058,-0.015533355067428237,-0.010958715497969874,-0.008519992070918365\n20060714 00:00,1241500,1242600,1228300,1236300,93057100,-0.004669511311488628,-0.015573263014723029,-0.01099616163561116,-0.008556125826942741\n20060717 00:00,1235000,1241000,1231500,1234300,81501000,-0.0016177303243549712,-0.015582538781753436,-0.011004884822984194,-0.008564554436145127\n20060718 00:00,1237500,1240500,1223900,1236800,110945600,0.0020254395203758158,-0.01554350696419244,-0.010969535464733338,-0.008531168183326391\n20060719 00:00,1241800,1262600,1241500,1259700,113164600,0.018515523932729705,-0.015700238179155165,-0.011066439270262964,-0.00859617821826513\n20060720 00:00,1261200,1263000,1249200,1249600,102301600,-0.008017782011590091,-0.015781694572953954,-0.011138457473288685,-0.008663164956713635\n20060721 00:00,1251500,1251600,1238800,1241100,91040300,-0.0068021766965429276,-0.015781731309242732,-0.01113848665570853,-0.008663190112193905\n20060724 00:00,1244400,1263200,1244400,1261300,82569500,0.01627588429618876,-0.015894857569861254,-0.011206468742159996,-0.008707106006442795\n20060725 00:00,1259800,1273000,1257200,1269700,89318900,0.00665979544913986,-0.01586928328864893,-0.01117593535566428,-0.00867392893927056\n20060726 00:00,1265900,1274400,1261800,1269000,80982700,-0.0005513113333858177,-0.015877939662059755,-0.011185533711363525,-0.008684029462242164\n20060727 00:00,1273300,1276900,1262000,1263700,83523300,-0.00417651694247434,-0.015911828212448183,-0.01121963261348329,-0.008718240502091548\n20060728 00:00,1269900,1281400,1268600,1278500,73613600,0.011711640420986047,-0.01595719883091425,-0.011244764947125766,-0.008732583880981797\n20060731 00:00,1276800,1279400,1265500,1276700,45112600,-0.001407899882674979,-0.015894740615565384,-0.011193463287870482,-0.00868722974049767\n20060801 00:00,1273400,1273800,1266000,1271600,59779400,-0.003994673768308976,-0.015921748945957416,-0.011217109298476668,-0.00870908331086753\n20060802 00:00,1275800,1284600,1275500,1279100,54742200,0.005898081157596824,-0.01591476805893033,-0.011213879214374767,-0.008707852765926045\n20060803 00:00,1273300,1285400,1271500,1281200,57009300,0.0016417793761238642,-0.015914362956577183,-0.011213365482780022,-0.00870728112448456\n20060804 00:00,1290600,1294300,1274900,1280000,82405300,-0.0009366219169528733,-0.015844515252667724,-0.011155927992079862,-0.008656459472525066\n20060807 00:00,1279000,1280700,1274000,1277600,40064500,-0.00187499999999996,-0.01578961102485234,-0.011110920818407,-0.008616728381793759\n20060808 00:00,1281000,1284500,1269500,1273300,85261800,-0.003365685660613682,-0.01579393962424903,-0.011114579849418011,-0.008620030468375948\n20060809 00:00,1282000,1286000,1266100,1267800,69698700,-0.0043194848032670485,-0.015817853844080677,-0.011145246024468168,-0.008654296085769004\n20060810 00:00,1265300,1275000,1262900,1272800,59427000,0.003943839722353681,-0.01580237194730554,-0.011127641328274256,-0.008635559733059883\n20060811 00:00,1271700,1272000,1263900,1268400,44261200,-0.003456945317410476,-0.015821230054733678,-0.011153019269118694,-0.008664413372973372\n20060814 00:00,1276300,1281600,1269200,1270500,53400000,0.0016556291390728006,-0.015768354460713327,-0.011106863413027633,-0.008621839784307531\n20060815 00:00,1282200,1288700,1279100,1287100,58213500,0.013065722156631265,-0.01583536012277332,-0.011142918743335537,-0.008641395607283154\n20060816 00:00,1293400,1298900,1290400,1297500,60369100,0.008080180250174873,-0.015690505854599364,-0.011016815730246142,-0.008525288818894526\n20060817 00:00,1295700,1303700,1294900,1300300,62227600,0.0021579961464355257,-0.015688824105157543,-0.011014640952886358,-0.008522851210176015\n20060818 00:00,1301900,1304800,1295900,1304600,55412700,0.003306929170191486,-0.01567399974698156,-0.010998604005362948,-0.008506167835758407\n20060821 00:00,1301800,1302500,1291400,1301100,37306500,-0.002682814655833199,-0.015695046339300193,-0.011018127008202622,-0.008524878618684548\n20060822 00:00,1299500,1305200,1296800,1301300,55297300,0.0001537160863884779,-0.015699671175741402,-0.011023119828204607,-0.008530067609361142\n20060823 00:00,1301800,1304400,1291900,1295700,62965500,-0.004303388918773576,-0.01570801240462203,-0.011030033512696734,-0.008536220275222065\n20060824 00:00,1299900,1301000,1294000,1298700,51483600,0.0023153507756425995,-0.01564297932308343,-0.010973645082566267,-0.008484440276769683\n20060825 00:00,1296400,1302900,1295500,1298400,39270800,-0.00023100023100020017,-0.015650586634638954,-0.010982073000398763,-0.008493305656771965\n20060828 00:00,1296600,1308200,1296400,1304800,49560400,0.004929143561306137,-0.015596709378727088,-0.01093145737945193,-0.008444428801356043\n20060829 00:00,1304900,1308300,1298100,1307500,57351500,0.0020692826486818916,-0.015590683444645353,-0.01093229607343686,-0.008448927003162297\n20060830 00:00,1308700,1310400,1305500,1307400,46878200,-7.64818355640795e-05,-0.015567738386705545,-0.010912146428134198,-0.0084302675819927\n20060831 00:00,1308500,1309900,1305800,1307100,29525300,-0.00022946305644788723,-0.015544764381294228,-0.01090777688511557,-0.008435816009033977\n20060901 00:00,1311400,1315800,1308400,1314800,40424700,0.0058909035268917,-0.01554698598797902,-0.010903924328975039,-0.008428725339167343\n20060905 00:00,1315100,1318500,1312000,1317200,47964900,0.0018253726802555104,-0.015518914716837128,-0.010878064964314801,-0.008404045133667812\n20060906 00:00,1311000,1311600,1303300,1304300,49301500,-0.009793501366535118,-0.015564586842348663,-0.01093716224577193,-0.008470299316082763\n20060907 00:00,1300600,1305700,1293500,1298200,80073400,-0.0046768381507321655,-0.01560551746906263,-0.010974075488568883,-0.008505070906378982\n20060908 00:00,1300800,1304600,1298300,1303000,38018200,0.0036974272069019154,-0.015575344214930079,-0.01094431888959757,-0.008475536424732387\n20060911 00:00,1298600,1306900,1294800,1303800,65683400,0.0006139677666923138,-0.015567858498977452,-0.0109467784157298,-0.008483297722619918\n20060912 00:00,1305700,1318300,1305400,1316400,61896000,0.009664058904740092,-0.015588398556247149,-0.01094960009568624,-0.008476673801193543\n20060913 00:00,1316200,1324500,1315200,1322500,58637400,0.004633849893649344,-0.015518193935386278,-0.010886353482419234,-0.008417136476028276\n20060914 00:00,1319400,1322200,1317500,1320500,52366200,-0.0015122873345935206,-0.015507156332106916,-0.010876825974245762,-0.008408413993967986\n20060915 00:00,1323400,1323900,1316800,1318200,65292400,-0.001741764483150332,-0.015518184828122842,-0.01088702598129437,-0.008418172336613756\n20060918 00:00,1318000,1326500,1316600,1320200,55715500,0.0015172204521316512,-0.01551976972418193,-0.010890911267309218,-0.008423283952001941\n20060919 00:00,1321200,1321400,1310700,1317500,82371900,-0.0020451446750492375,-0.015481013518805929,-0.010858931754902448,-0.008394917069541437\n20060920 00:00,1322400,1328600,1304600,1324100,70440400,0.005009487666034262,-0.01541182641048052,-0.01079605870089621,-0.00833541001452901\n20060921 00:00,1326000,1327500,1314300,1317000,81614100,-0.005362132769428318,-0.015343979589449615,-0.01074280061473526,-0.008289929128944893\n20060922 00:00,1316700,1316800,1310000,1313900,62386400,-0.002353834472285543,-0.015364274680325102,-0.010765175461739464,-0.008313412686245646\n20060925 00:00,1317300,1328500,1310500,1325400,84147600,0.008752568688636941,-0.015381586011913848,-0.01076838948672759,-0.0083091114892489\n20060926 00:00,1324900,1335800,1324000,1335400,67666400,0.007544892108042767,-0.015382927558913058,-0.010759706542096872,-0.008295084525223649\n20060927 00:00,1334800,1339700,1332500,1336400,72301000,0.0007488392990864234,-0.01538100323813734,-0.010757762533605573,-0.008293130021284022\n20060928 00:00,1337400,1339800,1332500,1337800,59890200,0.0010475905417539622,-0.01538221254969105,-0.010759121973494542,-0.008294569494033002\n20060929 00:00,1337900,1339400,1334800,1334800,40817300,-0.0022424876663178495,-0.015378333426838841,-0.01076978166656855,-0.00831297977607965\n20061002 00:00,1335400,1338300,1329500,1330700,44652500,-0.003071621216661713,-0.01539880471195313,-0.010787921338820942,-0.008329876474142978\n20061003 00:00,1328900,1337900,1326600,1334400,68655400,0.0027804914706546224,-0.015385780301838625,-0.01077415500859066,-0.00831571462904428\n20061004 00:00,1332200,1350000,1330800,1349500,75263900,0.011315947242206192,-0.015297615938843873,-0.010686344968354194,-0.008228093476959167\n20061005 00:00,1349000,1354100,1253500,1353000,54568200,0.002593553167840046,-0.015080527237727251,-0.010513076414032438,-0.008078185280747139\n20061006 00:00,1349600,1350900,1344100,1350300,64091700,-0.001995565410199518,-0.015062706662225322,-0.010498131799558158,-0.008064773830454851\n20061009 00:00,1348500,1353000,1346400,1350900,37472800,0.00044434570095530646,-0.015067989542815427,-0.010506423903904558,-0.008074670140850773\n20061010 00:00,1351100,1354500,1348400,1353300,53759800,0.0017765933821896063,-0.014987342485480788,-0.010438594143440843,-0.008013673233921418\n20061011 00:00,1348400,1354300,1343000,1349900,91013400,-0.002512377152146583,-0.014991837319318071,-0.010442441663239967,-0.00801717567300204\n20061012 00:00,1354700,1363900,1354000,1362700,52652500,0.009482183865471505,-0.014957908328948577,-0.010400662536481036,-0.007971211667581569\n20061013 00:00,1361600,1367100,1360400,1365500,45871200,0.002054744257723673,-0.014947378435026325,-0.010390039597326312,-0.007960539126357706\n20061016 00:00,1365200,1370500,1364200,1368900,40366300,0.0024899304284144996,-0.01493161447088994,-0.010385672501961998,-0.00796224765956423\n20061017 00:00,1364700,1367000,1356700,1364500,85859100,-0.003214259624516047,-0.014961912300532598,-0.010413963818369483,-0.007989469311190694\n20061018 00:00,1370600,1373400,1361100,1365800,76340200,0.0009527299377061205,-0.01484379097142576,-0.01031791537833236,-0.007905187846640866\n20061019 00:00,1364100,1368700,1362300,1367500,58435000,0.0012446917557475956,-0.014756790251637416,-0.010272110487826586,-0.007881344300289712\n20061020 00:00,1368100,1369400,1360000,1368600,41403600,0.00080438756855572,-0.014493853038399306,-0.010066608873683687,-0.0077064613914969325\n20061023 00:00,1365600,1378000,1363900,1376800,58583800,0.005991524185298802,-0.014498080329285385,-0.010065595243067228,-0.007702653845020321\n20061024 00:00,1373000,1378300,1372200,1377600,47700500,0.0005810575246949501,-0.01436807718695897,-0.00999289730598077,-0.007660505100802239\n20061025 00:00,1377400,1384100,1375900,1382000,65026300,0.0031939605110336,-0.014343587278663915,-0.009968963448014649,-0.007636867671208931\n20061026 00:00,1386600,1399200,1379800,1388600,62481200,0.004775687409551477,-0.014304092366321158,-0.009930632550057699,-0.007599157305013881\n20061027 00:00,1386100,1387500,1376400,1379100,69622200,-0.006841423015987336,-0.01423728771779891,-0.009878969728123266,-0.007555566534804484\n20061030 00:00,1376600,1382000,1374000,1378700,46718000,-0.00029004423174538996,-0.014123032116398333,-0.0098175403622521,-0.00752229863962242\n20061031 00:00,1380700,1382500,1372500,1377900,62820600,-0.0005802567636179479,-0.014124910644220796,-0.009827396433754604,-0.007536407510141643\n20061101 00:00,1382200,1383000,1367200,1368900,74753300,-0.006531678641410799,-0.014162686592284632,-0.009857750583252136,-0.007562805126286179\n20061102 00:00,1365000,1370100,1363600,1368100,49397500,-0.0005844108408210591,-0.014127939227383741,-0.009846713755146636,-0.007564408297610783\n20061103 00:00,1372600,1373900,1356200,1366000,59368200,-0.0015349755134858034,-0.014143319722940594,-0.009864342903627919,-0.007583236194645446\n20061106 00:00,1369600,1382800,1369500,1380800,61060900,0.010834553440702832,-0.01417737610744802,-0.009875446937754221,-0.0075821044157135895\n20061107 00:00,1382000,1389800,1344400,1384300,59784300,0.002534762456546824,-0.014177521742211967,-0.009875744879957644,-0.007582483552449415\n20061108 00:00,1380000,1390500,1368600,1387400,77371400,0.002239398974210882,-0.01414962207577319,-0.009849902146119737,-0.007557737361769816\n20061109 00:00,1390100,1391400,1379000,1380900,92487700,-0.004685022343952738,-0.014193243256757476,-0.009887905098183054,-0.007592745256784362\n20061110 00:00,1381400,1383400,1377200,1382700,43263600,0.0013034977188790542,-0.014171049441903989,-0.00988115755578569,-0.007594232065077891\n20061113 00:00,1381800,1390400,1380700,1386800,50853900,0.002965212989079369,-0.014170680051893455,-0.009880276646138723,-0.007593078466205504\n20061114 00:00,1389700,1397300,1381200,1395500,83661000,0.006273435246610948,-0.014170974033013555,-0.009873379766538017,-0.007582348165362704\n20061115 00:00,1395700,1404500,1395300,1399700,70170500,0.0030096739519884785,-0.01413143797835296,-0.009837132999683891,-0.007547854905666937\n20061116 00:00,1404400,1452000,1394900,1402300,58884800,0.0018575409016217126,-0.014132443740948214,-0.009838610798120285,-0.00754958434466358\n20061117 00:00,1399200,1404200,1397300,1403900,50228600,0.0011409826713257853,-0.014114240889895397,-0.009834394044905164,-0.007552823528453319\n20061120 00:00,1403000,1407400,1401000,1403700,56446500,-0.00014246028919440157,-0.014121068454615405,-0.009844614693997741,-0.0075648530182695645\n20061121 00:00,1404900,1406700,1402900,1405800,47757500,0.0014960461637101297,-0.014118977522019594,-0.00984780945690797,-0.007570865565895534\n20061122 00:00,1407500,1411600,1400000,1409200,38874400,0.002418551714326256,-0.01411758038912909,-0.009849462979264544,-0.007574145381276059\n20061124 00:00,1402400,1408400,1402000,1404600,21623300,-0.0032642634118649205,-0.01414710861177108,-0.009878827197833133,-0.00760342216987998\n20061127 00:00,1402900,1403500,1384400,1384900,75952500,-0.014025345294033875,-0.014360432093897403,-0.010047520217009824,-0.007748322854403229\n20061128 00:00,1382400,1391500,1381100,1390300,94228900,0.003899198498086509,-0.01428502720655541,-0.009981437298220805,-0.007687209442555948\n20061129 00:00,1394700,1405300,1394200,1403600,79107800,0.009566280658850568,-0.014306993359149197,-0.009985571453529378,-0.007681837426095076\n20061130 00:00,1404400,1410500,1397600,1404600,79790000,0.0007124536905100953,-0.014246294522786715,-0.009934544225521083,-0.007635966096712783\n20061201 00:00,1405300,1406600,1389700,1400600,114802600,-0.002847785846504358,-0.014206806706362379,-0.009924589820205935,-0.007641755843578189\n20061204 00:00,1402500,1415500,1400800,1413300,81558200,0.009067542481793422,-0.014224091357903345,-0.009925903732967783,-0.007634555814593023\n20061205 00:00,1415600,1419600,1412600,1418800,63979700,0.0038916012170098213,-0.014206314513561028,-0.009906703176104592,-0.007614596281853078\n20061206 00:00,1418700,1420700,1415000,1417500,49723900,-0.0009162672681138906,-0.014214133858296391,-0.009914123170756014,-0.007621803384452459\n20061207 00:00,1420300,1423000,1411100,1412200,55697300,-0.003738977072310412,-0.014205119080223837,-0.009906775443731112,-0.007615344356172511\n20061208 00:00,1411300,1419000,1407800,1414100,63778800,0.0013454184959638127,-0.014195076613226564,-0.009897005038304306,-0.007605718985762219\n20061211 00:00,1414200,1420900,1413400,1417400,34939300,0.0023336397708790813,-0.014195578568877903,-0.009898152198778973,-0.007607210102540767\n20061212 00:00,1416800,1418700,1408900,1416200,72746800,-0.0008466205728798748,-0.014202996632276617,-0.009905209005834711,-0.007614074325176813\n20061213 00:00,1422300,1423300,1415600,1418400,48130900,0.0015534529021323795,-0.014201533441748104,-0.009908525616930685,-0.007619939030832218\n20061214 00:00,1418700,1432400,1418400,1429800,58885100,0.008037225042301088,-0.014217408394696806,-0.00991580021753418,-0.007622628815424156\n20061215 00:00,1426500,1428900,1422400,1423800,55196600,-0.004196391103650887,-0.014239085923299172,-0.00993391287659498,-0.007638841055723347\n20061218 00:00,1425400,1435000,1417500,1419400,44417800,-0.0030903216743924933,-0.014187495381568419,-0.009892550725411122,-0.007602931621692176\n20061219 00:00,1415300,1425600,1411900,1422800,56781500,0.002395378328871267,-0.014119209441357094,-0.009833954770099844,-0.0075495013614755\n20061220 00:00,1422900,1426600,1420500,1421300,38432300,-0.0010542592071970391,-0.01412462033380094,-0.009838913700861103,-0.007554219353136154\n20061221 00:00,1422700,1424300,1413200,1416200,43870900,-0.0035882642651093866,-0.014158305195122598,-0.009870137045040719,-0.0075841304716356365\n20061222 00:00,1416400,1416500,1407800,1408500,54236800,-0.005437085157463661,-0.01421172646132271,-0.009919206625061908,-0.007630880183857284\n20061226 00:00,1408200,1415800,1407800,1415400,25831300,0.004898828541000988,-0.014209613867586728,-0.009912844116186204,-0.007622252060946448\n20061227 00:00,1418700,1426000,1418300,1425900,35903300,0.007418397626112849,-0.014098956448473698,-0.009814606949063042,-0.00753063608420073\n20061228 00:00,1424100,1427000,1419900,1421900,33168800,-0.0028052458096641253,-0.014121336508697412,-0.00983461812246081,-0.007549384412797121\n20061229 00:00,1421000,1425400,1414700,1415200,40461100,-0.004712005063647218,-0.014144442475749478,-0.009853656507313844,-0.007566254384631026\n20070103 00:00,1422700,1428400,1405800,1414500,103082600,-0.0004946297343131345,-0.014091199287362181,-0.009809535277986534,-0.0075269960379248345\n20070104 00:00,1412300,1420500,1406100,1416700,68197700,0.0015553199010251983,-0.013936851220356108,-0.009719128461496888,-0.00747067606548525\n20070105 00:00,1413300,1413900,1403800,1407600,69414700,-0.006423378273452407,-0.014003824468246422,-0.009778718405864308,-0.007526329998064874\n20070108 00:00,1408200,1414100,1402500,1411700,66512400,0.00291275930662116,-0.013995233722543902,-0.009768892888413023,-0.0075158462283633175\n20070109 00:00,1413100,1416000,1404000,1411300,71153200,-0.0002833463200396791,-0.013974723853261081,-0.009765502195514286,-0.007521581705049266\n20070110 00:00,1405700,1415300,1403000,1414000,67224600,0.0019131297385388546,-0.013975005445665725,-0.009768094297319296,-0.0075254055308660904\n20070111 00:00,1415600,1426200,1415000,1422700,52619600,0.0061527581329561265,-0.013973817308703998,-0.009759741053388483,-0.0075132325949229285\n20070112 00:00,1421200,1430300,1420800,1429700,51861700,0.0049202221128838985,-0.013976148046324395,-0.009759908681686653,-0.007512247077645519\n20070116 00:00,1430500,1434400,1427300,1430300,42256900,0.00041966846191510143,-0.013921364948821893,-0.009713856002695911,-0.007470848552458442\n20070117 00:00,1428700,1434600,1427300,1429400,46167300,-0.000629238621268291,-0.013928482513025323,-0.009720795215722203,-0.007477692687132149\n20070118 00:00,1431800,1432500,1423100,1424500,61992100,-0.003428011753183191,-0.013926263666611195,-0.00971896676029318,-0.00747607234769273\n20070119 00:00,1425500,1431000,1424600,1429300,51748400,0.0033696033696033467,-0.013892829135571803,-0.009687240097098041,-0.007445256142525784\n20070122 00:00,1430700,1459500,1419300,1422100,58695700,-0.005037430910235785,-0.013940803576520016,-0.00973229271359183,-0.007488751145214474\n20070123 00:00,1422500,1430800,1420600,1427500,53361600,0.0037972013219886858,-0.013619547191011416,-0.009480357515436025,-0.007273770815528954\n20070124 00:00,1429700,1439800,1429100,1439100,56374000,0.008126094570928277,-0.013636955489143815,-0.009485155297457202,-0.007271845978073621\n20070125 00:00,1438400,1439200,1344000,1423500,67120400,-0.010840108401083959,-0.013784320592294712,-0.009604620408988157,-0.007376437707309638\n20070126 00:00,1425900,1426500,1415800,1421900,70148700,-0.0011239901650860196,-0.013783929750408439,-0.009604273550086452,-0.00737611429557426\n20070129 00:00,1421900,1426300,1417400,1419600,61032000,-0.0016175539770729719,-0.013786409196852076,-0.009616547303660156,-0.007393609358037367\n20070130 00:00,1423600,1428300,1420600,1427600,67432100,0.005635390250774863,-0.013779295983387752,-0.00961317839230524,-0.0073922365202820275\n20070131 00:00,1426100,1441300,1424100,1438100,83878600,0.007355001400952688,-0.013791773189139262,-0.009615443571346112,-0.007389057705670771\n20070201 00:00,1441500,1446600,1439100,1445700,63910200,0.005284750712746034,-0.013751444442814276,-0.009575539745717385,-0.007349380403692897\n20070202 00:00,1447300,1449000,1443800,1447900,41581300,0.0015217541675311974,-0.01375272546600982,-0.009577220410942961,-0.007351274116605897\n20070205 00:00,1446900,1449300,1443400,1447000,38448100,-0.0006215898888044524,-0.01365663739980747,-0.009499850054634012,-0.007283882102180436\n20070206 00:00,1449700,1450300,1443300,1447900,54230700,0.0006219765031099111,-0.013604464071320873,-0.009455835807618726,-0.007244217431306656\n20070207 00:00,1451200,1453600,1445700,1450300,53946900,0.0016575730368120212,-0.013603214603472174,-0.009454404885131626,-0.007242689776023257\n20070208 00:00,1448000,1451200,1442700,1448800,65985200,-0.0010342687719782084,-0.013524500855371402,-0.009390858945645357,-0.007187229739184309\n20070209 00:00,1450600,1453300,1433900,1439200,74068700,-0.00662617338487026,-0.013576198767502243,-0.009444928099973238,-0.007242562993953181\n20070212 00:00,1439300,1440400,1431900,1434200,52040223,-0.0034741523068371194,-0.013596279721747795,-0.00946197164488423,-0.007257987307187173\n20070213 00:00,1437700,1445500,1437600,1445100,57747043,0.007600055780225823,-0.013611270372815544,-0.009466676572648554,-0.00725720895391845\n20070214 00:00,1448000,1458900,1447800,1456400,63401367,0.007819528060341918,-0.013600331874681194,-0.009446552479678641,-0.007232188054330929\n20070215 00:00,1456700,1459500,1454300,1458300,35042400,0.0013045866520187133,-0.013568567293551284,-0.009434067273341666,-0.007229980611357068\n20070216 00:00,1454300,1457400,1452300,1456800,34840200,-0.0010285949393128435,-0.013581758998010621,-0.009448504333901587,-0.00724508156664605\n20070220 00:00,1455600,1462000,1440600,1461000,51440200,0.002883031301482708,-0.013568156514474095,-0.009444062830285618,-0.00724552374752758\n20070221 00:00,1456100,1460700,1453500,1458900,60179100,-0.0014373716632443134,-0.01356736801404918,-0.00944337505568206,-0.007244889669486676\n20070222 00:00,1460500,1464200,1451700,1458300,73687100,-0.00041126876413732916,-0.013550188842109583,-0.00942845938429979,-0.0072311806618759415\n20070223 00:00,1457300,1457900,1447500,1453600,69286600,-0.0032229308098470355,-0.01356848593411477,-0.009453374118503301,-0.007259623236648283\n20070226 00:00,1458300,1459500,1447500,1452100,64226939,-0.00103192074848657,-0.01355079549093973,-0.009438293353317412,-0.0072459336811418786\n20070227 00:00,1438900,1442000,1391000,1400000,240160400,-0.03587907168927762,-0.014676181030729367,-0.010277692953506012,-0.007932875235155934\n20070228 00:00,1403900,1419800,1398000,1409300,157388600,0.0066428571428571725,-0.014684991626522184,-0.0102803382195936,-0.007932233786791084\n20070301 00:00,1393500,1412500,1380500,1405900,184864096,-0.0024125452352231624,-0.01456301091455418,-0.010184077921518596,-0.007849684946189818\n20070302 00:00,1400500,1406500,1389000,1389800,136190700,-0.01145173909950925,-0.014692012132090773,-0.010298842966133091,-0.007956860739697307\n20070305 00:00,1379200,1395100,1376600,1376900,124971624,-0.009281911066340465,-0.014787495910500251,-0.010375617891154265,-0.008023662044205087\n20070306 00:00,1387800,1401200,1384400,1398000,124103700,0.015324279177863387,-0.014877118340848022,-0.010419102444202907,-0.00804255066558842\n20070307 00:00,1397400,1404600,1394000,1394600,107667100,-0.0024320457796852546,-0.0148330328513061,-0.010383188585485367,-0.008010993073026074\n20070308 00:00,1405500,1411600,1400700,1405400,98830200,0.0077441560304030155,-0.014826861541292317,-0.010367192008134136,-0.007989758682013445\n20070309 00:00,1413300,1414100,1400800,1406200,94249900,0.0005692329585882394,-0.01483132284038792,-0.010372503137105533,-0.007995522852147025\n20070312 00:00,1404200,1413400,1401600,1410100,70784500,0.0027734319442469513,-0.014787392900390231,-0.01033277630954556,-0.007958036688274923\n20070313 00:00,1402400,1407700,1381200,1381500,153621800,-0.02028224948585211,-0.01516176690945882,-0.010629713643374096,-0.00821369281707002\n20070314 00:00,1384300,1392400,1367500,1391400,218131100,0.007166123778501676,-0.015172408266964683,-0.010631620701735197,-0.00821094365287636\n20070315 00:00,1390400,1399900,1388000,1395700,116295212,0.0030904125341382205,-0.015138940716121334,-0.010616096104627909,-0.008204984378011895\n20070316 00:00,1393100,1396300,1381200,1384800,103331708,-0.007809701225191645,-0.015219803826638081,-0.010688156405092682,-0.008272351933010782\n20070319 00:00,1392600,1403300,1391500,1400700,87263354,0.011481802426343224,-0.015267203339541012,-0.010710456497056531,-0.008281271616546782\n20070320 00:00,1400800,1410400,1399600,1409300,76058944,0.006139787249232587,-0.015244466436702943,-0.010683427377764225,-0.008251954332545103\n20070321 00:00,1411000,1436500,1408200,1433300,149067748,0.017029731072163434,-0.015360050949082096,-0.010743663613459081,-0.008282684606743434\n20070322 00:00,1434700,1436400,1427900,1433100,113333402,-0.00013953812879374805,-0.01530712506246815,-0.010699272012348934,-0.008242842601656152\n20070323 00:00,1432800,1437900,1431500,1435000,70644235,0.0013257972228037929,-0.015303220114764475,-0.010702415280626775,-0.0082497432477934\n20070326 00:00,1435000,1436500,1421200,1435900,110377931,0.0006271777003483692,-0.015284176071766391,-0.010685190477487701,-0.008233488274691475\n20070327 00:00,1431300,1431600,1424000,1427100,90033377,-0.006128560484713441,-0.015339875175791476,-0.0107323226748156,-0.00827605348575902\n20070328 00:00,1422300,1424700,1412600,1415400,142590430,-0.008198444397729654,-0.015419988187327883,-0.010797872231205149,-0.008333839318098573\n20070329 00:00,1425400,1426100,1411900,1421200,128167947,0.004097781545852719,-0.01535353056473631,-0.010738433946689004,-0.008278143016736956\n20070330 00:00,1421700,1428400,1405600,1419400,115313800,-0.0012665353222628406,-0.015354530260292147,-0.010749519312734043,-0.008294605016400027\n20070402 00:00,1421600,1424600,1414800,1423000,74548980,0.002536282936451917,-0.015335892997773989,-0.010731072154457236,-0.008276259201990849\n20070403 00:00,1429700,1439800,1429100,1436600,73978508,0.009557273366127994,-0.015330553226461817,-0.010712071482293379,-0.008249975954132054\n20070404 00:00,1436900,1439500,1431600,1437900,55336623,0.0009049143811776794,-0.015332399506740806,-0.010714120434456577,-0.008252132949926782\n20070405 00:00,1436700,1444400,1436100,1442800,43189240,0.003407747409416517,-0.015325611115617572,-0.010712888613218667,-0.008253863315533898\n20070409 00:00,1445900,1447800,1441500,1444200,44716540,0.0009703354588299629,-0.01532905561442554,-0.010718827116149354,-0.008261131362833907\n20070410 00:00,1443300,1448500,1442700,1448000,53549739,0.002631214513225233,-0.015311775753497608,-0.010701510352303337,-0.008243794926178808\n20070411 00:00,1448200,1448600,1435400,1438300,98582156,-0.00669889502762433,-0.015252988089594112,-0.010655735375739415,-0.008204956965085086\n20070412 00:00,1437400,1448000,1433400,1447400,109544751,0.006326913717583205,-0.015255358298642432,-0.01065122354822265,-0.008196776349340903\n20070413 00:00,1449000,1452900,1443700,1452600,73851540,0.0035926488876605323,-0.015176732741566657,-0.010582933339732578,-0.008133995876938232\n20070416 00:00,1458700,1468600,1458400,1467800,73180718,0.010463995594107045,-0.01520824577032485,-0.010594767369664887,-0.008135339105414181\n20070417 00:00,1469600,1474000,1466500,1470700,92046661,0.0019757460144433914,-0.015202321417355528,-0.010588462212767763,-0.008128830943352228\n20070418 00:00,1466000,1476400,1465700,1471500,79716663,0.0005439586591418077,-0.015182715185805003,-0.010570899964405845,-0.008112358334864853\n20070419 00:00,1465400,1474000,1463600,1470300,93454136,-0.0008154943934760572,-0.015063940752428262,-0.010507857827214162,-0.008079026878544575\n20070420 00:00,1482000,1484800,1476900,1484700,111259258,0.009793919608243273,-0.015091151717586893,-0.01051802415988478,-0.008080106780705667\n20070423 00:00,1483700,1487300,1479700,1481200,71438337,-0.0023573785950024018,-0.015110693637338104,-0.010536001704075324,-0.00809725036207344\n20070424 00:00,1482300,1484000,1473300,1480400,106786997,-0.0005401026194976621,-0.015111535874864152,-0.010536781883450762,-0.008097997458478421\n20070425 00:00,1487300,1496500,1481600,1494600,100169134,0.00959200216157785,-0.01511730789324162,-0.01052731833108369,-0.008080411879723247\n20070426 00:00,1494900,1498000,1491000,1493900,83518805,-0.0004683527365181295,-0.015083468473058467,-0.01049860521265088,-0.008054431573784814\n20070427 00:00,1490300,1497400,1488400,1494000,91329479,6.693888479825105e-05,-0.015090924976400725,-0.01050692378516182,-0.008063209712179685\n20070430 00:00,1496300,1497400,1482100,1482300,92080774,-0.007831325301204783,-0.015177251123085551,-0.010582228255559578,-0.008132638567732046\n20070501 00:00,1485200,1494700,1476700,1486100,127418434,0.0025635836200499362,-0.01516905587008375,-0.01057327638195119,-0.00812328334247799\n20070502 00:00,1489000,1499500,1487500,1496200,82498312,0.006796312495794377,-0.01513448456657228,-0.010535790616683477,-0.008084243888432334\n20070503 00:00,1499500,1504000,1490500,1502600,75972844,0.004277503007619199,-0.015129443538249642,-0.010534554948891021,-0.008085036844257638\n20070504 00:00,1507500,1511100,1502200,1506400,84518329,0.002528949820311377,-0.01508908283117073,-0.010498122860712744,-0.008050699088278317\n20070507 00:00,1508800,1512000,1508100,1509500,58016709,0.0020578863515665624,-0.015090430524453415,-0.01050085997556056,-0.008054176898621262\n20070508 00:00,1505700,1509200,1501300,1508600,74156636,-0.000596223915203753,-0.015063999521947383,-0.010495438067900598,-0.0080599548616843\n20070509 00:00,1506400,1528200,1504400,1513800,93550075,0.0034469044146892003,-0.015049746386059814,-0.010480039422285885,-0.00804394554907275\n20070510 00:00,1507300,1510200,1492700,1493300,140785030,-0.013542079534945128,-0.015238326816612406,-0.010628855341053714,-0.00817156315374777\n20070511 00:00,1497500,1508200,1497200,1508100,100530941,0.009910935511953323,-0.015255234953224915,-0.010628411855007392,-0.00816186958186781\n20070514 00:00,1508600,1513000,1497900,1505500,104242001,-0.0017240236058616576,-0.015100091480807813,-0.010506237320283383,-0.008057270665833836\n20070515 00:00,1507000,1516600,1501900,1503800,164645008,-0.0011291929591498162,-0.014955842317220134,-0.010391958094256746,-0.007958968302623964\n20070516 00:00,1508000,1516300,1503800,1516100,106342127,0.008179279159462594,-0.014970662082196676,-0.010396255994611728,-0.00795765703588299\n20070517 00:00,1513800,1519600,1511100,1514400,97297576,-0.0011212980674097928,-0.014964452543741003,-0.010390837222508413,-0.007952659818396062\n20070518 00:00,1519400,1525000,1518100,1524900,89715341,0.0069334389857369505,-0.014687598872364293,-0.01016761602832184,-0.007758029899344612\n20070521 00:00,1525800,1532300,1525000,1527100,169217747,0.0014427175552496063,-0.014618085672179057,-0.010109112522925326,-0.007705395621501063\n20070522 00:00,1527100,1531600,1524000,1526000,74583722,-0.0007203195599502221,-0.014630199298617474,-0.010124034738421597,-0.007721815085431521\n20070523 00:00,1529500,1535000,1523700,1523800,121227022,-0.0014416775884665833,-0.014639662993080896,-0.01013258513488019,-0.007729878606103194\n20070524 00:00,1525300,1532000,1507400,1510100,175952900,-0.0089906811917575,-0.014648045315327655,-0.01013907616485345,-0.007735361395163755\n20070525 00:00,1514900,1520200,1511900,1518600,78518621,0.005628766306867039,-0.014647709336227692,-0.010133957269068313,-0.007727692744191859\n20070529 00:00,1519400,1525000,1514500,1520800,78864194,0.0014487027525351692,-0.014597398161301837,-0.01011099178145871,-0.007719305141303974\n20070530 00:00,1514600,1533800,1513400,1533700,121948468,0.008482377695949506,-0.01461249955821131,-0.010117911173748603,-0.007721862737206839\n20070531 00:00,1536600,1538900,1531200,1533500,92738217,-0.0001304035991392949,-0.014358468779727688,-0.009920146727075217,-0.007554093663820561\n20070601 00:00,1538800,1544000,1535100,1539600,94158006,0.003977828496902536,-0.014344114569811243,-0.009914763082042248,-0.0075534921937334115\n20070604 00:00,1535300,1543900,1535000,1542400,68860762,0.0018186541958951086,-0.014295633847489001,-0.009892250842072237,-0.007544823655614833\n20070605 00:00,1537200,1539000,1528600,1534400,115048353,-0.005186721991701226,-0.014348738569810851,-0.009938625700913426,-0.007587610849136833\n20070606 00:00,1529100,1529500,1517600,1521000,141701715,-0.008733055265901957,-0.014146130697357357,-0.009785447603449847,-0.007460783581816593\n20070607 00:00,1515500,1520600,1492500,1493600,213266360,-0.018014464168310318,-0.014462073460149903,-0.010028403637720494,-0.0076648306611832185\n20070608 00:00,1494200,1511900,1490900,1510500,159269911,0.011314943760042828,-0.014432623229194167,-0.00998672325581253,-0.00761663043105755\n20070611 00:00,1509600,1519500,1507000,1513000,95929369,0.0016550810989739428,-0.01443306108852886,-0.009987232352123144,-0.007617177503536431\n20070612 00:00,1506700,1515400,1496700,1496700,203229576,-0.010773298083278204,-0.014528457217640438,-0.01006158470351621,-0.007680311494895535\n20070613 00:00,1504500,1519800,1501900,1519500,199710336,0.015233513730206427,-0.014448637559631907,-0.009973270447548484,-0.0075874688001881145\n20070614 00:00,1520600,1531200,1520300,1527100,130035045,0.005001645278051914,-0.014313118673939917,-0.009859730854824868,-0.0074856462872164966\n20070615 00:00,1532500,1536600,1529300,1530400,129793868,0.0021609586798507774,-0.014310260135509725,-0.00986239626378965,-0.007491256492097413\n20070618 00:00,1533600,1533900,1526600,1529000,82443861,-0.0009147935180344735,-0.014130316533299285,-0.009759575547690413,-0.007429549701208133\n20070619 00:00,1526400,1533800,1523600,1532000,100350055,0.0019620667102682177,-0.014040529579892182,-0.009684859036610106,-0.007362867187167452\n20070620 00:00,1535900,1535900,1509600,1510200,171495940,-0.01422976501305484,-0.014147166077250235,-0.009765824826568124,-0.0074301480179991995\n20070621 00:00,1510800,1521100,1502500,1519800,188604867,0.006356773937226778,-0.014145858448689872,-0.009758073924331754,-0.0074189622304080384\n20070622 00:00,1515000,1517700,1498500,1502400,186515531,-0.011448874851954227,-0.01427680390080269,-0.009875698507981692,-0.007529485508371298\n20070625 00:00,1502400,1512500,1490200,1496100,217859808,-0.004193290734824329,-0.014261967274228892,-0.009863765501878013,-0.007519100411596049\n20070626 00:00,1502100,1504600,1488200,1490700,177104734,-0.0036093843994385866,-0.014286907711778199,-0.009885035131991838,-0.007538413147849013\n20070627 00:00,1482400,1505600,1480600,1505500,177953980,0.00992822164083984,-0.014314252442156908,-0.009898902495369507,-0.007545095776748401\n20070628 00:00,1503700,1514100,1503100,1504000,142737708,-0.0009963467286615568,-0.014209728262477994,-0.009815279120863031,-0.0074726145441406135\n20070629 00:00,1508300,1516500,1491500,1499800,170502301,-0.002792553191489411,-0.014235032546516344,-0.009843080059327804,-0.007501746439841801\n20070702 00:00,1508400,1518000,1507700,1518000,88702331,0.012134951326843613,-0.014060037534992648,-0.009729970191682556,-0.007421627313406073\n20070703 00:00,1521700,1525000,1519900,1522400,51988192,0.0028985507246377384,-0.01404069102319139,-0.009710911532223336,-0.007402722106965258\n20070705 00:00,1524300,1525600,1516300,1524300,76986388,0.001248029427220132,-0.01403495478995375,-0.009713550791363048,-0.007409826310099709\n20070706 00:00,1523800,1531600,1519300,1529600,68311656,0.0034770058387456615,-0.013958068034014177,-0.009647238301058403,-0.007349150921677348\n20070709 00:00,1531500,1533600,1526200,1530800,68134745,0.0007845188284518745,-0.013962867588060786,-0.009652831281440167,-0.007355166874702488\n20070710 00:00,1522700,1526000,1508700,1508900,160715108,-0.014306245100600967,-0.014119330865834468,-0.009772423517970814,-0.007455103295579482\n20070711 00:00,1507500,1518900,1505300,1518400,148542017,0.006295977201935088,-0.014122807080774472,-0.00976949177461744,-0.007448755493371119\n20070712 00:00,1523600,1547500,1523400,1547500,119573544,0.01916491043203372,-0.014298576288750559,-0.009876352461711984,-0.0075188813029642265\n20070713 00:00,1545700,1554600,1544000,1551100,96356361,0.0023263327948304102,-0.014161632362742657,-0.009764855844513419,-0.007420950551929864\n20070716 00:00,1549900,1555300,1545800,1549000,92650896,-0.0013538778931081463,-0.013958044890159959,-0.009606331625357102,-0.007286449386428698\n20070717 00:00,1550200,1554800,1546800,1548600,109985438,-0.0002582311168495277,-0.013918949484129904,-0.009573561018404939,-0.00725705050646146\n20070718 00:00,1543200,1548000,1533000,1545900,216371454,-0.0017435102673382108,-0.013919923015053752,-0.009574395574537648,-0.007257810975647259\n20070719 00:00,1552000,1555300,1547600,1552200,128996829,0.004075295944110158,-0.013918140611637209,-0.009570752393673413,-0.007253175821211049\n20070720 00:00,1548700,1549900,1528300,1533300,242445444,-0.01217626594511012,-0.013936636543250827,-0.009619508732125555,-0.007318063870576966\n20070723 00:00,1542800,1547200,1538400,1540600,105681900,0.004760973064631857,-0.013839973507698288,-0.009536307645116976,-0.007242039298524254\n20070724 00:00,1531200,1535000,1507600,1511200,231005501,-0.019083473971180043,-0.014134838075753994,-0.009759069636613429,-0.007426363673256366\n20070725 00:00,1520300,1523900,1502700,1517500,246139539,0.004168872419269443,-0.014016912844848775,-0.009689764335450886,-0.007382977476732509\n20070726 00:00,1501600,1507500,1464000,1485500,424889258,-0.021087314662273426,-0.014444108884638276,-0.010024070587041594,-0.007667764525952245\n20070727 00:00,1482600,1488700,1459000,1460400,358859128,-0.01689666778862331,-0.014725478905463411,-0.010242015608500469,-0.00785189791493894\n20070730 00:00,1458900,1478100,1453600,1472700,241553260,0.008422350041084714,-0.014702414724142927,-0.01021106200461713,-0.007816738489080384\n20070731 00:00,1483300,1488800,1453900,1453900,270892856,-0.012765668500033911,-0.01483763035161168,-0.010335121238910104,-0.007934850291453079\n20070801 00:00,1452100,1470100,1439600,1466200,440958944,0.008460004126831233,-0.014839591149548904,-0.010325036348168535,-0.007918343888649208\n20070802 00:00,1467700,1477600,1461000,1472900,269490793,0.004569635793207016,-0.014802001106791217,-0.010288502284064038,-0.007882372762857316\n20070803 00:00,1472600,1475800,1432400,1433500,330332336,-0.02674994908004613,-0.01542470413229918,-0.010766739778119672,-0.00828359621665798\n20070806 00:00,1442200,1468300,1427600,1467600,297717655,0.02378793163585624,-0.01569892952389882,-0.01093488739658252,-0.008395194166778589\n20070807 00:00,1459400,1489700,1456000,1476800,264111899,0.006268738075769997,-0.01569027298743383,-0.01092039064171841,-0.008377584013096325\n20070808 00:00,1484100,1505800,1479200,1498600,254003397,0.014761646803900241,-0.01575192922988576,-0.010944645099873557,-0.008381899718439768\n20070809 00:00,1474100,1489500,1456500,1457200,318863694,-0.0276257840651275,-0.016353790334994144,-0.011398395393434811,-0.008756692686416054\n20070810 00:00,1442400,1464600,1431200,1455400,373642344,-0.0012352456766401287,-0.016328394407785187,-0.011376853722165873,-0.008737205704726931\n20070813 00:00,1465100,1468900,1452800,1455100,155532500,-0.00020612889927162925,-0.016337963777871483,-0.01138844405604331,-0.008749873406923299\n20070814 00:00,1457000,1458400,1427500,1427700,259981792,-0.018830320940141587,-0.016626404702885258,-0.011610258676571644,-0.00893616979106613\n20070815 00:00,1427000,1444300,1406300,1409000,292967525,-0.013097989773761975,-0.01679953747341626,-0.011749823745126816,-0.00905784004190773\n20070816 00:00,1397900,1419200,1372500,1417300,503557150,0.005890702625975797,-0.016746557889264938,-0.011720705162546065,-0.009041441670971971\n20070817 00:00,1455600,1458100,1423300,1447400,321464021,0.021237564382981633,-0.01692794448469202,-0.011833660035927786,-0.009117915846547536\n20070820 00:00,1451300,1454500,1433000,1447500,177136236,6.908940168570687e-05,-0.016934535223318406,-0.011840748364928268,-0.009125269439135228\n20070821 00:00,1445900,1458200,1441400,1449500,140401964,0.001381692573402482,-0.016937651676264067,-0.011845189922322509,-0.009130417404807755\n20070822 00:00,1460100,1468000,1453300,1466600,155083872,0.011797171438427068,-0.01695335828284299,-0.011839462589136662,-0.009113263717644792\n20070823 00:00,1473300,1476500,1456100,1465700,189807172,-0.0006136642574662288,-0.01695709711422908,-0.011842998212309675,-0.009116691011271341\n20070824 00:00,1464900,1482500,1462800,1481600,115128829,0.01084805894794294,-0.016948206655372354,-0.011819098861427478,-0.0090847904755874\n20070827 00:00,1478700,1479100,1468100,1469200,94133747,-0.008369330453563695,-0.01703746807777293,-0.01189463228066496,-0.00915300554713603\n20070828 00:00,1461600,1462400,1434600,1436500,201545328,-0.02225701061802343,-0.01743906558000095,-0.012204188296188951,-0.009413494586676962\n20070829 00:00,1443900,1467400,1439600,1467100,183933397,0.02130177514792897,-0.017622315337964656,-0.012314722852325105,-0.009485264937785126\n20070830 00:00,1454500,1471800,1453100,1461500,175252806,-0.003817054052211888,-0.01765518333937527,-0.012344805077409255,-0.009513862075817779\n20070831 00:00,1476700,1485000,1468300,1474700,160229700,0.009031816626753342,-0.017662184743525593,-0.012339167196894294,-0.00950148623941659\n20070904 00:00,1474700,1499800,1474000,1492000,107064171,0.011731199566013428,-0.017688637779551857,-0.012343966843200042,-0.009494742543785838\n20070905 00:00,1481800,1483600,1470000,1475500,143102408,-0.011058981233244003,-0.0178180173165668,-0.012455149135880344,-0.00959622395284616\n20070906 00:00,1479500,1486100,1471300,1482600,114939005,0.004811928159945689,-0.01781609690796284,-0.012450319480200046,-0.009589843388314484\n20070907 00:00,1464800,1468900,1452600,1458400,204773965,-0.0163226763793336,-0.017945821203636768,-0.012549631627221614,-0.009672942931422807\n20070910 00:00,1465100,1467100,1443400,1455100,168772272,-0.002262753702687914,-0.017925078834120593,-0.012532159316759115,-0.009657213877341704\n20070911 00:00,1462300,1477000,1461300,1476400,149098671,0.014638169197993323,-0.01799232457340978,-0.01256698724952627,-0.00967475999740678\n20070912 00:00,1472800,1484300,1469900,1476400,144262146,0.0,-0.017994917777366854,-0.012569534512544054,-0.009677282769479822\n20070913 00:00,1485700,1494500,1482000,1488100,127665042,0.00792468165808713,-0.0179850602957863,-0.012564586738790441,-0.009674952342801479\n20070914 00:00,1479500,1490900,1477400,1489300,107020941,0.0008063974195282597,-0.017990391778032137,-0.012572805737143804,-0.009684710665307156\n20070917 00:00,1482900,1486500,1476300,1481300,106507975,-0.005371651111260367,-0.01802341485560657,-0.0126006412858013,-0.009709780761494324\n20070918 00:00,1488300,1525000,1483700,1523900,236377628,0.028758522919057672,-0.018357214122244198,-0.01280119930368814,-0.009839308362701445\n20070919 00:00,1534100,1543700,1527100,1533600,176040395,0.006365247063455648,-0.018356280617464235,-0.012794903511866814,-0.009830153955500309\n20070920 00:00,1533500,1534300,1521100,1523400,147812692,-0.006651017214397537,-0.018400522837786638,-0.012831539405071193,-0.009862734943863577\n20070921 00:00,1527000,1528800,1522500,1522700,123062709,-0.0004594984902192012,-0.018411825693832807,-0.012845888743991613,-0.009878708351531434\n20070924 00:00,1524300,1528100,1513600,1515500,130049917,-0.0047284428974847525,-0.018405258667368887,-0.012840508847144957,-0.009873961309091033\n20070925 00:00,1508100,1516500,1504700,1516400,126499030,0.0005938634114153185,-0.018388621072531447,-0.012825318517042305,-0.009859542510463217\n20070926 00:00,1522700,1527700,1516400,1523700,115705154,0.004814033236613113,-0.01837655576328023,-0.01282136617614036,-0.009859915162968049\n20070927 00:00,1528900,1530800,1523600,1529400,90743331,0.0037408938767473643,-0.018369736430304623,-0.012820966626506563,-0.009862937976078807\n20070928 00:00,1528500,1531900,1519800,1524700,114975085,-0.0030731005623120256,-0.018392410892212215,-0.012841441640104008,-0.009882240471920677\n20071001 00:00,1526100,1547400,1526000,1545200,130896880,0.013445267921558424,-0.018437011249006898,-0.012858564399918688,-0.009884715026459996\n20071002 00:00,1546200,1546500,1538100,1544300,106161969,-0.0005824488739322176,-0.018426624100167554,-0.01284929035594345,-0.009876034374569019\n20071003 00:00,1538100,1544100,1534500,1538000,107188444,-0.004079518228323531,-0.01843540084136942,-0.012856667650312383,-0.009882665629009656\n20071004 00:00,1541000,1542600,1535900,1541600,72348145,0.0023407022106631814,-0.018436173389745913,-0.012857725131742211,-0.009883875007195887\n20071005 00:00,1550200,1561000,1546400,1556000,107716077,0.009340944473274604,-0.018422248748811983,-0.012850175567505685,-0.009879723972757203\n20071008 00:00,1553900,1554900,1547700,1551900,64689303,-0.0026349614395886345,-0.01844660536359749,-0.012873475074743831,-0.009902459939873442\n20071009 00:00,1556000,1564000,1550300,1564000,85168711,0.007796894129776355,-0.018433293135664483,-0.012852679032583888,-0.00987767430404129\n20071010 00:00,1560400,1564400,1554100,1560300,92827348,-0.00236572890025577,-0.018449442720625278,-0.01286736432847125,-0.00989157899284188\n20071011 00:00,1569200,1575200,1545400,1553500,217693623,-0.004358136255848244,-0.018486861383792304,-0.01290095287008729,-0.009923125710831595\n20071012 00:00,1554700,1562300,1552700,1560600,108160497,0.0045703250724171696,-0.018462228788560395,-0.012875302766271406,-0.009896933176954658\n20071015 00:00,1562700,1563600,1539400,1548300,147452330,-0.007881584006151465,-0.018526706248423536,-0.012941076916604007,-0.009963398588178416\n20071016 00:00,1544100,1545100,1534800,1537700,149944098,-0.006846218433120166,-0.01859138026976236,-0.012997152170652658,-0.010014889871202482\n20071017 00:00,1550000,1550900,1524700,1540300,191822064,0.001690836964297393,-0.018593119462565196,-0.012999310807313471,-0.010017272111831926\n20071018 00:00,1534400,1541900,1530800,1538200,124527600,-0.0013633707719274968,-0.018579933645431205,-0.01298783609351,-0.010006709580882402\n20071019 00:00,1531000,1531500,1499100,1499700,268517135,-0.025029254973345516,-0.019046296651016165,-0.013347783576042334,-0.010309927341842133\n20071022 00:00,1488300,1507600,1486600,1506000,242729590,0.0042008401680335705,-0.01904213594451868,-0.013341405256450365,-0.010302366820915274\n20071023 00:00,1513000,1519500,1502600,1519400,161146462,0.008897742363877859,-0.01904958896253995,-0.013337266547144023,-0.010292048604663167\n20071024 00:00,1512100,1517100,1488400,1515600,301697347,-0.002500987231802032,-0.019070964001546793,-0.01336225226339142,-0.010318959159587002\n20071025 00:00,1516800,1522900,1498900,1513200,212700182,-0.0015835312747426444,-0.019081740674732405,-0.013372388253448586,-0.010328753603839098\n20071026 00:00,1530600,1535000,1519000,1534500,147407625,0.014076130055511449,-0.0191370977566638,-0.013398878352717624,-0.01033985482146662\n20071029 00:00,1539200,1544400,1535600,1540000,100917701,0.0035842293906809264,-0.019136931407406667,-0.01340014578572449,-0.010341886598493036\n20071030 00:00,1534300,1537500,1528700,1530600,120728222,-0.006103896103896056,-0.019128384431577196,-0.01339324524880959,-0.01033586377207122\n20071031 00:00,1539800,1552600,1528500,1547900,200718185,0.011302757088723414,-0.01914655144947219,-0.01339261386553634,-0.010325211030694439\n20071101 00:00,1533300,1534000,1505900,1507800,297180006,-0.02590606628335168,-0.019623974815599347,-0.013759618827090639,-0.010633352349349465\n20071102 00:00,1515400,1515500,1492200,1511100,297848587,0.0021886191802626964,-0.019565091405742096,-0.013707847868219988,-0.01058537301178174\n20071105 00:00,1496300,1511400,1489700,1501900,209639996,-0.0060882800608828,-0.019609204261716293,-0.013745436200641096,-0.010619483144839233\n20071106 00:00,1508400,1520900,1499000,1520900,163741165,0.01265064251947523,-0.019631031082509184,-0.013744378387716647,-0.01060622561835952\n20071107 00:00,1504300,1511300,1475600,1475900,270774443,-0.02958774409888887,-0.020210387881561105,-0.014201005219484126,-0.010997425558702353\n20071108 00:00,1479800,1484000,1450700,1475300,361286275,-0.0004065316078325498,-0.020219689223108097,-0.01421100097783462,-0.011007791508081262\n20071109 00:00,1455100,1475400,1449000,1452600,259572995,-0.015386701009964088,-0.02041579996730366,-0.014370151928516511,-0.011147239329602435\n20071112 00:00,1452000,1466100,1439300,1439900,225811847,-0.008742943687181648,-0.020461251925840557,-0.014407006187479794,-0.011179510186736878\n20071113 00:00,1452600,1483000,1452200,1481900,173178279,0.029168692270296503,-0.020781536429418258,-0.014601071791108623,-0.011306288961847669\n20071114 00:00,1492200,1493900,1468100,1471000,185943284,-0.007355422093258679,-0.020848745762238278,-0.014660589993825723,-0.011361707051566203\n20071115 00:00,1467900,1474900,1445200,1453600,241477765,-0.011828687967369134,-0.02097624845419715,-0.014771784714456221,-0.01146420805302553\n20071116 00:00,1462800,1464600,1445800,1460400,277070414,0.004678040726472155,-0.02097580469776506,-0.014769531504954485,-0.011460990230787841\n20071119 00:00,1452800,1453600,1432000,1435600,249074173,-0.016981648863325094,-0.021198344869601808,-0.014948779686314206,-0.01161715961221655\n20071120 00:00,1436400,1455200,1421200,1442000,391931736,0.004458066313736353,-0.021194090207490936,-0.014941915353586997,-0.011608904073740272\n20071121 00:00,1430800,1439100,1417400,1418100,232088105,-0.01657420249653263,-0.021399506714162818,-0.015106257559238768,-0.011751349721504455\n20071123 00:00,1430100,1443400,1427100,1441800,70919047,0.016712502644383287,-0.02147599972129045,-0.01514265336013929,-0.011766369850136014\n20071126 00:00,1443800,1448700,1407800,1408200,196405849,-0.023304203079484,-0.021846673184588425,-0.015434641815814613,-0.012016411619403906\n20071127 00:00,1417400,1432300,1409500,1430900,255983068,0.01611986933674192,-0.021890630039313946,-0.015443187942113246,-0.012006080417407616\n20071128 00:00,1442100,1474700,1441400,1472600,222463103,0.029142497728702255,-0.022028185774769348,-0.015490265350376568,-0.01200492416423958\n20071129 00:00,1466100,1477200,1461100,1472700,179804977,6.790710308290926e-05,-0.022037090438740643,-0.015501015243933741,-0.012016657742861129\n20071130 00:00,1490400,1492500,1473400,1484600,198187551,0.00808039655055337,-0.022030703643645316,-0.015498226751302724,-0.012015787491959123\n20071203 00:00,1482100,1484400,1473000,1475600,130665807,-0.006062238986932478,-0.02207677208620753,-0.015538675101064704,-0.012053239791045188\n20071204 00:00,1466600,1473400,1463100,1465500,126981771,-0.0068446733532122606,-0.02211223942036916,-0.01556839874031916,-0.012079901487797884\n20071205 00:00,1479200,1490000,1478300,1488600,149205049,0.015762538382804614,-0.022164217370344744,-0.015597367133227971,-0.012096603570976095\n20071206 00:00,1486300,1512100,1485700,1511100,135055501,0.015114873035066534,-0.022219083518031865,-0.015623113589518355,-0.012106826427533766\n20071207 00:00,1514200,1515000,1506200,1507500,112768081,-0.002382370458606342,-0.022227629531170353,-0.015630860404046546,-0.012114147192240065\n20071210 00:00,1512500,1522400,1508600,1520300,100000048,0.0084908789386402,-0.022203214773668576,-0.015599380839201028,-0.012078901404741327\n20071211 00:00,1521200,1528800,1479600,1482400,227167081,-0.024929290271656912,-0.022609027331141084,-0.015916856170512625,-0.012349284487658617\n20071212 00:00,1515200,1517200,1472000,1491300,259965196,0.006003777657852094,-0.02260805916155301,-0.015911905145629658,-0.012342210217355605\n20071213 00:00,1483200,1493700,1473000,1493000,216356168,0.0011399450144169432,-0.022599975079176788,-0.015903879911881833,-0.012334216355593822\n20071214 00:00,1480500,1491000,1471700,1471800,133917954,-0.01419959812458138,-0.022759605441848223,-0.01603505987248899,-0.012450229512134842\n20071217 00:00,1466200,1468700,1449400,1450700,150430849,-0.014336186981926846,-0.02291764240381181,-0.01617280927664121,-0.012577163694287373\n20071218 00:00,1460900,1464700,1439600,1458200,232214158,0.005169917970634819,-0.022883646567443225,-0.016137884199004197,-0.012541743241568605\n20071219 00:00,1459300,1468900,1449400,1456300,183399740,-0.0013029762721162852,-0.022872630984817687,-0.016128017826490405,-0.012532489508712993\n20071220 00:00,1468400,1468500,1451800,1465400,178843379,0.006248712490558361,-0.02287236008435902,-0.016123346845808014,-0.012525472861544845\n20071221 00:00,1473600,1482700,1470900,1482000,118912375,0.011327965060734302,-0.022880471691422467,-0.016114688052268494,-0.012507873829498986\n20071224 00:00,1487300,1494800,1485400,1492000,43846385,0.006747638326585648,-0.022852420968681456,-0.016082839354169556,-0.012474000444790292\n20071226 00:00,1488400,1496200,1485000,1494800,58150837,0.0018766756032171372,-0.022809398222158883,-0.016043917818012593,-0.012437265248703623\n20071227 00:00,1490100,1490300,1473200,1475200,104895088,-0.01311212202301315,-0.02295400379175513,-0.016167099210359265,-0.012549025491433911\n20071228 00:00,1485400,1486100,1469000,1475400,102741375,0.00013557483731019282,-0.022958642304339763,-0.01617884505453116,-0.012564560227775887\n20071231 00:00,1471000,1473300,1462600,1464200,80764439,-0.007591161718855877,-0.023001580971907822,-0.016214768563056346,-0.012596743980973343\n20080102 00:00,1465300,1469900,1438800,1445600,176004906,-0.012703182625324438,-0.02309907421784566,-0.016292991171259034,-0.012664693483506092\n20080103 00:00,1449200,1454900,1441300,1444600,111123658,-0.0006917542888765782,-0.02309998944772114,-0.016293867442372403,-0.012665548985847533\n20080104 00:00,1433400,1434400,1409200,1409300,195816564,-0.024435829987539792,-0.023479405900116525,-0.016592349668687265,-0.012920885475717802\n20080107 00:00,1418100,1422300,1401100,1414600,220246505,0.0037607322784360964,-0.02342608331798435,-0.016542808856518838,-0.012873360711123459\n20080108 00:00,1420800,1429000,1386300,1388100,302929270,-0.018733210801640032,-0.023669125743516223,-0.01673981607619007,-0.01304582673289333\n20080109 00:00,1390200,1407900,1377000,1407800,283830252,0.014192061090699593,-0.023703090795399524,-0.016747003772886022,-0.013038739520622499\n20080110 00:00,1397000,1428000,1393700,1418000,299678952,0.007245347350475884,-0.02370383726757054,-0.016741332951223733,-0.01302964766336343\n20080111 00:00,1407600,1415700,1392900,1400300,246581793,-0.012482369534555726,-0.02383167400201006,-0.016853383467099376,-0.013133282604536025\n20080114 00:00,1411600,1417000,1404100,1414600,188219100,0.01021209740769824,-0.02384688832293878,-0.016857989093427835,-0.01313223277502818\n20080115 00:00,1397400,1401000,1379100,1379500,212525079,-0.024812667891983553,-0.024222649576800214,-0.017153004788293243,-0.013384203311173619\n20080116 00:00,1373800,1391200,1362800,1371400,334802665,-0.005871692642261728,-0.024258204103544977,-0.017184238028594902,-0.013413132889662414\n20080117 00:00,1375800,1377000,1329300,1332300,356115323,-0.0285110106460551,-0.024709252142106182,-0.017532311945167762,-0.013706311682835905\n20080118 00:00,1341800,1350100,1311100,1324900,323776666,-0.005554304586054215,-0.024751453805205128,-0.017572524701384637,-0.01374546416015345\n20080122 00:00,1264500,1322500,1260000,1310200,372500628,-0.011095176994490141,-0.024817076960440502,-0.017625965850477494,-0.013792411126848514\n20080123 00:00,1271200,1338800,1268400,1336200,446511338,0.019844298580369513,-0.02492277650212292,-0.017682046642541253,-0.013822040347093605\n20080124 00:00,1342800,1354500,1333200,1349900,237630863,0.010252956144289671,-0.024931754048132516,-0.0176859218099666,-0.013823195455375895\n20080125 00:00,1365000,1367600,1326000,1329800,251958732,-0.014889991851248285,-0.02499247757343895,-0.017733564547753853,-0.013863864873739192\n20080128 00:00,1332900,1353300,1320600,1353200,193975813,0.017596631072341662,-0.025054851472060838,-0.017755903840595635,-0.01386486186637867\n20080129 00:00,1361000,1364500,1348900,1360700,148947831,0.005542417972214109,-0.025039369137560857,-0.01773663364063542,-0.013843572369357753\n20080130 00:00,1355800,1385400,1351500,1353700,305837123,-0.005144410964944557,-0.025078624885871273,-0.017776920922220003,-0.013884409557513834\n20080131 00:00,1334000,1385400,1332000,1374400,277681778,0.0152914235059467,-0.02512569132001865,-0.017800973469959822,-0.013896193487567508\n20080201 00:00,1379200,1396100,1375200,1394500,174630458,0.014624563445867267,-0.025169506037021096,-0.0178210954588133,-0.013903684970714387\n20080204 00:00,1391900,1393000,1378900,1380200,111342814,-0.010254571531014722,-0.025259301932012746,-0.017898275798308702,-0.01397414000425577\n20080205 00:00,1358700,1362500,1336800,1337200,238458618,-0.03115490508621943,-0.025788386337644367,-0.018307861547942665,-0.014320021462555337\n20080206 00:00,1345700,1352500,1324100,1327200,229340555,-0.007478312892611472,-0.02584212905122671,-0.01835527700692967,-0.014364063885530146\n20080207 00:00,1320800,1347800,1317300,1337800,267321299,0.00798673899939728,-0.02584420218019765,-0.018349385266761276,-0.014353926103095787\n20080208 00:00,1332400,1342100,1321100,1331200,184790542,-0.004933472865899291,-0.02586859940162236,-0.01837116818284506,-0.014374315342675975\n20080211 00:00,1331000,1342200,1320400,1339100,169951567,0.005934495192307709,-0.02581774612499242,-0.018320610592320652,-0.014323915381320301\n20080212 00:00,1349100,1363000,1339800,1349200,225752737,0.007542379209917183,-0.02579479108625396,-0.01829157359784847,-0.014291636118751387\n20080213 00:00,1360200,1370600,1351600,1367100,162148026,0.013267121257041214,-0.025822841181943352,-0.018304818657785715,-0.014296988668911876\n20080214 00:00,1369400,1370000,1347900,1350100,208822459,-0.012435081559505567,-0.02593906786331898,-0.018410542860822218,-0.014397114039607853\n20080215 00:00,1345500,1351500,1339100,1350700,132777717,0.00044441152507213033,-0.02594167592221447,-0.018413386839208203,-0.014400083785801253\n20080219 00:00,1366700,1368800,1346100,1350300,130677687,-0.00029614274080103087,-0.025938510827529803,-0.018410297482290127,-0.014397034804406298\n20080220 00:00,1340000,1365500,1337700,1361100,205707963,0.007998222617196182,-0.025942538043049305,-0.018407198613019368,-0.014390137045702325\n20080221 00:00,1366600,1370000,1340700,1344800,184158985,-0.01197560796414665,-0.02604140704663341,-0.018489354871308962,-0.014463383801317177\n20080222 00:00,1349800,1356500,1328700,1356400,189835912,0.008625817965496774,-0.026038411562185927,-0.01847673143297943,-0.014445627736399208\n20080225 00:00,1355500,1376500,1347800,1373100,179679646,0.012312002359186058,-0.026038194624757423,-0.018458518934791033,-0.014417821871358247\n20080226 00:00,1367500,1389500,1365000,1383500,180031190,0.007574102396038063,-0.02602854632091985,-0.018441692698270166,-0.014397169105484242\n20080227 00:00,1375800,1391400,1374200,1381200,154524167,-0.0016624503071919206,-0.025354225538051497,-0.017925135198978193,-0.013964714628899227\n20080228 00:00,1372500,1379600,1365600,1370000,146116746,-0.00810889081957722,-0.025421660730953335,-0.01798996419493063,-0.014028154270901585\n20080229 00:00,1356000,1356800,1327800,1332500,215606264,-0.027372262773722622,-0.025832541220238956,-0.018309494171524443,-0.014298985627201454\n20080303 00:00,1331600,1338100,1322400,1333900,175197297,0.0010506566604127077,-0.02572961730856974,-0.01822218757015164,-0.014220004556159318\n20080304 00:00,1322600,1334000,1309900,1329200,268720531,-0.00352350251143263,-0.025676168587532116,-0.018177702378852738,-0.014180297789396603\n20080305 00:00,1334300,1347600,1323400,1337000,251947217,0.0058681913933194,-0.025628366322722033,-0.018154896146163904,-0.014170816848939399\n20080306 00:00,1329800,1332100,1306600,1308200,219263185,-0.02154076290201945,-0.025894563775914706,-0.018365325705257708,-0.014351516750045664\n20080307 00:00,1297200,1317400,1285800,1297100,283407216,-0.008484941140498359,-0.025960944795542628,-0.018431126738614856,-0.01441700859486798\n20080310 00:00,1297900,1299200,1275900,1278600,225098491,-0.014262585768252234,-0.02610128934953258,-0.01854759967274023,-0.014520755656775113\n20080311 00:00,1307100,1324500,1289600,1323900,288807446,0.0354293758798685,-0.026494848280787485,-0.018787905085710314,-0.014679362186227798\n20080312 00:00,1327500,1337700,1311600,1313100,210821412,-0.008157715839564927,-0.026306674816409727,-0.018640761703672314,-0.014554091789262516\n20080313 00:00,1296100,1326100,1286000,1319200,320576788,0.0046454953925825215,-0.02630411106277534,-0.01864187918158968,-0.01455717171809855\n20080314 00:00,1327700,1328100,1277800,1292600,421607705,-0.020163735597331756,-0.02655581834282711,-0.018846882402790126,-0.014737277178343241\n20080317 00:00,1263500,1292500,1260800,1279000,353331235,-0.01052142967662073,-0.026586389689947587,-0.01887165033782579,-0.014758951335870714\n20080318 00:00,1306000,1333800,1299800,1333200,296899685,0.04237685691946824,-0.027141060463679985,-0.01922791753328411,-0.015009450317899022\n20080319 00:00,1341500,1346500,1302400,1303600,315189081,-0.02220222022202223,-0.02743045206355272,-0.019465480159704368,-0.015219383110353252\n20080320 00:00,1300300,1329000,1292600,1327300,210173152,0.01818042344277382,-0.027442163823790628,-0.019472423345412125,-0.01522378418662402\n20080324 00:00,1333100,1358100,1332400,1347700,195960254,0.015369547201084854,-0.027476581248910413,-0.019478729260353034,-0.015215103959508904\n20080325 00:00,1348300,1355400,1337700,1350500,172378901,0.002077613712250459,-0.02747471130416077,-0.019476533133730017,-0.015212733946536158\n20080326 00:00,1344600,1345800,1334600,1338300,176224612,-0.00903369122547204,-0.02754363955000078,-0.019536499733195756,-0.015267923125480332\n20080327 00:00,1342000,1344400,1323700,1324500,206430063,-0.01031158932974674,-0.0275866281429512,-0.019571757695079867,-0.015299059916548457\n20080328 00:00,1329900,1333500,1310800,1314000,160978488,-0.007927519818799578,-0.027583879847631616,-0.019569499556317205,-0.015297063078432576\n20080331 00:00,1312800,1327300,1310900,1319400,136632600,0.004109589041095818,-0.02758387328319035,-0.01956948118887794,-0.015297038418858754\n20080401 00:00,1336000,1368400,1335200,1368000,223939346,0.03683492496589369,-0.027966026456950788,-0.019795391789316445,-0.015439656681599898\n20080402 00:00,1370600,1376600,1359900,1366600,195202819,-0.0010233918128654818,-0.027977845307653477,-0.019807886420317753,-0.015452511568577826\n20080403 00:00,1359400,1374300,1357100,1368000,154905062,0.0010244402165959787,-0.027976081981508038,-0.01981655893573164,-0.0154667473925115\n20080404 00:00,1369500,1379600,1361200,1369700,163249486,0.0012426900584794343,-0.0279750542894827,-0.0198154396431187,-0.015465579267964264\n20080407 00:00,1378700,1385700,1367500,1370500,140339108,0.0005840695042709232,-0.02798161872463217,-0.01982336353387918,-0.01547422787948061\n20080408 00:00,1361800,1369200,1359500,1364700,136136866,-0.004232032105071171,-0.02800825541260337,-0.019848244780519133,-0.01549817330684249\n20080409 00:00,1366200,1368000,1349000,1353900,175481616,-0.007913827214772517,-0.02807023137475044,-0.019904323576581385,-0.015551108345486066\n20080410 00:00,1354000,1366700,1349000,1359400,169304838,0.00406233842972159,-0.028017999613657776,-0.01985488313765847,-0.015503155950083189\n20080411 00:00,1344600,1350300,1330100,1332900,197516165,-0.019493894365161135,-0.02824763715949445,-0.02004726556566257,-0.015675677812624942\n20080414 00:00,1331900,1335400,1325500,1328100,144406756,-0.003601170380373664,-0.02827471636342992,-0.020074774725797346,-0.015703416180818604\n20080415 00:00,1335700,1336900,1323300,1335200,151883965,0.005345982983208986,-0.028262685808464767,-0.02007221808141344,-0.015705910043109488\n20080416 00:00,1345300,1365000,1345100,1362300,163122890,0.020296584781306137,-0.0283506386603569,-0.020113107816847168,-0.015721710605305732\n20080417 00:00,1360100,1368200,1356700,1364800,162693949,0.001835131762460529,-0.028346918789641063,-0.02010897669917478,-0.01571736025340254\n20080418 00:00,1389500,1395600,1382600,1389600,183614351,0.018171160609613102,-0.028400349418041773,-0.020124683356809774,-0.015712956401811407\n20080421 00:00,1382200,1389800,1378500,1387800,103874439,-0.0012953367875647714,-0.028406904248042306,-0.020142209059200018,-0.01573633063567736\n20080422 00:00,1381900,1383000,1369000,1376900,147890564,-0.007854157659605177,-0.028449295177523506,-0.02017857165437171,-0.01576947954813515\n20080423 00:00,1380800,1387800,1371200,1379800,174523494,0.002106180550512038,-0.0284408031166476,-0.020169491046629927,-0.015760085188236957\n20080424 00:00,1380900,1397400,1370400,1387900,205416157,0.005870416002319079,-0.028432984514975775,-0.020168289157325252,-0.01576241064381155\n20080425 00:00,1394000,1398900,1379100,1397600,178746207,0.006988976151019566,-0.028423139549959432,-0.02015265920945484,-0.015743696742987662\n20080428 00:00,1398900,1402400,1393900,1396200,96149678,-0.0010017172295363475,-0.0284276040611068,-0.020157058155695254,-0.015748060736818788\n20080429 00:00,1394000,1397300,1386200,1390700,127557013,-0.003939263715800001,-0.028395218279636876,-0.020129635199132852,-0.01572328344385077\n20080430 00:00,1393000,1405800,1383600,1384300,187426431,-0.004601998993312706,-0.028428171089739628,-0.020161264491486995,-0.01575420717379051\n20080501 00:00,1383900,1410200,1382700,1409300,174277769,0.0180596691468613,-0.0284918192279217,-0.020193173691522612,-0.015769196463343065\n20080502 00:00,1423300,1423500,1405700,1413400,155583107,0.002909245724827869,-0.02849333318176485,-0.02019583471591979,-0.01577246898680812\n20080505 00:00,1410500,1415500,1404100,1407100,112416820,-0.004457336918069932,-0.02852521147697148,-0.020226495839600945,-0.01580248124085291\n20080506 00:00,1400200,1421900,1396900,1418400,160469827,0.008030701442683474,-0.028525271772529715,-0.020219595169664196,-0.015791869705968277\n20080507 00:00,1418900,1420400,1391400,1392800,176599218,-0.018048505358150058,-0.028715241435632213,-0.02037420198296568,-0.015927624714893125\n20080508 00:00,1397500,1403200,1389800,1398400,163850260,0.004020677771395809,-0.028714691587464636,-0.020373146208242224,-0.015926299232594796\n20080509 00:00,1386000,1393900,1384500,1389300,136146489,-0.00650743707093826,-0.02863453356237178,-0.020308292494479824,-0.015869604190572498\n20080512 00:00,1392400,1405300,1387300,1404700,136486176,0.011084718923198844,-0.028639408500252525,-0.02031037483445854,-0.015870197806943022\n20080513 00:00,1408200,1408800,1397400,1404000,140874412,-0.0004983270449205879,-0.028633702316748253,-0.020304915401769798,-0.015864869916200994\n20080514 00:00,1411000,1422000,1408800,1409600,160657015,0.0039886039886039,-0.028619688640419073,-0.020289057618304487,-0.01584802904604512\n20080515 00:00,1410400,1426300,1408300,1425500,153317955,0.011279795686719662,-0.02863066185571365,-0.020293211973395515,-0.015848548291993295\n20080516 00:00,1428600,1428700,1416100,1426500,190670888,0.0007015082427217489,-0.028623368347186973,-0.02028593608561412,-0.015841281797766008\n20080519 00:00,1428000,1442200,1423300,1428300,156766647,0.0012618296529969264,-0.028627514905338273,-0.02029546108151341,-0.015853674018927053\n20080520 00:00,1422700,1423400,1410700,1416300,155971911,-0.00840159630329762,-0.028691007138872765,-0.020351797378405347,-0.015906195512473773\n20080521 00:00,1418100,1421200,1390400,1393100,230883524,-0.016380710301489798,-0.028851375297598028,-0.02048339128458002,-0.016022449971086393\n20080522 00:00,1394300,1401600,1392400,1395700,158574294,0.0018663412533199697,-0.028839477222910477,-0.020471133183914775,-0.016009999941904635\n20080523 00:00,1390400,1392000,1375700,1378600,166003660,-0.012251916600988788,-0.028877863297430438,-0.020502065346471844,-0.016036958451575815\n20080527 00:00,1378000,1390000,1375300,1387400,147828033,0.00638328739300742,-0.028878448363460357,-0.020501601901050485,-0.016035936048579558\n20080528 00:00,1391800,1393700,1380500,1393700,162036690,0.004540867810292726,-0.028873805471811703,-0.02049472453332869,-0.01602786748993135\n20080529 00:00,1391300,1409200,1390800,1400300,163649708,0.0047355958958168465,-0.028869214290294112,-0.020495833893963252,-0.016032015788493646\n20080530 00:00,1404700,1407400,1400600,1401000,102697673,0.0004998928800972191,-0.028866936265593272,-0.020493490497839505,-0.016029637543106243\n20080602 00:00,1398200,1398400,1380300,1388300,170549805,-0.00906495360456816,-0.028940667373206254,-0.020560784400106846,-0.016093499795023253\n20080603 00:00,1393300,1396200,1372300,1380100,254854683,-0.005906504357847675,-0.028981181920957534,-0.02059841074759224,-0.01612958645363404\n20080604 00:00,1377900,1391600,1374600,1380400,228312738,0.00021737555249612406,-0.028951064100929316,-0.020570833644640883,-0.016103363797555004\n20080605 00:00,1385700,1408200,1383200,1406400,218172776,0.01883512025499856,-0.028952423207384184,-0.020539747042567457,-0.01605498050832321\n20080606 00:00,1395800,1398000,1363500,1363800,346563277,-0.030290102389078477,-0.029220511570467754,-0.0207435702320152,-0.016224544171504544\n20080609 00:00,1368600,1375000,1354200,1366200,216423204,0.001759788825340891,-0.02920968933846942,-0.02074702604433551,-0.01623561155641842\n20080610 00:00,1356600,1371000,1355200,1361400,240148088,-0.003513394817742599,-0.029232503412440408,-0.020769165097863553,-0.01625739075904609\n20080611 00:00,1359700,1360800,1339400,1339500,262997245,-0.016086381665932126,-0.029305394834401206,-0.020826879645931072,-0.01630701457179972\n20080612 00:00,1346000,1357700,1335200,1344500,222258163,0.0037327360955581312,-0.02926635233112444,-0.020812643957184653,-0.01630600330408738\n20080613 00:00,1351800,1364200,1346100,1364000,216176831,0.014503532911863237,-0.029300563307149093,-0.02082578717284498,-0.016307915374654\n20080616 00:00,1355200,1369300,1354600,1363900,169113153,-7.331378299124669e-05,-0.029307065870898538,-0.020832982142769556,-0.016315479463748447\n20080617 00:00,1370600,1371100,1354500,1355000,171527978,-0.006525405088349534,-0.029343248715423608,-0.020865087614957895,-0.01634541130383147\n20080618 00:00,1347000,1350800,1337200,1343200,254184303,-0.00870848708487082,-0.02940903282407891,-0.02092400488210859,-0.01640066788318527\n20080619 00:00,1341500,1352400,1335200,1347100,293564153,0.00290351399642641,-0.029273974115995288,-0.020808593915781864,-0.016295731055287085\n20080620 00:00,1328400,1330900,1312300,1315900,258290018,-0.023160864078390575,-0.02956604227571602,-0.021049415666347,-0.016509233534757205\n20080623 00:00,1320400,1322200,1313200,1316300,145594140,0.0003039744661448296,-0.02947489805547183,-0.02097130927897266,-0.016438077567842206\n20080624 00:00,1310500,1324400,1302000,1312400,251628479,-0.0029628504140393197,-0.029467151401343337,-0.020964401608771933,-0.016431617156868906\n20080625 00:00,1317300,1334000,1316200,1320000,259333519,0.005790917403230678,-0.029440421069097902,-0.02093457411906205,-0.016400138583975057\n20080626 00:00,1305900,1307500,1281700,1282100,277734014,-0.02871212121212119,-0.02984831251047858,-0.021267894185744953,-0.016693704926741208\n20080627 00:00,1282900,1288600,1270400,1278000,270916380,-0.0031978784806176996,-0.029859535534036825,-0.02127838871522177,-0.016703811098718848\n20080630 00:00,1278900,1289100,1273000,1278400,239562749,0.0003129890453834605,-0.029845659793776597,-0.021264967673973595,-0.016690632455831484\n20080701 00:00,1265200,1284500,1259400,1283700,345449083,0.004145807259073875,-0.02982609054971346,-0.021260418413587646,-0.016694090293165764\n20080702 00:00,1287900,1291500,1260400,1260700,272417773,-0.017916958790994753,-0.03001412915194045,-0.02141756956144702,-0.016834775453393857\n20080703 00:00,1270900,1271200,1250500,1263800,210776761,0.0024589513762196535,-0.030011565932274983,-0.02141434954924009,-0.016831205307513385\n20080707 00:00,1267800,1273400,1239200,1250900,351738836,-0.010207311283430887,-0.030092739038088036,-0.02148765112050169,-0.016900310592832448\n20080708 00:00,1250000,1273900,1242100,1272800,340874944,0.01750739467583351,-0.030146808754117696,-0.02150644125473135,-0.016900293312548702\n20080709 00:00,1274900,1277400,1243900,1244300,316371135,-0.022391577624135794,-0.030283212440608737,-0.021612285100165437,-0.016989845819795162\n20080710 00:00,1244400,1257900,1236000,1253800,396109468,0.007634814755284047,-0.030285356442488306,-0.021612244648049426,-0.016988640843337188\n20080711 00:00,1239200,1257400,1224900,1240200,449501561,-0.010847025043866698,-0.030297218490204232,-0.02165552015230844,-0.01704866274504088\n20080714 00:00,1252800,1255000,1224100,1228200,298497953,-0.009675858732462461,-0.03036986382032036,-0.021720836681303212,-0.017110072317276438\n20080715 00:00,1218100,1234600,1200300,1214300,470793694,-0.011317375020355014,-0.03044917800011923,-0.02178849849762475,-0.017171522301745165\n20080716 00:00,1215600,1245700,1211100,1244700,329318028,0.02503499958824018,-0.03059173429431223,-0.021859890522419344,-0.017204976917850875\n20080717 00:00,1251500,1262600,1241100,1259000,334500668,0.011488712139471335,-0.03059307585694816,-0.021845456832459205,-0.01718213349910455\n20080718 00:00,1261700,1262800,1251500,1259200,225313674,0.00015885623510714098,-0.03060053669367273,-0.021855284845705914,-0.017193223445396005\n20080721 00:00,1265100,1267900,1255500,1259900,187264301,0.0005559085133417518,-0.030503189725398852,-0.021771654330538397,-0.01711690512062483\n20080722 00:00,1251700,1278000,1248900,1276900,274133491,0.013493134375744065,-0.03053042224456079,-0.0217807581947456,-0.017116344665956684\n20080723 00:00,1279000,1291400,1275800,1282200,288521277,0.004150677421881133,-0.030323110965263054,-0.021607168590443312,-0.01696073196181498\n20080724 00:00,1283700,1284100,1251600,1254300,235554635,-0.021759475900795522,-0.03057918538195724,-0.021818368328193345,-0.017148009174268564\n20080725 00:00,1259000,1263300,1251800,1257200,196081254,0.00231204655983408,-0.030338166693368078,-0.021620753710705078,-0.016973533106477163\n20080728 00:00,1254900,1260600,1234300,1235600,184425740,-0.01718103722558062,-0.03034268598387626,-0.021624279668176115,-0.016976529521781702\n20080729 00:00,1239900,1263000,1238500,1262700,242317674,0.021932664292651394,-0.0304426636534959,-0.021679263757301084,-0.017007527699633606\n20080730 00:00,1270200,1284700,1265100,1284500,334141761,0.017264591747842006,-0.030382264163752684,-0.0216016483570583,-0.016920734561207115\n20080731 00:00,1274400,1285700,1266300,1268500,250939559,-0.01245620864149477,-0.03048854472138636,-0.021701109216367816,-0.017016559864574787\n20080801 00:00,1271300,1272800,1254600,1261100,224290180,-0.005833661805281776,-0.03053072201509897,-0.021743024508945028,-0.01705833548531619\n20080804 00:00,1260400,1261400,1247600,1249200,178404175,-0.009436206486400756,-0.030242257673315617,-0.02151893768588069,-0.01686856807926641\n20080805 00:00,1260200,1284700,1259000,1284200,237970461,0.02801793147614484,-0.030306095366909192,-0.02155915707679836,-0.016896196640421773\n20080806 00:00,1280500,1293000,1276800,1290900,198361062,0.005217255879146565,-0.030305565520079698,-0.021560004777725895,-0.016897778706961276\n20080807 00:00,1279500,1284400,1265400,1268600,225325052,-0.017274769540630563,-0.03044984039838972,-0.021699256733442213,-0.017034352961229092\n20080808 00:00,1266000,1299300,1263900,1296200,238479064,0.02175626675074893,-0.03016628358866995,-0.021441360904516694,-0.016790136906212286\n20080811 00:00,1294500,1315000,1292300,1306500,232867329,0.00794630458262624,-0.030154566388788818,-0.021422402805642393,-0.016767318710878047\n20080812 00:00,1302900,1303500,1287300,1292400,201072811,-0.010792192881745155,-0.030235843633654523,-0.021492176339046404,-0.016830959658268734\n20080813 00:00,1287800,1296500,1276700,1288200,245406882,-0.0032497678737233304,-0.030053539613333957,-0.02134516540367005,-0.016702763335882005\n20080814 00:00,1278300,1302800,1277500,1295200,217081849,0.005433938829374263,-0.029932350327115408,-0.02123793496007653,-0.016602974299640316\n20080815 00:00,1299200,1305000,1293000,1300500,166418947,0.004092032118591771,-0.02993262952438646,-0.021240223293369633,-0.01660633369591242\n20080818 00:00,1304400,1304700,1276600,1282400,164317208,-0.013917723952326044,-0.029970034734108232,-0.02130753825868232,-0.01668959344125629\n20080819 00:00,1274200,1276900,1265400,1270000,169787570,-0.00966936993137868,-0.03003977238528056,-0.02136816734905506,-0.016745366791570952\n20080820 00:00,1273800,1279400,1263400,1277100,210797133,0.005590551181102299,-0.030035073868473695,-0.02135995251292376,-0.01673527741861915\n20080821 00:00,1267500,1284400,1266100,1279800,170542446,0.0021141649048626032,-0.030021305632706215,-0.021361473966864428,-0.016744949749567164\n20080822 00:00,1286900,1296400,1285600,1295100,148657687,0.011954992967651235,-0.03002735134554065,-0.021351137749160615,-0.01672588038531107\n20080825 00:00,1287900,1288300,1267600,1270800,160122280,-0.018763029881862403,-0.030219961705946524,-0.02152174609752172,-0.016884759542464618\n20080826 00:00,1270400,1278700,1265900,1274400,151392796,0.0028328611898016387,-0.030157096568742003,-0.021464274680375005,-0.016830163497522466\n20080827 00:00,1275500,1288300,1273000,1284600,151261792,0.008003766478342778,-0.02988925360655583,-0.02123971756591034,-0.016628681908308574\n20080828 00:00,1291900,1303400,1291300,1303100,145659356,0.014401370076288389,-0.029824639457055185,-0.02120205348215208,-0.01660538480487491\n20080829 00:00,1296800,1301300,1286100,1286900,164300951,-0.012431893177806796,-0.029907482917458438,-0.021270642897140864,-0.016666375440997135\n20080902 00:00,1300600,1307000,1275200,1281000,228921650,-0.004584660812805952,-0.0299348631023456,-0.02130583110461942,-0.01670572607642733\n20080903 00:00,1278900,1285000,1269300,1279600,242827927,-0.0010928961748634114,-0.029931037107819764,-0.021318033726281854,-0.016726473494069437\n20080904 00:00,1269700,1272200,1240000,1240700,325766260,-0.030400125039074744,-0.030292375454448992,-0.02159600322929122,-0.01695999937503274\n20080905 00:00,1233000,1249500,1221100,1246400,255219981,0.004594180704440953,-0.030292399736018837,-0.021596273525612365,-0.01696040082090748\n20080908 00:00,1280500,1282400,1251000,1272500,337437833,0.020940308087291415,-0.0302213565931493,-0.021502724561197006,-0.016854854086303786\n20080909 00:00,1271000,1273600,1229200,1229400,342304701,-0.03387033398821215,-0.030745847235041722,-0.021910311087699377,-0.017200119461469154\n20080910 00:00,1238900,1248900,1226000,1236000,269667230,0.005368472425573367,-0.03071226324919001,-0.02189734126979607,-0.017198138980221045\n20080911 00:00,1221200,1255300,1216000,1255100,330109363,0.015453074433656955,-0.03074289983990006,-0.021901039042323572,-0.01718747576845648\n20080912 00:00,1242900,1259800,1238300,1257400,263335532,0.0018325233049159007,-0.030743342782691908,-0.02190843426359723,-0.01719857722366344\n20080915 00:00,1217900,1242600,1201400,1203600,423505847,-0.04278670271989815,-0.031543082110241434,-0.022524569456472257,-0.01771683373172938\n20080916 00:00,1172500,1220900,1171600,1218500,498530783,0.012379528082419489,-0.031525138235820836,-0.022491246705531008,-0.017675312558621047\n20080917 00:00,1197000,1203700,1160300,1163500,539644642,-0.04513746409519903,-0.03219611102520404,-0.023051563621398312,-0.018176639237774246\n20080918 00:00,1179500,1217900,1138200,1205500,687599556,0.03609798023205846,-0.03252980922385042,-0.02325294244829343,-0.018307479097206893\n20080919 00:00,1276000,1279900,1233300,1250500,423412122,0.03732890916632092,-0.032834189135328755,-0.02341702952767954,-0.01839677658692677\n20080922 00:00,1244400,1247500,1203600,1207000,220080067,-0.03478608556577367,-0.03335642530798963,-0.0238261828246076,-0.01874564582123946\n20080923 00:00,1208600,1220200,1185000,1187000,296527384,-0.0165700082850041,-0.033480250525349954,-0.023927499573534572,-0.018834963388932147\n20080924 00:00,1191600,1196800,1178000,1188100,275213511,0.0009267059814659362,-0.033479288579817315,-0.023926432501902295,-0.01883384027496515\n20080925 00:00,1195700,1218900,1190700,1210000,279066804,0.018432791852537767,-0.03353730602627214,-0.02395162238152398,-0.018841529900179132\n20080926 00:00,1191400,1215000,1185100,1213300,259352240,0.0027272727272726893,-0.033538622047991,-0.02395373119837486,-0.01884406135318133\n20080929 00:00,1191400,1193400,1109700,1130200,422132892,-0.06849089260693975,-0.0352668648137705,-0.025251739339887773,-0.019912713008484365\n20080930 00:00,1135100,1167400,1127100,1165400,288617995,0.031144930100867052,-0.03545617310992635,-0.025365014957965355,-0.01998545588722028\n20081001 00:00,1152100,1166900,1139500,1160000,307831997,-0.004633602196670639,-0.03547628315096205,-0.025383943244452693,-0.020003754184730705\n20081002 00:00,1149500,1151100,1110600,1113600,314691321,-0.040000000000000036,-0.036086476968130464,-0.02585714022505257,-0.020403918658681932\n20081003 00:00,1128400,1154400,1096900,1099700,421344201,-0.012482040229885083,-0.036180733180864205,-0.025941015660967914,-0.02048226014088712\n20081006 00:00,1071200,1076200,1006500,1062800,560836430,-0.033554605801582205,-0.03663543728471993,-0.026312381419725518,-0.020809198536247752\n20081007 00:00,1068400,1073200,996500,997400,483905229,-0.0615355664283026,-0.03795424338567982,-0.027313319593691474,-0.021640682494532153\n20081008 00:00,975000,1021800,968100,983900,628550992,-0.013535191497894505,-0.03805404098985542,-0.027408680100224427,-0.021733677600730295\n20081009 00:00,996400,1006200,909000,917200,489731456,-0.06779144221973776,-0.03958166457567715,-0.028564848851492512,-0.02269182515418305\n20081010 00:00,870700,939300,835800,904500,791887655,-0.013846489315307409,-0.03965796874267387,-0.028629830078757745,-0.022750770164175427\n20081013 00:00,939500,1009200,931700,1006800,398191241,0.11310116086235489,-0.042824393479714506,-0.030742498069362332,-0.02430168433244524\n20081014 00:00,1046600,1055300,971100,999100,492175724,-0.007647993643226103,-0.04282271139216591,-0.03074103719752506,-0.02430034138988511\n20081015 00:00,974600,977700,905000,907500,441809518,-0.09168251426283658,-0.045215528312323755,-0.032531508870058436,-0.025769705039753246\n20081016 00:00,912100,947700,865400,944100,663194641,0.04033057851239663,-0.045499682899938255,-0.03268750343238972,-0.025857377966833444\n20081017 00:00,920400,985800,916600,940900,442697520,-0.0033894714542951343,-0.04550833063670216,-0.032695973159157454,-0.02586575279713091\n20081020 00:00,954300,985500,943700,984900,278574190,0.04676373684769897,-0.045663524425786424,-0.032722245345908445,-0.025823297354723485\n20081021 00:00,970300,986400,952300,955000,302530501,-0.030358412021525005,-0.045994603029952924,-0.03299651038417975,-0.026067275291241913\n20081022 00:00,932000,935000,875300,903900,457390740,-0.05350785340314135,-0.046861322476180606,-0.03368187336525396,-0.02665595781181168\n20081023 00:00,903900,924400,858100,910400,593520712,0.007191060958070539,-0.04684235623418589,-0.03365719635628742,-0.02662823641410388\n20081024 00:00,840100,898600,838100,875400,507077944,-0.03844463971880496,-0.047307247243705663,-0.034028749865438454,-0.026950032047182798\n20081027 00:00,859800,895100,846800,848200,361805538,-0.03107151016678089,-0.047624248352401144,-0.03430537018586567,-0.027205125518804243\n20081028 00:00,873900,941300,845400,937700,586539158,0.10551756661164813,-0.04987388934765411,-0.03577749202887518,-0.028262754778787844\n20081029 00:00,936100,971700,921000,923600,491961890,-0.015036792151007838,-0.049944540455940274,-0.03583783052832198,-0.028317595664621862\n20081030 00:00,958200,965100,929100,954400,384751908,0.03334776959722818,-0.05009407856502654,-0.035917935075213306,-0.02836068543643039\n20081031 00:00,950300,985700,944800,971300,382066156,0.017707460184409163,-0.049872726058763306,-0.03571072686682171,-0.02816101750089637\n20081103 00:00,968400,976900,959500,967400,192755777,-0.004015237310820541,-0.049895605912556464,-0.035734116043619785,-0.02818467819590373\n20081104 00:00,990300,1008600,982000,1002800,323448071,0.0365929295017573,-0.05004351838635189,-0.03578908192903364,-0.02819009459897934\n20081105 00:00,992100,1002000,950900,957000,358790224,-0.04567211806940563,-0.05066134557847791,-0.036293718409465256,-0.0286343895298435\n20081106 00:00,945000,954400,901100,908100,448081103,-0.05109717868338559,-0.05111113969450813,-0.03663675152362961,-0.028920508748958268\n20081107 00:00,916500,934100,908600,931300,333639323,0.025547847153397196,-0.05116894528911991,-0.03664745165114163,-0.028906097126262624\n20081110 00:00,952100,955300,909200,921700,270329844,-0.010308171373349051,-0.051123915094097076,-0.03660970916092709,-0.028872239684514866\n20081111 00:00,907100,920300,886500,901600,394940198,-0.02180752956493437,-0.05125342414225865,-0.03671646642708471,-0.028966868059874033\n20081112 00:00,882300,889500,851200,857300,419693221,-0.04913487133984029,-0.05184228054228709,-0.03722384635677439,-0.029430813184711517\n20081113 00:00,860900,916500,821000,910500,697477299,0.06205528986352493,-0.0524336370753747,-0.03756127852934761,-0.0296328792202846\n20081114 00:00,893800,920600,872300,876800,493637570,-0.03701263042284464,-0.05277584332032845,-0.03783251276298543,-0.029866278537305904\n20081117 00:00,864100,885500,851600,853000,388638068,-0.027144160583941646,-0.05302846434540788,-0.038048122276268546,-0.03006215735060319\n20081118 00:00,851300,870000,829100,861700,493249855,0.010199296600234442,-0.05290279615438773,-0.03792767066103918,-0.02994448667262513\n20081119 00:00,858900,868600,809300,813400,519670115,-0.05605199025182783,-0.053749130269468925,-0.03859641657763479,-0.03051856097773332\n20081120 00:00,800700,825100,750800,759500,770818769,-0.0662650602409639,-0.05475398486682675,-0.039364667893364756,-0.031160679959524817\n20081121 00:00,774400,805300,743400,802700,660786257,0.056879526003950076,-0.05523263561571551,-0.039656406308579334,-0.031352776101284806\n20081124 00:00,819200,869800,811700,848900,471391231,0.05755574934595731,-0.05553202922811456,-0.03977409536385348,-0.03137359912951259\n20081125 00:00,872300,875000,838300,860600,417610243,0.013782542113323082,-0.05552565936239915,-0.03977230863023192,-0.03137425564665142\n20081126 00:00,843400,891500,842400,890200,323021713,0.03439460841273534,-0.05557533405896229,-0.03980132582956677,-0.03139226041065228\n20081128 00:00,886600,900400,884800,898200,108195975,0.008986744551786163,-0.05556221812500671,-0.03978168414958238,-0.031369139879606996\n20081201 00:00,874600,875400,819700,821300,337001207,-0.08561567579603657,-0.05730010419159087,-0.04111938367496898,-0.03249350144068163\n20081202 00:00,834400,854900,822400,852700,446305503,0.03823207110678184,-0.05743577139361927,-0.04116381628809252,-0.032489297232053106\n20081203 00:00,834400,878200,831400,874100,476978867,0.02509675149525048,-0.057444651476759465,-0.04113296359035356,-0.03243726313584971\n20081204 00:00,860400,880500,837400,850000,411156280,-0.027571216107996843,-0.05768461640420201,-0.04135300655559239,-0.03264668577675449\n20081205 00:00,835800,884200,822500,879700,431229520,0.03494117647058825,-0.05781200804250929,-0.04142003156505202,-0.032681529559748596\n20081208 00:00,904000,923800,898000,910600,384623763,0.03512561100375122,-0.0579249267451271,-0.04145626875876586,-0.032676888124808436\n20081209 00:00,903600,921300,889800,895500,339702496,-0.016582473094662875,-0.05804642734885886,-0.04157132362092701,-0.03278850678598931\n20081210 00:00,903400,913600,890000,902500,345648209,0.007816862088218857,-0.057830869687704595,-0.04138084582993333,-0.032611398980975814\n20081211 00:00,895100,910000,873700,880300,324318387,-0.02459833795013855,-0.05804106239009386,-0.041565037896757945,-0.032781730205190436\n20081212 00:00,855600,889000,852100,884700,352878065,0.00499829603544244,-0.05803293967436927,-0.04155480942647254,-0.03277037916494053\n20081215 00:00,890100,891400,862900,874800,232084190,-0.011190233977619535,-0.05800840245124379,-0.04153396194634983,-0.03275149867315952\n20081216 00:00,883500,920200,881800,918700,337674741,0.050182898948331056,-0.05823432148818956,-0.041618696503671115,-0.03276096830681447\n20081217 00:00,908500,924300,900700,910200,248346838,-0.009252204201589231,-0.05829427839639378,-0.041677854763614235,-0.032819700810324814\n20081218 00:00,913600,916700,882100,892000,327981859,-0.019995605361459057,-0.0584326511366227,-0.04179742164927099,-0.03292924236449599\n20081219 00:00,891000,903800,880900,882800,263071879,-0.010313901345291532,-0.058500596169040346,-0.04186471623196217,-0.032996190194844836\n20081222 00:00,886500,886700,854900,865700,214633316,-0.019370185772541904,-0.05864860761002705,-0.042005054427073286,-0.033132437810972803\n20081223 00:00,874900,879300,858000,861900,208760330,-0.004389511378075528,-0.05867997195949164,-0.042040177475255555,-0.033169564607533245\n20081224 00:00,864700,868600,860000,865600,60804665,0.004292841396913882,-0.05867493138996357,-0.04203380476613697,-0.03316248173972823\n20081226 00:00,872800,873000,865000,871000,69614698,0.006238447319778295,-0.05858634345577053,-0.04194867358291471,-0.03307919333765756\n20081229 00:00,873300,873300,856100,868900,110883286,-0.002411021814006875,-0.05859581154875012,-0.041958328414097606,-0.03308894771828567\n20081230 00:00,876700,890500,870900,888700,159248150,0.022787432385775075,-0.05858287783427422,-0.04191386894874279,-0.03302768199179126\n20081231 00:00,890700,909700,888700,903300,173715289,0.01642849105434907,-0.05850574861405453,-0.04182546931777076,-0.032933274146550784\n20090102 00:00,905000,934400,898600,930300,214236568,0.02989040185984715,-0.05857058615814633,-0.04183576169615891,-0.03291448869893446\n20090105 00:00,926000,936600,918900,928400,206399365,-0.002042351929485098,-0.058381571951917295,-0.04167608638033404,-0.032770453837022075\n20090106 00:00,936900,944500,926800,934400,293506649,0.006462731581214909,-0.05837745117843677,-0.04167003173982331,-0.03276336825915339\n20090107 00:00,920000,922600,902000,906200,249972498,-0.030179794520547976,-0.05852270168398256,-0.04178603816510829,-0.03286378477346248\n20090108 00:00,901600,910900,896700,910100,245799625,0.004303685720591588,-0.05852215403045652,-0.041797146022922886,-0.03288110614124416\n20090109 00:00,912700,913100,888100,890100,301818019,-0.02197560707614543,-0.05870293402118702,-0.04195893613577955,-0.03303277282047406\n20090112 00:00,888600,889100,864100,869400,227448562,-0.023255813953488413,-0.05881189978858077,-0.042048504777236935,-0.03311200092586949\n20090113 00:00,866800,877700,862100,870500,330756708,0.0012652403956752156,-0.05882263771697602,-0.04206649765111424,-0.03313386138433799\n20090114 00:00,856100,857500,836900,842100,386919869,-0.03262492820218266,-0.05893332849352735,-0.042153843638004514,-0.033208762350242095\n20090115 00:00,841500,852500,817200,844400,468049820,0.002731267070419152,-0.05889940874144882,-0.04211985973751269,-0.03317474425246851\n20090116 00:00,859000,859600,830500,850200,368389974,0.006868782567503562,-0.05863541444828772,-0.04189207306548917,-0.03296625972929526\n20090120 00:00,842900,844600,804700,805400,364223238,-0.05269348388614448,-0.05931031209977663,-0.04242406070925939,-0.03342206257675704\n20090121 00:00,819900,842400,804700,840200,336621069,0.04320834368015891,-0.05945154398852903,-0.04246079230907971,-0.03340308545922754\n20090122 00:00,824300,840400,811700,828400,397576509,-0.014044275172578002,-0.059530322505357676,-0.042555887902221395,-0.03350687962537403\n20090123 00:00,808800,839900,805800,831100,362037373,0.0032592950265573073,-0.059536324390794794,-0.04256826157883114,-0.033522650080280506\n20090126 00:00,835700,853600,828100,837300,298668074,0.007459992780652236,-0.059429783974551384,-0.0424669502485526,-0.033424126356380784\n20090127 00:00,840800,851400,833000,845900,258161815,0.010271109518690924,-0.05941662935326217,-0.04246616502244102,-0.033429935209068236\n20090128 00:00,864200,879500,860700,873800,308654914,0.03298262205934499,-0.05951965212269099,-0.0425071088871765,-0.03343778503942074\n20090129 00:00,861300,863500,844700,845700,272661772,-0.032158388647287706,-0.059798625076959565,-0.04273576115487135,-0.033639611535303544\n20090130 00:00,850000,852500,822100,826900,334101048,-0.022230105238264186,-0.05997309970869664,-0.04290274232335406,-0.033802597966253234\n20090202 00:00,815100,831800,813100,825200,262320515,-0.002055871326641645,-0.0599897761944179,-0.04293392423872556,-0.03384151267249719\n20090203 00:00,830900,843600,822200,837200,257121011,0.014541929229277661,-0.05992683483740829,-0.04286059576282001,-0.03376264686194342\n20090204 00:00,843200,853700,830400,833300,297968491,-0.004658385093167738,-0.05966172556899216,-0.04264234740630256,-0.03356937988416086\n20090205 00:00,827400,852900,821300,845700,364376526,0.014880595223808912,-0.059616308586149615,-0.042584243272199,-0.03350451227666602\n20090206 00:00,848600,873400,846900,870000,315637676,0.02873359347286275,-0.05968607963277292,-0.04260945728452903,-0.033505973098887594\n20090209 00:00,869800,877400,863200,871300,218051063,0.0014942528735633065,-0.059659766763725385,-0.04258338053605293,-0.03348002222541443\n20090210 00:00,862600,870300,824500,829200,481916722,-0.048318604384253394,-0.06026938399362839,-0.04307748121372118,-0.03391254145652939\n20090211 00:00,834500,840500,824100,836300,300434035,0.008562469850458276,-0.060268946370120875,-0.043075985951180784,-0.03391048237053412\n20090212 00:00,821500,838200,810000,836100,427359756,-0.00023914863087404203,-0.06028223890024767,-0.0431010853111452,-0.03394187590779645\n20090213 00:00,835100,842300,827400,827400,271057308,-0.010405453893075012,-0.060266878332773714,-0.043087865150344844,-0.03392979678987369\n20090217 00:00,801700,806200,791700,791900,417596871,-0.04290548706792363,-0.060749202755611534,-0.04347928813946298,-0.03427276056103622\n20090218 00:00,798100,799400,782800,789700,335062611,-0.0027781285515847687,-0.06075881186221682,-0.04348896756582721,-0.03428247747460373\n20090219 00:00,797700,801500,780200,782800,283119967,-0.00873749525136125,-0.06081622456540393,-0.043549016453421005,-0.03434393170235013\n20090220 00:00,767000,783300,757700,773800,444706361,-0.011497189575881417,-0.06081259973398863,-0.043545897348044614,-0.034341082197653756\n20090223 00:00,782600,782600,745900,746500,348341421,-0.03528043422072891,-0.06116915255775143,-0.04384903977402368,-0.034615751738207495\n20090224 00:00,752700,779500,748400,774700,396714741,0.037776289350301306,-0.06131866454566944,-0.04392515099985977,-0.03465273328938076\n20090225 00:00,771900,784200,756300,768300,441636709,-0.00826126242416414,-0.061372117609187864,-0.04398135356225036,-0.034710401599446196\n20090226 00:00,778300,783800,755400,755400,332689554,-0.01679031628270211,-0.06147163696689922,-0.04406930502724054,-0.034792186263631106\n20090227 00:00,740200,755800,738200,739300,406261222,-0.021313211543553034,-0.06158447642913806,-0.04416443843511021,-0.03487788063943387\n20090302 00:00,725000,729200,703800,705800,385024335,-0.045313134045718906,-0.06187765191601959,-0.04439258531934962,-0.0350713610162285\n20090303 00:00,715600,717000,696400,700700,419242719,-0.007225843015018385,-0.06191312769236443,-0.04442728990848178,-0.035105654488311176\n20090304 00:00,713200,728700,704100,716700,420665680,0.02283430854859425,-0.061921029154136095,-0.04440223613442093,-0.03506303239997147\n20090305 00:00,700600,708600,681700,687900,438558253,-0.040184177480117156,-0.06235145465484593,-0.04476010536031715,-0.03538222214424276\n20090306 00:00,694500,704500,671000,688400,434093626,0.000726849832824561,-0.062197897669294816,-0.0446256465315017,-0.035257944472114645\n20090309 00:00,679700,700000,677300,681100,329682326,-0.010604299825682784,-0.06221188936181134,-0.04463800313463047,-0.03526942941514109\n20090310 00:00,695100,723600,693700,721600,371711244,0.05946263397445306,-0.06256965126476716,-0.04480525573744916,-0.035335122214993575\n20090311 00:00,730300,737400,718400,726100,332178093,0.006236141906873716,-0.06244816464646729,-0.04475329480330522,-0.03532022516580897\n20090312 00:00,725800,757500,719700,755300,358429127,0.04021484643988438,-0.0625658336863593,-0.044780260840421186,-0.03529883776777113\n20090313 00:00,759500,763800,747300,761500,310083362,0.008208658811068359,-0.06256216201892466,-0.044773522652616485,-0.03529046482930412\n20090316 00:00,769800,779600,758100,759600,320386601,-0.0024950755088640753,-0.06243225820616372,-0.044661134103820076,-0.035187413602915905\n20090317 00:00,760000,782900,754500,782400,311355607,0.03001579778830954,-0.0624359355552413,-0.0446166103087619,-0.035117193956276466\n20090318 00:00,777700,809000,770700,798900,441475581,0.02108895705521463,-0.06226798607791021,-0.04452260779849736,-0.03506261230053095\n20090319 00:00,809700,810000,786900,788400,407724426,-0.013143071723619948,-0.062180428443546876,-0.044450168705287466,-0.03499823284566718\n20090320 00:00,787600,788600,765300,766500,391019636,-0.02777777777777779,-0.06241273457833958,-0.044667847367768965,-0.03520811365678526\n20090323 00:00,791100,822700,784000,822200,365790289,0.0726679712981082,-0.06311124915111746,-0.04509512640476925,-0.03549079803330872\n20090324 00:00,812100,823600,805100,806000,313719679,-0.019703235222573556,-0.06325231786630979,-0.04522018949662368,-0.035607328586586925\n20090325 00:00,812800,827000,790600,813200,414247151,0.008933002481389618,-0.0631911647794048,-0.04515606496591603,-0.035541619990183244\n20090326 00:00,823000,833000,814800,831100,386807953,0.022011805213969504,-0.06314675317057286,-0.0450870881292202,-0.035459547521411276\n20090327 00:00,820800,825300,813200,816100,296952930,-0.018048369630610073,-0.06322750108385611,-0.04515594659255484,-0.03552206776297257\n20090330 00:00,797300,798800,779600,787600,305114129,-0.03492219090797699,-0.0635702350452441,-0.04544365184014911,-0.035780437406864804\n20090331 00:00,795500,810700,790500,794400,327264261,0.008633824276282454,-0.06344107770609565,-0.04538511395286067,-0.035759546488051505\n20090401 00:00,785100,814200,783300,810000,338214148,0.01963746223564944,-0.06343905665504544,-0.04535966704771696,-0.03572161134677266\n20090402 00:00,831600,846100,827300,833900,416144835,0.029506172839506073,-0.06349428746385807,-0.04536560865406643,-0.03570127706167264\n20090403 00:00,835100,842800,826700,842700,257432702,0.010552824079625767,-0.06348163221807254,-0.04534583782949054,-0.03567771294837322\n20090406 00:00,833800,838100,822900,834800,246697212,-0.009374629168150017,-0.06353086929338461,-0.045392227929909386,-0.03572258533701108\n20090407 00:00,822200,826500,815100,816100,237625682,-0.02240057498802106,-0.06367673926432288,-0.04551648652086756,-0.03583532298126992\n20090408 00:00,820400,829400,815400,824900,216767229,0.010782992280357728,-0.06362258698718935,-0.04545646318131595,-0.03577216980006779\n20090409 00:00,847300,858200,843400,858200,239538116,0.04036852951872949,-0.06377765474536749,-0.04552389909651234,-0.03579288950403256\n20090413 00:00,849500,865400,845800,858300,192944102,0.00011652295502218024,-0.06364375375357711,-0.045406427064425325,-0.035684175689571745\n20090414 00:00,850500,857600,840800,843800,235242383,-0.016893859955726453,-0.06373715124863018,-0.04548791667852865,-0.03575931725640321\n20090415 00:00,838900,854200,836100,853100,229423934,0.011021569092201977,-0.06373351213145348,-0.04547874584787382,-0.035747197489762045\n20090416 00:00,859700,871500,847800,866200,267945977,0.015355761340991592,-0.06372019208548939,-0.045475071484108454,-0.03574866520348514\n20090417 00:00,868500,876500,861400,871400,222571320,0.006003232509812939,-0.0637113707664332,-0.04546398898441588,-0.0357363772767623\n20090420 00:00,855300,856600,833400,834100,247170330,-0.0428046821207253,-0.06418032094696742,-0.04586644554024974,-0.03610338632731313\n20090421 00:00,827900,851300,827600,850800,267436289,0.02002158014626554,-0.06417643941275933,-0.045838920510375115,-0.03606325703738611\n20090422 00:00,843200,863400,840700,845700,310130610,-0.005994358251057874,-0.06416563293879118,-0.04582911776235395,-0.03605398937195323\n20090423 00:00,847400,854200,836300,853700,288723780,0.009459619250325124,-0.06415504326524876,-0.045813082036007056,-0.03603505037500817\n20090424 00:00,860400,873100,856900,866800,262958864,0.015344968958650673,-0.06415701579395511,-0.04580346270387027,-0.03601925146474898\n20090427 00:00,857500,870100,855400,858400,262642484,-0.009690816797415791,-0.06422212898969677,-0.04586889124388967,-0.036084848113635964\n20090428 00:00,849700,865900,847600,855600,228247982,-0.0032618825722273703,-0.06423153020263246,-0.04587816581544656,-0.03609405517314244\n20090429 00:00,865300,883600,863000,873600,279418010,0.02103786816269282,-0.06421900334965026,-0.045840273136721496,-0.0360426400665744\n20090430 00:00,885800,890200,869400,875500,274331659,0.002174908424908528,-0.06419270337329766,-0.04581379958595234,-0.03601607398392604\n20090501 00:00,874800,882000,867200,878400,200655255,0.0033123929183322964,-0.06418951479094742,-0.045828688559061366,-0.03604060003495847\n20090504 00:00,885400,909300,883800,909200,255326586,0.03506375227686709,-0.06428756046012066,-0.0458606330437052,-0.03603730622272227\n20090505 00:00,906100,909200,898400,905600,225570150,-0.003959524857017116,-0.06428510313311951,-0.04585831688218868,-0.036035065316003256\n20090506 00:00,917100,922000,906100,921100,266625770,0.01711572438162534,-0.06429244349672122,-0.04585294572174219,-0.03602291768912282\n20090507 00:00,930900,931500,902900,909000,280867573,-0.0131364672673977,-0.06424896180868615,-0.045816491653388566,-0.035990210018817234\n20090508 00:00,920600,932200,914400,929900,270335585,0.022992299229922963,-0.06426979872085067,-0.04580917026903766,-0.03596787755078742\n20090511 00:00,916800,921000,910400,911400,228667168,-0.01989461232390577,-0.06437750587072105,-0.045900887420261376,-0.0360510704929\n20090512 00:00,916300,918200,898500,910100,270140180,-0.001426377002413881,-0.06440080256289504,-0.04593190338942634,-0.03608620158006541\n20090513 00:00,897000,900000,885000,888000,246186091,-0.02428304581914076,-0.06458450360908699,-0.04608943930917724,-0.03622978896772874\n20090514 00:00,887200,901100,885000,894500,231484683,0.007319819819819884,-0.06457935834087483,-0.04608192884137799,-0.03622101762078151\n20090515 00:00,893500,899900,881500,887300,219327984,-0.008049189491335929,-0.06463566118068038,-0.046144207627432314,-0.03628648216166841\n20090518 00:00,895900,913100,893700,912400,193916284,0.028288064916037525,-0.0646763403172443,-0.04614090104309861,-0.03625972695228348\n20090519 00:00,912000,919700,908200,911200,185180240,-0.0013152126260411734,-0.06468535283899471,-0.04615026915336643,-0.036269284625474144\n20090520 00:00,919600,928000,904100,905100,264998947,-0.006694468832309064,-0.06467500800317623,-0.04614097028714604,-0.03626054336177612\n20090521 00:00,894600,898000,882600,892400,237713218,-0.014031598718373672,-0.06465463450454512,-0.0461238343182452,-0.03624513330799475\n20090522 00:00,894100,900000,886800,890400,156576575,-0.0022411474675033682,-0.06466922783985737,-0.04613892748474882,-0.03626049293265697\n20090526 00:00,883300,915600,883200,913000,219235499,0.02538185085354905,-0.06462120534125117,-0.046061224330206846,-0.03616696713026223\n20090527 00:00,914500,917500,895300,897100,224229578,-0.017415115005476434,-0.06474968116927483,-0.04617972894418731,-0.0362801561269325\n20090528 00:00,904200,913400,891000,909300,267221840,0.013599375766358168,-0.06474580559906587,-0.04616645833584452,-0.0362618770585248\n20090529 00:00,914400,926800,906800,924100,211070697,0.016276256461013938,-0.06474631372660697,-0.04615340177587192,-0.036241589213831735\n20090601 00:00,936800,951700,934300,947800,249479392,0.02564657504599066,-0.06476857671855071,-0.04613991029751555,-0.036209037159659764\n20090602 00:00,944300,953600,941600,948800,215142967,0.001055074910318643,-0.06471864731317792,-0.046092843138975596,-0.03616349585431529\n20090603 00:00,940500,941300,927600,936400,213928309,-0.013069139966273235,-0.06476731504700957,-0.0461355803055523,-0.03620307145743312\n20090604 00:00,940000,946700,933000,946000,193801501,0.010252029047415734,-0.06474919781053852,-0.04611110531616267,-0.036175207173488044\n20090605 00:00,955000,956600,938000,945300,246374405,-0.0007399577167018778,-0.06475909146621607,-0.04614085638074344,-0.03621554414927722\n20090608 00:00,938300,951000,930400,943000,208098876,-0.0024330900243308973,-0.0645046132587941,-0.045928543208033426,-0.03602570900054991\n20090609 00:00,946700,951400,940200,946200,196817698,0.0033934252386003116,-0.06450016731982199,-0.04592350061274986,-0.0360203483299945\n20090610 00:00,954800,954900,932000,943400,273297871,-0.002959205242020757,-0.0644975629281181,-0.04592101493058298,-0.03601792593144254\n20090611 00:00,946000,961100,945700,948500,235728412,0.005405978376086473,-0.06438085821189961,-0.04581351386598881,-0.03591533129947324\n20090612 00:00,943800,951300,940000,950900,171740144,0.002530311017395981,-0.06438393900859363,-0.045817089955640156,-0.035919171427967425\n20090615 00:00,940000,940200,924200,928800,202851363,-0.023241139972657532,-0.06457594724222146,-0.04599672772940477,-0.03609221455535305\n20090616 00:00,931800,932900,915800,916400,198767295,-0.013350559862187805,-0.06465359863242856,-0.046067066043887404,-0.036158654296227374\n20090617 00:00,916000,923300,908300,915200,203008787,-0.0013094718463553257,-0.06462807694177987,-0.04604295739070761,-0.036135298928093626\n20090618 00:00,916500,926700,912600,920800,187412736,0.006118881118881037,-0.06456854132750546,-0.045983625916293486,-0.03607607627988364\n20090619 00:00,925500,927000,915200,920400,177671400,-0.0004344048653345256,-0.06457910033356593,-0.045994971981392435,-0.03608784192324368\n20090622 00:00,911300,911800,892600,892700,218156368,-0.030095610604085166,-0.06466663220267194,-0.04606492327380819,-0.03614842107527884\n20090623 00:00,894900,898700,888500,893600,178329012,0.0010081774392292076,-0.06466427354328377,-0.046062436949485495,-0.03614586669325193\n20090624 00:00,901900,910800,896000,901500,191834872,0.00884064458370637,-0.06463378663102809,-0.04602715968105184,-0.03610803570366544\n20090625 00:00,896600,921700,895700,920000,243790166,0.020521353300055445,-0.06464652504534643,-0.04601904253168673,-0.03608880053047202\n20090626 00:00,917600,922400,912800,918900,145646076,-0.0011956521739130421,-0.06440705179808165,-0.0458177345526232,-0.03590783831466456\n20090629 00:00,921300,928200,916000,926800,145470021,0.008597235825443361,-0.0643747797069371,-0.0457812048086918,-0.035869038831786985\n20090630 00:00,927200,930600,912700,919200,197335184,-0.008200258955545991,-0.06441730419970661,-0.04582116843728763,-0.03590763727316773\n20090701 00:00,923800,932300,922200,923400,150650842,0.004569190600522299,-0.06441638543792952,-0.04582002664670275,-0.035906376586750686\n20090702 00:00,911600,911600,897600,898500,163342826,-0.026965562053281378,-0.06451829738513704,-0.04590260275591087,-0.03597864483226925\n20090706 00:00,889900,899300,886600,898000,156432184,-0.0005564830272676291,-0.06452828972913142,-0.045913173277282955,-0.03598952357786197\n20090707 00:00,897300,898200,880000,881100,177457069,-0.018819599109131446,-0.06460194031946975,-0.04597525987064935,-0.03604544544723261\n20090708 00:00,885500,888000,870100,880000,226760296,-0.0012484394506866447,-0.06461792626032944,-0.046008366152100945,-0.03608767851890376\n20090709 00:00,885800,889000,879100,882000,149577524,0.002272727272727204,-0.06444453093022866,-0.04585709442556862,-0.03594820080357036\n20090710 00:00,877700,884900,873500,879500,159588401,-0.0028344671201814275,-0.06447392371352323,-0.045890047084270434,-0.03598305121867926\n20090713 00:00,882700,901700,875900,901300,195240615,0.024786810687890792,-0.06442855241126125,-0.045816543357461215,-0.03589455020044162\n20090714 00:00,903900,906900,897300,906300,163668573,0.005547542438699704,-0.06436194353833542,-0.045751750325050855,-0.03583072518589096\n20090715 00:00,918300,935100,916800,932500,187131063,0.028908749862076588,-0.06433256755872398,-0.045684217692700466,-0.035742851383155555\n20090716 00:00,930100,945100,928200,941200,187206613,0.009329758713136682,-0.0642996636014272,-0.045679209908963514,-0.03575271494631982\n20090717 00:00,940600,943200,935400,941700,124450720,0.0005312367190819511,-0.06431798222772014,-0.045704900057587546,-0.03578233482622188\n20090720 00:00,947300,952800,941900,950700,140762992,0.009557183816502057,-0.06429860785758414,-0.045680275925492606,-0.035754912065452206\n20090721 00:00,958900,959000,944200,955700,192789308,0.005259282633848672,-0.06428575366451643,-0.045665719719251846,-0.03573944852228682\n20090722 00:00,949600,961300,948900,955500,174355740,-0.0002092706916396736,-0.06430575271955338,-0.04569578895865878,-0.03577488613971893\n20090723 00:00,956000,980800,955300,977000,221948744,0.02250130821559404,-0.06432049436314975,-0.045684879781866014,-0.03575030260549182\n20090724 00:00,971200,981400,966900,981000,139178807,0.004094165813715467,-0.0641461985374643,-0.04553158877125037,-0.03560820918406628\n20090727 00:00,979600,984000,973400,983500,140972764,0.0025484199796126372,-0.06414550382502694,-0.04553082279170012,-0.03560740521228187\n20090728 00:00,976800,983700,970600,981100,172827421,-0.002440264361972533,-0.06404078787380522,-0.045439647043914726,-0.03552344769684589\n20090729 00:00,973800,979300,969800,976800,171353315,-0.004382835592702028,-0.06406142069189498,-0.04548482690932573,-0.035581713502353014\n20090730 00:00,988300,998300,986000,987000,189613045,0.010442260442260487,-0.06405481339381354,-0.045488086043811424,-0.03559023239553172\n20090731 00:00,986700,994700,983800,988100,177642880,0.0011144883485310064,-0.06397777068476078,-0.045417836967791406,-0.03552360498014315\n20090803 00:00,998800,1005300,993100,1004500,153669856,0.016597510373443924,-0.06393423154846228,-0.04536097656682606,-0.03545964306227626\n20090804 00:00,1000300,1008400,997800,1006800,153552986,0.002289696366351457,-0.06387548101426317,-0.04530580559037703,-0.03540638033481844\n20090805 00:00,1007800,1008500,995800,1003700,171448359,-0.0030790623758442104,-0.06386104437250988,-0.04533174786343836,-0.035453848457954344\n20090806 00:00,1008200,1010200,994200,998900,175088254,-0.004782305469761883,-0.0638978387191463,-0.045369387784678944,-0.035491939151887544\n20090807 00:00,1009600,1020200,1004000,1012000,191014861,0.013114425868455237,-0.06376179524657012,-0.04523787074554514,-0.03536283513767282\n20090810 00:00,1007400,1012200,1002700,1009800,120318516,-0.0021739130434782483,-0.06377210593934123,-0.04527297941419631,-0.03541116351550631\n20090811 00:00,1005200,1006100,994600,996600,137773398,-0.013071895424836555,-0.06386912785136178,-0.04536601246939946,-0.03550207012589997\n20090812 00:00,995400,1015600,995300,1007700,201540302,0.01113786875376288,-0.06378836372331022,-0.045283414521202985,-0.035418494574969886\n20090813 00:00,1013100,1016100,1002600,1015700,153246804,0.007938870695643585,-0.06375519987118752,-0.04524695927244114,-0.035380284694838775\n20090814 00:00,1016000,1016000,997000,1007300,174916433,-0.008270158511371473,-0.0638133946725395,-0.04530403693524332,-0.03543676681521378\n20090817 00:00,988500,989400,981200,982700,193699832,-0.02442172143353516,-0.06401870488514372,-0.045482349130477856,-0.035600686467288645\n20090818 00:00,985300,994400,983600,991600,157136658,0.009056680573928944,-0.06391396759527866,-0.04538158682980718,-0.03550204321864894\n20090819 00:00,983600,1003000,982500,1000100,171794756,0.008572004840661451,-0.06384199761527107,-0.04530949485894628,-0.03542988621491553\n20090820 00:00,1000200,1012200,998700,1010100,154136164,0.009999000099990107,-0.06383707169558858,-0.04530088721614739,-0.03541931585914668\n20090821 00:00,1018200,1031300,1016200,1029700,189020639,0.01940401940401948,-0.06383492348563487,-0.045279269135928356,-0.035387318463133095\n20090824 00:00,1034100,1039500,1025900,1029600,170094558,-9.71156647566751e-05,-0.06385629810369368,-0.045308392529456586,-0.03542057270019146\n20090825 00:00,1033400,1042100,1029400,1031400,190103102,0.0017482517482516613,-0.06371895193987642,-0.04518743733424962,-0.035308355469699536\n20090826 00:00,1028200,1036400,1024900,1031700,162232342,0.0002908667830134881,-0.06372728322348674,-0.04519628302975699,-0.035317475396285776\n20090827 00:00,1030700,1037100,1019400,1034300,173710311,0.0025201124357856486,-0.06373830911098247,-0.04521045358813272,-0.03533332236707148\n20090828 00:00,1042200,1043500,1026700,1033300,129111422,-0.0009668374746205632,-0.06376135432511,-0.045244613095367404,-0.03537340686283564\n20090831 00:00,1023400,1025800,1017900,1025500,148653664,-0.007548630600987094,-0.0637262375081819,-0.04521410689387056,-0.03534535856336464\n20090901 00:00,1018900,1032400,999900,1002000,293867399,-0.022915650901998985,-0.0638813634796454,-0.04534509881953464,-0.035463484718515674\n20090902 00:00,997600,1004300,995700,998000,148469967,-0.003992015968063867,-0.06389477521622787,-0.04535795182232094,-0.03547603986238272\n20090903 00:00,1003600,1007700,996000,1006500,125510980,0.008517034068136198,-0.0636022625689472,-0.045105889001884884,-0.03524554069496201\n20090904 00:00,1008800,1020900,1005500,1020800,118252152,0.014207650273224015,-0.06359642538655524,-0.0450905862937417,-0.035225191950065904\n20090908 00:00,1030300,1030500,1023900,1028900,116888694,0.007934952978056353,-0.06358191124408336,-0.045095442528504295,-0.03524037446125647\n20090909 00:00,1031300,1040800,1028000,1037600,141198400,0.00845563222859358,-0.06323560738269739,-0.044801383729823015,-0.034974167312181934\n20090910 00:00,1037900,1048600,1032200,1048200,143608830,0.01021588280647645,-0.06322980888429156,-0.0447916488410369,-0.034962333948249824\n20090911 00:00,1049800,1053000,1042800,1047900,139201608,-0.00028620492272468656,-0.06324963548549709,-0.04482396398009909,-0.03500130668063235\n20090914 00:00,1038700,1054600,1038700,1053400,134269629,0.005248592422941067,-0.06324062959043883,-0.044813625199960086,-0.034990257344388855\n20090915 00:00,1054600,1061100,1047700,1057400,165775887,0.0037972280235427647,-0.06274765535363289,-0.044410912706289205,-0.034635663051989944\n20090916 00:00,1061200,1073400,1057300,1073300,185276009,0.015036882920370642,-0.06274979247758829,-0.044409334635823416,-0.034632104425125466\n20090917 00:00,1072000,1080600,1065700,1071600,181885156,-0.0015839001211217507,-0.0622264272904229,-0.043988656851362114,-0.03426616891507404\n20090918 00:00,1071400,1071600,1063700,1067200,133261025,-0.004106009705113878,-0.06216214531863999,-0.043989942520723344,-0.03430240845131087\n20090921 00:00,1059100,1067100,1056700,1064400,124441627,-0.002623688155922066,-0.06207633509635826,-0.04397571431402691,-0.034326340352249775\n20090922 00:00,1070400,1073700,1066000,1070800,119687389,0.00601277715144688,-0.06171223044925681,-0.043670844631594,-0.03405304861029598\n20090923 00:00,1072900,1080300,1059900,1061400,212641124,-0.008778483376914448,-0.061647031122403516,-0.04361568766187124,-0.03400324518400002\n20090924 00:00,1064000,1066400,1045500,1049500,193188006,-0.011211607311098604,-0.061716553581707745,-0.04367895439186834,-0.034063177007851414\n20090925 00:00,1047600,1053600,1040900,1044500,177450598,-0.004764173415912287,-0.061751524659081826,-0.04373064693452481,-0.03412378370177589\n20090928 00:00,1048500,1065500,1048300,1063200,106784561,0.017903303015797123,-0.06174723824075374,-0.043709974312355036,-0.03409437565497158\n20090929 00:00,1065000,1070200,1057800,1060300,123081691,-0.0027276147479308177,-0.06066173601824862,-0.042866016836993856,-0.03337918479053072\n20090930 00:00,1063700,1064600,1046200,1055600,213499050,-0.00443270772422899,-0.06063421663313999,-0.04288791758077312,-0.03342743122215204\n20091001 00:00,1052900,1053800,1029500,1030500,231472699,-0.02377794619173934,-0.060806269978852606,-0.043031823585451705,-0.03355633198347829\n20091002 00:00,1020000,1031000,1019900,1025400,189423487,-0.0049490538573507825,-0.06038736961122958,-0.042694892229513504,-0.033263098004361356\n20091005 00:00,1028600,1043200,1026000,1040100,138731180,0.014335868929198359,-0.06028924050266174,-0.04259433425727178,-0.03316124521388254\n20091006 00:00,1047800,1061100,1047200,1055500,188508421,0.014806268628016594,-0.05993165593437651,-0.04228528390496093,-0.03287806827251767\n20091007 00:00,1052800,1059100,1050700,1057700,143388316,0.002084320227380365,-0.05898848287138844,-0.04154445249269627,-0.032245104445533794\n20091008 00:00,1065900,1071700,1061500,1066400,161845863,0.00822539472440198,-0.05887646682793739,-0.04143995476440149,-0.032144614703228984\n20091009 00:00,1066100,1072600,1063600,1072500,117476400,0.005720180045011292,-0.057731121804275226,-0.04054467786901329,-0.031382648201702674\n20091012 00:00,1077900,1080900,1072800,1077600,106574589,0.004755244755244803,-0.05761956268628295,-0.04044417532688066,-0.03128803987924844\n20091013 00:00,1074200,1076500,1067600,1075000,138026355,-0.0024127691165553022,-0.05571235404311192,-0.03922995887875327,-0.03044325500603676\n20091014 00:00,1087400,1094200,1082600,1093100,172568984,0.016837209302325684,-0.05565265509684842,-0.03915928484115317,-0.030366730187855986\n20091015 00:00,1088300,1097000,1087300,1096500,145631259,0.0031104199066873672,-0.053613884085451674,-0.03760756832024482,-0.0290746606135912\n20091016 00:00,1087400,1092700,1082300,1088600,167637899,-0.007204742362061145,-0.05350849946186421,-0.03758831474935475,-0.029101323188185493\n20091019 00:00,1090200,1101300,1087300,1098600,128660136,0.009186110600771569,-0.05346875742583813,-0.03754559606953769,-0.029057017670577858\n20091020 00:00,1099800,1099900,1086800,1092000,161763105,-0.006007646095030017,-0.053266399431506725,-0.03746386392511567,-0.029039590720393655\n20091021 00:00,1090500,1103100,1081500,1081500,201818324,-0.009615384615384581,-0.05301214461303611,-0.037259978594362406,-0.028862557177161532\n20091022 00:00,1081600,1096800,1075100,1093400,211112710,0.011003236245954673,-0.05218036220454588,-0.036596870383416066,-0.02828936855678483\n20091023 00:00,1097200,1097400,1076400,1080800,221826860,-0.011523687580025643,-0.05227847504094715,-0.03668799705554754,-0.0283767709305948\n20091026 00:00,1082000,1093100,1066200,1068300,224536815,-0.011565507031828237,-0.05188792521021885,-0.036380610663453515,-0.02811371865990908\n20091027 00:00,1070100,1073900,1061600,1064000,220340353,-0.004025086586164961,-0.05157474595470201,-0.036127734974955965,-0.027892990579849706\n20091028 00:00,1061300,1064700,1043500,1043800,227624458,-0.018984962406014994,-0.049866384416801045,-0.03506456327571813,-0.02717376719622303\n20091029 00:00,1052000,1068600,1049400,1066500,175392823,0.02174746119946347,-0.049761543650799954,-0.034947674083122715,-0.027050455031992677\n20091030 00:00,1063000,1066200,1034400,1035600,301271541,-0.02897327707454289,-0.04996887316539566,-0.03516671447228537,-0.027275738445053516\n20091102 00:00,1040600,1054100,1030800,1043600,237753904,0.0077249903437621725,-0.0499565925636287,-0.0351696358851451,-0.02728676399565909\n20091103 00:00,1036900,1048000,1035500,1046500,200418258,0.002778842468378784,-0.049926289098501386,-0.03514031168892997,-0.027257961844077475\n20091104 00:00,1055600,1063300,1046500,1049100,216842586,0.00248447204968949,-0.04978316834503402,-0.035078768121242436,-0.02723990677227111\n20091105 00:00,1056300,1068800,1054400,1068600,155994141,0.018587360594795488,-0.04913796136872268,-0.034547871314260514,-0.02676994829357959\n20091106 00:00,1062000,1073900,1060500,1071600,145539690,0.0028074115665357446,-0.04833911310019947,-0.033920379205683644,-0.026233805519805097\n20091109 00:00,1080000,1096300,1078800,1096300,138344762,0.023049645390070816,-0.04832338648249542,-0.03391216375699474,-0.026229594247524784\n20091110 00:00,1093300,1099200,1089700,1095700,145893995,-0.0005472954483262127,-0.048257617036649714,-0.03385431434323847,-0.026175966973569092\n20091111 00:00,1103000,1108200,1096200,1101500,160053341,0.005293419731678295,-0.04804037132008503,-0.03366920546427677,-0.026007990123818384\n20091112 00:00,1100200,1105700,1087500,1089900,141333806,-0.01053109396277807,-0.047359618398387995,-0.033143000096560654,-0.025564173485260973\n20091113 00:00,1092700,1100900,1087500,1096100,139007106,0.005688595283970921,-0.046754462006026946,-0.03278064721606931,-0.02533125825850748\n20091116 00:00,1103900,1116900,1103200,1112200,179317407,0.014688440835690209,-0.04626307153739994,-0.03237310593793847,-0.02496841667356504\n20091117 00:00,1109100,1113900,1105000,1113200,126440382,0.0008991188635136815,-0.045968695567508835,-0.03213236635919344,-0.024756270456470556\n20091118 00:00,1112900,1114300,1105800,1112700,134068179,-0.00044915558749547557,-0.045993286824932554,-0.03216213236233061,-0.02478879509739959\n20091119 00:00,1104800,1105500,1091400,1097700,172315485,-0.013480722566729608,-0.04511779511851202,-0.03149362400901096,-0.024230628803722582\n20091120 00:00,1092900,1097600,1090100,1094300,118297574,-0.003097385442288436,-0.04379475353040119,-0.03048473071630247,-0.023389206804857836\n20091123 00:00,1106900,1116300,1106000,1109200,133405287,0.01361601023485326,-0.043269335922257915,-0.03016352522800745,-0.023176866042012814\n20091124 00:00,1110500,1111400,1101000,1109900,124477453,0.0006310854670033006,-0.042727667849100634,-0.029846710649523413,-0.022979920029519207\n20091125 00:00,1111300,1115000,1108200,1113700,96237873,0.003423731867735924,-0.04273126642292052,-0.029861296987099446,-0.023000363903295885\n20091127 00:00,1084100,1103200,1082900,1095000,99909438,-0.016790877255993486,-0.042740481116199734,-0.029927314582693886,-0.023096662915928188\n20091130 00:00,1095300,1101500,1090200,1098800,141351888,0.003470319634703234,-0.0427481174156094,-0.029939126614789896,-0.023110701015667926\n20091201 00:00,1110400,1116600,1107300,1112500,140569828,0.012468147069530477,-0.04049350714307459,-0.028230974470076386,-0.021693863676850327\n20091202 00:00,1112700,1120100,1109200,1113200,114258270,0.0006292134831460405,-0.04028989872311949,-0.028130725038751976,-0.021648714539908204\n20091203 00:00,1115700,1121800,1102900,1103800,147669372,-0.00844412504491554,-0.0402977741953751,-0.028175284156415254,-0.021712829573198714\n20091204 00:00,1118800,1123800,1100400,1110100,233224453,0.005707555716615298,-0.039955696196131374,-0.02789473048956066,-0.02146507430028378\n20091207 00:00,1109100,1115200,1105000,1108000,113045254,-0.0018917214665346016,-0.03980406919794651,-0.027830339665864286,-0.02144718875840935\n20091208 00:00,1100400,1102500,1092700,1096100,143490416,-0.010740072202166107,-0.03971384100093624,-0.027819861580259595,-0.02147922516209759\n20091209 00:00,1095600,1101800,1090200,1099700,129731956,0.003284371863881086,-0.03955499745394357,-0.027684455721098813,-0.021356313847594083\n20091210 00:00,1107400,1111100,1104500,1106500,113015960,0.006183504592161437,-0.039556231750034,-0.02768722718712053,-0.021359904773218218\n20091211 00:00,1111600,1113600,1106100,1111800,107129731,0.004789877993673697,-0.039268430813290345,-0.027449573044826706,-0.021148983701488645\n20091214 00:00,1118800,1119900,1113700,1119000,97147444,0.0064759848893685135,-0.039266245138959516,-0.02744630986530156,-0.021145146107931473\n20091215 00:00,1114600,1119200,1110000,1113000,104679392,-0.00536193029490617,-0.039213923657324075,-0.027402540441188845,-0.021105935754039157\n20091216 00:00,1117800,1121300,1112700,1114900,126284285,0.00170709793351298,-0.03875460799932314,-0.02713413180113035,-0.02093929893883721\n20091217 00:00,1106900,1109300,1100800,1101300,155962329,-0.012198403444255046,-0.03878492323194199,-0.027158991217927055,-0.020961249880407148\n20091218 00:00,1101600,1103000,1092800,1101900,139436292,0.0005448106782892648,-0.03858419069072116,-0.026993184561186403,-0.020814062083447486\n20091221 00:00,1108300,1117000,1107600,1113300,102759561,0.010345766403484946,-0.03849085907905483,-0.026903177535725423,-0.020725827382590694\n20091222 00:00,1115700,1119600,1114300,1117400,83460870,0.0036827449923650946,-0.03828670014518963,-0.026732027476034145,-0.020572274231579608\n20091223 00:00,1120300,1121100,1115000,1119700,91884071,0.0020583497404689233,-0.038252883474568844,-0.026700621727399308,-0.020542153736534403\n20091224 00:00,1122000,1126000,1121800,1126000,31493323,0.005626507100116029,-0.038250343853480695,-0.02669727571300748,-0.02053837783685626\n20091228 00:00,1129500,1129800,1123200,1126700,63559406,0.000621669626998278,-0.03826571041353213,-0.02671467011550048,-0.020556853274651284\n20091229 00:00,1130300,1130300,1125500,1126200,71809827,-0.0004437738528445534,-0.03825511097134051,-0.026704888842903736,-0.020547508165238117\n20091230 00:00,1121800,1126400,1121700,1124500,61798352,-0.0015095009767359668,-0.038224906181042365,-0.02671177722135818,-0.020574170774699623\n20091231 00:00,1127400,1128000,1114300,1114400,77535777,-0.00898176967541131,-0.03828811824706409,-0.026786010589322614,-0.020654279557947856\n20100104 00:00,1123300,1133900,1123300,1133300,101612569,0.016959798994974795,-0.03817951295507808,-0.026724252399852124,-0.020617495385481206\n20100105 00:00,1132900,1136800,1129200,1136500,101558482,0.00282361245919005,-0.038158746188121095,-0.02670391256780797,-0.020597383150859305\n20100106 00:00,1135500,1139900,1134300,1137300,100357016,0.0007039155301364897,-0.03817317864065064,-0.026720811623141293,-0.020615597143020213\n20100107 00:00,1135500,1143300,1131800,1142100,109962379,0.004220522289633433,-0.037770744178972866,-0.026396278898478356,-0.020332593546101996\n20100108 00:00,1138700,1146200,1136600,1146200,97392014,0.0035898782943699636,-0.03777243076001024,-0.026398301192121675,-0.020334794806893316\n20100111 00:00,1151100,1151300,1142400,1147400,90916057,0.00104693770720643,-0.037532940170750054,-0.026202205066506005,-0.020161832109275066\n20100112 00:00,1139800,1142100,1132200,1136700,138519116,-0.009325431410144636,-0.03734180675405573,-0.026050869567767667,-0.0200317127333358\n20100113 00:00,1139500,1149400,1133700,1146400,145150327,0.008533474091668936,-0.03732794066537117,-0.02603261628836444,-0.02001112065879427\n20100114 00:00,1145100,1151300,1144200,1149400,101472803,0.002616887648290378,-0.036865443438356675,-0.025664637714546714,-0.019693529629250688\n20100115 00:00,1147100,1148400,1132000,1136700,190969038,-0.01104924308334787,-0.036962854628080834,-0.025749532311252352,-0.01977175167653299\n20100119 00:00,1136200,1151300,1135800,1151200,119055229,0.01275622415764932,-0.036967623303212904,-0.025746059965374025,-0.01976388607284807\n20100120 00:00,1142800,1142900,1129800,1138600,188236070,-0.01094510076441979,-0.036012707726650654,-0.02502235123518461,-0.01916343285693098\n20100121 00:00,1138900,1142700,1115600,1116500,310936217,-0.0194098015106271,-0.035880690506031175,-0.02500180052176328,-0.0192023045260402\n20100122 00:00,1112500,1116200,1090900,1092100,314680278,-0.02185400806090465,-0.03599858993996404,-0.025094240480779538,-0.019281172133185486\n20100125 00:00,1102000,1104100,1094100,1097800,169260899,0.005219302261697756,-0.03599423036337112,-0.025088879547495654,-0.019275277380354946\n20100126 00:00,1093600,1104600,1090400,1092900,193990092,-0.004463472399344193,-0.03603954527993899,-0.025134780479475823,-0.019321490714982993\n20100127 00:00,1091600,1100700,1083400,1098100,240013264,0.004757983347058348,-0.03604116977534395,-0.02514233800661632,-0.019332211119387852\n20100128 00:00,1102100,1102500,1079100,1085400,280379510,-0.011565431199344278,-0.03596838843376304,-0.025142664066589222,-0.019371510464611563\n20100129 00:00,1090800,1098000,1072200,1073700,274003890,-0.010779436152570487,-0.035601850811027874,-0.024858649474428406,-0.019131488594691982\n20100201 00:00,1081500,1090700,1080800,1090600,167106965,0.015739964608363577,-0.03535300818423594,-0.024638564693872916,-0.01892673451555319\n20100202 00:00,1092800,1105900,1088800,1104100,187474697,0.012378507243719028,-0.035328992425696995,-0.024604804520582155,-0.018887779630815255\n20100203 00:00,1099100,1104200,1095100,1098200,149775695,-0.005343718866044789,-0.03536853566631433,-0.024655880476330903,-0.018945003634326336\n20100204 00:00,1089500,1090300,1064300,1064900,299639792,-0.030322345656528915,-0.03575134771290592,-0.02495638321882295,-0.01920162759137002\n20100205 00:00,1065300,1068800,1045800,1066600,428459550,0.00159639402760825,-0.03574831669707052,-0.02496968279861158,-0.01922363295125811\n20100208 00:00,1067200,1073300,1058100,1058700,188743438,-0.007406712919557523,-0.03568594724142662,-0.024967596752984766,-0.019253683768446186\n20100209 00:00,1071500,1081400,1062700,1072000,308419675,0.01256257674506478,-0.03568181894711404,-0.024951811076143714,-0.01923168358411473\n20100210 00:00,1070800,1076000,1061100,1070100,210589713,-0.0017723880597014796,-0.03477530384916062,-0.024256746694673138,-0.018649342797175252\n20100211 00:00,1069000,1082500,1062500,1081300,191602096,0.010466311559667263,-0.03477732775691546,-0.024255964521215187,-0.018647064712206035\n20100212 00:00,1070000,1080600,1065100,1080400,256579291,-0.0008323314528807524,-0.034780277399123156,-0.024258739643166344,-0.018649746798054208\n20100216 00:00,1088500,1098500,1084200,1097500,139022359,0.015827471306923302,-0.0347001538631543,-0.024171592618005767,-0.018558855576794365\n20100217 00:00,1102700,1104100,1097500,1102600,150780287,0.004646924829157184,-0.033922850084828635,-0.023566717933817885,-0.018045902204656183\n20100218 00:00,1101000,1111400,1100400,1109100,155131400,0.00589515690186837,-0.033889027270305225,-0.023532720820864043,-0.01801181217385403\n20100219 00:00,1106600,1115700,1103600,1111800,171665579,0.002434406275358292,-0.03381308518717067,-0.023466038508244913,-0.017950066210632974\n20100222 00:00,1115600,1115700,1108300,1111500,119291196,-0.0002698327037237158,-0.03371768668807761,-0.0233855349924647,-0.01787750315534129\n20100223 00:00,1108800,1112000,1095200,1098100,185594332,-0.012055780476833089,-0.03326495565365305,-0.023038431403450032,-0.01758670916662399\n20100224 00:00,1101300,1110000,1098600,1108400,160346043,0.00937983790183039,-0.032989806086430346,-0.02287689621587922,-0.017485741384441096\n20100225 00:00,1092200,1107500,1089400,1106700,228064106,-0.0015337423312883347,-0.03293602861280884,-0.02283105200205721,-0.017444126362062953\n20100226 00:00,1108000,1111200,1101100,1107600,153360353,0.0008132285172133269,-0.03276057926468872,-0.022686535994665722,-0.017316100804152013\n20100301 00:00,1112000,1120000,1111700,1118600,135190244,0.009931383170819874,-0.03249169243094893,-0.02246009713434916,-0.017112290801398172\n20100302 00:00,1124200,1127400,1120000,1121900,145530949,0.0029501162166993833,-0.031593040361000004,-0.021768596313943997,-0.0165312215456081\n20100303 00:00,1124900,1129700,1120200,1123000,132804832,0.0009804795436312297,-0.03153364895204706,-0.021717063660303005,-0.01648387836534435\n20100304 00:00,1124700,1128000,1120300,1126600,119080489,0.0032056990204809566,-0.031471275590193186,-0.021695780268871992,-0.016484499885101554\n20100305 00:00,1133900,1143400,1131000,1142300,156885083,0.013935735842357522,-0.030723175043226237,-0.021103919231427556,-0.015975929552054343\n20100308 00:00,1142800,1145200,1140700,1142900,103543953,0.0005252560623303371,-0.030724171810092814,-0.02110485834899078,-0.015976837936987263\n20100309 00:00,1139300,1149900,1138700,1144600,140701397,0.0014874442208416827,-0.030622991032764245,-0.021019261613827403,-0.0158995489970369\n20100310 00:00,1145100,1152700,1144200,1149900,162438448,0.004630438581163743,-0.0297404153205116,-0.020458974455908826,-0.01551107267487737\n20100311 00:00,1147000,1154800,1143500,1154500,135307420,0.004000347856335296,-0.029744448722910898,-0.020464425364184795,-0.015517279250291036\n20100312 00:00,1159300,1159700,1151400,1154600,142572159,8.661758336936387e-05,-0.029399955864087557,-0.020267498727082098,-0.015399019619951933\n20100315 00:00,1152500,1155800,1146000,1155000,130011073,0.00034644032565389615,-0.02941745678469556,-0.020289012526856914,-0.015422672670761823\n20100316 00:00,1158000,1165100,1154900,1164100,162857046,0.007878787878787818,-0.029382950355944425,-0.020252555167022866,-0.015385175276786456\n20100317 00:00,1167600,1174800,1167100,1171300,159132687,0.006185035649858284,-0.029206578798185973,-0.020155553827679352,-0.015330485907188265\n20100318 00:00,1171100,1172700,1165700,1170300,166805098,-0.0008537522410996257,-0.02916366224091965,-0.020150717552260677,-0.015345950089115039\n20100319 00:00,1168900,1169700,1155200,1159300,197632473,-0.00939929932495942,-0.029114990801061762,-0.020111952139203186,-0.015312465542289813\n20100322 00:00,1152900,1168000,1152400,1165900,165945786,0.005693090658155819,-0.028681854265196483,-0.019766791858313714,-0.015014205077391565\n20100323 00:00,1167400,1175100,1163800,1174000,143575620,0.006947422591988994,-0.02710930645954631,-0.01873131469173174,-0.014265038281187511\n20100324 00:00,1169700,1173200,1166000,1168500,179017686,-0.004684838160136318,-0.02689401165066106,-0.01856163098390277,-0.014119669682558011\n20100325 00:00,1176700,1181000,1165100,1166200,204212712,-0.0019683354728283753,-0.026921114377623206,-0.018593466707349546,-0.014154028548917348\n20100326 00:00,1169000,1174200,1161200,1166600,182823304,0.0003429943405934832,-0.026846994710762614,-0.01856624974516998,-0.014151815245050317\n20100329 00:00,1171900,1175300,1169700,1173200,114886550,0.005657466140922329,-0.026614026149016437,-0.018373970730495442,-0.013981227677357128\n20100330 00:00,1174300,1178300,1169100,1174000,133753684,0.0006818956699625733,-0.02595752753922311,-0.01786840156427172,-0.013556118439019839\n20100331 00:00,1169300,1175200,1166100,1169900,143074981,-0.0034923339011925236,-0.025996751921127836,-0.017910231786578808,-0.013599337825203096\n20100401 00:00,1178300,1182100,1171000,1178200,132999598,0.007094623472091666,-0.025930838151603,-0.017878208040305685,-0.013585380724923041\n20100405 00:00,1182600,1188400,1179200,1187600,96085334,0.007978271940247916,-0.0257238097384917,-0.01775685360859103,-0.013509698775673607\n20100406 00:00,1184400,1192500,1182900,1190400,100648392,0.0023576961940046104,-0.025723828946118053,-0.017766393894706307,-0.013524314713500716\n20100407 00:00,1188100,1190800,1178100,1183600,164373267,-0.005712365591397872,-0.025683148730023392,-0.017733373461275778,-0.01349537768186513\n20100408 00:00,1179200,1189700,1176000,1187800,135493462,0.003548496113551902,-0.025353850788808138,-0.017470376645915456,-0.013267725751365634\n20100409 00:00,1190100,1196000,1188000,1195500,117269001,0.006482572823707677,-0.025346496203498933,-0.01747017572571134,-0.013271338423558507\n20100412 00:00,1197200,1200500,1195600,1197400,96008284,0.0015892931827687917,-0.02488646301854234,-0.017189987653752056,-0.013087025115861631\n20100413 00:00,1196400,1200300,1190000,1198700,114417753,0.0010856856522465375,-0.02488199114604316,-0.017185699162146642,-0.013082834383932117\n20100414 00:00,1202900,1211900,1200800,1211900,139840404,0.011011929590389657,-0.024670603289784137,-0.01700379649295333,-0.012916650158860218\n20100415 00:00,1210200,1215300,1209500,1213200,130211106,0.0010726957669775494,-0.024672630834974715,-0.017016795483291276,-0.01293549798600886\n20100416 00:00,1208600,1210800,1187600,1194000,336400729,-0.015825914935707175,-0.02483838349719883,-0.017170239770885335,-0.013082380724632017\n20100419 00:00,1190200,1199200,1184700,1198100,197140040,0.0034338358458960716,-0.024841412193923697,-0.01717536810568088,-0.013088628368713795\n20100420 00:00,1205400,1209800,1201700,1208800,135686200,0.008930807111259487,-0.023841115749308046,-0.016407962798741734,-0.012445376465508626\n20100421 00:00,1209700,1212200,1199900,1206600,179302939,-0.0018199867637326284,-0.02378612605236503,-0.01639447258491636,-0.012454009472573739\n20100422 00:00,1198400,1211700,1191300,1210200,217053442,0.002983590253605062,-0.02372770972386934,-0.016342732362998075,-0.01240582825836844\n20100423 00:00,1209500,1218600,1206300,1217900,157952904,0.006362584696744333,-0.023722946712969668,-0.016342964910179242,-0.012408723919077562\n20100426 00:00,1218500,1221200,1212300,1213500,128503526,-0.003612776089990999,-0.02372612368199657,-0.016367249274767834,-0.012444260558136912\n20100427 00:00,1206900,1212700,1182500,1184300,319490055,-0.02406262875978571,-0.024007187280283514,-0.016582683424983626,-0.012624707892433012\n20100428 00:00,1190600,1196800,1182800,1193500,260858013,0.007768301950519252,-0.023971806635181208,-0.016544844984122422,-0.01258555920974726\n20100429 00:00,1201200,1211100,1200700,1208500,173403067,0.012568077084206042,-0.023893962530551996,-0.016499650993514175,-0.01255777087410917\n20100430 00:00,1208900,1210100,1187800,1188600,243566503,-0.016466694249069103,-0.024102234596259826,-0.016668581161174412,-0.012705728021496101\n20100503 00:00,1193900,1206800,1192000,1203600,165779303,0.012619888944977342,-0.024118029730755604,-0.016668929359104197,-0.012697841514700476\n20100504 00:00,1190200,1190300,1169200,1175800,315600227,-0.023097374543037508,-0.024111575045314897,-0.01673197692884473,-0.012797940479500636\n20100505 00:00,1165100,1178000,1159700,1168200,285775282,-0.006463684300051065,-0.024134981763079936,-0.016751437788202636,-0.01281529781634246\n20100506 00:00,1162500,1170000,1061300,1127400,569347387,-0.03492552645095015,-0.02477718193271641,-0.01726600512570232,-0.013261824563306664\n20100507 00:00,1127700,1137600,1095800,1110000,585016620,-0.015433741351782881,-0.024815536048019424,-0.01729579410172135,-0.013287047495266779\n20100510 00:00,1158700,1166500,1149200,1161700,339405817,0.046576576576576656,-0.02538462914948062,-0.01767075732371949,-0.0135585207968572\n20100511 00:00,1150700,1173600,1149200,1158300,275150530,-0.0029267452870792576,-0.02514456211194673,-0.0174812920842153,-0.013396031188642049\n20100512 00:00,1163300,1176100,1160900,1174700,198610922,0.014158680825347547,-0.025150972608146666,-0.017467707270531388,-0.013371786949247214\n20100513 00:00,1172000,1176700,1158900,1160200,209054765,-0.012343577083510637,-0.02491234661909828,-0.017285106362877018,-0.013219052805175758\n20100514 00:00,1151000,1153300,1128700,1139200,309838200,-0.018100327529736226,-0.025148936448014927,-0.017481938668909413,-0.013394690522872347\n20100517 00:00,1141800,1145100,1117800,1139100,302412076,-8.77808988763995e-05,-0.025083823427784376,-0.017426645235561682,-0.013344631874956672\n20100518 00:00,1149000,1152200,1120300,1124300,336263031,-0.012992713545781798,-0.025019346574950578,-0.01742904486295449,-0.013382683106496873\n20100519 00:00,1117500,1127700,1103700,1117400,357395387,-0.006137152005692426,-0.025056962766767447,-0.017461246970288072,-0.013411998985426023\n20100520 00:00,1094400,1098900,1074800,1075500,461299151,-0.03749776266332561,-0.02575945815391696,-0.01799375749816328,-0.013853891213812915\n20100521 00:00,1059600,1093800,1056400,1090300,446458865,0.013761041376104233,-0.025627913420514938,-0.017868439764752806,-0.013731893071056317\n20100524 00:00,1085000,1093800,1076100,1077000,236939723,-0.012198477483261527,-0.025732674651751317,-0.01795408685203873,-0.013807350478929854\n20100525 00:00,1051800,1078700,1043800,1078000,346668886,0.0009285051067779992,-0.025582672851366662,-0.017876454099275605,-0.013768297397668354\n20100526 00:00,1085300,1094700,1068600,1071700,305215403,-0.005844155844155874,-0.025419120780534682,-0.017747362894133166,-0.013657577152510305\n20100527 00:00,1092200,1108000,1087900,1107900,246903469,0.0337781095455818,-0.025716437071345615,-0.017934124118377602,-0.013785401879852348\n20100528 00:00,1106700,1106800,1088500,1094400,227442685,-0.012185215272136452,-0.025800425463848305,-0.018026594455658435,-0.013882393910508876\n20100601 00:00,1083400,1099500,1073800,1075200,249503926,-0.01754385964912286,-0.025852205721466362,-0.018113414085756962,-0.013987892900421411\n20100602 00:00,1080600,1103400,1076100,1102800,207115458,0.025669642857142794,-0.026009419828940637,-0.018195958911041678,-0.014030631807667792\n20100603 00:00,1106800,1110600,1095900,1107000,202921965,0.003808487486398171,-0.0258696740325305,-0.01807753111090193,-0.013923568552457329\n20100604 00:00,1086400,1093300,1064700,1069400,303257186,-0.033965672990063256,-0.026489418371391585,-0.018567126212348847,-0.014343781577026786\n20100607 00:00,1071700,1076100,1054100,1054900,226645501,-0.013559005049560535,-0.026618647915288587,-0.018673400419254273,-0.014437818378723074\n20100608 00:00,1056100,1068300,1046500,1065700,328152629,0.010237937245236584,-0.026602332218670893,-0.01864713447345993,-0.014406247991911324\n20100609 00:00,1072600,1082800,1056600,1059900,234619553,-0.005442432204185055,-0.026648340630059955,-0.018689936449060963,-0.014447340628458453\n20100610 00:00,1078600,1092800,1076900,1091900,262038971,0.030191527502594573,-0.02685753070180727,-0.018799307933817618,-0.014503499193846657\n20100611 00:00,1082100,1097500,1081300,1096800,176469285,0.004487590438684963,-0.02685808052097186,-0.018800764296980743,-0.014505438832260943\n20100614 00:00,1105900,1111200,1094000,1095700,185513847,-0.0010029175784098676,-0.026871756863860206,-0.01881454153207648,-0.014519269852619109\n20100615 00:00,1103600,1121000,1100900,1119500,199033417,0.021721274071369923,-0.02664106627321765,-0.018599162733277625,-0.014312053713394283\n20100616 00:00,1114600,1124200,1112000,1119600,183558599,8.932559178198574e-05,-0.026508787071490847,-0.018490010539129374,-0.014215230441409859\n20100617 00:00,1122900,1123300,1110600,1121400,231754413,0.001607717041800738,-0.026495554676554504,-0.018477263335541422,-0.014202741891534388\n20100618 00:00,1118100,1121300,1113700,1116600,147605456,-0.004280363830925671,-0.026536295452051065,-0.018518158220993196,-0.01424371893243304\n20100621 00:00,1131400,1132000,1107900,1114100,189325476,-0.0022389396381873317,-0.02654653728802131,-0.018527497495189116,-0.014252577054286793\n20100622 00:00,1114300,1119000,1094200,1095700,209071401,-0.01651557310833862,-0.026232991612649352,-0.01829001718681544,-0.014055646911597091\n20100623 00:00,1096200,1100200,1084800,1092600,232709298,-0.0028292415807246174,-0.02625366303218587,-0.018309093935517586,-0.014073873547178156\n20100624 00:00,1086800,1088300,1071400,1074700,233370748,-0.016382939776679484,-0.026445588706737515,-0.018474117770115345,-0.014224556110440713\n20100625 00:00,1077400,1084200,1067700,1079500,198008813,0.004466362705871418,-0.0263592831554488,-0.018431758752889247,-0.014205624827909113\n20100628 00:00,1080300,1083200,1071500,1074900,147292823,-0.004261232051875896,-0.02637981118412099,-0.018449836865827865,-0.014222396899835529\n20100629 00:00,1060400,1060600,1035600,1042000,333792138,-0.030607498371941544,-0.0268957592967805,-0.018860214932747154,-0.014576495966008959\n20100630 00:00,1039000,1048800,1028800,1032200,240155366,-0.009404990403070967,-0.02690937817603161,-0.01887124469719958,-0.014586145482942644\n20100701 00:00,1031800,1034900,1011400,1028100,333948813,-0.003972098430536697,-0.026944709051136877,-0.018906154646724193,-0.01462083103859775\n20100702 00:00,1031200,1034200,1016200,1022000,184630972,-0.005933274973251579,-0.026579069693359474,-0.018623178169425027,-0.014381921837006099\n20100706 00:00,1036500,1043700,1018800,1028600,217611751,0.0064579256360077775,-0.026564360974415304,-0.018604624172452292,-0.014361317936544929\n20100707 00:00,1031100,1062400,1030300,1061500,221557775,0.031985222632704646,-0.02659858410875939,-0.018569761983434192,-0.014289626617277175\n20100708 00:00,1069300,1072800,1059100,1071700,183720137,0.00960904380593508,-0.02658409980132953,-0.018546899144687337,-0.014262297214488106\n20100709 00:00,1071300,1079600,1069300,1079300,124564547,0.007091536810674537,-0.02657944354188903,-0.01853800512858188,-0.014251144065985426\n20100712 00:00,1076200,1082400,1071500,1080300,119020688,0.0009265264523301564,-0.02655910574702795,-0.018519253113911293,-0.01423323742486657\n20100713 00:00,1091700,1100900,1089300,1096600,183345379,0.015088401369989901,-0.026451895997362283,-0.018454724274876683,-0.014191461621358243\n20100714 00:00,1093200,1100700,1088700,1096700,162674552,9.119095385745624e-05,-0.02646500126582401,-0.01847033332914577,-0.014208405434576542\n20100715 00:00,1095800,1100600,1081700,1096800,201307149,9.118263882545996e-05,-0.02626490853064967,-0.0183623569171109,-0.014149535893551548\n20100716 00:00,1090600,1091600,1064500,1066300,248223518,-0.027808169219547763,-0.026703880637584807,-0.01871590616011089,-0.014457546523875842\n20100719 00:00,1070800,1076300,1062200,1072900,161887549,0.006189627684516585,-0.02669388617176278,-0.01870226174369843,-0.014441956332309444\n20100720 00:00,1058500,1085600,1058200,1084800,215127960,0.011091434430049452,-0.026699600110984507,-0.018704518265586133,-0.014442369717809777\n20100721 00:00,1090500,1090700,1066300,1070700,230027718,-0.012997787610619427,-0.026835804603624714,-0.018822045752857945,-0.01454994056262976\n20100722 00:00,1083300,1099400,1083300,1094800,218860157,0.02250863920799473,-0.026934529536614904,-0.01886544040661743,-0.01456383884926864\n20100723 00:00,1092600,1105600,1089300,1104100,192641111,0.008494702228717621,-0.02682608632575826,-0.018805047653706667,-0.014529061617688889\n20100726 00:00,1105600,1116700,1102900,1115700,147222199,0.01050629471968123,-0.026834617441732656,-0.018803625616143148,-0.01452233359080372\n20100727 00:00,1121500,1122900,1111100,1115500,179718422,-0.00017925965761400597,-0.026844132848517128,-0.01881352440682132,-0.014532436762016997\n20100728 00:00,1113700,1116600,1104600,1108000,139676159,-0.006723442402510105,-0.026878448381397975,-0.018842766468518006,-0.014558974174998646\n20100729 00:00,1115100,1118200,1094200,1102900,188354458,-0.004602888086642554,-0.0268801941427716,-0.01884425662363304,-0.014560328067363041\n20100730 00:00,1092000,1108600,1089800,1102700,189667997,-0.00018134010336390283,-0.026883911077627016,-0.018859234463350527,-0.014581309053794046\n20100802 00:00,1120100,1129400,1115400,1127600,145317471,0.02258093769837677,-0.02698892897945292,-0.018908533388954495,-0.014600904399349662\n20100803 00:00,1125000,1127700,1118500,1122200,130643614,-0.004788932245477162,-0.026984171537085544,-0.018930031018171607,-0.014636398510077465\n20100804 00:00,1125000,1131100,1121600,1129700,132448474,0.0066833006594189115,-0.026980406544642458,-0.01892226147029004,-0.014626494148509604\n20100805 00:00,1123100,1129100,1120800,1128500,118412553,-0.001062228910330143,-0.026968290255591013,-0.018911350062659465,-0.0146162250587061\n20100806 00:00,1117600,1125700,1109200,1124100,192589474,-0.0038989809481613236,-0.02696140733590429,-0.018905456615944873,-0.014610859096371632\n20100809 00:00,1129400,1131800,1123200,1130100,89710689,0.00533760341606615,-0.026939149879514342,-0.018898759823727313,-0.014612457636645624\n20100810 00:00,1120800,1129800,1113800,1123900,206287943,-0.005486240155738398,-0.026963561345007638,-0.018919870576018724,-0.01463180879094266\n20100811 00:00,1106900,1106900,1091200,1093000,219264412,-0.027493549248153726,-0.027254761487973043,-0.019142529751312268,-0.014817929029990797\n20100812 00:00,1076200,1090200,1076000,1086000,187028334,-0.006404391582799596,-0.027297529500923234,-0.019193161644473166,-0.014872753128593498\n20100813 00:00,1082700,1089500,1081800,1082800,128491825,-0.0029465930018416353,-0.027322477820756377,-0.019223455632118823,-0.014905896871969568\n20100816 00:00,1075600,1086100,1071800,1082600,128663908,-0.00018470631695599593,-0.027261574338755028,-0.01917099437101152,-0.014857936127582337\n20100817 00:00,1091600,1103900,1088800,1095900,145307620,0.012285239238869483,-0.026929080743560173,-0.01889323218082778,-0.01460935104688874\n20100818 00:00,1095300,1103800,1089100,1097800,154569684,0.0017337348298203104,-0.026929877257785083,-0.01890230816689169,-0.014622840788753701\n20100819 00:00,1092300,1094900,1074300,1078800,217668677,-0.01730734195664052,-0.027129923439485462,-0.019073835952110704,-0.014779165522334423\n20100820 00:00,1075200,1077000,1067500,1075300,164263849,-0.003244345569150875,-0.027150962820550104,-0.019104107109003413,-0.014814358104760953\n20100823 00:00,1080000,1085700,1070700,1071300,135275833,-0.003719892123128399,-0.027104973541948477,-0.019098471382326957,-0.014830234707296549\n20100824 00:00,1058800,1063900,1049800,1055600,228100949,-0.01465509194436665,-0.027249581947969007,-0.01921764075271936,-0.014935842621927037\n20100825 00:00,1049300,1063400,1043000,1058800,205812863,0.0030314513073133043,-0.027246729065150126,-0.01921413191144665,-0.014931984091629819\n20100826 00:00,1064000,1065800,1048800,1052300,180709953,-0.0061390253116735405,-0.02728783623118942,-0.01925067154550519,-0.01496608879129055\n20100827 00:00,1058300,1069700,1043100,1068200,215621134,0.015109759574265968,-0.027323250173773496,-0.019261075852402068,-0.014963160553945122\n20100830 00:00,1065400,1069100,1053000,1053400,129802797,-0.013855083317730776,-0.027450857199799457,-0.019366283293679818,-0.015056426859478238\n20100831 00:00,1048800,1059800,1044900,1054700,207994986,0.0012340991076513763,-0.02739320554167894,-0.01931531067376041,-0.015009014810109555\n20100901 00:00,1067400,1086100,1066700,1084400,218692218,0.028159666255807236,-0.027283788027090562,-0.01917857233921791,-0.014857711847544074\n20100902 00:00,1086900,1094900,1084900,1094700,136593872,0.009498340095905666,-0.02725486751627367,-0.019142441652176434,-0.014817737442236911\n20100903 00:00,1105800,1109900,1099500,1109200,164269500,0.01324563807435819,-0.027274492132339595,-0.019150820389308505,-0.014820121042922196\n20100907 00:00,1103900,1105100,1095500,1096800,115959632,-0.01117922827262896,-0.02735335218268812,-0.019236090546152655,-0.014908808403820003\n20100908 00:00,1098500,1108500,1098100,1104100,122759786,0.006655725747629404,-0.027351517339306963,-0.019236280293980824,-0.014910077453730321\n20100909 00:00,1116300,1116800,1106200,1109400,123066497,0.004800289828819748,-0.027348136977659445,-0.01923813947283501,-0.014914729812238217\n20100910 00:00,1111300,1116100,1108700,1115400,101964504,0.005408328826392639,-0.02733917265750122,-0.019237389918911597,-0.014918359519797685\n20100913 00:00,1126100,1129500,1121300,1127200,138847600,0.010579164425318366,-0.027336752826792515,-0.01922304814952975,-0.014897662209023646\n20100914 00:00,1125400,1132900,1120800,1126500,169752501,-0.0006210078069552871,-0.027351063517398334,-0.019239989897443445,-0.014916006563852531\n20100915 00:00,1122800,1132100,1119800,1131400,135433895,0.004349755881047468,-0.027350478169505633,-0.019238933720049985,-0.014914699388994415\n20100916 00:00,1127100,1131200,1123500,1131000,165464005,-0.0003535442814212031,-0.027327135989357446,-0.019240320663460778,-0.014929269336669932\n20100917 00:00,1130000,1131500,1121800,1125100,163422582,-0.005216622458001807,-0.02735196578870851,-0.01926209965472166,-0.01494942195342677\n20100920 00:00,1128700,1144600,1126200,1142300,165915393,0.015287529997333626,-0.027354972065595538,-0.01924168057471644,-0.014916514902342567\n20100921 00:00,1143000,1148400,1135100,1140000,211066069,-0.00201348157226644,-0.02735128677474166,-0.019238365519578277,-0.014913397218494473\n20100922 00:00,1138100,1144300,1131000,1134300,162196256,-0.0050000000000000044,-0.027393399734999692,-0.019280943835174057,-0.014956223613298868\n20100923 00:00,1124500,1136700,1121900,1125000,168335090,-0.008198889182755909,-0.02738713322947568,-0.019275839308228918,-0.014951738532834484\n20100924 00:00,1137300,1149000,1136500,1147900,154008044,0.02035555555555546,-0.02736510761603213,-0.019223569686914136,-0.014883345942834707\n20100927 00:00,1148200,1149900,1141700,1143200,107216443,-0.004094433313006407,-0.027359925898079496,-0.019219127370207936,-0.014879297798196998\n20100928 00:00,1144200,1150400,1131900,1146700,174697792,0.0030615815255423673,-0.02730247486311648,-0.019195759648921045,-0.014874099765313198\n20100929 00:00,1144400,1149000,1140200,1144100,149678645,-0.0022673759483735623,-0.027299619694891617,-0.01919320587048257,-0.014871706656654618\n20100930 00:00,1150800,1157900,1135900,1141200,232277380,-0.0025347434664801938,-0.027286379288788895,-0.019181637834922386,-0.01486103015564243\n20101001 00:00,1149900,1151200,1139300,1146100,143224066,0.004293725902558609,-0.026951419251872298,-0.01891217012225399,-0.014626476158691103\n20101004 00:00,1143600,1148500,1131800,1137500,143395829,-0.007503708227903361,-0.026975026784625364,-0.018931831668204183,-0.014644034113677928\n20101005 00:00,1148400,1163200,1146700,1160500,194332138,0.020219780219780326,-0.027029125582514416,-0.018963242488071866,-0.014663350056414188\n20101006 00:00,1160500,1163300,1155600,1160600,121660574,8.616975441610997e-05,-0.027007066892185537,-0.018964757682148965,-0.014677432401038248\n20101007 00:00,1165000,1165300,1151900,1158900,140415077,-0.001464759607099797,-0.027021511025668677,-0.018979096213486604,-0.014691714636262874\n20101008 00:00,1160400,1168600,1156100,1165600,136003134,0.005781344378289699,-0.02701858384688736,-0.01897986770944292,-0.014694457882035702\n20101011 00:00,1167700,1169700,1162500,1166600,88810641,0.0008579272477693412,-0.02702688742375341,-0.018991391078108204,-0.014707697709795044\n20101012 00:00,1162800,1173500,1156500,1169900,143770924,0.0028287330704612756,-0.027029394085540222,-0.018995402962478845,-0.014712512022755388\n20101013 00:00,1176200,1185500,1173800,1178800,162739555,0.007607487819471848,-0.027006815758607125,-0.018967790476893735,-0.014682215845820662\n20101014 00:00,1178100,1180100,1167200,1175500,176271612,-0.002799457074991518,-0.026982369693164743,-0.01897333309899105,-0.014703745326278984\n20101015 00:00,1182700,1183500,1167600,1177200,202366646,0.0014461931093152636,-0.02698644797602,-0.018978151302370513,-0.01470895797855199\n20101018 00:00,1177700,1186600,1175200,1185500,119032748,0.007050628610261622,-0.026924751476856003,-0.018917956903244895,-0.014649564343398654\n20101019 00:00,1172200,1178500,1160200,1167100,221000327,-0.01552087726697593,-0.02709142469826634,-0.019064525354045837,-0.014785415015380915\n20101020 00:00,1169700,1184400,1168700,1178700,169446252,0.0099391654528318,-0.02704852643830819,-0.01901565605295033,-0.01473336257434958\n20101021 00:00,1184200,1190800,1172100,1181200,195073757,0.0021209807414948045,-0.026963694033730716,-0.01894203162258731,-0.014665713073567692\n20101022 00:00,1182900,1185300,1180000,1183800,95874689,0.002201151371486576,-0.026955613844042468,-0.01894655077504055,-0.01467694888869552\n20101025 00:00,1191900,1197600,1186100,1186900,124389435,0.002618685588781977,-0.026845182153504753,-0.01885202932085662,-0.014590909122639537\n20101026 00:00,1180800,1188400,1178700,1187300,136058914,0.00033701238520511545,-0.026740722108031974,-0.0187643339365639,-0.014512150917188042\n20101027 00:00,1178400,1185100,1172600,1183800,167955941,-0.0029478649035626914,-0.02673305551115878,-0.018757660985387625,-0.01450600767485603\n20101028 00:00,1190400,1191100,1178300,1184000,143823805,0.00016894745734075123,-0.02650587850405159,-0.018574768453900423,-0.014346723033457083\n20101029 00:00,1182700,1187100,1180700,1185300,124560631,0.0010979729729729826,-0.02640803837793962,-0.018529594899244113,-0.014329625833162966\n20101101 00:00,1191500,1197500,1178500,1185300,145231041,0.0,-0.02594164700863163,-0.018166150032659995,-0.014021061366250517\n20101102 00:00,1194100,1197500,1191000,1194900,127371600,0.008099215388509329,-0.025942384282730865,-0.018166236294641182,-0.01402080057608049\n20101103 00:00,1196300,1200200,1184500,1200100,188790367,0.00435182860490424,-0.02593992388631709,-0.01816266809019257,-0.014016641803267706\n20101104 00:00,1213000,1223200,1211300,1222600,183902380,0.0187484376301974,-0.026006825650423535,-0.01819106465151489,-0.014024511383465672\n20101105 00:00,1223600,1229200,1221800,1227400,149833645,0.003926059218059885,-0.02593896217956909,-0.01816012504002457,-0.014013255744773913\n20101108 00:00,1223300,1226900,1219400,1225400,123981989,-0.001629460648525316,-0.02595663037555001,-0.01817777520219064,-0.01403089629318002\n20101109 00:00,1228200,1229400,1211200,1216000,161563427,-0.007670964582993323,-0.025899504126259524,-0.018173096076186217,-0.014054176534530585\n20101110 00:00,1215600,1221600,1206600,1220900,192884353,0.004029605263157876,-0.025886043547598086,-0.018158258145889093,-0.014038604343173059\n20101111 00:00,1210300,1218200,1206900,1216600,141083466,-0.0035219919731345195,-0.025918073243957562,-0.01819115264692591,-0.014071959868383353\n20101112 00:00,1208100,1213500,1196500,1201800,203211051,-0.01216505013973368,-0.025940317810409678,-0.018208780205121695,-0.014087126116561892\n20101115 00:00,1205700,1210500,1199800,1200400,135801020,-0.0011649192877351,-0.025957303172598263,-0.01822875687505109,-0.014108697441579249\n20101116 00:00,1193300,1194900,1175900,1181200,243870180,-0.015994668443852,-0.026104554077623566,-0.01836853984458386,-0.014244499282334365\n20101117 00:00,1182100,1187000,1178600,1182100,144016027,0.0007619370132068148,-0.02610503934356182,-0.018369042425528604,-0.014245011093845\n20101118 00:00,1193500,1203900,1193500,1200200,139883399,0.015311733355892088,-0.026133672416508512,-0.0183709657733066,-0.014232695585968905\n20101119 00:00,1199200,1203400,1192500,1202600,119156212,0.001999666722212856,-0.025994836102895966,-0.018254805293689762,-0.014128623509548348\n20101122 00:00,1197200,1202400,1187700,1201900,150117203,-0.0005820721769499437,-0.025980192249322565,-0.018241527286585246,-0.01411607363014239\n20101123 00:00,1187900,1190200,1179900,1184200,175335182,-0.014726682752308817,-0.0261142980587486,-0.018369295266808857,-0.014240462937069901\n20101124 00:00,1192500,1202300,1191700,1201900,113831826,0.014946799527106869,-0.026144168311487942,-0.018373773360259874,-0.014231404564362296\n20101126 00:00,1191400,1198100,1190300,1192700,56088364,-0.007654546967301723,-0.026210401615728206,-0.01843348220680401,-0.014287635246650917\n20101129 00:00,1185100,1194800,1177400,1191600,186493230,-0.0009222771862161805,-0.026028270122526405,-0.01828625840738022,-0.0141590206096121\n20101130 00:00,1179600,1191700,1178100,1184800,185923239,-0.0057066129573682955,-0.02607591303532442,-0.018330612558194525,-0.014201621533582212\n20101201 00:00,1202500,1212400,1201900,1210000,138468755,0.02126941255908177,-0.026159064612786796,-0.018379173885120885,-0.014231742925941286\n20101202 00:00,1211700,1226500,1211400,1225700,153312536,0.012975206611570256,-0.026173938686458884,-0.01837533863893425,-0.014217933810567596\n20101203 00:00,1221500,1230300,1221100,1228600,112949149,0.0023659949416658943,-0.026100310806976428,-0.01831071315858361,-0.014158107475882772\n20101206 00:00,1226400,1230400,1225000,1227400,84112951,-0.0009767214715936667,-0.02611659837811842,-0.018329999716789693,-0.014178992782995644\n20101207 00:00,1239700,1240100,1227600,1228300,160822937,0.0007332572918363756,-0.02610394982220835,-0.01831800500854408,-0.014167346638520538\n20101208 00:00,1229700,1233800,1224100,1232900,120939312,0.0037450134332004392,-0.02599941906066825,-0.018227257432187727,-0.01408394682718406\n20101209 00:00,1239400,1240200,1231600,1238200,110524832,0.004298807689188111,-0.025998079292922558,-0.018225130878565362,-0.014081400840922163\n20101210 00:00,1241200,1246000,1237300,1245000,96823273,0.005491842997900287,-0.02599784306609982,-0.01822576789899669,-0.01408250338623338\n20101213 00:00,1250400,1252000,1245200,1245600,102916423,0.0004819277108434328,-0.0260075444677342,-0.018237635237469657,-0.014095525377620433\n20101214 00:00,1247900,1252300,1242900,1246500,127061129,0.0007225433526012459,-0.026015896665425812,-0.0182502289763622,-0.014110380266432318\n20101215 00:00,1244900,1249300,1238900,1241200,125961401,-0.0042519053349378,-0.02600670435796896,-0.01824243913209133,-0.014103338070096396\n20101216 00:00,1242200,1249100,1237500,1248200,157753417,0.005639703512729577,-0.02600123264284457,-0.018233998742711494,-0.014093315091455897\n20101217 00:00,1240500,1244600,1238200,1243800,105024844,-0.0035250761095978467,-0.025907558968770665,-0.0181576837899507,-0.01402625400879507\n20101220 00:00,1246200,1249000,1239900,1245700,91230312,0.0015275767808329288,-0.025904049045907682,-0.01815405963496558,-0.014022568957088333\n20101221 00:00,1250000,1254700,1248800,1253900,73500780,0.006582644296379447,-0.0258946793340723,-0.018151809311853187,-0.01402411395376046\n20101222 00:00,1255400,1258200,1254100,1257900,62932866,0.003190047053194034,-0.025895468482069764,-0.018152940035606392,-0.014025426770285124\n20101223 00:00,1256300,1257700,1252900,1256100,58830089,-0.0014309563558311256,-0.025909923511391448,-0.018167216784874513,-0.014039608479116375\n20101227 00:00,1250900,1257700,1250400,1256500,51912786,0.0003184459836000908,-0.02592032228606383,-0.01818073981663241,-0.014054797040765954\n20101228 00:00,1259300,1259500,1255000,1258000,49262784,0.0011937922801432688,-0.025918242032208022,-0.018178603881324352,-0.014052631421881736\n20101229 00:00,1259600,1262000,1259000,1259200,46307819,0.000953895071542199,-0.025912411149224684,-0.018172856364241072,-0.014046928346851303\n20101230 00:00,1258100,1261300,1255300,1257200,59362453,-0.0015883100381194337,-0.02591285612290229,-0.018173262598945892,-0.014047313929953075\n20101231 00:00,1255300,1258700,1253400,1257800,71169974,0.0004772510340438352,-0.02583841031514465,-0.018109629430448217,-0.013989444939435146\n20110103 00:00,1267300,1276000,1266600,1270100,112417364,0.009778979169979385,-0.025791451694559864,-0.01808477473713867,-0.013976373767965405\n20110104 00:00,1273000,1273700,1261900,1269300,117330516,-0.0006298716636485846,-0.025803492576182526,-0.01809730291108818,-0.013989161715651238\n20110105 00:00,1265700,1277200,1264700,1276400,110956559,0.005593634286614746,-0.025794654312770896,-0.018085369561409978,-0.013975578386937\n20110106 00:00,1277000,1278300,1270100,1273900,98800243,-0.0019586336571607577,-0.025816028376146227,-0.018107665349044677,-0.013998365542363736\n20110107 00:00,1275500,1277700,1261600,1271300,132033948,-0.002040976528769889,-0.025837042363425867,-0.018129069152127218,-0.014019977154808377\n20110110 00:00,1265900,1271600,1262000,1270100,102726986,-0.0009439156768662471,-0.02584562681716666,-0.018137453159957427,-0.01402825430566536\n20110111 00:00,1274500,1277400,1269500,1274300,100122850,0.0033068262341546806,-0.025759230467444404,-0.01806168147540937,-0.013958146590807482\n20110112 00:00,1282500,1287100,1279900,1286400,90853228,0.009495409244290931,-0.025762118066052858,-0.01806260492937467,-0.013958022966531395\n20110113 00:00,1286100,1286900,1280500,1284500,101801231,-0.0014769900497512145,-0.025778171706316536,-0.018078714787774737,-0.013974162794611942\n20110114 00:00,1281700,1293300,1281100,1292800,96551177,0.006461658232775447,-0.025667952672739983,-0.017980427833377284,-0.013882236787472888\n20110118 00:00,1292100,1296400,1290300,1295300,97195465,0.0019337871287128383,-0.025650431688954665,-0.017980620461482102,-0.01389187247653109\n20110119 00:00,1294300,1295000,1279100,1282700,138452706,-0.009727476260325774,-0.02563469777416892,-0.017968080264670394,-0.013881034838953709\n20110120 00:00,1279300,1283900,1271400,1281400,151691232,-0.0010134871754892139,-0.025397735445831113,-0.0177791496751274,-0.013717709791631562\n20110121 00:00,1288500,1291700,1282300,1283600,131335477,0.0017168721710629775,-0.025093774936902905,-0.0175368324021433,-0.01350825429963231\n20110124 00:00,1283100,1292500,1282600,1291600,88339067,0.006232471174820731,-0.02509400627312141,-0.017535818176667058,-0.013506576069825521\n20110125 00:00,1287700,1292000,1281100,1291600,148176299,0.0,-0.025065298416286033,-0.017510331455574256,-0.013482806524277994\n20110126 00:00,1294400,1300500,1292300,1296900,113752687,0.004103437596779225,-0.025065866782166026,-0.017511494219938344,-0.01348428616027452\n20110127 00:00,1296500,1302100,1294700,1300300,107115837,0.002621636209422462,-0.024947553699603515,-0.017411348239463706,-0.013393824994699642\n20110128 00:00,1301700,1303500,1275100,1277200,221182337,-0.017765131123586908,-0.02506316160969879,-0.017501210036409656,-0.0134699616339934\n20110131 00:00,1280500,1287800,1277600,1286700,123710397,0.007438145944252961,-0.025020721931146628,-0.01748085362249862,-0.013461377726748382\n20110201 00:00,1294400,1309700,1293900,1307100,141489397,0.015854511541151695,-0.025045895945941154,-0.01749461221149251,-0.013469050794488176\n20110202 00:00,1304600,1308400,1303300,1304800,101182676,-0.0017596205340065785,-0.025018809168781644,-0.017471293939617816,-0.013447741498836308\n20110203 00:00,1302700,1309800,1295700,1307600,119265099,0.0021459227467810482,-0.024481930068125626,-0.0170539475672969,-0.013094117581686807\n20110204 00:00,1308500,1312000,1302300,1311700,96574018,0.003135515448149384,-0.024477770715918726,-0.017049217476508643,-0.013089083232272718\n20110207 00:00,1314400,1324000,1314300,1320000,92312617,0.0063276663871312255,-0.024406364328675465,-0.016982763306428943,-0.013025269070838346\n20110208 00:00,1321300,1326400,1317300,1325900,84631958,0.004469696969696901,-0.02438611123310497,-0.01697785111718585,-0.013028535061992814\n20110209 00:00,1322000,1326300,1316100,1323200,122808924,-0.0020363526661135722,-0.02438779034046189,-0.01697934519143957,-0.013029930495783885\n20110210 00:00,1316100,1324700,1313000,1323300,131988116,7.557436517524607e-05,-0.024390103634923745,-0.01699305988164098,-0.01304972322786575\n20110211 00:00,1318000,1332800,1317700,1331500,114245978,0.006196629638026252,-0.024373058824554594,-0.016972837224859677,-0.013027806472921039\n20110214 00:00,1330700,1335400,1328900,1334300,75442998,0.002102891475779245,-0.024332408460763098,-0.016960049826403256,-0.013029872718184095\n20110215 00:00,1330500,1332200,1326600,1330400,96473771,-0.0029228809113392984,-0.02436216735395278,-0.016989890749879385,-0.013059757371702395\n20110216 00:00,1334700,1340100,1331900,1338200,112514786,0.005862898376428172,-0.02436215509359527,-0.016989919581164904,-0.013059808108790759\n20110217 00:00,1334300,1344300,1333400,1342200,90526975,0.0029890898221491824,-0.024360860202679965,-0.016988359212567316,-0.013058106215023091\n20110218 00:00,1343200,1346900,1340600,1345700,109026773,0.002607659067203061,-0.024350322416420603,-0.016977563390153928,-0.013047172834490795\n20110222 00:00,1331100,1338600,1314800,1318000,193712343,-0.020584082633573586,-0.02450894130531192,-0.017099629528976455,-0.013149752837506893\n20110223 00:00,1317200,1320700,1302100,1310100,192006664,-0.005993930197268571,-0.02455762605039627,-0.01715192403381138,-0.013203971691907745\n20110224 00:00,1308600,1314400,1297000,1309200,201673410,-0.0006869704602702198,-0.02455294091237678,-0.017147627029342322,-0.013199881599998225\n20110225 00:00,1314700,1324100,1314000,1323200,104682889,0.010693553315001436,-0.024555901904421938,-0.017138234890902132,-0.013183904053406283\n20110228 00:00,1328400,1333200,1323800,1331500,106909359,0.006272672309552529,-0.024547529442325394,-0.017136568300825335,-0.013185812338889637\n20110301 00:00,1336800,1336800,1308900,1308900,169595915,-0.016973338340217747,-0.024757387061831265,-0.01730810967302164,-0.013336927461425884\n20110302 00:00,1307900,1318100,1306000,1311600,161826340,0.0020628008251202257,-0.024753870374992392,-0.01730436500423458,-0.013333061256305845\n20110303 00:00,1323900,1336200,1323900,1334700,135154955,0.017612076852699055,-0.02481496749625902,-0.01733081678556623,-0.013341043735115455\n20110304 00:00,1333700,1334800,1316000,1324700,198750826,-0.007492320371619066,-0.02485418133990145,-0.0173834528646629,-0.013400835158266816\n20110307 00:00,1328000,1331500,1307400,1313700,160082351,-0.008303766890616737,-0.02492293254043623,-0.01744232727587467,-0.013454444289637327\n20110308 00:00,1316700,1330000,1310700,1325600,125693247,0.009058384714927259,-0.02492256568067962,-0.017433266788795535,-0.013440749262001374\n20110309 00:00,1323400,1327900,1316000,1323900,123778259,-0.0012824381412190888,-0.024940828543200372,-0.017453053243998946,-0.013461347938826194\n20110310 00:00,1310400,1310400,1298100,1299300,212776860,-0.018581463856786717,-0.025179825200420104,-0.017648287787822174,-0.01363325306192962\n20110311 00:00,1294900,1313100,1294900,1308400,171495590,0.007003771261448577,-0.025169783012415285,-0.01763314633769808,-0.013615393214038415\n20110314 00:00,1300300,1304800,1290600,1300500,194998514,-0.006037908896362021,-0.025213251665535532,-0.017671302727839105,-0.013650717656442058\n20110315 00:00,1267000,1293300,1265100,1285600,236582783,-0.011457131872356752,-0.025326920906561395,-0.017774150720083322,-0.013747796881002377\n20110316 00:00,1281800,1285700,1252800,1262100,414607812,-0.018279402613565643,-0.02555570723904068,-0.017964354536004395,-0.013917432500112214\n20110317 00:00,1280100,1283900,1271000,1278500,193507431,0.012994215989224234,-0.025566171062740797,-0.017955654982757117,-0.01389851702152405\n20110318 00:00,1288400,1288800,1275100,1277600,188607766,-0.0007039499413374894,-0.025492074158447623,-0.017893156263578167,-0.013842201251913011\n20110321 00:00,1294100,1300100,1292000,1297400,133722411,0.01549780839073267,-0.02553558008423057,-0.017912519475720083,-0.013848694072747587\n20110322 00:00,1297600,1298800,1291700,1293000,99916388,-0.003391398180977334,-0.025565365130671605,-0.017945597826710197,-0.013883528072206684\n20110323 00:00,1289600,1300000,1283200,1296400,126368332,0.0026295436968291064,-0.025527318547698085,-0.017910193985003126,-0.013849533066089888\n20110324 00:00,1304600,1310800,1296800,1309000,124919412,0.009719222462202914,-0.02551365475267249,-0.017886946344297095,-0.013821176312714482\n20110325 00:00,1312200,1318600,1309500,1312900,130636077,0.0029793735676089117,-0.025505671162179253,-0.017878236765761328,-0.013812079712639598\n20110328 00:00,1315700,1319200,1309400,1309400,76324619,-0.0026658542158580767,-0.025531937779073772,-0.017906484409935298,-0.013841383435125894\n20110329 00:00,1308900,1318900,1304400,1318600,112305617,0.007026118833053374,-0.025524324588408257,-0.01789372641472931,-0.013825882763656577\n20110330 00:00,1325800,1331500,1323600,1327000,110691781,0.006370392840891803,-0.025492500555618965,-0.017859759841942945,-0.013790774010725763\n20110331 00:00,1326300,1329600,1324600,1325100,107390884,-0.0014318010550112836,-0.025510202904603294,-0.017882188191377595,-0.013815721773512974\n20110401 00:00,1334500,1337700,1328400,1331500,132462581,0.004829824164213958,-0.02550735886377197,-0.01788383732111867,-0.013819766195860223\n20110404 00:00,1334800,1336700,1328800,1332400,87692371,0.000675929402929043,-0.025512633726182777,-0.017889521960851185,-0.013825669286366655\n20110405 00:00,1329500,1338300,1329400,1332400,102189817,0.0,-0.02547397637162936,-0.017855548588963974,-0.013794192928306765\n20110406 00:00,1338500,1340000,1331200,1336600,102531525,0.0031522065445812597,-0.02547462277764564,-0.017856466313234242,-0.01379525529133429\n20110407 00:00,1333900,1339400,1326600,1333200,166665573,-0.002543767768966032,-0.025499538287898665,-0.01788457590181624,-0.01382506763125449\n20110408 00:00,1338800,1339900,1323100,1328600,122011059,-0.003450345034503477,-0.02552545286103218,-0.017908757403987417,-0.013848325239708487\n20110411 00:00,1330100,1334500,1321400,1324700,105116572,-0.0029354207436399493,-0.025546050223646737,-0.017927995324085767,-0.013866838446031754\n20110412 00:00,1317100,1319700,1309900,1314500,147011475,-0.007699856571299124,-0.025601147965885192,-0.017988704557055767,-0.013930539143946681\n20110413 00:00,1320900,1321800,1309700,1314500,131494341,0.0,-0.025605267807078953,-0.01799286449905001,-0.013934720463529275\n20110414 00:00,1306900,1317600,1302700,1315600,132675697,0.0008368200836819106,-0.02542958067446088,-0.0178492740415168,-0.013808240624717262\n20110415 00:00,1317800,1323700,1314100,1321200,127204358,0.004256612952265204,-0.025428644531362506,-0.0178476556725256,-0.013806258563627025\n20110418 00:00,1305300,1308100,1295100,1305300,175212323,-0.012034514078110847,-0.025546055696739157,-0.01795504356059116,-0.013908303079646928\n20110419 00:00,1307500,1313500,1304400,1312800,103007172,0.00574580556193971,-0.02552598549280776,-0.017932057729378798,-0.013883762938319713\n20110420 00:00,1328800,1333900,1328000,1331600,123308092,0.014320536258379146,-0.025558514881043003,-0.01794187874557569,-0.013881478205410186\n20110421 00:00,1337500,1338300,1333500,1337400,90235439,0.0043556623610694345,-0.025558286768028002,-0.017944050472513795,-0.013884929278147228\n20110425 00:00,1336600,1338500,1332000,1336200,51582371,-0.0008972633467922986,-0.025541441494133402,-0.017928983213615645,-0.013870809872464541\n20110426 00:00,1340500,1350500,1339100,1347900,116407987,0.008756174225415414,-0.02518796994715384,-0.017640908399409825,-0.013617597814514472\n20110427 00:00,1350500,1358700,1345000,1356300,95956938,0.006231916314266561,-0.02518579940972855,-0.01764115973595285,-0.013619140243108405\n20110428 00:00,1354200,1362900,1354100,1360400,101543480,0.003022930030229354,-0.02516570918069333,-0.017638050939666767,-0.01362508418578491\n20110429 00:00,1361400,1365700,1359800,1365400,85741363,0.0036753895912966517,-0.024967772963506517,-0.017474684489908618,-0.013480146751125317\n20110502 00:00,1371000,1371800,1359500,1362500,103821177,-0.0021239197304818713,-0.024968216126258602,-0.017492137272033487,-0.01350666729839754\n20110503 00:00,1359400,1361900,1350500,1357100,108602242,-0.003963302752293618,-0.02466298956227197,-0.017254082548679307,-0.013304421634730201\n20110504 00:00,1357000,1357300,1342400,1348600,158575567,-0.006263355684916316,-0.024661000450626493,-0.01725244326046928,-0.013302968836099171\n20110505 00:00,1340900,1349400,1330200,1336300,188183223,-0.009120569479460161,-0.024054088126426468,-0.016793325608708404,-0.012922639977334597\n20110506 00:00,1348800,1356200,1336800,1342000,184218970,0.0042655092419365825,-0.02386678118164628,-0.016637989415360793,-0.012784347273275107\n20110509 00:00,1342000,1351100,1339800,1347200,101087402,0.003874813710879277,-0.023104470735851583,-0.016148634864027647,-0.012440504499267402\n20110510 00:00,1351500,1361100,1350100,1358700,96564068,0.008536223277909816,-0.023081268830594748,-0.016118904345651414,-0.012407293601394887\n20110511 00:00,1356400,1356900,1338200,1344500,169055758,-0.010451166556266989,-0.023151737334816944,-0.016197337939715603,-0.012489973355380815\n20110512 00:00,1340700,1353600,1333900,1351000,151731104,0.004834510970621153,-0.02301519142947269,-0.0160808233547816,-0.012384137393236112\n20110513 00:00,1351700,1353300,1335700,1340400,137536979,-0.007846039970392349,-0.022846664045750885,-0.015949744944346016,-0.012273022891887895\n20110516 00:00,1335400,1346000,1329700,1331900,123693366,-0.006341390629662769,-0.022893798561429726,-0.01599034131479215,-0.012310133801303408\n20110517 00:00,1327000,1333500,1321200,1331700,169691578,-0.00015016142353030393,-0.02275727090758818,-0.015878879625936204,-0.012212034685630313\n20110518 00:00,1332600,1345000,1329500,1343800,113414741,0.009086130509874613,-0.022706944764219715,-0.01582559950092604,-0.012157179803937499\n20110519 00:00,1347900,1350200,1339400,1346600,107562279,0.002083643399315438,-0.02186527075074412,-0.015184477749891827,-0.011622971721912168\n20110520 00:00,1343100,1345200,1333600,1336700,151825718,-0.007351849101440711,-0.021902971169069176,-0.015235677380391714,-0.011681367732471653\n20110523 00:00,1319900,1324600,1315900,1320400,146936625,-0.012194209620707719,-0.02190290145793087,-0.015235623129528756,-0.011681321723424277\n20110524 00:00,1324200,1327300,1317000,1319500,125130970,-0.0006816116328385302,-0.021910404095822438,-0.015242799634840319,-0.011688324368664219\n20110525 00:00,1313800,1329300,1313800,1323700,126797102,0.0031830238726791027,-0.02185577273016844,-0.015193678355634305,-0.01164214049615479\n20110526 00:00,1320000,1332400,1317800,1330100,141163316,0.004834932386492463,-0.02145779097976179,-0.014945929738500391,-0.011474480606464584\n20110527 00:00,1333900,1338700,1331900,1335400,104585597,0.003984662807307693,-0.021316584193604805,-0.014827291687023417,-0.01136787386393499\n20110531 00:00,1347800,1349000,1338400,1348900,137873991,0.010109330537666716,-0.021082487619899642,-0.014629626370487443,-0.01118962991579022\n20110601 00:00,1345200,1346000,1317600,1318500,191089527,-0.022536881903773454,-0.021239922940506813,-0.014796980962682818,-0.01136227243496523\n20110602 00:00,1319800,1322300,1309600,1316900,171255274,-0.0012135001896094177,-0.021257124966043126,-0.01481498170453858,-0.011380698969535417\n20110603 00:00,1301600,1314200,1300800,1304000,175974272,-0.00979573240185283,-0.020617439502060502,-0.014334592352829096,-0.010985229785839242\n20110606 00:00,1300900,1303600,1288700,1290500,150447026,-0.010352760736196287,-0.020563444151540673,-0.014292687515125987,-0.010949770355780502\n20110607 00:00,1296700,1300700,1288500,1288500,140942241,-0.0015497869043006318,-0.02056832556515868,-0.014309841979336893,-0.010973467537848813\n20110608 00:00,1287700,1291900,1281800,1284000,172442254,-0.0034924330616996624,-0.020550219564474358,-0.014294773215823259,-0.010960017914232255\n20110609 00:00,1287700,1299300,1284600,1294000,124608303,0.007788161993769416,-0.02022265262359475,-0.014089209246558028,-0.010819493277690042\n20110610 00:00,1288300,1289300,1272600,1275600,200759581,-0.014219474497681572,-0.020403406331916903,-0.014238758547712999,-0.010952407624849093\n20110613 00:00,1278900,1282400,1270500,1276700,166838405,0.0008623392913138517,-0.02039463950212986,-0.014230391594107376,-0.010944253843756132\n20110614 00:00,1288800,1297700,1288200,1293200,135441318,0.012923944544528831,-0.020278536382766332,-0.01415852717136936,-0.010895972906493814\n20110615 00:00,1282600,1286500,1266800,1270200,253954829,-0.017785338694710773,-0.020522627025411206,-0.01435189145438128,-0.011062295154886909\n20110616 00:00,1270900,1279700,1263200,1272800,235033145,0.0020469217446070775,-0.02052146168080424,-0.014350556924334243,-0.011060870432707802\n20110617 00:00,1279100,1279400,1266200,1270200,196654705,-0.0020427404148334327,-0.020504084414777225,-0.014335669056968385,-0.011047309654556749\n20110620 00:00,1266000,1279700,1265800,1277000,118761833,0.005353487639741861,-0.020481649484441682,-0.01431098027372828,-0.011021419350673101\n20110621 00:00,1283400,1297000,1281900,1294200,156360187,0.013469068128425965,-0.02029610003160294,-0.014144930119772593,-0.010865764200799188\n20110622 00:00,1290500,1298100,1285900,1287000,149249226,-0.0055632823365785455,-0.02032067992265273,-0.014165487709377837,-0.01088417751638797\n20110623 00:00,1270900,1283700,1261900,1282900,235834402,-0.0031857031857032148,-0.020125611244041133,-0.014012222038323882,-0.010753196873980346\n20110624 00:00,1282800,1283700,1266200,1268100,164159526,-0.01153636292774185,-0.020259204192383067,-0.014125282383082347,-0.010855311363744756\n20110627 00:00,1269100,1284300,1266400,1279400,136843451,0.008910969166469496,-0.020228884509756757,-0.014088532255908826,-0.010815133190377534\n20110628 00:00,1284300,1296300,1282700,1296100,140874843,0.013052993590745743,-0.019620146854797498,-0.01360736722242511,-0.010401976649348582\n20110629 00:00,1301600,1309200,1297100,1307500,194592323,0.00879561762209713,-0.019524088150488134,-0.013518290612791408,-0.010316622168550805\n20110630 00:00,1311500,1321800,1309900,1319700,175250888,0.00933078393881459,-0.01949472904610668,-0.01348206775158087,-0.010276740263972472\n20110701 00:00,1319500,1341000,1317800,1339600,177311326,0.015079184663181033,-0.019488484975548698,-0.013453226207617642,-0.010235852090553783\n20110705 00:00,1338000,1340800,1333900,1337100,143543355,-0.0018662287249925358,-0.019511070137314117,-0.013478871833642794,-0.010263129238751239\n20110706 00:00,1334800,1341400,1331100,1339400,120813267,0.0017201406027971267,-0.019123169650397197,-0.013239787907732989,-0.010103378870852052\n20110707 00:00,1351300,1357000,1348800,1354600,135298236,0.01134836493952518,-0.019134027010792944,-0.013245442715057535,-0.01010626021638522\n20110708 00:00,1338400,1344400,1333900,1344000,141569480,-0.007825188247453152,-0.01921408126665059,-0.013319385853498466,-0.010176945540744116\n20110711 00:00,1327300,1331800,1316600,1319600,153549170,-0.01815476190476195,-0.019482791693892016,-0.013531560335505602,-0.010358980919545428\n20110712 00:00,1316900,1327800,1313600,1314300,183267791,-0.004016368596544417,-0.019462231521949074,-0.013539232173158031,-0.010381703137046935\n20110713 00:00,1321100,1332200,1315200,1318500,175157447,0.003195617438940923,-0.019452827888541187,-0.013528974450101861,-0.010370990101959635\n20110714 00:00,1321700,1327800,1306800,1309400,203950283,-0.0069017823284034385,-0.019511573877969524,-0.013578640248448475,-0.010415815284039787\n20110715 00:00,1316400,1318700,1307700,1317400,181930028,0.006109668550481118,-0.01895155974106239,-0.013143251054398735,-0.010046863185880703\n20110718 00:00,1310600,1312800,1296300,1305800,156024657,-0.008805222407772928,-0.019046151297303433,-0.01322756366868702,-0.01012569613424889\n20110719 00:00,1313500,1328900,1313100,1327800,141053959,0.016847909327615262,-0.019105262334567653,-0.013262666555348798,-0.010148000364661276\n20110720 00:00,1330800,1331500,1324200,1326500,116123946,-0.0009790631119144244,-0.018955293509607927,-0.013142658918813794,-0.010043964926810839\n20110721 00:00,1333900,1348200,1331400,1345200,210672957,0.014097248398039941,-0.018828685825967906,-0.013062918554032757,-0.009989209356291533\n20110722 00:00,1345000,1347200,1337700,1346100,104151486,0.000669045495093723,-0.01882761632642479,-0.013071259561048739,-0.010002567069532706\n20110725 00:00,1333300,1344900,1331600,1338300,118778460,-0.005794517494985496,-0.018864272673231396,-0.01311612701245082,-0.010051811830411284\n20110726 00:00,1337500,1339600,1330300,1333600,110478321,-0.0035119181050586867,-0.018887004002853727,-0.013136073452765244,-0.010070273656540521\n20110727 00:00,1325800,1326000,1304300,1306000,227669341,-0.020695860827834478,-0.01916260229412911,-0.013347179047054604,-0.01024699843270738\n20110728 00:00,1306200,1317600,1300100,1301600,174850267,-0.0033690658499234694,-0.019151437116212162,-0.013337850364427814,-0.010238648778924234\n20110729 00:00,1289000,1305500,1283600,1290500,259846955,-0.008527965580823582,-0.019230137570762407,-0.01340319865637188,-0.010296879082389626\n20110801 00:00,1309500,1309600,1275300,1287100,282573772,-0.0026346377373110963,-0.019072624281506793,-0.01332114095501192,-0.010255046475730377\n20110802 00:00,1277700,1285000,1254900,1254900,277202501,-0.02501748115919511,-0.019492596380863696,-0.01364159928313008,-0.010522454380629532\n20110803 00:00,1256600,1263100,1235300,1262100,330037238,0.005737508964857696,-0.019490496332352426,-0.013641213903118387,-0.010522983084050218\n20110804 00:00,1244200,1246200,1200700,1201800,425131235,-0.04777751366769667,-0.02089018137518973,-0.014685172618282036,-0.011377305410216457\n20110805 00:00,1219000,1220700,1168700,1199800,563324602,-0.0016641704110500477,-0.020874311526896203,-0.014671353846618284,-0.01136458005991449\n20110808 00:00,1169800,1183500,1120200,1122600,575520736,-0.0643440573428905,-0.023160354129504384,-0.016368713286963814,-0.012748114684747687\n20110809 00:00,1142500,1174900,1102700,1173700,488407780,0.04551933012649201,-0.023883074352085556,-0.016820422368134406,-0.013055348729248186\n20110810 00:00,1151800,1162800,1119600,1123500,437511075,-0.04277072505751045,-0.024421636097053983,-0.017218974090300314,-0.013379261626333726\n20110811 00:00,1134500,1189200,1128500,1172800,370920501,0.04388072986203828,-0.025023633244106714,-0.01758616294532434,-0.01362127504973262\n20110812 00:00,1185500,1192100,1172800,1181500,268509211,0.00741814461118695,-0.02499878505461267,-0.017556545090994784,-0.013589114504728333\n20110815 00:00,1192400,1207400,1190000,1205500,212752002,0.020313161235717248,-0.02508421057932878,-0.017593117108382225,-0.013599642898130296\n20110816 00:00,1193400,1206900,1183100,1195600,244497729,-0.008212360016590647,-0.025138060012235237,-0.017655019698416066,-0.013665838596429844\n20110817 00:00,1203100,1211900,1187200,1196700,208918724,0.0009200401472064801,-0.02514065537867034,-0.017657800669772634,-0.01366871851308326\n20110818 00:00,1165000,1166400,1133900,1146100,425616854,-0.04228294476476979,-0.02586763667769444,-0.018200849462442416,-0.014113713567216498\n20110819 00:00,1129100,1158800,1125000,1126800,356095922,-0.016839717302155166,-0.026036908602225902,-0.018336338260446637,-0.014231192705475924\n20110822 00:00,1151200,1152300,1124100,1127300,242458988,0.0004437344692935774,-0.026013910017597633,-0.018315236869207212,-0.014211102701011951\n20110823 00:00,1131700,1165400,1125800,1164600,281355605,0.033087909163487916,-0.02616906335793578,-0.018369438186620294,-0.014211486868553981\n20110824 00:00,1161800,1182400,1159300,1181300,207713990,0.014339687446333516,-0.026199244201506572,-0.01837763202962066,-0.014207959522908214\n20110825 00:00,1188000,1194000,1158700,1163100,257738746,-0.01540675526961821,-0.026320122890817796,-0.0184738733814508,-0.014291066801292121\n20110826 00:00,1156600,1185100,1138600,1180400,270142650,0.014874043504427892,-0.0263183012852684,-0.018472859424082527,-0.014290483398180684\n20110829 00:00,1195200,1214200,1194400,1213800,161544072,0.028295493053202225,-0.02637655972519623,-0.018465051916639826,-0.014247456378656957\n20110830 00:00,1208600,1224300,1192600,1216200,211257778,0.001977261492832394,-0.02637418858504445,-0.018462511478048615,-0.014244825687694144\n20110831 00:00,1224800,1235100,1213000,1220600,245536971,0.0036178260154580144,-0.02617003502814243,-0.018346693381336408,-0.014176098897943587\n20110901 00:00,1222500,1234000,1207800,1209600,224361524,-0.009011961330493201,-0.026247311125549712,-0.018422849686800517,-0.014251658246466325\n20110902 00:00,1184700,1190700,1174300,1178400,203457102,-0.025793650793650813,-0.026611260061113612,-0.0187255637962659,-0.01452172829672432\n20110906 00:00,1144300,1171600,1143800,1169900,246122470,-0.007213170400543145,-0.026565289447630674,-0.018688449610053736,-0.014489335439118982\n20110907 00:00,1188500,1203300,1183700,1202700,179440332,0.028036584323446467,-0.026770017948687944,-0.018808348814047013,-0.014564012458739214\n20110908 00:00,1195900,1209300,1187800,1190200,217993064,-0.010393281782655639,-0.026868544636706734,-0.01889567478968842,-0.014645367376057958\n20110909 00:00,1176800,1181000,1152800,1158600,324360564,-0.026550159637035775,-0.02726882397626382,-0.019215845140126843,-0.014922831920822551\n20110912 00:00,1144900,1167600,1140500,1166600,266243906,0.0069048852062834065,-0.027258815175011726,-0.019213039667831774,-0.014923866516540173\n20110913 00:00,1170800,1181800,1162200,1175800,233871130,0.00788616492370986,-0.027247817318940985,-0.019195374137000454,-0.014902646472966219\n20110914 00:00,1183200,1207800,1167200,1193600,262265087,0.015138629018540462,-0.02728513804486735,-0.019209220013750198,-0.01490397799448332\n20110915 00:00,1205500,1214700,1195700,1214700,249832457,0.017677613941018855,-0.027330999008290495,-0.01922068525904558,-0.014897107009718429\n20110916 00:00,1213100,1219500,1203200,1215800,241561427,0.0009055733926073284,-0.02729467703090863,-0.019187886703855375,-0.014866186777860954\n20110919 00:00,1195600,1209300,1187200,1203100,203129673,-0.010445797006086499,-0.027354791824234975,-0.019260305692078823,-0.014945165086855146\n20110920 00:00,1208300,1219900,1200100,1201700,197070638,-0.0011636605435957348,-0.02735018155704976,-0.019256058080737395,-0.014941110806002111\n20110921 00:00,1202600,1205900,1165000,1165100,265304249,-0.030456852791878153,-0.027805667036875766,-0.019607704107202355,-0.01523740040411488\n20110922 00:00,1132800,1142100,1113000,1128000,421358975,-0.031842760278087745,-0.028264237555072496,-0.01995942386019558,-0.015532158409555383\n20110923 00:00,1121600,1141600,1120200,1135400,256734677,0.006560283687943258,-0.028178033439450162,-0.019914509676535103,-0.015509255735839653\n20110926 00:00,1146400,1164000,1129800,1162500,239547138,0.023868240267747032,-0.028275782599233888,-0.019951117451904695,-0.015513269265418034\n20110927 00:00,1185300,1195600,1168400,1176000,256192520,0.011612903225806548,-0.02828838998258993,-0.01995009077813956,-0.015504974326251376\n20110928 00:00,1178300,1184800,1149700,1151600,259939999,-0.02074829931972788,-0.02852430505913419,-0.020138379260740507,-0.015667873247852654\n20110929 00:00,1171200,1176300,1139400,1160200,269136509,0.007467870788468112,-0.028502272699601556,-0.02011117331293818,-0.015637909279287456\n20110930 00:00,1144500,1154400,1130800,1131700,248418973,-0.0245647302189278,-0.028837940493500934,-0.020382056071895867,-0.015874255375840206\n20111003 00:00,1125000,1139500,1098200,1099300,311460260,-0.028629495449324027,-0.02920524408770172,-0.020666317946677174,-0.016114248017276234\n20111004 00:00,1084300,1125800,1074300,1121300,417972274,0.020012735377058055,-0.02920297591541698,-0.020664954912657803,-0.016113367509116867\n20111005 00:00,1125900,1147200,1115800,1145000,256163233,0.02113618121822891,-0.02928446599438389,-0.020698102498811075,-0.016120743891231727\n20111006 00:00,1143500,1166600,1135200,1165100,227492632,0.017554585152838476,-0.029320446235940094,-0.020701432788876633,-0.01610666861297144\n20111007 00:00,1171600,1172500,1150600,1157500,248676622,-0.006523045232168956,-0.029373311142497114,-0.020753114790231106,-0.01615772001193951\n20111010 00:00,1177200,1195900,1176700,1195900,198271905,0.03317494600431958,-0.029642565883418546,-0.020905924420259556,-0.0162484531842299\n20111011 00:00,1188500,1200400,1187500,1196800,178972455,0.0007525712852245459,-0.029648381988963787,-0.020912450226010543,-0.016255357328534486\n20111012 00:00,1206000,1221300,1203300,1206700,242813965,0.008272058823529438,-0.029649476086504103,-0.020912451258901118,-0.016254775652704924\n20111013 00:00,1200300,1208700,1191200,1204700,195568141,-0.0016574127786525006,-0.029642957711194642,-0.020906514807149394,-0.016249149422248556\n20111014 00:00,1218600,1225800,1212300,1225600,172262036,0.017348717523034685,-0.029685281707153,-0.02091795372817097,-0.01624412362410462\n20111017 00:00,1219900,1220600,1199300,1202400,171627600,-0.018929503916449097,-0.029902907789944103,-0.02110202861500901,-0.01641031249252875\n20111018 00:00,1200800,1235000,1192000,1226100,268361142,0.019710578842315307,-0.02981073009299662,-0.02099589799834543,-0.01629674362599416\n20111019 00:00,1223300,1230800,1207200,1211400,214042358,-0.011989234157083417,-0.02991755647456474,-0.021096921435702607,-0.016394673535264984\n20111020 00:00,1213600,1220900,1198200,1216900,237363342,0.0045402014198447915,-0.02991338380938072,-0.02109115883058883,-0.016388063339057863\n20111021 00:00,1230700,1241200,1227200,1239100,235785897,0.01824307667022773,-0.02996422419224588,-0.02110845724594536,-0.016387480655650065\n20111024 00:00,1241400,1258000,1240600,1254900,183187923,0.012751190380114519,-0.029977440846520126,-0.02110602325954412,-0.01637670337061641\n20111025 00:00,1249300,1249400,1227800,1230800,251450068,-0.019204717507371072,-0.030189663138317117,-0.0212787928339748,-0.016528440847405027\n20111026 00:00,1243500,1247700,1222100,1243300,269728092,0.01015599610009743,-0.03016876025998708,-0.02124878034058593,-0.01649357205193638\n20111027 00:00,1277000,1294200,1266100,1285300,311523237,0.03378106651652857,-0.030428599098820654,-0.021393426885729695,-0.016576810011557332\n20111028 00:00,1279800,1288500,1278000,1286800,195357919,0.0011670427137633332,-0.030428359706342938,-0.021393177329844287,-0.016576555037596887\n20111031 00:00,1272300,1272600,1253600,1254500,196077055,-0.02510102580043516,-0.030753764775935794,-0.021652435835537994,-0.016800551054836473\n20111101 00:00,1220000,1235100,1215200,1220800,327694121,-0.026863292148266216,-0.031125226551218847,-0.02195572273537412,-0.01706749418083766\n20111102 00:00,1238800,1244000,1228000,1239900,223203130,0.015645478374836097,-0.03115656056059085,-0.021964748885316375,-0.017064628093463142\n20111103 00:00,1253100,1265000,1236000,1262400,250528531,0.018146624727800598,-0.03115140963679533,-0.021961806501804074,-0.01706286307460362\n20111104 00:00,1252300,1257000,1240100,1254500,222714743,-0.00625792141951842,-0.03120136802310459,-0.022008968494753072,-0.017108534320599687\n20111107 00:00,1254300,1263900,1242000,1262800,190854662,0.006616181745715322,-0.03118167127830604,-0.021985456404476526,-0.01708298828376665\n20111108 00:00,1269300,1280200,1257100,1278600,198356191,0.01251187836553691,-0.03113164605390973,-0.021926623635640633,-0.01701946024558036\n20111109 00:00,1249100,1254600,1228700,1231900,258953226,-0.036524323478804965,-0.03174725273755157,-0.022409034113369086,-0.01743086431879904\n20111110 00:00,1248000,1249400,1230200,1243200,212759650,0.009172822469356356,-0.03171979940595156,-0.022374865605727382,-0.017393115975657514\n20111111 00:00,1258600,1269900,1258000,1266200,160894568,0.0185006435006434,-0.0316587188285088,-0.022296029958515016,-0.017304815166449623\n20111114 00:00,1262100,1263500,1249200,1254600,132357162,-0.009161269941557415,-0.031719831570749694,-0.02234853559879895,-0.017352732392528946\n20111115 00:00,1251200,1267500,1247200,1261200,161096614,0.005260640841702635,-0.03155402005249571,-0.022206588939909067,-0.01722350800185951\n20111116 00:00,1248100,1263400,1239000,1240500,208022997,-0.016412940057088488,-0.031716570721113085,-0.022341486564656576,-0.017343663891243873\n20111117 00:00,1238400,1241600,1212300,1221800,289968098,-0.015074566706973047,-0.03183934850424224,-0.022463620678884078,-0.017465454867961656\n20111118 00:00,1224600,1227500,1214700,1219900,194731409,-0.0015550826649206595,-0.031853302053176415,-0.022477618931206374,-0.01747947695149475\n20111121 00:00,1202100,1203400,1186600,1196200,196378704,-0.01942782195261905,-0.03205630367425108,-0.022643059927522687,-0.017624894517737043\n20111122 00:00,1193900,1201000,1185300,1191900,211395413,-0.003594716602574821,-0.031942889960413744,-0.022549929571844925,-0.01754257714524014\n20111123 00:00,1180700,1182000,1165600,1165600,187557531,-0.022065609531000896,-0.0321794109059941,-0.022760188992737754,-0.017738836644496922\n20111125 00:00,1163800,1177000,1162000,1162000,82609855,-0.00308853809196985,-0.03214489251687276,-0.022730474714391352,-0.017711683419828105\n20111128 00:00,1195300,1201800,1188200,1197000,187351680,0.030120481927710774,-0.0323232308901741,-0.02282048286727618,-0.017754603059055043\n20111129 00:00,1200900,1208600,1196100,1200800,179062421,0.0031746031746031633,-0.03227972857651678,-0.02277940010941064,-0.01771481015742907\n20111130 00:00,1235000,1252200,1232200,1251100,251880591,0.041888740839440386,-0.03262537429631093,-0.022999820666853094,-0.01786847364418944\n20111201 00:00,1248500,1256400,1244300,1249800,159154203,-0.001039085604667922,-0.03262794176467705,-0.023017927396578822,-0.017894864296646426\n20111202 00:00,1261400,1265000,1247800,1248600,177337985,-0.0009601536245799069,-0.032639976117787066,-0.023030302928966278,-0.017907421710444228\n20111205 00:00,1268000,1271800,1254500,1262100,162251741,0.010812109562710281,-0.03262983114703819,-0.023009425558766436,-0.017880822937809914\n20111206 00:00,1261700,1271100,1257600,1262600,131839611,0.00039616512162266027,-0.03263109024449848,-0.023010707672957396,-0.017882117322134825\n20111207 00:00,1258400,1272600,1249700,1267500,198050354,0.003880880722318958,-0.03263087254733985,-0.023010395805751524,-0.017881755253225225\n20111208 00:00,1258800,1261800,1236500,1239800,209396519,-0.021854043392504963,-0.03288772150866501,-0.023222404169275065,-0.018069859259983286\n20111209 00:00,1245200,1263700,1244100,1260300,165468493,0.01653492498790121,-0.03292236489554129,-0.02323406150894307,-0.018069262822939268\n20111212 00:00,1249100,1249700,1231600,1242400,178947251,-0.01420296754740935,-0.0330474058652604,-0.02333954318603322,-0.018164317513503694\n20111213 00:00,1249000,1255700,1224500,1231100,208440687,-0.009095299420476488,-0.03311355545537425,-0.023397727605375274,-0.01821825572978063\n20111214 00:00,1225900,1230200,1214700,1217100,209648393,-0.01137194379010642,-0.033178126372135595,-0.02345165966293596,-0.018266516250868153\n20111215 00:00,1231200,1232000,1219900,1221500,165196209,0.0036151507682196105,-0.033180102374207425,-0.023455410313385588,-0.0182712129598013\n20111216 00:00,1222100,1229500,1213000,1215700,176091223,-0.0047482603356528985,-0.033188253445274554,-0.023462595493116155,-0.018277883226434404\n20111219 00:00,1220600,1223200,1200300,1203200,155423430,-0.01028214197581645,-0.03326857988923798,-0.02353311923804807,-0.01834318118878531\n20111220 00:00,1222300,1241400,1221700,1238800,174072018,0.029587765957446832,-0.03344598605835997,-0.02363181189738904,-0.01839991196732369\n20111221 00:00,1239400,1243600,1227500,1241700,172629737,0.0023409751372296395,-0.033447873631537194,-0.023634133546142817,-0.01840246502016113\n20111222 00:00,1246400,1253900,1243600,1253300,107292214,0.009342031086413849,-0.03343202854974413,-0.023610406791440653,-0.018374536574795486\n20111223 00:00,1256400,1264300,1254100,1263900,70389081,0.008457671746588957,-0.03342210917675115,-0.023593931538883502,-0.018354566407101237\n20111227 00:00,1261500,1268200,1260600,1264900,67901152,0.0007912018355882289,-0.033423482706210074,-0.023595370703377513,-0.018356040561389585\n20111228 00:00,1265300,1265300,1247300,1249200,99876424,-0.012412048383271368,-0.03352654994147837,-0.023683782502681786,-0.01843663960201059\n20111229 00:00,1252100,1262500,1251800,1261000,92793923,0.009446045469100328,-0.03350990218592549,-0.023659184378065985,-0.018407803165065895\n20111230 00:00,1259900,1263300,1255000,1255000,68634754,-0.004758128469468659,-0.033538218174483624,-0.02368529135679701,-0.018432732528832037\n20120103 00:00,1277500,1283800,1274400,1274900,153839622,0.015856573705179233,-0.03356358370099808,-0.02369616104782084,-0.0184358745435944\n20120104 00:00,1271800,1278100,1267200,1276300,97719637,0.0010981253431641136,-0.03355684919525107,-0.023689390619505514,-0.018429084965090825\n20120105 00:00,1270100,1282300,1264300,1281000,125717608,0.0036825197837500045,-0.03355890897026054,-0.023693068631803618,-0.01843362565369958\n20120106 00:00,1282200,1282200,1272900,1278200,107707317,-0.002185792349726823,-0.03356012901403498,-0.023694195337016766,-0.01843470260047108\n20120109 00:00,1280400,1281800,1274100,1279900,73574543,0.0013299953058989455,-0.03354571537926647,-0.02368008541762334,-0.018420754590620276\n20120110 00:00,1293700,1296500,1289500,1291300,89928567,0.008906945855144954,-0.03353077365614099,-0.023658069342946467,-0.01839496720530841\n20120111 00:00,1287500,1293700,1285200,1292500,89885776,0.0009292960582358845,-0.03353723885954702,-0.023665404431893407,-0.018402766027018392\n20120112 00:00,1295400,1297000,1285400,1295100,90072240,0.002011605415860762,-0.03354007685599287,-0.0236761108511318,-0.01841766707333216\n20120113 00:00,1286600,1290100,1277200,1290100,140555253,-0.003860705737008696,-0.03355380305180172,-0.023688587044537867,-0.01842947689508265\n20120117 00:00,1301000,1303200,1290600,1293100,100741169,0.002325401131695326,-0.03355888114415432,-0.023696985862994457,-0.018439645980337677\n20120118 00:00,1293500,1308400,1290800,1308000,121911064,0.011522697393859804,-0.03356136095543856,-0.02368759226850083,-0.018423922717158737\n20120119 00:00,1312400,1315700,1308100,1314800,94452469,0.005198776758409851,-0.03347884570692777,-0.023611897999197953,-0.018351864686632097\n20120120 00:00,1312300,1319500,1309200,1319500,92111257,0.0035746881655005502,-0.03346377694428988,-0.02359590988937125,-0.018335386476220877\n20120123 00:00,1315000,1322500,1309800,1315800,104367886,-0.0028040924592648286,-0.03348390435878406,-0.02361539660797422,-0.018354531642215\n20120124 00:00,1307700,1315000,1306000,1314600,80446736,-0.0009119927040583953,-0.0335009532583178,-0.02363575642616217,-0.018376656498886194\n20120125 00:00,1312400,1328700,1307500,1325700,142742589,0.008443633044272092,-0.0334892274964045,-0.023617650090446002,-0.0183551487028856\n20120126 00:00,1331500,1334000,1313700,1319000,136612555,-0.0050539337708380705,-0.03352946516142806,-0.023656745591407218,-0.018393635320411505\n20120127 00:00,1311500,1320500,1311500,1317300,103843754,-0.001288855193328331,-0.03354372676275997,-0.02367137519782886,-0.01840846110898476\n20120130 00:00,1305000,1314400,1300600,1313800,111244083,-0.0026569498216048038,-0.03338311892485931,-0.023540253760182966,-0.01829305876220688\n20120131 00:00,1320200,1321800,1306800,1312100,123069314,-0.0012939564621707866,-0.033401667666190724,-0.023563519651982914,-0.018318839349466848\n20120201 00:00,1323100,1331400,1321300,1324700,123870829,0.009602926606203877,-0.03337602896589574,-0.023552659073399124,-0.018315856932884168\n20120202 00:00,1327500,1330200,1322100,1326800,87353028,0.0015852645882086236,-0.03336221614638673,-0.023539004288239563,-0.018302286395251534\n20120203 00:00,1340300,1346200,1337700,1345700,108928852,0.014244799517636464,-0.03337639180636656,-0.02353496249466006,-0.018288532944589143\n20120206 00:00,1339900,1345000,1338300,1344600,78933992,-0.0008174184439325716,-0.033389671362559305,-0.02354894708082973,-0.018302893379630706\n20120207 00:00,1342000,1350200,1336400,1347900,105743604,0.0024542614904061733,-0.03339460837979763,-0.02355694059006935,-0.01831251629344636\n20120208 00:00,1348800,1352200,1343100,1351900,101030602,0.002967579197269865,-0.03339716029910772,-0.02356049112280869,-0.018316599183309686\n20120209 00:00,1353900,1355800,1345700,1353400,115253050,0.0011095495228936603,-0.03338336164059736,-0.023547077664722197,-0.01830339107414381\n20120210 00:00,1341400,1344700,1338400,1344300,120730639,-0.0067238067090290565,-0.03342564061742678,-0.02358487535735369,-0.018338799810751368\n20120213 00:00,1352900,1355200,1347400,1353600,90078617,0.006918098638696746,-0.03342573617454101,-0.023584104225204912,-0.018337566649763472\n20120214 00:00,1349900,1352700,1342500,1351900,124259501,-0.0012559101654846527,-0.033438503178568856,-0.02359703574005065,-0.018350585864717498\n20120215 00:00,1356400,1358300,1342900,1345400,151754087,-0.0048080479325394165,-0.03345084511711234,-0.023607953633924005,-0.01836074460564656\n20120216 00:00,1345600,1361700,1343400,1360400,133245607,0.011149100639215037,-0.03345816997379585,-0.023606987577615108,-0.018355358694300074\n20120217 00:00,1365200,1365700,1359600,1364100,96651581,0.002719788297559589,-0.03345877498440134,-0.023607728411520066,-0.018356171935103395\n20120221 00:00,1367500,1370500,1360500,1364600,95051314,0.00036654204237218657,-0.03346576743530316,-0.023615277714821324,-0.01836401809435829\n20120222 00:00,1362000,1365500,1357900,1360200,95836135,-0.0032243880990766582,-0.03326193614688267,-0.023450977614353715,-0.018220791923912072\n20120223 00:00,1359500,1367300,1355000,1366100,111498117,0.004337597412145344,-0.033213770953556314,-0.02340491198472182,-0.01817584556391673\n20120224 00:00,1369500,1372000,1366300,1369300,85773667,0.0023424346680331887,-0.033202826271318334,-0.02339365186801735,-0.018164417290265373\n20120227 00:00,1360400,1375300,1358000,1371600,108707496,0.0016796903527349638,-0.03320420115040232,-0.023405102453543672,-0.018181239197613212\n20120228 00:00,1371900,1377200,1369300,1375600,98896749,0.002916302128900483,-0.033208096587487475,-0.02341175846474399,-0.018189366860659435\n20120229 00:00,1377300,1381900,1367200,1368700,137944326,-0.0050159930212271275,-0.033073792375111453,-0.02330289790789619,-0.01809407022242519\n20120301 00:00,1373200,1379900,1371200,1377700,110411453,0.006575582669686497,-0.0330676392862159,-0.023293301304806502,-0.018082637894660566\n20120302 00:00,1376300,1378200,1370000,1373200,88920412,-0.003266313420918876,-0.03305704551516922,-0.02331008173160454,-0.01811401140503755\n20120305 00:00,1370500,1371900,1362800,1367500,96836494,-0.0041508884357704945,-0.03303069724037959,-0.023287567716612684,-0.018093541419756068\n20120306 00:00,1352900,1354300,1343600,1346700,144814675,-0.015210237659963433,-0.03311166237256474,-0.023352843101144907,-0.0181504526578709\n20120307 00:00,1350600,1359100,1349300,1356900,103577541,0.00757406994876364,-0.03310975242516082,-0.023353218157356432,-0.018152045841054683\n20120308 00:00,1365000,1373200,1362400,1370200,85876391,0.009801753998083917,-0.03309476335146477,-0.023329734876134153,-0.018124034329231077\n20120309 00:00,1373600,1379300,1371300,1375700,91438907,0.004014012552912005,-0.03289430983226905,-0.023161736528179825,-0.017973337712972465\n20120312 00:00,1375600,1377600,1370900,1375800,78786035,7.269026677336754e-05,-0.032907312467508894,-0.023178987364719166,-0.01799285324990505\n20120313 00:00,1383800,1401200,1380900,1400600,158323337,0.01802587585404858,-0.032899900530545485,-0.023145772959400346,-0.0179458836441822\n20120314 00:00,1400700,1404500,1394800,1399100,128829330,-0.0010709695844638434,-0.03281371870634575,-0.023072764005966657,-0.017879897099410638\n20120315 00:00,1401200,1407800,1397600,1407200,137226098,0.0057894360660424304,-0.032612995129164345,-0.022902861952318422,-0.017726425885909808\n20120316 00:00,1403200,1404800,1400000,1402700,124840231,-0.0031978396816373378,-0.03263090659263986,-0.022934349330775407,-0.017765150534408785\n20120319 00:00,1402000,1412800,1401100,1408800,109925153,0.004348755970628115,-0.032615276539736004,-0.022917424349037267,-0.017747535230900682\n20120320 00:00,1400500,1406100,1396400,1404100,111240920,-0.00333617262918795,-0.03262089421106749,-0.022943290548306353,-0.017784195845488175\n20120321 00:00,1404600,1406500,1399200,1401600,108863774,-0.0017804999643900032,-0.032611343543269,-0.022934665066752107,-0.017776063577297295\n20120322 00:00,1391700,1395500,1387400,1391600,125466549,-0.007134703196347014,-0.032667002418400884,-0.02298536967949085,-0.017824127091086387\n20120323 00:00,1393700,1398100,1385500,1396900,92667075,0.003808565679793041,-0.03266579444297042,-0.022991386619713824,-0.01783399560711003\n20120326 00:00,1406200,1416100,1406000,1416100,99701237,0.013744720452430359,-0.032679128808137614,-0.022988300192446385,-0.017822155316157145\n20120327 00:00,1417400,1418300,1410800,1411300,92318657,-0.0033895911305699133,-0.03268361767740677,-0.022992315398133855,-0.0178259180135419\n20120328 00:00,1410900,1413200,1396400,1404300,129945172,-0.00495996598880466,-0.032726038831784536,-0.023036243078244874,-0.017870648816946756\n20120329 00:00,1396200,1404200,1390900,1402200,149350733,-0.00149540696432382,-0.03274647258575594,-0.023059834712879826,-0.01789592390607842\n20120330 00:00,1409100,1410500,1400600,1407200,116418788,0.003565825131935485,-0.03272904325651247,-0.02304170157486508,-0.017877415570211996\n20120402 00:00,1406400,1422100,1403700,1417900,124770859,0.007603752131893016,-0.03272865360537556,-0.023038201423499462,-0.017872257222684162\n20120403 00:00,1416000,1418800,1404300,1412600,135974247,-0.0037379222794273748,-0.03275155674703888,-0.023059526214077208,-0.017892740600138513\n20120404 00:00,1401700,1403300,1393400,1398400,136665920,-0.010052385671810882,-0.03282640786021133,-0.023124135732691942,-0.017951890362591254\n20120405 00:00,1394000,1402000,1392600,1397800,104649640,-0.0004290617848969891,-0.03283811185140527,-0.0231365742540074,-0.017964720459196528\n20120409 00:00,1379400,1387800,1378400,1382300,102847154,-0.011088853913292285,-0.03291137739524493,-0.02319831047781592,-0.018020310445158106\n20120410 00:00,1379400,1383400,1357600,1358400,218274578,-0.017290023873254734,-0.03306144882359365,-0.023320507490828583,-0.018127647710498136\n20120411 00:00,1373300,1375400,1367500,1369000,132627770,0.007803297997644343,-0.03303430659350064,-0.023288832878772057,-0.018093556902387925\n20120412 00:00,1371300,1389000,1370300,1388500,139019808,0.014243973703433221,-0.03298980652001239,-0.02323185957047956,-0.018029934158775688\n20120413 00:00,1384600,1384800,1370100,1371300,139193450,-0.012387468491177556,-0.033090954422833434,-0.023317776836534087,-0.01810773202872754\n20120416 00:00,1378300,1380400,1365800,1369300,135725445,-0.0014584700649019622,-0.03310091867468541,-0.023327490339048643,-0.018117311857698153\n20120417 00:00,1378600,1393600,1377000,1390900,120502872,0.01577448331264142,-0.033127569326335045,-0.023332944449209223,-0.018111466170023963\n20120418 00:00,1384900,1390800,1383800,1385900,112671125,-0.0035947947372204636,-0.033049753353814916,-0.023268113313714756,-0.018053557203100406\n20120419 00:00,1386000,1391400,1370700,1377500,183200752,-0.006061043365322205,-0.03310022740525873,-0.023317526468241034,-0.01810240479740555\n20120420 00:00,1382400,1388300,1378700,1379500,126288466,0.0014519056261343977,-0.03308793904295117,-0.02332379750980575,-0.01811856978849967\n20120423 00:00,1365500,1369100,1359400,1367900,143801646,-0.008408843783979658,-0.0331571174019703,-0.023387548881501727,-0.01817942805333503\n20120424 00:00,1368700,1376500,1368000,1373100,120700892,0.0038014474742305016,-0.03314227034118001,-0.023371589031128417,-0.018162874978952633\n20120425 00:00,1385600,1392500,1385300,1392400,133661106,0.014055786177263219,-0.03315953597776481,-0.023377636054706975,-0.01816294140144953\n20120426 00:00,1389100,1403200,1388200,1401700,114664137,0.006679115196782437,-0.03315955820765771,-0.02337713191088334,-0.018162156649745333\n20120427 00:00,1405600,1407800,1398000,1404200,104637129,0.0017835485481914048,-0.03316273823331482,-0.0233808211220017,-0.018166117305748956\n20120430 00:00,1401300,1402100,1394900,1397700,92165955,-0.00462897023216069,-0.033199387028085774,-0.023416387485510094,-0.018201106629156576\n20120501 00:00,1398100,1416600,1396300,1407400,115353699,0.006939972812477713,-0.03317625720816766,-0.023389496822923603,-0.018172211075259726\n20120502 00:00,1399300,1404600,1394600,1402800,103011706,-0.0032684382549381663,-0.03317177361098064,-0.023385518908607093,-0.01816850273861032\n20120503 00:00,1404000,1404500,1389900,1392500,123832837,-0.007342457941260316,-0.03318095538238815,-0.023393265356172758,-0.018175484020346994\n20120504 00:00,1385200,1386600,1369200,1369600,158063698,-0.016445242369838464,-0.033271407790679365,-0.02346573491074498,-0.018238366982143137\n20120507 00:00,1364800,1375600,1364700,1371000,108876105,0.0010221962616823177,-0.03327916116961275,-0.023474987268065885,-0.018248418439295786\n20120508 00:00,1363100,1367700,1349200,1365000,191348137,-0.004376367614879695,-0.03331415118099493,-0.023509318962949034,-0.018282399188089257\n20120509 00:00,1351000,1366000,1344900,1357400,201963421,-0.005567765567765615,-0.03335779125934073,-0.023556570517760774,-0.018331576007641535\n20120510 00:00,1367500,1368500,1357100,1359500,129264219,0.0015470752909974017,-0.03327478202745212,-0.023483930741747212,-0.018264464150185112\n20120511 00:00,1351600,1368700,1351100,1355600,135521665,-0.0028687017285766725,-0.033301121331478466,-0.023511508914401836,-0.01829270275912132\n20120514 00:00,1343200,1350300,1339100,1341300,140800618,-0.010548834464443768,-0.0333280759064798,-0.023533709210571834,-0.018312368566838478\n20120515 00:00,1340500,1348100,1331300,1333500,177460833,-0.005815253858197256,-0.03332388930703178,-0.023530137432988645,-0.018309124548516416\n20120516 00:00,1339200,1345400,1328000,1328800,187878911,-0.003524559430071239,-0.033341498651709676,-0.02354651087480503,-0.01832483913509051\n20120517 00:00,1328800,1330200,1308100,1308700,212866150,-0.015126429861529234,-0.03348542894665963,-0.02367642408385288,-0.018447279887511023\n20120518 00:00,1314000,1316000,1295500,1297400,279229262,-0.008634522808894318,-0.033550403475458054,-0.023734824282977327,-0.018502175335813113\n20120521 00:00,1301400,1320200,1299500,1320200,148240929,0.01757360875597347,-0.03353328075469509,-0.02369374214766561,-0.018448320525261887\n20120522 00:00,1323400,1332300,1313400,1322000,168227548,0.0013634297833662323,-0.03343160356462282,-0.023606090341932045,-0.0183681456000215\n20120523 00:00,1312600,1324600,1299900,1322700,190382180,0.0005295007564296572,-0.033426651805338436,-0.02360118128179088,-0.018363259302635587\n20120524 00:00,1326700,1328400,1314200,1325300,150009412,0.0019656762682391804,-0.03342955485969762,-0.023604649045207527,-0.01836702811036119\n20120525 00:00,1324800,1328500,1317800,1321000,117560211,-0.003244548404134906,-0.03345796721361308,-0.023634130381776496,-0.01839707931762721\n20120529 00:00,1331600,1339300,1327500,1337000,136971363,0.012112036336108911,-0.03346726216206605,-0.023631254470560553,-0.0183877151661573\n20120530 00:00,1325900,1326200,1314900,1317300,137463079,-0.014734480179506404,-0.033603672906049764,-0.023756584769280054,-0.01850713852050715\n20120531 00:00,1317100,1324500,1303400,1314900,177358856,-0.0018219084491004622,-0.033358560038141964,-0.023559195903735432,-0.018335191144030382\n20120601 00:00,1294100,1298500,1281600,1281600,204865682,-0.02532511978097196,-0.033660524024455026,-0.023800730128238645,-0.018544510486119534\n20120604 00:00,1284400,1287400,1271400,1281000,165707651,-0.000468164794007464,-0.033592738790008334,-0.023741959157037827,-0.01849054498529984\n20120605 00:00,1278800,1292600,1277900,1290300,142793334,0.007259953161592447,-0.033504601047387825,-0.02365916651277895,-0.01841060179319921\n20120606 00:00,1299800,1320300,1299300,1320200,158440296,0.02317290552584672,-0.03357512786096466,-0.023680293045047082,-0.01840539321829632\n20120607 00:00,1334900,1335300,1317800,1320500,161308954,0.0002272382972277054,-0.03355599364720674,-0.023662440063652763,-0.018388223257134125\n20120608 00:00,1317200,1331200,1312900,1331200,122247149,0.008102991291177641,-0.03355629764588754,-0.02366228902311328,-0.01838782963687008\n20120611 00:00,1341900,1342500,1312800,1314500,147440040,-0.012545072115384581,-0.03353510885279669,-0.023645360935653878,-0.01837317291581702\n20120612 00:00,1318000,1330100,1311600,1330100,158037459,0.011867630277672125,-0.033534416138449485,-0.023632077674176473,-0.018353177680252995\n20120613 00:00,1325000,1333600,1316200,1321000,156244332,-0.006841590857830204,-0.03357737696366185,-0.023685430417780238,-0.018412070317098253\n20120614 00:00,1323800,1340000,1319800,1335700,205109009,0.011127933383800137,-0.03339656015963165,-0.02352397195174767,-0.01826093170942104\n20120615 00:00,1333500,1342600,1331100,1341000,140129470,0.003967956876544054,-0.03339225419498633,-0.02351869422945467,-0.018255135946721835\n20120618 00:00,1335900,1347300,1332900,1344300,114237240,0.002460850111856816,-0.03337406013225714,-0.023500594692116093,-0.018237086800519223\n20120619 00:00,1351300,1362500,1349300,1356900,123471677,0.009372907833072874,-0.03337616937208628,-0.023497413526844018,-0.018231085339863642\n20120620 00:00,1357600,1361000,1344600,1354400,187408947,-0.0018424349620458358,-0.033383063729081175,-0.023520087587512735,-0.018262171502171624\n20120621 00:00,1356700,1357800,1323300,1324400,183348690,-0.02215002953337275,-0.033598420547255384,-0.02369163832124269,-0.018410369374378927\n20120622 00:00,1331100,1337100,1326200,1334200,113139172,0.007399577167019,-0.033569010453189725,-0.023658538576513257,-0.018375302690533363\n20120625 00:00,1321000,1321000,1308500,1312600,127618191,-0.016189476840054007,-0.033629308912020636,-0.02370658201511655,-0.018416813023200265\n20120626 00:00,1316900,1323800,1309300,1320000,130178242,0.005637665701660799,-0.03362763070392674,-0.02370920059433081,-0.018421722203829205\n20120627 00:00,1324000,1334300,1323100,1331700,93079408,0.008863636363636296,-0.03361559864999492,-0.02370556334304404,-0.018422560190769426\n20120628 00:00,1323200,1329900,1312800,1327900,155144041,-0.0028534955320267397,-0.03364117162558868,-0.02373718672635662,-0.018457409024048733\n20120629 00:00,1352400,1362700,1348500,1362700,171534507,0.026206792680171676,-0.03376276000956894,-0.023803538191952505,-0.01849431389284573\n20120702 00:00,1365300,1366500,1355200,1364600,109683533,0.0013942907463124765,-0.03374730085632728,-0.023808516206058266,-0.018510186885241246\n20120703 00:00,1365100,1375100,1363400,1374700,71720585,0.0074014363183350085,-0.0337256548273599,-0.023782437781557832,-0.018481745567083232\n20120705 00:00,1369300,1374000,1362900,1368400,106181413,-0.004582818069396977,-0.03375721359918162,-0.023812078626979972,-0.018510363973038603\n20120706 00:00,1355600,1357600,1348500,1355900,122598176,-0.00913475591932189,-0.033826057336296705,-0.023884566169245697,-0.01858479401434706\n20120709 00:00,1354100,1355700,1347000,1353200,89161246,-0.001991297293310712,-0.03378425782159099,-0.02384822984908352,-0.018551370102980715\n20120710 00:00,1360800,1362300,1336800,1341400,136359914,-0.00872007094295002,-0.0336652159851542,-0.023753093161970322,-0.018468977162516283\n20120711 00:00,1342300,1346000,1333800,1341600,128650992,0.0001490979573579576,-0.03364307803785924,-0.023732598148895296,-0.018449357991594594\n20120712 00:00,1333900,1340900,1326000,1335100,129050301,-0.004844961240310086,-0.03368008897614645,-0.02376811392606695,-0.018484076703908052\n20120713 00:00,1338800,1358800,1338400,1357500,110927086,0.016777769455471603,-0.03365750520773991,-0.02372461888095292,-0.018429433934558752\n20120716 00:00,1354200,1358300,1349000,1353900,82751324,-0.002651933701657505,-0.03368393265743785,-0.023753489738311553,-0.018459607363500018\n20120717 00:00,1360100,1366400,1345500,1363600,120755154,0.007164487776054385,-0.033609724265736884,-0.023682455863258046,-0.018390265811524684\n20120718 00:00,1360200,1376400,1359600,1374100,101000531,0.007700205338809107,-0.0335760259952123,-0.02366926342525419,-0.0183880049569604\n20120719 00:00,1376300,1381800,1372100,1377400,115912986,0.002401571937995728,-0.0335636084167424,-0.023656553592166625,-0.018375139324017575\n20120720 00:00,1369800,1371600,1363200,1364700,124504674,-0.009220270074052572,-0.03362297545350011,-0.0237256355372631,-0.01844940025080161\n20120723 00:00,1344500,1354600,1338500,1350900,118466395,-0.01011211255220923,-0.03369919841168558,-0.023792062210662976,-0.018510604561031242\n20120724 00:00,1352000,1352500,1330300,1340300,145582265,-0.007846620771337576,-0.0337164153483475,-0.023806621052306406,-0.018523746382055995\n20120725 00:00,1342600,1345600,1332500,1339500,103594503,-0.0005968812952323876,-0.033700812272378526,-0.023792200150909982,-0.018509955693549827\n20120726 00:00,1359100,1364600,1352600,1361700,125654874,0.01657334826427781,-0.03349922166971324,-0.023606339843617503,-0.018332481148514167\n20120727 00:00,1369100,1390700,1366500,1388000,186380497,0.01931409267826978,-0.033519911583180496,-0.023594599920678156,-0.018303452999785787\n20120730 00:00,1385700,1393300,1382700,1386800,94642715,-0.0008645533141210526,-0.03346475384693249,-0.02354669182690579,-0.01825940966359151\n20120731 00:00,1385100,1388700,1377100,1377100,101993870,-0.006994519757715589,-0.03349648307796545,-0.023574194400623687,-0.018284659021934546\n20120801 00:00,1387200,1387300,1374000,1375900,120308711,-0.0008713964127514684,-0.03319458264687864,-0.023332665047906626,-0.018075313267706773\n20120802 00:00,1365400,1375600,1355900,1366400,162944408,-0.006904571553165151,-0.033253076247662085,-0.023388719400454023,-0.018130067266045425\n20120803 00:00,1386000,1396400,1385000,1393900,125877370,0.02012587822014056,-0.03235244737656063,-0.022672989523863832,-0.017512906359251967\n20120806 00:00,1397000,1401700,1395600,1396200,73331353,0.0016500466317526108,-0.03233777537382585,-0.022658762900899163,-0.017498917166594716\n20120807 00:00,1402000,1409200,1401500,1403200,91323457,0.005013608365563638,-0.030651715769745902,-0.021386000493424144,-0.01644648196531629\n20120808 00:00,1398200,1406400,1398100,1404900,77895539,0.0012115165336374911,-0.030141241102618482,-0.021076574451255718,-0.016244234201178202\n20120809 00:00,1403000,1408900,1401500,1406300,78981598,0.0009965122072745913,-0.029296175079666267,-0.02042818840434742,-0.01570069752172882\n20120810 00:00,1400700,1408900,1398100,1408400,91051646,0.0014932802389249211,-0.028799041797669966,-0.020125963049784222,-0.015502376862067176\n20120813 00:00,1406000,1408400,1400400,1407700,71864462,-0.0004970178926441138,-0.02881506272605712,-0.020146491961678777,-0.015525308963288745\n20120814 00:00,1412800,1413800,1403700,1407900,85796080,0.00014207572636215637,-0.028755271868676862,-0.02012766516009389,-0.01552831994827008\n20120815 00:00,1406400,1411900,1405500,1409500,63862368,0.001136444349740806,-0.028689054201550428,-0.020069977856283113,-0.015475180149578186\n20120816 00:00,1410900,1421600,1408000,1420100,94540455,0.0075203973040085526,-0.0286796615365563,-0.020055663924914344,-0.015458242709315138\n20120817 00:00,1422500,1423000,1418600,1422200,77899419,0.0014787691007676074,-0.027816903855296574,-0.019394775340661353,-0.01490496979370516\n20120820 00:00,1420100,1422200,1416000,1422200,65230362,0.0,-0.027631294767554975,-0.01924396378574899,-0.014772708674783603\n20120821 00:00,1425200,1430900,1414500,1417600,91504684,-0.0032344255378989883,-0.027652503753376308,-0.019263235486797432,-0.014790947616488108\n20120822 00:00,1413800,1420500,1410700,1418200,113612822,0.0004232505643340101,-0.02738999817453415,-0.019115602004744787,-0.014704552024175548\n20120823 00:00,1414500,1414800,1404400,1406800,98981571,-0.008038358482583607,-0.02743880571337797,-0.019176125692516047,-0.014771321547587044\n20120824 00:00,1403000,1418100,1402200,1415200,84633688,0.005970998009667383,-0.027263506848119973,-0.01902732862755703,-0.014636652494303452\n20120827 00:00,1419000,1420800,1413400,1415400,59637252,0.00014132278123235587,-0.027246333206449994,-0.019032312487647328,-0.014653448436593296\n20120828 00:00,1411700,1418400,1409700,1414000,67508199,-0.0009891196834816984,-0.027070112444982912,-0.01894175778364759,-0.014608561990841382\n20120829 00:00,1414800,1418900,1411200,1415100,60586630,0.0007779349363508103,-0.02707421636150179,-0.018946053672306788,-0.014612960219138237\n20120830 00:00,1409000,1409400,1401900,1404900,87670205,-0.007207971168115335,-0.02713774264645983,-0.01900355500408523,-0.014667249670670622\n20120831 00:00,1413200,1418200,1403600,1412400,130393446,0.005338458253256517,-0.027052987514000905,-0.01892694641299395,-0.014594983970637984\n20120904 00:00,1410900,1414600,1401300,1408700,101328393,-0.0026196544888134055,-0.026690619226388487,-0.018643793056250257,-0.014354059800423343\n20120905 00:00,1411000,1414700,1406300,1409400,84134821,0.0004969120465676546,-0.02663488770720239,-0.018595425013602895,-0.014309617199871887\n20120906 00:00,1417900,1437800,1417600,1437800,131300165,0.020150418617851606,-0.02652143328146218,-0.018524374146960825,-0.014261171513680183\n20120907 00:00,1440200,1443900,1438800,1443900,82439521,0.0042425928501876875,-0.02641844566196978,-0.01843454236559845,-0.014178353060944698\n20120910 00:00,1442100,1444400,1434600,1435100,72407250,-0.006094604889535282,-0.02605751579412243,-0.018155566194233915,-0.013943066101923899\n20120911 00:00,1436300,1443700,1435600,1438900,71392996,0.0026478991011078534,-0.026061242596684873,-0.018163149923345126,-0.013952705944306566\n20120912 00:00,1443800,1445500,1439000,1443900,76655733,0.0034748766418792876,-0.02606184557729757,-0.018168704315390707,-0.01396089991546543\n20120913 00:00,1443300,1470400,1441500,1467000,176699165,0.01599833783503013,-0.0260685345967401,-0.018172434415739062,-0.013963052626993495\n20120914 00:00,1468900,1481100,1467600,1472400,149771595,0.0036809815950920033,-0.026013887378089177,-0.01815006674142618,-0.013957893058324018\n20120917 00:00,1469500,1471900,1463700,1467400,93464487,-0.0033958163542515685,-0.026038095473769812,-0.018172183469789847,-0.013978894886509642\n20120918 00:00,1465300,1468100,1462500,1466200,81839586,-0.000817772931715921,-0.025949868550269286,-0.018098609844230115,-0.013913132879860908\n20120919 00:00,1467600,1471700,1464100,1467400,97491385,0.0008184422316190876,-0.025940364217496657,-0.018089585604671346,-0.013904364576217973\n20120920 00:00,1460000,1467900,1456300,1467500,126125706,6.814774430963233e-05,-0.025420528840335573,-0.017686549083501965,-0.013563593092989821\n20120921 00:00,1466400,1470000,1458100,1458900,92863680,-0.005860306643952318,-0.02489207967447594,-0.0172827027865926,-0.0132261721244529\n20120924 00:00,1451600,1459800,1450500,1455900,81529919,-0.002056343820686868,-0.024917790040946162,-0.017310898096545114,-0.013255692148580847\n20120925 00:00,1459600,1462400,1440600,1441900,116957213,-0.009616045058039702,-0.02487929031943762,-0.017322601660433097,-0.013294158898147732\n20120926 00:00,1441100,1441100,1429600,1432900,128852225,-0.006241764338719702,-0.024923193630881992,-0.01737439943937659,-0.013350165188503304\n20120927 00:00,1438800,1449700,1435100,1447200,96575805,0.009979761323190672,-0.024639007887679504,-0.017137743886161187,-0.013138847803695217\n20120928 00:00,1440100,1445500,1434600,1439300,127590894,-0.005458817025981166,-0.024689619852105143,-0.017188556347438134,-0.013189767149101701\n20121001 00:00,1445000,1456900,1440200,1442400,120196114,0.0021538247759327334,-0.02430820590508913,-0.01688781618769369,-0.012932033886836492\n20121002 00:00,1449000,1451500,1438300,1445000,102440134,0.0018025513033832485,-0.023809116587083554,-0.01649955630843349,-0.012602856771271993\n20121003 00:00,1448800,1454300,1441300,1450700,104035525,0.003944636678200775,-0.02372152403852727,-0.01645630255257205,-0.012583239861730426\n20121004 00:00,1456300,1463300,1454400,1462700,110972345,0.008271868753015887,-0.023619431332476078,-0.0163990720516664,-0.012549925236385345\n20121005 00:00,1469200,1471500,1457000,1461300,102439846,-0.0009571340671361561,-0.023574268630320274,-0.016388659159295084,-0.012558037339026273\n20121008 00:00,1455800,1458900,1453100,1456600,70711413,-0.0032163142407445333,-0.02354419262610427,-0.0163635497775034,-0.01253557564527112\n20121009 00:00,1455200,1456400,1441500,1442500,133493925,-0.009680076891390943,-0.023301205826557213,-0.01624156326265487,-0.01247809393446099\n20121010 00:00,1442000,1443200,1430900,1432800,112051156,-0.006724436741767814,-0.023356074740321434,-0.016289050451376012,-0.01252164595287608\n20121011 00:00,1442800,1444900,1433600,1433600,104250608,0.0005583472920156485,-0.02336142044275216,-0.01630179721825658,-0.012538338199828882\n20121012 00:00,1434400,1439500,1425900,1428400,106195956,-0.0036272321428570953,-0.02337518585922008,-0.016313819994922117,-0.012549431981664015\n20121015 00:00,1432300,1442300,1427700,1440100,89763067,0.008190982917950063,-0.023312545569866935,-0.016280175646456816,-0.012531245261993052\n20121016 00:00,1447600,1456400,1446600,1455800,93647156,0.010902020693007497,-0.023066123022714564,-0.016071262921810926,-0.01234232888492869\n20121017 00:00,1456300,1463200,1454200,1461600,97927398,0.003984063745019917,-0.02297084752384728,-0.01602217981952981,-0.012317870778343067\n20121018 00:00,1458500,1465200,1453300,1458600,126316151,-0.0020525451559934016,-0.022860951660174048,-0.01593292626456449,-0.012239621561767701\n20121019 00:00,1455000,1455600,1430500,1433000,161433193,-0.017551076374605734,-0.023094190537997248,-0.01612351950944634,-0.01240748057752911\n20121022 00:00,1432000,1436700,1422800,1434100,112027680,0.0007676203768318679,-0.02302315604447705,-0.01609360922376493,-0.012399493454875659\n20121023 00:00,1418800,1420600,1408300,1413500,166634827,-0.014364409734328176,-0.023164948336793476,-0.016225385486784077,-0.012525930209738498\n20121024 00:00,1419400,1421000,1408000,1410500,101447368,-0.002122391227449616,-0.0229220425936634,-0.016033780072021348,-0.012361672810203055\n20121025 00:00,1420700,1422800,1405700,1414300,114919471,0.0026940801134349712,-0.02291160450449142,-0.016035074137226275,-0.012369221243494108\n20121026 00:00,1413200,1418400,1403900,1413500,118933565,-0.0005656508520115455,-0.022533908853064027,-0.0158079504172146,-0.01222236686296252\n20121031 00:00,1418400,1420300,1406800,1411800,85205741,-0.0012026883622214823,-0.02254428933300106,-0.015818044751861077,-0.012232308654613418\n20121101 00:00,1416600,1430100,1415200,1429100,89011864,0.012253860320158738,-0.022152226129022023,-0.015497410427057105,-0.011949752800991139\n20121102 00:00,1437200,1437200,1414100,1415600,113381608,-0.009446504793226507,-0.021770945882478656,-0.015207577957096229,-0.011708670802344426\n20121105 00:00,1413700,1421700,1409300,1419000,85689537,0.002401808420457785,-0.021715976924163927,-0.015184107488704284,-0.011701992062377223\n20121106 00:00,1422700,1435200,1421300,1429300,92986054,0.007258632840028145,-0.021630964677828837,-0.015136656354474644,-0.011674564618024538\n20121107 00:00,1416500,1416800,1390700,1397800,225343099,-0.022038760232281573,-0.021917387173987776,-0.01535751750620878,-0.011860475259640848\n20121108 00:00,1397200,1404100,1379500,1379500,157175132,-0.013092001716983881,-0.02206520889695317,-0.015484945898877694,-0.011977032043389646\n20121109 00:00,1376100,1394400,1375600,1381600,176223379,0.001522290685030736,-0.02203864686672382,-0.015478940328670645,-0.01198198504595592\n20121112 00:00,1385500,1388100,1379600,1382400,86603151,0.0005790387955992848,-0.021224104728924515,-0.014859882965856126,-0.01146713989333827\n20121113 00:00,1375200,1392500,1373600,1378000,109828367,-0.00318287037037035,-0.021242227328511335,-0.01488705991842824,-0.011499143687983243\n20121114 00:00,1382100,1384300,1356200,1359800,169918714,-0.013207547169811318,-0.021296786681623058,-0.01496249659388019,-0.011585709986722923\n20121115 00:00,1359500,1364900,1351800,1357000,160925393,-0.002059126342109141,-0.021226423045065296,-0.014904489572958078,-0.011534290231873294\n20121116 00:00,1359200,1366400,1347000,1363500,213614223,0.004789977892409647,-0.021226093606017515,-0.01490480377991526,-0.011534947564134052\n20121119 00:00,1379200,1391500,1378300,1391500,125631368,0.02053538687202061,-0.02113977625221539,-0.01480082090754957,-0.011421547269189411\n20121120 00:00,1388900,1394200,1380800,1392800,99716218,0.0009342436219905714,-0.020954662666121518,-0.014651325615157659,-0.011291039957372519\n20121121 00:00,1393100,1395700,1390300,1394500,66253719,0.0012205628948880332,-0.020941603339508525,-0.014638865322082927,-0.011278899006860445\n20121123 00:00,1401400,1414000,1400400,1413300,53475754,0.013481534600215062,-0.020691559364273058,-0.01442381412165681,-0.011082502325202281\n20121126 00:00,1406900,1411700,1401900,1411700,86491321,-0.001132102172221039,-0.02067416120973504,-0.014408649936524348,-0.011068529060893622\n20121127 00:00,1409100,1413800,1402400,1403800,113949581,-0.005596089820783412,-0.020365393274080525,-0.014171188771318864,-0.01086908127115982\n20121128 00:00,1397700,1415400,1390000,1414800,153889115,0.007835874056133285,-0.020339556426195053,-0.014140221269386027,-0.010835378636539167\n20121129 00:00,1420200,1425000,1413700,1421600,132400376,0.004806333050607847,-0.020005044822311753,-0.013933130787373177,-0.010696215883102198\n20121130 00:00,1421700,1424200,1416700,1420600,115188920,-0.0007034327518289363,-0.02001833097273837,-0.013947032968333549,-0.01071044646766063\n20121203 00:00,1428100,1429200,1413400,1414700,103003304,-0.004153174714909169,-0.019307480912707467,-0.013497946564018218,-0.010400905299609627\n20121204 00:00,1414400,1418700,1408700,1412200,110768908,-0.001767159115006689,-0.019311894321444,-0.013501913456255555,-0.010404634155553477\n20121205 00:00,1414100,1421600,1403800,1415000,134509723,0.001982721994051806,-0.01930016632217034,-0.013490200081261538,-0.010392928576708826\n20121206 00:00,1413700,1420400,1411600,1419100,81136204,0.0028975265017667784,-0.019276965679154403,-0.013482996549651452,-0.010394253045995476\n20121207 00:00,1425200,1426900,1416700,1424000,89962391,0.0034528926784582747,-0.019269557589363117,-0.013474205232982964,-0.010384724336197073\n20121210 00:00,1422200,1428100,1421500,1425200,77982728,0.0008426966292134352,-0.019275472572642387,-0.013481919286202541,-0.010393397466944775\n20121211 00:00,1430700,1441100,1429900,1434200,120603702,0.006314903171484643,-0.018906293064728477,-0.013188143478828455,-0.010139819093314004\n20121212 00:00,1440100,1445500,1433100,1435400,120477188,0.0008367033886487185,-0.01882755553805437,-0.013150720725605575,-0.010124421092941928\n20121213 00:00,1434400,1438300,1422800,1426600,112947114,-0.0061306952765779466,-0.01869887588263023,-0.013050353369758632,-0.01003914691923628\n20121214 00:00,1423200,1425800,1418800,1421200,104037074,-0.003785223608579802,-0.018635993726681316,-0.012999719409993539,-0.00999504242753508\n20121217 00:00,1425000,1438500,1424300,1437900,111442822,0.011750633267661126,-0.018532300641325303,-0.012899523170122006,-0.00989671034305203\n20121218 00:00,1440000,1455000,1437900,1454100,145326291,0.011266430210723932,-0.018559592567159885,-0.012909925545966093,-0.009898108962292174\n20121219 00:00,1455500,1455800,1442400,1442700,128974934,-0.007839900969671909,-0.01859608942056515,-0.012939324775913011,-0.009923724475436612\n20121220 00:00,1443600,1451400,1439900,1451400,111467367,0.006030359742150049,-0.018478972692666372,-0.01283755389937827,-0.00983013441548016\n20121221 00:00,1422000,1431000,1419400,1427700,177975926,-0.01632906159570069,-0.01835324845190461,-0.012802037647668688,-0.009842707708939883\n20121224 00:00,1424500,1425600,1421900,1423300,38187479,-0.003081879946767563,-0.018380665878308985,-0.012827727231780765,-0.009867476186719426\n20121226 00:00,1426200,1427100,1413500,1416500,84610171,-0.004777629452680343,-0.018408804372301836,-0.012864036547081448,-0.009908141336625027\n20121227 00:00,1417500,1420700,1399200,1415900,153336787,-0.0004235792446170006,-0.018408443814156187,-0.01287410592543166,-0.009923770875527543\n20121228 00:00,1406500,1414200,1398700,1398700,118554490,-0.012147750547355063,-0.01855018625926001,-0.01298936681720051,-0.010024914549202561\n20121231 00:00,1397200,1425600,1395400,1425200,207656929,0.01894616429541718,-0.018524249894900584,-0.012934574984967907,-0.009954739973819947\n20130102 00:00,1452800,1461500,1447300,1461500,154762124,0.02547010945832162,-0.01876371596815098,-0.01308526271734062,-0.01005810030117509\n20130103 00:00,1459900,1463700,1453400,1457300,125860852,-0.0028737598357851946,-0.01874692982725551,-0.01307120346042092,-0.01004549473601265\n20130104 00:00,1459700,1466100,1456700,1464500,95968674,0.004940643656076382,-0.01867092035883711,-0.013030150254216182,-0.010023076583846213\n20130107 00:00,1458700,1461100,1454300,1459200,82356729,-0.0036189825879139326,-0.01869933162534752,-0.013055722117180982,-0.010047134771287426\n20130108 00:00,1457200,1459100,1449800,1455300,96448983,-0.0026726973684210176,-0.018724893327612575,-0.013081183460085659,-0.010072542612988443\n20130109 00:00,1458900,1463200,1456400,1459900,76541810,0.0031608603037174277,-0.018703296223985488,-0.013059697742726237,-0.010051116275236149\n20130110 00:00,1467200,1470900,1459700,1470700,104550895,0.007397766970340447,-0.01870493970394053,-0.013053806084188957,-0.0100412076622507\n20130111 00:00,1470600,1471500,1466100,1470700,78613039,0.0,-0.018701565539060314,-0.013061774549637901,-0.010055222841957269\n20130114 00:00,1468900,1470700,1464300,1469600,76595746,-0.0007479431563200967,-0.018709078571853253,-0.013069036433511446,-0.010062350839271202\n20130115 00:00,1462900,1472100,1462000,1470700,76588670,0.0007485029940119681,-0.018712904321298556,-0.013073209781446715,-0.010066709490675263\n20130116 00:00,1467800,1472800,1466100,1470500,82147565,-0.00013598966478545194,-0.01868750623692864,-0.013050922040727993,-0.010046079862647866\n20130117 00:00,1476600,1484200,1474300,1479700,105543278,0.006256375382522883,-0.01868832888370703,-0.013046934001656985,-0.010039527264751406\n20130118 00:00,1480000,1484900,1474300,1483300,143478816,0.002432925593025548,-0.018658881770282708,-0.01303668001614676,-0.01003950506471232\n20130122 00:00,1483400,1491300,1479800,1491000,85902251,0.0051911278905143465,-0.018658872062274873,-0.013036682043747519,-0.010039513348522596\n20130123 00:00,1491200,1494900,1488600,1493700,78754801,0.0018108651911468154,-0.01866158422242029,-0.013040650103532022,-0.010044150923757525\n20130124 00:00,1491200,1501400,1490100,1494200,117043379,0.0003347392381334302,-0.01864289530686881,-0.013023787188856875,-0.010028261443392842\n20130125 00:00,1498800,1502500,1494600,1502500,106824958,0.005554811939499471,-0.0186300962031805,-0.013007219973963573,-0.010009685462359209\n20130128 00:00,1503300,1503300,1495100,1500700,93917764,-0.0011980033277869673,-0.01863499304812229,-0.013021890556187098,-0.010029566387762107\n20130129 00:00,1497800,1508500,1496700,1506600,90136030,0.003931498633970909,-0.018588161213399804,-0.012978332497299672,-0.00998775356665848\n20130130 00:00,1506400,1509300,1499300,1500800,107211861,-0.003849727864064789,-0.018607334013329334,-0.012994865676233635,-0.01000287957340703\n20130131 00:00,1499300,1503800,1496000,1497000,92861090,-0.0025319829424307327,-0.01860639564591116,-0.01299405692777282,-0.01000213992433276\n20130201 00:00,1506600,1514100,1503900,1512800,107936504,0.0105544422177688,-0.018613371876628627,-0.012985215925538963,-0.009984866813740667\n20130204 00:00,1503100,1505800,1494300,1495300,121333979,-0.011567953463775815,-0.018733923854300005,-0.013095063496493817,-0.010089007905084199\n20130205 00:00,1503600,1514800,1502900,1510800,100432126,0.010365812880358538,-0.01875254272571591,-0.01309802079730305,-0.010083616080555139\n20130206 00:00,1505300,1512600,1504100,1511800,112965414,0.0006619009796133835,-0.01870100035656703,-0.013077367460382247,-0.010079429572417198\n20130207 00:00,1512100,1513500,1498700,1509600,134829859,-0.0014552189443047814,-0.0187046995708959,-0.013080724437656933,-0.01008260410438467\n20130208 00:00,1512400,1518900,1512200,1518000,81972911,0.00556438791732905,-0.0187046138027579,-0.013077048322649129,-0.010077013988745843\n20130211 00:00,1517600,1519000,1514000,1517700,56652554,-0.00019762845849802257,-0.018714027653389184,-0.013087383926974425,-0.010087840976554676\n20130212 00:00,1517800,1523000,1516100,1520000,56302742,0.0015154510113988273,-0.01871278993582332,-0.013086036939790279,-0.010086435738141351\n20130213 00:00,1523200,1526100,1517200,1521500,73581411,0.0009868421052632304,-0.018652927227071216,-0.0130347472645411,-0.010039716315329995\n20130214 00:00,1517100,1524700,1515200,1523100,60435268,0.001051593821886243,-0.018653299059409142,-0.013041829888249932,-0.010050376437086877\n20130215 00:00,1524300,1525900,1515500,1521700,188245249,-0.0009191779922526067,-0.018651360074559777,-0.013040067475434992,-0.010048708154170128\n20130219 00:00,1523800,1532800,1523600,1532000,74071874,0.006768745482026661,-0.018611336219201108,-0.012998310609967924,-0.010006027427426886\n20130220 00:00,1531000,1531900,1512600,1512600,139347892,-0.012663185378590125,-0.018739537764414078,-0.013116637430668938,-0.010119090069029777\n20130221 00:00,1509000,1509600,1499400,1504000,145971241,-0.005685574507470537,-0.018791021730091364,-0.01316281047582523,-0.010162431882108197\n20130222 00:00,1511400,1518900,1507700,1518900,89396944,0.009906914893617058,-0.01880338034814167,-0.013160458155382242,-0.010152237214788959\n20130225 00:00,1526000,1528600,1490000,1490100,179800584,-0.018961090262690106,-0.019067704138157636,-0.013365643019849875,-0.010325895336877092\n20130226 00:00,1497000,1501900,1487300,1500200,171479227,0.006778068586000829,-0.019071953695669167,-0.013365810677827387,-0.010323886949317171\n20130227 00:00,1498900,1523300,1497700,1519100,119804636,0.012598320223970116,-0.019111054004954196,-0.013381534405704394,-0.010327148708145356\n20130228 00:00,1518700,1528700,1515300,1515300,102964805,-0.002501481140148809,-0.019131562737853436,-0.013400895732924746,-0.010345898357644013\n20130301 00:00,1510900,1523400,1504200,1521100,143240616,0.0038276248927604506,-0.019130898768996877,-0.013399366872913916,-0.010343908427359171\n20130304 00:00,1517600,1529200,1515200,1529200,82972461,0.005325093682203574,-0.019086441070159034,-0.013355911529887157,-0.010300987436506311\n20130305 00:00,1536500,1547000,1536400,1542900,104395367,0.00895893277530746,-0.019096117387957277,-0.013359982602895473,-0.010302070374258065\n20130306 00:00,1548300,1549200,1541600,1545000,83236231,0.0013610733035194222,-0.019070382600798602,-0.01333640745489788,-0.010279646521905985\n20130307 00:00,1546900,1549800,1545200,1548200,63019696,0.002071197411003256,-0.01903502888334898,-0.01330417739126438,-0.010249081666563482\n20130308 00:00,1554700,1556400,1546600,1554400,97289907,0.00400465056194288,-0.018827700036600583,-0.013135247695071739,-0.01010062241544468\n20130311 00:00,1553500,1560400,1551400,1560300,63325768,0.0037956767884714804,-0.018821349254203472,-0.013135149670524086,-0.010103857712969646\n20130312 00:00,1559300,1561000,1552200,1556400,92466418,-0.0024995193232070223,-0.018827943094704834,-0.01315411190576516,-0.010129413493679991\n20130313 00:00,1557500,1561200,1552400,1558400,75940737,0.0012850167052171901,-0.01883234692330863,-0.013160398064592295,-0.010136703115784048\n20130314 00:00,1563100,1568000,1562200,1567300,104114468,0.00571098562628336,-0.01882473014836819,-0.01314845816490786,-0.010122458574295338\n20130315 00:00,1558700,1560400,1553100,1558800,105586093,-0.005423339501052782,-0.018765950963743463,-0.013134157444208257,-0.01013186915813165\n20130318 00:00,1542900,1556400,1542000,1549700,110246166,-0.005837823967154265,-0.018805725690128432,-0.013167821716666219,-0.01016227597021149\n20130319 00:00,1552900,1555100,1535900,1546100,149589016,-0.002323030263921999,-0.018826012928954337,-0.013191596503073489,-0.010187909955329496\n20130320 00:00,1555100,1559500,1552600,1556300,95297590,0.006597244680162984,-0.018801112751145384,-0.013162604103003482,-0.010156736006714474\n20130321 00:00,1547900,1553100,1541000,1543400,115911436,-0.008288890316776931,-0.01888508819827024,-0.01323667034283844,-0.010225519684809985\n20130322 00:00,1548500,1556000,1547300,1556000,91810945,0.008163794220552134,-0.018865087089402363,-0.013209159950515801,-0.010194006121264029\n20130325 00:00,1559900,1562700,1543500,1550700,131779376,-0.003406169665809755,-0.018877042071843233,-0.013219502584029545,-0.010203489217530852\n20130326 00:00,1556000,1562200,1554200,1561500,75820229,0.006964596633778353,-0.018812455711816337,-0.013157446327360543,-0.010142781749599868\n20130327 00:00,1552700,1562500,1550000,1561600,89094609,6.404098623113974e-05,-0.018821240052407272,-0.013168010280882674,-0.010154294408190559\n20130328 00:00,1561300,1568500,1558500,1565500,83562253,0.0024974385245901676,-0.01876928591018839,-0.013144350681147417,-0.01014571852435572\n20130401 00:00,1566000,1569100,1556800,1560500,82034908,-0.003193867773874204,-0.018767690729127793,-0.013142995276682225,-0.010144490943906301\n20130402 00:00,1565900,1572100,1563700,1568200,89338807,0.004934315924383315,-0.018723258019207666,-0.013100077005603221,-0.010102380014569656\n20130403 00:00,1569200,1570300,1548200,1551500,138206759,-0.01064915189389104,-0.018826567675023238,-0.013183763595816909,-0.010175605621121731\n20130404 00:00,1554300,1561700,1550900,1558500,108461458,0.004511762810183617,-0.018826626691446028,-0.013182705686172408,-0.010173952282323692\n20130405 00:00,1539800,1553500,1537700,1551800,132353586,-0.0042990054539621125,-0.018857381190345867,-0.013218287543993117,-0.01021210758732256\n20130408 00:00,1552500,1562200,1547600,1562100,75492357,0.0066374532800619335,-0.01882825617573238,-0.013185633376807507,-0.010177572041959583\n20130409 00:00,1564800,1573200,1559800,1567500,91965576,0.003456884962550477,-0.01871773556244804,-0.013091785021022949,-0.010092611604956215\n20130410 00:00,1571700,1588700,1571300,1587300,114994657,0.012631578947368327,-0.018747677088020633,-0.013097772510916875,-0.010085829287066375\n20130411 00:00,1586900,1597100,1585400,1592200,94630689,0.0030870030870031595,-0.01861889604318582,-0.012990238147509093,-0.00998962145090877\n20130412 00:00,1587100,1590400,1579200,1587800,100708097,-0.0027634719256375284,-0.018386840477917697,-0.012809275441515248,-0.009835896159136387\n20130415 00:00,1580200,1581300,1551200,1551700,186156530,-0.022735860939664954,-0.018784709732007507,-0.013126091783417872,-0.010109503493470125\n20130416 00:00,1563200,1574900,1559100,1574200,126446312,0.014500225559064273,-0.018787651198170552,-0.013127873670216993,-0.010110667212801103\n20130417 00:00,1563100,1563200,1542800,1550400,198134784,-0.015118790496760237,-0.018841969286444802,-0.013169454611350261,-0.010145458027924466\n20130418 00:00,1553300,1554100,1535500,1541400,148855136,-0.005804953560371473,-0.01887926680837317,-0.013200878691984629,-0.010173750998738351\n20130419 00:00,1544400,1555500,1541200,1554800,123372939,0.008693395614376431,-0.018814645771769625,-0.013163419779340383,-0.010150772113869468\n20130422 00:00,1557800,1565400,1547500,1562000,90989989,0.004630820684332404,-0.018782237226646837,-0.013130943040520628,-0.010118259021242196\n20130423 00:00,1569600,1579300,1561800,1577900,120401270,0.010179257362356031,-0.018745323371504533,-0.013085963860450647,-0.010068980246297193\n20130424 00:00,1578200,1582900,1575400,1579000,81172344,0.0006971290956334641,-0.01874789516263048,-0.013088659671379127,-0.010071742171723496\n20130425 00:00,1582500,1592700,1581000,1586100,113027663,0.004496516782773963,-0.018659886647921516,-0.013011430621303175,-0.010000259614356414\n20130426 00:00,1583400,1586000,1577300,1582600,83462024,-0.002206670449530268,-0.018682467727612964,-0.013034381005711743,-0.010023406873743151\n20130429 00:00,1586500,1596500,1584200,1593000,79783650,0.006571464678377437,-0.018630551310076224,-0.013006373697962974,-0.010008145423952055\n20130430 00:00,1592900,1597200,1586100,1596800,101793690,0.002385436283741438,-0.018628423695953463,-0.013009860692998384,-0.010014625546354088\n20130501 00:00,1593200,1594100,1581000,1583200,111301363,-0.008517034068136309,-0.018714377026328874,-0.013082608603952557,-0.010080333697078489\n20130502 00:00,1586700,1598900,1585300,1597200,82810536,0.008842849924204144,-0.018684624266148912,-0.013045911019346015,-0.0100399338522679\n20130503 00:00,1611300,1618800,1610400,1613200,115367824,0.010017530678687603,-0.018699657673314538,-0.013052962838516905,-0.010042730716412868\n20130506 00:00,1614600,1620100,1614200,1617800,58439339,0.0028514753285395766,-0.018669918863982057,-0.013024821591889694,-0.010015441124552415\n20130507 00:00,1620900,1626500,1616700,1626300,80144043,0.005254048708122072,-0.01859638975707989,-0.012958189303123663,-0.009952485504014633\n20130508 00:00,1624200,1633900,1623300,1633400,83868841,0.004365738178687906,-0.01835623065961199,-0.012764191414192187,-0.009783095984544734\n20130509 00:00,1632900,1637000,1624700,1629300,94159930,-0.002510101628504957,-0.018376110577120543,-0.012782353829759606,-0.009800342806182563\n20130510 00:00,1630300,1634900,1625100,1634100,91107266,0.0029460504511140684,-0.01833507371477199,-0.012744826357021097,-0.009764686176059462\n20130513 00:00,1632300,1638100,1628200,1635400,71774035,0.0007955449482894839,-0.01828718626636526,-0.012703570097048573,-0.009726964978103991\n20130514 00:00,1637200,1653500,1636700,1652800,91589504,0.010639598874893075,-0.018305564223242025,-0.012705994391969108,-0.009720884434868602\n20130515 00:00,1650100,1664500,1649100,1661500,104178214,0.005263794772507158,-0.018276707292782073,-0.012676137085848404,-0.009690493832184819\n20130516 00:00,1657900,1663600,1651100,1653400,99638286,-0.00487511284983444,-0.018199310393688047,-0.012614817686088573,-0.00963774528782887\n20130517 00:00,1659700,1670400,1657400,1669700,106565142,0.009858473448651317,-0.018157074685977524,-0.012566734301295108,-0.009586544528020505\n20130520 00:00,1668100,1675800,1666100,1669700,78535046,0.0,-0.0181323516246102,-0.012545156517206944,-0.009566643479611467\n20130521 00:00,1670900,1678000,1665000,1671100,82655513,0.0008384739773612537,-0.017921956852169695,-0.01237783710085558,-0.009422287376200537\n20130522 00:00,1673400,1690700,1651700,1659200,207803061,-0.007121057985757906,-0.01790062609742995,-0.01236099572618324,-0.009407839273430193\n20130523 00:00,1642000,1659100,1639400,1654500,184821919,-0.0028326904532304242,-0.017832066417923727,-0.01233624232579279,-0.009406438838341056\n20130524 00:00,1644800,1653300,1639800,1653300,116703919,-0.0007252946509519465,-0.017841807909155957,-0.012345558195170777,-0.009415527810283465\n20130528 00:00,1670900,1677800,1658100,1663000,127445547,0.005867053771245301,-0.017834530703919858,-0.012334207997785089,-0.009402006315854023\n20130529 00:00,1654100,1658000,1643400,1652200,146895581,-0.006494287432351142,-0.017899056523604844,-0.012389665810974799,-0.009452630008335225\n20130530 00:00,1653800,1665900,1652300,1658900,96487592,0.004055199128434772,-0.017865762474826605,-0.012357639279865924,-0.009421279186205722\n20130531 00:00,1653600,1663100,1632400,1632400,137865958,-0.015974440894568676,-0.01806757463570857,-0.012532981461652186,-0.009582510320082283\n20130603 00:00,1638800,1644600,1626600,1643800,146747874,0.006983582455280635,-0.01786344486990457,-0.012363403788238568,-0.009431352239269716\n20130604 00:00,1644300,1651000,1627300,1635600,140302603,-0.004988441416230671,-0.017891678551394882,-0.012387047570368256,-0.009452549163034146\n20130605 00:00,1631000,1634200,1611300,1611800,183592216,-0.014551235020787479,-0.017589267526473863,-0.01216070216914748,-0.009266754064344206\n20130606 00:00,1611900,1627400,1602500,1626400,168748465,0.009058195805931257,-0.017588387361897113,-0.012149005603185636,-0.009249291314827636\n20130607 00:00,1638300,1649500,1631400,1648100,146431212,0.013342351205115621,-0.0176298884678459,-0.012171278436585995,-0.009261313627282332\n20130610 00:00,1653000,1654000,1643800,1648000,83501459,-6.067592985858905e-05,-0.017434937824161185,-0.012060446466758648,-0.00919532501122608\n20130611 00:00,1632700,1645400,1627400,1631200,136509220,-0.010194174757281571,-0.017548097320722163,-0.01215257107046281,-0.009276235991383172\n20130612 00:00,1642300,1643800,1616000,1617500,152312512,-0.008398724865129936,-0.017632602223008702,-0.012231503583211692,-0.009352197883888903\n20130613 00:00,1616500,1645000,1613000,1642200,134784614,0.015270479134466663,-0.017538575626686224,-0.012132686565766446,-0.009250827110668986\n20130614 00:00,1640300,1646600,1629100,1631700,113390558,-0.006393861892583175,-0.017571351784708814,-0.012177089773207686,-0.009301428655132025\n20130617 00:00,1643000,1652200,1635500,1645000,117546027,0.00815100815100811,-0.017508038100779156,-0.012114894921266535,-0.00923983024838396\n20130618 00:00,1645600,1659900,1645200,1656900,89587973,0.0072340425531916,-0.017485660222878698,-0.012103599138537825,-0.009234442289584505\n20130619 00:00,1656100,1658900,1633800,1635400,169087146,-0.012976039592009214,-0.01765911555574435,-0.012245938555016727,-0.009360193926175094\n20130620 00:00,1618700,1621000,1589800,1592700,271644171,-0.02610982022746733,-0.0181874525939215,-0.012652714332181281,-0.009702165844903991\n20130621 00:00,1596200,1597600,1574800,1590500,232959955,-0.0013813021912475465,-0.01818944623371351,-0.012666625540621689,-0.00972243026509257\n20130624 00:00,1574100,1584300,1557300,1569900,201603786,-0.012951901917635955,-0.018335388670925372,-0.01278272930612252,-0.009822627145115555\n20130625 00:00,1585200,1591700,1574300,1586500,140715013,0.010573921905853823,-0.017963059062065048,-0.012481431086775175,-0.009559195496681872\n20130626 00:00,1599300,1605000,1592600,1601700,120215759,0.009580838323353325,-0.017973838979409466,-0.012486517389460215,-0.00956124655445994\n20130627 00:00,1611500,1618200,1609500,1611300,119294686,0.005993631766248342,-0.01773455724413132,-0.012291544766042606,-0.009389894954619258\n20130628 00:00,1606500,1614000,1598600,1600100,130109066,-0.006950909203748523,-0.017806080956634752,-0.012356749912102411,-0.009451731696288407\n20130701 00:00,1612800,1624800,1610800,1614000,114653012,0.00868695706518352,-0.01780514780150262,-0.012356295507873441,-0.009451532512394398\n20130702 00:00,1610900,1623000,1605000,1611600,119553837,-0.0014869888475836923,-0.01779502308942463,-0.012347548247254113,-0.009443519566050733\n20130703 00:00,1605100,1617600,1602200,1613400,59696858,0.0011169024571853203,-0.017515108698506438,-0.01217880024729612,-0.009334033957767348\n20130705 00:00,1625300,1630800,1613000,1630500,97439875,0.010598735589438357,-0.017535988345382045,-0.012182863265522221,-0.00932913209348656\n20130708 00:00,1639200,1643900,1635800,1639400,90672202,0.005458448328733434,-0.01753063453201117,-0.012181336522738596,-0.009329645547871782\n20130709 00:00,1650000,1653300,1642700,1650800,106757402,0.006953763572038474,-0.01749074995586832,-0.012139724880745672,-0.009287113213464803\n20130710 00:00,1650300,1657500,1646300,1652100,105437138,0.0007874969711654245,-0.017393087410484013,-0.012059137724458723,-0.009215628883922012\n20130711 00:00,1671100,1676000,1665300,1675100,113993351,0.013921675443375081,-0.017426142399100116,-0.012064010810526368,-0.009205478302021874\n20130712 00:00,1674300,1678500,1671300,1675100,81255611,0.0,-0.017337477206338638,-0.011991182785936524,-0.009141093013182442\n20130715 00:00,1679600,1683900,1676800,1682200,61816116,0.004238552922213534,-0.017327398995216174,-0.01197930302011614,-0.009128252845218848\n20130716 00:00,1682500,1683500,1670700,1675000,76492853,-0.004280109380573105,-0.01732149303425829,-0.011974470555385851,-0.009123992657355258\n20130717 00:00,1681600,1684700,1677300,1679700,79399399,0.002805970149253767,-0.017229641817236706,-0.011925768776281855,-0.009098293683940325\n20130718 00:00,1682900,1692700,1682000,1688800,84464524,0.005417634101327673,-0.017202339379703065,-0.011897083734247438,-0.009068871580562559\n20130719 00:00,1684800,1692300,1683100,1692300,89925668,0.0020724774988156724,-0.017199973971871754,-0.011901330643745229,-0.009076643491961097\n20130722 00:00,1693900,1697400,1690100,1695000,66244175,0.0015954617975535434,-0.017196725102164,-0.01190613018421314,-0.009085733610112324\n20130723 00:00,1697900,1698300,1690500,1691400,68810946,-0.002123893805309751,-0.017218548209113248,-0.011926821081462901,-0.009105820930560773\n20130724 00:00,1698000,1698500,1681800,1685500,101293288,-0.003488234598557405,-0.017146398398749735,-0.011869143867975421,-0.00905585900491531\n20130725 00:00,1681700,1690800,1679400,1689300,88599506,0.0022545238801543466,-0.017025818981983673,-0.011769511688717739,-0.008967393720462796\n20130726 00:00,1682400,1691600,1675200,1691100,87678043,0.0010655301012254537,-0.016944071660437026,-0.011701351682961441,-0.008906477062477521\n20130729 00:00,1687000,1690600,1681100,1685300,69807907,-0.003429720300396233,-0.01696541304440344,-0.011719734324486654,-0.008923282409355492\n20130730 00:00,1691500,1692800,1681900,1686000,76066677,0.0004153563163828977,-0.0168813431711881,-0.011679075789868732,-0.00890576629870994\n20130731 00:00,1689400,1698500,1684900,1686600,119215193,0.000355871886120962,-0.016748294449037335,-0.011607041784300982,-0.008866259012781333\n20130801 00:00,1700000,1708100,1699000,1706500,93280387,0.011798885331435915,-0.016770085152374364,-0.011607727943611717,-0.008855694417764277\n20130802 00:00,1703000,1709600,1700500,1709500,69378174,0.0017579841781423244,-0.016697962988221546,-0.011546559031142357,-0.00880036464323732\n20130805 00:00,1706100,1709600,1703500,1708000,45392458,-0.0008774495466510324,-0.016698000080668903,-0.011546592294178025,-0.00880039586482779\n20130806 00:00,1703400,1705200,1693500,1697300,71528242,-0.006264637002341922,-0.016689596259339582,-0.011539906424789961,-0.008794625829262714\n20130807 00:00,1692300,1694300,1685500,1691800,73391843,-0.003240440699935232,-0.016563147900419076,-0.011477663576281619,-0.008766610700777016\n20130808 00:00,1700000,1701800,1689300,1698100,84008835,0.0037238444260550008,-0.016559776109939604,-0.011472868781436971,-0.008761057307570803\n20130809 00:00,1695600,1701000,1687300,1693000,82562992,-0.003003356692774295,-0.016589437681611034,-0.011503160708907521,-0.008791685275385373\n20130812 00:00,1684700,1693100,1683800,1691000,59076849,-0.0011813349084465186,-0.016601171225284962,-0.011514238609771051,-0.008802413655492738\n20130813 00:00,1694000,1699000,1684100,1696900,74561074,0.003489059727971533,-0.016595842309227754,-0.011507573231540783,-0.008795035814223293\n20130814 00:00,1695600,1697900,1687000,1687400,70350361,-0.005598444221816212,-0.016648721105949192,-0.011553205414004857,-0.008836804853441235\n20130815 00:00,1674300,1674300,1660900,1662700,126229462,-0.014637904468412954,-0.016849455687293943,-0.011711574162425912,-0.008972588533095918\n20130816 00:00,1660400,1666300,1655000,1658700,106209007,-0.002405725626992261,-0.01686525303610564,-0.011725705519864477,-0.008985831756698098\n20130819 00:00,1656400,1662100,1647600,1647600,83024441,-0.006691987701211821,-0.0169293956337143,-0.01178015822888606,-0.009035118821969163\n20130820 00:00,1650300,1662000,1648600,1655900,77447684,0.005037630492838119,-0.01692207544130559,-0.011777868634149322,-0.009035511020236756\n20130821 00:00,1651500,1660300,1641900,1645600,132890097,-0.006220182378162908,-0.016980903127743623,-0.011828412894740245,-0.009081639417159545\n20130822 00:00,1649500,1662900,1648900,1660600,82535506,0.009115216334467657,-0.016988612285067463,-0.011823267392039148,-0.009069641142764939\n20130823 00:00,1665500,1668300,1657700,1666700,70964457,0.0036733710706973177,-0.01695749991238649,-0.011793239060484632,-0.009040190709523685\n20130826 00:00,1667700,1673000,1658900,1659700,71204095,-0.004199916001680015,-0.016990261017051186,-0.011821777288686178,-0.009066477737908531\n20130827 00:00,1643300,1649800,1632100,1632900,132014807,-0.016147496535518502,-0.017148144012807745,-0.011942835839729738,-0.009167905313736182\n20130828 00:00,1633100,1644900,1630600,1639100,83019406,0.0037969257149856883,-0.017145509410727143,-0.011943500358046725,-0.00917032858092947\n20130829 00:00,1635300,1650400,1634000,1642200,88993054,0.0018912818009884091,-0.017139416664456283,-0.011937158157862535,-0.009163853397787131\n20130830 00:00,1644600,1645300,1631700,1636500,105523797,-0.0034709535988308726,-0.017157833357705626,-0.011953064847234404,-0.009178422013379624\n20130903 00:00,1652300,1655800,1637000,1643800,113549991,0.004460739382829315,-0.01715216825573262,-0.011944778112732281,-0.009168737696276992\n20130904 00:00,1644600,1660300,1641350,1657600,83234247,0.00839518189560784,-0.01708909409719999,-0.011882042858849211,-0.009106183111208564\n20130905 00:00,1658500,1664000,1657300,1658600,55584480,0.0006032818532819562,-0.01709469975721626,-0.011891510930265503,-0.009117710219850219\n20130906 00:00,1664800,1669800,1644800,1660400,131889423,0.0010852526226938775,-0.017073513640961734,-0.01187222430615471,-0.009099436207972609\n20130909 00:00,1664500,1677300,1664400,1676700,71813338,0.009816911587569255,-0.017086900146985034,-0.011870854938493524,-0.00909020053865102\n20130910 00:00,1686400,1689000,1682600,1688400,91018703,0.006977992485238893,-0.016932656844754305,-0.011777109325891624,-0.009028706020532129\n20130911 00:00,1686600,1694000,1683500,1693700,77547138,0.003139066571902438,-0.01693294338867933,-0.011778594759601545,-0.009030830577950155\n20130912 00:00,1693500,1695600,1687200,1690400,74584175,-0.0019483970006494156,-0.01689263616060145,-0.011745275471315443,-0.009001236534509746\n20130913 00:00,1691300,1694600,1687400,1693300,61972527,0.0017155702792237548,-0.016894613762724185,-0.011747757560220942,-0.009003987563452399\n20130916 00:00,1711600,1712400,1700400,1703800,94743068,0.0062009094667216935,-0.01689770029452911,-0.011746770935333214,-0.00900082955380362\n20130917 00:00,1704700,1711100,1704600,1710700,68422451,0.00404977109989435,-0.016807401287412125,-0.011696814676937681,-0.008972379865472209\n20130918 00:00,1709700,1735200,1705800,1731400,162552414,0.012100309814695676,-0.0168491232993772,-0.011716527058818444,-0.008980358994996718\n20130919 00:00,1735300,1736000,1725900,1728100,122855888,-0.001905972045743276,-0.016837113323498264,-0.011706303436823032,-0.008971087671646612\n20130920 00:00,1723000,1723300,1705800,1706200,110504216,-0.012672877726983445,-0.01699181274291567,-0.011829465653915936,-0.009077437522876661\n20130923 00:00,1705000,1706400,1694000,1699400,88854203,-0.003985464775524528,-0.01702382769679546,-0.011857686421078338,-0.009103635623139558\n20130924 00:00,1699200,1705200,1692100,1695700,86708329,-0.0021772390255384577,-0.017037298383482502,-0.011869821150574215,-0.009115058158800236\n20130925 00:00,1696100,1699300,1689000,1691100,98740960,-0.0027127439995282554,-0.01700596469486169,-0.01184400754862381,-0.009092187294627982\n20130926 00:00,1693200,1701700,1690500,1696900,67188223,0.003429720300396122,-0.016984603528278366,-0.011822526587896084,-0.009070642472085149\n20130927 00:00,1688500,1691400,1684700,1689500,80759674,-0.00436089339383583,-0.016914583099500495,-0.011766909332043132,-0.00902270349442276\n20130930 00:00,1674600,1685400,1671500,1681000,121886292,-0.005031074282332071,-0.016900422815912718,-0.011755489838687887,-0.009012745106198802\n20131001 00:00,1681500,1695000,1680000,1694000,107332142,0.007733491969066142,-0.016886712355965266,-0.01174840705505283,-0.009009195512281656\n20131002 00:00,1683400,1692100,1678300,1691100,87176914,-0.00171192443919721,-0.016852275224994565,-0.011719702440212509,-0.008983546880578551\n20131003 00:00,1687700,1689400,1668400,1676200,153254596,-0.008810833185500577,-0.016949340633902663,-0.011801079167997842,-0.009056560030509779\n20131004 00:00,1677400,1690600,1675300,1688900,84960871,0.007576661496241588,-0.016955118903617106,-0.011798452405971565,-0.009049452577163457\n20131007 00:00,1674300,1684500,1672500,1674200,81489219,-0.008703890105986156,-0.01705176312928818,-0.011881488805068082,-0.009125234694265788\n20131008 00:00,1674500,1676200,1653700,1654800,153859703,-0.01158762393979218,-0.01718425133928566,-0.011998251470245332,-0.009233614129688221\n20131009 00:00,1658200,1662000,1645300,1655700,143898404,0.0005438723712836158,-0.01717696350504603,-0.011991353681702953,-0.009226924273063767\n20131010 00:00,1673200,1692400,1672300,1692400,157839488,0.022165851301564343,-0.017349285858017854,-0.01208368853282556,-0.009276618082926352\n20131011 00:00,1689000,1703200,1687700,1703000,88751455,0.006263294729378366,-0.017240724246627516,-0.011988395693691756,-0.009188398777184392\n20131014 00:00,1692400,1710700,1690800,1710400,94276399,0.0043452730475630474,-0.01717148374228281,-0.011926570555589787,-0.00913052674338753\n20131015 00:00,1705200,1711500,1694700,1697200,135988023,-0.007717492984097296,-0.017247085817155235,-0.011989645839046843,-0.009186924040693632\n20131016 00:00,1707200,1721600,1706400,1720500,130275941,0.013728493990101454,-0.01726799344447319,-0.011984252906638904,-0.009167510377215134\n20131017 00:00,1713800,1733200,1713400,1732700,109465354,0.007090961929671513,-0.0172633163348709,-0.011982224694301984,-0.009166894282208734\n20131018 00:00,1738500,1745100,1735100,1743600,123495408,0.006290760085415847,-0.01723831671274806,-0.011969909127678277,-0.009161340538637116\n20131021 00:00,1744700,1747500,1740100,1744500,84701818,0.0005161734342740143,-0.017245794497359912,-0.011979227692485038,-0.009171640416554388\n20131022 00:00,1749400,1759300,1746600,1753500,112475864,0.005159071367153878,-0.017224153695434907,-0.0119555430873543,-0.009146866267497309\n20131023 00:00,1748000,1748900,1739700,1746200,93453544,-0.004163102366695148,-0.016983149583743046,-0.011769576854268379,-0.0089902405238409\n20131024 00:00,1748900,1753700,1745100,1752400,62520580,0.0035505669453670397,-0.016976622388841203,-0.011761726643903165,-0.008981685018827686\n20131025 00:00,1755100,1759600,1751700,1759300,75063201,0.003937457201552252,-0.016768822365472533,-0.011593525173048357,-0.008834593389792462\n20131028 00:00,1759000,1764700,1757000,1762400,68672145,0.0017620644574547484,-0.016748261198476645,-0.011574471699476986,-0.008816343662006818\n20131029 00:00,1766400,1772200,1763800,1772200,69837141,0.005560599182932391,-0.016748111386977977,-0.011571033492015716,-0.008811152422825859\n20131030 00:00,1773700,1775100,1756600,1763300,119958891,-0.005022006545536639,-0.016785951485541496,-0.011602968928319128,-0.008839940105527286\n20131031 00:00,1761800,1768900,1755300,1757300,113070805,-0.0034027108262916217,-0.01680327253822524,-0.011617773339308173,-0.008853402904141154\n20131101 00:00,1760500,1766000,1752200,1761400,111765973,0.0023331246799067618,-0.016764947303774903,-0.011602208024787963,-0.008849970818717719\n20131104 00:00,1767100,1769000,1761500,1768600,71643685,0.004087657545134515,-0.01665211346530835,-0.011506695157620163,-0.00876369169725692\n20131105 00:00,1761600,1767500,1755700,1762800,74666522,-0.0032794300576727275,-0.0166839995468114,-0.011535844688873425,-0.008791382383698008\n20131106 00:00,1770600,1775000,1765400,1771800,71899592,0.005105513955071528,-0.016678546166955258,-0.011534491821015604,-0.00879221548361347\n20131107 00:00,1775200,1776400,1747600,1749700,130922217,-0.01247319110509082,-0.016426025206151555,-0.011344826038042148,-0.008636057563359844\n20131108 00:00,1748500,1773100,1748500,1773100,112039875,0.013373721209350098,-0.016293648523602787,-0.011220462591655484,-0.008515965943520014\n20131111 00:00,1771400,1775300,1769100,1772900,53145668,-0.00011279679657094643,-0.01630078061827653,-0.011227406130982357,-0.008522808964689179\n20131112 00:00,1769400,1773600,1763700,1769800,73699767,-0.0017485475774154935,-0.016314646654857382,-0.01123991594993768,-0.00853459578904671\n20131113 00:00,1761100,1784000,1760900,1783200,84500144,0.007571477003051275,-0.016287551305622268,-0.011208256317145142,-0.008500502953578817\n20131114 00:00,1785300,1794200,1782500,1793200,92770485,0.0056078959174517,-0.016098132305676062,-0.011052454198803532,-0.008362621870428895\n20131115 00:00,1795400,1801200,1793300,1801200,88157314,0.004461298237787181,-0.016072766612209945,-0.011026939393712734,-0.00833702757448273\n20131118 00:00,1803900,1805000,1790200,1795000,83432360,-0.003442149677992501,-0.016110187953318186,-0.011062968020377517,-0.008372313750231133\n20131119 00:00,1793400,1798700,1787200,1790300,85703243,-0.002618384401114171,-0.015972046900077093,-0.010992210722046373,-0.008337478482304029\n20131120 00:00,1794100,1799300,1779800,1785100,108921426,-0.0029045411383566977,-0.015997038047404426,-0.011014343339319575,-0.00835808722778272\n20131121 00:00,1789800,1800500,1788600,1799700,70890848,0.008178813511848126,-0.01600180207184989,-0.011009622906762374,-0.008348310666292501\n20131122 00:00,1799600,1808300,1797700,1808100,66142514,0.004667444574095736,-0.015946739937669773,-0.010980937242076346,-0.00833368619989357\n20131125 00:00,1811400,1811700,1803700,1807100,66442019,-0.0005530667551573165,-0.01594308086758474,-0.01097767696242166,-0.008330638513941668\n20131126 00:00,1807500,1812200,1804100,1806400,72012227,-0.0003873609650821841,-0.01589582833431676,-0.010938211804494044,-0.008295324776992566\n20131127 00:00,1808800,1812400,1806500,1811200,51121354,0.0026572187776794376,-0.01588845067535367,-0.010939015505086965,-0.008300489930091508\n20131129 00:00,1813400,1817500,1808000,1809300,41250857,-0.0010490282685512442,-0.015905084294463245,-0.010957583136441759,-0.008320088576217853\n20131202 00:00,1811300,1814300,1802500,1805400,76545928,-0.0021555297628916836,-0.015915314308816365,-0.010966504348846282,-0.008328312071146506\n20131203 00:00,1799500,1803900,1791700,1798500,92867713,-0.003821867730142925,-0.015911899514117492,-0.010963704765432661,-0.0083258404545926\n20131204 00:00,1792100,1804800,1783500,1796700,107731159,-0.001000834028356934,-0.01590654515717776,-0.010959028105134754,-0.008321525071866788\n20131205 00:00,1794200,1797400,1787800,1790100,88220890,-0.0036734012355985612,-0.015942101216231477,-0.01099074331271014,-0.008351192735731284\n20131206 00:00,1807300,1811100,1801600,1809500,99444907,0.010837383386403054,-0.015970165378604552,-0.011001356234838996,-0.00835250246626034\n20131209 00:00,1814800,1816700,1811600,1814000,60060446,0.002486874827300367,-0.01597156663487033,-0.011003469979045269,-0.008354996035151292\n20131210 00:00,1809600,1813600,1806400,1807500,62301715,-0.0035832414553472747,-0.01600234267318864,-0.011030375383137685,-0.008379838018460296\n20131211 00:00,1808100,1808500,1785000,1787200,111930458,-0.011230982019363789,-0.016147435521522847,-0.011153360676808215,-0.008491037856543662\n20131212 00:00,1786400,1788600,1777600,1781300,94786627,-0.003301253357206768,-0.016174970437534086,-0.011177639658622203,-0.008513581111884952\n20131213 00:00,1784700,1786600,1777700,1781100,83056349,-0.00011227755010390084,-0.016120500933432046,-0.011132130462039931,-0.00847284862208586\n20131216 00:00,1789200,1798100,1789000,1792200,74941906,0.006232103756105722,-0.016084500773700404,-0.011095031421137049,-0.008435163771696752\n20131217 00:00,1793700,1794100,1782500,1785400,75948317,-0.0037942193951567837,-0.016085833477479362,-0.011114044357667146,-0.00846360197488475\n20131218 00:00,1789400,1817300,1773300,1817000,207030899,0.017699115044247815,-0.016170959572904247,-0.011166755212650465,-0.008499032385133993\n20131219 00:00,1812000,1817000,1807200,1815000,112655750,-0.0011007154650523043,-0.016098263466241432,-0.011107520942341896,-0.008446974569973368\n20131220 00:00,1806700,1819900,1806600,1815800,133819141,0.00044077134986220123,-0.01610410553659349,-0.011118149408933135,-0.00846015464668873\n20131223 00:00,1824100,1826400,1820700,1825400,66321111,0.005286925872893589,-0.01583995027846101,-0.010906249130340787,-0.008276111304331406\n20131224 00:00,1825700,1830000,1825300,1829300,38250253,0.0021365180234469427,-0.01580932006191144,-0.010878525608155836,-0.008249937330156665\n20131226 00:00,1833700,1839600,1833300,1838400,53110222,0.004974580440605614,-0.015758832420471436,-0.010831491329831203,-0.00820474402693044\n20131227 00:00,1841600,1841800,1836600,1838400,53771801,0.0,-0.015756459906389436,-0.01082932143009407,-0.008202682140150826\n20131230 00:00,1839200,1840200,1835800,1838200,47180243,-0.00010879025239340923,-0.015596964765018225,-0.010702554649410778,-0.008093362727446311\n20131231 00:00,1841200,1846800,1839300,1846700,68550651,0.004624088782504643,-0.015454792162299948,-0.010618680122522834,-0.008040566689064575\n20140102 00:00,1839100,1840600,1824800,1829200,108167846,-0.009476363242540753,-0.015270237653311794,-0.010528814830583294,-0.008001179868357463\n20140103 00:00,1832400,1836000,1826300,1828800,71382847,-0.0002186748305269548,-0.015250975061597517,-0.0105121086436723,-0.007985836491387698\n20140106 00:00,1835200,1835600,1820800,1823600,89901576,-0.00284339457567806,-0.015280427540284084,-0.010541981957390473,-0.00801593415070401\n20140107 00:00,1831200,1837900,1829600,1834300,75867995,0.005867514805878438,-0.015245447126495254,-0.010506221013324,-0.007979757108834704\n20140108 00:00,1834600,1838300,1829000,1835200,86342393,0.0004906503843427057,-0.015224334770566773,-0.010487616095854094,-0.007962488897528854\n20140109 00:00,1841000,1841400,1828000,1836400,79126576,0.0006538796861377261,-0.015231048689284016,-0.010495277524033836,-0.007970655439497007\n20140110 00:00,1839600,1842100,1830100,1841400,77972574,0.002722718362012655,-0.015223799681197976,-0.010495586753036025,-0.007974993936723372\n20140113 00:00,1836900,1841800,1813400,1816600,122813410,-0.013468013468013518,-0.015413828892930945,-0.010645604022546714,-0.008103680987890572\n20140114 00:00,1822700,1837700,1819500,1837200,85261773,0.011339865683144268,-0.015436307230524507,-0.0106474455368824,-0.008094521088109414\n20140115 00:00,1841000,1849400,1840100,1846900,83647160,0.005279773568473756,-0.015430837326337557,-0.010638310489437247,-0.008083432166355356\n20140116 00:00,1843000,1845000,1838400,1843900,61950237,-0.0016243434945043544,-0.015440285985716276,-0.010646721389635124,-0.00809128984097392\n20140117 00:00,1841000,1844500,1833300,1836500,89214819,-0.00401323282173649,-0.015478075626884268,-0.010685378963036443,-0.008130410105837236\n20140121 00:00,1847200,1847700,1830500,1841800,77312943,0.0028859243125509693,-0.015477338419225477,-0.010684331113617555,-0.0081291966544455\n20140122 00:00,1845100,1845700,1839100,1843000,53915460,0.0006515365403410023,-0.015483106559321646,-0.010693686702731473,-0.008140464699356231\n20140123 00:00,1833500,1834000,1818300,1827900,115258815,-0.00819316332067277,-0.015575984781978844,-0.010770986147233041,-0.008209459154868808\n20140124 00:00,1815700,1816500,1788300,1788300,175573279,-0.021664204825209255,-0.015991046939723908,-0.011090030937461146,-0.008477317441764333\n20140127 00:00,1790500,1795100,1771300,1780100,160064102,-0.004585360398143501,-0.016034346184974235,-0.011132433631475041,-0.008519242187631573\n20140128 00:00,1782500,1793000,1781300,1791000,90568738,0.006123251502724525,-0.016021787694938464,-0.011115043258736907,-0.008499275956104104\n20140129 00:00,1776200,1785500,1768800,1772800,179260502,-0.01016192071468458,-0.016146785534786223,-0.01121980685937927,-0.008593252758698329\n20140130 00:00,1788800,1798100,1782600,1792300,96632848,0.010999548736462028,-0.016142472727246622,-0.011199495424555124,-0.008564412514868124\n20140131 00:00,1770200,1792900,1769200,1781800,159765786,-0.005858394242035381,-0.016176570484654117,-0.01122747128117074,-0.00858912480882431\n20140203 00:00,1779400,1783700,1738300,1741500,222544720,-0.022617577730384975,-0.016588823504567727,-0.011557518381464618,-0.008875348237553454\n20140204 00:00,1749400,1758400,1743400,1753600,144004983,0.0069480333046223475,-0.01644704022791266,-0.011435745406178734,-0.008764242679883856\n20140205 00:00,1747800,1755600,1737100,1751700,146216400,-0.0010834854014598605,-0.016434589517527843,-0.01144025170769229,-0.008777788701694818\n20140206 00:00,1756100,1774800,1755800,1774800,110630862,0.013187189587258175,-0.01648416519141769,-0.011460743939468413,-0.008782776658096866\n20140207 00:00,1782800,1798700,1777400,1797400,132131649,0.012733829163849464,-0.01651589903932846,-0.011466686942531817,-0.008774970657205367\n20140210 00:00,1797100,1800700,1792100,1800100,72626938,0.0015021698008235163,-0.01651767642543228,-0.01147266591421408,-0.008783189478612475\n20140211 00:00,1802300,1824400,1800700,1819800,103111329,0.010943836453530364,-0.016538164232709915,-0.011474200125780749,-0.008774619598439155\n20140212 00:00,1822600,1828300,1817100,1821600,87336980,0.0009891196834816984,-0.016539921215510133,-0.011476054259303658,-0.008776525522652847\n20140213 00:00,1808700,1832000,1808300,1830000,86663567,0.004611330698287119,-0.01653478479505966,-0.01146820912244807,-0.00876723637910469\n20140214 00:00,1829000,1843600,1826800,1840100,79238964,0.005519125683060011,-0.01653106382056188,-0.011460384758014636,-0.00875722451268023\n20140218 00:00,1842000,1844900,1836500,1842600,68488244,0.0013586218140317907,-0.016520427440044734,-0.011450216356465918,-0.008747305588987932\n20140219 00:00,1837800,1849500,1828700,1830500,107451814,-0.006566807771627103,-0.016584304262108666,-0.011510883088264957,-0.008806261033544975\n20140220 00:00,1833000,1845200,1826200,1841000,89178782,0.005736137667303964,-0.01641402259653547,-0.011369095832114224,-0.008679664041620192\n20140221 00:00,1844200,1848900,1838000,1839600,100978693,-0.0007604562737643095,-0.016369547821506365,-0.011331924392147393,-0.008646385982550705\n20140224 00:00,1843000,1861500,1842100,1849100,93723541,0.005164166123070135,-0.016348372151586344,-0.011322465419208044,-0.008643173137416745\n20140225 00:00,1850300,1855800,1842300,1848400,97120950,-0.0003785625439403084,-0.016027291898840213,-0.011073842442586959,-0.008433176866586036\n20140226 00:00,1851000,1856000,1843300,1848500,84192425,5.41008439731705e-05,-0.01603211693469634,-0.011085070508722025,-0.008447818364469832\n20140227 00:00,1845800,1858700,1843800,1858700,80283904,0.00551798755747912,-0.015985766512983966,-0.011060529030156053,-0.008434903152796108\n20140228 00:00,1857800,1871500,1850500,1863000,127758775,0.0023134448808306285,-0.015960912443169363,-0.011037358585464004,-0.008412630242427017\n20140303 00:00,1846500,1854500,1837500,1849800,141848312,-0.007085346215781052,-0.016038529469103065,-0.011104924170654387,-0.008474837441750234\n20140304 00:00,1868100,1879800,1867500,1875800,149682598,0.014055573575521674,-0.016102739365038737,-0.011140174992549802,-0.008494650288431342\n20140305 00:00,1877500,1880700,1874500,1876100,72001348,0.0001599317624481067,-0.01609572523172357,-0.011145444319512204,-0.008506467882615531\n20140306 00:00,1882200,1886100,1878900,1882100,71357422,0.0031981237673897045,-0.016091888634847652,-0.011140596096424921,-0.008501080365338264\n20140307 00:00,1889600,1889600,1874300,1882600,92692794,0.00026566069815636695,-0.016098219245626197,-0.01114717108784719,-0.008507785635177423\n20140310 00:00,1879900,1882300,1870800,1882100,66969564,-0.00026559014129390324,-0.016109305481531243,-0.011159973742180595,-0.008521503305823767\n20140311 00:00,1884800,1887000,1868000,1872300,88435777,-0.005206949683863815,-0.01616195090849473,-0.011207662312688278,-0.008566549394496598\n20140312 00:00,1863200,1873500,1859000,1872800,93180936,0.00026705122042414153,-0.016144369313748144,-0.011192015081290762,-0.00855193336504279\n20140313 00:00,1878800,1879900,1846600,1851800,136495375,-0.011213156770610855,-0.016284586402216063,-0.011305685065071243,-0.008651451185545998\n20140314 00:00,1848000,1857900,1844400,1846600,133250737,-0.0028080786262015822,-0.016310209341800403,-0.01133370514376511,-0.00868074917022908\n20140317 00:00,1856200,1867700,1855200,1863300,86212672,0.00904364778511857,-0.016273057715801613,-0.011290619295408953,-0.00863449980989247\n20140318 00:00,1867400,1879100,1865100,1876600,88937577,0.007137873665002958,-0.016219745663996844,-0.011237840753353462,-0.008582005679910186\n20140319 00:00,1877100,1879400,1854800,1866600,142453779,-0.005328786102525851,-0.01624921858369117,-0.011262173842998527,-0.00860359874517478\n20140320 00:00,1862500,1878900,1859200,1877500,100140419,0.005839494267652512,-0.016246998724775013,-0.011261485155570624,-0.008603726319601506\n20140321 00:00,1876900,1881700,1860300,1861900,137887629,-0.008308921438082595,-0.016247308401241646,-0.011261727399421287,-0.008603932615374114\n20140324 00:00,1868400,1870700,1846200,1854000,110550534,-0.0042429776035233235,-0.01627745578737662,-0.011297465904220726,-0.008642651724844902\n20140325 00:00,1864000,1869400,1852700,1863100,95520395,0.004908306364617143,-0.016244591968491023,-0.011264563963216031,-0.008609729461079577\n20140326 00:00,1870000,1873400,1849500,1849700,102575862,-0.007192313885459711,-0.016315864044658776,-0.011331414353895744,-0.008674222667587071\n20140327 00:00,1847700,1853400,1839100,1845800,127599205,-0.0021084500189220146,-0.01632921109762915,-0.011343376927512415,-0.008685447180383233\n20140328 00:00,1851400,1864200,1850000,1855000,88551960,0.0049842886553255195,-0.016328934699362047,-0.011340290575444821,-0.008680862852342206\n20140331 00:00,1866600,1873000,1864700,1870400,83948640,0.008301886792452917,-0.01630994500542146,-0.011313500204829255,-0.008649913969855857\n20140401 00:00,1876500,1883600,1874500,1882700,77846445,0.006576133447390831,-0.01631381686025818,-0.011314329228724556,-0.008649120871835602\n20140402 00:00,1885000,1891300,1881400,1888600,70718887,0.003133797206140043,-0.01617992708714982,-0.011203639467589465,-0.008550798951237028\n20140403 00:00,1891300,1892100,1880600,1886000,69874589,-0.0013766811394684275,-0.01619752218639742,-0.011222925375375026,-0.008570986222797715\n20140404 00:00,1896400,1897000,1861000,1863800,147905014,-0.01177094379639454,-0.01631049281807498,-0.011311487724155408,-0.008646536606282987\n20140407 00:00,1859000,1862600,1839600,1843400,126552113,-0.010945380405622873,-0.016443978004842198,-0.011426308726034007,-0.008751407800260087\n20140408 00:00,1841800,1854000,1835900,1851300,101526439,0.004285559292611429,-0.01644401196883381,-0.011425369419736715,-0.008749949647173148\n20140409 00:00,1856100,1871500,1850800,1871500,90817021,0.010911251552962797,-0.01642681635320309,-0.011415211043620905,-0.008743542797403012\n20140410 00:00,1870700,1871700,1829400,1831700,150960665,-0.0212663638792413,-0.01681930472802484,-0.01172103192880575,-0.00900316156455601\n20140411 00:00,1821600,1834200,1813100,1814800,147808432,-0.009226401703335663,-0.01689744815075303,-0.011783796602991019,-0.009057727884798656\n20140414 00:00,1829200,1833700,1814500,1829400,118011184,0.008044963632356072,-0.01646979819409175,-0.011445642763039134,-0.00876728409350426\n20140415 00:00,1833300,1843300,1815200,1842400,146271143,0.007106155023504979,-0.01640464664226774,-0.011408172585022976,-0.008744570753436359\n20140416 00:00,1854900,1861400,1846500,1861400,89620166,0.0103126356925749,-0.016203616108635414,-0.011236469510362052,-0.00858850203863341\n20140417 00:00,1858700,1869100,1855600,1863900,89232723,0.0013430751047598388,-0.016147984417949783,-0.011188825430402916,-0.00854511612439621\n20140421 00:00,1864500,1871000,1862100,1870400,53096311,0.003487311551048977,-0.016133330176156774,-0.01118451607934499,-0.008546321596310212\n20140422 00:00,1872400,1884000,1871300,1878900,76101182,0.0045444824636442505,-0.016133250965687764,-0.011184560440066762,-0.008546431832376541\n20140423 00:00,1878000,1879200,1873000,1874400,64174505,-0.002395018361807444,-0.016132397403290786,-0.011198574320049098,-0.008568371490877654\n20140424 00:00,1883900,1883900,1869300,1878100,80287334,0.0019739650021339816,-0.01612834944794691,-0.011194227895582373,-0.008563865953625962\n20140425 00:00,1872000,1873300,1858700,1862900,90739070,-0.008093285767530989,-0.016218362024921044,-0.011272507094793995,-0.008635890132569116\n20140428 00:00,1870800,1876900,1849700,1868800,120930399,0.003167105051264052,-0.016195697525751174,-0.011250235141243332,-0.008613827443635525\n20140429 00:00,1874800,1880400,1870800,1877000,71643542,0.004387842465753522,-0.016190976610852916,-0.011249435625313118,-0.00861511841098492\n20140430 00:00,1874600,1885000,1871800,1884300,85384290,0.0038891848694726505,-0.01618973103507816,-0.011246806852233521,-0.008611752260540322\n20140501 00:00,1882500,1888400,1877300,1882900,82539046,-0.0007429814785331335,-0.016105861106991755,-0.011178469070058457,-0.008551694607877375\n20140502 00:00,1883300,1891400,1877900,1880600,80493271,-0.0012215199957512635,-0.016105545953543125,-0.011189945908841958,-0.008569457714086208\n20140505 00:00,1871600,1885500,1866300,1884400,62112050,0.0020206317132829277,-0.016082105376930843,-0.011182668422141238,-0.008570796710809453\n20140506 00:00,1880300,1881300,1867400,1868100,70612290,-0.008649968159626376,-0.016179843500721804,-0.011265144800293931,-0.00864513710883505\n20140507 00:00,1874100,1879700,1860200,1878900,95472189,0.005781275092339833,-0.016181084479441808,-0.011265409347040825,-0.008644881123310149\n20140508 00:00,1877100,1890400,1870800,1877000,87869466,-0.0010112299749853726,-0.01619489696102628,-0.011281426157339918,-0.008662073053090382\n20140509 00:00,1877100,1880400,1868300,1880000,74953765,0.0015982951518380695,-0.016173090888369445,-0.011261232140263762,-0.008642738416879235\n20140512 00:00,1887700,1898800,1887500,1898100,71834301,0.009627659574467984,-0.016195305115931053,-0.011269171535368034,-0.008643067951621314\n20140513 00:00,1900000,1904200,1897800,1899600,60592895,0.0007902639481587315,-0.01619532490506237,-0.011269191666431286,-0.008643088264967215\n20140514 00:00,1898200,1898800,1887900,1890400,64159354,-0.004843124868393334,-0.016210874518635794,-0.011298184502372164,-0.008679247633008556\n20140515 00:00,1886800,1887200,1864800,1874000,141261751,-0.008675412611087618,-0.01630623621603828,-0.011381814480278566,-0.00875662347466219\n20140516 00:00,1875000,1881300,1867200,1881100,85281290,0.003788687299893345,-0.016260026222892555,-0.01133906998934052,-0.008715726430127742\n20140519 00:00,1877000,1888900,1875200,1887000,51306979,0.003136462707989951,-0.016235089135183164,-0.011329252351245225,-0.008713968914675595\n20140520 00:00,1886700,1886700,1870700,1875500,94515421,-0.006094329623741346,-0.016287077840312122,-0.011373095735297578,-0.00875347005820194\n20140521 00:00,1881000,1892200,1880600,1891300,77745877,0.008424420154625523,-0.016297188720618465,-0.011371426132631583,-0.008745520323654424\n20140522 00:00,1892000,1899800,1888600,1896000,57302105,0.002485063184053393,-0.016223871497971668,-0.011308419932842753,-0.008688010891997552\n20140523 00:00,1897600,1904800,1896800,1903800,50524951,0.004113924050632933,-0.01619694223712243,-0.011281304162160898,-0.008660795693614064\n20140527 00:00,1910600,1915800,1909500,1915700,56783233,0.006250656581573644,-0.016188661924596164,-0.01126734010196674,-0.008643801648569586\n20140528 00:00,1915500,1918200,1910600,1913800,60654048,-0.0009918045623009686,-0.01619966997858874,-0.011283096704117692,-0.008662089684172833\n20140529 00:00,1918500,1924000,1913400,1924000,55471647,0.005329710523565678,-0.016134674051176932,-0.011223395863271632,-0.008605211634381695\n20140530 00:00,1922100,1928000,1920400,1926300,63232048,0.0011954261954261192,-0.016138662995208792,-0.011229540702565525,-0.008612505773462368\n20140602 00:00,1929800,1929900,1919700,1929100,55322323,0.0014535638270258833,-0.01589109058776301,-0.011034233858349191,-0.008445061507606672\n20140603 00:00,1924300,1929000,1922600,1928100,52564603,-0.0005183764449743222,-0.01589587308288267,-0.011046336248181769,-0.00846106610622508\n20140604 00:00,1924800,1933000,1922700,1931900,48936106,0.0019708521342254315,-0.015848475138302603,-0.011004733273100673,-0.008422552407940901\n20140605 00:00,1934300,1946500,1927000,1944600,76105702,0.006573839225632705,-0.015634197361600845,-0.010828669747271228,-0.008266860757848231\n20140606 00:00,1948800,1954300,1947800,1954100,61256519,0.004885323459837609,-0.015616660107832261,-0.010821120858872763,-0.008264636630068871\n20140609 00:00,1953600,1960500,1951700,1955700,58266471,0.0008187912594033175,-0.015561242229592358,-0.010796495863456528,-0.008256427206543786\n20140610 00:00,1953600,1956000,1949200,1955900,50668363,0.00010226517359512854,-0.015560448061977778,-0.010795744927617942,-0.00825569931740501\n20140611 00:00,1948700,1951100,1944800,1949200,55834216,-0.0034255330027097575,-0.015465903581975417,-0.010721028434588628,-0.008191553050862015\n20140612 00:00,1946800,1948000,1931100,1935400,87647599,-0.007079827621588319,-0.015445786856880575,-0.010705271626166614,-0.008178120497885393\n20140613 00:00,1938900,1943200,1933000,1941600,64621214,0.0032034721504599073,-0.015356028074868574,-0.010655835021003498,-0.008150179495997252\n20140616 00:00,1938800,1947000,1936600,1942900,67831890,0.0006695508858673982,-0.015294126295058249,-0.010603856013911069,-0.008103490282323742\n20140617 00:00,1940000,1949700,1938100,1948300,69206159,0.0027793504555047033,-0.015280977181569844,-0.01060080334658154,-0.008105819993081877\n20140618 00:00,1948300,1963700,1944000,1962600,93135373,0.007339732074115979,-0.015281497933252276,-0.010601048683774272,-0.008105918507829258\n20140619 00:00,1964600,1966000,1958000,1964800,74988020,0.0011209619891980882,-0.015098520083035737,-0.0104552859191664,-0.0079799949676533\n20140620 00:00,1960000,1960600,1957100,1959400,77778094,-0.0027483713355048733,-0.014514291393553862,-0.010015047361743573,-0.007616517016827992\n20140623 00:00,1960000,1960500,1955200,1958800,50217325,-0.00030621618862913813,-0.014507473978262412,-0.010008977310516157,-0.007610845382617657\n20140624 00:00,1955200,1965000,1944800,1947100,88391670,-0.005973044721257925,-0.014378271216576302,-0.00990951116784293,-0.0075272317215065165\n20140625 00:00,1942800,1957800,1942500,1955800,72492534,0.004468183452313701,-0.014344942369721265,-0.009893043695978735,-0.007519752986258209\n20140626 00:00,1956000,1956300,1941300,1954500,69751995,-0.000664689641067584,-0.01433279398230958,-0.009896364392398157,-0.007531320194028119\n20140627 00:00,1950100,1958800,1948900,1957900,55840263,0.0017395753389612967,-0.014331108321240437,-0.009900117811611917,-0.007537973166814598\n20140630 00:00,1957100,1961700,1955300,1957200,59593898,-0.0003575259206292092,-0.01426295027394849,-0.009844261687199318,-0.007488675151968475\n20140701 00:00,1962100,1976300,1961300,1970600,81724640,0.0068465154302064235,-0.014251959059545884,-0.00983862978882842,-0.007485900285143138\n20140702 00:00,1970300,1974800,1969600,1972200,46267119,0.0008119354511315624,-0.0142390341637185,-0.009826818726434173,-0.0074746830032306035\n20140703 00:00,1978100,1982900,1976500,1982500,39315126,0.005222594057397778,-0.014236483551137612,-0.009820242504628863,-0.007465960744043619\n20140707 00:00,1978400,1979800,1972200,1975100,55946614,-0.0037326607818410906,-0.014239499813124742,-0.009839035184206427,-0.0074931637734615515\n20140708 00:00,1971200,1972200,1957600,1962800,90890519,-0.006227532783150247,-0.014305037541631456,-0.009898958665320196,-0.007550094320064404\n20140709 00:00,1967500,1973000,1963100,1971200,65783629,0.004279600570613384,-0.014296905309635528,-0.00989631740973964,-0.007550380283692756\n20140710 00:00,1952400,1968600,1950600,1963500,88163470,-0.00390625,-0.014330850345257388,-0.009925774789683069,-0.007577445310999577\n20140711 00:00,1962400,1967500,1957900,1966000,55246470,0.00127323656735423,-0.014255080520326924,-0.009886905038212997,-0.0075582468521508\n20140714 00:00,1976300,1978600,1974400,1976000,51736248,0.0050864699898269805,-0.014248695151164111,-0.009876477297118802,-0.007545664137537878\n20140715 00:00,1977300,1981000,1963700,1972300,100356883,-0.0018724696356274828,-0.014268363864179219,-0.009897488105941434,-0.007567390412669375\n20140716 00:00,1981300,1982600,1974200,1979600,66890342,0.003701262485423129,-0.01422564623164679,-0.009858006214611394,-0.007529633483001194\n20140717 00:00,1973200,1981000,1954300,1957100,124560916,-0.011365932511618548,-0.014382697139520045,-0.009985524301598863,-0.007641407732454026\n20140718 00:00,1963800,1979100,1962400,1977400,111817075,0.01037248990853823,-0.014414602614019046,-0.010002323255006272,-0.007650153455365795\n20140721 00:00,1970800,1975000,1964300,1973400,60883796,-0.002022858298776131,-0.014434454397353778,-0.010021120300768155,-0.0076683882244304126\n20140722 00:00,1980400,1985600,1978700,1982000,60031730,0.004357960879699974,-0.014432742122769817,-0.010016698269068178,-0.007662521631238736\n20140723 00:00,1985100,1988500,1981000,1986400,54979732,0.002219979818365303,-0.014411761086139748,-0.00999681385896552,-0.0076432218286800226\n20140724 00:00,1988200,1990600,1984500,1986500,50510204,5.034232782930026e-05,-0.014385639852364568,-0.009974231196333703,-0.007622525565231043\n20140725 00:00,1981100,1982600,1973300,1977400,69172823,-0.004580921218222955,-0.014430593706853815,-0.010013962095832007,-0.007659472126750047\n20140728 00:00,1977800,1980900,1966200,1978000,64463636,0.00030342874481648074,-0.014433574347436225,-0.010016955500407267,-0.007662472335762668\n20140729 00:00,1982100,1984500,1969300,1969300,71955637,-0.004398382204246709,-0.014443727153812563,-0.0100252601370097,-0.007669791719897366\n20140730 00:00,1976600,1979100,1961600,1969800,97604354,0.0002538973239221143,-0.014444438075949568,-0.010025950490867979,-0.007670471108882365\n20140731 00:00,1956300,1957800,1930400,1930900,156932334,-0.019748197786577326,-0.01481723281183447,-0.010312907169143744,-0.007911667836271164\n20140801 00:00,1925800,1937500,1915800,1924800,159252899,-0.0031591485835620325,-0.014796869903585913,-0.010315897968451228,-0.00792710841066162\n20140804 00:00,1929100,1943000,1920500,1938800,81387375,0.00727348295926844,-0.01480609173996527,-0.010316006625730297,-0.007922358865883597\n20140805 00:00,1931100,1936000,1913200,1920100,136260078,-0.009645141324530648,-0.014911825773950243,-0.010400958601662477,-0.007996232003567175\n20140806 00:00,1910800,1928900,1910800,1920700,86720027,0.00031248372480607856,-0.014853684085037936,-0.010352203488715595,-0.007952480839534544\n20140807 00:00,1929600,1931200,1905500,1909900,121255519,-0.005622949966158197,-0.01487964270728527,-0.010373327266020381,-0.007971027178890713\n20140808 00:00,1914300,1933700,1909500,1932400,101088602,0.011780721503743541,-0.014929139427454673,-0.01039895813029098,-0.007983935243691903\n20140811 00:00,1939900,1946600,1937100,1938000,68566260,0.002897950734837451,-0.014900788104545112,-0.010372052037688087,-0.007957799598017744\n20140812 00:00,1936300,1941500,1929400,1935400,67359712,-0.001341589267285892,-0.014901830736796975,-0.01037297552815073,-0.007958659574433412\n20140813 00:00,1943000,1950600,1939600,1948900,59607085,0.00697530226309806,-0.014910673615338398,-0.010375175219742828,-0.007957317807644446\n20140814 00:00,1951900,1957600,1949800,1957600,51962205,0.004464056647339509,-0.014854494986070584,-0.010323756397266704,-0.007908436420556378\n20140815 00:00,1964900,1966500,1943200,1957100,131789171,-0.0002554147936248974,-0.014634416625775198,-0.010151429692343646,-0.007761565946418028\n20140818 00:00,1968100,1974500,1966900,1973200,62330394,0.008226457513668128,-0.014625453947171059,-0.010132732851266967,-0.007737679859346319\n20140819 00:00,1978500,1985400,1976500,1983900,52380329,0.0054226636934928685,-0.014554035333100327,-0.01006815294398932,-0.007676745641354967\n20140820 00:00,1981500,1991600,1980800,1989200,67210020,0.0026715056202428755,-0.01455309228481072,-0.010070236740276677,-0.0076804430372861415\n20140821 00:00,1990600,1997600,1989300,1995000,59306589,0.0029157450231249715,-0.01448565650952976,-0.010011935634264934,-0.007627011589661026\n20140822 00:00,1993200,1996900,1987400,1991900,67316596,-0.0015538847117794186,-0.014482495265442201,-0.010022103123484196,-0.0076442845772861714\n20140825 00:00,2001500,2005300,1998600,2002000,59522463,0.005070535669461362,-0.01448412272207054,-0.010021629641710642,-0.007642691093024618\n20140826 00:00,2003500,2008200,2002800,2003300,40694869,0.0006493506493505663,-0.014447477307966021,-0.009990082159149018,-0.00761386129890476\n20140827 00:00,2004500,2005700,1999400,2002500,41413859,-0.0003993410872060732,-0.014181149618521906,-0.009783467115265282,-0.0074390788454160245\n20140828 00:00,1995900,2002600,1993900,2001400,47413129,-0.0005493133583021059,-0.014193391492325368,-0.009797175214917185,-0.007453568584642288\n20140829 00:00,2004400,2007300,1998200,2007100,52731377,0.002848006395523184,-0.014191731217607001,-0.009794889133933966,-0.007450948888654934\n20140902 00:00,2009900,2010000,1998600,2006100,62095645,-0.0004982312789596488,-0.014167939196259015,-0.00977461114726596,-0.00743254422087193\n20140903 00:00,2013500,2014100,2002200,2005000,50973915,-0.0005483276008174665,-0.01417962586184061,-0.009788697211570122,-0.007447909395756656\n20140904 00:00,2008600,2015800,1996600,2002200,69364467,-0.0013965087281795352,-0.014180268781587839,-0.009800534474535676,-0.007465714321669744\n20140905 00:00,2001900,2011900,1994200,2011100,83243971,0.004445110378583639,-0.014174695148081323,-0.009792127550228989,-0.0074557969805214425\n20140908 00:00,2009400,2012100,2000000,2005900,59405002,-0.0025856496444731647,-0.014197347010786957,-0.009812411006178606,-0.007474817847593185\n20140909 00:00,2004200,2005500,1989200,1993200,81235943,-0.00633132259833491,-0.014238060563445896,-0.009859969751785522,-0.007526025740231567\n20140910 00:00,1994600,2002000,1987700,2000700,63306991,0.003762793497892769,-0.014229142326172528,-0.00985740169370315,-0.007526842939178504\n20140911 00:00,1992800,2003300,1991200,2003000,60058285,0.0011495976408257835,-0.014232856939382177,-0.009862340851782175,-0.007532434897596241\n20140912 00:00,2001200,2001200,1985600,1991200,104418519,-0.005891163255117293,-0.014274681458573933,-0.009896496449205906,-0.007562502221202561\n20140915 00:00,1991700,1993100,1983800,1990200,66547024,-0.0005022097227802558,-0.014283672878767495,-0.009905432002873608,-0.007571407992632048\n20140916 00:00,1986400,2008400,1985000,2005200,104267737,0.007536930961712374,-0.014290324896873052,-0.009908582235395997,-0.007572691436217618\n20140917 00:00,2008000,2016800,1997500,2007500,129557361,0.0011470177538399629,-0.014293736641421854,-0.009914368927516137,-0.007579744204100081\n20140918 00:00,2013600,2018500,2011000,2018200,82911266,0.005330012453300226,-0.01424156414726383,-0.00988535051810526,-0.007563069151591412\n20140919 00:00,2015500,2017300,2002900,2007000,103522528,-0.005549499554058035,-0.014278982014263378,-0.009916042514098118,-0.007590175610638182\n20140922 00:00,2003600,2003700,1987400,1991500,100445733,-0.007722969606377639,-0.014181584709086445,-0.009841423168350837,-0.007527699110778123\n20140923 00:00,1984100,1992600,1979500,1980100,95589005,-0.005724328395681599,-0.014202359873753581,-0.009858133733328087,-0.007542242852700835\n20140924 00:00,1980600,1996900,1975200,1995700,96800805,0.007878389980304101,-0.014194638338058401,-0.009840984682314084,-0.007520068028154772\n20140925 00:00,1990500,1990500,1963200,1963300,131462409,-0.01623490504584857,-0.014445406984486372,-0.010034010959272584,-0.0076823120616117705\n20140926 00:00,1967000,1983900,1964200,1979000,89383462,0.007996740182345974,-0.014460536840202692,-0.010039399496973741,-0.007682507538724604\n20140929 00:00,1962000,1978900,1960500,1974900,84163503,-0.0020717534108135593,-0.014438849052834471,-0.010021403970959174,-0.007666480343575286\n20140930 00:00,1977000,1983000,1966100,1970200,106045623,-0.0023798673350549082,-0.014411824396717251,-0.009999214093353375,-0.007646867868503911\n20141001 00:00,1967500,1967700,1939100,1943700,163982292,-0.013450411125774053,-0.01460066792914733,-0.010157362622004716,-0.0077886530042207795\n20141002 00:00,1941800,1950500,1923500,1944200,145715250,0.0002572413438288734,-0.01458921926045621,-0.010146978670956422,-0.007778836650208125\n20141003 00:00,1957100,1969400,1950800,1965200,101990291,0.010801357884991258,-0.014522029074465525,-0.01007667272063774,-0.007706869697455379\n20141006 00:00,1973600,1976000,1955900,1963000,97319437,-0.0011194789334418864,-0.014524461557281593,-0.010088501741769357,-0.0077237079783932325\n20141007 00:00,1952900,1957200,1932500,1933000,126487728,-0.015282730514518561,-0.014668127396028493,-0.010197729048159104,-0.00781457623061544\n20141008 00:00,1933600,1969200,1923600,1966100,170825947,0.0171236420072427,-0.014639914751985728,-0.010144404796517457,-0.007747865073882693\n20141009 00:00,1963600,1966000,1925800,1927000,193080301,-0.01988708610955703,-0.015014909946720143,-0.010433297321097577,-0.007990856583607162\n20141010 00:00,1927100,1936500,1905100,1905400,195742635,-0.011209133367929391,-0.014919325493333661,-0.010404511835300924,-0.00799768138025806\n20141013 00:00,1904400,1911500,1873000,1874500,203655232,-0.016217067282460418,-0.015178209004722592,-0.010613689525743517,-0.008180361081479393\n20141014 00:00,1884600,1898200,1870400,1878300,195991419,0.0020272072552680598,-0.015178463290641837,-0.010616564034088711,-0.008184632420704318\n20141015 00:00,1851900,1868800,1819200,1864300,349938478,-0.0074535484214449665,-0.015174499285506245,-0.010613454436965347,-0.008181978305330725\n20141016 00:00,1830200,1875800,1829000,1862700,179272051,-0.0008582309714101344,-0.015109301427998377,-0.010584312864228073,-0.008172058204586467\n20141017 00:00,1884800,1897500,1876200,1884700,195960240,0.011810812261770609,-0.015150437969816462,-0.010607911871046392,-0.008186308016390123\n20141020 00:00,1880900,1904500,1880700,1903000,102818615,0.009709768132859287,-0.015173137568182917,-0.010619987171176636,-0.008192719542443475\n20141021 00:00,1917000,1942000,1914800,1940700,136732853,0.019810825013137245,-0.015355538585678886,-0.01072652482037473,-0.008258814710717334\n20141022 00:00,1944400,1949100,1926100,1926900,134617023,-0.007110836296181811,-0.015427610382444692,-0.01079174704603847,-0.008320385455371863\n20141023 00:00,1946400,1962000,1942600,1949300,141433028,0.01162488971923814,-0.015435834372088834,-0.010779208562358724,-0.008296778573990022\n20141024 00:00,1952300,1964900,1944900,1964300,101947411,0.007695070025137252,-0.015448338830107343,-0.010783231971086155,-0.0082962807667226\n20141027 00:00,1957500,1964500,1950300,1961600,75533804,-0.0013745354579239866,-0.015463551619812419,-0.010800163341903292,-0.008314128306771352\n20141028 00:00,1968400,1984200,1967300,1984100,92862874,0.011470228384991898,-0.015505579039936088,-0.010818593412924762,-0.008319978718303134\n20141029 00:00,1985900,1991200,1968000,1981100,129853584,-0.0015120205634796546,-0.015518918025717428,-0.010836246604006571,-0.008339931796266875\n20141030 00:00,1975900,1999500,1974100,1993800,106646609,0.006410579980818731,-0.015476723338846959,-0.010793122481586837,-0.008296312195194994\n20141031 00:00,2017800,2018100,2007800,2016600,121383830,0.011435449894673377,-0.015487242842289228,-0.010783311213968952,-0.008275662668754395\n20141103 00:00,2019600,2024500,2013100,2017700,80803486,0.0005454725776059544,-0.015492241598291883,-0.010788923721537615,-0.008281602365011848\n20141104 00:00,2012200,2016000,2000600,2010700,82190940,-0.003469296723992654,-0.015524653053442803,-0.010820625209993709,-0.008312925372850001\n20141105 00:00,2025500,2025900,2014500,2023400,82242532,0.006316208285671587,-0.015499021093489945,-0.010791347253224908,-0.008281703748669813\n20141106 00:00,2024100,2032600,2016400,2031500,90435301,0.004003162992982201,-0.015497499843516302,-0.010791553112696825,-0.00828283032379638\n20141107 00:00,2031600,2035900,2026100,2033400,70687484,0.0009352695052915472,-0.01532938007792353,-0.01065709623450214,-0.008166319006311656\n20141110 00:00,2034000,2040400,2031300,2039800,58529173,0.0031474377889249006,-0.01526369723975349,-0.01062254281058327,-0.008148360557942673\n20141111 00:00,2040700,2043000,2036600,2041600,48919008,0.0008824394548485603,-0.015259481744709464,-0.010618405281598988,-0.00814426459237635\n20141112 00:00,2033500,2042400,2033100,2039600,78536093,-0.000979623824451381,-0.015254390856801893,-0.010613911887232541,-0.008140089719605783\n20141113 00:00,2041400,2048300,2032100,2041900,79200441,0.0011276720925672556,-0.015246807853610671,-0.01061604111460454,-0.008147396501153106\n20141114 00:00,2041300,2044800,2037200,2042400,65017444,0.0002448699740438265,-0.015250697616602239,-0.010625025819190816,-0.008159097300250833\n20141117 00:00,2038500,2045800,2036600,2043700,60076767,0.0006365060712887338,-0.01525533762761771,-0.010632752817462728,-0.00816846996000645\n20141118 00:00,2044600,2059200,2044400,2055500,68462821,0.005773841561873105,-0.015226612688942896,-0.01060172929133517,-0.008136221065413242\n20141119 00:00,2053000,2055500,2043000,2052200,77328648,-0.0016054487959134,-0.01521889236840352,-0.010595093086162796,-0.00813016279813149\n20141120 00:00,2042500,2057100,2041900,2055800,64783018,0.0017542149887925795,-0.01519308927313981,-0.01057143317421496,-0.008107645409278979\n20141121 00:00,2076000,2077200,2059800,2067200,121172657,0.005545286506469571,-0.01518090672297783,-0.010565880886177782,-0.008105627689446736\n20141124 00:00,2071900,2073900,2069100,2072600,59414411,0.002612229102167074,-0.015180421782172208,-0.010567927161992528,-0.008109023347475602\n20141125 00:00,2075100,2077900,2068000,2072500,66365644,-4.8248576666964915e-05,-0.015177819557849671,-0.01056550040574214,-0.008106690132605196\n20141126 00:00,2072700,2077600,2070300,2076400,48377586,0.0018817852834740467,-0.0151693616737056,-0.01055688237844423,-0.008097986733584549\n20141128 00:00,2075000,2078700,2069100,2072000,47640169,-0.0021190522057407124,-0.015190259083467064,-0.010577210314857928,-0.008118011085863762\n20141201 00:00,2063800,2065400,2053800,2058000,95613332,-0.006756756756756799,-0.015247635553334438,-0.010624413722006357,-0.008159791270919854\n20141202 00:00,2058000,2073400,2057900,2070900,68327439,0.006268221574343924,-0.015231524075124755,-0.010603229560099,-0.008135902880103596\n20141203 00:00,2072800,2081500,2071100,2079100,59313893,0.003959631078275239,-0.015195183881696779,-0.010568489211991718,-0.008102015403616906\n20141204 00:00,2075500,2082700,2067000,2076400,80223355,-0.0012986388341109656,-0.015197076150493231,-0.010570173341590428,-0.008103588574979474\n20141205 00:00,2078800,2084700,2075500,2080000,75793135,0.001733769986515199,-0.015163967916971761,-0.010540478281641973,-0.008075713065233109\n20141208 00:00,2075500,2081200,2059300,2066100,98866205,-0.006682692307692362,-0.015197708780226893,-0.010584701702987778,-0.0081255246995087\n20141209 00:00,2043700,2066000,2039100,2064700,115507853,-0.0006776051497990876,-0.015208699084066217,-0.01059615109898358,-0.008137218835834351\n20141210 00:00,2059400,2059800,2029300,2031600,146331601,-0.0160313847047997,-0.015433029310279723,-0.010769235455989344,-0.008282984209589304\n20141211 00:00,2038900,2061900,2037100,2042300,150279681,0.00526678480015752,-0.01528911943922614,-0.010648305012033654,-0.00817430401318929\n20141212 00:00,2026500,2038100,2008500,2009400,177421306,-0.016109288547226153,-0.015517328592753423,-0.010824550348840957,-0.008322847631583608\n20141215 00:00,2020000,2025300,1987800,1995100,178323144,-0.007116552204638249,-0.015583752586332442,-0.010879658058254043,-0.008371922671781204\n20141216 00:00,1985500,2023900,1978600,1979000,222136276,-0.008069770938800014,-0.015666689694519644,-0.0109549247753092,-0.00844310033170643\n20141217 00:00,1984800,2023400,1983000,2017900,236495966,0.019656392117231025,-0.015806684778042028,-0.011026647901175043,-0.008478427929570622\n20141218 00:00,2047800,2129700,2039300,2068400,227706451,0.025026017146538404,-0.015978121341433626,-0.011139345406605274,-0.008559811860552347\n20141219 00:00,2064600,2073300,2056200,2063300,201656897,-0.002465673950879932,-0.015987670996785493,-0.011147684271295862,-0.008567505257221664\n20141222 00:00,2067100,2074700,2064600,2074700,122695539,0.005525129646682503,-0.01598366876350513,-0.011138943990827908,-0.008556239141330087\n20141223 00:00,2082000,2082300,2075100,2077500,105506063,0.0013495927121993656,-0.01598505854013447,-0.011144503724904626,-0.008564021864292013\n20141224 00:00,2080300,2083400,2077200,2078100,37099900,0.0002888086642598431,-0.015990756744940635,-0.011150680596166791,-0.008570453910870671\n20141226 00:00,2082900,2088400,2082500,2084400,47217364,0.003031615417929734,-0.01598965185711325,-0.011152158046590215,-0.00857330799626024\n20141229 00:00,2082500,2089700,2081500,2087200,68552412,0.001343312224141302,-0.015984576241950904,-0.011147007733455344,-0.008568117861912616\n20141230 00:00,2082100,2083700,2075100,2076000,67744755,-0.00536604062859336,-0.016027772811827014,-0.011183661511635782,-0.008601283702050225\n20141231 00:00,2079600,2081800,2054000,2055000,104411039,-0.010115606936416222,-0.016148122377990962,-0.01128588981762158,-0.008693851631288708\n20150102 00:00,2064000,2068800,2041800,2054300,105957476,-0.0003406326034063323,-0.01604794248287511,-0.011204437078631578,-0.008622382269933757\n20150105 00:00,2042000,2043700,2013500,2017600,151790532,-0.01786496616852451,-0.01633498920245312,-0.011427908148814565,-0.008811961396671677\n20150106 00:00,2021300,2027200,1988600,1998200,191309913,-0.009615384615384581,-0.01641957046468619,-0.011495584000950167,-0.008870625037238991\n20150107 00:00,2014600,2027200,2008800,2023100,110907078,0.012461215093584332,-0.01646735550533699,-0.011521705534978834,-0.008885197836048343\n20150108 00:00,2040000,2061600,2039900,2059000,135532145,0.01774504473333005,-0.01658883915610782,-0.011587543081311668,-0.0089213706500112\n20150109 00:00,2063900,2064100,2035200,2041900,138380098,-0.008305002428363295,-0.016672875959146308,-0.011657376198493438,-0.008983631834820304\n20150112 00:00,2044200,2045900,2019300,2026500,130060345,-0.007541995200548546,-0.016750247347594907,-0.011724014515667259,-0.00904454839141286\n20150113 00:00,2041500,2054800,2005200,2020800,195352135,-0.0028127313101405926,-0.016592840612733566,-0.011600332854947926,-0.00893884544292657\n20150114 00:00,1996700,2011000,1985700,2009400,175802901,-0.005641330166270775,-0.016607867374338187,-0.011630697956191843,-0.008977387356276111\n20150115 00:00,2016400,2020000,1988800,1989700,156300011,-0.009803921568627416,-0.016717693606113332,-0.011725885590075612,-0.009064771207790836\n20150116 00:00,1987500,2018200,1985500,2016300,185662074,0.013368849575312813,-0.01676260229287261,-0.011740209110295021,-0.00906278988890138\n20150120 00:00,2024300,2027100,2001700,2020800,120590234,0.0022318107424490474,-0.016727725595992952,-0.011708289637995488,-0.009032446902082967\n20150121 00:00,2015100,2036600,2009400,2030600,111421802,0.004849564528899508,-0.016728474017803755,-0.011706536112257958,-0.009029359597365314\n20150122 00:00,2040200,2062600,2023300,2060500,143386079,0.01472471190781044,-0.016800405579611224,-0.011741035770922077,-0.009043904446972065\n20150123 00:00,2058000,2061000,2048100,2049700,103145813,-0.005241446250909942,-0.016762164071379662,-0.01171056563466747,-0.00901757720036216\n20150126 00:00,2047300,2055600,2038500,2054400,80310454,0.0022930184905107787,-0.016358337398135185,-0.011397188470617837,-0.008752418334976196\n20150127 00:00,2030000,2041200,2017500,2027900,118119788,-0.012899143302180671,-0.01648951146271407,-0.011499600260750661,-0.008839497063030163\n20150128 00:00,2041600,2049500,1999100,2001400,143518567,-0.013067705508161165,-0.01666203253241742,-0.011643891158445736,-0.008968738560487039\n20150129 00:00,2003400,2023000,1986800,2020100,142243135,0.009343459578295299,-0.016562130872428218,-0.011550580594608954,-0.00887894168562024\n20150130 00:00,2005600,2021700,1991300,1994700,168157021,-0.012573634968565894,-0.016693827326468794,-0.011671100552042133,-0.008993503494068132\n20150202 00:00,2000700,2020200,1978600,2019000,148086377,0.01218228305008262,-0.01668280445270988,-0.011642334785556988,-0.008955279057124227\n20150203 00:00,2029400,2048500,2025500,2048400,111656466,0.014561664190193113,-0.016318419735728444,-0.011341474829956774,-0.008688283916757225\n20150204 00:00,2039100,2053800,2035100,2040600,113368828,-0.003807850029291182,-0.016348531123778952,-0.011375268750661615,-0.008724040981993706\n20150205 00:00,2048300,2063000,2047700,2061800,86542389,0.010389101244731913,-0.0163612153647616,-0.011370900495545472,-0.008710582104306228\n20150206 00:00,2065700,2072400,2049200,2055300,105345677,-0.0031525851197982124,-0.016335311854974905,-0.01137158004184024,-0.008725432979433394\n20150209 00:00,2047700,2056400,2041400,2046300,77313286,-0.004378922784994854,-0.016324589072217673,-0.011383891755976141,-0.008750024298629039\n20150210 00:00,2058900,2071200,2048200,2067700,87817324,0.01045789962371102,-0.01635100627610035,-0.011392159253409417,-0.008748616254713055\n20150211 00:00,2066000,2074500,2058300,2069300,77041314,0.0007738066450646564,-0.01632253499644814,-0.011383851017776576,-0.008751056863238122\n20150212 00:00,2079100,2089900,2076800,2089200,82340827,0.00961677862078969,-0.016340626452556087,-0.011386613138902948,-0.00874564697260858\n20150213 00:00,2090800,2098400,2087600,2097800,77979039,0.00411640819452419,-0.016340195878018028,-0.011386884038949333,-0.008746291826160279\n20150217 00:00,2093800,2103200,2091000,2101600,65018633,0.0018114214891791214,-0.016340226089851487,-0.01139121554725882,-0.008752916339705158\n20150218 00:00,2096300,2102200,2093500,2101500,68979537,-4.7582794061695743e-05,-0.01634561854005021,-0.011396662991273211,-0.008758393100719188\n20150219 00:00,2094300,2104200,2092400,2099800,82658520,-0.0008089459909588204,-0.01629152787738733,-0.011351724548180939,-0.008718333672014274\n20150220 00:00,2094300,2113300,2087300,2112800,123596635,0.006191065815791985,-0.016292858659221483,-0.011352136636125507,-0.008718256007645723\n20150223 00:00,2109700,2112100,2104800,2111900,68459606,-0.0004259750094660619,-0.01629103247236118,-0.01135045659422839,-0.008716653875087703\n20150224 00:00,2111100,2120500,2107600,2118100,65091020,0.0029357450636866567,-0.016289957438583268,-0.011352286991161408,-0.008720033146381825\n20150225 00:00,2116400,2122400,2112200,2116100,67297730,-0.0009442424814692929,-0.016293089010568678,-0.011355158775630122,-0.008722766439086675\n20150226 00:00,2115500,2117100,2106500,2113700,65693818,-0.001134161901611419,-0.01629947726414203,-0.011361056952493752,-0.00872840335786977\n20150227 00:00,2112500,2115800,2106400,2106600,87493136,-0.0033590386525996774,-0.0163285852322226,-0.01139195725967054,-0.008760259154386604\n20150302 00:00,2107900,2120600,2107200,2119900,75805733,0.006313490933257393,-0.016332059390887294,-0.011389763687883768,-0.00875504413646832\n20150303 00:00,2114600,2115900,2100800,2111200,97220283,-0.004103967168262668,-0.01629681924939535,-0.01136138119848628,-0.008730317436027184\n20150304 00:00,2104200,2104900,2090600,2102100,99097965,-0.004310344827586188,-0.016266947827522464,-0.011361610576259156,-0.008746593438709963\n20150305 00:00,2105900,2108000,2098500,2105100,69813562,0.0014271442842872517,-0.0162624301183777,-0.011356943197507928,-0.008741846271645346\n20150306 00:00,2093800,2099400,2071000,2075000,151279849,-0.01429860814213102,-0.016466458729189774,-0.011521542119326544,-0.008885425372162265\n20150309 00:00,2077600,2087900,2075800,2083600,81466789,0.004144578313252989,-0.016459902625912372,-0.01151239742033976,-0.008874900702381323\n20150310 00:00,2067000,2068100,2049700,2050000,137606860,-0.016125935880207387,-0.01669595115781089,-0.01169773388344057,-0.009033202749254704\n20150311 00:00,2052900,2055000,2044000,2045000,101445686,-0.0024390243902439046,-0.016670289466707996,-0.011676372012519975,-0.009014133096562772\n20150312 00:00,2052400,2071800,2052000,2071300,83701264,0.012860635696821499,-0.01671818321819137,-0.011695595641432842,-0.009018072789220656\n20150313 00:00,2067600,2069300,2045800,2058400,142726670,-0.006227972770723733,-0.016640894290481247,-0.011635152997255283,-0.008966610836458416\n20150316 00:00,2066800,2086900,2066800,2086400,122468254,0.013602798289933826,-0.016677311377891732,-0.011641824463149814,-0.008957425021589785\n20150317 00:00,2076500,2084200,2069800,2079900,86273420,-0.003115414110429482,-0.016687750091857283,-0.011663339913136584,-0.00898484543856249\n20150318 00:00,2073500,2112600,2066200,2104200,201026638,0.011683254002596177,-0.016720709588807007,-0.011681360126053643,-0.008994901574441204\n20150319 00:00,2100400,2102900,2090300,2095000,107031725,-0.004372207965022357,-0.016710517134371446,-0.01167304150331676,-0.008987581884449196\n20150320 00:00,2096600,2110200,2096100,2104500,143568202,0.004534606205250702,-0.016707996696697605,-0.011672776329248402,-0.008988518983063819\n20150323 00:00,2104300,2111100,2100000,2100000,60797901,-0.002138275124732747,-0.016639207054902322,-0.01161696505837629,-0.008939626433707305\n20150324 00:00,2098700,2104000,2087400,2088200,66524763,-0.005619047619047635,-0.016654067614566514,-0.011629071936310966,-0.008950265334101355\n20150325 00:00,2090100,2093500,2057100,2057600,143214221,-0.01465376879609237,-0.016862335152089625,-0.011799068936865284,-0.009099860453009142\n20150326 00:00,2049600,2063700,2041200,2052700,135552421,-0.002381415241057505,-0.01681189992221004,-0.011757815911756406,-0.009063502427286837\n20150327 00:00,2051600,2059500,2049100,2057500,101603187,0.0023383835923418417,-0.016792394312629324,-0.011738855018945752,-0.009044831920970704\n20150330 00:00,2069600,2086100,2069600,2082400,79185641,0.012102065613608826,-0.016835800080936398,-0.011761270940079267,-0.009056058232244212\n20150331 00:00,2072600,2081000,2063600,2064300,101521731,-0.008691893968497899,-0.01691693469633666,-0.01183839249516548,-0.009131040439726434\n20150401 00:00,2064200,2064200,2045100,2057000,123533228,-0.0035363077072131377,-0.01694296120925265,-0.01186855019720921,-0.009163400463407623\n20150402 00:00,2055800,2069800,2054000,2064000,76346908,0.003403014098201318,-0.0169428609200626,-0.0118681663269963,-0.009162865417200754\n20150406 00:00,2053900,2084500,2052100,2078400,94957784,0.006976744186046435,-0.016934682574687103,-0.011852673071452487,-0.009143472610113397\n20150407 00:00,2078600,2087500,2072500,2072800,66012249,-0.002694380292532772,-0.016811990857015978,-0.011755372038573601,-0.009059707257344724\n20150408 00:00,2075300,2085000,2070800,2080200,79769143,0.0035700501736781742,-0.01667869296517662,-0.011644249271450378,-0.0089604059671536\n20150409 00:00,2078200,2091800,2071900,2089200,79714373,0.004326507066628293,-0.01667872564590569,-0.011644224777358056,-0.008960350993375561\n20150410 00:00,2092100,2100900,2089600,2100600,64668878,0.005456634118322867,-0.016647680109607287,-0.011628614811626673,-0.008952969673197588\n20150413 00:00,2098400,2106200,2090300,2090600,68313801,-0.00476054460630293,-0.016298758834147067,-0.011362720868248648,-0.008731337293328579\n20150414 00:00,2088600,2097100,2081000,2094900,66715857,0.0020568257916386834,-0.016193841067753414,-0.011275421767505598,-0.00865343063804995\n20150415 00:00,2100700,2110400,2099500,2104700,86369302,0.004678027590815814,-0.016182223783638445,-0.011271121729393464,-0.008653031396706102\n20150416 00:00,2100400,2109800,2098000,2104000,60189683,-0.0003325889675488414,-0.016184748761206524,-0.011281554446033237,-0.008667679699784181\n20150417 00:00,2089800,2092300,2070100,2079800,164756043,-0.01150190114068439,-0.016302313672796172,-0.011390038240600985,-0.00877132238447019\n20150420 00:00,2090900,2102500,2089600,2098500,77138230,0.008991249158572856,-0.016317981281664697,-0.011392225206315798,-0.008766322869201853\n20150421 00:00,2106500,2108600,2092400,2096000,62036953,-0.0011913271384321744,-0.01633258300792392,-0.011407988258389196,-0.008782705019769561\n20150422 00:00,2100400,2108500,2089000,2106600,72044468,0.005057251908396898,-0.016333390358593877,-0.011407963012639372,-0.008782235919949187\n20150423 00:00,2101700,2119300,2100100,2112100,91675891,0.0026108421152568617,-0.016311073022755827,-0.011386364217658922,-0.008761020176441123\n20150424 00:00,2117000,2119700,2111100,2116700,49570752,0.0021779271814781342,-0.016310675824816285,-0.01138584627448112,-0.008760437864423598\n20150427 00:00,2123400,2124800,2105400,2107400,70031075,-0.004393631596352865,-0.016263928369219235,-0.01134849250897337,-0.008728091840343212\n20150428 00:00,2107100,2115000,2093400,2114400,80175010,0.0033216285470247797,-0.01626385698015942,-0.011348262401955331,-0.008727777121368942\n20150429 00:00,2103200,2112900,2096000,2105300,113900782,-0.004303821415058695,-0.016303448138966937,-0.011386359410578795,-0.008765077604058058\n20150430 00:00,2099000,2103500,2076200,2085200,139993578,-0.009547332921673868,-0.016413353105002297,-0.0114796878964799,-0.008849569229737132\n20150501 00:00,2094100,2107700,2092800,2107200,87366934,0.010550546710147657,-0.016432801115672118,-0.01148031014453969,-0.008840155533410025\n20150504 00:00,2112200,2120200,2111000,2113900,63475146,0.003179574791192019,-0.016418127485906726,-0.011464818893157026,-0.008824228410968618\n20150505 00:00,2110100,2114600,2087300,2089200,102623336,-0.0116845640758787,-0.016564803500633465,-0.011584458830905732,-0.008929455516121267\n20150506 00:00,2095400,2099300,2067600,2080400,122648566,-0.004212138617652683,-0.01650844924901487,-0.011539454424528039,-0.008890501670243946\n20150507 00:00,2079100,2093800,2075300,2088700,75342115,0.003989617381272792,-0.0165054548091402,-0.011539419967238472,-0.008892045168717746\n20150508 00:00,2108400,2118500,2107900,2116500,125762691,0.013309714176281906,-0.016551667650272564,-0.011555447073687646,-0.008891980371702845\n20150511 00:00,2115400,2118900,2105300,2106000,65829833,-0.0049610205527994555,-0.016595696381996383,-0.011594202865401143,-0.00892792517860817\n20150512 00:00,2095900,2106300,2086300,2099800,101766611,-0.0029439696106362545,-0.01659964852902669,-0.011611611565015688,-0.008952507516612421\n20150513 00:00,2104900,2112200,2097400,2100600,79703427,0.000380988665587223,-0.016601190269573053,-0.011613177434853485,-0.008954086249686199\n20150514 00:00,2112400,2123200,2109100,2122500,82976922,0.010425592687803409,-0.016585688083382285,-0.011584466911409073,-0.008918334410526352\n20150515 00:00,2124300,2126100,2118700,2124400,68168050,0.0008951707891637906,-0.016494496369025353,-0.01150886379240853,-0.008851041514028206\n20150518 00:00,2122400,2134000,2121700,2131000,68309200,0.003106759555639327,-0.01649467555802554,-0.011509783218824163,-0.008852355558270929\n20150519 00:00,2132600,2135700,2126900,2130300,62912644,-0.0003284842796809073,-0.016504521318913834,-0.011520772649221259,-0.008863954674651274\n20150520 00:00,2131600,2137800,2125100,2128800,70291407,-0.0007041261794114018,-0.016456345510486053,-0.01148044372456508,-0.008827808894698102\n20150521 00:00,2127400,2137500,2125100,2135000,59049641,0.0029124389327319644,-0.01644214680557239,-0.011476812063252514,-0.008829810485228308\n20150522 00:00,2130200,2135400,2129100,2130000,48920652,-0.0023419203747072626,-0.016463919311924827,-0.011497817692791689,-0.00885040729557599\n20150526 00:00,2123900,2125000,2102100,2107100,110549834,-0.010751173708920203,-0.01659417776547444,-0.011607197895352275,-0.008948657379789608\n20150527 00:00,2112300,2129800,2108500,2126700,83068343,0.00930188410611743,-0.01661041526472169,-0.011615131681277136,-0.00895216448686833\n20150528 00:00,2123400,2125900,2116300,2125000,68137802,-0.0007993605115906854,-0.016609326145976308,-0.011614137902349452,-0.008951221533244676\n20150529 00:00,2124000,2124300,2108200,2111300,101440890,-0.006447058823529361,-0.016670610293537245,-0.011671159411810052,-0.009005970646106922\n20150601 00:00,2119500,2123400,2106200,2115400,85386556,0.001941931511391104,-0.016668752995618596,-0.01166897840133414,-0.009003617065664559\n20150602 00:00,2110200,2121900,2102700,2113900,80789780,-0.0007090857521035998,-0.01667739488370824,-0.011677602728684913,-0.009012232031450424\n20150603 00:00,2119700,2126700,2113400,2119200,78010486,0.0025072141539335124,-0.0166676761486481,-0.011667213857195987,-0.009001485912710997\n20150604 00:00,2111200,2117700,2097500,2102700,133914464,-0.007785956964892371,-0.01674689350611108,-0.011734566943363499,-0.009062514199751969\n20150605 00:00,2099300,2105800,2089800,2097600,97753516,-0.0024254529890140875,-0.016762987479541518,-0.011756407785524486,-0.009087418676368215\n20150608 00:00,2096300,2098200,2083900,2084800,80415421,-0.006102212051868783,-0.016819255405626603,-0.011808965083673234,-0.009137997852494447\n20150609 00:00,2084400,2091000,2076900,2084700,92083031,-4.7966231772833545e-05,-0.016822582079887453,-0.011812324813838726,-0.009141375204640386\n20150610 00:00,2093800,2114000,2093100,2109500,122058028,0.011896196095361411,-0.016860253213124416,-0.011825250083864858,-0.009141108546555338\n20150611 00:00,2114900,2120900,2112000,2116300,65279388,0.0032235126807300674,-0.016830185713415737,-0.011796261327768674,-0.009112694864687323\n20150612 00:00,2106200,2108400,2096800,2100100,120211197,-0.0076548693474459695,-0.016838036822011005,-0.011802480962521037,-0.009118044766770937\n20150615 00:00,2086200,2094400,2077900,2091100,113025531,-0.004285510213799304,-0.016875995943557383,-0.011838025934575301,-0.009152302764663974\n20150616 00:00,2089000,2103500,2087200,2102500,75706432,0.005451676151307927,-0.016873376390444898,-0.011830614624756904,-0.009142336987076477\n20150617 00:00,2105800,2113200,2093900,2105900,118475364,0.0016171224732461909,-0.01687528057036278,-0.011833312054299274,-0.009145457295058416\n20150618 00:00,2112300,2133400,2111800,2127800,153435733,0.010399354195355981,-0.01689579352343675,-0.011844259058474698,-0.009151304727272673\n20150619 00:00,2114200,2115500,2104500,2108100,106014352,-0.009258388946329577,-0.01699394201080615,-0.011925721171175145,-0.009223871395381287\n20150622 00:00,2119500,2125900,2116500,2118900,61838092,0.005123096627294821,-0.016971187668253254,-0.011900482165901548,-0.00919730782560522\n20150623 00:00,2121800,2124400,2115700,2120400,59750874,0.0007079144839303719,-0.016966987332138417,-0.011896333390636341,-0.009193186537238161\n20150624 00:00,2117100,2121700,2104800,2105000,77999419,-0.007262780607432573,-0.016983279513813815,-0.01190935214062918,-0.009204460232913625\n20150625 00:00,2111300,2112500,2097700,2098600,80464312,-0.003040380047505953,-0.017009413509146577,-0.011936558872360115,-0.009232238836449008\n20150626 00:00,2102800,2105800,2091600,2098200,84634171,-0.00019060325931574695,-0.017007097832859402,-0.011934370446274274,-0.009230118246974636\n20150629 00:00,2080200,2088200,2053300,2054200,173766367,-0.02097035554284621,-0.01737436365911907,-0.01222044715878626,-0.009472913343369822\n20150630 00:00,2073200,2073200,2052800,2058500,147775137,0.002093272320124573,-0.017366572356683145,-0.012212089273227983,-0.009464253414445532\n20150701 00:00,2077900,2080300,2065600,2075000,119981651,0.008015545299975724,-0.017372244464852835,-0.01221474078158383,-0.009465294652217673\n20150702 00:00,2080700,2082700,2068200,2073100,91216426,-0.000915662650602389,-0.017379696306777742,-0.012222017941609946,-0.009472478689969912\n20150706 00:00,2057400,2076500,2055400,2067200,107837293,-0.002845979451063574,-0.01740205036705215,-0.0122472030577365,-0.009499173031495558\n20150707 00:00,2069300,2081600,2041200,2080200,160419568,0.006288699690402577,-0.017375338570941267,-0.012216666703290458,-0.009466597819152966\n20150708 00:00,2063400,2067600,2042500,2045300,149493795,-0.016777232958369415,-0.017567891324105814,-0.012365075760330978,-0.009591474035133602\n20150709 00:00,2070300,2073500,2048800,2049000,129658638,0.0018090255708209657,-0.017569124723378765,-0.012368819844231495,-0.009596556555718852\n20150710 00:00,2072800,2079800,2064900,2074800,117226689,0.012591508052708589,-0.017586168759235687,-0.012361692518122646,-0.009576543565986747\n20150713 00:00,2090000,2099000,2089400,2097700,95163867,0.011037208405629384,-0.017616789803910203,-0.012371992789671793,-0.009576010908575218\n20150714 00:00,2096900,2110500,2096600,2106800,72962870,0.004338084568813461,-0.017615769248158317,-0.012372141187719848,-0.009576782471568571\n20150715 00:00,2107100,2112800,2100500,2106100,88918067,-0.000332257452060003,-0.01760707956952079,-0.01236420664340148,-0.009569250486561544\n20150716 00:00,2118200,2123000,2115500,2123000,94346340,0.008024310336641083,-0.01761888053238138,-0.012367525087600884,-0.009568046931450325\n20150717 00:00,2123400,2125500,2118000,2124800,79523761,0.0008478568064060887,-0.017488097130995296,-0.012260855822280056,-0.009474232822836935\n20150720 00:00,2127700,2131800,2122100,2125900,59688017,0.0005176957831325435,-0.017466261047027264,-0.01225687257201265,-0.009479766852154929\n20150721 00:00,2124500,2127400,2113900,2117500,69759154,-0.003951267698386607,-0.01748162713127149,-0.012269978968848967,-0.009491668617995557\n20150722 00:00,2109100,2117700,2108900,2113700,78346222,-0.0017945690672963588,-0.017498695238396134,-0.012289199260487351,-0.009512036231234542\n20150723 00:00,2115400,2116500,2097500,2101800,82429587,-0.005629938023371306,-0.01754862220738251,-0.012333625728968026,-0.009553530403248993\n20150724 00:00,2102500,2103700,2076000,2080000,103477607,-0.010372062042059205,-0.017657935210044683,-0.01242303180606875,-0.009632324171994017\n20150727 00:00,2069800,2075500,2062600,2067900,115528777,-0.005817307692307705,-0.017670908177500926,-0.012433641674449904,-0.009641674281002361\n20150728 00:00,2078000,2095000,2068000,2093300,112137492,0.012282992407756765,-0.017710744941360074,-0.012447882367226297,-0.009642269802997051\n20150729 00:00,2094400,2110400,2093200,2107700,93976149,0.006879090431376245,-0.017679028096177173,-0.01241234696236155,-0.009604698738095633\n20150730 00:00,2102000,2110200,2094200,2108200,84772348,0.0002372254115861061,-0.017679095328532696,-0.012412413880100935,-0.009604765488114321\n20150731 00:00,2114400,2114500,2101600,2105000,87268759,-0.0015178825538374463,-0.01736532264286751,-0.012169367189584373,-0.009399422563905822\n20150803 00:00,2105300,2105300,2086500,2097900,103970825,-0.0033729216152018626,-0.017367116109238273,-0.01217088377493499,-0.009400791545009137\n20150804 00:00,2097000,2102400,2088000,2093800,75432078,-0.0019543352876686404,-0.017377836445431564,-0.012189190823123568,-0.009423143041289479\n20150805 00:00,2104000,2113100,2097300,2100700,76059680,0.0032954436908969598,-0.01727071593317157,-0.012098407610402059,-0.009341069182499426\n20150806 00:00,2102700,2104100,2076500,2083500,102560139,-0.00818774694149571,-0.0173490905307061,-0.012163704067410583,-0.009399393731186258\n20150807 00:00,2081600,2083400,2068700,2079500,100231197,-0.0019198464122870407,-0.017315754319280348,-0.012135828766216697,-0.009374429621030108\n20150810 00:00,2092900,2106700,2092800,2105700,71084411,0.012599182495792283,-0.01732430096776481,-0.01214092026059252,-0.009377679185535637\n20150811 00:00,2089600,2094700,2077600,2086700,105506895,-0.009023127701001998,-0.01742105352952694,-0.012223187612071076,-0.00945222452501129\n20150812 00:00,2071400,2091400,2053600,2089200,161327951,0.001198063928691262,-0.017409743592385677,-0.012212238569216929,-0.009441467873566195\n20150813 00:00,2087500,2095500,2080200,2086600,83612688,-0.001244495500670073,-0.017416878551261752,-0.012226838754230699,-0.00946004774301058\n20150814 00:00,2084300,2095000,2082600,2094200,64655468,0.003642288891018808,-0.01741638380844182,-0.01222744423622131,-0.009461239750776555\n20150817 00:00,2087300,2105900,2081600,2105900,72957322,0.005586858943749329,-0.017409958220657933,-0.012216109448603355,-0.009447287886892449\n20150818 00:00,2102900,2106800,2097000,2099800,64867959,-0.0028966237713091703,-0.017422047140423856,-0.012237587372328152,-0.009473771053885822\n20150819 00:00,2091000,2100100,2073500,2083200,158175490,-0.007905514810934378,-0.0174991244331349,-0.012307578976996601,-0.00953998530447776\n20150820 00:00,2065400,2071700,2039100,2039700,168829568,-0.020881336405529916,-0.01785657221579749,-0.012587693673012657,-0.009778874018156273\n20150821 00:00,2018100,2029200,1975400,1978300,302127692,-0.030102466048928744,-0.018520285292563755,-0.013095357818167357,-0.010203349055292887\n20150824 00:00,1874900,1958400,1829500,1895000,422467681,-0.04210685942475867,-0.019681083688301366,-0.013963247181066174,-0.010915089696629467\n20150825 00:00,1954500,1954500,1870600,1872700,309260532,-0.011767810026385273,-0.019806454416852186,-0.014071465367207197,-0.01101416392588096\n20150826 00:00,1922100,1947900,1883700,1944600,286850037,0.03839376301596631,-0.020458210824764785,-0.014488415081903665,-0.011305939061273359\n20150827 00:00,1970500,1994100,1952100,1992700,223431181,0.02473516404401943,-0.020680309464817567,-0.014616232358408912,-0.011383495291738438\n20150828 00:00,1985000,1998300,1979200,1992800,125935492,5.01831685653098e-05,-0.020677761431716967,-0.014613733856212178,-0.011381023194283276\n20150831 00:00,1981400,1991200,1970200,1976700,125137509,-0.008079084704937789,-0.020750878889750655,-0.01467813441807501,-0.011440776811052341\n20150901 00:00,1930700,1947600,1907300,1917700,218973748,-0.029847726007993125,-0.021323097324369097,-0.015116842084113008,-0.011808310380386735\n20150902 00:00,1946900,1954400,1924300,1954100,135717247,0.01898107107472491,-0.021429940933950984,-0.015169683674206558,-0.011832363693713401\n20150903 00:00,1962500,1980500,1949600,1955500,132209917,0.0007164423519778751,-0.021420950128608004,-0.0151608704172189,-0.011823645087096987\n20150904 00:00,1928800,1938600,1916100,1925900,156708531,-0.015136793658910741,-0.021602240848519822,-0.01531181640106294,-0.011958414404427178\n20150908 00:00,1959700,1976100,1951800,1974300,101013620,0.02513110753413983,-0.021805760887010184,-0.015423495775797188,-0.0120211338611488\n20150909 00:00,1993300,1994600,1943500,1947900,124972739,-0.013371827989667184,-0.021902003976272063,-0.015499729314475564,-0.012086700382451958\n20150910 00:00,1945000,1972200,1942500,1958500,129752786,0.005441757790441093,-0.02190303604078983,-0.015498507270670507,-0.012084276681840827\n20150911 00:00,1953200,1967600,1945400,1967400,99026646,0.004544294102629465,-0.021899207475636853,-0.015491853987849226,-0.012076117552482805\n20150914 00:00,1969500,1970000,1954400,1960100,67361661,-0.0037104808376537957,-0.021880280156947682,-0.015475936342511782,-0.012061804352872546\n20150915 00:00,1965900,1989900,1960900,1984600,101089338,0.012499362277434756,-0.02190537632871297,-0.015478566571953302,-0.012052458071591441\n20150916 00:00,1988200,2004000,1984100,2001800,87778654,0.008666733850650088,-0.0219098479190635,-0.015480414850092248,-0.012052907871697374\n20150917 00:00,1999600,2028400,1992800,1997300,222001098,-0.002247976820861197,-0.021925259153094814,-0.015495258052111008,-0.012067448257952116\n20150918 00:00,1957400,1975600,1949600,1954500,187553370,-0.021428929054223222,-0.022241269002001168,-0.015749800929737903,-0.012289223320634661\n20150921 00:00,1964500,1976800,1952200,1964600,89174988,0.005167562036326512,-0.022197382908144055,-0.01570631267751172,-0.012245947156309799\n20150922 00:00,1939000,1944600,1925700,1939100,126149228,-0.012979741423190472,-0.022270874993395137,-0.01576438646544761,-0.012295801506998905\n20150923 00:00,1941300,1946700,1929100,1936000,84630237,-0.0015986797999071323,-0.02224004298964526,-0.01573779057250647,-0.012271463869055128\n20150924 00:00,1921300,1934500,1905600,1929000,138435508,-0.003615702479338845,-0.022261098099624625,-0.015766039371672248,-0.01230354759730755\n20150925 00:00,1946100,1950000,1918100,1928500,123731291,-0.00025920165889059543,-0.022070108009181487,-0.015612427559520976,-0.012169862007003747\n20150928 00:00,1917500,1919000,1876400,1880100,140388758,-0.025097225823178637,-0.02247354761680017,-0.015936152364719562,-0.012451091145998907\n20150929 00:00,1882400,1897400,1869300,1881200,133559566,0.00058507526195406,-0.022461487236717207,-0.01592453650354285,-0.012439712256206279\n20150930 00:00,1904000,1918200,1894400,1916300,138923111,0.018658303210716598,-0.022544971138556174,-0.015959107595060255,-0.012448208109532132\n20151001 00:00,1920300,1924900,1898200,1921300,120401494,0.002609194802484005,-0.02239808586406275,-0.01583658273516602,-0.01233866969652048\n20151002 00:00,1897500,1950000,1891200,1950000,171195207,0.014937802529537247,-0.02244652821017715,-0.01585376817302637,-0.012339192192249767\n20151005 00:00,1964700,1987400,1963300,1984700,113013522,0.017794871794871714,-0.022513891186853686,-0.015893267588564814,-0.012363837646448347\n20151006 00:00,1982700,1989800,1970000,1977900,98202913,-0.0034262105104045926,-0.0225282259065718,-0.01590608454845125,-0.012375845494184644\n20151007 00:00,1988500,1998300,1974900,1994100,109575864,0.008190505081146604,-0.022352764710538937,-0.01575473674213791,-0.012237352446704597\n20151008 00:00,1989600,2015500,1985900,2012100,135414276,0.009026628554235083,-0.02228451807694876,-0.015715895334017627,-0.01221418685547488\n20151009 00:00,2014000,2019000,2005800,2013300,86171310,0.0005963918294318304,-0.02200889003402502,-0.015497199701006582,-0.012025841679522689\n20151012 00:00,2014300,2017600,2009100,2015200,49928236,0.0009437242338450336,-0.021897197743123396,-0.015404099714334821,-0.011942653181439224\n20151013 00:00,2006300,2021600,2000500,2002500,73963310,-0.006302104009527576,-0.02174620166048113,-0.015285811339947669,-0.011841801165295339\n20151014 00:00,2001600,2008700,1989400,1992900,87771536,-0.0047940074906367425,-0.021784450151985418,-0.015320784643003595,-0.011875028477508544\n20151015 00:00,2000500,2023500,1996400,2023500,115541959,0.015354508505193376,-0.021774595889710962,-0.015287303145284608,-0.011828951388001354\n20151016 00:00,2028200,2032800,2019200,2032700,99255980,0.00454657771188538,-0.021760845885571794,-0.015271298145743607,-0.011811744258755745\n20151019 00:00,2025300,2033700,2021300,2033700,69118218,0.0004919565110443891,-0.02174197187817716,-0.015271111191896048,-0.011821519304006885\n20151020 00:00,2028600,2038400,2025500,2031100,69151520,-0.0012784579829866471,-0.02174380775460114,-0.015285182893081171,-0.01184211387809625\n20151021 00:00,2036400,2037900,2016500,2018500,91935632,-0.00620353503027915,-0.021679716352405436,-0.015270108087301696,-0.011853169638491355\n20151022 00:00,2030000,2055100,2028100,2052600,150245339,0.016893732970027164,-0.021694033285264216,-0.01525232600389526,-0.011818275688289132\n20151023 00:00,2072400,2079500,2063000,2075100,122715586,0.010961707103186225,-0.021689511294632105,-0.01524989965141936,-0.011816966512759873\n20151026 00:00,2072700,2073700,2065600,2070000,60360403,-0.002457712881306917,-0.02170642449502526,-0.015273660645808644,-0.01184437804078977\n20151027 00:00,2062000,2070000,2058000,2066000,68555036,-0.0019323671497584183,-0.021709681406276774,-0.01527661192844962,-0.011847166393949378\n20151028 00:00,2070000,2089700,2062100,2089500,120529088,0.011374636979670782,-0.02170901211264756,-0.015276249825177482,-0.011846968052719906\n20151029 00:00,2083600,2092700,2082100,2088300,76891203,-0.0005743000717874924,-0.021704098715944815,-0.015271685703168753,-0.011842590127758146\n20151030 00:00,2090700,2094400,2078300,2079300,106285063,-0.004309725614135895,-0.02173802573941938,-0.015308136125703222,-0.01188038576499418\n20151102 00:00,2083600,2106200,2081800,2103900,76512481,0.011830904631366268,-0.021740892869101074,-0.015309703631467955,-0.011881260446057746\n20151103 00:00,2099800,2116600,2097000,2110000,88875760,0.0028993773468319883,-0.021735031386898723,-0.015302822870185778,-0.011873836310869726\n20151104 00:00,2113700,2114900,2097300,2103600,85726190,-0.003033175355450224,-0.02173181289025923,-0.015300040235057873,-0.011871286031900841\n20151105 00:00,2104400,2109800,2090900,2101500,70361947,-0.0009982886480319753,-0.02174323429021041,-0.015316618767728257,-0.011890613812941021\n20151106 00:00,2097400,2103200,2084700,2100400,88269574,-0.0005234356412087138,-0.021754281441756493,-0.0153296917993089,-0.011904766833671773\n20151109 00:00,2093300,2094900,2069500,2080800,116567529,-0.009331555894115384,-0.021838931844663793,-0.015401479227927442,-0.01196969705829353\n20151110 00:00,2075400,2086000,2071900,2085600,66317971,0.0023068050749712743,-0.021840128976069087,-0.015403302886610072,-0.011971854716349381\n20151111 00:00,2089000,2089400,2076700,2077400,61997358,-0.0039317222861526835,-0.021867015195473065,-0.015427909282384598,-0.011995245746583023\n20151112 00:00,2065100,2070600,2048200,2049000,108620680,-0.013670934822374137,-0.02200947860706307,-0.015543392057253998,-0.01209634524385246\n20151113 00:00,2043600,2046700,2024400,2025300,138508160,-0.011566617862371897,-0.02212495018706376,-0.015639793611956915,-0.012182580638633474\n20151116 00:00,2023000,2056500,2021900,2056500,98680096,0.015405125166642053,-0.022179401308034925,-0.01566066994164063,-0.012185558371317831\n20151117 00:00,2059700,2070300,2048800,2054000,106324660,-0.0012156576707998967,-0.02218739513301491,-0.01566847511853462,-0.012193262980615231\n20151118 00:00,2060300,2089000,2060100,2086800,102442425,0.015968841285296964,-0.022253225827577036,-0.015703169451708722,-0.012211358634746492\n20151119 00:00,2085500,2090500,2082000,2085400,76035735,-0.0006708836496071013,-0.022248394242731305,-0.015698666843141376,-0.012207031402215846\n20151120 00:00,2094700,2101200,2088600,2093800,81212191,0.004028004219813974,-0.02224545939559135,-0.015693948503992257,-0.012201362290076054\n20151123 00:00,2094000,2099800,2085300,2090900,60019105,-0.0013850415512465242,-0.022259760102566604,-0.01571211627209914,-0.01222159157416302\n20151124 00:00,2078700,2098300,2074100,2093700,87434656,0.0013391362571142373,-0.02226249456312425,-0.01571552963354181,-0.01222536685515538\n20151125 00:00,2094800,2097400,2090100,2093000,47935311,-0.00033433634236046395,-0.022263706270025115,-0.015716718948241323,-0.012226544232655203\n20151127 00:00,2094000,2098000,2088700,2095300,29568841,0.001098901098901095,-0.0222657503611744,-0.015719074321476487,-0.01222906554921852\n20151130 00:00,2097900,2098900,2085600,2086900,88383711,-0.0040089724621772405,-0.02227897891550975,-0.015730624626173795,-0.012239721185243772\n20151201 00:00,2094200,2108200,2091200,2106800,88004669,0.009535674924529225,-0.022234474415774964,-0.015680217848894413,-0.012186167925645421\n20151202 00:00,2106000,2110000,2082300,2085400,97535582,-0.010157584962977029,-0.022332102357617522,-0.01576834081585656,-0.012269223825669848\n20151203 00:00,2089000,2091500,2047600,2055800,136133021,-0.014193919631725338,-0.02249401474163914,-0.015903924831387934,-0.012390772285381288\n20151204 00:00,2061000,2099700,2059400,2096600,163843653,0.019846288549469904,-0.02259639369912909,-0.015951731644929357,-0.012409486890915719\n20151207 00:00,2092000,2092400,2072000,2082700,91156641,-0.006629781551082736,-0.022649586171082606,-0.015999064091393667,-0.012453695379475441\n20151208 00:00,2064800,2080400,2057800,2069900,88063594,-0.006145868343976568,-0.022644158005619704,-0.01599460203587254,-0.012449748353589403\n20151209 00:00,2062000,2086800,2041800,2053300,141598569,-0.008019711097154492,-0.022703881211249995,-0.01604536464968104,-0.01249573410905437\n20151210 00:00,2054400,2074300,2051500,2058600,104748495,0.0025812107339404644,-0.022509861463282103,-0.01588654536108635,-0.012355680055100132\n20151211 00:00,2033800,2041400,2015100,2018800,179403932,-0.019333527640143733,-0.02277306714720077,-0.016101243469527255,-0.012544518954545237\n20151214 00:00,2021000,2030000,1999700,2030000,149245578,0.00554785020804438,-0.02257767277326864,-0.015937913013130012,-0.012398281653940515\n20151215 00:00,2046900,2061100,2045500,2050600,136119948,0.010147783251231557,-0.022532038800438577,-0.015885577814736894,-0.012342374056996109\n20151216 00:00,2063700,2083900,2048300,2080200,173480390,0.01443479957085736,-0.0225064110673276,-0.015841296419093966,-0.012288148462881092\n20151217 00:00,2083700,2084800,2048400,2048600,153094246,-0.015190847033939026,-0.022576685832912367,-0.015931493833909453,-0.012388966568282183\n20151218 00:00,2027700,2028900,1999800,2000200,210818406,-0.02362589085228939,-0.02273785230615924,-0.01610200430349614,-0.012564458287742263\n20151221 00:00,2014300,2018800,2000900,2017000,85939272,0.008399160083991664,-0.02272606089928116,-0.01608103694575994,-0.012538599264557145\n20151222 00:00,2027000,2038500,2015500,2035600,94477624,0.009221616261774868,-0.02273740863415366,-0.01608476330071673,-0.012538262690082074\n20151223 00:00,2047000,2060700,2045800,2060500,100768218,0.012232265671055176,-0.022764347915993573,-0.016091159894849737,-0.012533708053412135\n20151224 00:00,2057200,2063300,2054300,2056500,37303088,-0.001941276389225921,-0.022774964247103624,-0.01610125865274638,-0.012543530894943875\n20151228 00:00,2048600,2052500,2039500,2052200,61014906,-0.0020909311937757913,-0.02279299307314967,-0.016119960885386846,-0.012562592118148036\n20151229 00:00,2065300,2077900,2064700,2074000,82484583,0.010622746321021337,-0.022808621437529653,-0.016120223789380262,-0.012554663752065811\n20151230 00:00,2070900,2072100,2057600,2059300,56653819,-0.007087753134040531,-0.022825607520265724,-0.016134235330831692,-0.012567089576565018\n20151231 00:00,2051700,2058900,2038900,2038900,88561987,-0.00990627883261297,-0.02282279540328258,-0.016132003671623554,-0.012565167357248882\n20160104 00:00,2005300,2010300,1985900,2010100,194050675,-0.014125263622541517,-0.0229712905869619,-0.016253022202287817,-0.012671538185862\n20160105 00:00,2013900,2019000,2000500,2013500,95287082,0.0016914581364111392,-0.02274449658508228,-0.016069932559578278,-0.012511747175307866\n20160106 00:00,1983300,2000500,1976000,1988500,125322778,-0.012416190712689401,-0.022784879859347552,-0.01610174160853142,-0.012538985336474105\n20160107 00:00,1953200,1974300,1935900,1939900,186961947,-0.024440533065124503,-0.0231377247927014,-0.01639411973160835,-0.012799128826736268\n20160108 00:00,1952100,1958500,1915800,1919500,167303627,-0.010516005979689713,-0.02314937341763941,-0.016435208958859165,-0.012855912730141701\n20160111 00:00,1930500,1934000,1898300,1921100,170857466,0.0008335504037508823,-0.023082793776086716,-0.01637751013362418,-0.01280294823522422\n20160112 00:00,1938500,1945500,1911400,1936600,149409008,0.008068294206444282,-0.023027108937082666,-0.016319991231967743,-0.012744451601554331\n20160113 00:00,1945300,1948600,1883800,1888700,188087693,-0.024734070019622023,-0.023393119813309528,-0.016604263901202343,-0.012985149935095242\n20160114 00:00,1895500,1932600,1876600,1918900,190012996,0.0159898342775453,-0.023414704717152773,-0.016594379711132402,-0.012958489687504501\n20160115 00:00,1867900,1887600,1855200,1878300,270477512,-0.021157955078430324,-0.02362035438956883,-0.016752984022295265,-0.013092014290664084\n20160119 00:00,1899500,1901100,1862100,1880600,162816196,0.0012245115263802564,-0.023584637017872744,-0.016741847509918823,-0.013093981743434993\n20160120 00:00,1850000,1874900,1810200,1858100,227085634,-0.01196426672338613,-0.02370132704870209,-0.016840856379180844,-0.013183564850890643\n20160121 00:00,1861900,1888700,1846500,1867000,146780065,0.0047898390829341775,-0.023701283489587843,-0.016840895010410892,-0.013183647297489106\n20160122 00:00,1897800,1907600,1888800,1905500,138442684,0.020621317621853263,-0.023775099630215134,-0.016886232299751454,-0.013213802616588308\n20160125 00:00,1899100,1901500,1874100,1876300,106621985,-0.015324061926003663,-0.023907407117568977,-0.016991501720865877,-0.013304658144638793\n20160126 00:00,1884400,1905300,1880300,1902400,122035268,0.01391035548686248,-0.023950030647253227,-0.017008133890349438,-0.01330743441617456\n20160127 00:00,1895800,1915600,1870600,1881400,146285880,-0.011038687973086603,-0.023922800997318455,-0.016986718307167265,-0.013289118290464547\n20160128 00:00,1900000,1902000,1871700,1891700,112813076,0.005474646539810779,-0.023788565478748174,-0.016870251355395476,-0.013182123695904442\n20160129 00:00,1900300,1938700,1898800,1938700,168702015,0.024845377173970506,-0.02396974217793989,-0.016980332338092305,-0.013254303815211584\n20160201 00:00,1925000,1945800,1918500,1936500,110539586,-0.00113478103884046,-0.023854303133077272,-0.016885413211818925,-0.013170323781608779\n20160202 00:00,1919000,1919600,1895400,1901100,155214611,-0.018280402788536043,-0.024055763136060955,-0.017063268703503123,-0.013335595795662417\n20160203 00:00,1913700,1917800,1871100,1912300,163410140,0.005891326074378034,-0.024008343139431357,-0.01703981933362879,-0.013324925078213383\n20160204 00:00,1907200,1927400,1899600,1915300,108163692,0.00156879150760858,-0.02398257399911696,-0.01701534889934076,-0.013301146979302444\n20160205 00:00,1909700,1910800,1872000,1879800,146276261,-0.018534955359473693,-0.02419721194521328,-0.017200733276826505,-0.013470936387608157\n20160208 00:00,1857500,1861200,1828100,1853500,154383523,-0.013990850090435103,-0.024320673130125182,-0.01730062631443444,-0.013558265333096984\n20160209 00:00,1833800,1869300,1832100,1853500,146059137,0.0,-0.024296041520173523,-0.01727812000768239,-0.013536892017616438\n20160210 00:00,1864400,1883200,1851200,1853100,117266734,-0.00021580793094144735,-0.02428567706811921,-0.01728319979471121,-0.01355020507135254\n20160211 00:00,1823800,1841000,1810900,1830300,163939145,-0.012303707301278943,-0.024400679783600446,-0.017379715328638332,-0.013636865157200827\n20160212 00:00,1849300,1866500,1839700,1866500,104243751,0.01977817844069274,-0.024498101128381855,-0.017436785017540823,-0.01367242352766651\n20160216 00:00,1887800,1898100,1876400,1898100,96542669,0.01693008304312893,-0.024571766463464255,-0.017473974696814894,-0.013690168169799136\n20160217 00:00,1911200,1933200,1910100,1928700,118038289,0.016121384542437278,-0.02463287898439815,-0.017500549447183995,-0.01369833096247941\n20160218 00:00,1932200,1932600,1917200,1920500,90826534,-0.004251568413957574,-0.024656467642223175,-0.017522114968776873,-0.013718817957633096\n20160219 00:00,1911500,1921800,1904500,1920000,98439467,-0.00026034886748238506,-0.02465417746130404,-0.017519857951746338,-0.01371657862014886\n20160222 00:00,1939000,1949500,1938000,1948300,88924304,0.01473958333333325,-0.024701470344814007,-0.017543359060277805,-0.01372739642147541\n20160223 00:00,1939900,1943200,1921800,1923300,94280136,-0.012831699430272514,-0.024819978364184342,-0.01764157208883261,-0.013814790265523506\n20160224 00:00,1906200,1935300,1893200,1932300,125633728,0.004679457182966695,-0.024819379246130372,-0.01763912144251084,-0.013811352576333343\n20160225 00:00,1937300,1955500,1928300,1955500,98561286,0.012006417222998556,-0.024834136727811786,-0.017634500844250212,-0.013796401595359843\n20160226 00:00,1965200,1966800,1949000,1951000,111611131,-0.002301201738685754,-0.024840260467690608,-0.01764018732434936,-0.013801854973888434\n20160229 00:00,1950800,1962300,1934400,1935600,101903944,-0.007893388006150692,-0.02487954619132987,-0.01767323556206481,-0.013831578030938313\n20160301 00:00,1950500,1982100,1944600,1982100,120346342,0.02402355858648475,-0.025047376300328005,-0.01777131284527425,-0.01389247034082447\n20160302 00:00,1977000,1990600,1972500,1990300,89104136,0.004137026386156206,-0.02501617618723288,-0.01773967265634925,-0.013860595549102964\n20160303 00:00,1987000,1997900,1981100,1997700,89517942,0.0037180324574184187,-0.02498337691249581,-0.01770714893676691,-0.013828218726953985\n20160304 00:00,2000000,2013500,1990300,2003600,106711620,0.0029533964058667816,-0.024980410489130342,-0.017703277271471557,-0.013823864480535453\n20160307 00:00,1994000,2010700,1992700,2006300,83187387,0.001347574366140858,-0.024831700373148687,-0.01757994274818192,-0.013714057591813253\n20160308 00:00,1993000,1999200,1982200,1983600,108213232,-0.011314359766734783,-0.02493981969898145,-0.01767435972127777,-0.01380116989136753\n20160309 00:00,1993600,1997900,1984300,1994100,80085909,0.005293405928614714,-0.02475555346261899,-0.017519173894487903,-0.013661486723315287\n20160310 00:00,1999000,2010500,1973800,1995400,128146107,0.0006519231733614905,-0.024741004619607276,-0.01750529389930491,-0.013647963288434862\n20160311 00:00,2012500,2028100,2011300,2027600,115060016,0.016137115365340238,-0.024769536034426512,-0.017521658295693035,-0.013657841492318681\n20160314 00:00,2022000,2030300,2017700,2025300,64367388,-0.0011343460248569581,-0.024733057705365814,-0.01748994488657643,-0.013628668244392756\n20160315 00:00,2013200,2022000,2010600,2022000,83697700,-0.00162938823877945,-0.024713343409963055,-0.017493712988241997,-0.013644954725044105\n20160316 00:00,2016200,2038200,2015600,2033900,112017848,0.005885262116716028,-0.024688927607595085,-0.0174659865545463,-0.013615463406037847\n20160317 00:00,2032600,2052200,2027700,2047900,116797254,0.006883327597227096,-0.024668800581141855,-0.017457335497277827,-0.013612930145477525\n20160318 00:00,2042000,2047800,2038000,2045200,118003097,-0.0013184237511597585,-0.024649193051202938,-0.01743992193894434,-0.013596686185288588\n20160321 00:00,2041100,2049400,2038100,2046900,65685245,0.0008312145511442104,-0.024655029835440524,-0.017448353994382663,-0.013606501770200806\n20160322 00:00,2037400,2052300,2035700,2046200,83178482,-0.0003419805559626843,-0.02464602912107088,-0.017439901839315104,-0.013598342050067373\n20160323 00:00,2041100,2043300,2030100,2032200,69049169,-0.006841950933437646,-0.024657506280643535,-0.01744943841675434,-0.013606844110351969\n20160324 00:00,2019800,2031600,2017400,2031100,71333708,-0.0005412853065642764,-0.024507667885111592,-0.017327089039482973,-0.013499149026998373\n20160328 00:00,2036200,2038500,2027100,2032700,53066451,0.0007877504800355428,-0.024492841852981485,-0.017312922129259358,-0.013485333492224175\n20160329 00:00,2027500,2052300,2024100,2052300,83887128,0.009642347616470648,-0.02450211939292703,-0.01731099110968699,-0.013477427231047568\n20160330 00:00,2063500,2068700,2055900,2061000,76192165,0.0042391463236368665,-0.024477034223662025,-0.01730239505789939,-0.01347762146677289\n20160331 00:00,2058700,2064100,2053300,2055600,76146466,-0.0026200873362445254,-0.024422546444908513,-0.017256810876400932,-0.013436783760025339\n20160401 00:00,2043500,2071400,2039900,2069100,92124925,0.006567425569176777,-0.024395425916185074,-0.017225889768846925,-0.01340383657795995\n20160404 00:00,2068400,2070700,2058900,2062900,56532432,-0.002996471895993391,-0.024420045618774314,-0.017250736528911504,-0.013428804381524452\n20160405 00:00,2046400,2052500,2039000,2041400,81083900,-0.01042222114499003,-0.024515766932083686,-0.017338642688051596,-0.01351254431089513\n20160406 00:00,2042700,2064900,2039800,2064600,80656346,0.011364749681590958,-0.024513409367842076,-0.017320632248704428,-0.013486189381749135\n20160407 00:00,2051800,2055600,2030900,2038900,102193798,-0.012447931802770484,-0.02463944540972109,-0.017428367187589684,-0.01358416807034754\n20160408 00:00,2053200,2058400,2038800,2044800,85480012,0.0028937172004512846,-0.024640566617931303,-0.01743082553770401,-0.013587339245863162\n20160411 00:00,2052300,2060700,2039100,2039900,73916328,-0.0023963223787167864,-0.024660890080911883,-0.01745432426050939,-0.013612530687931801\n20160412 00:00,2042000,2062500,2037000,2059900,100704771,0.009804402176577298,-0.0246356694776799,-0.0174195604134676,-0.013572679372927639\n20160413 00:00,2070200,2081000,2068400,2080400,85422095,0.00995193941453465,-0.024645709944025932,-0.01741748162210963,-0.013564139850132256\n20160414 00:00,2080300,2086000,2076000,2080200,55930929,-9.61353585848812e-05,-0.024655175367925105,-0.017429724076354385,-0.013577862728978462\n20160415 00:00,2080000,2081100,2074000,2078000,69798928,-0.001057590616286852,-0.02465849806973569,-0.017432916208880024,-0.013580985255501441\n20160418 00:00,2071100,2092700,2070000,2092500,69184743,0.006977863330125178,-0.0245478951240759,-0.01733323151995505,-0.013487121048841238\n20160419 00:00,2097000,2102000,2089400,2099100,81005196,0.003154121863799375,-0.024540355960754746,-0.017334686491444373,-0.013493370760317251\n20160420 00:00,2099000,2109200,2094000,2100700,68129528,0.0007622314325186341,-0.02453213225044677,-0.017326600903334814,-0.01348535880464058\n20160421 00:00,2101300,2102500,2086600,2089000,66185715,-0.0055695720474128185,-0.024577094176450133,-0.017370744927200754,-0.013529066807903521\n20160422 00:00,2085300,2092900,2079200,2089600,81454081,0.0002872187649594071,-0.024583399997612363,-0.017377904658466906,-0.013536681755486373\n20160425 00:00,2082800,2086200,2075400,2085900,54918433,-0.0017706738131699762,-0.024598383033455257,-0.01739308865985497,-0.013551972890862934\n20160426 00:00,2090200,2095200,2083700,2090000,67103310,0.001965578407402191,-0.02456632243899072,-0.01736302760743903,-0.013522977786914248\n20160427 00:00,2084600,2098100,2080600,2093800,65535983,0.0018181818181817189,-0.024568926488623837,-0.017366616544023678,-0.013527091763088403\n20160428 00:00,2084900,2097600,2069700,2074200,80393263,-0.009360970484286968,-0.02461930808468099,-0.017408117909308643,-0.013563859110208014\n20160429 00:00,2067100,2071300,2050300,2063000,110829381,-0.005399672162761493,-0.02457566496640812,-0.017372438277496356,-0.013532424783560775\n20160502 00:00,2069000,2081800,2064100,2080300,55377797,0.008385845855550134,-0.024566293308512822,-0.017368328439236202,-0.013531120001877932\n20160503 00:00,2065000,2067900,2052800,2061300,89754991,-0.009133298082007357,-0.02464708377041685,-0.017439765178545317,-0.013597570306283046\n20160504 00:00,2050000,2058300,2044200,2049600,74239405,-0.005676029690001472,-0.02457766004221246,-0.017383694026852366,-0.01354861736372013\n20160505 00:00,2055700,2059800,2044700,2049500,57183088,-4.8790007806442937e-05,-0.024553394031042352,-0.017361696819725953,-0.013527829647634215\n20160506 00:00,2040400,2057700,2038800,2057000,70502951,0.0036594291290559244,-0.024553593877429777,-0.017362221960488373,-0.013528528201624266\n20160509 00:00,2055800,2064000,2053700,2058900,60302710,0.0009236752552259642,-0.024524876494569758,-0.017356315791794336,-0.013534782606794332\n20160510 00:00,2066400,2084600,2066400,2084600,65978296,0.012482393511098255,-0.02451369046906778,-0.01732812897717678,-0.01349753273440687\n20160511 00:00,2078900,2083300,2065000,2065000,72657913,-0.009402283411685697,-0.024574350764721104,-0.017378526770002106,-0.013542459624948678\n20160512 00:00,2072900,2074800,2053700,2065500,77898879,0.0002421307506053072,-0.024574862476253755,-0.017379049997809218,-0.01354298899203909\n20160513 00:00,2062300,2068600,2043800,2047200,83635846,-0.008859840232389282,-0.024637297046715214,-0.017445613619897334,-0.013611753796270748\n20160516 00:00,2049500,2073400,2048900,2068100,68003049,0.010209066041422465,-0.024646278451411593,-0.01744113670375237,-0.013600102299084756\n20160517 00:00,2064400,2068000,2042300,2048200,100223310,-0.009622358686717236,-0.024732269613043634,-0.017516734497328837,-0.013670159426609124\n20160518 00:00,2044400,2063000,2036400,2049100,102872425,0.00043941021384630297,-0.02472932678283614,-0.01751376109230195,-0.013667169722259153\n20160519 00:00,2040000,2045400,2027800,2042400,104044038,-0.003269728173344366,-0.024743737575687114,-0.017526932772728546,-0.013679680836437372\n20160520 00:00,2049500,2060900,2048600,2054900,90968053,0.006120250685468065,-0.02474397124726113,-0.017523368961223577,-0.013674092600754728\n20160523 00:00,2054800,2058400,2049900,2051600,52302088,-0.0016059175628984068,-0.024739840404256988,-0.017519592640538213,-0.013670505274605681\n20160524 00:00,2061500,2082400,2061400,2078700,84293252,0.013209202573601031,-0.024671454947778726,-0.017443386873545044,-0.013590130529014312\n20160525 00:00,2086400,2097700,2086200,2092600,71874969,0.006686871602443745,-0.024663550186096467,-0.017440837690256276,-0.013590436384750002\n20160526 00:00,2094700,2097100,2089700,2093400,48058849,0.0003822995316831168,-0.024658651525126515,-0.01743600041137388,-0.013585631828431347\n20160527 00:00,2095500,2102100,2094700,2102100,53233980,0.004155918601318476,-0.024605788253145244,-0.01738629743024593,-0.01353761358666336\n20160531 00:00,2105300,2106900,2091800,2100800,87775464,-0.0006184291898577721,-0.024614541231006835,-0.017395462636894825,-0.013546998550953405\n20160601 00:00,2091500,2104800,2088900,2103000,64263039,0.0010472201066260567,-0.024607782419392047,-0.01738864211442962,-0.013540145130662191\n20160602 00:00,2098000,2109200,2092400,2109200,56601095,0.0029481692819781635,-0.024607070922391172,-0.01738762644431764,-0.013538967306990205\n20160603 00:00,2103200,2106900,2088600,2102800,89799792,-0.003034325810733929,-0.024565519787827478,-0.017352723852067625,-0.013507609028046173\n20160606 00:00,2107100,2117600,2105100,2113900,57500239,0.005278676050979536,-0.02454408946979548,-0.017328615532485447,-0.01348207307574694\n20160607 00:00,2115600,2123400,2115000,2117000,52942760,0.001466483750413916,-0.02449801915952077,-0.01728724284619793,-0.01344320467542449\n20160608 00:00,2118000,2125200,2116900,2123900,57416846,0.0032593292394897944,-0.02448918928630548,-0.0172771549706386,-0.013432446163470507\n20160609 00:00,2114900,2122200,2111900,2120400,72933317,-0.0016479118602570342,-0.024483302182862,-0.017288737279646277,-0.01345334135161426\n20160610 00:00,2104300,2108600,2094400,2100300,100123152,-0.0094793435200905,-0.024569134987497285,-0.017364192577067006,-0.01352326443833854\n20160613 00:00,2093400,2103700,2083500,2084200,99528764,-0.007665571585011688,-0.02456924956715313,-0.017364286032254057,-0.013523346632149444\n20160614 00:00,2079700,2087400,2069200,2080900,112987135,-0.0015833413300067045,-0.024551501001526574,-0.017348595609324894,-0.013508753397476566\n20160615 00:00,2085700,2092000,2075300,2077800,94632612,-0.0014897400163390584,-0.024567122545567477,-0.01736771017034559,-0.013529730072924065\n20160616 00:00,2067400,2085700,2055900,2083500,139759122,0.0027432861680622977,-0.024564796758627005,-0.017364756566019286,-0.01352644178147247\n20160617 00:00,2071400,2072000,2057500,2065300,108517057,-0.00873530117590593,-0.02462634241167058,-0.017430516398976928,-0.01359444817814868\n20160620 00:00,2088400,2096000,2077500,2079100,74625875,0.006681837989638284,-0.02454549029234503,-0.01735481932337291,-0.013521499237277523\n20160621 00:00,2082600,2089200,2077900,2084100,66630510,0.002404886729834965,-0.024547276464685106,-0.017359242119308883,-0.013527327607496236\n20160622 00:00,2086900,2094900,2079400,2080300,90582991,-0.0018233290149225478,-0.024558527657229837,-0.01737013985042103,-0.013538036909626579\n20160623 00:00,2098300,2108700,2092700,2108700,86757627,0.013651877133105783,-0.024533780764047188,-0.01732832950439666,-0.013487130100031762\n20160624 00:00,2040000,2069000,2027200,2031300,294018070,-0.03670507895860009,-0.025246878692062453,-0.01787166293916912,-0.013939962711631884\n20160627 00:00,2015900,2015900,1986500,1995300,216490003,-0.0177226406734603,-0.025448997489595938,-0.018034952561908162,-0.014082552644966648\n20160628 00:00,2016600,2032200,2011200,2032200,145242853,0.018493459630130715,-0.025252815181170774,-0.01785036501630458,-0.013904146224519435\n20160629 00:00,2048300,2069300,2047200,2067100,122034443,0.017173506544631456,-0.025316038190011138,-0.01787753656770694,-0.013912098877361924\n20160630 00:00,2071800,2095400,2065600,2095300,140612123,0.013642300807895191,-0.025344980821962237,-0.017891459558695193,-0.013918014953329689\n20160701 00:00,2092900,2104900,2092900,2097900,92251985,0.0012408724287691353,-0.025336532749902302,-0.01788297937775657,-0.013909517655266648\n20160705 00:00,2089000,2090800,2077100,2083900,99629966,-0.006673340006673301,-0.025367475354531495,-0.017909306716411704,-0.013933384612708771\n20160706 00:00,2078700,2098000,2070600,2097700,87769094,0.006622198761936815,-0.025367949064395517,-0.01790925396753308,-0.013933051210622487\n20160707 00:00,2098900,2106400,2086300,2095400,76391364,-0.0010964389569528832,-0.02518511631179744,-0.01776175266138596,-0.013804384967842281\n20160708 00:00,2110000,2129400,2107800,2127000,114482147,0.015080652858642685,-0.025225591813157512,-0.01777494297275417,-0.013803029645388553\n20160711 00:00,2131600,2140700,2129500,2134500,67609333,0.0035260930888576514,-0.02520101968169887,-0.01776810754842861,-0.013805649594004933\n20160712 00:00,2145100,2153000,2142500,2150000,91585333,0.007261653783087407,-0.025187158532514676,-0.017762695989063153,-0.013804742479706035\n20160713 00:00,2154200,2154500,2143500,2149300,77887465,-0.000325581395348884,-0.025198290215373325,-0.01777598812743059,-0.01381918634891093\n20160714 00:00,2163400,2166600,2156600,2161100,81647966,0.00549015958684218,-0.02518721742872334,-0.01776139060224611,-0.013802709798656214\n20160715 00:00,2167900,2168200,2153100,2158400,88704013,-0.0012493637499421117,-0.025198413577400932,-0.017780087382247907,-0.013825405137462544\n20160718 00:00,2159500,2166000,2156700,2164100,48647808,0.002640845070422504,-0.025193765491439264,-0.017774716614140255,-0.013819649110176989\n20160719 00:00,2158800,2162300,2156500,2161800,43905369,-0.001062797467769494,-0.02520057726986388,-0.017781370207652754,-0.013826218375898166\n20160720 00:00,2167500,2173700,2162400,2171300,52553592,0.004394486076417792,-0.025168023565674456,-0.017748651174613758,-0.013793411206661227\n20160721 00:00,2169200,2172200,2157500,2162200,63005168,-0.004191037627227945,-0.02518395254383577,-0.017762699679158257,-0.013806457237678866\n20160722 00:00,2163900,2173000,2161000,2172500,52576045,0.004763666635833941,-0.02513737345503437,-0.017717683347535183,-0.013762274006124927\n20160725 00:00,2170000,2170600,2159700,2166400,49718650,-0.0028078250863060594,-0.02506356062322159,-0.017656700383079604,-0.013708130596483428\n20160726 00:00,2165300,2171700,2157600,2167500,64796484,0.0005077548005907317,-0.025022880114015825,-0.01762058428119022,-0.01367444776324484\n20160727 00:00,2171700,2172700,2156200,2165100,73524223,-0.0011072664359861317,-0.025014598220951603,-0.017630294497423,-0.013693749506368091\n20160728 00:00,2162600,2171100,2157500,2168000,59237051,0.001339430049420276,-0.025017962421034514,-0.017639112935353383,-0.013705475578312781\n20160729 00:00,2164500,2175400,2161300,2171500,68771465,0.0016143911439114866,-0.02501338467743691,-0.01763427529014949,-0.013700499380524282\n20160801 00:00,2171500,2176500,2164100,2169300,65459572,-0.0010131245682707402,-0.02501075844424701,-0.01763183162830612,-0.01369815304679018\n20160802 00:00,2166400,2168300,2145800,2155200,86422053,-0.006499792559811923,-0.025036835153089104,-0.017653904207776187,-0.013718091039708403\n20160803 00:00,2154500,2162400,2151300,2162300,46176692,0.003294357832219763,-0.025018225477545446,-0.017634644639859625,-0.01369848501657263\n20160804 00:00,2163000,2167800,2158300,2164300,40200895,0.0009249410350089526,-0.0250237211358202,-0.01764128603863967,-0.013705737205376487\n20160805 00:00,2171900,2182300,2170700,2181400,61991590,0.00790093794760427,-0.02495502751249304,-0.017574013096564797,-0.013639221623220297\n20160808 00:00,2183900,2185200,2177400,2180500,36959153,-0.00041257907765657187,-0.024947227550311295,-0.01756674592770798,-0.01363223848451352\n20160809 00:00,2181200,2187600,2178000,2182200,48239720,0.0007796376977757813,-0.024928638915035623,-0.0175673427903868,-0.013643063065160253\n20160810 00:00,2182900,2184000,2172300,2176300,51678201,-0.002703693520300643,-0.024870594980258363,-0.017518956351389354,-0.01359982500142763\n20160811 00:00,2182500,2189400,2179500,2186800,65858201,0.004824702476680542,-0.024864861887685365,-0.017510686835819862,-0.013590203328144168\n20160812 00:00,2182600,2187100,2179900,2184100,48330938,-0.0012346808121456165,-0.02486481047360121,-0.017510639073866078,-0.013590157513127572\n20160815 00:00,2188900,2195000,2188800,2190900,43891571,0.0031134105581245297,-0.024865483061941886,-0.017511729442774723,-0.013591470599311099\n20160816 00:00,2185600,2186800,2179600,2179600,48785828,-0.005157697749783141,-0.024908132941648817,-0.017554375587429054,-0.013634114752822708\n20160817 00:00,2179800,2185300,2170200,2183800,69540455,0.0019269590750596866,-0.02488613680093328,-0.017533215789587255,-0.013613400806272198\n20160818 00:00,2183100,2189000,2182200,2189000,49012060,0.002381170436853264,-0.024818825341518337,-0.01747366484399066,-0.013557986961876125\n20160819 00:00,2183400,2187500,2177400,2185600,68512765,-0.001553220648698006,-0.024550081977323977,-0.01726118014086818,-0.01337549354279852\n20160822 00:00,2182500,2188000,2178300,2185100,56032026,-0.0002287701317715829,-0.0240255118578988,-0.01685555303234343,-0.013033274513262878\n20160823 00:00,2192300,2196000,2189000,2189300,49279171,0.0019221088279712806,-0.023037110830202837,-0.016105517135372067,-0.012410310185464143\n20160824 00:00,2188000,2189100,2173600,2178800,62792016,-0.004796053533092759,-0.022952707091428683,-0.01603773457660065,-0.012351388316249247\n20160825 00:00,2174000,2181900,2172200,2176600,61431694,-0.0010097301266752678,-0.022447701074727537,-0.0157264739715269,-0.012143412673202653\n20160826 00:00,2179000,2191100,2162500,2172800,116455917,-0.001745842139116105,-0.022276096468200578,-0.015635923990612567,-0.012096072613277968\n20160829 00:00,2174300,2186600,2174000,2183400,60888768,0.0048784977908689076,-0.022266413961893477,-0.015623465096922702,-0.01208213363774775\n20160830 00:00,2182500,2185900,2173500,2179800,52513386,-0.0016488046166529546,-0.022208550827888127,-0.015575077637241393,-0.012038797624985987\n20160831 00:00,2176400,2177500,2164700,2174400,71308010,-0.002477291494632494,-0.021661709666303933,-0.015156613700129438,-0.011688771111209079\n20160901 00:00,2173800,2177300,2160300,2173700,89011329,-0.00032192788815310625,-0.02157230587516786,-0.015115839817806,-0.011673921653329597\n20160902 00:00,2183600,2188700,2177000,2183600,70476391,0.00455444633574098,-0.021565185649269264,-0.015106343815092543,-0.011663159132787166\n20160906 00:00,2187200,2190900,2178600,2190900,48541412,0.0033431031324417937,-0.021375591784891658,-0.014950808125361065,-0.01152577972993491\n20160907 00:00,2188400,2192200,2183100,2190100,72763936,-0.00036514674334753305,-0.021176999414144793,-0.014840031578776981,-0.011461817474269258\n20160908 00:00,2186000,2189400,2181600,2185100,66880396,-0.0022830007762202342,-0.021041016084615585,-0.01473099343381517,-0.011367143707495721\n20160909 00:00,2170000,2170200,2132500,2133200,199753948,-0.0237517733742163,-0.02143548017989134,-0.01504383787367873,-0.01163647701107425\n20160912 00:00,2123900,2168100,2123100,2164000,158990452,0.014438402400150041,-0.02148490222801537,-0.015067280188827789,-0.011646069626706522\n20160913 00:00,2148500,2151400,2125000,2132400,166172973,-0.014602587800369715,-0.021630341110197626,-0.015182775236197987,-0.011745601726538851\n20160914 00:00,2132900,2146900,2125000,2131500,122562929,-0.00042205965109731736,-0.021609532858774694,-0.015183083624913392,-0.011757167317974618\n20160915 00:00,2130000,2157300,2127600,2152800,125570649,0.009992962702322306,-0.021615997655513548,-0.01518611286560642,-0.011758365076452122\n20160916 00:00,2135000,2136900,2125800,2133700,139164920,-0.008872166480862087,-0.021680512889421827,-0.015239429136076371,-0.01180571122095235\n20160919 00:00,2141000,2148700,2130300,2134100,75239623,0.00018746777897549194,-0.02136094439812063,-0.014988348232076381,-0.01159114079631969\n20160920 00:00,2144300,2145900,2133800,2134200,62864323,4.6858160348550726e-05,-0.021369969664818727,-0.015000682319693334,-0.011605238804124937\n20160921 00:00,2142200,2160300,2134400,2158200,102931692,0.01124543154343538,-0.021242886924918446,-0.014882666580307452,-0.011492056649162882\n20160922 00:00,2169900,2175300,2167100,2171800,69951017,0.0063015475859513614,-0.021226182944150882,-0.014861672075314436,-0.0114687748815814\n20160923 00:00,2167300,2168800,2158800,2159900,63444583,-0.005479325904779397,-0.021242904304362563,-0.014875661412817681,-0.011481307787888011\n20160926 00:00,2150200,2152300,2140100,2142400,80230788,-0.008102226954951663,-0.021310233619933304,-0.01493238426801398,-0.011532376378305521\n20160927 00:00,2140300,2156800,2136200,2155700,68564482,0.006207991038088112,-0.020874744929760547,-0.014588078422323689,-0.011236679769607186\n20160928 00:00,2158100,2168200,2147100,2166400,79072162,0.004963584914412955,-0.020866958917384548,-0.01457748334339421,-0.01122458718769237\n20160929 00:00,2163900,2168700,2140500,2146800,115706725,-0.00904726735598227,-0.020858107720852826,-0.014603432352572613,-0.011269088057764491\n20160930 00:00,2156700,2171200,2153600,2163000,96329808,0.00754611514812753,-0.020861313639001806,-0.014599960018846246,-0.011262055572674746\n20161003 00:00,2158100,2160400,2150400,2157800,75146488,-0.00240406842348595,-0.020828619150307686,-0.014597002897055409,-0.0112749513311436\n20161004 00:00,2158600,2161700,2139900,2146800,114252574,-0.005097784780795256,-0.020780941493585937,-0.014589904565646272,-0.011289485687903935\n20161005 00:00,2153700,2161300,2153300,2156300,63422919,0.004425190981926619,-0.020750835562257017,-0.014559490916892858,-0.01125890799613016\n20161006 00:00,2153900,2160400,2147400,2157800,56891266,0.0006956360432222031,-0.020749403661658145,-0.014567191151370484,-0.011271476538025654\n20161007 00:00,2160600,2163000,2141900,2150400,79463848,-0.0034294188525350044,-0.02076738629490511,-0.014594385800760161,-0.01130358207913401\n20161010 00:00,2161400,2167000,2159900,2161600,46875472,0.005208333333333259,-0.020761296323059064,-0.014584718553314016,-0.011292007799302358\n20161011 00:00,2156400,2157400,2125800,2134300,119387206,-0.012629533678756522,-0.020900198700845245,-0.014698708734103777,-0.01139271738005532\n20161012 00:00,2136100,2143200,2130100,2137100,66340623,0.0013119055428010284,-0.020848419165794163,-0.014653246640950057,-0.01135062309180081\n20161013 00:00,2121500,2135900,2112100,2130100,91466314,-0.0032754667540124682,-0.02083567720624671,-0.014642472107816499,-0.011340897386408479\n20161014 00:00,2141400,2146900,2130300,2131200,80852248,0.0005164076803905182,-0.020778328201692342,-0.01461917231857491,-0.011335749107858655\n20161017 00:00,2130700,2133800,2121700,2123800,53226160,-0.00347222222222221,-0.020807627968951328,-0.014649210563793301,-0.011366181032944634\n20161018 00:00,2142400,2142900,2132700,2137100,66888708,0.00626235992089641,-0.0208033698101748,-0.014639491813685958,-0.011353551261804524\n20161019 00:00,2140000,2146400,2136000,2142800,57783289,0.0026671657854100417,-0.02078952744160935,-0.014625117786665106,-0.011338893809628381\n20161020 00:00,2138500,2145300,2131100,2138800,68059264,-0.0018667164457718544,-0.0207532145686481,-0.014594401141350393,-0.011311160492564455\n20161021 00:00,2129500,2140800,2127600,2139800,78690483,0.00046755189826064303,-0.02067568526990024,-0.014558678911806231,-0.011297725456915108\n20161024 00:00,2149800,2153100,2144800,2148900,51206007,0.004252733900364625,-0.02065087551337856,-0.014548936147810141,-0.011296014850882387\n20161025 00:00,2147000,2149800,2139800,2141700,58851733,-0.0033505514449253537,-0.02065726585675107,-0.014554492376381251,-0.011301126415939321\n20161026 00:00,2132200,2144200,2129300,2137400,72529547,-0.0020077508521267884,-0.020657732358434655,-0.014554909850624187,-0.011301517753835066\n20161027 00:00,2145700,2146200,2130900,2131700,68426767,-0.002666791428838744,-0.020652224682581894,-0.014567338562520895,-0.01132350828767144\n20161028 00:00,2131300,2139300,2117200,2125400,130649200,-0.002955387718722169,-0.02066631777264403,-0.014580071114930438,-0.011335515542492751\n20161031 00:00,2129500,2131900,2123700,2125500,54590230,4.704996706506037e-05,-0.020638854703214367,-0.014555588559129693,-0.01131262188747886\n20161101 00:00,2129000,2129900,2096000,2110100,114185217,-0.0072453540343448974,-0.020670860389887,-0.014600394154740756,-0.01136425106718181\n20161102 00:00,2106700,2111000,2092400,2097400,91540186,-0.006018672100848277,-0.02072102810146478,-0.014646232527172757,-0.011407781484934943\n20161103 00:00,2100100,2102400,2084600,2087800,82365245,-0.004577095451511415,-0.020733282832478137,-0.014656692066510407,-0.011417284014232977\n20161104 00:00,2089100,2098800,2084000,2085500,95290592,-0.001101638087939505,-0.020733806769238434,-0.014657182660178748,-0.011417756832822375\n20161107 00:00,2114700,2131900,2113000,2131500,95548312,0.022057060656916816,-0.02089413430459649,-0.014744293422985208,-0.011465836005103812\n20161108 00:00,2127200,2147700,2123800,2141100,97985548,0.0045038705137228074,-0.020803103990795112,-0.014663846611012912,-0.011391031218794725\n20161109 00:00,2124700,2171000,2123400,2164400,219161783,0.010882256783896205,-0.020825672374883742,-0.014669834852155067,-0.01138818064708321\n20161110 00:00,2173500,2183100,2152300,2169200,159836491,0.0022177046756606256,-0.02079459883600014,-0.014640715570796022,-0.011360103173179216\n20161111 00:00,2161300,2167000,2153200,2164200,86128015,-0.0023049972340033476,-0.020653349245123066,-0.014527631758168404,-0.011262034432715243\n20161114 00:00,2169900,2172700,2157200,2165900,85660687,0.0007855096571480757,-0.02053196077257758,-0.01442744439914522,-0.011173149308860838\n20161115 00:00,2170000,2182800,2168100,2182800,79608357,0.007802760976961087,-0.020472951657973634,-0.014394559394132674,-0.011154190970005065\n20161116 00:00,2175200,2181400,2174200,2178700,59816015,-0.0018783214220267075,-0.020476835810515577,-0.014398076035847251,-0.011157511693057464\n20161117 00:00,2180400,2190600,2179200,2189900,61742349,0.005140680222150751,-0.020403561033159486,-0.014358854373919696,-0.011136443620958952\n20161118 00:00,2190400,2192600,2182900,2185000,79242591,-0.002237545093383253,-0.020412530872064447,-0.014367017753525264,-0.011144177080096134\n20161121 00:00,2191900,2201800,2190000,2201500,62050842,0.007551487414187541,-0.02041900058684131,-0.014367496198454987,-0.011141461601239697\n20161122 00:00,2204900,2207900,2197300,2205800,60951795,0.0019532137179196774,-0.020405889624464484,-0.014354345371303721,-0.01112828952232469\n20161123 00:00,2200000,2207600,2197500,2207000,50177872,0.0005440203100914864,-0.020408470958908718,-0.014357094823801266,-0.01113112859793437\n20161125 00:00,2211200,2215400,2210100,2215200,30799433,0.003715450838241985,-0.02039846122660774,-0.01434530958937289,-0.011118396849891726\n20161128 00:00,2211900,2214800,2203700,2204800,64260081,-0.0046948356807511304,-0.020433848327841057,-0.014377065308195481,-0.011148216692188273\n20161129 00:00,2205800,2214400,2201700,2209100,60422740,0.00195029027576199,-0.020402227177169715,-0.014347779898591208,-0.011120176457503971\n20161130 00:00,2216500,2218200,2203100,2203800,89052622,-0.0023991670816169153,-0.020408125127431027,-0.014365824131285659,-0.011144695828418934\n20161201 00:00,2207300,2207300,2191500,2195700,73523163,-0.00367546964334331,-0.020333915200140943,-0.014305818347994537,-0.011092262221734412\n20161202 00:00,2197000,2202500,2192600,2196800,65214024,0.0005009791865919766,-0.020165690634817116,-0.014169791906856721,-0.010973400481458232\n20161205 00:00,2206700,2214000,2204200,2210000,62268605,0.006008739985433387,-0.020035319199236255,-0.01409369818784835,-0.010926242012312147\n20161206 00:00,2212400,2217400,2206700,2217000,54251477,0.0031674208144796268,-0.019975625576887954,-0.014040102480641683,-0.01087589708110352\n20161207 00:00,2215000,2246700,2213800,2246000,100958910,0.013080739738385194,-0.01996354229508627,-0.014009208322778579,-0.010834974914817497\n20161208 00:00,2245800,2257000,2242700,2251500,87138295,0.0024487978628673357,-0.01988678540258314,-0.013942767578541293,-0.010774033671048141\n20161209 00:00,2254400,2265100,2253700,2265100,75738981,0.006040417499444839,-0.019887390102349214,-0.013939173861325344,-0.010768201793274378\n20161212 00:00,2264200,2269600,2257600,2262500,82237402,-0.0011478521919562334,-0.01960764737815108,-0.013720240085057532,-0.010581685042138361\n20161213 00:00,2270100,2283400,2270000,2277600,98759427,0.0066740331491712546,-0.019609966402237635,-0.013720570590687847,-0.01058095547593772\n20161214 00:00,2274100,2282200,2253700,2258800,131328288,-0.00825430277485073,-0.019673333674855176,-0.013786766806932365,-0.010648659791561906\n20161215 00:00,2261300,2278100,2260100,2268100,109782020,0.004117230387816528,-0.0196157768683707,-0.013758065044661918,-0.010635340546590346\n20161216 00:00,2259900,2260800,2246700,2250400,133572412,-0.007803888717428653,-0.01949151406270959,-0.01366161730674297,-0.010553720918361332\n20161219 00:00,2252400,2260100,2250800,2255300,77760990,0.0021773906861002335,-0.019073938701947266,-0.013336373064649774,-0.010277698053980065\n20161220 00:00,2261600,2265700,2258800,2264000,95464598,0.0038575799228484087,-0.019063814539903804,-0.013334494249536755,-0.010280214802805613\n20161221 00:00,2262700,2264500,2257700,2257700,58961932,-0.0027826855123674887,-0.01907502940649754,-0.013356378575193466,-0.010307786977608858\n20161222 00:00,2256100,2257400,2249200,2253800,50253495,-0.001727421712362176,-0.01905574905554298,-0.013358974239093775,-0.010322044664081017\n20161223 00:00,2254200,2257200,2252100,2257100,30271966,0.0014641938060164783,-0.019039833518611705,-0.01334376228993841,-0.01030720779496552\n20161227 00:00,2260000,2267300,2260000,2262700,35839769,0.0024810597669575607,-0.019020584049855065,-0.013324837009108364,-0.010288455337519558\n20161228 00:00,2265900,2265900,2242800,2244000,55878521,-0.008264462809917328,-0.019078891536269443,-0.013388019631016018,-0.010354236876119331\n20161229 00:00,2244700,2248900,2238400,2243500,44831649,-0.00022281639928700692,-0.019021023268653778,-0.013339123260185094,-0.010310123390265864\n20161230 00:00,2247100,2248300,2227300,2235300,86143160,-0.003655003342990848,-0.018946341997123545,-0.01327905255866774,-0.01025784152955924\n20170103 00:00,2250700,2258300,2238900,2252400,77920116,0.007649979868473933,-0.018770406812804907,-0.013129343505733,-0.010122113530221345\n20170104 00:00,2256400,2267500,2256100,2265800,70209892,0.005949209731841654,-0.018769360695129085,-0.013123654275789353,-0.010113949074308515\n20170105 00:00,2262800,2265800,2254900,2264000,65938728,-0.0007944213964162783,-0.018630297348144413,-0.013011818855406709,-0.010016628760846583\n20170106 00:00,2265300,2277500,2259000,2272100,62917568,0.003577738515901041,-0.018168293478763108,-0.012652586366937849,-0.009712183315259724\n20170109 00:00,2269000,2270700,2264200,2264600,41106606,-0.0033009110514502504,-0.018076905002411173,-0.012579582344306959,-0.009648979976879978\n20170110 00:00,2264700,2274400,2260100,2264600,56225536,0.0,-0.01808047163371581,-0.012583073134357197,-0.009652430336238131\n20170111 00:00,2263800,2271000,2255900,2271000,66005672,0.0028261061556125178,-0.018072508824072648,-0.012583536957640005,-0.009657386366352909\n20170112 00:00,2265000,2267500,2249600,2265300,67094792,-0.002509907529722577,-0.017614168639814024,-0.01223363045176491,-0.00936528545318959\n20170113 00:00,2267500,2274000,2266900,2270500,48194702,0.002295501699554059,-0.017532697155177954,-0.012191945153578078,-0.009344810023778996\n20170117 00:00,2263000,2267800,2258000,2262500,52726727,-0.0035234529839242024,-0.01718797818131222,-0.011927710388700693,-0.009123481092899554\n20170118 00:00,2265200,2268000,2259000,2267500,47432023,0.0022099447513812542,-0.017185188022788664,-0.01192459204550127,-0.009120187795663799\n20170119 00:00,2268300,2270000,2254100,2259100,60830945,-0.003704520396912936,-0.0170666879210163,-0.011831204248436797,-0.009040187275316658\n20170120 00:00,2267300,2273100,2260500,2267400,106233534,0.003674029480766672,-0.017066499166384953,-0.011832367899557394,-0.009042071888939341\n20170123 00:00,2263700,2268000,2252700,2261500,64870592,-0.0026020993208080156,-0.0169257933331106,-0.011759878125160073,-0.009005947843111154\n20170124 00:00,2264000,2280800,2262800,2276000,81566655,0.006411673667919615,-0.016700587930230583,-0.011575378293198178,-0.008843148000383882\n20170125 00:00,2287000,2295700,2285100,2295700,65524898,0.008655536028119526,-0.016653318765697835,-0.011548065083874062,-0.008826473236938954\n20170126 00:00,2294200,2297100,2290200,2293300,52160586,-0.0010454327656053142,-0.016528939724538626,-0.011448505382666806,-0.00874014463402169\n20170127 00:00,2294400,2295900,2287600,2289700,45459870,-0.0015697902585792844,-0.016546794759207055,-0.011469318902062528,-0.008762535310678323\n20170130 00:00,2281800,2282000,2264200,2275500,69104606,-0.006201685810368174,-0.01633468990234645,-0.01135544102426128,-0.008701021871946732\n20170131 00:00,2270100,2275900,2263200,2275300,63594548,-8.789277081955316e-05,-0.0163288411224722,-0.01135008863002009,-0.008695934099049767\n20170201 00:00,2282800,2285800,2269500,2276200,69036939,0.0003955522348702001,-0.016024624531964682,-0.011113280565904679,-0.008495061270923867\n20170202 00:00,2272400,2280900,2268300,2277700,64355660,0.0006589930586065051,-0.016028254687630243,-0.011121929785645157,-0.008506386135150763\n20170203 00:00,2288500,2295500,2284600,2293400,65321136,0.006892918294771011,-0.016031101858780667,-0.011117753677105305,-0.008498465942196097\n20170206 00:00,2288900,2293200,2285500,2289300,52191634,-0.0017877387285253343,-0.01572753212477008,-0.01088364510305747,-0.008301386855498973\n20170207 00:00,2293600,2296500,2287200,2289400,52308487,4.368147468647443e-05,-0.015528306897800702,-0.010726467185723388,-0.008166624203344838\n20170208 00:00,2285900,2293900,2283100,2292400,44188553,0.0013103870009609775,-0.015522743847709632,-0.010721010504806542,-0.008161224227441175\n20170209 00:00,2295700,2309500,2295200,2306000,57358826,0.005932647007502956,-0.015514333280347343,-0.010707916298632592,-0.008145633190747485\n20170210 00:00,2310000,2317700,2308800,2315100,53177237,0.0039462272333044,-0.015340494323031844,-0.010566112474856133,-0.008020907178121867\n20170213 00:00,2320900,2330700,2320500,2327700,47492534,0.005442529480367941,-0.015174310814607265,-0.010465276719370187,-0.007954908067922817\n20170214 00:00,2325500,2337100,2321600,2337000,63276400,0.003995360226833444,-0.01505842276056659,-0.010398374013056502,-0.007914119269223108\n20170215 00:00,2334300,2351400,2333900,2349200,75351898,0.005220367993153507,-0.014955569553462857,-0.010338323496673728,-0.007876886708881928\n20170216 00:00,2349300,2351500,2338500,2347200,77912159,-0.0008513536523071519,-0.01492642115983517,-0.010313761312291876,-0.007854769415678794\n20170217 00:00,2339700,2350900,2339400,2350900,61031072,0.0015763462849351928,-0.01491871771128276,-0.010306179429208097,-0.007847252338696518\n20170221 00:00,2355100,2366800,2355100,2364900,68354069,0.00595516610659752,-0.014838419043418838,-0.010259615677658686,-0.007818672546205888\n20170222 00:00,2360200,2365400,2358300,2362800,52965600,-0.0008879868070531538,-0.01466404943474984,-0.010122442568906004,-0.007701328753921297\n20170223 00:00,2369000,2369000,2355700,2364400,66891920,0.0006771626883359527,-0.014669646852926438,-0.010131052849385999,-0.007711545180146811\n20170224 00:00,2354200,2367900,2354100,2367400,65260982,0.0012688208424971315,-0.014624805477759961,-0.010111829858912375,-0.007705979255757865\n20170227 00:00,2366100,2373100,2363500,2371100,47536121,0.0015628960040550144,-0.014603210547005674,-0.010092069124297779,-0.007687196324318309\n20170228 00:00,2367100,2369500,2360200,2364700,68854635,-0.0026991691619923097,-0.014538151913106267,-0.01004003095891303,-0.007642099322519406\n20170301 00:00,2384000,2403200,2383700,2397800,118445158,0.013997547257580178,-0.014319334509299562,-0.009896970310948036,-0.007539424320772757\n20170302 00:00,2395700,2395700,2382100,2382700,62429917,-0.006297439319376097,-0.014388083735554344,-0.009957709627797151,-0.007595893584556583\n20170303 00:00,2381900,2386100,2377300,2384200,59910203,0.0006295379191674222,-0.014393977987522212,-0.00996546750794856,-0.0076046449579967\n20170306 00:00,2374800,2381200,2370100,2377100,47626346,-0.0029779380924419563,-0.014423635963097833,-0.009993332380567875,-0.007631553934064982\n20170307 00:00,2373900,2377700,2367700,2370000,51126013,-0.0029868326953009783,-0.014450168436583836,-0.010017130951714404,-0.007653895071990531\n20170308 00:00,2373100,2376300,2364100,2365600,62858443,-0.0018565400843881807,-0.01431412360329378,-0.009909945340477663,-0.007562094205243337\n20170309 00:00,2367100,2372400,2357400,2368600,78158975,0.001268177206628307,-0.01431526013906561,-0.009915428196773143,-0.007569894068927392\n20170310 00:00,2379500,2380200,2365900,2376900,67005430,0.0035041796842016915,-0.01430954368634653,-0.009908070653230155,-0.0075616616659386696\n20170313 00:00,2375900,2378500,2372400,2378100,44239339,0.0005048592704783861,-0.01419927498401705,-0.009848276971514549,-0.007528776030940836\n20170314 00:00,2372200,2372400,2361900,2369000,52143010,-0.0038265842479290324,-0.014222180199119819,-0.009867601879974812,-0.007546192291178099\n20170315 00:00,2375600,2394300,2372900,2389500,78506663,0.008653440270156132,-0.014223808527912909,-0.00985679957248284,-0.007528763257479341\n20170316 00:00,2391200,2392000,2381000,2384800,71500910,-0.00196693869010256,-0.014240294923892597,-0.009877584403144778,-0.007551839567764993\n20170317 00:00,2377500,2379700,2370300,2370300,66555644,-0.006080174438108044,-0.014295958767289401,-0.009932011611723897,-0.007605607530898692\n20170320 00:00,2370100,2373600,2363300,2367700,46808067,-0.0010969075644433612,-0.014294499752550196,-0.00993072250045129,-0.007604408994535438\n20170321 00:00,2374900,2376100,2335800,2337300,119931847,-0.012839464459179828,-0.014478360250034673,-0.010076613751182236,-0.007730058980318753\n20170322 00:00,2337300,2346100,2330500,2342800,85892073,0.0023531425148675122,-0.014469416355184166,-0.010067156896805566,-0.007720328669116776\n20170323 00:00,2339800,2353400,2336000,2340300,89153899,-0.0010670991975414434,-0.014408968031893614,-0.01001770349362787,-0.00767673661716701\n20170324 00:00,2343500,2350400,2329600,2338600,93360484,-0.0007264025979575317,-0.014410026010730577,-0.01001866673771729,-0.0076776493585130594\n20170327 00:00,2319700,2339200,2316100,2336200,78643223,-0.0010262550243735902,-0.01441904022878889,-0.010027149029302091,-0.007685848082063105\n20170328 00:00,2333200,2358100,2331400,2353200,78046362,0.007276774248780038,-0.014401556838817822,-0.010017537269319728,-0.007680432658900524\n20170329 00:00,2350000,2358100,2347300,2355400,48500109,0.0009348971613123425,-0.014405002468636323,-0.010023814652630463,-0.007688219639519698\n20170330 00:00,2355000,2365200,2352700,2362900,46797888,0.0031841725396959397,-0.014379625747676648,-0.009999124580536718,-0.007663895617395589\n20170331 00:00,2359100,2365100,2356800,2357400,55060512,-0.0023276482288713263,-0.014394851839926445,-0.010020230631571198,-0.007688136252700717\n20170403 00:00,2357900,2360300,2339200,2353300,73352665,-0.0017392042080257575,-0.014384581593491869,-0.010011507458888118,-0.0076802378193099605\n20170404 00:00,2350000,2355800,2345600,2354800,47152999,0.0006374027960736051,-0.0142532563609781,-0.009905796788505786,-0.007588182177218961\n20170405 00:00,2362600,2373900,2345500,2347800,96925396,-0.0029726516052318575,-0.01423419054457231,-0.009908983226302603,-0.007603231209391716\n20170406 00:00,2349600,2360400,2344300,2354400,59853359,0.0028111423460259743,-0.01405328486200598,-0.009763334705370648,-0.007476378150865837\n20170407 00:00,2351800,2360000,2346400,2352000,58063904,-0.0010193679918450993,-0.014066772971649938,-0.009777420426620251,-0.007490782456651083\n20170410 00:00,2353600,2362500,2347300,2353400,62169916,0.0005952380952380931,-0.014048372419856662,-0.009760932601146128,-0.007475314298500085\n20170411 00:00,2349000,2351800,2333400,2350600,80178276,-0.0011897679952409534,-0.014031267426203413,-0.00976161899378393,-0.007485485213336614\n20170412 00:00,2348000,2349500,2337700,2340300,66034492,-0.004381859950650879,-0.014039935676575337,-0.009784410727937972,-0.0075158061244341235\n20170413 00:00,2336500,2344900,2325100,2325100,72058660,-0.006494893817032055,-0.014101084452904655,-0.009835084670856557,-0.0075608959724212145\n20170417 00:00,2331200,2345700,2328800,2345700,56011057,0.008859833985634946,-0.014111863931924824,-0.009831177497168503,-0.00754915939851907\n20170418 00:00,2337100,2344900,2330800,2338700,74664350,-0.0029841838257236297,-0.014129095742324798,-0.00985494203878149,-0.007576406514968807\n20170419 00:00,2345200,2349500,2331800,2334400,59798136,-0.0018386282977722601,-0.014147384532598832,-0.009873677193875253,-0.007595379625496295\n20170420 00:00,2341400,2358500,2337800,2353400,83135283,0.008139136394790913,-0.014161599253665863,-0.009875152235409313,-0.007590063191011654\n20170421 00:00,2352200,2353000,2341300,2345900,92494914,-0.00318687855868105,-0.014135093205886424,-0.009853641184523162,-0.007571214954486452\n20170424 00:00,2371700,2374100,2366100,2371700,103888079,0.01099791124941385,-0.014173603722346067,-0.009868419191218454,-0.007573341248043192\n20170425 00:00,2379300,2389500,2378100,2385500,67491880,0.005818611122823336,-0.014160027935940183,-0.00984999795427061,-0.007552336919340928\n20170426 00:00,2385300,2395300,2383500,2384000,73538016,-0.0006287989939216532,-0.014169863591924996,-0.009859968216714438,-0.007562378939989978\n20170427 00:00,2387400,2389500,2379800,2386000,45634569,0.0008389261744965459,-0.014172618443847193,-0.00986305441489966,-0.007565641777641944\n20170428 00:00,2389300,2389300,2379300,2380800,49721027,-0.0021793797150041483,-0.014077415679112588,-0.009787392432366534,-0.007500396913794149\n20170501 00:00,2386600,2391700,2382000,2386800,44888079,0.002520161290322509,-0.014022385592087721,-0.00973927650795716,-0.007455966903890791\n20170502 00:00,2388200,2389800,2383000,2387700,49086142,0.00037707390648566985,-0.014009230060727573,-0.009739284906049,-0.007462992944063318\n20170503 00:00,2382900,2387300,2377000,2384800,61863616,-0.0012145579427901287,-0.013910221921660195,-0.009660075393908977,-0.007394338006677892\n20170504 00:00,2388100,2389200,2377800,2387600,56277584,0.0011741026501173035,-0.013853867279983528,-0.009612266448262283,-0.007351084739963347\n20170505 00:00,2391600,2397200,2386900,2397000,49995690,0.003937007874015741,-0.013845829489146647,-0.009601949869520248,-0.007339553347821218\n20170508 00:00,2397700,2399200,2391700,2396600,43249763,-0.00016687526074254944,-0.013854674681103792,-0.009612651915836561,-0.007351245276325531\n20170509 00:00,2399400,2401900,2390400,2394400,46767168,-0.0009179671200867379,-0.013863681137173829,-0.00962116084669736,-0.007359488978338266\n20170510 00:00,2393700,2398700,2391600,2398700,46195692,0.0017958569996658902,-0.01380163066465159,-0.009589710738396338,-0.0073443518109738\n20170511 00:00,2393100,2395700,2381400,2393800,54364403,-0.0020427731687997497,-0.013702579730323614,-0.009511121063518313,-0.007276669957796245\n20170512 00:00,2390500,2392100,2386700,2389800,41779519,-0.0016709833737154067,-0.013713964951984847,-0.009521394994930711,-0.00728635146448907\n20170515 00:00,2394900,2404400,2394500,2403000,51325482,0.005523474767763048,-0.013607081620534478,-0.009429102331289256,-0.007201837031867056\n20170516 00:00,2406400,2406700,2396300,2400800,45582380,-0.0009155222638368432,-0.013583558136196744,-0.009425402113254027,-0.0072087045237461435\n20170517 00:00,2380900,2386400,2357500,2358200,144257251,-0.01774408530489835,-0.013790853609326612,-0.009581412589295707,-0.007337375157608729\n20170518 00:00,2357000,2377500,2354300,2367700,93498838,0.004028496310745533,-0.013785485546049716,-0.009573444823283775,-0.007328021499688366\n20170519 00:00,2373600,2390800,2372700,2383100,97341700,0.006504202390505531,-0.013761424333624867,-0.009545070208017377,-0.007297347425327915\n20170522 00:00,2388700,2397100,2388200,2395200,44766182,0.0050774201670094055,-0.013757797221065965,-0.009543717917307999,-0.007297207833729052\n20170523 00:00,2399800,2402400,2395200,2400500,44309601,0.0022127588510354457,-0.013740746029699652,-0.009527222653483719,-0.0072810089328203455\n20170524 00:00,2403300,2407300,2399300,2406100,42561538,0.002332847323474274,-0.013666853218111554,-0.009487620032937759,-0.007259686286235795\n20170525 00:00,2412200,2420800,2409700,2417600,57128563,0.004779518723245113,-0.013659604265050817,-0.009484711898762516,-0.007259092226546183\n20170526 00:00,2415900,2419000,2414500,2417100,34160249,-0.00020681667769684164,-0.013662390243635183,-0.009487366574317884,-0.0072616769049426485\n20170530 00:00,2413200,2417900,2411600,2415000,30629121,-0.0008688097306689402,-0.013674238574943596,-0.009501585151092156,-0.007277159050804208\n20170531 00:00,2418400,2418800,2406400,2414400,67558518,-0.0002484472049689712,-0.013672208254358584,-0.00949971950660271,-0.007275381194531963\n20170601 00:00,2419700,2433600,2416500,2433600,58482273,0.007952286282306265,-0.013685672199580088,-0.009501212214107478,-0.007270492079506816\n20170602 00:00,2434500,2443500,2430800,2441700,56727456,0.003328402366863825,-0.01368562059966039,-0.009500733715287965,-0.007269786002463455\n20170605 00:00,2440200,2443000,2437600,2439900,33597787,-0.0007371913011426923,-0.013667868544154822,-0.009485511670817157,-0.007255912697513544\n20170606 00:00,2433400,2439800,2431200,2432100,43156884,-0.0031968523300135443,-0.013695756978057529,-0.009515082966631217,-0.00728638112078549\n20170607 00:00,2436100,2439200,2428300,2436600,43784238,0.0018502528678918662,-0.01369486155485614,-0.00951400372858292,-0.0072852038917224715\n20170608 00:00,2438000,2443300,2431700,2437800,59231538,0.0004924895345974623,-0.013700387199321176,-0.009521127064709204,-0.007293178951361467\n20170609 00:00,2440700,2450100,2419500,2434100,115565354,-0.0015177619164821188,-0.013699448008572822,-0.009520311708879653,-0.007292429611468907\n20170612 00:00,2430900,2434200,2423800,2433600,74220413,-0.00020541473234458874,-0.013586371948455144,-0.009429580031382601,-0.00721360964166654\n20170613 00:00,2439800,2446100,2435800,2445500,53143874,0.00488987508218286,-0.013498034721317023,-0.009352525333180574,-0.00714256961789188\n20170614 00:00,2448600,2448700,2433000,2442400,67840892,-0.0012676344305867504,-0.01349578173704095,-0.009350565347352284,-0.007140765828451927\n20170615 00:00,2426900,2439100,2423700,2437700,57671192,-0.0019243367179823112,-0.013499069411046534,-0.009353395122214374,-0.007143351498974973\n20170616 00:00,2428300,2428300,2416400,2426400,68393285,-0.004635517085777585,-0.013546147766600661,-0.009395259803918818,-0.007182436790442183\n20170619 00:00,2436100,2447300,2434800,2446600,51499196,0.008325090669304425,-0.013456045144918076,-0.009311719949576452,-0.00710239552308484\n20170620 00:00,2442300,2442600,2429900,2430100,48023571,-0.0067440529714706265,-0.013523546531604097,-0.009375054460521117,-0.0071635086879903755\n20170621 00:00,2434600,2435900,2424200,2429500,50482105,-0.0002469034196123099,-0.0135322666013599,-0.009384302684634718,-0.0071730384692378\n20170622 00:00,2429600,2435300,2426400,2428400,36622080,-0.0004527680592714134,-0.01352313756617075,-0.009376254708341311,-0.0071655668014415\n20170623 00:00,2428800,2435100,2424700,2431300,56648578,0.0011942019436665952,-0.01344266114787924,-0.009333835381354136,-0.007143435569006943\n20170626 00:00,2439300,2443800,2430500,2432900,48970596,0.000658084152511007,-0.01217691275375584,-0.008395448804759177,-0.00637956436600748\n20170627 00:00,2430100,2433800,2413100,2413300,72130894,-0.008056229191499842,-0.011916407610895897,-0.008200020546102842,-0.006218828353517688\n20170628 00:00,2425100,2437100,2422400,2434900,59025861,0.008950399867401426,-0.011742123229927303,-0.008087885727680327,-0.006139825236917983\n20170629 00:00,2436200,2437200,2399600,2413500,97388588,-0.008788861965583816,-0.011686543317580275,-0.008078768565726658,-0.006155477195274038\n20170630 00:00,2423000,2427100,2415800,2418000,58187364,0.0018645121193288094,-0.011585000203678874,-0.00802066358962451,-0.006120528929699593\n20170703 00:00,2429000,2433800,2422100,2422100,32862520,0.0016956162117451878,-0.011583908918931272,-0.008019363359966567,-0.006119117312283103\n20170705 00:00,2426100,2430100,2417000,2427700,47672771,0.0023120432682381953,-0.011503869002698276,-0.00795232545051074,-0.0060590107245291755\n20170706 00:00,2418600,2420300,2403400,2405500,57599572,-0.009144457717180865,-0.011618186145173128,-0.008051482332531619,-0.006150085727799184\n20170707 00:00,2411800,2422800,2410200,2421100,43893302,0.006485138224901377,-0.011616560472611483,-0.008041519431812815,-0.006135678281599839\n20170710 00:00,2419800,2428000,2417800,2423700,31706829,0.0010738920325472634,-0.01148465920199196,-0.007964540743335607,-0.006087978618434013\n20170711 00:00,2421200,2425500,2408500,2421900,45825492,-0.0007426661715559391,-0.011494943954643757,-0.007976774983555535,-0.006101252123262871\n20170712 00:00,2433100,2442000,2433100,2440100,46071933,0.007514761137949577,-0.011497062352828494,-0.007977978572260005,-0.006101968030418457\n20170713 00:00,2440200,2445500,2437600,2444200,33501511,0.001680259005778506,-0.011489670344521974,-0.007970420265605235,-0.006094321070729586\n20170714 00:00,2444000,2459700,2443100,2455600,47191923,0.004664102773913825,-0.011486193024916451,-0.007968921890635732,-0.006093877663822906\n20170717 00:00,2454400,2459100,2453400,2455300,25751504,-0.00012216973448442303,-0.011479273802186092,-0.007962719281316172,-0.006088057078460975\n20170718 00:00,2450600,2457200,2446700,2456600,36481728,0.0005294668675925873,-0.011483614570284038,-0.007968242882310435,-0.006094211243295456\n20170719 00:00,2460100,2470000,2460100,2469900,42449945,0.005413986811039662,-0.011477056109627558,-0.007956076538022258,-0.006079055356993937\n20170720 00:00,2472500,2474200,2464700,2471000,38472135,0.00044536216041124455,-0.01147936151079457,-0.007962297374678105,-0.006087363497820691\n20170721 00:00,2464300,2469100,2461800,2468800,77627243,-0.0008903278025090833,-0.011448029377558679,-0.007936306841317629,-0.006064220551588407\n20170724 00:00,2468100,2469800,2462900,2468200,32070018,-0.00024303305249517848,-0.011452302032112747,-0.007945148047343377,-0.006075497235498808\n20170725 00:00,2477000,2478000,2471600,2474200,49230957,0.0024309213191799905,-0.011424731914578925,-0.007919564525752147,-0.006050972760853622\n20170726 00:00,2477800,2477900,2471300,2474300,41030559,4.041710451874181e-05,-0.011426810007115262,-0.007921577122051458,-0.006052950441351329\n20170727 00:00,2479600,2480000,2456800,2472000,64357340,-0.0009295558339732501,-0.011425606068614196,-0.007920519286752222,-0.006051970493128365\n20170728 00:00,2467000,2470600,2461400,2469100,40266001,-0.0011731391585760864,-0.011437619431206749,-0.007931934204699228,-0.0060630663824492404\n20170731 00:00,2473800,2474800,2465300,2467700,41852288,-0.0005670082216192585,-0.011446281136683233,-0.007940594340340373,-0.006071725681216975\n20170801 00:00,2474500,2475000,2468000,2473200,39456990,0.0022287960449001165,-0.011433887600786102,-0.007928062759967998,-0.006059120509845653\n20170802 00:00,2474700,2476000,2463700,2474400,40002720,0.00048520135856389146,-0.011361350434905469,-0.007868655121023863,-0.006006712173128498\n20170803 00:00,2473100,2473400,2466400,2469600,35313680,-0.0019398642095053154,-0.011380925362009263,-0.007888580351543514,-0.00602682414910292\n20170804 00:00,2475200,2477900,2469700,2474100,47115173,0.0018221574344023939,-0.01137871375553161,-0.007885973626547473,-0.006024006787886776\n20170807 00:00,2475000,2478700,2473700,2478700,26044202,0.0018592619538417843,-0.011355088279653409,-0.007876292490598227,-0.006021759327955756\n20170808 00:00,2474900,2489000,2468300,2472600,52101258,-0.0024609674426110395,-0.011370477512768236,-0.007889554728567743,-0.006033887672683774\n20170809 00:00,2464600,2473100,2460600,2472500,55549945,-4.044325810892424e-05,-0.011373941279446092,-0.007892957129751597,-0.006037257360149846\n20170810 00:00,2463000,2464300,2437000,2437600,104046619,-0.014115267947421684,-0.011602015696343454,-0.008067483837147928,-0.006183237981752454\n20170811 00:00,2440000,2448000,2437500,2441200,61113729,0.0014768624876928538,-0.011599172846344704,-0.008069365599135106,-0.0061876384169069635\n20170814 00:00,2455500,2467900,2455500,2465400,57898513,0.009913157463542488,-0.011631828515742045,-0.008079495737650782,-0.006185760278260293\n20170815 00:00,2470000,2470000,2461600,2465100,47792878,-0.00012168410805546426,-0.011638867291495653,-0.008088233278258567,-0.006195403424125945\n20170816 00:00,2470900,2475700,2464600,2469400,49448733,0.0017443511419414914,-0.011584412091630397,-0.008041706988427015,-0.006153104006894209\n20170817 00:00,2462600,2466000,2430900,2430900,115678588,-0.015590831780999403,-0.011880003376785601,-0.008271070148331764,-0.006347161198290249\n20170818 00:00,2429500,2441900,2422000,2427100,118659025,-0.0015632070426591094,-0.01189581195022565,-0.008286832939631455,-0.006362899583300321\n20170821 00:00,2426400,2432000,2418300,2429000,52959492,0.0007828272423879845,-0.011883214987233685,-0.00827521058788504,-0.006351796793202582\n20170822 00:00,2436000,2456200,2435500,2454400,56390025,0.010456978180321208,-0.011927675864072574,-0.008294224818036273,-0.006357245510164227\n20170823 00:00,2443400,2450500,2441800,2445600,41275750,-0.003585397653194211,-0.01196193467353823,-0.008324850035472904,-0.006385933673135475\n20170824 00:00,2450000,2451800,2437500,2439900,44822885,-0.0023307163886162607,-0.011934920306270738,-0.00830288350331701,-0.006366658123199195\n20170825 00:00,2448900,2456100,2443900,2445600,53279580,0.0023361613180867824,-0.011922766968173062,-0.008290400891334196,-0.006353999976526616\n20170828 00:00,2451700,2451900,2440900,2445700,30596755,4.0889761203866115e-05,-0.01191153546858111,-0.00828038256704655,-0.0063446283915046114\n20170829 00:00,2431300,2451500,2429300,2448500,45762826,0.001144866500388364,-0.011909874671707016,-0.008283548580679461,-0.00635036755995828\n20170830 00:00,2448600,2463200,2446200,2460100,51768706,0.004737594445578974,-0.011896348264736943,-0.008266560593277853,-0.006331534216837421\n20170831 00:00,2467500,2477700,2466100,2474900,74827764,0.006016015609121572,-0.011881226552050954,-0.008245995391599701,-0.006308067111319957\n20170901 00:00,2479800,2483300,2476700,2478400,48254590,0.0014141985534767976,-0.011874381495266895,-0.008239137347390565,-0.006301202143562567\n20170905 00:00,2472700,2475200,2449500,2460600,80412244,-0.007182052937378947,-0.011958123504752333,-0.00831199096519085,-0.00636825120004555\n20170906 00:00,2468700,2472800,2462300,2469000,51824854,0.003413801511826353,-0.011958196897664738,-0.008311960672208006,-0.0063681656324956135\n20170907 00:00,2472700,2472700,2464000,2468700,51789141,-0.00012150668286758926,-0.011956920956353473,-0.008310775285089502,-0.006367028519482196\n20170908 00:00,2465400,2471000,2463000,2465800,50483333,-0.0011747073358447935,-0.011948258834805088,-0.008303362323762872,-0.006360281480847546\n20170911 00:00,2480400,2493000,2480300,2492100,58404461,0.010665909643928995,-0.011380433104507098,-0.007861868849049524,-0.00598613526412222\n20170912 00:00,2496400,2500700,2494200,2500500,49393581,0.003370651257975199,-0.011258380928374256,-0.007788437450647999,-0.005938623422418988\n20170913 00:00,2497300,2502100,2496000,2501700,42484385,0.0004799040191960646,-0.010985827480718273,-0.007578194282701758,-0.0057615976340208075\n20170914 00:00,2498300,2503200,2496000,2500900,65581923,-0.0003197825478674643,-0.010985228704806366,-0.0075776520202843365,-0.005761085498738181\n20170915 00:00,2487000,2492900,2485700,2491900,68255555,-0.0035987044663920997,-0.010974052054781015,-0.007585549620918689,-0.005779151511819238\n20170918 00:00,2496200,2501100,2492800,2497200,38706384,0.002126891127252284,-0.010848361689100887,-0.007483893513203917,-0.005690307978092422\n20170919 00:00,2500000,2500700,2496000,2499700,38421723,0.0010011212558065363,-0.01084506584363287,-0.007480617313229043,-0.005687042251057249\n20170920 00:00,2500700,2501900,2489200,2500600,50752645,0.00036004320518467914,-0.010843566113564535,-0.007479192850435555,-0.005685657912969473\n20170921 00:00,2498700,2499800,2491900,2493900,43352855,-0.002679356954330969,-0.01080248623204293,-0.007466334499116916,-0.0056878443549745975\n20170922 00:00,2490600,2496300,2490200,2494400,35884635,0.0002004891936324693,-0.010795728666010548,-0.007468648917800632,-0.005694995015141621\n20170925 00:00,2491600,2495500,2480800,2489300,50407468,-0.0020445798588839548,-0.010753826569198299,-0.00743502903418718,-0.005665790348737979\n20170926 00:00,2494500,2496900,2488100,2490800,43026163,0.000602579038283757,-0.010647115142464466,-0.0073494590924986294,-0.005591490854497749\n20170927 00:00,2498900,2504900,2488800,2500500,62619261,0.003894331138589946,-0.01063657634747183,-0.0073446971877672755,-0.005589808588588598\n20170928 00:00,2497300,2504300,2496400,2503500,36427192,0.0011997600479904946,-0.010633525734038885,-0.007346915625558625,-0.005594835938090677\n20170929 00:00,2503700,2513100,2501300,2512300,59810909,0.0035150788895546015,-0.01050185509474028,-0.007239213843239406,-0.0054999118647357965\n20171002 00:00,2515000,2523200,2514000,2523200,45157038,0.004338653823189986,-0.01048154154800977,-0.007228579690834872,-0.005494437761630012\n20171003 00:00,2524800,2528900,2522300,2528600,48890886,0.0021401395053899375,-0.01045676799914575,-0.007205780884263533,-0.005472691682867813\n20171004 00:00,2527200,2534400,2525600,2531600,39214468,0.0011864272720081281,-0.010399930829024379,-0.007158288638233935,-0.005430181181292746\n20171005 00:00,2535400,2546800,2534100,2546600,57502282,0.005925106651919698,-0.01040714133425131,-0.007161643226962226,-0.005431480195203564\n20171006 00:00,2541600,2544600,2538600,2543700,63350212,-0.00113877326631584,-0.010417596280838411,-0.0071711679105492575,-0.005440508959027488\n20171009 00:00,2546500,2547000,2536500,2539500,27885527,-0.0016511381059086672,-0.010399434097570217,-0.007156259042806319,-0.005427334421752901\n20171010 00:00,2545900,2550500,2539800,2546200,35938141,0.0026383146288639914,-0.010393318547423126,-0.007154922624161354,-0.005428545740427613\n20171011 00:00,2545300,2550200,2543200,2550200,35324039,0.0015709685020814934,-0.010163362534007693,-0.006975823442401464,-0.005276558147439007\n20171012 00:00,2546800,2550600,2543700,2546400,39362384,-0.0014900792094737492,-0.010178928809295133,-0.006990086902516506,-0.00529012708160642\n20171013 00:00,2551500,2552700,2547600,2549500,39906982,0.001217404963870461,-0.010145564605365904,-0.006961273716232804,-0.005263740025989528\n20171016 00:00,2552000,2555000,2548200,2552900,31623755,0.0013335948225141614,-0.01014264445149004,-0.006958259042680701,-0.00526067496434777\n20171017 00:00,2552400,2555200,2549800,2554700,29021655,0.000705080496689936,-0.010108492523884282,-0.006929255737122708,-0.005234416370152122\n20171018 00:00,2559200,2559500,2555000,2557200,32340875,0.0009785884839708103,-0.010099113247197531,-0.0069287663817038615,-0.005238666198866035\n20171019 00:00,2548300,2558200,2543500,2557900,51983499,0.00027373689973408943,-0.010105024412448526,-0.006935728217739685,-0.005246188143609481\n20171020 00:00,2567300,2571400,2564200,2571100,68864750,0.005160483208882294,-0.010090005263485326,-0.0069169398606494445,-0.005225390435613823\n20171023 00:00,2575100,2575100,2560200,2561100,50941227,-0.0038893858659717617,-0.010128469227634435,-0.006949200831870919,-0.00525434461425836\n20171024 00:00,2565600,2568300,2561500,2565600,57258734,0.0017570575143492917,-0.010127034464018242,-0.00695108756042299,-0.005258002017994895\n20171025 00:00,2562300,2563100,2540000,2552900,84509571,-0.004950109136264369,-0.0101488363586559,-0.006968362138040623,-0.005272863099661473\n20171026 00:00,2560100,2563000,2555600,2556200,60425004,0.0012926475772649937,-0.010128710043144586,-0.0069502950851932956,-0.005255893832120478\n20171027 00:00,2564700,2578900,2561600,2577100,68581031,0.008176199045458077,-0.010128951505444881,-0.006937861008827419,-0.005236702472994649\n20171030 00:00,2570900,2576000,2564100,2567500,45270942,-0.0037251173800008086,-0.010138255212125424,-0.006945334030517736,-0.005243199563290716\n20171031 00:00,2572100,2574400,2568100,2571500,42638839,0.0015579357351509504,-0.010132374401640939,-0.006939419599221176,-0.005237267208863645\n20171101 00:00,2581000,2584300,2570700,2574900,47993039,0.0013221854948473055,-0.010034707391681134,-0.006860404118885046,-0.005168194789954099\n20171102 00:00,2574300,2577500,2561900,2575900,48827159,0.0003883645966833438,-0.009962918334597719,-0.006802197299315716,-0.0051172286109455066\n20171103 00:00,2578200,2585000,2573100,2584500,45788670,0.0033386389223184487,-0.009908363786406303,-0.006754422371666555,-0.005073067873920958\n20171106 00:00,2583100,2590000,2582200,2588500,40510098,0.0015476881408396093,-0.00989445354671616,-0.006741507281280968,-0.005060683293947302\n20171107 00:00,2590000,2593500,2580900,2586700,51927624,-0.000695383426694951,-0.00952564233670073,-0.00650718718379991,-0.0048980599109041505\n20171108 00:00,2584600,2592200,2581500,2591100,40183247,0.001701009007615939,-0.00952309078838703,-0.006508641383033172,-0.004901649559332326\n20171109 00:00,2577400,2583900,2563600,2581700,88196762,-0.0036278028636486104,-0.009492456811141185,-0.006503849218737728,-0.004910633569898916\n20171110 00:00,2577100,2582100,2573700,2580900,46236809,-0.00030987333927257055,-0.009501154086158972,-0.0065129369311174475,-0.004919929422991555\n20171113 00:00,2573200,2585900,2572700,2583300,41967655,0.0009299081715681279,-0.009478785115421638,-0.006493360334461008,-0.0049018414306250865\n20171114 00:00,2574400,2578500,2565200,2577300,50761825,-0.002322610614330478,-0.009500811397360805,-0.006512547245929974,-0.004919514684202841\n20171115 00:00,2566200,2572200,2556300,2564400,68119981,-0.005005238039809123,-0.009532010758750632,-0.006549495974270795,-0.004959528378790993\n20171116 00:00,2575200,2590400,2574800,2586200,68715102,0.008501013882389552,-0.009548724828395019,-0.006549247912953276,-0.004950237868222241\n20171117 00:00,2582000,2584400,2577800,2578600,65649757,-0.0029386745031320105,-0.009573522702128036,-0.006576173470213472,-0.004978297685697761\n20171120 00:00,2581500,2585200,2578600,2583000,38680440,0.001706352284185142,-0.009550126504884472,-0.006555046377077225,-0.004958380243564815\n20171121 00:00,2591900,2602000,2591000,2599900,59121571,0.00654277971351136,-0.009540558488589099,-0.006549453879240528,-0.0049549070799079255\n20171122 00:00,2600700,2601500,2595800,2597600,36058663,-0.0008846494095926527,-0.009552598629430791,-0.006561265879842652,-0.004966597459792516\n20171124 00:00,2603200,2604800,2601600,2603600,20775775,0.0023098244533414913,-0.009548442702726326,-0.006556274696024792,-0.0049611610034981865\n20171127 00:00,2603800,2607500,2600000,2602300,43626677,-0.0004993086495621579,-0.009556704902324183,-0.006567016108094724,-0.004973224074563213\n20171128 00:00,2607900,2629000,2606600,2628700,85200455,0.010144871844137926,-0.009561783854277795,-0.006553356278515902,-0.004949574669888105\n20171129 00:00,2630500,2636300,2622000,2627100,70248234,-0.0006086658804732581,-0.009572109779686498,-0.006563632011297314,-0.004959823645165634\n20171130 00:00,2638000,2660500,2636700,2650100,102291232,0.00875490084123176,-0.009585251163683991,-0.0065599572539185745,-0.004947184265043581\n20171201 00:00,2648000,2653100,2607600,2644600,144772948,-0.0020753933813818515,-0.009566799612350104,-0.006545050947187585,-0.004934167915092014\n20171204 00:00,2663800,2667900,2641200,2641400,81628604,-0.0012100128563865553,-0.009577520324910497,-0.006554620071074308,-0.0049431231313180005\n20171205 00:00,2644000,2651500,2630400,2631900,72059111,-0.0035965775724994264,-0.00960592432668829,-0.006585869263104156,-0.00497588908374323\n20171206 00:00,2628400,2637300,2627200,2632400,63603819,0.00018997682282750894,-0.009611627187807118,-0.006593362725098606,-0.004984337108438758\n20171207 00:00,2630800,2644300,2629400,2640700,66321314,0.003153016258927277,-0.00949516784412095,-0.006522560497436436,-0.004937874520385074\n20171208 00:00,2650000,2655200,2647200,2655100,61507907,0.0054530995569357366,-0.00950424479830494,-0.0065254859416845066,-0.004937520617448588\n20171211 00:00,2656000,2663800,2654900,2663100,59974834,0.003013069187601136,-0.009491393146853783,-0.006519918373867148,-0.004935836167663289\n20171212 00:00,2666000,2673200,2663500,2667800,70771940,0.0017648605009199514,-0.009477671850533076,-0.006506830694093272,-0.004923086266525975\n20171213 00:00,2670500,2675600,2666600,2667500,84036820,-0.00011245220781164189,-0.009466573802933285,-0.006506872955715794,-0.004929067385772698\n20171214 00:00,2670900,2672100,2656000,2656600,80249826,-0.004086223055295268,-0.009389228965084475,-0.006447340650725885,-0.004879030876138589\n20171215 00:00,2655400,2670400,2653900,2665100,121594778,0.0031995784084921652,-0.009386944182746845,-0.006446791941949229,-0.004879407661753339\n20171218 00:00,2681000,2686000,2679800,2682000,63715443,0.0063412254699635184,-0.009287906030193511,-0.0063603231482612195,-0.004799639546766343\n20171219 00:00,2685100,2685300,2670900,2671700,65048769,-0.0038404175988068223,-0.009331569881218641,-0.006398191455880983,-0.004834418271641813\n20171220 00:00,2682500,2683300,2666900,2670300,57876020,-0.0005240109293708217,-0.009339577790421494,-0.006408947009700444,-0.004846638584639345\n20171221 00:00,2677300,2683900,2673000,2675800,58124382,0.0020596936673782373,-0.009309548767836245,-0.006382085679966195,-0.004821465940242629\n20171222 00:00,2676100,2676300,2669000,2675100,49690800,-0.0002616040062785041,-0.00929841401555403,-0.006372508818878868,-0.00481271958518667\n20171226 00:00,2670200,2673800,2668900,2671900,39296365,-0.0011962169638518594,-0.00931213050757737,-0.006385299804798877,-0.00482501718722762\n20171227 00:00,2673500,2677300,2670200,2673200,46121058,0.00048654515513302243,-0.009316563042484596,-0.006390752437826804,-0.00483101363078905\n20171228 00:00,2678700,2679200,2674500,2678700,40062616,0.002057459224898972,-0.009190678086809371,-0.006289745903762539,-0.004743269691228571\n20171229 00:00,2685500,2685500,2666400,2668600,60907419,-0.003770485683353919,-0.009225602256718602,-0.006318563287536792,-0.0047688315699110605\n20180102 00:00,2678600,2688100,2674000,2687700,60549562,0.007157310949561513,-0.009206907276647537,-0.0062927757839520695,-0.004739263068285498\n20180103 00:00,2689900,2706400,2689500,2704700,69993787,0.006325110689437086,-0.009194202557998736,-0.00628533300076172,-0.0047346254034174385\n20180104 00:00,2712200,2721600,2711000,2716100,70499774,0.00421488519983737,-0.009184689663957636,-0.006280622995314622,-0.004732475800107789\n20180105 00:00,2725600,2735600,2719500,2734200,62838867,0.006663966716983882,-0.009190577154263493,-0.006276115511963403,-0.00472242679476425\n20180108 00:00,2733200,2741000,2729800,2739200,45590194,0.0018286884646332435,-0.009190129274515903,-0.006277832079536519,-0.004725297221194984\n20180109 00:00,2744300,2752400,2740900,2745400,50588042,0.0022634345794392274,-0.009152576404835817,-0.0062448117089642175,-0.004694693109125547\n20180110 00:00,2737100,2744200,2729200,2741200,52504885,-0.0015298317185109545,-0.009163747679068922,-0.006254488808311009,-0.004703573669369305\n20180111 00:00,2747500,2761200,2745600,2761200,57132771,0.007296074711805156,-0.009187507236423219,-0.0062660918319025856,-0.004708696089794498\n20180112 00:00,2764300,2781100,2762700,2779200,72240014,0.006518904823989535,-0.00917510650149571,-0.00624682799219868,-0.004685773554329674\n20180116 00:00,2794200,2800900,2761800,2769700,98395992,-0.0034182498560736407,-0.009214661610711798,-0.006281437736294522,-0.004717746942579126\n20180117 00:00,2780700,2800500,2771900,2796100,86404443,0.009531718236632125,-0.00922395552676568,-0.006272832608999959,-0.004699599901506899\n20180118 00:00,2795100,2799600,2785800,2791400,86824501,-0.001680912699831949,-0.009244205639412792,-0.006291673592293256,-0.004717689683155845\n20180119 00:00,2797000,2804100,2791400,2804100,115665358,0.0045496883284372736,-0.00920388420259551,-0.006253568772295707,-0.004680766533382801\n20180122 00:00,2801600,2826900,2801200,2826900,67806515,0.008130951107307105,-0.00923404459679216,-0.006269712700184804,-0.00468943833494813\n20180123 00:00,2827600,2836200,2823800,2832900,78792149,0.002122466305847448,-0.009203872075071161,-0.006242886865183011,-0.004664396606252681\n20180124 00:00,2840300,2847000,2818400,2831800,109450315,-0.0003882946803628329,-0.009200036489728908,-0.006248079753735256,-0.004674402540830243\n20180125 00:00,2841600,2842700,2824100,2833000,68835239,0.00042375874002398284,-0.009167688419633162,-0.006234777230216961,-0.004671253127718619\n20180126 00:00,2843200,2865800,2839700,2865800,79736062,0.011577832686198386,-0.00923642679306225,-0.006268704629307852,-0.00468662292520001\n20180129 00:00,2859900,2864200,2845000,2846800,75630192,-0.006629911368553287,-0.00931004099164822,-0.0063266361546625615,-0.004736194075485347\n20180130 00:00,2832000,2832900,2812200,2817600,111230880,-0.010257130813545068,-0.009403930314862027,-0.006397735368555722,-0.004795143966429355\n20180131 00:00,2827500,2833000,2806800,2819000,95104527,0.0004968767745598957,-0.009400805390614032,-0.006394846093032247,-0.004792380314368957\n20180201 00:00,2811000,2830600,2806900,2815800,72849227,-0.001135154310038966,-0.00941082571729057,-0.006403710427248788,-0.004800628393282563\n20180202 00:00,2800000,2802300,2754100,2754500,149222076,-0.02177001207472118,-0.010021979695735426,-0.006861902667618599,-0.005177277297085141\n20180205 00:00,2734700,2758400,2633100,2639300,260184696,-0.04182247231802505,-0.011856168960434389,-0.008215404432667595,-0.006274526334746921\n20180206 00:00,2597300,2697000,2587000,2691300,317612443,0.0197021937634978,-0.012078129015705708,-0.008347360479732353,-0.006358501578076386\n20180207 00:00,2684600,2723600,2676400,2676700,146912435,-0.005424887600787742,-0.012130687492464067,-0.008390879286464798,-0.006397201370167289\n20180208 00:00,2680000,2681600,2576000,2576300,210533683,-0.03750887286584226,-0.013454410935238673,-0.00937195004375848,-0.0071956052487404274\n20180209 00:00,2609400,2636000,2529300,2615000,252255048,0.015021542522221765,-0.013557951118123563,-0.009434592850894107,-0.0072364458161956816\n20180212 00:00,2638900,2669800,2618800,2653400,125613495,0.01468451242829838,-0.013658973549450117,-0.009493538082495935,-0.007272959848321488\n20180213 00:00,2640000,2666200,2633100,2660000,72719768,0.0024873746890781145,-0.013655408664527205,-0.009494452836513189,-0.0072762626812818455\n20180214 00:00,2644000,2700000,2639700,2695900,104371989,0.013496240601503784,-0.013735173985711753,-0.00953980660617933,-0.007303271780165746\n20180215 00:00,2715600,2730300,2687700,2730300,97354499,0.012760117215030231,-0.013800168624459389,-0.009576996489027063,-0.007325639050528498\n20180216 00:00,2722700,2753200,2722700,2731100,133139606,0.0002930080943486235,-0.013794091332984888,-0.009571369213377052,-0.007320251676649339\n20180220 00:00,2720000,2736700,2705000,2714000,74302666,-0.006261213430485912,-0.013859705649764199,-0.009626873118125486,-0.007370365758155423\n20180221 00:00,2718500,2747100,2699800,2700500,78867162,-0.004974207811348608,-0.013904337163350457,-0.009671135232061206,-0.00741443094650432\n20180222 00:00,2710900,2730500,2696500,2704000,96644954,0.0012960562858730373,-0.013894541393400272,-0.009661670178278904,-0.007405142196287376\n20180223 00:00,2718400,2747100,2712600,2747100,71109438,0.015939349112426004,-0.014008809647546909,-0.009724721959285443,-0.007440890664977991\n20180226 00:00,2759000,2780100,2752600,2779000,74117961,0.01161224564085761,-0.014056018992599806,-0.00974607745056646,-0.007448463562479601\n20180227 00:00,2781100,2789200,2743600,2744300,84017988,-0.012486505937387538,-0.01423663845364229,-0.009890117372796218,-0.0075730030679226675\n20180228 00:00,2756500,2761800,2713200,2716500,97944730,-0.010130087818387201,-0.014341529863782097,-0.009972919590742825,-0.0076440296192471745\n20180301 00:00,2715000,2731700,2660000,2677000,157627163,-0.014540769372354156,-0.014487179497552877,-0.010109077087789112,-0.007775126893329153\n20180302 00:00,2657500,2697200,2648200,2690800,111706399,0.005155024280911524,-0.014424344124299973,-0.010051335778211249,-0.007720101210247016\n20180305 00:00,2677500,2728900,2676100,2721900,82516773,0.011557900995986303,-0.014468620663644845,-0.010069937636006165,-0.0077250159903110484\n20180306 00:00,2732800,2733800,2711800,2728800,66749775,0.0025349939380578945,-0.014440574855431447,-0.010043699038995315,-0.0076997408109050975\n20180307 00:00,2703900,2731700,2702100,2727800,75522183,-0.00036646144825569493,-0.014421702878288372,-0.01002730939187848,-0.0076846744847399425\n20180308 00:00,2735200,2742400,2724200,2741000,55014311,0.004839064447540231,-0.014403782317395194,-0.010006855053840524,-0.007662869399481782\n20180309 00:00,2756900,2788700,2753400,2788700,93409685,0.017402407880335646,-0.01454001097519121,-0.010084420289116023,-0.007709161381282417\n20180312 00:00,2792000,2799100,2780900,2785200,62503496,-0.0012550650840893463,-0.014555763259071444,-0.010101090550865173,-0.007726321013636716\n20180313 00:00,2798400,2804000,2760300,2767200,77611771,-0.00646273158121502,-0.014619092585724556,-0.010153967519238572,-0.007773625868487808\n20180314 00:00,2778100,2780200,2746700,2753000,90187429,-0.005131540907776788,-0.014633681672502629,-0.0101657997830363,-0.007783988480155716\n20180315 00:00,2758500,2766000,2744300,2750000,68608453,-0.0010897203051216664,-0.01462843465794043,-0.010173416128837428,-0.0077984622357685565\n20180316 00:00,2744500,2753800,2741600,2742000,80466251,-0.002909090909090861,-0.01463620067424312,-0.010180002358827144,-0.007804419526040359\n20180319 00:00,2733400,2733800,2686300,2704900,95066872,-0.01353026987600292,-0.014774836667163503,-0.010286686112539304,-0.007894069659262705\n20180320 00:00,2709100,2716700,2701800,2709500,52033461,0.0017006173980553818,-0.01476275264571122,-0.010274889978447464,-0.007882426996857456\n20180321 00:00,2708800,2732600,2701900,2704300,71895340,-0.0019191732792027683,-0.01459661610600999,-0.010144727805326315,-0.007771442625445079\n20180322 00:00,2678500,2688600,2633700,2636700,128018295,-0.024997226639056347,-0.01515891134818246,-0.010574095286654758,-0.008129946809336909\n20180323 00:00,2641700,2650200,2578300,2580500,152584561,-0.021314521940304143,-0.015560711632850614,-0.010881727100587858,-0.008387377759970437\n20180326 00:00,2621600,2654300,2594100,2651100,119051490,0.027359038945940606,-0.015929204852034792,-0.011109622836995585,-0.008540321498559461\n20180327 00:00,2661700,2667700,2588700,2606000,116865500,-0.01701180641997657,-0.016190685616153035,-0.01131308681181811,-0.008712856937686541\n20180328 00:00,2607600,2626400,2585800,2598300,130160686,-0.002954719877206413,-0.016208457678888212,-0.011337546568818547,-0.008740881879753479\n20180329 00:00,2611200,2652600,2602800,2631500,101867581,0.012777585344263542,-0.016259669880050648,-0.011359989425881272,-0.008747987905931147\n20180402 00:00,2625600,2631300,2546700,2574700,156224122,-0.021584647539426238,-0.01666226159930327,-0.011673436879016522,-0.00901391288065757\n20180403 00:00,2589200,2613100,2568400,2607700,112280149,0.012817027226472932,-0.016694851505443455,-0.011678874259967172,-0.009004875350901503\n20180404 00:00,2567600,2643600,2566000,2635600,105850742,0.010699083483529437,-0.016708460421036988,-0.011674037187713707,-0.008990204790782039\n20180405 00:00,2655500,2666400,2643300,2656400,74694497,0.007891941113977952,-0.0167139812561017,-0.011669507431430252,-0.008980317101440833\n20180406 00:00,2634200,2651000,2580000,2597200,147082676,-0.022285800331275363,-0.017104471739231325,-0.011968056526044647,-0.009229852582046229\n20180409 00:00,2613700,2648400,2605400,2610000,91750575,0.004928384413984244,-0.01710501463145223,-0.011965979120084028,-0.009226378304820863\n20180410 00:00,2642500,2660400,2629900,2651500,95382545,0.015900383141762342,-0.017182212038282258,-0.012000892916797692,-0.009238750865442496\n20180411 00:00,2634200,2656400,2633900,2637600,80296381,-0.005242315670375253,-0.017225409963321576,-0.012038222246574118,-0.009272951668799698\n20180412 00:00,2652800,2670000,2650600,2659300,63531523,0.00822717622080682,-0.017222619279744625,-0.012025302035262945,-0.009254631443735452\n20180413 00:00,2674500,2675400,2640100,2651500,74484642,-0.0029331026961982865,-0.017209510336011695,-0.012014349146667618,-0.009244827940155987\n20180416 00:00,2670000,2681900,2660700,2673300,53229700,0.008221761267207306,-0.017156648677718576,-0.011959865221923317,-0.009189479191169391\n20180417 00:00,2693300,2708700,2687500,2701900,54103741,0.010698387760445849,-0.017169882477968197,-0.01196708494425014,-0.009193492830809316\n20180418 00:00,2706800,2713000,2698700,2703900,50299257,0.0007402198452941544,-0.01714732552884662,-0.011946806402804596,-0.009174428900065128\n20180419 00:00,2695900,2698600,2677200,2688900,66127959,-0.005547542438699704,-0.017181361967365846,-0.011975183557097703,-0.009199789110878204\n20180420 00:00,2688700,2690600,2656200,2666100,86632836,-0.00847930380452977,-0.017261971047561327,-0.012051497202993838,-0.009273812876643646\n20180423 00:00,2672800,2678800,2653500,2665700,56938463,-0.00015003188177487026,-0.017241822992829146,-0.012033721154046082,-0.009257301335202495\n20180424 00:00,2677600,2679700,2612800,2629800,105344976,-0.013467381925948207,-0.017389949852453946,-0.012166895358885058,-0.009382504335104088\n20180425 00:00,2629400,2641300,2608500,2636300,85139536,0.0024716708494942896,-0.01738819942240116,-0.012169548474886495,-0.0093875049652127\n20180426 00:00,2648600,2672400,2642900,2663100,58733046,0.010165762621856311,-0.01740172709939138,-0.012166564767863368,-0.009375719100468726\n20180427 00:00,2670000,2673300,2655000,2665600,49090356,0.0009387555855957519,-0.017401381493103368,-0.012166204355450438,-0.00937535079496539\n20180430 00:00,2672600,2678900,2644400,2645100,64203115,-0.007690576230492185,-0.017459078253166463,-0.01221340575979124,-0.009416957164006347\n20180501 00:00,2638700,2651000,2621200,2649800,60987801,0.0017768704396809998,-0.017460504072177484,-0.012215277954604387,-0.009419067320107891\n20180502 00:00,2647700,2656800,2627700,2632000,70609719,-0.006717488112310321,-0.01751939269595766,-0.012265162708093393,-0.009464152143661472\n20180503 00:00,2622800,2633600,2590500,2626200,120224810,-0.0022036474164133235,-0.017525842458489545,-0.012270872839365964,-0.009469467980246546\n20180504 00:00,2615200,2667800,2611500,2660200,68817239,0.012946462569491946,-0.01757261851358629,-0.012290260856982467,-0.009474255536425615\n20180507 00:00,2669100,2680200,2661100,2669200,47379307,0.0033832042703556553,-0.017572695665529978,-0.012290959195419424,-0.009475285027083575\n20180508 00:00,2664800,2673200,2651500,2669200,57615594,0.0,-0.017571925538175322,-0.01229022068394835,-0.00947456336992305\n20180509 00:00,2676700,2698600,2671000,2695000,52616842,0.00966581747340034,-0.017579161010032433,-0.012283033072884447,-0.009459686866723336\n20180510 00:00,2703400,2723900,2702300,2720200,59562006,0.009350649350649443,-0.017594702327006176,-0.012285239298144957,-0.009454784203935033\n20180511 00:00,2722500,2731400,2715800,2728500,49302696,0.0030512462318947886,-0.017574272563705935,-0.012264872635583313,-0.009434451180143645\n20180514 00:00,2733400,2740700,2723700,2729800,48164268,0.000476452263148186,-0.017562809250432545,-0.012254271094166182,-0.009424309046114292\n20180515 00:00,2715200,2716100,2700300,2711000,75504782,-0.006886951425012833,-0.017629997019436492,-0.012316203398890965,-0.00948343968227852\n20180516 00:00,2711100,2727500,2711000,2722400,41303208,0.0042050903725563415,-0.01761652616137311,-0.012300726144072039,-0.009466892824773433\n20180517 00:00,2719300,2732300,2711400,2720100,49747414,-0.0008448427857772334,-0.01735043696218559,-0.012092941605347813,-0.009290190284798883\n20180518 00:00,2716100,2720200,2709300,2713300,57758893,-0.002499908091614267,-0.017374925974349087,-0.01211784582581148,-0.009315315851270984\n20180521 00:00,2729900,2739800,2726000,2733700,49218301,0.0075185198835365785,-0.017378745970409313,-0.012119367641513435,-0.009315612515527845\n20180522 00:00,2739400,2742500,2722500,2726100,46039188,-0.0027801148626404038,-0.017404362159968146,-0.012146613930418089,-0.00934372780436194\n20180523 00:00,2711900,2733900,2709900,2733600,52441278,0.002751183008693703,-0.01740347868871836,-0.012145363359031002,-0.00934228153325003\n20180524 00:00,2729500,2732200,2707800,2728000,64497794,-0.0020485806262803274,-0.01742294304195259,-0.0121642190483389,-0.00936081274607102\n20180525 00:00,2721500,2728600,2715800,2721500,43997689,-0.0023826979472141296,-0.01744547602405631,-0.012188477046515855,-0.009385990343933587\n20180529 00:00,2702600,2711700,2677600,2690200,98456218,-0.011501010472166118,-0.017576005608788504,-0.01229389783464042,-0.009478025725496091\n20180530 00:00,2705000,2731000,2704300,2726100,61173533,0.013344732733625797,-0.017617149447761413,-0.012306465735457899,-0.009475359899421753\n20180531 00:00,2722000,2724800,2702600,2709400,77780721,-0.006125967499358009,-0.01766622811042538,-0.012347999524890841,-0.009512871544853346\n20180601 00:00,2724900,2739400,2723300,2736000,61618180,0.009817671809256634,-0.017677411124924075,-0.012353738039415545,-0.009515707616588064\n20180604 00:00,2745100,2751800,2742700,2749000,41517726,0.004751461988304007,-0.017677742771308635,-0.01235231824724371,-0.00951335413900262\n20180605 00:00,2750200,2755300,2741900,2751000,43560811,0.0007275372862858287,-0.01767104632289708,-0.012345880772853559,-0.009507054722705004\n20180606 00:00,2759000,2775200,2750900,2774000,51074336,0.008360596146855581,-0.01765329179280495,-0.012319892011622362,-0.009476676323322494\n20180607 00:00,2779800,2782800,2763400,2773700,62257297,-0.00010814708002881979,-0.017660316051652473,-0.012327135150772902,-0.009484036146752656\n20180608 00:00,2767800,2782500,2766700,2781900,49348853,0.0029563399069834073,-0.01765396579051073,-0.012319780986366716,-0.009476146805230914\n20180611 00:00,2784200,2793700,2783100,2785600,44542078,0.0013300262410582686,-0.017640458470281277,-0.012306920072984773,-0.009463630488947496\n20180612 00:00,2790500,2793300,2782000,2789200,63125112,0.001292360712234375,-0.017634469508590808,-0.012300944413484451,-0.00945766192079552\n20180613 00:00,2792100,2794800,2778000,2780300,66680720,-0.003190879105119726,-0.017663727184507323,-0.012331024918679644,-0.00948818107323448\n20180614 00:00,2790100,2793300,2780600,2787300,59029532,0.0025177139157643857,-0.017649053660217046,-0.012316249537276919,-0.009473351392182009\n20180615 00:00,2766500,2775000,2753500,2771300,95685257,-0.005740322175582069,-0.017683981108503458,-0.01234538115230751,-0.0094993932699501\n20180618 00:00,2754700,2767000,2749500,2765600,46078648,-0.0020567964493197755,-0.017661872442030043,-0.01232675140914291,-0.009482618127928456\n20180619 00:00,2739800,2757500,2735300,2755000,73157804,-0.00383280300838873,-0.017685341217236757,-0.012357478458336377,-0.009517214536126651\n20180620 00:00,2762700,2767200,2755900,2759700,45977778,0.0017059891107078506,-0.01762135355067484,-0.012302412682201135,-0.009466904986764411\n20180621 00:00,2759800,2759800,2736800,2742400,63277398,-0.006268797333043419,-0.017672270037884748,-0.012345413744902185,-0.009505686365949045\n20180622 00:00,2756700,2757800,2744900,2747400,45162641,0.0018232205367560983,-0.01766369504234282,-0.012336704959399437,-0.009496906257513241\n20180625 00:00,2734500,2736100,2691100,2710000,115078014,-0.013612870350149242,-0.017839715304598255,-0.012478373779301066,-0.009620262450605856\n20180626 00:00,2716100,2725600,2707900,2716000,62816272,0.0022140221402213722,-0.017835321173870003,-0.01247345813842363,-0.009615068794597625\n20180627 00:00,2722700,2738700,2691800,2693500,89809831,-0.008284241531664183,-0.017838545925453655,-0.012476003272713119,-0.009617251627422364\n20180628 00:00,2692600,2717500,2684900,2708900,69724773,0.005717467978466617,-0.017825183140749882,-0.012470313293697466,-0.009615651992727549\n20180629 00:00,2720800,2736600,2711900,2712800,71773644,0.0014396987707188114,-0.017734466190064774,-0.012394280970116967,-0.009547447989519352\n20180702 00:00,2695100,2720400,2692400,2718600,54236596,0.002138012385726862,-0.01773386802458276,-0.012393540095113812,-0.009546631036598545\n20180703 00:00,2728800,2729800,2704200,2709000,35551259,-0.003531229309203243,-0.01776328275596365,-0.012420414023761229,-0.009572150472710416\n20180705 00:00,2721600,2731800,2709600,2731100,51422807,0.008157991878922077,-0.017772870726711215,-0.012420397415169508,-0.009567013698412513\n20180706 00:00,2731400,2758400,2727200,2754200,53890390,0.008458130423638854,-0.017684804936910336,-0.012337667416472095,-0.00948712819020846\n20180709 00:00,2765600,2779600,2765100,2779000,42066501,0.009004429598431507,-0.01769613736705655,-0.012342751420828347,-0.00948888118189698\n20180710 00:00,2784000,2790100,2780900,2789000,45949582,0.003598416696653395,-0.017691340091260145,-0.012336424768065603,-0.009481739223932594\n20180711 00:00,2771700,2780300,2765200,2768600,65023147,-0.007314449623521013,-0.017753070151260493,-0.012387710848734869,-0.009527457657866062\n20180712 00:00,2782900,2794300,2776100,2793700,52468803,0.009065953911724378,-0.017761016301802702,-0.01239152596962978,-0.009529070542141948\n20180713 00:00,2791900,2799300,2786600,2795900,40862085,0.0007874861295056323,-0.017763858162193034,-0.012394573152666637,-0.009532227181921916\n20180716 00:00,2796600,2798000,2788400,2793400,37927451,-0.0008941664580278674,-0.017777208044304802,-0.012410473639754775,-0.009549487387085016\n20180717 00:00,2784800,2809100,2784100,2804700,47922571,0.00404524951671803,-0.017767588062215945,-0.012398827234379049,-0.009536760702953385\n20180718 00:00,2805700,2811800,2800600,2810600,35961053,0.002103611794487925,-0.017762738174294638,-0.012393568183268006,-0.009531283528459908\n20180719 00:00,2803100,2807400,2794600,2800000,48872857,-0.003771436703906672,-0.01779622674774682,-0.012427924322044575,-0.009566102163100677\n20180720 00:00,2798000,2804800,2795100,2796800,61205760,-0.0011428571428571122,-0.01780416348571548,-0.01243538230414268,-0.009573304922215722\n20180723 00:00,2794600,2804100,2790600,2802000,40201459,0.0018592677345536934,-0.01779311107167727,-0.01242437128941637,-0.009562315977309395\n20180724 00:00,2817900,2825500,2806400,2816100,55176993,0.005032119914346822,-0.017783658685350905,-0.012411555660545786,-0.009547707416283413\n20180725 00:00,2813700,2843600,2812800,2840100,62755526,0.008522424629807235,-0.017794618841925194,-0.012412223808048323,-0.009542888931833067\n20180726 00:00,2831500,2841100,2830900,2833400,46601066,-0.002359071863666795,-0.017809020608210078,-0.012425196002465534,-0.00955509902677743\n20180727 00:00,2837300,2838200,2803800,2814200,69312181,-0.006776311145620051,-0.017862450810153606,-0.01246977080145818,-0.00959495304322439\n20180730 00:00,2815100,2816800,2793600,2799500,53456799,-0.0052235093454623405,-0.01789624045374123,-0.012498370395601813,-0.009620785841214046\n20180731 00:00,2807000,2820200,2803800,2813300,54314615,0.004929451687801345,-0.017884976561416667,-0.012484016668338281,-0.009604784934377792\n20180801 00:00,2814800,2821300,2801400,2808600,48996782,-0.001670635908008422,-0.01790165855516118,-0.012500344766522536,-0.009620924372148386\n20180802 00:00,2794400,2825800,2791600,2823900,50365933,0.005447553941465566,-0.017896006136562836,-0.0124905795455781,-0.00960896663149175\n20180803 00:00,2825500,2836500,2823400,2836000,41504629,0.004284854279542394,-0.017875699045396185,-0.012468985199209975,-0.009586686054138914\n20180806 00:00,2836400,2849700,2832100,2846400,35260013,0.003667136812411931,-0.017873033424736614,-0.012464955702333105,-0.009581929479897321\n20180807 00:00,2854000,2860100,2852500,2855800,38972125,0.003302417088251852,-0.017870660497672646,-0.012461600269906784,-0.009578050277497871\n20180808 00:00,2853900,2859100,2849400,2854600,34117081,-0.0004201974928216279,-0.017857704093180316,-0.012450067029491918,-0.009567275720586601\n20180809 00:00,2855400,2859700,2849200,2850700,31121962,-0.0013662159321796707,-0.017864981966031007,-0.012456754068341696,-0.009573647788016738\n20180810 00:00,2834200,2840500,2823600,2831600,64276743,-0.006700108745220423,-0.01773988245397177,-0.012359681950717315,-0.009491516970656502\n20180813 00:00,2834900,2841600,2817700,2821000,54746417,-0.0037434665913264054,-0.017771313304029607,-0.01238797380892966,-0.009518135443931146\n20180814 00:00,2829400,2841700,2825000,2839000,37456013,0.006380716058135505,-0.017754017648587268,-0.012379851252859626,-0.009514903033193498\n20180815 00:00,2823500,2825100,2801600,2817800,90330173,-0.007467418104966539,-0.01782086748448649,-0.012435656996831254,-0.009564821212624707\n20180816 00:00,2833800,2850400,2833600,2840600,60613010,0.00809141883739084,-0.017827985216408625,-0.012433311253003442,-0.009557430524892066\n20180817 00:00,2837600,2855600,2833800,2850600,55316391,0.003520383017672213,-0.01760250443010098,-0.012251667673589992,-0.009399156398264169\n20180820 00:00,2855800,2859700,2850600,2856700,36225951,0.002139900371851633,-0.017586139195344932,-0.012235791765263819,-0.009383541348047118\n20180821 00:00,2862600,2873100,2861100,2863400,57496192,0.0023453635313472887,-0.01758156775786599,-0.012230743088514903,-0.009378238256809293\n20180822 00:00,2858900,2867600,2855800,2861700,39705478,-0.0005936997974436142,-0.017569639645739137,-0.012235155505492746,-0.009391361749388394\n20180823 00:00,2859400,2869400,2854400,2857900,41655271,-0.0013278820281650283,-0.017552389626730985,-0.0122203344842685,-0.009377835617894785\n20180824 00:00,2864600,2876700,2863800,2875100,45762305,0.006018405122642401,-0.01753090693211686,-0.012195439338166218,-0.00935112130653118\n20180827 00:00,2888600,2899000,2886800,2897800,51785180,0.007895377552085137,-0.017537928636035857,-0.012193941562093776,-0.009345081827199722\n20180828 00:00,2903000,2904100,2894000,2899200,41169485,0.0004831251294086236,-0.017535942088730546,-0.012192022874273742,-0.00934319931502019\n20180829 00:00,2901600,2917400,2898900,2914800,51917476,0.005380794701986824,-0.01753188733493958,-0.01218423174540313,-0.009333416338420239\n20180830 00:00,2909400,2913600,2896300,2903000,55221298,-0.004048305201042934,-0.017570495628793724,-0.01222174336297843,-0.009370343321929292\n20180831 00:00,2898400,2908100,2892900,2903100,52151495,3.444712366507119e-05,-0.01757763136639697,-0.012233742192804258,-0.009384934648224194\n20180904 00:00,2898500,2902100,2886900,2898100,50641175,-0.0017222968550859585,-0.01759308812988043,-0.012248317085453146,-0.00939903941879434\n20180905 00:00,2894100,2896400,2878900,2890300,62293382,-0.0026914185155791914,-0.017545538708163718,-0.012209476784663996,-0.009364841918145524\n20180906 00:00,2891700,2894900,2870000,2881600,57093261,-0.0030100681590146117,-0.01757448989502001,-0.012237414483746746,-0.009392239330646382\n20180907 00:00,2869600,2886900,2867100,2876000,59629388,-0.0019433647973348123,-0.017585326258131702,-0.012247194258858715,-0.009401455842605369\n20180910 00:00,2887400,2890400,2878800,2881000,42190430,0.00173852573018074,-0.017572522118157054,-0.012234754453245032,-0.009389210262291376\n20180911 00:00,2873700,2895500,2869800,2890500,42539380,0.0032974661575841946,-0.017546329297219467,-0.012224800411659848,-0.009387913053891002\n20180912 00:00,2890500,2898000,2882400,2891200,53961780,0.0002421726344923325,-0.01755431196115266,-0.01223408139275687,-0.009397886163063926\n20180913 00:00,2903000,2910300,2900000,2908300,44562244,0.005914499169894949,-0.017549382268571223,-0.012224278203708305,-0.00938548493108202\n20180914 00:00,2911100,2912700,2900000,2908800,47621027,0.0001719217412234908,-0.017547020876213206,-0.012222036973354675,-0.009383307758648294\n20180917 00:00,2908200,2908600,2890400,2893400,59631885,-0.005294279427942805,-0.017563950392864937,-0.012235978135051168,-0.009395655839375888\n20180918 00:00,2895500,2915700,2895500,2909100,50345855,0.00542614225478677,-0.0175631602010671,-0.012231584100015631,-0.009389340608845546\n20180919 00:00,2909800,2916700,2908300,2912200,42388455,0.001065621669932293,-0.01756293454820942,-0.01223134957055314,-0.009389101347297873\n20180920 00:00,2926400,2939400,2925100,2935800,89443398,0.008103839022045145,-0.017565015201993082,-0.012223818666220788,-0.009376446556899287\n20180921 00:00,2931700,2932200,2918100,2919900,86818431,-0.005415900265685725,-0.017591109969417353,-0.01224545026444418,-0.009395698856136645\n20180924 00:00,2914100,2915000,2903700,2910200,44500016,-0.003322031576423856,-0.017614286745034107,-0.012265932371059518,-0.009414744444678347\n20180925 00:00,2915300,2916500,2904900,2907500,38617967,-0.000927771287196788,-0.01760704379220956,-0.012259512939986499,-0.009408764030003812\n20180926 00:00,2908900,2922400,2894100,2898800,63273109,-0.0029922613929492803,-0.01762909890338141,-0.012279286039692952,-0.009427320597842133\n20180927 00:00,2904100,2919100,2901000,2906900,49923097,0.002794259693666312,-0.017629939655097675,-0.012281159312063526,-0.009429744303152906\n20180928 00:00,2900100,2912800,2899500,2907200,55605049,0.00010320272455199841,-0.017634258691014922,-0.012285487834166987,-0.009434077882307138\n20181001 00:00,2921200,2929300,2909800,2917300,55669774,0.0034741331865713043,-0.01763428238343202,-0.012285552184711638,-0.00943416390754914\n20181002 00:00,2915700,2923600,2911500,2915600,42173808,-0.0005827306070681493,-0.017646466660620096,-0.01229988815773688,-0.009449646941663307\n20181003 00:00,2927400,2932100,2913200,2917200,55817020,0.000548772122376251,-0.017651384705492486,-0.012305215420324676,-0.009455192356700969\n20181004 00:00,2912200,2912400,2876600,2894400,99293459,-0.007815713698066662,-0.01772848742331353,-0.012370196052375292,-0.009513710749682429\n20181005 00:00,2896500,2902700,2862300,2878200,90999928,-0.005597014925373123,-0.01777931172015942,-0.012419525858325632,-0.009562243848066376\n20181008 00:00,2870600,2882200,2855000,2878200,76849736,0.0,-0.017773331962004573,-0.012413974040520958,-0.009556920163678883\n20181009 00:00,2874300,2888600,2867700,2874000,66107852,-0.0014592453616844026,-0.017772100764027535,-0.012412880444785699,-0.009555899923189554\n20181010 00:00,2869100,2869100,2778900,2783000,181989770,-0.03166318719554628,-0.018503585265855646,-0.012969954453787664,-0.010019996343832775\n20181011 00:00,2771500,2789000,2703900,2721700,246184984,-0.02202659001077978,-0.01887973789408274,-0.013263346468341647,-0.010269268981474691\n20181012 00:00,2768600,2770800,2723700,2759500,164510497,0.013888378586912609,-0.018920073910045514,-0.01327398899917951,-0.01026408202526654\n20181015 00:00,2755400,2770400,2743000,2744000,90506955,-0.005616959594129334,-0.018966601587764798,-0.013314831420615684,-0.010301893657615201\n20181016 00:00,2765600,2808200,2760700,2804000,98163677,0.02186588921282806,-0.019141176715512503,-0.013414397002968833,-0.010361471928874495\n20181017 00:00,2804400,2811500,2775600,2804500,96178817,0.00017831669044232612,-0.01914324671765589,-0.013416472960827253,-0.010363551061702564\n20181018 00:00,2794100,2800700,2749700,2764000,123177259,-0.014441076840791545,-0.019324921684957592,-0.013562852092304734,-0.010491114113706467\n20181019 00:00,2771600,2793000,2754700,2762500,117788143,-0.0005426917510853446,-0.01932858866625693,-0.013566393931458254,-0.010494589240045114\n20181022 00:00,2770000,2773500,2744200,2750100,73429798,-0.004488687782805423,-0.019366732945670227,-0.013604581004907343,-0.010532799126836334\n20181023 00:00,2708700,2748700,2686100,2736100,125899322,-0.005090723973673716,-0.019377807774457755,-0.013613808043537368,-0.010541041115370728\n20181024 00:00,2733300,2737600,2647000,2653200,148689080,-0.030298600197361192,-0.020008113290553683,-0.014096732285559339,-0.01094539694553519\n20181025 00:00,2673100,2718100,2662300,2700800,119060991,0.0179406000301523,-0.020070269894841574,-0.014114070278949183,-0.010938842303296493\n20181026 00:00,2659200,2687800,2623000,2653300,178385574,-0.017587381516587675,-0.02031211959652479,-0.014307018816167536,-0.011105721810686408\n20181029 00:00,2688100,2702500,2598600,2638600,145358219,-0.005540270606414599,-0.020349832143085236,-0.01434962880090065,-0.0111509426015875\n20181030 00:00,2637300,2681200,2631200,2677700,139865192,0.014818464337148507,-0.020380948906595964,-0.014350073416179629,-0.011135036008139533\n20181031 00:00,2707100,2732300,2701300,2706300,109862120,0.010680808156253496,-0.02040099700300752,-0.01435364330994131,-0.011129821433042456\n20181101 00:00,2716400,2737300,2703800,2735100,90496605,0.010641835716661108,-0.020419631032176883,-0.014355984630717685,-0.011123477171262039\n20181102 00:00,2747500,2752300,2696000,2718900,105725403,-0.005923000987166804,-0.020464613231715955,-0.014395126337631781,-0.011159505333169194\n20181105 00:00,2724800,2740100,2713500,2733900,58423015,0.005516936996579513,-0.020465418307942723,-0.014393163333295466,-0.01115606667532736\n20181106 00:00,2733600,2753000,2732500,2751200,50219235,0.0063279563992830745,-0.020464667358710147,-0.014387075386111715,-0.011147133594284197\n20181107 00:00,2775500,2811000,2770800,2810100,86619120,0.02140883977900554,-0.020606124617204784,-0.014461397503580218,-0.011185666216490187\n20181108 00:00,2801100,2812100,2792200,2805000,56765848,-0.001814882032667886,-0.020621592496953296,-0.014476421297391745,-0.011200453269731948\n20181109 00:00,2790000,2792300,2761800,2777600,84222634,-0.00976827094474153,-0.02069035411083158,-0.014532177669299306,-0.011249276595267895\n20181112 00:00,2772400,2774600,2720000,2725700,88721475,-0.018685195852534586,-0.02094702534727513,-0.014735019118981185,-0.011423421584812169\n20181113 00:00,2730600,2753300,2712500,2720600,87233813,-0.0018710789888836121,-0.0209602002422486,-0.014747590584336334,-0.011435671364070647\n20181114 00:00,2741800,2746100,2684500,2702000,112019431,-0.0068367271925310336,-0.021000213314640515,-0.014781129576636416,-0.01146575904822965\n20181115 00:00,2687600,2735400,2670200,2730200,118697478,0.010436713545521892,-0.020977416911026284,-0.014747060265614245,-0.011425680191981171\n20181116 00:00,2717400,2747400,2701800,2737300,107996462,0.0026005420848289607,-0.020969271858135956,-0.014748160477418061,-0.011431709020183409\n20181119 00:00,2731700,2733700,2680800,2691000,88067909,-0.016914477770065384,-0.021168496156435918,-0.014905269467423978,-0.011566366495176015\n20181120 00:00,2654100,2670000,2631600,2641200,121906074,-0.018506131549609783,-0.02142271446874317,-0.015108512237917773,-0.011742434392952602\n20181121 00:00,2657800,2671500,2650200,2650200,65299409,0.0034075420263517398,-0.021419939726278356,-0.01511019500883044,-0.011746493447752778\n20181123 00:00,2631600,2648200,2631000,2632500,37268417,-0.006678741227077234,-0.021465478142272464,-0.0151491286683354,-0.011781906136012793\n20181126 00:00,2658000,2675500,2653400,2675000,67846819,0.01614434947768273,-0.02153615710672879,-0.015183020100213683,-0.011796186270397727\n20181127 00:00,2663400,2684000,2656600,2684000,68394857,0.0033644859813084516,-0.02152571804740665,-0.015171147521755775,-0.011783549488192956\n20181128 00:00,2696100,2745800,2685400,2745800,113271909,0.023025335320417284,-0.021683481399040725,-0.015267721401380252,-0.01184750348670702\n20181129 00:00,2737100,2755500,2724400,2739800,70520259,-0.002185155510233794,-0.021692237726368496,-0.015275745241875114,-0.011855136841181661\n20181130 00:00,2738100,2762800,2734500,2756500,79834477,0.006095335425943427,-0.021683882980278953,-0.015272929687348384,-0.011855274209180535\n20181203 00:00,2803800,2804000,2775100,2793000,87120547,0.013241429348811895,-0.021703720176397445,-0.015269150094895977,-0.011838904594129604\n20181204 00:00,2783400,2788400,2699000,2702500,156127119,-0.0324024346580738,-0.022342168103801914,-0.01575682796364458,-0.012246207502499514\n20181206 00:00,2659700,2699600,2624400,2698400,183371757,-0.0015171137835338078,-0.02232853340891073,-0.015744770154303277,-0.012234990325009947\n20181207 00:00,2694500,2712200,2626400,2635700,141538111,-0.02323599169878443,-0.022681196776874777,-0.016021354522229053,-0.012471017259528582\n20181210 00:00,2633700,2651600,2586200,2640700,144445674,0.0018970292521911514,-0.022683232821468214,-0.016024254180589538,-0.012474377307192672\n20181211 00:00,2676200,2678600,2624800,2641300,113002276,0.00022721248153900753,-0.022690073459779823,-0.01603516589170306,-0.012487459292152805\n20181212 00:00,2674500,2689500,2653800,2654600,86056529,0.005035399235225002,-0.02268971156081859,-0.016032559083203526,-0.012483655730685184\n20181213 00:00,2664500,2674900,2641200,2653700,86351666,-0.0003390341294357002,-0.022696699012495897,-0.016039945332940925,-0.012491254578192756\n20181214 00:00,2629200,2640300,2598500,2604700,104539987,-0.01846478501714588,-0.02293053719411753,-0.016226615854153484,-0.012652780194174576\n20181217 00:00,2593900,2606500,2535300,2553600,147122082,-0.019618382155334624,-0.023163851829046022,-0.01640963779267246,-0.01280899128233447\n20181218 00:00,2571900,2579400,2533500,2550800,119888002,-0.0010964912280702066,-0.02317620779860912,-0.016423368243021447,-0.012823454463304457\n20181219 00:00,2551800,2593900,2493500,2512600,197525731,-0.014975693899952902,-0.02334340146587656,-0.016566363776673,-0.012953550061465145\n20181220 00:00,2497800,2516200,2446600,2471700,223400311,-0.01627795908620555,-0.023506371318751912,-0.016696050710380227,-0.013065493994119815\n20181221 00:00,2467500,2496900,2399900,2407000,213445004,-0.02617631589594205,-0.023916378525090782,-0.017015768350576013,-0.013337078600700988\n20181224 00:00,2390000,2402900,2343400,2343400,126345859,-0.026422933111757363,-0.02433414814460941,-0.017344264640156235,-0.01361798360842696\n20181226 00:00,2359000,2461800,2337600,2461800,194254142,0.05052487838183839,-0.025275691985238276,-0.017950948527322094,-0.014046154893475776\n20181227 00:00,2425700,2481800,2389600,2480700,162914215,0.00767730928588839,-0.025267207753938925,-0.017934634384886673,-0.014025666654386548\n20181228 00:00,2497300,2513200,2464500,2477500,137837623,-0.0012899584794614505,-0.0252745044152163,-0.017941858675712307,-0.01403285236479215\n20181231 00:00,2495000,2501600,2474800,2499200,109065742,0.00875882946518658,-0.025280439761389766,-0.017938265050232334,-0.014024178879783545\n20190102 00:00,2460600,2512100,2459600,2501800,113049958,0.0010403329065300504,-0.025256558611972735,-0.017915787287646052,-0.01400244925752382\n20190103 00:00,2483000,2485700,2436700,2442100,120229906,-0.02386281877048524,-0.025594744144695925,-0.018190963135007055,-0.014244034874771438\n20190104 00:00,2475900,2531100,2471700,2523900,127632690,0.03349576184431435,-0.02595039032002437,-0.018410838746569888,-0.014391531701179319\n20190107 00:00,2527600,2559300,2517000,2543800,92782393,0.007884623004080993,-0.025955053361050206,-0.01840986975690462,-0.014387560296792683\n20190108 00:00,2568600,2573100,2540100,2567700,91402346,0.009395392719553364,-0.025963010094060202,-0.01841232035789656,-0.014387075599179996\n20190109 00:00,2575600,2589100,2562000,2579700,81042188,0.00467344315924767,-0.025959890552195615,-0.01840680769136631,-0.014380287166745708\n20190110 00:00,2563100,2591500,2555200,2588800,89194945,0.0035275419622435855,-0.02595811905492042,-0.01840408564244439,-0.014377058382258225\n20190111 00:00,2576500,2589800,2570300,2589800,63179848,0.00038627935723112294,-0.025949868324375135,-0.01839602448168242,-0.014369098280446276\n20190114 00:00,2568700,2583000,2564100,2574000,55596057,-0.006100857209050847,-0.025994198975756676,-0.018442942366555398,-0.014417395409920061\n20190115 00:00,2578200,2607000,2578200,2603500,75236655,0.01146076146076136,-0.02601257875153546,-0.018450193031575232,-0.014418713187175075\n20190116 00:00,2608200,2619600,2606000,2609800,64108161,0.002419819473785223,-0.025987884713236608,-0.01842594635005412,-0.014394704989896832\n20190117 00:00,2600000,2639200,2599700,2629600,81545544,0.0075867882596367675,-0.025981404129627923,-0.018423625177368383,-0.014394601183783159\n20190118 00:00,2650000,2669700,2641100,2664600,107074964,0.01331000912686342,-0.025996565398786226,-0.01841691830653553,-0.014376236488439165\n20190122 00:00,2647700,2650400,2610600,2628600,94951142,-0.013510470614726433,-0.026133195103040397,-0.01853451753514733,-0.014483690640904014\n20190123 00:00,2640000,2647600,2606600,2634100,78007199,0.0020923685612113108,-0.02613045030047582,-0.018539596567217254,-0.014492940530267246\n20190124 00:00,2632100,2641900,2620900,2635500,52302743,0.0005314908317830547,-0.026134713702280012,-0.018544460506201114,-0.014498124613399433\n20190125 00:00,2656200,2667000,2651100,2657800,82960927,0.008461392525137557,-0.0261308286399008,-0.018531425937168684,-0.014480212476225867\n20190128 00:00,2633800,2638300,2618000,2637600,78330632,-0.007600270900744999,-0.02618522104219487,-0.018579212110426825,-0.014524476893229825\n20190129 00:00,2639300,2645500,2624800,2634100,57549403,-0.001326963906581713,-0.02617879267743826,-0.018589668529195597,-0.014543934527617628\n20190130 00:00,2650900,2685200,2642500,2675800,83541451,0.015830834060969634,-0.026179767984679907,-0.018564247866256232,-0.014504442270647126\n20190131 00:00,2675000,2703900,2672700,2699300,80400276,0.00878242021077802,-0.02609486886615925,-0.018482086428829186,-0.014423740280880908\n20190201 00:00,2701300,2712000,2691900,2700600,72038042,0.00048160634238514355,-0.02609492189723532,-0.018482141676298476,-0.014423796709901224\n20190204 00:00,2701400,2720200,2693600,2719600,52322390,0.007035473598459685,-0.02608311204776405,-0.018464293250246303,-0.014402729141018167\n20190205 00:00,2724700,2734400,2718900,2731000,66377266,0.004191792910722247,-0.025790745259092373,-0.01822739395198826,-0.014195399356654634\n20190206 00:00,2728000,2733400,2719200,2727400,48360155,-0.001318198462101794,-0.024886008723312526,-0.017540610771686716,-0.013624806303671114\n20190207 00:00,2709300,2715400,2683000,2701400,87046957,-0.009532888465204947,-0.024877159557287247,-0.0175683392494227,-0.013672034187948871\n20190208 00:00,2687200,2705100,2678300,2704700,66123754,0.0012215888058044744,-0.02483821923848456,-0.017533079917619886,-0.013638737176695023\n20190211 00:00,2711700,2714900,2700400,2706200,59745218,0.0005545901578734025,-0.024065592717744333,-0.016942543058752757,-0.013145271642790522\n20190212 00:00,2724300,2745200,2723400,2741000,63150422,0.012859359988175223,-0.02404790103096262,-0.016932547583076284,-0.013139378988776153\n20190213 00:00,2750600,2759300,2745600,2749900,58128429,0.0032469901495804088,-0.024004311996073814,-0.016915023717514577,-0.013135750368534411\n20190214 00:00,2737700,2756400,2728700,2743800,75153118,-0.002218262482272082,-0.024023202251367465,-0.016933850376605355,-0.013154543124724761\n20190215 00:00,2763800,2774000,2761300,2773700,79085885,0.010897295721262523,-0.024005655205078788,-0.01692446489882369,-0.01314950854891413\n20190219 00:00,2765200,2785800,2764700,2778500,52093038,0.0017305404333560759,-0.023979465727511234,-0.016918769230166993,-0.013154738053955076\n20190220 00:00,2778500,2789200,2772500,2784100,67228767,0.0020154759762460728,-0.02397421435730476,-0.016913053886324032,-0.013148775367483339\n20190221 00:00,2777500,2781000,2763500,2774200,54799005,-0.0035559067562228597,-0.023951270544143963,-0.016893686495085703,-0.013131314553538127\n20190222 00:00,2781500,2793500,2778200,2791400,69886502,0.0061999855814289795,-0.023911430614251033,-0.016852527690954966,-0.013089452662431415\n20190225 00:00,2806900,2813100,2794300,2795200,63299670,0.0013613240667764703,-0.023911238410662315,-0.016852315919881088,-0.013089230460003601\n20190226 00:00,2791300,2802900,2789000,2793200,51868143,-0.0007155123068116609,-0.02386589902631883,-0.01683961953611971,-0.013093935939064454\n20190227 00:00,2785300,2795900,2774800,2792000,51380666,-0.0004296147787483662,-0.023854113286922357,-0.01684528485206841,-0.01310890434804395\n20190228 00:00,2789700,2794500,2783200,2786800,55290567,-0.0018624641833810962,-0.02374227854442734,-0.016753861368431124,-0.013028362030976442\n20190301 00:00,2804400,2808700,2788200,2804200,66469737,0.006243720396153396,-0.023646367167860647,-0.016667012553075546,-0.012946344433468534\n20190304 00:00,2816500,2818700,2768400,2794000,92363298,-0.003637401041295174,-0.023511262658489223,-0.016558811374432075,-0.012852485320886401\n20190305 00:00,2795500,2797600,2784100,2790200,50799626,-0.0013600572655690923,-0.02352711815360111,-0.016577595744310794,-0.012872831063065672\n20190306 00:00,2791600,2791600,2769700,2773300,65186339,-0.006056913482904491,-0.023555521605776022,-0.016618155459995693,-0.012919871237846223\n20190307 00:00,2768400,2769700,2740700,2750100,87135188,-0.008365485162081243,-0.023628725745833936,-0.01668258637470725,-0.012979625178588989\n20190308 00:00,2729200,2746500,2724300,2744600,75928240,-0.0019999272753717934,-0.023637083026151796,-0.016690394301327235,-0.012987140246785394\n20190311 00:00,2752400,2786200,2752300,2784400,55683813,0.014501202360999832,-0.023682710736216667,-0.01671142347634765,-0.012995056033794961\n20190312 00:00,2790900,2800700,2788500,2794900,67070688,0.0037710099123688945,-0.02360677508305174,-0.016673579149602925,-0.01297751805221645\n20190313 00:00,2804900,2823600,2803000,2813400,67192638,0.006619199255787356,-0.023594215635553716,-0.01665554523516452,-0.012956565719709162\n20190314 00:00,2813300,2818400,2806700,2811600,58035218,-0.000639795265515053,-0.023551729933571963,-0.016618736478119428,-0.012922783321003543\n20190315 00:00,2805600,2822000,2803400,2813100,70500698,0.0005335040546308178,-0.023516730590803718,-0.016587404527662396,-0.01289340644381726\n20190318 00:00,2815300,2826500,2813000,2823300,53932917,0.003625893142796155,-0.023502838137834575,-0.01657209998755712,-0.012877349125284815\n20190319 00:00,2834900,2843600,2814200,2824000,75871459,0.00024793681153267855,-0.023486014965822713,-0.01655653510177412,-0.012862455027234421\n20190320 00:00,2821600,2835000,2803200,2815500,76226168,-0.003009915014164255,-0.02336300696682386,-0.016457332056514153,-0.012775942314727767\n20190321 00:00,2806300,2851800,2806000,2847300,71740185,0.011294619072988787,-0.02337987782104468,-0.016458107788164405,-0.012768137796092038\n20190322 00:00,2832200,2838000,2791800,2792500,112328040,-0.019246303515611296,-0.023618734683424847,-0.016647135006187544,-0.012930601015091856\n20190325 00:00,2788900,2801900,2776400,2790400,76291897,-0.0007520143240823396,-0.02323295436088091,-0.016346182804417735,-0.012674870370619316\n20190326 00:00,2809700,2821800,2795700,2811200,59544156,0.0074541284403670804,-0.02292636698375244,-0.0160959658689143,-0.012454704308960025\n20190327 00:00,2811300,2817500,2779300,2796500,66485128,-0.005229083665338696,-0.022729760676579315,-0.015994837760249625,-0.01240447527462457\n20190328 00:00,2803600,2812100,2790700,2807100,51663386,0.003790452351153162,-0.022511956053904936,-0.015816655831615574,-0.012247416057568527\n20190329 00:00,2824100,2828400,2811400,2824800,62399538,0.0063054397777064786,-0.022486684487565304,-0.01578802268121894,-0.012216990859149894\n20190401 00:00,2847000,2861600,2844100,2858300,63982897,0.011859246672330848,-0.022479986932408557,-0.01578435470193009,-0.012214937935545959\n20190402 00:00,2860400,2862300,2851000,2859700,37196324,0.0004898016303396258,-0.02216285288488656,-0.015534462602675957,-0.012000892270099685\n20190403 00:00,2873300,2877500,2857500,2864200,58863047,0.0015735916354862045,-0.022134992926254086,-0.015527834421109665,-0.012005582670323952\n20190404 00:00,2868000,2874600,2860100,2871800,46049322,0.0026534459884086647,-0.02211861954496729,-0.015525610481068847,-0.012010901745054533\n20190405 00:00,2879500,2886300,2876000,2885700,52350041,0.004840169928268079,-0.022113225110844657,-0.01552534395997673,-0.012013368895424294\n20190408 00:00,2881000,2889000,2873700,2887900,43533191,0.0007623800117821933,-0.021773277596570897,-0.015258189560302907,-0.011785020235789116\n20190409 00:00,2877200,2880800,2867000,2873100,58219574,-0.005124831192215851,-0.021818481483788604,-0.015301837853273706,-0.011827839247223013\n20190410 00:00,2877700,2883800,2873200,2882900,45338210,0.003410949845115141,-0.02175573852529734,-0.015271993958700738,-0.011815533721889293\n20190411 00:00,2888400,2888400,2875800,2882100,50745623,-0.0002774983523535779,-0.021720811220861082,-0.015241526946689798,-0.011787444475265975\n20190412 00:00,2900100,2904700,2892600,2901600,54347951,0.006765899864682012,-0.021716489867347297,-0.015240170226722676,-0.011787668190472621\n20190415 00:00,2902700,2903500,2890800,2899700,40803641,-0.0006548111386821542,-0.02170258332501313,-0.015227689072447202,-0.011775946905296908\n20190416 00:00,2909600,2910100,2895000,2901600,47250452,0.0006552401972617083,-0.021702669940773984,-0.015236546274371288,-0.011789479674251027\n20190417 00:00,2914100,2914200,2889900,2894500,46905428,-0.0024469258340226174,-0.021706220115136406,-0.015254337656557017,-0.01181486299163097\n20190418 00:00,2901200,2903200,2886600,2900200,57128888,0.0019692520297114324,-0.02170258754014128,-0.01525034049950109,-0.01181067147722748\n20190422 00:00,2891700,2904400,2890700,2902700,34371097,0.0008620095165849939,-0.02166034150991613,-0.01521301927202368,-0.011775975643871768\n20190423 00:00,2906800,2931300,2904200,2928800,48067844,0.008991628483825398,-0.021588843182641856,-0.015142156412208911,-0.011705451549408257\n20190424 00:00,2927600,2931500,2920800,2922300,39141617,-0.0022193389784211925,-0.021600294635325302,-0.015152658744367949,-0.01171544790892774\n20190425 00:00,2921200,2927800,2907300,2920500,47913789,-0.000615953187557694,-0.021454967996758136,-0.015034965379024899,-0.011612485739289741\n20190426 00:00,2921200,2934900,2912500,2934100,40182622,0.004656736860126687,-0.02145295935807604,-0.015031005058620263,-0.011607484984580578\n20190429 00:00,2935300,2944500,2934100,2938700,54400805,0.0015677720595752564,-0.02144123985683495,-0.015032713764814902,-0.011616352218471137\n20190430 00:00,2935200,2943400,2919200,2940200,65799876,0.0005104297818763204,-0.021442816904528733,-0.015034326744639965,-0.011617984353582427\n20190501 00:00,2947600,2949500,2918000,2918100,60258030,-0.007516495476498242,-0.021440747089551265,-0.015032660907533637,-0.011616533875584374\n20190502 00:00,2916800,2927000,2895500,2911800,60849168,-0.002158939035673879,-0.021458759300817424,-0.015049971829659033,-0.011633470943063795\n20190503 00:00,2928000,2943400,2925700,2940300,46544275,0.009787760148361802,-0.021410890608414654,-0.014996938990539515,-0.01157768511643834\n20190506 00:00,2892400,2933100,2889300,2928200,87572687,-0.004115226337448541,-0.0214253262738338,-0.01500936796583845,-0.011589044332659497\n20190507 00:00,2901500,2908100,2858200,2879300,122126119,-0.01669967898367597,-0.02160981865740742,-0.015174277214239825,-0.011743513884163547\n20190508 00:00,2875600,2894300,2868800,2875300,76825136,-0.0013892265481193489,-0.02162572179898109,-0.015191069469101011,-0.011760780122028342\n20190509 00:00,2852000,2873300,2833100,2866600,92353972,-0.0030257712238722645,-0.021643212415357115,-0.015206953690526659,-0.011775807980250047\n20190510 00:00,2856400,2889400,2823000,2881000,98319928,0.005023372636572931,-0.021629600569727635,-0.015202726148272241,-0.011776583175400368\n20190513 00:00,2823900,2834900,2799300,2808600,109539319,-0.025130163137799366,-0.022040244008947767,-0.015533156638484744,-0.012064252439306913\n20190514 00:00,2820100,2851000,2818500,2834000,71206743,0.009043651641387207,-0.022050543142253805,-0.015533472606552528,-0.012059246418926644\n20190515 00:00,2816000,2857600,2813600,2850600,63998271,0.0058574453069866195,-0.02204462250368838,-0.015523031076750996,-0.012046394818735687\n20190516 00:00,2858300,2892100,2857700,2877000,64428827,0.00926120816670184,-0.0219952018345998,-0.01546931601614443,-0.011990390433901314\n20190517 00:00,2851300,2886000,2851300,2858400,83049965,-0.006465067778936406,-0.022051898143613375,-0.015521807258054295,-0.012040639970098103\n20190520 00:00,2840600,2854300,2831200,2839500,54207516,-0.006612090680100713,-0.022096842742969452,-0.015560289851483501,-0.012075677692078898\n20190521 00:00,2858300,2869300,2855500,2865100,42481385,0.009015671773199507,-0.02208471161991261,-0.015538325814421397,-0.012048471764945072\n20190522 00:00,2854300,2866700,2851000,2856300,44484176,-0.003071446022826385,-0.02210646910764451,-0.015566020199925167,-0.012079331088682869\n20190523 00:00,2831600,2832100,2805800,2821400,84366849,-0.012218604488324014,-0.022214004921544725,-0.015653025923382868,-0.01215539229689266\n20190524 00:00,2837500,2841900,2820900,2827800,47298776,0.002268377401290156,-0.022214838644562168,-0.01565417666440565,-0.01215671203904104\n20190528 00:00,2830100,2841400,2801500,2801500,60527933,-0.009300516302425899,-0.022284358511277396,-0.015711761225361658,-0.012207933932660722\n20190529 00:00,2789100,2793500,2767200,2782700,92901721,-0.006710690701409949,-0.02232103121388543,-0.015742722029789512,-0.01223584974530432\n20190530 00:00,2790800,2800400,2778100,2790300,55710278,0.0027311603837998355,-0.022202320392202626,-0.015642242394232096,-0.012145089087609933\n20190531 00:00,2762000,2771200,2752500,2752700,72088865,-0.013475253556965217,-0.022313995586771034,-0.015752380595730257,-0.012254407923789647\n20190603 00:00,2753000,2765500,2730900,2745700,87492324,-0.002542957823228109,-0.022284505539011713,-0.015727364347250878,-0.012231776641152116\n20190604 00:00,2771100,2806800,2766200,2805300,68467401,0.021706668609097868,-0.022415726319712524,-0.01580632375945088,-0.012282875711185802\n20190605 00:00,2823400,2829900,2803200,2829600,62528891,0.008662175168431263,-0.022424684572605467,-0.015808111586596806,-0.012280841010898534\n20190606 00:00,2832900,2855500,2825700,2848000,59513845,0.006502685891998761,-0.022420735393988617,-0.015798605785940473,-0.01226837299559399\n20190607 00:00,2859500,2888500,2857500,2876500,64257228,0.01000702247191021,-0.022428324757023343,-0.01580205793130987,-0.012269619605534849\n20190610 00:00,2893500,2908200,2888800,2889700,54537978,0.004588910133843216,-0.022418817440884368,-0.01578987549117449,-0.012256011066695677\n20190611 00:00,2909500,2914000,2881900,2889000,48746820,-0.00024223967885939057,-0.022427993883650035,-0.015800082029648676,-0.012266766745380435\n20190612 00:00,2886400,2892600,2878200,2883900,40324747,-0.0017653167185877061,-0.022441482080237118,-0.01581321720008616,-0.012279713718883862\n20190613 00:00,2893700,2899800,2886200,2895800,43570266,0.004126356669787334,-0.022437037838416638,-0.015806780405980728,-0.012272214702528317\n20190614 00:00,2892700,2899200,2884100,2892600,44888094,-0.001105048691207977,-0.02242409442342025,-0.015795203967771343,-0.012261366994585894\n20190617 00:00,2895300,2902200,2891800,2893700,35295998,0.00038028071631068805,-0.02243003247123583,-0.01580188722033583,-0.012268447513044555\n20190618 00:00,2913800,2935600,2910000,2924000,77625000,0.01047102325742122,-0.022398697433460228,-0.015760886225605085,-0.012222293632427729\n20190619 00:00,2925300,2936500,2914900,2930600,70013693,0.0022571819425445394,-0.02238088679245703,-0.0157432782092195,-0.012204793634476028\n20190620 00:00,2960200,2963100,2936100,2958600,86590076,0.009554357469460095,-0.022360313349267563,-0.01571316931315834,-0.012169601423772769\n20190621 00:00,2941400,2955100,2937600,2940000,67991002,-0.0062867572500506785,-0.02241180598295043,-0.01575886882703614,-0.012212212646918623\n20190624 00:00,2941800,2945800,2934700,2936400,38096535,-0.001224489795918382,-0.022372359441235296,-0.01572511406400886,-0.012181492150048693\n20190625 00:00,2936700,2937300,2906400,2907600,71876031,-0.00980792807519415,-0.022465856117327522,-0.015804742289630976,-0.012253727156042284\n20190626 00:00,2917800,2923100,2903500,2904700,44754247,-0.000997386160407232,-0.022324665460428047,-0.015690247568541343,-0.01215346393955056\n20190627 00:00,2912900,2920600,2909300,2915000,34194112,0.0035459772093504593,-0.02232261938492012,-0.01568725250612312,-0.012149962975721974\n20190628 00:00,2925700,2935500,2920200,2930000,48292420,0.005145797598627766,-0.02224471876545655,-0.015616560353609952,-0.012083113630266748\n20190701 00:00,2966800,2969100,2943300,2956600,62311396,0.009078498293515258,-0.022253823020297697,-0.01561909040957283,-0.012082139005133967\n20190702 00:00,2955900,2964900,2946900,2964300,54952846,0.0026043428262192414,-0.0222510033031912,-0.015615742837130027,-0.01207851003496459\n20190703 00:00,2971900,2988200,2970200,2988000,31250129,0.007995142192085858,-0.022253704887229116,-0.015610844183138921,-0.012069559722203188\n20190705 00:00,2974600,2986400,2960200,2984600,41808407,-0.0011378848728246238,-0.02223792193068251,-0.01559690255550852,-0.012056599700204592\n20190708 00:00,2970100,2973500,2962300,2968200,38037047,-0.0054948736849158575,-0.022280062056104798,-0.015642569138958572,-0.01210414622538038\n20190709 00:00,2955100,2975200,2954800,2971900,35212296,0.0012465467286570941,-0.02227785238796023,-0.015649390135075887,-0.012115781435199757\n20190710 00:00,2984000,2996600,2977900,2986100,49211837,0.004778088091793142,-0.022268226951718862,-0.01564749748614711,-0.012118011106573876\n20190711 00:00,2993400,2995800,2982000,2993100,46132132,0.0023441947690967524,-0.022270043099710996,-0.01565023961385429,-0.012121246870640772\n20190712 00:00,2998600,3007300,2995100,3006500,35952915,0.00447696368313788,-0.02220333527115742,-0.015589366245550601,-0.012063483831507184\n20190715 00:00,3011200,3011300,3002200,3007500,28272073,0.00033261267254292015,-0.02220174447239153,-0.015598393834594531,-0.012078172043801566\n20190716 00:00,3006400,3008800,2994400,2997100,35700618,-0.003458021612635087,-0.022225357437331887,-0.015620024811435108,-0.012098746430120055\n20190717 00:00,2997700,2999300,2977400,2977400,35522550,-0.006573020586567058,-0.02226984730104821,-0.015658083125859076,-0.012133376109414774\n20190718 00:00,2971800,2992400,2967000,2988300,46198657,0.003660912205279754,-0.02227006759619897,-0.01565868567241846,-0.01213418243278566\n20190719 00:00,3000100,3000700,2969700,2971700,63466815,-0.00555499782485025,-0.02231515381125582,-0.015699467073597956,-0.012172668953616133\n20190722 00:00,2976100,2984900,2970500,2979000,36969602,0.002456506376821377,-0.022284861802944162,-0.01567080910284086,-0.012144882082232987\n20190723 00:00,2991500,3000300,2982300,3000300,40884695,0.0071500503524672965,-0.022273280960150816,-0.01565298044881517,-0.012123722743157955\n20190724 00:00,2991600,3014400,2990900,3014400,39298979,0.004699530046995193,-0.022269997266054792,-0.01564735694011157,-0.012116851887945016\n20190725 00:00,3009700,3010000,2991200,3000000,47024731,-0.004777070063694322,-0.02231070057242062,-0.01568753940338253,-0.012156756691689363\n20190726 00:00,3007700,3022300,3006200,3020100,36417399,0.006699999999999928,-0.022305212458186494,-0.015685777549652745,-0.012156981293646256\n20190729 00:00,3018500,3019300,3008500,3014600,33607291,-0.0018211317506042768,-0.022301855021559475,-0.015682778313783088,-0.012154173013274906\n20190730 00:00,2999000,3011700,2994900,3007200,39992583,-0.002454720360910212,-0.02226441902967364,-0.015651285264786714,-0.012125848125142377\n20190731 00:00,3009800,3012000,2952000,2974300,93490663,-0.010940409683426466,-0.022332820432548976,-0.015706294557318187,-0.012173718133204038\n20190801 00:00,2975600,3008700,2939600,2948400,129413425,-0.008707931277947778,-0.02241486313105034,-0.01578015641738254,-0.01224321881856897\n20190802 00:00,2938600,2941200,2909000,2926200,98958651,-0.00752950752950754,-0.022464991296107486,-0.015822410582921997,-0.012281275384101517\n20190805 00:00,2880700,2882000,2817300,2838200,153207444,-0.03007313239013054,-0.02302270896302178,-0.01625803933447527,-0.01265181898663845\n20190806 00:00,2859300,2880300,2842800,2878000,101365146,0.01402297230639138,-0.02306634805992642,-0.01627757412688901,-0.012658503863520663\n20190807 00:00,2844000,2888200,2820600,2879700,111953123,0.0005906879777624052,-0.02307275288247341,-0.016285679005085166,-0.01266751503509272\n20190808 00:00,2896200,2936200,2890200,2936200,72990577,0.01962009931590103,-0.023179471221394545,-0.016342165591131445,-0.01269722325955273\n20190809 00:00,2925900,2932400,2896500,2916200,80339390,-0.006811525100470006,-0.02322704409490186,-0.016383231999076826,-0.012734821094782757\n20190812 00:00,2899000,2905600,2870200,2881000,56407758,-0.012070502709004893,-0.023336920087109768,-0.016473363823997892,-0.01281442737718207\n20190813 00:00,2877800,2941500,2873600,2925500,84048259,0.015446025685525777,-0.02333522171663849,-0.016446418456732677,-0.01277402292934685\n20190814 00:00,2880500,2887400,2837600,2839000,117557987,-0.029567595282857684,-0.023831823302794892,-0.01682756274402199,-0.013093617357833938\n20190815 00:00,2848900,2856300,2823900,2846500,83862040,0.002641775272983482,-0.023831682774909074,-0.016831809842164293,-0.013100203483176405\n20190816 00:00,2864900,2893300,2864400,2888500,68482425,0.014754962234322822,-0.02381431077362233,-0.016793693736499977,-0.013051028772227307\n20190819 00:00,2922300,2930800,2914400,2923300,48006246,0.012047775662108462,-0.023833860943719358,-0.01680291756132536,-0.013054747660598694\n20190820 00:00,2917800,2923600,2899500,2900900,44802403,-0.007662573119419869,-0.02390048868318798,-0.016863026980577026,-0.013111382187462283\n20190821 00:00,2924700,2928600,2917200,2924500,43174047,0.008135406253231725,-0.023903604629647843,-0.01685826044322674,-0.013102413527160166\n20190822 00:00,2932400,2939300,2904000,2923600,46884642,-0.0003077449136604793,-0.02391204507561769,-0.01686731249071464,-0.013111791617154254\n20190823 00:00,2909500,2927600,2834700,2848500,120191247,-0.025687508551101357,-0.02430739280368637,-0.017176015844873025,-0.01337430517618911\n20190826 00:00,2872400,2880000,2855800,2880000,59943714,0.011058451816745585,-0.024310891624842217,-0.01716409078517533,-0.013354157702681002\n20190827 00:00,2895500,2899500,2860400,2868700,61103929,-0.003923611111111058,-0.024341716596604286,-0.01719744314060934,-0.01338885739699851\n20190828 00:00,2861000,2890600,2852500,2888900,53616521,0.007041517063478331,-0.024339499744691923,-0.017196868305724096,-0.013389157915314503\n20190829 00:00,2917700,2931600,2906200,2925800,50484863,0.012773027796046943,-0.024361933119211546,-0.017198443097890866,-0.013379613074411474\n20190830 00:00,2942100,2942400,2914300,2924500,53366859,-0.0004443229202268917,-0.02437277801219371,-0.017212882629325306,-0.013395968894303665\n20190903 00:00,2905600,2915800,2892800,2907400,56717313,-0.0058471533595486624,-0.0243878691946242,-0.017225644042854243,-0.013407488316651972\n20190904 00:00,2931500,2940600,2923100,2940400,41612831,0.01135034738942009,-0.024398873858556252,-0.01722027038143973,-0.013393383430599521\n20190905 00:00,2967800,2988200,2966500,2978200,73400759,0.012855393823969496,-0.02441059648304669,-0.017211612577664882,-0.013373860895929648\n20190906 00:00,2982100,2987500,2974200,2980500,42688556,0.0007722785575179358,-0.024393416459144213,-0.01719543888009189,-0.013358223667199222\n20190909 00:00,2991500,2992300,2971600,2982000,46732221,0.0005032712632109249,-0.024375041013921368,-0.017178362246625202,-0.013341839425473777\n20190910 00:00,2973300,2982000,2959700,2981300,52064073,-0.00023474178403759538,-0.02436633523037245,-0.017170220540364486,-0.013333998426728163\n20190911 00:00,2984900,3003300,2977500,3002500,56792958,0.007110991849193393,-0.02436488792742947,-0.017162951812932103,-0.013323626319441352\n20190912 00:00,3012400,3024400,3004100,3012900,67811540,0.0034637801831807202,-0.02436468896781705,-0.017162617800338793,-0.013323220310603663\n20190913 00:00,3017800,3021700,3006800,3010900,54558955,-0.0006638122738888974,-0.02436862525939453,-0.01716645416412749,-0.013327003403257919\n20190916 00:00,2998000,3006400,2994500,3001600,49705444,-0.0030887774419608993,-0.02439476486495357,-0.017195402442712737,-0.013357448975040575\n20190917 00:00,2999100,3010200,2997700,3009200,36323494,0.0025319829424306217,-0.024387814344202053,-0.017187744515587574,-0.013349413932195221\n20190918 00:00,3004700,3012200,2982500,3011000,69120166,0.000598165625415481,-0.024351246242065992,-0.0171550390185319,-0.013318767575615193\n20190919 00:00,3015000,3026300,3007200,3010800,69121065,-6.642311524407418e-05,-0.02436109748851691,-0.017168389401505293,-0.013333983335320956\n20190920 00:00,3003400,3006700,2974100,2982800,76469577,-0.009299853859439322,-0.02444123508672263,-0.01723710071259795,-0.013396603335034046\n20190923 00:00,2975700,2990000,2972800,2982100,34996734,-0.00023467882526484463,-0.024446524894900682,-0.01725053428658578,-0.013414378320440895\n20190924 00:00,2994100,2998400,2948200,2958700,86035930,-0.0078468193554877,-0.024470557683548166,-0.017270352671139865,-0.013431950021767242\n20190925 00:00,2959400,2981000,2943300,2976200,59649873,0.00591475986074963,-0.024443382164894775,-0.017240400488777067,-0.01340051761025538\n20190926 00:00,2976200,2978600,2954500,2970000,50218277,-0.0020831933337813746,-0.02444963675080935,-0.017246165978596496,-0.013406022364756279\n20190927 00:00,2978700,2979400,2936900,2954000,69755359,-0.005387205387205385,-0.024468221482371173,-0.017262090471987908,-0.013420528695022657\n20190930 00:00,2959800,2975500,2959200,2967700,43647624,0.004637779282329113,-0.024466692910900492,-0.017258866627298013,-0.013416401106452572\n20191001 00:00,2976700,2984500,2930000,2932400,82358360,-0.011894733295144344,-0.024577410477907447,-0.0173510973376522,-0.013498776541931639\n20191002 00:00,2914900,2915100,2866400,2880600,112701810,-0.017664711499113306,-0.02479293593765052,-0.017528059050713148,-0.01365518006433283\n20191003 00:00,2878100,2904200,2848200,2904200,80754022,0.008192737624105995,-0.024786944805474817,-0.01751362165492736,-0.013636239996670007\n20191004 00:00,2912100,2946300,2910800,2943500,51702655,0.013532125886646984,-0.024813924951223396,-0.01751760513416433,-0.01362796403808364\n20191007 00:00,2935000,2952600,2927700,2930800,53449478,-0.004314591472736495,-0.024781339671861094,-0.017490495582576766,-0.01360377357671109\n20191008 00:00,2910300,2918500,2884900,2885300,84728916,-0.015524771393476189,-0.024912147360078962,-0.017594524543321086,-0.013693526896927927\n20191009 00:00,2907800,2923000,2900600,2912700,53598153,0.009496412851349945,-0.02491264890061434,-0.017583839731299025,-0.013676878681750087\n20191010 00:00,2911400,2942100,2910000,2932400,51438836,0.006763484052597191,-0.0248979479693943,-0.017563886587092573,-0.013654125602235207\n20191011 00:00,2962800,2987200,2961500,2962800,84666635,0.010366934933842664,-0.024334585436382658,-0.017116699495091654,-0.013268871207955966\n20191014 00:00,2959300,2966700,2955800,2959500,33597139,-0.0011138112596192906,-0.024032553462424746,-0.016878835801039785,-0.013065215386481694\n20191015 00:00,2970500,2997000,2969700,2988800,42092291,0.00990032100016891,-0.024007798930368033,-0.016865969062774926,-0.013058685987099165\n20191016 00:00,2984000,2991600,2979200,2984000,44244959,-0.0016059957173447659,-0.023977720951855522,-0.016840039625566756,-0.01303496812190959\n20191017 00:00,2997000,3002400,2985200,2992800,42407689,0.0029490616621983268,-0.023850101845618445,-0.016771796532800597,-0.01299837816221717\n20191018 00:00,2987100,2994000,2970000,2979700,52953828,-0.0043771718791767444,-0.02387794469761411,-0.016796778616068573,-0.013021835180262049\n20191021 00:00,2994800,3002100,2989400,2999900,32012712,0.006779205960331547,-0.023714727557724125,-0.016656707040571043,-0.01289410241949717\n20191022 00:00,3006300,3009000,2989200,2990100,45261515,-0.0032667755591853087,-0.02373108975236481,-0.016671442700064574,-0.012907970979122378\n20191023 00:00,2987400,2999400,2985000,2998800,29921722,0.002909601685562313,-0.023693972837127618,-0.016636598642413812,-0.012874338573440744\n20191024 00:00,3008800,3010700,2994700,3003700,32530924,0.0016339869281045694,-0.023654411619494067,-0.016600809355242566,-0.012840560088441774\n20191025 00:00,2997400,3021900,2996900,3016000,39239172,0.0040949495622066845,-0.023095555738085697,-0.016165686102814318,-0.012471398242678011\n20191028 00:00,3029100,3038500,3029100,3033000,36575627,0.005636604774535758,-0.023017847186190748,-0.01612504515643367,-0.012450517899636684\n20191029 00:00,3030300,3042200,3028600,3032100,41162448,-0.00029673590504453173,-0.022798421088357435,-0.01594979895147809,-0.012298823832096451\n20191030 00:00,3034200,3045500,3019900,3041400,42953304,0.0030671811615712308,-0.022749703704156594,-0.01590534710369714,-0.012256645925997288\n20191031 00:00,3041100,3041300,3017400,3033300,58711304,-0.0026632471887946263,-0.022730205664264945,-0.015911883146575153,-0.012277060642066523\n20191101 00:00,3049200,3061900,3047500,3061400,60530013,0.00926383806415454,-0.022723446630070247,-0.01590875134934758,-0.01227586251144435\n20191104 00:00,3078700,3080000,3069600,3073700,53557993,0.0040177696478735925,-0.02270792256317388,-0.015905475366384928,-0.012279115936705474\n20191105 00:00,3075800,3079100,3067100,3070300,38622636,-0.0011061587012395346,-0.022670745008504915,-0.015873589324502155,-0.01225005078070897\n20191106 00:00,3070600,3074000,3060700,3071000,39751180,0.00022799075008950176,-0.022680175627940283,-0.01588640559747216,-0.012264671933050439\n20191107 00:00,3086000,3094500,3076600,3081800,49868008,0.0035167697818301313,-0.02267978413908791,-0.015889396753249903,-0.012269466364163777\n20191108 00:00,3078200,3089700,3070400,3089400,40602769,0.002466091245376001,-0.02255186887081762,-0.015820974390654993,-0.01223275944944427\n20191111 00:00,3074300,3085400,3072700,3083500,29661437,-0.0019097559396646924,-0.022552448950905867,-0.015821494828017667,-0.012233248091490635\n20191112 00:00,3087500,3099900,3081500,3090000,42687583,0.0021079941624777554,-0.022457594208482905,-0.015740621432119645,-0.012159828099690226\n20191113 00:00,3079000,3095400,3076700,3091000,48941059,0.0003236245954691963,-0.022208295737834036,-0.015542256494933519,-0.011988615640724981\n20191114 00:00,3087700,3096400,3080900,3095500,45780378,0.001455839534131309,-0.022192694258661272,-0.015527357916644708,-0.011974091776296478\n20191115 00:00,3109800,3118300,3102600,3117900,48879480,0.00723631077370368,-0.022131670937744177,-0.015467851450115444,-0.011915393939228587\n20191118 00:00,3115200,3122800,3110300,3120200,43348280,0.0007376759998716231,-0.022124233924138904,-0.015473868055962032,-0.011928582619822867\n20191119 00:00,3126800,3126900,3112200,3119300,61908885,-0.0002884430485224909,-0.022134094756492393,-0.015484198596242074,-0.011939163559660503\n20191120 00:00,3113000,3118200,3090700,3107700,67573622,-0.0037187830603020444,-0.021944588672494655,-0.015334867772509326,-0.011811250018515492\n20191121 00:00,3108500,3110100,3093900,3102700,45099359,-0.0016089069086462349,-0.021703942445668072,-0.015145075135541723,-0.01164856724212942\n20191122 00:00,3110600,3112300,3098500,3109600,35054695,0.002223869532987477,-0.02170620841741839,-0.015148053300356961,-0.011651925074432256\n20191125 00:00,3119900,3133700,3119800,3133700,40447004,0.007750192950861878,-0.02164653806260438,-0.015089089730293803,-0.011593338288704475\n20191126 00:00,3134200,3142800,3130600,3140800,33060315,0.0022656923126016526,-0.02158776436336051,-0.015063667267006663,-0.011585695245897107\n20191127 00:00,3146700,3154800,3143700,3154800,39384378,0.004457463066734668,-0.021586840450739497,-0.015061743442463311,-0.011583238372007908\n20191129 00:00,3148900,3151300,3140600,3143100,26816024,-0.0037086344617724976,-0.021458158086593515,-0.01500183587191306,-0.011559994389437856\n20191202 00:00,3146300,3146600,3111800,3116400,66926781,-0.008494798129235481,-0.02151963882386698,-0.015052640933413092,-0.011605108287686012\n20191203 00:00,3086400,3096400,3071300,3095500,66499178,-0.006706456167372643,-0.021580893234771706,-0.01511083298944223,-0.011661667813662532\n20191204 00:00,3106300,3121100,3103200,3114600,39502096,0.006170247132935014,-0.02154525211173446,-0.015093852926352411,-0.011654635892579621\n20191205 00:00,3122200,3122400,3105900,3120200,36852740,0.0017979836897192847,-0.02087234877801515,-0.014578316475954527,-0.011222991145379564\n20191206 00:00,3141400,3153100,3141000,3148700,41180679,0.0091340298698801,-0.020863985938331487,-0.014560021712107412,-0.01119940170951177\n20191209 00:00,3144100,3151800,3138000,3138800,30852815,-0.0031441547305237627,-0.020502892557650337,-0.014281352744445234,-0.01096467289143697\n20191210 00:00,3138000,3145400,3128100,3135300,43286945,-0.001115075825156131,-0.020515878912664938,-0.014294036323070372,-0.010977195061089242\n20191211 00:00,3140500,3147000,3136000,3144200,45117507,0.0028386438299365935,-0.02050764944383956,-0.014285181896780769,-0.010968007472287971\n20191212 00:00,3144500,3179900,3141700,3171300,84790876,0.008619044590038705,-0.020515558815474833,-0.014286608319335578,-0.010965977858676687\n20191213 00:00,3168800,3186600,3160300,3173200,69090591,0.0005991233878850366,-0.02051124672044887,-0.014282468842062107,-0.010961930403288333\n20191216 00:00,3191800,3201500,3191800,3195000,66586561,0.00687003655615781,-0.020240498081391993,-0.014061583601696829,-0.010767627156257235\n20191217 00:00,3199800,3202400,3194800,3195700,47875424,0.00021909233176842235,-0.01994590614511745,-0.01383023044026582,-0.010569986351694427\n20191218 00:00,3200000,3202500,3195300,3195900,42877236,6.25840973809133e-05,-0.01993957100075674,-0.013824403744394502,-0.0105644307078314\n20191219 00:00,3197800,3209800,3197600,3209000,66460035,0.0040990018461153355,-0.019737176249026,-0.013659125691456036,-0.010418939429677088\n20191220 00:00,3205400,3214500,3204000,3207300,121837660,-0.0005297600498597177,-0.019519515231693173,-0.013486920563281903,-0.010270966667814138\n20191223 00:00,3216300,3216500,3210700,3212200,40678424,0.0015277647865805655,-0.01901559037651107,-0.013098412914989232,-0.009943987505438762\n20191224 00:00,3214300,3215200,3209000,3212300,16196485,3.1131311873489054e-05,-0.018498889715562364,-0.012702325205749253,-0.009612198114453553\n20191226 00:00,3216900,3229400,3216400,3229400,27791943,0.005323288609407673,-0.01731494274985499,-0.011917756864950394,-0.00904053704078248\n20191227 00:00,3237700,3238000,3222900,3228600,36687383,-0.0002477240354245014,-0.017322060538997985,-0.011932002251078502,-0.009058582122489282\n20191230 00:00,3229400,3231000,3205500,3210800,43131761,-0.005513225546676548,-0.017360931523874634,-0.011964395617893,-0.00908752229508382\n20191231 00:00,3205000,3221250,3201500,3218600,39932115,0.002429301108757942,-0.017352340050737644,-0.011965678957862137,-0.009094069861380302\n20200102 00:00,3235800,3248700,3225350,3248700,48912531,0.009351892127011707,-0.017359701404652005,-0.01196122177792071,-0.009083312264772185\n20200103 00:00,3211900,3236400,3211100,3224100,60780998,-0.007572259673100046,-0.016971656351883205,-0.011667915446855491,-0.008840510795687772\n20200106 00:00,3204400,3237300,3203600,3236400,43759922,0.003815018144598392,-0.016456945782009357,-0.011338490657455005,-0.008609861170249202\n20200107 00:00,3230200,3235350,3222400,3227300,35212108,-0.0028117661599308397,-0.016479022844094752,-0.01136653471462894,-0.008641086210425312\n20200108 00:00,3229900,3257800,3226800,3244500,57728195,0.005329532426486594,-0.016462991087599174,-0.011359925894333775,-0.008639500722551128\n20200109 00:00,3262000,3267300,3255200,3266500,44095946,0.006780705809831922,-0.016467055640180386,-0.01136035009341749,-0.00863798426265564\n20200110 00:00,3273600,3274600,3252050,3257100,45653071,-0.0028776978417266452,-0.016497444317163403,-0.011389282518756951,-0.008666140365632452\n20200113 00:00,3264000,3279600,3259200,3279500,40497334,0.006877283473028184,-0.016493176393001383,-0.011378719177182273,-0.008652220960329863\n20200114 00:00,3274800,3286200,3268500,3274500,55569570,-0.0015246226558927045,-0.016447939532089603,-0.011341414473031754,-0.008619144859597607\n20200115 00:00,3273400,3290200,3272600,3281900,59764758,0.002259887005649608,-0.016417233683584987,-0.01133039964887832,-0.008618627247663574\n20200116 00:00,3296700,3309200,3294500,3309200,44147974,0.008318352174045529,-0.016426098003656193,-0.011329810251999146,-0.008612998109259513\n20200117 00:00,3317200,3321800,3310700,3319500,74196426,0.00311253475160167,-0.016419503140744047,-0.011330348575881943,-0.008617339108627935\n20200121 00:00,3309200,3321800,3308200,3313000,64018769,-0.001958126223828849,-0.016389780360326737,-0.011327081927869284,-0.008628176126905219\n20200122 00:00,3322600,3329500,3311700,3313400,43894937,0.00012073649260480046,-0.016205709244455593,-0.011181087644017231,-0.008502480461307771\n20200123 00:00,3306000,3319200,3294100,3317200,42424449,0.0011468582121083593,-0.016208658777259785,-0.011184272263737556,-0.008505790404993203\n20200124 00:00,3324600,3325300,3273600,3287700,76182796,-0.00889304232485233,-0.016306430722458718,-0.011264358180362019,-0.008576447965227791\n20200127 00:00,3230500,3251200,3226800,3235000,70764386,-0.016029443075706418,-0.01654540732019252,-0.011461797750826171,-0.008751744300152938\n20200128 00:00,3250600,3278500,3245500,3268900,56570669,0.010479134466769624,-0.016487036880902216,-0.011399509676808087,-0.008687367749557803\n20200129 00:00,3284000,3286200,3264000,3266200,44285050,-0.0008259659212579429,-0.016483831368084262,-0.011396660803912568,-0.008684709000085267\n20200130 00:00,3243700,3279000,3235400,3276800,69267283,0.003245361582266959,-0.016397582361698877,-0.011350308507589047,-0.00865962549226691\n20200131 00:00,3269700,3271700,3207400,3217300,97365490,-0.018157958984375,-0.01668779749325263,-0.011586824044912661,-0.008867513974609728\n20200203 00:00,3233500,3261500,3232200,3241200,60751881,0.0074285891896932466,-0.016687876366655214,-0.01157880405605702,-0.008855176512252249\n20200204 00:00,3280700,3300100,3277350,3290600,54266275,0.015241268665926233,-0.016760195857226323,-0.011620398737207776,-0.008880391911191277\n20200205 00:00,3322900,3330800,3306800,3328600,53887796,0.01154804594906711,-0.01679480481465664,-0.011636317613172808,-0.008886347173885614\n20200206 00:00,3339800,3341900,3328050,3339800,43537036,0.003364777984738332,-0.016777367191251856,-0.01161854438603565,-0.008868395037640552\n20200207 00:00,3328100,3336200,3316000,3322000,54243541,-0.005329660458710084,-0.016718063854245912,-0.011571727537504217,-0.008828234689911434\n20200210 00:00,3311900,3347200,3311900,3346800,35723822,0.007465382299819412,-0.016719947328572075,-0.011565800945387212,-0.008818144580272975\n20200211 00:00,3361600,3370200,3347500,3352600,49571204,0.0017329986853114043,-0.01671565699145893,-0.011561397564171261,-0.00881368093566411\n20200212 00:00,3368600,3376500,3364300,3374200,35993342,0.006442760842331419,-0.016671905927847206,-0.0115379223925942,-0.008801014767104341\n20200213 00:00,3359200,3381200,3355700,3370600,47811785,-0.001066919566119373,-0.01668772351357234,-0.01155412113138924,-0.00881741669719058\n20200214 00:00,3374800,3377200,3362000,3376000,51819302,0.0016020886489052089,-0.01666714756678661,-0.011535131728227895,-0.008799273074564743\n20200218 00:00,3365200,3371700,3352100,3367300,49435726,-0.002577014218009488,-0.01666521647168819,-0.011549430009777997,-0.008822223176753009\n20200219 00:00,3378100,3390650,3374800,3383400,36863549,0.004781278769340425,-0.016662343124644912,-0.01154385196359359,-0.008815203265464595\n20200220 00:00,3377700,3386350,3336900,3369500,68702515,-0.004108293432641741,-0.016700575995381314,-0.011578003452857064,-0.008847178985367092\n20200221 00:00,3354100,3358100,3325800,3334800,94782814,-0.01029826383736454,-0.01679122518508601,-0.011649935209691363,-0.008909132547997838\n20200224 00:00,3231700,3258400,3212400,3224200,137060852,-0.03316540722082284,-0.017619553263020806,-0.012281369551324112,-0.009435603567369038\n20200225 00:00,3239600,3246100,3116900,3126500,197728104,-0.030302090441039597,-0.018299149522922397,-0.01279868903566906,-0.009866413903133513\n20200226 00:00,3141900,3181100,3107000,3115000,173407681,-0.0036782344474651785,-0.01831998184714303,-0.012816862731522952,-0.009883170294042754\n20200227 00:00,3054500,3096400,2975100,2975100,253785330,-0.04491171749598721,-0.01963849821994386,-0.01380083477340984,-0.010688797991025614\n20200228 00:00,2886200,2962600,2855400,2962600,346777226,-0.004201539444052327,-0.01965617159915262,-0.013816049944941657,-0.010702702701140899\n20200302 00:00,2980000,3091500,2944600,3090900,207524129,0.04330655505299408,-0.02046512260587899,-0.014344937056576584,-0.011082288786616148\n20200303 00:00,3095500,3138000,2975700,3002400,276438674,-0.02863243715422692,-0.02098599854553845,-0.014742280816323212,-0.011413777998354344\n20200304 00:00,3061100,3131000,3033300,3128600,150015051,0.04203304023447907,-0.021671125741699437,-0.015176258974900037,-0.011713869534315684\n20200305 00:00,3049500,3084700,3000200,3024600,162185198,-0.03324170555520045,-0.022304047661371524,-0.01565537085208542,-0.012110985846990942\n20200306 00:00,2930800,2987800,2902400,2974600,201271746,-0.016531111551940758,-0.022435714764505992,-0.015757959017531672,-0.01219807213835568\n20200309 00:00,2756000,2841400,2734600,2742300,280056192,-0.07809453371881936,-0.025471215138323004,-0.01799268053821483,-0.014005901415535564\n20200310 00:00,2847600,2885200,2735000,2884200,248563890,0.05174488567990365,-0.026340920638194147,-0.01856431412505869,-0.014418633968492777\n20200311 00:00,2807300,2819100,2708900,2743600,232891616,-0.0487483530961792,-0.027496064968572636,-0.019442116493572976,-0.01514858636337892\n20200312 00:00,2560500,2666400,2477200,2481100,347822422,-0.09567721242163585,-0.031253562196029885,-0.022217787975493713,-0.017400850173379893\n20200313 00:00,2633400,2710600,2495800,2693200,287485966,0.0854862762484383,-0.033381358382933345,-0.023622134650316113,-0.018419528590274393\n20200316 00:00,2407800,2569000,2373700,2398500,266357640,-0.10942373384821036,-0.03747163093666077,-0.026642001854101396,-0.02086876666280022\n20200317 00:00,2450400,2559900,2370800,2528000,235335708,0.05399207838232223,-0.03812017329013672,-0.02704200644928594,-0.021136276698697793\n20200318 00:00,2362500,2460300,2280800,2400000,300967068,-0.05063291139240511,-0.039034467870768474,-0.027747610285626535,-0.021730628271470022\n20200319 00:00,2392600,2473800,2322500,2405100,263646203,0.0021249999999999325,-0.039014243579929914,-0.027727341362698336,-0.021710335555339987\n20200320 00:00,2425900,2444600,2286200,2288000,304651791,-0.04868820423267228,-0.039854872690110586,-0.028391440632374292,-0.022280327420251923\n20200323 00:00,2280000,2293900,2182700,2229500,281816983,-0.025568181818181768,-0.03995537541273163,-0.028469850569448802,-0.022346959775100966\n20200324 00:00,2349900,2441000,2338000,2431500,214693586,0.09060327427674375,-0.041815396973560945,-0.029678787235871078,-0.023208805493508337\n20200325 00:00,2450000,2563500,2397600,2467900,278538590,0.01497018301460007,-0.04183085529072465,-0.029680979807828665,-0.023203926145783458\n20200326 00:00,2492600,2628000,2490500,2612000,224153673,0.05838972405689047,-0.042455817283246385,-0.030048905851915546,-0.023434827276863544\n20200327 00:00,2532200,2608000,2510500,2534200,193638954,-0.02978560490045945,-0.04280775443041252,-0.030336776058548835,-0.0236885436345641\n20200330 00:00,2556800,2623900,2535300,2616500,141153243,0.03247573198642573,-0.04296258625898499,-0.030415827979339748,-0.0237271975669232\n20200331 00:00,2607000,2633300,2562200,2577500,165876305,-0.014905407987769959,-0.043086805853789927,-0.03053477142737453,-0.023843328320638013\n20200401 00:00,2479500,2514400,2439000,2461500,171513817,-0.04500484966052376,-0.043766440102138114,-0.031068196363470392,-0.024298809613386898\n20200402 00:00,2452000,2526700,2446000,2518300,158102646,0.023075360552508695,-0.043816750474448246,-0.031078773051721752,-0.024288204421692102\n20200403 00:00,2508100,2533100,2452300,2481900,121365280,-0.01445419529047376,-0.04393154115844528,-0.03117982362659507,-0.02438193019523376\n20200406 00:00,2580500,2669700,2567250,2648600,161181089,0.0671662838954028,-0.044790256378693626,-0.031714528566953594,-0.02474390645431032\n20200407 00:00,2743000,2750000,2648900,2651300,180252896,0.0010194064788944246,-0.044789366221167574,-0.03171360038832913,-0.024742958006778976\n20200408 00:00,2680500,2760000,2655600,2740300,138883582,0.033568438124693456,-0.04490228767299594,-0.03174846164768222,-0.02473620566636771\n20200409 00:00,2778100,2812000,2754800,2782000,163674342,0.015217311973141578,-0.044908079980379295,-0.03173883241451041,-0.0247183552669899\n20200413 00:00,2771500,2774100,2714100,2756600,105066645,-0.00913012221423437,-0.04496329969201423,-0.03178816676771647,-0.024764552157394985\n20200414 00:00,2810800,2847500,2799100,2837900,123049134,0.029492853515199924,-0.04506959916222933,-0.03183690651528932,-0.02478260702981408\n20200415 00:00,2775200,2795800,2754600,2777600,109527503,-0.021248105993868727,-0.045259434978030755,-0.0319950700692457,-0.024923886218176948\n20200416 00:00,2790500,2800300,2757600,2791000,111598189,0.004824308755760454,-0.045248274180999554,-0.03198233230717044,-0.024910307781871914\n20200417 00:00,2854100,2873000,2824000,2866400,129983603,0.02701540666427804,-0.04530203081839536,-0.03198609166299234,-0.02488741377189049\n20200420 00:00,2826000,2862900,2813600,2815900,89823671,-0.017617917945855432,-0.0454534565990458,-0.03211592764290622,-0.025005740308919902\n20200421 00:00,2764800,2780400,2720400,2730400,115363846,-0.030363294151070752,-0.045795171034072664,-0.03239383712628078,-0.025249635608664528\n20200422 00:00,2783800,2810000,2769100,2791000,82718312,0.022194550249047706,-0.04583984616659463,-0.03241007667283658,-0.025250716249561267\n20200423 00:00,2804600,2839300,2787510,2790800,97600252,-7.165890361882088e-05,-0.04583015820172275,-0.032400730114496595,-0.025241551693780142\n20200424 00:00,2806900,2836900,2785000,2829700,73686003,0.013938655582628634,-0.04581769643094745,-0.03237499946906711,-0.025208747460370995\n20200427 00:00,2850200,2882700,2846200,2870500,68934756,0.014418489592536332,-0.04582227428789011,-0.03236688837959226,-0.02519387194051357\n20200428 00:00,2910000,2914000,2854050,2857300,97598619,-0.004598502003135385,-0.045851409917184255,-0.03239465703866251,-0.025220911872815627\n20200429 00:00,2915900,2948700,2904100,2932100,104012097,0.02617856017919018,-0.0459084206136064,-0.0324051278893619,-0.02520657250397047\n20200430 00:00,2916900,2922300,2885900,2904800,104971069,-0.009310732921796627,-0.04592275481425026,-0.03241734871599159,-0.02521766669873327\n20200501 00:00,2851600,2860400,2815300,2827900,112895959,-0.026473423299366527,-0.04618323679397468,-0.03262978874772969,-0.025404495745768304\n20200504 00:00,2804600,2839000,2791600,2835700,70791051,0.0027582304890554354,-0.04619080270190685,-0.03264330996934585,-0.0254211917230731\n20200505 00:00,2866600,2892500,2857500,2861900,72761195,0.009239341256127132,-0.046153251279607246,-0.032601234613532794,-0.025376704675043823\n20200506 00:00,2880100,2884600,2841500,2842500,65961054,-0.006778713442118889,-0.04605897840794725,-0.03252304563621727,-0.025307089962288486\n20200507 00:00,2877900,2897800,2871500,2876800,69442289,0.012066842568161817,-0.04603800019898309,-0.03249257044369442,-0.025271551962971962\n20200508 00:00,2910500,2928500,2898700,2924400,62554633,0.016546162402669706,-0.04601980670300829,-0.03245695459887902,-0.025226648328457134\n20200511 00:00,2903700,2940000,2898800,2925000,62733856,0.00020517029134170528,-0.04603366325545732,-0.03247235301333179,-0.02524286870383878\n20200512 00:00,2937500,2942200,2865500,2866700,82244098,-0.019931623931623954,-0.04595779526514236,-0.03241266702663829,-0.025191809283398002\n20200513 00:00,2859500,2871900,2789650,2816000,126198350,-0.017685840862315505,-0.04612051669252925,-0.03255879247490922,-0.02532908747661191\n20200514 00:00,2788400,2851000,2763800,2849700,110802691,0.011967329545454541,-0.04612109700439155,-0.0325521001438984,-0.025318518126596214\n20200515 00:00,2823200,2863300,2813400,2862800,91973272,0.004596975120188196,-0.04612496908344406,-0.0325602600094019,-0.025328963795190763\n20200518 00:00,2930900,2966750,2927000,2950000,101361961,0.030459689814168023,-0.04617993646709393,-0.03255620047824236,-0.02529343723416216\n20200519 00:00,2944100,2962050,2919700,2919700,79323689,-0.010271186440677926,-0.04620931589815611,-0.032581226963598865,-0.02531614318027007\n20200520 00:00,2958300,2978700,2955800,2969300,68822340,0.01698804671712839,-0.04622448848542246,-0.03258268704394053,-0.025310293173910238\n20200521 00:00,2968000,2976700,2936900,2948800,70251827,-0.006903984103997618,-0.04624914217418581,-0.03260457379811316,-0.02533070488549096\n20200522 00:00,2945600,2956300,2932300,2954400,54086999,0.0018990775908844792,-0.04615705872563346,-0.03252305424526657,-0.025254816906355792\n20200526 00:00,3019600,3021900,2987000,2990800,80856468,0.012320606552937985,-0.046149247023677814,-0.03250584539411142,-0.025232598469734437\n20200527 00:00,3021400,3035700,2968700,3035300,92634618,0.014878962150595143,-0.04607923055623245,-0.03242823171147579,-0.025150934739792668\n20200528 00:00,3046900,3068300,3022600,3029700,80738978,-0.0018449576648107424,-0.04604909786670843,-0.03240126993512965,-0.025125663365528402\n20200529 00:00,3024600,3049600,2994700,3043200,102897180,0.004455886721457469,-0.0460446889977179,-0.032396147659743406,-0.025120160775832394\n20200601 00:00,3036300,3062050,3030600,3055500,47464891,0.004041798107255579,-0.045932212952893556,-0.0322962577267782,-0.025026980452527225\n20200602 00:00,3065200,3081300,3051000,3080800,67599676,0.008280150548191756,-0.045900450877819125,-0.03226121853313727,-0.024990194239104736\n20200603 00:00,3102600,3132100,3099400,3121800,79682933,0.013308231628148537,-0.04586813593856421,-0.032248133174144614,-0.024987360098195133\n20200604 00:00,3111200,3130000,3090800,3113600,68818172,-0.0026266897302837933,-0.04590028792840872,-0.03228398949311753,-0.02502519118131938\n20200605 00:00,3174100,3212750,3171700,3193400,123509914,0.025629496402877594,-0.04596124764604661,-0.03230485669505978,-0.02502468521149763\n20200608 00:00,3203000,3234100,3196300,3232000,65325209,0.012087430325045334,-0.04596298550847418,-0.03230366701677952,-0.025021934872098733\n20200609 00:00,3202600,3223650,3193600,3207900,68019755,-0.007456683168316824,-0.04602233883031488,-0.03235963583169831,-0.025076099418901064\n20200610 00:00,3214000,3223900,3182300,3190000,84532800,-0.0055799744381058725,-0.046052198635057544,-0.03238695335822596,-0.025102061666319415\n20200611 00:00,3113100,3121400,3000100,3006100,183916982,-0.05764890282131663,-0.047047408199012916,-0.03315558406208618,-0.025749904018267107\n20200612 00:00,3083200,3090800,2986000,3042100,170715746,0.011975649512657505,-0.04704359626163588,-0.03314376413885047,-0.025733815067401904\n20200615 00:00,2980100,3082800,2967400,3070500,125276263,0.009335656290062833,-0.047019667330677764,-0.033114707939116056,-0.02570202553965515\n20200616 00:00,3155600,3156400,3076800,3129600,122098812,0.019247679531021022,-0.0470246943236996,-0.033096329244965715,-0.025671169360280816\n20200617 00:00,3140400,3143890,3108600,3116600,74761010,-0.0041538854805726055,-0.047065042135017776,-0.03314185855018094,-0.0257194609007196\n20200618 00:00,3099800,3123000,3095200,3117800,65220566,0.00038503497401021214,-0.04707173943323958,-0.03314877024279416,-0.025726486886189566\n20200619 00:00,3141000,3143800,3065300,3086400,114303869,-0.010071204054140748,-0.047155629572479256,-0.033230899505206316,-0.025807677431680696\n20200622 00:00,3079500,3110500,3067500,3106200,64819717,0.006415241057542875,-0.04710327288859997,-0.033179114630981166,-0.025756197387066315\n20200623 00:00,3135000,3145000,3116200,3120500,60336017,0.004603695834138222,-0.0470834493285948,-0.03315832313038248,-0.02573488988091887\n20200624 00:00,3098400,3105000,3021100,3040900,116094751,-0.025508732574907822,-0.0472743306788608,-0.03331153849178775,-0.025868025643037026\n20200625 00:00,3034700,3076400,3012800,3073500,81346026,0.010720510375217929,-0.04725140991863587,-0.03328171040844332,-0.025834515291296583\n20200626 00:00,3061700,3063800,2994200,3000500,110191083,-0.02375142345859771,-0.04748895613148693,-0.03348140120658733,-0.026014025507935738\n20200629 00:00,3014200,3044600,2989300,3044600,68919256,0.01469755040826537,-0.04749227714278143,-0.03347264558089505,-0.025998831871752684\n20200630 00:00,3040100,3102000,3038300,3083600,87954973,0.012809564474807855,-0.047495238397412876,-0.03347040204305175,-0.025993813678300268\n20200701 00:00,3095700,3118900,3090700,3105200,62334610,0.007004799584900745,-0.04748652699460839,-0.033459127149935014,-0.025981172197983692\n20200702 00:00,3142400,3157000,3115100,3122300,59836713,0.00550689166559315,-0.04748927622185459,-0.03346396355362211,-0.025987121267708305\n20200706 00:00,3163800,3176800,3155600,3170500,52435296,0.01543733785991086,-0.047473707328215146,-0.03343368707300562,-0.02594900422689646\n20200707 00:00,3153800,3175200,3133700,3137800,72195898,-0.010313830626084264,-0.04751092493949633,-0.033465603895330216,-0.025978095218242687\n20200708 00:00,3145900,3163000,3127000,3161800,49246242,0.007648671043406274,-0.04749703680459838,-0.03344834186638648,-0.02595903457886748\n20200709 00:00,3168500,3171000,3106800,3143800,75016501,-0.005692959706496303,-0.04754280765995262,-0.03349287675971029,-0.026002910585406276\n20200710 00:00,3142600,3178700,3127610,3175900,50767516,0.01021057319167884,-0.04753225340159229,-0.033476269789574686,-0.025983076937019962\n20200713 00:00,3200600,3227100,3141400,3148400,88782287,-0.008658962813690607,-0.047599218598030214,-0.033538888105987666,-0.026043377947776305\n20200714 00:00,3132500,3197600,3120000,3189200,80603945,0.012958963282937441,-0.04758440222999584,-0.03351373420240513,-0.026012713142244768\n20200715 00:00,3224800,3230350,3192700,3218500,76618906,0.009187256992349235,-0.04754780049616265,-0.03347315486476581,-0.025970013358734643\n20200716 00:00,3197800,3212800,3190900,3207900,48326537,-0.003293459686189215,-0.047526783455380334,-0.033454482244325505,-0.02595259054010366\n20200717 00:00,3218200,3225600,3197400,3217200,54472899,0.0028990928644907488,-0.04752885898562417,-0.03345683535915453,-0.025955091634247897\n20200720 00:00,3214100,3251300,3206200,3243200,49745039,0.008081561606365861,-0.047479206580589954,-0.033405876143789724,-0.02590343576313141\n20200721 00:00,3264800,3269200,3239400,3250100,49755103,0.002127528367044995,-0.047480256440524005,-0.033407000883163736,-0.02590460042045779\n20200722 00:00,3246200,3272000,3245000,3268600,46779160,0.005692132549767637,-0.04748220477714857,-0.03341007326857719,-0.025908272032121312\n20200723 00:00,3264500,3272300,3214900,3229600,69166002,-0.01193171388361991,-0.047579078149098564,-0.033497901531548704,-0.025991278380965797\n20200724 00:00,3209300,3219900,3192500,3208800,60592047,-0.006440426058954674,-0.047590225308212095,-0.03350771680004241,-0.026000383623498432\n20200727 00:00,3216300,3234100,3207800,3232200,43728174,0.007292445774121248,-0.047589605029670565,-0.03350658952085255,-0.025998986064139\n20200728 00:00,3224500,3236400,3208500,3211700,50744355,-0.006342429305117303,-0.04761678653435305,-0.03353106424933208,-0.026022017820240557\n20200729 00:00,3221400,3257300,3220800,3251200,44530648,0.012298782576205758,-0.04758751687247323,-0.033493218305559576,-0.02597959989232566\n20200730 00:00,3219000,3244050,3196400,3239600,54373583,-0.0035679133858267376,-0.04753250448981141,-0.033445751169793286,-0.02593615509975989\n20200731 00:00,3260000,3266100,3213400,3265200,67655356,0.007902210149401068,-0.04745921860992468,-0.03337462506933826,-0.02586618036972812\n20200803 00:00,3283100,3296200,3277300,3287900,46717604,0.006952100943280692,-0.047395663928129765,-0.033312853837223884,-0.025805359888039184\n20200804 00:00,3278800,3300600,3278600,3300600,38139316,0.003862647890750859,-0.047049729051807536,-0.03302880938807098,-0.02555430899659861\n20200805 00:00,3314600,3323900,3311900,3321100,37235538,0.006210991940859278,-0.04704791702271038,-0.033036609488017905,-0.02556723328697142\n20200806 00:00,3315200,3344600,3311400,3343300,39913430,0.0066845322332962365,-0.04703154848947789,-0.03301795205409455,-0.025547355648559325\n20200807 00:00,3332900,3348800,3323000,3345700,50273179,0.0007178536176830619,-0.04702639404836167,-0.033036281144502376,-0.025578203722727084\n20200810 00:00,3350000,3357700,3329600,3355700,39093250,0.0029889111396719237,-0.04697572780208266,-0.0329890645205495,-0.02553282607967171\n20200811 00:00,3368600,3375400,3320100,3328000,60840577,-0.008254611556456126,-0.046941730724064816,-0.03296059083718978,-0.025507296897566163\n20200812 00:00,3354700,3382800,3354300,3374400,47937318,0.013942307692307754,-0.04693824535217573,-0.03295987453912019,-0.02550805678250341\n20200813 00:00,3365800,3382500,3358300,3368300,37594791,-0.0018077287814129983,-0.046620400969935236,-0.0327028709879961,-0.02528348725331963\n20200814 00:00,3364300,3374100,3356700,3368400,42748803,2.9688566932861704e-05,-0.04663023002291544,-0.032712857168542865,-0.025293557197990712\n20200817 00:00,3379100,3383400,3374900,3379100,29645911,0.003176582353639601,-0.046633537248106004,-0.032728655237121485,-0.02531601408895995\n20200818 00:00,3383200,3391000,3366200,3386400,34414214,0.0021603385516852924,-0.04664450707894403,-0.032747905487897015,-0.025339678600964328\n20200819 00:00,3391100,3396100,3366300,3372300,58910587,-0.00416371367824242,-0.04661994578307868,-0.03272647195658471,-0.025319912469361657\n20200820 00:00,3353300,3387950,3352200,3382800,37450891,0.0031136019927053837,-0.046628850570814166,-0.032738605889842794,-0.025333767848149114\n20200821 00:00,3378600,3397100,3375500,3394800,43998909,0.003547357218872005,-0.0466149992757619,-0.03272433078126952,-0.025319266806156013\n20200824 00:00,3421300,3430000,3410600,3429200,40778173,0.01013314480970906,-0.046331743908887286,-0.032482412996678436,-0.025099385933719846\n20200825 00:00,3435300,3442100,3422700,3441200,33649645,0.003499358450950618,-0.04633984504326293,-0.032496928261656864,-0.025117320547988563\n20200826 00:00,3447200,3478600,3441700,3475700,44752689,0.010025572474718025,-0.04629791249488922,-0.03245106398142624,-0.025069360276053512\n20200827 00:00,3485000,3499000,3465400,3483300,53042146,0.0021866098915326315,-0.04630908514421856,-0.03246460740015147,-0.025084167543171172\n20200828 00:00,3494500,3507100,3481600,3505800,45300252,0.006459391955903948,-0.046309134811263364,-0.03247198201826687,-0.025095447065597982\n20200831 00:00,3503500,3512900,3491000,3493100,53787099,-0.003622568315363117,-0.046326030139894,-0.03248762258788534,-0.025110418727830014\n20200901 00:00,3502400,3526900,3492400,3526000,48071811,0.00941856803412433,-0.04627132311179403,-0.03243119560617644,-0.025053074845216503\n20200902 00:00,3546400,3587000,3534300,3577000,65239809,0.014463981849120788,-0.04627591346428804,-0.032430821683048915,-0.02505005448512433\n20200903 00:00,3558500,3563800,3426100,3453900,132142532,-0.03441431367067371,-0.04671451799304293,-0.03279588906034718,-0.025375919479088783\n20200904 00:00,3460700,3478090,3348800,3425700,121071294,-0.00816468340137233,-0.046768133882729546,-0.0328441874664808,-0.025421383154416458\n20200908 00:00,3367400,3380500,3328800,3332100,102804803,-0.02732288291444085,-0.047056420553632676,-0.0330803691772109,-0.025629787903681013\n20200909 00:00,3375200,3424600,3366200,3397900,81687944,0.01974730650340617,-0.04705891418954782,-0.03305890350051212,-0.025595549606083817\n20200910 00:00,3417500,3425200,3328600,3338900,83084631,-0.017363665793578398,-0.04722013946475714,-0.03320134987884977,-0.025727985023986277\n20200911 00:00,3357900,3369700,3310000,3340600,73834123,0.0005091497199676276,-0.04723005640647665,-0.03321179640313044,-0.025738713866770697\n20200914 00:00,3375200,3403700,3369300,3384600,57267531,0.013171286595222487,-0.047210074254820836,-0.03318158486090187,-0.025703049074279356\n20200915 00:00,3411100,3420200,3390200,3401700,47255792,0.005052295692253184,-0.0471788242365194,-0.0331500255421926,-0.025671324868667154\n20200916 00:00,3415000,3430600,3385300,3388200,72445309,-0.00396860393332743,-0.047208762291083665,-0.03317875019258551,-0.02569940265778625\n20200917 00:00,3335200,3376900,3330000,3358400,82845183,-0.008795230505873275,-0.0472661797764181,-0.03323026712965768,-0.02574777403441346\n20200918 00:00,3353500,3354900,3279700,3306500,90698721,-0.015453787517865636,-0.047385207614573856,-0.033332313807036995,-0.025840768117817825\n20200921 00:00,3257100,3270900,3217300,3269700,88383996,-0.011129593225465029,-0.04740134704420891,-0.033345852298506076,-0.025852920058774827\n20200922 00:00,3285500,3309000,3258700,3303000,58131952,0.010184420589044896,-0.04738048493469715,-0.033318989623344564,-0.02582285850426917\n20200923 00:00,3309200,3312000,3221000,3226400,82043108,-0.023191038449894008,-0.04755227295910205,-0.03345829044701804,-0.025944840521444315\n20200924 00:00,3212200,3267900,3198000,3235000,71764361,0.0026655095462435607,-0.047559723835509764,-0.033467335820766955,-0.025954735915825748\n20200925 00:00,3225700,3295700,3216400,3287300,60520195,0.01616692426584243,-0.047540112343199374,-0.033432253965956685,-0.02591140686801139\n20200928 00:00,3332200,3349600,3321600,3341900,58415562,0.016609375475314048,-0.04750153833414604,-0.03337940938365707,-0.02585095469591924\n20200929 00:00,3340000,3347700,3316300,3323700,44028300,-0.005446003770310348,-0.04754646841958636,-0.033422899618147525,-0.02589367735119617\n20200930 00:00,3331000,3382900,3328800,3348900,84868616,0.007581911724884982,-0.047444255444826104,-0.033327988234195645,-0.025802658418286335\n20201001 00:00,3376300,3387100,3350100,3370400,80342903,0.006420018513541681,-0.04727951901648725,-0.03318351256554941,-0.025668983685661843\n20201002 00:00,3317100,3359150,3311900,3338400,77980566,-0.00949442202705908,-0.04736123109979673,-0.0332618484635311,-0.025745519751738093\n20201005 00:00,3360100,3399500,3360100,3397600,41167062,0.017733045770429,-0.04737251058793703,-0.03326494016874248,-0.025744246580167125\n20201006 00:00,3398700,3421700,3343800,3349300,82966706,-0.01421591711796566,-0.04745624773387636,-0.033335656987719356,-0.025808022311019113\n20201007 00:00,3381200,3416300,3380900,3407600,44075564,0.017406622279282136,-0.04732747963716996,-0.03320632876749369,-0.025678395491017934\n20201008 00:00,3428800,3438500,3418700,3437800,38281729,0.008862542551942632,-0.04732764045776483,-0.03320717934044229,-0.02567961376839404\n20201009 00:00,3455300,3473500,3448900,3468500,50708118,0.008930129734132208,-0.04732579593837838,-0.03320335647458454,-0.02567473625335287\n20201012 00:00,3495500,3540200,3490600,3524300,64619979,0.01608764595646539,-0.047334640681169535,-0.03320295995037105,-0.025669413243894434\n20201013 00:00,3523100,3523800,3491000,3501300,65629877,-0.006526118661861924,-0.047367521470217125,-0.03323250016551625,-0.025697172611453312\n20201014 00:00,3507300,3519300,3471500,3479300,50761914,-0.006283380458686816,-0.04742482256892973,-0.033291828432456955,-0.02575758155427534\n20201015 00:00,3437200,3480200,3431300,3475000,54266254,-0.0012358807806167604,-0.047422983133925435,-0.03329009759983121,-0.025755908617175735\n20201016 00:00,3489900,3507500,3471100,3472900,64891517,-0.0006043165467626288,-0.047436514657947924,-0.03330379586376849,-0.025769695769544618\n20201019 00:00,3485700,3493200,3410600,3420100,59117764,-0.015203432290016972,-0.04753062020886591,-0.033382918927107416,-0.025840831724194466\n20201020 00:00,3434200,3468800,3426500,3433800,52953855,0.004005730826583953,-0.04753588774026484,-0.03338986747693158,-0.025848676418720892\n20201021 00:00,3433600,3456700,3424100,3427300,55820362,-0.0018929465897838949,-0.04752838989352304,-0.03338296903998095,-0.02584209752491196\n20201022 00:00,3429200,3452400,3406500,3446100,48736995,0.005485367490444482,-0.04752211801615713,-0.033375540197236014,-0.025834051908204557\n20201023 00:00,3459100,3459900,3431500,3457800,40954601,0.003395142334813306,-0.047516499438885335,-0.033369520244529924,-0.025827817983739648\n20201026 00:00,3421400,3429800,3356300,3393900,83377228,-0.018479958355023474,-0.047685877121167966,-0.03351552238638315,-0.02596135871148589\n20201027 00:00,3397400,3401150,3379900,3382200,52891143,-0.0034473614425881705,-0.0477201971584162,-0.03355034847249464,-0.02599645457037387\n20201028 00:00,3321100,3328400,3261300,3266600,113415793,-0.034178936786706915,-0.04812305393233724,-0.033874577493236545,-0.026278767426840325\n20201029 00:00,3269900,3333900,3251000,3299800,78860838,0.010163472723933031,-0.04811403451961987,-0.03385995095556617,-0.0262611517516054\n20201030 00:00,3282800,3296800,3226000,3265400,99522697,-0.010424874234802095,-0.04816915284021427,-0.03390794535345441,-0.026305348412659472\n20201102 00:00,3302000,3323500,3272400,3302000,73909088,0.011208427757702033,-0.04816980642540395,-0.033906146919030745,-0.026302242815653073\n20201103 00:00,3337200,3382500,3331700,3360300,80997071,0.01765596608116282,-0.04817778694994974,-0.033895935395485986,-0.026282333178586834\n20201104 00:00,3408000,3479200,3396000,3435400,113182021,0.02234919501235,-0.0481883365570539,-0.03387612806355139,-0.02624634267477971\n20201105 00:00,3492800,3521900,3488750,3502400,73813299,0.01950282354311006,-0.04818970054174318,-0.03385468578912457,-0.02621274246800755\n20201106 00:00,3499700,3515000,3476500,3501600,60701935,-0.00022841480127910874,-0.04820306509523926,-0.03386848896772585,-0.026226779476029378\n20201109 00:00,3643600,3643700,3540600,3545600,145206783,0.012565684258624588,-0.04819309020547654,-0.03384969556619308,-0.026203284958502906\n20201110 00:00,3535200,3551800,3505900,3540400,73250171,-0.0014666064981949667,-0.04819085189283964,-0.03384759780408651,-0.026201262123363996\n20201111 00:00,3564300,3575600,3550700,3566700,48425558,0.007428539148118807,-0.04817907796135245,-0.03383308794986977,-0.026185293758863797\n20201112 00:00,3555700,3564200,3512600,3532100,60620567,-0.009700843917346602,-0.048242954812175276,-0.03388990561887176,-0.026238348204158005\n20201113 00:00,3553000,3589000,3547100,3581000,51387458,0.013844455140001655,-0.048231249545305374,-0.03386722779503447,-0.026209820950802886\n20201116 00:00,3611000,3625900,3595900,3625700,63099795,0.012482546774643888,-0.048231298134379624,-0.033861163484569516,-0.026200497876213\n20201117 00:00,3599700,3619200,3583400,3606200,57359007,-0.0053782717820006765,-0.04826398318301368,-0.03389138327137129,-0.02622940344105414\n20201118 00:00,3609800,3615000,3562400,3562800,58727952,-0.012034828905773343,-0.04834639083546529,-0.033963304919656725,-0.026295735039319684\n20201119 00:00,3556800,3581800,3541500,3577800,51165348,0.004210171775008487,-0.04831311003818266,-0.033930556314630544,-0.026263270144016162\n20201120 00:00,3574500,3577100,3552500,3553300,50408452,-0.006847783554139397,-0.04834540407126881,-0.03395948005112683,-0.02629039718787141\n20201123 00:00,3572500,3588200,3548650,3574600,51739439,0.0059944277150818515,-0.04833596946200627,-0.033948426059008725,-0.02627847990874517\n20201124 00:00,3603000,3638100,3592900,3632200,56453154,0.016113691042354494,-0.048343659167180426,-0.033944140663038955,-0.02626781063066675\n20201125 00:00,3631600,3631600,3614850,3626600,35940388,-0.0015417653212929094,-0.0483595046485696,-0.03395977038311878,-0.026283325329190938\n20201127 00:00,3638400,3641800,3625800,3636700,23919941,0.002784977665030608,-0.04836406594656928,-0.03396493970479569,-0.02628881878604032\n20201130 00:00,3628400,3631200,3591800,3620600,70776034,-0.00442709049412926,-0.048368447092854865,-0.033968872605572686,-0.02629251272879532\n20201201 00:00,3656000,3676500,3649300,3660200,67257271,0.010937413688338893,-0.04829471754509686,-0.033894152196205264,-0.02621726409477038\n20201202 00:00,3648000,3669500,3642000,3667900,38543468,0.002103710179771623,-0.048247459352112845,-0.03385049642298604,-0.026175528758197817\n20201203 00:00,3666600,3681900,3655000,3666900,54787910,-0.0002726355680362502,-0.04826719293489803,-0.03387193888035705,-0.02619788221028723\n20201204 00:00,3673000,3698500,3672200,3698500,41677506,0.008617633423327664,-0.048253061424960345,-0.033854019405480704,-0.02617794338531859\n20201207 00:00,3689700,3696200,3677200,3690900,41405227,-0.0020548871163985627,-0.04828439328001307,-0.03388917965699641,-0.026215144540822587\n20201208 00:00,3676700,3707700,3676700,3701700,35566369,0.002926115581565414,-0.04825770485151224,-0.033863252903922926,-0.026189623834101016\n20201209 00:00,3709100,3710500,3659500,3668500,62483119,-0.008968852149012663,-0.048309218437136946,-0.033908805681507066,-0.026231998926975357\n20201210 00:00,3653900,3678550,3644500,3667300,49958315,-0.0003271091726864128,-0.04832120603000092,-0.033920961694593264,-0.02624424472425883\n20201211 00:00,3649300,3665800,3632650,3663000,48805237,-0.0011725247457257115,-0.048347573794787956,-0.033950987671780945,-0.026276220880940896\n20201214 00:00,3686100,3698000,3644900,3646600,56272411,-0.004477204477204455,-0.04837378786742963,-0.03397542358741436,-0.02629970886765288\n20201215 00:00,3674600,3695900,3659200,3695900,52393172,0.013519442768606282,-0.04837482812279478,-0.03396842927563007,-0.02628843135785133\n20201216 00:00,3698100,3711600,3688800,3701700,48533538,0.0015693065288562291,-0.048369522629608606,-0.03396310840287995,-0.026283102286312594\n20201217 00:00,3719300,3724590,3710500,3722400,53146880,0.0055920252856795916,-0.04835244851770501,-0.033944608196269314,-0.026263841833890574\n20201218 00:00,3709800,3711500,3670200,3691800,97825013,-0.00822050290135401,-0.04841681407220989,-0.03400443934814617,-0.02632125571250496\n20201221 00:00,3649800,3784600,3620300,3678600,75870057,-0.0035754916300991813,-0.04843267478050769,-0.03401919434010088,-0.026335421251168632\n20201222 00:00,3682300,3683300,3660400,3672400,42023209,-0.0016854238025335588,-0.04844661058785022,-0.03403278298918665,-0.026348824831472294\n20201223 00:00,3683300,3696100,3673900,3675700,38573967,0.0008985949243001112,-0.04844305679011002,-0.034029261849596315,-0.02634532110182082\n20201224 00:00,3680600,3690000,3674500,3690000,21624848,0.003890415431074379,-0.04844632540927617,-0.03403323863211855,-0.026349675403607793\n20201228 00:00,3718100,3725900,3710700,3721700,32833964,0.008590785907859111,-0.048424418861646085,-0.034007474892799115,-0.026321855409671423\n20201229 00:00,3738500,3740000,3708300,3714600,45884792,-0.0019077303382862842,-0.04840299164130752,-0.03398813335982506,-0.026303625748913775\n20201230 00:00,3723800,3730800,3715800,3719900,43472434,0.0014268023474937053,-0.048406474969044856,-0.033991761649520176,-0.026307331317292182\n20201231 00:00,3718500,3746420,3712400,3738800,55021528,0.005080781741444662,-0.04841139729005836,-0.03400020709401407,-0.02631765492587694\n20210104 00:00,3753000,3754500,3648300,3687900,94376649,-0.013613993794800439,-0.048465454948009745,-0.034045452198055076,-0.026358202090037208\n20210105 00:00,3680500,3724800,3680500,3713300,54611244,0.006887388486672696,-0.04845943494236397,-0.03403762414738014,-0.026349410177247484\n20210106 00:00,3696700,3769800,3691200,3735500,92950127,0.005978509681415556,-0.048427613796158564,-0.03400490632260893,-0.02631621433645081\n20210107 00:00,3761800,3798900,3759200,3791000,62270874,0.014857448802034545,-0.0484284653579511,-0.0339944323721817,-0.026299702797366726\n20210108 00:00,3806300,3814900,3771100,3812600,63163985,0.005697705091004979,-0.04843020478199824,-0.033996921209994146,-0.026302591144884424\n20210111 00:00,3778400,3805700,3777200,3786900,45616919,-0.0067408067985101905,-0.048455069898098606,-0.03401899299287098,-0.026323173812155893\n20210112 00:00,3788400,3798500,3763600,3787700,46336265,0.00021125458818560539,-0.048473548876315165,-0.03403980778090744,-0.026345233811764207\n20210113 00:00,3786500,3808600,3778500,3797900,39076595,0.002692927106159315,-0.0484564034512379,-0.03402278220486165,-0.026328272126793617\n20210114 00:00,3806300,3811300,3781000,3784600,41851848,-0.003501935280023183,-0.048482857660511566,-0.03404818478638332,-0.02635311408945202\n20210115 00:00,3767100,3775800,3737200,3757000,81635248,-0.007292712572002369,-0.04854649718705178,-0.034111328983195875,-0.026415994227819616\n20210119 00:00,3782400,3792300,3767800,3786500,43441293,0.007852009582113295,-0.04853752592886085,-0.034099476255188166,-0.026402605398914814\n20210120 00:00,3811000,3847900,3806900,3838900,54390017,0.01383863726396406,-0.048510491784883016,-0.03406199816961668,-0.026359559686725206\n20210121 00:00,3845000,3849500,3832500,3842400,42558878,0.000911719502982633,-0.04850725053844334,-0.034058786928159716,-0.026356364440813507\n20210122 00:00,3822400,3840800,3818400,3828800,40128912,-0.0035394545075994044,-0.04852994625475127,-0.03408028178940968,-0.026377219130675558\n20210125 00:00,3836000,3847700,3784600,3843900,62710822,0.003943794400334211,-0.04846051090489875,-0.03401626462816642,-0.0263160903857311\n20210126 00:00,3854100,3858500,3835500,3837900,39595836,-0.001560914696011828,-0.04834187525846878,-0.033915563383727504,-0.026224949904631395\n20210127 00:00,3802400,3803200,3720100,3744100,101850739,-0.0244404492039918,-0.04859978544819376,-0.03413851327968679,-0.026429262597346903\n20210128 00:00,3762700,3819300,3758900,3776300,76978675,0.008600197644293761,-0.048575154651806465,-0.034110140211368864,-0.0263988945377102\n20210129 00:00,3755700,3766700,3682700,3700700,110053148,-0.02001959590074942,-0.048760277145212534,-0.03426807695689313,-0.026542338661633427\n20210201 00:00,3738400,3773400,3714200,3762300,65567084,0.01664549950009464,-0.048598870053317235,-0.0341134949583148,-0.026391395095047645\n20210202 00:00,3796800,3832200,3796000,3815500,55798392,0.014140286526858503,-0.04860126784226866,-0.034107388083678546,-0.026380754415722404\n20210203 00:00,3824300,3837000,3804800,3818500,44014303,0.0007862665443585382,-0.04861345811754584,-0.03413281097598519,-0.026413231567203124\n20210204 00:00,3830300,3862400,3827800,3861900,41511995,0.011365719523372952,-0.048613335473807494,-0.0341329362117944,-0.02641348894668192\n20210205 00:00,3882700,3884700,3864850,3877100,40406184,0.003935886480747719,-0.048611774726459896,-0.03413116877459525,-0.026411611323887713\n20210208 00:00,3893000,3905400,3883600,3905100,34842630,0.007221892651724238,-0.04856252546078243,-0.034081755903054796,-0.02636211123466708\n20210209 00:00,3895500,3908900,3891700,3902500,31350935,-0.000665796010345443,-0.04858575805882143,-0.0341076349699257,-0.02638940112427962\n20210210 00:00,3921000,3922800,3875100,3900800,54203861,-0.0004356181934657144,-0.04859453752653234,-0.034116363510391934,-0.02639810251562016\n20210211 00:00,3913400,3916900,3881200,3907100,39710262,0.00161505332239531,-0.04860693314479555,-0.03413074001506274,-0.026413535023505033\n20210212 00:00,3898800,3928900,3897700,3926400,40896380,0.004939725115814753,-0.048586020725456036,-0.03410897117629179,-0.02639130963070416\n20210216 00:00,3940600,3941600,3915400,3923000,44689625,-0.0008659331703341211,-0.04859630961497775,-0.034119115012985764,-0.026401376140272416\n20210217 00:00,3904300,3926300,3893300,3923900,45915151,0.00022941626306405283,-0.04858272114388508,-0.03410624479919777,-0.02638888882679579\n20210218 00:00,3895600,3915150,3877400,3907200,53102694,-0.004255969825938455,-0.04862076598490073,-0.03414365021431456,-0.026425953366331946\n20210219 00:00,3921000,3923800,3895500,3900300,69024514,-0.0017659705159704941,-0.04860764874901158,-0.034131652706905276,-0.026414552782031975\n20210222 00:00,3870600,3896200,3867400,3870300,58902644,-0.007691716021844486,-0.048586149550339096,-0.03411342154175095,-0.02639806379345355\n20210223 00:00,3847200,3889450,3802000,3875000,99054818,0.0012143761465519542,-0.048196073142468134,-0.033797650498567616,-0.026121904665234882\n20210224 00:00,3862300,3922300,3852700,3917700,65524154,0.011019354838709638,-0.047838162524595426,-0.03349655283554638,-0.025851093778221385\n20210225 00:00,3905100,3918700,3807789,3823300,138895516,-0.02409577047757616,-0.04805356759894087,-0.03367259091983508,-0.026006145465779534\n20210226 00:00,3844400,3855800,3782300,3803600,136480361,-0.00515261684931867,-0.047437028721114584,-0.0331904453054237,-0.02559564440280253\n20210301 00:00,3856500,3909200,3855500,3895800,94752970,0.024240193500893792,-0.04743459964828596,-0.03315566475938779,-0.025543617406109186\n20210302 00:00,3898700,3900700,3860000,3865400,73195170,-0.007803275322141756,-0.04726191023756892,-0.03309297837809057,-0.02553957323275416\n20210303 00:00,3858300,3868300,3813100,3814200,109545489,-0.01324571842500133,-0.04704919949562372,-0.03292469357713608,-0.02539497173655359\n20210304 00:00,3812200,3840000,3718800,3767000,171790812,-0.012374809920822183,-0.046928878847858554,-0.03290286863577013,-0.025425654491807816\n20210305 00:00,3804100,3847600,3726500,3836300,136356393,0.01839660207061322,-0.046526471484977315,-0.03255831618239857,-0.025111944276616765\n20210308 00:00,3846900,3876800,3814200,3817200,108618789,-0.004978755571774851,-0.04641825091870674,-0.03246836896614422,-0.025031738515639633\n20210309 00:00,3858800,3899100,3853100,3871700,100993909,0.014277480876034865,-0.0446382542225654,-0.031102434146641305,-0.023886538550429645\n20210310 00:00,3895900,3914000,3881702,3895800,102850671,0.006224655835937787,-0.04423085089794901,-0.03086729452654472,-0.0237432320737894\n20210311 00:00,3922400,3956500,3917400,3935300,78605803,0.010139124185019721,-0.043414280269126714,-0.03022147922519897,-0.023188445805679636\n20210312 00:00,3920900,3942100,3912000,3940600,58694370,0.0013467842350012305,-0.04069354610652568,-0.02818498433909548,-0.02151671634600315\n20210315 00:00,3944000,3966850,3920400,3964100,67193193,0.005963558848906203,-0.039209266982435306,-0.02722796269973306,-0.02084077372075125\n20210316 00:00,3970600,3978300,3950800,3959100,67508285,-0.0012613203501424808,-0.03537391963166265,-0.02439042784137404,-0.018535169009916815\n20210317 00:00,3945600,3981200,3933000,3972600,83563811,0.0034098658786088087,-0.03479030013717443,-0.02403657834316959,-0.01830380904651896\n20210318 00:00,3944900,3967200,3908650,3914800,101153040,-0.014549665206665674,-0.03390673160877079,-0.02336990146173612,-0.017752756299526436\n20210319 00:00,3899400,3915690,3871500,3894800,94802448,-0.0051088178195565215,-0.033950781626111565,-0.02340945640146713,-0.017789914930016703\n20210322 00:00,3900100,3940500,3899800,3925900,62207903,0.007985005648557086,-0.03295363776907512,-0.022638540122867465,-0.01713959973637732\n20210323 00:00,3918900,3934600,3886600,3895000,80338274,-0.007870806694006416,-0.03267676943190424,-0.02242220633484373,-0.016955536692509418\n20210324 00:00,3909200,3927500,3874800,3875200,86478164,-0.0050834403080872725,-0.030574307559066333,-0.021046886483622258,-0.015967853562385854\n20210325 00:00,3859900,3905500,3839000,3897000,102523995,0.005625516102394812,-0.030559507783413722,-0.02104728526872927,-0.01597635464399496\n20210326 00:00,3909800,3964100,3902900,3959800,101407276,0.016114960225814823,-0.029717132539752132,-0.020500824200277545,-0.01558764432738364\n20210329 00:00,3943500,3967499,3928100,3957800,93832458,-0.00050507601394012,-0.02925900262167659,-0.020142863450711916,-0.015283083390897121\n20210330 00:00,3943500,3957800,3930299,3947300,66174457,-0.002652989034311992,-0.029077380110137864,-0.02005528310013033,-0.015245636568339889\n20210331 00:00,3953500,3980000,3953300,3963300,90673494,0.004053403592328975,-0.02890664518103501,-0.019912524965691118,-0.015117792759614012\n"
  },
  {
    "path": "Tests/TestData/spy_var.txt",
    "content": "Date,Open,High,Low,Close,Volume,Var\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,245483200,\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,3.22556099999929\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,4.06655600000158\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,3.37128900000243\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,2.47248099999706\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,2.29572399999961\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,1.87383599999157\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,1.08966000000146\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.52898500000083\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.466201000010187\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.368264000007912\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0.450164000008954\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0.449780000013561\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.448916000012105\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.497621000009531\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,99783700,0.529376000009506\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.515084000006027\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.533696000013151\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.63526100001036\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.533085000017309\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.532796000010421\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.361276000017824\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.361581000011938\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.299301000010018\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.891029000013077\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,1.59842900000876\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,2.01058400001421\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,215505700,2.24168900002041\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,2.27762000001167\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,2.3175560000127\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,2.91680400001496\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,2.83027600002242\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,2.83424400001968\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,2.94332100001702\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,2.70197600002211\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,2.40978900002301\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,2.19620500001474\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,2.54398100001708\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,3.19252000001507\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,2.75284100001591\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,1.76267600002393\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,1.78918100002193\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,1.78637600003276\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,2.45250000003216\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,3.10442400004831\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,3.27533600004244\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102968200,3.11454900004173\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,79718500,3.0882610000408\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,3.6593560000365\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,3.01647600003707\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,2.19306900003721\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,2.5445360000449\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,2.52342100003807\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,2.54490000002988\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,2.24212900002749\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1.56750400002784\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1.05792400004066\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,0.49819600004048\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,0.49988900003882\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0.50461600003473\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,1.09146100003272\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,1.13212400003977\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,1.25378100004309\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,2.12934100003986\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,2.24262100004125\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,2.13725600005273\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,2.05580900004134\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,1.65324900003907\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,1.8284840000415\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,1.33049600004233\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,1.33446500003629\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,1.35274400003254\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1.85719600002631\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1.26816000003237\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,2.99210100002892\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,4.44236400001682\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,6.91452000001664\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,7.89164100002017\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,8.10464400002093\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,7.30618100002539\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,6.90598100001807\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,5.60190900002272\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,2.8182240000242\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,1.8211090000259\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,2.5957890000318\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,3.51810900002238\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,3.32846400002745\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,3.23975600002814\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,4.91437600003337\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,6.15600900003483\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,6.53864400002931\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,6.17890000003899\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,5.10454400003437\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,3.55846100004419\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,2.71529600003487\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,2.00434100002894\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,1.4361240000253\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.533361000030709\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.453944000033516\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.359224000025279\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.329480000029434\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0.173581000031845\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,0.0907410000363598\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.36371600003622\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.67664000003424\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.861440000033326\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.863269000030414\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.779845000026398\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,101924300,0.746176000033302\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.730096000028425\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.647104000032414\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.519604000033723\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.51328900003864\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,1.40780900004029\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,2.12972900004024\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,3.08742400004485\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,3.40572900005282\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,4.08024900004602\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,3.52074500005619\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,2.92652400006045\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,89398400,2.31416500006526\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,1.85070100006487\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,1.09770400006892\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,1.06168100007199\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,1.16370500005723\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1.18392100006167\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1.21212400006334\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,1.30900400005703\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1.30473600006007\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1.72742100005053\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,2.99510000005466\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,3.83458100004282\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,4.03718900004969\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,4.04854100005832\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,3.58234100005575\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,3.22562900005869\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,4.25346900005752\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,4.19770900006915\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,2.70478900006492\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1.99454900006458\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,1.82664500006649\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,1.91786900007719\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,1.74234100007379\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,1.86010900007022\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,2.42406900006972\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,126981900,2.41697600006955\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,1.48004900005981\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.723441000067396\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.467424000064057\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.571924000065337\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,1.42768900005103\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,2.02418500006388\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1.87432100005753\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,2.29403600005753\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,3.01510900005815\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,3.09510100005355\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,4.2820240000583\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,5.87690400005158\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,8.17480400005297\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,9.20706100005555\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,8.06610400005229\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,4.69428100006189\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,4.03408900005525\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93453900,3.81730000004973\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,3.54274900005476\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1.97778400004972\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,1.22915600004853\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.76578500004689\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.647121000041807\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.538500000042404\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.510464000049978\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.351344000038807\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.406564000044455\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.478656000053888\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.544601000055991\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.521564000060607\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.824405000061233\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,1.27054100006717\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,1.94254100006219\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,2.22666400005619\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,2.11957600006281\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,2.06055600006584\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91804700,1.12332000006427\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,1.30917600006796\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,1.20822100006262\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.71792500005904\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.689429000056407\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,54981700,0.727316000054998\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.742100000054052\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.703061000062007\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.584341000056156\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.435680000056891\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.448761000065133\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0.526936000060232\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.532024000061938\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.800936000061483\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,1.10800900005415\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,1.27534000005471\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,1.2123290000527\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,1.28140900004655\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,1.73746400004529\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,1.95752900004663\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,2.11972100005005\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,2.55714400004945\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,3.27436400004444\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,4.0177010000516\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,3.88842900004965\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,3.078180000055\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,2.77350100005424\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,1.12058400004753\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.954676000059408\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.751009000072372\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.476449000059802\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.406060000052094\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,0.380429000062577\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0.408240000069782\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.693161000061082\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.67997600005765\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.671705000058864\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.761705000055372\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.727580000042508\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.603456000048027\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.627564000053098\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.714069000059681\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,2.8121440000541\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,5.08576100005303\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,6.19109600005322\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,8.13260000006994\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,7.60426100006589\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,194573800,7.07386100006624\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,9.32534100005432\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,8.26406100005988\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,5.60814400005256\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,2.87190100004955\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,3.18039600005068\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,3.7955960000545\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,5.42956100004449\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,6.9503450000484\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,8.91292100004284\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,11.3598810000549\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,10.1605440000531\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,7.88993600006506\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,4.53314900006808\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,2.48643600007927\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,1.89178500007256\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.982296000074712\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.789145000082499\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.68602000008832\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.82771600009437\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.799684000092384\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,1.5004160000899\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,1.61440900008165\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,1.96936900008586\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,1.92348400008632\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,1.94070900009683\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,1.57958000009967\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,1.10986100009177\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,1.3173490000845\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,1.81694400008564\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,1.45554900008574\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,1.46442900008697\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,1.42290000007051\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,1.33462100008182\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,1.16322900008527\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,1.04283600008057\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.973284000094282\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,119656900,1.0220250000857\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,1.16662500009261\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,101527200,0.997056000094744\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,1.06478400008928\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,1.26768500010076\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,1.88662100010697\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,2.17860500010283\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,2.16720500009251\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,2.52810400009912\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,2.70246500009671\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,2.51548100010405\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,3.27066400010517\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,5.44772400010697\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,6.14572900009807\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,5.49894400009362\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,4.16641600010189\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,2.96846400010691\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,3.21985600010521\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,4.03600100009498\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,4.51281600009679\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,4.81547600008344\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,4.25718400009646\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,2.28156100009073\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,1.12860400009231\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.524845000109053\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.487445000107982\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.396096000113175\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.417900000109512\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.49104900011298\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.494016000106058\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.490701000104309\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.291804000094999\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,86871400,0.516165000095498\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.803244000097038\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.852969000094163\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.942209000088042\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.942696000085562\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.959720000093512\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.774381000090216\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.783256000082474\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.786121000091953\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.935496000092826\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,1.4913450000895\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,1.90712100009114\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,2.74951600009808\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,2.92692400010128\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,3.02052900009585\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,2.97668100009469\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1.91748900008679\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1.84620100008033\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,1.93015600008221\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,1.93172500008222\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,2.03862100007245\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,1.57134100007534\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,1.31616400006897\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,1.09242900007666\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.891296000081638\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,84776800,0.617449000077613\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0.605476000084309\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.794469000080426\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.853941000066698\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,70447200,0.887421000072209\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.88598100006493\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.901821000072232\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.609981000059634\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.453656000063347\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.285345000054804\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.353545000063605\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.510976000063238\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.948544000057154\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,1.10318900007405\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,1.08382100007293\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.813749000080861\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.71236500008672\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.548916000087047\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0.491600000095787\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0.322329000104219\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,0.385104000095453\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.585136000088823\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.494241000094917\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.479604000094696\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.532916000083787\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.722004000090237\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.743025000083435\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.641904000076465\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.642464000084146\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.675616000080481\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.704820000071777\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,2.2972560000926\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,4.32134100007534\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,5.01099600008456\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,6.28304100008245\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,6.46634400007315\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,6.38252400008059\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,5.21772400008922\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,3.5820450000756\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,2.31254100008664\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,1.11242900008074\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,1.8026240000836\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,2.24247600007948\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,3.53574500008108\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,4.74284100007935\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,5.53675600008137\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,4.83120500007499\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,4.60808000007819\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,4.5753890000633\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,3.55402900006447\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,2.74631600006251\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,2.01836000006006\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.985929000060423\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.546204000049329\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.341745000041556\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.203844000046956\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.223325000042678\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,64102500,0.0819250000422471\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0.198261000063212\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.206789000054414\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0.206004000050598\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.34144500005641\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.453376000055869\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.441169000063383\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0.468344000059005\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0.738985000054527\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.684004000053392\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.762340000037511\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,1.11328900002991\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,1.12333600003331\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,2.20837600003142\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,2.43358900002204\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,2.73224500002834\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,2.94122900003276\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,4.23274900003889\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,3.88604500003567\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,2.77918100004172\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,2.32958900005178\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,3.20216400005302\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,2.07504400004109\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,3.01392400004988\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,4.59779600004549\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,8.54140500004723\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,10.57130100004\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,14.0513490000303\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,16.4202800000348\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,13.9771050000199\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,10.3597440000376\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,10.9508010000354\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,7.15445600002568\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,8.93426900001941\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,12.8328600000168\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,14.3684850000209\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,16.8842640000221\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,15.1789840000129\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,11.4701650000061\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,10.1788640000086\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,8.45262900000671\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,8.25522900000942\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,6.2702240000217\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,5.61755600001925\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,5.19120900001144\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,3.84616900002584\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,3.48323600002186\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,2.13130100002309\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,1.22846400002163\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,1.15467600003467\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,1.00803600003564\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.653220000036526\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.483876000020246\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.49626900003932\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.751445000030799\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,1.18506100003287\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,1.40510400004132\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,1.55230400004803\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,1.40812500006723\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,1.05518100006157\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.705389000046125\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.749381000037829\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.541981000053056\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,90989800,0.388069000036921\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.396196000052441\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.446361000038451\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,1.8766560000513\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,2.33240100003604\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,4.91003600003751\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,189556900,8.4406610000442\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,12.4578290000354\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,11.3403090000284\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,10.698789000031\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,9.57310100003815\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,10.1947090000394\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,11.1104210000485\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,12.6201960000471\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,14.3580210000509\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,14.2491840000584\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,10.8263050000605\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,3.60603600005561\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,1.12355600005685\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,3.854944000057\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,8.13088400005654\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,9.03698000004078\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,146056100,8.51620500003628\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,7.91006100003142\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,6.91244400004507\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,5.13558000003832\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,4.0073040000425\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,4.59410400004708\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,3.59394400004385\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,3.58368100005464\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,3.08164100005524\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,4.31907600006525\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,3.81324900005711\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,4.3222890000543\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,133646200,4.32051600005798\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,4.93782400006603\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,4.6586010000683\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,4.35730000006151\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,4.29932900005952\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,4.58753600006457\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,4.67632400007278\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,4.68809600006352\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,4.92740400006733\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,4.62318400006916\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,5.78516900006798\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,5.30240000007325\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,6.5200010000699\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,4.81658400008018\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,4.24246500006848\n"
  },
  {
    "path": "Tests/TestData/spy_vidya.txt",
    "content": "Date,Open,High,Low,Close,Volume,VIDYA_9\n02/27/2017 12:00:00 AM,2366100,2373100,2363500,2371100,47536121,0\n02/28/2017 12:00:00 AM,2367100,2369500,2360200,2364700,68854635,0\n03/01/2017 12:00:00 AM,2384000,2403200,2383700,2397800,118445158,0\n03/02/2017 12:00:00 AM,2395700,2395700,2382100,2382700,62429917,0\n03/03/2017 12:00:00 AM,2381900,2386100,2377300,2384200,59910203,0\n03/06/2017 12:00:00 AM,2374800,2381200,2370100,2377100,47626346,0\n03/07/2017 12:00:00 AM,2373900,2377700,2367700,2370000,51126013,0\n03/08/2017 12:00:00 AM,2373100,2376300,2364100,2365600,62858443,0\n03/09/2017 12:00:00 AM,2367100,2372400,2357400,2368600,78158975,0\n03/10/2017 12:00:00 AM,2379500,2380200,2365900,2376900,67005430,2368711.953\n03/13/2017 12:00:00 AM,2375900,2378500,2372400,2378100,44239339,2368865.644\n03/14/2017 12:00:00 AM,2372200,2372400,2361900,2369000,52143010,2368866.831\n03/15/2017 12:00:00 AM,2375600,2394300,2372900,2389500,78506663,2369666.705\n03/16/2017 12:00:00 AM,2391200,2392000,2381000,2384800,71500910,2370052.734\n03/17/2017 12:00:00 AM,2377500,2379700,2370300,2370300,66555644,2370055.436\n03/20/2017 12:00:00 AM,2370100,2373600,2363300,2367700,46808067,2370015.637\n03/21/2017 12:00:00 AM,2374900,2376100,2335800,2337300,119931847,2367705.341\n03/22/2017 12:00:00 AM,2337300,2346100,2330500,2342800,85892073,2366326.381\n03/23/2017 12:00:00 AM,2339800,2353400,2336000,2340300,89153899,2364779.92\n03/24/2017 12:00:00 AM,2343500,2350400,2329600,2338600,93360484,2363147.132\n03/27/2017 12:00:00 AM,2319700,2339200,2316100,2336200,78643223,2361346.915\n03/28/2017 12:00:00 AM,2333200,2358100,2331400,2353200,78046362,2361246.972\n03/29/2017 12:00:00 AM,2350000,2358100,2347300,2355400,48500109,2361211.112\n03/30/2017 12:00:00 AM,2355000,2365200,2352700,2362900,46797888,2361235.491\n03/31/2017 12:00:00 AM,2359100,2365100,2356800,2357400,55060512,2361228.301\n04/03/2017 12:00:00 AM,2357900,2360300,2339200,2353300,73352665,2361119.255\n04/04/2017 12:00:00 AM,2350000,2355800,2345600,2354800,47152999,2361064.872\n04/05/2017 12:00:00 AM,2362600,2373900,2345500,2347800,96925396,2360665.738\n04/06/2017 12:00:00 AM,2349600,2360400,2344300,2354400,59853359,2360630.593\n04/07/2017 12:00:00 AM,2351800,2360000,2346400,2352000,58063904,2360512.206\n04/10/2017 12:00:00 AM,2353600,2362500,2347300,2353400,62169916,2360455.144\n04/11/2017 12:00:00 AM,2349000,2351800,2333400,2350600,80178276,2360269.073\n04/12/2017 12:00:00 AM,2348000,2349500,2337700,2340300,66034492,2359206.083\n04/13/2017 12:00:00 AM,2336500,2344900,2325100,2325100,72058660,2356191.837\n04/17/2017 12:00:00 AM,2331200,2345700,2328800,2345700,56011057,2356073.818\n04/18/2017 12:00:00 AM,2337100,2344900,2330800,2338700,74664350,2355574.193\n04/19/2017 12:00:00 AM,2345200,2349500,2331800,2334400,59798136,2354746.843\n04/20/2017 12:00:00 AM,2341400,2358500,2337800,2353400,83135283,2354725.265\n04/21/2017 12:00:00 AM,2352200,2353000,2341300,2345900,92494914,2354689.667\n04/24/2017 12:00:00 AM,2371700,2374100,2366100,2371700,103888079,2355538.412\n04/25/2017 12:00:00 AM,2379300,2389500,2378100,2385500,67491880,2357650.522\n04/26/2017 12:00:00 AM,2385300,2395300,2383500,2384000,73538016,2359390.375\n04/27/2017 12:00:00 AM,2387400,2389500,2379800,2386000,45634569,2361233.522\n04/28/2017 12:00:00 AM,2389300,2389300,2379300,2380800,49721027,2362241.112\n05/01/2017 12:00:00 AM,2386600,2391700,2382000,2386800,44888079,2363793.574\n05/02/2017 12:00:00 AM,2388200,2389800,2383000,2387700,49086142,2365347.763\n05/03/2017 12:00:00 AM,2382900,2387300,2377000,2384800,61863616,2366377.982\n05/04/2017 12:00:00 AM,2388100,2389200,2377800,2387600,56277584,2367648.795\n05/05/2017 12:00:00 AM,2391600,2397200,2386900,2397000,49995690,2370027.099\n05/08/2017 12:00:00 AM,2397700,2399200,2391700,2396600,43249763,2372126.71\n05/09/2017 12:00:00 AM,2399400,2401900,2390400,2394400,46767168,2373622.486\n05/10/2017 12:00:00 AM,2393700,2398700,2391600,2398700,46195692,2375591.291\n05/11/2017 12:00:00 AM,2393100,2395700,2381400,2393800,54364403,2376520.083\n05/12/2017 12:00:00 AM,2390500,2392100,2386700,2389800,41779519,2376920.323\n05/15/2017 12:00:00 AM,2394900,2404400,2394500,2403000,51325482,2378751.187\n05/16/2017 12:00:00 AM,2406400,2406700,2396300,2400800,45582380,2380046.76\n05/17/2017 12:00:00 AM,2380900,2386400,2357500,2358200,144257251,2378617.746\n05/18/2017 12:00:00 AM,2357000,2377500,2354300,2367700,93498838,2378214.972\n05/19/2017 12:00:00 AM,2373600,2390800,2372700,2383100,97341700,2378224.369\n05/22/2017 12:00:00 AM,2388700,2397100,2388200,2395200,44766182,2378682.41\n05/23/2017 12:00:00 AM,2399800,2402400,2395200,2400500,44309601,2379492.613\n05/24/2017 12:00:00 AM,2403300,2407300,2399300,2406100,42561538,2380763.25\n05/25/2017 12:00:00 AM,2412200,2420800,2409700,2417600,57128563,2383256.621\n05/26/2017 12:00:00 AM,2415900,2419000,2414500,2417100,34160249,2385489.735\n05/30/2017 12:00:00 AM,2413200,2417900,2411600,2415000,30629121,2387207.832\n05/31/2017 12:00:00 AM,2418400,2418800,2406400,2414400,67558518,2388725.708\n06/01/2017 12:00:00 AM,2419700,2433600,2416500,2433600,58482273,2392852.71\n06/02/2017 12:00:00 AM,2434500,2443500,2430800,2441700,56727456,2397906.252\n06/05/2017 12:00:00 AM,2440200,2443000,2437600,2439900,33597787,2401920.756\n06/06/2017 12:00:00 AM,2433400,2439800,2431200,2432100,43156884,2403805.857\n06/07/2017 12:00:00 AM,2436100,2439200,2428300,2436600,43784238,2406160.18\n06/08/2017 12:00:00 AM,2438000,2443300,2431700,2437800,59231538,2408512.519\n06/09/2017 12:00:00 AM,2440700,2450100,2419500,2434100,115565354,2409960.756\n06/12/2017 12:00:00 AM,2430900,2434200,2423800,2433600,74220413,2411239.649\n06/13/2017 12:00:00 AM,2439800,2446100,2435800,2445500,53143874,2414127.003\n06/14/2017 12:00:00 AM,2448600,2448700,2433000,2442400,67840892,2416050.42\n06/15/2017 12:00:00 AM,2426900,2439100,2423700,2437700,57671192,2417007.839\n06/16/2017 12:00:00 AM,2428300,2428300,2416400,2426400,68393285,2417036.804\n06/19/2017 12:00:00 AM,2436100,2447300,2434800,2446600,51499196,2418628.768\n06/20/2017 12:00:00 AM,2442300,2442600,2429900,2430100,48023571,2418649.982\n06/21/2017 12:00:00 AM,2434600,2435900,2424200,2429500,50482105,2418651.847\n06/22/2017 12:00:00 AM,2429600,2435300,2426400,2428400,36622080,2418683.054\n06/23/2017 12:00:00 AM,2428800,2435100,2424700,2431300,56648578,2418764.701\n06/26/2017 12:00:00 AM,2439300,2443800,2430500,2432900,48970596,2418934.678\n06/27/2017 12:00:00 AM,2430100,2433800,2413100,2413300,72130894,2418663.854\n06/28/2017 12:00:00 AM,2425100,2437100,2422400,2434900,59025861,2418930.686\n06/29/2017 12:00:00 AM,2436200,2437200,2399600,2413500,97388588,2418755.844\n06/30/2017 12:00:00 AM,2423000,2427100,2415800,2418000,58187364,2418740.367\n07/03/2017 12:00:00 AM,2429000,2433800,2422100,2422100,32862520,2418772.726\n07/05/2017 12:00:00 AM,2426100,2430100,2417000,2427700,47672771,2418818.247\n07/06/2017 12:00:00 AM,2418600,2420300,2403400,2405500,57599572,2418234.377\n07/07/2017 12:00:00 AM,2411800,2422800,2410200,2421100,43893302,2418249.115\n07/10/2017 12:00:00 AM,2419800,2428000,2417800,2423700,31706829,2418253.391\n07/11/2017 12:00:00 AM,2421200,2425500,2408500,2421900,45825492,2418266.646\n07/12/2017 12:00:00 AM,2433100,2442000,2433100,2440100,46071933,2419077.529\n07/13/2017 12:00:00 AM,2440200,2445500,2437600,2444200,33501511,2420208.165\n07/14/2017 12:00:00 AM,2444000,2459700,2443100,2455600,47191923,2422520.914\n07/17/2017 12:00:00 AM,2454400,2459100,2453400,2455300,25751504,2424629.262\n07/18/2017 12:00:00 AM,2450600,2457200,2446700,2456600,36481728,2426765.95\n07/19/2017 12:00:00 AM,2460100,2470000,2460100,2469900,42449945,2430657.922\n07/20/2017 12:00:00 AM,2472500,2474200,2464700,2471000,38472135,2434369.204\n07/21/2017 12:00:00 AM,2464300,2469100,2461800,2468800,77627243,2437185.536\n07/24/2017 12:00:00 AM,2468100,2469800,2462900,2468200,32070018,2439629.758\n07/25/2017 12:00:00 AM,2477000,2478000,2471600,2474200,49230957,2442800.683\n07/26/2017 12:00:00 AM,2477800,2477900,2471300,2474300,41030559,2445696.731\n07/27/2017 12:00:00 AM,2479600,2480000,2456800,2472000,64357340,2447738.271\n07/28/2017 12:00:00 AM,2467000,2470600,2461400,2469100,40266001,2449010.375\n07/31/2017 12:00:00 AM,2473800,2474800,2465300,2467700,41852288,2449957.771\n08/01/2017 12:00:00 AM,2474500,2475000,2468000,2473200,39456990,2451590.846\n08/02/2017 12:00:00 AM,2474700,2476000,2463700,2474400,40002720,2453285.737\n08/03/2017 12:00:00 AM,2473100,2473400,2466400,2469600,35313680,2453947.481\n08/04/2017 12:00:00 AM,2475200,2477900,2469700,2474100,47115173,2455133.922\n08/07/2017 12:00:00 AM,2475000,2478700,2473700,2478700,26044202,2456909.335\n08/08/2017 12:00:00 AM,2474900,2489000,2468300,2472600,52101258,2457450.982\n08/09/2017 12:00:00 AM,2464600,2473100,2460600,2472500,55549945,2457960.856\n08/10/2017 12:00:00 AM,2463000,2464300,2437000,2437600,104046619,2456188.599\n08/11/2017 12:00:00 AM,2440000,2448000,2437500,2441200,61113729,2455127.483\n08/14/2017 12:00:00 AM,2455500,2467900,2455500,2465400,57898513,2455234.067\n08/15/2017 12:00:00 AM,2470000,2470000,2461600,2465100,47792878,2455327.792\n08/16/2017 12:00:00 AM,2470900,2475700,2464600,2469400,49448733,2455630.11\n08/17/2017 12:00:00 AM,2462600,2466000,2430900,2430900,115678588,2454036.942\n08/18/2017 12:00:00 AM,2429500,2441900,2422000,2427100,118659025,2452150.812\n08/21/2017 12:00:00 AM,2426400,2432000,2418300,2429000,52959492,2450671.679\n08/22/2017 12:00:00 AM,2436000,2456200,2435500,2454400,56390025,2450683.862\n08/23/2017 12:00:00 AM,2443400,2450500,2441800,2445600,41275750,2450607.22\n08/24/2017 12:00:00 AM,2450000,2451800,2437500,2439900,44822885,2450323.633\n08/25/2017 12:00:00 AM,2448900,2456100,2443900,2445600,53279580,2450267.966\n08/28/2017 12:00:00 AM,2451700,2451900,2440900,2445700,30596755,2450215.371\n08/29/2017 12:00:00 AM,2431300,2451500,2429300,2448500,45762826,2450209.677\n08/30/2017 12:00:00 AM,2448600,2463200,2446200,2460100,51768706,2450484.401\n08/31/2017 12:00:00 AM,2467500,2477700,2466100,2474900,74827764,2451919.529\n09/01/2017 12:00:00 AM,2479800,2483300,2476700,2478400,48254590,2453646.938\n09/05/2017 12:00:00 AM,2472700,2475200,2449500,2460600,80412244,2453718.241\n09/06/2017 12:00:00 AM,2468700,2472800,2462300,2469000,51824854,2454162.414\n09/07/2017 12:00:00 AM,2472700,2472700,2464000,2468700,51789141,2454571.746\n09/08/2017 12:00:00 AM,2465400,2471000,2463000,2465800,50483333,2454781.94\n09/11/2017 12:00:00 AM,2480400,2493000,2480300,2492100,58404461,2457488.11\n09/12/2017 12:00:00 AM,2496400,2500700,2494200,2500500,49393581,2461135.523\n09/13/2017 12:00:00 AM,2497300,2502100,2496000,2501700,42484385,2464646.657\n09/14/2017 12:00:00 AM,2498300,2503200,2496000,2500900,65581923,2467667.159\n09/15/2017 12:00:00 AM,2487000,2492900,2485700,2491900,68255555,2468826.606\n09/18/2017 12:00:00 AM,2496200,2501100,2492800,2497200,38706384,2470514.813\n09/19/2017 12:00:00 AM,2500000,2500700,2496000,2499700,38421723,2472411.472\n09/20/2017 12:00:00 AM,2500700,2501900,2489200,2500600,50752645,2474302.623\n09/21/2017 12:00:00 AM,2498700,2499800,2491900,2493900,43352855,2475013.545\n09/22/2017 12:00:00 AM,2490600,2496300,2490200,2494400,35884635,2475747.263\n09/25/2017 12:00:00 AM,2491600,2495500,2480800,2489300,50407468,2475940.551\n09/26/2017 12:00:00 AM,2494500,2496900,2488100,2490800,43026163,2476240.154\n09/27/2017 12:00:00 AM,2498900,2504900,2488800,2500500,62619261,2477548.314\n09/28/2017 12:00:00 AM,2497300,2504300,2496400,2503500,36427192,2479180.135\n09/29/2017 12:00:00 AM,2503700,2513100,2501300,2512300,59810909,2482026.929\n10/02/2017 12:00:00 AM,2515000,2523200,2514000,2523200,45157038,2486457.875\n10/03/2017 12:00:00 AM,2524800,2528900,2522300,2528600,48890886,2491365.817\n10/04/2017 12:00:00 AM,2527200,2534400,2525600,2531600,39214468,2496241.308\n10/05/2017 12:00:00 AM,2535400,2546800,2534100,2546600,57502282,2503300.374\n10/06/2017 12:00:00 AM,2541600,2544600,2538600,2543700,63350212,2508278.868\n10/09/2017 12:00:00 AM,2546500,2547000,2536500,2539500,27885527,2511368.751\n10/10/2017 12:00:00 AM,2545900,2550500,2539800,2546200,35938141,2515233.711\n10/11/2017 12:00:00 AM,2545300,2550200,2543200,2550200,35324039,2519343.574\n10/12/2017 12:00:00 AM,2546800,2550600,2543700,2546400,39362384,2521895.235\n10/13/2017 12:00:00 AM,2551500,2552700,2547600,2549500,39906982,2524682.165\n10/16/2017 12:00:00 AM,2552000,2555000,2548200,2552900,31623755,2527732.31\n10/17/2017 12:00:00 AM,2552400,2555200,2549800,2554700,29021655,2530749.286\n10/18/2017 12:00:00 AM,2559200,2559500,2555000,2557200,32340875,2533849.211\n10/19/2017 12:00:00 AM,2548300,2558200,2543500,2557900,51983499,2536705.054\n10/20/2017 12:00:00 AM,2567300,2571400,2564200,2571100,68864750,2541582.089\n10/23/2017 12:00:00 AM,2575100,2575100,2560200,2561100,50941227,2543050.69\n10/24/2017 12:00:00 AM,2565600,2568300,2561500,2565600,57258734,2544999.804\n10/25/2017 12:00:00 AM,2562300,2563100,2540000,2552900,84509571,2545180.944\n10/26/2017 12:00:00 AM,2560100,2563000,2555600,2556200,60425004,2545552.361\n10/27/2017 12:00:00 AM,2564700,2578900,2561600,2577100,68581031,2548202.69\n10/30/2017 12:00:00 AM,2570900,2576000,2564100,2567500,45270942,2549082.969\n10/31/2017 12:00:00 AM,2572100,2574400,2568100,2571500,42638839,2550311.795\n11/01/2017 12:00:00 AM,2581000,2584300,2570700,2574900,47993039,2551852.092\n11/02/2017 12:00:00 AM,2574300,2577500,2561900,2575900,48827159,2553416.434\n11/03/2017 12:00:00 AM,2578200,2585000,2573100,2584500,45788670,2556046.6\n11/06/2017 12:00:00 AM,2583100,2590000,2582200,2588500,40510098,2559056.717\n11/07/2017 12:00:00 AM,2590000,2593500,2580900,2586700,51927624,2561341.761\n11/08/2017 12:00:00 AM,2584600,2592200,2581500,2591100,40183247,2564103.939\n11/09/2017 12:00:00 AM,2577400,2583900,2563600,2581700,88196762,2564849.75\n11/10/2017 12:00:00 AM,2577100,2582100,2573700,2580900,46236809,2565466.925\n11/13/2017 12:00:00 AM,2573200,2585900,2572700,2583300,41967655,2566302.209\n11/14/2017 12:00:00 AM,2574400,2578500,2565200,2577300,50761825,2566471.479\n11/15/2017 12:00:00 AM,2566200,2572200,2556300,2564400,68119981,2566398.258\n11/16/2017 12:00:00 AM,2575200,2590400,2574800,2586200,68715102,2567139.834\n11/17/2017 12:00:00 AM,2582000,2584400,2577800,2578600,65649757,2567274.609\n11/20/2017 12:00:00 AM,2581500,2585200,2578600,2583000,38680440,2567654.403\n11/21/2017 12:00:00 AM,2591900,2602000,2591000,2599900,59121571,2569688.89\n11/22/2017 12:00:00 AM,2600700,2601500,2595800,2597600,36058663,2571209.088\n11/24/2017 12:00:00 AM,2603200,2604800,2601600,2603600,20775775,2573387.136\n11/27/2017 12:00:00 AM,2603800,2607500,2600000,2602300,43626677,2575169.427\n11/28/2017 12:00:00 AM,2607900,2629000,2606600,2628700,85200455,2580866.731\n11/29/2017 12:00:00 AM,2630500,2636300,2622000,2627100,70248234,2585481.441\n11/30/2017 12:00:00 AM,2638000,2660500,2636700,2650100,102291232,2593606.911\n12/01/2017 12:00:00 AM,2648000,2653100,2607600,2644600,144772948,2598937.706\n12/04/2017 12:00:00 AM,2663800,2667900,2641200,2641400,81628604,2602848.204\n12/05/2017 12:00:00 AM,2644000,2651500,2630400,2631900,72059111,2604504.52\n12/06/2017 12:00:00 AM,2628400,2637300,2627200,2632400,63603819,2606123.076\n12/07/2017 12:00:00 AM,2630800,2644300,2629400,2640700,66321314,2608701.234\n12/08/2017 12:00:00 AM,2650000,2655200,2647200,2655100,61507907,2613239.121\n12/11/2017 12:00:00 AM,2656000,2663800,2654900,2663100,59974834,2618644.409\n12/12/2017 12:00:00 AM,2666000,2673200,2663500,2667800,70771940,2624262.221\n12/13/2017 12:00:00 AM,2670500,2675600,2666600,2667500,84036820,2629141.363\n12/14/2017 12:00:00 AM,2670900,2672100,2656000,2656600,80249826,2630883.363\n12/15/2017 12:00:00 AM,2655400,2670400,2653900,2665100,121594778,2633622.667\n12/18/2017 12:00:00 AM,2681000,2686000,2679800,2682000,63715443,2638737.051\n12/19/2017 12:00:00 AM,2685100,2685300,2670900,2671700,65048769,2640932.695\n12/20/2017 12:00:00 AM,2682500,2683300,2666900,2670300,57876020,2642738.615\n12/21/2017 12:00:00 AM,2677300,2683900,2673000,2675800,58124382,2645129.643\n12/22/2017 12:00:00 AM,2676100,2676300,2669000,2675100,49690800,2647206.792\n12/26/2017 12:00:00 AM,2670200,2673800,2668900,2671900,39296365,2648560.047\n12/27/2017 12:00:00 AM,2673500,2677300,2670200,2673200,46121058,2649996.33\n12/28/2017 12:00:00 AM,2678700,2679200,2674500,2678700,40062616,2652086.855\n12/29/2017 12:00:00 AM,2685500,2685500,2666400,2668600,60907419,2652501.538\n01/02/2018 12:00:00 AM,2678600,2688100,2674000,2687700,60549562,2655054.844\n01/03/2018 12:00:00 AM,2689900,2706400,2689500,2704700,69993787,2660007.446\n01/04/2018 12:00:00 AM,2712200,2721600,2711000,2716100,70499774,2666383.418\n01/05/2018 12:00:00 AM,2725600,2735600,2719500,2734200,62838867,2675254.88\n01/08/2018 12:00:00 AM,2733200,2741000,2729800,2739200,45590194,2683877.089\n01/09/2018 12:00:00 AM,2744300,2752400,2740900,2745400,50588042,2692473.431\n01/10/2018 12:00:00 AM,2737100,2744200,2729200,2741200,52504885,2698386.604\n01/11/2018 12:00:00 AM,2747500,2761200,2745600,2761200,57132771,2707118.937\n01/12/2018 12:00:00 AM,2764300,2781100,2762700,2779200,72240014,2717954.117\n01/16/2018 12:00:00 AM,2794200,2800900,2761800,2769700,98395992,2723935.835\n01/17/2018 12:00:00 AM,2780700,2800500,2771900,2796100,86404443,2733718.704\n01/18/2018 12:00:00 AM,2795100,2799600,2785800,2791400,86824501,2740662.64\n01/19/2018 12:00:00 AM,2797000,2804100,2791400,2804100,115665358,2748910.077\n01/22/2018 12:00:00 AM,2801600,2826900,2801200,2826900,67806515,2760120.689\n01/23/2018 12:00:00 AM,2827600,2836200,2823800,2832900,78792149,2770807.112\n01/24/2018 12:00:00 AM,2840300,2847000,2818400,2831800,109450315,2779526.01\n01/25/2018 12:00:00 AM,2841600,2842700,2824100,2833000,68835239,2787211.444\n01/26/2018 12:00:00 AM,2843200,2865800,2839700,2865800,79736062,2799807.665\n01/29/2018 12:00:00 AM,2859900,2864200,2845000,2846800,75630192,2804615.733\n01/30/2018 12:00:00 AM,2832000,2832900,2812200,2817600,111230880,2805089.961\n01/31/2018 12:00:00 AM,2827500,2833000,2806800,2819000,95104527,2805624.385\n02/01/2018 12:00:00 AM,2811000,2830600,2806900,2815800,72849227,2805945.049\n02/02/2018 12:00:00 AM,2800000,2802300,2754100,2754500,149222076,2802988.401\n02/05/2018 12:00:00 AM,2734700,2758400,2633100,2639300,260184696,2783121.724\n02/06/2018 12:00:00 AM,2597300,2697000,2587000,2691300,317612443,2777449.535\n02/07/2018 12:00:00 AM,2684600,2723600,2676400,2676700,146912435,2770455.257\n02/08/2018 12:00:00 AM,2680000,2681600,2576000,2576300,210533683,2749377.002\n02/09/2018 12:00:00 AM,2609400,2636000,2529300,2615000,252255048,2739558.255\n02/12/2018 12:00:00 AM,2638900,2669800,2618800,2653400,125613495,2735940.104\n02/13/2018 12:00:00 AM,2640000,2666200,2633100,2660000,72719768,2733146.716\n02/14/2018 12:00:00 AM,2644000,2700000,2639700,2695900,104371989,2732803.314\n02/15/2018 12:00:00 AM,2715600,2730300,2687700,2730300,97354499,2732767.997\n02/16/2018 12:00:00 AM,2722700,2753200,2722700,2731100,133139606,2732743.563\n02/20/2018 12:00:00 AM,2720000,2736700,2705000,2714000,74302666,2732731.999\n02/21/2018 12:00:00 AM,2718500,2747100,2699800,2700500,78867162,2732397.052\n02/22/2018 12:00:00 AM,2710900,2730500,2696500,2704000,96644954,2732196.073\n02/23/2018 12:00:00 AM,2718400,2747100,2712600,2747100,71109438,2732643.461\n02/26/2018 12:00:00 AM,2759000,2780100,2752600,2779000,74117961,2735057.795\n02/27/2018 12:00:00 AM,2781100,2789200,2743600,2744300,84017988,2735219.802\n02/28/2018 12:00:00 AM,2756500,2761800,2713200,2716500,97944730,2735100.187\n03/01/2018 12:00:00 AM,2715000,2731700,2660000,2677000,157627163,2733047.383\n03/02/2018 12:00:00 AM,2657500,2697200,2648200,2690800,111706399,2732106.422\n03/05/2018 12:00:00 AM,2677500,2728900,2676100,2721900,82516773,2732053.932\n03/06/2018 12:00:00 AM,2732800,2733800,2711800,2728800,66749775,2732018.261\n03/07/2018 12:00:00 AM,2703900,2731700,2702100,2727800,75522183,2731976.331\n03/08/2018 12:00:00 AM,2735200,2742400,2724200,2741000,55014311,2732181.16\n03/09/2018 12:00:00 AM,2756900,2788700,2753400,2788700,93409685,2735612.545\n03/12/2018 12:00:00 AM,2792000,2799100,2780900,2785200,62503496,2738398.288\n03/13/2018 12:00:00 AM,2798400,2804000,2760300,2767200,77611771,2739341.812\n03/14/2018 12:00:00 AM,2778100,2780200,2746700,2753000,90187429,2739550.674\n03/15/2018 12:00:00 AM,2758500,2766000,2744300,2750000,68608453,2739671.044\n03/16/2018 12:00:00 AM,2744500,2753800,2741600,2742000,80466251,2739673.268\n03/19/2018 12:00:00 AM,2733400,2733800,2686300,2704900,95066872,2738262.013\n03/20/2018 12:00:00 AM,2709100,2716700,2701800,2709500,52033461,2737288.649\n03/21/2018 12:00:00 AM,2708800,2732600,2701900,2704300,71895340,2735983.61\n03/22/2018 12:00:00 AM,2678500,2688600,2633700,2636700,128018295,2726722.844\n03/23/2018 12:00:00 AM,2641700,2650200,2578300,2580500,152584561,2709362.437\n03/26/2018 12:00:00 AM,2621600,2654300,2594100,2651100,119051490,2707125.921\n03/27/2018 12:00:00 AM,2661700,2667700,2588700,2606000,116865500,2700737.51\n03/28/2018 12:00:00 AM,2607600,2626400,2585800,2598300,130160686,2693865.174\n03/29/2018 12:00:00 AM,2611200,2652600,2602800,2631500,101867581,2691711.401\n04/02/2018 12:00:00 AM,2625600,2631300,2546700,2574700,156224122,2683991.55\n04/03/2018 12:00:00 AM,2589200,2613100,2568400,2607700,112280149,2681199.888\n04/04/2018 12:00:00 AM,2567600,2643600,2566000,2635600,105850742,2680557.12\n04/05/2018 12:00:00 AM,2655500,2666400,2643300,2656400,74694497,2680515.645\n04/06/2018 12:00:00 AM,2634200,2651000,2580000,2597200,147082676,2677444.378\n04/09/2018 12:00:00 AM,2613700,2648400,2605400,2610000,91750575,2675668.33\n04/10/2018 12:00:00 AM,2642500,2660400,2629900,2651500,95382545,2675541.569\n04/11/2018 12:00:00 AM,2634200,2656400,2633900,2637600,80296381,2675351.617\n04/12/2018 12:00:00 AM,2652800,2670000,2650600,2659300,63531523,2675166.594\n04/13/2018 12:00:00 AM,2674500,2675400,2640100,2651500,74484642,2675051.898\n04/16/2018 12:00:00 AM,2670000,2681900,2660700,2673300,53229700,2675012.525\n04/17/2018 12:00:00 AM,2693300,2708700,2687500,2701900,54103741,2676178.322\n04/18/2018 12:00:00 AM,2706800,2713000,2698700,2703900,50299257,2677420.108\n04/19/2018 12:00:00 AM,2695900,2698600,2677200,2688900,66127959,2677732.533\n04/20/2018 12:00:00 AM,2688700,2690600,2656200,2666100,86632836,2677705.031\n04/23/2018 12:00:00 AM,2672800,2678800,2653500,2665700,56938463,2677681.881\n04/24/2018 12:00:00 AM,2677600,2679700,2612800,2629800,105344976,2676047.041\n04/25/2018 12:00:00 AM,2629400,2641300,2608500,2636300,85139536,2675016.691\n04/26/2018 12:00:00 AM,2648600,2672400,2642900,2663100,58733046,2674948.568\n04/27/2018 12:00:00 AM,2670000,2673300,2655000,2665600,49090356,2674868.819\n04/30/2018 12:00:00 AM,2672600,2678900,2644400,2645100,64203115,2674391.086\n05/01/2018 12:00:00 AM,2638700,2651000,2621200,2649800,60987801,2674153.196\n05/02/2018 12:00:00 AM,2647700,2656800,2627700,2632000,70609719,2672849.515\n05/03/2018 12:00:00 AM,2622800,2633600,2590500,2626200,120224810,2671096.615\n05/04/2018 12:00:00 AM,2615200,2667800,2611500,2660200,68817239,2670972.95\n05/07/2018 12:00:00 AM,2669100,2680200,2661100,2669200,47379307,2670933.503\n05/08/2018 12:00:00 AM,2664800,2673200,2651500,2669200,57615594,2670894.933\n05/09/2018 12:00:00 AM,2676700,2698600,2671000,2695000,52616842,2672173.833\n05/10/2018 12:00:00 AM,2703400,2723900,2702300,2720200,59562006,2675850.832\n05/11/2018 12:00:00 AM,2722500,2731400,2715800,2728500,49302696,2680245.448\n05/14/2018 12:00:00 AM,2733400,2740700,2723700,2729800,48164268,2684438.14\n05/15/2018 12:00:00 AM,2715200,2716100,2700300,2711000,75504782,2685649.216\n05/16/2018 12:00:00 AM,2711100,2727500,2711000,2722400,41303208,2687810.105\n05/17/2018 12:00:00 AM,2719300,2732300,2711400,2720100,49747414,2689549.592\n05/18/2018 12:00:00 AM,2716100,2720200,2709300,2713300,57758893,2690469.948\n05/21/2018 12:00:00 AM,2729900,2739800,2726000,2733700,49218301,2693311.822\n05/22/2018 12:00:00 AM,2739400,2742500,2722500,2726100,46039188,2694896.145\n05/23/2018 12:00:00 AM,2711900,2733900,2709900,2733600,52441278,2697164.54\n05/24/2018 12:00:00 AM,2729500,2732200,2707800,2728000,64497794,2698541.889\n05/25/2018 12:00:00 AM,2721500,2728600,2715800,2721500,43997689,2699197.966\n05/29/2018 12:00:00 AM,2702600,2711700,2677600,2690200,98456218,2698914.834\n05/30/2018 12:00:00 AM,2705000,2731000,2704300,2726100,61173533,2699652.326\n05/31/2018 12:00:00 AM,2722000,2724800,2702600,2709400,77780721,2699657.773\n06/01/2018 12:00:00 AM,2724900,2739400,2723300,2736000,61618180,2700934.14\n06/04/2018 12:00:00 AM,2745100,2751800,2742700,2749000,41517726,2703311.657\n06/05/2018 12:00:00 AM,2750200,2755300,2741900,2751000,43560811,2705776.983\n06/06/2018 12:00:00 AM,2759000,2775200,2750900,2774000,51074336,2710932.86\n06/07/2018 12:00:00 AM,2779800,2782800,2763400,2773700,62257297,2715635.648\n06/08/2018 12:00:00 AM,2767800,2782500,2766700,2781900,49348853,2721160.56\n06/11/2018 12:00:00 AM,2784200,2793700,2783100,2785600,44542078,2726782.569\n06/12/2018 12:00:00 AM,2790500,2793300,2782000,2789200,63125112,2732474.723\n06/13/2018 12:00:00 AM,2792100,2794800,2778000,2780300,66680720,2735599.707\n06/14/2018 12:00:00 AM,2790100,2793300,2780600,2787300,59029532,2739484.969\n06/15/2018 12:00:00 AM,2766500,2775000,2753500,2771300,95685257,2740494.947\n06/18/2018 12:00:00 AM,2754700,2767000,2749500,2765600,46078648,2740945.959\n06/19/2018 12:00:00 AM,2739800,2757500,2735300,2755000,73157804,2741032.399\n06/20/2018 12:00:00 AM,2762700,2767200,2755900,2759700,45977778,2741118.862\n06/21/2018 12:00:00 AM,2759800,2759800,2736800,2742400,63277398,2741159.599\n06/22/2018 12:00:00 AM,2756700,2757800,2744900,2747400,45162641,2741278.883\n06/25/2018 12:00:00 AM,2734500,2736100,2691100,2710000,115078014,2738897.2\n06/26/2018 12:00:00 AM,2716100,2725600,2707900,2716000,62816272,2737494.14\n06/27/2018 12:00:00 AM,2722700,2738700,2691800,2693500,89809831,2733668.728\n06/28/2018 12:00:00 AM,2692600,2717500,2684900,2708900,69724773,2732401.61\n06/29/2018 12:00:00 AM,2720800,2736600,2711900,2712800,71773644,2731567.789\n07/02/2018 12:00:00 AM,2695100,2720400,2692400,2718600,54236596,2731186.947\n07/03/2018 12:00:00 AM,2728800,2729800,2704200,2709000,35551259,2730187.714\n07/05/2018 12:00:00 AM,2721600,2731800,2709600,2731100,51422807,2730189.576\n07/06/2018 12:00:00 AM,2731400,2758400,2727200,2754200,53890390,2731114.524\n07/09/2018 12:00:00 AM,2765600,2779600,2765100,2779000,42066501,2734366.96\n07/10/2018 12:00:00 AM,2784000,2790100,2780900,2789000,45949582,2738628.174\n07/11/2018 12:00:00 AM,2771700,2780300,2765200,2768600,65023147,2739724.466\n07/12/2018 12:00:00 AM,2782900,2794300,2776100,2793700,52468803,2743206.883\n07/13/2018 12:00:00 AM,2791900,2799300,2786600,2795900,40862085,2746724.92\n07/16/2018 12:00:00 AM,2796600,2798000,2788400,2793400,37927451,2749582.733\n07/17/2018 12:00:00 AM,2784800,2809100,2784100,2804700,47922571,2753687.637\n07/18/2018 12:00:00 AM,2805700,2811800,2800600,2810600,35961053,2758305.558\n07/19/2018 12:00:00 AM,2803100,2807400,2794600,2800000,48872857,2760552.59\n07/20/2018 12:00:00 AM,2798000,2804800,2795100,2796800,61205760,2762212.794\n07/23/2018 12:00:00 AM,2794600,2804100,2790600,2802000,40201459,2764372.866\n07/24/2018 12:00:00 AM,2817900,2825500,2806400,2816100,55176993,2768264.881\n07/25/2018 12:00:00 AM,2813700,2843600,2812800,2840100,62755526,2775604.66\n07/26/2018 12:00:00 AM,2831500,2841100,2830900,2833400,46601066,2780400.978\n07/27/2018 12:00:00 AM,2837300,2838200,2803800,2814200,69312181,2781580.62\n07/30/2018 12:00:00 AM,2815100,2816800,2793600,2799500,53456799,2781668.62\n07/31/2018 12:00:00 AM,2807000,2820200,2803800,2813300,54314615,2782557.176\n08/01/2018 12:00:00 AM,2814800,2821300,2801400,2808600,48996782,2783030.092\n08/02/2018 12:00:00 AM,2794400,2825800,2791600,2823900,50365933,2784794.376\n08/03/2018 12:00:00 AM,2825500,2836500,2823400,2836000,41504629,2787880.365\n08/06/2018 12:00:00 AM,2836400,2849700,2832100,2846400,35260013,2792186.965\n08/07/2018 12:00:00 AM,2854000,2860100,2852500,2855800,38972125,2797579.229\n08/08/2018 12:00:00 AM,2853900,2859100,2849400,2854600,34117081,2802209.127\n08/09/2018 12:00:00 AM,2855400,2859700,2849200,2850700,31121962,2805548.821\n08/10/2018 12:00:00 AM,2834200,2840500,2823600,2831600,64276743,2805980.64\n08/13/2018 12:00:00 AM,2834900,2841600,2817700,2821000,54746417,2806083.923\n08/14/2018 12:00:00 AM,2829400,2841700,2825000,2839000,37456013,2807024.801\n08/15/2018 12:00:00 AM,2823500,2825100,2801600,2817800,90330173,2807172.668\n08/16/2018 12:00:00 AM,2833800,2850400,2833600,2840600,60613010,2808021.061\n08/17/2018 12:00:00 AM,2837600,2855600,2833800,2850600,55316391,2809717.368\n08/20/2018 12:00:00 AM,2855800,2859700,2850600,2856700,36225951,2811993.704\n08/21/2018 12:00:00 AM,2862600,2873100,2861100,2863400,57496192,2814969.717\n08/22/2018 12:00:00 AM,2858900,2867600,2855800,2861700,39705478,2817464.46\n08/23/2018 12:00:00 AM,2859400,2869400,2854400,2857900,41655271,2819191.918\n08/24/2018 12:00:00 AM,2864600,2876700,2863800,2875100,45762305,2823132.324\n08/27/2018 12:00:00 AM,2888600,2899000,2886800,2897800,51785180,2830402.955\n08/28/2018 12:00:00 AM,2903000,2904100,2894000,2899200,41169485,2837202.216\n08/29/2018 12:00:00 AM,2901600,2917400,2898900,2914800,51917476,2846057.679\n08/30/2018 12:00:00 AM,2909400,2913600,2896300,2903000,55221298,2850517.773\n08/31/2018 12:00:00 AM,2898400,2908100,2892900,2903100,52151495,2854643.3\n09/04/2018 12:00:00 AM,2898500,2902100,2886900,2898100,50641175,2857356.681\n09/05/2018 12:00:00 AM,2894100,2896400,2878900,2890300,62293382,2858620.761\n09/06/2018 12:00:00 AM,2891700,2894900,2870000,2881600,57093261,2858937.226\n09/07/2018 12:00:00 AM,2869600,2886900,2867100,2876000,59629388,2858955.869\n09/10/2018 12:00:00 AM,2887400,2890400,2878800,2881000,42190430,2859221.183\n09/11/2018 12:00:00 AM,2873700,2895500,2869800,2890500,42539380,2860317.606\n09/12/2018 12:00:00 AM,2890500,2898000,2882400,2891200,53961780,2861451.323\n09/13/2018 12:00:00 AM,2903000,2910300,2900000,2908300,44562244,2864826.647\n09/14/2018 12:00:00 AM,2911100,2912700,2900000,2908800,47621027,2868034.582\n09/17/2018 12:00:00 AM,2908200,2908600,2890400,2893400,59631885,2868522.948\n09/18/2018 12:00:00 AM,2895500,2915700,2895500,2909100,50345855,2870654.387\n09/19/2018 12:00:00 AM,2909800,2916700,2908300,2912200,42388455,2873077.409\n09/20/2018 12:00:00 AM,2926400,2939400,2925100,2935800,89443398,2878972.801\n09/21/2018 12:00:00 AM,2931700,2932200,2918100,2919900,86818431,2880891.5\n09/24/2018 12:00:00 AM,2914100,2915000,2903700,2910200,44500016,2881548.572\n09/25/2018 12:00:00 AM,2915300,2916500,2904900,2907500,38617967,2881956.679\n09/26/2018 12:00:00 AM,2908900,2922400,2894100,2898800,63273109,2882049.195\n09/27/2018 12:00:00 AM,2904100,2919100,2901000,2906900,49923097,2882389.659\n09/28/2018 12:00:00 AM,2900100,2912800,2899500,2907200,55605049,2882747.487\n10/01/2018 12:00:00 AM,2921200,2929300,2909800,2917300,55669774,2884066.757\n10/02/2018 12:00:00 AM,2915700,2923600,2911500,2915600,42173808,2885092.978\n10/03/2018 12:00:00 AM,2927400,2932100,2913200,2917200,55817020,2886269.32\n10/04/2018 12:00:00 AM,2912200,2912400,2876600,2894400,99293459,2886513.194\n10/05/2018 12:00:00 AM,2896500,2902700,2862300,2878200,90999928,2886004.187\n10/08/2018 12:00:00 AM,2870600,2882200,2855000,2878200,76849736,2885526.346\n10/09/2018 12:00:00 AM,2874300,2888600,2867700,2874000,66107852,2884729.657\n10/10/2018 12:00:00 AM,2869100,2869100,2778900,2783000,181989770,2869964.215\n10/11/2018 12:00:00 AM,2771500,2789000,2703900,2721700,246184984,2845958.634\n10/12/2018 12:00:00 AM,2768600,2770800,2723700,2759500,164510497,2837434.059\n10/15/2018 12:00:00 AM,2755400,2770400,2743000,2744000,90506955,2827514.209\n10/16/2018 12:00:00 AM,2765600,2808200,2760700,2804000,98163677,2826784.422\n10/17/2018 12:00:00 AM,2804400,2811500,2775600,2804500,96178817,2826104.62\n10/18/2018 12:00:00 AM,2794100,2800700,2749700,2764000,123177259,2822389.213\n10/19/2018 12:00:00 AM,2771600,2793000,2754700,2762500,117788143,2818746.268\n10/22/2018 12:00:00 AM,2770000,2773500,2744200,2750100,73429798,2813974.522\n10/23/2018 12:00:00 AM,2708700,2748700,2686100,2736100,125899322,2807815.076\n10/24/2018 12:00:00 AM,2733300,2737600,2647000,2653200,148689080,2789445.015\n10/25/2018 12:00:00 AM,2673100,2718100,2662300,2700800,119060991,2783860.076\n10/26/2018 12:00:00 AM,2659200,2687800,2623000,2653300,178385574,2772696.67\n10/29/2018 12:00:00 AM,2688100,2702500,2598600,2638600,145358219,2760400.412\n10/30/2018 12:00:00 AM,2637300,2681200,2631200,2677700,139865192,2756177.583\n10/31/2018 12:00:00 AM,2707100,2732300,2701300,2706300,109862120,2754918.598\n11/01/2018 12:00:00 AM,2716400,2737300,2703800,2735100,90496605,2754884.167\n11/02/2018 12:00:00 AM,2747500,2752300,2696000,2718900,105725403,2754379.722\n11/05/2018 12:00:00 AM,2724800,2740100,2713500,2733900,58423015,2754358.3\n11/06/2018 12:00:00 AM,2733600,2753000,2732500,2751200,50219235,2754315.307\n11/07/2018 12:00:00 AM,2775500,2811000,2770800,2810100,86619120,2757344.516\n11/08/2018 12:00:00 AM,2801100,2812100,2792200,2805000,56765848,2759679.951\n11/09/2018 12:00:00 AM,2790000,2792300,2761800,2777600,84222634,2760059.346\n11/12/2018 12:00:00 AM,2772400,2774600,2720000,2725700,88721475,2759324.838\n11/13/2018 12:00:00 AM,2730600,2753300,2712500,2720600,87233813,2758352.961\n11/14/2018 12:00:00 AM,2741800,2746100,2684500,2702000,112019431,2756162.823\n11/15/2018 12:00:00 AM,2687600,2735400,2670200,2730200,118697478,2755887.865\n11/16/2018 12:00:00 AM,2717400,2747400,2701800,2737300,107996462,2755817.994\n11/19/2018 12:00:00 AM,2731700,2733700,2680800,2691000,88067909,2753129.101\n11/20/2018 12:00:00 AM,2654100,2670000,2631600,2641200,121906074,2745137.538\n11/21/2018 12:00:00 AM,2657800,2671500,2650200,2650200,65299409,2739311.219\n11/23/2018 12:00:00 AM,2631600,2648200,2631000,2632500,37268417,2731637.151\n11/26/2018 12:00:00 AM,2658000,2675500,2653400,2675000,67846819,2730178.259\n11/27/2018 12:00:00 AM,2663400,2684000,2656600,2684000,68394857,2729393.497\n11/28/2018 12:00:00 AM,2696100,2745800,2685400,2745800,113271909,2729936.035\n11/29/2018 12:00:00 AM,2737100,2755500,2724400,2739800,70520259,2730205.714\n11/30/2018 12:00:00 AM,2738100,2762800,2734500,2756500,79834477,2731249.041\n12/03/2018 12:00:00 AM,2803800,2804000,2775100,2793000,87120547,2735178.865\n12/04/2018 12:00:00 AM,2783400,2788400,2699000,2702500,156127119,2734723.622\n12/06/2018 12:00:00 AM,2659700,2699600,2624400,2698400,183371757,2734117.749\n12/07/2018 12:00:00 AM,2694500,2712200,2626400,2635700,141538111,2728819.625\n12/10/2018 12:00:00 AM,2633700,2651600,2586200,2640700,144445674,2724475.306\n12/11/2018 12:00:00 AM,2676200,2678600,2624800,2641300,113002276,2720424.611\n12/12/2018 12:00:00 AM,2674500,2689500,2653800,2654600,86056529,2718145.152\n12/13/2018 12:00:00 AM,2664500,2674900,2641200,2653700,86351666,2715867.756\n12/14/2018 12:00:00 AM,2629200,2640300,2598500,2604700,104539987,2708131.068\n12/17/2018 12:00:00 AM,2593900,2606500,2535300,2553600,147122082,2693422.959\n12/18/2018 12:00:00 AM,2571900,2579400,2533500,2550800,119888002,2679669.609\n12/19/2018 12:00:00 AM,2551800,2593900,2493500,2512600,197525731,2660877.212\n12/20/2018 12:00:00 AM,2497800,2516200,2446600,2471700,223400311,2636993.642\n12/21/2018 12:00:00 AM,2467500,2496900,2399900,2407000,213445004,2604247.029\n12/24/2018 12:00:00 AM,2390000,2402900,2343400,2343400,126345859,2564180.151\n12/26/2018 12:00:00 AM,2359000,2461800,2337600,2461800,194254142,2558942.962\n12/27/2018 12:00:00 AM,2425700,2481800,2389600,2480700,162914215,2555912.371\n12/28/2018 12:00:00 AM,2497300,2513200,2464500,2477500,137837623,2552757.207\n12/31/2018 12:00:00 AM,2495000,2501600,2474800,2499200,109065742,2551457.326\n01/02/2019 12:00:00 AM,2460600,2512100,2459600,2501800,113049958,2550350.984\n01/03/2019 12:00:00 AM,2483000,2485700,2436700,2442100,120229906,2544349.816\n01/04/2019 12:00:00 AM,2475900,2531100,2471700,2523900,127632690,2544316.756\n01/07/2019 12:00:00 AM,2527600,2559300,2517000,2543800,92782393,2544310.014\n01/08/2019 12:00:00 AM,2568600,2573100,2540100,2567700,91402346,2544930.932\n01/09/2019 12:00:00 AM,2575600,2589100,2562000,2579700,81042188,2546090.285\n01/10/2019 12:00:00 AM,2563100,2591500,2555200,2588800,89194945,2547744.706\n01/11/2019 12:00:00 AM,2576500,2589800,2570300,2589800,63179848,2549400.796\n01/14/2019 12:00:00 AM,2568700,2583000,2564100,2574000,55596057,2549980.07\n01/15/2019 12:00:00 AM,2578200,2607000,2578200,2603500,75236655,2552392.18\n01/16/2019 12:00:00 AM,2608200,2619600,2606000,2609800,64108161,2555232.719\n01/17/2019 12:00:00 AM,2600000,2639200,2599700,2629600,81545544,2559936.093\n01/18/2019 12:00:00 AM,2650000,2669700,2641100,2664600,107074964,2568758.084\n01/22/2019 12:00:00 AM,2647700,2650400,2610600,2628600,94951142,2571230.731\n01/23/2019 12:00:00 AM,2640000,2647600,2606600,2634100,78007199,2574081.067\n01/24/2019 12:00:00 AM,2632100,2641900,2620900,2635500,52302743,2576934.03\n01/25/2019 12:00:00 AM,2656200,2667000,2651100,2657800,82960927,2582109.059\n01/28/2019 12:00:00 AM,2633800,2638300,2618000,2637600,78330632,2584132.394\n01/29/2019 12:00:00 AM,2639300,2645500,2624800,2634100,57549403,2585718.92\n01/30/2019 12:00:00 AM,2650900,2685200,2642500,2675800,83541451,2591773.515\n01/31/2019 12:00:00 AM,2675000,2703900,2672700,2699300,80400276,2600683.699\n02/01/2019 12:00:00 AM,2701300,2712000,2691900,2700600,72038042,2609048.496\n02/04/2019 12:00:00 AM,2701400,2720200,2693600,2719600,52322390,2619678.318\n02/05/2019 12:00:00 AM,2724700,2734400,2718900,2731000,66377266,2631160.467\n02/06/2019 12:00:00 AM,2728000,2733400,2719200,2727400,48360155,2640405.519\n02/07/2019 12:00:00 AM,2709300,2715400,2683000,2701400,87046957,2643384.31\n02/08/2019 12:00:00 AM,2687200,2705100,2678300,2704700,66123754,2646585.195\n02/11/2019 12:00:00 AM,2711700,2714900,2700400,2706200,59745218,2649796.495\n02/12/2019 12:00:00 AM,2724300,2745200,2723400,2741000,63150422,2657736.503\n02/13/2019 12:00:00 AM,2750600,2759300,2745600,2749900,58128429,2666398.577\n02/14/2019 12:00:00 AM,2737700,2756400,2728700,2743800,75153118,2672645.588\n02/15/2019 12:00:00 AM,2763800,2774000,2761300,2773700,79085885,2683205.121\n02/19/2019 12:00:00 AM,2765200,2785800,2764700,2778500,52093038,2693479.154\n02/20/2019 12:00:00 AM,2778500,2789200,2772500,2784100,67228767,2703613.738\n02/21/2019 12:00:00 AM,2777500,2781000,2763500,2774200,54799005,2709750.333\n02/22/2019 12:00:00 AM,2781500,2793500,2778200,2791400,69886502,2718094.905\n02/25/2019 12:00:00 AM,2806900,2813100,2794300,2795200,63299670,2726219.815\n02/26/2019 12:00:00 AM,2791300,2802900,2789000,2793200,51868143,2732892.088\n02/27/2019 12:00:00 AM,2785300,2795900,2774800,2792000,51380666,2738557.56\n02/28/2019 12:00:00 AM,2789700,2794500,2783200,2786800,55290567,2742357.515\n03/01/2019 12:00:00 AM,2804400,2808700,2788200,2804200,66469737,2748567.311\n03/04/2019 12:00:00 AM,2816500,2818700,2768400,2794000,92363298,2751691.571\n03/05/2019 12:00:00 AM,2795500,2797600,2784100,2790200,50799626,2753902.04\n03/06/2019 12:00:00 AM,2791600,2791600,2769700,2773300,65186339,2754143.647\n03/07/2019 12:00:00 AM,2768400,2769700,2740700,2750100,87135188,2754011.543\n03/08/2019 12:00:00 AM,2729200,2746500,2724300,2744600,75928240,2753619.644\n03/11/2019 12:00:00 AM,2752400,2786200,2752300,2784400,55683813,2754597.775\n03/12/2019 12:00:00 AM,2790900,2800700,2788500,2794900,67070688,2756439.29\n03/13/2019 12:00:00 AM,2804900,2823600,2803000,2813400,67192638,2760280.073\n03/14/2019 12:00:00 AM,2813300,2818400,2806700,2811600,58035218,2763532.107\n03/15/2019 12:00:00 AM,2805600,2822000,2803400,2813100,70500698,2766768.177\n03/18/2019 12:00:00 AM,2815300,2826500,2813000,2823300,53932917,2771197.319\n03/19/2019 12:00:00 AM,2834900,2843600,2814200,2824000,75871459,2775382.02\n03/20/2019 12:00:00 AM,2821600,2835000,2803200,2815500,76226168,2777529.07\n03/21/2019 12:00:00 AM,2806300,2851800,2806000,2847300,71740185,2784119.218\n03/22/2019 12:00:00 AM,2832200,2838000,2791800,2792500,112328040,2784194.788\n03/25/2019 12:00:00 AM,2788900,2801900,2776400,2790400,76291897,2784268.427\n03/26/2019 12:00:00 AM,2809700,2821800,2795700,2811200,59544156,2784762.366\n03/27/2019 12:00:00 AM,2811300,2817500,2779300,2796500,66485128,2784808.031\n03/28/2019 12:00:00 AM,2803600,2812100,2790700,2807100,51663386,2785068.076\n03/29/2019 12:00:00 AM,2824100,2828400,2811400,2824800,62399538,2786469.602\n04/01/2019 12:00:00 AM,2847000,2861600,2844100,2858300,63982897,2791496.23\n04/02/2019 12:00:00 AM,2860400,2862300,2851000,2859700,37196324,2796356.047\n04/03/2019 12:00:00 AM,2873300,2877500,2857500,2864200,58863047,2801489.401\n04/04/2019 12:00:00 AM,2868000,2874600,2860100,2871800,46049322,2807343.551\n04/05/2019 12:00:00 AM,2879500,2886300,2876000,2885700,52350041,2814889.176\n04/08/2019 12:00:00 AM,2881000,2889000,2873700,2887900,43533191,2822067.649\n04/09/2019 12:00:00 AM,2877200,2880800,2867000,2873100,58219574,2825127.556\n04/10/2019 12:00:00 AM,2877700,2883800,2873200,2882900,45338210,2829298.834\n04/11/2019 12:00:00 AM,2888400,2888400,2875800,2882100,50745623,2832996.713\n04/12/2019 12:00:00 AM,2900100,2904700,2892600,2901600,54347951,2839399.438\n04/15/2019 12:00:00 AM,2902700,2903500,2890800,2899700,40803641,2844686.436\n04/16/2019 12:00:00 AM,2909600,2910100,2895000,2901600,47250452,2849812.112\n04/17/2019 12:00:00 AM,2914100,2914200,2889900,2894500,46905428,2852775.201\n04/18/2019 12:00:00 AM,2901200,2903200,2886600,2900200,57128888,2856356.431\n04/22/2019 12:00:00 AM,2891700,2904400,2890700,2902700,34371097,2860045.618\n04/23/2019 12:00:00 AM,2906800,2931300,2904200,2928800,48067844,2867824.165\n04/24/2019 12:00:00 AM,2927600,2931500,2920800,2922300,39141617,2872752.613\n04/25/2019 12:00:00 AM,2921200,2927800,2907300,2920500,47913789,2876766.491\n04/26/2019 12:00:00 AM,2921200,2934900,2912500,2934100,40182622,2882635.477\n04/29/2019 12:00:00 AM,2935300,2944500,2934100,2938700,54400805,2888684.722\n04/30/2019 12:00:00 AM,2935200,2943400,2919200,2940200,65799876,2894339.729\n05/01/2019 12:00:00 AM,2947600,2949500,2918000,2918100,60258030,2895090.621\n05/02/2019 12:00:00 AM,2916800,2927000,2895500,2911800,60849168,2895328.946\n05/03/2019 12:00:00 AM,2928000,2943400,2925700,2940300,46544275,2898274.926\n05/06/2019 12:00:00 AM,2892400,2933100,2889300,2928200,87572687,2899310.142\n05/07/2019 12:00:00 AM,2901500,2908100,2858200,2879300,122126119,2898377.505\n05/08/2019 12:00:00 AM,2875600,2894300,2868800,2875300,76825136,2897192.628\n05/09/2019 12:00:00 AM,2852000,2873300,2833100,2866600,92353972,2895302.507\n05/10/2019 12:00:00 AM,2856400,2889400,2823000,2881000,98319928,2894851.857\n05/13/2019 12:00:00 AM,2823900,2834900,2799300,2808600,109539319,2886387.136\n05/14/2019 12:00:00 AM,2820100,2851000,2818500,2834000,71206743,2883354.528\n05/15/2019 12:00:00 AM,2816000,2857600,2813600,2850600,63998271,2882221.18\n05/16/2019 12:00:00 AM,2858300,2892100,2857700,2877000,64428827,2882210.889\n05/17/2019 12:00:00 AM,2851300,2886000,2851300,2858400,83049965,2881695.751\n05/20/2019 12:00:00 AM,2840600,2854300,2831200,2839500,54207516,2880015.643\n05/21/2019 12:00:00 AM,2858300,2869300,2855500,2865100,42481385,2879902.681\n05/22/2019 12:00:00 AM,2854300,2866700,2851000,2856300,44484176,2879499.452\n05/23/2019 12:00:00 AM,2831600,2832100,2805800,2821400,84366849,2876586.792\n05/24/2019 12:00:00 AM,2837500,2841900,2820900,2827800,47298776,2874579.51\n05/28/2019 12:00:00 AM,2830100,2841400,2801500,2801500,60527933,2869918.893\n05/29/2019 12:00:00 AM,2789100,2793500,2767200,2782700,92901721,2863135.272\n05/30/2019 12:00:00 AM,2790800,2800400,2778100,2790300,55710278,2858373.906\n05/31/2019 12:00:00 AM,2762000,2771200,2752500,2752700,72088865,2848633.581\n06/03/2019 12:00:00 AM,2753000,2765500,2730900,2745700,87492324,2838701.589\n06/04/2019 12:00:00 AM,2771100,2806800,2766200,2805300,68467401,2838223.285\n06/05/2019 12:00:00 AM,2823400,2829900,2803200,2829600,62528891,2838138.33\n06/06/2019 12:00:00 AM,2832900,2855500,2825700,2848000,59513845,2838399.851\n06/07/2019 12:00:00 AM,2859500,2888500,2857500,2876500,64257228,2840286.01\n06/10/2019 12:00:00 AM,2893500,2908200,2888800,2889700,54537978,2843212.524\n06/11/2019 12:00:00 AM,2909500,2914000,2881900,2889000,48746820,2845878.704\n06/12/2019 12:00:00 AM,2886400,2892600,2878200,2883900,40324747,2847793.219\n06/13/2019 12:00:00 AM,2893700,2899800,2886200,2895800,43570266,2850743.059\n06/14/2019 12:00:00 AM,2892700,2899200,2884100,2892600,44888094,2853074.998\n06/17/2019 12:00:00 AM,2895300,2902200,2891800,2893700,35295998,2855387.602\n06/18/2019 12:00:00 AM,2913800,2935600,2910000,2924000,77625000,2861322.946\n06/19/2019 12:00:00 AM,2925300,2936500,2914900,2930600,70013693,2867694.917\n06/20/2019 12:00:00 AM,2960200,2963100,2936100,2958600,86590076,2877893.307\n06/21/2019 12:00:00 AM,2941400,2955100,2937600,2940000,67991002,2882482.6\n06/24/2019 12:00:00 AM,2941800,2945800,2934700,2936400,38096535,2886082.591\n06/25/2019 12:00:00 AM,2936700,2937300,2906400,2907600,71876031,2886430.316\n06/26/2019 12:00:00 AM,2917800,2923100,2903500,2904700,44754247,2886642.472\n06/27/2019 12:00:00 AM,2912900,2920600,2909300,2915000,34194112,2887386.031\n06/28/2019 12:00:00 AM,2925700,2935500,2920200,2930000,48292420,2889338.172\n07/01/2019 12:00:00 AM,2966800,2969100,2943300,2956600,62311396,2894323.522\n07/02/2019 12:00:00 AM,2955900,2964900,2946900,2964300,54952846,2900007.035\n07/03/2019 12:00:00 AM,2971900,2988200,2970200,2988000,31250129,2908861.94\n07/05/2019 12:00:00 AM,2974600,2986400,2960200,2984600,41808407,2915898.489\n07/08/2019 12:00:00 AM,2970100,2973500,2962300,2968200,38037047,2918882.8\n07/09/2019 12:00:00 AM,2955100,2975200,2954800,2971900,35212296,2922136.254\n07/10/2019 12:00:00 AM,2984000,2996600,2977900,2986100,49211837,2927082.115\n07/11/2019 12:00:00 AM,2993400,2995800,2982000,2993100,46132132,2932672.759\n07/12/2019 12:00:00 AM,2998600,3007300,2995100,3006500,35952915,2939898.944\n07/15/2019 12:00:00 AM,3011200,3011300,3002200,3007500,28272073,2946581.404\n07/16/2019 12:00:00 AM,3006400,3008800,2994400,2997100,35700618,2950062.753\n07/17/2019 12:00:00 AM,2997700,2999300,2977400,2977400,35522550,2950653.32\n07/18/2019 12:00:00 AM,2971800,2992400,2967000,2988300,46198657,2952129.477\n07/19/2019 12:00:00 AM,3000100,3000700,2969700,2971700,63466815,2952219.708\n07/22/2019 12:00:00 AM,2976100,2984900,2970500,2979000,36969602,2952692.615\n07/23/2019 12:00:00 AM,2991500,3000300,2982300,3000300,40884695,2955094.076\n07/24/2019 12:00:00 AM,2991600,3014400,2990900,3014400,39298979,2959133.025\n07/25/2019 12:00:00 AM,3009700,3010000,2991200,3000000,47024731,2960607.284\n07/26/2019 12:00:00 AM,3007700,3022300,3006200,3020100,36417399,2964293.982\n07/29/2019 12:00:00 AM,3018500,3019300,3008500,3014600,33607291,2966800.272\n07/30/2019 12:00:00 AM,2999000,3011700,2994900,3007200,39992583,2968151.073\n07/31/2019 12:00:00 AM,3009800,3012000,2952000,2974300,93490663,2968300.037\n08/01/2019 12:00:00 AM,2975600,3008700,2939600,2948400,129413425,2967190.076\n08/02/2019 12:00:00 AM,2938600,2941200,2909000,2926200,98958651,2964031.518\n08/05/2019 12:00:00 AM,2880700,2882000,2817300,2838200,153207444,2948195.914\n08/06/2019 12:00:00 AM,2859300,2880300,2842800,2878000,101365146,2943204.629\n08/07/2019 12:00:00 AM,2844000,2888200,2820600,2879700,111953123,2938827.001\n08/08/2019 12:00:00 AM,2896200,2936200,2890200,2936200,72990577,2938808.707\n08/09/2019 12:00:00 AM,2925900,2932400,2896500,2916200,80339390,2938284.443\n08/12/2019 12:00:00 AM,2899000,2905600,2870200,2881000,56407758,2935510.99\n08/13/2019 12:00:00 AM,2877800,2941500,2873600,2925500,84048259,2935445.813\n08/14/2019 12:00:00 AM,2880500,2887400,2837600,2839000,117557987,2929789.059\n08/15/2019 12:00:00 AM,2848900,2856300,2823900,2846500,83862040,2925455.751\n08/16/2019 12:00:00 AM,2864900,2893300,2864400,2888500,68482425,2924827.116\n08/19/2019 12:00:00 AM,2922300,2930800,2914400,2923300,48006246,2924815.094\n08/20/2019 12:00:00 AM,2917800,2923600,2899500,2900900,44802403,2924622.238\n08/21/2019 12:00:00 AM,2924700,2928600,2917200,2924500,43174047,2924621.105\n08/22/2019 12:00:00 AM,2932400,2939300,2904000,2923600,46884642,2924612.403\n08/23/2019 12:00:00 AM,2909500,2927600,2834700,2848500,120191247,2921284.702\n08/26/2019 12:00:00 AM,2872400,2880000,2855800,2880000,59943714,2920543.484\n08/27/2019 12:00:00 AM,2895500,2899500,2860400,2868700,61103929,2919226.486\n08/28/2019 12:00:00 AM,2861000,2890600,2852500,2888900,53616521,2918975.86\n08/29/2019 12:00:00 AM,2917700,2931600,2906200,2925800,50484863,2919111.534\n08/30/2019 12:00:00 AM,2942100,2942400,2914300,2924500,53366859,2919212.352\n09/03/2019 12:00:00 AM,2905600,2915800,2892800,2907400,56717313,2919180.142\n09/04/2019 12:00:00 AM,2931500,2940600,2923100,2940400,41612831,2919811.223\n09/05/2019 12:00:00 AM,2967800,2988200,2966500,2978200,73400759,2923038.807\n09/06/2019 12:00:00 AM,2982100,2987500,2974200,2980500,42688556,2926299.63\n09/09/2019 12:00:00 AM,2991500,2992300,2971600,2982000,46732221,2929519.586\n09/10/2019 12:00:00 AM,2973300,2982000,2959700,2981300,52064073,2932461.264\n09/11/2019 12:00:00 AM,2984900,3003300,2977500,3002500,56792958,2937608.688\n09/12/2019 12:00:00 AM,3012400,3024400,3004100,3012900,67811540,2943717.602\n09/13/2019 12:00:00 AM,3017800,3021700,3006800,3010900,54558955,2948924.892\n09/16/2019 12:00:00 AM,2998000,3006400,2994500,3001600,49705444,2952083.475\n09/17/2019 12:00:00 AM,2999100,3010200,2997700,3009200,36323494,2955947.774\n09/18/2019 12:00:00 AM,3004700,3012200,2982500,3011000,69120166,2959777.517\n09/19/2019 12:00:00 AM,3015000,3026300,3007200,3010800,69121065,2963302.171\n09/20/2019 12:00:00 AM,3003400,3006700,2974100,2982800,76469577,2963490.23\n09/23/2019 12:00:00 AM,2975700,2990000,2972800,2982100,34996734,2963645.636\n09/24/2019 12:00:00 AM,2994100,2998400,2948200,2958700,86035930,2963492.769\n09/25/2019 12:00:00 AM,2959400,2981000,2943300,2976200,59649873,2963501.522\n09/26/2019 12:00:00 AM,2976200,2978600,2954500,2970000,50218277,2963564.498\n09/27/2019 12:00:00 AM,2978700,2979400,2936900,2954000,69755359,2963234.174\n09/30/2019 12:00:00 AM,2959800,2975500,2959200,2967700,43647624,2963271.402\n10/01/2019 12:00:00 AM,2976700,2984500,2930000,2932400,82358360,2961566.711\n10/02/2019 12:00:00 AM,2914900,2915100,2866400,2880600,112701810,2953723.783\n10/03/2019 12:00:00 AM,2878100,2904200,2848200,2904200,80754022,2950815.697\n10/04/2019 12:00:00 AM,2912100,2946300,2910800,2943500,51702655,2950753.331\n10/07/2019 12:00:00 AM,2935000,2952600,2927700,2930800,53449478,2950331.504\n10/08/2019 12:00:00 AM,2910300,2918500,2884900,2885300,84728916,2946515.995\n10/09/2019 12:00:00 AM,2907800,2923000,2900600,2912700,53598153,2945620.671\n10/10/2019 12:00:00 AM,2911400,2942100,2910000,2932400,51438836,2945544.497\n10/11/2019 12:00:00 AM,2962800,2987200,2961500,2962800,84666635,2945931.598\n10/14/2019 12:00:00 AM,2959300,2966700,2955800,2959500,33597139,2946186.31\n10/15/2019 12:00:00 AM,2970500,2997000,2969700,2988800,42092291,2948076.644\n10/16/2019 12:00:00 AM,2984000,2991600,2979200,2984000,44244959,2949447.569\n10/17/2019 12:00:00 AM,2997000,3002400,2985200,2992800,42407689,2951450.756\n10/18/2019 12:00:00 AM,2987100,2994000,2970000,2979700,52953828,2952221.577\n10/21/2019 12:00:00 AM,2994800,3002100,2989400,2999900,32012712,2954491.199\n10/22/2019 12:00:00 AM,3006300,3009000,2989200,2990100,45261515,2955654.369\n10/23/2019 12:00:00 AM,2987400,2999400,2985000,2998800,29921722,2957474.013\n10/24/2019 12:00:00 AM,3008800,3010700,2994700,3003700,32530924,2959677.134\n10/25/2019 12:00:00 AM,2997400,3021900,2996900,3016000,39239172,2963128.345\n10/28/2019 12:00:00 AM,3029100,3038500,3029100,3033000,36575627,2968592.435\n10/29/2019 12:00:00 AM,3030300,3042200,3028600,3032100,41162448,2973431.375\n10/30/2019 12:00:00 AM,3034200,3045500,3019900,3041400,42953304,2979261.364\n10/31/2019 12:00:00 AM,3041100,3041300,3017400,3033300,58711304,2982808.159\n11/01/2019 12:00:00 AM,3049200,3061900,3047500,3061400,60530013,2990244.486\n11/04/2019 12:00:00 AM,3078700,3080000,3069600,3073700,53557993,2998985.531\n11/05/2019 12:00:00 AM,3075800,3079100,3067100,3070300,38622636,3005824.781\n11/06/2019 12:00:00 AM,3070600,3074000,3060700,3071000,39751180,3012120.521\n11/07/2019 12:00:00 AM,3086000,3094500,3076600,3081800,49868008,3019599.079\n11/08/2019 12:00:00 AM,3078200,3089700,3070400,3089400,40602769,3027581.762\n11/11/2019 12:00:00 AM,3074300,3085400,3072700,3083500,29661437,3032883.701\n11/12/2019 12:00:00 AM,3087500,3099900,3081500,3090000,42687583,3038729.112\n11/13/2019 12:00:00 AM,3079000,3095400,3076700,3091000,48941059,3044141.076\n11/14/2019 12:00:00 AM,3087700,3096400,3080900,3095500,45780378,3049747.537\n11/15/2019 12:00:00 AM,3109800,3118300,3102600,3117900,48879480,3058711.271\n11/18/2019 12:00:00 AM,3115200,3122800,3110300,3120200,43348280,3066914.982\n11/19/2019 12:00:00 AM,3126800,3126900,3112200,3119300,61908885,3073694.046\n11/20/2019 12:00:00 AM,3113000,3118200,3090700,3107700,67573622,3076431.406\n11/21/2019 12:00:00 AM,3108500,3110100,3093900,3102700,45099359,3078051.04\n11/22/2019 12:00:00 AM,3110600,3112300,3098500,3109600,35054695,3080408.386\n11/25/2019 12:00:00 AM,3119900,3133700,3119800,3133700,40447004,3086197.159\n11/26/2019 12:00:00 AM,3134200,3142800,3130600,3140800,33060315,3092539.047\n11/27/2019 12:00:00 AM,3146700,3154800,3143700,3154800,39384378,3100576.494\n11/29/2019 12:00:00 AM,3148900,3151300,3140600,3143100,26816024,3104292.036\n12/02/2019 12:00:00 AM,3146300,3146600,3111800,3116400,66926781,3104495.642\n12/03/2019 12:00:00 AM,3086400,3096400,3071300,3095500,66499178,3104300.168\n12/04/2019 12:00:00 AM,3106300,3121100,3103200,3114600,39502096,3104429.274\n12/05/2019 12:00:00 AM,3122200,3122400,3105900,3120200,36852740,3104770.343\n12/06/2019 12:00:00 AM,3141400,3153100,3141000,3148700,41180679,3107423.386\n12/09/2019 12:00:00 AM,3144100,3151800,3138000,3138800,30852815,3108678.725\n12/10/2019 12:00:00 AM,3138000,3145400,3128100,3135300,43286945,3109550.884\n12/11/2019 12:00:00 AM,3140500,3147000,3136000,3144200,45117507,3111146.787\n12/12/2019 12:00:00 AM,3144500,3179900,3141700,3171300,84790876,3115899.637\n12/13/2019 12:00:00 AM,3168800,3186600,3160300,3173200,69090591,3120542.186\n12/16/2019 12:00:00 AM,3191800,3201500,3191800,3195000,66586561,3128138.406\n12/17/2019 12:00:00 AM,3199800,3202400,3194800,3195700,47875424,3135073.008\n12/18/2019 12:00:00 AM,3200000,3202500,3195300,3195900,42877236,3141328.397\n12/19/2019 12:00:00 AM,3197800,3209800,3197600,3209000,66460035,3149144.041\n12/20/2019 12:00:00 AM,3205400,3214500,3204000,3207300,121837660,3155518.32\n12/23/2019 12:00:00 AM,3216300,3216500,3210700,3212200,40678424,3162023.338\n12/24/2019 12:00:00 AM,3214300,3215200,3209000,3212300,16196485,3167798.897\n12/26/2019 12:00:00 AM,3216900,3229400,3216400,3229400,27791943,3175929.705\n12/27/2019 12:00:00 AM,3237700,3238000,3222900,3228600,36687383,3182698.617\n12/30/2019 12:00:00 AM,3229400,3231000,3205500,3210800,43131761,3184392.801\n12/31/2019 12:00:00 AM,3205000,3221250,3201500,3218600,39932115,3186898.951\n01/02/2020 12:00:00 AM,3235800,3248700,3225350,3248700,48912531,3193677.316\n01/03/2020 12:00:00 AM,3211900,3236400,3211100,3224100,60780998,3195045.214\n01/06/2020 12:00:00 AM,3204400,3237300,3203600,3236400,43759922,3197579.061\n01/07/2020 12:00:00 AM,3230200,3235350,3222400,3227300,35212108,3198774.983\n01/08/2020 12:00:00 AM,3229900,3257800,3226800,3244500,57728195,3201682.574\n01/09/2020 12:00:00 AM,3262000,3267300,3255200,3266500,44095946,3207340.648\n01/10/2020 12:00:00 AM,3273600,3274600,3252050,3257100,45653071,3210582.256\n01/13/2020 12:00:00 AM,3264000,3279600,3259200,3279500,40497334,3216663.681\n01/14/2020 12:00:00 AM,3274800,3286200,3268500,3274500,55569570,3221079.847\n01/15/2020 12:00:00 AM,3273400,3290200,3272600,3281900,59764758,3226206.97\n01/16/2020 12:00:00 AM,3296700,3309200,3294500,3309200,44147974,3235224.624\n01/17/2020 12:00:00 AM,3317200,3321800,3310700,3319500,74196426,3245013.021\n01/21/2020 12:00:00 AM,3309200,3321800,3308200,3313000,64018769,3251726.81\n01/22/2020 12:00:00 AM,3322600,3329500,3311700,3313400,43894937,3257840.803\n01/23/2020 12:00:00 AM,3306000,3319200,3294100,3317200,42424449,3263958.776\n01/24/2020 12:00:00 AM,3324600,3325300,3273600,3287700,76182796,3264578.36\n01/27/2020 12:00:00 AM,3230500,3251200,3226800,3235000,70764386,3263090.344\n01/28/2020 12:00:00 AM,3250600,3278500,3245500,3268900,56570669,3263096.868\n01/29/2020 12:00:00 AM,3284000,3286200,3264000,3266200,44285050,3263111.03\n01/30/2020 12:00:00 AM,3243700,3279000,3235400,3276800,69267283,3263247.35\n01/31/2020 12:00:00 AM,3269700,3271700,3207400,3217300,97365490,3260718.809\n02/03/2020 12:00:00 AM,3233500,3261500,3232200,3241200,60751881,3260255.513\n02/04/2020 12:00:00 AM,3280700,3300100,3277350,3290600,54266275,3261042.437\n02/05/2020 12:00:00 AM,3322900,3330800,3306800,3328600,53887796,3264689.503\n02/06/2020 12:00:00 AM,3339800,3341900,3328050,3339800,43537036,3269300.625\n02/07/2020 12:00:00 AM,3328100,3336200,3316000,3322000,54243541,3271390.472\n02/10/2020 12:00:00 AM,3311900,3347200,3311900,3346800,35723822,3275775.124\n02/11/2020 12:00:00 AM,3361600,3370200,3347500,3352600,49571204,3280562.954\n02/12/2020 12:00:00 AM,3368600,3376500,3364300,3374200,35993342,3287814.243\n02/13/2020 12:00:00 AM,3359200,3381200,3355700,3370600,47811785,3293761.828\n02/14/2020 12:00:00 AM,3374800,3377200,3362000,3376000,51819302,3300017.072\n02/18/2020 12:00:00 AM,3365200,3371700,3352100,3367300,49435726,3304088.787\n02/19/2020 12:00:00 AM,3378100,3390650,3374800,3383400,36863549,3310049.291\n02/20/2020 12:00:00 AM,3377700,3386350,3336900,3369500,68702515,3313004.165\n02/21/2020 12:00:00 AM,3354100,3358100,3325800,3334800,94782814,3313043.109\n02/24/2020 12:00:00 AM,3231700,3258400,3212400,3224200,137060852,3305398.646\n02/25/2020 12:00:00 AM,3239600,3246100,3116900,3126500,197728104,3283950.926\n02/26/2020 12:00:00 AM,3141900,3181100,3107000,3115000,173407681,3263183.663\n02/27/2020 12:00:00 AM,3054500,3096400,2975100,2975100,253785330,3220196.635\n02/28/2020 12:00:00 AM,2886200,2962600,2855400,2962600,346777226,3181325.048\n03/02/2020 12:00:00 AM,2980000,3091500,2944600,3090900,207524129,3176464.814\n03/03/2020 12:00:00 AM,3095500,3138000,2975700,3002400,276438674,3162606.847\n03/04/2020 12:00:00 AM,3061100,3131000,3033300,3128600,150015051,3162000.979\n03/05/2020 12:00:00 AM,3049500,3084700,3000200,3024600,162185198,3155296.17\n03/06/2020 12:00:00 AM,2930800,2987800,2902400,2974600,201271746,3144177.366\n03/09/2020 12:00:00 AM,2756000,2841400,2734600,2742300,280056192,3102438.778\n03/10/2020 12:00:00 AM,2847600,2885200,2735000,2884200,248563890,3091284.493\n03/11/2020 12:00:00 AM,2807300,2819100,2708900,2743600,232891616,3065121.147\n03/12/2020 12:00:00 AM,2560500,2666400,2477200,2481100,347822422,3002665.601\n03/13/2020 12:00:00 AM,2633400,2710600,2495800,2693200,287485966,2987390.429\n03/16/2020 12:00:00 AM,2407800,2569000,2373700,2398500,266357640,2938208.227\n03/17/2020 12:00:00 AM,2450400,2559900,2370800,2528000,235335708,2915671.513\n03/18/2020 12:00:00 AM,2362500,2460300,2280800,2400000,300967068,2879801.628\n03/19/2020 12:00:00 AM,2392600,2473800,2322500,2405100,263646203,2847357.065\n03/20/2020 12:00:00 AM,2425900,2444600,2286200,2288000,304651791,2801462.129\n03/23/2020 12:00:00 AM,2280000,2293900,2182700,2229500,281816983,2750804.834\n03/24/2020 12:00:00 AM,2349900,2441000,2338000,2431500,214693586,2738808.944\n03/25/2020 12:00:00 AM,2450000,2563500,2397600,2467900,278538590,2730857.306\n03/26/2020 12:00:00 AM,2492600,2628000,2490500,2612000,224153673,2730707.251\n03/27/2020 12:00:00 AM,2532200,2608000,2510500,2534200,193638954,2727989.316\n03/30/2020 12:00:00 AM,2556800,2623900,2535300,2616500,141153243,2727577.988\n03/31/2020 12:00:00 AM,2607000,2633300,2562200,2577500,165876305,2726852.265\n04/01/2020 12:00:00 AM,2479500,2514400,2439000,2461500,171513817,2719207.404\n04/02/2020 12:00:00 AM,2452000,2526700,2446000,2518300,158102646,2716332.802\n04/03/2020 12:00:00 AM,2508100,2533100,2452300,2481900,121365280,2711076.261\n04/06/2020 12:00:00 AM,2580500,2669700,2567250,2648600,161181089,2709923.523\n04/07/2020 12:00:00 AM,2743000,2750000,2648900,2651300,180252896,2708806.352\n04/08/2020 12:00:00 AM,2680500,2760000,2655600,2740300,138883582,2710034.085\n04/09/2020 12:00:00 AM,2778100,2812000,2754800,2782000,163674342,2713475.319\n04/13/2020 12:00:00 AM,2771500,2774100,2714100,2756600,105066645,2715150.206\n04/14/2020 12:00:00 AM,2810800,2847500,2799100,2837900,123049134,2722200.785\n04/15/2020 12:00:00 AM,2775200,2795800,2754600,2777600,109527503,2724130.027\n04/16/2020 12:00:00 AM,2790500,2800300,2757600,2791000,111598189,2726696.083\n04/17/2020 12:00:00 AM,2854100,2873000,2824000,2866400,129983603,2734760.79\n04/20/2020 12:00:00 AM,2826000,2862900,2813600,2815900,89823671,2737714.143\n04/21/2020 12:00:00 AM,2764800,2780400,2720400,2730400,115363846,2737683.352\n04/22/2020 12:00:00 AM,2783800,2810000,2769100,2791000,82718312,2738930.175\n04/23/2020 12:00:00 AM,2804600,2839300,2787510,2790800,97600252,2740138.952\n04/24/2020 12:00:00 AM,2806900,2836900,2785000,2829700,73686003,2743392.056\n04/27/2020 12:00:00 AM,2850200,2882700,2846200,2870500,68934756,2749672.993\n04/28/2020 12:00:00 AM,2910000,2914000,2854050,2857300,97598619,2754231.939\n04/29/2020 12:00:00 AM,2915900,2948700,2904100,2932100,104012097,2766050.17\n04/30/2020 12:00:00 AM,2916900,2922300,2885900,2904800,104971069,2773086.982\n05/01/2020 12:00:00 AM,2851600,2860400,2815300,2827900,112895959,2773701.281\n05/04/2020 12:00:00 AM,2804600,2839000,2791600,2835700,70791051,2774602.867\n05/05/2020 12:00:00 AM,2866600,2892500,2857500,2861900,72761195,2776885.4\n05/06/2020 12:00:00 AM,2880100,2884600,2841500,2842500,65961054,2777865.875\n05/07/2020 12:00:00 AM,2877900,2897800,2871500,2876800,69442289,2780986.547\n05/08/2020 12:00:00 AM,2910500,2928500,2898700,2924400,62554633,2788477.961\n05/11/2020 12:00:00 AM,2903700,2940000,2898800,2925000,62733856,2795644.472\n05/12/2020 12:00:00 AM,2937500,2942200,2865500,2866700,82244098,2796508.758\n05/13/2020 12:00:00 AM,2859500,2871900,2789650,2816000,126198350,2796830.558\n05/14/2020 12:00:00 AM,2788400,2851000,2763800,2849700,110802691,2797008.329\n05/15/2020 12:00:00 AM,2823200,2863300,2813400,2862800,91973272,2797728.794\n05/18/2020 12:00:00 AM,2930900,2966750,2927000,2950000,101361961,2805850.126\n05/19/2020 12:00:00 AM,2944100,2962050,2919700,2919700,79323689,2809598.212\n05/20/2020 12:00:00 AM,2958300,2978700,2955800,2969300,68822340,2818303.68\n05/21/2020 12:00:00 AM,2968000,2976700,2936900,2948800,70251827,2823534.742\n05/22/2020 12:00:00 AM,2945600,2956300,2932300,2954400,54086999,2829138.858\n05/26/2020 12:00:00 AM,3019600,3021900,2987000,2990800,80856468,2838888.776\n05/27/2020 12:00:00 AM,3021400,3035700,2968700,3035300,92634618,2854375.647\n05/28/2020 12:00:00 AM,3046900,3068300,3022600,3029700,80738978,2867298.228\n05/29/2020 12:00:00 AM,3024600,3049600,2994700,3043200,102897180,2881321.546\n06/01/2020 12:00:00 AM,3036300,3062050,3030600,3055500,47464891,2896182.712\n06/02/2020 12:00:00 AM,3065200,3081300,3051000,3080800,67599676,2913993.371\n06/03/2020 12:00:00 AM,3102600,3132100,3099400,3121800,79682933,2937280.933\n06/04/2020 12:00:00 AM,3111200,3130000,3090800,3113600,68818172,2955236.645\n06/05/2020 12:00:00 AM,3174100,3212750,3171700,3193400,123509914,2985663.73\n06/08/2020 12:00:00 AM,3203000,3234100,3196300,3232000,65325209,3019370.839\n06/09/2020 12:00:00 AM,3202600,3223650,3193600,3207900,68019755,3040018.391\n06/10/2020 12:00:00 AM,3214000,3223900,3182300,3190000,84532800,3053498.336\n06/11/2020 12:00:00 AM,3113100,3121400,3000100,3006100,183916982,3051944.849\n06/12/2020 12:00:00 AM,3083200,3090800,2986000,3042100,170715746,3051817.522\n06/15/2020 12:00:00 AM,2980100,3082800,2967400,3070500,125276263,3051855.674\n06/16/2020 12:00:00 AM,3155600,3156400,3076800,3129600,122098812,3054190.183\n06/17/2020 12:00:00 AM,3140400,3143890,3108600,3116600,74761010,3055578.966\n06/18/2020 12:00:00 AM,3099800,3123000,3095200,3117800,65220566,3057002.235\n06/19/2020 12:00:00 AM,3141000,3143800,3065300,3086400,114303869,3057063.015\n06/22/2020 12:00:00 AM,3079500,3110500,3067500,3106200,64819717,3057768.71\n06/23/2020 12:00:00 AM,3135000,3145000,3116200,3120500,60336017,3059229.113\n06/24/2020 12:00:00 AM,3098400,3105000,3021100,3040900,116094751,3058709.324\n06/25/2020 12:00:00 AM,3034700,3076400,3012800,3073500,81346026,3058803.519\n06/26/2020 12:00:00 AM,3061700,3063800,2994200,3000500,110191083,3056228.211\n06/29/2020 12:00:00 AM,3014200,3044600,2989300,3044600,68919256,3056047.174\n06/30/2020 12:00:00 AM,3040100,3102000,3038300,3083600,87954973,3056238.16\n07/01/2020 12:00:00 AM,3095700,3118900,3090700,3105200,62334610,3057154.781\n07/02/2020 12:00:00 AM,3142400,3157000,3115100,3122300,59836713,3058983.5\n07/06/2020 12:00:00 AM,3163800,3176800,3155600,3170500,52435296,3064809.058\n07/07/2020 12:00:00 AM,3153800,3175200,3133700,3137800,72195898,3066838.174\n07/08/2020 12:00:00 AM,3145900,3163000,3127000,3161800,49246242,3070689.396\n07/09/2020 12:00:00 AM,3168500,3171000,3106800,3143800,75016501,3072619.868\n07/10/2020 12:00:00 AM,3142600,3178700,3127610,3175900,50767516,3077239.532\n07/13/2020 12:00:00 AM,3200600,3227100,3141400,3148400,88782287,3078814.356\n07/14/2020 12:00:00 AM,3132500,3197600,3120000,3189200,80603945,3083879.303\n07/15/2020 12:00:00 AM,3224800,3230350,3192700,3218500,76618906,3092076.705\n07/16/2020 12:00:00 AM,3197800,3212800,3190900,3207900,48326537,3097977.473\n07/17/2020 12:00:00 AM,3218200,3225600,3197400,3217200,54472899,3104695.867\n07/20/2020 12:00:00 AM,3214100,3251300,3206200,3243200,49745039,3114537.781\n07/21/2020 12:00:00 AM,3264800,3269200,3239400,3250100,49755103,3124689.093\n07/22/2020 12:00:00 AM,3246200,3272000,3245000,3268600,46779160,3136944.163\n07/23/2020 12:00:00 AM,3264500,3272300,3214900,3229600,69166002,3140527.628\n07/24/2020 12:00:00 AM,3209300,3219900,3192500,3208800,60592047,3141716.346\n07/27/2020 12:00:00 AM,3216300,3234100,3207800,3232200,43728174,3144965.885\n07/28/2020 12:00:00 AM,3224500,3236400,3208500,3211700,50744355,3145933.004\n07/29/2020 12:00:00 AM,3221400,3257300,3220800,3251200,44530648,3150670.024\n07/30/2020 12:00:00 AM,3219000,3244050,3196400,3239600,54373583,3153549.083\n07/31/2020 12:00:00 AM,3260000,3266100,3213400,3265200,67655356,3159286.648\n08/03/2020 12:00:00 AM,3283100,3296200,3277300,3287900,46717604,3167838.805\n08/04/2020 12:00:00 AM,3278800,3300600,3278600,3300600,38139316,3177732.587\n08/05/2020 12:00:00 AM,3314600,3323900,3311900,3321100,37235538,3190187.784\n08/06/2020 12:00:00 AM,3315200,3344600,3311400,3343300,39913430,3205344.505\n08/07/2020 12:00:00 AM,3332900,3348800,3323000,3345700,50273179,3219420.707\n08/10/2020 12:00:00 AM,3350000,3357700,3329600,3355700,39093250,3233860.523\n08/11/2020 12:00:00 AM,3368600,3375400,3320100,3328000,60840577,3239501.024\n08/12/2020 12:00:00 AM,3354700,3382800,3354300,3374400,47937318,3251758.609\n08/13/2020 12:00:00 AM,3365800,3382500,3358300,3368300,37594791,3261275.566\n08/14/2020 12:00:00 AM,3364300,3374100,3356700,3368400,42748803,3270030.912\n08/17/2020 12:00:00 AM,3379100,3383400,3374900,3379100,29645911,3279791.383\n08/18/2020 12:00:00 AM,3383200,3391000,3366200,3386400,34414214,3289896.41\n08/19/2020 12:00:00 AM,3391100,3396100,3366300,3372300,58910587,3295415.629\n08/20/2020 12:00:00 AM,3353300,3387950,3352200,3382800,37450891,3302119.813\n08/21/2020 12:00:00 AM,3378600,3397100,3375500,3394800,43998909,3310213.614\n08/24/2020 12:00:00 AM,3421300,3430000,3410600,3429200,40778173,3323517.288\n08/25/2020 12:00:00 AM,3435300,3442100,3422700,3441200,33649645,3337490.56\n08/26/2020 12:00:00 AM,3447200,3478600,3441700,3475700,44752689,3356176.734\n08/27/2020 12:00:00 AM,3485000,3499000,3465400,3483300,53042146,3373757.882\n08/28/2020 12:00:00 AM,3494500,3507100,3481600,3505800,45300252,3393138.444\n08/31/2020 12:00:00 AM,3503500,3512900,3491000,3493100,53787099,3405029.241\n09/01/2020 12:00:00 AM,3502400,3526900,3492400,3526000,48071811,3421277.156\n09/02/2020 12:00:00 AM,3546400,3587000,3534300,3577000,65239809,3444733.572\n09/03/2020 12:00:00 AM,3558500,3563800,3426100,3453900,132142532,3444819.668\n09/04/2020 12:00:00 AM,3460700,3478090,3348800,3425700,121071294,3444622.728\n09/08/2020 12:00:00 AM,3367400,3380500,3328800,3332100,102804803,3437915.886\n09/09/2020 12:00:00 AM,3375200,3424600,3366200,3397900,81687944,3437302.003\n09/10/2020 12:00:00 AM,3417500,3425200,3328600,3338900,83084631,3433125.804\n09/11/2020 12:00:00 AM,3357900,3369700,3310000,3340600,73834123,3429305.197\n09/14/2020 12:00:00 AM,3375200,3403700,3369300,3384600,57267531,3428766.12\n09/15/2020 12:00:00 AM,3411100,3420200,3390200,3401700,47255792,3428728.482\n09/16/2020 12:00:00 AM,3415000,3430600,3385300,3388200,72445309,3428327.861\n09/17/2020 12:00:00 AM,3335200,3376900,3330000,3358400,82845183,3426360.209\n09/18/2020 12:00:00 AM,3353500,3354900,3279700,3306500,90698721,3419725.989\n09/21/2020 12:00:00 AM,3257100,3270900,3217300,3269700,88383996,3408988.579\n09/22/2020 12:00:00 AM,3285500,3309000,3258700,3303000,58131952,3404352.072\n09/23/2020 12:00:00 AM,3309200,3312000,3221000,3226400,82043108,3390739.974\n09/24/2020 12:00:00 AM,3212200,3267900,3198000,3235000,71764361,3379937.419\n09/25/2020 12:00:00 AM,3225700,3295700,3216400,3287300,60520195,3377254.111\n09/28/2020 12:00:00 AM,3332200,3349600,3321600,3341900,58415562,3377065.876\n09/29/2020 12:00:00 AM,3340000,3347700,3316300,3323700,44028300,3376767.368\n09/30/2020 12:00:00 AM,3331000,3382900,3328800,3348900,84868616,3376484.993\n10/01/2020 12:00:00 AM,3376300,3387100,3350100,3370400,80342903,3376344.312\n10/02/2020 12:00:00 AM,3317100,3359150,3311900,3338400,77980566,3376337.026\n10/05/2020 12:00:00 AM,3360100,3399500,3360100,3397600,41167062,3377089.633\n10/06/2020 12:00:00 AM,3398700,3421700,3343800,3349300,82966706,3377016.615\n10/07/2020 12:00:00 AM,3381200,3416300,3380900,3407600,44075564,3378056.601\n10/08/2020 12:00:00 AM,3428800,3438500,3418700,3437800,38281729,3380929.039\n10/09/2020 12:00:00 AM,3455300,3473500,3448900,3468500,50708118,3386315.419\n10/12/2020 12:00:00 AM,3495500,3540200,3490600,3524300,64619979,3397728.012\n10/13/2020 12:00:00 AM,3523100,3523800,3491000,3501300,65629877,3404353.626\n10/14/2020 12:00:00 AM,3507300,3519300,3471500,3479300,50761914,3407830.928\n10/15/2020 12:00:00 AM,3437200,3480200,3431300,3475000,54266254,3410708.602\n10/16/2020 12:00:00 AM,3489900,3507500,3471100,3472900,64891517,3413254.245\n10/19/2020 12:00:00 AM,3485700,3493200,3410600,3420100,59117764,3413274.172\n10/20/2020 12:00:00 AM,3434200,3468800,3426500,3433800,52953855,3413424.5\n10/21/2020 12:00:00 AM,3433600,3456700,3424100,3427300,55820362,3413450.704\n10/22/2020 12:00:00 AM,3429200,3452400,3406500,3446100,48736995,3414020.763\n10/23/2020 12:00:00 AM,3459100,3459900,3431500,3457800,40954601,3415201.986\n10/26/2020 12:00:00 AM,3421400,3429800,3356300,3393900,83377228,3414603.243\n10/27/2020 12:00:00 AM,3397400,3401150,3379900,3382200,52891143,3413427.275\n10/28/2020 12:00:00 AM,3321100,3328400,3261300,3266600,113415793,3399780.044\n10/29/2020 12:00:00 AM,3269900,3333900,3251000,3299800,78860838,3393432.767\n10/30/2020 12:00:00 AM,3282800,3296800,3226000,3265400,99522697,3383470.534\n11/02/2020 12:00:00 AM,3302000,3323500,3272400,3302000,73909088,3379656.79\n11/03/2020 12:00:00 AM,3337200,3382500,3331700,3360300,80997071,3379546.774\n11/04/2020 12:00:00 AM,3408000,3479200,3396000,3435400,113182021,3381463.927\n11/05/2020 12:00:00 AM,3492800,3521900,3488750,3502400,73813299,3388887.706\n11/06/2020 12:00:00 AM,3499700,3515000,3476500,3501600,60701935,3395742.161\n11/09/2020 12:00:00 AM,3643600,3643700,3540600,3545600,145206783,3407343.99\n11/10/2020 12:00:00 AM,3535200,3551800,3505900,3540400,73250171,3417068.69\n11/11/2020 12:00:00 AM,3564300,3575600,3550700,3566700,48425558,3429554.303\n11/12/2020 12:00:00 AM,3555700,3564200,3512600,3532100,60620567,3434979.149\n11/13/2020 12:00:00 AM,3553000,3589000,3547100,3581000,51387458,3445845.487\n11/16/2020 12:00:00 AM,3611000,3625900,3595900,3625700,63099795,3462182.709\n11/17/2020 12:00:00 AM,3599700,3619200,3583400,3606200,57359007,3472739.072\n11/18/2020 12:00:00 AM,3609800,3615000,3562400,3562800,58727952,3476111.891\n11/19/2020 12:00:00 AM,3556800,3581800,3541500,3577800,51165348,3480722.28\n11/20/2020 12:00:00 AM,3574500,3577100,3552500,3553300,50408452,3482555.08\n11/23/2020 12:00:00 AM,3572500,3588200,3548650,3574600,51739439,3486071.938\n11/24/2020 12:00:00 AM,3603000,3638100,3592900,3632200,56453154,3496006.216\n11/25/2020 12:00:00 AM,3631600,3631600,3614850,3626600,35940388,3504193.875\n11/27/2020 12:00:00 AM,3638400,3641800,3625800,3636700,23919941,3513201.788\n11/30/2020 12:00:00 AM,3628400,3631200,3591800,3620600,70776034,3518644.317\n12/01/2020 12:00:00 AM,3656000,3676500,3649300,3660200,67257271,3529022.215\n12/02/2020 12:00:00 AM,3648000,3669500,3642000,3667900,38543468,3539768.508\n12/03/2020 12:00:00 AM,3666600,3681900,3655000,3666900,54787910,3549441.28\n12/04/2020 12:00:00 AM,3673000,3698500,3672200,3698500,41677506,3563411.116\n12/07/2020 12:00:00 AM,3689700,3696200,3677200,3690900,41405227,3573970.936\n12/08/2020 12:00:00 AM,3676700,3707700,3676700,3701700,35566369,3585388.17\n12/09/2020 12:00:00 AM,3709100,3710500,3659500,3668500,62483119,3588917.271\n12/10/2020 12:00:00 AM,3653900,3678550,3644500,3667300,49958315,3592121.078\n12/11/2020 12:00:00 AM,3649300,3665800,3632650,3663000,48805237,3594578.949\n12/14/2020 12:00:00 AM,3686100,3698000,3644900,3646600,56272411,3595169.256\n12/15/2020 12:00:00 AM,3674600,3695900,3659200,3695900,52393172,3601093.599\n12/16/2020 12:00:00 AM,3698100,3711600,3688800,3701700,48533538,3607468.398\n12/17/2020 12:00:00 AM,3719300,3724590,3710500,3722400,53146880,3616550.106\n12/18/2020 12:00:00 AM,3709800,3711500,3670200,3691800,97825013,3619135.947\n12/21/2020 12:00:00 AM,3649800,3784600,3620300,3678600,75870057,3620174.944\n12/22/2020 12:00:00 AM,3682300,3683300,3660400,3672400,42023209,3620670.799\n12/23/2020 12:00:00 AM,3683300,3696100,3673900,3675700,38573967,3621418.616\n12/24/2020 12:00:00 AM,3680600,3690000,3674500,3690000,21624848,3623563.168\n12/28/2020 12:00:00 AM,3718100,3725900,3710700,3721700,32833964,3629799.456\n12/29/2020 12:00:00 AM,3738500,3740000,3708300,3714600,45884792,3634160.577\n12/30/2020 12:00:00 AM,3723800,3730800,3715800,3719900,43472434,3639043.61\n12/31/2020 12:00:00 AM,3718500,3746420,3712400,3738800,55021528,3646577.185\n01/04/2021 12:00:00 AM,3753000,3754500,3648300,3687900,94376649,3646670.113\n01/05/2021 12:00:00 AM,3680500,3724800,3680500,3713300,54611244,3648363.564\n01/06/2021 12:00:00 AM,3696700,3769800,3691200,3735500,92950127,3652381.689\n01/07/2021 12:00:00 AM,3761800,3798900,3759200,3791000,62270874,3664107.803\n01/08/2021 12:00:00 AM,3806300,3814900,3771100,3812600,63163985,3678360.242\n01/11/2021 12:00:00 AM,3778400,3805700,3777200,3786900,45616919,3685029.748\n01/12/2021 12:00:00 AM,3788400,3798500,3763600,3787700,46336265,3691396.473\n01/13/2021 12:00:00 AM,3786500,3808600,3778500,3797900,39076595,3698811.395\n01/14/2021 12:00:00 AM,3806300,3811300,3781000,3784600,41851848,3703052.931\n01/15/2021 12:00:00 AM,3767100,3775800,3737200,3757000,81635248,3703718.61\n01/19/2021 12:00:00 AM,3782400,3792300,3767800,3786500,43441293,3707096.996\n01/20/2021 12:00:00 AM,3811000,3847900,3806900,3838900,54390017,3717357.274\n01/21/2021 12:00:00 AM,3845000,3849500,3832500,3842400,42558878,3727353.732\n01/22/2021 12:00:00 AM,3822400,3840800,3818400,3828800,40128912,3733479.809\n01/25/2021 12:00:00 AM,3836000,3847700,3784600,3843900,62710822,3741385.052\n01/26/2021 12:00:00 AM,3854100,3858500,3835500,3837900,39595836,3747386.93\n01/27/2021 12:00:00 AM,3802400,3803200,3720100,3744100,101850739,3747265.106\n01/28/2021 12:00:00 AM,3762700,3819300,3758900,3776300,76978675,3747463.324\n01/29/2021 12:00:00 AM,3755700,3766700,3682700,3700700,110053148,3744867.711\n02/01/2021 12:00:00 AM,3738400,3773400,3714200,3762300,65567084,3744999.501\n02/02/2021 12:00:00 AM,3796800,3832200,3796000,3815500,55798392,3746722.985\n02/03/2021 12:00:00 AM,3824300,3837000,3804800,3818500,44014303,3748599.749\n02/04/2021 12:00:00 AM,3830300,3862400,3827800,3861900,41511995,3754244.962\n02/05/2021 12:00:00 AM,3882700,3884700,3864850,3877100,40406184,3761305.88\n02/08/2021 12:00:00 AM,3893000,3905400,3883600,3905100,34842630,3771526.819\n02/09/2021 12:00:00 AM,3895500,3908900,3891700,3902500,31350935,3780485.851\n02/10/2021 12:00:00 AM,3921000,3922800,3875100,3900800,54203861,3788482.9\n02/11/2021 12:00:00 AM,3913400,3916900,3881200,3907100,39710262,3796829.441\n02/12/2021 12:00:00 AM,3898800,3928900,3897700,3926400,40896380,3807481.89\n02/16/2021 12:00:00 AM,3940600,3941600,3915400,3923000,44689625,3816399.03\n02/17/2021 12:00:00 AM,3904300,3926300,3893300,3923900,45915151,3824766.884\n02/18/2021 12:00:00 AM,3895600,3915150,3877400,3907200,53102694,3828913.491\n02/19/2021 12:00:00 AM,3921000,3923800,3895500,3900300,69024514,3831717.504\n02/22/2021 12:00:00 AM,3870600,3896200,3867400,3870300,58902644,3831838.242\n02/23/2021 12:00:00 AM,3847200,3889450,3802000,3875000,99054818,3831968.752\n02/24/2021 12:00:00 AM,3862300,3922300,3852700,3917700,65524154,3836220.218\n02/25/2021 12:00:00 AM,3905100,3918700,3807789,3823300,138895516,3835666.913\n02/26/2021 12:00:00 AM,3844400,3855800,3782300,3803600,136480361,3833890.565\n03/01/2021 12:00:00 AM,3856500,3909200,3855500,3895800,94752970,3835146.26\n03/02/2021 12:00:00 AM,3898700,3900700,3860000,3865400,73195170,3835192.596\n03/03/2021 12:00:00 AM,3858300,3868300,3813100,3814200,109545489,3834502.202\n03/04/2021 12:00:00 AM,3812200,3840000,3718800,3767000,171790812,3830694.106\n03/05/2021 12:00:00 AM,3804100,3847600,3726500,3836300,136356393,3830739.162\n03/08/2021 12:00:00 AM,3846900,3876800,3814200,3817200,108618789,3830486.706\n03/09/2021 12:00:00 AM,3858800,3899100,3853100,3871700,100993909,3831076.004\n03/10/2021 12:00:00 AM,3895900,3914000,3881702,3895800,102850671,3832839.601\n03/11/2021 12:00:00 AM,3922400,3956500,3917400,3935300,78605803,3837647.994\n03/12/2021 12:00:00 AM,3920900,3942100,3912000,3940600,58694370,3842745.888\n03/15/2021 12:00:00 AM,3944000,3966850,3920400,3964100,67193193,3850175.302\n03/16/2021 12:00:00 AM,3970600,3978300,3950800,3959100,67508285,3856323.759\n03/17/2021 12:00:00 AM,3945600,3981200,3933000,3972600,83563811,3863765.075\n03/18/2021 12:00:00 AM,3944900,3967200,3908650,3914800,101153040,3864307.926\n03/19/2021 12:00:00 AM,3899400,3915690,3871500,3894800,94802448,3864452.076\n03/22/2021 12:00:00 AM,3900100,3940500,3899800,3925900,62207903,3865585.186\n03/23/2021 12:00:00 AM,3918900,3934600,3886600,3895000,80338274,3865764.257\n03/24/2021 12:00:00 AM,3909200,3927500,3874800,3875200,86478164,3865958.714\n03/25/2021 12:00:00 AM,3859900,3905500,3839000,3897000,102523995,3866017.173\n03/26/2021 12:00:00 AM,3909800,3964100,3902900,3959800,101407276,3869925.136\n03/29/2021 12:00:00 AM,3943500,3967499,3928100,3957800,93832458,3873424.024\n03/30/2021 12:00:00 AM,3943500,3957800,3930299,3947300,66174457,3875597.709\n03/31/2021 12:00:00 AM,3953500,3980000,3953300,3963300,90673494,3879212.789\n"
  },
  {
    "path": "Tests/TestData/spy_with_ChandeKrollStop.csv",
    "content": "Date,Open,High,Low,Close,Volume,short_stop,long_stop\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,148.98783999999998,152.66216\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,150.84227199999998,152.66216\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,151.5298176,152.66216\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,152.07585408,153.31414592\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,152.930683264,153.31414592\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,153.5005466112,153.31414592\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,153.71243728896,154.239316736\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,153.853949831168,156.17945338879997\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,154.6271598649344,156.54756271104\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,154.6271598649344,156.78605016883202\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,154.6271598649344,156.69701768644197\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,154.49372789194754,156.35561414915358\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,154.30298231355803,156.33849131932286\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,154.05150868067716,156.33849131932286\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,154.05150868067716,156.33849131932286\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,153.2909324445067,156.35383444436664\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,153.37474595560536,156.35383444436664\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,153.4577967644843,156.56906755549332\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,154.16023741158742,156.9122032355157\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,154.26218992926994,156.9122032355157\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,154.62775194341597,156.99781007073005\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,154.62775194341597,156.99781007073005\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,154.62775194341597,157.58224805658404\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,154.41816124378622,156.83947100497105\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,154.41816124378622,156.81357680397684\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,154.34913855681853,156.74086144318147\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,155.64531084545484,156.74086144318147\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,156.66224867636387,156.74086144318147\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,156.7637989410911,156.81775132363614\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,156.7637989410911,156.81775132363614\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,156.7637989410911,157.6962010589089\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,155.87303915287288,158.74605494216138\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,155.6924313222983,157.8668439537291\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,155.24394505783863,157.57547516298328\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,154.7231560462709,157.48638013038664\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,154.10452483701673,157.4031041043093\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,154.91351671655255,156.93648328344747\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,156.00481337324206,156.93648328344747\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,156.30985069859364,156.93648328344747\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,156.7178805588749,157.38518662675796\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,156.93030444709993,157.71014930140637\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,156.93030444709993,159.1021194411251\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,156.95499484614393,160.32969555290006\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,158.67999587691517,160.59375644232006\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,159.19399670153214,160.66500515385604\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,160.0051973612257,160.7448026387743\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,160.85015788898056,160.7448026387743\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,161.17612631118445,160.7448026387743\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,161.26490104894756,161.06984211101943\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,161.46592083915806,163.56387368881553\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,162.75073667132642,163.8550989510524\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,163.75458933706113,164.01407916084193\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,163.78567146964892,164.92926332867358\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,164.22853717571914,165.16541066293885\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,164.94282974057532,165.17432853035106\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,165.17026379246025,165.63146282428085\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,165.4062110339682,166.30717025942468\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,165.4062110339682,167.53973620753976\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,165.50037506173965,167.50962493826034\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,165.50037506173965,167.50962493826034\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,165.50037506173965,167.50962493826034\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,165.2263000493917,167.5751679683893\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,165.21104003951336,167.31013437471145\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,164.1448320316107,166.72410749976916\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,163.71589250023084,166.72410749976916\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,163.71589250023084,165.46142879985226\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,162.39071400018466,164.71114303988182\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,162.25857120014774,164.70691443190546\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,161.84885696011818,164.22753154552436\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,161.42246845447565,164.22753154552436\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,161.42246845447565,164.22753154552436\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,161.3939747635805,164.2560252364195\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,161.07917981086442,164.5708201891356\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,160.90667507895324,165.71065993683743\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,161.8414720505301,165.44852794946993\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,161.8414720505301,165.44852794946993\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,161.8414720505301,164.22625788766075\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,161.66717764042406,162.5830063101286\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,160.8769936898714,161.15640504810287\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,160.8769936898714,160.9151240384823\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,160.7048759615177,160.65009923078583\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,160.7048759615177,160.33807938462866\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,157.51753649229707,160.03246350770291\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,158.21402919383763,160.03246350770291\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,158.3472233550701,160.03246350770291\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,158.55377868405608,161.68597080616235\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,159.21902294724487,163.3827766449299\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,160.7532183577959,163.72097705275516\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,161.8685746862367,163.6814253137633\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,162.53285974898938,163.43714025101062\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,164.0682877991915,163.43714025101062\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,164.77663023935318,163.43714025101062\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,165.51530419148253,164.84171220080853\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,165.574243353186,166.23336976064684\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,165.84339468254882,167.14469580851747\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,166.63271574603908,167.44575664681398\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,166.79217259683125,169.16660531745117\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,167.465738077465,169.344261922535\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,167.698590461972,169.344261922535\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,167.698590461972,169.344261922535\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,167.698590461972,169.861409538028\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,167.50229789566208,170.06216168347035\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,167.50229789566208,169.95372934677627\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,167.477016522579,169.90298347742103\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,167.477016522579,169.90298347742103\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,168.00969057445056,169.90298347742103\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,168.36175245956045,169.9703867819368\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,168.63940196764835,170.32030942554945\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,168.63940196764835,170.52059803235164\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,168.63940196764835,170.52059803235164\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,168.57441725929496,170.89447842588132\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,168.57441725929496,170.94558274070505\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,168.55353380743597,170.740138363241\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,168.47482704594879,170.740138363241\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,168.15986163675902,170.740138363241\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,167.75271144752577,169.0918308419794\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,167.75271144752577,168.35346467358352\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,167.0981691580206,167.62277173886682\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,167.0465353264165,167.62221739109344\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,167.03722826113318,167.21577391287477\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,166.93778260890656,167.21577391287477\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,164.40422608712524,167.10729530423984\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,164.40216375660813,167.08783624339188\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,164.40216375660813,166.6442689947135\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,164.40216375660813,166.3734151957708\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,163.98526784338338,166.36473215661664\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,164.1042142747067,166.24578572529333\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,164.1042142747067,166.24578572529333\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,164.1042142747067,166.24578572529333\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,163.3968777086498,166.17312229135018\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,163.57750216691983,166.17312229135018\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,164.33200173353586,166.17312229135018\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,165.6736013868287,166.57249783308015\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,166.39888110946296,167.09799826646412\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,166.82310488757037,167.21689511242963\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,167.08248391005628,167.21689511242963\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,168.49398712804503,167.21689511242963\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,168.72318970243603,168.9275160899437\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,170.33055176194884,170.86681029756397\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,170.64444140955905,170.86681029756397\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,170.64444140955905,171.69555859044095\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,170.64444140955905,171.69555859044095\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,170.57507400169425,172.23492599830576\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,170.74405920135538,171.7459407986446\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,170.74405920135538,171.62675263891566\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,170.74405920135538,171.14740211113255\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.59324736108434,169.99592168890604\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,167.97259788886745,169.99592168890604\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,167.68407831109397,169.99592168890604\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,167.29326264887516,170.02673735112484\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,167.26461011910013,170.05538988089987\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,166.27975047622408,170.06024952377592\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,166.27975047622408,168.8497596952166\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,166.26780038097928,167.98980775617326\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,165.85024030478343,167.98980775617326\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,166.3145230360491,167.98980775617326\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,167.0756184288393,168.5343815711607\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,167.27449474307144,168.40550525692856\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,168.07559579445714,168.40550525692856\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,169.2604766355657,168.40550525692856\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,170.74638130845258,171.31440420554284\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,171.44310504676207,172.77689495323793\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,172.67248403740965,172.77689495323793\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,172.74398722992774,172.77689495323793\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,173.03718978394218,173.88751596259036\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,173.34575182715375,174.52601277007227\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,174.03860146172298,176.39139853827703\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,174.8908811693784,176.30911883062163\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,174.8908811693784,176.30911883062163\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,174.8908811693784,176.30911883062163\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,174.8907049355027,177.12929506449728\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,175.00896092697738,177.7210390730226\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,175.00896092697738,177.7210390730226\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,175.00896092697738,177.71586500673448\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,175.00516874158188,177.71586500673448\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,175.00413499326552,177.71586500673448\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,174.58963711655193,177.81036288344805\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,174.80370969324153,177.59629030675845\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,175.21296775459325,177.59629030675845\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,176.39437420367457,177.59629030675845\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,177.3594993629397,177.8756257963254\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,177.69959949035174,177.8756257963254\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,177.7996795922814,178.7903204077186\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,177.7996795922814,178.7903204077186\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,177.7996795922814,178.7903204077186\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,178.0186359512481,180.79136404875192\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,178.60090876099844,180.54909123900154\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,178.83672700879876,180.36327299120123\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,179.097381607039,180.36327299120123\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,179.6559052856312,180.36327299120123\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,179.6559052856312,181.002618392961\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,179.6559052856312,181.43182061719602\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,179.60272422850497,181.0114564937568\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,179.48817938280396,180.86716519500544\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.23283480499455,180.86716519500544\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,179.23283480499455,180.86716519500544\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,179.28409142015718,180.7359085798428\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,179.28409142015718,180.7359085798428\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.28409142015718,180.47898149109938\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.13881480712047,180.2911851928795\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.13881480712047,180.2911851928795\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,179.13881480712047,180.2911851928795\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,178.65505184569642,180.38795852344288\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,178.24090654499656,180.38795852344288\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,178.63072523599726,180.67927476400274\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,179.5205801887978,180.43941981120219\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,180.32246415103825,180.00753584896174\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,181.3979713208306,180.00753584896174\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,181.9223770566645,180.00753584896174\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,182.1979016453316,182.8276229433355\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,182.75632131626526,182.8276229433355\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,182.75632131626526,184.0520983546684\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,182.75632131626526,184.46367868373474\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,182.35724564240977,184.5382034860722\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,182.35724564240977,184.5382034860722\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,182.2317965139278,184.4868502310862\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,182.15143721114225,184.4868502310862\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,181.76681585210483,184.4868502310862\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,181.76681585210483,184.43854731831615\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,181.76681585210483,184.43854731831615\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,181.78012971627766,184.43854731831615\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,182.08010377302213,184.19989622697787\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,182.2000830184177,184.0799169815823\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,182.2000830184177,184.0799169815823\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,182.37205313178734,184.0799169815823\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,182.37205313178734,184.82993358526582\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,182.37205313178734,182.85108599565612\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,181.72364250542986,181.29686879652488\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,180.7489140043439,180.9774950372199\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,180.7125049627801,180.8419960297759\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,180.7125049627801,180.8419960297759\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,179.4380039702241,180.8419960297759\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,177.50640317617925,179.0627019672453\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,175.5391225409434,178.70816157379622\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,175.16747074096304,178.35252925903697\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,175.16747074096304,178.3480234072296\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,175.20358127421633,178.3480234072296\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,175.99286501937306,177.78713498062694\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,178.20629201549846,177.78713498062694\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,178.99503361239877,177.78713498062694\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,179.184026889919,177.94370798450154\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,180.47122151193523,179.05496638760124\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,181.04297720954818,181.74597311008097\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,181.36038176763853,183.0987784880648\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,181.36038176763853,183.48702279045182\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,181.60224433128866,184.41961823236147\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,182.56779546503094,184.4696945858892\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,182.74023637202475,185.94775566871132\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,182.9141890976198,185.8358109023802\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,182.96135127809583,185.8358109023802\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,183.75908102247666,185.8358109023802\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,183.75908102247666,186.98864872190418\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,183.79701185438506,187.47873518201865\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,184.47560948350804,187.34439051649196\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,185.39048758680644,186.96951241319357\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,185.77239006944515,186.93760993055486\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,185.93791205555613,186.93760993055486\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,185.93791205555613,186.93760993055486\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,185.93791205555613,189.02533628444408\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,185.83466371555593,188.49226902755527\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,185.83466371555593,188.0498152220442\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,185.12773097244474,188.0498152220442\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,185.1001847779558,188.0498152220442\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,184.97814782236463,188.05748174210828\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,184.37251825789173,188.05748174210828\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,184.70912934804056,188.32198539368665\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,184.70912934804056,188.3335883149493\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,184.80904278274596,188.83095721725405\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,184.80904278274596,188.83095721725405\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,184.97458738095742,187.9454126190426\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,184.97458738095742,187.87233009523408\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,184.97458738095742,187.80186407618726\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,184.6985087390502,187.56149126094982\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,185.80480699124016,187.22519300875985\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,186.09184559299212,187.22519300875985\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,186.09184559299212,187.22519300875985\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,186.09184559299212,188.09001882048506\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,185.75747647439368,187.61801505638803\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,185.67198494361196,187.61801505638803\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,185.67198494361196,187.61801505638803\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,185.64158795488956,186.10818370887065\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,184.75727036391166,185.92054696709653\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,182.55945303290346,185.92054696709653\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,182.55945303290346,185.92054696709653\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,182.66667995284658,185.55332004715342\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,183.34934396227726,185.19065603772273\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,184.8554751698218,185.0545248301782\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,185.31638013585746,185.0545248301782\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,185.34910410868596,185.0545248301782\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,185.34910410868596,187.73361986414255\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,185.34910410868596,188.61089589131404\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,185.17528328694877,188.36141869635279\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,185.25086504291778,188.20913495708223\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,185.79669203433423,188.00330796566578\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,186.16135362746738,187.93864637253262\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,186.16135362746738,187.93864637253262\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,186.16135362746738,187.93864637253262\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,185.9850829019739,189.3507469427367\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,185.94406632157913,189.3507469427367\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,185.7992530572633,189.26247804335148\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,186.5100175653188,189.26247804335148\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,187.46401405225507,188.9659859477449\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,187.58721124180403,188.9659859477449\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,187.58721124180403,188.9659859477449\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,187.58721124180403,189.66278875819597\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,187.30993215580366,189.5900678441963\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,187.30993215580366,189.5900678441963\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,187.30993215580366,189.5900678441963\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,186.97772526377148,189.63605427535705\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,187.7221802110172,189.67284342028563\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,188.88174416881375,189.7222747362285\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,189.357395335051,189.76825583118625\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,190.00191626804082,189.76825583118625\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,190.57353301443266,190.522604664949\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,190.80082641154613,191.2580837319592\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,190.97866112923688,191.81646698556736\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,191.2749289033895,193.07133887076313\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,192.24994312271158,193.07133887076313\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,193.11795449816927,193.35507109661052\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,193.84836359853543,194.28204550183074\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,194.00069087882832,194.28204550183074\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,194.00069087882832,194.30930912117168\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,194.00069087882832,194.30930912117168\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,193.96255270306267,194.78744729693733\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,193.72683372996013,195.38453301603192\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,193.72683372996013,195.38453301603192\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,193.75509886973958,195.38453301603192\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,194.18807909579166,195.39362641282554\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,194.35846327663333,195.71192090420834\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,194.59477062130665,195.71192090420834\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,194.59477062130665,195.81522937869335\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,194.59477062130665,195.81522937869335\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,194.18781649704533,196.763397441891\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,194.05825319763625,196.63671795351277\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,194.24262563718978,196.38737436281022\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.0601005097518,196.38737436281022\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,195.36608040780146,196.38737436281022\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,196.05486432624116,196.39391959219853\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,196.10989146099294,196.39391959219853\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,196.10989146099294,197.11513567375883\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,196.10989146099294,197.71010853900705\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,195.9147305350355,197.7842155719716\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,195.9147305350355,197.62737245757728\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,195.5657844280284,197.61389796606184\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,195.4126275424227,197.61389796606184\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,195.65670530172042,197.61389796606184\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,195.65670530172042,197.66329469827957\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,195.65670530172042,197.66329469827957\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,195.10936424137634,198.58063575862366\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,195.4860744915847,198.5039255084153\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,196.09085959326774,198.18914040673226\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,196.6086876746142,198.18914040673226\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,196.6086876746142,198.18914040673226\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,196.6086876746142,198.6913123253858\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,196.57095013969138,198.91904986030863\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,196.48076011175309,199.00031352847802\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,196.38460808940246,196.84625082278242\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,196.21968647152198,195.54700065822593\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,194.57374917721756,195.54700065822593\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,194.47299934177406,195.54700065822593\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,194.36839947341923,195.24182433701168\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,193.6127195787354,194.91145946960933\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,191.61817566298834,194.91145946960933\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,190.52626593945004,194.68373406054997\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,190.86901275156,194.34098724844\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,191.41521020124802,194.194789798752\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,192.4761681609984,194.194789798752\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,193.08693452879874,194.194789798752\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,193.907547623039,194.23383183900157\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,195.2340380984312,196.482452376961\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,196.08323047874495,196.482452376961\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,196.96258438299597,197.10741561700402\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,197.14206750639678,197.10741561700402\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,197.91965400511742,197.10741561700402\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,198.43572320409393,199.3079324936032\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,198.66057856327515,200.11034599488258\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,198.7404628506201,200.46427679590607\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,198.79237028049607,200.8195371493799\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,198.91589622439687,200.8195371493799\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,199.2747169795175,201.17762971950393\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,199.2747169795175,201.46410377560312\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,199.2747169795175,201.52528302048248\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,199.10377358361401,201.86622641638598\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,198.94161509351298,201.69270792518964\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,198.94161509351298,201.56816634015172\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,198.79729207481037,201.49253307212138\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,198.7818336598483,201.4340264576971\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,198.48746692787864,201.05522116615768\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,198.33597354230292,201.05522116615768\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,198.44705845365908,201.05522116615768\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,198.82364676292727,201.40635323707272\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,198.8349174103418,201.40635323707272\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,198.8349174103418,201.40635323707272\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,198.8349174103418,201.06605285738124\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,198.78394714261876,200.880842285905\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,198.78394714261876,200.274673828724\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,198.539157714095,200.274673828724\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,197.89532617127603,200.00899125038336\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,196.3562609370208,199.8931930003067\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,195.8468069996933,198.22855440024534\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,195.8468069996933,196.88484352019628\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,194.73144559975466,196.88484352019628\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,193.8551564798037,196.87949985292562\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,193.7705001470744,196.87949985292562\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,193.7705001470744,196.87949985292562\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,192.74840011765951,197.20159988234047\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,191.89472009412762,196.70457913975832\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,191.4117760753021,193.81166331180665\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,191.38542086024168,193.3613306494453\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,190.59866935055467,189.28906451955623\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,190.59866935055467,189.28906451955623\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,189.23093548044375,189.28906451955623\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,185.878748384355,188.95920103401278\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,187.00863917278974,188.95920103401278\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,188.2369113382318,188.95920103401278\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,189.45752907058545,189.11136082721023\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,190.29602325646837,189.56308866176818\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,190.9668186051747,194.26397674353163\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,193.09745488413975,194.26397674353163\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,193.9339639073118,197.0031813948253\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,194.57717112584945,197.93254511586025\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,196.81773690067956,199.4460360926882\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,197.98818952054364,199.52282887415058\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,198.1965516164349,200.03226309932043\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,198.57924129314793,201.0534483835651\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,199.40339303451833,201.0534483835651\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,200.1187144276147,201.41075870685208\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,200.89097154209173,203.20902845790826\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,201.5267772336734,203.20902845790826\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,201.71142178693873,203.20902845790826\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,202.103137429551,204.23322276632658\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,202.3405099436408,204.23857821306126\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,202.46640795491263,205.33686257044903\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,203.40912636393008,205.5735920450874\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,203.41130109114405,205.5735920450874\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,203.41130109114405,205.71869890885594\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,204.8408326983322,205.71869890885594\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,205.1566661586658,206.26895912708474\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,205.29733292693263,206.6491673016678\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,205.5138663415461,206.5061336584539\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,205.62509307323688,206.5061336584539\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,205.62509307323688,206.5061336584539\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,205.62509307323688,207.90392554141047\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,205.6050876534973,207.90392554141047\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,205.6050876534973,207.9249123465027\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,205.97405609823826,207.87594390176173\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,205.97405609823826,207.87594390176173\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,205.97405609823826,207.2882040971275\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,205.5972448785906,207.04856327770202\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.0917959028725,207.04856327770202\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,204.351436722298,205.79148049772928\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,203.9631493778384,204.23318439818343\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,203.17851950227072,204.03854751854675\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,201.14681560181657,204.03854751854675\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,203.12612958813008,204.03854751854675\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,204.40690367050405,204.5748380148374\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,205.71552293640326,205.11447706359675\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,206.83441834912261,204.42558165087738\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,207.81353467929807,204.42558165087738\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,207.81353467929807,204.42558165087738\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,207.81353467929807,209.0764653207019\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,205.30380975580061,210.16717225656154\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,205.30380975580061,209.4429521953595\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,205.30380975580061,208.5023617562876\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,204.91704780464048,206.43988940503007\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,204.6476382437124,204.46991152402407\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,203.88011059496992,204.46991152402407\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,202.75008847597593,204.46991152402407\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,202.53407078078072,204.50592921921924\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,200.8152566246246,204.73463576024025\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,200.53536423975973,204.73463576024025\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,200.53536423975973,204.73463576024025\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,199.75954649075697,205.230453509243\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,199.75954649075697,205.18636280739443\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,199.75954649075697,204.87909024591553\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,199.15090975408447,204.70127219673245\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,199.76698224261406,204.70127219673245\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,200.54958579409126,204.26041420590875\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,201.007668635273,204.26041420590875\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,201.007668635273,204.26041420590875\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,201.007668635273,205.42233136472697\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,200.5741349082184,205.16855365874022\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,199.95930792657472,205.08684292699218\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,199.61144634125978,204.65347434159375\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,199.15315707300783,204.466779473275\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,199.34657642138,203.89342357862\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,200.57726113710402,203.582738862896\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,201.7338089096832,203.36619109031682\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,202.23104712774656,203.36619109031682\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,202.23683770219725,203.36619109031682\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,202.7994701617578,207.55895287225346\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,204.44557612940625,208.51316229780275\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,205.772460903525,208.197539096475\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,206.57796872281997,208.197539096475\n"
  },
  {
    "path": "Tests/TestData/spy_with_ForceIndex.csv",
    "content": "Date,Open,High,Low,Close,Volume,ForceIndex20\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,5339379.200000222\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-4531101.676190357\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,6070085.150113562\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,5491981.802483699\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,9663230.773675628\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,2889621.176182938\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,10042425.8260701\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,-14200953.966889007\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,-5086282.160518332\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,-14946607.669040648\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,-4919151.224370018\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,722616.511284193\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,25309759.319733154\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,28328853.860711057\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,21321371.493024442\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,-56238852.077739924\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,-18789533.21319338\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,-66555525.288126975\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-75634259.35592484\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,-49387771.607741475\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,-37704232.88319469\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,-8722580.227652129\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,-6987130.682161502\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1649321.3828064445\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,-1058130.1774608458\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,7949006.410868777\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,11377299.895547891\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,-8178039.142123409\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,6073343.728555\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,27680583.182978395\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,27645646.59412329\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,32034036.442301966\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,35808125.35255901\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,27733033.414219975\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,30289234.6128657\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,28391536.554497506\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,44749058.5016882\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,50702799.025337115\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,37729929.02292405\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,53873166.25883598\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,48661718.71037548\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,46201680.737958595\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,13078892.858153462\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,2204493.157376578\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,-22326.571897184942\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,13439556.911140766\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-4313486.604206162\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,2278027.5485755154\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-37696600.789384454\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,-19710931.19039537\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-29676597.172262356\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-72843377.91776101\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,-38094025.7351175\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,2656647.00156074\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,2403633.0014120983\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,-23622379.665389314\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-44103080.649637856\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,-1687436.96871984\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,-15357588.30503225\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,2401879.1525897514\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,16358505.89996228\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,-30074854.09051072\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-150743875.12950918\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-144887141.3076515\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-173529171.37358925\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,-133710157.71896183\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,-100864994.31715603\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,-79685014.09647419\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,-82161832.56347702\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,-62548177.08124079\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,-58802743.54969413\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,-52701055.59258045\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,-27487069.726620305\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,-15309677.276466213\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,-460410.8691836409\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,265781.2135957794\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,29265040.145634275\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,27162139.46509761\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,28803937.992231272\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,20746085.802495\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,22518483.916542906\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,29525307.92449136\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,29666605.265015826\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,29332516.287395366\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,23769981.021929033\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,14853744.543650337\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,17774684.301397886\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,17923318.939360064\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,12273537.70703998\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,11104629.353988554\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,11672921.034561135\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,30983601.412221856\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,30501999.65867685\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,26325423.500707626\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,15759748.214925956\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,9829559.813504575\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,14911798.497932754\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,9222887.21241527\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,7040966.525518652\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,10209926.856421638\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,2699660.2986671636\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-31844002.205968\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-35631606.75778036\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-41959440.97132511\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,-31103961.450246505\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-43463351.978794605\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,-24856413.695099883\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,-17646682.86699511\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,-21244809.070138473\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-58451524.20631558\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,-47078039.61523806\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,-39652009.17569169\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-42521044.11133987\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,-28407237.62454586\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,-13100363.184112797\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,-10595809.547530577\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,-8372332.066813621\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,5660980.320501991\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,17496212.670930464\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,20591108.70227043\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,15091859.302054062\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,16269572.701858602\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,26484821.587395754\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,29914524.29335799\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,65028344.83684805\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,54790619.23333843\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,23865045.592068207\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,13727252.583299886\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,8594279.95631889\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,2429685.770002707\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,6938929.03000249\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,-979331.0680929953\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,-13195464.299703263\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,4145620.5859829113\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,2031884.5301750514\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-24367295.71079404\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,-10362516.214528108\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,-22675959.622668102\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-53306170.13479523\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-46308243.455290854\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,24058087.445212908\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,32662314.926621236\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,36756276.55265738\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,14962525.642880354\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,49853958.62927277\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,59222530.18838971\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,68965660.93235242\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,62496606.17689048\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,68726004.54099604\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,53777166.77518687\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,52524280.98707391\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,54642265.65497149\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,51691517.68783136\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,54575045.90803788\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,38020678.869177185\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,28049552.310207933\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,31089034.37590263\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,33162444.05438813\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,25445902.715874955\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,30490177.695315246\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-4121851.418524027\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,26950728.33562092\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,24573211.446514174\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,19380557.023036752\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,31030956.54465218\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,36803204.68325688\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,40931707.85628004\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,31125879.965205528\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,24705523.587567028\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,15702328.579227284\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,26797227.571681805\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,31208084.94580739\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,26878381.236682825\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,24731382.071284555\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,24816038.63592411\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,21824244.099169407\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,15302575.042105664\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,5232545.800000351\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,4500005.628571627\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-3928903.859863685\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,20716591.745837618\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,21809697.67480552\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,14939421.705776379\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-11653215.0281071\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-17023349.40638265\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-15607298.986726973\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,-3961693.8451340646\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-8439280.526549809\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,60468259.04740693\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,51975023.23336844\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,48336212.3539999\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,51622817.46314275\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,48434484.3714149\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,49360531.9550896\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,44659528.91174773\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,40243934.15824794\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,43547133.952700555\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,19253631.004824195\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,17110039.480555285\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,10186941.625264492\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,18394484.70857244\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,17010177.21251811\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,16424782.049420942\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,19717017.092333235\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-17188288.916460115\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,4272180.218440656\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,13140201.054779725\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,10240476.76384826\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,1152081.3577675568\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,5678314.56178979\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,5831938.698762218\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,-13755768.510643952\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-89924135.31915416\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-96441430.62209177\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,-76267684.08665444\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-104263194.17363971\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,-73536895.68091217\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,-85990761.80653927\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-174946317.92020267\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,-139295715.26113564\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,-129302038.66483712\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,-87864178.79199547\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,-43730175.09751943\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,-36674684.516803436\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,-10360551.896155506\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,-8564563.810807332\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,1249648.3616504865\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,10404694.70816014\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,11090349.497859165\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,-4605351.406698836\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,6616940.346319942\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,3625371.551432239\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,14346418.070343565\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,12201325.206501396\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,11132941.282072607\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,18730677.92187521\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,23691612.69122041\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,545846.4349136688\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,42499535.34587464\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,39881153.78912457\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,39454476.285398476\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,36591906.73440797\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,32394255.616845347\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,20555804.415240966\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,19096687.80426575\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,-13551244.367569\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-19874588.71351496\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,-2355246.740799105\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,10741727.139276847\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,-7054180.207320945\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,5757568.193376325\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,-18861253.06313588\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,-25930195.247598924\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,-14787037.604970502\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,-28649247.928306684\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-31202629.554182053\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,-19431926.549021892\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,-3159116.0205437914\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,7647374.648079503\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,11641911.253024278\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,8693800.657498159\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,-28027325.881311025\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,-52954405.32118619\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,-39762061.19535904\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,-17020182.89103904\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-80268048.52046385\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-98709874.7566104\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,-71306868.58931407\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,-45672582.247474775\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,-22277930.22390559\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,-17451277.726390954\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,-11566554.1334013\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,-3528459.4540297957\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,-6277083.886979323\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,-2490537.9929810916\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,-16965139.89841166\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,-7766479.431896221\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,-69184.43838225864\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,5348695.222416073\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,4927730.439328747\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,2032516.3022499033\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,4438753.606797425\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,-9315810.355754599\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,2715666.8209838755\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,676167.1237474172\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,2842383.588152434\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,17712124.38928064\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,17100575.01887306\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,9279614.54088511\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,-16092683.796341991\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,-8531507.720499843\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,-3534540.6042617764\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-15836012.356236821\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,-935740.7032620236\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,1848517.4589534532\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,6095523.415243547\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,13533519.947125223\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,11363966.61882749\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,16329075.512272546\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,17025298.987294223\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,16756699.464694766\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,14541916.658533396\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,15218222.500577763\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,24813139.976713136\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,29416153.21702622\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,27853199.57730954\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,25309071.046137106\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,18449346.184600197\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,2744342.738447843\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,7090090.096690932\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,7745881.8970060535\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,11368128.573481832\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,24605170.042673822\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,24060228.324323922\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,16627715.722007435\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,14641568.319911472\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,2456516.4799198415\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,9153115.672308614\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,7158502.3701838665\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,9058065.763499659\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,7524947.119356872\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,18076992.822275285\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,17351873.50586806\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,20585786.12435681\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,14572194.779179983\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,114820.8954487443\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,6218092.048263118\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,-1722628.3372857617\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,92962.36150342063\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,5605819.660407749\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,1150023.6927498197\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,6600914.579154736\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-24973301.095050476\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,1072975.1997162327\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,-1407090.1526377234\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,4264704.147613393\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,6605214.609745437\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,6029877.504055499\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,-1345132.2582355505\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,-690498.7098320824\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,-7134004.546991106\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,-6157132.399658609\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-73395111.69492897\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-77029326.58112627\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,-57632183.47816199\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-79458407.52786078\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,-71350207.57282639\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-77976674.66112854\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,-45924736.69340192\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,-37651127.484506615\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,-35887915.72407735\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,-23866238.41702235\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,-16578982.948734574\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,-15532877.905997843\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,-2309812.962569371\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,3694315.700532321\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,7013387.348100679\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,10087594.648281647\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,6881063.062730998\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,12363253.247232752\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,11770876.08082974\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,10285492.835036375\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,8695500.660270931\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,11444037.168816691\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,9665342.200357998\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,8143799.705085732\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,5020572.399839536\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,13286574.07604535\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,8846586.068802875\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-2698114.985368914\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,2355584.060856696\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,3593109.57887046\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-9831730.476260237\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-9986193.764235493\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,7542472.30854884\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,10710956.18392529\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,19365703.214027584\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,4566737.193643952\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,-14384549.205750506\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,-25075607.567107756\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,-6871918.751192616\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-52220424.96536473\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,-31869046.58771093\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,-32093987.293643344\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,-35482381.26567709\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-77267402.85942239\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,-69459544.30138214\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,-38088381.22505987\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,-36755175.10838768\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-75848863.95520791\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,-8733204.340426289\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-85893559.16514714\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-124153795.43513349\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-180906493.5841683\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-157730729.43329528\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,-188711336.24917126\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,-174855780.41591677\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,-113311681.32868686\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,-79932751.2021451\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,-16855724.611464888\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,-35158888.93418245\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,1188339.3452636339\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,17766607.026667096\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,13946563.50031777\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,35480033.643144645\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,28033402.819988243\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,39034403.4085606\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,67205811.46488817\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,61785199.80156561\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,49689075.05855921\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,56020163.433934614\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,58919300.34498848\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,54926959.16927527\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,53713654.86743944\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,49632337.26101673\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,43020414.66472943\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,40784950.887136064\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,37283218.42169462\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,34727583.238676056\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,39948998.3588022\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,33559963.56272571\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,32852569.69960907\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,44618162.109170035\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,43996586.28924898\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,38677580.9283683\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,37840147.22090451\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,31810452.818913616\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,14544511.026636152\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,22590438.166956604\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,25686472.62724634\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,21241873.424651537\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,22165174.241351422\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,5695492.0278895255\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,3485877.5490427283\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-47043710.88419947\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,-27002627.56189474\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-87955571.60361926\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,-104492043.06994116\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-133993509.44423234\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,-27918703.21144843\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,96874177.76107068\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,81621887.1171594\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,87256411.67742978\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,82162858.56529362\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,74419659.46383713\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,70982736.94347163\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,66343329.61552196\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,52190431.93785317\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,21659885.848533798\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,18325141.005816467\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-43289122.518547125\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-76971626.08820942\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,-39981632.746475086\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,13763417.896046393\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,-12314638.094053347\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-33093845.894619618\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-41579399.047512844\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,-59994837.23346398\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-85026391.78265795\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,-24302066.755738445\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,-16752516.20757268\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,-3120330.9497086033\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,47138544.188358575\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,30019235.12280067\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,31352722.06348623\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,-6126699.275893148\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,-47065575.535332255\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,-12047127.865300234\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-58678029.02098631\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,-14814737.018987633\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,21043124.41139233\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,9087071.610307336\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,27395566.88551618\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,17968716.991657577\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,8627175.944832915\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,27766575.18818222\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,26153307.455974426\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,42089328.74588144\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,45748540.29389285\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,43808267.88495077\n"
  },
  {
    "path": "Tests/TestData/spy_with_McGinleyDynamic.csv",
    "content": "Date,Close,McGinleyDynamic14\n02/22/2013 12:00:00 AM,151.89,\n02/25/2013 12:00:00 AM,149.0,\n02/26/2013 12:00:00 AM,150.02,\n02/27/2013 12:00:00 AM,151.91,\n02/28/2013 12:00:00 AM,151.61,\n03/01/2013 12:00:00 AM,152.11,\n03/04/2013 12:00:00 AM,152.92,\n03/05/2013 12:00:00 AM,154.29,\n03/06/2013 12:00:00 AM,154.5,\n03/07/2013 12:00:00 AM,154.78,\n03/08/2013 12:00:00 AM,155.44,\n03/11/2013 12:00:00 AM,156.03,\n03/12/2013 12:00:00 AM,155.68,\n03/13/2013 12:00:00 AM,155.9,153.29142857142855\n03/14/2013 12:00:00 AM,156.73,153.51618543680198\n03/15/2013 12:00:00 AM,155.83,153.67185830027788\n03/18/2013 12:00:00 AM,154.97,153.76151461951198\n03/19/2013 12:00:00 AM,154.61,153.82080122714007\n03/20/2013 12:00:00 AM,155.69,153.94801814038235\n03/21/2013 12:00:00 AM,154.36,153.97713250976707\n03/22/2013 12:00:00 AM,155.6,154.08829072483223\n03/25/2013 12:00:00 AM,154.95,154.14848358223864\n03/26/2013 12:00:00 AM,156.19,154.28683033456548\n03/27/2013 12:00:00 AM,156.19,154.4162654154844\n03/28/2013 12:00:00 AM,156.67,154.56818142320327\n04/01/2013 12:00:00 AM,156.05,154.6700622114275\n04/02/2013 12:00:00 AM,156.82,154.81537943788481\n04/03/2013 12:00:00 AM,155.23,154.84468004212815\n04/04/2013 12:00:00 AM,155.86,154.91533153709204\n04/05/2013 12:00:00 AM,155.16,154.93269788420815\n04/08/2013 12:00:00 AM,156.21,155.0209860714834\n04/09/2013 12:00:00 AM,156.75,155.13912750559146\n04/10/2013 12:00:00 AM,158.67,155.36962175294278\n04/11/2013 12:00:00 AM,159.19,155.6172382814862\n04/12/2013 12:00:00 AM,158.8,155.82689313100863\n04/15/2013 12:00:00 AM,155.12,155.77547406439157\n04/16/2013 12:00:00 AM,157.41,155.88745158085976\n04/17/2013 12:00:00 AM,155.11,155.8307975580213\n04/18/2013 12:00:00 AM,154.14,155.70463940233566\n04/19/2013 12:00:00 AM,155.48,155.68850079764735\n04/22/2013 12:00:00 AM,156.17,155.72247139952822\n04/23/2013 12:00:00 AM,157.78,155.86192033027433\n04/24/2013 12:00:00 AM,157.88,155.99883875434105\n04/25/2013 12:00:00 AM,158.52,156.16773569943612\n04/26/2013 12:00:00 AM,158.24,156.3081519158028\n04/29/2013 12:00:00 AM,159.3,156.50624755356566\n04/30/2013 12:00:00 AM,159.68,156.71545138413805\n05/01/2013 12:00:00 AM,158.28,156.8228513472733\n05/02/2013 12:00:00 AM,159.75,157.01702516026455\n05/03/2013 12:00:00 AM,161.37,157.29573602909588\n05/06/2013 12:00:00 AM,161.78,157.5819768769441\n05/07/2013 12:00:00 AM,162.6,157.8981672443607\n05/08/2013 12:00:00 AM,163.34,158.23760121630133\n05/09/2013 12:00:00 AM,162.88,158.53298192499528\n05/10/2013 12:00:00 AM,163.41,158.8415779472214\n05/13/2013 12:00:00 AM,163.54,159.14024326112383\n05/14/2013 12:00:00 AM,165.23,159.5145575171945\n05/15/2013 12:00:00 AM,166.12,159.9156896788464\n05/16/2013 12:00:00 AM,165.34,160.25474382542725\n05/17/2013 12:00:00 AM,166.94,160.66024485248465\n05/20/2013 12:00:00 AM,166.93,161.04449909350288\n05/21/2013 12:00:00 AM,167.17,161.42134498310185\n05/22/2013 12:00:00 AM,165.93,161.70979008203645\n05/23/2013 12:00:00 AM,165.45,161.95359704759937\n05/24/2013 12:00:00 AM,165.31,162.1744544441233\n05/28/2013 12:00:00 AM,166.3,162.44096482939662\n05/29/2013 12:00:00 AM,165.22,162.62644512420914\n05/30/2013 12:00:00 AM,165.83,162.83809421358987\n05/31/2013 12:00:00 AM,163.45,162.8811509262223\n06/03/2013 12:00:00 AM,164.35,162.98236796375946\n06/04/2013 12:00:00 AM,163.56,163.02304762446857\n06/05/2013 12:00:00 AM,161.27,162.89229591783612\n06/06/2013 12:00:00 AM,162.73,162.88065703647598\n06/07/2013 12:00:00 AM,164.8,163.0114769235519\n06/10/2013 12:00:00 AM,164.8,163.13377240522476\n06/11/2013 12:00:00 AM,163.1,163.1313580919153\n06/12/2013 12:00:00 AM,161.75,163.02927568764136\n06/13/2013 12:00:00 AM,164.21,163.11121351838491\n06/14/2013 12:00:00 AM,163.18,163.11611855914342\n06/17/2013 12:00:00 AM,164.44,163.20767284940266\n06/18/2013 12:00:00 AM,165.74,163.37774951266238\n06/19/2013 12:00:00 AM,163.45,163.38290114289637\n06/20/2013 12:00:00 AM,159.4,163.06889030553512\n06/21/2013 12:00:00 AM,159.07,162.75343139847442\n06/24/2013 12:00:00 AM,157.06,162.2845054138969\n06/25/2013 12:00:00 AM,158.57,161.993435658903\n06/26/2013 12:00:00 AM,160.14,161.85481120536494\n06/27/2013 12:00:00 AM,161.08,161.79839500571143\n06/28/2013 12:00:00 AM,160.42,161.6965104293321\n07/01/2013 12:00:00 AM,161.36,161.67227283333443\n07/02/2013 12:00:00 AM,161.21,161.63887297695678\n07/03/2013 12:00:00 AM,161.28,161.6130102736751\n07/05/2013 12:00:00 AM,163.02,161.71008465115662\n07/08/2013 12:00:00 AM,163.95,161.86151269211223\n07/09/2013 12:00:00 AM,165.13,162.07703350818701\n07/10/2013 12:00:00 AM,165.19,162.28309522525163\n07/11/2013 12:00:00 AM,167.44,162.60812065756744\n07/12/2013 12:00:00 AM,167.51,162.9190348513769\n07/15/2013 12:00:00 AM,168.15,163.2483059545704\n07/16/2013 12:00:00 AM,167.52,163.523475381477\n07/17/2013 12:00:00 AM,167.95,163.8076172618501\n07/18/2013 12:00:00 AM,168.87,164.12776710985156\n07/19/2013 12:00:00 AM,169.17,164.4468692468306\n07/22/2013 12:00:00 AM,169.5,164.76665280407664\n07/23/2013 12:00:00 AM,169.14,165.0479580900733\n07/24/2013 12:00:00 AM,168.52,165.27614553441933\n07/25/2013 12:00:00 AM,168.93,165.51527703281118\n07/26/2013 12:00:00 AM,169.11,165.75089726177933\n07/29/2013 12:00:00 AM,168.59,165.94037115656496\n07/30/2013 12:00:00 AM,168.59,166.11801002294825\n07/31/2013 12:00:00 AM,168.71,166.29203390807675\n08/01/2013 12:00:00 AM,170.66,166.5732952459011\n08/02/2013 12:00:00 AM,170.95,166.85511037460628\n08/05/2013 12:00:00 AM,170.7,167.10582507976468\n08/06/2013 12:00:00 AM,169.73,167.28194020512424\n08/07/2013 12:00:00 AM,169.18,167.41153334119636\n08/08/2013 12:00:00 AM,169.8,167.57273960052288\n08/09/2013 12:00:00 AM,169.31,167.69181441816775\n08/12/2013 12:00:00 AM,169.11,167.7897578522446\n08/13/2013 12:00:00 AM,169.61,167.91428301072668\n08/14/2013 12:00:00 AM,168.74,167.97211678866228\n08/15/2013 12:00:00 AM,166.38,167.85397836073625\n08/16/2013 12:00:00 AM,165.83,167.70222022510046\n08/19/2013 12:00:00 AM,164.77,167.47746425749153\n08/20/2013 12:00:00 AM,165.58,167.33561091878312\n08/21/2013 12:00:00 AM,164.56,167.12363480237627\n08/22/2013 12:00:00 AM,166.06,167.0456956174731\n08/23/2013 12:00:00 AM,166.62,167.01497685043896\n08/26/2013 12:00:00 AM,166.0,166.9406890636462\n08/27/2013 12:00:00 AM,163.33,166.65920940631932\n08/28/2013 12:00:00 AM,163.91,166.4493273775587\n08/29/2013 12:00:00 AM,164.17,166.27728649706862\n08/30/2013 12:00:00 AM,163.65,166.07727863212781\n09/03/2013 12:00:00 AM,164.39,165.95173402316587\n09/04/2013 12:00:00 AM,165.75,165.93725417044618\n09/05/2013 12:00:00 AM,165.96,165.93887798203895\n09/06/2013 12:00:00 AM,166.04,165.94608340352212\n09/09/2013 12:00:00 AM,167.63,166.06160244823428\n09/10/2013 12:00:00 AM,168.87,166.24918715740012\n09/11/2013 12:00:00 AM,169.4,166.45796243491571\n09/12/2013 12:00:00 AM,168.95,166.62569294260146\n09/13/2013 12:00:00 AM,169.33,166.8068103556556\n09/16/2013 12:00:00 AM,170.31,167.03707652104384\n09/17/2013 12:00:00 AM,171.07,167.29892378845764\n09/18/2013 12:00:00 AM,173.05,167.6577690876525\n09/19/2013 12:00:00 AM,172.76,167.98103061787208\n09/20/2013 12:00:00 AM,170.72,168.16441506460149\n09/23/2013 12:00:00 AM,169.93,168.28536809485644\n09/24/2013 12:00:00 AM,169.53,168.3716882225092\n09/25/2013 12:00:00 AM,169.04,168.4186743235996\n09/26/2013 12:00:00 AM,169.69,168.50679235013024\n09/27/2013 12:00:00 AM,168.91,168.53531887876858\n09/30/2013 12:00:00 AM,168.01,168.49732460444707\n10/01/2013 12:00:00 AM,169.34,168.55632651764785\n10/02/2013 12:00:00 AM,169.18,168.60022134971493\n10/03/2013 12:00:00 AM,167.62,168.52855334091953\n10/04/2013 12:00:00 AM,168.89,168.55415065560356\n10/07/2013 12:00:00 AM,167.43,168.47167587298557\n10/08/2013 12:00:00 AM,165.48,168.2421075093678\n10/09/2013 12:00:00 AM,165.6,168.04105017525458\n10/10/2013 12:00:00 AM,169.17,168.11955832742774\n10/11/2013 12:00:00 AM,170.26,168.26490256141395\n10/14/2013 12:00:00 AM,170.94,168.4442978052582\n10/15/2013 12:00:00 AM,169.7,168.53136539124685\n10/16/2013 12:00:00 AM,172.07,168.7639655503737\n10/17/2013 12:00:00 AM,173.22,169.0507444894933\n10/18/2013 12:00:00 AM,174.39,169.38751550695693\n10/21/2013 12:00:00 AM,174.4,169.70612937583596\n10/22/2013 12:00:00 AM,175.41,170.0630850989214\n10/23/2013 12:00:00 AM,174.57,170.35302840574988\n10/24/2013 12:00:00 AM,175.15,170.65964664018972\n10/25/2013 12:00:00 AM,175.95,170.99409027041543\n10/28/2013 12:00:00 AM,176.23,171.3255792950727\n10/29/2013 12:00:00 AM,177.17,171.69062019808206\n10/30/2013 12:00:00 AM,176.29,171.98618097853142\n10/31/2013 12:00:00 AM,175.79,172.23511792455412\n11/01/2013 12:00:00 AM,176.21,172.49427366626793\n11/04/2013 12:00:00 AM,176.83,172.77469352610535\n11/05/2013 12:00:00 AM,176.27,173.0051368510169\n11/06/2013 12:00:00 AM,177.17,173.2756248198969\n11/07/2013 12:00:00 AM,174.93,173.3893872026856\n11/08/2013 12:00:00 AM,177.29,173.64428019303176\n11/11/2013 12:00:00 AM,177.32,173.8857291877853\n11/12/2013 12:00:00 AM,176.96,174.0904534954976\n11/13/2013 12:00:00 AM,178.38,174.3684238832453\n11/14/2013 12:00:00 AM,179.27,174.68178752773323\n11/15/2013 12:00:00 AM,180.05,175.02150639548856\n11/18/2013 12:00:00 AM,179.42,175.30599062074643\n11/19/2013 12:00:00 AM,179.03,175.55053997064817\n11/20/2013 12:00:00 AM,178.47,175.74575905972068\n11/21/2013 12:00:00 AM,179.91,176.01660729788335\n11/22/2013 12:00:00 AM,180.81,176.32410351185888\n11/25/2013 12:00:00 AM,180.63,176.60337253101198\n11/26/2013 12:00:00 AM,180.68,176.8691564096054\n11/27/2013 12:00:00 AM,181.12,177.145271326313\n11/29/2013 12:00:00 AM,181.0,177.39789249194456\n12/02/2013 12:00:00 AM,180.53,177.60648798488614\n12/03/2013 12:00:00 AM,179.75,177.75242235789636\n12/04/2013 12:00:00 AM,179.73,177.88756279585417\n12/05/2013 12:00:00 AM,178.94,177.96098387514854\n12/06/2013 12:00:00 AM,180.94,178.16009964940656\n12/09/2013 12:00:00 AM,181.4,178.3754255508464\n12/10/2013 12:00:00 AM,180.75,178.5362990913043\n12/11/2013 12:00:00 AM,178.72,178.54936671915124\n12/12/2013 12:00:00 AM,178.13,178.51912886893803\n12/13/2013 12:00:00 AM,178.11,178.4896359395748\n12/16/2013 12:00:00 AM,179.22,178.540959583313\n12/17/2013 12:00:00 AM,178.65,178.54872918657387\n12/18/2013 12:00:00 AM,181.7,178.7586062775895\n12/19/2013 12:00:00 AM,181.49,178.9422234555964\n12/20/2013 12:00:00 AM,181.56,179.11865456201986\n12/23/2013 12:00:00 AM,182.53,179.34461058475668\n12/24/2013 12:00:00 AM,182.93,179.58121447466624\n12/26/2013 12:00:00 AM,183.85,179.8587799078344\n12/27/2013 12:00:00 AM,183.85,180.11990564362281\n12/30/2013 12:00:00 AM,183.82,180.36355235820199\n12/31/2013 12:00:00 AM,184.69,180.64462916624728\n01/02/2014 12:00:00 AM,182.92,180.79921852506394\n01/03/2014 12:00:00 AM,182.88,180.9411961087769\n01/06/2014 12:00:00 AM,182.36,181.03942196623402\n01/07/2014 12:00:00 AM,183.48,181.20465708381644\n01/08/2014 12:00:00 AM,183.52,181.36184932443575\n01/09/2014 12:00:00 AM,183.64,181.51664863245526\n01/10/2014 12:00:00 AM,184.14,181.6935787354434\n01/13/2014 12:00:00 AM,181.68,181.69260853577276\n01/14/2014 12:00:00 AM,183.67,181.82786584883038\n01/15/2014 12:00:00 AM,184.66,182.01803331758435\n01/16/2014 12:00:00 AM,184.42,182.1808371195739\n01/17/2014 12:00:00 AM,183.63,182.28111967725835\n01/21/2014 12:00:00 AM,184.18,182.41124638267493\n01/22/2014 12:00:00 AM,184.3,182.54071138271107\n01/23/2014 12:00:00 AM,182.79,182.5584207741091\n01/24/2014 12:00:00 AM,178.89,182.27422714816666\n01/27/2014 12:00:00 AM,178.01,181.93938836403063\n01/28/2014 12:00:00 AM,179.07,181.7209761686373\n01/29/2014 12:00:00 AM,177.35,181.37682767250854\n01/30/2014 12:00:00 AM,179.23,181.2160026811753\n01/31/2014 12:00:00 AM,178.18,180.98398318351715\n02/03/2014 12:00:00 AM,174.17,180.41651674280237\n02/04/2014 12:00:00 AM,175.38,180.0136261209567\n02/05/2014 12:00:00 AM,175.17,179.62777019187777\n02/06/2014 12:00:00 AM,177.48,179.466796090235\n02/07/2014 12:00:00 AM,179.68,179.48195278874795\n02/10/2014 12:00:00 AM,180.01,179.51922982142068\n02/11/2014 12:00:00 AM,181.98,179.68568307251363\n02/12/2014 12:00:00 AM,182.07,179.8472439775323\n02/13/2014 12:00:00 AM,183.01,180.057938633089\n02/14/2014 12:00:00 AM,184.02,180.3173459084962\n02/18/2014 12:00:00 AM,184.24,180.57442473139625\n02/19/2014 12:00:00 AM,183.02,180.73995741428982\n02/20/2014 12:00:00 AM,184.1,180.9629129678141\n02/21/2014 12:00:00 AM,183.89,181.15899304209472\n02/24/2014 12:00:00 AM,184.91,181.40583434595987\n02/25/2014 12:00:00 AM,184.84,181.6334040098044\n02/26/2014 12:00:00 AM,184.85,181.84758136416085\n02/27/2014 12:00:00 AM,185.82,182.10782928505404\n02/28/2014 12:00:00 AM,186.29,182.38062027425653\n03/03/2014 12:00:00 AM,184.98,182.55607187899508\n03/04/2014 12:00:00 AM,187.58,182.87799664200847\n03/05/2014 12:00:00 AM,187.75,183.19125710305136\n03/06/2014 12:00:00 AM,188.18,183.51128526822134\n03/07/2014 12:00:00 AM,188.26,183.81752880779018\n03/10/2014 12:00:00 AM,188.16,184.1000476292213\n03/11/2014 12:00:00 AM,187.23,184.30903668672548\n03/12/2014 12:00:00 AM,187.28,184.5080995137512\n03/13/2014 12:00:00 AM,185.18,184.55539964466394\n03/14/2014 12:00:00 AM,184.66,184.56285418422345\n03/17/2014 12:00:00 AM,186.33,184.68435813685568\n03/18/2014 12:00:00 AM,187.66,184.88374026805403\n03/19/2014 12:00:00 AM,186.66,185.0058550568761\n03/20/2014 12:00:00 AM,187.75,185.1906546968904\n03/21/2014 12:00:00 AM,186.2,185.2612001930502\n03/24/2014 12:00:00 AM,185.43,185.2732134788634\n03/25/2014 12:00:00 AM,186.31,185.34563492293248\n03/26/2014 12:00:00 AM,184.97,185.31858523931976\n03/27/2014 12:00:00 AM,184.58,185.26497966838335\n03/28/2014 12:00:00 AM,185.49,185.28097469813648\n03/31/2014 12:00:00 AM,187.01,185.39997205058364\n04/01/2014 12:00:00 AM,188.25,185.59149455020437\n04/02/2014 12:00:00 AM,188.88,185.8104515887055\n04/03/2014 12:00:00 AM,188.63,186.0000737168638\n04/04/2014 12:00:00 AM,186.4,186.02839550987898\n04/07/2014 12:00:00 AM,184.34,185.90331640014332\n04/08/2014 12:00:00 AM,185.1,185.84493406357444\n04/09/2014 12:00:00 AM,187.09,185.93152350230892\n04/10/2014 12:00:00 AM,183.15,185.72049597137314\n04/11/2014 12:00:00 AM,181.51,185.39085412918968\n04/14/2014 12:00:00 AM,182.94,185.20622171425953\n04/15/2014 12:00:00 AM,184.2,185.13276534912742\n04/16/2014 12:00:00 AM,186.12,185.2017978063187\n04/17/2014 12:00:00 AM,186.39,185.28452583459838\n04/21/2014 12:00:00 AM,187.04,185.40527524901387\n04/22/2014 12:00:00 AM,187.89,185.57355192775628\n04/23/2014 12:00:00 AM,187.45,185.7022971309908\n04/24/2014 12:00:00 AM,187.83,185.84750568924133\n04/25/2014 12:00:00 AM,186.29,185.87881319228669\n04/28/2014 12:00:00 AM,186.88,185.94880631094833\n04/29/2014 12:00:00 AM,187.75,186.07259648607487\n04/30/2014 12:00:00 AM,188.31,186.22494997994627\n05/01/2014 12:00:00 AM,188.32,186.36804747909744\n05/02/2014 12:00:00 AM,188.06,186.48461034857866\n05/05/2014 12:00:00 AM,188.42,186.61725946785424\n05/06/2014 12:00:00 AM,186.78,186.62884333162268\n05/07/2014 12:00:00 AM,187.88,186.7158548026605\n05/08/2014 12:00:00 AM,187.68,186.783318046008\n05/09/2014 12:00:00 AM,187.96,186.86528176504788\n05/12/2014 12:00:00 AM,189.79,187.06160747391255\n05/13/2014 12:00:00 AM,189.96,187.25628650225875\n05/14/2014 12:00:00 AM,189.06,187.38027646563867\n05/15/2014 12:00:00 AM,187.4,187.3816846965099\n05/16/2014 12:00:00 AM,188.05,187.42874650110474\n05/19/2014 12:00:00 AM,188.74,187.51983166084062\n05/20/2014 12:00:00 AM,187.55,187.52198515605062\n05/21/2014 12:00:00 AM,189.13,187.63298671935104\n05/22/2014 12:00:00 AM,189.59,187.76709043081652\n05/23/2014 12:00:00 AM,190.35,187.94177218624134\n05/27/2014 12:00:00 AM,191.52,188.17878765443754\n05/28/2014 12:00:00 AM,191.38,188.3925262303417\n05/29/2014 12:00:00 AM,192.37,188.65385341384234\n05/30/2014 12:00:00 AM,192.68,188.9181415805989\n06/02/2014 12:00:00 AM,192.9,189.17979325997842\n06/03/2014 12:00:00 AM,192.8,189.41949776968428\n06/04/2014 12:00:00 AM,193.19,189.66840145076478\n06/05/2014 12:00:00 AM,194.45,189.97756851436782\n06/06/2014 12:00:00 AM,195.38,190.32251371814044\n06/09/2014 12:00:00 AM,195.58,190.65926790629666\n06/10/2014 12:00:00 AM,195.6,190.97784867232613\n06/11/2014 12:00:00 AM,194.92,191.23733329858453\n06/12/2014 12:00:00 AM,193.54,191.39412057445554\n06/13/2014 12:00:00 AM,194.13,191.57875499591128\n06/16/2014 12:00:00 AM,194.29,191.76182969222373\n06/17/2014 12:00:00 AM,194.83,191.96750244669127\n06/18/2014 12:00:00 AM,196.26,192.248152869662\n06/19/2014 12:00:00 AM,196.48,192.52521504553425\n06/20/2014 12:00:00 AM,195.94,192.75256421779832\n06/23/2014 12:00:00 AM,195.88,192.96202399667655\n06/24/2014 12:00:00 AM,194.7,193.08179158852462\n06/25/2014 12:00:00 AM,195.58,193.25129097994423\n06/26/2014 12:00:00 AM,195.44,193.40074093593424\n06/27/2014 12:00:00 AM,195.82,193.56516246797833\n06/30/2014 12:00:00 AM,195.72,193.7124121796003\n07/01/2014 12:00:00 AM,197.03,193.93382091914637\n07/02/2014 12:00:00 AM,197.23,194.1539133365807\n07/03/2014 12:00:00 AM,198.2,194.4200331060856\n07/07/2014 12:00:00 AM,197.51,194.6272539727365\n07/08/2014 12:00:00 AM,196.24,194.73870970894842\n07/09/2014 12:00:00 AM,197.12,194.90073048060762\n07/10/2014 12:00:00 AM,196.34,195.00055398523742\n07/11/2014 12:00:00 AM,196.61,195.11179612808934\n07/14/2014 12:00:00 AM,197.6,195.280740711571\n07/15/2014 12:00:00 AM,197.23,195.41455033012232\n07/16/2014 12:00:00 AM,197.96,195.58719544278634\n07/17/2014 12:00:00 AM,195.71,195.59594520110574\n07/18/2014 12:00:00 AM,197.71,195.7405934065787\n07/21/2014 12:00:00 AM,197.34,195.85117782881431\n07/22/2014 12:00:00 AM,198.2,196.01113814436343\n07/23/2014 12:00:00 AM,198.64,196.18916925646624\n07/24/2014 12:00:00 AM,198.65,196.35639361683923\n07/25/2014 12:00:00 AM,197.72,196.45113479274613\n07/28/2014 12:00:00 AM,197.8,196.54488096308424\n07/29/2014 12:00:00 AM,196.95,196.57358068069175\n07/30/2014 12:00:00 AM,196.98,196.60237178815004\n07/31/2014 12:00:00 AM,193.09,196.33272930026698\n08/01/2014 12:00:00 AM,192.5,196.03650001450217\n08/04/2014 12:00:00 AM,193.89,195.87627549494087\n08/05/2014 12:00:00 AM,192.01,195.57718905682117\n08/06/2014 12:00:00 AM,192.07,195.30787079934552\n08/07/2014 12:00:00 AM,191.03,194.97400471221096\n08/08/2014 12:00:00 AM,193.24,194.84564138349654\n08/11/2014 12:00:00 AM,193.79,194.7685819695777\n08/12/2014 12:00:00 AM,193.53,194.6778251766498\n08/13/2014 12:00:00 AM,194.84,194.68937057329885\n08/14/2014 12:00:00 AM,195.76,194.76418481513028\n08/15/2014 12:00:00 AM,195.72,194.83113340773147\n08/18/2014 12:00:00 AM,197.36,195.00268500482392\n08/19/2014 12:00:00 AM,198.39,195.22853017337712\n08/20/2014 12:00:00 AM,198.92,195.4731719507996\n08/21/2014 12:00:00 AM,199.5,195.73827339315275\n08/22/2014 12:00:00 AM,199.19,195.9681745943856\n08/25/2014 12:00:00 AM,200.2,196.24568904493896\n08/26/2014 12:00:00 AM,200.33,196.51435169901077\n08/27/2014 12:00:00 AM,200.25,196.7618230557021\n08/28/2014 12:00:00 AM,200.14,196.98723770008942\n08/29/2014 12:00:00 AM,200.71,197.23396294500253\n09/02/2014 12:00:00 AM,200.61,197.45928082745317\n09/03/2014 12:00:00 AM,200.5,197.66359616649493\n09/04/2014 12:00:00 AM,200.21,197.83640381109979\n09/05/2014 12:00:00 AM,201.11,198.055375134293\n09/08/2014 12:00:00 AM,200.59,198.22744113944768\n09/09/2014 12:00:00 AM,199.32,198.30378399371398\n09/10/2014 12:00:00 AM,200.07,198.42554602865889\n09/11/2014 12:00:00 AM,200.3,198.55449363475358\n09/12/2014 12:00:00 AM,199.13,198.5951280675697\n09/15/2014 12:00:00 AM,198.98,198.62240684229937\n09/16/2014 12:00:00 AM,200.48,198.75024229488253\n09/17/2014 12:00:00 AM,200.75,198.88747505379143\n09/18/2014 12:00:00 AM,201.82,199.08502940940213\n09/19/2014 12:00:00 AM,200.7,199.19671612170734\n09/22/2014 12:00:00 AM,199.15,199.1933761237538\n09/23/2014 12:00:00 AM,198.01,199.1068104244297\n09/24/2014 12:00:00 AM,199.56,199.13888806049707\n09/25/2014 12:00:00 AM,196.34,198.9273216788805\n09/26/2014 12:00:00 AM,197.9,198.85240595470975\n09/29/2014 12:00:00 AM,197.54,198.75614650852708\n09/30/2014 12:00:00 AM,197.02,198.6277067889156\n10/01/2014 12:00:00 AM,194.35,198.29435398552192\n10/02/2014 12:00:00 AM,194.38,197.99154612431195\n10/03/2014 12:00:00 AM,196.52,197.88325187129163\n10/06/2014 12:00:00 AM,196.29,197.76570803627342\n10/07/2014 12:00:00 AM,193.26,197.41279226725672\n10/08/2014 12:00:00 AM,196.64,197.35671995889535\n10/09/2014 12:00:00 AM,192.74,196.99420515020793\n10/10/2014 12:00:00 AM,190.54,196.46748020051984\n10/13/2014 12:00:00 AM,187.41,195.6860845031598\n10/14/2014 12:00:00 AM,187.7,195.01219522114283\n10/15/2014 12:00:00 AM,186.43,194.27826589783444\n10/16/2014 12:00:00 AM,186.27,193.60134851904527\n10/17/2014 12:00:00 AM,188.47,193.1932471356142\n10/20/2014 12:00:00 AM,190.3,192.97372914878858\n10/21/2014 12:00:00 AM,194.07,193.05027981342454\n10/22/2014 12:00:00 AM,192.69,193.02435253518715\n10/23/2014 12:00:00 AM,194.93,193.15522497896882\n10/24/2014 12:00:00 AM,196.43,193.3739245892821\n10/27/2014 12:00:00 AM,196.16,193.56186261753462\n10/28/2014 12:00:00 AM,198.41,193.87553178001244\n10/29/2014 12:00:00 AM,198.11,194.15295145487482\n10/30/2014 12:00:00 AM,199.38,194.4886721541171\n10/31/2014 12:00:00 AM,201.66,194.93184152308\n11/03/2014 12:00:00 AM,201.77,195.35735752054842\n11/04/2014 12:00:00 AM,201.07,195.72097017273364\n11/05/2014 12:00:00 AM,202.34,196.1348638187309\n11/06/2014 12:00:00 AM,203.15,196.57023527934555\n11/07/2014 12:00:00 AM,203.34,196.9925393742836\n11/10/2014 12:00:00 AM,203.98,197.42668967140438\n11/11/2014 12:00:00 AM,204.18,197.84834668421212\n11/12/2014 12:00:00 AM,203.96,198.23487415393586\n11/13/2014 12:00:00 AM,204.19,198.61274663845242\n11/14/2014 12:00:00 AM,204.24,198.97219267222007\n11/17/2014 12:00:00 AM,204.37,199.31860258143712\n11/18/2014 12:00:00 AM,205.55,199.71213346860614\n11/19/2014 12:00:00 AM,205.22,200.06498697990833\n11/20/2014 12:00:00 AM,205.58,200.41831609051445\n11/21/2014 12:00:00 AM,206.68,200.81379099419135\n11/24/2014 12:00:00 AM,207.26,201.21956900723\n11/25/2014 12:00:00 AM,207.11,201.5944518978434\n11/26/2014 12:00:00 AM,207.64,201.97813958911686\n11/28/2014 12:00:00 AM,207.2,202.3149268755493\n12/01/2014 12:00:00 AM,205.76,202.54493242227585\n12/02/2014 12:00:00 AM,207.09,202.84200415135376\n12/03/2014 12:00:00 AM,207.89,203.16880872656515\n12/04/2014 12:00:00 AM,207.66,203.46274301678216\n12/05/2014 12:00:00 AM,208.0,203.75946627081254\n12/08/2014 12:00:00 AM,206.61,203.9520696822349\n12/09/2014 12:00:00 AM,206.47,204.12330774567565\n12/10/2014 12:00:00 AM,203.16,204.05318569807235\n12/11/2014 12:00:00 AM,204.19,204.0629319830153\n12/12/2014 12:00:00 AM,200.89,203.82163275030692\n12/15/2014 12:00:00 AM,199.51,203.48616084369195\n12/16/2014 12:00:00 AM,197.91,203.04104217044716\n12/17/2014 12:00:00 AM,201.79,202.94944528896858\n12/18/2014 12:00:00 AM,206.78,203.203338439362\n12/19/2014 12:00:00 AM,206.52,203.42538702494483\n12/22/2014 12:00:00 AM,207.47,203.6924098036703\n12/23/2014 12:00:00 AM,207.75,203.96024978235155\n12/24/2014 12:00:00 AM,207.77,204.21295793232625\n12/26/2014 12:00:00 AM,208.44,204.49113252450843\n12/29/2014 12:00:00 AM,208.72,204.7694482181929\n12/30/2014 12:00:00 AM,207.6,204.96082723183483\n12/31/2014 12:00:00 AM,205.54,205.0017323969739\n01/02/2015 12:00:00 AM,205.43,205.03206864364566\n01/05/2015 12:00:00 AM,201.72,204.77956791868866\n01/06/2015 12:00:00 AM,199.82,204.38881117925357\n01/07/2015 12:00:00 AM,202.31,204.23412693561656\n01/08/2015 12:00:00 AM,205.9,204.34931347657772\n01/09/2015 12:00:00 AM,204.25,204.34220584970527\n01/12/2015 12:00:00 AM,202.65,204.21724584498767\n01/13/2015 12:00:00 AM,202.08,204.0580239559252\n01/14/2015 12:00:00 AM,200.86,203.81469457537463\n01/15/2015 12:00:00 AM,199.02,203.43800119009717\n01/16/2015 12:00:00 AM,201.63,203.30416351108667\n01/20/2015 12:00:00 AM,202.05,203.2123353690428\n01/21/2015 12:00:00 AM,203.08,203.2028581799525\n01/22/2015 12:00:00 AM,206.1,203.39840420917056\n01/23/2015 12:00:00 AM,204.97,203.50725755486468\n01/26/2015 12:00:00 AM,205.45,203.64085009817896\n01/27/2015 12:00:00 AM,202.74,203.57535235571982\n01/28/2015 12:00:00 AM,200.14,203.312683579098\n01/29/2015 12:00:00 AM,201.99,203.21570711601316\n01/30/2015 12:00:00 AM,199.45,202.92583166871086\n02/02/2015 12:00:00 AM,201.92,202.85254427833496\n02/03/2015 12:00:00 AM,204.84,202.98907556856508\n02/04/2015 12:00:00 AM,204.06,203.06397696670567\n02/05/2015 12:00:00 AM,206.12,203.26960371242862\n02/06/2015 12:00:00 AM,205.55,203.42538027887693\n02/09/2015 12:00:00 AM,204.63,203.50941625756712\n02/10/2015 12:00:00 AM,206.81,203.73047852297805\n02/11/2015 12:00:00 AM,206.93,203.94520578383276\n02/12/2015 12:00:00 AM,208.92,204.2678924491348\n02/13/2015 12:00:00 AM,209.78,204.62183579748535\n02/17/2015 12:00:00 AM,210.11,204.97446646298158\n"
  },
  {
    "path": "Tests/TestData/spy_with_StochRSI.csv",
    "content": "Date,Close,k,d\n02/22/2013 12:00:00 AM,151.89,,\n02/25/2013 12:00:00 AM,149.0,,\n02/26/2013 12:00:00 AM,150.02,,\n02/27/2013 12:00:00 AM,151.91,,\n02/28/2013 12:00:00 AM,151.61,,\n03/01/2013 12:00:00 AM,152.11,,\n03/04/2013 12:00:00 AM,152.92,,\n03/05/2013 12:00:00 AM,154.29,,\n03/06/2013 12:00:00 AM,154.5,,\n03/07/2013 12:00:00 AM,154.78,,\n03/08/2013 12:00:00 AM,155.44,,\n03/11/2013 12:00:00 AM,156.03,,\n03/12/2013 12:00:00 AM,155.68,,\n03/13/2013 12:00:00 AM,155.9,,\n03/14/2013 12:00:00 AM,156.73,,\n03/15/2013 12:00:00 AM,155.83,,\n03/18/2013 12:00:00 AM,154.97,,\n03/19/2013 12:00:00 AM,154.61,,\n03/20/2013 12:00:00 AM,155.69,,\n03/21/2013 12:00:00 AM,154.36,,\n03/22/2013 12:00:00 AM,155.6,,\n03/25/2013 12:00:00 AM,154.95,,\n03/26/2013 12:00:00 AM,156.19,,\n03/27/2013 12:00:00 AM,156.19,,\n03/28/2013 12:00:00 AM,156.67,,\n04/01/2013 12:00:00 AM,156.05,,\n04/02/2013 12:00:00 AM,156.82,,\n04/03/2013 12:00:00 AM,155.23,,\n04/04/2013 12:00:00 AM,155.86,,\n04/05/2013 12:00:00 AM,155.16,7.319288119108858,\n04/08/2013 12:00:00 AM,156.21,21.591511595932086,\n04/09/2013 12:00:00 AM,156.75,35.411391422876534,21.44073037930583\n04/10/2013 12:00:00 AM,158.67,68.74472475620986,41.91587592500616\n04/11/2013 12:00:00 AM,159.19,87.80583461271996,63.98731693060212\n04/12/2013 12:00:00 AM,158.8,94.69508828803966,83.74854921898982\n04/15/2013 12:00:00 AM,155.12,61.36175495470633,81.28755928515531\n04/16/2013 12:00:00 AM,157.41,41.521097374074984,65.85931353894031\n04/17/2013 12:00:00 AM,155.11,13.492675752701984,38.79184269382776\n04/18/2013 12:00:00 AM,154.14,13.492675752701984,22.835482959826315\n04/19/2013 12:00:00 AM,155.48,6.763750767135401,11.24970075751312\n04/22/2013 12:00:00 AM,156.17,16.8358456221005,12.36409071397929\n04/23/2013 12:00:00 AM,157.78,34.10999459890648,19.23653032938079\n04/24/2013 12:00:00 AM,157.88,45.05330411172842,31.99971477757847\n04/25/2013 12:00:00 AM,158.52,55.52865244436734,44.897317051667414\n04/26/2013 12:00:00 AM,158.24,57.02608220510315,52.536012920399635\n04/29/2013 12:00:00 AM,159.3,62.97089750073515,58.508544050068544\n04/30/2013 12:00:00 AM,159.68,67.7734106528344,62.590130119557564\n05/01/2013 12:00:00 AM,158.28,66.70474589819872,65.81635135058943\n05/02/2013 12:00:00 AM,159.75,73.06799049961555,69.1820490168829\n05/03/2013 12:00:00 AM,161.37,81.0513674932456,73.6080346303533\n05/06/2013 12:00:00 AM,161.78,96.68178684367282,83.600381612178\n05/07/2013 12:00:00 AM,162.6,99.99999999999999,92.57771811230614\n05/08/2013 12:00:00 AM,163.34,99.99999999999999,98.89392894789094\n05/09/2013 12:00:00 AM,162.88,95.43072012224305,98.47690670741434\n05/10/2013 12:00:00 AM,163.41,92.95958247572428,96.1301008659891\n05/13/2013 12:00:00 AM,163.54,91.33104920562789,93.2404506011984\n05/14/2013 12:00:00 AM,165.23,95.90032908338483,93.396986921579\n05/15/2013 12:00:00 AM,166.12,98.3714667299036,95.20094833963877\n05/16/2013 12:00:00 AM,165.34,92.00370799121697,95.42516793483513\n05/17/2013 12:00:00 AM,166.94,90.34452360939952,93.57323277684003\n05/20/2013 12:00:00 AM,166.93,88.58185403246796,90.31002854436149\n05/21/2013 12:00:00 AM,167.17,95.51786830332837,91.48141531506529\n05/22/2013 12:00:00 AM,165.93,71.01526754048993,85.03832995876209\n05/23/2013 12:00:00 AM,165.45,39.444603784088144,68.65924654263549\n05/24/2013 12:00:00 AM,165.31,7.17154818867742,39.21047317108517\n05/28/2013 12:00:00 AM,166.3,9.448759187976124,18.688303720247234\n05/29/2013 12:00:00 AM,165.22,9.448759187976124,8.68968885487656\n05/30/2013 12:00:00 AM,165.83,14.429093946158522,11.108870774036927\n05/31/2013 12:00:00 AM,163.45,4.980334758182385,9.61939596410568\n06/03/2013 12:00:00 AM,164.35,9.82023023096811,9.743219645103009\n06/04/2013 12:00:00 AM,163.56,4.948095527066918,6.582886838739141\n06/05/2013 12:00:00 AM,161.27,4.948095527066918,6.572140428367318\n06/06/2013 12:00:00 AM,162.73,6.215121965200204,5.370437673111349\n06/07/2013 12:00:00 AM,164.8,19.502264435249074,10.221827309172067\n06/10/2013 12:00:00 AM,164.8,32.89760695957915,19.538331120009477\n06/11/2013 12:00:00 AM,163.1,35.715331003745746,29.37173413285799\n06/12/2013 12:00:00 AM,161.75,25.270730945800004,31.294556303041634\n06/13/2013 12:00:00 AM,164.21,26.282131107088762,29.08939768554484\n06/14/2013 12:00:00 AM,163.18,27.12861203094739,26.227158027945386\n06/17/2013 12:00:00 AM,164.44,42.44467674548167,31.951806627839275\n06/18/2013 12:00:00 AM,165.74,52.46284427570045,40.6787110173765\n06/19/2013 12:00:00 AM,163.45,59.03859027190163,51.315370431027915\n06/20/2013 12:00:00 AM,159.4,40.77178309098302,50.7577392128617\n06/21/2013 12:00:00 AM,159.07,16.34687287514542,38.71908207934336\n06/24/2013 12:00:00 AM,157.06,0.0,19.03955198870948\n06/25/2013 12:00:00 AM,158.57,7.44648341582128,7.931118763655565\n06/26/2013 12:00:00 AM,160.14,22.01368769259242,9.820057036137898\n06/27/2013 12:00:00 AM,161.08,40.61743841095432,23.359203173122673\n06/28/2013 12:00:00 AM,160.42,49.24270579464845,37.291277299398395\n07/01/2013 12:00:00 AM,161.36,54.963418439422604,48.27452088167512\n07/02/2013 12:00:00 AM,161.21,56.00479301767771,53.403639083916254\n07/03/2013 12:00:00 AM,161.28,59.922279926438286,56.963497127846196\n07/05/2013 12:00:00 AM,163.02,67.85008848495436,61.259053809690116\n07/08/2013 12:00:00 AM,163.95,80.42976512792151,69.40071117977138\n07/09/2013 12:00:00 AM,165.13,93.77386075297886,80.6845714552849\n07/10/2013 12:00:00 AM,165.19,98.89146860625084,91.03169816238372\n07/11/2013 12:00:00 AM,167.44,100.0,97.55510978640989\n07/12/2013 12:00:00 AM,167.51,100.0,99.63048953541693\n07/15/2013 12:00:00 AM,168.15,100.0,99.99999999999999\n07/16/2013 12:00:00 AM,167.52,95.60539644567413,98.53513214855803\n07/17/2013 12:00:00 AM,167.95,92.78765847094364,96.13101830553924\n07/18/2013 12:00:00 AM,168.87,92.78765847094364,93.72690446252045\n07/19/2013 12:00:00 AM,169.17,97.18226202526951,94.25252632238558\n07/22/2013 12:00:00 AM,169.5,99.99999999999999,96.65664016540435\n07/23/2013 12:00:00 AM,169.14,96.6534086698834,97.94522356505094\n07/24/2013 12:00:00 AM,168.52,84.41521854227089,93.6895424040514\n07/25/2013 12:00:00 AM,168.93,73.1653010164702,84.7446427428748\n07/26/2013 12:00:00 AM,169.11,63.64943992951001,73.743319829417\n07/29/2013 12:00:00 AM,168.59,51.20460122205065,62.673114056010256\n07/30/2013 12:00:00 AM,168.59,29.12118541451802,47.99174218869287\n07/31/2013 12:00:00 AM,168.71,11.069319718760863,30.465035451776487\n08/01/2013 12:00:00 AM,170.66,35.75234855383273,25.314284562370513\n08/02/2013 12:00:00 AM,170.95,69.08568188716606,38.635783386586525\n08/05/2013 12:00:00 AM,170.7,92.67977528342023,65.83926857480631\n08/06/2013 12:00:00 AM,169.73,59.34644195008689,73.7039663735577\n08/07/2013 12:00:00 AM,169.18,26.013108616753556,59.34644195008687\n08/08/2013 12:00:00 AM,169.8,7.428195696429423,30.92924875442327\n08/09/2013 12:00:00 AM,169.31,7.428195696429423,13.62316666987078\n08/12/2013 12:00:00 AM,169.11,7.428195696429423,7.428195696429403\n08/13/2013 12:00:00 AM,169.61,5.948492954380382,6.934961449079722\n08/14/2013 12:00:00 AM,168.74,5.948492954380382,6.441727201730042\n08/15/2013 12:00:00 AM,166.38,5.948492954380382,5.948492954380361\n08/16/2013 12:00:00 AM,165.83,-2.842170943040401e-14,3.9656619695868915\n08/19/2013 12:00:00 AM,164.77,-2.842170943040401e-14,1.9828309847934216\n08/20/2013 12:00:00 AM,165.58,4.601010622943007,1.53367020764763\n08/21/2013 12:00:00 AM,164.56,5.65484256829772,3.4186177304135463\n08/22/2013 12:00:00 AM,166.06,14.902358525484905,8.386070572241858\n08/23/2013 12:00:00 AM,166.62,25.35472138027997,15.303974158020845\n08/26/2013 12:00:00 AM,166.0,36.43068939658734,25.562589767450717\n08/27/2013 12:00:00 AM,163.33,27.407877856539628,29.731096211135625\n08/28/2013 12:00:00 AM,163.91,16.741273661422056,26.859946971516322\n08/29/2013 12:00:00 AM,164.17,10.86715880175958,18.338770106573733\n08/30/2013 12:00:00 AM,163.65,14.394623774143714,14.001018745775095\n09/03/2013 12:00:00 AM,164.39,22.309370574098033,15.85705105000042\n09/04/2013 12:00:00 AM,165.75,49.38701880543176,28.697004384557815\n09/05/2013 12:00:00 AM,165.96,78.96818274924148,50.22152404292373\n09/06/2013 12:00:00 AM,166.04,99.99999999999997,76.11840051822438\n09/09/2013 12:00:00 AM,167.63,99.99999999999997,92.98939424974711\n09/10/2013 12:00:00 AM,168.87,99.99999999999997,99.99999999999994\n09/11/2013 12:00:00 AM,169.4,99.99999999999997,99.99999999999994\n09/12/2013 12:00:00 AM,168.95,96.93799492307748,98.97933164102578\n09/13/2013 12:00:00 AM,169.33,95.56941225714819,97.50246906007519\n09/16/2013 12:00:00 AM,170.31,95.56941225714819,96.02560647912459\n09/17/2013 12:00:00 AM,171.07,98.63141733407068,96.59008061612232\n09/18/2013 12:00:00 AM,173.05,99.99999999999997,98.06694319707292\n09/19/2013 12:00:00 AM,172.76,98.25905013570701,98.96348915659253\n09/20/2013 12:00:00 AM,170.72,84.09542081742657,94.11815698437783\n09/23/2013 12:00:00 AM,169.93,61.09379271399405,81.14942122237586\n09/24/2013 12:00:00 AM,169.53,36.29693848917266,60.49538400686441\n09/25/2013 12:00:00 AM,169.04,20.239194845019927,39.209975349395535\n09/26/2013 12:00:00 AM,169.69,14.196391381832811,23.577508238675122\n09/27/2013 12:00:00 AM,168.91,7.400862137613813,13.945482788155507\n09/30/2013 12:00:00 AM,168.01,4.288901766713655,8.628718428720084\n10/01/2013 12:00:00 AM,169.34,7.494577405139138,6.39478043648886\n10/02/2013 12:00:00 AM,169.18,14.034252667177643,8.605910613010137\n10/03/2013 12:00:00 AM,167.62,14.034252667177643,11.854360913164799\n10/04/2013 12:00:00 AM,168.89,13.243301027386298,13.770602120580518\n10/07/2013 12:00:00 AM,167.43,6.703625765347794,11.327059819970568\n10/08/2013 12:00:00 AM,165.48,6.703625765347794,8.883517519360618\n10/09/2013 12:00:00 AM,165.6,0.8877383890942951,4.76499663992995\n10/10/2013 12:00:00 AM,169.17,28.589414490026964,12.06025954815634\n10/11/2013 12:00:00 AM,170.26,61.9227478233603,30.466633567493844\n10/14/2013 12:00:00 AM,170.94,94.3683427675993,61.62683502699551\n10/15/2013 12:00:00 AM,169.7,91.94794925018479,82.74634661371478\n10/16/2013 12:00:00 AM,172.07,91.94794925018479,92.75474708932295\n10/17/2013 12:00:00 AM,173.22,91.94794925018479,91.94794925018478\n10/18/2013 12:00:00 AM,174.39,99.99999999999997,94.63196616678984\n10/21/2013 12:00:00 AM,174.4,99.99999999999997,97.3159830833949\n10/22/2013 12:00:00 AM,175.41,99.99999999999997,99.99999999999996\n10/23/2013 12:00:00 AM,174.57,95.64909819028303,98.54969939676097\n10/24/2013 12:00:00 AM,175.15,92.94645340415556,96.19851719814616\n10/25/2013 12:00:00 AM,175.95,92.46497979569385,93.68684379671079\n10/28/2013 12:00:00 AM,176.23,96.8158816054108,94.07577160175337\n10/29/2013 12:00:00 AM,177.17,99.51852639153826,96.2664625975476\n10/30/2013 12:00:00 AM,176.29,90.83214007519939,95.72218269071611\n10/31/2013 12:00:00 AM,175.79,76.61957226325522,88.99007957666426\n11/01/2013 12:00:00 AM,176.21,64.88014316345956,77.44395183397135\n11/04/2013 12:00:00 AM,176.83,60.63237347190404,67.37736296620623\n11/05/2013 12:00:00 AM,176.27,42.32813106102107,55.946882565461515\n11/06/2013 12:00:00 AM,177.17,33.62960080756352,45.53003511349617\n11/07/2013 12:00:00 AM,174.93,13.711897090586291,29.889876319723584\n11/08/2013 12:00:00 AM,177.29,28.48433200408364,25.275276634077773\n11/11/2013 12:00:00 AM,177.32,31.35690043748416,24.51770984405132\n11/12/2013 12:00:00 AM,176.96,43.44123437096132,34.427488937509665\n11/13/2013 12:00:00 AM,178.38,48.86247169620754,41.22020216821763\n11/14/2013 12:00:00 AM,179.27,59.147105528560516,50.48360386524308\n11/15/2013 12:00:00 AM,180.05,77.30211180975431,61.77056301150741\n11/18/2013 12:00:00 AM,179.42,81.6860025004498,72.71173994625484\n11/19/2013 12:00:00 AM,179.03,76.14776346233465,78.37862592417954\n11/20/2013 12:00:00 AM,178.47,59.449168650648396,72.42764487114424\n11/21/2013 12:00:00 AM,179.91,58.251653012519455,64.61619504183412\n11/22/2013 12:00:00 AM,180.81,67.84489201606502,61.848571226410904\n11/25/2013 12:00:00 AM,180.63,81.99507234606448,69.36387245821626\n11/26/2013 12:00:00 AM,180.68,85.84727085616855,78.56241173943263\n11/27/2013 12:00:00 AM,181.12,85.66573559012608,84.50269293078632\n11/29/2013 12:00:00 AM,181.0,84.71438602402779,85.40913082344076\n12/02/2013 12:00:00 AM,180.53,70.75279409370883,80.37763856928753\n12/03/2013 12:00:00 AM,179.75,40.82675314848727,65.43131108874125\n12/04/2013 12:00:00 AM,179.73,14.087176981601402,41.88890807459913\n12/05/2013 12:00:00 AM,178.94,-2.842170943040401e-14,18.304643376696177\n12/06/2013 12:00:00 AM,180.94,20.353785657479758,11.480320879693672\n12/09/2013 12:00:00 AM,181.4,44.63020877633063,21.66133147793675\n12/10/2013 12:00:00 AM,180.75,59.33896533329269,41.440986589034324\n12/11/2013 12:00:00 AM,178.72,38.9851796758129,47.65145126181204\n12/12/2013 12:00:00 AM,178.13,14.70875655696203,37.67763385535584\n12/13/2013 12:00:00 AM,178.11,-2.842170943040401e-14,17.89797874425827\n12/16/2013 12:00:00 AM,179.22,8.533152100551598,7.747302885837836\n12/17/2013 12:00:00 AM,178.65,12.655575466844056,7.062909189131845\n12/18/2013 12:00:00 AM,181.7,36.440707447238935,19.209811671544834\n12/19/2013 12:00:00 AM,181.49,53.83295371477725,34.30974554295339\n12/20/2013 12:00:00 AM,181.56,76.10475060532285,55.45947058911298\n12/23/2013 12:00:00 AM,182.53,85.08822932235309,71.67531121415104\n12/24/2013 12:00:00 AM,182.93,92.49616428759647,84.56304807175745\n12/26/2013 12:00:00 AM,183.85,99.43527736409175,92.33989032468041\n12/27/2013 12:00:00 AM,183.85,99.99999999999996,97.3104805505627\n12/30/2013 12:00:00 AM,183.82,99.66979339787815,99.70169025398992\n12/31/2013 12:00:00 AM,184.69,99.66979339787815,99.77986226525206\n01/02/2014 12:00:00 AM,182.92,83.67636680052766,94.3386511987613\n01/03/2014 12:00:00 AM,182.88,67.6876533072278,83.67793783521118\n01/06/2014 12:00:00 AM,182.36,44.51608669315654,65.29336893363731\n01/07/2014 12:00:00 AM,183.48,44.811129110975266,52.338289703786515\n01/08/2014 12:00:00 AM,183.52,38.91494735537313,42.747387719834954\n01/09/2014 12:00:00 AM,183.64,41.03911483372889,41.58839710002574\n01/10/2014 12:00:00 AM,184.14,40.574871924973465,40.17631137135847\n01/13/2014 12:00:00 AM,181.68,29.456640442663925,37.023542400455405\n01/14/2014 12:00:00 AM,183.67,30.203929906496164,33.41181409137783\n01/15/2014 12:00:00 AM,184.66,31.422986404860307,30.361185584673443\n01/16/2014 12:00:00 AM,184.42,47.84941144213349,36.4921092511633\n01/17/2014 12:00:00 AM,183.63,44.89473218064214,41.38904334254529\n01/21/2014 12:00:00 AM,184.18,39.952221665946105,44.23212176290723\n01/22/2014 12:00:00 AM,184.3,44.69392551748685,43.180293121358346\n01/23/2014 12:00:00 AM,182.79,37.80903606530491,40.81839441624594\n01/24/2014 12:00:00 AM,178.89,24.361783836590647,35.62158180646078\n01/27/2014 12:00:00 AM,178.01,3.193654947776718,21.78815828322407\n01/28/2014 12:00:00 AM,179.07,5.584546230075235,11.046661671480846\n01/29/2014 12:00:00 AM,177.35,5.970028876737749,4.9160766848632145\n01/30/2014 12:00:00 AM,179.23,15.270311606251898,8.94162890435494\n01/31/2014 12:00:00 AM,178.18,16.293528752390845,12.511289745126811\n02/03/2014 12:00:00 AM,174.17,15.90804610572833,15.823962154790339\n02/04/2014 12:00:00 AM,175.38,11.651953083666035,14.617842647261718\n02/05/2014 12:00:00 AM,175.17,9.80769317064266,12.455897453345656\n02/06/2014 12:00:00 AM,177.48,24.81579647258858,15.425147575632407\n02/07/2014 12:00:00 AM,179.68,42.72398365695446,25.782491100061883\n02/10/2014 12:00:00 AM,180.01,62.02962497170907,43.18980170041735\n02/11/2014 12:00:00 AM,181.98,80.35485500309647,61.70282121058665\n02/12/2014 12:00:00 AM,182.07,90.73581144461208,77.70676380647252\n02/13/2014 12:00:00 AM,183.01,99.99999999999996,90.36355548256948\n02/14/2014 12:00:00 AM,184.02,99.99999999999996,96.91193714820398\n02/18/2014 12:00:00 AM,184.24,99.99999999999996,99.99999999999993\n02/19/2014 12:00:00 AM,183.02,94.89685661309045,98.29895220436343\n02/20/2014 12:00:00 AM,184.1,92.98506266058874,95.96063975789302\n02/21/2014 12:00:00 AM,183.89,90.16238014176115,92.68143313848009\n02/24/2014 12:00:00 AM,184.91,95.26552352867067,92.80432211034017\n02/25/2014 12:00:00 AM,184.84,96.79061167830771,94.07283844957982\n02/26/2014 12:00:00 AM,184.85,99.10892696882904,97.05502072526912\n02/27/2014 12:00:00 AM,185.82,99.10892696882904,98.3361552053219\n02/28/2014 12:00:00 AM,186.29,99.49563277169372,99.23782890311723\n03/03/2014 12:00:00 AM,184.98,77.44129467181538,92.01528480411268\n03/04/2014 12:00:00 AM,187.58,77.44129467181538,84.79274070510813\n03/05/2014 12:00:00 AM,187.75,77.44129467181538,77.44129467181536\n03/06/2014 12:00:00 AM,188.18,99.99999999999999,84.96086311454356\n03/07/2014 12:00:00 AM,188.26,99.99999999999999,92.48043155727176\n03/10/2014 12:00:00 AM,188.16,98.2500337319389,99.41667791064626\n03/11/2014 12:00:00 AM,187.23,76.44221399294487,91.56408257496122\n03/12/2014 12:00:00 AM,187.28,55.2737359893288,76.65532790473749\n03/13/2014 12:00:00 AM,185.18,23.690368924056557,51.80210630211005\n03/14/2014 12:00:00 AM,184.66,12.16485532971725,30.376320081034176\n03/17/2014 12:00:00 AM,186.33,11.89888885734336,15.918037703705696\n03/18/2014 12:00:00 AM,187.66,31.7679154731946,18.610553220085045\n03/19/2014 12:00:00 AM,186.66,43.46134020879297,29.042714846443616\n03/20/2014 12:00:00 AM,187.75,49.70348492807241,41.64424687001997\n03/21/2014 12:00:00 AM,186.2,36.168977035976326,43.11126739094721\n03/24/2014 12:00:00 AM,185.43,25.510209900352308,37.12755728813366\n03/25/2014 12:00:00 AM,186.31,14.195017017731724,25.291401318020093\n03/26/2014 12:00:00 AM,184.97,7.8604982939765735,15.855241737353508\n03/27/2014 12:00:00 AM,184.58,6.8258406940022205,9.627118668570144\n03/28/2014 12:00:00 AM,185.49,7.802571427018571,7.49630347166576\n03/31/2014 12:00:00 AM,187.01,27.253523241367656,13.960645120796121\n04/01/2014 12:00:00 AM,188.25,58.61561197704151,31.22390221514255\n04/02/2014 12:00:00 AM,188.88,84.14637388335626,56.67183636725511\n04/03/2014 12:00:00 AM,188.63,95.3777527552813,79.379912871893\n04/04/2014 12:00:00 AM,186.4,73.6054776999969,84.3765347795448\n04/07/2014 12:00:00 AM,184.34,40.27214436666356,69.75179160731389\n04/08/2014 12:00:00 AM,185.1,15.017324547332922,42.96498220466442\n04/09/2014 12:00:00 AM,187.09,23.573195275216587,26.287554729737654\n04/10/2014 12:00:00 AM,183.15,23.573195275216587,20.721238365921995\n04/11/2014 12:00:00 AM,181.51,18.14568440827309,21.764024986235384\n04/14/2014 12:00:00 AM,182.94,6.711170504194639,16.1433500625614\n04/15/2014 12:00:00 AM,184.2,18.923884261436303,14.593579724634639\n04/16/2014 12:00:00 AM,186.12,38.73979020467202,21.458281656767614\n04/17/2014 12:00:00 AM,186.39,52.867845436179095,36.8438399674291\n04/21/2014 12:00:00 AM,187.04,64.01301577902677,51.87355047329259\n04/22/2014 12:00:00 AM,187.89,70.80500320644227,62.561954807216004\n04/23/2014 12:00:00 AM,187.45,75.69532532788295,70.17111477111729\n04/24/2014 12:00:00 AM,187.83,84.87883157414817,77.12638670282442\n04/25/2014 12:00:00 AM,186.29,80.9748672332112,80.51634137841407\n04/28/2014 12:00:00 AM,186.88,81.34080436194381,82.39816772310103\n04/29/2014 12:00:00 AM,187.75,79.78363002521277,80.69976720678923\n04/30/2014 12:00:00 AM,188.31,90.41303432883187,83.84582290532946\n05/01/2014 12:00:00 AM,188.32,97.65088267629018,89.28251567677825\n05/02/2014 12:00:00 AM,188.06,97.2911618642241,95.11835962311535\n05/05/2014 12:00:00 AM,188.42,97.2911618642241,97.41106880157943\n05/06/2014 12:00:00 AM,186.78,63.95782853089076,86.18005075311297\n05/07/2014 12:00:00 AM,187.88,52.48673242952644,71.24524094154708\n05/08/2014 12:00:00 AM,187.68,34.27291833123594,50.23915976388436\n05/09/2014 12:00:00 AM,187.96,54.47479689836284,47.078149219708386\n05/12/2014 12:00:00 AM,189.79,68.65473113550306,52.46748212170059\n05/13/2014 12:00:00 AM,189.96,86.86854523379355,69.99935775588646\n05/14/2014 12:00:00 AM,189.06,86.61518371532087,80.71282002820581\n05/15/2014 12:00:00 AM,187.4,53.28185038198753,75.58852644370063\n05/16/2014 12:00:00 AM,188.05,27.196048471539523,55.69769418961596\n05/19/2014 12:00:00 AM,188.74,21.9251424560862,34.134347103204405\n05/20/2014 12:00:00 AM,187.55,22.18326006620114,23.768150331275606\n05/21/2014 12:00:00 AM,189.13,31.8171160058526,25.30850617604663\n05/22/2014 12:00:00 AM,189.59,38.459432119193686,30.819936063749125\n05/23/2014 12:00:00 AM,190.35,66.68721788793212,45.65458867099279\n05/27/2014 12:00:00 AM,191.52,83.13916385872866,62.76193795528481\n05/28/2014 12:00:00 AM,191.38,93.38907219969965,81.07181798212014\n05/29/2014 12:00:00 AM,192.37,98.2365021541796,91.5882460708693\n05/30/2014 12:00:00 AM,192.68,98.2365021541796,96.62069216935295\n06/02/2014 12:00:00 AM,192.9,99.99999999999999,98.82433476945306\n06/03/2014 12:00:00 AM,192.8,98.77840210634201,99.00496808684053\n06/04/2014 12:00:00 AM,193.19,98.77840210634201,99.18560140422801\n06/05/2014 12:00:00 AM,194.45,98.77840210634201,98.77840210634201\n06/06/2014 12:00:00 AM,195.38,99.99999999999999,99.18560140422801\n06/09/2014 12:00:00 AM,195.58,99.99999999999999,99.592800702114\n06/10/2014 12:00:00 AM,195.6,99.99999999999999,100.0\n06/11/2014 12:00:00 AM,194.92,89.79998016045252,96.59999338681752\n06/12/2014 12:00:00 AM,193.54,56.885391354416946,82.22845717162318\n06/13/2014 12:00:00 AM,194.13,28.8646173996534,58.51666297150764\n06/16/2014 12:00:00 AM,194.29,12.480294035819135,32.74343426329651\n06/17/2014 12:00:00 AM,194.83,23.64902303724132,21.664644824237968\n06/18/2014 12:00:00 AM,196.26,41.099368406935355,25.742895159998618\n06/19/2014 12:00:00 AM,196.48,58.66796983398454,41.13878709272042\n06/20/2014 12:00:00 AM,195.94,62.262757788637934,54.01003200985262\n06/23/2014 12:00:00 AM,195.88,53.658065869627336,58.196264497416614\n06/24/2014 12:00:00 AM,194.7,29.34047431262655,48.42043265696395\n06/25/2014 12:00:00 AM,195.58,21.81713876726058,34.93855964983817\n06/26/2014 12:00:00 AM,195.44,13.42028454858585,21.52596587615767\n06/27/2014 12:00:00 AM,195.82,22.54725799353669,19.26156043646105\n06/30/2014 12:00:00 AM,195.72,24.880956988562243,20.282833176894936\n07/01/2014 12:00:00 AM,197.03,43.6488308400166,30.35901527403852\n07/02/2014 12:00:00 AM,197.23,61.045847260392605,43.191878362990494\n07/03/2014 12:00:00 AM,198.2,84.38655566069302,63.02707792036742\n07/07/2014 12:00:00 AM,197.51,79.72452851459994,75.05231047856186\n07/08/2014 12:00:00 AM,196.24,53.2005386492731,72.4372076081887\n07/09/2014 12:00:00 AM,197.12,28.843152616994328,53.9227399269558\n07/10/2014 12:00:00 AM,196.34,8.97594730105455,30.33987952244067\n07/11/2014 12:00:00 AM,196.61,11.709140217851681,16.509413378633532\n07/14/2014 12:00:00 AM,197.6,14.886749203382896,11.857278907429722\n07/15/2014 12:00:00 AM,197.23,21.727591172163724,16.107826864466112\n07/16/2014 12:00:00 AM,197.96,32.663678149689886,23.092672841745514\n07/17/2014 12:00:00 AM,195.71,20.51012186310411,24.96713039498592\n07/18/2014 12:00:00 AM,197.71,26.22039537376912,26.46473179552105\n07/21/2014 12:00:00 AM,197.34,22.300960067101016,23.010492434658094\n07/22/2014 12:00:00 AM,198.2,36.9590876606323,28.493481033834158\n07/23/2014 12:00:00 AM,198.64,41.47618476644075,33.578744164724704\n07/24/2014 12:00:00 AM,198.65,54.66159238344497,44.36562160350602\n07/25/2014 12:00:00 AM,197.72,55.401685249829704,50.51315413323849\n07/28/2014 12:00:00 AM,197.8,54.65334490268646,54.90554084532039\n07/29/2014 12:00:00 AM,196.95,35.79681374702728,48.617281299847825\n07/30/2014 12:00:00 AM,196.98,24.87932873427919,38.443162461330985\n07/31/2014 12:00:00 AM,193.09,8.559456496168142,23.078532992491546\n08/01/2014 12:00:00 AM,192.5,4.480735447167919,12.63984022587176\n08/04/2014 12:00:00 AM,193.89,8.311314877855068,7.117168940397052\n08/05/2014 12:00:00 AM,192.01,10.191828697091578,7.661293007371531\n08/06/2014 12:00:00 AM,192.07,12.442482997093036,10.315208857346569\n08/07/2014 12:00:00 AM,191.03,4.1311681192379535,8.921826604474198\n08/08/2014 12:00:00 AM,193.24,14.56812396835517,10.380591694895395\n08/11/2014 12:00:00 AM,193.79,27.31583848068287,15.338376856092008\n08/12/2014 12:00:00 AM,193.53,41.23690117994099,27.70695454299302\n08/13/2014 12:00:00 AM,194.84,53.57961663476463,40.710785431796175\n08/14/2014 12:00:00 AM,195.76,68.18130793726759,54.33260858399108\n08/15/2014 12:00:00 AM,195.72,87.31538848616047,69.69210435273091\n08/18/2014 12:00:00 AM,197.36,95.98853669631644,83.82841103991484\n08/19/2014 12:00:00 AM,198.39,99.72180991481765,94.34191169909819\n08/20/2014 12:00:00 AM,198.92,99.99999999999999,98.5701155370447\n08/21/2014 12:00:00 AM,199.5,99.99999999999999,99.90726997160588\n08/22/2014 12:00:00 AM,199.19,98.26176262196547,99.42058754065516\n08/25/2014 12:00:00 AM,200.2,98.26176262196547,98.84117508131033\n08/26/2014 12:00:00 AM,200.33,98.26176262196547,98.26176262196549\n08/27/2014 12:00:00 AM,200.25,99.29520041570093,98.60624188654397\n08/28/2014 12:00:00 AM,200.14,97.4623005985576,98.33975454540801\n08/29/2014 12:00:00 AM,200.71,97.4623005985576,98.07326720427206\n09/02/2014 12:00:00 AM,200.61,96.79722607268752,97.24060908993425\n09/03/2014 12:00:00 AM,200.5,95.01717400815211,96.42556689313243\n09/04/2014 12:00:00 AM,200.21,86.1591359457952,92.65784534221163\n09/05/2014 12:00:00 AM,201.11,86.98085196233528,89.38572063876089\n09/08/2014 12:00:00 AM,200.59,65.52386219511858,79.55461670108305\n09/09/2014 12:00:00 AM,199.32,41.04856692414215,64.51776036053204\n09/10/2014 12:00:00 AM,200.07,17.56222107438776,41.3782167312162\n09/11/2014 12:00:00 AM,200.3,21.34890564701579,26.653231215181933\n09/12/2014 12:00:00 AM,199.13,21.34890564701579,20.086677456139814\n09/15/2014 12:00:00 AM,198.98,12.050076257065896,18.249295850365858\n09/16/2014 12:00:00 AM,200.48,15.03451941041849,16.14450043816676\n09/17/2014 12:00:00 AM,200.75,32.464786163658246,19.849793943714243\n09/18/2014 12:00:00 AM,201.82,58.734167186456816,35.41115758684455\n09/19/2014 12:00:00 AM,200.7,55.8088117675686,49.002588372561256\n09/22/2014 12:00:00 AM,199.15,38.37854501432884,50.973841322784786\n09/23/2014 12:00:00 AM,198.01,12.10916399153027,35.4321735911426\n09/24/2014 12:00:00 AM,199.56,10.14665357765999,20.211454194506395\n09/25/2014 12:00:00 AM,196.34,10.14665357765999,10.800823715616778\n09/26/2014 12:00:00 AM,197.9,18.684259332290395,12.992522162536819\n09/29/2014 12:00:00 AM,197.54,15.483560322517691,14.771491077489387\n09/30/2014 12:00:00 AM,197.02,20.107277240137233,18.091698964981802\n10/01/2014 12:00:00 AM,194.35,11.569671485506827,15.720169682720613\n10/02/2014 12:00:00 AM,194.38,4.780115448188973,12.15235472461104\n10/03/2014 12:00:00 AM,196.52,10.646025736485559,8.998604223393816\n10/06/2014 12:00:00 AM,196.29,20.31125172193481,11.912464302203142\n10/07/2014 12:00:00 AM,193.26,20.40935719148709,17.12221154996918\n10/08/2014 12:00:00 AM,196.64,28.135295857719033,22.951968257047003\n10/09/2014 12:00:00 AM,192.74,24.952551671603747,24.49906824026998\n10/10/2014 12:00:00 AM,190.54,24.698047671482,25.92863173360162\n10/13/2014 12:00:00 AM,187.41,6.482481799333932,18.71102704747325\n10/14/2014 12:00:00 AM,187.7,1.7624513019042665,10.98099359090676\n10/15/2014 12:00:00 AM,186.43,1.7624513019042665,3.3357948010475154\n10/16/2014 12:00:00 AM,186.27,1.7624513019042665,1.7624513019042933\n10/17/2014 12:00:00 AM,188.47,13.336642032207855,5.620514878672156\n10/20/2014 12:00:00 AM,190.3,36.470703713747824,17.189932349286675\n10/21/2014 12:00:00 AM,194.07,69.80403704708115,39.8704609310123\n10/22/2014 12:00:00 AM,192.69,85.22587492046614,63.833538560431734\n10/23/2014 12:00:00 AM,194.93,95.4251465722595,83.48501951326895\n10/24/2014 12:00:00 AM,196.43,95.4251465722595,92.02538935499507\n10/27/2014 12:00:00 AM,196.16,99.15773477201877,96.66934263884595\n10/28/2014 12:00:00 AM,198.41,99.15773477201877,97.91353870543237\n10/29/2014 12:00:00 AM,198.11,98.25328408436243,98.85625120946669\n10/30/2014 12:00:00 AM,199.38,99.09554931234362,98.83552272290831\n10/31/2014 12:00:00 AM,201.66,99.09554931234362,98.81479423634993\n11/03/2014 12:00:00 AM,201.77,99.99999999999996,99.39703287489577\n11/04/2014 12:00:00 AM,201.07,97.88139717116334,98.99231549450235\n11/05/2014 12:00:00 AM,202.34,97.88139717116334,98.58759811410893\n11/06/2014 12:00:00 AM,203.15,97.88139717116334,97.88139717116339\n11/07/2014 12:00:00 AM,203.34,99.99999999999996,98.58759811410893\n11/10/2014 12:00:00 AM,203.98,99.99999999999996,99.29379905705447\n11/11/2014 12:00:00 AM,204.18,99.99999999999996,100.00000000000001\n11/12/2014 12:00:00 AM,203.96,97.5842585571328,99.19475285237763\n11/13/2014 12:00:00 AM,204.19,96.41436088488832,97.9995398140071\n11/14/2014 12:00:00 AM,204.24,95.21968778039466,96.40610240747199\n11/17/2014 12:00:00 AM,204.37,97.5078905057455,96.38064639034289\n11/18/2014 12:00:00 AM,205.55,98.67778817798998,97.1351221547101\n11/19/2014 12:00:00 AM,205.22,92.41750650289637,96.20106172887733\n11/20/2014 12:00:00 AM,205.58,88.6665544938861,93.2539497249242\n11/21/2014 12:00:00 AM,206.68,88.6665544938861,89.9168718302229\n11/24/2014 12:00:00 AM,207.26,96.12150927347338,91.15153942041523\n11/25/2014 12:00:00 AM,207.11,95.64376140597275,93.47727505777745\n11/26/2014 12:00:00 AM,207.64,95.64376140597275,95.80301069513966\n11/28/2014 12:00:00 AM,207.2,80.78582608030702,90.69111629741754\n12/01/2014 12:00:00 AM,205.76,51.80873134100091,76.07943960909358\n12/02/2014 12:00:00 AM,207.09,29.901530041419544,54.16536248757585\n12/03/2014 12:00:00 AM,207.89,28.96493750619944,36.89173296287332\n12/04/2014 12:00:00 AM,207.66,42.6424234611972,33.83629700293875\n12/05/2014 12:00:00 AM,208.0,47.677799408352975,39.761720125249894\n12/08/2014 12:00:00 AM,206.61,30.138993935905475,40.15307226848524\n12/09/2014 12:00:00 AM,206.47,16.46150798090772,31.426100441722078\n12/10/2014 12:00:00 AM,203.16,-2.4868995751603507e-14,15.533500638937745\n12/11/2014 12:00:00 AM,204.19,4.720990438863178,7.060832806590314\n12/12/2014 12:00:00 AM,200.89,4.720990438863178,3.1473269592421342\n12/15/2014 12:00:00 AM,199.51,4.720990438863178,4.720990438863202\n12/16/2014 12:00:00 AM,197.91,-2.4868995751603507e-14,3.1473269592421342\n12/17/2014 12:00:00 AM,201.79,11.557384436506762,5.426124958456662\n12/18/2014 12:00:00 AM,206.78,34.62075567722288,15.392713371243229\n12/19/2014 12:00:00 AM,206.52,57.058593940328755,34.41224468468616\n12/22/2014 12:00:00 AM,207.47,69.69856529992202,53.79263830582458\n12/23/2014 12:00:00 AM,207.75,71.62499409422986,66.1273844448269\n12/24/2014 12:00:00 AM,207.77,74.21716809798033,71.84690916404409\n12/26/2014 12:00:00 AM,208.44,83.35314563521362,76.39843594247462\n12/29/2014 12:00:00 AM,208.72,91.69667893352299,83.08899755557233\n12/30/2014 12:00:00 AM,207.6,95.34914289139218,90.13298915337629\n12/31/2014 12:00:00 AM,205.54,83.12905148618042,90.05829110369855\n01/02/2015 12:00:00 AM,205.43,70.5278720475078,83.00202214169349\n01/05/2015 12:00:00 AM,201.72,51.542682252241406,68.3998685953099\n01/06/2015 12:00:00 AM,199.82,35.72131038538128,52.597288228376854\n01/07/2015 12:00:00 AM,202.31,25.200362149135863,37.488118262252875\n01/08/2015 12:00:00 AM,205.9,37.42691113899356,32.78286122450359\n01/09/2015 12:00:00 AM,204.25,48.95195416109225,37.19307581640725\n01/12/2015 12:00:00 AM,202.65,50.963285183705565,45.78071682793048\n01/13/2015 12:00:00 AM,202.08,39.66734938611574,46.52752957697121\n01/14/2015 12:00:00 AM,200.86,30.105335963337836,40.24532351105307\n01/15/2015 12:00:00 AM,199.02,20.414339757453547,30.062341702302398\n01/16/2015 12:00:00 AM,201.63,21.701340014429586,24.073671911740348\n01/20/2015 12:00:00 AM,202.05,30.421336972527747,24.179005581470317\n01/21/2015 12:00:00 AM,203.08,53.42942732983142,35.18403477226294\n01/22/2015 12:00:00 AM,206.1,74.8478607844617,52.89954169560698\n01/23/2015 12:00:00 AM,204.97,87.30161373222637,71.85963394883986\n01/26/2015 12:00:00 AM,205.45,92.02586208311645,84.72511219993487\n01/27/2015 12:00:00 AM,202.74,76.07329131526396,85.13358904353562\n01/28/2015 12:00:00 AM,200.14,54.92656211268476,74.34190517035509\n01/29/2015 12:00:00 AM,201.99,40.60271939200144,57.20085760665009\n01/30/2015 12:00:00 AM,199.45,29.883761305823505,41.804347603503274\n02/02/2015 12:00:00 AM,201.92,40.13682385691179,36.87443485157895\n02/03/2015 12:00:00 AM,204.84,52.808002456279226,40.942862539671545\n02/04/2015 12:00:00 AM,204.06,71.60356431238621,54.849463541859116\n02/05/2015 12:00:00 AM,206.12,86.83024145158586,70.41393607341715\n02/06/2015 12:00:00 AM,205.55,87.85874073768481,82.09751550055235\n02/09/2015 12:00:00 AM,204.63,86.95289901966662,87.21396040297915\n02/10/2015 12:00:00 AM,206.81,87.52457229884614,87.44540401873257\n02/11/2015 12:00:00 AM,206.93,91.21819128405834,88.56522086752375\n02/12/2015 12:00:00 AM,208.92,99.99999999999997,92.91425452763487\n02/13/2015 12:00:00 AM,209.78,99.99999999999997,97.07273042801948\n02/17/2015 12:00:00 AM,210.11,99.99999999999997,100.00000000000003\n"
  },
  {
    "path": "Tests/TestData/spy_with_adx.txt",
    "content": "Date,Open,High,Low,Close,TR,+DM 1,-DM 1,TR14,+DM14,-DM14,+DI14,-DI14,DI 14 Diff,DI 14 Sum,DX,ADX 14,ADXR 14\n2/11/2009,29.8720,30.1983,29.4072,29.8720,,,,,,,,,,,,,\n2/12/2009,30.2381,30.2776,29.3182,30.2381,0.96,0.00,0.09,,,,,,,,,,\n2/13/2009,30.0996,30.4458,29.9611,30.0996,0.48,0.17,0.00,,,,,,,,,,\n2/17/2009,28.9028,29.3478,28.7443,28.9028,1.36,0.00,1.22,,,,,,,,,,\n2/18/2009,28.9225,29.3477,28.5566,28.9225,0.79,0.00,0.19,,,,,,,,,,\n2/19/2009,28.4775,29.2886,28.4081,28.4775,0.88,0.00,0.15,,,,,,,,,,\n2/20/2009,28.5566,28.8334,28.0818,28.5566,0.75,0.00,0.33,,,,,,,,,,\n2/23/2009,27.5576,28.7346,27.4289,27.5576,1.31,0.00,0.65,,,,,,,,,,\n2/24/2009,28.4675,28.6654,27.6565,28.4675,1.11,0.00,0.00,,,,,,,,,,\n2/25/2009,28.2796,28.8532,27.8345,28.2796,1.02,0.19,0.00,,,,,,,,,,\n2/26/2009,27.4882,28.6356,27.3992,27.4882,1.24,0.00,0.44,,,,,,,,,,\n2/27/2009,27.2310,27.6761,27.0927,27.2310,0.58,0.00,0.31,,,,,,,,,,\n3/2/2009,26.3507,27.2112,26.1826,26.3507,1.05,0.00,0.91,,,,,,,,,,\n3/3/2009,26.3309,26.8651,26.1332,26.3309,0.73,0.00,0.0494,,,,,,,,,,\n3/4/2009,27.0333,27.4090,26.6277,27.0333,1.08,0.54,0.00,13.333,0.90,4.32,6.7494,32.4196,25.67,39.17,65.53692,,\n3/5/2009,26.2221,26.9441,26.1332,26.2221,0.90,0.00,0.49,13.28,0.84,4.51,6.2920,33.9458,27.65,40.24,68.73,,\n3/6/2009,26.0144,26.5189,25.4307,26.0144,1.09,0.00,0.70,13.42,0.78,4.89,5.7818,36.4278,30.65,42.21,72.60,,\n3/9/2009,25.4605,26.5189,25.3518,25.4605,1.17,0.00,0.08,13.63,0.72,4.62,5.2867,33.8873,28.60,39.17,73.01,,\n3/10/2009,27.0333,27.0927,25.8760,27.0333,1.63,0.57,0.00,14.29,1.24,4.29,8.6988,30.0160,21.32,38.71,55.06,,\n3/11/2009,27.4487,27.6860,26.9640,27.4487,0.72,0.59,0.00,13.99,1.75,3.98,12.4910,28.4668,15.98,40.96,39.01,,\n3/12/2009,28.3586,28.4477,27.1421,28.3586,1.31,0.76,0.00,14.30,2.38,3.70,16.6785,25.8669,9.19,42.55,21.60,,\n3/13/2009,28.4278,28.5267,28.0123,28.4278,0.51,0.08,0.00,13.79,2.29,3.43,16.6292,24.9020,8.27,41.53,19.92,,\n3/16/2009,27.9530,28.6654,27.8840,27.9530,0.78,0.14,0.00,13.59,2.27,3.19,16.6937,23.4696,6.78,40.16,16.87,,\n3/17/2009,29.0116,29.0116,27.9928,29.0116,1.06,0.35,0.00,13.67,2.45,2.96,17.9332,21.6526,3.72,39.59,9.40,,\n3/18/2009,29.3776,29.8720,28.7643,29.3776,1.11,0.86,0.00,13.80,3.14,2.75,22.7270,19.9151,2.81,42.64,6.59,,\n3/19/2009,29.3576,29.8028,29.1402,29.3576,0.66,0.00,0.00,13.48,2.91,2.55,21.6099,18.9363,2.67,40.55,6.59,,\n3/20/2009,28.9107,29.7529,28.7127,28.9107,1.04,0.00,0.43,13.56,2.71,2.80,19.9520,20.6366,0.68,40.59,1.69,,\n3/23/2009,30.6149,30.6546,28.9290,30.6149,1.74,0.90,0.00,14.33,3.41,2.60,23.8153,18.1258,5.69,41.94,13.57,33.5833,\n3/24/2009,30.0502,30.5951,30.0304,30.0502,0.58,0.00,0.00,13.89,3.17,2.41,22.8135,17.3633,5.45,40.18,13.57,32.1535,\n3/25/2009,30.1890,30.7635,29.3863,30.1890,1.38,0.00,0.64,14.28,2.94,2.88,20.6132,20.1994,0.41,40.81,1.01,29.9292,\n3/26/2009,31.1202,31.1698,30.1365,31.1202,1.03,0.41,0.00,14.29,3.14,2.68,21.9656,18.7391,3.23,40.70,7.93,28.3576,\n3/27/2009,30.5356,30.8923,30.4267,30.5356,0.69,0.00,0.00,13.97,2.92,2.49,20.8748,17.8085,3.07,38.68,7.93,26.8983,\n3/30/2009,29.7827,30.0402,29.3467,29.7827,1.19,0.00,1.08,14.16,2.71,3.39,19.1217,23.9419,4.82,43.06,11.19,25.7765,\n3/31/2009,30.0402,30.6645,29.9906,30.0402,0.88,0.62,0.00,14.03,3.14,3.15,22.3703,22.4368,0.07,44.81,0.15,23.9459,\n4/1/2009,30.4861,30.5951,29.5152,30.4861,1.08,0.00,0.48,14.11,2.91,3.40,20.6576,24.0895,3.43,44.75,7.67,22.7833,\n4/2/2009,31.4670,31.9724,30.9418,31.4670,1.49,1.38,0.00,14.58,4.08,3.16,27.9963,21.6344,6.36,49.63,12.82,22.0715,\n4/3/2009,32.0515,32.1011,31.5364,32.0515,0.63,0.13,0.00,14.18,3.92,2.93,27.6519,20.6667,6.99,48.32,14.46,21.5276,\n4/6/2009,31.9724,32.0317,31.3580,31.9724,0.69,0.00,0.18,13.86,3.64,2.90,26.2680,20.9198,5.35,47.19,11.33,20.7995,\n4/7/2009,31.1302,31.6255,30.9220,31.1302,1.05,0.00,0.44,13.92,3.38,3.13,24.2855,22.4737,1.81,46.76,3.87,19.5906,\n4/8/2009,31.6551,31.8534,31.1994,31.6551,0.72,0.23,0.00,13.65,3.37,2.90,24.6685,21.2827,3.39,45.95,7.37,18.7176,\n4/9/2009,32.6360,32.7055,32.1308,32.6360,1.05,0.85,0.00,13.72,3.98,2.70,28.9898,19.6536,9.34,48.64,19.19,18.7515,26.1674\n4/13/2009,32.5866,32.7648,32.2298,32.5866,0.54,0.06,0.00,13.28,3.75,2.50,28.2683,18.8617,9.41,47.13,19.96,18.8378,25.4956\n4/14/2009,32.1903,32.5766,31.9724,32.1903,0.61,0.00,0.26,12.94,3.49,2.58,26.9268,19.9553,6.97,46.88,14.87,18.5544,24.2418\n4/15/2009,32.1011,32.1308,31.5562,32.1011,0.63,0.00,0.42,12.65,3.24,2.81,25.5774,22.2446,3.33,47.82,6.97,17.7269,23.0422\n4/16/2009,32.9335,33.1215,32.2101,32.9335,1.02,0.99,0.00,12.77,4.00,2.61,31.2919,20.4671,10.82,51.76,20.91,17.9545,22.4264\n4/17/2009,33.0027,33.1909,32.6262,33.0027,0.56,0.07,0.00,12.42,3.78,2.43,30.4281,19.5366,10.89,49.96,21.80,18.2291,22.0028\n4/20/2009,31.9425,32.5172,31.7642,31.9425,1.24,0.00,0.86,12.77,3.51,3.12,27.4777,24.3909,3.09,51.87,5.95,17.3521,20.6490\n4/21/2009,32.3883,32.4379,31.7840,32.3883,0.65,0.00,0.00,12.51,3.26,2.89,26.0420,23.1164,2.93,49.16,5.95,16.5377,19.6605\n4/22/2009,32.4875,33.2207,32.0912,32.4875,1.13,0.78,0.00,12.75,3.81,2.69,29.8745,21.0686,8.81,50.94,17.29,16.5912,19.3313\n4/23/2009,32.8046,32.8343,32.1903,32.8046,0.64,0.00,0.00,12.48,3.54,2.49,28.3334,19.9817,8.35,48.32,17.29,16.6408,19.0842\n4/24/2009,33.3792,33.6169,32.7648,33.3792,0.85,0.78,0.00,12.44,4.07,2.32,32.6822,18.6135,14.07,51.30,27.43,17.4112,19.1053\n4/27/2009,33.4188,33.7459,33.0423,33.4188,0.70,0.13,0.00,12.26,3.91,2.15,31.8587,17.5452,14.31,49.40,28.97,18.2370,18.9138\n4/28/2009,33.1711,33.5971,33.0522,33.1711,0.54,0.00,0.00,11.93,3.63,2.00,30.4033,16.7437,13.66,47.15,28.97,19.0038,18.8607\n4/29/2009,33.6268,34.0825,33.3297,33.6268,0.91,0.49,0.00,11.99,3.85,1.85,32.1410,15.4706,16.67,47.61,35.01,20.1474,19.4494\n4/30/2009,33.9638,34.5780,33.7260,33.9638,0.95,0.50,0.00,12.08,4.07,1.72,33.7117,14.2527,19.46,47.96,40.57,21.6061,20.2219\n5/1/2009,34.0529,34.2214,33.6962,34.0529,0.53,0.00,0.03,11.74,3.78,1.63,32.2041,13.8691,18.34,46.07,39.80,22.9053,20.7299\n5/4/2009,34.7266,34.7663,34.2015,34.7266,0.71,0.54,0.00,11.62,4.06,1.51,34.9166,13.0175,21.90,47.93,45.69,24.5325,21.1297\n5/5/2009,34.6969,34.7364,34.3105,34.6969,0.43,0.00,0.00,11.22,3.77,1.40,33.5906,12.5232,21.07,46.11,45.69,26.0435,21.9990\n5/6/2009,34.7067,35.0140,34.1420,34.7067,0.87,0.28,0.00,11.29,3.78,1.30,33.4549,11.5556,21.90,45.01,48.65,27.6585,22.9438\n5/7/2009,33.8944,34.9447,33.5674,33.8944,1.38,0.00,0.57,11.86,3.51,1.79,29.5688,15.0593,14.51,44.63,32.51,28.0052,22.6786\n5/8/2009,33.9142,34.4194,33.5674,33.9142,0.85,0.00,0.00,11.86,3.26,1.66,27.4451,13.9777,13.47,41.42,32.51,28.3271,22.4324\n5/11/2009,34.0331,34.3995,33.3692,34.0331,1.03,0.00,0.20,12.05,3.02,1.74,25.0975,14.4276,10.67,39.53,27.00,28.2320,22.4116\n5/12/2009,33.6169,34.1619,33.2108,33.6169,0.95,0.00,0.16,12.14,2.81,1.77,23.1306,14.6021,8.53,37.73,22.60,27.8298,22.2353\n5/13/2009,32.7154,33.3396,32.6560,32.7154,0.96,0.00,0.55,12.23,2.61,2.20,21.3132,17.9912,3.32,39.30,8.45,26.4457,21.9285\n5/14/2009,33.0819,33.3892,32.7747,33.0819,0.67,0.05,0.00,12.03,2.47,2.04,20.5318,16.9835,3.55,37.52,9.46,25.2323,21.7347\n5/15/2009,33.0621,33.5079,32.9235,33.0621,0.58,0.12,0.00,11.76,2.41,1.90,20.5208,16.1392,4.38,36.66,11.95,24.2837,21.6438\n5/18/2009,33.9240,33.9638,33.0820,33.9240,0.90,0.46,0.00,11.82,2.70,1.76,22.8129,14.9078,7.91,37.72,20.96,24.0461,22.0967\n5/19/2009,34.0825,34.4194,33.6368,34.0825,0.78,0.46,0.00,11.76,2.96,1.64,25.1698,13.9153,11.25,39.09,28.79,24.3853,22.9957\n5/20/2009,33.9638,34.7167,33.8647,33.9638,0.85,0.30,0.00,11.77,3.04,1.52,25.8738,12.9079,12.97,38.78,33.43,25.0316,23.9685\n5/21/2009,33.3396,33.9440,33.0027,33.3396,0.96,0.00,0.86,11.89,2.83,2.27,23.7821,19.1150,4.67,42.90,10.88,24.0207,24.2766\n5/22/2009,33.2306,33.6567,33.0127,33.2306,0.64,0.00,0.00,11.68,2.63,2.11,22.4712,18.0614,4.41,40.53,10.88,23.0821,24.5628\n5/26/2009,34.4691,34.5086,32.8738,34.4691,1.63,0.85,0.00,12.48,3.29,1.96,26.3526,15.6961,10.66,42.05,25.34,23.2436,25.4510\n5/27/2009,34.2312,34.8653,34.1124,34.2312,0.75,0.36,0.00,12.34,3.41,1.82,27.6349,14.7389,12.90,42.37,30.43,23.7572,25.8812\n5/28/2009,34.6275,34.7464,33.8944,34.6275,0.85,0.00,0.22,12.32,3.17,1.91,25.7230,15.4894,10.23,41.21,24.83,23.8339,26.0805\n5/29/2009,35.0536,35.1725,34.4393,35.0536,0.73,0.43,0.00,12.17,3.37,1.77,27.6747,14.5561,13.12,42.23,31.06,24.3504,26.2912\n6/1/2009,36.0543,36.1633,35.2816,36.0543,1.11,0.99,0.00,12.41,4.12,1.64,33.1843,13.2544,19.93,46.44,42.92,25.6765,26.7532\n6/2/2009,36.1038,36.4504,35.7768,36.1038,0.67,0.29,0.00,12.20,4.11,1.53,33.7055,12.5224,21.18,46.23,45.82,27.1156,26.7807\n6/3/2009,35.9948,36.0344,35.5985,35.9948,0.51,0.00,0.18,11.83,3.82,1.60,32.2659,13.4946,18.77,45.76,41.02,28.1088,26.6706\n6/4/2009,36.4011,36.4504,36.0048,36.4011,0.46,0.42,0.00,11.44,3.96,1.48,34.6170,12.9573,21.66,47.57,45.53,29.3531,26.8184\n6/5/2009,36.4407,36.7380,36.0839,36.4407,0.65,0.29,0.00,11.28,3.97,1.38,35.1594,12.2058,22.95,47.37,48.46,30.7179,27.3820\n6/8/2009,36.3318,36.6091,35.7868,36.3318,0.82,0.00,0.30,11.29,3.68,1.58,32.5997,13.9476,18.65,46.55,40.07,31.3860,27.8857\n6/9/2009,36.6091,36.8270,36.3318,36.6091,0.50,0.22,0.00,10.98,3.64,1.46,33.1138,13.3187,19.80,46.43,42.63,32.1893,28.6104\n6/10/2009,36.4803,36.8369,35.9552,36.4803,0.88,0.00,0.38,11.08,3.38,1.73,30.4788,15.6577,14.82,46.14,32.12,32.1847,28.1027\n6/11/2009,36.4803,36.8865,36.4110,36.4803,0.48,0.05,0.00,10.76,3.19,1.61,29.5932,14.9660,14.63,44.56,32.83,32.2305,27.6563\n6/12/2009,36.3119,36.3802,35.8659,36.3119,0.61,0.00,0.55,10.61,2.96,2.04,27.8796,19.2370,8.64,47.12,18.34,31.2385,27.2411\n6/15/2009,35.5688,35.9948,35.2516,35.5688,1.06,0.00,0.61,10.91,2.75,2.51,25.1706,22.9973,2.17,48.17,4.51,29.3295,26.5434\n6/16/2009,35.2220,35.8561,35.1923,35.2220,0.66,0.00,0.06,10.80,2.55,2.39,23.6231,22.1326,1.49,45.76,3.26,27.4672,25.6506\n6/17/2009,35.5578,35.8759,35.1230,35.5578,0.75,0.00,0.07,10.78,2.37,2.29,21.9730,21.2295,0.74,43.20,1.72,25.6282,24.9893\n6/18/2009,35.4896,35.7273,35.2418,35.4896,0.49,0.00,0.00,10.49,2.20,2.12,20.9564,20.2474,0.71,41.20,1.72,23.9205,24.7985\n6/19/2009,35.8703,36.0688,35.6225,35.8703,0.58,0.34,0.00,10.32,2.38,1.97,23.0886,19.1114,3.98,42.20,9.42,22.8851,25.0003\n6/22/2009,34.7990,35.6025,34.7394,34.7990,1.13,0.00,0.88,10.72,2.21,2.72,20.6522,25.3348,4.68,45.99,10.18,21.9778,25.0433\n6/23/2009,34.7196,34.9775,34.4915,34.7196,0.49,0.00,0.25,10.44,2.06,2.77,19.6906,26.5302,6.84,46.22,14.80,21.4649,25.4090\n6/24/2009,35.3049,35.5827,34.9974,35.3049,0.86,0.61,0.00,10.56,2.51,2.57,23.8142,24.3608,0.55,48.18,1.13,20.0127,25.3653\n6/25/2009,35.9993,36.0688,34.9974,35.9993,1.07,0.49,0.00,10.87,2.82,2.39,25.9384,21.9603,3.98,47.90,8.31,19.1765,25.2813\n6/26/2009,36.0786,36.2076,35.7612,36.0786,0.45,0.14,0.00,10.54,2.76,2.22,26.1566,21.0304,5.13,47.19,10.86,18.5827,25.3860\n6/29/2009,36.1580,36.4555,35.8307,36.1580,0.62,0.25,0.00,10.41,2.81,2.06,26.9678,19.7687,7.20,46.74,15.40,18.3556,25.2702\n6/30/2009,36.0885,36.4359,35.8207,36.0885,0.62,0.00,0.01,10.29,2.61,1.92,25.3548,18.6835,6.67,44.04,15.15,18.1266,25.1785\n7/1/2009,36.1084,36.5448,36.0985,36.1084,0.46,0.11,0.00,10.01,2.53,1.78,25.2869,17.8316,7.46,43.12,17.29,18.0668,24.6527\n7/2/2009,35.3149,35.8107,35.2156,35.3149,0.89,0.00,0.88,10.19,2.35,2.54,23.0703,24.9370,1.87,48.01,3.89,17.0541,23.1918\n7/6/2009,35.1263,35.2552,34.7593,35.1263,0.56,0.00,0.46,10.01,2.18,2.81,21.7902,28.1103,6.32,49.90,12.67,16.7406,22.1039\n7/7/2009,34.2534,35.2058,34.2335,34.2534,0.97,0.00,0.53,10.27,2.03,3.14,19.7273,30.5687,10.84,50.30,21.56,17.0845,21.3563\n7/8/2009,34.4320,34.5908,34.0252,34.4320,0.57,0.00,0.21,10.10,1.88,3.12,18.6228,30.9192,12.30,49.54,24.82,17.6370,20.7788\n7/9/2009,34.4915,34.7296,34.3725,34.4915,0.36,0.14,0.00,9.74,1.89,2.90,19.3653,29.7853,10.42,49.15,21.20,17.8915,20.3883\n7/10/2009,34.6403,34.8586,34.2833,34.6403,0.58,0.13,0.00,9.62,1.88,2.69,19.5482,28.0036,8.46,47.55,17.78,17.8837,19.9307\n7/13/2009,35.3049,35.3149,34.2038,35.3049,1.11,0.46,0.00,10.04,2.20,2.50,21.9293,24.9051,2.98,46.83,6.35,17.0601,19.2625\n7/14/2009,35.4338,35.5034,35.1165,35.4338,0.39,0.19,0.00,9.71,2.23,2.32,22.9966,23.9128,0.92,46.91,1.95,15.9811,17.9969\n7/15/2009,36.6243,36.6342,35.8505,36.6243,1.20,1.13,0.00,10.22,3.20,2.16,31.3617,21.1036,10.26,52.47,19.55,16.2361,17.7063\n7/16/2009,37.0608,37.1401,36.4259,37.0608,0.71,0.51,0.00,10.20,3.48,2.00,34.1249,19.6263,14.50,53.75,26.97,17.0031,17.7929\n7/17/2009,37.2592,37.2691,36.8722,37.2592,0.40,0.13,0.00,9.87,3.36,1.86,34.0597,18.8371,15.22,52.90,28.78,17.8442,18.0999\n7/20/2009,37.6162,37.6956,37.3087,37.6162,0.44,0.43,0.00,9.60,3.55,1.73,36.9535,17.9810,18.97,54.93,34.54,19.0365,18.5815\n7/21/2009,37.8742,37.8742,37.3385,37.8742,0.54,0.18,0.00,9.45,3.47,1.60,36.7487,16.9619,19.79,53.71,36.84,20.3081,19.1875\n7/22/2009,38.1917,38.3801,37.8245,38.1917,0.56,0.51,0.00,9.33,3.73,1.49,39.9818,15.9520,24.03,55.93,42.96,21.9262,19.4901\n7/23/2009,39.0347,39.1736,38.0825,39.0347,1.09,0.79,0.00,9.76,4.26,1.38,43.6435,14.1681,29.48,57.81,50.99,24.0019,20.3712\n7/24/2009,38.7372,39.0546,38.4693,38.7372,0.59,0.00,0.00,9.65,3.95,1.28,40.9950,13.3083,27.69,54.30,50.99,25.9292,21.5069\n7/27/2009,39.0347,39.0944,38.5586,39.0347,0.54,0.04,0.00,9.49,3.71,1.19,39.1003,12.5571,26.54,51.66,51.38,27.7474,22.6922\n7/28/2009,39.1538,39.2729,38.6181,39.1538,0.65,0.18,0.00,9.47,3.62,1.11,38.2815,11.6887,26.59,49.97,53.22,29.5666,23.7291\n7/29/2009,39.0249,39.1141,38.6876,39.0249,0.47,0.00,0.00,9.26,3.37,1.03,36.3539,11.1002,25.25,47.45,53.22,31.2560,24.5698\n7/30/2009,39.2530,39.8581,39.1935,39.2530,0.83,0.74,0.00,9.43,3.87,0.95,41.0313,10.1195,30.91,51.15,60.43,33.3400,25.2001\n7/31/2009,39.1339,39.5330,39.0944,39.1339,0.44,0.00,0.10,9.20,3.59,0.99,39.0742,10.7145,28.36,49.79,56.96,35.0272,25.5041\n8/3/2009,39.7193,39.7392,39.3225,39.7193,0.61,0.21,0.00,9.14,3.54,0.91,38.7426,10.0052,28.74,48.75,58.95,36.7360,26.4861\n8/4/2009,39.7193,39.8680,39.4513,39.7193,0.42,0.13,0.00,8.91,3.42,0.85,38.3762,9.5372,28.84,47.91,60.19,38.4113,27.7072\n8/5/2009,39.4117,39.8185,39.1439,39.4117,0.67,0.00,0.31,8.95,3.17,1.10,35.4823,12.2542,23.23,47.74,48.66,39.1433,28.4937\n8/6/2009,39.0644,39.6102,38.9257,39.0644,0.68,0.00,0.22,8.99,2.95,1.24,32.7811,13.7481,19.03,46.53,40.91,39.2692,29.1528\n8/7/2009,39.5605,39.7491,39.2729,39.5605,0.68,0.14,0.00,9.03,2.88,1.15,31.8341,12.7061,19.13,44.54,42.95,39.5317,29.9199\n8/10/2009,39.2827,39.5309,39.0249,39.2827,0.54,0.00,0.25,8.92,2.67,1.31,29.9235,14.7225,15.20,44.65,34.05,39.1400,30.5331\n8/11/2009,38.9454,39.1836,38.7372,38.9454,0.55,0.00,0.29,8.83,2.48,1.51,28.0754,17.0706,11.00,45.15,24.38,38.0855,31.0437\n8/12/2009,39.5506,39.8978,38.8860,39.5506,1.01,0.71,0.00,9.21,3.02,1.40,32.7440,15.1958,17.55,47.94,36.60,37.9797,31.9545\n8/13/2009,39.7689,39.8383,39.3225,39.7689,0.52,0.00,0.00,9.07,2.80,1.30,30.8821,14.3318,16.55,45.21,36.60,37.8815,32.8144\n8/14/2009,39.3126,39.6399,38.9653,39.3126,0.80,0.00,0.36,9.23,2.60,1.56,28.1924,16.9549,11.24,45.15,24.89,36.9536,33.2601\n8/17/2009,38.1717,38.6975,38.1520,38.1717,1.16,0.00,0.81,9.73,2.42,2.27,24.8289,23.2925,1.54,48.12,3.19,34.5421,32.8990\n8/18/2009,38.7174,38.7968,38.3007,38.7174,0.63,0.10,0.00,9.66,2.34,2.10,24.2501,21.7849,2.47,46.04,5.35,32.4573,32.8987\n8/19/2009,38.9852,39.0844,38.2312,38.9852,0.85,0.29,0.00,9.82,2.46,1.95,25.0717,19.8925,5.18,44.96,11.52,30.9617,32.9944\n8/20/2009,39.4415,39.5209,38.8860,39.4415,0.63,0.44,0.00,9.76,2.72,1.81,27.9146,18.5978,9.32,46.51,20.03,30.1809,33.4585\n8/21/2009,39.9671,40.0368,39.4217,39.9671,0.62,0.52,0.00,9.67,3.04,1.68,31.4728,17.4152,14.06,48.89,28.75,30.0790,34.2452\n8/24/2009,39.9276,40.2450,39.7788,39.9276,0.47,0.21,0.00,9.45,3.04,1.56,32.1234,16.5560,15.57,48.68,31.98,30.2148,34.6790\n8/25/2009,40.0468,40.4335,39.9276,40.0468,0.51,0.19,0.00,9.28,3.01,1.45,32.4034,15.6534,16.75,48.06,34.85,30.5462,34.9077\n8/26/2009,39.9771,40.2757,39.7589,39.9771,0.52,0.00,0.17,9.13,2.79,1.52,30.5700,16.6147,13.96,47.18,29.58,30.4769,35.0043\n8/27/2009,40.0763,40.1458,39.3522,40.0763,0.79,0.00,0.41,9.27,2.59,1.82,27.9542,19.5781,8.38,47.53,17.62,29.5587,34.3494\n8/28/2009,40.1161,40.7509,39.8383,40.1161,0.91,0.61,0.00,9.52,3.01,1.69,31.6287,17.7022,13.93,49.33,28.23,29.4638,33.7747\n8/31/2009,39.7093,39.8780,39.4713,39.7093,0.64,0.00,0.37,9.49,2.80,1.93,29.4795,20.3669,9.11,49.85,18.28,28.6651,33.3224\n9/1/2009,38.9653,40.2649,38.8464,38.9653,1.42,0.00,0.62,10.23,2.60,2.42,25.3919,23.6513,1.74,49.04,3.55,26.8711,32.3763\n9/2/2009,38.9356,39.1538,38.7272,38.9356,0.43,0.00,0.12,9.93,2.41,2.37,24.3006,23.8357,0.46,48.14,0.97,25.0207,30.9871\n9/3/2009,39.1935,39.2532,38.7075,39.1935,0.55,0.10,0.00,9.76,2.34,2.20,23.9604,22.5033,1.46,46.46,3.14,23.4575,28.9998\n9/4/2009,40.0368,40.0566,39.2035,40.0368,0.86,0.80,0.00,9.93,2.98,2.04,29.9694,20.5471,9.42,50.52,18.65,23.1143,27.7858\n9/8/2009,40.4137,40.4534,40.1359,40.4137,0.42,0.40,0.00,9.64,3.16,1.89,32.7917,19.6587,13.13,52.45,25.04,23.2517,27.1067\n9/9/2009,40.7609,40.9593,40.2649,40.7609,0.69,0.51,0.00,9.64,3.44,1.76,35.6770,18.2429,17.43,53.92,32.33,23.9004,27.0406\n9/10/2009,41.1478,41.1973,40.6717,41.1478,0.53,0.24,0.00,9.48,3.43,1.63,36.2095,17.2314,18.98,53.44,35.51,24.7298,27.4044\n9/11/2009,41.1874,41.2867,40.8898,41.1874,0.40,0.09,0.00,9.20,3.28,1.52,35.6191,16.4879,19.13,52.11,36.72,25.5859,27.9004\n9/14/2009,41.3461,41.3759,40.8799,41.3461,0.50,0.09,0.00,9.04,3.13,1.41,34.6512,15.5830,19.07,50.23,37.96,26.4697,28.5079\n9/15/2009,41.4750,41.6140,41.2371,41.4750,0.38,0.24,0.00,8.77,3.15,1.31,35.8771,14.9132,20.96,50.79,41.28,27.5273,29.0021\n9/16/2009,42.0802,42.1397,41.5049,42.0802,0.66,0.53,0.00,8.81,3.45,1.21,39.1383,13.7877,25.35,52.93,47.90,28.9823,29.2705\n9/17/2009,42.0703,42.3183,41.8719,42.0703,0.45,0.18,0.00,8.62,3.38,1.13,39.1834,13.0741,26.11,52.26,49.96,30.4809,29.9724\n9/18/2009,42.1406,42.3193,41.9122,42.1406,0.41,0.00,0.00,8.42,3.14,1.05,37.2998,12.4416,24.86,49.74,49.97,31.8734,30.2692\n9/21/2009,42.2696,42.3988,41.8625,42.2696,0.54,0.08,0.00,8.35,2.99,0.97,35.8564,11.6426,24.21,47.50,50.98,33.2379,30.0545\n9/22/2009,42.3492,42.5279,42.1404,42.3492,0.39,0.13,0.00,8.14,2.91,0.90,35.7355,11.0885,24.65,46.82,52.64,34.6236,29.8222\n9/23/2009,42.1505,42.8655,42.0781,42.1505,0.79,0.34,0.00,8.35,3.04,0.84,36.4089,10.0426,26.37,46.45,56.76,36.2049,29.8312\n9/24/2009,41.7732,42.3888,41.4752,41.7732,0.91,0.00,0.60,8.67,2.82,1.38,32.5702,15.9416,16.63,48.51,34.28,36.0672,29.5907\n9/25/2009,41.4059,41.7931,41.2867,41.4059,0.51,0.00,0.19,8.55,2.62,1.47,30.6417,17.2017,13.44,47.84,28.09,35.4975,29.3746\n9/28/2009,42.1107,42.3591,41.5944,42.1107,0.95,0.57,0.00,8.89,3.00,1.37,33.7212,15.3583,18.36,49.08,37.41,35.6344,29.7674\n9/29/2009,41.9221,42.3194,41.7335,41.9221,0.59,0.00,0.00,8.85,2.79,1.27,31.4876,14.3410,17.15,45.83,37.41,35.7616,30.2457\n9/30/2009,41.9519,42.3019,41.3065,41.9519,1.00,0.00,0.43,9.21,2.59,1.60,28.0841,17.4277,10.66,45.51,23.41,34.8797,30.2328\n10/1/2009,40.7107,41.8328,40.7107,40.7107,1.24,0.00,0.60,9.79,2.40,2.09,24.5244,21.3030,3.22,45.83,7.03,32.8904,29.6800\n10/2/2009,40.5916,40.9590,40.4327,40.5916,0.53,0.00,0.28,9.62,2.23,2.22,23.1826,23.0275,0.16,46.21,0.34,30.5650,29.0461\n10/5/2009,40.9192,41.1079,40.5419,40.9192,0.57,0.15,0.00,9.50,2.22,2.06,23.3688,21.6553,1.71,45.02,3.81,28.6537,28.8180\n10/6/2009,41.6440,41.8427,40.9298,41.6440,0.92,0.73,0.00,9.74,2.80,1.91,28.6955,19.6027,9.09,48.30,18.83,27.9517,29.2163\n10/7/2009,41.7633,41.7832,41.4752,41.7633,0.31,0.00,0.00,9.36,2.60,1.77,27.7508,18.9573,8.79,46.71,18.83,27.2999,29.5866\n10/8/2009,41.9420,42.3193,41.8427,41.9420,0.56,0.54,0.00,9.24,2.95,1.65,31.8815,17.8170,14.06,49.70,28.30,27.3713,30.3046\n10/9/2009,42.1803,42.2498,41.7633,42.1803,0.49,0.00,0.08,9.07,2.74,1.61,30.1713,17.7367,12.43,47.91,25.96,27.2702,30.9469\n10/12/2009,42.2696,42.5676,41.9817,42.2696,0.59,0.32,0.00,9.01,2.86,1.49,31.7370,16.5830,15.15,48.32,31.36,27.5624,31.8836\n10/13/2009,42.2795,42.4485,42.0711,42.2795,0.38,0.00,0.00,8.74,2.65,1.39,30.3668,15.8670,14.50,46.23,31.36,27.8338,31.9505\n10/14/2009,42.8555,42.9876,42.5476,42.8555,0.71,0.54,0.00,8.83,3.00,1.29,34.0389,14.5939,19.45,48.63,39.98,28.7016,32.0996\n10/15/2009,42.7561,42.8158,42.5676,42.7561,0.29,0.00,0.00,8.48,2.79,1.20,32.8837,14.0986,18.79,46.98,39.98,29.5075,32.5710\n10/16/2009,42.4781,42.6867,42.1803,42.4781,0.58,0.00,0.39,8.45,2.59,1.50,30.6436,17.7202,12.92,48.36,26.72,29.3084,32.5350\n10/19/2009,42.9052,42.9647,42.2895,42.9052,0.68,0.28,0.00,8.52,2.68,1.39,31.4776,16.3166,15.16,47.79,31.72,29.4808,32.1802\n10/20/2009,42.9151,43.1533,42.6370,42.9151,0.52,0.19,0.00,8.43,2.68,1.29,31.7870,15.3174,16.47,47.10,34.96,29.8724,31.3814\n10/21/2009,42.8356,43.5109,42.7561,42.8356,0.75,0.36,0.00,8.58,2.85,1.20,33.1578,13.9706,19.19,47.13,40.71,30.6467,30.6059\n10/22/2009,43.0044,43.1832,42.4881,43.0044,0.70,0.00,0.27,8.67,2.64,1.38,30.4982,15.9425,14.56,46.44,31.34,30.6964,29.6751\n10/23/2009,42.8257,43.4215,42.7165,42.8257,0.70,0.24,0.00,8.75,2.69,1.28,30.7643,14.6583,16.11,45.42,35.46,31.0366,29.4941\n10/26/2009,42.6867,43.4513,42.4881,42.6867,0.96,0.00,0.23,9.09,2.50,1.42,27.5044,15.6177,11.89,43.12,27.57,30.7886,29.0443\n10/27/2009,42.0413,42.8059,41.8825,42.0413,0.92,0.00,0.61,9.36,2.32,1.92,24.7922,20.5449,4.25,45.34,9.37,29.2586,28.3150\n10/28/2009,41.0980,42.0214,41.0086,41.0980,1.03,0.00,0.87,9.73,2.16,2.66,22.1603,27.3473,5.19,49.51,10.48,27.9170,27.5936\n10/29/2009,41.7931,41.8925,41.2470,41.7931,0.79,0.00,0.00,9.83,2.00,2.47,20.3688,25.1364,4.77,45.51,10.48,26.6713,27.1169\n10/30/2009,40.6711,41.8526,40.6313,40.6711,1.22,0.00,0.62,10.35,1.86,2.91,17.9646,28.1200,10.16,46.08,22.04,26.3403,27.0870\n11/2/2009,40.8399,41.2767,40.3532,40.8399,0.92,0.00,0.28,10.53,1.73,2.98,16.3892,28.2948,11.91,44.68,26.64,26.3620,27.5318\n11/3/2009,40.9689,41.0285,40.5519,40.9689,0.48,0.00,0.00,10.26,1.60,2.77,15.6276,26.9799,11.35,42.61,26.64,26.3821,27.9448\n11/4/2009,41.0384,41.5747,40.9888,41.0384,0.61,0.55,0.00,10.13,2.03,2.57,20.0854,25.3663,5.28,45.45,11.62,25.3276,27.3180\n11/5/2009,42.0512,42.1009,41.4852,42.0512,1.06,0.53,0.00,10.47,2.42,2.39,23.0735,22.7916,0.28,45.87,0.61,23.5624,26.5216\n11/6/2009,42.2995,42.3492,41.7832,42.2995,0.57,0.25,0.00,10.29,2.49,2.22,24.2178,21.5375,2.68,45.76,5.86,22.2977,26.0851\n11/9/2009,43.2030,43.2129,42.5775,43.2030,0.91,0.86,0.00,10.46,3.18,2.06,30.3573,19.6577,10.70,50.01,21.39,22.2331,26.4399\n11/10/2009,43.3122,43.4627,43.0938,43.3122,0.37,0.25,0.00,10.09,3.20,1.91,31.7236,18.9387,12.78,50.66,25.24,22.4476,26.5720\n11/11/2009,43.5903,43.8286,43.3024,43.5903,0.53,0.37,0.00,9.89,3.34,1.77,33.7350,17.9313,15.80,51.67,30.59,23.0290,27.0328\n11/12/2009,43.3421,43.8484,43.2428,43.3421,0.61,0.00,0.06,9.79,3.10,1.71,31.6484,17.4309,14.22,49.08,28.97,23.4533,27.1209\n11/13/2009,43.6995,43.8286,43.3221,43.6995,0.51,0.00,0.00,9.60,2.88,1.58,29.9783,16.5111,13.47,46.49,28.97,23.8472,26.5529\n11/16/2009,44.1464,44.3350,43.8088,44.1464,0.64,0.51,0.00,9.55,3.18,1.47,33.2867,15.4121,17.87,48.70,36.70,24.7656,26.3413\n11/17/2009,44.2854,44.2854,43.9378,44.2854,0.35,0.00,0.00,9.21,2.95,1.37,32.0309,14.8307,17.20,46.86,36.70,25.6183,26.1448\n11/18/2009,44.0401,44.1761,43.7392,44.0401,0.55,0.00,0.20,9.10,2.74,1.47,30.1087,16.1227,13.99,46.23,30.25,25.9493,26.1448\n11/19/2009,43.3520,43.7690,43.0442,43.3520,1.00,0.00,0.70,9.45,2.54,2.06,26.9349,21.7795,5.16,48.71,10.58,24.8517,25.6068\n11/20/2009,43.1336,43.2428,42.9747,43.1336,0.38,0.00,0.07,9.15,2.36,1.98,25.8242,21.6410,4.18,47.47,8.81,23.7061,25.0441\n11/23/2009,43.8286,44.0868,43.5506,43.8286,0.95,0.84,0.00,9.45,3.04,1.84,32.1508,19.4581,12.69,51.61,24.59,23.7696,24.5486\n11/24/2009,43.6796,43.8384,43.4215,43.6796,0.42,0.00,0.13,9.19,2.82,1.84,30.6926,19.9800,10.71,50.67,21.14,23.5818,23.5721\n11/25/2009,43.8683,43.9080,43.6995,43.8683,0.23,0.07,0.00,8.76,2.69,1.71,30.6869,19.4593,11.23,50.15,22.39,23.4966,22.8972\n11/27/2009,43.2030,43.5208,42.5973,43.2030,1.27,0.00,1.10,9.41,2.50,2.69,26.5413,28.5455,2.00,55.09,3.64,22.0782,22.1556\n11/30/2009,43.2528,43.3122,42.8059,43.2528,0.51,0.00,0.00,9.24,2.32,2.49,25.0875,26.9818,1.89,52.07,3.64,20.7610,21.6043\n12/1/2009,43.6995,43.9876,43.5704,43.6995,0.73,0.68,0.00,9.32,2.83,2.32,30.3578,24.8539,5.50,55.21,9.97,19.9901,21.5096\n12/2/2009,43.7591,44.1761,43.6697,43.7591,0.51,0.19,0.00,9.16,2.82,2.15,30.7374,23.4797,7.26,54.22,13.39,19.5184,21.4859\n12/3/2009,43.5803,44.1861,43.5704,43.5803,0.62,0.00,0.10,9.12,2.61,2.10,28.6623,22.9833,5.68,51.65,11.00,18.9097,21.3785\n12/4/2009,43.8088,44.4144,43.3520,43.8088,1.06,0.23,0.00,9.53,2.66,1.95,27.8627,20.4214,7.44,48.28,15.41,18.6598,21.7127\n12/7/2009,43.6002,43.9776,43.5109,43.6002,0.47,0.00,0.00,9.32,2.47,1.81,26.4670,19.3984,7.07,45.87,15.41,18.4278,22.0231\n12/8/2009,43.3341,43.6896,43.0540,43.3341,0.64,0.00,0.46,9.29,2.29,2.14,24.6555,22.9906,1.66,47.65,3.49,17.3611,21.6552\n12/9/2009,43.7690,43.8088,43.0143,43.7690,0.79,0.12,0.00,9.42,2.25,1.98,23.8413,21.0511,2.79,44.89,6.22,16.5650,20.7084\n12/10/2009,43.9876,44.2257,43.9279,43.9876,0.46,0.42,0.00,9.20,2.50,1.84,27.1886,20.0064,7.18,47.19,15.22,16.4688,20.0875\n12/11/2009,43.8188,44.2754,43.6400,43.8188,0.64,0.00,0.29,9.18,2.32,2.00,25.3067,21.7577,3.55,47.06,7.54,15.8311,19.8003\n12/14/2009,44.2357,44.2854,43.8782,44.2357,0.47,0.01,0.00,8.99,2.17,1.85,24.1046,20.6286,3.48,44.73,7.77,15.2553,19.4185\n12/15/2009,43.9876,44.3549,43.8584,43.9876,0.50,0.07,0.00,8.85,2.08,1.72,23.5373,19.4707,4.07,43.01,9.46,14.8410,19.1688\n12/16/2009,44.0469,44.3846,43.9776,44.0469,0.41,0.03,0.00,8.62,1.96,1.60,22.7705,18.5514,4.22,41.32,10.21,14.5103,18.2942\n12/17/2009,43.5109,43.8981,43.4513,43.5109,0.60,0.00,0.53,8.60,1.82,2.01,21.1936,23.3862,2.19,44.58,4.92,13.8251,17.2931\n12/18/2009,44.2246,44.2446,43.7671,44.2246,0.73,0.35,0.00,8.72,2.04,1.87,23.3841,21.4184,1.97,44.80,4.39,13.1510,16.5706\n12/21/2009,44.7220,44.8911,44.4335,44.7220,0.67,0.65,0.00,8.76,2.54,1.73,28.9829,19.7894,9.19,48.77,18.85,13.5581,16.5383\n12/22/2009,44.9905,45.0502,44.7916,44.9905,0.33,0.16,0.00,8.47,2.52,1.61,29.7386,19.0222,10.72,48.76,21.98,14.1595,16.5346\n12/23/2009,45.3188,45.3287,44.9707,45.3188,0.36,0.28,0.00,8.22,2.62,1.50,31.8318,18.1937,13.64,50.03,27.26,15.0954,16.8776\n12/24/2009,45.7366,45.7366,45.3586,45.7366,0.42,0.41,0.00,8.05,2.84,1.39,35.2469,17.2494,18.00,52.50,34.28,16.4660,17.4469\n12/28/2009,45.9753,46.0548,45.6968,45.9753,0.36,0.32,0.00,7.83,2.95,1.29,37.6984,16.4610,21.24,54.16,39.21,18.0907,17.7259\n12/29/2009,45.7863,46.0052,45.7466,45.7863,0.26,0.00,0.00,7.53,2.74,1.20,36.4041,15.8958,20.51,52.30,39.21,19.5995,18.0822\n12/30/2009,45.9256,46.0151,45.7167,45.9256,0.30,0.00,0.03,7.29,2.55,1.14,34.9144,15.6553,19.26,50.57,38.08,20.9198,18.6943\n12/31/2009,45.5078,46.0301,45.5078,45.5078,0.52,0.00,0.21,7.29,2.36,1.27,32.4142,17.3984,15.02,49.81,30.14,21.5787,18.7049\n1/4/2010,46.1743,46.2389,46.0251,46.1743,0.73,0.21,0.00,7.50,2.40,1.18,32.0386,15.7033,16.34,47.74,34.22,22.4814,18.8683\n1/5/2010,46.1743,46.2538,45.9157,46.1743,0.34,0.00,0.11,7.31,2.23,1.20,30.5559,16.4740,14.08,47.03,29.94,23.0143,18.9277\n1/6/2010,45.8957,46.3036,45.8262,45.8957,0.48,0.00,0.09,7.26,2.07,1.21,28.5471,16.6234,11.92,45.17,26.40,23.2559,18.8831\n1/7/2010,45.9256,46.0251,45.6769,45.9256,0.35,0.00,0.15,7.09,1.92,1.27,27.1453,17.9126,9.23,45.06,20.49,23.0584,18.4418\n1/8/2010,46.3036,46.3036,45.6868,46.3036,0.62,0.28,0.00,7.20,2.07,1.18,28.6876,16.3784,12.31,45.07,27.31,23.3624,18.2567\n1/11/2010,46.1146,46.3931,45.8759,46.1146,0.52,0.09,0.00,7.20,2.01,1.10,27.8704,15.2025,12.67,43.07,29.41,23.7944,18.6762\n1/12/2010,45.5376,45.8957,45.2890,45.5376,0.83,0.00,0.59,7.52,1.86,1.60,24.8086,21.3420,3.47,46.15,7.51,22.6313,18.3954\n1/13/2010,46.1046,46.2439,45.3685,46.1046,0.88,0.35,0.00,7.85,2.08,1.49,26.4769,18.9632,7.51,45.44,16.54,22.1959,18.6456\n1/14/2010,46.1444,46.2737,45.9753,46.1444,0.30,0.03,0.00,7.59,1.96,1.38,25.8287,18.2177,7.61,44.05,17.28,21.8447,19.1553\n1/15/2010,45.6073,46.3036,45.4083,45.6073,0.90,0.00,0.57,7.94,1.82,1.85,22.9178,23.3019,0.38,46.22,0.83,20.3437,19.2172\n1/19/2010,46.3434,46.3931,45.7068,46.3434,0.79,0.09,0.00,8.16,1.78,1.72,21.8080,21.0587,0.75,42.87,1.75,19.0155,19.3075\n1/20/2010,45.6769,46.3572,45.1896,45.6769,1.17,0.00,0.52,8.75,1.65,2.11,18.8970,24.1605,5.26,43.06,12.22,18.5304,19.7251\n1/21/2010,45.2492,46.1046,45.0602,45.2492,1.04,0.00,0.13,9.17,1.53,2.09,16.7440,22.8194,6.08,39.56,15.36,18.3036,19.9412\n1/22/2010,43.9263,45.2392,43.8069,43.9263,1.44,0.00,1.25,9.95,1.43,3.20,14.3179,32.1036,17.79,46.42,38.31,19.7329,21.1071\n1/25/2010,44.0755,44.3639,43.8865,44.0755,0.48,0.00,0.00,9.72,1.32,2.97,13.6147,30.5269,16.91,44.14,38.31,21.0601,22.0372\n1/26/2010,44.1152,44.6524,43.8169,44.1152,0.84,0.29,0.00,9.86,1.52,2.76,15.3867,27.9407,12.55,43.33,28.97,21.6254,22.4407\n1/27/2010,44.4635,44.6126,43.7771,44.4635,0.84,0.00,0.04,9.99,1.41,2.60,14.1002,26.0029,11.90,40.10,29.68,22.2007,22.6296\n1/28/2010,43.3194,44.1949,43.0908,43.3194,1.37,0.00,0.69,10.65,1.31,3.10,12.2832,29.0949,16.81,41.38,40.63,23.5171,23.4397\n1/29/2010,42.5635,43.7869,42.4044,42.5635,1.38,0.00,0.69,11.27,1.21,3.56,10.7768,31.6155,20.84,42.39,49.16,25.3485,24.5714\n2/1/2010,43.0310,43.0515,42.6530,43.0310,0.49,0.00,0.00,10.96,1.13,3.31,10.2968,30.2074,19.91,40.50,49.16,27.0491,24.8402\n2/2/2010,43.4189,43.5483,42.8022,43.4189,0.75,0.50,0.00,10.92,1.54,3.07,14.1428,28.1434,14.00,42.29,33.11,27.4819,24.8389\n2/3/2010,43.6576,43.7372,43.1901,43.6576,0.55,0.19,0.00,10.69,1.62,2.85,15.1864,26.7026,11.52,41.89,27.49,27.4827,24.6637\n2/4/2010,42.3944,43.4289,42.3944,42.3944,1.26,0.00,0.80,11.19,1.51,3.45,13.4716,30.8003,17.33,44.27,39.14,28.3155,24.3296\n2/5/2010,42.7524,42.7923,41.8969,42.7524,0.90,0.00,0.50,11.28,1.40,3.70,12.4025,32.7653,20.36,45.17,45.08,29.5131,24.2643\n2/8/2010,42.4442,42.9514,42.4143,42.4442,0.54,0.16,0.00,11.01,1.46,3.43,13.2422,31.1675,17.93,44.41,40.36,30.2881,24.4093\n2/9/2010,42.8818,43.2797,42.5337,42.8818,0.84,0.33,0.00,11.06,1.68,3.19,15.2097,28.8137,13.60,44.02,30.90,30.3320,24.3178\n2/10/2010,42.7923,43.0808,42.5237,42.7923,0.56,0.00,0.01,10.83,1.56,2.97,14.4273,27.4238,13.00,41.85,31.05,30.3836,25.0582\n2/11/2010,43.4388,43.5582,42.5337,43.4388,1.02,0.48,0.00,11.08,1.93,2.76,17.4017,24.8883,7.49,42.29,17.70,29.4778,25.2690\n2/12/2010,43.5283,43.6478,42.9315,43.5283,0.72,0.09,0.00,11.01,1.88,2.56,17.0832,23.2685,6.19,40.35,15.33,28.4671,25.0463\n2/16/2010,44.0854,44.1152,43.6179,44.0854,0.59,0.47,0.00,10.81,2.21,2.38,20.4807,22.0047,1.52,42.49,3.59,26.6900,24.4454\n2/17/2010,44.3341,44.3341,44.0257,44.3341,0.31,0.22,0.00,10.34,2.27,2.21,21.9864,21.3486,0.64,43.34,1.47,24.8887,24.2029\n2/18/2010,44.6126,44.6921,44.2146,44.6126,0.48,0.36,0.00,10.08,2.47,2.05,24.4961,20.3375,4.16,44.83,9.28,23.7735,24.5610\n2/19/2010,44.5927,44.8115,44.3838,44.5927,0.43,0.12,0.00,9.79,2.41,1.90,24.6455,19.4489,5.20,44.09,11.79,22.9172,24.9831\n2/22/2010,44.5032,44.7916,44.3241,44.5032,0.47,0.00,0.06,9.56,2.24,1.83,23.4400,19.1222,4.32,42.56,10.14,22.0048,24.7434\n2/23/2010,43.9263,44.5032,43.7174,43.9263,0.79,0.00,0.61,9.66,2.08,2.30,21.5334,23.8469,2.31,45.38,5.10,20.7972,24.1400\n2/24/2010,44.3739,44.5529,44.0854,44.3739,0.63,0.05,0.00,9.60,1.98,2.14,20.6453,22.2900,1.64,42.94,3.83,19.5853,23.9504\n2/25/2010,44.3639,44.4635,43.5980,44.3639,0.87,0.00,0.49,9.78,1.84,2.47,18.8177,25.3019,6.48,44.12,14.70,19.2361,24.3746\n2/26/2010,44.5230,44.6225,44.1649,44.5230,0.46,0.16,0.00,9.54,1.87,2.30,19.5821,24.0878,4.51,43.67,10.32,18.5991,24.4436\n3/1/2010,45.1696,45.2492,44.7121,45.1696,0.73,0.63,0.00,9.58,2.36,2.13,24.6387,22.2621,2.38,46.90,5.07,17.6325,23.9823\n3/2/2010,45.3089,45.6073,45.2094,45.3089,0.44,0.36,0.00,9.33,2.55,1.98,27.3196,21.2183,6.10,48.54,12.57,17.2710,23.8273\n3/3/2010,45.3586,45.5775,45.1896,45.3586,0.39,0.00,0.02,9.06,2.37,1.86,26.1494,20.5280,5.62,46.68,12.04,16.8975,23.1877\n3/4/2010,45.5078,45.5675,45.1596,45.5078,0.41,0.00,0.03,8.82,2.20,1.76,24.9396,19.9186,5.02,44.86,11.19,16.4901,22.4786\n3/5/2010,46.1942,46.2937,45.7466,46.1942,0.79,0.73,0.00,8.97,2.77,1.63,30.8484,18.1740,12.67,49.02,25.85,17.1589,21.9245\n3/8/2010,46.2837,46.3931,46.1942,46.2837,0.20,0.10,0.00,8.53,2.67,1.51,31.2944,17.7503,13.54,49.04,27.62,17.9059,21.3973\n3/9/2010,46.5423,46.8009,46.1543,46.5423,0.65,0.41,0.00,8.57,2.89,1.41,33.6922,16.4108,17.28,50.10,34.49,19.0906,21.4320\n3/10/2010,46.9203,47.0298,46.5523,46.9203,0.49,0.23,0.00,8.44,2.91,1.31,34.4578,15.4633,18.99,49.92,38.05,20.4447,21.6810\n3/11/2010,47.0993,47.0993,46.7313,47.0993,0.37,0.07,0.00,8.21,2.77,1.21,33.7597,14.7701,18.99,48.53,39.13,21.7794,21.8921\n3/12/2010,47.1093,47.2784,46.8507,47.1093,0.43,0.18,0.00,8.05,2.75,1.13,34.1909,13.9853,20.21,48.18,41.94,23.2195,22.0084\n3/15/2010,46.9899,47.1292,46.6617,46.9899,0.47,0.00,0.19,7.94,2.56,1.23,32.1784,15.5418,16.64,47.72,34.86,24.0512,21.8183\n3/16/2010,47.2884,47.3579,46.9800,47.2884,0.38,0.23,0.00,7.75,2.60,1.15,33.5598,14.7842,18.78,48.34,38.84,25.1073,22.1717\n3/17/2010,47.4177,47.6464,47.2784,47.4177,0.37,0.29,0.00,7.57,2.70,1.06,35.7402,14.0653,21.67,49.81,43.52,26.4225,22.5108\n3/18/2010,47.5768,47.6265,47.3480,47.5768,0.28,0.00,0.00,7.31,2.51,0.99,34.3777,13.5290,20.85,47.91,43.52,27.6437,22.6381\n3/19/2010,47.2896,47.7476,47.1203,47.2896,0.63,0.00,0.23,7.41,2.33,1.15,31.4677,15.4564,16.01,46.92,34.12,28.1064,22.6887\n3/22/2010,47.7177,47.9069,47.0505,47.7177,0.86,0.16,0.00,7.74,2.32,1.06,30.0437,13.7457,16.30,43.79,37.22,28.7573,22.8274\n3/23/2010,48.0488,48.0961,47.5683,48.0488,0.53,0.19,0.00,7.71,2.35,0.99,30.4408,12.8051,17.64,43.25,40.78,29.6160,23.0531\n3/24/2010,47.8173,47.9667,47.7078,47.8173,0.34,0.00,0.00,7.50,2.18,0.92,29.0573,12.2231,16.83,41.28,40.78,30.4135,23.7862\n3/25/2010,47.7476,48.3949,47.6978,47.7476,0.70,0.43,0.00,7.66,2.45,0.85,32.0014,11.1114,20.89,43.11,48.45,31.7021,24.8040\n3/26/2010,47.7974,48.1260,47.5385,47.7974,0.59,0.00,0.16,7.70,2.28,0.95,29.5611,12.3317,17.23,41.89,41.13,32.3753,25.7329\n3/29/2010,48.0264,48.1956,47.8969,48.0264,0.40,0.07,0.00,7.55,2.18,0.88,28.9240,11.6815,17.24,40.61,42.46,33.0959,26.7703\n3/30/2010,48.1858,48.3451,47.8571,48.1858,0.49,0.15,0.00,7.50,2.18,0.82,29.0353,10.9215,18.11,39.96,45.33,33.9700,27.8747\n3/31/2010,47.9567,48.2454,47.8671,47.9567,0.38,0.00,0.00,7.34,2.02,0.76,27.5395,10.3589,17.18,37.90,45.33,34.7817,29.0006\n4/1/2010,47.9567,48.4944,47.5883,47.9567,0.91,0.00,0.28,7.72,1.88,0.99,24.3092,12.7530,11.56,37.06,31.18,34.5245,29.2878\n4/5/2010,48.4048,48.5143,47.9367,48.4048,0.58,0.02,0.00,7.75,1.76,0.91,22.7544,11.8026,10.95,34.56,31.69,34.3222,29.7147\n4/6/2010,48.5442,48.6936,48.1858,48.5442,0.51,0.18,0.00,7.70,1.82,0.85,23.5818,11.0247,12.56,34.61,36.29,34.4624,30.4424\n4/7/2010,48.4247,48.6637,48.1658,48.4247,0.50,0.00,0.02,7.65,1.69,0.81,22.0475,10.5687,11.48,32.62,35.19,34.5146,31.0791\n4/8/2010,48.5343,48.6139,48.0363,48.5343,0.58,0.00,0.13,7.68,1.57,0.88,20.3900,11.4597,8.93,31.85,28.04,34.0521,31.0792\n4/9/2010,48.8230,48.8429,48.4297,48.8230,0.41,0.23,0.00,7.55,1.68,0.82,22.3078,10.8323,11.48,33.14,34.63,34.0931,31.4252\n4/12/2010,48.8629,48.9923,48.7334,48.8629,0.26,0.15,0.00,7.27,1.71,0.76,23.5688,10.4464,13.12,34.02,38.58,34.4135,32.0148\n4/13/2010,49.1118,49.1416,48.6538,49.1118,0.49,0.15,0.00,7.24,1.74,0.70,24.0433,9.7422,14.30,33.79,42.33,34.9789,32.6962\n4/14/2010,49.6993,49.7093,49.2910,49.6993,0.60,0.57,0.00,7.32,2.18,0.65,29.8387,8.9467,20.89,38.79,53.87,36.3279,34.0150\n4/15/2010,49.9184,49.9781,49.6594,49.9184,0.32,0.27,0.00,7.11,2.30,0.61,32.2808,8.5458,23.73,40.83,58.14,37.8856,35.1305\n4/16/2010,49.3209,49.9084,48.9923,49.3209,0.93,0.00,0.67,7.53,2.13,1.23,28.3111,16.3530,11.96,44.66,26.77,37.0919,35.0939\n4/19/2010,49.2910,49.4503,48.6936,49.2910,0.76,0.00,0.30,7.75,1.98,1.44,25.5468,18.6106,6.94,44.16,15.71,35.5645,34.7672\n4/20/2010,49.5400,49.6694,49.2213,49.5400,0.45,0.22,0.00,7.64,2.06,1.34,26.9154,17.5197,9.40,44.44,21.14,34.5345,34.6581\n4/21/2010,49.8188,49.9781,49.5151,49.8188,0.46,0.31,0.00,7.56,2.22,1.24,29.3500,16.4469,12.90,45.80,28.17,34.0802,34.3024\n4/22/2010,50.0976,50.1474,49.0520,50.0976,1.10,0.00,0.46,8.12,2.06,1.62,25.3889,19.9329,5.46,45.32,12.04,32.5058,33.4140\n4/23/2010,50.3067,50.3565,49.8785,50.3067,0.48,0.21,0.00,8.01,2.12,1.50,26.4837,18.7441,7.74,45.23,17.11,31.4063,32.9343\n4/26/2010,50.1972,50.4362,50.0876,50.1972,0.35,0.08,0.00,7.79,2.05,1.39,26.3217,17.9054,8.42,44.23,19.03,30.5223,32.5184\n4/27/2010,49.1318,50.2171,49.0023,49.1318,1.21,0.00,1.09,8.45,1.90,2.38,22.5372,28.1760,5.64,50.71,11.12,29.1363,31.5942\n4/28/2010,49.1616,49.4205,48.7732,49.1616,0.65,0.00,0.23,8.49,1.77,2.44,20.8195,28.7260,7.91,49.55,15.96,28.1950,31.1441\n4/29/2010,50.0180,50.1176,49.4005,50.0180,0.96,0.70,0.00,8.84,2.34,2.27,26.4523,25.6203,0.83,52.07,1.60,26.2952,30.3543\n4/30/2010,49.0296,50.0778,48.9923,49.0296,1.09,0.00,0.41,9.30,2.17,2.51,23.3635,27.0197,3.66,50.38,7.26,24.9353,29.9571\n5/3/2010,49.7192,49.9582,49.2213,49.7192,0.93,0.00,0.00,9.56,2.02,2.33,21.0943,24.3954,3.30,45.49,7.26,23.6726,30.0002\n5/4/2010,48.2256,49.1118,47.8770,48.2256,1.84,0.00,1.34,10.72,1.87,3.51,17.4694,32.7431,15.27,50.21,30.42,24.1544,31.0200\n5/5/2010,47.9767,48.2952,47.4389,47.9767,0.86,0.00,0.44,10.81,1.74,3.70,16.0856,34.2021,18.12,50.29,36.03,25.0023,31.0471\n5/6/2010,46.3734,48.1161,41.3746,46.3734,6.74,0.00,6.06,16.78,1.61,9.50,9.6231,56.6011,46.98,66.22,70.94,28.2834,31.9240\n5/7/2010,45.2183,46.6025,44.0964,45.2183,2.51,0.00,0.00,18.09,1.50,8.82,8.2898,48.7588,40.47,57.05,70.94,31.3302,32.9323\n5/10/2010,47.5683,47.5982,47.1103,47.5683,2.38,1.00,0.00,19.18,2.39,8.19,12.4535,42.7073,30.25,55.16,54.85,33.0099,33.5451\n5/11/2010,47.5185,48.1858,47.0007,47.5185,1.19,0.59,0.00,18.99,2.81,7.60,14.7705,40.0422,25.27,54.81,46.11,33.9453,33.2256\n5/12/2010,48.4147,48.4545,47.6978,48.4147,0.94,0.27,0.00,18.57,2.87,7.06,15.4729,38.0240,22.55,53.50,42.15,34.5316,32.9690\n5/13/2010,47.6480,48.5840,47.5286,47.6480,1.06,0.00,0.17,18.30,2.67,6.73,14.5805,36.7556,22.18,51.34,43.20,35.1505,32.8364\n5/14/2010,46.7319,47.3194,46.1842,46.7319,1.46,0.00,1.34,18.46,2.48,7.59,13.4241,41.1247,27.70,54.55,50.78,36.2670,32.7017\n5/17/2010,46.8812,47.0705,45.8756,46.8812,1.19,0.00,0.31,18.33,2.30,7.36,12.5491,40.1276,27.58,52.68,52.35,37.4161,32.8055\n5/18/2010,46.2340,47.3791,46.0249,46.2340,1.35,0.31,0.00,18.38,2.44,6.83,13.3037,37.1707,23.87,50.47,47.29,38.1210,32.2081\n5/19/2010,45.8656,46.4332,45.3577,45.8656,1.08,0.00,0.67,18.14,2.27,7.01,12.5149,38.6449,26.13,51.16,51.08,39.0463,31.9908\n5/20/2010,44.1628,45.0889,44.0632,44.1628,1.80,0.00,1.29,18.65,2.11,7.80,11.3052,41.8517,30.55,53.16,57.46,40.3619,32.0172\n5/21/2010,44.6507,45.4474,43.3065,44.6507,2.14,0.00,0.76,19.46,1.96,8.00,10.0612,41.1357,31.07,51.20,60.70,41.8144,32.9844\n5/24/2010,44.4714,45.1337,44.4516,44.4714,0.68,0.00,0.00,18.75,1.82,7.43,9.6952,39.6391,29.94,49.33,60.70,43.1631,34.0827\n5/25/2010,44.5113,44.5710,43.0476,44.5113,1.52,0.00,1.40,18.93,1.69,8.30,8.9150,43.8654,34.95,52.78,66.22,44.8099,36.5466\n5/26/2010,44.0134,45.3776,43.9338,44.0134,1.44,0.81,0.00,19.02,2.37,7.71,12.4784,40.5362,28.06,53.01,52.92,45.3895,38.3598\n5/27/2010,45.6763,45.6963,44.8996,45.6763,1.68,0.32,0.00,19.35,2.52,7.16,13.0402,37.0104,23.97,50.05,47.89,45.5682,39.2891\n5/28/2010,45.4075,45.7958,45.0092,45.4075,0.79,0.10,0.00,18.75,2.44,6.65,13.0238,35.4579,22.43,48.48,46.27,45.6186,39.7820\n6/1/2010,44.9892,46.0547,44.9394,44.9892,1.12,0.26,0.00,18.53,2.53,6.17,13.6371,33.3236,19.69,46.96,41.92,45.3545,39.9431\n6/2/2010,46.0547,46.0847,44.9394,46.0547,1.15,0.03,0.00,18.35,2.38,5.73,12.9495,31.2438,18.29,44.19,41.40,45.0718,40.1111\n6/3/2010,46.4929,46.5725,45.8854,46.4929,0.69,0.49,0.00,17.73,2.69,5.32,15.1994,30.0327,14.83,45.23,32.79,44.1948,40.2309\n6/4/2010,44.9021,46.0945,44.7478,44.9021,1.75,0.00,1.14,18.21,2.50,6.08,13.7424,33.4026,19.66,47.14,41.70,44.0167,40.7164\n6/7/2010,44.0831,45.2681,44.0334,44.0831,1.23,0.00,0.71,18.14,2.32,6.36,12.8070,35.0673,22.26,47.87,46.50,44.1939,41.1575\n6/8/2010,44.0034,44.2923,43.4060,44.0034,0.89,0.00,0.63,17.73,2.16,6.53,12.1668,36.8529,24.69,49.02,50.36,44.6343,41.8403\n6/9/2010,43.6350,44.7205,43.5056,43.6350,1.21,0.43,0.00,17.68,2.43,6.07,13.7528,34.3204,20.57,48.07,42.78,44.5021,42.4320\n6/10/2010,44.8798,44.9296,44.0532,44.8798,1.29,0.21,0.00,17.71,2.47,5.63,13.9282,31.8117,17.88,45.74,39.10,44.1161,42.9652\n6/11/2010,45.3079,45.3478,44.4216,45.3079,0.93,0.42,0.00,17.37,2.71,5.23,15.5929,30.1156,14.52,45.71,31.77,43.2344,43.1987\n6/14/2010,45.2980,46.0448,45.2183,45.2980,0.83,0.70,0.00,16.96,3.21,4.86,18.9432,28.6478,9.70,47.59,20.39,41.6028,43.2063\n6/15/2010,46.5128,46.5725,45.2613,46.5128,1.31,0.53,0.00,17.06,3.51,4.51,20.5807,26.4456,5.86,47.03,12.47,39.5220,42.4557\n6/16/2010,46.7020,46.9410,46.3037,46.7020,0.64,0.37,0.00,16.48,3.63,4.19,22.0212,25.4227,3.40,47.44,7.17,37.2111,41.3897\n6/17/2010,46.8514,46.9809,46.4431,46.8514,0.54,0.04,0.00,15.84,3.41,3.89,21.5253,24.5594,3.03,46.08,6.58,35.0234,40.3210\n6/18/2010,46.8906,47.2298,46.7509,46.8906,0.48,0.25,0.00,15.18,3.41,3.61,22.4856,23.7849,1.30,46.27,2.81,32.7223,39.0384\n6/21/2010,46.4915,47.5690,46.2221,46.4915,1.35,0.00,0.53,15.45,3.17,3.88,20.5250,25.1342,4.61,45.66,10.09,31.1061,38.0889\n6/22/2010,46.1324,47.0303,46.0426,46.1324,0.99,0.00,0.18,15.33,2.94,3.78,19.2027,24.6858,5.48,43.89,12.49,29.7766,36.9857\n6/23/2010,45.9428,46.3618,45.5836,45.9428,0.78,0.00,0.46,15.01,2.73,3.97,18.2074,26.4634,8.26,44.67,18.48,28.9698,36.4932\n6/24/2010,45.2444,45.8829,45.0948,45.2444,0.85,0.00,0.49,14.79,2.54,4.18,17.1635,28.2510,11.09,45.41,24.41,28.6444,36.4191\n6/25/2010,45.1646,45.5537,44.8454,45.1646,0.71,0.00,0.25,14.44,2.36,4.13,16.3217,28.5923,12.27,44.91,27.32,28.5498,36.5920\n6/28/2010,45.0050,45.4440,44.7057,45.0050,0.74,0.00,0.14,14.15,2.19,3.97,15.4701,28.0877,12.62,43.56,28.97,28.5797,36.5409\n6/29/2010,43.2690,44.3565,42.9697,43.2690,2.04,0.00,1.74,15.17,2.03,5.43,13.3950,35.7612,22.37,49.16,45.50,29.7883,36.9522\n6/30/2010,42.6106,43.5683,42.5407,42.6106,1.03,0.00,0.43,15.12,1.89,5.47,12.4844,36.1682,23.68,48.65,48.68,31.1376,37.1860\n7/1/2010,42.4909,42.8600,41.6728,42.4909,1.19,0.00,0.87,15.22,1.75,5.94,11.5109,39.0484,27.54,50.56,54.47,32.8039,37.2034\n7/2/2010,42.3711,42.7218,41.9920,42.3711,0.73,0.00,0.00,14.87,1.63,5.52,10.9459,37.1316,26.19,48.08,54.47,34.3512,36.9366\n7/6/2010,42.5008,43.2690,42.1516,42.5008,1.12,0.55,0.00,14.92,2.06,5.13,13.7932,34.3512,20.56,48.14,42.70,34.9476,36.0793\n7/7/2010,43.8577,43.9075,42.6006,43.8577,1.41,0.64,0.00,15.26,2.55,4.76,16.7052,31.1853,14.48,47.89,30.24,34.6110,34.8172\n7/8/2010,44.0971,44.2767,43.5783,44.0971,0.70,0.37,0.00,14.87,2.74,4.42,18.4033,29.7207,11.32,48.12,23.52,33.8186,33.2705\n7/9/2010,44.5161,44.5261,43.9774,44.5161,0.55,0.25,0.00,14.36,2.79,4.10,19.4371,28.5849,9.15,48.02,19.05,32.7637,31.9349\n7/12/2010,44.6458,44.9252,44.3565,44.6458,0.57,0.40,0.00,13.90,2.99,3.81,21.5129,27.4155,5.90,48.93,12.06,31.2851,30.5308\n7/13/2010,45.2245,45.3941,44.6957,45.2245,0.75,0.47,0.00,13.66,3.25,3.54,23.7677,25.9132,2.15,49.68,4.32,29.3589,29.1644\n7/14/2010,45.4539,45.7034,45.1347,45.4539,0.57,0.31,0.00,13.25,3.32,3.29,25.0819,24.8010,0.28,49.88,0.56,27.3021,27.9732\n7/15/2010,45.4938,45.6335,44.8853,45.4938,0.75,0.00,0.25,13.05,3.09,3.30,23.6440,25.2901,1.65,48.93,3.36,25.5922,27.0710\n7/16/2010,44.2368,45.5219,44.1969,44.2368,1.33,0.00,0.69,13.44,2.87,3.75,21.3138,27.9181,6.60,49.23,13.41,24.7224,26.6510\n7/19/2010,44.6159,44.7057,43.9973,44.6159,0.71,0.00,0.20,13.19,2.66,3.68,20.1693,27.9319,7.76,48.10,16.14,24.1092,26.9488\n7/20/2010,45.1546,45.1546,43.7579,45.1546,1.40,0.45,0.00,13.65,2.92,3.42,21.3944,25.0732,3.68,46.47,7.92,22.9526,27.0451\n7/21/2010,44.5361,45.6535,44.4563,44.5361,1.20,0.50,0.00,13.87,3.21,3.18,23.1449,22.9088,0.24,46.05,0.51,21.3498,27.0768\n7/22/2010,45.6635,45.8730,45.1347,45.6635,1.34,0.22,0.00,14.22,3.20,2.95,22.5123,20.7543,1.76,43.27,4.06,20.1150,27.2331\n7/23/2010,45.9528,45.9927,45.2744,45.9528,0.72,0.12,0.00,13.92,3.09,2.74,22.2105,19.6832,2.53,41.89,6.03,19.1091,27.0283\n7/26/2010,46.3319,46.3518,45.8031,46.3319,0.55,0.36,0.00,13.47,3.23,2.54,23.9713,18.8816,5.09,42.85,11.88,18.5925,26.6018\n7/27/2010,46.3119,46.6112,46.1024,46.3119,0.51,0.26,0.00,13.02,3.26,2.36,25.0269,18.1437,6.88,43.17,15.94,18.4034,26.1110\n7/28/2010,45.9428,46.4716,45.7732,45.9428,0.70,0.00,0.33,12.79,3.03,2.52,23.6601,19.7271,3.93,43.39,9.06,17.7363,25.2500\n7/29/2010,45.6036,46.3020,45.1447,45.6036,1.16,0.00,0.63,13.03,2.81,2.97,21.5589,22.7981,1.24,44.36,2.79,16.6690,23.9770\n7/30/2010,45.7034,45.9827,44.9651,45.7034,1.02,0.00,0.18,13.12,2.61,2.94,19.8865,22.3987,2.51,42.29,5.94,15.9027,22.6308\n8/2/2010,46.5614,46.6811,46.1025,46.5614,0.98,0.70,0.00,13.16,3.12,2.73,23.7164,20.7345,2.98,44.45,6.71,15.2460,21.2740\n8/3/2010,46.3618,46.5913,46.1423,46.3618,0.45,0.00,0.00,12.67,2.90,2.53,22.8758,19.9996,2.88,42.88,6.71,14.6361,20.1142\n8/4/2010,46.8287,46.8806,46.3918,46.8287,0.52,0.29,0.00,12.28,2.98,2.35,24.2650,19.1548,5.11,43.42,11.77,14.4313,19.5769\n8/5/2010,46.7210,46.8108,46.4117,46.7210,0.42,0.00,0.00,11.82,2.77,2.18,23.4091,18.4792,4.93,41.89,11.77,14.2412,19.1752\n8/6/2010,46.6511,46.7409,45.9428,46.6511,0.80,0.00,0.47,11.78,2.57,2.50,21.8225,21.2087,0.61,43.03,1.43,13.3258,18.1392\n8/9/2010,46.9704,47.0801,46.6811,46.9704,0.43,0.34,0.00,11.36,2.73,2.32,23.9836,20.4080,3.58,44.39,8.05,12.9493,17.1495\n8/10/2010,46.5639,46.8407,46.1723,46.5639,0.80,0.00,0.51,11.35,2.53,2.66,22.2971,23.4559,1.16,45.75,2.53,12.2053,16.1601\n8/11/2010,45.2943,45.8131,45.1048,45.2943,1.46,0.00,1.07,12.00,2.35,3.54,19.5856,29.5006,9.91,49.09,20.20,12.7763,15.9427\n8/12/2010,44.9352,45.1347,44.3465,44.9352,0.95,0.00,0.76,12.09,2.18,4.05,18.0500,33.4603,15.41,51.51,29.92,14.0006,16.2966\n8/13/2010,44.6159,44.9551,44.6059,44.6159,0.35,0.00,0.00,11.57,2.03,3.76,17.5055,32.4509,14.95,49.96,29.92,15.1375,16.7704\n8/16/2010,44.6957,45.0050,44.1969,44.6957,0.81,0.00,0.41,11.56,1.88,3.90,16.2813,33.7209,17.44,50.00,34.88,16.5475,17.1419\n8/17/2010,45.2664,45.6734,44.9252,45.2664,0.98,0.67,0.00,11.71,2.42,3.62,20.6305,30.9050,10.27,51.54,19.94,16.7896,16.7293\n8/18/2010,45.4440,45.7133,45.0050,45.4440,0.71,0.04,0.00,11.58,2.28,3.36,19.7132,29.0147,9.30,48.73,19.09,16.9538,16.4282\n8/19/2010,44.7556,45.3542,44.4563,44.7556,0.99,0.00,0.55,11.74,2.12,3.67,18.0549,31.2473,13.19,49.30,26.76,17.6541,16.4500\n8/20/2010,44.8154,44.9252,44.4363,44.8154,0.49,0.00,0.02,11.39,1.97,3.43,17.2800,30.0818,12.80,47.36,27.03,18.3238,16.4800\n8/23/2010,44.3765,45.2345,44.3565,44.3765,0.88,0.31,0.00,11.46,2.14,3.18,18.6556,27.7762,9.12,46.43,19.64,18.4180,16.4247\n8/24/2010,43.5484,44.0173,43.3638,43.5484,1.01,0.00,0.99,11.65,1.98,3.95,17.0339,33.8827,16.85,50.92,33.09,19.4661,16.8536\n8/25/2010,43.9674,44.1570,43.1693,43.9674,0.99,0.00,0.19,11.81,1.84,3.86,15.6087,32.6955,17.09,48.30,35.37,20.6023,16.9641\n8/26/2010,43.4386,44.2168,43.3987,43.4386,0.82,0.06,0.00,11.78,1.77,3.58,15.0324,30.4249,15.39,45.46,33.86,21.5494,17.2494\n8/27/2010,43.9674,44.0572,42.8700,43.9674,1.19,0.00,0.53,12.13,1.64,3.86,13.5607,31.8062,18.25,45.37,40.22,22.8829,17.5441\n8/30/2010,43.5085,44.1470,43.4985,43.5085,0.65,0.09,0.00,11.91,1.62,3.58,13.5763,30.0741,16.50,43.65,37.80,23.9480,18.3622\n8/31/2010,43.3588,43.7479,43.0795,43.3588,0.67,0.00,0.42,11.73,1.50,3.74,12.8024,31.9331,19.13,44.74,42.76,25.2920,19.6463\n9/1/2010,44.6558,44.8055,43.9674,44.6558,1.45,1.06,0.00,12.34,2.45,3.48,19.8747,28.1879,8.31,48.06,17.30,24.7209,19.9292\n9/2/2010,45.1546,45.1746,44.6259,45.1546,0.55,0.37,0.00,12.00,2.65,3.23,22.0412,26.8993,4.86,48.94,9.93,23.6642,20.1058\n9/3/2010,45.9029,45.9129,45.4440,45.9029,0.76,0.74,0.00,11.90,3.19,3.00,26.8393,25.1858,1.65,52.03,3.18,22.2009,19.4952\n9/7/2010,45.5936,45.9228,45.5188,45.5936,0.40,0.01,0.00,11.46,2.98,2.78,25.9794,24.2977,1.68,50.28,3.34,20.8541,18.9039\n9/8/2010,46.1423,46.3419,45.7133,46.1423,0.75,0.42,0.00,11.39,3.18,2.59,27.9526,22.7011,5.25,50.65,10.37,20.1050,18.8796\n9/9/2010,46.3219,46.5913,46.2122,46.3219,0.45,0.25,0.00,11.02,3.21,2.40,29.0765,21.7764,7.30,50.85,14.36,19.6943,19.0091\n9/10/2010,46.4915,46.5614,46.1423,46.4915,0.42,0.00,0.07,10.65,2.98,2.30,27.9328,21.5759,6.36,49.51,12.84,19.2047,18.8114\n9/13/2010,47.1400,47.2597,46.8307,47.1400,0.77,0.70,0.00,10.66,3.46,2.13,32.4697,20.0213,12.45,52.49,23.72,19.5269,19.4965\n9/14/2010,47.3395,47.5890,46.9704,47.3395,0.62,0.33,0.00,10.52,3.54,1.98,33.6907,18.8439,14.85,52.53,28.26,20.1508,20.3765\n9/15/2010,47.6388,47.6887,47.0801,47.6388,0.61,0.10,0.00,10.38,3.39,1.84,32.6755,17.7387,14.94,50.41,29.63,20.8277,21.1886\n9/16/2010,47.8284,47.8683,47.4293,47.8284,0.44,0.18,0.00,10.07,3.33,1.71,33.0344,16.9657,16.07,50.00,32.14,21.6356,22.2592\n9/17/2010,47.9950,48.1400,47.7500,47.9950,0.39,0.27,0.00,9.74,3.36,1.59,34.5005,16.2867,18.21,50.79,35.86,22.6518,23.2999\n9/20/2010,48.8299,48.9300,48.1101,48.8299,0.94,0.79,0.00,9.98,3.91,1.47,39.1824,14.7613,24.42,53.94,45.27,24.2675,24.7798\n9/21/2010,48.8200,49.1700,48.6100,48.8200,0.56,0.24,0.00,9.83,3.87,1.37,39.3918,13.9204,25.47,53.31,47.78,25.9468,25.3339\n9/22/2010,48.6900,49.0210,48.4200,48.6900,0.60,0.00,0.19,9.73,3.60,1.46,36.9584,15.0134,21.95,51.97,42.22,27.1095,25.3869\n9/23/2010,48.6700,49.1600,48.3200,48.6700,0.84,0.14,0.00,9.87,3.48,1.36,35.2221,13.7362,21.49,48.96,43.89,28.3078,25.2544\n9/24/2010,49.6600,49.6900,49.1500,49.6600,1.02,0.53,0.00,10.19,3.76,1.26,36.8978,12.3611,24.54,49.26,49.81,29.8438,25.3489\n9/27/2010,49.3900,49.7500,49.3500,49.3900,0.40,0.06,0.00,9.86,3.55,1.17,36.0095,11.8597,24.15,47.87,50.45,31.3157,25.7103\n9/28/2010,49.3700,49.5400,48.5900,49.3700,0.95,0.00,0.76,10.11,3.30,1.85,32.6248,18.2646,14.36,50.89,28.22,31.0944,25.3944\n9/29/2010,49.2900,49.5300,49.1100,49.2900,0.42,0.00,0.00,9.80,3.06,1.71,31.2273,17.4823,13.75,48.71,28.22,30.8890,25.0469\n9/30/2010,49.0700,49.8400,48.7500,49.0700,1.09,0.00,0.36,10.19,2.84,1.95,27.8885,19.1444,8.74,47.03,18.59,30.0106,24.7687\n10/1/2010,49.0100,49.5300,48.7810,49.0100,0.75,0.00,0.00,10.22,2.64,1.81,25.8436,17.7407,8.10,43.58,18.59,29.1949,24.6728\n10/4/2010,48.4800,49.0500,48.2000,48.4800,0.85,0.00,0.58,10.34,2.45,2.26,23.7183,21.9030,1.82,45.62,3.98,27.3938,24.1108\n10/5/2010,49.6600,49.7600,49.0000,49.6600,1.28,0.71,0.00,10.88,2.99,2.10,27.4545,19.3256,8.13,46.78,17.38,26.6783,24.1569\n10/6/2010,49.2300,49.7100,48.9100,49.2300,0.80,0.00,0.09,10.90,2.77,2.04,25.4396,18.7329,6.71,44.17,15.18,25.8572,24.2545\n10/7/2010,49.4100,49.5400,49.0000,49.4100,0.54,0.00,0.00,10.66,2.57,1.90,24.1511,17.7841,6.37,41.94,15.18,25.0948,24.6811\n10/8/2010,49.7500,49.8700,49.0800,49.7500,0.79,0.33,0.00,10.69,2.72,1.76,25.4533,16.4699,8.98,41.92,21.43,24.8329,25.3898\n10/11/2010,49.7700,50.0200,49.6200,49.7700,0.40,0.15,0.00,10.33,2.68,1.63,25.9199,15.8319,10.09,41.75,24.16,24.7849,25.9472\n10/12/2010,50.1100,50.2100,49.2600,50.1100,0.95,0.00,0.36,10.54,2.49,1.88,23.5835,17.8207,5.76,41.40,13.92,24.0088,26.1583\n10/13/2010,50.5200,50.7500,50.2800,50.5200,0.64,0.54,0.00,10.43,2.85,1.74,27.3151,16.7268,10.59,44.04,24.04,24.0111,26.9275\n10/14/2010,50.4200,50.6400,50.1700,50.4200,0.47,0.00,0.11,10.15,2.64,1.73,26.0504,17.0359,9.01,43.09,20.92,23.7904,27.5530\n10/15/2010,51.4900,51.5000,50.6300,51.4900,1.08,0.86,0.00,10.51,3.32,1.61,31.5580,15.2848,16.27,46.84,34.74,24.5726,27.8335\n10/18/2010,51.3000,51.7200,51.3000,51.3000,0.42,0.22,0.00,10.18,3.30,1.49,32.4175,14.6539,17.76,47.07,37.74,25.5129,28.2010\n10/19/2010,50.8200,51.3000,50.4200,50.8200,0.88,0.00,0.88,10.33,3.06,2.26,29.6556,21.9250,7.73,51.58,14.99,24.7611,27.3858\n10/20/2010,51.1900,51.5700,50.8700,51.1900,0.75,0.27,0.00,10.34,3.11,2.10,30.1158,20.3349,9.78,50.45,19.39,24.3772,26.7861\n10/21/2010,51.2900,51.7101,50.7900,51.2900,0.92,0.14,0.00,10.52,3.03,1.95,28.8139,18.5569,10.26,47.37,21.65,24.1826,25.7882\n10/22/2010,51.6400,51.6900,51.2100,51.6400,0.48,0.00,0.00,10.25,2.82,1.81,27.4647,17.6880,9.78,45.15,21.65,24.0019,25.3401\n10/25/2010,51.8900,52.2300,51.8500,51.8900,0.59,0.54,0.00,10.11,3.15,1.68,31.2036,16.6556,14.55,47.86,30.40,24.4587,25.1580\n10/26/2010,52.0300,52.1500,51.4200,52.0300,0.73,0.00,0.43,10.12,2.93,1.99,28.9520,19.7041,9.25,48.66,19.01,24.0693,24.5820\n10/27/2010,52.1900,52.2300,51.6600,52.1900,0.57,0.08,0.00,9.96,2.80,1.85,28.0987,18.5770,9.52,46.68,20.40,23.8072,24.3200\n10/28/2010,52.3000,52.4500,51.8400,52.3000,0.61,0.22,0.00,9.86,2.82,1.72,28.5914,17.4280,11.16,46.02,24.26,23.8394,24.3122\n10/29/2010,52.1800,52.4900,52.1698,52.1800,0.32,0.04,0.00,9.48,2.66,1.60,28.0476,16.8392,11.21,44.89,24.97,23.9202,23.9645\n11/1/2010,52.2200,52.7500,51.9800,52.2200,0.77,0.26,0.00,9.57,2.73,1.48,28.5076,15.4845,13.02,43.99,29.60,24.3261,24.1686\n11/2/2010,52.7800,52.9300,52.5750,52.7800,0.71,0.18,0.00,9.60,2.71,1.38,28.2742,14.3390,13.94,42.61,32.70,24.9244,24.3574\n11/3/2010,53.0200,53.0400,52.3600,53.0200,0.68,0.00,0.22,9.59,2.52,1.49,26.2698,15.5639,10.71,41.83,25.59,24.9720,24.7723\n11/4/2010,53.6700,53.8614,53.5000,53.6700,0.84,0.82,0.00,9.75,3.16,1.39,32.4285,14.2206,18.21,46.65,39.03,25.9763,25.7446\n11/5/2010,53.6700,53.8100,53.5100,53.6700,0.30,0.00,0.00,9.35,2.94,1.29,31.3882,13.7644,17.62,45.15,39.03,26.9088,25.8350\n11/8/2010,53.7375,53.8300,53.4499,53.7375,0.38,0.00,0.06,9.06,2.73,1.26,30.0719,13.8502,16.22,43.92,36.93,27.6248,26.0010\n11/9/2010,53.4500,54.0401,53.2100,53.4500,0.83,0.00,0.24,9.25,2.53,1.41,27.3723,15.2013,12.17,42.57,28.59,27.6936,25.9381\n11/10/2010,53.7150,53.7700,53.1000,53.7150,0.67,0.00,0.11,9.26,2.35,1.42,25.3910,15.2894,10.10,40.68,24.83,27.4892,25.7456\n11/11/2010,53.3850,53.4800,52.6600,53.3850,1.06,0.00,0.44,9.65,2.18,1.75,22.6151,18.1774,4.44,40.79,10.88,26.3027,25.3807\n11/12/2010,52.5100,53.3672,52.1100,52.5100,1.28,0.00,0.55,10.24,2.03,2.18,19.7981,21.2865,1.49,41.08,3.62,24.6827,24.3760\n11/15/2010,52.3150,52.8800,52.2900,52.3150,0.59,0.00,0.00,10.09,1.88,2.02,18.6410,20.0423,1.40,38.68,3.62,23.1784,23.4928\n11/16/2010,51.4500,52.2462,50.8500,51.4500,1.47,0.00,1.44,10.84,1.75,3.32,16.1214,30.6191,14.50,46.74,31.02,23.7384,23.7889\n11/17/2010,51.6000,51.8700,51.3500,51.6000,0.52,0.00,0.00,10.58,1.62,3.08,15.3294,29.1149,13.79,44.44,31.02,24.2583,24.0892\n11/18/2010,52.4300,52.7900,52.1300,52.4300,1.19,0.92,0.00,11.02,2.43,2.86,22.0234,25.9704,3.95,47.99,8.22,23.1130,23.7196\n11/19/2010,52.4700,52.5900,52.1400,52.4700,0.45,0.00,0.00,10.68,2.25,2.66,21.0956,24.8763,3.78,45.97,8.22,22.0495,23.4869\n11/22/2010,52.9100,52.9100,52.1700,52.9100,0.74,0.32,0.00,10.66,2.41,2.47,22.6333,23.1492,0.52,45.78,1.13,20.5550,22.7635\n11/23/2010,52.0700,52.4500,51.7700,52.0700,1.14,0.00,0.40,11.04,2.24,2.69,20.2955,24.3823,4.09,44.68,9.15,19.7402,22.8582\n11/24/2010,53.1200,53.2500,52.5600,53.1200,1.18,0.80,0.00,11.43,2.88,2.50,25.2000,21.8648,3.34,47.06,7.09,18.8363,22.8726\n11/26/2010,52.7700,53.1300,52.6700,52.7700,0.46,0.00,0.00,11.07,2.67,2.32,24.1530,20.9565,3.20,45.11,7.09,17.9970,22.8109\n11/29/2010,52.7300,52.9000,52.1000,52.7300,0.80,0.00,0.57,11.08,2.48,2.72,22.4094,24.5873,2.18,47.00,4.63,17.0425,22.3681\n11/30/2010,52.0850,52.7355,51.8800,52.0850,0.86,0.00,0.22,11.15,2.31,2.75,20.6893,24.6739,3.98,45.36,8.78,16.4526,21.9709\n12/1/2010,53.1900,53.4600,52.8400,53.1900,1.38,0.72,0.00,11.72,2.87,2.55,24.4423,21.7802,2.66,46.22,5.76,15.6888,20.9958\n12/2/2010,53.7300,53.8100,53.2100,53.7300,0.62,0.35,0.00,11.51,3.01,2.37,26.1670,20.6067,5.56,46.77,11.89,15.4173,20.0500\n12/3/2010,53.8700,53.9400,53.5000,53.8700,0.44,0.13,0.00,11.12,2.93,2.20,26.3006,19.7917,6.51,46.09,14.12,15.3248,19.2516\n12/6/2010,53.8450,53.9500,53.6800,53.8450,0.27,0.01,0.00,10.60,2.73,2.04,25.7251,19.2876,6.44,45.01,14.30,15.2517,19.4950\n12/7/2010,53.8800,54.5200,53.8200,53.8800,0.70,0.57,0.00,10.54,3.10,1.90,29.4234,18.0070,11.42,47.43,24.07,15.8815,20.0699\n12/8/2010,54.0800,54.1500,53.6899,54.0800,0.46,0.00,0.13,10.25,2.88,1.89,28.1027,18.4680,9.63,46.57,20.69,16.2249,19.6689\n12/9/2010,54.1350,54.4400,53.9500,54.1350,0.49,0.29,0.00,10.01,2.96,1.76,29.6244,17.5638,12.06,47.19,25.56,16.8916,19.4705\n12/10/2010,54.4950,54.5500,54.0900,54.4950,0.46,0.11,0.00,9.75,2.86,1.63,29.3551,16.7354,12.62,46.09,27.38,17.6408,19.0979\n12/13/2010,54.3000,54.7400,54.2700,54.3000,0.47,0.19,0.00,9.53,2.85,1.52,29.9012,15.9097,13.99,45.81,30.54,18.5623,19.1512\n12/14/2010,54.3950,54.6200,54.2300,54.3950,0.39,0.00,0.04,9.24,2.65,1.45,28.6386,15.6710,12.97,44.31,29.27,19.3268,19.0816\n12/15/2010,54.1600,54.7000,54.0300,54.1600,0.67,0.00,0.20,9.25,2.46,1.54,26.5635,16.6985,9.86,43.26,22.80,19.5751,18.7861\n12/16/2010,54.5800,54.6600,54.0600,54.5800,0.60,0.00,0.00,9.19,2.28,1.43,24.8284,15.6078,9.22,40.44,22.80,19.8057,18.4241\n12/17/2010,54.5200,54.6800,54.4100,54.5200,0.27,0.02,0.00,8.80,2.14,1.33,24.2939,15.1289,9.16,39.42,23.25,20.0515,18.2521\n12/20/2010,54.5600,54.7600,54.1600,54.5600,0.60,0.00,0.25,8.77,1.99,1.49,22.6320,16.9442,5.69,39.58,14.37,19.6458,17.6673\n12/21/2010,54.8900,54.8900,54.6200,54.8900,0.33,0.13,0.00,8.47,1.97,1.38,23.2847,16.2844,7.00,39.57,17.69,19.5062,17.4618\n12/22/2010,54.8850,54.9600,54.7900,54.8850,0.17,0.07,0.00,8.04,1.90,1.28,23.6631,15.9401,7.72,39.60,19.50,19.5058,17.4153\n12/23/2010,54.7420,54.8700,54.6100,54.7420,0.27,0.00,0.18,7.74,1.77,1.37,22.8223,17.6993,5.12,40.52,12.64,19.0156,17.1336\n12/27/2010,54.7700,54.8600,54.2100,54.7700,0.65,0.00,0.40,7.84,1.64,1.67,20.9295,21.3352,0.41,42.26,0.96,17.7259,16.8037\n12/28/2010,54.6700,54.9200,54.5500,54.6700,0.37,0.06,0.00,7.65,1.58,1.55,20.7015,20.3030,0.40,41.00,0.97,16.5292,16.3770\n12/29/2010,54.7900,54.9000,54.7300,54.7900,0.23,0.00,0.00,7.33,1.47,1.44,20.0520,19.6660,0.39,39.72,0.97,15.4180,16.1548\n12/30/2010,54.6600,54.8000,54.5500,54.6600,0.25,0.00,0.18,7.06,1.37,1.52,19.3417,21.5198,2.18,40.86,5.33,14.6974,16.1691\n12/31/2010,54.4600,54.6200,54.2100,54.4600,0.45,0.00,0.34,7.00,1.27,1.75,18.0989,24.9919,6.89,43.09,16.00,14.7902,16.6762\n1/3/2011,55.3100,55.6900,54.9500,55.3100,1.23,1.07,0.00,7.73,2.25,1.63,29.0567,21.0168,8.04,50.07,16.06,14.8806,17.1037\n1/4/2011,55.2650,55.5500,54.9200,55.2650,0.63,0.00,0.03,7.81,2.09,1.54,26.7130,19.7057,7.01,46.42,15.10,14.8960,17.2356\n1/5/2011,55.7400,55.7600,55.0700,55.7400,0.69,0.21,0.00,7.94,2.15,1.43,27.0363,17.9939,9.04,45.03,20.08,15.2664,17.5360\n1/6/2011,55.9200,55.9600,55.6800,55.9200,0.28,0.20,0.00,7.66,2.19,1.33,28.6600,17.3357,11.32,46.00,24.62,15.9345,17.9930\n1/7/2011,55.8700,56.0500,55.3200,55.8700,0.73,0.00,0.36,7.84,2.04,1.59,25.9910,20.3139,5.68,46.30,12.26,15.6720,17.6589\n1/10/2011,56.0800,56.1800,55.5800,56.0800,0.60,0.13,0.00,7.88,2.02,1.48,25.6616,18.7669,6.89,44.43,15.52,15.6611,17.5837\n1/11/2011,56.1600,56.3600,55.9500,56.1600,0.41,0.18,0.00,7.73,2.06,1.37,26.6296,17.7710,8.86,44.40,19.95,15.9676,17.7367\n1/12/2011,56.5550,56.5600,56.2000,56.5550,0.40,0.20,0.00,7.57,2.11,1.27,27.8638,16.8325,11.03,44.70,24.68,16.5899,17.8028\n1/13/2011,56.5750,56.7300,56.4100,56.5750,0.32,0.17,0.00,7.35,2.13,1.18,28.9632,16.1000,12.86,45.06,28.54,17.4438,17.5849\n1/14/2011,57.0000,57.0200,56.4600,57.0000,0.56,0.29,0.00,7.39,2.27,1.10,30.6931,14.8796,15.81,45.57,34.70,18.6764,17.6028\n1/18/2011,57.1600,57.2300,56.4900,57.1600,0.74,0.21,0.00,7.60,2.32,1.02,30.4677,13.4309,17.04,43.90,38.81,20.1145,17.7662\n1/19/2011,56.5100,57.2600,56.3200,56.5100,0.94,0.00,0.17,8.00,2.15,1.12,26.8866,13.9779,12.91,40.86,31.59,20.9341,17.8158\n1/20/2011,56.1100,56.3500,55.6800,56.1100,0.83,0.00,0.64,8.26,2.00,1.68,24.1836,20.3245,3.86,44.51,8.67,20.0581,17.4242\n1/21/2011,55.6800,56.4900,55.6500,55.6800,0.84,0.14,0.00,8.51,1.99,1.56,23.4413,18.3175,5.12,41.76,12.27,19.5018,17.1912\n1/24/2011,56.4500,56.4600,55.6800,56.4500,0.78,0.00,0.00,8.68,1.85,1.45,21.3346,16.6712,4.66,38.01,12.27,18.9853,16.9406\n1/25/2011,56.5325,56.5500,56.0500,56.5325,0.50,0.09,0.00,8.56,1.81,1.34,21.1398,15.6973,5.44,36.84,14.77,18.6845,16.9754\n1/26/2011,56.8300,56.9800,56.4500,56.8300,0.53,0.43,0.00,8.48,2.11,1.25,24.8904,14.7159,10.17,39.61,25.69,19.1848,17.5597\n1/27/2011,57.1800,57.3500,56.9200,57.1800,0.52,0.37,0.00,8.39,2.33,1.16,27.7570,13.8041,13.95,41.56,33.57,20.2125,17.9423\n1/28/2011,55.7300,57.2200,55.4700,55.7300,1.75,0.00,1.45,9.54,2.16,2.53,22.6667,26.4676,3.80,49.13,7.74,19.3213,17.4912\n1/31/2011,56.0000,56.1600,55.3900,56.0000,0.77,0.00,0.08,9.63,2.01,2.43,20.8545,25.1822,4.33,46.04,9.40,18.6127,17.2901\n2/1/2011,57.0500,57.1800,56.3600,57.0500,1.18,1.02,0.00,10.12,2.89,2.25,28.4996,22.2468,6.25,50.75,12.32,18.1633,17.3766\n2/2/2011,56.9550,57.1700,56.8400,56.9550,0.33,0.00,0.00,9.73,2.68,2.09,27.5330,21.4923,6.04,49.03,12.32,17.7461,17.5949\n2/3/2011,57.0575,57.1400,56.4000,57.0575,0.74,0.00,0.44,9.77,2.49,2.38,25.4487,24.3665,1.08,49.82,2.17,16.6336,17.6550\n2/4/2011,57.3750,57.4200,56.9000,57.3750,0.52,0.28,0.00,9.60,2.59,2.21,26.9874,23.0462,3.94,50.03,7.88,16.0082,18.0613\n2/7/2011,57.6500,57.9700,57.4000,57.6500,0.59,0.55,0.00,9.51,2.95,2.05,31.0839,21.6038,9.48,52.69,17.99,16.1499,18.5420\n2/8/2011,58.0250,58.0700,57.5600,58.0250,0.51,0.10,0.00,9.34,2.84,1.91,30.4571,20.4238,10.03,50.88,19.72,16.4049,18.2315\n2/9/2011,57.9300,58.1200,57.7500,57.9300,0.37,0.05,0.00,9.04,2.69,1.77,29.7636,19.5879,10.18,49.35,20.62,16.7059,18.1039"
  },
  {
    "path": "Tests/TestData/spy_with_cci.txt",
    "content": "Date,Open,High,Low,Close,Commodity Channel Index (CCI) 14\n1/16/2013 12:00:00 AM,146.77,147.28,146.61,147.05,\n1/17/2013 12:00:00 AM,147.7,148.42,147.43,148,\n1/18/2013 12:00:00 AM,147.97,148.49,147.43,148.33,\n1/22/2013 12:00:00 AM,148.33,149.13,147.98,149.13,\n1/23/2013 12:00:00 AM,149.13,149.5,148.86,149.37,\n1/24/2013 12:00:00 AM,149.15,150.14,149.01,149.41,\n1/25/2013 12:00:00 AM,149.88,150.25,149.37,150.25,\n1/28/2013 12:00:00 AM,150.29,150.33,149.51,150.07,\n1/29/2013 12:00:00 AM,149.77,150.85,149.67,150.66,\n1/30/2013 12:00:00 AM,150.64,150.94,149.93,150.07,\n1/31/2013 12:00:00 AM,149.89,150.38,149.6,149.7,\n2/1/2013 12:00:00 AM,150.65,151.42,150.39,151.24,\n2/4/2013 12:00:00 AM,150.32,150.58,149.43,149.54,\n2/5/2013 12:00:00 AM,150.35,151.48,150.29,151.05,105.0005\n2/6/2013 12:00:00 AM,150.52,151.26,150.41,151.16,102.6545\n2/7/2013 12:00:00 AM,151.21,151.35,149.86,150.96,77.95193\n2/8/2013 12:00:00 AM,151.23,151.89,151.22,151.8,149.9751\n2/11/2013 12:00:00 AM,151.75,151.9,151.39,151.77,134.6711\n2/12/2013 12:00:00 AM,151.78,152.3,151.61,152.02,139.2417\n2/13/2013 12:00:00 AM,152.33,152.61,151.72,152.15,135.2057\n2/14/2013 12:00:00 AM,151.69,152.47,151.52,152.29,110.4122\n2/15/2013 12:00:00 AM,152.43,152.59,151.55,152.11,91.47002\n2/19/2013 12:00:00 AM,152.37,153.28,152.36,153.25,141.6772\n2/20/2013 12:00:00 AM,153.14,153.19,151.3,151.34,47.07866\n2/21/2013 12:00:00 AM,150.92,151.42,149.94,150.42,-86.04478\n2/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,-8.01317\n2/25/2013 12:00:00 AM,152.63,152.86,149,149,-135.6897\n2/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,-166.3776\n2/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,-13.10612\n2/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,42.2037\n3/1/2013 12:00:00 AM,151.09,152.34,150.41,152.11,6.704213\n3/4/2013 12:00:00 AM,151.76,152.92,151.52,152.92,82.578\n3/5/2013 12:00:00 AM,153.66,154.7,153.64,154.29,199.3686\n3/6/2013 12:00:00 AM,154.84,154.92,154.16,154.5,179.5471\n3/7/2013 12:00:00 AM,154.71,154.98,154.52,154.78,148.5032\n3/8/2013 12:00:00 AM,155.46,155.65,154.66,155.44,134.6678\n3/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,126.6936\n3/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,100.3347\n3/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,88.05182\n3/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,100.7036\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,65.47228\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,28.58965\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,0.9727957\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,56.51917\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,-30.74768\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,8.808882\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,-17.25059\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,79.11461\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,51.10533\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,126.7717\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,85.40448\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,138.0194\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,1.541741\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,12.17782\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,-96.19313\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,16.13406\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,129.7329\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,229.6422\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,225.3154\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,140.0898\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,-31.11329\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,21.68331\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,-92.27182\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,-125.4362\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,-74.34872\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,-26.95436\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,49.14233\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,70.95987\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,94.40148\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,61.81363\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,94.10661\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,95.84732\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,64.91308\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96.44053\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,155.6996\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,140.6538\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,142.2243\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,145.9511\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,118.9655\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,102.723\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,94.80473\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,123.396\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,139.7538\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,117.426\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,132.5676\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,129.885\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,112.0121\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,84.37033\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,17.577\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,-0.2850748\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,73.00949\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,-13.59309\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,21.53842\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,-98.90562\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,-140.8251\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,-127.7295\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,-190.0317\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,-151.4941\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,-30.11283\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,6.252911\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,-60.7136\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,-98.52526\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,-44.51254\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,-24.21847\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,46.19364\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,119.8902\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,45.38231\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,-212.437\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,-201.7931\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,-197.1416\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,-119.9249\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,-62.50879\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,-19.69415\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,-33.25071\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,3.592538\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,-3.432033\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,-6.811083\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,47.73188\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,102.2551\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,149.3501\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,151.6283\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,169.9053\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,141.3326\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,128.2774\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,100.7469\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,95.15704\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,99.21332\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,89.59978\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,91.04593\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,82.31332\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,64.75846\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,52.57219\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,42.54441\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,32.6235\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,29.32182\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,67.30337\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,239.6324\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,195.5927\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,150.5017\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,56.85922\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,-30.56561\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,26.24531\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,-1.330201\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,-44.21419\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,-9.248472\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,-38.38493\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,-247.7847\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,-230.772\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,-193.6337\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,-129.6763\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,-120.5679\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,-75.33572\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,-43.23889\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,-36.72143\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,-123.7335\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,-117.3391\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,-91.96931\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,-102.0854\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,-53.49993\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,10.69338\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,74.56219\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,59.90124\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,145.407\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,186.9708\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,165.8096\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,132.3848\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,111.8595\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,127.4601\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,115.9227\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,135.4275\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,131.9135\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,75.37705\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,29.49498\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,11.04254\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,-20.23897\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,-20.83793\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,-79.30806\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,-129.8574\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,-65.91423\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,-73.47805\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,-117.6157\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,-70.16394\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,-99.47483\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,-167.4297\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-184.3081\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,11.78844\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,97.14207\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,129.9438\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,104.6191\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,171.5332\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,171.7889\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,176.8566\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,145.009\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,138.2815\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,95.56779\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,91.94613\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,94.49028\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,93.72124\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,106.0366\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,86.93131\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,69.06176\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,60.68073\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,81.39811\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,53.64558\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,112.7082\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,-9.457965\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,57.20654\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,131.2839\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,78.19733\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,159.3311\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,244.2536\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,231.0115\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,155.8697\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,101.6691\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,65.65199\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,91.45136\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,113.4838\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,110.0266\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,99.99233\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,104.6872\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,104.8878\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,70.86911\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,-9.337917\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,-48.5298\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,-87.16278\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,60.17348\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,105.4094\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,54.83457\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,-106.1783\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,-176.5914\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,-139.3568\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,-50.18081\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,-76.9837\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,31.65131\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,107.8655\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,103.9574\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,138.1398\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,132.9316\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,149.0094\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,128.9915\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,106.8608\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,108.8653\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,55.99036\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,44.00346\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,21.1719\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,50.12557\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,43.64715\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,43.90664\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,63.28024\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,-125.4347\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,-37.32738\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,138.9013\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,103.3444\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,37.72211\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,60.99863\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,99.62864\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,-103.3697\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,-287.4536\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,-254.0326\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,-157.4752\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,-149.6736\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,-81.76563\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,-90.82207\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-130.5751\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,-117.5621\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,-111.6467\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,-61.41662\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,7.382764\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,41.58273\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,118.8878\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,150.0759\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,134.4041\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,144.5029\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,125.8157\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,94.40343\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,82.43629\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,80.18954\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,91.12029\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,82.09227\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,80.20094\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,92.24671\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,128.4795\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,44.88475\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,189.1259\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,178.1\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,159.6632\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,125.0897\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,87.90372\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,65.9644\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,23.85514\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,-30.73485\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,-84.0436\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,-22.63152\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,39.4059\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,-11.6427\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,19.95014\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,-0.7847012\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,-107.9176\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,-58.27738\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,-81.80448\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,-150.9764\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,-57.04919\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,69.14381\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,147.0838\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,159.6982\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,132.5567\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,39.35272\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,-116.1421\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,-103.2422\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,-2.365347\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,-103.3045\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,-181.6037\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,-128.9453\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,-83.3799\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,-1.284795\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,21.4576\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,40.76793\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,80.77468\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,77.90808\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,89.95018\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,43.64087\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,39.26166\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,77.37398\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,84.22206\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,88.14601\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,87.59874\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,56.01451\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,-7.469471\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,-15.01959\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,56.59106\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,3.437432\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,202.7077\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,220.3284\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,112.0423\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,-49.48185\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,-51.85168\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,20.91631\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,-41.98981\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,58.16592\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,101.7281\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,126.4567\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,171.9316\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,145.727\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,148.7474\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,140.021\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,118.1914\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,99.23695\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,92.14983\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,113.2768\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,145.0686\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,140.1766\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,121.4201\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,86.25623\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,30.88591\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,25.78047\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,34.40224\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,46.67979\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,110.2738\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,131.2864\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,92.32849\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,76.15726\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,19.0761\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,9.444615\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,-4.519725\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,46.86752\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,71.14531\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,154.2054\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,159.0412\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,195.6191\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,122.3201\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,18.79195\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,54.01083\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,-15.25489\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,7.021236\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,98.03967\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,55.49835\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,98.13805\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,-45.85994\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,35.4335\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,1.79538\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,130.3613\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,136.9858\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,140.517\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,43.34494\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,10.59107\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,-0.1061269\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,-61.9087\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,-314.9709\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,-256.0746\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,-147.2182\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,-144.1663\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,-118.5062\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,-106.1909\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,-69.34718\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,-24.50326\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,-32.08519\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,11.34013\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,55.66002\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,71.41306\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,148.521\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,178.0082\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,151.9719\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,139.1086\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,110.1295\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,110.231\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,105.0039\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,88.76134\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,71.27868\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,78.90618\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,75.98537\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,80.78029\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,66.21307\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,67.73229\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,68.61908\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,-61.67449\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,-70.19936\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,-43.24272\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,-158.7768\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,-171.3231\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,-16.83428\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,88.13358\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,163.9207\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,80.369\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,-78.21355\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,-151.785\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,-89.37118\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,-194.2596\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,-137.1118\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,-132.5444\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,-101.8558\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,-178.095\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,-172.8679\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,-72.4838\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,-53.41863\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,-129.2393\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,-71.69722\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,-111.8776\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,-173.4668\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,-216.47\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,-177.8542\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,-185.892\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,-136.676\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-66.04948\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,-39.31038\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,36.05622\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,40.3339\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,78.94288\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,95.35794\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,91.01237\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,121.5851\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,109.7416\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,103.6253\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,127.606\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,116.3735\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,94.52717\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,104.3752\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,104.2338\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,102.9468\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,99.64209\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,96.30655\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,84.19743\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,85.3493\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,83.25415\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,77.91877\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,119.2531\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,102.1025\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,101.5134\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,186.5984\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,173.0255\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,141.1284\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,129.1765\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,99.26846\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,18.39462\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,54.62403\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,94.49895\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,75.13985\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,95.42255\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,12.5437\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,-96.30259\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,-206.4327\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,-143.942\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,-221.2226\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,-206.052\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,-170.815\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,-105.2101\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,80.55946\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,42.11866\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,57.53434\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,74.12247\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,76.49182\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,88.93974\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,84.92143\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,59.52781\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,22.75454\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,0.9628283\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,-73.97392\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,-124.4817\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,-100.7157\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,-21.8927\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,-34.95187\n1/12/2015 1:14:41 PM,204.42,204.6,201.92,202.61,-76.34883"
  },
  {
    "path": "Tests/TestData/spy_with_chop.csv",
    "content": "Date,Open,High,Low,Close,Volume,CHOP14\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,39.1937058472543\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,34.93575759834959\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,30.08081776152703\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,35.59297399404555\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,37.8708878214655\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,37.608049878582676\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,44.083450221237214\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,62.5803050728031\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,62.895888368892265\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,64.04556847292761\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,65.66550929319382\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,65.30866744234655\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,65.29592132968104\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,62.563981275218744\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,65.12603523992532\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,65.46235979848505\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,66.68863697206635\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,66.3993812302752\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,66.07182280555561\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,53.77238940655252\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,47.23240819094533\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,47.287391008092854\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,50.41466655128153\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,52.2095980995497\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,55.13357338978696\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,54.870510903262506\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,55.144206845214946\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,56.03783465206231\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,55.40168678157614\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,54.94272803617391\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,53.9189443137773\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,53.01884692894445\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,53.124966713119946\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,51.502783341682786\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,52.14411342678097\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,51.63792615489757\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,38.812677958869656\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,35.28939776417563\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,28.527853745842183\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,26.224055153101467\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,27.143776640261713\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,32.10608010970076\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,37.346764721783124\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,32.25496956715187\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,27.46255308068411\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,29.93830853486462\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,27.94380493392156\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,25.436562717050784\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,25.70906600619634\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,35.62495221600048\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,37.20302525755326\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,39.971730940535885\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,46.079543242642046\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,48.345692576959905\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,48.79978444781998\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,53.89929926013159\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,54.107474028479146\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,54.893125948077355\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,47.99817029348738\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,45.62132056833578\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,46.285666831863026\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,46.361578012180864\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,47.3101836053624\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,51.908395638126834\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,53.425042762859405\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,53.779693480498516\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,59.77073208841506\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,59.26126875076315\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,62.372765921240024\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,58.37875492127532\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,51.55002429393086\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,45.59915483610421\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,45.242728286483654\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,44.61079886488892\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,43.99129212594616\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,44.57664625494375\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,44.57664625494375\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,43.43198576236397\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,41.44385454716552\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,41.493306192904015\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,40.65635596010155\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,40.812154563286555\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,39.52977821176809\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,30.24295181556706\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,27.033586717703532\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,27.118804822314964\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,32.623710636499375\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,33.103874816497836\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,29.114759714312676\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,29.41693861581683\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,24.845599626312016\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,22.32076103621319\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,26.98840417379735\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,34.36099545701611\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,42.27862890190389\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,43.94747722372722\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,60.98533345119625\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,65.19707123934461\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,57.127827519118775\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,55.63011559220179\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,58.72243320907361\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,59.6211073815204\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,59.300953120689634\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,60.051320574778536\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,61.48722579742855\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,61.811001491366774\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,61.40041632493825\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,61.31340751938553\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,50.31147904518999\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,46.253331824427434\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,42.17418900416498\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,42.31427167079901\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,38.46377367185427\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,40.145041415938415\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,43.55462551591839\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,45.76023607131588\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,42.94678319251608\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,42.84543277494379\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,44.38436949076591\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,45.11455999114642\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,46.40469527030355\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,64.07419615824006\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,61.918819126476464\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,64.23035144306779\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,60.96913669174107\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,52.25361609478935\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,47.834893679022144\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,45.34089510219981\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,44.738009750990116\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,36.922212782072954\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,33.27749698517109\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,27.187217223879497\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,25.752887357407552\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,29.20952706243952\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,29.854622512438922\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,30.188690414298915\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,30.967327088720182\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,37.58750980302112\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,47.71260465661825\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,41.5309266988507\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,42.40428383200743\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,43.668421636632225\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,44.782509306159625\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,44.12349585780818\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,45.565225342444876\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,36.9005487510768\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,40.10910560568444\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,51.71633300296608\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,52.8130389710701\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,50.54058589283661\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,51.026567628371\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,47.57636300192483\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,43.273966381394025\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,37.81058494277989\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,35.83107118080295\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,31.7194934992111\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,30.416519340581882\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,29.405192505384115\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,27.945024542744715\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,23.992531382373453\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,29.54466234912724\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,31.40597117458092\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,32.41305753076043\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,33.024001054131354\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,37.394115274858564\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,38.97406782853601\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,53.7131363559032\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,60.35719789522527\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,63.797501276480354\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,62.016307800551616\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,67.21702615141521\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,64.2793681864567\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,55.62696952765047\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,50.47356440166661\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,48.745112342864886\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,47.446509050697685\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,48.543970357778775\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,48.890729692890794\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,47.03057484669953\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,44.126170375298564\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,43.06772380814053\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,38.904378743151405\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,40.149943045070394\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,41.42758955388082\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,42.24871437721813\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,57.226780123287504\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,56.7801948931671\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,59.63481631903579\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,58.03933851047542\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,57.204575424047434\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,61.997028273268604\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,54.877358431336695\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,54.49607707947819\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,56.47237004549048\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,57.192939196101555\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,60.50328019453872\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,60.74398029020189\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,58.98615415972338\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,53.56619257457415\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,48.04601822117057\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,42.30765291474026\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,37.85691700078947\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,37.26243511480994\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,34.751215960166455\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,34.46243260576381\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,34.19229154595075\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,35.403142890914054\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,34.853821812650125\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,34.40026307882522\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,49.46623363733863\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,50.01074398660982\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,61.188388931763924\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,63.39548381969348\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,62.309217209582705\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,61.90045037424568\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,63.1336514524885\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,65.59780883693706\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,65.20436219626743\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,65.70947586716935\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,50.84975486516091\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,42.96199946344391\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,42.74305850998121\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,43.50906772385024\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,45.14349113457107\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,46.76509929567385\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,36.86198347654359\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,36.39497193208106\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,37.315488942518684\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,39.16365197444015\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,40.66903029382814\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,40.33954505877857\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,46.73112001101929\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,47.44634349747546\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,44.00204063081765\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,38.73407590291367\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,37.693851367021054\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,35.96721203587619\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,35.25596933298551\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,33.514738116231854\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,26.356223683941735\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,25.789856536435295\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,29.78812797438406\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,38.37279312931806\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,40.11988852321706\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,46.98738177463981\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,47.64382464701869\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,46.40861411094276\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,51.067694232042626\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,48.65982352631151\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,49.216591891354945\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,48.93923030470076\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,55.71923702652316\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,59.28971136587335\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,57.89531501729945\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,59.0608462559754\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,59.53232007407624\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,60.9707846630854\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,60.78114032644344\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,66.31719181952597\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,65.51820592152511\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,67.0292067215866\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,69.16841495099226\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,64.82492273255829\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,65.69756876539367\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,65.56663457095068\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,65.4352463735384\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,61.417569904166434\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,60.49787352493242\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,59.315798299398224\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,60.472289540686475\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,57.614907010727\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,57.777244930582185\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,55.54137735643505\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,46.97000715002031\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,47.308449892010465\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,47.823299091905994\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,48.4571766732203\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,47.836081118732906\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,46.641705684034335\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,46.65489250100019\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,46.163897792976584\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,46.549269246076015\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,50.69582903616051\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,51.1003523799227\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,50.187578698777884\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,48.54633537715782\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,41.91305565944576\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,39.79741383003033\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,40.14346480288294\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,58.2200319065802\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,60.96719881664629\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,62.07544937956335\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,62.635013854214854\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,57.41845329018893\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,53.52307477507982\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,53.02974469714052\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,54.07674701209324\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,59.904614510864285\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,60.27412692665616\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,60.88208456396635\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,61.8349725933326\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,61.42952260995514\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,59.108576501219055\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,49.96174181027916\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,49.310175514634444\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,43.62375948541304\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,40.24498997989068\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,37.20952374156737\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,37.20952374156742\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,35.16227787886967\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,28.03856306859468\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,25.04437221488059\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,21.16895392043653\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,23.229973677647376\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,25.78764717375355\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,31.642379251501605\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,40.92908837123216\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,41.2729285629126\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,44.389273175827284\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,49.22501442597661\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,47.36472265939902\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,49.161506298341436\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,48.962012966538495\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,55.29289309210242\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,58.54126689947666\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,59.72692352171346\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,59.99534720500783\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,59.794207916135285\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,51.7250091696436\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,50.48482077810099\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,48.038691501183166\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,49.14816861966153\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,53.296345283074274\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,51.185573692799366\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,54.047587858542634\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,54.46100226379399\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,55.98792788002098\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,55.40141262767737\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,54.3309369707514\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,64.32311877063201\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,68.74459949423547\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,69.96734181245792\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,65.62602252947966\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,63.04774476967792\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,60.14239575910125\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,60.79539662158301\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,60.25845195447737\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,61.17432296101354\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,64.26325386364236\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,50.071946675464744\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,43.760151432986675\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,44.56455551246495\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,45.61643092149109\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,43.225157711760225\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,41.3608592432905\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,43.027688256557894\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,43.31270139545589\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,43.960208472007466\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,48.04134478903688\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,47.49749163306738\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,48.670555132008865\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,51.61805060554291\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,47.746852937590376\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,40.7534049057648\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,36.11782511785983\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,33.997650227003476\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,28.76585978604388\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,25.744854697003497\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,23.415463480329723\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,28.61869135959375\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,27.44844502318866\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,31.586627408707937\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,30.40644829250427\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,31.82957444093158\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,45.57479837934987\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,50.65366642820872\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,58.20052176919625\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,66.92544537141899\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,67.76026078110203\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,67.15484316659968\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,63.87963093619776\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,67.4771894886468\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,68.82024369019933\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,67.32547861643278\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,68.05504976386474\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,69.52678108551537\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,65.365175108442\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,61.87454417648889\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,54.83107333555508\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,56.13837125568078\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,54.945046579170814\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,55.338029867146595\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,46.27951634099313\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,40.840489067314245\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,42.967322122246316\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,42.556561263388964\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,44.000011522675464\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,48.07179414838469\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,57.28026129879681\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,53.34482697827913\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,44.541800382127754\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,46.29365909883764\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,36.574629802459604\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,39.027883262634575\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,40.35073906216166\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,42.55205044363348\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,43.16807247587551\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,42.857414304843374\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,43.591110970926195\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,45.255796979910485\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,43.97171631248279\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,38.49439771425346\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,35.444820395306785\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,33.5500861862645\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,27.822455173222252\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,25.122008311286212\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,22.872670551353785\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,29.490230515552437\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,26.711334141632143\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,33.51331385293828\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,31.663057200405994\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,34.10460197223592\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,30.805121048000697\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,30.226362548459917\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,36.29639983309798\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,34.15942458390327\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,30.4104350691054\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,42.62870944732302\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,40.668510590377466\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,32.3073217193997\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,37.630022809421106\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,37.59131355248478\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,41.965575487423976\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,45.62132056833549\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,48.38818316447544\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,50.41900883851606\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,48.48638155771851\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,50.97792940964115\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,49.60974380780149\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,56.60828237975602\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,56.50979456030449\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,53.190984122885354\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,55.63124678335858\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,45.21637209112506\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,40.43728584483556\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,41.49778907229787\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,45.678419570541934\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,41.88721996692605\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,41.80410451756971\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,41.326833345335864\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,41.13253500012407\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,40.327924261232745\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,40.46609148147846\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,39.27529217949145\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,37.926217569932724\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,37.23792384318806\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,36.926904437670764\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,37.620819287256815\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,37.73215820625164\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,37.275437506519026\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,38.18524240498071\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,41.69132005898322\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,42.869033031131686\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,47.37368845617312\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,49.11009178579603\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,51.53316898316209\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,53.45492243375477\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,57.198219138403836\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,59.165637332559754\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,65.62087074807019\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,66.62093160850958\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,64.6012339289775\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,64.46092432855372\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,65.73938228783345\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,65.54351190723511\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,66.43264910459982\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,64.43246501536694\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,62.7136214554096\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,61.27294256000568\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,60.28754774013928\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,55.40721853792588\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,54.42097640696881\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,54.19935509679263\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,51.05954489998078\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,46.19906671729042\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,42.77132612557663\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,38.645770419965075\n"
  },
  {
    "path": "Tests/TestData/spy_with_don50.txt",
    "content": "Date,Open,High,Low,Close,Donchian Channels 50 Top,Donchian Channels 50 Bottom,Donchian Channels 50 Mean\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,156.04,155.31,155.675\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,156.04,154.2,155.12\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,156.04,153.59,154.815\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,156.04,153.59,154.815\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,156.04,153.59,154.815\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,156.04,153.59,154.815\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,156.27,153.59,154.93\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,156.27,153.59,154.93\n3/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,156.27,153.59,154.93\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,156.85,153.59,155.22\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,156.91,153.59,155.25\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,157.21,153.59,155.4\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,157.21,153.59,155.4\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,157.21,153.59,155.4\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,157.21,153.59,155.4\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,157.21,153.59,155.4\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,157.32,153.59,155.455\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,158.87,153.59,156.23\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,159.71,153.59,156.65\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,159.71,153.59,156.65\n4/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,159.71,153.59,156.65\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,159.71,153.59,156.65\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,159.71,153.59,156.65\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,159.71,153.55,156.63\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,159.71,153.55,156.63\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,159.71,153.55,156.63\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,159.71,153.55,156.63\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,159.71,153.55,156.63\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,159.71,153.55,156.63\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,159.71,153.55,156.63\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,159.71,153.55,156.63\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,159.72,153.55,156.635\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,159.72,153.55,156.635\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,159.89,153.55,156.72\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,161.88,153.55,157.715\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,162.01,153.55,157.78\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,162.65,153.55,158.1\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,163.39,153.55,158.47\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,163.7,153.55,158.625\n5/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,163.7,153.55,158.625\n5/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,163.81,153.55,158.68\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,165.35,153.55,159.45\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,166.45,153.55,160.0\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,166.45,153.55,160.0\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,167.04,153.55,160.295\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,167.58,153.55,160.565\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,167.8,153.55,160.675\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,169.07,153.55,161.31\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,169.07,153.55,161.31\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,169.07,153.55,161.31\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,169.07,153.55,161.31\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,169.07,153.55,161.31\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,169.07,153.55,161.31\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,169.07,153.55,161.31\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,169.07,153.55,161.31\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,169.07,153.55,161.31\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,169.07,153.55,161.31\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,169.07,153.55,161.31\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,169.07,153.55,161.31\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,169.07,153.55,161.31\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,169.07,153.55,161.31\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,169.07,153.55,161.31\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,169.07,153.55,161.31\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,169.07,153.55,161.31\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,169.07,153.55,161.31\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,169.07,153.55,161.31\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,169.07,153.55,161.31\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,169.07,153.55,161.31\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,169.07,153.55,161.31\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,169.07,153.55,161.31\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,169.07,153.55,161.31\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,169.07,153.55,161.31\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,169.07,153.55,161.31\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,169.07,154.12,161.595\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,169.07,154.75,161.91\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,169.07,155.73,162.4\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,169.07,155.73,162.4\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,169.07,155.73,162.4\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,169.07,155.73,162.4\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,169.07,155.73,162.4\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,169.07,155.73,162.4\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,169.07,155.73,162.4\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,169.07,155.73,162.4\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,169.07,155.73,162.4\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,169.07,155.73,162.4\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,169.07,155.73,162.4\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,169.27,155.73,162.5\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,169.27,155.73,162.5\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,169.74,155.73,162.735\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,169.83,155.73,162.78\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,169.86,155.73,162.795\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,169.86,155.73,162.795\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,169.86,155.73,162.795\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,169.86,155.73,162.795\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,169.86,155.73,162.795\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,169.86,155.73,162.795\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,170.81,155.73,163.27\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,170.97,155.73,163.35\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,170.97,155.73,163.35\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,170.97,155.73,163.35\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,170.97,155.73,163.35\n8/8/2013 12:00:00 AM,170.0,170.18,168.93,169.8,170.97,155.73,163.35\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,170.97,155.73,163.35\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,170.97,155.73,163.35\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,170.97,155.73,163.35\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,170.97,155.73,163.35\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,170.97,155.73,163.35\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,170.97,155.73,163.35\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,170.97,155.73,163.35\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,170.97,155.73,163.35\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,170.97,155.73,163.35\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,170.97,155.73,163.35\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,170.97,155.73,163.35\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,170.97,155.73,163.35\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,170.97,155.73,163.35\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,170.97,155.73,163.35\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,170.97,155.73,163.35\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,170.97,155.73,163.35\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,170.97,155.73,163.35\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,170.97,157.42,164.195\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,170.97,159.25,165.11\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,170.97,159.86,165.415\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,170.97,159.86,165.415\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,170.97,160.22,165.595\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,170.97,160.22,165.595\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,170.97,160.22,165.595\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,170.97,161.3,166.135\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,171.24,163.05,167.145\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,171.24,163.05,167.145\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,173.52,163.05,168.285\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,173.6,163.05,168.325\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,173.6,163.05,168.325\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,173.6,163.05,168.325\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,173.6,163.05,168.325\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,173.6,163.05,168.325\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,173.6,163.05,168.325\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,173.6,163.05,168.325\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,173.6,163.05,168.325\n10/1/2013 12:00:00 AM,168.14,169.5,168.0,169.34,173.6,163.05,168.325\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,173.6,163.05,168.325\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,173.6,163.05,168.325\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,173.6,163.05,168.325\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,173.6,163.05,168.325\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,173.6,163.05,168.325\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,173.6,163.05,168.325\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,173.6,163.05,168.325\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,173.6,163.05,168.325\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,173.6,163.05,168.325\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,173.6,163.05,168.325\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,173.6,163.05,168.325\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,173.6,163.05,168.325\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,174.51,163.05,168.78\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,174.75,163.05,168.9\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,175.93,163.05,169.49\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,175.93,163.05,169.49\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,175.93,163.05,169.49\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,176.0,163.05,169.525\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,176.47,163.05,169.76\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,177.24,163.05,170.145\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,177.51,163.05,170.28\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,177.51,163.05,170.28\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,177.51,163.05,170.28\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,177.51,163.05,170.28\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,177.51,163.05,170.28\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,177.51,163.05,170.28\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,177.64,163.17,170.405\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,177.64,163.17,170.405\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,177.64,163.7,170.67\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,177.64,164.14,170.89\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,178.41,164.48,171.445\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,179.42,164.48,171.95\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,180.12,164.53,172.325\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,180.5,164.53,172.515\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,180.5,164.53,172.515\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,180.5,164.53,172.515\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,180.5,164.53,172.515\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,180.83,164.53,172.68\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,181.17,164.53,172.85\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,181.22,164.53,172.875\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,181.24,164.53,172.885\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,181.75,164.53,173.14\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,181.75,164.53,173.14\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,181.75,164.53,173.14\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,181.75,164.53,173.14\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,181.75,164.53,173.14\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,181.75,164.53,173.14\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,181.75,164.53,173.14\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,181.75,164.53,173.14\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,181.75,164.53,173.14\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,181.75,164.53,173.14\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,181.75,164.53,173.14\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,181.75,164.53,173.14\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,181.75,164.53,173.14\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,181.75,164.53,173.14\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,181.75,167.23,174.49\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,181.99,168.77,175.38\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,182.64,169.08,175.86\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,183.01,169.47,176.24\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,183.96,170.63,177.295\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,184.18,171.34,177.76\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,184.18,173.51,178.845\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,184.69,173.96,179.325\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,184.69,173.96,179.325\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,184.69,173.96,179.325\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,184.69,174.51,179.6\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,184.69,174.76,179.725\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,184.69,174.76,179.725\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,184.69,174.76,179.725\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,184.69,174.76,179.725\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,184.69,174.76,179.725\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,184.69,174.76,179.725\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,184.94,174.76,179.85\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,184.94,174.76,179.85\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,184.94,174.76,179.85\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,184.94,174.76,179.85\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,184.94,174.85,179.895\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,184.94,176.09,180.515\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,184.94,176.09,180.515\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,184.94,176.09,180.515\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,184.94,177.12,181.03\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,184.94,176.88,180.91\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,184.94,176.88,180.91\n1/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,184.94,176.88,180.91\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,184.94,173.83,179.385\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,184.94,173.83,179.385\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,184.94,173.71,179.325\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,184.94,173.71,179.325\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,184.94,173.71,179.325\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,184.94,173.71,179.325\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,184.94,173.71,179.325\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,184.94,173.71,179.325\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,184.94,173.71,179.325\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,184.94,173.71,179.325\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,184.94,173.71,179.325\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,184.95,173.71,179.33\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,184.95,173.71,179.33\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,184.95,173.71,179.33\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,186.15,173.71,179.93\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,186.15,173.71,179.93\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,186.15,173.71,179.93\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,186.15,173.71,179.93\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,187.15,173.71,180.43\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,187.15,173.71,180.43\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,187.98,173.71,180.845\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,188.07,173.71,180.89\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,188.61,173.71,181.16\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,188.96,173.71,181.335\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,188.96,173.71,181.335\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,188.96,173.71,181.335\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,188.96,173.71,181.335\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,188.96,173.71,181.335\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,188.96,173.71,181.335\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,188.96,173.71,181.335\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,188.96,173.71,181.335\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,188.96,173.71,181.335\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,188.96,173.71,181.335\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,189.02,173.71,181.365\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,189.02,173.71,181.365\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,189.02,173.71,181.365\n3/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,189.02,173.71,181.365\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,189.02,173.71,181.365\n3/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,189.02,173.71,181.365\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,189.02,173.71,181.365\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,189.02,173.71,181.365\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,189.13,173.71,181.42\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,189.22,173.71,181.465\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,189.7,173.71,181.705\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,189.7,173.71,181.705\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,189.7,173.71,181.705\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,189.7,173.71,181.705\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,189.7,173.71,181.705\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,189.7,173.71,181.705\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,189.7,173.71,181.705\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,189.7,173.71,181.705\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,189.7,173.71,181.705\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,189.7,175.22,182.46\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,189.7,177.73,183.715\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,189.7,179.21,184.455\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,189.7,180.04,184.87\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,189.7,180.83,185.265\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,189.7,180.83,185.265\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,189.7,181.31,185.505\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,189.7,181.31,185.505\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,189.7,181.31,185.505\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,189.7,181.31,185.505\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,189.7,181.31,185.505\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,189.7,181.31,185.505\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,189.7,181.31,185.505\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,189.7,181.31,185.505\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,189.7,181.31,185.505\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,189.7,181.31,185.505\n5/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,189.88,181.31,185.595\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,190.42,181.31,185.865\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,190.42,181.31,185.865\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,190.42,181.31,185.865\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,190.42,181.31,185.865\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,190.42,181.31,185.865\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,190.42,181.31,185.865\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,190.42,181.31,185.865\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,190.42,181.31,185.865\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,190.48,181.31,185.895\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,191.58,181.31,186.445\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,191.82,181.31,186.565\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,192.4,181.31,186.855\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,192.8,181.31,187.055\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,192.99,181.31,187.15\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,192.99,181.31,187.15\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,193.3,181.31,187.305\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,194.65,181.31,187.98\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,195.43,181.31,188.37\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,196.05,181.31,188.68\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,196.05,181.31,188.68\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,196.05,181.31,188.68\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,196.05,181.31,188.68\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,196.05,181.31,188.68\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,196.05,181.31,188.68\n6/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,196.05,181.31,188.68\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,196.37,181.31,188.84\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,196.6,181.31,188.955\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,196.6,181.31,188.955\n6/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,196.6,181.31,188.955\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,196.6,181.44,189.02\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,196.6,181.51,189.055\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,196.6,184.65,190.625\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,196.6,184.96,190.78\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,196.6,184.96,190.78\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,197.63,184.96,191.295\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,197.63,184.96,191.295\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,198.29,184.96,191.625\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,198.29,184.96,191.625\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,198.29,184.96,191.625\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,198.29,186.01,192.15\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,198.29,186.01,192.15\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,198.29,186.01,192.15\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,198.29,186.01,192.15\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,198.29,186.01,192.15\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,198.29,186.01,192.15\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,198.29,186.01,192.15\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,198.29,186.48,192.385\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,198.29,186.48,192.385\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,198.56,186.48,192.52\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,198.85,186.48,192.665\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,199.06,186.48,192.77\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,199.06,186.48,192.77\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,199.06,186.72,192.89\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,199.06,187.07,193.065\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,199.06,187.07,193.065\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,199.06,188.06,193.56\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,199.06,188.86,193.96\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,199.06,189.59,194.325\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,199.06,190.95,195.005\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,199.06,191.06,195.06\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,199.06,190.55,194.805\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,199.06,190.55,194.805\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,199.06,190.55,194.805\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,199.06,190.55,194.805\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,199.06,190.55,194.805\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,199.06,190.55,194.805\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,199.06,190.55,194.805\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,199.06,190.55,194.805\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,199.06,190.55,194.805\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,199.16,190.55,194.855\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,199.76,190.55,195.155\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,199.76,190.55,195.155\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,200.59,190.55,195.57\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,200.82,190.55,195.685\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,200.82,190.55,195.685\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,200.82,190.55,195.685\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,200.82,190.55,195.685\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,200.99,190.55,195.77\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,201.41,190.55,195.98\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,201.58,190.55,196.065\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,201.58,190.55,196.065\n9/8/2014 12:00:00 AM,200.94,201.21,200.0,200.59,201.58,190.55,196.065\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,201.58,190.55,196.065\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,201.58,190.55,196.065\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,201.58,190.55,196.065\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,201.58,190.55,196.065\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,201.58,190.55,196.065\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,201.58,190.55,196.065\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,201.68,190.55,196.115\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,201.85,190.55,196.2\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,201.9,190.55,196.225\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,201.9,190.55,196.225\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,201.9,190.55,196.225\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,201.9,190.55,196.225\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,201.9,190.55,196.225\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,201.9,190.55,196.225\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,201.9,190.55,196.225\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,201.9,190.55,196.225\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,201.9,190.55,196.225\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,201.9,190.55,196.225\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,201.9,190.55,196.225\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,201.9,190.55,196.225\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,201.9,190.55,196.225\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,201.9,190.55,196.225\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,201.9,190.55,196.225\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,201.9,190.49,196.195\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,201.9,187.3,194.6\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,201.9,187.04,194.47\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,201.9,181.92,191.91\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,201.9,181.92,191.91\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,201.9,181.92,191.91\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,201.9,181.92,191.91\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,201.9,181.92,191.91\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,201.9,181.92,191.91\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,201.9,181.92,191.91\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,201.9,181.92,191.91\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,201.9,181.92,191.91\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,201.9,181.92,191.91\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,201.9,181.92,191.91\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,201.9,181.92,191.91\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,201.9,181.92,191.91\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,202.45,181.92,192.185\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,202.45,181.92,192.185\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,202.59,181.92,192.255\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,203.26,181.92,192.59\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,203.6,181.92,192.76\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,204.04,181.92,192.98\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,204.31,181.92,193.115\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,204.31,181.92,193.115\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,204.83,181.92,193.375\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,204.83,181.92,193.375\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,204.83,181.92,193.375\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,205.92,181.92,193.92\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,205.92,181.92,193.92\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,205.92,181.92,193.92\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,207.84,181.92,194.88\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,207.84,181.92,194.88\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,207.84,181.92,194.88\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,207.84,181.92,194.88\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,207.87,181.92,194.895\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,207.87,181.92,194.895\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,207.87,181.92,194.895\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,208.15,181.92,195.035\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,208.26,181.92,195.09\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208.0,208.47,181.92,195.195\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,208.47,181.92,195.195\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,208.47,181.92,195.195\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,208.47,181.92,195.195\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,208.47,181.92,195.195\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,208.47,181.92,195.195\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,208.47,181.92,195.195\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,208.47,181.92,195.195\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,208.47,181.92,195.195\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,212.97,181.92,197.445\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,212.97,181.92,197.445\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,212.97,181.92,197.445\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,212.97,181.92,197.445\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,212.97,181.92,197.445\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,212.97,182.89,197.93\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,212.97,187.62,200.295\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,212.97,188.07,200.52\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,212.97,191.48,202.225\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,212.97,192.61,202.79\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,212.97,194.26,203.615\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,212.97,194.49,203.73\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,212.97,195.03,204.0\n1/8/2015 12:00:00 AM,204.0,206.16,203.99,205.9,212.97,196.73,204.85\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,212.97,196.8,204.885\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,212.97,197.4,205.185\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,212.97,197.86,205.415\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,212.97,197.86,205.415\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,212.97,197.86,205.415\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,212.97,197.86,205.415\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,212.97,197.86,205.415\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,212.97,197.86,205.415\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,212.97,197.86,205.415\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,212.97,197.86,205.415\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,212.97,197.86,205.415\n1/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,212.97,197.86,205.415\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,212.97,197.86,205.415\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,212.97,197.86,205.415\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,212.97,197.86,205.415\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,212.97,197.86,205.415\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,212.97,197.86,205.415\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,212.97,197.86,205.415\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,212.97,197.86,205.415\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,212.97,197.86,205.415\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,212.97,197.86,205.415\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,212.97,197.86,205.415\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,212.97,197.86,205.415\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,212.97,197.86,205.415\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,212.97,197.86,205.415\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,212.97,197.86,205.415\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,212.97,197.86,205.415\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,212.97,197.86,205.415\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,212.97,197.86,205.415\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,212.97,197.86,205.415\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,212.97,197.86,205.415\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,212.97,197.86,205.415\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,212.97,197.86,205.415\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,212.97,197.86,205.415\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,212.97,197.86,205.415\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,212.97,197.86,205.415\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,212.24,197.86,205.05\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,212.24,197.86,205.05\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,212.24,197.86,205.05\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,212.24,197.86,205.05\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,212.24,197.86,205.05\n3/11/2015 3:42:16 PM,205.29,205.5,204.4,204.48,,,\n"
  },
  {
    "path": "Tests/TestData/spy_with_fisher.txt",
    "content": "Date,Open,High,Low,Close,Fisher Transform 10\n4/17/2014 12:00:00 AM,185.88,186.91,185.56,186.39,\n4/21/2014 12:00:00 AM,186.44,187.1,186.21,187.04,\n4/22/2014 12:00:00 AM,187.23,188.4,187.13,187.89,\n4/23/2014 12:00:00 AM,187.81,187.92,187.3,187.45,\n4/24/2014 12:00:00 AM,188.37,188.39,186.93,187.83,\n4/25/2014 12:00:00 AM,187.21,187.33,185.87,186.29,\n4/28/2014 12:00:00 AM,187.05,187.69,184.96,186.88,\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,\n4/30/2014 12:00:00 AM,187.44,188.5,187.18,188.31,\n5/1/2014 12:00:00 AM,188.22,188.84,187.73,188.32,0.342828254\n5/2/2014 12:00:00 AM,188.31,189.14,187.78,188.06,0.791373872\n5/5/2014 12:00:00 AM,187.14,188.55,186.62,188.42,0.854045187\n5/6/2014 12:00:00 AM,188,188.13,186.74,186.78,0.736979019\n5/7/2014 12:00:00 AM,187.43,187.97,186.01,187.88,0.445481344\n5/8/2014 12:00:00 AM,187.67,189.05,187.08,187.68,0.488179006\n5/9/2014 12:00:00 AM,187.69,188.04,186.83,187.96,0.433232731\n5/12/2014 12:00:00 AM,188.76,189.88,188,189.78,0.707901794\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,1.103714942\n5/14/2014 12:00:00 AM,189.79,189.88,188.79,189.06,1.235542109\n5/15/2014 12:00:00 AM,188.67,188.72,186.48,187.4,0.817985343\n5/16/2014 12:00:00 AM,187.51,188.13,186.72,188.05,0.30344568\n5/19/2014 12:00:00 AM,187.69,188.89,187.52,188.74,0.008558511\n5/20/2014 12:00:00 AM,188.64,188.67,187.07,187.55,-0.238603695\n5/21/2014 12:00:00 AM,188.1,189.22,188.06,189.13,-0.310880008\n5/22/2014 12:00:00 AM,189.18,189.98,188.86,189.59,-0.119087683\n5/23/2014 12:00:00 AM,189.75,190.48,189.59,190.35,0.293999119\n5/27/2014 12:00:00 AM,191.05,191.58,190.95,191.52,0.776160654\n5/28/2014 12:00:00 AM,191.52,191.82,191.06,191.38,1.262292233\n5/29/2014 12:00:00 AM,191.82,192.4,191.33,192.37,1.733520295\n5/30/2014 12:00:00 AM,192.19,192.8,192.03,192.68,2.187245752\n6/2/2014 12:00:00 AM,192.95,192.99,191.97,192.9,2.625974204\n6/3/2014 12:00:00 AM,192.4,192.9,192.25,192.8,3.053218695\n6/4/2014 12:00:00 AM,192.47,193.3,192.26,193.19,3.472134952\n6/5/2014 12:00:00 AM,193.41,194.65,192.7,194.45,3.885190495\n6/6/2014 12:00:00 AM,194.87,195.43,194.78,195.38,4.294194778\n6/9/2014 12:00:00 AM,195.35,196.05,195.17,195.58,4.700429396\n6/10/2014 12:00:00 AM,195.33,195.64,194.92,195.6,4.085720805\n6/11/2014 12:00:00 AM,194.9,195.12,194.48,194.92,3.190139966\n6/12/2014 12:00:00 AM,194.65,194.8,193.11,193.54,2.19277169\n6/13/2014 12:00:00 AM,193.9,194.32,193.3,194.13,1.416017048\n6/16/2014 12:00:00 AM,193.89,194.7,193.66,194.29,0.938162223\n6/17/2014 12:00:00 AM,194.02,194.97,193.81,194.83,0.668704904\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,0.740568462\n6/19/2014 12:00:00 AM,196.43,196.6,195.8,196.48,1.045072632\n6/20/2014 12:00:00 AM,196.03,196.1,195.7,195.94,1.282738083\n6/23/2014 12:00:00 AM,195.97,196.05,195.52,195.88,1.4080557\n6/24/2014 12:00:00 AM,195.53,196.5,194.48,194.7,1.34576642\n6/25/2014 12:00:00 AM,194.25,195.78,194.25,195.58,1.075325285\n6/26/2014 12:00:00 AM,195.61,195.63,194.13,195.44,0.762838453\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,0.595059081\n6/30/2014 12:00:00 AM,195.7,196.16,195.53,195.72,0.653378563\n7/1/2014 12:00:00 AM,196.19,197.63,196.13,197.03,0.957834356\n7/2/2014 12:00:00 AM,197.05,197.48,196.96,197.23,1.354943295\n7/3/2014 12:00:00 AM,197.79,198.29,197.64,198.2,1.781561664\n7/7/2014 12:00:00 AM,197.82,197.98,197.22,197.51,1.960161917\n7/8/2014 12:00:00 AM,197.15,197.22,195.76,196.24,1.588798277\n7/9/2014 12:00:00 AM,196.73,197.3,196.31,197.12,1.273834411\n7/10/2014 12:00:00 AM,195.22,196.86,195.06,196.34,0.83937228\n7/11/2014 12:00:00 AM,196.22,196.75,195.78,196.61,0.44947391\n7/14/2014 12:00:00 AM,197.61,197.86,197.44,197.6,0.482162373\n7/15/2014 12:00:00 AM,197.72,198.1,196.36,197.23,0.503780329\n7/16/2014 12:00:00 AM,198.11,198.26,197.42,197.96,0.750370513\n7/17/2014 12:00:00 AM,197.35,198.1,195.43,195.71,0.624000583\n7/18/2014 12:00:00 AM,196.35,197.91,196.24,197.71,0.540690742\n7/21/2014 12:00:00 AM,197.09,197.5,196.43,197.34,0.44554143\n7/22/2014 12:00:00 AM,198.01,198.56,197.87,198.2,0.70270998\n7/23/2014 12:00:00 AM,198.5,198.85,198.1,198.64,1.091033076\n7/24/2014 12:00:00 AM,198.83,199.06,198.45,198.65,1.521672251\n7/25/2014 12:00:00 AM,198.09,198.26,197.33,197.72,1.330406892\n7/28/2014 12:00:00 AM,197.76,198.09,196.62,197.8,0.879167745\n7/29/2014 12:00:00 AM,198.17,198.45,196.92,196.95,0.556446366\n7/30/2014 12:00:00 AM,197.65,197.91,196.16,196.98,0.114260616\n7/31/2014 12:00:00 AM,195.61,195.78,192.97,193.09,-0.413713638\n8/1/2014 12:00:00 AM,192.56,193.76,191.57,192.5,-0.938468288\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,-1.322636428\n8/5/2014 12:00:00 AM,193.1,193.6,191.31,192.01,-1.744035589\n8/6/2014 12:00:00 AM,191.11,192.89,191.08,192.07,-2.173550077\n8/7/2014 12:00:00 AM,192.94,193.13,190.55,191.03,-2.600616863\n8/8/2014 12:00:00 AM,191.46,193.37,190.95,193.24,-2.782999315\n8/11/2014 12:00:00 AM,193.96,194.66,193.71,193.8,-2.201390604\n8/12/2014 12:00:00 AM,193.61,194.15,192.94,193.53,-1.736407603\n8/13/2014 12:00:00 AM,194.29,195.06,193.96,194.84,-0.914759343\n8/14/2014 12:00:00 AM,195.16,195.76,194.98,195.76,-0.149144953\n8/15/2014 12:00:00 AM,196.47,196.65,194.31,195.72,0.515873529\n8/18/2014 12:00:00 AM,196.8,197.45,196.69,197.36,1.096872457\n8/19/2014 12:00:00 AM,197.84,198.54,197.44,198.39,1.61751554\n8/20/2014 12:00:00 AM,198.12,199.16,198.08,198.92,2.097155968\n8/21/2014 12:00:00 AM,199.09,199.76,198.93,199.5,2.549603054\n8/22/2014 12:00:00 AM,199.34,199.69,198.74,199.19,2.875543867\n8/25/2014 12:00:00 AM,200.14,200.59,199.15,200.2,3.24542414\n8/26/2014 12:00:00 AM,200.33,200.82,200.28,200.33,3.635023403\n8/27/2014 12:00:00 AM,200.43,200.57,199.94,200.25,3.546088404\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,3.087214511\n8/29/2014 12:00:00 AM,200.45,200.73,199.82,200.71,2.827859728\n9/2/2014 12:00:00 AM,200.97,201,199.86,200.61,2.76228185\n9/3/2014 12:00:00 AM,201.38,201.41,200.22,200.5,2.940735242\n9/4/2014 12:00:00 AM,200.84,201.58,199.66,200.21,2.774762046\n9/5/2014 12:00:00 AM,200.17,201.19,199.41,201.11,2.246245391\n9/8/2014 12:00:00 AM,200.92,201.21,200,200.59,1.907811365\n9/9/2014 12:00:00 AM,200.41,200.55,198.91,199.32,1.063452865\n9/10/2014 12:00:00 AM,199.43,200.2,198.77,200.07,0.268944645\n9/11/2014 12:00:00 AM,199.27,200.33,199.12,200.3,-0.269124463\n9/12/2014 12:00:00 AM,200.1,200.12,198.56,199.13,-0.807066753\n9/15/2014 12:00:00 AM,199.16,199.32,198.38,198.98,-1.317516853\n9/16/2014 12:00:00 AM,198.61,200.84,198.5,200.48,-1.261526148\n9/17/2014 12:00:00 AM,200.77,201.68,199.75,200.75,-0.661913925\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,-0.011367484\n9/19/2014 12:00:00 AM,201.52,201.9,200.29,200.7,0.468505655\n9/22/2014 12:00:00 AM,200.35,200.38,198.73,199.15,0.378356525\n9/23/2014 12:00:00 AM,198.43,199.26,197.95,198.01,-0.049358652\n9/24/2014 12:00:00 AM,198.04,199.69,197.52,199.56,-0.556610532\n9/25/2014 12:00:00 AM,199.04,199.05,196.27,196.34,-1.064404308\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,-1.551669826\n9/29/2014 12:00:00 AM,196.2,197.89,196.05,197.54,-2.016570472\n9/30/2014 12:00:00 AM,197.69,198.3,196.61,197.02,-2.182257235\n10/1/2014 12:00:00 AM,196.7,196.77,193.91,194.35,-2.480864166\n10/2/2014 12:00:00 AM,194.18,195.06,192.35,194.38,-2.840544701\n10/3/2014 12:00:00 AM,195.68,196.94,195.08,196.52,-2.263430121\n10/6/2014 12:00:00 AM,197.34,197.6,195.58,196.29,-1.557769197\n10/7/2014 12:00:00 AM,195.28,195.72,193.22,193.26,-1.323284807\n10/8/2014 12:00:00 AM,193.37,196.92,192.36,196.64,-1.219650979\n10/9/2014 12:00:00 AM,196.33,196.6,192.58,192.74,-1.177424661\n10/10/2014 12:00:00 AM,192.69,193.65,190.49,190.54,-1.406947056\n10/13/2014 12:00:00 AM,190.46,191.15,187.3,187.41,-1.753077414\n10/14/2014 12:00:00 AM,188.42,189.82,187.04,187.7,-2.1462045\n10/15/2014 12:00:00 AM,185.16,187.69,181.92,186.43,-2.555861807\n10/16/2014 12:00:00 AM,183.06,187.58,182.89,186.27,-2.806897791\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-2.316456637\n10/20/2014 12:00:00 AM,188.13,190.45,188.07,190.3,-1.72795817\n10/21/2014 12:00:00 AM,191.68,194.2,191.48,194.07,-1.000776931\n10/22/2014 12:00:00 AM,194.41,194.91,192.61,192.69,-0.315376753\n10/23/2014 12:00:00 AM,194.62,196.2,194.26,194.93,0.330229878\n10/24/2014 12:00:00 AM,195.25,196.49,194.49,196.43,0.911883148\n10/27/2014 12:00:00 AM,195.73,196.45,195.03,196.16,1.438694971\n10/28/2014 12:00:00 AM,196.82,198.42,196.73,198.41,1.924935327\n10/29/2014 12:00:00 AM,198.55,199.12,196.8,198.11,2.382881528\n10/30/2014 12:00:00 AM,197.58,199.95,197.4,199.38,2.821634064\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,3.247540998\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,3.664904946\n11/4/2014 12:00:00 AM,201.23,201.6,200.06,201.07,3.267909965\n11/5/2014 12:00:00 AM,202.54,202.59,201.45,202.34,3.278911736\n11/6/2014 12:00:00 AM,202.39,203.26,201.64,203.15,3.490761338\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,3.800977202\n11/10/2014 12:00:00 AM,203.38,204.04,203.13,203.98,4.159020686\n11/11/2014 12:00:00 AM,204.06,204.31,203.65,204.18,4.540079943\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,4.281043141\n11/13/2014 12:00:00 AM,204.16,204.83,203.21,204.19,4.35471112\n11/14/2014 12:00:00 AM,204.1,204.49,203.72,204.24,4.593749105\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,4.914819266\n11/18/2014 12:00:00 AM,204.44,205.92,204.44,205.55,5.276470504\n11/19/2014 12:00:00 AM,205.31,205.55,204.3,205.22,4.323946576\n11/20/2014 12:00:00 AM,204.26,205.71,204.18,205.58,3.54113845\n11/21/2014 12:00:00 AM,207.64,207.84,205.98,206.68,3.360325842\n11/24/2014 12:00:00 AM,207.17,207.39,206.91,207.26,3.476976594\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,3.740057527\n11/26/2014 12:00:00 AM,207.29,207.76,207.03,207.64,4.074840348\n11/28/2014 12:00:00 AM,207.49,207.87,206.91,207.2,4.413998517\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,3.073892226\n12/2/2014 12:00:00 AM,205.81,207.34,205.78,207.08,2.193017935\n12/3/2014 12:00:00 AM,207.3,208.15,207.1,207.89,1.995380597\n12/4/2014 12:00:00 AM,207.54,208.26,206.7,207.66,2.027525426\n12/5/2014 12:00:00 AM,207.87,208.47,207.55,208,2.26444295\n12/8/2014 12:00:00 AM,207.52,208.12,205.93,206.61,1.796729731\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,0.957943656\n12/10/2014 12:00:00 AM,205.91,205.98,202.93,203.16,0.180264305\n12/11/2014 12:00:00 AM,203.88,206.19,203.71,204.19,-0.372820871\n12/12/2014 12:00:00 AM,202.64,203.82,200.85,200.89,-0.911036996\n12/15/2014 12:00:00 AM,201.98,202.53,198.78,199.51,-1.417689851\n12/16/2014 12:00:00 AM,198.58,202.4,197.86,197.91,-1.894778266\n12/17/2014 12:00:00 AM,198.44,202.34,198.29,201.79,-2.281065681\n12/18/2014 12:00:00 AM,204.74,212.97,203.92,206.78,-1.399145206\n12/19/2014 12:00:00 AM,206.43,207.33,205.61,206.52,-0.695845575\n12/22/2014 12:00:00 AM,206.75,207.47,206.46,207.47,-0.129491217\n12/23/2014 12:00:00 AM,208.17,208.23,207.4,207.75,0.387885242\n12/24/2014 12:00:00 AM,208.02,208.34,207.72,207.77,0.858184094\n12/26/2014 12:00:00 AM,208.31,208.85,208.25,208.44,1.335471665\n12/29/2014 12:00:00 AM,208.22,208.97,208.14,208.72,1.800582644\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,2.075252619\n12/31/2014 12:00:00 AM,207.99,208.19,205.39,205.54,1.992434884\n1/2/2015 12:00:00 AM,206.38,206.88,204.18,205.43,1.164907553\n1/5/2015 12:00:00 AM,204.17,204.37,201.35,201.72,0.360858915\n1/6/2015 12:00:00 AM,202.09,202.72,198.86,199.82,-0.337480384\n1/7/2015 12:00:00 AM,201.42,202.72,200.88,202.31,-0.806145612\n1/8/2015 12:00:00 AM,204.01,206.16,203.99,205.9,-0.760659008\n1/9/2015 12:00:00 AM,206.4,206.42,203.51,204.25,-0.588282286\n1/12/2015 12:00:00 AM,204.41,204.6,201.92,202.65,-0.557475987\n1/13/2015 12:00:00 AM,204.12,205.48,200.51,202.08,-0.58707958\n1/14/2015 12:00:00 AM,199.65,201.1,198.57,200.86,-0.884076505\n1/15/2015 12:00:00 AM,201.63,202.01,198.88,199.02,-1.158310636\n1/16/2015 12:00:00 AM,198.77,201.82,198.55,201.63,-1.441949865\n1/20/2015 12:00:00 AM,202.4,202.72,200.17,202.06,-1.405833946\n1/21/2015 12:00:00 AM,201.5,203.66,200.94,203.08,-1.148124039\n1/22/2015 12:00:00 AM,203.99,206.26,202.33,206.1,-0.622371181\n1/23/2015 12:00:00 AM,205.79,206.1,204.81,204.97,-0.004237614\n1/26/2015 12:00:00 AM,204.71,205.56,203.85,205.45,0.471790544\n1/27/2015 12:00:00 AM,202.97,204.12,201.74,202.74,0.577799086\n1/28/2015 12:00:00 AM,204.17,204.29,199.91,200.14,0.446741794\n1/29/2015 12:00:00 AM,200.38,202.3,198.68,201.99,0.034229283\n1/30/2015 12:00:00 AM,200.57,202.17,199.13,199.45,-0.402967617\n2/2/2015 12:00:00 AM,200.05,202.03,197.86,201.92,-0.888388467\n2/3/2015 12:00:00 AM,203,204.85,202.55,204.84,-0.731367442\n2/4/2015 12:00:00 AM,203.92,205.38,203.51,204.06,-0.34394608\n2/5/2015 12:00:00 AM,204.86,206.3,204.77,206.12,0.187286813\n2/6/2015 12:00:00 AM,206.56,207.24,204.92,205.55,0.727725267\n2/9/2015 12:00:00 AM,204.77,205.64,204.14,204.63,1.022947824\n2/10/2015 12:00:00 AM,205.88,207.12,204.68,206.81,1.37433934\n2/11/2015 12:00:00 AM,206.61,207.45,205.83,206.93,1.778820326\n2/12/2015 12:00:00 AM,207.89,208.99,206.97,208.92,2.199552712\n2/13/2015 12:00:00 AM,209.07,209.84,208.76,209.78,2.622024788\n2/17/2015 12:00:00 AM,209.4,210.32,209.1,210.11,3.041295855\n2/18/2015 12:00:00 AM,209.66,210.22,209.34,210.13,3.456326464\n2/19/2015 12:00:00 AM,209.41,210.42,209.24,209.98,3.867505756\n2/20/2015 12:00:00 AM,209.48,211.33,208.73,211.24,4.275616016\n2/23/2015 12:00:00 AM,210.94,211.21,210.48,211.21,4.68143295\n2/24/2015 12:00:00 AM,211.12,212.05,210.76,211.81,5.085598035\n2/25/2015 12:00:00 AM,211.66,212.24,211.22,211.63,5.488600153\n2/26/2015 12:00:00 AM,211.52,211.71,210.65,211.38,4.213938127\n2/27/2015 12:00:00 AM,211.26,211.58,210.6,210.66,3.100451799\n3/2/2015 12:00:00 AM,210.78,212.06,210.72,211.99,2.47327359\n3/3/2015 12:00:00 AM,211.47,212.05,210.08,211.12,1.917743197\n3/4/2015 12:00:00 AM,210.4,210.49,209.06,210.23,1.025770818\n3/5/2015 12:00:00 AM,210.62,210.8,209.85,210.46,0.412987899\n3/6/2015 12:00:00 AM,209.42,209.94,207.1,207.5,-0.21324391\n3/9/2015 12:00:00 AM,207.74,208.79,207.55,208.36,-0.793225167\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,-1.323592928\n3/11/2015 12:00:00 AM,205.29,205.5,204.4,204.5,-1.814211536\n3/12/2015 12:00:00 AM,205.26,207.18,205.2,207.1,-1.883152507\n3/13/2015 12:00:00 AM,206.77,207.93,204.58,205.83,-1.808214165\n3/16/2015 12:00:00 AM,206.71,208.69,205.86,208.58,-1.519387116\n3/17/2015 12:00:00 AM,207.69,208.42,206.98,207.96,-1.135860211\n3/18/2015 12:00:00 AM,207.39,211.27,206.62,210.46,-0.648334538\n3/19/2015 12:00:00 AM,209.96,210.47,209.03,209.5,-0.040555206\n3/20/2015 12:00:00 AM,209.71,211.02,209.49,210.41,0.549347678\n3/23/2015 12:00:00 AM,210.42,211.11,210,210,1.094740765\n3/24/2015 12:00:00 AM,209.85,210.4,208.74,208.82,1.351493464\n3/25/2015 12:00:00 AM,209.07,209.35,205.71,205.76,1.006343018\n3/26/2015 12:00:00 AM,204.96,206.37,204.12,205.27,0.386411627\n3/27/2015 12:00:00 AM,205.13,205.95,204.9,205.74,-0.213301042\n3/30/2015 12:00:00 AM,206.98,208.61,206.96,208.25,-0.386299936\n3/31/2015 12:00:00 AM,207.26,208.1,206.36,206.43,-0.465602908\n4/1/2015 12:00:00 AM,206.39,206.42,204.51,205.7,-0.756841709\n4/2/2015 12:00:00 AM,205.62,206.98,205.4,206.44,-0.975106\n4/6/2015 12:00:00 AM,205.37,208.45,205.21,207.83,-1.025239013\n4/7/2015 12:00:00 AM,207.86,208.76,207.24,207.28,-0.756026114\n4/8/2015 12:00:00 AM,207.55,208.51,207.08,207.98,-0.256464963\n4/9/2015 12:00:00 AM,207.78,209.18,207.19,208.9,0.308627764\n4/10/2015 12:00:00 AM,209.2,210.09,208.96,210.04,0.855935091\n4/13/2015 12:00:00 AM,209.87,210.63,209.03,209.09,1.368823333\n4/14/2015 12:00:00 AM,208.85,209.71,208.1,209.49,1.519126699\n4/15/2015 12:00:00 AM,210.05,211.04,209.95,210.43,1.824668013\n4/16/2015 12:00:00 AM,210.03,210.98,209.79,210.37,2.136348624\n4/17/2015 12:00:00 AM,208.94,209.23,207.01,207.95,1.572694557\n4/20/2015 12:00:00 AM,209.06,210.25,208.96,209.85,1.239442269\n4/21/2015 12:00:00 AM,210.67,210.86,209.24,209.6,1.176517855\n4/22/2015 12:00:00 AM,210.01,210.85,208.9,210.63,1.132849731\n4/23/2015 12:00:00 AM,210.15,211.94,210.01,211.16,1.363903736\n4/24/2015 12:00:00 AM,211.66,211.97,211.11,211.65,1.712077502\n4/27/2015 12:00:00 AM,212.33,212.48,210.54,210.77,2.086671871\n4/28/2015 12:00:00 AM,210.74,211.5,209.33,211.44,1.867899077\n4/29/2015 12:00:00 AM,210.32,211.29,209.6,210.57,1.585391577\n4/30/2015 12:00:00 AM,209.9,210.35,207.62,208.46,1.016981012\n5/1/2015 12:00:00 AM,209.41,210.77,209.28,210.72,0.595157603\n5/4/2015 12:00:00 AM,211.22,212.02,211.1,211.32,0.706930419\n5/5/2015 12:00:00 AM,211.01,211.46,208.73,208.9,0.57125724\n5/6/2015 12:00:00 AM,209.54,209.93,206.76,208.04,0.097082119\n5/7/2015 12:00:00 AM,207.91,209.38,207.52,208.87,-0.4154051\n5/8/2015 12:00:00 AM,210.84,211.86,210.78,211.62,-0.217279527\n5/11/2015 12:00:00 AM,211.54,211.89,210.52,210.6,0.147526773\n5/12/2015 12:00:00 AM,209.59,210.63,208.62,209.98,0.174847899\n5/13/2015 12:00:00 AM,210.49,211.22,209.74,210.02,0.265055074\n5/14/2015 12:00:00 AM,211.24,212.32,210.91,212.21,0.614443492\n5/15/2015 12:00:00 AM,212.43,212.61,211.86,212.44,1.048655141\n5/18/2015 12:00:00 AM,212.24,213.4,212.16,213.1,1.502116074\n5/19/2015 12:00:00 AM,213.26,213.57,212.69,213.03,1.951901405\n5/20/2015 12:00:00 AM,213.16,213.78,212.5,212.88,2.391757141\n5/21/2015 12:00:00 AM,212.74,213.75,212.51,213.5,2.80862789\n5/22/2015 12:00:00 AM,213.02,213.54,212.91,212.99,3.223815867\n5/26/2015 12:00:00 AM,212.39,212.91,210.2,210.7,2.403874747\n5/27/2015 12:00:00 AM,211.23,212.98,210.76,212.7,1.68174215\n5/28/2015 12:00:00 AM,212.34,212.59,211.63,212.46,1.031361991\n5/29/2015 12:00:00 AM,212.4,212.43,210.82,211.14,0.337593814\n6/1/2015 12:00:00 AM,211.95,212.34,210.62,211.57,-0.313489458\n6/2/2015 12:00:00 AM,211.02,212.19,210.27,211.36,-0.898507136\n6/3/2015 12:00:00 AM,211.97,212.67,211.33,211.92,-0.995235958\n6/4/2015 12:00:00 AM,211.12,211.86,209.75,210.13,-1.29634953\n6/5/2015 12:00:00 AM,209.93,210.58,208.98,209.77,-1.679474553\n6/8/2015 12:00:00 AM,209.63,209.82,208.39,208.48,-2.091823122\n6/9/2015 12:00:00 AM,208.44,209.1,207.69,208.45,-2.511545121\n6/10/2015 12:00:00 AM,209.38,211.41,209.3,210.95,-1.92420328\n6/11/2015 12:00:00 AM,211.49,212.09,211.2,211.63,-1.089016023\n6/12/2015 12:00:00 AM,210.62,211.48,209.68,210.01,-0.559060311\n6/15/2015 12:00:00 AM,208.62,209.45,207.79,209.11,-0.58746432\n6/16/2015 12:00:00 AM,208.9,210.35,208.72,210.25,-0.626853643\n6/17/2015 12:00:00 AM,210.58,211.32,209.36,210.59,-0.464875858\n6/18/2015 12:00:00 AM,211.23,213.34,210.63,212.78,0.001010348\n6/19/2015 12:00:00 AM,211.42,211.55,210.36,210.81,0.30374015\n6/22/2015 12:00:00 AM,211.95,212.59,211.64,211.89,0.738075571\n6/23/2015 12:00:00 AM,212.18,212.44,211.57,212.05,1.166160952\n6/24/2015 12:00:00 AM,211.71,212.17,210.47,210.5,1.314112385\n6/25/2015 12:00:00 AM,211.13,211.25,209.77,209.86,1.135238077\n6/26/2015 12:00:00 AM,210.28,210.58,209.16,209.82,0.774582658\n6/29/2015 12:00:00 AM,208.02,209.83,205.33,205.42,0.191548172\n6/30/2015 12:00:00 AM,207.32,207.32,205.28,205.85,-0.400900909\n7/1/2015 12:00:00 AM,207.79,208.03,206.56,207.5,-0.783573644\n7/2/2015 12:00:00 AM,208.07,208.27,206.81,207.31,-0.997305352\n7/6/2015 12:00:00 AM,205.74,207.65,205.53,206.72,-1.290636733\n7/7/2015 12:00:00 AM,206.93,208.17,204.11,208.02,-1.670295825\n7/8/2015 12:00:00 AM,206.34,206.76,204.25,204.53,-2.081167525\n7/9/2015 12:00:00 AM,207.03,207.35,204.77,204.9,-2.211022815\n7/10/2015 12:00:00 AM,207.28,207.98,204.95,207.48,-2.049834058\n7/13/2015 12:00:00 AM,209,209.9,208.94,209.77,-1.190334802\n7/14/2015 12:00:00 AM,209.69,211.05,209.65,210.68,-0.371332607\n7/15/2015 12:00:00 AM,210.71,211.28,210.04,210.61,0.33409261\n7/16/2015 12:00:00 AM,211.82,212.3,211.58,212.3,0.942231299\n7/17/2015 12:00:00 AM,212.34,212.55,211.8,212.48,1.480376191\n7/20/2015 12:00:00 AM,212.77,213.18,212.21,212.59,1.971141054\n7/21/2015 12:00:00 AM,212.45,212.74,211.39,211.75,2.196248949\n7/22/2015 12:00:00 AM,210.91,211.77,210.89,211.37,2.082448315\n7/23/2015 12:00:00 AM,211.54,211.65,209.75,210.18,1.773500209\n7/24/2015 12:00:00 AM,210.25,210.37,207.6,208,0.975366757\n7/27/2015 12:00:00 AM,206.98,207.55,206.26,206.79,0.209976117\n7/28/2015 12:00:00 AM,207.8,209.5,206.8,209.33,-0.282863606\n7/29/2015 12:00:00 AM,209.44,211.04,209.31,210.77,-0.349193795\n7/30/2015 12:00:00 AM,210.2,211.02,209.42,210.82,-0.264191873\n7/31/2015 12:00:00 AM,211.44,211.45,210.16,210.5,-0.07735025\n8/3/2015 12:00:00 AM,210.53,210.53,208.65,209.79,0.01144003\n8/4/2015 12:00:00 AM,209.7,210.25,208.8,209.38,0.100330028\n8/5/2015 12:00:00 AM,210.4,211.31,209.73,210.07,0.409887402\n8/6/2015 12:00:00 AM,210.27,210.41,207.65,208.35,0.47185122\n8/7/2015 12:00:00 AM,208.16,208.34,206.87,207.95,0.199069578\n8/10/2015 12:00:00 AM,209.29,210.67,209.28,210.57,0.234478092\n8/11/2015 12:00:00 AM,208.96,209.47,207.76,208.67,0.085407989\n8/12/2015 12:00:00 AM,207.14,209.14,205.36,208.92,-0.32424438\n8/13/2015 12:00:00 AM,208.75,209.55,208.01,208.66,-0.451251795\n8/14/2015 12:00:00 AM,208.43,209.51,208.26,209.42,-0.416400554\n8/17/2015 12:00:00 AM,208.73,210.59,208.16,210.59,-0.235598658\n8/18/2015 12:00:00 AM,210.29,210.68,209.7,209.98,0.132332066\n8/19/2015 12:00:00 AM,209.1,210.01,207.35,208.32,0.222629091\n8/20/2015 12:00:00 AM,206.54,208.29,203.9,203.97,-0.118673381\n8/21/2015 12:00:00 AM,201.81,203.94,197.52,197.63,-0.584182455\n8/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,-1.071833905\n8/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,-1.457481547\n8/26/2015 12:00:00 AM,192.21,194.79,188.37,194.68,-1.733042272\n8/27/2015 12:00:00 AM,197.05,199.42,195.21,199.27,-1.561395297\n8/28/2015 12:00:00 AM,198.5,199.84,197.92,199.28,-1.254618679\n8/31/2015 12:00:00 AM,198.14,199.13,197.01,197.67,-1.005039651\n9/1/2015 12:00:00 AM,193.07,194.77,190.73,191.77,-1.016096784\n9/2/2015 12:00:00 AM,194.69,195.46,192.42,195.41,-1.035343218\n9/3/2015 12:00:00 AM,196.25,198.05,194.96,195.55,-0.775487776\n9/4/2015 12:00:00 AM,192.88,193.86,191.61,192.59,-0.689223873\n9/8/2015 12:00:00 AM,195.97,197.61,195.17,197.43,-0.424434791\n9/9/2015 12:00:00 AM,199.32,199.47,194.35,194.79,-0.113374353\n9/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,0.001601937\n9/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,0.025584495\n9/14/2015 12:00:00 AM,196.95,197.01,195.43,196.01,0.131076406\n9/15/2015 12:00:00 AM,196.59,198.99,195.96,198.46,0.499807265\n9/16/2015 12:00:00 AM,198.82,200.41,198.41,200.18,0.949248075\n9/17/2015 12:00:00 AM,199.96,202.89,199.28,199.73,1.41337424\n9/18/2015 12:00:00 AM,195.74,198.68,194.96,195.45,1.236319536\n9/21/2015 12:00:00 AM,196.45,197.68,195.21,196.46,0.707349707\n9/22/2015 12:00:00 AM,193.9,194.46,192.56,193.91,0.076378782\n9/23/2015 12:00:00 AM,194.13,194.67,192.91,193.6,-0.493632372\n9/24/2015 12:00:00 AM,192.13,193.45,190.56,192.9,-1.032816975\n9/25/2015 12:00:00 AM,194.61,195,191.81,192.85,-1.323260523\n9/28/2015 12:00:00 AM,191.75,191.91,187.64,188.01,-1.700545941\n9/29/2015 12:00:00 AM,188.24,189.74,186.93,188.12,-2.109670309\n9/30/2015 12:00:00 AM,190.4,191.83,189.44,191.63,-2.102874055\n10/1/2015 12:00:00 AM,192.03,192.49,189.82,192.13,-1.799424627\n10/2/2015 12:00:00 AM,189.75,195.03,189.12,195,-1.384888439\n10/5/2015 12:00:00 AM,196.47,198.74,196.33,198.47,-0.664190907\n10/6/2015 12:00:00 AM,198.27,198.98,197,197.79,0.032123395\n10/7/2015 12:00:00 AM,198.85,199.83,197.48,199.41,0.654418292\n10/8/2015 12:00:00 AM,198.96,201.55,198.59,201.21,1.209834861\n10/9/2015 12:00:00 AM,201.4,201.9,200.58,201.33,1.715252029\n10/12/2015 12:00:00 AM,201.43,201.76,200.91,201.52,2.185794655\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,200.25,2.554223037\n10/14/2015 12:00:00 AM,200.16,200.87,198.94,199.29,2.494520966\n10/15/2015 12:00:00 AM,200.05,202.36,199.64,202.35,2.572894903\n10/16/2015 12:00:00 AM,202.82,203.29,201.92,203.27,2.823829839\n10/19/2015 12:00:00 AM,202.53,203.37,202.13,203.37,3.157101645\n10/20/2015 12:00:00 AM,202.86,203.84,202.55,203.11,3.528981956\n10/21/2015 12:00:00 AM,203.64,203.79,201.65,201.85,3.132106788\n10/22/2015 12:00:00 AM,203,205.51,201.85,205.26,3.14450003\n10/23/2015 12:00:00 AM,207.24,207.95,206.3,207.51,3.357908612\n10/26/2015 12:00:00 AM,207.27,207.37,206.56,207,3.497820921\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.6,3.215446723\n10/28/2015 12:00:00 AM,207,208.98,206.21,208.95,3.283205631\n10/29/2015 12:00:00 AM,208.36,209.27,208.21,208.83,3.523074015\n10/30/2015 12:00:00 AM,209.07,209.44,207.74,207.93,3.626683637\n11/2/2015 12:00:00 AM,208.36,210.62,208.17,210.39,3.882669307\n11/3/2015 12:00:00 AM,209.98,211.66,209.7,211,4.213524835\n11/4/2015 12:00:00 AM,211.37,211.5,209.72,210.36,4.387186031\n11/5/2015 12:00:00 AM,210.44,210.98,209.09,210.15,3.600291862\n11/6/2015 12:00:00 AM,209.74,210.32,208.46,210.04,2.719215374\n11/9/2015 12:00:00 AM,209.33,209.49,206.95,208.08,1.828313409\n11/10/2015 12:00:00 AM,207.54,208.6,207.19,208.56,0.941237336\n11/11/2015 12:00:00 AM,208.9,208.94,207.66,207.74,0.251285965\n11/12/2015 12:00:00 AM,206.51,207.06,204.82,204.84,-0.390400906\n11/13/2015 12:00:00 AM,204.36,204.67,202.44,202.54,-0.967059942\n11/16/2015 12:00:00 AM,202.3,205.69,202.18,205.62,-1.410047894\n11/17/2015 12:00:00 AM,205.97,207.04,204.88,205.47,-1.387949553\n11/18/2015 12:00:00 AM,206.03,208.9,205.99,208.73,-1.038359653\n11/19/2015 12:00:00 AM,208.55,209.05,208.2,208.55,-0.497734986\n11/20/2015 12:00:00 AM,209.47,210.12,208.86,209.31,0.110169876\n11/23/2015 12:00:00 AM,209.4,209.98,208.52,209.07,0.650859448\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,209.35,1.004717227\n11/25/2015 12:00:00 AM,209.48,209.74,209.01,209.32,1.396063811\n11/27/2015 12:00:00 AM,209.4,209.8,208.86,209.56,1.769633768\n11/30/2015 12:00:00 AM,209.79,209.89,208.56,208.69,2.066106124\n12/1/2015 12:00:00 AM,209.42,210.82,209.11,210.68,2.429883724\n12/2/2015 12:00:00 AM,210.6,211,208.23,208.53,2.406490867\n12/3/2015 12:00:00 AM,208.9,209.15,204.75,205.61,1.434068581\n12/4/2015 12:00:00 AM,206.1,209.97,205.93,209.62,0.757924769\n12/7/2015 12:00:00 AM,209.2,209.73,207.2,208.35,0.407993691\n12/8/2015 12:00:00 AM,206.48,208.29,205.78,206.95,-0.096697082\n12/9/2015 12:00:00 AM,206.2,208.68,204.18,205.34,-0.632401332\n12/10/2015 12:00:00 AM,205.44,207.43,205.14,205.87,-1.149334693\n12/11/2015 12:00:00 AM,203.38,204.14,201.51,201.88,-1.638283663\n12/14/2015 12:00:00 AM,202.1,203.05,199.95,202.9,-2.102282655\n12/15/2015 12:00:00 AM,204.69,206.11,202.87,205.03,-1.846128096\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,208.03,-1.221871486\n12/17/2015 12:00:00 AM,208.37,208.48,204.84,204.86,-0.646439559\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,200.02,-0.692974976\n12/21/2015 12:00:00 AM,201.43,201.88,200.09,201.67,-0.98962339\n12/22/2015 12:00:00 AM,202.7,203.85,201.55,203.5,-1.058159317\n12/23/2015 12:00:00 AM,204.7,206.07,204.58,206.02,-0.697932406\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.68,-0.22164611\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,205.21,0.066274889\n12/29/2015 12:00:00 AM,206.53,207.79,206.47,207.4,0.51462043\n12/30/2015 12:00:00 AM,207.09,207.21,205.76,205.93,0.890875928\n12/31/2015 12:00:00 AM,205.17,205.89,203.87,203.87,0.947677811\n1/4/2016 12:00:00 AM,200.53,201.03,198.59,201.02,0.454634038\n1/5/2016 12:00:00 AM,201.39,201.9,200.05,201.36,-0.015150108\n1/6/2016 12:00:00 AM,198.33,200.06,197.6,198.82,-0.542770572\n1/7/2016 12:00:00 AM,195.32,197.44,193.59,194.05,-1.060415857\n1/8/2016 12:00:00 AM,195.21,195.85,191.58,191.92,-1.552419698\n1/11/2016 12:00:00 AM,193.05,193.41,189.82,192.11,-2.019576783\n1/12/2016 12:00:00 AM,193.85,194.55,191.14,193.66,-2.247400708\n1/13/2016 12:00:00 AM,194.53,194.86,188.38,188.83,-2.574121655\n1/14/2016 12:00:00 AM,189.55,193.26,187.66,191.93,-2.946710791\n1/15/2016 12:00:00 AM,186.79,188.76,185.52,187.81,-3.339178185\n1/19/2016 12:00:00 AM,189.95,190.11,186.2,188.06,-3.260132767\n1/20/2016 12:00:00 AM,185,187.5,181.02,185.65,-3.427656463\n1/21/2016 12:00:00 AM,186.19,188.87,184.64,186.69,-2.86422093\n1/22/2016 12:00:00 AM,189.78,190.76,188.88,190.52,-1.968000078\n1/25/2016 12:00:00 AM,189.91,190.15,187.41,187.64,-1.305345806\n1/26/2016 12:00:00 AM,188.44,190.53,188.02,190.2,-0.806515241\n1/27/2016 12:00:00 AM,189.58,191.56,187.06,188.13,-0.382670273\n1/28/2016 12:00:00 AM,190,190.2,187.16,189.11,-0.035784899\n1/29/2016 12:00:00 AM,190.03,193.88,189.88,193.72,0.446165979\n2/1/2016 12:00:00 AM,192.5,194.58,191.84,193.65,0.948687273\n2/2/2016 12:00:00 AM,191.9,191.97,189.54,190.16,1.11391546\n2/3/2016 12:00:00 AM,191.37,191.78,187.1,191.3,0.891748262\n2/4/2016 12:00:00 AM,190.72,192.75,189.96,191.6,0.729246738\n2/5/2016 12:00:00 AM,190.97,191.67,187.2,187.95,0.329544815\n2/8/2016 12:00:00 AM,185.75,186.12,182.8,185.42,-0.204657543\n2/9/2016 12:00:00 AM,183.38,186.94,183.2,185.43,-0.679805271\n2/10/2016 12:00:00 AM,186.44,188.34,185.12,185.27,-0.899572563\n2/11/2016 12:00:00 AM,182.38,184.1,181.09,182.86,-1.260857494\n2/12/2016 12:00:00 AM,184.93,186.65,183.96,186.63,-1.340184591\n2/16/2016 12:00:00 AM,188.78,189.81,187.63,189.78,-0.95514856\n2/17/2016 12:00:00 AM,191.12,193.32,191.01,192.88,-0.332543352\n2/18/2016 12:00:00 AM,193.22,193.27,191.72,192.09,0.289332964\n2/19/2016 12:00:00 AM,191.15,192.18,190.45,192,0.744716358\n2/22/2016 12:00:00 AM,193.9,194.95,193.79,194.78,1.22002193\n2/23/2016 12:00:00 AM,193.99,194.32,192.18,192.32,1.53749863\n2/24/2016 12:00:00 AM,190.62,193.53,189.32,193.2,1.55037988\n2/25/2016 12:00:00 AM,193.73,195.55,192.83,195.54,1.766336295\n2/26/2016 12:00:00 AM,196.52,196.68,194.9,195.09,2.096781061\n2/29/2016 12:00:00 AM,195.08,196.23,193.33,193.56,2.138761407\n3/1/2016 12:00:00 AM,195.05,198.21,194.45,198.11,2.378289408\n3/2/2016 12:00:00 AM,197.7,199.06,197.25,199,2.710188266\n3/3/2016 12:00:00 AM,198.7,199.8,198.11,199.78,3.084191387\n3/4/2016 12:00:00 AM,200,201.35,199.03,200.43,3.476600207\n3/7/2016 12:00:00 AM,199.34,201.07,199.25,200.59,3.836300616\n3/8/2016 12:00:00 AM,199.3,199.92,198.21,198.4,3.366735306\n3/9/2016 12:00:00 AM,199.36,199.79,198.43,199.38,2.813681142\n3/10/2016 12:00:00 AM,199.9,201.07,197.38,199.54,2.393019616\n3/11/2016 12:00:00 AM,201.25,202.81,199.52,202.76,2.405372429\n3/14/2016 12:00:00 AM,202.2,203.04,201.77,202.5,2.626280996\n3/15/2016 12:00:00 AM,201.32,202.53,201.05,202.17,2.504584718\n3/16/2016 12:00:00 AM,201.62,203.82,201.55,203.34,2.65897491\n3/17/2016 12:00:00 AM,203.26,205.23,202.77,204.63,2.946212496\n3/18/2016 12:00:00 AM,204.2,204.78,203.8,204.38,3.296532635\n3/21/2016 12:00:00 AM,204.11,204.94,203.8,204.67,3.67621514\n3/22/2016 12:00:00 AM,203.74,205.23,203.57,204.56,4.069144828\n3/23/2016 12:00:00 AM,204.11,204.33,203.01,203.21,3.46431316\n3/24/2016 12:00:00 AM,201.98,203.16,201.74,203.12,2.321669008\n3/28/2016 12:00:00 AM,203.62,203.86,202.71,203.24,1.587870203\n3/29/2016 12:00:00 AM,202.75,205.25,202.4,205.12,1.284293936\n3/30/2016 12:00:00 AM,206.35,206.87,205.59,206.02,1.391086384\n3/31/2016 12:00:00 AM,205.87,206.41,205.33,205.52,1.547841861\n4/1/2016 12:00:00 AM,204.35,207.14,203.98,206.92,1.597172444\n4/4/2016 12:00:00 AM,206.84,207.07,205.89,206.25,1.852905496\n4/5/2016 12:00:00 AM,204.64,206.26,203.89,204.19,1.659346134\n4/6/2016 12:00:00 AM,204.27,206.49,203.98,206.42,1.440546817\n4/7/2016 12:00:00 AM,205.18,205.56,203.09,203.95,1.076684601\n4/8/2016 12:00:00 AM,205.32,205.85,203.87,204.5,0.766758519\n4/11/2016 12:00:00 AM,205.23,206.07,203.91,204.02,0.493862854\n4/12/2016 12:00:00 AM,204.2,206.25,203.7,205.92,0.189665112\n4/13/2016 11:01 AM,207.02,207.45,206.84,207.15,0.395226907"
  },
  {
    "path": "Tests/TestData/spy_with_hilbert.csv",
    "content": "Date,Close,PriorPrice,Detrend1,Detrend2,Detrend4,InPhase,Quadrature\n20220103 00:00,477.71,0,0,0,0,0,0\n20220104 00:00,477.55,0,0,0,0,0,0\n20220105 00:00,468.38,0,0,0,0,0,0\n20220106 00:00,467.94,0,0,0,0,0,0\n20220107 00:00,466.09,0,0,0,0,0,0\n20220110 00:00,465.51,0,0,0,0,0,0\n20220111 00:00,469.75,0,0,0,0,0,0\n20220112 00:00,471.02,477.71,-6.69,0,0,0,2.26122\n20220113 00:00,464.53,477.55,-13.02,-6.69,0,0,-2.28924\n20220114 00:00,464.72,468.38,-3.66,-13.02,0,10.334625,-11.01862764\n20220118 00:00,456.49,467.94,-11.45,-3.66,-6.69,-5.457375,-0.56366312\n20220119 00:00,451.75,466.09,-14.34,-11.45,-13.02,-7.1865625,-10.32737614\n20220120 00:00,446.75,465.51,-18.76,-14.34,-3.66,13.36986188,-8.189638135\n20220121 00:00,437.98,469.75,-31.77,-18.76,-11.45,-2.887183125,-11.51239314\n20220124 00:00,439.84,471.02,-31.18,-31.77,-14.34,2.728970313,-23.99925769\n20220125 00:00,434.47,464.53,-30.06,-31.18,-18.76,9.788987291,-24.91090888\n20220126 00:00,433.38,464.72,-31.34,-30.06,-31.77,-17.68573628,-27.5788291\n20220127 00:00,431.24,456.49,-25.25,-31.34,-31.18,-12.36597885,-31.2253872\n20220128 00:00,441.95,451.75,-9.8,-25.25,-30.06,-11.31680557,-31.25924424\n20220131 00:00,449.91,446.75,3.16,-9.8,-31.34,-42.62669254,-21.42226087\n20220201 00:00,452.95,437.98,14.97,3.16,-25.25,-41.92314657,-12.46548455\n20220202 00:00,457.35,439.84,17.51,14.97,-9.8,-31.31860904,1.810895825\n20220203 00:00,446.6,434.47,12.13,17.51,3.16,-37.01651226,9.196726222\n20220204 00:00,448.7,433.38,15.32,12.13,14.97,-17.53688557,7.563922789\n20220207 00:00,447.26,431.24,16.02,15.32,17.51,-10.16006674,13.01373346\n20220208 00:00,450.94,441.95,8.99,16.02,12.13,-21.05886029,15.5379859\n20220209 00:00,457.54,449.91,7.63,8.99,15.32,0.878265162,10.80970191\n20220210 00:00,449.32,452.95,-3.63,7.63,16.02,7.517045121,14.10877924\n20220211 00:00,440.46,457.35,-16.89,-3.63,8.99,0.746436218,5.732499246\n20220214 00:00,439.02,446.6,-7.58,-16.89,7.63,23.50163588,-9.559192619\n20220215 00:00,446.1,448.7,-2.6,-7.58,-3.63,6.252448652,-4.763615255\n20220216 00:00,446.6,447.26,-0.66,-2.6,-16.89,-18.574763,-5.607927105\n20220217 00:00,437.06,450.94,-13.88,-0.66,-7.58,5.972413782,2.421338044\n20220218 00:00,434.23,457.54,-23.31,-13.88,-2.6,11.73755489,-7.896699362\n20220222 00:00,429.57,449.32,-19.75,-23.31,-0.66,5.882337994,-15.81608774\n20220223 00:00,421.95,440.46,-18.51,-19.75,-13.88,2.119045252,-16.16270438\n20220224 00:00,428.3,439.02,-10.72,-18.51,-23.31,-6.991840142,-20.23247766\n20220225 00:00,437.75,446.1,-8.35,-10.72,-19.75,-12.44321537,-13.36069408\n20220228 00:00,436.63,446.6,-9.97,-8.35,-18.51,-15.16409377,-11.81871745\n20220301 00:00,429.98,437.06,-7.08,-9.97,-10.72,-9.92613099,-12.0928746\n20220302 00:00,437.89,434.23,3.66,-7.08,-8.35,-12.71919176,-12.3118065\n20220303 00:00,435.71,429.57,6.14,3.66,-9.97,-24.99682454,-2.502711615\n20220304 00:00,432.17,421.95,10.22,6.14,-7.08,-20.02671818,-1.475750596\n20220307 00:00,419.43,428.3,-8.87,10.22,3.66,-11.61381177,12.37214347\n20220308 00:00,416.25,437.75,-21.5,-8.87,6.14,-1.157421083,-2.101803701\n20220309 00:00,427.41,436.63,-9.22,-21.5,10.22,17.12365896,-14.20185551\n20220310 00:00,425.48,429.98,-4.5,-9.22,-8.87,-11.14389547,-8.409409651\n20220311 00:00,420.07,437.89,-17.82,-4.5,-21.5,-24.03808739,-3.277067161\n20220314 00:00,417,435.71,-18.71,-17.82,-9.22,13.49314844,-14.33840046\n20220315 00:00,426.17,432.17,-6,-18.71,-4.5,2.149688874,-17.7896487\n20220316 00:00,435.62,419.43,16.19,-6,-17.82,-32.77668549,-16.31859936\n20220317 00:00,441.07,416.25,24.82,16.19,-18.71,-27.67016324,1.787938739\n20220318 00:00,444.52,427.41,17.11,24.82,-6,-25.83582256,13.52113342\n20220321 00:00,444.39,425.48,18.91,17.11,16.19,-14.15675779,11.32274329\n20220322 00:00,449.59,420.07,29.52,18.91,24.82,-1.555366159,13.5023831\n20220323 00:00,443.8,417,26.8,29.52,17.11,-18.44974733,24.28868723\n20220324 00:00,450.49,426.17,24.32,26.8,18.91,-6.624541195,23.14364549\n20220325 00:00,452.69,435.62,17.07,24.32,29.52,16.60834249,26.75991628\n20220328 00:00,455.91,441.07,14.84,17.07,26.8,8.235097946,19.87663217\n20220329 00:00,461.55,444.52,17.03,14.84,24.32,14.41416634,18.1287117\n20220330 00:00,458.7,444.39,14.31,17.03,17.07,18.36623498,18.91152167\n20220331 00:00,451.64,449.59,2.05,14.31,14.84,12.4207247,19.74460456\n20220401 00:00,452.92,443.8,9.12,2.05,17.03,28.81330813,5.359534326\n20220404 00:00,456.8,450.49,6.31,9.12,14.31,22.31105921,13.66089634\n20220405 00:00,451.03,452.69,-1.66,6.31,2.05,5.441097682,8.682602602\n20220406 00:00,446.52,455.91,-9.39,-1.66,9.12,31.01407566,6.131202963\n20220407 00:00,448.77,461.55,-12.78,-9.39,6.31,29.5083351,-2.13564032\n20220408 00:00,447.57,458.7,-11.13,-12.78,-1.66,11.52422203,-6.945713399\n20220411 00:00,439.92,451.64,-11.72,-11.13,-9.39,16.79087554,-7.890486428\n20220412 00:00,438.29,452.92,-14.63,-11.72,-12.78,12.06554279,-9.122711129\n20220413 00:00,443.31,456.8,-13.49,-14.63,-11.13,5.017943488,-12.73736441\n20220414 00:00,437.79,451.03,-13.24,-13.49,-11.72,6.719893471,-12.09835636\n20220418 00:00,437.97,446.52,-8.55,-13.24,-14.63,-0.116630329,-14.65532917\n20220419 00:00,445.04,448.77,-3.73,-8.55,-13.49,-6.889543385,-11.37850445\n20220420 00:00,444.71,447.57,-2.86,-3.73,-13.24,-9.322180146,-7.71682126\n20220421 00:00,438.06,439.92,-1.86,-2.86,-8.55,-8.491435259,-6.077254504\n20220422 00:00,426.04,438.29,-12.25,-1.86,-3.73,-7.56098505,-0.327785586\n20220425 00:00,428.51,443.31,-14.8,-12.25,-2.86,0.228853107,-9.301712022\n20220426 00:00,416.1,437.79,-21.69,-14.8,-1.86,4.03043861,-7.579571528\n20220427 00:00,417.27,437.97,-20.7,-21.69,-12.25,-2.897288007,-17.83737866\n20220428 00:00,427.81,445.04,-17.23,-20.7,-14.8,-1.924053277,-17.43815518\n20220429 00:00,412,444.71,-32.71,-17.23,-21.69,-10.87685898,-12.20305399\n20220502 00:00,414.48,438.06,-23.58,-32.71,-20.7,-1.751215384,-30.63405645\n20220503 00:00,416.38,426.04,-9.66,-23.58,-17.23,-4.042648831,-24.43955225\n20220504 00:00,429.06,428.51,0.55,-9.66,-32.71,-40.12668045,-20.20021108\n20220505 00:00,413.81,416.1,-2.29,0.55,-23.58,-31.02358427,-6.93654866\n20220506 00:00,411.34,417.27,-5.93,-2.29,-9.66,-12.82439451,-7.113331345\n20220509 00:00,398.17,427.81,-29.64,-5.93,0.55,-20.08600459,1.743766553\n20220510 00:00,399.09,412,-12.91,-29.64,-2.29,0.964273989,-27.68072599\n20220511 00:00,392.75,414.48,-21.73,-12.91,-5.93,-5.308678012,-4.975866905\n20220512 00:00,392.34,416.38,-24.04,-21.73,-29.64,-32.55642541,-22.96056539\n20220513 00:00,401.72,429.06,-27.34,-24.04,-12.91,3.556563983,-16.48092301\n20220516 00:00,400.09,413.81,-13.72,-27.34,-21.73,-8.832385538,-30.4633111\n20220517 00:00,408.32,411.34,-3.02,-13.72,-24.04,-39.83308014,-18.26979198\n20220518 00:00,391.86,398.17,-6.31,-3.02,-27.34,-29.51945687,-11.18381915\n20220519 00:00,389.46,399.09,-9.63,-6.31,-13.72,-17.75000232,-9.230249689\n20220520 00:00,389.63,392.75,-3.12,-9.63,-3.02,-21.42519339,-12.35557087\n20220523 00:00,396.92,392.34,4.58,-3.12,-6.31,-24.15585511,-7.787864395\n20220524 00:00,393.89,401.72,-7.83,4.58,-9.63,-26.94412647,3.050357045\n20220525 00:00,397.37,400.09,-2.72,-7.83,-3.12,-11.2899353,-9.542938165\n20220526 00:00,405.31,408.32,-3.01,-2.72,4.58,-7.454967997,-0.671599319\n20220527 00:00,415.26,391.86,23.4,-3.01,-7.83,-24.50783281,-14.1447131\n20220531 00:00,412.93,389.46,23.47,23.4,-2.72,-29.14285892,15.24013943\n20220601 00:00,409.59,389.63,19.96,23.47,-3.01,-27.12571718,11.94260697\n20220602 00:00,417.39,396.92,20.47,19.96,23.4,-2.155723834,18.19230713\n20220603 00:00,410.54,393.89,16.65,20.47,23.47,-5.416277912,18.87890116\n20220606 00:00,411.79,397.37,14.42,16.65,19.96,-5.490767908,17.92503981\n20220607 00:00,415.74,405.31,10.43,14.42,20.47,12.77274037,17.27572859\n20220608 00:00,411.22,415.26,-4.04,10.43,16.65,9.094351026,17.85418346\n20220609 00:00,401.44,412.93,-11.49,-4.04,14.42,17.74511238,5.682816264\n20220610 00:00,389.8,409.59,-19.79,-11.49,10.43,30.26837763,1.233734008\n20220613 00:00,375,417.39,-42.39,-19.79,-4.04,16.4332254,-3.541388103\n20220614 00:00,373.87,410.54,-36.67,-42.39,-11.49,30.55270886,-29.57853791\n20220615 00:00,379.2,411.79,-32.59,-36.67,-19.79,23.5897323,-26.85156918\n20220616 00:00,366.65,415.74,-49.09,-32.59,-42.39,-16.68408937,-25.99512581\n20220617 00:00,365.86,411.22,-45.36,-49.09,-36.67,12.52865763,-42.83415038\n20220621 00:00,375.07,401.44,-26.37,-45.36,-32.59,10.24648001,-45.23329252\n20220622 00:00,374.39,389.8,-15.41,-26.37,-49.09,-51.02570925,-35.63936283\n20220623 00:00,378.06,375,3.06,-15.41,-45.36,-36.51261491,-31.73313287\n20220624 00:00,390.08,373.87,16.21,3.06,-26.37,-28.88486019,-14.46508464\n20220627 00:00,388.59,379.2,9.39,16.21,-15.41,-64.53051287,2.310381089\n20220628 00:00,380.65,366.65,14,9.39,3.06,-26.81382297,-0.231198607\n20220629 00:00,380.34,365.86,14.48,14,16.21,-9.191886224,9.886668808\n20220630 00:00,377.25,375.07,2.18,14.48,9.39,-40.73287567,13.66501487\n20220701 00:00,381.24,374.39,6.85,2.18,14,-1.257152583,3.206394057\n20220705 00:00,381.96,378.06,3.9,6.85,14.48,6.825964748,10.15057503\n20220706 00:00,383.25,390.08,-6.83,3.9,2.18,-26.23600105,7.292301191\n20220707 00:00,388.99,388.59,0.4,-6.83,6.85,13.18552061,-3.534305641\n20220708 00:00,388.67,380.65,8.02,0.4,3.9,8.891987615,0.154037803\n20220711 00:00,384.23,380.34,3.89,8.02,-6.83,-31.56323567,5.510584693\n20220712 00:00,380.83,377.25,3.58,3.89,0.4,5.785118087,2.732024777\n20220713 00:00,378.83,381.24,-2.41,3.58,8.02,12.82978714,6.257157626\n20220714 00:00,377.91,381.96,-4.05,-2.41,3.89,-13.26721715,-0.117675625\n20220715 00:00,385.13,383.25,1.88,-4.05,3.58,11.36323749,-2.570520722\n20220718 00:00,381.95,388.99,-7.04,1.88,-2.41,3.642164831,4.219745639\n20220719 00:00,392.27,388.67,3.6,-7.04,-4.05,-7.89918289,-9.125636004\n20220720 00:00,394.77,384.23,10.54,3.6,1.88,6.708155803,1.463754026\n20220721 00:00,398.79,380.83,17.96,10.54,-7.04,-14.85335033,1.385055031\n20220722 00:00,395.09,378.83,16.26,17.96,3.6,-14.77173114,12.95886886\n20220725 00:00,395.57,377.91,17.66,16.26,10.54,4.528303935,10.7590686\n20220726 00:00,390.89,385.13,5.76,17.66,17.96,-0.999502461,20.09321767\n20220727 00:00,401.04,381.95,19.09,5.76,16.26,6.372950729,2.944145187\n20220728 00:00,406.07,392.27,13.8,19.09,17.66,9.797785499,21.21710757\n20220729 00:00,411.99,394.77,17.22,13.8,5.76,-4.388434063,8.974761073\n20220801 00:00,410.77,398.79,11.98,17.22,19.09,14.24094871,20.34214236\n20220802 00:00,408.06,395.09,12.97,11.98,13.8,13.96246879,10.62960924\n20220803 00:00,414.45,395.57,18.88,12.97,17.22,8.44340687,13.46420412\n20220804 00:00,414.17,390.89,23.28,18.88,11.98,9.032002433,14.60416792\n20220805 00:00,413.47,401.04,12.43,23.28,12.97,6.600167683,23.62956099\n20220808 00:00,412.99,406.07,6.92,12.43,18.88,19.09525086,15.02724876\n20220809 00:00,411.35,411.99,-0.64,6.92,23.28,29.34257154,15.12311162\n20220810 00:00,419.99,410.77,9.22,-0.64,12.43,20.23660648,1.32285008\n20220811 00:00,419.99,408.06,11.93,9.22,6.92,13.4571093,10.29927173\n20220812 00:00,427.1,414.45,12.65,11.93,-0.64,8.363095431,8.101423327\n20220815 00:00,428.86,414.17,14.69,12.65,9.22,14.33430761,11.16593384\n20220816 00:00,429.7,413.47,16.23,14.69,11.93,11.7975769,11.94254108\n20220817 00:00,426.65,412.99,13.66,16.23,12.65,8.240503099,15.38700564\n20220818 00:00,427.89,411.35,16.54,13.66,14.69,16.62216033,12.10605889\n20220819 00:00,422.14,419.99,2.15,16.54,16.23,14.65033633,21.01410791\n20220822 00:00,413.35,419.99,-6.64,2.15,13.66,20.60115697,8.486167904\n20220823 00:00,412.35,427.1,-14.75,-6.64,16.54,36.50057181,5.448268472\n20220824 00:00,413.67,428.86,-15.19,-14.75,2.15,23.69827607,-6.747455249\n20220825 00:00,419.51,429.7,-10.19,-15.19,-6.64,16.83879717,-9.904265256\n20220826 00:00,405.31,426.65,-21.34,-10.19,-14.75,12.8286756,-5.257719874\n20220829 00:00,402.63,427.89,-25.26,-21.34,-15.19,12.99953031,-16.14976166\n20220830 00:00,398.21,422.14,-23.93,-25.26,-10.19,18.00526121,-18.94876932\n20220831 00:00,395.18,413.35,-18.17,-23.93,-21.34,0.465646507,-23.24715944\n20220901 00:00,396.42,412.35,-15.93,-18.17,-25.26,-8.897860756,-19.19034403\n20220902 00:00,392.24,413.67,-21.43,-15.93,-23.93,-5.834721634,-16.54419989\n20220906 00:00,390.76,419.51,-28.75,-21.43,-18.17,-5.406751968,-18.19883628\n20220907 00:00,397.78,405.31,-7.53,-28.75,-15.93,-2.74232908,-31.79679956\n20220908 00:00,400.38,402.63,-2.25,-7.53,-21.43,-24.51561074,-12.92070666\n20220909 00:00,406.6,398.21,8.39,-2.25,-28.75,-37.58485,-15.83313825\n20220912 00:00,410.97,395.18,15.79,8.39,-7.53,-17.81344147,-1.314218852\n20220913 00:00,393.1,396.42,-3.32,15.79,-2.25,-30.91322532,11.56055927\n20220914 00:00,394.6,392.24,2.36,-3.32,8.39,-10.74362975,-4.561885972\n20220915 00:00,390.12,390.76,-0.64,2.36,15.79,6.552714669,6.483789034\n20220916 00:00,385.56,397.78,-12.22,-0.64,-3.32,-23.27189808,1.948442541\n20220919 00:00,388.55,400.38,-11.83,-12.22,2.36,5.827420109,-6.029939307\n20220920 00:00,384.09,406.6,-22.51,-11.83,-0.64,12.75103631,-3.563046421\n20220921 00:00,377.39,410.97,-33.58,-22.51,-12.22,-12.18534278,-13.19807949\n20220922 00:00,374.22,393.1,-18.88,-33.58,-11.83,15.56703677,-28.40286969\n20220923 00:00,367.95,394.6,-26.65,-18.88,-22.51,-5.05459194,-14.33325087\n20220926 00:00,364.31,390.12,-25.81,-26.65,-33.58,-28.55925516,-27.52638996\n20220927 00:00,363.38,385.56,-22.18,-25.81,-18.88,6.771755848,-23.15779879\n20220928 00:00,370.53,388.55,-18.02,-22.18,-26.65,-18.91679088,-25.3931598\n20220929 00:00,362.79,384.09,-21.3,-18.02,-25.81,-36.09425203,-18.64793599\n20220930 00:00,357.18,377.39,-20.21,-21.3,-22.18,-6.518060036,-23.05190801\n20221003 00:00,366.61,374.22,-7.61,-20.21,-18.02,-18.49547471,-23.94082237\n20221004 00:00,377.97,367.95,10.02,-7.61,-21.3,-43.50441254,-18.78830491\n20221005 00:00,377.09,364.31,12.78,10.02,-20.21,-37.35484312,-2.391637959\n20221006 00:00,373.2,363.38,9.82,12.78,-7.61,-31.40125144,3.110392941\n20221007 00:00,362.79,370.53,-7.74,9.82,10.02,-22.89492696,11.62774637\n20221010 00:00,360.02,362.79,-2.77,-7.74,12.78,-1.601700383,-5.752427186\n20221011 00:00,357.74,357.18,0.56,-2.77,9.82,-5.466107165,0.970898273\n20221012 00:00,356.56,366.61,-10.05,0.56,-7.74,-24.65777862,2.012579611\n20221013 00:00,365.97,377.97,-12,-10.05,-2.77,3.497607757,-5.665836384\n20221014 00:00,357.63,377.09,-19.46,-12,0.56,6.75402195,-4.742268091\n20221017 00:00,366.82,373.2,-6.38,-19.46,-10.05,-12.77381442,-19.2186127\n20221018 00:00,371.13,362.79,8.34,-6.38,-12,-7.714894074,-10.80180661\n20221019 00:00,368.5,360.02,8.48,8.34,-19.46,-26.65607106,-1.022131092\n20221020 00:00,365.41,357.74,7.67,8.48,-6.38,-22.81737216,2.236529364\n20221021 00:00,374.29,356.56,17.73,7.67,8.34,-0.562020237,1.331779691\n20221024 00:00,378.87,365.97,12.9,17.73,8.48,-20.39979262,14.12574693\n20221025 00:00,384.92,357.63,27.29,12.9,7.67,-15.14090632,4.126121536\n20221026 00:00,382.02,366.82,15.2,27.29,17.73,0.144179649,26.92690246\n20221027 00:00,379.98,371.13,8.85,15.2,12.9,-8.893868316,13.60332908\n20221028 00:00,389.02,368.5,20.52,8.85,27.29,17.47333699,11.01553303\n20221031 00:00,386.21,365.41,20.8,20.52,15.2,2.803804077,18.08752523\n20221101 00:00,384.52,374.29,10.23,20.8,8.85,-11.09510638,21.06551016\n20221102 00:00,374.87,378.87,-4,10.23,20.52,28.62550649,17.69558353\n20221103 00:00,371.01,384.92,-13.91,-4,20.8,30.95541559,7.821722436\n20221104 00:00,376.35,382.02,-5.67,-13.91,10.23,16.78316995,-6.012432768\n20221107 00:00,379.95,379.98,-0.03,-5.67,-4,17.67775912,-3.016117817\n20221108 00:00,382,389.02,-7.02,-0.03,-13.91,2.293001399,0.310557724\n20221109 00:00,374.13,386.21,-12.08,-7.02,-5.67,9.141937917,-3.956407822\n20221110 00:00,394.69,384.52,10.17,-12.08,-0.03,20.77637704,-15.41249149\n20221111 00:00,398.51,374.87,23.64,10.17,-7.02,-15.39138161,0.842414156\n20221114 00:00,395.12,371.01,24.11,23.64,-12.08,-28.05911942,10.28139788\n20221115 00:00,398.49,376.35,22.14,24.11,10.17,6.768186921,16.91141598\n20221116 00:00,395.45,379.95,15.5,22.14,23.64,2.202847677,20.37611248\n20221117 00:00,394.24,382,12.24,15.5,24.11,0.016834167,17.0789386\n20221118 00:00,396.03,374.13,21.9,12.24,22.14,22.25729869,11.72492602\n20221121 00:00,394.59,394.69,-0.1,21.9,15.5,3.390683275,27.70648125\n20221122 00:00,399.9,398.51,1.39,-0.1,12.24,15.3900647,3.393204994\n20221123 00:00,402.42,395.12,7.3,1.39,21.9,40.40507217,8.287390662\n20221125 00:00,402.33,398.49,3.84,7.3,-0.1,-3.766291121,7.148983288\n20221128 00:00,395.91,395.45,0.46,3.84,1.39,8.462191082,6.485658044\n20221129 00:00,395.23,394.24,0.99,0.46,7.3,34.41709583,2.541736351\n20221130 00:00,407.68,396.03,11.65,0.99,3.84,1.622592638,-0.755547581\n20221201 00:00,407.38,394.59,12.79,11.65,0.46,-3.298696163,8.186086887\n20221202 00:00,406.91,399.9,7.01,12.79,0.99,12.94029335,10.16524492\n20221205 00:00,399.59,402.42,-2.83,7.01,11.65,10.02865883,10.73343737\n20221206 00:00,393.83,402.33,-8.5,-2.83,12.79,16.13914044,3.478852782\n20221207 00:00,393.16,395.91,-2.75,-8.5,7.01,23.72646128,-3.94259817\n20221208 00:00,396.24,395.23,1.01,-2.75,-2.83,5.013510854,-1.91552776\n20221209 00:00,393.28,407.68,-14.4,1.01,-8.5,-1.178333323,4.544601819\n20221212 00:00,398.95,407.38,-8.43,-14.4,-2.75,23.05880291,-12.19810838\n20221213 00:00,401.97,406.91,-4.94,-8.43,1.01,11.13739189,-5.224204585\n20221214 00:00,399.4,399.59,-0.19,-4.94,-14.4,-14.82711666,-8.998740633\n20221215 00:00,389.63,393.83,-4.2,-0.19,-8.43,4.255652349,-0.53618115\n20221216 00:00,383.27,393.16,-9.89,-4.2,-4.94,4.230993852,-3.898754334\n20221219 00:00,380.02,396.24,-16.22,-9.89,-0.19,-1.802531579,-4.588869229\n20221220 00:00,380.54,393.28,-12.74,-16.22,-4.2,10.32696424,-13.23165896\n20221221 00:00,386.23,398.95,-12.72,-12.74,-9.89,0.436556096,-9.991677799\n20221222 00:00,380.72,401.97,-21.25,-12.72,-16.22,-11.32310755,-10.00980073\n20221223 00:00,382.91,399.4,-16.49,-21.25,-12.74,7.499809793,-19.0535671\n20221227 00:00,381.4,389.63,-8.23,-16.49,-12.72,-2.533849379,-17.09157265\n20221228 00:00,376.66,383.27,-6.61,-8.23,-21.25,-27.2201108,-12.43592568\n20221229 00:00,383.44,380.02,3.42,-6.61,-16.49,-10.60343328,-13.54291155\n20221230 00:00,382.43,380.54,1.89,3.42,-8.23,-14.61111936,-1.422162879\n20230103 00:00,380.82,386.23,-5.41,1.89,-6.61,-27.04745786,-0.858924105\n"
  },
  {
    "path": "Tests/TestData/spy_with_ibs.csv",
    "content": "Date,Open,High,Low,Close,Volume,IBS\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,1.0\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,0.0\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,0.8775510204081779\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,0.8365758754863765\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,0.13698630136987394\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,0.8808290155440471\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,1.0\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,0.6132075471698154\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,0.4473684210526414\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.5652173913043532\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,0.7878787878787817\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,0.9890109890109989\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0.5280898876404563\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.7528089887640503\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.8793103448275515\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0.7123287671233117\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.5347222222222302\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.5312500000000088\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.6231884057971134\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0.16883116883118227\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,1.0\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.31249999999999445\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.9506172839506273\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,0.9596774193548299\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.8363636363636293\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.3064516129032428\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.53571428571427\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.185520361990948\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.7129629629629829\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.8797468354430382\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.9931972789115708\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.574626865671648\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.8850574712643586\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.5555555555555528\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0.7857142857143038\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,0.006600660066009975\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.9493670886075875\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.40686274509804693\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,0.3172043010752579\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0.9510489510489362\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,0.7932960893854714\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,0.914772727272725\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0.4473684210526247\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0.3589743589743677\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.5862068965517433\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.7154471544715535\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.9639639639639707\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0.13740458015267673\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.8970588235294207\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.39285714285715617\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.6101694915254433\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.9489795918367241\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0.9528301886792602\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,0.3333333333333333\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,0.8653846153846039\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,0.7272727272727194\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0.9285714285714262\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0.7857142857142949\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,0.1968503937007858\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0.923664122137409\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.3298969072164882\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0.5153846153846012\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,0.19487179487179954\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0.7664974619289299\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.9500000000000051\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,0.24873096446700985\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,0.6027397260273909\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0.44525547445256325\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,0.1006289308176077\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0.9388888888888817\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,0.3502109704641396\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,0.061135371179045966\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0.9959839357429642\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,0.9171270718232171\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,0.41747572815534595\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,0.19999999999999368\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,0.05376344086021725\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.9093750000000022\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.15340909090909752\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0.5329341317365228\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.8299319727891156\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0.027888446215136826\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,0.13461538461538952\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,0.6986899563318777\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,0.49259259259259414\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0.6571428571428604\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0.7119999999999891\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,0.1494252873563485\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,0.36363636363634855\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,0.20000000000000406\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.3944444444444464\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0.6838709677419319\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0.9662921348314594\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0.6641221374045752\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0.8113207547169654\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.5\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,0.8425925925925797\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0.47499999999998754\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0.6619718309859329\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,0.34883720930233325\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,0.29333333333333184\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0.6261682242990676\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.9347826086956488\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.6712328767123245\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.11538461538458315\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.20238095238095358\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.8684210526315757\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.9695121951219614\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.5052631578947321\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0.36697247706422426\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,0.16176470588235387\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.8351648351648283\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.978260869565206\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.5737704918032566\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.32478632478631647\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.7159090909090895\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,0.6960000000000036\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.42753623188406187\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.7849462365591536\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.805369127516785\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.036363636363654216\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0.2164179104477547\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0.2920353982301007\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0.006896551724151179\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.5373134328358301\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0.20108695652174122\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.8297872340425497\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0.8018867924528231\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,0.07801418439717141\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,0.06779661016949479\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0.5972222222222129\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0.46951219512194403\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0.3529411764705981\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,0.3670212765957388\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,0.8518518518518524\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.3432835820895712\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0.6240000000000009\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0.9218750000000046\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0.9531249999999993\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1.0\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,0.2738095238095105\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0.8194444444444505\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,0.22500000000000533\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.9384615384615075\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0.840136054421769\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,0.16831683168315745\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,0.0799999999999922\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0.42857142857143826\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.24242424242423852\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,0.13761467889908735\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0.5714285714285714\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.6567164179104567\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.6187050359712185\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,0.8933333333333356\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0.8940397350993393\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.371428571428573\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.8888888888888785\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.1500000000000071\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,0.05309734513273301\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,0.6407185628742522\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,0.9556650246305403\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,0.9612903225806433\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,0.9299999999999926\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0.13690476190475526\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,0.9411764705882331\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,0.9494949494949521\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,0.8799999999999955\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,0.5270270270270405\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,0.5905511811023575\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,0.655913978494623\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0.7441860465116333\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,0.9397590361445656\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.6883116883116807\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.9186046511627669\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0.3405405405405391\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.19117647058823067\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.7122302158273371\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.9237057220708537\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.5932203389830619\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.6562499999999898\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.0590277777777834\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.9918699186991828\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.6612903225806348\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.5959595959595939\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.9870689655172409\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.8717948717948899\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.9113924050632989\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,0.2702702702702568\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,0.269565217391305\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,0.2512820512820538\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,0.8823529411764579\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.9811320754716885\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.32499999999999557\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.3414634146341506\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.7966101694915189\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,0.21052631578946424\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.23728813559321993\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.47540983606558446\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.6478873239436612\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.1752577319587502\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.8229166666666515\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0.4705882352941439\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.16438356164383774\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.09361702127659549\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0.33636363636363353\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.38202247191012206\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.35164835164834546\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0.34482758620690246\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,0.9931972789115644\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.7878787878788044\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.6971830985915479\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0.8070175438596727\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.8333333333333629\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0.8281249999999827\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0.3653846153846038\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0.5454545454545043\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,1.0\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.27672955974842567\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.2577319587628869\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.18918918918919125\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.6309523809523797\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.6702127659574536\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,0.6343283582089494\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0.9338842975206513\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.11971830985915599\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.9450549450549333\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.772357723577233\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.7108433734939594\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.2743362831858438\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.6569767441860443\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.5909090909091164\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.6139240506329058\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,0.021201413427552718\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,0.3708333333333268\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0.8050847457626976\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,0.2814371257484996\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0.6258064516128979\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,0.5316455696202603\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,0.07488986784140432\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0.7341040462427684\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0.7891891891891806\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,1.0\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,0.9112149532710297\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0.9302325581395311\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0.8083333333333305\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,0.3214285714285569\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,0.9198312236286922\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,0.7988165680473384\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0.7023809523809535\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,0.0721153846153879\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0.7812499999999936\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,0.0825688073394285\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.364102564102565\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.4485294117647114\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.40944881889762935\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.9666666666666591\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.5904761904761828\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.7235294117647048\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0.6747967479674954\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.48387096774195026\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0.4819277108433731\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,0.5424836601307081\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0.9391304347826134\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0.2251308900523451\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.9517241379310388\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.15615615615615863\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0.16176470588235048\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0.6507936507936579\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0.8214285714285722\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,0.48178137651821795\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,0.9289340101522912\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0.056856187290965546\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.33061224489796165\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.622754491017964\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,0.02066115702479795\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,0.4722222222222277\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,0.3450704225352207\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,0.6506024096385348\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0.8791208791208674\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.7474747474747498\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,0.4957264957264874\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,0.08333333333333662\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.16521739130434707\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.8342541436464027\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0.9712918660287071\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,0.051886792452830156\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,0.09478672985781518\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0.7772020725388573\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0.95390070921985\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0.9865771812080657\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,0.6148148148148056\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.9325842696629177\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.5984251968503818\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.24193548387094038\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,0.6164383561643961\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.2876712328767022\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.7032967032967014\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.6979166666666685\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.8560606060606071\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.5315315315315281\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.20588235294117954\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.93264248704662\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.028776978417260745\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.9540816326530597\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.30456852791877903\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.9338842975206731\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,0.9521276595744661\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.29230769230769904\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.24770642201835724\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.41071428571429114\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.9432624113475289\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.8905109489051242\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.3000000000000124\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.9224137931034451\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.6517857142857191\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.8539325842696658\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.9047619047619048\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0.42105263157894346\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0.9719626168224287\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.8441558441558403\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,0.9117647058823505\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.8461538461538562\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0.8942307692307582\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0.8974358974358896\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.9230769230769063\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.4659090909091067\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.9444444444444554\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0.6874999999999806\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.2544378698224728\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.8137254901960773\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.6057692307692311\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,0.8793103448275976\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0.9441624365482164\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.8499999999999911\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.6000000000000142\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,0.6792452830188386\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.1089108910891078\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.8692810457516416\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.8733333333333348\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.9399999999999977\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.3015873015873002\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.6000000000000038\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.5192307692307524\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.8615384615384575\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.38157894736841513\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0.3287671232876819\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.8265306122449089\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.7111111111111073\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.8556701030927975\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0.3809523809523584\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0.49999999999999184\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,0.6428571428571646\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.10486891385767882\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.8802395209580898\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.8504672897196284\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.4782608695651959\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.7199999999999894\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.327868852459037\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.4193548387096725\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.8027210884353794\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.01960784313725563\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.4685714285714247\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,0.042704626334521156\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,0.42465753424657887\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0.8177777777777666\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,0.3056768558951926\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0.5469613259668481\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,0.18604651162790417\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,0.9462809917355394\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,0.08421052631577373\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,0.48760330578512356\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.8\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,1.0\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0.6025641025641002\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.8815789473684525\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.8636363636363578\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,0.7777777777777661\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.6867469879518122\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,0.4736842105263095\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0.729166666666656\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0.09259259259261501\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0.4920634920634992\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.8522727272727042\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.978021978021998\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.6637168141592947\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.23529411764706024\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.28645833333333687\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.9550561797752899\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,0.48760330578512356\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0.24999999999999567\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.909090909090911\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0.9752066115702471\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.3653846153846105\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.638297872340421\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.8461538461538406\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0.5181347150259049\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0.9599999999999985\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.2546583850931634\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.2545454545454633\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.04580152671755891\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.9400921658986192\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,0.02517985611510545\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0.7512690355330046\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0.8097826086956527\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0.24260355029585629\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,0.15384615384615233\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0.7518518518518476\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0.7741935483871017\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,0.3514851485148445\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,0.015999999999996815\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,0.9385964912280695\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,0.039800995024874955\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,0.015822784810121202\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,0.028571428571424775\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,0.2374100719424447\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0.7816291161178529\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0.7206823027718561\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0.399061032863848\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,0.9369747899159758\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,0.9522058823529428\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0.03478260869564551\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,0.34536082474227664\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,0.9699999999999989\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,0.7957746478873278\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,0.9940828402366918\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,0.5646551724137957\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,0.8959276018099469\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,0.8476190476190484\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,0.4086956521739201\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,0.6558441558441533\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,0.7807017543859678\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,0.9320987654321081\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.7373737373737415\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.9340659340659313\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.8030303030303089\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.6989247311827966\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.6049382716049303\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.6753246753246797\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.7741935483870899\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.7500000000000144\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.73599999999999\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.9150326797385652\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.37634408602151176\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.7291666666666704\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.31313131313132153\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.8356164383561558\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0.30208333333332255\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.32758620689654877\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.83974358974359\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.7523809523809366\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.6153846153846196\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,0.489130434782603\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.31050228310502626\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.9516728624535332\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,0.07540983606557083\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0.19354838709677086\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,0.013468013468010794\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,0.19466666666666393\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,0.011013215859027101\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0.8641975308641952\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,0.3160220994475149\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,0.5290697674418589\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,1.0\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,0.42168674698795305\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,0.08064516129034033\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,0.3166666666666659\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.6987951807228961\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0.10465116279069998\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.053571428571430386\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,0.4629629629629649\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,0.12251655629139183\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,0.25064599483204075\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0.7771739130434805\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,0.8801843317972385\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,0.25429553264605154\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,0.27238805970149865\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,0.3158953722334048\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.9051383399209563\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,0.04472843450479712\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0.9418960244648322\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,0.7372549019607904\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,0.7867647058823587\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,0.9592875318066164\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0.12403100775193611\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0.9356725146198753\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,0.42016806722689154\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0.052511415525111876\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.9143646408839774\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,0.10526315789473488\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0.9736211031175026\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,0.9956521739130474\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,0.29411764705882887\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0.8823529411764662\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,0.2715517241379388\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,0.3311258278145715\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,0.8729508196721301\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,0.6790123456790188\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0.9653465346534549\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0.944444444444443\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0.827868852459033\n"
  },
  {
    "path": "Tests/TestData/spy_with_ichimoku.csv",
    "content": "Date,Open,High,Low,Close,Ichimoku Cloud,TenkanMaximum,TenkanMinimum,Tenkan,KijunMaximum,KijunMinimum,Kijun,DelayedTenkanSenkouA,DelayedKijunSenkouA,Senkou A,SenkouBMaximum,SenkouBMinimum,DelayedMaximumSenkouB,DelayedMinimumSenkouB,Senkou B\n3/12/2015 2:00:00 PM,206.42,206.69,206.34,206.59,206.515,,,,,,,,,,,,,,\n3/12/2015 3:00:00 PM,206.59,206.88,206.42,206.84,206.61,,,,,,,,,,,,,,\n3/12/2015 4:00:00 PM,206.84,207.18,206.84,207.13,206.76,,,,,,,,,,,,,,\n3/13/2015 10:00:00 AM,206.76,206.93,206.22,206.48,206.7,,,,,,,,,,,,,,\n3/13/2015 11:00:00 AM,206.48,206.59,205.12,205.12,206.15,,,,,,,,,,,,,,\n3/13/2015 12:00:00 PM,205.13,206.16,204.58,205.07,205.88,,,,,,,,,,,,,,\n3/13/2015 1:00:00 PM,205.08,205.5,204.73,205.37,205.88,,,,,,,,,,,,,,\n3/13/2015 2:00:00 PM,205.37,205.4,204.76,205.07,205.88,,,,,,,,,,,,,,\n3/13/2015 3:00:00 PM,205.06,205.14,204.64,205.07,205.88,207.18,204.58,205.88,,,,,,,,,,,\n3/13/2015 4:00:00 PM,205.07,206.13,204.93,205.84,205.88,207.18,204.58,205.88,,,,,,,,,,,\n3/16/2015 10:00:00 AM,206.68,207.72,206.68,207.6,206.15,207.72,204.58,206.15,,,,,,,,,,,\n3/16/2015 11:00:00 AM,207.6,207.94,207.56,207.77,206.26,207.94,204.58,206.26,,,,,,,,,,,\n3/16/2015 12:00:00 PM,207.77,208.22,207.74,208.08,206.4,208.22,204.58,206.4,,,,,,,,,,,\n3/16/2015 1:00:00 PM,208.08,208.11,207.76,207.94,206.4,208.22,204.58,206.4,,,,,,,,,,,\n3/16/2015 2:00:00 PM,207.94,208.16,207.67,208.06,206.4,208.22,204.64,206.43,,,,,,,,,,,\n3/16/2015 3:00:00 PM,208.06,208.52,207.94,208.47,206.55,208.52,204.64,206.58,,,,,,,,,,,\n3/16/2015 4:00:00 PM,208.47,208.69,208.34,208.64,206.635,208.69,204.64,206.665,,,,,,,,,,,\n3/17/2015 10:00:00 AM,207.65,208.05,207.25,207.57,206.635,208.69,204.93,206.81,,,,,,,,,,,\n3/17/2015 11:00:00 AM,207.58,207.86,207.44,207.65,206.635,208.69,206.68,207.685,,,,,,,,,,,\n3/17/2015 12:00:00 PM,207.65,207.65,206.98,207.47,206.635,208.69,206.98,207.835,,,,,,,,,,,\n3/17/2015 1:00:00 PM,207.47,207.86,207.14,207.85,206.635,208.69,206.98,207.835,,,,,,,,,,,\n3/17/2015 2:00:00 PM,207.85,208.15,207.72,208.1,206.635,208.69,206.98,207.835,,,,,,,,,,,\n3/17/2015 3:00:00 PM,208.1,208.25,207.69,207.99,206.635,208.69,206.98,207.835,,,,,,,,,,,\n3/17/2015 4:00:00 PM,207.99,208.42,207.89,207.97,206.635,208.69,206.98,207.835,,,,,,,,,,,\n3/18/2015 10:00:00 AM,207.43,207.44,206.95,207.14,206.635,208.69,206.95,207.82,,,,,,,,,,,\n3/18/2015 11:00:00 AM,207.14,207.57,207.11,207.51,206.635,208.42,206.95,207.685,208.69,204.58,206.635,,,,,,,,\n3/18/2015 12:00:00 PM,207.51,207.58,207.12,207.27,206.515,208.42,206.95,207.685,208.69,204.58,206.635,,,,,,,,\n3/18/2015 1:00:00 PM,207.27,207.34,206.95,207.04,206.61,208.42,206.95,207.685,208.69,204.58,206.635,,,,,,,,\n3/18/2015 2:00:00 PM,207.03,207.34,206.62,207.29,206.635,208.42,206.62,207.52,208.69,204.58,206.635,,,,,,,,\n3/18/2015 3:00:00 PM,207.3,210.37,207.24,210.11,206.7,210.37,206.62,208.495,210.37,204.58,207.475,,,,,,,,\n3/18/2015 4:00:00 PM,210.1,211.27,209.99,210.42,206.15,211.27,206.62,208.945,211.27,204.58,207.925,,,,,,,,\n3/19/2015 10:00:00 AM,210.04,210.1,209.49,210.02,205.88,211.27,206.62,208.945,211.27,204.64,207.955,,,,,,,,\n3/19/2015 11:00:00 AM,209.99,210.29,209.48,209.72,205.88,211.27,206.62,208.945,211.27,204.64,207.955,,,,,,,,\n3/19/2015 12:00:00 PM,209.71,209.87,209.03,209.35,205.88,211.27,206.62,208.945,211.27,204.64,207.955,,,,,,,,\n3/19/2015 1:00:00 PM,209.34,209.46,209.07,209.17,205.88,211.27,206.62,208.945,211.27,204.93,208.1,,,,,,,,\n3/19/2015 2:00:00 PM,209.17,209.76,209.07,209.36,205.88,211.27,206.62,208.945,211.27,206.62,208.945,,,,,,,,\n3/19/2015 3:00:00 PM,209.35,209.81,209.32,209.68,206.15,211.27,206.62,208.945,211.27,206.62,208.945,,,,,,,,\n3/19/2015 4:00:00 PM,209.68,209.85,209.31,209.5,206.26,211.27,207.24,209.255,211.27,206.62,208.945,,,,,,,,\n3/20/2015 10:00:00 AM,209.66,210.02,209.61,209.82,206.4,211.27,209.03,210.15,211.27,206.62,208.945,,,,,,,,\n3/20/2015 11:00:00 AM,209.82,210.35,209.75,210.25,205.76,210.35,209.03,209.69,211.27,206.62,208.945,,,,,,,,\n3/20/2015 12:00:00 PM,210.26,210.61,210.24,210.47,204.79,210.61,209.03,209.82,211.27,206.62,208.945,,,,,,,,\n3/20/2015 1:00:00 PM,210.47,210.84,210.43,210.77,205.23,210.84,209.03,209.935,211.27,206.62,208.945,,,,,,,,\n3/20/2015 2:00:00 PM,210.78,211.02,210.72,210.86,205.81,211.02,209.07,210.045,211.27,206.62,208.945,,,,,,,,\n3/20/2015 3:00:00 PM,210.86,210.98,210.66,210.95,205.77,211.02,209.07,210.045,211.27,206.62,208.945,,,,,,,,\n3/20/2015 4:00:00 PM,210.96,211,210.36,210.45,206.17,211.02,209.31,210.165,211.27,206.62,208.945,,,,,,,,\n3/23/2015 10:00:00 AM,210.43,210.98,210.33,210.75,205.39,211.02,209.31,210.165,211.27,206.62,208.945,,,,,,,,\n3/23/2015 11:00:00 AM,210.75,211.11,210.67,210.81,205.28,211.11,209.61,210.36,211.27,206.62,208.945,,,,,,,,\n3/23/2015 12:00:00 PM,210.81,210.91,210.55,210.74,205.59,211.11,209.75,210.43,211.27,206.62,208.945,,,,,,,,\n3/23/2015 1:00:00 PM,210.73,210.89,210.5,210.71,205.89,211.11,210.24,210.675,211.27,206.62,208.945,,,,,,,,\n3/23/2015 2:00:00 PM,210.71,210.79,210.55,210.65,205.56,211.11,210.33,210.72,211.27,206.62,208.945,,,,,,,,\n3/23/2015 3:00:00 PM,210.65,210.98,210.62,210.72,205.61,211.11,210.33,210.72,211.27,206.62,208.945,,,,,,,,\n3/23/2015 4:00:00 PM,210.72,210.78,210.01,210.02,205.55,211.11,210.01,210.56,211.27,206.62,208.945,207.685,206.635,207.16,211.27,204.58,,,\n3/24/2015 10:00:00 AM,209.87,210.01,209.45,209.98,205.53,211.11,209.45,210.28,211.27,206.62,208.945,207.685,206.635,207.16,211.27,204.58,,,\n3/24/2015 11:00:00 AM,209.98,210.23,209.84,210,205.75,211.11,209.45,210.28,211.27,206.62,208.945,207.685,206.635,207.16,211.27,204.58,,,\n3/24/2015 12:00:00 PM,210.01,210.4,209.86,210.14,206.635,211.11,209.45,210.28,211.27,207.24,209.255,207.52,206.635,207.0775,211.27,204.58,,,\n3/24/2015 1:00:00 PM,210.14,210.27,209.52,209.54,207.475,210.98,209.45,210.215,211.27,209.03,210.15,208.495,207.475,207.985,211.27,204.58,,,\n3/24/2015 2:00:00 PM,209.54,209.74,209.22,209.51,207.925,210.98,209.22,210.1,211.11,209.03,210.07,208.945,207.925,208.435,211.27,204.58,,,\n3/24/2015 3:00:00 PM,209.51,209.52,208.98,209.22,207.925,210.98,208.98,209.98,211.11,208.98,210.045,208.945,207.955,208.45,211.27,204.64,,,\n3/24/2015 4:00:00 PM,209.22,209.5,208.74,208.78,207.925,210.98,208.74,209.86,211.11,208.74,209.925,208.945,207.955,208.45,211.27,204.64,,,\n3/25/2015 10:00:00 AM,209.01,209.35,208.29,208.52,207.925,210.78,208.29,209.535,211.11,208.29,209.7,208.945,207.955,208.45,211.27,204.64,,,\n3/25/2015 11:00:00 AM,208.51,208.96,208.29,208.74,207.925,210.4,208.29,209.345,211.11,208.29,209.7,208.945,208.1,208.5225,211.27,204.93,,,\n3/25/2015 12:00:00 PM,208.74,208.87,207.08,207.35,207.36,210.4,207.08,208.74,211.11,207.08,209.095,208.945,208.945,208.945,211.27,206.62,,,\n3/25/2015 1:00:00 PM,207.35,207.42,206.65,207.03,207.55,210.4,206.65,208.525,211.11,206.65,208.88,208.945,208.945,208.945,211.27,206.62,,,\n3/25/2015 2:00:00 PM,207.03,207.16,206.5,206.89,207.38,210.27,206.5,208.385,211.11,206.5,208.805,209.255,208.945,209.1,211.27,206.5,,,\n3/25/2015 3:00:00 PM,206.89,207.13,206.64,206.74,207.47,209.74,206.5,208.12,211.11,206.5,208.805,210.15,208.945,209.5475,211.27,206.5,,,\n3/25/2015 4:00:00 PM,206.75,206.76,205.71,205.76,207.47,209.52,205.71,207.615,211.11,205.71,208.41,209.69,208.945,209.3175,211.27,205.71,,,\n3/26/2015 10:00:00 AM,204.96,205.51,204.5,204.79,207,209.5,204.5,207,211.11,204.5,207.805,209.82,208.945,209.3825,211.27,204.5,,,\n3/26/2015 11:00:00 AM,204.79,205.38,204.12,205.23,206.45,209.35,204.12,206.735,211.11,204.12,207.615,209.935,208.945,209.44,211.27,204.12,,,\n3/26/2015 12:00:00 PM,205.23,205.82,204.69,205.81,204.84,208.96,204.12,206.54,211.11,204.12,207.615,210.045,208.945,209.495,211.27,204.12,,,\n3/26/2015 1:00:00 PM,205.81,205.9,205.25,205.77,205.7,208.87,204.12,206.495,211.11,204.12,207.615,210.045,208.945,209.495,211.27,204.12,,,\n3/26/2015 2:00:00 PM,205.76,206.37,205.17,206.17,205.47,207.42,204.12,205.77,211.11,204.12,207.615,210.165,208.945,209.555,211.27,204.12,,,\n3/26/2015 3:00:00 PM,206.17,206.22,205.37,205.39,205.49,207.16,204.12,205.64,211.11,204.12,207.615,210.165,208.945,209.555,211.27,204.12,,,\n3/26/2015 4:00:00 PM,205.37,205.9,205.17,205.28,205.625,207.13,204.12,205.625,210.98,204.12,207.55,210.36,208.945,209.6525,211.27,204.12,,,\n3/27/2015 10:00:00 AM,205.16,205.66,205.13,205.59,205.42,206.76,204.12,205.44,210.98,204.12,207.55,210.43,208.945,209.6875,211.27,204.12,,,\n3/27/2015 11:00:00 AM,205.58,205.92,204.9,205.89,205.245,206.37,204.12,205.245,210.98,204.12,207.55,210.675,208.945,209.81,211.27,204.12,,,\n3/27/2015 12:00:00 PM,205.88,205.95,205.27,205.56,205.245,206.37,204.12,205.245,210.98,204.12,207.55,210.72,208.945,209.8325,211.27,204.12,,,\n3/27/2015 1:00:00 PM,205.57,205.65,205.25,205.61,205.53,206.37,204.69,205.53,210.78,204.12,207.45,210.72,208.945,209.8325,211.27,204.12,,,\n3/27/2015 2:00:00 PM,205.62,205.66,205.3,205.55,205.635,206.37,204.9,205.635,210.4,204.12,207.26,210.56,208.945,209.7525,211.27,204.12,211.27,204.58,207.925\n3/27/2015 3:00:00 PM,205.54,205.67,205.37,205.53,205.635,206.37,204.9,205.635,210.4,204.12,207.26,210.28,208.945,209.6125,211.27,204.12,211.27,204.58,207.925\n3/27/2015 4:00:00 PM,205.52,205.95,205.38,205.75,205.56,206.22,204.9,205.56,210.4,204.12,207.26,210.28,208.945,209.6125,211.27,204.12,211.27,204.58,207.925\n3/30/2015 10:00:00 AM,206.96,208.05,206.96,207.94,206.33,208.05,204.9,206.475,210.27,204.12,207.195,210.28,209.255,209.7675,211.27,204.12,211.27,204.58,207.925\n3/30/2015 11:00:00 AM,207.93,208.1,207.52,207.85,206.4,208.1,204.9,206.5,209.74,204.12,206.93,210.215,210.15,210.1825,211.27,204.12,211.27,204.58,207.925\n3/30/2015 12:00:00 PM,207.85,208,207.66,207.93,206.5,208.1,204.9,206.5,209.52,204.12,206.82,210.1,210.07,210.085,211.11,204.12,211.27,204.58,207.925\n3/30/2015 1:00:00 PM,207.93,208.23,207.9,208.18,206.74,208.23,205.25,206.74,209.5,204.12,206.81,209.98,210.045,210.0125,211.11,204.12,211.27,204.64,207.955\n3/30/2015 2:00:00 PM,208.18,208.48,208.14,208.27,206.735,208.48,205.25,206.865,209.35,204.12,206.735,209.86,209.925,209.8925,211.11,204.12,211.27,204.64,207.955\n3/30/2015 3:00:00 PM,208.27,208.54,208.27,208.52,206.54,208.54,205.3,206.92,208.96,204.12,206.54,209.535,209.7,209.6175,211.11,204.12,211.27,204.64,207.955\n3/30/2015 4:00:00 PM,208.52,208.61,208.24,208.27,206.495,208.61,205.37,206.99,208.87,204.12,206.495,209.345,209.7,209.5225,211.11,204.12,211.27,204.93,208.1\n3/31/2015 10:00:00 AM,207.26,207.56,206.97,207.36,206.365,208.61,205.38,206.995,208.61,204.12,206.365,208.74,209.095,208.9175,211.11,204.12,211.27,206.62,208.945\n3/31/2015 11:00:00 AM,207.35,207.86,207.3,207.55,206.365,208.61,206.96,207.785,208.61,204.12,206.365,208.525,208.88,208.7025,211.11,204.12,211.27,206.62,208.945\n3/31/2015 12:00:00 PM,207.55,208.1,207.37,207.38,206.365,208.61,206.97,207.79,208.61,204.12,206.365,208.385,208.805,208.595,211.11,204.12,211.27,206.5,208.885\n3/31/2015 1:00:00 PM,207.38,207.58,207.14,207.47,206.365,208.61,206.97,207.79,208.61,204.12,206.365,208.12,208.805,208.4625,211.11,204.12,211.27,206.5,208.885\n3/31/2015 2:00:00 PM,207.46,207.88,207.39,207.47,206.365,208.61,206.97,207.79,208.61,204.12,206.365,207.615,208.41,208.0125,211.11,204.12,211.27,205.71,208.49\n3/31/2015 3:00:00 PM,207.47,207.64,207.29,207.57,206.365,208.61,206.97,207.79,208.61,204.12,206.365,207,207.805,207.4025,211.11,204.12,211.27,204.5,207.885\n3/31/2015 4:00:00 PM,207.57,207.59,206.36,206.45,206.65,208.61,206.36,207.485,208.61,204.69,206.65,206.735,207.615,207.175,211.11,204.12,211.27,204.12,207.695\n4/1/2015 10:00:00 AM,206.36,206.42,204.51,204.84,206.56,208.61,204.51,206.56,208.61,204.51,206.56,206.54,207.615,207.0775,211.11,204.12,211.27,204.12,207.695\n4/1/2015 11:00:00 AM,204.84,205.93,204.67,205.7,206.305,208.1,204.51,206.305,208.61,204.51,206.56,206.495,207.615,207.055,211.11,204.12,211.27,204.12,207.695\n4/1/2015 12:00:00 PM,205.69,206.02,205.34,205.47,206.305,208.1,204.51,206.305,208.61,204.51,206.56,205.77,207.615,206.6925,211.11,204.12,211.27,204.12,207.695\n4/1/2015 1:00:00 PM,205.47,205.71,205.06,205.49,206.305,208.1,204.51,206.305,208.61,204.51,206.56,205.64,207.615,206.6275,211.11,204.12,211.27,204.12,207.695\n4/1/2015 2:00:00 PM,205.5,205.95,205.29,205.74,206.195,207.88,204.51,206.195,208.61,204.51,206.56,205.625,207.55,206.5875,210.98,204.12,211.27,204.12,207.695\n4/1/2015 3:00:00 PM,205.75,205.8,205.1,205.42,206.195,207.88,204.51,206.195,208.61,204.51,206.56,205.44,207.55,206.495,210.98,204.12,211.27,204.12,207.695\n4/1/2015 4:00:00 PM,205.42,205.74,205.03,205.74,206.075,207.64,204.51,206.075,208.61,204.51,206.56,205.245,207.55,206.3975,210.98,204.12,211.27,204.12,207.695\n4/2/2015 10:00:00 AM,205.58,206.85,205.4,206.76,206.05,207.59,204.51,206.05,208.61,204.51,206.56,205.245,207.55,206.3975,210.98,204.12,211.27,204.12,207.695\n4/2/2015 11:00:00 AM,206.76,206.98,206.23,206.39,205.745,206.98,204.51,205.745,208.61,204.51,206.56,205.53,207.45,206.49,210.78,204.12,211.27,204.12,207.695\n4/2/2015 12:00:00 PM,206.39,206.63,206.17,206.25,205.825,206.98,204.67,205.825,208.61,204.51,206.56,205.635,207.26,206.4475,210.4,204.12,211.27,204.12,207.695\n4/2/2015 1:00:00 PM,206.25,206.42,205.83,206.29,206.005,206.98,205.03,206.005,208.61,204.51,206.56,205.635,207.26,206.4475,210.4,204.12,211.27,204.12,207.695\n4/2/2015 2:00:00 PM,206.29,206.55,206.2,206.42,206.005,206.98,205.03,206.005,208.61,204.51,206.56,205.56,207.26,206.41,210.4,204.12,211.27,204.12,207.695\n4/2/2015 3:00:00 PM,206.42,206.73,206.15,206.33,206.005,206.98,205.03,206.005,208.61,204.51,206.56,206.475,207.195,206.835,210.27,204.12,211.27,204.12,207.695\n4/2/2015 4:00:00 PM,206.33,206.77,206.22,206.4,206.005,206.98,205.03,206.005,208.61,204.51,206.56,206.5,206.93,206.715,209.74,204.12,211.27,204.12,207.695\n4/6/2015 10:00:00 AM,205.39,206.71,205.21,206.51,206.005,206.98,205.03,206.005,208.61,204.51,206.56,206.5,206.82,206.66,209.52,204.12,211.11,204.12,207.615\n4/6/2015 11:00:00 AM,206.51,207.73,206.49,207.59,206.47,207.73,205.21,206.47,208.61,204.51,206.56,206.74,206.81,206.775,209.5,204.12,211.11,204.12,207.615\n4/6/2015 12:00:00 PM,207.59,208.03,207.57,207.92,206.56,208.03,205.21,206.62,208.61,204.51,206.56,206.865,206.735,206.8,209.35,204.12,211.11,204.12,207.615\n4/6/2015 1:00:00 PM,207.92,208.27,207.9,208.23,206.56,208.27,205.21,206.74,208.61,204.51,206.56,206.92,206.54,206.73,208.96,204.12,211.11,204.12,207.615\n4/6/2015 2:00:00 PM,208.23,208.45,208.22,208.3,206.48,208.45,205.21,206.83,208.45,204.51,206.48,206.99,206.495,206.7425,208.87,204.12,211.11,204.12,207.615\n4/6/2015 3:00:00 PM,208.3,208.42,208.12,208.32,206.48,208.45,205.21,206.83,208.45,204.51,206.48,206.995,206.365,206.68,208.61,204.12,211.11,204.12,207.615\n4/6/2015 4:00:00 PM,208.33,208.4,207.75,207.84,206.48,208.45,205.21,206.83,208.45,204.51,206.48,207.785,206.365,207.075,208.61,204.12,211.11,204.12,207.615\n4/7/2015 10:00:00 AM,207.86,208.64,207.76,208.08,206.575,208.64,205.21,206.925,208.64,204.51,206.575,207.79,206.365,207.0775,208.64,204.12,211.11,204.12,207.615\n4/7/2015 11:00:00 AM,208.08,208.76,207.73,208.48,206.635,208.76,205.21,206.985,208.76,204.51,206.635,207.79,206.365,207.0775,208.76,204.12,211.11,204.12,207.615\n4/7/2015 12:00:00 PM,208.48,208.54,208.2,208.51,206.635,208.76,206.49,207.625,208.76,204.51,206.635,207.79,206.365,207.0775,208.76,204.12,211.11,204.12,207.615\n4/7/2015 1:00:00 PM,208.51,208.65,208.31,208.41,206.635,208.76,207.57,208.165,208.76,204.51,206.635,207.79,206.365,207.0775,208.76,204.12,211.11,204.12,207.615\n4/7/2015 2:00:00 PM,208.41,208.55,208.14,208.25,206.635,208.76,207.73,208.245,208.76,204.51,206.635,207.485,206.65,207.0675,208.76,204.51,211.11,204.12,207.615\n4/7/2015 3:00:00 PM,208.25,208.47,208.22,208.24,206.56,208.76,207.73,208.245,208.76,204.67,206.715,206.56,206.56,206.56,208.76,204.51,211.11,204.12,207.615\n4/7/2015 4:00:00 PM,208.24,208.28,207.24,207.28,206.4325,208.76,207.24,208,208.76,205.03,206.895,206.305,206.56,206.4325,208.76,204.51,211.11,204.12,207.615\n4/8/2015 10:00:00 AM,207.53,208.45,207.52,208.39,206.4325,208.76,207.24,208,208.76,205.03,206.895,206.305,206.56,206.4325,208.76,204.51,211.11,204.12,207.615\n4/8/2015 11:00:00 AM,208.38,208.51,207.15,207.59,206.4325,208.76,207.15,207.955,208.76,205.03,206.895,206.305,206.56,206.4325,208.76,204.51,211.11,204.12,207.615\n4/8/2015 12:00:00 PM,207.6,208.24,207.45,208.07,206.3775,208.76,207.15,207.955,208.76,205.03,206.895,206.195,206.56,206.3775,208.76,204.51,210.98,204.12,207.55\n4/8/2015 1:00:00 PM,208.07,208.13,207.8,207.89,206.3775,208.65,207.15,207.9,208.76,205.03,206.895,206.195,206.56,206.3775,208.76,204.51,210.98,204.12,207.55\n4/8/2015 2:00:00 PM,207.9,208.03,207.64,207.95,206.3175,208.65,207.15,207.9,208.76,205.21,206.985,206.075,206.56,206.3175,208.76,204.51,210.98,204.12,207.55\n4/8/2015 3:00:00 PM,207.95,208.45,207.08,207.79,206.305,208.55,207.08,207.815,208.76,205.21,206.985,206.05,206.56,206.305,208.76,204.51,210.98,204.12,207.55\n4/8/2015 4:00:00 PM,207.79,208.08,207.6,207.99,206.1525,208.51,207.08,207.795,208.76,205.21,206.985,205.745,206.56,206.1525,208.76,204.51,210.78,204.12,207.45\n4/9/2015 10:00:00 AM,207.82,208.65,207.75,208.01,206.1925,208.65,207.08,207.865,208.76,205.21,206.985,205.825,206.56,206.1925,208.76,204.51,210.4,204.12,207.26\n4/9/2015 11:00:00 AM,208,208.34,207.4,207.79,206.2825,208.65,207.08,207.865,208.76,205.21,206.985,206.005,206.56,206.2825,208.76,204.51,210.4,204.12,207.26\n4/9/2015 12:00:00 PM,207.78,208.01,207.19,207.88,206.2825,208.65,207.08,207.865,208.76,205.21,206.985,206.005,206.56,206.2825,208.76,204.51,210.4,204.12,207.26\n4/9/2015 1:00:00 PM,207.88,208.32,207.83,208.29,206.2825,208.65,207.08,207.865,208.76,205.21,206.985,206.005,206.56,206.2825,208.76,204.51,210.27,204.12,207.195\n4/9/2015 2:00:00 PM,208.3,208.46,208.04,208.13,206.2825,208.65,207.08,207.865,208.76,205.21,206.985,206.005,206.56,206.2825,208.76,204.51,209.74,204.12,206.93\n4/9/2015 3:00:00 PM,208.14,208.53,208.04,208.47,206.2825,208.65,207.08,207.865,208.76,206.49,207.625,206.005,206.56,206.2825,208.76,204.51,209.52,204.12,206.82\n4/9/2015 4:00:00 PM,208.47,209.18,208.46,208.92,206.515,209.18,207.08,208.13,209.18,207.08,208.13,206.47,206.56,206.515,209.18,204.51,209.5,204.12,206.81\n4/10/2015 10:00:00 AM,209.21,209.36,208.96,209.23,206.59,209.36,207.19,208.275,209.36,207.08,208.22,206.62,206.56,206.59,209.36,204.51,209.35,204.12,206.735\n4/10/2015 11:00:00 AM,209.22,209.82,209.2,209.67,206.54,209.82,207.19,208.505,209.82,207.08,208.45,206.74,206.56,206.65,209.82,204.51,208.96,204.12,206.54\n4/10/2015 12:00:00 PM,209.67,209.98,209.62,209.75,206.495,209.98,207.19,208.585,209.98,207.08,208.53,206.83,206.48,206.655,209.98,204.51,208.87,204.12,206.495\n4/10/2015 1:00:00 PM,209.75,209.93,209.72,209.84,206.365,209.98,207.19,208.585,209.98,207.08,208.53,206.83,206.48,206.655,209.98,204.51,208.61,204.12,206.365\n4/10/2015 2:00:00 PM,209.84,209.95,209.66,209.89,206.365,209.98,207.83,208.905,209.98,207.08,208.53,206.83,206.48,206.655,209.98,204.51,208.61,204.12,206.365\n4/10/2015 3:00:00 PM,209.9,210.09,209.74,209.96,206.38,210.09,208.04,209.065,210.09,207.08,208.585,206.925,206.575,206.75,210.09,204.51,208.64,204.12,206.38\n4/10/2015 4:00:00 PM,209.96,210.06,209.74,210.06,206.44,210.09,208.04,209.065,210.09,207.08,208.585,206.985,206.635,206.81,210.09,204.51,208.76,204.12,206.44\n4/13/2015 10:00:00 AM,209.84,210.5,209.84,210.45,206.44,210.5,208.46,209.48,210.5,207.08,208.79,207.625,206.635,207.13,210.5,204.51,208.76,204.12,206.44\n4/13/2015 11:00:00 AM,210.45,210.63,210.2,210.22,206.44,210.63,208.96,209.795,210.63,207.08,208.855,208.165,206.635,207.4,210.63,204.51,208.76,204.12,206.44\n4/13/2015 12:00:00 PM,210.22,210.44,210.14,210.16,206.635,210.63,209.2,209.915,210.63,207.08,208.855,208.245,206.635,207.44,210.63,204.51,208.76,204.51,206.635\n4/13/2015 1:00:00 PM,210.16,210.21,209.87,210.05,206.635,210.63,209.62,210.125,210.63,207.08,208.855,208.245,206.715,207.48,210.63,204.67,208.76,204.51,206.635\n4/13/2015 2:00:00 PM,210.05,210.05,209.38,209.66,206.635,210.63,209.38,210.005,210.63,207.08,208.855,208,206.895,207.4475,210.63,205.03,208.76,204.51,206.635\n4/13/2015 3:00:00 PM,209.66,209.78,209.27,209.44,206.635,210.63,209.27,209.95,210.63,207.08,208.855,208,206.895,207.4475,210.63,205.03,208.76,204.51,206.635\n4/13/2015 4:00:00 PM,209.44,209.65,209.03,209.06,206.635,210.63,209.03,209.83,210.63,207.08,208.855,207.955,206.895,207.425,210.63,205.03,208.76,204.51,206.635\n4/14/2015 10:00:00 AM,208.86,209.5,208.56,208.73,206.635,210.63,208.56,209.595,210.63,207.08,208.855,207.955,206.895,207.425,210.63,205.03,208.76,204.51,206.635\n4/14/2015 11:00:00 AM,208.73,208.75,208.1,208.58,206.635,210.63,208.1,209.365,210.63,207.08,208.855,207.9,206.895,207.3975,210.63,205.03,208.76,204.51,206.635\n4/14/2015 12:00:00 PM,208.58,209.33,208.42,209.19,206.635,210.63,208.1,209.365,210.63,207.08,208.855,207.9,206.985,207.4425,210.63,205.21,208.76,204.51,206.635\n4/14/2015 1:00:00 PM,209.19,209.71,209.15,209.41,206.635,210.44,208.1,209.27,210.63,207.19,208.91,207.815,206.985,207.4,210.63,205.21,208.76,204.51,206.635\n4/14/2015 2:00:00 PM,209.41,209.48,209.23,209.36,206.635,210.21,208.1,209.155,210.63,207.19,208.91,207.795,206.985,207.39,210.63,205.21,208.76,204.51,206.635\n4/14/2015 3:00:00 PM,209.35,209.42,209.09,209.37,206.635,210.05,208.1,209.075,210.63,207.19,208.91,207.865,206.985,207.425,210.63,205.21,208.76,204.51,206.635\n4/14/2015 4:00:00 PM,209.37,209.6,209.19,209.49,206.635,209.78,208.1,208.94,210.63,207.19,208.91,207.865,206.985,207.425,210.63,205.21,208.76,204.51,206.635\n4/15/2015 10:00:00 AM,210.07,210.71,209.95,210.45,206.635,210.71,208.1,209.405,210.71,207.83,209.27,207.865,206.985,207.425,210.71,205.21,208.76,204.51,206.635\n4/15/2015 11:00:00 AM,210.45,210.65,210.26,210.63,206.635,210.71,208.1,209.405,210.71,208.04,209.375,207.865,206.985,207.425,210.71,205.21,208.76,204.51,206.635\n4/15/2015 12:00:00 PM,210.63,210.66,210.06,210.4,206.635,210.71,208.1,209.405,210.71,208.04,209.375,207.865,206.985,207.425,210.71,205.21,208.76,204.51,206.635\n4/15/2015 1:00:00 PM,210.41,210.54,210.22,210.51,206.635,210.71,208.42,209.565,210.71,208.1,209.405,207.865,207.625,207.745,210.71,206.49,208.76,204.51,206.635\n4/15/2015 2:00:00 PM,210.51,210.98,210.46,210.8,206.845,210.98,209.09,210.035,210.98,208.1,209.54,208.13,208.13,208.13,210.98,207.08,209.18,204.51,206.845\n4/15/2015 3:00:00 PM,210.8,211.04,210.73,210.91,206.935,211.04,209.09,210.065,211.04,208.1,209.57,208.275,208.22,208.2475,211.04,207.08,209.36,204.51,206.935\n4/15/2015 4:00:00 PM,210.91,210.96,210.41,210.47,207.165,211.04,209.09,210.065,211.04,208.1,209.57,208.505,208.45,208.4775,211.04,207.08,209.82,204.51,207.165\n4/16/2015 10:00:00 AM,210.04,210.25,209.81,210,207.245,211.04,209.19,210.115,211.04,208.1,209.57,208.585,208.53,208.5575,211.04,207.08,209.98,204.51,207.245\n4/16/2015 11:00:00 AM,210,210.4,209.79,210.22,207.245,211.04,209.79,210.415,211.04,208.1,209.57,208.585,208.53,208.5575,211.04,207.08,209.98,204.51,207.245\n4/16/2015 12:00:00 PM,210.21,210.46,210.02,210.2,207.245,211.04,209.79,210.415,211.04,208.1,209.57,208.905,208.53,208.7175,211.04,207.08,209.98,204.51,207.245\n4/16/2015 1:00:00 PM,210.2,210.48,210.19,210.36,207.3,211.04,209.79,210.415,211.04,208.1,209.57,209.065,208.585,208.825,211.04,207.08,210.09,204.51,207.3\n4/16/2015 2:00:00 PM,210.36,210.97,210.28,210.94,207.3,211.04,209.79,210.415,211.04,208.1,209.57,209.065,208.585,208.825,211.04,207.08,210.09,204.51,207.3\n4/16/2015 3:00:00 PM,210.94,210.98,210.65,210.65,207.505,211.04,209.79,210.415,211.04,208.1,209.57,209.48,208.79,209.135,211.04,207.08,210.5,204.51,207.505\n4/16/2015 4:00:00 PM,210.66,210.72,210.24,210.37,207.57,211.04,209.79,210.415,211.04,208.1,209.57,209.795,208.855,209.325,211.04,207.08,210.63,204.51,207.57\n4/17/2015 10:00:00 AM,208.98,209.23,208.17,208.4,207.57,210.98,208.17,209.575,211.04,208.1,209.57,209.915,208.855,209.385,211.04,207.08,210.63,204.51,207.57\n4/17/2015 11:00:00 AM,208.4,208.51,207.8,207.97,207.65,210.98,207.8,209.39,211.04,207.8,209.42,210.125,208.855,209.49,211.04,207.08,210.63,204.67,207.65\n4/17/2015 12:00:00 PM,207.97,208.35,207.69,208.19,207.83,210.98,207.69,209.335,211.04,207.69,209.365,210.005,208.855,209.43,211.04,207.08,210.63,205.03,207.83\n4/17/2015 1:00:00 PM,208.19,208.33,207.98,208.16,207.83,210.98,207.69,209.335,211.04,207.69,209.365,209.95,208.855,209.4025,211.04,207.08,210.63,205.03,207.83\n4/17/2015 2:00:00 PM,208.15,208.3,207.34,207.45,207.83,210.98,207.34,209.16,211.04,207.34,209.19,209.83,208.855,209.3425,211.04,207.08,210.63,205.03,207.83\n4/17/2015 3:00:00 PM,207.45,207.56,207.01,207.38,207.83,210.98,207.01,208.995,211.04,207.01,209.025,209.595,208.855,209.225,211.04,207.01,210.63,205.03,207.83\n4/17/2015 4:00:00 PM,207.38,208.2,207.33,207.95,207.83,210.98,207.01,208.995,211.04,207.01,209.025,209.365,208.855,209.11,211.04,207.01,210.63,205.03,207.83\n4/20/2015 10:00:00 AM,209.09,209.91,208.96,209.8,207.92,210.72,207.01,208.865,211.04,207.01,209.025,209.365,208.855,209.11,211.04,207.01,210.63,205.21,207.92\n4/20/2015 11:00:00 AM,209.8,210.09,209.53,210.05,207.92,210.09,207.01,208.55,211.04,207.01,209.025,209.27,208.91,209.09,211.04,207.01,210.63,205.21,207.92\n4/20/2015 12:00:00 PM,210.05,210.25,209.97,210.16,207.92,210.25,207.01,208.63,211.04,207.01,209.025,209.155,208.91,209.0325,211.04,207.01,210.63,205.21,207.92\n4/20/2015 1:00:00 PM,210.15,210.17,209.95,210.03,207.92,210.25,207.01,208.63,211.04,207.01,209.025,209.075,208.91,208.9925,211.04,207.01,210.63,205.21,207.92\n4/20/2015 2:00:00 PM,210.03,210.18,209.85,209.86,207.92,210.25,207.01,208.63,211.04,207.01,209.025,208.94,208.91,208.925,211.04,207.01,210.63,205.21,207.92\n4/20/2015 3:00:00 PM,209.88,209.97,209.71,209.96,207.96,210.25,207.01,208.63,211.04,207.01,209.025,209.405,209.27,209.3375,211.04,207.01,210.71,205.21,207.96\n4/20/2015 4:00:00 PM,209.96,210.2,209.77,209.85,207.96,210.25,207.01,208.63,211.04,207.01,209.025,209.405,209.375,209.39,211.04,207.01,210.71,205.21,207.96\n4/21/2015 10:00:00 AM,210.65,210.86,210,210.06,207.96,210.86,207.33,209.095,211.04,207.01,209.025,209.405,209.375,209.39,211.04,207.01,210.71,205.21,207.96\n4/21/2015 11:00:00 AM,210.07,210.26,209.65,209.88,208.6,210.86,208.96,209.91,211.04,207.01,209.025,209.565,209.405,209.485,211.04,207.01,210.71,206.49,208.6\n4/21/2015 12:00:00 PM,209.88,210.15,209.5,209.65,209.025,210.86,209.5,210.18,211.04,207.01,209.025,210.035,209.54,209.7875,211.04,207.01,210.98,207.08,209.03\n4/21/2015 1:00:00 PM,209.66,209.82,209.53,209.72,208.995,210.86,209.5,210.18,210.98,207.01,208.995,210.065,209.57,209.8175,211.04,207.01,211.04,207.08,209.06\n4/21/2015 2:00:00 PM,209.72,209.96,209.44,209.44,208.995,210.86,209.44,210.15,210.98,207.01,208.995,210.065,209.57,209.8175,211.04,207.01,211.04,207.08,209.06\n4/21/2015 3:00:00 PM,209.44,209.86,209.24,209.78,208.995,210.86,209.24,210.05,210.98,207.01,208.995,210.115,209.57,209.8425,211.04,207.01,211.04,207.08,209.06\n4/21/2015 4:00:00 PM,209.78,209.8,209.43,209.56,208.995,210.86,209.24,210.05,210.98,207.01,208.995,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 10:00:00 AM,210.04,210.1,209.28,209.54,208.995,210.86,209.24,210.05,210.98,207.01,208.995,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 11:00:00 AM,209.54,210.16,208.9,210.08,208.995,210.86,208.9,209.88,210.98,207.01,208.995,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 12:00:00 PM,210.08,210.24,209.92,210.21,208.995,210.26,208.9,209.58,210.98,207.01,208.995,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 1:00:00 PM,210.21,210.37,209.91,210.26,208.935,210.37,208.9,209.635,210.86,207.01,208.935,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 2:00:00 PM,210.26,210.67,210.12,210.58,208.935,210.67,208.9,209.785,210.86,207.01,208.935,210.415,209.57,209.9925,211.04,207.01,211.04,207.08,209.06\n4/22/2015 3:00:00 PM,210.58,210.77,210.53,210.58,208.935,210.77,208.9,209.835,210.86,207.01,208.935,209.575,209.57,209.5725,211.04,207.01,211.04,207.08,209.06\n4/22/2015 4:00:00 PM,210.58,210.85,210.08,210.63,208.935,210.85,208.9,209.875,210.86,207.01,208.935,209.39,209.42,209.405,211.04,207.01,211.04,207.08,209.06\n4/23/2015 10:00:00 AM,210.17,210.65,210.01,210.62,208.935,210.85,208.9,209.875,210.86,207.01,208.935,209.335,209.365,209.35,211.04,207.01,211.04,207.08,209.06\n4/23/2015 11:00:00 AM,210.62,210.86,210.16,210.32,208.935,210.86,208.9,209.88,210.86,207.01,208.935,209.335,209.365,209.35,211.04,207.01,211.04,207.08,209.06\n4/23/2015 12:00:00 PM,210.32,211.4,210.29,211.22,209.06,211.4,208.9,210.15,211.4,207.01,209.205,209.16,209.19,209.175,211.4,207.01,211.04,207.08,209.06\n4/23/2015 1:00:00 PM,211.22,211.78,211.11,211.74,209.01,211.78,209.91,210.845,211.78,207.33,209.555,208.995,209.025,209.01,211.78,207.01,211.04,207.01,209.025\n4/23/2015 2:00:00 PM,211.73,211.77,211.45,211.65,209.01,211.78,209.91,210.845,211.78,208.9,210.34,208.995,209.025,209.01,211.78,207.01,211.04,207.01,209.025\n4/23/2015 3:00:00 PM,211.65,211.72,211.41,211.57,208.945,211.78,210.01,210.895,211.78,208.9,210.34,208.865,209.025,208.945,211.78,207.01,211.04,207.01,209.025\n4/23/2015 4:00:00 PM,211.57,211.94,211.16,211.18,208.7875,211.94,210.01,210.975,211.94,208.9,210.42,208.55,209.025,208.7875,211.94,207.01,211.04,207.01,209.025\n4/24/2015 10:00:00 AM,211.7,211.76,211.12,211.54,208.8275,211.94,210.01,210.975,211.94,208.9,210.42,208.63,209.025,208.8275,211.94,207.01,211.04,207.01,209.025\n4/24/2015 11:00:00 AM,211.54,211.59,211.11,211.5,208.8275,211.94,210.01,210.975,211.94,208.9,210.42,208.63,209.025,208.8275,211.94,207.01,211.04,207.01,209.025\n4/24/2015 12:00:00 PM,211.5,211.79,211.42,211.64,208.8275,211.94,210.16,211.05,211.94,208.9,210.42,208.63,209.025,208.8275,211.94,207.01,211.04,207.01,209.025\n4/24/2015 1:00:00 PM,211.64,211.97,211.62,211.73,208.8275,211.97,210.29,211.13,211.97,208.9,210.435,208.63,209.025,208.8275,211.97,207.01,211.04,207.01,209.025\n4/24/2015 2:00:00 PM,211.73,211.87,211.59,211.74,208.8275,211.97,211.11,211.54,211.97,208.9,210.435,208.63,209.025,208.8275,211.97,207.01,211.04,207.01,209.025\n4/24/2015 3:00:00 PM,211.75,211.82,211.41,211.49,209.025,211.97,211.11,211.54,211.97,208.9,210.435,209.095,209.025,209.06,211.97,207.01,211.04,207.01,209.025\n4/24/2015 4:00:00 PM,211.49,211.71,211.43,211.65,209.025,211.97,211.11,211.54,211.97,208.9,210.435,209.91,209.025,209.4675,211.97,207.01,211.04,207.01,209.025\n4/27/2015 10:00:00 AM,212.34,212.43,211.87,212.32,208.2,212.43,211.11,211.77,212.43,208.9,210.665,210.18,209.025,209.6025,212.43,207.01,211.04,207.01,209.025\n4/27/2015 11:00:00 AM,212.32,212.48,211.81,211.9,208.48,212.48,211.11,211.795,212.48,208.9,210.69,210.18,208.995,209.5875,212.48,207.01,211.04,207.01,209.025\n4/27/2015 12:00:00 PM,211.89,212.12,211.65,211.74,209.025,212.48,211.11,211.795,212.48,208.9,210.69,210.15,208.995,209.5725,212.48,207.01,211.04,207.01,209.025\n4/27/2015 1:00:00 PM,211.74,211.81,211.01,211.17,209.025,212.48,211.01,211.745,212.48,208.9,210.69,210.05,208.995,209.5225,212.48,207.01,211.04,207.01,209.025\n4/27/2015 2:00:00 PM,211.16,211.4,210.92,211.23,209.025,212.48,210.92,211.7,212.48,208.9,210.69,210.05,208.995,209.5225,212.48,207.01,211.04,207.01,209.025\n4/27/2015 3:00:00 PM,211.23,211.37,210.89,211.08,209.025,212.48,210.89,211.685,212.48,208.9,210.69,210.05,208.995,209.5225,212.48,207.01,211.04,207.01,209.025\n4/27/2015 4:00:00 PM,211.08,211.25,210.54,210.74,209.025,212.48,210.54,211.51,212.48,209.91,211.195,209.88,208.995,209.4375,212.48,207.01,211.04,207.01,209.025\n4/28/2015 10:00:00 AM,210.71,210.92,210.4,210.63,209.025,212.48,210.4,211.44,212.48,209.91,211.195,209.58,208.995,209.2875,212.48,207.01,211.04,207.01,209.025\n4/28/2015 11:00:00 AM,210.63,210.63,209.33,210.41,209.025,212.48,209.33,210.905,212.48,209.33,210.905,209.635,208.935,209.285,212.48,207.01,211.04,207.01,209.025\n4/28/2015 12:00:00 PM,210.41,211.27,210.4,211.1,209.025,212.48,209.33,210.905,212.48,209.33,210.905,209.785,208.935,209.36,212.48,207.01,211.04,207.01,209.025\n4/28/2015 1:00:00 PM,211.1,211.46,210.93,211.31,209.025,212.12,209.33,210.725,212.48,209.33,210.905,209.835,208.935,209.385,212.48,207.01,211.04,207.01,209.025\n4/28/2015 2:00:00 PM,211.3,211.5,211.17,211.29,209.025,211.81,209.33,210.57,212.48,209.33,210.905,209.875,208.935,209.405,212.48,207.01,211.04,207.01,209.025\n4/28/2015 3:00:00 PM,211.29,211.3,210.95,211.18,209.025,211.5,209.33,210.415,212.48,209.33,210.905,209.875,208.935,209.405,212.48,207.01,211.04,207.01,209.025\n4/28/2015 4:00:00 PM,211.18,211.43,211.06,211.41,209.025,211.5,209.33,210.415,212.48,209.33,210.905,209.88,208.935,209.4075,212.48,207.01,211.04,207.01,209.025\n4/29/2015 10:00:00 AM,210.32,211.21,210.32,210.82,209.205,211.5,209.33,210.415,212.48,209.33,210.905,210.15,209.205,209.6775,212.48,207.01,211.4,207.01,209.205\n4/29/2015 11:00:00 AM,210.82,210.98,210.1,210.56,209.395,211.5,209.33,210.415,212.48,209.33,210.905,210.845,209.555,210.2,212.48,207.33,211.78,207.01,209.395\n4/29/2015 12:00:00 PM,210.57,210.95,210.31,210.46,209.395,211.5,209.33,210.415,212.48,209.33,210.905,210.845,210.34,210.5925,212.48,208.9,211.78,207.01,209.395\n4/29/2015 1:00:00 PM,210.46,210.52,209.6,210.14,209.395,211.5,209.6,210.55,212.48,209.33,210.905,210.895,210.34,210.6175,212.48,208.9,211.78,207.01,209.395\n4/29/2015 2:00:00 PM,210.15,210.72,209.78,210.58,209.475,211.5,209.6,210.55,212.48,209.33,210.905,210.975,210.42,210.6975,212.48,208.9,211.94,207.01,209.475\n4/29/2015 3:00:00 PM,210.57,211.29,210.07,210.83,209.475,211.5,209.6,210.55,212.48,209.33,210.905,210.975,210.42,210.6975,212.48,208.9,211.94,207.01,209.475\n4/29/2015 4:00:00 PM,210.83,210.97,210.28,210.53,209.4,211.43,209.6,210.515,212.48,209.33,210.905,210.975,210.42,210.6975,212.48,208.9,211.94,207.01,209.475\n4/30/2015 10:00:00 AM,209.9,210.35,209.28,209.3,208.92,211.43,209.28,210.355,212.48,209.28,210.88,211.05,210.42,210.735,212.48,208.9,211.94,207.01,209.475\n4/30/2015 11:00:00 AM,209.3,209.52,208.92,209.26,208.89,211.29,208.92,210.105,212.48,208.92,210.7,211.13,210.435,210.7825,212.48,208.9,211.97,207.01,209.49\n4/30/2015 12:00:00 PM,209.25,210.2,209.25,209.45,208.36,211.29,208.92,210.105,212.48,208.92,210.7,211.54,210.435,210.9875,212.48,208.9,211.97,207.01,209.49\n4/30/2015 1:00:00 PM,209.44,209.72,208.97,209.31,208.8,211.29,208.92,210.105,212.48,208.92,210.7,211.54,210.435,210.9875,212.48,208.9,211.97,207.01,209.49\n4/30/2015 2:00:00 PM,209.32,209.54,209.19,209.24,208.55,211.29,208.92,210.105,212.48,208.92,210.7,211.54,210.435,210.9875,212.48,208.9,211.97,207.01,209.49\n4/30/2015 3:00:00 PM,209.24,210.59,208.15,208.2,207.98,211.29,208.15,209.72,212.48,208.15,210.315,211.77,210.665,211.2175,212.48,208.15,212.43,207.01,209.72\n4/30/2015 4:00:00 PM,208.19,208.53,207.62,208.48,207.51,211.29,207.62,209.455,212.12,207.62,209.87,211.795,210.69,211.2425,212.48,207.62,212.48,207.01,209.745\n5/1/2015 10:00:00 AM,209.41,209.88,209.37,209.54,207.17,210.97,207.62,209.295,211.81,207.62,209.715,211.795,210.69,211.2425,212.48,207.62,212.48,207.01,209.745\n5/1/2015 11:00:00 AM,209.54,210.1,209.35,209.6,208.04,210.59,207.62,209.105,211.5,207.62,209.56,211.745,210.69,211.2175,212.48,207.62,212.48,207.01,209.745\n5/1/2015 12:00:00 PM,209.61,210.1,209.28,209.6,207.66,210.59,207.62,209.105,211.5,207.62,209.56,211.7,210.69,211.195,212.48,207.62,212.48,207.01,209.745\n5/1/2015 1:00:00 PM,209.6,209.94,209.34,209.94,208.45,210.59,207.62,209.105,211.5,207.62,209.56,211.685,210.69,211.1875,212.48,207.62,212.48,207.01,209.745\n5/1/2015 2:00:00 PM,209.94,210.49,209.78,210.38,208.71,210.59,207.62,209.105,211.5,207.62,209.56,211.51,211.195,211.3525,212.48,207.62,212.48,207.01,209.745\n5/1/2015 3:00:00 PM,210.37,210.72,210.34,210.44,209.17,210.72,207.62,209.17,211.5,207.62,209.56,211.44,211.195,211.3175,212.48,207.62,212.48,207.01,209.745\n5/1/2015 4:00:00 PM,210.45,210.77,210.21,210.69,208.95,210.77,207.62,209.195,211.5,207.62,209.56,210.905,210.905,210.905,212.48,207.62,212.48,207.01,209.745\n5/4/2015 10:00:00 AM,211.22,211.98,211.1,211.91,209.1,211.98,207.62,209.8,211.98,207.62,209.8,210.905,210.905,210.905,212.48,207.62,212.48,207.01,209.745\n5/4/2015 11:00:00 AM,211.92,212.02,211.53,211.6,208.87,212.02,209.28,210.65,212.02,207.62,209.82,210.725,210.905,210.815,212.48,207.62,212.48,207.01,209.745\n5/4/2015 12:00:00 PM,211.61,211.75,211.41,211.66,209.745,212.02,209.28,210.65,212.02,207.62,209.82,210.57,210.905,210.7375,212.48,207.62,212.48,207.01,209.745\n5/4/2015 1:00:00 PM,211.66,211.74,211.37,211.43,209.745,212.02,209.28,210.65,212.02,207.62,209.82,210.415,210.905,210.66,212.48,207.62,212.48,207.01,209.745\n5/4/2015 2:00:00 PM,211.43,211.56,211.18,211.54,209.745,212.02,209.34,210.68,212.02,207.62,209.82,210.415,210.905,210.66,212.48,207.62,212.48,207.01,209.745\n5/4/2015 3:00:00 PM,211.54,211.75,211.4,211.54,209.745,212.02,209.78,210.9,212.02,207.62,209.82,210.415,210.905,210.66,212.48,207.62,212.48,207.01,209.745\n5/4/2015 4:00:00 PM,211.54,211.7,211.31,211.32,209.82,212.02,210.21,211.115,212.02,207.62,209.82,210.415,210.905,210.66,212.48,207.62,212.48,207.33,209.905\n5/5/2015 10:00:00 AM,211.01,211.46,210.57,210.63,209.82,212.02,210.21,211.115,212.02,207.62,209.82,210.415,210.905,210.66,212.48,207.62,212.48,208.9,210.69\n5/5/2015 11:00:00 AM,210.64,210.88,210.27,210.51,209.82,212.02,210.27,211.145,212.02,207.62,209.82,210.55,210.905,210.7275,212.48,207.62,212.48,208.9,210.69\n5/5/2015 12:00:00 PM,210.51,210.51,209.5,209.93,209.82,212.02,209.5,210.76,212.02,207.62,209.82,210.55,210.905,210.7275,212.48,207.62,212.48,208.9,210.69\n5/5/2015 1:00:00 PM,209.93,210.23,209.75,209.77,209.82,211.75,209.5,210.625,212.02,207.62,209.82,210.55,210.905,210.7275,212.48,207.62,212.48,208.9,210.69\n5/5/2015 2:00:00 PM,209.77,209.83,209.16,209.4,209.82,211.75,209.16,210.455,212.02,207.62,209.82,210.515,210.905,210.71,212.48,207.62,212.48,208.9,210.69\n5/5/2015 3:00:00 PM,209.4,209.62,208.74,208.92,209.82,211.75,208.74,210.245,212.02,207.62,209.82,210.355,210.88,210.6175,212.48,207.62,212.48,208.9,210.69\n5/5/2015 4:00:00 PM,208.93,209.36,208.73,208.89,209.82,211.75,208.73,210.24,212.02,207.62,209.82,210.105,210.7,210.4025,212.48,207.62,212.48,208.9,210.69\n5/6/2015 10:00:00 AM,209.54,209.93,207.98,208.36,209.82,211.7,207.98,209.84,212.02,207.62,209.82,210.105,210.7,210.4025,212.48,207.62,212.48,208.9,210.69\n5/6/2015 11:00:00 AM,208.36,208.98,207.65,208.8,209.555,211.46,207.65,209.555,212.02,207.62,209.82,210.105,210.7,210.4025,212.48,207.62,212.48,208.9,210.69\n5/6/2015 12:00:00 PM,208.81,208.89,208.12,208.55,209.05,210.88,207.65,209.265,212.02,207.62,209.82,210.105,210.7,210.4025,212.48,207.62,212.48,208.9,210.69\n5/6/2015 1:00:00 PM,208.55,208.58,207.86,207.98,209.08,210.51,207.65,209.08,212.02,207.62,209.82,209.72,210.315,210.0175,212.48,207.62,212.48,208.15,210.315\n5/6/2015 2:00:00 PM,207.99,208.17,207.28,207.51,208.755,210.23,207.28,208.755,212.02,207.28,209.65,209.455,209.87,209.6625,212.12,207.28,212.48,207.62,210.05\n5/6/2015 3:00:00 PM,207.52,207.65,206.76,207.17,208.345,209.93,206.76,208.345,212.02,206.76,209.39,209.295,209.715,209.505,212.02,206.76,212.48,207.62,210.05\n5/6/2015 4:00:00 PM,207.18,208.09,206.89,208.04,208.345,209.93,206.76,208.345,212.02,206.76,209.39,209.105,209.56,209.3325,212.02,206.76,212.48,207.62,210.05\n5/7/2015 10:00:00 AM,207.91,208.39,207.57,207.66,208.345,209.93,206.76,208.345,212.02,206.76,209.39,209.105,209.56,209.3325,212.02,206.76,212.48,207.62,210.05\n5/7/2015 11:00:00 AM,207.66,208.65,207.52,208.45,208.345,209.93,206.76,208.345,212.02,206.76,209.39,209.105,209.56,209.3325,212.02,206.76,212.48,207.62,210.05\n5/7/2015 12:00:00 PM,208.46,209.02,208.31,208.71,207.89,209.02,206.76,207.89,212.02,206.76,209.39,209.105,209.56,209.3325,212.02,206.76,212.48,207.62,210.05\n5/7/2015 1:00:00 PM,208.71,209.38,208.68,209.21,208.07,209.38,206.76,208.07,212.02,206.76,209.39,209.17,209.56,209.365,212.02,206.76,212.48,207.62,210.05\n5/7/2015 2:00:00 PM,209.21,209.36,208.84,208.95,208.07,209.38,206.76,208.07,212.02,206.76,209.39,209.195,209.56,209.3775,212.02,206.76,212.48,207.62,210.05\n5/7/2015 3:00:00 PM,208.95,209.25,208.95,209.1,208.07,209.38,206.76,208.07,212.02,206.76,209.39,209.8,209.8,209.8,212.02,206.76,212.48,207.62,210.05\n5/7/2015 4:00:00 PM,209.1,209.21,208.62,208.87,208.07,209.38,206.76,208.07,211.75,206.76,209.255,210.65,209.82,210.235,212.02,206.76,212.48,207.62,210.05\n5/8/2015 10:00:00 AM,210.84,211.43,210.78,211.29,209.16,211.43,206.89,209.16,211.75,206.76,209.255,210.65,209.82,210.235,212.02,206.76,212.48,207.62,210.05\n5/8/2015 11:00:00 AM,211.29,211.58,211.23,211.42,209.255,211.58,207.52,209.55,211.75,206.76,209.255,210.65,209.82,210.235,212.02,206.76,212.48,207.62,210.05\n5/8/2015 12:00:00 PM,211.42,211.86,211.41,211.74,209.31,211.86,207.52,209.69,211.86,206.76,209.31,210.68,209.82,210.25,212.02,206.76,212.48,207.62,210.05\n5/8/2015 1:00:00 PM,211.74,211.82,211.52,211.61,209.31,211.86,208.31,210.085,211.86,206.76,209.31,210.9,209.82,210.36,212.02,206.76,212.48,207.62,210.05\n5/8/2015 2:00:00 PM,211.6,211.77,211.4,211.42,209.31,211.86,208.62,210.24,211.86,206.76,209.31,211.115,209.82,210.4675,212.02,206.76,212.48,207.62,210.05\n5/8/2015 3:00:00 PM,211.43,211.58,211.3,211.57,209.31,211.86,208.62,210.24,211.86,206.76,209.31,211.115,209.82,210.4675,212.02,206.76,212.48,207.62,210.05\n5/8/2015 4:00:00 PM,211.57,211.76,211.45,211.65,209.31,211.86,208.62,210.24,211.86,206.76,209.31,211.145,209.82,210.4825,212.02,206.76,212.48,207.62,210.05\n5/11/2015 10:00:00 AM,211.54,211.85,211.27,211.66,209.31,211.86,208.62,210.24,211.86,206.76,209.31,210.76,209.82,210.29,212.02,206.76,212.48,207.62,210.05\n5/11/2015 11:00:00 AM,211.66,211.89,211.11,211.53,209.325,211.89,210.78,211.335,211.89,206.76,209.325,210.625,209.82,210.2225,212.02,206.76,212.48,207.62,210.05\n5/11/2015 12:00:00 PM,211.53,211.68,211.25,211.54,209.325,211.89,211.11,211.5,211.89,206.76,209.325,210.455,209.82,210.1375,212.02,206.76,212.48,207.62,210.05\n5/11/2015 1:00:00 PM,211.54,211.58,211.03,211.18,209.325,211.89,211.03,211.46,211.89,206.76,209.325,210.245,209.82,210.0325,212.02,206.76,212.48,207.62,210.05\n5/11/2015 2:00:00 PM,211.18,211.42,211.13,211.13,209.325,211.89,211.03,211.46,211.89,206.76,209.325,210.24,209.82,210.03,212.02,206.76,212.48,207.62,210.05\n5/11/2015 3:00:00 PM,211.13,211.25,210.68,210.72,209.325,211.89,210.68,211.285,211.89,206.76,209.325,209.84,209.82,209.83,212.02,206.76,212.48,207.62,210.05\n5/11/2015 4:00:00 PM,210.72,211.08,210.52,210.6,209.325,211.89,210.52,211.205,211.89,206.76,209.325,209.555,209.82,209.6875,212.02,206.76,212.48,207.62,210.05\n5/12/2015 10:00:00 AM,209.59,209.63,208.62,209.05,209.325,211.89,208.62,210.255,211.89,206.76,209.325,209.265,209.82,209.5425,212.02,206.76,212.48,207.62,210.05\n5/12/2015 11:00:00 AM,209.04,210.19,208.74,209.78,209.325,211.89,208.62,210.255,211.89,206.76,209.325,209.08,209.82,209.45,212.02,206.76,212.48,207.62,210.05\n5/12/2015 12:00:00 PM,209.78,210.28,209.75,210.02,209.2025,211.89,208.62,210.255,211.89,206.76,209.325,208.755,209.65,209.2025,212.02,206.76,212.12,207.28,209.7\n5/12/2015 1:00:00 PM,210.02,210.28,209.58,210.12,208.8675,211.68,208.62,210.15,211.89,206.89,209.39,208.345,209.39,208.8675,212.02,206.76,212.02,206.76,209.39\n5/12/2015 2:00:00 PM,210.12,210.49,209.92,210.1,208.8675,211.58,208.62,210.1,211.89,207.52,209.705,208.345,209.39,208.8675,212.02,206.76,212.02,206.76,209.39\n5/12/2015 3:00:00 PM,210.09,210.63,209.93,210.2,208.8675,211.42,208.62,210.02,211.89,207.52,209.705,208.345,209.39,208.8675,212.02,206.76,212.02,206.76,209.39\n5/12/2015 4:00:00 PM,210.19,210.4,209.93,209.98,208.8675,211.25,208.62,209.935,211.89,208.31,210.1,208.345,209.39,208.8675,212.02,206.76,212.02,206.76,209.39\n5/13/2015 10:00:00 AM,210.49,211.22,210.29,210.81,208.64,211.22,208.62,209.92,211.89,208.62,210.255,207.89,209.39,208.64,212.02,206.76,212.02,206.76,209.39\n5/13/2015 11:00:00 AM,210.8,210.98,210.04,210.06,208.73,211.22,208.62,209.92,211.89,208.62,210.255,208.07,209.39,208.73,212.02,206.76,212.02,206.76,209.39\n5/13/2015 12:00:00 PM,210.06,210.44,209.85,210.24,208.73,211.22,208.74,209.98,211.89,208.62,210.255,208.07,209.39,208.73,212.02,206.76,212.02,206.76,209.39\n5/13/2015 1:00:00 PM,210.24,210.42,209.92,210.19,208.73,211.22,209.58,210.4,211.89,208.62,210.255,208.07,209.39,208.73,212.02,206.76,212.02,206.76,209.39\n5/13/2015 2:00:00 PM,210.19,210.59,210.18,210.36,208.6625,211.22,209.58,210.4,211.89,208.62,210.255,208.07,209.255,208.6625,211.89,206.76,212.02,206.76,209.39\n5/13/2015 3:00:00 PM,210.36,210.4,209.87,209.97,209.2075,211.22,209.85,210.535,211.89,208.62,210.255,209.16,209.255,209.2075,211.89,206.76,212.02,206.76,209.39\n5/13/2015 4:00:00 PM,209.97,210.22,209.74,210.06,209.39,211.22,209.74,210.48,211.89,208.62,210.255,209.55,209.255,209.4025,211.89,206.76,212.02,206.76,209.39\n5/14/2015 10:00:00 AM,211.24,211.48,210.91,211.08,209.39,211.48,209.74,210.61,211.89,208.62,210.255,209.69,209.31,209.5,211.89,206.76,212.02,206.76,209.39\n5/14/2015 11:00:00 AM,211.08,211.65,210.94,211.51,209.39,211.65,209.74,210.695,211.89,208.62,210.255,210.085,209.31,209.6975,211.89,206.76,212.02,206.76,209.39\n5/14/2015 12:00:00 PM,211.51,211.62,211.33,211.56,209.39,211.65,209.74,210.695,211.89,208.62,210.255,210.24,209.31,209.775,211.89,206.76,212.02,206.76,209.39\n5/14/2015 1:00:00 PM,211.57,211.92,211.46,211.9,209.39,211.92,209.74,210.83,211.92,208.62,210.27,210.24,209.31,209.775,211.92,206.76,212.02,206.76,209.39\n5/14/2015 2:00:00 PM,211.9,212.19,211.86,212.06,209.39,212.19,209.74,210.965,212.19,208.62,210.405,210.24,209.31,209.775,212.19,206.76,212.02,206.76,209.39\n5/14/2015 3:00:00 PM,212.05,212.2,212,212.15,209.39,212.2,209.74,210.97,212.2,208.62,210.41,210.24,209.31,209.775,212.2,206.76,212.02,206.76,209.39\n5/14/2015 4:00:00 PM,212.15,212.32,212.06,212.21,209.39,212.32,209.74,211.03,212.32,208.62,210.47,211.335,209.325,210.33,212.32,206.76,212.02,206.76,209.39\n5/15/2015 10:00:00 AM,212.43,212.61,212.12,212.27,209.39,212.61,209.74,211.175,212.61,208.62,210.615,211.5,209.325,210.4125,212.61,206.76,212.02,206.76,209.39\n5/15/2015 11:00:00 AM,212.26,212.37,211.86,212.29,209.39,212.61,210.91,211.76,212.61,208.62,210.615,211.46,209.325,210.3925,212.61,206.76,212.02,206.76,209.39\n5/15/2015 12:00:00 PM,212.28,212.42,211.94,212.08,209.39,212.61,210.94,211.775,212.61,208.62,210.615,211.46,209.325,210.3925,212.61,206.76,212.02,206.76,209.39\n5/15/2015 1:00:00 PM,212.08,212.22,211.94,212.16,209.39,212.61,211.33,211.97,212.61,208.62,210.615,211.285,209.325,210.305,212.61,206.76,212.02,206.76,209.39\n5/15/2015 2:00:00 PM,212.16,212.23,212.04,212.09,209.39,212.61,211.46,212.035,212.61,208.62,210.615,211.205,209.325,210.265,212.61,206.76,212.02,206.76,209.39\n5/15/2015 3:00:00 PM,212.09,212.39,211.97,212.32,209.39,212.61,211.86,212.235,212.61,208.74,210.675,210.255,209.325,209.79,212.61,206.76,212.02,206.76,209.39\n5/15/2015 4:00:00 PM,212.32,212.48,212.22,212.44,209.39,212.61,211.86,212.235,212.61,209.58,211.095,210.255,209.325,209.79,212.61,206.76,212.02,206.76,209.39\n5/18/2015 10:00:00 AM,212.24,212.6,212.16,212.55,209.39,212.61,211.86,212.235,212.61,209.58,211.095,210.255,209.325,209.79,212.61,206.76,212.02,206.76,209.39\n5/18/2015 11:00:00 AM,212.55,212.6,212.25,212.42,209.39,212.61,211.86,212.235,212.61,209.74,211.175,210.15,209.39,209.77,212.61,206.89,212.02,206.76,209.39\n5/18/2015 12:00:00 PM,212.43,212.99,212.43,212.9,209.39,212.99,211.86,212.425,212.99,209.74,211.365,210.1,209.705,209.9025,212.99,207.52,212.02,206.76,209.39\n5/18/2015 1:00:00 PM,212.9,212.99,212.56,212.9,209.39,212.99,211.94,212.465,212.99,209.74,211.365,210.02,209.705,209.8625,212.99,207.52,212.02,206.76,209.39\n5/18/2015 2:00:00 PM,212.9,213.2,212.88,213.14,209.39,213.2,211.94,212.57,213.2,209.74,211.47,209.935,210.1,210.0175,213.2,208.31,212.02,206.76,209.39\n5/18/2015 3:00:00 PM,213.15,213.28,213.09,213.24,209.39,213.28,211.97,212.625,213.28,209.74,211.51,209.92,210.255,210.0875,213.28,208.62,212.02,206.76,209.39\n5/18/2015 4:00:00 PM,213.24,213.4,213.06,213.1,209.39,213.4,211.97,212.685,213.4,209.74,211.57,209.92,210.255,210.0875,213.4,208.62,212.02,206.76,209.39\n5/19/2015 10:00:00 AM,213.26,213.32,212.8,213.07,209.39,213.4,212.16,212.78,213.4,209.74,211.57,209.98,210.255,210.1175,213.4,208.62,212.02,206.76,209.39\n5/19/2015 11:00:00 AM,213.07,213.31,212.86,213.08,209.39,213.4,212.16,212.78,213.4,209.74,211.57,210.4,210.255,210.3275,213.4,208.62,212.02,206.76,209.39\n5/19/2015 12:00:00 PM,213.08,213.36,212.93,213.19,209.325,213.4,212.25,212.825,213.4,209.74,211.57,210.4,210.255,210.3275,213.4,208.62,211.89,206.76,209.325\n5/19/2015 1:00:00 PM,213.19,213.3,213.08,213.2,209.325,213.4,212.43,212.915,213.4,209.74,211.57,210.535,210.255,210.395,213.4,208.62,211.89,206.76,209.325\n5/19/2015 2:00:00 PM,213.2,213.57,213.15,213.45,209.325,213.57,212.56,213.065,213.57,210.91,212.24,210.48,210.255,210.3675,213.57,208.62,211.89,206.76,209.325\n5/19/2015 3:00:00 PM,213.46,213.49,212.97,213.18,209.325,213.57,212.8,213.185,213.57,210.94,212.255,210.61,210.255,210.4325,213.57,208.62,211.89,206.76,209.325\n5/19/2015 4:00:00 PM,213.18,213.19,212.69,213.03,209.325,213.57,212.69,213.13,213.57,211.33,212.45,210.695,210.255,210.475,213.57,208.62,211.89,206.76,209.325\n5/20/2015 10:00:00 AM,213.16,213.2,212.5,212.62,209.325,213.57,212.5,213.035,213.57,211.46,212.515,210.695,210.255,210.475,213.57,208.62,211.89,206.76,209.325\n5/20/2015 11:00:00 AM,212.62,213.19,212.53,213.02,209.34,213.57,212.5,213.035,213.57,211.86,212.715,210.83,210.27,210.55,213.57,208.62,211.92,206.76,209.34\n5/20/2015 12:00:00 PM,213.02,213.13,212.68,212.81,209.475,213.57,212.5,213.035,213.57,211.86,212.715,210.965,210.405,210.685,213.57,208.62,212.19,206.76,209.475\n5/20/2015 1:00:00 PM,212.82,213.1,212.78,212.93,209.48,213.57,212.5,213.035,213.57,211.86,212.715,210.97,210.41,210.69,213.57,208.62,212.2,206.76,209.48\n5/20/2015 2:00:00 PM,212.92,212.95,212.74,212.87,209.54,213.57,212.5,213.035,213.57,211.86,212.715,211.03,210.47,210.75,213.57,208.62,212.32,206.76,209.54\n5/20/2015 3:00:00 PM,212.87,213.78,212.84,213.43,209.685,213.78,212.5,213.14,213.78,211.86,212.82,211.175,210.615,210.895,213.78,208.62,212.61,206.76,209.685\n5/20/2015 4:00:00 PM,213.43,213.48,212.72,212.88,209.685,213.78,212.5,213.14,213.78,211.94,212.86,211.76,210.615,211.1875,213.78,208.62,212.61,206.76,209.685\n5/21/2015 10:00:00 AM,212.74,212.96,212.51,212.84,209.685,213.78,212.5,213.14,213.78,211.94,212.86,211.775,210.615,211.195,213.78,208.62,212.61,206.76,209.685\n5/21/2015 11:00:00 AM,212.84,213.37,212.74,213.24,209.685,213.78,212.5,213.14,213.78,211.97,212.875,211.97,210.615,211.2925,213.78,208.62,212.61,206.76,209.685\n5/21/2015 12:00:00 PM,213.24,213.6,213.24,213.5,209.685,213.78,212.51,213.145,213.78,211.97,212.875,212.035,210.615,211.325,213.78,208.62,212.61,206.76,209.685\n5/21/2015 1:00:00 PM,213.49,213.64,213.39,213.46,209.685,213.78,212.51,213.145,213.78,212.16,212.97,212.235,210.675,211.455,213.78,208.74,212.61,206.76,209.685\n5/21/2015 2:00:00 PM,213.47,213.55,213.15,213.19,209.685,213.78,212.51,213.145,213.78,212.16,212.97,212.235,211.095,211.665,213.78,209.58,212.61,206.76,209.685\n5/21/2015 3:00:00 PM,213.2,213.58,213.15,213.48,209.685,213.78,212.51,213.145,213.78,212.25,213.015,212.235,211.095,211.665,213.78,209.58,212.61,206.76,209.685\n5/21/2015 4:00:00 PM,213.48,213.75,213.21,213.5,209.75,213.78,212.51,213.145,213.78,212.43,213.105,212.235,211.175,211.705,213.78,209.74,212.61,206.89,209.75\n5/22/2015 10:00:00 AM,213.02,213.34,212.91,213.23,210.255,213.75,212.51,213.13,213.78,212.5,213.14,212.425,211.365,211.895,213.78,209.74,212.99,207.52,210.255\n5/22/2015 11:00:00 AM,213.23,213.43,213.14,213.37,210.255,213.75,212.51,213.13,213.78,212.5,213.14,212.465,211.365,211.915,213.78,209.74,212.99,207.52,210.255\n5/22/2015 12:00:00 PM,213.37,213.4,212.92,213.16,210.755,213.75,212.74,213.245,213.78,212.5,213.14,212.57,211.47,212.02,213.78,209.74,213.2,208.31,210.755\n5/22/2015 1:00:00 PM,213.16,213.27,213.03,213.24,210.95,213.75,212.91,213.33,213.78,212.5,213.14,212.625,211.51,212.0675,213.78,209.74,213.28,208.62,210.95\n5/22/2015 2:00:00 PM,213.22,213.54,213.07,213.33,211.01,213.75,212.91,213.33,213.78,212.5,213.14,212.685,211.57,212.1275,213.78,209.74,213.4,208.62,211.01\n5/22/2015 3:00:00 PM,213.33,213.35,213.15,213.27,211.01,213.75,212.91,213.33,213.78,212.5,213.14,212.78,211.57,212.175,213.78,209.74,213.4,208.62,211.01\n5/22/2015 4:00:00 PM,213.27,213.44,212.92,212.98,211.01,213.75,212.91,213.33,213.78,212.5,213.14,212.78,211.57,212.175,213.78,209.74,213.4,208.62,211.01\n5/26/2015 10:00:00 AM,212.39,212.5,211.47,211.57,211.01,213.75,211.47,212.61,213.78,211.47,212.625,212.825,211.57,212.1975,213.78,209.74,213.4,208.62,211.01\n5/26/2015 11:00:00 AM,211.59,211.69,210.83,210.9,211.01,213.54,210.83,212.185,213.78,210.83,212.305,212.915,211.57,212.2425,213.78,209.74,213.4,208.62,211.01\n5/26/2015 12:00:00 PM,210.91,211.24,210.61,210.89,211.095,213.54,210.61,212.075,213.78,210.61,212.195,213.065,212.24,212.6525,213.78,210.61,213.57,208.62,211.095\n5/26/2015 1:00:00 PM,210.9,211.11,210.67,210.7,211.095,213.54,210.61,212.075,213.78,210.61,212.195,213.185,212.255,212.72,213.78,210.61,213.57,208.62,211.095\n5/26/2015 2:00:00 PM,210.7,210.88,210.27,210.35,211.095,213.54,210.27,211.905,213.78,210.27,212.025,213.13,212.45,212.79,213.78,210.27,213.57,208.62,211.095\n5/26/2015 3:00:00 PM,210.34,210.62,210.21,210.24,211.095,213.54,210.21,211.875,213.78,210.21,211.995,213.035,212.515,212.775,213.78,210.21,213.57,208.62,211.095\n5/26/2015 4:00:00 PM,210.25,210.92,210.2,210.7,211.095,213.44,210.2,211.82,213.78,210.2,211.99,213.035,212.715,212.875,213.78,210.2,213.57,208.62,211.095\n5/27/2015 10:00:00 AM,211.23,212.16,210.85,211.85,211.095,213.44,210.2,211.82,213.78,210.2,211.99,213.035,212.715,212.875,213.78,210.2,213.57,208.62,211.095\n5/27/2015 11:00:00 AM,211.86,212,211.6,211.99,211.095,212.5,210.2,211.35,213.78,210.2,211.99,213.035,212.715,212.875,213.78,210.2,213.57,208.62,211.095\n5/27/2015 12:00:00 PM,211.99,212.34,211.85,212.22,210.77,212.34,210.2,211.27,213.78,210.2,211.99,213.035,212.715,212.875,213.78,210.2,213.57,208.62,211.095\n5/27/2015 1:00:00 PM,212.22,212.33,212.07,212.18,211.15,212.34,210.2,211.27,213.75,210.2,211.975,213.14,212.82,212.98,213.78,210.2,213.78,208.62,211.2\n5/27/2015 2:00:00 PM,212.18,212.49,212.16,212.47,211.2,212.49,210.2,211.345,213.75,210.2,211.975,213.14,212.86,213,213.78,210.2,213.78,208.62,211.2\n5/27/2015 3:00:00 PM,212.48,212.7,212.47,212.61,211.2,212.7,210.2,211.45,213.75,210.2,211.975,213.14,212.86,213,213.78,210.2,213.78,208.62,211.2\n5/27/2015 4:00:00 PM,212.61,212.98,212.59,212.7,211.2,212.98,210.2,211.59,213.75,210.2,211.975,213.14,212.875,213.0075,213.78,210.2,213.78,208.62,211.2\n5/28/2015 10:00:00 AM,212.34,212.59,211.82,211.85,211.2,212.98,210.2,211.59,213.75,210.2,211.975,213.145,212.875,213.01,213.78,210.2,213.78,208.62,211.2\n5/28/2015 11:00:00 AM,211.87,212.21,211.63,211.88,211.26,212.98,210.85,211.915,213.75,210.2,211.975,213.145,212.97,213.0575,213.78,210.2,213.78,208.74,211.26\n5/28/2015 12:00:00 PM,211.88,212.34,211.66,211.84,211.68,212.98,211.6,212.29,213.75,210.2,211.975,213.145,212.97,213.0575,213.78,210.2,213.78,209.58,211.68\n5/28/2015 1:00:00 PM,211.84,212.15,211.72,211.89,211.68,212.98,211.63,212.305,213.75,210.2,211.975,213.145,213.015,213.08,213.78,210.2,213.78,209.58,211.68\n5/28/2015 2:00:00 PM,211.89,212.26,211.84,212.1,211.76,212.98,211.63,212.305,213.54,210.2,211.87,213.145,213.105,213.125,213.78,210.2,213.78,209.74,211.76\n5/28/2015 3:00:00 PM,212.1,212.53,212,212.45,211.76,212.98,211.63,212.305,213.54,210.2,211.87,213.13,213.14,213.135,213.78,210.2,213.78,209.74,211.76\n5/28/2015 4:00:00 PM,212.45,212.58,212.3,212.46,211.76,212.98,211.63,212.305,213.54,210.2,211.87,213.13,213.14,213.135,213.78,210.2,213.78,209.74,211.76\n5/29/2015 10:00:00 AM,212.4,212.43,211.82,212.06,211.76,212.98,211.63,212.305,213.54,210.2,211.87,213.245,213.14,213.1925,213.78,210.2,213.78,209.74,211.76\n5/29/2015 11:00:00 AM,212.06,212.16,210.82,211.13,211.705,212.59,210.82,211.705,213.54,210.2,211.87,213.33,213.14,213.235,213.78,210.2,213.78,209.74,211.76\n5/29/2015 12:00:00 PM,211.13,211.58,210.86,211.48,211.35,212.58,210.82,211.7,213.44,210.2,211.82,213.33,213.14,213.235,213.78,210.2,213.78,209.74,211.76\n5/29/2015 1:00:00 PM,211.49,211.96,211.4,211.71,210.88,212.58,210.82,211.7,213.44,210.2,211.82,213.33,213.14,213.235,213.78,210.2,213.78,209.74,211.76\n5/29/2015 2:00:00 PM,211.71,212.1,211.63,211.79,210.59,212.58,210.82,211.7,212.98,210.2,211.59,213.33,213.14,213.235,213.78,210.2,213.78,209.74,211.76\n5/29/2015 3:00:00 PM,211.79,211.82,210.92,211.18,210.5,212.58,210.82,211.7,212.98,210.2,211.59,212.61,212.625,212.6175,213.78,210.2,213.78,209.74,211.76\n5/29/2015 4:00:00 PM,211.17,211.66,211.1,211.1,209.93,212.58,210.82,211.7,212.98,210.2,211.59,212.185,212.305,212.245,213.78,210.2,213.78,209.74,211.76\n6/1/2015 10:00:00 AM,211.95,212.11,210.94,211.3,210.13,212.58,210.82,211.7,212.98,210.2,211.59,212.075,212.195,212.135,213.78,210.2,213.78,210.61,212.195\n6/1/2015 11:00:00 AM,211.3,211.73,210.62,211.31,210.23,212.43,210.62,211.525,212.98,210.2,211.59,212.075,212.195,212.135,213.78,210.2,213.78,210.61,212.195\n6/1/2015 12:00:00 PM,211.3,211.59,211.03,211.15,209.68,212.16,210.62,211.39,212.98,210.2,211.59,211.905,212.025,211.965,213.78,210.2,213.78,210.27,212.025\n6/1/2015 1:00:00 PM,211.15,212.01,211.12,211.98,209.96,212.11,210.62,211.365,212.98,210.2,211.59,211.875,211.995,211.935,213.78,210.2,213.78,210.21,211.995\n6/1/2015 2:00:00 PM,211.99,212.09,211.83,212.04,209.97,212.11,210.62,211.365,212.98,210.62,211.8,211.82,211.99,211.905,213.78,210.2,213.78,210.2,211.99\n6/1/2015 3:00:00 PM,212.04,212.34,211.98,212.16,210.01,212.34,210.62,211.48,212.98,210.62,211.8,211.82,211.99,211.905,213.78,210.2,213.78,210.2,211.99\n6/1/2015 4:00:00 PM,212.16,212.26,211.46,211.57,209.87,212.34,210.62,211.48,212.98,210.62,211.8,211.35,211.99,211.67,213.78,210.2,213.78,210.2,211.99\n6/2/2015 10:00:00 AM,211.02,211.14,210.27,210.77,209.95,212.34,210.27,211.305,212.98,210.27,211.625,211.27,211.99,211.63,213.78,210.2,213.78,210.2,211.99\n6/2/2015 11:00:00 AM,210.77,211.47,210.56,211.15,209.77,212.34,210.27,211.305,212.98,210.27,211.625,211.27,211.975,211.6225,213.75,210.2,213.78,210.2,211.99\n6/2/2015 12:00:00 PM,211.15,211.44,211.04,211.37,209.33,212.34,210.27,211.305,212.98,210.27,211.625,211.345,211.975,211.66,213.75,210.2,213.78,210.2,211.99\n6/2/2015 1:00:00 PM,211.37,212.13,211.35,212,209.23,212.34,210.27,211.305,212.98,210.27,211.625,211.45,211.975,211.7125,213.75,210.2,213.78,210.2,211.99\n6/2/2015 2:00:00 PM,212,212.19,211.87,212.11,209.04,212.34,210.27,211.305,212.59,210.27,211.43,211.59,211.975,211.7825,213.75,210.2,213.78,210.2,211.99\n6/2/2015 3:00:00 PM,212.12,212.15,211.38,211.66,208.79,212.34,210.27,211.305,212.58,210.27,211.425,211.59,211.975,211.7825,213.75,210.2,213.78,210.2,211.99\n6/2/2015 4:00:00 PM,211.66,211.66,211.24,211.36,208.69,212.34,210.27,211.305,212.58,210.27,211.425,211.915,211.975,211.945,213.75,210.2,213.78,210.2,211.99\n6/3/2015 10:00:00 AM,211.97,212.16,211.33,211.96,209.13,212.26,210.27,211.265,212.58,210.27,211.425,212.29,211.975,212.1325,213.75,210.2,213.78,210.2,211.99\n6/3/2015 11:00:00 AM,211.95,212.67,211.57,212.55,208.49,212.67,210.27,211.47,212.67,210.27,211.47,212.305,211.975,212.14,213.75,210.2,213.78,210.2,211.99\n6/3/2015 12:00:00 PM,212.54,212.63,211.69,211.91,207.96,212.67,210.56,211.615,212.67,210.27,211.47,212.305,211.87,212.0875,213.54,210.2,213.78,210.2,211.99\n6/3/2015 1:00:00 PM,211.91,211.97,211.5,211.82,208.56,212.67,211.04,211.855,212.67,210.27,211.47,212.305,211.87,212.0875,213.54,210.2,213.78,210.2,211.99\n6/3/2015 2:00:00 PM,211.83,211.96,211.68,211.9,208.69,212.67,211.24,211.955,212.67,210.27,211.47,212.305,211.87,212.0875,213.54,210.2,213.78,210.2,211.99\n6/3/2015 3:00:00 PM,211.9,212.25,211.9,211.98,208.86,212.67,211.24,211.955,212.67,210.27,211.47,212.305,211.87,212.0875,213.54,210.2,213.78,210.2,211.99\n6/3/2015 4:00:00 PM,211.98,212.1,211.74,211.92,208.7,212.67,211.24,211.955,212.67,210.27,211.47,211.705,211.87,211.7875,213.54,210.2,213.78,210.2,211.99\n6/4/2015 10:00:00 AM,211.12,211.44,210.6,211.35,208.76,212.67,210.6,211.635,212.67,210.27,211.47,211.7,211.82,211.76,213.44,210.2,213.78,210.2,211.99\n6/4/2015 11:00:00 AM,211.35,211.78,210.8,210.88,208.47,212.67,210.6,211.635,212.67,210.27,211.47,211.7,211.82,211.76,213.44,210.2,213.78,210.2,211.99\n6/4/2015 12:00:00 PM,210.88,211.1,210.36,210.59,209.9,212.67,210.36,211.515,212.67,210.27,211.47,211.7,211.59,211.645,212.98,210.2,213.78,210.2,211.99\n6/4/2015 1:00:00 PM,210.59,210.81,210.47,210.5,210.55,212.63,210.36,211.495,212.67,210.27,211.47,211.7,211.59,211.645,212.98,210.2,213.78,210.2,211.99\n6/4/2015 2:00:00 PM,210.5,210.5,209.76,209.93,211.005,212.25,209.76,211.005,212.67,209.76,211.215,211.7,211.59,211.645,212.98,209.76,213.78,210.2,211.99\n6/4/2015 3:00:00 PM,209.93,210.35,209.78,210.13,211.005,212.25,209.76,211.005,212.67,209.76,211.215,211.7,211.59,211.645,212.98,209.76,213.78,210.2,211.99\n6/4/2015 4:00:00 PM,210.13,210.34,209.75,210.23,211,212.25,209.75,211,212.67,209.75,211.21,211.525,211.59,211.5575,212.98,209.75,213.78,210.2,211.99\n6/5/2015 10:00:00 AM,209.93,210.17,208.98,209.68,210.54,212.1,208.98,210.54,212.67,208.98,210.825,211.39,211.59,211.49,212.98,208.98,213.78,210.2,211.99\n6/5/2015 11:00:00 AM,209.7,210.58,209.66,209.96,210.38,211.78,208.98,210.38,212.67,208.98,210.825,211.365,211.59,211.4775,212.98,208.98,213.78,210.2,211.99\n6/5/2015 12:00:00 PM,209.96,210.22,209.79,209.97,210.38,211.78,208.98,210.38,212.67,208.98,210.825,211.365,211.8,211.5825,212.98,208.98,213.78,210.2,211.99\n6/5/2015 1:00:00 PM,209.97,210.07,209.47,210.01,210.04,211.1,208.98,210.04,212.67,208.98,210.825,211.48,211.8,211.64,212.98,208.98,213.78,210.2,211.99\n6/5/2015 2:00:00 PM,210,210.15,209.81,209.87,209.895,210.81,208.98,209.895,212.67,208.98,210.825,211.48,211.8,211.64,212.98,208.98,213.78,210.2,211.99\n6/5/2015 3:00:00 PM,209.88,210.17,209.8,209.95,209.78,210.58,208.98,209.78,212.67,208.98,210.825,211.305,211.625,211.465,212.98,208.98,213.78,210.2,211.99\n6/5/2015 4:00:00 PM,209.94,210.08,209.56,209.77,209.78,210.58,208.98,209.78,212.67,208.98,210.825,211.305,211.625,211.465,212.98,208.98,213.75,210.2,211.975\n6/8/2015 10:00:00 AM,209.63,209.82,209.17,209.33,209.78,210.58,208.98,209.78,212.67,208.98,210.825,211.305,211.625,211.465,212.98,208.98,213.75,210.2,211.975\n6/8/2015 11:00:00 AM,209.33,209.51,209.15,209.23,209.78,210.58,208.98,209.78,212.67,208.98,210.825,211.305,211.625,211.465,212.98,208.98,213.75,210.2,211.975\n6/8/2015 12:00:00 PM,209.23,209.47,208.96,209.04,209.77,210.58,208.96,209.77,212.67,208.96,210.815,211.305,211.43,211.3675,212.67,208.96,213.75,210.2,211.975\n6/8/2015 1:00:00 PM,209.04,209.19,208.77,208.79,209.495,210.22,208.77,209.495,212.67,208.77,210.72,211.305,211.425,211.365,212.67,208.77,213.75,210.2,211.975\n6/8/2015 2:00:00 PM,208.79,208.88,208.42,208.69,209.295,210.17,208.42,209.295,212.67,208.42,210.545,211.305,211.425,211.365,212.67,208.42,213.75,210.2,211.975\n6/8/2015 3:00:00 PM,208.7,209.26,208.47,209.13,209.295,210.17,208.42,209.295,212.67,208.42,210.545,211.265,211.425,211.345,212.67,208.42,213.75,210.2,211.975\n6/8/2015 4:00:00 PM,209.13,209.15,208.39,208.49,209.28,210.17,208.39,209.28,212.63,208.39,210.51,211.47,211.47,211.47,212.67,208.39,213.75,210.2,211.975\n6/9/2015 10:00:00 AM,208.44,208.82,207.91,207.96,208.995,210.08,207.91,208.995,212.25,207.91,210.08,211.615,211.47,211.5425,212.67,207.91,213.54,210.2,211.87\n6/9/2015 11:00:00 AM,207.96,208.6,207.69,208.56,208.755,209.82,207.69,208.755,212.25,207.69,209.97,211.855,211.47,211.6625,212.67,207.69,213.54,210.2,211.87\n6/9/2015 12:00:00 PM,208.56,208.91,208.41,208.69,208.13,209.51,207.69,208.6,212.25,207.69,209.97,211.955,211.47,211.7125,212.67,207.69,213.54,210.2,211.87\n6/9/2015 1:00:00 PM,208.69,208.88,208.5,208.86,208.57,209.47,207.69,208.58,212.1,207.69,209.895,211.955,211.47,211.7125,212.67,207.69,213.54,210.2,211.87\n6/9/2015 2:00:00 PM,208.87,209.1,208.63,208.7,208.475,209.26,207.69,208.475,211.78,207.69,209.735,211.955,211.47,211.7125,212.67,207.69,213.54,210.2,211.87\n6/9/2015 3:00:00 PM,208.7,209.02,208.64,208.76,208.475,209.26,207.69,208.475,211.78,207.69,209.735,211.635,211.47,211.5525,212.67,207.69,213.44,210.2,211.82\n6/9/2015 4:00:00 PM,208.75,208.81,208.27,208.47,208.475,209.26,207.69,208.475,211.1,207.69,209.395,211.635,211.47,211.5525,212.67,207.69,213.44,210.2,211.82\n6/10/2015 10:00:00 AM,209.38,210.1,209.31,209.9,208.895,210.1,207.69,208.895,210.81,207.69,209.25,211.515,211.47,211.4925,212.67,207.69,212.98,210.2,211.59\n6/10/2015 11:00:00 AM,209.9,210.6,209.9,210.55,209.07,210.6,207.69,209.145,210.6,207.69,209.145,211.495,211.47,211.4825,212.67,207.69,212.98,210.2,211.59\n6/10/2015 12:00:00 PM,210.55,211.41,210.47,211.06,209.42,211.41,207.69,209.55,211.41,207.69,209.55,211.005,211.215,211.11,212.67,207.69,212.98,209.76,211.37\n6/10/2015 1:00:00 PM,211.06,211.26,211.02,211.19,209.26,211.41,208.27,209.84,211.41,207.69,209.55,211.005,211.215,211.11,212.67,207.69,212.98,209.76,211.37\n6/10/2015 2:00:00 PM,211.19,211.25,210.92,211.08,209.55,211.41,208.27,209.84,211.41,207.69,209.55,211,211.21,211.105,212.67,207.69,212.98,209.75,211.365\n6/10/2015 3:00:00 PM,211.08,211.39,211.07,211.35,209.55,211.41,208.27,209.84,211.41,207.69,209.55,210.54,210.825,210.6825,212.67,207.69,212.98,208.98,210.98\n6/10/2015 4:00:00 PM,211.35,211.35,210.94,210.95,209.55,211.41,208.27,209.84,211.41,207.69,209.55,210.38,210.825,210.6025,212.67,207.69,212.98,208.98,210.98\n6/11/2015 10:00:00 AM,211.49,211.98,211.41,211.93,209.835,211.98,208.27,210.125,211.98,207.69,209.835,210.38,210.825,210.6025,212.67,207.69,212.98,208.98,210.98\n6/11/2015 11:00:00 AM,211.93,212.09,211.2,211.3,209.89,212.09,209.31,210.7,212.09,207.69,209.89,210.04,210.825,210.4325,212.67,207.69,212.98,208.98,210.98\n6/11/2015 12:00:00 PM,211.3,211.72,211.22,211.55,209.89,212.09,209.9,210.995,212.09,207.69,209.89,209.895,210.825,210.36,212.67,207.69,212.98,208.98,210.98\n6/11/2015 1:00:00 PM,211.55,211.7,211.38,211.62,209.89,212.09,210.47,211.28,212.09,207.69,209.89,209.78,210.825,210.3025,212.67,207.69,212.98,208.98,210.98\n6/11/2015 2:00:00 PM,211.62,211.87,211.49,211.76,209.89,212.09,210.92,211.505,212.09,207.69,209.89,209.78,210.825,210.3025,212.67,207.69,212.98,208.98,210.98\n6/11/2015 3:00:00 PM,211.76,211.82,211.56,211.64,209.64,212.09,210.92,211.505,212.09,207.69,209.89,209.78,210.825,210.3025,212.67,207.69,212.98,208.98,210.98\n6/11/2015 4:00:00 PM,211.64,211.76,211.29,211.65,209.89,212.09,210.94,211.515,212.09,207.69,209.89,209.78,210.825,210.3025,212.67,207.69,212.98,208.98,210.98\n6/12/2015 10:00:00 AM,210.62,210.84,210.13,210.41,209.89,212.09,210.13,211.11,212.09,207.69,209.89,209.77,210.815,210.2925,212.67,207.69,212.67,208.96,210.815\n6/12/2015 11:00:00 AM,210.41,210.73,209.71,209.75,209.89,212.09,209.71,210.9,212.09,207.69,209.89,209.495,210.72,210.1075,212.67,207.69,212.67,208.77,210.72\n6/12/2015 12:00:00 PM,209.75,210.54,209.68,210.07,209.89,212.09,209.68,210.885,212.09,207.69,209.89,209.295,210.545,209.92,212.67,207.69,212.67,208.42,210.545\n6/12/2015 1:00:00 PM,210.07,210.17,209.89,209.96,209.89,211.87,209.68,210.775,212.09,207.69,209.89,209.295,210.545,209.92,212.67,207.69,212.67,208.42,210.545\n6/12/2015 2:00:00 PM,209.96,210.3,209.92,210.19,209.89,211.87,209.68,210.775,212.09,207.69,209.89,209.28,210.51,209.895,212.63,207.69,212.67,208.39,210.53\n6/12/2015 3:00:00 PM,210.19,210.2,209.72,209.76,209.5375,211.87,209.68,210.775,212.09,207.69,209.89,208.995,210.08,209.5375,212.25,207.69,212.67,207.91,210.29\n6/12/2015 4:00:00 PM,209.76,210.2,209.72,210,209.3625,211.82,209.68,210.75,212.09,208.27,210.18,208.755,209.97,209.3625,212.25,207.69,212.67,207.69,210.18\n6/15/2015 10:00:00 AM,208.62,208.66,207.79,208.13,209.285,211.76,207.79,209.775,212.09,207.79,209.94,208.6,209.97,209.285,212.25,207.69,212.67,207.69,210.18\n6/15/2015 11:00:00 AM,208.12,208.59,208.03,208.57,209.2375,210.84,207.79,209.315,212.09,207.79,209.94,208.58,209.895,209.2375,212.1,207.69,212.67,207.69,210.18\n6/15/2015 12:00:00 PM,208.57,209.34,208.57,208.99,209.105,210.73,207.79,209.26,212.09,207.79,209.94,208.475,209.735,209.105,212.09,207.69,212.67,207.69,210.18\n6/15/2015 1:00:00 PM,208.99,209.31,208.9,209.23,209.105,210.54,207.79,209.165,212.09,207.79,209.94,208.475,209.735,209.105,212.09,207.69,212.67,207.69,210.18\n6/15/2015 2:00:00 PM,209.23,209.45,208.78,208.98,208.935,210.3,207.79,209.045,212.09,207.79,209.94,208.475,209.395,208.935,212.09,207.69,212.67,207.69,210.18\n6/15/2015 3:00:00 PM,208.98,209.32,208.82,208.91,209.045,210.3,207.79,209.045,212.09,207.79,209.94,208.895,209.25,209.0725,212.09,207.69,212.67,207.69,210.18\n6/15/2015 4:00:00 PM,208.9,209.26,208.75,209.07,208.995,210.2,207.79,208.995,212.09,207.79,209.94,209.145,209.145,209.145,212.09,207.69,212.67,207.69,210.18\n6/16/2015 10:00:00 AM,208.9,209.72,208.72,209.42,208.995,210.2,207.79,208.995,212.09,207.79,209.94,209.55,209.55,209.55,212.09,207.69,212.67,207.69,210.18\n6/16/2015 11:00:00 AM,209.42,209.56,208.87,209.26,208.755,209.72,207.79,208.755,212.09,207.79,209.94,209.84,209.55,209.695,212.09,207.69,212.67,207.69,210.18\n6/16/2015 12:00:00 PM,209.26,209.87,209.2,209.67,208.95,209.87,208.03,208.95,212.09,207.79,209.94,209.84,209.55,209.695,212.09,207.69,212.67,207.69,210.18\n6/16/2015 1:00:00 PM,209.67,210.03,209.59,209.99,209.3,210.03,208.57,209.3,212.09,207.79,209.94,209.84,209.55,209.695,212.09,207.69,212.67,207.69,210.18\n6/16/2015 2:00:00 PM,209.99,210.23,209.92,210.11,209.475,210.23,208.72,209.475,212.09,207.79,209.94,209.84,209.55,209.695,212.09,207.69,212.67,207.69,210.18\n6/16/2015 3:00:00 PM,210.11,210.35,210.11,210.27,209.535,210.35,208.72,209.535,212.09,207.79,209.94,210.125,209.835,209.98,212.09,207.69,212.67,207.69,210.18\n6/16/2015 4:00:00 PM,210.26,210.34,210.12,210.25,209.535,210.35,208.72,209.535,211.87,207.79,209.83,210.7,209.89,210.295,212.09,207.69,212.67,207.69,210.18\n6/17/2015 10:00:00 AM,210.58,210.99,210.57,210.71,209.83,210.99,208.72,209.855,211.87,207.79,209.83,210.995,209.89,210.4425,212.09,207.69,212.67,207.69,210.18\n6/17/2015 11:00:00 AM,210.71,210.84,210.48,210.71,209.83,210.99,208.72,209.855,211.87,207.79,209.83,211.28,209.89,210.585,212.09,207.69,212.67,207.69,210.18\n6/17/2015 12:00:00 PM,210.71,210.76,210.13,210.33,209.805,210.99,208.87,209.93,211.82,207.79,209.805,211.505,209.89,210.6975,212.09,207.69,212.67,207.69,210.18\n6/17/2015 1:00:00 PM,210.33,210.35,209.49,209.64,209.775,210.99,209.2,210.095,211.76,207.79,209.775,211.505,209.89,210.6975,212.09,207.69,212.67,207.69,210.18\n6/17/2015 2:00:00 PM,209.64,210.03,209.55,209.92,209.39,210.99,209.49,210.24,210.99,207.79,209.39,211.515,209.89,210.7025,212.09,207.69,212.67,207.69,210.18\n6/17/2015 3:00:00 PM,209.93,211.32,209.36,211.07,209.555,211.32,209.36,210.34,211.32,207.79,209.555,211.11,209.89,210.5,212.09,207.69,212.67,207.69,210.18\n6/17/2015 4:00:00 PM,211.07,211.17,210.58,210.61,209.555,211.32,209.36,210.34,211.32,207.79,209.555,210.9,209.89,210.395,212.09,207.69,212.67,207.69,210.18\n6/18/2015 10:00:00 AM,211.23,212.02,211.17,211.86,209.905,212.02,209.36,210.69,212.02,207.79,209.905,210.885,209.89,210.3875,212.09,207.69,212.67,207.69,210.18\n6/18/2015 11:00:00 AM,211.86,212.59,211.86,212.56,210.18,212.59,209.36,210.975,212.59,207.79,210.19,210.775,209.89,210.3325,212.59,207.69,212.67,207.69,210.18\n6/18/2015 12:00:00 PM,212.56,212.94,212.54,212.76,210.16,212.94,209.36,211.15,212.94,207.79,210.365,210.775,209.89,210.3325,212.94,207.69,212.63,207.69,210.16\n6/18/2015 1:00:00 PM,212.76,213.34,212.69,212.81,209.97,213.34,209.36,211.35,213.34,207.79,210.565,210.775,209.89,210.3325,213.34,207.69,212.25,207.69,209.97\n6/18/2015 2:00:00 PM,212.81,212.95,212.44,212.56,209.97,213.34,209.36,211.35,213.34,207.79,210.565,210.75,210.18,210.465,213.34,207.79,212.25,207.69,209.97\n6/18/2015 3:00:00 PM,212.56,212.99,212.51,212.96,209.8575,213.34,209.36,211.35,213.34,208.03,210.685,209.775,209.94,209.8575,213.34,207.79,212.25,207.69,209.97\n6/18/2015 4:00:00 PM,212.96,213.1,212.66,212.78,209.6275,213.34,209.36,211.35,213.34,208.57,210.955,209.315,209.94,209.6275,213.34,207.79,212.1,207.69,209.895\n6/19/2015 10:00:00 AM,211.42,211.52,211.09,211.35,209.6,213.34,210.58,211.96,213.34,208.72,211.03,209.26,209.94,209.6,213.34,207.79,212.09,207.69,209.89\n6/19/2015 11:00:00 AM,211.35,211.55,211.26,211.51,209.5525,213.34,211.09,212.215,213.34,208.72,211.03,209.165,209.94,209.5525,213.34,207.79,212.09,207.69,209.89\n6/19/2015 12:00:00 PM,211.51,211.52,211.07,211.13,209.4925,213.34,211.07,212.205,213.34,208.72,211.03,209.045,209.94,209.4925,213.34,207.79,212.09,207.69,209.89\n6/19/2015 1:00:00 PM,211.14,211.18,210.95,211.11,209.4925,213.34,210.95,212.145,213.34,208.72,211.03,209.045,209.94,209.4925,213.34,207.79,212.09,207.69,209.89\n6/19/2015 2:00:00 PM,211.12,211.31,210.99,211.21,209.4675,213.34,210.95,212.145,213.34,208.72,211.03,208.995,209.94,209.4675,213.34,207.79,212.09,207.69,209.89\n6/19/2015 3:00:00 PM,211.2,211.22,210.68,210.77,209.4675,213.1,210.68,211.89,213.34,208.87,211.105,208.995,209.94,209.4675,213.34,207.79,212.09,207.69,209.89\n6/19/2015 4:00:00 PM,210.76,211.01,210.44,210.46,209.3475,213.1,210.44,211.77,213.34,209.2,211.27,208.755,209.94,209.3475,213.34,207.79,212.09,207.69,209.89\n6/22/2015 10:00:00 AM,211.95,212.18,211.69,212.09,209.445,213.1,210.44,211.77,213.34,209.36,211.35,208.95,209.94,209.445,213.34,207.79,212.09,207.69,209.89\n6/22/2015 11:00:00 AM,212.08,212.46,211.97,212.34,209.62,212.46,210.44,211.45,213.34,209.36,211.35,209.3,209.94,209.62,213.34,207.79,212.09,207.69,209.89\n6/22/2015 12:00:00 PM,212.35,212.59,212.14,212.18,209.7075,212.59,210.44,211.515,213.34,209.36,211.35,209.475,209.94,209.7075,213.34,207.79,212.09,207.69,209.89\n6/22/2015 1:00:00 PM,212.18,212.21,211.64,211.99,209.7375,212.59,210.44,211.515,213.34,209.36,211.35,209.535,209.94,209.7375,213.34,207.79,212.09,207.69,209.89\n6/22/2015 2:00:00 PM,211.99,212.02,211.68,211.95,209.6825,212.59,210.44,211.515,213.34,209.36,211.35,209.535,209.83,209.6825,213.34,207.79,212.09,207.69,209.89\n6/22/2015 3:00:00 PM,211.95,212.15,211.81,212.07,209.8425,212.59,210.44,211.515,213.34,209.36,211.35,209.855,209.83,209.8425,213.34,207.79,212.09,207.69,209.89\n6/22/2015 4:00:00 PM,212.07,212.09,211.74,211.89,209.8425,212.59,210.44,211.515,213.34,209.36,211.35,209.855,209.83,209.8425,213.34,207.79,212.09,207.69,209.89\n6/23/2015 10:00:00 AM,212.18,212.31,212.07,212.26,209.8675,212.59,210.44,211.515,213.34,209.36,211.35,209.93,209.805,209.8675,213.34,207.79,212.09,207.69,209.89\n6/23/2015 11:00:00 AM,212.26,212.44,211.7,211.86,209.89,212.59,211.64,212.115,213.34,209.36,211.35,210.095,209.775,209.935,213.34,207.79,212.09,207.69,209.89\n6/23/2015 12:00:00 PM,211.86,212.02,211.71,211.84,209.815,212.59,211.64,212.115,213.34,209.36,211.35,210.24,209.39,209.815,213.34,207.79,212.09,207.69,209.89\n6/23/2015 1:00:00 PM,211.84,211.86,211.57,211.68,209.89,212.59,211.57,212.08,213.34,210.44,211.89,210.34,209.555,209.9475,213.34,207.79,212.09,207.69,209.89\n6/23/2015 2:00:00 PM,211.68,211.94,211.59,211.89,209.89,212.44,211.57,212.005,213.34,210.44,211.89,210.34,209.555,209.9475,213.34,207.79,212.09,207.69,209.89\n6/23/2015 3:00:00 PM,211.89,212.15,211.83,212.07,209.89,212.44,211.57,212.005,213.34,210.44,211.89,210.69,209.905,210.2975,213.34,207.79,212.09,207.69,209.89\n6/23/2015 4:00:00 PM,212.07,212.17,211.93,211.99,210.14,212.44,211.57,212.005,213.34,210.44,211.89,210.975,210.19,210.5825,213.34,207.79,212.59,207.69,210.14\n"
  },
  {
    "path": "Tests/TestData/spy_with_indicators.txt",
    "content": "Date,SMA14,EMA14,MACD 12 26,RSI 14,RSI 14 Wilder,OBV,Close\n1/9/2013 12:00:00 AM,,,,,,,13390.51\n1/10/2013 12:00:00 AM,,,,,,2.57E+08,13471.22\n1/11/2013 12:00:00 AM,,,,,,3.76E+08,13488.43\n1/14/2013 12:00:00 AM,,,,,,4.94E+08,13507.32\n1/15/2013 12:00:00 AM,,,,,,5.97E+08,13534.89\n1/16/2013 12:00:00 AM,,,,,,4.78E+08,13511.23\n1/17/2013 12:00:00 AM,,,,,,6.58E+08,13596.02\n1/18/2013 12:00:00 AM,,,,,,9.19E+08,13649.7\n1/22/2013 12:00:00 AM,,,,,,1.06E+09,13712.21\n1/23/2013 12:00:00 AM,,,,,,1.17E+09,13779.33\n1/24/2013 12:00:00 AM,,,,,,1.29E+09,13825.33\n1/25/2013 12:00:00 AM,,,,,,1.42E+09,13895.98\n1/28/2013 12:00:00 AM,,,,,,1.31E+09,13881.93\n1/29/2013 12:00:00 AM,13657.04,13657.04,,,,1.42E+09,13954.42\n1/30/2013 12:00:00 AM,13694.17,13690.82,,,88.04238,1.30E+09,13910.42\n1/31/2013 12:00:00 AM,13721.99,13713.46,,79.83788,81.63051,1.16E+09,13860.58\n2/1/2013 12:00:00 AM,13759.22,13752.97,,83.23053,85.12351,1.29E+09,14009.79\n2/4/2013 12:00:00 AM,13785.85,13769.92,,70.81807,72.26000,1.16E+09,13880.08\n2/5/2013 12:00:00 AM,13817.59,13797.83,,72.98048,75.33095,1.29E+09,13979.3\n2/6/2013 12:00:00 AM,13851.54,13822.99,,75.00231,75.54313,1.42E+09,13986.52\n2/7/2013 12:00:00 AM,13876.4,13839.13,,69.16106,71.63991,1.30E+09,13944.05\n2/8/2013 12:00:00 AM,13900.92,13859.64,,68.99854,73.34813,1.40E+09,13992.97\n2/11/2013 12:00:00 AM,13919.42,13874.52,,65.01398,71.29391,1.32E+09,13971.24\n2/12/2013 12:00:00 AM,13936.52,13893.75,,64.19803,73.06802,1.44E+09,14018.7\n2/13/2013 12:00:00 AM,13947.78,13905.64,,59.46132,69.57595,1.31E+09,13982.91\n2/14/2013 12:00:00 AM,13953.31,13914.67,139.5094,55.01595,68.63630,1.20E+09,13973.39\n2/15/2013 12:00:00 AM,13960.44,13923.62,132.8266,56.51675,69.03229,1.39E+09,13981.76\n2/19/2013 12:00:00 AM,13966.24,13938.56,130.3776,55.43573,71.52598,1.53E+09,14035.67\n2/20/2013 12:00:00 AM,13967.46,13937.09,118.3474,51.05484,60.92824,1.39E+09,13927.54\n2/21/2013 12:00:00 AM,13968.9,13929.56,103.8304,51.23921,56.98285,1.26E+09,13880.62\n2/22/2013 12:00:00 AM,13968.24,13939.03,100.8421,49.40847,63.49152,1.40E+09,14000.57\n2/25/2013 12:00:00 AM,13961.39,13918.38,80.08895,44.46252,49.06751,1.25E+09,13784.17\n2/26/2013 12:00:00 AM,13955.73,13915.95,72.16703,45.51572,54.97087,1.38E+09,13900.13\n2/27/2013 12:00:00 AM,13962.08,13937.2,79.11726,54.22788,62.11683,1.49E+09,14075.37\n2/28/2013 12:00:00 AM,13969.97,13952.84,81.99534,55.36546,60.87717,1.31E+09,14054.49\n3/1/2013 12:00:00 AM,13976.87,13971.08,86.1214,54.76105,62.24398,1.44E+09,14089.66\n3/4/2013 12:00:00 AM,13988.06,13991.98,91.41675,57.58727,63.72481,1.55E+09,14127.82\n3/5/2013 12:00:00 AM,14004.85,14026.89,104.571,60.58537,68.16319,1.66E+09,14253.77\n3/6/2013 12:00:00 AM,14027.23,14062.8,117.0733,64.02512,69.51755,1.78E+09,14296.24\n3/7/2013 12:00:00 AM,14052.66,14098.36,128.1868,65.60803,70.57302,1.89E+09,14329.49\n3/8/2013 12:00:00 AM,14082.33,14138.19,140.8241,67.30503,72.64614,2.01E+09,14397.07\n3/11/2013 12:00:00 AM,14111.73,14179.4,153.1265,67.20417,74.10603,2.10E+09,14447.29\n3/12/2013 12:00:00 AM,14149.05,14215.49,161.241,73.94858,74.18786,2.20E+09,14450.06\n3/13/2013 12:00:00 AM,14190.1,14247.46,166.1774,77.38509,74.35235,2.29E+09,14455.28\n3/14/2013 12:00:00 AM,14228.57,14286.35,174.8409,76.57948,76.89923,2.41E+09,14539.14\n3/15/2013 12:00:00 AM,14280.71,14316.72,177.6394,94.4133,74.52059,2.00E+09,14514.11\n3/18/2013 12:00:00 AM,14320.13,14334.76,172.8577,85.93996,68.83614,1.88E+09,14452.06\n3/19/2013 12:00:00 AM,14347.31,14350.91,167.4414,81.89716,68.99050,2.00E+09,14455.82\n3/20/2013 12:00:00 AM,14379.97,14372.35,165.7498,86.20842,71.26936,2.12E+09,14511.73\n3/21/2013 12:00:00 AM,14403.67,14378.9,155.3369,74.16928,63.19678,2.01E+09,14421.49\n3/22/2013 12:00:00 AM,14431.11,14396.65,152.631,76.00052,67.20987,2.11E+09,14512.03\n3/25/2013 12:00:00 AM,14444.97,14403.46,143.6439,64.32263,62.03774,1.99E+09,14447.75\n3/26/2013 12:00:00 AM,14463.78,14424.29,143.8922,67.64038,66.82403,2.08E+09,14559.65\n3/27/2013 12:00:00 AM,14477.83,14437.87,139.7754,63.1666,64.21457,1.99E+09,14526.16\n3/28/2013 12:00:00 AM,14490.79,14456.63,139.1356,62.40138,66.42305,2.15E+09,14578.54\n4/1/2013 12:00:00 AM,14499.76,14472.12,136.5947,59.13663,65.94694,2.05E+09,14572.85\n4/2/2013 12:00:00 AM,14514.9,14497.44,140.1599,63.7005,69.62148,2.15E+09,14662.01\n4/3/2013 12:00:00 AM,14521.69,14504.5,132.4485,55.40196,60.77653,2.03E+09,14550.35\n4/4/2013 12:00:00 AM,14526.48,14518.04,129.3456,53.93088,63.28498,2.13E+09,14606.11\n4/5/2013 12:00:00 AM,14530.13,14524.34,122.181,52.9469,60.24453,2.00E+09,14565.25\n4/8/2013 12:00:00 AM,14541.66,14536.22,119.0227,59.45237,62.53272,2.11E+09,14613.48\n4/9/2013 12:00:00 AM,14557.2,14554.52,119.9766,61.95713,65.21419,2.23E+09,14673.46\n4/10/2013 12:00:00 AM,14577.96,14587.55,129.6298,64.7774,70.15324,2.35E+09,14802.24\n4/11/2013 12:00:00 AM,14609.64,14624.56,140.7332,73.21284,72.22741,2.50E+09,14865.14\n4/12/2013 12:00:00 AM,14634.86,14656.63,147.8223,70.40273,72.22054,2.38E+09,14865.06\n4/15/2013 12:00:00 AM,14645.68,14648.97,130.4836,57.0988,53.87075,2.22E+09,14599.2\n4/16/2013 12:00:00 AM,14659.76,14663.35,127.9827,58.86048,60.30807,2.34E+09,14756.78\n4/17/2013 12:00:00 AM,14666.36,14657.38,113.5411,53.79709,53.28547,2.17E+09,14618.59\n4/18/2013 12:00:00 AM,14663.4,14641.35,94.43504,48.33891,49.61805,2.02E+09,14537.14\n4/19/2013 12:00:00 AM,14661.59,14628.84,79.21699,48.9871,50.08905,2.22E+09,14547.51\n4/22/2013 12:00:00 AM,14654.82,14620.61,67.95959,45.98599,51.02385,2.37E+09,14567.17\n4/23/2013 12:00:00 AM,14666.9,14633.79,70.51371,56.91946,57.64194,2.51E+09,14719.46\n4/24/2013 12:00:00 AM,14671.91,14639.46,68.26825,52.90185,55.35882,2.37E+09,14676.3\n4/25/2013 12:00:00 AM,14681.59,14647.64,67.68542,55.6809,56.41419,2.50E+09,14700.8\n4/26/2013 12:00:00 AM,14688.67,14656.29,67.39477,54.28297,56.93996,2.63E+09,14712.55\n4/29/2013 12:00:00 AM,14699.05,14677.96,74.87083,56.03981,61.46463,2.73E+09,14818.75\n4/30/2013 12:00:00 AM,14701.73,14699.53,81.55409,51.71498,62.31000,2.87E+09,14839.8\n5/1/2013 12:00:00 AM,14690,14699.72,74.78455,42.98929,53.90901,2.76E+09,14700.95\n5/2/2013 12:00:00 AM,14687.61,14717.3,79.04916,48.71385,59.44841,2.85E+09,14831.58\n5/3/2013 12:00:00 AM,14714.38,14751.52,92.84747,65.90579,64.46181,2.97E+09,14973.96\n5/6/2013 12:00:00 AM,14729.53,14780.51,102.1955,60.34124,64.15764,2.86E+09,14968.89\n5/7/2013 12:00:00 AM,14760.79,14817.27,115.3199,72.44913,67.04179,2.97E+09,15056.2\n5/8/2013 12:00:00 AM,14801.36,14855.65,128.1907,80.14308,68.56796,3.09E+09,15105.12\n5/9/2013 12:00:00 AM,14839.58,14885.91,135.019,78.03767,67.03054,2.99E+09,15082.62\n5/10/2013 12:00:00 AM,14878.96,14916.92,141.6915,78.4045,68.25265,3.09E+09,15118.49\n5/13/2013 12:00:00 AM,14905.55,14940.22,143.1658,72.02481,66.27522,2.99E+09,15091.68\n5/14/2013 12:00:00 AM,14944.05,14976.89,152.5468,79.1195,70.51534,3.12E+09,15215.25\n5/15/2013 12:00:00 AM,14985.11,15016.73,162.9797,79.90012,72.34670,3.24E+09,15275.69\n5/16/2013 12:00:00 AM,15022.3,15045.6,165.9083,76.24153,69.09889,3.09E+09,15233.22\n5/17/2013 12:00:00 AM,15060.56,15086.77,175.9789,76.59496,72.84480,3.27E+09,15354.4\n5/20/2013 12:00:00 AM,15095.95,15119.91,180.3383,74.64775,71.37463,3.15E+09,15335.28\n5/21/2013 12:00:00 AM,15145,15155.6,185.8707,87.3748,72.98097,3.28E+09,15387.58\n5/22/2013 12:00:00 AM,15178.97,15175.81,181.6725,77.38457,66.77651,3.11E+09,15307.17\n5/23/2013 12:00:00 AM,15201.86,15191.63,175.3023,71.69788,65.82689,2.96E+09,15294.5\n5/24/2013 12:00:00 AM,15225.74,15206.49,168.9996,72.51564,66.17848,3.06E+09,15303.1\n5/28/2013 12:00:00 AM,15250.96,15233.55,170.6147,73.20097,70.25205,3.19E+09,15409.39\n5/29/2013 12:00:00 AM,15265.08,15242.78,161.4329,62.07098,62.16587,3.08E+09,15302.8\n5/30/2013 12:00:00 AM,15282.36,15253.68,154.1329,64.78573,63.09839,3.20E+09,15324.53\n5/31/2013 12:00:00 AM,15282.15,15235.27,129.9879,49.8527,50.26767,2.99E+09,15115.57\n6/3/2013 12:00:00 AM,15293.75,15237.77,120.6348,57.36089,56.56958,3.14E+09,15254.03\n6/4/2013 12:00:00 AM,15291.06,15229.74,105.8303,48.214,52.60391,3.00E+09,15177.54\n6/5/2013 12:00:00 AM,15268.55,15193.85,75.7187,37.00318,43.32649,2.86E+09,14960.59\n6/6/2013 12:00:00 AM,15254.79,15173.42,57.6483,42.29467,47.03721,3.00E+09,15040.62\n6/7/2013 12:00:00 AM,15247.2,15183.38,59.38632,46.02274,55.22335,3.14E+09,15248.12\n6/10/2013 12:00:00 AM,15240.29,15190.74,59.31101,46.35546,54.80438,3.05E+09,15238.59\n6/11/2013 12:00:00 AM,15221.33,15181.58,49.27703,40.45283,49.82489,2.95E+09,15122.02\n6/12/2013 12:00:00 AM,15199.04,15156.73,30.73987,39.14737,45.03223,2.84E+09,14995.23\n6/13/2013 12:00:00 AM,15190.59,15159.31,30.29289,46.31169,52.10853,2.94E+09,15176.08\n6/14/2013 12:00:00 AM,15173.95,15147.43,21.14958,43.16004,48.19589,2.84E+09,15070.18\n6/17/2013 12:00:00 AM,15157.55,15151.75,22.49359,43.27265,52.19881,2.98E+09,15179.85\n6/18/2013 12:00:00 AM,15158.66,15173.95,34.32919,50.44397,56.74094,3.07E+09,15318.23\n6/19/2013 12:00:00 AM,15143.49,15165.71,26.77463,44.47642,49.23871,2.96E+09,15112.19\n6/20/2013 12:00:00 AM,15117.97,15111.39,-7.678265,41.35838,39.56340,2.79E+09,14758.32\n6/21/2013 12:00:00 AM,15085.5,15069.79,-31.30673,38.45913,41.01247,3.21E+09,14799.4\n6/24/2013 12:00:00 AM,15048.5,15015.1,-60.61768,37.2607,37.69885,3.05E+09,14659.56\n6/25/2013 12:00:00 AM,15034.19,14981.13,-74.85426,44.77567,41.37400,3.19E+09,14760.31\n6/26/2013 12:00:00 AM,15024.87,14971.66,-73.20298,46.71599,46.43461,3.32E+09,14910.14\n6/27/2013 12:00:00 AM,15008.9,14978.71,-61.95303,44.09465,49.98316,3.44E+09,15024.49\n6/28/2013 12:00:00 AM,14985.4,14969.49,-61.59802,41.77036,46.64001,3.21E+09,14909.6\n7/1/2013 12:00:00 AM,14974.9,14970.22,-55.40398,46.2246,48.74050,3.33E+09,14974.96\n7/2/2013 12:00:00 AM,14970.41,14965.18,-53.31399,48.31433,47.43149,3.21E+09,14932.41\n7/3/2013 12:00:00 AM,14957.01,14968.29,-46.5906,44.60703,49.36378,3.27E+09,14988.55\n7/5/2013 12:00:00 AM,14961.7,14990.63,-29.0424,51.84434,54.12789,3.37E+09,15135.84\n7/8/2013 12:00:00 AM,14964.91,15021.84,-7.87505,51.27445,56.77013,3.50E+09,15224.69\n7/9/2013 12:00:00 AM,14963.63,15058.97,14.83351,49.47272,58.93879,3.61E+09,15300.34\n7/10/2013 12:00:00 AM,14976.45,15090,31.76368,55.98579,58.57570,3.51E+09,15291.66\n7/11/2013 12:00:00 AM,15026.63,15139.46,58.16828,76.72454,63.32093,3.63E+09,15460.92\n7/12/2013 12:00:00 AM,15074.13,15182.77,78.46238,76.03729,63.41107,3.76E+09,15464.3\n7/15/2013 12:00:00 AM,15133.03,15222.97,95.06041,85.64143,63.97409,3.86E+09,15484.26\n7/16/2013 12:00:00 AM,15182.43,15253.48,104.3958,81.7628,62.29779,3.75E+09,15451.85\n7/17/2013 12:00:00 AM,15222.46,15282.42,112.0095,79.26448,62.90085,3.88E+09,15470.52\n7/18/2013 12:00:00 AM,15259.89,15317.91,122.9221,78.44663,65.39209,4.01E+09,15548.54\n7/19/2013 12:00:00 AM,15305.18,15348.02,129.6881,89.09528,65.10244,3.79E+09,15543.74\n7/22/2013 12:00:00 AM,15345.94,15374.35,133.6555,88.16814,65.16510,3.92E+09,15545.55\n7/23/2013 12:00:00 AM,15391.32,15400.14,137.011,93.68876,65.97176,4.02E+09,15567.74\n7/24/2013 12:00:00 AM,15430.87,15419.09,136.0443,89.74979,64.13383,3.92E+09,15542.24\n7/25/2013 12:00:00 AM,15460.85,15437.29,134.8031,87.30963,64.68929,4.02E+09,15555.61\n7/26/2013 12:00:00 AM,15484.72,15453.49,132.5513,85.03107,64.83056,4.11E+09,15558.83\n7/29/2013 12:00:00 AM,15500.55,15462.63,126.3361,75.29272,61.78342,4.03E+09,15521.97\n7/30/2013 12:00:00 AM,15516.9,15470.35,119.9168,76.56844,61.66656,3.91E+09,15520.59\n7/31/2013 12:00:00 AM,15519.66,15474.25,111.8417,56.83252,59.80826,3.76E+09,15499.54\n8/1/2013 12:00:00 AM,15531.36,15494.75,114.4896,70.07748,66.45314,3.87E+09,15628.02\n8/2/2013 12:00:00 AM,15543.79,15516.56,117.6798,70.82042,67.80671,3.98E+09,15658.36\n8/5/2013 12:00:00 AM,15555.24,15529.31,115.1502,68.55435,63.59603,3.90E+09,15612.13\n8/6/2013 12:00:00 AM,15558.69,15527.9,104.4063,54.75887,56.02705,3.81E+09,15518.74\n8/7/2013 12:00:00 AM,15553.12,15520.27,90.96411,41.83221,52.55954,3.73E+09,15470.67\n8/8/2013 12:00:00 AM,15549.88,15517.34,81.60162,45.45383,54.31114,3.82E+09,15498.32\n8/9/2013 12:00:00 AM,15541.3,15505.1,67.52816,39.48018,49.16348,3.74E+09,15425.51\n8/12/2013 12:00:00 AM,15530.73,15493.71,55.26731,36.64151,48.76492,3.66E+09,15419.68\n8/13/2013 12:00:00 AM,15524.21,15488.01,47.53067,41.85459,51.06096,3.74E+09,15451.01\n8/14/2013 12:00:00 AM,15508.64,15467.97,31.88541,33.4884,43.47072,3.65E+09,15337.66\n8/15/2013 12:00:00 AM,15476.74,15420.53,1.278171,24.68721,32.97150,3.52E+09,15112.19\n8/16/2013 12:00:00 AM,15445.28,15375.32,-25.16708,24.86022,31.84302,3.37E+09,15081.47\n8/19/2013 12:00:00 AM,15408.86,15326.71,-51.24173,23.0367,29.35211,3.26E+09,15010.74\n8/20/2013 12:00:00 AM,15373.39,15283.55,-71.70486,23.36539,29.08365,3.16E+09,15002.99\n8/21/2013 12:00:00 AM,15321.22,15232.08,-95.33129,9.82511,25.64681,3.06E+09,14897.55\n8/22/2013 12:00:00 AM,15271.6,15196.3,-107.4755,13.24613,31.14732,3.21E+09,14963.74\n8/23/2013 12:00:00 AM,15228.63,15171.53,-112.0345,18.18511,34.81675,3.34E+09,15010.51\n8/26/2013 12:00:00 AM,15187.75,15141.52,-119.439,18.76749,32.27962,3.24E+09,14946.46\n8/27/2013 12:00:00 AM,15138.14,15092.8,-137.4667,16.55787,26.70618,3.12E+09,14776.13\n8/28/2013 12:00:00 AM,15090.01,15057.03,-146.165,18.19099,30.38298,3.23E+09,14824.51\n8/29/2013 12:00:00 AM,15048.26,15028.22,-150.0027,20.85306,31.63796,3.32E+09,14840.95\n8/30/2013 12:00:00 AM,15004.73,14999.17,-153.7443,20.34957,30.53320,3.18E+09,14810.31\n9/3/2013 12:00:00 AM,14960.66,14977.14,-153.0371,19.74982,32.49266,3.33E+09,14833.96\n9/4/2013 12:00:00 AM,14931.6,14970.97,-143.0082,29.73087,39.96544,3.45E+09,14930.87\n9/5/2013 12:00:00 AM,14919.12,14966.5,-132.9938,38.86648,40.44965,3.55E+09,14937.48\n9/6/2013 12:00:00 AM,14907.76,14960.64,-124.8272,39.66215,39.66879,3.44E+09,14922.5\n9/9/2013 12:00:00 AM,14911.51,14974.3,-105.7888,53.12245,49.52020,3.53E+09,15063.12\n9/10/2013 12:00:00 AM,14924.94,15003.2,-79.46105,59.80598,56.48266,3.63E+09,15191.06\n9/11/2013 12:00:00 AM,14955.59,15046.32,-47.11607,71.68996,62.39944,3.74E+09,15326.6\n9/12/2013 12:00:00 AM,14979.65,15080.23,-23.3085,67.75358,60.69723,3.64E+09,15300.64\n9/13/2013 12:00:00 AM,15005.76,15119.67,1.626179,68.69874,63.78790,3.73E+09,15376.06\n9/16/2013 12:00:00 AM,15044.93,15169.69,30.61396,76.56224,68.04740,3.83E+09,15494.78\n9/17/2013 12:00:00 AM,15098.75,15217.69,55.76436,92.01784,69.19613,3.94E+09,15529.73\n9/18/2013 12:00:00 AM,15159.64,15278.93,86.57684,92.81021,73.51514,4.08E+09,15676.94\n9/19/2013 12:00:00 AM,15216.47,15326.61,106.509,89.01746,70.59067,3.97E+09,15636.55\n9/20/2013 12:00:00 AM,15262.24,15343.21,106.1171,77.28205,58.98716,3.59E+09,15451.09\n9/23/2013 12:00:00 AM,15302.77,15350.96,100.6352,73.63419,56.31511,3.49E+09,15401.38\n9/24/2013 12:00:00 AM,15331.61,15348.78,89.86549,67.24853,52.85099,3.41E+09,15334.59\n9/25/2013 12:00:00 AM,15355.59,15338.71,75.51114,63.70504,49.82044,3.32E+09,15273.26\n9/26/2013 12:00:00 AM,15384.58,15337.32,67.79498,66.03849,52.45532,3.40E+09,15328.3\n9/27/2013 12:00:00 AM,15398.52,15326.78,55.38817,58.1673,48.93312,3.31E+09,15258.24\n9/30/2013 12:00:00 AM,15394.13,15300.5,34.78021,47.43172,43.20034,3.19E+09,15129.67\n10/1/2013 12:00:00 AM,15384.5,15285.99,23.1863,43.98652,46.45940,3.27E+09,15191.7\n10/2/2013 12:00:00 AM,15372.53,15265.61,9.167026,42.74416,43.89857,3.18E+09,15133.14\n10/3/2013 12:00:00 AM,15345.42,15229.73,-12.82279,34.38565,38.55736,3.09E+09,14996.48\n10/4/2013 12:00:00 AM,15315.26,15208.77,-23.83453,32.00126,42.73568,3.17E+09,15072.58\n10/7/2013 12:00:00 AM,15272.87,15172.44,-43.06645,26.71218,37.77885,3.09E+09,14936.24\n10/8/2013 12:00:00 AM,15208.55,15119.65,-70.3838,15.01223,32.95661,2.98E+09,14776.53\n10/9/2013 12:00:00 AM,15149.01,15077.43,-88.87421,17.25475,34.44892,3.09E+09,14802.98\n10/10/2013 12:00:00 AM,15125.8,15083.91,-76.57464,38.47808,49.29563,3.19E+09,15126.07\n10/11/2013 12:00:00 AM,15114.06,15104.34,-57.20768,44.41932,53.21734,3.28E+09,15237.11\n10/14/2013 12:00:00 AM,15111.68,15130.59,-36.26486,48.86565,55.36520,3.36E+09,15301.26\n10/15/2013 12:00:00 AM,15104.17,15135.58,-30.07303,46.58512,50.20870,3.27E+09,15168.01\n10/16/2013 12:00:00 AM,15107.42,15167.35,-8.460448,51.34559,56.88788,3.36E+09,15373.83\n10/17/2013 12:00:00 AM,15115.52,15194.59,8.39502,53.4918,56.80096,3.25E+09,15371.65\n10/18/2013 12:00:00 AM,15134.8,15221.93,23.73882,58.86124,57.69496,3.41E+09,15399.65\n10/21/2013 12:00:00 AM,15149.12,15244.63,34.89547,56.82531,57.35486,3.32E+09,15392.2\n10/22/2013 12:00:00 AM,15173.02,15274.37,49.25837,61.25802,59.93135,3.42E+09,15467.66\n10/23/2013 12:00:00 AM,15202.79,15292.9,55.61597,64.85175,57.24948,3.33E+09,15413.33\n10/24/2013 12:00:00 AM,15233.98,15321.74,67.61174,65.34027,60.60029,3.42E+09,15509.21\n10/25/2013 12:00:00 AM,15279.27,15354.88,81.11134,73.51991,62.61050,3.53E+09,15570.28\n10/28/2013 12:00:00 AM,15335.87,15383.42,90.65586,83.30751,62.53455,3.44E+09,15568.93\n10/29/2013 12:00:00 AM,15398.54,15423.01,105.9888,84.42039,66.18113,3.52E+09,15680.35\n10/30/2013 12:00:00 AM,15433.73,15449.11,111.8809,74.31857,62.55653,3.44E+09,15618.76\n10/31/2013 12:00:00 AM,15455.78,15462,109.398,65.82832,58.46859,3.33E+09,15545.75\n11/1/2013 12:00:00 AM,15478.23,15482.47,111.7741,66.02522,61.08670,3.43E+09,15615.55\n11/4/2013 12:00:00 AM,15511.88,15503.36,114.2422,77.04637,61.95878,3.50E+09,15639.12\n11/5/2013 12:00:00 AM,15529.33,15518.67,113.2067,67.81238,60.66060,3.41E+09,15618.22\n11/6/2013 12:00:00 AM,15556.13,15549.1,121.3688,73.09129,65.45854,3.52E+09,15746.88\n11/7/2013 12:00:00 AM,15570.02,15555.08,114.1834,60.36548,56.62062,3.42E+09,15593.98\n11/8/2013 12:00:00 AM,15596.41,15582.64,120.6383,66.83368,62.59013,3.52E+09,15761.78\n11/11/2013 12:00:00 AM,15618.95,15609.37,126.0215,65.11305,63.28152,3.58E+09,15783.1\n11/12/2013 12:00:00 AM,15643.04,15628.21,126.2159,66.50877,61.42199,3.50E+09,15750.67\n11/13/2013 12:00:00 AM,15665.36,15654,130.5905,65.67147,63.92027,3.59E+09,15821.63\n11/14/2013 12:00:00 AM,15687.21,15683.63,136.8844,65.44682,65.75744,3.71E+09,15876.22\n11/15/2013 12:00:00 AM,15715.26,15720.71,147.0746,68.27811,68.46522,3.84E+09,15961.7\n11/18/2013 12:00:00 AM,15736.38,15754.75,154.5246,65.12644,68.90878,3.93E+09,15976.02\n11/19/2013 12:00:00 AM,15761.26,15783.05,157.8834,68.83098,68.25966,3.85E+09,15967.03\n11/20/2013 12:00:00 AM,15786.62,15798.75,153.434,69.34087,63.51430,3.76E+09,15900.82\n11/21/2013 12:00:00 AM,15814.8,15826.92,156.9082,70.60176,67.52334,3.84E+09,16009.99\n11/22/2013 12:00:00 AM,15845.2,15858.63,162.2118,71.52991,69.34364,3.92E+09,16064.77\n11/25/2013 12:00:00 AM,15877.65,15887.15,165.1384,73.28947,69.60388,4.02E+09,16072.54\n11/26/2013 12:00:00 AM,15900.93,15911.91,165.5702,69.2402,69.61317,4.13E+09,16072.8\n11/27/2013 12:00:00 AM,15936.89,15936.63,165.9784,85.02258,70.52889,4.19E+09,16097.33\n11/29/2013 12:00:00 AM,15960.07,15956.6,163.5356,78.89567,69.52445,4.12E+09,16086.41\n12/2/2013 12:00:00 AM,15976.19,15963.56,153.5646,68.25665,62.68860,4.03E+09,16008.77\n12/3/2013 12:00:00 AM,15987.9,15957.03,136.492,62.05927,55.55516,3.93E+09,15914.62\n12/4/2013 12:00:00 AM,15992.77,15948.06,119.5782,55.37668,53.81455,3.81E+09,15889.77\n12/5/2013 12:00:00 AM,15988.86,15931.19,99.51868,45.77418,49.24991,3.69E+09,15821.51\n12/6/2013 12:00:00 AM,15993.04,15943.06,98.51839,53.84595,59.90954,3.79E+09,16020.2\n12/9/2013 12:00:00 AM,15996.58,15954.05,97.03715,53.29391,60.15134,3.88E+09,16025.53\n12/10/2013 12:00:00 AM,15997.01,15956.6,90.59071,50.38364,56.54086,3.80E+09,15973.13\n12/11/2013 12:00:00 AM,15992.92,15941.52,74.16928,46.66278,48.74741,3.69E+09,15843.53\n12/12/2013 12:00:00 AM,15973.6,15914.58,52.15394,34.14587,43.55428,3.58E+09,15739.43\n12/13/2013 12:00:00 AM,15951.5,15893.35,35.58192,31.00462,44.52815,3.67E+09,15755.36\n12/16/2013 12:00:00 AM,15938.07,15892.18,32.5,39.95751,51.79325,3.77E+09,15884.57\n12/17/2013 12:00:00 AM,15923.96,15889.92,28.9723,39.54729,51.27219,3.67E+09,15875.26\n12/18/2013 12:00:00 AM,15929,15926.99,49.22835,52.91153,63.65316,3.80E+09,16167.97\n12/19/2013 12:00:00 AM,15935.62,15960.61,65.42376,53.81894,64.02677,3.89E+09,16179.08\n12/20/2013 12:00:00 AM,15950.79,15995.34,80.72208,59.01622,65.47369,4.18E+09,16221.14\n12/23/2013 12:00:00 AM,15977.93,16035.25,97.64895,66.42089,67.90232,4.26E+09,16294.61\n12/24/2013 12:00:00 AM,16011.35,16078.22,114.8187,69.5704,69.85837,4.29E+09,16357.55\n12/26/2013 12:00:00 AM,16058.37,16131.77,136.721,76.35185,73.26815,4.34E+09,16479.88\n12/27/2013 12:00:00 AM,16091.1,16177.99,152.2055,71.77859,73.16104,4.29E+09,16478.41\n12/30/2013 12:00:00 AM,16125.3,16221.5,164.6671,72.31929,73.88484,4.35E+09,16504.29\n12/31/2013 12:00:00 AM,16168.41,16268.85,178.3271,77.6217,75.84644,4.43E+09,16576.66\n1/2/2014 12:00:00 AM,16211.11,16291.85,176.2031,77.21804,65.88223,4.34E+09,16441.35\n1/3/2014 12:00:00 AM,16263.29,16315.6,174.8158,85.71571,66.87420,4.42E+09,16469.99\n1/6/2014 12:00:00 AM,16311.13,16330.2,168.1556,81.84067,63.74572,4.33E+09,16425.1\n1/7/2014 12:00:00 AM,16357.3,16356.97,169.4643,81.42798,67.59494,4.41E+09,16530.94\n1/8/2014 12:00:00 AM,16399.27,16371.07,163.118,77.01749,62.95649,4.31E+09,16462.74\n1/9/2014 12:00:00 AM,16419.04,16380.9,154.8526,67.03338,61.75336,4.22E+09,16444.76\n1/10/2014 12:00:00 AM,16437.46,16388.38,145.9972,65.94199,61.21315,4.14E+09,16437.05\n1/13/2014 12:00:00 AM,16440.09,16370.99,123.1074,51.94478,50.22192,4.03E+09,16257.94\n1/14/2014 12:00:00 AM,16445.75,16371.37,113.018,54.00823,55.75865,4.12E+09,16373.86\n1/15/2014 12:00:00 AM,16454.64,16386.12,112.447,56.01654,60.20327,4.23E+09,16481.94\n1/16/2014 12:00:00 AM,16450.15,16390.23,105.5386,46.78024,56.52907,4.14E+09,16417.01\n1/17/2014 12:00:00 AM,16448.73,16399.35,102.2379,49.02354,58.28359,4.32E+09,16458.56\n1/21/2014 12:00:00 AM,16442.31,16401.36,94.96716,45.65798,55.71225,4.21E+09,16414.44\n1/22/2014 12:00:00 AM,16427.79,16397.62,84.90986,39.86824,53.35097,4.12E+09,16373.34\n1/23/2014 12:00:00 AM,16410.36,16370.92,62.02346,38.31485,44.62849,4.03E+09,16197.35\n1/24/2014 12:00:00 AM,16368.15,16305.34,17.9991,27.84742,33.85095,3.88E+09,15879.11\n1/27/2014 12:00:00 AM,16326.21,16243.02,-19.98709,27.92406,32.74756,3.76E+09,15837.88\n1/28/2014 12:00:00 AM,16283.18,16201.09,-42.28686,27.09302,37.56761,3.85E+09,15928.56\n1/29/2014 12:00:00 AM,16231.47,16139.45,-74.4146,24.8,32.34330,3.74E+09,15738.79\n1/30/2014 12:00:00 AM,16188.89,16100.67,-89.97729,30.49567,37.73925,3.83E+09,15848.61\n1/31/2014 12:00:00 AM,16136.16,16047.09,-113.0916,27.90215,33.78243,3.69E+09,15698.85\n2/3/2014 12:00:00 AM,16072.94,15957.19,-155.922,25.64602,27.11650,3.54E+09,15372.8\n2/4/2014 12:00:00 AM,16006.61,15888.93,-181.923,23.82341,30.40232,3.66E+09,15445.24\n2/5/2014 12:00:00 AM,15932.2,15829.1,-200.6205,18.82401,30.30057,3.56E+09,15440.23\n2/6/2014 12:00:00 AM,15875.88,15802.36,-197.9623,28.02529,38.61550,3.67E+09,15628.53\n2/7/2014 12:00:00 AM,15828.42,15801.25,-180.4174,32.67833,44.84531,3.77E+09,15794.08\n2/10/2014 12:00:00 AM,15784.65,15801.33,-164.0003,33.72042,45.12463,3.86E+09,15801.79\n2/11/2014 12:00:00 AM,15757.61,15827.12,-133.8746,40.69179,51.71589,3.95E+09,15994.77\n2/12/2014 12:00:00 AM,15740.94,15845.36,-111.2055,43.81982,50.66881,3.88E+09,15963.94\n2/13/2014 12:00:00 AM,15751.55,15869.66,-87.10004,54.54405,52.79383,3.97E+09,16027.59\n2/14/2014 12:00:00 AM,15774.16,15907.62,-57.10634,59.20436,56.78735,4.06E+09,16154.39\n2/18/2014 12:00:00 AM,15788.57,15937.33,-34.86988,56.10656,55.82511,3.97E+09,16130.4\n2/19/2014 12:00:00 AM,15810.13,15951.09,-24.21758,59.7174,52.25422,3.89E+09,16040.56\n2/20/2014 12:00:00 AM,15830.46,15975.38,-8.203214,59.26752,55.42178,3.96E+09,16133.23\n2/21/2014 12:00:00 AM,15859.35,15992.43,2.049503,64.28397,54.17176,3.84E+09,16103.3\n2/24/2014 12:00:00 AM,15918.94,16021.06,18.34242,84.95235,57.73358,4.08E+09,16207.14\n2/25/2014 12:00:00 AM,15971.4,16042.21,28.7064,81.97083,56.48249,3.98E+09,16179.66\n2/26/2014 12:00:00 AM,16025.56,16063.03,37.99492,82.61497,57.16457,4.08E+09,16198.41\n2/27/2014 12:00:00 AM,16071.57,16090.98,50.76155,80.72334,59.84804,4.17E+09,16272.65\n2/28/2014 12:00:00 AM,16109.25,16121.75,64.09901,78.31335,61.56173,4.30E+09,16321.71\n3/3/2014 12:00:00 AM,16135.41,16127.92,61.55876,66.99115,53.81368,4.20E+09,16168.03\n3/4/2014 12:00:00 AM,16164.06,16163.65,77.04313,68.0257,61.54199,4.30E+09,16395.88\n3/5/2014 12:00:00 AM,16192.37,16189.85,85.44881,67.72912,59.85212,4.23E+09,16360.18\n3/6/2014 12:00:00 AM,16220.53,16220.79,95.9835,67.67304,61.80451,4.30E+09,16421.89\n3/7/2014 12:00:00 AM,16241.84,16251.71,105.6027,64.6302,62.77839,4.38E+09,16452.72\n3/10/2014 12:00:00 AM,16262.43,16273.98,109.2202,63.99924,60.93112,4.31E+09,16418.68\n3/11/2014 12:00:00 AM,16284.62,16284.28,105.4307,65.42326,57.33223,4.24E+09,16351.25\n3/12/2014 12:00:00 AM,16299.4,16291.72,100.3692,61.17245,56.73443,4.16E+09,16340.08\n3/13/2014 12:00:00 AM,16299.8,16267.34,76.81725,50.248,46.03522,4.07E+09,16108.89\n3/14/2014 12:00:00 AM,16289.69,16240.45,54.04175,43.36665,44.35134,3.99E+09,16065.67\n3/17/2014 12:00:00 AM,16294.52,16241.35,50.06444,52.76788,52.25215,4.08E+09,16247.22\n3/18/2014 12:00:00 AM,16304.36,16254,53.47516,55.33766,55.58046,4.15E+09,16336.19\n3/19/2014 12:00:00 AM,16300.75,16249.76,46.44232,48.10284,50.70267,4.06E+09,16222.17\n3/20/2014 12:00:00 AM,16301.42,16260.59,49.08858,50.33591,54.78351,4.16E+09,16331.05\n3/21/2014 12:00:00 AM,16311.05,16266.22,48.34647,55.32632,53.54371,3.80E+09,16302.77\n3/24/2014 12:00:00 AM,16302.53,16267.61,45.1337,44.39406,52.36673,3.69E+09,16276.69\n3/25/2014 12:00:00 AM,16303.08,16280.98,49.3766,50.3442,56.00804,3.78E+09,16367.88\n3/26/2014 12:00:00 AM,16292.16,16279.38,44.24949,43.38517,51.41766,3.69E+09,16268.99\n3/27/2014 12:00:00 AM,16278.7,16277.36,39.34855,41.65729,51.20013,3.59E+09,16264.23\n3/28/2014 12:00:00 AM,16271.87,16283.46,39.75328,45.85866,53.80150,3.68E+09,16323.06\n3/31/2014 12:00:00 AM,16279.47,16306.68,50.35473,54.35526,59.16498,3.79E+09,16457.66\n4/1/2014 12:00:00 AM,16293.22,16336.81,64.06571,57.48903,61.82285,3.87E+09,16532.61\n4/2/2014 12:00:00 AM,16326.37,16368.3,77.29989,71.19984,63.21244,3.95E+09,16573\n4/3/2014 12:00:00 AM,16362.58,16395.53,86.7518,74.09501,63.18485,3.87E+09,16572.55\n4/4/2014 12:00:00 AM,16374.4,16397.82,80.41776,58.03255,54.14369,3.77E+09,16412.71\n4/7/2014 12:00:00 AM,16367.95,16377.56,61.22952,45.92417,46.64157,3.65E+09,16245.87\n4/8/2014 12:00:00 AM,16370.37,16361.37,46.31744,51.6913,47.12722,3.75E+09,16256.14\n4/9/2014 12:00:00 AM,16377.95,16371.48,48.54829,54.92982,54.91694,3.84E+09,16437.18\n4/10/2014 12:00:00 AM,16368.49,16344.65,28.44691,44.96041,44.50455,3.73E+09,16170.22\n4/11/2014 12:00:00 AM,16350.63,16302.26,0.9288958,41.27594,40.10377,3.61E+09,16026.75\n4/14/2014 12:00:00 AM,16336.73,16285.06,-8.955553,43.45871,45.97771,3.70E+09,16173.24\n4/15/2014 12:00:00 AM,16336.27,16282.06,-9.472533,49.78249,49.24604,3.80E+09,16262.56\n4/16/2014 12:00:00 AM,16347.74,16301.1,3.176589,54.90968,54.61834,3.89E+09,16424.85\n4/17/2014 12:00:00 AM,16353.85,16315.42,11.74954,52.6826,53.99971,3.76E+09,16408.54\n4/21/2014 12:00:00 AM,16353.25,16333.27,21.57994,49.71954,55.35883,3.84E+09,16449.25\n4/22/2014 12:00:00 AM,16351.95,16357.41,34.23059,49.38771,57.52090,3.92E+09,16514.37\n4/23/2014 12:00:00 AM,16346.85,16376.64,42.73737,47.55957,56.94079,3.84E+09,16501.65\n4/24/2014 12:00:00 AM,16341.78,16393.31,48.91519,47.5742,56.94079,3.84E+09,16501.65\n4/25/2014 12:00:00 AM,16338.12,16389.06,42.01464,48.22259,50.43869,3.75E+09,16361.46\n4/28/2014 12:00:00 AM,16352.61,16397.02,43.09196,57.44658,53.96334,3.86E+09,16448.74\n4/29/2014 12:00:00 AM,16372.56,16415.47,50.3555,59.70539,57.21568,3.93E+09,16535.37\n4/30/2014 12:00:00 AM,16382.82,16437.52,59.09975,55.51284,58.85859,4.02E+09,16580.84\n5/1/2014 12:00:00 AM,16410.58,16453.7,63.52451,68.3677,57.70557,3.95E+09,16558.87\n5/2/2014 12:00:00 AM,16445.3,16461.59,62.59948,75.30721,55.26550,3.87E+09,16512.89\n5/5/2014 12:00:00 AM,16470.83,16470.79,62.57014,71.48206,56.03446,3.94E+09,16530.55\n5/6/2014 12:00:00 AM,16480.72,16461.48,51.50112,57.94049,49.33579,3.87E+09,16401.02\n5/7/2014 12:00:00 AM,16487.41,16469.09,51.61669,55.6638,54.63466,3.96E+09,16518.54\n5/8/2014 12:00:00 AM,16497.58,16480.01,53.70615,58.44579,56.00218,4.03E+09,16550.97\n5/9/2014 12:00:00 AM,16507.16,16493.79,57.3133,58.03059,57.38311,4.11E+09,16583.34\n5/12/2014 12:00:00 AM,16520.1,16520.68,68.43119,60.26791,61.84994,4.18E+09,16695.47\n5/13/2014 12:00:00 AM,16535.37,16546.64,77.9549,62.02236,62.60175,4.25E+09,16715.44\n5/14/2014 12:00:00 AM,16543.39,16555.62,76.43374,55.66931,56.50820,4.18E+09,16613.97\n5/15/2014 12:00:00 AM,16549.49,16541.11,61.03619,54.19385,48.18689,4.08E+09,16446.81\n5/16/2014 12:00:00 AM,16552.53,16534.47,51.82688,52.18357,50.28570,4.19E+09,16491.31\n5/19/2014 12:00:00 AM,16550.85,16531.46,45.66021,48.70642,51.26743,4.28E+09,16511.86\n5/20/2014 12:00:00 AM,16536.1,16510.51,29.33579,39.68162,44.87911,4.20E+09,16374.31\n5/21/2014 12:00:00 AM,16534.25,16513.51,28.87559,48.86562,52.27114,4.28E+09,16533.06\n5/22/2014 12:00:00 AM,16536.41,16517.46,28.98525,51.37024,52.70229,4.34E+09,16543.08\n5/23/2014 12:00:00 AM,16541.82,16529.3,33.7816,53.30033,55.43625,4.40E+09,16606.27\n5/27/2014 12:00:00 AM,16561.42,16548.79,42.67711,62.62748,58.28145,4.48E+09,16675.5\n5/28/2014 12:00:00 AM,16569.61,16560.04,45.78419,55.66608,55.93065,4.42E+09,16633.18\n5/29/2014 12:00:00 AM,16580.17,16578.54,52.92667,57.07188,58.70919,4.47E+09,16698.74\n5/30/2014 12:00:00 AM,16589.73,16597.02,59.38964,56.49139,59.48257,4.58E+09,16717.17\n6/2/2014 12:00:00 AM,16593.17,16616.57,65.88727,52.54773,60.62291,4.63E+09,16743.63\n6/3/2014 12:00:00 AM,16593.66,16630.67,68.52872,50.36453,59.17968,4.57E+09,16722.34\n6/4/2014 12:00:00 AM,16602.48,16644.92,71.02897,57.18196,59.91296,4.63E+09,16737.53\n6/5/2014 12:00:00 AM,16630.29,16670.41,80.04234,74.58871,64.38440,4.70E+09,16836.11\n6/6/2014 12:00:00 AM,16661.22,16704.26,93.22544,75.91724,67.83967,4.78E+09,16924.28\n6/9/2014 12:00:00 AM,16692.02,16736.11,103.993,75.8673,68.54123,4.85E+09,16943.1\n6/10/2014 12:00:00 AM,16732.85,16764.08,111.469,90.89749,68.65158,4.92E+09,16945.92\n6/11/2014 12:00:00 AM,16755.05,16774.72,107.9161,74.20262,60.39600,4.85E+09,16843.88\n6/12/2014 12:00:00 AM,16768.7,16769.32,95.1524,62.88158,53.01556,4.78E+09,16734.19\n6/13/2014 12:00:00 AM,16780.81,16770.17,87.38256,61.76628,55.24651,4.88E+09,16775.74\n6/16/2014 12:00:00 AM,16788.34,16771.62,80.71962,58.03953,55.53490,4.95E+09,16781.01\n6/17/2014 12:00:00 AM,16800.87,16776.53,76.77167,63.66723,57.08773,5.02E+09,16808.49\n6/18/2014 12:00:00 AM,16815.71,16793.88,80.6316,65.42307,62.16849,5.09E+09,16906.62\n6/19/2014 12:00:00 AM,16830.31,16810.89,83.92084,65.238,62.88417,5.17E+09,16921.46\n6/20/2014 12:00:00 AM,16844.84,16829.05,87.58521,65.19429,64.14526,5.42E+09,16947.08\n6/23/2014 12:00:00 AM,16860.19,16843.48,88.67465,66.33076,63.25807,5.36E+09,16937.26\n6/24/2014 12:00:00 AM,16865.95,16840.1,79.0145,55.28909,53.57692,5.28E+09,16818.13\n6/25/2014 12:00:00 AM,16868.19,16843.75,74.48461,52.20273,56.54557,5.35E+09,16867.51\n6/26/2014 12:00:00 AM,16862.61,16844.07,68.38129,43.95107,54.90836,5.29E+09,16846.13\n6/27/2014 12:00:00 AM,16856.09,16845.11,63.27563,42.78986,55.28076,5.42E+09,16851.84\n6/30/2014 12:00:00 AM,16847.57,16842.64,56.54091,40.89544,53.18962,5.33E+09,16826.6\n7/1/2014 12:00:00 AM,16855.58,16857.76,60.94823,58.21649,61.28062,5.41E+09,16956.07\n7/2/2014 12:00:00 AM,16872.87,16873.56,65.31568,70.40255,62.37179,5.47E+09,16976.24\n7/3/2014 12:00:00 AM,16893.76,16899.52,75.33373,72.72327,66.94818,5.53E+09,17068.26\n7/7/2014 12:00:00 AM,16911.14,16916.14,78.81026,67.81862,62.99828,5.47E+09,17024.21\n7/8/2014 12:00:00 AM,16918.14,16914.88,71.25537,56.351,53.86254,5.40E+09,16906.62\n7/9/2014 12:00:00 AM,16923.79,16924.31,70.82549,55.2422,58.24310,5.46E+09,16985.61\n7/10/2014 12:00:00 AM,16923.33,16923.07,64.0545,49.60508,53.36984,5.40E+09,16915.07\n7/11/2014 12:00:00 AM,16923.1,16925.84,60.31231,49.79873,55.02112,5.46E+09,16943.81\n7/14/2014 12:00:00 AM,16931.54,16943.12,65.59637,56.46379,60.82319,5.52E+09,17055.42\n7/15/2014 12:00:00 AM,16948.86,16958.79,69.40836,65.15652,61.07801,5.62E+09,17060.68\n7/16/2014 12:00:00 AM,16968.2,16982.71,77.78788,66.34032,64.72008,5.73E+09,17138.2\n7/17/2014 12:00:00 AM,16977.53,16981.93,70.59225,56.74791,53.49662,5.63E+09,16976.81\n7/18/2014 12:00:00 AM,16995.27,16997.69,73.99158,61.43415,59.30607,5.74E+09,17100.18\n7/21/2014 12:00:00 AM,17011.35,17004.9,71.94678,60.14865,56.32989,5.68E+09,17051.73\n7/22/2014 12:00:00 AM,17022.6,17019.38,74.45542,57.55968,59.14657,5.75E+09,17113.54\n7/23/2014 12:00:00 AM,17030.48,17028.35,73.42586,55.26551,57.41044,5.68E+09,17086.63\n7/24/2014 12:00:00 AM,17031.59,17035.74,71.5567,50.81023,57.22021,5.61E+09,17083.8\n7/25/2014 12:00:00 AM,17027.05,17025.72,59.44645,46.93515,49.52518,5.55E+09,16960.57\n7/28/2014 12:00:00 AM,17032.47,17019.97,51.03745,54.02958,50.79846,5.61E+09,16982.59\n7/29/2014 12:00:00 AM,17027.22,17005.59,38.2452,46.06595,46.73474,5.54E+09,16912.11\n7/30/2014 12:00:00 AM,17024.74,16988.89,25.25419,48.06163,44.98876,5.46E+09,16880.36\n7/31/2014 12:00:00 AM,16997.57,16932.15,-10.50418,33.92685,32.09415,5.36E+09,16563.3\n8/1/2014 12:00:00 AM,16957.42,16873.64,-43.97889,25.39191,30.04849,5.27E+09,16493.37\n8/4/2014 12:00:00 AM,16922.32,16833.06,-63.64881,29.73865,34.89929,5.35E+09,16569.28\n8/5/2014 12:00:00 AM,16871.7,16779.25,-89.4872,22.20549,30.67952,5.27E+09,16429.47\n8/6/2014 12:00:00 AM,16833.59,16734.46,-107.6048,26.34116,31.56358,5.35E+09,16443.34\n8/7/2014 12:00:00 AM,16781.31,16685.63,-126.5617,16.0878,29.37963,5.27E+09,16368.27\n8/8/2014 12:00:00 AM,16745.75,16668.07,-125.1612,29.53687,40.36882,5.35E+09,16553.93\n8/11/2014 12:00:00 AM,16706.93,16655,-121.3572,26.78247,41.22036,5.42E+09,16569.98\n8/12/2014 12:00:00 AM,16669.35,16642.4,-117.7471,27.18816,40.85086,5.35E+09,16560.54\n8/13/2014 12:00:00 AM,16638.49,16643.65,-106.2966,32.60229,45.89973,5.42E+09,16651.8\n8/14/2014 12:00:00 AM,16620.85,16652.98,-91.18583,39.53513,49.06915,5.48E+09,16713.58\n8/15/2014 12:00:00 AM,16598.02,16654.3,-82.34978,36.77635,46.65499,5.37E+09,16662.91\n8/18/2014 12:00:00 AM,16592.78,16678.89,-60.46217,47.20837,54.93971,5.45E+09,16838.74\n8/19/2014 12:00:00 AM,16595.58,16710.99,-36.17519,51.43892,58.15760,5.52E+09,16919.59\n8/20/2014 12:00:00 AM,16625.28,16746.74,-11.98496,68.80437,60.40036,5.58E+09,16979.13\n8/21/2014 12:00:00 AM,16664.29,16785.77,11.91907,74.91197,62.58956,5.64E+09,17039.49\n8/22/2014 12:00:00 AM,16695.14,16814.5,27.45863,70.40422,60.31290,5.58E+09,17001.22\n8/25/2014 12:00:00 AM,16741.38,16849.48,45.35521,82.55547,63.16516,5.63E+09,17076.87\n8/26/2014 12:00:00 AM,16788.77,16883.78,61.23949,82.83106,64.25603,5.68E+09,17106.7\n8/27/2014 12:00:00 AM,16842.61,16915.54,74.20791,89.64959,64.83170,5.75E+09,17122.01\n8/28/2014 12:00:00 AM,16880.15,16937.41,80.13718,82.55623,61.85766,5.69E+09,17079.57\n8/29/2014 12:00:00 AM,16917.9,16958.88,85.3754,82.61713,62.67789,5.77E+09,17098.45\n9/2/2014 12:00:00 AM,16954.12,16973.38,86.04242,80.48629,60.38970,5.71E+09,17067.56\n9/3/2014 12:00:00 AM,16984.58,16987.36,86.43954,78.39352,60.92286,5.77E+09,17078.28\n9/4/2014 12:00:00 AM,17010.01,16998.32,85.07164,75.50386,60.21449,5.70E+09,17069.58\n9/5/2014 12:00:00 AM,17043.9,17016.86,88.43735,83.17627,63.75079,5.78E+09,17137.36\n9/8/2014 12:00:00 AM,17063.37,17029.47,87.99722,74.12444,61.49791,5.72E+09,17111.42\n9/9/2014 12:00:00 AM,17070.11,17027.39,78.86774,58.10163,53.79839,5.65E+09,17013.87\n9/10/2014 12:00:00 AM,17076.51,17032.9,75.19109,57.7605,57.05364,5.72E+09,17068.71\n9/11/2014 12:00:00 AM,17077.19,17035.05,69.88126,50.88627,55.53903,5.66E+09,17049\n9/12/2014 12:00:00 AM,17076.21,17028.71,60.01956,48.77521,50.99111,5.58E+09,16987.51\n9/15/2014 12:00:00 AM,17072.94,17029.03,55.0897,45.66726,53.87711,5.65E+09,17031.14\n9/16/2014 12:00:00 AM,17074.74,17042.76,58.6429,52.1105,59.77276,5.72E+09,17131.97\n9/17/2014 12:00:00 AM,17077.23,17057.97,62.74309,52.86381,61.09428,5.81E+09,17156.85\n9/18/2014 12:00:00 AM,17090.55,17085.71,73.94684,63.80932,66.32102,5.89E+09,17265.99\n9/19/2014 12:00:00 AM,17103.5,17111.58,82.97888,63.53222,66.92390,6.24E+09,17279.74\n9/22/2014 12:00:00 AM,17111.01,17119.72,80.56919,57.04531,58.18956,6.17E+09,17172.68\n9/23/2014 12:00:00 AM,17109.41,17111.21,68.44487,48.68502,50.45260,6.09E+09,17055.87\n9/24/2014 12:00:00 AM,17119.44,17124.39,70.46593,57.04088,58.32888,6.17E+09,17210.06\n9/25/2014 12:00:00 AM,17105.76,17100.58,50.1658,41.97886,45.09733,6.08E+09,16945.8\n9/26/2014 12:00:00 AM,17105.88,17102.25,47.03927,50.06479,52.45310,6.15E+09,17113.15\n9/29/2014 12:00:00 AM,17109.98,17098.12,40.70884,52.24051,50.62303,6.08E+09,17071.22\n9/30/2014 12:00:00 AM,17108.13,17090.75,33.02601,48.97034,49.37014,5.98E+09,17042.9\n10/1/2014 12:00:00 AM,17090.69,17052.62,7.629463,41.70119,40.32944,5.88E+09,16804.71\n10/2/2014 12:00:00 AM,17077.37,17019.07,-12.64704,43.40669,40.20760,5.80E+09,16801.05\n10/3/2014 12:00:00 AM,17075.83,17017.82,-11.74552,49.32074,49.56217,5.89E+09,17009.69\n10/6/2014 12:00:00 AM,17065.83,17014.37,-12.32364,45.3187,48.86062,5.82E+09,16991.91\n10/7/2014 12:00:00 AM,17034.58,16975.04,-34.3756,37.45529,39.60671,5.75E+09,16719.39\n10/8/2014 12:00:00 AM,17015.17,16977.6,-29.33725,42.88297,49.90984,5.85E+09,16994.22\n10/9/2014 12:00:00 AM,16970.85,16935.15,-51.77682,36.09084,40.77844,5.76E+09,16659.25\n10/10/2014 12:00:00 AM,16925.95,16883.01,-77.95341,35.96042,38.19164,5.62E+09,16544.1\n10/13/2014 12:00:00 AM,16873.47,16808.08,-115.3653,34.33143,33.72875,5.52E+09,16321.07\n10/14/2014 12:00:00 AM,16809.55,16742.37,-143.8309,29.6297,33.61722,5.41E+09,16315.19\n10/15/2014 12:00:00 AM,16752.11,16662.28,-178.3305,30.9075,30.42149,5.24E+09,16141.74\n10/16/2014 12:00:00 AM,16680.98,16589.61,-205.2822,24.63099,29.98785,5.11E+09,16117.24\n10/17/2014 12:00:00 AM,16631.63,16561.72,-203.0652,34.18538,39.89826,5.25E+09,16380.41\n10/20/2014 12:00:00 AM,16585.69,16540.11,-197.4777,35.21328,40.56138,5.35E+09,16399.67\n10/21/2014 12:00:00 AM,16572.13,16550.07,-173.6873,45.58777,47.52601,5.45E+09,16614.81\n10/22/2014 12:00:00 AM,16547.86,16538.24,-165.3131,42.62036,43.60076,5.36E+09,16461.32\n10/23/2014 12:00:00 AM,16524.16,16556.86,-139.5911,42.81764,49.88981,5.46E+09,16677.9\n10/24/2014 12:00:00 AM,16510.84,16590,-107.676,46.14587,53.19868,5.55E+09,16805.41\n10/27/2014 12:00:00 AM,16517.88,16620.39,-80.44481,52.28176,53.52345,5.62E+09,16817.94\n10/28/2014 12:00:00 AM,16518.7,16671.77,-43.21101,50.27815,58.20508,5.70E+09,17005.75\n10/29/2014 12:00:00 AM,16541.21,16712.11,-16.05478,58.90535,57.16694,5.63E+09,16974.31\n10/30/2014 12:00:00 AM,16587.73,16776.55,23.04278,67.36948,62.26444,5.71E+09,17195.42\n10/31/2014 12:00:00 AM,16664.12,16858.41,68.97567,78.95147,66.09828,5.83E+09,17390.52\n11/3/2014 12:00:00 AM,16739.19,16926.13,102.2401,78.17271,65.21035,5.75E+09,17366.24\n11/4/2014 12:00:00 AM,16827.91,16987.15,128.5408,86.32895,65.57139,5.83E+09,17383.84\n11/5/2014 12:00:00 AM,16925.58,17053.47,155.7142,88.28425,67.64041,5.91E+09,17484.53\n11/6/2014 12:00:00 AM,17009.44,17120.27,180.8087,86.86268,69.03253,5.98E+09,17554.47\n11/7/2014 12:00:00 AM,17093.31,17180.76,199.9614,86.86433,69.42664,6.06E+09,17573.93\n11/10/2014 12:00:00 AM,17164.67,17238.49,215.8641,85.2394,70.26047,6.13E+09,17613.74\n11/11/2014 12:00:00 AM,17247.06,17288.68,225.956,95.59541,70.28590,6.18E+09,17614.9\n11/12/2014 12:00:00 AM,17313.8,17331.81,231.0724,94.44222,70.13557,6.11E+09,17612.2\n11/13/2014 12:00:00 AM,17374.33,17374.61,235.6855,93.94122,71.13508,6.19E+09,17652.79\n11/14/2014 12:00:00 AM,17432.67,17409.29,235.1741,92.11449,70.01292,6.12E+09,17634.74\n11/17/2014 12:00:00 AM,17478.53,17441.09,233.1312,90.38053,70.37567,6.19E+09,17647.75\n11/18/2014 12:00:00 AM,17529.49,17473.99,232.0704,94.39633,71.51844,6.27E+09,17687.82\n11/19/2014 12:00:00 AM,17564.51,17502.22,228.4279,91.93923,71.36381,6.20E+09,17685.73\n11/20/2014 12:00:00 AM,17587.98,17531.12,225.6249,88.85331,72.38729,6.28E+09,17719\n11/21/2014 12:00:00 AM,17619.68,17568.31,228.1216,95.33405,75.01899,6.42E+09,17810.06\n11/24/2014 12:00:00 AM,17650.68,17601.59,228.1035,95.23912,75.23781,6.50E+09,17817.9\n11/25/2014 12:00:00 AM,17674.28,17630.04,225.2537,93.24608,74.97080,6.42E+09,17814.94\n11/26/2014 12:00:00 AM,17693.8,17656.4,221.4758,92.05839,75.37805,6.48E+09,17827.75\n11/28/2014 12:00:00 AM,17711.97,17679.31,216.0311,91.56595,75.39454,6.56E+09,17828.24\n12/1/2014 12:00:00 AM,17723.62,17692.31,205.2,75.67551,70.08714,6.48E+09,17776.8\n12/2/2014 12:00:00 AM,17742.52,17717.28,202.5722,81.57133,74.02109,6.56E+09,17879.55\n12/3/2014 12:00:00 AM,17763.98,17743.32,200.8428,83.41727,75.15367,6.66E+09,17912.62\n12/4/2014 12:00:00 AM,17781.64,17764.22,196.2003,79.34199,73.84116,6.58E+09,17900.1\n12/5/2014 12:00:00 AM,17804.79,17790.17,195.0089,85.06503,75.96060,6.66E+09,17958.79\n12/8/2014 12:00:00 AM,17819.41,17798.48,183.3727,68.43199,65.59350,6.57E+09,17852.48\n12/9/2014 12:00:00 AM,17827.51,17798.84,168.0755,60.00558,61.25099,6.47E+09,17801.2\n12/10/2014 12:00:00 AM,17816.61,17763.41,132.7923,40.83644,44.62157,6.36E+09,17533.15\n12/11/2014 12:00:00 AM,17807.85,17741.14,108.6763,42.88891,48.19244,6.45E+09,17596.34\n12/12/2014 12:00:00 AM,17770.05,17679.76,63.37456,25.65427,35.78496,6.33E+09,17280.83\n12/15/2014 12:00:00 AM,17724.54,17613.24,19.18312,22.98431,32.89457,6.21E+09,17180.84\n12/16/2014 12:00:00 AM,17671.25,17540.66,-24.59055,21.03914,29.97484,6.09E+09,17068.87\n12/17/2014 12:00:00 AM,17637.62,17516.15,-35.63156,34.9391,43.79388,6.21E+09,17356.87\n12/18/2014 12:00:00 AM,17634.04,17551.09,-10.26939,48.73769,57.12323,6.34E+09,17778.15\n12/19/2014 12:00:00 AM,17636.04,17584.91,11.84424,50.71456,57.80494,6.68E+09,17804.8\n12/22/2014 12:00:00 AM,17641.75,17634.85,41.37061,51.98615,61.61831,6.78E+09,17959.44\n12/23/2014 12:00:00 AM,17649.72,17686.76,69.19603,52.73033,63.12075,6.86E+09,18024.17\n12/24/2014 12:00:00 AM,17659.01,17732.55,90.68991,53.19475,63.26525,6.90E+09,18030.21\n12/26/2014 12:00:00 AM,17665.79,17775.38,108.371,52.37169,63.85860,6.96E+09,18053.71\n12/29/2014 12:00:00 AM,17679.06,17810.42,119.7538,54.86177,63.13518,6.90E+09,18038.23\n12/30/2014 12:00:00 AM,17692.05,17833.44,122.907,54.7506,60.50493,6.86E+09,17983.07\n12/31/2014 12:00:00 AM,17712.76,17832.06,111.2132,58.02594,53.53762,6.77E+09,17823.07\n1/2/2015 12:00:00 AM,17729.66,17832.18,101.5754,56.75036,53.89212,6.85E+09,17832.99"
  },
  {
    "path": "Tests/TestData/spy_with_keltner.csv",
    "content": "Date,Open,High,Low,Close,Keltner Channels 20 Top,Keltner Channels 20 Bottom,Middle Band,TypicalPrice\n9/18/2013 12:00:00 AM,171.01,173.52,170.58,173.051,,,,172.3837\n9/19/2013 12:00:00 AM,173.52,173.6,172.585,172.76,,,,172.9817\n9/20/2013 12:00:00 AM,172.33,172.33,170.58,170.72,,,,171.21\n9/23/2013 12:00:00 AM,170.49,170.65,169.39,169.93,,,,169.99\n9/24/2013 12:00:00 AM,169.9,170.53,169.21,169.53,,,,169.7567\n9/25/2013 12:00:00 AM,169.64,169.98,168.89,169.04,,,,169.3033\n9/26/2013 12:00:00 AM,169.32,170.17,169.05,169.69,,,,169.6367\n9/27/2013 12:00:00 AM,168.84,169.14,168.47,168.909,,,,168.8397\n9/30/2013 12:00:00 AM,167.48,168.54,167.15,168.01,,,,167.9\n10/1/2013 12:00:00 AM,168.14,169.5,167.9671,169.34,,,,168.9357\n10/2/2013 12:00:00 AM,168.35,169.3422,167.83,169.18,,,,168.7841\n10/3/2013 12:00:00 AM,168.79,168.94,166.84,167.62,,,,167.8\n10/4/2013 12:00:00 AM,167.75,169.06,167.53,168.89,,,,168.4933\n10/7/2013 12:00:00 AM,167.42,168.45,167.25,167.43,,,,167.71\n10/8/2013 12:00:00 AM,167.4,167.62,165.36,165.48,,,,166.1533\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,,,,165.4433\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,,,,168.5533\n10/11/2013 12:00:00 AM,168.91,170.32,168.77,170.26,,,,169.7833\n10/14/2013 12:00:00 AM,169.21,171.08,169.08,170.94,,,,170.3667\n10/15/2013 12:00:00 AM,170.51,171.15,169.47,169.7,171.8585,166.5546,169.2066,170.1067\n10/16/2013 12:00:00 AM,170.72,172.16,170.635,172.07,171.7844,166.5525,169.1685,171.6217\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,171.839,166.4624,169.1507,172.6267\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.388,171.9186,166.6755,169.297,174.136\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,172.0941,166.9395,169.5168,174.3867\n10/22/2013 12:00:00 AM,174.91,175.93,174.4262,175.41,172.3849,167.1987,169.7918,175.2554\n10/23/2013 12:00:00 AM,174.81,174.89,173.96,174.57,172.6703,167.4302,170.0503,174.4733\n10/24/2013 12:00:00 AM,174.92,175.37,174.51,175.15,172.9188,167.7191,170.319,175.01\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,173.2344,168.0903,170.6623,175.7067\n10/28/2013 12:00:00 AM,175.89,176.47,175.7,176.23,173.5719,168.5761,171.074,176.1333\n10/29/2013 12:00:00 AM,176.63,177.24,176.38,177.17,173.9324,169.015,171.4737,176.93\n10/30/2013 12:00:00 AM,177.38,177.51,175.66,176.29,174.3428,169.3748,171.8588,176.4867\n10/31/2013 12:00:00 AM,176.15,176.89,175.53,175.79,174.6828,169.8618,172.2723,176.07\n11/1/2013 12:00:00 AM,176.02,176.61,175.22,176.21,175.0483,170.2483,172.6483,176.0133\n11/4/2013 12:00:00 AM,176.69,176.9,175.9825,176.83,175.4372,170.7455,173.0914,176.5708\n11/5/2013 12:00:00 AM,176.14,176.75,175.57,176.27,175.8643,171.3227,173.5935,176.1967\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,176.4127,171.9371,174.1749,177.07\n11/7/2013 12:00:00 AM,177.5,177.64,174.76,174.93,176.7153,172.3567,174.536,175.7767\n11/8/2013 12:00:00 AM,174.87,177.31,174.85,177.29,177.1186,172.6235,174.871,176.4833\n11/11/2013 12:00:00 AM,177.12,177.53,176.91,177.32,177.3594,173.0713,175.2154,177.2533\n11/12/2013 12:00:00 AM,176.94,177.36,176.37,176.96,177.6472,173.4625,175.5549,176.8967\n11/13/2013 12:00:00 AM,176.09,178.4261,176.09,178.38,177.9384,173.7724,175.8554,177.632\n11/14/2013 12:00:00 AM,178.54,179.42,178.25,179.27,178.1953,174.1508,176.173,178.98\n11/15/2013 12:00:00 AM,179.56,180.12,179.33,180.05,178.4472,174.4686,176.4579,179.8333\n11/18/2013 12:00:00 AM,180.35,180.5,179.02,179.42,178.7657,174.6761,176.7209,179.6467\n11/19/2013 12:00:00 AM,179.33,179.87,178.72,179.03,178.9347,174.9022,176.9185,179.2067\n11/20/2013 12:00:00 AM,179.39,179.93,177.98,178.47,179.1882,175.0807,177.1345,178.7933\n11/21/2013 12:00:00 AM,178.97,180.05,178.86,179.91,179.4721,175.2565,177.3643,179.6067\n11/22/2013 12:00:00 AM,179.98,180.83,179.77,180.81,179.726,175.479,177.6025,180.47\n11/25/2013 12:00:00 AM,181.13,181.17,180.37,180.63,179.9577,175.7062,177.832,180.7233\n11/26/2013 12:00:00 AM,180.72,181.22,180.405,180.68,180.135,175.9128,178.0239,180.7683\n11/27/2013 12:00:00 AM,180.87,181.24,180.65,181.12,180.2664,176.2331,178.2497,181.0033\n11/29/2013 12:00:00 AM,181.32,181.75,180.8,181,180.4913,176.5195,178.5054,181.1833\n12/2/2013 12:00:00 AM,181.09,181.43,180.25,180.53,180.7117,176.7714,178.7416,180.7367\n12/3/2013 12:00:00 AM,179.94,180.39,179.17,179.75,180.9048,176.8982,178.9015,179.77\n12/4/2013 12:00:00 AM,179.1,180.48,178.35,179.73,181.1363,176.9991,179.0677,179.52\n12/5/2013 12:00:00 AM,179.41,179.74,178.7701,178.94,181.2208,177.1226,179.1717,179.15\n12/6/2013 12:00:00 AM,180.67,181.11,180.15,180.94,181.4153,177.4237,179.4195,180.7333\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,181.5319,177.7998,179.6658,181.41\n12/10/2013 12:00:00 AM,180.98,181.36,180.635,180.75,181.7259,177.972,179.8489,180.915\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,181.9509,177.993,179.9719,179.3567\n12/12/2013 12:00:00 AM,178.64,178.86,177.76,178.13,181.8891,178.1166,180.0028,178.25\n12/13/2013 12:00:00 AM,178.5,178.66,177.77,178.11,181.8281,178.0976,179.9628,178.18\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.216,181.8656,178.0076,179.9366,179.3087\n12/17/2013 12:00:00 AM,179.36,179.41,178.25,178.65,181.7978,177.9878,179.8928,178.77\n12/18/2013 12:00:00 AM,178.92,181.73,177.32,181.7,182.0944,177.7954,179.9449,180.25\n12/19/2013 12:00:00 AM,181.19,181.7,180.71,181.49,182.1478,177.9928,180.0703,181.3\n12/20/2013 12:00:00 AM,180.67,181.99,180.5683,181.56,182.2242,178.093,180.1586,181.3728\n12/23/2013 12:00:00 AM,182.41,182.64,182.065,182.53,182.3228,178.1885,180.2557,182.4117\n12/24/2013 12:00:00 AM,182.54,183.01,182.53,182.93,182.4038,178.3175,180.3607,182.8233\n12/26/2013 12:00:00 AM,183.34,183.96,183.32,183.855,182.5671,178.4486,180.5078,183.7117\n12/27/2013 12:00:00 AM,184.1,184.18,183.66,183.845,182.7064,178.5984,180.6524,183.895\n12/30/2013 12:00:00 AM,183.87,184.02,183.58,183.82,182.7993,178.7678,180.7836,183.8067\n12/31/2013 12:00:00 AM,184.07,184.69,183.93,184.69,182.9611,178.9761,180.9686,184.4367\n1/2/2014 12:00:00 AM,183.98,184.07,182.48,182.92,183.1942,179.0817,181.1379,183.1567\n1/3/2014 12:00:00 AM,183.21,183.6,182.63,182.885,183.2831,179.3446,181.3138,183.0383\n1/6/2014 12:00:00 AM,183.47,183.56,182.08,182.36,183.4972,179.4821,181.4897,182.6667\n1/7/2014 12:00:00 AM,183.09,183.79,182.95,183.48,183.5753,179.6713,181.6233,183.4067\n1/8/2014 12:00:00 AM,183.45,183.83,182.89,183.52,183.6913,179.7557,181.7235,183.4133\n1/9/2014 12:00:00 AM,184.1,184.13,182.795,183.64,183.8643,179.8433,181.8538,183.5217\n1/10/2014 12:00:00 AM,183.95,184.22,183.01,184.14,184.0005,180.1505,182.0755,183.79\n1/13/2014 12:00:00 AM,183.71,184.18,181.34,181.685,184.3386,180.2276,182.2831,182.4017\n1/14/2014 12:00:00 AM,182.28,183.77,181.95,183.67,184.6757,180.3855,182.5306,183.13\n1/15/2014 12:00:00 AM,184.1,184.94,183.7102,184.66,184.8999,180.6741,182.787,184.4367\n1/16/2014 12:00:00 AM,184.28,184.6618,183.83,184.42,185.1519,180.9754,183.0637,184.3039\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.635,185.0835,181.399,183.2413,183.8017\n1/21/2014 12:00:00 AM,184.7,184.77,183.05,184.18,185.2733,181.4792,183.3763,184\n1/22/2014 12:00:00 AM,184.49,184.57,183.91,184.3,185.3605,181.6807,183.5206,184.26\n1/23/2014 12:00:00 AM,183.36,183.4,181.82,182.79,185.4784,181.5887,183.5335,182.67\n1/24/2014 12:00:00 AM,181.6,181.66,178.83,178.89,185.5879,181.1761,183.382,179.7933\n1/27/2014 12:00:00 AM,179.06,179.52,177.12,178.01,185.4159,180.7986,183.1073,178.2167\n1/28/2014 12:00:00 AM,178.14,179.3,178.12,179.07,185.2204,180.4876,182.854,178.83\n1/29/2014 12:00:00 AM,177.56,178.55,176.88,177.35,185.041,180.0457,182.5434,177.5933\n1/30/2014 12:00:00 AM,178.86,179.81,178.26,179.23,184.8934,179.6597,182.2765,179.1\n1/31/2014 12:00:00 AM,177.02,179.29,176.92,178.18,184.6541,179.3963,182.0252,178.13\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,184.5428,178.7495,181.6461,175.4567\n2/4/2014 12:00:00 AM,174.95,175.84,174.1055,175.385,184.184,178.3526,181.2683,175.1102\n2/5/2014 12:00:00 AM,174.79,175.56,173.71,175.17,183.7858,177.8914,180.8386,174.8133\n2/6/2014 12:00:00 AM,175.58,177.48,175.2209,177.48,183.5543,177.4543,180.5043,176.727\n2/7/2014 12:00:00 AM,178.31,179.87,177.73,179.68,183.412,177.1538,180.2829,179.0933\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,183.1844,176.9787,180.0816,179.7633\n2/11/2014 12:00:00 AM,180.16,182.439,180.0389,181.98,183.1078,176.9637,180.0358,181.486\n2/12/2014 12:00:00 AM,182.22,182.83,181.705,182.07,182.9894,176.9893,179.9893,182.2017\n2/13/2014 12:00:00 AM,180.84,183.2,180.83,183.01,182.9674,176.8023,179.8849,182.3467\n2/14/2014 12:00:00 AM,182.84,184.36,182.67,184.02,183.0007,176.7069,179.8538,183.6833\n2/18/2014 12:00:00 AM,184.19,184.49,183.65,184.24,182.9952,176.7449,179.8701,184.1267\n2/19/2014 12:00:00 AM,183.76,184.95,182.87,183.02,183.0029,176.6986,179.8507,183.6133\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,183.0714,176.5781,179.8247,183.74\n2/21/2014 12:00:00 AM,184.49,184.89,183.8,183.89,183.0433,176.7585,179.9009,184.1933\n2/24/2014 12:00:00 AM,184.28,186.15,184.2,184.91,183.1805,177.1507,180.1656,185.0867\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,183.436,177.5622,180.4991,184.8867\n2/26/2014 12:00:00 AM,185.11,185.6,184.33,184.85,183.7393,177.8685,180.8039,184.9267\n2/27/2014 12:00:00 AM,184.59,185.87,184.37,185.82,184.0755,178.3083,181.1919,185.3533\n2/28/2014 12:00:00 AM,185.79,187.15,185.05,186.29,184.4017,178.6884,181.5451,186.1633\n3/3/2014 12:00:00 AM,184.69,185.45,183.75,184.98,184.7443,179.0055,181.8749,184.7267\n3/4/2014 12:00:00 AM,186.75,187.98,186.75,187.58,185.2278,179.72,182.4739,187.4367\n3/5/2014 12:00:00 AM,187.72,188.07,187.45,187.75,185.7765,180.4359,183.1062,187.7567\n3/6/2014 12:00:00 AM,188.21,188.61,187.7796,188.18,186.3711,181.179,183.7751,188.1899\n3/7/2014 12:00:00 AM,188.87,188.96,187.43,188.26,186.8871,181.812,184.3495,188.2167\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,187.2328,182.3392,184.786,187.8233\n3/11/2014 12:00:00 AM,188.44,188.71,186.8,187.23,187.7024,182.6513,185.1769,187.58\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,187.8969,182.9926,185.4447,186.8433\n3/13/2014 12:00:00 AM,187.84,187.99,184.66,185.18,188.2493,183.0143,185.6318,185.9433\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,188.3046,183.2211,185.7628,184.9667\n3/17/2014 12:00:00 AM,185.59,186.77,185.51,186.33,188.4621,183.3156,185.8888,186.2033\n3/18/2014 12:00:00 AM,186.71,187.91,186.51,187.66,188.6792,183.4217,186.0505,187.36\n3/19/2014 12:00:00 AM,187.7,187.94,185.47,186.66,188.8623,183.5463,186.2043,186.69\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.747,189.0384,183.7149,186.3766,187.1857\n3/21/2014 12:00:00 AM,187.72,189.0239,186.03,186.2,189.3257,183.7166,186.5212,187.0846\n3/24/2014 12:00:00 AM,186.82,187.07,184.62,185.43,189.371,183.7334,186.5522,185.7067\n3/25/2014 12:00:00 AM,186.37,186.94,185.27,186.31,189.4586,183.7745,186.6165,186.1733\n3/26/2014 12:00:00 AM,187.03,187.34,184.92,184.97,189.5856,183.729,186.6573,185.7433\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,189.5438,183.6962,186.62,184.6067\n3/28/2014 12:00:00 AM,185.105,186.42,185,185.49,189.498,183.6894,186.5937,185.6367\n3/31/2014 12:00:00 AM,186.65,187.3,185.5216,187.01,189.5374,183.8383,186.6879,186.6105\n4/1/2014 12:00:00 AM,187.62,188.36,187.0015,188.25,189.436,183.9831,186.7096,187.8705\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,189.5117,184.0034,186.7576,188.7167\n4/3/2014 12:00:00 AM,189.17,189.22,188.05,188.63,189.5572,184.0023,186.7797,188.6333\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,189.6716,183.8062,186.7389,187.4\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,189.6176,183.5632,186.5904,184.8533\n4/8/2014 12:00:00 AM,184.21,185.4,183.59,185.1,189.4659,183.4265,186.4462,184.6967\n4/9/2014 12:00:00 AM,185.6,187.15,185.06,187.09,189.4934,183.3581,186.4257,186.4333\n4/10/2014 12:00:00 AM,187.09,187.17,182.93,183.155,189.4854,183.2136,186.3495,184.4183\n4/11/2014 12:00:00 AM,182.17,183.42,181.31,181.51,189.3973,183.013,186.2052,182.08\n4/14/2014 12:00:00 AM,182.93,183.37,181.44,182.9401,189.2028,182.8455,186.0242,182.5834\n4/15/2014 12:00:00 AM,183.32,184.33,181.51,184.2,189.0952,182.5518,185.8235,183.3467\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.125,189.0028,182.539,185.7709,185.6383\n4/17/2014 12:00:00 AM,185.88,186.91,185.56,186.39,188.9114,182.5405,185.726,186.2867\n4/21/2014 12:00:00 AM,186.44,187.1,186.21,187.04,188.7385,182.6833,185.7109,186.7833\n4/22/2014 12:00:00 AM,187.23,188.4,187.13,187.89,188.7618,182.87,185.8159,187.8067\n4/23/2014 12:00:00 AM,187.81,187.92,187.3,187.45,188.7522,183.0179,185.8851,187.5567\n4/24/2014 12:00:00 AM,188.37,188.39,186.93,187.83,188.7789,183.1886,185.9837,187.7167\n4/25/2014 12:00:00 AM,187.21,187.33,185.87,186.29,188.9124,183.2441,186.0782,186.4967\n4/28/2014 12:00:00 AM,187.05,187.69,184.96,186.875,189.0227,183.2209,186.1218,186.5083\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,189.0249,183.3199,186.1724,187.6233\n4/30/2014 12:00:00 AM,187.44,188.5,187.18,188.31,189.0284,183.3291,186.1788,187.9967\n5/1/2014 12:00:00 AM,188.22,188.84,187.73,188.325,189.0165,183.2992,186.1578,188.2983\n5/2/2014 12:00:00 AM,188.31,189.14,187.78,188.06,189.0154,183.2696,186.1425,188.3267\n5/5/2014 12:00:00 AM,187.14,188.55,186.62,188.42,188.9133,183.418,186.1657,187.8633\n5/6/2014 12:00:00 AM,188,188.13,186.74,186.78,188.9745,183.5932,186.2838,187.2167\n5/7/2014 12:00:00 AM,187.43,187.97,186.01,187.88,189.1152,183.7115,186.4133,187.2867\n5/8/2014 12:00:00 AM,187.67,189.05,187.08,187.675,189.1813,183.7955,186.4884,187.935\n5/9/2014 12:00:00 AM,187.69,188.04,186.83,187.96,189.1136,184.1824,186.648,187.61\n5/12/2014 12:00:00 AM,188.76,189.88,187.9992,189.785,189.4564,184.5537,187.0051,189.2214\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,189.7338,185.023,187.3784,190.05\n5/14/2014 12:00:00 AM,189.79,189.88,188.79,189.06,189.9049,185.4416,187.6732,189.2433\n5/15/2014 12:00:00 AM,188.67,188.72,186.48,187.4,190.0476,185.4884,187.768,187.5333\n5/16/2014 12:00:00 AM,187.51,188.13,186.72,188.05,190.1194,185.5512,187.8353,187.6333\n5/19/2014 12:00:00 AM,187.69,188.89,187.52,188.74,190.2354,185.5952,187.9153,188.3833\n5/20/2014 12:00:00 AM,188.645,188.67,187.07,187.55,190.2565,185.5698,187.9131,187.7633\n5/21/2014 12:00:00 AM,188.1,189.22,188.06,189.13,190.3976,185.5534,187.9755,188.8033\n5/22/2014 12:00:00 AM,189.18,189.98,188.86,189.59,190.4601,185.6669,188.0635,189.4767\n5/23/2014 12:00:00 AM,189.75,190.48,189.5858,190.35,190.5623,185.9289,188.2456,190.1386\n5/27/2014 12:00:00 AM,191.05,191.58,190.95,191.52,190.6919,186.2835,188.4877,191.35\n5/28/2014 12:00:00 AM,191.52,191.82,191.06,191.38,190.8513,186.5037,188.6775,191.42\n5/29/2014 12:00:00 AM,191.82,192.4,191.33,192.37,191.0344,186.7243,188.8793,192.0333\n5/30/2014 12:00:00 AM,192.19,192.8,192.03,192.68,191.2191,186.96,189.0896,192.5033\n6/2/2014 12:00:00 AM,192.95,192.99,191.97,192.895,191.4082,187.2001,189.3042,192.6183\n6/3/2014 12:00:00 AM,192.4,192.9,192.25,192.8,191.5516,187.5354,189.5435,192.65\n6/4/2014 12:00:00 AM,192.47,193.3,192.265,193.19,191.7883,187.8689,189.8286,192.9183\n6/5/2014 12:00:00 AM,193.41,194.65,192.7,194.45,192.1199,188.202,190.1609,193.9333\n6/6/2014 12:00:00 AM,194.87,195.43,194.78,195.375,192.4086,188.6392,190.5239,195.195\n6/9/2014 12:00:00 AM,195.35,196.05,195.17,195.58,192.7834,189.0635,190.9234,195.6\n6/10/2014 12:00:00 AM,195.33,195.64,194.92,195.6,193.0016,189.4617,191.2317,195.3867\n6/11/2014 12:00:00 AM,194.9,195.12,194.48,194.92,193.2764,189.666,191.4712,194.84\n6/12/2014 12:00:00 AM,194.65,194.8,193.11,193.54,193.553,189.8466,191.6998,193.8167\n6/13/2014 12:00:00 AM,193.9,194.32,193.3,194.13,193.7552,190.2828,192.019,193.9167\n6/16/2014 12:00:00 AM,193.89,194.7,193.66,194.29,194.0566,190.6397,192.3482,194.2167\n6/17/2014 12:00:00 AM,194.02,194.97,193.81,194.83,194.3485,190.9632,192.6559,194.5367\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.255,194.7666,191.3362,193.0514,195.675\n6/19/2014 12:00:00 AM,196.43,196.6,195.8,196.48,195.0759,191.776,193.4259,196.2933\n6/20/2014 12:00:00 AM,196.03,196.1039,195.7,195.94,195.3723,192.1234,193.7478,195.9146\n6/23/2014 12:00:00 AM,195.97,196.05,195.52,195.88,195.6289,192.4346,194.0317,195.8167\n6/24/2014 12:00:00 AM,195.53,196.5,194.48,194.7,195.8819,192.5692,194.2256,195.2267\n6/25/2014 12:00:00 AM,194.25,195.781,194.25,195.58,196.129,192.7005,194.4147,195.2037\n6/26/2014 12:00:00 AM,195.61,195.63,194.13,195.44,196.3129,192.82,194.5664,195.0667\n6/27/2014 12:00:00 AM,194.98,195.88,194.885,195.82,196.481,192.9543,194.7177,195.5283\n6/30/2014 12:00:00 AM,195.7,196.165,195.53,195.72,196.6115,193.1425,194.877,195.805\n7/1/2014 12:00:00 AM,196.19,197.63,196.13,197.03,196.92,193.2621,195.091,196.93\n7/2/2014 12:00:00 AM,197.05,197.48,196.96,197.23,197.0966,193.5159,195.3062,197.2233\n7/3/2014 12:00:00 AM,197.79,198.29,197.64,198.2,197.2353,193.7882,195.5117,198.0433\n7/7/2014 12:00:00 AM,197.82,197.98,197.22,197.51,197.3541,193.9069,195.6305,197.57\n7/8/2014 12:00:00 AM,197.15,197.22,195.76,196.24,197.4597,193.882,195.6708,196.4067\n7/9/2014 12:00:00 AM,196.73,197.295,196.31,197.12,197.5609,193.933,195.7469,196.9083\n7/10/2014 12:00:00 AM,195.22,196.86,195.06,196.34,197.6937,193.9248,195.8092,196.0867\n7/11/2014 12:00:00 AM,196.22,196.75,195.78,196.61,197.7589,194.116,195.9374,196.38\n7/14/2014 12:00:00 AM,197.61,197.86,197.44,197.6,197.9619,194.2845,196.1232,197.6333\n7/15/2014 12:00:00 AM,197.72,198.1,196.36,197.23,198.1651,194.3827,196.2739,197.23\n7/16/2014 12:00:00 AM,198.11,198.26,197.42,197.96,198.3225,194.5596,196.4411,197.88\n7/17/2014 12:00:00 AM,197.35,198.1,195.43,195.71,198.4119,194.5441,196.478,196.4133\n7/18/2014 12:00:00 AM,196.35,197.91,196.24,197.7099,198.5666,194.4887,196.5277,197.2866\n7/21/2014 12:00:00 AM,197.09,197.5,196.43,197.34,198.6629,194.51,196.5864,197.09\n7/22/2014 12:00:00 AM,198.01,198.56,197.87,198.2,198.8343,194.5779,196.7061,198.21\n7/23/2014 12:00:00 AM,198.495,198.85,198.1,198.64,198.9042,194.8383,196.8713,198.53\n7/24/2014 12:00:00 AM,198.83,199.06,198.45,198.65,199.0109,195.0832,197.0471,198.72\n7/25/2014 12:00:00 AM,198.09,198.26,197.33,197.72,199.1326,195.2319,197.1823,197.77\n7/28/2014 12:00:00 AM,197.76,198.09,196.62,197.8,199.267,195.295,197.281,197.5033\n7/29/2014 12:00:00 AM,198.17,198.45,196.92,196.95,199.4159,195.3096,197.3627,197.44\n7/30/2014 12:00:00 AM,197.65,197.91,196.16,196.98,199.4082,195.326,197.3671,197.0167\n7/31/2014 12:00:00 AM,195.61,195.78,192.97,193.09,199.5061,194.9004,197.2032,193.9467\n8/1/2014 12:00:00 AM,192.56,193.76,191.57,192.5,199.3192,194.544,196.9316,192.61\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,199.2066,194.2409,196.7238,193.4133\n8/5/2014 12:00:00 AM,193.1,193.6,191.31,192.01,199.0639,193.9736,196.5188,192.3067\n8/6/2014 12:00:00 AM,191.11,192.89,191.08,192.07,198.8757,193.6723,196.274,192.0133\n8/7/2014 12:00:00 AM,192.935,193.13,190.55,191.03,198.6889,193.4074,196.0482,191.57\n8/8/2014 12:00:00 AM,191.46,193.37,190.95,193.24,198.6047,193.1057,195.8552,192.52\n8/11/2014 12:00:00 AM,193.965,194.66,193.71,193.795,198.4385,192.914,195.6763,194.055\n8/12/2014 12:00:00 AM,193.61,194.15,192.94,193.53,198.2142,192.7693,195.4917,193.54\n8/13/2014 12:00:00 AM,194.29,195.06,193.96,194.84,198.0887,192.5688,195.3288,194.62\n8/14/2014 12:00:00 AM,195.16,195.76,194.98,195.76,197.9118,192.6543,195.2831,195.5\n8/15/2014 12:00:00 AM,196.47,196.65,194.31,195.72,197.836,192.5575,195.1967,195.56\n8/18/2014 12:00:00 AM,196.8,197.45,196.69,197.36,197.8736,192.5276,195.2006,197.1667\n8/19/2014 12:00:00 AM,197.84,198.54,197.4426,198.39,197.8663,192.5263,195.1963,198.1242\n8/20/2014 12:00:00 AM,198.12,199.16,198.08,198.92,197.9005,192.511,195.2058,198.72\n8/21/2014 12:00:00 AM,199.09,199.76,198.93,199.5,197.9516,192.5276,195.2396,199.3967\n8/22/2014 12:00:00 AM,199.34,199.69,198.74,199.19,197.9957,192.6272,195.3115,199.2067\n8/25/2014 12:00:00 AM,200.14,200.5949,199.1502,200.2,198.1177,192.753,195.4354,199.9817\n8/26/2014 12:00:00 AM,200.33,200.82,200.28,200.33,198.2013,192.9731,195.5872,200.4767\n8/27/2014 12:00:00 AM,200.43,200.57,199.94,200.25,198.2792,193.2189,195.7491,200.2533\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,198.3437,193.753,196.0484,199.9333\n8/29/2014 12:00:00 AM,200.45,200.73,199.82,200.71,198.6382,194.2395,196.4389,200.42\n9/2/2014 12:00:00 AM,200.97,200.995,199.86,200.61,198.9084,194.6769,196.7926,200.4883\n9/3/2014 12:00:00 AM,201.38,201.41,200.22,200.5,199.2243,195.2013,197.2128,200.71\n9/4/2014 12:00:00 AM,200.84,201.58,199.66,200.2101,199.656,195.6166,197.6363,200.4834\n9/5/2014 12:00:00 AM,200.17,201.19,199.41,201.11,200.046,196.1266,198.0863,200.57\n9/8/2014 12:00:00 AM,200.92,201.21,200,200.59,200.3593,196.6213,198.4903,200.6\n9/9/2014 12:00:00 AM,200.41,200.55,198.91,199.32,200.6557,196.8787,198.7672,199.5933\n9/10/2014 12:00:00 AM,199.43,200.2,198.77,200.07,200.9792,197.1693,199.0742,199.68\n9/11/2014 12:00:00 AM,199.27,200.33,199.12,200.3,201.22,197.4581,199.3391,199.9167\n9/12/2014 12:00:00 AM,200.1,200.12,198.56,199.13,201.47,197.5851,199.5275,199.27\n9/15/2014 12:00:00 AM,199.16,199.32,198.38,198.981,201.5317,197.8568,199.6942,198.8937\n9/16/2014 12:00:00 AM,198.61,200.84,198.5,200.48,201.7161,197.9497,199.8329,199.94\n9/17/2014 12:00:00 AM,200.77,201.68,199.75,200.75,201.9025,198.0236,199.963,200.7267\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,202.0475,198.1655,200.1065,201.59\n9/19/2014 12:00:00 AM,201.52,201.899,200.29,200.7,202.1835,198.1862,200.1848,200.963\n9/22/2014 12:00:00 AM,200.35,200.38,198.73,199.15,202.2707,198.1204,200.1955,199.42\n9/23/2014 12:00:00 AM,198.43,199.26,197.95,198.01,202.1818,198.0517,200.1168,198.4067\n9/24/2014 12:00:00 AM,198.04,199.69,197.52,199.56,202.2204,197.8578,200.0391,198.9233\n9/25/2014 12:00:00 AM,199.04,199.05,196.27,196.34,202.2682,197.5066,199.8874,197.22\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,202.2378,197.3007,199.7693,197.57\n9/29/2014 12:00:00 AM,196.2,197.89,196.05,197.54,202.1453,197.0672,199.6063,197.16\n9/30/2014 12:00:00 AM,197.69,198.3,196.61,197.02,202.028,196.8667,199.4473,197.31\n10/1/2014 12:00:00 AM,196.7,196.77,193.91,194.35,201.887,196.4377,199.1623,195.01\n10/2/2014 12:00:00 AM,194.18,195.055,192.35,194.38,201.6181,196.051,198.8346,193.9283\n10/3/2014 12:00:00 AM,195.68,196.94,195.08,196.52,201.4571,195.773,198.6151,196.18\n10/6/2014 12:00:00 AM,197.34,197.6,195.582,196.29,201.3123,195.507,198.4096,196.4907\n10/7/2014 12:00:00 AM,195.28,195.72,193.22,193.26,201.1402,195.1264,198.1333,194.0667\n10/8/2014 12:00:00 AM,193.37,196.92,192.36,196.64,201.1563,194.673,197.9146,195.3067\n10/9/2014 12:00:00 AM,196.33,196.6,192.58,192.74,201.0728,194.162,197.6174,193.9733\n10/10/2014 12:00:00 AM,192.69,193.65,190.49,190.54,200.7938,193.6701,197.2319,191.56\n10/13/2014 12:00:00 AM,190.46,191.15,187.3,187.4099,200.4984,192.9381,196.7183,188.62\n10/14/2014 12:00:00 AM,188.42,189.82,187.04,187.7,199.9437,192.3175,196.1306,188.1867\n10/15/2014 12:00:00 AM,185.16,187.694,181.92,186.43,199.4636,191.2598,195.3617,185.348\n10/16/2014 12:00:00 AM,183.06,187.58,182.89,186.27,198.9323,190.19,194.5612,185.58\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,198.4552,189.4322,193.9437,188.6133\n10/20/2014 12:00:00 AM,188.13,190.45,188.07,190.3,197.9952,188.9108,193.453,189.6067\n10/21/2014 12:00:00 AM,191.68,194.2,191.48,194.07,197.9316,188.4587,193.1952,193.25\n10/22/2014 12:00:00 AM,194.41,194.91,192.61,192.69,197.6654,188.173,192.9192,193.4033\n10/23/2014 12:00:00 AM,194.62,196.2,194.26,194.93,197.5774,188.052,192.8147,195.13\n10/24/2014 12:00:00 AM,195.25,196.49,194.49,196.43,197.4853,187.9674,192.7263,195.8033\n10/27/2014 12:00:00 AM,195.73,196.45,195.03,196.16,197.3891,187.9356,192.6624,195.88\n10/28/2014 12:00:00 AM,196.82,198.42,196.73,198.41,197.459,187.92,192.6895,197.8533\n10/29/2014 12:00:00 AM,198.55,199.12,196.8,198.11,197.5497,188.1293,192.8395,198.01\n10/30/2014 12:00:00 AM,197.58,199.95,197.4,199.38,197.7872,188.39,193.0886,198.91\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,198.04,188.6608,193.3504,201.4167\n11/3/2014 12:00:00 AM,201.92,202.45,201.305,201.77,198.2421,188.9939,193.618,201.8417\n11/4/2014 12:00:00 AM,201.23,201.6,200.06,201.07,198.4823,189.438,193.9601,200.91\n11/5/2014 12:00:00 AM,202.54,202.59,201.45,202.34,198.5953,190.007,194.3011,202.1267\n11/6/2014 12:00:00 AM,202.39,203.26,201.64,203.15,198.8478,190.6255,194.7366,202.6833\n11/7/2014 12:00:00 AM,203.17,203.5999,202.61,203.34,199.2662,191.3694,195.3178,203.1833\n11/10/2014 12:00:00 AM,203.38,204.04,203.13,203.98,199.8005,192.3448,196.0726,203.7167\n11/11/2014 12:00:00 AM,204.055,204.31,203.65,204.175,200.4344,193.2967,196.8656,204.045\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,200.9951,194.5849,197.79,203.8367\n11/13/2014 12:00:00 AM,204.16,204.83,203.21,204.19,201.6897,195.74,198.7148,204.0767\n11/14/2014 12:00:00 AM,204.1,204.49,203.72,204.24,202.2633,196.72,199.4917,204.15\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,202.8842,197.5585,200.2213,204.2\n11/18/2014 12:00:00 AM,204.44,205.92,204.44,205.55,203.3106,198.3374,200.824,205.3033\n11/19/2014 12:00:00 AM,205.31,205.55,204.3,205.22,203.8129,198.9971,201.405,205.0233\n11/20/2014 12:00:00 AM,204.26,205.71,204.18,205.58,204.1657,199.647,201.9063,205.1567\n11/21/2014 12:00:00 AM,207.64,207.8445,205.98,206.68,204.7371,200.1787,202.4579,206.8348\n11/24/2014 12:00:00 AM,207.17,207.39,206.91,207.26,205.2492,200.7973,203.0232,207.1867\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,205.6229,201.3615,203.4922,207.2333\n11/26/2014 12:00:00 AM,207.29,207.76,207.03,207.64,205.977,201.9541,203.9656,207.4767\n11/28/2014 12:00:00 AM,207.49,207.87,206.91,207.2,206.2786,202.4942,204.3864,207.3267\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,206.4559,202.7645,204.6102,205.8933\n12/2/2014 12:00:00 AM,205.81,207.34,205.782,207.085,206.7333,202.9766,204.8549,206.7357\n12/3/2014 12:00:00 AM,207.3,208.15,207.1,207.89,207.0251,203.3651,205.1951,207.7133\n12/4/2014 12:00:00 AM,207.54,208.265,206.7,207.66,207.2992,203.6325,205.4659,207.5417\n12/5/2014 12:00:00 AM,207.87,208.47,207.55,208,207.5128,203.9512,205.732,208.0067\n12/8/2014 12:00:00 AM,207.52,208.12,205.93,206.61,207.788,204.0464,205.9172,206.8867\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,208.0194,204.0093,206.0144,205.66\n12/10/2014 12:00:00 AM,205.91,205.98,202.93,203.1601,208.2344,203.7922,206.0133,204.0234\n12/11/2014 12:00:00 AM,203.88,206.19,203.71,204.19,208.4349,203.6777,206.0563,204.6967\n12/12/2014 12:00:00 AM,202.64,203.819,200.85,200.89,208.4527,203.4375,205.9451,201.853\n12/15/2014 12:00:00 AM,201.98,202.53,198.78,199.51,208.4823,203.0202,205.7513,200.2733\n12/16/2014 12:00:00 AM,198.58,202.395,197.86,197.91,208.5121,202.5092,205.5107,199.3883\n12/17/2014 12:00:00 AM,198.44,202.34,198.29,201.79,208.5033,202.0684,205.2858,200.8067\n12/18/2014 12:00:00 AM,204.74,212.97,203.92,206.78,209.3914,201.467,205.4292,207.89\n12/19/2014 12:00:00 AM,206.43,207.33,205.6109,206.52,209.4721,201.5193,205.4957,206.487\n12/22/2014 12:00:00 AM,206.75,207.47,206.46,207.47,209.3929,201.6283,205.5106,207.1333\n12/23/2014 12:00:00 AM,208.17,208.23,207.3991,207.75,209.4323,201.6496,205.5409,207.793\n12/24/2014 12:00:00 AM,208.02,208.34,207.72,207.77,209.44,201.7128,205.5764,207.9433\n12/26/2014 12:00:00 AM,208.31,208.85,208.25,208.44,209.5181,201.7384,205.6283,208.5133\n12/29/2014 12:00:00 AM,208.22,208.97,208.14,208.72,209.5725,201.8123,205.6924,208.61\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,209.6235,201.9547,205.7891,207.8267\n12/31/2014 12:00:00 AM,207.99,208.19,205.39,205.54,209.6969,201.8451,205.771,206.3733\n1/2/2015 12:00:00 AM,206.38,206.88,204.18,205.43,209.7086,201.6117,205.6602,205.4967\n1/5/2015 12:00:00 AM,204.17,204.37,201.35,201.72,209.6442,201.17,205.4071,202.48\n1/6/2015 12:00:00 AM,202.09,202.72,198.855,199.82,209.488,200.572,205.03,200.465\n1/7/2015 12:00:00 AM,201.42,202.72,200.88,202.31,209.2954,200.2729,204.7841,201.97\n1/8/2015 12:00:00 AM,204.01,206.16,203.99,205.9,209.3661,200.1712,204.7686,205.35\n1/9/2015 12:00:00 AM,206.4,206.42,203.51,204.25,209.3541,200.2536,204.8038,204.7267\n1/12/2015 12:00:00 AM,204.41,204.6,201.92,202.65,209.2458,200.1978,204.7218,203.0567\n1/13/2015 12:00:00 AM,204.12,205.48,200.51,202.08,209.4099,200.1174,204.7637,202.69\n1/14/2015 12:00:00 AM,199.65,201.1,198.57,200.86,209.3871,200.1306,204.7588,200.1767\n1/15/2015 12:00:00 AM,201.63,202.01,198.88,199.0199,209.3108,200.265,204.7879,199.97\n1/16/2015 12:00:00 AM,198.77,201.82,198.55,201.63,209.2168,200.345,204.7809,200.6667\n1/20/2015 12:00:00 AM,202.4,202.72,200.17,202.055,208.2574,200.6802,204.4688,201.6483\n1/21/2015 12:00:00 AM,201.5,203.66,200.94,203.08,208.1362,200.4088,204.2725,202.56\n1/22/2015 12:00:00 AM,203.99,206.26,202.33,206.1,208.2433,200.078,204.1606,204.8967\n1/23/2015 12:00:00 AM,205.79,206.1,204.81,204.97,208.1528,199.9185,204.0357,205.2933\n1/26/2015 12:00:00 AM,204.71,205.56,203.85,205.45,208.0851,199.6873,203.8862,204.9533\n1/27/2015 12:00:00 AM,202.97,204.12,201.74,202.74,208,199.2077,203.6038,202.8667\n1/28/2015 12:00:00 AM,204.17,204.29,199.91,200.14,207.908,198.5833,203.2457,201.4467\n1/29/2015 12:00:00 AM,200.38,202.3,198.68,201.9902,207.747,198.0607,202.9038,200.9901\n1/30/2015 12:00:00 AM,200.57,202.17,199.13,199.45,207.4588,197.7365,202.5977,200.25\n2/2/2015 12:00:00 AM,200.05,202.03,197.86,201.92,207.3244,197.3816,202.353,200.6033\n2/3/2015 12:00:00 AM,203,204.85,202.55,204.84,207.3181,197.5479,202.433,204.08\n2/4/2015 12:00:00 AM,203.92,205.38,203.51,204.06,207.3611,197.8901,202.6256,204.3167\n2/5/2015 12:00:00 AM,204.86,206.3,204.77,206.12,207.4996,198.1276,202.8136,205.73\n2/6/2015 12:00:00 AM,206.56,207.24,204.92,205.55,207.4125,198.27,202.8412,205.9033\n2/9/2015 12:00:00 AM,204.77,205.64,204.135,204.63,207.3109,198.3791,202.845,204.8017\n2/10/2015 12:00:00 AM,205.88,207.12,204.6801,206.81,207.454,198.5507,203.0023,206.2034\n2/11/2015 12:00:00 AM,206.61,207.45,205.83,206.93,207.405,199.0043,203.2047,206.7367\n2/12/2015 12:00:00 AM,207.89,208.99,206.9727,208.92,207.7022,199.5189,203.6105,208.2942\n2/13/2015 12:00:00 AM,209.07,209.84,208.76,209.78,208.0229,200.1472,204.0851,209.46\n2/17/2015 12:00:00 AM,209.4,210.32,209.1,210.11,208.328,200.7598,204.5439,209.8433\n2/18/2015 12:00:00 AM,209.66,210.22,209.3401,210.13,208.6152,201.2974,204.9563,209.8967\n2/19/2015 12:00:00 AM,209.41,210.42,209.24,209.98,208.8657,201.7789,205.3223,209.88\n2/20/2015 12:00:00 AM,209.48,211.33,208.73,211.239,209.0427,202.1555,205.5991,210.433\n2/23/2015 12:00:00 AM,210.94,211.21,210.48,211.209,209.2866,202.479,205.8828,210.9663\n2/24/2015 12:00:00 AM,211.12,212.05,210.76,211.81,209.5844,202.8398,206.2121,211.54\n2/25/2015 12:00:00 AM,211.66,212.24,211.22,211.63,209.8241,203.483,206.6536,211.6967\n2/26/2015 12:00:00 AM,211.52,211.71,210.65,211.38,210.0652,204.222,207.1436,211.2467\n2/27/2015 12:00:00 AM,211.26,211.58,210.6,210.66,210.365,204.9179,207.6414,210.9467\n3/2/2015 12:00:00 AM,210.78,212.06,210.72,211.99,210.809,205.6079,208.2084,211.59\n3/3/2015 12:00:00 AM,211.47,212.054,210.08,211.12,211.1684,206.2966,208.7325,211.0847\n3/4/2015 12:00:00 AM,210.4,210.49,209.06,210.2301,211.3954,206.6543,209.0248,209.9267\n3/5/2015 12:00:00 AM,210.62,210.8,209.85,210.46,211.6291,207.0259,209.3275,210.37\n3/6/2015 12:00:00 AM,209.42,209.94,207.1,207.5,211.8356,207.0644,209.45,208.18\n3/9/2015 12:00:00 AM,207.74,208.79,207.5459,208.36,211.8748,207.2581,209.5664,208.232\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,212.0577,207.1523,209.605,205.5733\n3/11/2015 12:00:00 AM,205.29,205.5,204.4,204.5,211.8833,207.1864,209.5349,204.8\n3/12/2015 12:00:00 AM,205.26,207.175,205.2,207.1,211.9502,207.095,209.5226,206.4917\n3/13/2015 12:00:00 AM,206.77,207.9338,204.58,205.8272,211.9382,206.8889,209.4136,206.1137\n3/16/2015 12:00:00 AM,206.71,208.69,205.8641,208.58,211.9845,206.6678,209.3261,207.7114\n3/17/2015 12:00:00 AM,207.69,208.42,206.98,207.96,211.9101,206.5365,209.2233,207.7867\n3/18/2015 12:00:00 AM,207.39,211.27,206.62,210.46,212.1706,206.2314,209.201,209.45\n3/19/2015 12:00:00 AM,209.96,210.4697,209.03,209.5,212.1794,206.2012,209.1903,209.6666\n3/20/2015 12:00:00 AM,209.71,211.02,209.4903,210.41,212.0928,206.2752,209.184,210.3068\n3/23/2015 12:00:00 AM,210.42,211.11,210,210,212.0893,206.219,209.1542,210.37\n3/24/2015 12:00:00 AM,209.85,210.4,208.74,208.82,212.006,206.0803,209.0432,209.32\n3/25/2015 12:00:00 AM,209.07,209.35,205.71,205.76,211.9647,205.646,208.8053,206.94\n3/26/2015 12:00:00 AM,204.96,206.37,204.12,205.27,211.7543,205.257,208.5057,205.2533\n3/27/2015 12:00:00 AM,205.13,205.95,204.9,205.74,211.4887,204.981,208.2348,205.53\n3/30/2015 12:00:00 AM,206.98,208.61,206.96,208.25,211.4165,204.6882,208.0523,207.94\n3/31/2015 12:00:00 AM,207.26,208.1,206.36,206.43,211.2041,204.4884,207.8463,206.9633\n4/1/2015 12:00:00 AM,206.39,206.42,204.51,205.7,210.9744,204.2798,207.6271,205.5433\n4/2/2015 12:00:00 AM,205.62,206.98,205.4,206.435,210.8168,204.0276,207.4222,206.2717\n4/6/2015 12:00:00 AM,205.37,208.45,205.21,207.83,210.7569,203.9858,207.3714,207.1633\n4/7/2015 12:00:00 AM,207.855,208.76,207.24,207.28,210.7506,203.9449,207.3477,207.76\n4/8/2015 12:00:00 AM,207.55,208.51,207.08,207.975,210.7147,204.209,207.4618,207.855\n4/9/2015 12:00:00 AM,207.78,209.18,207.19,208.9,210.9626,204.3234,207.643,208.4233\n4/10/2015 12:00:00 AM,209.2,210.09,208.96,210.04,211.0115,204.595,207.8033,209.6967\n4/13/2015 12:00:00 AM,209.87,210.63,209.03,209.09,211.0534,204.9001,207.9767,209.5833\n4/14/2015 12:00:00 AM,208.85,209.71,208.1,209.49,211.0289,205.0635,208.0462,209.1\n4/15/2015 12:00:00 AM,210.05,211.04,209.95,210.43,211.1595,205.2015,208.1805,210.4733\n4/16/2015 12:00:00 AM,210.03,210.98,209.7928,210.37,210.9463,205.5078,208.2271,210.3809\n4/17/2015 12:00:00 AM,208.94,209.23,207.01,207.95,211.0101,205.2836,208.1469,208.0633\n4/20/2015 12:00:00 AM,209.06,210.25,208.96,209.85,211.0369,205.1948,208.1159,209.6867\n4/21/2015 12:00:00 AM,210.67,210.86,209.24,209.6,211.0517,205.1331,208.0924,209.9\n4/22/2015 12:00:00 AM,210.01,210.85,208.9,210.63,211.1137,205.1517,208.1327,210.1267\n4/23/2015 12:00:00 AM,210.15,211.94,210.01,211.16,211.1903,205.4848,208.3375,211.0367\n4/24/2015 12:00:00 AM,211.66,211.97,211.11,211.6499,211.4023,205.9052,208.6537,211.5766\n4/27/2015 12:00:00 AM,212.33,212.48,210.54,210.77,211.7557,206.1251,208.9404,211.2633\n4/28/2015 12:00:00 AM,210.74,211.5,209.3301,211.44,211.844,206.3184,209.0812,210.7567\n4/29/2015 12:00:00 AM,210.32,211.29,209.6,210.57,212.0164,206.4984,209.2574,210.4867\n4/30/2015 12:00:00 AM,209.9,210.35,207.62,208.46,212.257,206.5844,209.4207,208.81\n5/1/2015 12:00:00 AM,209.41,210.77,209.28,210.72,212.511,206.7289,209.62,210.2567\n5/4/2015 12:00:00 AM,211.22,212.02,211.1,211.32,212.5813,207.0903,209.8358,211.48\n5/5/2015 12:00:00 AM,211.01,211.46,208.73,208.9,212.7689,207.0963,209.9326,209.6967\n5/6/2015 12:00:00 AM,209.54,209.93,206.76,208.04,212.9188,206.9853,209.952,208.2433\n5/7/2015 12:00:00 AM,207.91,209.38,207.52,208.87,212.9174,207.0034,209.9604,208.59\n5/8/2015 12:00:00 AM,210.84,211.86,210.78,211.62,213.1386,206.9545,210.0465,211.42\n5/11/2015 12:00:00 AM,211.54,211.89,210.52,210.6,213.1923,207.0428,210.1176,211.0033\n5/12/2015 12:00:00 AM,209.59,210.63,208.62,209.98,213.2545,207.0449,210.1497,209.7433\n5/13/2015 12:00:00 AM,210.49,211.22,209.74,210.02,213.2419,207.0428,210.1424,210.3267\n5/14/2015 12:00:00 AM,211.24,212.32,210.91,212.21,213.397,207.031,210.214,211.8133\n5/15/2015 12:00:00 AM,212.43,212.61,211.86,212.44,213.4132,207.4388,210.426,212.3033\n5/18/2015 12:00:00 AM,212.24,213.4,212.16,213.1,213.4937,207.6783,210.586,212.8867\n5/19/2015 12:00:00 AM,213.26,213.57,212.69,213.03,213.5981,207.8936,210.7458,213.0967\n5/20/2015 12:00:00 AM,213.16,213.78,212.5,212.88,213.6942,208.0902,210.8922,213.0533\n5/21/2015 12:00:00 AM,212.74,213.75,212.51,213.5,213.7533,208.2528,211.003,213.2533\n5/22/2015 12:00:00 AM,213.02,213.54,212.91,212.99,213.8145,208.3485,211.0815,213.1467\n5/26/2015 12:00:00 AM,212.39,212.91,210.2,210.7,213.8786,208.2851,211.0818,211.27\n5/27/2015 12:00:00 AM,211.23,212.98,210.76,212.7,213.9563,208.3463,211.1513,212.1467\n5/28/2015 12:00:00 AM,212.34,212.59,211.63,212.46,213.9856,208.4911,211.2383,212.2267\n5/29/2015 12:00:00 AM,212.4,212.43,210.82,211.14,214.02,208.722,211.371,211.4633\n6/1/2015 12:00:00 AM,211.95,212.34,210.62,211.57,214.0384,208.8289,211.4337,211.51\n6/2/2015 12:00:00 AM,211.02,212.19,210.27,211.36,214.0746,208.7721,211.4233,211.2733\n6/3/2015 12:00:00 AM,211.97,212.67,211.33,211.92,214.0842,208.9902,211.5372,211.9733\n6/4/2015 12:00:00 AM,211.12,211.86,209.75,210.13,214.126,209.182,211.654,210.58\n6/5/2015 12:00:00 AM,209.93,210.58,208.98,209.77,214.1658,209.2608,211.7133,209.7767\n6/8/2015 12:00:00 AM,209.63,209.82,208.39,208.48,213.9227,209.2517,211.5872,208.8967\n6/9/2015 12:00:00 AM,208.44,209.1,207.69,208.45,213.7962,209.1192,211.4577,208.4133\n6/10/2015 12:00:00 AM,209.38,211.41,209.3,210.95,213.9079,209.0884,211.4982,210.5533\n6/11/2015 12:00:00 AM,211.49,212.09,211.2,211.63,213.9481,209.1796,211.5638,211.64\n6/12/2015 12:00:00 AM,210.62,211.48,209.68,210.01,213.8507,209.1347,211.4927,210.39\n6/15/2015 12:00:00 AM,208.62,209.45,207.79,209.11,213.7849,208.8484,211.3167,208.7833\n6/16/2015 12:00:00 AM,208.9,210.35,208.72,210.25,213.6585,208.6635,211.161,209.7733\n6/17/2015 12:00:00 AM,210.58,211.32,209.36,210.59,213.6058,208.4488,211.0273,210.4233\n6/18/2015 12:00:00 AM,211.23,213.34,210.63,212.78,213.6759,208.2984,210.9872,212.25\n6/19/2015 12:00:00 AM,211.42,211.55,210.36,210.81,213.6471,208.0926,210.8698,210.9067\n6/22/2015 12:00:00 AM,211.95,212.59,211.64,211.89,213.678,207.951,210.8145,212.04\n6/23/2015 12:00:00 AM,212.18,212.44,211.57,212.05,213.5715,208.1325,210.852,212.02\n6/24/2015 12:00:00 AM,211.71,212.17,210.47,210.5,213.473,208.121,210.797,211.0467\n6/25/2015 12:00:00 AM,211.13,211.25,209.77,209.86,213.4071,207.9936,210.7003,210.2933\n6/26/2015 12:00:00 AM,210.28,210.58,209.16,209.82,213.3101,207.9296,210.6198,209.8533\n6/29/2015 12:00:00 AM,208.02,209.83,205.33,205.42,213.2861,207.4886,210.3873,206.86\n6/30/2015 12:00:00 AM,207.32,207.32,205.28,205.85,213.0389,207.2234,210.1312,206.15\n7/1/2015 12:00:00 AM,207.79,208.03,206.56,207.5,212.8714,206.9299,209.9007,207.3633\n7/2/2015 12:00:00 AM,208.07,208.27,206.81,207.31,212.6623,206.8273,209.7448,207.4633\n7/6/2015 12:00:00 AM,205.74,207.65,205.53,206.72,212.5442,206.6312,209.5877,206.6333\n7/7/2015 12:00:00 AM,206.93,208.17,204.11,208.02,212.6349,206.3274,209.4812,206.7667\n7/8/2015 12:00:00 AM,206.34,206.76,204.25,204.53,212.6503,205.9888,209.3195,205.18\n7/9/2015 12:00:00 AM,207.03,207.35,204.77,204.9,212.3958,205.7552,209.0755,205.6733\n7/10/2015 12:00:00 AM,207.28,207.98,204.95,207.48,212.2994,205.3679,208.8337,206.8033\n7/13/2015 12:00:00 AM,209,209.9,208.94,209.77,212.292,205.29,208.791,209.5367\n7/14/2015 12:00:00 AM,209.69,211.05,209.65,210.68,212.3143,205.4353,208.8748,210.46\n7/15/2015 12:00:00 AM,210.71,211.28,210.04,210.61,212.3286,205.5081,208.9183,210.6433\n7/16/2015 12:00:00 AM,211.82,212.3,211.58,212.3,212.3902,205.6102,209.0002,212.06\n7/17/2015 12:00:00 AM,212.34,212.55,211.8,212.48,212.2415,205.7615,209.0015,212.2767\n7/20/2015 12:00:00 AM,212.77,213.18,212.21,212.59,212.2204,205.9579,209.0892,212.66\n7/21/2015 12:00:00 AM,212.45,212.74,211.39,211.75,212.1842,205.9862,209.0852,211.96\n7/22/2015 12:00:00 AM,210.91,211.77,210.89,211.37,212.1511,205.9516,209.0513,211.3433\n7/23/2015 12:00:00 AM,211.54,211.65,209.75,210.18,212.1401,205.9106,209.0253,210.5267\n7/24/2015 12:00:00 AM,210.25,210.37,207.6,208,212.155,205.732,208.9435,208.6567\n7/27/2015 12:00:00 AM,206.98,207.55,206.26,206.79,212.0297,205.5587,208.7942,206.8667\n7/28/2015 12:00:00 AM,207.8,209.5,206.8,209.33,211.9796,205.7771,208.8783,208.5433\n7/29/2015 12:00:00 AM,209.44,211.04,209.31,210.77,212.1675,206.0115,209.0895,210.3733\n7/30/2015 12:00:00 AM,210.2,211.02,209.42,210.82,212.2768,206.2078,209.2423,210.42\n7/31/2015 12:00:00 AM,211.44,211.45,210.16,210.5,212.4261,206.3826,209.4043,210.7033\n8/3/2015 12:00:00 AM,210.53,210.53,208.65,209.79,212.5592,206.5517,209.5555,209.6567\n8/4/2015 12:00:00 AM,209.7,210.25,208.8,209.38,212.499,206.883,209.691,209.4767\n8/5/2015 12:00:00 AM,210.4,211.31,209.73,210.07,212.6205,207.2805,209.9505,210.37\n8/6/2015 12:00:00 AM,210.27,210.41,207.65,208.35,212.7725,207.4415,210.107,208.8033\n8/7/2015 12:00:00 AM,208.16,208.34,206.87,207.95,212.6983,207.6073,210.1528,207.72\n8/10/2015 12:00:00 AM,209.29,210.67,209.28,210.57,212.7527,207.6167,210.1847,210.1733\n8/11/2015 12:00:00 AM,208.96,209.47,207.76,208.67,212.7671,207.4196,210.0933,208.6333\n8/12/2015 12:00:00 AM,207.14,209.14,205.36,208.92,212.8158,207.0872,209.9515,207.8067\n8/13/2015 12:00:00 AM,208.75,209.55,208.01,208.66,212.6385,206.9325,209.7855,208.74\n8/14/2015 12:00:00 AM,208.43,209.51,208.26,209.42,212.5153,206.7343,209.6248,209.0633\n8/17/2015 12:00:00 AM,208.73,210.59,208.16,210.59,212.4808,206.4808,209.4808,209.78\n8/18/2015 12:00:00 AM,210.29,210.68,209.7,209.98,212.3611,206.4166,209.3888,210.12\n8/19/2015 12:00:00 AM,209.1,210.01,207.35,208.32,212.3554,206.1439,209.2497,208.56\n8/20/2015 12:00:00 AM,206.54,208.29,203.9,203.97,212.2874,205.6979,208.9927,205.3867\n8/21/2015 12:00:00 AM,201.81,203.94,197.52,197.63,212.1154,204.9739,208.5447,199.6967\n8/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,212.2743,203.1093,207.6918,189.81\n8/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,211.7777,201.7397,206.7587,189.88\n8/26/2015 12:00:00 AM,192.21,194.79,188.37,194.68,211.3239,200.4174,205.8707,192.6133\n8/27/2015 12:00:00 AM,197.05,199.42,195.21,199.27,210.9368,199.5592,205.248,197.9667\n8/28/2015 12:00:00 AM,198.5,199.84,197.92,199.28,210.3995,198.9275,204.6635,199.0133\n8/31/2015 12:00:00 AM,198.14,199.13,197.01,197.67,209.8428,198.3122,204.0775,197.9367\n9/1/2015 12:00:00 AM,193.07,194.77,190.73,191.77,209.4018,197.0478,203.2248,192.4233\n9/2/2015 12:00:00 AM,194.69,195.46,192.42,195.41,208.7368,196.1188,202.4278,194.43\n9/3/2015 12:00:00 AM,196.25,198.05,194.96,195.55,208.1308,195.4632,201.797,196.1867\n9/4/2015 12:00:00 AM,192.88,193.86,191.61,192.59,207.5636,194.5271,201.0453,192.6867\n9/8/2015 12:00:00 AM,195.97,197.61,195.17,197.43,207.0643,193.6828,200.3735,196.7367\n9/9/2015 12:00:00 AM,199.32,199.47,194.35,194.79,206.616,192.888,199.752,196.2033\n9/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,205.9536,192.3471,199.1503,195.7733\n9/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,205.3743,191.6553,198.5148,196.03\n9/14/2015 4:00:00 PM,196.95,197.01,195.43,196.03,204.7538,190.9853,197.8695,196.1567"
  },
  {
    "path": "Tests/TestData/spy_with_kst.csv",
    "content": "Date,Close,kst,signal\n02/22/2013 12:00:00 AM,151.89,,\n02/25/2013 12:00:00 AM,149.0,,\n02/26/2013 12:00:00 AM,150.02,,\n02/27/2013 12:00:00 AM,151.91,,\n02/28/2013 12:00:00 AM,151.61,,\n03/01/2013 12:00:00 AM,152.11,,\n03/04/2013 12:00:00 AM,152.92,,\n03/05/2013 12:00:00 AM,154.29,,\n03/06/2013 12:00:00 AM,154.5,,\n03/07/2013 12:00:00 AM,154.78,,\n03/08/2013 12:00:00 AM,155.44,,\n03/11/2013 12:00:00 AM,156.03,,\n03/12/2013 12:00:00 AM,155.68,,\n03/13/2013 12:00:00 AM,155.9,,\n03/14/2013 12:00:00 AM,156.73,,\n03/15/2013 12:00:00 AM,155.83,,\n03/18/2013 12:00:00 AM,154.97,,\n03/19/2013 12:00:00 AM,154.61,,\n03/20/2013 12:00:00 AM,155.69,,\n03/21/2013 12:00:00 AM,154.36,,\n03/22/2013 12:00:00 AM,155.6,,\n03/25/2013 12:00:00 AM,154.95,,\n03/26/2013 12:00:00 AM,156.19,,\n03/27/2013 12:00:00 AM,156.19,,\n03/28/2013 12:00:00 AM,156.67,,\n04/01/2013 12:00:00 AM,156.05,,\n04/02/2013 12:00:00 AM,156.82,,\n04/03/2013 12:00:00 AM,155.23,,\n04/04/2013 12:00:00 AM,155.86,,\n04/05/2013 12:00:00 AM,155.16,,\n04/08/2013 12:00:00 AM,156.21,,\n04/09/2013 12:00:00 AM,156.75,,\n04/10/2013 12:00:00 AM,158.67,,\n04/11/2013 12:00:00 AM,159.19,,\n04/12/2013 12:00:00 AM,158.8,21.435098761368376,\n04/15/2013 12:00:00 AM,155.12,19.37055950450582,\n04/16/2013 12:00:00 AM,157.41,17.66737141027742,\n04/17/2013 12:00:00 AM,155.11,12.583323348411287,\n04/18/2013 12:00:00 AM,154.14,6.68384034380711,\n04/19/2013 12:00:00 AM,155.48,1.8979841609659647,\n04/22/2013 12:00:00 AM,156.17,1.6413979699559396,\n04/23/2013 12:00:00 AM,157.78,0.8547517348672637,\n04/24/2013 12:00:00 AM,157.88,2.6420555187129158,9.419598083652456\n04/25/2013 12:00:00 AM,158.52,5.442246195273139,7.64261446519743\n04/26/2013 12:00:00 AM,158.24,7.605169888535372,6.335348952311825\n04/29/2013 12:00:00 AM,159.3,11.132982353178418,5.609305723745269\n04/30/2013 12:00:00 AM,159.68,13.262303620021505,5.684747976146404\n05/01/2013 12:00:00 AM,158.28,13.482386343133232,6.440141976071529\n05/02/2013 12:00:00 AM,159.75,15.243783215418286,7.923008537677342\n05/03/2013 12:00:00 AM,161.37,18.239719186211758,9.767266450594654\n05/06/2013 12:00:00 AM,161.78,21.27994838112697,12.03673274462351\n05/07/2013 12:00:00 AM,162.6,23.655697502638866,14.371581853948616\n05/08/2013 12:00:00 AM,163.34,29.385069784465042,17.03189558608105\n05/09/2013 12:00:00 AM,162.88,33.531668263212694,19.912617627711864\n05/10/2013 12:00:00 AM,163.41,36.391032854398716,22.719067683403008\n05/13/2013 12:00:00 AM,163.54,37.106275554739675,25.368397898371693\n05/14/2013 12:00:00 AM,165.23,39.0300649558467,28.207028855339857\n05/15/2013 12:00:00 AM,166.12,40.61986719866107,31.026593742366835\n05/16/2013 12:00:00 AM,165.34,40.64246702024302,33.51578794614809\n05/17/2013 12:00:00 AM,166.94,41.98446568602582,35.81628986891462\n05/20/2013 12:00:00 AM,166.93,44.00905744799584,38.07777430728762\n05/21/2013 12:00:00 AM,167.17,44.64150478550624,39.77293375184775\n05/22/2013 12:00:00 AM,165.93,43.400103898799784,40.86942660024632\n05/23/2013 12:00:00 AM,165.45,43.035644075574176,41.607716735932485\n05/24/2013 12:00:00 AM,165.31,40.06100757655368,41.93602029391182\n05/28/2013 12:00:00 AM,166.3,38.49285497139505,41.87633029563941\n05/29/2013 12:00:00 AM,165.22,34.77270941377776,41.22664609731905\n05/30/2013 12:00:00 AM,165.83,32.23025084916809,40.291955411644054\n05/31/2013 12:00:00 AM,163.45,28.654610260494962,38.810860364362846\n06/03/2013 12:00:00 AM,164.35,26.0223738708362,36.812339966900666\n06/04/2013 12:00:00 AM,163.56,20.641024025474618,34.145619882452706\n06/05/2013 12:00:00 AM,161.27,14.500217458594442,30.934521389096556\n06/06/2013 12:00:00 AM,162.73,9.632052119553459,27.22301117176092\n06/07/2013 12:00:00 AM,164.8,8.26264879860837,23.689860196433663\n06/10/2013 12:00:00 AM,164.8,6.137727768494544,20.094846062778053\n06/11/2013 12:00:00 AM,163.1,2.796633155230884,16.54194870071729\n06/12/2013 12:00:00 AM,161.75,1.30335325266023,13.105626745549749\n06/13/2013 12:00:00 AM,164.21,1.0411061222248428,10.03745961907529\n06/14/2013 12:00:00 AM,163.18,-1.0271948119694283,7.031951987652443\n06/17/2013 12:00:00 AM,164.44,-1.8193309163848088,4.536356994112506\n06/18/2013 12:00:00 AM,165.74,0.5064715823992518,2.981496341201929\n06/19/2013 12:00:00 AM,163.45,2.5112798546406387,2.190299422878282\n06/20/2013 12:00:00 AM,159.4,-3.131450530565198,0.9242883863034415\n06/21/2013 12:00:00 AM,159.07,-8.329260013811322,-0.6831547006194325\n06/24/2013 12:00:00 AM,157.06,-16.646868356547028,-2.843543757483645\n06/25/2013 12:00:00 AM,158.57,-23.437999694234918,-5.592582973805328\n06/26/2013 12:00:00 AM,160.14,-26.24272241555217,-8.624119478002774\n06/27/2013 12:00:00 AM,161.08,-25.054112331584086,-11.29377698018218\n06/28/2013 12:00:00 AM,160.42,-24.942994622844576,-13.863072947566598\n07/01/2013 12:00:00 AM,161.36,-22.167350435044746,-16.382386505060374\n07/02/2013 12:00:00 AM,161.21,-21.578613820166318,-19.059041357816703\n07/03/2013 12:00:00 AM,161.28,-21.441020881352827,-21.09343806345977\n07/05/2013 12:00:00 AM,163.02,-18.626226950600067,-22.237545500880742\n07/08/2013 12:00:00 AM,163.95,-12.935163561246032,-21.82513385695841\n07/09/2013 12:00:00 AM,165.13,-6.14962482163861,-19.90420331555882\n07/10/2013 12:00:00 AM,165.19,-0.3275940198066527,-17.02474460492043\n07/11/2013 12:00:00 AM,167.44,7.499857257539,-13.407636872795642\n07/12/2013 12:00:00 AM,167.51,14.32977821342864,-9.043995446543061\n07/15/2013 12:00:00 AM,168.15,20.273311051348724,-4.328366392499342\n07/16/2013 12:00:00 AM,167.52,24.92739242972129,0.8389676352659468\n07/17/2013 12:00:00 AM,167.95,30.932291042566796,6.658224515701461\n07/18/2013 12:00:00 AM,168.87,34.91908700225567,12.607703843796543\n07/19/2013 12:00:00 AM,169.17,36.32545008101404,18.081105359603217\n07/22/2013 12:00:00 AM,169.5,36.79832645376579,22.85309994575926\n07/23/2013 12:00:00 AM,169.14,35.997023389198084,26.889168546759787\n07/24/2013 12:00:00 AM,168.52,34.308485080973924,29.86790497158589\n07/25/2013 12:00:00 AM,168.93,32.0041158540554,31.831720264988864\n07/26/2013 12:00:00 AM,169.11,31.16159301590436,33.04152937216171\n07/29/2013 12:00:00 AM,168.59,29.527045792419273,33.55260196801704\n07/30/2013 12:00:00 AM,168.59,29.193281419219247,33.359378676533986\n07/31/2013 12:00:00 AM,168.71,28.448874788195717,32.6404662083051\n08/01/2013 12:00:00 AM,170.66,27.88945657084419,31.703133596064006\n08/02/2013 12:00:00 AM,170.95,28.386441053055286,30.76847966265173\n08/05/2013 12:00:00 AM,170.7,29.148529622014607,30.007535910742455\n08/06/2013 12:00:00 AM,169.73,29.698786835246217,29.49534721677271\n08/07/2013 12:00:00 AM,169.18,30.175109386725165,29.29212427595824\n08/08/2013 12:00:00 AM,169.8,29.600111210545613,29.118626297585045\n08/09/2013 12:00:00 AM,169.31,26.74128095554382,28.809096871265552\n08/12/2013 12:00:00 AM,169.11,23.961919009891346,28.22783438134023\n08/13/2013 12:00:00 AM,169.61,21.43894412165642,27.448953196169196\n08/14/2013 12:00:00 AM,168.74,19.122334246578493,26.47482849347301\n08/15/2013 12:00:00 AM,166.38,13.494067829311266,24.82012035750145\n08/16/2013 12:00:00 AM,165.83,7.964019030738028,22.46628584735961\n08/19/2013 12:00:00 AM,164.77,1.5353132365741686,19.337011003062717\n08/20/2013 12:00:00 AM,165.58,-3.9218412790199615,15.548460929091036\n08/21/2013 12:00:00 AM,164.56,-9.8038652849664,11.17024131847859\n08/22/2013 12:00:00 AM,166.06,-12.807623002972981,6.775918656421167\n08/23/2013 12:00:00 AM,166.62,-14.241089700362107,2.5311399108374495\n08/26/2013 12:00:00 AM,166.0,-15.301947770741162,-1.5511814105400603\n08/27/2013 12:00:00 AM,163.33,-19.251926880349593,-5.81498820242096\n08/28/2013 12:00:00 AM,163.91,-21.23507588353683,-9.673781948292971\n08/29/2013 12:00:00 AM,164.17,-22.320533282247133,-13.038732205291323\n08/30/2013 12:00:00 AM,163.65,-24.038973069399315,-15.88031957262171\n09/03/2013 12:00:00 AM,164.39,-23.95396685124847,-18.106111302869323\n09/04/2013 12:00:00 AM,165.75,-21.17741435337608,-19.369838977137064\n09/05/2013 12:00:00 AM,165.96,-18.327131417502407,-19.983117689862556\n09/06/2013 12:00:00 AM,166.04,-15.89565953074231,-20.166958782127022\n09/09/2013 12:00:00 AM,167.63,-11.801282169826372,-19.777995937580933\n09/10/2013 12:00:00 AM,168.87,-6.71366880774422,-18.384856151735892\n09/11/2013 12:00:00 AM,169.4,-1.0781360818747316,-16.145196173773435\n09/12/2013 12:00:00 AM,168.95,3.550683488230346,-13.27061653260927\n09/13/2013 12:00:00 AM,169.33,7.30169892050168,-9.788319644842494\n09/16/2013 12:00:00 AM,170.31,10.725666101086127,-5.935027094583093\n09/17/2013 12:00:00 AM,171.07,13.174656827745467,-2.1181302966806994\n09/18/2013 12:00:00 AM,173.05,17.111852508024125,1.8195345839333594\n09/19/2013 12:00:00 AM,172.76,20.855454083887054,5.902991652225511\n09/20/2013 12:00:00 AM,170.72,23.83215510760934,9.862262460829479\n09/23/2013 12:00:00 AM,169.93,25.128244867645833,13.400252869206152\n09/24/2013 12:00:00 AM,169.53,24.846445480955737,16.280761931742873\n09/25/2013 12:00:00 AM,169.04,20.639253140354,18.179491893089946\n09/26/2013 12:00:00 AM,169.69,17.77935296522456,19.343675675836934\n09/27/2013 12:00:00 AM,168.91,15.616936489909031,19.887150163483923\n09/30/2013 12:00:00 AM,168.01,12.277545858818295,19.78747116693646\n10/01/2013 12:00:00 AM,169.34,10.506509701645916,19.05354418844999\n10/02/2013 12:00:00 AM,169.18,9.529527526356365,17.795107904279913\n10/03/2013 12:00:00 AM,167.62,6.40725223698208,15.85900758532133\n10/04/2013 12:00:00 AM,168.89,5.200994213127966,13.644868623708232\n10/07/2013 12:00:00 AM,167.43,4.09396407868604,11.339037356789376\n10/08/2013 12:00:00 AM,165.48,0.09150061694642808,9.055953743077424\n10/09/2013 12:00:00 AM,165.6,-3.64494598722602,6.675476081694026\n10/10/2013 12:00:00 AM,169.17,-3.3962842052841182,4.5628960044503435\n10/11/2013 12:00:00 AM,170.26,-2.158847169851975,2.9588523345980913\n10/14/2013 12:00:00 AM,170.94,1.4429103217741508,1.951785736834562\n10/15/2013 12:00:00 AM,169.7,4.861997338198357,1.4331712714836722\n10/16/2013 12:00:00 AM,172.07,10.420252313997288,1.8790601689298065\n10/17/2013 12:00:00 AM,173.22,14.77360087225594,2.942683131055137\n10/18/2013 12:00:00 AM,174.39,18.232970318646135,4.513683824384037\n10/21/2013 12:00:00 AM,174.4,21.148174847486853,6.853314294444084\n10/22/2013 12:00:00 AM,175.41,26.466452443635564,10.199025231206482\n10/23/2013 12:00:00 AM,174.57,28.6826326787198,13.76334932942914\n10/24/2013 12:00:00 AM,175.15,29.73118106842518,17.306685800348824\n10/25/2013 12:00:00 AM,175.95,30.229424496582908,20.505187375327573\n10/28/2013 12:00:00 AM,176.23,31.171832714595418,23.428502417149467\n10/29/2013 12:00:00 AM,177.17,33.75392318165886,26.02113251355631\n10/30/2013 12:00:00 AM,176.29,35.52145359259733,28.32644948248313\n10/31/2013 12:00:00 AM,175.79,34.63071630466967,30.14842125870797\n11/01/2013 12:00:00 AM,176.21,33.68412080260306,31.54130414260977\n11/04/2013 12:00:00 AM,176.83,32.914938570224244,32.25780260111962\n11/05/2013 12:00:00 AM,176.27,29.754524503305554,32.37690169274026\n11/06/2013 12:00:00 AM,177.17,28.71498409110573,32.263990917482545\n11/07/2013 12:00:00 AM,174.93,27.335781645933185,31.942475045188132\n11/08/2013 12:00:00 AM,177.29,26.981018451078526,31.47682901590848\n11/11/2013 12:00:00 AM,177.32,26.47542057929178,30.668106504534357\n11/12/2013 12:00:00 AM,176.96,25.59137335877838,29.56476425633225\n11/13/2013 12:00:00 AM,178.38,26.40914246690039,28.651256052135665\n11/14/2013 12:00:00 AM,179.27,29.61454694671191,28.19908117925887\n11/15/2013 12:00:00 AM,180.05,31.342016711083545,28.02431208379879\n11/18/2013 12:00:00 AM,179.42,31.827866152991653,28.254683378208355\n11/19/2013 12:00:00 AM,179.03,33.319200987318666,28.766263033343126\n11/20/2013 12:00:00 AM,178.47,32.04309496758739,29.28929784686026\n11/21/2013 12:00:00 AM,179.91,31.76048045305017,29.820349180412666\n11/22/2013 12:00:00 AM,180.81,31.10732836554352,30.335005601107305\n11/25/2013 12:00:00 AM,180.63,30.435560643366912,30.873248632728252\n11/26/2013 12:00:00 AM,180.68,29.89849316433204,31.260954265776213\n11/27/2013 12:00:00 AM,181.12,29.515899342066223,31.24999342081558\n11/29/2013 12:00:00 AM,181.0,28.436558822712417,30.927164766552124\n12/02/2013 12:00:00 AM,180.53,25.90501287106204,30.269069957448835\n12/03/2013 12:00:00 AM,179.75,23.347097002927427,29.161058403627585\n12/04/2013 12:00:00 AM,179.73,20.19003242057498,27.84405145395954\n12/05/2013 12:00:00 AM,178.94,17.107439576979957,26.21593580106285\n12/06/2013 12:00:00 AM,180.94,14.926585838844934,24.418075520318563\n12/09/2013 12:00:00 AM,181.4,14.13677186769644,22.60709898968851\n12/10/2013 12:00:00 AM,180.75,13.37883000753217,20.77158086115519\n12/11/2013 12:00:00 AM,178.72,11.092403698567844,18.72452578965537\n12/12/2013 12:00:00 AM,178.13,8.890162940216936,16.55270402493365\n12/13/2013 12:00:00 AM,178.11,5.9482211576093285,14.335282723438905\n12/16/2013 12:00:00 AM,179.22,3.6074443968560272,12.141987989430971\n12/17/2013 12:00:00 AM,178.65,1.3910576448857066,10.053213014354386\n12/18/2013 12:00:00 AM,181.7,3.6453489509355292,8.557425167016117\n12/19/2013 12:00:00 AM,181.49,5.676475037009229,7.529635077923261\n12/20/2013 12:00:00 AM,181.56,7.2774668509017655,6.767490076057186\n12/23/2013 12:00:00 AM,182.53,8.991781143691966,6.2800402022971635\n12/24/2013 12:00:00 AM,182.93,12.045480607000112,6.385937636567416\n12/26/2013 12:00:00 AM,183.85,14.216006426891473,6.977698023975698\n12/27/2013 12:00:00 AM,183.85,17.326110137075453,8.241907910583045\n12/30/2013 12:00:00 AM,183.82,19.24450709985401,9.979359322027266\n12/31/2013 12:00:00 AM,184.69,20.929883147913237,12.150339933474768\n01/02/2014 12:00:00 AM,182.92,20.789214803764395,14.05521391712242\n01/03/2014 12:00:00 AM,182.88,18.995466253892545,15.535101830109456\n01/06/2014 12:00:00 AM,182.36,16.835503290269763,16.597105878928122\n01/07/2014 12:00:00 AM,183.48,16.58129103373709,17.4403847555998\n01/08/2014 12:00:00 AM,183.52,15.676927879084216,17.843878896942478\n01/09/2014 12:00:00 AM,183.64,15.994631367073058,18.04150389029599\n01/10/2014 12:00:00 AM,184.14,15.354956926933651,17.8224868669469\n01/13/2014 12:00:00 AM,181.68,12.823299890829794,17.109019399277543\n01/14/2014 12:00:00 AM,183.67,11.047849154670217,16.01101562225054\n01/15/2014 12:00:00 AM,184.66,10.19641823570347,14.834038225799326\n01/16/2014 12:00:00 AM,184.42,9.493272156905313,13.778238881689633\n01/17/2014 12:00:00 AM,183.63,9.13538671168446,12.922670372957933\n01/21/2014 12:00:00 AM,184.18,11.486097875923477,12.356537799867532\n01/22/2014 12:00:00 AM,184.3,12.046865883274025,11.953197578110844\n01/23/2014 12:00:00 AM,182.79,10.384363904465877,11.329834526710046\n01/24/2014 12:00:00 AM,178.89,5.714540578191299,10.258677154627563\n01/27/2014 12:00:00 AM,178.01,0.34242368575741544,8.871913131841744\n01/28/2014 12:00:00 AM,179.07,-3.7975537506542683,7.222423920139024\n01/29/2014 12:00:00 AM,177.35,-9.867792994160231,4.993067116820835\n01/30/2014 12:00:00 AM,179.23,-13.299225212780478,2.460567409077969\n01/31/2014 12:00:00 AM,178.18,-15.410540863139683,-0.2667578770136023\n02/03/2014 12:00:00 AM,174.17,-20.81478339916469,-3.855744685356732\n02/04/2014 12:00:00 AM,175.38,-26.20802991533531,-8.106288662979992\n02/05/2014 12:00:00 AM,175.17,-30.349405888028855,-12.632263084368295\n02/06/2014 12:00:00 AM,177.48,-33.429626989334,-16.98161503631555\n02/07/2014 12:00:00 AM,179.68,-32.172252113139876,-20.59435679174858\n02/10/2014 12:00:00 AM,180.01,-26.309732180851274,-23.09570995065936\n02/11/2014 12:00:00 AM,181.98,-20.769850324005112,-24.307049653975458\n02/12/2014 12:00:00 AM,182.07,-14.019233712071385,-24.387050598341116\n02/13/2014 12:00:00 AM,183.01,-8.178027686805148,-23.583438023192834\n02/14/2014 12:00:00 AM,184.02,-2.344764975934445,-21.53121375394503\n02/18/2014 12:00:00 AM,184.24,4.728352419936892,-18.093837938914785\n02/19/2014 12:00:00 AM,183.02,9.360501998033474,-13.681625951574526\n02/20/2014 12:00:00 AM,184.1,14.755819926561209,-8.327687405363948\n02/21/2014 12:00:00 AM,183.89,17.712416978379885,-2.7849463951950852\n02/24/2014 12:00:00 AM,184.91,18.53974563074462,2.198328917204458\n02/25/2014 12:00:00 AM,184.84,19.362639491832738,6.657494452297553\n02/26/2014 12:00:00 AM,184.85,20.48183468523376,10.49094649644257\n02/27/2014 12:00:00 AM,185.82,21.231947806263992,13.75872155122803\n02/28/2014 12:00:00 AM,186.29,22.964457546867074,16.570857387094865\n03/03/2014 12:00:00 AM,184.98,22.70220649721481,18.56795228457019\n03/04/2014 12:00:00 AM,187.58,23.561606514532908,20.14585278640346\n03/05/2014 12:00:00 AM,187.75,24.384791649515655,21.215738533398397\n03/06/2014 12:00:00 AM,188.18,25.22916945664836,22.050933253206004\n03/07/2014 12:00:00 AM,188.26,26.338243908738047,22.91743306187194\n03/10/2014 12:00:00 AM,188.16,28.883057520911816,23.97525728732517\n03/11/2014 12:00:00 AM,187.23,29.527662137339256,24.980349226448002\n03/12/2014 12:00:00 AM,187.28,30.71865110089703,26.034427370296118\n03/13/2014 12:00:00 AM,185.18,29.415909662616485,26.751255383157165\n03/14/2014 12:00:00 AM,184.66,26.903725439104818,27.218090821144944\n03/17/2014 12:00:00 AM,186.33,25.183858270226928,27.39834101622206\n03/18/2014 12:00:00 AM,187.66,24.258084747856532,27.384262471593267\n03/19/2014 12:00:00 AM,186.66,21.764597445686725,26.999310025930864\n03/20/2014 12:00:00 AM,187.75,21.483819993976738,26.459929590957387\n03/21/2014 12:00:00 AM,186.2,20.347080042139154,25.511487648871537\n03/24/2014 12:00:00 AM,185.43,17.323966382357302,24.155521453873543\n03/25/2014 12:00:00 AM,186.31,13.04897967974203,22.192224629300764\n03/26/2014 12:00:00 AM,184.97,8.909115200918905,19.913691911334368\n03/27/2014 12:00:00 AM,184.58,4.303153274499281,17.402517226378198\n03/28/2014 12:00:00 AM,185.49,2.553569684442407,14.888040716846584\n03/31/2014 12:00:00 AM,187.01,2.008116433580475,12.415822015260355\n04/01/2014 12:00:00 AM,188.25,2.453685088782271,10.270165086715416\n04/02/2014 12:00:00 AM,188.88,5.271035272021962,8.468744562053773\n04/03/2014 12:00:00 AM,188.63,7.987322683535415,7.09543818887558\n04/04/2014 12:00:00 AM,186.4,8.799452363518075,6.14826996456011\n04/07/2014 12:00:00 AM,184.34,7.243413533881176,5.50320705946446\n04/08/2014 12:00:00 AM,185.1,4.1913286098312135,4.979008549343606\n04/09/2014 12:00:00 AM,187.09,2.6205627866299004,4.792054050691452\n04/10/2014 12:00:00 AM,183.15,-2.6580305238882627,4.212987360876934\n04/11/2014 12:00:00 AM,181.51,-8.040921458556255,3.0964275950839637\n04/14/2014 12:00:00 AM,182.94,-10.271546213344584,1.6825130059587576\n04/15/2014 12:00:00 AM,184.2,-11.881184041617395,-0.22328914000117095\n04/16/2014 12:00:00 AM,186.12,-13.723291487707133,-2.635579603472565\n04/17/2014 12:00:00 AM,186.39,-11.238679145934821,-4.862038660078443\n04/21/2014 12:00:00 AM,187.04,-6.604485945902397,-6.400694157832173\n04/22/2014 12:00:00 AM,187.89,-2.7092584996345455,-7.167426058883924\n04/23/2014 12:00:00 AM,187.45,0.01786669770795779,-7.456614513208584\n04/24/2014 12:00:00 AM,187.83,0.7327804279286383,-7.079857740784484\n04/25/2014 12:00:00 AM,186.29,0.9544826545242078,-6.080368394886655\n04/28/2014 12:00:00 AM,186.88,2.607505960691678,-4.649362597771515\n04/29/2014 12:00:00 AM,187.75,4.770557848199592,-2.799169054458517\n04/30/2014 12:00:00 AM,188.31,7.266335633192114,-0.4669882632474893\n05/01/2014 12:00:00 AM,188.32,9.149565504329317,1.7983722534485258\n05/02/2014 12:00:00 AM,188.06,11.868542737197412,3.850930996015171\n05/05/2014 12:00:00 AM,188.42,13.408144332837464,5.641753532956505\n05/06/2014 12:00:00 AM,186.78,11.79713712254554,6.950561357938459\n05/07/2014 12:00:00 AM,187.88,10.983280979445905,8.0895058636626\n05/08/2014 12:00:00 AM,187.68,9.961965658635506,9.090337308563855\n05/09/2014 12:00:00 AM,187.96,8.827345994041,9.781430645602669\n05/12/2014 12:00:00 AM,189.79,8.315070607115853,10.175265396593364\n05/13/2014 12:00:00 AM,189.96,9.586677496418975,10.433081159174126\n05/14/2014 12:00:00 AM,189.06,9.568515063098134,10.47963111014844\n05/15/2014 12:00:00 AM,187.4,8.144755026054503,10.065876920021449\n05/16/2014 12:00:00 AM,188.05,8.181741477250565,9.485165491622904\n05/19/2014 12:00:00 AM,188.74,8.047217877991223,9.068507797783536\n05/20/2014 12:00:00 AM,187.55,7.479269841520111,8.679173226902892\n05/21/2014 12:00:00 AM,189.13,8.363006551451736,8.501511103882473\n05/22/2014 12:00:00 AM,189.59,10.770930863663379,8.71746497828496\n05/23/2014 12:00:00 AM,190.35,12.672383832636168,9.201610892231662\n05/27/2014 12:00:00 AM,191.52,13.994895484111208,9.691412890864132\n05/28/2014 12:00:00 AM,191.38,15.85625920405234,10.390051128747933\n05/29/2014 12:00:00 AM,192.37,17.992404078597694,11.484234356808287\n05/30/2014 12:00:00 AM,192.68,20.96497682599503,12.904593840002116\n06/02/2014 12:00:00 AM,192.9,22.706755005196484,14.533431298580478\n06/03/2014 12:00:00 AM,192.8,22.679911131079763,16.222391441864882\n06/04/2014 12:00:00 AM,193.19,23.058055866816495,17.855174699127634\n06/05/2014 12:00:00 AM,194.45,23.866860575542354,19.31027800044752\n06/06/2014 12:00:00 AM,195.38,25.62605072552404,20.749574321879507\n06/09/2014 12:00:00 AM,195.58,27.27865476262869,22.225547575048115\n06/10/2014 12:00:00 AM,195.6,29.222501303214337,23.710685586066113\n06/11/2014 12:00:00 AM,194.92,31.087253008865627,25.165668800540328\n06/12/2014 12:00:00 AM,193.54,29.739149054140224,26.140576825889795\n06/13/2014 12:00:00 AM,194.13,27.634023115834758,26.688051060405158\n06/16/2014 12:00:00 AM,194.29,25.180620634195677,26.96590767186248\n06/17/2014 12:00:00 AM,194.83,23.03175660914031,26.962985532120683\n06/18/2014 12:00:00 AM,196.26,22.225681286212456,26.780632277750694\n06/19/2014 12:00:00 AM,196.48,22.945905248740253,26.48283833588583\n06/20/2014 12:00:00 AM,195.94,22.97559883238312,26.00472101030299\n06/23/2014 12:00:00 AM,195.88,22.795318068050033,25.29058953972918\n06/24/2014 12:00:00 AM,194.7,21.54867214209031,24.230747221198587\n06/25/2014 12:00:00 AM,195.58,20.02339717583431,23.151219234720152\n06/26/2014 12:00:00 AM,195.44,18.741896075753,22.163205119155514\n06/27/2014 12:00:00 AM,195.82,17.836447985294857,21.34718593594431\n06/30/2014 12:00:00 AM,195.72,16.786884410695222,20.65331124722819\n07/01/2014 12:00:00 AM,197.03,17.611227835032324,20.140594197097062\n07/02/2014 12:00:00 AM,197.23,17.776399055201747,19.56620462003723\n07/03/2014 12:00:00 AM,198.2,18.903741903551623,19.113776072389285\n07/07/2014 12:00:00 AM,197.51,19.150283480459333,18.708772229323653\n07/08/2014 12:00:00 AM,196.24,18.585182037423913,18.379495551027386\n07/09/2014 12:00:00 AM,197.12,18.300206621595883,18.188029933889784\n07/10/2014 12:00:00 AM,196.34,16.25196003910119,17.911370374261804\n07/11/2014 12:00:00 AM,196.61,13.403207687490914,17.418788118950253\n07/14/2014 12:00:00 AM,197.6,11.88654828648408,16.874306327371237\n07/15/2014 12:00:00 AM,197.23,11.189733847815567,16.160806995458262\n07/16/2014 12:00:00 AM,197.96,10.588670281730623,15.362170465072582\n07/17/2014 12:00:00 AM,195.71,9.105884724548877,14.27351966740561\n07/18/2014 12:00:00 AM,197.71,9.346656166022383,13.184227743579282\n07/21/2014 12:00:00 AM,197.34,8.529327698110293,12.066910594766657\n07/22/2014 12:00:00 AM,198.2,9.076846532907002,11.042092807134559\n07/23/2014 12:00:00 AM,198.64,8.551570839649404,10.18649400719547\n07/24/2014 12:00:00 AM,198.65,9.922074354154173,9.799701414602499\n07/25/2014 12:00:00 AM,197.72,9.101823073568603,9.490287502056335\n07/28/2014 12:00:00 AM,197.8,8.797245492902928,9.224455462621597\n07/29/2014 12:00:00 AM,196.95,7.454305319190707,8.87619268900605\n07/30/2014 12:00:00 AM,196.98,6.164907734545016,8.54941746789451\n07/31/2014 12:00:00 AM,193.09,2.2020559271248263,7.755572996905894\n08/01/2014 12:00:00 AM,192.5,-2.179380424890627,6.56571653879468\n08/04/2014 12:00:00 AM,193.89,-5.631402925202839,4.931466599004698\n08/05/2014 12:00:00 AM,192.01,-10.567657687349628,2.8071078737825834\n08/06/2014 12:00:00 AM,192.07,-15.55579465155878,-0.023766460185522753\n08/07/2014 12:00:00 AM,191.03,-18.394383857190498,-3.0789005636032005\n08/08/2014 12:00:00 AM,193.24,-18.997469086046813,-6.167202183486506\n08/11/2014 12:00:00 AM,193.79,-19.809979656181326,-9.196567180750066\n08/12/2014 12:00:00 AM,193.53,-19.191969508121293,-12.013997985490766\n08/13/2014 12:00:00 AM,194.84,-17.81024196238416,-14.237586639880654\n08/14/2014 12:00:00 AM,195.76,-14.061216848951737,-15.557790686998555\n08/15/2014 12:00:00 AM,195.72,-11.13573773760418,-16.169383443932038\n08/18/2014 12:00:00 AM,197.36,-7.938648712666101,-15.877271335633868\n08/19/2014 12:00:00 AM,198.39,-2.7251382078606863,-14.451642841889635\n08/20/2014 12:00:00 AM,198.92,2.2060154229282354,-12.162709588543109\n08/21/2014 12:00:00 AM,199.5,8.210079263024074,-9.139648660868566\n08/22/2014 12:00:00 AM,199.19,12.863081184857705,-5.509308567419785\n08/25/2014 12:00:00 AM,200.2,16.80886336697176,-1.509216025742779\n08/26/2014 12:00:00 AM,200.33,19.721987658798056,2.661031709944134\n08/27/2014 12:00:00 AM,200.25,21.87225861488264,6.65364009481462\n08/28/2014 12:00:00 AM,200.14,21.963449434047604,10.331327558331486\n08/29/2014 12:00:00 AM,200.71,22.56984022551383,13.721159662573701\n09/02/2014 12:00:00 AM,200.61,22.43435765703105,16.51665920311723\n09/03/2014 12:00:00 AM,200.5,21.322490639643082,18.640712004974432\n09/04/2014 12:00:00 AM,200.21,19.893791144798058,19.93890221406043\n09/05/2014 12:00:00 AM,201.11,19.019614682499526,20.622961491576188\n09/08/2014 12:00:00 AM,200.59,18.671517447073157,20.829923056031898\n09/09/2014 12:00:00 AM,199.32,16.692245734156238,20.49328506440503\n09/10/2014 12:00:00 AM,200.07,15.75143719470935,19.813193795496886\n09/11/2014 12:00:00 AM,200.3,15.66734656628615,19.11362681019006\n09/12/2014 12:00:00 AM,199.13,14.49384387695676,18.216293882572607\n09/15/2014 12:00:00 AM,198.98,12.74641901474333,17.13985625565175\n09/16/2014 12:00:00 AM,200.48,13.442001849531838,16.264246390083834\n09/17/2014 12:00:00 AM,200.75,14.043642718982841,15.614229898326588\n09/18/2014 12:00:00 AM,201.82,15.329329976692998,15.204198264348085\n09/19/2014 12:00:00 AM,200.7,15.431392885913775,14.844184424219264\n09/22/2014 12:00:00 AM,199.15,14.28350380345337,14.576546431918946\n09/23/2014 12:00:00 AM,198.01,11.833698370328227,14.141242118098821\n09/24/2014 12:00:00 AM,199.56,9.645057692249463,13.472098909872523\n09/25/2014 12:00:00 AM,196.34,3.9747969515722783,12.303315918163136\n09/26/2014 12:00:00 AM,197.9,0.23012221964054724,10.912616274262827\n09/29/2014 12:00:00 AM,197.54,-1.916441473981381,9.206122571650248\n09/30/2014 12:00:00 AM,197.02,-4.128443753034502,7.187001852537209\n10/01/2014 12:00:00 AM,194.35,-9.82569848555611,4.391998690065087\n10/02/2014 12:00:00 AM,194.38,-13.38512424368965,1.190163453442484\n10/03/2014 12:00:00 AM,196.52,-15.393203532489032,-2.1072484727733385\n10/06/2014 12:00:00 AM,196.29,-17.123740495455273,-5.324741680082616\n10/07/2014 12:00:00 AM,193.26,-20.74036613525736,-8.70089988313893\n10/08/2014 12:00:00 AM,196.64,-19.8115975027873,-11.343832600289995\n10/09/2014 12:00:00 AM,192.74,-20.939252353709136,-13.695985330662182\n10/10/2014 12:00:00 AM,190.54,-26.095391567923556,-16.3825353411002\n10/13/2014 12:00:00 AM,187.41,-33.37320774173387,-19.631953562066798\n10/14/2014 12:00:00 AM,187.7,-37.15939197474656,-22.669030616421292\n10/15/2014 12:00:00 AM,186.43,-43.73056349890484,-26.04074608922298\n10/16/2014 12:00:00 AM,186.27,-47.17580967244996,-29.572146771440863\n10/17/2014 12:00:00 AM,188.47,-48.174859156910145,-33.02227106715807\n10/20/2014 12:00:00 AM,190.3,-45.65711549850523,-35.79079877418561\n10/21/2014 12:00:00 AM,194.07,-39.93084041650144,-38.026270209042735\n10/22/2014 12:00:00 AM,192.69,-34.7949740423786,-39.56579484111712\n10/23/2014 12:00:00 AM,194.93,-27.696430904195626,-39.743688100702904\n10/24/2014 12:00:00 AM,196.43,-19.676608851052123,-38.22184377951604\n10/27/2014 12:00:00 AM,196.16,-12.093942358875609,-35.436793822197046\n10/28/2014 12:00:00 AM,198.41,-5.300707215025074,-31.16680979065485\n10/29/2014 12:00:00 AM,198.11,1.2972409044085307,-25.780915282115018\n10/30/2014 12:00:00 AM,199.38,8.50314576178348,-19.483359180037947\n10/31/2014 12:00:00 AM,201.66,16.1842525324209,-12.6120960654906\n11/03/2014 12:00:00 AM,201.77,23.922310170778342,-5.517301555792847\n11/04/2014 12:00:00 AM,201.07,27.679734438051952,1.4243327198105478\n11/05/2014 12:00:00 AM,202.34,34.9637100639661,8.38657060516185\n11/06/2014 12:00:00 AM,203.15,40.2973203079762,15.050340511720552\n11/07/2014 12:00:00 AM,203.34,42.010622943397976,21.06195887863984\n11/10/2014 12:00:00 AM,203.98,42.72479314960152,26.398125585820573\n11/11/2014 12:00:00 AM,204.18,43.51767466482385,31.089284892533385\n11/12/2014 12:00:00 AM,203.96,42.59720799375717,34.87751402941935\n11/13/2014 12:00:00 AM,204.19,40.76956500105794,37.60921541482347\n11/14/2014 12:00:00 AM,204.24,39.56383451031249,39.347162563660596\n11/17/2014 12:00:00 AM,204.37,39.26519509693156,40.63443597020277\n11/18/2014 12:00:00 AM,205.55,40.833209475268134,41.28660257145855\n11/19/2014 12:00:00 AM,205.22,41.2159830246761,41.38867620664743\n11/20/2014 12:00:00 AM,205.58,42.12070243521191,41.400907261293426\n11/21/2014 12:00:00 AM,206.68,44.001063154443344,41.542715039609185\n11/24/2014 12:00:00 AM,207.26,45.49257140848061,41.762148011126605\n11/25/2014 12:00:00 AM,207.11,45.26364978017923,42.05841932072906\n11/26/2014 12:00:00 AM,207.64,46.560989913482175,42.70191097766509\n11/28/2014 12:00:00 AM,207.2,46.16557307901429,43.43543748529862\n12/01/2014 12:00:00 AM,205.76,43.722622114195104,43.93070715388346\n12/02/2014 12:00:00 AM,207.09,41.20373027739061,43.97187613189707\n12/03/2014 12:00:00 AM,207.89,38.40373367130799,43.659403981522836\n12/04/2014 12:00:00 AM,207.66,35.337210942563544,42.905682704561904\n12/05/2014 12:00:00 AM,208.0,32.6441214208809,41.64380028972163\n12/08/2014 12:00:00 AM,206.61,29.603741297041402,39.87837472178394\n12/09/2014 12:00:00 AM,206.47,25.944024922113428,37.73174973755441\n12/10/2014 12:00:00 AM,203.16,20.135641597483172,34.79559992466563\n12/11/2014 12:00:00 AM,204.19,14.532017776623347,31.280760446622192\n12/12/2014 12:00:00 AM,200.89,6.63096019592071,27.159464677925037\n12/15/2014 12:00:00 AM,199.51,-0.7714555273650561,22.495555144063296\n12/16/2014 12:00:00 AM,197.91,-9.903810534417326,17.12805023231604\n12/17/2014 12:00:00 AM,201.79,-13.217427080827193,11.73309045193929\n12/18/2014 12:00:00 AM,206.78,-13.456976543190702,6.610746233709112\n12/19/2014 12:00:00 AM,206.52,-11.380310002999064,2.056962755926839\n12/22/2014 12:00:00 AM,207.47,-6.28270847174437,-1.52378539894625\n12/23/2014 12:00:00 AM,207.75,0.18973671484079313,-3.7399970525731807\n12/24/2014 12:00:00 AM,207.77,4.521470136451364,-4.852280123703401\n12/26/2014 12:00:00 AM,208.44,6.166181217218129,-4.903922232448132\n12/29/2014 12:00:00 AM,208.72,9.122956714741164,-3.80454309443633\n12/30/2014 12:00:00 AM,207.6,10.513340171118774,-1.5359707938212077\n12/31/2014 12:00:00 AM,205.54,10.997214433348914,1.1545449299761374\n01/02/2015 12:00:00 AM,205.43,10.841943514565667,3.854424936393512\n01/05/2015 12:00:00 AM,201.72,5.580572573692738,5.738967444914823\n01/06/2015 12:00:00 AM,199.82,-0.7504745776341037,6.353660099815963\n01/07/2015 12:00:00 AM,202.31,-4.638165418809603,5.817226529410363\n01/08/2015 12:00:00 AM,205.9,-4.48751911927704,4.816227723218319\n01/09/2015 12:00:00 AM,204.25,-6.847701784180343,3.370240723062933\n01/12/2015 12:00:00 AM,202.65,-8.30823656862862,1.433441469355179\n01/13/2015 12:00:00 AM,202.08,-9.923824619634452,-0.8373546185062906\n01/14/2015 12:00:00 AM,200.86,-13.906269926378325,-3.6044084362537614\n01/15/2015 12:00:00 AM,199.02,-21.57721216475351,-7.206536845067003\n01/16/2015 12:00:00 AM,201.63,-24.262461644627642,-10.52242953599149\n01/20/2015 12:00:00 AM,202.05,-23.157120889778597,-13.012056904007544\n01/21/2015 12:00:00 AM,203.08,-19.829841415992764,-14.700020903694561\n01/22/2015 12:00:00 AM,206.1,-13.646747290409971,-15.717712922709332\n01/23/2015 12:00:00 AM,204.97,-7.280677662400176,-15.765821353622647\n01/26/2015 12:00:00 AM,205.45,-2.4654669106857448,-15.116624724962326\n01/27/2015 12:00:00 AM,202.74,-0.05932304222561813,-14.020568994139122\n01/28/2015 12:00:00 AM,200.14,0.1357147169973678,-12.46034847820849\n01/29/2015 12:00:00 AM,201.99,-0.9138976338358515,-10.164424641439862\n01/30/2015 12:00:00 AM,199.45,-3.651277058607879,-7.874293020770999\n02/02/2015 12:00:00 AM,201.92,-6.066601542629135,-5.975346426643281\n02/03/2015 12:00:00 AM,204.84,-5.3197768186027625,-4.36311702693328\n02/04/2015 12:00:00 AM,204.06,-4.8987987497946195,-3.391122744642686\n02/05/2015 12:00:00 AM,206.12,-4.252436142341468,-3.0546514646361627\n02/06/2015 12:00:00 AM,205.55,-0.6521403693881549,-2.8531707378253195\n02/09/2015 12:00:00 AM,204.63,0.4386401027647482,-2.7978414994930567\n02/10/2015 12:00:00 AM,206.81,3.2304135360986868,-2.4539860751484657\n02/11/2015 12:00:00 AM,206.93,7.492593649161693,-1.5199314881487385\n02/12/2015 12:00:00 AM,208.92,10.336973050479633,0.034318523972096227\n02/13/2015 12:00:00 AM,209.78,13.88658262068064,2.251338986562071\n02/17/2015 12:00:00 AM,210.11,18.677883949857836,4.917745738613249\n"
  },
  {
    "path": "Tests/TestData/spy_with_kvo.csv",
    "content": "Date,Open,High,Low,Close,Volume,KVO5_10\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,6206502878.531636\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,1269832002.9523783\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,1474636235.6224556\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,2942693590.1638966\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,-1046643348.3958902\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,-3199072756.304652\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,-5333821902.837638\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,-661531943.7026198\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,-1810233873.892468\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,1029073145.4592948\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,-1064997429.6171157\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,1121630450.4240236\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,-783653840.8396811\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,1068304491.170609\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,-1047329775.5272024\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,1104098391.21917\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,-902584316.0427022\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,1974383462.8483648\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,-1118560257.7067327\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,521963333.73835945\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,2152301074.174033\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,3719518878.5082664\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,4212566948.634102\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,-359942536.25126743\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,-3846938290.5562067\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,226122719.75708246\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,-3488951867.7705984\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,-5652456134.372263\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,-592849283.9461503\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,1731010671.6771245\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,4535894615.304917\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,4654965815.030614\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,5281161640.997452\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,206299516.2016697\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,195431528.89111042\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,1362738416.6526022\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,-2301374734.622734\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,-804154008.0944147\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,1945130494.1701727\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,1740461763.091217\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,1993961694.303053\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,2240460077.4725018\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,-1682366572.7449236\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,-535869057.61707973\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,113369100.141325\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1146817268.4338417\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,2056909466.9604225\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,-2176214695.519824\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,-600598528.3759422\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,228636211.12673187\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,911713118.80579\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,-2723547335.5024586\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,-7327839985.609878\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,-8601110359.098843\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,-3142248228.4533668\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,-4558757320.009392\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,-604493104.631381\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,-1674606979.6344929\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,-4203095308.1933985\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,-5154325980.02994\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,-6948624696.000225\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,-7388086960.585392\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,1067417123.0723324\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,4815474426.081393\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,2305790822.151107\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,-143301820.8144207\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,3529518319.797308\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,6318967524.884499\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,7541030880.7545395\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,7368077174.671677\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1520968455.171739\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,-4897981938.209809\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,-8858755352.04823\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,-9503507395.652258\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,-1083296107.520691\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,3779191142.0976114\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,6419332843.446899\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,2319703665.6980996\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,3784953890.2988625\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,212219568.87973952\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,-1232503457.90301\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,1308545383.8963225\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,3243592027.5581355\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,4694633741.405418\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,5286455152.137994\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,5807991610.061623\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,5021314001.958145\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,3407379825.1786118\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,-576027177.438755\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,-7165811.606327057\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,625805274.0338726\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,1274210081.7006474\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,1167187382.3264542\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,-2178761698.5856905\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,-4304672339.463023\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,-6066139178.41257\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,-6541401510.592497\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,-6124627298.684212\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,-2244884600.184141\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1394139158.8425226\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,3336695589.1038237\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,3797907156.7337666\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,3036075873.457221\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,81272159.95419693\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,-2344168250.5357513\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,-534340814.74502945\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,-2108272782.490553\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,-3053630997.1438146\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,-913173017.2473536\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,-2004837470.580656\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,-4149675108.79484\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,-5086158547.885148\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,-4492306806.726845\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,-227665690.56126976\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,-1302047985.0869951\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,1942292874.0152473\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,3931478101.505312\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,1540914809.8614542\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,-1417247652.189002\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,-2599374552.463189\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,974773001.7782488\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,-1041166859.2063446\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1961633918.1508694\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,3526236417.496793\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,3988331044.699748\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1293449995.8909616\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,2517723713.590389\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,3996611158.6628513\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,4155255249.3826904\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,3848992131.8912525\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,3245318125.421297\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,4016763954.4538403\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,3240831502.8327885\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,4894840696.587955\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,5005478414.623302\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,-793084894.9307499\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,-4615416472.239861\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,-6536643064.868988\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,-7780557938.039388\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,-3959953065.6580706\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,-4632904460.171746\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,-5316421487.166329\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,-1066700804.1793647\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,-2238230616.8056602\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,-4186538449.8692837\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,-153634214.90579605\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,-1262512856.809493\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,-3093489542.698056\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,-4794231861.719542\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1038530464.2146063\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,3745350220.820274\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,5194500796.674981\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,677858858.5961761\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,3275964219.4986734\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,4358548005.892207\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,5776848580.047138\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,5509268881.552927\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,5456036713.94952\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,15597695.096653938\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,-12640928.71598339\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,804842695.0721254\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,1246112582.9242363\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1540075409.6278496\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,-1803749333.4382944\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,-4905918119.310625\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,-6835007290.267313\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,-2691693271.496211\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,-2957756388.658973\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,-334985361.04311264\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,-1465835087.3383965\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,1363027232.7232985\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,2390687267.177944\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,37411883.43883681\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,626857295.2186403\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,2311198208.2758894\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,3431682189.5226955\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,149388153.9641533\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,-2483123893.595306\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,-4303543735.58012\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,-901563173.3791416\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,1121434177.6529326\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,2332228932.6727104\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,3092675653.0702972\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,2665052420.236784\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,2119269528.5615654\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,-1099500964.087977\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,-3680823456.0112796\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,-4909622129.696923\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,-5742245943.937731\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,-1170066438.3679156\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,1131628562.136936\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,-324038719.0004561\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,-1496046771.902115\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,-3356957956.004019\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,-4237723171.1271343\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,-277282735.13922644\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,-731509094.1146832\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,1736065071.9577284\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,5014907624.859497\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,7881122419.372841\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,6483026428.147469\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,4213518380.541458\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,3207494655.8253784\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,2452543396.030386\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,-817340283.20366\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,-662007121.37957\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,-2665311378.216318\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,-4170218940.175725\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,-5233741341.964041\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,-1593006003.3011265\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,906766911.6790953\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,2078844517.8684483\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,3094860948.4073105\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,-338949820.3559842\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,1093849969.5948696\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,2235817516.5056934\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,-939972218.7484212\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,-3420633630.99262\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,-1392893026.4558837\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,229228151.66208506\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,-1576547014.314794\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,-4077074350.6671743\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,-6102201916.147256\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,-924628681.6613483\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,-2956340002.7990417\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,640635654.6182861\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,-1593040811.5735893\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,-3955107044.9563293\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,-5577781022.646986\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,-6175778037.4888115\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,-125444122.05324364\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,4778295850.696142\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,6211917729.052582\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,6923096699.170403\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,6695292835.298656\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,6096287276.362086\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,5494959212.097527\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,4542076955.660051\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,355055565.24907684\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,800095342.9467106\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,2153980895.851778\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,2446125161.0066833\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,-2124063490.9951572\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,-861929039.6197128\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,146462006.4916811\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,1906055782.5106544\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,-3080585232.344922\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,172628888.70559502\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,1161857039.366209\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,1445267336.5751934\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,2128353398.1793823\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,-1560790413.8910837\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,-3932414208.5886745\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,-5650218383.740349\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,-6844699597.843483\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,-8138748314.14451\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,-2737493769.7694864\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,836182415.2854681\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,-1202945189.5265818\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,1659762406.7974315\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,-813285453.4635262\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,-2602521316.311302\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,896292567.8100967\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,-595039882.8915544\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,-3079015588.7053337\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,488857607.1657729\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,3196216830.740937\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,4301765285.27099\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,4444482717.815974\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,1217163953.3962421\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,-1464496369.826403\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,-3964088734.709255\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,-4827174998.377226\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,-812784960.4385023\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,-1710073205.6744766\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,-4162045834.227051\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,640596745.9725456\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,3931697721.388394\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,5279177673.899302\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,5845295006.813684\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,4949157979.368447\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,4585582275.405267\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,291941455.12593746\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,227025266.02908707\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,-2137818079.3448215\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,-353405033.15397406\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,1286637365.3416548\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,2480293152.701227\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,2935516390.110258\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,3121270874.695038\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,-433574102.97659683\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,-3214771377.4259577\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,-1381099035.228907\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,149318143.40143776\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,-2379311647.814882\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,-1013233973.6949787\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,425312575.0121403\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,-1296451798.5766861\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,-3391303660.238644\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,-465282973.0208454\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,750867164.2191119\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,-1593011893.11636\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,347221933.74202585\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,1147161792.89776\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,1694119300.730939\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,2309765881.9111805\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,2333890956.3050632\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,2107030143.723546\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,2288005991.8097935\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,1895027469.462265\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,1667350112.4095268\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1123604837.3591957\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1599925003.5459728\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,1670342845.0244198\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,1188844591.9251251\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,-1943992716.8400345\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,-4072198248.7389345\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,-5332154801.882252\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,-2313826163.337655\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,-163791353.19756794\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,1068080608.2781715\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,1987092738.9520998\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,2424130725.6857777\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,-1833964115.9353752\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,-3506675896.0535636\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,-4068092462.420147\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,-4565199193.230093\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,-4767336360.019184\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,-1304412948.8860853\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,1070534424.9474509\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,2447513758.037084\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,2625228239.8906302\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,2561032818.7853413\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,85971031.60896301\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,-2016360322.8745747\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,-109399051.9160285\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,-1442138086.2553113\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,239750870.02844787\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,1418905252.6001859\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,-220707617.24655366\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,1188643913.126688\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,-796455978.8541853\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,1532779965.9766378\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,-852408181.7530866\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,390175467.4443388\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,1191420600.7989206\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,1538889246.0389423\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,-661848503.3269186\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,-1971925746.7457588\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,-3111055216.7958126\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,-4205379896.2382364\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,-6105017929.676619\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,-7554727067.898773\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,-1907688952.5455189\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,-2364752000.165928\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,-2229798257.3456345\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,-2890814280.297409\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,1673208770.3281307\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,4127703939.541746\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,2339483520.843143\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,3297924540.5174437\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,3822639480.453844\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,4992730749.068787\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,4915080934.6531\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,4093336493.1181154\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,3799283263.580694\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,3356882487.230261\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,-30411446.880687714\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,-32789632.40478325\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,367432761.34650517\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,-1273436730.491499\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,-2430189487.896106\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,-924585848.3750939\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,314620234.14277077\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,863163887.3210144\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,-1110684252.753272\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,469736896.82850266\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,1162945615.7857313\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,-1131591805.6835232\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,-89115359.71156406\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,848427045.600811\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,-1696354768.1234913\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,-3155064206.2158985\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,-1024144572.1977044\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,2076121743.5804944\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,3272642160.400284\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,42429779.375525\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,-2789497376.007031\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,-4465509227.995966\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,-1349534955.3348632\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,-2783041529.6346693\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,432198596.76235294\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,-1165781908.707358\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,1578684808.1583982\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,-1074697775.3762033\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,-3446793112.506033\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,636680270.6721082\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,2845550082.6997304\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,-320516705.594378\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,1967354055.0924044\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,-2282148033.371194\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,-5988750387.694586\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,-7988499078.0425415\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,-8882550637.382133\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,-12065321767.485512\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,216603338.70744133\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,7780591762.027444\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,9343629855.558104\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,10288371970.119057\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,10280894783.018873\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,9864312826.654781\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,8011276307.401903\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,5637556942.156151\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,4664784922.158598\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,4793762488.258156\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,3785666073.3610306\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,4128041816.7915573\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,2495655204.0974045\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,-2491100350.7028484\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,-2260335207.112835\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,-1574226416.0819855\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,-916691510.3725948\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,-1002032919.2642956\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,-1205053786.0123081\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,-3861546403.213269\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,-3005542594.219057\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,-1425982148.3345385\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,-445083151.72402763\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,-80013564.51350594\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,-2932661166.1059904\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,-1970969925.162201\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,265237951.17915535\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,691227029.3210659\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,1084665327.271492\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,753283533.4248314\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,-1757180974.9167852\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,-4127601789.6560264\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,-2342853945.653416\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,-683792880.9328089\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,-2355319361.862743\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,-277788611.70640326\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,-1834471264.2931967\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,-3631804005.176672\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,-5522724750.290258\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,-405836352.033628\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,-3028551519.1263847\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,-4891219048.659793\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,-7461362333.034943\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,886679173.2158928\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,5134375508.005346\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,-2849134983.457942\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,1995156454.5019274\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,4490263221.300588\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,3884897522.873102\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,3726511888.4248056\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,3951686990.1371784\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,688423424.2925668\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,-1526132221.9824839\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,-3453094065.725807\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,-5613220213.95491\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,-7426350687.750553\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,-805659207.1782389\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,3492882327.0362806\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,378563221.36991453\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,-2160736014.9090624\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,-4516986139.881155\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,-6436627578.351353\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,-6637240703.490486\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,1204978103.1967182\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,5107868557.104443\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,6942817751.753498\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,8609044453.505392\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,8343027594.310709\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,3212602596.664299\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,-843803933.5384045\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,-3547972214.055871\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,-5837899782.01968\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,-7779184221.026894\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,-1410690844.4157438\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,2915399340.5263414\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,5645192795.822402\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,6010052077.553549\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,6460276410.679202\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1489788496.1645164\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,1400565168.702733\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,2092225181.3559666\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,2565898462.168747\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,2990115446.6810207\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,2599515935.5728817\n"
  },
  {
    "path": "Tests/TestData/spy_with_macd.txt",
    "content": "Date,Open,High,Low,Close,MACD,Signal,Histogram\n1988-02-29,25.58,26.69,25.43,26.69,,,\n1988-03-31,26.69,27.17,25.52,25.8,,,\n1988-04-29,25.8,27.12,25.39,26.05,,,\n1988-05-31,26.05,26.28,24.8,26.13,,,\n1988-06-30,26.13,27.6,26.12,27.26,,,\n1988-07-29,27.26,27.55,26.16,27.11,,,\n1988-08-31,27.11,27.33,25.57,26.07,,,\n1988-09-30,26.07,27.4,25.61,27.1,,,\n1988-10-31,27.1,28.3,26.8,27.81,,,\n1988-11-30,27.81,27.95,26.2,27.28,,,\n1988-12-30,27.28,27.95,26.96,27.68,,,\n1989-01-31,27.68,29.65,27.29,29.65,,,\n1989-02-28,29.65,29.96,28.53,28.79,,,\n1989-03-31,28.79,29.9,28.55,29.39,,,\n1989-04-28,29.39,30.94,29.34,30.86,,,\n1989-05-31,30.86,32.2,30.31,31.95,,,\n1989-06-30,31.95,32.81,31.33,31.69,,,\n1989-07-31,31.69,34.49,31.62,34.49,,,\n1989-08-31,34.49,35.16,33.79,35.03,,,\n1989-09-29,35.03,35.3,34.03,34.8,,,\n1989-10-31,34.8,35.93,32.6,33.92,,,\n1989-11-30,33.92,34.54,32.16,34.49,,,\n1989-12-29,34.49,35.29,33.85,35.22,,,\n1990-01-31,35.22,35.94,31.88,32.8,,,\n1990-02-28,32.8,33.5,32.1,33.08,,,\n1990-03-30,33.08,34.34,33.0,33.88,,,\n1990-04-30,33.88,34.62,32.67,32.97,,,\n1990-05-31,32.97,36.11,32.97,36.0,,,\n1990-06-29,36.0,36.76,35.01,35.68,,,\n1990-07-31,35.68,36.86,34.89,35.5,,,\n1990-08-31,35.5,35.62,30.52,32.15,,,\n1990-09-28,32.15,32.55,29.5,30.5,,,\n1990-10-31,30.51,31.86,29.35,30.3,,,\n1990-11-30,30.3,32.2,30.06,32.12,,,\n1990-12-31,32.12,33.29,32.09,32.91,,,\n1991-01-31,32.91,34.28,30.83,34.28,,,\n1991-02-28,34.28,36.97,33.93,36.59,,,\n1991-03-28,36.59,37.84,36.25,37.4,,,\n1991-04-30,37.4,39.0,36.91,37.41,,,\n1991-05-31,37.41,38.86,36.46,38.86,,,\n1991-06-28,38.85,38.85,36.68,36.99,,,\n1991-07-31,37.0,38.65,36.97,38.65,,,\n1991-08-30,38.65,39.55,37.29,39.41,,,\n1991-09-30,39.41,39.63,38.15,38.66,,,\n1991-10-31,38.66,39.25,37.49,39.12,,,\n1991-11-29,39.12,39.66,37.04,37.4,,,\n1991-12-31,37.4,41.69,37.01,41.57,,,\n1992-01-31,41.57,41.98,40.73,40.74,,,\n1992-02-28,40.74,41.67,40.5,41.13,,,\n1992-03-31,41.13,41.24,40.06,40.24,,,\n1992-04-30,40.24,41.49,39.11,41.36,,,\n1992-05-29,41.36,41.74,40.85,41.4,,,\n1992-06-30,41.4,41.59,39.86,40.68,,,\n1992-07-31,40.69,42.34,40.59,42.28,,,\n1992-08-31,42.28,42.37,40.7,41.27,,,\n1992-09-30,41.27,42.39,41.14,41.64,,,\n1992-10-30,41.64,41.98,39.55,41.73,,,\n1992-11-30,41.73,43.05,41.42,42.99,,,\n1992-12-31,42.99,44.12,42.72,43.43,,,\n1993-01-29,43.43,44.12,42.55,43.94,,,\n1993-02-26,43.97,45.12,42.81,44.41,,,\n1993-03-31,44.56,45.84,44.22,45.19,,,\n1993-04-30,45.25,45.25,43.28,44.03,,,\n1993-05-28,44.09,45.66,43.84,45.22,,,\n1993-06-30,45.38,45.81,44.22,45.06,,,\n1993-07-30,45.12,45.22,44.16,44.84,,,\n1993-08-31,44.91,46.56,44.84,46.56,,,\n1993-09-30,46.41,46.59,44.81,45.94,,,\n1993-10-29,45.88,47.16,45.72,46.84,,,\n1993-11-30,46.78,47.0,45.53,46.34,,,\n1993-12-31,46.59,47.16,46.38,46.59,,,\n1994-01-31,46.59,48.31,46.41,48.22,,,\n1994-02-28,48.16,48.28,46.56,46.81,,,\n1994-03-31,46.81,47.31,43.53,44.59,,,\n1994-04-29,43.34,45.36,43.34,45.09,,,\n1994-05-31,45.09,45.94,44.17,45.81,,,\n1994-06-30,45.7,46.56,44.0,44.47,,,\n1994-07-29,44.69,46.05,44.38,45.91,,,\n1994-08-31,45.94,47.98,45.66,47.66,,,\n1994-09-30,47.5,47.72,45.73,46.17,,,\n1994-10-31,46.2,47.7,45.0,47.48,,,\n1994-11-30,47.28,47.33,44.61,45.59,,,\n1994-12-30,45.64,46.41,44.69,45.56,,,\n1995-01-31,45.7,47.23,45.69,47.09,,,\n1995-02-28,47.16,49.16,47.0,49.02,,,\n1995-03-31,48.97,50.89,48.22,50.11,,,\n1995-04-28,50.09,51.67,50.06,51.59,,,\n1995-05-31,51.55,53.64,51.39,53.64,,,\n1995-06-30,53.41,55.16,52.75,54.41,,,\n1995-07-31,54.47,56.7,54.2,56.16,,,\n1995-08-31,56.23,56.8,55.42,56.41,,,\n1995-09-29,56.39,58.91,56.34,58.48,,,\n1995-10-31,58.48,59.19,57.27,58.31,,,\n1995-11-30,58.28,61.2,58.23,60.91,,,\n1995-12-29,60.98,62.8,60.58,61.48,,,\n1996-01-31,61.41,63.69,59.64,63.67,,,\n1996-02-29,63.61,66.69,63.44,63.88,,,\n1996-03-29,64.64,65.97,62.0,64.69,,,\n1996-04-30,65.0,65.81,62.12,65.39,,,\n1996-05-31,65.38,68.44,63.08,66.88,,,\n1996-06-28,66.89,68.5,66.16,67.11,,,\n1996-07-31,67.28,67.7,60.38,64.09,,,\n1996-08-30,64.16,67.34,64.06,65.33,,,\n1996-09-30,64.47,69.25,64.38,68.62,,,\n1996-10-31,68.7,71.62,68.44,70.84,,,\n1996-11-29,70.98,76.69,70.27,76.02,,,\n1996-12-31,75.92,76.58,71.88,73.84,,,\n1997-01-31,74.38,79.69,72.75,78.41,,,\n1997-02-28,78.72,82.0,77.12,79.16,,,\n1997-03-31,78.75,81.8,75.25,75.38,,,\n1997-04-30,75.25,80.69,73.31,80.09,,,\n1997-05-30,80.22,85.56,79.31,85.16,,,\n1997-06-30,85.34,90.5,84.08,88.31,,,\n1997-07-31,88.5,96.03,88.39,95.31,,,\n1997-08-29,95.5,96.62,89.34,90.38,,,\n1997-09-30,90.69,96.38,90.25,94.38,,,\n1997-10-31,95.25,98.5,84.38,92.06,,,\n1997-11-28,93.19,96.81,90.09,95.62,,,\n1997-12-31,96.22,99.0,92.38,97.06,,,\n1998-01-30,97.31,99.56,90.91,98.31,,,\n1998-02-27,99.91,105.53,99.72,105.12,,,\n1998-03-31,105.25,111.53,103.16,109.94,,,\n1998-04-30,110.31,113.44,107.62,111.34,,,\n1998-05-29,111.75,113.31,107.58,109.03,,,\n1998-06-30,108.97,114.69,107.5,113.31,,,\n1998-07-31,114.06,119.23,111.31,111.78,,,\n1998-08-31,111.78,112.42,95.0,96.0,,,\n1998-09-30,96.06,107.0,93.62,101.75,,,\n1998-10-30,100.03,110.91,92.22,110.0,,,\n1998-11-30,110.81,119.72,110.19,116.12,,,\n1998-12-31,116.12,124.75,113.75,123.31,,,\n1999-01-29,123.38,128.5,120.38,127.66,,,\n1999-02-26,128.69,128.84,121.33,123.56,,,\n1999-03-31,123.66,132.62,121.78,128.38,,,\n1999-04-30,129.69,137.5,128.12,133.25,,,\n1999-05-28,133.44,138.0,128.0,130.2,,,\n1999-06-30,130.12,137.5,128.02,137.0,,,\n1999-07-30,137.0,142.25,132.56,132.75,,,\n1999-08-31,132.75,138.78,127.0,132.06,,,\n1999-09-30,132.94,136.62,125.56,128.75,,,\n1999-10-29,127.94,137.69,123.44,137.0,,,\n1999-11-30,136.5,143.0,134.59,139.28,,,\n1999-12-31,139.31,147.56,139.0,146.88,,,\n2000-01-31,148.25,148.25,135.0,139.56,,,\n2000-02-29,139.75,144.56,132.72,137.44,,,\n2000-03-31,137.62,155.75,135.03,150.38,,,\n2000-04-28,150.12,153.11,133.5,145.09,,,\n2000-05-31,146.56,148.48,136.5,142.81,,,\n2000-06-30,143.69,149.16,143.0,145.28,,,\n2000-07-31,145.44,151.98,141.52,143.0,,,\n2000-08-31,143.62,153.09,142.62,152.34,,,\n2000-09-29,153.25,153.59,142.12,143.62,,,\n2000-10-31,144.28,145.75,130.16,142.95,,,\n2000-11-30,142.25,144.3,129.75,132.28,,,\n2000-12-29,133.19,139.56,125.53,131.19,,,\n2001-01-31,132.0,138.7,127.56,137.02,,,\n2001-02-28,137.1,137.99,121.8,123.95,,,\n2001-03-30,124.05,127.75,108.04,116.69,,,\n2001-04-30,116.3,127.27,109.3,126.66,,,\n2001-05-31,125.07,132.09,123.44,125.95,,,\n2001-06-29,126.2,129.23,120.4,122.6,,,\n2001-07-31,122.8,124.32,116.75,121.35,,,\n2001-08-31,121.97,123.25,112.04,114.15,,,\n2001-09-28,113.85,116.17,93.8,104.44,,,\n2001-10-31,103.9,111.79,102.83,105.8,,,\n2001-11-30,106.6,116.9,105.7,114.05,,,\n2001-12-31,113.65,118.0,112.0,114.3,,,\n2002-01-31,115.11,117.99,108.4,113.18,,,\n2002-02-28,113.09,113.3,107.82,111.15,,,\n2002-03-28,111.72,117.9,111.51,114.52,,,\n2002-04-30,114.23,115.1,106.63,107.86,,,\n2002-05-31,107.97,111.25,104.9,107.22,,,\n2002-06-28,107.09,107.6,95.19,98.96,,,\n2002-07-31,99.18,99.8,77.68,91.16,,,\n2002-08-30,90.88,97.15,83.55,91.78,,,\n2002-09-30,90.73,93.33,80.9,81.79,,,\n2002-10-31,82.43,91.29,77.07,88.52,,,\n2002-11-29,88.35,94.95,87.45,93.98,,,\n2002-12-31,95.47,96.05,87.11,88.23,,,\n2003-01-31,88.85,93.86,84.15,86.06,-9.94615,-8.406431,-1.539718\n2003-02-28,86.14,86.81,81.0,84.9,-10.07201,-8.739547,-1.3324610000000001\n2003-03-31,85.26,89.88,79.38,84.74,-10.0686,-9.005357,-1.063242\n2003-04-30,85.25,92.8,84.91,91.91,-9.379219,-9.08013,-0.2990895\n2003-05-30,91.92,97.09,90.5,96.95,-8.330171,-8.930138000000001,0.5999671\n2003-06-30,97.53,102.18,96.67,97.63,-7.359089999999999,-8.615929,1.256838\n2003-07-31,97.25,101.9,96.43,99.39,-6.37401,-8.167544,1.7935349999999999\n2003-08-29,99.19,101.82,96.34,101.44,-5.366051000000001,-7.607246000000001,2.2411950000000003\n2003-09-30,101.64,104.7,99.25,99.95,-4.634049,-7.012607000000001,2.378557\n2003-10-31,100.24,105.97,100.2,105.3,-3.580953,-6.326276,2.745323\n2003-11-28,105.75,106.95,103.62,106.45,-2.623332,-5.585687,2.962355\n2003-12-31,106.85,111.52,105.96,111.28,-1.457863,-4.760122,3.302259\n2004-01-30,111.74,116.5,110.73,113.48,-0.35263459999999996,-3.878625,3.52599\n2004-02-27,113.7,116.6,112.78,115.02,0.6401525,-2.974869,3.615022\n2004-03-31,115.43,116.97,108.85,113.1,1.25752,-2.128392,3.385911\n2004-04-30,113.07,115.41,110.9,110.96,1.5561690000000001,-1.3914790000000001,2.947649\n2004-05-28,111.37,113.26,108.06,112.86,1.923987,-0.7283861999999999,2.652373\n2004-06-30,112.46,114.94,111.87,114.53,2.323456,-0.11801769999999999,2.4414740000000004\n2004-07-30,114.25,114.4,108.21,110.84,2.3155930000000002,0.3687045,1.9468889999999999\n2004-08-31,110.19,111.63,106.59,111.11,2.304584,0.7558803000000001,1.5487030000000002\n2004-09-30,110.95,113.74,110.41,111.76,2.3215470000000002,1.069014,1.252533\n2004-10-29,112.26,114.68,109.35,113.2,2.423252,1.339861,1.0833899999999999\n2004-11-30,113.56,119.14,113.2,117.89,2.8494509999999997,1.641779,1.2076719999999999\n2004-12-31,118.16,121.66,117.73,120.87,3.3886160000000003,1.9911470000000002,1.39747\n2005-01-31,121.56,121.76,116.37,118.16,3.5562410000000004,2.3041650000000002,1.252075\n2005-02-28,118.25,121.67,118.1,120.63,3.8440800000000004,2.612148,1.2319309999999999\n2005-03-31,120.82,123.25,116.25,117.96,3.812796,2.852278,0.9605183\n2005-04-29,118.63,119.26,113.55,115.75,3.568539,2.99553,0.5730090999999999\n2005-05-31,116.07,120.25,114.8,119.48,3.6340529999999998,3.1232349999999998,0.5108184\n2005-06-30,119.52,121.94,118.75,119.18,3.6200360000000003,3.222595,0.397441\n2005-07-29,119.45,124.64,118.26,123.74,3.9315599999999997,3.364388,0.5671723000000001\n2005-08-31,123.83,124.74,120.38,122.58,4.038292,3.499169,0.5391235\n2005-09-30,122.51,124.74,120.44,123.04,4.112589,3.6218529999999998,0.4907364000000001\n2005-10-31,122.96,123.34,116.88,120.13,3.8917949999999997,3.675841,0.2159538\n2005-11-30,120.58,127.41,120.13,125.41,4.095654,3.759804,0.3358505\n2005-12-30,126.02,128.57,124.36,124.51,4.136904,3.8352239999999997,0.3016798\n2006-01-31,125.1,129.44,124.39,127.5,4.360596,3.9402980000000003,0.4202978\n2006-02-28,127.82,130.04,123.64,128.23,4.5443940000000005,4.0611180000000004,0.48327609999999993\n2006-03-31,128.6,131.47,127.18,129.83,4.764241999999999,4.201741999999999,0.5624998000000001\n2006-04-28,130.07,131.86,128.02,131.47,5.013021,4.3639980000000005,0.6490229000000001\n2006-05-31,131.47,132.8,124.76,127.51,4.834908,4.4581800000000005,0.3767276\n2006-06-30,127.38,129.43,122.34,127.23,4.617925,4.4901290000000005,0.12779580000000001\n2006-07-31,127.43,128.14,122.39,127.85,4.444757,4.481054,-0.03629794\n2006-08-31,127.34,131.04,126.28,130.64,4.480995,4.4810419999999995,-4.741412999999999e-05\n2006-09-29,131.14,133.99,129.35,133.58,4.692851999999999,4.523405,0.1694475\n2006-10-31,133.54,139.0,132.34,137.79,5.141197,4.6469629999999995,0.4942338\n2006-11-30,138.22,141.16,135.62,140.53,5.652451,4.848061,0.8043901\n2006-12-29,140.53,143.24,138.97,141.62,6.075541,5.093557,0.9819849\n2007-01-31,142.25,144.13,140.25,143.75,6.507701,5.376386,1.131316\n2007-02-28,144.15,146.42,139.0,140.93,6.547168,5.610542,0.9366257\n2007-03-30,139.34,143.81,136.75,142.0,6.588833999999999,5.806201000000001,0.7826338\n2007-04-30,142.16,149.8,140.89,148.29,7.048159,6.0545919999999995,0.9935665000000001\n2007-05-31,148.42,153.89,147.67,153.32,7.728961,6.3894660000000005,1.339495\n2007-06-29,153.88,154.4,148.06,150.43,7.943732000000001,6.700319,1.2434129999999999\n2007-07-31,150.87,156.0,145.04,145.72,7.645747999999999,6.889405,0.7563426999999999\n2007-08-31,145.18,150.59,137.0,147.59,7.474326,7.0063889999999995,0.4679366\n2007-09-28,147.45,154.39,144.33,152.58,7.652907000000001,7.135692999999999,0.5172142\n2007-10-31,152.6,157.52,148.0,154.65,7.870736,7.282700999999999,0.5880344\n2007-11-30,153.29,153.41,140.66,148.66,7.47387,7.320935,0.15293520000000002\n2007-12-31,148.19,152.89,143.96,146.21,6.882322,7.233212,-0.3508902\n2008-01-31,146.53,146.99,126.0,137.37,5.635242,6.913618,-1.278377\n2008-02-29,137.94,139.61,131.73,133.82,4.310775,6.39305,-2.082275\n2008-03-31,133.14,135.81,126.07,131.97,3.0763830000000003,5.729716000000001,-2.653334\n2008-04-30,133.71,140.59,132.33,138.26,2.575974,5.098968,-2.5229939999999997\n2008-05-30,138.39,144.3,137.52,140.35,2.321284,4.543431,-2.222147\n2008-06-30,139.83,140.89,127.04,127.98,1.108507,3.856446,-2.747939\n2008-07-31,126.52,129.16,120.02,126.83,0.05395466,3.095948,-3.041993\n2008-08-29,127.12,131.51,124.76,128.79,-0.6165236999999999,2.353454,-2.969977\n2008-09-30,130.03,130.71,110.53,115.99,-2.155884,1.451586,-3.6074699999999997\n2008-10-31,115.27,116.69,83.58,96.83,-4.865799,0.1881091,-5.053908\n2008-11-28,96.78,100.86,74.34,90.09,-7.471166,-1.3437459999999999,-6.12742\n2008-12-31,87.51,92.43,81.86,90.24,-9.4153,-2.958057,-6.457243\n2009-01-30,90.44,94.55,80.05,82.83,-11.4223,-4.650905000000001,-6.771392\n2009-02-27,81.57,87.74,73.81,73.93,-13.57453,-6.435630000000001,-7.138902000000001\n2009-03-31,72.52,83.3,67.1,79.52,-14.66014,-8.080531,-6.579604\n2009-04-30,78.53,89.02,78.33,87.42,-14.713410000000001,-9.407107,-5.306305\n2009-05-29,87.44,93.7,86.72,92.53,-14.179839999999999,-10.36166,-3.81819\n2009-06-30,93.67,96.11,87.53,91.95,-13.646479999999999,-11.01862,-2.6278610000000002\n2009-07-31,92.34,99.83,87.0,98.81,-12.52585,-11.32007,-1.205785\n2009-08-31,99.85,104.35,98.12,102.46,-11.21395,-11.29884,0.08489023\n2009-09-30,101.95,108.06,99.57,105.59,-9.808632000000001,-11.0008,1.1921700000000002\n2009-10-30,105.34,110.31,101.99,103.56,-8.757753999999998,-10.55219,1.7944380000000002\n2009-11-30,104.13,111.74,103.08,109.94,-7.325667,-9.906887,2.58122\n2009-12-31,110.92,113.03,109.02,111.44,-6.000521,-9.125614,3.125093\n2010-01-29,112.37,115.14,107.22,107.39,-5.216995,-8.34389,3.126895\n2010-02-26,108.15,111.58,104.58,110.74,-4.276433,-7.530399000000001,3.253966\n2010-03-31,111.2,118.17,111.17,117.0,-2.9914169999999998,-6.6226020000000005,3.631185\n2010-04-30,117.8,122.12,117.1,118.81,-1.8061610000000001,-5.659314,3.853153\n2010-05-28,119.38,120.68,104.38,109.37,-1.610007,-4.849453,3.239446\n2010-06-30,108.35,113.2,102.88,103.22,-1.928575,-4.265276999999999,2.336702\n2010-07-30,103.15,112.29,101.13,110.27,-1.593795,-3.730981,2.1371860000000003\n2010-08-31,111.99,113.18,104.29,105.31,-1.70901,-3.3265860000000003,1.617577\n2010-09-30,106.73,115.79,106.66,114.13,-1.0762120000000002,-2.876512,1.8003\n2010-10-29,114.99,119.76,113.18,118.49,-0.22035900000000003,-2.345281,2.124922\n2010-11-30,119.07,122.95,117.59,118.49,0.45269209999999993,-1.785686,2.238379\n2010-12-31,120.2,126.2,120.19,125.75,1.553998,-1.11775,2.6717470000000003\n2011-01-31,126.71,130.35,125.7,128.68,2.6328669999999996,-0.3676263,3.000493\n2011-02-28,129.46,134.69,129.38,133.15,3.804711,0.4668412,3.3378699999999997\n2011-03-31,133.57,133.69,125.28,132.59,4.634792,1.300431,3.334361\n2011-04-29,133.41,136.57,129.51,136.43,5.538647,2.148075,3.3905730000000003\n2011-05-31,137.07,137.18,131.38,134.9,6.061626,2.9307849999999998,3.130841\n2011-06-30,134.51,134.92,126.19,131.97,6.168557,3.578339,2.590218\n2011-07-29,132.09,135.7,127.97,129.33,5.97144,4.05696,1.91448\n2011-08-31,130.84,130.96,110.27,122.22,5.181773000000001,4.281922,0.8998510000000001\n2011-09-30,122.29,123.4,111.3,113.15,3.780504,4.181639,-0.40113459999999995\n2011-10-31,112.49,129.42,107.43,125.5,3.624746,4.07026,-0.445514\n2011-11-30,122.03,128.02,116.2,124.99,3.420722,3.940352,-0.5196304\n2011-12-30,124.85,127.26,120.03,125.5,3.262575,3.804797,-0.5422216\n2012-01-31,127.76,133.4,126.43,131.32,3.5657650000000003,3.756991,-0.19122550000000002\n2012-02-29,132.29,138.19,132.13,137.02,4.217372,3.849067,0.368305\n2012-03-30,137.31,141.83,134.36,140.81,4.982164,4.075686,0.9064780000000001\n2012-04-30,140.64,142.21,135.76,139.87,5.449598,4.350469,1.09913\n2012-05-31,139.79,141.66,129.55,131.47,5.083632,4.497101,0.5865309\n2012-06-29,129.41,136.27,127.14,136.1,5.108319,4.619345,0.4889742\n2012-07-31,136.48,139.34,132.6,137.71,5.1978800000000005,4.735052,0.4628278\n2012-08-31,138.7,143.09,135.58,141.16,5.484026,4.884847,0.5991791\n2012-09-28,141.04,148.11,140.13,143.97,5.869878,5.081853,0.7880252\n2012-10-31,144.52,147.16,140.39,141.35,5.896287999999999,5.24474,0.6515482\n2012-11-30,141.65,143.72,134.7,142.16,5.914401,5.378672,0.5357287\n2012-12-31,142.8,145.58,139.54,142.41,5.881135,5.479165,0.4019697\n2013-01-31,145.11,150.94,144.73,149.7,6.369587,5.657249,0.7123381\n2013-02-28,150.65,153.28,148.73,151.61,6.832056,5.8922099999999995,0.939845\n2013-03-28,151.09,156.85,150.41,156.67,7.520175999999999,6.217804,1.302373\n2013-04-30,156.59,159.72,153.55,159.68,8.213716,6.616986,1.59673\n2013-05-31,159.33,169.07,158.1,163.45,8.964225,7.086434,1.877791\n2013-06-28,163.83,165.99,155.73,160.42,9.208364,7.51082,1.697545\n2013-07-31,161.26,169.86,160.22,168.71,9.956014999999999,7.999859,1.9561560000000002\n2013-08-30,169.99,170.97,163.05,163.65,10.02467,8.404822,1.619852\n2013-09-30,165.23,173.6,163.7,168.01,10.31203,8.786264,1.525768\n2013-10-31,168.14,177.51,164.53,175.79,11.040280000000001,9.237067,1.8032130000000002\n2013-11-29,176.02,181.75,174.76,181.0,11.90064,9.769782000000001,2.130861\n2013-12-31,181.09,184.69,177.32,184.69,12.733460000000001,10.36252,2.370939\n2014-01-31,183.98,184.94,176.88,178.18,12.72152,10.83432,1.8872\n2014-02-28,177.95,187.15,173.71,186.29,13.214139999999999,11.31028,1.903859\n2014-03-31,184.69,189.02,183.75,187.01,13.50695,11.74961,1.757332\n2014-04-30,187.62,189.7,181.31,188.31,13.686129999999999,12.13692,1.549213\n2014-05-30,188.22,192.8,186.01,192.68,14.019160000000001,12.51337,1.50579\n2014-06-30,192.95,196.6,191.97,195.72,14.362820000000001,12.88326,1.47956\n2014-07-31,196.19,199.06,192.97,193.09,14.25859,13.158320000000002,1.100265\n2014-08-29,192.56,200.82,190.55,200.71,14.6223,13.451120000000001,1.171181\n2014-09-30,200.97,201.9,196.05,197.02,14.44626,13.65015,0.7961161\n2014-10-31,196.7,201.82,181.92,201.66,14.51385,13.82289,0.690967\n2014-11-28,201.92,207.87,200.06,207.2,14.84335,14.026979999999998,0.8163691999999999\n2014-12-31,206.4,212.97,197.86,205.54,14.799920000000002,14.18157,0.6183541\n2015-01-30,206.38,206.88,198.55,199.45,14.111429999999999,14.167539999999999,-0.05611245\n2015-02-27,200.05,212.24,197.86,210.66,14.305439999999999,14.195120000000001,0.1103194\n2015-03-31,210.78,212.06,204.12,206.43,13.95698,14.14749,-0.1905103\n2015-04-30,206.39,212.48,204.51,208.46,13.686860000000001,14.055370000000002,-0.3685078\n2015-05-29,209.41,213.78,206.76,211.14,13.53304,13.9509,-0.4178638\n2015-06-30,211.95,213.34,205.28,205.85,12.8363,13.727979999999999,-0.8916771000000001\n2015-07-31,207.79,213.18,204.11,210.5,12.515089999999999,13.4854,-0.9703149\n2015-08-31,210.53,211.31,182.4,197.67,11.09732,13.00779,-1.9104619999999999\n2015-09-30,193.07,202.89,186.93,191.63,9.378252999999999,12.281880000000001,-2.903627\n2015-10-30,192.03,209.44,189.12,207.93,9.224813000000001,11.67047,-2.445654\n2015-11-30,208.36,211.66,202.18,208.69,9.060096000000001,11.14839,-2.0882959999999997\n2015-12-31,209.42,211.0,199.83,203.87,8.443294999999999,10.60737,-2.164078\n2016-01-29,200.53,201.9,181.02,193.72,7.054139,9.896726,-2.842587\n2016-02-29,192.5,196.68,181.09,193.56,5.872616000000001,9.091904,-3.219288\n2016-03-31,195.05,206.87,194.45,205.52,5.834072,8.440337,-2.606266\n2016-04-29,204.35,210.92,203.09,206.33,5.802004,7.9126710000000005,-2.110667\n2016-05-31,206.9,210.69,202.78,209.84,5.990759,7.528288000000001,-1.5375299999999998\n2016-06-30,209.15,212.52,198.65,209.48,6.041655,7.230962,-1.189307\n2016-07-29,209.29,217.54,207.06,217.12,6.622139,7.109197,-0.48705829999999994\n2016-08-31,217.15,219.6,214.25,217.38,7.02221,7.0918,-0.06959006\n2016-09-30,217.38,219.22,212.31,216.3,7.1694759999999995,7.107335000000001,0.06214106\n2016-10-31,215.81,216.7,211.21,212.55,6.904007000000001,7.066669,-0.1626624\n2016-11-30,212.9,221.82,208.38,220.38,7.241956,7.101727,0.1402295\n2016-12-30,220.73,228.34,219.15,223.53,7.675483,7.2164779999999995,0.4590048\n2017-01-31,225.07,229.71,223.88,227.53,8.246758999999999,7.422534,0.8242252\n2017-02-28,228.28,237.31,226.82,236.47,9.313522,7.800732000000001,1.5127899999999999\n2017-03-31,238.4,240.32,231.61,235.74,9.984936,8.237573,1.747363\n2017-04-28,235.79,239.53,232.51,238.08,10.58385,8.706828,1.8770220000000002\n2017-05-31,238.66,242.08,235.43,241.44,11.2005,9.205564,1.994941\n2017-06-30,241.97,245.01,239.96,241.8,11.584719999999999,9.681394000000001,1.9033220000000002\n2017-07-31,242.9,248.0,240.34,246.77,12.15018,10.17515,1.975032\n2017-08-31,247.45,248.91,241.83,247.49,12.512189999999999,10.642560000000001,1.8696279999999998\n2017-09-29,247.98,251.32,244.95,251.23,12.95156,11.10436,1.847205\n2017-10-31,251.5,257.89,251.29,257.15,13.620460000000001,11.60758,2.012881\n2017-11-30,258.1,266.05,255.63,265.01,14.616320000000002,12.20933,2.406989\n2017-12-29,264.8,268.6,260.76,266.86,15.37755,12.84297,2.534581\n2018-01-31,267.86,286.63,267.4,281.9,16.9985,13.674079999999998,3.324418\n2018-02-28,281.1,283.06,252.92,271.65,17.25708,14.39068,2.866405\n2018-03-06,271.5,273.39,264.82,272.88,17.36114,14.984770000000001,2.37637\n"
  },
  {
    "path": "Tests/TestData/spy_with_obv.txt",
    "content": "Date,Open,High,Low,Close,Volume,OBV \n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,1.156476E+08,\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,1.385384E+08,-2.28908E+07\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,9.62323E+07,7.33415E+07\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,1.437959E+08,2.171374E+08\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,6.66189E+07,2.837563E+08\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,8.9907E+07,3.736633E+08\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,9.68405E+07,4.705038E+08\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,1.06479E+08,3.640248E+08\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,1.029682E+08,4.66993E+08\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,7.97185E+07,5.467115E+08\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,1.184293E+08,6.651408E+08\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,1.205206E+08,7.856614E+08\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,1.096312E+08,6.760302E+08\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,1.295212E+08,8.055514E+08\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,8.47033E+07,7.208481E+08\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,9.51305E+07,8.159786E+08\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,2.432158E+08,5.727628E+08\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,2.106298E+08,3.62133E+08\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,1.512651E+08,2.108679E+08\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,1.42755E+08,3.536229E+08\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,1.60155E+08,1.934679E+08\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,1.063892E+08,2.998571E+08\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,1.754015E+08,1.244556E+08\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,1.679477E+08,2.924033E+08\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,1.574056E+08,1.349977E+08\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,2.108855E+08,-7.588784E+07\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,2.00017E+08,1.241292E+08\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,1.883034E+08,3.124325E+08\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,1.02463E+08,3.124325E+08\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,1.59335E+08,1.530975E+08\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,1.767924E+08,-2.369486E+07\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,1.631143E+08,1.394194E+08\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,1.409942E+08,-1574768\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,1.35807E+08,1.342322E+08\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,1.145742E+08,2.488064E+08\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,2.057606E+08,4.304582E+07\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,3.202715E+08,-2.772257E+08\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,2.70449E+08,-5.476746E+08\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,2.217057E+08,-7.693804E+08\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,1.619672E+08,-6.074131E+08\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.344994E+08,-4.729137E+08\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,1.292817E+08,-3.43632E+08\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,1.601388E+08,-5.037708E+08\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,1.316825E+08,-3.720883E+08\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,1.548075E+08,-5.268958E+08\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,7.5214E+07,-4.516818E+08\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,1.218654E+08,-3.298164E+08\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,1.079307E+08,-2.218857E+08\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,1.19159E+08,-1.027267E+08\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,1.194101E+08,1.668342E+07\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,1.35448E+08,1.521314E+08\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,1.026369E+08,2.547683E+08\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,6.93766E+07,3.241449E+08\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,8.8577E+07,2.355679E+08\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,9.15262E+07,3.270941E+08\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,1.044458E+08,4.315399E+08\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,1.033631E+08,5.34903E+08\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,7.92687E+07,6.141718E+08\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,8.07614E+07,5.334104E+08\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,1.126621E+08,4.207483E+08\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,1.110332E+08,5.317815E+08\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.074186E+08,6.392001E+08\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,7.96142E+07,5.595859E+08\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,8.50268E+07,5.595859E+08\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.422641E+08,7.0185E+08\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,1.099667E+08,8.118167E+08\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,8.94027E+07,9.012194E+08\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.34082E+07,8.478112E+08\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,8.72311E+07,7.605801E+08\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,8.45586E+07,6.760215E+08\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,1.019243E+08,7.779458E+08\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,9.1473E+07,6.864728E+08\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,6.84364E+07,6.180364E+08\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,8.06301E+07,6.986664E+08\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,7.89056E+07,6.197608E+08\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,1.525461E+08,4.672147E+08\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.30207E+08,3.370077E+08\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,9.62961E+07,2.407116E+08\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,8.89174E+07,3.29629E+08\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.577231E+08,1.719059E+08\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,1.01273E+08,2.731789E+08\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,9.0796E+07,3.639749E+08\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,8.93984E+07,2.745765E+08\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,1.542754E+08,1.203011E+08\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,1.051208E+08,2.254219E+08\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,1.18828E+08,3.442499E+08\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,1.341863E+08,2.100636E+08\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,1.428026E+08,3.528662E+08\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,9.72904E+07,4.501566E+08\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,6.2845E+07,5.130016E+08\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,1.593838E+08,6.723854E+08\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,8.74072E+07,7.597926E+08\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,1.04783E+08,8.645756E+08\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,9.43257E+07,9.589013E+08\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,8.25578E+07,8.763435E+08\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,7.22575E+07,9.48601E+08\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,1.260507E+08,1.074652E+09\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,8.22325E+07,1.156884E+09\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,2.01318E+08,1.358202E+09\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,1.464406E+08,1.211762E+09\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.323176E+08,1.079444E+09\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.045339E+08,9.749101E+08\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.004224E+08,8.744877E+08\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.145591E+08,7.599286E+08\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,7.65796E+07,8.365082E+08\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,9.76959E+07,7.388123E+08\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,1.436097E+08,5.952026E+08\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,1.269819E+08,7.221844E+08\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,1.128038E+08,6.093807E+08\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,1.763843E+08,4.329964E+08\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,9.66007E+07,5.295971E+08\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,9.56532E+07,4.339439E+08\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,1.765606E+08,2.573833E+08\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,1.681005E+08,4.254838E+08\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,1.939883E+08,6.194721E+08\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,1.049564E+08,7.244285E+08\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,1.112484E+08,8.356769E+08\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,1.549017E+08,6.807752E+08\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.608956E+08,8.416708E+08\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,1.288904E+08,9.705612E+08\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,1.380559E+08,1.108617E+09\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,1.040586E+08,1.212676E+09\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,1.266389E+08,1.339315E+09\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,1.050438E+08,1.234271E+09\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,7.00377E+07,1.304308E+09\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.34539E+07,1.397762E+09\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,8.44979E+07,1.48226E+09\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,8.72006E+07,1.569461E+09\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,1.355066E+08,1.433954E+09\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,1.333523E+08,1.300602E+09\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,1.427717E+08,1.443374E+09\n11/4/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,8.52578E+07,1.528632E+09\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,8.54665E+07,1.443165E+09\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.71231E+07,1.530288E+09\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,1.486322E+08,1.381656E+09\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,1.365001E+08,1.518156E+09\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,6.62267E+07,1.584383E+09\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,8.31935E+07,1.501189E+09\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,9.97956E+07,1.600985E+09\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,1.029658E+08,1.703951E+09\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,1.027596E+08,1.80671E+09\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,9.84595E+07,1.708251E+09\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,9.30458E+07,1.615205E+09\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,1.246929E+08,1.490512E+09\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,9.18047E+07,1.582317E+09\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,8.12347E+07,1.663551E+09\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,7.91878E+07,1.584364E+09\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,8.66978E+07,1.671062E+09\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,5.82279E+07,1.729289E+09\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,5.49817E+07,1.674308E+09\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.92623E+07,1.575045E+09\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,1.159394E+08,1.459106E+09\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,1.229563E+08,1.33615E+09\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,1.063336E+08,1.229816E+09\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,1.274244E+08,1.35724E+09\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,6.99874E+07,1.427228E+09\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.7428E+07,1.3498E+09\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,1.301888E+08,1.219611E+09\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,1.153214E+08,1.10429E+09\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,1.07741E+08,9.965487E+08\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,9.61005E+07,1.092649E+09\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,8.94322E+07,1.003217E+09\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,2.344557E+08,1.237673E+09\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,1.367177E+08,1.100955E+09\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,1.966787E+08,1.297634E+09\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,8.54078E+07,1.383041E+09\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,4.53633E+07,1.428405E+09\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,6.32152E+07,1.49162E+09\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.17948E+07,1.49162E+09\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,5.68072E+07,1.434813E+09\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,8.61236E+07,1.520936E+09\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,1.195111E+08,1.401425E+09\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,8.1352E+07,1.320073E+09\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,1.068894E+08,1.213184E+09\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.60412E+07,1.299225E+09\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,9.64814E+07,1.395707E+09\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,9.05294E+07,1.486236E+09\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,1.019865E+08,1.588223E+09\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,1.495076E+08,1.438715E+09\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,1.045963E+08,1.543311E+09\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,9.83701E+07,1.641682E+09\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.21121E+07,1.569569E+09\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,1.078325E+08,1.461737E+09\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,8.85046E+07,1.550242E+09\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,6.07614E+07,1.611003E+09\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,1.323437E+08,1.478659E+09\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,2.085958E+08,1.270063E+09\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.799497E+08,1.090114E+09\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,1.088518E+08,1.198966E+09\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,2.152445E+08,9.83721E+08\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,1.161505E+08,1.099871E+09\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,1.945738E+08,9.052977E+08\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,2.543701E+08,6.509276E+08\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,1.64781E+08,8.157085E+08\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,1.636291E+08,6.520794E+08\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,1.32379E+08,7.844584E+08\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,1.707013E+08,9.551597E+08\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,9.19772E+07,1.047137E+09\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,1.216364E+08,1.168773E+09\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,9.44147E+07,1.263188E+09\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.005156E+08,1.363704E+09\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,9.64135E+07,1.460117E+09\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,8.00185E+07,1.540136E+09\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,1.259955E+08,1.41414E+09\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.048414E+08,1.518982E+09\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.180692E+08,1.400912E+09\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,1.13918E+08,1.51483E+09\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,1.168151E+08,1.398015E+09\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,9.83294E+07,1.496344E+09\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,9.37208E+07,1.590065E+09\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,1.506819E+08,1.740747E+09\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,1.674343E+08,1.573313E+09\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,1.696383E+08,1.742951E+09\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,8.82737E+07,1.831225E+09\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,8.2328E+07,1.913553E+09\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,1.174687E+08,2.031021E+09\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,7.48343E+07,1.956187E+09\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,9.88274E+07,1.85736E+09\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.047016E+08,1.962061E+09\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.54146E+08,1.807915E+09\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,1.53743E+08,1.654172E+09\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,9.82506E+07,1.752423E+09\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,1.016263E+08,1.854049E+09\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,1.761153E+08,1.677934E+09\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,1.169442E+08,1.794878E+09\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.630581E+08,1.63182E+09\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.208898E+08,1.51093E+09\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.03492E+08,1.614422E+09\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.196569E+08,1.494765E+09\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,1.422045E+08,1.352561E+09\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,1.015272E+08,1.454088E+09\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,9.96267E+07,1.553714E+09\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,8.89589E+07,1.642673E+09\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,7.87143E+07,1.721388E+09\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,7.7253E+07,1.644135E+09\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.690036E+08,1.475131E+09\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,1.40661E+08,1.33447E+09\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,1.125858E+08,1.447056E+09\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,1.000139E+08,1.54707E+09\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,1.728738E+08,1.374196E+09\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.670166E+08,1.207179E+09\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,1.32183E+08,1.339362E+09\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,1.570263E+08,1.496389E+09\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,1.041517E+08,1.60054E+09\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,1.051923E+08,1.705733E+09\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,6.82128E+07,1.773946E+09\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.56864E+07,1.859632E+09\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.36114E+07,1.786021E+09\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,8.81096E+07,1.87413E+09\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,1.003077E+08,1.773822E+09\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,1.349505E+08,1.908773E+09\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,8.39714E+07,1.992744E+09\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,1.014617E+08,2.094206E+09\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,9.28565E+07,2.187063E+09\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,9.79693E+07,2.089094E+09\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,7.58278E+07,2.164921E+09\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,8.53562E+07,2.079565E+09\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.06377E+08,2.185942E+09\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,9.34954E+07,2.092447E+09\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,8.3648E+07,2.176095E+09\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,8.68714E+07,2.262966E+09\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,6.64168E+07,2.329383E+09\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,7.22439E+07,2.257139E+09\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,1.548973E+08,2.102242E+09\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,9.73841E+07,2.199626E+09\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,6.36763E+07,2.263302E+09\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,1.115126E+08,2.15179E+09\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,8.8998E+07,2.240787E+09\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,6.15195E+07,2.302307E+09\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,6.1108E+07,2.363415E+09\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,7.19611E+07,2.435376E+09\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,6.60485E+07,2.369328E+09\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,6.4139E+07,2.433467E+09\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,7.62562E+07,2.509723E+09\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,6.45682E+07,2.574291E+09\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.49852E+07,2.509306E+09\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,5.54952E+07,2.564801E+09\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,9.20356E+07,2.656837E+09\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,7.86503E+07,2.735487E+09\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,6.50257E+07,2.800513E+09\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.69925E+07,2.857506E+09\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,6.8703E+07,2.788803E+09\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,1.061255E+08,2.682677E+09\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,8.1991E+07,2.764668E+09\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,8.73494E+07,2.852017E+09\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.47768E+07,2.936794E+09\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,1.051448E+08,3.041939E+09\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,8.58331E+07,3.127772E+09\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,9.99651E+07,3.027807E+09\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,7.04472E+07,2.95736E+09\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,9.60182E+07,2.861342E+09\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,8.26941E+07,2.944036E+09\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,8.42166E+07,2.859819E+09\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,7.13261E+07,2.931145E+09\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,7.03968E+07,2.860749E+09\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.03217E+07,2.95107E+09\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,5.23162E+07,3.003387E+09\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.28948E+07,3.056281E+09\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,6.16767E+07,2.994605E+09\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,1.080553E+08,2.886549E+09\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,7.29536E+07,2.959503E+09\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,9.89224E+07,2.86058E+09\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,6.42262E+07,2.924807E+09\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,5.85636E+07,2.98337E+09\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,1.112974E+08,2.872073E+09\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,7.99786E+07,2.952051E+09\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,1.444126E+08,2.807639E+09\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,1.242563E+08,2.931895E+09\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,6.74803E+07,2.864415E+09\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,6.76125E+07,2.932027E+09\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,6.55456E+07,2.997573E+09\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,5.64175E+07,3.05399E+09\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,7.67825E+07,2.977208E+09\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,6.91065E+07,3.046314E+09\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.04086E+07,2.965905E+09\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,1.041051E+08,3.070011E+09\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,1.830735E+08,2.886937E+09\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.890752E+08,2.697862E+09\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,9.11084E+07,2.78897E+09\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.525572E+08,2.636413E+09\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,9.46282E+07,2.731041E+09\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,1.355078E+08,2.595533E+09\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,1.169994E+08,2.712533E+09\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,7.44512E+07,2.786984E+09\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,7.36054E+07,2.713379E+09\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,6.89616E+07,2.78234E+09\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,5.72282E+07,2.839568E+09\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.39872E+08,2.699696E+09\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,7.51886E+07,2.774885E+09\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,5.89646E+07,2.833849E+09\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,7.27256E+07,2.906575E+09\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,6.77458E+07,2.974321E+09\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,7.60677E+07,2.898253E+09\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.3806E+07,2.962059E+09\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,4.72561E+07,3.009315E+09\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,4.78206E+07,2.961495E+09\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,5.82675E+07,2.903227E+09\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,6.58862E+07,2.969113E+09\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,7.23226E+07,2.896791E+09\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,5.73714E+07,2.839419E+09\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,8.50003E+07,2.754419E+09\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,1.020151E+08,2.856434E+09\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,6.41025E+07,2.792332E+09\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,8.84825E+07,2.703849E+09\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,6.71543E+07,2.771003E+09\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,6.67374E+07,2.837741E+09\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.174083E+08,2.720333E+09\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,7.63573E+07,2.643975E+09\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.160432E+08,2.760018E+09\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,1.511539E+08,2.911172E+09\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,9.494E+07,3.006112E+09\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,1.214495E+08,2.884663E+09\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.254334E+08,2.759229E+09\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,1.110883E+08,2.648141E+09\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.071375E+08,2.755279E+09\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,1.500097E+08,2.605269E+09\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.035058E+08,2.708775E+09\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,9.50859E+07,2.613689E+09\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,1.301387E+08,2.48355E+09\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,1.776124E+08,2.305938E+09\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,1.571704E+08,2.463109E+09\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,1.214662E+08,2.584575E+09\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,1.047379E+08,2.479837E+09\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,1.476036E+08,2.332233E+09\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,1.860549E+08,2.518288E+09\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,2.099787E+08,2.30831E+09\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,2.216482E+08,2.086661E+09\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.300502E+08,1.856611E+09\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.15307E+08,2.071918E+09\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,3.803363E+08,1.691582E+09\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,2.70175E+08,1.421407E+09\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,2.142533E+08,1.63566E+09\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,1.295995E+08,1.76526E+09\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,1.544764E+08,1.919736E+09\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,1.514775E+08,1.768259E+09\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,1.546817E+08,1.92294E+09\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,1.168401E+08,2.03978E+09\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,8.2755E+07,1.957026E+09\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.06688E+08,2.063714E+09\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,1.423653E+08,1.921348E+09\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,1.130267E+08,2.034375E+09\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.468571E+08,2.181232E+09\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,9.35399E+07,2.274772E+09\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,9.31773E+07,2.181595E+09\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,9.14689E+07,2.273063E+09\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.067421E+08,2.379805E+09\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,8.94722E+07,2.469278E+09\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,6.59176E+07,2.535195E+09\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,5.42991E+07,2.589495E+09\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,8.99675E+07,2.499527E+09\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,8.49915E+07,2.584518E+09\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,8.03352E+07,2.664854E+09\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,8.03773E+07,2.745231E+09\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,7.58919E+07,2.821123E+09\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,8.22299E+07,2.738893E+09\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,7.25898E+07,2.811483E+09\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,1.421739E+08,2.953657E+09\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,6.56752E+07,3.019332E+09\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,7.90198E+07,2.940312E+09\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,5.63859E+07,2.996698E+09\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.78901E+07,2.938808E+09\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,1.038069E+08,2.835001E+09\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.44562E+07,2.909457E+09\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,6.88735E+07,2.978331E+09\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,9.12253E+07,2.887105E+09\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,9.09898E+07,2.978095E+09\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,1.084651E+08,2.86963E+09\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,1.25039E+08,2.744591E+09\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,1.592371E+08,2.585354E+09\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,1.586288E+08,2.743983E+09\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,2.021238E+08,2.541859E+09\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.895569E+08,2.352302E+09\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.589109E+08,2.093391E+09\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,2.525237E+08,2.345915E+09\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,2.569953E+08,2.60291E+09\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,2.433649E+08,2.359545E+09\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,1.481941E+08,2.507739E+09\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,1.206218E+08,2.628361E+09\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,4.29634E+07,2.671324E+09\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,5.72119E+07,2.728536E+09\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,7.9532E+07,2.808068E+09\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,7.34483E+07,2.73462E+09\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,1.302817E+08,2.604338E+09\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,1.214085E+08,2.48293E+09\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,1.694406E+08,2.313489E+09\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.089239E+08,2.104566E+09\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,1.250696E+08,2.229635E+09\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,1.460561E+08,2.375691E+09\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,1.576098E+08,2.218082E+09\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,1.440602E+08,2.074021E+09\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.143722E+08,1.859649E+09\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,1.92575E+08,1.667074E+09\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,1.75449E+08,1.491625E+09\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,2.117161E+08,1.703341E+09\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,1.308767E+08,1.834218E+09\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,1.227043E+08,1.956922E+09\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.737079E+08,2.13063E+09\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,1.173577E+08,2.013272E+09\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,9.17101E+07,2.104983E+09\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,1.336462E+08,1.971336E+09\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,1.676865E+08,1.80365E+09\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,1.733125E+08,1.976962E+09\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,1.975085E+08,1.779454E+09\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,1.627071E+08,1.942161E+09\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,1.238674E+08,2.066028E+09\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,1.339685E+08,1.93206E+09\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,9.77312E+07,2.029791E+09\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,1.255901E+08,1.904201E+09\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,8.70842E+07,1.817117E+09\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,9.61426E+07,1.913259E+09\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,9.02272E+07,2.003486E+09\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,9.72269E+07,2.100713E+09\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,9.36175E+07,2.194331E+09\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,7.6896E+07,2.271227E+09\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,8.00594E+07,2.351286E+09\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,9.13855E+07,2.259901E+09\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,1.4003E+08,2.399931E+09\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,7.42576E+07,2.325673E+09\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,7.22159E+07,2.397889E+09\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,7.29441E+07,2.324945E+09\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,7.25793E+07,2.252365E+09\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,1.079803E+08,2.144385E+09\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,8.7369E+07,2.231754E+09\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,1.102066E+08,2.121547E+09\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,1.143434E+08,2.007204E+09\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,7.68397E+07,2.084044E+09\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,1.865108E+08,1.897533E+09\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,8.96513E+07,1.987184E+09\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,1.566998E+08,1.830484E+09\n3/11/2015 12:00:00 AM,205.29,205.5,204.4,204.5,1.090654E+08,1.721419E+09\n3/12/2015 12:00:00 AM,205.24,207.18,205.2,207.1,9.38436E+07,1.815263E+09\n3/13/2015 12:00:00 AM,206.76,207.93,204.58,205.83,1.623816E+08,1.652881E+09\n3/16/2015 12:00:00 AM,206.68,208.69,205.86,208.58,1.356771E+08,1.788558E+09\n3/17/2015 12:00:00 AM,207.65,208.42,206.98,207.96,9.4461E+07,1.694097E+09\n3/18/2015 12:00:00 AM,207.43,211.27,206.62,210.46,2.285647E+08,1.922662E+09\n3/19/2015 12:00:00 AM,210.04,210.47,209.03,209.5,1.177756E+08,1.804886E+09\n3/20/2015 12:00:00 AM,209.66,211.02,209.49,210.41,1.775602E+08,1.982446E+09\n3/23/2015 12:00:00 AM,210.43,211.11,210,210,7.16468E+07,1.910799E+09\n3/24/2015 12:00:00 AM,209.87,210.4,208.74,208.82,7.77182E+07,1.833081E+09\n3/25/2015 12:00:00 AM,209.01,209.35,205.71,205.76,1.592963E+08,1.673785E+09\n3/26/2015 12:00:00 AM,204.96,206.37,204.12,205.27,1.529197E+08,1.520865E+09\n3/27/2015 12:00:00 AM,205.16,205.95,204.9,205.74,1.170551E+08,1.637921E+09\n3/30/2015 12:00:00 AM,206.96,208.61,206.96,208.25,9.59869E+07,1.733907E+09\n3/31/2015 12:00:00 AM,207.26,208.1,206.36,206.43,1.265759E+08,1.607332E+09\n4/1/2015 12:00:00 AM,206.36,206.42,204.51,205.7,1.370568E+08,1.470275E+09\n4/2/2015 12:00:00 AM,205.58,206.98,205.4,206.43,8.68465E+07,1.557121E+09\n4/6/2015 12:00:00 AM,205.39,208.45,205.21,207.83,1.139866E+08,1.671108E+09\n4/7/2015 12:00:00 AM,207.86,208.76,207.24,207.28,8.10861E+07,1.590022E+09\n4/8/2015 12:00:00 AM,207.53,208.51,207.08,207.98,8.92712E+07,1.679293E+09\n4/9/2015 12:00:00 AM,207.82,209.18,207.19,208.9,8.54431E+07,1.764736E+09\n4/10/2015 12:00:00 AM,209.21,210.09,208.96,210.04,7.25113E+07,1.837247E+09\n4/13/2015 12:00:00 AM,209.84,210.63,209.03,209.09,7.4362E+07,1.762885E+09\n4/14/2015 12:00:00 AM,208.86,209.71,208.1,209.49,7.47965E+07,1.837682E+09\n4/15/2015 12:00:00 AM,210.07,211.04,209.95,210.43,9.9416E+07,1.937098E+09\n4/16/2015 12:00:00 AM,210.04,210.98,209.79,210.37,6.88254E+07,1.868272E+09\n4/17/2015 12:00:00 AM,208.98,209.23,207.01,207.95,1.910369E+08,1.677235E+09\n4/20/2015 12:00:00 AM,209.09,210.25,208.96,209.85,9.20891E+07,1.769325E+09\n4/21/2015 12:00:00 AM,210.65,210.86,209.24,209.6,7.13563E+07,1.697968E+09\n4/22/2015 12:00:00 AM,210.04,210.85,208.9,210.63,7.81247E+07,1.776093E+09\n4/23/2015 12:00:00 AM,210.17,211.94,210.01,211.16,1.023921E+08,1.878485E+09\n4/24/2015 10:39:31 AM,211.7,211.76,211.11,211.5,1.719313E+07,1.895678E+09"
  },
  {
    "path": "Tests/TestData/spy_with_rma.csv",
    "content": "time,open,high,low,close,SMA5,SMA10,SMA15,RMA5\n1640876400,478.2,478.99,477.99,478.77,477.2653333,477.424,477.986,477.8273333\n1640878200,478.76,478.83,478.14,478.19,477.3046667,477.615,478.106,477.7956667\n1640880000,478.15,478.42,478.02,478.31,477.416,477.767,478.186,477.835\n1640881800,478.31,478.4,478.05,478.245,477.4836667,477.9165,478.343,477.9101667\n1640883600,478.23,478.4,477.8,478.02,477.571,478.0015,478.307,477.8765\n1640885400,478.03,478.335,477.89,478.33,477.689,478.1025,478.219,477.8055\n1640887200,478.33,478.33,477.92,478.06,477.8076667,478.1495,478.193,477.8511667\n1640889000,478.06,478.36,478.04,478.24,477.9043333,478.1825,478.179,477.9008333\n1640890800,478.24,478.24,477.76,478.13,477.9963333,478.2495,478.156,477.9028333\n1640892600,478.11,478.31,478,478.14,478.061,478.2435,478.18,477.9975\n1640894400,478.14,478.14,477.55,477.57,478.0776667,478.1235,478.028,477.9821667\n1640896200,477.56,477.72,475.68,476.15,477.9816667,477.9195,477.646,477.7081667\n1640961000,475.64,476.86,475.45,475.67,477.8323333,477.6555,477.132,477.3088333\n1640962800,475.7,476.26,474.88,476,477.735,477.431,476.706,477.01\n1640964600,476.02,476.04,475.1,475.79,477.5743333,477.208,476.236,476.6023333\n1640966400,475.81,475.95,475.35,475.91,477.3836667,476.966,475.904,476.3216667\n1640968200,475.88,475.93,475.27,475.32,477.1923333,476.692,475.738,476.2383333\n1640970000,475.33,475.64,474.94,475.16,476.9823333,476.384,475.636,476.2343333\n1640971800,475.18,476.17,475.08,476.13,476.8413333,476.184,475.662,476.3193333\n1640973600,476.14,476.35,476.05,476.32,476.728,476.002,475.768,476.494\n1640975400,476.27,476.49,475.88,476.33,476.5946667,475.878,475.852,476.5686667\n1640977200,476.33,476.66,475.85,476.09,476.4633333,475.872,476.006,476.5973333\n1640979000,476.05,476.33,475.75,475.95,476.3106667,475.9,476.164,476.5746667\n1640980800,475.96,476.54,475.87,476.45,476.1986667,475.945,476.228,476.4816667\n1640982600,476.45,476.7,474.68,474.89,475.982,475.855,475.942,476.069\n1641220200,476.3,477.71,473.87,474.9,475.804,475.754,475.656,475.706\n1641222000,474.95,476.75,474.78,476.75,475.844,475.897,475.788,475.735\n1641223800,476.75,476.78,475.61,476.17,475.8773333,475.998,475.832,475.7113333\n1641225600,476.16,476.19,475.06,475.53,475.846,475.938,475.648,475.556\n1641227400,475.55,475.83,474.45,475.35,475.8166667,475.841,475.74,475.7156667\n1641229200,475.27,475.99,475.05,475.93,475.818,475.801,475.946,475.963\n1641231000,475.94,475.94,475.48,475.59,475.836,475.751,475.714,475.799\n1641232800,475.6,476.18,475.35,476.07,475.8966667,475.763,475.694,475.8276667\n1641234600,476.09,476.77,475.87,476.74,475.9373333,475.792,475.936,476.0813333\n1641236400,476.72,477.07,476.6,476.91,475.9766667,475.994,476.248,476.2306667\n1641238200,476.92,477.68,476.77,477.22,476.036,476.226,476.506,476.316\n1641240000,477.21,477.53,477.01,477.4,476.1233333,476.291,476.868,476.7003333\n1641241800,477.42,477.85,476.67,477.76,476.244,476.45,477.206,477\n1641306600,479.22,479.96,479.06,479.67,476.4586667,476.864,477.792,477.3866667\n1641308400,479.68,479.7,478.72,479.57,476.7706667,477.286,478.324,477.8086667\n1641310200,479.58,479.75,477.51,477.62,476.952,477.455,478.404,477.901\n1641312000,477.63,477.65,476.44,476.93,476.964,477.589,478.31,477.685\n1641313800,476.95,477.99,476.83,477.46,477.05,477.728,478.25,477.572\n1641315600,477.46,477.95,477.11,477.55,477.1846667,477.809,477.826,477.2016667\n1641317400,477.52,477.61,476.72,476.8,477.2813333,477.798,477.272,476.7553333\n1641319200,476.8,477.32,476.61,476.78,477.338,477.754,477.104,476.688\n1641321000,476.8,476.81,475.59,475.72,477.3466667,477.586,476.862,476.6226667\n1641322800,475.7,476.65,475.7,476.55,477.3786667,477.465,476.68,476.5936667\n1641324600,476.53,477.56,476.51,477.41,477.4233333,477.239,476.652,476.8363333\n1641326400,477.42,478.31,477.39,478.25,477.5126667,477.107,476.942,477.3476667\n1641328200,478.26,478.96,477.46,477.51,477.532,477.096,477.088,477.524\n1641393000,477.16,477.64,476.14,477.21,477.5193333,477.124,477.386,477.7813333\n1641394800,477.21,477.98,476.76,477.72,477.5166667,477.15,477.62,477.9866667\n1641396600,477.72,477.72,476.93,477.29,477.358,477.124,477.596,477.83\n1641398400,477.29,477.39,476.48,477.23,477.202,477.167,477.392,477.427\n1641400200,477.23,477.27,476.3,476.57,477.132,477.146,477.204,477.19\n1641402000,476.53,477.25,476.37,477.15,477.1466667,477.289,477.192,477.0496667\n1641403800,477.13,477.17,475.87,475.95,477.046,477.229,476.838,476.655\n1641405600,475.92,476.03,475.31,475.86,476.9333333,477.074,476.552,476.4113333\n1641407400,475.86,476.13,475.59,475.84,476.8693333,476.833,476.274,476.3103333\n1641409200,475.84,476.91,473.23,473.41,476.6446667,476.423,475.642,475.8636667\n1641411000,473.41,473.86,471.115,471.7,476.3766667,475.872,474.552,475.0566667\n1641412800,471.7,471.7,469.95,470.3,475.96,475.13,473.422,474.252\n1641414600,470.29,471.19,468.29,468.43,475.3613333,474.244,471.936,473.0533333\n1641479400,467.94,470.39,466.81,467.04,474.614,473.225,470.176,471.565\n1641481200,467.04,468.64,465.45,467.68,473.9586667,472.336,469.03,470.6526667\n1641483000,467.68,469.72,467.68,468.68,473.39,471.489,468.426,470.327\n1641484800,468.73,469.98,468.07,468.58,472.7806667,470.752,468.082,470.1106667\n1641486600,468.59,469.34,468.05,469.13,472.2366667,470.079,468.222,470.3796667\n1641488400,469.22,469.75,468.69,469.64,471.7306667,469.459,468.742,471.0136667\n1641490200,469.615,470.8,469.32,469.59,471.2653333,469.077,469.124,471.3123333\n1641492000,469.58,469.97,468.54,468.64,470.698,468.771,469.116,471.043\n1641493800,468.64,469.15,468.41,469.11,470.242,468.652,469.222,470.812\n1641495600,469.04,469.6,468.28,468.73,469.7666667,468.682,469.142,470.2266667\n1641497400,468.75,469.68,468.58,469.4,469.3373333,468.918,469.094,469.5133333\n1641499200,469.38,470.17,468.36,468.96,469.0406667,469.046,468.968,468.9626667\n1641501000,468.95,469.09,467.09,467.93,468.7893333,468.971,468.826,468.6443333\n1641565800,467.95,469.2,466.74,468.65,468.6793333,468.978,468.734,468.4353333\n1641567600,468.68,468.73,466.83,467,468.584,468.765,468.388,468.207\n1641569400,466.9,467.34,464.65,465.26,468.4653333,468.327,467.56,467.6983333\n1641571200,465.27,466.52,464.69,466.45,468.3833333,468.013,467.058,467.4283333\n1641573000,466.44,468.09,466.1,467.64,468.314,467.913,467,467.401\n1641574800,467.66,467.8,466.77,467.08,468.214,467.71,466.686,467.19\n1641576600,467.04,467.43,466.48,467.27,468.09,467.564,466.74,467.266\n1641578400,467.29,467.68,466.81,467.03,467.916,467.327,467.094,467.683\n1641580200,467.03,467.53,466.59,466.89,467.736,467.12,467.182,467.798\n1641582000,466.9,467.14,466.1,466.57,467.598,466.984,466.968,467.582\n1641583800,466.55,467.72,466.39,467.46,467.488,466.865,467.044,467.667\n1641585600,467.48,467.97,466.66,466.96,467.37,466.861,466.982,467.491\n1641587400,466.96,467.48,465.92,466.12,467.1513333,466.947,466.8,467.0043333\n1641825000,462.7,462.99,459.02,459.36,466.5113333,466.238,465.294,465.5673333\n1641826800,459.33,459.57,457.36,458.17,465.8606667,465.291,463.614,464.1836667\n1641828600,458.15,458.72,456.6,457.69,465.13,464.352,461.66,462.438\n1641830400,457.77,460.17,457.09,460.06,464.6673333,463.631,460.28,461.3163333\n1641832200,460.06,460.06,458.43,459.53,464.2853333,462.881,458.962,460.3663333\n1641834000,459.455,459.53,458.05,458.36,463.746,462.028,458.762,460.48\n1641835800,458.31,460.18,457.97,459.24,463.186,461.295,458.976,460.867\n1641837600,459.25,460.87,459.1,460.52,462.7486667,460.601,459.542,461.6896667\n1641839400,460.52,462.16,460.17,461.88,462.3893333,460.093,459.906,462.2023333\n1641841200,461.89,463.39,461.71,463.14,462.13,459.795,460.628,462.963\n1641843000,463.11,463.86,462.12,462.97,461.8686667,460.156,461.55,463.2626667\n1641844800,462.97,463.49,461.6,462.68,461.6093333,460.607,462.238,463.2403333\n1641846600,462.66,465.73,462.23,465.52,461.48,461.39,463.238,463.328\n1641911400,465.23,465.43,462.05,462.82,461.204,461.666,463.426,462.964\n1641913200,462.86,464.56,462.56,464.08,461.068,462.121,463.614,462.561\n1641915000,464.1,464.96,462.35,463.38,461.336,462.623,463.696,462.409\n1641916800,463.44,466.74,463.35,466.55,461.8946667,463.354,464.47,463.0106667\n1641918600,466.54,468.05,466.21,467.55,462.552,464.057,464.876,463.371\n1641920400,467.58,467.95,466.67,466.81,463.002,464.55,465.674,464.126\n1641922200,466.8,467.83,466.69,467.77,463.5513333,465.013,466.412,464.9503333\n1641924000,467.76,468.37,467,468.08,464.1993333,465.524,467.352,466.0273333\n1641925800,468.11,468.57,468,468.47,464.8146667,466.103,467.736,466.4476667\n1641927600,468.46,468.5,467.715,468.4,465.34,466.391,467.906,466.855\n1641929400,468.37,469.36,468.04,468.85,465.8046667,466.994,468.314,467.1246667\n1641931200,468.89,469.63,468.89,469.45,466.2253333,467.531,468.65,467.3443333\n1641933000,469.42,469.85,468.545,469.75,466.6773333,468.168,468.984,467.4933333\n1641997800,471.59,472.68,470.895,472.62,467.34,468.775,469.814,468.379\n1641999600,472.7,473.2,472.08,472.38,467.7973333,469.258,470.61,469.1493333\n1642001400,472.38,472.5,470.12,470.73,468.3246667,469.65,470.986,469.6606667\n1642003200,470.75,471.24,468.94,470.38,468.7446667,469.911,471.172,470.0056667\n1642005000,470.42,471.53,470.34,470.975,469.251,470.2005,471.417,470.4675\n1642006800,471,471.27,470.25,470.93,469.543,470.4465,471.079,470.1755\n1642008600,470.94,471.86,470.88,471.69,469.819,470.7755,470.941,469.9845\n1642010400,471.75,471.76,470.69,470.84,470.0876667,470.9745,470.963,470.0761667\n1642012200,470.835,471.13,470.18,470.34,470.259,471.0635,470.955,470.1505\n1642014000,470.32,471.17,469.77,471.13,470.4623333,471.2015,470.986,470.2468333\n1642015800,471.12,471.17,470.29,470.92,470.6256667,471.0315,470.984,470.5781667\n1642017600,470.92,471.07,470.13,470.56,470.7696667,470.8495,470.758,470.6781667\n1642019400,470.52,471.67,470.17,471.08,470.9183333,470.8845,470.806,470.8398333\n1642084200,472.19,472.88,471.77,472.36,471.1123333,471.0825,471.21,471.2398333\n1642086000,472.42,472.5,470.51,471.16,471.2063333,471.101,471.216,471.3213333\n1642087800,471.105,471.37,469.18,469.96,471.029,471.004,471.024,471.049\n1642089600,469.89,471.08,469.44,470.98,470.9356667,470.933,471.108,471.1106667\n1642091400,470.95,471.35,470.685,470.9,470.947,470.939,471.072,471.08\n1642093200,470.9,470.9,467.2,467.68,470.767,470.673,470.136,470.23\n1642095000,467.72,468.54,466.91,467.63,470.544,470.323,469.43,469.651\n1642096800,467.59,468.86,466.98,468.49,470.3813333,470.08,469.136,469.4373333\n1642098600,468.45,468.7,467.8,468.65,470.1786667,469.889,468.67,468.9596667\n1642100400,468.66,469.2,467.38,467.45,469.9526667,469.526,467.98,468.4066667\n1642102200,467.42,467.57,466.78,467.34,469.7526667,469.024,467.912,468.6406667\n1642104000,467.37,467.37,465.55,466.25,469.4273333,468.533,467.636,468.5303333\n1642105800,466.24,466.54,463.48,464.52,469.0006667,467.989,466.842,467.8536667\n1642170600,461.19,464.49,460.75,464.4,468.59,467.331,465.992,467.251\n1642172400,464.38,464.85,462.68,463.04,468.054,466.545,465.11,466.619\n1642174200,463.09,463.28,461.8,462.61,467.404,466.038,464.164,465.53\n1642176000,462.62,463.4,460.72,461.45,466.7566667,465.42,463.204,464.5406667\n1642177800,461.46,463.34,461.09,462.94,466.2886667,464.865,462.888,464.3116667\n1642179600,462.93,463.29,461.78,462.38,465.7153333,464.238,462.484,463.9613333\n1642181400,462.28,462.89,460.55,460.65,465.032,463.558,462.006,463.48\n1642183200,460.59,461.155,459.91,460.52,464.5546667,462.876,461.588,463.2666667\n1642185000,460.42,462.16,459.99,461.98,464.178,462.449,461.694,463.423\n1642186800,461.97,462.62,461.465,461.48,463.7106667,462.145,461.402,462.9676667\n1642188600,461.49,463.12,461.46,462.24,463.2833333,461.929,461.374,462.7283333\n1642190400,462.35,464.23,462.31,463.66,463.0306667,461.991,461.976,463.0156667\n1642192200,463.68,465.08,463.68,464.72,462.856,462.202,462.816,463.47\n1642516200,459.74,459.96,457.14,458.18,462.318,461.875,462.056,462.499\n1642518000,458.1,459.54,457.46,459.11,461.9573333,461.492,461.582,462.0473333\n1642519800,459.08,459.08,457.24,457.5,461.4973333,461.004,460.634,461.1273333\n1642521600,457.55,458.05,456.82,457.49,461.1273333,460.688,459.4,459.8393333\n1642523400,457.47,458.7,456.58,458.09,460.826,460.445,458.074,458.455\n1642525200,458.07,458.28,456.59,456.85,460.5193333,459.932,457.808,458.3953333\n1642527000,456.84,457.02,455.73,455.8,460.0433333,459.364,457.146,457.8253333\n1642528800,455.81,456.78,455.47,456.13,459.6266667,458.753,456.872,457.7456667\n1642530600,456.06,457.31,455.8,457.15,459.3933333,458.102,456.804,458.0953333\n1642532400,457.1,457.61,456.75,457.21,459.1726667,457.351,456.628,458.4496667\n1642534200,457.18,458.9,457.16,458.42,458.9353333,457.375,456.942,458.5023333\n1642536000,458.435,458.65,456.39,457.03,458.6386667,457.167,457.188,458.6596667\n1642537800,457.04,457.24,455.34,456.51,458.2566667,457.068,457.264,458.4526667\n1642602600,458.13,459.59,457.76,459.48,457.978,457.267,457.73,458.441\n1642604400,459.48,459.53,456.33,456.39,457.4226667,457.097,457.566,457.8916667\n1642606200,456.41,456.73,455.49,456.29,457.2966667,457.041,457.14,457.3956667\n1642608000,456.175,456.59,454.73,455.61,457.0633333,457.022,456.856,456.8973333\n1642609800,455.63,456.86,454.9,456.74,457.0126667,457.083,456.902,456.8316667\n1642611600,456.745,458.18,456.7,458.08,457.052,457.176,456.622,456.498\n1642613400,458.09,458.23,457.08,458.09,457.052,457.264,456.962,456.75\n1642615200,458.11,458.17,456.84,456.89,457.0546667,457.111,457.082,457.0256667\n1642617000,456.9,457.27,456.09,456.45,457.098,457.053,457.25,457.295\n1642618800,456.4,456.63,454.43,454.49,456.9886667,456.851,456.8,456.9376667\n1642620600,454.45,455.9,454.28,455.33,456.8673333,456.436,456.25,456.6813333\n1642622400,455.37,456.11,454.45,454.53,456.6886667,456.25,455.538,455.9766667\n1642624200,454.52,454.64,451.47,451.79,456.2466667,455.8,454.518,454.9646667\n1642689000,453.75,457.01,453.51,456.68,456.2233333,455.907,454.564,454.8803333\n1642690800,456.73,456.96,455.54,456.5,456.2226667,455.883,454.966,455.3056667\n1642692600,456.48,458.37,456.48,458.07,456.1286667,455.882,455.514,455.7606667\n1642694400,458.07,458.74,457.26,458.01,456.2366667,455.874,456.21,456.5726667\n1642696200,457.985,458.21,456.95,457.5,456.3173333,455.935,457.352,457.7343333\n1642698000,457.53,457.84,456.78,457.47,456.4413333,456.037,457.51,457.9143333\n1642699800,457.48,457.79,456.48,456.74,456.4413333,456.262,457.558,457.7373333\n1642701600,456.71,456.71,455.31,455.68,456.2813333,456.297,457.08,457.0643333\n1642703400,455.71,456.07,455.17,455.26,456.0926667,456.37,456.53,456.2526667\n1642705200,455.29,456.565,454.33,454.36,455.924,456.627,455.902,455.199\n1642707000,454.34,454.36,453.03,453.28,455.7126667,456.287,455.064,454.4896667\n1642708800,453.26,453.87,450.265,450.69,455.4593333,455.706,453.854,453.6073333\n1642710600,450.7,450.83,446.26,446.81,454.8913333,454.58,452.08,452.3913333\n1642775400,445.59,446.67,443.15,443.66,454.1666667,453.145,449.76,450.7816667\n1642777200,443.64,444.31,440.66,442.78,453.566,451.673,447.444,449.337\n1642779000,442.81,447.135,442.37,446.09,452.86,450.535,446.006,448.331\n1642780800,446.11,448.05,445.16,447.46,452.2573333,449.607,445.36,448.0103333\n1642782600,447.45,447.45,443.58,444.51,451.3533333,448.49,444.9,447.7633333\n1642784400,444.49,444.99,442.9,443.59,450.392,447.323,444.886,447.955\n1642786200,443.48,444.35,442.12,442.87,449.4166667,446.174,444.904,448.1466667\n1642788000,442.85,444.2,441.49,442,448.3853333,445.046,444.086,447.4253333\n1642789800,442.02,443.83,441.78,442.21,447.4166667,444.198,443.036,446.2546667\n1642791600,442.22,443.29,441.11,441.21,446.452,443.638,442.376,445.19\n1642793400,441.23,442.28,439.865,439.95,445.4313333,443.267,441.648,443.8123333\n1642795200,439.945,440.43,438.02,438.5,444.374,442.839,440.774,442.309\n1642797000,438.47,441.24,437.97,438.02,443.3566667,442.032,439.978,441.3026667\n1643034600,432.07,433.46,428.47,429.06,441.9146667,440.192,437.348,439.0706667\n1643036400,429.08,430.34,425.8,428.61,440.7013333,438.602,434.828,436.9273333\n1643038200,428.53,430.93,427.78,428.77,439.7086667,437.12,432.592,435.1806667\n1643040000,428.68,428.8,426.47,427.73,438.7053333,435.606,430.438,433.5373333\n1643041800,427.76,428.05,422.89,425.76,437.35,433.982,427.986,431.354\n1643043600,425.76,425.77,420.78,422.6,435.6926667,432.021,426.694,430.3656667\n1643045400,422.5,426.36,421.34,425.32,434.4133333,430.432,426.036,430.0173333\n1643047200,425.26,429.23,424.73,426.29,433.26,429.066,425.54,429.734\n1643049000,426.26,431.33,426.2,431.26,432.486,428.342,426.246,430.39\n1643050800,431.27,433.03,427.87,428.48,431.5846667,427.388,426.79,430.9866667\n1643052600,428.47,430.59,426.04,430.31,430.7913333,427.513,428.332,431.6103333\n1643054400,430.38,434.04,429.91,433.05,430.2473333,427.957,429.878,432.1683333\n1643056200,433.08,440.38,432.16,439.89,430.2433333,429.069,432.598,433.7723333\n1643121000,433.07,434.67,428.41,429.12,429.618,429.208,432.17,432.58\n1643122800,429.14,432.48,427.15,432.48,429.2486667,429.88,432.97,432.3386667\n1643124600,432.45,433.98,430.42,431.12,429.386,430.732,433.132,431.786\n1643126400,430.99,432.97,429.87,432.22,429.6266667,431.422,432.966,431.1706667\n1643128200,432.16,432.39,429.24,429.81,429.696,431.774,430.95,428.872\n1643130000,429.8,432.84,429.5,432.39,430.0066667,431.887,431.604,429.7236667\n1643131800,432.37,432.37,430.04,431.53,430.3913333,432.192,431.414,429.6133333\n1643133600,431.57,433.73,430.17,433.57,431.1226667,432.518,431.904,430.5086667\n1643135400,433.51,436.33,433.19,436.3,431.8546667,432.843,432.72,431.7316667\n1643137200,436.37,437.76,434.91,437.32,432.59,432.586,434.222,434.226\n1643139000,437.3,439.71,436.14,439.53,433.1413333,433.627,435.65,435.1643333\n1643140800,439.59,439.61,435.11,435.46,433.6066667,433.925,436.436,436.1176667\n1643142600,435.49,436.85,433.48,434.42,433.8806667,434.255,436.606,436.2316667\n1643207400,440.72,442.34,438.8,441.95,434.474,435.228,437.736,436.982\n1643209200,441.99,443.08,438.55,439.18,434.4266667,436.165,438.108,436.3696667\n1643211000,439.17,439.49,437.54,439.12,435.0933333,436.838,438.026,436.2813333\n1643212800,439.11,441.08,438.3,440.63,435.6366667,437.748,439.06,436.9486667\n1643214600,440.65,441.4,439.73,440.7,436.2753333,438.461,440.316,438.1303333\n1643216400,440.7,441.64,440.57,441.42,436.8886667,438.973,440.21,438.1256667\n1643218200,441.47,442.11,440.98,441.92,437.696,439.433,440.758,439.021\n1643220000,441.96,442.01,440.04,440.78,438.2553333,439.558,441.09,439.7873333\n1643221800,440.78,441.31,440.34,440.72,438.868,440.084,441.108,439.892\n1643223600,440.75,444.03,438.74,441.46,439.394,440.788,441.26,439.866\n1643225400,441.47,442.08,434.41,436.34,439.3966667,440.227,440.244,439.4136667\n1643227200,436.33,436.33,428.86,432.97,439.1066667,439.606,438.454,437.9546667\n1643229000,432.94,434.55,430.61,433.47,438.7026667,439.041,436.992,436.6536667\n1643293800,438.23,441.27,436.98,440.28,439.024,439.006,436.904,436.922\n1643295600,440.3,441.59,437.4,437.41,439.2233333,438.677,436.094,436.6403333\n1643297400,437.4,439.43,435.89,439.21,439.0406667,438.456,436.668,437.2526667\n1643299200,439.19,440.37,437.07,437.67,438.94,438.031,437.608,438.517\n1643301000,437.65,439.78,437.47,438.96,438.9293333,437.849,438.706,439.7863333\n1643302800,439.01,439.02,434.83,435.225,438.569,437.2995,437.695,438.9645\n1643304600,435.2,435.55,432.54,434.02,438.1236667,436.5555,437.017,438.5851667\n1643306400,433.975,434.5,430.08,430.26,437.3796667,435.9475,435.227,436.6591667\n1643308200,430.33,432.5,430.06,431.96,436.7156667,435.8465,434.085,434.9541667\n1643310000,431.98,434.27,430.53,430.86,436.0543333,435.5855,432.465,432.9338333\n1643311800,430.87,433.02,429.85,431.07,435.411,434.6645,431.634,432.3805\n1643313600,431.16,432.74,429.45,431.59,434.753,434.0825,431.148,431.8185\n1643315400,431.53,433.97,430.76,431.22,434.4116667,433.2835,431.34,432.4681667\n1643380200,432.68,433.11,427.88,428.49,434.113,432.3655,430.646,432.3935\n1643382000,428.49,432.34,427.82,430.73,433.9303333,431.5425,430.62,433.0078333\n1643383800,430.75,433.45,429.08,433.39,433.471,431.359,431.084,433.196\n1643385600,433.5,435.73,432.11,435,433.3103333,431.457,431.766,433.6193333\n1643387400,435.02,437.08,434.27,436.95,433.1596667,432.126,432.912,433.9456667\n1643389200,436.95,437.52,435.27,435.58,433.0203333,432.488,434.33,434.8623333\n1643391000,435.6,436.14,434.2,434.55,432.7263333,432.857,435.094,434.9633333\n1643392800,434.54,436.53,434.45,435.62,432.7526667,433.312,435.54,434.9806667\n1643394600,435.65,436.94,435.65,436.2,432.898,433.773,435.78,434.905\n1643396400,436.19,437.19,432.39,432.6,433.054,433.911,434.91,434.053\n1643398200,432.54,436.31,431.84,436.07,433.328,434.669,435.008,433.667\n1643400000,436.08,437.83,435.59,437.23,433.7526667,435.319,435.544,433.9776667\n1643401800,437.22,442,436.05,441.92,434.476,436.172,436.804,435.108\n1643639400,441.24,443.36,439.83,443.33,435.2586667,437.005,438.23,436.4836667\n1643641200,443.33,445.785,443.29,444.38,436.136,437.748,440.586,438.974\n1643643000,444.39,445.39,443.86,445.2,437.25,438.71,442.412,440.952\n1643644800,445.17,445.51,443.93,444.17,438.146,439.672,443.8,442.274\n1643646600,444.17,446.79,443.9,446.71,439.034,440.781,444.758,443.011\n1643648400,446.74,446.93,445.67,446.32,439.7886667,441.793,445.356,443.3516667\n1643650200,446.33,447.52,445.88,447.33,440.4806667,443.266,445.946,443.1606667\n1643652000,447.32,447.61,446.64,446.87,441.2333333,444.346,446.28,443.1673333\n1643653800,446.95,447.58,446.54,447.31,442.084,445.354,446.908,443.638\n1643655600,447.42,448.36,447.2,448.36,442.9333333,445.998,447.238,444.1733333\n1643657400,448.35,448.37,447.79,448.11,443.7273333,446.476,447.596,444.8473333\n1643659200,448.06,448.27,445.71,447.24,444.7033333,446.762,447.578,445.5193333\n1643661000,447.21,450.27,446.73,449.81,445.6193333,447.223,448.166,446.5623333\n1643725800,450.68,451.015,448.62,449.77,446.4553333,447.783,448.658,447.3303333\n1643727600,449.76,450.04,446.95,448.77,446.912,447.989,448.74,447.663\n1643729400,448.8,450.02,447.89,450.01,447.3573333,448.358,449.12,448.1193333\n1643731200,450,450.84,449.41,449.87,447.7233333,448.612,449.646,448.7573333\n1643733000,449.89,451.02,449,450.68,448.0886667,448.993,449.82,448.9156667\n1643734800,450.71,450.9,449.56,450.075,448.4823333,449.2695,449.881,449.0938333\n1643736600,450.085,450.47,448.985,450.44,448.731,449.4775,450.215,449.4685\n1643738400,450.43,450.47,449.54,450.335,448.9986667,449.7,450.28,449.5786667\n1643740200,450.32,450.7,449.62,450.41,449.204,450.017,450.388,449.575\n1643742000,450.46,450.88,449.52,450.12,449.4206667,450.048,450.276,449.6486667\n1643743800,450.15,450.61,449.82,450.43,449.6286667,450.114,450.347,449.8616667\n1643745600,450.41,452.47,450.26,452.32,449.8926667,450.469,450.723,450.1466667\n1643747400,452.34,453.62,451.84,452.94,450.2146667,450.762,451.244,450.6966667\n1643812200,455.5,456.38,453.99,454.53,450.7006667,451.228,452.068,451.5406667\n1643814000,454.55,456.08,453.86,454.17,450.9913333,451.577,452.878,452.2923333\n1643815800,454.19,455.78,453.4,455.08,451.3453333,452.0775,453.808,453.0758333\n1643817600,455.08,455.21,453.06,454.27,451.712,452.4605,454.198,453.4495\n1643819400,454.28,454.81,453.16,454.76,452.0286667,452.903,454.562,453.6876667\n1643821200,454.76,456.02,454.3,455.12,452.3786667,453.374,454.68,453.6846667\n1643823000,455.15,456.84,454.77,456.83,452.7886667,454.045,455.212,453.9556667\n1643824800,456.82,456.86,455.24,455.66,453.161,454.568,455.328,453.921\n1643826600,455.66,456.67,455.58,456.28,453.5503333,454.964,455.73,454.3163333\n1643828400,456.28,456.82,455.49,456.26,453.9453333,455.296,456.03,454.6793333\n1643830200,456.28,457.71,456.21,456.99,454.384,455.542,456.404,455.246\n1643832000,457.05,458.01,456.59,457.38,454.868,455.863,456.514,455.519\n1643833800,457.4,458.12,456.87,457.3,455.326,456.085,456.842,456.083\n1643898600,450.95,452.32,450.02,450.3,455.1913333,455.688,455.646,455.1493333\n1643900400,450.29,452.82,450.05,452.52,455.1633333,455.464,454.898,454.5973333\n1643902200,452.53,452.91,451.46,451.95,454.9913333,455.147,453.89,453.7343333\n1643904000,451.97,452.96,451.16,451.56,454.8173333,454.62,452.726,452.9233333\n1643905800,451.56,451.74,450.17,450.2,454.492,454.074,451.306,451.724\n1643907600,450.17,450.62,449.19,450.16,454.218,453.462,451.278,452.034\n1643909400,450.14,450.61,449.23,449.91,453.8946667,452.827,450.756,451.8236667\n1643911200,449.92,450.46,449.05,450.06,453.5573333,452.134,450.378,451.8013333\n1643913000,450.06,450.7,449.69,450.01,453.1026667,451.397,450.068,451.7736667\n1643914800,449.96,450.58,449.28,449.56,452.696,450.623,449.94,452.013\n1643916600,449.54,449.61,447.71,448.26,452.1613333,450.419,449.56,451.3023333\n1643918400,448.27,449.36,447.56,448.64,451.6533333,450.031,449.306,450.9283333\n1643920200,448.62,448.63,445.72,446.68,450.966,449.504,448.63,450.092\n1643985000,446.35,448.26,445.08,447.19,450.2866667,449.067,448.066,449.2856667\n1643986800,447.17,448.72,446.03,446.1,449.54,448.657,447.374,448.257\n1643988600,446.08,446.97,444.24,444.68,449.1653333,448.109,446.658,447.7143333\n1643990400,444.71,446.21,443.86,445.72,448.712,447.69,446.074,447.096\n1643992200,445.82,447.85,445.6,446.84,448.3713333,447.368,446.106,447.1093333\n1643994000,446.86,447.75,446.45,447.42,448.0953333,447.109,446.152,447.1383333\n1643995800,447.51,448.62,446.87,448.57,447.9866667,447.01,446.646,447.6226667\n1643997600,448.58,450.39,448.58,449.74,447.9586667,447.158,447.658,448.4586667\n1643999400,449.76,450.82,449.61,450.63,448.0066667,447.357,448.64,449.2896667\n1644001200,450.64,450.8,449.33,450.01,448.0033333,447.69,449.274,449.5873333\n1644003000,450.01,451.13,449.87,451.04,448.072,448.075,449.998,449.995\n1644004800,451.06,452.77,451.04,451.88,448.2266667,448.653,450.66,450.2336667\n1644006600,451.89,452.56,448.58,448.73,448.258,449.058,450.458,449.658\n1644244200,449.51,450.4,448.21,449.91,448.3426667,449.477,450.314,449.1796667\n1644246000,449.95,450.29,448.5,449.79,448.55,449.772,450.27,449.048\n1644247800,449.78,450.86,449.22,449.79,448.7233333,450.009,450.02,448.7343333\n1644249600,449.78,450.09,448.66,449.18,448.9286667,450.07,449.48,448.3386667\n1644251400,449.17,449.17,447.12,448.19,449.1626667,449.915,449.372,448.6196667\n1644253200,448.15,448.24,447.27,447.34,449.2706667,449.586,448.858,448.5426667\n1644255000,447.32,448.04,446.77,447.67,449.326,449.352,448.434,448.408\n1644256800,447.69,449.13,447.44,448.99,449.4306667,449.147,448.274,448.5576667\n1644258600,449.02,449.59,448.6,449.42,449.4873333,448.901,448.322,448.9083333\n1644260400,449.43,450.07,448.86,450.06,449.5086667,449.034,448.696,449.1706667\n1644262200,450.09,450.46,449.73,449.91,449.4606667,449.034,449.21,449.6366667\n1644264000,449.9,450.99,448.93,449.08,449.3986667,448.963,449.492,449.9276667\n1644265800,449.14,449.49,445.85,447.24,449.1453333,448.708,449.142,449.5793333\n1644330600,446.74,447.465,446.06,446.4,448.78,448.43,448.538,448.888\n1644332400,446.41,447.23,445.24,446.3,448.618,448.241,447.786,448.163\n1644334200,446.32,448.3,445.82,447.96,448.488,448.303,447.396,447.581\n1644336000,447.92,449.34,447.87,448.98,448.434,448.434,447.376,447.376\n1644337800,449.01,450.25,449.01,450.07,448.4526667,448.542,447.942,447.8526667\n1644339600,450.11,450.46,449.48,450.1,448.514,448.61,448.682,448.586\n1644341400,450.12,451.26,450.12,450.58,448.6733333,448.662,449.538,449.5493333\n1644343200,450.59,450.63,449.63,449.85,448.8406667,448.656,449.916,450.1006667\n1644345000,449.86,450.515,449.65,450.4,449.0226667,448.788,450.2,450.4346667\n1644346800,450.36,450.79,448.8,448.92,449.018,448.956,449.97,450.032\n1644348600,448.92,449.4,448.18,448.66,448.9673333,449.182,449.682,449.4673333\n1644350400,448.6,450.78,448.11,450.16,448.974,449.568,449.598,449.004\n1644352200,450.19,451.91,450.02,450.89,449.0393333,449.861,449.806,448.9843333\n1644417000,455.22,456.36,455.02,455.37,449.4586667,450.5,450.8,449.7586667\n1644418800,455.36,456.35,455.16,455.92,450.0373333,451.085,452.2,451.1523333\n1644420600,455.95,456.78,455.82,456.78,450.7293333,451.753,453.824,452.8003333\n1644422400,456.77,457.02,455.75,456.19,451.3886667,452.314,455.03,454.1046667\n1644424200,456.18,456.52,455.52,455.86,451.9153333,452.915,456.024,455.0243333\n1644426000,455.85,456.3,455.38,456.11,452.3906667,453.486,456.172,455.0766667\n1644427800,456.11,456.7,455.81,456.66,452.83,454.26,456.32,454.89\n1644429600,456.66,456.86,456.1,456.55,453.26,455.049,456.274,454.485\n1644431400,456.57,456.78,456.33,456.75,453.6713333,455.708,456.386,454.3493333\n1644433200,456.76,457.42,456.76,457.37,454.1726667,456.356,456.688,454.5046667\n1644435000,457.36,457.59,456.61,456.66,454.59,456.485,456.798,454.903\n1644436800,456.67,457.025,455.76,457.01,455.1293333,456.594,456.868,455.4033333\n1644438600,457,457.8,456.45,457.51,455.7193333,456.667,457.06,456.1123333\n1644503400,451.34,455.54,451.32,455.13,456.0506667,456.561,456.736,456.2256667\n1644505200,455.18,456.91,455.03,455.97,456.3893333,456.572,456.456,456.2733333\n1644507000,456.02,457.7,455.1,455.5,456.398,456.511,456.224,456.111\n1644508800,455.52,456.24,454.57,455.15,456.3466667,456.36,455.852,455.8386667\n1644510600,455.13,456.34,454.27,456.21,456.3086667,456.326,455.592,455.5746667\n1644512400,456.2,456.42,455.54,456.15,456.306,456.266,455.796,455.836\n1644514200,456.19,456.53,452.76,453.71,456.1626667,455.9,455.344,455.6066667\n1644516000,453.67,454.37,451.5,451.51,455.856,455.385,454.546,455.017\n1644517800,451.5,452.12,450,452.07,455.55,454.891,453.93,454.589\n1644519600,452.05,452.22,449.48,450.77,455.1646667,454.217,452.842,453.7896667\n1644521400,450.73,451.69,449.46,449.87,454.706,453.691,451.586,452.601\n1644523200,449.86,451.13,449.13,449.8,454.2013333,453.074,450.804,451.9313333\n1644525000,449.8,449.95,447.2,449.36,453.7146667,452.46,450.374,451.6286667\n1644589800,449.41,451.6,448.83,449.18,453.1926667,451.863,449.796,451.1256667\n1644591600,449.17,450.81,448.28,449.69,452.6713333,451.211,449.58,451.0403333\n1644593400,449.82,450.54,448.71,449,452.2626667,450.496,449.406,451.1726667\n1644595200,448.94,450.13,447.75,448.17,451.7426667,449.942,449.08,450.8806667\n1644597000,448.18,448.58,446.83,447.91,451.2366667,449.582,448.79,450.4446667\n1644598800,447.89,448.67,447.27,447.93,450.7553333,449.168,448.54,450.1273333\n1644600600,447.93,448.32,446.39,446.69,450.1206667,448.76,447.94,449.3006667\n1644602400,446.71,447.68,445.68,445.68,449.4226667,448.341,447.276,448.3576667\n1644604200,445.68,445.74,441,441.76,448.626,447.537,445.994,447.083\n1644606000,441.72,443.9,440.49,441.17,447.9366667,446.718,444.646,445.8646667\n1644607800,441.23,443.12,439.43,440.92,447.1933333,445.892,443.244,444.5453333\n1644609600,440.95,442.78,440.01,441.12,446.55,445.035,442.13,443.645\n1644611400,441.03,442.52,438.95,440.5,445.9253333,444.185,441.094,442.8343333\n1644849000,439.92,441.28,438.97,440.18,445.284,443.386,440.778,442.676\n1644850800,440.16,440.41,437.66,438.93,444.5886667,442.488,440.33,442.4306667\n1644852600,438.94,439.37,437.36,437.8,443.83,441.475,439.706,442.061\n1644854400,437.88,440.16,437.63,439.76,443.168,440.782,439.434,441.82\n1644856200,439.79,440.675,439.09,440.17,442.5793333,440.231,439.368,441.7163333\n1644858000,440.19,440.97,439.55,440.95,442.098,440.15,439.522,441.47\n1644859800,440.93,441.48,440.46,440.89,441.63,440.122,439.914,441.422\n1644861600,440.91,441.6,439.72,439.93,441.0966667,440.023,440.34,441.4136667\n1644863400,439.91,440.04,436.16,436.23,440.3993333,439.534,439.634,440.4993333\n1644865200,436.26,438.78,435.34,437.49,439.8533333,439.233,439.098,439.7183333\n1644867000,437.46,438.88,436.58,438.09,439.6086667,439.024,438.526,439.1106667\n1644868800,438.14,439.47,436.83,438.49,439.43,438.98,438.046,438.496\n1644870600,438.49,440.2,438.31,439.04,439.3046667,439.104,437.868,438.0686667\n1644935400,443.72,445.78,443.45,444.02,439.498,439.53,439.426,439.394\n1644937200,444.06,444.96,443.5,444.96,439.7953333,440.009,440.92,440.7063333\n1644939000,444.98,445.92,444.64,445.5,440.15,440.464,442.402,442.088\n1644940800,445.51,445.99,444.76,444.97,440.5526667,440.872,443.698,443.3786667\n1644942600,444.98,445.88,444.98,445.6,441.0726667,441.439,445.01,444.6436667\n1644944400,445.61,445.89,443.86,444.4,441.382,442.256,445.086,444.212\n1644946200,444.34,444.58,443.19,443.87,441.6286667,442.894,444.868,443.6026667\n1644948000,443.87,445.49,443.76,445.38,441.924,443.623,444.844,443.145\n1644949800,445.38,445.6,445.14,445.48,442.23,444.322,444.946,442.854\n1644951600,445.52,445.59,444.46,445.34,442.5906667,444.952,444.894,442.5326667\n1644953400,445.34,445.73,444.66,445.35,443.1986667,445.085,445.084,443.1976667\n1644955200,445.33,445.96,445.25,445.59,443.7386667,445.148,445.428,444.0186667\n1644957000,445.595,446.28,443.86,446.08,444.2713333,445.206,445.568,444.6333333\n1645021800,443.93,444.81,442.45,442.79,444.558,444.988,445.03,444.6\n1645023600,442.76,443.42,442.25,443.29,444.8413333,444.757,444.62,444.7043333\n1645025400,443.27,443.59,442.81,442.98,444.772,444.615,444.146,444.303\n1645027200,443.04,443.75,442.78,443.73,444.69,444.601,443.774,443.863\n1645029000,443.62,443.73,443,443.59,444.5626667,444.422,443.276,443.4166667\n1645030800,443.61,443.965,443.25,443.31,444.452,444.205,443.38,443.627\n1645032600,443.3,443.3,441.94,442.88,444.2706667,443.959,443.298,443.6096667\n1645034400,442.85,443.36,442.53,443.06,444.1813333,443.73,443.314,443.7653333\n1645036200,443.08,443.17,442.5,443.03,444.1253333,443.474,443.174,443.8253333\n1645038000,443.02,446.29,442.02,446.18,444.1786667,443.484,443.692,444.3866667\n1645039800,446.18,447.21,445.29,446.57,444.2513333,443.862,444.344,444.7333333\n1645041600,446.63,447.67,446.35,447.41,444.3893333,444.274,445.25,445.3653333\n1645043400,447.42,448.055,446.27,446.62,444.474,444.638,445.962,445.798\n1645108200,443.32,443.77,440.56,440.79,444.154,444.344,445.514,445.324\n1645110000,440.76,441.66,439.89,440.01,443.7493333,443.986,444.28,444.0433333\n1645111800,440,441.15,439.8,440.92,443.6246667,443.747,443.15,443.0276667\n1645113600,440.9,441.83,440.64,441.48,443.504,443.607,441.964,441.861\n1645115400,441.48,442.105,440.96,441.21,443.386,443.422,440.882,440.846\n1645117200,441.225,441.64,440.74,441.41,443.2313333,443.26,441.006,440.9773333\n1645119000,441.4,441.84,440.78,441.14,443.068,442.756,441.232,441.544\n1645120800,441.14,441.265,440.21,440.48,442.8793333,442.147,441.144,441.8763333\n1645122600,440.44,440.89,439.98,440.31,442.708,441.437,440.91,442.181\n1645124400,440.31,440.31,439.02,439.16,442.448,440.691,440.5,442.257\n1645126200,439.16,439.3,438.3,438.36,442.1366667,440.448,439.89,441.5786667\n1645128000,438.39,438.6,436.92,437.67,441.5693333,440.214,439.196,440.5513333\n1645129800,437.62,438.54,436.43,437.11,440.9386667,439.833,438.522,439.6276667\n1645194600,437.36,438.65,435.91,438.37,440.336,439.522,438.134,438.948\n1645196400,438.39,438.65,436.71,436.81,439.682,439.082,437.664,438.264\n1645198200,436.87,436.87,435.21,435.48,439.328,438.489,437.088,437.927\n1645200000,435.48,435.6,433.6,434.94,438.99,437.869,436.542,437.663\n1645201800,435.03,435.58,432.89,433.21,438.476,437.142,435.762,437.096\n1645203600,433.19,435.04,432.84,434.08,437.9826667,436.519,434.904,436.3676667\n1645205400,434.06,434.58,432.42,432.47,437.4,435.85,434.036,435.586\n1645207200,432.52,433.27,431.82,432.56,436.81,435.27,433.452,434.992\n1645209000,432.56,434.36,432.41,433.95,436.3306667,434.898,433.254,434.6866667\n1645210800,433.95,436.38,433.72,436.2,436.0453333,434.807,433.852,435.0903333\n1645212600,436.2,437.08,434.76,436.66,435.802,434.636,434.368,435.534\n1645214400,436.66,437.4,434.2,434.3,435.478,434.385,434.734,435.827\n1645216200,434.33,435.56,432.81,434.26,435.2046667,434.263,435.074,436.0156667\n1645540200,431.89,435.28,430.49,434.2,434.9733333,434.189,435.124,435.9083333\n1645542000,434.19,435.46,432.88,435.42,434.8606667,434.41,434.968,435.4186667\n1645543800,435.46,435.5,431.67,431.79,434.422,434.181,433.994,434.235\n1645545600,431.79,432.42,430.95,431.34,434.0573333,434.068,433.402,433.3913333\n1645547400,431.36,432.39,430.43,431.25,433.7753333,433.937,432.8,432.6383333\n1645549200,431.22,431.92,430.27,430.44,433.4753333,433.586,432.048,431.9373333\n1645551000,430.44,430.67,429.23,429.42,433.2226667,432.908,430.848,431.1626667\n1645552800,429.46,430.07,428.23,428.9,432.8773333,432.132,430.27,431.0153333\n1645554600,428.79,429.27,426.79,427.31,432.5333333,431.433,429.464,430.5643333\n1645556400,427.28,428.79,425.86,428.21,432.2433333,430.828,428.856,430.2713333\n1645558200,428.145,431.77,427.32,430.94,432.0426667,430.502,428.956,430.4966667\n1645560000,431.05,432.88,430.73,431.65,431.7393333,430.125,429.402,431.0163333\n1645561800,431.62,431.79,428.05,429.65,431.272,429.911,429.552,430.913\n1645626600,432.66,433.25,431.04,431.12,431.06,429.889,430.314,431.485\n1645628400,431.13,431.16,428.13,428.37,430.6673333,429.601,430.346,431.4123333\n1645630200,428.26,429.46,427.68,428.2,430.2673333,429.377,429.798,430.6883333\n1645632000,428.11,428.47,426.62,427.06,429.71,429.141,428.88,429.449\n1645633800,427.14,429.12,426.71,428.83,429.5126667,429.134,428.716,429.0946667\n1645635600,428.82,430.2,428.19,430.11,429.4306667,429.414,428.514,428.5306667\n1645637400,430.15,430.26,427.65,428.01,429.2146667,429.394,428.442,428.2626667\n1645639200,427.97,427.97,425.58,425.72,428.9,428.872,427.946,427.974\n1645641000,425.71,427.27,425.05,426.16,428.6826667,428.323,427.766,428.1256667\n1645642800,426.14,426.63,424.16,424.4,428.3826667,427.798,426.88,427.4646667\n1645644600,424.42,424.75,423.03,423.65,428.1386667,427.051,425.588,426.6756667\n1645646400,423.6,423.89,422.19,423.64,427.834,426.578,424.714,425.97\n1645648200,423.63,423.83,421.36,421.97,427.236,425.955,423.964,425.245\n1645713000,411.02,415.91,410.65,415.76,426.1766667,424.825,421.884,423.2356667\n1645714800,415.69,418.13,413.11,415.44,425.2293333,423.486,420.092,421.8353333\n1645716600,415.45,417.97,414.42,417.05,424.2913333,422.18,418.772,420.8833333\n1645718400,417.06,419.47,416.23,417.7,423.58,421.149,417.584,420.015\n1645720200,417.7,418.79,416.07,418.69,422.946,420.446,416.928,419.428\n1645722000,418.66,418.79,415.35,416.48,422.2406667,419.478,417.072,419.8346667\n1645723800,416.39,417.935,415.42,416.42,421.4133333,418.68,417.268,420.0013333\n1645725600,416.4,418.25,415.74,416.53,420.508,417.968,417.164,419.704\n1645727400,416.56,421.39,416.44,418.98,419.906,417.502,417.42,419.824\n1645729200,418.98,420.8,417.86,420.72,419.5726667,417.377,417.826,420.0216667\n1645731000,420.69,423.8,420.6,423.37,419.3866667,418.138,419.204,420.4526667\n1645732800,423.36,425.04,422.97,423.73,419.342,418.967,420.666,421.041\n1645734600,423.74,428.76,423.67,428.31,419.6526667,420.093,423.022,422.5816667\n1645799400,429.61,431.25,428.26,428.52,419.978,421.175,424.93,423.733\n1645801200,428.49,432.26,427.86,431.87,420.638,422.493,427.16,425.305\n1645803000,431.87,433.98,430.56,433.3,421.8073333,424.175,429.146,426.7783333\n1645804800,433.24,435.79,432.45,435.22,423.126,426.055,431.444,428.515\n1645806600,435.24,436.82,434.53,436.72,424.4373333,428.074,433.126,429.4893333\n1645808400,436.74,436.98,435.49,436.61,425.698,429.837,434.744,430.605\n1645810200,436.66,437.28,435.36,435.78,426.8373333,431.343,435.526,431.0203333\n1645812000,435.81,436.8,434.85,436.56,428.176,432.662,436.178,431.692\n1645813800,436.58,437.73,436.14,436.57,429.5193333,433.946,436.448,432.0213333\n1645815600,436.62,437.37,435.745,437.04,430.8866667,434.819,436.512,432.5796667\n1645817400,437.12,437.54,435.02,436.11,432.0286667,435.578,436.412,432.8626667\n1645819200,436.08,437.41,435.12,436.61,433.088,436.052,436.578,433.614\n1645821000,436.7,437.84,436,437.7,434.0433333,436.492,436.806,434.3573333\n1646058600,432.02,434.48,431.87,434.29,434.7473333,436.399,436.35,434.6983333\n1646060400,434.27,434.55,431.85,432.92,435.0546667,436.019,435.526,434.5616667\n1646062200,432.93,436.25,432.85,435.95,435.55,435.953,435.494,435.091\n1646064000,435.97,437.895,435.49,437.66,435.936,436.141,435.704,435.499\n1646065800,437.67,438.19,436.19,437.365,436.207,436.2215,435.637,435.6225\n1646067600,437.34,437.66,434.21,434.71,436.173,436.0355,435.721,435.8585\n1646069400,434.655,434.97,432.67,433.59,435.9643333,435.6905,435.855,436.1288333\n1646071200,433.58,435.46,432.88,433.84,435.7796667,435.4635,435.433,435.7491667\n1646073000,433.82,435.09,433.18,434.58,435.6996667,435.2605,434.817,435.2561667\n1646074800,434.56,434.56,430.72,431.24,435.345,434.6145,433.592,434.3225\n1646076600,431.24,433.38,430.7,432.92,435.1016667,434.4775,433.234,433.8581667\n1646078400,432.92,434.23,431.64,433.55,434.869,434.5405,433.226,433.5545\n1646080200,433.53,436.94,431.62,436.66,434.9056667,434.6115,433.79,434.0841667\n1646145000,435.04,437.17,434.41,434.86,434.789,434.3315,433.846,434.3035\n1646146800,434.86,436.2,433.42,434.76,434.593,434.071,434.55,435.072\n1646148600,434.78,435.2,432.31,432.72,434.4883333,433.872,434.51,435.1263333\n1646150400,432.71,434.13,432.47,432.97,434.4916667,433.81,434.394,435.0756667\n1646152200,432.99,433.04,429.24,429.78,434.0803333,433.404,433.018,433.6943333\n1646154000,429.74,430.67,428.51,430.43,433.5983333,432.989,432.132,432.7413333\n1646155800,430.36,431.62,430.03,431.34,433.1966667,432.999,431.448,431.6456667\n1646157600,431.33,432.02,428.28,428.33,432.7713333,432.54,430.57,430.8013333\n1646159400,428.3,429.51,428.18,429.13,432.474,432.098,429.802,430.178\n1646161200,429.13,430.63,427.93,430.36,432.242,431.468,429.918,430.692\n1646163000,430.35,431.4,429.37,429.73,431.9186667,430.955,429.778,430.7416667\n1646164800,429.76,432.29,429.42,429.47,431.8006667,430.426,429.404,430.7786667\n1646166600,429.47,430.335,427.11,430,431.606,430.154,429.738,431.19\n1646231400,432.37,434.76,431.91,433.61,431.61,430.218,430.634,432.026\n1646233200,433.62,435.08,431.57,434.36,431.4566667,430.676,431.434,432.2146667\n1646235000,434.34,435.67,433.35,434.51,431.4333333,431.084,432.39,432.7393333\n1646236800,434.51,437.53,433.6,436.72,431.564,431.622,433.84,433.782\n1646238600,436.74,438.29,436.26,437.09,431.8553333,432.498,435.258,434.6153333\n1646240400,437.1,438.04,436.52,437.42,432.152,433.327,436.02,434.845\n1646242200,437.51,438.07,437.14,437.78,432.6853333,434.069,436.704,435.3203333\n1646244000,437.79,439.07,437.79,438.5,433.2233333,434.946,437.502,435.7793333\n1646245800,438.56,439.31,438.22,438.77,433.7186667,435.876,437.912,435.7546667\n1646247600,438.82,439.46,437.91,438.4,434.39,436.716,438.174,435.848\n1646249400,438.42,439.23,437.64,437.98,434.98,437.153,438.286,436.113\n1646251200,437.97,439,437.69,438.7,435.536,437.587,438.47,436.419\n1646253000,438.705,439.55,437.68,437.85,436.0773333,437.921,438.34,436.4963333\n1646317800,440.47,441.11,438.95,439.68,436.758,438.217,438.522,437.063\n1646319600,439.7,440.31,437.11,437.72,437.2726667,438.28,438.386,437.3786667\n1646321400,437.645,438.13,434.86,434.9,437.3586667,438.028,437.77,437.1006667\n1646323200,434.9,436.13,433.84,435.82,437.456,437.832,437.194,436.818\n1646325000,435.8,436.86,435.08,436.29,437.5746667,437.611,436.882,436.8456667\n1646326800,436.29,437.36,435.39,435.57,437.498,437.291,436.06,436.267\n1646328600,435.64,439.25,435.44,437.83,437.5473333,437.234,436.082,436.3953333\n1646330400,437.89,439.01,437.43,438.88,437.6446667,437.324,436.878,437.1986667\n1646332200,438.86,438.86,437.34,437.98,437.658,437.252,437.31,437.716\n1646334000,437.99,439.27,437.55,438.74,437.674,437.341,437.8,438.133\n1646335800,438.68,438.71,435.88,436.25,437.506,436.998,437.936,438.444\n1646337600,436.23,436.5,434.77,436.445,437.3756667,436.8705,437.659,438.1641667\n1646339400,436.4,436.42,433.92,435.72,437.225,436.9525,437.027,437.2995\n1646404200,431.75,432.48,429.38,431.79,436.7643333,436.5495,435.789,436.0038333\n1646406000,431.78,432.425,428.72,429.79,436.227,435.8995,433.999,434.3265\n1646407800,429.81,430.53,428.38,428.51,435.4823333,435.1935,432.451,432.7398333\n1646409600,428.52,429.45,427.89,428.97,434.899,434.3075,430.956,431.5475\n1646411400,428.97,430.01,428.02,429.22,434.5203333,433.3415,429.656,430.8348333\n1646413200,429.23,431.89,428.74,431.49,434.2316667,432.6925,429.596,431.1351667\n1646415000,431.48,432.34,430.51,431.88,433.9376667,432.0065,430.014,431.9451667\n1646416800,431.95,433.37,431.69,431.77,433.6843333,431.5585,430.666,432.7918333\n1646418600,431.78,432.86,430.31,430.48,433.1943333,430.962,430.968,433.2003333\n1646420400,430.48,431.86,429.69,431.24,432.685,430.514,431.372,433.543\n1646422200,431.2,431.63,429.21,429.31,432.107,430.266,430.936,432.777\n1646424000,429.32,431.39,429.23,430.71,431.5716667,430.358,430.702,431.9156667\n1646425800,430.67,432.625,429.6,432.22,431.303,430.729,430.792,431.366\n1646663400,431.55,431.83,427.82,427.82,430.728,430.614,430.26,430.374\n1646665200,427.81,428.7,426.06,426.07,430.0846667,430.299,429.226,429.0116667\n1646667000,426.08,426.77,425.07,425.56,429.6693333,429.706,428.476,428.4393333\n1646668800,425.56,427.21,425.19,426.4,429.4433333,429.158,427.614,427.8993333\n1646670600,426.37,426.49,424.07,424.155,429.153,428.3965,426.001,426.7575\n1646672400,424.16,424.3,422.2,423.01,428.7556667,427.6495,425.039,426.1451667\n1646674200,422.97,424.45,422.27,423.02,428.3423333,426.8275,424.429,425.9438333\n1646676000,422.99,424.34,422.06,422.92,427.771,426.1885,423.901,425.4835\n1646677800,422.89,424.05,422.5,422.71,427.1596667,425.3885,423.163,424.9341667\n1646679600,422.68,423.93,422.03,422.79,426.561,424.4455,422.89,425.0055\n1646681400,422.755,423.01,421.32,421.75,425.979,423.8385,422.638,424.7785\n1646683200,421.77,422.05,420.37,421.57,425.3343333,423.3885,422.348,424.2938333\n1646685000,421.57,421.58,419.36,419.45,424.677,422.7775,421.654,423.5535\n1646749800,419.62,421.15,417.79,418.69,423.8756667,422.0065,420.85,422.7191667\n1646751600,418.69,419.23,415.76,416.38,422.8196667,421.229,419.568,421.1586667\n1646753400,416.36,419.55,415.4,419.3,422.2516667,420.858,419.078,420.4716667\n1646755200,419.38,419.77,416.37,416.71,421.6276667,420.227,418.106,419.5066667\n1646757000,416.68,418.66,415.12,417.96,421.121,419.731,417.808,419.198\n1646758800,417.96,424.59,417.7,423.82,420.949,419.842,418.834,419.941\n1646760600,423.84,425.55,423,425.17,421.0166667,420.08,420.592,421.5286667\n1646762400,425.3,427.2,423.48,423.71,421.0633333,420.276,421.474,422.2613333\n1646764200,423.75,423.75,419.38,419.52,420.83,420.071,422.036,422.795\n1646766000,419.52,421,417.81,420.81,420.6893333,420.207,422.606,423.0883333\n1646767800,420.83,422.76,419.65,421.47,420.6066667,420.485,422.136,422.2576667\n1646769600,421.47,423.53,418.94,419.08,420.3593333,420.755,420.918,420.5223333\n1646771400,419.09,419.32,416.255,416.3,419.996,420.455,419.436,418.977\n1646836200,425.14,425.7,422.85,424.16,420.1686667,421.2,420.364,419.3326667\n1646838000,424.2,426.35,423.96,425.74,420.588,421.978,421.35,419.96\n1646839800,425.75,426.93,425.12,426.59,421.1146667,422.255,422.374,421.2336667\n1646841600,426.6,426.74,424.73,425.39,421.7153333,422.277,423.636,423.0743333\n1646843400,425.4,427.51,425.39,427.37,422.2533333,422.643,425.85,425.4603333\n1646845200,427.4,428,426.79,427.55,422.976,423.446,426.528,426.058\n1646847000,427.56,428.74,427.55,428.36,423.6693333,424.201,427.052,426.5203333\n1646848800,428.37,428.37,427.25,428.29,423.9673333,424.883,427.392,426.4763333\n1646850600,428.32,428.33,426.3,426.72,424.0706667,425.647,427.658,426.0816667\n1646852400,426.72,427.74,426.57,427.23,424.3053333,426.74,427.63,425.1953333\n1646854200,427.26,428.12,427.08,427.3,424.824,427.054,427.58,425.35\n1646856000,427.32,429.07,427.28,428.78,425.3553333,427.358,427.664,425.6613333\n1646857800,428.78,429.5,426.63,427.41,425.7513333,427.44,427.488,425.7993333\n1646922600,422.52,424.99,422.05,424.53,426.1146667,427.354,427.05,425.8106667\n1646924400,424.52,425.27,423.15,423.17,426.5726667,426.934,426.238,425.8766667\n1646926200,423.17,423.62,421.52,421.81,426.416,426.36,425.14,425.196\n1646928000,421.77,421.86,420.52,420.77,426.0846667,425.601,423.538,424.0216667\n1646929800,420.77,422.02,420.45,421.9,425.772,424.962,422.436,423.246\n1646931600,421.885,423.14,421.7,422.86,425.6033333,424.576,422.102,423.1293333\n1646933400,422.86,422.9,421.16,421.46,425.2093333,423.999,421.76,422.9703333\n1646935200,421.43,422.68,421.11,422.38,424.8646667,423.507,421.874,423.2316667\n1646937000,422.38,423.86,422.105,423.48,424.5393333,422.977,422.416,423.9783333\n1646938800,423.48,425.3,423.36,424.79,424.306,422.715,422.994,424.585\n1646940600,424.81,426.09,424.47,425.66,424.2353333,422.828,423.554,424.9613333\n1646942400,425.73,425.78,424.1,424.89,424.0793333,423,424.24,425.3193333\n1646944200,424.92,426.42,424.17,425.47,423.9573333,423.366,424.858,425.4493333\n1647009000,428.12,428.76,426.6,427.17,423.85,424.006,425.596,425.44\n1647010800,427.13,427.17,424.85,425.76,423.74,424.392,425.79,425.138\n1647012600,425.66,427.075,424.97,426.96,423.902,424.802,426.05,425.15\n1647014400,426.99,427.03,425.12,425.2,424.0373333,425.176,426.112,424.9733333\n1647016200,425.2,425.26,423.75,424.39,424.2093333,425.377,425.896,424.7283333\n1647018000,424.35,424.82,423.38,423.45,424.388,425.374,425.152,424.166\n1647019800,423.38,424.32,423.01,424.04,424.5306667,425.299,424.808,424.0396667\n1647021600,424.01,425.18,423.72,425,424.6733333,425.233,424.416,423.8563333\n1647023400,424.97,425.5,423.68,423.69,424.822,425.113,424.114,423.823\n1647025200,423.67,424.85,423.36,424.68,424.9753333,425.034,424.172,424.1133333\n1647027000,424.67,424.76,422.62,423.1,424.95,424.627,424.102,424.425\n1647028800,423.05,423.175,421.96,421.96,424.7613333,424.247,423.686,424.2003333\n1647030600,421.94,421.94,419.55,420.08,424.3893333,423.559,422.702,423.5323333\n1647264600,420.89,421.96,419.11,421.36,424.154,423.175,422.236,423.215\n1647266400,421.34,423.48,420.5,422.75,423.9726667,423.011,421.85,422.8116667\n1647268200,422.79,424.32,422.06,424.32,423.7826667,423.098,422.094,422.7786667\n1647270000,424.33,424.5,422.09,422.26,423.5493333,422.92,422.154,422.7833333\n1647271800,422.29,422.46,419.99,420.46,423.116,422.466,422.23,422.88\n1647273600,420.42,420.45,418.84,419.82,422.7573333,422.079,421.922,422.6003333\n1647275400,419.81,420.15,417.83,417.89,422.324,421.4,420.95,421.874\n1647277200,417.89,418.11,417.31,417.44,421.9233333,420.834,419.574,420.6633333\n1647279000,417.44,417.65,416.12,416.71,421.4346667,420.309,418.464,419.5896667\n1647280800,416.7,417.25,415.8,415.89,420.8273333,419.89,417.55,418.4873333\n1647282600,415.92,417.28,415.81,417.12,420.3893333,419.466,417.01,417.9333333\n1647284400,417.13,418.2,416.65,417.17,419.8886667,418.908,416.866,417.8466667\n1647286200,417.17,417.7,416.01,417.05,419.4853333,418.181,416.788,418.0923333\n1647351000,419.77,421.33,418.43,420.375,419.3796667,417.9925,417.521,418.9081667\n1647352800,420.38,421.79,419.13,421.66,419.485,418.1125,418.675,420.0475\n1647354600,421.75,422.81,421.48,421.76,419.5116667,418.3065,419.603,420.8081667\n1647356400,421.78,423.2,421.71,423.17,419.5396667,418.8345,420.803,421.5081667\n1647358200,423.23,424.25,421.83,422.55,419.4216667,419.3455,421.903,421.9791667\n1647360000,422.46,424.3,421.57,424.07,419.5423333,420.0815,422.642,422.1028333\n1647361800,424.05,424.4,422.56,423.58,419.7503333,420.8505,423.026,421.9258333\n1647363600,423.66,424.13,422.1,422.13,419.9043333,421.3515,423.1,421.6528333\n1647365400,422.13,423.38,421.85,423.2,420.2583333,421.9545,423.106,421.4098333\n1647367200,423.19,423.46,421.38,422.08,420.5676667,422.4575,423.012,421.1221667\n1647369000,422.08,424.76,421.65,424.64,421.0963333,422.884,423.126,421.3383333\n1647370800,424.62,426.04,424.38,425.78,421.7556667,423.296,423.566,422.0256667\n1647372600,425.82,426.83,425.34,426.12,422.3556667,423.732,424.364,422.9876667\n1647437400,429.89,432.66,429.8,431.91,423.3383333,424.606,426.106,424.8383333\n1647439200,431.94,434.54,430.76,433.45,424.4316667,425.696,428.38,427.1156667\n1647441000,433.46,434.27,432.13,433.31,425.294,426.62,430.114,428.788\n1647442800,433.31,433.47,432.22,432.87,426.0413333,427.549,431.532,430.0243333\n1647444600,432.89,433.16,432.25,432.97,426.7886667,428.633,432.902,431.0576667\n1647446400,433.05,433.58,432.53,433,427.444,429.613,433.12,430.951\n1647448200,433.025,433.1,431.17,431.67,428.052,430.572,432.764,430.244\n1647450000,431.67,431.89,430.03,430.64,428.49,431.172,432.23,429.548\n1647451800,430.64,431.58,430.46,431.32,429.006,431.726,431.92,429.2\n1647453600,431.28,431.28,426.31,426.38,429.2893333,431.752,430.602,428.1393333\n1647455400,426.36,431.46,424.8,429.94,429.7386667,431.555,429.99,428.1736667\n1647457200,429.94,433.28,429.4,432.98,430.4653333,431.508,430.252,429.2093333\n1647459000,432.98,435.68,431.875,435.61,431.1966667,431.738,431.246,430.7046667\n1647523800,433.59,436.23,433.23,436.16,431.8886667,432.067,432.214,432.0356667\n1647525600,436.19,436.96,435.9,436.37,432.572,432.407,434.212,434.377\n1647527400,436.4,436.53,433.98,434.81,432.7653333,432.588,435.186,435.3633333\n1647529200,434.65,435.82,434.28,435.5,432.902,432.971,435.69,435.621\n1647531000,435.48,436.44,435.14,436.1,433.088,433.517,435.788,435.359\n1647532800,436.2,437.66,435.75,437.54,433.3993333,434.139,436.064,435.3243333\n1647534600,437.46,437.91,437.19,437.74,433.7173333,435.275,436.338,434.7803333\n1647536400,437.75,438.74,436.99,438.67,434.0953333,436.148,437.11,435.0573333\n1647538200,438.71,439.85,438.56,439.43,434.6126667,436.793,437.896,435.7156667\n1647540000,439.44,439.7,438.27,438.3,435.1233333,437.062,438.336,436.3973333\n1647541800,438.31,439.51,438.31,439.42,435.6633333,437.388,438.712,436.9873333\n1647543600,439.38,439.77,438.13,439.09,436.5106667,437.66,438.982,437.8326667\n1647545400,439.15,441.06,438.9,441.02,437.2493333,438.281,439.452,438.4203333\n1647610200,438,439.18,437.22,439.03,437.6526667,438.634,439.372,438.3906667\n1647612000,439.07,440.88,438.77,439.72,437.9266667,438.996,439.656,438.5866667\n1647613800,439.69,440.17,438.43,439.51,438.15,439.193,439.674,438.631\n1647615600,439.56,440.58,439.32,439.72,438.3733333,439.391,439.8,438.7823333\n1647617400,439.7,440.88,439.15,439.96,438.7166667,439.52,439.588,438.7846667\n1647619200,439.97,440.99,439.55,440.98,439.082,439.675,439.978,439.385\n1647621000,440.97,441.71,440.86,441.45,439.4386667,439.99,440.324,439.7726667\n1647622800,441.44,442.29,441.23,442.27,439.754,440.275,440.876,440.355\n1647624600,442.295,442.47,441.81,442.03,440.04,440.569,441.338,440.809\n1647626400,442.07,442.45,441.48,442.16,440.2726667,440.683,441.778,441.3676667\n1647628200,442.2,442.69,441.76,442.55,440.4806667,441.035,442.092,441.5376667\n1647630000,442.56,444.23,442.36,444.03,440.8626667,441.466,442.608,442.0046667\n1647631800,444.04,444.86,443.7,444.46,441.1986667,441.961,443.046,442.2836667\n1647869400,444.39,446.455,443.83,443.94,441.522,442.383,443.428,442.567\n1647871200,443.94,444.28,442.74,442.99,441.6533333,442.686,443.594,442.5613333\n1647873000,443.035,445.11,442.77,444.89,442.044,443.077,444.062,443.029\n1647874800,444.91,445.72,444.36,445.49,442.4286667,443.481,444.354,443.3016667\n1647876600,445.5,445.77,444.69,445.47,442.826,443.801,444.556,443.581\n1647878400,445.43,445.86,444.69,445.46,443.2086667,444.144,444.86,443.9246667\n1647880200,445.51,445.55,442.19,442.38,443.37,444.166,444.738,443.942\n1647882000,442.42,442.49,440.68,441.27,443.3893333,444.038,444.014,443.3653333\n1647883800,441.23,442.66,441.23,442.54,443.462,443.889,443.424,442.997\n1647885600,442.53,443.64,441.73,443.52,443.5453333,443.795,443.034,442.7843333\n1647887400,443.59,443.98,441.79,441.88,443.5353333,443.589,442.318,442.2643333\n1647889200,441.76,443.54,441.69,443.48,443.6233333,443.638,442.538,442.5233333\n1647891000,443.55,444.48,442.09,444.42,443.748,443.591,443.168,443.325\n1647955800,445.86,447.49,445.86,447.17,443.9573333,443.759,444.094,444.2923333\n1647957600,447.3,448.76,447.3,448.56,444.2306667,444.068,445.102,445.2646667\n1647959400,448.57,449.39,448.57,448.775,444.553,444.3995,446.481,446.6345\n1647961200,448.9,449.68,448.24,449.41,444.981,445.1025,447.667,447.5455\n1647963000,449.39,449.39,448.5,448.7,445.235,445.8455,448.523,447.9125\n1647964800,448.7,449.16,447.92,448.09,445.4083333,446.4005,448.707,447.7148333\n1647966600,448.12,449.09,447.8,449.02,445.645,446.9505,448.799,447.4935\n1647968400,448.97,449.54,448.56,449,445.881,447.6625,448.844,447.0625\n1647970200,449.03,449.59,448.96,449.5,446.3556667,448.2645,448.862,446.9531667\n1647972000,449.53,449.59,448.13,448.59,446.8436667,448.6815,448.84,447.0021667\n1647973800,448.58,449.28,448.14,448.98,447.273,448.8625,449.018,447.4285\n1647975600,448.98,449.84,448.82,449.05,447.6416667,448.9115,449.024,447.7541667\n1647977400,449.04,450.56,448.88,449.57,448.1543333,448.991,449.138,448.3013333\n1648042200,446.91,447.31,445.64,446.05,448.3256667,448.655,448.448,448.1186667\n1648044000,446.07,447.88,445.7,447.52,448.5323333,448.537,448.234,448.2293333\n1648045800,447.57,447.98,446.6,447.23,448.5363333,448.451,447.884,447.9693333\n1648047600,447.23,448.16,447.16,448.03,448.501,448.352,447.68,447.829\n1648049400,448.04,448.09,447.34,447.77,448.434,448.229,447.32,447.525\n1648051200,447.77,448.48,446.39,447.36,448.2973333,448.015,447.582,447.8643333\n1648053000,447.32,447.64,446.14,446.85,448.174,447.841,447.448,447.781\n1648054800,446.8,446.91,444.93,445.06,447.972,447.449,447.014,447.537\n1648056600,444.995,445.87,444.76,445.78,447.756,447.122,446.564,447.198\n1648058400,445.79,445.93,444.72,445.92,447.5506667,446.757,446.194,446.9876667\n1648060200,445.89,446.29,445.17,445.305,447.271,446.6825,445.783,446.3715\n1648062000,445.31,445.97,444.93,445.72,447.0796667,446.5025,445.557,446.1341667\n1648063800,445.71,445.88,443.79,443.84,446.737,446.1635,445.313,445.8865\n1648128600,445.89,446.35,444.78,445.6,446.507,445.9205,445.277,445.8635\n1648130400,445.61,446.95,445.3,445.44,446.2316667,445.6875,445.181,445.7251667\n1648132200,445.51,446.93,445.23,446.33,446.2503333,445.5845,445.386,446.0518333\n1648134000,446.35,448.3,446.24,448.22,446.297,445.7215,445.886,446.4615\n1648135800,448.33,448.94,448.06,448.42,446.3763333,446.0575,446.802,447.1208333\n1648137600,448.4,448.57,447.015,447.23,446.323,446.2025,447.128,447.2485\n1648139400,447.22,447.81,446.82,447.72,446.3196667,446.3825,447.584,447.5211667\n1648141200,447.75,448.4,447.41,448.15,446.3723333,446.667,447.948,447.6533333\n1648143000,448.16,448.54,447.815,448.24,446.465,446.919,447.952,447.498\n1648144800,448.22,448.85,447.83,448.13,446.6696667,447.348,447.894,447.2156667\n1648146600,448.14,448.29,447.43,448.16,446.8283333,447.604,448.08,447.3043333\n1648148400,448.18,449.81,447.76,449.6,447.0736667,448.02,448.456,447.5096667\n1648150200,449.6,450.45,448.83,450.41,447.414,448.428,448.908,447.894\n1648215000,451.17,451.61,450.305,450.84,447.7553333,448.69,449.428,448.4933333\n1648216800,450.88,452.48,450.46,451.85,448.2893333,449.033,450.172,449.4283333\n1648218600,451.85,452.98,451.85,452.34,448.7386667,449.544,451.008,450.2026667\n1648220400,452.33,452.52,448.44,449.05,448.9793333,449.677,450.898,450.2003333\n1648222200,449.05,450.06,448.69,449.28,449.176,449.79,450.672,450.058\n1648224000,449.24,450.42,448.98,450.29,449.314,449.995,450.562,449.881\n1648225800,450.28,450.48,449.26,450.06,449.4233333,450.188,450.204,449.4393333\n1648227600,450.08,450.77,449.55,449.98,449.6066667,450.37,449.732,448.9686667\n1648229400,449.97,451.4,449.97,451.31,449.846,450.541,450.184,449.489\n1648231200,451.34,451.88,451.145,451.72,450.084,450.672,450.672,450.084\n1648233000,451.71,452.19,451.56,451.91,450.3286667,450.779,450.996,450.5456667\n1648234800,451.89,451.96,450.01,450.09,450.4593333,450.603,451.002,450.8583333\n1648236600,450.06,452.79,449.71,452.65,450.7586667,450.634,451.536,451.6606667\n1648474200,452.06,453.64,451.68,453.54,451.0213333,451.083,451.982,451.9203333\n1648476000,453.56,453.57,452.09,452.88,451.186,451.443,452.214,451.957\n1648477800,452.91,453.35,452,453.25,451.3466667,451.739,452.482,452.0896667\n1648479600,453.27,453.4,451.84,452.4,451.3833333,451.973,452.944,452.3543333\n1648481400,452.42,452.42,450.28,450.44,451.2566667,452.019,452.502,451.7396667\n1648483200,450.46,451.22,450.06,450.61,451.3606667,451.949,451.916,451.3276667\n1648485000,450.56,451.74,450.54,451.64,451.518,451.941,451.668,451.245\n1648486800,451.66,452.53,451.43,452.31,451.6526667,451.981,451.48,451.1516667\n1648488600,452.35,452.52,452.15,452.42,451.81,452.214,451.484,451.08\n1648490400,452.38,452.98,452.2,452.9,452.0046667,452.239,451.976,451.7416667\n1648492200,452.88,454.42,452.75,454.42,452.212,452.327,452.738,452.623\n1648494000,454.45,454.58,453.88,454.48,452.396,452.487,453.306,453.215\n1648495800,454.48,455.89,454.34,455.86,452.6593333,452.748,454.016,453.9273333\n1648560600,460.02,461.24,458.68,459.28,453.272,453.436,455.388,455.224\n1648562400,459.35,459.7,457.19,458.7,453.6753333,454.262,456.548,455.9613333\n1648564200,458.71,459.41,457.62,459.18,454.0513333,455.119,457.5,456.4323333\n1648566000,459.19,459.52,458.25,459.3,454.4793333,455.885,458.464,457.0583333\n1648567800,459.32,459.94,459.11,459.43,454.8913333,456.597,459.178,457.4723333\n1648569600,459.48,459.48,458.2,458.36,455.2886667,457.191,458.994,457.0916667\n1648571400,458.39,458.79,457.51,458.32,455.814,457.733,458.918,456.999\n1648573200,458.31,458.38,457.66,458.14,456.316,458.105,458.71,456.921\n1648575000,458.25,459.56,457.97,459.52,456.8413333,458.609,458.754,456.9863333\n1648576800,459.58,459.86,459.09,459.81,457.3413333,459.004,458.83,457.1673333\n1648578600,459.81,460.81,459.73,460.56,457.884,459.132,459.27,458.022\n1648580400,460.59,461.54,460.33,461.51,458.458,459.413,459.908,458.953\n1648582200,461.53,462.07,460.6,461.6,458.9366667,459.655,460.6,459.8816667\n1648647000,460.34,461,459.84,460.9,459.3646667,459.815,460.876,460.4256667\n1648648800,460.94,461.19,460.05,460.12,459.6486667,459.884,460.938,460.7026667\n1648650600,460.13,460.73,459.76,459.85,459.6866667,460.033,460.796,460.4496667\n1648652400,459.85,460.05,458.64,459.15,459.7166667,460.116,460.324,459.9246667\n1648654200,459.17,459.72,459,459.64,459.7473333,460.266,459.932,459.4133333\n1648656000,459.61,460.1,459.09,459.52,459.762,460.266,459.656,459.152\n1648657800,459.52,460.12,459.36,459.9,459.7933333,460.275,459.612,459.1303333\n1648659600,459.89,459.94,458.855,458.99,459.8353333,460.118,459.44,459.1573333\n1648661400,458.96,459.18,458.52,458.66,459.858,459.833,459.342,459.367\n1648663200,458.61,459.33,458.42,458.57,459.8866667,459.53,459.128,459.4846667\n1648665000,458.55,458.96,457.78,457.88,459.7773333,459.228,458.8,459.3493333\n1648666800,457.9,457.97,456.47,457.16,459.6006667,458.932,458.252,458.9206667\n1648668600,457.12,458.73,456.88,458.72,459.478,458.819,458.198,458.857\n1648733400,457.88,458.14,457.13,457.9,459.2373333,458.694,458.046,458.5893333\n1648735200,457.875,457.875,456.59,457.11,458.938,458.441,457.754,458.251\n1648737000,457.17,458.75,457.03,458.46,458.7753333,458.335,457.87,458.3103333\n1648738800,458.48,458.58,457.59,457.68,458.6126667,458.113,457.974,458.4736667\n1648740600,457.67,458.2,457.28,457.93,458.4846667,458.007,457.816,458.2936667\n1648742400,457.92,458.1,456.73,456.95,458.338,457.836,457.626,458.128\n1648744200,456.96,457.31,456.62,456.7,458.142,457.649,457.544,458.037\n1648746000,456.69,457.01,456.28,456.95,457.9706667,457.556,457.242,457.6566667\n1648747800,456.96,457.47,456.62,456.97,457.7753333,457.537,457.1,457.3383333\n1648749600,456.94,456.97,455.91,456.34,457.5986667,457.299,456.782,457.0816667\n1648751400,456.31,456.61,455.84,456.59,457.4606667,457.168,456.71,457.0026667\n1648753200,456.62,457.35,455.265,455.51,457.2566667,457.008,456.472,456.7206667\n1648755000,455.515,455.65,451.51,451.68,456.8433333,456.33,455.418,455.9313333\n1648819800,453.31,453.46,451.67,452.25,456.516,455.787,454.474,455.203\n1648821600,452.22,452.78,450.81,451.09,456.0073333,455.103,453.424,454.3283333\n1648823400,451.07,452.3,450.81,451.98,455.6126667,454.606,452.502,453.5086667\n1648825200,451.95,452.42,451.57,451.7,455.252,454.106,451.74,452.886\n1648827000,451.69,451.74,450.13,450.28,454.7066667,453.439,451.46,452.7276667\n1648828800,450.3,450.51,449.69,450.43,454.2233333,452.785,451.096,452.5343333\n1648830600,450.31,450.4,449.36,449.97,453.6926667,452.148,450.872,452.4166667\n1648832400,449.91,450.2,449.14,449.65,453.206,451.454,450.406,452.158\n1648834200,449.64,450.87,449.59,450.54,452.7953333,450.957,450.174,452.0123333\n1648836000,450.51,452.21,450.48,452.17,452.4766667,451.006,450.552,452.0226667\n1648837800,452.2,452.77,451.64,451.81,452.1326667,450.962,450.828,451.9986667\n1648839600,451.79,452.5,450.63,451.07,451.7813333,450.96,451.048,451.8693333\n1648841400,451.07,453.18,450.32,452.88,451.534,451.05,451.694,452.178\n1649079000,453.13,454.68,452.29,454.51,451.4673333,451.331,452.488,452.6243333\n1649080800,454.5,454.87,453.49,454.84,451.678,451.787,453.022,452.913\n1649082600,454.845,454.95,454.08,454.46,451.8253333,452.19,453.552,453.1873333\n1649084400,454.47,455.3,454.34,455.21,452.1,452.714,454.38,453.766\n1649086200,455.2,455.71,454.88,455.48,452.3333333,453.297,454.9,453.9363333\n1649088000,455.52,455.65,455.32,455.57,452.5913333,453.8,455.112,453.9033333\n1649089800,455.55,455.685,454.845,454.92,452.9006667,454.075,455.128,453.9536667\n1649091600,454.91,455.31,454.69,455.25,453.222,454.419,455.286,454.089\n1649093400,455.26,455.77,455.1,455.76,453.608,454.888,455.396,454.116\n1649095200,455.71,455.89,454.99,455.87,454.0226667,455.187,455.474,454.3096667\n1649097000,455.87,456.26,455.67,456.05,454.39,455.341,455.57,454.619\n1649098800,456.04,456.35,455.84,456.1,454.652,455.467,455.806,454.991\n1649100600,456.095,456.83,455.73,456.77,454.9826667,455.698,456.11,455.3946667\n1649165400,455.22,457.18,455.05,456.93,455.3733333,455.87,456.344,455.8473333\n1649167200,456.91,457.825,453.9,454.44,455.4773333,455.766,456.058,455.7693333\n1649169000,454.39,455.5,453.82,455.07,455.5146667,455.716,455.862,455.6606667\n1649170800,455.09,455.21,454.22,454.59,455.498,455.683,455.56,455.375\n1649172600,454.56,454.98,453.5,453.51,455.4346667,455.509,454.908,454.8336667\n1649174400,453.49,453.91,452.72,452.77,455.272,455.21,454.076,454.138\n1649176200,452.77,453.73,452.67,453.57,455.1446667,454.98,453.902,454.0666667\n1649178000,453.57,454.67,453.39,454.18,455.052,454.793,453.724,453.983\n1649179800,454.19,454.21,452.53,453.02,454.9253333,454.485,453.41,453.8503333\n1649181600,453.02,453.47,452.61,452.9,454.7686667,454.098,453.288,453.9586667\n1649183400,452.91,453.19,452.38,452.5,454.5513333,453.655,453.234,454.1303333\n1649185200,452.54,452.76,451.05,451.4,454.2533333,453.351,452.8,453.7023333\n1649187000,451.4,451.4,449.82,451.04,453.9193333,452.948,452.172,453.1433333\n1649251800,446.89,447.58,445.45,445.58,453.218,452.047,450.684,451.855\n1649253600,445.62,445.79,444.51,445,452.4333333,451.196,449.104,450.3413333\n1649255400,445.01,445.86,444.75,444.98,451.6366667,450.417,447.6,448.8196667\n1649257200,444.96,445.71,444.67,445.41,451.0346667,449.601,446.402,447.8356667\n1649259000,445.46,446.41,444.92,445.94,450.426,448.777,445.382,447.031\n1649260800,445.88,446.1,444.62,444.91,449.7806667,447.966,445.248,447.0626667\n1649262600,444.89,445.35,444.74,445.24,449.2293333,447.2,445.296,447.3253333\n1649264400,445.27,445.92,444.95,445.8,448.7646667,446.53,445.46,447.6946667\n1649266200,445.81,446.88,445.65,446.07,448.2646667,445.997,445.592,447.8596667\n1649268000,446.12,448.52,443.47,444.56,447.6233333,445.349,445.316,447.5903333\n1649269800,444.54,448.03,444.47,447.96,447.286,445.587,445.926,447.625\n1649271600,447.99,448.93,445.59,445.67,446.804,445.654,446.012,447.162\n1649273400,445.67,447.96,445.33,446.56,446.408,445.812,446.164,446.76\n1649338200,445.59,447.65,445.3,447.01,446.1153333,445.972,446.352,446.4953333\n1649340000,447.03,447.72,445.58,445.65,445.756,445.943,446.57,446.383\n1649341800,445.69,446.63,444.44,445.16,445.728,445.968,446.01,445.77\n1649343600,445.24,446.06,444.17,444.51,445.6953333,445.895,445.778,445.5783333\n1649345400,444.49,444.92,443.88,444.35,445.6533333,445.75,445.336,445.2393333\n1649347200,444.3,445.18,444.14,444.38,445.5846667,445.581,444.81,444.8136667\n1649349000,444.27,444.56,443.54,444.25,445.472,445.55,444.53,444.452\n1649350800,444.27,446.78,444.17,446.54,445.5806667,445.408,444.806,444.9786667\n1649352600,446.58,447.67,445.92,447.5,445.7313333,445.591,445.404,445.5443333\n1649354400,447.58,448.22,446.89,447.27,445.8293333,445.662,445.988,446.1553333\n1649356200,447.15,449.45,446.98,449.24,446.0406667,445.885,446.96,447.1156667\n1649358000,449.24,450.5,449.1,449.295,446.3563333,446.2495,447.969,448.0758333\n1649359800,449.32,450.69,448.45,448.75,446.409,446.6085,448.411,448.2115\n1649424600,447.97,448.2,445.97,446.09,446.437,446.7665,448.129,447.7995\n1649426400,446.08,447.56,445.95,447.45,446.4963333,447.0765,448.165,447.5848333\n1649428200,447.41,449.84,447.14,449.8,446.6823333,447.6185,448.277,447.3408333\n1649430000,449.8,450.25,448.99,449.33,446.9276667,448.1265,448.284,447.0851667\n1649431800,449.35,449.86,448.85,449.6,447.2236667,448.4325,448.454,447.2451667\n1649433600,449.57,450.62,449.09,450.42,447.6176667,448.7245,449.32,448.2131667\n1649435400,450.42,450.43,449.48,450.165,448.0053333,449.014,449.863,448.8543333\n1649437200,450.19,450.2,449.19,449.22,448.328,449.012,449.747,449.063\n1649439000,449.27,449.29,448.59,448.85,448.6346667,448.9675,449.651,449.3181667\n1649440800,448.82,449.34,447.76,448.03,448.734,448.8955,449.337,449.1755\n1649442600,448.07,449.12,447.64,448.61,448.808,449.1475,448.975,448.6355\n1649444400,448.62,449.37,448.14,448.89,448.916,449.2915,448.72,448.3445\n1649446200,448.88,449.13,446.69,447.62,448.808,449.0735,448.4,448.1345\n1649683800,444.11,445,442.89,444.1,448.4616667,448.5505,447.45,447.3611667\n1649685600,444.05,444.48,442.4,442.77,448.063,447.8675,446.398,446.5935\n1649687400,442.76,442.83,441.98,442.34,447.813,447.0595,445.144,445.8975\n1649689200,442.32,442.64,441.61,441.99,447.449,446.242,443.764,444.971\n1649691000,442,442.76,441.86,442.16,446.9396667,445.536,442.672,444.0756667\n1649692800,442.14,442.34,441.73,441.77,446.4356667,444.828,442.206,443.8136667\n1649694600,441.73,442.02,441.36,441.84,445.9183333,444.209,442.02,443.7293333\n1649696400,441.84,442.57,441.44,441.73,445.339,443.521,441.898,443.716\n1649698200,441.72,442.31,441.62,442.19,444.8073333,442.851,441.938,443.8943333\n1649700000,442.2,442.56,441.32,441.55,444.296,442.244,441.816,443.868\n1649701800,441.52,442.78,441.19,442.44,443.8686667,442.078,441.95,443.7406667\n1649703600,442.46,443,440.87,440.97,443.398,441.898,441.776,443.276\n1649705400,440.94,441.02,439.395,439.95,442.8206667,441.659,441.42,442.5816667\n1649770200,443.08,445.73,442.37,445.06,442.5653333,441.966,441.994,442.5933333\n1649772000,445.1,445.3,443.57,443.57,442.2953333,442.107,442.398,442.5863333\n1649773800,443.63,443.87,442.22,442.65,442.1986667,442.195,442.44,442.4436667\n1649775600,442.59,444.22,442.22,444.06,442.2846667,442.417,443.058,442.9256667\n1649777400,444.07,444.5,443.395,443.68,442.374,442.612,443.804,443.566\n1649779200,443.67,443.75,441.63,441.78,442.36,442.571,443.148,442.937\n1649781000,441.74,442.38,441.23,442.02,442.3506667,442.618,442.838,442.5706667\n1649782800,442.01,442.7,441.16,441.64,442.342,442.538,442.636,442.44\n1649784600,441.69,441.91,439.39,439.62,442.194,442.403,441.748,441.539\n1649786400,439.57,440.33,438.44,438.51,441.9793333,442.259,440.714,440.4343333\n1649788200,438.49,439.28,437.98,438.82,441.7546667,441.635,440.122,440.2416667\n1649790000,438.78,439.03,436.66,437.06,441.4553333,440.984,439.13,439.6013333\n1649791800,437.03,438.77,436.69,438.25,441.176,440.544,438.452,439.084\n1649856600,438.03,440.25,437.84,439.02,441.046,440.04,438.332,439.338\n1649858400,439.06,439.92,438.28,439.27,441.0006667,439.599,438.484,439.8856667\n1649860200,439.3,439.93,438.79,439.81,440.6506667,439.402,438.682,439.9306667\n1649862000,439.82,441.75,439.79,441.5,440.5126667,439.35,439.57,440.7326667\n1649863800,441.54,441.98,440.81,441,440.4026667,439.286,440.12,441.2366667\n1649865600,441.03,442.07,440.76,441.57,440.2366667,439.481,440.63,441.3856667\n1649867400,441.58,442.59,441.58,442.08,440.13,439.838,441.192,441.484\n1649869200,442.1,442.83,441.95,442.37,440.1693333,440.193,441.704,441.6803333\n1649871000,442.39,442.43,441.53,442.04,440.1706667,440.691,441.812,441.2916667\n1649872800,441.97,442.52,441.75,442.18,440.2066667,441.084,442.048,441.1706667\n1649874600,442.19,443,442.06,442.8,440.4186667,441.462,442.294,441.2506667\n1649876400,442.83,443.58,442.29,443.48,440.75,441.883,442.574,441.441\n1649878200,443.495,444.1,443.02,443.35,441.052,442.237,442.77,441.585\n1649943000,443.55,444.72,441.67,442.16,441.392,442.303,442.794,441.883\n1649944800,442.2,442.95,440.51,441.31,441.596,442.334,442.62,441.882\n1649946600,441.32,442.02,440.83,441.42,441.756,442.319,442.344,441.781\n1649948400,441.41,442.27,441.07,442.03,441.94,442.314,442.054,441.68\n1649950200,442.05,442.21,440.57,440.78,442.0046667,442.155,441.54,441.3896667\n1649952000,440.775,441.2,439.97,440.09,441.9106667,441.96,441.126,441.0766667\n1649953800,440.06,440.29,439.47,440.08,441.8493333,441.75,440.88,440.9793333\n1649955600,440.06,440.26,439.65,439.98,441.7433333,441.468,440.592,440.8673333\n1649957400,440,441.35,439.9,441.33,441.6933333,441.253,440.452,440.8923333\n1649959200,441.29,441.83,440.45,440.9,441.5953333,441.008,440.476,441.0633333\n1649961000,440.93,441.13,439.33,439.33,441.4146667,440.725,440.324,441.0136667\n1649962800,439.34,440,438.88,439.22,441.2173333,440.516,440.152,440.8533333\n1649964600,439.27,439.28,437.68,437.86,440.888,440.16,439.728,440.456\n1650288600,436.81,439.46,436.81,437.76,440.5066667,439.733,439.014,439.7876667\n1650290400,437.76,439.5,437.09,438.74,440.1993333,439.529,438.582,439.2523333\n1650292200,438.75,439.5,438.13,438.57,439.96,439.377,438.43,439.013\n1650294000,438.59,438.97,437.03,437.33,439.6946667,439.102,438.052,438.6446667\n1650295800,437.32,437.4,436.21,437.18,439.412,438.822,437.916,438.506\n1650297600,437.17,437.215,435.79,435.92,439.0046667,438.281,437.548,438.2716667\n1650299400,435.92,436.76,435.62,436.56,438.7233333,437.847,437.112,437.9883333\n1650301200,436.61,437.55,436.39,437.28,438.536,437.642,436.854,437.748\n1650303000,437.27,439.73,437.22,439.15,438.474,437.635,437.218,438.057\n1650304800,439.17,439.74,438.28,438.95,438.4053333,437.744,437.572,438.2333333\n1650306600,438.94,439.54,438.33,438.37,438.208,437.805,438.062,438.465\n1650308400,438.38,438.55,437.04,437.08,437.9533333,437.639,438.166,438.4803333\n1650310200,437.04,437.99,435.63,437.99,437.864,437.581,438.308,438.591\n1650375000,437.83,441.45,437.69,441.43,438.0113333,437.991,438.764,438.7843333\n1650376800,441.4,442.87,441.18,442.7,438.334,438.543,439.514,439.305\n1650378600,442.72,443.84,442.5,443.16,438.694,439.267,440.472,439.899\n1650380400,443.16,443.88,442.77,443.76,439.0286667,439.987,441.808,440.8496667\n1650382200,443.72,444.28,443.27,443.73,439.3726667,440.632,442.956,441.6966667\n1650384000,443.75,444.03,443.39,443.57,439.7886667,441.074,443.384,442.0986667\n1650385800,443.58,443.74,443.09,443.38,440.202,441.517,443.52,442.205\n1650387600,443.38,443.66,442.66,442.69,440.6533333,441.949,443.426,442.1303333\n1650389400,442.7,443.87,442.68,443.57,441.1206667,442.598,443.388,441.9106667\n1650391200,443.58,443.65,442.44,442.98,441.5006667,443.097,443.238,441.6416667\n1650393000,442.98,443.85,442.77,443.785,441.8096667,443.3325,443.281,441.7581667\n1650394800,443.77,445.35,443.53,445.09,442.219,443.5715,443.623,442.2705\n1650396600,445.13,445.79,444.24,445.01,442.6616667,443.7565,444.087,442.9921667\n1650461400,446.91,447.56,444.4,445,443.1896667,443.8805,444.373,443.6821667\n1650463200,444.97,446.02,444.37,445.82,443.7116667,444.0895,444.941,444.5631667\n1650465000,445.83,447.25,445.39,446.89,444.0756667,444.4215,445.562,445.2161667\n1650466800,446.92,446.96,445.07,445.57,444.267,444.6405,445.658,445.2845\n1650468600,445.61,446.55,445.42,446.05,444.4596667,444.9765,445.866,445.3491667\n1650470400,446.02,446.32,444.8,445.06,444.5463333,445.1255,445.878,445.2988333\n1650472200,445.03,446.65,444.95,446.26,444.715,445.4535,445.966,445.2275\n1650474000,446.26,446.91,445.89,446.13,444.8856667,445.688,445.814,445.0116667\n1650475800,446.1,447.19,445.92,446.61,445.101,445.84,446.022,445.283\n1650477600,446.59,446.89,445.34,445.4,445.2816667,445.879,445.892,445.2946667\n1650479400,445.41,445.49,443.49,444.02,445.3116667,445.781,445.684,445.2146667\n1650481200,443.99,445.89,443.9,445.47,445.4776667,445.746,445.526,445.2576667\n1650483000,445.5,446.38,444.42,444.66,445.536,445.523,445.232,445.245\n1650547800,448.54,450.01,448.54,449.34,445.8193333,445.9,445.778,445.6973333\n1650549600,449.38,449.42,447.86,448.68,446.064,446.163,446.434,446.335\n1650551400,448.72,448.95,446.92,447.29,446.2166667,446.386,447.088,446.9186667\n1650553200,447.29,447.63,446.39,446.7,446.2753333,446.43,447.334,447.1793333\n1650555000,446.67,446.75,444.68,444.7,446.1293333,446.287,447.342,447.1843333\n1650556800,444.74,445.05,443.5,443.65,446.0013333,445.991,446.204,446.2143333\n1650558600,443.65,444.39,442.63,442.65,445.7746667,445.716,444.998,445.0566667\n1650560400,442.66,443.36,441.37,443.26,445.6546667,445.64,444.192,444.2066667\n1650562200,443.28,443.615,441.56,441.77,445.3553333,445.27,443.206,443.2913333\n1650564000,441.64,441.64,440.35,440.71,444.994,444.875,442.408,442.527\n1650565800,440.66,441.93,438.85,439.22,444.5013333,443.863,441.522,442.1603333\n1650567600,439.23,439.71,437.87,439.49,444.1073333,442.944,440.89,442.0533333\n1650569400,439.48,439.56,437.1,438.03,443.708,442.018,439.844,441.534\n1650634200,436.9,437.23,433.84,434.34,442.966,440.782,438.358,440.542\n1650636000,434.34,435.97,432.82,432.94,442.1846667,439.606,436.804,439.3826667\n1650637800,432.93,434.11,432.17,432.33,441.0506667,438.474,435.426,438.0026667\n1650639600,432.32,433.48,431.94,432.67,439.9833333,437.476,434.062,436.5693333\n1650641400,432.7,432.97,430.35,430.39,438.8566667,436.189,432.534,435.2016667\n1650643200,430.37,431.32,429.87,430.91,437.804,435.103,431.848,434.549\n1650645000,430.88,431.88,430.33,430.4,436.8506667,434.072,431.34,434.1186667\n1650646800,430.42,430.72,429.54,430.06,435.9446667,433.156,430.886,433.6746667\n1650648600,430.07,430.2,428.745,428.75,435.018,432.082,430.102,433.038\n1650650400,428.74,429.99,428.33,428.87,434.0586667,431.166,429.798,432.6906667\n1650652200,428.89,429.22,426.82,427.46,433.1046667,430.478,429.108,431.7346667\n1650654000,427.475,429.39,426.72,428.58,432.296,430.042,428.744,430.998\n1650655800,428.54,430.22,428.5,430.06,431.6853333,429.815,428.744,430.6143333\n"
  },
  {
    "path": "Tests/TestData/spy_with_roc50.txt",
    "content": "Date,Open,High,Low,Close,Rate of Change 50\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,10.47\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,10.25\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,11.22\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,7.759995\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,9.990005\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,7.959991\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,6.320007\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,6.539993\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,8.610001\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,8.130005\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,7.050003\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,4.929993\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,8.980011\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,7.319992\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,9.279999\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,9.529999\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,6.699997\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,0.7299957\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,-0.1199951\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,-1.740005\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,3.450012\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,2.729996\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,5.970001\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,6.279999\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,5.880005\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,5.040009\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,3.5\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,5.139999\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,5.429993\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,6.889999\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,5.889999\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,7.76001\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,9.229996\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,8.399994\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,6.150009\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,6.169998\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,6.269989\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,5.830002\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,6.619995\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,5.729996\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,4.980011\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,3.699997\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,2.990005\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,3.25\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,1.649994\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.780014\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,3.490005\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,5.020004\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,5.25\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,4.419998\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,2.87999\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,4.580002\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,3.479996\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,5.660004\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,5.259995\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,5.180008\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,5.110001\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,3.100006\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,-0.02999878\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,0.7799988\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,1.459991\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,4.309998\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,2.409988\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,2.820007\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,-1.110001\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,-1.830002\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,0.7200012\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,4.25\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,5.319992\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,8.690002\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,7.389999\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,5.899994\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,6.550003\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,8.449997\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,8.039993\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,7.73999\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,8.050003\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,7.289993\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,7.12001\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,7.919998\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,7.569992\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,3.279999\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,2.419998\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,1.380005\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,1.519989\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,1.740005\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,0.04000854\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,-1.160004\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,-0.1600037\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,0.03999329\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,-0.9000092\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,-0.03999329\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,-1.680008\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,-3.110001\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-2.98999\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,0.4599915\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,-0.4000092\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,-0.009994507\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,-1\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,2.340012\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,4.040009\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,4.589996\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,5.089996\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,6.300003\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,4.960007\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,6.409988\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,9.569992\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,10.39999\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,12.39999\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,10.70999\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,11.23\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,10.15001\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,10.21001\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,10.27\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,13.84\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,11.01999\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,13.12\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,13.67001\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,12.57001\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,12.63\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,13.31\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,14.01001\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,11.78999\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,10.16\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,9.070007\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,10.96001\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,11.48\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,10.32001\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,9.609985\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,8.069992\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,8.240005\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,9.809998\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,9.820007\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,10.2\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,9.900009\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,11.25\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,12.48999\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,12.74001\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,9.380005\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,8.950012\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,10.49001\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,10.33\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,11.22\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,16.22\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,15.89\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,12.39\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,12.27\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,11.98999\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,14.15001\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,11.78\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,10.60001\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,10.3\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,8.520004\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,7.470001\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,7.789993\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,8.330002\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,7.570007\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,7.410004\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,6.970001\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,5.389999\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,7.880005\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,8.449997\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,7.589996\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,7.360001\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,7.009995\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,9.37001\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,5.5\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,1.569992\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,1.049988\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,0.6900024\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,-1.919998\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,-0.8200073\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,-1.240005\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-4.860001\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,-3.089996\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,-4.740005\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,-3.330002\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,-0.9500122\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,-0.6699982\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,0.8600006\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,1.070007\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,2.479996\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,4.270004\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,4.51001\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,4.080002\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,3.160004\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,2.490005\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,4.160004\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,6.119995\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,6.720001\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,7.710007\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,7.069992\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,6.330002\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,5.880005\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,6.259995\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,6.619995\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,5.729996\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,5.230011\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,3.37999\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,3.429993\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,1.359985\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,-0.02999878\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,3.410004\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,4.779999\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,4.300003\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,4.270004\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,2.679993\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,1.789993\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,2.169998\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,3.290009\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,0.9100037\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,0.8300018\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,2.589996\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,4.619995\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,4.700012\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,4.330002\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,3.610001\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,5.449997\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,7.090012\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,8.019989\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,5.799988\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,2.279999\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,4.76001\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,10.03\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,10.73999\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,11.22\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,9.559998\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,8.210007\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,7.440002\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,5.850006\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,4.219986\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,3.87001\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,3.729996\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,4.069992\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,5.300003\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,3.959991\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,4.529999\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,1.869995\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,3.040009\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,2.829987\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,2.139999\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,3.5\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,4.980011\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,1.479996\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,-0.3500061\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,-0.1299896\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,0.480011\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,-0.6100006\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,1.900009\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,2.309998\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,5.170013\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,6.860001\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,5.050003\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,4.709991\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,6.019989\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,5.149994\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,6.600006\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,7.76001\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,8.139999\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,10.41\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,11\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,10.11\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,7.910004\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,5.289993\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,5.25\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,5.659988\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,8.430008\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,11.92\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,11.37999\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,8.850006\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,12.73001\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,13.19\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,12.64\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,11.24001\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,9.700012\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,9.330002\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,9.990005\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,9.339996\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,10.75\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,9.679993\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,9.950012\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,10.23999\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,8.589996\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,8.300003\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,9.279999\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,9.169998\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,9.540009\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,8.930008\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,9.830002\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,9.660004\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,10.23999\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,8.850006\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,8.689987\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,8.660004\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,10.40001\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,8.899994\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,8.23999\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,5.539993\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,3.369995\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,4.300003\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,1.659988\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,0.5500031\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,-0.3500061\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,0.8700104\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,1.110001\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,0.6300049\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,2.039993\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,2.569992\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,1.270004\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,1.979996\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,2.809998\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,3.319992\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,4.580002\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,5.650009\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,6.069992\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,6.040009\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,5.419998\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,3.880005\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,4.230011\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,4.669998\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,4.619995\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,5.51001\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,5.529999\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,5.149994\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,3.5\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,4.350006\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,3.270004\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,1.900009\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,0.7799988\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,2.970001\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,4.509995\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,4.700012\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,4.360001\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,2.539993\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,0.4099884\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,2.330002\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,-1.62001\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,2.189987\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,-0.1700134\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,-0.3199921\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,-3.849991\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,-4.259995\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,-2.12999\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,-1.430008\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,-4.540009\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,-0.3099976\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,-4.23999\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,-2.550003\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,-5.089996\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,-6.190002\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,-5.580002\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,-5.800003\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-2.559998\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,-2.940002\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,0.280014\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,-0.8399963\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,0.08999634\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,0.6699982\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,0.4400024\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,1.050003\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,-0.2799988\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,0.4600067\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,2.160004\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,2.580002\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,0.8700104\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,2.009995\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,2.899994\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,3.199997\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,3.269989\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,3.569992\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,3.460007\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,3.979996\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,3.130005\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,3.779999\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,6.229996\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,5.149994\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,5.279999\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,7.549988\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,8.279999\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,6.630005\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,6.889999\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,5.37999\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,5.059998\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,7.940002\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,9.880005\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,8.100006\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,11.66\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,8.710007\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,8.930008\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,6.139999\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,9.839996\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,6.509995\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,2.98999\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,1.62001\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,8.529999\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,10.14\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,13.78\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,16.93001\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,20.34\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,20.07001\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,22.01001\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,22.45\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,19.13\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,15.23999\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,11.35999\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,9.029999\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,4.890015\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,5.880005\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,9.73999\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,5.839996\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,4.539993\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,2.699997\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,-0.8000031\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,-2.75\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,0.5599976\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,-0.2899933\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,-0.06999207\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,2.76001\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,0.9900055\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,1.270004\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,-1.220001\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,-4.050003\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,-2.25\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,-4.919998\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,-3.630005\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,-0.3800049\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,-1.520004\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,-0.5599976\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,-1.709991\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,-2.479996\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,-0.8300018\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,-0.2700043\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,3.160004\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,2.690002\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,2.220001\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,2.470001\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,1.979996\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,4.630005\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,4.740005\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,8.649994\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,7.440002\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,10.49001\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,11.15001\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,14.08\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,9.330002\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,3.449997\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,3.940002\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,0.02999878\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,0.6100006\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,-2.790009\n3/11/2015 3:47:04 PM,205.29,205.5,204.4,204.5,-3.940002"
  },
  {
    "path": "Tests/TestData/spy_with_rocp50.txt",
    "content": "Date,Open,High,Low,Close,Rate of Change % 50\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,6.718861\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,6.614183\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,7.25697\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,4.98426\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,6.471888\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,5.115675\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,4.07874\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,4.187203\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,5.512517\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,5.189254\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,4.517785\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,3.143727\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,5.784972\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,4.696517\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,5.980922\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,6.100761\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,4.27432\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,0.4600717\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,-0.07537855\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,-1.095721\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,2.224092\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,1.734322\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,3.848882\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,4.074217\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,3.78184\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,3.227258\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,2.218279\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,3.255637\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,3.425431\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,4.354145\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,3.697426\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,4.859726\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,5.831435\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,5.258212\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,3.811123\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,3.81382\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,3.856082\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,3.569243\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,4.064339\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,3.506515\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,3.045133\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,2.239301\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,1.799907\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,1.965647\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,0.9883754\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,1.066324\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,2.087698\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,3.025375\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,3.173164\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,2.673763\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,1.731804\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,2.772063\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,2.098532\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,3.462835\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,3.200483\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,3.167038\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,3.1686\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,1.905\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,-0.01820314\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,0.4733002\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,0.8951511\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,2.664604\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,1.467626\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,1.728158\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,-0.6750186\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,-1.10414\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,0.4405024\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,2.666249\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,3.344434\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,5.532919\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,4.660402\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,3.684273\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,4.066304\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,5.267421\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,4.982643\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,4.801185\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,4.991322\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,4.47184\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,4.342794\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,4.79622\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,4.582597\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,1.95891\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,1.444689\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,0.8206987\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,0.9073477\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,1.036026\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,0.02369192\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,-0.6857029\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,-0.09439744\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,0.02364508\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,-0.5340667\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,-0.02367447\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,-0.9934409\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,-1.844712\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-1.773528\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,0.2726521\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,-0.2343895\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,-0.005846451\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,-0.5858231\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,1.378667\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,2.387994\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,2.703178\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,3.006318\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,3.725388\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,2.92436\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,3.798737\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,5.751888\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,6.271479\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,7.525638\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,6.468167\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,6.824256\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,6.112254\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,6.12772\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,6.186749\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,8.47364\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,6.723195\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,7.991713\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,8.353201\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,7.646455\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,7.619913\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,8.020003\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,8.437732\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,7.033343\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,6.016465\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,5.354196\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,6.487131\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,6.779658\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,6.059543\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,5.617575\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,4.663387\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,4.769626\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,5.74625\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,5.778855\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,6.016633\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,5.856607\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,6.629736\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,7.394464\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,7.582885\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,5.539155\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,5.290231\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,6.258206\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,6.116408\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,6.701309\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,9.801789\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,9.59541\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,7.323993\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,7.206628\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,7.014151\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,8.338249\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,6.84605\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,6.119389\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,5.906304\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,4.885324\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,4.258595\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,4.462389\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,4.755925\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,4.302363\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,4.204735\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,3.934075\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,3.057462\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,4.482624\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,4.795413\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,4.292256\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,4.175413\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,3.956649\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,5.356434\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,3.102262\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,0.8854004\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,0.5933475\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,0.386816\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,-1.071009\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,-0.4554331\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,-0.6911189\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-2.714629\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,-1.731381\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,-2.634654\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,-1.841713\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,-0.5259438\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,-0.3708203\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,0.4748237\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,0.5911643\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,1.373731\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,2.375524\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,2.509325\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,2.280095\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,1.746437\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,1.37266\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,2.301523\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,3.424348\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,3.772526\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,4.328789\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,3.944868\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,3.543242\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,3.236106\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,3.449223\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,3.646175\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,3.139208\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,2.859023\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,1.83845\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,1.865647\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,0.7398462\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,-0.01624277\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,1.864205\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,2.613735\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,2.357975\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,2.327231\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,1.460327\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,0.9747295\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,1.17845\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,1.810881\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,0.4954558\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,0.4494757\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,1.404401\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,2.515926\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,2.551858\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,2.349431\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,1.974944\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,3.046563\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,3.982929\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,4.478689\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,3.270362\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,1.272108\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,2.671461\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,5.758741\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,6.12384\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,6.405207\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,5.386521\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,4.569238\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,4.133105\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,3.214642\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,2.317782\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,2.114644\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,2.026951\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,2.209071\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,2.89586\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,2.151\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,2.463428\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,1.0113\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,1.64467\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,1.530964\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,1.151652\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,1.878791\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,2.692189\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,0.7889944\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,-0.1864214\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,-0.06907728\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,0.2549724\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,-0.3241925\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,1.0148\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,1.233446\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,2.791886\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,3.714936\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,2.710247\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,2.509854\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,3.225109\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,2.743006\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,3.544579\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,4.184873\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,4.369062\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,5.627942\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,5.959476\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,5.450429\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,4.229722\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,2.810089\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,2.779542\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,3.000577\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,4.522537\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,6.466311\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,6.148022\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,4.730347\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,6.950593\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,7.266819\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,6.909369\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,6.102066\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,5.211698\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,5.005634\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,5.341106\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,4.970992\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,5.734863\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,5.153593\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,5.341142\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,5.479447\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,4.575231\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,4.407628\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,4.927782\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,4.876102\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,5.063161\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,4.78103\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,5.232064\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,5.147061\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,5.447962\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,4.663052\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,4.57464\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,4.580558\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,5.549632\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,4.73278\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,4.365789\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,2.953875\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,1.781841\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,2.268054\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,0.8720716\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,0.2871779\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,-0.1828854\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,0.4522589\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,0.576085\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,0.3265966\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,1.058088\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,1.330292\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,0.6531264\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,1.013408\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,1.436751\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,1.697337\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,2.349683\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,2.919298\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,3.126766\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,3.108759\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,2.781911\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,1.976972\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,2.152896\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,2.383382\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,2.358584\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,2.83\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,2.827487\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,2.635077\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,1.787356\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,2.222566\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,1.659648\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,0.963347\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,0.3935413\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,1.503722\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,2.298203\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,2.384341\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,2.220638\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,1.291894\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,0.207484\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,1.181363\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,-0.8183523\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,1.118996\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,-0.08599131\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,-0.1621527\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,-1.942478\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,-2.14458\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,-1.072232\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,-0.723249\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,-2.295252\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,-0.1573991\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,-2.152498\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,-1.320629\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,-2.644154\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,-3.192533\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,-2.9061\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,-3.019734\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-1.340102\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,-1.521425\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,0.1444936\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,-0.4340394\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,0.04618987\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,0.3422549\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,0.2248122\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,0.5320243\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,-0.1411355\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,0.2312521\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,1.082709\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,1.295247\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,0.4345706\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,1.003342\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,1.448187\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,1.598879\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,1.629211\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,1.779568\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,1.725689\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,1.987911\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,1.556365\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,1.88444\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,3.125625\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,2.574096\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,2.636045\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,3.791487\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,4.161222\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,3.307065\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,3.432129\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,2.665736\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,2.521175\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,3.986946\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,4.98965\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,4.058933\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,5.93868\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,4.401216\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,4.520607\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,3.116435\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,5.063028\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,3.349107\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,1.521469\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,0.8253148\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,4.413743\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,5.156631\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,7.149527\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,8.885278\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,10.85321\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,10.6926\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,11.80605\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,12.05239\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,10.15016\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,8.008403\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,5.85355\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,4.686283\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,2.5086\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,2.993435\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,4.965329\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,2.943398\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,2.291653\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,1.354196\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,-0.3967088\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,-1.362938\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,0.2785088\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,-0.1433198\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,-0.03445339\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,1.357337\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,0.4853444\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,0.6220023\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,-0.5981571\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,-1.983448\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,-1.101645\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,-2.407398\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,-1.765996\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,-0.1851695\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,-0.7393736\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,-0.2709491\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,-0.8250465\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,-1.197429\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,-0.3997312\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,-0.1303109\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,1.535772\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,1.298953\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,1.067873\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,1.189445\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,0.951921\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,2.240939\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,2.295736\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,4.257725\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,3.643666\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,5.221766\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,5.588697\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,7.114346\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,4.62362\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,1.668438\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,1.907807\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,0.01445933\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,0.2936224\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,-1.342835\n3/11/2015 3:47:25 PM,205.29,205.5,204.4,204.53,-1.875841"
  },
  {
    "path": "Tests/TestData/spy_with_rsv.csv",
    "content": "Date,Open,High,Low,Close,Volume,RSV9\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,0.0063414884283660945\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,0.006010296974833682\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,0.005908606593766317\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,0.005383285887464726\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,0.004952832843717208\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,0.00449396764457249\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,0.0036801386297302093\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,0.0036602474774449748\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,0.003983742635830433\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,0.00486327863648318\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,0.004919128934091188\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,0.005213557871255144\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,0.005173327131574075\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.0055795260495645795\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.005464008358664374\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,0.005580282539152558\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.0056315929300747155\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.005480411463126456\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.004750311062556865\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.005143840587389835\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.00476049809801937\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.004961886499877929\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.004681595987571382\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,0.005012878380126119\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.005026184262833121\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,0.005096394880564667\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,0.005145379221942788\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,0.005191490073628603\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.005005347441566227\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.005539157363969585\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,0.005791131629057187\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0.005721569061638621\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,0.006067956392009774\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,0.006432214332473369\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0.006319357646020577\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,0.0063434023997384036\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.006324748931886624\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.0062811490705146815\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.005895002370182148\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0.005556256078796438\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.005447412029958709\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,0.004838330424213929\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,0.0042058690793177105\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,0.0042681215642682915\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,0.003892591293579831\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,0.004026170173863833\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,0.003988234828652637\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,0.0037650521969335815\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,0.003690910005076969\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,0.0037919128378128037\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,0.003972533668737428\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,0.004099776412018231\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,0.004152844269203008\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,0.0044731226580269675\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,0.006726613974128869\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,0.006920242480886991\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,0.007015835822779542\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,0.007427853801346703\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,0.007592112067375948\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,0.0076555900066339975\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,0.008423996974966244\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0.008797340817484046\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,0.009172022311115354\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,0.007747062106695669\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0.008084387744811414\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,0.008269588134773881\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,0.007967836736975728\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,0.00819051902009404\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,0.008134868549968236\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.007733065600466022\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.007502040871024594\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0.007203853901390676\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.007035060050656095\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0.00653970981474227\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,0.006728778134731359\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,0.007679521769622471\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,0.008184337521258142\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0.008433431293562683\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0.008181359529113332\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,0.008002724149419745\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,0.007966795649394346\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,0.008238511976611252\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.008475437274194838\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0.008214240762724421\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0.00780967718831578\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0.006960807300320197\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0.006623012580728885\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.006556148991295653\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,0.0065712757408981585\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,0.006272752547714984\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,0.005857319505399518\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,0.005421109860764325\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,0.005142176960968409\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,0.004370689179374105\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,0.004013381863655486\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,0.0037939346611396934\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,0.003493753548314778\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,0.0034881721051708736\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,0.003522124152880045\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,0.004019071438907805\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,0.003931404931750912\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,0.004040590334761586\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,0.0043566976340101695\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,0.004341573545862168\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,0.004326082885832552\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,0.0043640007831977365\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.004304874695734959\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.004338832733134537\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,0.00424397877629459\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.0044511276407749115\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.004333105476437554\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.004421856624680455\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.004485522950192711\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0.004583257845176706\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0.0047884872266245465\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0.004933288275200179\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.005094278616655844\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0.005366043613962208\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.005167552333188971\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0.005360296979633321\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,0.005166158085626822\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,0.005511853335012586\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0.005685659860031151\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0.005959386553237261\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0.005906135592725971\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,0.0061215234039841\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,0.005877817233784331\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.0058441580428029325\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0.0067720223576330455\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,0.006574801894047695\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,0.006259026842123743\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,0.006051383625120438\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,0.005643132328968207\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,0.0054969839784645355\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,0.005058010408714305\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,0.004681775426223029\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,0.005379872579254066\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,0.0039014033482755784\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,0.00397610829827811\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,0.004197337850002688\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,0.004441586190545132\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,0.004509651014110404\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,0.004636145101952453\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.0045807661431247265\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.004914866197190746\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,0.0041984525836781346\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0.004487279544030495\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.005087015687917765\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.005015610596716022\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.005107307537323684\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,0.005187040859560394\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,0.005581916644070639\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,0.005606227716222606\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,0.005405222902240146\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,0.005456117735173119\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0.005551266207356592\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,0.005011254308924856\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,0.004903967368899299\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,0.004608634656479063\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,0.004448528309500735\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,0.003984496062544911\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,0.004090810910046734\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,0.004115490518509659\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,0.003981093439543957\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,0.0035074215108520535\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,0.0034562226733107597\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,0.003924729165769538\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,0.0041690567133654925\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,0.004486488966203732\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,0.004447989309512458\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,0.004502005308824273\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,0.004542140421944936\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.00469812394441893\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.004623584370357659\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,0.004606863639299921\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,0.0043158105487779725\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,0.003944082716530641\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,0.0036406782753026575\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,0.0034252918715610295\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,0.0033964907639071956\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,0.003485301629742071\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,0.0038373636953685725\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,0.00394520300884539\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,0.003981481670311425\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,0.003849474236677265\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,0.003961984530315552\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,0.003842607050716748\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,0.003929642524892683\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,0.0038626890367235243\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,0.0038972111781083157\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,0.004176700999206149\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.00420677551299391\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.0043065988378507255\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,0.0042679246114490765\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.004239401460308916\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.004415645149251057\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0.0044532739582017035\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.0043872399861983056\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.004304626344711004\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0.0035880067238223136\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,0.006008067809526695\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.005995612293400457\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.006145205288979379\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,0.006116348917358638\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,0.005960621654200311\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,0.0058388590949339245\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,0.00576574833886133\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,0.005636652673675737\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,0.005527641608381382\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,0.002959660322545419\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,0.002917536296795178\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,0.002786768564593413\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,0.002853456190441586\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,0.0030884899316957455\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,0.0036009988503143265\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,0.004029067526585261\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.004793849970430971\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.004986531757179518\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.004914557305250237\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.0048969650199722865\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.0049207582948783595\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.005434761472637156\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.005365572694052466\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.005491003953635825\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,0.005269787443465722\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,0.005402300517292206\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0.005298182928829973\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,0.005595501445382284\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0.005837257557136987\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,0.0064469378839283435\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,0.006825248249553913\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0.007156569585487359\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0.0072730536917895005\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0.007405019497948725\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,0.0071546149739724835\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0.007169201467618563\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0.00713102978558192\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,0.00700045550586673\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,0.006435475386874252\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,0.005722604540934623\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,0.005347797578970489\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,0.005447569355973464\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,0.005617871018802413\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,0.005323340782892476\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,0.005878750807841948\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,0.005730277491124389\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,0.005765820882364919\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,0.0057278248088955645\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,0.006068722207998561\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,0.0063535429333223\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,0.0058418381278757545\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,0.005448219440590172\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,0.005397387321873274\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,0.005045933953005429\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,0.005050493468089668\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,0.005132573991534162\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,0.0052180147808461586\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.005189108866649612\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0.005102421758423555\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0.00513178566599128\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0.005243519944208793\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,0.0059899077784664155\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,0.005878450193441419\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0.006639786632384105\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.0069101599462146526\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.007108722624789524\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,0.006859944447090738\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,0.006815562851502431\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,0.006970922432516352\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,0.006909749578587113\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0.006247672013658884\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,0.00614015481296125\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,0.0052247817293437585\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,0.004926434265157135\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.004902586671655687\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.005023727131585218\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0.005078161950946334\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,0.005100458048154315\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,0.005804180906676549\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0.006404020402309928\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0.007522762961599412\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0.007642929115379037\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,0.007548514967535059\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.007287519788729663\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.00715014723686161\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.0069027386182168695\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,0.0068936134045510305\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.006410160389186284\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.006903557585842545\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,0.00566694951876157\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,0.005457735739031512\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,0.005399544668326177\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,0.0056222291652488765\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,0.0057561629291513604\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,0.005771293463763987\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,0.0061358390412494905\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,0.006514174474745641\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.00556994762577448\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,0.005854652436697969\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,0.005775862703009541\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,0.005696788239202175\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.005984745000093283\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,0.0059677877991117815\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.006025617390702025\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.0054991172270641335\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.004863280106932443\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.0047042939817355\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,0.004266562903185269\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,0.004217307256948719\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,0.004195877402505389\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,0.0035652631978848673\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,0.003135093446945006\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,0.0033714102890856183\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,0.003058113251224069\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,0.003135155452303837\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,0.00355459146071806\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,0.003493560623603168\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,0.003617569064488176\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,0.003627142761210001\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,0.0034815090999794187\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,0.0037419950711898987\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,0.003587999728996153\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,0.003723091282937616\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,0.0037413974195088825\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,0.003508515687882768\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,0.0036604323182549458\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,0.003533946895011595\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,0.0034798720372518368\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,0.0041413621099997576\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,0.003961815711349662\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.004433738181174834\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.004323286575825222\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.004288775240968674\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,0.0042672409674139366\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,0.00415209756709417\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,0.0041683675634594155\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,0.004189127149960977\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,0.003744714875395182\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,0.003784071714936202\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.003429904389319326\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.0035555050106171786\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0.0034965380796825587\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0.0037297966414154334\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,0.0038378777100454113\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.004596547466231481\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.004678911467470307\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.004649290004774904\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.004584409707275246\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.004329470342744585\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.004233291008022355\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.004331173999513411\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.004312253059706516\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.004305008519822313\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.003991738855629332\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,0.004073652098210931\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,0.0046865803077039405\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0.005246339639658791\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,0.005728897176627561\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0.006066147368627416\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,0.006347158713716357\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,0.006340319894244471\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,0.006391498551744235\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,0.006230818491029125\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.006170058544979138\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.005593698335630527\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0.0058679860707611135\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.005357772453320354\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.005063766182610616\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,0.004680376449702305\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,0.0043061161822646596\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,0.004243736316655373\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,0.004389175435926572\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,0.004305830468375201\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,0.004313625633470694\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,0.0031431496118784403\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,0.003321180634532138\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,0.003457953429125902\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,0.0034833803921730517\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,0.0039951322737659875\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,0.004314464026137471\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,0.004146075380276496\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,0.004326399298050542\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,0.004577152331557002\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,0.004571812996814213\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.004674216047860947\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.004582439886152484\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.004790421335152714\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0.004853868813903779\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,0.0044956430437925535\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.004564317467487699\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.004550962442762721\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.004582708204658253\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.00490881653362742\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,0.004707563282095984\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0.004921744884604096\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0.00484923521399317\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0.004671235442900924\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,0.005046611357092104\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0.005967033804622845\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0.006137965160110286\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,0.006257264651349279\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,0.006227319721959036\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,0.007333814091588829\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,0.007398034223050606\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,0.007851710873474874\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,0.008191975011239678\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,0.008651051443640487\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0.010981670919073845\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0.011717138013273277\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0.011839436315265748\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,0.011758481774893116\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,0.011197212563902227\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0.011153559449654174\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,0.011032971335857233\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,0.010826525613039185\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,0.010403447356759707\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,0.007091805260956516\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,0.0061366988570718305\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,0.0057098116217003695\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,0.0058017022735834195\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,0.0057234881709687995\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,0.005747685224718861\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,0.005407396488168918\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,0.005314616076256368\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,0.005166908142771377\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,0.0051810227025433815\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,0.004397795113917166\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,0.004207879948461834\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,0.0043401357237526925\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,0.004227167825175188\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,0.0038568122293611575\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,0.003693769665348646\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,0.003589883880639382\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,0.003499237169891835\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,0.0038983749573774135\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,0.0038523241319251985\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,0.003890745310458072\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,0.003471897958054047\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,0.003508231271313293\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,0.0035801454165149\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,0.0035220247513461666\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,0.0032709222652619295\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,0.003625741845803338\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,0.0032507616508024714\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,0.003916062943840332\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.004264426963336189\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,0.00445035337871036\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0.00557876970981203\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,0.0062673391986699705\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,0.007009322078352571\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,0.009805600628778674\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0.010031416471627662\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,0.015315655556358075\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,0.01527525017737758\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0.01516926845831453\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,0.015123302783040667\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,0.014725074518170553\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,0.014421305454067085\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.01405978342940908\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0.012255094881195796\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.012045010763991162\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,0.0043821434387867775\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,0.004407249903644616\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,0.005681528740635088\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0.005932660695290317\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,0.006019211682758808\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,0.006439181910160525\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,0.006834560454413595\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,0.008594345411530742\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.008903136676525635\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,0.008615508921700422\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0.008572003999536969\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,0.0084924723285085\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,0.008668590848428193\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,0.009571879677406959\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0.009332270458746551\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0.009230564838081526\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,0.00807102220644212\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0.007829146666350472\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.008608975954112025\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,0.00917051978670035\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0.009879366805132251\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,0.009687542544272813\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,0.009028746720442531\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,0.009006525524926092\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,0.00910034575080692\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,0.008855434050170977\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,0.00905819516453751\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,0.008274850114909775\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0.007750960943186367\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,0.00594674774399059\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,0.005799447429814993\n"
  },
  {
    "path": "Tests/TestData/spy_with_sobv.csv",
    "content": "Date,Open,High,Low,Close,Volume,SOBV20\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,490366025.0\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,516196930.0\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,546740405.0\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,572273000.0\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,590608965.0\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,620265525.0\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,636435025.0\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,652802635.0\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,655419245.0\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,659790140.0\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,652102385.0\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,642576330.0\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,633918075.0\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,637207100.0\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,641425305.0\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,633661555.0\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,621780180.0\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,623582340.0\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,622425420.0\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,607243665.0\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,605947520.0\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,604407040.0\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,618707750.0\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,633452580.0\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,654736130.0\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,666103345.0\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,686838155.0\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,708290795.0\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,730505605.0\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,751063530.0\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,786569800.0\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,821105030.0\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,855106035.0\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,887207200.0\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,908502660.0\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,940747775.0\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,987754100.0\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1033324270.0\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1096232045.0\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1162002705.0\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1226788460.0\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,1282028225.0\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1333744915.0\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,1368550995.0\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1386286865.0\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1401241430.0\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,1418922575.0\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,1422813590.0\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,1438950985.0\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,1441506690.0\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,1445269985.0\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,1437832055.0\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,1415354500.0\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,1398035770.0\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,1395456160.0\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,1387728140.0\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,1368047445.0\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,1333605665.0\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,1301293570.0\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,1267413325.0\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,1233847370.0\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,1210245290.0\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,1171598655.0\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,1129099235.0\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,1083608855.0\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,1034596445.0\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,986544645.0\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,953225565.0\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,921051110.0\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,889639790.0\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,856415210.0\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,823320535.0\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,804530835.0\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,781833555.0\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,755117640.0\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,734359675.0\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,727538965.0\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,736330275.0\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,742097715.0\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,758383695.0\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,763450475.0\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,767364855.0\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,786789555.0\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,827395985.0\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,885488300.0\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,950627830.0\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,1002035895.0\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,1052270650.0\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,1101412250.0\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,1154580080.0\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,1201163785.0\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1262601070.0\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,1325775990.0\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,1387327775.0\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,1440812615.0\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,1483977950.0\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,1516944850.0\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,1548235565.0\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,1569820785.0\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,1584515355.0\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,1607670280.0\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,1622303615.0\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,1624087355.0\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,1614192590.0\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,1595519585.0\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,1585330520.0\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,1572888405.0\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,1559958280.0\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,1546197025.0\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,1531946560.0\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,1509982325.0\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,1486160925.0\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,1462782590.0\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,1428224805.0\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,1403477560.0\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,1387956390.0\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,1379805400.0\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,1374527385.0\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1378193380.0\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1390520345.0\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1403532090.0\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1416361225.0\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1440430540.0\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1477312740.0\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,1523121370.0\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,1574550030.0\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1626542815.0\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,1666856070.0\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1697402830.0\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,1727398390.0\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,1759379765.0\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,1789934080.0\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,1809662200.0\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,1828919150.0\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,1847385065.0\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,1855346270.0\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,1851346010.0\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,1844206595.0\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,1827914160.0\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,1797554545.0\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,1770883670.0\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,1758040100.0\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,1746831475.0\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,1734882735.0\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,1711077285.0\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,1685250715.0\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,1673190695.0\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1674649350.0\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,1686537630.0\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,1709778975.0\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1733496085.0\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,1756886100.0\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,1789833605.0\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,1834186490.0\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1876550310.0\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,1917778990.0\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,1961159270.0\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,2006848100.0\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,2061582480.0\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,2120871565.0\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,2176111780.0\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,2214220970.0\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,2253907345.0\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,2291342635.0\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,2332363335.0\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,2370329035.0\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,2406998505.0\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,2441903160.0\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,2466681910.0\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,2480476425.0\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,2493288485.0\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,2507188895.0\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,2520478345.0\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,2525583510.0\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,2530663535.0\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,2545430285.0\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,2564115565.0\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,2570699145.0\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,2567222865.0\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,2561872095.0\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,2546848490.0\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,2545627715.0\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,2541081305.0\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,2529352160.0\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,2515273250.0\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,2490438490.0\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,2455068390.0\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,2419365335.0\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,2384113645.0\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,2365237030.0\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,2345759175.0\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,2331525020.0\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,2317499520.0\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,2309701575.0\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,2300729500.0\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,2288846030.0\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,2276871285.0\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,2274165835.0\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,2271281800.0\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,2270477980.0\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,2269646370.0\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,2266745600.0\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,2265169530.0\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,2271991330.0\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,2290421895.0\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,2307143150.0\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,2334481270.0\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,2361932870.0\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,2390250475.0\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,2401453670.0\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,2423917980.0\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,2439586425.0\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,2444367295.0\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,2436450210.0\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,2416374880.0\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,2401742140.0\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,2379187535.0\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,2358134275.0\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,2333327880.0\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,2299870580.0\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,2279996800.0\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,2247639505.0\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,2217077090.0\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,2190523270.0\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,2163468985.0\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,2149971900.0\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,2135965735.0\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,2122066845.0\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,2116594235.0\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,2120514175.0\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,2113709110.0\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,2109108045.0\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,2105220705.0\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,2117459055.0\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,2132854135.0\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,2147723095.0\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,2178040320.0\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,2210084115.0\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,2243484885.0\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,2298086075.0\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,2348861900.0\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,2411935580.0\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,2474263745.0\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,2524315130.0\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,2564826285.0\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,2604490700.0\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,2631727080.0\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,2646250530.0\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,2660865835.0\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,2676561530.0\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,2689751235.0\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,2703546080.0\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,2715091480.0\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,2714896490.0\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,2725716855.0\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,2725637905.0\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,2713762690.0\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,2699429740.0\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,2698449840.0\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,2693435970.0\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,2687944130.0\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,2674473240.0\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,2646678735.0\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,2615592895.0\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,2595077715.0\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,2574328150.0\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,2552642195.0\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,2530292560.0\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,2509639545.0\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,2491756530.0\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,2487886865.0\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,2483429605.0\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,2490535890.0\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,2507970985.0\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,2516550910.0\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,2535519160.0\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,2556582250.0\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,2579316505.0\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,2601267995.0\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,2623844625.0\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,2647128365.0\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,2669376290.0\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,2703865785.0\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,2741120520.0\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,2778064815.0\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,2805333645.0\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,2845428565.0\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,2898217885.0\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,2947718895.0\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,2985756395.0\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,3010841445.0\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,3035536085.0\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,3060003900.0\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,3074611765.0\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,3097350100.0\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,3118758930.0\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,3148238545.0\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,3174568690.0\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,3193397840.0\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,3210360855.0\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,3226493855.0\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,3250753730.0\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,3267972955.0\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,3292234750.0\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,3315779475.0\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,3347931485.0\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,3379152380.0\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,3408879330.0\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,3431850290.0\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,3453127170.0\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,3486248465.0\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,3518868025.0\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,3552542610.0\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,3597050065.0\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,3641399275.0\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,3677674255.0\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,3707371475.0\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,3728669730.0\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,3757405115.0\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,3778722720.0\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,3799793820.0\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,3814116670.0\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,3836204865.0\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,3858134110.0\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,3878106315.0\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,3891062170.0\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,3895363975.0\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,3900463835.0\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,3904052725.0\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,3916159200.0\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,3927094305.0\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,3928097070.0\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,3928859925.0\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,3917144910.0\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,3907351055.0\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,3899181440.0\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,3897914810.0\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,3904726370.0\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,3910224100.0\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,3916093535.0\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,3921851990.0\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,3927109855.0\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,3933056890.0\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,3927234440.0\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,3909313490.0\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,3899031795.0\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,3886525005.0\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,3875101945.0\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,3861849615.0\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,3851235945.0\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,3841416655.0\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,3833481965.0\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,3824996425.0\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,3826592925.0\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,3814983010.0\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,3810506540.0\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,3805597675.0\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,3801047810.0\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,3797064360.0\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,3793116650.0\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,3788903915.0\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,3791074415.0\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,3785648630.0\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,3786463145.0\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,3800025730.0\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,3805416765.0\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,3815567090.0\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,3816735990.0\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,3829781035.0\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,3833770985.0\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,3829614250.0\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,3832495500.0\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,3835265540.0\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,3829303755.0\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,3826517705.0\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,3825774385.0\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,3829640530.0\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,3834617395.0\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,3830134495.0\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,3823183310.0\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,3807487410.0\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,3794785580.0\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,3776974295.0\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,3767251675.0\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,3749480450.0\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,3728818420.0\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,3702144340.0\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,3687578795.0\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,3673985805.0\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,3658361045.0\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,3639780230.0\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,3627144445.0\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,3600672855.0\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,3568989270.0\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,3529621040.0\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,3495216000.0\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,3434236450.0\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,3355001150.0\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,3292550990.0\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,3242852475.0\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,3206432195.0\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,3157081165.0\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,3122964705.0\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,3089514960.0\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,3056681760.0\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,3035689895.0\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,3016460385.0\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,2995023690.0\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,2974856540.0\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,2964603280.0\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,2957071335.0\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,2944810090.0\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,2948384885.0\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,2967515700.0\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,3001444905.0\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,3027323715.0\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,3067720965.0\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,3125876540.0\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,3177336210.0\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,3226334770.0\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,3271404105.0\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,3319935820.0\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,3364362940.0\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,3410056750.0\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,3463172070.0\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,3507002000.0\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,3560769490.0\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,3605991140.0\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,3638679590.0\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,3670413855.0\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,3710250660.0\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,3740952755.0\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,3770867235.0\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,3790884850.0\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,3801354635.0\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,3801147610.0\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,3813370400.0\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,3811237425.0\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,3795609845.0\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,3763017855.0\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,3739257455.0\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,3732458315.0\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,3709861440.0\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,3687565575.0\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,3668017040.0\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,3654567665.0\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,3641159590.0\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,3634622620.0\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,3629603580.0\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,3614347645.0\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,3589577610.0\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,3560896810.0\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,3517220325.0\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,3485220575.0\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,3466775580.0\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,3448411950.0\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,3414913870.0\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,3380803370.0\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,3346541965.0\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,3316453655.0\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,3284324965.0\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,3245890345.0\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,3225759185.0\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,3206903715.0\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,3176149270.0\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,3147832160.0\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,3109972145.0\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,3059751205.0\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,3021868305.0\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,2980624065.0\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,2953585605.0\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,2941212545.0\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,2932587255.0\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,2922595045.0\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,2899020525.0\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,2878972285.0\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,2870934185.0\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,2878126055.0\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,2899808020.0\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,2934943310.0\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,2963337595.0\n"
  },
  {
    "path": "Tests/TestData/spy_with_stoch12k3.txt",
    "content": "Date,Open,High,Low,Close,Stochastics 12 %K 3,%D 5\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,65.7458,\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,49.47259,\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,58.01477,\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,65.09355,\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,83.65073,64.39549\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,90.42255,69.33084\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,90.66809,77.56994\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,66.21764,79.21051\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,56.22887,77.43758\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,35.5218,67.81179\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,31.13871,55.95502\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,21.15591,42.05259\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,27.81375,34.37181\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,47.51071,32.62818\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,60.49776,37.62337\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,73.21424,46.03848\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,75.70345,56.94798\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,83.69353,68.12394\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,89.91679,76.60516\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,90.09174,82.52395\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,91.2682,86.13474\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,89.44349,88.88274\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,96.2514,91.39433\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,96.77655,92.76627\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,98.58655,94.46524\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,95.12104,95.23581\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,93.71279,96.08967\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,92.46336,95.33206\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,96.34877,95.24651\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,96.65057,94.85931\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,93.69971,94.57504\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,93.85982,94.60445\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,91.8642,94.48461\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,93.00379,93.81562\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,79.25126,90.33575\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,64.66115,84.52805\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,48.96277,75.54864\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,49.03177,66.98215\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,46.4015,57.66169\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,45.39144,50.88972\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,27.92899,43.5433\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,23.91738,38.53422\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,15.2642,31.7807\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,14.05625,25.31165\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,14.64051,19.16147\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,27.15612,19.00689\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,46.71005,23.56543\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,49.95367,30.50332\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,39.39801,35.57167\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,40.07658,40.65889\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,42.86515,43.80069\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,59.27237,46.31316\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,70.33366,50.38915\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,73.51187,57.21193\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,52.46168,59.68895\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,26.83994,56.48391\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,12.57793,47.14502\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,19.80759,37.0398\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,27.87527,27.91248\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,40.9357,25.60729\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,46.94606,29.62851\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,50.90968,37.29486\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,51.33205,43.59975\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,54.12606,48.84991\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,59.75231,52.61323\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,73.58824,57.94167\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,88.19596,65.39893\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,95.74902,74.28232\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,96.88654,82.83441\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,95.96808,90.07757\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,96.89312,94.73854\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,94.04947,95.90925\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,93.52354,95.46415\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,92.98811,94.68446\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,96.0195,94.69475\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,97.21043,94.75821\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,95.27634,95.00359\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,87.65425,93.82973\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,82.67474,91.76705\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,78.57465,88.27808\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,71.39177,83.11435\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,62.14585,76.48825\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,55.91384,70.14017\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,69.56747,67.51871\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,84.54752,68.71329\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,95.67828,73.57059\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,85.21724,78.18487\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,68.11574,80.62525\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,59.42014,78.59578\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,55.36218,72.75871\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,54.68593,64.56024\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,50.13945,57.54469\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,39.43958,51.80945\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,26.05821,45.13707\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,10.58667,36.18196\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,4.04564,26.05391\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,6.473342,17.32069\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,6.41073,10.71492\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,16.76322,8.855922\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,25.87711,11.91401\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,34.13741,17.93236\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,24.32907,21.50351\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,14.99147,23.21966\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,10.31365,21.92974\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,14.28191,19.6107\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,20.60677,16.90457\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,36.25237,19.28923\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,54.50978,27.1929\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,67.45091,38.62035\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,78.89561,51.54309\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,89.23445,65.26862\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,99.11688,77.84153\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,96.70566,86.2807\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,95.69894,91.93031\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,91.85752,94.52269\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,94.27875,95.53155\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,93.86102,94.48038\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,94.74256,94.08775\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,84.91842,91.93166\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,73.10004,88.18015\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,57.08553,80.74152\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,39.14742,69.79879\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,27.73577,56.39743\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,16.23582,42.66092\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,15.81137,31.20318\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,18.62127,23.51033\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,26.25319,20.93148\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,25.65489,20.51531\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,24.44555,22.15726\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,17.53687,22.50236\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,14.44684,21.66747\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,10.28284,18.4734\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,34.12377,20.16718\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,66.35549,28.54916\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,93.03187,43.64816\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,91.64094,59.08698\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,91.59327,75.34907\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,91.92649,86.90961\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,98.82681,93.40388\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,98.0784,94.41318\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,96.93721,95.47243\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,93.36143,95.82607\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,92.2223,95.88523\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,93.55268,94.83041\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,96.49026,94.51278\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,98.48499,94.82233\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,93.61698,94.87344\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,86.32262,93.6935\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,79.58543,90.90005\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,78.97688,87.39738\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,75.66708,82.83379\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,79.49779,80.00996\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,60.61718,74.86887\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,68.5329,72.65836\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,68.02175,70.46734\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,84.69869,72.27367\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,88.15216,74.00454\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,90.78285,80.03767\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,98.21785,85.97466\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,92.22002,90.81432\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,84.75636,90.82585\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,73.40303,87.87602\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,76.24859,84.96917\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,84.67532,82.26067\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,93.61585,82.53983\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,93.53326,84.29521\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,92.86634,88.18787\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,91.29745,91.19765\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,84.01936,91.06645\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,67.11268,85.76582\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,53.66932,77.79303\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,39.61102,67.14197\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,50.13269,58.90901\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,64.56157,55.01746\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,79.60284,57.51549\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,57.0587,58.19336\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,30.24795,56.32075\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,9.642576,48.22272\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,18.21236,38.95288\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,22.70859,27.57404\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,52.89116,26.74053\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,72.2133,35.1336\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,94.88997,52.18307\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,94.42749,67.4261\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,95.7728,82.03894\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,98.28989,91.11869\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,97.37568,96.15117\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,96.09515,96.3922\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,96.64736,96.83617\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,90.24535,95.73068\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,83.80821,92.83435\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,73.26998,88.01321\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,71.48572,83.09132\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,70.20604,77.80306\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,67.38543,73.23108\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,70.15084,70.4996\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,49.66656,65.77892\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,52.87613,62.057\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,57.30785,59.47736\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,82.4433,62.48894\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,80.46299,64.55137\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,76.01845,69.82175\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,74.90739,74.228\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,67.12952,76.19233\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,41.16062,67.93579\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,17.54688,55.35257\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,12.43307,42.63549\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,14.04951,30.46392\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,19.97457,21.03293\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,17.0388,16.20856\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,16.13098,15.92538\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,11.13498,15.66577\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,10.1589,14.88764\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,20.69444,15.03162\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,36.50831,18.92552\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,58.52315,27.40396\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,78.52858,40.88268\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,88.54754,56.5604\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,94.79844,71.3812\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,95.49071,83.17768\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,97.49543,90.97214\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,92.43922,93.75426\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,90.98264,94.24129\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,88.61214,93.00403\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,90.55412,92.01672\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,87.8888,90.09539\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,84.78838,88.56522\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,86.76974,87.72264\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,87.41992,87.48419\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,82.21872,85.81712\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,81.5407,84.54749\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,84.12649,84.41512\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,93.18668,85.6985\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,91.99614,86.61375\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,88.82784,87.93557\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,80.14429,87.65629\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,73.06451,85.44389\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,53.99857,77.60627\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,37.5559,66.71822\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,31.47787,55.24823\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,47.34485,48.68834\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,57.89437,45.65431\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,65.79765,48.01413\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,53.59093,51.22114\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,44.42442,53.81045\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,33.62429,51.06633\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,24.67236,44.42193\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,21.89432,35.64127\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,18.63608,28.6503\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,35.0261,26.77063\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,58.91927,31.82963\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,80.30762,42.95668\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,89.69688,56.51719\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,75.74439,67.93885\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,46.53318,70.24026\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,25.13447,63.48331\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,29.86104,53.39399\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,28.41551,41.13772\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,20.97218,30.18328\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,8.353784,22.5474\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,18.75249,21.271\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,37.06795,22.71238\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,50.77473,27.18423\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,62.05799,35.40139\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,69.09019,47.54867\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,77.77438,59.35305\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,85.66274,69.07201\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,82.93375,75.50381\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,80.25396,79.14301\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,79.87783,81.30054\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,88.90083,83.52583\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,93.68233,85.12974\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,88.72044,86.28708\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,83.87587,87.01146\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,67.42072,84.52003\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,65.39072,79.81802\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,59.48955,72.97945\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,68.89951,69.01527\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,78.3375,67.9076\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,87.17207,71.85787\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,86.30225,76.04018\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,64.08516,76.9593\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,48.97963,72.97532\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,46.56095,66.62001\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,47.69481,58.72456\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,55.85808,52.63573\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,62.28279,52.27525\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,82.89262,59.05785\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,92.25098,68.19585\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,95.77804,77.8125\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,96.69237,85.97936\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,96.45155,92.81311\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,98.73724,95.98203\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,97.89603,97.11105\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,97.94044,97.54353\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,97.52184,97.70942\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,98.30586,98.08028\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,96.71546,97.67593\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,95.27299,97.15132\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,88.11343,95.18592\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,73.52548,90.38665\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,62.28814,83.18311\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,55.29462,74.89893\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,62.09421,68.26318\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,74.76354,65.5932\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,88.22096,68.5323\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,92.54725,74.58411\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,86.56042,80.83728\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,69.33501,82.28544\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,65.23392,80.37952\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,61.03141,74.9416\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71.72873,70.7779\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,72.58195,67.98221\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,78.62341,69.83988\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,82.58276,73.30965\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,90.75056,79.25348\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,89.53839,82.81541\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,76.60264,83.61955\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,67.94875,81.48462\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,58.57374,76.68282\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,61.53845,70.84039\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,65.3847,66.00966\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,70.64803,64.81873\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,80.70411,67.3698\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,59.60759,67.57658\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,63.98386,68.06566\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,57.58539,66.5058\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,80.7821,68.53261\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,84.9205,69.37589\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,91.30771,75.71591\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,83.56965,79.63307\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,73.84648,82.88528\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,57.88763,78.3064\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,49.95418,71.31313\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,28.84782,58.82115\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,19.02886,45.91299\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,15.12047,34.16779\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,17.47442,26.08515\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,17.47096,19.58851\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,9.026229,15.62419\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,16.55213,15.12884\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,26.08762,17.32227\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,36.78133,21.18365\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,44.34594,26.55865\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,54.27105,35.60761\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,69.94862,46.28691\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,84.74594,58.01858\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,93.85754,69.43382\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,98.0103,80.16669\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,97.50408,88.8133\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,96.06689,94.03695\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,95.64752,96.21727\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,94.51572,96.34891\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,94.16748,95.58034\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,92.21181,94.52189\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,93.72135,94.05278\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,94.23631,93.77054\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,91.11395,93.09018\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,80.64664,90.38601\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,78.06667,87.55698\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,72.87344,83.38741\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,57.37821,76.01579\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,43.94224,66.58144\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,40.37817,58.52775\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,39.86209,50.88683\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,30.69084,42.45031\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,34.4163,37.85793\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,52.06427,39.48233\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,78.85952,47.1786\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,78.95428,54.99704\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,62.30644,61.32016\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,29.76759,60.39042\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,23.32299,54.64217\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,16.44581,42.15942\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,25.59014,31.48659\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,18.55502,22.73631\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,23.66771,21.51633\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,15.85271,20.02228\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,14.44824,19.62276\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,23.47615,19.19996\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,35.39266,22.56749\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,32.08459,24.25087\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,37.01188,28.4827\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,25.03084,30.59922\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,21.44804,30.1936\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,2.296402,23.57435\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,2.479115,17.65325\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,11.4623,12.54334\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,20.37913,11.613\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,32.34962,13.79331\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,40.9864,21.53131\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,57.56804,32.5491\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,67.57706,43.77205\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,78.67353,55.43093\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,85.79173,66.11935\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,94.43674,76.80942\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,98.83879,85.06357\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,97.26748,91.00166\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,97.58907,94.78477\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,97.32751,97.09192\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,97.75645,97.75586\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,94.99097,96.9863\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,94.52264,96.43733\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,95.70677,96.06087\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,97.97769,96.19091\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,98.51835,96.34328\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,98.39567,97.02422\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,97.78452,97.6766\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,95.33723,97.60269\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,93.1573,96.63861\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,91.48181,95.2313\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,92.03387,93.95895\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,90.69901,92.54184\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,91.37819,91.75004\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,87.24625,90.56783\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,87.53139,89.77774\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,84.90049,88.35107\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,89.6972,88.1507\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,88.60128,87.59532\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,78.67455,85.88098\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,73.95329,83.16536\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,76.81996,81.54926\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,87.01111,81.01204\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,89.52032,81.19585\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,76.99402,80.85974\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,67.27602,79.52428\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,38.97852,71.956\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,27.67866,60.08951\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,9.140162,44.01347\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,10.26739,30.66815\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,2.843207,17.78159\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,15.01508,12.9889\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,32.18182,13.88953\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,51.12909,22.28732\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,59.98235,32.23031\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,62.12222,44.08611\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,64.87978,54.05905\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,67.01965,61.02662\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,69.15951,64.6327\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,68.78448,66.39313\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,62.38694,66.44607\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,55.12903,64.49592\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,41.43053,59.3781\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,26.77803,50.9018\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,21.47484,41.43987\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,36.90777,36.34404\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,52.40442,35.79912\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,53.5243,38.21787\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,40.94197,41.05066\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,30.49515,42.85472\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,19.50932,39.37503\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,19.5204,32.79823\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,26.18628,27.33063\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,43.84247,27.91072\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,65.17039,34.84577\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,78.35667,46.61525\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,88.39478,60.39012\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,74.16351,69.98557\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,53.84582,71.98624\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,39.49341,66.85084\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,25.6377,56.30704\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,34.87463,45.60301\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,47.70056,40.31042\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,68.4127,43.2238\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,84.924,52.30992\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,84.55322,64.09303\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,84.00832,73.91976\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,83.19115,81.01788\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,87.3894,84.81322\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,96.45478,87.11938\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,97.81594,89.77192\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,99.06158,92.78257\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,98.76295,95.89693\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,97.06625,97.8323\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,97.24445,97.99023\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,97.19722,97.86649\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,98.05073,97.66432\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,95.92715,97.09716\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,92.6908,96.22207\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,85.48459,93.87009\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,86.41051,91.71275\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,79.56604,88.01582\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,68.69402,82.56919\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,53.37127,74.70528\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,33.26828,64.26202\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,27.19448,52.41882\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,10.99318,38.70424\n3/11/2015 3:48:33 PM,205.29,205.5,204.4,204.57,9.122028,26.78984"
  },
  {
    "path": "Tests/TestData/spy_with_vtx.csv",
    "content": "Date,Open,High,Low,Close,Volume,plus_vtx,minus_vtx\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,,\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,,\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,,\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,1.2301626416954157,0.786594381468702\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,1.2756302521008414,0.8156862745098044\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,1.2159911160466397,0.6812881732370888\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,1.1296082949308757,0.7995391705069113\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,1.0939675174013925,0.7662412993039436\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,1.0834319526627219,0.7455621301775134\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,1.0334528076463563,0.7580645161290309\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,0.9277251184834139,0.7831753554502351\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,0.9344827586206903,0.7775862068965512\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,0.8953744493392083,0.7907488986784135\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,0.9293924466338279,0.7952928297755892\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,0.9010752688172056,0.8166666666666668\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,0.9183889772125086,0.7896131425543191\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,0.8459633481921764,0.8132738979692926\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,0.827687776141386,0.8964162984781562\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,0.8051330798479089,0.911121673003802\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,0.9128352490421472,0.8587164750957857\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,1.0009852216748774,0.7940886699507398\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,0.9890891840607215,0.7618595825426941\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,1.1156824782187809,0.7037754114230398\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,1.0657322377960359,0.7452875785403579\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,0.9221183800623042,0.8059635068980862\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,0.9011035653650252,0.8268251273344639\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,0.8180746561886045,0.843222003929273\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,0.7668828691339181,0.9057611598626469\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,0.7931818181818181,0.9034090909090895\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,0.8072512023677384,0.8919718830928594\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,0.9157261098570341,0.8310759969902171\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,0.956587966488955,0.7821782178217807\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,1.040297339593113,0.717527386541471\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,0.9871794871794863,0.772435897435898\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,0.9584498601677991,0.7678785457451066\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,0.9325562031640312,0.8355537052456296\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,0.8440442079410564,0.8743348342202216\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,0.8845377472749302,0.8255954784012924\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,1.0797413793103456,0.7612068965517259\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,1.1006054960409886,0.7405682347461604\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,1.2655279503105599,0.6744306418219485\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,1.3520518358531337,0.5712742980561589\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,1.332423580786028,0.5573144104803531\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,1.3130335799658521,0.603301081388733\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,1.2613095238095262,0.6523809523809558\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,1.2095238095238117,0.6000000000000039\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,1.2577777777777805,0.6083333333333368\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,1.2820652173913076,0.585326086956523\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,1.2637774210807942,0.6003210272873218\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,1.3029649595687351,0.5719676549865241\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,1.344280240831968,0.5511767925561046\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,1.2324902723735423,0.574902723735411\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,1.1131243878550454,0.7737512242899132\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,1.0917647058823536,0.8127058823529419\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,1.1332453825857531,0.7634124890061581\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,1.0177664974619283,0.8663282571912018\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,1.0487804878048779,0.8469301934398664\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,0.9625771604938272,0.864583333333335\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,0.9345304900860457,0.9476243920688374\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,0.9120556980578967,0.98644192011726\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,0.8090844570617455,1.0805535841022003\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,0.7809523809523805,1.0972789115646262\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,0.8592914438502665,1.07052139037433\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,0.8712474983322204,1.0733822548365561\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,0.8165256994144428,1.0982433311646047\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,0.816064799190009,1.1498481268984115\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,0.8540856031128397,1.0385862516212692\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,0.908127208480564,1.0179890780597476\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,0.8723127035830606,1.054723127035828\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,0.9643446682073278,0.9785407725321859\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,0.9013681196309242,1.0076360165447\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,0.8716381418092896,1.0733496332518313\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,0.8422161999397759,1.0870219813309223\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,0.775014628437682,1.1234640140432977\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,0.8635558180744238,1.0466627288836372\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,0.922222222222222,0.971471471471471\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,0.8724053724053721,0.9890109890109886\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,0.8046287947099486,1.0153291253381422\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,0.8782687105500445,0.9449954914337236\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,0.8918835192069389,0.9442379182156121\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,0.8867123734900415,0.962128632060071\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,0.8689272905119007,0.9243560482556228\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,0.9143333333333327,0.9076666666666663\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,0.9131746563861873,0.8933959101575584\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,0.9616736990154701,0.8699015471167355\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,1.1007957559681685,0.7051913603637724\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,1.1915662650602385,0.5807228915662639\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,1.3355614973262,0.4759358288770045\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,1.2585568917668777,0.5083256244218286\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,1.2368038740920055,0.5588377723970923\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,1.2079842286840772,0.5603745687530785\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,1.2755465175393956,0.5271987798678187\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,1.303162486368589,0.5599781897491816\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,1.3568129330254013,0.5184757505773675\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,1.3203438395415446,0.48997134670487125\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,1.2555092316855239,0.595592614651579\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,1.1260257913247342,0.6776084407971864\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,1.1091127098321334,0.748800959232615\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,1.0924924924924917,0.7603603603603607\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,1.0821039127645926,0.8127004490057741\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,1.0532859680284195,0.7246891651865025\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,1.03957471943296,0.7531010041346735\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,1.09723076923077,0.741538461538464\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,0.9969951923076933,0.7830528846153857\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,0.9169696969697,0.8921212121212153\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,0.934640522875819,0.8472964943553198\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,0.8850114416475992,0.886727688787189\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,0.8644356211003976,0.9376063528077175\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,0.9145642201834872,0.9048165137614712\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,0.9448275862068977,0.8655172413793132\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,0.895708853883758,0.9348180336773514\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,0.835490830636461,0.9757281553398095\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,0.7952380952380951,1.010052910052913\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,0.7807063784923565,1.0358460727464451\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,0.7300908605024047,1.154997327632284\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,0.7526881720430105,1.125960061443934\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,0.7872872872872889,1.0960960960960981\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,0.8527944111776442,1.0593812375249512\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,0.8277136258660491,1.0785219399538113\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,0.8044871794871783,1.1346153846153841\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,0.8321266968325779,1.104524886877828\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,0.8402130492676413,1.0901020861074122\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,0.8628646060078352,1.0661732694819333\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,0.8737373737373728,1.040824915824917\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,0.9986225895316804,0.9788797061524345\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,0.9701943844492442,0.9205183585313188\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,1.0688328345446776,0.8537836682342902\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,1.119672836848902,0.8243650452001734\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,1.1577540106951876,0.7883244206773639\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,1.1643454038997219,0.7999071494893242\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,1.1264150943396225,0.8264150943396242\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,1.1451612903225818,0.7907834101382496\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,1.268899036022325,0.7026889903602235\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,1.2630834512022642,0.5869872701555887\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,1.3517978620019442,0.5971817298347928\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,1.2593457943925261,0.6280373831775716\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,1.183173076923078,0.7475961538461557\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,1.1576866040533886,0.7686604053386074\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,1.061985472154965,0.8179176755447961\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,1.139004149377595,0.8246887966804982\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,0.999468367889421,0.9074960127591701\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,0.8507772020725389,0.9601036269430047\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,0.8926582278481009,0.9377215189873408\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,0.8697355533790401,0.9554358472086177\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,0.8225952813067137,0.9614337568058066\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,0.8240997229916881,1.0166204986149578\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,0.7866666666666644,1.024444444444445\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,0.6879010082493102,1.1736938588450965\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,0.5707295373665452,1.2353202846975093\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,0.7220367278797969,1.0759599332220366\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,0.8403639371381296,0.9648469809760122\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,0.8644408688656459,0.9304102976669327\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,0.8954813359528475,0.9076620825147326\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,0.903659447348766,0.8472740851381613\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,0.9731299927378355,0.7919389978213496\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,1.1045437753971183,0.739194680458071\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,1.0942607373622195,0.7590269859369055\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,1.1154576528674516,0.698442840865932\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,1.1198899371069189,0.7020440251572326\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,1.1174808235769076,0.6794509487282998\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,1.1780650542118438,0.6346955796497079\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,1.297465540240107,0.5526900844819927\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,1.3687585890975724,0.4319743472285846\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,1.3126873126873135,0.49850149850149916\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,1.2314674735249622,0.578416540595059\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,1.206555671175858,0.619146722164413\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,1.2352702153596096,0.5914939726398496\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,1.2097638707808196,0.6795596117630025\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,1.2186884749356355,0.6734817507193718\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,0.997237187456832,0.7552148086752333\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,0.9767881922543218,0.8052226567427792\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,1.0639957688747854,0.8603728679095608\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,1.102452906897954,0.8379184171296925\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,1.0532462639708666,0.8211729247770959\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,1.127549128661476,0.8062044246693868\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,1.1511756740120653,0.7926874307521851\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,1.1073276380700285,0.8233666225484304\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,1.1319885443904871,0.8620346158635284\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,1.0987056973509126,0.8330712471271315\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,1.1361620520196571,0.7967158096607935\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,1.1422619047619051,0.7747619047619042\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,1.1986368062317436,0.7497565725413833\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,1.169398907103825,0.7928464977645298\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,1.3049327354260087,0.7729820627802668\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,1.3368034292712803,0.7005511328842609\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,1.1711071640023676,0.7424511545293058\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,1.1280417149478537,0.7902665121668594\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,1.0978324545987088,0.8441710603397758\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,0.9958506224066377,0.9460580912863039\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,0.9494227597581065,0.8949972512369406\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,1.0103211009174282,0.873279816513758\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,0.9947245017584976,0.84935521688159\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,0.9152348224513163,0.8854524627720471\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,0.8404004711425186,1.029446407538277\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,0.7852468768590117,1.0880428316478263\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,0.7814793901750422,1.0203274985883657\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,0.7479224376731297,1.0448753462603864\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,0.7379972565157743,0.9318701417466846\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,0.886353263350068,0.95664080328617\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,0.9060948081264103,0.9295711060948068\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,1.00594421582076,0.8417924096936424\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,1.0697329376854612,0.8150346191889197\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,1.0685404339250502,0.7435897435897424\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,1.083735909822868,0.8035426731078903\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,1.0376226826608537,0.8462377317339151\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,1.0813449023861188,0.7901301518438187\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,1.0852459016393445,0.760655737704918\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,1.1348376444689061,0.6752889378095768\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,1.1007462686567173,0.6769722814498926\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,1.0989724175229862,0.7068685776095186\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,1.1324575807334438,0.679255610290092\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,1.2138157894736863,0.7473684210526311\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,1.0051880674448777,0.743190661478599\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,0.9138954869358694,0.7844418052256535\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,0.8823529411764727,0.8605042016806735\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,0.954935622317598,0.8213519313304734\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,0.939262472885034,0.8736442516268991\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,0.8965879265091865,0.9002624671916023\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,0.8937530742744715,0.8829316281357602\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,0.9234592445328036,0.9304174950298222\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,0.9293771456596372,0.9445806768023544\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,0.769461077844312,0.9576561163387519\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,0.730452674897119,1.0456790123456796\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,0.7541390728476816,1.0844370860927135\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,0.6993309720582445,1.0909090909090908\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,0.7335092348284955,1.016584998115341\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,0.6883351390393638,1.0379198266522214\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,0.6580469547465122,1.0656685947601228\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,0.6517395797450908,1.1488115742335512\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,0.5869638635596074,1.1962174940898347\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,0.6497266001929868,1.1145062721132197\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,0.7489953632148368,1.0374034003091184\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,0.7977135598602721,1.0422356303588445\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,0.8066746843054711,0.9618159951894164\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,0.9125391849529784,0.9394984326018807\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,1.0042890135268887,0.9039920818211813\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,1.1243243243243235,0.7902027027027025\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,1.1293310463121786,0.7787307032590056\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,1.1635674931129476,0.7541322314049591\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,1.1407017543859646,0.8407017543859642\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,1.2406318883174143,0.8005143277002199\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,1.3901363271852432,0.6824378508420201\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,1.385836385836384,0.5974765974765972\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,1.4160066694456017,0.5756565235514797\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,1.3692838654012078,0.6341673856773073\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,1.3049366535605078,0.6671035386631713\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,1.1367521367521363,0.7330077330077328\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,1.1507557677008748,0.766905330151154\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,1.1144480519480506,0.7743506493506502\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,1.1729355814958913,0.7509727626459138\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,1.0787984327383544,0.7845015237266004\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,1.0193050193050188,0.8232518232518241\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,1.0410544511668103,0.8210890233362136\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,1.0141155712395233,0.8584031760035296\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,0.9148936170212753,0.8602970694500193\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,0.8987921699291959,1.0116618075801749\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,0.909531502423263,0.9151857835218096\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,0.9393697646589545,0.8639808536098935\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,0.9001536098310293,0.8782642089093717\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,0.8907757622539555,0.928984947896567\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,0.9779969650986349,0.8547040971168444\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,0.8752421542037981,0.9930259589306478\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,0.8782576321667924,1.001489203276248\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,0.8620689655172418,1.0073891625615776\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,0.8379809389339931,1.090363572184964\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,0.8782338737495696,1.0124180751983458\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,0.9044652128764291,0.9681550709588117\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,0.9541507467870801,0.8791246960750265\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,1.0230623818525535,0.8635160680529318\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,1.0281797410510307,0.7757044935262772\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,0.9484684684684702,0.8360360360360375\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,0.8416637539321924,1.002446696959105\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,0.8618962432915926,1.034347048300536\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,0.8988243676522987,0.9700748129675799\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,0.8267394270122786,1.0092087312414737\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,0.8174603174603174,1.0714285714285714\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,0.801299589603283,1.068057455540355\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,0.8181511470985159,1.048245614035087\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,0.9442601194426009,0.92733908427339\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,0.9510961214165256,0.9507588532883621\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,0.9550991994430901,1.0038287504350827\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,0.965205288796102,0.9993041057759207\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,0.9464222770532248,1.04335565738456\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,0.9371946964410313,1.0296580600139555\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,0.9478164322723898,1.069948186528495\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,0.9985353350421083,0.9351885756133269\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,1.0843960990247554,0.8807201800450096\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,1.033989957512552,0.9269988412514466\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,1.15641476274165,0.9028998242530726\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,1.237619263970921,0.7155838255338456\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,1.1790095411176726,0.7401181281235772\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,1.1772879731672259,0.7781504551988481\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,1.0134035423647665,0.8635710866443259\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,1.0204556020455602,0.853091585309157\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,0.9789280806229954,0.9102153000458079\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,0.9928539526574365,0.8878963823135327\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,1.064228367528992,0.8425512934879564\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,1.0338906461816526,0.8825124265702653\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,0.9912087912087892,0.8971428571428567\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,1.0443303779747999,0.9351376574894998\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,0.9921441774491675,0.9260628465804067\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,0.9640745793542497,0.9549795361527962\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,0.9618625277161855,0.9241685144124162\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,0.995069475571492,0.902734199910353\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,1.0836859426422183,0.8467324870709917\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,1.1301633045148876,0.8006724303554252\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,1.1809378185524972,0.7680937818552482\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,1.1469017094017087,0.7836538461538446\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,1.2024070021881823,0.701312910284461\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,1.1444188722669717,0.7830840046029893\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,1.0586881472957395,0.8193325661680066\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,1.1211594202898536,0.7681159420289838\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,1.3032490974729236,0.6287605294825502\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,1.4045707226683122,0.5299567634342168\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,1.3910828025477662,0.5242038216560496\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,1.4345762711864387,0.5111864406779675\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,1.3528169014084481,0.5697183098591562\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,1.1826729348556086,0.6541302887844204\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,1.1451398135818924,0.722370173102532\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,1.1200269723533396,0.744436952124076\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,1.1195009848982282,0.7491792514773485\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,1.1326720396776198,0.7123372597644159\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,1.1757425742574275,0.7233910891089131\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,1.1520100502512571,0.7386934673366857\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,1.1240506329113946,0.7341772151898743\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,1.054231227651968,0.7467222884386191\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,1.0146699266503691,0.86674816625917\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,0.9034360189573477,0.9300947867298607\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,0.9252941176470613,0.9523529411764736\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,0.9781194559432319,0.9112950916617399\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,1.041807909604522,0.8067796610169508\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,1.186471663619745,0.7885435709932977\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,1.190881458966565,0.7051671732522793\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,1.1305674191580244,0.7327638804148867\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,1.014134275618375,0.7856301531213196\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,1.008094645080948,0.8518057285180588\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,0.8394919168591236,0.8856812933025408\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,0.9097658480868098,0.8863506567675623\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,0.9687328579264967,0.8573779484366445\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,0.9660167130919258,0.8668523676880241\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,1.0280802292263633,0.8017191977077384\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,0.9258861439312597,0.8147153598281431\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,0.9066599394550986,0.8213925327951574\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,0.8768930141670755,0.8505129457743045\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,0.9089989888776561,0.897371081900911\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,0.8800599700149933,0.8765617191404309\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,0.8813905930470363,0.9089979550102261\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,0.8587939698492472,0.9266331658291466\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,0.9097859327217133,0.9102956167176353\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,0.9029850746268646,0.9014925373134332\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,0.9393633148054563,0.9186457806973225\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,0.7568988173455969,0.9653964082347791\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,0.6726966764829598,1.0753050063104763\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,0.7438220757825357,1.0613673805601311\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,0.685636856368563,1.0871080139372824\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,0.7452943532238675,1.1121345614737692\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,0.7171597633136081,1.1143984220907304\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,0.7451868629671559,1.092865232163081\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,0.7988010490820526,1.0835518920944183\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,0.7653775322283604,1.1116022099447516\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,0.7816173851086566,1.0676879230495193\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,0.8511022768341159,1.0234911456451043\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,0.8570427470217241,0.9856341976173802\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,0.8966597077244266,0.9394572025052197\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,0.9453319133830327,0.8775292864749744\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,1.1081616481774983,0.8019017432646596\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,1.2080368354960254,0.680619506069484\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,1.1903497122620643,0.6892430278884455\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,1.2675990675990692,0.6116550116550094\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,1.3464955577492599,0.5384995064165817\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,1.3937738940469688,0.5161114145275784\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,1.3732856290995832,0.5038759689922454\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,1.2706027060270595,0.5264452644526424\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,1.3220024721878878,0.4765142150803428\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,1.31439393939394,0.5233585858585835\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,1.2102137767220902,0.5914489311163859\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,1.2432432432432423,0.6560196560196541\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,1.1992385786802022,0.750634517766495\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,1.0824108241082395,0.8683886838868363\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,1.0337146297411182,0.9295605057194453\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,1.0041224970553588,0.9593639575971716\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,0.9729881823297684,0.9589195272931899\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,0.9380428488708732,1.0561667631731324\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,0.8946814112690892,0.9873617693522903\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,0.9797930014785611,0.9344504682109409\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,1.05558264261336,0.8951730862993673\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,0.9952852428099955,0.9179632248939177\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,0.9083900226757367,0.9873015873015886\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,0.8574650428506996,1.0568335588633295\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,0.8648528099910807,1.0446030330062457\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,0.8102799832845816,1.030923526953615\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,0.7957206297941066,1.0540976988292314\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,0.8271852445870097,1.0485164394546929\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,0.8567460317460323,1.0178571428571423\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,0.745018450184502,1.068634686346864\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,0.7245188880969355,1.126514611546686\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,0.8140161725067392,1.0074123989218329\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,0.8249318801089922,1.0367847411444147\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,0.6944262295081967,1.1059016393442629\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,0.6707891637220261,1.0750883392226154\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,0.7201318319143094,1.0790991485855543\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,0.7234042553191489,1.1231382978723405\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,0.6808669656203287,1.1497259591429996\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,0.6898159509202444,1.1906748466257675\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,0.6297409805735419,1.2257169287696585\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,0.6706625980819524,1.2024847428073229\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,0.7611029256998526,1.1128183540307302\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,0.7622406639004146,1.1051867219917018\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,0.8718105735864465,1.0187793427230056\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,0.9261164848734317,0.9689236468409145\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,0.8881711748082363,0.962858296326202\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,0.8826736672051705,0.9703150242326338\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,0.9511176101942772,0.9427616461249225\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,0.9923195084485414,0.922756199253896\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,0.9895049053159947,0.8973305954825467\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,1.0520055970149265,0.8148320895522393\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,1.1784422474077658,0.7173860622136488\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,1.2055722891566283,0.6566265060240962\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,1.3329605814928724,0.5772994129158503\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,1.3665644171779157,0.4907975460122687\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,1.284970722186077,0.5500975927130768\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,1.3161839863713818,0.5410562180579203\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,1.2871775417298943,0.5811836115326233\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,1.2815533980582523,0.5711974110032343\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,1.2953929539295395,0.6535682023486875\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,1.2853860294117643,0.633731617647057\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,1.2927522501184265,0.636665087636189\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,1.2517694641051562,0.7077856420626867\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,1.2961599158337702,0.658600736454497\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,1.2709141274238223,0.6880886426592782\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,1.1627771295215865,0.7368728121353546\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,1.2005479452054792,0.6783561643835598\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,1.3344927536231912,0.6330434782608699\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,1.2781100478468947,0.6794258373205739\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,1.2962728995578066,0.7056222362602642\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,1.2278481012658249,0.7196202531645557\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,1.0975463794135283,0.8013165769000596\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,1.084515031196826,0.7804878048780481\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,1.1768018018018047,0.7319819819819819\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,1.1604519774011322,0.7581920903954812\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,1.178151260504206,0.7294117647058823\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,1.0852956567242311,0.770277341705913\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,0.9447186574531107,0.9274432379072048\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,0.8913525498891356,0.9241685144124163\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,0.9126819126819128,0.9039501039501024\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,0.732192598487862,1.0668523676880215\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,0.6627618033368821,1.0976215832445844\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,0.674968474148801,1.1034047919293803\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,0.7038396386222464,1.0827216261998855\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,0.8494741454864148,0.8562664329535483\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,0.9180939833113743,0.9650856389986805\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,0.9275072270402486,0.979764287302645\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,0.9188645507375944,0.9810013410818048\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,0.9335616438356158,0.9805936073059343\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,0.9156050955414005,0.9629208371246576\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,0.948356807511736,0.9507042253521115\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,0.9720262709802966,0.918268061298953\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,0.9554124349764674,0.9180084220956148\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,0.9190809190809196,0.9690309690309687\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,0.9043648847474258,0.95610593428151\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,0.8941320293398537,0.9650366748166258\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,0.9378502292409578,0.933265410086602\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,0.9725956566701144,0.8738366080661842\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,0.834265044393292,1.1466622821440329\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,0.7347784507491227,1.0204016576346842\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,0.7005377865836397,0.9971695442966327\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,0.6200999736911337,1.1068139963167587\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,0.643385982230997,1.08045409674235\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,0.6527745258721611,1.1039569187543898\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,0.7051541751069095,1.0823767724510465\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,0.752938615585546,1.0537657814540704\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,0.83343955810495,0.993414064159762\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,0.9091108190976778,0.9680245291283397\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,0.9718179718179711,0.9452529452529451\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,0.9499188499884071,0.9093438441919778\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,0.8888141672270788,0.932302174400359\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,0.828301036502929,1.0349256421811623\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,0.8496966973713771,1.0435857110761626\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,0.8615217391304352,1.0056521739130433\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,0.9795268425841672,0.9711101000909915\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,1.070415879017013,0.8771266540642723\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,1.0777214578807628,0.8571083755732556\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,1.091403162055335,0.8258399209486162\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,1.0327079107505068,0.8846348884381342\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,1.026013771996939,0.8689109920938531\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,1.021138211382113,0.922222222222222\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,0.9840722059994684,0.8776214494292537\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,1.0580453563714898,0.8380129589632829\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,1.1716353111432691,0.8092619392185239\n"
  },
  {
    "path": "Tests/TestData/spy_with_vwap.txt",
    "content": "Date,Open,High,Low,Close,Volume,Moving VWAP 50\n04/28/2014 12:00:00 AM,187.05,187.69,184.96,186.88,134928700,\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83898900,\n04/30/2014 12:00:00 AM,187.44,188.5,187.18,188.31,101247200,\n05/01/2014 12:00:00 AM,188.22,188.84,187.73,188.32,92857900,\n05/02/2014 12:00:00 AM,188.31,189.14,187.78,188.06,97967100,\n05/05/2014 12:00:00 AM,187.14,188.55,186.62,188.42,75816400,\n05/06/2014 12:00:00 AM,188,188.13,186.74,186.78,85333700,\n05/07/2014 12:00:00 AM,187.43,187.97,186.01,187.88,106320700,\n05/08/2014 12:00:00 AM,187.67,189.05,187.08,187.68,93479100,\n05/09/2014 12:00:00 AM,187.69,188.04,186.83,187.96,83638400,\n05/12/2014 12:00:00 AM,188.76,189.88,188,189.78,86869000,\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66402200,\n05/14/2014 12:00:00 AM,189.79,189.88,188.79,189.06,72236700,\n05/15/2014 12:00:00 AM,188.67,188.72,186.48,187.4,154870300,\n05/16/2014 12:00:00 AM,187.51,188.13,186.72,188.05,97346200,\n05/19/2014 12:00:00 AM,187.69,188.89,187.52,188.74,63652800,\n05/20/2014 12:00:00 AM,188.64,188.67,187.07,187.55,111495700,\n05/21/2014 12:00:00 AM,188.1,189.22,188.06,189.13,88989000,\n05/22/2014 12:00:00 AM,189.18,189.98,188.86,189.59,61509200,\n05/23/2014 12:00:00 AM,189.75,190.48,189.59,190.35,61092800,\n05/27/2014 12:00:00 AM,191.05,191.58,190.95,191.52,71932300,\n05/28/2014 12:00:00 AM,191.52,191.82,191.06,191.38,66064100,\n05/29/2014 12:00:00 AM,191.82,192.4,191.33,192.37,64122300,\n05/30/2014 12:00:00 AM,192.19,192.8,192.03,192.68,76206700,\n06/02/2014 12:00:00 AM,192.95,192.99,191.97,192.9,64215900,\n06/03/2014 12:00:00 AM,192.4,192.9,192.25,192.8,64982200,\n06/04/2014 12:00:00 AM,192.47,193.3,192.26,193.19,55017100,\n06/05/2014 12:00:00 AM,193.41,194.65,192.7,194.45,91942200,\n06/06/2014 12:00:00 AM,194.87,195.43,194.78,195.38,78649300,\n06/09/2014 12:00:00 AM,195.35,196.05,195.17,195.58,65005600,\n06/10/2014 12:00:00 AM,195.33,195.64,194.92,195.6,54728800,\n06/11/2014 12:00:00 AM,194.9,195.12,194.48,194.92,68700400,\n06/12/2014 12:00:00 AM,194.65,194.8,193.11,193.54,106122900,\n06/13/2014 12:00:00 AM,193.9,194.32,193.3,194.13,81977300,\n06/16/2014 12:00:00 AM,193.89,194.7,193.66,194.29,87358300,\n06/17/2014 12:00:00 AM,194.02,194.97,193.81,194.83,84775200,\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105142300,\n06/19/2014 12:00:00 AM,196.43,196.6,195.8,196.48,85824600,\n06/20/2014 12:00:00 AM,196.03,196.1,195.7,195.94,99956400,\n06/23/2014 12:00:00 AM,195.97,196.05,195.52,195.88,70445400,\n06/24/2014 12:00:00 AM,195.53,196.5,194.48,194.7,95988400,\n06/25/2014 12:00:00 AM,194.25,195.78,194.25,195.58,82268000,\n06/26/2014 12:00:00 AM,195.61,195.63,194.13,195.44,84265700,\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71154700,\n06/30/2014 12:00:00 AM,195.7,196.16,195.53,195.72,70201200,\n07/01/2014 12:00:00 AM,196.19,197.63,196.13,197.03,90321700,\n07/02/2014 12:00:00 AM,197.05,197.48,196.96,197.23,52313800,\n07/03/2014 12:00:00 AM,197.79,198.29,197.64,198.2,52938800,\n07/07/2014 12:00:00 AM,197.82,197.98,197.22,197.51,61636700,\n07/08/2014 12:00:00 AM,197.15,197.22,195.76,196.24,108050700,191.8429\n07/09/2014 12:00:00 AM,196.73,197.3,196.31,197.12,72921900,192.1052\n07/10/2014 12:00:00 AM,195.22,196.86,195.06,196.34,98825300,192.289\n07/11/2014 12:00:00 AM,196.22,196.75,195.78,196.61,63448200,192.4634\n07/14/2014 12:00:00 AM,197.61,197.86,197.44,197.6,58562600,192.6356\n07/15/2014 12:00:00 AM,197.72,198.1,196.36,197.23,111294600,192.8709\n07/16/2014 12:00:00 AM,198.11,198.26,197.42,197.96,79967700,193.069\n07/17/2014 12:00:00 AM,197.35,198.1,195.43,195.71,144249500,193.3133\n07/18/2014 12:00:00 AM,196.35,197.91,196.24,197.71,124236300,193.5815\n07/21/2014 12:00:00 AM,197.09,197.5,196.43,197.34,67465800,193.7703\n07/22/2014 12:00:00 AM,198.01,198.56,197.87,198.2,67490100,193.9695\n07/23/2014 12:00:00 AM,198.5,198.85,198.1,198.64,61583800,194.1435\n07/24/2014 12:00:00 AM,198.83,199.06,198.45,198.65,56372600,194.2754\n07/25/2014 12:00:00 AM,198.09,198.26,197.33,197.72,76774600,194.4311\n07/28/2014 12:00:00 AM,197.76,198.09,196.62,197.8,69082000,194.7454\n07/29/2014 12:00:00 AM,198.17,198.45,196.92,196.95,80364500,194.981\n07/30/2014 12:00:00 AM,197.65,197.91,196.16,196.98,104066800,195.147\n07/31/2014 12:00:00 AM,195.61,195.78,192.97,193.09,182368000,195.3092\n08/01/2014 12:00:00 AM,192.56,193.76,191.57,192.5,189017400,195.329\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,90973800,195.3717\n08/05/2014 12:00:00 AM,193.1,193.6,191.31,192.01,152514900,195.3455\n08/06/2014 12:00:00 AM,191.11,192.89,191.08,192.07,94623800,195.3352\n08/07/2014 12:00:00 AM,192.94,193.13,190.55,191.03,135504400,195.2878\n08/08/2014 12:00:00 AM,191.46,193.37,190.95,193.24,114867300,195.2569\n08/11/2014 12:00:00 AM,193.96,194.66,193.71,193.8,74426200,195.2852\n08/12/2014 12:00:00 AM,193.61,194.15,192.94,193.53,73575600,195.2939\n08/13/2014 12:00:00 AM,194.29,195.06,193.96,194.84,68917000,195.3219\n08/14/2014 12:00:00 AM,195.16,195.76,194.98,195.76,57192000,195.3545\n08/15/2014 12:00:00 AM,196.47,196.65,194.31,195.72,139865800,195.3999\n08/18/2014 12:00:00 AM,196.8,197.45,196.69,197.36,75133400,195.4332\n08/19/2014 12:00:00 AM,197.84,198.54,197.44,198.39,58938900,195.4663\n08/20/2014 12:00:00 AM,198.12,199.16,198.08,198.92,72595100,195.5177\n08/21/2014 12:00:00 AM,199.09,199.76,198.93,199.5,67740300,195.5855\n08/22/2014 12:00:00 AM,199.34,199.69,198.74,199.19,76052900,195.6852\n08/25/2014 12:00:00 AM,200.14,200.59,199.15,200.2,63788700,195.7805\n08/26/2014 12:00:00 AM,200.33,200.82,200.28,200.33,47244700,195.8634\n08/27/2014 12:00:00 AM,200.43,200.57,199.94,200.25,47782100,195.9405\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58143500,196.0049\n08/29/2014 12:00:00 AM,200.45,200.73,199.82,200.71,65878400,196.0665\n09/02/2014 12:00:00 AM,200.97,201,199.86,200.61,71399600,196.1456\n09/03/2014 12:00:00 AM,201.38,201.41,200.22,200.5,57371000,196.2145\n09/04/2014 12:00:00 AM,200.84,201.58,199.66,200.21,84993700,196.3227\n09/05/2014 12:00:00 AM,200.17,201.19,199.41,201.11,102010300,196.4485\n09/08/2014 12:00:00 AM,200.92,201.21,200,200.59,64103000,196.5375\n09/09/2014 12:00:00 AM,200.41,200.55,198.91,199.32,88480000,196.6246\n09/10/2014 12:00:00 AM,199.43,200.2,198.77,200.07,67150000,196.6859\n09/11/2014 12:00:00 AM,199.27,200.33,199.12,200.3,66733800,196.7332\n09/12/2014 12:00:00 AM,200.1,200.12,198.56,199.13,117403300,196.8029\n09/15/2014 12:00:00 AM,199.16,199.32,198.38,198.98,76350000,196.8267\n09/16/2014 12:00:00 AM,198.61,200.84,198.5,200.48,116039000,196.8892\n09/17/2014 12:00:00 AM,200.77,201.68,199.75,200.75,149647200,197.0272\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94415600,197.126\n09/19/2014 12:00:00 AM,201.52,201.9,200.29,200.7,121373900,197.2624\n09/22/2014 12:00:00 AM,200.35,200.38,198.73,199.15,125341100,197.3417\n09/23/2014 12:00:00 AM,198.43,199.26,197.95,198.01,111103600,197.3641\n09/24/2014 12:00:00 AM,198.04,199.69,197.52,199.56,107098000,197.3959\n09/25/2014 12:00:00 AM,199.04,199.05,196.27,196.34,149990800,197.3955\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103503900,197.4181\n09/29/2014 12:00:00 AM,196.2,197.89,196.05,197.54,95061600,197.4177\n09/30/2014 12:00:00 AM,197.69,198.3,196.61,197.02,129887300,197.4221\n10/01/2014 12:00:00 AM,196.7,196.77,193.91,194.35,177602400,197.3369\n10/02/2014 12:00:00 AM,194.18,195.06,192.35,194.38,157161800,197.2129\n10/03/2014 12:00:00 AM,195.68,196.94,195.08,196.52,120932900,197.1666\n10/06/2014 12:00:00 AM,197.34,197.6,195.58,196.29,104721100,197.1461\n10/07/2014 12:00:00 AM,195.28,195.72,193.22,193.26,147546700,197.0583\n10/08/2014 12:00:00 AM,193.37,196.92,192.36,196.64,186038800,196.9679\n10/09/2014 12:00:00 AM,196.33,196.6,192.58,192.74,209904000,196.8669\n10/10/2014 12:00:00 AM,192.69,193.65,190.49,190.54,221531600,196.7419\n10/13/2014 12:00:00 AM,190.46,191.15,187.3,187.41,221938600,196.5683\n10/14/2014 12:00:00 AM,188.42,189.82,187.04,187.7,215226000,196.2923\n10/15/2014 12:00:00 AM,185.16,187.69,181.92,186.43,379972000,195.6535\n10/16/2014 12:00:00 AM,183.06,187.58,182.89,186.27,270110200,195.2189\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214147600,195.053\n10/20/2014 12:00:00 AM,188.13,190.45,188.07,190.3,129429000,194.9799\n10/21/2014 12:00:00 AM,191.68,194.2,191.48,194.07,153368100,194.9373\n10/22/2014 12:00:00 AM,194.41,194.91,192.61,192.69,151377900,194.922\n10/23/2014 12:00:00 AM,194.62,196.2,194.26,194.93,153664900,194.9283\n10/24/2014 12:00:00 AM,195.25,196.49,194.49,196.43,116715200,194.9377\n10/27/2014 12:00:00 AM,195.73,196.45,195.03,196.16,82747500,194.9305\n10/28/2014 12:00:00 AM,196.82,198.42,196.73,198.41,105847800,194.9501\n10/29/2014 12:00:00 AM,198.55,199.12,196.8,198.11,142224000,194.9935\n10/30/2014 12:00:00 AM,197.58,199.95,197.4,199.38,112825200,195.0164\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146697400,195.12\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93478700,195.1695\n11/04/2014 12:00:00 AM,201.23,201.6,200.06,201.07,93082100,195.2057\n11/05/2014 12:00:00 AM,202.54,202.59,201.45,202.34,91466100,195.2667\n11/06/2014 12:00:00 AM,202.39,203.26,201.64,203.15,106715600,195.3499\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89443000,195.4168\n11/10/2014 12:00:00 AM,203.38,204.04,203.13,203.98,65897400,195.449\n11/11/2014 12:00:00 AM,204.06,204.31,203.65,204.18,54294500,195.4641\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89957000,195.5297\n11/13/2014 12:00:00 AM,204.16,204.83,203.21,204.19,84981800,195.5752\n11/14/2014 12:00:00 AM,204.1,204.49,203.72,204.24,80310400,195.604\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80373900,195.6585\n11/18/2014 12:00:00 AM,204.44,205.92,204.44,205.55,75858700,195.7117\n11/19/2014 12:00:00 AM,205.31,205.55,204.3,205.22,82226500,195.7892\n11/20/2014 12:00:00 AM,204.26,205.71,204.18,205.58,72498700,195.8497\n11/21/2014 12:00:00 AM,207.64,207.84,205.98,206.68,142105400,196.0259\n11/24/2014 12:00:00 AM,207.17,207.39,206.91,207.26,65635300,196.103\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79013700,196.176\n11/26/2014 12:00:00 AM,207.29,207.76,207.03,207.64,61927200,196.1783\n11/28/2014 12:00:00 AM,207.49,207.87,206.91,207.2,57890100,196.2004\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103711100,196.2664\n12/02/2014 12:00:00 AM,205.81,207.34,205.78,207.08,74435500,196.3194\n12/03/2014 12:00:00 AM,207.3,208.15,207.1,207.89,68869900,196.4056\n12/04/2014 12:00:00 AM,207.54,208.26,206.7,207.66,91222700,196.5277\n12/05/2014 12:00:00 AM,207.87,208.47,207.55,208,90978000,196.6668\n12/08/2014 12:00:00 AM,207.52,208.12,205.93,206.61,108460400,196.8355\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125033900,197.0035\n12/10/2014 12:00:00 AM,205.91,205.98,202.93,203.16,159140400,197.1841\n12/11/2014 12:00:00 AM,203.88,206.19,203.71,204.19,158542800,197.4178\n12/12/2014 12:00:00 AM,202.64,203.82,200.85,200.89,201983200,197.6504\n12/15/2014 12:00:00 AM,201.98,202.53,198.78,199.51,188920400,197.7704\n12/16/2014 12:00:00 AM,198.58,202.4,197.86,197.91,258867900,197.8434\n12/17/2014 12:00:00 AM,198.44,202.34,198.29,201.79,252458700,198.0102\n12/18/2014 12:00:00 AM,204.74,212.97,203.92,206.78,256909600,198.4451\n12/19/2014 12:00:00 AM,206.43,207.33,205.61,206.52,242836400,198.8536\n12/22/2014 12:00:00 AM,206.75,207.47,206.46,207.47,147884900,199.2664\n12/23/2014 12:00:00 AM,208.17,208.23,207.4,207.75,120516200,199.767\n12/24/2014 12:00:00 AM,208.02,208.34,207.72,207.77,42963400,200.2081\n12/26/2014 12:00:00 AM,208.31,208.85,208.25,208.44,57204200,201.2146\n12/29/2014 12:00:00 AM,208.22,208.97,208.14,208.72,79514400,202.0566\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448200,202.6324\n12/31/2014 12:00:00 AM,207.99,208.19,205.39,205.54,130284300,203.0267\n01/02/2015 12:00:00 AM,206.38,206.88,204.18,205.43,121394000,203.3556\n01/05/2015 12:00:00 AM,204.17,204.37,201.35,201.72,169139200,203.5975\n01/06/2015 12:00:00 AM,202.09,202.72,198.86,199.82,208922400,203.7269\n01/07/2015 12:00:00 AM,201.42,202.72,200.88,202.31,125069700,203.848\n01/08/2015 12:00:00 AM,204.01,206.16,203.99,205.9,146039400,203.9896\n01/09/2015 12:00:00 AM,206.4,206.42,203.51,204.25,157293400,204.1344\n01/12/2015 12:00:00 AM,204.41,204.6,201.92,202.65,144043100,204.26\n01/13/2015 12:00:00 AM,204.12,205.48,200.51,202.08,214341100,204.3232\n01/14/2015 12:00:00 AM,199.65,201.1,198.57,200.86,192551700,204.2556\n01/15/2015 12:00:00 AM,201.63,202.01,198.88,199.02,175383200,204.1818\n01/16/2015 12:00:00 AM,198.77,201.82,198.55,201.63,211677200,204.0947\n01/20/2015 12:00:00 AM,202.4,202.72,200.17,202.06,130756800,204.075\n01/21/2015 12:00:00 AM,201.5,203.66,200.94,203.08,122729500,204.0652\n01/22/2015 12:00:00 AM,203.99,206.26,202.33,206.1,173536400,204.0938\n01/23/2015 12:00:00 AM,205.79,206.1,204.81,204.97,117356900,204.1225\n01/26/2015 12:00:00 AM,204.71,205.56,203.85,205.45,91684800,204.134\n01/27/2015 12:00:00 AM,202.97,204.12,201.74,202.74,133590500,204.1144\n01/28/2015 12:00:00 AM,204.17,204.29,199.91,200.14,167681700,204.0644\n01/29/2015 12:00:00 AM,200.38,202.3,198.68,201.99,173293000,203.9805\n01/30/2015 12:00:00 AM,200.57,202.17,199.13,199.45,193789000,203.8755\n02/02/2015 12:00:00 AM,200.05,202.03,197.86,201.92,162649000,203.7822\n02/03/2015 12:00:00 AM,203,204.85,202.55,204.84,123861500,203.7672\n02/04/2015 12:00:00 AM,203.92,205.38,203.51,204.06,132933500,203.7637\n02/05/2015 12:00:00 AM,204.86,206.3,204.77,206.12,97236300,203.7215\n02/06/2015 12:00:00 AM,206.56,207.24,204.92,205.55,125550800,203.731\n02/09/2015 12:00:00 AM,204.77,205.64,204.14,204.63,87074300,203.7041\n02/10/2015 12:00:00 AM,205.88,207.12,204.68,206.81,95999300,203.7043\n02/11/2015 12:00:00 AM,206.61,207.45,205.83,206.93,90268400,203.7125\n02/12/2015 12:00:00 AM,207.89,208.99,206.97,208.92,97202800,203.7401\n02/13/2015 12:00:00 AM,209.07,209.84,208.76,209.78,93554000,203.785\n02/17/2015 12:00:00 AM,209.4,210.32,209.1,210.11,76888700,203.8122\n02/18/2015 12:00:00 AM,209.66,210.22,209.34,210.13,80057400,203.8321\n02/19/2015 12:00:00 AM,209.41,210.42,209.24,209.98,91364200,203.8553\n02/20/2015 12:00:00 AM,209.48,211.33,208.73,211.24,140029800,203.931\n02/23/2015 12:00:00 AM,210.94,211.21,210.48,211.21,74250700,203.9796\n02/24/2015 12:00:00 AM,211.12,212.05,210.76,211.81,72214000,204.0446\n02/25/2015 12:00:00 AM,211.66,212.24,211.22,211.63,72874800,204.1146\n02/26/2015 12:00:00 AM,211.52,211.71,210.65,211.38,72577000,204.2526\n02/27/2015 12:00:00 AM,211.26,211.58,210.6,210.66,107946400,204.4611\n03/02/2015 12:00:00 AM,210.78,212.06,210.72,211.99,87300800,204.7615\n03/03/2015 12:00:00 AM,211.47,212.05,210.08,211.12,110141700,205.0507\n03/04/2015 12:00:00 AM,210.4,210.49,209.06,210.23,114257600,205.0576\n03/05/2015 12:00:00 AM,210.62,210.8,209.85,210.46,76825900,205.069\n03/06/2015 12:00:00 AM,209.42,209.94,207.1,207.5,186468600,205.1254\n03/09/2015 12:00:00 AM,207.74,208.79,207.55,208.36,89621900,205.1147\n03/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,156656000,205.1138\n03/11/2015 12:00:00 AM,205.29,205.5,204.4,204.5,109058000,205.08\n03/12/2015 12:00:00 AM,205.26,207.18,205.2,207.1,93451300,205.053\n03/13/2015 12:00:00 AM,206.77,207.93,204.58,205.83,162353900,205.0511\n03/16/2015 12:00:00 AM,206.71,208.69,205.86,208.58,135571800,205.067\n03/17/2015 12:00:00 AM,207.69,208.42,206.98,207.96,94322500,205.0946\n03/18/2015 12:00:00 AM,207.39,211.27,206.62,210.46,227287200,205.2884\n03/19/2015 12:00:00 AM,209.96,210.47,209.03,209.5,117697000,205.517\n03/20/2015 12:00:00 AM,209.71,211.02,209.49,210.41,177517400,205.7184\n03/23/2015 12:00:00 AM,210.42,211.11,210,210,71619100,205.7877\n03/24/2015 12:00:00 AM,209.85,210.4,208.74,208.82,76947600,205.8492\n03/25/2015 12:00:00 AM,209.07,209.35,205.71,205.76,159285600,205.9473\n03/26/2015 12:00:00 AM,204.96,206.37,204.12,205.27,152909900,206.029\n03/27/2015 12:00:00 AM,205.13,205.95,204.9,205.74,117057900,206.2063\n03/30/2015 12:00:00 AM,206.98,208.61,206.96,208.25,95986800,206.3996\n03/31/2015 12:00:00 AM,207.26,208.1,206.36,206.43,126569200,206.6345\n04/01/2015 12:00:00 AM,206.39,206.42,204.51,205.7,137055500,206.7197\n04/02/2015 12:00:00 AM,205.62,206.98,205.4,206.44,86817700,206.8027\n04/06/2015 12:00:00 AM,205.37,208.45,205.21,207.83,113960800,206.8642\n04/07/2015 12:00:00 AM,207.86,208.76,207.24,207.28,81058800,206.9063\n04/08/2015 12:00:00 AM,207.55,208.51,207.08,207.98,89261200,206.9515\n04/09/2015 12:00:00 AM,207.78,209.18,207.19,208.9,85426700,207.065\n04/10/2015 12:00:00 AM,209.2,210.09,208.96,210.04,72471000,207.2432\n04/13/2015 12:00:00 AM,209.87,210.63,209.03,209.09,74139000,207.4747\n04/14/2015 12:00:00 AM,208.85,209.71,208.1,209.49,74795400,207.7503\n04/15/2015 12:00:00 AM,210.05,211.04,209.95,210.43,99415800,208.0187\n04/16/2015 12:00:00 AM,210.03,210.98,209.79,210.37,68783400,208.1458\n04/17/2015 12:00:00 AM,208.94,209.23,207.01,207.95,191012500,208.2476\n04/20/2015 12:00:00 AM,209.06,210.25,208.96,209.85,92026900,208.3189\n04/21/2015 12:00:00 AM,210.67,210.86,209.24,209.6,71355300,208.3957\n04/22/2015 12:00:00 AM,210.01,210.85,208.9,210.63,78047700,208.4796\n04/23/2015 12:00:00 AM,210.15,211.94,210.01,211.16,102247700,208.5669\n04/24/2015 12:00:00 AM,211.66,211.97,211.11,211.65,61224600,208.6337\n04/27/2015 12:00:00 AM,212.33,212.48,210.54,210.77,79107200,208.6852\n04/28/2015 12:00:00 AM,210.74,211.5,209.33,211.44,86758000,208.7072\n04/29/2015 12:00:00 AM,210.32,211.29,209.6,210.57,125567200,208.7334\n04/30/2015 12:00:00 AM,209.9,210.35,207.62,208.46,160858700,208.7274\n05/01/2015 12:00:00 AM,209.41,210.77,209.28,210.72,103287000,208.7351\n05/04/2015 12:00:00 AM,211.22,212.02,211.1,211.32,70821800,208.7324\n05/05/2015 12:00:00 AM,211.01,211.46,208.73,208.9,113238000,208.7288\n05/06/2015 12:00:00 AM,209.54,209.93,206.76,208.04,135473800,208.6889\n05/07/2015 12:00:00 AM,207.91,209.38,207.52,208.87,88023100,208.6446\n05/08/2015 12:00:00 AM,210.84,211.86,210.78,211.62,156274600,208.6838\n05/11/2015 12:00:00 AM,211.54,211.89,210.52,210.6,75494500,208.6715\n05/12/2015 12:00:00 AM,209.59,210.63,208.62,209.98,119660300,208.6511\n05/13/2015 12:00:00 AM,210.49,211.22,209.74,210.02,94546600,208.63\n05/14/2015 12:00:00 AM,211.24,212.32,210.91,212.21,95861300,208.6536\n05/15/2015 12:00:00 AM,212.43,212.61,211.86,212.44,76420900,208.6798\n05/18/2015 12:00:00 AM,212.24,213.4,212.16,213.1,74415300,208.7421\n05/19/2015 12:00:00 AM,213.26,213.57,212.69,213.03,72059900,208.8115\n05/20/2015 12:00:00 AM,213.16,213.78,212.5,212.88,76565500,208.9605\n05/21/2015 12:00:00 AM,212.74,213.75,212.51,213.5,64545900,209.0954\n05/22/2015 12:00:00 AM,213.02,213.54,212.91,212.99,57402300,209.1917\n05/26/2015 12:00:00 AM,212.39,212.91,210.2,210.7,124112100,209.3395\n05/27/2015 12:00:00 AM,211.23,212.98,210.76,212.7,93186100,209.4358\n05/28/2015 12:00:00 AM,212.34,212.59,211.63,212.46,74861900,209.5078\n05/29/2015 12:00:00 AM,212.4,212.43,210.82,211.14,123445000,209.5876\n06/01/2015 12:00:00 AM,211.95,212.34,210.62,211.57,93232600,209.622\n06/02/2015 12:00:00 AM,211.02,212.19,210.27,211.36,91483800,209.6322\n06/03/2015 12:00:00 AM,211.97,212.67,211.33,211.92,87726400,209.663\n06/04/2015 12:00:00 AM,211.12,211.86,209.75,210.13,151754800,209.6982\n06/05/2015 12:00:00 AM,209.93,210.58,208.98,209.77,121878400,209.7726\n06/08/2015 12:00:00 AM,209.63,209.82,208.39,208.48,88916000,209.9034\n06/09/2015 12:00:00 AM,208.44,209.1,207.69,208.45,104838200,209.9788\n06/10/2015 12:00:00 AM,209.38,211.41,209.3,210.95,133679700,210.0309\n06/11/2015 12:00:00 AM,211.49,212.09,211.2,211.63,73835000,210.1326\n06/12/2015 12:00:00 AM,210.62,211.48,209.68,210.01,135365400,210.2646\n06/15/2015 12:00:00 AM,208.62,209.45,207.79,209.11,124244800,210.2996\n06/16/2015 12:00:00 AM,208.9,210.35,208.72,210.25,85162400,210.3704\n06/17/2015 12:00:00 AM,210.58,211.32,209.36,210.59,126667800,210.4153\n06/18/2015 12:00:00 AM,211.23,213.34,210.63,212.78,164914300,210.5145\n06/19/2015 12:00:00 AM,211.42,211.55,210.36,210.81,130244000,210.5661\n06/22/2015 12:00:00 AM,211.95,212.59,211.64,211.89,70551700,210.6008\n06/23/2015 12:00:00 AM,212.18,212.44,211.57,212.05,64845600,210.6335\n06/24/2015 12:00:00 AM,211.71,212.17,210.47,210.5,92151500,210.6677\n06/25/2015 12:00:00 AM,211.13,211.25,209.77,209.86,97024500,210.6705\n06/26/2015 12:00:00 AM,210.28,210.58,209.16,209.82,103574500,210.6611\n06/29/2015 12:00:00 AM,208.02,209.83,205.33,205.42,196391700,210.6149\n06/30/2015 12:00:00 AM,207.32,207.32,205.28,205.85,182767500,210.4868\n07/01/2015 12:00:00 AM,207.79,208.03,206.56,207.5,135726600,210.414\n07/02/2015 12:00:00 AM,208.07,208.27,206.81,207.31,104278100,210.3633\n07/06/2015 12:00:00 AM,205.74,207.65,205.53,206.72,117603800,210.2666\n07/07/2015 12:00:00 AM,206.93,208.17,204.11,208.02,173465000,210.1402\n07/08/2015 12:00:00 AM,206.34,206.76,204.25,204.53,163558500,209.9807\n07/09/2015 12:00:00 AM,207.03,207.35,204.77,204.9,141670200,209.867\n07/10/2015 12:00:00 AM,207.28,207.98,204.95,207.48,129236200,209.7852\n07/13/2015 12:00:00 AM,209,209.9,208.94,209.77,105767600,209.7984\n07/14/2015 12:00:00 AM,209.69,211.05,209.65,210.68,81315800,209.8008\n07/15/2015 12:00:00 AM,210.71,211.28,210.04,210.61,97759800,209.7952\n07/16/2015 12:00:00 AM,211.82,212.3,211.58,212.3,106514900,209.8333\n07/17/2015 12:00:00 AM,212.34,212.55,211.8,212.48,88143500,209.9048\n07/20/2015 12:00:00 AM,212.77,213.18,212.21,212.59,70305000,209.9651\n07/21/2015 12:00:00 AM,212.45,212.74,211.39,211.75,77757500,209.9576\n07/22/2015 12:00:00 AM,210.91,211.77,210.89,211.37,88480000,209.962\n07/23/2015 12:00:00 AM,211.54,211.65,209.75,210.18,90374700,209.9817\n07/24/2015 12:00:00 AM,210.25,210.37,207.6,208,117631900,209.9545\n07/27/2015 12:00:00 AM,206.98,207.55,206.26,206.79,130697100,209.8495\n07/28/2015 12:00:00 AM,207.8,209.5,206.8,209.33,123042200,209.7807\n07/29/2015 12:00:00 AM,209.44,211.04,209.31,210.77,105481500,209.7475\n07/30/2015 12:00:00 AM,210.2,211.02,209.42,210.82,91232200,209.7132\n07/31/2015 12:00:00 AM,211.44,211.45,210.16,210.5,103182700,209.6883\n08/03/2015 12:00:00 AM,210.53,210.53,208.65,209.79,113841100,209.6522\n08/04/2015 12:00:00 AM,209.7,210.25,208.8,209.38,81558100,209.6148\n08/05/2015 12:00:00 AM,210.4,211.31,209.73,210.07,85583400,209.5832\n08/06/2015 12:00:00 AM,210.27,210.41,207.65,208.35,115884300,209.5355\n08/07/2015 12:00:00 AM,208.16,208.34,206.87,207.95,117805400,209.4633\n08/10/2015 12:00:00 AM,209.29,210.67,209.28,210.57,79722200,209.4207\n08/11/2015 12:00:00 AM,208.96,209.47,207.76,208.67,125941600,209.3681\n08/12/2015 12:00:00 AM,207.14,209.14,205.36,208.92,171932400,209.286\n08/13/2015 12:00:00 AM,208.75,209.55,208.01,208.66,89193700,209.2359\n08/14/2015 12:00:00 AM,208.43,209.51,208.26,209.42,72721100,209.1915\n08/17/2015 12:00:00 AM,208.73,210.59,208.16,210.59,78925300,209.1825\n08/18/2015 12:00:00 AM,210.29,210.68,209.7,209.98,71666100,209.1968\n08/19/2015 12:00:00 AM,209.1,210.01,207.35,208.32,172818200,209.1959\n08/20/2015 12:00:00 AM,206.54,208.29,203.9,203.97,193902400,209.0502\n08/21/2015 12:00:00 AM,201.81,203.94,197.52,197.63,343685100,208.5071\n08/24/2015 12:00:00 AM,187.49,197.48,182.4,189.55,506614400,206.9162\n08/25/2015 12:00:00 AM,195.45,195.45,186.92,187.27,368266800,206.0016\n08/26/2015 12:00:00 AM,192.21,194.79,188.37,194.68,338986400,205.2848\n08/27/2015 12:00:00 AM,197.05,199.42,195.21,199.27,273949800,204.8929\n08/28/2015 12:00:00 AM,198.5,199.84,197.92,199.28,160366600,204.5855\n08/31/2015 12:00:00 AM,198.14,199.13,197.01,197.67,160489800,204.3132\n09/01/2015 12:00:00 AM,193.07,194.77,190.73,191.77,254138800,203.8209\n09/02/2015 12:00:00 AM,194.69,195.46,192.42,195.41,159607500,203.542\n09/03/2015 12:00:00 AM,196.25,198.05,194.96,195.55,152070800,203.2927\n09/04/2015 12:00:00 AM,192.88,193.86,191.61,192.59,207012800,202.904\n09/08/2015 12:00:00 AM,195.97,197.61,195.17,197.43,115903000,202.7066\n09/09/2015 12:00:00 AM,199.32,199.47,194.35,194.79,149065500,202.4729\n09/10/2015 12:00:00 AM,194.5,197.22,194.25,195.85,158424700,202.2234\n09/11/2015 12:00:00 AM,195.32,196.82,194.53,196.74,119638900,202.0228\n09/14/2015 12:00:00 AM,196.95,197.01,195.43,196.01,79411100,201.8816\n09/15/2015 12:00:00 AM,196.59,198.99,195.96,198.46,113692900,201.7408\n09/16/2015 12:00:00 AM,198.82,200.41,198.41,200.18,99429500,201.5881\n09/17/2015 12:00:00 AM,199.96,202.89,199.28,199.73,275822300,201.4597\n09/18/2015 12:00:00 AM,195.74,198.68,194.96,195.45,223522000,201.2151\n09/21/2015 12:00:00 AM,196.45,197.68,195.21,196.46,105495700,201.0479\n09/22/2015 12:00:00 AM,193.9,194.46,192.56,193.91,153688400,200.7783\n09/23/2015 12:00:00 AM,194.13,194.67,192.91,193.6,92695900,200.5888\n09/24/2015 12:00:00 AM,192.13,193.45,190.56,192.9,159330600,200.2821\n09/25/2015 12:00:00 AM,194.61,195,191.81,192.85,155037000,199.9802\n09/28/2015 12:00:00 AM,191.75,191.91,187.64,188.01,178464700,199.6027\n09/29/2015 12:00:00 AM,188.24,189.74,186.93,188.12,159023500,199.2518\n09/30/2015 12:00:00 AM,190.4,191.83,189.44,191.63,163424900,198.9493\n10/01/2015 12:00:00 AM,192.03,192.49,189.82,192.13,130859700,198.6899\n10/02/2015 12:00:00 AM,189.75,195.03,189.12,195,210950700,198.3833\n10/05/2015 12:00:00 AM,196.47,198.74,196.33,198.47,126166700,198.213\n10/06/2015 12:00:00 AM,198.27,198.98,197,197.79,110222900,198.0683\n10/07/2015 12:00:00 AM,198.85,199.83,197.48,199.41,124239300,197.9229\n10/08/2015 12:00:00 AM,198.96,201.55,198.59,201.21,152975400,197.8037\n10/09/2015 12:00:00 AM,201.4,201.9,200.58,201.33,107053500,197.7081\n10/12/2015 12:00:00 AM,201.43,201.76,200.91,201.52,56379300,197.5645\n10/13/2015 12:00:00 AM,200.65,202.16,200.05,200.25,87994500,197.4245\n10/14/2015 12:00:00 AM,200.16,200.87,198.94,199.29,99082500,197.3307\n10/15/2015 12:00:00 AM,200.05,202.36,199.64,202.35,134072500,197.2549\n10/16/2015 12:00:00 AM,202.82,203.29,201.92,203.27,114565000,197.1627\n10/19/2015 12:00:00 AM,202.53,203.37,202.13,203.37,76493000,197.0602\n10/20/2015 12:00:00 AM,202.86,203.84,202.55,203.11,78426000,196.991\n10/21/2015 12:00:00 AM,203.64,203.79,201.65,201.85,102024100,196.8795\n10/22/2015 12:00:00 AM,203,205.51,201.85,205.26,174840600,196.8017\n10/23/2015 12:00:00 AM,207.24,207.95,206.3,207.51,144429500,196.8569\n10/26/2015 12:00:00 AM,207.27,207.37,206.56,207,69010300,196.8354\n10/27/2015 12:00:00 AM,206.2,207,205.79,206.6,77882400,196.8035\n10/28/2015 12:00:00 AM,207,208.98,206.21,208.95,135790300,196.8694\n10/29/2015 12:00:00 AM,208.36,209.27,208.21,208.83,90490600,196.7477\n10/30/2015 12:00:00 AM,209.07,209.44,207.74,207.93,131059900,196.7245\n11/02/2015 12:00:00 AM,208.36,210.62,208.17,210.39,86212500,196.7101\n11/03/2015 12:00:00 AM,209.98,211.66,209.7,211,95210200,197.4108\n11/04/2015 12:00:00 AM,211.37,211.5,209.72,210.36,96179800,197.9153\n11/05/2015 12:00:00 AM,210.44,210.98,209.09,210.15,78379900,198.3282\n11/06/2015 12:00:00 AM,209.74,210.32,208.46,210.04,110462200,198.5421\n11/09/2015 12:00:00 AM,209.33,209.49,206.95,208.08,130992400,198.7316\n11/10/2015 12:00:00 AM,207.54,208.6,207.19,208.56,75837800,198.8581\n11/11/2015 12:00:00 AM,208.9,208.94,207.66,207.74,67808900,199.2131\n11/12/2015 12:00:00 AM,206.51,207.06,204.82,204.84,121290700,199.4612\n11/13/2015 12:00:00 AM,204.36,204.67,202.44,202.54,153520800,199.6395\n11/16/2015 12:00:00 AM,202.3,205.69,202.18,205.62,117622900,199.9532\n11/17/2015 12:00:00 AM,205.97,207.04,204.88,205.47,121080400,200.1326\n11/18/2015 12:00:00 AM,206.03,208.9,205.99,208.73,121259600,200.3526\n11/19/2015 12:00:00 AM,208.55,209.05,208.2,208.55,88157800,200.5997\n11/20/2015 12:00:00 AM,209.47,210.12,208.86,209.31,94002800,200.8308\n11/23/2015 12:00:00 AM,209.4,209.98,208.52,209.07,64903700,200.9802\n11/24/2015 12:00:00 AM,207.87,209.83,207.41,209.35,98820000,201.1712\n11/25/2015 12:00:00 AM,209.48,209.74,209.01,209.32,51960700,201.2712\n11/27/2015 12:00:00 AM,209.4,209.8,208.86,209.56,37301900,201.3628\n11/30/2015 12:00:00 AM,209.79,209.89,208.56,208.69,112642700,201.7252\n12/01/2015 12:00:00 AM,209.42,210.82,209.11,210.68,97800200,201.9684\n12/02/2015 12:00:00 AM,210.6,211,208.23,208.53,108416100,202.3445\n12/03/2015 12:00:00 AM,208.9,209.15,204.75,205.61,166136000,202.6244\n12/04/2015 12:00:00 AM,206.1,209.97,205.93,209.62,192898300,203.0944\n12/07/2015 12:00:00 AM,209.2,209.73,207.2,208.35,101981800,203.4571\n12/08/2015 12:00:00 AM,206.48,208.29,205.78,206.95,103268100,203.9588\n12/09/2015 12:00:00 AM,206.2,208.68,204.18,205.34,162351000,204.4709\n12/10/2015 12:00:00 AM,205.44,207.43,205.14,205.87,116063600,204.9074\n12/11/2015 12:00:00 AM,203.38,204.14,201.51,201.88,211152000,205.1362\n12/14/2015 12:00:00 AM,202.1,203.05,199.95,202.9,182295300,205.5233\n12/15/2015 12:00:00 AM,204.69,206.11,202.87,205.03,153967900,205.6811\n12/16/2015 12:00:00 AM,206.37,208.39,204.8,208.03,196966200,205.8723\n12/17/2015 12:00:00 AM,208.37,208.48,204.84,204.86,172823800,206.047\n12/18/2015 12:00:00 AM,202.77,202.93,199.83,200.02,251355400,206.0027\n12/21/2015 12:00:00 AM,201.43,201.88,200.09,201.67,98958700,206.0086\n12/22/2015 12:00:00 AM,202.7,203.85,201.55,203.5,110977800,205.994\n12/23/2015 12:00:00 AM,204.7,206.07,204.58,206.02,110957100,206.0597\n12/24/2015 12:00:00 AM,205.72,206.33,205.42,205.68,48540200,206.1634\n12/28/2015 12:00:00 AM,204.86,205.26,203.94,205.21,65886100,206.2657\n12/29/2015 12:00:00 AM,206.53,207.79,206.47,207.4,92577000,206.3468\n12/30/2015 12:00:00 AM,207.09,207.21,205.76,205.93,63300300,206.3951\n12/31/2015 12:00:00 AM,205.17,205.89,203.87,203.87,114872500,206.4063\n01/04/2016 12:00:00 AM,200.53,201.03,198.59,201.02,221985200,206.2396\n01/05/2016 12:00:00 AM,201.39,201.9,200.05,201.36,110750000,206.2133\n01/06/2016 12:00:00 AM,198.33,200.06,197.6,198.82,152013700,205.9921\n01/07/2016 12:00:00 AM,195.32,197.44,193.59,194.05,213242300,205.5915\n01/08/2016 12:00:00 AM,195.21,195.85,191.58,191.92,209751000,205.1711\n01/11/2016 12:00:00 AM,193.05,193.41,189.82,192.11,187877100,204.715\n01/12/2016 12:00:00 AM,193.85,194.55,191.14,193.66,172087900,204.3433\n01/13/2016 12:00:00 AM,194.53,194.86,188.38,188.83,221047400,203.8135\n01/14/2016 12:00:00 AM,189.55,193.26,187.66,191.93,240714800,203.2495\n01/15/2016 12:00:00 AM,186.79,188.76,185.52,187.81,324812700,202.3707\n01/19/2016 12:00:00 AM,189.95,190.11,186.2,188.06,195152800,201.8581\n01/20/2016 12:00:00 AM,185,187.5,181.02,185.65,286445900,201.0698\n01/21/2016 12:00:00 AM,186.19,188.87,184.64,186.69,195645200,200.5386\n01/22/2016 12:00:00 AM,189.78,190.76,188.88,190.52,168274300,200.145\n01/25/2016 12:00:00 AM,189.91,190.15,187.41,187.64,130184400,199.8571\n01/26/2016 12:00:00 AM,188.44,190.53,188.02,190.2,140918000,199.5739\n01/27/2016 12:00:00 AM,189.58,191.56,187.06,188.13,185597600,199.2057\n01/28/2016 12:00:00 AM,190,190.2,187.16,189.11,143685000,198.918\n01/29/2016 12:00:00 AM,190.03,193.88,189.88,193.72,210484900,198.6387\n02/01/2016 12:00:00 AM,192.5,194.58,191.84,193.65,136010400,198.421\n02/02/2016 12:00:00 AM,191.9,191.97,189.54,190.16,182497900,198.0925\n02/03/2016 12:00:00 AM,191.37,191.78,187.1,191.3,204983400,197.7637\n02/04/2016 12:00:00 AM,190.72,192.75,189.96,191.6,139499300,197.502\n02/05/2016 12:00:00 AM,190.97,191.67,187.2,187.95,180758100,197.2169\n02/08/2016 12:00:00 AM,185.75,186.12,182.8,185.42,191465200,196.7771\n02/09/2016 12:00:00 AM,183.38,186.94,183.2,185.43,184415100,196.4179\n02/10/2016 12:00:00 AM,186.44,188.34,185.12,185.27,148016100,196.1735\n02/11/2016 12:00:00 AM,182.38,184.1,181.09,182.86,218980900,195.6332\n02/12/2016 12:00:00 AM,184.93,186.65,183.96,186.63,127591100,195.3067\n02/16/2016 12:00:00 AM,188.78,189.81,187.63,189.78,119982900,195.0277\n02/17/2016 12:00:00 AM,191.12,193.32,191.01,192.88,135832200,194.7354\n02/18/2016 12:00:00 AM,193.22,193.27,191.72,192.09,102258300,194.3963\n02/19/2016 12:00:00 AM,191.15,192.18,190.45,192,114780000,194.1768\n02/22/2016 12:00:00 AM,193.9,194.95,193.79,194.78,103576100,194.0183\n02/23/2016 12:00:00 AM,193.99,194.32,192.18,192.32,111423800,193.765\n02/24/2016 12:00:00 AM,190.62,193.53,189.32,193.2,150699100,193.5521\n02/25/2016 12:00:00 AM,193.73,195.55,192.83,195.54,110692400,193.3229\n02/26/2016 12:00:00 AM,196.52,196.68,194.9,195.09,129823000,193.165\n02/29/2016 12:00:00 AM,195.08,196.23,193.33,193.56,125812700,192.9642\n03/01/2016 12:00:00 AM,195.05,198.21,194.45,198.11,141732900,192.6795\n03/02/2016 12:00:00 AM,197.7,199.06,197.25,199,102373900,192.4444\n03/03/2016 12:00:00 AM,198.7,199.8,198.11,199.78,95150800,192.2339\n03/04/2016 12:00:00 AM,200,201.35,199.03,200.43,129272500,192.2516\n03/07/2016 12:00:00 AM,199.34,201.07,199.25,200.59,100008000,192.1996\n03/08/2016 12:00:00 AM,199.3,199.92,198.21,198.4,123905900,192.119\n03/09/2016 12:00:00 AM,199.36,199.79,198.43,199.38,94774400,192.1205\n03/10/2016 12:00:00 AM,199.9,201.07,197.38,199.54,156800300,192.1608\n03/11/2016 12:00:00 AM,201.25,202.81,199.52,202.76,137945600,192.1509\n03/14/2016 12:00:00 AM,202.2,203.04,201.77,202.5,73546500,192.1311\n03/15/2016 12:00:00 AM,201.32,202.53,201.05,202.17,93119900,192.0618\n03/16/2016 12:00:00 AM,201.62,203.82,201.55,203.34,129225400,192.0017\n03/17/2016 12:00:00 AM,203.26,205.23,202.77,204.63,134203900,192.0773\n03/18/2016 12:00:00 AM,204.2,204.78,203.8,204.38,138350900,192.1649\n03/21/2016 12:00:00 AM,204.11,204.94,203.8,204.67,72860800,192.1994\n03/22/2016 12:00:00 AM,203.74,205.23,203.57,204.56,97399100,192.3153\n03/23/2016 12:00:00 AM,204.11,204.33,203.01,203.21,81009200,192.4444\n03/24/2016 12:00:00 AM,201.98,203.16,201.74,203.12,84055800,192.5394\n03/28/2016 12:00:00 AM,203.62,203.86,202.71,203.24,62371200,192.6606\n03/29/2016 12:00:00 AM,202.75,205.25,202.4,205.12,92862400,192.879\n03/30/2016 12:00:00 AM,206.35,206.87,205.59,206.02,86336700,193.3184\n03/31/2016 12:00:00 AM,205.87,206.41,205.33,205.52,94540900,193.6322\n04/01/2016 12:00:00 AM,204.35,207.14,203.98,206.92,114390300,194.2295\n04/04/2016 12:00:00 AM,206.84,207.07,205.89,206.25,63418400,194.5847\n04/05/2016 12:00:00 AM,204.64,206.26,203.89,204.19,99598200,194.8668\n04/06/2016 12:00:00 AM,204.27,206.49,203.98,206.42,91787000,195.1449\n04/07/2016 12:00:00 AM,205.18,205.56,203.09,203.95,113488100,195.445\n04/08/2016 12:00:00 AM,205.32,205.85,203.87,204.5,95007900,195.7816\n04/11/2016 12:00:00 AM,205.23,206.07,203.91,204.02,83723700,196.0619\n04/12/2016 12:00:00 AM,204.2,206.25,203.7,205.92,115309400,196.3798\n04/13/2016 12:00:00 AM,207.02,208.1,206.84,208,96207700,196.6323\n04/14/2016 12:00:00 AM,208.03,208.6,207.6,208.01,65188300,196.9381\n04/15/2016 12:00:00 AM,208,208.17,207.4,207.78,75749700,197.3165\n04/18/2016 12:00:00 AM,207.11,209.28,207,209.24,82455300,197.623\n04/19/2016 12:00:00 AM,209.7,210.2,208.94,209.9,88257600,198.0784\n04/20/2016 12:00:00 AM,209.9,210.92,209.39,210.1,81077700,198.7131\n04/21/2016 04:00:00 PM,210.13,210.25,208.65,208.95,62976700,199.3218\n"
  },
  {
    "path": "Tests/TestData/spy_with_vwma.csv",
    "content": "Date,Open,High,Low,Close,Volume,VWMA20\n02/22/2013 12:00:00 AM,151.16,151.89,150.49,151.89,106292600,\n02/25/2013 12:00:00 AM,152.63,152.86,149.0,149.0,245483200,\n02/26/2013 12:00:00 AM,149.72,150.2,148.73,150.02,186331600,\n02/27/2013 12:00:00 AM,149.89,152.33,149.76,151.91,143932600,\n02/28/2013 12:00:00 AM,151.9,152.87,151.41,151.61,123724200,\n03/01/2013 12:00:00 AM,151.09,152.34,150.41,152.11,170612700,\n03/04/2013 12:00:00 AM,151.76,152.92,151.52,152.92,97328800,\n03/05/2013 12:00:00 AM,153.66,154.7,153.64,154.29,121238200,\n03/06/2013 12:00:00 AM,154.84,154.92,154.16,154.5,94284300,\n03/07/2013 12:00:00 AM,154.71,154.98,154.52,154.78,86002000,\n03/08/2013 12:00:00 AM,155.46,155.65,154.66,155.44,122805700,\n03/11/2013 12:00:00 AM,155.33,156.04,155.13,156.03,83235500,\n03/12/2013 12:00:00 AM,155.92,156.1,155.21,155.68,104108300,\n03/13/2013 12:00:00 AM,155.76,156.12,155.23,155.9,91051500,\n03/14/2013 12:00:00 AM,156.31,156.8,156.22,156.73,123614200,\n03/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,133153200,\n03/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,126518300,\n03/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,167049900,\n03/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,113607800,\n03/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,128492900,153.4821529565071\n03/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,111103200,153.6393340977646\n03/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,151231800,154.17860914218596\n03/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,86114000,154.5770983744136\n03/27/2013 12:00:00 AM,155.26,156.24,155.0,156.19,99783700,154.81042156472026\n03/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,102687700,155.0640600344759\n04/01/2013 12:00:00 AM,156.59,156.91,155.67,156.05,99128500,155.33238748570537\n04/02/2013 12:00:00 AM,156.61,157.21,156.37,156.82,101291000,155.5039771792739\n04/03/2013 12:00:00 AM,156.91,157.03,154.82,155.23,153781800,155.55007003414983\n04/04/2013 12:00:00 AM,155.43,156.17,155.09,155.86,129370000,155.61017931828405\n04/05/2013 12:00:00 AM,153.95,155.35,153.77,155.16,155171000,155.61082644904124\n04/08/2013 12:00:00 AM,155.27,156.22,154.75,156.21,86039700,155.6417363673401\n04/09/2013 12:00:00 AM,156.5,157.32,155.98,156.75,100591500,155.67522548215018\n04/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,134837300,155.8436490364438\n04/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,109635100,155.99355219118362\n04/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,116024900,156.09106679157452\n04/15/2013 12:00:00 AM,158.0,158.13,155.1,155.12,215505700,156.020925734992\n04/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,147152400,156.15540989457904\n04/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,226231500,156.16384360273645\n04/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,166888900,156.05551932868752\n04/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,149219300,156.10547926272687\n04/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,106216500,156.1293760641037\n04/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,165592000,156.29974368475396\n04/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,94996400,156.35972881138918\n04/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,130774400,156.47099943533132\n04/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,95639000,156.52641885365188\n04/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,88223400,156.63562259177434\n04/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,115647600,156.75967632388063\n05/01/2013 12:00:00 AM,159.33,159.41,158.1,158.28,138538400,156.92652152176314\n05/02/2013 12:00:00 AM,158.68,159.89,158.53,159.75,96232300,157.08175505681302\n05/03/2013 12:00:00 AM,161.14,161.88,161.04,161.37,143795900,157.42989376288492\n05/06/2013 12:00:00 AM,161.49,162.01,161.42,161.78,66618900,157.58123727908256\n05/07/2013 12:00:00 AM,162.11,162.65,161.67,162.6,89907000,157.78712789800764\n05/08/2013 12:00:00 AM,162.42,163.39,162.33,163.34,96840500,157.95070256513694\n05/09/2013 12:00:00 AM,163.27,163.7,162.47,162.88,106479000,158.10286079379657\n05/10/2013 12:00:00 AM,163.0,163.55,162.51,163.41,102968200,158.28591054817178\n05/13/2013 12:00:00 AM,163.0,163.81,162.82,163.54,79718500,158.74324701026518\n05/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,118429300,159.14863984132543\n05/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,120520600,159.92016214082585\n05/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,109631200,160.6236081650969\n05/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,129521200,161.34556748896082\n05/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,84703300,161.8158458115087\n05/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,95130500,162.37548009100917\n05/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,243215800,162.94886511197384\n05/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,210629800,163.4230549041018\n05/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,151265100,163.75015948089137\n05/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,142755000,164.05992234011686\n05/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,160155000,164.33829157813327\n05/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,106389200,164.74482753740946\n05/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,175401500,164.84488337620564\n06/03/2013 12:00:00 AM,163.86,164.46,162.66,164.35,167947700,165.0077146686692\n06/04/2013 12:00:00 AM,164.44,165.1,162.73,163.56,157405600,165.00286320495098\n06/05/2013 12:00:00 AM,163.11,163.42,161.13,161.27,210885500,164.7966631877162\n06/06/2013 12:00:00 AM,161.2,162.74,160.25,162.73,200017000,164.7018884705355\n06/07/2013 12:00:00 AM,163.89,164.95,163.14,164.8,188303400,164.77378967919185\n06/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,102463000,164.8222287139275\n06/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,159335000,164.7654759056271\n06/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,176792400,164.5752955953171\n06/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,163114300,164.4969068182554\n06/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,140994200,164.4090772993324\n06/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,135807000,164.30707976552412\n06/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,114574200,164.28897115052072\n06/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,205760600,164.1541469929793\n06/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,320271500,163.57763390464527\n06/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,270449000,163.10997568263656\n06/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,221705700,162.6344499766342\n06/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,161967200,162.3006448074279\n06/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,134499400,162.08489729242055\n06/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,129281700,161.9355173344551\n06/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,160138800,161.7911740476198\n07/01/2013 12:00:00 AM,161.27,162.48,161.08,161.36,131682500,161.6515859631244\n07/02/2013 12:00:00 AM,161.1,162.3,160.5,161.21,154807500,161.54570833816294\n07/03/2013 12:00:00 AM,160.51,161.77,160.22,161.28,75214000,161.55710835908835\n07/05/2013 12:00:00 AM,162.53,163.08,161.3,163.02,121865400,161.5398792582551\n07/08/2013 12:00:00 AM,163.89,164.39,163.08,163.95,107930700,161.42893407880146\n07/09/2013 12:00:00 AM,164.97,165.33,164.27,165.13,119159000,161.45876101927212\n07/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,119410100,161.5169019624915\n07/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,135448000,161.76051340221417\n07/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,102636900,161.82271570595594\n07/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,69376600,161.90546885884285\n07/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,88577000,161.95746340935978\n07/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,91526200,161.9968557807184\n07/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,104445800,162.14537097702342\n07/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,103363100,162.76198745827034\n07/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,79268700,163.3973168447281\n07/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,80761400,164.22008663840165\n07/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,112662100,164.84993875488854\n07/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,111033200,165.3441222248618\n07/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,107418600,165.78322134172538\n07/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,79614200,166.2995455240218\n07/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,85026800,166.7119305140511\n07/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,142264100,167.26960975097765\n08/01/2013 12:00:00 AM,169.98,170.81,169.9,170.66,109966700,167.66701808071284\n08/02/2013 12:00:00 AM,170.3,170.97,170.05,170.95,89402700,168.08864392292247\n08/05/2013 12:00:00 AM,170.61,170.96,170.35,170.7,53408200,168.38397020278526\n08/06/2013 12:00:00 AM,170.37,170.52,169.35,169.73,87231100,168.64264736385417\n08/07/2013 12:00:00 AM,169.2,169.43,168.55,169.18,84558600,168.8812923795223\n08/08/2013 12:00:00 AM,170.0,170.18,168.93,169.8,101924300,169.03457652227584\n08/09/2013 12:00:00 AM,169.56,170.1,168.72,169.31,91473000,169.13155585665186\n08/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,68436400,169.16713754208453\n08/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,80630100,169.2645442445146\n08/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,78905600,169.30716547088076\n08/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,152546100,169.09617087417988\n08/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,130207000,168.87148577630316\n08/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,96296100,168.64266269715654\n08/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,88917400,168.4825694081163\n08/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,157723100,168.17065051720763\n08/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,101273000,168.02065985293748\n08/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,90796000,167.89674346017875\n08/26/2013 12:00:00 AM,166.77,167.3,165.89,166.0,89398400,167.78325091735965\n08/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,154275400,167.41458869886628\n08/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,105120800,167.13995593518476\n08/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,118828000,166.77386343383262\n08/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,134186300,166.39027881867733\n09/03/2013 12:00:00 AM,165.24,165.58,163.7,164.39,142802600,166.15097821310061\n09/04/2013 12:00:00 AM,164.44,166.03,164.14,165.75,97290400,165.98879905398468\n09/05/2013 12:00:00 AM,165.85,166.4,165.73,165.96,62845000,165.86208767348842\n09/06/2013 12:00:00 AM,166.49,166.98,164.48,166.04,159383800,165.69263927086047\n09/09/2013 12:00:00 AM,166.45,167.73,166.45,167.63,87407200,165.61911546321122\n09/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,104783000,165.6646621891424\n09/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,94325700,165.6798916669696\n09/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,82557800,165.6925588073834\n09/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,72257500,165.76533154878817\n09/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,126050700,166.02585941073562\n09/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,82232500,166.2747504463044\n09/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,201318000,166.90426313788183\n09/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,146440600,167.44884821776552\n09/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,132317600,167.69986784307375\n09/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,104533900,167.84395875319882\n09/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,100422400,167.9886570646345\n09/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,114559100,168.35838469360363\n09/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,76579600,168.61253971125262\n09/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,97695900,168.86342321063125\n09/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,143609700,169.12224027131805\n10/01/2013 12:00:00 AM,168.14,169.5,168.0,169.34,126981900,169.44001683688546\n10/02/2013 12:00:00 AM,168.35,169.34,167.83,169.18,112803800,169.58791127132284\n10/03/2013 12:00:00 AM,168.77,168.94,166.84,167.62,176384300,169.5370659370071\n10/04/2013 12:00:00 AM,167.74,169.06,167.53,168.89,96600700,169.7541267315358\n10/07/2013 12:00:00 AM,167.43,168.45,167.25,167.43,95653200,169.73811079582393\n10/08/2013 12:00:00 AM,167.45,167.62,165.36,165.48,176560600,169.45807545366077\n10/09/2013 12:00:00 AM,165.8,166.2,164.53,165.6,168100500,169.1938370942732\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,193988300,169.19992981861392\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,104956400,169.23944530114306\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,111248400,169.26060803498294\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,154901700,169.2299787555784\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,160895600,169.10972289784098\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,128890400,169.10787103811018\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,138055900,169.3075735925946\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,104058600,169.4875409332828\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,126638900,169.7733604536473\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,105043800,169.99949503552057\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,70037700,170.14774600678732\n10/25/2013 12:00:00 AM,175.51,176.0,175.17,175.95,93453900,170.403906970713\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,84497900,170.73440605632368\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,87200600,171.03089622602863\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,135506600,171.39760969508978\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,133352300,171.90458454869167\n11/01/2013 12:00:00 AM,176.05,176.61,175.22,176.21,142771700,172.26466793358648\n11/04/2013 12:00:00 AM,176.71,176.9,175.9825,176.83,85257800,172.60460392950063\n11/05/2013 12:00:00 AM,176.16,176.75,175.57,176.27,85466500,173.25538371017802\n11/06/2013 12:00:00 AM,177.03,177.5,176.54,177.17,87123100,173.95306303681224\n11/07/2013 12:00:00 AM,177.56,177.64,174.76,174.93,148632200,174.42206095961959\n11/08/2013 12:00:00 AM,174.85,177.31,174.85,177.29,136500100,174.77916243251823\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,66226700,175.04092054383534\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,83193500,175.48897343376655\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,99795600,175.88053528877336\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,102965800,176.2075620423908\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,102759600,176.51795755254705\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,98459500,176.7618870420599\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,93045800,176.94914105374605\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,124692900,177.1624196412724\n11/21/2013 12:00:00 AM,179.0,180.05,178.86,179.91,91804700,177.35120571220105\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,81234700,177.55015510694196\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,79187800,177.7222645143093\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,86697800,177.86978749049428\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,58227900,178.07272876668767\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181.0,54981700,178.31649371611294\n12/02/2013 12:00:00 AM,181.12,181.43,180.25,180.53,99262300,178.59548645254182\n12/03/2013 12:00:00 AM,179.95,180.39,179.17,179.75,115939400,178.74545768911426\n12/04/2013 12:00:00 AM,179.18,180.48,178.35,179.73,122956300,178.91747328187586\n12/05/2013 12:00:00 AM,179.42,179.74,178.77,178.94,106333600,178.99665849504984\n12/06/2013 12:00:00 AM,180.72,181.11,180.15,180.94,127424400,179.43775695283628\n12/09/2013 12:00:00 AM,181.47,181.67,181.16,181.4,69987400,179.6685668092483\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,77428000,179.7960842653991\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,130188800,179.8459183887273\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,115321400,179.81931056416633\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,107741000,179.75366037686342\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,96100500,179.71146311344165\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,89432200,179.67711038488505\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,234455700,179.93539263655597\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,136717700,180.12529461402684\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,196678700,180.26340073877418\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,85407800,180.33150594091572\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,45363300,180.37520304376346\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,63215200,180.46578905703095\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,61794800,180.5458334674167\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,56807200,180.62112979241084\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,86123600,180.79025966339782\n01/02/2014 12:00:00 AM,183.91,184.07,182.48,182.92,119511100,180.96646289620983\n01/03/2014 12:00:00 AM,183.24,183.6,182.63,182.88,81352000,181.11387272320326\n01/06/2014 12:00:00 AM,183.52,183.56,182.08,182.36,106889400,181.28837652821667\n01/07/2014 12:00:00 AM,183.12,183.79,182.95,183.48,86041200,181.40220750558132\n01/08/2014 12:00:00 AM,183.46,183.83,182.89,183.52,96481400,181.50084573606728\n01/09/2014 12:00:00 AM,184.1,184.13,182.79,183.64,90529400,181.62154297547966\n01/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,101986500,181.92990663087505\n01/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,149507600,182.1215039048842\n01/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,104596300,182.4059331981038\n01/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,98370100,182.6583658210653\n01/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,72112100,182.8924670276316\n01/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,107832500,183.07688001738185\n01/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,88504600,183.24252952706982\n01/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,60761400,183.46665266002623\n01/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,132343700,183.46137496813753\n01/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,208595800,182.99036783937453\n01/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,179949700,182.53557530143195\n01/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,108851800,182.3210563024338\n01/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,215244500,181.81785408005203\n01/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,116150500,181.5822429007492\n01/31/2014 12:00:00 AM,177.0,179.29,176.92,178.18,194573800,181.23989568930696\n02/03/2014 12:00:00 AM,177.95,178.37,173.83,174.17,254370100,180.48930255729084\n02/04/2014 12:00:00 AM,174.98,175.84,174.11,175.38,164781000,180.0933913069087\n02/05/2014 12:00:00 AM,174.77,175.56,173.71,175.17,163629100,179.68847127788385\n02/06/2014 12:00:00 AM,175.61,177.48,175.22,177.48,132379000,179.44730198342884\n02/07/2014 12:00:00 AM,178.29,179.87,177.73,179.68,170701300,179.3270147110261\n02/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,91977200,179.17497024916702\n02/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,121636400,179.16301368294287\n02/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,94414700,179.0920957368507\n02/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,100515600,179.03672084817146\n02/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,96413500,179.06962673982716\n02/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,80018500,179.0415157109692\n02/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,125995500,179.05804134613152\n02/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,104841400,179.1315692036535\n02/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,118069200,179.1588822122377\n02/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,113918000,179.41766389097373\n02/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,116815100,179.7478767850638\n02/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,98329400,179.96302650078297\n02/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,93720800,180.39829910669542\n02/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,150681900,180.7938005082732\n03/03/2014 12:00:00 AM,184.65,185.45,183.75,184.98,167434300,181.26613927288548\n03/04/2014 12:00:00 AM,186.79,187.98,186.75,187.58,169638300,182.42778005316995\n03/05/2014 12:00:00 AM,187.75,188.07,187.45,187.75,88273700,183.1075959739817\n03/06/2014 12:00:00 AM,188.24,188.61,187.78,188.18,82328000,183.8480391089813\n03/07/2014 12:00:00 AM,188.93,188.96,187.43,188.26,117468700,184.43907201246617\n03/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,74834300,184.93325980434685\n03/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,98827400,185.24028549373273\n03/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,104701600,185.51796603411398\n03/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,154146000,185.63912068882402\n03/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,153743000,185.68835225335172\n03/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,98250600,185.78519070445148\n03/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,101626300,185.91981871181267\n03/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,176115300,186.1277761705619\n03/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,116944200,186.29569229933176\n03/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,163058100,186.40566800895587\n03/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,120889800,186.4270891314696\n03/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,103492000,186.49826511169402\n03/26/2014 12:00:00 AM,187.0,187.34,184.92,184.97,119656900,186.48979769497186\n03/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,142204500,186.4064184639879\n03/28/2014 12:00:00 AM,185.14,186.42,185.0,185.49,101527200,186.37566721389504\n03/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,99626700,186.500022135398\n04/01/2014 12:00:00 AM,187.65,188.36,187.45,188.25,88958900,186.48808741350965\n04/02/2014 12:00:00 AM,188.5,189.13,188.14,188.88,78714300,186.5215572537155\n04/03/2014 12:00:00 AM,189.13,189.22,188.05,188.63,77253000,186.5330523702304\n04/04/2014 12:00:00 AM,189.64,189.7,186.1,186.4,169003600,186.4368963916091\n04/07/2014 12:00:00 AM,185.9,186.26,183.96,184.34,140661000,186.26096100299478\n04/08/2014 12:00:00 AM,184.18,185.4,183.59,185.1,112585800,186.16749815282432\n04/09/2014 12:00:00 AM,185.61,187.15,185.06,187.09,100013900,186.15748450581032\n04/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,172873800,186.00598273534425\n04/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,167016600,185.78399765841078\n04/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,132183000,185.6110897720416\n04/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,157026300,185.4418636352737\n04/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,104151700,185.3835521887084\n04/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,105192300,185.31398151834375\n04/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,68212800,185.30265870055536\n04/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,85686400,185.39135263325358\n04/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,73611400,185.41594467345723\n04/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,88109600,185.5334313389026\n04/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,100307700,185.6285725486297\n04/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,134950500,185.70966224160006\n04/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,83971400,185.7283107382155\n04/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,101461700,185.74500674304883\n05/01/2014 12:00:00 AM,188.25,188.84,187.73,188.32,92856500,185.74162628328605\n05/02/2014 12:00:00 AM,188.33,189.14,187.78,188.06,97969300,185.743371993727\n05/05/2014 12:00:00 AM,187.16,188.55,186.62,188.42,75827800,185.78528733278517\n05/06/2014 12:00:00 AM,188.03,188.13,186.74,186.78,85356200,185.9200004347085\n05/07/2014 12:00:00 AM,187.41,187.97,186.01,187.88,106377000,186.06102120056016\n05/08/2014 12:00:00 AM,187.71,189.05,187.08,187.68,93495400,186.08380594406927\n05/09/2014 12:00:00 AM,187.71,188.04,186.83,187.96,83648000,186.4097676016962\n05/12/2014 12:00:00 AM,188.77,189.88,188.0,189.79,86871400,186.97790081360412\n05/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,66416800,187.3647912450657\n05/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,72243900,187.70763612723582\n05/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,154897300,187.77100372637221\n05/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,97384100,187.86423232340817\n05/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,63676300,187.92492697678475\n05/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,111512600,187.90418007232603\n05/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,88998000,187.97973855867858\n05/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,61519500,188.04009957620988\n05/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,61108000,188.21405980923151\n05/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,71961100,188.45185138501995\n05/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,66048500,188.59690254774955\n05/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,64139000,188.75616428226476\n05/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,76256200,188.95769254954482\n06/02/2014 12:00:00 AM,192.98,192.99,191.97,192.9,64568200,189.1649750696799\n06/03/2014 12:00:00 AM,192.41,192.9,192.25,192.8,64985200,189.3432993427143\n06/04/2014 12:00:00 AM,192.46,193.3,192.26,193.19,55495200,189.61152126980258\n06/05/2014 12:00:00 AM,193.43,194.65,192.7,194.45,92035600,190.00563757704364\n06/06/2014 12:00:00 AM,194.88,195.43,194.78,195.38,78650300,190.41016581488853\n06/09/2014 12:00:00 AM,195.36,196.05,195.17,195.58,65025700,190.7561985644007\n06/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,56992500,190.9908892806246\n06/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,68703000,191.21117961838567\n06/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,106125500,191.46757188574506\n06/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,81991000,192.0342062223166\n06/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,87349400,192.4276058050455\n06/17/2014 12:00:00 AM,194.0,194.97,193.81,194.83,84776800,192.71832877206054\n06/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,105144800,193.35002118287593\n06/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,85833100,193.7798774137948\n06/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,99965100,194.0880417045993\n06/23/2014 12:00:00 AM,196.0,196.05,195.52,195.88,70447200,194.31737517405506\n06/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,96018200,194.46894059121308\n06/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,82694100,194.655368689477\n06/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,84216600,194.78767984693584\n06/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,71326100,194.93393750753583\n06/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,70396800,195.05000963454037\n07/01/2014 12:00:00 AM,196.21,197.63,196.13,197.03,90321700,195.2490005685308\n07/02/2014 12:00:00 AM,197.03,197.48,196.96,197.23,52316200,195.38265636269767\n07/03/2014 12:00:00 AM,197.81,198.29,197.64,198.2,52894800,195.53025695000764\n07/07/2014 12:00:00 AM,197.84,197.98,197.22,197.51,61676700,195.6153290315499\n07/08/2014 12:00:00 AM,197.12,197.22,195.76,196.24,108055300,195.6584865668768\n07/09/2014 12:00:00 AM,196.75,197.29,196.31,197.12,72953600,195.72581179226626\n07/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,98922400,195.79561874551152\n07/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,64226200,195.9755006977686\n07/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,58563600,196.12971581292194\n07/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,111297400,196.30428343894167\n07/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,79978600,196.4634469347166\n07/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,144412600,196.410676042246\n07/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,124256300,196.50241907926508\n07/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,67480300,196.57023595951216\n07/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,67612500,196.6659311257999\n07/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,65545600,196.86122143337062\n07/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,56417500,196.9902822835128\n07/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,76782500,197.10723399555746\n07/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,69106500,197.19491069358972\n07/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,80408600,197.24738982936248\n07/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,104105100,197.24231774303757\n07/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,183073500,196.80774391544514\n08/01/2014 12:00:00 AM,192.58,193.76,191.57,192.5,189075200,196.33632447782585\n08/04/2014 12:00:00 AM,192.87,194.3,192.05,193.89,91108400,196.1820065275005\n08/05/2014 12:00:00 AM,193.11,193.6,191.31,192.01,152557200,195.85372545078778\n08/06/2014 12:00:00 AM,191.08,192.89,191.08,192.07,94628200,195.62618659102824\n08/07/2014 12:00:00 AM,192.96,193.13,190.55,191.03,135507800,195.28224716681888\n08/08/2014 12:00:00 AM,191.43,193.37,190.95,193.24,116999400,195.12553800761827\n08/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,74451200,195.00833477759352\n08/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,73605400,194.83439269919913\n08/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,68961600,194.71180757492994\n08/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,57228200,194.66862171489618\n08/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,139872000,194.5511114621145\n08/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,75188600,194.5627740487315\n08/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,58964600,194.55246073372552\n08/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,72725600,194.57768527696652\n08/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,67745800,194.63001188691524\n08/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,76067700,194.68533230112376\n08/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,63806000,194.75447175749608\n08/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,47256100,194.7992178241742\n08/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,47820600,194.81704267277684\n08/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,58267500,195.17254157946837\n08/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,65886200,195.70356067175132\n09/02/2014 12:00:00 AM,200.97,200.99,199.86,200.61,72322600,196.0246231843287\n09/03/2014 12:00:00 AM,201.35,201.41,200.22,200.5,57371400,196.59472333704886\n09/04/2014 12:00:00 AM,200.86,201.58,199.66,200.21,85000300,197.08016388715188\n09/05/2014 12:00:00 AM,200.19,201.19,199.41,201.11,102015100,197.9110124106691\n09/08/2014 12:00:00 AM,200.94,201.21,200.0,200.59,64102500,198.41374640904513\n09/09/2014 12:00:00 AM,200.42,200.55,198.91,199.32,88482500,198.70794056284984\n09/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,67154300,199.03698918815195\n09/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,66737400,199.29760093025527\n09/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,117408300,199.41992283671658\n09/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,76357300,199.75817048936995\n09/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,116043200,199.9376283262036\n09/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,151153900,200.0745120671208\n09/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,94940000,200.23194514264642\n09/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,121449500,200.296856392589\n09/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,125433400,200.26153502461\n09/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,111088300,200.11974256034588\n09/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,107137500,200.08082347412426\n09/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,150009700,199.78095955990244\n09/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,103505800,199.6700258793068\n09/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,95085900,199.5326295280274\n09/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,130138700,199.33322758622387\n10/01/2014 12:00:00 AM,196.68,196.77,193.91,194.35,177612400,198.8906027065503\n10/02/2014 12:00:00 AM,194.18,195.05,192.35,194.38,157170400,198.52124923949387\n10/03/2014 12:00:00 AM,195.71,196.94,195.08,196.52,121466200,198.2950815852219\n10/06/2014 12:00:00 AM,197.36,197.6,195.58,196.29,104737900,198.13866440183457\n10/07/2014 12:00:00 AM,195.29,195.72,193.22,193.26,147603600,197.78659195237435\n10/08/2014 12:00:00 AM,193.36,196.92,192.36,196.64,186054900,197.63760791680485\n10/09/2014 12:00:00 AM,196.36,196.6,192.58,192.74,209978700,197.1745124750823\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,221648200,196.54684191277795\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,230050200,195.74758433053546\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,215307000,194.97709293496206\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,380336300,193.68480705379224\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,270175000,192.8601905089071\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,214253300,192.3129610192965\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,129599500,191.98997953859987\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,154476400,191.89089074140853\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,151477500,191.69357624928762\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,154681700,191.63833764410217\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,116840100,191.61360588925825\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,82755000,191.56094544004648\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,106688000,191.56668508697484\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,142365300,191.6916798260165\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,113026700,191.8209568844439\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,146857100,192.07223036515666\n11/03/2014 12:00:00 AM,201.92,202.45,201.3,201.77,93539900,192.20643059445726\n11/04/2014 12:00:00 AM,201.22,201.6,200.06,201.07,93177300,192.4028314867415\n11/05/2014 12:00:00 AM,202.56,202.59,201.45,202.34,91468900,192.43916976157638\n11/06/2014 12:00:00 AM,202.41,203.26,201.64,203.15,106742100,192.7750864647747\n11/07/2014 12:00:00 AM,203.17,203.6,202.61,203.34,89472200,193.24233709063\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,65917600,193.94443408403296\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,54299100,194.63339337758765\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,89967500,196.2377257917865\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,84991500,197.7136352370088\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,80335200,198.87936387228876\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,80377300,199.61917622342622\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,75891900,200.26608424908082\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,82229900,201.06283918733743\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,72589800,201.7456504567666\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,142173900,202.4436505844054\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,65675200,202.8890251037072\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,79019800,203.32759104093998\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,56385900,203.8864829910209\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,57890100,204.2967649275115\n12/01/2014 12:00:00 AM,206.4,206.54,205.38,205.76,103806900,204.62037662069494\n12/02/2014 12:00:00 AM,205.8,207.34,205.78,207.09,74456200,204.8939277700591\n12/03/2014 12:00:00 AM,207.28,208.15,207.1,207.89,68873500,205.2406956463056\n12/04/2014 12:00:00 AM,207.55,208.26,206.7,207.66,91225300,205.54028200154482\n12/05/2014 12:00:00 AM,207.88,208.47,207.55,208.0,90989800,205.83840370588595\n12/08/2014 12:00:00 AM,207.55,208.12,205.93,206.61,108465100,206.0274023658902\n12/09/2014 12:00:00 AM,204.37,206.6,203.91,206.47,125039000,206.14036238689192\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,159237100,205.93465493781392\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,158628800,205.88132732638778\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,202123800,205.44338501109513\n12/15/2014 12:00:00 AM,202.0,202.53,198.78,199.51,189556900,204.95023426677517\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,258910900,204.1654253998087\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,252523700,203.8764964934034\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,256995300,204.11963831984417\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,243364900,204.29130714930852\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,148194100,204.33840019333928\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,120621800,204.415565626064\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,42963400,204.3910853490923\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,57211900,204.40832183804187\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,79532000,204.4723259874148\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,73448300,204.5066016800543\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,130281700,204.48640806569955\n01/02/2015 12:00:00 AM,206.39,206.88,204.18,205.43,121408500,204.44523024267895\n01/05/2015 12:00:00 AM,204.2,204.37,201.35,201.72,169440600,204.19262109386293\n01/06/2015 12:00:00 AM,202.13,202.72,198.85,199.82,208923900,203.78707563881702\n01/07/2015 12:00:00 AM,201.46,202.72,200.88,202.31,125069600,203.62990266837954\n01/08/2015 12:00:00 AM,204.0,206.16,203.99,205.9,146056100,203.62240977043902\n01/09/2015 12:00:00 AM,206.39,206.42,203.51,204.25,157609800,203.67731098525996\n01/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,144060200,203.60400533689668\n01/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,214372200,203.6746493297439\n01/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,192575000,203.75335201552608\n01/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,175449000,203.97636603649158\n01/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,211716100,203.99469673477353\n01/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,130876700,203.65931257340117\n01/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,122704300,203.3825692562479\n01/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,173707900,203.33478778847538\n01/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,117357700,203.21289342083836\n01/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,91710100,203.21619091935477\n01/27/2015 12:00:00 AM,203.0,204.12,201.74,202.74,133646200,203.09204302004363\n01/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,167686500,202.77868232356872\n01/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,173312500,202.6207635067658\n01/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,197508500,202.30375085766482\n02/02/2015 12:00:00 AM,200.07,202.03,197.86,201.92,162707100,202.16633640645549\n02/03/2015 12:00:00 AM,203.02,204.85,202.55,204.84,123867400,202.29462967051043\n02/04/2015 12:00:00 AM,203.94,205.38,203.51,204.06,133968500,202.5380155527779\n02/05/2015 12:00:00 AM,204.83,206.3,204.77,206.12,97731200,202.66138993027167\n02/06/2015 12:00:00 AM,206.57,207.24,204.92,205.55,125590100,202.62522449368586\n02/09/2015 12:00:00 AM,204.77,205.64,204.13,204.63,87084200,202.59785499743185\n02/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,96142600,202.73351826686962\n02/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,90227200,202.91841230519816\n02/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,97226900,203.27997493229978\n02/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,93617500,203.7958515150648\n02/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,76896000,204.17445678325097\n"
  },
  {
    "path": "Tests/TestData/spy_with_williamsR14.txt",
    "content": "Date,Open,High,Low,Close,Williams %R 14\n3/15/2013 12:00:00 AM,155.85,156.04,155.31,155.83,\n3/18/2013 12:00:00 AM,154.34,155.64,154.2,154.97,\n3/19/2013 12:00:00 AM,155.3,155.51,153.59,154.61,\n3/20/2013 12:00:00 AM,155.52,155.95,155.26,155.69,\n3/21/2013 12:00:00 AM,154.75,155.64,154.1,154.36,\n3/22/2013 12:00:00 AM,154.84,155.6,154.73,155.6,\n3/25/2013 12:00:00 AM,155.99,156.27,154.35,154.95,\n3/26/2013 12:00:00 AM,155.59,156.23,155.42,156.19,\n3/27/2013 12:00:00 AM,155.26,156.24,155,156.19,\n3/28/2013 12:00:00 AM,156.09,156.85,155.75,156.67,\n4/1/2013 12:00:00 AM,156.59,156.91,155.67,156.05,\n4/2/2013 12:00:00 AM,156.61,157.21,156.37,156.82,\n4/3/2013 12:00:00 AM,156.91,157.03,154.82,155.23,\n4/4/2013 12:00:00 AM,155.43,156.17,155.09,155.86,-37.29288\n4/5/2013 12:00:00 AM,153.95,155.35,153.77,155.16,-56.62976\n4/8/2013 12:00:00 AM,155.27,156.22,154.75,156.21,-27.62423\n4/9/2013 12:00:00 AM,156.5,157.32,155.98,156.75,-16.05653\n4/10/2013 12:00:00 AM,157.17,158.87,157.13,158.67,-3.921516\n4/11/2013 12:00:00 AM,158.7,159.71,158.54,159.19,-8.754277\n4/12/2013 12:00:00 AM,158.68,159.04,157.92,158.8,-15.31992\n4/15/2013 12:00:00 AM,158,158.13,155.1,155.12,-77.27289\n4/16/2013 12:00:00 AM,156.29,157.49,155.91,157.41,-38.72057\n4/17/2013 12:00:00 AM,156.29,156.32,154.28,155.11,-77.44115\n4/18/2013 12:00:00 AM,155.37,155.41,153.55,154.14,-90.42214\n4/19/2013 12:00:00 AM,154.5,155.55,154.12,155.48,-68.66897\n4/22/2013 12:00:00 AM,155.78,156.54,154.75,156.17,-57.46764\n4/23/2013 12:00:00 AM,156.95,157.93,156.17,157.78,-31.33128\n4/24/2013 12:00:00 AM,157.83,158.3,157.54,157.88,-29.7078\n4/25/2013 12:00:00 AM,158.25,159.27,158.1,158.52,-19.31821\n4/26/2013 12:00:00 AM,158.32,158.6,157.73,158.24,-23.86364\n4/29/2013 12:00:00 AM,158.67,159.65,158.42,159.3,-6.6559\n4/30/2013 12:00:00 AM,159.27,159.72,158.61,159.68,-0.6484369\n5/1/2013 12:00:00 AM,159.33,159.41,158.1,158.28,-23.33878\n5/2/2013 12:00:00 AM,158.68,159.89,158.53,159.75,-2.208194\n5/3/2013 12:00:00 AM,161.14,161.88,161.04,161.37,-6.122565\n5/6/2013 12:00:00 AM,161.49,162.01,161.42,161.78,-2.718628\n5/7/2013 12:00:00 AM,162.11,162.65,161.67,162.6,-0.5493169\n5/8/2013 12:00:00 AM,162.42,163.39,162.33,163.34,-0.539407\n5/9/2013 12:00:00 AM,163.27,163.7,162.47,162.88,-9.161925\n5/10/2013 12:00:00 AM,163,163.55,162.51,163.41,-3.851173\n5/13/2013 12:00:00 AM,163,163.81,162.82,163.54,-4.306285\n5/14/2013 12:00:00 AM,163.67,165.35,163.67,165.23,-1.574937\n5/15/2013 12:00:00 AM,164.98,166.45,164.91,166.12,-3.784424\n5/16/2013 12:00:00 AM,165.76,166.36,165.09,165.34,-13.29344\n5/17/2013 12:00:00 AM,165.98,167.04,165.73,166.94,-1.118467\n5/20/2013 12:00:00 AM,166.78,167.58,166.61,166.93,-6.85664\n5/21/2013 12:00:00 AM,167.07,167.8,166.5,167.17,-6.796166\n5/22/2013 12:00:00 AM,167.34,169.07,165.17,165.93,-39.10348\n5/23/2013 12:00:00 AM,164.2,165.91,163.94,165.45,-47.32034\n5/24/2013 12:00:00 AM,164.44,165.38,163.98,165.31,-50.81088\n5/28/2013 12:00:00 AM,167.04,167.78,165.81,166.3,-41.09795\n5/29/2013 12:00:00 AM,165.41,165.8,164.34,165.22,-58.33337\n5/30/2013 12:00:00 AM,165.35,166.59,165.22,165.83,-49.39023\n5/31/2013 12:00:00 AM,165.36,166.31,163.13,163.45,-89.92017\n6/3/2013 12:00:00 AM,163.86,164.46,162.66,164.35,-73.63493\n6/4/2013 12:00:00 AM,164.44,165.1,162.73,163.56,-85.95954\n6/5/2013 12:00:00 AM,163.11,163.42,161.13,161.27,-98.23679\n6/6/2013 12:00:00 AM,161.2,162.74,160.25,162.73,-71.88216\n6/7/2013 12:00:00 AM,163.89,164.95,163.14,164.8,-48.41271\n6/10/2013 12:00:00 AM,165.31,165.4,164.37,164.8,-48.41271\n6/11/2013 12:00:00 AM,163.27,164.54,162.74,163.1,-67.68703\n6/12/2013 12:00:00 AM,164.25,164.39,161.6,161.75,-80.07968\n6/13/2013 12:00:00 AM,161.64,164.5,161.3,164.21,-47.41026\n6/14/2013 12:00:00 AM,164.03,164.67,162.91,163.18,-61.08907\n6/17/2013 12:00:00 AM,164.3,165.22,163.55,164.44,-33.91159\n6/18/2013 12:00:00 AM,164.54,165.99,164.52,165.74,-13.4068\n6/19/2013 12:00:00 AM,165.61,165.89,163.38,163.45,-47.19475\n6/20/2013 12:00:00 AM,161.83,162.1,158.98,159.4,-94.00859\n6/21/2013 12:00:00 AM,159.6,159.76,157.47,159.07,-81.2206\n6/24/2013 12:00:00 AM,157.39,158.43,155.73,157.06,-87.03703\n6/25/2013 12:00:00 AM,158.52,159.17,157.42,158.57,-72.3196\n6/26/2013 12:00:00 AM,159.89,160.5,159.25,160.14,-57.01755\n6/27/2013 12:00:00 AM,161.12,161.82,160.95,161.08,-47.85574\n6/28/2013 12:00:00 AM,160.62,161.4,159.86,160.42,-54.28852\n7/1/2013 12:00:00 AM,161.27,162.48,161.08,161.36,-45.12671\n7/2/2013 12:00:00 AM,161.1,162.3,160.5,161.21,-46.58864\n7/3/2013 12:00:00 AM,160.51,161.77,160.22,161.28,-45.90646\n7/5/2013 12:00:00 AM,162.53,163.08,161.3,163.02,-28.94735\n7/8/2013 12:00:00 AM,163.89,164.39,163.08,163.95,-19.88311\n7/9/2013 12:00:00 AM,164.97,165.33,164.27,165.13,-7.480258\n7/10/2013 12:00:00 AM,165.01,165.75,164.63,165.19,-5.588796\n7/11/2013 12:00:00 AM,167.13,167.61,166.53,167.44,-1.43096\n7/12/2013 12:00:00 AM,167.4,167.93,167.13,167.51,-3.442609\n7/15/2013 12:00:00 AM,167.97,168.39,167.68,168.15,-2.187835\n7/16/2013 12:00:00 AM,168.25,168.36,167.07,167.52,-9.518547\n7/17/2013 12:00:00 AM,168.18,168.48,167.73,167.95,-6.148481\n7/18/2013 12:00:00 AM,168.28,169.27,168.2,168.87,-4.250893\n7/19/2013 12:00:00 AM,168.51,169.23,168.31,169.17,-1.105039\n7/22/2013 12:00:00 AM,169.39,169.74,169.01,169.5,-2.521065\n7/23/2013 12:00:00 AM,169.79,169.83,169.05,169.14,-7.180046\n7/24/2013 12:00:00 AM,169.8,169.86,168.18,168.52,-15.65417\n7/25/2013 12:00:00 AM,168.2,169.08,167.94,168.93,-13.71693\n7/26/2013 12:00:00 AM,168.24,169.16,167.52,169.11,-13.41682\n7/29/2013 12:00:00 AM,168.71,169.06,168.11,168.59,-24.28308\n7/30/2013 12:00:00 AM,169.12,169.28,168.19,168.59,-38.13824\n7/31/2013 12:00:00 AM,168.94,169.85,168.49,168.71,-41.21852\n8/1/2013 12:00:00 AM,169.98,170.81,169.9,170.66,-4.010542\n8/2/2013 12:00:00 AM,170.3,170.97,170.05,170.95,-0.5129309\n8/5/2013 12:00:00 AM,170.61,170.96,170.35,170.7,-7.826218\n8/6/2013 12:00:00 AM,170.37,170.52,169.35,169.73,-35.94222\n8/7/2013 12:00:00 AM,169.2,169.43,168.55,169.18,-51.88435\n8/8/2013 12:00:00 AM,170,170.18,168.93,169.8,-33.91302\n8/9/2013 12:00:00 AM,169.56,170.1,168.72,169.31,-48.11609\n8/12/2013 12:00:00 AM,168.44,169.31,168.38,169.11,-53.91311\n8/13/2013 12:00:00 AM,169.4,169.9,168.41,169.61,-39.42034\n8/14/2013 12:00:00 AM,169.52,169.8,168.7,168.74,-64.63761\n8/15/2013 12:00:00 AM,167.35,167.43,166.09,166.38,-94.05721\n8/16/2013 12:00:00 AM,166.04,166.63,165.5,165.83,-93.96706\n8/19/2013 12:00:00 AM,165.64,166.21,164.76,164.77,-99.83881\n8/20/2013 12:00:00 AM,165.03,166.2,164.86,165.58,-86.79539\n8/21/2013 12:00:00 AM,165.15,166.03,164.19,164.56,-94.54285\n8/22/2013 12:00:00 AM,164.92,166.3,164.89,166.06,-72.37823\n8/23/2013 12:00:00 AM,166.54,166.83,165.77,166.62,-61.6115\n8/26/2013 12:00:00 AM,166.77,167.3,165.89,166,-69.78297\n8/27/2013 12:00:00 AM,164.33,164.98,163.21,163.33,-98.2784\n8/28/2013 12:00:00 AM,163.3,164.49,163.05,163.91,-87.80141\n8/29/2013 12:00:00 AM,163.55,165.04,163.4,164.17,-83.64968\n8/30/2013 12:00:00 AM,164.52,164.53,163.17,163.65,-91.241\n9/3/2013 12:00:00 AM,165.24,165.58,163.7,164.39,-80.1482\n9/4/2013 12:00:00 AM,164.44,166.03,164.14,165.75,-38.35609\n9/5/2013 12:00:00 AM,165.85,166.4,165.73,165.96,-31.52933\n9/6/2013 12:00:00 AM,166.49,166.98,164.48,166.04,-29.64729\n9/9/2013 12:00:00 AM,166.45,167.73,166.45,167.63,-2.13656\n9/10/2013 12:00:00 AM,168.63,168.9,168.26,168.87,-0.5128005\n9/11/2013 12:00:00 AM,168.64,169.4,168.35,169.4,0\n9/12/2013 12:00:00 AM,169.37,169.56,168.72,168.95,-9.370217\n9/13/2013 12:00:00 AM,169.15,169.46,168.74,169.33,-3.532964\n9/16/2013 12:00:00 AM,171.18,171.24,170.04,170.31,-11.3554\n9/17/2013 12:00:00 AM,170.47,171.11,170.46,171.07,-2.075679\n9/18/2013 12:00:00 AM,170.97,173.52,170.58,173.05,-4.541072\n9/19/2013 12:00:00 AM,173.51,173.6,172.59,172.76,-8.053797\n9/20/2013 12:00:00 AM,172.3,172.33,170.58,170.72,-29.09093\n9/23/2013 12:00:00 AM,170.5,170.65,169.39,169.93,-38.79504\n9/24/2013 12:00:00 AM,169.89,170.53,169.21,169.53,-44.62722\n9/25/2013 12:00:00 AM,169.65,169.98,168.89,169.04,-50.00008\n9/26/2013 12:00:00 AM,169.34,170.17,169.05,169.69,-54.6853\n9/27/2013 12:00:00 AM,168.81,169.14,168.47,168.91,-87.82757\n9/30/2013 12:00:00 AM,167.45,168.54,167.15,168.01,-86.66668\n10/1/2013 12:00:00 AM,168.14,169.5,168,169.34,-66.04654\n10/2/2013 12:00:00 AM,168.35,169.34,167.83,169.18,-68.52721\n10/3/2013 12:00:00 AM,168.77,168.94,166.84,167.62,-88.46157\n10/4/2013 12:00:00 AM,167.74,169.06,167.53,168.89,-69.67455\n10/7/2013 12:00:00 AM,167.43,168.45,167.25,167.43,-91.27225\n10/8/2013 12:00:00 AM,167.45,167.62,165.36,165.48,-98.54375\n10/9/2013 12:00:00 AM,165.8,166.2,164.53,165.6,-86.28196\n10/10/2013 12:00:00 AM,167.29,169.26,167.23,169.17,-24.18296\n10/11/2013 12:00:00 AM,168.9,170.32,168.77,170.26,-4.500071\n10/14/2013 12:00:00 AM,169.24,171.08,169.08,170.94,-2.137394\n10/15/2013 12:00:00 AM,170.52,171.15,169.47,169.7,-21.90329\n10/16/2013 12:00:00 AM,170.75,172.16,170.63,172.07,-1.179506\n10/17/2013 12:00:00 AM,171.37,173.32,171.34,173.22,-1.137725\n10/18/2013 12:00:00 AM,173.86,174.51,173.51,174.39,-1.202356\n10/21/2013 12:00:00 AM,174.45,174.75,174.01,174.4,-3.424717\n10/22/2013 12:00:00 AM,174.91,175.93,174.66,175.41,-4.56131\n10/23/2013 12:00:00 AM,174.83,174.89,173.96,174.57,-11.9297\n10/24/2013 12:00:00 AM,174.9,175.37,174.51,175.15,-6.842098\n10/25/2013 12:00:00 AM,175.51,176,175.17,175.95,-0.4359463\n10/28/2013 12:00:00 AM,175.9,176.47,175.7,176.23,-2.010096\n10/29/2013 12:00:00 AM,176.6,177.24,176.38,177.17,-0.6993732\n10/30/2013 12:00:00 AM,177.4,177.51,175.66,176.29,-13.95884\n10/31/2013 12:00:00 AM,176.18,176.89,175.53,175.79,-20.40335\n11/1/2013 12:00:00 AM,176.05,176.61,175.22,176.21,-16.16902\n11/4/2013 12:00:00 AM,176.71,176.9,175.98,176.83,-9.88363\n11/5/2013 12:00:00 AM,176.16,176.75,175.57,176.27,-20.09709\n11/6/2013 12:00:00 AM,177.03,177.5,176.54,177.17,-8.499908\n11/7/2013 12:00:00 AM,177.56,177.64,174.76,174.93,-73.64163\n11/8/2013 12:00:00 AM,174.85,177.31,174.85,177.29,-9.511054\n11/11/2013 12:00:00 AM,177.14,177.53,176.91,177.32,-8.695454\n11/12/2013 12:00:00 AM,176.95,177.36,176.37,176.96,-21.72497\n11/13/2013 12:00:00 AM,176.1,178.41,176.09,178.38,-0.8218823\n11/14/2013 12:00:00 AM,178.53,179.42,178.25,179.27,-3.218751\n11/15/2013 12:00:00 AM,179.57,180.12,179.33,180.05,-1.305822\n11/18/2013 12:00:00 AM,180.39,180.5,179.02,179.42,-18.81535\n11/19/2013 12:00:00 AM,179.31,179.87,178.72,179.03,-25.60975\n11/20/2013 12:00:00 AM,179.41,179.93,177.98,178.47,-35.3658\n11/21/2013 12:00:00 AM,179,180.05,178.86,179.91,-10.27867\n11/22/2013 12:00:00 AM,180.01,180.83,179.77,180.81,-0.3295593\n11/25/2013 12:00:00 AM,181.11,181.17,180.37,180.63,-8.424228\n11/26/2013 12:00:00 AM,180.74,181.22,180.4,180.68,-8.359257\n11/27/2013 12:00:00 AM,180.89,181.24,180.65,181.12,-1.878097\n11/29/2013 12:00:00 AM,181.34,181.75,180.8,181,-13.25087\n12/2/2013 12:00:00 AM,181.12,181.43,180.25,180.53,-21.55478\n12/3/2013 12:00:00 AM,179.95,180.39,179.17,179.75,-35.33567\n12/4/2013 12:00:00 AM,179.18,180.48,178.35,179.73,-53.58096\n12/5/2013 12:00:00 AM,179.42,179.74,178.77,178.94,-74.53566\n12/6/2013 12:00:00 AM,180.72,181.11,180.15,180.94,-21.48532\n12/9/2013 12:00:00 AM,181.47,181.67,181.16,181.4,-9.283971\n12/10/2013 12:00:00 AM,180.96,181.36,180.63,180.75,-26.52517\n12/11/2013 12:00:00 AM,180.81,180.85,178.5,178.72,-89.11777\n12/12/2013 12:00:00 AM,178.61,178.86,177.76,178.13,-90.72657\n12/13/2013 12:00:00 AM,178.48,178.66,177.77,178.11,-91.22793\n12/16/2013 12:00:00 AM,178.95,179.81,178.9,179.22,-63.40841\n12/17/2013 12:00:00 AM,179.37,179.41,178.25,178.65,-77.69428\n12/18/2013 12:00:00 AM,178.91,181.73,177.32,181.7,-1.128739\n12/19/2013 12:00:00 AM,181.18,181.7,180.71,181.49,-5.44197\n12/20/2013 12:00:00 AM,180.67,181.99,180.57,181.56,-9.207882\n12/23/2013 12:00:00 AM,182.41,182.64,182.07,182.53,-2.067684\n12/24/2013 12:00:00 AM,182.57,183.01,182.53,182.93,-1.406011\n12/26/2013 12:00:00 AM,183.37,183.96,183.32,183.85,-1.656636\n12/27/2013 12:00:00 AM,184.14,184.18,183.66,183.85,-4.81031\n12/30/2013 12:00:00 AM,183.92,184.02,183.58,183.82,-5.247611\n12/31/2013 12:00:00 AM,184.11,184.69,183.93,184.69,0\n1/2/2014 12:00:00 AM,183.91,184.07,182.48,182.92,-24.01636\n1/3/2014 12:00:00 AM,183.24,183.6,182.63,182.88,-24.55901\n1/6/2014 12:00:00 AM,183.52,183.56,182.08,182.36,-31.6147\n1/7/2014 12:00:00 AM,183.12,183.79,182.95,183.48,-16.41801\n1/8/2014 12:00:00 AM,183.46,183.83,182.89,183.52,-15.87516\n1/9/2014 12:00:00 AM,184.1,184.13,182.79,183.64,-25.48554\n1/10/2014 12:00:00 AM,183.96,184.22,183.01,184.14,-13.3496\n1/13/2014 12:00:00 AM,183.64,184.18,181.34,181.68,-89.85088\n1/14/2014 12:00:00 AM,182.27,183.77,181.95,183.67,-30.44783\n1/15/2014 12:00:00 AM,184.1,184.94,183.71,184.66,-7.77773\n1/16/2014 12:00:00 AM,184.3,184.66,183.83,184.42,-14.44454\n1/17/2014 12:00:00 AM,184.1,184.45,183.32,183.63,-36.38876\n1/21/2014 12:00:00 AM,184.72,184.77,183.05,184.18,-21.11135\n1/22/2014 12:00:00 AM,184.51,184.57,183.91,184.3,-17.77773\n1/23/2014 12:00:00 AM,183.38,183.4,181.82,182.79,-59.72237\n1/24/2014 12:00:00 AM,181.59,181.66,178.83,178.89,-99.01804\n1/27/2014 12:00:00 AM,179.05,179.52,177.12,178.01,-88.61894\n1/28/2014 12:00:00 AM,178.23,179.3,178.12,179.07,-75.0638\n1/29/2014 12:00:00 AM,177.59,178.55,176.88,177.35,-94.16872\n1/30/2014 12:00:00 AM,178.88,179.81,178.26,179.23,-70.84378\n1/31/2014 12:00:00 AM,177,179.29,176.92,178.18,-83.87112\n2/3/2014 12:00:00 AM,177.95,178.37,173.83,174.17,-96.93973\n2/4/2014 12:00:00 AM,174.98,175.84,174.11,175.38,-86.04858\n2/5/2014 12:00:00 AM,174.77,175.56,173.71,175.17,-86.79935\n2/6/2014 12:00:00 AM,175.61,177.48,175.22,177.48,-65.91329\n2/7/2014 12:00:00 AM,178.29,179.87,177.73,179.68,-46.02182\n2/10/2014 12:00:00 AM,179.7,180.07,179.21,180.01,-41.98907\n2/11/2014 12:00:00 AM,180.23,182.44,180.04,181.98,-14.65428\n2/12/2014 12:00:00 AM,182.26,182.83,181.71,182.07,-8.333278\n2/13/2014 12:00:00 AM,180.85,183.2,180.83,183.01,-2.002135\n2/14/2014 12:00:00 AM,182.9,184.36,182.67,184.02,-3.192456\n2/18/2014 12:00:00 AM,184.2,184.49,183.65,184.24,-2.31911\n2/19/2014 12:00:00 AM,183.78,184.95,182.87,183.02,-17.17077\n2/20/2014 12:00:00 AM,183.27,184.52,182.6,184.1,-7.562203\n2/21/2014 12:00:00 AM,184.45,184.89,183.8,183.89,-9.430592\n2/24/2014 12:00:00 AM,184.3,186.15,184.2,184.91,-9.967777\n2/25/2014 12:00:00 AM,185.03,185.59,184.23,184.84,-10.53054\n2/26/2014 12:00:00 AM,185.1,185.6,184.33,184.85,-11.89377\n2/27/2014 12:00:00 AM,184.58,185.87,184.37,185.82,-3.919081\n2/28/2014 12:00:00 AM,185.78,187.15,185.05,186.29,-10.83126\n3/3/2014 12:00:00 AM,184.65,185.45,183.75,184.98,-30.52036\n3/4/2014 12:00:00 AM,186.79,187.98,186.75,187.58,-5.594325\n3/5/2014 12:00:00 AM,187.75,188.07,187.45,187.75,-4.419987\n3/6/2014 12:00:00 AM,188.24,188.61,187.78,188.18,-7.154881\n3/7/2014 12:00:00 AM,188.93,188.96,187.43,188.26,-11.00648\n3/10/2014 12:00:00 AM,187.94,188.23,187.08,188.16,-12.57866\n3/11/2014 12:00:00 AM,188.48,188.71,186.8,187.23,-27.20143\n3/12/2014 12:00:00 AM,186.32,187.35,185.9,187.28,-32.24579\n3/13/2014 12:00:00 AM,187.88,187.99,184.66,185.18,-72.55296\n3/14/2014 12:00:00 AM,184.8,185.8,184.44,184.66,-82.53354\n3/17/2014 12:00:00 AM,185.62,186.77,185.51,186.33,-50.47987\n3/18/2014 12:00:00 AM,186.74,187.91,186.51,187.66,-24.95204\n3/19/2014 12:00:00 AM,187.71,187.94,185.47,186.66,-44.14587\n3/20/2014 12:00:00 AM,186.25,187.89,185.92,187.75,-23.22467\n3/21/2014 12:00:00 AM,187.71,189.02,186.03,186.2,-61.57219\n3/24/2014 12:00:00 AM,186.84,187.07,184.62,185.43,-78.3845\n3/25/2014 12:00:00 AM,186.4,186.94,185.27,186.31,-59.17043\n3/26/2014 12:00:00 AM,187,187.34,184.92,184.97,-88.42798\n3/27/2014 12:00:00 AM,184.77,185.34,183.9,184.58,-86.71862\n3/28/2014 12:00:00 AM,185.14,186.42,185,185.49,-68.94515\n3/31/2014 12:00:00 AM,186.66,187.3,186.47,187.01,-39.25792\n4/1/2014 12:00:00 AM,187.65,188.36,187.45,188.25,-15.03912\n4/2/2014 12:00:00 AM,188.5,189.13,188.14,188.88,-4.780105\n4/3/2014 12:00:00 AM,189.13,189.22,188.05,188.63,-11.09014\n4/4/2014 12:00:00 AM,189.64,189.7,186.1,186.4,-56.89658\n4/7/2014 12:00:00 AM,185.9,186.26,183.96,184.34,-92.41376\n4/8/2014 12:00:00 AM,184.18,185.4,183.59,185.1,-75.28625\n4/9/2014 12:00:00 AM,185.61,187.15,185.06,187.09,-42.71686\n4/10/2014 12:00:00 AM,187.07,187.17,182.93,183.15,-96.75035\n4/11/2014 12:00:00 AM,182.16,183.42,181.31,181.51,-97.61625\n4/14/2014 12:00:00 AM,182.92,183.37,181.44,182.94,-80.57205\n4/15/2014 12:00:00 AM,183.35,184.33,181.51,184.2,-65.55424\n4/16/2014 12:00:00 AM,185.47,186.14,184.65,186.12,-42.66987\n4/17/2014 12:00:00 AM,185.87,186.91,185.56,186.39,-39.4517\n4/21/2014 12:00:00 AM,186.45,187.1,186.21,187.04,-31.70446\n4/22/2014 12:00:00 AM,187.24,188.4,187.13,187.89,-21.57327\n4/23/2014 12:00:00 AM,187.8,187.92,187.3,187.45,-26.81764\n4/24/2014 12:00:00 AM,188.39,188.39,186.93,187.83,-22.28838\n4/25/2014 12:00:00 AM,187.23,187.33,185.87,186.29,-29.76025\n4/28/2014 12:00:00 AM,187.08,187.69,184.96,186.88,-21.4385\n4/29/2014 12:00:00 AM,187.48,188.04,187.08,187.75,-9.167761\n4/30/2014 12:00:00 AM,187.46,188.5,187.18,188.31,-2.642592\n5/1/2014 12:00:00 AM,188.25,188.84,187.73,188.32,-6.905566\n5/2/2014 12:00:00 AM,188.33,189.14,187.78,188.06,-14.026\n5/5/2014 12:00:00 AM,187.16,188.55,186.62,188.42,-9.436445\n5/6/2014 12:00:00 AM,188.03,188.13,186.74,186.78,-52.5612\n5/7/2014 12:00:00 AM,187.41,187.97,186.01,187.88,-30.14346\n5/8/2014 12:00:00 AM,187.71,189.05,187.08,187.68,-34.92845\n5/9/2014 12:00:00 AM,187.71,188.04,186.83,187.96,-28.22954\n5/12/2014 12:00:00 AM,188.77,189.88,188,189.79,-1.829505\n5/13/2014 12:00:00 AM,190.03,190.42,189.77,189.96,-8.424765\n5/14/2014 12:00:00 AM,189.82,189.88,188.79,189.06,-24.90848\n5/15/2014 12:00:00 AM,188.68,188.72,186.48,187.4,-55.31152\n5/16/2014 12:00:00 AM,187.5,188.13,186.72,188.05,-53.74134\n5/19/2014 12:00:00 AM,187.71,188.89,187.52,188.74,-38.09504\n5/20/2014 12:00:00 AM,188.67,188.67,187.07,187.55,-65.0792\n5/21/2014 12:00:00 AM,188.07,189.22,188.06,189.13,-29.25152\n5/22/2014 12:00:00 AM,189.2,189.98,188.86,189.59,-18.82089\n5/23/2014 12:00:00 AM,189.76,190.48,189.59,190.35,-2.908045\n5/27/2014 12:00:00 AM,191.06,191.58,190.95,191.52,-1.077154\n5/28/2014 12:00:00 AM,191.55,191.82,191.06,191.38,-8.239728\n5/29/2014 12:00:00 AM,191.85,192.4,191.33,192.37,-0.5067363\n5/30/2014 12:00:00 AM,192.21,192.8,192.03,192.68,-1.898896\n6/2/2014 12:00:00 AM,192.98,192.99,191.97,192.9,-1.382665\n6/3/2014 12:00:00 AM,192.41,192.9,192.25,192.8,-2.91862\n6/4/2014 12:00:00 AM,192.46,193.3,192.26,193.19,-1.61291\n6/5/2014 12:00:00 AM,193.43,194.65,192.7,194.45,-2.522032\n6/6/2014 12:00:00 AM,194.88,195.43,194.78,195.38,-0.5979412\n6/9/2014 12:00:00 AM,195.36,196.05,195.17,195.58,-5.233869\n6/10/2014 12:00:00 AM,195.36,195.64,194.92,195.6,-5.631998\n6/11/2014 12:00:00 AM,194.87,195.12,194.48,194.92,-15.71634\n6/12/2014 12:00:00 AM,194.68,194.8,193.11,193.54,-38.8546\n6/13/2014 12:00:00 AM,193.89,194.32,193.3,194.13,-37.64698\n6/16/2014 12:00:00 AM,193.88,194.7,193.66,194.29,-35.2707\n6/17/2014 12:00:00 AM,194,194.97,193.81,194.83,-25.84748\n6/18/2014 12:00:00 AM,194.83,196.37,194.4,196.26,-2.500017\n6/19/2014 12:00:00 AM,196.46,196.6,195.8,196.48,-2.592014\n6/20/2014 12:00:00 AM,196.01,196.1,195.7,195.94,-15.17248\n6/23/2014 12:00:00 AM,196,196.05,195.52,195.88,-16.58985\n6/24/2014 12:00:00 AM,195.54,196.5,194.48,194.7,-48.71807\n6/25/2014 12:00:00 AM,194.28,195.78,194.25,195.58,-29.22644\n6/26/2014 12:00:00 AM,195.6,195.63,194.13,195.44,-33.23787\n6/27/2014 12:00:00 AM,194.98,195.88,194.88,195.82,-22.3495\n6/30/2014 12:00:00 AM,195.71,196.16,195.53,195.72,-25.215\n7/1/2014 12:00:00 AM,196.21,197.63,196.13,197.03,-13.27446\n7/2/2014 12:00:00 AM,197.03,197.48,196.96,197.23,-9.238083\n7/3/2014 12:00:00 AM,197.81,198.29,197.64,198.2,-1.94377\n7/7/2014 12:00:00 AM,197.84,197.98,197.22,197.51,-17.4107\n7/8/2014 12:00:00 AM,197.12,197.22,195.76,196.24,-49.27869\n7/9/2014 12:00:00 AM,196.75,197.29,196.31,197.12,-28.12503\n7/10/2014 12:00:00 AM,195.24,196.86,195.06,196.34,-46.87506\n7/11/2014 12:00:00 AM,196.24,196.75,195.78,196.61,-40.38455\n7/14/2014 12:00:00 AM,197.63,197.86,197.44,197.6,-16.58628\n7/15/2014 12:00:00 AM,197.71,198.1,196.36,197.23,-25.48078\n7/16/2014 12:00:00 AM,198.12,198.26,197.42,197.96,-7.932392\n7/17/2014 12:00:00 AM,197.33,198.1,195.43,195.71,-75.65969\n7/18/2014 12:00:00 AM,196.38,197.91,196.24,197.71,-17.95626\n7/21/2014 12:00:00 AM,197.08,197.5,196.43,197.34,-29.41171\n7/22/2014 12:00:00 AM,198.04,198.56,197.87,198.2,-10.28573\n7/23/2014 12:00:00 AM,198.51,198.85,198.1,198.64,-5.541062\n7/24/2014 12:00:00 AM,198.82,199.06,198.45,198.65,-10.25009\n7/25/2014 12:00:00 AM,198.11,198.26,197.33,197.72,-33.49991\n7/28/2014 12:00:00 AM,197.78,198.09,196.62,197.8,-31.49986\n7/29/2014 12:00:00 AM,198.21,198.45,196.92,196.95,-52.75002\n7/30/2014 12:00:00 AM,197.66,197.91,196.16,196.98,-57.30025\n7/31/2014 12:00:00 AM,195.63,195.78,192.97,193.09,-98.02963\n8/1/2014 12:00:00 AM,192.58,193.76,191.57,192.5,-87.58353\n8/4/2014 12:00:00 AM,192.87,194.3,192.05,193.89,-69.02544\n8/5/2014 12:00:00 AM,193.11,193.6,191.31,192.01,-90.96778\n8/6/2014 12:00:00 AM,191.08,192.89,191.08,192.07,-87.59391\n8/7/2014 12:00:00 AM,192.96,193.13,190.55,191.03,-94.35963\n8/8/2014 12:00:00 AM,191.43,193.37,190.95,193.24,-68.39008\n8/11/2014 12:00:00 AM,193.99,194.66,193.71,193.79,-61.92723\n8/12/2014 12:00:00 AM,193.63,194.15,192.94,193.53,-64.9824\n8/13/2014 12:00:00 AM,194.3,195.06,193.96,194.84,-45.69625\n8/14/2014 12:00:00 AM,195.19,195.76,194.98,195.76,-34.05069\n8/15/2014 12:00:00 AM,196.49,196.65,194.31,195.72,-34.55693\n8/18/2014 12:00:00 AM,196.81,197.45,196.69,197.36,-7.472867\n8/19/2014 12:00:00 AM,197.85,198.54,197.44,198.39,-1.877273\n8/20/2014 12:00:00 AM,198.15,199.16,198.08,198.92,-2.78752\n8/21/2014 12:00:00 AM,199.06,199.76,198.93,199.5,-2.822961\n8/22/2014 12:00:00 AM,199.32,199.69,198.74,199.19,-6.188845\n8/25/2014 12:00:00 AM,200.16,200.59,199.15,200.2,-3.884459\n8/26/2014 12:00:00 AM,200.35,200.82,200.28,200.33,-4.77123\n8/27/2014 12:00:00 AM,200.45,200.57,199.94,200.25,-5.775144\n8/28/2014 12:00:00 AM,199.59,200.27,199.39,200.14,-8.629537\n8/29/2014 12:00:00 AM,200.44,200.73,199.82,200.71,-1.395946\n9/2/2014 12:00:00 AM,200.97,200.99,199.86,200.61,-5.405476\n9/3/2014 12:00:00 AM,201.35,201.41,200.22,200.5,-12.81694\n9/4/2014 12:00:00 AM,200.86,201.58,199.66,200.21,-18.84449\n9/5/2014 12:00:00 AM,200.19,201.19,199.41,201.11,-9.611478\n9/8/2014 12:00:00 AM,200.94,201.21,200,200.59,-23.91318\n9/9/2014 12:00:00 AM,200.42,200.55,198.91,199.32,-64.57127\n9/10/2014 12:00:00 AM,199.46,200.2,198.77,200.07,-53.16889\n9/11/2014 12:00:00 AM,199.28,200.33,199.12,200.3,-45.07044\n9/12/2014 12:00:00 AM,200.12,200.12,198.56,199.13,-81.12561\n9/15/2014 12:00:00 AM,199.17,199.32,198.38,198.98,-81.25027\n9/16/2014 12:00:00 AM,198.64,200.84,198.5,200.48,-34.37523\n9/17/2014 12:00:00 AM,200.8,201.68,199.75,200.75,-28.1817\n9/18/2014 12:00:00 AM,201.36,201.85,201.1,201.82,-0.8645178\n9/19/2014 12:00:00 AM,201.53,201.9,200.29,200.7,-34.09093\n9/22/2014 12:00:00 AM,200.33,200.38,198.73,199.15,-78.12524\n9/23/2014 12:00:00 AM,198.41,199.26,197.95,198.01,-98.48107\n9/24/2014 12:00:00 AM,198.06,199.69,197.52,199.56,-53.4247\n9/25/2014 12:00:00 AM,199.05,199.05,196.27,196.34,-98.7568\n9/26/2014 12:00:00 AM,196.7,198.39,196.42,197.9,-71.04809\n9/29/2014 12:00:00 AM,196.18,197.89,196.05,197.54,-74.53004\n9/30/2014 12:00:00 AM,197.7,198.3,196.61,197.02,-83.41875\n10/1/2014 12:00:00 AM,196.68,196.77,193.91,194.35,-94.49308\n10/2/2014 12:00:00 AM,194.18,195.05,192.35,194.38,-78.74344\n10/3/2014 12:00:00 AM,195.71,196.94,195.08,196.52,-56.33504\n10/6/2014 12:00:00 AM,197.36,197.6,195.58,196.29,-58.74354\n10/7/2014 12:00:00 AM,195.29,195.72,193.22,193.26,-90.47131\n10/8/2014 12:00:00 AM,193.36,196.92,192.36,196.64,-55.07855\n10/9/2014 12:00:00 AM,196.36,196.6,192.58,192.74,-95.14322\n10/10/2014 12:00:00 AM,192.7,193.65,190.49,190.54,-99.45666\n10/13/2014 12:00:00 AM,190.47,191.15,187.3,187.41,-99.11218\n10/14/2014 12:00:00 AM,188.46,189.82,187.04,187.7,-94.50455\n10/15/2014 12:00:00 AM,185.19,187.69,181.92,186.43,-72.61691\n10/16/2014 12:00:00 AM,183.05,187.58,182.89,186.27,-73.44319\n10/17/2014 12:00:00 AM,188.42,189.75,187.62,188.47,-60.0122\n10/20/2014 12:00:00 AM,188.12,190.45,188.07,190.3,-46.55612\n10/21/2014 12:00:00 AM,191.7,194.2,191.48,194.07,-22.51274\n10/22/2014 12:00:00 AM,194.44,194.91,192.61,192.69,-31.31378\n10/23/2014 12:00:00 AM,194.64,196.2,194.26,194.93,-17.02814\n10/24/2014 12:00:00 AM,195.23,196.49,194.49,196.43,-3.266703\n10/27/2014 12:00:00 AM,195.75,196.45,195.03,196.16,-5.06663\n10/28/2014 12:00:00 AM,196.84,198.42,196.73,198.41,-0.06057277\n10/29/2014 12:00:00 AM,198.59,199.12,196.8,198.11,-5.872062\n10/30/2014 12:00:00 AM,197.59,199.61,197.4,199.38,-1.300145\n10/31/2014 12:00:00 AM,201.78,201.82,200.77,201.66,-0.8040381\n11/3/2014 12:00:00 AM,201.92,202.45,201.3,201.77,-3.312191\n11/4/2014 12:00:00 AM,201.22,201.6,200.06,201.07,-7.055162\n11/5/2014 12:00:00 AM,202.56,202.59,201.45,202.34,-1.670007\n11/6/2014 12:00:00 AM,202.41,203.26,201.64,203.15,-0.7241653\n11/7/2014 12:00:00 AM,203.17,203.6,202.61,203.34,-2.145293\n11/10/2014 12:00:00 AM,203.4,204.04,203.13,203.98,-0.5249134\n11/11/2014 12:00:00 AM,204.07,204.31,203.65,204.18,-1.293581\n11/12/2014 12:00:00 AM,203.35,204.24,203.31,203.96,-3.564065\n11/13/2014 12:00:00 AM,204.14,204.83,203.21,204.19,-6.530604\n11/14/2014 12:00:00 AM,204.13,204.49,203.72,204.24,-7.2839\n11/17/2014 12:00:00 AM,203.85,204.58,203.65,204.37,-5.728602\n11/18/2014 12:00:00 AM,204.46,205.92,204.44,205.55,-4.342663\n11/19/2014 12:00:00 AM,205.3,205.55,204.3,205.22,-11.94534\n11/20/2014 12:00:00 AM,204.25,205.71,204.18,205.58,-5.801985\n11/21/2014 12:00:00 AM,207.6,207.84,205.98,206.68,-14.91008\n11/24/2014 12:00:00 AM,207.19,207.39,206.91,207.26,-9.076712\n11/25/2014 12:00:00 AM,207.54,207.79,206.8,207.11,-11.77413\n11/26/2014 12:00:00 AM,207.27,207.76,207.03,207.64,-3.824037\n11/28/2014 12:00:00 AM,207.52,207.87,206.91,207.2,-14.13501\n12/1/2014 12:00:00 AM,206.4,206.54,205.38,205.76,-45.27909\n12/2/2014 12:00:00 AM,205.8,207.34,205.78,207.09,-16.73821\n12/3/2014 12:00:00 AM,207.28,208.15,207.1,207.89,-5.263061\n12/4/2014 12:00:00 AM,207.55,208.26,206.7,207.66,-13.01498\n12/5/2014 12:00:00 AM,207.88,208.47,207.55,208,-9.751048\n12/8/2014 12:00:00 AM,207.55,208.12,205.93,206.61,-43.35657\n12/9/2014 12:00:00 AM,204.37,206.6,203.91,206.47,-43.85967\n12/10/2014 12:00:00 AM,205.94,205.98,202.93,203.16,-95.84818\n12/11/2014 12:00:00 AM,203.89,206.19,203.71,204.19,-77.25618\n12/12/2014 12:00:00 AM,202.65,203.82,200.85,200.89,-99.47515\n12/15/2014 12:00:00 AM,202,202.53,198.78,199.51,-92.46651\n12/16/2014 12:00:00 AM,198.55,202.4,197.86,197.91,-99.52872\n12/17/2014 12:00:00 AM,198.48,202.34,198.29,201.79,-62.95955\n12/18/2014 12:00:00 AM,204.78,212.97,203.92,206.78,-40.96626\n12/19/2014 12:00:00 AM,206.46,207.33,205.61,206.52,-42.68694\n12/22/2014 12:00:00 AM,206.71,207.47,206.46,207.47,-36.39973\n12/23/2014 12:00:00 AM,208.2,208.23,207.4,207.75,-34.54667\n12/24/2014 12:00:00 AM,208.03,208.34,207.72,207.77,-34.41427\n12/26/2014 12:00:00 AM,208.29,208.85,208.25,208.44,-29.98014\n12/29/2014 12:00:00 AM,208.25,208.97,208.14,208.72,-28.12707\n12/30/2014 12:00:00 AM,208.21,208.37,207.51,207.6,-35.53934\n12/31/2014 12:00:00 AM,207.96,208.19,205.39,205.54,-49.17278\n1/2/2015 12:00:00 AM,206.39,206.88,204.18,205.43,-49.90078\n1/5/2015 12:00:00 AM,204.2,204.37,201.35,201.72,-74.454\n1/6/2015 12:00:00 AM,202.13,202.72,198.85,199.82,-87.02841\n1/7/2015 12:00:00 AM,201.46,202.72,200.88,202.31,-72.61579\n1/8/2015 12:00:00 AM,204,206.16,203.99,205.9,-50.07089\n1/9/2015 12:00:00 AM,206.39,206.42,203.51,204.25,-46.64035\n1/12/2015 12:00:00 AM,204.42,204.6,201.92,202.65,-62.4507\n1/13/2015 12:00:00 AM,204.15,205.48,200.51,202.08,-68.08303\n1/14/2015 12:00:00 AM,199.67,201.1,198.57,200.86,-77.98082\n1/15/2015 12:00:00 AM,201.64,202.01,198.88,199.02,-95.6731\n1/16/2015 12:00:00 AM,198.75,201.82,198.55,201.63,-70.44144\n1/20/2015 12:00:00 AM,202.42,202.72,200.17,202.05,-64.35842\n1/21/2015 12:00:00 AM,201.51,203.66,200.94,203.08,-53.00831\n1/22/2015 12:00:00 AM,204.02,206.26,202.33,206.1,-9.363729\n1/23/2015 12:00:00 AM,205.8,206.1,204.81,204.97,-18.42437\n1/26/2015 12:00:00 AM,204.73,205.56,203.85,205.45,-12.32531\n1/27/2015 12:00:00 AM,203,204.12,201.74,202.74,-46.75978\n1/28/2015 12:00:00 AM,204.16,204.29,199.91,200.14,-79.79673\n1/29/2015 12:00:00 AM,200.34,202.3,198.68,201.99,-56.28965\n1/30/2015 12:00:00 AM,200.56,202.17,199.13,199.45,-88.32691\n2/2/2015 12:00:00 AM,200.07,202.03,197.86,201.92,-51.66666\n2/3/2015 12:00:00 AM,203.02,204.85,202.55,204.84,-16.90475\n2/4/2015 12:00:00 AM,203.94,205.38,203.51,204.06,-26.19046\n2/5/2015 12:00:00 AM,204.83,206.3,204.77,206.12,-2.132795\n2/6/2015 12:00:00 AM,206.57,207.24,204.92,205.55,-18.01707\n2/9/2015 12:00:00 AM,204.77,205.64,204.13,204.63,-27.82515\n2/10/2015 12:00:00 AM,205.89,207.12,204.68,206.81,-4.584304\n2/11/2015 12:00:00 AM,206.6,207.45,205.83,206.93,-5.422361\n2/12/2015 12:00:00 AM,207.91,208.99,206.97,208.92,-0.6289964\n2/13/2015 12:00:00 AM,209.08,209.84,208.76,209.78,-0.5008145\n2/17/2015 12:00:00 AM,209.38,210.32,209.1,210.11,-1.685446\n2/18/2015 12:00:00 AM,209.63,210.22,209.34,210.13,-1.524898\n2/19/2015 12:00:00 AM,209.43,210.42,209.24,209.98,-3.503205\n2/20/2015 12:00:00 AM,209.43,211.33,208.73,211.24,-0.6681242\n2/23/2015 12:00:00 AM,210.97,211.21,210.48,211.21,-1.366687\n2/24/2015 12:00:00 AM,211.11,212.05,210.76,211.81,-2.810366\n2/25/2015 12:00:00 AM,211.64,212.24,211.22,211.63,-7.521585\n2/26/2015 12:00:00 AM,211.55,211.71,210.65,211.38,-10.6042\n2/27/2015 12:00:00 AM,211.25,211.58,210.6,210.66,-19.48214\n3/2/2015 12:00:00 AM,210.76,212.06,210.72,211.99,-3.306873\n3/3/2015 12:00:00 AM,211.46,212.05,210.08,211.12,-17.47285\n3/4/2015 12:00:00 AM,210.42,210.49,209.06,210.23,-38.14057\n3/5/2015 12:00:00 AM,210.63,210.8,209.85,210.46,-50.71207\n3/6/2015 12:00:00 AM,209.38,209.94,207.1,207.5,-92.21802\n3/9/2015 12:00:00 AM,207.76,208.79,207.55,208.36,-75.48649\n3/10/2015 12:00:00 AM,206.71,206.81,204.93,204.98,-99.31596\n3/11/2015 3:58:01 PM,205.29,205.5,204.45,204.65,-97.43265"
  },
  {
    "path": "Tests/TestData/spy_with_zlema.csv",
    "content": "Date,Close,ZLEMA5\n02/22/2013 12:00:00 AM,151.89,\n02/25/2013 12:00:00 AM,149.0,\n02/26/2013 12:00:00 AM,150.02,\n02/27/2013 12:00:00 AM,151.91,\n02/28/2013 12:00:00 AM,151.61,\n03/01/2013 12:00:00 AM,152.11,\n03/04/2013 12:00:00 AM,152.92,152.542\n03/05/2013 12:00:00 AM,154.29,153.85133333333334\n03/06/2013 12:00:00 AM,154.5,154.59422222222224\n03/07/2013 12:00:00 AM,154.78,154.81948148148152\n03/08/2013 12:00:00 AM,155.44,155.33965432098768\n03/11/2013 12:00:00 AM,156.03,155.9864362139918\n03/12/2013 12:00:00 AM,155.68,155.96429080932788\n03/13/2013 12:00:00 AM,155.9,155.89952720621858\n03/14/2013 12:00:00 AM,156.73,156.5263514708124\n03/15/2013 12:00:00 AM,155.83,156.2709009805416\n03/18/2013 12:00:00 AM,154.97,155.25060065369442\n03/19/2013 12:00:00 AM,154.61,154.6304004357963\n03/20/2013 12:00:00 AM,155.69,155.22360029053087\n03/21/2013 12:00:00 AM,154.36,154.85240019368726\n03/22/2013 12:00:00 AM,155.6,155.07160012912485\n03/25/2013 12:00:00 AM,154.95,155.22773341941655\n03/26/2013 12:00:00 AM,156.19,155.7451556129444\n03/27/2013 12:00:00 AM,156.19,156.3067704086296\n03/28/2013 12:00:00 AM,156.67,156.5878469390864\n04/01/2013 12:00:00 AM,156.05,156.36189795939094\n04/02/2013 12:00:00 AM,156.82,156.56459863959398\n04/03/2013 12:00:00 AM,155.23,155.84639909306264\n04/04/2013 12:00:00 AM,155.86,155.53093272870845\n04/05/2013 12:00:00 AM,155.16,155.3839551524723\n04/08/2013 12:00:00 AM,156.21,155.77597010164823\n04/09/2013 12:00:00 AM,156.75,156.63064673443216\n04/10/2013 12:00:00 AM,158.67,158.1304311562881\n04/11/2013 12:00:00 AM,159.19,159.29695410419208\n04/12/2013 12:00:00 AM,158.8,159.1746360694614\n04/15/2013 12:00:00 AM,155.12,156.46642404630762\n04/16/2013 12:00:00 AM,157.41,156.31761603087176\n04/17/2013 12:00:00 AM,155.11,155.91174402058118\n04/18/2013 12:00:00 AM,154.14,154.23116268038746\n04/19/2013 12:00:00 AM,155.48,154.7707751202583\n04/22/2013 12:00:00 AM,156.17,155.9138500801722\n04/23/2013 12:00:00 AM,157.78,157.3025667201148\n04/24/2013 12:00:00 AM,157.88,158.06504448007655\n04/25/2013 12:00:00 AM,158.52,158.4633629867177\n04/26/2013 12:00:00 AM,158.24,158.50890865781182\n04/29/2013 12:00:00 AM,159.3,159.03260577187456\n04/30/2013 12:00:00 AM,159.68,159.72840384791638\n05/01/2013 12:00:00 AM,158.28,158.9056025652776\n05/02/2013 12:00:00 AM,159.75,159.21040171018507\n05/03/2013 12:00:00 AM,161.37,160.96026780679006\n05/06/2013 12:00:00 AM,161.78,161.91017853786005\n05/07/2013 12:00:00 AM,162.6,162.55011902524004\n05/08/2013 12:00:00 AM,163.34,163.33341268349338\n05/09/2013 12:00:00 AM,162.88,163.27560845566225\n05/10/2013 12:00:00 AM,163.41,163.3437389704415\n05/13/2013 12:00:00 AM,163.54,163.62915931362767\n05/14/2013 12:00:00 AM,165.23,164.76943954241847\n05/15/2013 12:00:00 AM,166.12,166.07962636161233\n05/16/2013 12:00:00 AM,165.34,165.86975090774158\n05/17/2013 12:00:00 AM,166.94,166.4998339384944\n05/20/2013 12:00:00 AM,166.93,167.17322262566296\n05/21/2013 12:00:00 AM,167.17,167.2488150837753\n05/22/2013 12:00:00 AM,165.93,166.4758767225169\n05/23/2013 12:00:00 AM,165.45,165.56058448167792\n05/24/2013 12:00:00 AM,165.31,165.27038965445195\n05/28/2013 12:00:00 AM,166.3,165.89692643630133\n05/29/2013 12:00:00 AM,165.22,165.64128429086756\n05/30/2013 12:00:00 AM,165.83,165.5475228605784\n05/31/2013 12:00:00 AM,163.45,164.25834857371893\n06/03/2013 12:00:00 AM,164.35,163.79556571581264\n06/04/2013 12:00:00 AM,163.56,163.75371047720844\n06/05/2013 12:00:00 AM,161.27,161.89914031813896\n06/06/2013 12:00:00 AM,162.73,161.8994268787593\n06/07/2013 12:00:00 AM,164.8,164.0429512525062\n06/10/2013 12:00:00 AM,164.8,164.98530083500415\n06/11/2013 12:00:00 AM,163.1,163.79020055666945\n06/12/2013 12:00:00 AM,161.75,162.09346703777965\n06/13/2013 12:00:00 AM,164.21,163.16897802518645\n06/14/2013 12:00:00 AM,163.18,163.64931868345764\n06/17/2013 12:00:00 AM,164.44,163.98954578897175\n06/18/2013 12:00:00 AM,165.74,165.4263638593145\n06/19/2013 12:00:00 AM,163.45,164.43757590620967\n06/20/2013 12:00:00 AM,159.4,160.64505060413978\n06/21/2013 12:00:00 AM,159.07,158.6600337360932\n06/24/2013 12:00:00 AM,157.06,157.34668915739547\n06/25/2013 12:00:00 AM,158.57,157.58779277159698\n06/26/2013 12:00:00 AM,160.14,159.46519518106464\n06/27/2013 12:00:00 AM,161.08,160.84013012070977\n06/28/2013 12:00:00 AM,160.42,160.7934200804732\n07/01/2013 12:00:00 AM,161.36,161.07561338698216\n07/02/2013 12:00:00 AM,161.21,161.38374225798813\n07/03/2013 12:00:00 AM,161.28,161.32249483865877\n07/05/2013 12:00:00 AM,163.02,162.49166322577253\n07/08/2013 12:00:00 AM,163.95,163.86777548384836\n07/09/2013 12:00:00 AM,165.13,164.9918503225656\n07/10/2013 12:00:00 AM,165.19,165.47123354837709\n07/11/2013 12:00:00 AM,167.44,166.8974890322514\n07/12/2013 12:00:00 AM,167.51,167.8749926881676\n07/15/2013 12:00:00 AM,168.15,168.2033284587784\n07/16/2013 12:00:00 AM,167.52,167.97888563918562\n07/17/2013 12:00:00 AM,167.95,167.90259042612377\n07/18/2013 12:00:00 AM,168.87,168.67506028408252\n07/19/2013 12:00:00 AM,169.17,169.24670685605503\n07/22/2013 12:00:00 AM,169.5,169.5411379040367\n07/23/2013 12:00:00 AM,169.14,169.39742526935783\n07/24/2013 12:00:00 AM,168.52,168.77828351290523\n07/25/2013 12:00:00 AM,168.93,168.75885567527018\n07/26/2013 12:00:00 AM,169.11,169.07257045018014\n07/29/2013 12:00:00 AM,168.59,168.7983803001201\n07/30/2013 12:00:00 AM,168.59,168.55558686674675\n07/31/2013 12:00:00 AM,168.71,168.64705791116452\n08/01/2013 12:00:00 AM,170.66,170.008038607443\n08/02/2013 12:00:00 AM,170.95,171.068692404962\n08/05/2013 12:00:00 AM,170.7,170.95912826997468\n08/06/2013 12:00:00 AM,169.73,170.14275217998312\n08/07/2013 12:00:00 AM,169.18,169.31516811998875\n08/08/2013 12:00:00 AM,169.8,169.50011207999253\n08/09/2013 12:00:00 AM,169.31,169.48007471999503\n08/12/2013 12:00:00 AM,169.11,169.1267164799967\n08/13/2013 12:00:00 AM,169.61,169.38781098666448\n08/14/2013 12:00:00 AM,168.74,169.04854065777633\n08/15/2013 12:00:00 AM,166.38,167.08236043851755\n08/16/2013 12:00:00 AM,165.83,165.69490695901172\n08/19/2013 12:00:00 AM,164.77,164.8499379726745\n08/20/2013 12:00:00 AM,165.58,165.0099586484497\n08/21/2013 12:00:00 AM,164.56,164.7899724322998\n08/22/2013 12:00:00 AM,166.06,165.37331495486654\n08/23/2013 12:00:00 AM,166.62,166.47554330324436\n08/26/2013 12:00:00 AM,166.0,166.29702886882959\n08/27/2013 12:00:00 AM,163.33,164.21135257921975\n08/28/2013 12:00:00 AM,163.91,163.41423505281318\n08/29/2013 12:00:00 AM,164.17,163.94615670187545\n08/30/2013 12:00:00 AM,163.65,163.76077113458365\n09/03/2013 12:00:00 AM,164.39,164.04384742305575\n09/04/2013 12:00:00 AM,165.75,165.31256494870385\n09/05/2013 12:00:00 AM,165.96,166.0517099658026\n09/06/2013 12:00:00 AM,166.04,166.14447331053506\n09/09/2013 12:00:00 AM,167.63,167.1963155403567\n09/10/2013 12:00:00 AM,168.87,168.69754369357116\n09/11/2013 12:00:00 AM,169.4,169.52169579571412\n09/12/2013 12:00:00 AM,168.95,169.35779719714276\n09/13/2013 12:00:00 AM,169.33,169.32519813142852\n09/16/2013 12:00:00 AM,170.31,170.1067987542857\n09/17/2013 12:00:00 AM,171.07,171.0078658361905\n09/18/2013 12:00:00 AM,173.05,172.60191055746034\n09/19/2013 12:00:00 AM,172.76,173.21794037164022\n09/20/2013 12:00:00 AM,170.72,171.60862691442682\n09/23/2013 12:00:00 AM,169.93,170.10575127628456\n09/24/2013 12:00:00 AM,169.53,169.51716751752303\n09/25/2013 12:00:00 AM,169.04,169.06144501168203\n09/26/2013 12:00:00 AM,169.69,169.32429667445467\n09/27/2013 12:00:00 AM,168.91,169.14286444963645\n09/30/2013 12:00:00 AM,168.01,168.2052429664243\n10/01/2013 12:00:00 AM,169.34,168.72682864428288\n10/02/2013 12:00:00 AM,169.18,169.26788576285526\n10/03/2013 12:00:00 AM,167.62,168.14525717523685\n10/04/2013 12:00:00 AM,168.89,168.29683811682457\n10/07/2013 12:00:00 AM,167.43,167.94455874454974\n10/08/2013 12:00:00 AM,165.48,165.9863724963665\n10/09/2013 12:00:00 AM,165.6,165.24758166424434\n10/10/2013 12:00:00 AM,169.17,167.78505444282956\n10/11/2013 12:00:00 AM,170.26,170.16336962855303\n10/14/2013 12:00:00 AM,170.94,171.01224641903536\n10/15/2013 12:00:00 AM,169.7,170.38816427935691\n10/16/2013 12:00:00 AM,172.07,171.32544285290462\n10/17/2013 12:00:00 AM,173.22,173.13029523526976\n10/18/2013 12:00:00 AM,174.39,174.32353015684652\n10/21/2013 12:00:00 AM,174.4,174.7423534378977\n10/22/2013 12:00:00 AM,175.41,175.3049022919318\n10/23/2013 12:00:00 AM,174.57,175.11660152795451\n10/24/2013 12:00:00 AM,175.15,175.041067685303\n10/25/2013 12:00:00 AM,175.95,175.80404512353533\n10/28/2013 12:00:00 AM,176.23,176.3060300823569\n10/29/2013 12:00:00 AM,177.17,177.00068672157127\n10/30/2013 12:00:00 AM,176.29,176.7837911477142\n10/31/2013 12:00:00 AM,175.79,175.99252743180946\n11/01/2013 12:00:00 AM,176.21,176.03835162120635\n11/04/2013 12:00:00 AM,176.83,176.64890108080425\n11/05/2013 12:00:00 AM,176.27,176.5426007205362\n11/06/2013 12:00:00 AM,177.17,176.86506714702415\n11/07/2013 12:00:00 AM,174.93,175.7733780980161\n11/08/2013 12:00:00 AM,177.29,176.31891873201076\n11/11/2013 12:00:00 AM,177.32,177.44927915467383\n11/12/2013 12:00:00 AM,176.96,177.1761861031159\n11/13/2013 12:00:00 AM,178.38,177.9307907354106\n11/14/2013 12:00:00 AM,179.27,179.1471938236071\n11/15/2013 12:00:00 AM,180.05,180.00479588240475\n11/18/2013 12:00:00 AM,179.42,179.85986392160316\n11/19/2013 12:00:00 AM,179.03,179.2432426144021\n11/20/2013 12:00:00 AM,178.47,178.66882840960142\n11/21/2013 12:00:00 AM,179.91,179.37588560640094\n11/22/2013 12:00:00 AM,180.81,180.63392373760064\n11/25/2013 12:00:00 AM,180.63,180.8726158250671\n11/26/2013 12:00:00 AM,180.68,180.7650772167114\n11/27/2013 12:00:00 AM,181.12,181.04671814447428\n11/29/2013 12:00:00 AM,181.0,181.1378120963162\n12/02/2013 12:00:00 AM,180.53,180.73854139754414\n12/03/2013 12:00:00 AM,179.75,179.9923609316961\n12/04/2013 12:00:00 AM,179.73,179.63824062113073\n12/05/2013 12:00:00 AM,178.94,179.1354937474205\n12/06/2013 12:00:00 AM,180.94,180.14032916494702\n12/09/2013 12:00:00 AM,181.4,181.38021944329802\n12/10/2013 12:00:00 AM,180.75,181.1068129621987\n12/11/2013 12:00:00 AM,178.72,179.41787530813247\n12/12/2013 12:00:00 AM,178.13,178.11525020542166\n12/13/2013 12:00:00 AM,178.11,177.91016680361446\n12/16/2013 12:00:00 AM,179.22,178.71011120240965\n12/17/2013 12:00:00 AM,178.65,178.87007413493978\n12/18/2013 12:00:00 AM,181.7,180.6400494232932\n12/19/2013 12:00:00 AM,181.49,181.87003294886213\n12/20/2013 12:00:00 AM,181.56,181.7200219659081\n12/23/2013 12:00:00 AM,182.53,182.3366813106054\n12/24/2013 12:00:00 AM,182.93,182.99112087373695\n12/26/2013 12:00:00 AM,183.85,183.71741391582464\n12/27/2013 12:00:00 AM,183.85,184.0682759438831\n12/30/2013 12:00:00 AM,183.82,183.97551729592206\n12/31/2013 12:00:00 AM,184.69,184.49367819728138\n01/02/2014 12:00:00 AM,182.92,183.66911879818758\n01/03/2014 12:00:00 AM,182.88,182.8027458654584\n01/06/2014 12:00:00 AM,182.36,182.46849724363898\n01/07/2014 12:00:00 AM,183.48,183.00566482909267\n01/08/2014 12:00:00 AM,183.52,183.56377655272846\n01/09/2014 12:00:00 AM,183.64,183.64251770181897\n01/10/2014 12:00:00 AM,184.14,184.01501180121264\n01/13/2014 12:00:00 AM,181.68,182.58334120080843\n01/14/2014 12:00:00 AM,183.67,182.7888941338723\n01/15/2014 12:00:00 AM,184.66,184.40592942258155\n01/16/2014 12:00:00 AM,184.42,184.66061961505437\n01/17/2014 12:00:00 AM,183.63,183.97374641003626\n01/21/2014 12:00:00 AM,184.18,183.96249760669085\n01/22/2014 12:00:00 AM,184.3,184.29833173779392\n01/23/2014 12:00:00 AM,182.79,183.33222115852928\n01/24/2014 12:00:00 AM,178.89,180.04814743901952\n01/27/2014 12:00:00 AM,178.01,177.77543162601302\n01/28/2014 12:00:00 AM,179.07,178.26695441734202\n01/29/2014 12:00:00 AM,177.35,177.7413029448947\n01/30/2014 12:00:00 AM,179.23,178.2908686299298\n01/31/2014 12:00:00 AM,178.18,178.53057908661987\n02/03/2014 12:00:00 AM,174.17,175.39038605774658\n02/04/2014 12:00:00 AM,175.38,174.4535907051644\n02/05/2014 12:00:00 AM,175.17,175.02572713677628\n02/06/2014 12:00:00 AM,177.48,176.5438180911842\n02/07/2014 12:00:00 AM,179.68,179.09254539412282\n02/10/2014 12:00:00 AM,180.01,180.24169692941524\n02/11/2014 12:00:00 AM,181.98,181.5877979529435\n02/12/2014 12:00:00 AM,182.07,182.43519863529568\n02/13/2014 12:00:00 AM,183.01,182.97013242353046\n02/14/2014 12:00:00 AM,184.02,183.97008828235366\n02/18/2014 12:00:00 AM,184.24,184.47005885490245\n02/19/2014 12:00:00 AM,183.02,183.65337256993496\n02/20/2014 12:00:00 AM,184.1,183.75558171328998\n02/21/2014 12:00:00 AM,183.89,184.09038780886\n02/24/2014 12:00:00 AM,184.91,184.63359187257333\n02/25/2014 12:00:00 AM,184.84,185.01906124838223\n02/26/2014 12:00:00 AM,184.85,184.9427074989215\n02/27/2014 12:00:00 AM,185.82,185.561804999281\n02/28/2014 12:00:00 AM,186.29,186.28453666618734\n03/03/2014 12:00:00 AM,184.98,185.56969111079155\n03/04/2014 12:00:00 AM,187.58,186.66979407386106\n03/05/2014 12:00:00 AM,187.75,187.95319604924072\n03/06/2014 12:00:00 AM,188.18,188.2287973661605\n03/07/2014 12:00:00 AM,188.26,188.40919824410702\n03/10/2014 12:00:00 AM,188.16,188.31946549607136\n03/11/2014 12:00:00 AM,187.23,187.6129769973809\n03/12/2014 12:00:00 AM,187.28,187.20865133158728\n03/13/2014 12:00:00 AM,185.18,185.8491008877249\n03/14/2014 12:00:00 AM,184.66,184.57940059181658\n03/17/2014 12:00:00 AM,186.33,185.54626706121107\n03/18/2014 12:00:00 AM,187.66,187.25084470747407\n03/19/2014 12:00:00 AM,186.66,187.1638964716494\n03/20/2014 12:00:00 AM,187.75,187.38926431443292\n03/21/2014 12:00:00 AM,186.2,186.83950954295528\n03/24/2014 12:00:00 AM,185.43,185.59633969530353\n03/25/2014 12:00:00 AM,186.31,185.87089313020238\n03/26/2014 12:00:00 AM,184.97,185.4172620868016\n03/27/2014 12:00:00 AM,184.58,184.56150805786774\n03/28/2014 12:00:00 AM,185.49,185.04433870524517\n03/31/2014 12:00:00 AM,187.01,186.50955913683012\n04/01/2014 12:00:00 AM,188.25,188.0097060912201\n04/02/2014 12:00:00 AM,188.88,188.92313739414675\n04/03/2014 12:00:00 AM,188.63,188.95209159609783\n04/04/2014 12:00:00 AM,186.4,187.2747277307319\n04/07/2014 12:00:00 AM,184.34,184.8664851538213\n04/08/2014 12:00:00 AM,185.1,184.51099010254754\n04/09/2014 12:00:00 AM,187.09,186.2873267350317\n04/10/2014 12:00:00 AM,183.15,184.59155115668784\n04/11/2014 12:00:00 AM,181.51,181.7043674377919\n04/14/2014 12:00:00 AM,182.94,182.04624495852795\n04/15/2014 12:00:00 AM,184.2,183.66082997235196\n04/16/2014 12:00:00 AM,186.12,185.54055331490133\n04/17/2014 12:00:00 AM,186.39,186.55370220993422\n04/21/2014 12:00:00 AM,187.04,187.02246813995615\n04/22/2014 12:00:00 AM,187.89,187.81164542663743\n04/23/2014 12:00:00 AM,187.45,187.8277636177583\n04/24/2014 12:00:00 AM,187.83,187.80850907850555\n04/25/2014 12:00:00 AM,186.29,186.9156727190037\n04/28/2014 12:00:00 AM,186.88,186.58711514600247\n04/29/2014 12:00:00 AM,187.75,187.461410097335\n04/30/2014 12:00:00 AM,188.31,188.22094006489002\n05/01/2014 12:00:00 AM,188.32,188.44396004326\n05/02/2014 12:00:00 AM,188.06,188.23264002884002\n05/05/2014 12:00:00 AM,188.42,188.32842668589336\n05/06/2014 12:00:00 AM,186.78,187.38561779059557\n05/07/2014 12:00:00 AM,187.88,187.37041186039707\n05/08/2014 12:00:00 AM,187.68,187.77360790693137\n05/09/2014 12:00:00 AM,187.96,187.8624052712876\n05/12/2014 12:00:00 AM,189.79,189.2082701808584\n05/13/2014 12:00:00 AM,189.96,190.12551345390563\n05/14/2014 12:00:00 AM,189.06,189.52700896927044\n05/15/2014 12:00:00 AM,187.4,187.9646726461803\n05/16/2014 12:00:00 AM,188.05,187.6564484307869\n05/19/2014 12:00:00 AM,188.74,188.46429895385796\n05/20/2014 12:00:00 AM,187.55,187.99286596923866\n05/21/2014 12:00:00 AM,189.13,188.5019106461591\n05/22/2014 12:00:00 AM,189.59,189.5446070974394\n05/23/2014 12:00:00 AM,190.35,190.2197380649596\n05/27/2014 12:00:00 AM,191.52,191.29649204330644\n05/28/2014 12:00:00 AM,191.38,191.66766136220429\n05/29/2014 12:00:00 AM,192.37,192.18510757480288\n05/30/2014 12:00:00 AM,192.68,192.7834050498686\n06/02/2014 12:00:00 AM,192.9,192.9989366999124\n06/03/2014 12:00:00 AM,192.8,192.9726244666083\n06/04/2014 12:00:00 AM,193.19,193.14174964440554\n06/05/2014 12:00:00 AM,194.45,194.12783309627036\n06/06/2014 12:00:00 AM,195.38,195.27522206418024\n06/09/2014 12:00:00 AM,195.58,195.7534813761202\n06/10/2014 12:00:00 AM,195.6,195.7756542507468\n06/11/2014 12:00:00 AM,194.92,195.27043616716452\n06/12/2014 12:00:00 AM,193.54,194.00695744477636\n06/13/2014 12:00:00 AM,194.13,193.78463829651758\n06/16/2014 12:00:00 AM,194.29,194.2030921976784\n06/17/2014 12:00:00 AM,194.83,194.6453947984523\n06/18/2014 12:00:00 AM,196.26,195.8402631989682\n06/19/2014 12:00:00 AM,196.48,196.60350879931212\n06/20/2014 12:00:00 AM,195.94,196.27567253287475\n06/23/2014 12:00:00 AM,195.88,195.9437816885832\n06/24/2014 12:00:00 AM,194.7,195.11585445905547\n06/25/2014 12:00:00 AM,195.58,195.17056963937034\n06/26/2014 12:00:00 AM,195.44,195.50704642624692\n06/27/2014 12:00:00 AM,195.82,195.69136428416462\n06/30/2014 12:00:00 AM,195.72,195.79424285610975\n07/01/2014 12:00:00 AM,197.03,196.60949523740652\n07/02/2014 12:00:00 AM,197.23,197.31966349160433\n07/03/2014 12:00:00 AM,198.2,198.00310899440288\n07/07/2014 12:00:00 AM,197.51,197.93207266293524\n07/08/2014 12:00:00 AM,196.24,196.71471510862352\n07/09/2014 12:00:00 AM,197.12,196.71981007241573\n07/10/2014 12:00:00 AM,196.34,196.62654004827715\n07/11/2014 12:00:00 AM,196.61,196.45102669885145\n07/14/2014 12:00:00 AM,197.6,197.2540177992343\n07/15/2014 12:00:00 AM,197.23,197.4526785328229\n07/16/2014 12:00:00 AM,197.96,197.7417856885486\n07/17/2014 12:00:00 AM,195.71,196.55785712569906\n07/18/2014 12:00:00 AM,197.71,196.8585714171327\n07/21/2014 12:00:00 AM,197.34,197.56238094475515\n07/22/2014 12:00:00 AM,198.2,197.9382539631701\n07/23/2014 12:00:00 AM,198.64,198.6055026421134\n07/24/2014 12:00:00 AM,198.65,198.7703350947423\n07/25/2014 12:00:00 AM,197.72,198.11355672982822\n07/28/2014 12:00:00 AM,197.8,197.72570448655216\n07/29/2014 12:00:00 AM,196.95,197.21046965770145\n07/30/2014 12:00:00 AM,196.98,196.8603131051343\n07/31/2014 12:00:00 AM,193.09,194.3168754034229\n08/01/2014 12:00:00 AM,192.5,192.21791693561528\n08/04/2014 12:00:00 AM,193.89,193.04194462374352\n08/05/2014 12:00:00 AM,192.01,192.53462974916238\n08/06/2014 12:00:00 AM,192.07,191.7730864994416\n08/07/2014 12:00:00 AM,191.03,191.1987243329611\n08/08/2014 12:00:00 AM,193.24,192.26914955530742\n08/11/2014 12:00:00 AM,193.79,193.6960997035383\n08/12/2014 12:00:00 AM,193.53,193.73739980235888\n08/13/2014 12:00:00 AM,194.84,194.4549332015726\n08/14/2014 12:00:00 AM,195.76,195.63328880104842\n08/15/2014 12:00:00 AM,195.72,195.95552586736562\n08/18/2014 12:00:00 AM,197.36,196.95701724491045\n08/19/2014 12:00:00 AM,198.39,198.32467816327363\n08/20/2014 12:00:00 AM,198.92,199.04311877551575\n08/21/2014 12:00:00 AM,199.5,199.56541251701051\n08/22/2014 12:00:00 AM,199.19,199.53027501134034\n08/25/2014 12:00:00 AM,200.2,199.98685000756024\n08/26/2014 12:00:00 AM,200.33,200.4812333383735\n08/27/2014 12:00:00 AM,200.25,200.42082222558236\n08/28/2014 12:00:00 AM,200.14,200.26388148372158\n08/29/2014 12:00:00 AM,200.71,200.56592098914774\n09/02/2014 12:00:00 AM,200.61,200.73728065943186\n09/03/2014 12:00:00 AM,200.5,200.5881871062879\n09/04/2014 12:00:00 AM,200.21,200.32879140419195\n09/05/2014 12:00:00 AM,201.11,200.79252760279465\n09/08/2014 12:00:00 AM,200.59,200.85168506852978\n09/09/2014 12:00:00 AM,199.32,199.7444567123532\n09/10/2014 12:00:00 AM,200.07,199.67963780823547\n09/11/2014 12:00:00 AM,200.3,200.213091872157\n09/12/2014 12:00:00 AM,199.13,199.53872791477136\n09/15/2014 12:00:00 AM,198.98,198.91248527651425\n09/16/2014 12:00:00 AM,200.48,199.88499018434283\n09/17/2014 12:00:00 AM,200.75,200.7633267895619\n09/18/2014 12:00:00 AM,201.82,201.56221785970794\n09/19/2014 12:00:00 AM,200.7,201.25814523980532\n09/22/2014 12:00:00 AM,199.15,199.66543015987023\n09/23/2014 12:00:00 AM,198.01,198.21695343991348\n09/24/2014 12:00:00 AM,199.56,198.80130229327568\n09/25/2014 12:00:00 AM,196.34,197.42420152885046\n09/26/2014 12:00:00 AM,197.9,197.02946768590033\n09/29/2014 12:00:00 AM,197.54,197.59964512393356\n09/30/2014 12:00:00 AM,197.02,197.11309674928904\n10/01/2014 12:00:00 AM,194.35,195.12873116619272\n10/02/2014 12:00:00 AM,194.38,193.99915411079516\n10/03/2014 12:00:00 AM,196.52,195.5627694071968\n10/06/2014 12:00:00 AM,196.29,196.44184627146456\n10/07/2014 12:00:00 AM,193.26,194.29456418097638\n10/08/2014 12:00:00 AM,196.64,195.1930427873176\n10/09/2014 12:00:00 AM,192.74,194.20202852487841\n10/10/2014 12:00:00 AM,190.54,190.94801901658562\n10/13/2014 12:00:00 AM,187.41,187.99201267772375\n10/14/2014 12:00:00 AM,187.7,186.94800845181584\n10/15/2014 12:00:00 AM,186.43,186.44867230121056\n10/16/2014 12:00:00 AM,186.27,185.91244820080706\n10/17/2014 12:00:00 AM,188.47,187.44496546720472\n10/20/2014 12:00:00 AM,190.3,189.7399769781365\n10/21/2014 12:00:00 AM,194.07,193.04998465209098\n10/22/2014 12:00:00 AM,192.69,193.72665643472732\n10/23/2014 12:00:00 AM,194.93,194.41443762315157\n10/24/2014 12:00:00 AM,196.43,196.3329584154344\n10/27/2014 12:00:00 AM,196.16,196.68530561028962\n10/28/2014 12:00:00 AM,198.41,197.92020374019307\n10/29/2014 12:00:00 AM,198.11,198.63346916012873\n10/30/2014 12:00:00 AM,199.38,199.2056461067525\n10/31/2014 12:00:00 AM,201.66,201.20709740450167\n11/03/2014 12:00:00 AM,201.77,202.19139826966781\n11/04/2014 12:00:00 AM,201.07,201.62093217977855\n11/05/2014 12:00:00 AM,202.34,202.0506214531857\n11/06/2014 12:00:00 AM,203.15,203.11041430212381\n11/07/2014 12:00:00 AM,203.34,203.52027620141587\n11/10/2014 12:00:00 AM,203.98,203.95018413427724\n11/11/2014 12:00:00 AM,204.18,204.30678942285152\n11/12/2014 12:00:00 AM,203.96,204.18452628190101\n11/13/2014 12:00:00 AM,204.19,204.18968418793403\n11/14/2014 12:00:00 AM,204.24,204.29978945862268\n11/17/2014 12:00:00 AM,204.37,204.38319297241515\n11/18/2014 12:00:00 AM,205.55,205.20879531494347\n11/19/2014 12:00:00 AM,205.22,205.49586354329566\n11/20/2014 12:00:00 AM,205.58,205.53390902886377\n11/21/2014 12:00:00 AM,206.68,206.40260601924254\n11/24/2014 12:00:00 AM,207.26,207.24840401282836\n11/25/2014 12:00:00 AM,207.11,207.34560267521894\n11/26/2014 12:00:00 AM,207.64,207.57040178347933\n11/28/2014 12:00:00 AM,207.2,207.47693452231954\n12/01/2014 12:00:00 AM,205.76,206.27795634821302\n12/02/2014 12:00:00 AM,207.09,206.5119708988087\n12/03/2014 12:00:00 AM,207.89,207.68131393253915\n12/04/2014 12:00:00 AM,207.66,207.86420928835946\n12/05/2014 12:00:00 AM,208.0,207.946139525573\n12/08/2014 12:00:00 AM,206.61,207.15075968371536\n12/09/2014 12:00:00 AM,206.47,206.4138397891436\n12/10/2014 12:00:00 AM,203.16,204.17922652609573\n12/11/2014 12:00:00 AM,204.19,203.42281768406383\n12/12/2014 12:00:00 AM,200.89,201.82187845604255\n12/15/2014 12:00:00 AM,199.51,199.4912523040284\n12/16/2014 12:00:00 AM,197.91,197.97083486935227\n12/17/2014 12:00:00 AM,201.79,200.0038899129015\n12/18/2014 12:00:00 AM,206.78,205.21925994193435\n12/19/2014 12:00:00 AM,206.52,207.22950662795625\n12/22/2014 12:00:00 AM,207.47,207.53967108530418\n12/23/2014 12:00:00 AM,207.75,208.01978072353614\n12/24/2014 12:00:00 AM,207.77,208.03652048235745\n12/26/2014 12:00:00 AM,208.44,208.401013654905\n12/29/2014 12:00:00 AM,208.72,208.82400910327001\n12/30/2014 12:00:00 AM,207.6,208.13600606884668\n12/31/2014 12:00:00 AM,205.54,206.21067071256445\n01/02/2015 12:00:00 AM,205.43,205.22711380837632\n01/05/2015 12:00:00 AM,201.72,202.78474253891756\n01/06/2015 12:00:00 AM,199.82,199.92649502594503\n01/07/2015 12:00:00 AM,202.31,200.91766335063002\n01/08/2015 12:00:00 AM,205.9,204.60510890042002\n01/09/2015 12:00:00 AM,204.25,205.13340593361335\n01/12/2015 12:00:00 AM,202.65,203.22227062240893\n01/13/2015 12:00:00 AM,202.08,202.11818041493933\n01/14/2015 12:00:00 AM,200.86,201.10212027662624\n01/15/2015 12:00:00 AM,199.02,199.3880801844175\n01/16/2015 12:00:00 AM,201.63,200.39205345627835\n01/20/2015 12:00:00 AM,202.05,201.95470230418556\n01/21/2015 12:00:00 AM,203.08,202.81313486945706\n01/22/2015 12:00:00 AM,206.1,205.25875657963803\n01/23/2015 12:00:00 AM,204.97,205.79250438642535\n01/26/2015 12:00:00 AM,205.45,205.46166959095024\n01/27/2015 12:00:00 AM,202.74,203.81111306063352\n01/28/2015 12:00:00 AM,200.14,200.81740870708902\n01/29/2015 12:00:00 AM,201.99,200.95827247139272\n01/30/2015 12:00:00 AM,199.45,200.2255149809285\n02/02/2015 12:00:00 AM,201.92,200.7670099872857\n02/03/2015 12:00:00 AM,204.84,203.92133999152384\n02/04/2015 12:00:00 AM,204.06,204.68089332768255\n02/05/2015 12:00:00 AM,206.12,205.58726221845504\n02/06/2015 12:00:00 AM,205.55,206.0715081456367\n02/09/2015 12:00:00 AM,204.63,205.09433876375783\n02/10/2015 12:00:00 AM,206.81,206.08622584250523\n02/11/2015 12:00:00 AM,206.93,207.13415056167017\n02/12/2015 12:00:00 AM,208.92,208.43276704111344\n02/13/2015 12:00:00 AM,209.78,209.83184469407564\n02/17/2015 12:00:00 AM,210.11,210.32122979605046\n"
  },
  {
    "path": "Tests/TestData/spy_zigzag.csv",
    "content": "date,open,high,low,close,volume,zigzag,type\n19980102 00:00,973100,975300,965300,973600,2150000,,\n19980105 00:00,978400,984400,967800,977500,4030800,,\n19980106 00:00,972500,972800,961900,966300,2821800,,\n19980107 00:00,960900,965000,952200,964700,5225400,,\n19980108 00:00,963100,963100,955000,957800,3249100,,\n19980109 00:00,952500,955000,919100,924700,10000200,,\n19980112 00:00,911300,941900,909100,940600,11953200,909100,Low\n19980113 00:00,946300,956300,942200,952200,5006400,,\n19980114 00:00,956900,959700,947200,958100,3738000,,\n19980115 00:00,955000,957500,948100,949400,2726400,,\n19980116 00:00,962500,966900,956600,962300,4185400,,\n19980120 00:00,966900,980000,965000,980000,4373400,,\n19980121 00:00,972200,976900,961600,971600,4526300,,\n19980122 00:00,961600,968800,958800,963000,4484300,,\n19980123 00:00,965000,967800,950000,956600,6231300,,\n19980126 00:00,963800,967300,937500,957500,4280800,,\n19980127 00:00,958100,980000,956600,970000,6639000,,\n19980128 00:00,974100,981100,971700,978800,4089900,,\n19980129 00:00,978400,995600,975600,987500,7706300,,\n19980130 00:00,987800,989700,980000,983100,3333000,,\n19980202 00:00,999100,1005000,997500,1002500,5587200,,\n19980203 00:00,1000000,1008100,997200,1006900,2656800,,\n19980204 00:00,1002800,1011600,998800,1005900,3283800,,\n19980205 00:00,1013100,1015900,1000300,1003800,4970800,,\n19980206 00:00,1010000,1015000,1006900,1012800,5531800,,\n19980209 00:00,1017200,1017500,1007200,1011400,2277100,,\n19980210 00:00,1014400,1024700,1011900,1020500,3624500,,\n19980211 00:00,1020900,1031900,1017000,1021300,4020500,,\n19980212 00:00,1017200,1029400,1008800,1026600,5102800,,\n19980213 00:00,1021900,1029400,1018800,1021600,1889500,,\n19980217 00:00,1028100,1030900,1021600,1023400,2945300,,\n19980218 00:00,1023100,1034700,1022800,1034100,2919600,,\n19980219 00:00,1032500,1034100,1027500,1030000,3330600,,\n19980220 00:00,1030800,1037500,1023800,1035600,3594700,,\n19980223 00:00,1042500,1042500,1033400,1040000,3131700,,\n19980224 00:00,1039100,1040900,1029400,1031900,3241700,,\n19980225 00:00,1037500,1048800,1036300,1044800,3348400,,\n19980226 00:00,1044400,1051600,1041900,1050600,3604100,,\n19980227 00:00,1049700,1055300,1043100,1052000,3335400,,\n19980302 00:00,1052500,1057500,1046300,1048100,4126000,,\n19980303 00:00,1045300,1054700,1045000,1054100,3177500,,\n19980304 00:00,1050900,1054100,1040600,1049700,4395900,,\n19980305 00:00,1035000,1044400,1031600,1037500,7153500,,\n19980306 00:00,1045600,1058800,1044400,1057500,6702600,,\n19980309 00:00,1055300,1062200,1052500,1054400,3282800,,\n19980310 00:00,1062200,1068400,1053800,1066600,5582900,,\n19980311 00:00,1069700,1073100,1067300,1072500,3426500,,\n19980312 00:00,1070900,1075900,1065000,1072500,3057400,,\n19980313 00:00,1078400,1080000,1068800,1072200,2743800,,\n19980316 00:00,1078400,1082800,1075300,1082500,3073800,,\n19980317 00:00,1083100,1085000,1076600,1084700,4577900,,\n19980318 00:00,1082500,1089400,1080000,1087800,1820900,,\n19980319 00:00,1089700,1093800,1086600,1093400,2450000,,\n19980320 00:00,1095600,1101900,1088800,1100000,2828600,,\n19980323 00:00,1097200,1103100,1094100,1095000,4383400,,\n19980324 00:00,1100600,1108100,1099400,1105900,3293800,,\n19980325 00:00,1114100,1115300,1091900,1101900,4484900,,\n19980326 00:00,1098800,1107500,1096300,1101300,3319600,,\n19980327 00:00,1107500,1107800,1090000,1095300,2512200,,\n19980330 00:00,1096300,1100900,1089700,1093400,2776500,,\n19980331 00:00,1101600,1111900,1097500,1100900,5726500,,\n19980401 00:00,1103100,1110800,1094100,1109800,2828500,,\n19980402 00:00,1109400,1122500,1107500,1120300,3947500,,\n19980403 00:00,1123400,1128100,1118400,1121900,3726100,,\n19980406 00:00,1132500,1133800,1120600,1122500,4029500,,\n19980407 00:00,1117500,1119400,1101600,1110000,5200100,,\n19980408 00:00,1112200,1112800,1097500,1101300,4762900,,\n19980409 00:00,1105600,1112800,1105300,1110000,4367800,,\n19980413 00:00,1113800,1113800,1100000,1110000,4216000,,\n19980414 00:00,1111300,1117200,1109100,1116900,3219500,,\n19980415 00:00,1119700,1121300,1111600,1120200,3811700,,\n19980416 00:00,1113100,1115000,1105000,1109100,7242500,,\n19980417 00:00,1107200,1124100,1104400,1122200,5414800,,\n19980420 00:00,1120000,1125600,1118800,1124100,3606300,,\n19980421 00:00,1124400,1131600,1119100,1126300,4573300,,\n19980422 00:00,1128800,1134400,1128100,1130000,2288400,1134400,High\n19980423 00:00,1126300,1130000,1117500,1120900,4848500,,\n19980424 00:00,1117500,1124700,1103400,1108800,11129100,,\n19980427 00:00,1093800,1106600,1076300,1085900,14372900,,\n19980428 00:00,1097800,1098100,1081300,1086300,6213200,,\n19980429 00:00,1090300,1099700,1084400,1095300,7582100,,\n19980430 00:00,1105600,1119200,1104100,1114400,8226200,,\n19980501 00:00,1117500,1123100,1113100,1121900,3768600,,\n19980504 00:00,1127200,1133100,1121600,1122500,4332900,,\n19980505 00:00,1120000,1121600,1111300,1116600,4969800,,\n19980506 00:00,1121300,1121300,1104700,1105000,5221600,,\n19980507 00:00,1105000,1105600,1094100,1095900,6769900,,\n19980508 00:00,1100000,1113800,1100000,1110000,7888200,,\n19980511 00:00,1115600,1122200,1103800,1108600,6219300,,\n19980512 00:00,1108100,1118800,1102500,1116400,5983800,,\n19980513 00:00,1120600,1125600,1115900,1120600,4355500,,\n19980514 00:00,1115300,1126900,1113400,1119700,4229300,,\n19980515 00:00,1120000,1122200,1108100,1110000,6807000,,\n19980518 00:00,1107200,1115900,1098300,1108400,4751100,,\n19980519 00:00,1110000,1116900,1107800,1110600,5877900,,\n19980520 00:00,1120900,1125000,1108800,1122800,5775400,,\n19980521 00:00,1123800,1127800,1113100,1116900,6427100,,\n19980522 00:00,1117500,1120600,1109400,1111600,4659700,,\n19980526 00:00,1120900,1120900,1094400,1095300,6262300,,\n19980527 00:00,1093100,1099100,1075800,1096300,10286000,1075800,Low\n19980528 00:00,1098800,1103800,1087300,1100000,4778900,,\n19980529 00:00,1106300,1108100,1093800,1093800,4583900,,\n19980601 00:00,1089700,1102200,1085600,1095000,5829200,,\n19980602 00:00,1100000,1103400,1091600,1095900,6477900,,\n19980603 00:00,1098800,1101900,1082200,1085000,6262700,,\n19980604 00:00,1082500,1100600,1080600,1099100,6317300,,\n19980605 00:00,1103800,1118800,1098800,1118100,8140300,,\n19980608 00:00,1119400,1124700,1116600,1118800,4056700,,\n19980609 00:00,1117200,1124200,1114100,1122800,2680400,,\n19980610 00:00,1116300,1130600,1112500,1113800,6336300,,\n19980611 00:00,1114400,1118800,1092800,1096600,7897100,,\n19980612 00:00,1098800,1104400,1082500,1102500,9700700,,\n19980615 00:00,1088100,1099100,1078800,1080000,9754800,,\n19980616 00:00,1084100,1091600,1077500,1090600,7245000,,\n19980617 00:00,1101600,1117800,1099400,1112500,11964800,,\n19980618 00:00,1111900,1114400,1107500,1111600,3749600,,\n19980619 00:00,1110600,1112300,1096300,1100300,3538200,,\n19980622 00:00,1102500,1110600,1100600,1103800,5357100,,\n19980623 00:00,1110900,1121900,1110000,1119700,5205600,,\n19980624 00:00,1121600,1136900,1116100,1134700,8222700,,\n19980625 00:00,1139100,1144700,1128100,1130000,5837700,,\n19980626 00:00,1133100,1138400,1131300,1134100,4753900,,\n19980629 00:00,1142500,1146900,1138000,1138900,6537200,,\n19980630 00:00,1139100,1141900,1130600,1133600,4126100,,\n19980701 00:00,1140600,1149400,1136300,1149400,3241200,,\n19980702 00:00,1147200,1148800,1142500,1146300,3432900,,\n19980706 00:00,1147800,1158400,1145600,1157800,3042100,,\n19980707 00:00,1159800,1161300,1152800,1155600,4847300,,\n19980708 00:00,1158800,1169400,1157500,1168100,6773100,,\n19980709 00:00,1162800,1167200,1156300,1160000,7258600,,\n19980710 00:00,1160300,1169100,1150600,1165300,7739800,,\n19980713 00:00,1165600,1168400,1160600,1167500,6846100,,\n19980714 00:00,1169400,1181600,1169400,1178100,7119900,,\n19980715 00:00,1180600,1182800,1174400,1175600,4908000,,\n19980716 00:00,1176900,1185900,1170600,1184400,6239600,,\n19980717 00:00,1186300,1190000,1183100,1187500,3478600,,\n19980720 00:00,1187500,1192300,1179400,1185000,2238300,,\n19980721 00:00,1190000,1190000,1162800,1165300,5107200,,\n19980722 00:00,1163400,1195900,1155300,1166300,10611500,1195900,High\n19980723 00:00,1163100,1168400,1138800,1141900,14881000,,\n19980724 00:00,1149700,1150900,1128800,1141600,11706000,,\n19980727 00:00,1136300,1150000,1128400,1149800,9360300,,\n19980728 00:00,1144400,1146600,1118800,1133100,13422500,,\n19980729 00:00,1137200,1141300,1122500,1126600,6932100,,\n19980730 00:00,1136300,1145900,1134100,1143400,6617400,,\n19980731 00:00,1143400,1145000,1113100,1120600,7679600,,\n19980803 00:00,1117800,1124200,1110300,1113800,10349100,,\n19980804 00:00,1122200,1122200,1072500,1076100,14468800,,\n19980805 00:00,1079400,1088800,1055900,1081600,21457200,,\n19980806 00:00,1081300,1095200,1075600,1090900,13163000,,\n19980807 00:00,1096900,1105900,1084700,1090300,11718400,,\n19980810 00:00,1087500,1096600,1081900,1085900,6055400,,\n19980811 00:00,1067800,1074400,1055000,1070600,14385600,,\n19980812 00:00,1077500,1088100,1075000,1085000,10997500,,\n19980813 00:00,1088100,1096600,1076300,1076400,8529600,,\n19980814 00:00,1083400,1087200,1057800,1064800,7995800,,\n19980817 00:00,1060000,1089400,1055000,1085000,11035000,,\n19980818 00:00,1090000,1105900,1087800,1102500,7245000,,\n19980819 00:00,1110900,1110900,1096300,1100000,6054300,,\n19980820 00:00,1096900,1104100,1091600,1092500,7590600,,\n19980821 00:00,1081900,1087200,1055000,1083800,16427600,,\n19980824 00:00,1092500,1099400,1083100,1090600,7902200,,\n19980825 00:00,1103800,1112500,1086400,1095000,9623400,,\n19980826 00:00,1082800,1096300,1077500,1085000,9090300,,\n19980827 00:00,1070000,1078400,1038900,1042500,24042400,,\n19980828 00:00,1049700,1057200,1021600,1030000,23196400,,\n19980831 00:00,1037500,1040200,950000,962500,22799800,,\n19980901 00:00,960600,1005600,936300,996900,24391500,936300,Low\n19980902 00:00,998100,1017500,987800,990000,13984400,,\n19980903 00:00,976300,993800,966900,985200,16873300,,\n19980904 00:00,994400,998100,957800,976300,16414800,,\n19980908 00:00,1008800,1029700,998100,1025900,14307900,,\n19980909 00:00,1027500,1031300,1004800,1007500,12026000,,\n19980910 00:00,984400,993400,968100,982500,19666100,,\n19980911 00:00,981900,1015000,970000,1012500,20203300,,\n19980914 00:00,1028800,1044500,1020900,1031600,10318300,,\n19980915 00:00,1028800,1043100,1022800,1042000,8166200,,\n19980916 00:00,1047500,1052500,1031600,1050000,11125300,,\n19980917 00:00,1022500,1030300,1017800,1022300,12549700,,\n19980918 00:00,1023800,1024100,1010900,1019700,6667900,,\n19980921 00:00,996300,1034100,989400,1021900,8552400,,\n19980922 00:00,1035000,1036600,1021600,1030000,7070200,,\n19980923 00:00,1038800,1070000,1037800,1066300,12804500,1070000,High\n19980924 00:00,1063100,1068100,1032500,1043800,10809300,,\n19980925 00:00,1031300,1054200,1026300,1043000,10051500,,\n19980928 00:00,1053100,1063100,1042500,1049100,8368600,,\n19980929 00:00,1053800,1059400,1033800,1049400,10488400,,\n19980930 00:00,1035000,1043100,1013800,1018400,7537300,,\n19981001 00:00,1000300,1015500,980900,986300,12833400,,\n19981002 00:00,988800,1008800,972200,1003100,14014100,,\n19981005 00:00,995900,1000000,963400,990000,12408900,,\n19981006 00:00,1007500,1012800,975300,985300,12216900,,\n19981007 00:00,986300,1000300,957500,972200,13942400,,\n19981008 00:00,945600,967500,922200,962200,20019400,922200,Low\n19981009 00:00,970000,995600,940600,986300,11865900,,\n19981012 00:00,1006300,1014400,996900,997800,9127600,,\n19981013 00:00,995600,1004100,987500,995300,5916200,,\n19981014 00:00,989400,1018100,988400,1005000,8056200,,\n19981015 00:00,1001300,1072500,999400,1050300,19735400,,\n19981016 00:00,1061300,1067500,1050000,1056600,16305900,,\n19981019 00:00,1056900,1068100,1055000,1063400,7627400,,\n19981020 00:00,1075600,1088000,1060900,1065000,14236900,,\n19981021 00:00,1068800,1076300,1058800,1071300,8997900,,\n19981022 00:00,1067800,1084700,1061600,1080000,8012900,,\n19981023 00:00,1079700,1080000,1067800,1071300,6188800,,\n19981026 00:00,1077200,1085600,1067800,1075500,5654900,,\n19981027 00:00,1084400,1089700,1062800,1066300,9865800,,\n19981028 00:00,1065600,1078100,1060300,1067800,5499700,,\n19981029 00:00,1070900,1089700,1066300,1089700,8847200,,\n19981030 00:00,1101300,1109100,1095000,1100000,9498800,,\n19981102 00:00,1108100,1117500,1101900,1114800,6351000,,\n19981103 00:00,1115900,1118100,1107500,1111300,6573900,,\n19981104 00:00,1124700,1130900,1110900,1118400,7788100,,\n19981105 00:00,1115300,1138100,1111300,1137300,6686200,,\n19981106 00:00,1134700,1145000,1133100,1142800,5136100,,\n19981109 00:00,1139400,1142500,1125000,1131400,5908800,,\n19981110 00:00,1130000,1139400,1125000,1126900,9142100,,\n19981111 00:00,1138100,1140600,1118900,1123800,10735000,,\n19981112 00:00,1123100,1131300,1116900,1120300,5396300,,\n19981113 00:00,1122200,1130600,1121300,1127700,5531900,,\n19981116 00:00,1142200,1143600,1128900,1138400,5934200,,\n19981117 00:00,1136600,1156300,1130000,1143400,8944500,,\n19981118 00:00,1143100,1149400,1135000,1147500,4538000,,\n19981119 00:00,1152800,1159100,1146300,1155000,5115600,,\n19981120 00:00,1163600,1167500,1158400,1166300,5351500,,\n19981123 00:00,1174700,1192200,1171600,1191600,6442400,,\n19981124 00:00,1190000,1196600,1184500,1186900,5121600,,\n19981125 00:00,1189400,1191900,1181600,1188800,4268500,,\n19981127 00:00,1194700,1197200,1190000,1195000,4562000,,\n19981130 00:00,1190200,1193800,1166600,1166900,7991700,,\n19981201 00:00,1161300,1180300,1152200,1178100,8773600,,\n19981202 00:00,1172200,1179100,1160000,1175000,7322100,,\n19981203 00:00,1172500,1183100,1151900,1152800,11737800,,\n19981204 00:00,1166300,1188800,1155900,1179700,10616800,,\n19981207 00:00,1180600,1195300,1180000,1192500,4105700,,\n19981208 00:00,1185300,1197500,1175000,1184700,9996400,,\n19981209 00:00,1186900,1189700,1178800,1188100,5259600,,\n19981210 00:00,1188400,1188400,1167200,1168100,5844400,,\n19981211 00:00,1164400,1173400,1155600,1170600,8669100,,\n19981214 00:00,1161600,1164100,1139100,1144700,9276400,,\n19981215 00:00,1146900,1167500,1145300,1166300,9482100,,\n19981216 00:00,1171300,1171300,1157500,1164100,7183500,,\n19981217 00:00,1172200,1185600,1170200,1185000,6720200,,\n19981218 00:00,1183100,1191300,1178800,1190200,4027900,,\n19981221 00:00,1192500,1213400,1190000,1203100,8465700,,\n19981222 00:00,1204100,1212200,1191900,1205300,5581100,,\n19981223 00:00,1211900,1231900,1208100,1228100,7558200,,\n19981224 00:00,1231600,1238800,1222800,1226900,1557500,,\n19981228 00:00,1232500,1233100,1220000,1226300,4031000,,\n19981229 00:00,1227200,1244400,1221300,1243100,3747300,,\n19981230 00:00,1239400,1247500,1230300,1233800,6962800,,\n19981231 00:00,1233100,1239400,1224700,1228800,6480500,,\n19990104 00:00,1233800,1252200,1217200,1228800,9480700,,\n19990105 00:00,1229400,1248800,1229400,1244400,7840800,,\n19990106 00:00,1258100,1276300,1257500,1275000,7648500,,\n19990107 00:00,1263800,1272200,1257800,1269400,5364300,,\n19990108 00:00,1281900,1285000,1259700,1275000,6076900,1285000,High\n19990111 00:00,1276900,1276900,1252200,1262800,7455600,,\n19990112 00:00,1262200,1262200,1238100,1240000,7434300,,\n19990113 00:00,1204100,1251300,1203800,1233100,10563100,,\n19990114 00:00,1236300,1239100,1209100,1211600,11370000,,\n19990115 00:00,1223800,1247800,1220300,1243100,7757900,,\n19990119 00:00,1253000,1274700,1235000,1252800,6270400,,\n19990120 00:00,1260900,1279400,1250300,1256300,6222800,,\n19990121 00:00,1255800,1258400,1232200,1235900,6408000,,\n19990122 00:00,1221300,1238400,1217800,1225600,7249900,,\n19990125 00:00,1232800,1240000,1219100,1236300,5008100,,\n19990126 00:00,1241300,1257200,1236300,1255000,5893300,,\n19990127 00:00,1263800,1266300,1244100,1244700,7089500,,\n19990128 00:00,1252500,1269700,1251900,1266600,5763500,,\n19990129 00:00,1273400,1283000,1254100,1278800,5990400,,\n19990201 00:00,1286900,1286900,1270000,1270900,9098500,,\n19990202 00:00,1270800,1272200,1247700,1262800,9197400,,\n19990203 00:00,1256900,1279400,1256600,1271900,10155700,,\n19990204 00:00,1273800,1275000,1248100,1248400,6727600,,\n19990205 00:00,1256600,1256600,1232200,1240000,7444000,,\n19990208 00:00,1250900,1250900,1233400,1243800,8364900,,\n19990209 00:00,1243800,1245000,1215600,1218600,8502300,,\n19990210 00:00,1221300,1230000,1213300,1226900,6492100,,\n19990211 00:00,1230600,1256900,1225000,1256900,8880800,,\n19990212 00:00,1248100,1255000,1226300,1235000,10496300,,\n19990216 00:00,1247500,1256300,1233800,1243800,6590400,,\n19990217 00:00,1231900,1253600,1222500,1227500,7447000,,\n19990218 00:00,1231900,1243800,1222200,1239400,8844800,,\n19990219 00:00,1240000,1257500,1233800,1239400,5219200,,\n19990222 00:00,1244400,1277200,1242800,1276900,10212200,,\n19990223 00:00,1275900,1285000,1265900,1275000,7631500,,\n19990224 00:00,1278400,1288400,1254100,1254100,6777300,,\n19990225 00:00,1245300,1252800,1225900,1247500,11219400,,\n19990226 00:00,1247500,1248400,1228100,1239100,9233600,,\n19990301 00:00,1236600,1243100,1208800,1237800,7594300,1208800,Low\n19990302 00:00,1245000,1253100,1223100,1228100,9311200,,\n19990303 00:00,1230900,1235600,1217800,1231300,7558900,,\n19990304 00:00,1240600,1252300,1232700,1250000,7787300,,\n19990305 00:00,1275000,1281300,1259200,1278100,10091200,,\n19990308 00:00,1282800,1288000,1272500,1285200,4553000,,\n19990309 00:00,1281300,1299400,1274400,1282500,7703600,,\n19990310 00:00,1284700,1292200,1277800,1290300,3748200,,\n19990311 00:00,1296900,1311900,1288800,1302200,6543200,,\n19990312 00:00,1310000,1310300,1292200,1295300,4963300,,\n19990315 00:00,1299400,1311900,1295000,1311600,5257400,,\n19990316 00:00,1311300,1316600,1304700,1309800,4422900,,\n19990317 00:00,1306900,1309400,1296300,1302500,4380300,,\n19990318 00:00,1297800,1323400,1297500,1321600,3537400,,\n19990319 00:00,1323100,1326300,1298400,1300600,5265200,,\n19990322 00:00,1300600,1305900,1294200,1299100,4422000,,\n19990323 00:00,1293100,1296300,1257000,1264100,9302400,,\n19990324 00:00,1268400,1271600,1256300,1269400,5950500,,\n19990325 00:00,1280600,1292500,1277500,1291300,6432000,,\n19990326 00:00,1286300,1291300,1277200,1284700,5881500,,\n19990329 00:00,1291600,1314400,1291600,1312200,5395500,,\n19990330 00:00,1299400,1312200,1295600,1303400,5090200,,\n19990331 00:00,1311600,1316100,1284400,1286300,7029600,,\n19990401 00:00,1296900,1296900,1281300,1293800,7473900,,\n19990405 00:00,1309400,1323800,1302500,1323800,5533700,,\n19990406 00:00,1321900,1329800,1311600,1319400,5022000,,\n19990407 00:00,1326900,1333800,1313800,1328800,6056300,,\n19990408 00:00,1331900,1347800,1322800,1345300,5645500,,\n19990409 00:00,1344400,1356900,1335900,1348800,4132000,,\n19990412 00:00,1334700,1362500,1332200,1360600,7944600,,\n19990413 00:00,1362500,1364700,1340300,1351900,10581100,,\n19990414 00:00,1360600,1360600,1326900,1330300,11566600,,\n19990415 00:00,1334400,1335600,1310000,1326300,11010600,,\n19990416 00:00,1329100,1329100,1311900,1321300,6139800,,\n19990419 00:00,1326900,1345300,1283800,1289100,12557100,,\n19990420 00:00,1298100,1310300,1288800,1306300,8576400,,\n19990421 00:00,1310600,1337800,1257800,1336900,5330700,,\n19990422 00:00,1351300,1362500,1343900,1359700,6576600,,\n19990423 00:00,1358800,1367500,1350000,1357500,4218900,,\n19990426 00:00,1365000,1368100,1354700,1361300,3304000,,\n19990427 00:00,1371300,1375000,1358400,1365600,4907600,1375000,High\n19990428 00:00,1364400,1372500,1350000,1353400,5446900,,\n19990429 00:00,1355600,1360600,1338100,1345600,9593600,,\n19990430 00:00,1350900,1356300,1315000,1334700,10538700,,\n19990503 00:00,1334400,1357200,1330300,1356300,10658900,,\n19990504 00:00,1351300,1358100,1331300,1333100,10221800,,\n19990505 00:00,1339400,1350000,1318400,1349700,9747000,,\n19990506 00:00,1344400,1351300,1323800,1335000,13134000,,\n19990507 00:00,1345000,1349800,1334400,1346300,8344100,,\n19990510 00:00,1348400,1357200,1335300,1342200,5372100,,\n19990511 00:00,1353100,1368800,1257800,1357200,6679600,,\n19990512 00:00,1357500,1372200,1315000,1366300,15070800,,\n19990513 00:00,1372500,1380000,1368100,1370200,4174600,,\n19990514 00:00,1345600,1362500,1333100,1343000,8210400,,\n19990517 00:00,1336300,1344800,1323100,1343100,6277500,,\n19990518 00:00,1345300,1349800,1326300,1336300,8114700,,\n19990519 00:00,1344700,1348800,1332500,1348100,4273700,,\n19990520 00:00,1351300,1355900,1300600,1343100,4349700,,\n19990521 00:00,1341300,1346900,1195800,1334200,6117400,1195800,Low\n19990524 00:00,1338400,1338400,1303900,1310900,7687100,,\n19990525 00:00,1313800,1323400,1286900,1288400,9523800,,\n19990526 00:00,1293100,1310000,1280900,1306600,12776900,,\n19990527 00:00,1298400,1302800,1280000,1284400,13998900,,\n19990528 00:00,1290000,1307500,1285900,1305900,8348100,,\n19990601 00:00,1301300,1301600,1283800,1298800,6391500,,\n19990602 00:00,1297500,1301900,1206300,1297800,6812100,,\n19990603 00:00,1306900,1309100,1297800,1302800,5933500,,\n19990604 00:00,1314700,1331900,1309400,1319400,9507800,,\n19990607 00:00,1334400,1341900,1329100,1337500,5078600,,\n19990608 00:00,1333800,1338000,1315900,1321600,5000500,,\n19990609 00:00,1324100,1330900,1318100,1321600,7428700,,\n19990610 00:00,1314400,1315000,1295900,1309100,6785900,,\n19990611 00:00,1312200,1322200,1290900,1298100,12587100,,\n19990614 00:00,1306900,1307500,1295500,1297800,6542000,,\n19990615 00:00,1304700,1316600,1300800,1305900,5438900,,\n19990616 00:00,1323800,1338800,1321600,1334800,7562200,,\n19990617 00:00,1328800,1355600,1326300,1346600,8476400,,\n19990618 00:00,1340600,1346900,1333800,1343100,2601000,,\n19990621 00:00,1344700,1350000,1336600,1349400,4452000,,\n19990622 00:00,1340000,1351900,1333400,1337000,5603600,,\n19990623 00:00,1330000,1336300,1321300,1332800,9474700,,\n19990624 00:00,1328800,1338100,1306600,1316900,9029400,,\n19990625 00:00,1325900,1330200,1312500,1316600,3966300,,\n19990628 00:00,1326900,1336300,1324700,1333800,5175700,,\n19990629 00:00,1330000,1351300,1327800,1351300,6514400,,\n19990630 00:00,1346300,1375000,1338400,1367500,16362400,,\n19990701 00:00,1370000,1385000,1360600,1380600,9586200,,\n19990702 00:00,1381300,1393000,1379100,1391900,3637300,,\n19990706 00:00,1392500,1407500,1385900,1387200,10954800,,\n19990707 00:00,1390600,1397200,1385200,1395600,3052600,,\n19990708 00:00,1390600,1406300,1387500,1395600,7133500,,\n19990709 00:00,1400000,1404700,1393800,1402200,2770400,,\n19990712 00:00,1409400,1409400,1395000,1400600,4233900,,\n19990713 00:00,1393800,1399200,1386600,1395000,6359600,,\n19990714 00:00,1400000,1402200,1387500,1398400,4246900,,\n19990715 00:00,1407800,1488800,1403100,1411300,3236000,1488800,High\n19990716 00:00,1412500,1421600,1407500,1420000,2078000,,\n19990719 00:00,1421900,1422500,1405600,1410000,4029000,,\n19990720 00:00,1401300,1404100,1375300,1378000,6843600,,\n19990721 00:00,1380900,1389100,1370000,1378800,4599000,,\n19990722 00:00,1374400,1380000,1354700,1361400,7580400,,\n19990723 00:00,1366600,1370000,1351300,1357500,4432000,,\n19990726 00:00,1348800,1361300,1346300,1350000,4026700,,\n19990727 00:00,1360000,1372000,1353800,1365000,5722800,,\n19990728 00:00,1362500,1373100,1355900,1367300,3803200,,\n19990729 00:00,1349400,1352500,1333100,1343800,7638800,,\n19990730 00:00,1348100,1353400,1328800,1330900,5569700,,\n19990802 00:00,1327500,1347500,1325000,1329400,5783300,,\n19990803 00:00,1337200,1338400,1313800,1323600,5268700,,\n19990804 00:00,1327200,1338800,1305300,1306900,5986000,,\n19990805 00:00,1308800,1317200,1288400,1315600,9910600,,\n19990806 00:00,1312200,1320000,1295000,1300600,7129800,,\n19990809 00:00,1305900,1318000,1297200,1300500,5162600,,\n19990810 00:00,1298800,1301600,1270000,1282200,9971000,1270000,Low\n19990811 00:00,1296900,1305300,1286300,1305300,7796900,,\n19990812 00:00,1306900,1318100,1300000,1300200,6292100,,\n19990813 00:00,1316300,1332500,1311300,1331900,5609100,,\n19990816 00:00,1331300,1339700,1322500,1333800,3637600,,\n19990817 00:00,1344400,1351600,1331300,1347000,4708500,,\n19990818 00:00,1342000,1343800,1334100,1335600,4046500,,\n19990819 00:00,1323800,1332300,1316900,1328800,6345700,,\n19990820 00:00,1330600,1339100,1326900,1338800,3054700,,\n19990823 00:00,1348100,1364500,1346600,1363900,5284900,,\n19990824 00:00,1360600,1379700,1353800,1365000,9108100,,\n19990825 00:00,1371900,1387800,1279100,1384400,5894000,1387800,High\n19990826 00:00,1382800,1384200,1365000,1365000,4057900,,\n19990827 00:00,1368800,1370600,1351300,1351600,5935300,,\n19990830 00:00,1353400,1355000,1323900,1326600,4286300,,\n19990831 00:00,1329400,1337500,1307500,1325000,11968000,,\n19990901 00:00,1329400,1335600,1323100,1335600,6137800,,\n19990902 00:00,1321300,1326700,1306600,1322500,11370700,,\n19990903 00:00,1348800,1362800,1346900,1361900,9796800,,\n19990907 00:00,1360600,1366300,1342800,1355200,4507400,,\n19990908 00:00,1348400,1360600,1335000,1349100,6999800,,\n19990909 00:00,1347500,1352500,1336900,1351300,5950500,,\n19990910 00:00,1362500,1363600,1349400,1354500,2671700,,\n19990913 00:00,1351300,1354700,1345000,1348100,2130600,,\n19990914 00:00,1340600,1345600,1333800,1340600,3558700,,\n19990915 00:00,1354400,1354400,1320600,1320800,6522800,,\n19990916 00:00,1325000,1328100,1303100,1323800,15114200,,\n19990917 00:00,1326300,1339400,1321600,1337200,8371300,,\n19990920 00:00,1339400,1340000,1330900,1336300,2602800,,\n19990921 00:00,1322500,1324700,1301600,1309100,9018700,,\n19990922 00:00,1312500,1318400,1297500,1311600,12758600,,\n19990923 00:00,1318100,1342500,1237800,1280000,11455200,1237800,Low\n19990924 00:00,1277500,1283800,1263100,1280600,13686000,,\n19990927 00:00,1287500,1297500,1282800,1282800,6797200,,\n19990928 00:00,1279400,1288100,1255600,1281900,11184900,,\n19990929 00:00,1284400,1291300,1267800,1267800,7351000,,\n19990930 00:00,1274400,1294400,1269700,1283800,7185300,,\n19991001 00:00,1279400,1285600,1266300,1283400,10818900,,\n19991004 00:00,1291900,1306300,1287500,1306300,6202900,,\n19991005 00:00,1307200,1319700,1286900,1301900,11376700,,\n19991006 00:00,1307500,1328100,1306900,1326300,11399000,,\n19991007 00:00,1328600,1330000,1315000,1320000,5986000,,\n19991008 00:00,1317500,1338800,1312300,1337200,9560400,,\n19991011 00:00,1335900,1341300,1333100,1338100,3970800,,\n19991012 00:00,1331300,1333100,1311900,1314100,8223800,,\n19991013 00:00,1306900,1313100,1282500,1286600,10731100,,\n19991014 00:00,1284800,1291900,1267500,1284100,10461400,,\n19991015 00:00,1260000,1267500,1245000,1248100,14030700,,\n19991018 00:00,1249400,1257500,1234400,1255600,9088500,,\n19991019 00:00,1271900,1282500,1259400,1260800,17208700,,\n19991020 00:00,1277500,1292500,1271300,1292200,8467400,,\n19991021 00:00,1272200,1288800,1266300,1286300,9352900,,\n19991022 00:00,1297500,1312200,1295600,1303400,8087900,,\n19991025 00:00,1293100,1304700,1287500,1295000,7667400,,\n19991026 00:00,1301900,1306900,1281900,1282500,5696200,,\n19991027 00:00,1283800,1303100,1282500,1301300,5049600,,\n19991028 00:00,1324400,1345000,1321900,1345000,10053700,,\n19991029 00:00,1358400,1376900,1357200,1365600,10480000,,\n19991101 00:00,1365000,1370000,1356300,1359400,3631400,,\n19991102 00:00,1359700,1372500,1347500,1348100,5787700,,\n19991103 00:00,1360000,1363800,1351300,1356900,7310900,,\n19991104 00:00,1367500,1373600,1357700,1364700,7695600,,\n19991105 00:00,1386300,1391100,1367800,1372200,7618700,,\n19991108 00:00,1370000,1383800,1367500,1379400,4517900,,\n19991109 00:00,1385000,1386900,1362800,1367200,4361300,,\n19991110 00:00,1362500,1383900,1360800,1377500,6173600,,\n19991111 00:00,1381900,1385600,1374700,1383800,4724400,,\n19991112 00:00,1392500,1399700,1371300,1397500,15589200,,\n19991115 00:00,1398400,1402500,1394100,1398100,2101000,,\n19991116 00:00,1405600,1426300,1400900,1424400,7442900,,\n19991117 00:00,1422500,1429400,1413100,1415600,9129600,,\n19991118 00:00,1424400,1430000,1416300,1428100,11360400,,\n19991119 00:00,1424100,1429700,1420000,1425000,4641100,,\n19991122 00:00,1424400,1430000,1415000,1424700,4149600,,\n19991123 00:00,1428400,1428400,1400600,1408800,5948300,,\n19991124 00:00,1407500,1424400,1400000,1420600,4357200,,\n19991126 00:00,1424700,1428800,1412500,1414400,1694900,,\n19991129 00:00,1408800,1419200,1404400,1410000,7653200,,\n19991130 00:00,1407500,1423100,1390000,1392500,8403900,,\n19991201 00:00,1393100,1405000,1390000,1401300,6790400,,\n19991202 00:00,1406300,1413600,1403800,1411300,6706200,,\n19991203 00:00,1430300,1454100,1430300,1436900,9860300,,\n19991206 00:00,1435300,1437200,1422500,1427500,2950200,,\n19991207 00:00,1432800,1433100,1413800,1419400,10334900,,\n19991208 00:00,1413400,1420600,1406300,1406300,4357000,,\n19991209 00:00,1418100,1422200,1393800,1410000,6029100,,\n19991210 00:00,1422800,1428100,1408800,1420000,4698200,,\n19991213 00:00,1414400,1427200,1412800,1421300,3919800,,\n19991214 00:00,1416300,1424800,1406300,1408100,5625700,,\n19991215 00:00,1403800,1422000,1400000,1418000,6539200,,\n19991216 00:00,1421900,1426600,1411600,1423800,5503200,,\n19991217 00:00,1430000,1433100,1420600,1423800,4355000,,\n19991220 00:00,1425600,1431900,1410900,1416900,4888100,,\n19991221 00:00,1415900,1440600,1413400,1433400,7829500,,\n19991222 00:00,1436300,1441900,1429700,1437500,5250700,,\n19991223 00:00,1450200,1464400,1449700,1460900,5566200,,\n19991227 00:00,1465000,1467800,1450600,1458100,2602500,,"
  },
  {
    "path": "Tests/TestData/stock_prices.csv",
    "content": "Date,EEM,EWG,TIP,EWJ,EFA,IEF,EWQ,EWU,XLB,XLE,XLF,LQD,XLK,XLU,EPP,FXI,VGK,VPL,SPY,TLT,BND,CSJ,DIA\n2008-01-02,49.27333450317383,35.38999938964844,106.63999938964844,52.91999816894531,78.22000122070312,87.62999725341797,37.939998626708984,47.7599983215332,41.29999923706055,79.5,23.038179397583008,106.08000183105469,26.1200008392334,42.09000015258789,51.1733283996582,55.98332977294922,74.52999877929688,67.30999755859375,144.92999267578125,94.37999725341797,77.36000061035156,101.4000015258789,130.6300048828125\n2008-01-03,49.71666717529297,35.290000915527344,107.0,53.119998931884766,78.3499984741211,87.80999755859375,37.91999816894531,48.060001373291016,42.04999923706055,80.44000244140625,22.891958236694336,105.7300033569336,26.15999984741211,42.029998779296875,51.293331146240234,55.599998474121094,74.80000305175781,67.5,144.86000061035156,94.25,77.45999908447266,101.5199966430664,130.74000549316406\n2008-01-04,48.223331451416016,34.599998474121094,106.97000122070312,51.7599983215332,76.56999969482422,88.04000091552734,36.9900016784668,46.91999816894531,40.779998779296875,77.5,22.24207878112793,106.5999984741211,25.139999389648438,42.349998474121094,49.849998474121094,54.53667068481445,72.9800033569336,65.7699966430664,141.30999755859375,94.2699966430664,77.55000305175781,101.6500015258789,128.1699981689453\n2008-01-07,48.57666778564453,34.630001068115234,106.94999694824219,51.439998626708984,76.6500015258789,88.19999694824219,37.2599983215332,47.060001373291016,40.220001220703125,77.19999694824219,22.2989444732666,106.47000122070312,24.920000076293945,43.22999954223633,50.41667175292969,56.116668701171875,72.94999694824219,65.6500015258789,141.19000244140625,94.68000030517578,77.56999969482422,101.72000122070312,128.05999755859375\n2008-01-08,48.20000076293945,34.38999938964844,107.02999877929688,51.31999969482422,76.22000122070312,88.38999938964844,36.970001220703125,46.400001525878906,39.599998474121094,75.8499984741211,21.486597061157227,106.2699966430664,24.260000228881836,43.2400016784668,49.56666946411133,55.3266716003418,72.4000015258789,65.36000061035156,138.91000366210938,94.56999969482422,77.6500015258789,101.73999786376953,125.8499984741211\n2008-01-09,49.779998779296875,34.5,106.94999694824219,52.439998626708984,76.7699966430664,88.25,37.08000183105469,46.41999816894531,39.849998474121094,76.8499984741211,21.892770767211914,106.05000305175781,24.600000381469727,43.709999084472656,50.529998779296875,58.79999923706055,72.5,66.75,140.3699951171875,94.75,77.55999755859375,101.6500015258789,126.95999908447266\n2008-01-10,50.36666488647461,34.599998474121094,106.47000122070312,52.0,76.69000244140625,88.01000213623047,37.16999816894531,46.18000030517578,40.38999938964844,76.52999877929688,22.266450881958008,105.73999786376953,24.639999389648438,43.439998626708984,51.10667037963867,59.25,72.55999755859375,66.45999908447266,141.2899932861328,93.47000122070312,77.52999877929688,101.63999938964844,127.81999969482422\n2008-01-11,48.95000076293945,34.11000061035156,107.26000213623047,51.119998931884766,75.16000366210938,88.56999969482422,36.459999084472656,45.20000076293945,39.97999954223633,75.5999984741211,22.339561462402344,106.51000213623047,24.280000686645508,43.43000030517578,49.52333068847656,56.66667175292969,71.23999786376953,65.11000061035156,140.14999389648438,94.19999694824219,77.7699966430664,102.19000244140625,126.19000244140625\n2008-01-14,49.66999816894531,34.72999954223633,107.70999908447266,51.7599983215332,76.36000061035156,88.61000061035156,37.209999084472656,45.7400016784668,41.31999969482422,77.0999984741211,22.64825439453125,106.06999969482422,24.770000457763672,43.4900016784668,50.306671142578125,56.91667175292969,72.37000274658203,65.75,141.27999877929688,94.55000305175781,77.87000274658203,102.2300033569336,127.51000213623047\n2008-01-15,47.42333221435547,33.77000045776367,108.26000213623047,50.31999969482422,73.87999725341797,89.19000244140625,36.099998474121094,44.599998474121094,40.189998626708984,73.91000366210938,21.714054107666016,106.63999938964844,24.25,43.029998779296875,47.869998931884766,52.619998931884766,70.05000305175781,63.650001525878906,138.1699981689453,95.61000061035156,78.1500015258789,102.12000274658203,125.30000305175781\n2008-01-16,45.45000076293945,32.83000183105469,107.62000274658203,49.400001525878906,72.38999938964844,89.0199966430664,35.40999984741211,43.720001220703125,38.849998474121094,71.44999694824219,22.07961082458496,106.4800033569336,23.719999313354492,42.2599983215332,46.973331451416016,50.54999923706055,68.69999694824219,62.47999954223633,136.97999572753906,94.91999816894531,78.0,102.22000122070312,124.6500015258789\n2008-01-17,44.12666702270508,32.34000015258789,108.4000015258789,48.720001220703125,71.30000305175781,89.73999786376953,34.630001068115234,43.099998474121094,36.93000030517578,68.75,20.95857048034668,106.9800033569336,23.510000228881836,40.630001068115234,45.543331146240234,49.6733283996582,67.69999694824219,61.380001068115234,133.42999267578125,96.1500015258789,78.31999969482422,102.44999694824219,121.7699966430664\n2008-01-18,45.13333511352539,32.22999954223633,108.5,50.0,71.70999908447266,89.61000061035156,34.58000183105469,43.2400016784668,37.349998474121094,68.9000015258789,20.714866638183594,106.80000305175781,23.100000381469727,40.029998779296875,46.310001373291016,52.313331604003906,67.48999786376953,62.59000015258789,132.05999755859375,95.48999786376953,78.27999877929688,102.6500015258789,120.56999969482422\n2008-01-22,44.0,30.200000762939453,109.31999969482422,48.15999984741211,69.70999908447266,90.61000061035156,33.439998626708984,43.099998474121094,37.0099983215332,66.94999694824219,21.161657333374023,107.02999877929688,22.670000076293945,38.650001525878906,44.599998474121094,47.91999816894531,65.5999984741211,60.209999084472656,130.72000122070312,96.51000213623047,78.7699966430664,102.91000366210938,119.22000122070312\n2008-01-23,44.279998779296875,29.6200008392334,109.05999755859375,48.31999969482422,69.30000305175781,90.19000244140625,32.66999816894531,42.720001220703125,37.650001525878906,67.56999969482422,22.664501190185547,107.16999816894531,22.8700008392334,39.68000030517578,45.31666946411133,50.45000076293945,65.38999938964844,60.470001220703125,133.86000061035156,96.29000091552734,78.63999938964844,102.69999694824219,122.69999694824219\n2008-01-24,45.13999938964844,30.56999969482422,108.31999969482422,49.119998931884766,71.7300033569336,89.37000274658203,33.970001220703125,43.7400016784668,38.25,69.94999694824219,22.672624588012695,106.26000213623047,23.200000762939453,38.599998474121094,46.2400016784668,49.966670989990234,67.30000305175781,61.720001220703125,134.99000549316406,94.36000061035156,78.12999725341797,102.94999694824219,123.43000030517578\n2008-01-25,44.45333480834961,30.010000228881836,109.19999694824219,49.880001068115234,70.69000244140625,90.19999694824219,33.09000015258789,43.41999816894531,38.439998626708984,68.69999694824219,22.07961082458496,107.41000366210938,22.84000015258789,38.18000030517578,47.21332931518555,49.61000061035156,65.9000015258789,63.02000045776367,133.0399932861328,95.94999694824219,78.6500015258789,103.37000274658203,122.19000244140625\n2008-01-28,45.5533332824707,30.81999969482422,109.06999969482422,49.599998474121094,71.4800033569336,89.87000274658203,33.689998626708984,43.47999954223633,39.20000076293945,70.26000213623047,22.86758804321289,107.37999725341797,22.940000534057617,38.779998779296875,48.0,50.206668853759766,67.29000091552734,63.349998474121094,135.24000549316406,95.58999633789062,78.37000274658203,103.30000305175781,123.52999877929688\n2008-01-29,45.33000183105469,31.0,109.02999877929688,50.439998626708984,71.91000366210938,89.51000213623047,34.130001068115234,44.0,39.400001525878906,71.05000305175781,23.216896057128906,107.19999694824219,23.139999389648438,38.90999984741211,47.50333023071289,49.76667022705078,67.5999984741211,63.470001220703125,135.91000366210938,94.94000244140625,78.26000213623047,103.2699966430664,124.54000091552734\n2008-01-30,44.733333587646484,30.950000762939453,109.05000305175781,50.20000076293945,71.58000183105469,89.47000122070312,33.779998779296875,43.70000076293945,39.25,70.16000366210938,22.74573516845703,107.18000030517578,22.959999084472656,38.709999084472656,46.2400016784668,47.45000076293945,67.19999694824219,62.900001525878906,134.91000366210938,94.31999969482422,78.29000091552734,103.61000061035156,123.77999877929688\n2008-01-31,45.630001068115234,31.200000762939453,109.58000183105469,50.880001068115234,72.33999633789062,89.93000030517578,34.0,44.31999969482422,39.95000076293945,69.5999984741211,23.671812057495117,107.52999877929688,23.25,39.220001220703125,47.376670837402344,48.02333068847656,68.0999984741211,64.0,137.3699951171875,94.98999786376953,78.3499984741211,103.18000030517578,126.0\n2008-02-01,46.540000915527344,31.450000762939453,109.08000183105469,51.31999969482422,73.55000305175781,89.94000244140625,34.61000061035156,44.91999816894531,40.91999816894531,71.3499984741211,24.1104793548584,107.48999786376953,23.649999618530273,40.2400016784668,48.98332977294922,50.23332977294922,69.04000091552734,65.12999725341797,139.5800018310547,95.2300033569336,78.30999755859375,102.97000122070312,127.43000030517578\n2008-02-04,46.68333435058594,31.420000076293945,108.44999694824219,51.15999984741211,72.80000305175781,89.44000244140625,34.290000915527344,44.720001220703125,40.279998779296875,71.4000015258789,23.4118595123291,107.19999694824219,23.15999984741211,40.81999969482422,48.0,51.51667022705078,68.2699966430664,64.47000122070312,137.82000732421875,94.25,78.02999877929688,102.97000122070312,126.02999877929688\n2008-02-05,44.16999816894531,29.770000457763672,108.97000122070312,49.439998626708984,69.45999908447266,90.06999969482422,32.22999954223633,43.13999938964844,39.119998931884766,68.44999694824219,22.461414337158203,107.56999969482422,22.579999923706055,39.59000015258789,46.22999954223633,47.956668853759766,65.11000061035156,62.279998779296875,134.1300048828125,94.97000122070312,78.23999786376953,103.16999816894531,122.95999908447266\n2008-02-06,43.4466667175293,30.06999969482422,108.83999633789062,48.79999923706055,69.4000015258789,89.91000366210938,32.369998931884766,43.0,38.849998474121094,67.51000213623047,22.201461791992188,106.98999786376953,22.329999923706055,39.52000045776367,45.793331146240234,46.216670989990234,65.4800033569336,61.470001220703125,133.0500030517578,94.68000030517578,78.08000183105469,103.01000213623047,122.26000213623047\n2008-02-07,44.18333435058594,29.8700008392334,107.54000091552734,49.08000183105469,69.05000305175781,88.9000015258789,32.189998626708984,42.279998779296875,39.0,68.83999633789062,22.40454864501953,105.76000213623047,22.469999313354492,39.310001373291016,45.853328704833984,48.029998779296875,64.70999908447266,61.70000076293945,133.92999267578125,92.63999938964844,77.5999984741211,103.01000213623047,122.7300033569336\n2008-02-08,44.099998474121094,29.770000457763672,108.62000274658203,47.84000015258789,68.33999633789062,89.6500015258789,31.84000015258789,42.34000015258789,39.83000183105469,69.8499984741211,22.030868530273438,106.16000366210938,22.299999237060547,39.0,45.65666961669922,47.216670989990234,64.3499984741211,60.61000061035156,133.07000732421875,93.69999694824219,77.83000183105469,103.19000244140625,121.75\n2008-02-11,44.64666748046875,29.90999984741211,108.9000015258789,48.31999969482422,68.69999694824219,89.8499984741211,31.969999313354492,42.18000030517578,39.970001220703125,71.6500015258789,21.543460845947266,106.4800033569336,22.690000534057617,39.31999969482422,45.84333038330078,46.849998474121094,64.80000305175781,61.040000915527344,133.75,94.08999633789062,78.0,103.18000030517578,122.31999969482422\n2008-02-12,45.36666488647461,30.68000030517578,108.69999694824219,49.040000915527344,70.18000030517578,89.66000366210938,32.93000030517578,43.099998474121094,40.689998626708984,71.61000061035156,22.136474609375,106.33000183105469,22.739999771118164,39.9900016784668,46.313331604003906,48.13666915893555,65.95999908447266,62.02000045776367,134.99000549316406,93.52999877929688,77.87000274658203,103.27999877929688,123.7699966430664\n2008-02-13,46.38666534423828,31.149999618530273,107.70999908447266,48.68000030517578,70.66000366210938,89.27999877929688,33.2400016784668,43.619998931884766,40.52000045776367,73.3499984741211,22.055238723754883,105.26000213623047,23.260000228881836,39.79999923706055,46.17667007446289,48.99666976928711,66.83000183105469,61.599998474121094,136.3699951171875,92.54000091552734,77.44999694824219,103.4000015258789,125.26000213623047\n2008-02-14,45.790000915527344,30.899999618530273,106.98999786376953,49.15999984741211,70.33999633789062,88.79000091552734,33.04999923706055,43.2400016784668,40.0,72.72000122070312,21.4541015625,105.02999877929688,22.799999237060547,39.29999923706055,46.09000015258789,47.873329162597656,66.36000061035156,61.880001068115234,135.1699981689453,91.18000030517578,77.08999633789062,103.43000030517578,124.01000213623047\n2008-02-15,46.11666488647461,30.809999465942383,107.52999877929688,49.7599983215332,70.5999984741211,88.9800033569336,33.040000915527344,43.040000915527344,40.25,72.8499984741211,21.7952880859375,105.37000274658203,22.719999313354492,39.849998474121094,46.873329162597656,49.959999084472656,66.16000366210938,62.599998474121094,135.13999938964844,91.87999725341797,77.20999908447266,103.44000244140625,123.33000183105469\n2008-02-19,46.720001220703125,31.280000686645508,106.91000366210938,50.2400016784668,71.29000091552734,88.33999633789062,33.540000915527344,43.599998474121094,41.25,75.25,21.762794494628906,104.33000183105469,22.510000228881836,39.529998779296875,47.029998779296875,50.276668548583984,67.11000061035156,63.11000061035156,135.52000427246094,90.94999694824219,76.5,103.05999755859375,123.68000030517578\n2008-02-20,47.11000061035156,31.209999084472656,107.2699966430664,49.20000076293945,70.91999816894531,88.26000213623047,33.59000015258789,43.5,41.4900016784668,76.1500015258789,22.01462173461914,104.55999755859375,22.549999237060547,39.61000061035156,46.646671295166016,49.779998779296875,67.01000213623047,62.02000045776367,135.9199981689453,91.58000183105469,76.55999755859375,102.93000030517578,124.08999633789062\n2008-02-21,46.45000076293945,30.899999618530273,107.94000244140625,49.560001373291016,70.79000091552734,89.16999816894531,33.43000030517578,43.52000045776367,40.93000030517578,74.05999755859375,21.62469482421875,105.27999877929688,22.510000228881836,38.7400016784668,46.099998474121094,47.853328704833984,67.12999725341797,62.040000915527344,134.7899932861328,92.55000305175781,77.19999694824219,103.19999694824219,123.19999694824219\n2008-02-22,47.073333740234375,30.989999771118164,107.63999938964844,49.959999084472656,71.69000244140625,88.91999816894531,33.970001220703125,43.900001525878906,41.31999969482422,74.9000015258789,22.095857620239258,104.87000274658203,22.489999771118164,39.41999816894531,46.810001373291016,49.2599983215332,67.58999633789062,62.650001525878906,135.6199951171875,92.0199966430664,77.01000213623047,103.04000091552734,123.80000305175781\n2008-02-25,47.95000076293945,31.299999237060547,107.0999984741211,51.0,72.83000183105469,88.33000183105469,34.54999923706055,44.68000030517578,42.27000045776367,77.04000091552734,22.095857620239258,104.19999694824219,22.6200008392334,39.459999084472656,47.66667175292969,49.36333084106445,68.58000183105469,64.05999755859375,137.3300018310547,91.08000183105469,76.62999725341797,103.0199966430664,125.56999969482422\n2008-02-26,48.58333206176758,31.8799991607666,107.80999755859375,51.560001373291016,73.91000366210938,88.55000305175781,35.029998779296875,45.47999954223633,42.470001220703125,78.3499984741211,22.290821075439453,104.94999694824219,22.8799991607666,39.970001220703125,48.353328704833984,49.82332992553711,69.97000122070312,64.87000274658203,138.36000061035156,91.11000061035156,76.91999816894531,103.33999633789062,126.80999755859375\n2008-02-27,48.99333190917969,32.150001525878906,107.98999786376953,51.279998779296875,74.1500015258789,88.76000213623047,35.279998779296875,45.2400016784668,42.459999084472656,77.33000183105469,22.388301849365234,104.8499984741211,22.899999618530273,39.0099983215332,48.736671447753906,51.46332931518555,70.05000305175781,64.91999816894531,138.22000122070312,91.19000244140625,77.05999755859375,103.4000015258789,126.83000183105469\n2008-02-28,48.46666717529297,31.84000015258789,109.41999816894531,50.720001220703125,73.44000244140625,89.80000305175781,34.90999984741211,44.86000061035156,42.22999954223633,78.66000366210938,21.68968391418457,105.61000061035156,22.610000610351562,38.75,48.086669921875,50.163330078125,69.5999984741211,64.16999816894531,136.8699951171875,92.80999755859375,77.62999725341797,103.45999908447266,125.83999633789062\n2008-02-29,46.540000915527344,30.979999542236328,110.56999969482422,50.119998931884766,71.5999984741211,90.76000213623047,33.93000030517578,43.79999923706055,40.869998931884766,76.05000305175781,20.982940673828125,106.27999877929688,22.149999618530273,37.61000061035156,46.15999984741211,48.40999984741211,67.9000015258789,62.880001068115234,133.82000732421875,94.2300033569336,78.12000274658203,103.80999755859375,123.01000213623047\n2008-03-03,46.7933349609375,31.030000686645508,110.01000213623047,50.08000183105469,71.80999755859375,90.25,34.02000045776367,43.58000183105469,41.54999923706055,77.0,20.698619842529297,105.83000183105469,22.139999389648438,38.18000030517578,46.41999816894531,48.81666946411133,67.76000213623047,62.83000183105469,133.5,93.63999938964844,77.63999938964844,103.44999694824219,122.5\n2008-03-04,45.7066650390625,30.559999465942383,109.76000213623047,48.91999816894531,70.72000122070312,89.91000366210938,33.68000030517578,43.459999084472656,40.54999923706055,75.5,20.584890365600586,105.20999908447266,22.170000076293945,38.84000015258789,45.49666976928711,46.810001373291016,67.20999908447266,61.540000915527344,132.99000549316406,92.7300033569336,77.2699966430664,103.37000274658203,122.4000015258789\n2008-03-05,46.66666793823242,30.93000030517578,109.69000244140625,49.20000076293945,71.56999969482422,89.5199966430664,34.13999938964844,43.779998779296875,41.689998626708984,77.4000015258789,20.422420501708984,104.47000122070312,22.329999923706055,38.72999954223633,46.290000915527344,47.693328857421875,68.0,61.970001220703125,133.8300018310547,91.62000274658203,76.7699966430664,103.22000122070312,122.87000274658203\n2008-03-06,45.06666564941406,30.719999313354492,110.27999877929688,48.7599983215332,70.55000305175781,90.23999786376953,33.61000061035156,43.439998626708984,41.31999969482422,75.8499984741211,19.715679168701172,104.33000183105469,22.020000457763672,37.939998626708984,44.94667053222656,45.5,67.12999725341797,61.25,131.05999755859375,92.11000061035156,76.70999908447266,103.36000061035156,120.80000305175781\n2008-03-07,44.44333267211914,30.260000228881836,110.69000244140625,48.040000915527344,69.72000122070312,90.55000305175781,33.15999984741211,43.18000030517578,39.59000015258789,73.76000213623047,19.756296157836914,104.11000061035156,22.020000457763672,37.70000076293945,43.89332962036133,45.35667037963867,66.5,60.130001068115234,129.7100067138672,92.2300033569336,76.91999816894531,103.36000061035156,118.93000030517578\n2008-03-10,43.663333892822266,29.940000534057617,111.5199966430664,47.84000015258789,69.37000274658203,91.19999694824219,32.84000015258789,42.79999923706055,38.7400016784668,72.8499984741211,19.195775985717773,104.08999633789062,21.780000686645508,37.650001525878906,43.20000076293945,44.48332977294922,65.83000183105469,59.560001373291016,128.0,93.58999633789062,77.1500015258789,103.37999725341797,117.9800033569336\n2008-03-11,46.599998474121094,30.93000030517578,110.44000244140625,49.2400016784668,71.55999755859375,90.20999908447266,33.81999969482422,43.900001525878906,41.099998474121094,76.5999984741211,20.454914093017578,102.9000015258789,22.549999237060547,38.29999923706055,45.50333023071289,48.81666946411133,67.9000015258789,61.65999984741211,132.60000610351562,92.79000091552734,76.70999908447266,102.91999816894531,122.05999755859375\n2008-03-12,45.73666763305664,31.010000228881836,111.5,49.2400016784668,71.55999755859375,91.25,33.959999084472656,43.91999816894531,40.5099983215332,74.9000015258789,20.11372947692871,104.13999938964844,22.31999969482422,38.29999923706055,44.8266716003418,46.709999084472656,67.97000122070312,61.36000061035156,131.36000061035156,94.58000183105469,77.41999816894531,103.16000366210938,121.4000015258789\n2008-03-13,45.31999969482422,31.190000534057617,110.77999877929688,49.400001525878906,71.68000030517578,90.7699966430664,34.189998626708984,44.119998931884766,41.5,76.1500015258789,20.064987182617188,103.01000213623047,22.229999542236328,38.18000030517578,44.89332962036133,45.57332992553711,68.27999877929688,61.380001068115234,131.64999389648438,93.83999633789062,77.08000183105469,102.73999786376953,121.51000213623047\n2008-03-14,43.71333312988281,30.579999923706055,111.02999877929688,46.119998931884766,69.94999694824219,91.70999908447266,33.54999923706055,42.79999923706055,40.77000045776367,74.76000213623047,19.4963436126709,102.94999694824219,21.950000762939453,37.900001525878906,44.03667068481445,42.956668853759766,66.68000030517578,59.15999984741211,129.61000061035156,95.0,77.41000366210938,103.12999725341797,120.0199966430664\n2008-03-17,42.63333511352539,29.989999771118164,109.83999633789062,47.439998626708984,68.88999938964844,92.16999816894531,33.119998931884766,41.5,39.95000076293945,72.1500015258789,19.04955291748047,103.79000091552734,21.850000381469727,37.91999816894531,43.09000015258789,42.206668853759766,65.55000305175781,58.720001220703125,128.3000030517578,95.7300033569336,77.66999816894531,103.06999969482422,120.08999633789062\n2008-03-18,44.849998474121094,30.799999237060547,109.72000122070312,48.79999923706055,71.0,91.54000091552734,34.15999984741211,43.13999938964844,41.349998474121094,75.30000305175781,20.649877548217773,103.5999984741211,22.829999923706055,38.59000015258789,44.783329010009766,44.33332824707031,67.52999877929688,60.90999984741211,133.6300048828125,95.36000061035156,77.73999786376953,103.16999816894531,124.05000305175781\n2008-03-19,42.15666580200195,29.860000610351562,110.18000030517578,47.31999969482422,68.43000030517578,92.33000183105469,32.93000030517578,41.2400016784668,38.54999923706055,70.69999694824219,20.105606079101562,104.05000305175781,22.149999618530273,37.83000183105469,43.15666961669922,41.22999954223633,65.0,59.290000915527344,130.32000732421875,96.94000244140625,77.80000305175781,103.05999755859375,121.44000244140625\n2008-03-20,42.86666488647461,29.950000762939453,110.41999816894531,48.20000076293945,69.45999908447266,92.52999877929688,33.189998626708984,41.7599983215332,38.29999923706055,70.80999755859375,21.380990982055664,104.5999984741211,22.389999389648438,37.45000076293945,43.216670989990234,42.36000061035156,65.58000183105469,59.97999954223633,132.0800018310547,97.18000030517578,78.01000213623047,102.62000274658203,123.11000061035156\n2008-03-24,44.5099983215332,30.950000762939453,108.47000122070312,49.68000030517578,70.7300033569336,90.9000015258789,33.90999984741211,42.619998931884766,39.65999984741211,72.05000305175781,21.657188415527344,104.4000015258789,23.18000030517578,37.56999969482422,44.709999084472656,42.783329010009766,66.9800033569336,61.380001068115234,134.72000122070312,95.30000305175781,77.58000183105469,102.6500015258789,125.33999633789062\n2008-03-25,45.19333267211914,31.059999465942383,108.29000091552734,50.20000076293945,71.76000213623047,91.22000122070312,34.43000030517578,43.31999969482422,40.849998474121094,72.7699966430664,21.592201232910156,104.87000274658203,23.200000762939453,37.459999084472656,45.25333023071289,44.896671295166016,68.12000274658203,62.08000183105469,134.85000610351562,95.69999694824219,77.7300033569336,102.83999633789062,125.12999725341797\n2008-03-26,44.82666778564453,31.25,108.61000061035156,49.79999923706055,71.76000213623047,91.29000091552734,34.75,43.2400016784668,40.66999816894531,74.3499984741211,20.812347412109375,105.0,22.75,37.599998474121094,45.383331298828125,43.783329010009766,68.12000274658203,62.060001373291016,133.1999969482422,95.30000305175781,77.80000305175781,102.62999725341797,123.91999816894531\n2008-03-27,44.61000061035156,31.360000610351562,108.83000183105469,49.63999938964844,71.69999694824219,91.16999816894531,34.630001068115234,43.099998474121094,40.560001373291016,73.5999984741211,20.487407684326172,104.36000061035156,22.56999969482422,37.97999954223633,45.11333084106445,44.16667175292969,68.30999755859375,61.52000045776367,132.77999877929688,94.62999725341797,77.80999755859375,102.94000244140625,123.1500015258789\n2008-03-28,44.529998779296875,31.31999969482422,109.63999938964844,49.84000015258789,71.63999938964844,91.52999877929688,34.5,42.900001525878906,40.220001220703125,73.4000015258789,20.024370193481445,104.91999816894531,22.43000030517578,37.630001068115234,45.11333084106445,45.630001068115234,68.30000305175781,62.029998779296875,131.50999450683594,95.55000305175781,77.87000274658203,102.98999786376953,122.2300033569336\n2008-03-31,44.7933349609375,31.510000228881836,109.9000015258789,49.47999954223633,71.9000015258789,91.69000244140625,34.939998626708984,43.119998931884766,40.16999816894531,74.05999755859375,20.203086853027344,105.19999694824219,22.399999618530273,37.939998626708984,45.193328857421875,45.046669006347656,68.79000091552734,61.66999816894531,131.97000122070312,95.88999938964844,78.13999938964844,103.12000274658203,122.4000015258789\n2008-04-01,46.51333236694336,32.290000915527344,108.31999969482422,50.91999816894531,74.16999816894531,90.58000183105469,36.060001373291016,44.65999984741211,41.45000076293945,75.44999694824219,21.62469482421875,104.5199966430664,23.049999237060547,38.91999816894531,46.57332992553711,48.4033317565918,70.66999816894531,63.41999816894531,136.61000061035156,93.93000030517578,77.02999877929688,102.3499984741211,126.06999969482422\n2008-04-02,46.54666519165039,32.22999954223633,108.31999969482422,50.84000015258789,74.33000183105469,90.27999877929688,36.09000015258789,44.7400016784668,41.72999954223633,76.5,21.608448028564453,104.69999694824219,23.329999923706055,39.41999816894531,46.693328857421875,47.383331298828125,70.83999633789062,63.65999984741211,136.6999969482422,94.12999725341797,76.93000030517578,102.19999694824219,126.19000244140625\n2008-04-03,47.11333465576172,32.20000076293945,108.27999877929688,51.08000183105469,74.55000305175781,90.27999877929688,35.95000076293945,44.959999084472656,42.4900016784668,76.68000030517578,21.705930709838867,104.75,23.31999969482422,39.209999084472656,47.68333053588867,49.353328704833984,70.97000122070312,64.5,137.0399932861328,94.33999633789062,76.9000015258789,102.58000183105469,126.33000183105469\n2008-04-04,46.92333221435547,32.310001373291016,108.9000015258789,51.119998931884766,74.80000305175781,90.97000122070312,36.09000015258789,45.29999923706055,42.90999984741211,77.30999755859375,21.413484573364258,106.0199966430664,23.239999771118164,39.16999816894531,48.0099983215332,48.866668701171875,71.2300033569336,64.66000366210938,136.88999938964844,95.19999694824219,77.61000061035156,102.88999938964844,126.0999984741211\n2008-04-07,47.54666519165039,32.47999954223633,108.6500015258789,51.47999954223633,75.26000213623047,90.37000274658203,36.22999954223633,45.63999938964844,42.68000030517578,77.72000122070312,21.543460845947266,106.13999938964844,23.260000228881836,39.34000015258789,47.986671447753906,50.0,71.58999633789062,64.4000015258789,136.9600067138672,94.69999694824219,77.30999755859375,102.37000274658203,126.05000305175781\n2008-04-08,47.28666687011719,32.349998474121094,108.45999908447266,50.720001220703125,74.47000122070312,90.37999725341797,36.060001373291016,45.02000045776367,43.08000183105469,78.5999984741211,21.29975700378418,105.76000213623047,23.1200008392334,39.599998474121094,47.95000076293945,48.67667007446289,70.98999786376953,64.05999755859375,136.82000732421875,94.37000274658203,77.3499984741211,102.77999877929688,126.12999725341797\n2008-04-09,46.54999923706055,32.189998626708984,109.18000030517578,49.959999084472656,73.86000061035156,90.91999816894531,35.88999938964844,44.97999954223633,42.619998931884766,78.75,20.942323684692383,105.44999694824219,23.020000457763672,39.5,46.83000183105469,46.970001220703125,70.73999786376953,62.79999923706055,135.8300018310547,95.3499984741211,77.6500015258789,102.9000015258789,125.6500015258789\n2008-04-10,47.21666717529297,32.150001525878906,108.70999908447266,49.79999923706055,73.62999725341797,90.55999755859375,35.86000061035156,44.91999816894531,42.72999954223633,78.5999984741211,20.812347412109375,105.55000305175781,23.209999084472656,39.220001220703125,46.80332946777344,48.55332946777344,70.48999786376953,62.790000915527344,136.02000427246094,95.02999877929688,77.41999816894531,102.7699966430664,125.94999694824219\n2008-04-11,46.4466667175293,31.559999465942383,109.5199966430664,50.119998931884766,72.63999938964844,90.94999694824219,35.16999816894531,43.880001068115234,42.18000030517578,77.5,20.414297103881836,105.6500015258789,22.59000015258789,39.27000045776367,46.23332977294922,47.633331298828125,69.22000122070312,62.68000030517578,133.3800048828125,95.66999816894531,77.87000274658203,102.77999877929688,123.33999633789062\n2008-04-14,46.336666107177734,31.600000381469727,109.18000030517578,49.79999923706055,72.80000305175781,90.72000122070312,35.43000030517578,44.040000915527344,41.970001220703125,79.27999877929688,19.935012817382812,105.0,22.5,39.209999084472656,45.90666961669922,46.813331604003906,69.37999725341797,62.349998474121094,132.92999267578125,95.11000061035156,77.61000061035156,102.69999694824219,123.16999816894531\n2008-04-15,46.880001068115234,31.719999313354492,108.77999877929688,50.15999984741211,73.30999755859375,90.30999755859375,35.5,44.380001068115234,42.20000076293945,79.69999694824219,20.138099670410156,104.77999877929688,22.5,39.63999938964844,46.65999984741211,47.533329010009766,69.69999694824219,62.95000076293945,133.24000549316406,93.93000030517578,77.3499984741211,102.8499984741211,123.4800033569336\n2008-04-16,48.266666412353516,32.70000076293945,108.11000061035156,51.7599983215332,75.62000274658203,89.69999694824219,36.58000183105469,45.7599983215332,44.220001220703125,82.4000015258789,20.682371139526367,104.18000030517578,23.420000076293945,40.470001220703125,48.31666946411133,49.189998626708984,71.97000122070312,64.80000305175781,136.85000610351562,93.01000213623047,76.94000244140625,102.62000274658203,126.63999938964844\n2008-04-17,47.91666793823242,32.31999969482422,107.66000366210938,51.0,74.77999877929688,89.48999786376953,36.29999923706055,45.459999084472656,44.0,82.33000183105469,21.039804458618164,104.44999694824219,23.40999984741211,40.54999923706055,47.546669006347656,48.3266716003418,71.02999877929688,64.4800033569336,137.0500030517578,92.8499984741211,76.87000274658203,102.41000366210938,126.69999694824219\n2008-04-18,48.63999938964844,32.7599983215332,107.55999755859375,52.400001525878906,75.30999755859375,89.4000015258789,36.630001068115234,46.060001373291016,44.2400016784668,83.58999633789062,21.502843856811523,104.91000366210938,23.81999969482422,40.68000030517578,47.693328857421875,49.116668701171875,71.77999877929688,65.04000091552734,138.47999572753906,92.7699966430664,76.93000030517578,102.44999694824219,127.86000061035156\n2008-04-21,48.88666534423828,32.97999954223633,107.5999984741211,52.2400016784668,75.9000015258789,89.41000366210938,36.709999084472656,45.65999984741211,44.349998474121094,84.54000091552734,21.169780731201172,104.56999969482422,23.969999313354492,40.310001373291016,48.6733283996582,49.80332946777344,72.0999984741211,65.56999969482422,138.5500030517578,93.13999938964844,77.05999755859375,102.55999755859375,128.02999877929688\n2008-04-22,48.43333435058594,32.650001525878906,107.87000274658203,51.2400016784668,75.11000061035156,89.4800033569336,36.34000015258789,45.58000183105469,44.0,84.58000183105469,20.877334594726562,104.33999633789062,23.850000381469727,40.189998626708984,48.473331451416016,49.56666946411133,71.41000366210938,65.0,137.94000244140625,93.45999908447266,77.2300033569336,102.61000061035156,127.37000274658203\n2008-04-23,49.130001068115234,32.93000030517578,107.54000091552734,51.79999923706055,75.5,89.38999938964844,36.790000915527344,45.619998931884766,43.310001373291016,83.91999816894531,20.73923683166504,104.66000366210938,24.0,40.25,49.349998474121094,52.53667068481445,71.62000274658203,65.61000061035156,137.72000122070312,93.1500015258789,77.16000366210938,102.63999938964844,127.30000305175781\n2008-04-24,48.5,32.63999938964844,106.56999969482422,51.400001525878906,75.01000213623047,88.69000244140625,36.47999954223633,45.459999084472656,42.68000030517578,81.72000122070312,21.486597061157227,104.5199966430664,24.290000915527344,40.209999084472656,48.96332931518555,53.453330993652344,71.26000213623047,65.0,138.32000732421875,92.36000061035156,76.83000183105469,102.3499984741211,128.10000610351562\n2008-04-25,48.856666564941406,32.86000061035156,106.41999816894531,52.400001525878906,75.62999725341797,88.56999969482422,36.65999984741211,46.0,43.900001525878906,82.87999725341797,21.892770767211914,104.56999969482422,24.0,40.34000015258789,48.83000183105469,52.736671447753906,72.04000091552734,65.79000091552734,139.60000610351562,91.81999969482422,76.7300033569336,102.36000061035156,128.8000030517578\n2008-04-28,48.76333236694336,32.90999984741211,106.5999984741211,53.36000061035156,76.06999969482422,88.7300033569336,36.7599983215332,45.900001525878906,43.650001525878906,83.0199966430664,21.949634552001953,105.06999969482422,24.0,39.95000076293945,48.720001220703125,52.453330993652344,71.87000274658203,66.55999755859375,139.6300048828125,92.0999984741211,77.0,102.55999755859375,128.7899932861328\n2008-04-29,47.900001525878906,32.56999969482422,106.61000061035156,52.880001068115234,75.4000015258789,88.88999938964844,36.40999984741211,45.459999084472656,42.209999084472656,81.1500015258789,21.681560516357422,105.4000015258789,24.229999542236328,40.13999938964844,48.18000030517578,52.4900016784668,71.41999816894531,66.02999877929688,139.0800018310547,92.44999694824219,76.94999694824219,102.44999694824219,128.17999267578125\n2008-04-30,48.88666534423828,32.68000030517578,107.11000061035156,53.119998931884766,75.80999755859375,89.16999816894531,36.459999084472656,45.68000030517578,42.310001373291016,81.75,21.6165714263916,105.98999786376953,23.799999237060547,39.880001068115234,48.70000076293945,52.93000030517578,71.61000061035156,66.43000030517578,138.25999450683594,93.11000061035156,77.56999969482422,102.72000122070312,128.19000244140625\n2008-05-01,49.40666580200195,33.150001525878906,106.58999633789062,53.599998474121094,76.2699966430664,88.87999725341797,36.790000915527344,46.0,42.0099983215332,79.95999908447266,22.35580825805664,106.1500015258789,24.799999237060547,40.349998474121094,49.19667053222656,54.05332946777344,72.2300033569336,66.91000366210938,141.1199951171875,92.77999877929688,77.27999877929688,102.51000213623047,129.9600067138672\n2008-05-02,49.880001068115234,32.93000030517578,106.31999969482422,53.47999954223633,76.4800033569336,88.16000366210938,36.75,46.36000061035156,42.439998626708984,81.47000122070312,22.510154724121094,105.52999877929688,24.790000915527344,41.02000045776367,49.853328704833984,54.546669006347656,72.26000213623047,67.5199966430664,141.50999450683594,91.61000061035156,77.08999633789062,102.44000244140625,130.72999572753906\n2008-05-05,49.84333419799805,33.209999084472656,106.56999969482422,53.560001373291016,76.61000061035156,88.29000091552734,36.77000045776367,46.15999984741211,43.400001525878906,82.6500015258789,22.120227813720703,105.68000030517578,24.68000030517578,40.43000030517578,50.16667175292969,54.04999923706055,72.4000015258789,67.33999633789062,140.8300018310547,91.61000061035156,77.23999786376953,102.48999786376953,129.6300048828125\n2008-05-06,50.400001525878906,33.31999969482422,106.48999786376953,53.79999923706055,77.18000030517578,88.01000213623047,37.119998931884766,46.720001220703125,43.75,84.83999633789062,22.35580825805664,105.0,24.979999542236328,40.41999816894531,50.5966682434082,54.413330078125,73.01000213623047,67.76000213623047,142.0500030517578,90.94999694824219,76.95999908447266,102.30000305175781,130.25\n2008-05-07,48.900001525878906,32.83000183105469,106.75,53.119998931884766,75.83000183105469,88.36000061035156,36.400001525878906,45.900001525878906,43.2599983215332,83.26000213623047,21.551584243774414,105.27999877929688,24.540000915527344,39.810001373291016,48.646671295166016,51.216670989990234,71.68000030517578,66.44999694824219,139.52000427246094,91.33999633789062,77.06999969482422,102.5199966430664,128.39999389648438\n2008-05-08,49.4033317565918,33.06999969482422,107.54000091552734,53.36000061035156,76.48999786376953,88.93000030517578,36.619998931884766,46.380001068115234,44.0,84.93000030517578,21.112916946411133,105.75,24.579999923706055,39.90999984741211,49.796669006347656,51.98332977294922,72.33999633789062,67.25,139.16000366210938,92.16000366210938,77.44999694824219,102.69000244140625,128.24000549316406\n2008-05-09,49.0,32.97999954223633,107.83000183105469,52.52000045776367,75.87999725341797,89.02999877929688,36.349998474121094,45.97999954223633,43.45000076293945,84.7699966430664,21.112916946411133,105.75,24.5,40.040000915527344,49.663330078125,50.66999816894531,72.01000213623047,66.43000030517578,138.89999389648438,92.5,77.4000015258789,102.66999816894531,127.5\n2008-05-12,49.630001068115234,33.400001525878906,107.66000366210938,52.720001220703125,76.63999938964844,88.87999725341797,36.77000045776367,46.380001068115234,44.34000015258789,84.30000305175781,21.364744186401367,105.6500015258789,24.899999618530273,40.43000030517578,50.68000030517578,50.91667175292969,72.72000122070312,66.9800033569336,140.4600067138672,92.36000061035156,77.31999969482422,102.5,128.75999450683594\n2008-05-13,49.86666488647461,33.220001220703125,106.8499984741211,52.7599983215332,76.37999725341797,88.13999938964844,36.65999984741211,45.84000015258789,44.59000015258789,85.68000030517578,21.169780731201172,105.05000305175781,24.899999618530273,40.369998931884766,50.456668853759766,51.633331298828125,72.2300033569336,66.91000366210938,140.47999572753906,91.3499984741211,76.91999816894531,102.2699966430664,128.41000366210938\n2008-05-14,49.98666763305664,33.209999084472656,106.94999694824219,53.2400016784668,76.37999725341797,88.11000061035156,36.84000015258789,45.63999938964844,44.84000015258789,84.69999694824219,21.316003799438477,105.11000061035156,24.950000762939453,40.52000045776367,50.5966682434082,52.00667190551758,72.13999938964844,67.2699966430664,140.77000427246094,91.38999938964844,76.97000122070312,102.18000030517578,129.0\n2008-05-15,51.04999923706055,33.560001373291016,107.72000122070312,54.279998779296875,77.68000030517578,88.5999984741211,37.380001068115234,46.29999923706055,45.349998474121094,85.81999969482422,21.52721405029297,105.80999755859375,25.43000030517578,40.47999954223633,51.4233283996582,52.72999954223633,73.25,68.48999786376953,142.52999877929688,92.22000122070312,77.37999725341797,102.37999725341797,130.0500030517578\n2008-05-16,51.70000076293945,34.209999084472656,107.72000122070312,54.47999954223633,78.5199966430664,88.44999694824219,37.779998779296875,47.119998931884766,45.90999984741211,88.94999694824219,21.437854766845703,105.66999816894531,25.3700008392334,40.779998779296875,51.873329162597656,52.913330078125,74.05999755859375,69.27999877929688,142.66000366210938,91.83999633789062,77.2300033569336,102.37999725341797,129.60000610351562\n2008-05-19,51.709999084472656,34.099998474121094,108.05999755859375,54.400001525878906,78.19999694824219,88.6500015258789,37.709999084472656,46.959999084472656,45.790000915527344,89.5,21.23476791381836,105.69000244140625,25.5,41.2400016784668,51.6533317565918,52.98332977294922,73.7699966430664,68.87999725341797,143.0500030517578,91.95999908447266,77.44000244140625,102.62999725341797,130.22999572753906\n2008-05-20,50.813331604003906,33.90999984741211,108.70999908447266,53.91999816894531,77.4800033569336,88.91999816894531,37.599998474121094,46.31999969482422,46.029998779296875,90.38999938964844,20.73923683166504,105.7300033569336,25.100000381469727,41.52000045776367,50.703330993652344,50.79999923706055,73.16999816894531,68.06999969482422,141.88999938964844,92.44000244140625,77.41000366210938,102.7699966430664,128.30999755859375\n2008-05-21,50.29666519165039,33.540000915527344,108.83000183105469,52.959999084472656,76.5999984741211,88.70999908447266,37.29999923706055,45.7599983215332,44.68000030517578,89.05000305175781,20.211210250854492,105.2699966430664,24.440000534057617,41.310001373291016,50.2400016784668,50.706668853759766,72.22000122070312,67.11000061035156,139.49000549316406,92.45999908447266,77.38999938964844,102.5999984741211,126.05999755859375\n2008-05-22,50.44333267211914,33.849998474121094,108.06999969482422,53.720001220703125,77.48999786376953,88.12999725341797,37.630001068115234,46.41999816894531,44.47999954223633,87.75,20.324939727783203,104.11000061035156,24.530000686645508,41.54999923706055,50.473331451416016,51.18000030517578,73.55000305175781,68.02999877929688,139.50999450683594,91.37000274658203,77.08000183105469,102.27999877929688,126.0199966430664\n2008-05-23,49.563331604003906,33.34000015258789,108.48999786376953,53.279998779296875,76.61000061035156,88.5199966430664,37.16999816894531,45.81999969482422,43.869998931884766,86.26000213623047,20.024370193481445,104.58999633789062,24.479999542236328,40.90999984741211,49.69667053222656,49.86333084106445,72.30000305175781,66.9800033569336,137.63999938964844,91.7699966430664,77.41000366210938,102.51000213623047,124.61000061035156\n2008-05-27,49.483333587646484,33.38999938964844,107.73999786376953,53.439998626708984,76.45999908447266,88.08999633789062,37.13999938964844,45.7599983215332,43.66999816894531,85.69999694824219,20.129976272583008,103.95999908447266,24.8799991607666,41.119998931884766,50.086669921875,50.056671142578125,72.0999984741211,67.12999725341797,138.66000366210938,91.1500015258789,76.9800033569336,102.26000213623047,125.43000030517578\n2008-05-28,50.150001525878906,33.52000045776367,106.7699966430664,52.84000015258789,76.44999694824219,87.43000030517578,37.349998474121094,45.959999084472656,44.7599983215332,87.51000213623047,20.016246795654297,103.29000091552734,25.020000457763672,41.150001525878906,50.0766716003418,49.98332977294922,72.5,66.69999694824219,139.3000030517578,90.33999633789062,76.58000183105469,102.0,125.83999633789062\n2008-05-29,50.2599983215332,33.34000015258789,106.36000061035156,53.439998626708984,76.27999877929688,87.0199966430664,37.20000076293945,45.68000030517578,44.459999084472656,85.12000274658203,20.373680114746094,102.79000091552734,25.200000762939453,41.59000015258789,49.970001220703125,50.68333053588867,72.0,67.2300033569336,140.0,89.69000244140625,76.44999694824219,101.83999633789062,126.2300033569336\n2008-05-30,50.43333435058594,33.529998779296875,106.77999877929688,54.15999984741211,76.70999908447266,87.30999755859375,37.5,45.58000183105469,44.5099983215332,86.0,20.11372947692871,103.19999694824219,25.350000381469727,41.310001373291016,50.09333038330078,50.73332977294922,72.08999633789062,67.91000366210938,140.35000610351562,90.27999877929688,76.5,101.76000213623047,126.12999725341797\n2008-06-02,49.83333206176758,33.02000045776367,106.30999755859375,54.279998779296875,75.91000366210938,87.5199966430664,36.810001373291016,44.900001525878906,44.16999816894531,86.51000213623047,19.813159942626953,103.08000183105469,24.989999771118164,41.0099983215332,49.263328552246094,50.99666976928711,71.19999694824219,67.75,138.89999389648438,90.30000305175781,76.58999633789062,102.06999969482422,125.16000366210938\n2008-06-03,48.93333435058594,32.790000915527344,106.30999755859375,54.2400016784668,75.75,87.9800033569336,36.709999084472656,45.2400016784668,44.220001220703125,84.6500015258789,19.748172760009766,103.4800033569336,24.850000381469727,40.650001525878906,48.7400016784668,49.099998474121094,70.94999694824219,67.44000244140625,138.08999633789062,90.94999694824219,76.88999938964844,102.18000030517578,123.95999908447266\n2008-06-04,48.50666809082031,32.59000015258789,105.76000213623047,54.880001068115234,75.30999755859375,87.66000366210938,36.400001525878906,44.63999938964844,44.029998779296875,83.38999938964844,19.626319885253906,103.16000366210938,24.899999618530273,41.13999938964844,48.76667022705078,48.53667068481445,70.25,68.19999694824219,138.02000427246094,90.13999938964844,76.5199966430664,102.19000244140625,123.98999786376953\n2008-06-05,50.04999923706055,33.15999984741211,105.43000030517578,55.31999969482422,76.55999755859375,87.19999694824219,37.04999923706055,45.439998626708984,45.5099983215332,87.73999786376953,20.016246795654297,102.61000061035156,25.40999984741211,41.630001068115234,49.39332962036133,50.126670837402344,71.63999938964844,68.62000274658203,140.77999877929688,89.5999984741211,76.16999816894531,102.05999755859375,126.11000061035156\n2008-06-06,48.23666763305664,32.380001068115234,106.72000122070312,53.36000061035156,74.36000061035156,87.95999908447266,36.08000183105469,44.36000061035156,44.16999816894531,86.0199966430664,18.952072143554688,103.12000274658203,24.719999313354492,40.540000915527344,48.15999984741211,47.189998626708984,69.72000122070312,66.55000305175781,136.2899932861328,90.76000213623047,76.55999755859375,102.26000213623047,122.12000274658203\n2008-06-09,48.11333465576172,32.4900016784668,106.16000366210938,53.439998626708984,74.26000213623047,87.33000183105469,36.060001373291016,44.459999084472656,44.84000015258789,88.55000305175781,18.692119598388672,103.02999877929688,24.670000076293945,41.16999816894531,47.8466682434082,47.453330993652344,69.5999984741211,66.29000091552734,136.6199951171875,90.76000213623047,75.93000030517578,101.69999694824219,122.95999908447266\n2008-06-10,47.003334045410156,31.889999389648438,105.58999633789062,52.279998779296875,73.0,86.80999755859375,35.41999816894531,43.720001220703125,44.27000045776367,86.37000274658203,18.748985290527344,102.44000244140625,24.559999465942383,41.130001068115234,47.033329010009766,46.220001220703125,68.5,65.11000061035156,135.94000244140625,90.16999816894531,75.5,101.3499984741211,122.95999908447266\n2008-06-11,46.29999923706055,31.329999923706055,105.79000091552734,51.52000045776367,72.06999969482422,86.9000015258789,34.83000183105469,43.02000045776367,43.47999954223633,86.9000015258789,18.2047119140625,102.4000015258789,23.93000030517578,41.09000015258789,46.650001525878906,45.099998474121094,67.44999694824219,64.30000305175781,133.94000244140625,89.95999908447266,75.94000244140625,101.63999938964844,121.05000305175781\n2008-06-12,46.56999969482422,31.25,104.80000305175781,51.400001525878906,71.81999969482422,86.13999938964844,34.540000915527344,43.040000915527344,43.459999084472656,85.58000183105469,18.70024299621582,101.52999877929688,24.200000762939453,40.91999816894531,46.236671447753906,46.209999084472656,67.31999969482422,63.93000030517578,134.4499969482422,89.05999755859375,75.11000061035156,101.27999877929688,121.62999725341797\n2008-06-13,47.073333740234375,31.610000610351562,104.79000091552734,51.91999816894531,72.4800033569336,85.94000244140625,34.70000076293945,43.439998626708984,44.540000915527344,86.5999984741211,18.99268913269043,101.0,24.459999084472656,41.290000915527344,46.586669921875,46.11333084106445,67.88999938964844,64.5,136.14999389648438,88.87000274658203,75.18000030517578,101.25,123.0999984741211\n2008-06-16,47.233333587646484,31.84000015258789,105.05000305175781,52.400001525878906,72.8499984741211,85.94999694824219,34.90999984741211,43.63999938964844,44.5,86.91000366210938,19.171405792236328,101.36000061035156,24.520000457763672,41.33000183105469,46.47666931152344,46.49332809448242,68.2300033569336,64.81999969482422,136.22999572753906,88.88999938964844,75.25,101.29000091552734,122.66000366210938\n2008-06-17,47.43333435058594,32.040000915527344,105.3499984741211,52.7599983215332,73.06999969482422,86.23999786376953,34.97999954223633,43.939998626708984,44.7400016784668,88.3499984741211,18.610885620117188,101.69000244140625,24.420000076293945,41.560001373291016,46.81999969482422,46.2599983215332,68.41000366210938,65.29000091552734,135.57000732421875,89.06999969482422,75.5,101.44999694824219,121.93000030517578\n2008-06-18,47.20333480834961,31.809999465942383,105.91999816894531,52.20000076293945,72.47000122070312,86.70999908447266,34.599998474121094,43.459999084472656,44.439998626708984,88.69000244140625,18.30219268798828,102.19999694824219,24.15999984741211,41.400001525878906,46.686668395996094,46.82332992553711,67.69999694824219,64.83999633789062,134.25,89.81999969482422,75.75,101.62999725341797,120.33000183105469\n2008-06-19,47.276668548583984,32.150001525878906,105.26000213623047,52.040000915527344,72.33000183105469,86.20999908447266,34.560001373291016,43.400001525878906,44.52000045776367,86.55999755859375,18.497156143188477,101.66999816894531,24.25,41.45000076293945,46.880001068115234,46.89332962036133,67.5999984741211,64.7300033569336,134.4199981689453,89.29000091552734,75.55999755859375,101.37000274658203,120.62999725341797\n2008-06-20,45.733333587646484,31.170000076293945,105.5999984741211,50.31999969482422,70.75,86.61000061035156,33.810001373291016,42.65999984741211,43.41999816894531,85.75,18.017871856689453,101.7300033569336,23.75,40.66999816894531,45.543331146240234,44.470001220703125,66.37999725341797,62.900001525878906,131.5800018310547,89.80999755859375,75.70999908447266,101.44000244140625,118.23999786376953\n2008-06-23,45.86666488647461,31.15999984741211,105.5999984741211,50.68000030517578,70.73999786376953,86.56999969482422,33.7400016784668,42.81999969482422,43.70000076293945,89.13999938964844,17.449228286743164,101.69000244140625,23.530000686645508,41.15999984741211,45.90666961669922,44.6733283996582,66.0999984741211,63.060001373291016,131.4499969482422,90.0,75.44999694824219,101.44999694824219,118.33000183105469\n2008-06-24,45.663333892822266,31.010000228881836,106.23999786376953,50.279998779296875,70.41999816894531,87.02999877929688,33.66999816894531,42.47999954223633,42.869998931884766,87.44999694824219,17.652315139770508,101.62999725341797,23.5,40.81999969482422,45.91667175292969,44.44667053222656,65.8499984741211,62.70000076293945,131.19000244140625,90.5999984741211,75.7699966430664,101.55999755859375,117.94000244140625\n2008-06-25,46.04999923706055,30.229999542236328,106.31999969482422,50.79999923706055,69.8499984741211,87.0199966430664,32.90999984741211,41.79999923706055,43.0,87.12000274658203,17.611698150634766,101.70999908447266,23.700000762939453,41.29999923706055,46.09000015258789,45.436668395996094,66.62000274658203,63.529998779296875,131.80999755859375,90.63999938964844,75.80000305175781,101.5999984741211,117.91000366210938\n2008-06-26,44.470001220703125,29.600000381469727,107.23999786376953,49.52000045776367,68.08000183105469,87.51000213623047,32.16999816894531,40.880001068115234,41.939998626708984,86.48999786376953,16.97806739807129,101.79000091552734,23.25,40.06999969482422,45.133331298828125,43.133331298828125,65.0,62.0099983215332,128.22999572753906,91.25,75.80000305175781,101.63999938964844,114.66999816894531\n2008-06-27,44.900001525878906,29.6200008392334,107.75,49.79999923706055,68.26000213623047,87.94000244140625,32.06999969482422,39.63999938964844,41.900001525878906,87.25,16.709991455078125,101.69000244140625,22.940000534057617,39.72999954223633,45.5,43.353328704833984,65.12000274658203,62.5099983215332,127.52999877929688,92.31999969482422,76.0,101.63999938964844,113.45999908447266\n2008-06-30,45.2400016784668,29.440000534057617,107.8499984741211,49.880001068115234,68.66999816894531,88.0,32.220001220703125,41.439998626708984,41.72999954223633,88.4800033569336,16.45816421508789,101.4000015258789,22.90999984741211,40.70000076293945,45.36333084106445,43.61333084106445,65.61000061035156,62.470001220703125,127.9800033569336,92.33999633789062,76.25,101.7699966430664,113.41999816894531\n2008-07-01,44.43333435058594,29.260000228881836,107.1500015258789,50.08000183105469,67.93000030517578,87.47000122070312,32.0,41.02000045776367,40.959999084472656,88.8499984741211,16.50690460205078,100.91999816894531,22.75,40.90999984741211,44.276668548583984,43.38999938964844,64.66999816894531,62.220001220703125,128.3800048828125,91.79000091552734,75.9000015258789,101.45999908447266,113.7699966430664\n2008-07-02,43.16666793823242,29.0,107.81999969482422,49.0,66.8499984741211,87.68000030517578,31.31999969482422,40.119998931884766,39.209999084472656,86.16999816894531,16.255077362060547,100.8499984741211,22.450000762939453,40.79999923706055,43.650001525878906,41.82332992553711,63.810001373291016,61.04999923706055,126.18000030517578,92.2699966430664,75.63999938964844,101.33999633789062,112.1500015258789\n2008-07-03,43.0433349609375,28.989999771118164,108.0999984741211,49.15999984741211,67.27999877929688,87.70999908447266,31.59000015258789,40.34000015258789,39.45000076293945,84.9000015258789,16.198213577270508,100.72000122070312,22.350000381469727,40.380001068115234,43.73332977294922,41.880001068115234,64.5999984741211,61.16999816894531,126.30999755859375,92.06999969482422,75.69999694824219,101.77999877929688,113.05000305175781\n2008-07-07,42.88999938964844,28.950000762939453,108.05000305175781,49.15999984741211,66.69999694824219,88.12000274658203,31.200000762939453,39.84000015258789,39.650001525878906,82.7699966430664,15.662063598632812,101.19000244140625,22.600000381469727,39.97999954223633,43.65666961669922,42.806671142578125,63.52000045776367,61.20000076293945,125.0199966430664,92.48999786376953,75.73999786376953,101.83000183105469,112.20999908447266\n2008-07-08,43.41666793823242,29.040000915527344,107.97000122070312,48.959999084472656,67.05000305175781,88.33999633789062,31.43000030517578,40.34000015258789,39.22999954223633,81.4000015258789,16.67749786376953,101.73999786376953,22.829999923706055,40.189998626708984,43.96332931518555,43.630001068115234,64.1500015258789,61.130001068115234,127.23999786376953,93.08999633789062,76.16999816894531,101.70999908447266,113.73999786376953\n2008-07-09,42.540000915527344,29.020000457763672,108.5999984741211,48.15999984741211,66.18000030517578,88.76000213623047,31.079999923706055,40.119998931884766,39.29999923706055,79.8499984741211,15.72705078125,101.80999755859375,22.149999618530273,40.66999816894531,43.14332962036133,42.7400016784668,63.52000045776367,60.0,124.79000091552734,93.5,76.18000030517578,101.97000122070312,111.66000366210938\n2008-07-10,43.310001373291016,29.059999465942383,108.58999633789062,48.599998474121094,66.75,88.79000091552734,31.1200008392334,40.060001373291016,39.45000076293945,82.30000305175781,15.613322257995605,101.2300033569336,22.43000030517578,40.77000045776367,43.84000015258789,44.383331298828125,63.75,60.689998626708984,125.30000305175781,93.48999786376953,76.38999938964844,101.86000061035156,112.22000122070312\n2008-07-11,43.02000045776367,28.610000610351562,107.61000061035156,47.959999084472656,65.69999694824219,87.95999908447266,30.389999389648438,39.20000076293945,39.41999816894531,81.80000305175781,15.174654960632324,100.44999694824219,22.219999313354492,40.459999084472656,43.49666976928711,44.349998474121094,62.470001220703125,60.029998779296875,123.83999633789062,92.16000366210938,75.91000366210938,101.4800033569336,111.0\n2008-07-14,42.96666717529297,28.559999465942383,108.41000366210938,48.279998779296875,65.55999755859375,88.43000030517578,30.399999618530273,39.20000076293945,39.86000061035156,82.33999633789062,14.394801139831543,100.5,22.049999237060547,40.18000030517578,43.61000061035156,43.91999816894531,62.15999984741211,60.27000045776367,122.72000122070312,92.97000122070312,76.31999969482422,101.61000061035156,110.5\n2008-07-15,42.25,28.25,108.33999633789062,47.47999954223633,64.51000213623047,88.75,30.0,38.63999938964844,39.470001220703125,78.87000274658203,13.948009490966797,100.4800033569336,22.0,39.900001525878906,42.796669006347656,42.56666946411133,61.470001220703125,59.20000076293945,120.98999786376953,92.94000244140625,76.38999938964844,101.61000061035156,109.30000305175781\n2008-07-16,43.470001220703125,28.649999618530273,107.79000091552734,48.68000030517578,65.69999694824219,87.94000244140625,30.520000457763672,38.91999816894531,39.619998931884766,76.83999633789062,15.775792121887207,99.69000244140625,22.31999969482422,39.11000061035156,44.04999923706055,44.736671447753906,62.369998931884766,60.7400016784668,123.95999908447266,91.26000213623047,75.76000213623047,101.45999908447266,112.16999816894531\n2008-07-17,43.67333221435547,29.200000762939453,107.08999633789062,48.439998626708984,66.69999694824219,87.5199966430664,31.329999923706055,39.619998931884766,39.869998931884766,75.58000183105469,16.45816421508789,99.3499984741211,22.549999237060547,38.4900016784668,44.0966682434082,45.16667175292969,63.849998474121094,60.34000015258789,125.19999694824219,90.79000091552734,75.41000366210938,101.16999816894531,114.13999938964844\n2008-07-18,43.29666519165039,29.389999389648438,106.5999984741211,48.2400016784668,67.12999725341797,87.22000122070312,31.6299991607666,40.060001373291016,39.599998474121094,76.9000015258789,16.791227340698242,99.16999816894531,22.799999237060547,38.529998779296875,44.029998779296875,45.349998474121094,64.58000183105469,60.40999984741211,125.9800033569336,90.44999694824219,75.29000091552734,101.12999725341797,114.94999694824219\n2008-07-21,43.83333206176758,29.559999465942383,106.62000274658203,48.2400016784668,67.5199966430664,87.41999816894531,31.920000076293945,40.220001220703125,40.41999816894531,79.19999694824219,16.85621452331543,99.27999877929688,22.350000381469727,39.209999084472656,44.966670989990234,45.83332824707031,64.80999755859375,60.79999923706055,126.05000305175781,90.80000305175781,75.44999694824219,101.16999816894531,114.6500015258789\n2008-07-22,43.86000061035156,29.649999618530273,106.11000061035156,48.880001068115234,67.75,87.12000274658203,32.08000183105469,40.279998779296875,40.47999954223633,76.56999969482422,18.269699096679688,99.91999816894531,22.229999542236328,39.08000183105469,45.07332992553711,46.5966682434082,64.83000183105469,61.5,127.4800033569336,90.3499984741211,75.22000122070312,101.20999908447266,115.69999694824219\n2008-07-23,43.92333221435547,29.649999618530273,105.38999938964844,49.20000076293945,68.0,86.9800033569336,32.06999969482422,40.459999084472656,39.970001220703125,73.79000091552734,18.245328903198242,99.56999969482422,22.6299991607666,38.130001068115234,45.50333023071289,47.19667053222656,65.0199966430664,61.83000183105469,128.1699981689453,90.16999816894531,75.25,101.19999694824219,116.2300033569336\n2008-07-24,42.29999923706055,28.959999084472656,106.13999938964844,49.15999984741211,66.76000213623047,87.7300033569336,31.450000762939453,39.540000915527344,38.959999084472656,73.61000061035156,17.01868438720703,100.44999694824219,22.049999237060547,38.06999969482422,44.70000076293945,45.16999816894531,63.560001373291016,61.5,125.51000213623047,91.05000305175781,75.79000091552734,101.44999694824219,113.5999984741211\n2008-07-25,42.59000015258789,29.18000030517578,105.41000366210938,48.599998474121094,66.9000015258789,87.22000122070312,31.860000610351562,39.779998779296875,39.02000045776367,73.80999755859375,16.95369529724121,99.91999816894531,22.360000610351562,37.61000061035156,44.459999084472656,45.5099983215332,63.97999954223633,60.970001220703125,125.4800033569336,90.13999938964844,75.30999755859375,101.37000274658203,113.16999816894531\n2008-07-28,41.869998931884766,28.700000762939453,106.30999755859375,48.040000915527344,65.77999877929688,87.72000122070312,31.31999969482422,39.08000183105469,38.970001220703125,74.0999984741211,16.157594680786133,100.5,21.889999389648438,37.70000076293945,43.06999969482422,44.220001220703125,63.11000061035156,59.970001220703125,123.63999938964844,91.05000305175781,75.80999755859375,101.62999725341797,111.33999633789062\n2008-07-29,44.189998626708984,29.06999969482422,105.58999633789062,48.31999969482422,66.43000030517578,87.47000122070312,31.56999969482422,39.52000045776367,39.7400016784668,73.22000122070312,17.46547508239746,100.25,22.329999923706055,37.75,43.68000030517578,45.529998779296875,63.70000076293945,60.33000183105469,126.27999877929688,90.68000030517578,75.69000244140625,101.47000122070312,113.8499984741211\n2008-07-30,43.72999954223633,29.209999084472656,106.02999877929688,48.7599983215332,67.05000305175781,87.63999938964844,31.979999542236328,40.380001068115234,40.68000030517578,77.58000183105469,17.733549118041992,100.7300033569336,22.479999542236328,38.4900016784668,44.119998931884766,46.619998931884766,64.30999755859375,60.790000915527344,128.52999877929688,90.7699966430664,75.70999908447266,101.6500015258789,115.81999969482422\n2008-07-31,42.75,29.18000030517578,106.47000122070312,48.0,66.38999938964844,88.33999633789062,31.56999969482422,39.7400016784668,40.380001068115234,74.4000015258789,17.571081161499023,101.36000061035156,22.350000381469727,38.08000183105469,43.25,44.63999938964844,63.720001220703125,60.0099983215332,126.83000183105469,91.66999816894531,75.97000122070312,101.83000183105469,113.69999694824219\n2008-08-01,42.459999084472656,28.75,105.94999694824219,47.31999969482422,65.4000015258789,88.08000183105469,31.09000015258789,39.459999084472656,39.650001525878906,74.38999938964844,17.571081161499023,100.52999877929688,22.100000381469727,36.9900016784668,42.41999816894531,45.380001068115234,62.880001068115234,58.95000076293945,126.16000366210938,91.54000091552734,75.80000305175781,101.47000122070312,113.12000274658203\n2008-08-04,41.15999984741211,28.610000610351562,105.6500015258789,46.119998931884766,64.77999877929688,88.0199966430664,31.010000228881836,39.0,37.93000030517578,70.88999938964844,17.42485809326172,100.54000091552734,22.209999084472656,36.59000015258789,41.869998931884766,44.16999816894531,62.77000045776367,57.77000045776367,124.98999786376953,91.33000183105469,75.66000366210938,101.44999694824219,112.7699966430664\n2008-08-05,41.689998626708984,29.229999542236328,105.08000183105469,47.15999984741211,66.41999816894531,87.56999969482422,31.760000228881836,40.2400016784668,38.369998931884766,71.41999816894531,18.31031608581543,100.0999984741211,22.6299991607666,36.88999938964844,42.380001068115234,45.02000045776367,64.43000030517578,58.810001373291016,128.36000061035156,90.6500015258789,75.3499984741211,101.3499984741211,116.01000213623047\n2008-08-06,42.52000045776367,29.31999969482422,104.80999755859375,46.880001068115234,66.44000244140625,87.5999984741211,32.02000045776367,40.15999984741211,38.75,73.05000305175781,18.123476028442383,100.25,22.950000762939453,37.09000015258789,42.61000061035156,45.2400016784668,64.48999786376953,58.68000030517578,128.92999267578125,90.27999877929688,75.25,101.41999816894531,116.48999786376953\n2008-08-07,41.060001373291016,28.84000015258789,105.88999938964844,45.84000015258789,65.11000061035156,88.41999816894531,31.559999465942383,39.599998474121094,38.630001068115234,72.19999694824219,17.229894638061523,101.08000183105469,22.90999984741211,37.060001373291016,41.61000061035156,42.68000030517578,63.310001373291016,57.310001373291016,127.01000213623047,91.75,75.7300033569336,101.63999938964844,114.58999633789062\n2008-08-08,41.15999984741211,28.6299991607666,105.75,46.52000045776367,65.37999725341797,88.37999725341797,31.600000381469727,39.599998474121094,38.470001220703125,70.9800033569336,17.822908401489258,101.18000030517578,23.350000381469727,37.16999816894531,41.93000030517578,43.75,63.380001068115234,57.959999084472656,129.3699951171875,92.0,75.69999694824219,101.5,116.94999694824219\n2008-08-11,40.72999954223633,28.399999618530273,104.80000305175781,46.79999923706055,65.31999969482422,87.94999694824219,31.440000534057617,39.52000045776367,38.52000045776367,70.94999694824219,18.123476028442383,100.72000122070312,23.5,37.58000183105469,41.72999954223633,42.900001525878906,63.31999969482422,58.18000030517578,130.7100067138672,91.12000274658203,75.37999725341797,101.29000091552734,117.80000305175781\n2008-08-12,40.38999938964844,28.260000228881836,105.29000091552734,46.47999954223633,64.8499984741211,88.55999755859375,31.209999084472656,38.7400016784668,38.84000015258789,70.98999786376953,17.205524444580078,101.33000183105469,23.549999237060547,37.13999938964844,41.20000076293945,41.439998626708984,62.84000015258789,57.720001220703125,129.35000610351562,91.97000122070312,75.72000122070312,101.6500015258789,116.56999969482422\n2008-08-13,40.380001068115234,27.829999923706055,105.27999877929688,45.68000030517578,63.83000183105469,88.37000274658203,30.719999313354492,38.439998626708984,39.68000030517578,73.5,16.709991455078125,100.80000305175781,23.459999084472656,37.13999938964844,40.959999084472656,41.0,61.75,56.849998474121094,128.57000732421875,91.6500015258789,75.5199966430664,101.66999816894531,115.4000015258789\n2008-08-14,40.90999984741211,27.65999984741211,105.81999969482422,45.400001525878906,63.58000183105469,88.63999938964844,30.56999969482422,38.380001068115234,39.599998474121094,72.1500015258789,17.229894638061523,101.08999633789062,23.639999389648438,36.81999969482422,40.779998779296875,40.95000076293945,61.38999938964844,56.599998474121094,129.5399932861328,92.23999786376953,75.70999908447266,101.62999725341797,116.41000366210938\n2008-08-15,40.27000045776367,27.3799991607666,106.08000183105469,45.08000183105469,63.15999984741211,88.97000122070312,30.3799991607666,38.08000183105469,39.349998474121094,70.80000305175781,17.35174560546875,101.31999969482422,23.729999542236328,36.95000076293945,40.38999938964844,41.0,61.06999969482422,56.20000076293945,130.1699981689453,93.04000091552734,75.94999694824219,101.81999969482422,116.52999877929688\n2008-08-18,39.59000015258789,27.18000030517578,106.18000030517578,45.47999954223633,62.84000015258789,89.19000244140625,30.1299991607666,37.900001525878906,38.9900016784668,69.9000015258789,16.68562126159668,101.36000061035156,23.43000030517578,37.0,40.040000915527344,40.0,60.599998474121094,56.439998626708984,128.38999938964844,93.41000366210938,76.1500015258789,101.55000305175781,114.86000061035156\n2008-08-19,39.2599983215332,26.969999313354492,106.06999969482422,44.7599983215332,62.130001068115234,89.05999755859375,29.799999237060547,37.439998626708984,38.75,72.41000366210938,16.198213577270508,101.19999694824219,23.020000457763672,37.20000076293945,39.56999969482422,39.43000030517578,59.970001220703125,55.59000015258789,126.98999786376953,93.05000305175781,76.01000213623047,101.69000244140625,113.48999786376953\n2008-08-20,40.2599983215332,27.040000915527344,106.51000213623047,45.2400016784668,62.5,89.31999969482422,29.8799991607666,37.619998931884766,39.43000030517578,74.5,16.531274795532227,101.20999908447266,23.06999969482422,37.34000015258789,40.47999954223633,41.61000061035156,60.099998474121094,56.209999084472656,127.58000183105469,93.30999755859375,76.18000030517578,101.72000122070312,114.04000091552734\n2008-08-21,40.20000076293945,27.18000030517578,106.69000244140625,45.52000045776367,62.75,89.12999725341797,30.040000915527344,37.959999084472656,39.77000045776367,76.37000274658203,16.2307071685791,100.61000061035156,22.979999542236328,37.70000076293945,40.279998779296875,40.900001525878906,60.459999084472656,56.5,127.80000305175781,93.13999938964844,76.16000366210938,101.5999984741211,114.05000305175781\n2008-08-22,40.16999816894531,27.290000915527344,106.27999877929688,45.20000076293945,63.040000915527344,88.87000274658203,30.25,38.08000183105469,39.75,74.62000274658203,16.84809112548828,100.6500015258789,23.299999237060547,37.849998474121094,40.619998931884766,41.380001068115234,60.93000030517578,56.5,129.64999389648438,93.08000183105469,76.0,101.62000274658203,116.31999969482422\n2008-08-25,39.34000015258789,26.8700008392334,106.68000030517578,44.79999923706055,62.04999923706055,89.45999908447266,29.690000534057617,37.7599983215332,38.88999938964844,73.6500015258789,16.255077362060547,101.30000305175781,23.0,37.45000076293945,39.79999923706055,40.959999084472656,59.88999938964844,55.7400016784668,127.0199966430664,94.01000213623047,76.20999908447266,101.81999969482422,113.8499984741211\n2008-08-26,39.40999984741211,26.969999313354492,106.72000122070312,45.040000915527344,62.36000061035156,89.48999786376953,29.729999542236328,37.79999923706055,39.099998474121094,75.1500015258789,16.385053634643555,101.41999816894531,22.90999984741211,37.86000061035156,40.18000030517578,41.959999084472656,60.130001068115234,56.130001068115234,127.38999938964844,94.08999633789062,76.30999755859375,101.95999908447266,114.06999969482422\n2008-08-27,40.25,27.139999389648438,107.0,45.2400016784668,62.95000076293945,89.62000274658203,30.040000915527344,38.20000076293945,39.459999084472656,76.33999633789062,16.701868057250977,101.26000213623047,23.1299991607666,38.130001068115234,40.59000015258789,43.43000030517578,60.63999938964844,56.22999954223633,128.6300048828125,94.25,76.33000183105469,102.0,115.0\n2008-08-28,40.529998779296875,27.549999237060547,106.66999816894531,45.599998474121094,63.7599983215332,89.48999786376953,30.56999969482422,38.720001220703125,40.02000045776367,75.0,17.376117706298828,101.23999786376953,23.270000457763672,38.189998626708984,41.310001373291016,42.68000030517578,61.52000045776367,56.900001525878906,130.19000244140625,94.26000213623047,76.4000015258789,102.04000091552734,117.12999725341797\n2008-08-29,40.04999923706055,27.399999618530273,106.36000061035156,45.63999938964844,63.56999969482422,89.37999725341797,30.510000228881836,38.400001525878906,39.75,74.6500015258789,17.400487899780273,101.04000091552734,22.75,37.65999984741211,41.11000061035156,42.11000061035156,61.27000045776367,56.939998626708984,128.7899932861328,93.83999633789062,76.30000305175781,101.9000015258789,115.44999694824219\n2008-09-02,38.84000015258789,27.219999313354492,105.48999786376953,45.040000915527344,62.59000015258789,89.56999969482422,30.31999969482422,37.2400016784668,38.75,70.55000305175781,17.64419174194336,100.9800033569336,22.6200008392334,37.20000076293945,40.220001220703125,41.33000183105469,60.099998474121094,56.220001220703125,127.98999786376953,94.37000274658203,76.26000213623047,101.66999816894531,115.16000366210938\n2008-09-03,38.20000076293945,27.25,105.30999755859375,45.2400016784668,62.33000183105469,89.79000091552734,30.079999923706055,37.0,38.54999923706055,70.27999877929688,17.92038917541504,101.18000030517578,22.31999969482422,36.61000061035156,39.7599983215332,40.189998626708984,60.18000030517578,55.939998626708984,127.87999725341797,94.7699966430664,76.36000061035156,101.72000122070312,115.51000213623047\n2008-09-04,36.439998626708984,26.059999465942383,105.1500015258789,43.79999923706055,59.65999984741211,90.23999786376953,28.469999313354492,35.720001220703125,37.18000030517578,68.69999694824219,17.043054580688477,101.20999908447266,21.520000457763672,36.150001525878906,37.650001525878906,38.20000076293945,57.400001525878906,53.75,124.02999877929688,95.52999877929688,76.4000015258789,101.70999908447266,112.19999694824219\n2008-09-05,36.959999084472656,25.559999465942383,105.18000030517578,43.79999923706055,59.439998626708984,90.04000091552734,28.280000686645508,35.52000045776367,37.220001220703125,68.41999816894531,17.660438537597656,101.11000061035156,21.520000457763672,35.38999938964844,37.7599983215332,39.16999816894531,57.02000045776367,53.970001220703125,124.41999816894531,95.4800033569336,76.45999908447266,101.68000030517578,112.3499984741211\n2008-09-08,37.41999816894531,25.770000457763672,105.58999633789062,44.880001068115234,60.77000045776367,90.05000305175781,28.690000534057617,36.400001525878906,37.150001525878906,67.94999694824219,18.42404556274414,101.27999877929688,21.780000686645508,36.279998779296875,39.130001068115234,39.63999938964844,57.880001068115234,55.2599983215332,126.98999786376953,95.87999725341797,77.0,101.51000213623047,115.16000366210938\n2008-09-09,35.31999969482422,25.1200008392334,105.7699966430664,43.63999938964844,58.79999923706055,90.45999908447266,27.790000915527344,35.58000183105469,35.970001220703125,63.25,17.24614143371582,101.62999725341797,21.399999618530273,35.13999938964844,36.93000030517578,37.560001373291016,56.36000061035156,53.56999969482422,123.22000122070312,96.83000183105469,77.13999938964844,101.79000091552734,112.52999877929688\n2008-09-10,35.88999938964844,25.110000610351562,105.72000122070312,44.20000076293945,59.369998931884766,90.2300033569336,28.049999237060547,35.81999969482422,36.279998779296875,65.73999786376953,17.034931182861328,101.58999633789062,21.299999237060547,35.529998779296875,37.619998931884766,38.099998474121094,56.66999816894531,54.0,123.72000122070312,96.2300033569336,77.13999938964844,101.88999938964844,113.0\n2008-09-11,35.36000061035156,25.15999984741211,105.80000305175781,43.959999084472656,59.2400016784668,90.06999969482422,28.06999969482422,35.65999984741211,36.900001525878906,66.68000030517578,17.42485809326172,100.80000305175781,21.649999618530273,35.810001373291016,37.33000183105469,37.310001373291016,56.599998474121094,53.939998626708984,125.51000213623047,96.18000030517578,77.08999633789062,101.48999786376953,114.86000061035156\n2008-09-12,36.540000915527344,25.68000030517578,105.05000305175781,44.2400016784668,60.400001525878906,89.62000274658203,28.6200008392334,36.81999969482422,38.08000183105469,68.93000030517578,17.181154251098633,100.02999877929688,21.75,36.47999954223633,38.470001220703125,37.43000030517578,57.869998931884766,54.45000076293945,126.08999633789062,94.94000244140625,76.83999633789062,101.62000274658203,114.79000091552734\n2008-09-15,33.66999816894531,24.81999969482422,105.66999816894531,43.0,57.83000183105469,91.33999633789062,27.510000228881836,34.779998779296875,36.5,63.650001525878906,15.50771713256836,99.29000091552734,20.700000762939453,35.209999084472656,36.209999084472656,34.84000015258789,55.29999923706055,52.70000076293945,120.08999633789062,98.0199966430664,77.41999816894531,100.81999969482422,109.80000305175781\n2008-09-16,33.959999084472656,24.530000686645508,104.62000274658203,42.599998474121094,57.400001525878906,91.08000183105469,27.360000610351562,34.119998931884766,36.900001525878906,66.33999633789062,16.669374465942383,92.98999786376953,21.09000015258789,34.68000030517578,36.540000915527344,35.400001525878906,54.619998931884766,52.54999923706055,122.0999984741211,98.0,76.66999816894531,98.6500015258789,110.66000366210938\n2008-09-17,31.549999237060547,23.979999542236328,105.0,41.08000183105469,55.209999084472656,91.9000015258789,26.399999618530273,33.540000915527344,36.209999084472656,64.94999694824219,15.069049835205078,88.7300033569336,19.920000076293945,33.0,34.290000915527344,30.8799991607666,52.97999954223633,50.31999969482422,116.61000061035156,98.48999786376953,76.7699966430664,97.7699966430664,106.76000213623047\n2008-09-18,34.209999084472656,24.81999969482422,103.61000061035156,42.91999816894531,57.720001220703125,90.81999969482422,27.350000381469727,35.0,36.20000076293945,66.88999938964844,16.255077362060547,89.94000244140625,20.770000457763672,34.209999084472656,36.189998626708984,35.08000183105469,55.13999938964844,52.40999984741211,120.06999969482422,97.05000305175781,75.68000030517578,96.72000122070312,109.97000122070312\n2008-09-19,38.470001220703125,26.489999771118164,104.13999938964844,45.2400016784668,61.810001373291016,89.19999694824219,29.459999084472656,37.099998474121094,38.279998779296875,71.25,18.180341720581055,92.75,20.850000381469727,35.0,38.08000183105469,39.060001373291016,59.040000915527344,55.29999923706055,124.12000274658203,93.97000122070312,76.61000061035156,103.0199966430664,113.56999969482422\n2008-09-22,35.959999084472656,25.84000015258789,104.5,43.68000030517578,59.70000076293945,89.01000213623047,28.530000686645508,36.13999938964844,37.790000915527344,70.0,16.693744659423828,93.30000305175781,20.309999465942383,34.130001068115234,38.22999954223633,36.619998931884766,58.09000015258789,54.290000915527344,121.30999755859375,93.95999908447266,76.41000366210938,98.47000122070312,110.5\n2008-09-23,34.84000015258789,25.440000534057617,103.43000030517578,43.279998779296875,58.86000061035156,89.01000213623047,28.020000457763672,35.52000045776367,36.90999984741211,67.69000244140625,16.645004272460938,92.33999633789062,20.299999237060547,33.540000915527344,37.779998779296875,35.75,56.47999954223633,53.7599983215332,118.55000305175781,93.5999984741211,76.6500015258789,98.44999694824219,108.5\n2008-09-24,35.2400016784668,25.389999389648438,102.91999816894531,43.880001068115234,59.029998779296875,89.23999786376953,27.889999389648438,35.47999954223633,36.18000030517578,67.88999938964844,16.45816421508789,92.0999984741211,20.350000381469727,33.849998474121094,38.31999969482422,36.20000076293945,56.31999969482422,54.13999938964844,118.93000030517578,94.01000213623047,76.63999938964844,98.7699966430664,108.30000305175781\n2008-09-25,37.04999923706055,25.989999771118164,102.87999725341797,44.63999938964844,60.38999938964844,88.97000122070312,28.700000762939453,36.13999938964844,36.08000183105469,69.55000305175781,16.91307830810547,92.5,20.700000762939453,34.52000045776367,38.439998626708984,37.18000030517578,57.900001525878906,55.0,120.79000091552734,93.81999969482422,76.88999938964844,98.5,110.2699966430664\n2008-09-26,35.790000915527344,25.56999969482422,102.66000366210938,44.400001525878906,59.75,88.91000366210938,28.459999084472656,35.599998474121094,35.2400016784668,67.69999694824219,17.376117706298828,90.0,20.799999237060547,34.529998779296875,38.13999938964844,36.150001525878906,57.15999984741211,54.66999816894531,120.8499984741211,94.5,76.12000274658203,97.2300033569336,111.1500015258789\n2008-09-29,31.610000610351562,23.15999984741211,103.06999969482422,40.959999084472656,53.08000183105469,90.1500015258789,25.510000228881836,31.31999969482422,32.70000076293945,59.650001525878906,15.085296630859375,81.80000305175781,19.0,32.720001220703125,33.86000061035156,30.8799991607666,51.130001068115234,49.93000030517578,111.37999725341797,97.25,76.48999786376953,96.94999694824219,104.75\n2008-09-30,34.16999816894531,23.899999618530273,101.30000305175781,42.63999938964844,56.29999923706055,88.95999908447266,26.75,33.29999923706055,33.400001525878906,63.29999923706055,16.157594680786133,89.79000091552734,19.850000381469727,33.22999954223633,35.900001525878906,34.470001220703125,53.369998931884766,51.72999954223633,115.98999786376953,94.87999725341797,75.62000274658203,97.75,108.36000061035156\n2008-10-01,34.58000183105469,23.559999465942383,101.83000183105469,42.119998931884766,55.880001068115234,89.27999877929688,26.639999389648438,33.599998474121094,32.849998474121094,62.2599983215332,16.791227340698242,90.20999908447266,19.670000076293945,33.09000015258789,35.86000061035156,34.25,53.06999969482422,51.5099983215332,116.05999755859375,95.77999877929688,74.94999694824219,99.2300033569336,108.69999694824219\n2008-10-02,31.549999237060547,22.440000534057617,101.62000274658203,40.31999969482422,53.439998626708984,89.77999877929688,25.200000762939453,32.400001525878906,30.489999771118164,58.709999084472656,15.954508781433105,88.9000015258789,18.899999618530273,32.61000061035156,33.70000076293945,32.709999084472656,50.779998779296875,49.11000061035156,111.8499984741211,96.55000305175781,76.41000366210938,99.91999816894531,105.2699966430664\n2008-10-03,30.719999313354492,22.290000915527344,101.86000061035156,39.52000045776367,53.22999954223633,90.12000274658203,25.040000915527344,32.20000076293945,30.190000534057617,58.0099983215332,15.255889892578125,88.86000061035156,18.6299991607666,32.119998931884766,33.29999923706055,32.31999969482422,50.63999938964844,48.369998931884766,110.33999633789062,97.4000015258789,75.98999786376953,99.26000213623047,103.19999694824219\n2008-10-06,28.40999984741211,21.040000915527344,101.77999877929688,38.2400016784668,50.220001220703125,90.8499984741211,23.3700008392334,30.31999969482422,28.700000762939453,54.88999938964844,14.45978832244873,87.83000183105469,17.600000381469727,30.549999237060547,29.950000762939453,30.100000381469727,47.83000183105469,45.70000076293945,104.72000122070312,99.16999816894531,75.37999725341797,96.83999633789062,99.9000015258789\n2008-10-07,26.200000762939453,20.1200008392334,100.91000366210938,36.84000015258789,47.869998931884766,90.77999877929688,22.459999084472656,29.100000381469727,27.219999313354492,51.880001068115234,12.932575225830078,89.47000122070312,16.700000762939453,29.299999237060547,29.65999984741211,28.3799991607666,45.5,44.5,100.02999877929688,98.87000274658203,75.5999984741211,97.33999633789062,95.06999969482422\n2008-10-08,26.200000762939453,19.510000228881836,97.93000030517578,35.47999954223633,46.79999923706055,89.62000274658203,21.84000015258789,28.420000076293945,28.100000381469727,52.86000061035156,12.412672996520996,88.83000183105469,16.549999237060547,28.790000915527344,28.200000762939453,28.09000015258789,44.40999984741211,42.9900016784668,97.51000213623047,97.44999694824219,74.4800033569336,96.70999908447266,91.4000015258789\n2008-10-09,24.270000457763672,18.260000228881836,97.33999633789062,33.84000015258789,44.0,88.72000122070312,20.75,26.65999984741211,26.299999237060547,45.25,11.121039390563965,86.45999908447266,16.0,26.850000381469727,26.540000915527344,26.0,41.529998779296875,40.790000915527344,90.69999694824219,96.62999725341797,72.16000366210938,96.61000061035156,85.55000305175781\n2008-10-10,24.549999237060547,17.84000015258789,95.37999725341797,32.36000061035156,42.36000061035156,87.68000030517578,20.34000015258789,25.979999542236328,25.68000030517578,43.400001525878906,12.266449928283691,81.69999694824219,15.899999618530273,25.760000228881836,26.100000381469727,27.43000030517578,40.59000015258789,39.22999954223633,88.5,95.94999694824219,69.95999908447266,90.87999725341797,83.75\n2008-10-13,30.139999389648438,20.43000030517578,94.0,37.47999954223633,49.09000015258789,87.08000183105469,23.0,29.639999389648438,29.290000915527344,50.54999923706055,13.225020408630371,86.19999694824219,17.760000228881836,28.8700008392334,30.43000030517578,32.9900016784668,46.349998474121094,45.11000061035156,101.3499984741211,94.72000122070312,72.87000274658203,93.19999694824219,95.02999877929688\n2008-10-14,28.639999389648438,20.290000915527344,96.1500015258789,37.279998779296875,48.08000183105469,86.66999816894531,22.84000015258789,28.739999771118164,28.440000534057617,50.61000061035156,14.077985763549805,84.8499984741211,17.15999984741211,28.6299991607666,29.530000686645508,31.389999389648438,45.93000030517578,44.43000030517578,99.8499984741211,94.11000061035156,73.80000305175781,94.25,93.66999816894531\n2008-10-15,24.010000228881836,18.0,96.4800033569336,33.400001525878906,42.95000076293945,87.37999725341797,20.34000015258789,25.31999969482422,24.90999984741211,43.29999923706055,12.550771713256836,84.8499984741211,15.869999885559082,26.5,26.34000015258789,26.729999542236328,40.7599983215332,39.72999954223633,90.0199966430664,95.01000213623047,73.3499984741211,95.87000274658203,84.87000274658203\n2008-10-16,25.190000534057617,18.989999771118164,95.86000061035156,35.439998626708984,45.47999954223633,87.4000015258789,21.100000381469727,26.6200008392334,25.079999923706055,44.95000076293945,12.83509349822998,85.73999786376953,16.700000762939453,27.270000457763672,27.950000762939453,29.06999969482422,42.869998931884766,42.349998474121094,93.7699966430664,94.5199966430664,73.33999633789062,95.4800033569336,89.87000274658203\n2008-10-17,24.399999618530273,18.510000228881836,95.47000122070312,34.959999084472656,44.5099983215332,87.94999694824219,20.690000534057617,26.559999465942383,25.75,45.939998626708984,12.469536781311035,85.01000213623047,16.540000915527344,27.40999984741211,26.530000686645508,27.3700008392334,42.099998474121094,41.63999938964844,93.20999908447266,93.87000274658203,73.73999786376953,95.76000213623047,87.54000091552734\n2008-10-20,26.110000610351562,18.829999923706055,96.77999877929688,37.720001220703125,47.349998474121094,88.04000091552734,21.709999084472656,28.139999389648438,27.049999237060547,51.290000915527344,13.086920738220215,87.5999984741211,17.200000762939453,29.719999313354492,28.729999542236328,29.670000076293945,44.20000076293945,44.790000915527344,98.80999755859375,94.62000274658203,73.70999908447266,96.36000061035156,93.27999877929688\n2008-10-21,24.030000686645508,17.700000762939453,96.93000030517578,36.36000061035156,44.68000030517578,88.97000122070312,20.600000381469727,26.459999084472656,25.90999984741211,48.959999084472656,12.688870429992676,88.47000122070312,16.299999237060547,28.780000686645508,27.40999984741211,26.780000686645508,41.470001220703125,43.06999969482422,95.86000061035156,95.12000274658203,74.97000122070312,96.91000366210938,90.37999725341797\n2008-10-22,21.5,16.440000534057617,97.6500015258789,34.15999984741211,41.41999816894531,89.6500015258789,19.06999969482422,24.479999542236328,24.489999771118164,44.20000076293945,11.892769813537598,87.44999694824219,15.449999809265137,27.559999465942383,25.309999465942383,23.90999984741211,38.54999923706055,40.290000915527344,90.63999938964844,97.05000305175781,75.30999755859375,97.30000305175781,85.5\n2008-10-23,22.100000381469727,16.489999771118164,96.66000366210938,35.31999969482422,42.33000183105469,89.7699966430664,19.469999313354492,24.600000381469727,23.93000030517578,46.54999923706055,11.770917892456055,88.0,15.800000190734863,28.219999313354492,25.420000076293945,24.049999237060547,39.040000915527344,41.25,91.69000244140625,97.7699966430664,74.95999908447266,96.72000122070312,87.98999786376953\n2008-10-24,19.81999969482422,15.449999809265137,94.3499984741211,33.20000076293945,39.59000015258789,89.38999938964844,18.6200008392334,23.100000381469727,22.899999618530273,43.650001525878906,11.00731086730957,88.3499984741211,15.0600004196167,27.469999313354492,23.25,21.649999618530273,36.7400016784668,38.619998931884766,87.04000091552734,96.7300033569336,74.0999984741211,96.41999816894531,83.08999633789062\n2008-10-27,19.299999237060547,15.210000038146973,93.3499984741211,31.200000762939453,37.5099983215332,89.33999633789062,17.389999389648438,21.799999237060547,21.200000762939453,40.86000061035156,10.706742286682129,87.77999877929688,14.75,26.399999618530273,22.049999237060547,19.420000076293945,34.900001525878906,36.20000076293945,83.94999694824219,96.80000305175781,73.69999694824219,95.8499984741211,80.26000213623047\n2008-10-28,23.34000015258789,18.219999313354492,92.79000091552734,35.0,42.68000030517578,88.62000274658203,19.6299991607666,25.520000457763672,23.8700008392334,47.09000015258789,12.388301849365234,87.19999694824219,16.799999237060547,29.059999465942383,25.219999313354492,23.309999465942383,39.08000183105469,40.58000183105469,93.76000213623047,95.38999938964844,73.12999725341797,96.22000122070312,91.13999938964844\n2008-10-29,22.600000381469727,17.68000030517578,93.4000015258789,34.20000076293945,42.779998779296875,88.75,20.1200008392334,25.81999969482422,24.850000381469727,48.130001068115234,11.624695777893066,88.66999816894531,16.149999618530273,28.1299991607666,25.139999389648438,22.489999771118164,40.220001220703125,40.349998474121094,93.08000183105469,94.91000366210938,73.66000366210938,96.62000274658203,89.1500015258789\n2008-10-30,25.649999618530273,18.110000610351562,92.87999725341797,36.040000915527344,44.279998779296875,88.06999969482422,20.40999984741211,27.079999923706055,25.6299991607666,50.349998474121094,12.030869483947754,88.01000213623047,16.75,29.700000762939453,26.420000076293945,25.649999618530273,41.09000015258789,42.70000076293945,96.30000305175781,94.05000305175781,73.16999816894531,96.80999755859375,92.5\n2008-10-31,25.43000030517578,18.479999542236328,92.37000274658203,36.0,44.56999969482422,87.88999938964844,20.5,26.719999313354492,25.920000076293945,51.400001525878906,12.61575984954834,87.6500015258789,16.649999618530273,28.90999984741211,26.3799991607666,25.15999984741211,41.720001220703125,42.130001068115234,96.83000183105469,92.83000183105469,73.12999725341797,96.5,93.5\n2008-11-03,25.200000762939453,18.09000015258789,93.1500015258789,36.2400016784668,44.75,87.70999908447266,20.510000228881836,26.639999389648438,25.799999237060547,49.810001373291016,12.688870429992676,87.93000030517578,16.649999618530273,29.209999084472656,27.229999542236328,25.450000762939453,41.43000030517578,42.939998626708984,97.11000061035156,92.70999908447266,73.4000015258789,97.20999908447266,93.43000030517578\n2008-11-04,27.5,19.68000030517578,94.58999633789062,38.2400016784668,47.81999969482422,88.76000213623047,22.329999923706055,28.579999923706055,27.010000228881836,53.02000045776367,13.40373706817627,88.52999877929688,17.350000381469727,29.760000228881836,28.829999923706055,27.209999084472656,44.75,45.08000183105469,100.41000366210938,94.44999694824219,74.13999938964844,97.20999908447266,96.20999908447266\n2008-11-05,24.0,18.350000381469727,95.26000213623047,37.439998626708984,45.220001220703125,89.2300033569336,20.920000076293945,26.65999984741211,25.8799991607666,50.650001525878906,12.177091598510742,90.25,16.299999237060547,29.209999084472656,27.459999084472656,24.649999618530273,41.880001068115234,43.75,96.19000244140625,95.56999969482422,74.69999694824219,96.80999755859375,91.8499984741211\n2008-11-06,22.790000915527344,17.149999618530273,94.86000061035156,34.20000076293945,42.29999923706055,88.95999908447266,19.56999969482422,24.600000381469727,24.469999313354492,47.599998474121094,11.340373992919922,90.87000274658203,15.399999618530273,27.84000015258789,25.510000228881836,22.690000534057617,39.2400016784668,40.47999954223633,90.86000061035156,94.87999725341797,74.76000213623047,97.19999694824219,87.12999725341797\n2008-11-07,24.639999389648438,18.040000915527344,94.44999694824219,36.20000076293945,44.689998626708984,88.63999938964844,20.729999542236328,26.239999771118164,24.8700008392334,49.849998474121094,11.551584243774414,90.2300033569336,15.84000015258789,29.059999465942383,27.1299991607666,25.600000381469727,41.529998779296875,42.81999969482422,93.86000061035156,94.26000213623047,74.5999984741211,97.44999694824219,90.12999725341797\n2008-11-10,24.8700008392334,17.93000030517578,94.77999877929688,36.52000045776367,44.02000045776367,88.7300033569336,20.3700008392334,25.760000228881836,24.8799991607666,50.02000045776367,11.210397720336914,90.2699966430664,15.670000076293945,28.360000610351562,26.219999313354492,26.610000610351562,40.459999084472656,42.79999923706055,92.62999725341797,94.72000122070312,74.5999984741211,97.19000244140625,88.93000030517578\n2008-11-11,23.31999969482422,17.170000076293945,95.0,35.0,42.56999969482422,89.05999755859375,19.639999389648438,25.219999313354492,23.889999389648438,48.58000183105469,10.820470809936523,90.55999755859375,15.329999923706055,28.360000610351562,25.09000015258789,25.049999237060547,39.439998626708984,40.7400016784668,89.7699966430664,95.0,74.79000091552734,97.79000091552734,86.75\n2008-11-12,21.59000015258789,16.229999542236328,95.1500015258789,34.040000915527344,40.279998779296875,89.61000061035156,18.510000228881836,23.280000686645508,22.3700008392334,44.599998474121094,10.154346466064453,90.54000091552734,14.609999656677246,27.420000076293945,23.709999084472656,24.079999923706055,37.209999084472656,39.36000061035156,85.81999969482422,95.61000061035156,74.55000305175781,98.30999755859375,83.08999633789062\n2008-11-13,24.579999923706055,17.90999984741211,94.55999755859375,36.36000061035156,43.709999084472656,88.95999908447266,20.600000381469727,24.780000686645508,24.190000534057617,49.84000015258789,10.893582344055176,89.91999816894531,15.520000457763672,29.5,25.559999465942383,27.65999984741211,40.279998779296875,41.779998779296875,91.16999816894531,93.31999969482422,74.55000305175781,98.38999938964844,88.69999694824219\n2008-11-14,22.219999313354492,16.709999084472656,95.5199966430664,34.400001525878906,41.20000076293945,89.83999633789062,19.290000915527344,23.459999084472656,22.719999313354492,47.77000045776367,10.341185569763184,89.9000015258789,14.8100004196167,28.799999237060547,23.479999542236328,25.149999618530273,38.040000915527344,39.779998779296875,86.62000274658203,95.16999816894531,74.80999755859375,98.16999816894531,84.22000122070312\n2008-11-17,21.850000381469727,16.350000381469727,95.61000061035156,34.31999969482422,40.45000076293945,90.22000122070312,18.770000457763672,23.31999969482422,22.25,46.779998779296875,9.683184623718262,90.55000305175781,14.390000343322754,28.75,23.100000381469727,25.100000381469727,37.27000045776367,39.33000183105469,85.47000122070312,95.58999633789062,74.62000274658203,97.05999755859375,82.94999694824219\n2008-11-18,21.530000686645508,16.399999618530273,94.63999938964844,34.31999969482422,40.52000045776367,90.91999816894531,18.81999969482422,23.799999237060547,22.0,48.09000015258789,9.545084953308105,90.66000366210938,14.59000015258789,28.440000534057617,23.079999923706055,24.280000686645508,37.34000015258789,39.189998626708984,87.08000183105469,96.81999969482422,74.66999816894531,98.52999877929688,84.33999633789062\n2008-11-19,19.670000076293945,15.149999618530273,94.62000274658203,32.119998931884766,37.810001373291016,91.9000015258789,17.6200008392334,22.299999237060547,20.68000030517578,45.599998474121094,8.545897483825684,90.80000305175781,13.779999732971191,27.829999923706055,21.149999618530273,22.280000686645508,34.83000183105469,36.630001068115234,81.5,99.30000305175781,74.93000030517578,97.83000183105469,80.36000061035156\n2008-11-20,18.260000228881836,14.300000190734863,93.4800033569336,31.200000762939453,35.72999954223633,93.75,16.56999969482422,21.139999389648438,19.8799991607666,39.959999084472656,7.6279449462890625,89.80999755859375,13.1899995803833,26.209999084472656,19.579999923706055,21.15999984741211,32.77000045776367,34.90999984741211,75.44999694824219,104.43000030517578,74.87000274658203,98.0999984741211,76.05999755859375\n2008-11-21,20.889999389648438,15.170000076293945,92.52999877929688,33.119998931884766,38.27000045776367,92.88999938964844,17.399999618530273,22.0,20.100000381469727,44.41999816894531,7.863525390625,90.8499984741211,13.890000343322754,28.829999923706055,22.479999542236328,24.459999084472656,34.56999969482422,38.0,79.5199966430664,102.91999816894531,74.5,97.48999786376953,80.54000091552734\n2008-11-24,22.15999984741211,16.43000030517578,90.7300033569336,34.68000030517578,40.560001373291016,92.0199966430664,18.84000015258789,23.920000076293945,21.260000228881836,47.630001068115234,9.057676315307617,90.44999694824219,14.569999694824219,29.1200008392334,23.100000381469727,24.93000030517578,37.22999954223633,39.689998626708984,85.02999877929688,101.30999755859375,74.18000030517578,97.87999725341797,83.9000015258789\n2008-11-25,21.739999771118164,16.709999084472656,92.38999938964844,34.52000045776367,41.29999923706055,93.5999984741211,19.350000381469727,24.079999923706055,22.040000915527344,48.38999938964844,9.585702896118164,90.87999725341797,14.770000457763672,29.700000762939453,23.520000457763672,24.40999984741211,37.88999938964844,39.560001373291016,85.66000366210938,104.29000091552734,75.45999908447266,98.45999908447266,84.80999755859375\n2008-11-26,23.399999618530273,16.790000915527344,92.88999938964844,35.15999984741211,41.75,94.16999816894531,19.540000915527344,24.559999465942383,23.049999237060547,51.099998474121094,10.032493591308594,90.4000015258789,15.229999542236328,29.600000381469727,24.200000762939453,27.229999542236328,38.310001373291016,40.29999923706055,88.97000122070312,104.43000030517578,75.93000030517578,98.69999694824219,87.18000030517578\n2008-11-28,22.950000762939453,16.59000015258789,93.18000030517578,34.63999938964844,41.72999954223633,94.36000061035156,19.350000381469727,25.0,23.149999618530273,50.279998779296875,10.284321784973145,90.13999938964844,15.25,30.1200008392334,24.559999465942383,26.59000015258789,38.63999938964844,40.209999084472656,90.08999633789062,105.72000122070312,75.69000244140625,98.3499984741211,88.30000305175781\n2008-12-01,20.739999771118164,15.239999771118164,95.05000305175781,32.63999938964844,38.31999969482422,95.31999969482422,17.780000686645508,22.420000076293945,21.190000534057617,44.93000030517578,8.570267677307129,91.08999633789062,14.149999618530273,28.1200008392334,22.43000030517578,24.600000381469727,35.189998626708984,37.369998931884766,82.11000061035156,109.4000015258789,75.83999633789062,99.2699966430664,81.66000366210938\n2008-12-02,22.049999237060547,16.06999969482422,95.88999938964844,34.279998779296875,40.400001525878906,95.81999969482422,18.889999389648438,23.6200008392334,22.010000228881836,46.45000076293945,9.268887519836426,91.77999877929688,14.649999618530273,28.850000381469727,23.520000457763672,26.40999984741211,37.0,39.31999969482422,85.2699966430664,109.81999969482422,76.30000305175781,98.68000030517578,84.36000061035156\n2008-12-03,22.229999542236328,16.309999465942383,97.16000366210938,34.599998474121094,40.939998626708984,95.97000122070312,18.920000076293945,23.34000015258789,21.969999313354492,46.47999954223633,9.74817180633545,92.41999816894531,15.069999694824219,29.350000381469727,23.540000915527344,27.25,37.43000030517578,39.779998779296875,87.31999969482422,110.12999725341797,75.94000244140625,97.76000213623047,86.04000091552734\n2008-12-04,21.280000686645508,15.9399995803833,97.93000030517578,33.2400016784668,39.68000030517578,96.56999969482422,18.459999084472656,22.65999984741211,21.530000686645508,43.2599983215332,9.642566680908203,92.51000213623047,14.460000038146973,28.290000915527344,22.3799991607666,25.850000381469727,36.2599983215332,38.09000015258789,85.30000305175781,112.30000305175781,76.2699966430664,98.11000061035156,83.73999786376953\n2008-12-05,22.540000915527344,16.030000686645508,97.25,33.7599983215332,40.18000030517578,95.55000305175781,18.639999389648438,23.3799991607666,21.93000030517578,44.15999984741211,10.406173706054688,91.87999725341797,15.029999732971191,28.469999313354492,23.520000457763672,27.829999923706055,36.869998931884766,38.880001068115234,87.93000030517578,110.4800033569336,75.70999908447266,98.36000061035156,86.58999633789062\n2008-12-08,23.979999542236328,16.940000534057617,96.0,35.279998779296875,42.09000015258789,95.19000244140625,19.530000686645508,24.440000534057617,23.579999923706055,46.119998931884766,11.104792594909668,92.83000183105469,15.729999542236328,28.93000030517578,25.209999084472656,30.299999237060547,38.540000915527344,40.81999969482422,91.0,110.23999786376953,75.37999725341797,98.81999969482422,89.12000274658203\n2008-12-09,23.649999618530273,16.940000534057617,96.56999969482422,35.040000915527344,41.70000076293945,96.0,19.510000228881836,24.239999771118164,23.329999923706055,46.58000183105469,10.658001899719238,93.45999908447266,15.630000114440918,28.520000457763672,25.079999923706055,29.079999923706055,38.43000030517578,40.290000915527344,89.5,112.41999816894531,75.77999877929688,98.98999786376953,87.11000061035156\n2008-12-10,25.059999465942383,17.399999618530273,95.94000244140625,35.79999923706055,42.79999923706055,95.91000366210938,20.219999313354492,24.6200008392334,24.049999237060547,48.9900016784668,10.471161842346191,93.68000030517578,15.5,28.950000762939453,24.84000015258789,31.239999771118164,39.34000015258789,41.0099983215332,90.11000061035156,112.1500015258789,75.6500015258789,99.12999725341797,87.63999938964844\n2008-12-11,24.420000076293945,17.450000762939453,97.0,35.68000030517578,42.61000061035156,96.48999786376953,20.25,24.559999465942383,23.010000228881836,48.7599983215332,9.666937828063965,94.0,15.170000076293945,28.719999313354492,24.360000610351562,30.1200008392334,39.310001373291016,40.95000076293945,87.94000244140625,112.37000274658203,76.45999908447266,97.36000061035156,85.86000061035156\n2008-12-12,24.760000228881836,17.530000686645508,96.61000061035156,36.47999954223633,43.029998779296875,96.76000213623047,20.3799991607666,24.600000381469727,23.100000381469727,48.279998779296875,9.853777885437012,94.51000213623047,15.350000381469727,28.899999618530273,24.739999771118164,29.989999771118164,39.4900016784668,41.81999969482422,88.98999786376953,112.37000274658203,76.05999755859375,98.91000366210938,86.36000061035156\n2008-12-15,24.43000030517578,17.829999923706055,96.19999694824219,36.279998779296875,43.13999938964844,96.97000122070312,20.40999984741211,24.920000076293945,23.049999237060547,48.0,9.447603225708008,94.4800033569336,15.180000305175781,28.450000762939453,24.559999465942383,29.049999237060547,39.619998931884766,41.63999938964844,87.75,113.6500015258789,76.86000061035156,98.95999908447266,85.98999786376953\n2008-12-16,26.3799991607666,19.15999984741211,99.29000091552734,38.119998931884766,45.619998931884766,98.51000213623047,21.940000534057617,26.139999389648438,24.459999084472656,49.4900016784668,10.503655433654785,96.41999816894531,15.970000267028809,29.420000076293945,26.030000686645508,31.170000076293945,42.04999923706055,43.630001068115234,91.87999725341797,116.45999908447266,77.5,99.66999816894531,89.56999969482422\n2008-12-17,25.920000076293945,18.93000030517578,101.19000244140625,38.040000915527344,45.38999938964844,99.18000030517578,21.81999969482422,25.579999923706055,24.479999542236328,49.16999816894531,10.406173706054688,97.8499984741211,15.65999984741211,28.530000686645508,25.639999389648438,30.760000228881836,41.90999984741211,43.790000915527344,90.98999786376953,119.62000274658203,77.5199966430664,99.69999694824219,88.3499984741211\n2008-12-18,25.350000381469727,18.600000381469727,101.75,36.720001220703125,44.0,99.8499984741211,21.139999389648438,24.459999084472656,23.540000915527344,46.310001373291016,10.105605125427246,100.22000122070312,15.220000267028809,28.770000457763672,24.8799991607666,30.479999542236328,40.369998931884766,42.2400016784668,89.29000091552734,122.12999725341797,78.06999969482422,100.58000183105469,86.36000061035156\n2008-12-19,25.440000534057617,18.049999237060547,100.01000213623047,36.560001373291016,43.36000061035156,99.5199966430664,20.75,24.020000457763672,22.780000686645508,46.0,9.935011863708496,98.7300033569336,15.270000457763672,28.579999923706055,25.100000381469727,30.549999237060547,39.58000183105469,42.130001068115234,88.19000244140625,122.26000213623047,77.56999969482422,100.13999938964844,85.36000061035156\n2008-12-22,24.489999771118164,17.90999984741211,100.7300033569336,36.47999954223633,43.060001373291016,99.26000213623047,20.450000762939453,23.979999542236328,21.950000762939453,44.630001068115234,9.585702896118164,99.91999816894531,15.0600004196167,28.200000762939453,24.899999618530273,28.860000610351562,39.220001220703125,41.81999969482422,87.05999755859375,121.31999969482422,78.23999786376953,99.9000015258789,84.95999908447266\n2008-12-23,23.950000762939453,17.8799991607666,100.4800033569336,35.560001373291016,42.20000076293945,99.20999908447266,19.920000076293945,23.100000381469727,21.8700008392334,44.72999954223633,9.358244895935059,100.25,14.850000381469727,27.8799991607666,24.190000534057617,27.610000610351562,39.310001373291016,41.279998779296875,86.16000366210938,121.16000366210938,78.52999877929688,100.94000244140625,84.06999969482422\n2008-12-24,24.1200008392334,18.149999618530273,100.5,36.0,42.7599983215332,99.11000061035156,20.0,23.0,21.889999389648438,44.560001373291016,9.561332702636719,100.5,14.949999809265137,28.020000457763672,24.540000915527344,27.969999313354492,37.0099983215332,41.040000915527344,86.66000366210938,120.9000015258789,78.16999816894531,100.93000030517578,84.4800033569336\n2008-12-26,24.040000915527344,18.06999969482422,100.7300033569336,36.68000030517578,42.959999084472656,99.63999938964844,20.15999984741211,23.420000076293945,22.15999984741211,45.15999984741211,9.569456100463867,100.69000244140625,14.930000305175781,28.079999923706055,24.780000686645508,28.059999465942383,36.790000915527344,41.70000076293945,87.16000366210938,121.30000305175781,78.2300033569336,100.87999725341797,85.06999969482422\n2008-12-29,24.0,18.31999969482422,100.4000015258789,36.959999084472656,42.970001220703125,99.48999786376953,20.100000381469727,23.15999984741211,21.760000228881836,46.150001525878906,9.488221168518066,100.58000183105469,14.9399995803833,28.139999389648438,24.600000381469727,28.239999771118164,36.939998626708984,41.90999984741211,86.91000366210938,120.75,78.72000122070312,100.77999877929688,84.91000366210938\n2008-12-30,24.639999389648438,18.969999313354492,98.94000244140625,38.0,44.2599983215332,99.62999725341797,20.940000534057617,23.719999313354492,22.350000381469727,47.27000045776367,9.853777885437012,101.45999908447266,15.220000267028809,28.56999969482422,25.34000015258789,28.75,38.099998474121094,43.099998474121094,88.97000122070312,121.9000015258789,78.87000274658203,100.98999786376953,86.68000030517578\n2008-12-31,24.969999313354492,19.219999313354492,99.23999786376953,38.31999969482422,44.86000061035156,98.52999877929688,20.93000030517578,24.5,22.739999771118164,47.77000045776367,10.17059326171875,101.6500015258789,15.40999984741211,29.030000686645508,26.350000381469727,29.09000015258789,38.36000061035156,43.81999969482422,90.23999786376953,119.3499984741211,78.97000122070312,100.83999633789062,87.5199966430664\n2009-01-02,26.15999984741211,19.329999923706055,97.37999725341797,38.52000045776367,45.439998626708984,97.12000274658203,21.43000030517578,24.600000381469727,23.56999969482422,50.150001525878906,10.284321784973145,100.61000061035156,15.989999771118164,29.709999084472656,26.549999237060547,31.110000610351562,39.09000015258789,44.18000030517578,92.95999908447266,116.3499984741211,78.68000030517578,100.73999786376953,90.19999694824219\n2009-01-05,26.5,18.850000381469727,97.0199966430664,37.560001373291016,44.709999084472656,96.94999694824219,20.90999984741211,25.200000762939453,23.6200008392334,51.33000183105469,10.113728523254395,101.30000305175781,15.9399995803833,30.1299991607666,26.34000015258789,31.459999084472656,38.68000030517578,43.18000030517578,92.8499984741211,113.3499984741211,78.3499984741211,100.19999694824219,89.69999694824219\n2009-01-06,27.100000381469727,18.90999984741211,97.73999786376953,37.20000076293945,45.189998626708984,96.88999938964844,20.989999771118164,25.81999969482422,24.149999618530273,51.88999938964844,10.276198387145996,101.47000122070312,16.309999465942383,29.700000762939453,26.899999618530273,31.559999465942383,39.380001068115234,43.119998931884766,93.47000122070312,112.20999908447266,77.8499984741211,101.63999938964844,90.1500015258789\n2009-01-07,25.540000915527344,18.6299991607666,97.86000061035156,36.84000015258789,44.40999984741211,96.91000366210938,20.729999542236328,25.040000915527344,23.59000015258789,49.689998626708984,9.7400484085083,100.62000274658203,15.789999961853027,29.459999084472656,26.1200008392334,29.299999237060547,38.65999984741211,42.459999084472656,90.66999816894531,112.6500015258789,78.08999633789062,101.61000061035156,87.86000061035156\n2009-01-08,25.43000030517578,18.729999542236328,98.63999938964844,37.36000061035156,45.06999969482422,97.16999816894531,20.979999542236328,25.600000381469727,23.920000076293945,50.33000183105469,9.699431419372559,101.33999633789062,15.899999618530273,29.309999465942383,26.200000762939453,28.780000686645508,39.09000015258789,43.0,91.04000091552734,112.55999755859375,77.95999908447266,101.80999755859375,87.43000030517578\n2009-01-09,24.8799991607666,17.770000457763672,99.51000213623047,36.720001220703125,43.5099983215332,97.62000274658203,20.200000762939453,24.8799991607666,23.34000015258789,48.63999938964844,9.390739440917969,102.5999984741211,15.550000190734863,29.079999923706055,25.06999969482422,27.709999084472656,37.59000015258789,42.119998931884766,89.08999633789062,112.7300033569336,78.23999786376953,102.1500015258789,86.13999938964844\n2009-01-12,23.829999923706055,17.360000610351562,100.01000213623047,36.279998779296875,42.459999084472656,98.2300033569336,19.700000762939453,24.139999389648438,22.3700008392334,46.720001220703125,8.895207405090332,102.06999969482422,15.270000457763672,29.09000015258789,24.549999237060547,26.170000076293945,36.63999938964844,41.31999969482422,86.94999694824219,113.9000015258789,77.93000030517578,101.16999816894531,84.79000091552734\n2009-01-13,23.899999618530273,16.920000076293945,99.98999786376953,35.599998474121094,41.68000030517578,98.30000305175781,19.350000381469727,23.739999771118164,22.489999771118164,47.88999938964844,9.017059326171875,101.8499984741211,15.199999809265137,28.540000915527344,24.209999084472656,25.8799991607666,35.900001525878906,40.540000915527344,87.11000061035156,114.0199966430664,78.3499984741211,101.87999725341797,84.41999816894531\n2009-01-14,22.739999771118164,15.9399995803833,100.11000061035156,34.560001373291016,39.970001220703125,98.8499984741211,18.43000030517578,22.540000915527344,21.649999618530273,45.599998474121094,8.497157096862793,101.4000015258789,14.739999771118164,28.190000534057617,23.549999237060547,25.18000030517578,34.290000915527344,39.38999938964844,84.37000274658203,115.9000015258789,78.63999938964844,101.11000061035156,82.08000183105469\n2009-01-15,23.0,16.09000015258789,100.11000061035156,35.0,40.33000183105469,98.7699966430664,18.399999618530273,22.520000457763672,22.290000915527344,46.16999816894531,8.107230186462402,101.5999984741211,14.84000015258789,28.34000015258789,23.579999923706055,25.610000610351562,34.540000915527344,39.81999969482422,84.4000015258789,116.08999633789062,78.30000305175781,101.5199966430664,82.18000030517578\n2009-01-16,23.25,16.149999618530273,99.69999694824219,35.2400016784668,40.56999969482422,97.86000061035156,18.489999771118164,22.65999984741211,22.540000915527344,46.540000915527344,7.863525390625,101.5999984741211,14.9399995803833,28.899999618530273,23.899999618530273,25.950000762939453,34.630001068115234,40.189998626708984,85.05999755859375,114.30000305175781,78.41999816894531,102.02999877929688,82.69000244140625\n2009-01-20,21.520000457763672,14.949999809265137,99.63999938964844,33.720001220703125,37.599998474121094,97.70999908447266,16.969999313354492,20.760000228881836,21.270000457763672,44.060001373291016,6.563769340515137,100.0999984741211,14.329999923706055,28.399999618530273,22.1200008392334,23.739999771118164,31.829999923706055,38.15999984741211,80.56999969482422,114.27999877929688,78.08000183105469,101.80000305175781,79.41000366210938\n2009-01-21,22.690000534057617,15.670000076293945,98.12000274658203,35.20000076293945,39.439998626708984,96.83999633789062,17.770000457763672,21.780000686645508,22.020000457763672,47.02000045776367,7.530463218688965,99.5999984741211,15.020000457763672,28.719999313354492,23.440000534057617,25.100000381469727,33.34000015258789,39.779998779296875,84.05000305175781,110.66999816894531,77.54000091552734,101.83999633789062,82.23999786376953\n2009-01-22,21.940000534057617,15.319999694824219,98.29000091552734,34.31999969482422,38.52000045776367,96.19999694824219,17.3700008392334,20.959999084472656,21.68000030517578,45.72999954223633,7.067424774169922,99.2300033569336,14.680000305175781,28.709999084472656,22.600000381469727,23.850000381469727,32.599998474121094,38.79999923706055,82.75,108.54000091552734,77.70999908447266,101.79000091552734,81.16000366210938\n2009-01-23,22.219999313354492,14.979999542236328,98.6500015258789,34.2400016784668,38.25,96.22000122070312,17.079999923706055,20.860000610351562,22.010000228881836,47.060001373291016,7.303005695343018,98.56999969482422,14.890000343322754,28.770000457763672,22.399999618530273,24.5,32.369998931884766,38.779998779296875,83.11000061035156,107.69000244140625,77.55999755859375,101.7300033569336,80.5199966430664\n2009-01-26,22.479999542236328,15.619999885559082,98.31999969482422,34.20000076293945,39.0,95.9800033569336,17.6200008392334,21.600000381469727,21.75,47.93000030517578,7.173029899597168,97.69000244140625,15.069999694824219,29.459999084472656,22.450000762939453,24.6200008392334,33.20000076293945,38.75,83.68000030517578,106.75,77.30000305175781,101.37999725341797,81.06999969482422\n2009-01-27,22.8799991607666,15.829999923706055,99.16999816894531,35.279998779296875,39.7599983215332,96.61000061035156,17.84000015258789,22.0,21.90999984741211,48.0099983215332,7.4248576164245605,99.52999877929688,15.15999984741211,29.600000381469727,22.920000076293945,24.979999542236328,33.619998931884766,39.9900016784668,84.52999877929688,109.26000213623047,77.7699966430664,101.47000122070312,81.51000213623047\n2009-01-28,24.040000915527344,16.559999465942383,99.2300033569336,35.91999816894531,40.93000030517578,95.98999786376953,18.639999389648438,22.84000015258789,22.530000686645508,49.31999969482422,8.375304222106934,100.31999969482422,15.59000015258789,29.790000915527344,23.709999084472656,25.93000030517578,34.869998931884766,40.75,87.38999938964844,106.52999877929688,77.80999755859375,101.79000091552734,83.68000030517578\n2009-01-29,22.81999969482422,15.8100004196167,98.73999786376953,34.560001373291016,39.06999969482422,94.73999786376953,17.690000534057617,22.059999465942383,21.920000076293945,47.58000183105469,7.7173027992248535,99.12000274658203,15.130000114440918,29.56999969482422,22.690000534057617,24.540000915527344,33.209999084472656,39.060001373291016,84.55000305175781,104.08000183105469,77.29000091552734,101.62999725341797,81.52999877929688\n2009-01-30,22.649999618530273,15.5,99.19999694824219,33.720001220703125,38.70000076293945,94.69999694824219,17.440000534057617,22.200000762939453,21.059999465942383,46.91999816894531,7.506092548370361,99.81999969482422,14.680000305175781,28.979999542236328,22.389999389648438,25.110000610351562,33.04999923706055,38.2400016784668,82.83000183105469,103.75,77.33000183105469,101.75,80.08000183105469\n2009-02-02,22.420000076293945,15.25,99.55999755859375,33.720001220703125,38.31999969482422,95.19999694824219,17.329999923706055,21.459999084472656,20.760000228881836,46.16999816894531,7.506092548370361,98.8499984741211,14.90999984741211,29.139999389648438,22.59000015258789,24.989999771118164,32.61000061035156,38.2599983215332,82.58000183105469,105.38999938964844,77.30000305175781,101.19999694824219,79.31999969482422\n2009-02-03,23.09000015258789,15.970000267028809,99.19999694824219,34.36000061035156,39.41999816894531,94.37999725341797,17.950000762939453,22.5,21.15999984741211,46.970001220703125,7.367993354797363,98.5199966430664,15.210000038146973,29.270000457763672,23.030000686645508,25.530000686645508,33.79999923706055,39.029998779296875,83.73999786376953,102.87999725341797,76.5,101.20999908447266,80.62999725341797\n2009-02-04,23.260000228881836,15.739999771118164,99.0,34.68000030517578,39.220001220703125,93.9000015258789,17.780000686645508,22.280000686645508,21.420000076293945,47.40999984741211,7.286758899688721,98.55999755859375,15.199999809265137,29.489999771118164,22.559999465942383,26.209999084472656,33.369998931884766,38.970001220703125,83.33000183105469,102.5199966430664,76.63999938964844,101.19999694824219,79.69000244140625\n2009-02-05,23.75,16.049999237060547,98.88999938964844,34.560001373291016,39.779998779296875,94.12000274658203,18.18000030517578,23.0,21.989999771118164,48.56999969482422,7.400487422943115,97.69999694824219,15.4399995803833,29.700000762939453,22.889999389648438,27.18000030517578,34.119998931884766,39.16999816894531,84.56999969482422,102.61000061035156,76.80999755859375,100.80000305175781,80.55000305175781\n2009-02-06,24.940000534057617,16.600000381469727,99.45999908447266,34.7599983215332,40.70000076293945,93.55000305175781,18.649999618530273,23.600000381469727,22.649999618530273,49.470001220703125,7.952883720397949,98.27999877929688,15.970000267028809,29.889999389648438,24.010000228881836,28.469999313354492,34.970001220703125,39.720001220703125,86.9800033569336,102.29000091552734,76.80000305175781,100.94000244140625,82.86000061035156\n2009-02-09,24.809999465942383,16.790000915527344,100.5,34.119998931884766,40.689998626708984,93.36000061035156,18.75,23.780000686645508,22.56999969482422,49.650001525878906,8.042242050170898,98.45999908447266,16.010000228881836,29.719999313354492,23.8799991607666,28.25,35.29999923706055,39.220001220703125,87.0999984741211,102.62000274658203,76.81999969482422,100.9800033569336,82.75\n2009-02-10,23.309999465942383,15.899999618530273,100.95999908447266,32.91999816894531,38.66999816894531,94.61000061035156,17.649999618530273,22.399999618530273,21.559999465942383,47.34000015258789,7.221770763397217,98.94000244140625,15.359999656677246,28.8799991607666,22.309999465942383,26.860000610351562,33.400001525878906,37.54999923706055,83.11000061035156,104.8499984741211,77.23999786376953,101.2300033569336,79.19000244140625\n2009-02-11,24.010000228881836,16.100000381469727,100.69000244140625,33.08000183105469,39.09000015258789,95.33999633789062,17.969999313354492,22.5,21.559999465942383,46.79999923706055,7.571080207824707,99.27999877929688,15.390000343322754,28.790000915527344,23.059999465942383,26.979999542236328,33.66999816894531,37.79999923706055,83.5999984741211,106.20999908447266,77.5199966430664,101.36000061035156,79.55000305175781\n2009-02-12,23.860000610351562,15.850000381469727,100.33000183105469,33.040000915527344,38.970001220703125,95.30999755859375,17.850000381469727,22.440000534057617,21.920000076293945,46.880001068115234,7.473598480224609,99.36000061035156,15.460000038146973,28.540000915527344,23.030000686645508,26.459999084472656,33.7400016784668,37.900001525878906,83.66000366210938,105.20999908447266,77.31999969482422,101.4800033569336,79.5\n2009-02-13,23.979999542236328,15.649999618530273,99.91000366210938,32.15999984741211,38.54999923706055,94.55999755859375,17.729999542236328,22.280000686645508,21.59000015258789,46.9900016784668,7.189277172088623,98.5999984741211,15.390000343322754,28.3700008392334,23.18000030517578,26.809999465942383,33.369998931884766,37.25,82.76000213623047,102.41000366210938,76.95999908447266,101.13999938964844,78.55000305175781\n2009-02-17,22.450000762939453,14.649999618530273,100.5199966430664,31.079999923706055,36.5,96.1500015258789,16.6299991607666,21.239999771118164,20.649999618530273,43.7400016784668,6.4744110107421875,99.13999938964844,14.75,27.139999389648438,21.850000381469727,24.899999618530273,31.40999984741211,35.630001068115234,79.22000122070312,105.5999984741211,77.45999908447266,100.9000015258789,75.75\n2009-02-18,22.290000915527344,14.529999732971191,99.88999938964844,31.31999969482422,36.470001220703125,95.44999694824219,16.540000915527344,21.139999389648438,20.530000686645508,43.4900016784668,6.4744110107421875,98.6500015258789,14.760000228881836,26.729999542236328,22.040000915527344,25.56999969482422,31.34000015258789,35.970001220703125,79.02999877929688,104.69999694824219,77.16000366210938,100.80000305175781,75.76000213623047\n2009-02-19,22.079999923706055,14.609999656677246,99.61000061035156,30.8799991607666,36.41999816894531,94.91999816894531,16.59000015258789,21.1200008392334,20.31999969482422,43.5,6.133224964141846,97.83999633789062,14.399999618530273,26.850000381469727,22.1200008392334,25.56999969482422,31.229999542236328,35.810001373291016,78.18000030517578,102.91999816894531,76.83000183105469,100.63999938964844,75.02999877929688\n2009-02-20,21.520000457763672,14.329999923706055,99.95999908447266,30.479999542236328,35.88999938964844,95.19000244140625,16.290000915527344,20.860000610351562,20.479999542236328,42.380001068115234,6.0438666343688965,97.43000030517578,14.539999961853027,26.239999771118164,22.020000457763672,25.139999389648438,30.809999465942383,35.33000183105469,77.41999816894531,103.91999816894531,76.97000122070312,100.58999633789062,73.7300033569336\n2009-02-23,20.989999771118164,13.619999885559082,99.86000061035156,29.200000762939453,34.52000045776367,95.27999877929688,15.649999618530273,20.280000686645508,19.239999771118164,40.400001525878906,5.832656383514404,97.0999984741211,13.869999885559082,25.610000610351562,21.469999313354492,24.799999237060547,29.649999618530273,34.130001068115234,74.6500015258789,104.87999725341797,77.0999984741211,100.20999908447266,71.1500015258789\n2009-02-24,22.139999389648438,14.130000114440918,99.0,30.399999618530273,35.959999084472656,94.91999816894531,16.360000610351562,20.84000015258789,19.850000381469727,42.29999923706055,6.539398670196533,96.75,14.239999771118164,26.350000381469727,22.459999084472656,26.149999618530273,30.729999542236328,35.310001373291016,77.4800033569336,104.7699966430664,77.04000091552734,100.16999816894531,73.37999725341797\n2009-02-25,21.760000228881836,13.649999618530273,98.41000366210938,29.600000381469727,34.970001220703125,94.05999755859375,15.9399995803833,20.440000534057617,19.549999237060547,42.04999923706055,6.498781681060791,95.43000030517578,14.369999885559082,26.18000030517578,21.920000076293945,25.510000228881836,29.989999771118164,34.560001373291016,76.87000274658203,103.55999755859375,76.6500015258789,99.83999633789062,72.66999816894531\n2009-02-26,21.56999969482422,13.6899995803833,97.62000274658203,29.239999771118164,34.68000030517578,93.81999969482422,15.699999809265137,20.260000228881836,19.56999969482422,42.150001525878906,6.604386806488037,94.81999969482422,14.220000267028809,25.75,21.780000686645508,24.809999465942383,29.739999771118164,34.09000015258789,75.62000274658203,102.47000122070312,76.51000213623047,99.76000213623047,71.83999633789062\n2009-02-27,21.229999542236328,13.489999771118164,97.0199966430664,29.479999542236328,34.68000030517578,93.73999786376953,15.729999542236328,20.040000915527344,19.3700008392334,41.130001068115234,6.173842430114746,94.16000366210938,14.119999885559082,25.350000381469727,21.31999969482422,24.309999465942383,29.6200008392334,34.220001220703125,73.93000030517578,101.87999725341797,76.58999633789062,99.27999877929688,70.76000213623047\n2009-03-02,19.940000534057617,12.779999732971191,97.62999725341797,28.440000534057617,32.689998626708984,94.43000030517578,14.890000343322754,18.68000030517578,18.079999923706055,38.119998931884766,5.7839155197143555,93.69000244140625,13.779999732971191,24.549999237060547,20.360000610351562,22.799999237060547,27.690000534057617,32.84000015258789,70.5999984741211,103.27999877929688,76.44000244140625,98.52999877929688,67.83000183105469\n2009-03-03,20.219999313354492,12.869999885559082,97.41000366210938,28.360000610351562,32.560001373291016,94.30999755859375,14.84000015258789,18.459999084472656,18.149999618530273,38.310001373291016,5.670186996459961,93.18000030517578,13.649999618530273,23.670000076293945,20.56999969482422,23.299999237060547,27.479999542236328,32.81999969482422,70.06999969482422,102.58999633789062,76.18000030517578,98.69999694824219,67.20999908447266\n2009-03-04,21.639999389648438,13.539999961853027,97.22000122070312,29.1200008392334,34.0099983215332,93.83000183105469,15.569999694824219,19.139999389648438,18.780000686645508,40.13999938964844,5.597075462341309,93.1500015258789,14.010000228881836,23.889999389648438,21.549999237060547,25.459999084472656,28.670000076293945,34.06999969482422,71.7300033569336,102.12000274658203,76.16999816894531,98.0,68.7699966430664\n2009-03-05,20.75,12.770000457763672,98.12000274658203,28.559999465942383,32.63999938964844,94.93000030517578,14.920000076293945,18.5,18.170000076293945,38.369998931884766,5.06904935836792,92.9000015258789,13.579999923706055,23.209999084472656,20.469999313354492,23.989999771118164,27.459999084472656,33.04999923706055,68.80000305175781,104.95999908447266,76.5199966430664,98.36000061035156,66.06999969482422\n2009-03-06,21.100000381469727,12.819999694824219,97.47000122070312,28.479999542236328,32.58000183105469,94.4800033569336,14.829999923706055,18.540000915527344,18.399999618530273,38.790000915527344,5.020308494567871,93.0999984741211,13.649999618530273,23.18000030517578,20.450000762939453,24.0,27.3799991607666,32.93000030517578,68.91999816894531,104.26000213623047,76.19999694824219,98.2699966430664,66.5\n2009-03-09,20.690000534057617,12.729999542236328,97.0999984741211,27.479999542236328,31.700000762939453,94.5199966430664,14.4399995803833,18.0,18.18000030517578,38.86000061035156,5.085296630859375,90.54000091552734,13.220000267028809,22.739999771118164,20.059999465942383,23.68000030517578,26.760000228881836,32.02000045776367,68.11000061035156,103.6500015258789,75.91999816894531,97.81999969482422,65.44000244140625\n2009-03-10,22.3700008392334,13.550000190734863,96.4800033569336,28.8799991607666,33.83000183105469,93.83000183105469,15.59000015258789,19.059999465942383,19.190000534057617,40.83000183105469,5.840779781341553,91.8499984741211,13.979999542236328,23.040000915527344,21.309999465942383,25.610000610351562,28.59000015258789,33.65999984741211,72.16999816894531,101.66000366210938,76.0,97.8499984741211,69.13999938964844\n2009-03-11,22.3700008392334,13.789999961853027,96.95999908447266,29.0,34.02000045776367,94.5,15.680000305175781,19.020000457763672,19.770000457763672,40.65999984741211,5.995125770568848,91.87999725341797,14.289999961853027,23.0,21.329999923706055,25.100000381469727,28.8700008392334,33.91999816894531,72.63999938964844,102.76000213623047,76.16000366210938,97.5,69.4800033569336\n2009-03-12,23.229999542236328,14.210000038146973,98.43000030517578,28.959999084472656,34.790000915527344,94.7699966430664,16.229999542236328,19.559999465942383,20.260000228881836,41.880001068115234,6.6125102043151855,91.80000305175781,14.699999809265137,23.299999237060547,21.850000381469727,25.969999313354492,29.860000610351562,34.15999984741211,75.5,103.25,76.33000183105469,97.33000183105469,71.7699966430664\n2009-03-13,23.360000610351562,14.180000305175781,98.4000015258789,29.239999771118164,35.02000045776367,94.69999694824219,16.260000228881836,19.860000610351562,20.350000381469727,41.5,6.653127670288086,92.6500015258789,14.699999809265137,23.6200008392334,22.31999969482422,26.440000534057617,29.8700008392334,34.45000076293945,76.08999633789062,102.7300033569336,76.2699966430664,97.26000213623047,72.31999969482422\n2009-03-16,23.3799991607666,14.300000190734863,98.30000305175781,29.760000228881836,35.400001525878906,94.16000366210938,16.3799991607666,20.059999465942383,20.670000076293945,42.029998779296875,6.523151874542236,92.77999877929688,14.569999694824219,24.260000228881836,22.56999969482422,27.09000015258789,30.190000534057617,34.959999084472656,75.86000061035156,101.11000061035156,76.22000122070312,97.62000274658203,72.30999755859375\n2009-03-17,23.889999389648438,14.479999542236328,98.19999694824219,30.799999237060547,36.33000183105469,93.9800033569336,16.81999969482422,20.479999542236328,20.850000381469727,43.47999954223633,6.945572853088379,92.52999877929688,15.100000381469727,24.639999389648438,23.25,27.489999771118164,31.0,36.04999923706055,78.18000030517578,100.55999755859375,76.05000305175781,98.13999938964844,74.08000183105469\n2009-03-18,24.389999389648438,15.0600004196167,101.83000183105469,31.520000457763672,37.369998931884766,97.19999694824219,17.450000762939453,20.799999237060547,21.459999084472656,43.91999816894531,7.644191741943359,94.5,15.3100004196167,25.440000534057617,23.6299991607666,27.700000762939453,31.729999542236328,36.959999084472656,79.93000030517578,104.37000274658203,77.4000015258789,99.55000305175781,74.97000122070312\n2009-03-19,24.229999542236328,15.170000076293945,102.30000305175781,31.360000610351562,37.349998474121094,96.87000274658203,17.3700008392334,20.579999923706055,21.65999984741211,44.97999954223633,7.034931182861328,94.69999694824219,15.350000381469727,25.809999465942383,23.729999542236328,27.209999084472656,31.770000457763672,36.900001525878906,78.94000244140625,104.5,77.3499984741211,99.41999816894531,74.11000061035156\n2009-03-20,23.899999618530273,14.949999809265137,101.79000091552734,30.68000030517578,36.83000183105469,96.87000274658203,17.190000534057617,20.559999465942383,21.149999618530273,43.0,6.6125102043151855,93.73999786376953,15.039999961853027,25.350000381469727,23.56999969482422,26.420000076293945,31.34000015258789,36.380001068115234,76.70999908447266,103.91999816894531,77.0,98.5,72.73999786376953\n2009-03-23,26.110000610351562,15.899999618530273,101.7699966430664,33.08000183105469,39.47999954223633,96.54000091552734,18.239999771118164,22.059999465942383,22.399999618530273,46.540000915527344,7.701056003570557,94.02999877929688,15.930000305175781,26.329999923706055,25.600000381469727,29.09000015258789,33.560001373291016,39.04999923706055,82.22000122070312,103.0199966430664,76.81999969482422,98.2300033569336,77.76000213623047\n2009-03-24,25.299999237060547,15.34000015258789,102.3499984741211,32.15999984741211,38.2400016784668,96.4000015258789,17.65999984741211,21.360000610351562,22.309999465942383,45.65999984741211,7.327375888824463,93.0999984741211,15.670000076293945,25.760000228881836,24.8799991607666,28.510000228881836,32.41999816894531,38.11000061035156,80.5999984741211,104.0,76.77999877929688,98.12000274658203,76.69999694824219\n2009-03-25,25.68000030517578,15.6899995803833,102.19999694824219,33.119998931884766,38.83000183105469,95.81999969482422,17.950000762939453,21.260000228881836,22.510000228881836,45.439998626708984,7.571080207824707,92.6500015258789,15.760000228881836,25.75,25.200000762939453,28.639999389648438,32.93000030517578,38.849998474121094,81.44999694824219,102.5999984741211,76.5199966430664,98.11000061035156,77.41000366210938\n2009-03-26,26.3799991607666,15.90999984741211,103.33999633789062,33.47999954223633,39.349998474121094,96.06999969482422,18.040000915527344,21.459999084472656,23.40999984741211,45.83000183105469,7.660438537597656,93.12999725341797,16.170000076293945,26.059999465942383,25.920000076293945,30.15999984741211,33.22999954223633,39.790000915527344,83.11000061035156,103.79000091552734,76.77999877929688,98.47000122070312,79.0999984741211\n2009-03-27,25.600000381469727,15.3100004196167,103.08000183105469,32.91999816894531,38.09000015258789,96.01000213623047,17.25,20.780000686645508,22.899999618530273,44.470001220703125,7.4248576164245605,93.41999816894531,15.819999694824219,25.799999237060547,25.06999969482422,29.700000762939453,31.940000534057617,38.81999969482422,81.61000061035156,104.55999755859375,76.97000122070312,98.30999755859375,77.80999755859375\n2009-03-30,24.280000686645508,14.520000457763672,103.2699966430664,31.639999389648438,36.63999938964844,96.41999816894531,16.549999237060547,20.299999237060547,22.110000610351562,42.81999969482422,6.783102989196777,93.3499984741211,15.329999923706055,25.290000915527344,24.020000457763672,27.790000915527344,30.649999618530273,37.36000061035156,78.79000091552734,104.95999908447266,77.12000274658203,98.51000213623047,75.25\n2009-03-31,24.809999465942383,14.970000267028809,102.75,31.600000381469727,37.59000015258789,96.58999633789062,17.200000762939453,20.959999084472656,22.209999084472656,42.459999084472656,7.156783103942871,94.12000274658203,15.619999885559082,25.549999237060547,24.6299991607666,28.530000686645508,31.899999618530273,37.61000061035156,79.5199966430664,105.70999908447266,77.1500015258789,98.9000015258789,75.83999633789062\n2009-04-01,25.6299991607666,15.199999809265137,102.63999938964844,32.52000045776367,38.56999969482422,96.55000305175781,17.489999771118164,21.520000457763672,22.65999984741211,43.36000061035156,7.359869956970215,93.45999908447266,16.059999465942383,25.649999618530273,25.25,29.219999313354492,32.72999954223633,38.43000030517578,81.05999755859375,106.37000274658203,77.02999877929688,98.33000183105469,77.52999877929688\n2009-04-02,27.020000457763672,16.100000381469727,102.01000213623047,33.68000030517578,40.310001373291016,95.91999816894531,18.3799991607666,22.639999389648438,23.510000228881836,45.13999938964844,7.562956809997559,93.48999786376953,16.479999542236328,25.979999542236328,26.510000228881836,30.799999237060547,34.189998626708984,40.029998779296875,83.43000030517578,105.06999969482422,76.87999725341797,98.58999633789062,79.70999908447266\n2009-04-03,27.350000381469727,16.489999771118164,101.33999633789062,33.400001525878906,40.540000915527344,94.81999969482422,18.59000015258789,22.760000228881836,23.809999465942383,46.02000045776367,7.871649265289307,92.91000366210938,16.709999084472656,26.149999618530273,26.950000762939453,30.950000762939453,34.58000183105469,39.97999954223633,84.26000213623047,102.91999816894531,76.47000122070312,98.05999755859375,80.16000366210938\n2009-04-06,27.010000228881836,16.170000076293945,101.26000213623047,32.68000030517578,39.70000076293945,94.5999984741211,18.239999771118164,22.260000228881836,23.389999389648438,45.09000015258789,7.660438537597656,92.86000061035156,16.540000915527344,25.93000030517578,26.549999237060547,30.899999618530273,33.93000030517578,39.34000015258789,83.5999984741211,102.4800033569336,76.55000305175781,98.37999725341797,79.76000213623047\n2009-04-07,26.389999389648438,15.680000305175781,101.12000274658203,32.47999954223633,38.869998931884766,94.83999633789062,17.639999389648438,21.639999389648438,22.59000015258789,43.7400016784668,7.432981491088867,92.81999969482422,16.079999923706055,25.809999465942383,25.989999771118164,30.290000915527344,32.88999938964844,38.869998931884766,81.6500015258789,102.73999786376953,76.69999694824219,98.62000274658203,77.88999938964844\n2009-04-08,26.780000686645508,15.970000267028809,101.62000274658203,32.720001220703125,39.2599983215332,95.30999755859375,17.850000381469727,21.639999389648438,22.850000381469727,44.29999923706055,7.473598480224609,93.75,16.31999969482422,26.059999465942383,26.0,30.510000228881836,33.2400016784668,39.06999969482422,82.52999877929688,103.6500015258789,77.05999755859375,98.72000122070312,78.37000274658203\n2009-04-09,27.950000762939453,16.3799991607666,101.30999755859375,33.91999816894531,40.310001373291016,94.75,18.229999542236328,22.200000762939453,23.84000015258789,45.599998474121094,8.635255813598633,94.37999725341797,16.729999542236328,26.06999969482422,26.90999984741211,31.850000381469727,34.040000915527344,40.47999954223633,85.80999755859375,102.3499984741211,76.97000122070312,99.18000030517578,80.88999938964844\n2009-04-13,28.1200008392334,16.690000534057617,101.7699966430664,34.0,40.709999084472656,95.30999755859375,18.459999084472656,22.459999084472656,24.149999618530273,45.099998474121094,9.000812530517578,95.29000091552734,16.729999542236328,25.729999542236328,27.3799991607666,32.16999816894531,34.540000915527344,40.63999938964844,85.83000183105469,103.29000091552734,77.08999633789062,99.61000061035156,80.55000305175781\n2009-04-14,27.670000076293945,16.520000457763672,101.81999969482422,33.68000030517578,40.31999969482422,95.80000305175781,18.170000076293945,22.18000030517578,23.700000762939453,44.97999954223633,8.407798767089844,95.54000091552734,16.549999237060547,25.399999618530273,27.059999465942383,32.06999969482422,34.11000061035156,40.34000015258789,84.3499984741211,103.83000183105469,77.29000091552734,99.5999984741211,79.2699966430664\n2009-04-15,28.06999969482422,16.75,101.87999725341797,33.84000015258789,40.849998474121094,95.88999938964844,18.450000762939453,22.719999313354492,24.260000228881836,45.040000915527344,8.813972473144531,96.27999877929688,16.5,25.639999389648438,27.610000610351562,33.09000015258789,34.70000076293945,40.75,85.25,103.6500015258789,77.4000015258789,99.80000305175781,80.30000305175781\n2009-04-16,28.309999465942383,16.90999984741211,101.5,33.959999084472656,41.11000061035156,95.51000213623047,18.549999237060547,22.899999618530273,24.270000457763672,45.25,8.911454200744629,96.69000244140625,16.989999771118164,25.81999969482422,27.81999969482422,32.939998626708984,35.11000061035156,40.86000061035156,86.5,102.83000183105469,77.25,100.02999877929688,81.26000213623047\n2009-04-17,28.110000610351562,16.829999923706055,100.5,34.119998931884766,40.970001220703125,94.73999786376953,18.579999923706055,22.860000610351562,24.450000762939453,45.779998779296875,9.025182723999023,96.56999969482422,16.959999084472656,25.780000686645508,27.510000228881836,32.439998626708984,35.0099983215332,40.900001525878906,87.08000183105469,101.69999694824219,76.83999633789062,100.2699966430664,81.30999755859375\n2009-04-20,26.739999771118164,15.930000305175781,100.58999633789062,33.36000061035156,39.290000915527344,95.4000015258789,17.559999465942383,21.68000030517578,23.31999969482422,43.560001373291016,8.017871856689453,96.04000091552734,16.420000076293945,25.489999771118164,26.020000457763672,31.3700008392334,33.22999954223633,39.70000076293945,83.43000030517578,103.23999786376953,77.22000122070312,100.5,78.5199966430664\n2009-04-21,27.309999465942383,16.260000228881836,100.25,33.7599983215332,40.189998626708984,95.02999877929688,18.0,22.299999237060547,23.790000915527344,44.41999816894531,8.610885620117188,96.33999633789062,16.700000762939453,25.579999923706055,26.780000686645508,32.22999954223633,34.06999969482422,40.459999084472656,85.05999755859375,102.22000122070312,77.06999969482422,100.26000213623047,79.58999633789062\n2009-04-22,27.079999923706055,16.399999618530273,100.5,33.880001068115234,39.869998931884766,94.80000305175781,17.93000030517578,21.81999969482422,23.899999618530273,43.95000076293945,8.302193641662598,96.0999984741211,16.780000686645508,25.309999465942383,26.329999923706055,31.139999389648438,33.7400016784668,40.209999084472656,84.54000091552734,101.5999984741211,77.20999908447266,100.37999725341797,78.80999755859375\n2009-04-23,27.5,16.709999084472656,101.02999877929688,34.08000183105469,40.869998931884766,94.77999877929688,18.549999237060547,22.540000915527344,23.959999084472656,44.77000045776367,8.692120552062988,96.0199966430664,16.860000610351562,25.399999618530273,27.15999984741211,31.709999084472656,34.709999084472656,40.77000045776367,85.37000274658203,101.58999633789062,77.2699966430664,100.54000091552734,79.6500015258789\n2009-04-24,28.020000457763672,17.0,101.25,34.599998474121094,41.5,94.41000366210938,19.049999237060547,22.84000015258789,25.100000381469727,46.06999969482422,8.887084007263184,96.2300033569336,17.100000381469727,25.360000610351562,27.5,32.31999969482422,35.349998474121094,41.33000183105469,86.66000366210938,100.56999969482422,77.2300033569336,100.56999969482422,80.7300033569336\n2009-04-27,27.079999923706055,16.739999771118164,101.3499984741211,34.52000045776367,41.0099983215332,94.80000305175781,18.6200008392334,22.84000015258789,24.549999237060547,45.20000076293945,8.740860939025879,96.11000061035156,17.020000457763672,25.540000915527344,26.649999618530273,30.889999389648438,34.84000015258789,40.91999816894531,85.83999633789062,101.0,77.4000015258789,100.66999816894531,80.26000213623047\n2009-04-28,26.989999771118164,16.68000030517578,101.3499984741211,33.959999084472656,40.619998931884766,94.33999633789062,18.59000015258789,22.5,24.420000076293945,45.29999923706055,8.472785949707031,95.80000305175781,17.010000228881836,25.639999389648438,26.280000686645508,30.549999237060547,34.7400016784668,40.209999084472656,85.56999969482422,99.3499984741211,77.12000274658203,100.55000305175781,80.12000274658203\n2009-04-29,28.40999984741211,17.1299991607666,100.93000030517578,34.2400016784668,41.65999984741211,93.83000183105469,19.110000610351562,23.15999984741211,24.969999313354492,46.54999923706055,8.838342666625977,96.26000213623047,17.200000762939453,25.829999923706055,27.420000076293945,31.959999084472656,35.7400016784668,40.86000061035156,87.38999938964844,98.47000122070312,77.01000213623047,100.7699966430664,81.7699966430664\n2009-04-30,28.670000076293945,17.290000915527344,100.44000244140625,34.040000915527344,41.91999816894531,93.66999816894531,19.149999618530273,23.459999084472656,25.670000076293945,45.779998779296875,8.716490745544434,96.19999694824219,17.25,25.850000381469727,27.770000457763672,31.979999542236328,36.099998474121094,40.939998626708984,87.41999816894531,98.08000183105469,77.2300033569336,100.94999694824219,81.66999816894531\n2009-05-01,29.09000015258789,17.420000076293945,98.8499984741211,34.560001373291016,42.40999984741211,93.08999633789062,19.59000015258789,24.100000381469727,25.729999542236328,47.2599983215332,8.65150260925293,95.97000122070312,17.479999542236328,26.530000686645508,27.850000381469727,32.27000045776367,36.720001220703125,41.38999938964844,87.88999938964844,97.11000061035156,76.83000183105469,100.52999877929688,82.16000366210938\n2009-05-04,31.100000381469727,18.1299991607666,99.02999877929688,35.47999954223633,44.16999816894531,93.18000030517578,20.299999237060547,24.739999771118164,27.18000030517578,49.150001525878906,9.528838157653809,96.19999694824219,17.799999237060547,26.93000030517578,29.56999969482422,35.15999984741211,38.06999969482422,42.959999084472656,90.87999725341797,97.43000030517578,76.88999938964844,100.86000061035156,84.23999786376953\n2009-05-05,30.81999969482422,17.829999923706055,99.05999755859375,35.36000061035156,43.72999954223633,93.16000366210938,20.059999465942383,24.68000030517578,27.020000457763672,48.4900016784668,9.390739440917969,96.51000213623047,17.690000534057617,26.8799991607666,29.31999969482422,34.29999923706055,37.72999954223633,42.779998779296875,90.56999969482422,97.30999755859375,76.87999725341797,100.87000274658203,84.16000366210938\n2009-05-06,31.350000381469727,18.15999984741211,99.45999908447266,36.20000076293945,44.790000915527344,93.19999694824219,20.56999969482422,25.5,27.1299991607666,50.369998931884766,10.13809871673584,96.94000244140625,17.790000915527344,26.719999313354492,30.350000381469727,35.43000030517578,38.58000183105469,43.90999984741211,92.13999938964844,97.08000183105469,77.20999908447266,101.27999877929688,85.19999694824219\n2009-05-07,30.56999969482422,17.799999237060547,99.55999755859375,35.36000061035156,44.040000915527344,92.41999816894531,20.309999465942383,25.040000915527344,26.239999771118164,49.720001220703125,9.845653533935547,96.01000213623047,17.110000610351562,26.860000610351562,30.010000228881836,34.349998474121094,37.9900016784668,43.119998931884766,90.86000061035156,94.70999908447266,76.94000244140625,101.18000030517578,84.16999816894531\n2009-05-08,31.59000015258789,18.639999389648438,99.5999984741211,36.79999923706055,45.95000076293945,92.52999877929688,21.190000534057617,26.18000030517578,26.799999237060547,51.84000015258789,10.576766967773438,96.62000274658203,17.09000015258789,27.25,31.25,35.90999984741211,39.630001068115234,44.75,92.9800033569336,94.94000244140625,77.12999725341797,101.37999725341797,85.72000122070312\n2009-05-11,30.850000381469727,18.100000381469727,100.0999984741211,36.439998626708984,44.779998779296875,93.4000015258789,20.450000762939453,25.260000228881836,26.40999984741211,50.2599983215332,9.959383010864258,96.91000366210938,17.139999389648438,27.1299991607666,29.899999618530273,34.36000061035156,38.52000045776367,44.04999923706055,91.23999786376953,96.29000091552734,77.44999694824219,101.33999633789062,84.43000030517578\n2009-05-12,31.06999969482422,18.25,100.41000366210938,36.63999938964844,45.2599983215332,93.33999633789062,20.600000381469727,25.739999771118164,26.670000076293945,50.58000183105469,9.74817180633545,97.18000030517578,17.049999237060547,27.31999969482422,30.1299991607666,34.369998931884766,38.900001525878906,44.220001220703125,90.97000122070312,96.63999938964844,77.41999816894531,102.13999938964844,84.72000122070312\n2009-05-13,29.93000030517578,17.530000686645508,100.38999938964844,35.959999084472656,43.720001220703125,93.7699966430664,19.899999618530273,24.739999771118164,25.520000457763672,48.90999984741211,9.252639770507812,97.0,16.6200008392334,26.59000015258789,28.959999084472656,33.58000183105469,37.599998474121094,43.2400016784668,88.68000030517578,97.69000244140625,77.6500015258789,102.48999786376953,83.12999725341797\n2009-05-14,30.360000610351562,17.739999771118164,100.94999694824219,36.0,44.150001525878906,93.77999877929688,20.100000381469727,25.139999389648438,25.739999771118164,49.04999923706055,9.561332702636719,97.22000122070312,16.799999237060547,26.56999969482422,29.34000015258789,33.77000045776367,38.119998931884766,43.29999923706055,89.44000244140625,98.06999969482422,77.62000274658203,102.20999908447266,83.38999938964844\n2009-05-15,30.079999923706055,17.420000076293945,101.16000366210938,36.36000061035156,43.75,93.55000305175781,19.760000228881836,24.920000076293945,25.829999923706055,48.0,9.366369247436523,97.19999694824219,16.799999237060547,25.940000534057617,28.8799991607666,33.68000030517578,37.560001373291016,43.54999923706055,88.70999908447266,98.04000091552734,77.5999984741211,102.38999938964844,82.77999877929688\n2009-05-18,31.75,18.190000534057617,101.12999725341797,36.68000030517578,45.41999816894531,93.0,20.59000015258789,26.040000915527344,26.56999969482422,49.65999984741211,9.983753204345703,97.05999755859375,17.260000228881836,25.940000534057617,30.360000610351562,35.65999984741211,39.27000045776367,44.16999816894531,91.2300033569336,96.5199966430664,77.37000274658203,102.08999633789062,85.12000274658203\n2009-05-19,32.11000061035156,18.510000228881836,101.33000183105469,36.439998626708984,45.83000183105469,92.87000274658203,20.81999969482422,26.360000610351562,26.8799991607666,49.900001525878906,9.78066635131836,97.44999694824219,17.360000610351562,26.40999984741211,30.719999313354492,35.79999923706055,39.810001373291016,44.380001068115234,91.12000274658203,96.01000213623047,77.54000091552734,102.25,84.73999786376953\n2009-05-20,32.209999084472656,18.860000610351562,101.87000274658203,36.91999816894531,46.130001068115234,93.16000366210938,21.059999465942383,26.540000915527344,27.0,50.06999969482422,9.52071475982666,98.01000213623047,17.18000030517578,25.93000030517578,30.65999984741211,35.380001068115234,39.88999938964844,44.66999816894531,90.51000213623047,97.0199966430664,77.7699966430664,102.41999816894531,84.19000244140625\n2009-05-21,31.610000610351562,18.65999984741211,100.87000274658203,36.439998626708984,45.779998779296875,92.13999938964844,21.059999465942383,26.34000015258789,26.399999618530273,48.59000015258789,9.536961555480957,97.01000213623047,16.8799991607666,25.6200008392334,30.049999237060547,34.72999954223633,39.869998931884766,44.06999969482422,89.20999908447266,94.58000183105469,77.37000274658203,102.05000305175781,83.0999984741211\n2009-05-22,31.75,18.829999923706055,101.05000305175781,36.560001373291016,46.040000915527344,91.5999984741211,21.09000015258789,26.280000686645508,26.299999237060547,48.61000061035156,9.47197437286377,96.87999725341797,16.940000534057617,25.829999923706055,30.34000015258789,34.689998626708984,40.06999969482422,44.27000045776367,89.0199966430664,93.52999877929688,77.3499984741211,102.37999725341797,82.87000274658203\n2009-05-26,32.130001068115234,19.100000381469727,100.62000274658203,37.7599983215332,46.959999084472656,90.98999786376953,21.479999542236328,26.719999313354492,26.93000030517578,49.63999938964844,9.78066635131836,96.83999633789062,17.3799991607666,26.579999923706055,31.299999237060547,35.119998931884766,40.70000076293945,45.400001525878906,91.30000305175781,92.12000274658203,77.19000244140625,102.27999877929688,84.8499984741211\n2009-05-27,31.760000228881836,18.84000015258789,100.38999938964844,37.040000915527344,46.04999923706055,89.95999908447266,21.190000534057617,26.639999389648438,25.920000076293945,49.099998474121094,9.488221168518066,96.16999816894531,17.209999084472656,26.040000915527344,30.610000610351562,35.36000061035156,40.08000183105469,44.7400016784668,89.66999816894531,90.48999786376953,76.7300033569336,102.70999908447266,83.16000366210938\n2009-05-28,32.7400016784668,19.0,100.5,36.79999923706055,46.52000045776367,90.43000030517578,21.549999237060547,26.799999237060547,26.3799991607666,50.72999954223633,9.756296157836914,96.52999877929688,17.459999084472656,26.579999923706055,30.8700008392334,36.15999984741211,40.54999923706055,44.75,90.91999816894531,91.80000305175781,76.93000030517578,103.08000183105469,84.0199966430664\n2009-05-29,33.2400016784668,19.34000015258789,101.80999755859375,37.47999954223633,47.45000076293945,91.44999694824219,21.940000534057617,27.459999084472656,27.170000076293945,51.68000030517578,9.935011863708496,97.94999694824219,17.649999618530273,26.770000457763672,32.06999969482422,37.369998931884766,41.25,45.84000015258789,92.52999877929688,94.16999816894531,77.4800033569336,102.80000305175781,85.38999938964844\n2009-06-01,34.63999938964844,19.950000762939453,100.62999725341797,38.08000183105469,48.619998931884766,89.69000244140625,22.350000381469727,28.239999771118164,28.0,53.58000183105469,10.040616989135742,97.43000030517578,18.149999618530273,27.6299991607666,33.220001220703125,39.529998779296875,42.25,46.86000061035156,94.7699966430664,91.08999633789062,76.69000244140625,102.63999938964844,87.3499984741211\n2009-06-02,34.13999938964844,20.260000228881836,101.3499984741211,38.119998931884766,49.040000915527344,89.98999786376953,22.729999542236328,28.420000076293945,28.280000686645508,53.439998626708984,9.878148078918457,98.1500015258789,18.110000610351562,27.299999237060547,33.459999084472656,38.720001220703125,42.79999923706055,47.06999969482422,94.8499984741211,91.58000183105469,76.9800033569336,102.86000061035156,87.5\n2009-06-03,32.93000030517578,19.6200008392334,101.30999755859375,37.279998779296875,47.58000183105469,90.54000091552734,22.1299991607666,27.200000762939453,27.309999465942383,51.380001068115234,9.74817180633545,98.6500015258789,17.90999984741211,26.84000015258789,32.72999954223633,38.02000045776367,41.400001525878906,46.02000045776367,93.6500015258789,92.44000244140625,77.23999786376953,103.33999633789062,86.94999694824219\n2009-06-04,33.540000915527344,19.760000228881836,100.29000091552734,37.560001373291016,47.880001068115234,89.48999786376953,22.280000686645508,27.15999984741211,27.940000534057617,52.540000915527344,10.097481727600098,98.22000122070312,18.15999984741211,27.09000015258789,32.75,38.75,41.65999984741211,46.29999923706055,94.52999877929688,90.52999877929688,76.76000213623047,102.25,87.51000213623047\n2009-06-05,33.61000061035156,19.389999389648438,99.9000015258789,37.119998931884766,47.290000915527344,88.5999984741211,21.920000076293945,26.959999084472656,27.540000915527344,52.11000061035156,10.008123397827148,97.69999694824219,18.34000015258789,27.1200008392334,32.68000030517578,39.040000915527344,41.06999969482422,46.0,94.55000305175781,89.83999633789062,76.23999786376953,102.05999755859375,87.91000366210938\n2009-06-08,33.09000015258789,19.299999237060547,99.51000213623047,37.31999969482422,47.189998626708984,88.1500015258789,21.790000915527344,27.15999984741211,27.399999618530273,51.9900016784668,10.0812349319458,97.5,18.229999542236328,26.950000762939453,32.2599983215332,38.54999923706055,40.97999954223633,45.83000183105469,94.16000366210938,89.61000061035156,76.08000183105469,102.20999908447266,87.73999786376953\n2009-06-09,33.150001525878906,19.290000915527344,100.18000030517578,37.63999938964844,47.77000045776367,88.52999877929688,21.940000534057617,27.299999237060547,27.889999389648438,52.5,10.154346466064453,98.23999786376953,18.309999465942383,26.8799991607666,32.599998474121094,38.06999969482422,41.40999984741211,46.08000183105469,94.63999938964844,89.5999984741211,76.29000091552734,102.73999786376953,87.73999786376953\n2009-06-10,33.56999969482422,19.420000076293945,100.2300033569336,37.68000030517578,47.86000061035156,88.0,21.770000457763672,27.520000457763672,27.920000076293945,52.970001220703125,10.0,97.94999694824219,18.360000610351562,27.299999237060547,33.15999984741211,39.16999816894531,41.43000030517578,46.459999084472656,94.4000015258789,88.19000244140625,76.0999984741211,102.86000061035156,87.6500015258789\n2009-06-11,34.290000915527344,19.649999618530273,100.41999816894531,38.31999969482422,48.68000030517578,88.5999984741211,22.0,27.959999084472656,28.309999465942383,54.029998779296875,10.0812349319458,98.29000091552734,18.43000030517578,27.829999923706055,33.880001068115234,40.119998931884766,42.060001373291016,47.25,94.81999969482422,89.16999816894531,76.47000122070312,103.05999755859375,87.86000061035156\n2009-06-12,33.7400016784668,19.540000915527344,100.2300033569336,38.279998779296875,48.43000030517578,89.06999969482422,22.010000228881836,27.739999771118164,28.020000457763672,53.5099983215332,10.146222114562988,99.0199966430664,18.3799991607666,28.18000030517578,33.41999816894531,39.560001373291016,41.88999938964844,47.0099983215332,95.08000183105469,89.97000122070312,76.66999816894531,103.0199966430664,88.30999755859375\n2009-06-15,32.529998779296875,18.649999618530273,100.12000274658203,37.599998474121094,46.689998626708984,89.47000122070312,21.1200008392334,26.860000610351562,27.079999923706055,52.09000015258789,9.886271476745605,99.05000305175781,18.190000534057617,27.610000610351562,32.119998931884766,38.22999954223633,40.22999954223633,45.81999969482422,92.9000015258789,90.77999877929688,76.81999969482422,102.93000030517578,86.48999786376953\n2009-06-16,32.040000915527344,18.34000015258789,100.44999694824219,37.20000076293945,46.150001525878906,89.97000122070312,20.829999923706055,26.780000686645508,26.350000381469727,50.97999954223633,9.715678215026855,98.98999786376953,17.959999084472656,27.420000076293945,31.75,37.22999954223633,39.93000030517578,45.2599983215332,91.63999938964844,92.36000061035156,77.18000030517578,103.16999816894531,85.26000213623047\n2009-06-17,31.68000030517578,18.389999389648438,99.79000091552734,37.63999938964844,46.279998779296875,89.7300033569336,20.84000015258789,26.780000686645508,26.049999237060547,50.150001525878906,9.431356430053711,99.11000061035156,18.059999465942383,27.5,31.450000762939453,37.349998474121094,39.83000183105469,45.4900016784668,91.55000305175781,91.83999633789062,77.13999938964844,103.30000305175781,85.2300033569336\n2009-06-18,31.59000015258789,18.3799991607666,99.54000091552734,37.31999969482422,46.20000076293945,88.63999938964844,20.940000534057617,26.6200008392334,26.270000457763672,49.959999084472656,9.658814430236816,97.8499984741211,17.979999542236328,28.1200008392334,31.75,37.15999984741211,39.86000061035156,45.4900016784668,92.22000122070312,90.44999694824219,76.56999969482422,103.16000366210938,85.62000274658203\n2009-06-19,31.75,18.489999771118164,100.16999816894531,37.91999816894531,46.93000030517578,89.05000305175781,21.209999084472656,27.260000228881836,26.06999969482422,49.209999084472656,9.78066635131836,98.58999633789062,18.1200008392334,27.469999313354492,31.959999084472656,37.27000045776367,40.40999984741211,46.04999923706055,92.04000091552734,91.69000244140625,76.75,103.30000305175781,85.30999755859375\n2009-06-22,30.600000381469727,17.81999969482422,100.33999633789062,37.08000183105469,45.41999816894531,89.52999877929688,20.389999389648438,26.239999771118164,24.75,46.75,9.21202278137207,98.94999694824219,17.670000076293945,27.389999389648438,30.729999542236328,36.08000183105469,39.0099983215332,44.869998931884766,89.27999877929688,92.58000183105469,76.93000030517578,103.6500015258789,83.31999969482422\n2009-06-23,30.549999237060547,17.6200008392334,100.83000183105469,37.119998931884766,45.060001373291016,89.81999969482422,20.260000228881836,26.059999465942383,25.06999969482422,47.029998779296875,9.317627906799316,99.75,17.68000030517578,27.149999618530273,30.190000534057617,35.810001373291016,39.52000045776367,44.90999984741211,89.3499984741211,93.66999816894531,77.27999877929688,102.94000244140625,83.18000030517578\n2009-06-24,31.219999313354492,17.739999771118164,100.30999755859375,37.20000076293945,45.099998474121094,89.4800033569336,20.290000915527344,26.219999313354492,25.31999969482422,47.220001220703125,9.431356430053711,99.58999633789062,17.93000030517578,27.3799991607666,30.75,36.880001068115234,39.63999938964844,45.439998626708984,90.12000274658203,92.7300033569336,77.11000061035156,103.0,83.02999877929688\n2009-06-25,32.150001525878906,17.940000534057617,100.88999938964844,38.08000183105469,46.04999923706055,90.5999984741211,20.56999969482422,26.34000015258789,25.860000610351562,48.209999084472656,9.634443283081055,100.37000274658203,18.190000534057617,27.84000015258789,31.489999771118164,37.970001220703125,40.290000915527344,46.54999923706055,92.08000183105469,94.43000030517578,77.63999938964844,102.72000122070312,84.72000122070312\n2009-06-26,32.31999969482422,17.8799991607666,100.88999938964844,38.20000076293945,45.959999084472656,90.72000122070312,20.389999389648438,26.219999313354492,25.81999969482422,47.88999938964844,9.683184623718262,100.41999816894531,18.15999984741211,27.739999771118164,31.760000228881836,38.369998931884766,40.18000030517578,46.75,91.83999633789062,94.58999633789062,77.68000030517578,102.98999786376953,84.2699966430664\n2009-06-29,32.560001373291016,18.229999542236328,100.95999908447266,38.0,46.349998474121094,90.91000366210938,20.760000228881836,26.579999923706055,26.049999237060547,48.34000015258789,9.805036544799805,100.30999755859375,18.350000381469727,28.100000381469727,32.029998779296875,38.779998779296875,40.709999084472656,46.65999984741211,92.69999694824219,94.7300033569336,77.81999969482422,103.12000274658203,85.25\n2009-06-30,32.22999954223633,17.979999542236328,101.63999938964844,37.720001220703125,45.810001373291016,90.66999816894531,20.469999313354492,26.420000076293945,25.799999237060547,48.04999923706055,9.707554817199707,100.27999877929688,18.209999084472656,27.889999389648438,31.670000076293945,38.369998931884766,40.279998779296875,46.2400016784668,91.94999694824219,94.56999969482422,77.69000244140625,103.06999969482422,84.66000366210938\n2009-07-01,32.81999969482422,18.360000610351562,101.04000091552734,38.15999984741211,46.56999969482422,90.36000061035156,20.920000076293945,26.65999984741211,25.860000610351562,48.09000015258789,9.650690078735352,99.69999694824219,18.290000915527344,28.25,31.84000015258789,38.720001220703125,41.08000183105469,46.560001373291016,92.33000183105469,94.08000183105469,77.37999725341797,102.58000183105469,85.02999877929688\n2009-07-02,31.920000076293945,17.639999389648438,100.79000091552734,37.31999969482422,45.22999954223633,90.66000366210938,20.260000228881836,26.020000457763672,25.149999618530273,46.15999984741211,9.317627906799316,99.70999908447266,17.829999923706055,27.440000534057617,30.68000030517578,37.439998626708984,39.880001068115234,45.31999969482422,89.80999755859375,94.30000305175781,77.41000366210938,102.97000122070312,82.98999786376953\n2009-07-06,31.850000381469727,17.459999084472656,100.55000305175781,37.560001373291016,45.290000915527344,90.72000122070312,20.170000076293945,25.979999542236328,24.950000762939453,45.689998626708984,9.325751304626465,99.94999694824219,17.780000686645508,27.600000381469727,30.530000686645508,38.16999816894531,39.61000061035156,45.619998931884766,89.80000305175781,94.12000274658203,77.3499984741211,103.66999816894531,83.25\n2009-07-07,31.100000381469727,16.940000534057617,100.70999908447266,37.15999984741211,44.189998626708984,91.08000183105469,19.6299991607666,25.34000015258789,24.239999771118164,44.52000045776367,9.179529190063477,99.55000305175781,17.34000015258789,27.049999237060547,29.790000915527344,36.79999923706055,38.599998474121094,44.84000015258789,88.05999755859375,94.75,77.51000213623047,103.0199966430664,81.55000305175781\n2009-07-08,30.739999771118164,16.920000076293945,101.06999969482422,37.15999984741211,44.0099983215332,92.12999725341797,19.450000762939453,25.020000457763672,24.260000228881836,44.529998779296875,9.025182723999023,100.45999908447266,17.350000381469727,26.93000030517578,29.6299991607666,36.5099983215332,38.34000015258789,44.689998626708984,88.0,96.5,78.04000091552734,103.04000091552734,81.93000030517578\n2009-07-09,31.290000915527344,17.270000457763672,100.25,37.15999984741211,44.54999923706055,91.58999633789062,19.649999618530273,25.5,24.450000762939453,44.9900016784668,9.138911247253418,100.5,17.459999084472656,26.940000534057617,30.110000610351562,37.150001525878906,39.060001373291016,44.86000061035156,88.16999816894531,95.3499984741211,77.80999755859375,103.26000213623047,81.7699966430664\n2009-07-10,30.920000076293945,17.040000915527344,100.6500015258789,36.7599983215332,44.029998779296875,92.16000366210938,19.3799991607666,25.139999389648438,24.309999465942383,44.66999816894531,9.017059326171875,100.9000015258789,17.530000686645508,26.90999984741211,29.920000076293945,36.869998931884766,38.470001220703125,44.4900016784668,87.95999908447266,96.2300033569336,78.08999633789062,103.25,81.44000244140625\n2009-07-13,31.139999389648438,17.600000381469727,100.23999786376953,36.84000015258789,44.79999923706055,91.83000183105469,19.860000610351562,25.579999923706055,25.049999237060547,45.349998474121094,9.593826293945312,100.83999633789062,17.860000610351562,27.3799991607666,30.1299991607666,36.709999084472656,39.4900016784668,44.7599983215332,90.0999984741211,95.69000244140625,77.95999908447266,103.52999877929688,83.30999755859375\n2009-07-14,31.479999542236328,17.700000762939453,100.16000366210938,36.84000015258789,45.040000915527344,91.22000122070312,19.940000534057617,25.84000015258789,25.239999771118164,45.959999084472656,9.553208351135254,100.62000274658203,17.8799991607666,27.59000015258789,31.079999923706055,37.41999816894531,39.689998626708984,45.02000045776367,90.61000061035156,94.0999984741211,77.7300033569336,103.0,83.66000366210938\n2009-07-15,33.16999816894531,18.56999969482422,99.88999938964844,37.2400016784668,46.58000183105469,90.04000091552734,20.790000915527344,27.059999465942383,26.229999542236328,47.59000015258789,9.959383010864258,99.69000244140625,18.549999237060547,28.139999389648438,32.47999954223633,39.02000045776367,41.29999923706055,46.11000061035156,93.26000213623047,91.68000030517578,77.33999633789062,103.19999694824219,86.19999694824219\n2009-07-16,33.22999954223633,18.809999465942383,100.51000213623047,37.08000183105469,46.9900016784668,90.58000183105469,21.200000762939453,27.18000030517578,26.479999542236328,48.16999816894531,9.926888465881348,100.37999725341797,18.81999969482422,28.149999618530273,32.650001525878906,38.72999954223633,41.880001068115234,46.150001525878906,93.11000061035156,92.66999816894531,77.68000030517578,103.58000183105469,87.2300033569336\n2009-07-17,33.56999969482422,18.719999313354492,100.47000122070312,37.08000183105469,46.81999969482422,89.97000122070312,21.149999618530273,26.959999084472656,26.610000610351562,48.45000076293945,9.86190128326416,100.06999969482422,19.0,28.020000457763672,32.63999938964844,39.34000015258789,41.650001525878906,46.02000045776367,94.12999725341797,91.23999786376953,77.4800033569336,103.58000183105469,87.45999908447266\n2009-07-20,34.77000045776367,19.100000381469727,101.05000305175781,37.560001373291016,47.72999954223633,90.30000305175781,21.610000610351562,27.6200008392334,27.18000030517578,49.279998779296875,9.943135261535645,100.4800033569336,19.170000076293945,28.229999542236328,33.650001525878906,40.91999816894531,42.61000061035156,46.93000030517578,95.12999725341797,91.72000122070312,77.7300033569336,103.70999908447266,88.33000183105469\n2009-07-21,34.66999816894531,19.229999542236328,101.27999877929688,37.880001068115234,48.029998779296875,91.30999755859375,21.739999771118164,27.540000915527344,27.5,49.709999084472656,9.853777885437012,101.9000015258789,19.280000686645508,28.510000228881836,33.66999816894531,40.720001220703125,42.7400016784668,47.290000915527344,95.56999969482422,93.55000305175781,78.19999694824219,103.75,89.16999816894531\n2009-07-22,34.59000015258789,19.290000915527344,101.01000213623047,38.31999969482422,48.150001525878906,90.7699966430664,21.739999771118164,27.68000030517578,27.579999923706055,49.2599983215332,9.86190128326416,101.62999725341797,19.389999389648438,28.360000610351562,33.5,40.41999816894531,42.790000915527344,47.650001525878906,95.55000305175781,92.70999908447266,78.02999877929688,103.91000366210938,88.87999725341797\n2009-07-23,35.56999969482422,19.790000915527344,100.5199966430664,38.47999954223633,48.959999084472656,89.88999938964844,22.149999618530273,28.280000686645508,28.520000457763672,50.65999984741211,10.146222114562988,101.45999908447266,19.770000457763672,29.100000381469727,34.31999969482422,42.060001373291016,43.599998474121094,48.119998931884766,97.66000366210938,91.01000213623047,77.7699966430664,103.79000091552734,90.62999725341797\n2009-07-24,35.400001525878906,19.90999984741211,100.56999969482422,38.68000030517578,49.2599983215332,90.08000183105469,22.299999237060547,28.459999084472656,28.75,51.189998626708984,10.08935832977295,101.73999786376953,19.649999618530273,29.559999465942383,34.189998626708984,42.2599983215332,43.91999816894531,48.20000076293945,98.05999755859375,91.44999694824219,77.80000305175781,104.13999938964844,90.97000122070312\n2009-07-27,35.709999084472656,19.93000030517578,100.37999725341797,38.599998474121094,49.310001373291016,89.66000366210938,22.229999542236328,28.399999618530273,28.809999465942383,51.36000061035156,10.25182819366455,101.51000213623047,19.649999618530273,29.489999771118164,34.68000030517578,42.66999816894531,44.099998474121094,48.439998626708984,98.3499984741211,90.4000015258789,77.69999694824219,104.5,91.13999938964844\n2009-07-28,35.54999923706055,19.639999389648438,100.29000091552734,38.560001373291016,49.099998474121094,89.83999633789062,22.059999465942383,28.15999984741211,28.56999969482422,50.61000061035156,10.227457046508789,101.9000015258789,19.690000534057617,29.010000228881836,34.939998626708984,42.869998931884766,43.560001373291016,48.439998626708984,97.88999938964844,91.19999694824219,77.77999877929688,103.83999633789062,90.98999786376953\n2009-07-29,34.75,19.639999389648438,100.23999786376953,38.84000015258789,48.70000076293945,89.9000015258789,21.940000534057617,27.899999618530273,27.969999313354492,49.439998626708984,10.227457046508789,102.54000091552734,19.670000076293945,28.8700008392334,34.22999954223633,41.2599983215332,43.220001220703125,48.2400016784668,97.6500015258789,91.69999694824219,77.75,103.75,90.68000030517578\n2009-07-30,35.61000061035156,19.809999465942383,100.80999755859375,39.279998779296875,49.650001525878906,90.26000213623047,22.270000457763672,28.5,28.81999969482422,50.130001068115234,10.463038444519043,103.0999984741211,19.770000457763672,29.309999465942383,35.27000045776367,42.0,44.06999969482422,49.279998779296875,98.66999816894531,93.0,78.0999984741211,103.80000305175781,91.41999816894531\n2009-07-31,35.779998779296875,20.139999389648438,101.33999633789062,39.47999954223633,50.40999984741211,91.16999816894531,22.610000610351562,28.65999984741211,29.1200008392334,50.619998931884766,10.568643569946289,104.45999908447266,19.700000762939453,28.940000534057617,35.689998626708984,41.86000061035156,44.849998474121094,49.650001525878906,98.80999755859375,94.80999755859375,78.44000244140625,104.2699966430664,91.66999816894531\n2009-08-03,37.119998931884766,20.790000915527344,100.38999938964844,40.15999984741211,51.58000183105469,89.94000244140625,23.329999923706055,29.68000030517578,30.149999618530273,51.91999816894531,10.836718559265137,103.0,19.969999313354492,29.229999542236328,36.560001373291016,43.560001373291016,46.06999969482422,50.66999816894531,100.44000244140625,93.05999755859375,77.93000030517578,104.04000091552734,92.86000061035156\n2009-08-04,36.779998779296875,20.729999542236328,100.02999877929688,40.119998931884766,51.5,89.68000030517578,23.309999465942383,29.639999389648438,30.040000915527344,51.83000183105469,11.056052207946777,102.4800033569336,19.90999984741211,28.799999237060547,36.47999954223633,42.790000915527344,46.040000915527344,50.349998474121094,100.69999694824219,92.31999969482422,77.86000061035156,104.19999694824219,93.19000244140625\n2009-08-05,36.470001220703125,20.56999969482422,100.11000061035156,39.84000015258789,51.290000915527344,89.16999816894531,23.270000457763672,29.899999618530273,30.280000686645508,51.310001373291016,11.43785572052002,102.5,19.729999542236328,28.600000381469727,35.88999938964844,41.790000915527344,45.93000030517578,49.95000076293945,100.41000366210938,90.94000244140625,77.68000030517578,104.26000213623047,92.83000183105469\n2009-08-06,36.16999816894531,20.420000076293945,99.94999694824219,39.79999923706055,50.970001220703125,89.16999816894531,23.110000610351562,29.479999542236328,30.030000686645508,50.88999938964844,11.356620788574219,102.22000122070312,19.59000015258789,28.649999618530273,35.97999954223633,41.9900016784668,45.47999954223633,50.060001373291016,99.88999938964844,91.25,77.7300033569336,104.20999908447266,92.62999725341797\n2009-08-07,36.529998779296875,20.40999984741211,100.08000183105469,39.63999938964844,50.91999816894531,88.58000183105469,23.06999969482422,29.68000030517578,30.209999084472656,50.83000183105469,11.65718936920166,102.19999694824219,19.790000915527344,28.920000076293945,36.16999816894531,41.810001373291016,45.63999938964844,50.0,101.19999694824219,90.48999786376953,77.19000244140625,104.13999938964844,93.79000091552734\n2009-08-10,36.119998931884766,20.299999237060547,100.2699966430664,39.63999938964844,50.61000061035156,89.1500015258789,22.940000534057617,29.260000228881836,29.809999465942383,51.04999923706055,11.608448028564453,102.5199966430664,19.700000762939453,28.979999542236328,35.790000915527344,41.880001068115234,45.18000030517578,49.7599983215332,100.98999786376953,91.62000274658203,77.81999969482422,104.1500015258789,93.5\n2009-08-11,35.439998626708984,19.959999084472656,100.70999908447266,39.63999938964844,50.31999969482422,89.7699966430664,22.719999313354492,29.0,29.739999771118164,50.310001373291016,11.17790412902832,103.05000305175781,19.420000076293945,29.0,35.54999923706055,41.369998931884766,44.77000045776367,49.619998931884766,99.7300033569336,92.68000030517578,77.97000122070312,104.13999938964844,92.58000183105469\n2009-08-12,35.7599983215332,20.15999984741211,100.31999969482422,39.84000015258789,50.88999938964844,89.5199966430664,23.0,29.139999389648438,30.010000228881836,50.849998474121094,11.40536117553711,102.1500015258789,19.809999465942383,29.139999389648438,36.27000045776367,41.540000915527344,45.31999969482422,50.25,100.80000305175781,91.69000244140625,77.91999816894531,104.19999694824219,93.7699966430664\n2009-08-13,36.380001068115234,20.469999313354492,100.6500015258789,40.20000076293945,51.66999816894531,90.22000122070312,23.3799991607666,29.739999771118164,30.559999465942383,51.470001220703125,11.640942573547363,103.13999938964844,19.899999618530273,29.040000915527344,37.02000045776367,41.779998779296875,46.13999938964844,50.84000015258789,101.56999969482422,92.98999786376953,78.12000274658203,104.27999877929688,94.19000244140625\n2009-08-14,35.720001220703125,20.219999313354492,100.54000091552734,40.36000061035156,51.22999954223633,90.5,23.110000610351562,29.559999465942383,29.790000915527344,50.709999084472656,11.567831039428711,103.12000274658203,19.709999084472656,29.040000915527344,36.34000015258789,41.040000915527344,45.59000015258789,50.61000061035156,100.79000091552734,93.3499984741211,78.36000061035156,104.4000015258789,93.41000366210938\n2009-08-17,34.31999969482422,19.56999969482422,100.9000015258789,39.2400016784668,49.58000183105469,91.12000274658203,22.350000381469727,28.600000381469727,28.65999984741211,49.06999969482422,11.080422401428223,103.29000091552734,19.239999771118164,28.639999389648438,35.34000015258789,39.130001068115234,43.97999954223633,49.09000015258789,98.30999755859375,94.7300033569336,78.58000183105469,103.69999694824219,91.61000061035156\n2009-08-18,35.06999969482422,19.719999313354492,101.12000274658203,39.560001373291016,50.439998626708984,90.80000305175781,22.56999969482422,29.200000762939453,29.09000015258789,49.560001373291016,11.307879447937012,103.02999877929688,19.530000686645508,28.700000762939453,36.04999923706055,40.029998779296875,44.84000015258789,49.91999816894531,99.08999633789062,94.18000030517578,78.47000122070312,103.48999786376953,92.30000305175781\n2009-08-19,35.15999984741211,19.969999313354492,101.62999725341797,39.68000030517578,50.869998931884766,91.13999938964844,22.829999923706055,29.420000076293945,29.469999313354492,50.47999954223633,11.299756050109863,103.36000061035156,19.579999923706055,28.90999984741211,36.13999938964844,40.060001373291016,45.31999969482422,50.029998779296875,99.95999908447266,94.95999908447266,78.55999755859375,103.83000183105469,93.12999725341797\n2009-08-20,35.77000045776367,20.190000534057617,102.23999786376953,40.15999984741211,51.22999954223633,91.37999725341797,23.170000076293945,29.65999984741211,29.530000686645508,50.90999984741211,11.592201232910156,103.8499984741211,19.799999237060547,29.149999618530273,36.22999954223633,40.599998474121094,45.869998931884766,50.560001373291016,100.98999786376953,95.73999786376953,78.66999816894531,103.80999755859375,93.79000091552734\n2009-08-21,36.310001373291016,20.84000015258789,101.83000183105469,40.599998474121094,52.349998474121094,90.44999694824219,23.979999542236328,30.280000686645508,30.309999465942383,52.349998474121094,11.819659233093262,103.37999725341797,20.09000015258789,29.719999313354492,36.2599983215332,40.779998779296875,47.099998474121094,50.9900016784668,102.97000122070312,93.7699966430664,78.41999816894531,103.93000030517578,95.02999877929688\n2009-08-24,36.470001220703125,20.84000015258789,102.19000244140625,40.52000045776367,52.34000015258789,91.01000213623047,24.010000228881836,30.18000030517578,30.06999969482422,53.02000045776367,11.730300903320312,103.91000366210938,20.030000686645508,29.770000457763672,36.84000015258789,40.400001525878906,46.97999954223633,51.060001373291016,102.95999908447266,95.47000122070312,78.56999969482422,103.97000122070312,95.12999725341797\n2009-08-25,36.38999938964844,21.100000381469727,101.88999938964844,40.84000015258789,52.86000061035156,91.25,24.260000228881836,30.239999771118164,29.920000076293945,52.209999084472656,11.8765230178833,104.08999633789062,20.079999923706055,29.579999923706055,36.810001373291016,40.529998779296875,47.5099983215332,51.31999969482422,103.16000366210938,96.01000213623047,78.69999694824219,104.08999633789062,95.4800033569336\n2009-08-26,36.279998779296875,21.049999237060547,102.18000030517578,40.880001068115234,52.63999938964844,91.37000274658203,24.270000457763672,30.020000457763672,29.809999465942383,52.45000076293945,11.844029426574707,104.77999877929688,20.170000076293945,29.549999237060547,36.56999969482422,40.2599983215332,47.06999969482422,51.209999084472656,103.16999816894531,96.44999694824219,78.75,103.88999938964844,95.45999908447266\n2009-08-27,36.209999084472656,21.1200008392334,101.80999755859375,41.0,53.040000915527344,91.12000274658203,24.469999313354492,30.1200008392334,30.020000457763672,52.290000915527344,11.96588134765625,104.30000305175781,20.209999084472656,29.549999237060547,37.16999816894531,40.29999923706055,47.56999969482422,51.54999923706055,103.4000015258789,96.06999969482422,78.66000366210938,104.12000274658203,95.81999969482422\n2009-08-28,36.02000045776367,21.079999923706055,101.8499984741211,40.959999084472656,53.06999969482422,91.33000183105469,24.540000915527344,30.31999969482422,30.209999084472656,52.18000030517578,11.982128143310547,104.81999969482422,20.280000686645508,29.479999542236328,37.29999923706055,39.810001373291016,47.619998931884766,51.66999816894531,103.37999725341797,96.51000213623047,78.81999969482422,104.22000122070312,95.58000183105469\n2009-08-31,35.310001373291016,20.90999984741211,101.76000213623047,40.880001068115234,52.68000030517578,91.5999984741211,24.360000610351562,29.899999618530273,29.809999465942383,51.16999816894531,11.941511154174805,105.33000183105469,20.020000457763672,29.229999542236328,36.95000076293945,39.310001373291016,47.310001373291016,51.2599983215332,102.45999908447266,96.5999984741211,78.97000122070312,104.33000183105469,95.05000305175781\n2009-09-01,34.63999938964844,20.170000076293945,100.9800033569336,40.279998779296875,51.369998931884766,91.58000183105469,23.610000610351562,29.399999618530273,28.93000030517578,50.279998779296875,11.299756050109863,104.30999755859375,19.610000610351562,29.0,36.2599983215332,38.40999984741211,45.75,50.52000045776367,100.19999694824219,96.05999755859375,78.80000305175781,104.1500015258789,93.20999908447266\n2009-09-02,35.0099983215332,20.149999618530273,101.13999938964844,40.400001525878906,51.310001373291016,92.08000183105469,23.510000228881836,29.5,29.200000762939453,49.90999984741211,11.202274322509766,104.62000274658203,19.649999618530273,28.799999237060547,36.220001220703125,38.720001220703125,45.790000915527344,50.689998626708984,99.81999969482422,97.45999908447266,78.97000122070312,104.08000183105469,92.83000183105469\n2009-09-03,35.709999084472656,20.239999771118164,101.2699966430664,40.279998779296875,51.709999084472656,91.75,23.6200008392334,29.860000610351562,29.6200008392334,50.2599983215332,11.421608924865723,104.80000305175781,19.739999771118164,28.780000686645508,36.720001220703125,39.68000030517578,46.11000061035156,50.83000183105469,100.6500015258789,96.86000061035156,78.83000183105469,104.37999725341797,93.44999694824219\n2009-09-04,36.400001525878906,20.68000030517578,101.25,40.20000076293945,52.5,91.19999694824219,24.010000228881836,30.31999969482422,30.030000686645508,50.959999084472656,11.551584243774414,104.87000274658203,20.09000015258789,28.920000076293945,37.40999984741211,41.130001068115234,46.939998626708984,51.22999954223633,102.05999755859375,95.20999908447266,78.75,104.18000030517578,94.44999694824219\n2009-09-08,37.150001525878906,21.200000762939453,101.45999908447266,40.560001373291016,53.540000915527344,90.98999786376953,24.75,30.81999969482422,30.440000534057617,52.36000061035156,11.600324630737305,104.5999984741211,20.239999771118164,28.989999771118164,38.529998779296875,42.36000061035156,48.11000061035156,52.0,102.94000244140625,94.54000091552734,78.70999908447266,104.37999725341797,95.05999755859375\n2009-09-09,37.349998474121094,21.510000228881836,101.77999877929688,40.720001220703125,54.20000076293945,91.06999969482422,25.030000686645508,31.280000686645508,30.579999923706055,52.47999954223633,11.779041290283203,104.56999969482422,20.389999389648438,28.950000762939453,38.63999938964844,42.16999816894531,48.77000045776367,52.27000045776367,103.7300033569336,94.43000030517578,78.83999633789062,104.36000061035156,95.52999877929688\n2009-09-10,37.84000015258789,21.81999969482422,102.0199966430664,41.20000076293945,54.68000030517578,91.75,25.290000915527344,31.68000030517578,30.75,53.38999938964844,11.8765230178833,105.26000213623047,20.670000076293945,28.950000762939453,39.15999984741211,42.58000183105469,49.16999816894531,52.79999923706055,104.79000091552734,96.16999816894531,79.13999938964844,104.47000122070312,96.33999633789062\n2009-09-11,37.86000061035156,21.829999923706055,102.25,41.15999984741211,54.61000061035156,92.0199966430664,25.260000228881836,31.5,30.790000915527344,53.599998474121094,11.803411483764648,106.20999908447266,20.690000534057617,28.940000534057617,39.0,42.38999938964844,49.099998474121094,52.709999084472656,104.7699966430664,96.69999694824219,79.18000030517578,104.0199966430664,96.22000122070312\n2009-09-14,37.720001220703125,21.899999618530273,102.0199966430664,41.0,54.720001220703125,91.4800033569336,25.43000030517578,31.5,31.18000030517578,54.0,11.957757949829102,105.66999816894531,20.6200008392334,29.360000610351562,38.7599983215332,42.40999984741211,49.38999938964844,52.5099983215332,105.27999877929688,95.73999786376953,78.87999725341797,104.25,96.31999969482422\n2009-09-15,38.16999816894531,22.030000686645508,102.08000183105469,40.68000030517578,54.72999954223633,91.29000091552734,25.6200008392334,31.540000915527344,31.8700008392334,54.540000915527344,11.982128143310547,105.61000061035156,20.760000228881836,29.579999923706055,38.79999923706055,42.290000915527344,49.59000015258789,52.27000045776367,105.72000122070312,95.25,78.94000244140625,104.12000274658203,96.9000015258789\n2009-09-16,39.130001068115234,22.420000076293945,102.27999877929688,40.880001068115234,55.810001373291016,91.22000122070312,26.1200008392334,32.040000915527344,32.310001373291016,55.88999938964844,12.396425247192383,105.94000244140625,20.920000076293945,30.049999237060547,40.22999954223633,43.79999923706055,50.59000015258789,53.11000061035156,107.31999969482422,95.41999816894531,78.95999908447266,104.05999755859375,98.08000183105469\n2009-09-17,38.91999816894531,22.420000076293945,102.41000366210938,40.47999954223633,55.45000076293945,91.66999816894531,26.149999618530273,32.040000915527344,32.15999984741211,55.619998931884766,12.35580825805664,106.45999908447266,20.84000015258789,29.850000381469727,39.849998474121094,43.560001373291016,50.439998626708984,52.68000030517578,107.16000366210938,96.62000274658203,79.19000244140625,104.47000122070312,98.05999755859375\n2009-09-18,39.029998779296875,22.43000030517578,101.94000244140625,40.68000030517578,55.599998474121094,91.18000030517578,26.270000457763672,31.899999618530273,32.0099983215332,55.18000030517578,12.298943519592285,105.79000091552734,20.889999389648438,29.68000030517578,39.720001220703125,43.36000061035156,50.369998931884766,52.88999938964844,106.72000122070312,95.76000213623047,79.0999984741211,104.1500015258789,98.11000061035156\n2009-09-21,38.689998626708984,22.15999984741211,101.83000183105469,40.279998779296875,55.0099983215332,91.12000274658203,26.059999465942383,31.399999618530273,31.690000534057617,54.709999084472656,12.18521499633789,106.04000091552734,20.799999237060547,29.540000915527344,39.34000015258789,42.779998779296875,49.90999984741211,52.290000915527344,106.44999694824219,95.9800033569336,79.04000091552734,104.27999877929688,97.73999786376953\n2009-09-22,39.279998779296875,22.479999542236328,102.06999969482422,40.79999923706055,55.77000045776367,91.36000061035156,26.360000610351562,31.860000610351562,32.040000915527344,55.56999969482422,12.461413383483887,106.29000091552734,20.90999984741211,29.459999084472656,40.150001525878906,43.13999938964844,50.560001373291016,53.029998779296875,107.06999969482422,96.18000030517578,78.94000244140625,104.05000305175781,98.20999908447266\n2009-09-23,38.689998626708984,22.25,102.29000091552734,40.36000061035156,55.290000915527344,91.55999755859375,26.079999923706055,31.559999465942383,31.530000686645508,54.40999984741211,12.209586143493652,106.33999633789062,20.90999984741211,29.360000610351562,39.939998626708984,42.31999969482422,50.06999969482422,52.5099983215332,106.18000030517578,96.47000122070312,79.16999816894531,104.0999984741211,97.58000183105469\n2009-09-24,37.93000030517578,21.81999969482422,102.19000244140625,40.400001525878906,54.47999954223633,91.80999755859375,25.610000610351562,30.860000610351562,30.84000015258789,53.630001068115234,11.96588134765625,106.51000213623047,20.709999084472656,29.280000686645508,39.36000061035156,41.20000076293945,49.099998474121094,52.41999816894531,105.01000213623047,96.75,79.20999908447266,104.36000061035156,96.98999786376953\n2009-09-25,38.09000015258789,21.760000228881836,102.33999633789062,40.08000183105469,54.25,92.18000030517578,25.559999465942383,30.65999984741211,30.540000915527344,53.560001373291016,11.852152824401855,106.91999816894531,20.579999923706055,29.200000762939453,39.599998474121094,41.22999954223633,48.970001220703125,52.25,104.44999694824219,97.9800033569336,79.45999908447266,104.33000183105469,96.73999786376953\n2009-09-28,38.58000183105469,22.229999542236328,102.55000305175781,40.400001525878906,54.9900016784668,92.33999633789062,25.940000534057617,30.940000534057617,31.1200008392334,54.41999816894531,12.250203132629395,107.19000244140625,20.920000076293945,29.450000762939453,40.130001068115234,41.369998931884766,49.65999984741211,52.599998474121094,106.31999969482422,98.83999633789062,79.5,104.22000122070312,97.83999633789062\n2009-09-29,38.66999816894531,22.15999984741211,102.51000213623047,39.560001373291016,54.65999984741211,92.30000305175781,25.829999923706055,31.040000915527344,31.149999618530273,54.27000045776367,12.193338394165039,106.7699966430664,20.809999465942383,29.510000228881836,40.209999084472656,41.36000061035156,49.47999954223633,52.09000015258789,106.0,98.75,79.5,104.16000366210938,97.44000244140625\n2009-09-30,38.90999984741211,22.190000534057617,102.87999725341797,39.7599983215332,54.68000030517578,92.37000274658203,25.969999313354492,31.020000457763672,30.940000534057617,53.91999816894531,12.136474609375,106.68000030517578,20.8700008392334,29.329999923706055,40.529998779296875,40.91999816894531,49.59000015258789,52.2599983215332,105.58999633789062,98.66000366210938,79.5,104.37000274658203,97.08999633789062\n2009-10-01,37.849998474121094,21.40999984741211,103.12000274658203,38.7599983215332,53.25,92.80999755859375,25.010000228881836,30.34000015258789,29.729999542236328,52.2400016784668,11.600324630737305,105.12000274658203,20.25,28.829999923706055,39.209999084472656,39.650001525878906,48.0,50.72999954223633,102.97000122070312,99.69999694824219,79.61000061035156,103.83000183105469,95.12000274658203\n2009-10-02,37.86000061035156,21.290000915527344,102.91999816894531,38.2400016784668,52.65999984741211,92.7699966430664,24.729999542236328,30.0,29.610000610351562,51.970001220703125,11.608448028564453,104.44000244140625,20.25,28.520000457763672,38.61000061035156,39.5099983215332,47.61000061035156,50.08000183105469,102.48999786376953,99.01000213623047,79.37000274658203,103.80999755859375,94.86000061035156\n2009-10-05,38.7400016784668,21.59000015258789,102.9800033569336,38.560001373291016,53.41999816894531,92.76000213623047,25.219999313354492,30.260000228881836,30.110000610351562,53.119998931884766,11.974004745483398,105.0,20.420000076293945,28.829999923706055,39.41999816894531,40.470001220703125,48.41999816894531,50.63999938964844,104.0199966430664,99.0199966430664,79.48999786376953,103.87999725341797,95.97000122070312\n2009-10-06,39.380001068115234,22.09000015258789,102.97000122070312,39.0,54.31999969482422,92.45999908447266,25.670000076293945,30.65999984741211,30.739999771118164,54.380001068115234,12.128351211547852,104.77999877929688,20.790000915527344,29.049999237060547,40.02000045776367,41.529998779296875,49.33000183105469,51.40999984741211,105.51000213623047,98.04000091552734,79.58000183105469,103.8499984741211,97.29000091552734\n2009-10-07,39.34000015258789,22.149999618530273,103.41999816894531,39.36000061035156,54.52000045776367,93.05000305175781,25.75,30.860000610351562,30.75,54.79999923706055,12.258326530456543,105.44999694824219,20.75,29.06999969482422,40.529998779296875,42.02000045776367,49.34000015258789,51.91999816894531,105.80000305175781,99.19000244140625,79.62000274658203,103.87999725341797,97.27999877929688\n2009-10-08,39.81999969482422,22.5,103.31999969482422,39.79999923706055,55.310001373291016,92.70999908447266,26.170000076293945,31.139999389648438,31.469999313354492,56.209999084472656,12.27457332611084,104.86000061035156,20.8799991607666,29.06999969482422,41.689998626708984,42.72999954223633,50.08000183105469,52.880001068115234,106.61000061035156,98.1500015258789,79.58999633789062,103.9000015258789,97.91000366210938\n2009-10-09,39.849998474121094,22.469999313354492,102.79000091552734,39.79999923706055,55.16999816894531,91.81999969482422,26.06999969482422,30.899999618530273,31.5,56.15999984741211,12.380178451538086,103.94000244140625,21.020000457763672,29.25,41.61000061035156,42.88999938964844,49.83000183105469,52.91999816894531,107.26000213623047,95.9000015258789,79.01000213623047,103.69999694824219,98.69000244140625\n2009-10-12,40.18000030517578,22.739999771118164,103.04000091552734,39.880001068115234,55.5,92.08999633789062,26.350000381469727,31.040000915527344,31.579999923706055,56.91999816894531,12.477660179138184,104.30000305175781,21.030000686645508,29.549999237060547,41.58000183105469,42.45000076293945,50.150001525878906,52.90999984741211,107.68000030517578,96.05000305175781,79.27999877929688,103.77999877929688,98.94000244140625\n2009-10-13,40.25,22.719999313354492,103.62000274658203,39.68000030517578,55.380001068115234,92.30000305175781,26.3799991607666,30.860000610351562,31.75,57.0099983215332,12.35580825805664,104.5,21.110000610351562,29.34000015258789,41.52000045776367,42.77000045776367,50.290000915527344,52.720001220703125,107.45999908447266,96.55000305175781,79.33999633789062,103.86000061035156,98.83000183105469\n2009-10-14,41.54999923706055,23.31999969482422,103.16999816894531,40.119998931884766,56.709999084472656,91.66999816894531,27.020000457763672,31.600000381469727,32.43000030517578,57.959999084472656,12.778228759765625,104.0,21.360000610351562,29.360000610351562,42.79999923706055,44.290000915527344,51.650001525878906,53.66999816894531,109.30999755859375,95.12000274658203,79.0,103.95999908447266,100.2300033569336\n2009-10-15,41.31999969482422,23.350000381469727,103.25,39.91999816894531,56.970001220703125,91.37000274658203,27.1299991607666,32.060001373291016,32.4900016784668,59.16999816894531,12.66450023651123,103.9800033569336,21.31999969482422,29.59000015258789,42.9900016784668,44.15999984741211,51.90999984741211,53.63999938964844,109.70999908447266,94.68000030517578,79.0199966430664,103.88999938964844,100.6500015258789\n2009-10-16,40.75,22.8700008392334,103.58000183105469,39.20000076293945,56.11000061035156,91.79000091552734,26.610000610351562,32.20000076293945,32.040000915527344,58.9900016784668,12.363931655883789,104.05999755859375,21.1200008392334,29.690000534057617,42.38999938964844,43.16999816894531,51.29999923706055,52.709999084472656,108.88999938964844,95.44999694824219,79.05000305175781,103.91000366210938,99.98999786376953\n2009-10-19,41.529998779296875,23.280000686645508,104.23999786376953,39.84000015258789,57.0099983215332,91.93000030517578,26.989999771118164,32.599998474121094,32.529998779296875,59.7599983215332,12.420796394348145,104.58999633789062,21.350000381469727,30.110000610351562,43.11000061035156,44.4900016784668,52.04999923706055,53.66999816894531,109.79000091552734,96.19999694824219,79.16000366210938,103.9800033569336,100.86000061035156\n2009-10-20,40.97999954223633,23.100000381469727,104.33000183105469,39.720001220703125,56.709999084472656,92.13999938964844,26.8799991607666,32.380001068115234,32.189998626708984,59.380001068115234,12.323314666748047,105.26000213623047,21.280000686645508,29.809999465942383,42.900001525878906,44.18000030517578,51.689998626708984,53.41999816894531,109.20999908447266,96.72000122070312,79.31999969482422,104.05999755859375,100.38999938964844\n2009-10-21,40.7599983215332,23.040000915527344,103.91999816894531,39.599998474121094,56.52000045776367,91.93000030517578,26.65999984741211,32.52000045776367,31.809999465942383,59.220001220703125,12.087733268737793,104.81999969482422,21.290000915527344,29.850000381469727,42.880001068115234,43.90999984741211,51.61000061035156,53.27000045776367,108.2300033569336,96.13999938964844,79.30999755859375,103.98999786376953,99.43000030517578\n2009-10-22,41.099998474121094,23.299999237060547,103.41000366210938,39.68000030517578,57.06999969482422,91.66000366210938,26.90999984741211,32.7400016784668,32.189998626708984,59.45000076293945,12.44516658782959,105.44000244140625,21.389999389648438,29.920000076293945,43.22999954223633,44.31999969482422,52.2400016784668,53.52000045776367,109.33000183105469,95.66999816894531,79.23999786376953,104.05999755859375,100.73999786376953\n2009-10-23,40.7599983215332,23.1200008392334,103.19000244140625,38.7599983215332,56.16999816894531,91.20999908447266,26.549999237060547,32.13999938964844,31.549999237060547,58.29999923706055,12.266449928283691,104.86000061035156,21.329999923706055,29.43000030517578,42.779998779296875,44.36000061035156,51.310001373291016,52.43000030517578,108.08000183105469,94.94999694824219,79.0,104.19000244140625,99.83000183105469\n2009-10-26,40.25,22.399999618530273,102.72000122070312,38.63999938964844,55.31999969482422,90.69000244140625,25.8799991607666,32.02000045776367,30.739999771118164,57.34000015258789,11.949634552001953,104.41999816894531,21.190000534057617,29.040000915527344,42.349998474121094,43.95000076293945,50.279998779296875,52.150001525878906,106.91000366210938,93.72000122070312,78.9000015258789,104.19000244140625,98.80999755859375\n2009-10-27,39.54999923706055,22.06999969482422,103.54000091552734,38.47999954223633,54.880001068115234,91.47000122070312,25.649999618530273,31.940000534057617,30.489999771118164,57.849998474121094,11.860276222229004,105.31999969482422,21.079999923706055,28.969999313354492,41.790000915527344,43.86000061035156,49.959999084472656,51.77000045776367,106.41999816894531,95.0,79.18000030517578,104.25,98.81999969482422\n2009-10-28,37.7400016784668,21.280000686645508,103.62000274658203,38.08000183105469,53.560001373291016,91.75,24.8799991607666,31.239999771118164,29.549999237060547,55.939998626708984,11.494719505310059,104.61000061035156,20.770000457763672,28.68000030517578,40.16999816894531,42.189998626708984,48.599998474121094,50.70000076293945,104.41000366210938,95.44999694824219,79.0999984741211,104.2300033569336,97.68000030517578\n2009-10-29,39.40999984741211,22.049999237060547,103.62999725341797,38.68000030517578,55.13999938964844,91.30999755859375,25.65999984741211,32.13999938964844,30.43000030517578,57.43000030517578,11.974004745483398,104.73999786376953,21.170000076293945,28.93000030517578,41.13999938964844,43.22999954223633,50.380001068115234,51.72999954223633,106.6500015258789,94.41000366210938,79.13999938964844,104.16999816894531,99.54000091552734\n2009-10-30,37.56999969482422,21.0,104.01000213623047,38.20000076293945,53.29999923706055,91.98999786376953,24.5,30.979999542236328,29.34000015258789,55.25,11.413484573364258,105.68000030517578,20.610000610351562,28.389999389648438,39.59000015258789,41.70000076293945,48.310001373291016,50.58000183105469,103.55999755859375,95.77999877929688,79.47000122070312,104.2699966430664,97.05999755859375\n2009-11-02,38.130001068115234,21.170000076293945,103.87000274658203,38.560001373291016,53.81999969482422,90.9800033569336,24.829999923706055,31.280000686645508,29.600000381469727,55.599998474121094,11.510966300964355,105.04000091552734,20.729999542236328,28.34000015258789,40.130001068115234,42.7400016784668,48.88999938964844,51.099998474121094,104.31999969482422,95.05000305175781,79.1500015258789,103.69999694824219,97.8499984741211\n2009-11-03,38.189998626708984,21.059999465942383,103.66000366210938,38.52000045776367,53.61000061035156,90.7699966430664,24.690000534057617,31.540000915527344,29.899999618530273,56.31999969482422,11.543460845947266,104.55999755859375,20.649999618530273,28.280000686645508,39.900001525878906,42.54999923706055,48.59000015258789,50.900001525878906,104.6500015258789,94.0999984741211,79.01000213623047,103.83999633789062,97.80000305175781\n2009-11-04,38.900001525878906,21.329999923706055,103.86000061035156,38.439998626708984,54.150001525878906,90.5199966430664,25.139999389648438,31.639999389648438,29.899999618530273,56.27000045776367,11.380990982055664,104.97000122070312,20.770000457763672,28.469999313354492,40.22999954223633,43.189998626708984,49.36000061035156,51.15999984741211,104.91999816894531,93.23999786376953,78.98999786376953,104.01000213623047,98.16999816894531\n2009-11-05,39.70000076293945,21.75,104.05999755859375,38.720001220703125,54.849998474121094,90.54000091552734,25.639999389648438,32.18000030517578,30.43000030517578,57.22999954223633,11.673436164855957,105.04000091552734,21.219999313354492,28.950000762939453,40.61000061035156,44.209999084472656,50.2599983215332,51.529998779296875,106.8499984741211,93.23999786376953,79.05999755859375,104.22000122070312,100.16000366210938\n2009-11-06,39.650001525878906,21.760000228881836,104.31999969482422,38.47999954223633,55.0099983215332,90.80999755859375,25.690000534057617,32.31999969482422,30.690000534057617,57.08000183105469,11.624695777893066,105.31999969482422,21.25,28.920000076293945,41.060001373291016,44.16999816894531,50.34000015258789,51.52000045776367,107.12999725341797,93.33000183105469,79.08000183105469,104.19999694824219,100.37000274658203\n2009-11-09,41.11000061035156,22.6299991607666,104.86000061035156,38.91999816894531,56.54999923706055,90.8499984741211,26.530000686645508,33.400001525878906,31.690000534057617,58.16999816894531,12.038992881774902,105.37999725341797,21.739999771118164,29.440000534057617,42.7599983215332,45.720001220703125,51.83000183105469,52.7400016784668,109.56999969482422,93.44000244140625,79.23999786376953,104.3499984741211,102.41999816894531\n2009-11-10,40.91999816894531,22.350000381469727,104.68000030517578,38.63999938964844,56.25,90.91999816894531,26.43000030517578,33.2400016784668,31.729999542236328,58.209999084472656,11.998374938964844,105.30999755859375,21.729999542236328,29.579999923706055,42.63999938964844,45.369998931884766,51.63999938964844,52.41999816894531,109.58999633789062,93.2699966430664,79.2699966430664,104.48999786376953,102.69000244140625\n2009-11-11,41.27000045776367,22.610000610351562,105.05999755859375,38.599998474121094,56.41999816894531,91.18000030517578,26.540000915527344,33.08000183105469,32.040000915527344,58.189998626708984,12.160844802856445,105.69999694824219,21.860000610351562,29.510000228881836,42.939998626708984,45.459999084472656,51.58000183105469,52.40999984741211,110.1500015258789,93.66000366210938,79.47000122070312,104.66999816894531,103.12999725341797\n2009-11-12,40.349998474121094,22.25,104.56999969482422,37.959999084472656,55.599998474121094,91.20999908447266,26.079999923706055,32.939998626708984,31.889999389648438,56.90999984741211,11.933387756347656,105.69999694824219,21.700000762939453,29.100000381469727,42.130001068115234,44.630001068115234,51.16999816894531,51.47999954223633,109.02999877929688,93.48999786376953,79.55999755859375,104.61000061035156,102.16999816894531\n2009-11-13,41.040000915527344,22.489999771118164,104.61000061035156,38.31999969482422,56.380001068115234,91.27999877929688,26.459999084472656,33.380001068115234,32.0099983215332,57.27000045776367,11.909016609191895,106.01000213623047,21.899999618530273,29.360000610351562,42.70000076293945,45.380001068115234,51.709999084472656,52.08000183105469,109.62000274658203,93.91999816894531,79.51000213623047,104.37999725341797,102.91000366210938\n2009-11-16,42.06999969482422,23.020000457763672,105.4000015258789,38.68000030517578,57.279998779296875,91.7699966430664,26.84000015258789,34.20000076293945,32.66999816894531,58.77000045776367,12.038992881774902,106.51000213623047,22.139999389648438,29.770000457763672,43.439998626708984,46.349998474121094,52.66999816894531,52.84000015258789,111.20999908447266,95.0199966430664,79.70999908447266,104.63999938964844,104.26000213623047\n2009-11-17,41.91999816894531,22.860000610351562,105.68000030517578,38.2400016784668,56.900001525878906,91.97000122070312,26.690000534057617,34.2599983215332,33.04999923706055,58.66999816894531,12.071486473083496,106.66999816894531,22.239999771118164,29.610000610351562,42.970001220703125,46.220001220703125,52.41999816894531,52.18000030517578,111.33999633789062,95.52999877929688,79.69000244140625,104.63999938964844,104.58999633789062\n2009-11-18,41.59000015258789,23.010000228881836,105.6500015258789,37.84000015258789,56.720001220703125,91.73999786376953,26.739999771118164,34.040000915527344,33.04999923706055,58.439998626708984,12.168968200683594,106.31999969482422,22.1200008392334,29.479999542236328,42.72999954223633,45.619998931884766,52.43000030517578,51.77000045776367,111.2699966430664,94.97000122070312,79.70999908447266,104.52999877929688,104.55000305175781\n2009-11-19,40.81999969482422,22.59000015258789,105.66000366210938,36.959999084472656,55.650001525878906,91.8499984741211,26.280000686645508,33.439998626708984,32.54999923706055,57.130001068115234,11.933387756347656,106.44999694824219,21.799999237060547,29.1200008392334,41.9900016784668,44.66999816894531,51.439998626708984,50.63999938964844,109.81999969482422,95.13999938964844,79.7699966430664,104.5,103.6500015258789\n2009-11-20,40.650001525878906,22.360000610351562,105.66000366210938,37.2400016784668,55.34000015258789,91.83999633789062,25.920000076293945,32.939998626708984,32.439998626708984,56.599998474121094,11.860276222229004,105.94999694824219,21.690000534057617,29.25,41.68000030517578,44.599998474121094,50.84000015258789,50.779998779296875,109.43000030517578,95.12000274658203,79.7300033569336,104.45999908447266,103.25\n2009-11-23,41.5,22.90999984741211,105.75,37.63999938964844,56.33000183105469,91.70999908447266,26.34000015258789,33.619998931884766,32.77000045776367,57.33000183105469,12.030869483947754,105.94999694824219,22.06999969482422,29.6200008392334,42.58000183105469,45.59000015258789,51.939998626708984,51.41999816894531,110.81999969482422,95.0,79.79000091552734,104.52999877929688,104.45999908447266\n2009-11-24,41.27000045776367,22.8799991607666,105.86000061035156,37.15999984741211,56.099998474121094,92.18000030517578,26.389999389648438,33.58000183105469,32.72999954223633,57.65999984741211,11.941511154174805,106.36000061035156,22.030000686645508,29.68000030517578,42.02000045776367,45.0099983215332,51.849998474121094,50.75,110.98999786376953,95.5999984741211,79.98999786376953,104.66999816894531,104.36000061035156\n2009-11-25,41.75,23.15999984741211,106.27999877929688,37.79999923706055,56.849998474121094,92.48999786376953,26.790000915527344,33.959999084472656,33.2599983215332,58.11000061035156,11.91714096069336,106.75,22.06999969482422,30.020000457763672,42.869998931884766,45.15999984741211,52.650001525878906,51.779998779296875,111.37999725341797,96.04000091552734,80.1500015258789,104.63999938964844,104.62999725341797\n2009-11-27,40.130001068115234,22.420000076293945,106.51000213623047,37.47999954223633,55.209999084472656,92.91000366210938,25.850000381469727,33.31999969482422,32.349998474121094,57.02000045776367,11.600324630737305,106.72000122070312,21.709999084472656,29.510000228881836,41.040000915527344,43.11000061035156,50.720001220703125,50.599998474121094,109.56999969482422,96.4000015258789,80.29000091552734,104.66999816894531,103.18000030517578\n2009-11-30,40.52000045776367,22.5,106.56999969482422,38.2400016784668,55.38999938964844,93.05999755859375,25.860000610351562,32.540000915527344,32.5,56.81999969482422,11.909016609191895,107.25,21.75,29.760000228881836,41.849998474121094,43.70000076293945,50.5,51.630001068115234,109.94000244140625,96.62999725341797,80.25,104.4800033569336,103.58000183105469\n2009-12-01,41.68000030517578,22.979999542236328,106.18000030517578,39.560001373291016,56.90999984741211,92.33999633789062,26.459999084472656,33.380001068115234,33.130001068115234,57.56999969482422,11.91714096069336,106.26000213623047,22.100000381469727,30.31999969482422,42.790000915527344,44.90999984741211,51.869998931884766,53.06999969482422,111.30000305175781,95.25,79.88999938964844,104.31999969482422,104.7300033569336\n2009-12-02,41.849998474121094,22.950000762939453,106.06999969482422,39.400001525878906,57.0,92.1500015258789,26.559999465942383,33.65999984741211,33.45000076293945,57.22999954223633,11.909016609191895,106.27999877929688,22.06999969482422,30.729999542236328,42.7400016784668,45.0,52.02000045776367,53.0099983215332,111.25,95.33000183105469,79.77999877929688,104.31999969482422,104.58000183105469\n2009-12-03,41.459999084472656,22.639999389648438,105.72000122070312,39.959999084472656,56.869998931884766,91.72000122070312,26.450000762939453,33.18000030517578,32.90999984741211,56.310001373291016,11.665312767028809,106.25,22.079999923706055,30.829999923706055,42.58000183105469,44.68000030517578,51.529998779296875,53.43000030517578,110.37999725341797,94.33999633789062,79.69999694824219,104.37999725341797,103.69000244140625\n2009-12-04,41.84000015258789,22.719999313354492,104.86000061035156,39.959999084472656,56.66999816894531,91.04000091552734,26.530000686645508,33.2599983215332,32.54999923706055,55.900001525878906,11.88464641571045,105.80999755859375,22.219999313354492,30.639999389648438,42.2400016784668,45.33000183105469,51.470001220703125,53.2599983215332,111.01000213623047,93.33999633789062,79.37000274658203,104.12999725341797,103.98999786376953\n2009-12-07,41.47999954223633,22.6200008392334,105.02999877929688,39.63999938964844,56.36000061035156,91.29000091552734,26.389999389648438,33.040000915527344,32.59000015258789,55.77000045776367,11.689682960510254,105.76000213623047,22.18000030517578,30.90999984741211,41.689998626708984,44.63999938964844,51.290000915527344,52.790000915527344,110.83999633789062,93.45999908447266,79.58000183105469,104.2699966430664,104.05000305175781\n2009-12-08,40.709999084472656,22.059999465942383,104.9800033569336,39.7599983215332,55.380001068115234,91.61000061035156,25.889999389648438,32.279998779296875,32.06999969482422,54.81999969482422,11.584077835083008,106.20999908447266,21.979999542236328,30.780000686645508,41.08000183105469,43.650001525878906,50.060001373291016,52.540000915527344,109.61000061035156,93.5999984741211,79.70999908447266,104.5,102.94000244140625\n2009-12-09,40.959999084472656,22.110000610351562,104.5199966430664,39.880001068115234,55.310001373291016,91.43000030517578,25.809999465942383,32.29999923706055,32.470001220703125,54.81999969482422,11.624695777893066,105.5999984741211,22.190000534057617,30.889999389648438,41.45000076293945,43.58000183105469,49.91999816894531,52.84000015258789,110.0199966430664,93.16999816894531,79.62999725341797,104.5199966430664,103.44999694824219\n2009-12-10,41.20000076293945,22.170000076293945,104.18000030517578,39.560001373291016,55.47999954223633,91.12000274658203,25.860000610351562,32.36000061035156,32.349998474121094,55.5,11.608448028564453,105.69000244140625,22.290000915527344,31.280000686645508,41.77000045776367,43.529998779296875,50.220001220703125,52.72999954223633,110.63999938964844,92.0999984741211,79.5199966430664,104.51000213623047,104.18000030517578\n2009-12-11,41.349998474121094,22.239999771118164,104.22000122070312,39.79999923706055,55.459999084472656,90.66999816894531,25.860000610351562,32.400001525878906,32.439998626708984,55.529998779296875,11.689682960510254,105.19000244140625,22.239999771118164,31.81999969482422,41.599998474121094,43.58000183105469,50.15999984741211,52.84000015258789,111.11000061035156,92.08999633789062,79.43000030517578,104.51000213623047,104.91999816894531\n2009-12-14,41.630001068115234,22.450000762939453,104.58000183105469,39.84000015258789,56.0,90.66999816894531,26.06999969482422,32.880001068115234,32.90999984741211,56.099998474121094,11.754671096801758,105.7699966430664,22.420000076293945,31.969999313354492,41.91999816894531,43.7599983215332,50.63999938964844,52.900001525878906,111.87000274658203,92.19999694824219,79.36000061035156,104.55999755859375,105.19999694824219\n2009-12-15,41.20000076293945,22.260000228881836,104.56999969482422,39.52000045776367,55.380001068115234,90.37999725341797,25.8700008392334,32.599998474121094,32.59000015258789,56.279998779296875,11.567831039428711,105.01000213623047,22.280000686645508,31.770000457763672,41.29999923706055,43.279998779296875,50.16999816894531,52.4900016784668,111.3499984741211,91.79000091552734,79.29000091552734,104.38999938964844,104.73999786376953\n2009-12-16,41.439998626708984,22.610000610351562,104.75,40.119998931884766,56.029998779296875,90.37999725341797,26.09000015258789,32.86000061035156,32.91999816894531,56.63999938964844,11.640942573547363,105.41000366210938,22.350000381469727,31.6299991607666,41.209999084472656,42.939998626708984,50.849998474121094,52.91999816894531,111.5199966430664,91.68000030517578,79.33000183105469,104.47000122070312,104.66999816894531\n2009-12-17,40.25,22.020000457763672,105.19999694824219,39.560001373291016,54.709999084472656,91.18000030517578,25.510000228881836,32.040000915527344,32.189998626708984,56.15999984741211,11.421608924865723,105.86000061035156,22.079999923706055,31.450000762939453,40.41999816894531,41.7599983215332,49.4900016784668,52.08000183105469,110.18000030517578,93.19000244140625,79.55000305175781,104.52999877929688,103.37999725341797\n2009-12-18,40.36000061035156,22.170000076293945,105.04000091552734,39.47999954223633,54.84000015258789,90.7300033569336,25.459999084472656,32.08000183105469,31.989999771118164,56.150001525878906,11.551584243774414,105.69000244140625,22.329999923706055,31.350000381469727,40.7400016784668,41.5,49.40999984741211,52.099998474121094,110.20999908447266,92.79000091552734,79.52999877929688,104.5999984741211,103.13999938964844\n2009-12-21,40.310001373291016,22.219999313354492,104.55000305175781,39.36000061035156,55.0,89.80000305175781,25.799999237060547,32.0,32.459999084472656,56.81999969482422,11.722177505493164,105.18000030517578,22.530000686645508,31.440000534057617,40.43000030517578,41.380001068115234,49.84000015258789,51.83000183105469,111.33000183105469,91.13999938964844,79.16000366210938,104.48999786376953,103.87999725341797\n2009-12-22,40.38999938964844,22.399999618530273,104.20999908447266,39.31999969482422,54.849998474121094,89.4000015258789,25.790000915527344,32.040000915527344,32.650001525878906,57.09000015258789,11.74654769897461,104.73999786376953,22.709999084472656,31.18000030517578,39.77000045776367,41.31999969482422,50.43000030517578,52.08000183105469,111.7300033569336,90.62999725341797,78.98999786376953,104.52999877929688,104.44999694824219\n2009-12-23,40.790000915527344,22.559999465942383,104.05999755859375,39.439998626708984,55.349998474121094,89.36000061035156,25.969999313354492,32.2599983215332,33.150001525878906,57.540000915527344,11.697806358337402,105.06999969482422,22.799999237060547,31.25,40.150001525878906,41.7599983215332,50.689998626708984,52.56999969482422,111.94999694824219,90.6500015258789,78.9800033569336,104.41000366210938,104.44999694824219\n2009-12-24,41.20000076293945,22.709999084472656,103.77999877929688,39.720001220703125,55.56999969482422,89.04000091552734,26.020000457763672,32.41999816894531,33.40999984741211,57.810001373291016,11.803411483764648,104.58000183105469,23.010000228881836,31.479999542236328,40.84000015258789,42.380001068115234,48.849998474121094,51.68000030517578,112.4800033569336,89.70999908447266,78.66000366210938,104.38999938964844,105.0\n2009-12-28,41.34000015258789,22.81999969482422,103.75,39.560001373291016,55.810001373291016,88.80000305175781,26.280000686645508,32.400001525878906,33.439998626708984,57.90999984741211,11.762794494628906,104.30000305175781,23.079999923706055,31.5,41.04999923706055,42.18000030517578,49.209999084472656,51.689998626708984,112.72000122070312,89.45999908447266,78.48999786376953,104.25,105.29000091552734\n2009-12-29,41.18000030517578,22.790000915527344,103.83000183105469,39.720001220703125,55.900001525878906,88.87000274658203,26.389999389648438,32.400001525878906,33.4900016784668,57.529998779296875,11.7140531539917,104.18000030517578,23.049999237060547,31.479999542236328,41.439998626708984,42.040000915527344,49.15999984741211,51.900001525878906,112.55999755859375,89.7300033569336,78.54000091552734,104.04000091552734,105.29000091552734\n2009-12-30,41.36000061035156,22.549999237060547,103.98999786376953,39.279998779296875,55.66999816894531,89.02999877929688,26.139999389648438,32.619998931884766,33.45000076293945,57.470001220703125,11.722177505493164,104.30000305175781,23.1299991607666,31.469999313354492,41.41999816894531,42.0099983215332,48.95000076293945,51.560001373291016,112.5199966430664,90.31999969482422,78.6500015258789,103.98999786376953,105.22000122070312\n2009-12-31,41.5,22.440000534057617,103.9000015258789,38.959999084472656,55.279998779296875,88.5999984741211,25.850000381469727,32.400001525878906,32.9900016784668,57.0099983215332,11.697806358337402,104.1500015258789,22.93000030517578,31.020000457763672,41.369998931884766,42.2599983215332,48.47999954223633,51.31999969482422,111.44000244140625,89.88999938964844,78.58999633789062,103.95999908447266,104.06999969482422\n2010-01-04,42.709999084472656,22.899999618530273,104.16999816894531,39.959999084472656,56.72999954223633,88.81999969482422,26.770000457763672,33.02000045776367,34.02000045776367,58.810001373291016,11.933387756347656,104.69999694824219,23.270000457763672,31.079999923706055,42.7599983215332,43.13999938964844,49.959999084472656,52.84000015258789,113.33000183105469,89.80999755859375,78.68000030517578,104.0199966430664,105.66000366210938\n2010-01-05,43.02000045776367,22.790000915527344,104.51000213623047,40.20000076293945,56.779998779296875,89.20999908447266,26.700000762939453,33.2400016784668,34.130001068115234,59.290000915527344,12.152721405029297,105.19999694824219,23.239999771118164,30.709999084472656,42.97999954223633,44.029998779296875,49.880001068115234,53.08000183105469,113.62999725341797,90.38999938964844,78.91000366210938,104.25,105.48999786376953\n2010-01-06,43.11000061035156,22.93000030517578,104.23999786376953,40.36000061035156,57.02000045776367,88.8499984741211,26.84000015258789,33.2599983215332,34.709999084472656,60.0,12.177091598510742,104.88999938964844,22.979999542236328,30.889999389648438,43.20000076293945,44.560001373291016,50.18000030517578,53.31999969482422,113.70999908447266,89.18000030517578,78.87999725341797,104.25,105.55999755859375\n2010-01-07,42.86000061035156,22.770000457763672,104.4000015258789,40.0,56.79999923706055,88.8499984741211,26.719999313354492,33.13999938964844,34.439998626708984,59.90999984741211,12.437043190002441,105.0199966430664,22.889999389648438,30.75,42.86000061035156,43.869998931884766,49.86000061035156,52.95000076293945,114.19000244140625,89.33000183105469,78.81999969482422,104.2699966430664,105.94000244140625\n2010-01-08,43.20000076293945,22.799999237060547,104.62000274658203,40.47999954223633,57.25,88.95999908447266,27.09000015258789,33.31999969482422,34.91999816894531,60.29999923706055,12.363931655883789,105.25,23.040000915527344,30.719999313354492,43.369998931884766,44.0,50.36000061035156,53.52000045776367,114.56999969482422,89.29000091552734,78.9000015258789,104.4000015258789,106.11000061035156\n2010-01-11,43.11000061035156,23.15999984741211,104.38999938964844,40.84000015258789,57.720001220703125,89.0199966430664,27.31999969482422,33.599998474121094,34.72999954223633,60.220001220703125,12.372055053710938,105.36000061035156,22.950000762939453,31.040000915527344,43.65999984741211,44.06999969482422,50.7599983215332,53.83000183105469,114.7300033569336,88.80000305175781,78.93000030517578,104.48999786376953,106.54000091552734\n2010-01-12,42.41999816894531,22.760000228881836,104.87000274658203,41.119998931884766,57.040000915527344,89.66000366210938,26.809999465942383,33.36000061035156,34.06999969482422,59.349998474121094,12.193338394165039,105.55999755859375,22.700000762939453,30.90999984741211,42.52000045776367,43.0,50.02000045776367,53.65999984741211,113.66000366210938,90.31999969482422,79.2300033569336,104.5199966430664,106.13999938964844\n2010-01-13,42.54999923706055,22.940000534057617,104.4000015258789,41.36000061035156,57.52000045776367,89.2300033569336,27.040000915527344,33.599998474121094,34.470001220703125,59.56999969482422,12.331438064575195,105.12000274658203,22.920000076293945,31.25,42.88999938964844,42.47999954223633,50.70000076293945,53.939998626708984,114.62000274658203,89.2699966430664,79.05000305175781,104.38999938964844,106.75\n2010-01-14,42.439998626708984,22.969999313354492,104.66999816894531,41.959999084472656,57.959999084472656,89.6500015258789,27.059999465942383,33.70000076293945,34.04999923706055,59.7400016784668,12.388301849365234,105.5,22.979999542236328,31.110000610351562,43.15999984741211,42.130001068115234,50.599998474121094,54.61000061035156,114.93000030517578,90.5199966430664,79.23999786376953,104.51000213623047,107.02999877929688\n2010-01-15,41.95000076293945,22.440000534057617,105.01000213623047,41.880001068115234,57.04999923706055,90.05000305175781,26.520000457763672,33.380001068115234,33.79999923706055,59.2599983215332,12.136474609375,105.45999908447266,22.65999984741211,30.90999984741211,42.459999084472656,41.45000076293945,49.540000915527344,54.31999969482422,113.63999938964844,91.08000183105469,79.29000091552734,104.56999969482422,106.01000213623047\n2010-01-19,42.79999923706055,22.59000015258789,104.93000030517578,41.84000015258789,57.61000061035156,89.88999938964844,26.709999084472656,33.86000061035156,34.34000015258789,59.79999923706055,12.290820121765137,105.55000305175781,23.049999237060547,31.270000457763672,43.040000915527344,42.77000045776367,50.56999969482422,54.619998931884766,115.05999755859375,90.81999969482422,79.25,104.33000183105469,107.16999816894531\n2010-01-20,41.77000045776367,21.920000076293945,105.08999633789062,40.91999816894531,56.13999938964844,90.19999694824219,25.850000381469727,33.29999923706055,33.72999954223633,58.869998931884766,12.258326530456543,105.4800033569336,22.68000030517578,30.940000534057617,41.81999969482422,41.13999938964844,49.0,53.15999984741211,113.88999938964844,91.73999786376953,79.44000244140625,104.4000015258789,106.0199966430664\n2010-01-21,40.5099983215332,21.25,105.29000091552734,41.119998931884766,54.939998626708984,90.52999877929688,25.149999618530273,32.279998779296875,32.27000045776367,57.66999816894531,11.909016609191895,105.76000213623047,22.440000534057617,30.489999771118164,40.459999084472656,39.61000061035156,47.47999954223633,52.650001525878906,111.69999694824219,92.16000366210938,79.52999877929688,104.52999877929688,103.70999908447266\n2010-01-22,39.61000061035156,20.860000610351562,105.19000244140625,40.68000030517578,53.869998931884766,90.61000061035156,24.559999465942383,31.360000610351562,31.6299991607666,56.29999923706055,11.519089698791504,105.5999984741211,21.65999984741211,29.81999969482422,39.83000183105469,39.06999969482422,46.45000076293945,52.04999923706055,109.20999908447266,92.0,79.5,104.62999725341797,101.62999725341797\n2010-01-25,39.900001525878906,21.079999923706055,104.91999816894531,41.0,54.529998779296875,90.41000366210938,24.889999389648438,32.060001373291016,31.90999984741211,56.66999816894531,11.584077835083008,105.58999633789062,21.84000015258789,30.020000457763672,40.369998931884766,39.689998626708984,47.29999923706055,52.58000183105469,109.7699966430664,91.58000183105469,79.38999938964844,104.58999633789062,101.91000366210938\n2010-01-26,39.06999969482422,21.010000228881836,105.23999786376953,40.560001373291016,54.220001220703125,90.58999633789062,24.719999313354492,31.84000015258789,31.459999084472656,56.310001373291016,11.380990982055664,105.30999755859375,21.780000686645508,30.139999389648438,39.68000030517578,38.54999923706055,46.93000030517578,51.970001220703125,109.30999755859375,91.61000061035156,79.58000183105469,104.5,101.87999725341797\n2010-01-27,38.970001220703125,20.969999313354492,104.95999908447266,40.31999969482422,54.15999984741211,90.37999725341797,24.719999313354492,32.08000183105469,31.190000534057617,56.09000015258789,11.65718936920166,104.93000030517578,21.959999084472656,29.940000534057617,39.439998626708984,38.33000183105469,47.119998931884766,51.689998626708984,109.83000183105469,91.55999755859375,79.47000122070312,104.44000244140625,102.30000305175781\n2010-01-28,38.70000076293945,20.579999923706055,105.0999984741211,39.91999816894531,53.25,90.3499984741211,24.139999389648438,31.239999771118164,30.6299991607666,55.5,11.600324630737305,104.77999877929688,21.329999923706055,29.709999084472656,39.11000061035156,38.5099983215332,45.970001220703125,51.13999938964844,108.56999969482422,91.51000213623047,79.5,104.4800033569336,101.19999694824219\n2010-01-29,38.279998779296875,20.34000015258789,105.48999786376953,39.36000061035156,52.47999954223633,90.69999694824219,23.829999923706055,30.860000610351562,30.139999389648438,54.5,11.519089698791504,105.44999694824219,20.959999084472656,29.530000686645508,38.18000030517578,38.36000061035156,45.439998626708984,50.369998931884766,107.38999938964844,92.30999755859375,79.5999984741211,104.56999969482422,100.55000305175781\n2010-02-01,39.310001373291016,20.700000762939453,105.23999786376953,39.7599983215332,53.439998626708984,90.08999633789062,24.360000610351562,31.020000457763672,31.34000015258789,56.29999923706055,11.7140531539917,104.52999877929688,21.200000762939453,29.719999313354492,39.029998779296875,39.560001373291016,46.58000183105469,51.119998931884766,109.05999755859375,91.1500015258789,79.30000305175781,104.25,101.83999633789062\n2010-02-02,39.630001068115234,21.0,105.43000030517578,40.52000045776367,54.33000183105469,90.23999786376953,24.780000686645508,31.860000610351562,31.440000534057617,57.040000915527344,11.82778263092041,104.86000061035156,21.40999984741211,29.959999084472656,39.380001068115234,39.84000015258789,47.29999923706055,51.79999923706055,110.37999725341797,91.41000366210938,79.3499984741211,104.30000305175781,102.87999725341797\n2010-02-03,39.400001525878906,20.850000381469727,105.0,40.119998931884766,53.7599983215332,89.80999755859375,24.639999389648438,31.3799991607666,31.079999923706055,56.54999923706055,11.697806358337402,104.75,21.459999084472656,29.75,39.04999923706055,39.84000015258789,46.709999084472656,51.38999938964844,109.83000183105469,90.3499984741211,79.30000305175781,104.2699966430664,102.62999725341797\n2010-02-04,37.619998931884766,20.0,105.27999877929688,39.36000061035156,51.56999969482422,90.55000305175781,23.3700008392334,30.15999984741211,29.920000076293945,54.22999954223633,11.194150924682617,104.73999786376953,20.860000610351562,28.969999313354492,37.38999938964844,38.02000045776367,44.41999816894531,49.939998626708984,106.44000244140625,91.77999877929688,79.44999694824219,104.30999755859375,100.04000091552734\n2010-02-05,37.20000076293945,19.700000762939453,105.08999633789062,39.279998779296875,51.47999954223633,90.83999633789062,22.719999313354492,29.799999237060547,30.479999542236328,54.2400016784668,11.324127197265625,104.41999816894531,21.06999969482422,28.920000076293945,37.470001220703125,37.56999969482422,44.0099983215332,49.88999938964844,106.66000366210938,91.9800033569336,79.58000183105469,104.3499984741211,100.16000366210938\n2010-02-08,36.83000183105469,19.530000686645508,104.93000030517578,39.0,50.459999084472656,90.76000213623047,22.520000457763672,29.399999618530273,29.989999771118164,53.7400016784668,11.09666919708252,104.5199966430664,20.979999542236328,28.59000015258789,37.27000045776367,37.16999816894531,43.369998931884766,49.459999084472656,105.88999938964844,92.0999984741211,79.58999633789062,104.2699966430664,99.22000122070312\n2010-02-09,38.029998779296875,20.1200008392334,104.56999969482422,39.2400016784668,52.04999923706055,90.2699966430664,23.43000030517578,30.15999984741211,30.719999313354492,54.869998931884766,11.210397720336914,104.27999877929688,21.15999984741211,28.8799991607666,38.41999816894531,38.459999084472656,45.16999816894531,50.400001525878906,107.22000122070312,91.18000030517578,79.43000030517578,104.2699966430664,100.6500015258789\n2010-02-10,37.93000030517578,20.049999237060547,104.26000213623047,39.2400016784668,51.720001220703125,90.0199966430664,23.280000686645508,30.059999465942383,30.510000228881836,54.63999938964844,11.299756050109863,103.47000122070312,21.100000381469727,28.75,38.16999816894531,38.630001068115234,44.650001525878906,50.310001373291016,107.01000213623047,90.30999755859375,79.25,104.0999984741211,100.5199966430664\n2010-02-11,38.93000030517578,20.030000686645508,104.01000213623047,39.439998626708984,52.20000076293945,89.91000366210938,23.260000228881836,30.579999923706055,31.030000686645508,55.56999969482422,11.324127197265625,103.70999908447266,21.31999969482422,28.920000076293945,39.2400016784668,39.68000030517578,45.029998779296875,50.880001068115234,108.12999725341797,89.81999969482422,79.12000274658203,104.08999633789062,101.58000183105469\n2010-02-12,38.439998626708984,19.770000457763672,104.01000213623047,39.20000076293945,51.75,90.12000274658203,22.889999389648438,30.299999237060547,30.969999313354492,55.59000015258789,11.332250595092773,103.83000183105469,21.360000610351562,28.809999465942383,38.810001373291016,38.90999984741211,44.41999816894531,50.470001220703125,108.04000091552734,90.19000244140625,79.2300033569336,104.19000244140625,101.2699966430664\n2010-02-16,39.43000030517578,20.329999923706055,104.30999755859375,39.599998474121094,52.900001525878906,90.31999969482422,23.690000534057617,31.059999465942383,31.75,56.900001525878906,11.567831039428711,104.23999786376953,21.68000030517578,29.309999465942383,39.90999984741211,39.560001373291016,45.59000015258789,51.34000015258789,109.73999786376953,90.36000061035156,79.33000183105469,104.30999755859375,102.80999755859375\n2010-02-17,39.56999969482422,20.290000915527344,104.11000061035156,39.599998474121094,52.970001220703125,89.83999633789062,23.670000076293945,31.139999389648438,31.770000457763672,56.81999969482422,11.608448028564453,103.88999938964844,21.739999771118164,29.190000534057617,40.33000183105469,39.70000076293945,45.540000915527344,51.529998779296875,110.26000213623047,89.33000183105469,79.1500015258789,104.3499984741211,103.37999725341797\n2010-02-18,39.720001220703125,20.329999923706055,104.0199966430664,39.68000030517578,53.27000045776367,89.5199966430664,23.780000686645508,31.239999771118164,32.11000061035156,57.13999938964844,11.681559562683105,103.81999969482422,21.8799991607666,29.350000381469727,40.540000915527344,39.709999084472656,45.91999816894531,51.68000030517578,110.91000366210938,88.97000122070312,79.04000091552734,104.30999755859375,104.16999816894531\n2010-02-19,39.380001068115234,20.3799991607666,103.83999633789062,39.040000915527344,52.939998626708984,89.56999969482422,23.75,31.079999923706055,32.290000915527344,57.36000061035156,11.74654769897461,104.19000244140625,21.81999969482422,29.760000228881836,40.220001220703125,39.029998779296875,45.720001220703125,51.130001068115234,111.13999938964844,89.44999694824219,79.04000091552734,104.2699966430664,103.98999786376953\n2010-02-22,39.43000030517578,20.389999389648438,103.58000183105469,39.52000045776367,53.040000915527344,89.5,23.770000457763672,31.079999923706055,32.150001525878906,56.56999969482422,11.900893211364746,104.25,21.780000686645508,29.600000381469727,40.5,39.15999984741211,45.650001525878906,51.5,111.16000366210938,89.08000183105469,79.01000213623047,104.31999969482422,103.83999633789062\n2010-02-23,38.52000045776367,19.979999542236328,103.9000015258789,39.36000061035156,52.290000915527344,90.18000030517578,23.3700008392334,30.6200008392334,31.639999389648438,55.630001068115234,11.681559562683105,104.5,21.510000228881836,29.399999618530273,39.77000045776367,38.650001525878906,44.7400016784668,51.08000183105469,109.80999755859375,90.47000122070312,79.30999755859375,104.41999816894531,102.87000274658203\n2010-02-24,38.88999938964844,20.010000228881836,103.69999694824219,39.439998626708984,52.619998931884766,90.2300033569336,23.520000457763672,30.8799991607666,31.559999465942383,55.97999954223633,11.88464641571045,104.94999694824219,21.719999313354492,29.43000030517578,40.279998779296875,39.31999969482422,45.209999084472656,51.459999084472656,110.81999969482422,90.69000244140625,79.41000366210938,104.47000122070312,103.69999694824219\n2010-02-25,38.56999969482422,19.93000030517578,103.69999694824219,39.52000045776367,52.29999923706055,90.55999755859375,23.290000915527344,30.479999542236328,31.489999771118164,56.0099983215332,11.852152824401855,104.83999633789062,21.65999984741211,29.3700008392334,39.4900016784668,38.9900016784668,44.84000015258789,51.02000045776367,110.66999816894531,91.19999694824219,79.5199966430664,104.47000122070312,103.30000305175781\n2010-02-26,38.959999084472656,20.049999237060547,103.91000366210938,39.7599983215332,52.619998931884766,90.69999694824219,23.610000610351562,30.600000381469727,31.5,56.13999938964844,11.925264358520508,105.52999877929688,21.690000534057617,29.139999389648438,40.09000015258789,39.59000015258789,45.189998626708984,51.52000045776367,110.73999786376953,91.66999816894531,79.61000061035156,104.62000274658203,103.30000305175781\n2010-03-01,39.619998931884766,20.31999969482422,103.91999816894531,40.15999984741211,53.029998779296875,90.55000305175781,23.760000228881836,30.420000076293945,31.979999542236328,56.65999984741211,11.957757949829102,105.22000122070312,21.969999313354492,29.559999465942383,40.95000076293945,40.59000015258789,45.33000183105469,52.380001068115234,111.88999938964844,91.33999633789062,79.45999908447266,104.5,104.0199966430664\n2010-03-02,40.06999969482422,20.6299991607666,104.0,40.279998779296875,53.43000030517578,90.5999984741211,24.049999237060547,30.639999389648438,32.25,57.130001068115234,11.998374938964844,105.44000244140625,21.940000534057617,29.649999618530273,41.06999969482422,40.900001525878906,45.810001373291016,52.52000045776367,112.19999694824219,91.22000122070312,79.5199966430664,104.5199966430664,104.01000213623047\n2010-03-03,40.119998931884766,20.84000015258789,103.95999908447266,40.560001373291016,54.06999969482422,90.51000213623047,24.34000015258789,31.31999969482422,32.529998779296875,57.380001068115234,12.006498336791992,105.66000366210938,21.950000762939453,29.600000381469727,41.400001525878906,40.779998779296875,46.5,52.869998931884766,112.30000305175781,90.98999786376953,79.52999877929688,104.54000091552734,104.08999633789062\n2010-03-04,39.90999984741211,20.790000915527344,104.06999969482422,40.15999984741211,53.93000030517578,90.66999816894531,24.290000915527344,31.260000228881836,32.75,57.08000183105469,12.128351211547852,105.70999908447266,22.040000915527344,29.65999984741211,41.29999923706055,40.15999984741211,46.31999969482422,52.459999084472656,112.63999938964844,91.47000122070312,79.58999633789062,104.36000061035156,104.5\n2010-03-05,40.95000076293945,21.110000610351562,103.83999633789062,40.560001373291016,54.97999954223633,90.23999786376953,24.93000030517578,31.979999542236328,33.16999816894531,58.150001525878906,12.363931655883789,105.58000183105469,22.309999465942383,29.959999084472656,42.22999954223633,41.18000030517578,47.54999923706055,53.13999938964844,114.25,90.2699966430664,79.47000122070312,104.43000030517578,105.76000213623047\n2010-03-08,40.97999954223633,21.059999465942383,103.75,40.84000015258789,54.97999954223633,90.0,24.799999237060547,31.700000762939453,33.16999816894531,58.060001373291016,12.388301849365234,105.75,22.43000030517578,29.959999084472656,42.16999816894531,41.31999969482422,47.400001525878906,53.400001525878906,114.2699966430664,89.80000305175781,79.33999633789062,104.51000213623047,105.58999633789062\n2010-03-09,41.209999084472656,21.030000686645508,103.93000030517578,40.68000030517578,54.849998474121094,90.2300033569336,24.739999771118164,31.479999542236328,32.959999084472656,58.060001373291016,12.428919792175293,105.6500015258789,22.530000686645508,29.920000076293945,42.52000045776367,41.40999984741211,47.08000183105469,53.459999084472656,114.45999908447266,89.81999969482422,79.38999938964844,104.41999816894531,105.70999908447266\n2010-03-10,41.5,21.280000686645508,103.81999969482422,40.400001525878906,55.08000183105469,90.08000183105469,24.959999084472656,31.639999389648438,32.970001220703125,58.56999969482422,12.567018508911133,105.75,22.68000030517578,29.93000030517578,42.61000061035156,41.5099983215332,47.52000045776367,53.34000015258789,114.97000122070312,89.58999633789062,79.33000183105469,104.61000061035156,105.7699966430664\n2010-03-11,41.5099983215332,21.420000076293945,103.94000244140625,40.79999923706055,55.290000915527344,90.0,25.09000015258789,31.979999542236328,33.15999984741211,58.470001220703125,12.672623634338379,105.70999908447266,22.770000457763672,30.030000686645508,42.52000045776367,41.349998474121094,47.79999923706055,53.529998779296875,115.44999694824219,89.91999816894531,79.31999969482422,104.4800033569336,106.27999877929688\n2010-03-12,41.369998931884766,21.549999237060547,104.20999908447266,41.20000076293945,55.65999984741211,90.13999938964844,25.1299991607666,32.18000030517578,33.290000915527344,58.5,12.623883247375488,105.93000030517578,22.75,29.84000015258789,42.38999938964844,41.2400016784668,47.970001220703125,53.79999923706055,115.45999908447266,90.4800033569336,79.3499984741211,104.55999755859375,106.41999816894531\n2010-03-15,41.06999969482422,21.3700008392334,104.19000244140625,41.0,55.27000045776367,90.13999938964844,24.950000762939453,31.860000610351562,33.279998779296875,57.900001525878906,12.623883247375488,105.91000366210938,22.729999542236328,29.950000762939453,42.15999984741211,40.75,47.5099983215332,53.619998931884766,115.48999786376953,90.36000061035156,79.45999908447266,104.44000244140625,106.56999969482422\n2010-03-16,41.599998474121094,21.670000076293945,104.58000183105469,41.400001525878906,55.970001220703125,90.48999786376953,25.280000686645508,32.29999923706055,33.77000045776367,58.41999816894531,12.778228759765625,106.4000015258789,22.899999618530273,30.299999237060547,42.84000015258789,40.959999084472656,48.349998474121094,54.25,116.41000366210938,91.08000183105469,79.5999984741211,104.68000030517578,107.06999969482422\n2010-03-17,42.04999923706055,21.780000686645508,104.80000305175781,41.560001373291016,56.27000045776367,90.5999984741211,25.290000915527344,32.52000045776367,33.959999084472656,59.060001373291016,12.932575225830078,106.79000091552734,22.969999313354492,30.399999618530273,43.220001220703125,41.619998931884766,48.56999969482422,54.56999969482422,117.0999984741211,91.47000122070312,79.62000274658203,104.6500015258789,107.5199966430664\n2010-03-18,41.72999954223633,21.600000381469727,104.37999725341797,41.279998779296875,55.939998626708984,90.36000061035156,25.079999923706055,32.41999816894531,33.720001220703125,58.18000030517578,12.859463691711426,106.58000183105469,23.0,30.260000228881836,43.060001373291016,41.41999816894531,48.150001525878906,54.25,117.04000091552734,91.16999816894531,79.4800033569336,104.44999694824219,107.94999694824219\n2010-03-19,41.189998626708984,21.350000381469727,104.18000030517578,41.20000076293945,55.369998931884766,90.23999786376953,24.809999465942383,31.940000534057617,33.279998779296875,57.279998779296875,12.745735168457031,106.5,22.790000915527344,29.959999084472656,42.70000076293945,41.08000183105469,47.5099983215332,54.0099983215332,115.97000122070312,91.26000213623047,79.54000091552734,104.48999786376953,107.33999633789062\n2010-03-22,41.34000015258789,21.389999389648438,104.41999816894531,41.400001525878906,55.529998779296875,90.54000091552734,24.8799991607666,32.119998931884766,33.77000045776367,57.130001068115234,12.810723304748535,106.66999816894531,22.959999084472656,29.760000228881836,42.790000915527344,41.11000061035156,47.650001525878906,54.220001220703125,116.58999633789062,91.36000061035156,79.62000274658203,104.55000305175781,107.79000091552734\n2010-03-23,41.630001068115234,21.479999542236328,104.33999633789062,41.79999923706055,55.91999816894531,90.3499984741211,24.959999084472656,32.29999923706055,34.209999084472656,57.349998474121094,12.916328430175781,106.5999984741211,23.18000030517578,29.8799991607666,43.400001525878906,41.2400016784668,47.900001525878906,54.72999954223633,117.41000366210938,90.93000030517578,79.62000274658203,104.5999984741211,108.87000274658203\n2010-03-24,41.0099983215332,21.190000534057617,103.5,41.119998931884766,55.0,89.44999694824219,24.540000915527344,31.84000015258789,34.11000061035156,57.02000045776367,12.92445182800293,105.80999755859375,23.06999969482422,29.56999969482422,42.66999816894531,40.7599983215332,46.9900016784668,53.939998626708984,116.83999633789062,89.2699966430664,79.22000122070312,104.3499984741211,108.4000015258789\n2010-03-25,40.900001525878906,21.34000015258789,103.36000061035156,40.880001068115234,54.970001220703125,89.12000274658203,24.610000610351562,31.799999237060547,33.43000030517578,56.060001373291016,12.981315612792969,105.43000030517578,23.110000610351562,29.3799991607666,42.599998474121094,40.02000045776367,47.150001525878906,53.54999923706055,116.6500015258789,88.69999694824219,78.97000122070312,104.33999633789062,108.44000244140625\n2010-03-26,41.099998474121094,21.59000015258789,103.48999786376953,41.52000045776367,55.5099983215332,89.33000183105469,24.8799991607666,31.940000534057617,33.68000030517578,56.08000183105469,12.997563362121582,105.75,23.0,29.450000762939453,42.84000015258789,40.83000183105469,47.63999938964844,54.130001068115234,116.58000183105469,88.94999694824219,79.13999938964844,104.44999694824219,108.43000030517578\n2010-03-29,41.84000015258789,21.84000015258789,103.36000061035156,42.040000915527344,55.97999954223633,89.19999694824219,25.149999618530273,32.29999923706055,34.040000915527344,57.16999816894531,13.013810157775879,105.66000366210938,23.06999969482422,29.809999465942383,43.380001068115234,41.619998931884766,48.040000915527344,54.900001525878906,117.31999969482422,88.61000061035156,78.97000122070312,104.45999908447266,108.91999816894531\n2010-03-30,42.0,21.780000686645508,103.44999694824219,42.279998779296875,55.97999954223633,89.29000091552734,24.979999542236328,32.380001068115234,34.09000015258789,57.2599983215332,12.932575225830078,105.72000122070312,23.170000076293945,29.729999542236328,43.5,42.2599983215332,47.790000915527344,55.08000183105469,117.4000015258789,88.88999938964844,79.12999725341797,104.5199966430664,109.12999725341797\n2010-03-31,42.119998931884766,21.8700008392334,103.9000015258789,41.7599983215332,55.97999954223633,89.5,25.059999465942383,32.540000915527344,33.91999816894531,57.52000045776367,12.956945419311523,105.7699966430664,23.100000381469727,29.65999984741211,42.959999084472656,42.099998474121094,48.130001068115234,54.58000183105469,117.0,89.5,79.19999694824219,104.58999633789062,108.61000061035156\n2010-04-01,43.220001220703125,22.229999542236328,103.44000244140625,42.400001525878906,56.970001220703125,89.05999755859375,25.56999969482422,33.15999984741211,34.5099983215332,58.540000915527344,13.06255054473877,105.52999877929688,23.059999465942383,30.06999969482422,43.79999923706055,43.27000045776367,49.0099983215332,55.47999954223633,117.80000305175781,88.94999694824219,78.93000030517578,104.4000015258789,109.27999877929688\n2010-04-05,43.61000061035156,22.260000228881836,102.70999908447266,42.279998779296875,57.029998779296875,88.26000213623047,25.59000015258789,33.459999084472656,34.93000030517578,59.58000183105469,13.192526817321777,104.55999755859375,23.329999923706055,30.25,44.15999984741211,43.790000915527344,49.150001525878906,55.47999954223633,118.76000213623047,87.47000122070312,78.47000122070312,103.93000030517578,109.7300033569336\n2010-04-06,43.7400016784668,22.1299991607666,103.12000274658203,42.400001525878906,56.869998931884766,88.5199966430664,25.440000534057617,33.34000015258789,34.9900016784668,59.58000183105469,13.330625534057617,104.80999755859375,23.350000381469727,30.5,44.36000061035156,43.84000015258789,48.849998474121094,55.63999938964844,119.04000091552734,87.61000061035156,78.52999877929688,104.11000061035156,109.72000122070312\n2010-04-07,43.36000061035156,21.90999984741211,103.8499984741211,42.400001525878906,56.470001220703125,89.06999969482422,25.139999389648438,33.02000045776367,34.77000045776367,58.9900016784668,13.28188419342041,105.33999633789062,23.260000228881836,30.200000762939453,44.060001373291016,43.560001373291016,48.22999954223633,55.540000915527344,118.36000061035156,88.7300033569336,78.83000183105469,104.19999694824219,109.05000305175781\n2010-04-08,43.5099983215332,21.8700008392334,103.75,42.439998626708984,56.40999984741211,88.97000122070312,25.049999237060547,33.040000915527344,34.849998474121094,59.20000076293945,13.387490272521973,105.13999938964844,23.299999237060547,30.020000457763672,44.06999969482422,43.77000045776367,48.16999816894531,55.560001373291016,118.7699966430664,88.7699966430664,78.79000091552734,104.12999725341797,109.37000274658203\n2010-04-09,43.779998779296875,22.170000076293945,103.86000061035156,42.560001373291016,57.150001525878906,89.06999969482422,25.489999771118164,33.47999954223633,34.90999984741211,59.83000183105469,13.436230659484863,105.20999908447266,23.479999542236328,30.239999771118164,44.45000076293945,44.59000015258789,49.11000061035156,55.81999969482422,119.55000305175781,88.9800033569336,78.94000244140625,104.0,110.05999755859375\n2010-04-12,43.43000030517578,22.360000610351562,104.1500015258789,42.47999954223633,57.33000183105469,89.30999755859375,25.75,33.439998626708984,34.79999923706055,59.970001220703125,13.493095397949219,105.51000213623047,23.530000686645508,30.31999969482422,44.279998779296875,43.9900016784668,49.459999084472656,55.72999954223633,119.73999786376953,89.44999694824219,79.0199966430664,104.22000122070312,110.18000030517578\n2010-04-13,43.34000015258789,22.3700008392334,104.23999786376953,42.400001525878906,57.279998779296875,89.4800033569336,25.649999618530273,33.41999816894531,34.66999816894531,59.7599983215332,13.501218795776367,105.88999938964844,23.600000381469727,30.15999984741211,44.2599983215332,43.84000015258789,49.43000030517578,55.619998931884766,119.83000183105469,89.73999786376953,79.18000030517578,104.1500015258789,110.25\n2010-04-14,43.97999954223633,22.6299991607666,104.11000061035156,42.599998474121094,58.040000915527344,89.23999786376953,26.020000457763672,33.91999816894531,34.93000030517578,60.33000183105469,13.8505277633667,105.80000305175781,23.940000534057617,30.190000534057617,45.11000061035156,44.279998779296875,50.08000183105469,56.25,121.19000244140625,89.11000061035156,79.12000274658203,104.29000091552734,111.29000091552734\n2010-04-15,43.7400016784668,22.579999923706055,104.41000366210938,42.79999923706055,58.0,89.38999938964844,25.850000381469727,34.099998474121094,34.93000030517578,60.31999969482422,13.79366397857666,105.9800033569336,24.049999237060547,30.18000030517578,44.95000076293945,43.900001525878906,50.040000915527344,56.27000045776367,121.29000091552734,89.20999908447266,79.23999786376953,104.30999755859375,111.55999755859375\n2010-04-16,42.459999084472656,22.110000610351562,104.6500015258789,42.0,56.720001220703125,89.93000030517578,25.18000030517578,33.5,34.33000183105469,59.29999923706055,13.290008544921875,106.2300033569336,23.729999542236328,29.829999923706055,43.810001373291016,42.310001373291016,48.88999938964844,55.16999816894531,119.36000061035156,89.86000061035156,79.41000366210938,104.4000015258789,110.18000030517578\n2010-04-19,42.290000915527344,22.0,104.4000015258789,41.91999816894531,56.56999969482422,89.70999908447266,25.15999984741211,33.18000030517578,34.34000015258789,59.380001068115234,13.419983863830566,105.95999908447266,23.780000686645508,29.860000610351562,43.70000076293945,41.90999984741211,48.709999084472656,55.040000915527344,119.80999755859375,89.63999938964844,79.30999755859375,104.37000274658203,110.83999633789062\n2010-04-20,42.790000915527344,22.260000228881836,104.6500015258789,41.7599983215332,56.91999816894531,89.75,25.280000686645508,33.63999938964844,34.45000076293945,60.540000915527344,13.598700523376465,106.19000244140625,23.90999984741211,30.239999771118164,44.18000030517578,42.59000015258789,49.22999954223633,55.22999954223633,120.87999725341797,89.95999908447266,79.38999938964844,104.44000244140625,111.0999984741211\n2010-04-21,42.650001525878906,22.110000610351562,104.97000122070312,41.91999816894531,56.54999923706055,90.04000091552734,25.0,33.36000061035156,34.36000061035156,60.47999954223633,13.517465591430664,106.55999755859375,23.959999084472656,30.270000457763672,43.90999984741211,41.9900016784668,48.70000076293945,55.16999816894531,120.66000366210938,90.69999694824219,79.44999694824219,104.5,111.16000366210938\n2010-04-22,42.83000183105469,21.90999984741211,104.66999816894531,41.560001373291016,56.040000915527344,89.83000183105469,24.639999389648438,33.060001373291016,34.70000076293945,60.630001068115234,13.590577125549316,106.31999969482422,24.020000457763672,30.3700008392334,43.790000915527344,42.18000030517578,48.18000030517578,54.779998779296875,121.0199966430664,90.43000030517578,79.4000015258789,104.37000274658203,111.3499984741211\n2010-04-23,43.060001373291016,22.149999618530273,104.68000030517578,41.84000015258789,56.459999084472656,89.58000183105469,24.860000610351562,33.41999816894531,35.0099983215332,62.09000015258789,13.631194114685059,106.30000305175781,24.079999923706055,30.610000610351562,43.689998626708984,42.04999923706055,48.79999923706055,54.90999984741211,121.80999755859375,90.11000061035156,79.33999633789062,104.33000183105469,111.95999908447266\n2010-04-26,43.060001373291016,22.260000228881836,104.7699966430664,42.119998931884766,56.52000045776367,89.63999938964844,24.860000610351562,33.439998626708984,35.15999984741211,61.880001068115234,13.419983863830566,106.3499984741211,24.049999237060547,30.5,43.63999938964844,42.06999969482422,48.650001525878906,55.189998626708984,121.3499984741211,90.20999908447266,79.30000305175781,104.36000061035156,112.08000183105469\n2010-04-27,41.52000045776367,21.299999237060547,105.37999725341797,41.36000061035156,54.25,90.4800033569336,23.510000228881836,32.08000183105469,33.880001068115234,59.97999954223633,12.965068817138672,106.41999816894531,23.579999923706055,29.979999542236328,42.130001068115234,40.459999084472656,46.22999954223633,53.77000045776367,118.4800033569336,91.4800033569336,79.58999633789062,104.36000061035156,109.87000274658203\n2010-04-28,41.869998931884766,21.200000762939453,105.16999816894531,41.20000076293945,54.2599983215332,90.0199966430664,23.40999984741211,32.119998931884766,34.290000915527344,60.59000015258789,13.151908874511719,106.5999984741211,23.649999618530273,30.290000915527344,42.779998779296875,40.900001525878906,46.08000183105469,54.029998779296875,119.37999725341797,90.69999694824219,79.54000091552734,104.38999938964844,110.55000305175781\n2010-04-29,42.560001373291016,21.469999313354492,105.72000122070312,41.68000030517578,55.099998474121094,90.16999816894531,23.84000015258789,32.52000045776367,34.599998474121094,60.65999984741211,13.45247745513916,106.87000274658203,23.889999389648438,30.31999969482422,43.2400016784668,40.97999954223633,47.119998931884766,54.58000183105469,120.86000061035156,91.08000183105469,79.56999969482422,104.37999725341797,111.69000244140625\n2010-04-30,42.04999923706055,21.389999389648438,106.05999755859375,41.560001373291016,54.40999984741211,90.72000122070312,23.559999465942383,31.84000015258789,33.9900016784668,59.90999984741211,13.127538681030273,107.30999755859375,23.389999389648438,30.440000534057617,42.25,40.84000015258789,46.29999923706055,53.97999954223633,118.80999755859375,92.12999725341797,79.80000305175781,104.41999816894531,110.0999984741211\n2010-05-03,42.279998779296875,21.5,105.70999908447266,41.68000030517578,54.79999923706055,90.20999908447266,23.809999465942383,31.739999771118164,33.970001220703125,60.59000015258789,13.379365921020508,106.88999938964844,23.709999084472656,30.829999923706055,42.79999923706055,41.209999084472656,46.63999938964844,54.439998626708984,120.3499984741211,91.69000244140625,79.5199966430664,104.12999725341797,111.54000091552734\n2010-05-04,40.34000015258789,20.59000015258789,105.87000274658203,40.400001525878906,52.630001068115234,90.81999969482422,22.690000534057617,31.100000381469727,32.790000915527344,58.970001220703125,13.013810157775879,107.0199966430664,23.030000686645508,30.299999237060547,40.70000076293945,39.689998626708984,44.630001068115234,52.31999969482422,117.5199966430664,93.33999633789062,79.75,104.23999786376953,109.36000061035156\n2010-05-05,39.61000061035156,20.049999237060547,105.91999816894531,40.36000061035156,51.619998931884766,91.16999816894531,21.940000534057617,30.15999984741211,32.54999923706055,58.040000915527344,12.940698623657227,106.55999755859375,22.93000030517578,30.09000015258789,40.349998474121094,39.060001373291016,43.470001220703125,52.11000061035156,116.81999969482422,93.88999938964844,79.79000091552734,104.16000366210938,108.80000305175781\n2010-05-06,37.9900016784668,19.31999969482422,106.4000015258789,40.119998931884766,49.31999969482422,92.16999816894531,20.56999969482422,28.739999771118164,31.479999542236328,56.060001373291016,12.396425247192383,104.80000305175781,22.239999771118164,29.260000228881836,37.900001525878906,37.75,41.150001525878906,50.79999923706055,112.94000244140625,96.79000091552734,80.0999984741211,103.98999786376953,105.26000213623047\n2010-05-07,38.189998626708984,19.18000030517578,106.16999816894531,39.7599983215332,49.209999084472656,91.91999816894531,20.639999389648438,28.579999923706055,31.1299991607666,54.9900016784668,12.258326530456543,105.13999938964844,21.75,29.100000381469727,38.220001220703125,38.2400016784668,40.869998931884766,50.720001220703125,111.26000213623047,95.58000183105469,79.9000015258789,103.30000305175781,103.77999877929688\n2010-05-10,40.939998626708984,20.190000534057617,105.87000274658203,40.880001068115234,52.400001525878906,91.22000122070312,22.5,30.1200008392334,32.61000061035156,57.34000015258789,12.940698623657227,105.80000305175781,22.75,30.0,40.720001220703125,40.349998474121094,44.34000015258789,52.83000183105469,116.16000366210938,93.5999984741211,79.80999755859375,103.5,108.0\n2010-05-11,40.20000076293945,20.139999389648438,106.06999969482422,39.959999084472656,51.54999923706055,91.33000183105469,22.170000076293945,29.8799991607666,32.20000076293945,56.959999084472656,12.89195728302002,105.91000366210938,22.600000381469727,30.059999465942383,39.91999816894531,39.619998931884766,43.599998474121094,51.720001220703125,115.83000183105469,93.36000061035156,79.91999816894531,103.73999786376953,107.66999816894531\n2010-05-12,40.70000076293945,20.6200008392334,106.19999694824219,40.31999969482422,52.130001068115234,91.0999984741211,22.510000228881836,30.139999389648438,32.869998931884766,57.75,13.038180351257324,105.87000274658203,23.190000534057617,30.309999465942383,40.34000015258789,39.81999969482422,44.34000015258789,52.209999084472656,117.44999694824219,92.6500015258789,79.69999694824219,103.7699966430664,109.26000213623047\n2010-05-13,40.31999969482422,20.450000762939453,106.29000091552734,40.0,51.45000076293945,91.3499984741211,22.100000381469727,29.739999771118164,32.380001068115234,57.380001068115234,12.802599906921387,106.18000030517578,22.850000381469727,30.18000030517578,40.02000045776367,39.61000061035156,43.40999984741211,51.7400016784668,115.98999786376953,93.26000213623047,79.8499984741211,103.86000061035156,108.0999984741211\n2010-05-14,39.4900016784668,19.809999465942383,106.5999984741211,39.720001220703125,49.9900016784668,91.94000244140625,21.149999618530273,28.780000686645508,31.59000015258789,56.2400016784668,12.469536781311035,106.1500015258789,22.40999984741211,29.93000030517578,38.880001068115234,38.880001068115234,41.9900016784668,50.90999984741211,113.88999938964844,94.87999725341797,80.12000274658203,103.70999908447266,106.51000213623047\n2010-05-17,39.25,19.920000076293945,106.2300033569336,39.63999938964844,50.060001373291016,91.73999786376953,21.1299991607666,28.979999542236328,31.59000015258789,55.65999984741211,12.477660179138184,106.33000183105469,22.520000457763672,29.959999084472656,38.59000015258789,38.68000030517578,42.09000015258789,50.880001068115234,113.94999694824219,94.52999877929688,80.12999725341797,103.73999786376953,106.5199966430664\n2010-05-18,38.43000030517578,19.6200008392334,106.77999877929688,38.959999084472656,48.97999954223633,92.41000366210938,20.690000534057617,28.280000686645508,31.049999237060547,55.22999954223633,12.120227813720703,106.66999816894531,22.18000030517578,29.670000076293945,37.779998779296875,38.439998626708984,41.150001525878906,49.810001373291016,112.4000015258789,95.9800033569336,80.43000030517578,103.86000061035156,105.38999938964844\n2010-05-19,38.060001373291016,19.65999984741211,106.0999984741211,39.2400016784668,49.16999816894531,92.48999786376953,21.030000686645508,28.280000686645508,31.049999237060547,54.599998474121094,12.136474609375,106.7300033569336,22.010000228881836,29.3700008392334,36.86000061035156,38.369998931884766,41.529998779296875,49.709999084472656,111.76000213623047,96.30000305175781,80.44999694824219,103.81999969482422,104.7699966430664\n2010-05-20,36.16999816894531,19.09000015258789,106.08999633789062,38.63999938964844,47.459999084472656,93.38999938964844,20.360000610351562,27.139999389648438,29.639999389648438,52.15999984741211,11.57595443725586,106.48999786376953,21.309999465942383,28.489999771118164,34.720001220703125,37.02000045776367,40.099998474121094,48.13999938964844,107.54000091552734,98.33000183105469,80.58999633789062,103.61000061035156,101.11000061035156\n2010-05-21,37.34000015258789,19.239999771118164,106.16000366210938,39.0,48.619998931884766,93.44000244140625,20.809999465942383,27.860000610351562,30.3700008392334,53.06999969482422,11.982128143310547,106.30999755859375,21.469999313354492,28.6200008392334,36.150001525878906,38.209999084472656,41.060001373291016,49.18000030517578,109.11000061035156,98.43000030517578,80.69999694824219,103.41999816894531,101.83999633789062\n2010-05-24,36.95000076293945,18.760000228881836,106.05000305175781,38.47999954223633,47.5,93.44000244140625,20.1200008392334,27.399999618530273,29.850000381469727,51.86000061035156,11.640942573547363,106.58999633789062,21.3700008392334,28.350000381469727,36.06999969482422,38.43000030517578,39.939998626708984,48.52000045776367,107.70999908447266,98.08999633789062,80.69000244140625,103.66999816894531,100.68000030517578\n2010-05-25,36.54999923706055,18.579999923706055,105.69999694824219,38.2400016784668,47.31999969482422,93.76000213623047,20.030000686645508,27.31999969482422,30.350000381469727,51.97999954223633,11.74654769897461,106.08000183105469,21.309999465942383,28.200000762939453,35.77000045776367,37.970001220703125,39.91999816894531,48.2400016784668,107.81999969482422,98.56999969482422,80.70999908447266,103.3499984741211,100.45999908447266\n2010-05-26,36.529998779296875,18.290000915527344,105.9000015258789,37.7599983215332,46.619998931884766,93.56999969482422,19.600000381469727,27.15999984741211,30.110000610351562,51.869998931884766,11.665312767028809,106.1500015258789,21.100000381469727,28.190000534057617,35.5099983215332,37.91999816894531,39.189998626708984,47.7400016784668,107.16999816894531,98.29000091552734,80.61000061035156,103.3499984741211,99.68000030517578\n2010-05-27,38.7400016784668,19.3799991607666,105.51000213623047,38.68000030517578,49.27000045776367,92.68000030517578,21.010000228881836,28.8799991607666,31.299999237060547,54.06999969482422,12.193338394165039,105.5999984741211,21.81999969482422,28.729999542236328,37.619998931884766,39.72999954223633,41.7599983215332,49.5099983215332,110.76000213623047,96.05999755859375,80.30000305175781,103.33000183105469,102.72000122070312\n2010-05-28,38.099998474121094,19.149999618530273,106.0999984741211,38.040000915527344,48.31999969482422,93.0999984741211,20.559999465942383,28.34000015258789,30.75,53.04999923706055,11.925264358520508,105.45999908447266,21.639999389648438,28.760000228881836,37.0099983215332,39.380001068115234,40.86000061035156,48.79999923706055,109.37000274658203,96.5,80.45999908447266,103.5199966430664,101.47000122070312\n2010-06-01,37.400001525878906,19.0,105.36000061035156,37.91999816894531,47.84000015258789,92.95999908447266,20.209999084472656,28.1200008392334,29.760000228881836,50.529998779296875,11.673436164855957,104.93000030517578,21.43000030517578,28.09000015258789,36.189998626708984,38.47999954223633,40.540000915527344,48.369998931884766,107.52999877929688,96.8499984741211,80.27999877929688,103.25,100.31999969482422\n2010-06-02,38.709999084472656,19.399999618530273,105.25,38.119998931884766,49.119998931884766,92.43000030517578,20.940000534057617,28.860000610351562,30.68000030517578,52.720001220703125,12.038992881774902,105.30000305175781,21.90999984741211,28.68000030517578,37.33000183105469,39.529998779296875,41.900001525878906,49.029998779296875,110.33000183105469,95.93000030517578,80.20999908447266,103.16999816894531,102.61000061035156\n2010-06-03,38.56999969482422,19.389999389648438,105.30000305175781,38.040000915527344,48.970001220703125,92.30000305175781,20.8799991607666,28.81999969482422,30.309999465942383,53.43000030517578,11.974004745483398,104.95999908447266,22.1299991607666,28.979999542236328,37.400001525878906,39.310001373291016,41.70000076293945,48.97999954223633,110.70999908447266,95.2300033569336,80.12000274658203,103.2300033569336,102.69000244140625\n2010-06-04,37.20000076293945,18.510000228881836,105.97000122070312,37.31999969482422,46.880001068115234,93.58000183105469,19.639999389648438,27.700000762939453,29.110000610351562,51.54999923706055,11.494719505310059,105.5999984741211,21.420000076293945,28.1200008392334,35.7599983215332,38.369998931884766,39.65999984741211,47.560001373291016,106.81999969482422,97.79000091552734,80.33999633789062,103.11000061035156,99.44000244140625\n2010-06-07,36.619998931884766,18.329999923706055,106.05999755859375,36.720001220703125,46.290000915527344,93.95999908447266,19.420000076293945,27.479999542236328,28.59000015258789,51.099998474121094,11.26726245880127,106.04000091552734,21.110000610351562,28.290000915527344,35.150001525878906,38.0,39.22999954223633,46.77000045776367,105.48999786376953,98.54000091552734,80.58999633789062,103.33000183105469,98.2699966430664\n2010-06-08,37.459999084472656,18.479999542236328,105.79000091552734,37.08000183105469,47.029998779296875,93.66999816894531,19.709999084472656,27.65999984741211,29.239999771118164,51.95000076293945,11.502842903137207,106.04000091552734,21.149999618530273,28.65999984741211,36.22999954223633,38.81999969482422,39.83000183105469,47.650001525878906,106.62000274658203,98.05000305175781,80.55999755859375,103.37000274658203,99.44000244140625\n2010-06-09,37.2599983215332,18.6200008392334,105.9000015258789,37.119998931884766,46.86000061035156,93.68000030517578,19.59000015258789,27.540000915527344,29.280000686645508,51.40999984741211,11.380990982055664,106.08000183105469,21.040000915527344,28.5,36.2599983215332,39.099998474121094,39.599998474121094,47.630001068115234,106.05000305175781,97.94000244140625,80.55999755859375,103.45999908447266,99.1500015258789\n2010-06-10,38.560001373291016,19.3700008392334,105.12000274658203,37.7599983215332,48.84000015258789,92.80999755859375,20.639999389648438,28.6200008392334,30.329999923706055,53.9900016784668,11.754671096801758,105.63999938964844,21.549999237060547,29.200000762939453,37.939998626708984,40.040000915527344,41.650001525878906,48.970001220703125,109.1500015258789,96.19000244140625,80.2300033569336,103.30999755859375,101.87999725341797\n2010-06-11,38.7599983215332,19.34000015258789,105.7300033569336,37.68000030517578,48.90999984741211,93.4000015258789,20.84000015258789,28.559999465942383,30.670000076293945,54.31999969482422,11.787164688110352,106.02999877929688,21.739999771118164,29.219999313354492,38.13999938964844,40.27000045776367,41.619998931884766,49.02000045776367,109.68000030517578,97.41000366210938,80.36000061035156,103.51000213623047,102.30999755859375\n2010-06-14,38.77000045776367,19.5,105.7300033569336,37.91999816894531,49.220001220703125,93.31999969482422,21.1299991607666,28.799999237060547,30.3700008392334,54.040000915527344,11.738424301147461,105.83000183105469,21.700000762939453,29.389999389648438,38.2400016784668,40.11000061035156,42.040000915527344,49.290000915527344,109.51000213623047,96.91000366210938,80.37999725341797,103.47000122070312,102.13999938964844\n2010-06-15,39.939998626708984,20.139999389648438,105.58999633789062,38.599998474121094,50.779998779296875,93.02999877929688,22.010000228881836,29.540000915527344,31.1200008392334,55.619998931884766,12.014622688293457,105.69999694824219,22.270000457763672,29.959999084472656,39.220001220703125,41.029998779296875,43.599998474121094,50.349998474121094,112.0,96.51000213623047,80.23999786376953,103.47000122070312,104.16999816894531\n2010-06-16,39.939998626708984,20.049999237060547,105.91999816894531,38.7599983215332,50.540000915527344,93.29000091552734,21.889999389648438,29.5,31.079999923706055,55.58000183105469,12.022746086120605,105.80999755859375,22.329999923706055,30.149999618530273,39.06999969482422,41.099998474121094,43.25,50.349998474121094,111.95999908447266,97.05999755859375,80.43000030517578,103.51000213623047,104.29000091552734\n2010-06-17,39.7400016784668,20.229999542236328,106.43000030517578,38.68000030517578,50.70000076293945,93.7300033569336,22.010000228881836,29.520000457763672,30.90999984741211,55.52000045776367,12.006498336791992,106.51000213623047,22.40999984741211,30.3700008392334,38.959999084472656,40.619998931884766,43.56999969482422,50.33000183105469,112.13999938964844,97.8499984741211,80.6500015258789,103.69000244140625,104.55999755859375\n2010-06-18,39.91999816894531,20.219999313354492,106.25,38.7599983215332,50.61000061035156,93.54000091552734,21.959999084472656,29.5,30.950000762939453,55.61000061035156,12.04711627960205,106.5,22.329999923706055,30.079999923706055,39.060001373291016,40.65999984741211,43.41999816894531,50.349998474121094,111.7300033569336,97.69000244140625,80.62000274658203,103.5999984741211,104.48999786376953\n2010-06-21,40.61000061035156,20.239999771118164,106.30999755859375,39.040000915527344,50.599998474121094,93.47000122070312,21.899999618530273,29.31999969482422,31.139999389648438,55.4900016784668,12.030869483947754,106.7699966430664,22.170000076293945,29.8700008392334,39.689998626708984,41.599998474121094,43.22999954223633,50.66999816894531,111.41000366210938,97.41000366210938,80.63999938964844,103.76000213623047,104.44999694824219\n2010-06-22,39.83000183105469,20.06999969482422,106.55999755859375,38.560001373291016,49.959999084472656,94.02999877929688,21.610000610351562,29.020000457763672,30.3700008392334,53.869998931884766,11.844029426574707,107.29000091552734,21.979999542236328,29.1299991607666,39.060001373291016,40.95000076293945,42.720001220703125,49.970001220703125,109.56999969482422,98.56999969482422,80.83000183105469,103.80999755859375,102.93000030517578\n2010-06-23,39.66999816894531,19.81999969482422,106.58000183105469,38.119998931884766,49.43000030517578,94.37999725341797,21.18000030517578,28.8799991607666,30.43000030517578,53.459999084472656,11.787164688110352,107.73999786376953,21.940000534057617,28.8700008392334,38.41999816894531,41.2599983215332,43.16999816894531,49.93000030517578,109.2300033569336,99.23999786376953,81.02999877929688,103.88999938964844,102.98999786376953\n2010-06-24,38.970001220703125,19.600000381469727,106.27999877929688,38.0,48.56999969482422,94.30000305175781,20.639999389648438,28.3799991607666,29.65999984741211,52.34000015258789,11.57595443725586,107.30999755859375,21.5,28.709999084472656,37.720001220703125,40.77000045776367,42.2599983215332,49.380001068115234,107.41999816894531,98.6500015258789,80.91999816894531,103.91000366210938,101.55999755859375\n2010-06-25,39.43000030517578,19.56999969482422,106.6500015258789,38.15999984741211,48.849998474121094,94.44999694824219,20.649999618530273,28.299999237060547,30.100000381469727,52.4900016784668,11.892769813537598,107.48999786376953,21.479999542236328,28.84000015258789,38.040000915527344,41.18000030517578,42.439998626708984,49.849998474121094,107.87000274658203,99.05000305175781,81.0199966430664,103.94999694824219,101.72000122070312\n2010-06-28,39.15999984741211,19.5,106.9000015258789,37.720001220703125,48.4900016784668,95.12000274658203,20.549999237060547,28.780000686645508,29.760000228881836,51.779998779296875,11.779041290283203,108.08000183105469,21.520000457763672,29.030000686645508,37.689998626708984,40.959999084472656,42.18000030517578,49.18000030517578,107.52999877929688,99.9800033569336,81.16999816894531,104.06999969482422,101.44000244140625\n2010-06-29,37.56999969482422,18.809999465942383,106.98999786376953,36.79999923706055,46.83000183105469,95.52999877929688,19.690000534057617,27.399999618530273,28.65999984741211,50.06999969482422,11.356620788574219,108.02999877929688,20.719999313354492,28.440000534057617,36.04999923706055,39.310001373291016,40.63999938964844,47.66999816894531,104.20999908447266,101.06999969482422,81.36000061035156,103.9000015258789,98.7300033569336\n2010-06-30,37.31999969482422,18.709999084472656,106.91000366210938,36.79999923706055,46.5099983215332,95.66999816894531,19.559999465942383,26.8799991607666,28.3700008392334,49.68000030517578,11.218521118164062,108.45999908447266,20.399999618530273,28.260000228881836,35.7400016784668,39.130001068115234,40.189998626708984,47.560001373291016,103.22000122070312,101.75,81.37999725341797,103.9000015258789,97.7300033569336\n2010-07-01,37.59000015258789,19.030000686645508,106.0199966430664,36.91999816894531,47.189998626708984,95.37999725341797,19.920000076293945,27.200000762939453,28.209999084472656,49.5,11.112915992736816,108.13999938964844,20.31999969482422,28.1299991607666,35.81999969482422,39.380001068115234,40.9900016784668,47.77000045776367,102.76000213623047,101.5999984741211,81.19000244140625,104.0,97.33999633789062\n2010-07-02,37.75,18.8799991607666,105.81999969482422,37.08000183105469,47.09000015258789,95.20999908447266,19.850000381469727,27.31999969482422,28.049999237060547,49.380001068115234,10.982940673828125,107.83000183105469,20.290000915527344,28.15999984741211,35.869998931884766,39.02000045776367,40.900001525878906,47.88999938964844,102.19999694824219,100.79000091552734,81.13999938964844,104.06999969482422,96.87000274658203\n2010-07-06,38.45000076293945,19.280000686645508,105.94000244140625,37.84000015258789,48.029998779296875,95.44000244140625,20.229999542236328,27.700000762939453,28.079999923706055,49.86000061035156,11.047928810119629,108.27999877929688,20.489999771118164,28.489999771118164,36.470001220703125,39.7599983215332,41.66999816894531,48.83000183105469,102.87000274658203,101.62000274658203,81.33999633789062,104.12999725341797,97.44999694824219\n2010-07-07,39.29999923706055,19.739999771118164,105.5,38.560001373291016,49.529998779296875,95.13999938964844,21.020000457763672,28.68000030517578,29.200000762939453,51.619998931884766,11.535337448120117,108.3499984741211,21.149999618530273,29.3700008392334,37.36000061035156,40.040000915527344,43.15999984741211,49.91999816894531,106.11000061035156,100.43000030517578,81.23999786376953,104.2300033569336,100.29000091552734\n2010-07-08,39.4900016784668,19.850000381469727,105.66000366210938,38.63999938964844,50.0099983215332,94.91000366210938,21.34000015258789,28.899999618530273,29.68000030517578,52.349998474121094,11.624695777893066,108.08000183105469,21.280000686645508,29.600000381469727,37.970001220703125,39.95000076293945,43.59000015258789,50.150001525878906,107.16000366210938,99.79000091552734,81.18000030517578,104.16999816894531,101.51000213623047\n2010-07-09,39.970001220703125,19.8700008392334,105.73999786376953,38.400001525878906,50.060001373291016,94.66000366210938,21.309999465942383,28.920000076293945,30.389999389648438,52.619998931884766,11.787164688110352,107.94999694824219,21.389999389648438,29.799999237060547,38.31999969482422,40.68000030517578,43.75,50.099998474121094,107.95999908447266,99.22000122070312,81.08999633789062,104.29000091552734,102.11000061035156\n2010-07-12,39.650001525878906,19.799999237060547,105.66999816894531,38.20000076293945,49.869998931884766,94.81999969482422,21.239999771118164,28.979999542236328,29.989999771118164,52.47999954223633,11.803411483764648,108.08000183105469,21.489999771118164,29.899999618530273,38.13999938964844,40.470001220703125,43.45000076293945,49.939998626708984,108.02999877929688,99.18000030517578,81.12000274658203,104.30999755859375,102.25\n2010-07-13,40.11000061035156,20.34000015258789,105.55000305175781,38.400001525878906,50.790000915527344,94.3499984741211,21.790000915527344,29.700000762939453,30.799999237060547,53.11000061035156,12.095856666564941,108.13999938964844,21.799999237060547,30.0,38.619998931884766,40.86000061035156,44.65999984741211,50.209999084472656,109.66000366210938,98.33000183105469,80.9800033569336,104.3499984741211,103.7300033569336\n2010-07-14,40.029998779296875,20.389999389648438,105.8499984741211,38.68000030517578,50.970001220703125,94.81999969482422,21.760000228881836,29.739999771118164,30.700000762939453,53.04999923706055,12.006498336791992,108.62000274658203,21.93000030517578,30.010000228881836,38.709999084472656,40.47999954223633,44.75,50.61000061035156,109.6500015258789,99.31999969482422,81.19000244140625,104.33999633789062,103.75\n2010-07-15,39.84000015258789,20.6200008392334,105.9800033569336,38.36000061035156,51.220001220703125,95.30999755859375,21.989999771118164,30.020000457763672,30.670000076293945,52.9900016784668,11.982128143310547,108.80999755859375,22.0,30.209999084472656,38.599998474121094,39.86000061035156,45.279998779296875,50.25,109.68000030517578,100.30999755859375,81.2699966430664,104.4000015258789,103.69999694824219\n2010-07-16,38.650001525878906,20.1200008392334,105.7300033569336,37.400001525878906,49.58000183105469,95.86000061035156,21.25,29.18000030517578,29.829999923706055,51.72999954223633,11.478472709655762,109.0,21.3700008392334,29.690000534057617,37.540000915527344,38.7400016784668,43.75,48.869998931884766,106.66000366210938,100.80000305175781,81.54000091552734,104.6500015258789,101.01000213623047\n2010-07-19,39.15999984741211,20.209999084472656,105.31999969482422,37.52000045776367,49.900001525878906,95.61000061035156,21.450000762939453,29.260000228881836,29.860000610351562,52.060001373291016,11.470349311828613,108.9800033569336,21.579999923706055,30.149999618530273,37.72999954223633,39.06999969482422,44.15999984741211,49.11000061035156,107.29000091552734,100.18000030517578,81.44999694824219,104.66999816894531,101.62000274658203\n2010-07-20,40.08000183105469,20.040000915527344,105.44000244140625,37.7599983215332,50.2400016784668,95.70999908447266,21.3799991607666,29.5,30.760000228881836,53.25,11.592201232910156,109.0999984741211,21.719999313354492,30.420000076293945,38.810001373291016,40.13999938964844,44.18000030517578,49.91999816894531,108.4800033569336,100.33000183105469,81.44000244140625,104.5999984741211,102.33000183105469\n2010-07-21,39.66999816894531,19.670000076293945,105.98999786376953,37.08000183105469,49.33000183105469,96.31999969482422,20.920000076293945,29.239999771118164,30.65999984741211,52.380001068115234,11.40536117553711,109.62999725341797,21.459999084472656,29.950000762939453,37.97999954223633,40.02000045776367,43.31999969482422,48.91999816894531,107.06999969482422,102.02999877929688,81.7300033569336,104.58999633789062,101.2300033569336\n2010-07-22,40.869998931884766,20.450000762939453,105.88999938964844,37.7599983215332,50.9900016784668,95.79000091552734,21.920000076293945,30.15999984741211,31.31999969482422,53.540000915527344,11.738424301147461,109.48999786376953,22.040000915527344,30.43000030517578,38.97999954223633,41.119998931884766,45.16999816894531,49.9900016784668,109.45999908447266,100.8499984741211,81.63999938964844,104.55999755859375,103.25\n2010-07-23,41.150001525878906,20.649999618530273,105.62000274658203,38.31999969482422,51.59000015258789,95.4800033569336,22.149999618530273,30.559999465942383,32.0099983215332,53.779998779296875,11.82778263092041,109.62999725341797,22.190000534057617,30.479999542236328,39.63999938964844,41.459999084472656,45.650001525878906,50.630001068115234,110.41000366210938,99.77999877929688,81.5,104.68000030517578,104.2699966430664\n2010-07-26,41.43000030517578,20.84000015258789,105.66000366210938,38.36000061035156,51.95000076293945,95.44999694824219,22.350000381469727,30.700000762939453,32.20000076293945,54.25,11.990251541137695,109.7300033569336,22.329999923706055,30.700000762939453,40.15999984741211,41.369998931884766,45.970001220703125,50.93000030517578,111.55999755859375,99.61000061035156,81.54000091552734,104.76000213623047,105.26000213623047\n2010-07-27,41.36000061035156,20.90999984741211,105.51000213623047,38.15999984741211,52.099998474121094,95.12000274658203,22.479999542236328,31.059999465942383,31.940000534057617,53.9900016784668,12.022746086120605,109.36000061035156,22.389999389648438,31.149999618530273,40.0,41.16999816894531,46.209999084472656,50.84000015258789,111.55000305175781,98.6500015258789,81.5,104.63999938964844,105.44000244140625\n2010-07-28,41.130001068115234,20.690000534057617,105.86000061035156,38.599998474121094,51.83000183105469,95.52999877929688,22.389999389648438,30.760000228881836,31.84000015258789,53.869998931884766,11.91714096069336,109.75,22.209999084472656,31.0,39.650001525878906,41.18000030517578,45.810001373291016,50.95000076293945,110.83000183105469,98.97000122070312,81.63999938964844,104.62000274658203,105.08999633789062\n2010-07-29,41.20000076293945,20.700000762939453,105.98999786376953,38.84000015258789,52.06999969482422,95.7300033569336,22.459999084472656,30.760000228881836,31.809999465942383,53.95000076293945,11.957757949829102,109.79000091552734,22.010000228881836,30.520000457763672,39.95000076293945,41.09000015258789,45.93000030517578,51.31999969482422,110.29000091552734,98.94000244140625,81.7300033569336,104.81999969482422,104.66999816894531\n2010-07-30,41.400001525878906,20.739999771118164,106.37000274658203,38.52000045776367,51.90999984741211,96.29000091552734,22.399999618530273,30.780000686645508,32.0099983215332,53.84000015258789,11.949634552001953,110.30000305175781,21.920000076293945,30.3700008392334,40.02000045776367,41.2400016784668,45.88999938964844,51.150001525878906,110.2699966430664,100.4800033569336,81.8499984741211,104.98999786376953,104.69999694824219\n2010-08-02,42.470001220703125,21.43000030517578,106.37000274658203,39.36000061035156,53.65999984741211,95.73999786376953,23.31999969482422,31.860000610351562,32.869998931884766,55.720001220703125,12.250203132629395,109.62999725341797,22.3799991607666,31.0,41.22999954223633,42.38999938964844,47.66999816894531,52.36000061035156,112.76000213623047,98.75,81.5999984741211,104.6500015258789,106.7300033569336\n2010-08-03,42.27000045776367,21.5,106.93000030517578,39.20000076293945,53.58000183105469,96.19000244140625,23.31999969482422,32.0,32.27000045776367,55.70000076293945,12.112104415893555,109.9000015258789,22.260000228881836,30.850000381469727,40.939998626708984,41.97999954223633,47.68000030517578,52.119998931884766,112.22000122070312,99.31999969482422,81.81999969482422,104.66000366210938,106.38999938964844\n2010-08-04,42.33000183105469,21.600000381469727,106.56999969482422,39.119998931884766,53.630001068115234,95.79000091552734,23.40999984741211,32.02000045776367,32.56999969482422,56.130001068115234,12.160844802856445,109.55999755859375,22.440000534057617,30.979999542236328,41.11000061035156,42.13999938964844,47.63999938964844,52.060001373291016,112.97000122070312,98.55999755859375,81.66000366210938,104.38999938964844,106.95999908447266\n2010-08-05,42.13999938964844,21.670000076293945,106.95999908447266,39.08000183105469,53.59000015258789,96.25,23.440000534057617,31.84000015258789,32.63999938964844,56.310001373291016,12.112104415893555,109.76000213623047,22.34000015258789,30.93000030517578,40.939998626708984,42.029998779296875,47.630001068115234,52.0099983215332,112.8499984741211,99.0199966430664,81.79000091552734,104.56999969482422,106.87999725341797\n2010-08-06,42.08000183105469,21.709999084472656,107.05999755859375,39.439998626708984,53.75,96.87999725341797,23.510000228881836,32.02000045776367,32.4900016784668,55.63999938964844,12.006498336791992,110.38999938964844,22.280000686645508,30.989999771118164,40.970001220703125,41.95000076293945,47.7599983215332,52.369998931884766,112.38999938964844,100.0999984741211,82.02999877929688,104.69999694824219,106.69000244140625\n2010-08-09,42.29999923706055,21.75,107.01000213623047,39.47999954223633,53.810001373291016,96.86000061035156,23.56999969482422,32.13999938964844,32.689998626708984,55.869998931884766,12.071486473083496,110.75,22.43000030517578,31.100000381469727,41.310001373291016,42.220001220703125,47.83000183105469,52.56999969482422,112.98999786376953,99.7300033569336,81.93000030517578,104.70999908447266,107.12000274658203\n2010-08-10,41.720001220703125,21.5,107.66999816894531,39.2400016784668,53.380001068115234,97.3499984741211,23.270000457763672,31.940000534057617,32.34000015258789,55.40999984741211,11.96588134765625,110.61000061035156,22.200000762939453,31.280000686645508,40.77000045776367,41.29999923706055,47.40999984741211,52.0099983215332,112.37999725341797,99.94000244140625,82.0999984741211,104.54000091552734,106.66000366210938\n2010-08-11,40.38999938964844,20.459999084472656,107.66000366210938,37.91999816894531,50.95000076293945,97.9000015258789,22.0,30.559999465942383,31.25,53.7599983215332,11.543460845947266,110.5999984741211,21.670000076293945,30.649999618530273,39.130001068115234,40.150001525878906,45.09000015258789,50.060001373291016,109.30000305175781,101.27999877929688,82.16000366210938,104.48999786376953,104.12999725341797\n2010-08-12,40.459999084472656,20.299999237060547,106.94999694824219,37.79999923706055,50.88999938964844,97.6500015258789,21.84000015258789,30.68000030517578,31.450000762939453,53.439998626708984,11.462225914001465,110.20999908447266,21.3700008392334,30.59000015258789,39.040000915527344,40.0099983215332,45.060001373291016,50.060001373291016,108.62999725341797,101.02999877929688,82.01000213623047,104.5999984741211,103.44999694824219\n2010-08-13,40.68000030517578,20.1299991607666,107.2300033569336,37.7599983215332,50.709999084472656,98.06999969482422,21.639999389648438,30.760000228881836,31.299999237060547,53.349998474121094,11.429732322692871,110.63999938964844,21.270000457763672,30.700000762939453,39.310001373291016,40.04999923706055,44.86000061035156,50.060001373291016,108.30999755859375,102.29000091552734,82.23999786376953,104.63999938964844,103.3499984741211\n2010-08-16,41.060001373291016,20.219999313354492,107.58000183105469,38.040000915527344,51.119998931884766,98.77999877929688,21.719999313354492,30.860000610351562,31.440000534057617,53.34000015258789,11.397237777709961,111.86000061035156,21.309999465942383,30.700000762939453,39.58000183105469,40.5,45.2599983215332,50.56999969482422,108.26000213623047,104.8499984741211,82.55000305175781,104.58999633789062,103.27999877929688\n2010-08-17,41.4900016784668,20.559999465942383,107.33999633789062,38.2400016784668,51.689998626708984,98.27999877929688,22.149999618530273,31.1200008392334,32.18000030517578,54.22999954223633,11.48659610748291,111.68000030517578,21.540000915527344,31.0,40.11000061035156,40.84000015258789,45.790000915527344,50.970001220703125,109.58999633789062,104.25,82.43000030517578,104.51000213623047,104.33000183105469\n2010-08-18,41.459999084472656,20.559999465942383,107.27999877929688,38.47999954223633,51.66999816894531,98.18000030517578,22.100000381469727,31.020000457763672,32.29999923706055,53.709999084472656,11.535337448120117,111.77999877929688,21.65999984741211,30.829999923706055,39.880001068115234,40.709999084472656,45.7599983215332,51.0099983215332,109.79000091552734,104.52999877929688,82.37999725341797,104.66000366210938,104.56999969482422\n2010-08-19,41.13999938964844,20.1299991607666,107.29000091552734,38.400001525878906,50.84000015258789,98.62000274658203,21.559999465942383,30.34000015258789,31.559999465942383,52.84000015258789,11.26726245880127,111.9000015258789,21.399999618530273,30.389999389648438,39.36000061035156,40.439998626708984,44.75,50.72999954223633,107.87999725341797,106.16000366210938,82.56999969482422,104.76000213623047,103.05999755859375\n2010-08-20,41.02000045776367,19.719999313354492,107.16000366210938,38.040000915527344,50.310001373291016,98.30000305175781,21.190000534057617,30.15999984741211,31.489999771118164,52.189998626708984,11.234768867492676,112.0999984741211,21.350000381469727,30.469999313354492,39.2599983215332,40.540000915527344,44.189998626708984,50.310001373291016,107.52999877929688,106.04000091552734,82.45999908447266,104.7300033569336,102.13999938964844\n2010-08-23,40.650001525878906,19.6299991607666,107.16000366210938,37.79999923706055,50.209999084472656,98.43000030517578,21.18000030517578,30.280000686645508,31.139999389648438,52.209999084472656,11.161657333374023,112.33999633789062,21.15999984741211,30.670000076293945,39.11000061035156,39.97999954223633,44.18000030517578,50.08000183105469,107.12000274658203,106.05999755859375,82.51000213623047,104.81999969482422,101.76000213623047\n2010-08-24,40.130001068115234,19.360000610351562,107.5199966430664,37.7599983215332,49.52000045776367,99.20999908447266,20.84000015258789,29.739999771118164,30.420000076293945,51.400001525878906,10.974817276000977,112.5999984741211,20.8700008392334,30.719999313354492,38.40999984741211,39.58000183105469,43.43000030517578,49.630001068115234,105.52999877929688,107.76000213623047,82.80000305175781,105.01000213623047,100.4000015258789\n2010-08-25,39.869998931884766,19.329999923706055,107.5199966430664,37.63999938964844,49.56999969482422,98.76000213623047,20.790000915527344,29.700000762939453,30.510000228881836,51.2400016784668,11.00731086730957,112.80999755859375,21.0,30.700000762939453,38.459999084472656,39.54999923706055,43.41999816894531,49.630001068115234,105.94000244140625,107.41000366210938,82.69000244140625,105.0,100.61000061035156\n2010-08-26,39.619998931884766,19.280000686645508,108.0999984741211,37.599998474121094,49.54999923706055,99.20999908447266,20.760000228881836,29.799999237060547,30.469999313354492,50.779998779296875,10.917952537536621,112.91000366210938,20.790000915527344,30.559999465942383,38.56999969482422,39.220001220703125,43.40999984741211,49.599998474121094,105.2300033569336,108.41999816894531,82.76000213623047,104.9800033569336,99.93000030517578\n2010-08-27,40.4900016784668,19.6200008392334,107.45999908447266,38.08000183105469,50.52000045776367,98.06999969482422,21.209999084472656,30.34000015258789,31.3799991607666,52.099998474121094,11.153533935546875,111.88999938964844,21.040000915527344,31.139999389648438,39.52000045776367,39.970001220703125,44.400001525878906,50.459999084472656,106.86000061035156,105.3499984741211,82.37999725341797,105.02999877929688,101.58000183105469\n2010-08-30,39.81999969482422,19.209999084472656,107.94000244140625,37.959999084472656,49.790000915527344,98.81999969482422,20.729999542236328,29.799999237060547,30.90999984741211,51.34000015258789,10.917952537536621,112.62000274658203,20.760000228881836,30.670000076293945,39.29999923706055,39.36000061035156,43.4900016784668,50.2400016784668,105.30999755859375,107.37000274658203,82.75,105.08999633789062,100.16999816894531\n2010-08-31,40.060001373291016,19.309999465942383,108.23999786376953,37.52000045776367,49.939998626708984,99.26000213623047,20.850000381469727,29.920000076293945,31.040000915527344,51.20000076293945,11.015434265136719,113.0,20.690000534057617,30.809999465942383,39.349998474121094,39.290000915527344,43.790000915527344,49.90999984741211,105.30999755859375,108.55999755859375,82.88999938964844,105.22000122070312,100.19999694824219\n2010-09-01,41.470001220703125,20.079999923706055,107.75,38.560001373291016,51.720001220703125,98.30000305175781,21.81999969482422,30.920000076293945,31.969999313354492,53.11000061035156,11.43785572052002,111.7300033569336,21.219999313354492,31.479999542236328,41.11000061035156,40.29999923706055,45.52000045776367,51.560001373291016,108.45999908447266,106.0,82.4000015258789,104.98999786376953,102.80000305175781\n2010-09-02,41.540000915527344,20.229999542236328,107.55000305175781,38.439998626708984,52.0099983215332,97.88999938964844,22.149999618530273,31.059999465942383,32.349998474121094,53.54999923706055,11.551584243774414,111.58999633789062,21.40999984741211,31.479999542236328,41.290000915527344,40.709999084472656,45.900001525878906,51.54999923706055,109.47000122070312,104.87999725341797,82.23999786376953,105.0199966430664,103.27999877929688\n2010-09-03,42.029998779296875,20.479999542236328,107.37999725341797,38.720001220703125,52.4900016784668,97.33000183105469,22.450000762939453,31.5,32.72999954223633,54.20000076293945,11.7952880859375,110.75,21.729999542236328,31.6200008392334,41.52000045776367,40.95000076293945,46.380001068115234,51.97999954223633,110.88999938964844,103.58000183105469,82.08999633789062,104.87999725341797,104.58000183105469\n2010-09-07,41.41999816894531,20.059999465942383,107.9800033569336,38.720001220703125,51.7599983215332,98.0999984741211,21.790000915527344,30.979999542236328,32.40999984741211,53.38999938964844,11.527214050292969,111.56999969482422,21.549999237060547,31.459999084472656,41.290000915527344,40.540000915527344,45.38999938964844,51.7599983215332,109.63999938964844,105.69999694824219,82.44000244140625,104.94999694824219,103.55999755859375\n2010-09-08,41.869998931884766,20.170000076293945,107.66000366210938,38.79999923706055,52.15999984741211,97.83000183105469,22.059999465942383,31.34000015258789,32.65999984741211,53.849998474121094,11.640942573547363,111.3499984741211,21.670000076293945,31.309999465942383,41.61000061035156,40.720001220703125,45.900001525878906,51.93000030517578,110.41000366210938,104.86000061035156,82.20999908447266,104.86000061035156,103.9800033569336\n2010-09-09,42.11000061035156,20.329999923706055,107.41999816894531,38.91999816894531,52.650001525878906,97.05999755859375,22.270000457763672,31.6200008392334,32.54999923706055,53.959999084472656,11.787164688110352,110.7699966430664,21.729999542236328,31.6200008392334,42.119998931884766,40.90999984741211,46.33000183105469,52.38999938964844,110.91999816894531,102.79000091552734,81.9000015258789,104.73999786376953,104.25\n2010-09-10,42.2599983215332,20.43000030517578,107.52999877929688,39.20000076293945,52.810001373291016,96.77999877929688,22.399999618530273,31.700000762939453,32.81999969482422,54.52000045776367,11.803411483764648,110.8499984741211,21.739999771118164,31.440000534057617,42.15999984741211,40.790000915527344,46.45000076293945,52.59000015258789,111.4800033569336,102.31999969482422,81.80000305175781,104.75,104.77999877929688\n2010-09-13,43.27000045776367,20.84000015258789,108.26000213623047,39.599998474121094,53.77000045776367,97.23999786376953,22.959999084472656,32.13999938964844,33.349998474121094,54.959999084472656,12.0552396774292,111.0,22.1299991607666,31.549999237060547,43.040000915527344,41.93000030517578,47.36000061035156,53.22999954223633,112.72000122070312,102.81999969482422,82.01000213623047,104.69000244140625,105.66999816894531\n2010-09-14,43.25,21.079999923706055,108.1500015258789,39.720001220703125,54.130001068115234,97.7300033569336,23.18000030517578,32.34000015258789,33.290000915527344,54.77000045776367,11.949634552001953,111.5199966430664,22.219999313354492,31.510000228881836,43.22999954223633,42.099998474121094,47.810001373291016,53.41999816894531,112.6500015258789,103.80999755859375,82.12999725341797,104.80999755859375,105.44000244140625\n2010-09-15,43.310001373291016,21.1299991607666,107.91999816894531,39.63999938964844,54.150001525878906,97.38999938964844,23.209999084472656,32.5,33.22999954223633,54.65999984741211,11.990251541137695,111.33999633789062,22.360000610351562,31.329999923706055,43.31999969482422,41.83000183105469,47.790000915527344,53.5099983215332,113.08000183105469,102.2699966430664,82.05000305175781,104.76000213623047,105.94000244140625\n2010-09-16,43.09000015258789,21.209999084472656,107.69999694824219,39.119998931884766,53.88999938964844,97.05000305175781,23.229999542236328,32.540000915527344,33.38999938964844,54.40999984741211,11.957757949829102,110.98999786376953,22.489999771118164,31.219999313354492,43.02000045776367,41.59000015258789,47.689998626708984,52.880001068115234,113.05000305175781,101.26000213623047,81.91999816894531,104.7699966430664,106.19000244140625\n2010-09-17,43.02000045776367,21.010000228881836,107.38999938964844,39.0,53.630001068115234,97.2699966430664,23.0,32.279998779296875,32.72999954223633,53.88999938964844,11.868399620056152,111.3499984741211,22.530000686645508,30.850000381469727,42.9900016784668,41.959999084472656,47.290000915527344,52.810001373291016,112.48999786376953,101.66999816894531,82.0,104.81999969482422,106.06999969482422\n2010-09-20,43.70000076293945,21.350000381469727,107.80999755859375,39.68000030517578,54.560001373291016,97.56999969482422,23.520000457763672,32.79999923706055,32.939998626708984,54.79999923706055,12.095856666564941,111.48999786376953,22.860000610351562,31.260000228881836,43.84000015258789,42.47999954223633,48.220001220703125,53.689998626708984,114.20999908447266,102.26000213623047,82.05999755859375,104.83000183105469,107.5199966430664\n2010-09-21,43.56999969482422,21.549999237060547,109.19000244140625,39.2400016784668,54.54999923706055,98.4800033569336,23.700000762939453,32.63999938964844,32.790000915527344,54.84000015258789,11.982128143310547,112.33999633789062,22.81999969482422,31.100000381469727,43.72999954223633,42.45000076293945,48.29999923706055,53.290000915527344,113.9800033569336,103.68000030517578,82.36000061035156,104.86000061035156,107.62000274658203\n2010-09-22,43.599998474121094,21.610000610351562,109.33999633789062,39.119998931884766,54.470001220703125,98.62999725341797,23.729999542236328,32.68000030517578,32.869998931884766,54.439998626708984,11.787164688110352,112.2699966430664,22.709999084472656,31.31999969482422,43.790000915527344,42.209999084472656,48.38999938964844,53.25,113.41999816894531,104.61000061035156,82.43000030517578,104.9000015258789,107.4000015258789\n2010-09-23,43.31999969482422,21.260000228881836,109.26000213623047,38.959999084472656,53.880001068115234,98.7699966430664,23.219999313354492,32.34000015258789,32.560001373291016,54.099998474121094,11.559707641601562,112.3499984741211,22.68000030517578,30.959999084472656,43.470001220703125,41.88999938964844,47.65999984741211,52.880001068115234,112.5,104.91000366210938,82.44999694824219,105.04000091552734,106.66999816894531\n2010-09-24,44.119998931884766,22.030000686645508,108.70999908447266,39.47999954223633,55.380001068115234,98.27999877929688,24.18000030517578,33.220001220703125,33.36000061035156,55.27000045776367,11.868399620056152,112.0999984741211,23.1200008392334,31.459999084472656,44.47999954223633,42.849998474121094,49.279998779296875,53.88999938964844,114.81999969482422,103.5,82.26000213623047,104.9000015258789,108.56999969482422\n2010-09-27,44.040000915527344,21.90999984741211,109.02999877929688,39.68000030517578,55.099998474121094,99.04000091552734,23.959999084472656,33.099998474121094,33.16999816894531,55.060001373291016,11.738424301147461,112.68000030517578,23.1299991607666,31.520000457763672,44.56999969482422,42.630001068115234,48.7599983215332,54.060001373291016,114.2699966430664,105.30000305175781,82.61000061035156,105.02999877929688,108.19000244140625\n2010-09-28,44.36000061035156,22.09000015258789,109.79000091552734,39.84000015258789,55.41999816894531,99.37000274658203,24.260000228881836,33.13999938964844,33.16999816894531,55.45000076293945,11.762794494628906,112.87999725341797,23.15999984741211,31.540000915527344,44.939998626708984,42.4900016784668,49.25,54.380001068115234,114.66999816894531,106.0199966430664,82.79000091552734,104.94000244140625,108.55999755859375\n2010-09-29,44.5099983215332,22.049999237060547,109.30000305175781,40.040000915527344,55.33000183105469,99.12999725341797,24.139999389648438,32.97999954223633,32.90999984741211,56.040000915527344,11.673436164855957,112.7699966430664,23.110000610351562,31.479999542236328,44.68000030517578,42.720001220703125,48.97999954223633,54.4900016784668,114.47000122070312,105.58000183105469,82.69999694824219,105.0,108.30999755859375\n2010-09-30,44.77000045776367,22.0,109.05999755859375,39.560001373291016,54.91999816894531,99.01000213623047,23.989999771118164,32.720001220703125,32.779998779296875,56.060001373291016,11.65718936920166,113.08999633789062,23.020000457763672,31.3799991607666,44.29999923706055,42.81999969482422,48.720001220703125,53.849998474121094,114.12999725341797,105.51000213623047,82.66000366210938,105.04000091552734,107.91000366210938\n2010-10-01,45.43000030517578,22.209999084472656,109.22000122070312,39.63999938964844,55.470001220703125,98.83000183105469,24.149999618530273,33.2599983215332,33.209999084472656,56.810001373291016,11.779041290283203,112.11000061035156,23.030000686645508,31.549999237060547,44.72999954223633,43.099998474121094,49.33000183105469,54.099998474121094,114.61000061035156,104.61000061035156,82.37000274658203,104.91999816894531,108.31999969482422\n2010-10-04,45.290000915527344,21.760000228881836,109.38999938964844,38.880001068115234,54.66999816894531,99.18000030517578,23.690000534057617,33.040000915527344,32.68000030517578,56.099998474121094,11.697806358337402,112.29000091552734,22.84000015258789,31.489999771118164,44.630001068115234,43.349998474121094,48.529998779296875,53.540000915527344,113.75,104.87999725341797,82.58000183105469,104.97000122070312,107.56999969482422\n2010-10-05,46.11000061035156,22.350000381469727,110.08999633789062,40.119998931884766,56.220001220703125,99.19999694824219,24.59000015258789,33.68000030517578,33.599998474121094,57.41999816894531,11.96588134765625,112.5199966430664,23.290000915527344,31.84000015258789,45.369998931884766,44.27000045776367,50.11000061035156,54.86000061035156,116.04000091552734,104.25,82.5999984741211,105.02999877929688,109.4000015258789\n2010-10-06,46.09000015258789,22.600000381469727,111.05999755859375,40.560001373291016,56.689998626708984,99.83999633789062,24.860000610351562,33.86000061035156,33.91999816894531,57.93000030517578,11.957757949829102,113.25,23.18000030517578,31.690000534057617,45.65999984741211,44.2400016784668,50.369998931884766,55.310001373291016,116.02999877929688,105.55999755859375,82.79000091552734,105.12000274658203,109.7699966430664\n2010-10-07,45.68000030517578,22.559999465942383,110.80999755859375,40.720001220703125,56.5,99.94000244140625,24.8700008392334,33.720001220703125,33.58000183105469,57.63999938964844,11.909016609191895,113.22000122070312,23.18000030517578,31.75,45.38999938964844,43.86000061035156,50.22999954223633,55.47999954223633,115.88999938964844,104.68000030517578,82.93000030517578,105.12999725341797,109.5999984741211\n2010-10-08,46.22999954223633,22.690000534057617,111.54000091552734,40.91999816894531,56.869998931884766,99.9800033569336,24.940000534057617,33.939998626708984,34.2400016784668,58.36000061035156,11.941511154174805,113.11000061035156,23.309999465942383,31.850000381469727,46.130001068115234,44.400001525878906,50.540000915527344,55.880001068115234,116.54000091552734,104.22000122070312,82.83000183105469,105.08000183105469,110.16000366210938\n2010-10-11,46.20000076293945,22.649999618530273,111.54000091552734,40.84000015258789,56.79999923706055,100.08000183105469,24.809999465942383,33.86000061035156,34.18000030517578,58.52000045776367,11.925264358520508,113.20999908447266,23.350000381469727,31.860000610351562,46.02000045776367,44.81999969482422,50.310001373291016,55.84000015258789,116.6500015258789,104.23999786376953,82.80000305175781,105.19000244140625,110.26000213623047\n2010-10-12,46.0099983215332,22.760000228881836,111.19999694824219,40.47999954223633,56.68000030517578,99.79000091552734,24.8700008392334,33.7400016784668,34.27000045776367,58.43000030517578,12.063363075256348,113.04000091552734,23.489999771118164,31.729999542236328,45.849998474121094,44.68000030517578,50.47999954223633,55.400001525878906,117.01000213623047,103.20999908447266,82.72000122070312,105.12999725341797,110.26000213623047\n2010-10-13,46.86000061035156,23.209999084472656,111.87000274658203,40.599998474121094,57.31999969482422,99.79000091552734,25.25,34.18000030517578,34.81999969482422,59.13999938964844,12.071486473083496,112.9800033569336,23.68000030517578,31.850000381469727,46.20000076293945,45.7400016784668,51.22999954223633,55.599998474121094,117.91999816894531,103.05000305175781,82.8499984741211,105.11000061035156,111.05999755859375\n2010-10-14,46.779998779296875,23.540000915527344,112.22000122070312,40.880001068115234,57.720001220703125,99.22000122070312,25.520000457763672,34.34000015258789,34.4900016784668,59.04999923706055,11.860276222229004,112.06999969482422,23.690000534057617,31.799999237060547,46.439998626708984,45.880001068115234,51.59000015258789,55.939998626708984,117.45999908447266,101.51000213623047,82.52999877929688,104.94000244140625,111.06999969482422\n2010-10-15,46.720001220703125,23.5,111.5,40.560001373291016,57.529998779296875,98.79000091552734,25.389999389648438,34.29999923706055,34.59000015258789,59.209999084472656,11.65718936920166,111.36000061035156,24.09000015258789,31.899999618530273,46.36000061035156,46.20000076293945,51.349998474121094,55.81999969482422,117.69999694824219,100.2699966430664,82.33999633789062,104.9800033569336,110.68000030517578\n2010-10-18,46.7400016784668,23.75,111.75,40.84000015258789,57.65999984741211,99.26000213623047,25.440000534057617,34.400001525878906,34.7400016784668,59.369998931884766,11.91714096069336,112.12999725341797,24.25,31.899999618530273,46.68000030517578,46.33000183105469,51.36000061035156,56.189998626708984,118.27999877929688,101.08000183105469,82.6500015258789,105.0999984741211,111.01000213623047\n2010-10-19,45.2599983215332,23.010000228881836,111.80999755859375,40.47999954223633,56.38999938964844,99.5999984741211,24.739999771118164,33.560001373291016,33.849998474121094,58.189998626708984,11.754671096801758,112.13999938964844,23.81999969482422,31.959999084472656,45.040000915527344,45.2400016784668,50.130001068115234,55.04999923706055,116.7300033569336,101.69000244140625,82.7699966430664,105.11000061035156,109.83999633789062\n2010-10-20,45.97999954223633,23.59000015258789,111.77999877929688,40.79999923706055,57.45000076293945,99.54000091552734,25.34000015258789,33.959999084472656,34.54999923706055,58.939998626708984,11.868399620056152,112.33999633789062,24.020000457763672,32.220001220703125,45.91999816894531,46.18000030517578,51.279998779296875,55.75,117.87000274658203,101.91000366210938,82.73999786376953,105.1500015258789,111.08999633789062\n2010-10-21,45.97999954223633,23.770000457763672,111.77999877929688,40.279998779296875,57.13999938964844,98.98999786376953,25.469999313354492,33.7599983215332,34.540000915527344,58.90999984741211,11.868399620056152,112.04000091552734,24.040000915527344,32.08000183105469,45.459999084472656,46.13999938964844,51.150001525878906,55.13999938964844,118.12999725341797,100.69999694824219,82.66999816894531,105.04000091552734,111.54000091552734\n2010-10-22,46.029998779296875,23.84000015258789,111.80999755859375,40.599998474121094,57.290000915527344,99.0199966430664,25.549999237060547,33.880001068115234,34.290000915527344,59.29999923706055,11.860276222229004,112.18000030517578,24.110000610351562,31.8700008392334,45.709999084472656,45.66999816894531,51.29999923706055,55.349998474121094,118.3499984741211,101.37999725341797,82.62000274658203,105.08000183105469,111.36000061035156\n2010-10-25,46.529998779296875,24.030000686645508,112.1500015258789,40.63999938964844,57.5099983215332,98.98999786376953,25.6200008392334,33.900001525878906,35.029998779296875,59.459999084472656,11.819659233093262,112.58000183105469,24.18000030517578,31.799999237060547,46.47999954223633,46.220001220703125,51.40999984741211,55.790000915527344,118.69999694824219,101.66999816894531,82.66999816894531,104.9800033569336,111.70999908447266\n2010-10-26,46.4900016784668,23.809999465942383,111.54000091552734,40.2400016784668,57.13999938964844,98.33000183105469,25.3799991607666,33.959999084472656,34.81999969482422,59.58000183105469,11.835906028747559,111.9800033569336,24.239999771118164,31.719999313354492,46.06999969482422,46.16999816894531,51.029998779296875,55.27000045776367,118.72000122070312,100.0999984741211,82.44000244140625,105.0199966430664,111.76000213623047\n2010-10-27,45.70000076293945,23.540000915527344,110.8499984741211,40.119998931884766,56.59000015258789,97.76000213623047,25.06999969482422,33.58000183105469,34.5,59.33000183105469,11.844029426574707,111.69000244140625,24.309999465942383,31.59000015258789,45.25,45.08000183105469,50.54999923706055,54.72999954223633,118.37999725341797,99.22000122070312,82.2699966430664,105.02999877929688,111.30999755859375\n2010-10-28,45.9900016784668,23.81999969482422,111.25,40.2400016784668,57.029998779296875,98.33000183105469,25.3700008392334,33.97999954223633,34.52000045776367,59.20000076293945,11.844029426574707,112.13999938964844,24.309999465942383,31.670000076293945,45.47999954223633,45.11000061035156,51.18000030517578,55.0099983215332,118.4000015258789,99.48999786376953,82.55000305175781,105.16000366210938,111.0999984741211\n2010-10-29,46.119998931884766,23.829999923706055,111.62000274658203,40.08000183105469,57.0099983215332,98.7699966430664,25.31999969482422,34.099998474121094,34.79999923706055,59.2400016784668,11.82778263092041,112.36000061035156,24.350000381469727,31.719999313354492,45.58000183105469,44.970001220703125,51.099998474121094,54.91999816894531,118.48999786376953,100.41999816894531,82.69999694824219,105.23999786376953,111.30999755859375\n2010-11-01,46.630001068115234,23.700000762939453,111.54000091552734,39.68000030517578,56.79999923706055,98.37000274658203,25.149999618530273,34.2400016784668,34.779998779296875,59.310001373291016,11.82778263092041,111.88999938964844,24.3700008392334,31.40999984741211,46.060001373291016,45.43000030517578,50.790000915527344,54.93000030517578,118.52999877929688,99.66999816894531,82.47000122070312,105.0999984741211,111.31999969482422\n2010-11-02,47.209999084472656,24.170000076293945,111.80999755859375,39.959999084472656,57.7400016784668,98.69999694824219,25.719999313354492,34.619998931884766,35.13999938964844,59.959999084472656,11.860276222229004,112.41000366210938,24.610000610351562,31.780000686645508,46.849998474121094,46.0099983215332,51.849998474121094,55.38999938964844,119.47000122070312,100.9800033569336,82.61000061035156,105.04000091552734,111.87999725341797\n2010-11-03,47.5,24.299999237060547,111.61000061035156,40.08000183105469,58.13999938964844,99.0199966430664,25.889999389648438,34.86000061035156,35.040000915527344,60.09000015258789,11.974004745483398,112.04000091552734,24.75,31.719999313354492,47.459999084472656,46.9900016784668,52.09000015258789,55.70000076293945,119.94999694824219,98.91999816894531,82.69999694824219,105.06999969482422,112.30000305175781\n2010-11-04,48.58000183105469,24.780000686645508,111.87999725341797,41.0,59.459999084472656,99.81999969482422,26.5,35.900001525878906,36.189998626708984,62.0,12.372055053710938,113.0999984741211,25.1200008392334,32.060001373291016,48.849998474121094,47.880001068115234,53.41999816894531,57.15999984741211,122.26000213623047,99.69000244140625,82.95999908447266,105.12999725341797,114.43000030517578\n2010-11-05,48.4900016784668,24.56999969482422,111.5,41.36000061035156,59.20000076293945,99.4000015258789,26.15999984741211,35.720001220703125,36.31999969482422,62.310001373291016,12.656376838684082,112.73999786376953,25.100000381469727,32.04999923706055,48.90999984741211,47.83000183105469,52.7599983215332,57.5099983215332,122.72000122070312,97.9800033569336,82.61000061035156,105.11000061035156,114.54000091552734\n2010-11-08,48.290000915527344,24.399999618530273,111.6500015258789,41.36000061035156,58.84000015258789,99.43000030517578,25.940000534057617,35.400001525878906,36.40999984741211,62.5,12.558895111083984,112.80000305175781,25.1200008392334,31.8700008392334,48.630001068115234,47.93000030517578,52.34000015258789,57.41999816894531,122.48999786376953,98.41999816894531,82.62999725341797,105.0,114.22000122070312\n2010-11-09,47.68000030517578,24.1299991607666,110.63999938964844,41.08000183105469,58.25,98.58999633789062,25.639999389648438,35.040000915527344,35.77000045776367,62.380001068115234,12.323314666748047,111.95999908447266,25.049999237060547,31.760000228881836,47.81999969482422,46.90999984741211,51.849998474121094,56.900001525878906,121.61000061035156,96.25,82.20999908447266,104.91000366210938,113.69000244140625\n2010-11-10,48.029998779296875,24.079999923706055,110.91000366210938,41.560001373291016,58.41999816894531,98.95999908447266,25.649999618530273,35.18000030517578,35.95000076293945,63.18000030517578,12.461413383483887,111.72000122070312,25.06999969482422,31.6200008392334,48.060001373291016,47.2400016784668,51.91999816894531,57.369998931884766,122.0999984741211,96.37999725341797,82.18000030517578,105.0199966430664,113.7300033569336\n2010-11-11,47.560001373291016,23.81999969482422,110.91999816894531,41.31999969482422,57.91999816894531,98.8499984741211,25.190000534057617,35.15999984741211,36.31999969482422,63.880001068115234,12.339561462402344,111.2300033569336,24.690000534057617,31.600000381469727,47.61000061035156,47.45000076293945,51.27000045776367,57.02000045776367,121.63999938964844,96.33000183105469,82.20999908447266,104.94000244140625,113.08000183105469\n2010-11-12,46.40999984741211,23.770000457763672,110.01000213623047,41.0,57.439998626708984,98.02999877929688,24.93000030517578,34.939998626708984,35.5099983215332,62.939998626708984,12.136474609375,110.44999694824219,24.34000015258789,31.34000015258789,46.68000030517578,46.02000045776367,51.06999969482422,56.27000045776367,120.19999694824219,95.80999755859375,81.83999633789062,104.69999694824219,112.16000366210938\n2010-11-15,46.38999938964844,23.799999237060547,108.62999725341797,41.0,57.400001525878906,96.7699966430664,24.899999618530273,34.81999969482422,35.22999954223633,62.619998931884766,12.193338394165039,109.23999786376953,24.270000457763672,31.450000762939453,46.65999984741211,45.41999816894531,51.0,56.220001220703125,120.02999877929688,93.80999755859375,81.44999694824219,104.61000061035156,112.25\n2010-11-16,45.16999816894531,23.270000457763672,108.83000183105469,40.279998779296875,56.04999923706055,97.48999786376953,24.18000030517578,33.7599983215332,34.470001220703125,61.45000076293945,11.990251541137695,109.81999969482422,23.829999923706055,31.079999923706055,45.7400016784668,44.11000061035156,49.599998474121094,55.20000076293945,118.16000366210938,96.13999938964844,81.72000122070312,104.61000061035156,110.5\n2010-11-17,45.400001525878906,23.40999984741211,108.8499984741211,40.880001068115234,56.36000061035156,97.20999908447266,24.350000381469727,33.91999816894531,34.459999084472656,61.70000076293945,11.909016609191895,109.81999969482422,23.84000015258789,31.06999969482422,45.75,44.15999984741211,49.91999816894531,55.59000015258789,118.22000122070312,95.61000061035156,81.73999786376953,104.61000061035156,110.44000244140625\n2010-11-18,46.47999954223633,24.110000610351562,109.02999877929688,41.91999816894531,57.77000045776367,96.9800033569336,25.0,34.70000076293945,35.11000061035156,63.060001373291016,12.071486473083496,109.9000015258789,24.239999771118164,31.25,46.7400016784668,45.099998474121094,51.13999938964844,56.900001525878906,119.95999908447266,96.0,81.73999786376953,104.87999725341797,112.1500015258789\n2010-11-19,46.5099983215332,24.270000457763672,109.33999633789062,41.959999084472656,57.77000045776367,97.18000030517578,25.190000534057617,34.52000045776367,35.38999938964844,63.59000015258789,12.071486473083496,110.27999877929688,24.309999465942383,31.1299991607666,46.27000045776367,44.65999984741211,51.279998779296875,56.65999984741211,120.29000091552734,96.58999633789062,81.76000213623047,104.75,112.01000213623047\n2010-11-22,46.369998931884766,24.139999389648438,109.72000122070312,41.84000015258789,57.150001525878906,97.69999694824219,24.81999969482422,34.099998474121094,35.47999954223633,63.38999938964844,11.892769813537598,110.88999938964844,24.450000762939453,31.219999313354492,46.09000015258789,44.47999954223633,50.5099983215332,56.70000076293945,120.19000244140625,97.0,82.0,104.94999694824219,111.81999969482422\n2010-11-23,44.900001525878906,23.239999771118164,109.76000213623047,41.040000915527344,55.43000030517578,97.9000015258789,23.799999237060547,33.08000183105469,34.79999923706055,62.150001525878906,11.70592975616455,110.94999694824219,24.09000015258789,30.8799991607666,44.529998779296875,43.470001220703125,48.79999923706055,55.279998779296875,118.44999694824219,97.4800033569336,82.0199966430664,104.94000244140625,110.38999938964844\n2010-11-24,45.939998626708984,23.610000610351562,109.18000030517578,41.7599983215332,56.310001373291016,96.8499984741211,23.93000030517578,33.540000915527344,35.470001220703125,63.27000045776367,11.88464641571045,110.04000091552734,24.489999771118164,31.06999969482422,45.52000045776367,44.20000076293945,49.43000030517578,56.290000915527344,120.19999694824219,95.73999786376953,81.62999725341797,104.68000030517578,111.8499984741211\n2010-11-26,44.79999923706055,23.450000762939453,109.5,41.08000183105469,55.369998931884766,97.2699966430664,23.59000015258789,33.18000030517578,34.869998931884766,62.5099983215332,11.7140531539917,110.18000030517578,24.25,30.860000610351562,44.5099983215332,43.20000076293945,48.5,55.34000015258789,118.80000305175781,97.06999969482422,81.81999969482422,104.81999969482422,110.63999938964844\n2010-11-29,45.150001525878906,22.940000534057617,109.62000274658203,41.279998779296875,54.880001068115234,97.4800033569336,23.0,32.63999938964844,35.16999816894531,62.93000030517578,11.811534881591797,110.29000091552734,24.190000534057617,30.799999237060547,44.880001068115234,43.84000015258789,47.86000061035156,55.619998931884766,119.16000366210938,97.9000015258789,81.87999725341797,104.80999755859375,110.6500015258789\n2010-11-30,44.779998779296875,22.530000686645508,109.4800033569336,41.08000183105469,54.2599983215332,97.6500015258789,22.489999771118164,32.31999969482422,35.189998626708984,62.709999084472656,11.74654769897461,110.12000274658203,23.950000762939453,30.760000228881836,44.4900016784668,43.34000015258789,47.11000061035156,55.27000045776367,118.48999786376953,98.41000366210938,81.91000366210938,104.79000091552734,110.16999816894531\n2010-12-01,46.060001373291016,23.399999618530273,108.58999633789062,41.91999816894531,55.79999923706055,96.12999725341797,23.209999084472656,33.18000030517578,36.150001525878906,64.56999969482422,11.982128143310547,109.44999694824219,24.459999084472656,31.1200008392334,45.720001220703125,44.45000076293945,48.70000076293945,56.439998626708984,121.01000213623047,95.88999938964844,81.19000244140625,104.45999908447266,112.66999816894531\n2010-12-02,46.970001220703125,23.8700008392334,108.55000305175781,42.31999969482422,56.86000061035156,95.88999938964844,23.809999465942383,33.779998779296875,36.70000076293945,65.52999877929688,12.290820121765137,109.20999908447266,24.75,31.209999084472656,46.5,45.060001373291016,49.83000183105469,57.279998779296875,122.55999755859375,95.63999938964844,81.12000274658203,104.48999786376953,113.73999786376953\n2010-12-03,47.13999938964844,24.239999771118164,108.54000091552734,42.560001373291016,57.40999984741211,95.9000015258789,24.219999313354492,34.15999984741211,37.0099983215332,65.81999969482422,12.331438064575195,108.9000015258789,24.809999465942383,31.280000686645508,46.790000915527344,44.41999816894531,50.40999984741211,57.61000061035156,122.88999938964844,94.88999938964844,81.25,104.5999984741211,113.94000244140625\n2010-12-06,47.060001373291016,24.06999969482422,108.97000122070312,42.7599983215332,57.150001525878906,96.5,23.940000534057617,34.20000076293945,37.06999969482422,66.04000091552734,12.315191268920898,109.66000366210938,24.809999465942383,31.190000534057617,46.349998474121094,43.84000015258789,49.97999954223633,57.58000183105469,122.76000213623047,96.2300033569336,81.5199966430664,104.63999938964844,113.73999786376953\n2010-12-07,46.84000015258789,24.079999923706055,107.88999938964844,42.2400016784668,57.18000030517578,94.9000015258789,24.149999618530273,34.380001068115234,37.119998931884766,65.79000091552734,12.331438064575195,108.63999938964844,24.84000015258789,30.979999542236328,46.459999084472656,43.9900016784668,50.20000076293945,57.290000915527344,122.83000183105469,94.16999816894531,80.93000030517578,104.37000274658203,113.7300033569336\n2010-12-08,46.540000915527344,24.030000686645508,106.83999633789062,42.36000061035156,57.349998474121094,94.08999633789062,24.40999984741211,34.540000915527344,36.72999954223633,65.4800033569336,12.534524917602539,107.94000244140625,25.049999237060547,30.8700008392334,46.20000076293945,43.29999923706055,50.540000915527344,57.15999984741211,123.27999877929688,93.26000213623047,80.51000213623047,104.19000244140625,113.88999938964844\n2010-12-09,46.380001068115234,23.950000762939453,106.70999908447266,42.439998626708984,57.5,94.29000091552734,24.5,34.58000183105469,36.93000030517578,65.62999725341797,12.688870429992676,108.19999694824219,25.06999969482422,31.0,46.5099983215332,43.36000061035156,50.56999969482422,57.29999923706055,123.76000213623047,93.72000122070312,80.58000183105469,104.16999816894531,113.91999816894531\n2010-12-10,46.59000015258789,24.059999465942383,106.19000244140625,42.31999969482422,57.630001068115234,93.48999786376953,24.510000228881836,34.779998779296875,37.25,65.9000015258789,12.802599906921387,107.69999694824219,25.190000534057617,31.1200008392334,46.79999923706055,43.43000030517578,50.79999923706055,57.38999938964844,124.4800033569336,93.1500015258789,80.31999969482422,104.27999877929688,114.29000091552734\n2010-12-13,46.88999938964844,24.40999984741211,106.83000183105469,42.880001068115234,58.25,93.79000091552734,24.940000534057617,35.040000915527344,37.45000076293945,66.45999908447266,12.794476509094238,108.0999984741211,25.139999389648438,31.270000457763672,47.220001220703125,43.869998931884766,51.31999969482422,58.06999969482422,124.55999755859375,93.5,80.52999877929688,104.19000244140625,114.48999786376953\n2010-12-14,46.959999084472656,24.399999618530273,105.80999755859375,43.040000915527344,58.34000015258789,92.80000305175781,24.90999984741211,35.0,37.41999816894531,66.1500015258789,12.680747032165527,107.44000244140625,25.18000030517578,31.350000381469727,47.29999923706055,43.779998779296875,51.310001373291016,58.31999969482422,124.66999816894531,92.13999938964844,80.0199966430664,104.05999755859375,115.01000213623047\n2010-12-15,46.20000076293945,23.979999542236328,106.13999938964844,42.7599983215332,57.56999969482422,92.41999816894531,24.450000762939453,34.439998626708984,37.220001220703125,65.79000091552734,12.575141906738281,106.7699966430664,25.079999923706055,31.079999923706055,46.400001525878906,42.7599983215332,50.5,57.56999969482422,124.0999984741211,90.94000244140625,79.7699966430664,104.12999725341797,114.88999938964844\n2010-12-16,46.33000183105469,24.100000381469727,106.61000061035156,43.0,57.88999938964844,92.97000122070312,24.670000076293945,34.63999938964844,37.56999969482422,66.16000366210938,12.591388702392578,107.29000091552734,25.1200008392334,31.360000610351562,46.72999954223633,42.599998474121094,50.869998931884766,57.95000076293945,124.81999969482422,91.56999969482422,79.94999694824219,104.19000244140625,115.23999786376953\n2010-12-17,46.400001525878906,23.969999313354492,107.33000183105469,42.880001068115234,57.56999969482422,93.7699966430664,24.459999084472656,34.459999084472656,37.560001373291016,65.88999938964844,12.61575984954834,108.2699966430664,25.079999923706055,31.149999618530273,46.599998474121094,42.59000015258789,50.38999938964844,57.880001068115234,124.30000305175781,93.23999786376953,80.44000244140625,104.31999969482422,114.94999694824219\n2010-12-20,46.189998626708984,23.959999084472656,107.31999969482422,42.91999816894531,57.70000076293945,93.76000213623047,24.450000762939453,34.459999084472656,37.68000030517578,66.31999969482422,12.623883247375488,108.19999694824219,25.100000381469727,31.190000534057617,46.599998474121094,42.380001068115234,50.4900016784668,57.84000015258789,124.5999984741211,93.13999938964844,80.48999786376953,104.25,114.75\n2010-12-21,46.5,24.06999969482422,107.5,42.880001068115234,57.63999938964844,93.95999908447266,24.450000762939453,34.34000015258789,38.060001373291016,66.98999786376953,12.843216896057129,108.43000030517578,25.25,31.200000762939453,46.09000015258789,43.27000045776367,51.0099983215332,58.310001373291016,125.38999938964844,93.79000091552734,80.58000183105469,104.37000274658203,115.30999755859375\n2010-12-22,46.65999984741211,24.040000915527344,107.41999816894531,43.040000915527344,57.75,93.69999694824219,24.450000762939453,34.459999084472656,38.040000915527344,67.22000122070312,12.989439010620117,108.33999633789062,25.219999313354492,31.34000015258789,46.31999969482422,43.150001525878906,48.72999954223633,56.20000076293945,125.77999877929688,93.12000274658203,80.48999786376953,104.22000122070312,115.58000183105469\n2010-12-23,46.61000061035156,24.040000915527344,107.0199966430664,43.0,57.720001220703125,93.37000274658203,24.3700008392334,34.5,38.13999938964844,67.41000366210938,12.89195728302002,108.38999938964844,25.209999084472656,31.360000610351562,46.33000183105469,42.599998474121094,48.720001220703125,56.220001220703125,125.5999984741211,92.93000030517578,80.4000015258789,104.12999725341797,115.7300033569336\n2010-12-27,46.459999084472656,23.850000381469727,107.25,43.119998931884766,57.599998474121094,93.7300033569336,24.209999084472656,34.29999923706055,38.20000076293945,67.16999816894531,13.00568675994873,108.5999984741211,25.260000228881836,31.3799991607666,46.380001068115234,42.54999923706055,48.43000030517578,56.349998474121094,125.6500015258789,93.76000213623047,80.04000091552734,104.25,115.54000091552734\n2010-12-28,46.5,23.770000457763672,106.19000244140625,43.439998626708984,57.650001525878906,92.5,24.100000381469727,34.2599983215332,38.279998779296875,67.41999816894531,13.00568675994873,107.30999755859375,25.229999542236328,31.489999771118164,46.529998779296875,42.189998626708984,48.34000015258789,56.689998626708984,125.83000183105469,91.61000061035156,79.5199966430664,104.04000091552734,115.79000091552734\n2010-12-29,47.06999969482422,23.969999313354492,106.87999725341797,43.84000015258789,58.150001525878906,93.54000091552734,24.3700008392334,34.540000915527344,38.439998626708984,68.08999633789062,12.981315612792969,108.12000274658203,25.280000686645508,31.3799991607666,46.939998626708984,42.779998779296875,48.79999923706055,57.29999923706055,125.91999816894531,93.16000366210938,79.98999786376953,104.25,115.6500015258789\n2010-12-30,47.310001373291016,23.770000457763672,106.77999877929688,43.47999954223633,57.869998931884766,93.3499984741211,24.299999237060547,34.400001525878906,38.439998626708984,68.1500015258789,12.940698623657227,108.16999816894531,25.219999313354492,31.329999923706055,46.9900016784668,42.66999816894531,48.56999969482422,56.959999084472656,125.72000122070312,93.08999633789062,80.0,104.05000305175781,115.44999694824219\n2010-12-31,47.63999938964844,23.940000534057617,107.5199966430664,43.63999938964844,58.220001220703125,93.81999969482422,24.450000762939453,34.7400016784668,38.40999984741211,68.25,12.956945419311523,108.44000244140625,25.190000534057617,31.34000015258789,46.97999954223633,43.09000015258789,49.09000015258789,57.040000915527344,125.75,94.12000274658203,80.2699966430664,104.27999877929688,115.62999725341797\n2011-01-03,48.099998474121094,24.190000534057617,107.06999969482422,44.040000915527344,58.70000076293945,93.52999877929688,24.719999313354492,34.63999938964844,38.720001220703125,68.76000213623047,13.241267204284668,108.86000061035156,25.469999313354492,31.489999771118164,47.380001068115234,43.72999954223633,49.36000061035156,57.63999938964844,127.05000305175781,93.41000366210938,80.16999816894531,104.26000213623047,116.41000366210938\n2011-01-04,48.31999969482422,24.139999389648438,107.33999633789062,44.08000183105469,58.52000045776367,93.75,24.729999542236328,35.0,38.459999084472656,68.16999816894531,13.225020408630371,109.0,25.56999969482422,31.639999389648438,46.779998779296875,44.279998779296875,49.2400016784668,57.31999969482422,126.9800033569336,93.5199966430664,80.18000030517578,104.25,116.63999938964844\n2011-01-05,48.20000076293945,23.780000686645508,106.93000030517578,43.7599983215332,58.27000045776367,92.73999786376953,24.520000457763672,34.91999816894531,38.54999923706055,68.44000244140625,13.379365921020508,108.19999694824219,25.719999313354492,31.440000534057617,46.689998626708984,44.31999969482422,48.84000015258789,57.13999938964844,127.63999938964844,91.45999908447266,79.83000183105469,104.23999786376953,117.04000091552734\n2011-01-06,47.689998626708984,23.559999465942383,107.23999786376953,43.7599983215332,57.599998474121094,93.22000122070312,24.170000076293945,34.619998931884766,38.349998474121094,67.79000091552734,13.290008544921875,108.36000061035156,25.8700008392334,31.469999313354492,46.310001373291016,43.970001220703125,48.2599983215332,57.0,127.38999938964844,91.86000061035156,79.9000015258789,104.30000305175781,116.77999877929688\n2011-01-07,47.25,23.34000015258789,107.58000183105469,43.91999816894531,57.369998931884766,93.83999633789062,23.799999237060547,34.47999954223633,38.310001373291016,68.27999877929688,13.176279067993164,108.91000366210938,25.75,31.579999923706055,46.130001068115234,43.650001525878906,47.88999938964844,56.95000076293945,127.13999938964844,92.3499984741211,80.19999694824219,104.48999786376953,116.56999969482422\n2011-01-10,46.7599983215332,23.100000381469727,107.88999938964844,43.91999816894531,57.27000045776367,94.16000366210938,23.600000381469727,34.540000915527344,38.36000061035156,68.01000213623047,13.14378547668457,109.0999984741211,25.770000457763672,31.40999984741211,46.040000915527344,43.310001373291016,47.68000030517578,57.029998779296875,126.9800033569336,92.8499984741211,80.38999938964844,104.41999816894531,116.19999694824219\n2011-01-11,47.2599983215332,23.40999984741211,107.93000030517578,44.2400016784668,57.65999984741211,93.79000091552734,23.81999969482422,34.779998779296875,38.66999816894531,69.13999938964844,13.192526817321777,109.05000305175781,25.729999542236328,31.459999084472656,46.099998474121094,43.79999923706055,48.18000030517578,57.33000183105469,127.43000030517578,92.33000183105469,80.2300033569336,104.38999938964844,116.55000305175781\n2011-01-12,48.209999084472656,24.15999984741211,107.9000015258789,44.63999938964844,58.93000030517578,93.5199966430664,24.610000610351562,35.47999954223633,39.04999923706055,70.08999633789062,13.411860466003418,108.9800033569336,25.959999084472656,31.6200008392334,46.599998474121094,44.689998626708984,49.59000015258789,57.81999969482422,128.5800018310547,91.61000061035156,80.18000030517578,104.3499984741211,117.4000015258789\n2011-01-13,47.790000915527344,24.399999618530273,108.2300033569336,44.599998474121094,59.09000015258789,94.1500015258789,25.06999969482422,35.29999923706055,38.709999084472656,69.88999938964844,13.37124252319336,109.44999694824219,25.940000534057617,31.59000015258789,46.790000915527344,44.560001373291016,49.779998779296875,57.900001525878906,128.3699951171875,92.43000030517578,80.43000030517578,104.3499984741211,117.19999694824219\n2011-01-14,47.93000030517578,24.6299991607666,107.76000213623047,44.599998474121094,59.45000076293945,93.88999938964844,25.399999618530273,35.560001373291016,38.79999923706055,70.6500015258789,13.582453727722168,108.93000030517578,26.170000076293945,31.739999771118164,46.7599983215332,44.54999923706055,50.2400016784668,57.900001525878906,129.3000030517578,91.83999633789062,80.31999969482422,104.44000244140625,117.69000244140625\n2011-01-18,47.86000061035156,24.799999237060547,107.77999877929688,44.720001220703125,59.84000015258789,93.66000366210938,25.510000228881836,35.97999954223633,39.0099983215332,71.08999633789062,13.501218795776367,108.87000274658203,26.200000762939453,31.81999969482422,47.11000061035156,44.220001220703125,50.619998931884766,58.130001068115234,129.52000427246094,91.41000366210938,80.23999786376953,104.37999725341797,118.2300033569336\n2011-01-19,47.4900016784668,24.760000228881836,107.81999969482422,44.63999938964844,59.43000030517578,93.9000015258789,25.3799991607666,35.540000915527344,38.11000061035156,70.2300033569336,13.200650215148926,108.79000091552734,26.010000228881836,31.739999771118164,46.959999084472656,44.34000015258789,50.09000015258789,58.02000045776367,128.25,92.06999969482422,80.33999633789062,104.51000213623047,118.16000366210938\n2011-01-20,46.970001220703125,24.6200008392334,106.80000305175781,44.2400016784668,58.91999816894531,93.16999816894531,25.420000076293945,34.86000061035156,37.56999969482422,69.7300033569336,13.265637397766113,108.31999969482422,25.8700008392334,31.979999542236328,46.27000045776367,43.61000061035156,49.77000045776367,57.33000183105469,128.0800018310547,90.80000305175781,80.04000091552734,104.43000030517578,118.12000274658203\n2011-01-21,46.47999954223633,24.90999984741211,107.0,43.79999923706055,59.2400016784668,93.4800033569336,25.8700008392334,35.099998474121094,37.47999954223633,70.0999984741211,13.37124252319336,108.4800033569336,25.719999313354492,31.950000762939453,46.20000076293945,43.22999954223633,50.5,56.939998626708984,128.3699951171875,91.5199966430664,80.19999694824219,104.47000122070312,118.45999908447266\n2011-01-24,46.84000015258789,25.030000686645508,106.93000030517578,44.08000183105469,59.869998931884766,93.48999786376953,26.1200008392334,35.47999954223633,37.880001068115234,70.36000061035156,13.354995727539062,108.52999877929688,26.079999923706055,32.130001068115234,46.7599983215332,43.06999969482422,50.93000030517578,57.459999084472656,129.10000610351562,91.55999755859375,80.19000244140625,104.5,119.55999755859375\n2011-01-25,46.560001373291016,25.059999465942383,107.3499984741211,44.47999954223633,59.75,93.95999908447266,26.1299991607666,35.02000045776367,37.93000030517578,70.16000366210938,13.330625534057617,109.06999969482422,26.200000762939453,32.08000183105469,46.560001373291016,42.83000183105469,50.81999969482422,57.630001068115234,129.1699981689453,92.43000030517578,80.4000015258789,104.73999786376953,119.48999786376953\n2011-01-26,46.970001220703125,25.329999923706055,107.16999816894531,44.400001525878906,60.130001068115234,93.38999938964844,26.229999542236328,35.400001525878906,38.72999954223633,71.83999633789062,13.322502136230469,108.45999908447266,26.350000381469727,31.959999084472656,46.88999938964844,43.09000015258789,51.13999938964844,57.81999969482422,129.6699981689453,91.02999877929688,80.12000274658203,104.66000366210938,119.61000061035156\n2011-01-27,46.810001373291016,25.489999771118164,107.0999984741211,44.439998626708984,60.27000045776367,93.73999786376953,26.450000762939453,35.439998626708984,38.40999984741211,71.41999816894531,13.436230659484863,108.63999938964844,26.440000534057617,32.08000183105469,46.72999954223633,43.13999938964844,51.470001220703125,57.790000915527344,129.99000549316406,91.44000244140625,80.27999877929688,104.75,119.63999938964844\n2011-01-28,45.33000183105469,25.0,107.51000213623047,43.68000030517578,58.93000030517578,94.16999816894531,25.600000381469727,34.599998474121094,37.810001373291016,71.11000061035156,13.200650215148926,108.77999877929688,25.829999923706055,31.649999618530273,45.93000030517578,42.029998779296875,50.150001525878906,56.689998626708984,127.72000122070312,91.91999816894531,80.44999694824219,104.8499984741211,118.0199966430664\n2011-01-31,45.810001373291016,25.170000076293945,107.54000091552734,43.720001220703125,59.439998626708984,93.80000305175781,26.0,35.119998931884766,38.439998626708984,73.1500015258789,13.322502136230469,108.4800033569336,25.989999771118164,31.719999313354492,46.31999969482422,42.54999923706055,50.900001525878906,56.970001220703125,128.67999267578125,91.22000122070312,80.33999633789062,104.8499984741211,118.5999984741211\n2011-02-01,46.91999816894531,25.700000762939453,107.27999877929688,44.599998474121094,60.849998474121094,93.12999725341797,26.690000534057617,36.0,39.470001220703125,74.33999633789062,13.598700523376465,107.91000366210938,26.43000030517578,32.040000915527344,47.09000015258789,42.84000015258789,52.040000915527344,57.91999816894531,130.74000549316406,90.44999694824219,79.95999908447266,104.58000183105469,120.08999633789062\n2011-02-02,46.56999969482422,25.639999389648438,106.98999786376953,45.040000915527344,60.79999923706055,92.91000366210938,26.469999313354492,36.220001220703125,39.400001525878906,74.27999877929688,13.493095397949219,107.69999694824219,26.479999542236328,31.8700008392334,47.02000045776367,42.790000915527344,51.77000045776367,58.33000183105469,130.49000549316406,90.47000122070312,79.87000274658203,104.44999694824219,120.0999984741211\n2011-02-03,46.5099983215332,25.440000534057617,106.43000030517578,45.400001525878906,60.810001373291016,92.37999725341797,26.190000534057617,36.220001220703125,39.56999969482422,74.31999969482422,13.501218795776367,107.44000244140625,26.520000457763672,32.0,47.4900016784668,42.68000030517578,51.58000183105469,58.79999923706055,130.77999877929688,89.72000122070312,79.5999984741211,104.30999755859375,120.37000274658203\n2011-02-04,46.5,25.389999389648438,105.83000183105469,45.400001525878906,60.790000915527344,91.80999755859375,26.1299991607666,36.18000030517578,39.58000183105469,74.12999725341797,13.493095397949219,107.11000061035156,26.690000534057617,31.799999237060547,47.849998474121094,42.869998931884766,51.47999954223633,58.880001068115234,131.14999389648438,88.80999755859375,79.33000183105469,104.2300033569336,120.69000244140625\n2011-02-07,46.560001373291016,25.59000015258789,105.80999755859375,45.36000061035156,60.97999954223633,91.7699966430664,26.25,36.459999084472656,39.790000915527344,74.55999755859375,13.688058853149414,107.2300033569336,26.81999969482422,32.0099983215332,47.810001373291016,42.470001220703125,51.7599983215332,58.86000061035156,131.97000122070312,89.2699966430664,79.33999633789062,104.30999755859375,121.3499984741211\n2011-02-08,46.58000183105469,25.889999389648438,105.26000213623047,45.63999938964844,61.380001068115234,91.13999938964844,26.559999465942383,36.7599983215332,39.91999816894531,74.30999755859375,13.785540580749512,106.83999633789062,26.93000030517578,32.0,47.86000061035156,42.58000183105469,52.15999984741211,59.040000915527344,132.57000732421875,88.44999694824219,79.08999633789062,104.19999694824219,122.13999938964844\n2011-02-09,45.5099983215332,26.149999618530273,105.55999755859375,45.31999969482422,61.20000076293945,91.66000366210938,26.6299991607666,36.599998474121094,39.560001373291016,73.37000274658203,13.688058853149414,107.52999877929688,26.8799991607666,32.0,47.2599983215332,41.5,52.220001220703125,58.59000015258789,132.27000427246094,89.22000122070312,79.27999877929688,104.38999938964844,122.27999877929688\n2011-02-10,45.08000183105469,25.8799991607666,104.91000366210938,45.279998779296875,60.79999923706055,91.36000061035156,26.40999984741211,36.439998626708984,39.630001068115234,74.12000274658203,13.688058853149414,107.0,26.760000228881836,32.060001373291016,46.97999954223633,41.369998931884766,51.619998931884766,58.41999816894531,132.32000732421875,88.19000244140625,79.02999877929688,104.2699966430664,122.16999816894531\n2011-02-11,45.630001068115234,25.940000534057617,105.44999694824219,45.31999969482422,60.83000183105469,91.77999877929688,26.389999389648438,36.5,39.849998474121094,74.11000061035156,13.874898910522461,107.58999633789062,26.899999618530273,32.0,47.08000183105469,41.68000030517578,51.84000015258789,58.41999816894531,133.11000061035156,89.45999908447266,79.30000305175781,104.3499984741211,122.6500015258789\n2011-02-14,45.400001525878906,25.90999984741211,105.52999877929688,45.720001220703125,60.95000076293945,91.80999755859375,26.209999084472656,36.560001373291016,40.279998779296875,75.73999786376953,13.88302230834961,107.66000366210938,26.940000534057617,31.770000457763672,47.22999954223633,41.91999816894531,51.63999938964844,58.959999084472656,133.42999267578125,89.5199966430664,79.38999938964844,104.37999725341797,122.61000061035156\n2011-02-15,45.4900016784668,25.790000915527344,105.66000366210938,45.400001525878906,60.77000045776367,92.0199966430664,26.200000762939453,36.47999954223633,39.81999969482422,74.94999694824219,13.866774559020996,107.9000015258789,26.84000015258789,31.8700008392334,46.90999984741211,41.79999923706055,51.58000183105469,58.599998474121094,133.00999450683594,89.91999816894531,79.5,104.44000244140625,122.19999694824219\n2011-02-16,45.869998931884766,26.06999969482422,105.51000213623047,46.040000915527344,61.5,91.88999938964844,26.6200008392334,36.7400016784668,40.34000015258789,75.94999694824219,13.939886093139648,107.7699966430664,26.989999771118164,31.799999237060547,47.38999938964844,42.310001373291016,52.27000045776367,59.34000015258789,133.85000610351562,89.62999725341797,79.52999877929688,104.45999908447266,122.87999725341797\n2011-02-17,46.029998779296875,26.059999465942383,105.91000366210938,46.439998626708984,61.709999084472656,92.2300033569336,26.690000534057617,36.959999084472656,40.70000076293945,76.69999694824219,13.923639297485352,107.97000122070312,27.040000915527344,31.860000610351562,47.65999984741211,42.65999984741211,52.470001220703125,59.689998626708984,134.25,89.7699966430664,79.6500015258789,104.5199966430664,123.16000366210938\n2011-02-18,46.310001373291016,26.260000228881836,106.45999908447266,46.400001525878906,61.91999816894531,92.20999908447266,26.850000381469727,37.060001373291016,40.25,77.0199966430664,13.956132888793945,108.12999725341797,27.0,31.90999984741211,47.66999816894531,42.72999954223633,52.68000030517578,59.720001220703125,134.52999877929688,89.48999786376953,79.6500015258789,104.62000274658203,123.5999984741211\n2011-02-22,44.83000183105469,25.68000030517578,107.30000305175781,45.119998931884766,60.150001525878906,93.0999984741211,25.979999542236328,36.02000045776367,38.959999084472656,76.2699966430664,13.525588989257812,108.43000030517578,26.34000015258789,31.770000457763672,45.939998626708984,41.20000076293945,51.099998474121094,57.900001525878906,131.8300018310547,90.83000183105469,79.94999694824219,104.61000061035156,121.88999938964844\n2011-02-23,44.869998931884766,25.459999084472656,107.69000244140625,45.20000076293945,60.22999954223633,92.87000274658203,26.010000228881836,35.959999084472656,38.66999816894531,77.81999969482422,13.468724250793457,108.30000305175781,26.030000686645508,31.700000762939453,46.099998474121094,41.2400016784668,51.209999084472656,58.150001525878906,131.02000427246094,91.16000366210938,79.94000244140625,104.5999984741211,120.8499984741211\n2011-02-24,44.97999954223633,25.3799991607666,108.08000183105469,45.08000183105469,60.279998779296875,93.11000061035156,26.110000610351562,35.84000015258789,38.470001220703125,76.72000122070312,13.436230659484863,108.41999816894531,26.1200008392334,31.579999923706055,46.11000061035156,41.15999984741211,51.29999923706055,58.0,130.92999267578125,91.73999786376953,80.0199966430664,104.66000366210938,120.41999816894531\n2011-02-25,45.52000045776367,25.549999237060547,108.44000244140625,45.68000030517578,61.0,93.41000366210938,26.510000228881836,36.439998626708984,39.040000915527344,77.94000244140625,13.62307071685791,108.93000030517578,26.450000762939453,31.760000228881836,47.119998931884766,41.84000015258789,51.91999816894531,58.900001525878906,132.3300018310547,92.27999877929688,80.23999786376953,104.69999694824219,121.13999938964844\n2011-02-28,45.790000915527344,26.0,108.1500015258789,46.119998931884766,61.54999923706055,93.37000274658203,26.850000381469727,36.720001220703125,39.459999084472656,78.54000091552734,13.688058853149414,109.22000122070312,26.559999465942383,32.11000061035156,47.22999954223633,42.45000076293945,52.4900016784668,59.400001525878906,133.14999389648438,92.4000015258789,80.3499984741211,104.83000183105469,122.1500015258789\n2011-03-01,45.31999969482422,25.549999237060547,108.5,46.040000915527344,60.689998626708984,93.26000213623047,26.420000076293945,35.939998626708984,38.4900016784668,77.06999969482422,13.395613670349121,108.79000091552734,26.049999237060547,31.790000915527344,46.470001220703125,42.16999816894531,51.4900016784668,58.869998931884766,130.92999267578125,92.37000274658203,80.0999984741211,104.56999969482422,120.37000274658203\n2011-03-02,45.939998626708984,25.770000457763672,108.18000030517578,45.63999938964844,61.0099983215332,92.7699966430664,26.5,36.2400016784668,38.630001068115234,77.51000213623047,13.31437873840332,108.20999908447266,26.209999084472656,31.84000015258789,46.91999816894531,42.560001373291016,52.02000045776367,58.779998779296875,131.2100067138672,90.94999694824219,79.94000244140625,104.61000061035156,120.44999694824219\n2011-03-03,46.849998474121094,26.260000228881836,107.88999938964844,46.08000183105469,61.790000915527344,92.13999938964844,26.989999771118164,36.84000015258789,39.40999984741211,78.83999633789062,13.590577125549316,107.75,26.6299991607666,32.20000076293945,47.349998474121094,43.31999969482422,52.72999954223633,59.34000015258789,133.47000122070312,90.05999755859375,79.62000274658203,104.37999725341797,122.36000061035156\n2011-03-04,46.900001525878906,25.950000762939453,108.61000061035156,45.7599983215332,61.22999954223633,92.80000305175781,26.610000610351562,36.63999938964844,39.04999923706055,78.33999633789062,13.419983863830566,108.16000366210938,26.420000076293945,32.0099983215332,47.099998474121094,43.439998626708984,52.099998474121094,58.93000030517578,132.47000122070312,90.80999755859375,79.88999938964844,104.62000274658203,121.47000122070312\n2011-03-07,46.2400016784668,25.84000015258789,108.5199966430664,44.880001068115234,60.63999938964844,92.56999969482422,26.360000610351562,36.2400016784668,38.380001068115234,77.79000091552734,13.330625534057617,107.88999938964844,26.079999923706055,32.130001068115234,46.540000915527344,43.099998474121094,51.75,58.02000045776367,131.42999267578125,90.2300033569336,79.87999725341797,104.58999633789062,120.70999908447266\n2011-03-08,46.86000061035156,25.799999237060547,108.58999633789062,45.08000183105469,60.83000183105469,92.3499984741211,26.489999771118164,36.31999969482422,38.81999969482422,77.1500015258789,13.62307071685791,107.75,26.299999237060547,32.4900016784668,47.18000030517578,44.13999938964844,51.880001068115234,58.45000076293945,132.5800018310547,89.68000030517578,79.80999755859375,104.62000274658203,121.98999786376953\n2011-03-09,46.95000076293945,25.670000076293945,108.73999786376953,45.08000183105469,60.849998474121094,92.88999938964844,26.440000534057617,36.279998779296875,38.189998626708984,76.62000274658203,13.62307071685791,108.30999755859375,26.190000534057617,32.81999969482422,46.95000076293945,44.43000030517578,51.869998931884766,58.38999938964844,132.38999938964844,90.55000305175781,79.94999694824219,104.62999725341797,122.01000213623047\n2011-03-10,45.560001373291016,25.079999923706055,109.36000061035156,43.959999084472656,59.34000015258789,93.68000030517578,25.8799991607666,35.2599983215332,37.36000061035156,73.83000183105469,13.346872329711914,108.75,25.700000762939453,32.45000076293945,45.650001525878906,43.63999938964844,50.56999969482422,56.93000030517578,129.94000244140625,92.06999969482422,80.31999969482422,104.63999938964844,119.7300033569336\n2011-03-11,46.029998779296875,25.170000076293945,109.18000030517578,43.2400016784668,59.34000015258789,93.45999908447266,25.989999771118164,35.36000061035156,37.90999984741211,75.11000061035156,13.436230659484863,108.6500015258789,25.799999237060547,32.52000045776367,46.060001373291016,43.529998779296875,50.90999984741211,56.5,130.83999633789062,91.55000305175781,80.33000183105469,104.80000305175781,120.41999816894531\n2011-03-14,46.29999923706055,24.8799991607666,109.33999633789062,40.20000076293945,58.279998779296875,93.66999816894531,25.8700008392334,35.29999923706055,37.77000045776367,75.5199966430664,13.31437873840332,108.7699966430664,25.68000030517578,32.09000015258789,45.59000015258789,43.56999969482422,50.630001068115234,53.790000915527344,130.0500030517578,91.51000213623047,80.41000366210938,104.83999633789062,119.8499984741211\n2011-03-15,45.529998779296875,24.059999465942383,109.30999755859375,40.119998931884766,57.060001373291016,94.01000213623047,25.18000030517578,34.619998931884766,37.77000045776367,74.94999694824219,13.160032272338867,108.76000213623047,25.299999237060547,31.479999542236328,44.31999969482422,42.810001373291016,49.31999969482422,52.970001220703125,128.55999755859375,92.87999725341797,80.45999908447266,104.66999816894531,118.43000030517578\n2011-03-16,44.599998474121094,23.200000762939453,110.08999633789062,38.63999938964844,55.290000915527344,94.80999755859375,24.190000534057617,33.5,37.0099983215332,73.75,12.916328430175781,109.41000366210938,24.68000030517578,30.989999771118164,43.31999969482422,41.75,47.7599983215332,51.38999938964844,126.18000030517578,93.93000030517578,80.83999633789062,104.94000244140625,116.16000366210938\n2011-03-17,45.150001525878906,24.079999923706055,110.30999755859375,40.400001525878906,57.130001068115234,94.5199966430664,25.079999923706055,34.459999084472656,37.66999816894531,76.0,13.070673942565918,109.33999633789062,24.940000534057617,31.030000686645508,43.720001220703125,41.97999954223633,49.5099983215332,53.04999923706055,127.8499984741211,93.20999908447266,80.72000122070312,104.87999725341797,117.69000244140625\n2011-03-18,45.22999954223633,24.3799991607666,110.2300033569336,41.47999954223633,57.91999816894531,94.45999908447266,25.59000015258789,34.900001525878906,37.72999954223633,75.38999938964844,13.216897010803223,109.41000366210938,24.899999618530273,30.8799991607666,44.599998474121094,41.68000030517578,50.119998931884766,54.279998779296875,127.76000213623047,93.45999908447266,80.70999908447266,104.91999816894531,118.2699966430664\n2011-03-21,46.099998474121094,25.09000015258789,109.76000213623047,42.68000030517578,59.349998474121094,93.97000122070312,26.350000381469727,35.52000045776367,38.380001068115234,77.68000030517578,13.28188419342041,109.05999755859375,25.31999969482422,31.239999771118164,45.65999984741211,42.75,51.36000061035156,55.79999923706055,129.74000549316406,92.91000366210938,80.4800033569336,104.77999877929688,120.06999969482422\n2011-03-22,46.2400016784668,24.920000076293945,109.48999786376953,42.52000045776367,59.18000030517578,94.0199966430664,26.190000534057617,35.459999084472656,38.290000915527344,77.51000213623047,13.208773612976074,109.26000213623047,25.280000686645508,31.290000915527344,45.650001525878906,42.83000183105469,50.970001220703125,55.58000183105469,129.2899932861328,93.22000122070312,80.44999694824219,104.72000122070312,119.91999816894531\n2011-03-23,46.849998474121094,24.850000381469727,109.30999755859375,42.279998779296875,59.25,93.9000015258789,26.229999542236328,35.52000045776367,38.849998474121094,77.70999908447266,13.176279067993164,109.19000244140625,25.420000076293945,31.270000457763672,46.119998931884766,43.189998626708984,51.040000915527344,55.540000915527344,129.66000366210938,93.0999984741211,80.41999816894531,104.83000183105469,120.62999725341797\n2011-03-24,47.38999938964844,25.5,109.41000366210938,42.36000061035156,60.040000915527344,93.41999816894531,26.739999771118164,35.84000015258789,39.02000045776367,77.98999786376953,13.241267204284668,108.83000183105469,25.81999969482422,31.399999618530273,46.869998931884766,43.630001068115234,51.86000061035156,56.040000915527344,130.89999389648438,92.4000015258789,80.29000091552734,104.68000030517578,121.45999908447266\n2011-03-25,47.34000015258789,25.329999923706055,108.9000015258789,41.31999969482422,59.380001068115234,93.16999816894531,26.5,35.599998474121094,39.22999954223633,78.69000244140625,13.273760795593262,108.66999816894531,25.8799991607666,31.389999389648438,46.95000076293945,43.66999816894531,51.31999969482422,55.15999984741211,131.3000030517578,92.16999816894531,80.18000030517578,104.44999694824219,121.95999908447266\n2011-03-28,47.099998474121094,25.270000457763672,108.95999908447266,41.2400016784668,59.349998474121094,93.19999694824219,26.5,35.540000915527344,39.04999923706055,78.5,13.23314380645752,108.70999908447266,25.81999969482422,31.280000686645508,46.77000045776367,43.33000183105469,51.31999969482422,55.119998931884766,130.97999572753906,92.30000305175781,80.11000061035156,104.55000305175781,121.76000213623047\n2011-03-29,47.63999938964844,25.3799991607666,108.73999786376953,41.15999984741211,59.65999984741211,92.93000030517578,26.729999542236328,35.720001220703125,39.459999084472656,79.45999908447266,13.257513999938965,108.18000030517578,26.0,31.59000015258789,47.439998626708984,43.720001220703125,51.630001068115234,55.33000183105469,131.86000061035156,91.58999633789062,79.97000122070312,104.51000213623047,122.51000213623047\n2011-03-30,48.25,25.799999237060547,109.12000274658203,41.79999923706055,60.369998931884766,93.25,26.969999313354492,36.040000915527344,39.869998931884766,80.01000213623047,13.363119125366211,108.55000305175781,26.110000610351562,31.950000762939453,48.099998474121094,44.400001525878906,52.15999984741211,56.209999084472656,132.77000427246094,92.31999969482422,80.11000061035156,104.52999877929688,123.20999908447266\n2011-03-31,48.66999816894531,25.950000762939453,109.16000366210938,41.279998779296875,60.08000183105469,93.01000213623047,26.93000030517578,35.81999969482422,40.02000045776367,79.75,13.31437873840332,108.19999694824219,26.059999465942383,31.8700008392334,48.310001373291016,44.90999984741211,51.95000076293945,55.83000183105469,132.58999633789062,92.12999725341797,80.0199966430664,104.44000244140625,123.0199966430664\n2011-04-01,49.45000076293945,26.3799991607666,108.86000061035156,41.20000076293945,60.650001525878906,92.95999908447266,27.25,36.29999923706055,40.16999816894531,79.98999786376953,13.428107261657715,108.27999877929688,26.010000228881836,32.119998931884766,48.84000015258789,45.4900016784668,52.61000061035156,56.04999923706055,133.14999389648438,92.19000244140625,79.88999938964844,104.11000061035156,123.45999908447266\n2011-04-04,49.869998931884766,26.420000076293945,109.3499984741211,40.63999938964844,60.72999954223633,93.16999816894531,27.290000915527344,36.560001373291016,40.43000030517578,80.04000091552734,13.411860466003418,108.52999877929688,25.920000076293945,32.099998474121094,49.0,46.349998474121094,52.83000183105469,55.65999984741211,133.25999450683594,92.29000091552734,79.98999786376953,104.25,123.76000213623047\n2011-04-05,49.77000045776367,26.350000381469727,109.1500015258789,39.84000015258789,60.58000183105469,92.69999694824219,27.299999237060547,36.81999969482422,40.90999984741211,80.27999877929688,13.40373706817627,108.58999633789062,25.8799991607666,31.969999313354492,49.0099983215332,46.0,52.90999984741211,55.0099983215332,133.24000549316406,91.91999816894531,79.80999755859375,104.12000274658203,123.6500015258789\n2011-04-06,50.040000915527344,26.75,108.55999755859375,39.47999954223633,61.08000183105469,92.30000305175781,27.579999923706055,37.119998931884766,40.56999969482422,79.44000244140625,13.558082580566406,108.23999786376953,26.06999969482422,32.20000076293945,49.66999816894531,46.06999969482422,53.619998931884766,55.060001373291016,133.66000366210938,90.54000091552734,79.69000244140625,104.16000366210938,124.16999816894531\n2011-04-07,49.9900016784668,26.68000030517578,108.75,39.15999984741211,60.779998779296875,92.30999755859375,27.43000030517578,36.939998626708984,40.4900016784668,79.44000244140625,13.493095397949219,108.08000183105469,26.079999923706055,32.06999969482422,49.540000915527344,45.9900016784668,53.349998474121094,54.7400016784668,133.32000732421875,90.36000061035156,79.66999816894531,104.20999908447266,123.91000366210938\n2011-04-08,50.040000915527344,26.8700008392334,108.9800033569336,39.91999816894531,61.279998779296875,92.04000091552734,27.68000030517578,37.08000183105469,40.20000076293945,79.72000122070312,13.37124252319336,108.0199966430664,25.93000030517578,31.979999542236328,50.0099983215332,46.02000045776367,53.810001373291016,55.43000030517578,132.86000061035156,89.87999725341797,79.62000274658203,104.16999816894531,123.6500015258789\n2011-04-11,49.45000076293945,26.799999237060547,108.9000015258789,39.63999938964844,61.15999984741211,92.16000366210938,27.520000457763672,37.15999984741211,39.75,78.1500015258789,13.37124252319336,108.02999877929688,25.889999389648438,31.559999465942383,49.849998474121094,45.56999969482422,53.68000030517578,55.279998779296875,132.4600067138672,89.95999908447266,79.62999725341797,104.11000061035156,123.63999938964844\n2011-04-12,48.52000045776367,26.59000015258789,109.44999694824219,39.720001220703125,60.59000015258789,92.68000030517578,27.329999923706055,36.459999084472656,39.209999084472656,75.7300033569336,13.322502136230469,108.41000366210938,25.68000030517578,31.479999542236328,49.060001373291016,45.040000915527344,53.029998779296875,54.959999084472656,131.47000122070312,90.93000030517578,79.91000366210938,104.16000366210938,122.45999908447266\n2011-04-13,48.91999816894531,26.729999542236328,109.69000244140625,39.880001068115234,60.77000045776367,93.04000091552734,27.299999237060547,36.599998474121094,38.97999954223633,76.04000091552734,13.225020408630371,108.5999984741211,25.84000015258789,31.559999465942383,49.459999084472656,45.47999954223633,53.27000045776367,55.22999954223633,131.4600067138672,91.5,80.05999755859375,104.41000366210938,122.55000305175781\n2011-04-14,49.06999969482422,26.829999923706055,109.55000305175781,40.15999984741211,61.040000915527344,92.7300033569336,27.31999969482422,36.70000076293945,39.099998474121094,76.55999755859375,13.103168487548828,108.33000183105469,25.790000915527344,31.75,49.779998779296875,45.54999923706055,53.4900016784668,55.599998474121094,131.55999755859375,91.43000030517578,80.0199966430664,104.3499984741211,122.72000122070312\n2011-04-15,49.130001068115234,26.719999313354492,110.3499984741211,40.119998931884766,60.95000076293945,93.41000366210938,27.170000076293945,36.720001220703125,39.36000061035156,77.19000244140625,13.111291885375977,108.9000015258789,25.739999771118164,32.099998474121094,49.689998626708984,45.790000915527344,53.18000030517578,55.59000015258789,132.0399932861328,92.66999816894531,80.2699966430664,104.41999816894531,123.19000244140625\n2011-04-18,47.900001525878906,25.889999389648438,110.37999725341797,40.0,59.70000076293945,93.63999938964844,26.290000915527344,36.060001373291016,38.810001373291016,76.04000091552734,12.932575225830078,109.05000305175781,25.510000228881836,31.81999969482422,48.900001525878906,44.88999938964844,51.849998474121094,55.11000061035156,130.55999755859375,92.87999725341797,80.36000061035156,104.51000213623047,121.73999786376953\n2011-04-19,48.59000015258789,26.110000610351562,110.7699966430664,40.119998931884766,60.13999938964844,93.76000213623047,26.59000015258789,36.220001220703125,39.5,76.80999755859375,12.97319221496582,109.27999877929688,25.579999923706055,31.829999923706055,49.09000015258789,44.84000015258789,52.5,55.2400016784668,131.30999755859375,93.27999877929688,80.48999786376953,104.7300033569336,122.38999938964844\n2011-04-20,49.7400016784668,27.170000076293945,110.38999938964844,40.720001220703125,61.66999816894531,93.38999938964844,27.5,37.13999938964844,40.02000045776367,78.62000274658203,13.00568675994873,109.33000183105469,26.1200008392334,32.2400016784668,50.209999084472656,45.9900016784668,54.02000045776367,56.310001373291016,133.10000610351562,92.68000030517578,80.37999725341797,104.7300033569336,124.33999633789062\n2011-04-21,50.18000030517578,27.389999389648438,110.19000244140625,40.880001068115234,62.06999969482422,93.45999908447266,27.690000534057617,37.439998626708984,40.45000076293945,78.9800033569336,13.078797340393066,109.43000030517578,26.350000381469727,32.2400016784668,50.72999954223633,46.369998931884766,54.34000015258789,56.529998779296875,133.77999877929688,92.5999984741211,80.44000244140625,104.62999725341797,124.79000091552734\n2011-04-25,49.77000045776367,27.43000030517578,110.48999786376953,40.84000015258789,62.06999969482422,93.79000091552734,27.729999542236328,37.31999969482422,40.13999938964844,78.56999969482422,13.06255054473877,109.54000091552734,26.3700008392334,32.279998779296875,50.59000015258789,45.869998931884766,54.47999954223633,56.59000015258789,133.63999938964844,92.94999694824219,80.48999786376953,104.76000213623047,124.55000305175781\n2011-04-26,50.20000076293945,27.829999923706055,110.87000274658203,40.880001068115234,62.54999923706055,94.19000244140625,28.049999237060547,37.63999938964844,40.59000015258789,79.3499984741211,13.14378547668457,110.05000305175781,26.59000015258789,32.540000915527344,50.86000061035156,46.0099983215332,54.970001220703125,56.720001220703125,134.7899932861328,93.8499984741211,80.73999786376953,104.93000030517578,125.69999694824219\n2011-04-27,50.11000061035156,28.43000030517578,110.5999984741211,40.959999084472656,63.33000183105469,93.91999816894531,28.65999984741211,38.15999984741211,40.720001220703125,79.30999755859375,13.225020408630371,109.91000366210938,26.75,32.79999923706055,50.900001525878906,45.56999969482422,55.959999084472656,56.83000183105469,135.6699981689453,92.88999938964844,80.69999694824219,104.9000015258789,126.69000244140625\n2011-04-28,49.70000076293945,28.649999618530273,110.93000030517578,42.040000915527344,63.7599983215332,94.27999877929688,28.81999969482422,38.099998474121094,40.709999084472656,79.30000305175781,13.330625534057617,110.26000213623047,26.760000228881836,33.09000015258789,50.91999816894531,45.220001220703125,56.09000015258789,57.709999084472656,136.11000061035156,93.5999984741211,80.8499984741211,104.98999786376953,127.41999816894531\n2011-04-29,50.0,28.780000686645508,111.16000366210938,42.119998931884766,63.459999084472656,94.47000122070312,28.90999984741211,38.220001220703125,40.869998931884766,80.4800033569336,13.306255340576172,110.47000122070312,26.739999771118164,33.15999984741211,50.560001373291016,45.209999084472656,56.27000045776367,57.790000915527344,136.42999267578125,93.88999938964844,80.95999908447266,104.94999694824219,128.0399932861328\n2011-05-02,50.0099983215332,28.729999542236328,110.75,42.2400016784668,63.869998931884766,94.19999694824219,28.889999389648438,38.18000030517578,40.58000183105469,79.41000366210938,13.249390602111816,110.30000305175781,26.639999389648438,33.16999816894531,50.529998779296875,45.06999969482422,56.189998626708984,57.720001220703125,136.22000122070312,93.63999938964844,80.76000213623047,104.76000213623047,127.83999633789062\n2011-05-03,48.900001525878906,28.600000381469727,110.93000030517578,42.2400016784668,63.349998474121094,94.44999694824219,28.799999237060547,37.47999954223633,40.209999084472656,77.41999816894531,13.306255340576172,110.25,26.649999618530273,33.380001068115234,49.790000915527344,44.5099983215332,55.72999954223633,57.36000061035156,135.72999572753906,94.16999816894531,80.8499984741211,104.77999877929688,127.81999969482422\n2011-05-04,48.09000015258789,28.219999313354492,111.02999877929688,42.15999984741211,62.810001373291016,94.69000244140625,28.579999923706055,37.279998779296875,39.5,76.05000305175781,13.192526817321777,110.41000366210938,26.56999969482422,33.34000015258789,48.63999938964844,43.709999084472656,55.2599983215332,56.75,134.8300018310547,94.58999633789062,80.94999694824219,104.77999877929688,126.97000122070312\n2011-05-05,47.630001068115234,27.530000686645508,110.9000015258789,41.84000015258789,61.56999969482422,95.16000366210938,27.709999084472656,36.400001525878906,39.029998779296875,74.47000122070312,13.021933555603027,110.79000091552734,26.43000030517578,33.099998474121094,48.040000915527344,43.349998474121094,53.849998474121094,56.2599983215332,133.61000061035156,95.48999786376953,81.12999725341797,104.77999877929688,125.63999938964844\n2011-05-06,48.25,27.469999313354492,110.94000244140625,42.08000183105469,61.599998474121094,95.20999908447266,27.5,36.459999084472656,39.349998474121094,74.80000305175781,13.086920738220215,110.79000091552734,26.479999542236328,33.290000915527344,48.84000015258789,43.779998779296875,53.599998474121094,56.849998474121094,134.1999969482422,95.06999969482422,81.19000244140625,104.68000030517578,126.2699966430664\n2011-05-09,48.34000015258789,27.5,111.16999816894531,42.2400016784668,62.040000915527344,95.3499984741211,27.56999969482422,36.68000030517578,39.91999816894531,76.11000061035156,13.054427146911621,110.9000015258789,26.59000015258789,33.36000061035156,49.31999969482422,43.86000061035156,54.02000045776367,57.20000076293945,134.72000122070312,94.97000122070312,81.26000213623047,104.77999877929688,126.70999908447266\n2011-05-10,48.90999984741211,27.889999389648438,110.87000274658203,42.439998626708984,62.630001068115234,94.88999938964844,28.0,37.13999938964844,40.2599983215332,76.47000122070312,13.176279067993164,110.44999694824219,26.829999923706055,33.84000015258789,49.7400016784668,44.290000915527344,54.65999984741211,57.58000183105469,135.8699951171875,94.29000091552734,81.05000305175781,104.69000244140625,127.44999694824219\n2011-05-11,47.83000183105469,27.290000915527344,110.5199966430664,41.720001220703125,61.369998931884766,95.2300033569336,27.43000030517578,36.70000076293945,39.189998626708984,74.26000213623047,12.997563362121582,110.62999725341797,26.59000015258789,33.72999954223633,48.7599983215332,43.630001068115234,53.689998626708984,56.529998779296875,134.44000244140625,94.83000183105469,81.1500015258789,104.73999786376953,126.30999755859375\n2011-05-12,47.970001220703125,27.3799991607666,110.38999938964844,41.84000015258789,61.56999969482422,95.0199966430664,27.559999465942383,36.599998474121094,39.150001525878906,74.1500015258789,12.997563362121582,110.37000274658203,26.790000915527344,34.06999969482422,48.529998779296875,43.709999084472656,53.959999084472656,56.529998779296875,135.0800018310547,94.2300033569336,81.06999969482422,104.77999877929688,126.98999786376953\n2011-05-13,46.91999816894531,26.790000915527344,110.37000274658203,40.959999084472656,60.61000061035156,95.38999938964844,27.149999618530273,36.18000030517578,38.650001525878906,73.79000091552734,12.810723304748535,110.69999694824219,26.459999084472656,33.90999984741211,47.9900016784668,43.20000076293945,52.97999954223633,55.66999816894531,134.0399932861328,95.08000183105469,81.19000244140625,104.86000061035156,125.95999908447266\n2011-05-16,46.849998474121094,26.739999771118164,110.4000015258789,40.720001220703125,60.5,95.62000274658203,27.030000686645508,36.040000915527344,38.5099983215332,73.2300033569336,12.794476509094238,111.0199966430664,26.079999923706055,33.95000076293945,47.939998626708984,43.099998474121094,52.959999084472656,55.369998931884766,133.19000244140625,95.61000061035156,81.37999725341797,104.80000305175781,125.47000122070312\n2011-05-17,47.0,26.65999984741211,110.48999786376953,40.7599983215332,60.630001068115234,95.9000015258789,27.1299991607666,36.13999938964844,38.060001373291016,73.2300033569336,12.89195728302002,111.16999816894531,26.079999923706055,34.20000076293945,48.25,43.150001525878906,53.040000915527344,55.439998626708984,133.1699981689453,96.58999633789062,81.51000213623047,104.9000015258789,124.80999755859375\n2011-05-18,47.7599983215332,26.8799991607666,110.43000030517578,41.08000183105469,61.0,95.3499984741211,27.350000381469727,36.380001068115234,38.90999984741211,74.70999908447266,12.948822021484375,110.88999938964844,26.270000457763672,34.09000015258789,48.68000030517578,44.13999938964844,53.45000076293945,55.88999938964844,134.36000061035156,95.30999755859375,81.27999877929688,104.81999969482422,125.70999908447266\n2011-05-19,47.45000076293945,27.149999618530273,110.13999938964844,40.47999954223633,61.349998474121094,95.44999694824219,27.860000610351562,36.619998931884766,38.900001525878906,74.72000122070312,12.948822021484375,111.08000183105469,26.31999969482422,34.16999816894531,49.119998931884766,44.119998931884766,54.02000045776367,55.689998626708984,134.67999267578125,95.2699966430664,81.25,104.91999816894531,126.18000030517578\n2011-05-20,47.06999969482422,26.399999618530273,110.0999984741211,40.040000915527344,60.47999954223633,95.68000030517578,27.239999771118164,36.459999084472656,38.5099983215332,74.62999725341797,12.770105361938477,111.0,26.170000076293945,34.130001068115234,48.54999923706055,44.02000045776367,53.08000183105469,55.11000061035156,133.61000061035156,95.31999969482422,81.31999969482422,104.91000366210938,124.8499984741211\n2011-05-23,46.09000015258789,25.729999542236328,110.11000061035156,39.439998626708984,59.08000183105469,95.80999755859375,26.600000381469727,35.52000045776367,38.11000061035156,73.47000122070312,12.591388702392578,110.93000030517578,25.799999237060547,33.72999954223633,47.119998931884766,42.939998626708984,51.810001373291016,53.93000030517578,132.05999755859375,95.77999877929688,81.37000274658203,104.94000244140625,123.5199966430664\n2011-05-24,46.54999923706055,25.889999389648438,110.66999816894531,39.91999816894531,59.41999816894531,95.91000366210938,26.690000534057617,35.68000030517578,38.29999923706055,74.51000213623047,12.575141906738281,111.06999969482422,25.719999313354492,33.70000076293945,47.470001220703125,43.279998779296875,52.08000183105469,54.400001525878906,131.9499969482422,96.13999938964844,81.41999816894531,104.95999908447266,123.30000305175781\n2011-05-25,46.650001525878906,26.020000457763672,110.69999694824219,40.0,59.79999923706055,95.91999816894531,26.770000457763672,36.099998474121094,38.84000015258789,75.7699966430664,12.58326530456543,110.8499984741211,25.799999237060547,33.630001068115234,47.40999984741211,43.4900016784668,52.54999923706055,54.459999084472656,132.38999938964844,95.69000244140625,81.44999694824219,104.83999633789062,123.6500015258789\n2011-05-26,47.25,26.09000015258789,110.97000122070312,40.36000061035156,60.36000061035156,96.44999694824219,27.030000686645508,36.540000915527344,38.93000030517578,76.1500015258789,12.648253440856934,111.33000183105469,25.969999313354492,33.619998931884766,48.08000183105469,43.72999954223633,53.0,55.09000015258789,133.0,96.51000213623047,81.55999755859375,105.06999969482422,123.80000305175781\n2011-05-27,47.75,26.299999237060547,111.1500015258789,40.36000061035156,60.79999923706055,96.44000244140625,27.239999771118164,36.900001525878906,39.349998474121094,76.33999633789062,12.737611770629883,111.44999694824219,26.100000381469727,33.619998931884766,48.5,44.18000030517578,53.5099983215332,55.27000045776367,133.50999450683594,96.47000122070312,81.58999633789062,105.0999984741211,124.2300033569336\n2011-05-31,48.529998779296875,27.149999618530273,110.86000061035156,41.08000183105469,62.060001373291016,96.58999633789062,28.079999923706055,37.31999969482422,39.75,77.11000061035156,12.867587089538574,111.44000244140625,26.459999084472656,33.869998931884766,49.06999969482422,45.369998931884766,54.66999816894531,56.130001068115234,134.89999389648438,96.69000244140625,81.69000244140625,105.01000213623047,125.5\n2011-06-01,47.65999984741211,26.389999389648438,110.5999984741211,40.560001373291016,60.59000015258789,97.13999938964844,27.309999465942383,36.29999923706055,38.5099983215332,75.2699966430664,12.437043190002441,111.56999969482422,25.90999984741211,33.52000045776367,47.939998626708984,44.47999954223633,53.25,55.150001525878906,131.8699951171875,97.63999938964844,81.86000061035156,105.01000213623047,122.69999694824219\n2011-06-02,48.11000061035156,26.540000915527344,110.19999694824219,40.599998474121094,60.900001525878906,96.55999755859375,27.549999237060547,36.36000061035156,38.56999969482422,75.23999786376953,12.44516658782959,110.55999755859375,25.93000030517578,33.41999816894531,48.060001373291016,44.59000015258789,53.61000061035156,55.25,131.72999572753906,95.77999877929688,81.52999877929688,104.88999938964844,122.30000305175781\n2011-06-03,47.869998931884766,26.81999969482422,110.37000274658203,40.2400016784668,60.93000030517578,96.94000244140625,27.649999618530273,36.439998626708984,38.08000183105469,75.26000213623047,12.363931655883789,110.80000305175781,25.540000915527344,33.189998626708984,47.65999984741211,43.709999084472656,53.77000045776367,54.86000061035156,130.4199981689453,96.33000183105469,81.66999816894531,104.9800033569336,121.31999969482422\n2011-06-06,47.099998474121094,26.43000030517578,110.41999816894531,39.84000015258789,60.13999938964844,96.87999725341797,27.219999313354492,36.13999938964844,37.70000076293945,73.55999755859375,12.128351211547852,110.61000061035156,25.350000381469727,33.040000915527344,47.33000183105469,43.279998779296875,52.91999816894531,54.310001373291016,129.0399932861328,95.5999984741211,81.62000274658203,104.91999816894531,120.7300033569336\n2011-06-07,47.470001220703125,26.739999771118164,110.58000183105469,40.15999984741211,60.689998626708984,97.05999755859375,27.549999237060547,36.459999084472656,37.84000015258789,73.55999755859375,12.10398006439209,110.98999786376953,25.270000457763672,33.08000183105469,47.619998931884766,43.54999923706055,53.439998626708984,54.720001220703125,128.9600067138672,96.04000091552734,81.72000122070312,104.95999908447266,120.48999786376953\n2011-06-08,47.130001068115234,26.440000534057617,110.56999969482422,40.119998931884766,59.90999984741211,97.2699966430664,27.1200008392334,36.060001373291016,37.45000076293945,73.77999877929688,11.990251541137695,111.05999755859375,25.100000381469727,33.15999984741211,46.900001525878906,43.31999969482422,52.5099983215332,54.310001373291016,128.4199981689453,96.79000091552734,81.87999725341797,105.01000213623047,120.30000305175781\n2011-06-09,47.5,26.84000015258789,110.44000244140625,40.400001525878906,60.529998779296875,96.87999725341797,27.479999542236328,36.47999954223633,38.06999969482422,74.77999877929688,12.128351211547852,110.76000213623047,25.1200008392334,33.189998626708984,47.540000915527344,43.38999938964844,53.20000076293945,54.90999984741211,129.39999389648438,96.4000015258789,81.69000244140625,104.94999694824219,121.12000274658203\n2011-06-10,46.470001220703125,26.09000015258789,110.4000015258789,40.0,59.130001068115234,97.19000244140625,26.6299991607666,35.459999084472656,37.59000015258789,73.33000183105469,12.04711627960205,110.62999725341797,24.770000457763672,32.970001220703125,46.47999954223633,42.31999969482422,51.630001068115234,54.11000061035156,127.5999984741211,97.13999938964844,81.79000091552734,104.9800033569336,119.37000274658203\n2011-06-13,46.38999938964844,26.219999313354492,110.38999938964844,40.0,59.220001220703125,96.9800033569336,26.639999389648438,35.65999984741211,37.369998931884766,72.16999816894531,12.168968200683594,110.75,24.790000915527344,33.119998931884766,46.61000061035156,42.619998931884766,51.880001068115234,54.150001525878906,127.69999694824219,96.6500015258789,81.70999908447266,105.06999969482422,119.45999908447266\n2011-06-14,47.09000015258789,26.790000915527344,110.08999633789062,40.79999923706055,60.27000045776367,96.20999908447266,27.209999084472656,36.060001373291016,38.09000015258789,73.70999908447266,12.233956336975098,110.41999816894531,25.100000381469727,33.25,47.58000183105469,43.130001068115234,52.72999954223633,55.209999084472656,129.32000732421875,95.19000244140625,81.37000274658203,104.9000015258789,120.69999694824219\n2011-06-15,46.08000183105469,25.899999618530273,110.66000366210938,40.0,58.290000915527344,97.25,26.1200008392334,35.040000915527344,37.209999084472656,72.0199966430664,11.96588134765625,111.02999877929688,24.6299991607666,32.84000015258789,46.40999984741211,42.34000015258789,50.720001220703125,53.959999084472656,127.0199966430664,96.91999816894531,81.69999694824219,105.0,118.87999725341797\n2011-06-16,45.72999954223633,25.860000610351562,110.58000183105469,39.880001068115234,58.09000015258789,97.5199966430664,26.049999237060547,34.70000076293945,36.849998474121094,72.12999725341797,12.030869483947754,110.81999969482422,24.56999969482422,33.099998474121094,45.9900016784668,42.08000183105469,50.56999969482422,53.68000030517578,127.30000305175781,97.36000061035156,81.75,105.08999633789062,119.52999877929688\n2011-06-17,45.790000915527344,26.290000915527344,110.5199966430664,40.0,58.65999984741211,97.44999694824219,26.530000686645508,34.97999954223633,36.63999938964844,71.68000030517578,12.095856666564941,110.86000061035156,24.450000762939453,32.9900016784668,46.369998931884766,42.08000183105469,51.38999938964844,53.970001220703125,127.05000305175781,96.9000015258789,81.83000183105469,105.12999725341797,119.73999786376953\n2011-06-20,45.720001220703125,26.3700008392334,110.22000122070312,40.040000915527344,58.59000015258789,97.30000305175781,26.469999313354492,35.040000915527344,36.95000076293945,71.87999725341797,12.087733268737793,110.87999725341797,24.540000915527344,33.18000030517578,46.08000183105469,41.95000076293945,51.209999084472656,53.88999938964844,127.69999694824219,97.0199966430664,81.7300033569336,105.04000091552734,120.54000091552734\n2011-06-21,46.560001373291016,27.06999969482422,110.48999786376953,40.720001220703125,59.86000061035156,97.16999816894531,27.15999984741211,35.68000030517578,37.900001525878906,73.30999755859375,12.258326530456543,110.8499984741211,24.979999542236328,33.20000076293945,46.880001068115234,41.900001525878906,52.459999084472656,54.7400016784668,129.4499969482422,96.58999633789062,81.75,105.0999984741211,121.58999633789062\n2011-06-22,45.63999938964844,26.139999389648438,110.23999786376953,40.31999969482422,58.150001525878906,97.12999725341797,26.440000534057617,34.58000183105469,37.7400016784668,73.0999984741211,12.18521499633789,111.0,24.799999237060547,32.97999954223633,45.709999084472656,41.11000061035156,51.7400016784668,54.540000915527344,128.6699981689453,96.6500015258789,81.7699966430664,105.11000061035156,120.80999755859375\n2011-06-23,45.58000183105469,25.829999923706055,111.04000091552734,40.2400016784668,57.650001525878906,97.63999938964844,26.049999237060547,34.20000076293945,37.709999084472656,72.30000305175781,12.063363075256348,111.29000091552734,24.969999313354492,32.70000076293945,45.529998779296875,41.27000045776367,51.06999969482422,54.38999938964844,128.3000030517578,97.38999938964844,81.97000122070312,105.20999908447266,120.31999969482422\n2011-06-24,45.5,25.360000610351562,111.47000122070312,40.47999954223633,57.099998474121094,98.05000305175781,25.639999389648438,33.939998626708984,37.470001220703125,70.93000030517578,11.990251541137695,111.3499984741211,24.540000915527344,32.79999923706055,45.209999084472656,41.63999938964844,50.29999923706055,54.40999984741211,126.80999755859375,96.9800033569336,82.05000305175781,105.20999908447266,119.19999694824219\n2011-06-27,46.029998779296875,25.6299991607666,111.29000091552734,40.279998779296875,57.56999969482422,97.66999816894531,25.989999771118164,34.20000076293945,37.54999923706055,71.30999755859375,12.112104415893555,110.98999786376953,24.8700008392334,33.040000915527344,45.349998474121094,42.349998474121094,51.0099983215332,54.400001525878906,127.94000244140625,95.6500015258789,81.80999755859375,105.13999938964844,120.19999694824219\n2011-06-28,46.65999984741211,25.989999771118164,110.8499984741211,40.7599983215332,58.2599983215332,96.7699966430664,26.440000534057617,34.560001373291016,38.279998779296875,73.38999938964844,12.168968200683594,110.22000122070312,25.18000030517578,33.189998626708984,46.0099983215332,42.599998474121094,51.650001525878906,55.06999969482422,129.61000061035156,94.87999725341797,81.51000213623047,104.87999725341797,121.61000061035156\n2011-06-29,47.09000015258789,26.420000076293945,110.88999938964844,41.400001525878906,59.279998779296875,96.19000244140625,27.020000457763672,35.099998474121094,38.88999938964844,74.25,12.420796394348145,109.97000122070312,25.3799991607666,33.40999984741211,46.66999816894531,42.45000076293945,52.650001525878906,55.84000015258789,130.72000122070312,94.25,81.33000183105469,104.91999816894531,122.44999694824219\n2011-06-30,47.599998474121094,26.889999389648438,110.63999938964844,41.720001220703125,60.13999938964844,95.86000061035156,27.639999389648438,35.619998931884766,39.369998931884766,75.3499984741211,12.469536781311035,110.12999725341797,25.700000762939453,33.47999954223633,47.61000061035156,42.95000076293945,53.529998779296875,56.540000915527344,131.97000122070312,94.0999984741211,81.16000366210938,104.94999694824219,123.83000183105469\n2011-07-01,48.15999984741211,27.139999389648438,110.01000213623047,42.08000183105469,60.79999923706055,95.38999938964844,27.899999618530273,35.97999954223633,39.72999954223633,76.05999755859375,12.69699478149414,109.70999908447266,26.1200008392334,33.880001068115234,48.0099983215332,43.29999923706055,54.06999969482422,57.029998779296875,133.9199981689453,93.62999725341797,80.9800033569336,104.5999984741211,125.58000183105469\n2011-07-05,48.13999938964844,26.950000762939453,110.12999725341797,42.15999984741211,60.439998626708984,95.98999786376953,27.43000030517578,35.97999954223633,39.779998779296875,76.52999877929688,12.58326530456543,110.0999984741211,26.15999984741211,33.68000030517578,47.310001373291016,42.970001220703125,53.68000030517578,56.75,133.80999755859375,93.83999633789062,81.25,104.66000366210938,125.48999786376953\n2011-07-06,47.81999969482422,26.799999237060547,110.44999694824219,42.400001525878906,60.060001373291016,96.16000366210938,27.110000610351562,35.880001068115234,39.939998626708984,76.38999938964844,12.518278121948242,110.33000183105469,26.280000686645508,33.75,47.08000183105469,42.41999816894531,53.119998931884766,56.900001525878906,133.97000122070312,94.31999969482422,81.30000305175781,104.69999694824219,126.08999633789062\n2011-07-07,48.47999954223633,27.06999969482422,110.41000366210938,42.68000030517578,60.58000183105469,95.79000091552734,27.34000015258789,36.060001373291016,40.540000915527344,77.54000091552734,12.721364974975586,110.36000061035156,26.600000381469727,33.88999938964844,47.779998779296875,42.79999923706055,53.630001068115234,57.47999954223633,135.36000061035156,94.04000091552734,81.12999725341797,104.66999816894531,127.0999984741211\n2011-07-08,47.93000030517578,26.639999389648438,110.91000366210938,42.31999969482422,59.83000183105469,96.80999755859375,26.760000228881836,35.880001068115234,40.22999954223633,76.88999938964844,12.558895111083984,111.06999969482422,26.469999313354492,33.7599983215332,47.52000045776367,42.27000045776367,52.7400016784668,57.08000183105469,134.39999389648438,95.37000274658203,81.55000305175781,104.69000244140625,126.38999938964844\n2011-07-11,46.59000015258789,25.40999984741211,111.52999877929688,41.79999923706055,58.02000045776367,97.55000305175781,25.3799991607666,34.959999084472656,39.41999816894531,75.06999969482422,12.2177095413208,111.44000244140625,26.030000686645508,33.400001525878906,46.22999954223633,41.279998779296875,50.79999923706055,56.060001373291016,131.97000122070312,96.80000305175781,81.79000091552734,104.87999725341797,124.94999694824219\n2011-07-12,46.119998931884766,25.15999984741211,111.9800033569336,41.91999816894531,57.630001068115234,97.69000244140625,25.139999389648438,34.599998474121094,39.2599983215332,74.79000091552734,12.168968200683594,111.52999877929688,25.799999237060547,33.54999923706055,45.75,40.88999938964844,50.310001373291016,55.959999084472656,131.39999389648438,97.12999725341797,81.87000274658203,104.83000183105469,124.33000183105469\n2011-07-13,46.869998931884766,25.68000030517578,112.19000244140625,42.720001220703125,58.4900016784668,97.8499984741211,25.479999542236328,35.099998474121094,39.599998474121094,75.3499984741211,12.177091598510742,111.80999755859375,25.860000610351562,33.459999084472656,46.40999984741211,41.5,51.119998931884766,56.83000183105469,131.83999633789062,97.4000015258789,81.9800033569336,104.88999938964844,124.80000305175781\n2011-07-14,46.369998931884766,25.489999771118164,111.5199966430664,42.31999969482422,57.97999954223633,97.29000091552734,25.239999771118164,34.91999816894531,39.220001220703125,74.8499984741211,12.087733268737793,111.12000274658203,25.639999389648438,33.310001373291016,45.93000030517578,41.20000076293945,50.66999816894531,56.290000915527344,130.92999267578125,96.01000213623047,81.66999816894531,104.8499984741211,124.20999908447266\n2011-07-15,46.65999984741211,25.690000534057617,111.87000274658203,42.63999938964844,58.18000030517578,97.69000244140625,25.260000228881836,35.0,39.56999969482422,76.86000061035156,12.063363075256348,111.37000274658203,25.920000076293945,33.36000061035156,45.90999984741211,41.33000183105469,50.790000915527344,56.540000915527344,131.69000244140625,96.16999816894531,81.81999969482422,104.91000366210938,124.55999755859375\n2011-07-18,46.119998931884766,25.299999237060547,111.97000122070312,42.119998931884766,57.31999969482422,97.62999725341797,24.739999771118164,34.58000183105469,39.099998474121094,76.5999984741211,11.900893211364746,110.94000244140625,25.829999923706055,33.040000915527344,45.369998931884766,41.209999084472656,49.77000045776367,55.91999816894531,130.61000061035156,95.23999786376953,81.70999908447266,104.77999877929688,123.62000274658203\n2011-07-19,46.790000915527344,25.670000076293945,112.52999877929688,42.63999938964844,58.18000030517578,98.0,25.110000610351562,34.959999084472656,39.689998626708984,78.0,12.04711627960205,111.4800033569336,26.450000762939453,33.33000183105469,46.369998931884766,41.77000045776367,50.619998931884766,56.72999954223633,132.72999572753906,97.22000122070312,81.93000030517578,104.77999877929688,125.62999725341797\n2011-07-20,46.93000030517578,25.809999465942383,111.88999938964844,43.08000183105469,58.869998931884766,97.5199966430664,25.520000457763672,35.34000015258789,39.65999984741211,77.80000305175781,12.18521499633789,111.22000122070312,26.3700008392334,33.529998779296875,46.86000061035156,41.939998626708984,51.310001373291016,57.2400016784668,132.64999389648438,96.06999969482422,81.80000305175781,104.87999725341797,125.45999908447266\n2011-07-21,47.68000030517578,26.3799991607666,111.66000366210938,43.439998626708984,60.119998931884766,96.9800033569336,26.40999984741211,36.040000915527344,40.13999938964844,79.33000183105469,12.477660179138184,111.05000305175781,26.489999771118164,34.029998779296875,47.59000015258789,42.18000030517578,52.68000030517578,57.91999816894531,134.49000549316406,95.33000183105469,81.62000274658203,104.91000366210938,127.02999877929688\n2011-07-22,47.650001525878906,26.469999313354492,112.02999877929688,43.52000045776367,60.18000030517578,97.3499984741211,26.459999084472656,36.15999984741211,39.95000076293945,79.7300033569336,12.44516658782959,111.5,26.719999313354492,33.81999969482422,47.79999923706055,42.439998626708984,52.68000030517578,58.16999816894531,134.5800018310547,96.05000305175781,81.83999633789062,104.94000244140625,126.5999984741211\n2011-07-25,47.54999923706055,26.559999465942383,112.1500015258789,43.36000061035156,59.79999923706055,97.04000091552734,26.280000686645508,35.939998626708984,39.849998474121094,79.41000366210938,12.35580825805664,110.97000122070312,26.649999618530273,33.939998626708984,47.31999969482422,42.18000030517578,52.33000183105469,57.790000915527344,133.8300018310547,95.0,81.56999969482422,104.7699966430664,125.76000213623047\n2011-07-26,47.709999084472656,26.770000457763672,112.19000244140625,43.439998626708984,60.15999984741211,97.44999694824219,26.260000228881836,36.29999923706055,39.41999816894531,79.02999877929688,12.339561462402344,111.45999908447266,26.770000457763672,33.81999969482422,47.7400016784668,42.65999984741211,52.7599983215332,58.0099983215332,133.3300018310547,95.6500015258789,81.7699966430664,104.91999816894531,124.83000183105469\n2011-07-27,46.869998931884766,25.969999313354492,112.4000015258789,42.720001220703125,58.70000076293945,97.29000091552734,25.489999771118164,35.459999084472656,38.52000045776367,77.54000091552734,12.04711627960205,111.12999725341797,26.059999465942383,33.720001220703125,47.11000061035156,42.060001373291016,51.20000076293945,57.20000076293945,130.60000610351562,95.66000366210938,81.5999984741211,104.87000274658203,122.83999633789062\n2011-07-28,46.90999984741211,25.610000610351562,112.86000061035156,42.63999938964844,58.560001373291016,97.4800033569336,25.190000534057617,35.540000915527344,38.439998626708984,77.22000122070312,12.0552396774292,111.37000274658203,26.020000457763672,33.5099983215332,47.16999816894531,42.36000061035156,51.040000915527344,57.119998931884766,130.22000122070312,96.0199966430664,81.83999633789062,105.0,122.27999877929688\n2011-07-29,47.11000061035156,25.719999313354492,114.16999816894531,42.84000015258789,58.709999084472656,98.66000366210938,25.15999984741211,35.47999954223633,38.0099983215332,76.44999694824219,12.022746086120605,112.37000274658203,25.809999465942383,33.16999816894531,46.86000061035156,42.36000061035156,51.06999969482422,57.09000015258789,129.3300018310547,97.91999816894531,82.26000213623047,104.95999908447266,121.12999725341797\n2011-08-01,47.06999969482422,24.979999542236328,113.9000015258789,42.439998626708984,57.970001220703125,98.77999877929688,24.65999984741211,35.2599983215332,37.880001068115234,76.33999633789062,11.982128143310547,112.27999877929688,25.790000915527344,33.27000045776367,47.08000183105469,42.220001220703125,50.18000030517578,56.9900016784668,128.77999877929688,98.58000183105469,82.30000305175781,105.08999633789062,121.11000061035156\n2011-08-02,45.619998931884766,23.90999984741211,114.6500015258789,42.08000183105469,56.439998626708984,99.69000244140625,23.739999771118164,34.380001068115234,36.709999084472656,74.20999908447266,11.65718936920166,113.22000122070312,25.25,32.70000076293945,45.75,41.150001525878906,48.619998931884766,56.040000915527344,125.48999786376953,101.54000091552734,82.6500015258789,105.1500015258789,118.45999908447266\n2011-08-03,45.459999084472656,24.110000610351562,113.94000244140625,42.15999984741211,56.77000045776367,99.7699966430664,23.950000762939453,34.47999954223633,36.900001525878906,73.79000091552734,11.7140531539917,113.18000030517578,25.510000228881836,32.70000076293945,45.400001525878906,40.93000030517578,49.06999969482422,55.90999984741211,126.16999816894531,101.73999786376953,82.70999908447266,105.0199966430664,118.80000305175781\n2011-08-04,42.86000061035156,22.170000076293945,114.94000244140625,39.599998474121094,52.810001373291016,101.08999633789062,22.0,32.060001373291016,34.400001525878906,68.7300033569336,11.121039390563965,114.0,24.479999542236328,31.6299991607666,42.599998474121094,39.2400016784668,45.349998474121094,52.45000076293945,120.26000213623047,105.36000061035156,83.20999908447266,105.06999969482422,113.70999908447266\n2011-08-05,42.58000183105469,22.639999389648438,113.62999725341797,39.959999084472656,53.7400016784668,99.91999816894531,22.81999969482422,32.380001068115234,34.31999969482422,68.06999969482422,10.909829139709473,112.58999633789062,24.329999923706055,31.889999389648438,42.029998779296875,38.7599983215332,46.70000076293945,52.459999084472656,120.08000183105469,102.31999969482422,82.66999816894531,104.94999694824219,114.25\n2011-08-08,39.029998779296875,20.329999923706055,115.0,38.040000915527344,49.72999954223633,101.51000213623047,20.68000030517578,29.860000610351562,31.809999465942383,62.279998779296875,9.878148078918457,111.5199966430664,22.959999084472656,30.200000762939453,38.900001525878906,35.9900016784668,42.45000076293945,49.529998779296875,112.26000213623047,105.55000305175781,83.05999755859375,104.94999694824219,108.06999969482422\n2011-08-09,41.31999969482422,21.540000915527344,115.95999908447266,40.0,53.08000183105469,102.0999984741211,22.100000381469727,31.979999542236328,33.77000045776367,65.44999694824219,10.641755104064941,112.5199966430664,24.010000228881836,31.190000534057617,42.08000183105469,37.459999084472656,46.0099983215332,52.5099983215332,117.4800033569336,105.87000274658203,83.3499984741211,104.55000305175781,112.37000274658203\n2011-08-10,39.130001068115234,20.010000228881836,118.0999984741211,38.15999984741211,49.90999984741211,103.44999694824219,20.43000030517578,30.020000457763672,32.61000061035156,63.189998626708984,9.902518272399902,113.52999877929688,23.06999969482422,30.600000381469727,39.939998626708984,35.119998931884766,42.54999923706055,50.15999984741211,112.29000091552734,109.0199966430664,84.01000213623047,104.73999786376953,107.16999816894531\n2011-08-11,41.290000915527344,20.989999771118164,115.63999938964844,39.599998474121094,52.29999923706055,101.93000030517578,21.34000015258789,31.739999771118164,34.220001220703125,66.47000122070312,10.454915046691895,111.19999694824219,23.950000762939453,31.889999389648438,42.150001525878906,37.02000045776367,44.90999984741211,52.16999816894531,117.33000183105469,103.5199966430664,83.19999694824219,104.63999938964844,111.25\n2011-08-12,41.27000045776367,21.530000686645508,116.30000305175781,39.2400016784668,52.900001525878906,102.63999938964844,22.049999237060547,32.380001068115234,34.439998626708984,66.95999908447266,10.381803512573242,112.47000122070312,24.1200008392334,31.700000762939453,42.310001373291016,36.709999084472656,45.720001220703125,52.13999938964844,118.12000274658203,105.56999969482422,83.47000122070312,104.44999694824219,112.80000305175781\n2011-08-15,42.22999954223633,22.09000015258789,115.70999908447266,39.720001220703125,54.130001068115234,102.26000213623047,22.700000762939453,33.060001373291016,34.9900016784668,69.22000122070312,10.714865684509277,112.68000030517578,24.549999237060547,32.779998779296875,43.91999816894531,38.08000183105469,46.84000015258789,53.150001525878906,120.62000274658203,104.5,83.33000183105469,104.7300033569336,114.80999755859375\n2011-08-16,41.869998931884766,21.559999465942383,115.97000122070312,39.400001525878906,53.34000015258789,102.7300033569336,22.25,32.720001220703125,34.43000030517578,68.06999969482422,10.503655433654785,113.08999633789062,24.3700008392334,32.7400016784668,43.0099983215332,37.81999969482422,45.939998626708984,52.4900016784668,119.58999633789062,106.2300033569336,83.58000183105469,104.69999694824219,114.08000183105469\n2011-08-17,42.16999816894531,21.459999084472656,116.56999969482422,39.439998626708984,53.650001525878906,103.44999694824219,22.479999542236328,32.91999816894531,34.529998779296875,68.33999633789062,10.568643569946289,113.4000015258789,24.260000228881836,32.97999954223633,43.650001525878906,37.66999816894531,46.20000076293945,52.779998779296875,119.66999816894531,108.08999633789062,83.7300033569336,104.77999877929688,114.26000213623047\n2011-08-18,40.18000030517578,20.170000076293945,115.68000030517578,38.08000183105469,51.040000915527344,103.98999786376953,21.1200008392334,31.420000076293945,32.52000045776367,64.37999725341797,10.056864738464355,113.55000305175781,23.079999923706055,32.59000015258789,41.68000030517578,36.20000076293945,43.72999954223633,50.880001068115234,114.51000213623047,110.30999755859375,83.91000366210938,104.45999908447266,110.06999969482422\n2011-08-19,39.68000030517578,19.6200008392334,116.06999969482422,37.720001220703125,50.16999816894531,104.0999984741211,20.700000762939453,30.799999237060547,32.0,63.2400016784668,9.853777885437012,113.41000366210938,22.520000457763672,32.38999938964844,41.209999084472656,35.880001068115234,42.880001068115234,50.279998779296875,112.63999938964844,111.19999694824219,83.98999786376953,104.54000091552734,107.91000366210938\n2011-08-22,39.63999938964844,19.6200008392334,116.04000091552734,37.79999923706055,50.4900016784668,103.91000366210938,20.959999084472656,31.219999313354492,32.0,62.72999954223633,9.731925010681152,112.98999786376953,22.639999389648438,32.310001373291016,41.310001373291016,35.66999816894531,43.5099983215332,50.41999816894531,112.7300033569336,110.91999816894531,83.80000305175781,104.68000030517578,108.30000305175781\n2011-08-23,41.029998779296875,20.399999618530273,115.31999969482422,38.52000045776367,52.130001068115234,103.48999786376953,21.780000686645508,32.18000030517578,33.130001068115234,65.55999755859375,10.04874038696289,111.69999694824219,23.469999313354492,32.88999938964844,43.099998474121094,37.310001373291016,45.0,51.849998474121094,116.44000244140625,109.38999938964844,83.55000305175781,104.55000305175781,111.37000274658203\n2011-08-24,40.630001068115234,20.700000762939453,113.62000274658203,38.08000183105469,52.150001525878906,102.37999725341797,21.920000076293945,32.20000076293945,33.599998474121094,65.94999694824219,10.316815376281738,110.37999725341797,23.68000030517578,33.599998474121094,42.849998474121094,36.880001068115234,45.189998626708984,51.380001068115234,118.08000183105469,106.27999877929688,83.06999969482422,104.3499984741211,112.94999694824219\n2011-08-25,39.84000015258789,20.010000228881836,114.51000213623047,37.560001373291016,50.88999938964844,103.01000213623047,21.440000534057617,31.15999984741211,33.22999954223633,64.55999755859375,10.284321784973145,110.98999786376953,23.34000015258789,33.04999923706055,42.15999984741211,36.630001068115234,43.81999969482422,50.630001068115234,116.27999877929688,107.43000030517578,83.30000305175781,104.45999908447266,111.26000213623047\n2011-08-26,40.52000045776367,20.31999969482422,114.8499984741211,38.36000061035156,51.689998626708984,103.33999633789062,21.610000610351562,31.540000915527344,33.93000030517578,65.80999755859375,10.373680114746094,111.04000091552734,23.799999237060547,33.0,43.11000061035156,36.959999084472656,44.380001068115234,51.63999938964844,117.97000122070312,108.48999786376953,83.4000015258789,104.5199966430664,112.69999694824219\n2011-08-29,41.83000183105469,20.8799991607666,114.16999816894531,38.880001068115234,52.91999816894531,102.66000366210938,22.209999084472656,32.36000061035156,34.959999084472656,67.7300033569336,10.804224014282227,111.4000015258789,24.399999618530273,33.650001525878906,44.22999954223633,37.970001220703125,45.7400016784668,52.58000183105469,121.36000061035156,106.98999786376953,83.19999694824219,104.69000244140625,115.13999938964844\n2011-08-30,41.88999938964844,20.68000030517578,114.83999633789062,38.720001220703125,52.61000061035156,103.37000274658203,22.110000610351562,32.220001220703125,35.25,68.12999725341797,10.731112480163574,111.98999786376953,24.5,33.66999816894531,44.18000030517578,37.939998626708984,45.36000061035156,52.459999084472656,121.68000030517578,108.70999908447266,83.51000213623047,104.5999984741211,115.3499984741211\n2011-08-31,42.75,20.920000076293945,114.31999969482422,39.400001525878906,53.56999969482422,103.0,22.579999923706055,32.7599983215332,35.34000015258789,68.63999938964844,10.86921215057373,112.33000183105469,24.440000534057617,33.88999938964844,44.68000030517578,38.630001068115234,46.33000183105469,53.34000015258789,122.22000122070312,107.02999877929688,83.4000015258789,104.69999694824219,115.94999694824219\n2011-09-01,42.52000045776367,20.399999618530273,115.3499984741211,39.040000915527344,52.90999984741211,103.58999633789062,22.25,32.560001373291016,34.86000061035156,68.12000274658203,10.625507354736328,112.0,24.170000076293945,33.66999816894531,44.290000915527344,38.09000015258789,45.66999816894531,52.84000015258789,120.94000244140625,108.97000122070312,83.54000091552734,104.55999755859375,114.87000274658203\n2011-09-02,41.560001373291016,19.75,116.61000061035156,38.400001525878906,51.72999954223633,104.54000091552734,21.40999984741211,32.0,33.970001220703125,66.22000122070312,10.186840057373047,112.69000244140625,23.6200008392334,33.290000915527344,43.18000030517578,37.119998931884766,44.54999923706055,51.790000915527344,117.8499984741211,112.51000213623047,83.7699966430664,104.27999877929688,112.27999877929688\n2011-09-06,41.130001068115234,18.709999084472656,115.91999816894531,37.560001373291016,50.029998779296875,104.68000030517578,20.3700008392334,31.239999771118164,33.790000915527344,65.5,10.008123397827148,113.3499984741211,23.510000228881836,33.130001068115234,42.54999923706055,37.16999816894531,42.59000015258789,50.720001220703125,116.98999786376953,113.68000030517578,83.88999938964844,104.44000244140625,111.20999908447266\n2011-09-07,42.349998474121094,19.459999084472656,115.61000061035156,38.279998779296875,51.52000045776367,104.12000274658203,21.100000381469727,32.119998931884766,34.7599983215332,67.9000015258789,10.487408638000488,113.56999969482422,24.1200008392334,33.5,44.040000915527344,37.849998474121094,43.95000076293945,52.02000045776367,120.29000091552734,111.51000213623047,83.69999694824219,104.5199966430664,113.94000244140625\n2011-09-08,41.40999984741211,18.809999465942383,116.30000305175781,37.79999923706055,50.5,104.62999725341797,20.56999969482422,31.719999313354492,34.29999923706055,67.11000061035156,10.2599515914917,113.47000122070312,24.0,33.47999954223633,43.029998779296875,36.95000076293945,42.9900016784668,51.29999923706055,119.04000091552734,112.51000213623047,83.80999755859375,104.54000091552734,112.87000274658203\n2011-09-09,40.0099983215332,17.81999969482422,116.44000244140625,36.91999816894531,48.75,105.13999938964844,19.59000015258789,30.8799991607666,33.16999816894531,64.88999938964844,9.935011863708496,113.58999633789062,23.489999771118164,32.79999923706055,41.779998779296875,35.95000076293945,41.22999954223633,50.060001373291016,115.91999816894531,113.70999908447266,83.87999725341797,104.45999908447266,109.81999969482422\n2011-09-12,39.93000030517578,17.780000686645508,116.04000091552734,37.279998779296875,48.540000915527344,104.81999969482422,19.149999618530273,30.899999618530273,32.95000076293945,65.19999694824219,10.04874038696289,112.9000015258789,23.770000457763672,33.06999969482422,41.25,35.790000915527344,41.02000045776367,50.0099983215332,116.66999816894531,113.83000183105469,83.62999725341797,104.16999816894531,110.51000213623047\n2011-09-13,39.9900016784668,18.0,115.54000091552734,37.91999816894531,49.060001373291016,104.51000213623047,19.280000686645508,30.920000076293945,33.4900016784668,65.37999725341797,10.113728523254395,112.87999725341797,24.049999237060547,33.290000915527344,41.31999969482422,35.880001068115234,41.31999969482422,50.619998931884766,117.73999786376953,112.20999908447266,83.54000091552734,104.37999725341797,110.91999816894531\n2011-09-14,39.880001068115234,18.770000457763672,115.4000015258789,38.08000183105469,49.79999923706055,104.56999969482422,19.850000381469727,31.440000534057617,34.0099983215332,66.19000244140625,10.235580444335938,112.83000183105469,24.40999984741211,33.52000045776367,40.959999084472656,35.970001220703125,42.310001373291016,50.52000045776367,119.37000274658203,113.16000366210938,83.72000122070312,104.27999877929688,112.4000015258789\n2011-09-15,40.459999084472656,19.479999542236328,115.16999816894531,38.52000045776367,50.880001068115234,103.79000091552734,20.59000015258789,32.02000045776367,34.59000015258789,67.5,10.495532035827637,112.44000244140625,24.799999237060547,33.939998626708984,41.650001525878906,36.36000061035156,43.400001525878906,51.33000183105469,121.43000030517578,111.43000030517578,83.55999755859375,104.33000183105469,114.26000213623047\n2011-09-16,40.529998779296875,19.469999313354492,115.20999908447266,38.91999816894531,50.900001525878906,103.98999786376953,20.280000686645508,32.040000915527344,34.52000045776367,67.08999633789062,10.487408638000488,112.44000244140625,24.979999542236328,33.97999954223633,41.93000030517578,36.619998931884766,43.16999816894531,51.63999938964844,121.5199966430664,112.23999786376953,83.52999877929688,104.19999694824219,114.86000061035156\n2011-09-19,39.33000183105469,18.780000686645508,115.5,38.36000061035156,49.5,104.83999633789062,19.610000610351562,31.15999984741211,34.0099983215332,66.02999877929688,10.203086853027344,113.05999755859375,24.920000076293945,33.790000915527344,40.630001068115234,35.40999984741211,41.79999923706055,50.709999084472656,120.30999755859375,114.37999725341797,83.79000091552734,104.33999633789062,113.72000122070312\n2011-09-20,39.040000915527344,18.979999542236328,116.0,38.31999969482422,49.70000076293945,104.9800033569336,19.600000381469727,31.479999542236328,33.61000061035156,65.62000274658203,10.17059326171875,113.11000061035156,24.860000610351562,34.279998779296875,40.369998931884766,35.220001220703125,42.2400016784668,50.529998779296875,120.16999816894531,114.86000061035156,83.9000015258789,104.20999908447266,113.87999725341797\n2011-09-21,37.59000015258789,18.270000457763672,116.19999694824219,37.84000015258789,48.220001220703125,105.43000030517578,19.0,30.31999969482422,32.09000015258789,62.88999938964844,9.666937828063965,113.37000274658203,24.489999771118164,33.650001525878906,39.040000915527344,33.66999816894531,40.790000915527344,49.380001068115234,116.62999725341797,118.66000366210938,84.12999725341797,104.16999816894531,110.94999694824219\n2011-09-22,34.95000076293945,17.520000457763672,115.93000030517578,37.2400016784668,46.65999984741211,106.41000366210938,18.219999313354492,29.18000030517578,30.290000915527344,59.34000015258789,9.390739440917969,113.58999633789062,23.729999542236328,33.08000183105469,37.130001068115234,31.530000686645508,39.25,48.11000061035156,112.86000061035156,123.12000274658203,84.33000183105469,103.87000274658203,107.06999969482422\n2011-09-23,35.880001068115234,17.75,115.26000213623047,37.36000061035156,47.189998626708984,105.52999877929688,18.389999389648438,29.420000076293945,30.239999771118164,58.70000076293945,9.488221168518066,112.88999938964844,24.0,33.40999984741211,37.470001220703125,32.27000045776367,40.349998474121094,48.459999084472656,113.54000091552734,120.83000183105469,84.05000305175781,103.63999938964844,107.44999694824219\n2011-09-26,36.41999816894531,18.389999389648438,114.70999908447266,37.560001373291016,48.15999984741211,105.08999633789062,18.8700008392334,30.1200008392334,31.209999084472656,60.84000015258789,9.91064167022705,112.68000030517578,24.299999237060547,33.68000030517578,38.189998626708984,32.130001068115234,41.06999969482422,48.91999816894531,116.23999786376953,118.88999938964844,83.79000091552734,103.83000183105469,110.23999786376953\n2011-09-27,37.58000183105469,19.059999465942383,114.91999816894531,38.15999984741211,49.349998474121094,104.38999938964844,19.6299991607666,30.81999969482422,31.860000610351562,61.72999954223633,9.959383010864258,112.31999969482422,24.610000610351562,33.79999923706055,39.150001525878906,33.7599983215332,42.16999816894531,49.970001220703125,117.54000091552734,117.06999969482422,83.62000274658203,103.97000122070312,111.70999908447266\n2011-09-28,36.45000076293945,18.68000030517578,114.87000274658203,38.15999984741211,48.5099983215332,104.41000366210938,19.290000915527344,30.139999389648438,30.450000762939453,59.709999084472656,9.675061225891113,111.87000274658203,24.260000228881836,33.459999084472656,37.90999984741211,32.4900016784668,41.2599983215332,49.2599983215332,115.13999938964844,117.02999877929688,83.44000244140625,104.05999755859375,109.83000183105469\n2011-09-29,36.95000076293945,19.280000686645508,114.51000213623047,38.84000015258789,49.459999084472656,104.41000366210938,19.860000610351562,30.5,30.479999542236328,60.279998779296875,9.943135261535645,111.75,24.209999084472656,34.0,38.2400016784668,32.90999984741211,42.349998474121094,49.939998626708984,116.05000305175781,117.83999633789062,83.43000030517578,104.08000183105469,111.37999725341797\n2011-09-30,35.099998474121094,18.270000457763672,114.30000305175781,37.84000015258789,47.779998779296875,105.06999969482422,19.049999237060547,29.540000915527344,29.360000610351562,58.5099983215332,9.593826293945312,112.30999755859375,23.600000381469727,33.619998931884766,36.77000045776367,30.829999923706055,40.65999984741211,48.459999084472656,113.1500015258789,120.80000305175781,83.73999786376953,103.9800033569336,108.93000030517578\n2011-10-03,34.36000061035156,17.450000762939453,115.25,37.2400016784668,46.52000045776367,105.83000183105469,18.270000457763672,28.959999084472656,28.530000686645508,56.52000045776367,9.163281440734863,112.0999984741211,23.06999969482422,32.81999969482422,35.68000030517578,29.75,39.43000030517578,47.52000045776367,109.93000030517578,123.80999755859375,84.0,104.04000091552734,106.36000061035156\n2011-10-04,34.88999938964844,17.799999237060547,115.33000183105469,37.720001220703125,47.29999923706055,105.29000091552734,18.739999771118164,29.34000015258789,29.639999389648438,58.369998931884766,9.528838157653809,111.12000274658203,23.540000915527344,32.65999984741211,36.209999084472656,29.790000915527344,40.220001220703125,47.970001220703125,112.33999633789062,122.23999786376953,83.66999816894531,103.75,107.72000122070312\n2011-10-05,35.70000076293945,18.399999618530273,115.25,37.560001373291016,48.029998779296875,104.8499984741211,19.260000228881836,29.899999618530273,30.81999969482422,60.52000045776367,9.666937828063965,111.58000183105469,24.030000686645508,32.68000030517578,37.2400016784668,31.0,41.099998474121094,48.36000061035156,114.41999816894531,121.36000061035156,83.30999755859375,103.97000122070312,109.27999877929688\n2011-10-06,36.880001068115234,19.1200008392334,115.23999786376953,37.720001220703125,49.31999969482422,104.12000274658203,19.979999542236328,30.920000076293945,31.600000381469727,61.65999984741211,9.967506408691406,111.12999725341797,24.389999389648438,33.2599983215332,38.63999938964844,31.440000534057617,42.400001525878906,49.2599983215332,116.48999786376953,119.12000274658203,83.26000213623047,104.0,111.08999633789062\n2011-10-07,36.439998626708984,18.950000762939453,114.8499984741211,37.52000045776367,48.97999954223633,103.58000183105469,19.799999237060547,30.959999084472656,31.1200008392334,60.900001525878906,9.61007308959961,111.02999877929688,24.299999237060547,33.400001525878906,38.869998931884766,31.040000915527344,41.86000061035156,49.150001525878906,115.70999908447266,118.23999786376953,83.08000183105469,103.87000274658203,111.0199966430664\n2011-10-10,38.06999969482422,20.06999969482422,114.05999755859375,38.47999954223633,50.849998474121094,102.48999786376953,20.770000457763672,32.02000045776367,32.43000030517578,63.65999984741211,10.105605125427246,111.23999786376953,25.049999237060547,34.04999923706055,40.61000061035156,32.689998626708984,43.84000015258789,50.72999954223633,119.58000183105469,116.56999969482422,82.95999908447266,103.98999786376953,114.20999908447266\n2011-10-11,38.09000015258789,20.1200008392334,114.33000183105469,38.15999984741211,50.7599983215332,102.83000183105469,20.799999237060547,31.780000686645508,32.470001220703125,63.790000915527344,10.097481727600098,111.54000091552734,25.15999984741211,33.7400016784668,40.470001220703125,33.400001525878906,43.7400016784668,50.5,119.69999694824219,116.18000030517578,82.91999816894531,103.88999938964844,114.01000213623047\n2011-10-12,39.15999984741211,20.670000076293945,113.8499984741211,38.400001525878906,51.5,102.4800033569336,21.399999618530273,32.220001220703125,32.790000915527344,64.12999725341797,10.357433319091797,111.70999908447266,25.270000457763672,33.65999984741211,41.29999923706055,34.720001220703125,44.790000915527344,51.029998779296875,120.75,114.48999786376953,82.9000015258789,103.91999816894531,114.98999786376953\n2011-10-13,38.810001373291016,20.579999923706055,113.91999816894531,38.400001525878906,51.52000045776367,102.88999938964844,21.31999969482422,32.29999923706055,32.619998931884766,64.04000091552734,10.113728523254395,111.80999755859375,25.549999237060547,33.65999984741211,41.2400016784668,34.310001373291016,44.560001373291016,51.13999938964844,120.51000213623047,115.62999725341797,83.0,104.12999725341797,114.66000366210938\n2011-10-14,39.59000015258789,20.8700008392334,113.75,38.47999954223633,52.119998931884766,102.37999725341797,21.610000610351562,32.81999969482422,33.47999954223633,66.5999984741211,10.235580444335938,111.73999786376953,26.0,33.97999954223633,42.13999938964844,34.66999816894531,45.33000183105469,51.45000076293945,122.56999969482422,113.94999694824219,82.8499984741211,104.25,116.33999633789062\n2011-10-17,38.25,20.100000381469727,114.18000030517578,38.31999969482422,50.91999816894531,103.05000305175781,20.84000015258789,32.15999984741211,32.34000015258789,65.38999938964844,9.9187650680542,111.66000366210938,25.59000015258789,33.84000015258789,40.90999984741211,33.56999969482422,43.7599983215332,50.90999984741211,120.2300033569336,115.91999816894531,83.13999938964844,104.22000122070312,113.9000015258789\n2011-10-18,39.27000045776367,20.600000381469727,114.7300033569336,38.68000030517578,51.650001525878906,102.94000244140625,21.100000381469727,32.540000915527344,33.16999816894531,67.48999786376953,10.38992691040039,112.05000305175781,25.81999969482422,34.08000183105469,41.47999954223633,34.13999938964844,44.689998626708984,51.380001068115234,122.58000183105469,115.19999694824219,83.05000305175781,104.06999969482422,115.51000213623047\n2011-10-19,38.52000045776367,20.139999389648438,114.55000305175781,38.08000183105469,50.720001220703125,103.0999984741211,20.690000534057617,32.099998474121094,32.209999084472656,66.79000091552734,10.243703842163086,112.33999633789062,25.31999969482422,34.11000061035156,40.77000045776367,33.119998931884766,43.68000030517578,50.58000183105469,121.12999725341797,115.16000366210938,83.2699966430664,104.30000305175781,114.94999694824219\n2011-10-20,37.779998779296875,20.030000686645508,114.56999969482422,37.959999084472656,50.849998474121094,102.88999938964844,20.6299991607666,32.34000015258789,32.5099983215332,67.30999755859375,10.398050308227539,112.58999633789062,25.209999084472656,34.29999923706055,40.58000183105469,32.56999969482422,43.88999938964844,50.31999969482422,121.66000366210938,114.33999633789062,83.2300033569336,104.43000030517578,115.33000183105469\n2011-10-21,38.86000061035156,20.8700008392334,114.44999694824219,38.36000061035156,52.08000183105469,102.69999694824219,21.239999771118164,33.099998474121094,33.369998931884766,68.55000305175781,10.666125297546387,112.95999908447266,25.530000686645508,34.880001068115234,41.52000045776367,33.459999084472656,45.36000061035156,51.040000915527344,123.97000122070312,113.12999725341797,83.0999984741211,104.38999938964844,117.8499984741211\n2011-10-24,40.380001068115234,21.200000762939453,114.79000091552734,38.7599983215332,52.86000061035156,102.6500015258789,21.59000015258789,33.560001373291016,34.16999816894531,69.44999694824219,10.901705741882324,113.54000091552734,25.93000030517578,34.72999954223633,42.720001220703125,35.279998779296875,45.9900016784668,51.9900016784668,125.48999786376953,113.31999969482422,83.16000366210938,104.4000015258789,118.87999725341797\n2011-10-25,39.58000183105469,20.950000762939453,115.81999969482422,38.20000076293945,51.95000076293945,103.52999877929688,21.09000015258789,33.13999938964844,33.29999923706055,68.0,10.576766967773438,114.0999984741211,25.520000457763672,34.34000015258789,41.61000061035156,34.72999954223633,45.220001220703125,51.0,123.05000305175781,116.19999694824219,83.58999633789062,104.37999725341797,116.79000091552734\n2011-10-26,40.310001373291016,21.190000534057617,115.72000122070312,38.279998779296875,52.65999984741211,102.7699966430664,21.5,33.68000030517578,33.900001525878906,69.47000122070312,10.763607025146484,114.0199966430664,25.6299991607666,34.47999954223633,42.290000915527344,36.130001068115234,46.04999923706055,51.400001525878906,124.30000305175781,114.16999816894531,83.37999725341797,104.37999725341797,118.41000366210938\n2011-10-27,42.7599983215332,22.920000076293945,115.05999755859375,39.7599983215332,55.56999969482422,101.52999877929688,23.229999542236328,35.0,35.7400016784668,72.55000305175781,11.40536117553711,114.0,26.389999389648438,35.29999923706055,45.04999923706055,38.209999084472656,48.720001220703125,53.849998474121094,128.6300048828125,110.30000305175781,82.94999694824219,104.5,121.94000244140625\n2011-10-28,42.400001525878906,22.6200008392334,115.45999908447266,39.91999816894531,55.25,102.13999938964844,22.850000381469727,34.70000076293945,35.9900016784668,73.04000091552734,11.413484573364258,114.44000244140625,26.479999542236328,35.0099983215332,44.689998626708984,37.790000915527344,48.09000015258789,53.95000076293945,128.60000610351562,111.45999908447266,83.25,104.62999725341797,122.04000091552734\n2011-10-31,40.810001373291016,21.200000762939453,116.48999786376953,37.599998474121094,52.380001068115234,103.51000213623047,21.5,33.36000061035156,34.45000076293945,69.70999908447266,10.966693878173828,114.69999694824219,26.010000228881836,34.849998474121094,42.68000030517578,36.060001373291016,45.709999084472656,51.09000015258789,125.5,115.87999725341797,83.62000274658203,104.70999908447266,119.33999633789062\n2011-11-01,39.81999969482422,20.079999923706055,117.55000305175781,37.119998931884766,50.7400016784668,104.54000091552734,20.280000686645508,32.52000045776367,33.529998779296875,67.45999908447266,10.446791648864746,114.87000274658203,25.290000915527344,34.119998931884766,41.56999969482422,35.5099983215332,43.810001373291016,50.290000915527344,122.0,119.44999694824219,84.02999877929688,104.4800033569336,116.37999725341797\n2011-11-02,41.040000915527344,20.540000915527344,117.58999633789062,37.2400016784668,51.16999816894531,104.29000091552734,20.549999237060547,32.97999954223633,34.36000061035156,69.48999786376953,10.755483627319336,115.29000091552734,25.600000381469727,34.720001220703125,42.27000045776367,37.439998626708984,44.540000915527344,50.58000183105469,123.98999786376953,117.95999908447266,83.9800033569336,104.44999694824219,118.12999725341797\n2011-11-03,41.459999084472656,21.399999618530273,116.7699966430664,37.52000045776367,52.459999084472656,103.80000305175781,21.399999618530273,33.81999969482422,35.060001373291016,71.31999969482422,10.942323684692383,115.3499984741211,26.209999084472656,35.13999938964844,42.880001068115234,38.06999969482422,46.0,51.099998474121094,126.25,116.33999633789062,83.7699966430664,104.72000122070312,120.19000244140625\n2011-11-04,41.189998626708984,20.780000686645508,117.4000015258789,37.439998626708984,51.79999923706055,104.11000061035156,20.829999923706055,33.68000030517578,34.97999954223633,71.26000213623047,10.796100616455078,115.58000183105469,26.049999237060547,34.97999954223633,42.560001373291016,37.720001220703125,45.08000183105469,50.900001525878906,125.4800033569336,116.4800033569336,83.88999938964844,104.68000030517578,119.5999984741211\n2011-11-07,41.540000915527344,20.75,117.98999786376953,37.7599983215332,52.02000045776367,104.2300033569336,20.790000915527344,33.65999984741211,35.279998779296875,71.6500015258789,10.852965354919434,115.12000274658203,26.209999084472656,35.16999816894531,42.959999084472656,38.209999084472656,45.209999084472656,51.369998931884766,126.26000213623047,117.22000122070312,83.91000366210938,104.4800033569336,120.44999694824219\n2011-11-08,42.029998779296875,21.139999389648438,117.20999908447266,37.599998474121094,52.650001525878906,103.76000213623047,21.219999313354492,34.31999969482422,35.70000076293945,72.81999969482422,11.056052207946777,114.41000366210938,26.510000228881836,35.400001525878906,43.470001220703125,38.95000076293945,46.11000061035156,51.470001220703125,127.87999725341797,115.72000122070312,83.6500015258789,104.5,121.58999633789062\n2011-11-09,39.56999969482422,19.579999923706055,117.19000244140625,36.91999816894531,49.95000076293945,104.68000030517578,19.790000915527344,32.380001068115234,33.959999084472656,69.5999984741211,10.454915046691895,114.11000061035156,25.59000015258789,34.630001068115234,41.189998626708984,36.84000015258789,43.0099983215332,49.790000915527344,123.16000366210938,118.12000274658203,83.75,104.25,117.69000244140625\n2011-11-10,39.83000183105469,20.110000610351562,117.41999816894531,36.880001068115234,50.540000915527344,104.16999816894531,20.09000015258789,32.86000061035156,34.369998931884766,70.80999755859375,10.503655433654785,113.54000091552734,25.670000076293945,34.86000061035156,41.70000076293945,36.9900016784668,43.81999969482422,50.09000015258789,124.31999969482422,116.36000061035156,83.6500015258789,104.5199966430664,118.88999938964844\n2011-11-11,40.790000915527344,20.93000030517578,117.05999755859375,37.279998779296875,51.79999923706055,103.69000244140625,20.850000381469727,33.58000183105469,35.16999816894531,72.26000213623047,10.755483627319336,113.33999633789062,26.15999984741211,35.36000061035156,42.68000030517578,37.79999923706055,45.099998474121094,50.84000015258789,126.66000366210938,115.6500015258789,83.58999633789062,104.4800033569336,121.52999877929688\n2011-11-14,40.22999954223633,20.360000610351562,117.22000122070312,37.119998931884766,50.880001068115234,104.33999633789062,20.31999969482422,33.060001373291016,34.79999923706055,71.30999755859375,10.536149024963379,113.33000183105469,25.959999084472656,34.939998626708984,41.790000915527344,37.310001373291016,43.869998931884766,50.369998931884766,125.45999908447266,117.51000213623047,83.5999984741211,104.41999816894531,120.70999908447266\n2011-11-15,40.47999954223633,20.219999313354492,116.7699966430664,37.119998931884766,50.7400016784668,104.19999694824219,19.979999542236328,33.099998474121094,34.869998931884766,71.2300033569336,10.584890365600586,113.22000122070312,26.309999465942383,35.0,42.08000183105469,37.790000915527344,43.869998931884766,50.38999938964844,126.08000183105469,117.3499984741211,83.55000305175781,104.43000030517578,120.87000274658203\n2011-11-16,39.38999938964844,19.75,116.44000244140625,36.439998626708984,49.77000045776367,104.58000183105469,19.6299991607666,32.459999084472656,34.04999923706055,70.16000366210938,10.324938774108887,112.86000061035156,25.920000076293945,34.58000183105469,40.9900016784668,36.189998626708984,42.95000076293945,49.4900016784668,124.08000183105469,118.41999816894531,83.70999908447266,104.41999816894531,119.0999984741211\n2011-11-17,38.38999938964844,19.579999923706055,116.43000030517578,36.47999954223633,49.22999954223633,104.79000091552734,19.350000381469727,31.959999084472656,33.08000183105469,68.55999755859375,10.121851921081543,111.97000122070312,25.420000076293945,34.400001525878906,40.31999969482422,35.279998779296875,42.439998626708984,49.11000061035156,122.11000061035156,119.37000274658203,83.66999816894531,104.22000122070312,117.83000183105469\n2011-11-18,38.540000915527344,19.649999618530273,116.45999908447266,36.63999938964844,49.400001525878906,104.4000015258789,19.459999084472656,31.940000534057617,33.2599983215332,68.1500015258789,10.154346466064453,112.1500015258789,25.209999084472656,34.63999938964844,40.29999923706055,35.31999969482422,42.63999938964844,49.20000076293945,121.9800033569336,119.33999633789062,83.62000274658203,104.0,117.7300033569336\n2011-11-21,37.29999923706055,19.09000015258789,116.25,35.91999816894531,48.150001525878906,104.69000244140625,18.979999542236328,31.0,32.68000030517578,66.93000030517578,9.902518272399902,111.69000244140625,24.770000457763672,34.209999084472656,39.06999969482422,34.2400016784668,41.45000076293945,47.97999954223633,119.66000366210938,120.05000305175781,83.5999984741211,103.86000061035156,115.16000366210938\n2011-11-22,37.43000030517578,18.860000610351562,116.61000061035156,36.20000076293945,48.0099983215332,105.01000213623047,18.739999771118164,30.860000610351562,32.43000030517578,66.30000305175781,9.813159942626953,111.4000015258789,24.729999542236328,33.790000915527344,39.189998626708984,34.31999969482422,41.15999984741211,48.29999923706055,119.19000244140625,121.38999938964844,83.69000244140625,103.9000015258789,114.73999786376953\n2011-11-23,36.220001220703125,18.280000686645508,117.0999984741211,35.36000061035156,46.689998626708984,105.37000274658203,18.1299991607666,30.079999923706055,31.56999969482422,64.29000091552734,9.545084953308105,110.83000183105469,24.139999389648438,33.2599983215332,38.0099983215332,33.380001068115234,39.900001525878906,47.099998474121094,116.55999755859375,122.58000183105469,83.77999877929688,103.58000183105469,112.33000183105469\n2011-11-25,36.099998474121094,18.139999389648438,116.7300033569336,35.36000061035156,46.45000076293945,104.69999694824219,18.100000381469727,30.0,31.40999984741211,63.83000183105469,9.569456100463867,110.38999938964844,24.010000228881836,33.43000030517578,37.79999923706055,33.33000183105469,39.70000076293945,46.959999084472656,116.33999633789062,120.80000305175781,83.66000366210938,103.7699966430664,112.13999938964844\n2011-11-28,37.83000183105469,19.18000030517578,117.11000061035156,36.36000061035156,48.43000030517578,104.70999908447266,19.25,31.100000381469727,32.59000015258789,66.22000122070312,9.853777885437012,110.44000244140625,24.799999237060547,33.849998474121094,39.349998474121094,34.61000061035156,41.83000183105469,48.470001220703125,119.70999908447266,120.73999786376953,83.66000366210938,103.58000183105469,115.0999984741211\n2011-11-29,37.65999984741211,19.329999923706055,117.08000183105469,36.52000045776367,48.75,104.51000213623047,19.350000381469727,31.360000610351562,32.650001525878906,67.16999816894531,9.805036544799805,110.19000244140625,24.670000076293945,34.220001220703125,39.650001525878906,34.290000915527344,42.119998931884766,48.7599983215332,120.05000305175781,119.75,83.54000091552734,103.69000244140625,115.55999755859375\n2011-11-30,40.0099983215332,20.6299991607666,116.73999786376953,37.720001220703125,51.2400016784668,103.9000015258789,20.540000915527344,32.81999969482422,34.52000045776367,70.87000274658203,10.406173706054688,110.69000244140625,25.6200008392334,35.209999084472656,41.959999084472656,36.220001220703125,44.400001525878906,50.83000183105469,124.98999786376953,117.87999725341797,83.36000061035156,103.79000091552734,120.19000244140625\n2011-12-01,39.88999938964844,20.440000534057617,116.45999908447266,37.20000076293945,50.79999923706055,103.66999816894531,20.360000610351562,32.619998931884766,34.29999923706055,70.4800033569336,10.349309921264648,110.55999755859375,25.760000228881836,35.11000061035156,41.560001373291016,36.619998931884766,43.91999816894531,50.20000076293945,124.97000122070312,117.0,83.12999725341797,103.58000183105469,120.12999725341797\n2011-12-02,39.77000045776367,20.329999923706055,116.98999786376953,37.31999969482422,50.790000915527344,104.12999725341797,20.350000381469727,32.599998474121094,34.0,70.41999816894531,10.487408638000488,111.5,25.739999771118164,34.75,41.790000915527344,36.400001525878906,43.880001068115234,50.43000030517578,124.86000061035156,118.63999938964844,83.4000015258789,103.43000030517578,120.05999755859375\n2011-12-05,40.41999816894531,20.459999084472656,116.97000122070312,37.599998474121094,51.369998931884766,104.06999969482422,20.600000381469727,32.91999816894531,34.400001525878906,71.29000091552734,10.69861888885498,112.33000183105469,26.030000686645508,35.02000045776367,42.40999984741211,36.869998931884766,44.38999938964844,51.0,126.22000122070312,118.4000015258789,83.41000366210938,103.55999755859375,120.94999694824219\n2011-12-06,39.869998931884766,20.3799991607666,116.68000030517578,37.15999984741211,51.130001068115234,103.80000305175781,20.56999969482422,32.939998626708984,34.720001220703125,71.27999877929688,10.706742286682129,111.7300033569336,26.020000457763672,35.119998931884766,41.86000061035156,36.560001373291016,44.40999984741211,50.349998474121094,126.26000213623047,117.2699966430664,83.30000305175781,103.51000213623047,121.38999938964844\n2011-12-07,40.029998779296875,20.399999618530273,116.4800033569336,37.68000030517578,51.4900016784668,104.2699966430664,20.670000076293945,33.220001220703125,34.75,70.5999984741211,10.836718559265137,112.43000030517578,26.049999237060547,35.06999969482422,42.130001068115234,36.81999969482422,44.66999816894531,50.869998931884766,126.7300033569336,117.69000244140625,83.41000366210938,103.66000366210938,122.06999969482422\n2011-12-08,38.59000015258789,19.520000457763672,116.52999877929688,36.7599983215332,49.79999923706055,104.80000305175781,19.719999313354492,32.34000015258789,33.66999816894531,68.62999725341797,10.414297103881836,112.05000305175781,25.639999389648438,34.560001373291016,40.720001220703125,35.70000076293945,42.97999954223633,49.560001373291016,123.94999694824219,119.16000366210938,83.5999984741211,103.73999786376953,119.94000244140625\n2011-12-09,39.369998931884766,20.15999984741211,115.91000366210938,37.599998474121094,51.040000915527344,104.08000183105469,20.420000076293945,32.97999954223633,34.099998474121094,70.19000244140625,10.641755104064941,111.62000274658203,26.040000915527344,35.0,41.470001220703125,36.29999923706055,44.220001220703125,50.599998474121094,126.05000305175781,116.70999908447266,83.4000015258789,103.73999786376953,121.77999877929688\n2011-12-12,37.88999938964844,19.200000762939453,116.44999694824219,36.959999084472656,49.54999923706055,104.44000244140625,19.6200008392334,32.20000076293945,33.290000915527344,68.55000305175781,10.38992691040039,111.62999725341797,25.709999084472656,34.70000076293945,40.25,34.939998626708984,42.47999954223633,49.560001373291016,124.20999908447266,118.01000213623047,83.48999786376953,103.72000122070312,120.23999786376953\n2011-12-13,37.540000915527344,18.75,116.7699966430664,36.79999923706055,48.880001068115234,104.91999816894531,19.06999969482422,31.959999084472656,32.72999954223633,67.91000366210938,10.243703842163086,112.01000213623047,25.469999313354492,34.83000183105469,39.83000183105469,34.7400016784668,41.86000061035156,49.040000915527344,123.05000305175781,119.11000061035156,83.69999694824219,103.81999969482422,119.51000213623047\n2011-12-14,37.0,18.549999237060547,117.0,36.400001525878906,48.29999923706055,105.36000061035156,18.6200008392334,31.540000915527344,32.33000183105469,66.0,10.203086853027344,112.19999694824219,25.079999923706055,34.61000061035156,39.43000030517578,34.380001068115234,41.2599983215332,48.650001525878906,121.73999786376953,121.36000061035156,83.86000061035156,103.95999908447266,118.31999969482422\n2011-12-15,37.2400016784668,18.709999084472656,116.70999908447266,36.31999969482422,48.540000915527344,105.2699966430664,18.690000534057617,31.780000686645508,32.54999923706055,65.72000122070312,10.211210250854492,112.37999725341797,25.020000457763672,35.029998779296875,39.33000183105469,34.09000015258789,41.68000030517578,48.47999954223633,122.18000030517578,120.91000366210938,83.81999969482422,103.88999938964844,118.80999755859375\n2011-12-16,37.52000045776367,18.579999923706055,116.97000122070312,36.20000076293945,48.34000015258789,105.77999877929688,18.600000381469727,31.559999465942383,32.529998779296875,66.13999938964844,10.186840057373047,113.01000213623047,24.979999542236328,34.540000915527344,39.560001373291016,34.529998779296875,41.29999923706055,48.43000030517578,121.58999633789062,122.31999969482422,84.05000305175781,104.02999877929688,118.22000122070312\n2011-12-19,36.54999923706055,18.350000381469727,117.44000244140625,35.68000030517578,47.88999938964844,106.13999938964844,18.520000457763672,31.31999969482422,31.950000762939453,64.9800033569336,9.959383010864258,113.41000366210938,24.739999771118164,34.279998779296875,38.650001525878906,33.61000061035156,41.130001068115234,47.650001525878906,120.29000091552734,123.87000274658203,84.0199966430664,104.01000213623047,117.36000061035156\n2011-12-20,37.720001220703125,19.260000228881836,117.51000213623047,36.15999984741211,48.9900016784668,105.18000030517578,19.200000762939453,31.799999237060547,33.209999084472656,67.6500015258789,10.333062171936035,113.33000183105469,25.440000534057617,35.0099983215332,39.04999923706055,35.040000915527344,42.83000183105469,48.970001220703125,123.93000030517578,120.77999877929688,83.8499984741211,104.04000091552734,120.68000030517578\n2011-12-21,37.84000015258789,19.100000381469727,117.05000305175781,35.79999923706055,48.72999954223633,104.83999633789062,19.049999237060547,31.700000762939453,33.2599983215332,68.4000015258789,10.38992691040039,112.8499984741211,25.020000457763672,35.529998779296875,38.97999954223633,34.7599983215332,40.65999984741211,47.18000030517578,124.16999816894531,119.0999984741211,83.62000274658203,103.91000366210938,120.80999755859375\n2011-12-22,38.34000015258789,19.229999542236328,116.98999786376953,36.040000915527344,49.16999816894531,104.97000122070312,19.280000686645508,32.08000183105469,33.59000015258789,69.19999694824219,10.609260559082031,113.44000244140625,25.309999465942383,35.56999969482422,39.38999938964844,35.310001373291016,41.150001525878906,47.40999984741211,125.2699966430664,119.5999984741211,83.77999877929688,104.02999877929688,121.52999877929688\n2011-12-23,38.4900016784668,19.299999237060547,116.8499984741211,36.31999969482422,49.5099983215332,104.54000091552734,19.43000030517578,32.31999969482422,33.90999984741211,69.5999984741211,10.682372093200684,113.08999633789062,25.559999465942383,35.79999923706055,39.52000045776367,35.310001373291016,41.5099983215332,47.68000030517578,126.38999938964844,118.2699966430664,83.29000091552734,104.22000122070312,122.62999725341797\n2011-12-27,38.119998931884766,19.309999465942383,116.52999877929688,35.880001068115234,49.290000915527344,104.41000366210938,19.420000076293945,32.29999923706055,33.900001525878906,69.77999877929688,10.625507354736328,113.12999725341797,25.600000381469727,36.09000015258789,39.40999984741211,35.18000030517578,41.2400016784668,47.33000183105469,126.48999786376953,118.44999694824219,83.08999633789062,104.3499984741211,122.66999816894531\n2011-12-28,37.47999954223633,18.799999237060547,116.83000183105469,35.439998626708984,48.400001525878906,105.06999969482422,19.010000228881836,31.719999313354492,33.09000015258789,68.44999694824219,10.454915046691895,113.33999633789062,25.34000015258789,35.959999084472656,38.54999923706055,34.529998779296875,40.47999954223633,46.61000061035156,124.83000183105469,120.63999938964844,83.41000366210938,104.33999633789062,121.25\n2011-12-29,37.90999984741211,19.1200008392334,116.7300033569336,36.15999984741211,49.290000915527344,105.19999694824219,19.520000457763672,32.220001220703125,33.52000045776367,69.16000366210938,10.61738395690918,113.27999877929688,25.530000686645508,36.2400016784668,39.029998779296875,34.849998474121094,41.29999923706055,47.380001068115234,126.12000274658203,120.86000061035156,83.4800033569336,104.18000030517578,122.5199966430664\n2011-12-30,37.939998626708984,19.219999313354492,116.69000244140625,36.439998626708984,49.529998779296875,105.56999969482422,19.579999923706055,32.31999969482422,33.5,69.12999725341797,10.56052017211914,113.76000213623047,25.450000762939453,35.97999954223633,38.93000030517578,34.869998931884766,41.43000030517578,47.59000015258789,125.5,121.25,83.54000091552734,104.19999694824219,121.8499984741211\n2012-01-03,39.099998474121094,20.06999969482422,116.6500015258789,37.15999984741211,50.880001068115234,104.9000015258789,20.15999984741211,33.279998779296875,34.43000030517578,71.05000305175781,10.836718559265137,113.66999816894531,25.809999465942383,35.34000015258789,40.20000076293945,35.97999954223633,42.810001373291016,48.630001068115234,127.5,119.43000030517578,83.27999877929688,104.55999755859375,123.62999725341797\n2012-01-04,38.880001068115234,19.8799991607666,116.76000213623047,37.119998931884766,50.58000183105469,104.56999969482422,19.809999465942383,33.220001220703125,34.720001220703125,71.19999694824219,10.804224014282227,113.76000213623047,25.8799991607666,35.13999938964844,40.439998626708984,35.45000076293945,42.290000915527344,48.88999938964844,127.69999694824219,118.01000213623047,83.31999969482422,104.25,123.97000122070312\n2012-01-05,38.709999084472656,19.649999618530273,116.9800033569336,36.68000030517578,49.83000183105469,104.58999633789062,19.389999389648438,32.720001220703125,34.81999969482422,70.86000061035156,10.950447082519531,113.2699966430664,25.959999084472656,35.209999084472656,40.04999923706055,35.689998626708984,41.52000045776367,48.290000915527344,128.0399932861328,117.80000305175781,83.29000091552734,104.33999633789062,123.94999694824219\n2012-01-06,38.220001220703125,19.290000915527344,117.37000274658203,36.279998779296875,49.150001525878906,105.0,19.049999237060547,32.52000045776367,34.77000045776367,70.44000244140625,10.885458946228027,113.70999908447266,25.969999313354492,35.02000045776367,39.54999923706055,35.16999816894531,40.95000076293945,47.709999084472656,127.70999908447266,118.7300033569336,83.33999633789062,104.23999786376953,123.52999877929688\n2012-01-09,38.619998931884766,19.3700008392334,117.48999786376953,36.400001525878906,49.34000015258789,105.0199966430664,19.190000534057617,32.560001373291016,34.84000015258789,70.77999877929688,10.942323684692383,113.54000091552734,25.93000030517578,35.06999969482422,39.56999969482422,35.91999816894531,41.2599983215332,47.75,128.02000427246094,118.5199966430664,83.41000366210938,104.2699966430664,123.66000366210938\n2012-01-10,39.459999084472656,19.719999313354492,117.12999725341797,36.84000015258789,50.09000015258789,104.80999755859375,19.600000381469727,32.939998626708984,35.4900016784668,71.41000366210938,11.137287139892578,113.86000061035156,26.020000457763672,35.119998931884766,40.380001068115234,36.72999954223633,41.88999938964844,48.4900016784668,129.1300048828125,118.31999969482422,83.37000274658203,104.26000213623047,124.37999725341797\n2012-01-11,39.4900016784668,19.760000228881836,117.43000030517578,36.68000030517578,49.93000030517578,105.41999816894531,19.559999465942383,32.58000183105469,35.84000015258789,70.44999694824219,11.26726245880127,113.83999633789062,26.100000381469727,34.959999084472656,40.52000045776367,36.7400016784668,41.54999923706055,48.4900016784668,129.1999969482422,119.86000061035156,83.56999969482422,104.37999725341797,124.29000091552734\n2012-01-12,39.650001525878906,20.100000381469727,117.25,36.52000045776367,50.13999938964844,105.19999694824219,19.760000228881836,32.599998474121094,36.34000015258789,69.79000091552734,11.307879447937012,114.0999984741211,26.229999542236328,34.90999984741211,40.75,36.84000015258789,41.959999084472656,48.459999084472656,129.50999450683594,119.69000244140625,83.44999694824219,104.27999877929688,124.52999877929688\n2012-01-13,39.290000915527344,19.610000610351562,117.58000183105469,36.599998474121094,49.599998474121094,105.66999816894531,19.360000610351562,32.20000076293945,36.099998474121094,69.44000244140625,11.226645469665527,114.51000213623047,26.079999923706055,34.88999938964844,40.439998626708984,36.7400016784668,41.130001068115234,48.29999923706055,128.83999633789062,120.87999725341797,83.69999694824219,104.31999969482422,124.16000366210938\n2012-01-17,40.040000915527344,20.200000762939453,117.69999694824219,36.599998474121094,50.189998626708984,105.7699966430664,19.809999465942383,32.36000061035156,36.29999923706055,69.93000030517578,11.137287139892578,114.86000061035156,26.200000762939453,34.86000061035156,40.93000030517578,37.619998931884766,41.900001525878906,48.63999938964844,129.33999633789062,121.44000244140625,83.62999725341797,104.37999725341797,124.62000274658203\n2012-01-18,41.04999923706055,20.68000030517578,117.61000061035156,37.040000915527344,51.029998779296875,105.44000244140625,20.270000457763672,32.84000015258789,36.709999084472656,71.08000183105469,11.307879447937012,114.62999725341797,26.579999923706055,34.849998474121094,41.63999938964844,38.31999969482422,42.79999923706055,49.290000915527344,130.77000427246094,119.97000122070312,83.61000061035156,104.33000183105469,125.62000274658203\n2012-01-19,41.40999984741211,20.940000534057617,117.18000030517578,37.31999969482422,51.65999984741211,104.80999755859375,20.670000076293945,33.119998931884766,36.7400016784668,71.37000274658203,11.413484573364258,114.5999984741211,26.770000457763672,34.560001373291016,41.810001373291016,38.599998474121094,43.41999816894531,49.63999938964844,131.4600067138672,118.31999969482422,83.52999877929688,104.29000091552734,126.16999816894531\n2012-01-20,41.380001068115234,20.93000030517578,116.94000244140625,37.79999923706055,51.93000030517578,104.44999694824219,20.65999984741211,33.279998779296875,36.58000183105469,71.37999725341797,11.48659610748291,114.30999755859375,26.799999237060547,34.61000061035156,42.08000183105469,38.66999816894531,43.470001220703125,50.130001068115234,131.9499969482422,116.9800033569336,83.37000274658203,104.3499984741211,126.95999908447266\n2012-01-23,41.779998779296875,21.110000610351562,116.69999694824219,37.959999084472656,52.130001068115234,104.22000122070312,20.8799991607666,33.5,36.560001373291016,71.94999694824219,11.527214050292969,114.13999938964844,26.889999389648438,34.75,42.2599983215332,38.83000183105469,43.779998779296875,50.29999923706055,131.61000061035156,116.23999786376953,83.2699966430664,104.37000274658203,126.80999755859375\n2012-01-24,41.84000015258789,21.059999465942383,116.70999908447266,37.599998474121094,51.84000015258789,104.33999633789062,20.729999542236328,33.400001525878906,36.560001373291016,71.73999786376953,11.510966300964355,114.55000305175781,26.8700008392334,34.470001220703125,42.0099983215332,38.970001220703125,43.5099983215332,49.970001220703125,131.4600067138672,116.44999694824219,83.29000091552734,104.44000244140625,126.43000030517578\n2012-01-25,42.310001373291016,21.329999923706055,117.61000061035156,38.08000183105469,52.380001068115234,104.83999633789062,20.989999771118164,33.63999938964844,37.13999938964844,72.62000274658203,11.535337448120117,114.94000244140625,27.079999923706055,35.040000915527344,42.97999954223633,39.40999984741211,43.939998626708984,50.77000045776367,132.55999755859375,116.16999816894531,83.52999877929688,104.37999725341797,127.25\n2012-01-26,42.13999938964844,21.489999771118164,118.1500015258789,38.0,52.400001525878906,105.4000015258789,21.040000915527344,33.79999923706055,37.130001068115234,71.62999725341797,11.43785572052002,115.83999633789062,26.899999618530273,35.15999984741211,42.900001525878906,39.18000030517578,44.06999969482422,50.709999084472656,131.8800048828125,117.70999908447266,83.75,104.54000091552734,127.05999755859375\n2012-01-27,42.36000061035156,21.670000076293945,118.4000015258789,38.20000076293945,52.4900016784668,105.72000122070312,21.010000228881836,33.58000183105469,37.18000030517578,71.4800033569336,11.478472709655762,116.01000213623047,26.899999618530273,34.72999954223633,43.29999923706055,39.599998474121094,44.11000061035156,50.939998626708984,131.82000732421875,118.08000183105469,83.9000015258789,104.51000213623047,126.44999694824219\n2012-01-30,41.75,21.31999969482422,118.79000091552734,37.959999084472656,51.869998931884766,106.08000183105469,20.639999389648438,33.13999938964844,37.13999938964844,71.13999938964844,11.372867584228516,115.86000061035156,26.979999542236328,34.5099983215332,42.83000183105469,38.470001220703125,43.40999984741211,50.54999923706055,131.3699951171875,119.47000122070312,84.0,104.5199966430664,126.2300033569336\n2012-01-31,42.11000061035156,21.329999923706055,119.36000061035156,38.20000076293945,52.13999938964844,106.4800033569336,20.809999465942383,33.36000061035156,37.18000030517578,70.69000244140625,11.421608924865723,116.19999694824219,27.030000686645508,34.68000030517578,42.880001068115234,38.83000183105469,43.689998626708984,50.7599983215332,131.32000732421875,120.8499984741211,84.06999969482422,104.80000305175781,126.06999969482422\n2012-02-01,43.040000915527344,21.850000381469727,119.29000091552734,38.439998626708984,52.959999084472656,105.91999816894531,21.200000762939453,33.91999816894531,37.54999923706055,70.97000122070312,11.600324630737305,116.2699966430664,27.299999237060547,34.79999923706055,43.400001525878906,39.41999816894531,44.599998474121094,51.09000015258789,132.47000122070312,119.18000030517578,83.77999877929688,104.55999755859375,126.91000366210938\n2012-02-02,43.15999984741211,22.030000686645508,119.29000091552734,38.560001373291016,53.06999969482422,106.06999969482422,21.290000915527344,33.959999084472656,37.369998931884766,71.51000213623047,11.65718936920166,116.51000213623047,27.3700008392334,34.7400016784668,43.40999984741211,39.93000030517578,44.66999816894531,51.22999954223633,132.67999267578125,119.12999725341797,83.91000366210938,104.61000061035156,126.83999633789062\n2012-02-03,43.880001068115234,22.43000030517578,118.29000091552734,38.68000030517578,53.900001525878906,105.2300033569336,21.6299991607666,34.91999816894531,37.880001068115234,72.7699966430664,11.974004745483398,116.33999633789062,27.719999313354492,34.83000183105469,44.0099983215332,40.4900016784668,45.54999923706055,51.650001525878906,134.5399932861328,116.56999969482422,83.80000305175781,104.8499984741211,128.3699951171875\n2012-02-06,43.5099983215332,22.34000015258789,118.81999969482422,38.560001373291016,53.63999938964844,105.5199966430664,21.43000030517578,34.779998779296875,37.66999816894531,73.63999938964844,11.91714096069336,116.63999938964844,27.729999542236328,34.68000030517578,43.70000076293945,39.869998931884766,45.20000076293945,51.5,134.4499969482422,117.7300033569336,83.83999633789062,104.47000122070312,128.1199951171875\n2012-02-07,43.599998474121094,22.510000228881836,118.37999725341797,38.959999084472656,53.970001220703125,104.83999633789062,21.690000534057617,34.91999816894531,37.630001068115234,74.0199966430664,11.909016609191895,116.41999816894531,27.799999237060547,34.93000030517578,43.7400016784668,39.720001220703125,45.619998931884766,51.77000045776367,134.7899932861328,116.2699966430664,83.7300033569336,104.79000091552734,128.50999450683594\n2012-02-08,43.90999984741211,22.6299991607666,118.3499984741211,39.119998931884766,54.15999984741211,104.88999938964844,21.780000686645508,34.86000061035156,37.66999816894531,73.7699966430664,11.998374938964844,116.54000091552734,27.969999313354492,34.970001220703125,44.0,40.400001525878906,45.779998779296875,52.06999969482422,135.19000244140625,116.36000061035156,83.62999725341797,104.87000274658203,128.7100067138672\n2012-02-09,43.88999938964844,22.739999771118164,117.9000015258789,39.0,54.29999923706055,104.6500015258789,21.8799991607666,34.91999816894531,37.709999084472656,73.77999877929688,11.949634552001953,116.16999816894531,28.239999771118164,34.869998931884766,43.9900016784668,40.09000015258789,45.810001373291016,51.88999938964844,135.36000061035156,115.48999786376953,83.63999938964844,104.80000305175781,128.75999450683594\n2012-02-10,42.91999816894531,22.139999389648438,118.44999694824219,38.52000045776367,53.27000045776367,105.23999786376953,21.34000015258789,34.41999816894531,37.04999923706055,73.04000091552734,11.835906028747559,116.05999755859375,28.030000686645508,34.79999923706055,43.0,38.93000030517578,44.869998931884766,51.08000183105469,134.36000061035156,116.98999786376953,83.69999694824219,104.75,127.8499984741211\n2012-02-13,43.619998931884766,22.3799991607666,118.69000244140625,38.91999816894531,53.880001068115234,105.16999816894531,21.469999313354492,34.81999969482422,37.150001525878906,73.62000274658203,11.941511154174805,116.45999908447266,28.209999084472656,34.7599983215332,43.65999984741211,39.41999816894531,45.439998626708984,51.66999816894531,135.36000061035156,117.13999938964844,83.69000244140625,104.83999633789062,128.58999633789062\n2012-02-14,43.2599983215332,22.190000534057617,118.69000244140625,38.79999923706055,53.47999954223633,105.38999938964844,21.239999771118164,34.599998474121094,36.66999816894531,73.75,11.82778263092041,116.55000305175781,28.260000228881836,34.77000045776367,43.34000015258789,39.38999938964844,44.959999084472656,51.5099983215332,135.19000244140625,117.76000213623047,83.80000305175781,104.86000061035156,128.66000366210938\n2012-02-15,43.380001068115234,22.079999923706055,118.91000366210938,39.439998626708984,53.540000915527344,105.47000122070312,21.18000030517578,34.540000915527344,36.70000076293945,73.62999725341797,11.754671096801758,116.38999938964844,28.110000610351562,34.70000076293945,43.40999984741211,39.810001373291016,44.810001373291016,51.970001220703125,134.55999755859375,117.55000305175781,83.69000244140625,104.87999725341797,127.86000061035156\n2012-02-16,43.849998474121094,22.43000030517578,118.61000061035156,39.84000015258789,54.279998779296875,104.98999786376953,21.559999465942383,34.97999954223633,37.349998474121094,74.58999633789062,11.941511154174805,116.19000244140625,28.520000457763672,35.06999969482422,43.650001525878906,40.310001373291016,45.599998474121094,52.369998931884766,136.0500030517578,116.61000061035156,83.69999694824219,104.93000030517578,129.07000732421875\n2012-02-17,43.93000030517578,22.700000762939453,118.33000183105469,39.880001068115234,54.52000045776367,104.87999725341797,21.790000915527344,35.13999938964844,37.369998931884766,74.87000274658203,12.014622688293457,116.01000213623047,28.520000457763672,35.04999923706055,43.47999954223633,40.2599983215332,45.84000015258789,52.400001525878906,136.41000366210938,116.58000183105469,83.51000213623047,104.86000061035156,129.22999572753906\n2012-02-21,43.75,22.8799991607666,118.26000213623047,39.84000015258789,54.529998779296875,104.5,21.920000076293945,34.939998626708984,37.59000015258789,75.37999725341797,12.006498336791992,115.81999969482422,28.639999389648438,34.91999816894531,43.900001525878906,39.93000030517578,45.83000183105469,52.400001525878906,136.47000122070312,115.29000091552734,83.45999908447266,104.91999816894531,129.35000610351562\n2012-02-22,43.83000183105469,22.739999771118164,118.93000030517578,39.959999084472656,54.369998931884766,104.91000366210938,21.84000015258789,34.720001220703125,37.529998779296875,75.55000305175781,11.852152824401855,116.54000091552734,28.540000915527344,34.959999084472656,43.86000061035156,40.31999969482422,45.65999984741211,52.66999816894531,136.02999877929688,116.73999786376953,83.73999786376953,105.11000061035156,129.13999938964844\n2012-02-23,43.75,22.93000030517578,118.97000122070312,40.20000076293945,54.81999969482422,105.05999755859375,22.18000030517578,35.040000915527344,37.56999969482422,75.93000030517578,11.957757949829102,116.69999694824219,28.649999618530273,34.93000030517578,44.13999938964844,40.13999938964844,46.119998931884766,52.93000030517578,136.6300048828125,116.73999786376953,83.77999877929688,105.0999984741211,129.5800018310547\n2012-02-24,44.189998626708984,23.190000534057617,119.0,40.279998779296875,55.150001525878906,105.13999938964844,22.389999389648438,35.31999969482422,37.54999923706055,76.2300033569336,11.91714096069336,116.79000091552734,28.81999969482422,35.08000183105469,44.220001220703125,40.15999984741211,46.52000045776367,53.040000915527344,136.92999267578125,117.5,83.83999633789062,105.0,129.6199951171875\n2012-02-27,43.75,23.030000686645508,119.19000244140625,40.040000915527344,54.869998931884766,105.48999786376953,22.149999618530273,35.060001373291016,37.560001373291016,75.98999786376953,12.006498336791992,117.22000122070312,28.8700008392334,35.06999969482422,44.22999954223633,39.709999084472656,46.130001068115234,52.90999984741211,137.16000366210938,118.54000091552734,83.98999786376953,105.0999984741211,129.66000366210938\n2012-02-28,44.36000061035156,23.299999237060547,119.20999908447266,40.68000030517578,55.380001068115234,105.54000091552734,22.290000915527344,35.29999923706055,37.68000030517578,75.73999786376953,12.038992881774902,117.58999633789062,29.079999923706055,34.900001525878906,44.369998931884766,40.290000915527344,46.540000915527344,53.41999816894531,137.55999755859375,118.1500015258789,83.9800033569336,105.08999633789062,129.86000061035156\n2012-02-29,44.33000183105469,22.950000762939453,118.66999816894531,39.959999084472656,54.65999984741211,105.12000274658203,22.110000610351562,35.060001373291016,36.970001220703125,74.87999725341797,11.990251541137695,117.69999694824219,28.950000762939453,34.88999938964844,44.279998779296875,40.290000915527344,46.060001373291016,52.880001068115234,137.02000427246094,117.43000030517578,83.9000015258789,105.0999984741211,129.2899932861328\n2012-03-01,44.75,23.219999313354492,118.37999725341797,40.20000076293945,55.279998779296875,104.61000061035156,22.389999389648438,35.560001373291016,37.380001068115234,75.5999984741211,12.120227813720703,117.0199966430664,29.1200008392334,34.97999954223633,44.630001068115234,40.31999969482422,46.66999816894531,53.16999816894531,137.72999572753906,116.05999755859375,83.56999969482422,105.0199966430664,129.57000732421875\n2012-03-02,44.63999938964844,22.959999084472656,118.38999938964844,39.79999923706055,54.77000045776367,105.02999877929688,22.170000076293945,35.13999938964844,37.290000915527344,74.73999786376953,12.079609870910645,117.05999755859375,29.079999923706055,34.959999084472656,44.31999969482422,40.27000045776367,46.06999969482422,52.72999954223633,137.30999755859375,117.1500015258789,83.73999786376953,105.06999969482422,129.5500030517578\n2012-03-05,43.869998931884766,22.850000381469727,117.8499984741211,39.560001373291016,54.47999954223633,104.81999969482422,22.15999984741211,35.0,36.689998626708984,74.26000213623047,12.030869483947754,116.8499984741211,28.829999923706055,35.040000915527344,43.84000015258789,39.16999816894531,45.88999938964844,52.38999938964844,136.75,116.22000122070312,83.56999969482422,104.95999908447266,129.4199981689453\n2012-03-06,42.400001525878906,21.770000457763672,118.19000244140625,39.2400016784668,52.7400016784668,105.26000213623047,21.09000015258789,33.84000015258789,35.939998626708984,73.05000305175781,11.738424301147461,116.66999816894531,28.549999237060547,34.900001525878906,42.400001525878906,37.75,44.0099983215332,51.400001525878906,134.75,117.62999725341797,83.70999908447266,104.94999694824219,127.44999694824219\n2012-03-07,42.90999984741211,22.059999465942383,118.44999694824219,39.47999954223633,53.38999938964844,105.05999755859375,21.43000030517578,34.20000076293945,36.029998779296875,73.66000366210938,11.88464641571045,116.62000274658203,28.760000228881836,34.91999816894531,42.709999084472656,37.91999816894531,44.709999084472656,51.79999923706055,135.69000244140625,116.91000366210938,83.7300033569336,104.93000030517578,128.22999572753906\n2012-03-08,43.810001373291016,22.8700008392334,118.4000015258789,40.15999984741211,54.540000915527344,104.75,22.25,34.63999938964844,36.630001068115234,74.26000213623047,11.998374938964844,116.63999938964844,29.049999237060547,35.029998779296875,43.41999816894531,38.810001373291016,45.91999816894531,52.61000061035156,137.0399932861328,115.73999786376953,83.5999984741211,105.01000213623047,128.9199981689453\n2012-03-09,43.790000915527344,22.739999771118164,118.61000061035156,40.31999969482422,54.36000061035156,104.66999816894531,21.969999313354492,34.540000915527344,36.63999938964844,74.19000244140625,12.095856666564941,116.58000183105469,29.18000030517578,35.16999816894531,43.310001373291016,39.029998779296875,45.459999084472656,52.68000030517578,137.57000732421875,115.97000122070312,83.5199966430664,104.77999877929688,129.14999389648438\n2012-03-12,43.310001373291016,22.860000610351562,118.76000213623047,39.91999816894531,54.220001220703125,104.63999938964844,22.149999618530273,34.540000915527344,36.439998626708984,73.77999877929688,12.063363075256348,116.3499984741211,29.219999313354492,35.56999969482422,42.97999954223633,38.83000183105469,45.630001068115234,52.29999923706055,137.5800018310547,115.94999694824219,83.58000183105469,104.95999908447266,129.4600067138672\n2012-03-13,44.4900016784668,23.139999389648438,118.47000122070312,40.279998779296875,55.099998474121094,103.88999938964844,22.469999313354492,35.2400016784668,37.040000915527344,74.66999816894531,12.52640151977539,116.02999877929688,29.799999237060547,35.689998626708984,44.0,39.959999084472656,46.439998626708984,52.91999816894531,140.05999755859375,113.91000366210938,83.33000183105469,105.0,131.67999267578125\n2012-03-14,43.790000915527344,23.149999618530273,117.37000274658203,39.84000015258789,54.61000061035156,102.69999694824219,22.31999969482422,34.939998626708984,36.900001525878906,73.94999694824219,12.542648315429688,114.6500015258789,29.90999984741211,35.15999984741211,43.470001220703125,38.66999816894531,46.029998779296875,52.459999084472656,139.91000366210938,111.04000091552734,82.83999633789062,104.7699966430664,131.8800048828125\n2012-03-15,44.13999938964844,23.510000228881836,117.52999877929688,40.15999984741211,55.130001068115234,102.66999816894531,22.530000686645508,35.02000045776367,37.16999816894531,74.06999969482422,12.761981964111328,114.4000015258789,29.989999771118164,35.130001068115234,43.939998626708984,38.86000061035156,46.54999923706055,52.79999923706055,140.72000122070312,111.20999908447266,82.86000061035156,105.0,132.41000366210938\n2012-03-16,44.09000015258789,23.65999984741211,117.5999984741211,40.400001525878906,55.5099983215332,102.63999938964844,22.739999771118164,35.380001068115234,37.099998474121094,74.80000305175781,12.770105361938477,114.56999969482422,29.8799991607666,34.779998779296875,44.16999816894531,38.7599983215332,47.029998779296875,53.06999969482422,140.3000030517578,111.43000030517578,82.8499984741211,105.05999755859375,132.0500030517578\n2012-03-19,43.91999816894531,23.739999771118164,117.29000091552734,40.52000045776367,55.79999923706055,102.01000213623047,22.799999237060547,35.459999084472656,37.33000183105469,75.13999938964844,12.83509349822998,114.41000366210938,30.100000381469727,34.540000915527344,44.209999084472656,37.970001220703125,47.2400016784668,53.130001068115234,140.85000610351562,110.0999984741211,82.62999725341797,105.0,132.07000732421875\n2012-03-20,43.15999984741211,23.420000076293945,117.18000030517578,40.119998931884766,55.13999938964844,102.05999755859375,22.59000015258789,35.02000045776367,37.119998931884766,74.01000213623047,12.900081634521484,114.33999633789062,30.06999969482422,34.58000183105469,43.310001373291016,37.27000045776367,46.65999984741211,52.4900016784668,140.44000244140625,110.54000091552734,82.6500015258789,104.83000183105469,131.3800048828125\n2012-03-21,43.2400016784668,23.3700008392334,117.4000015258789,39.91999816894531,54.779998779296875,102.58000183105469,22.420000076293945,34.91999816894531,37.119998931884766,73.12999725341797,12.843216896057129,114.86000061035156,30.059999465942383,34.5099983215332,43.13999938964844,37.41999816894531,46.380001068115234,52.20000076293945,140.2100067138672,111.79000091552734,82.88999938964844,105.05000305175781,130.99000549316406\n2012-03-22,42.58000183105469,23.040000915527344,117.52999877929688,39.959999084472656,54.400001525878906,102.70999908447266,22.049999237060547,34.599998474121094,36.52000045776367,71.4800033569336,12.672623634338379,114.66999816894531,29.989999771118164,34.59000015258789,42.79999923706055,36.88999938964844,45.849998474121094,52.209999084472656,139.1999969482422,112.1500015258789,83.01000213623047,104.93000030517578,130.1699981689453\n2012-03-23,42.900001525878906,23.290000915527344,117.91000366210938,39.959999084472656,54.779998779296875,103.08999633789062,22.25,34.81999969482422,36.90999984741211,72.26000213623047,12.778228759765625,114.76000213623047,29.989999771118164,34.599998474121094,43.25,36.91999816894531,46.20000076293945,52.43000030517578,139.64999389648438,113.20999908447266,83.16000366210938,104.87999725341797,130.60000610351562\n2012-03-26,43.650001525878906,23.799999237060547,117.56999969482422,40.2400016784668,55.47999954223633,102.97000122070312,22.6200008392334,35.31999969482422,37.38999938964844,72.80000305175781,12.981315612792969,115.01000213623047,30.43000030517578,34.84000015258789,43.939998626708984,37.310001373291016,47.029998779296875,52.95000076293945,141.61000061035156,112.62999725341797,83.1500015258789,105.13999938964844,132.08999633789062\n2012-03-27,43.41999816894531,23.59000015258789,117.98999786376953,40.560001373291016,55.130001068115234,103.54000091552734,22.239999771118164,35.0,37.310001373291016,72.06999969482422,12.859463691711426,115.9000015258789,30.420000076293945,35.0099983215332,43.630001068115234,37.25,46.43000030517578,53.060001373291016,141.1699981689453,113.44000244140625,83.29000091552734,105.19999694824219,131.6699981689453\n2012-03-28,42.689998626708984,23.309999465942383,117.83999633789062,40.63999938964844,54.75,103.36000061035156,22.040000915527344,34.52000045776367,36.790000915527344,71.16999816894531,12.89195728302002,115.68000030517578,30.309999465942383,34.720001220703125,43.5099983215332,36.70000076293945,45.939998626708984,53.09000015258789,140.47000122070312,113.27999877929688,83.2699966430664,105.08000183105469,130.97999572753906\n2012-03-29,42.63999938964844,23.010000228881836,118.04000091552734,40.599998474121094,54.400001525878906,103.79000091552734,21.809999465942383,34.400001525878906,36.84000015258789,71.16999816894531,12.761981964111328,115.91000366210938,30.25,34.86000061035156,43.349998474121094,36.29999923706055,45.59000015258789,52.939998626708984,140.22999572753906,114.12999725341797,83.44999694824219,105.16999816894531,131.1300048828125\n2012-03-30,42.95000076293945,23.280000686645508,117.6500015258789,40.720001220703125,54.88999938964844,103.27999877929688,22.06999969482422,34.599998474121094,36.970001220703125,71.75,12.83509349822998,115.62999725341797,30.15999984741211,35.040000915527344,43.52000045776367,36.66999816894531,46.09000015258789,53.13999938964844,140.80999755859375,112.19999694824219,83.27999877929688,105.08999633789062,131.8000030517578\n2012-04-02,43.540000915527344,23.6299991607666,117.91999816894531,40.7599983215332,55.529998779296875,103.3499984741211,22.299999237060547,35.380001068115234,37.4900016784668,72.44999694824219,12.932575225830078,115.52999877929688,30.479999542236328,35.220001220703125,43.86000061035156,37.09000015258789,46.83000183105469,53.27000045776367,141.83999633789062,112.52999877929688,83.0,104.69000244140625,132.3000030517578\n2012-04-03,43.290000915527344,23.139999389648438,117.05000305175781,40.2400016784668,54.560001373291016,102.58999633789062,21.739999771118164,34.84000015258789,37.209999084472656,71.81999969482422,12.859463691711426,114.43000030517578,30.459999084472656,35.20000076293945,43.279998779296875,37.20000076293945,45.810001373291016,52.689998626708984,141.25999450683594,110.58000183105469,82.69000244140625,104.69999694824219,131.6699981689453\n2012-04-04,42.5099983215332,22.420000076293945,117.06999969482422,39.31999969482422,53.34000015258789,103.11000061035156,21.09000015258789,34.099998474121094,36.689998626708984,70.9000015258789,12.656376838684082,114.6500015258789,30.100000381469727,35.150001525878906,42.81999969482422,36.630001068115234,44.650001525878906,51.65999984741211,139.86000061035156,112.0999984741211,82.91999816894531,104.70999908447266,130.50999450683594\n2012-04-05,42.7400016784668,22.139999389648438,117.37999725341797,39.31999969482422,53.02000045776367,103.56999969482422,20.81999969482422,33.880001068115234,36.47999954223633,70.5,12.623883247375488,114.83999633789062,30.170000076293945,34.88999938964844,43.06999969482422,37.0,44.209999084472656,51.86000061035156,139.7899932861328,112.91000366210938,83.08000183105469,104.81999969482422,130.38999938964844\n2012-04-09,42.11000061035156,21.959999084472656,117.91999816894531,39.08000183105469,52.790000915527344,104.62999725341797,20.780000686645508,33.81999969482422,35.95000076293945,69.61000061035156,12.428919792175293,115.58999633789062,29.959999084472656,34.709999084472656,42.630001068115234,36.349998474121094,43.9900016784668,51.470001220703125,138.22000122070312,115.55000305175781,83.37000274658203,104.94999694824219,129.1199951171875\n2012-04-10,41.290000915527344,21.520000457763672,118.5999984741211,38.599998474121094,51.65999984741211,105.12000274658203,20.110000610351562,32.97999954223633,35.209999084472656,68.23999786376953,12.160844802856445,115.5199966430664,29.540000915527344,34.2599983215332,42.040000915527344,35.75,42.83000183105469,50.810001373291016,135.89999389648438,116.86000061035156,83.61000061035156,104.76000213623047,127.01000213623047\n2012-04-11,41.7400016784668,21.93000030517578,118.79000091552734,39.119998931884766,52.380001068115234,104.70999908447266,20.43000030517578,33.5,35.59000015258789,68.26000213623047,12.35580825805664,115.4000015258789,29.709999084472656,34.34000015258789,42.38999938964844,36.16999816894531,43.61000061035156,51.38999938964844,137.0,115.45999908447266,83.48999786376953,104.81999969482422,127.8499984741211\n2012-04-12,42.810001373291016,22.3700008392334,118.56999969482422,39.31999969482422,53.34000015258789,104.5,20.860000610351562,34.220001220703125,36.560001373291016,69.75,12.58326530456543,115.44999694824219,30.079999923706055,34.45000076293945,43.5,37.45000076293945,44.52000045776367,52.09000015258789,138.7899932861328,114.9800033569336,83.5,104.79000091552734,129.72000122070312\n2012-04-13,42.15999984741211,21.6200008392334,119.06999969482422,38.880001068115234,52.31999969482422,105.12999725341797,20.229999542236328,33.5,36.130001068115234,68.69999694824219,12.290820121765137,116.0,29.610000610351562,34.33000183105469,42.97999954223633,37.41999816894531,43.29999923706055,51.43000030517578,137.13999938964844,116.83999633789062,83.70999908447266,104.98999786376953,128.39999389648438\n2012-04-16,41.95000076293945,21.93000030517578,119.0,38.959999084472656,52.70000076293945,105.0999984741211,20.3700008392334,33.81999969482422,36.2400016784668,68.23999786376953,12.380178451538086,116.0,29.299999237060547,34.650001525878906,43.06999969482422,37.08000183105469,43.790000915527344,51.63999938964844,137.0500030517578,116.66999816894531,83.70999908447266,104.95999908447266,129.07000732421875\n2012-04-17,42.43000030517578,22.40999984741211,119.26000213623047,39.20000076293945,53.540000915527344,104.98999786376953,20.899999618530273,34.439998626708984,36.72999954223633,69.3499984741211,12.542648315429688,116.1500015258789,29.940000534057617,34.83000183105469,43.59000015258789,37.5,44.709999084472656,52.16999816894531,139.0800018310547,116.5999984741211,83.69999694824219,104.98999786376953,130.94000244140625\n2012-04-18,42.22999954223633,22.209999084472656,119.12000274658203,39.119998931884766,53.2599983215332,105.19999694824219,20.549999237060547,34.560001373291016,36.630001068115234,69.20999908447266,12.461413383483887,116.12999725341797,29.719999313354492,34.77000045776367,43.47999954223633,37.540000915527344,44.279998779296875,51.97999954223633,138.61000061035156,116.94000244140625,83.76000213623047,104.95999908447266,130.14999389648438\n2012-04-19,42.040000915527344,22.0,118.80999755859375,38.880001068115234,52.939998626708984,105.31999969482422,20.15999984741211,34.58000183105469,36.5,69.12000274658203,12.404549598693848,116.20999908447266,29.389999389648438,34.68000030517578,43.52000045776367,37.77000045776367,44.040000915527344,51.709999084472656,137.72000122070312,117.05000305175781,83.73999786376953,104.87000274658203,129.5399932861328\n2012-04-20,42.33000183105469,22.299999237060547,119.11000061035156,38.959999084472656,53.45000076293945,105.33000183105469,20.299999237060547,34.81999969482422,36.47999954223633,68.95999908447266,12.339561462402344,116.18000030517578,29.280000686645508,35.02000045776367,43.7400016784668,38.0,44.599998474121094,51.880001068115234,137.9499969482422,117.06999969482422,83.7300033569336,104.9000015258789,129.97999572753906\n2012-04-23,41.52000045776367,21.65999984741211,119.23999786376953,38.52000045776367,52.380001068115234,105.54000091552734,19.799999237060547,34.34000015258789,36.029998779296875,68.88999938964844,12.250203132629395,116.19999694824219,29.049999237060547,34.869998931884766,43.060001373291016,37.0,43.619998931884766,51.209999084472656,136.7899932861328,117.91999816894531,83.83000183105469,104.98999786376953,129.02000427246094\n2012-04-24,41.61000061035156,21.770000457763672,119.2699966430664,38.7599983215332,52.79999923706055,105.2699966430664,20.139999389648438,34.5,36.029998779296875,69.4000015258789,12.388301849365234,115.98999786376953,28.989999771118164,35.11000061035156,43.380001068115234,37.189998626708984,44.02000045776367,51.59000015258789,137.30999755859375,117.08999633789062,83.7300033569336,105.05000305175781,129.72000122070312\n2012-04-25,41.9900016784668,22.270000457763672,119.22000122070312,38.959999084472656,53.52000045776367,105.13999938964844,20.729999542236328,34.779998779296875,36.790000915527344,70.08999633789062,12.49390697479248,116.19000244140625,29.809999465942383,35.290000915527344,43.95000076293945,37.529998779296875,44.7400016784668,51.97999954223633,139.19000244140625,116.48999786376953,83.70999908447266,104.9000015258789,130.63999938964844\n2012-04-26,42.25,22.520000457763672,119.66999816894531,39.15999984741211,53.84000015258789,105.48999786376953,20.81999969482422,35.02000045776367,36.75,70.83000183105469,12.599513053894043,116.37999725341797,30.040000915527344,35.4900016784668,44.119998931884766,37.7400016784668,44.959999084472656,52.15999984741211,140.16000366210938,117.19000244140625,83.81999969482422,104.93000030517578,131.85000610351562\n2012-04-27,42.310001373291016,22.670000076293945,119.55000305175781,39.040000915527344,54.060001373291016,105.5999984741211,20.979999542236328,35.29999923706055,36.93000030517578,70.80000305175781,12.607636451721191,116.55000305175781,30.030000686645508,35.61000061035156,44.25,37.869998931884766,45.220001220703125,52.16999816894531,140.38999938964844,117.29000091552734,83.87000274658203,104.83000183105469,132.0\n2012-04-30,42.220001220703125,22.540000915527344,119.41999816894531,38.959999084472656,53.75,105.69000244140625,20.719999313354492,35.099998474121094,36.66999816894531,71.23999786376953,12.534524917602539,116.4800033569336,29.81999969482422,35.65999984741211,44.099998474121094,37.93000030517578,44.939998626708984,51.95000076293945,139.8699951171875,117.31999969482422,83.91999816894531,104.8499984741211,131.8000030517578\n2012-05-01,42.5,22.649999618530273,119.04000091552734,38.560001373291016,53.970001220703125,105.33000183105469,20.889999389648438,35.380001068115234,36.88999938964844,72.26000213623047,12.66450023651123,115.87000274658203,29.920000076293945,35.84000015258789,44.310001373291016,38.349998474121094,45.34000015258789,51.79999923706055,140.74000549316406,116.43000030517578,83.61000061035156,104.80999755859375,132.52999877929688\n2012-05-02,42.41999816894531,22.34000015258789,119.16999816894531,38.36000061035156,53.54999923706055,105.52999877929688,20.770000457763672,35.20000076293945,36.709999084472656,71.08000183105469,12.567018508911133,116.25,29.940000534057617,35.630001068115234,44.29999923706055,38.310001373291016,44.779998779296875,51.630001068115234,140.32000732421875,117.25,83.73999786376953,104.81999969482422,132.39999389648438\n2012-05-03,42.099998474121094,22.09000015258789,119.0199966430664,38.040000915527344,53.08000183105469,105.5199966430664,20.56999969482422,34.900001525878906,36.290000915527344,69.9000015258789,12.461413383483887,116.31999969482422,29.690000534057617,35.52000045776367,43.900001525878906,37.91999816894531,44.41999816894531,51.209999084472656,139.25,117.22000122070312,83.8499984741211,104.87999725341797,131.80999755859375\n2012-05-04,41.36000061035156,21.540000915527344,119.2699966430664,37.7599983215332,52.27000045776367,105.94000244140625,20.239999771118164,34.279998779296875,35.68000030517578,68.30000305175781,12.266449928283691,116.44999694824219,29.06999969482422,35.56999969482422,43.099998474121094,37.369998931884766,43.63999938964844,50.65999984741211,137.0,118.13999938964844,83.94000244140625,104.9000015258789,130.08999633789062\n2012-05-07,41.5099983215332,21.639999389648438,119.26000213623047,37.91999816894531,52.650001525878906,105.91000366210938,20.5,34.619998931884766,35.709999084472656,68.0999984741211,12.339561462402344,116.6500015258789,28.989999771118164,35.5,42.93000030517578,37.18000030517578,44.09000015258789,50.75,137.10000610351562,118.16000366210938,83.91000366210938,104.9000015258789,129.83999633789062\n2012-05-08,40.849998474121094,21.299999237060547,119.4800033569336,37.599998474121094,51.84000015258789,106.1500015258789,20.06999969482422,34.02000045776367,35.540000915527344,67.87999725341797,12.258326530456543,116.94000244140625,28.889999389648438,35.560001373291016,42.27000045776367,36.43000030517578,43.369998931884766,50.119998931884766,136.5500030517578,118.79000091552734,83.98999786376953,104.94000244140625,129.0800018310547\n2012-05-09,40.31999969482422,21.09000015258789,119.33999633789062,37.279998779296875,51.2400016784668,106.23999786376953,19.75,33.63999938964844,35.220001220703125,67.55000305175781,12.120227813720703,116.73999786376953,28.889999389648438,35.58000183105469,41.869998931884766,35.93000030517578,42.709999084472656,49.72999954223633,135.74000549316406,118.87000274658203,83.94000244140625,104.88999938964844,128.33999633789062\n2012-05-10,40.4900016784668,21.18000030517578,119.31999969482422,37.439998626708984,51.47999954223633,106.08999633789062,19.899999618530273,33.7599983215332,35.11000061035156,67.83999633789062,12.168968200683594,116.5,28.670000076293945,35.90999984741211,42.22999954223633,35.810001373291016,42.9900016784668,49.9900016784668,136.02000427246094,118.5199966430664,83.88999938964844,104.88999938964844,128.44000244140625\n2012-05-11,39.970001220703125,21.209999084472656,119.37999725341797,37.040000915527344,51.15999984741211,106.44000244140625,19.770000457763672,33.540000915527344,35.0099983215332,67.33999633789062,12.030869483947754,116.8499984741211,28.690000534057617,35.93000030517578,41.810001373291016,35.33000183105469,42.75,49.4900016784668,135.61000061035156,119.5,83.94999694824219,104.87999725341797,128.17999267578125\n2012-05-14,39.060001373291016,20.729999542236328,119.94000244140625,36.63999938964844,50.18000030517578,106.91000366210938,19.260000228881836,33.02000045776367,34.529998779296875,66.22000122070312,11.787164688110352,116.87999725341797,28.440000534057617,35.88999938964844,41.29999923706055,34.7400016784668,41.810001373291016,48.84000015258789,134.11000061035156,121.16999816894531,84.0999984741211,104.8499984741211,126.94999694824219\n2012-05-15,38.720001220703125,20.3799991607666,120.08000183105469,36.15999984741211,49.54999923706055,106.94000244140625,18.950000762939453,32.599998474121094,34.0099983215332,65.12000274658203,11.722177505493164,116.7300033569336,28.360000610351562,35.63999938964844,40.970001220703125,34.720001220703125,41.20000076293945,48.36000061035156,133.33999633789062,121.66000366210938,84.12000274658203,104.83999633789062,126.30999755859375\n2012-05-16,38.16999816894531,20.299999237060547,119.83999633789062,35.7599983215332,49.060001373291016,107.0199966430664,18.940000534057617,32.29999923706055,33.63999938964844,64.75,11.551584243774414,116.79000091552734,28.1299991607666,35.689998626708984,40.13999938964844,33.93000030517578,40.90999984741211,47.650001525878906,132.8300018310547,122.01000213623047,84.06999969482422,104.7699966430664,126.18000030517578\n2012-05-17,37.650001525878906,19.969999313354492,120.2300033569336,36.08000183105469,48.459999084472656,107.41999816894531,18.690000534057617,31.600000381469727,32.900001525878906,64.33999633789062,11.31600284576416,115.91999816894531,27.729999542236328,35.4900016784668,39.43000030517578,33.189998626708984,40.2400016784668,47.619998931884766,130.86000061035156,124.16999816894531,84.13999938964844,104.70999908447266,124.56999969482422\n2012-05-18,37.290000915527344,19.959999084472656,120.51000213623047,35.560001373291016,48.11000061035156,107.3499984741211,18.709999084472656,31.299999237060547,32.77000045776367,63.939998626708984,11.186027526855469,115.47000122070312,27.469999313354492,35.41999816894531,38.959999084472656,33.0,40.09000015258789,46.97999954223633,129.74000549316406,124.19999694824219,84.08999633789062,104.73999786376953,123.30999755859375\n2012-05-21,38.18000030517578,20.450000762939453,120.66999816894531,35.91999816894531,49.16999816894531,107.06999969482422,19.239999771118164,31.979999542236328,33.72999954223633,65.41000366210938,11.291632652282715,115.5999984741211,28.149999618530273,35.459999084472656,39.880001068115234,33.86000061035156,41.130001068115234,47.72999954223633,131.97000122070312,123.94000244140625,84.0999984741211,104.58000183105469,124.80999755859375\n2012-05-22,37.779998779296875,20.329999923706055,120.41999816894531,35.880001068115234,48.9900016784668,106.83999633789062,19.06999969482422,31.920000076293945,33.52000045776367,65.25,11.380990982055664,115.29000091552734,28.059999465942383,35.709999084472656,39.599998474121094,33.630001068115234,40.88999938964844,47.5,132.1999969482422,122.55999755859375,83.95999908447266,104.56999969482422,124.83000183105469\n2012-05-23,37.52000045776367,20.15999984741211,120.43000030517578,35.599998474121094,48.59000015258789,107.12000274658203,18.8700008392334,31.639999389648438,33.91999816894531,65.48999786376953,11.421608924865723,115.56999969482422,28.09000015258789,35.52000045776367,39.13999938964844,33.25,40.47999954223633,47.099998474121094,132.27000427246094,123.41000366210938,84.0199966430664,104.56999969482422,124.70999908447266\n2012-05-24,37.33000183105469,19.809999465942383,120.26000213623047,35.439998626708984,48.27000045776367,106.88999938964844,18.729999542236328,31.65999984741211,34.130001068115234,65.44000244140625,11.429732322692871,115.58999633789062,27.93000030517578,35.65999984741211,38.97999954223633,32.7400016784668,40.2400016784668,46.81999969482422,132.52999877929688,122.94000244140625,83.93000030517578,104.5199966430664,125.12000274658203\n2012-05-25,37.150001525878906,19.81999969482422,120.37999725341797,35.2400016784668,48.099998474121094,107.19999694824219,18.729999542236328,31.579999923706055,33.9900016784668,65.12999725341797,11.389114379882812,115.87999725341797,27.8700008392334,35.779998779296875,38.52000045776367,32.58000183105469,40.22999954223633,46.529998779296875,132.10000610351562,123.4000015258789,84.02999877929688,104.44999694824219,124.26000213623047\n2012-05-29,38.20000076293945,20.139999389648438,120.02999877929688,35.68000030517578,48.709999084472656,107.11000061035156,19.020000457763672,31.860000610351562,34.58000183105469,66.22000122070312,11.551584243774414,116.05000305175781,28.239999771118164,35.88999938964844,39.66999816894531,33.880001068115234,40.599998474121094,47.31999969482422,133.6999969482422,123.0199966430664,84.02999877929688,104.58000183105469,125.5999984741211\n2012-05-30,37.540000915527344,19.510000228881836,120.7300033569336,35.20000076293945,47.560001373291016,108.12999725341797,18.40999984741211,30.979999542236328,33.959999084472656,64.19000244140625,11.283509254455566,116.1500015258789,28.059999465942383,35.66999816894531,38.689998626708984,33.290000915527344,39.43000030517578,46.56999969482422,131.75999450683594,126.13999938964844,84.3499984741211,104.56999969482422,123.98999786376953\n2012-05-31,37.70000076293945,19.489999771118164,121.30999755859375,35.560001373291016,47.7599983215332,108.55000305175781,18.559999465942383,31.100000381469727,33.81999969482422,63.630001068115234,11.380990982055664,116.97000122070312,27.93000030517578,35.86000061035156,38.90999984741211,33.4900016784668,39.560001373291016,46.9900016784668,131.47000122070312,127.5999984741211,84.51000213623047,104.77999877929688,123.69999694824219\n2012-06-01,36.689998626708984,18.81999969482422,121.01000213623047,34.599998474121094,46.54999923706055,109.30999755859375,18.049999237060547,30.559999465942383,33.099998474121094,62.040000915527344,10.95857048034668,117.29000091552734,27.200000762939453,35.709999084472656,38.08000183105469,32.689998626708984,38.63999938964844,45.7599983215332,128.16000366210938,130.36000061035156,84.62000274658203,104.44999694824219,121.01000213623047\n2012-06-04,36.849998474121094,18.84000015258789,120.77999877929688,35.0,46.939998626708984,108.68000030517578,18.299999237060547,30.760000228881836,33.130001068115234,61.9900016784668,10.852965354919434,116.4000015258789,27.360000610351562,35.83000183105469,38.33000183105469,32.59000015258789,39.0099983215332,46.130001068115234,128.10000610351562,129.3300018310547,84.41000366210938,104.41999816894531,120.77999877929688\n2012-06-05,36.95000076293945,18.770000457763672,120.68000030517578,35.439998626708984,47.279998779296875,108.31999969482422,18.40999984741211,30.860000610351562,33.45000076293945,62.52000045776367,11.031682014465332,116.1500015258789,27.530000686645508,35.959999084472656,38.779998779296875,32.619998931884766,39.130001068115234,46.66999816894531,129.07000732421875,127.5999984741211,84.23999786376953,104.43000030517578,121.08999633789062\n2012-06-06,38.029998779296875,19.399999618530273,120.11000061035156,36.0,48.599998474121094,107.61000061035156,19.1200008392334,31.81999969482422,34.290000915527344,64.44999694824219,11.356620788574219,115.80999755859375,28.15999984741211,36.459999084472656,39.93000030517578,33.4900016784668,40.47999954223633,47.68000030517578,131.97000122070312,125.05000305175781,84.08000183105469,104.48999786376953,123.93000030517578\n2012-06-07,38.2599983215332,19.360000610351562,120.08999633789062,35.7599983215332,48.66999816894531,107.87000274658203,18.989999771118164,32.060001373291016,34.349998474121094,64.48999786376953,11.34849739074707,116.05000305175781,28.020000457763672,36.7400016784668,39.95000076293945,33.77000045776367,40.54999923706055,47.54999923706055,132.0500030517578,125.23999786376953,84.11000061035156,104.4800033569336,124.5199966430664\n2012-06-08,37.93000030517578,19.3799991607666,120.18000030517578,35.439998626708984,48.5099983215332,107.94999694824219,18.940000534057617,32.02000045776367,34.58000183105469,64.5,11.48659610748291,116.4800033569336,28.329999923706055,36.81999969482422,39.70000076293945,32.810001373291016,40.63999938964844,47.220001220703125,133.10000610351562,125.20999908447266,84.16000366210938,104.5999984741211,125.43000030517578\n2012-06-11,37.380001068115234,19.149999618530273,120.16999816894531,35.279998779296875,48.040000915527344,108.23999786376953,18.700000762939453,31.739999771118164,33.939998626708984,63.619998931884766,11.275385856628418,116.45999908447266,27.93000030517578,36.790000915527344,39.290000915527344,32.790000915527344,40.08000183105469,46.81999969482422,131.41000366210938,125.77999877929688,84.2300033569336,104.52999877929688,123.9800033569336\n2012-06-12,38.15999984741211,19.479999542236328,119.91000366210938,35.68000030517578,48.84000015258789,107.66000366210938,18.950000762939453,32.5,34.56999969482422,64.5199966430664,11.445979118347168,116.12000274658203,28.209999084472656,36.83000183105469,40.040000915527344,33.52000045776367,40.91999816894531,47.5,132.9199981689453,124.62999725341797,84.0999984741211,104.63999938964844,125.58999633789062\n2012-06-13,38.02000045776367,19.34000015258789,120.18000030517578,35.47999954223633,48.45000076293945,108.2300033569336,18.760000228881836,32.119998931884766,34.040000915527344,63.70000076293945,11.40536117553711,116.54000091552734,28.040000915527344,36.84000015258789,39.63999938964844,33.66999816894531,40.5,47.150001525878906,132.07000732421875,125.86000061035156,84.27999877929688,104.55000305175781,124.88999938964844\n2012-06-14,38.290000915527344,19.450000762939453,120.0199966430664,35.7599983215332,48.810001373291016,107.94000244140625,18.959999084472656,32.31999969482422,34.31999969482422,64.69999694824219,11.543460845947266,116.4000015258789,28.18000030517578,37.09000015258789,39.790000915527344,33.7400016784668,40.90999984741211,47.43000030517578,133.47000122070312,125.69999694824219,84.2300033569336,104.62999725341797,126.37000274658203\n2012-06-15,38.9900016784668,19.8799991607666,120.77999877929688,36.279998779296875,49.5,108.44000244140625,19.40999984741211,32.7599983215332,34.529998779296875,65.62000274658203,11.649065971374512,116.87999725341797,28.3700008392334,36.93000030517578,40.349998474121094,34.459999084472656,41.5099983215332,48.13999938964844,134.13999938964844,126.4000015258789,84.41999816894531,104.5999984741211,127.33999633789062\n2012-06-18,39.06999969482422,19.709999084472656,120.72000122070312,36.36000061035156,49.36000061035156,108.41000366210938,19.149999618530273,32.68000030517578,34.709999084472656,65.02999877929688,11.584077835083008,116.83000183105469,28.579999923706055,37.06999969482422,40.790000915527344,34.56999969482422,41.119998931884766,48.36000061035156,134.39999389648438,127.08000183105469,84.43000030517578,104.55000305175781,127.12999725341797\n2012-06-19,39.70000076293945,20.239999771118164,120.58999633789062,36.560001373291016,50.18000030517578,108.04000091552734,19.59000015258789,33.29999923706055,35.369998931884766,65.97000122070312,11.779041290283203,116.72000122070312,28.799999237060547,36.9900016784668,41.38999938964844,34.900001525878906,42.15999984741211,48.86000061035156,135.6999969482422,125.41999816894531,84.31999969482422,104.58000183105469,128.05999755859375\n2012-06-20,39.56999969482422,20.329999923706055,120.43000030517578,36.880001068115234,50.470001220703125,107.81999969482422,19.68000030517578,33.52000045776367,35.16999816894531,65.70999908447266,11.803411483764648,116.7699966430664,28.850000381469727,36.630001068115234,41.279998779296875,33.939998626708984,42.369998931884766,49.060001373291016,135.47999572753906,126.04000091552734,84.16000366210938,104.58000183105469,127.95999908447266\n2012-06-21,37.66999816894531,19.190000534057617,119.91999816894531,36.0,48.029998779296875,108.05000305175781,18.65999984741211,31.780000686645508,34.02000045776367,63.02000045776367,11.543460845947266,116.94999694824219,28.170000076293945,36.25,39.0099983215332,32.52000045776367,41.16999816894531,47.959999084472656,132.44000244140625,126.70999908447266,84.30000305175781,104.5999984741211,125.44000244140625\n2012-06-22,37.790000915527344,19.239999771118164,119.33999633789062,36.2400016784668,48.439998626708984,107.58000183105469,18.829999923706055,32.02000045776367,34.20000076293945,63.439998626708984,11.649065971374512,116.86000061035156,28.479999542236328,36.2599983215332,39.380001068115234,32.529998779296875,41.59000015258789,48.380001068115234,133.4600067138672,125.0199966430664,84.12999725341797,104.56999969482422,126.2300033569336\n2012-06-25,37.09000015258789,18.700000762939453,119.88999938964844,35.68000030517578,47.36000061035156,108.16999816894531,18.270000457763672,31.440000534057617,33.77000045776367,62.02000045776367,11.40536117553711,117.16000366210938,27.899999618530273,36.189998626708984,38.650001525878906,31.829999923706055,40.439998626708984,47.61000061035156,131.32000732421875,126.83999633789062,84.3499984741211,104.54000091552734,124.76000213623047\n2012-06-26,37.40999984741211,18.739999771118164,119.80999755859375,36.08000183105469,47.66999816894531,107.93000030517578,18.270000457763672,31.760000228881836,33.880001068115234,62.689998626708984,11.462225914001465,117.27999877929688,28.010000228881836,36.2400016784668,39.130001068115234,32.189998626708984,40.720001220703125,48.06999969482422,131.97999572753906,126.33999633789062,84.26000213623047,104.5999984741211,125.08000183105469\n2012-06-27,37.650001525878906,18.899999618530273,119.93000030517578,36.36000061035156,48.119998931884766,108.08000183105469,18.489999771118164,32.040000915527344,34.25,63.9900016784668,11.600324630737305,117.44000244140625,28.18000030517578,36.650001525878906,39.630001068115234,32.630001068115234,41.08000183105469,48.529998779296875,133.1699981689453,126.54000091552734,84.3499984741211,104.69999694824219,126.01000213623047\n2012-06-28,37.470001220703125,18.729999542236328,119.9800033569336,36.880001068115234,48.220001220703125,108.43000030517578,18.479999542236328,31.860000610351562,34.2599983215332,64.43000030517578,11.592201232910156,117.62000274658203,27.950000762939453,36.779998779296875,39.369998931884766,32.4900016784668,40.93000030517578,48.849998474121094,132.7899932861328,126.8499984741211,84.44000244140625,104.7300033569336,125.80000305175781\n2012-06-29,39.130001068115234,19.799999237060547,119.69999694824219,37.63999938964844,49.959999084472656,107.93000030517578,19.579999923706055,32.58000183105469,35.290000915527344,66.37000274658203,11.892769813537598,117.58999633789062,28.729999542236328,36.9900016784668,40.75,33.66999816894531,42.83000183105469,50.119998931884766,136.10000610351562,125.19999694824219,84.37999725341797,104.70999908447266,128.4499969482422\n2012-07-02,39.130001068115234,19.969999313354492,119.5999984741211,37.52000045776367,50.290000915527344,108.2699966430664,19.790000915527344,33.040000915527344,35.11000061035156,66.4000015258789,11.96588134765625,117.81999969482422,28.889999389648438,37.220001220703125,40.9900016784668,33.650001525878906,43.130001068115234,50.16999816894531,136.50999450683594,126.22000122070312,84.37000274658203,104.56999969482422,128.36000061035156\n2012-07-03,39.90999984741211,20.18000030517578,119.80999755859375,38.0,50.75,108.0,19.889999389648438,33.13999938964844,35.61000061035156,67.98999786376953,12.030869483947754,117.91999816894531,29.1200008392334,37.130001068115234,41.38999938964844,34.20000076293945,43.5,50.650001525878906,137.41000366210938,125.25,84.25,104.48999786376953,129.14999389648438\n2012-07-05,39.4900016784668,19.709999084472656,120.06999969482422,37.52000045776367,49.90999984741211,108.29000091552734,19.260000228881836,32.86000061035156,35.560001373291016,67.0999984741211,11.852152824401855,118.22000122070312,29.1200008392334,36.90999984741211,41.36000061035156,34.09000015258789,42.5099983215332,50.349998474121094,136.7899932861328,125.88999938964844,84.48999786376953,104.54000091552734,128.77999877929688\n2012-07-06,38.77000045776367,19.260000228881836,120.25,37.36000061035156,49.439998626708984,108.66999816894531,18.899999618530273,32.720001220703125,35.150001525878906,66.29000091552734,11.754671096801758,118.5199966430664,28.690000534057617,36.83000183105469,40.9900016784668,33.45000076293945,41.970001220703125,49.970001220703125,135.49000549316406,127.05999755859375,84.56999969482422,104.5,127.56999969482422\n2012-07-09,38.630001068115234,19.239999771118164,120.4800033569336,37.15999984741211,49.33000183105469,108.97000122070312,18.889999389648438,32.68000030517578,34.93000030517578,65.98999786376953,11.738424301147461,118.5999984741211,28.6299991607666,36.709999084472656,40.779998779296875,33.04999923706055,41.97999954223633,49.790000915527344,135.32000732421875,128.17999267578125,84.7300033569336,104.55000305175781,127.23999786376953\n2012-07-10,38.20000076293945,19.149999618530273,120.79000091552734,36.7599983215332,49.0,109.0199966430664,18.700000762939453,32.540000915527344,34.40999984741211,64.95999908447266,11.649065971374512,118.56999969482422,28.309999465942383,36.77000045776367,40.36000061035156,32.43000030517578,41.779998779296875,49.2400016784668,134.13999938964844,128.44000244140625,84.80999755859375,104.66999816894531,126.3499984741211\n2012-07-11,38.400001525878906,19.280000686645508,120.66999816894531,36.84000015258789,49.150001525878906,108.91999816894531,18.709999084472656,32.70000076293945,34.29999923706055,65.83999633789062,11.74654769897461,118.7699966430664,28.18000030517578,36.959999084472656,40.849998474121094,32.689998626708984,41.939998626708984,49.5099983215332,134.16000366210938,128.60000610351562,84.69000244140625,104.72000122070312,125.91000366210938\n2012-07-12,37.7599983215332,19.170000076293945,120.91000366210938,36.279998779296875,48.65999984741211,109.16999816894531,18.579999923706055,32.31999969482422,34.130001068115234,65.62000274658203,11.624695777893066,119.37000274658203,27.899999618530273,37.0099983215332,40.25,32.09000015258789,41.47999954223633,48.84000015258789,133.50999450683594,129.50999450683594,84.8499984741211,104.72000122070312,125.56999969482422\n2012-07-13,38.4900016784668,19.59000015258789,120.97000122070312,36.63999938964844,49.349998474121094,109.08000183105469,18.850000381469727,32.900001525878906,34.7400016784668,66.7699966430664,11.949634552001953,119.41000366210938,28.270000457763672,37.34000015258789,40.869998931884766,32.58000183105469,42.209999084472656,49.38999938964844,135.75,129.1699981689453,84.86000061035156,104.80000305175781,127.62000274658203\n2012-07-16,38.400001525878906,19.610000610351562,121.11000061035156,36.47999954223633,49.34000015258789,109.31999969482422,18.860000610351562,32.91999816894531,34.61000061035156,66.98999786376953,11.925264358520508,119.73999786376953,28.239999771118164,37.31999969482422,40.880001068115234,32.459999084472656,42.20000076293945,49.34000015258789,135.42999267578125,129.77000427246094,84.91000366210938,104.83999633789062,127.12000274658203\n2012-07-17,38.90999984741211,19.799999237060547,120.94999694824219,36.31999969482422,49.47999954223633,109.04000091552734,19.030000686645508,32.91999816894531,35.04999923706055,67.83000183105469,11.990251541137695,119.73999786376953,28.350000381469727,37.400001525878906,41.470001220703125,33.189998626708984,42.41999816894531,49.43000030517578,136.36000061035156,128.75,84.87999725341797,104.87000274658203,127.81999969482422\n2012-07-18,38.810001373291016,20.010000228881836,120.9800033569336,36.439998626708984,49.869998931884766,109.1500015258789,19.239999771118164,33.119998931884766,35.2599983215332,68.41999816894531,11.933387756347656,120.4000015258789,28.84000015258789,37.52000045776367,41.709999084472656,32.970001220703125,42.72999954223633,49.68000030517578,137.3699951171875,128.82000732421875,85.0199966430664,104.98999786376953,128.9600067138672\n2012-07-19,39.16999816894531,20.25,121.08999633789062,36.720001220703125,50.33000183105469,108.98999786376953,19.399999618530273,33.5,35.63999938964844,68.62999725341797,11.860276222229004,120.61000061035156,29.09000015258789,37.59000015258789,42.220001220703125,33.709999084472656,43.13999938964844,50.15999984741211,137.72999572753906,128.49000549316406,85.0,105.0199966430664,129.32000732421875\n2012-07-20,38.59000015258789,19.65999984741211,121.47000122070312,35.84000015258789,49.150001525878906,109.41999816894531,18.829999923706055,32.81999969482422,35.41999816894531,68.79000091552734,11.681559562683105,120.69999694824219,28.760000228881836,37.66999816894531,41.72999954223633,33.2599983215332,41.9900016784668,49.130001068115234,136.47000122070312,130.05999755859375,85.16000366210938,104.95999908447266,128.0399932861328\n2012-07-23,37.58000183105469,19.020000457763672,121.37000274658203,35.36000061035156,48.13999938964844,109.5999984741211,18.280000686645508,32.08000183105469,34.86000061035156,68.12999725341797,11.584077835083008,120.30999755859375,28.479999542236328,37.41999816894531,40.939998626708984,32.599998474121094,40.959999084472656,48.45000076293945,135.08999633789062,130.7899932861328,85.19999694824219,104.94000244140625,126.91000366210938\n2012-07-24,37.41999816894531,18.75,121.44000244140625,35.040000915527344,47.619998931884766,109.80999755859375,17.989999771118164,31.700000762939453,34.31999969482422,67.04000091552734,11.551584243774414,120.5,28.190000534057617,37.09000015258789,40.849998474121094,32.47999954223633,40.36000061035156,48.13999938964844,133.92999267578125,131.82000732421875,85.30000305175781,104.9800033569336,125.86000061035156\n2012-07-25,37.599998474121094,19.010000228881836,121.30999755859375,35.040000915527344,47.869998931884766,109.87000274658203,18.18000030517578,31.719999313354492,34.31999969482422,67.08999633789062,11.592201232910156,120.7300033569336,28.079999923706055,37.06999969482422,41.16999816894531,32.68000030517578,40.75,48.25,133.9600067138672,132.16000366210938,85.36000061035156,105.01000213623047,126.51000213623047\n2012-07-26,38.45000076293945,19.68000030517578,121.13999938964844,35.560001373291016,49.33000183105469,109.52999877929688,19.1200008392334,32.599998474121094,34.47999954223633,69.0,11.770917892456055,120.91999816894531,28.510000228881836,37.650001525878906,41.900001525878906,33.2400016784668,42.33000183105469,49.0,136.1699981689453,130.9499969482422,85.30000305175781,105.06999969482422,128.5800018310547\n2012-07-27,39.529998779296875,20.34000015258789,120.79000091552734,36.20000076293945,50.369998931884766,108.73999786376953,19.780000686645508,33.119998931884766,35.11000061035156,70.22000122070312,11.990251541137695,120.3499984741211,29.1299991607666,38.09000015258789,42.779998779296875,34.119998931884766,43.369998931884766,49.86000061035156,138.67999267578125,128.47999572753906,84.9800033569336,105.05999755859375,130.5399932861328\n2012-07-30,39.29999923706055,20.200000762939453,121.12999725341797,36.0,50.310001373291016,109.08999633789062,19.649999618530273,33.20000076293945,35.08000183105469,70.41999816894531,11.96588134765625,120.66000366210938,29.139999389648438,38.22999954223633,42.880001068115234,34.060001373291016,43.33000183105469,49.7400016784668,138.67999267578125,129.44000244140625,85.13999938964844,105.1500015258789,130.39999389648438\n2012-07-31,39.119998931884766,20.209999084472656,121.44000244140625,35.959999084472656,50.0,109.27999877929688,19.5,32.86000061035156,34.84000015258789,69.6500015258789,11.909016609191895,121.27999877929688,29.260000228881836,37.91999816894531,42.81999969482422,34.209999084472656,42.970001220703125,49.66999816894531,137.7100067138672,129.6999969482422,85.2300033569336,105.2699966430664,129.69000244140625\n2012-08-01,39.189998626708984,20.09000015258789,121.48999786376953,35.84000015258789,50.0099983215332,108.72000122070312,19.559999465942383,33.060001373291016,34.849998474121094,69.98999786376953,11.852152824401855,120.76000213623047,29.15999984741211,37.630001068115234,42.7400016784668,34.29999923706055,43.04999923706055,49.619998931884766,137.58999633789062,128.77999877929688,84.94000244140625,105.12999725341797,129.4499969482422\n2012-08-02,38.72999954223633,19.56999969482422,121.47000122070312,35.68000030517578,49.310001373291016,108.9800033569336,19.0,32.70000076293945,34.439998626708984,68.81999969482422,11.762794494628906,120.83999633789062,28.969999313354492,37.41999816894531,42.52000045776367,33.959999084472656,42.189998626708984,49.38999938964844,136.63999938964844,129.50999450683594,85.0999984741211,104.95999908447266,128.5399932861328\n2012-08-03,39.93000030517578,20.690000534057617,121.25,36.08000183105469,50.9900016784668,108.41000366210938,20.1200008392334,33.70000076293945,35.119998931884766,70.44000244140625,12.038992881774902,120.55000305175781,29.540000915527344,37.86000061035156,43.47999954223633,34.79999923706055,44.09000015258789,50.11000061035156,139.35000610351562,127.41999816894531,84.79000091552734,105.0,130.72999572753906\n2012-08-06,40.18000030517578,20.860000610351562,121.33000183105469,36.439998626708984,51.349998474121094,108.4800033569336,20.309999465942383,33.81999969482422,35.439998626708984,70.62999725341797,12.087733268737793,120.70999908447266,29.75,37.77000045776367,43.41999816894531,34.9900016784668,44.380001068115234,50.380001068115234,139.6199951171875,127.47000122070312,84.87000274658203,105.05999755859375,130.89999389648438\n2012-08-07,40.290000915527344,20.979999542236328,121.06999969482422,36.880001068115234,51.779998779296875,107.91000366210938,20.6299991607666,33.97999954223633,35.849998474121094,71.69000244140625,12.136474609375,120.08000183105469,29.950000762939453,37.380001068115234,43.689998626708984,35.189998626708984,44.72999954223633,50.869998931884766,140.32000732421875,125.83000183105469,84.6500015258789,105.0999984741211,131.3800048828125\n2012-08-08,40.369998931884766,20.889999389648438,120.70999908447266,36.79999923706055,51.75,107.76000213623047,20.5,34.2400016784668,35.88999938964844,71.75,12.136474609375,119.73999786376953,29.959999084472656,37.43000030517578,43.810001373291016,35.25,44.70000076293945,50.83000183105469,140.49000549316406,125.16000366210938,84.62999725341797,105.05999755859375,131.5500030517578\n2012-08-09,40.540000915527344,20.790000915527344,120.4800033569336,36.880001068115234,51.779998779296875,107.68000030517578,20.469999313354492,34.15999984741211,36.09000015258789,72.23999786376953,12.128351211547852,119.66000366210938,30.059999465942383,37.43000030517578,43.88999938964844,35.290000915527344,44.630001068115234,50.93000030517578,140.61000061035156,125.06999969482422,84.58000183105469,105.05999755859375,131.57000732421875\n2012-08-10,40.72999954223633,20.84000015258789,120.55999755859375,36.91999816894531,51.869998931884766,107.98999786376953,20.440000534057617,34.400001525878906,36.060001373291016,72.37000274658203,12.136474609375,120.0,30.1299991607666,37.540000915527344,43.709999084472656,35.22999954223633,44.7599983215332,50.91999816894531,140.83999633789062,125.69999694824219,84.68000030517578,105.12000274658203,131.92999267578125\n2012-08-13,40.369998931884766,20.780000686645508,120.4000015258789,36.84000015258789,51.619998931884766,107.91999816894531,20.40999984741211,34.2599983215332,35.86000061035156,72.0999984741211,12.144598007202148,119.75,30.219999313354492,37.5,43.470001220703125,34.91999816894531,44.54999923706055,50.75,140.77000427246094,125.48999786376953,84.69000244140625,105.0999984741211,131.6199951171875\n2012-08-14,40.36000061035156,20.850000381469727,119.87000274658203,36.79999923706055,51.7400016784668,107.38999938964844,20.43000030517578,34.380001068115234,35.70000076293945,71.97000122070312,12.128351211547852,119.20999908447266,30.15999984741211,37.459999084472656,43.47999954223633,35.20000076293945,44.709999084472656,50.65999984741211,140.7899932861328,123.79000091552734,84.4800033569336,105.16999816894531,131.66000366210938\n2012-08-15,40.29999923706055,20.739999771118164,118.9800033569336,36.599998474121094,51.59000015258789,106.8499984741211,20.389999389648438,34.380001068115234,35.7599983215332,71.95999908447266,12.168968200683594,118.6500015258789,30.170000076293945,37.279998779296875,43.369998931884766,34.93000030517578,44.70000076293945,50.47999954223633,140.9499969482422,122.05000305175781,84.18000030517578,105.18000030517578,131.72000122070312\n2012-08-16,40.66999816894531,21.030000686645508,118.69000244140625,37.08000183105469,52.22999954223633,106.58999633789062,20.760000228881836,34.560001373291016,36.290000915527344,72.5999984741211,12.250203132629395,118.30000305175781,30.579999923706055,37.189998626708984,43.83000183105469,34.619998931884766,45.20000076293945,51.08000183105469,141.99000549316406,121.01000213623047,84.08999633789062,105.2699966430664,132.57000732421875\n2012-08-17,40.470001220703125,21.149999618530273,118.8499984741211,37.36000061035156,52.29999923706055,106.72000122070312,20.729999542236328,34.52000045776367,36.2400016784668,72.56999969482422,12.290820121765137,118.45999908447266,30.75,37.09000015258789,43.72999954223633,34.5,45.2400016784668,51.279998779296875,142.17999267578125,121.5999984741211,84.2300033569336,105.30000305175781,132.4199981689453\n2012-08-20,40.45000076293945,21.149999618530273,118.79000091552734,37.279998779296875,52.2400016784668,106.77999877929688,20.729999542236328,34.400001525878906,36.16999816894531,72.31999969482422,12.323314666748047,118.79000091552734,30.780000686645508,37.15999984741211,43.95000076293945,34.459999084472656,45.13999938964844,51.2599983215332,142.19000244140625,121.8499984741211,84.19000244140625,105.36000061035156,132.3800048828125\n2012-08-21,40.38999938964844,21.389999389648438,118.87000274658203,37.279998779296875,52.540000915527344,106.87000274658203,21.010000228881836,34.47999954223633,36.220001220703125,72.08999633789062,12.363931655883789,118.98999786376953,30.579999923706055,36.88999938964844,44.13999938964844,34.290000915527344,45.47999954223633,51.38999938964844,141.75999450683594,122.38999938964844,84.33999633789062,105.26000213623047,131.77000427246094\n2012-08-22,40.40999984741211,21.440000534057617,119.83999633789062,37.2400016784668,52.47999954223633,107.69999694824219,21.0,34.439998626708984,36.52000045776367,72.36000061035156,12.347684860229492,119.66999816894531,30.6299991607666,36.83000183105469,44.13999938964844,34.279998779296875,45.439998626708984,51.38999938964844,141.82000732421875,124.41000366210938,84.68000030517578,105.19000244140625,131.47000122070312\n2012-08-23,40.040000915527344,21.209999084472656,120.4000015258789,37.2400016784668,52.18000030517578,107.88999938964844,20.760000228881836,34.29999923706055,35.90999984741211,71.55999755859375,12.22583293914795,119.76000213623047,30.3799991607666,36.45000076293945,43.7400016784668,34.20000076293945,45.09000015258789,51.189998626708984,140.66000366210938,124.93000030517578,84.72000122070312,105.1500015258789,130.3800048828125\n2012-08-24,40.04999923706055,21.149999618530273,120.37999725341797,37.20000076293945,52.099998474121094,107.83999633789062,20.65999984741211,34.13999938964844,35.84000015258789,71.9800033569336,12.290820121765137,119.88999938964844,30.56999969482422,36.619998931884766,43.79999923706055,34.0099983215332,45.02000045776367,51.2400016784668,141.50999450683594,124.80999755859375,84.72000122070312,105.1500015258789,131.3800048828125\n2012-08-27,39.63999938964844,21.309999465942383,120.7699966430664,37.08000183105469,52.130001068115234,108.12000274658203,20.780000686645508,34.2599983215332,35.630001068115234,72.01000213623047,12.282696723937988,120.04000091552734,30.600000381469727,36.70000076293945,43.459999084472656,33.5099983215332,45.18000030517578,50.939998626708984,141.5399932861328,125.54000091552734,84.8499984741211,105.12999725341797,131.05999755859375\n2012-08-28,39.560001373291016,21.3799991607666,121.08000183105469,36.7599983215332,52.08000183105469,108.16000366210938,20.81999969482422,34.20000076293945,35.54999923706055,72.05999755859375,12.266449928283691,120.20999908447266,30.530000686645508,36.630001068115234,43.630001068115234,33.61000061035156,45.13999938964844,50.77000045776367,141.39999389648438,125.83999633789062,84.87999725341797,105.2300033569336,130.86000061035156\n2012-08-29,39.369998931884766,21.329999923706055,120.66999816894531,36.880001068115234,51.91999816894531,108.08999633789062,20.6200008392334,34.099998474121094,35.630001068115234,71.58000183105469,12.290820121765137,119.95999908447266,30.59000015258789,36.56999969482422,43.560001373291016,33.5,44.95000076293945,50.810001373291016,141.50999450683594,125.29000091552734,84.80999755859375,105.31999969482422,130.9199981689453\n2012-08-30,38.90999984741211,20.940000534057617,120.58000183105469,36.20000076293945,51.150001525878906,108.29000091552734,20.3700008392334,33.79999923706055,35.310001373291016,70.81999969482422,12.22583293914795,120.0,30.25,36.38999938964844,42.7599983215332,32.95000076293945,44.45000076293945,49.91999816894531,140.49000549316406,125.94000244140625,84.87999725341797,105.38999938964844,129.9199981689453\n2012-08-31,39.279998779296875,21.219999313354492,121.13999938964844,36.2400016784668,51.599998474121094,108.98999786376953,20.610000610351562,33.939998626708984,35.650001525878906,71.52999877929688,12.315191268920898,120.83000183105469,30.489999771118164,36.349998474121094,43.380001068115234,33.06999969482422,44.97999954223633,50.220001220703125,141.16000366210938,127.72000122070312,85.18000030517578,105.51000213623047,130.8800048828125\n2012-09-04,39.060001373291016,21.190000534057617,120.9800033569336,35.7599983215332,51.34000015258789,108.58999633789062,20.639999389648438,33.779998779296875,35.189998626708984,70.9800033569336,12.315191268920898,120.16000366210938,30.489999771118164,36.4900016784668,42.68000030517578,32.459999084472656,44.849998474121094,49.459999084472656,141.02999877929688,127.31999969482422,84.94000244140625,105.27999877929688,130.22999572753906\n2012-09-05,38.86000061035156,21.329999923706055,121.18000030517578,35.31999969482422,51.20000076293945,108.55000305175781,20.65999984741211,33.720001220703125,35.349998474121094,70.70999908447266,12.315191268920898,120.20999908447266,30.459999084472656,36.33000183105469,42.540000915527344,32.16999816894531,44.880001068115234,49.130001068115234,140.91000366210938,126.72000122070312,84.94000244140625,105.31999969482422,130.3699951171875\n2012-09-06,39.720001220703125,21.989999771118164,120.5199966430664,35.79999923706055,52.470001220703125,107.80999755859375,21.329999923706055,34.47999954223633,36.2400016784668,72.19999694824219,12.607636451721191,119.68000030517578,31.139999389648438,36.7400016784668,43.470001220703125,32.72999954223633,46.2400016784668,49.869998931884766,143.77000427246094,124.61000061035156,84.73999786376953,105.30000305175781,132.82000732421875\n2012-09-07,40.63999938964844,22.479999542236328,120.91000366210938,36.279998779296875,53.2599983215332,107.94999694824219,21.770000457763672,34.84000015258789,36.95000076293945,73.44999694824219,12.737611770629883,119.93000030517578,31.09000015258789,36.619998931884766,44.02000045776367,33.65999984741211,46.88999938964844,50.5099983215332,144.3300018310547,124.02999877929688,84.73999786376953,105.41000366210938,132.94000244140625\n2012-09-10,40.119998931884766,22.270000457763672,121.22000122070312,36.279998779296875,52.84000015258789,108.0,21.489999771118164,34.63999938964844,36.88999938964844,73.12999725341797,12.632006645202637,119.91999816894531,30.760000228881836,36.58000183105469,43.58000183105469,33.060001373291016,46.40999984741211,50.290000915527344,143.50999450683594,124.33000183105469,84.76000213623047,105.51000213623047,132.47999572753906\n2012-09-11,40.599998474121094,22.739999771118164,121.0999984741211,36.439998626708984,53.439998626708984,107.80000305175781,21.8700008392334,34.84000015258789,37.02000045776367,73.91000366210938,12.737611770629883,120.0199966430664,30.84000015258789,36.4900016784668,44.189998626708984,33.400001525878906,47.09000015258789,50.75,143.91000366210938,123.55000305175781,84.6500015258789,105.52999877929688,133.08999633789062\n2012-09-12,40.779998779296875,22.940000534057617,120.51000213623047,36.84000015258789,53.790000915527344,107.2699966430664,22.030000686645508,34.91999816894531,36.970001220703125,74.36000061035156,12.786352157592773,119.77999877929688,31.010000228881836,36.279998779296875,44.43000030517578,33.779998779296875,47.25,51.22999954223633,144.38999938964844,122.01000213623047,84.52999877929688,105.47000122070312,133.3699951171875\n2012-09-13,41.880001068115234,23.25,121.5199966430664,37.439998626708984,54.61000061035156,107.58000183105469,22.209999084472656,35.58000183105469,37.880001068115234,75.56999969482422,13.119415283203125,120.41999816894531,31.43000030517578,36.790000915527344,45.16999816894531,34.58000183105469,48.040000915527344,52.02000045776367,146.58999633789062,121.52999877929688,84.69999694824219,105.69000244140625,135.38999938964844\n2012-09-14,42.369998931884766,23.530000686645508,121.93000030517578,37.84000015258789,55.150001525878906,106.56999969482422,22.610000610351562,35.900001525878906,38.349998474121094,76.56999969482422,13.225020408630371,119.69999694824219,31.579999923706055,36.540000915527344,45.5,35.189998626708984,48.540000915527344,52.470001220703125,147.24000549316406,118.30000305175781,84.27999877929688,105.69999694824219,135.86000061035156\n2012-09-17,41.90999984741211,23.469999313354492,121.81999969482422,37.47999954223633,54.86000061035156,106.79000091552734,22.43000030517578,35.7599983215332,37.7599983215332,75.98999786376953,13.103168487548828,120.11000061035156,31.610000610351562,36.310001373291016,45.130001068115234,34.7400016784668,48.27000045776367,52.040000915527344,146.74000549316406,119.72000122070312,84.4000015258789,105.69999694824219,135.52999877929688\n2012-09-18,41.93000030517578,23.260000228881836,121.66000366210938,37.560001373291016,54.630001068115234,107.05999755859375,22.110000610351562,35.720001220703125,37.65999984741211,75.44999694824219,13.038180351257324,120.4800033569336,31.6299991607666,36.20000076293945,45.060001373291016,34.52000045776367,48.0,52.029998779296875,146.6199951171875,120.31999969482422,84.5,105.68000030517578,135.61000061035156\n2012-09-19,41.93000030517578,23.3700008392334,121.80999755859375,37.63999938964844,54.86000061035156,107.30999755859375,22.229999542236328,35.880001068115234,37.869998931884766,74.72000122070312,13.030056953430176,120.68000030517578,31.65999984741211,36.2400016784668,45.36000061035156,35.08000183105469,48.189998626708984,52.2599983215332,146.6999969482422,121.11000061035156,84.61000061035156,105.66000366210938,135.72999572753906\n2012-09-20,41.68000030517578,23.270000457763672,121.4000015258789,37.2400016784668,54.5099983215332,107.37000274658203,22.040000915527344,35.63999938964844,37.810001373291016,74.93000030517578,12.956945419311523,120.58000183105469,31.600000381469727,36.38999938964844,45.04999923706055,34.52000045776367,47.81999969482422,51.869998931884766,146.7100067138672,121.41000366210938,84.62999725341797,105.73999786376953,135.9499969482422\n2012-09-21,41.779998779296875,23.43000030517578,121.5,37.439998626708984,54.540000915527344,107.5999984741211,22.079999923706055,35.599998474121094,37.45000076293945,74.68000030517578,12.859463691711426,120.80000305175781,31.510000228881836,36.029998779296875,45.08000183105469,34.7400016784668,48.0099983215332,51.970001220703125,145.8699951171875,121.55000305175781,84.72000122070312,105.68000030517578,135.47000122070312\n2012-09-24,41.7400016784668,23.280000686645508,121.41999816894531,37.36000061035156,54.349998474121094,107.83999633789062,21.93000030517578,35.540000915527344,37.34000015258789,74.30000305175781,12.867587089538574,120.9800033569336,31.309999465942383,36.369998931884766,44.880001068115234,34.650001525878906,46.720001220703125,51.040000915527344,145.64999389648438,122.5,84.80999755859375,105.5999984741211,135.32000732421875\n2012-09-25,41.119998931884766,23.020000457763672,121.58000183105469,37.36000061035156,53.970001220703125,108.23999786376953,21.719999313354492,35.29999923706055,36.7400016784668,73.48999786376953,12.672623634338379,121.22000122070312,30.8700008392334,36.290000915527344,44.2400016784668,34.20000076293945,46.29999923706055,50.7599983215332,144.10000610351562,123.70999908447266,84.9800033569336,105.58999633789062,134.33999633789062\n2012-09-26,40.93000030517578,22.729999542236328,121.86000061035156,36.959999084472656,53.43000030517578,108.69000244140625,21.3799991607666,34.959999084472656,36.560001373291016,72.79000091552734,12.591388702392578,121.55999755859375,30.649999618530273,36.369998931884766,44.130001068115234,33.880001068115234,45.63999938964844,50.439998626708984,143.2899932861328,125.04000091552734,85.12000274658203,105.52999877929688,133.89999389648438\n2012-09-27,41.58000183105469,22.969999313354492,121.83999633789062,37.400001525878906,54.06999969482422,108.45999908447266,21.639999389648438,35.31999969482422,37.0099983215332,73.77999877929688,12.705118179321289,121.5,31.049999237060547,36.220001220703125,44.95000076293945,34.7400016784668,46.2599983215332,51.16999816894531,144.63999938964844,124.1500015258789,85.06999969482422,105.63999938964844,134.60000610351562\n2012-09-28,41.33000183105469,22.56999969482422,121.76000213623047,36.68000030517578,53.0,108.45999908447266,20.979999542236328,34.79999923706055,36.79999923706055,73.43000030517578,12.66450023651123,121.7699966430664,30.829999923706055,36.38999938964844,44.59000015258789,34.599998474121094,45.2599983215332,50.36000061035156,143.97000122070312,124.22000122070312,85.1500015258789,105.76000213623047,134.0500030517578\n2012-10-01,41.7400016784668,22.729999542236328,122.0,36.560001373291016,53.43000030517578,108.5199966430664,21.34000015258789,35.02000045776367,36.91999816894531,73.80000305175781,12.721364974975586,121.70999908447266,30.760000228881836,36.220001220703125,45.0,34.939998626708984,45.77000045776367,50.4900016784668,144.35000610351562,124.41999816894531,85.04000091552734,105.29000091552734,134.77999877929688\n2012-10-02,41.79999923706055,22.90999984741211,122.5,36.400001525878906,53.63999938964844,108.44999694824219,21.40999984741211,35.040000915527344,36.720001220703125,73.93000030517578,12.745735168457031,121.75,30.799999237060547,36.40999984741211,44.91999816894531,34.91999816894531,46.08000183105469,50.43000030517578,144.5,124.25,85.04000091552734,105.36000061035156,134.47999572753906\n2012-10-03,41.52000045776367,22.90999984741211,122.62999725341797,36.2400016784668,53.41999816894531,108.55999755859375,21.280000686645508,34.959999084472656,36.54999923706055,73.0199966430664,12.859463691711426,121.83000183105469,30.959999084472656,36.59000015258789,44.77000045776367,34.90999984741211,45.849998474121094,50.20000076293945,145.08999633789062,124.29000091552734,85.01000213623047,105.37999725341797,134.67999267578125\n2012-10-04,41.95000076293945,23.170000076293945,122.80999755859375,36.68000030517578,54.06999969482422,108.12999725341797,21.59000015258789,35.459999084472656,37.02000045776367,73.75,13.054427146911621,121.7300033569336,31.049999237060547,36.79999923706055,45.08000183105469,35.150001525878906,46.5099983215332,50.66999816894531,146.1300048828125,122.73999786376953,84.87000274658203,105.41000366210938,135.52000427246094\n2012-10-05,41.95000076293945,23.31999969482422,122.55999755859375,36.68000030517578,54.13999938964844,107.63999938964844,21.75,35.34000015258789,37.20000076293945,73.58000183105469,13.046303749084473,121.54000091552734,30.889999389648438,36.7400016784668,45.0,35.369998931884766,46.61000061035156,50.59000015258789,146.13999938964844,121.1500015258789,84.77999877929688,105.48999786376953,135.9600067138672\n2012-10-08,41.58000183105469,23.020000457763672,122.8499984741211,36.47999954223633,53.81999969482422,107.98999786376953,21.540000915527344,35.119998931884766,37.130001068115234,73.69999694824219,13.038180351257324,121.86000061035156,30.56999969482422,36.79999923706055,44.880001068115234,34.9900016784668,46.25,50.40999984741211,145.63999938964844,122.16999816894531,84.88999938964844,105.41999816894531,135.64999389648438\n2012-10-09,41.27000045776367,22.579999923706055,122.54000091552734,35.880001068115234,53.040000915527344,107.7699966430664,21.100000381469727,34.7400016784668,36.779998779296875,73.80000305175781,12.956945419311523,121.98999786376953,30.18000030517578,36.72999954223633,44.72999954223633,35.02000045776367,45.43000030517578,49.88999938964844,144.1999969482422,121.94999694824219,84.73999786376953,105.48999786376953,134.58999633789062\n2012-10-10,41.02000045776367,22.549999237060547,122.41000366210938,35.599998474121094,52.88999938964844,108.02999877929688,21.06999969482422,34.619998931884766,36.380001068115234,72.41999816894531,12.948822021484375,122.20999908447266,30.059999465942383,36.66999816894531,44.68000030517578,35.2599983215332,45.41999816894531,49.619998931884766,143.27999877929688,122.80999755859375,84.87000274658203,105.48999786376953,133.27999877929688\n2012-10-11,41.400001525878906,22.770000457763672,122.30000305175781,35.79999923706055,53.22999954223633,108.12999725341797,21.280000686645508,34.880001068115234,36.529998779296875,72.95999908447266,13.021933555603027,122.61000061035156,29.940000534057617,36.709999084472656,44.91999816894531,36.09000015258789,45.790000915527344,49.810001373291016,143.36000061035156,123.66000366210938,84.94000244140625,105.66000366210938,133.1300048828125\n2012-10-12,41.27000045776367,22.780000686645508,122.19999694824219,35.84000015258789,53.16999816894531,108.13999938964844,21.329999923706055,34.86000061035156,36.369998931884766,72.55999755859375,12.843216896057129,122.75,29.920000076293945,36.5,44.7599983215332,36.380001068115234,45.75,49.75,142.88999938964844,123.97000122070312,85.0,105.75,133.1300048828125\n2012-10-15,41.5099983215332,22.959999084472656,122.19000244140625,36.08000183105469,53.689998626708984,108.16999816894531,21.59000015258789,35.040000915527344,36.68000030517578,72.93000030517578,12.989439010620117,123.12999725341797,30.06999969482422,36.650001525878906,45.15999984741211,36.650001525878906,46.2400016784668,50.189998626708984,144.0800018310547,123.69000244140625,84.97000122070312,105.91000366210938,134.02000427246094\n2012-10-16,41.939998626708984,23.399999618530273,121.66999816894531,36.599998474121094,54.58000183105469,107.66000366210938,22.229999542236328,35.47999954223633,37.560001373291016,74.08999633789062,13.070673942565918,123.05000305175781,30.479999542236328,36.790000915527344,45.540000915527344,36.849998474121094,47.08000183105469,50.77000045776367,145.5399932861328,121.9800033569336,84.80000305175781,105.8499984741211,135.3000030517578\n2012-10-17,42.27000045776367,23.579999923706055,121.30999755859375,36.79999923706055,55.09000015258789,106.9800033569336,22.43000030517578,35.7599983215332,37.869998931884766,75.0199966430664,13.241267204284668,122.80999755859375,30.31999969482422,37.2400016784668,46.150001525878906,37.349998474121094,47.5099983215332,51.2400016784668,146.1999969482422,120.8499984741211,84.58999633789062,105.76000213623047,135.42999267578125\n2012-10-18,42.150001525878906,23.549999237060547,121.30000305175781,37.040000915527344,54.880001068115234,106.79000091552734,22.350000381469727,35.47999954223633,37.880001068115234,75.01000213623047,13.265637397766113,122.58000183105469,29.969999313354492,37.40999984741211,45.97999954223633,37.45000076293945,47.20000076293945,51.34000015258789,145.82000732421875,120.11000061035156,84.55000305175781,105.87000274658203,135.36000061035156\n2012-10-19,41.5,23.219999313354492,121.70999908447266,36.560001373291016,54.13999938964844,107.23999786376953,22.020000457763672,35.15999984741211,37.09000015258789,73.83000183105469,13.086920738220215,122.80000305175781,29.290000915527344,37.11000061035156,45.36000061035156,37.130001068115234,46.59000015258789,50.7400016784668,143.38999938964844,121.73999786376953,84.68000030517578,105.83999633789062,133.11000061035156\n2012-10-22,41.900001525878906,23.299999237060547,121.51000213623047,37.08000183105469,54.52000045776367,106.87999725341797,22.1299991607666,35.31999969482422,37.2599983215332,73.45999908447266,13.086920738220215,122.51000213623047,29.489999771118164,37.0099983215332,45.66999816894531,37.66999816894531,46.88999938964844,51.189998626708984,143.41000366210938,120.95999908447266,84.55999755859375,105.83000183105469,133.10000610351562\n2012-10-23,41.040000915527344,22.700000762939453,121.7699966430664,36.31999969482422,53.349998474121094,107.38999938964844,21.549999237060547,34.599998474121094,36.13999938964844,71.75,12.867587089538574,122.72000122070312,29.170000076293945,36.66999816894531,45.029998779296875,36.97999954223633,45.70000076293945,50.290000915527344,141.4199981689453,122.69000244140625,84.75,105.87000274658203,130.74000549316406\n2012-10-24,41.08000183105469,22.600000381469727,121.58000183105469,36.400001525878906,53.380001068115234,107.16000366210938,21.489999771118164,34.720001220703125,36.119998931884766,71.19999694824219,12.867587089538574,122.38999938964844,29.0,36.400001525878906,45.5099983215332,37.20000076293945,45.689998626708984,50.630001068115234,141.02000427246094,121.4800033569336,84.70999908447266,105.83999633789062,130.5\n2012-10-25,41.529998779296875,22.729999542236328,121.22000122070312,36.68000030517578,53.70000076293945,106.7699966430664,21.469999313354492,35.060001373291016,36.040000915527344,71.87000274658203,12.900081634521484,122.04000091552734,28.940000534057617,36.58000183105469,45.849998474121094,37.529998779296875,45.970001220703125,50.9900016784668,141.42999267578125,120.86000061035156,84.56999969482422,105.75,130.77999877929688\n2012-10-26,41.209999084472656,22.799999237060547,121.81999969482422,36.47999954223633,53.619998931884766,107.44999694824219,21.6200008392334,35.02000045776367,36.11000061035156,71.95999908447266,12.83509349822998,122.63999938964844,28.989999771118164,36.58000183105469,45.540000915527344,36.93000030517578,46.0,50.709999084472656,141.35000610351562,122.63999938964844,84.75,105.79000091552734,130.7899932861328\n2012-10-31,41.150001525878906,22.940000534057617,122.5199966430664,36.2400016784668,53.58000183105469,107.88999938964844,21.59000015258789,34.959999084472656,36.029998779296875,71.94000244140625,12.916328430175781,123.0199966430664,28.8700008392334,36.900001525878906,45.70000076293945,36.790000915527344,46.060001373291016,50.52000045776367,141.35000610351562,123.36000061035156,84.88999938964844,105.80999755859375,130.60000610351562\n2012-11-01,41.81999969482422,23.1299991607666,122.08999633789062,36.599998474121094,54.209999084472656,107.52999877929688,21.8700008392334,35.41999816894531,36.72999954223633,72.25,13.078797340393066,122.4800033569336,29.34000015258789,36.5099983215332,45.880001068115234,37.75,46.560001373291016,50.900001525878906,142.8300018310547,122.3499984741211,84.76000213623047,105.63999938964844,131.97999572753906\n2012-11-02,41.599998474121094,22.8799991607666,122.0199966430664,36.31999969482422,53.689998626708984,107.62000274658203,21.6299991607666,35.02000045776367,36.06999969482422,71.05999755859375,12.997563362121582,122.23999786376953,28.959999084472656,36.2599983215332,45.2599983215332,37.459999084472656,46.06999969482422,50.41999816894531,141.55999755859375,122.26000213623047,84.79000091552734,105.75,130.6699981689453\n2012-11-05,41.79999923706055,22.8700008392334,122.18000030517578,36.31999969482422,53.560001373291016,107.87999725341797,21.440000534057617,34.959999084472656,36.31999969482422,71.5999984741211,12.97319221496582,122.30000305175781,29.1200008392334,35.66999816894531,45.689998626708984,37.790000915527344,45.88999938964844,50.58000183105469,141.85000610351562,122.94999694824219,84.91999816894531,105.7300033569336,130.8699951171875\n2012-11-06,42.130001068115234,23.079999923706055,121.86000061035156,36.400001525878906,54.06999969482422,107.38999938964844,21.700000762939453,35.36000061035156,36.70000076293945,72.75,13.119415283203125,121.70999908447266,29.25,35.689998626708984,46.25,38.11000061035156,46.400001525878906,50.900001525878906,142.9600067138672,121.79000091552734,84.6500015258789,105.61000061035156,132.0500030517578\n2012-11-07,41.439998626708984,22.56999969482422,122.55999755859375,35.959999084472656,53.2599983215332,108.29000091552734,21.239999771118164,34.79999923706055,36.119998931884766,70.8499984741211,12.680747032165527,121.95999908447266,28.520000457763672,34.939998626708984,45.56999969482422,37.279998779296875,45.599998474121094,50.27000045776367,139.72000122070312,124.0,84.8499984741211,105.55999755859375,129.25\n2012-11-08,40.91999816894531,22.31999969482422,123.22000122070312,35.79999923706055,52.779998779296875,108.7699966430664,21.010000228881836,34.41999816894531,35.630001068115234,69.56999969482422,12.575141906738281,121.83999633789062,28.110000610351562,34.880001068115234,45.27000045776367,36.52000045776367,45.11000061035156,49.900001525878906,138.0399932861328,125.83999633789062,84.9800033569336,105.55999755859375,127.98999786376953\n2012-11-09,41.0,22.139999389648438,122.7699966430664,35.79999923706055,52.79999923706055,108.77999877929688,21.100000381469727,34.34000015258789,35.560001373291016,69.55000305175781,12.591388702392578,121.54000091552734,28.239999771118164,34.66999816894531,45.439998626708984,36.459999084472656,45.040000915527344,50.060001373291016,138.16000366210938,125.9800033569336,84.9000015258789,105.27999877929688,127.91999816894531\n2012-11-12,41.150001525878906,22.229999542236328,123.0999984741211,35.439998626708984,52.7599983215332,108.8499984741211,21.100000381469727,34.31999969482422,35.560001373291016,69.69000244140625,12.61575984954834,121.55999755859375,28.200000762939453,34.380001068115234,45.599998474121094,36.54999923706055,45.130001068115234,49.900001525878906,138.27000427246094,126.19000244140625,85.02999877929688,105.43000030517578,128.0399932861328\n2012-11-13,40.779998779296875,22.020000457763672,122.95999908447266,35.47999954223633,52.5,108.9800033569336,20.989999771118164,34.13999938964844,35.5,69.4000015258789,12.52640151977539,121.61000061035156,28.059999465942383,34.5099983215332,45.09000015258789,35.97999954223633,44.900001525878906,49.709999084472656,137.7899932861328,126.61000061035156,85.0199966430664,105.3499984741211,127.52999877929688\n2012-11-14,40.150001525878906,21.84000015258789,122.83999633789062,35.040000915527344,51.95000076293945,109.01000213623047,20.850000381469727,33.720001220703125,34.900001525878906,68.55999755859375,12.30706787109375,121.86000061035156,27.780000686645508,34.27000045776367,44.45000076293945,35.7400016784668,44.5,49.08000183105469,135.92999267578125,126.7300033569336,85.0,105.3499984741211,125.76000213623047\n2012-11-15,40.290000915527344,21.850000381469727,122.75,35.599998474121094,52.119998931884766,108.95999908447266,20.940000534057617,33.7599983215332,34.779998779296875,68.6500015258789,12.331438064575195,121.62000274658203,27.6200008392334,34.06999969482422,44.279998779296875,35.709999084472656,44.47999954223633,49.4900016784668,135.6999969482422,126.4800033569336,84.98999786376953,105.36000061035156,125.51000213623047\n2012-11-16,40.40999984741211,21.700000762939453,122.83000183105469,36.2400016784668,52.09000015258789,109.02999877929688,20.780000686645508,33.619998931884766,34.86000061035156,68.91999816894531,12.412672996520996,121.66000366210938,27.65999984741211,34.36000061035156,44.380001068115234,35.77000045776367,44.20000076293945,50.029998779296875,136.3699951171875,126.37000274658203,84.94999694824219,105.4000015258789,125.5999984741211\n2012-11-19,41.119998931884766,22.209999084472656,122.5999984741211,36.7599983215332,53.220001220703125,108.80999755859375,21.389999389648438,34.2400016784668,35.849998474121094,70.51000213623047,12.648253440856934,122.04000091552734,28.420000076293945,34.38999938964844,45.130001068115234,36.54999923706055,45.310001373291016,50.810001373291016,139.1300048828125,125.66000366210938,84.94999694824219,105.37999725341797,127.62999725341797\n2012-11-20,41.040000915527344,22.3799991607666,122.25,36.68000030517578,53.29999923706055,108.36000061035156,21.559999465942383,34.400001525878906,35.880001068115234,70.2300033569336,12.713241577148438,121.66000366210938,28.299999237060547,34.33000183105469,44.970001220703125,36.189998626708984,45.470001220703125,50.61000061035156,139.19000244140625,124.4000015258789,84.81999969482422,105.31999969482422,127.70999908447266\n2012-11-21,40.959999084472656,22.469999313354492,121.95999908447266,36.720001220703125,53.38999938964844,108.19999694824219,21.6200008392334,34.5,35.939998626708984,70.61000061035156,12.713241577148438,121.75,28.389999389648438,34.18000030517578,45.029998779296875,36.58000183105469,45.599998474121094,50.63999938964844,139.4499969482422,124.33000183105469,84.7300033569336,105.38999938964844,128.14999389648438\n2012-11-23,41.630001068115234,23.139999389648438,121.87000274658203,37.15999984741211,54.540000915527344,108.13999938964844,22.190000534057617,35.08000183105469,36.400001525878906,71.61000061035156,12.867587089538574,121.80000305175781,28.850000381469727,34.09000015258789,45.93000030517578,37.459999084472656,46.7400016784668,51.43000030517578,141.35000610351562,124.20999908447266,84.75,105.43000030517578,129.88999938964844\n2012-11-26,41.630001068115234,23.139999389648438,122.20999908447266,37.15999984741211,54.40999984741211,108.31999969482422,22.110000610351562,34.959999084472656,36.43000030517578,70.91000366210938,12.818846702575684,122.0,28.979999542236328,34.52000045776367,45.79999923706055,37.33000183105469,46.560001373291016,51.349998474121094,141.0500030517578,124.80000305175781,84.7300033569336,105.3499984741211,129.52000427246094\n2012-11-27,41.279998779296875,23.079999923706055,122.20999908447266,36.959999084472656,54.13999938964844,108.56999969482422,21.90999984741211,34.79999923706055,36.27000045776367,70.31999969482422,12.705118179321289,122.06999969482422,28.850000381469727,34.61000061035156,45.790000915527344,36.86000061035156,46.29999923706055,51.15999984741211,140.3300018310547,125.29000091552734,84.9000015258789,105.37000274658203,128.67999267578125\n2012-11-28,41.5099983215332,23.260000228881836,122.5,37.0,54.529998779296875,108.70999908447266,22.15999984741211,35.060001373291016,36.41999816894531,70.95999908447266,12.75385856628418,122.05000305175781,29.020000457763672,34.75,46.18000030517578,36.84000015258789,46.72999954223633,51.349998474121094,141.4600067138672,125.11000061035156,84.94999694824219,105.36000061035156,129.63999938964844\n2012-11-29,41.810001373291016,23.389999389648438,122.72000122070312,37.439998626708984,55.0,108.81999969482422,22.389999389648438,35.34000015258789,36.66999816894531,71.12000274658203,12.818846702575684,122.13999938964844,29.15999984741211,34.95000076293945,46.369998931884766,36.849998474121094,47.18000030517578,51.869998931884766,142.1199951171875,125.12999725341797,85.0,105.41999816894531,130.13999938964844\n2012-11-30,41.790000915527344,23.520000457763672,122.91000366210938,37.31999969482422,55.06999969482422,108.80000305175781,22.43000030517578,35.36000061035156,36.70000076293945,71.05999755859375,12.802599906921387,122.12999725341797,29.1299991607666,35.31999969482422,46.5,37.150001525878906,47.20000076293945,51.81999969482422,142.14999389648438,124.79000091552734,84.94000244140625,105.4800033569336,130.10000610351562\n2012-12-03,41.77000045776367,23.610000610351562,122.79000091552734,37.15999984741211,55.13999938964844,108.62000274658203,22.520000457763672,35.439998626708984,36.02000045776367,70.66999816894531,12.75385856628418,121.88999938964844,29.09000015258789,35.099998474121094,46.45000076293945,36.79999923706055,47.380001068115234,51.689998626708984,141.4499969482422,124.66000366210938,84.83999633789062,105.38999938964844,129.5500030517578\n2012-12-04,41.88999938964844,23.760000228881836,122.83000183105469,37.20000076293945,55.279998779296875,108.80999755859375,22.719999313354492,35.5,36.09000015258789,70.41000366210938,12.721364974975586,122.0,29.040000915527344,34.91999816894531,46.43000030517578,37.0099983215332,47.619998931884766,51.630001068115234,141.25,125.37999725341797,84.91000366210938,105.37999725341797,129.38999938964844\n2012-12-05,42.34000015258789,23.770000457763672,123.05000305175781,37.20000076293945,55.36000061035156,108.9000015258789,22.81999969482422,35.65999984741211,35.65999984741211,70.9000015258789,12.875710487365723,122.25,28.75,35.45000076293945,46.650001525878906,38.119998931884766,47.72999954223633,51.810001373291016,141.5,125.31999969482422,84.97000122070312,105.5,130.24000549316406\n2012-12-06,42.65999984741211,23.850000381469727,123.30000305175781,37.400001525878906,55.470001220703125,108.95999908447266,22.709999084472656,35.65999984741211,35.75,71.12999725341797,12.916328430175781,122.2300033569336,28.920000076293945,35.43000030517578,46.849998474121094,38.27000045776367,47.70000076293945,52.0,141.97999572753906,125.58999633789062,84.97000122070312,105.37999725341797,130.74000549316406\n2012-12-07,42.790000915527344,23.719999313354492,123.1500015258789,37.52000045776367,55.4900016784668,108.6500015258789,22.65999984741211,35.70000076293945,36.04999923706055,71.55999755859375,13.021933555603027,121.94000244140625,28.770000457763672,35.459999084472656,47.20000076293945,38.40999984741211,47.52000045776367,52.29999923706055,142.41000366210938,124.43000030517578,84.80999755859375,105.41000366210938,131.55999755859375\n2012-12-10,43.029998779296875,23.760000228881836,123.30000305175781,37.400001525878906,55.54999923706055,108.75,22.739999771118164,35.779998779296875,36.279998779296875,71.4800033569336,12.989439010620117,122.05000305175781,28.84000015258789,35.470001220703125,47.279998779296875,38.77000045776367,47.650001525878906,52.18000030517578,142.47000122070312,124.9800033569336,84.86000061035156,105.38999938964844,131.74000549316406\n2012-12-11,43.25,24.030000686645508,122.94000244140625,37.36000061035156,55.869998931884766,108.54000091552734,23.010000228881836,35.880001068115234,36.56999969482422,71.9000015258789,13.054427146911621,121.5999984741211,29.229999542236328,35.54999923706055,47.4900016784668,38.79999923706055,47.9900016784668,52.380001068115234,143.44000244140625,124.02999877929688,84.79000091552734,105.36000061035156,132.5\n2012-12-12,43.380001068115234,24.18000030517578,122.55999755859375,37.52000045776367,56.04999923706055,108.08000183105469,23.100000381469727,36.0,36.47999954223633,72.16000366210938,13.111291885375977,121.2300033569336,29.18000030517578,35.4900016784668,47.599998474121094,39.0,48.189998626708984,52.619998931884766,143.50999450683594,122.58999633789062,84.66000366210938,105.31999969482422,132.50999450683594\n2012-12-13,43.189998626708984,24.09000015258789,122.22000122070312,37.36000061035156,55.880001068115234,107.87000274658203,23.040000915527344,35.86000061035156,36.380001068115234,71.48999786376953,13.046303749084473,121.04000091552734,28.969999313354492,35.349998474121094,47.400001525878906,38.65999984741211,48.029998779296875,52.41999816894531,142.6300048828125,122.68000030517578,84.48999786376953,105.33999633789062,131.82000732421875\n2012-12-14,43.380001068115234,24.280000686645508,122.3499984741211,37.560001373291016,56.08000183105469,108.11000061035156,23.219999313354492,35.939998626708984,36.650001525878906,71.22000122070312,12.997563362121582,121.12999725341797,28.690000534057617,35.209999084472656,47.5099983215332,39.34000015258789,48.31999969482422,52.52000045776367,142.10000610351562,123.5999984741211,84.54000091552734,105.37000274658203,131.4600067138672\n2012-12-17,43.4900016784668,24.3799991607666,121.88999938964844,37.91999816894531,56.310001373291016,107.54000091552734,23.270000457763672,36.08000183105469,37.02000045776367,71.87000274658203,13.265637397766113,120.73999786376953,29.040000915527344,35.75,47.70000076293945,39.36000061035156,48.4900016784668,52.880001068115234,143.77000427246094,121.75,84.38999938964844,105.4800033569336,132.44000244140625\n2012-12-18,43.529998779296875,24.6299991607666,121.54000091552734,38.08000183105469,56.279998779296875,107.12000274658203,23.360000610351562,35.86000061035156,37.459999084472656,73.19000244140625,13.460600852966309,120.44000244140625,29.469999313354492,36.0,46.720001220703125,39.540000915527344,48.9900016784668,53.40999984741211,145.3699951171875,120.51000213623047,84.19999694824219,105.33999633789062,133.5500030517578\n2012-12-19,43.5099983215332,24.610000610351562,121.63999938964844,38.68000030517578,56.47999954223633,107.2699966430664,23.3700008392334,35.900001525878906,37.29999923706055,72.69000244140625,13.379365921020508,120.91000366210938,29.31999969482422,35.72999954223633,46.52000045776367,39.47999954223633,49.060001373291016,53.779998779296875,144.2899932861328,120.91000366210938,84.37999725341797,105.33999633789062,132.6199951171875\n2012-12-20,43.77000045776367,24.729999542236328,121.69999694824219,39.20000076293945,56.86000061035156,107.33999633789062,23.549999237060547,36.060001373291016,37.65999984741211,73.18000030517578,13.566205978393555,121.02999877929688,29.3700008392334,35.84000015258789,46.869998931884766,39.75,48.880001068115234,53.36000061035156,145.1199951171875,120.93000030517578,84.4000015258789,105.3499984741211,133.19000244140625\n2012-12-21,43.27000045776367,24.56999969482422,122.04000091552734,38.959999084472656,56.5099983215332,107.62999725341797,23.40999984741211,35.68000030517578,37.0,72.06999969482422,13.322502136230469,121.23999786376953,28.950000762939453,35.310001373291016,46.439998626708984,39.2400016784668,48.439998626708984,53.029998779296875,142.7899932861328,122.25,84.5199966430664,105.30999755859375,131.7899932861328\n2012-12-24,43.18000030517578,24.479999542236328,121.9000015258789,38.959999084472656,56.36000061035156,107.5199966430664,23.239999771118164,35.70000076293945,37.189998626708984,71.5199966430664,13.298131942749023,121.16000366210938,28.8700008392334,35.15999984741211,46.34000015258789,39.13999938964844,48.310001373291016,52.88999938964844,142.35000610351562,122.02999877929688,83.94999694824219,105.33000183105469,130.97000122070312\n2012-12-26,43.310001373291016,24.520000457763672,122.05000305175781,38.91999816894531,56.349998474121094,107.58999633789062,23.209999084472656,35.599998474121094,37.41999816894531,71.19999694824219,13.298131942749023,120.97000122070312,28.709999084472656,34.86000061035156,46.34000015258789,39.470001220703125,48.36000061035156,52.90999984741211,141.75,122.19999694824219,84.0199966430664,105.30999755859375,130.80999755859375\n2012-12-27,43.540000915527344,24.610000610351562,122.19000244140625,38.959999084472656,56.61000061035156,107.80999755859375,23.450000762939453,35.63999938964844,37.290000915527344,71.06999969482422,13.249390602111816,121.36000061035156,28.68000030517578,34.79999923706055,46.529998779296875,39.540000915527344,48.540000915527344,53.08000183105469,141.55999755859375,122.61000061035156,84.08999633789062,105.41000366210938,130.60000610351562\n2012-12-28,43.70000076293945,24.260000228881836,122.1500015258789,38.68000030517578,56.0099983215332,108.05999755859375,23.049999237060547,35.31999969482422,36.81999969482422,69.83000183105469,13.14378547668457,121.62999725341797,28.360000610351562,34.45000076293945,46.400001525878906,39.54999923706055,47.900001525878906,52.790000915527344,140.02999877929688,123.30999755859375,84.11000061035156,105.4000015258789,129.07000732421875\n2012-12-31,44.349998474121094,24.700000762939453,121.41000366210938,39.0,56.86000061035156,107.48999786376953,23.59000015258789,35.880001068115234,37.540000915527344,71.41999816894531,13.31437873840332,120.98999786376953,28.850000381469727,34.91999816894531,47.13999938964844,40.45000076293945,48.84000015258789,53.38999938964844,142.41000366210938,121.18000030517578,84.02999877929688,105.4800033569336,130.5800018310547\n2013-01-02,45.220001220703125,24.989999771118164,121.33999633789062,39.959999084472656,57.7400016784668,107.0,23.719999313354492,36.41999816894531,38.47999954223633,73.0,13.704305648803711,121.2699966430664,29.809999465942383,35.560001373291016,47.93000030517578,41.849998474121094,49.43000030517578,54.560001373291016,146.05999755859375,119.55999755859375,83.9000015258789,105.5,133.77000427246094\n2013-01-03,44.900001525878906,24.600000381469727,120.51000213623047,39.599998474121094,57.18000030517578,106.44999694824219,23.360000610351562,36.099998474121094,38.20000076293945,72.9800033569336,13.688058853149414,120.61000061035156,29.6200008392334,35.560001373291016,47.52000045776367,41.59000015258789,48.849998474121094,54.11000061035156,145.72999572753906,117.94000244140625,83.6500015258789,105.48999786376953,133.6300048828125\n2013-01-04,44.9900016784668,24.739999771118164,120.45999908447266,39.439998626708984,57.470001220703125,106.5,23.510000228881836,36.36000061035156,38.66999816894531,73.79000091552734,13.8505277633667,120.55000305175781,29.5,35.7400016784668,47.7599983215332,41.619998931884766,49.2599983215332,54.11000061035156,146.3699951171875,118.4000015258789,83.77999877929688,105.54000091552734,134.05999755859375\n2013-01-07,44.650001525878906,24.670000076293945,120.87000274658203,39.08000183105469,57.220001220703125,106.55999755859375,23.450000762939453,36.279998779296875,38.59000015258789,73.22000122070312,13.818034172058105,120.75,29.459999084472656,35.38999938964844,47.54999923706055,41.290000915527344,49.060001373291016,53.79999923706055,145.97000122070312,118.44999694824219,83.72000122070312,105.61000061035156,133.50999450683594\n2013-01-08,44.25,24.489999771118164,121.04000091552734,38.560001373291016,56.900001525878906,106.81999969482422,23.420000076293945,36.119998931884766,38.650001525878906,72.9800033569336,13.777417182922363,120.86000061035156,29.350000381469727,35.279998779296875,47.310001373291016,40.560001373291016,48.900001525878906,53.209999084472656,145.5500030517578,119.2300033569336,83.80000305175781,105.6500015258789,133.05999755859375\n2013-01-09,44.439998626708984,24.5,121.26000213623047,39.08000183105469,57.189998626708984,106.87999725341797,23.34000015258789,36.18000030517578,38.900001525878906,72.86000061035156,13.76116943359375,120.81999969482422,29.399999618530273,35.209999084472656,47.650001525878906,41.0,49.04999923706055,53.75,145.9199981689453,119.12000274658203,83.7699966430664,105.66999816894531,133.7100067138672\n2013-01-10,44.83000183105469,24.899999618530273,121.1500015258789,39.400001525878906,57.91999816894531,106.56999969482422,23.65999984741211,36.560001373291016,39.06999969482422,73.5199966430664,13.9317626953125,120.87999725341797,29.549999237060547,35.36000061035156,48.150001525878906,41.52000045776367,49.84000015258789,54.25,147.0800018310547,118.79000091552734,83.7699966430664,105.69000244140625,134.5399932861328\n2013-01-11,44.470001220703125,25.079999923706055,121.26000213623047,39.52000045776367,58.040000915527344,106.91000366210938,23.809999465942383,36.540000915527344,39.0099983215332,73.61000061035156,13.899269104003906,121.0999984741211,29.59000015258789,35.400001525878906,47.75,41.09000015258789,50.04999923706055,54.150001525878906,147.07000732421875,119.8499984741211,83.83000183105469,105.70999908447266,134.72000122070312\n2013-01-14,44.65999984741211,25.209999084472656,121.30000305175781,39.7599983215332,58.11000061035156,106.87000274658203,23.93000030517578,36.439998626708984,39.02000045776367,73.62000274658203,13.858651161193848,120.86000061035156,29.399999618530273,35.33000183105469,47.790000915527344,41.310001373291016,50.0099983215332,54.34000015258789,146.97000122070312,119.5199966430664,83.83000183105469,105.52999877929688,134.88999938964844\n2013-01-15,44.470001220703125,24.920000076293945,121.37999725341797,39.63999938964844,58.02000045776367,107.12999725341797,23.790000915527344,36.5,39.060001373291016,73.94999694824219,13.915515899658203,120.76000213623047,29.209999084472656,35.43000030517578,47.79999923706055,41.279998779296875,49.83000183105469,54.369998931884766,147.07000732421875,120.06999969482422,83.94000244140625,105.62000274658203,135.0800018310547\n2013-01-16,44.43000030517578,24.81999969482422,121.3499984741211,39.15999984741211,57.7400016784668,107.2699966430664,23.65999984741211,36.2400016784668,38.779998779296875,74.27999877929688,13.923639297485352,120.76000213623047,29.309999465942383,35.2599983215332,48.09000015258789,41.209999084472656,49.599998474121094,54.06999969482422,147.0500030517578,120.31999969482422,83.93000030517578,105.69000244140625,134.88999938964844\n2013-01-17,44.68000030517578,25.170000076293945,121.13999938964844,39.31999969482422,58.209999084472656,106.77999877929688,24.059999465942383,36.36000061035156,39.08000183105469,74.75,13.915515899658203,120.55000305175781,29.43000030517578,35.400001525878906,48.310001373291016,41.36000061035156,50.130001068115234,54.34000015258789,148.0,119.12000274658203,83.79000091552734,105.66000366210938,135.8300018310547\n2013-01-18,44.779998779296875,25.059999465942383,121.33999633789062,39.47999954223633,58.150001525878906,107.08000183105469,24.06999969482422,36.29999923706055,39.34000015258789,75.48999786376953,13.9317626953125,120.66999816894531,29.389999389648438,35.68000030517578,48.25,41.70000076293945,50.02000045776367,54.43000030517578,148.3300018310547,120.04000091552734,83.91999816894531,105.72000122070312,136.08999633789062\n2013-01-22,44.709999084472656,25.040000915527344,121.31999969482422,39.08000183105469,58.18000030517578,107.16999816894531,24.059999465942383,36.380001068115234,39.720001220703125,76.20999908447266,14.061738014221191,120.66999816894531,29.469999313354492,35.97999954223633,48.470001220703125,41.7400016784668,50.130001068115234,54.189998626708984,149.1300048828125,120.2699966430664,83.83999633789062,105.6500015258789,136.74000549316406\n2013-01-23,44.470001220703125,25.030000686645508,121.33999633789062,38.7599983215332,58.119998931884766,107.22000122070312,23.959999084472656,36.47999954223633,39.5,75.94999694824219,14.053614616394043,120.81999969482422,29.780000686645508,35.88999938964844,48.470001220703125,41.529998779296875,50.150001525878906,53.970001220703125,149.3699951171875,120.08999633789062,83.97000122070312,105.69000244140625,137.4600067138672\n2013-01-24,44.310001373291016,25.219999313354492,121.2699966430664,39.20000076293945,58.400001525878906,107.04000091552734,24.100000381469727,36.560001373291016,39.619998931884766,76.16999816894531,14.126726150512695,120.6500015258789,29.270000457763672,36.04999923706055,48.52000045776367,41.529998779296875,50.439998626708984,54.349998474121094,149.41000366210938,119.66999816894531,83.8499984741211,105.69000244140625,138.02000427246094\n2013-01-25,44.15999984741211,25.799999237060547,120.76000213623047,39.47999954223633,59.029998779296875,106.33000183105469,24.579999923706055,36.900001525878906,39.7599983215332,76.88999938964844,14.1917142868042,120.0999984741211,29.299999237060547,36.22999954223633,48.70000076293945,41.099998474121094,51.119998931884766,54.619998931884766,150.25,118.02999877929688,83.58000183105469,105.56999969482422,138.6199951171875\n2013-01-28,43.849998474121094,25.68000030517578,120.5999984741211,38.880001068115234,58.7400016784668,106.11000061035156,24.540000915527344,36.68000030517578,39.380001068115234,76.76000213623047,14.134849548339844,120.0,29.399999618530273,36.209999084472656,48.54999923706055,40.959999084472656,50.91999816894531,54.08000183105469,150.07000732421875,117.5999984741211,83.4800033569336,105.6500015258789,138.64999389648438\n2013-01-29,44.34000015258789,25.809999465942383,120.37999725341797,39.400001525878906,59.13999938964844,105.94999694824219,24.6299991607666,37.02000045776367,39.599998474121094,78.0,14.1917142868042,119.7300033569336,29.440000534057617,36.459999084472656,48.9900016784668,41.54999923706055,51.209999084472656,54.72999954223633,150.66000366210938,116.94999694824219,83.38999938964844,105.55999755859375,139.22999572753906\n2013-01-30,44.130001068115234,25.780000686645508,120.41999816894531,39.79999923706055,59.20000076293945,106.01000213623047,24.540000915527344,37.0,39.380001068115234,77.61000061035156,14.126726150512695,119.33000183105469,29.350000381469727,36.4900016784668,48.880001068115234,41.59000015258789,51.189998626708984,54.939998626708984,150.07000732421875,116.75,83.30000305175781,105.63999938964844,138.75999450683594\n2013-01-31,44.220001220703125,25.709999084472656,120.77999877929688,39.880001068115234,58.97999954223633,106.0999984741211,24.329999923706055,36.939998626708984,39.02000045776367,77.3499984741211,14.118602752685547,119.41999816894531,29.399999618530273,36.58000183105469,48.790000915527344,41.470001220703125,50.93000030517578,55.04999923706055,149.6999969482422,117.31999969482422,83.44999694824219,105.5999984741211,138.41000366210938\n2013-02-01,44.5099983215332,26.09000015258789,120.19000244140625,39.7599983215332,59.45000076293945,105.5999984741211,24.8700008392334,36.939998626708984,39.5,78.06999969482422,14.305442810058594,118.73999786376953,29.729999542236328,36.68000030517578,49.08000183105469,41.81999969482422,51.459999084472656,55.029998779296875,151.24000549316406,115.54000091552734,83.05000305175781,105.55000305175781,139.74000549316406\n2013-02-04,43.91999816894531,25.139999389648438,120.97000122070312,39.79999923706055,58.380001068115234,106.20999908447266,23.81999969482422,36.5,39.119998931884766,77.33000183105469,14.142972946166992,119.13999938964844,29.34000015258789,36.43000030517578,48.4900016784668,40.630001068115234,50.04999923706055,54.849998474121094,149.5399932861328,117.0199966430664,83.33999633789062,105.36000061035156,138.57000732421875\n2013-02-05,43.970001220703125,25.34000015258789,120.62000274658203,39.68000030517578,58.650001525878906,105.83000183105469,24.170000076293945,36.41999816894531,39.31999969482422,78.0,14.281072616577148,118.9000015258789,29.68000030517578,36.529998779296875,48.56999969482422,40.619998931884766,50.459999084472656,54.79999923706055,151.0500030517578,115.9800033569336,83.19999694824219,105.4800033569336,139.38999938964844\n2013-02-06,43.91999816894531,25.049999237060547,120.76000213623047,40.20000076293945,58.63999938964844,106.1500015258789,23.84000015258789,36.599998474121094,39.36000061035156,78.05000305175781,14.305442810058594,119.20999908447266,29.670000076293945,36.63999938964844,48.650001525878906,40.459999084472656,50.25,55.22999954223633,151.16000366210938,116.93000030517578,83.4000015258789,105.58999633789062,139.5800018310547\n2013-02-07,43.529998779296875,24.8700008392334,120.6500015258789,40.31999969482422,58.15999984741211,106.19999694824219,23.40999984741211,36.380001068115234,39.150001525878906,77.8499984741211,14.264825820922852,119.25,29.670000076293945,36.689998626708984,48.310001373291016,39.52000045776367,49.689998626708984,55.119998931884766,150.9600067138672,116.66999816894531,83.41000366210938,105.58000183105469,139.2899932861328\n2013-02-08,43.849998474121094,24.969999313354492,120.61000061035156,40.15999984741211,58.529998779296875,106.27999877929688,23.59000015258789,36.68000030517578,39.380001068115234,78.58000183105469,14.297319412231445,119.51000213623047,29.93000030517578,36.689998626708984,48.95000076293945,39.849998474121094,50.06999969482422,55.34000015258789,151.8000030517578,117.12000274658203,83.38999938964844,105.55000305175781,139.72999572753906\n2013-02-11,43.83000183105469,24.950000762939453,120.5199966430664,40.599998474121094,58.470001220703125,106.16999816894531,23.649999618530273,36.47999954223633,39.33000183105469,78.19000244140625,14.362306594848633,119.44999694824219,29.989999771118164,36.779998779296875,48.880001068115234,39.77000045776367,49.779998779296875,55.54999923706055,151.77000427246094,117.02999877929688,83.29000091552734,105.54000091552734,139.52000427246094\n2013-02-12,43.95000076293945,25.149999618530273,120.51000213623047,40.31999969482422,58.7599983215332,106.05999755859375,23.90999984741211,36.720001220703125,39.349998474121094,78.4000015258789,14.476036071777344,119.33000183105469,29.889999389648438,36.939998626708984,48.95000076293945,39.83000183105469,50.27000045776367,55.439998626708984,152.02000427246094,116.73999786376953,83.30999755859375,105.5,140.0500030517578\n2013-02-13,44.16999816894531,25.34000015258789,120.16999816894531,40.15999984741211,58.900001525878906,105.69000244140625,24.0,36.7400016784668,39.4900016784668,78.68000030517578,14.443541526794434,119.05000305175781,29.8799991607666,36.939998626708984,49.33000183105469,40.04999923706055,50.52000045776367,55.43000030517578,152.14999389648438,115.79000091552734,83.19999694824219,105.54000091552734,139.8699951171875\n2013-02-14,44.150001525878906,24.959999084472656,120.37999725341797,39.7599983215332,58.58000183105469,106.13999938964844,23.739999771118164,36.52000045776367,39.36000061035156,79.36000061035156,14.49228286743164,119.37999725341797,29.799999237060547,36.63999938964844,49.599998474121094,40.220001220703125,50.099998474121094,55.34000015258789,152.2899932861328,116.83999633789062,83.31999969482422,105.58999633789062,139.86000061035156\n2013-02-15,43.9900016784668,24.84000015258789,120.05000305175781,39.63999938964844,58.43000030517578,106.04000091552734,23.670000076293945,36.459999084472656,39.349998474121094,78.44999694824219,14.427294731140137,119.33000183105469,29.780000686645508,36.720001220703125,49.470001220703125,40.31999969482422,49.95000076293945,55.22999954223633,152.11000061035156,116.5,83.25,105.61000061035156,139.4499969482422\n2013-02-19,44.08000183105469,25.360000610351562,119.98999786376953,40.2400016784668,59.119998931884766,105.87000274658203,24.219999313354492,36.599998474121094,39.18000030517578,79.36000061035156,14.565394401550293,119.30000305175781,29.979999542236328,37.040000915527344,50.209999084472656,39.439998626708984,50.560001373291016,55.959999084472656,153.25,115.91999816894531,83.22000122070312,105.54000091552734,139.97000122070312\n2013-02-20,43.689998626708984,25.010000228881836,120.0199966430664,40.36000061035156,58.540000915527344,106.0999984741211,23.770000457763672,36.099998474121094,38.08000183105469,77.69999694824219,14.346059799194336,119.5,29.56999969482422,36.970001220703125,49.56999969482422,39.040000915527344,49.869998931884766,55.709999084472656,151.33999633789062,116.2699966430664,83.27999877929688,105.5199966430664,138.8800048828125\n2013-02-21,43.09000015258789,24.530000686645508,120.16999816894531,39.880001068115234,57.65999984741211,106.30999755859375,23.229999542236328,35.81999969482422,37.72999954223633,77.16000366210938,14.232331275939941,119.69000244140625,29.329999923706055,36.810001373291016,48.86000061035156,38.5099983215332,49.11000061035156,55.099998474121094,150.4199981689453,116.94999694824219,83.36000061035156,105.66000366210938,138.50999450683594\n2013-02-22,43.279998779296875,24.770000457763672,120.43000030517578,40.52000045776367,58.4900016784668,106.44000244140625,23.799999237060547,36.13999938964844,38.22999954223633,77.97000122070312,14.41104793548584,119.7699966430664,29.690000534057617,37.18000030517578,49.470001220703125,38.540000915527344,49.84000015258789,55.77000045776367,151.88999938964844,117.02999877929688,83.4000015258789,105.66000366210938,139.80999755859375\n2013-02-25,42.70000076293945,24.309999465942383,121.02999877929688,39.959999084472656,57.09000015258789,107.26000213623047,22.850000381469727,35.279998779296875,37.349998474121094,75.93000030517578,14.02112102508545,120.4800033569336,29.270000457763672,36.849998474121094,48.900001525878906,38.040000915527344,48.2599983215332,55.18000030517578,149.0,119.33000183105469,83.66999816894531,105.7300033569336,137.66000366210938\n2013-02-26,42.939998626708984,24.360000610351562,120.73999786376953,40.720001220703125,57.54999923706055,107.05999755859375,23.040000915527344,35.400001525878906,37.75,76.68000030517578,14.094232559204102,120.33000183105469,29.440000534057617,36.959999084472656,49.0099983215332,38.119998931884766,48.72999954223633,55.779998779296875,150.02000427246094,118.63999938964844,83.70999908447266,105.73999786376953,138.77999877929688\n2013-02-27,43.40999984741211,24.739999771118164,120.73999786376953,40.68000030517578,58.279998779296875,107.01000213623047,23.59000015258789,35.900001525878906,38.41999816894531,77.8499984741211,14.313566207885742,120.29000091552734,29.690000534057617,37.29999923706055,49.65999984741211,38.470001220703125,49.459999084472656,56.06999969482422,151.91000366210938,118.29000091552734,83.69000244140625,105.70999908447266,140.60000610351562\n2013-02-28,43.209999084472656,24.670000076293945,121.01000213623047,40.84000015258789,58.220001220703125,107.16000366210938,23.469999313354492,35.939998626708984,38.4900016784668,77.69000244140625,14.289196014404297,120.33000183105469,29.6299991607666,37.43000030517578,49.65999984741211,38.95000076293945,49.20000076293945,56.15999984741211,151.61000061035156,118.51000213623047,83.7300033569336,105.69999694824219,140.27999877929688\n2013-03-01,43.310001373291016,24.489999771118164,121.5199966430664,41.2400016784668,58.099998474121094,107.30000305175781,23.3799991607666,35.7599983215332,38.5099983215332,77.79000091552734,14.329813003540039,120.2300033569336,29.68000030517578,37.5,49.63999938964844,38.599998474121094,49.06999969482422,56.4900016784668,152.11000061035156,118.9000015258789,83.62000274658203,105.61000061035156,140.74000549316406\n2013-03-04,42.900001525878906,24.549999237060547,121.13999938964844,41.47999954223633,58.349998474121094,107.05000305175781,23.530000686645508,35.900001525878906,38.560001373291016,77.62000274658203,14.451664924621582,120.13999938964844,29.770000457763672,37.880001068115234,49.31999969482422,37.93000030517578,49.36000061035156,56.52000045776367,152.9199981689453,118.2699966430664,83.5999984741211,105.58000183105469,141.07000732421875\n2013-03-05,43.41999816894531,24.93000030517578,121.11000061035156,41.560001373291016,58.93000030517578,106.94000244140625,23.829999923706055,36.29999923706055,38.81999969482422,78.12000274658203,14.573517799377441,119.94000244140625,30.18000030517578,38.08000183105469,49.90999984741211,38.220001220703125,49.939998626708984,56.900001525878906,154.2899932861328,117.93000030517578,83.55000305175781,105.58999633789062,142.33999633789062\n2013-03-06,43.630001068115234,25.149999618530273,120.83999633789062,42.08000183105469,59.08000183105469,106.5999984741211,23.790000915527344,36.15999984741211,39.15999984741211,78.20999908447266,14.670999526977539,119.58999633789062,30.15999984741211,38.060001373291016,50.099998474121094,38.5,49.84000015258789,57.36000061035156,154.5,116.86000061035156,83.41000366210938,105.61000061035156,142.83999633789062\n2013-03-07,43.75,25.3799991607666,120.38999938964844,41.68000030517578,59.25,106.19000244140625,24.09000015258789,36.2599983215332,39.27000045776367,78.61000061035156,14.776604652404785,119.19999694824219,30.229999542236328,37.88999938964844,50.29999923706055,38.56999969482422,50.22999954223633,57.209999084472656,154.77999877929688,115.95999908447266,83.29000091552734,105.61000061035156,143.13999938964844\n2013-03-08,44.130001068115234,25.329999923706055,120.0,41.880001068115234,59.380001068115234,105.6500015258789,24.170000076293945,36.15999984741211,39.59000015258789,78.98999786376953,14.817221641540527,118.77999877929688,30.290000915527344,37.970001220703125,50.34000015258789,39.08000183105469,50.20000076293945,57.369998931884766,155.44000244140625,114.75,83.05999755859375,105.58999633789062,143.75999450683594\n2013-03-11,43.88999938964844,25.3799991607666,119.94000244140625,42.119998931884766,59.560001373291016,105.69999694824219,24.209999084472656,36.29999923706055,39.810001373291016,79.02999877929688,14.930950164794922,118.86000061035156,30.360000610351562,38.060001373291016,50.540000915527344,38.630001068115234,50.369998931884766,57.66999816894531,156.02999877929688,114.86000061035156,83.0199966430664,105.63999938964844,144.36000061035156\n2013-03-12,43.38999938964844,25.309999465942383,120.16000366210938,41.68000030517578,59.2599983215332,105.98999786376953,24.149999618530273,36.119998931884766,39.84000015258789,79.12000274658203,14.849715232849121,119.0999984741211,30.25,37.959999084472656,50.400001525878906,37.97999954223633,50.220001220703125,57.209999084472656,155.67999267578125,115.69000244140625,83.18000030517578,105.63999938964844,144.39999389648438\n2013-03-13,42.97999954223633,25.209999084472656,120.19000244140625,41.91999816894531,59.16999816894531,105.9000015258789,24.059999465942383,36.18000030517578,39.7400016784668,78.94000244140625,14.89033317565918,118.98999786376953,30.229999542236328,38.130001068115234,49.970001220703125,37.34000015258789,50.04999923706055,57.209999084472656,155.89999389648438,115.56999969482422,83.08000183105469,105.62000274658203,144.4600067138672\n2013-03-14,43.15999984741211,25.510000228881836,120.4000015258789,42.15999984741211,59.75,105.93000030517578,24.299999237060547,36.880001068115234,39.97999954223633,80.0199966430664,14.987814903259277,119.04000091552734,30.450000762939453,38.209999084472656,49.88999938964844,37.7599983215332,50.779998779296875,57.400001525878906,156.72999572753906,115.22000122070312,83.11000061035156,105.55999755859375,145.3300018310547\n2013-03-15,42.77000045776367,25.549999237060547,120.55999755859375,42.560001373291016,59.869998931884766,106.30000305175781,24.229999542236328,36.599998474121094,39.849998474121094,79.5999984741211,14.987814903259277,119.19999694824219,30.200000762939453,38.130001068115234,50.209999084472656,37.439998626708984,50.72999954223633,57.810001373291016,155.8300018310547,115.76000213623047,83.20999908447266,105.55999755859375,144.82000732421875\n2013-03-18,42.290000915527344,25.149999618530273,120.81999969482422,42.36000061035156,59.209999084472656,106.6500015258789,23.889999389648438,36.380001068115234,39.56999969482422,78.95999908447266,14.841591835021973,119.48999786376953,30.209999084472656,37.91999816894531,49.58000183105469,36.790000915527344,49.9900016784668,57.400001525878906,154.97000122070312,116.63999938964844,83.37000274658203,105.4800033569336,144.1699981689453\n2013-03-19,41.9900016784668,24.969999313354492,120.94000244140625,42.599998474121094,59.029998779296875,106.9800033569336,23.6200008392334,36.5,39.400001525878906,78.08999633789062,14.760357856750488,119.69000244140625,30.170000076293945,38.02000045776367,48.97999954223633,36.34000015258789,49.77000045776367,57.36000061035156,154.61000061035156,117.43000030517578,83.41999816894531,105.45999908447266,144.3000030517578\n2013-03-20,42.22999954223633,25.209999084472656,120.5999984741211,42.91999816894531,59.38999938964844,106.56999969482422,23.93000030517578,36.400001525878906,39.70000076293945,78.52999877929688,14.857839584350586,119.33999633789062,30.31999969482422,38.29999923706055,49.220001220703125,37.25,50.18000030517578,57.65999984741211,155.69000244140625,116.12000274658203,83.33999633789062,105.58000183105469,144.80999755859375\n2013-03-21,41.79999923706055,24.860000610351562,120.66000366210938,42.91999816894531,58.849998474121094,106.8499984741211,23.540000915527344,36.220001220703125,39.02000045776367,78.12999725341797,14.679122924804688,119.45999908447266,29.979999542236328,38.11000061035156,49.029998779296875,36.84000015258789,49.52000045776367,57.56999969482422,154.36000061035156,117.23999786376953,83.36000061035156,105.52999877929688,143.88999938964844\n2013-03-22,41.959999084472656,25.06999969482422,120.87000274658203,43.08000183105469,59.36000061035156,106.88999938964844,23.81999969482422,36.52000045776367,39.06999969482422,78.75,14.768481254577637,119.47000122070312,30.170000076293945,38.16999816894531,49.560001373291016,36.939998626708984,49.79999923706055,57.81999969482422,155.60000610351562,117.33000183105469,83.44000244140625,105.55999755859375,144.89999389648438\n2013-03-25,41.91999816894531,24.639999389648438,120.87999725341797,42.68000030517578,58.619998931884766,106.97000122070312,23.190000534057617,36.2400016784668,38.77000045776367,78.44999694824219,14.727863311767578,119.47000122070312,30.100000381469727,38.09000015258789,49.290000915527344,36.81999969482422,49.0,57.470001220703125,154.9499969482422,117.22000122070312,83.43000030517578,105.5,144.2100067138672\n2013-03-26,42.52000045776367,24.709999084472656,120.94999694824219,43.08000183105469,58.9900016784668,107.08000183105469,23.3799991607666,36.400001525878906,39.040000915527344,79.27999877929688,14.825345039367676,119.55000305175781,30.290000915527344,38.45000076293945,49.650001525878906,37.310001373291016,49.2400016784668,57.93000030517578,156.19000244140625,117.36000061035156,83.45999908447266,105.55000305175781,145.27999877929688\n2013-03-27,42.68000030517578,24.299999237060547,121.31999969482422,43.279998779296875,58.70000076293945,107.54000091552734,22.989999771118164,36.2599983215332,39.029998779296875,79.54000091552734,14.752233505249023,119.97000122070312,30.209999084472656,38.630001068115234,49.77000045776367,37.349998474121094,48.68000030517578,58.209999084472656,156.19000244140625,118.36000061035156,83.62999725341797,105.5,144.9600067138672\n2013-03-28,42.77000045776367,24.469999313354492,121.2699966430664,43.20000076293945,58.97999954223633,107.33999633789062,23.209999084472656,36.540000915527344,39.18000030517578,79.30999755859375,14.792851448059082,119.9000015258789,30.270000457763672,39.099998474121094,49.70000076293945,36.93000030517578,49.130001068115234,58.029998779296875,156.6699981689453,117.76000213623047,83.63999938964844,105.54000091552734,145.32000732421875\n2013-04-01,42.310001373291016,24.350000381469727,121.23999786376953,41.52000045776367,58.189998626708984,107.4800033569336,23.06999969482422,36.31999969482422,38.84000015258789,79.1500015258789,14.71973991394043,119.36000061035156,30.06999969482422,39.0099983215332,49.52000045776367,36.47999954223633,48.849998474121094,56.779998779296875,156.0500030517578,118.38999938964844,83.41000366210938,105.31999969482422,145.3800048828125\n2013-04-02,42.33000183105469,24.739999771118164,121.18000030517578,42.040000915527344,58.810001373291016,107.2699966430664,23.43000030517578,36.58000183105469,38.459999084472656,78.69999694824219,14.809098243713379,119.3499984741211,30.190000534057617,39.13999938964844,49.849998474121094,36.4900016784668,49.47999954223633,57.119998931884766,156.82000732421875,117.91000366210938,83.41999816894531,105.4000015258789,146.27000427246094\n2013-04-03,41.83000183105469,24.670000076293945,121.48999786376953,41.880001068115234,58.52000045776367,107.72000122070312,23.350000381469727,36.36000061035156,38.13999938964844,77.2300033569336,14.565394401550293,119.83000183105469,29.950000762939453,39.029998779296875,49.310001373291016,35.869998931884766,49.189998626708984,56.77000045776367,155.22999572753906,118.97000122070312,83.47000122070312,105.51000213623047,145.13999938964844\n2013-04-04,41.709999084472656,24.700000762939453,122.05999755859375,43.599998474121094,59.040000915527344,108.1500015258789,23.389999389648438,36.36000061035156,38.470001220703125,77.12999725341797,14.695369720458984,120.47000122070312,29.959999084472656,39.400001525878906,49.349998474121094,35.970001220703125,49.15999984741211,57.88999938964844,155.86000061035156,120.38999938964844,83.70999908447266,105.41999816894531,145.77000427246094\n2013-04-05,41.61000061035156,24.360000610351562,122.56999969482422,43.84000015258789,58.77000045776367,108.48999786376953,23.18000030517578,36.18000030517578,38.310001373291016,77.30000305175781,14.646628379821777,120.83999633789062,29.729999542236328,39.56999969482422,48.709999084472656,35.63999938964844,48.86000061035156,57.709999084472656,155.16000366210938,122.81999969482422,83.94000244140625,105.48999786376953,145.30999755859375\n2013-04-08,41.68000030517578,24.40999984741211,122.02999877929688,44.279998779296875,59.0,108.13999938964844,23.229999542236328,36.08000183105469,38.43000030517578,77.81999969482422,14.792851448059082,120.94999694824219,29.860000610351562,39.869998931884766,48.9900016784668,35.630001068115234,48.959999084472656,58.09000015258789,156.2100067138672,121.87999725341797,83.9000015258789,105.45999908447266,145.9499969482422\n2013-04-09,42.09000015258789,24.459999084472656,121.91999816894531,43.91999816894531,59.209999084472656,108.18000030517578,23.31999969482422,36.279998779296875,38.880001068115234,78.4800033569336,14.833468437194824,121.06999969482422,30.06999969482422,39.75,49.65999984741211,36.2400016784668,49.189998626708984,58.15999984741211,156.75,121.58000183105469,83.80999755859375,105.4800033569336,146.50999450683594\n2013-04-10,42.4900016784668,24.93000030517578,121.23999786376953,44.84000015258789,60.09000015258789,107.7300033569336,23.65999984741211,36.70000076293945,39.150001525878906,78.9000015258789,15.036555290222168,120.75,30.600000381469727,40.06999969482422,50.06999969482422,36.41999816894531,50.02000045776367,59.06999969482422,158.6699981689453,119.91000366210938,83.6500015258789,105.44000244140625,147.77999877929688\n2013-04-11,42.529998779296875,25.06999969482422,121.58000183105469,45.36000061035156,60.560001373291016,107.8499984741211,23.8799991607666,36.86000061035156,39.31999969482422,79.23999786376953,15.069049835205078,120.83000183105469,30.5,40.15999984741211,50.33000183105469,36.27000045776367,50.29999923706055,59.59000015258789,159.19000244140625,120.13999938964844,83.69000244140625,105.41999816894531,148.39999389648438\n2013-04-12,41.880001068115234,24.899999618530273,122.08000183105469,45.439998626708984,60.40999984741211,108.44999694824219,23.790000915527344,36.86000061035156,38.7400016784668,78.0,15.004061698913574,121.43000030517578,30.3700008392334,40.33000183105469,50.13999938964844,36.0,50.150001525878906,59.27000045776367,158.8000030517578,121.93000030517578,83.88999938964844,105.41000366210938,148.4199981689453\n2013-04-15,40.86000061035156,24.350000381469727,122.05999755859375,45.08000183105469,59.220001220703125,108.69000244140625,23.190000534057617,36.08000183105469,37.310001373291016,74.81999969482422,14.687246322631836,121.47000122070312,29.8700008392334,39.75,48.4900016784668,34.91999816894531,49.0,58.33000183105469,155.1199951171875,122.98999786376953,83.9800033569336,105.38999938964844,145.80999755859375\n2013-04-16,41.70000076293945,24.799999237060547,121.8499984741211,45.52000045776367,60.060001373291016,108.37999725341797,23.59000015258789,36.439998626708984,37.9900016784668,75.73999786376953,14.914703369140625,121.25,30.239999771118164,40.22999954223633,49.5099983215332,35.560001373291016,49.790000915527344,59.29999923706055,157.41000366210938,121.9800033569336,83.95999908447266,105.44000244140625,147.36000061035156\n2013-04-17,41.040000915527344,23.940000534057617,121.83000183105469,45.20000076293945,58.810001373291016,108.58000183105469,22.809999465942383,35.779998779296875,37.43000030517578,74.08000183105469,14.638504981994629,121.41999816894531,29.6200008392334,40.0,48.970001220703125,34.83000183105469,48.33000183105469,58.66999816894531,155.11000061035156,122.79000091552734,84.0,105.43000030517578,145.9499969482422\n2013-04-18,41.040000915527344,23.780000686645508,120.9800033569336,44.880001068115234,58.630001068115234,108.63999938964844,22.729999542236328,35.81999969482422,37.31999969482422,74.70999908447266,14.484159469604492,121.52999877929688,29.309999465942383,40.130001068115234,48.7400016784668,34.93000030517578,48.34000015258789,58.310001373291016,154.13999938964844,123.08999633789062,84.05000305175781,105.4800033569336,145.17999267578125\n2013-04-19,41.63999938964844,23.809999465942383,121.44999694824219,45.36000061035156,59.099998474121094,108.58000183105469,23.020000457763672,35.97999954223633,37.7599983215332,74.55999755859375,14.687246322631836,121.70999908447266,29.350000381469727,40.72999954223633,49.029998779296875,36.04999923706055,48.68000030517578,58.810001373291016,155.47999572753906,122.83000183105469,83.9800033569336,105.48999786376953,145.13999938964844\n2013-04-22,41.84000015258789,23.93000030517578,121.7699966430664,45.31999969482422,59.349998474121094,108.63999938964844,23.18000030517578,36.08000183105469,38.119998931884766,75.36000061035156,14.703493118286133,121.75,29.579999923706055,40.68000030517578,49.33000183105469,36.220001220703125,48.91999816894531,58.91999816894531,156.1699981689453,122.91999816894531,84.08999633789062,105.47000122070312,145.32000732421875\n2013-04-23,42.040000915527344,24.360000610351562,121.83000183105469,45.7599983215332,60.189998626708984,108.56999969482422,23.780000686645508,36.68000030517578,38.45000076293945,76.2300033569336,14.97156810760498,121.91000366210938,29.899999618530273,40.779998779296875,49.81999969482422,36.02000045776367,49.790000915527344,59.41999816894531,157.77999877929688,122.48999786376953,84.06999969482422,105.48999786376953,146.8000030517578\n2013-04-24,42.290000915527344,24.65999984741211,122.01000213623047,46.040000915527344,60.709999084472656,108.62000274658203,24.110000610351562,36.84000015258789,39.029998779296875,77.25,15.06092643737793,121.95999908447266,29.950000762939453,40.90999984741211,50.43000030517578,36.47999954223633,50.290000915527344,59.93000030517578,157.8800048828125,122.80000305175781,84.05000305175781,105.5,146.4499969482422\n2013-04-25,42.66999816894531,24.780000686645508,122.0999984741211,46.279998779296875,61.029998779296875,108.5,24.020000457763672,37.18000030517578,39.459999084472656,77.30999755859375,15.150284767150879,121.88999938964844,30.049999237060547,40.91999816894531,50.7400016784668,37.04999923706055,50.43000030517578,60.34000015258789,158.52000427246094,122.2699966430664,84.0,105.52999877929688,146.75999450683594\n2013-04-26,42.2400016784668,24.889999389648438,122.55000305175781,46.15999984741211,61.08000183105469,108.88999938964844,24.040000915527344,37.380001068115234,38.900001525878906,77.18000030517578,15.085296630859375,122.33000183105469,30.040000915527344,40.97999954223633,50.54999923706055,36.939998626708984,50.58000183105469,60.15999984741211,158.24000549316406,123.38999938964844,84.11000061035156,105.54000091552734,146.8800048828125\n2013-04-29,42.68000030517578,25.260000228881836,122.22000122070312,46.439998626708984,61.86000061035156,108.8499984741211,24.56999969482422,37.65999984741211,39.4900016784668,77.95999908447266,15.150284767150879,122.33999633789062,30.469999313354492,41.31999969482422,51.2599983215332,37.41999816894531,51.34000015258789,60.75,159.3000030517578,122.94000244140625,84.18000030517578,105.56999969482422,147.86000061035156\n2013-04-30,43.290000915527344,25.469999313354492,122.1500015258789,46.79999923706055,61.939998626708984,108.83000183105469,24.530000686645508,37.58000183105469,39.54999923706055,78.2699966430664,15.190901756286621,122.12999725341797,30.799999237060547,41.43000030517578,51.599998474121094,37.7400016784668,51.36000061035156,61.18000030517578,159.67999267578125,123.01000213623047,84.18000030517578,105.58999633789062,148.02000427246094\n2013-05-01,42.81999969482422,25.25,121.80999755859375,46.279998779296875,61.56999969482422,109.05000305175781,24.270000457763672,37.52000045776367,38.849998474121094,77.05000305175781,15.020308494567871,122.30999755859375,30.530000686645508,41.02000045776367,50.83000183105469,37.189998626708984,51.029998779296875,60.540000915527344,158.27999877929688,124.01000213623047,84.16000366210938,105.51000213623047,146.74000549316406\n2013-05-02,43.15999984741211,25.34000015258789,121.68000030517578,46.47999954223633,61.7599983215332,109.05000305175781,24.510000228881836,37.63999938964844,39.130001068115234,78.05999755859375,15.150284767150879,122.30999755859375,30.920000076293945,40.970001220703125,51.029998779296875,37.380001068115234,51.290000915527344,60.72999954223633,159.75,123.8499984741211,84.18000030517578,105.5199966430664,147.9600067138672\n2013-05-03,43.52000045776367,25.90999984741211,120.8499984741211,47.119998931884766,62.54999923706055,108.12000274658203,24.860000610351562,38.119998931884766,39.81999969482422,79.47000122070312,15.312753677368164,121.16000366210938,31.209999084472656,40.88999938964844,51.47999954223633,37.709999084472656,51.91999816894531,61.380001068115234,161.3699951171875,120.93000030517578,83.77999877929688,105.54000091552734,149.36000061035156\n2013-05-06,43.58000183105469,25.850000381469727,120.66999816894531,46.91999816894531,62.470001220703125,107.9800033569336,24.829999923706055,38.15999984741211,39.93000030517578,80.01000213623047,15.475223541259766,121.13999938964844,31.360000610351562,40.31999969482422,51.22999954223633,37.88999938964844,51.86000061035156,61.2400016784668,161.77999877929688,120.62999725341797,83.7699966430664,105.55000305175781,149.42999267578125\n2013-05-07,43.88999938964844,26.030000686645508,120.66000366210938,47.0,62.56999969482422,107.83000183105469,24.90999984741211,38.20000076293945,40.310001373291016,80.62999725341797,15.556458473205566,121.05000305175781,31.34000015258789,40.709999084472656,51.029998779296875,38.310001373291016,52.02000045776367,61.18000030517578,162.60000610351562,120.16000366210938,83.69000244140625,105.58000183105469,150.25999450683594\n2013-05-08,44.22999954223633,26.389999389648438,120.4000015258789,47.400001525878906,63.22999954223633,107.95999908447266,25.270000457763672,38.540000915527344,40.65999984741211,80.76000213623047,15.686433792114258,121.16000366210938,31.59000015258789,40.349998474121094,51.400001525878906,38.619998931884766,52.689998626708984,61.619998931884766,163.33999633789062,120.3499984741211,83.7699966430664,105.55999755859375,150.94000244140625\n2013-05-09,43.90999984741211,26.1299991607666,120.3499984741211,47.040000915527344,62.619998931884766,107.94000244140625,24.93000030517578,38.36000061035156,40.61000061035156,80.69000244140625,15.572705268859863,120.9000015258789,31.5,39.7400016784668,50.88999938964844,38.220001220703125,52.119998931884766,61.209999084472656,162.8800048828125,120.04000091552734,83.63999938964844,105.51000213623047,150.83999633789062\n2013-05-10,43.56999969482422,26.18000030517578,120.01000213623047,47.040000915527344,62.689998626708984,107.33000183105469,25.079999923706055,38.439998626708984,40.56999969482422,80.2699966430664,15.637693405151367,120.2699966430664,31.59000015258789,39.83000183105469,50.81999969482422,38.41999816894531,52.33000183105469,61.060001373291016,163.41000366210938,118.75,83.43000030517578,105.48999786376953,151.0399932861328\n2013-05-13,43.16999816894531,26.079999923706055,119.6500015258789,47.63999938964844,62.65999984741211,107.13999938964844,25.0,38.279998779296875,40.279998779296875,80.26000213623047,15.686433792114258,119.95999908447266,31.510000228881836,39.619998931884766,50.560001373291016,37.72999954223633,52.04999923706055,61.31999969482422,163.5399932861328,117.83999633789062,83.33999633789062,105.51000213623047,150.86000061035156\n2013-05-14,43.369998931884766,26.219999313354492,119.13999938964844,47.959999084472656,62.779998779296875,106.70999908447266,25.040000915527344,38.36000061035156,40.779998779296875,81.4000015258789,15.954508781433105,119.63999938964844,31.610000610351562,39.88999938964844,50.61000061035156,37.75,52.209999084472656,61.689998626708984,165.22999572753906,116.55999755859375,83.18000030517578,105.5199966430664,152.1300048828125\n2013-05-15,43.380001068115234,26.149999618530273,119.18000030517578,48.400001525878906,63.04999923706055,106.98999786376953,25.049999237060547,38.459999084472656,41.0099983215332,81.16999816894531,16.100730895996094,120.05999755859375,31.709999084472656,40.27000045776367,50.36000061035156,37.75,52.36000061035156,61.779998779296875,166.1199951171875,117.33999633789062,83.27999877929688,105.52999877929688,152.77999877929688\n2013-05-16,43.22999954223633,26.079999923706055,119.5199966430664,47.68000030517578,62.619998931884766,107.5,24.920000076293945,38.459999084472656,40.81999969482422,80.7699966430664,15.995125770568848,120.61000061035156,31.8799991607666,39.939998626708984,49.849998474121094,37.540000915527344,52.130001068115234,61.18000030517578,165.33999633789062,118.55999755859375,83.4000015258789,105.54000091552734,152.4499969482422\n2013-05-17,43.41999816894531,26.290000915527344,118.91999816894531,48.439998626708984,63.04999923706055,106.91999816894531,25.190000534057617,38.619998931884766,41.2599983215332,82.12000274658203,16.206336975097656,120.08999633789062,32.20000076293945,40.31999969482422,49.86000061035156,37.90999984741211,52.5099983215332,61.72999954223633,166.94000244140625,117.05999755859375,83.22000122070312,105.56999969482422,153.13999938964844\n2013-05-20,43.529998779296875,26.389999389648438,118.88999938964844,48.7599983215332,63.400001525878906,106.83999633789062,25.280000686645508,38.84000015258789,41.29999923706055,83.27999877929688,16.23883056640625,119.94999694824219,32.20000076293945,40.119998931884766,50.380001068115234,38.369998931884766,52.66999816894531,62.15999984741211,166.92999267578125,116.91999816894531,83.19999694824219,105.55999755859375,153.0399932861328\n2013-05-21,43.439998626708984,26.479999542236328,119.13999938964844,49.040000915527344,63.529998779296875,107.12000274658203,25.459999084472656,38.84000015258789,41.25,83.11000061035156,16.279447555541992,120.4000015258789,32.099998474121094,40.20000076293945,50.0,38.119998931884766,52.81999969482422,62.2599983215332,167.1699981689453,117.83999633789062,83.27999877929688,105.52999877929688,153.50999450683594\n2013-05-22,42.959999084472656,26.34000015258789,118.06999969482422,48.52000045776367,62.88999938964844,106.2699966430664,25.229999542236328,38.52000045776367,40.689998626708984,82.1500015258789,16.108854293823242,119.44999694824219,31.75,39.52000045776367,49.209999084472656,37.540000915527344,52.33000183105469,61.459999084472656,165.92999267578125,116.08999633789062,83.0,105.55999755859375,152.83999633789062\n2013-05-23,42.63999938964844,26.280000686645508,118.0999984741211,46.47999954223633,61.9900016784668,106.37999725341797,25.209999084472656,38.2599983215332,40.709999084472656,82.19000244140625,16.01137351989746,119.56999969482422,31.739999771118164,39.25,48.84000015258789,37.18000030517578,52.04999923706055,59.75,165.4499969482422,116.63999938964844,82.98999786376953,105.45999908447266,152.77000427246094\n2013-05-24,42.27000045776367,26.149999618530273,118.19999694824219,45.63999938964844,61.45000076293945,106.41999816894531,25.18000030517578,38.18000030517578,40.56999969482422,81.70999908447266,16.027620315551758,119.48999786376953,31.690000534057617,38.83000183105469,47.61000061035156,36.560001373291016,52.0,58.63999938964844,165.30999755859375,116.80000305175781,83.0,105.48999786376953,152.77000427246094\n2013-05-28,42.5,26.389999389648438,117.12999725341797,45.36000061035156,61.61000061035156,105.16999816894531,25.459999084472656,38.279998779296875,40.939998626708984,82.56999969482422,16.19009017944336,118.33999633789062,31.84000015258789,38.380001068115234,47.72999954223633,37.15999984741211,52.29999923706055,58.560001373291016,166.3000030517578,113.83999633789062,82.54000091552734,105.4800033569336,153.8800048828125\n2013-05-29,41.959999084472656,26.229999542236328,117.05000305175781,44.599998474121094,61.02000045776367,105.5999984741211,25.290000915527344,37.959999084472656,40.810001373291016,82.38999938964844,16.19009017944336,118.29000091552734,31.760000228881836,37.810001373291016,47.380001068115234,36.58000183105469,51.95000076293945,57.93000030517578,165.22000122070312,115.12000274658203,82.61000061035156,105.51000213623047,152.83999633789062\n2013-05-30,41.959999084472656,26.520000457763672,116.62000274658203,44.36000061035156,61.2599983215332,105.61000061035156,25.530000686645508,38.20000076293945,40.939998626708984,82.19999694824219,16.385053634643555,118.44000244140625,31.959999084472656,37.90999984741211,47.36000061035156,36.7400016784668,52.380001068115234,57.75,165.8300018310547,114.83999633789062,82.54000091552734,105.55000305175781,153.10000610351562\n2013-05-31,41.20000076293945,26.149999618530273,116.7300033569336,43.36000061035156,60.06999969482422,105.31999969482422,25.0,37.540000915527344,40.29999923706055,80.5,16.11697769165039,117.8499984741211,31.65999984741211,37.68000030517578,46.349998474121094,36.0099983215332,51.369998931884766,56.470001220703125,163.4499969482422,114.44999694824219,82.4000015258789,105.48999786376953,151.10000610351562\n2013-06-03,41.810001373291016,26.40999984741211,116.33000183105469,42.84000015258789,60.29999923706055,105.33000183105469,25.25,37.880001068115234,40.5,81.27999877929688,16.133224487304688,117.18000030517578,31.81999969482422,37.7599983215332,47.220001220703125,36.540000915527344,51.880001068115234,56.709999084472656,164.35000610351562,114.77999877929688,82.16000366210938,105.41999816894531,152.30999755859375\n2013-06-04,41.29999923706055,26.209999084472656,116.11000061035156,44.08000183105469,60.52000045776367,105.05999755859375,25.079999923706055,37.779998779296875,40.45000076293945,80.63999938964844,15.9870023727417,116.72000122070312,31.68000030517578,37.630001068115234,46.72999954223633,36.18000030517578,51.630001068115234,57.2400016784668,163.55999755859375,113.72000122070312,82.12999725341797,105.30000305175781,151.63999938964844\n2013-06-05,40.560001373291016,25.889999389648438,116.25,42.400001525878906,59.16999816894531,105.56999969482422,24.65999984741211,37.20000076293945,39.54999923706055,79.69999694824219,15.72705078125,116.55000305175781,31.3700008392334,37.29999923706055,45.349998474121094,35.689998626708984,50.88999938964844,55.33000183105469,161.27000427246094,115.29000091552734,82.0999984741211,105.2699966430664,149.30999755859375\n2013-06-06,40.900001525878906,26.190000534057617,116.12000274658203,42.36000061035156,59.5,105.69999694824219,24.920000076293945,37.29999923706055,39.810001373291016,80.30000305175781,15.946385383605957,117.05000305175781,31.440000534057617,37.7400016784668,45.650001525878906,35.91999816894531,51.310001373291016,55.5,162.72999572753906,115.22000122070312,82.20999908447266,105.33999633789062,150.25\n2013-06-07,40.689998626708984,26.479999542236328,115.44000244140625,44.0,60.29999923706055,104.87999725341797,25.110000610351562,37.63999938964844,40.18000030517578,81.30999755859375,16.222583770751953,116.58999633789062,31.729999542236328,37.970001220703125,45.38999938964844,35.66999816894531,51.68000030517578,56.45000076293945,164.8000030517578,113.16000366210938,82.0,105.31999969482422,152.32000732421875\n2013-06-10,40.13999938964844,26.6299991607666,114.63999938964844,44.560001373291016,60.36000061035156,104.62000274658203,25.100000381469727,37.560001373291016,40.369998931884766,81.08000183105469,16.2307071685791,116.2300033569336,31.799999237060547,37.959999084472656,44.91999816894531,35.349998474121094,51.65999984741211,56.59000015258789,164.8000030517578,112.62000274658203,81.79000091552734,105.22000122070312,152.2100067138672\n2013-06-11,39.380001068115234,26.3799991607666,114.58000183105469,43.68000030517578,59.619998931884766,104.87999725341797,24.829999923706055,37.20000076293945,39.810001373291016,79.8499984741211,15.962632179260254,116.01000213623047,31.469999313354492,37.709999084472656,44.349998474121094,34.81999969482422,51.11000061035156,55.66999816894531,163.10000610351562,113.95999908447266,81.83000183105469,105.23999786376953,151.1999969482422\n2013-06-12,39.11000061035156,26.229999542236328,113.69999694824219,43.79999923706055,59.54999923706055,104.41000366210938,24.799999237060547,37.20000076293945,39.61000061035156,79.36000061035156,15.792038917541504,115.61000061035156,31.260000228881836,37.34000015258789,44.25,34.59000015258789,51.099998474121094,55.619998931884766,161.75,112.33000183105469,81.66999816894531,105.19000244140625,149.86000061035156\n2013-06-13,39.939998626708984,26.520000457763672,114.56999969482422,44.84000015258789,60.459999084472656,105.19999694824219,25.15999984741211,37.65999984741211,40.34000015258789,80.69000244140625,16.092607498168945,116.8499984741211,31.6200008392334,37.95000076293945,45.38999938964844,34.939998626708984,51.70000076293945,56.779998779296875,164.2100067138672,114.08999633789062,82.02999877929688,105.2699966430664,151.75999450683594\n2013-06-14,39.310001373291016,26.239999771118164,114.47000122070312,43.439998626708984,59.79999923706055,105.33999633789062,24.920000076293945,37.400001525878906,40.04999923706055,79.91000366210938,15.881397247314453,116.7699966430664,31.3799991607666,38.0,45.16999816894531,33.97999954223633,51.27000045776367,55.70000076293945,163.17999267578125,113.81999969482422,82.12000274658203,105.30999755859375,150.66000366210938\n2013-06-17,39.66999816894531,26.610000610351562,114.0999984741211,44.599998474121094,60.65999984741211,105.08999633789062,25.329999923706055,37.599998474121094,40.38999938964844,81.05999755859375,16.035743713378906,116.5999984741211,31.670000076293945,38.119998931884766,45.939998626708984,34.47999954223633,51.81999969482422,56.81999969482422,164.44000244140625,113.22000122070312,82.05999755859375,105.25,151.77999877929688\n2013-06-18,39.84000015258789,26.84000015258789,114.41000366210938,45.36000061035156,61.09000015258789,105.02999877929688,25.469999313354492,37.7599983215332,40.56999969482422,81.5199966430664,16.141347885131836,116.37000274658203,31.920000076293945,38.380001068115234,45.90999984741211,34.560001373291016,52.06999969482422,57.41999816894531,165.74000549316406,113.27999877929688,81.98999786376953,105.30000305175781,153.10000610351562\n2013-06-19,38.61000061035156,26.239999771118164,112.88999938964844,44.79999923706055,59.95000076293945,103.58999633789062,24.90999984741211,37.040000915527344,40.2599983215332,80.7699966430664,15.922014236450195,114.72000122070312,31.549999237060547,37.5,44.7599983215332,33.61000061035156,50.97999954223633,56.400001525878906,163.4499969482422,112.11000061035156,81.51000213623047,105.11000061035156,151.08999633789062\n2013-06-20,36.880001068115234,25.3799991607666,111.75,42.959999084472656,57.75,103.12000274658203,24.0,35.91999816894531,39.220001220703125,78.41000366210938,15.580828666687012,113.13999938964844,30.850000381469727,36.439998626708984,42.720001220703125,32.209999084472656,49.369998931884766,53.939998626708984,159.39999389648438,110.2699966430664,80.7699966430664,104.8499984741211,147.5800018310547\n2013-06-21,37.40999984741211,25.010000228881836,110.44000244140625,44.52000045776367,57.939998626708984,102.02999877929688,23.809999465942383,35.81999969482422,38.790000915527344,78.16999816894531,15.532087326049805,112.20999908447266,30.510000228881836,36.540000915527344,43.2599983215332,32.7400016784668,48.939998626708984,55.310001373291016,159.07000732421875,108.4000015258789,80.44000244140625,104.72000122070312,147.72999572753906\n2013-06-24,36.650001525878906,24.670000076293945,110.0199966430664,43.279998779296875,57.029998779296875,101.77999877929688,23.389999389648438,35.36000061035156,38.16999816894531,77.01000213623047,15.255889892578125,111.4800033569336,30.139999389648438,36.5099983215332,42.75,31.940000534057617,47.25,53.810001373291016,157.05999755859375,108.8499984741211,80.05000305175781,104.4800033569336,146.27999877929688\n2013-06-25,37.43000030517578,24.959999084472656,110.20999908447266,43.84000015258789,57.7599983215332,101.66000366210938,23.6299991607666,35.779998779296875,38.400001525878906,78.0,15.54021167755127,111.8499984741211,30.389999389648438,36.9900016784668,43.63999938964844,31.700000762939453,47.77000045776367,54.599998474121094,158.57000732421875,107.87999725341797,80.23999786376953,104.6500015258789,147.3000030517578\n2013-06-26,38.02000045776367,25.139999389648438,110.70999908447266,43.63999938964844,57.9900016784668,102.06999969482422,23.860000610351562,35.880001068115234,38.58000183105469,78.4800033569336,15.694557189941406,112.69999694824219,30.56999969482422,37.459999084472656,44.099998474121094,32.2599983215332,48.11000061035156,54.650001525878906,160.13999938964844,108.58000183105469,80.5199966430664,104.76000213623047,148.7899932861328\n2013-06-27,38.279998779296875,24.860000610351562,111.62999725341797,44.52000045776367,57.40999984741211,102.62000274658203,23.520000457763672,35.41999816894531,38.560001373291016,78.62999725341797,15.89764404296875,113.72000122070312,30.719999313354492,37.540000915527344,43.63999938964844,32.4900016784668,48.45000076293945,55.79999923706055,161.0800018310547,109.69000244140625,80.83999633789062,105.01000213623047,149.89999389648438\n2013-06-28,38.5,24.700000762939453,112.01000213623047,44.880001068115234,57.29999923706055,102.5,23.309999465942383,35.31999969482422,38.349998474121094,78.30000305175781,15.800162315368652,113.6500015258789,30.59000015258789,37.630001068115234,43.029998779296875,32.52000045776367,48.130001068115234,55.83000183105469,160.4199981689453,110.44000244140625,80.87999725341797,105.02999877929688,148.5500030517578\n2013-07-01,38.619998931884766,24.850000381469727,112.0199966430664,45.439998626708984,57.84000015258789,102.4000015258789,23.559999465942383,35.7400016784668,38.56999969482422,78.86000061035156,15.84890365600586,113.58000183105469,30.75,37.15999984741211,42.880001068115234,32.47999954223633,48.720001220703125,56.310001373291016,161.36000061035156,110.41000366210938,80.8499984741211,104.87999725341797,149.4199981689453\n2013-07-02,37.93000030517578,24.459999084472656,112.37999725341797,45.7599983215332,57.54999923706055,102.44000244140625,23.270000457763672,35.540000915527344,38.45000076293945,79.02999877929688,15.865150451660156,113.94000244140625,30.799999237060547,37.150001525878906,42.97999954223633,32.02000045776367,48.220001220703125,56.5,161.2100067138672,110.33999633789062,80.87000274658203,104.73999786376953,148.92999267578125\n2013-07-03,37.58000183105469,24.389999389648438,112.16999816894531,45.79999923706055,57.56999969482422,102.23999786376953,23.200000762939453,35.599998474121094,38.459999084472656,78.9800033569336,15.81640911102295,113.61000061035156,30.979999542236328,37.0099983215332,42.4900016784668,31.729999542236328,48.27000045776367,56.209999084472656,161.27999877929688,110.01000213623047,80.80999755859375,104.66999816894531,149.5399932861328\n2013-07-05,37.34000015258789,24.139999389648438,110.63999938964844,46.400001525878906,57.84000015258789,100.5199966430664,23.350000381469727,35.79999923706055,38.720001220703125,79.95999908447266,16.100730895996094,112.16999816894531,31.18000030517578,36.900001525878906,42.7599983215332,32.06999969482422,48.38999938964844,56.7400016784668,163.02000427246094,106.26000213623047,79.91000366210938,104.5,151.02000427246094\n2013-07-08,37.38999938964844,24.530000686645508,111.33999633789062,46.08000183105469,58.20000076293945,101.11000061035156,23.68000030517578,36.02000045776367,38.939998626708984,80.4800033569336,16.222583770751953,113.08999633789062,31.15999984741211,37.43000030517578,42.9900016784668,32.209999084472656,48.95000076293945,56.61000061035156,163.9499969482422,107.29000091552734,80.2699966430664,104.76000213623047,152.02000427246094\n2013-07-09,37.880001068115234,24.68000030517578,111.29000091552734,46.31999969482422,58.52000045776367,101.27999877929688,23.670000076293945,36.220001220703125,39.540000915527344,81.30000305175781,16.360681533813477,113.19000244140625,31.280000686645508,37.70000076293945,43.83000183105469,32.36000061035156,49.04999923706055,57.22999954223633,165.1300048828125,107.4000015258789,80.36000061035156,104.75,152.7899932861328\n2013-07-10,37.52000045776367,24.899999618530273,110.91000366210938,46.15999984741211,58.689998626708984,100.91999816894531,23.829999923706055,36.31999969482422,39.529998779296875,80.80000305175781,16.263200759887695,112.86000061035156,31.3799991607666,37.90999984741211,43.5099983215332,32.45000076293945,49.38999938964844,56.97999954223633,165.19000244140625,106.55999755859375,80.16000366210938,104.63999938964844,152.7100067138672\n2013-07-11,39.36000061035156,25.65999984741211,111.68000030517578,47.52000045776367,60.209999084472656,101.93000030517578,24.440000534057617,37.220001220703125,40.16999816894531,81.44999694824219,16.41754722595215,114.19000244140625,31.90999984741211,38.52000045776367,44.91999816894531,34.150001525878906,50.709999084472656,58.77000045776367,167.44000244140625,107.80999755859375,80.69999694824219,104.87000274658203,154.3800048828125\n2013-07-12,38.939998626708984,25.610000610351562,111.72000122070312,47.439998626708984,59.810001373291016,101.8499984741211,24.219999313354492,36.97999954223633,40.029998779296875,81.91000366210938,16.531274795532227,113.87000274658203,31.93000030517578,38.63999938964844,44.27000045776367,33.209999084472656,50.25,58.45000076293945,167.50999450683594,107.72000122070312,80.58999633789062,104.8499984741211,154.1699981689453\n2013-07-15,39.34000015258789,25.709999084472656,112.26000213623047,47.880001068115234,60.18000030517578,102.16999816894531,24.360000610351562,37.15999984741211,40.130001068115234,81.83999633789062,16.604387283325195,114.5999984741211,32.02000045776367,39.27000045776367,44.54999923706055,33.54999923706055,50.54999923706055,58.880001068115234,168.14999389648438,108.29000091552734,80.80999755859375,104.88999938964844,154.63999938964844\n2013-07-16,39.5,25.809999465942383,112.70999908447266,47.47999954223633,60.13999938964844,102.22000122070312,24.3799991607666,37.119998931884766,39.83000183105469,81.33999633789062,16.539398193359375,114.43000030517578,32.040000915527344,39.060001373291016,44.869998931884766,33.619998931884766,50.58000183105469,58.7400016784668,167.52000427246094,108.66000366210938,80.93000030517578,104.81999969482422,154.3000030517578\n2013-07-17,39.86000061035156,25.8799991607666,113.0199966430664,47.91999816894531,60.31999969482422,102.66999816894531,24.389999389648438,37.29999923706055,40.20000076293945,81.69999694824219,16.612510681152344,114.86000061035156,32.06999969482422,39.040000915527344,44.86000061035156,33.83000183105469,50.630001068115234,59.119998931884766,167.9499969482422,108.86000061035156,81.11000061035156,104.95999908447266,154.44000244140625\n2013-07-18,39.38999938964844,26.100000381469727,112.61000061035156,48.15999984741211,60.720001220703125,102.19000244140625,24.700000762939453,37.68000030517578,40.220001220703125,82.56999969482422,16.831844329833984,114.55999755859375,31.989999771118164,39.380001068115234,44.720001220703125,33.630001068115234,51.04999923706055,59.119998931884766,168.8699951171875,107.5,80.9800033569336,104.94999694824219,155.33999633789062\n2013-07-19,39.279998779296875,26.170000076293945,113.41999816894531,47.79999923706055,60.66999816894531,102.75,24.739999771118164,37.7400016784668,40.47999954223633,83.72000122070312,16.839967727661133,115.19000244140625,31.450000762939453,39.38999938964844,44.650001525878906,33.72999954223633,51.22999954223633,58.880001068115234,169.1699981689453,109.19999694824219,81.19000244140625,104.95999908447266,155.1199951171875\n2013-07-22,39.66999816894531,26.200000762939453,113.37999725341797,47.91999816894531,61.0099983215332,102.73999786376953,24.920000076293945,37.91999816894531,40.52000045776367,83.44999694824219,16.95369529724121,115.44999694824219,31.540000915527344,39.349998474121094,45.08000183105469,33.77000045776367,51.47999954223633,59.150001525878906,169.5,109.36000061035156,81.23999786376953,105.05000305175781,155.11000061035156\n2013-07-23,40.099998474121094,26.290000915527344,113.12000274658203,47.880001068115234,61.13999938964844,102.62000274658203,24.950000762939453,37.959999084472656,40.63999938964844,83.58999633789062,16.888708114624023,115.2699966430664,31.40999984741211,39.45000076293945,45.369998931884766,34.70000076293945,51.560001373291016,59.36000061035156,169.13999938964844,108.9000015258789,81.22000122070312,104.9800033569336,155.36000061035156\n2013-07-24,39.689998626708984,26.360000610351562,112.19999694824219,47.47999954223633,61.060001373291016,101.93000030517578,25.170000076293945,37.84000015258789,40.2599983215332,82.66000366210938,16.766857147216797,114.70999908447266,31.6200008392334,38.849998474121094,45.11000061035156,34.34000015258789,51.689998626708984,58.95000076293945,168.52000427246094,107.5199966430664,80.95999908447266,105.02999877929688,155.10000610351562\n2013-07-25,39.91999816894531,26.520000457763672,112.26000213623047,46.599998474121094,61.18000030517578,102.08000183105469,25.440000534057617,37.959999084472656,40.63999938964844,83.20999908447266,16.783103942871094,114.56999969482422,31.639999389648438,39.209999084472656,45.470001220703125,34.63999938964844,52.0099983215332,58.4900016784668,168.92999267578125,107.4800033569336,80.93000030517578,105.05000305175781,155.1199951171875\n2013-07-26,39.83000183105469,26.309999465942383,112.29000091552734,45.52000045776367,60.79999923706055,102.16999816894531,25.510000228881836,37.86000061035156,40.4900016784668,83.0,16.766857147216797,114.69000244140625,31.729999542236328,39.349998474121094,45.709999084472656,34.720001220703125,51.81999969482422,57.88999938964844,169.11000061035156,108.13999938964844,80.98999786376953,105.06999969482422,155.16000366210938\n2013-07-29,39.33000183105469,26.239999771118164,112.20999908447266,44.52000045776367,60.220001220703125,101.95999908447266,25.389999389648438,37.65999984741211,40.720001220703125,82.30999755859375,16.645004272460938,114.5,31.68000030517578,39.41999816894531,45.43000030517578,34.310001373291016,51.63999938964844,56.970001220703125,168.58999633789062,107.3499984741211,80.9800033569336,105.13999938964844,154.92999267578125\n2013-07-30,39.2400016784668,26.200000762939453,112.16000366210938,44.91999816894531,60.209999084472656,101.93000030517578,25.389999389648438,37.41999816894531,40.619998931884766,82.1500015258789,16.63688087463379,114.52999877929688,31.84000015258789,39.54999923706055,44.959999084472656,34.400001525878906,51.47999954223633,57.119998931884766,168.58999633789062,107.30999755859375,80.93000030517578,105.12999725341797,154.91000366210938\n2013-07-31,39.0099983215332,26.31999969482422,112.87000274658203,44.880001068115234,60.349998474121094,102.0,25.459999084472656,37.58000183105469,40.47999954223633,82.41999816894531,16.645004272460938,114.54000091552734,31.729999542236328,39.2599983215332,44.650001525878906,34.2599983215332,51.79999923706055,56.869998931884766,168.7100067138672,107.69999694824219,81.0199966430664,105.23999786376953,154.83999633789062\n2013-08-01,39.720001220703125,26.700000762939453,112.01000213623047,46.119998931884766,61.16999816894531,100.95999908447266,25.760000228881836,37.880001068115234,40.779998779296875,83.76000213623047,16.91307830810547,113.27999877929688,32.06999969482422,39.59000015258789,44.95000076293945,34.90999984741211,52.310001373291016,57.97999954223633,170.66000366210938,105.36000061035156,80.45999908447266,104.98999786376953,155.88999938964844\n2013-08-02,39.709999084472656,26.770000457763672,112.58000183105469,46.84000015258789,61.66999816894531,101.81999969482422,25.899999618530273,38.08000183105469,41.0099983215332,83.38999938964844,16.90495491027832,113.83999633789062,32.209999084472656,39.540000915527344,45.18000030517578,34.970001220703125,52.560001373291016,58.630001068115234,170.9499969482422,106.5199966430664,80.72000122070312,105.0999984741211,156.1999969482422\n2013-08-05,39.459999084472656,26.690000534057617,112.58999633789062,46.959999084472656,61.540000915527344,101.5,25.850000381469727,37.939998626708984,40.900001525878906,83.19000244140625,16.872461318969727,113.41000366210938,32.279998779296875,39.279998779296875,45.040000915527344,34.66999816894531,52.47999954223633,58.63999938964844,170.6999969482422,105.69999694824219,80.75,105.08000183105469,155.7899932861328\n2013-08-06,38.959999084472656,26.420000076293945,112.86000061035156,47.0,61.45000076293945,101.52999877929688,25.790000915527344,37.81999969482422,40.52000045776367,82.68000030517578,16.718114852905273,113.4800033569336,32.11000061035156,39.08000183105469,44.93000030517578,34.43000030517578,52.31999969482422,58.599998474121094,169.72999572753906,106.01000213623047,80.69999694824219,105.05999755859375,154.85000610351562\n2013-08-07,38.540000915527344,26.420000076293945,113.12999725341797,46.119998931884766,61.18000030517578,101.9000015258789,25.90999984741211,37.720001220703125,40.540000915527344,82.38999938964844,16.604387283325195,113.7300033569336,32.029998779296875,39.2599983215332,44.33000183105469,33.779998779296875,52.400001525878906,57.59000015258789,169.17999267578125,106.80000305175781,80.81999969482422,105.05000305175781,154.5399932861328\n2013-08-08,39.279998779296875,26.709999084472656,113.25,45.880001068115234,61.72999954223633,102.05000305175781,26.190000534057617,38.08000183105469,41.13999938964844,82.83999633789062,16.645004272460938,113.97000122070312,32.130001068115234,39.40999984741211,45.369998931884766,34.400001525878906,52.959999084472656,57.91999816894531,169.8000030517578,107.08999633789062,80.86000061035156,105.11000061035156,154.69000244140625\n2013-08-09,39.36000061035156,26.719999313354492,113.36000061035156,45.91999816894531,61.84000015258789,102.12000274658203,26.190000534057617,38.2599983215332,41.380001068115234,82.58999633789062,16.5881404876709,113.97000122070312,31.969999313354492,39.13999938964844,45.5,34.529998779296875,53.09000015258789,57.939998626708984,169.30999755859375,107.26000213623047,80.95999908447266,105.05000305175781,154.11000061035156\n2013-08-12,39.72999954223633,26.649999618530273,113.05999755859375,45.880001068115234,61.66999816894531,101.91999816894531,26.030000686645508,38.0,41.31999969482422,82.23999786376953,16.523151397705078,113.91000366210938,32.18000030517578,38.93000030517578,45.81999969482422,35.650001525878906,52.81999969482422,58.06999969482422,169.11000061035156,106.52999877929688,80.80999755859375,105.0999984741211,154.02999877929688\n2013-08-13,39.970001220703125,26.860000610351562,112.06999969482422,46.279998779296875,62.06999969482422,101.0,26.1299991607666,38.34000015258789,41.470001220703125,82.38999938964844,16.604387283325195,113.0999984741211,32.400001525878906,38.720001220703125,46.15999984741211,36.380001068115234,53.150001525878906,58.630001068115234,169.61000061035156,104.98999786376953,80.52999877929688,104.9800033569336,154.44000244140625\n2013-08-14,40.099998474121094,26.84000015258789,111.83000183105469,46.040000915527344,62.099998474121094,101.08999633789062,26.229999542236328,38.439998626708984,41.380001068115234,82.01000213623047,16.539398193359375,112.91000366210938,32.369998931884766,38.470001220703125,46.119998931884766,36.40999984741211,53.220001220703125,58.52000045776367,168.74000549316406,105.1500015258789,80.48999786376953,105.01000213623047,153.32000732421875\n2013-08-15,39.63999938964844,26.790000915527344,111.02999877929688,45.400001525878906,61.58000183105469,100.52999877929688,26.209999084472656,38.0,41.08000183105469,81.55999755859375,16.29569435119629,112.11000061035156,31.850000381469727,37.97999954223633,45.70000076293945,36.150001525878906,52.95000076293945,57.779998779296875,166.3800048828125,103.7300033569336,80.19999694824219,105.0,151.1199951171875\n2013-08-16,39.29999923706055,26.770000457763672,110.51000213623047,45.400001525878906,61.689998626708984,100.13999938964844,26.309999465942383,38.099998474121094,40.7599983215332,81.2300033569336,16.263200759887695,111.55000305175781,31.81999969482422,37.540000915527344,45.77000045776367,36.15999984741211,53.09000015258789,57.81999969482422,165.8300018310547,103.37000274658203,79.98999786376953,104.98999786376953,150.5\n2013-08-19,38.560001373291016,26.639999389648438,109.8499984741211,45.279998779296875,61.25,99.70999908447266,26.06999969482422,37.86000061035156,40.439998626708984,79.94000244140625,16.051990509033203,110.94000244140625,31.719999313354492,37.220001220703125,45.310001373291016,36.060001373291016,52.619998931884766,57.529998779296875,164.77000427246094,102.47000122070312,79.76000213623047,104.9800033569336,149.74000549316406\n2013-08-20,38.4900016784668,26.700000762939453,110.52999877929688,44.880001068115234,61.16999816894531,100.25,26.020000457763672,37.97999954223633,40.66999816894531,80.43000030517578,16.206336975097656,111.62000274658203,31.770000457763672,37.56999969482422,44.970001220703125,35.56999969482422,52.779998779296875,57.08000183105469,165.5800018310547,103.26000213623047,79.98999786376953,105.0,149.75\n2013-08-21,37.59000015258789,26.530000686645508,109.75,44.2400016784668,60.45000076293945,99.62000274658203,25.790000915527344,37.65999984741211,40.36000061035156,79.98999786376953,16.092607498168945,110.94999694824219,31.700000762939453,37.13999938964844,44.36000061035156,34.849998474121094,52.2400016784668,56.279998779296875,164.55999755859375,102.12999725341797,79.68000030517578,104.87999725341797,148.63999938964844\n2013-08-22,38.20000076293945,26.959999084472656,109.80000305175781,44.52000045776367,61.040000915527344,99.58000183105469,26.049999237060547,37.81999969482422,40.84000015258789,81.18000030517578,16.279447555541992,111.45999908447266,31.84000015258789,37.349998474121094,44.70000076293945,35.790000915527344,52.900001525878906,56.68000030517578,166.05999755859375,103.16999816894531,79.76000213623047,104.80000305175781,149.39999389648438\n2013-08-23,38.650001525878906,27.020000457763672,110.56999969482422,45.279998779296875,61.56999969482422,100.13999938964844,26.190000534057617,38.08000183105469,41.16999816894531,81.76000213623047,16.29569435119629,112.20999908447266,32.06999969482422,37.65999984741211,44.9900016784668,35.65999984741211,53.16999816894531,57.40999984741211,166.6199951171875,104.29000091552734,79.98999786376953,104.97000122070312,149.8300018310547\n2013-08-26,38.22999954223633,26.959999084472656,110.95999908447266,44.7599983215332,61.119998931884766,100.33999633789062,26.030000686645508,38.0,41.16999816894531,81.62000274658203,16.19009017944336,112.44000244140625,31.920000076293945,37.380001068115234,44.7400016784668,35.68000030517578,52.90999984741211,56.95000076293945,166.0,104.80999755859375,80.12999725341797,104.9800033569336,149.2100067138672\n2013-08-27,37.349998474121094,26.34000015258789,111.63999938964844,44.279998779296875,60.08000183105469,100.91000366210938,25.3799991607666,37.36000061035156,40.45000076293945,81.11000061035156,15.800162315368652,112.91999816894531,31.360000610351562,37.36000061035156,44.220001220703125,35.08000183105469,51.779998779296875,56.310001373291016,163.3300018310547,106.12999725341797,80.33000183105469,104.98999786376953,147.5\n2013-08-28,37.43000030517578,26.010000228881836,111.2300033569336,44.400001525878906,60.0099983215332,100.5,25.31999969482422,37.5,40.369998931884766,82.45999908447266,15.824532508850098,112.94000244140625,31.3799991607666,37.4900016784668,44.150001525878906,34.9900016784668,51.720001220703125,56.4900016784668,163.91000366210938,105.2699966430664,80.19000244140625,105.0199966430664,148.0399932861328\n2013-08-29,37.72999954223633,25.889999389648438,111.08000183105469,44.36000061035156,59.90999984741211,100.5999984741211,25.260000228881836,37.65999984741211,40.5,81.5999984741211,15.865150451660156,113.05000305175781,31.549999237060547,37.27000045776367,44.189998626708984,35.11000061035156,51.56999969482422,56.599998474121094,164.1699981689453,106.11000061035156,80.2699966430664,105.06999969482422,148.25\n2013-08-30,38.02000045776367,25.65999984741211,110.73999786376953,43.47999954223633,59.16999816894531,100.41000366210938,24.93000030517578,37.29999923706055,40.43000030517578,81.56999969482422,15.792038917541504,113.05000305175781,31.399999618530273,37.29999923706055,44.29999923706055,35.130001068115234,51.040000915527344,56.029998779296875,163.64999389648438,105.98999786376953,80.16000366210938,105.05000305175781,147.85000610351562\n2013-09-03,38.2599983215332,25.799999237060547,110.05999755859375,44.560001373291016,60.310001373291016,99.69000244140625,25.139999389648438,37.900001525878906,40.66999816894531,82.16999816894531,15.922014236450195,112.23999786376953,31.43000030517578,36.869998931884766,45.439998626708984,36.22999954223633,51.779998779296875,57.25,164.38999938964844,104.22000122070312,79.80999755859375,104.83000183105469,148.11000061035156\n2013-09-04,38.939998626708984,25.959999084472656,109.5,45.2400016784668,60.849998474121094,99.36000061035156,25.229999542236328,38.099998474121094,41.04999923706055,82.61000061035156,16.043867111206055,111.83000183105469,31.729999542236328,36.869998931884766,45.93000030517578,36.849998474121094,52.06999969482422,58.15999984741211,165.75,103.98999786376953,79.70999908447266,104.73999786376953,149.17999267578125\n2013-09-05,39.400001525878906,25.8799991607666,108.70999908447266,45.119998931884766,60.79999923706055,98.5999984741211,25.25,38.31999969482422,41.119998931884766,82.88999938964844,16.084484100341797,110.91000366210938,31.75,36.720001220703125,45.83000183105469,37.22999954223633,52.040000915527344,58.119998931884766,165.9600067138672,102.54000091552734,79.16000366210938,104.62000274658203,149.1199951171875\n2013-09-06,39.97999954223633,26.010000228881836,109.16000366210938,45.279998779296875,61.130001068115234,99.19999694824219,25.540000915527344,38.400001525878906,41.06999969482422,82.87999725341797,16.084484100341797,111.06999969482422,31.770000457763672,36.97999954223633,46.11000061035156,37.380001068115234,52.380001068115234,58.279998779296875,166.0399932861328,103.05000305175781,79.45999908447266,104.75,149.08999633789062\n2013-09-09,41.029998779296875,26.40999984741211,109.36000061035156,46.439998626708984,61.970001220703125,99.4000015258789,25.780000686645508,38.720001220703125,41.689998626708984,83.80999755859375,16.271324157714844,111.36000061035156,32.150001525878906,37.11000061035156,46.810001373291016,38.27000045776367,52.90999984741211,59.540000915527344,167.6300048828125,103.0999984741211,79.66000366210938,104.69000244140625,150.47000122070312\n2013-09-10,41.34000015258789,26.889999389648438,109.18000030517578,46.79999923706055,62.66999816894531,98.94000244140625,26.190000534057617,39.060001373291016,42.060001373291016,83.83999633789062,16.46628761291504,110.87000274658203,32.349998474121094,37.400001525878906,47.279998779296875,38.790000915527344,53.56999969482422,60.06999969482422,168.8699951171875,102.37999725341797,79.48999786376953,104.55000305175781,151.7899932861328\n2013-09-11,41.369998931884766,27.09000015258789,109.80000305175781,46.47999954223633,62.88999938964844,99.44000244140625,26.34000015258789,39.2599983215332,42.31999969482422,84.4800033569336,16.482534408569336,111.38999938964844,32.20000076293945,37.029998779296875,47.439998626708984,38.5,53.95000076293945,59.849998474121094,169.39999389648438,103.29000091552734,79.70999908447266,104.62000274658203,153.14999389648438\n2013-09-12,40.88999938964844,26.959999084472656,109.8499984741211,46.15999984741211,62.529998779296875,99.44999694824219,26.18000030517578,39.18000030517578,41.880001068115234,83.9800033569336,16.360681533813477,111.30999755859375,32.22999954223633,36.93000030517578,46.939998626708984,38.06999969482422,53.709999084472656,59.380001068115234,168.9499969482422,103.1500015258789,79.69000244140625,104.72000122070312,153.02999877929688\n2013-09-13,41.15999984741211,27.100000381469727,109.83999633789062,46.400001525878906,62.83000183105469,99.58000183105469,26.280000686645508,39.400001525878906,42.15999984741211,83.94999694824219,16.409423828125,111.37999725341797,32.2599983215332,37.209999084472656,47.040000915527344,38.20000076293945,53.959999084472656,59.61000061035156,169.3300018310547,103.55000305175781,79.81999969482422,104.76000213623047,153.69000244140625\n2013-09-16,41.619998931884766,27.469999313354492,110.13999938964844,47.0,63.31999969482422,99.80000305175781,26.489999771118164,39.63999938964844,42.630001068115234,83.93000030517578,16.5881404876709,111.51000213623047,32.209999084472656,37.310001373291016,47.56999969482422,38.59000015258789,54.36000061035156,60.34000015258789,170.30999755859375,102.86000061035156,79.91999816894531,104.86000061035156,154.94000244140625\n2013-09-17,41.529998779296875,27.540000915527344,110.56999969482422,46.79999923706055,63.36000061035156,100.0,26.579999923706055,39.439998626708984,42.5099983215332,84.30999755859375,16.669374465942383,111.80999755859375,32.369998931884766,37.529998779296875,47.900001525878906,38.40999984741211,54.38999938964844,60.36000061035156,171.07000732421875,103.70999908447266,79.98999786376953,104.95999908447266,155.2899932861328\n2013-09-18,43.27000045776367,28.25,112.04000091552734,48.2400016784668,65.05000305175781,101.23999786376953,27.360000610351562,40.18000030517578,43.4900016784668,85.33000183105469,16.815597534179688,113.44999694824219,32.779998779296875,38.650001525878906,49.16999816894531,39.15999984741211,55.7599983215332,62.060001373291016,173.0500030517578,104.98999786376953,80.62999725341797,105.30000305175781,156.69000244140625\n2013-09-19,43.040000915527344,28.09000015258789,111.68000030517578,48.0,64.73999786376953,100.88999938964844,27.219999313354492,40.0,43.34000015258789,85.12000274658203,16.750608444213867,112.7300033569336,32.79999923706055,38.470001220703125,48.790000915527344,38.880001068115234,55.4900016784668,61.81999969482422,172.75999450683594,104.37000274658203,80.54000091552734,105.3499984741211,156.32000732421875\n2013-09-20,42.08000183105469,28.0,111.98999786376953,47.599998474121094,64.2699966430664,100.98999786376953,27.139999389648438,39.599998474121094,42.619998931884766,84.04000091552734,16.596263885498047,112.83000183105469,32.40999984741211,37.529998779296875,48.209999084472656,38.43000030517578,55.130001068115234,61.20000076293945,170.72000122070312,104.91999816894531,80.52999877929688,105.19999694824219,154.3000030517578\n2013-09-23,42.22999954223633,27.8799991607666,112.37999725341797,47.7599983215332,64.25,101.37000274658203,27.010000228881836,39.599998474121094,42.29999923706055,83.62999725341797,16.360681533813477,113.5,32.5099983215332,37.97999954223633,48.369998931884766,38.650001525878906,54.849998474121094,61.119998931884766,169.92999267578125,105.69000244140625,80.58999633789062,105.13999938964844,153.7100067138672\n2013-09-24,41.869998931884766,27.8799991607666,112.4000015258789,47.79999923706055,64.1500015258789,101.73999786376953,27.040000915527344,39.47999954223633,42.279998779296875,83.70999908447266,16.255077362060547,113.79000091552734,32.369998931884766,37.959999084472656,48.08000183105469,38.11000061035156,54.70000076293945,61.0099983215332,169.52999877929688,106.83000183105469,80.76000213623047,105.1500015258789,153.05999755859375\n2013-09-25,41.54999923706055,27.979999542236328,112.5,47.68000030517578,64.22000122070312,102.0199966430664,27.110000610351562,39.58000183105469,42.38999938964844,83.69000244140625,16.34443473815918,114.13999938964844,32.31999969482422,37.70000076293945,48.189998626708984,37.90999984741211,54.849998474121094,60.880001068115234,169.0399932861328,107.05000305175781,80.93000030517578,105.12999725341797,152.4199981689453\n2013-09-26,41.720001220703125,27.950000762939453,112.33999633789062,48.439998626708984,64.48999786376953,101.80000305175781,27.09000015258789,39.65999984741211,42.66999816894531,83.83999633789062,16.34443473815918,113.86000061035156,32.439998626708984,37.650001525878906,48.43000030517578,37.900001525878906,54.83000183105469,61.619998931884766,169.69000244140625,106.30000305175781,80.80999755859375,105.11000061035156,152.9499969482422\n2013-09-27,41.22999954223633,28.030000686645508,112.37000274658203,48.08000183105469,64.26000213623047,101.94000244140625,27.139999389648438,39.439998626708984,42.15999984741211,83.55000305175781,16.28757095336914,113.7699966430664,32.2400016784668,37.40999984741211,48.18000030517578,37.650001525878906,54.81999969482422,61.2400016784668,168.91000366210938,106.55999755859375,80.83000183105469,105.27999877929688,152.2100067138672\n2013-09-30,40.7599983215332,27.809999465942383,112.58000183105469,47.68000030517578,63.79999923706055,102.11000061035156,26.8799991607666,39.2400016784668,42.0099983215332,82.91000366210938,16.17384147644043,113.5199966430664,32.040000915527344,37.369998931884766,47.650001525878906,37.08000183105469,54.5,60.7400016784668,168.00999450683594,106.4000015258789,80.87999725341797,105.27999877929688,151.0\n2013-10-01,41.56999969482422,28.1299991607666,112.38999938964844,47.47999954223633,64.13999938964844,101.7300033569336,27.209999084472656,39.220001220703125,42.189998626708984,83.44000244140625,16.28757095336914,113.04000091552734,32.31999969482422,37.47999954223633,48.11000061035156,37.599998474121094,54.86000061035156,60.779998779296875,169.33999633789062,105.80000305175781,80.61000061035156,105.16000366210938,151.6199951171875\n2013-10-02,41.72999954223633,28.100000381469727,112.56999969482422,47.2400016784668,64.12000274658203,101.9000015258789,27.15999984741211,39.34000015258789,42.29999923706055,83.62999725341797,16.279447555541992,113.37999725341797,32.33000183105469,37.52000045776367,48.119998931884766,37.56999969482422,54.869998931884766,60.689998626708984,169.17999267578125,105.95999908447266,80.69999694824219,105.2300033569336,150.97999572753906\n2013-10-03,41.56999969482422,27.959999084472656,112.6500015258789,46.880001068115234,63.70000076293945,102.04000091552734,26.920000076293945,39.040000915527344,41.939998626708984,82.9000015258789,16.157594680786133,113.44000244140625,32.04999923706055,37.08000183105469,47.939998626708984,37.5099983215332,54.58000183105469,60.34000015258789,167.6199951171875,105.79000091552734,80.73999786376953,105.19000244140625,149.6699981689453\n2013-10-04,42.11000061035156,28.0,112.41000366210938,46.959999084472656,63.849998474121094,101.76000213623047,27.049999237060547,38.959999084472656,42.54999923706055,83.73999786376953,16.28757095336914,113.33000183105469,32.18000030517578,37.150001525878906,48.290000915527344,38.0099983215332,54.54999923706055,60.619998931884766,168.88999938964844,105.70999908447266,80.6500015258789,105.18000030517578,150.42999267578125\n2013-10-07,41.75,27.850000381469727,112.52999877929688,46.08000183105469,63.189998626708984,101.8499984741211,26.989999771118164,38.779998779296875,42.029998779296875,83.05000305175781,16.100730895996094,113.52999877929688,32.040000915527344,36.970001220703125,47.58000183105469,37.599998474121094,54.290000915527344,59.58000183105469,167.42999267578125,106.13999938964844,80.70999908447266,105.06999969482422,149.0\n2013-10-08,41.349998474121094,27.670000076293945,112.2300033569336,45.91999816894531,62.70000076293945,101.80000305175781,26.770000457763672,38.220001220703125,41.36000061035156,82.16000366210938,15.89764404296875,113.51000213623047,31.530000686645508,37.22999954223633,47.36000061035156,37.529998779296875,53.720001220703125,59.38999938964844,165.47999572753906,106.16999816894531,80.68000030517578,105.1500015258789,147.52999877929688\n2013-10-09,41.65999984741211,27.600000381469727,112.23999786376953,47.0,62.970001220703125,101.62000274658203,26.790000915527344,38.02000045776367,41.41999816894531,81.87000274658203,15.954508781433105,113.2699966430664,31.649999618530273,37.380001068115234,47.540000915527344,37.72999954223633,53.54999923706055,60.27000045776367,165.60000610351562,105.31999969482422,80.62999725341797,105.16000366210938,147.77999877929688\n2013-10-10,42.63999938964844,28.209999084472656,112.1500015258789,47.68000030517578,64.0999984741211,101.4000015258789,27.40999984741211,38.7599983215332,42.29999923706055,83.38999938964844,16.409423828125,113.43000030517578,32.18000030517578,37.939998626708984,48.349998474121094,38.13999938964844,54.68000030517578,61.22999954223633,169.1699981689453,105.48999786376953,80.6500015258789,105.20999908447266,150.9600067138672\n2013-10-11,42.83000183105469,28.309999465942383,112.12999725341797,47.7599983215332,64.44000244140625,101.55000305175781,27.43000030517578,39.119998931884766,42.54999923706055,84.29000091552734,16.498781204223633,113.58000183105469,32.45000076293945,38.119998931884766,48.790000915527344,38.349998474121094,54.9900016784668,61.560001373291016,170.25999450683594,105.45999908447266,80.68000030517578,105.19000244140625,152.1699981689453\n2013-10-14,43.08000183105469,28.3799991607666,111.63999938964844,47.84000015258789,64.66000366210938,101.20999908447266,27.510000228881836,39.34000015258789,42.70000076293945,84.86000061035156,16.58001708984375,113.2300033569336,32.560001373291016,37.90999984741211,48.880001068115234,38.5,55.119998931884766,61.65999984741211,170.94000244140625,104.61000061035156,80.5199966430664,105.16000366210938,152.8000030517578\n2013-10-15,42.65999984741211,28.350000381469727,111.86000061035156,47.439998626708984,64.3499984741211,101.2300033569336,27.3700008392334,39.2599983215332,42.439998626708984,84.55000305175781,16.45816421508789,113.25,32.36000061035156,37.380001068115234,48.61000061035156,38.119998931884766,54.91999816894531,61.15999984741211,169.6999969482422,104.54000091552734,80.5,105.18000030517578,151.33999633789062\n2013-10-16,43.0,28.6200008392334,112.08999633789062,47.880001068115234,64.83000183105469,101.72000122070312,27.399999618530273,39.400001525878906,42.869998931884766,85.81999969482422,16.80747413635254,114.08999633789062,32.66999816894531,37.720001220703125,49.09000015258789,38.209999084472656,55.29999923706055,61.84000015258789,172.07000732421875,105.8499984741211,80.83999633789062,105.18000030517578,153.52000427246094\n2013-10-17,43.27000045776367,28.860000610351562,112.52999877929688,48.279998779296875,65.69000244140625,102.30000305175781,27.780000686645508,40.119998931884766,43.43000030517578,86.0,16.95369529724121,114.93000030517578,32.68000030517578,38.33000183105469,49.599998474121094,38.11000061035156,56.220001220703125,62.36000061035156,173.22000122070312,106.80999755859375,81.12000274658203,105.3499984741211,153.47999572753906\n2013-10-18,43.310001373291016,28.979999542236328,112.69000244140625,48.31999969482422,66.08000183105469,102.30999755859375,28.049999237060547,40.2599983215332,43.560001373291016,86.94000244140625,16.986190795898438,115.08000183105469,33.2400016784668,38.43000030517578,50.15999984741211,38.150001525878906,56.56999969482422,62.709999084472656,174.38999938964844,107.04000091552734,81.20999908447266,105.37999725341797,153.60000610351562\n2013-10-21,43.2400016784668,29.0,112.5999984741211,48.36000061035156,66.18000030517578,102.23999786376953,27.979999542236328,40.439998626708984,43.54999923706055,86.55000305175781,16.95369529724121,114.77999877929688,33.41999816894531,38.349998474121094,50.06999969482422,38.16999816894531,56.720001220703125,62.59000015258789,174.39999389648438,106.69999694824219,81.11000061035156,105.33000183105469,153.52999877929688\n2013-10-22,43.65999984741211,29.489999771118164,113.16999816894531,48.599998474121094,66.83999633789062,102.94999694824219,28.239999771118164,40.91999816894531,44.18000030517578,87.02999877929688,16.986190795898438,115.4800033569336,33.40999984741211,38.84000015258789,50.599998474121094,38.16999816894531,57.349998474121094,63.029998779296875,175.41000366210938,107.88999938964844,81.37000274658203,105.30999755859375,154.25\n2013-10-23,42.63999938964844,29.40999984741211,113.12000274658203,47.599998474121094,66.19000244140625,103.12999725341797,28.110000610351562,40.65999984741211,43.88999938964844,85.66999816894531,16.84809112548828,115.44999694824219,33.25,38.869998931884766,49.900001525878906,36.900001525878906,57.09000015258789,61.84000015258789,174.57000732421875,108.30999755859375,81.41000366210938,105.31999969482422,153.82000732421875\n2013-10-24,42.54999923706055,29.6299991607666,113.16000366210938,48.08000183105469,66.6500015258789,102.91999816894531,28.219999313354492,41.040000915527344,44.11000061035156,86.08000183105469,16.872461318969727,115.33000183105469,33.33000183105469,38.790000915527344,49.95000076293945,36.47999954223633,57.459999084472656,62.27000045776367,175.14999389648438,107.88999938964844,81.41000366210938,105.3499984741211,154.8000030517578\n2013-10-25,42.75,29.68000030517578,113.41000366210938,47.36000061035156,66.45999908447266,103.0999984741211,28.229999542236328,41.0,44.2400016784668,86.5999984741211,16.945571899414062,115.31999969482422,33.5,39.20000076293945,50.150001525878906,36.43000030517578,57.470001220703125,61.900001525878906,175.9499969482422,108.29000091552734,81.5,105.38999938964844,155.4499969482422\n2013-10-28,43.0,29.6200008392334,113.36000061035156,47.52000045776367,66.3499984741211,103.0,28.040000915527344,40.97999954223633,44.02000045776367,86.66999816894531,16.90495491027832,115.43000030517578,33.61000061035156,39.119998931884766,50.150001525878906,36.54999923706055,57.20000076293945,61.939998626708984,176.22999572753906,107.91999816894531,81.43000030517578,105.41000366210938,155.3699951171875\n2013-10-29,43.13999938964844,29.65999984741211,113.29000091552734,47.880001068115234,66.48999786376953,103.13999938964844,28.139999389648438,41.02000045776367,44.11000061035156,87.27999877929688,16.95369529724121,115.58999633789062,33.83000183105469,39.16999816894531,49.84000015258789,37.029998779296875,57.29999923706055,62.150001525878906,177.1699981689453,108.05999755859375,81.48999786376953,105.37999725341797,156.5\n2013-10-30,42.900001525878906,29.540000915527344,113.13999938964844,47.880001068115234,66.25,102.87000274658203,28.010000228881836,40.880001068115234,43.84000015258789,86.69000244140625,16.888708114624023,115.36000061035156,33.7599983215332,38.91999816894531,49.75,37.540000915527344,57.08000183105469,62.09000015258789,176.2899932861328,107.41000366210938,81.4000015258789,105.43000030517578,155.8699951171875\n2013-10-31,42.459999084472656,29.34000015258789,112.91999816894531,47.63999938964844,65.87999725341797,102.75,27.899999618530273,40.70000076293945,43.77000045776367,86.38999938964844,16.709991455078125,115.19999694824219,33.650001525878906,38.779998779296875,49.720001220703125,37.56999969482422,56.779998779296875,61.709999084472656,175.7899932861328,107.63999938964844,81.4000015258789,105.44000244140625,155.2899932861328\n2013-11-01,42.47999954223633,29.200000762939453,112.04000091552734,47.119998931884766,65.55999755859375,102.0199966430664,27.690000534057617,40.5,43.66999816894531,86.08000183105469,16.750608444213867,114.51000213623047,33.65999984741211,39.060001373291016,49.7400016784668,37.83000183105469,56.41999816894531,61.4900016784668,176.2100067138672,106.19000244140625,81.0,105.37999725341797,155.86000061035156\n2013-11-04,42.7400016784668,29.360000610351562,112.0999984741211,47.15999984741211,65.87999725341797,102.22000122070312,27.81999969482422,40.86000061035156,43.849998474121094,87.1500015258789,16.758731842041016,114.54000091552734,33.790000915527344,39.13999938964844,49.900001525878906,37.88999938964844,56.7599983215332,61.599998474121094,176.8300018310547,106.29000091552734,81.05000305175781,105.37000274658203,156.05999755859375\n2013-11-05,41.880001068115234,29.059999465942383,111.66000366210938,46.7599983215332,65.30999755859375,101.76000213623047,27.40999984741211,40.720001220703125,43.65999984741211,86.36000061035156,16.669374465942383,114.05000305175781,33.70000076293945,38.86000061035156,49.720001220703125,37.279998779296875,56.2400016784668,61.13999938964844,176.27000427246094,105.0199966430664,80.80999755859375,105.3499984741211,155.88999938964844\n2013-11-06,42.0099983215332,29.280000686645508,112.30000305175781,47.400001525878906,65.87999725341797,102.06999969482422,27.760000228881836,40.86000061035156,43.959999084472656,86.62000274658203,16.750608444213867,114.18000030517578,34.040000915527344,39.38999938964844,50.029998779296875,37.2400016784668,56.779998779296875,61.709999084472656,177.1699981689453,105.06999969482422,80.94999694824219,105.3499984741211,157.22000122070312\n2013-11-07,41.25,28.959999084472656,112.44999694824219,46.52000045776367,64.83999633789062,102.33999633789062,27.309999465942383,40.279998779296875,43.380001068115234,85.27999877929688,16.56376838684082,114.41000366210938,33.599998474121094,39.02000045776367,49.34000015258789,36.63999938964844,55.880001068115234,60.61000061035156,174.92999267578125,105.95999908447266,81.11000061035156,105.44000244140625,155.85000610351562\n2013-11-08,41.15999984741211,29.079999923706055,111.48999786376953,46.880001068115234,65.22000122070312,101.19000244140625,27.389999389648438,40.619998931884766,44.189998626708984,86.55000305175781,16.945571899414062,113.29000091552734,33.900001525878906,38.95000076293945,49.529998779296875,36.84000015258789,56.18000030517578,61.040000915527344,177.2899932861328,103.41000366210938,80.58000183105469,105.37999725341797,157.49000549316406\n2013-11-11,40.95000076293945,29.280000686645508,111.27999877929688,46.79999923706055,65.36000061035156,101.13999938964844,27.56999969482422,40.47999954223633,44.16999816894531,86.70999908447266,16.95369529724121,113.0999984741211,33.939998626708984,38.939998626708984,49.20000076293945,37.22999954223633,56.349998474121094,60.779998779296875,177.32000732421875,103.0199966430664,80.51000213623047,105.4000015258789,157.61000061035156\n2013-11-12,40.72999954223633,29.190000534057617,111.33999633789062,47.400001525878906,65.13999938964844,101.05000305175781,27.450000762939453,40.2400016784668,44.029998779296875,85.91000366210938,16.791227340698242,113.18000030517578,34.029998779296875,38.61000061035156,48.709999084472656,36.900001525878906,56.02000045776367,61.0,176.9600067138672,103.5,80.47000122070312,105.33000183105469,157.3699951171875\n2013-11-13,40.79999923706055,29.329999923706055,111.52999877929688,47.7599983215332,65.3499984741211,101.47000122070312,27.540000915527344,40.2400016784668,44.27000045776367,86.66000366210938,16.937448501586914,113.44000244140625,34.31999969482422,38.79999923706055,48.59000015258789,36.4900016784668,56.2599983215332,61.220001220703125,178.3800048828125,103.87999725341797,80.69000244140625,105.30000305175781,158.05999755859375\n2013-11-14,41.459999084472656,29.450000762939453,112.13999938964844,48.15999984741211,65.6500015258789,101.95999908447266,27.610000610351562,40.400001525878906,44.63999938964844,87.18000030517578,17.08367156982422,114.05999755859375,34.22999954223633,39.13999938964844,48.77000045776367,36.83000183105469,56.40999984741211,61.63999938964844,179.27000427246094,104.5199966430664,80.91999816894531,105.43000030517578,158.72999572753906\n2013-11-15,42.25,29.65999984741211,112.19000244140625,48.84000015258789,66.18000030517578,101.87999725341797,27.760000228881836,40.68000030517578,44.93000030517578,87.66000366210938,17.164907455444336,114.05999755859375,34.29999923706055,39.369998931884766,49.380001068115234,38.439998626708984,56.709999084472656,62.58000183105469,180.0500030517578,104.7300033569336,80.94999694824219,105.41000366210938,159.3000030517578\n2013-11-18,42.630001068115234,29.739999771118164,112.48999786376953,48.7599983215332,66.18000030517578,102.23999786376953,27.829999923706055,40.65999984741211,44.650001525878906,86.98999786376953,17.156782150268555,114.56999969482422,34.16999816894531,39.31999969482422,49.380001068115234,39.81999969482422,56.790000915527344,62.47999954223633,179.4199981689453,105.36000061035156,81.0999984741211,105.43000030517578,159.44000244140625\n2013-11-19,42.369998931884766,29.799999237060547,112.05000305175781,48.47999954223633,66.01000213623047,101.86000061035156,27.690000534057617,40.65999984741211,44.5099983215332,87.13999938964844,17.181154251098633,114.16999816894531,34.04999923706055,39.029998779296875,49.209999084472656,39.880001068115234,56.66999816894531,62.31999969482422,179.02999877929688,104.55999755859375,80.94000244140625,105.4000015258789,159.3300018310547\n2013-11-20,41.790000915527344,29.5,111.36000061035156,48.47999954223633,65.55000305175781,101.30000305175781,27.34000015258789,40.459999084472656,44.150001525878906,86.93000030517578,17.13241195678711,113.68000030517578,33.939998626708984,38.599998474121094,48.61000061035156,39.56999969482422,56.150001525878906,61.95000076293945,178.47000122070312,102.77999877929688,80.72000122070312,105.44000244140625,158.77000427246094\n2013-11-21,41.75,29.719999313354492,111.55000305175781,48.68000030517578,65.95999908447266,101.38999938964844,27.520000457763672,40.900001525878906,44.5099983215332,87.76000213623047,17.376117706298828,113.9000015258789,34.22999954223633,38.689998626708984,48.529998779296875,39.720001220703125,56.63999938964844,62.099998474121094,179.91000366210938,102.94999694824219,80.72000122070312,105.51000213623047,159.86000061035156\n2013-11-22,42.04999923706055,29.93000030517578,111.86000061035156,48.63999938964844,66.1500015258789,101.68000030517578,27.790000915527344,40.91999816894531,44.7400016784668,88.2300033569336,17.457351684570312,114.30000305175781,34.15999984741211,38.65999984741211,48.529998779296875,39.959999084472656,56.95000076293945,62.0099983215332,180.80999755859375,103.91000366210938,80.9000015258789,105.44000244140625,160.39999389648438\n2013-11-25,41.5099983215332,30.06999969482422,111.93000030517578,48.279998779296875,65.94999694824219,101.76000213623047,27.75,40.7599983215332,44.459999084472656,87.43000030517578,17.481721878051758,114.5,34.15999984741211,38.5099983215332,48.34000015258789,39.16999816894531,56.84000015258789,61.70000076293945,180.6300048828125,104.20999908447266,80.95999908447266,105.44999694824219,160.61000061035156\n2013-11-26,41.650001525878906,30.239999771118164,111.91999816894531,48.08000183105469,65.94999694824219,101.9800033569336,27.84000015258789,40.58000183105469,44.349998474121094,87.20999908447266,17.46547508239746,114.7300033569336,34.279998779296875,38.130001068115234,48.380001068115234,39.380001068115234,56.849998474121094,61.650001525878906,180.67999267578125,104.5999984741211,80.97000122070312,105.45999908447266,160.5\n2013-11-27,41.91999816894531,30.3799991607666,111.69999694824219,48.279998779296875,66.11000061035156,101.75,27.8799991607666,40.779998779296875,44.380001068115234,86.62000274658203,17.51421546936035,114.75,34.54999923706055,38.04999923706055,48.310001373291016,40.189998626708984,57.13999938964844,61.7599983215332,181.1199951171875,104.41999816894531,80.94000244140625,105.56999969482422,160.85000610351562\n2013-11-29,42.349998474121094,30.56999969482422,111.61000061035156,48.2400016784668,66.23999786376953,101.69000244140625,27.93000030517578,41.02000045776367,44.34000015258789,86.44000244140625,17.449228286743164,114.66000366210938,34.689998626708984,38.029998779296875,48.08000183105469,40.130001068115234,57.36000061035156,61.72999954223633,181.0,104.44999694824219,80.9800033569336,105.54000091552734,160.72000122070312\n2013-12-02,41.459999084472656,30.440000534057617,111.02999877929688,48.119998931884766,65.75,101.08999633789062,27.719999313354492,40.619998931884766,44.22999954223633,86.5,17.441104888916016,113.75,34.58000183105469,37.869998931884766,47.709999084472656,39.790000915527344,56.84000015258789,61.27000045776367,180.52999877929688,103.33000183105469,80.5,105.4800033569336,159.9199981689453\n2013-12-03,41.31999969482422,30.020000457763672,111.08999633789062,47.91999816894531,65.29000091552734,101.2699966430664,27.270000457763672,40.41999816894531,43.709999084472656,86.70999908447266,17.262388229370117,114.04000091552734,34.65999984741211,38.060001373291016,47.650001525878906,39.43000030517578,56.34000015258789,61.06999969482422,179.75,103.70999908447266,80.58000183105469,105.43000030517578,158.99000549316406\n2013-12-04,41.27000045776367,29.75,110.47000122070312,47.560001373291016,64.94000244140625,100.80999755859375,27.079999923706055,40.18000030517578,43.91999816894531,86.43000030517578,17.30300521850586,113.66999816894531,34.689998626708984,38.22999954223633,47.59000015258789,39.63999938964844,56.029998779296875,60.77000045776367,179.72999572753906,102.72000122070312,80.45999908447266,105.4000015258789,158.75999450683594\n2013-12-05,41.029998779296875,29.739999771118164,110.33999633789062,47.15999984741211,64.56999969482422,100.55999755859375,26.940000534057617,40.0,43.66999816894531,86.13999938964844,17.140535354614258,113.41999816894531,34.58000183105469,37.91999816894531,47.04999923706055,39.400001525878906,55.790000915527344,60.25,178.94000244140625,102.43000030517578,80.31999969482422,105.4000015258789,158.1199951171875\n2013-12-06,41.939998626708984,30.15999984741211,110.33000183105469,47.7599983215332,65.37000274658203,100.6500015258789,27.290000915527344,40.5,44.27000045776367,86.41000366210938,17.376117706298828,113.66000366210938,34.81999969482422,38.439998626708984,47.380001068115234,40.150001525878906,56.540000915527344,60.939998626708984,180.94000244140625,102.91999816894531,80.44000244140625,105.4000015258789,160.16000366210938\n2013-12-09,42.0,30.209999084472656,110.41999816894531,47.7599983215332,65.30000305175781,100.7699966430664,27.299999237060547,40.58000183105469,44.5,86.52999877929688,17.449228286743164,113.83000183105469,34.93000030517578,38.209999084472656,46.93000030517578,39.880001068115234,56.599998474121094,60.77000045776367,181.39999389648438,103.16000366210938,80.5199966430664,105.44999694824219,160.22999572753906\n2013-12-10,42.02000045776367,30.049999237060547,110.70999908447266,47.84000015258789,65.19000244140625,101.19000244140625,27.1299991607666,40.5,44.630001068115234,86.2699966430664,17.384241104125977,114.29000091552734,34.86000061035156,37.83000183105469,46.869998931884766,39.83000183105469,56.40999984741211,60.7599983215332,180.75,103.9000015258789,80.69000244140625,105.4800033569336,159.72000122070312\n2013-12-11,41.09000015258789,29.850000381469727,110.52999877929688,47.400001525878906,64.58000183105469,100.80000305175781,27.049999237060547,40.099998474121094,43.869998931884766,85.05000305175781,17.148658752441406,113.97000122070312,34.540000915527344,37.52000045776367,46.0,38.529998779296875,55.9900016784668,60.04999923706055,178.72000122070312,103.0999984741211,80.55000305175781,105.43000030517578,158.30999755859375\n2013-12-12,40.849998474121094,29.670000076293945,110.22000122070312,47.560001373291016,64.11000061035156,100.51000213623047,26.950000762939453,39.70000076293945,43.779998779296875,85.41000366210938,17.148658752441406,113.77999877929688,34.310001373291016,37.56999969482422,45.45000076293945,38.11000061035156,55.400001525878906,59.84000015258789,178.1300048828125,102.70999908447266,80.33999633789062,105.33999633789062,157.47000122070312\n2013-12-13,40.95000076293945,29.729999542236328,110.54000091552734,47.15999984741211,64.06999969482422,100.66000366210938,26.940000534057617,39.540000915527344,43.9900016784668,85.12999725341797,17.164907455444336,114.08999633789062,34.20000076293945,37.5099983215332,45.83000183105469,38.380001068115234,55.36000061035156,59.720001220703125,178.11000061035156,103.20999908447266,80.43000030517578,105.33999633789062,157.64999389648438\n2013-12-16,41.220001220703125,30.170000076293945,110.62000274658203,46.880001068115234,64.52999877929688,100.61000061035156,27.270000457763672,40.08000183105469,44.16999816894531,85.87000274658203,17.270511627197266,114.18000030517578,34.540000915527344,37.709999084472656,46.119998931884766,38.369998931884766,56.09000015258789,59.7400016784668,179.22000122070312,102.83000183105469,80.45999908447266,105.41999816894531,158.89999389648438\n2013-12-17,40.86000061035156,30.040000915527344,110.94999694824219,46.91999816894531,64.25,100.93000030517578,27.040000915527344,39.900001525878906,44.459999084472656,85.37999725341797,17.156782150268555,114.5199966430664,34.529998779296875,37.63999938964844,45.7599983215332,37.720001220703125,55.77000045776367,59.5099983215332,178.64999389648438,103.29000091552734,80.61000061035156,105.45999908447266,158.77999877929688\n2013-12-18,41.29999923706055,30.440000534057617,110.45999908447266,47.47999954223633,64.69999694824219,100.55000305175781,27.31999969482422,40.15999984741211,45.0,86.66999816894531,17.554834365844727,114.5199966430664,34.79999923706055,38.13999938964844,45.150001525878906,38.470001220703125,56.63999938964844,60.470001220703125,181.6999969482422,102.7699966430664,80.58000183105469,105.51000213623047,161.75999450683594\n2013-12-19,40.540000915527344,30.549999237060547,110.05000305175781,47.08000183105469,64.69999694824219,100.12999725341797,27.3799991607666,40.20000076293945,45.06999969482422,86.91999816894531,17.53046226501465,114.3499984741211,34.86000061035156,37.86000061035156,45.310001373291016,37.59000015258789,56.810001373291016,60.09000015258789,181.49000549316406,102.66999816894531,80.43000030517578,105.3499984741211,161.8800048828125\n2013-12-20,40.47999954223633,30.739999771118164,110.41999816894531,47.2400016784668,65.06999969482422,100.44000244140625,27.489999771118164,40.2400016784668,44.93000030517578,86.66999816894531,17.554834365844727,114.87999725341797,34.959999084472656,37.83000183105469,45.84000015258789,37.31999969482422,56.86000061035156,59.75,181.55999755859375,104.25,80.58000183105469,105.41000366210938,162.00999450683594\n2013-12-23,40.779998779296875,31.100000381469727,110.2300033569336,47.68000030517578,65.73999786376953,100.12000274658203,27.700000762939453,40.70000076293945,45.150001525878906,86.76000213623047,17.63606834411621,114.69999694824219,35.41999816894531,37.68000030517578,46.29999923706055,37.27000045776367,57.400001525878906,60.209999084472656,182.52999877929688,103.66000366210938,80.4800033569336,105.30000305175781,162.6199951171875\n2013-12-24,41.02000045776367,31.239999771118164,109.86000061035156,47.040000915527344,65.87000274658203,99.7300033569336,27.829999923706055,41.18000030517578,45.63999938964844,87.23999786376953,17.668561935424805,114.66999816894531,35.52000045776367,37.83000183105469,46.58000183105469,37.95000076293945,57.79999923706055,59.88999938964844,182.92999267578125,102.83000183105469,80.06999969482422,105.25,163.16000366210938\n2013-12-26,40.66999816894531,31.43000030517578,109.80999755859375,47.79999923706055,66.2300033569336,99.4800033569336,28.010000228881836,41.2400016784668,45.88999938964844,87.86000061035156,17.709178924560547,114.23999786376953,35.61000061035156,37.65999984741211,46.459999084472656,37.63999938964844,58.040000915527344,60.349998474121094,183.86000061035156,102.0999984741211,79.94999694824219,105.3499984741211,164.4600067138672\n2013-12-27,41.29999923706055,31.510000228881836,109.75,48.040000915527344,66.56999969482422,99.41999816894531,28.149999618530273,41.47999954223633,46.029998779296875,88.29000091552734,17.7010555267334,114.13999938964844,35.58000183105469,37.810001373291016,46.40999984741211,38.20000076293945,58.349998474121094,60.790000915527344,183.85000610351562,101.80999755859375,79.94999694824219,105.37000274658203,164.47000122070312\n2013-12-30,41.47999954223633,31.68000030517578,110.05999755859375,48.47999954223633,66.8499984741211,99.69000244140625,28.34000015258789,41.560001373291016,46.060001373291016,87.66000366210938,17.668561935424805,114.4800033569336,35.5099983215332,37.900001525878906,46.470001220703125,37.970001220703125,58.599998474121094,61.08000183105469,183.82000732421875,102.51000213623047,80.08000183105469,105.3499984741211,164.58999633789062\n2013-12-31,41.79999923706055,31.760000228881836,109.9000015258789,48.560001373291016,67.0999984741211,99.23999786376953,28.450000762939453,41.7599983215332,46.220001220703125,88.51000213623047,17.75792121887207,114.19000244140625,35.7400016784668,37.970001220703125,46.72999954223633,38.369998931884766,58.79999923706055,61.29999923706055,184.69000244140625,101.86000061035156,80.05000305175781,105.45999908447266,165.47000122070312\n2014-01-02,40.189998626708984,30.75,110.26000213623047,47.7599983215332,65.91000366210938,99.62999725341797,27.770000457763672,41.2400016784668,45.849998474121094,87.25,17.660438537597656,114.41000366210938,35.38999938964844,37.38999938964844,46.29999923706055,37.119998931884766,57.54999923706055,60.209999084472656,182.9199981689453,102.16999816894531,80.12000274658203,105.37000274658203,164.11000061035156\n2014-01-03,40.119998931884766,30.649999618530273,110.20999908447266,48.040000915527344,65.9800033569336,99.56999969482422,27.649999618530273,41.2599983215332,45.7400016784668,86.93000030517578,17.782291412353516,114.58000183105469,35.220001220703125,37.27000045776367,46.41999816894531,36.65999984741211,57.560001373291016,60.43000030517578,182.88999938964844,102.16999816894531,80.12999725341797,105.3499984741211,164.38999938964844\n2014-01-06,39.7400016784668,30.799999237060547,110.58000183105469,47.880001068115234,65.9000015258789,99.8499984741211,27.6299991607666,41.15999984741211,45.4900016784668,87.05000305175781,17.798538208007812,114.83000183105469,35.15999984741211,37.33000183105469,46.20000076293945,36.0099983215332,57.61000061035156,60.18000030517578,182.36000061035156,102.5999984741211,80.19999694824219,105.37000274658203,163.88999938964844\n2014-01-07,39.90999984741211,30.90999984741211,110.5999984741211,48.08000183105469,66.2699966430664,100.01000213623047,27.829999923706055,41.31999969482422,45.40999984741211,87.70999908447266,17.80666160583496,114.73999786376953,35.47999954223633,37.65999984741211,46.29999923706055,36.02000045776367,58.0,60.36000061035156,183.47999572753906,102.86000061035156,80.30000305175781,105.33000183105469,164.97000122070312\n2014-01-08,39.779998779296875,30.81999969482422,110.52999877929688,48.15999984741211,66.25,99.5199966430664,27.760000228881836,41.2400016784668,45.68000030517578,87.0999984741211,17.863525390625,114.25,35.47999954223633,37.459999084472656,46.150001525878906,36.45000076293945,57.970001220703125,60.45000076293945,183.52000427246094,102.58000183105469,80.04000091552734,105.30000305175781,164.35000610351562\n2014-01-09,39.56999969482422,30.75,110.94999694824219,48.0,66.19999694824219,99.77999877929688,27.68000030517578,41.18000030517578,45.5,86.83000183105469,17.928512573242188,114.51000213623047,35.25,37.68000030517578,46.08000183105469,35.779998779296875,58.02000045776367,60.18000030517578,183.63999938964844,103.18000030517578,80.19000244140625,105.31999969482422,164.19000244140625\n2014-01-10,40.27000045776367,31.049999237060547,111.54000091552734,48.31999969482422,66.80999755859375,100.62000274658203,27.969999313354492,41.540000915527344,45.63999938964844,86.9000015258789,17.896018981933594,115.12999725341797,35.31999969482422,38.220001220703125,46.540000915527344,36.43000030517578,58.59000015258789,60.599998474121094,184.13999938964844,104.41000366210938,80.58000183105469,105.37999725341797,164.17999267578125\n2014-01-13,39.790000915527344,30.850000381469727,111.58999633789062,48.0,66.2300033569336,100.91000366210938,27.799999237060547,41.02000045776367,45.02000045776367,85.16999816894531,17.627944946289062,115.3499984741211,34.939998626708984,37.83000183105469,46.099998474121094,35.709999084472656,58.11000061035156,60.189998626708984,181.69000244140625,104.93000030517578,80.69000244140625,105.43000030517578,162.24000549316406\n2014-01-14,40.220001220703125,31.299999237060547,111.20999908447266,47.880001068115234,66.76000213623047,100.52999877929688,28.1200008392334,41.599998474121094,45.650001525878906,86.27999877929688,17.774168014526367,115.01000213623047,35.529998779296875,37.880001068115234,45.88999938964844,36.2599983215332,58.790000915527344,60.08000183105469,183.6699981689453,104.44999694824219,80.56999969482422,105.37000274658203,163.4499969482422\n2014-01-15,40.209999084472656,31.719999313354492,111.11000061035156,48.2400016784668,67.04000091552734,100.44000244140625,28.309999465942383,41.720001220703125,45.93000030517578,86.02999877929688,17.98537826538086,115.04000091552734,35.959999084472656,37.810001373291016,45.810001373291016,36.189998626708984,59.02000045776367,60.2599983215332,184.66000366210938,104.33999633789062,80.5199966430664,105.33999633789062,164.57000732421875\n2014-01-16,39.9900016784668,31.670000076293945,111.19999694824219,48.08000183105469,67.01000213623047,100.72000122070312,28.290000915527344,41.7400016784668,46.040000915527344,86.1500015258789,17.87164878845215,115.30999755859375,35.95000076293945,38.06999969482422,45.720001220703125,35.86000061035156,59.06999969482422,60.220001220703125,184.4199981689453,105.04000091552734,80.69999694824219,105.33000183105469,163.97999572753906\n2014-01-17,39.790000915527344,31.389999389648438,111.41000366210938,48.20000076293945,66.80999755859375,100.95999908447266,28.020000457763672,41.7400016784668,45.93000030517578,86.01000213623047,17.81478500366211,115.44000244140625,35.75,38.060001373291016,45.709999084472656,35.79999923706055,58.689998626708984,60.27000045776367,183.63999938964844,105.4800033569336,80.79000091552734,105.33999633789062,164.0800018310547\n2014-01-21,39.72999954223633,31.56999969482422,111.19999694824219,48.279998779296875,67.12999725341797,100.8499984741211,28.219999313354492,42.119998931884766,46.209999084472656,86.72000122070312,17.831031799316406,115.27999877929688,35.93000030517578,38.47999954223633,45.810001373291016,35.79999923706055,59.08000183105469,60.400001525878906,184.17999267578125,105.55999755859375,80.79000091552734,105.30999755859375,163.72999572753906\n2014-01-22,40.2599983215332,31.479999542236328,111.01000213623047,48.400001525878906,67.12999725341797,100.56999969482422,28.149999618530273,42.31999969482422,45.7599983215332,87.12000274658203,17.839155197143555,115.0,35.88999938964844,38.52000045776367,45.849998474121094,36.65999984741211,59.09000015258789,60.400001525878906,184.3000030517578,105.30000305175781,80.6500015258789,105.37000274658203,163.47000122070312\n2014-01-23,39.27000045776367,31.540000915527344,111.48999786376953,47.439998626708984,66.68000030517578,101.25,28.1299991607666,42.099998474121094,45.08000183105469,86.12999725341797,17.546709060668945,115.44000244140625,35.81999969482422,38.40999984741211,44.86000061035156,35.02000045776367,59.06999969482422,59.209999084472656,182.7899932861328,106.79000091552734,80.87000274658203,105.38999938964844,161.7100067138672\n2014-01-24,38.2400016784668,30.520000457763672,111.80999755859375,46.720001220703125,64.8499984741211,101.66000366210938,27.190000534057617,40.720001220703125,43.869998931884766,84.33000183105469,17.148658752441406,115.36000061035156,35.130001068115234,37.97999954223633,43.90999984741211,34.220001220703125,57.189998626708984,58.060001373291016,178.88999938964844,107.4800033569336,81.08000183105469,105.4000015258789,158.47999572753906\n2014-01-27,38.09000015258789,30.420000076293945,111.41999816894531,46.119998931884766,64.55000305175781,101.3499984741211,27.200000762939453,40.41999816894531,43.689998626708984,84.02999877929688,17.043054580688477,115.13999938964844,34.79999923706055,38.06999969482422,44.0,34.15999984741211,56.91999816894531,57.689998626708984,178.00999450683594,106.7300033569336,80.93000030517578,105.43000030517578,158.02000427246094\n2014-01-28,38.33000183105469,30.799999237060547,111.63999938964844,46.52000045776367,65.11000061035156,101.5,27.56999969482422,40.70000076293945,43.939998626708984,84.66999816894531,17.270511627197266,115.69999694824219,34.59000015258789,38.209999084472656,44.380001068115234,34.54999923706055,57.459999084472656,58.099998474121094,179.07000732421875,106.98999786376953,81.0,105.47000122070312,158.94000244140625\n2014-01-29,37.779998779296875,30.25,112.05999755859375,46.47999954223633,64.37999725341797,101.9800033569336,27.200000762939453,40.18000030517578,44.119998931884766,84.19999694824219,17.067424774169922,115.93000030517578,34.31999969482422,38.189998626708984,43.779998779296875,34.5,56.75,57.7400016784668,177.35000610351562,107.87000274658203,81.18000030517578,105.47000122070312,157.10000610351562\n2014-01-30,38.130001068115234,30.389999389648438,111.98999786376953,46.560001373291016,64.70999908447266,101.87999725341797,27.329999923706055,40.279998779296875,44.33000183105469,84.47000122070312,17.311128616333008,115.98999786376953,34.7400016784668,38.779998779296875,44.29999923706055,34.65999984741211,56.90999984741211,58.130001068115234,179.22999572753906,107.55999755859375,81.18000030517578,105.55999755859375,158.1699981689453\n2014-01-31,38.189998626708984,29.829999923706055,112.20999908447266,45.31999969482422,63.61000061035156,102.27999877929688,26.8799991607666,39.81999969482422,44.040000915527344,83.37999725341797,17.108041763305664,116.33999633789062,34.81999969482422,39.099998474121094,43.869998931884766,34.58000183105469,56.11000061035156,57.119998931884766,178.17999267578125,108.27999877929688,81.29000091552734,105.54000091552734,156.75\n2014-02-03,37.11000061035156,29.34000015258789,112.87000274658203,44.400001525878906,62.310001373291016,102.66000366210938,26.40999984741211,38.939998626708984,43.0099983215332,81.88999938964844,16.67749786376953,116.73999786376953,34.09000015258789,38.790000915527344,43.119998931884766,33.75,55.0099983215332,56.02000045776367,174.1699981689453,109.31999969482422,81.37999725341797,105.54000091552734,153.52999877929688\n2014-02-04,37.86000061035156,29.520000457763672,112.37999725341797,44.439998626708984,63.029998779296875,102.3499984741211,26.770000457763672,39.34000015258789,43.38999938964844,82.7300033569336,16.839967727661133,116.18000030517578,34.220001220703125,38.560001373291016,44.04999923706055,34.13999938964844,55.599998474121094,56.41999816894531,175.38999938964844,108.16000366210938,81.25,105.4800033569336,154.0800018310547\n2014-02-05,37.720001220703125,29.540000915527344,111.88999938964844,44.52000045776367,63.15999984741211,101.9800033569336,26.81999969482422,39.459999084472656,43.439998626708984,81.91999816894531,16.823720932006836,115.80999755859375,34.25,38.38999938964844,43.650001525878906,33.709999084472656,55.790000915527344,56.400001525878906,175.1699981689453,107.16000366210938,81.08000183105469,105.5,154.17999267578125\n2014-02-06,38.5099983215332,30.100000381469727,111.91000366210938,45.040000915527344,64.27999877929688,101.79000091552734,27.3700008392334,40.060001373291016,44.09000015258789,83.13999938964844,17.08367156982422,115.69999694824219,34.630001068115234,38.66999816894531,44.650001525878906,34.27000045776367,56.91999816894531,57.209999084472656,177.47999572753906,106.69999694824219,81.05000305175781,105.5199966430664,156.13999938964844\n2014-02-07,38.72999954223633,30.450000762939453,112.2300033569336,45.7599983215332,65.12000274658203,102.05999755859375,27.799999237060547,40.439998626708984,44.70000076293945,84.04000091552734,17.29488182067871,116.05999755859375,35.099998474121094,38.880001068115234,44.91999816894531,34.400001525878906,57.650001525878906,57.88999938964844,179.67999267578125,106.79000091552734,81.1500015258789,105.58000183105469,157.77999877929688\n2014-02-10,38.29999923706055,30.329999923706055,112.33000183105469,45.560001373291016,64.9000015258789,102.11000061035156,27.700000762939453,40.34000015258789,44.91999816894531,83.62999725341797,17.311128616333008,116.11000061035156,35.16999816894531,39.16999816894531,44.7599983215332,34.099998474121094,57.47999954223633,57.59000015258789,180.00999450683594,107.08999633789062,81.19999694824219,105.58000183105469,157.75\n2014-02-11,39.130001068115234,30.969999313354492,111.97000122070312,46.20000076293945,65.93000030517578,101.66000366210938,28.09000015258789,40.97999954223633,45.439998626708984,84.72000122070312,17.489845275878906,115.87000274658203,35.599998474121094,39.540000915527344,45.83000183105469,35.400001525878906,58.400001525878906,58.650001525878906,181.97999572753906,106.47000122070312,81.02999877929688,105.55999755859375,159.75999450683594\n2014-02-12,39.13999938964844,31.0,111.69000244140625,46.119998931884766,66.04000091552734,101.41999816894531,28.09000015258789,41.29999923706055,45.36000061035156,84.5199966430664,17.489845275878906,115.5199966430664,35.7400016784668,39.59000015258789,46.06999969482422,35.380001068115234,58.4900016784668,58.7400016784668,182.07000732421875,105.91999816894531,80.88999938964844,105.5,159.7100067138672\n2014-02-13,39.18000030517578,31.469999313354492,112.06999969482422,45.720001220703125,66.23999786376953,101.9000015258789,28.389999389648438,41.439998626708984,45.75,84.91999816894531,17.554834365844727,116.0,36.0,40.02000045776367,46.060001373291016,35.470001220703125,58.880001068115234,58.439998626708984,183.00999450683594,106.5199966430664,81.08999633789062,105.58999633789062,160.2899932861328\n2014-02-14,39.65999984741211,31.56999969482422,111.83999633789062,45.52000045776367,66.48999786376953,101.83000183105469,28.520000457763672,41.63999938964844,46.119998931884766,86.02999877929688,17.579204559326172,116.22000122070312,36.06999969482422,40.279998779296875,46.619998931884766,35.779998779296875,59.150001525878906,58.56999969482422,184.02000427246094,106.58000183105469,81.05999755859375,105.55999755859375,161.58999633789062\n2014-02-18,39.290000915527344,31.709999084472656,112.05000305175781,46.52000045776367,67.05999755859375,102.08000183105469,28.549999237060547,42.2599983215332,46.150001525878906,86.41999816894531,17.611698150634766,116.45999908447266,36.09000015258789,40.41999816894531,46.7400016784668,35.79999923706055,59.54999923706055,59.279998779296875,184.24000549316406,106.81999969482422,81.16999816894531,105.5999984741211,161.41000366210938\n2014-02-19,39.02000045776367,31.43000030517578,111.83000183105469,45.959999084472656,66.61000061035156,101.87999725341797,28.389999389648438,42.13999938964844,45.83000183105469,86.52999877929688,17.36799430847168,116.33000183105469,35.970001220703125,40.189998626708984,46.630001068115234,35.97999954223633,59.150001525878906,58.810001373291016,183.02000427246094,106.37000274658203,81.0999984741211,105.5999984741211,160.52000427246094\n2014-02-20,39.15999984741211,31.489999771118164,111.48999786376953,45.68000030517578,66.83999633789062,101.7699966430664,28.65999984741211,42.459999084472656,46.310001373291016,87.0999984741211,17.41673469543457,116.18000030517578,36.09000015258789,40.5,47.04999923706055,35.68000030517578,59.52000045776367,58.810001373291016,184.10000610351562,106.11000061035156,81.08999633789062,105.56999969482422,161.30999755859375\n2014-02-21,39.43000030517578,31.579999923706055,111.69000244140625,46.040000915527344,66.97000122070312,101.9000015258789,28.790000915527344,42.459999084472656,46.189998626708984,86.41000366210938,17.449228286743164,116.30000305175781,35.95000076293945,40.54999923706055,46.90999984741211,35.7400016784668,59.560001373291016,59.0,183.88999938964844,106.66999816894531,81.1500015258789,105.5999984741211,160.80999755859375\n2014-02-24,39.43000030517578,31.739999771118164,111.69000244140625,46.560001373291016,67.55000305175781,101.80000305175781,29.040000915527344,42.720001220703125,46.029998779296875,87.70999908447266,17.579204559326172,116.36000061035156,36.09000015258789,40.45000076293945,47.310001373291016,35.310001373291016,60.02000045776367,59.540000915527344,184.91000366210938,106.4000015258789,81.12999725341797,105.6500015258789,161.66000366210938\n2014-02-25,38.97999954223633,31.670000076293945,112.12000274658203,46.400001525878906,67.38999938964844,102.1500015258789,29.040000915527344,42.31999969482422,46.20000076293945,87.66999816894531,17.47359848022461,116.80999755859375,35.9900016784668,40.400001525878906,46.93000030517578,34.70000076293945,59.95000076293945,59.34000015258789,184.83999633789062,107.3499984741211,81.29000091552734,105.66999816894531,161.5\n2014-02-26,39.0099983215332,31.450000762939453,112.37999725341797,46.20000076293945,67.16000366210938,102.44999694824219,28.84000015258789,42.20000076293945,46.54999923706055,87.12000274658203,17.449228286743164,117.19000244140625,36.02000045776367,40.27000045776367,46.88999938964844,34.81999969482422,59.709999084472656,59.27000045776367,184.85000610351562,107.91999816894531,81.45999908447266,105.66000366210938,161.83999633789062\n2014-02-27,39.75,31.43000030517578,112.54000091552734,46.20000076293945,67.38999938964844,102.56999969482422,28.979999542236328,42.5,46.91999816894531,87.20999908447266,17.538585662841797,117.38999938964844,36.310001373291016,40.16999816894531,47.15999984741211,35.779998779296875,59.97999954223633,59.52000045776367,185.82000732421875,108.51000213623047,81.55999755859375,105.69000244140625,162.5500030517578\n2014-02-28,39.47999954223633,31.709999084472656,112.69999694824219,46.439998626708984,67.51000213623047,102.47000122070312,29.049999237060547,42.52000045776367,47.08000183105469,87.6500015258789,17.627944946289062,117.31999969482422,36.349998474121094,40.45000076293945,46.95000076293945,35.38999938964844,60.22999954223633,59.41999816894531,186.2899932861328,108.56999969482422,81.5,105.68000030517578,163.02000427246094\n2014-03-03,38.779998779296875,30.6200008392334,113.22000122070312,45.36000061035156,66.08000183105469,102.80999755859375,28.350000381469727,41.7400016784668,46.970001220703125,87.08999633789062,17.489845275878906,117.27999877929688,35.959999084472656,40.04999923706055,46.599998474121094,34.959999084472656,58.689998626708984,58.5099983215332,184.97999572753906,109.02999877929688,81.5,105.58999633789062,161.49000549316406\n2014-03-04,39.439998626708984,31.309999465942383,112.48999786376953,46.52000045776367,67.38999938964844,102.0199966430664,28.93000030517578,42.36000061035156,47.709999084472656,88.04000091552734,17.847278594970703,116.6500015258789,36.43000030517578,40.34000015258789,47.310001373291016,35.36000061035156,59.88999938964844,59.650001525878906,187.5800018310547,107.38999938964844,81.22000122070312,105.56999969482422,163.6300048828125\n2014-03-05,39.470001220703125,31.239999771118164,112.6500015258789,46.0,67.33000183105469,102.12999725341797,28.959999084472656,42.279998779296875,47.81999969482422,87.22000122070312,18.03411865234375,116.58999633789062,36.47999954223633,40.06999969482422,47.29999923706055,35.0099983215332,59.880001068115234,59.25,187.75,107.62000274658203,81.33000183105469,105.4800033569336,163.35000610351562\n2014-03-06,40.029998779296875,31.479999542236328,112.37000274658203,46.880001068115234,68.02999877929688,101.69000244140625,29.3700008392334,42.34000015258789,48.0,87.8499984741211,18.09098243713379,116.23999786376953,36.529998779296875,39.869998931884766,47.88999938964844,35.380001068115234,60.5,60.22999954223633,188.17999267578125,106.55999755859375,81.12999725341797,105.52999877929688,164.08999633789062\n2014-03-07,39.52000045776367,31.1200008392334,112.12999725341797,46.560001373291016,67.66000366210938,101.25,29.25,42.040000915527344,47.790000915527344,88.0199966430664,18.172218322753906,115.81999969482422,36.41999816894531,39.9900016784668,47.65999984741211,34.9900016784668,60.09000015258789,59.84000015258789,188.25999450683594,105.88999938964844,80.88999938964844,105.45999908447266,164.33999633789062\n2014-03-10,39.25,30.770000457763672,112.18000030517578,46.36000061035156,67.23999786376953,101.36000061035156,29.209999084472656,41.540000915527344,47.75,88.16000366210938,18.180341720581055,115.63999938964844,36.36000061035156,39.88999938964844,47.20000076293945,34.439998626708984,59.65999984741211,59.459999084472656,188.16000366210938,106.04000091552734,80.94000244140625,105.5,163.99000549316406\n2014-03-11,38.810001373291016,30.709999084472656,112.1500015258789,45.880001068115234,66.75,101.45999908447266,28.950000762939453,41.34000015258789,47.2599983215332,87.16000366210938,18.058488845825195,115.68000030517578,36.279998779296875,39.779998779296875,46.790000915527344,33.900001525878906,59.349998474121094,58.88999938964844,187.22999572753906,106.31999969482422,80.93000030517578,105.48999786376953,163.4199981689453\n2014-03-12,38.88999938964844,30.510000228881836,112.38999938964844,45.439998626708984,66.5,101.86000061035156,28.8700008392334,41.099998474121094,47.2400016784668,87.16999816894531,18.0259952545166,116.08999633789062,36.34000015258789,40.279998779296875,46.7400016784668,33.810001373291016,59.20000076293945,58.599998474121094,187.27999877929688,107.05999755859375,81.0999984741211,105.5,163.22999572753906\n2014-03-13,38.189998626708984,29.6299991607666,112.8499984741211,44.68000030517578,65.26000213623047,102.45999908447266,28.190000534057617,40.439998626708984,46.900001525878906,86.30000305175781,17.822908401489258,116.5,35.849998474121094,40.70000076293945,46.45000076293945,32.97999954223633,57.90999984741211,57.72999954223633,185.17999267578125,108.5,81.33999633789062,105.52999877929688,161.0500030517578\n2014-03-14,38.400001525878906,29.950000762939453,112.83000183105469,44.15999984741211,65.12000274658203,102.47000122070312,28.18000030517578,40.47999954223633,46.900001525878906,86.37999725341797,17.709178924560547,116.37000274658203,35.630001068115234,40.88999938964844,46.20000076293945,33.029998779296875,58.0,57.2599983215332,184.66000366210938,108.5199966430664,81.29000091552734,105.47000122070312,160.64999389648438\n2014-03-17,38.869998931884766,30.479999542236328,112.56999969482422,44.63999938964844,65.94000244140625,102.05999755859375,28.59000015258789,40.779998779296875,47.279998779296875,86.83999633789062,17.896018981933594,116.22000122070312,36.04999923706055,41.15999984741211,46.7599983215332,33.06999969482422,58.779998779296875,57.88999938964844,186.3300018310547,107.70999908447266,81.18000030517578,105.47000122070312,162.3699951171875\n2014-03-18,39.40999984741211,30.760000228881836,112.79000091552734,44.599998474121094,66.3499984741211,102.30999755859375,28.93000030517578,40.959999084472656,47.54999923706055,87.56999969482422,17.98537826538086,116.58000183105469,36.52000045776367,41.099998474121094,47.029998779296875,33.630001068115234,59.2599983215332,58.08000183105469,187.66000366210938,108.0999984741211,81.2699966430664,105.54000091552734,163.27999877929688\n2014-03-19,38.56999969482422,30.420000076293945,111.75,44.36000061035156,65.54000091552734,101.36000061035156,28.469999313354492,40.47999954223633,47.130001068115234,86.91000366210938,17.97725486755371,115.73999786376953,36.369998931884766,40.45000076293945,46.33000183105469,33.099998474121094,58.400001525878906,57.47999954223633,186.66000366210938,107.26000213623047,80.88999938964844,105.33000183105469,162.19000244140625\n2014-03-20,38.7400016784668,30.459999084472656,111.4000015258789,43.720001220703125,65.29000091552734,101.37999725341797,28.68000030517578,40.400001525878906,47.7599983215332,87.25,18.26157569885254,115.9000015258789,36.650001525878906,40.540000915527344,46.09000015258789,33.0,58.459999084472656,56.810001373291016,187.75,107.06999969482422,80.81999969482422,105.36000061035156,163.3000030517578\n2014-03-21,38.97999954223633,30.489999771118164,111.81999969482422,43.52000045776367,65.16000366210938,101.56999969482422,28.56999969482422,40.34000015258789,47.369998931884766,87.05999755859375,18.19658851623535,116.30000305175781,36.310001373291016,40.5099983215332,46.38999938964844,33.95000076293945,58.2599983215332,56.93000030517578,186.1999969482422,108.2300033569336,81.05000305175781,105.37999725341797,162.6300048828125\n2014-03-24,39.36000061035156,30.3799991607666,111.95999908447266,43.68000030517578,65.33000183105469,101.61000061035156,28.610000610351562,40.279998779296875,47.0,86.87999725341797,18.188465118408203,116.5199966430664,36.279998779296875,40.619998931884766,46.59000015258789,34.4900016784668,58.310001373291016,57.2599983215332,185.42999267578125,109.0,81.05999755859375,105.33999633789062,162.44000244140625\n2014-03-25,39.810001373291016,30.81999969482422,111.93000030517578,43.880001068115234,66.04000091552734,101.55000305175781,29.049999237060547,40.900001525878906,47.2599983215332,87.66000366210938,18.172218322753906,116.55999755859375,36.5,40.790000915527344,47.15999984741211,34.77000045776367,58.150001525878906,57.529998779296875,186.30999755859375,108.58999633789062,81.04000091552734,105.4000015258789,163.38999938964844\n2014-03-26,39.900001525878906,30.899999618530273,112.31999969482422,44.20000076293945,66.02999877929688,101.9800033569336,29.0,40.70000076293945,46.58000183105469,87.25,17.98537826538086,117.01000213623047,36.060001373291016,40.619998931884766,47.27000045776367,34.849998474121094,58.04999923706055,57.77000045776367,184.97000122070312,109.44000244140625,81.26000213623047,105.41000366210938,162.3300018310547\n2014-03-27,40.41999816894531,30.8799991607666,112.36000061035156,44.84000015258789,66.36000061035156,102.08000183105469,29.010000228881836,40.86000061035156,46.45000076293945,87.95999908447266,17.887895584106445,117.04000091552734,35.93000030517578,40.95000076293945,47.470001220703125,35.099998474121094,58.209999084472656,58.38999938964844,184.5800018310547,109.98999786376953,81.33999633789062,105.3499984741211,162.27999877929688\n2014-03-28,40.7400016784668,31.299999237060547,112.08000183105469,45.31999969482422,66.86000061035156,101.72000122070312,29.18000030517578,41.040000915527344,46.77000045776367,89.05999755859375,17.961008071899414,116.94999694824219,36.06999969482422,41.0099983215332,47.79999923706055,35.83000183105469,58.599998474121094,58.90999984741211,185.49000549316406,109.37000274658203,81.19000244140625,105.36000061035156,162.85000610351562\n2014-03-31,41.0099983215332,31.350000381469727,112.0999984741211,45.31999969482422,67.19999694824219,101.7300033569336,29.200000762939453,41.18000030517578,47.279998779296875,89.05999755859375,18.14784812927246,116.94000244140625,36.349998474121094,41.459999084472656,48.09000015258789,35.779998779296875,58.95000076293945,59.08000183105469,187.00999450683594,109.0999984741211,81.19000244140625,105.4800033569336,164.24000549316406\n2014-04-01,41.4900016784668,31.579999923706055,111.70999908447266,45.439998626708984,67.62999725341797,101.33000183105469,29.489999771118164,41.31999969482422,47.540000915527344,89.58999633789062,18.180341720581055,116.30999755859375,36.779998779296875,41.16999816894531,48.38999938964844,35.900001525878906,59.43000030517578,59.470001220703125,188.25,107.88999938964844,80.91000366210938,105.37999725341797,164.9499969482422\n2014-04-02,41.56999969482422,31.549999237060547,111.45999908447266,45.84000015258789,67.76000213623047,100.88999938964844,29.440000534057617,41.41999816894531,47.88999938964844,89.91000366210938,18.220958709716797,116.1500015258789,36.79999923706055,41.11000061035156,48.52000045776367,35.84000015258789,59.38999938964844,59.810001373291016,188.8800048828125,107.2699966430664,80.75,105.23999786376953,165.3699951171875\n2014-04-03,41.40999984741211,31.43000030517578,111.58999633789062,45.599998474121094,67.56999969482422,100.95999908447266,29.459999084472656,41.29999923706055,47.95000076293945,90.48999786376953,18.188465118408203,116.37000274658203,36.619998931884766,41.2400016784668,48.400001525878906,35.75,59.310001373291016,59.61000061035156,188.6300048828125,107.73999786376953,80.81999969482422,105.2699966430664,165.33999633789062\n2014-04-04,41.29999923706055,31.34000015258789,112.0999984741211,45.400001525878906,67.36000061035156,101.58000183105469,29.40999984741211,41.15999984741211,47.34000015258789,90.16000366210938,18.009748458862305,116.83000183105469,35.91999816894531,41.459999084472656,48.45000076293945,35.630001068115234,59.06999969482422,59.439998626708984,186.39999389648438,108.45999908447266,81.05999755859375,105.36000061035156,163.8800048828125\n2014-04-07,41.47999954223633,31.020000457763672,112.2699966430664,44.959999084472656,67.04000091552734,101.81999969482422,29.360000610351562,40.900001525878906,46.650001525878906,88.6500015258789,17.733549118041992,117.11000061035156,35.63999938964844,41.38999938964844,48.43000030517578,35.810001373291016,58.810001373291016,59.04999923706055,184.33999633789062,109.11000061035156,81.20999908447266,105.37000274658203,162.16000366210938\n2014-04-08,41.959999084472656,31.059999465942383,112.33000183105469,44.0,67.0,101.95999908447266,29.360000610351562,41.2400016784668,46.83000183105469,89.54000091552734,17.75792121887207,117.41999816894531,35.959999084472656,41.97999954223633,49.16999816894531,36.380001068115234,58.9900016784668,58.79999923706055,185.10000610351562,109.37000274658203,81.2699966430664,105.37999725341797,162.3300018310547\n2014-04-09,42.279998779296875,31.440000534057617,112.41000366210938,44.63999938964844,67.86000061035156,101.93000030517578,29.770000457763672,41.79999923706055,47.540000915527344,89.94999694824219,17.91226577758789,117.5199966430664,36.439998626708984,41.88999938964844,49.86000061035156,36.81999969482422,59.720001220703125,59.650001525878906,187.08999633789062,108.83000183105469,81.25,105.4800033569336,164.10000610351562\n2014-04-10,41.83000183105469,30.850000381469727,112.80000305175781,43.36000061035156,66.66000366210938,102.36000061035156,29.200000762939453,41.2599983215332,46.59000015258789,88.69999694824219,17.497968673706055,117.68000030517578,35.599998474121094,41.72999954223633,49.41999816894531,36.68000030517578,58.650001525878906,58.47999954223633,183.16000366210938,109.83999633789062,81.5,105.47000122070312,161.47000122070312\n2014-04-11,41.83000183105469,30.59000015258789,113.08999633789062,43.20000076293945,66.26000213623047,102.56999969482422,29.059999465942383,40.900001525878906,46.029998779296875,88.44999694824219,17.286758422851562,117.76000213623047,35.20000076293945,41.689998626708984,49.36000061035156,36.13999938964844,58.209999084472656,58.31999969482422,181.50999450683594,110.7300033569336,81.55000305175781,105.4800033569336,160.02000427246094\n2014-04-14,41.7400016784668,30.649999618530273,112.87000274658203,43.79999923706055,66.63999938964844,102.41000366210938,29.149999618530273,41.15999984741211,46.400001525878906,89.66000366210938,17.42485809326172,117.83999633789062,35.54999923706055,41.939998626708984,49.45000076293945,36.20000076293945,58.459999084472656,58.790000915527344,182.94000244140625,110.44000244140625,81.54000091552734,105.52999877929688,161.4499969482422\n2014-04-15,41.11000061035156,30.239999771118164,113.1500015258789,43.7599983215332,66.36000061035156,102.52999877929688,29.06999969482422,41.08000183105469,46.68000030517578,90.86000061035156,17.58732795715332,118.08999633789062,35.72999954223633,42.52000045776367,49.11000061035156,35.290000915527344,58.209999084472656,58.56999969482422,184.1999969482422,111.12999725341797,81.58000183105469,105.48999786376953,162.36000061035156\n2014-04-16,41.630001068115234,30.709999084472656,113.22000122070312,44.599998474121094,67.18000030517578,102.37000274658203,29.420000076293945,41.540000915527344,47.369998931884766,91.94999694824219,17.725425720214844,118.13999938964844,36.08000183105469,42.83000183105469,49.540000915527344,35.72999954223633,58.880001068115234,59.40999984741211,186.1300048828125,111.2699966430664,81.52999877929688,105.4800033569336,164.02000427246094\n2014-04-17,42.0099983215332,31.020000457763672,113.08000183105469,44.720001220703125,67.52999877929688,101.79000091552734,29.549999237060547,41.79999923706055,47.52000045776367,92.79000091552734,17.75792121887207,117.45999908447266,36.029998779296875,42.29999923706055,49.650001525878906,35.81999969482422,59.2400016784668,59.43000030517578,186.38999938964844,110.05000305175781,81.31999969482422,105.4000015258789,163.75\n2014-04-21,41.75,31.09000015258789,113.08000183105469,44.720001220703125,67.62000274658203,101.7699966430664,29.610000610351562,42.0,47.529998779296875,93.41999816894531,17.74167251586914,117.62000274658203,36.16999816894531,42.25,49.599998474121094,35.59000015258789,59.38999938964844,59.5,187.0399932861328,109.95999908447266,81.33999633789062,105.44999694824219,164.02999877929688\n2014-04-22,41.63999938964844,31.489999771118164,113.08000183105469,44.400001525878906,67.9000015258789,101.7300033569336,29.780000686645508,42.119998931884766,47.70000076293945,93.2699966430664,17.863525390625,117.68000030517578,36.31999969482422,42.310001373291016,49.880001068115234,35.40999984741211,59.77000045776367,59.45000076293945,187.88999938964844,110.33000183105469,81.33999633789062,105.44000244140625,164.8000030517578\n2014-04-23,41.34000015258789,31.3799991607666,113.43000030517578,44.52000045776367,67.73999786376953,101.98999786376953,29.670000076293945,42.08000183105469,47.709999084472656,93.76000213623047,17.904142379760742,117.94000244140625,35.93000030517578,42.33000183105469,49.61000061035156,34.93000030517578,59.58000183105469,59.369998931884766,187.4499969482422,110.95999908447266,81.47000122070312,105.43000030517578,164.63999938964844\n2014-04-24,41.380001068115234,31.270000457763672,113.5,44.36000061035156,67.7300033569336,101.95999908447266,29.799999237060547,42.220001220703125,47.5,93.79000091552734,17.896018981933594,117.95999908447266,36.209999084472656,42.619998931884766,49.529998779296875,34.97999954223633,59.650001525878906,59.2400016784668,187.8300018310547,111.16999816894531,81.48999786376953,105.41999816894531,164.69000244140625\n2014-04-25,40.81999969482422,30.93000030517578,113.55000305175781,44.08000183105469,67.4000015258789,102.0999984741211,29.690000534057617,42.15999984741211,47.15999984741211,93.2300033569336,17.749797821044922,117.94000244140625,35.75,43.11000061035156,49.22999954223633,34.70000076293945,59.38999938964844,58.880001068115234,186.2899932861328,111.33000183105469,81.5199966430664,105.47000122070312,163.35000610351562\n2014-04-28,41.02000045776367,31.149999618530273,113.20999908447266,44.31999969482422,67.61000061035156,101.94999694824219,29.780000686645508,42.20000076293945,46.959999084472656,93.38999938964844,17.64419174194336,117.80000305175781,36.09000015258789,43.31999969482422,49.59000015258789,34.61000061035156,59.529998779296875,59.220001220703125,186.8800048828125,110.79000091552734,81.43000030517578,105.45999908447266,164.1699981689453\n2014-04-29,41.40999984741211,31.43000030517578,113.13999938964844,44.439998626708984,68.05000305175781,102.04000091552734,29.899999618530273,42.7599983215332,47.290000915527344,93.81999969482422,17.81478500366211,117.81999969482422,36.34000015258789,43.13999938964844,49.45000076293945,35.06999969482422,60.02000045776367,59.2599983215332,187.75,110.63999938964844,81.47000122070312,105.4800033569336,165.0\n2014-04-30,41.33000183105469,31.68000030517578,113.58000183105469,44.31999969482422,68.31999969482422,102.30999755859375,30.040000915527344,43.040000915527344,47.66999816894531,93.73999786376953,17.839155197143555,118.1500015258789,36.45000076293945,43.209999084472656,49.38999938964844,34.93000030517578,60.5099983215332,59.040000915527344,188.30999755859375,111.0999984741211,81.6500015258789,105.5199966430664,165.4499969482422\n2014-05-01,41.380001068115234,31.719999313354492,113.7300033569336,44.880001068115234,68.51000213623047,102.41000366210938,30.100000381469727,43.15999984741211,47.369998931884766,93.52999877929688,17.87164878845215,118.30000305175781,36.4900016784668,43.38999938964844,49.13999938964844,34.9900016784668,60.56999969482422,59.31999969482422,188.3300018310547,112.0199966430664,81.66999816894531,105.45999908447266,165.22999572753906\n2014-05-02,41.61000061035156,31.459999084472656,114.02999877929688,44.79999923706055,68.4000015258789,102.55999755859375,29.950000762939453,43.20000076293945,47.54999923706055,93.72000122070312,17.863525390625,118.55000305175781,36.38999938964844,42.5,49.209999084472656,35.0,60.43000030517578,59.349998474121094,188.05999755859375,112.70999908447266,81.76000213623047,105.47000122070312,164.75\n2014-05-05,41.380001068115234,31.420000076293945,113.79000091552734,44.68000030517578,68.3499984741211,102.5,29.989999771118164,43.2400016784668,47.810001373291016,94.16000366210938,17.790414810180664,118.25,36.58000183105469,42.880001068115234,49.150001525878906,34.70000076293945,60.380001068115234,59.25,188.4199981689453,112.02999877929688,81.66999816894531,105.4800033569336,164.92999267578125\n2014-05-06,41.56999969482422,31.219999313354492,113.75,44.560001373291016,68.2300033569336,102.62000274658203,29.780000686645508,43.29999923706055,47.56999969482422,94.30000305175781,17.538585662841797,118.44999694824219,36.16999816894531,42.66999816894531,49.27000045776367,34.7599983215332,60.290000915527344,59.22999954223633,186.77999877929688,112.4800033569336,81.75,105.47000122070312,163.72999572753906\n2014-05-07,41.790000915527344,31.510000228881836,113.81999969482422,44.36000061035156,68.30999755859375,102.69999694824219,30.040000915527344,43.36000061035156,47.939998626708984,95.12000274658203,17.774168014526367,118.47000122070312,36.189998626708984,43.36000061035156,49.22999954223633,34.61000061035156,60.470001220703125,59.029998779296875,187.8800048828125,112.08000183105469,81.79000091552734,105.51000213623047,165.02999877929688\n2014-05-08,41.689998626708984,31.40999984741211,113.9800033569336,44.20000076293945,68.31999969482422,102.80999755859375,30.040000915527344,43.540000915527344,47.75,93.76000213623047,17.822908401489258,118.5,36.290000915527344,42.88999938964844,49.2599983215332,34.720001220703125,60.5099983215332,58.959999084472656,187.67999267578125,111.5999984741211,81.83000183105469,105.54000091552734,165.35000610351562\n2014-05-09,41.619998931884766,31.329999923706055,113.91000366210938,44.560001373291016,68.22000122070312,102.7300033569336,29.8700008392334,43.34000015258789,47.75,93.66999816894531,17.81478500366211,118.37000274658203,36.33000183105469,42.2599983215332,49.349998474121094,34.58000183105469,60.2599983215332,59.209999084472656,187.9600067138672,111.23999786376953,81.7300033569336,105.55999755859375,165.72000122070312\n2014-05-12,42.31999969482422,31.729999542236328,113.5999984741211,44.599998474121094,68.66999816894531,102.45999908447266,30.09000015258789,43.65999984741211,48.36000061035156,94.33000183105469,17.993501663208008,118.06999969482422,36.81999969482422,41.869998931884766,49.70000076293945,35.31999969482422,60.779998779296875,59.459999084472656,189.7899932861328,110.79000091552734,81.6500015258789,105.52999877929688,166.8000030517578\n2014-05-13,42.47999954223633,31.700000762939453,113.88999938964844,45.20000076293945,68.7699966430664,102.86000061035156,30.06999969482422,43.63999938964844,48.400001525878906,94.68000030517578,17.97725486755371,118.51000213623047,36.84000015258789,41.970001220703125,49.779998779296875,35.41999816894531,60.63999938964844,59.9900016784668,189.9600067138672,111.75,81.80000305175781,105.58999633789062,167.0500030517578\n2014-05-14,42.779998779296875,31.6299991607666,114.54000091552734,44.959999084472656,68.63999938964844,103.33000183105469,29.989999771118164,43.540000915527344,48.40999984741211,94.72000122070312,17.847278594970703,119.0999984741211,36.66999816894531,42.18000030517578,49.869998931884766,35.81999969482422,60.560001373291016,59.90999984741211,189.05999755859375,112.95999908447266,82.01000213623047,105.66000366210938,166.11000061035156\n2014-05-15,42.380001068115234,31.450000762939453,115.06999969482422,44.52000045776367,68.33999633789062,103.69999694824219,29.700000762939453,43.5,47.72999954223633,93.63999938964844,17.64419174194336,119.30999755859375,36.45000076293945,42.0099983215332,49.849998474121094,35.56999969482422,60.29999923706055,59.58000183105469,187.39999389648438,113.86000061035156,82.16000366210938,105.68000030517578,164.5500030517578\n2014-05-16,42.939998626708984,31.31999969482422,114.94999694824219,44.599998474121094,68.48999786376953,103.4800033569336,29.729999542236328,43.720001220703125,47.900001525878906,93.4000015258789,17.668561935424805,119.16999816894531,36.68000030517578,42.13999938964844,50.0,35.970001220703125,60.34000015258789,59.84000015258789,188.0500030517578,113.54000091552734,82.16000366210938,105.66999816894531,164.61000061035156\n2014-05-19,42.939998626708984,31.389999389648438,114.61000061035156,44.68000030517578,68.3499984741211,103.3499984741211,29.809999465942383,43.619998931884766,48.099998474121094,93.69000244140625,17.75792121887207,119.05999755859375,36.91999816894531,41.4900016784668,49.59000015258789,35.7599983215332,60.34000015258789,59.61000061035156,188.74000549316406,112.69999694824219,82.12999725341797,105.68000030517578,164.7100067138672\n2014-05-20,42.59000015258789,31.25,114.83000183105469,44.15999984741211,67.91999816894531,103.6500015258789,29.639999389648438,43.2599983215332,47.84000015258789,93.41999816894531,17.652315139770508,119.05999755859375,36.709999084472656,41.4900016784668,49.040000915527344,35.54999923706055,60.029998779296875,59.02000045776367,187.5500030517578,112.94999694824219,82.16999816894531,105.75,163.32000732421875\n2014-05-21,42.91999816894531,31.469999313354492,114.76000213623047,44.68000030517578,68.44999694824219,103.48999786376953,29.81999969482422,43.68000030517578,48.060001373291016,94.43000030517578,17.76604461669922,118.83999633789062,36.959999084472656,41.52000045776367,49.41999816894531,36.040000915527344,60.47999954223633,59.47999954223633,189.1300048828125,112.26000213623047,82.0999984741211,105.69999694824219,164.97999572753906\n2014-05-22,43.220001220703125,31.479999542236328,114.94000244140625,45.119998931884766,68.54000091552734,103.37999725341797,29.780000686645508,43.58000183105469,48.16999816894531,94.33999633789062,17.847278594970703,118.80000305175781,37.029998779296875,41.86000061035156,49.63999938964844,36.349998474121094,60.40999984741211,59.939998626708984,189.58999633789062,112.0999984741211,82.05000305175781,105.70999908447266,165.17999267578125\n2014-05-23,43.13999938964844,31.559999465942383,115.20999908447266,45.560001373291016,68.72000122070312,103.58999633789062,29.850000381469727,43.41999816894531,48.58000183105469,94.1500015258789,17.904142379760742,118.93000030517578,37.34000015258789,41.7599983215332,49.81999969482422,36.34000015258789,60.41999816894531,60.33000183105469,190.35000610351562,112.69999694824219,82.12999725341797,105.66999816894531,165.8300018310547\n2014-05-27,42.77000045776367,32.150001525878906,115.27999877929688,45.91999816894531,69.20999908447266,103.62000274658203,30.170000076293945,43.540000915527344,48.58000183105469,94.41000366210938,18.058488845825195,119.3499984741211,37.65999984741211,42.09000015258789,50.0,36.150001525878906,60.90999984741211,60.540000915527344,191.52000427246094,113.36000061035156,82.20999908447266,105.69999694824219,166.47000122070312\n2014-05-28,43.02000045776367,31.940000534057617,115.91000366210938,45.720001220703125,68.9800033569336,104.19000244140625,30.030000686645508,43.279998779296875,48.599998474121094,94.56999969482422,18.0259952545166,119.91999816894531,37.560001373291016,42.34000015258789,49.849998474121094,36.59000015258789,60.65999984741211,60.540000915527344,191.3800048828125,114.76000213623047,82.4800033569336,105.7300033569336,166.08999633789062\n2014-05-29,43.13999938964844,32.09000015258789,115.86000061035156,46.2400016784668,69.4000015258789,104.05999755859375,30.1200008392334,43.52000045776367,49.09000015258789,95.37999725341797,18.066612243652344,119.56999969482422,37.779998779296875,42.459999084472656,50.29999923706055,36.65999984741211,60.939998626708984,61.08000183105469,192.3699951171875,114.1500015258789,82.41000366210938,105.75,166.77999877929688\n2014-05-30,42.54999923706055,32.13999938964844,115.58999633789062,46.31999969482422,69.41000366210938,103.9800033569336,30.200000762939453,43.459999084472656,49.08000183105469,95.30999755859375,18.107229232788086,119.58999633789062,37.81999969482422,42.7400016784668,50.04999923706055,36.849998474121094,60.97999954223633,60.939998626708984,192.67999267578125,114.0999984741211,82.33000183105469,105.73999786376953,166.92999267578125\n2014-06-02,42.68000030517578,32.09000015258789,114.47000122070312,46.880001068115234,69.55000305175781,103.33000183105469,30.15999984741211,43.47999954223633,49.279998779296875,95.19000244140625,18.15597152709961,118.58999633789062,37.7599983215332,42.72999954223633,50.04999923706055,37.119998931884766,60.939998626708984,61.470001220703125,192.89999389648438,112.95999908447266,81.94999694824219,105.55000305175781,167.1999969482422\n2014-06-03,42.91999816894531,31.959999084472656,113.80000305175781,46.79999923706055,69.37999725341797,102.80999755859375,30.010000228881836,43.400001525878906,49.16999816894531,95.5199966430664,18.180341720581055,118.05000305175781,37.70000076293945,42.88999938964844,49.93000030517578,37.45000076293945,60.7599983215332,61.33000183105469,192.8000030517578,111.56999969482422,81.75,105.52999877929688,167.02000427246094\n2014-06-04,42.68000030517578,31.959999084472656,113.5,47.119998931884766,69.36000061035156,102.7300033569336,30.0,43.279998779296875,49.25,95.47000122070312,18.229082107543945,117.98999786376953,37.77000045776367,42.869998931884766,49.70000076293945,37.13999938964844,60.70000076293945,61.4900016784668,193.19000244140625,111.54000091552734,81.76000213623047,105.45999908447266,167.1300048828125\n2014-06-05,43.130001068115234,32.25,113.79000091552734,47.2400016784668,69.83999633789062,102.87999725341797,30.489999771118164,43.380001068115234,49.47999954223633,96.0199966430664,18.399675369262695,118.23999786376953,38.02000045776367,43.22999954223633,49.970001220703125,37.439998626708984,61.2599983215332,61.689998626708984,194.4499969482422,111.58999633789062,81.8499984741211,105.52999877929688,168.13999938964844\n2014-06-06,43.560001373291016,32.349998474121094,113.79000091552734,47.2400016784668,70.22000122070312,102.80000305175781,30.729999542236328,43.70000076293945,49.720001220703125,96.80999755859375,18.521526336669922,118.48999786376953,38.189998626708984,43.08000183105469,50.040000915527344,37.2400016784668,61.720001220703125,61.77000045776367,195.3800048828125,111.58999633789062,81.83999633789062,105.51000213623047,169.0800018310547\n2014-06-09,43.720001220703125,32.22999954223633,113.77999877929688,47.20000076293945,70.1500015258789,102.6500015258789,30.59000015258789,43.63999938964844,49.59000015258789,96.95999908447266,18.60276222229004,118.25,38.310001373291016,42.790000915527344,50.43000030517578,37.61000061035156,61.58000183105469,61.79999923706055,195.5800018310547,111.43000030517578,81.7699966430664,105.4800033569336,169.24000549316406\n2014-06-10,43.95000076293945,32.189998626708984,113.58999633789062,46.79999923706055,70.0,102.47000122070312,30.510000228881836,43.63999938964844,49.65999984741211,96.80000305175781,18.59463882446289,118.02999877929688,38.33000183105469,42.689998626708984,50.310001373291016,37.779998779296875,61.540000915527344,61.540000915527344,195.60000610351562,111.0199966430664,81.61000061035156,105.45999908447266,169.35000610351562\n2014-06-11,43.79999923706055,31.90999984741211,113.69999694824219,46.91999816894531,69.6500015258789,102.61000061035156,30.190000534057617,43.540000915527344,49.380001068115234,97.16999816894531,18.47278594970703,118.12000274658203,38.2400016784668,42.150001525878906,50.0099983215332,37.619998931884766,61.13999938964844,61.47999954223633,194.9199981689453,111.22000122070312,81.63999938964844,105.4800033569336,168.35000610351562\n2014-06-12,43.59000015258789,31.899999618530273,114.04000091552734,47.08000183105469,69.66999816894531,103.01000213623047,30.190000534057617,43.52000045776367,48.959999084472656,97.48999786376953,18.359058380126953,118.5,37.90999984741211,42.279998779296875,49.86000061035156,37.52000045776367,61.099998474121094,61.439998626708984,193.5399932861328,112.20999908447266,81.8499984741211,105.5199966430664,167.2899932861328\n2014-06-13,43.61000061035156,31.780000686645508,113.8499984741211,47.31999969482422,69.72000122070312,102.80999755859375,30.09000015258789,43.560001373291016,49.150001525878906,98.41999816894531,18.3671817779541,118.4800033569336,38.130001068115234,42.54999923706055,50.0,38.09000015258789,61.0099983215332,61.63999938964844,194.1300048828125,112.1500015258789,81.83000183105469,105.45999908447266,167.6199951171875\n2014-06-16,43.40999984741211,31.84000015258789,113.95999908447266,47.31999969482422,69.73999786376953,102.80999755859375,30.010000228881836,43.560001373291016,49.040000915527344,99.01000213623047,18.277822494506836,118.47000122070312,38.130001068115234,42.84000015258789,49.959999084472656,38.02000045776367,61.04999923706055,61.619998931884766,194.2899932861328,112.43000030517578,81.80999755859375,105.43000030517578,167.69000244140625\n2014-06-17,43.41999816894531,31.889999389648438,113.80000305175781,47.2400016784668,69.69000244140625,102.37999725341797,30.100000381469727,43.599998474121094,49.13999938964844,98.94000244140625,18.464662551879883,118.06999969482422,38.220001220703125,42.779998779296875,49.529998779296875,37.9900016784668,61.04999923706055,61.45000076293945,194.8300018310547,111.54000091552734,81.62000274658203,105.43000030517578,168.0\n2014-06-18,43.900001525878906,32.16999816894531,114.36000061035156,47.880001068115234,70.29000091552734,102.91999816894531,30.31999969482422,43.86000061035156,49.66999816894531,99.69000244140625,18.570268630981445,118.75,38.41999816894531,43.75,49.849998474121094,38.279998779296875,61.56999969482422,62.119998931884766,196.25999450683594,112.4000015258789,81.83000183105469,105.47000122070312,168.92999267578125\n2014-06-19,43.650001525878906,32.25,114.19999694824219,48.720001220703125,70.66999816894531,102.66000366210938,30.389999389648438,44.040000915527344,49.56999969482422,100.4000015258789,18.5458984375,118.33000183105469,38.349998474121094,44.11000061035156,50.15999984741211,37.93000030517578,61.650001525878906,62.77000045776367,196.47999572753906,110.95999908447266,81.76000213623047,105.44999694824219,169.08999633789062\n2014-06-20,43.560001373291016,32.189998626708984,114.62000274658203,48.7599983215332,70.55000305175781,102.77999877929688,30.229999542236328,44.02000045776367,49.63999938964844,100.93000030517578,18.5458984375,118.55999755859375,38.09000015258789,43.470001220703125,49.939998626708984,37.83000183105469,61.540000915527344,62.650001525878906,195.94000244140625,111.80000305175781,81.80999755859375,105.4800033569336,169.0800018310547\n2014-06-23,43.470001220703125,32.0099983215332,114.5199966430664,48.36000061035156,70.36000061035156,102.70999908447266,30.149999618530273,44.040000915527344,49.709999084472656,101.29000091552734,18.586515426635742,118.55000305175781,38.20000076293945,43.31999969482422,50.040000915527344,37.36000061035156,61.43000030517578,62.47999954223633,195.8800048828125,111.44999694824219,81.77999877929688,105.44999694824219,168.91000366210938\n2014-06-24,43.45000076293945,31.93000030517578,115.04000091552734,48.36000061035156,69.91999816894531,103.12999725341797,29.959999084472656,43.540000915527344,49.2400016784668,99.16000366210938,18.464662551879883,119.05000305175781,38.0,43.45000076293945,49.540000915527344,36.70000076293945,59.97999954223633,61.880001068115234,194.6999969482422,112.58000183105469,81.93000030517578,105.48999786376953,167.8699951171875\n2014-06-25,43.20000076293945,31.290000915527344,115.08999633789062,48.20000076293945,68.22000122070312,103.2300033569336,29.260000228881836,41.439998626708984,49.630001068115234,99.91000366210938,18.48090934753418,119.16999816894531,38.150001525878906,43.61000061035156,49.04999923706055,36.77000045776367,59.83000183105469,62.119998931884766,195.5800018310547,112.87000274658203,82.04000091552734,105.55000305175781,168.27999877929688\n2014-06-26,43.25,31.09000015258789,115.30999755859375,48.040000915527344,68.2699966430664,103.5,29.200000762939453,41.58000183105469,49.619998931884766,100.0199966430664,18.415922164916992,119.38999938964844,38.11000061035156,43.7400016784668,49.66999816894531,37.130001068115234,59.79999923706055,62.290000915527344,195.44000244140625,113.41000366210938,82.1500015258789,105.54000091552734,168.0800018310547\n2014-06-27,43.349998474121094,31.219999313354492,115.3499984741211,47.91999816894531,68.30999755859375,103.5,29.219999313354492,41.70000076293945,49.470001220703125,100.0199966430664,18.489032745361328,119.37000274658203,38.34000015258789,43.90999984741211,49.72999954223633,37.209999084472656,59.95000076293945,62.20000076293945,195.82000732421875,113.23999786376953,82.1500015258789,105.58999633789062,168.1699981689453\n2014-06-30,43.22999954223633,31.280000686645508,115.36000061035156,48.15999984741211,68.37000274658203,103.58000183105469,29.149999618530273,41.7599983215332,49.63999938964844,100.0999984741211,18.47278594970703,119.26000213623047,38.349998474121094,44.2599983215332,49.25,37.040000915527344,59.95000076293945,62.2400016784668,195.72000122070312,113.5199966430664,82.22000122070312,105.68000030517578,167.88999938964844\n2014-07-01,43.63999938964844,31.440000534057617,114.55999755859375,49.0,68.97000122070312,103.05000305175781,29.309999465942383,42.15999984741211,49.7599983215332,100.16000366210938,18.586515426635742,118.47000122070312,38.7400016784668,43.81999969482422,49.5,37.31999969482422,60.439998626708984,62.93000030517578,197.02999877929688,112.27999877929688,81.88999938964844,105.55000305175781,169.1999969482422\n2014-07-02,43.900001525878906,31.40999984741211,114.0199966430664,48.880001068115234,69.08000183105469,102.62999725341797,29.229999542236328,42.36000061035156,49.81999969482422,100.01000213623047,18.570268630981445,118.05000305175781,38.779998779296875,42.970001220703125,50.0,38.02000045776367,60.5099983215332,63.08000183105469,197.22999572753906,111.08000183105469,81.66999816894531,105.52999877929688,169.39999389648438\n2014-07-03,44.15999984741211,31.700000762939453,114.11000061035156,48.720001220703125,69.22000122070312,102.41999816894531,29.350000381469727,42.58000183105469,50.13999938964844,100.38999938964844,18.716489791870117,117.93000030517578,38.95000076293945,42.5,50.040000915527344,38.43000030517578,60.810001373291016,63.029998779296875,198.1999969482422,110.68000030517578,81.56999969482422,105.51000213623047,170.47000122070312\n2014-07-07,44.130001068115234,31.290000915527344,114.33000183105469,48.36000061035156,68.68000030517578,102.66999816894531,28.940000534057617,42.31999969482422,49.720001220703125,99.62000274658203,18.635255813598633,118.13999938964844,38.9900016784668,42.70000076293945,50.04999923706055,38.349998474121094,60.16999816894531,62.66999816894531,197.50999450683594,111.48999786376953,81.66999816894531,105.44999694824219,169.86000061035156\n2014-07-08,43.93000030517578,30.899999618530273,114.69999694824219,48.20000076293945,67.95999908447266,103.13999938964844,28.5,41.720001220703125,49.59000015258789,99.45999908447266,18.47278594970703,118.58000183105469,38.63999938964844,42.9900016784668,49.880001068115234,38.150001525878906,59.290000915527344,62.459999084472656,196.24000549316406,112.73999786376953,81.81999969482422,105.4800033569336,168.85000610351562\n2014-07-09,44.18000030517578,31.049999237060547,114.9800033569336,48.52000045776367,68.18000030517578,103.16000366210938,28.6200008392334,41.7400016784668,49.7599983215332,100.12000274658203,18.521526336669922,118.7699966430664,38.83000183105469,42.869998931884766,49.7400016784668,37.970001220703125,59.5,62.650001525878906,197.1199951171875,112.83000183105469,81.9000015258789,105.43000030517578,169.5800018310547\n2014-07-10,43.939998626708984,30.600000381469727,115.12000274658203,47.68000030517578,67.43000030517578,103.37999725341797,28.229999542236328,41.439998626708984,49.540000915527344,99.16000366210938,18.399675369262695,118.68000030517578,38.720001220703125,43.15999984741211,49.58000183105469,37.7400016784668,58.779998779296875,62.0,196.33999633789062,112.86000061035156,81.91999816894531,105.48999786376953,168.9600067138672\n2014-07-11,43.88999938964844,30.549999237060547,115.29000091552734,47.7599983215332,67.47000122070312,103.55000305175781,28.299999237060547,41.41999816894531,49.630001068115234,98.4000015258789,18.43216896057129,119.05000305175781,38.91999816894531,42.83000183105469,50.0,37.900001525878906,58.77000045776367,62.18000030517578,196.61000061035156,113.58000183105469,82.04000091552734,105.58999633789062,169.1999969482422\n2014-07-14,44.22999954223633,30.8799991607666,115.05999755859375,48.31999969482422,67.97000122070312,103.31999969482422,28.450000762939453,41.599998474121094,49.599998474121094,99.25,18.5458984375,118.80000305175781,39.20000076293945,42.34000015258789,50.20000076293945,38.400001525878906,59.18000030517578,62.63999938964844,197.60000610351562,113.08999633789062,81.91999816894531,105.52999877929688,170.2899932861328\n2014-07-15,44.20000076293945,30.65999984741211,114.80999755859375,48.47999954223633,67.80000305175781,103.2300033569336,28.15999984741211,41.68000030517578,49.5,98.81999969482422,18.675872802734375,118.66999816894531,39.130001068115234,42.560001373291016,49.970001220703125,38.400001525878906,58.93000030517578,62.619998931884766,197.22999572753906,112.86000061035156,81.86000061035156,105.52999877929688,170.3800048828125\n2014-07-16,44.310001373291016,30.950000762939453,114.77999877929688,48.560001373291016,68.22000122070312,103.37999725341797,28.389999389648438,42.0,49.84000015258789,100.31999969482422,18.64337921142578,118.94999694824219,39.4900016784668,42.70000076293945,50.2400016784668,38.52000045776367,59.43000030517578,62.91999816894531,197.9600067138672,113.45999908447266,81.88999938964844,105.44000244140625,171.07000732421875\n2014-07-17,43.47999954223633,30.469999313354492,115.5,48.2400016784668,67.3499984741211,103.9800033569336,27.90999984741211,41.459999084472656,49.630001068115234,98.69999694824219,18.399675369262695,119.4000015258789,38.97999954223633,42.310001373291016,49.720001220703125,37.970001220703125,58.52000045776367,62.36000061035156,195.7100067138672,114.88999938964844,82.11000061035156,105.47000122070312,169.61000061035156\n2014-07-18,44.15999984741211,30.59000015258789,115.27999877929688,48.47999954223633,67.87999725341797,103.7699966430664,28.25,41.720001220703125,49.939998626708984,98.98999786376953,18.610885620117188,119.23999786376953,39.45000076293945,42.7400016784668,50.33000183105469,38.2400016784668,58.970001220703125,62.90999984741211,197.7100067138672,114.5199966430664,82.11000061035156,105.44999694824219,170.5800018310547\n2014-07-21,44.310001373291016,30.260000228881836,115.48999786376953,48.400001525878906,67.62999725341797,103.80000305175781,28.049999237060547,41.540000915527344,49.79999923706055,99.13999938964844,18.562145233154297,119.23999786376953,39.400001525878906,42.70000076293945,50.220001220703125,38.209999084472656,58.68000030517578,62.7599983215332,197.33999633789062,115.08999633789062,82.11000061035156,105.37000274658203,170.17999267578125\n2014-07-22,44.720001220703125,30.389999389648438,115.38999938964844,48.560001373291016,67.93000030517578,103.93000030517578,28.260000228881836,41.779998779296875,49.869998931884766,99.8499984741211,18.619009017944336,119.33000183105469,39.72999954223633,42.61000061035156,50.59000015258789,39.06999969482422,58.9900016784668,63.18000030517578,198.1999969482422,115.33000183105469,82.22000122070312,105.41000366210938,170.74000549316406\n2014-07-23,44.7599983215332,30.469999313354492,115.37999725341797,48.599998474121094,68.06999969482422,103.91999816894531,28.280000686645508,41.81999969482422,50.08000183105469,100.48999786376953,18.659626007080078,119.47000122070312,39.79999923706055,42.650001525878906,51.08000183105469,39.59000015258789,59.08000183105469,63.310001373291016,198.63999938964844,115.18000030517578,82.18000030517578,105.48999786376953,170.55999755859375\n2014-07-24,44.959999084472656,30.56999969482422,115.16999816894531,48.36000061035156,68.2300033569336,103.5,28.489999771118164,41.7400016784668,50.02000045776367,100.58000183105469,18.70024299621582,119.0,39.77000045776367,42.779998779296875,51.040000915527344,40.119998931884766,59.33000183105469,63.11000061035156,198.64999389648438,114.31999969482422,82.0199966430664,105.44000244140625,170.44000244140625\n2014-07-25,44.779998779296875,30.139999389648438,115.66999816894531,48.52000045776367,67.94999694824219,103.9000015258789,28.030000686645508,41.70000076293945,50.11000061035156,99.83999633789062,18.59463882446289,119.45999908447266,39.720001220703125,42.439998626708984,50.849998474121094,40.189998626708984,58.93000030517578,63.18000030517578,197.72000122070312,115.66999816894531,82.16999816894531,105.44000244140625,169.16000366210938\n2014-07-28,45.09000015258789,30.020000457763672,115.54000091552734,48.79999923706055,67.95999908447266,103.77999877929688,28.059999465942383,41.70000076293945,50.2400016784668,99.5999984741211,18.60276222229004,119.31999969482422,39.790000915527344,43.029998779296875,50.9900016784668,41.04999923706055,58.81999969482422,63.58000183105469,197.8000030517578,115.51000213623047,82.1500015258789,105.44999694824219,169.41000366210938\n2014-07-29,44.81999969482422,29.969999313354492,115.70999908447266,48.68000030517578,67.81999969482422,103.91999816894531,28.049999237060547,41.58000183105469,49.880001068115234,99.3499984741211,18.505279541015625,119.43000030517578,39.709999084472656,42.630001068115234,51.06999969482422,40.95000076293945,58.65999984741211,63.58000183105469,196.9499969482422,115.93000030517578,82.22000122070312,105.38999938964844,168.77999877929688\n2014-07-30,44.599998474121094,29.860000610351562,114.94999694824219,48.720001220703125,67.72000122070312,103.19000244140625,27.84000015258789,41.459999084472656,49.619998931884766,98.76000213623047,18.586515426635742,118.87999725341797,39.75,41.90999984741211,51.130001068115234,40.709999084472656,58.5099983215332,63.65999984741211,196.97999572753906,114.31999969482422,81.91000366210938,105.37000274658203,168.47999572753906\n2014-07-31,43.81999969482422,29.149999618530273,114.91000366210938,48.0,66.58999633789062,103.16000366210938,27.229999542236328,40.7599983215332,48.650001525878906,96.62999725341797,18.2047119140625,118.55000305175781,39.0,41.25,50.63999938964844,40.470001220703125,57.36000061035156,62.810001373291016,193.08999633789062,113.9800033569336,81.81999969482422,105.37000274658203,165.2899932861328\n2014-08-01,44.060001373291016,28.670000076293945,114.98999786376953,47.959999084472656,66.12999725341797,103.56999969482422,27.100000381469727,40.439998626708984,48.689998626708984,95.8499984741211,18.050365447998047,118.81999969482422,38.790000915527344,41.40999984741211,50.470001220703125,40.720001220703125,56.86000061035156,62.7400016784668,192.5,114.55999755859375,81.91999816894531,105.43000030517578,164.57000732421875\n2014-08-04,44.470001220703125,28.760000228881836,114.81999969482422,48.040000915527344,66.44000244140625,103.62999725341797,27.299999237060547,40.7400016784668,49.27000045776367,97.45999908447266,18.19658851623535,118.8499984741211,39.06999969482422,41.189998626708984,50.650001525878906,41.06999969482422,57.220001220703125,62.88999938964844,193.88999938964844,114.26000213623047,82.02999877929688,105.4800033569336,165.3300018310547\n2014-08-05,43.790000915527344,28.299999237060547,114.94999694824219,47.279998779296875,65.58999633789062,103.68000030517578,26.940000534057617,40.41999816894531,48.7599983215332,95.33000183105469,18.009748458862305,118.97000122070312,38.70000076293945,40.689998626708984,50.040000915527344,40.470001220703125,56.4900016784668,61.959999084472656,192.00999450683594,114.62999725341797,81.91999816894531,105.45999908447266,163.9199981689453\n2014-08-06,43.4900016784668,28.350000381469727,114.95999908447266,47.040000915527344,65.43000030517578,103.7699966430664,26.90999984741211,40.34000015258789,49.119998931884766,95.61000061035156,18.08285903930664,118.76000213623047,38.58000183105469,40.16999816894531,50.220001220703125,40.209999084472656,56.400001525878906,61.880001068115234,192.07000732421875,114.69999694824219,82.01000213623047,105.4800033569336,164.1999969482422\n2014-08-07,43.31999969482422,28.0,115.45999908447266,46.880001068115234,64.9000015258789,104.23999786376953,26.5,40.0,48.689998626708984,95.01000213623047,18.001625061035156,119.06999969482422,38.41999816894531,40.630001068115234,49.7400016784668,39.86000061035156,55.790000915527344,61.529998779296875,191.02999877929688,115.7699966430664,82.19000244140625,105.5,163.5500030517578\n2014-08-08,43.709999084472656,28.3799991607666,115.36000061035156,46.959999084472656,65.27999877929688,104.1500015258789,26.8799991607666,39.97999954223633,49.20000076293945,96.5999984741211,18.180341720581055,119.04000091552734,38.66999816894531,41.439998626708984,49.7400016784668,40.4900016784668,56.290000915527344,61.709999084472656,193.24000549316406,115.5199966430664,82.12999725341797,105.51000213623047,165.33999633789062\n2014-08-11,44.27000045776367,28.549999237060547,115.37000274658203,47.400001525878906,65.52999877929688,104.0999984741211,26.84000015258789,40.18000030517578,49.150001525878906,96.61000061035156,18.19658851623535,119.08999633789062,38.86000061035156,41.290000915527344,49.900001525878906,41.040000915527344,56.400001525878906,61.95000076293945,193.8000030517578,115.51000213623047,82.16999816894531,105.52999877929688,165.5500030517578\n2014-08-12,44.31999969482422,28.260000228881836,115.0199966430664,47.31999969482422,65.4800033569336,103.94999694824219,26.760000228881836,40.279998779296875,49.310001373291016,95.9000015258789,18.237205505371094,119.02999877929688,38.84000015258789,41.2599983215332,50.13999938964844,40.970001220703125,56.38999938964844,62.0099983215332,193.52999877929688,114.76000213623047,82.0999984741211,105.48999786376953,165.49000549316406\n2014-08-13,44.560001373291016,28.600000381469727,115.3499984741211,47.720001220703125,65.8499984741211,104.29000091552734,26.860000610351562,40.2599983215332,49.58000183105469,96.20999908447266,18.318439483642578,119.2699966430664,39.220001220703125,41.45000076293945,50.4900016784668,41.470001220703125,56.61000061035156,62.560001373291016,194.83999633789062,115.51000213623047,82.25,105.51000213623047,166.49000549316406\n2014-08-14,44.630001068115234,28.75,115.47000122070312,47.79999923706055,66.19999694824219,104.5,27.010000228881836,40.459999084472656,49.58000183105469,95.66000366210938,18.43216896057129,119.4000015258789,39.290000915527344,41.810001373291016,50.77000045776367,41.02000045776367,56.95000076293945,62.77000045776367,195.75999450683594,116.44000244140625,82.33000183105469,105.51000213623047,167.10000610351562\n2014-08-15,44.5099983215332,28.520000457763672,115.75,47.880001068115234,66.12999725341797,104.91999816894531,26.969999313354492,40.560001373291016,49.72999954223633,96.37000274658203,18.342811584472656,119.81999969482422,39.290000915527344,41.970001220703125,50.709999084472656,41.06999969482422,56.90999984741211,62.75,195.72000122070312,117.70999908447266,82.4800033569336,105.5199966430664,166.35000610351562\n2014-08-18,44.939998626708984,28.81999969482422,115.30000305175781,48.040000915527344,66.55999755859375,104.58999633789062,27.139999389648438,40.91999816894531,50.220001220703125,96.62999725341797,18.5458984375,119.55000305175781,39.65999984741211,41.86000061035156,51.0,41.400001525878906,57.349998474121094,63.0,197.36000061035156,116.54000091552734,82.30999755859375,105.4800033569336,168.05999755859375\n2014-08-19,45.150001525878906,28.950000762939453,115.08999633789062,48.08000183105469,66.72000122070312,104.4800033569336,27.200000762939453,40.880001068115234,50.369998931884766,97.37000274658203,18.578392028808594,119.47000122070312,39.90999984741211,42.38999938964844,51.22999954223633,41.43000030517578,57.439998626708984,63.279998779296875,198.38999938964844,116.18000030517578,82.30000305175781,105.52999877929688,168.88999938964844\n2014-08-20,45.060001373291016,28.790000915527344,114.75,47.79999923706055,66.51000213623047,104.16999816894531,26.979999542236328,40.7599983215332,50.439998626708984,97.58000183105469,18.627132415771484,119.19999694824219,39.90999984741211,42.47999954223633,51.5099983215332,41.209999084472656,57.209999084472656,63.130001068115234,198.9199981689453,115.98999786376953,82.18000030517578,105.44999694824219,169.60000610351562\n2014-08-21,44.869998931884766,28.979999542236328,114.97000122070312,48.040000915527344,66.79000091552734,104.38999938964844,27.280000686645508,40.7400016784668,50.369998931884766,97.66000366210938,18.846466064453125,119.61000061035156,40.099998474121094,42.58000183105469,51.34000015258789,40.66999816894531,57.560001373291016,63.099998474121094,199.5,116.63999938964844,82.2699966430664,105.45999908447266,170.17999267578125\n2014-08-22,44.75,28.799999237060547,114.91999816894531,47.68000030517578,66.47000122070312,104.4000015258789,27.040000915527344,40.68000030517578,50.16999816894531,97.01000213623047,18.781478881835938,119.76000213623047,40.11000061035156,42.45000076293945,51.22999954223633,40.88999938964844,57.2400016784668,62.83000183105469,199.19000244140625,117.29000091552734,82.2699966430664,105.41000366210938,169.8699951171875\n2014-08-25,45.08000183105469,29.110000610351562,115.05999755859375,47.84000015258789,66.9000015258789,104.4800033569336,27.389999389648438,41.08000183105469,50.36000061035156,97.87000274658203,18.94394874572754,119.94999694824219,40.150001525878906,42.7400016784668,51.349998474121094,41.25,57.849998474121094,62.970001220703125,200.1999969482422,117.7300033569336,82.30000305175781,105.37000274658203,170.6199951171875\n2014-08-26,45.349998474121094,29.299999237060547,114.97000122070312,47.599998474121094,66.91000366210938,104.45999908447266,27.649999618530273,40.84000015258789,50.40999984741211,98.37000274658203,18.98456573486328,120.02999877929688,40.16999816894531,42.22999954223633,51.34000015258789,41.310001373291016,57.93000030517578,62.880001068115234,200.3300018310547,117.3499984741211,82.33999633789062,105.4000015258789,170.92999267578125\n2014-08-27,45.58000183105469,29.299999237060547,115.18000030517578,47.400001525878906,67.04000091552734,104.75,27.729999542236328,41.099998474121094,50.40999984741211,98.16999816894531,18.94394874572754,120.2300033569336,40.15999984741211,42.689998626708984,51.47999954223633,41.02000045776367,58.13999938964844,62.849998474121094,200.25,118.3499984741211,82.47000122070312,105.4000015258789,171.00999450683594\n2014-08-28,45.130001068115234,29.010000228881836,115.36000061035156,47.279998779296875,66.73999786376953,104.88999938964844,27.56999969482422,40.959999084472656,50.45000076293945,98.19000244140625,18.887083053588867,120.48999786376953,40.099998474121094,43.0,51.29999923706055,40.52000045776367,57.75,62.70000076293945,200.13999938964844,118.97000122070312,82.58000183105469,105.41999816894531,170.77000427246094\n2014-08-29,45.060001373291016,28.920000076293945,115.25,47.20000076293945,66.70999908447266,104.9000015258789,27.56999969482422,41.08000183105469,50.529998779296875,98.73999786376953,18.976442337036133,120.58000183105469,40.279998779296875,43.279998779296875,51.119998931884766,40.470001220703125,57.779998779296875,62.529998779296875,200.7100067138672,119.05000305175781,82.58000183105469,105.51000213623047,170.8800048828125\n2014-09-02,44.9900016784668,28.959999084472656,114.44000244140625,47.68000030517578,66.83999633789062,104.05000305175781,27.549999237060547,40.86000061035156,50.36000061035156,97.48999786376953,19.04955291748047,119.66999816894531,40.290000915527344,42.88999938964844,51.189998626708984,40.709999084472656,57.709999084472656,62.75,200.61000061035156,116.7300033569336,82.12000274658203,105.37000274658203,170.5800018310547\n2014-09-03,45.58000183105469,29.360000610351562,114.6500015258789,47.720001220703125,67.30999755859375,104.19999694824219,27.809999465942383,41.13999938964844,50.439998626708984,97.75,19.017059326171875,119.83000183105469,40.06999969482422,43.099998474121094,51.7400016784668,42.060001373291016,58.22999954223633,62.970001220703125,200.5,117.37999725341797,82.26000213623047,105.4000015258789,170.72000122070312\n2014-09-04,45.459999084472656,29.190000534057617,114.22000122070312,47.560001373291016,66.98999786376953,103.83000183105469,27.799999237060547,40.79999923706055,50.439998626708984,96.43000030517578,19.033306121826172,118.9800033569336,40.04999923706055,43.08000183105469,51.619998931884766,42.189998626708984,57.900001525878906,62.869998931884766,200.2100067138672,115.94999694824219,82.12000274658203,105.37999725341797,170.66000366210938\n2014-09-05,45.849998474121094,29.389999389648438,114.0999984741211,47.36000061035156,67.0,103.86000061035156,27.8799991607666,40.720001220703125,50.65999984741211,97.08000183105469,19.057676315307617,119.0,40.290000915527344,43.619998931884766,51.52000045776367,42.52000045776367,58.040000915527344,62.59000015258789,201.11000061035156,115.7300033569336,82.08999633789062,105.41000366210938,171.25\n2014-09-08,45.310001373291016,29.1200008392334,113.81999969482422,47.31999969482422,66.29000091552734,103.75,27.56999969482422,39.86000061035156,50.459999084472656,95.56999969482422,19.065799713134766,118.80000305175781,40.349998474121094,43.36000061035156,50.869998931884766,42.290000915527344,57.22999954223633,62.29999923706055,200.58999633789062,115.77999877929688,82.02999877929688,105.38999938964844,171.05999755859375\n2014-09-09,44.75,29.110000610351562,113.48999786376953,46.91999816894531,66.0999984741211,103.51000213623047,27.549999237060547,39.880001068115234,50.04999923706055,95.1500015258789,18.87083625793457,118.4800033569336,40.060001373291016,42.86000061035156,50.650001525878906,41.9900016784668,57.209999084472656,61.77000045776367,199.32000732421875,115.69000244140625,81.88999938964844,105.27999877929688,170.1199951171875\n2014-09-10,44.560001373291016,29.1299991607666,113.05999755859375,47.439998626708984,66.4800033569336,103.25,27.610000610351562,40.29999923706055,50.04999923706055,94.91999816894531,18.968318939208984,118.29000091552734,40.29999923706055,42.66999816894531,50.56999969482422,41.25,57.45000076293945,62.22999954223633,200.07000732421875,114.95999908447266,81.73999786376953,105.23999786376953,170.6699981689453\n2014-09-11,44.2599983215332,29.059999465942383,113.11000061035156,47.31999969482422,66.11000061035156,103.12000274658203,27.5,40.040000915527344,49.97999954223633,94.9800033569336,19.017059326171875,118.19999694824219,40.38999938964844,43.029998779296875,50.02000045776367,41.11000061035156,57.20000076293945,61.77000045776367,200.3000030517578,114.58000183105469,81.68000030517578,105.30999755859375,170.50999450683594\n2014-09-12,43.790000915527344,28.959999084472656,112.66000366210938,47.15999984741211,66.0199966430664,102.7300033569336,27.510000228881836,40.060001373291016,49.75,93.55999755859375,19.000812530517578,117.62999725341797,40.220001220703125,42.2599983215332,49.56999969482422,40.95000076293945,57.220001220703125,61.47999954223633,199.1300048828125,113.37999725341797,81.55000305175781,105.27999877929688,169.89999389648438\n2014-09-15,43.56999969482422,28.989999771118164,112.79000091552734,47.20000076293945,65.87999725341797,102.91999816894531,27.469999313354492,40.13999938964844,49.81999969482422,94.22000122070312,18.99268913269043,117.66000366210938,39.97999954223633,42.38999938964844,49.0,40.369998931884766,57.189998626708984,61.18000030517578,198.97999572753906,113.55000305175781,81.58999633789062,105.2699966430664,170.32000732421875\n2014-09-16,44.13999938964844,29.079999923706055,112.76000213623047,47.279998779296875,66.16000366210938,102.88999938964844,27.5,40.2400016784668,50.04999923706055,95.36000061035156,19.073923110961914,117.63999938964844,40.279998779296875,42.93000030517578,49.31999969482422,40.630001068115234,57.400001525878906,61.599998474121094,200.47999572753906,113.08999633789062,81.55999755859375,105.30999755859375,171.3800048828125\n2014-09-17,43.72999954223633,28.920000076293945,112.0,46.880001068115234,65.69000244140625,102.62999725341797,27.360000610351562,40.099998474121094,50.349998474121094,94.83999633789062,19.15515899658203,117.31999969482422,40.36000061035156,42.849998474121094,48.310001373291016,40.34000015258789,57.150001525878906,60.75,200.75,112.80000305175781,81.45999908447266,105.29000091552734,171.5800018310547\n2014-09-18,43.790000915527344,29.280000686645508,111.70999908447266,47.15999984741211,66.19999694824219,102.55999755859375,27.540000915527344,40.47999954223633,50.689998626708984,94.3499984741211,19.341999053955078,117.52999877929688,40.599998474121094,42.540000915527344,48.529998779296875,40.279998779296875,57.66999816894531,61.06999969482422,201.82000732421875,113.16000366210938,81.47000122070312,105.2699966430664,172.61000061035156\n2014-09-19,43.459999084472656,29.110000610351562,112.04000091552734,47.2400016784668,65.97000122070312,102.94999694824219,27.350000381469727,40.5,50.439998626708984,93.79000091552734,19.21202278137207,117.98999786376953,40.34000015258789,42.540000915527344,48.189998626708984,39.869998931884766,57.439998626708984,60.91999816894531,200.6999969482422,114.5999984741211,81.63999938964844,105.30999755859375,172.4499969482422\n2014-09-22,42.79999923706055,29.0,111.95999908447266,47.20000076293945,65.68000030517578,103.16999816894531,27.270000457763672,40.279998779296875,50.41999816894531,92.41000366210938,19.082046508789062,118.0999984741211,40.06999969482422,42.220001220703125,47.540000915527344,39.119998931884766,57.22999954223633,60.61000061035156,199.14999389648438,114.73999786376953,81.73999786376953,105.27999877929688,171.41000366210938\n2014-09-23,42.560001373291016,28.56999969482422,112.37999725341797,47.119998931884766,65.12999725341797,103.38999938964844,26.809999465942383,39.560001373291016,50.15999984741211,92.13999938964844,18.952072143554688,118.29000091552734,39.97999954223633,42.099998474121094,47.63999938964844,39.08000183105469,56.47999954223633,60.529998779296875,198.00999450683594,115.44999694824219,81.77999877929688,105.30000305175781,170.2100067138672\n2014-09-24,43.16999816894531,28.65999984741211,112.27999877929688,47.400001525878906,65.45999908447266,103.0999984741211,27.020000457763672,39.79999923706055,50.68000030517578,92.22000122070312,19.057676315307617,118.01000213623047,40.2400016784668,41.95000076293945,47.970001220703125,39.84000015258789,56.45000076293945,60.650001525878906,199.55999755859375,114.80999755859375,81.7300033569336,105.30000305175781,171.7899932861328\n2014-09-25,42.22999954223633,28.020000457763672,112.69000244140625,47.279998779296875,64.5,103.5999984741211,26.5,39.220001220703125,49.90999984741211,90.80999755859375,18.740861892700195,118.36000061035156,39.36000061035156,41.70000076293945,46.79999923706055,39.0,55.5099983215332,59.880001068115234,196.33999633789062,116.16999816894531,81.93000030517578,105.31999969482422,169.1699981689453\n2014-09-26,42.41999816894531,28.059999465942383,112.11000061035156,47.63999938964844,64.7699966430664,103.37999725341797,26.75,39.2400016784668,50.400001525878906,91.9800033569336,18.91957664489746,118.0999984741211,39.790000915527344,41.7599983215332,46.88999938964844,39.189998626708984,55.72999954223633,60.2599983215332,197.89999389648438,116.0,81.8499984741211,105.30999755859375,170.6999969482422\n2014-09-29,41.560001373291016,27.760000228881836,112.19000244140625,47.36000061035156,64.16999816894531,103.70999908447266,26.450000762939453,39.099998474121094,50.189998626708984,91.7699966430664,18.854589462280273,118.05000305175781,39.779998779296875,42.029998779296875,45.95000076293945,38.27000045776367,55.310001373291016,59.56999969482422,197.5399932861328,116.93000030517578,81.94999694824219,105.29000091552734,170.3300018310547\n2014-09-30,41.560001373291016,27.700000762939453,112.06999969482422,47.08000183105469,64.12000274658203,103.62000274658203,26.549999237060547,38.7599983215332,49.59000015258789,90.62000274658203,18.82209587097168,118.22000122070312,39.900001525878906,42.09000015258789,46.06999969482422,38.279998779296875,55.220001220703125,59.29999923706055,197.02000427246094,116.2699966430664,81.93000030517578,105.27999877929688,170.07000732421875\n2014-10-01,40.709999084472656,27.360000610351562,112.87000274658203,46.31999969482422,63.36000061035156,104.30000305175781,26.229999542236328,38.29999923706055,48.41999816894531,88.7699966430664,18.59463882446289,118.5999984741211,39.279998779296875,42.33000183105469,45.939998626708984,37.459999084472656,54.619998931884766,58.47999954223633,194.35000610351562,118.2300033569336,82.12000274658203,105.29000091552734,167.67999267578125\n2014-10-02,40.93000030517578,27.1200008392334,112.58999633789062,45.439998626708984,62.68000030517578,103.98999786376953,25.8700008392334,37.84000015258789,48.29999923706055,88.30999755859375,18.64337921142578,118.58999633789062,39.2599983215332,42.27000045776367,46.130001068115234,37.470001220703125,53.97999954223633,57.9900016784668,194.3800048828125,117.19999694824219,82.05999755859375,105.30999755859375,167.64999389648438\n2014-10-03,41.279998779296875,27.030000686645508,112.41000366210938,46.0,62.68000030517578,103.95999908447266,25.690000534057617,37.79999923706055,48.439998626708984,88.16999816894531,18.911453247070312,118.93000030517578,39.58000183105469,42.540000915527344,46.16999816894531,38.08000183105469,53.7599983215332,58.43000030517578,196.52000427246094,117.69999694824219,82.01000213623047,105.26000213623047,169.72000122070312\n2014-10-06,41.81999969482422,26.969999313354492,112.51000213623047,45.880001068115234,63.08000183105469,104.12999725341797,25.90999984741211,38.2599983215332,48.43000030517578,88.2699966430664,18.854589462280273,118.98999786376953,39.59000015258789,42.540000915527344,46.56999969482422,38.630001068115234,54.220001220703125,58.540000915527344,196.2899932861328,117.7699966430664,82.19999694824219,105.33999633789062,169.57000732421875\n2014-10-07,41.45000076293945,26.510000228881836,112.9800033569336,45.599998474121094,62.0099983215332,104.73999786376953,25.290000915527344,37.599998474121094,47.58000183105469,87.12000274658203,18.53777503967285,119.41999816894531,38.970001220703125,42.47999954223633,46.150001525878906,38.29999923706055,53.09000015258789,58.060001373291016,193.25999450683594,119.36000061035156,82.41000366210938,105.41000366210938,166.86000061035156\n2014-10-08,42.06999969482422,26.959999084472656,113.5999984741211,45.880001068115234,62.9900016784668,105.11000061035156,25.760000228881836,38.36000061035156,48.20000076293945,87.97000122070312,18.887083053588867,120.02999877929688,39.709999084472656,43.439998626708984,46.9900016784668,39.02000045776367,54.060001373291016,58.72999954223633,196.63999938964844,119.38999938964844,82.62999725341797,105.55000305175781,169.6199951171875\n2014-10-09,41.40999984741211,26.25,113.4800033569336,44.720001220703125,61.29999923706055,104.93000030517578,24.8700008392334,37.20000076293945,47.02000045776367,84.73999786376953,18.489032745361328,119.52999877929688,39.04999923706055,42.72999954223633,46.290000915527344,38.380001068115234,52.43000030517578,57.400001525878906,192.74000549316406,118.87000274658203,82.5,105.51000213623047,166.33999633789062\n2014-10-10,40.5099983215332,25.719999313354492,113.79000091552734,44.08000183105469,60.380001068115234,105.33999633789062,24.540000915527344,36.7400016784668,46.29999923706055,83.55000305175781,18.342811584472656,119.62999725341797,38.04999923706055,42.93000030517578,45.2400016784668,37.709999084472656,51.720001220703125,56.43000030517578,190.5399932861328,120.05000305175781,82.56999969482422,105.4800033569336,165.2100067138672\n2014-10-13,40.91999816894531,25.729999542236328,114.31999969482422,43.68000030517578,60.29999923706055,105.88999938964844,24.56999969482422,36.7400016784668,45.11000061035156,80.97000122070312,18.180341720581055,119.94000244140625,37.630001068115234,42.88999938964844,45.58000183105469,38.04999923706055,51.709999084472656,56.279998779296875,187.41000366210938,120.77999877929688,82.80999755859375,105.54000091552734,162.92999267578125\n2014-10-14,41.15999984741211,25.8700008392334,114.05000305175781,43.959999084472656,60.45000076293945,106.0999984741211,24.68000030517578,36.720001220703125,45.25,79.94999694824219,18.25345230102539,120.20999908447266,37.689998626708984,43.279998779296875,45.810001373291016,38.11000061035156,51.790000915527344,56.56999969482422,187.6999969482422,121.56999969482422,82.91999816894531,105.5999984741211,163.02999877929688\n2014-10-15,40.63999938964844,25.700000762939453,114.18000030517578,43.720001220703125,60.09000015258789,106.69999694824219,24.3799991607666,36.20000076293945,45.560001373291016,80.55999755859375,17.904142379760742,120.30000305175781,37.43000030517578,42.709999084472656,46.18000030517578,37.95000076293945,51.22999954223633,56.650001525878906,186.42999267578125,122.52999877929688,83.11000061035156,105.58000183105469,161.27999877929688\n2014-10-16,40.27000045776367,25.520000457763672,114.04000091552734,43.560001373291016,59.529998779296875,106.41000366210938,24.030000686645508,36.040000915527344,46.0099983215332,82.0,17.904142379760742,120.02999877929688,37.209999084472656,42.75,46.220001220703125,37.79999923706055,50.689998626708984,56.34000015258789,186.27000427246094,121.75,82.97000122070312,105.62000274658203,160.97999572753906\n2014-10-17,40.720001220703125,26.15999984741211,114.0,43.7599983215332,60.63999938964844,106.0999984741211,24.600000381469727,36.7599983215332,46.619998931884766,82.69999694824219,18.13159942626953,119.9800033569336,37.650001525878906,43.0,46.70000076293945,38.2400016784668,51.84000015258789,56.79999923706055,188.47000122070312,121.06999969482422,82.91000366210938,105.54000091552734,163.4499969482422\n2014-10-20,40.84000015258789,26.09000015258789,114.04000091552734,44.63999938964844,61.02000045776367,106.25,24.65999984741211,36.779998779296875,47.33000183105469,83.41999816894531,18.237205505371094,120.19999694824219,37.91999816894531,43.599998474121094,47.0099983215332,38.2599983215332,52.060001373291016,57.58000183105469,190.3000030517578,121.51000213623047,82.9800033569336,105.5999984741211,163.64999389648438\n2014-10-21,41.0099983215332,26.440000534057617,113.80999755859375,44.560001373291016,61.75,105.95999908447266,25.1299991607666,37.36000061035156,48.349998474121094,85.95999908447266,18.578392028808594,120.12999725341797,38.65999984741211,43.75,47.31999969482422,38.40999984741211,52.88999938964844,57.709999084472656,194.07000732421875,120.54000091552734,82.86000061035156,105.5999984741211,165.8000030517578\n2014-10-22,40.7400016784668,26.040000915527344,113.76000213623047,44.599998474121094,61.29999923706055,105.93000030517578,24.75,36.97999954223633,47.959999084472656,84.33000183105469,18.407798767089844,119.93000030517578,38.47999954223633,44.02000045776367,47.16999816894531,38.2599983215332,52.310001373291016,57.689998626708984,192.69000244140625,120.66999816894531,82.83999633789062,105.55999755859375,164.3800048828125\n2014-10-23,40.72999954223633,26.549999237060547,113.3499984741211,44.880001068115234,61.88999938964844,105.48999786376953,25.170000076293945,37.220001220703125,47.91999816894531,85.9000015258789,18.586515426635742,119.69999694824219,38.90999984741211,44.099998474121094,47.47999954223633,38.5,53.02000045776367,58.11000061035156,194.92999267578125,119.5999984741211,82.58999633789062,105.51000213623047,166.4499969482422\n2014-10-24,41.02000045776367,26.549999237060547,113.29000091552734,45.040000915527344,62.22999954223633,105.58000183105469,25.270000457763672,37.41999816894531,48.279998779296875,85.5999984741211,18.76523208618164,119.75,39.25,44.529998779296875,47.77000045776367,38.63999938964844,53.2400016784668,58.400001525878906,196.42999267578125,119.72000122070312,82.66000366210938,105.54000091552734,167.74000549316406\n2014-10-27,40.70000076293945,26.34000015258789,113.2300033569336,45.119998931884766,61.880001068115234,105.69000244140625,25.06999969482422,37.279998779296875,47.27000045776367,83.80000305175781,18.789602279663086,119.9000015258789,39.290000915527344,44.43000030517578,47.56999969482422,38.099998474121094,52.959999084472656,58.34000015258789,196.16000366210938,119.94000244140625,82.62999725341797,105.5199966430664,167.8800048828125\n2014-10-28,41.52000045776367,26.950000762939453,113.18000030517578,45.36000061035156,62.81999969482422,105.43000030517578,25.34000015258789,37.63999938964844,47.7400016784668,85.70999908447266,18.99268913269043,119.5,39.83000183105469,44.7400016784668,48.33000183105469,39.27000045776367,53.790000915527344,58.88999938964844,198.41000366210938,119.19000244140625,82.58000183105469,105.51000213623047,169.66000366210938\n2014-10-29,41.58000183105469,26.690000534057617,113.02999877929688,45.599998474121094,62.34000015258789,105.08000183105469,25.010000228881836,37.459999084472656,47.150001525878906,85.98999786376953,19.04142951965332,119.27999877929688,39.790000915527344,44.47999954223633,47.7400016784668,39.40999984741211,53.220001220703125,58.970001220703125,198.11000061035156,119.45999908447266,82.44000244140625,105.41000366210938,169.39999389648438\n2014-10-30,41.970001220703125,26.84000015258789,112.98999786376953,45.959999084472656,62.790000915527344,105.19000244140625,25.200000762939453,37.58000183105469,47.5099983215332,85.68000030517578,19.147035598754883,119.36000061035156,39.91999816894531,45.459999084472656,48.27000045776367,39.45000076293945,53.56999969482422,59.5099983215332,199.3800048828125,119.55999755859375,82.5,105.43000030517578,171.60000610351562\n2014-10-31,42.150001525878906,27.229999542236328,113.08000183105469,48.2400016784668,63.95000076293945,105.0199966430664,25.549999237060547,38.02000045776367,48.400001525878906,87.41999816894531,19.366369247436523,119.33999633789062,40.540000915527344,45.470001220703125,48.599998474121094,39.93000030517578,54.16999816894531,61.119998931884766,201.66000366210938,119.25,82.36000061035156,105.47000122070312,173.4499969482422\n2014-11-03,41.79999923706055,26.940000534057617,113.08000183105469,48.560001373291016,63.400001525878906,104.80000305175781,25.239999771118164,37.52000045776367,48.060001373291016,86.04000091552734,19.43947982788086,118.7699966430664,40.709999084472656,45.77000045776367,47.869998931884766,39.54999923706055,53.439998626708984,61.040000915527344,201.77000427246094,118.95999908447266,82.1500015258789,105.2699966430664,173.36000061035156\n2014-11-04,41.84000015258789,26.8799991607666,113.04000091552734,47.279998779296875,63.040000915527344,104.79000091552734,25.09000015258789,37.560001373291016,47.560001373291016,84.2699966430664,19.447603225708008,118.94000244140625,40.70000076293945,45.529998779296875,48.060001373291016,39.77000045776367,53.349998474121094,60.08000183105469,201.07000732421875,119.33000183105469,82.12999725341797,105.2699966430664,173.4600067138672\n2014-11-05,41.470001220703125,27.020000457763672,113.1500015258789,47.040000915527344,63.15999984741211,104.81999969482422,25.270000457763672,37.86000061035156,48.02000045776367,85.75,19.577579498291016,118.72000122070312,40.810001373291016,46.560001373291016,47.650001525878906,39.459999084472656,53.720001220703125,59.65999984741211,202.33999633789062,119.16000366210938,82.2300033569336,105.27999877929688,174.5500030517578\n2014-11-06,40.959999084472656,27.049999237060547,112.95999908447266,46.439998626708984,62.81999969482422,104.5,25.239999771118164,37.720001220703125,48.40999984741211,86.83000183105469,19.61007308959961,118.36000061035156,40.790000915527344,45.77000045776367,47.5,39.349998474121094,53.5,59.189998626708984,203.14999389648438,118.38999938964844,82.04000091552734,105.20999908447266,175.2899932861328\n2014-11-07,41.220001220703125,26.889999389648438,113.62000274658203,46.279998779296875,62.849998474121094,105.16999816894531,25.15999984741211,37.939998626708984,48.63999938964844,87.79000091552734,19.618196487426758,119.11000061035156,40.84000015258789,46.25,47.90999984741211,39.279998779296875,53.540000915527344,59.22999954223633,203.33999633789062,119.75,82.31999969482422,105.33000183105469,175.5800018310547\n2014-11-10,41.33000183105469,27.0,113.22000122070312,46.63999938964844,63.130001068115234,104.73999786376953,25.270000457763672,38.060001373291016,48.77000045776367,87.0,19.72380256652832,118.51000213623047,40.95000076293945,46.47999954223633,48.040000915527344,39.29999923706055,53.779998779296875,59.61000061035156,203.97999572753906,118.6500015258789,82.1500015258789,105.29000091552734,175.9499969482422\n2014-11-11,41.290000915527344,27.170000076293945,113.19999694824219,46.91999816894531,63.5099983215332,104.75,25.469999313354492,38.31999969482422,49.0099983215332,87.26000213623047,19.6588134765625,118.5,40.970001220703125,46.310001373291016,48.189998626708984,39.4900016784668,54.13999938964844,59.83000183105469,204.17999267578125,118.7300033569336,82.19000244140625,105.19999694824219,176.02000427246094\n2014-11-12,41.209999084472656,26.75,113.04000091552734,46.68000030517578,62.970001220703125,104.70999908447266,25.100000381469727,37.959999084472656,49.130001068115234,86.48999786376953,19.618196487426758,118.48999786376953,41.099998474121094,45.5,48.04999923706055,39.45000076293945,53.5,59.68000030517578,203.9600067138672,118.62999725341797,82.18000030517578,105.20999908447266,176.0399932861328\n2014-11-13,41.099998474121094,26.889999389648438,112.91000366210938,47.08000183105469,63.27000045776367,104.87999725341797,25.200000762939453,37.959999084472656,49.13999938964844,85.33999633789062,19.61007308959961,118.36000061035156,41.31999969482422,45.130001068115234,48.060001373291016,39.68000030517578,53.72999954223633,59.93000030517578,204.19000244140625,118.91000366210938,82.23999786376953,105.23999786376953,176.44000244140625\n2014-11-14,41.439998626708984,26.920000076293945,113.19999694824219,47.08000183105469,63.36000061035156,105.0999984741211,25.34000015258789,37.880001068115234,49.290000915527344,86.20999908447266,19.545085906982422,118.51000213623047,41.61000061035156,44.939998626708984,48.540000915527344,40.45000076293945,53.7400016784668,60.02000045776367,204.24000549316406,119.48999786376953,82.26000213623047,105.27999877929688,176.35000610351562\n2014-11-17,41.0,26.989999771118164,112.80999755859375,46.31999969482422,63.11000061035156,104.9800033569336,25.3700008392334,37.97999954223633,49.279998779296875,85.76000213623047,19.545085906982422,118.2300033569336,41.529998779296875,45.529998779296875,47.900001525878906,39.25,53.88999938964844,59.209999084472656,204.3699951171875,119.19000244140625,82.26000213623047,105.26000213623047,176.49000549316406\n2014-11-18,41.220001220703125,27.649999618530273,112.91000366210938,46.959999084472656,63.79999923706055,105.0999984741211,25.809999465942383,38.20000076293945,49.869998931884766,85.83000183105469,19.61007308959961,118.33000183105469,41.66999816894531,45.65999984741211,47.77000045776367,38.81999969482422,54.650001525878906,59.66999816894531,205.5500030517578,119.5199966430664,82.37999725341797,105.26000213623047,176.9600067138672\n2014-11-19,41.20000076293945,27.65999984741211,112.43000030517578,46.68000030517578,63.61000061035156,104.81999969482422,25.809999465942383,38.18000030517578,49.79999923706055,86.27999877929688,19.569456100463867,117.69999694824219,41.400001525878906,45.619998931884766,46.97999954223633,38.63999938964844,54.630001068115234,59.0,205.22000122070312,118.76000213623047,82.16999816894531,105.22000122070312,176.92999267578125\n2014-11-20,41.130001068115234,27.670000076293945,112.72000122070312,46.20000076293945,63.22999954223633,105.01000213623047,25.559999465942383,38.099998474121094,50.060001373291016,87.36000061035156,19.569456100463867,118.1500015258789,41.61000061035156,45.52000045776367,46.7400016784668,38.4900016784668,54.400001525878906,58.599998474121094,205.5800018310547,119.37999725341797,82.2699966430664,105.2699966430664,177.25\n2014-11-21,42.439998626708984,27.979999542236328,113.05999755859375,46.560001373291016,63.779998779296875,105.22000122070312,25.889999389648438,38.36000061035156,50.66999816894531,88.5,19.66693687438965,118.66000366210938,41.66999816894531,45.70000076293945,47.36000061035156,39.90999984741211,54.81999969482422,59.189998626708984,206.67999267578125,120.0999984741211,82.44999694824219,105.23999786376953,177.6999969482422\n2014-11-24,42.09000015258789,28.3700008392334,113.1500015258789,46.63999938964844,64.1500015258789,105.33999633789062,26.270000457763672,38.5,50.439998626708984,87.81999969482422,19.796913146972656,118.8499984741211,41.88999938964844,45.31999969482422,47.099998474121094,40.02000045776367,55.290000915527344,59.189998626708984,207.25999450683594,120.19999694824219,82.45999908447266,105.30999755859375,177.8000030517578\n2014-11-25,41.81999969482422,28.600000381469727,113.25,46.7599983215332,64.26000213623047,105.5999984741211,26.350000381469727,38.41999816894531,50.2599983215332,86.38999938964844,19.78066635131836,119.36000061035156,41.90999984741211,45.31999969482422,46.90999984741211,39.689998626708984,55.5,59.09000015258789,207.11000061035156,121.19999694824219,82.61000061035156,105.36000061035156,177.9600067138672\n2014-11-26,42.349998474121094,28.899999618530273,113.30999755859375,46.63999938964844,64.51000213623047,105.77999877929688,26.450000762939453,38.720001220703125,50.29999923706055,85.30000305175781,19.805036544799805,119.7699966430664,42.290000915527344,45.52000045776367,47.400001525878906,40.93000030517578,55.720001220703125,59.310001373291016,207.63999938964844,121.52999877929688,82.7300033569336,105.41000366210938,178.00999450683594\n2014-11-28,41.5,28.790000915527344,113.26000213623047,46.47999954223633,63.9900016784668,106.19000244140625,26.309999465942383,38.060001373291016,49.15999984741211,79.81999969482422,19.8212833404541,120.08999633789062,42.4900016784668,46.0,46.54999923706055,40.599998474121094,55.290000915527344,58.810001373291016,207.1999969482422,122.48999786376953,82.87000274658203,105.4800033569336,178.10000610351562\n2014-12-01,40.790000915527344,28.81999969482422,112.93000030517578,46.720001220703125,63.93000030517578,105.75,26.34000015258789,38.08000183105469,48.650001525878906,80.0999984741211,19.683183670043945,119.33999633789062,42.0099983215332,46.09000015258789,45.70000076293945,39.540000915527344,55.2599983215332,58.4900016784668,205.75999450683594,121.5,82.58000183105469,105.37999725341797,177.60000610351562\n2014-12-02,40.779998779296875,28.68000030517578,112.29000091552734,47.119998931884766,64.11000061035156,105.27999877929688,26.25,38.34000015258789,48.939998626708984,80.97000122070312,19.870023727416992,118.54000091552734,42.02000045776367,46.400001525878906,46.040000915527344,40.5099983215332,55.279998779296875,58.90999984741211,207.08999633789062,120.31999969482422,82.4000015258789,105.3499984741211,178.55999755859375\n2014-12-03,40.88999938964844,28.56999969482422,112.43000030517578,47.08000183105469,64.02999877929688,105.31999969482422,26.1299991607666,38.36000061035156,49.65999984741211,81.95999908447266,19.959383010864258,118.66000366210938,42.16999816894531,46.27000045776367,46.08000183105469,40.29999923706055,55.16999816894531,58.84000015258789,207.88999938964844,120.79000091552734,82.37999725341797,105.30999755859375,178.9600067138672\n2014-12-04,40.959999084472656,28.5,112.6500015258789,46.959999084472656,63.81999969482422,105.69000244140625,26.040000915527344,38.099998474121094,49.810001373291016,81.25,19.983753204345703,118.8499984741211,42.16999816894531,46.22999954223633,46.06999969482422,41.5099983215332,54.970001220703125,58.86000061035156,207.66000366210938,121.80000305175781,82.5199966430664,105.30999755859375,178.8300018310547\n2014-12-05,40.880001068115234,28.760000228881836,112.0,47.0,63.959999084472656,105.0999984741211,26.200000762939453,38.18000030517578,49.77000045776367,80.27999877929688,20.1624698638916,118.36000061035156,42.119998931884766,45.869998931884766,45.959999084472656,41.97999954223633,55.2400016784668,58.84000015258789,208.0,121.08999633789062,82.27999877929688,105.11000061035156,179.50999450683594\n2014-12-08,40.279998779296875,28.549999237060547,112.08999633789062,46.2400016784668,63.400001525878906,105.44999694824219,25.959999084472656,37.84000015258789,48.97999954223633,77.02999877929688,20.259950637817383,118.91999816894531,41.689998626708984,46.2400016784668,45.5099983215332,41.68000030517578,54.810001373291016,58.209999084472656,206.61000061035156,122.56999969482422,82.44999694824219,105.02999877929688,178.5399932861328\n2014-12-09,39.900001525878906,28.3799991607666,112.56999969482422,46.47999954223633,63.060001373291016,105.83999633789062,25.700000762939453,37.36000061035156,49.11000061035156,77.87000274658203,20.211210250854492,119.0199966430664,41.68000030517578,46.470001220703125,45.20000076293945,40.290000915527344,54.29999923706055,58.220001220703125,206.47000122070312,123.19999694824219,82.4800033569336,105.05000305175781,177.9600067138672\n2014-12-10,39.310001373291016,28.1200008392334,112.80000305175781,45.7599983215332,62.2599983215332,106.31999969482422,25.309999465942383,36.959999084472656,48.099998474121094,75.47000122070312,19.95125961303711,118.9800033569336,41.04999923706055,45.88999938964844,44.77000045776367,39.900001525878906,53.689998626708984,57.31999969482422,203.16000366210938,124.0999984741211,82.69999694824219,105.1500015258789,175.2899932861328\n2014-12-11,38.97999954223633,28.239999771118164,112.6500015258789,45.880001068115234,62.18000030517578,106.13999938964844,25.110000610351562,36.68000030517578,48.13999938964844,75.41999816894531,20.0,118.86000061035156,41.22999954223633,46.349998474121094,44.77000045776367,40.060001373291016,53.45000076293945,57.470001220703125,204.19000244140625,124.61000061035156,82.62000274658203,105.12000274658203,176.02999877929688\n2014-12-12,38.34000015258789,27.639999389648438,112.77999877929688,45.439998626708984,60.97999954223633,107.01000213623047,24.6299991607666,35.58000183105469,46.79999923706055,74.0199966430664,19.61007308959961,119.05000305175781,40.619998931884766,45.90999984741211,44.290000915527344,39.560001373291016,52.2599983215332,56.84000015258789,200.88999938964844,126.30000305175781,82.9000015258789,105.16000366210938,173.0\n2014-12-15,37.790000915527344,27.010000228881836,112.33999633789062,44.560001373291016,59.970001220703125,106.62000274658203,24.139999389648438,35.119998931884766,46.54999923706055,73.36000061035156,19.43135643005371,119.33000183105469,40.369998931884766,45.52000045776367,43.79999923706055,39.45000076293945,51.380001068115234,56.08000183105469,199.50999450683594,126.04000091552734,82.75,105.0999984741211,171.7899932861328\n2014-12-16,37.72999954223633,27.389999389648438,113.04000091552734,44.599998474121094,60.400001525878906,107.16000366210938,24.40999984741211,35.720001220703125,46.189998626708984,74.01000213623047,19.244516372680664,119.29000091552734,39.83000183105469,45.47999954223633,43.630001068115234,39.36000061035156,51.95000076293945,56.119998931884766,197.91000366210938,127.5999984741211,82.94000244140625,105.12999725341797,170.85000610351562\n2014-12-17,38.04999923706055,27.700000762939453,112.51000213623047,45.08000183105469,60.529998779296875,106.41999816894531,24.6200008392334,35.47999954223633,47.45000076293945,77.08000183105469,19.683183670043945,119.31999969482422,40.58000183105469,46.290000915527344,42.7400016784668,40.34000015258789,52.529998779296875,56.68000030517578,201.7899932861328,126.44999694824219,82.73999786376953,105.0999984741211,173.58999633789062\n2014-12-18,38.56999969482422,28.110000610351562,111.80000305175781,45.79999923706055,61.61000061035156,105.81999969482422,25.18000030517578,36.29999923706055,48.529998779296875,78.55999755859375,20.138099670410156,119.44000244140625,41.7400016784668,47.20000076293945,43.33000183105469,40.529998779296875,53.63999938964844,57.470001220703125,206.77999877929688,124.19999694824219,82.61000061035156,104.93000030517578,177.7899932861328\n2014-12-19,38.84000015258789,27.829999923706055,112.3499984741211,46.040000915527344,61.70000076293945,106.20999908447266,25.030000686645508,36.65999984741211,48.81999969482422,80.56999969482422,20.04874038696289,119.37999725341797,41.56999969482422,46.86000061035156,43.77000045776367,40.2599983215332,53.439998626708984,57.900001525878906,206.52000427246094,125.87000274658203,82.79000091552734,105.04000091552734,177.64999389648438\n2014-12-22,39.380001068115234,28.15999984741211,112.45999908447266,45.91999816894531,62.0,106.20999908447266,25.110000610351562,36.79999923706055,48.849998474121094,79.75,20.186840057373047,119.76000213623047,42.06999969482422,46.97999954223633,44.16999816894531,41.25,53.5,57.47999954223633,207.47000122070312,126.04000091552734,82.75,105.0999984741211,179.36000061035156\n2014-12-23,39.02000045776367,28.020000457763672,111.6500015258789,46.0,61.79999923706055,105.33000183105469,25.219999313354492,36.47999954223633,49.22999954223633,80.72000122070312,20.300569534301758,118.8499984741211,42.18000030517578,47.099998474121094,43.77000045776367,40.65999984741211,53.29999923706055,57.290000915527344,207.75,123.54000091552734,82.01000213623047,105.0,180.02999877929688\n2014-12-24,39.11000061035156,28.170000076293945,111.52999877929688,45.91999816894531,62.08000183105469,105.25,25.420000076293945,36.779998779296875,49.060001373291016,80.12999725341797,20.26807403564453,118.91000366210938,42.13999938964844,47.970001220703125,43.900001525878906,40.33000183105469,53.68000030517578,57.31999969482422,207.77000427246094,123.94999694824219,82.04000091552734,104.9800033569336,180.02999877929688\n2014-12-26,39.41999816894531,28.18000030517578,111.56999969482422,46.2400016784668,62.2400016784668,105.38999938964844,25.40999984741211,36.81999969482422,49.22999954223633,80.11000061035156,20.26807403564453,119.0,42.31999969482422,48.54999923706055,44.15999984741211,41.68000030517578,53.720001220703125,57.7400016784668,208.44000244140625,124.41000366210938,82.11000061035156,104.9800033569336,180.19000244140625\n2014-12-29,39.18000030517578,28.010000228881836,111.73999786376953,45.7599983215332,61.790000915527344,105.75,25.200000762939453,36.5,49.22999954223633,80.4000015258789,20.3411865234375,119.2300033569336,42.11000061035156,49.11000061035156,44.58000183105469,41.59000015258789,53.2599983215332,57.54999923706055,208.72000122070312,125.33999633789062,82.25,105.0199966430664,180.11000061035156\n2014-12-30,39.2599983215332,27.65999984741211,111.70999908447266,45.20000076293945,61.220001220703125,105.87000274658203,24.829999923706055,36.2599983215332,49.060001373291016,79.76000213623047,20.316816329956055,119.33000183105469,41.810001373291016,48.09000015258789,44.290000915527344,40.95000076293945,52.79999923706055,56.9900016784668,207.60000610351562,125.68000030517578,82.30999755859375,105.08999633789062,179.4600067138672\n2014-12-31,39.290000915527344,27.40999984741211,112.01000213623047,44.959999084472656,60.84000015258789,105.98999786376953,24.649999618530273,36.060001373291016,48.58000183105469,79.16000366210938,20.089357376098633,119.41000366210938,41.349998474121094,47.220001220703125,43.95000076293945,41.619998931884766,52.40999984741211,56.869998931884766,205.5399932861328,125.91999816894531,82.37000274658203,105.18000030517578,177.8800048828125\n2015-01-02,38.77000045776367,27.280000686645508,112.7300033569336,45.040000915527344,60.58000183105469,106.52999877929688,24.520000457763672,35.720001220703125,48.650001525878906,79.52999877929688,20.089357376098633,119.83000183105469,41.27000045776367,47.439998626708984,43.84000015258789,41.68000030517578,52.13999938964844,56.72999954223633,205.42999267578125,127.31999969482422,82.6500015258789,105.1500015258789,177.94000244140625\n2015-01-05,38.08000183105469,26.329999923706055,112.81999969482422,44.52000045776367,59.150001525878906,107.18000030517578,23.639999389648438,34.81999969482422,47.40999984741211,76.23999786376953,19.66693687438965,120.31999969482422,40.63999938964844,46.86000061035156,43.439998626708984,41.529998779296875,50.619998931884766,56.02000045776367,201.72000122070312,129.32000732421875,82.88999938964844,105.12000274658203,174.83999633789062\n2015-01-06,37.91999816894531,26.219999313354492,112.83000183105469,43.79999923706055,58.47999954223633,107.9000015258789,23.3799991607666,34.41999816894531,46.9900016784668,75.12000274658203,19.366369247436523,120.80999755859375,40.150001525878906,46.88999938964844,43.119998931884766,41.02000045776367,50.04999923706055,55.439998626708984,199.82000732421875,131.64999389648438,83.12999725341797,105.11000061035156,173.38999938964844\n2015-01-07,38.7400016784668,26.440000534057617,112.91999816894531,44.439998626708984,59.130001068115234,107.87999725341797,23.610000610351562,34.720001220703125,47.52000045776367,75.27999877929688,19.569456100463867,120.97000122070312,40.4900016784668,47.349998474121094,43.599998474121094,42.099998474121094,50.56999969482422,56.15999984741211,202.30999755859375,131.38999938964844,83.18000030517578,105.23999786376953,175.58999633789062\n2015-01-08,39.400001525878906,26.940000534057617,112.73999786376953,45.0,59.93000030517578,107.44000244140625,24.040000915527344,35.34000015258789,48.650001525878906,76.97000122070312,19.861900329589844,120.58000183105469,41.380001068115234,47.68000030517578,44.08000183105469,42.439998626708984,51.29999923706055,56.849998474121094,205.89999389648438,129.64999389648438,83.05000305175781,105.20999908447266,178.75999450683594\n2015-01-09,39.27000045776367,26.75,113.08000183105469,44.52000045776367,59.63999938964844,107.97000122070312,23.850000381469727,35.18000030517578,48.400001525878906,76.36000061035156,19.593826293945312,120.9000015258789,41.25,47.380001068115234,44.34000015258789,42.279998779296875,51.0,56.63999938964844,204.25,131.07000732421875,83.19000244140625,105.30000305175781,177.22000122070312\n2015-01-12,38.95000076293945,26.90999984741211,113.05000305175781,44.36000061035156,59.5,108.3499984741211,23.989999771118164,35.040000915527344,48.290000915527344,74.16000366210938,19.43135643005371,121.12999725341797,40.77000045776367,47.27000045776367,44.02000045776367,41.900001525878906,50.9900016784668,56.47999954223633,202.64999389648438,131.82000732421875,83.30000305175781,105.29000091552734,176.24000549316406\n2015-01-13,39.290000915527344,27.030000686645508,112.87000274658203,44.720001220703125,59.79999923706055,108.44999694824219,24.06999969482422,35.13999938964844,47.75,73.56999969482422,19.366369247436523,121.23999786376953,40.7400016784668,47.400001525878906,44.22999954223633,42.5,51.220001220703125,56.880001068115234,202.0800018310547,131.82000732421875,83.37999725341797,105.30999755859375,175.97999572753906\n2015-01-14,39.06999969482422,27.100000381469727,113.54000091552734,44.63999938964844,59.630001068115234,108.94999694824219,24.06999969482422,34.81999969482422,47.189998626708984,73.80000305175781,19.09016990661621,121.44999694824219,40.5099983215332,47.810001373291016,43.84000015258789,42.04999923706055,51.15999984741211,56.56999969482422,200.86000061035156,132.82000732421875,83.56999969482422,105.43000030517578,174.05999755859375\n2015-01-15,39.15999984741211,27.049999237060547,114.44000244140625,44.959999084472656,60.0099983215332,109.87999725341797,24.049999237060547,35.02000045776367,47.099998474121094,72.86000061035156,18.854589462280273,122.08000183105469,39.9900016784668,48.189998626708984,44.119998931884766,42.470001220703125,51.45000076293945,56.900001525878906,199.02000427246094,134.91000366210938,83.94000244140625,105.58000183105469,173.05999755859375\n2015-01-16,39.4900016784668,27.690000534057617,113.80000305175781,45.36000061035156,60.790000915527344,109.06999969482422,24.520000457763672,35.58000183105469,47.849998474121094,75.2300033569336,19.082046508789062,121.4000015258789,40.380001068115234,48.619998931884766,44.459999084472656,42.220001220703125,52.16999816894531,57.36000061035156,201.6300048828125,133.19000244140625,83.69000244140625,105.3499984741211,174.6699981689453\n2015-01-20,39.43000030517578,27.670000076293945,114.06999969482422,45.720001220703125,61.0,109.31999969482422,24.729999542236328,35.900001525878906,47.93000030517578,75.31999969482422,19.000812530517578,121.68000030517578,40.720001220703125,48.7400016784668,43.95000076293945,41.7599983215332,52.529998779296875,57.290000915527344,202.05999755859375,134.9600067138672,83.5999984741211,105.31999969482422,174.89999389648438\n2015-01-21,40.29999923706055,27.850000381469727,113.5999984741211,45.79999923706055,61.47999954223633,108.80000305175781,24.969999313354492,36.2599983215332,48.400001525878906,76.8499984741211,19.04955291748047,121.62999725341797,40.790000915527344,49.209999084472656,44.400001525878906,43.09000015258789,52.959999084472656,57.560001373291016,203.0800018310547,133.39999389648438,83.44000244140625,105.33000183105469,175.35000610351562\n2015-01-22,41.06999969482422,27.799999237060547,113.62999725341797,46.0,61.709999084472656,108.52999877929688,25.079999923706055,36.58000183105469,49.0099983215332,77.20999908447266,19.520715713500977,121.56999969482422,41.459999084472656,49.0,44.54999923706055,43.86000061035156,53.11000061035156,57.90999984741211,206.10000610351562,132.9199981689453,83.45999908447266,105.33999633789062,177.9199981689453\n2015-01-23,40.7599983215332,27.760000228881836,114.31999969482422,45.84000015258789,61.36000061035156,109.23999786376953,24.950000762939453,36.400001525878906,48.25,76.66000366210938,19.30950355529785,122.27999877929688,41.45000076293945,49.13999938964844,44.279998779296875,43.75,52.810001373291016,57.77000045776367,204.97000122070312,134.77000427246094,83.7300033569336,105.41999816894531,176.41000366210938\n2015-01-26,40.779998779296875,28.440000534057617,114.12999725341797,46.36000061035156,62.20000076293945,108.98999786376953,25.40999984741211,36.939998626708984,48.459999084472656,77.76000213623047,19.406986236572266,122.25,41.279998779296875,49.11000061035156,44.47999954223633,43.72999954223633,53.65999984741211,58.20000076293945,205.4499969482422,134.36000061035156,83.62999725341797,105.30000305175781,176.5\n2015-01-27,40.560001373291016,28.209999084472656,114.48999786376953,46.439998626708984,62.290000915527344,109.13999938964844,25.389999389648438,36.959999084472656,48.130001068115234,77.70999908447266,19.195775985717773,122.33999633789062,40.09000015258789,49.18000030517578,44.59000015258789,42.88999938964844,53.68000030517578,58.27000045776367,202.74000549316406,134.57000732421875,83.68000030517578,105.33999633789062,173.58999633789062\n2015-01-28,40.119998931884766,27.84000015258789,114.93000030517578,46.36000061035156,61.36000061035156,109.9800033569336,24.729999542236328,36.5,47.2599983215332,74.6500015258789,18.846466064453125,123.16999816894531,40.02000045776367,48.7599983215332,44.2599983215332,42.11000061035156,52.63999938964844,58.11000061035156,200.13999938964844,136.77000427246094,83.9800033569336,105.41999816894531,171.72000122070312\n2015-01-29,40.119998931884766,28.540000915527344,114.80000305175781,46.7599983215332,62.20000076293945,109.58999633789062,25.440000534057617,36.7400016784668,47.880001068115234,74.9000015258789,19.000812530517578,122.87999725341797,40.400001525878906,49.40999984741211,44.54999923706055,42.38999938964844,53.59000015258789,58.540000915527344,201.99000549316406,135.8699951171875,83.88999938964844,105.4800033569336,173.89999389648438\n2015-01-30,39.02000045776367,28.049999237060547,115.62999725341797,45.959999084472656,61.220001220703125,110.55000305175781,24.950000762939453,36.08000183105469,47.689998626708984,75.55000305175781,18.692119598388672,123.88999938964844,39.900001525878906,48.31999969482422,44.150001525878906,41.2400016784668,52.68000030517578,57.540000915527344,199.4499969482422,138.27999877929688,84.3499984741211,105.45999908447266,171.4499969482422\n2015-02-02,39.720001220703125,28.670000076293945,115.55000305175781,46.439998626708984,61.959999084472656,110.2300033569336,25.31999969482422,36.400001525878906,48.119998931884766,77.86000061035156,18.99268913269043,123.66999816894531,40.310001373291016,48.529998779296875,44.97999954223633,41.939998626708984,53.290000915527344,58.369998931884766,201.9199981689453,137.47999572753906,84.08000183105469,105.4000015258789,173.27000427246094\n2015-02-03,40.470001220703125,29.219999313354492,115.0199966430664,46.36000061035156,62.95000076293945,109.30000305175781,25.940000534057617,37.29999923706055,49.18000030517578,79.98999786376953,19.30950355529785,122.66999816894531,40.77000045776367,48.709999084472656,45.540000915527344,42.790000915527344,54.4900016784668,58.560001373291016,204.83999633789062,134.57000732421875,83.81999969482422,105.3499984741211,176.3300018310547\n2015-02-04,40.27000045776367,28.739999771118164,115.26000213623047,46.599998474121094,62.43000030517578,109.4800033569336,25.459999084472656,36.959999084472656,48.86000061035156,78.66999816894531,19.26076316833496,122.83999633789062,40.849998474121094,48.119998931884766,45.36000061035156,43.150001525878906,53.7599983215332,58.599998474121094,204.05999755859375,134.8000030517578,83.8499984741211,105.4000015258789,176.52999877929688\n2015-02-05,40.5099983215332,29.18000030517578,114.76000213623047,47.0,63.290000915527344,109.08000183105469,26.0,37.52000045776367,50.040000915527344,79.80000305175781,19.455726623535156,122.44999694824219,41.22999954223633,48.560001373291016,45.86000061035156,43.0099983215332,54.5099983215332,59.060001373291016,206.1199951171875,133.32000732421875,83.66999816894531,105.47000122070312,178.5500030517578\n2015-02-06,39.81999969482422,28.440000534057617,113.86000061035156,46.599998474121094,62.5,107.86000061035156,25.399999618530273,37.119998931884766,49.91999816894531,79.81999969482422,19.61007308959961,121.16999816894531,41.099998474121094,46.560001373291016,45.59000015258789,42.040000915527344,53.689998626708984,58.54999923706055,205.5500030517578,130.9600067138672,83.12999725341797,105.16999816894531,178.08999633789062\n2015-02-09,39.7599983215332,28.110000610351562,113.66000366210938,46.15999984741211,62.20000076293945,107.80999755859375,25.309999465942383,37.02000045776367,49.86000061035156,79.9000015258789,19.512592315673828,121.25,41.040000915527344,46.150001525878906,45.470001220703125,41.939998626708984,53.47999954223633,58.220001220703125,204.6300048828125,130.75,83.0999984741211,105.16999816894531,177.08999633789062\n2015-02-10,39.65999984741211,28.450000762939453,113.27999877929688,46.7599983215332,62.77000045776367,107.54000091552734,25.65999984741211,37.15999984741211,50.22999954223633,79.86000061035156,19.66693687438965,120.91999816894531,41.650001525878906,47.099998474121094,45.58000183105469,42.130001068115234,54.0099983215332,58.650001525878906,206.80999755859375,129.7100067138672,82.94999694824219,105.19000244140625,178.50999450683594\n2015-02-11,39.369998931884766,28.350000381469727,113.06999969482422,46.84000015258789,62.43000030517578,107.5,25.510000228881836,36.97999954223633,50.150001525878906,79.30000305175781,19.66693687438965,121.0,41.810001373291016,46.08000183105469,45.130001068115234,42.11000061035156,53.630001068115234,58.349998474121094,206.92999267578125,129.9499969482422,82.94999694824219,105.18000030517578,178.6999969482422\n2015-02-12,40.209999084472656,29.200000762939453,112.88999938964844,47.15999984741211,63.400001525878906,107.54000091552734,26.149999618530273,37.63999938964844,51.0099983215332,80.33999633789062,19.861900329589844,121.30999755859375,42.380001068115234,45.869998931884766,45.279998779296875,42.709999084472656,54.779998779296875,58.81999969482422,208.9199981689453,129.52000427246094,82.98999786376953,105.18000030517578,179.83999633789062\n2015-02-13,40.66999816894531,29.190000534057617,112.66000366210938,47.720001220703125,63.81999969482422,107.18000030517578,26.18000030517578,37.81999969482422,51.439998626708984,82.04000091552734,19.845653533935547,120.83000183105469,42.650001525878906,45.16999816894531,45.91999816894531,42.97999954223633,54.959999084472656,59.56999969482422,209.77999877929688,128.19000244140625,82.80000305175781,105.19000244140625,180.33999633789062\n2015-02-17,40.58000183105469,29.049999237060547,112.08999633789062,47.68000030517578,63.970001220703125,106.41999816894531,26.239999771118164,37.79999923706055,51.5,82.29000091552734,19.910642623901367,120.2699966430664,42.66999816894531,45.130001068115234,46.08000183105469,43.13999938964844,55.119998931884766,59.72999954223633,210.11000061035156,126.26000213623047,82.47000122070312,105.23999786376953,180.57000732421875\n2015-02-18,40.56999969482422,29.1299991607666,112.55999755859375,48.52000045776367,64.3499984741211,106.93000030517578,26.31999969482422,37.97999954223633,51.63999938964844,81.30999755859375,19.788789749145508,120.69999694824219,42.709999084472656,46.20000076293945,46.27000045776367,43.099998474121094,55.310001373291016,60.40999984741211,210.1300048828125,127.01000213623047,82.69999694824219,105.41000366210938,180.47000122070312\n2015-02-19,40.400001525878906,29.100000381469727,112.47000122070312,48.880001068115234,64.43000030517578,106.66000366210938,26.329999923706055,37.939998626708984,51.779998779296875,80.93000030517578,19.707555770874023,120.68000030517578,42.86000061035156,45.68000030517578,46.099998474121094,43.060001373291016,55.22999954223633,60.52000045776367,209.97999572753906,126.16999816894531,82.62999725341797,105.36000061035156,180.08999633789062\n2015-02-20,40.66999816894531,29.5,112.4800033569336,49.31999969482422,65.02999877929688,106.5999984741211,26.670000076293945,38.18000030517578,51.93000030517578,80.54000091552734,19.853776931762695,120.86000061035156,43.08000183105469,45.689998626708984,46.31999969482422,43.33000183105469,55.939998626708984,60.939998626708984,211.24000549316406,126.54000091552734,82.6500015258789,105.37000274658203,181.13999938964844\n2015-02-23,40.2599983215332,29.420000076293945,112.69000244140625,49.040000915527344,64.80000305175781,107.08999633789062,26.489999771118164,38.099998474121094,51.869998931884766,80.20999908447266,19.805036544799805,121.2699966430664,43.11000061035156,46.0,46.11000061035156,42.970001220703125,55.66999816894531,60.70000076293945,211.2100067138672,127.98999786376953,82.81999969482422,105.3499984741211,180.9199981689453\n2015-02-24,40.84000015258789,29.65999984741211,113.37000274658203,49.279998779296875,65.19999694824219,107.80000305175781,26.690000534057617,38.36000061035156,52.09000015258789,80.43000030517578,19.90251922607422,122.05999755859375,43.2400016784668,46.34000015258789,46.459999084472656,43.5,56.04999923706055,61.029998779296875,211.80999755859375,129.6699981689453,83.16000366210938,105.52999877929688,181.91000366210938\n2015-02-25,40.7599983215332,29.670000076293945,113.55999755859375,49.15999984741211,65.25,107.9000015258789,26.6200008392334,38.380001068115234,51.939998626708984,80.87000274658203,19.90251922607422,122.16999816894531,42.970001220703125,45.58000183105469,46.56999969482422,43.2400016784668,56.099998474121094,61.06999969482422,211.6300048828125,130.22999572753906,83.23999786376953,105.45999908447266,181.9600067138672\n2015-02-26,40.77000045776367,29.579999923706055,113.4800033569336,49.599998474121094,65.06999969482422,107.26000213623047,26.3700008392334,38.2400016784668,51.61000061035156,79.37000274658203,19.853776931762695,121.51000213623047,43.2400016784668,45.279998779296875,46.189998626708984,43.77000045776367,55.810001373291016,61.209999084472656,211.3800048828125,128.4499969482422,83.01000213623047,105.37999725341797,182.00999450683594\n2015-02-27,40.7400016784668,29.700000762939453,114.13999938964844,49.400001525878906,65.0999984741211,107.63999938964844,26.5,38.20000076293945,51.4900016784668,79.0199966430664,19.78066635131836,121.80000305175781,43.09000015258789,45.22999954223633,46.36000061035156,43.7599983215332,55.88999938964844,61.029998779296875,210.66000366210938,129.52999877929688,83.08000183105469,105.36000061035156,181.19000244140625\n2015-03-02,40.68000030517578,29.81999969482422,113.20999908447266,49.52000045776367,65.19999694824219,106.66999816894531,26.5,38.2599983215332,51.83000183105469,78.47000122070312,19.926889419555664,120.41999816894531,43.43000030517578,44.36000061035156,46.45000076293945,43.849998474121094,55.970001220703125,61.2599983215332,211.99000549316406,126.87000274658203,82.6500015258789,105.2300033569336,182.67999267578125\n2015-03-03,40.369998931884766,29.489999771118164,113.37000274658203,49.279998779296875,64.80000305175781,106.44000244140625,26.270000457763672,37.900001525878906,51.54999923706055,78.76000213623047,19.870023727416992,120.3499984741211,43.13999938964844,44.630001068115234,46.470001220703125,42.70000076293945,55.5,61.099998474121094,211.1199951171875,126.41000366210938,82.55000305175781,105.19999694824219,181.8699951171875\n2015-03-04,39.93000030517578,29.420000076293945,113.4800033569336,49.040000915527344,64.54000091552734,106.5199966430664,26.15999984741211,37.720001220703125,51.369998931884766,78.6500015258789,19.748172760009766,120.2699966430664,42.970001220703125,44.380001068115234,46.220001220703125,42.02000045776367,55.29999923706055,60.86000061035156,210.22999572753906,126.44999694824219,82.55000305175781,105.19000244140625,180.77999877929688\n2015-03-05,39.869998931884766,29.510000228881836,113.27999877929688,49.31999969482422,64.69000244140625,106.58000183105469,26.31999969482422,37.91999816894531,51.150001525878906,78.18000030517578,19.82940673828125,120.43000030517578,42.91999816894531,44.72999954223633,45.91999816894531,41.70000076293945,55.470001220703125,60.97999954223633,210.4600067138672,126.29000091552734,82.5999984741211,105.25,181.1699981689453\n2015-03-06,39.2599983215332,29.040000915527344,111.97000122070312,49.2400016784668,63.810001373291016,105.48999786376953,25.809999465942383,37.08000183105469,50.459999084472656,76.77999877929688,19.683183670043945,119.1500015258789,42.38999938964844,43.38999938964844,45.33000183105469,41.2599983215332,54.41999816894531,60.650001525878906,207.5,123.5,82.12000274658203,105.12999725341797,178.39999389648438\n2015-03-09,39.11000061035156,29.299999237060547,111.80000305175781,49.08000183105469,63.90999984741211,105.9800033569336,25.81999969482422,37.2599983215332,50.529998779296875,76.2300033569336,19.77254295349121,119.62999725341797,42.59000015258789,43.470001220703125,45.310001373291016,41.7400016784668,54.63999938964844,60.45000076293945,208.36000061035156,124.63999938964844,82.22000122070312,105.19000244140625,179.8000030517578\n2015-03-10,38.2400016784668,28.65999984741211,111.93000030517578,48.36000061035156,62.52000045776367,106.43000030517578,25.170000076293945,36.2400016784668,49.7599983215332,75.16999816894531,19.350122451782227,119.81999969482422,41.720001220703125,43.38999938964844,44.34000015258789,40.77000045776367,53.310001373291016,59.41999816894531,204.97999572753906,126.27999877929688,82.54000091552734,105.13999938964844,176.69000244140625\n2015-03-11,38.529998779296875,29.010000228881836,112.12000274658203,48.79999923706055,62.68000030517578,106.62000274658203,25.350000381469727,35.959999084472656,49.70000076293945,75.38999938964844,19.471973419189453,120.43000030517578,41.45000076293945,43.11000061035156,44.310001373291016,40.869998931884766,53.34000015258789,59.75,204.5,127.19999694824219,82.62999725341797,105.16999816894531,176.35000610351562\n2015-03-12,38.77000045776367,29.270000457763672,111.87000274658203,49.880001068115234,63.459999084472656,106.72000122070312,25.530000686645508,36.15999984741211,50.31999969482422,74.91000366210938,19.894393920898438,120.30999755859375,41.720001220703125,43.93000030517578,45.150001525878906,41.279998779296875,53.790000915527344,60.84000015258789,207.10000610351562,127.11000061035156,82.69000244140625,105.22000122070312,178.97000122070312\n2015-03-13,38.29999923706055,29.190000534057617,111.51000213623047,49.91999816894531,63.09000015258789,106.55999755859375,25.34000015258789,35.779998779296875,49.84000015258789,74.62999725341797,19.756296157836914,119.97000122070312,41.4900016784668,43.47999954223633,44.439998626708984,41.4900016784668,53.40999984741211,60.52000045776367,205.8300018310547,126.72000122070312,82.61000061035156,105.18000030517578,177.55999755859375\n2015-03-16,38.7599983215332,29.93000030517578,111.66999816894531,50.119998931884766,63.79999923706055,106.93000030517578,25.780000686645508,36.15999984741211,49.7599983215332,75.63999938964844,20.0,120.08999633789062,41.97999954223633,44.22999954223633,44.880001068115234,42.2400016784668,54.119998931884766,60.869998931884766,208.5800018310547,127.94000244140625,82.7699966430664,105.23999786376953,179.77999877929688\n2015-03-17,39.209999084472656,29.600000381469727,111.77999877929688,50.2400016784668,63.63999938964844,107.1500015258789,25.649999618530273,36.220001220703125,49.209999084472656,75.3499984741211,19.95125961303711,120.29000091552734,41.9900016784668,44.15999984741211,44.630001068115234,42.41999816894531,53.970001220703125,61.040000915527344,207.9600067138672,129.0,82.83999633789062,105.16000366210938,178.5\n2015-03-18,40.16999816894531,29.950000762939453,113.48999786376953,51.040000915527344,65.0,108.37999725341797,26.190000534057617,37.279998779296875,49.959999084472656,77.54000091552734,20.064987182617188,121.7699966430664,42.560001373291016,45.349998474121094,45.68000030517578,43.15999984741211,55.220001220703125,62.15999984741211,210.4600067138672,131.49000549316406,83.3499984741211,105.43000030517578,180.72999572753906\n2015-03-19,39.4900016784668,29.469999313354492,113.41999816894531,50.439998626708984,64.23999786376953,107.87000274658203,25.719999313354492,36.779998779296875,49.099998474121094,76.30999755859375,19.87814712524414,121.1500015258789,42.439998626708984,44.93000030517578,45.4900016784668,43.150001525878906,54.459999084472656,61.54999923706055,209.5,130.82000732421875,83.0999984741211,105.3499984741211,179.66000366210938\n2015-03-20,40.08000183105469,30.260000228881836,113.76000213623047,51.2400016784668,65.66000366210938,108.30999755859375,26.420000076293945,37.63999938964844,49.22999954223633,76.91000366210938,20.073110580444336,121.48999786376953,42.540000915527344,44.97999954223633,46.369998931884766,43.34000015258789,55.869998931884766,62.52000045776367,210.41000366210938,131.50999450683594,83.31999969482422,105.4000015258789,180.9600067138672\n2015-03-23,40.20000076293945,30.209999084472656,113.70999908447266,51.47999954223633,65.98999786376953,108.44999694824219,26.549999237060547,37.70000076293945,49.22999954223633,76.63999938964844,19.959383010864258,121.7699966430664,42.540000915527344,45.0099983215332,46.630001068115234,43.20000076293945,56.119998931884766,62.869998931884766,210.0,131.35000610351562,83.36000061035156,105.4000015258789,180.85000610351562\n2015-03-24,40.36000061035156,30.3799991607666,114.26000213623047,51.36000061035156,65.8499984741211,108.77999877929688,26.610000610351562,37.34000015258789,49.06999969482422,76.12999725341797,19.796913146972656,121.94999694824219,42.400001525878906,44.5099983215332,46.689998626708984,43.0,56.04999923706055,62.83000183105469,208.82000732421875,132.6199951171875,83.5,105.45999908447266,179.8300018310547\n2015-03-25,39.720001220703125,30.209999084472656,114.2300033569336,51.2400016784668,65.54000091552734,108.30999755859375,26.3799991607666,37.20000076293945,48.52000045776367,77.12000274658203,19.4800968170166,121.55000305175781,41.310001373291016,43.9900016784668,46.369998931884766,42.5099983215332,55.38999938964844,62.41999816894531,205.75999450683594,131.5,83.37000274658203,105.4000015258789,176.9199981689453\n2015-03-26,39.349998474121094,30.010000228881836,113.62000274658203,50.720001220703125,64.97000122070312,107.69999694824219,26.139999389648438,36.7599983215332,48.630001068115234,77.02999877929688,19.463850021362305,120.80000305175781,41.34000015258789,43.619998931884766,46.20000076293945,42.470001220703125,54.84000015258789,62.029998779296875,205.27000427246094,129.4499969482422,83.0999984741211,105.38999938964844,176.47999572753906\n2015-03-27,39.459999084472656,30.100000381469727,113.66999816894531,50.91999816894531,65.13999938964844,108.12000274658203,26.420000076293945,36.68000030517578,48.61000061035156,76.4000015258789,19.43947982788086,121.27999877929688,41.369998931884766,43.880001068115234,46.029998779296875,43.099998474121094,55.0,62.150001525878906,205.74000549316406,131.05999755859375,83.18000030517578,105.43000030517578,176.80999755859375\n2015-03-30,40.220001220703125,30.360000610351562,113.33000183105469,51.119998931884766,65.18000030517578,108.11000061035156,26.3799991607666,36.63999938964844,49.27000045776367,78.04000091552734,19.72380256652832,121.48999786376953,41.869998931884766,44.41999816894531,45.83000183105469,44.7400016784668,55.119998931884766,62.13999938964844,208.25,130.41000366210938,83.27999877929688,105.44000244140625,179.38999938964844\n2015-03-31,40.130001068115234,29.84000015258789,113.58999633789062,50.119998931884766,64.16999816894531,108.38999938964844,25.979999542236328,36.02000045776367,48.779998779296875,77.58000183105469,19.585702896118164,121.70999908447266,41.439998626708984,44.43000030517578,45.36000061035156,44.400001525878906,54.220001220703125,61.279998779296875,206.42999267578125,130.69000244140625,83.37000274658203,105.52999877929688,177.5800018310547\n2015-04-01,40.630001068115234,30.100000381469727,114.47000122070312,50.31999969482422,64.62999725341797,108.7300033569336,26.260000228881836,36.2599983215332,48.91999816894531,77.55999755859375,19.569456100463867,121.7300033569336,41.380001068115234,44.470001220703125,45.599998474121094,45.20000076293945,54.75,61.400001525878906,205.6999969482422,132.1300048828125,83.51000213623047,105.47000122070312,176.74000549316406\n2015-04-02,41.2400016784668,30.329999923706055,114.05000305175781,50.7599983215332,65.19000244140625,108.41999816894531,26.559999465942383,36.439998626708984,48.970001220703125,77.72000122070312,19.66693687438965,121.52999877929688,41.369998931884766,44.54999923706055,45.75,45.65999984741211,55.25,61.849998474121094,206.44000244140625,130.72999572753906,83.4000015258789,105.48999786376953,177.3300018310547\n2015-04-06,41.77000045776367,30.6200008392334,114.5,51.36000061035156,65.8499984741211,108.55999755859375,26.84000015258789,36.7599983215332,49.36000061035156,79.12000274658203,19.699430465698242,121.69000244140625,41.77000045776367,45.16999816894531,46.060001373291016,46.220001220703125,55.7400016784668,62.47999954223633,207.8300018310547,130.0,83.47000122070312,105.52999877929688,178.58999633789062\n2015-04-07,41.560001373291016,30.3799991607666,114.75,51.599998474121094,65.76000213623047,108.6500015258789,26.719999313354492,36.900001525878906,49.279998779296875,79.16999816894531,19.593826293945312,122.12999725341797,41.68000030517578,44.650001525878906,46.209999084472656,46.369998931884766,55.59000015258789,62.68000030517578,207.27999877929688,131.08999633789062,83.5199966430664,105.47000122070312,178.4199981689453\n2015-04-08,42.43000030517578,30.270000457763672,114.47000122070312,51.68000030517578,66.04000091552734,108.55000305175781,26.709999084472656,37.18000030517578,49.41999816894531,78.52999877929688,19.66693687438965,122.08999633789062,41.810001373291016,44.52000045776367,47.0,49.220001220703125,55.7400016784668,63.209999084472656,207.97999572753906,131.1300048828125,83.45999908447266,105.55999755859375,178.75\n2015-04-09,42.849998474121094,30.25,114.05999755859375,51.68000030517578,66.12999725341797,108.11000061035156,26.75,37.15999984741211,49.560001373291016,79.79000091552734,19.699430465698242,121.47000122070312,41.91999816894531,44.33000183105469,47.560001373291016,51.119998931884766,55.72999954223633,63.41999816894531,208.89999389648438,129.42999267578125,83.27999877929688,105.5199966430664,179.39999389648438\n2015-04-10,42.880001068115234,30.549999237060547,113.94999694824219,51.7599983215332,66.26000213623047,108.08000183105469,26.75,37.2599983215332,49.70000076293945,80.13999938964844,19.691307067871094,121.63999938964844,42.08000183105469,44.65999984741211,47.5099983215332,50.790000915527344,55.88999938964844,63.5,210.0399932861328,129.6199951171875,83.23999786376953,105.45999908447266,180.3699951171875\n2015-04-13,42.630001068115234,30.229999542236328,113.9800033569336,51.400001525878906,65.83999633789062,108.30000305175781,26.6200008392334,37.13999938964844,49.5,79.33999633789062,19.764419555664062,121.5999984741211,41.959999084472656,44.220001220703125,46.9900016784668,51.34000015258789,55.61000061035156,63.040000915527344,209.08999633789062,129.8000030517578,83.26000213623047,105.52999877929688,179.63999938964844\n2015-04-14,42.81999969482422,30.3700008392334,114.27999877929688,51.7599983215332,66.33000183105469,108.62000274658203,26.780000686645508,37.58000183105469,49.709999084472656,80.7699966430664,19.764419555664062,121.87999725341797,41.83000183105469,44.439998626708984,47.2599983215332,50.9900016784668,56.08000183105469,63.54999923706055,209.49000549316406,130.72000122070312,83.41000366210938,105.58000183105469,180.17999267578125\n2015-04-15,43.119998931884766,30.360000610351562,114.62999725341797,52.0,66.62999725341797,108.68000030517578,26.950000762939453,37.880001068115234,50.189998626708984,82.69999694824219,19.8375301361084,121.95999908447266,42.20000076293945,44.54999923706055,47.34000015258789,51.34000015258789,56.369998931884766,63.810001373291016,210.42999267578125,130.61000061035156,83.48999786376953,105.68000030517578,180.8800048828125\n2015-04-16,43.459999084472656,30.030000686645508,114.76000213623047,52.119998931884766,66.80999755859375,108.76000213623047,27.0,38.060001373291016,50.08000183105469,82.51000213623047,19.870023727416992,121.88999938964844,42.04999923706055,44.2599983215332,47.689998626708984,52.22999954223633,56.45000076293945,64.08000183105469,210.3699951171875,129.9600067138672,83.47000122070312,105.72000122070312,180.91000366210938\n2015-04-17,42.70000076293945,29.389999389648438,115.48999786376953,51.720001220703125,65.97000122070312,108.9800033569336,26.670000076293945,37.68000030517578,49.619998931884766,81.91000366210938,19.60194969177246,122.22000122070312,41.470001220703125,44.099998474121094,46.93000030517578,50.029998779296875,55.63999938964844,63.470001220703125,207.9499969482422,131.4499969482422,83.61000061035156,105.66999816894531,177.94000244140625\n2015-04-20,42.65999984741211,29.6299991607666,115.18000030517578,51.880001068115234,66.04000091552734,108.77999877929688,26.68000030517578,37.7599983215332,49.97999954223633,82.22000122070312,19.683183670043945,121.93000030517578,42.18000030517578,44.7599983215332,46.810001373291016,50.40999984741211,55.75,63.619998931884766,209.85000610351562,130.2899932861328,83.5199966430664,105.62000274658203,180.02999877929688\n2015-04-21,42.90999984741211,29.889999389648438,114.7699966430664,52.68000030517578,66.62999725341797,108.55000305175781,26.899999618530273,37.939998626708984,49.61000061035156,81.3499984741211,19.585702896118164,121.9000015258789,42.15999984741211,44.36000061035156,46.86000061035156,51.5,56.20000076293945,64.13999938964844,209.60000610351562,129.6999969482422,83.41999816894531,105.58999633789062,179.25999450683594\n2015-04-22,43.369998931884766,29.729999542236328,114.23999786376953,53.08000183105469,66.76000213623047,107.91999816894531,26.940000534057617,38.08000183105469,49.709999084472656,81.88999938964844,19.72380256652832,121.11000061035156,42.59000015258789,44.45000076293945,46.97999954223633,52.38999938964844,56.189998626708984,64.55000305175781,210.6300048828125,127.72000122070312,83.11000061035156,105.55000305175781,180.05999755859375\n2015-04-23,43.689998626708984,29.6299991607666,114.52999877929688,53.040000915527344,67.01000213623047,108.25,27.06999969482422,38.34000015258789,49.84000015258789,82.44999694824219,19.756296157836914,121.41999816894531,42.7599983215332,44.70000076293945,47.220001220703125,51.849998474121094,56.5,64.72000122070312,211.16000366210938,128.27000427246094,83.2699966430664,105.69999694824219,180.3699951171875\n2015-04-24,43.849998474121094,29.790000915527344,115.0199966430664,53.2400016784668,67.4000015258789,108.62999725341797,27.15999984741211,38.619998931884766,50.2599983215332,81.9800033569336,19.72380256652832,121.6500015258789,43.130001068115234,45.150001525878906,48.04999923706055,51.91999816894531,56.720001220703125,65.0999984741211,211.64999389648438,129.07000732421875,83.4000015258789,105.69000244140625,180.5399932861328\n2015-04-27,44.02000045776367,30.290000915527344,115.04000091552734,53.119998931884766,67.7300033569336,108.45999908447266,27.489999771118164,38.779998779296875,50.70000076293945,81.88999938964844,19.65069007873535,121.55999755859375,43.25,44.61000061035156,48.220001220703125,52.709999084472656,57.209999084472656,65.16999816894531,210.77000427246094,129.07000732421875,83.33999633789062,105.66999816894531,180.1699981689453\n2015-04-28,44.09000015258789,30.1200008392334,114.37999725341797,53.279998779296875,67.80999755859375,107.95999908447266,27.40999984741211,38.959999084472656,50.77000045776367,82.30000305175781,19.764419555664062,120.83999633789062,43.38999938964844,44.93000030517578,48.72999954223633,52.709999084472656,57.130001068115234,65.44999694824219,211.44000244140625,127.29000091552734,83.08000183105469,105.56999969482422,180.83999633789062\n2015-04-29,43.540000915527344,29.6299991607666,114.16999816894531,52.79999923706055,67.22000122070312,107.55999755859375,27.079999923706055,38.84000015258789,50.7400016784668,82.94000244140625,19.756296157836914,119.83999633789062,43.18000030517578,44.7400016784668,47.97999954223633,51.97999954223633,56.65999984741211,64.7699966430664,210.57000732421875,125.7300033569336,82.81999969482422,105.54000091552734,180.07000732421875\n2015-04-30,42.880001068115234,29.6200008392334,114.36000061035156,51.439998626708984,66.51000213623047,107.52999877929688,27.15999984741211,38.41999816894531,50.41999816894531,82.68000030517578,19.60194969177246,119.94000244140625,42.58000183105469,44.220001220703125,47.31999969482422,51.33000183105469,56.52000045776367,63.400001525878906,208.4600067138672,125.94999694824219,82.91000366210938,105.54000091552734,178.17999267578125\n2015-05-01,43.13999938964844,30.0,113.88999938964844,52.08000183105469,67.25,106.77999877929688,27.510000228881836,38.439998626708984,51.25,82.87000274658203,19.77254295349121,118.94999694824219,43.099998474121094,44.470001220703125,47.599998474121094,51.79999923706055,56.970001220703125,63.97999954223633,210.72000122070312,124.0,82.5,105.51000213623047,179.89999389648438\n2015-05-04,43.38999938964844,29.979999542236328,113.44999694824219,52.31999969482422,67.18000030517578,106.55999755859375,27.34000015258789,38.540000915527344,51.11000061035156,82.66000366210938,19.967506408691406,118.56999969482422,43.13999938964844,44.79999923706055,47.70000076293945,52.209999084472656,56.970001220703125,64.19999694824219,211.32000732421875,122.83000183105469,82.37999725341797,105.47000122070312,180.44000244140625\n2015-05-05,42.91999816894531,29.40999984741211,113.4000015258789,51.31999969482422,66.18000030517578,106.37999725341797,26.8799991607666,37.91999816894531,50.529998779296875,81.63999938964844,19.788789749145508,118.37000274658203,42.470001220703125,43.79999923706055,47.40999984741211,50.33000183105469,56.040000915527344,63.29999923706055,208.89999389648438,122.66000366210938,82.25,105.44000244140625,179.00999450683594\n2015-05-06,42.38999938964844,29.770000457763672,112.48999786376953,51.279998779296875,66.3499984741211,105.86000061035156,27.219999313354492,38.060001373291016,50.540000915527344,81.31999969482422,19.691307067871094,117.86000061035156,42.11000061035156,43.560001373291016,46.7400016784668,49.310001373291016,56.41999816894531,62.970001220703125,208.0399932861328,120.55999755859375,82.0199966430664,105.38999938964844,178.38999938964844\n2015-05-07,42.33000183105469,29.719999313354492,112.77999877929688,51.36000061035156,66.12999725341797,106.30999755859375,27.0,37.959999084472656,50.7599983215332,80.44000244140625,19.82940673828125,118.33000183105469,42.41999816894531,43.720001220703125,46.349998474121094,49.290000915527344,56.209999084472656,62.709999084472656,208.8699951171875,122.18000030517578,82.19000244140625,105.45999908447266,179.27999877929688\n2015-05-08,42.869998931884766,30.3799991607666,113.25,52.560001373291016,67.66000366210938,106.72000122070312,27.540000915527344,39.29999923706055,51.56999969482422,81.76000213623047,20.11372947692871,119.01000213623047,43.029998779296875,44.029998779296875,46.84000015258789,50.5099983215332,57.560001373291016,63.880001068115234,211.6199951171875,122.51000213623047,82.41000366210938,105.56999969482422,181.85000610351562\n2015-05-11,42.459999084472656,30.010000228881836,112.22000122070312,51.720001220703125,67.06999969482422,105.66999816894531,27.149999618530273,39.540000915527344,51.33000183105469,80.22000122070312,20.040616989135742,117.80999755859375,42.810001373291016,43.72999954223633,46.119998931884766,50.06999969482422,57.34000015258789,62.90999984741211,210.61000061035156,119.52999877929688,81.9800033569336,105.47000122070312,181.0800018310547\n2015-05-12,42.31999969482422,29.84000015258789,112.33000183105469,51.720001220703125,67.02999877929688,105.75,27.049999237060547,39.220001220703125,50.790000915527344,80.58999633789062,19.967506408691406,117.63999938964844,42.58000183105469,43.68000030517578,46.7599983215332,49.790000915527344,57.130001068115234,63.130001068115234,209.97999572753906,119.83999633789062,81.87999725341797,105.5199966430664,180.72000122070312\n2015-05-13,42.400001525878906,29.770000457763672,112.16000366210938,52.040000915527344,67.52999877929688,105.61000061035156,27.270000457763672,39.41999816894531,50.72999954223633,80.37999725341797,19.975629806518555,117.52999877929688,42.7599983215332,43.25,47.27000045776367,49.209999084472656,57.529998779296875,63.63999938964844,210.02000427246094,118.87999725341797,81.83999633789062,105.55999755859375,180.75\n2015-05-14,42.81999969482422,30.540000915527344,112.37000274658203,52.31999969482422,68.33999633789062,105.97000122070312,27.809999465942383,39.79999923706055,51.2599983215332,80.3499984741211,20.154346466064453,117.93000030517578,43.45000076293945,43.75,47.59000015258789,49.65999984741211,58.4900016784668,63.95000076293945,212.2100067138672,119.19999694824219,82.0,105.66000366210938,182.5399932861328\n2015-05-15,43.150001525878906,30.459999084472656,113.1500015258789,52.560001373291016,68.41999816894531,106.7300033569336,27.8700008392334,39.68000030517578,51.5099983215332,80.66999816894531,20.064987182617188,118.75,43.310001373291016,44.31999969482422,47.95000076293945,50.599998474121094,58.41999816894531,64.2300033569336,212.44000244140625,121.58999633789062,82.33000183105469,105.62999725341797,182.47999572753906\n2015-05-18,42.709999084472656,30.459999084472656,112.55000305175781,53.0,68.19000244140625,106.01000213623047,27.600000381469727,39.459999084472656,51.279998779296875,80.73999786376953,20.1787166595459,117.83999633789062,43.52000045776367,44.4900016784668,47.27000045776367,49.849998474121094,58.06999969482422,64.22000122070312,213.10000610351562,119.55000305175781,82.02999877929688,105.54000091552734,182.67999267578125\n2015-05-19,42.779998779296875,30.540000915527344,112.01000213623047,53.040000915527344,67.93000030517578,105.54000091552734,27.649999618530273,39.15999984741211,51.029998779296875,79.58999633789062,20.292444229125977,117.20999908447266,43.40999984741211,44.59000015258789,46.72999954223633,50.529998779296875,57.869998931884766,64.23999786376953,213.02999877929688,118.48999786376953,81.8499984741211,105.44000244140625,182.92999267578125\n2015-05-20,42.75,30.5,112.30999755859375,53.040000915527344,68.05999755859375,105.7699966430664,27.709999084472656,39.400001525878906,51.0,79.73999786376953,20.235580444335938,117.3499984741211,43.439998626708984,44.65999984741211,46.52000045776367,50.040000915527344,58.06999969482422,64.08999633789062,212.8800048828125,118.69000244140625,81.8499984741211,105.51000213623047,182.7100067138672\n2015-05-21,42.599998474121094,30.579999923706055,112.73999786376953,53.2400016784668,68.41999816894531,106.4000015258789,27.799999237060547,39.79999923706055,51.18000030517578,80.48999786376953,20.186840057373047,117.91000366210938,43.630001068115234,44.63999938964844,46.90999984741211,49.84000015258789,58.400001525878906,64.33000183105469,213.5,120.3499984741211,82.11000061035156,105.51000213623047,182.7899932861328\n2015-05-22,42.7400016784668,30.18000030517578,112.93000030517578,53.119998931884766,67.9800033569336,106.16000366210938,27.559999465942383,39.400001525878906,51.119998931884766,80.19999694824219,20.194963455200195,117.83000183105469,43.599998474121094,44.56999969482422,46.84000015258789,51.34000015258789,57.79999923706055,64.30000305175781,212.99000549316406,120.4000015258789,82.05999755859375,105.5,182.25999450683594\n2015-05-26,42.060001373291016,29.350000381469727,113.0199966430664,52.439998626708984,66.76000213623047,106.81999969482422,26.969999313354492,38.720001220703125,50.47999954223633,78.93000030517578,19.967506408691406,118.3499984741211,42.970001220703125,44.290000915527344,46.75,51.599998474121094,56.58000183105469,63.709999084472656,210.6999969482422,122.45999908447266,82.26000213623047,105.51000213623047,180.3699951171875\n2015-05-27,42.06999969482422,29.729999542236328,112.91999816894531,52.79999923706055,67.41000366210938,106.76000213623047,27.459999084472656,39.02000045776367,50.810001373291016,78.79000091552734,20.186840057373047,118.47000122070312,43.779998779296875,44.470001220703125,46.630001068115234,51.54999923706055,57.34000015258789,63.75,212.6999969482422,122.73999786376953,82.30000305175781,105.44000244140625,181.52000427246094\n2015-05-28,41.52000045776367,29.639999389648438,112.8499984741211,52.68000030517578,67.29000091552734,106.86000061035156,27.420000076293945,38.97999954223633,50.939998626708984,78.4800033569336,20.1624698638916,118.22000122070312,43.689998626708984,44.56999969482422,45.9900016784668,49.68000030517578,57.29999923706055,63.36000061035156,212.4600067138672,122.44000244140625,82.30999755859375,105.55999755859375,181.2899932861328\n2015-05-29,41.119998931884766,29.110000610351562,113.20999908447266,52.20000076293945,66.63999938964844,106.91999816894531,26.93000030517578,38.65999984741211,50.61000061035156,78.38999938964844,19.983753204345703,118.2699966430664,43.369998931884766,44.5,46.029998779296875,48.7599983215332,56.68000030517578,63.029998779296875,211.13999938964844,122.70999908447266,82.33999633789062,105.51000213623047,180.11000061035156\n2015-06-01,40.959999084472656,29.020000457763672,112.51000213623047,52.439998626708984,66.45999908447266,106.27999877929688,26.850000381469727,38.2599983215332,50.630001068115234,78.19000244140625,20.0,117.27999877929688,43.4900016784668,44.560001373291016,45.709999084472656,49.29999923706055,56.33000183105469,63.130001068115234,211.57000732421875,121.12999725341797,81.9000015258789,105.3499984741211,180.39999389648438\n2015-06-02,41.119998931884766,29.280000686645508,112.05000305175781,52.31999969482422,66.7699966430664,105.54000091552734,27.25,38.41999816894531,50.790000915527344,78.7300033569336,20.032493591308594,116.68000030517578,43.400001525878906,43.970001220703125,45.810001373291016,49.310001373291016,56.83000183105469,62.900001525878906,211.36000061035156,119.44000244140625,81.66999816894531,105.30000305175781,180.14999389648438\n2015-06-03,40.90999984741211,29.739999771118164,111.36000061035156,52.52000045776367,67.13999938964844,104.63999938964844,27.610000610351562,38.439998626708984,50.84000015258789,78.19000244140625,20.203086853027344,115.93000030517578,43.4900016784668,43.31999969482422,45.86000061035156,49.650001525878906,57.279998779296875,63.06999969482422,211.9199981689453,117.5199966430664,81.30999755859375,105.2300033569336,180.8800048828125\n2015-06-04,40.290000915527344,29.360000610351562,111.66999816894531,52.15999984741211,66.41999816894531,105.1500015258789,27.15999984741211,38.060001373291016,50.2400016784668,77.12999725341797,20.024370193481445,116.52999877929688,43.09000015258789,43.2599983215332,44.91999816894531,49.34000015258789,56.56999969482422,62.41999816894531,210.1300048828125,119.05000305175781,81.51000213623047,105.23999786376953,179.2100067138672\n2015-06-05,40.11000061035156,28.81999969482422,111.36000061035156,51.84000015258789,65.62999725341797,104.38999938964844,26.700000762939453,37.720001220703125,50.0099983215332,77.66999816894531,20.138099670410156,115.94000244140625,42.95000076293945,42.720001220703125,44.59000015258789,48.959999084472656,55.790000915527344,62.02000045776367,209.77000427246094,117.5999984741211,81.19000244140625,105.1500015258789,178.5\n2015-06-08,40.11000061035156,28.790000915527344,111.51000213623047,51.560001373291016,65.54000091552734,104.54000091552734,26.670000076293945,37.65999984741211,49.83000183105469,77.2300033569336,20.016246795654297,115.86000061035156,42.470001220703125,42.470001220703125,44.59000015258789,49.40999984741211,55.7599983215332,61.7400016784668,208.47999572753906,117.47000122070312,81.29000091552734,105.2300033569336,177.80999755859375\n2015-06-09,39.86000061035156,28.639999389648438,111.26000213623047,51.040000915527344,65.18000030517578,104.19999694824219,26.6299991607666,37.459999084472656,49.86000061035156,77.22000122070312,20.064987182617188,115.33999633789062,42.369998931884766,42.369998931884766,44.369998931884766,48.72999954223633,55.54999923706055,61.310001373291016,208.4499969482422,116.54000091552734,81.05000305175781,105.12999725341797,177.7100067138672\n2015-06-10,40.41999816894531,29.559999465942383,110.86000061035156,51.880001068115234,66.55000305175781,103.80000305175781,27.260000228881836,38.400001525878906,50.380001068115234,78.13999938964844,20.34930992126465,115.02999877929688,43.029998779296875,42.58000183105469,44.970001220703125,48.27000045776367,56.91999816894531,62.16999816894531,210.9499969482422,115.5199966430664,80.87999725341797,105.06999969482422,180.05999755859375\n2015-06-11,40.27000045776367,29.549999237060547,111.41000366210938,52.119998931884766,66.7300033569336,104.62000274658203,27.3700008392334,38.47999954223633,50.52000045776367,77.81999969482422,20.430543899536133,116.05000305175781,43.04999923706055,42.91999816894531,45.25,48.689998626708984,57.0099983215332,62.439998626708984,211.6300048828125,117.94999694824219,81.26000213623047,105.16000366210938,180.63999938964844\n2015-06-12,40.2400016784668,29.200000762939453,111.47000122070312,51.84000015258789,66.19999694824219,104.55999755859375,26.969999313354492,38.2599983215332,50.20000076293945,76.97000122070312,20.3411865234375,115.8499984741211,42.66999816894531,42.540000915527344,45.099998474121094,49.099998474121094,56.45000076293945,62.11000061035156,210.00999450683594,117.97000122070312,81.19999694824219,105.1500015258789,179.1300048828125\n2015-06-15,39.79999923706055,28.799999237060547,111.83000183105469,52.0,65.80000305175781,104.80999755859375,26.6299991607666,38.040000915527344,49.88999938964844,76.76000213623047,20.251827239990234,115.83000183105469,42.40999984741211,42.470001220703125,45.0099983215332,47.61000061035156,55.86000061035156,62.119998931884766,209.11000061035156,118.13999938964844,81.20999908447266,105.12999725341797,178.10000610351562\n2015-06-16,39.79999923706055,28.799999237060547,112.48999786376953,51.7599983215332,65.77999877929688,105.20999908447266,26.6200008392334,38.060001373291016,50.150001525878906,77.37000274658203,20.365556716918945,116.12000274658203,42.689998626708984,42.66999816894531,45.25,46.9900016784668,55.900001525878906,62.0,210.25,119.05999755859375,81.41999816894531,105.16999816894531,179.2100067138672\n2015-06-17,40.040000915527344,28.690000534057617,112.62000274658203,51.31999969482422,65.63999938964844,105.2699966430664,26.459999084472656,38.29999923706055,50.36000061035156,77.18000030517578,20.3411865234375,116.11000061035156,42.709999084472656,43.029998779296875,45.4900016784668,47.130001068115234,55.84000015258789,61.79999923706055,210.58999633789062,118.1500015258789,81.44999694824219,105.16000366210938,179.47999572753906\n2015-06-18,40.41999816894531,29.280000686645508,112.37000274658203,51.36000061035156,66.22000122070312,105.19000244140625,26.739999771118164,38.68000030517578,50.779998779296875,77.12999725341797,20.528026580810547,115.9000015258789,43.09000015258789,43.599998474121094,45.619998931884766,47.220001220703125,56.540000915527344,62.0099983215332,212.77999877929688,117.5999984741211,81.38999938964844,105.23999786376953,181.3300018310547\n2015-06-19,40.060001373291016,28.979999542236328,112.61000061035156,51.400001525878906,66.05000305175781,105.75,26.670000076293945,38.47999954223633,50.2400016784668,75.9000015258789,20.09748077392578,116.5199966430664,42.540000915527344,42.790000915527344,45.63999938964844,46.790000915527344,56.290000915527344,62.06999969482422,210.80999755859375,119.08000183105469,81.62000274658203,105.2699966430664,179.75999450683594\n2015-06-22,40.61000061035156,29.969999313354492,112.11000061035156,52.20000076293945,67.33999633789062,104.86000061035156,27.6299991607666,38.91999816894531,50.400001525878906,76.86000061035156,20.406173706054688,115.5999984741211,42.88999938964844,42.72999954223633,45.79999923706055,47.400001525878906,57.599998474121094,62.84000015258789,211.88999938964844,116.6500015258789,81.2300033569336,105.22000122070312,180.9199981689453\n2015-06-23,41.04999923706055,29.899999618530273,111.86000061035156,52.79999923706055,67.48999786376953,104.54000091552734,27.610000610351562,38.939998626708984,50.2599983215332,77.0999984741211,20.44679069519043,115.33999633789062,42.91999816894531,42.150001525878906,46.18000030517578,48.5,57.52000045776367,63.349998474121094,212.0399932861328,115.94999694824219,81.04000091552734,105.16000366210938,181.1199951171875\n2015-06-24,40.75,29.559999465942383,112.05999755859375,52.279998779296875,66.9000015258789,104.8499984741211,27.43000030517578,38.7599983215332,49.619998931884766,76.61000061035156,20.27619743347168,115.66000366210938,42.720001220703125,41.81999969482422,45.90999984741211,48.36000061035156,57.060001373291016,62.83000183105469,210.5,116.94999694824219,81.19000244140625,105.2300033569336,179.41000366210938\n2015-06-25,40.29999923706055,29.170000076293945,111.94000244140625,52.08000183105469,65.7699966430664,104.58999633789062,26.989999771118164,38.040000915527344,49.58000183105469,75.83999633789062,20.154346466064453,115.47000122070312,42.619998931884766,41.540000915527344,44.75,47.560001373291016,57.029998779296875,62.83000183105469,209.86000061035156,116.54000091552734,81.08000183105469,105.12999725341797,178.64999389648438\n2015-06-26,39.959999084472656,29.290000915527344,111.44000244140625,52.31999969482422,65.73999786376953,104.08999633789062,27.1200008392334,37.79999923706055,49.38999938964844,76.0199966430664,20.21933364868164,114.94000244140625,42.2599983215332,41.790000915527344,44.06999969482422,46.2400016784668,56.27000045776367,62.119998931884766,209.82000732421875,115.2300033569336,80.93000030517578,105.16999816894531,179.1300048828125\n2015-06-29,39.040000915527344,28.110000610351562,112.26000213623047,51.0,63.68000030517578,105.30000305175781,26.049999237060547,36.70000076293945,48.2400016784668,74.62000274658203,19.73192596435547,115.94000244140625,41.36000061035156,41.56999969482422,42.959999084472656,45.0099983215332,54.29999923706055,60.66999816894531,205.4199981689453,118.20999908447266,81.33999633789062,105.30000305175781,175.63999938964844\n2015-06-30,39.619998931884766,27.8799991607666,112.05000305175781,51.2400016784668,63.4900016784668,105.01000213623047,25.729999542236328,36.5,48.38999938964844,75.16000366210938,19.805036544799805,115.72000122070312,41.400001525878906,41.459999084472656,43.400001525878906,46.099998474121094,53.97999954223633,61.029998779296875,205.85000610351562,117.52999877929688,81.26000213623047,105.33000183105469,175.82000732421875\n2015-07-01,39.619998931884766,28.1200008392334,111.63999938964844,51.599998474121094,63.900001525878906,104.30000305175781,25.920000076293945,36.58000183105469,48.650001525878906,74.19999694824219,20.105606079101562,115.0199966430664,41.68000030517578,41.709999084472656,43.709999084472656,45.72999954223633,54.2400016784668,61.52000045776367,207.5,115.62000274658203,80.9000015258789,105.16000366210938,177.39999389648438\n2015-07-02,39.779998779296875,28.030000686645508,112.12999725341797,51.599998474121094,63.97999954223633,104.66999816894531,25.790000915527344,36.7599983215332,48.5099983215332,74.47000122070312,20.016246795654297,115.45999908447266,41.7400016784668,42.22999954223633,44.0,45.810001373291016,54.27000045776367,61.65999984741211,207.30999755859375,116.06999969482422,81.0999984741211,105.30000305175781,177.0500030517578\n2015-07-06,38.66999816894531,27.34000015258789,112.56999969482422,51.2400016784668,62.689998626708984,105.41000366210938,24.950000762939453,36.20000076293945,48.11000061035156,73.54000091552734,19.935012817382812,115.91999816894531,41.56999969482422,42.400001525878906,42.810001373291016,43.84000015258789,53.0099983215332,60.779998779296875,206.72000122070312,118.1500015258789,81.37999725341797,105.31999969482422,176.67999267578125\n2015-07-07,38.099998474121094,27.43000030517578,112.94000244140625,51.36000061035156,62.709999084472656,105.69000244140625,24.989999771118164,35.900001525878906,47.95000076293945,74.22000122070312,19.975629806518555,116.4000015258789,41.630001068115234,43.45000076293945,42.68000030517578,41.959999084472656,52.959999084472656,60.7599983215332,208.02000427246094,119.26000213623047,81.45999908447266,105.36000061035156,177.6300048828125\n2015-07-08,36.7599983215332,27.010000228881836,113.08000183105469,49.2400016784668,61.25,106.11000061035156,24.579999923706055,35.2599983215332,46.900001525878906,72.72000122070312,19.626319885253906,116.55999755859375,40.95000076293945,43.220001220703125,41.31999969482422,38.95000076293945,52.189998626708984,58.540000915527344,204.52999877929688,120.29000091552734,81.69000244140625,105.30000305175781,175.0\n2015-07-09,37.4900016784668,27.540000915527344,112.3499984741211,49.84000015258789,62.22999954223633,105.37000274658203,25.06999969482422,35.779998779296875,47.029998779296875,73.11000061035156,19.78066635131836,115.79000091552734,40.790000915527344,42.7400016784668,42.0,40.900001525878906,53.09000015258789,59.20000076293945,204.89999389648438,117.91999816894531,81.41999816894531,105.2699966430664,175.25999450683594\n2015-07-10,38.439998626708984,28.889999389648438,111.81999969482422,50.599998474121094,64.30000305175781,104.63999938964844,26.40999984741211,36.84000015258789,47.70000076293945,73.45999908447266,20.016246795654297,115.05000305175781,41.439998626708984,42.970001220703125,42.65999984741211,42.7599983215332,55.33000183105469,60.130001068115234,207.47999572753906,116.05000305175781,81.04000091552734,105.16999816894531,177.41000366210938\n2015-07-13,38.709999084472656,28.790000915527344,111.43000030517578,51.31999969482422,64.55999755859375,104.36000061035156,26.3700008392334,37.060001373291016,48.220001220703125,73.9800033569336,20.259950637817383,114.80000305175781,42.06999969482422,42.9900016784668,42.880001068115234,42.90999984741211,55.349998474121094,60.70000076293945,209.77000427246094,115.69000244140625,80.8499984741211,105.0999984741211,179.60000610351562\n2015-07-14,38.779998779296875,28.8799991607666,111.61000061035156,51.68000030517578,65.08000183105469,104.69000244140625,26.579999923706055,37.5,48.4900016784668,74.54000091552734,20.308692932128906,114.9000015258789,42.22999954223633,42.93000030517578,43.15999984741211,42.720001220703125,55.81999969482422,61.029998779296875,210.67999267578125,116.06999969482422,81.0,105.13999938964844,180.3300018310547\n2015-07-15,38.349998474121094,28.770000457763672,111.91999816894531,51.599998474121094,64.83999633789062,105.08999633789062,26.450000762939453,37.41999816894531,48.11000061035156,73.2300033569336,20.479284286499023,115.19999694824219,42.2400016784668,43.13999938964844,43.0099983215332,41.72999954223633,55.560001373291016,60.83000183105469,210.61000061035156,117.29000091552734,81.2300033569336,105.16999816894531,180.33999633789062\n2015-07-16,38.810001373291016,29.0,112.05999755859375,51.79999923706055,65.4000015258789,105.05000305175781,26.729999542236328,37.63999938964844,47.9900016784668,73.33000183105469,20.682371139526367,115.37999725341797,42.779998779296875,43.779998779296875,43.43000030517578,42.540000915527344,56.04999923706055,61.25,212.3000030517578,118.11000061035156,81.2300033569336,105.18000030517578,181.07000732421875\n2015-07-17,38.7599983215332,28.860000610351562,111.98999786376953,51.91999816894531,65.30999755859375,105.05999755859375,26.65999984741211,37.560001373291016,47.65999984741211,72.44000244140625,20.625507354736328,115.45999908447266,43.439998626708984,43.349998474121094,43.41999816894531,42.84000015258789,55.88999938964844,61.31999969482422,212.47999572753906,118.72000122070312,81.23999786376953,105.1500015258789,180.5399932861328\n2015-07-20,38.5099983215332,29.0,111.72000122070312,51.91999816894531,65.47000122070312,104.8499984741211,26.739999771118164,37.58000183105469,47.2599983215332,71.4800033569336,20.649877548217773,115.19000244140625,43.66999816894531,43.130001068115234,43.540000915527344,42.56999969482422,56.040000915527344,61.349998474121094,212.58999633789062,118.22000122070312,81.12999725341797,105.08000183105469,180.69000244140625\n2015-07-21,38.52000045776367,28.889999389648438,111.9800033569336,51.7599983215332,65.2699966430664,105.13999938964844,26.780000686645508,37.34000015258789,46.970001220703125,71.51000213623047,20.625507354736328,115.43000030517578,43.380001068115234,42.7400016784668,43.59000015258789,42.75,55.849998474121094,61.2400016784668,211.75,118.86000061035156,81.27999877929688,105.08999633789062,178.97000122070312\n2015-07-22,37.970001220703125,28.690000534057617,112.02999877929688,51.52000045776367,64.7699966430664,105.2699966430664,26.65999984741211,37.040000915527344,46.7599983215332,70.93000030517578,20.77985382080078,115.58000183105469,42.68000030517578,42.93000030517578,42.95000076293945,42.310001373291016,55.45000076293945,60.779998779296875,211.3699951171875,119.5999984741211,81.30999755859375,105.05000305175781,178.3000030517578\n2015-07-23,37.599998474121094,28.65999984741211,112.22000122070312,51.47999954223633,64.5999984741211,105.69999694824219,26.690000534057617,36.560001373291016,46.09000015258789,70.87000274658203,20.601137161254883,115.91999816894531,42.59000015258789,42.290000915527344,42.65999984741211,42.29999923706055,55.27000045776367,60.63999938964844,210.17999267578125,121.08999633789062,81.5,105.06999969482422,177.16000366210938\n2015-07-24,37.060001373291016,28.25,112.0999984741211,51.0,63.88999938964844,105.80000305175781,26.510000228881836,36.060001373291016,45.08000183105469,69.52999877929688,20.406173706054688,115.87000274658203,42.36000061035156,42.33000183105469,42.13999938964844,41.72999954223633,54.650001525878906,59.970001220703125,208.0,121.38999938964844,81.55000305175781,105.0999984741211,175.52000427246094\n2015-07-27,36.380001068115234,27.93000030517578,112.33000183105469,50.79999923706055,63.41999816894531,106.1500015258789,26.219999313354492,35.900001525878906,44.58000183105469,68.51000213623047,20.259950637817383,115.87999725341797,41.97999954223633,42.869998931884766,41.83000183105469,40.130001068115234,54.22999954223633,59.630001068115234,206.7899932861328,122.04000091552734,81.70999908447266,105.12000274658203,174.22999572753906\n2015-07-28,36.72999954223633,28.239999771118164,112.05999755859375,51.040000915527344,64.22000122070312,105.8499984741211,26.510000228881836,36.47999954223633,45.5099983215332,70.47000122070312,20.3411865234375,115.79000091552734,42.36000061035156,43.06999969482422,42.619998931884766,40.790000915527344,54.95000076293945,60.209999084472656,209.3300018310547,121.1500015258789,81.56999969482422,105.08999633789062,176.11000061035156\n2015-07-29,37.09000015258789,28.219999313354492,112.05000305175781,51.2400016784668,64.44999694824219,105.69999694824219,26.540000915527344,36.7599983215332,45.84000015258789,71.43000030517578,20.544273376464844,115.69000244140625,42.63999938964844,43.22999954223633,42.83000183105469,41.279998779296875,55.099998474121094,60.52000045776367,210.77000427246094,120.73999786376953,81.5,105.13999938964844,177.25999450683594\n2015-07-30,36.720001220703125,28.059999465942383,112.20999908447266,51.31999969482422,64.4000015258789,105.81999969482422,26.5,36.97999954223633,46.060001373291016,70.93000030517578,20.544273376464844,115.75,42.720001220703125,43.54999923706055,42.65999984741211,40.650001525878906,55.060001373291016,60.36000061035156,210.82000732421875,121.62999725341797,81.52999877929688,105.08999633789062,177.22000122070312\n2015-07-31,37.119998931884766,28.329999923706055,112.6500015258789,51.720001220703125,64.77999877929688,106.44000244140625,26.780000686645508,37.08000183105469,45.95000076293945,69.37999725341797,20.479284286499023,116.3499984741211,42.58000183105469,43.9900016784668,42.81999969482422,40.47999954223633,55.41999816894531,60.70000076293945,210.5,122.52999877929688,81.80999755859375,105.19000244140625,176.67999267578125\n2015-08-03,36.4900016784668,28.530000686645508,112.55000305175781,51.52000045776367,64.61000061035156,106.5999984741211,26.850000381469727,36.86000061035156,45.59000015258789,67.91999816894531,20.454914093017578,116.29000091552734,42.349998474121094,44.220001220703125,42.36000061035156,39.88999938964844,55.43000030517578,60.22999954223633,209.7899932861328,123.55000305175781,81.83000183105469,105.05999755859375,175.75\n2015-08-04,36.650001525878906,28.520000457763672,111.91999816894531,51.439998626708984,64.66000366210938,106.05000305175781,26.770000457763672,37.02000045776367,45.790000915527344,67.69000244140625,20.422420501708984,115.69999694824219,42.099998474121094,43.5099983215332,42.869998931884766,40.16999816894531,55.310001373291016,60.459999084472656,209.3800048828125,122.56999969482422,81.55000305175781,104.98999786376953,175.32000732421875\n2015-08-05,36.63999938964844,28.84000015258789,111.56999969482422,51.7599983215332,65.0,105.63999938964844,27.06999969482422,37.279998779296875,46.02000045776367,67.18000030517578,20.5036563873291,115.25,42.5099983215332,43.619998931884766,42.790000915527344,40.439998626708984,55.70000076293945,60.709999084472656,210.07000732421875,121.6500015258789,81.38999938964844,104.97000122070312,175.36000061035156\n2015-08-06,36.31999969482422,28.850000381469727,111.7699966430664,51.599998474121094,64.7300033569336,106.01000213623047,27.170000076293945,37.18000030517578,45.86000061035156,68.27999877929688,20.430543899536133,115.47000122070312,42.09000015258789,43.849998474121094,41.9900016784668,40.11000061035156,55.599998474121094,60.209999084472656,208.35000610351562,122.7300033569336,81.47000122070312,104.93000030517578,174.22000122070312\n2015-08-07,36.29999923706055,28.760000228881836,112.08000183105469,51.7599983215332,64.61000061035156,106.43000030517578,27.139999389648438,37.08000183105469,45.220001220703125,66.98999786376953,20.471160888671875,115.87000274658203,42.119998931884766,44.38999938964844,41.869998931884766,40.529998779296875,55.400001525878906,60.36000061035156,207.9499969482422,124.33999633789062,81.63999938964844,104.88999938964844,173.83999633789062\n2015-08-10,36.93000030517578,29.139999389648438,111.91999816894531,52.52000045776367,65.43000030517578,105.98999786376953,27.440000534057617,37.36000061035156,46.33000183105469,69.18000030517578,20.66612434387207,115.41000366210938,42.779998779296875,44.209999084472656,42.400001525878906,41.439998626708984,56.02000045776367,61.13999938964844,210.57000732421875,122.80000305175781,81.47000122070312,104.94999694824219,176.19000244140625\n2015-08-11,36.099998474121094,28.479999542236328,112.37999725341797,51.599998474121094,64.38999938964844,106.69000244140625,27.06999969482422,36.91999816894531,45.470001220703125,69.30000305175781,20.479284286499023,115.88999938964844,42.13999938964844,44.43000030517578,41.13999938964844,40.88999938964844,55.290000915527344,59.83000183105469,208.6699981689453,124.75,81.77999877929688,105.04000091552734,174.11000061035156\n2015-08-12,35.540000915527344,28.18000030517578,112.12000274658203,51.279998779296875,63.939998626708984,106.6500015258789,26.760000228881836,36.779998779296875,45.63999938964844,70.55999755859375,20.292444229125977,115.70999908447266,42.33000183105469,45.220001220703125,40.779998779296875,40.0099983215332,54.95000076293945,59.43000030517578,208.9199981689453,124.06999969482422,81.75,105.08000183105469,174.2100067138672\n2015-08-13,35.5,28.010000228881836,111.81999969482422,51.68000030517578,63.900001525878906,106.37000274658203,26.65999984741211,36.599998474121094,45.5099983215332,69.48999786376953,20.365556716918945,115.30999755859375,42.209999084472656,45.22999954223633,40.72999954223633,40.310001373291016,54.790000915527344,59.65999984741211,208.66000366210938,123.66999816894531,81.58000183105469,104.94999694824219,174.30999755859375\n2015-08-14,35.529998779296875,28.06999969482422,111.69999694824219,51.68000030517578,64.0,106.26000213623047,26.6200008392334,36.7599983215332,45.720001220703125,69.33999633789062,20.51177978515625,115.41999816894531,42.41999816894531,45.56999969482422,40.779998779296875,40.43000030517578,54.90999984741211,59.72999954223633,209.4199981689453,123.95999908447266,81.55000305175781,105.01000213623047,174.89999389648438\n2015-08-17,35.13999938964844,27.809999465942383,111.69000244140625,51.79999923706055,63.880001068115234,106.44999694824219,26.6200008392334,36.540000915527344,45.97999954223633,69.4800033569336,20.552396774291992,115.79000091552734,42.65999984741211,45.790000915527344,40.720001220703125,40.16999816894531,54.689998626708984,59.65999984741211,210.58999633789062,124.5199966430664,81.69999694824219,105.0199966430664,175.6999969482422\n2015-08-18,34.779998779296875,27.5,111.41999816894531,51.439998626708984,63.38999938964844,106.27999877929688,26.350000381469727,36.439998626708984,45.68000030517578,69.2300033569336,20.536149978637695,115.3499984741211,42.439998626708984,45.68000030517578,40.20000076293945,39.33000183105469,54.400001525878906,59.119998931884766,209.97999572753906,123.54000091552734,81.55000305175781,105.04000091552734,175.3300018310547\n2015-08-19,34.31999969482422,27.209999084472656,111.80000305175781,50.880001068115234,62.84000015258789,106.93000030517578,26.190000534057617,35.86000061035156,45.099998474121094,67.31999969482422,20.34930992126465,115.91000366210938,42.15999984741211,45.869998931884766,40.13999938964844,38.45000076293945,53.86000061035156,58.75,208.32000732421875,124.72000122070312,81.83999633789062,105.1500015258789,173.74000549316406\n2015-08-20,33.75,26.459999084472656,112.11000061035156,49.36000061035156,61.31999969482422,107.22000122070312,25.540000915527344,35.34000015258789,44.27000045776367,65.80000305175781,19.918766021728516,115.9800033569336,41.130001068115234,45.599998474121094,39.11000061035156,37.5,52.68000030517578,57.08000183105469,203.97000122070312,126.0199966430664,81.91000366210938,105.12000274658203,170.22000122070312\n2015-08-21,32.7599983215332,26.010000228881836,112.1500015258789,47.68000030517578,59.86000061035156,107.6500015258789,25.139999389648438,34.36000061035156,43.209999084472656,63.459999084472656,19.203899383544922,116.01000213623047,39.560001373291016,45.04999923706055,38.20000076293945,36.560001373291016,51.529998779296875,55.40999984741211,197.8300018310547,126.38999938964844,82.04000091552734,105.11000061035156,164.41000366210938\n2015-08-24,31.309999465942383,25.6299991607666,111.76000213623047,45.91999816894531,57.849998474121094,107.83000183105469,24.3799991607666,33.08000183105469,41.310001373291016,60.130001068115234,18.3834285736084,115.69000244140625,38.0,43.36000061035156,35.52000045776367,34.18000030517578,50.06999969482422,52.93000030517578,189.5,126.33999633789062,82.0199966430664,104.93000030517578,158.3800048828125\n2015-08-25,31.739999771118164,25.809999465942383,111.48999786376953,46.279998779296875,58.400001525878906,107.23999786376953,24.5,33.20000076293945,40.72999954223633,59.220001220703125,18.139724731445312,115.0999984741211,37.70000076293945,42.029998779296875,37.279998779296875,35.0099983215332,50.459999084472656,53.88999938964844,187.27000427246094,124.33000183105469,81.75,104.95999908447266,156.49000549316406\n2015-08-26,32.77000045776367,26.479999542236328,110.81999969482422,48.119998931884766,59.79999923706055,106.58000183105469,25.020000457763672,33.599998474121094,41.869998931884766,61.29999923706055,18.82209587097168,115.02999877929688,39.599998474121094,42.779998779296875,38.20000076293945,35.790000915527344,51.380001068115234,55.880001068115234,194.4600067138672,121.9000015258789,81.4000015258789,105.0199966430664,162.66000366210938\n2015-08-27,34.220001220703125,26.639999389648438,111.36000061035156,49.0,60.5099983215332,106.5199966430664,25.260000228881836,34.13999938964844,43.349998474121094,64.30000305175781,19.285133361816406,115.13999938964844,40.52000045776367,43.279998779296875,38.95000076293945,37.470001220703125,51.90999984741211,56.95000076293945,199.27000427246094,122.0,81.51000213623047,105.19999694824219,166.4499969482422\n2015-08-28,33.790000915527344,26.360000610351562,111.68000030517578,49.2400016784668,60.41999816894531,106.54000091552734,25.059999465942383,34.29999923706055,43.599998474121094,65.73999786376953,19.195775985717773,115.3499984741211,40.599998474121094,43.150001525878906,38.63999938964844,36.36000061035156,51.720001220703125,57.029998779296875,199.27999877929688,122.36000061035156,81.55000305175781,105.12999725341797,166.3300018310547\n2015-08-31,33.79999923706055,26.34000015258789,111.58000183105469,48.47999954223633,59.970001220703125,106.36000061035156,25.020000457763672,34.119998931884766,43.380001068115234,66.4800033569336,19.033306121826172,115.05999755859375,40.22999954223633,42.459999084472656,37.83000183105469,35.90999984741211,51.529998779296875,56.040000915527344,197.6699981689453,121.41999816894531,81.44000244140625,105.06999969482422,165.17999267578125\n2015-09-01,32.529998779296875,25.690000534057617,111.06999969482422,46.279998779296875,57.959999084472656,106.66999816894531,24.420000076293945,32.84000015258789,42.040000915527344,64.08999633789062,18.415922164916992,115.41999816894531,38.939998626708984,41.310001373291016,36.400001525878906,34.279998779296875,50.099998474121094,53.810001373291016,191.77000427246094,122.02999877929688,81.47000122070312,105.05999755859375,160.4600067138672\n2015-09-02,33.0,26.049999237060547,110.72000122070312,47.119998931884766,58.81999969482422,106.37999725341797,24.75,33.459999084472656,42.63999938964844,64.68000030517578,18.667749404907227,115.25,39.880001068115234,41.34000015258789,37.029998779296875,34.66999816894531,50.81999969482422,54.72999954223633,195.41000366210938,120.9800033569336,81.41000366210938,105.05000305175781,163.4600067138672\n2015-09-03,33.130001068115234,26.1299991607666,110.7300033569336,47.47999954223633,58.939998626708984,106.63999938964844,24.729999542236328,33.47999954223633,42.900001525878906,64.87999725341797,18.77335548400879,115.80000305175781,39.90999984741211,41.529998779296875,36.77000045776367,34.869998931884766,50.849998474121094,54.79999923706055,195.5500030517578,121.51000213623047,81.47000122070312,105.08999633789062,163.6699981689453\n2015-09-04,32.13999938964844,25.579999923706055,110.91000366210938,45.959999084472656,57.61000061035156,106.97000122070312,24.190000534057617,32.70000076293945,42.04999923706055,63.790000915527344,18.399675369262695,116.05999755859375,39.29999923706055,40.959999084472656,36.0,33.58000183105469,49.86000061035156,53.279998779296875,192.58999633789062,122.68000030517578,81.66999816894531,105.08999633789062,160.97000122070312\n2015-09-08,33.18000030517578,26.5,110.41000366210938,47.040000915527344,59.29999923706055,106.5,24.860000610351562,33.86000061035156,43.099998474121094,64.7699966430664,18.87083625793457,115.5199966430664,40.400001525878906,41.83000183105469,37.63999938964844,35.970001220703125,51.31999969482422,54.81999969482422,197.42999267578125,120.87000274658203,81.47000122070312,105.0,164.91000366210938\n2015-09-09,32.9900016784668,26.1200008392334,110.66000366210938,46.959999084472656,59.060001373291016,106.54000091552734,24.739999771118164,33.70000076293945,42.77000045776367,63.599998474121094,18.610885620117188,115.7699966430664,39.869998931884766,41.310001373291016,37.68000030517578,35.9900016784668,51.02000045776367,54.97999954223633,194.7899932861328,121.44999694824219,81.44999694824219,104.94000244140625,162.52000427246094\n2015-09-10,33.33000183105469,26.479999542236328,110.69000244140625,46.91999816894531,59.45000076293945,106.30000305175781,25.030000686645508,34.0,42.869998931884766,63.939998626708984,18.70024299621582,115.54000091552734,40.27000045776367,41.2400016784668,37.70000076293945,36.060001373291016,51.529998779296875,55.040000915527344,195.85000610351562,120.62999725341797,81.27999877929688,104.94999694824219,163.38999938964844\n2015-09-11,33.459999084472656,26.479999542236328,111.0,46.959999084472656,59.439998626708984,106.58000183105469,24.950000762939453,33.900001525878906,42.810001373291016,63.369998931884766,18.781478881835938,115.62000274658203,40.459999084472656,41.54999923706055,37.68000030517578,36.33000183105469,51.459999084472656,55.09000015258789,196.74000549316406,121.38999938964844,81.44999694824219,105.0199966430664,164.38999938964844\n2015-09-14,33.439998626708984,26.350000381469727,110.79000091552734,46.84000015258789,58.9900016784668,106.68000030517578,24.649999618530273,33.52000045776367,42.29999923706055,62.81999969482422,18.740861892700195,115.61000061035156,40.36000061035156,41.650001525878906,37.709999084472656,35.970001220703125,50.90999984741211,54.90999984741211,196.00999450683594,121.58000183105469,81.47000122070312,104.94999694824219,163.77000427246094\n2015-09-15,33.72999954223633,26.469999313354492,110.04000091552734,47.20000076293945,59.38999938964844,105.83999633789062,24.84000015258789,33.779998779296875,42.61000061035156,63.52000045776367,19.008935928344727,114.73999786376953,40.880001068115234,41.869998931884766,37.7400016784668,36.45000076293945,51.279998779296875,55.369998931884766,198.4600067138672,119.25,81.12999725341797,104.81999969482422,166.11000061035156\n2015-09-16,34.54999923706055,26.56999969482422,110.01000213623047,47.599998474121094,60.29999923706055,105.80999755859375,25.18000030517578,34.560001373291016,43.220001220703125,65.31999969482422,19.130788803100586,114.94999694824219,41.04999923706055,42.290000915527344,38.66999816894531,37.540000915527344,52.04999923706055,56.22999954223633,200.17999267578125,118.80000305175781,81.08000183105469,104.81999969482422,167.50999450683594\n2015-09-17,34.529998779296875,26.739999771118164,110.87000274658203,47.560001373291016,60.33000183105469,106.69000244140625,25.469999313354492,34.36000061035156,43.02000045776367,65.27999877929688,18.862712860107422,115.9000015258789,40.77000045776367,42.869998931884766,38.27000045776367,37.11000061035156,52.2400016784668,55.959999084472656,199.72999572753906,120.25,81.54000091552734,105.08000183105469,166.80999755859375\n2015-09-18,33.83000183105469,25.760000228881836,111.22000122070312,46.040000915527344,58.81999969482422,107.19000244140625,24.639999389648438,33.7599983215332,41.880001068115234,63.060001373291016,18.407798767089844,116.25,40.060001373291016,42.22999954223633,38.060001373291016,36.31999969482422,50.91999816894531,54.779998779296875,195.4499969482422,122.0999984741211,81.7699966430664,105.0999984741211,163.5399932861328\n2015-09-21,33.77000045776367,25.56999969482422,110.5199966430664,46.31999969482422,58.79999923706055,106.58000183105469,24.6299991607666,33.779998779296875,42.02000045776367,63.459999084472656,18.619009017944336,115.66000366210938,40.459999084472656,42.400001525878906,37.93000030517578,36.810001373291016,50.810001373291016,54.880001068115234,196.4600067138672,120.11000061035156,81.47000122070312,105.08000183105469,164.89999389648438\n2015-09-22,33.119998931884766,24.600000381469727,110.79000091552734,45.63999938964844,57.369998931884766,107.11000061035156,23.899999618530273,32.720001220703125,41.2400016784668,62.790000915527344,18.3834285736084,116.16000366210938,39.779998779296875,41.869998931884766,37.380001068115234,36.16999816894531,49.290000915527344,54.029998779296875,193.91000366210938,121.77999877929688,81.62000274658203,105.0999984741211,163.0\n2015-09-23,32.619998931884766,24.610000610351562,110.70999908447266,45.63999938964844,57.119998931884766,106.98999786376953,23.8799991607666,32.720001220703125,40.369998931884766,61.97999954223633,18.391551971435547,116.08999633789062,39.880001068115234,41.97999954223633,36.77000045776367,35.65999984741211,49.09000015258789,53.7599983215332,193.60000610351562,121.7699966430664,81.63999938964844,105.06999969482422,162.58999633789062\n2015-09-24,32.5,24.559999465942383,110.72000122070312,45.31999969482422,56.95000076293945,107.1500015258789,23.760000228881836,32.7400016784668,40.25,62.25,18.26157569885254,116.11000061035156,39.880001068115234,42.31999969482422,37.02000045776367,35.380001068115234,48.959999084472656,53.58000183105469,192.89999389648438,122.5999984741211,81.6500015258789,105.11000061035156,161.8699951171875\n2015-09-25,32.40999984741211,24.700000762939453,110.12999725341797,46.439998626708984,57.43000030517578,106.87000274658203,24.040000915527344,32.91999816894531,40.20000076293945,62.369998931884766,18.529651641845703,115.76000213623047,39.810001373291016,42.72999954223633,36.81999969482422,35.2599983215332,49.029998779296875,54.06999969482422,192.85000610351562,121.54000091552734,81.5,105.12000274658203,162.8800048828125\n2015-09-28,31.690000534057617,24.329999923706055,110.16000366210938,45.31999969482422,56.310001373291016,107.4800033569336,23.520000457763672,32.060001373291016,38.95000076293945,59.880001068115234,18.099105834960938,115.95999908447266,38.900001525878906,42.52000045776367,36.25,34.61000061035156,48.11000061035156,52.97999954223633,188.00999450683594,123.62000274658203,81.70999908447266,105.08000183105469,159.7899932861328\n2015-09-29,31.860000610351562,24.420000076293945,110.47000122070312,44.7599983215332,56.25,107.8499984741211,23.649999618530273,32.040000915527344,39.099998474121094,59.790000915527344,18.13159942626953,116.11000061035156,38.72999954223633,42.529998779296875,35.91999816894531,34.59000015258789,48.2599983215332,52.5,188.1199951171875,123.97000122070312,81.7699966430664,105.11000061035156,160.22999572753906\n2015-09-30,32.779998779296875,24.739999771118164,110.69000244140625,45.68000030517578,57.31999969482422,107.87000274658203,24.06999969482422,32.779998779296875,39.95000076293945,61.209999084472656,18.407798767089844,116.08999633789062,39.5,43.290000915527344,36.65999984741211,35.459999084472656,49.18000030517578,53.689998626708984,191.6300048828125,123.54000091552734,81.93000030517578,105.12999725341797,162.6199951171875\n2015-10-01,32.959999084472656,24.530000686645508,111.02999877929688,46.040000915527344,57.5,107.79000091552734,24.059999465942383,32.900001525878906,40.369998931884766,61.31999969482422,18.415922164916992,115.7300033569336,39.52000045776367,42.779998779296875,36.88999938964844,35.709999084472656,49.16999816894531,54.06999969482422,192.1300048828125,123.80999755859375,81.80999755859375,105.06999969482422,162.49000549316406\n2015-10-02,33.84000015258789,24.860000610351562,111.66999816894531,46.599998474121094,58.47999954223633,108.30999755859375,24.489999771118164,33.779998779296875,41.36000061035156,63.849998474121094,18.440292358398438,116.23999786376953,40.08000183105469,43.349998474121094,37.43000030517578,37.0099983215332,50.099998474121094,54.720001220703125,195.0,124.55999755859375,82.12000274658203,105.16999816894531,164.5800018310547\n2015-10-05,34.56999969482422,25.290000915527344,111.33000183105469,47.7599983215332,59.63999938964844,107.70999908447266,25.049999237060547,34.31999969482422,42.439998626708984,65.77999877929688,18.830219268798828,115.93000030517578,40.869998931884766,43.90999984741211,38.34000015258789,37.66999816894531,50.97999954223633,56.02000045776367,198.47000122070312,122.87000274658203,81.80000305175781,105.12999725341797,167.5800018310547\n2015-10-06,34.5099983215332,25.5,111.6500015258789,47.36000061035156,59.709999084472656,107.93000030517578,25.239999771118164,34.380001068115234,42.9900016784668,67.23999786376953,18.740861892700195,116.16000366210938,40.91999816894531,43.61000061035156,38.33000183105469,37.11000061035156,51.20000076293945,55.7599983215332,197.7899932861328,123.4000015258789,81.91000366210938,105.18000030517578,167.69000244140625\n2015-10-07,35.43000030517578,25.809999465942383,111.62999725341797,48.119998931884766,60.459999084472656,107.66000366210938,25.459999084472656,34.959999084472656,43.560001373291016,68.08999633789062,18.887083053588867,116.56999969482422,41.11000061035156,43.459999084472656,39.04999923706055,38.65999984741211,51.63999938964844,56.70000076293945,199.41000366210938,122.98999786376953,81.91000366210938,105.16999816894531,168.9499969482422\n2015-10-08,35.810001373291016,26.040000915527344,111.58999633789062,48.279998779296875,60.939998626708984,107.37999725341797,25.65999984741211,35.34000015258789,44.16999816894531,69.38999938964844,19.000812530517578,116.11000061035156,41.29999923706055,44.0,39.56999969482422,38.84000015258789,52.119998931884766,57.060001373291016,201.2100067138672,121.95999908447266,81.77999877929688,105.16000366210938,170.3699951171875\n2015-10-09,35.939998626708984,26.260000228881836,111.27999877929688,48.400001525878906,61.04999923706055,107.44000244140625,25.709999084472656,35.15999984741211,44.150001525878906,68.94000244140625,18.87895965576172,116.16000366210938,41.47999954223633,43.790000915527344,39.779998779296875,38.65999984741211,52.130001068115234,57.189998626708984,201.3300018310547,122.27999877929688,81.7699966430664,105.1500015258789,170.75999450683594\n2015-10-12,35.66999816894531,26.239999771118164,111.4800033569336,48.47999954223633,60.93000030517578,107.80000305175781,25.6299991607666,35.02000045776367,43.77000045776367,68.05000305175781,18.895206451416016,116.62999725341797,41.529998779296875,44.18000030517578,39.77000045776367,38.689998626708984,51.93000030517578,57.209999084472656,201.52000427246094,123.20999908447266,81.91000366210938,105.19000244140625,171.1699981689453\n2015-10-13,35.09000015258789,26.0,111.41999816894531,47.959999084472656,60.15999984741211,107.9000015258789,25.389999389648438,34.400001525878906,43.599998474121094,67.33999633789062,18.748985290527344,116.54000091552734,41.439998626708984,44.08000183105469,39.06999969482422,38.189998626708984,51.34000015258789,56.59000015258789,200.25,123.41999816894531,81.95999908447266,105.25,170.63999938964844\n2015-10-14,35.36000061035156,26.049999237060547,111.80000305175781,47.400001525878906,60.279998779296875,108.48999786376953,25.559999465942383,34.70000076293945,43.95000076293945,67.91999816894531,18.59463882446289,117.0,41.36000061035156,44.06999969482422,39.380001068115234,38.349998474121094,51.650001525878906,56.36000061035156,199.2899932861328,124.5,82.26000213623047,105.3499984741211,169.07000732421875\n2015-10-15,36.220001220703125,26.360000610351562,111.58999633789062,48.599998474121094,61.310001373291016,108.12000274658203,25.81999969482422,35.36000061035156,44.06999969482422,69.13999938964844,19.017059326171875,116.94999694824219,41.88999938964844,44.720001220703125,40.22999954223633,39.619998931884766,52.349998474121094,57.880001068115234,202.35000610351562,123.88999938964844,82.0999984741211,105.37000274658203,171.32000732421875\n2015-10-16,36.25,26.239999771118164,111.29000091552734,48.84000015258789,61.2599983215332,108.02999877929688,25.790000915527344,35.279998779296875,44.09000015258789,69.2300033569336,19.130788803100586,116.98999786376953,41.970001220703125,44.779998779296875,40.189998626708984,39.7599983215332,52.20000076293945,57.880001068115234,203.27000427246094,123.93000030517578,82.06999969482422,105.30999755859375,171.8800048828125\n2015-10-19,35.880001068115234,26.270000457763672,111.0999984741211,48.599998474121094,61.04999923706055,107.9800033569336,25.700000762939453,35.15999984741211,43.779998779296875,67.86000061035156,19.114540100097656,116.9800033569336,42.130001068115234,44.810001373291016,39.81999969482422,39.380001068115234,52.08000183105469,57.560001373291016,203.3699951171875,123.58999633789062,82.06999969482422,105.33999633789062,172.1199951171875\n2015-10-20,35.869998931884766,26.260000228881836,110.97000122070312,48.31999969482422,60.79999923706055,107.61000061035156,25.549999237060547,35.08000183105469,43.849998474121094,68.05000305175781,19.228269577026367,116.76000213623047,42.02000045776367,44.959999084472656,39.65999984741211,39.43000030517578,52.0,57.29999923706055,203.11000061035156,122.83000183105469,81.94000244140625,105.29000091552734,172.00999450683594\n2015-10-21,35.349998474121094,26.329999923706055,111.04000091552734,48.959999084472656,60.77000045776367,107.9800033569336,25.540000915527344,34.86000061035156,43.459999084472656,67.20999908447266,19.09016990661621,117.33999633789062,41.70000076293945,44.869998931884766,39.380001068115234,38.849998474121094,51.72999954223633,57.529998779296875,201.85000610351562,124.05000305175781,82.08999633789062,105.37999725341797,171.47999572753906\n2015-10-22,36.08000183105469,26.75,111.41999816894531,49.560001373291016,61.459999084472656,108.08999633789062,25.799999237060547,35.20000076293945,44.650001525878906,68.41999816894531,19.398862838745117,117.58999633789062,42.63999938964844,45.38999938964844,40.18000030517578,39.70000076293945,52.220001220703125,58.40999984741211,205.25999450683594,124.26000213623047,82.2300033569336,105.41999816894531,174.8000030517578\n2015-10-23,36.290000915527344,27.200000762939453,111.26000213623047,50.040000915527344,62.08000183105469,107.4800033569336,26.200000762939453,35.400001525878906,45.02000045776367,68.26000213623047,19.61007308959961,117.16000366210938,43.83000183105469,44.59000015258789,40.720001220703125,40.369998931884766,52.68000030517578,58.970001220703125,207.50999450683594,123.19999694824219,82.0199966430664,105.33000183105469,176.3699951171875\n2015-10-26,35.959999084472656,27.200000762939453,111.2300033569336,50.0,61.83000183105469,107.76000213623047,26.030000686645508,35.2400016784668,44.650001525878906,66.58999633789062,19.528839111328125,117.37000274658203,43.65999984741211,44.43000030517578,40.470001220703125,39.4900016784668,52.45000076293945,58.75,207.0,124.0199966430664,82.11000061035156,105.38999938964844,176.02000427246094\n2015-10-27,35.56999969482422,26.93000030517578,111.4800033569336,49.599998474121094,61.279998779296875,108.02999877929688,25.799999237060547,34.880001068115234,44.459999084472656,65.79000091552734,19.415109634399414,117.4000015258789,43.40999984741211,44.27000045776367,40.119998931884766,39.18000030517578,51.939998626708984,58.31999969482422,206.60000610351562,124.33000183105469,82.12999725341797,105.37999725341797,175.6699981689453\n2015-10-28,35.13999938964844,27.1299991607666,110.91999816894531,50.08000183105469,61.709999084472656,107.47000122070312,25.899999618530273,35.2400016784668,45.130001068115234,67.25,19.870023727416992,116.94000244140625,44.060001373291016,43.79999923706055,39.900001525878906,38.7599983215332,52.33000183105469,58.560001373291016,208.9499969482422,123.83000183105469,81.9000015258789,105.30999755859375,177.67999267578125\n2015-10-29,34.810001373291016,27.049999237060547,110.62000274658203,49.52000045776367,61.2400016784668,106.80999755859375,25.770000457763672,35.02000045776367,45.220001220703125,67.58999633789062,19.845653533935547,116.12000274658203,43.939998626708984,43.54999923706055,39.09000015258789,38.380001068115234,52.09000015258789,57.81999969482422,208.8300018310547,121.87000274658203,81.61000061035156,105.16999816894531,177.3800048828125\n2015-10-30,34.869998931884766,27.110000610351562,110.95999908447266,49.279998779296875,61.11000061035156,107.0199966430664,25.790000915527344,34.939998626708984,45.279998779296875,68.02999877929688,19.56133270263672,116.41999816894531,43.650001525878906,43.75,39.06999969482422,38.27000045776367,52.08000183105469,57.75,207.92999267578125,122.77999877929688,81.79000091552734,105.26000213623047,176.49000549316406\n2015-11-02,35.560001373291016,27.520000457763672,110.91000366210938,49.63999938964844,61.689998626708984,106.55000305175781,26.15999984741211,35.279998779296875,45.560001373291016,69.62000274658203,19.82940673828125,115.58999633789062,44.040000915527344,43.79999923706055,39.0099983215332,38.59000015258789,52.689998626708984,58.11000061035156,210.38999938964844,121.94999694824219,81.45999908447266,105.1500015258789,178.1199951171875\n2015-11-03,36.029998779296875,27.329999923706055,110.72000122070312,49.599998474121094,61.66999816894531,106.2699966430664,26.049999237060547,35.279998779296875,45.7400016784668,71.4000015258789,19.861900329589844,115.5999984741211,44.27000045776367,43.93000030517578,39.599998474121094,38.630001068115234,52.52000045776367,58.290000915527344,211.0,120.94999694824219,81.31999969482422,105.04000091552734,179.07000732421875\n2015-11-04,35.7400016784668,26.850000381469727,110.56999969482422,49.36000061035156,61.33000183105469,106.16000366210938,25.850000381469727,35.29999923706055,45.470001220703125,70.76000213623047,19.805036544799805,115.47000122070312,44.31999969482422,44.15999984741211,39.47999954223633,39.119998931884766,52.189998626708984,58.02000045776367,210.36000061035156,121.08999633789062,81.37000274658203,104.97000122070312,178.64999389648438\n2015-11-05,35.79999923706055,26.90999984741211,110.22000122070312,49.720001220703125,61.220001220703125,106.08999633789062,26.030000686645508,34.720001220703125,45.209999084472656,70.16000366210938,19.88627052307129,115.5,44.189998626708984,43.779998779296875,39.13999938964844,39.310001373291016,52.0099983215332,58.13999938964844,210.14999389648438,120.7699966430664,81.22000122070312,105.05999755859375,178.63999938964844\n2015-11-06,35.29999923706055,26.920000076293945,109.76000213623047,49.599998474121094,60.939998626708984,105.37000274658203,25.829999923706055,34.34000015258789,45.33000183105469,69.80000305175781,20.089357376098633,114.75,44.34000015258789,42.25,38.81999969482422,38.95000076293945,51.720001220703125,57.83000183105469,210.0399932861328,119.0,80.9000015258789,104.97000122070312,179.13999938964844\n2015-11-09,34.41999816894531,26.479999542236328,109.72000122070312,49.400001525878906,60.310001373291016,105.19000244140625,25.459999084472656,34.08000183105469,45.02000045776367,69.11000061035156,19.870023727416992,114.55999755859375,43.90999984741211,42.36000061035156,38.060001373291016,38.16999816894531,51.220001220703125,57.290000915527344,208.0800018310547,118.33000183105469,80.83000183105469,104.95999908447266,177.4199981689453\n2015-11-10,34.27000045776367,26.40999984741211,109.68000030517578,49.91999816894531,60.27000045776367,105.38999938964844,25.350000381469727,34.02000045776367,44.689998626708984,69.26000213623047,19.959383010864258,114.8499984741211,43.619998931884766,42.7400016784668,37.95000076293945,37.90999984741211,51.040000915527344,57.45000076293945,208.55999755859375,118.68000030517578,80.91999816894531,104.91000366210938,177.77999877929688\n2015-11-11,34.34000015258789,26.489999771118164,109.66999816894531,50.119998931884766,60.58000183105469,105.33999633789062,25.469999313354492,34.20000076293945,44.7400016784668,67.79000091552734,19.894393920898438,114.83999633789062,43.599998474121094,43.11000061035156,38.2400016784668,37.91999816894531,51.290000915527344,57.79999923706055,207.74000549316406,118.43000030517578,80.93000030517578,104.95999908447266,177.2100067138672\n2015-11-12,34.0099983215332,26.309999465942383,109.66999816894531,49.63999938964844,59.790000915527344,105.4000015258789,25.06999969482422,33.5,43.84000015258789,66.25,19.593826293945312,114.80000305175781,43.220001220703125,42.70000076293945,38.310001373291016,37.88999938964844,50.5,57.349998474121094,204.83999633789062,119.0,80.94000244140625,104.91999816894531,174.6699981689453\n2015-11-13,33.540000915527344,26.049999237060547,109.81999969482422,49.400001525878906,59.290000915527344,105.80000305175781,24.799999237060547,33.2400016784668,44.400001525878906,65.9800033569336,19.43135643005371,115.13999938964844,42.369998931884766,42.540000915527344,37.7400016784668,37.130001068115234,50.08000183105469,56.90999984741211,202.5399932861328,119.68000030517578,81.08999633789062,105.04000091552734,172.61000061035156\n2015-11-16,34.189998626708984,26.260000228881836,109.76000213623047,49.880001068115234,60.040000915527344,105.94000244140625,25.020000457763672,33.900001525878906,44.970001220703125,68.18000030517578,19.66693687438965,115.16000366210938,43.02000045776367,43.2599983215332,38.099998474121094,37.689998626708984,50.7599983215332,57.52000045776367,205.6199951171875,119.56999969482422,81.08999633789062,104.98999786376953,175.02000427246094\n2015-11-17,34.09000015258789,26.3799991607666,109.95999908447266,50.0,60.20000076293945,105.91000366210938,25.09000015258789,34.040000915527344,44.91999816894531,67.43000030517578,19.626319885253906,115.27999877929688,43.029998779296875,42.47999954223633,38.2400016784668,37.52000045776367,50.84000015258789,57.58000183105469,205.47000122070312,119.7699966430664,81.18000030517578,105.06999969482422,175.16000366210938\n2015-11-18,34.459999084472656,26.700000762939453,110.12000274658203,50.2400016784668,60.75,105.86000061035156,25.31999969482422,34.41999816894531,45.720001220703125,68.54000091552734,19.975629806518555,115.30999755859375,43.68000030517578,42.75,38.599998474121094,37.779998779296875,51.40999984741211,58.0099983215332,208.72999572753906,120.0199966430664,81.13999938964844,105.05000305175781,177.72999572753906\n2015-11-19,34.77000045776367,26.979999542236328,110.51000213623047,50.2400016784668,61.060001373291016,106.08999633789062,25.389999389648438,34.70000076293945,45.66999816894531,67.62000274658203,20.00812339782715,115.6500015258789,43.880001068115234,43.209999084472656,39.310001373291016,37.83000183105469,51.68000030517578,58.33000183105469,208.5500030517578,120.81999969482422,81.25,104.97000122070312,177.66000366210938\n2015-11-20,35.119998931884766,26.860000610351562,110.5999984741211,50.47999954223633,60.91999816894531,105.94999694824219,25.18000030517578,34.36000061035156,45.529998779296875,66.9000015258789,20.040616989135742,115.62999725341797,44.20000076293945,43.38999938964844,39.630001068115234,38.470001220703125,51.310001373291016,58.65999984741211,209.30999755859375,120.44999694824219,81.2300033569336,104.94999694824219,178.05999755859375\n2015-11-23,34.790000915527344,26.719999313354492,110.7300033569336,50.2400016784668,60.540000915527344,106.08999633789062,24.969999313354492,34.08000183105469,45.59000015258789,67.37999725341797,19.959383010864258,115.66999816894531,43.939998626708984,42.9900016784668,39.33000183105469,38.04999923706055,50.93000030517578,58.45000076293945,209.07000732421875,120.81999969482422,81.26000213623047,104.94999694824219,177.74000549316406\n2015-11-24,34.970001220703125,26.540000915527344,110.8499984741211,50.47999954223633,60.54999923706055,106.19000244140625,24.790000915527344,34.099998474121094,45.970001220703125,68.81999969482422,19.90251922607422,115.70999908447266,43.95000076293945,42.93000030517578,39.560001373291016,38.060001373291016,50.77000045776367,58.77000045776367,209.35000610351562,120.80999755859375,81.29000091552734,104.95999908447266,177.97999572753906\n2015-11-25,34.70000076293945,26.889999389648438,110.79000091552734,50.15999984741211,60.689998626708984,106.25,24.940000534057617,34.34000015258789,45.68000030517578,68.26000213623047,19.918766021728516,115.81999969482422,43.810001373291016,42.66999816894531,39.209999084472656,37.970001220703125,51.099998474121094,58.5,209.32000732421875,121.08999633789062,81.30000305175781,105.01000213623047,177.92999267578125\n2015-11-27,33.939998626708984,27.170000076293945,110.8499984741211,49.91999816894531,60.70000076293945,106.36000061035156,25.139999389648438,34.36000061035156,45.619998931884766,67.7699966430664,19.967506408691406,115.86000061035156,43.90999984741211,42.75,38.689998626708984,36.93000030517578,51.380001068115234,58.04999923706055,209.55999755859375,120.97000122070312,81.33999633789062,105.01000213623047,177.89999389648438\n2015-11-30,33.9900016784668,27.25,110.80000305175781,49.52000045776367,60.650001525878906,106.4000015258789,25.190000534057617,34.36000061035156,45.72999954223633,68.0199966430664,19.95125961303711,115.91000366210938,43.959999084472656,42.81999969482422,38.88999938964844,37.45000076293945,51.43000030517578,57.77000045776367,208.69000244140625,121.44999694824219,81.30000305175781,105.05000305175781,177.22999572753906\n2015-12-01,34.25,27.270000457763672,111.20999908447266,50.279998779296875,61.290000915527344,106.80000305175781,25.280000686645508,34.70000076293945,46.04999923706055,68.55999755859375,20.17059326171875,116.44999694824219,44.349998474121094,43.15999984741211,39.7599983215332,37.630001068115234,51.84000015258789,58.72999954223633,210.67999267578125,122.83000183105469,81.44000244140625,104.91999816894531,178.80999755859375\n2015-12-02,33.84000015258789,26.829999923706055,110.83000183105469,49.880001068115234,60.63999938964844,106.5,24.959999084472656,34.20000076293945,45.43000030517578,66.44000244140625,19.935012817382812,116.16999816894531,44.06999969482422,42.20000076293945,39.400001525878906,37.310001373291016,51.209999084472656,58.209999084472656,208.52999877929688,122.87000274658203,81.33999633789062,104.87000274658203,177.2899932861328\n2015-12-03,33.650001525878906,26.670000076293945,110.13999938964844,49.400001525878906,60.349998474121094,105.37999725341797,24.760000228881836,33.779998779296875,45.029998779296875,65.11000061035156,19.61007308959961,114.62999725341797,43.5,41.880001068115234,39.2599983215332,37.040000915527344,51.060001373291016,57.66999816894531,205.61000061035156,119.52999877929688,80.70999908447266,104.83999633789062,174.8300018310547\n2015-12-04,33.880001068115234,26.93000030517578,110.41999816894531,49.68000030517578,60.84000015258789,105.7699966430664,25.09000015258789,34.02000045776367,45.81999969482422,64.69999694824219,20.129976272583008,115.25,44.56999969482422,42.470001220703125,39.4900016784668,37.36000061035156,51.619998931884766,58.040000915527344,209.6199951171875,120.58000183105469,81.02999877929688,104.83999633789062,178.4199981689453\n2015-12-07,33.31999969482422,26.989999771118164,110.37999725341797,49.560001373291016,60.45000076293945,106.11000061035156,25.06999969482422,33.63999938964844,45.0,62.2400016784668,19.94313621520996,115.44999694824219,44.349998474121094,42.65999984741211,38.93000030517578,36.79999923706055,51.2400016784668,57.56999969482422,208.35000610351562,121.75,81.16999816894531,104.88999938964844,177.33999633789062\n2015-12-08,32.95000076293945,26.520000457763672,110.41000366210938,48.91999816894531,59.560001373291016,106.16999816894531,24.729999542236328,33.02000045776367,44.150001525878906,61.599998474121094,19.691307067871094,115.30000305175781,44.2400016784668,42.599998474121094,38.290000915527344,36.2400016784668,50.40999984741211,56.84000015258789,206.9499969482422,121.80999755859375,81.19000244140625,104.87000274658203,175.77000427246094\n2015-12-09,32.68000030517578,26.399999618530273,110.19999694824219,48.36000061035156,59.290000915527344,106.33000183105469,24.530000686645508,33.060001373291016,45.47999954223633,62.40999984741211,19.463850021362305,115.2699966430664,43.59000015258789,42.61000061035156,38.27000045776367,35.86000061035156,50.36000061035156,56.47999954223633,205.33999633789062,121.68000030517578,81.16000366210938,104.87999725341797,174.99000549316406\n2015-12-10,32.459999084472656,26.40999984741211,109.95999908447266,48.79999923706055,59.29999923706055,106.0999984741211,24.479999542236328,32.959999084472656,45.13999938964844,62.810001373291016,19.4800968170166,115.0,43.709999084472656,41.90999984741211,38.290000915527344,35.52000045776367,50.18000030517578,56.70000076293945,205.8699951171875,121.83999633789062,81.1500015258789,104.83999633789062,175.8800048828125\n2015-12-11,31.549999237060547,25.780000686645508,110.31999969482422,48.040000915527344,58.16999816894531,106.94999694824219,24.06999969482422,32.36000061035156,43.939998626708984,60.459999084472656,19.04955291748047,115.19999694824219,42.79999923706055,41.790000915527344,37.38999938964844,34.529998779296875,49.279998779296875,55.709999084472656,201.8800048828125,123.76000213623047,81.37000274658203,104.86000061035156,172.72999572753906\n2015-12-14,32.060001373291016,25.75,109.52999877929688,48.47999954223633,58.2599983215332,106.16000366210938,24.100000381469727,32.2599983215332,43.36000061035156,60.779998779296875,19.09016990661621,114.3499984741211,43.130001068115234,42.0,37.4900016784668,35.040000915527344,49.310001373291016,56.119998931884766,202.89999389648438,122.16000366210938,80.98999786376953,104.66999816894531,173.89999389648438\n2015-12-15,32.54999923706055,26.040000915527344,109.47000122070312,48.279998779296875,58.54999923706055,105.88999938964844,24.34000015258789,32.41999816894531,43.599998474121094,62.310001373291016,19.536962509155273,114.36000061035156,43.31999969482422,42.33000183105469,37.560001373291016,35.63999938964844,49.68000030517578,56.040000915527344,205.02999877929688,121.44000244140625,80.9000015258789,104.72000122070312,175.4600067138672\n2015-12-16,33.189998626708984,26.479999542236328,109.1500015258789,49.47999954223633,59.72999954223633,105.61000061035156,24.780000686645508,32.959999084472656,44.04999923706055,61.900001525878906,19.853776931762695,114.33999633789062,43.90999984741211,43.400001525878906,38.45000076293945,36.27000045776367,50.61000061035156,57.2400016784668,208.02999877929688,121.18000030517578,80.80999755859375,104.62000274658203,177.63999938964844\n2015-12-17,32.7599983215332,26.399999618530273,109.52999877929688,49.0,58.970001220703125,106.05000305175781,24.420000076293945,32.52000045776367,43.16999816894531,60.380001068115234,19.569456100463867,114.47000122070312,43.220001220703125,43.4900016784668,37.810001373291016,35.83000183105469,49.91999816894531,56.59000015258789,204.86000061035156,122.55000305175781,80.9800033569336,104.55999755859375,175.10000610351562\n2015-12-18,32.650001525878906,26.09000015258789,109.83000183105469,48.400001525878906,58.349998474121094,106.43000030517578,24.059999465942383,32.08000183105469,42.27000045776367,58.790000915527344,18.927701950073242,114.47000122070312,42.16999816894531,42.5099983215332,38.0099983215332,36.16999816894531,49.33000183105469,56.36000061035156,200.02000427246094,123.2300033569336,81.16000366210938,104.69000244140625,171.0\n2015-12-21,32.400001525878906,26.270000457763672,109.62999725341797,48.20000076293945,58.11000061035156,106.4800033569336,24.139999389648438,31.65999984741211,42.650001525878906,58.849998474121094,19.114540100097656,114.55000305175781,42.599998474121094,42.47999954223633,37.47999954223633,35.77000045776367,49.38999938964844,56.09000015258789,201.6699981689453,123.19999694824219,81.06999969482422,104.69000244140625,172.25\n2015-12-22,32.65999984741211,26.3799991607666,109.4800033569336,48.560001373291016,58.54999923706055,106.18000030517578,24.290000915527344,31.8799991607666,43.189998626708984,59.540000915527344,19.293256759643555,114.4000015258789,42.90999984741211,42.84000015258789,37.709999084472656,35.83000183105469,49.75,56.5,203.5,122.30999755859375,80.95999908447266,104.70999908447266,174.00999450683594\n2015-12-23,33.119998931884766,26.790000915527344,109.58000183105469,49.08000183105469,59.529998779296875,105.94000244140625,24.690000534057617,32.720001220703125,44.209999084472656,62.130001068115234,19.520715713500977,114.5,43.27000045776367,43.5,38.279998779296875,36.54999923706055,50.68000030517578,57.08000183105469,206.02000427246094,121.38999938964844,80.73999786376953,104.6500015258789,175.80999755859375\n2015-12-24,33.0,26.790000915527344,109.7699966430664,48.47999954223633,59.43000030517578,105.97000122070312,24.610000610351562,32.779998779296875,44.11000061035156,61.56999969482422,19.504467010498047,114.55000305175781,43.25,43.470001220703125,38.25,36.459999084472656,50.689998626708984,56.68000030517578,205.67999267578125,121.83000183105469,80.80000305175781,104.55000305175781,175.22000122070312\n2015-12-28,32.77000045776367,26.729999542236328,109.80000305175781,48.52000045776367,59.290000915527344,105.98999786376953,24.510000228881836,32.619998931884766,43.79999923706055,60.45000076293945,19.48822021484375,114.41000366210938,43.220001220703125,43.54999923706055,38.08000183105469,35.869998931884766,50.540000915527344,56.59000015258789,205.2100067138672,122.19000244140625,80.80000305175781,104.41000366210938,174.97999572753906\n2015-12-29,32.79999923706055,27.040000915527344,109.37999725341797,49.2400016784668,59.880001068115234,105.43000030517578,24.739999771118164,32.81999969482422,44.209999084472656,60.869998931884766,19.691307067871094,113.81999969482422,43.810001373291016,43.790000915527344,38.86000061035156,35.9900016784668,51.0,57.43000030517578,207.39999389648438,120.16000366210938,80.55000305175781,104.41000366210938,176.97999572753906\n2015-12-30,32.290000915527344,26.6200008392334,109.5,48.959999084472656,59.52000045776367,105.47000122070312,24.559999465942383,32.599998474121094,43.79999923706055,60.04999923706055,19.55320930480957,113.81999969482422,43.439998626708984,43.75,38.689998626708984,35.40999984741211,50.599998474121094,57.060001373291016,205.92999267578125,120.04000091552734,80.5999984741211,104.48999786376953,175.8000030517578\n2015-12-31,32.189998626708984,26.190000534057617,109.68000030517578,48.47999954223633,58.720001220703125,105.58999633789062,24.209999084472656,32.279998779296875,43.41999816894531,60.31999969482422,19.358245849609375,114.01000213623047,42.83000183105469,43.279998779296875,38.38999938964844,35.290000915527344,49.880001068115234,56.66999816894531,203.8699951171875,120.58000183105469,80.76000213623047,104.5999984741211,173.99000549316406\n2016-01-04,31.309999465942383,25.559999465942383,110.11000061035156,47.720001220703125,57.81999969482422,106.04000091552734,23.81999969482422,31.760000228881836,42.7400016784668,60.29999923706055,18.98456573486328,113.94999694824219,42.27000045776367,43.189998626708984,37.7599983215332,34.150001525878906,49.150001525878906,55.75,201.02000427246094,121.44999694824219,80.72000122070312,104.5999984741211,171.2899932861328\n2016-01-05,31.3799991607666,25.31999969482422,110.04000091552734,48.31999969482422,57.72999954223633,106.01000213623047,23.59000015258789,31.68000030517578,42.720001220703125,60.529998779296875,19.057676315307617,114.01000213623047,42.15999984741211,43.5,37.560001373291016,33.959999084472656,48.86000061035156,56.040000915527344,201.36000061035156,120.95999908447266,80.81999969482422,104.55000305175781,171.38999938964844\n2016-01-06,30.780000686645508,25.030000686645508,110.38999938964844,47.47999954223633,56.779998779296875,106.6500015258789,23.219999313354492,31.100000381469727,41.599998474121094,58.20000076293945,18.76523208618164,114.45999908447266,41.63999938964844,43.41999816894531,36.61000061035156,33.220001220703125,48.04999923706055,54.97999954223633,198.82000732421875,122.58999633789062,81.18000030517578,104.62999725341797,168.94000244140625\n2016-01-07,29.829999923706055,24.530000686645508,110.30000305175781,46.7599983215332,55.599998474121094,106.87999725341797,22.899999618530273,30.239999771118164,40.470001220703125,56.779998779296875,18.237205505371094,114.55000305175781,40.40999984741211,43.130001068115234,35.279998779296875,31.950000762939453,47.15999984741211,53.88999938964844,194.0500030517578,122.80999755859375,81.19000244140625,104.66999816894531,164.9600067138672\n2016-01-08,29.510000228881836,24.290000915527344,110.38999938964844,45.7599983215332,54.93000030517578,107.1500015258789,22.709999084472656,30.040000915527344,40.060001373291016,56.04999923706055,17.952884674072266,114.63999938964844,40.09000015258789,43.11000061035156,34.810001373291016,31.6200008392334,46.75,52.97999954223633,191.9199981689453,123.36000061035156,81.29000091552734,104.73999786376953,163.24000549316406\n2016-01-11,29.5,24.479999542236328,109.80999755859375,46.08000183105469,55.15999984741211,106.80999755859375,22.760000228881836,30.1200008392334,39.380001068115234,54.849998474121094,17.97725486755371,114.2699966430664,40.349998474121094,43.34000015258789,34.90999984741211,31.450000762939453,46.88999938964844,53.27000045776367,192.11000061035156,122.01000213623047,80.94999694824219,104.70999908447266,163.8300018310547\n2016-01-12,29.559999465942383,24.8700008392334,110.11000061035156,45.84000015258789,55.41999816894531,107.29000091552734,23.059999465942383,30.139999389648438,39.439998626708984,54.97999954223633,18.115352630615234,114.52999877929688,40.83000183105469,43.16999816894531,35.06999969482422,31.399999618530273,47.279998779296875,53.13999938964844,193.66000366210938,123.7699966430664,81.16000366210938,104.66999816894531,164.9499969482422\n2016-01-13,29.25,24.25,110.33999633789062,45.439998626708984,54.560001373291016,107.70999908447266,22.6200008392334,29.639999389648438,38.529998779296875,53.65999984741211,17.64419174194336,114.87999725341797,39.72999954223633,43.150001525878906,34.52000045776367,30.81999969482422,46.380001068115234,52.56999969482422,188.8300018310547,124.98999786376953,81.36000061035156,104.70999908447266,161.35000610351562\n2016-01-14,29.6299991607666,24.530000686645508,110.23999786376953,46.0,55.2599983215332,107.48999786376953,22.81999969482422,30.200000762939453,39.04999923706055,55.970001220703125,17.798538208007812,114.30999755859375,40.47999954223633,43.79999923706055,35.06999969482422,31.260000228881836,46.97999954223633,53.2599983215332,191.92999267578125,123.81999969482422,81.26000213623047,104.70999908447266,163.58999633789062\n2016-01-15,28.459999084472656,23.6299991607666,110.23999786376953,44.720001220703125,53.2599983215332,107.98999786376953,22.110000610351562,29.0,38.25,54.349998474121094,17.400487899780273,114.13999938964844,39.34000015258789,43.40999984741211,33.5099983215332,29.799999237060547,45.2599983215332,51.43000030517578,187.80999755859375,125.75,81.4000015258789,104.69000244140625,159.67999267578125\n2016-01-19,28.8799991607666,23.920000076293945,110.12999725341797,45.08000183105469,53.75,107.8499984741211,22.389999389648438,29.1200008392334,37.779998779296875,53.18000030517578,17.392364501953125,113.62999725341797,39.380001068115234,44.060001373291016,34.119998931884766,30.540000915527344,45.560001373291016,52.02000045776367,188.05999755859375,125.36000061035156,81.30000305175781,104.69999694824219,160.02000427246094\n2016-01-20,28.25,23.489999771118164,110.19000244140625,43.36000061035156,52.529998779296875,108.37999725341797,21.920000076293945,28.5,37.5,51.77000045776367,17.051177978515625,113.80000305175781,39.06999969482422,43.06999969482422,33.59000015258789,29.459999084472656,44.619998931884766,50.439998626708984,185.64999389648438,126.68000030517578,81.38999938964844,104.61000061035156,157.61000061035156\n2016-01-21,28.360000610351562,23.729999542236328,109.79000091552734,43.20000076293945,52.91999816894531,108.11000061035156,22.079999923706055,28.899999618530273,37.83000183105469,53.380001068115234,16.97806739807129,113.47000122070312,39.290000915527344,43.029998779296875,33.959999084472656,29.65999984741211,45.08000183105469,50.5099983215332,186.69000244140625,125.81999969482422,81.33999633789062,104.58999633789062,158.60000610351562\n2016-01-22,29.329999923706055,24.18000030517578,109.94999694824219,45.15999984741211,54.47999954223633,107.87000274658203,22.760000228881836,29.760000228881836,38.5099983215332,55.7400016784668,17.286758422851562,113.54000091552734,40.380001068115234,43.79999923706055,34.540000915527344,30.729999542236328,46.27000045776367,52.34000015258789,190.52000427246094,125.33999633789062,81.30999755859375,104.72000122070312,160.7899932861328\n2016-01-25,28.829999923706055,23.969999313354492,110.16000366210938,44.20000076293945,53.75,108.2300033569336,22.489999771118164,29.219999313354492,37.279998779296875,53.13999938964844,16.937448501586914,113.41999816894531,39.90999984741211,43.43000030517578,34.119998931884766,29.989999771118164,45.66999816894531,51.47999954223633,187.63999938964844,126.0199966430664,81.30999755859375,104.63999938964844,158.6999969482422\n2016-01-26,29.25,24.43000030517578,110.44000244140625,44.79999923706055,54.709999084472656,108.30999755859375,22.979999542236328,29.920000076293945,37.91999816894531,55.150001525878906,17.221771240234375,113.73999786376953,40.29999923706055,43.72999954223633,34.70000076293945,30.200000762939453,46.65999984741211,52.09000015258789,190.1999969482422,126.08000183105469,81.43000030517578,104.66000366210938,161.5399932861328\n2016-01-27,29.149999618530273,24.260000228881836,110.72000122070312,44.84000015258789,54.36000061035156,108.38999938964844,22.81999969482422,29.68000030517578,37.619998931884766,54.88999938964844,17.156782150268555,113.43000030517578,39.470001220703125,43.83000183105469,34.27000045776367,29.780000686645508,46.2400016784668,51.869998931884766,188.1300048828125,126.05000305175781,81.43000030517578,104.68000030517578,159.3000030517578\n2016-01-28,29.610000610351562,24.15999984741211,110.94999694824219,44.91999816894531,54.52000045776367,108.52999877929688,22.940000534057617,30.059999465942383,37.68000030517578,56.560001373291016,17.164907455444336,113.55999755859375,39.97999954223633,44.529998779296875,34.75,30.219999313354492,46.369998931884766,52.209999084472656,189.11000061035156,126.2300033569336,81.48999786376953,104.69000244140625,160.50999450683594\n2016-01-29,30.56999969482422,24.329999923706055,111.4000015258789,46.0,55.47999954223633,109.11000061035156,23.290000915527344,30.719999313354492,38.77000045776367,58.209999084472656,17.64419174194336,114.1500015258789,41.2400016784668,45.41999816894531,35.380001068115234,31.200000762939453,47.11000061035156,53.290000915527344,193.72000122070312,127.30000305175781,81.7300033569336,104.79000091552734,164.3699951171875\n2016-02-01,30.280000686645508,24.309999465942383,111.19999694824219,45.720001220703125,55.41999816894531,108.69999694824219,23.280000686645508,30.760000228881836,38.93000030517578,57.2400016784668,17.571081161499023,113.44999694824219,41.38999938964844,45.849998474121094,35.310001373291016,30.530000686645508,47.06999969482422,53.029998779296875,193.64999389648438,126.66999816894531,81.38999938964844,104.62999725341797,164.33999633789062\n2016-02-02,29.299999237060547,23.700000762939453,111.54000091552734,45.2400016784668,54.130001068115234,109.47000122070312,22.59000015258789,29.84000015258789,38.66999816894531,55.33000183105469,17.08367156982422,113.66000366210938,40.650001525878906,46.04999923706055,34.34000015258789,29.75,45.779998779296875,52.16999816894531,190.16000366210938,129.02000427246094,81.66999816894531,104.69999694824219,161.41000366210938\n2016-02-03,30.1299991607666,24.149999618530273,111.68000030517578,44.68000030517578,54.58000183105469,109.3499984741211,23.0,30.260000228881836,39.970001220703125,57.29999923706055,17.099918365478516,113.37999725341797,40.599998474121094,46.619998931884766,34.65999984741211,30.229999542236328,46.5099983215332,52.09000015258789,191.3000030517578,127.94999694824219,81.7300033569336,104.7300033569336,163.1999969482422\n2016-02-04,30.360000610351562,24.059999465942383,111.69999694824219,44.560001373291016,54.650001525878906,109.61000061035156,23.079999923706055,30.34000015258789,41.08000183105469,57.27000045776367,17.24614143371582,113.43000030517578,40.63999938964844,46.41999816894531,35.08000183105469,29.950000762939453,46.4900016784668,52.209999084472656,191.60000610351562,128.57000732421875,81.79000091552734,104.7699966430664,164.13999938964844\n2016-02-05,30.010000228881836,23.600000381469727,111.38999938964844,43.79999923706055,53.810001373291016,109.75,22.75,29.860000610351562,40.61000061035156,55.939998626708984,17.01868438720703,113.41000366210938,39.5,46.56999969482422,34.5099983215332,29.729999542236328,45.81999969482422,51.36000061035156,187.9499969482422,128.72000122070312,81.70999908447266,104.76000213623047,161.94000244140625\n2016-02-08,29.600000381469727,23.010000228881836,111.47000122070312,43.720001220703125,52.810001373291016,110.56999969482422,22.219999313354492,29.079999923706055,39.540000915527344,55.650001525878906,16.5881404876709,114.0,38.93000030517578,46.40999984741211,34.380001068115234,29.139999389648438,44.58000183105469,51.189998626708984,185.4199981689453,131.49000549316406,82.05999755859375,104.80999755859375,160.35000610351562\n2016-02-09,29.190000534057617,22.969999313354492,111.22000122070312,42.880001068115234,52.20000076293945,110.58999633789062,22.010000228881836,28.799999237060547,40.029998779296875,54.310001373291016,16.56376838684082,113.61000061035156,38.75,46.56999969482422,33.790000915527344,28.8700008392334,44.189998626708984,50.380001068115234,185.42999267578125,131.6300048828125,82.05000305175781,104.72000122070312,160.24000549316406\n2016-02-10,29.309999465942383,23.040000915527344,111.62999725341797,42.119998931884766,52.13999938964844,110.91999816894531,22.079999923706055,28.780000686645508,39.650001525878906,54.09000015258789,16.474411010742188,113.75,38.810001373291016,46.52000045776367,33.849998474121094,29.06999969482422,44.439998626708984,49.86000061035156,185.27000427246094,132.7899932861328,82.22000122070312,104.77999877929688,159.38999938964844\n2016-02-11,28.81999969482422,22.8700008392334,112.0199966430664,41.279998779296875,51.380001068115234,111.43000030517578,21.690000534057617,28.399999618530273,38.790000915527344,53.86000061035156,15.970755577087402,114.12999725341797,38.72999954223633,45.70000076293945,33.7400016784668,28.440000534057617,43.849998474121094,49.15999984741211,182.86000061035156,133.72000122070312,82.2699966430664,104.81999969482422,156.8000030517578\n2016-02-12,29.31999969482422,23.1200008392334,111.5999984741211,41.63999938964844,52.279998779296875,110.58000183105469,21.8799991607666,29.280000686645508,39.939998626708984,55.279998779296875,16.645004272460938,113.48999786376953,39.27000045776367,45.560001373291016,34.22999954223633,29.06999969482422,44.630001068115234,49.630001068115234,186.6300048828125,131.5,82.0,104.7699966430664,159.97999572753906\n2016-02-16,29.969999313354492,23.440000534057617,111.13999938964844,43.15999984741211,53.34000015258789,110.25,22.420000076293945,29.700000762939453,40.54999923706055,55.83000183105469,16.91307830810547,112.94999694824219,39.970001220703125,45.849998474121094,34.90999984741211,30.290000915527344,45.38999938964844,50.79999923706055,189.77999877929688,130.11000061035156,81.87999725341797,104.72000122070312,162.1999969482422\n2016-02-17,30.559999465942383,23.940000534057617,110.94999694824219,43.52000045776367,54.2599983215332,109.9800033569336,22.920000076293945,30.3799991607666,41.349998474121094,57.65999984741211,17.140535354614258,112.91999816894531,40.790000915527344,45.7599983215332,35.38999938964844,30.760000228881836,46.34000015258789,51.40999984741211,192.8800048828125,129.30999755859375,81.86000061035156,104.63999938964844,164.92999267578125\n2016-02-18,30.3799991607666,23.969999313354492,111.26000213623047,43.52000045776367,53.97999954223633,110.48999786376953,22.780000686645508,30.219999313354492,41.22999954223633,56.939998626708984,17.043054580688477,113.83999633789062,40.630001068115234,46.5099983215332,35.36000061035156,30.469999313354492,46.06999969482422,51.41999816894531,192.08999633789062,130.89999389648438,82.13999938964844,104.80999755859375,164.52000427246094\n2016-02-19,30.239999771118164,23.889999389648438,111.3499984741211,43.31999969482422,53.91999816894531,110.48999786376953,22.799999237060547,30.18000030517578,40.75,56.810001373291016,17.043054580688477,113.76000213623047,40.65999984741211,46.20000076293945,35.380001068115234,30.459999084472656,46.060001373291016,51.189998626708984,192.0,131.00999450683594,82.02999877929688,104.77999877929688,163.6999969482422\n2016-02-22,30.989999771118164,24.139999389648438,111.62000274658203,44.040000915527344,54.529998779296875,110.37999725341797,22.969999313354492,30.200000762939453,41.529998779296875,58.2599983215332,17.311128616333008,113.98999786376953,41.20000076293945,46.7400016784668,36.34000015258789,31.31999969482422,46.29999923706055,52.27000045776367,194.77999877929688,130.94000244140625,82.05000305175781,104.81999969482422,165.94000244140625\n2016-02-23,30.329999923706055,23.700000762939453,111.95999908447266,43.31999969482422,53.63999938964844,110.5999984741211,22.610000610351562,29.479999542236328,40.5099983215332,56.27000045776367,17.002437591552734,114.22000122070312,40.54999923706055,46.779998779296875,35.689998626708984,30.540000915527344,45.4900016784668,51.439998626708984,192.32000732421875,131.47000122070312,82.0999984741211,104.83999633789062,164.14999389648438\n2016-02-24,30.260000228881836,23.399999618530273,112.20999908447266,43.7599983215332,53.45000076293945,110.5999984741211,22.56999969482422,29.31999969482422,40.93000030517578,56.84000015258789,16.961820602416992,114.33000183105469,40.86000061035156,47.0,35.439998626708984,30.450000762939453,45.290000915527344,51.599998474121094,193.1999969482422,131.2100067138672,82.16000366210938,104.87000274658203,164.6699981689453\n2016-02-25,30.360000610351562,23.65999984741211,112.66999816894531,44.279998779296875,54.09000015258789,110.93000030517578,22.8700008392334,29.84000015258789,41.459999084472656,56.88999938964844,17.19740104675293,114.97000122070312,41.369998931884766,47.47999954223633,35.470001220703125,30.350000381469727,45.90999984741211,52.029998779296875,195.5399932861328,131.67999267578125,82.27999877929688,104.95999908447266,166.83999633789062\n2016-02-26,30.059999465942383,23.649999618530273,112.37999725341797,44.2400016784668,53.95000076293945,110.38999938964844,22.760000228881836,29.81999969482422,42.060001373291016,57.22999954223633,17.319252014160156,114.93000030517578,41.2599983215332,46.16999816894531,35.150001525878906,30.420000076293945,45.7599983215332,51.72999954223633,195.08999633789062,130.41000366210938,82.19999694824219,104.86000061035156,166.27999877929688\n2016-02-29,30.31999969482422,23.360000610351562,112.76000213623047,43.560001373291016,53.630001068115234,110.56999969482422,22.700000762939453,29.760000228881836,41.79999923706055,56.58000183105469,17.13241195678711,115.01000213623047,40.970001220703125,46.29999923706055,35.15999984741211,30.280000686645508,45.59000015258789,51.41999816894531,193.55999755859375,130.97999572753906,82.25,104.88999938964844,164.9600067138672\n2016-03-01,31.399999618530273,24.239999771118164,112.44999694824219,44.63999938964844,55.029998779296875,109.55000305175781,23.280000686645508,30.520000457763672,42.869998931884766,58.060001373291016,17.709178924560547,114.05000305175781,42.189998626708984,46.06999969482422,36.150001525878906,31.3700008392334,46.86000061035156,52.709999084472656,198.11000061035156,128.42999267578125,81.80999755859375,104.80000305175781,168.52000427246094\n2016-03-02,31.81999969482422,24.219999313354492,112.69000244140625,45.279998779296875,55.40999984741211,109.36000061035156,23.25,30.68000030517578,42.70000076293945,59.47999954223633,17.904142379760742,114.27999877929688,42.310001373291016,46.310001373291016,36.9900016784668,32.04999923706055,46.90999984741211,53.459999084472656,199.0,128.9600067138672,81.76000213623047,104.83999633789062,168.88999938964844\n2016-03-03,32.18000030517578,24.459999084472656,112.91999816894531,45.599998474121094,55.95000076293945,109.48999786376953,23.5,30.940000534057617,42.959999084472656,60.380001068115234,18.0259952545166,114.81999969482422,42.310001373291016,46.59000015258789,37.52000045776367,32.08000183105469,47.400001525878906,54.0,199.77999877929688,129.42999267578125,81.80000305175781,104.80999755859375,169.35000610351562\n2016-03-04,32.81999969482422,24.559999465942383,112.56999969482422,46.08000183105469,56.36000061035156,109.12000274658203,23.6299991607666,31.139999389648438,43.459999084472656,60.959999084472656,18.099105834960938,114.80000305175781,42.41999816894531,47.11000061035156,38.310001373291016,32.9900016784668,47.619998931884766,54.72999954223633,200.42999267578125,128.60000610351562,81.76000213623047,104.80999755859375,170.02000427246094\n2016-03-07,32.77000045776367,24.489999771118164,112.12000274658203,45.599998474121094,56.290000915527344,108.9000015258789,23.639999389648438,31.239999771118164,43.959999084472656,62.38999938964844,18.09098243713379,114.93000030517578,42.15999984741211,47.369998931884766,38.439998626708984,32.61000061035156,47.650001525878906,54.47999954223633,200.58999633789062,128.55999755859375,81.73999786376953,104.76000213623047,170.6199951171875\n2016-03-08,32.209999084472656,24.239999771118164,112.55000305175781,45.15999984741211,55.7400016784668,109.52999877929688,23.420000076293945,30.81999969482422,43.099998474121094,59.77000045776367,17.798538208007812,115.54000091552734,41.900001525878906,47.84000015258789,37.72999954223633,31.860000610351562,47.11000061035156,53.790000915527344,198.39999389648438,129.97999572753906,82.01000213623047,104.87999725341797,169.6199951171875\n2016-03-09,32.40999984741211,24.34000015258789,112.4800033569336,45.119998931884766,55.95000076293945,109.0999984741211,23.540000915527344,30.979999542236328,43.369998931884766,60.7400016784668,17.822908401489258,115.41000366210938,42.2599983215332,48.060001373291016,38.40999984741211,31.979999542236328,47.31999969482422,54.02000045776367,199.3800048828125,129.19000244140625,81.87000274658203,104.83000183105469,170.02000427246094\n2016-03-10,32.459999084472656,24.25,112.08999633789062,44.91999816894531,55.86000061035156,108.70999908447266,23.59000015258789,30.739999771118164,43.599998474121094,60.790000915527344,17.80666160583496,115.88999938964844,42.220001220703125,48.099998474121094,38.16999816894531,31.729999542236328,47.349998474121094,53.88999938964844,199.5399932861328,128.66000366210938,81.83000183105469,104.87000274658203,170.05999755859375\n2016-03-11,33.13999938964844,25.110000610351562,112.05000305175781,46.119998931884766,57.31999969482422,108.4000015258789,24.309999465942383,31.3799991607666,44.400001525878906,62.36000061035156,18.269699096679688,116.22000122070312,42.869998931884766,48.150001525878906,39.150001525878906,32.86000061035156,48.630001068115234,55.2599983215332,202.75999450683594,127.36000061035156,81.72000122070312,104.87000274658203,172.22999572753906\n2016-03-14,32.939998626708984,25.239999771118164,111.91999816894531,46.31999969482422,57.20000076293945,108.4800033569336,24.25,31.260000228881836,44.099998474121094,61.95000076293945,18.21283531188965,116.55999755859375,42.91999816894531,48.209999084472656,38.79999923706055,32.900001525878906,48.5,55.16999816894531,202.5,127.76000213623047,81.9000015258789,104.87999725341797,172.41000366210938\n2016-03-15,32.470001220703125,25.1299991607666,111.69999694824219,45.720001220703125,56.65999984741211,108.45999908447266,24.1200008392334,30.8799991607666,44.20000076293945,61.83000183105469,18.2047119140625,116.5199966430664,43.08000183105469,48.29999923706055,38.209999084472656,32.70000076293945,47.79999923706055,54.439998626708984,202.1699981689453,127.87999725341797,81.81999969482422,104.86000061035156,172.63999938964844\n2016-03-16,33.119998931884766,25.520000457763672,112.88999938964844,45.79999923706055,57.15999984741211,109.02999877929688,24.360000610351562,31.260000228881836,44.56999969482422,62.900001525878906,18.164094924926758,117.08000183105469,43.58000183105469,49.040000915527344,38.97999954223633,33.06999969482422,48.380001068115234,54.95000076293945,203.33999633789062,128.25999450683594,82.13999938964844,105.05999755859375,173.47000122070312\n2016-03-17,33.849998474121094,25.510000228881836,113.13999938964844,45.959999084472656,57.599998474121094,109.1500015258789,24.360000610351562,31.899999618530273,45.38999938964844,63.7599983215332,18.3834285736084,117.44000244140625,43.7400016784668,49.310001373291016,39.70000076293945,33.459999084472656,48.810001373291016,55.459999084472656,204.6300048828125,128.7899932861328,82.31999969482422,105.12999725341797,174.94000244140625\n2016-03-18,34.029998779296875,25.549999237060547,113.5199966430664,45.79999923706055,57.5,109.33999633789062,24.440000534057617,31.780000686645508,45.41999816894531,63.4900016784668,18.464662551879883,117.70999908447266,43.59000015258789,48.630001068115234,39.619998931884766,33.68000030517578,48.7599983215332,55.400001525878906,204.3800048828125,129.05999755859375,82.38999938964844,105.1500015258789,175.69000244140625\n2016-03-21,34.099998474121094,25.520000457763672,113.55000305175781,46.0,57.40999984741211,109.02999877929688,24.260000228881836,31.600000381469727,45.630001068115234,63.27000045776367,18.43216896057129,117.56999969482422,43.7400016784668,48.58000183105469,39.540000915527344,33.709999084472656,48.540000915527344,55.45000076293945,204.6699981689453,128.07000732421875,82.23999786376953,105.08000183105469,176.00999450683594\n2016-03-22,34.02000045776367,25.520000457763672,113.26000213623047,46.279998779296875,57.310001373291016,108.80000305175781,24.139999389648438,31.219999313354492,45.11000061035156,62.91999816894531,18.37530517578125,117.3499984741211,43.75,48.41999816894531,39.5,33.439998626708984,48.279998779296875,55.66999816894531,204.55999755859375,128.0399932861328,82.22000122070312,105.06999969482422,175.6999969482422\n2016-03-23,33.439998626708984,25.43000030517578,113.37999725341797,45.68000030517578,56.72999954223633,109.30000305175781,23.969999313354492,30.8799991607666,44.54999923706055,61.540000915527344,18.237205505371094,117.94000244140625,43.5,48.779998779296875,38.79999923706055,32.970001220703125,47.880001068115234,54.900001525878906,203.2100067138672,129.49000549316406,82.4000015258789,105.16000366210938,174.80999755859375\n2016-03-24,33.36000061035156,25.170000076293945,113.12000274658203,45.400001525878906,56.349998474121094,109.19000244140625,23.690000534057617,30.780000686645508,44.54999923706055,61.84000015258789,18.123476028442383,117.88999938964844,43.619998931884766,48.90999984741211,38.720001220703125,32.7400016784668,47.54999923706055,54.63999938964844,203.1199951171875,129.5399932861328,82.30000305175781,105.18000030517578,174.94000244140625\n2016-03-28,33.470001220703125,25.239999771118164,113.26000213623047,46.08000183105469,56.689998626708984,109.3499984741211,23.739999771118164,31.0,44.7400016784668,61.5099983215332,18.180341720581055,117.95999908447266,43.5099983215332,48.72999954223633,38.7599983215332,33.0099983215332,47.79999923706055,55.130001068115234,203.24000549316406,129.7100067138672,82.33999633789062,105.0999984741211,175.1199951171875\n2016-03-29,33.93000030517578,25.59000015258789,114.44999694824219,46.560001373291016,57.29999923706055,110.08999633789062,24.1299991607666,31.360000610351562,44.9900016784668,61.79999923706055,18.21283531188965,118.48999786376953,44.189998626708984,49.45000076293945,38.880001068115234,33.34000015258789,48.43000030517578,55.65999984741211,205.1199951171875,131.07000732421875,82.68000030517578,105.27999877929688,176.07000732421875\n2016-03-30,34.279998779296875,25.93000030517578,114.5199966430664,46.400001525878906,57.72999954223633,109.94000244140625,24.459999084472656,31.6200008392334,45.189998626708984,61.91999816894531,18.318439483642578,118.3499984741211,44.45000076293945,49.33000183105469,39.279998779296875,33.84000015258789,48.90999984741211,55.91999816894531,206.02000427246094,129.69000244140625,82.6500015258789,105.31999969482422,176.88999938964844\n2016-03-31,34.25,25.729999542236328,114.63999938964844,45.63999938964844,57.15999984741211,110.33999633789062,24.18000030517578,31.360000610351562,44.810001373291016,61.88999938964844,18.277822494506836,118.81999969482422,44.36000061035156,49.619998931884766,39.220001220703125,33.77000045776367,48.52000045776367,55.27000045776367,205.52000427246094,130.61000061035156,82.80999755859375,105.41999816894531,176.63999938964844\n2016-04-01,34.150001525878906,25.520000457763672,114.7300033569336,44.52000045776367,56.54999923706055,110.13999938964844,23.969999313354492,31.059999465942383,45.2400016784668,61.060001373291016,18.440292358398438,118.87000274658203,44.70000076293945,49.810001373291016,38.95000076293945,33.58000183105469,48.18000030517578,54.33000183105469,206.9199981689453,130.67999267578125,82.7300033569336,105.23999786376953,177.72000122070312\n2016-04-04,33.7400016784668,25.399999618530273,114.87000274658203,44.52000045776367,56.43000030517578,110.2699966430664,23.979999542236328,31.15999984741211,44.650001525878906,60.61000061035156,18.350934982299805,118.87999725341797,44.529998779296875,49.599998474121094,38.470001220703125,33.16999816894531,48.16999816894531,54.060001373291016,206.25,130.75999450683594,82.7300033569336,105.26000213623047,177.1199951171875\n2016-04-05,33.08000183105469,24.799999237060547,114.98999786376953,43.560001373291016,55.31999969482422,110.70999908447266,23.459999084472656,30.540000915527344,44.369998931884766,60.20000076293945,18.09098243713379,119.26000213623047,44.099998474121094,48.66999816894531,37.63999938964844,32.41999816894531,47.279998779296875,53.0099983215332,204.19000244140625,132.19000244140625,82.87999725341797,105.41000366210938,175.82000732421875\n2016-04-06,33.47999954223633,25.149999618530273,114.69000244140625,44.279998779296875,56.220001220703125,110.47000122070312,23.81999969482422,30.979999542236328,44.880001068115234,61.5,18.188465118408203,119.16000366210938,44.529998779296875,48.61000061035156,38.36000061035156,33.029998779296875,48.029998779296875,53.91999816894531,206.4199981689453,131.22999572753906,82.83999633789062,105.4000015258789,177.0399932861328\n2016-04-07,32.810001373291016,24.600000381469727,115.08999633789062,44.040000915527344,55.400001525878906,111.04000091552734,23.3700008392334,30.520000457763672,44.22999954223633,61.13999938964844,17.847278594970703,119.4800033569336,43.88999938964844,48.59000015258789,37.61000061035156,32.400001525878906,47.150001525878906,53.36000061035156,203.9499969482422,132.85000610351562,83.11000061035156,105.41000366210938,175.2899932861328\n2016-04-08,33.380001068115234,25.020000457763672,114.86000061035156,45.31999969482422,56.459999084472656,110.87000274658203,23.75,31.059999465942383,44.52000045776367,62.369998931884766,17.91226577758789,119.20999908447266,43.88999938964844,48.849998474121094,37.959999084472656,32.81999969482422,47.97999954223633,54.470001220703125,204.5,132.00999450683594,83.04000091552734,105.51000213623047,175.66000366210938\n2016-04-11,33.810001373291016,25.110000610351562,114.56999969482422,45.040000915527344,56.4900016784668,110.8499984741211,23.760000228881836,31.219999313354492,44.720001220703125,62.11000061035156,17.98537826538086,119.19999694824219,43.77000045776367,48.63999938964844,38.04999923706055,33.209999084472656,48.04999923706055,54.36000061035156,204.02000427246094,131.83999633789062,83.02999877929688,105.51000213623047,175.44000244140625\n2016-04-12,34.33000183105469,25.43000030517578,114.08999633789062,46.08000183105469,57.33000183105469,110.41000366210938,24.06999969482422,31.719999313354492,45.34000015258789,63.959999084472656,18.21283531188965,118.7300033569336,44.06999969482422,48.97999954223633,38.90999984741211,33.66999816894531,48.599998474121094,55.4900016784668,205.9199981689453,130.92999267578125,82.9000015258789,105.47000122070312,177.08999633789062\n2016-04-13,34.939998626708984,25.739999771118164,114.19000244140625,47.36000061035156,58.2400016784668,110.48999786376953,24.530000686645508,32.119998931884766,45.790000915527344,64.26000213623047,18.627132415771484,119.13999938964844,44.52000045776367,48.68000030517578,39.54999923706055,34.9900016784668,49.16999816894531,56.72999954223633,208.0,131.38999938964844,82.94999694824219,105.44000244140625,178.9199981689453\n2016-04-14,34.77000045776367,25.829999923706055,113.91999816894531,47.560001373291016,58.43000030517578,110.2300033569336,24.540000915527344,32.08000183105469,45.81999969482422,64.41000366210938,18.667749404907227,119.05999755859375,44.5099983215332,48.619998931884766,39.84000015258789,34.91999816894531,49.18000030517578,56.900001525878906,208.00999450683594,130.75999450683594,82.87999725341797,105.48999786376953,179.11000061035156\n2016-04-15,34.56999969482422,25.799999237060547,114.33000183105469,47.119998931884766,58.29999923706055,110.55999755859375,24.479999542236328,31.979999542236328,46.029998779296875,63.540000915527344,18.60276222229004,119.55999755859375,44.34000015258789,48.88999938964844,39.9900016784668,34.47999954223633,49.04999923706055,56.72999954223633,207.77999877929688,131.8800048828125,83.06999969482422,105.52999877929688,178.67999267578125\n2016-04-18,34.72999954223633,26.09000015258789,114.30999755859375,47.47999954223633,58.79999923706055,110.44999694824219,24.670000076293945,32.2599983215332,46.2400016784668,64.58999633789062,18.740861892700195,119.69000244140625,44.529998779296875,49.08000183105469,40.400001525878906,34.70000076293945,49.52000045776367,57.25,209.24000549316406,131.30999755859375,83.04000091552734,105.58000183105469,179.77999877929688\n2016-04-19,35.2599983215332,26.760000228881836,114.51000213623047,48.20000076293945,59.81999969482422,110.2699966430664,25.100000381469727,32.84000015258789,47.22999954223633,65.87999725341797,18.976442337036133,119.91000366210938,44.279998779296875,49.15999984741211,40.959999084472656,35.119998931884766,50.43000030517578,57.97999954223633,209.89999389648438,130.89999389648438,83.08999633789062,105.58000183105469,180.32000732421875\n2016-04-20,35.099998474121094,26.780000686645508,114.02999877929688,48.47999954223633,59.869998931884766,109.70999908447266,25.06999969482422,32.7400016784668,47.09000015258789,66.47000122070312,19.122665405273438,119.58000183105469,44.369998931884766,47.93000030517578,40.91999816894531,34.720001220703125,50.33000183105469,58.189998626708984,210.10000610351562,129.4600067138672,82.86000061035156,105.52999877929688,180.75\n2016-04-21,34.75,26.670000076293945,113.88999938964844,48.47999954223633,59.5099983215332,109.52999877929688,24.940000534057617,32.5,46.880001068115234,66.08000183105469,18.952072143554688,119.52999877929688,44.209999084472656,46.93000030517578,40.68000030517578,34.47999954223633,49.939998626708984,57.900001525878906,208.97000122070312,128.69000244140625,82.76000213623047,105.56999969482422,179.6999969482422\n2016-04-22,34.540000915527344,26.530000686645508,113.81999969482422,48.84000015258789,59.540000915527344,109.41000366210938,24.889999389648438,32.540000915527344,47.209999084472656,67.04000091552734,19.130788803100586,119.66000366210938,43.439998626708984,47.349998474121094,40.58000183105469,34.349998474121094,49.84000015258789,58.09000015258789,208.97000122070312,128.36000061035156,82.7300033569336,105.55999755859375,179.89999389648438\n2016-04-25,34.31999969482422,26.399999618530273,113.69000244140625,48.52000045776367,59.2400016784668,109.29000091552734,24.8700008392334,32.41999816894531,47.04999923706055,66.29000091552734,19.09016990661621,119.37999725341797,43.45000076293945,47.439998626708984,40.54999923706055,33.939998626708984,49.66999816894531,57.790000915527344,208.61000061035156,127.83000183105469,82.62999725341797,105.51000213623047,179.5399932861328\n2016-04-26,34.689998626708984,26.420000076293945,113.63999938964844,48.31999969482422,59.45000076293945,109.05999755859375,24.920000076293945,32.70000076293945,47.43000030517578,67.3499984741211,19.21202278137207,119.33000183105469,43.2400016784668,47.5099983215332,40.70000076293945,34.13999938964844,49.970001220703125,57.77000045776367,208.9199981689453,127.25,82.51000213623047,105.52999877929688,179.63999938964844\n2016-04-27,34.900001525878906,26.56999969482422,114.33000183105469,48.279998779296875,59.4900016784668,109.66000366210938,25.100000381469727,32.779998779296875,47.83000183105469,68.62999725341797,19.244516372680664,120.08999633789062,43.040000915527344,48.20000076293945,40.060001373291016,34.38999938964844,50.2400016784668,57.4900016784668,209.35000610351562,128.52000427246094,82.76000213623047,105.62999725341797,180.25\n2016-04-28,34.540000915527344,26.3799991607666,114.93000030517578,46.08000183105469,58.68000030517578,110.04000091552734,24.860000610351562,32.65999984741211,47.380001068115234,67.61000061035156,19.04142951965332,120.19999694824219,42.5,48.130001068115234,40.060001373291016,34.06999969482422,49.9900016784668,55.97999954223633,207.4499969482422,129.0500030517578,82.91000366210938,105.68000030517578,178.1999969482422\n2016-04-29,34.38999938964844,26.229999542236328,114.87999725341797,45.68000030517578,58.43000030517578,110.0,24.75,32.619998931884766,47.099998474121094,67.5,18.93582534790039,120.33000183105469,42.130001068115234,48.41999816894531,39.95000076293945,33.529998779296875,49.86000061035156,55.529998779296875,206.3300018310547,129.3800048828125,82.97000122070312,105.62000274658203,177.58999633789062\n2016-05-02,34.29999923706055,26.530000686645508,114.5,46.52000045776367,58.97999954223633,109.5199966430664,25.010000228881836,32.79999923706055,47.27000045776367,67.43000030517578,19.106416702270508,119.8499984741211,42.439998626708984,48.810001373291016,40.16999816894531,33.470001220703125,50.27000045776367,56.36000061035156,207.97000122070312,127.81999969482422,82.66000366210938,105.51000213623047,178.6999969482422\n2016-05-03,33.33000183105469,26.040000915527344,114.55000305175781,46.08000183105469,58.0099983215332,110.16999816894531,24.56999969482422,32.099998474121094,46.4900016784668,65.83999633789062,18.862712860107422,120.05999755859375,42.04999923706055,48.77000045776367,39.540000915527344,32.65999984741211,49.2599983215332,55.59000015258789,206.16000366210938,129.42999267578125,82.88999938964844,105.58000183105469,177.3000030517578\n2016-05-04,32.790000915527344,25.709999084472656,114.68000030517578,45.68000030517578,57.34000015258789,110.37000274658203,24.290000915527344,31.600000381469727,46.02000045776367,64.88999938964844,18.716489791870117,119.86000061035156,41.91999816894531,49.34000015258789,38.97999954223633,32.25,48.689998626708984,54.939998626708984,205.00999450683594,130.13999938964844,82.91999816894531,105.5999984741211,176.32000732421875\n2016-05-05,32.779998779296875,25.549999237060547,115.05000305175781,45.91999816894531,57.220001220703125,110.66999816894531,24.1299991607666,31.579999923706055,45.790000915527344,65.41999816894531,18.70836639404297,120.0999984741211,41.939998626708984,49.150001525878906,39.060001373291016,32.29999923706055,48.45000076293945,55.189998626708984,204.97000122070312,131.00999450683594,83.06999969482422,105.6500015258789,176.44000244140625\n2016-05-06,32.83000183105469,25.729999542236328,114.6500015258789,46.15999984741211,57.380001068115234,110.41000366210938,24.229999542236328,31.65999984741211,46.15999984741211,65.2699966430664,18.789602279663086,119.83999633789062,42.25,48.83000183105469,38.93000030517578,32.11000061035156,48.63999938964844,55.29999923706055,205.72000122070312,130.4499969482422,83.02999877929688,105.58000183105469,177.33999633789062\n2016-05-09,32.40999984741211,25.81999969482422,114.72000122070312,46.119998931884766,57.2599983215332,110.62000274658203,24.18000030517578,31.440000534057617,45.599998474121094,64.31999969482422,18.740861892700195,119.72000122070312,42.25,49.11000061035156,38.75,31.6200008392334,48.529998779296875,55.20000076293945,205.88999938964844,130.86000061035156,83.08999633789062,105.66000366210938,176.97999572753906\n2016-05-10,33.029998779296875,26.09000015258789,115.06999969482422,47.279998779296875,58.08000183105469,110.5999984741211,24.469999313354492,31.719999313354492,46.36000061035156,65.44999694824219,19.008935928344727,119.91999816894531,42.79999923706055,49.15999984741211,39.45000076293945,32.349998474121094,49.0099983215332,56.33000183105469,208.4499969482422,130.8699951171875,83.08999633789062,105.69000244140625,179.1999969482422\n2016-05-11,32.95000076293945,25.860000610351562,115.05000305175781,46.400001525878906,57.58000183105469,110.7699966430664,24.329999923706055,31.639999389648438,46.20000076293945,65.6500015258789,18.805849075317383,120.05000305175781,42.4900016784668,49.34000015258789,39.130001068115234,31.809999465942383,48.75,55.650001525878906,206.5,131.61000061035156,83.11000061035156,105.68000030517578,177.3000030517578\n2016-05-12,32.86000061035156,25.610000610351562,114.97000122070312,46.7599983215332,57.560001373291016,110.47000122070312,24.260000228881836,31.579999923706055,46.400001525878906,65.83000183105469,18.81397247314453,119.80000305175781,42.369998931884766,49.630001068115234,39.0099983215332,31.75,48.599998474121094,55.790000915527344,206.55999755859375,131.00999450683594,83.12000274658203,105.63999938964844,177.4199981689453\n2016-05-13,32.27000045776367,25.450000762939453,115.25,46.119998931884766,56.970001220703125,110.88999938964844,23.920000076293945,31.280000686645508,45.95000076293945,64.98999786376953,18.586515426635742,120.0199966430664,42.209999084472656,49.38999938964844,38.47999954223633,31.239999771118164,48.099998474121094,55.08000183105469,204.75999450683594,132.27999877929688,83.20999908447266,105.58999633789062,175.47999572753906\n2016-05-16,32.65999984741211,25.6299991607666,115.12000274658203,46.7599983215332,57.650001525878906,110.48999786376953,24.170000076293945,31.700000762939453,46.7400016784668,66.08999633789062,18.683996200561523,119.62000274658203,42.79999923706055,49.45000076293945,39.040000915527344,31.850000381469727,48.689998626708984,55.72999954223633,206.77999877929688,131.13999938964844,83.02999877929688,105.5999984741211,177.25999450683594\n2016-05-17,32.5099983215332,25.350000381469727,115.19999694824219,46.439998626708984,57.22999954223633,110.33999633789062,23.90999984741211,31.65999984741211,46.5,66.4000015258789,18.578392028808594,119.58000183105469,42.369998931884766,48.61000061035156,38.959999084472656,31.65999984741211,48.29999923706055,55.47999954223633,204.85000610351562,131.36000061035156,82.97000122070312,105.48999786376953,175.55999755859375\n2016-05-18,32.189998626708984,25.34000015258789,114.19999694824219,46.47999954223633,57.25,109.44999694824219,23.8700008392334,32.0,45.790000915527344,65.76000213623047,18.903329849243164,118.55999755859375,42.45000076293945,47.70000076293945,38.56999969482422,31.40999984741211,48.459999084472656,55.2400016784668,204.91000366210938,129.49000549316406,82.58000183105469,105.36000061035156,175.6300048828125\n2016-05-19,31.889999389648438,25.100000381469727,114.1500015258789,46.15999984741211,56.84000015258789,109.55999755859375,23.780000686645508,31.760000228881836,45.95000076293945,65.7699966430664,18.724613189697266,118.83999633789062,42.220001220703125,48.18000030517578,38.31999969482422,31.239999771118164,48.15999984741211,54.869998931884766,204.1999969482422,130.0500030517578,82.66999816894531,105.38999938964844,174.67999267578125\n2016-05-20,32.209999084472656,25.309999465942383,114.08999633789062,46.47999954223633,57.310001373291016,109.62999725341797,24.059999465942383,31.899999618530273,46.279998779296875,66.16000366210938,18.854589462280273,118.91999816894531,42.72999954223633,48.290000915527344,38.56999969482422,31.639999389648438,48.599998474121094,55.25,205.49000549316406,130.14999389648438,82.66999816894531,105.4000015258789,174.75999450683594\n2016-05-23,32.150001525878906,25.18000030517578,114.1500015258789,46.279998779296875,57.119998931884766,109.69999694824219,23.940000534057617,31.799999237060547,46.81999969482422,65.98999786376953,18.838342666625977,118.91999816894531,42.650001525878906,47.86000061035156,38.349998474121094,31.56999969482422,48.47999954223633,55.15999984741211,205.2100067138672,130.44000244140625,82.69000244140625,105.37999725341797,174.77999877929688\n2016-05-24,32.47999954223633,25.600000381469727,114.04000091552734,46.63999938964844,57.95000076293945,109.5199966430664,24.399999618530273,32.63999938964844,47.130001068115234,66.31999969482422,19.122665405273438,118.72000122070312,43.45000076293945,48.34000015258789,38.59000015258789,32.18000030517578,49.380001068115234,55.45000076293945,207.8699951171875,129.86000061035156,82.6500015258789,105.30000305175781,176.86000061035156\n2016-05-25,32.869998931884766,25.850000381469727,114.12999725341797,46.959999084472656,58.560001373291016,109.47000122070312,24.639999389648438,33.040000915527344,47.709999084472656,67.37000274658203,19.32575225830078,118.93000030517578,43.75,48.20000076293945,38.939998626708984,32.77000045776367,49.93000030517578,55.880001068115234,209.27999877929688,129.3699951171875,82.62000274658203,105.38999938964844,178.27999877929688\n2016-05-26,33.09000015258789,26.079999923706055,114.45999908447266,46.91999816894531,58.720001220703125,109.80999755859375,24.850000381469727,32.939998626708984,47.20000076293945,67.08999633789062,19.21202278137207,119.2699966430664,43.88999938964844,48.75,39.04999923706055,32.650001525878906,50.099998474121094,55.88999938964844,209.33999633789062,130.0399932861328,82.76000213623047,105.48999786376953,178.0800018310547\n2016-05-27,33.08000183105469,26.0,114.30999755859375,46.79999923706055,58.65999984741211,109.5999984741211,24.75,32.81999969482422,47.18000030517578,67.12999725341797,19.341999053955078,119.18000030517578,44.099998474121094,48.83000183105469,39.09000015258789,32.84000015258789,49.970001220703125,55.84000015258789,210.24000549316406,129.85000610351562,82.7300033569336,105.41000366210938,178.5\n2016-05-31,33.119998931884766,25.93000030517578,114.13999938964844,47.15999984741211,58.380001068115234,109.7300033569336,24.700000762939453,32.2400016784668,46.939998626708984,66.87000274658203,19.293256759643555,119.38999938964844,44.189998626708984,49.150001525878906,39.08000183105469,33.650001525878906,49.61000061035156,56.119998931884766,209.83999633789062,130.16000366210938,82.80000305175781,105.5,177.64999389648438\n2016-06-01,33.099998474121094,25.959999084472656,113.93000030517578,47.119998931884766,58.33000183105469,109.52999877929688,24.690000534057617,32.060001373291016,47.0,66.88999938964844,19.33387565612793,119.13999938964844,44.08000183105469,49.279998779296875,39.04999923706055,33.439998626708984,49.540000915527344,56.040000915527344,210.27000427246094,130.4199981689453,82.66000366210938,105.36000061035156,177.72999572753906\n2016-06-02,33.369998931884766,26.0,114.31999969482422,46.720001220703125,58.33000183105469,109.87000274658203,24.739999771118164,32.20000076293945,47.2599983215332,66.80000305175781,19.374492645263672,119.37999725341797,44.040000915527344,49.29999923706055,38.91999816894531,33.72999954223633,49.68000030517578,55.869998931884766,210.91000366210938,131.36000061035156,82.81999969482422,105.3499984741211,178.27999877929688\n2016-06-03,33.880001068115234,26.1200008392334,115.05999755859375,46.91999816894531,58.709999084472656,110.88999938964844,24.860000610351562,32.540000915527344,47.65999984741211,66.54000091552734,19.09829330444336,120.33999633789062,43.939998626708984,50.08000183105469,39.5,33.77000045776367,50.0099983215332,56.369998931884766,210.27999877929688,133.22999572753906,83.33999633789062,105.55999755859375,178.05999755859375\n2016-06-06,34.2400016784668,26.15999984741211,115.19000244140625,47.400001525878906,59.040000915527344,110.5999984741211,24.950000762939453,32.52000045776367,48.150001525878906,68.01000213623047,19.21202278137207,120.05000305175781,44.02000045776367,50.0099983215332,39.939998626708984,34.20000076293945,50.13999938964844,57.02000045776367,211.35000610351562,132.24000549316406,83.20999908447266,105.5199966430664,179.17999267578125\n2016-06-07,34.54999923706055,26.469999313354492,115.5,47.720001220703125,59.470001220703125,110.76000213623047,25.139999389648438,32.70000076293945,48.16999816894531,69.55000305175781,19.171405792236328,120.2300033569336,44.20000076293945,49.970001220703125,40.2400016784668,34.63999938964844,50.4900016784668,57.41999816894531,211.67999267578125,132.55999755859375,83.22000122070312,105.5999984741211,179.3800048828125\n2016-06-08,34.79999923706055,26.489999771118164,115.7699966430664,48.0,59.59000015258789,110.88999938964844,25.139999389648438,32.779998779296875,48.45000076293945,69.38999938964844,19.187652587890625,120.62999725341797,44.290000915527344,50.27000045776367,40.43000030517578,34.7400016784668,50.560001373291016,57.7400016784668,212.3699951171875,133.27000427246094,83.31999969482422,105.5999984741211,180.05999755859375\n2016-06-09,34.400001525878906,26.010000228881836,115.80999755859375,47.439998626708984,58.86000061035156,111.05999755859375,24.719999313354492,32.439998626708984,48.099998474121094,68.86000061035156,19.04955291748047,120.80000305175781,44.29999923706055,50.70000076293945,40.0,34.540000915527344,49.83000183105469,57.15999984741211,212.0800018310547,134.1300048828125,83.4000015258789,105.63999938964844,179.8800048828125\n2016-06-10,33.529998779296875,25.149999618530273,115.80999755859375,46.599998474121094,57.150001525878906,111.44999694824219,23.93000030517578,31.260000228881836,47.7400016784668,67.37000274658203,18.81397247314453,120.94000244140625,43.959999084472656,50.56999969482422,39.2400016784668,33.61000061035156,48.13999938964844,56.15999984741211,210.07000732421875,134.77999877929688,83.4800033569336,105.69000244140625,178.7100067138672\n2016-06-13,33.060001373291016,24.75,115.66000366210938,45.7599983215332,56.31999969482422,111.66999816894531,23.549999237060547,30.860000610351562,47.209999084472656,67.16999816894531,18.683996200561523,120.76000213623047,43.470001220703125,50.5099983215332,38.7599983215332,32.900001525878906,47.36000061035156,55.20000076293945,208.4499969482422,135.3800048828125,83.5,105.69000244140625,177.36000061035156\n2016-06-14,32.95000076293945,24.459999084472656,115.37000274658203,45.560001373291016,55.41999816894531,111.63999938964844,23.010000228881836,30.139999389648438,46.86000061035156,67.12999725341797,18.407798767089844,120.48999786376953,43.56999969482422,50.779998779296875,38.470001220703125,32.9900016784668,45.56999969482422,54.45000076293945,208.0399932861328,135.27999877929688,83.48999786376953,105.6500015258789,176.80999755859375\n2016-06-15,33.29999923706055,24.540000915527344,115.91000366210938,46.0,55.790000915527344,111.9800033569336,23.190000534057617,30.31999969482422,47.06999969482422,66.97000122070312,18.43216896057129,120.94000244140625,43.459999084472656,50.459999084472656,38.4900016784668,33.040000915527344,45.86000061035156,54.84000015258789,207.75,135.8000030517578,83.68000030517578,105.77999877929688,176.57000732421875\n2016-06-16,33.18000030517578,24.690000534057617,115.68000030517578,45.79999923706055,55.90999984741211,112.0999984741211,23.329999923706055,30.540000915527344,47.22999954223633,66.6500015258789,18.48090934753418,121.12000274658203,43.54999923706055,50.779998779296875,38.2599983215332,32.95000076293945,46.08000183105469,54.5,208.3699951171875,136.4600067138672,83.7699966430664,105.76000213623047,177.4600067138672\n2016-06-17,33.27000045776367,24.93000030517578,115.38999938964844,45.720001220703125,56.459999084472656,111.72000122070312,23.639999389648438,31.200000762939453,47.20000076293945,66.88999938964844,18.3671817779541,120.76000213623047,43.04999923706055,50.54999923706055,38.459999084472656,32.810001373291016,46.869998931884766,54.5099983215332,206.52000427246094,135.61000061035156,83.6500015258789,105.73999786376953,176.52000427246094\n2016-06-20,33.86000061035156,25.530000686645508,115.05999755859375,46.7599983215332,57.86000061035156,111.23999786376953,24.209999084472656,32.459999084472656,47.470001220703125,67.47000122070312,18.47278594970703,120.61000061035156,43.22999954223633,50.36000061035156,39.29999923706055,33.38999938964844,48.13999938964844,55.689998626708984,207.85000610351562,134.16000366210938,83.45999908447266,105.7300033569336,177.8000030517578\n2016-06-21,34.119998931884766,25.739999771118164,114.70999908447266,47.08000183105469,58.33000183105469,110.98999786376953,24.450000762939453,32.779998779296875,47.34000015258789,68.2699966430664,18.578392028808594,120.5,43.529998779296875,50.43000030517578,39.45000076293945,33.47999954223633,48.599998474121094,56.040000915527344,208.44000244140625,133.5399932861328,83.3499984741211,105.7300033569336,178.05999755859375\n2016-06-22,33.939998626708984,25.219999313354492,115.0199966430664,46.279998779296875,57.119998931884766,111.20999908447266,23.81999969482422,32.220001220703125,47.38999938964844,67.88999938964844,18.562145233154297,120.72000122070312,43.380001068115234,50.189998626708984,38.900001525878906,33.7599983215332,48.619998931884766,55.869998931884766,208.10000610351562,133.75999450683594,83.37999725341797,105.76000213623047,177.57000732421875\n2016-06-23,34.7599983215332,26.040000915527344,115.05999755859375,47.31999969482422,58.70000076293945,110.68000030517578,24.700000762939453,33.099998474121094,48.119998931884766,69.01000213623047,18.952072143554688,120.5999984741211,43.970001220703125,50.33000183105469,39.849998474121094,34.58000183105469,50.13999938964844,57.040000915527344,210.80999755859375,132.22999572753906,83.2300033569336,105.73999786376953,179.80999755859375\n2016-06-24,32.650001525878906,23.489999771118164,115.77999877929688,45.36000061035156,53.65999984741211,112.20999908447266,21.899999618530273,29.139999389648438,46.02000045776367,66.77999877929688,17.936635971069336,121.16999816894531,42.279998779296875,50.40999984741211,37.790000915527344,32.4900016784668,44.47999954223633,54.34000015258789,203.24000549316406,135.77999877929688,83.69999694824219,105.86000061035156,173.6199951171875\n2016-06-27,32.22999954223633,22.920000076293945,116.12000274658203,45.119998931884766,52.630001068115234,113.18000030517578,21.389999389648438,27.979999542236328,44.470001220703125,64.63999938964844,17.42485809326172,121.68000030517578,41.43000030517578,51.029998779296875,37.0,32.380001068115234,43.31999969482422,53.81999969482422,199.60000610351562,139.1699981689453,84.12000274658203,105.79000091552734,171.1999969482422\n2016-06-28,33.18000030517578,23.389999389648438,116.5199966430664,45.79999923706055,54.0099983215332,113.16000366210938,22.040000915527344,29.18000030517578,44.849998474121094,66.44000244140625,17.87164878845215,122.3499984741211,42.25,51.220001220703125,37.95000076293945,33.15999984741211,44.7400016784668,54.93000030517578,203.1999969482422,139.4600067138672,84.22000122070312,105.88999938964844,173.82000732421875\n2016-06-29,34.02000045776367,23.709999084472656,116.44999694824219,46.400001525878906,55.0,112.69999694824219,22.43000030517578,29.940000534057617,45.61000061035156,67.69999694824219,18.277822494506836,122.30999755859375,42.900001525878906,51.36000061035156,38.540000915527344,33.7599983215332,45.650001525878906,55.66999816894531,206.66000366210938,138.38999938964844,84.19000244140625,105.94000244140625,176.63999938964844\n2016-06-30,34.36000061035156,24.049999237060547,116.66999816894531,46.0,55.81999969482422,112.94999694824219,22.8700008392334,30.739999771118164,46.34000015258789,68.23999786376953,18.570268630981445,122.73999786376953,43.369998931884766,52.470001220703125,39.20000076293945,34.220001220703125,46.65999984741211,55.72999954223633,209.47999572753906,138.89999389648438,84.30000305175781,106.08999633789062,179.0\n2016-07-01,34.689998626708984,24.1200008392334,117.05999755859375,45.91999816894531,55.81999969482422,113.08999633789062,22.889999389648438,30.739999771118164,46.36000061035156,68.5999984741211,18.47278594970703,123.05000305175781,43.470001220703125,52.47999954223633,39.310001373291016,34.47999954223633,46.720001220703125,55.790000915527344,209.9199981689453,140.57000732421875,84.37000274658203,106.0,179.30999755859375"
  },
  {
    "path": "Tests/TestData/symbol-properties/symbol-properties-database.csv",
    "content": "market,symbol,type,description,quote_currency,contract_multiplier,minimum_price_variation,lot_size,market_ticker,minimum_order_size,price_magnifier,strike_multiplier\n\n#\n# Use # signs for comments\n#\n\n# Deliberately putting AU200AUD oanda first to test that the first market is used for wilcard entries \n# (to deterministically get market) after a reload of the database\n\noanda,AU200AUD,cfd,Australia 200,AUD,1,0.1,0.1\n\nfxcm,AU200AUD,cfd,S&P/ASX index of Australian listed shares,USD,0.1,0.1,1\n"
  },
  {
    "path": "Tests/TestData/td_sequential_test_data.csv",
    "content": "Date,Open,High,Low,Close,Volume,TDS\n01/01/2023 08:29,100,101,99,99,800000,0\n01/01/2023 08:30,100,101,99,106,600000,0\n01/01/2023 09:01,106,100,97,105,650000,0\n01/01/2023 09:05,105,98,95,103,700000,0\n01/01/2023 09:10,102,96,93,102,750000,0\n01/01/2023 09:30,100,101,99,99,800000,1\n01/01/2023 09:31,98,100,97,97,850000,1\n01/01/2023 09:32,96,98,95,95,900000,1\n01/01/2023 09:33,94,96,93,93,950000,1\n01/01/2023 09:34,92,94,91,91,1000000,1\n01/01/2023 09:35,90,92,89,89,1050000,1\n01/01/2023 09:36,88,90,87,87,1100000,1\n01/01/2023 09:37,86,88,85,85,1150000,1\n01/01/2023 09:38,84,86,83,83,1200000,5\n01/01/2023 09:39,85,87,84,84,1250000,3\n01/01/2023 09:40,83,85,82,82,1300000,3\n01/01/2023 09:41,81,83,80,80,1350000,3\n01/01/2023 09:42,79,81,78,78,1400000,3\n01/01/2023 09:43,77,79,76,76,1450000,3\n01/01/2023 09:44,75,77,74,74,1500000,3\n01/01/2023 09:45,73,75,72,72,1550000,3\n01/01/2023 09:46,71,73,70,70,1600000,3\n01/01/2023 09:47,69,71,68,68,1650000,3\n01/01/2023 09:48,67,69,66,66,1700000,3\n01/01/2023 09:49,65,67,64,64,1750000,3\n01/01/2023 09:50,63,65,62,62,1800000,3"
  },
  {
    "path": "Tests/TestData/test.csv",
    "content": "1722556800,1676500,1676500,1676500,1676500,,,20000\n1722643200,1676200,1676200,1676200,1676200,,,300\n1722729600,1675700,1675700,1675700,1675700,,,600\n1722816000,1675700,1676200,1675700,1676200,,,1000"
  },
  {
    "path": "Tests/TestData/test_cash_equity.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfDecimal xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <decimal>100000</decimal>\n  <decimal>100000</decimal>\n  <decimal>100100</decimal>\n  <decimal>100150</decimal>\n  <decimal>100100.0</decimal>\n  <decimal>100000.0</decimal>\n  <decimal>99950.0</decimal>\n  <decimal>100000.0</decimal>\n  <decimal>100100.0</decimal>\n  <decimal>100150.0</decimal>\n  <decimal>100100.0</decimal>\n  <decimal>100000.0</decimal>\n  <decimal>99950.0</decimal>\n  <decimal>99950.0</decimal>\n</ArrayOfDecimal>"
  },
  {
    "path": "Tests/TestData/test_cash_fills.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfOrderEvent xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <OrderEvent>\n    <OrderId>1</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>1</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>2</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>2</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>3</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>3</FillPrice>\n    <FillQuantity>-100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>4</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>4</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>5</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>5</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>6</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>6</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>7</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>7</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>8</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>8</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>9</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>9</FillPrice>\n    <FillQuantity>-100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>10</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>10</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>11</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>11</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>12</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>12</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>13</OrderId>\n    <Symbol>CASH</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>12</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n</ArrayOfOrderEvent>"
  },
  {
    "path": "Tests/TestData/test_forex_equity.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfDecimal xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <decimal>100000</decimal>\n  <decimal>100000</decimal>\n  <decimal>100,033.33</decimal>\n  <decimal>100,037.50</decimal>\n  <decimal>100,020.00</decimal>\n  <decimal>100,000.00</decimal>\n  <decimal>99,992.86</decimal>\n  <decimal>100,000.00</decimal>\n  <decimal>100,011.11</decimal>\n  <decimal>100,015.00</decimal>\n  <decimal>100,009.09</decimal>\n  <decimal>100,000.00</decimal>\n  <decimal>99,996.15</decimal>\n  <decimal>100,000.00</decimal>\n</ArrayOfDecimal>"
  },
  {
    "path": "Tests/TestData/test_forex_fills.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfOrderEvent xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <OrderEvent>\n    <OrderId>1</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>1</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>2</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>2</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>3</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>3</FillPrice>\n    <FillQuantity>-100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>4</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>4</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>5</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>5</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>6</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>6</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>7</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>7</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>8</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>8</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>9</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>9</FillPrice>\n    <FillQuantity>-100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>10</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>10</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>11</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>11</FillPrice>\n    <FillQuantity>50</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>12</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>12</FillPrice>\n    <FillQuantity>100</FillQuantity>\n    <Message />\n  </OrderEvent>\n  <OrderEvent>\n    <OrderId>13</OrderId>\n    <Symbol>MCHJWB</Symbol>\n    <Status>Filled</Status>\n    <FillPrice>13</FillPrice>\n    <FillQuantity>-50</FillQuantity>\n    <Message />\n  </OrderEvent>\n</ArrayOfOrderEvent>"
  },
  {
    "path": "Tests/TestData/test_forex_fills_jwb_quantity.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfDecimal xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <decimal>0</decimal>\n  <decimal>-100</decimal>\n  <decimal>0</decimal>\n  <decimal>300</decimal>\n  <decimal>500</decimal>\n  <decimal>250</decimal>\n  <decimal>-350</decimal>\n  <decimal>-700</decimal>\n  <decimal>-300</decimal>\n  <decimal>600</decimal>\n  <decimal>1100</decimal>\n  <decimal>550</decimal>\n  <decimal>-650</decimal>\n  <decimal>0</decimal>\n</ArrayOfDecimal>"
  },
  {
    "path": "Tests/TestData/test_forex_fills_mch_quantity.xml",
    "content": "<?xml version=\"1.0\"?>\n<ArrayOfDecimal xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <decimal>0</decimal>\n  <decimal>100</decimal>\n  <decimal>50</decimal>\n  <decimal>-50</decimal>\n  <decimal>-100</decimal>\n  <decimal>-50</decimal>\n  <decimal>50</decimal>\n  <decimal>100</decimal>\n  <decimal>50</decimal>\n  <decimal>-50</decimal>\n  <decimal>-100</decimal>\n  <decimal>-50</decimal>\n  <decimal>50</decimal>\n  <decimal>0</decimal>\n</ArrayOfDecimal>"
  },
  {
    "path": "Tests/TestData/test_report_data.json",
    "content": "{\n    \"RollingWindow\": {},\n    \"AlphaRuntimeStatistics\": {},\n    \"Charts\": {\n        \"Benchmark\": {\n            \"Name\": \"Benchmark\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"Benchmark\": {\n                    \"Name\": \"Benchmark\",\n                    \"Unit\": \"$\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1609736400, \"y\": 366.2371 },\n                        { \"x\": 1609822800, \"y\": 361.2511 },\n                        { \"x\": 1609909200, \"y\": 363.7392 }\n                    ],\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                }\n            }\n        },\n        \"Drawdown\": {\n            \"Name\": \"Drawdown\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"Equity Drawdown\": {\n                    \"Name\": \"Equity Drawdown\",\n                    \"Unit\": \"%\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1609736400, \"y\": 0.0 },\n                        { \"x\": 1609822800, \"y\": 0.0 },\n                        { \"x\": 1609909200, \"y\": -0.01 }\n                    ],\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                }\n            }\n        },\n        \"Capacity\": {\n            \"Name\": \"Capacity\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"Strategy Capacity\": {\n                    \"Name\": \"Strategy Capacity\",\n                    \"Unit\": \"$\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1609736400, \"y\": 0.0 },\n                        { \"x\": 1609822800, \"y\": 0.0 },\n                        { \"x\": 1609909200, \"y\": 0.0 }\n                    ],\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                }\n            }\n        },\n        \"Strategy Equity\": {\n            \"Name\": \"Strategy Equity\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"Equity\": {\n                    \"Name\": \"Equity\",\n                    \"Unit\": \"$\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1609736400, \"y\": 1000000.0 },\n                        { \"x\": 1609748160, \"y\": 1000000.0 },\n                        { \"x\": 1609748820, \"y\": 1000000.0 }\n                    ],\n                    \"SeriesType\": 2,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                },\n                \"Daily Performance\": {\n                    \"Name\": \"Daily Performance\",\n                    \"Unit\": \"%\",\n                    \"Index\": 1,\n                    \"Values\": [\n                        { \"x\": 1609736400, \"y\": 0.0 },\n                        { \"x\": 1609822800, \"y\": 0.0 },\n                        { \"x\": 1609909200, \"y\": -0.013 }\n                    ],\n                    \"SeriesType\": 3,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                }\n            }\n        },\n        \"Exposure\": {\n            \"Name\": \"Exposure\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"Equity\": {\n                    \"Name\": \"Equity\",\n                    \"Unit\": \"\",\n                    \"Index\": 0,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.019 },\n                        { \"x\": 1609909200, \"y\": 0.014 },\n                        { \"x\": 1609995600, \"y\": 0.013 }\n                    ]\n                },\n                \"Option\": {\n                    \"Name\": \"Option\",\n                    \"Unit\": \"\",\n                    \"Index\": 1,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.020 },\n                        { \"x\": 1609909200, \"y\": 0.004 },\n                        { \"x\": 1609995600, \"y\": 0.011 }\n                    ]\n                },\n                \"Commodity\": {\n                    \"Name\": \"Commodity\",\n                    \"Unit\": \"\",\n                    \"Index\": 2,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.016 },\n                        { \"x\": 1609909200, \"y\": 0.012 },\n                        { \"x\": 1609995600, \"y\": 0.010 }\n                    ]\n                },\n                \"Forex\": {\n                    \"Name\": \"Forex\",\n                    \"Unit\": \"\",\n                    \"Index\": 3,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.012 },\n                        { \"x\": 1609909200, \"y\": 0.019 },\n                        { \"x\": 1609995600, \"y\": 0.020 }\n                    ]\n                },\n                \"Future\": {\n                    \"Name\": \"Future\",\n                    \"Unit\": \"\",\n                    \"Index\": 4,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.013 },\n                        { \"x\": 1609909200, \"y\": 0.015 },\n                        { \"x\": 1609995600, \"y\": 0.017 }\n                    ]\n                },\n                \"Cfd\": {\n                    \"Name\": \"Cfd\",\n                    \"Unit\": \"\",\n                    \"Index\": 5,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.014 },\n                        { \"x\": 1609909200, \"y\": 0.015 },\n                        { \"x\": 1609995600, \"y\": 0.014 }\n                    ]\n                },\n                \"Crypto\": {\n                    \"Name\": \"Crypto\",\n                    \"Unit\": \"\",\n                    \"Index\": 6,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.013 },\n                        { \"x\": 1609909200, \"y\": 0.015 },\n                        { \"x\": 1609995600, \"y\": 0.017 }\n                    ]\n                },\n                \"FutureOption\": {\n                    \"Name\": \"FutureOption\",\n                    \"Unit\": \"\",\n                    \"Index\": 7,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.022 },\n                        { \"x\": 1609909200, \"y\": 0.014 },\n                        { \"x\": 1609995600, \"y\": 0.020 }\n                    ]\n                },\n                \"IndexOption\": {\n                    \"Name\": \"IndexOption\",\n                    \"Unit\": \"\",\n                    \"Index\": 8,\n                    \"SeriesType\": 0,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\",\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 0.017 },\n                        { \"x\": 1609909200, \"y\": 0.015 },\n                        { \"x\": 1609995600, \"y\": 0.015 }\n                    ]\n                }\n            }\n        },\n        \"Assets Sales Volume\": {\n            \"Name\": \"Assets Sales Volume\",\n            \"ChartType\": 0,\n            \"Series\": {\n                \"VIX   210120C00010000\": {\n                    \"Name\": \"VIX   210120C00010000\",\n                    \"Unit\": \"$\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1609822800, \"y\": 1670.0 },\n                        { \"x\": 1609909200, \"y\": 1670.0 },\n                        { \"x\": 1609995600, \"y\": 1670.0 }\n                    ],\n                    \"SeriesType\": 7,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                },\n                \"VIX   210217C00010000\": {\n                    \"Name\": \"VIX   210217C00010000\",\n                    \"Unit\": \"$\",\n                    \"Index\": 0,\n                    \"Values\": [\n                        { \"x\": 1611291600, \"y\": 1490.0 },\n                        { \"x\": 1611378000, \"y\": 1490.0 },\n                        { \"x\": 1611464400, \"y\": 1490.0 }\n                    ],\n                    \"SeriesType\": 7,\n                    \"Color\": \"\",\n                    \"ScatterMarkerSymbol\": \"none\"\n                }\n            }\n        }\n    },\n    \"Orders\": {\n        \"1\": {\n            \"Type\": 0,\n            \"Id\": 1,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"1\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"BTCUSD\",\n                \"ID\": \"BTCUSD XJ\",\n                \"Permtick\": \"BTCUSD\"\n            },\n            \"Price\": 32843.35,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-24T05:00:00Z\",\n            \"CreatedTime\": \"2021-01-24T05:00:00Z\",\n            \"LastFillTime\": \"2021-01-24T05:00:00Z\",\n            \"Quantity\": 0.1,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 7,\n            \"Direction\": 0,\n            \"Value\": 3284.335,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 32840.47,\n                \"AskPrice\": 32843.35,\n                \"LastPrice\": 32841.91\n            },\n            \"IsMarketable\": true\n        },\n        \"2\": {\n            \"Type\": 0,\n            \"Id\": 2,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"2\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"EURUSD\",\n                \"ID\": \"EURUSD 8G\",\n                \"Permtick\": \"EURUSD\"\n            },\n            \"Price\": 1.21761,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-24T22:01:00Z\",\n            \"CreatedTime\": \"2021-01-24T22:01:00Z\",\n            \"LastFillTime\": \"2021-01-24T22:01:00Z\",\n            \"Quantity\": 4097282612.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 4,\n            \"Direction\": 0,\n            \"Value\": 4988892281.19732,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 1.21696,\n                \"AskPrice\": 1.21761,\n                \"LastPrice\": 1.217285\n            },\n            \"IsMarketable\": true\n        },\n        \"3\": {\n            \"Type\": 0,\n            \"Id\": 3,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"3\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"ES19H21\",\n                \"ID\": \"ES XMXYBDF3IXHD\",\n                \"Permtick\": \"ES19H21\"\n            },\n            \"Price\": 3838.75,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-24T23:01:00Z\",\n            \"CreatedTime\": \"2021-01-24T23:01:00Z\",\n            \"LastFillTime\": \"2021-01-24T23:01:00Z\",\n            \"Quantity\": 1.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 5,\n            \"Direction\": 0,\n            \"Value\": 3838.75,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 3838.5,\n                \"AskPrice\": 3838.75,\n                \"LastPrice\": 3838.625\n            },\n            \"IsMarketable\": true\n        },\n        \"4\": {\n            \"Type\": 0,\n            \"Id\": 4,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"4\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"DE30EUR\",\n                \"ID\": \"DE30EUR 8I\",\n                \"Permtick\": \"DE30EUR\"\n            },\n            \"Price\": 13882.3,\n            \"PriceCurrency\": \"EUR\",\n            \"Time\": \"2021-01-25T00:16:00Z\",\n            \"CreatedTime\": \"2021-01-25T00:16:00Z\",\n            \"LastFillTime\": \"2021-01-25T00:16:00Z\",\n            \"Quantity\": 3.0,\n            \"Status\": 3,\n            \"Tag\": \"Warning: fill at stale price (01/22/2021 22:00:00 Europe/Berlin)\",\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 6,\n            \"Direction\": 0,\n            \"Value\": 41646.9,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 13878.8,\n                \"AskPrice\": 13882.3,\n                \"LastPrice\": 13880.55\n            },\n            \"IsMarketable\": true\n        },\n        \"5\": {\n            \"Type\": 4,\n            \"Id\": 5,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"5\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"SPX   231215C03825000\",\n                \"ID\": \"SPX YEBOD23D7ZOU|SPX 31\",\n                \"Permtick\": \"SPX   231215C03825000\",\n                \"Underlying\": {\n                    \"Value\": \"SPX\",\n                    \"ID\": \"SPX 31\",\n                    \"Permtick\": \"SPX\"\n                }\n            },\n            \"Price\": 515.3,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-25T12:30:00Z\",\n            \"CreatedTime\": \"2021-01-25T12:30:00Z\",\n            \"LastFillTime\": \"2021-01-25T15:31:00Z\",\n            \"Quantity\": 1.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 10,\n            \"Direction\": 0,\n            \"Value\": 515.3,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 480.5000,\n                \"AskPrice\": 525.5000,\n                \"LastPrice\": 503.0000\n            },\n            \"IsMarketable\": false\n        },\n        \"6\": {\n            \"Type\": 0,\n            \"Id\": 6,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"6\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"SPY\",\n                \"ID\": \"SPY R735QTJ8XC9X\",\n                \"Permtick\": \"SPY\"\n            },\n            \"Price\": 384.02,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-25T14:31:00Z\",\n            \"CreatedTime\": \"2021-01-25T14:31:00Z\",\n            \"LastFillTime\": \"2021-01-25T14:31:00Z\",\n            \"Quantity\": 1.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 1,\n            \"Direction\": 0,\n            \"Value\": 384.02,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 384.0000,\n                \"AskPrice\": 384.0200,\n                \"LastPrice\": 384.0300\n            },\n            \"IsMarketable\": true\n        },\n        \"7\": {\n            \"Type\": 0,\n            \"Id\": 7,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"7\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"SPY   210716P00385000\",\n                \"ID\": \"SPY 31PB4NZP2BWX2|SPY R735QTJ8XC9X\",\n                \"Permtick\": \"SPY   210716P00385000\",\n                \"Underlying\": {\n                    \"Value\": \"SPY\",\n                    \"ID\": \"SPY R735QTJ8XC9X\",\n                    \"Permtick\": \"SPY\"\n                }\n            },\n            \"Price\": 23.42,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2021-01-25T14:31:00Z\",\n            \"CreatedTime\": \"2021-01-25T14:31:00Z\",\n            \"LastFillTime\": \"2021-01-25T14:31:00Z\",\n            \"Quantity\": 2.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 2,\n            \"Direction\": 0,\n            \"Value\": 46.84,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 23.1300,\n                \"AskPrice\": 23.4200,\n                \"LastPrice\": 23.2750\n            },\n            \"IsMarketable\": true\n        },\n        \"8\": {\n            \"Type\": 0,\n            \"Id\": 8,\n            \"ContingentId\": 0,\n            \"BrokerId\": [\n                \"8\"\n            ],\n            \"Symbol\": {\n                \"Value\": \"OG    220328C01835000\",\n                \"ID\": \"OG XX67IKNPHUOW|GC XXZQX57AFQ8T\",\n                \"Permtick\": \"OG    220328C01835000\",\n                \"Underlying\": {\n                    \"Value\": \"GC27J22\",\n                    \"ID\": \"GC XXZQX57AFQ8T\",\n                    \"Permtick\": \"GC27J22\"\n                }\n            },\n            \"Price\": 49.0,\n            \"PriceCurrency\": \"USD\",\n            \"Time\": \"2022-01-02T23:01:00Z\",\n            \"CreatedTime\": \"2022-01-02T23:01:00Z\",\n            \"LastFillTime\": \"2022-01-02T23:01:00Z\",\n            \"Quantity\": 1.0,\n            \"Status\": 3,\n            \"Properties\": {\n                \"TimeInForce\": {}\n            },\n            \"SecurityType\": 8,\n            \"Direction\": 0,\n            \"Value\": 49.0,\n            \"OrderSubmissionData\": {\n                \"BidPrice\": 48.2,\n                \"AskPrice\": 49.0,\n                \"LastPrice\": 48.6\n            },\n            \"IsMarketable\": true\n        }\n    },\n    \"ProfitLoss\": {},\n    \"Statistics\": {\n        \"Total Orders\": \"7\",\n        \"Average Win\": \"11.29%\",\n        \"Average Loss\": \"-1.24%\",\n        \"Compounding Annual Return\": \"114.572%\",\n        \"Drawdown\": \"31.300%\",\n        \"Expectancy\": \"1.491\",\n        \"Net Profit\": \"361.374%\",\n        \"Sharpe Ratio\": \"2.034\",\n        \"Probabilistic Sharpe Ratio\": \"80.811%\",\n        \"Loss Rate\": \"75%\",\n        \"Win Rate\": \"25%\",\n        \"Profit-Loss Ratio\": \"9.12\",\n        \"Alpha\": \"0\",\n        \"Beta\": \"0\",\n        \"Annual Standard Deviation\": \"0.396\",\n        \"Annual Variance\": \"0.157\",\n        \"Information Ratio\": \"2.034\",\n        \"Tracking Error\": \"0.396\",\n        \"Treynor Ratio\": \"0\",\n        \"Total Fees\": \"$0.65\",\n        \"Estimated Strategy Capacity\": \"$0\",\n        \"Lowest Capacity Asset\": \"ETHBTC 2MN\"\n    },\n    \"RuntimeStatistics\": {}\n}\n"
  },
  {
    "path": "Tests/TestData/tp_datatest.csv",
    "content": "Date,Open,High,Low,Close,Adj Close,Volume,POCPrice,POCVolume,PH,PL,VA,VAH,VAL\n2020-01-02,135.000000,135.919998,134.770004,135.419998,124.142937,3148600,,,,,,,,\n2020-01-03,133.570007,134.860001,133.559998,134.339996,123.152855,2373700,,,,,,,,\n2020-01-06,133.419998,134.240005,133.199997,134.100006,122.932846,2425500,134.35,1,135.45,134.15,2.0999999999999996,135.45,134.15\n2020-01-07,133.690002,134.960007,133.399994,134.190002,123.015358,3090800,134.2,1,134.35,134.15,2.0999999999999996,134.35,134.15\n2020-01-08,134.509995,135.860001,133.919998,135.309998,124.042076,4346000,134.2,1,135.35,134.15,2.0999999999999996,135.35,134.15\n2020-01-09,135.740005,136.789993,135.309998,136.740005,125.353020,3730600,135.35,1,136.75,134.2,2.0999999999999996,136.75,134.2\n2020-01-10,137.000000,137.869995,136.309998,136.690002,125.307167,3255400,136.7,1,136.75,135.35,2.0999999999999996,136.75,135.35\n2020-01-13,135.479996,136.639999,135.070007,136.600006,125.224678,3531000,136.7,1,136.75,136.65,2.0999999999999996,136.75,136.65\n2020-01-14,136.279999,137.139999,135.550003,135.820007,124.509621,3681000,136.65,1,136.7,135.85,2.0999999999999996,136.7,135.85\n2020-01-15,136.000000,138.059998,135.710007,136.619995,125.242996,4045900,136.65,2,136.65,135.85,2.0999999999999996,136.65,135.85\n2020-01-16,137.320007,138.190002,137.009995,137.979996,126.489731,4320900,136.65,1,138.0,135.85,2.0999999999999996,138.0,135.85\n2020-01-17,136.539993,138.330002,136.160004,138.309998,126.792267,5623300,138.0,1,138.35,136.65,2.0999999999999996,138.35,136.65\n2020-01-21,137.809998,139.350006,137.600006,139.169998,127.580643,7244100,138.35,1,139.2,138.0,2.0999999999999996,139.2,138.0\n2020-01-22,143.320007,145.789993,142.550003,143.889999,131.907593,16470400,139.2,1,143.9,138.35,2.0999999999999996,143.9,138.35\n2020-01-23,144.199997,144.410004,142.149994,142.869995,130.972534,5657800,142.9,1,143.9,139.2,2.0999999999999996,143.9,139.2\n2020-01-24,143.389999,143.919998,140.460007,140.559998,128.854889,5580200,142.9,1,143.9,140.6,2.0999999999999996,143.9,140.6\n2020-01-27,138.500000,140.070007,138.100006,138.619995,127.076454,4166600,140.6,1,142.9,138.65,2.0999999999999996,142.9,138.65\n2020-01-28,139.500000,140.470001,138.750000,139.550003,127.929008,3451600,139.6,1,140.6,138.65,2.0999999999999996,140.6,138.65\n2020-01-29,139.169998,139.580002,137.600006,137.690002,126.223907,3053800,138.65,1,139.6,137.7,2.0999999999999996,139.6,137.7\n2020-01-30,136.759995,136.970001,134.970001,136.770004,125.380493,5057900,137.7,1,139.6,136.8,2.0999999999999996,139.6,136.8\n2020-01-31,142.899994,144.050003,140.789993,143.729996,131.760895,18994600,137.7,1,143.75,136.8,2.0999999999999996,143.75,136.8\n"
  },
  {
    "path": "Tests/TestData/vp_datatest.csv",
    "content": "Date,Open,High,Low,Close,Adj Close,Volume,POCPrice,POCVolume,PH,PL,VA,VAH,VAL\n2020-01-02,135.000000,135.919998,134.770004,135.419998,124.142937,3148600,,,,,,,,\n2020-01-03,133.570007,134.860001,133.559998,134.339996,123.152855,2373700,,,,,,,,\n2020-01-06,133.419998,134.240005,133.199997,134.100006,122.932846,2425500,135.45,3148600,135.45,134.15,5563460.0,135.45,134.15\n2020-01-07,133.690002,134.960007,133.399994,134.190002,123.015358,3090800,134.2,3090800,134.35,134.15,5523000.0,134.35,134.15\n2020-01-08,134.509995,135.860001,133.919998,135.309998,124.042076,4346000,135.35,4346000,135.35,134.15,6903610.0,135.35,134.2\n2020-01-09,135.740005,136.789993,135.309998,136.740005,125.353020,3730600,135.35,4346000,136.75,134.2,7817179.999999999,136.75,135.35\n2020-01-10,137.000000,137.869995,136.309998,136.690002,125.307167,3255400,135.35,4346000,136.75,135.35,7932399.999999999,136.75,135.35\n2020-01-13,135.479996,136.639999,135.070007,136.600006,125.224678,3531000,136.75,3730600,136.75,136.65,7361899.999999999,136.75,136.65\n2020-01-14,136.279999,137.139999,135.550003,135.820007,124.509621,3681000,135.85,3681000,136.7,135.85,7327180.0,136.7,135.85\n2020-01-15,136.000000,138.059998,135.710007,136.619995,125.242996,4045900,136.65,7576900,136.65,135.85,7880529.999999999,136.65,135.85\n2020-01-16,137.320007,138.190002,137.009995,137.979996,126.489731,4320900,138.0,4320900,138.0,135.85,8433460.0,138.0,135.85\n2020-01-17,136.539993,138.330002,136.160004,138.309998,126.792267,5623300,138.35,5623300,138.35,136.65,9793070.0,138.35,138.0\n2020-01-21,137.809998,139.350006,137.600006,139.169998,127.580643,7244100,139.2,7244100,139.2,138.0,12031810.0,139.2,138.35\n2020-01-22,143.320007,145.789993,142.550003,143.889999,131.907593,16470400,143.9,16470400,143.9,138.35,20536460.0,143.9,139.2\n2020-01-23,144.199997,144.410004,142.149994,142.869995,130.972534,5657800,143.9,16470400,143.9,139.2,20560610.0,143.9,142.9\n2020-01-24,143.389999,143.919998,140.460007,140.559998,128.854889,5580200,143.9,16470400,143.9,140.6,19395880.0,143.9,142.9\n2020-01-27,138.500000,140.070007,138.100006,138.619995,127.076454,4166600,142.9,5657800,142.9,138.65,10783220.0,142.9,140.6\n2020-01-28,139.500000,140.470001,138.750000,139.550003,127.929008,3451600,140.6,5580200,140.6,138.65,9238880.0,140.6,138.65\n2020-01-29,139.169998,139.580002,137.600006,137.690002,126.223907,3053800,138.65,4166600,139.6,137.7,7470399.999999999,139.6,138.65\n2020-01-30,136.759995,136.970001,134.970001,136.770004,125.380493,5057900,136.8,5057900,139.6,136.8,8094309.999999999,137.7,136.8\n2020-01-31,142.899994,144.050003,140.789993,143.729996,131.760895,18994600,143.75,18994600,143.75,136.8,18974410.0,143.75,143.75\n"
  },
  {
    "path": "Tests/TestExtensions.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Threading;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Provides extension methods to make test code easier to read/write\n    /// </summary>\n    public static class TestExtensions\n    {\n        /// <summary>\n        /// Calls <see cref=\"WaitHandle.WaitOne(int)\"/> on the specified <see cref=\"WaitHandle\"></see> and then\n        /// call <see cref=\"Assert.Fail(string)\"/> if <paramref name=\"wait\"/> was not set.\n        /// </summary>\n        /// <param name=\"wait\">The <see cref=\"WaitHandle\"/></param> instance to wait on\n        /// <param name=\"milliseconds\">The timeout, in milliseconds</param>\n        /// <param name=\"message\">The message to fail with, null to fail with no message</param>\n        /// <returns>True if the <see cref=\"WaitHandle\"/> was signaled; otherwise, the test fails.</returns>\n        public static bool WaitOneAssertFail(this WaitHandle wait, int milliseconds, string message = null)\n        {\n            if (!wait.WaitOne(milliseconds))\n            {\n                Assert.Fail(message);\n                return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Asserts that the two JObject instances are equal. This uses <see cref=\"JToken.DeepEquals\"/> wrapped w/ better failure messages\n        /// </summary>\n        /// <param name=\"expected\">The expected value</param>\n        /// <param name=\"actual\">The actual value</param>\n        /// <param name=\"property\">The property to assert</param>\n        public static void IsEqualTo(this JObject expected, JObject actual, string property)\n        {\n            var e = expected.SelectToken(property);\n            var a = actual.SelectToken(property);\n            Assert.IsTrue(JToken.DeepEquals(e, a), $\"{property}: Expected {e}. Actual {a}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/TestGlobals.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Util;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Configuration;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.UniverseSelection;\nusing QuantConnect.Tests.Common.Data.Fundamental;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.Tests\n{\n    /// <summary>\n    /// Global static class for some core providers used by various tests\n    /// </summary>\n    public static class TestGlobals\n    {\n        private static bool _initialized;\n\n        public static IDataProvider DataProvider\n            = Composer.Instance.GetExportedValueByTypeName<IDataProvider>(Config.Get(\"data-provider\", \"DefaultDataProvider\"));\n        public static IMapFileProvider MapFileProvider\n            = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"));\n        public static IFactorFileProvider FactorFileProvider\n            = Composer.Instance.GetExportedValueByTypeName<IFactorFileProvider>(Config.Get(\"factor-file-provider\", \"LocalDiskFactorFileProvider\"));\n\n        public static IDataCacheProvider DataCacheProvider = new ZipDataCacheProvider(DataProvider);\n        public static IHistoryProvider HistoryProvider\n            = Composer.Instance.GetExportedValueByTypeName<IHistoryProvider>(\"SubscriptionDataReaderHistoryProvider\");\n\n        /// <summary>\n        /// Initialize our providers, called by AssemblyInitialize.cs so all tests\n        /// can access initialized providers\n        /// </summary>\n        public static void Initialize()\n        {\n            lock (DataProvider)\n            {\n                if (_initialized)\n                {\n                    return;\n                }\n                _initialized = true;\n\n                var initializeParameters = new HistoryProviderInitializeParameters(null, null, DataProvider, DataCacheProvider,\n                    MapFileProvider, FactorFileProvider, (_) => { }, true, new DataPermissionManager(), null, new AlgorithmSettings());\n                try\n                {\n                    HistoryProvider.Initialize(initializeParameters);\n                }\n                catch\n                {\n                    // Already initialized\n                }\n                MapFileProvider.Initialize(DataProvider);\n                FactorFileProvider.Initialize(MapFileProvider, DataProvider);\n                FundamentalService.Initialize(DataProvider, new NullFundamentalDataProvider(), false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/TestProcess.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.IO;\nusing NUnit.Framework;\nusing System.Diagnostics;\nusing QuantConnect.Logging;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Tests\n{\n    internal static class TestProcess\n    {\n        // Update in config.json to specify the alternate path to python.exe\n        private static readonly string _pythonLocation = Config.Get(\"python-location\", \"python\");\n\n        public static void RunPythonProcess(string args, out Process process, int timeout = 1000 * 45)\n        {\n            RunProcess(_pythonLocation, args, out process, timeout);\n        }\n\n        public static void RunProcess(string targetProcess, string args, out Process process, int timeout = 1000 * 45)\n        {\n            Log.Trace($\"TestProcess.RunProcess(): running '{targetProcess}' args {args}\");\n\n            // Use ProcessStartInfo class\n            var startInfo = new ProcessStartInfo(targetProcess, args)\n            {\n                RedirectStandardOutput = true,\n                RedirectStandardError = true,\n                UseShellExecute = false,\n                WindowStyle = ProcessWindowStyle.Hidden,\n                CreateNoWindow = true,\n                WorkingDirectory = Directory.GetCurrentDirectory()\n            };\n\n            process = new Process\n            {\n                StartInfo = startInfo,\n            };\n\n            // real-time stream process output\n            process.OutputDataReceived += DebugLog;\n            process.ErrorDataReceived += DebugLog;\n\n            process.Start();\n            process.BeginErrorReadLine();\n            process.BeginOutputReadLine();\n\n            if (!process.WaitForExit(timeout))\n            {\n                process.Kill();\n                Assert.Fail($\"Timeout waiting for process to exit. Timeout: {timeout}ms\");\n            }\n\n            process.OutputDataReceived -= DebugLog;\n            process.ErrorDataReceived -= DebugLog;\n        }\n\n        private static void DebugLog(object sender, DataReceivedEventArgs data)\n        {\n            if (!string.IsNullOrEmpty(data.Data))\n            {\n                Log.Debug($\"ProcessOutput: {data.Data}\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/LeanDataReaderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox;\nusing QuantConnect.Util;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.Tests.ToolBox\n{\n    [TestFixture, Parallelizable(ParallelScope.Fixtures)]\n    public class LeanDataReaderTests\n    {\n        string _dataDirectory = \"../../../Data/\";\n        DateTime _fromDate = new DateTime(2013, 10, 7);\n        DateTime _toDate = new DateTime(2013, 10, 11);\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void LoadsEquity_Daily_SingleEntryZip()\n        {\n            var dataPath = LeanData.GenerateZipFilePath(Globals.DataFolder, Symbols.AAPL, DateTime.UtcNow, Resolution.Daily, TickType.Trade);\n            var leanDataReader = new LeanDataReader(dataPath);\n            var data = leanDataReader.Parse().ToList();\n\n            Assert.AreEqual(5849, data.Count);\n            Assert.IsTrue(data.All(baseData => baseData.Symbol == Symbols.AAPL && baseData is TradeBar));\n        }\n\n        #region futures\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void ReadsEntireZipFileEntries_OpenInterest()\n        {\n            var baseFuture = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, SecurityIdentifier.DefaultDate);\n            var filePath = LeanData.GenerateZipFilePath(Globals.DataFolder, baseFuture, new DateTime(2013, 10, 06), Resolution.Minute, TickType.OpenInterest);\n            var leanDataReader = new LeanDataReader(filePath);\n\n            var data = leanDataReader.Parse()\n                .ToList()\n                .GroupBy(baseData => baseData.Symbol)\n                .Select(grp => grp.ToList())\n                .OrderBy(list => list[0].Symbol)\n                .ToList();\n\n            Assert.AreEqual(5, data.Count);\n            Assert.IsTrue(data.All(kvp => kvp.Count == 1));\n\n            foreach (var dataForSymbol in data)\n            {\n                Assert.IsTrue(dataForSymbol[0] is OpenInterest);\n                Assert.IsFalse(dataForSymbol[0].Symbol.IsCanonical());\n                Assert.AreEqual(Futures.Indices.SP500EMini, dataForSymbol[0].Symbol.ID.Symbol);\n                Assert.AreNotEqual(0, dataForSymbol[0]);\n            }\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void ReadsEntireZipFileEntries_Trade()\n        {\n            var baseFuture = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, SecurityIdentifier.DefaultDate);\n            var filePath = LeanData.GenerateZipFilePath(Globals.DataFolder, baseFuture, new DateTime(2013, 10, 06), Resolution.Minute, TickType.Trade);\n            var leanDataReader = new LeanDataReader(filePath);\n\n            var data = leanDataReader.Parse()\n                .ToList()\n                .GroupBy(baseData => baseData.Symbol)\n                .Select(grp => grp.ToList())\n                .OrderBy(list => list[0].Symbol)\n                .ToList();\n\n            Assert.AreEqual(2, data.Count);\n\n            foreach (var dataForSymbol in data)\n            {\n                Assert.IsTrue(dataForSymbol[0] is TradeBar);\n                Assert.IsFalse(dataForSymbol[0].Symbol.IsCanonical());\n                Assert.AreEqual(Futures.Indices.SP500EMini, dataForSymbol[0].Symbol.ID.Symbol);\n            }\n\n            Assert.AreEqual(118, data[0].Count);\n            Assert.AreEqual(10, data[1].Count);\n        }\n\n        [Test, Parallelizable(ParallelScope.Self)]\n        public void ReadsEntireZipFileEntries_Quote()\n        {\n            var baseFuture = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, SecurityIdentifier.DefaultDate);\n            var filePath = LeanData.GenerateZipFilePath(Globals.DataFolder, baseFuture, new DateTime(2013, 10, 06), Resolution.Minute, TickType.Quote);\n            var leanDataReader = new LeanDataReader(filePath);\n\n            var data = leanDataReader.Parse()\n                .ToList()\n                .GroupBy(baseData => baseData.Symbol)\n                .Select(grp => grp.ToList())\n                .OrderBy(list => list[0].Symbol)\n                .ToList();\n\n            Assert.AreEqual(5, data.Count);\n\n            foreach (var dataForSymbol in data)\n            {\n                Assert.IsTrue(dataForSymbol[0] is QuoteBar);\n                Assert.IsFalse(dataForSymbol[0].Symbol.IsCanonical());\n                Assert.AreEqual(Futures.Indices.SP500EMini, dataForSymbol[0].Symbol.ID.Symbol);\n            }\n\n            Assert.AreEqual(10, data[0].Count);\n            Assert.AreEqual(13, data[1].Count);\n            Assert.AreEqual(52, data[2].Count);\n            Assert.AreEqual(155, data[3].Count);\n            Assert.AreEqual(100, data[4].Count);\n        }\n\n        [Test]\n        public void ReadFutureChainData()\n        {\n            var canonicalFutures = new Dictionary<Symbol, string>()\n            {\n                { Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),\n                    \"ES20Z13|ES21H14|ES20M14|ES19U14|ES19Z14\" },\n                {Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),\n                    \"GC29V13|GC26X13|GC27Z13|GC26G14|GC28J14|GC26M14|GC27Q14|GC29V14|GC29Z14|GC25G15|GC28J15|GC26M15|GC27Q15|GC29Z15|GC28M16|GC28Z16|GC28M17|GC27Z17|GC27M18|GC27Z18|GC26M19\"},\n            };\n\n            var tickTypes = new[] { TickType.Trade, TickType.Quote, TickType.OpenInterest };\n\n            var resolutions = new[] { Resolution.Minute };\n\n\n            foreach (var canonical in canonicalFutures)\n            {\n                foreach (var res in resolutions)\n                {\n                    foreach (var tickType in tickTypes)\n                    {\n                        var futures = LoadFutureChain(canonical.Key, _fromDate, tickType, res);\n\n                        string chain = string.Join(\"|\", futures.Select(f => f.Value));\n\n                        if (tickType == TickType.Quote) //only quotes have the full chain!\n                            Assert.AreEqual(canonical.Value, chain);\n\n                        foreach (var future in futures)\n                        {\n                            string csv = LoadFutureData(future, tickType, res);\n                            Assert.IsTrue(!string.IsNullOrEmpty(csv));\n                        }\n                    }\n                }\n            }\n        }\n\n        private List<Symbol> LoadFutureChain(Symbol baseFuture, DateTime date, TickType tickType, Resolution res)\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, baseFuture, date, res, tickType);\n\n            //load future chain first\n            var config = new SubscriptionDataConfig(typeof(ZipEntryNameData), baseFuture, res,\n                                                    TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, tickType);\n            var factory = new ZipEntryNameSubscriptionDataSourceReader(TestGlobals.DataCacheProvider, config, date, false);\n\n            var result = factory.Read(new SubscriptionDataSource(filePath, SubscriptionTransportMedium.LocalFile, FileFormat.ZipEntryName))\n                          .Select(s => s.Symbol).ToList();\n            return result;\n        }\n\n        private string LoadFutureData(Symbol future, TickType tickType, Resolution res)\n        {\n            var dataType = LeanData.GetDataType(res, tickType);\n            var config = new SubscriptionDataConfig(dataType, future, res,\n                                                    TimeZones.NewYork, TimeZones.NewYork, false, false, false, false, tickType);\n\n            var date = _fromDate;\n\n            var sb = new StringBuilder();\n\n            while (date <= _toDate)\n            {\n                var leanDataReader = new LeanDataReader(config, future, res, date, _dataDirectory);\n\n                foreach (var bar in leanDataReader.Parse())\n                {\n                    //write base data type back to string\n                    sb.AppendLine(LeanData.GenerateLine(bar, SecurityType.Future, res));\n                }\n                date = date.AddDays(1);\n            }\n            var csv = sb.ToString();\n            return csv;\n        }\n\n        [Test]\n        public void GenerateDailyAndHourlyFutureDataFromMinutes()\n        {\n\n            var tickTypes = new[] { TickType.Trade, TickType.Quote, TickType.OpenInterest };\n\n            var futures = new[] { Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),\n                Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX)};\n            var resolutions = new[] { Resolution.Hour, Resolution.Daily };\n\n            foreach (var future in futures)\n                foreach (var res in resolutions)\n                    foreach (var tickType in tickTypes)\n                        ConvertMinuteFuturesData(future, tickType, res);\n        }\n\n        private void ConvertMinuteFuturesData(Symbol canonical, TickType tickType, Resolution outputResolution, Resolution inputResolution = Resolution.Minute)\n        {\n\n            var timeSpans = new Dictionary<Resolution, TimeSpan>()\n            {\n                { Resolution.Daily, TimeSpan.FromHours(24)},\n                { Resolution.Hour, TimeSpan.FromHours(1)},\n            };\n\n            var timeSpan = timeSpans[outputResolution];\n\n            var tickTypeConsolidatorMap = new Dictionary<TickType, Func<IDataConsolidator>>()\n            {\n                {TickType.Quote, () => new QuoteBarConsolidator(timeSpan)},\n                {TickType.OpenInterest, ()=> new OpenInterestConsolidator(timeSpan)},\n                {TickType.Trade, ()=> new TradeBarConsolidator(timeSpan) }\n\n            };\n\n            var consolidators = new Dictionary<string, IDataConsolidator>();\n            var configs = new Dictionary<string, SubscriptionDataConfig>();\n            var outputFiles = new Dictionary<string, StringBuilder>();\n            var futures = new Dictionary<string, Symbol>();\n\n            var date = _fromDate;\n            while (date <= _toDate)\n            {\n                var futureChain = LoadFutureChain(canonical, date, tickType, inputResolution);\n\n                foreach (var future in futureChain)\n                {\n                    if (!futures.ContainsKey(future.Value))\n                    {\n                        futures[future.Value] = future;\n                        var config = new SubscriptionDataConfig(LeanData.GetDataType(outputResolution, tickType),\n                                                                future, inputResolution, TimeZones.NewYork, TimeZones.NewYork,\n                                                                false, false, false, false, tickType);\n                        configs[future.Value] = config;\n\n                        consolidators[future.Value] = tickTypeConsolidatorMap[tickType].Invoke();\n\n                        var sb = new StringBuilder();\n                        outputFiles[future.Value] = sb;\n\n                        consolidators[future.Value].DataConsolidated += (sender, bar) =>\n                        {\n                            sb.Append(LeanData.GenerateLine(bar, SecurityType.Future, outputResolution) + Environment.NewLine);\n                        };\n                    }\n\n                    var leanDataReader = new LeanDataReader(configs[future.Value], future, inputResolution, date, _dataDirectory);\n\n                    var consolidator = consolidators[future.Value];\n\n                    foreach (var bar in leanDataReader.Parse())\n                    {\n                        consolidator.Update(bar);\n                    }\n                }\n                date = date.AddDays(1);\n            }\n\n            //write all results\n            foreach (var consolidator in consolidators.Values)\n                consolidator.Scan(date);\n\n            var zip = LeanData.GenerateRelativeZipFilePath(canonical, _fromDate, outputResolution, tickType);\n            var zipPath = Path.Combine(_dataDirectory, zip);\n            var fi = new FileInfo(zipPath);\n\n            if (!fi.Directory.Exists)\n                fi.Directory.Create();\n\n            foreach (var future in futures.Values)\n            {\n                var zipEntry = LeanData.GenerateZipEntryName(future, _fromDate, outputResolution, tickType);\n                var sb = outputFiles[future.Value];\n\n                //Uncomment to write zip files\n                //QuantConnect.Compression.ZipCreateAppendData(zipPath, zipEntry, sb.ToString());\n\n                Assert.IsTrue(sb.Length > 0);\n            }\n        }\n\n        #endregion\n\n\n        [Test, TestCaseSource(nameof(OptionAndFuturesCases))]\n        public void ReadLeanFutureAndOptionDataFromFilePath(string composedFilePath, Symbol symbol, int rowsInfile, double sumValue)\n        {\n            // Act\n            var ldr = new LeanDataReader(composedFilePath);\n            var data = ldr.Parse().ToList();\n            // Assert\n            Assert.True(symbol.Equals(data.First().Symbol));\n            Assert.AreEqual(rowsInfile, data.Count);\n            Assert.AreEqual(sumValue, data.Sum(c => c.Value));\n        }\n\n\n        public static object[] OptionAndFuturesCases =\n        {\n            new object[]\n            {\n                \"../../../Data/future/cme/minute/es/20131008_quote.zip#20131008_es_minute_quote_201312.csv\",\n                LeanData\n                    .ReadSymbolFromZipEntry(Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),\n                                            Resolution.Minute, \"20131008_es_minute_quote_201312.csv\"),\n                1411,\n                2346061.875\n            },\n\n            new object[]\n            {\n                \"../../../Data/future/comex/minute/gc/20131010_trade.zip#20131010_gc_minute_trade_201312.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),\n                                                Resolution.Minute, \"20131010_gc_minute_trade_201312.csv\"),\n                1379,\n                1791800.9\n            },\n\n            new object[]\n            {\n                \"../../../Data/future/comex/tick/gc/20131009_quote.zip#20131009_gc_tick_quote_201406.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),\n                                                Resolution.Tick, \"20131009_gc_tick_quote_201406.csv\"),\n                197839,\n                259245064.8\n            },\n\n            new object[]\n            {\n                \"../../../Data/future/comex/tick/gc/20131009_trade.zip#20131009_gc_tick_trade_201312.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),\n                                                Resolution.Tick, \"20131009_gc_tick_trade_201312.csv\"),\n                64712,\n                84596673.8\n            },\n\n            new object[]\n            {\n                \"../../../Data/future/cme/minute/es/20131010_openinterest.zip#20131010_es_minute_openinterest_201312.csv\",\n                LeanData\n                    .ReadSymbolFromZipEntry(Symbol.Create(Futures.Indices.SP500EMini, SecurityType.Future, Market.CME),\n                                            Resolution.Minute, \"20131010_es_minute_openinterest_201312.csv\"),\n                3,\n                8119169\n            },\n\n            new object[]\n            {\n                \"../../../Data/future/comex/tick/gc/20131009_openinterest.zip#20131009_gc_tick_openinterest_201310.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),\n                                                Resolution.Tick, \"20131009_gc_tick_openinterest_201310.csv\"),\n                4,\n                1312\n            },\n\n            new object[]\n            {\n                \"../../../Data/option/usa/minute/aapl/20140606_quote_american.zip#20140606_aapl_minute_quote_american_put_7500000_20141018.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA),\n                                                Resolution.Minute,\n                                                \"20140606_aapl_minute_quote_american_put_7500000_20141018.csv\"),\n                391,\n                44210.7\n            },\n\n            new object[]\n            {\n                \"../../../Data/option/usa/minute/aapl/20140606_trade_american.zip#20140606_aapl_minute_trade_american_call_6475000_20140606.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA),\n                                                Resolution.Minute,\n                                                \"20140606_aapl_minute_trade_american_call_6475000_20140606.csv\"),\n                374,\n                745.35\n            },\n\n            new object[]\n            {\n                \"../../../Data/option/usa/minute/goog/20151224_openinterest_american.zip#20151224_goog_minute_openinterest_american_call_3000000_20160115.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"GOOG\", SecurityType.Option, Market.USA),\n                                                Resolution.Minute,\n                                                \"20151224_goog_minute_openinterest_american_call_3000000_20160115.csv\"),\n                1,\n                38\n            },\n\n            new object[]\n            {\n                \"../../../Data/option/usa/daily/aapl_2014_openinterest_american.zip#aapl_openinterest_american_call_1950000_20150117.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA),\n                    Resolution.Daily,\n                    \"aapl_openinterest_american_call_1950000_20150117.csv\"),\n                2,\n                824\n            },\n\n            new object[]\n            {\n            \"../../../Data/option/usa/daily/aapl_2014_trade_american.zip#aapl_trade_american_call_5400000_20141018.csv\",\n            LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA),\n                Resolution.Daily,\n                \"aapl_trade_american_call_5400000_20141018.csv\"),\n            1,\n            109.9\n            },\n\n            new object[]\n            {\n                \"../../../Data/option/usa/daily/aapl_2014_quote_american.zip#aapl_quote_american_call_307100_20150117.csv\",\n                LeanData.ReadSymbolFromZipEntry(Symbol.Create(\"AAPL\", SecurityType.Option, Market.USA),\n                    Resolution.Daily,\n                    \"aapl_quote_american_call_307100_20150117.csv\"),\n                1,\n                63.3\n            }\n        };\n\n\n        [Test, TestCaseSource(nameof(SpotMarketCases))]\n        public void ReadLeanSpotMarketsSecuritiesDataFromFilePath(string securityType, string market, string resolution, string ticker, string fileName, int rowsInfile, double sumValue)\n        {\n            // Arrange\n            var filepath = GenerateFilepathForTesting(_dataDirectory, securityType, market, resolution, ticker, fileName);\n\n            SecurityType securityTypeEnum;\n            Enum.TryParse(securityType, true, out securityTypeEnum);\n            var symbol = Symbol.Create(ticker, securityTypeEnum, market);\n\n            // Act\n            var ldr = new LeanDataReader(filepath);\n            var data = ldr.Parse().ToList();\n            // Assert\n            Assert.True(symbol.Equals(data.First().Symbol));\n            Assert.AreEqual(rowsInfile, data.Count);\n            Assert.AreEqual(sumValue, data.Sum(c => c.Value));\n        }\n\n        public static object[] SpotMarketCases =\n        {\n            //TODO: generate Low resolution sample data for equities\n            new object[] {\"equity\", \"usa\", \"daily\", \"aig\", \"aig.zip\", 5849, 340770.5801},\n            new object[] {\"equity\", \"usa\", \"minute\", \"aapl\", \"20140605_trade.zip\", 686, 443184.58},\n            new object[] {\"equity\", \"usa\", \"minute\", \"ibm\", \"20131010_quote.zip\", 584, 107061.125},\n            new object[] {\"equity\", \"usa\", \"second\", \"ibm\", \"20131010_trade.zip\", 5060, 929385.34},\n            new object[] {\"equity\", \"usa\", \"tick\", \"bac\", \"20131011_trade.zip\", 112177, 1591680.73},\n            new object[] {\"forex\", \"oanda\", \"minute\", \"eurusd\", \"20140502_quote.zip\", 1222, 1693.578875},\n            new object[] {\"forex\", \"oanda\", \"second\", \"nzdusd\", \"20140514_quote.zip\", 18061, 15638.724575},\n            new object[] {\"forex\", \"oanda\", \"tick\", \"eurusd\", \"20140507_quote.zip\", 41367, 57598.54664},\n            new object[] {\"cfd\", \"oanda\", \"hour\", \"xauusd\", \"xauusd.zip\", 76499, 90453133.772 },\n            new object[] {\"crypto\", \"coinbase\", \"second\", \"btcusd\", \"20161008_trade.zip\", 3453, 2137057.57},\n            new object[] {\"crypto\", \"coinbase\", \"minute\", \"ethusd\", \"20170903_trade.zip\", 1440, 510470.66},\n            new object[] {\"crypto\", \"coinbase\", \"daily\", \"btcusd\", \"btcusd_trade.zip\", 1318, 3725052.03},\n        };\n\n        private static IEnumerable<TestCaseData> MinuteZipEntryFileNames\n        {\n            get\n            {\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Grains.Corn, Market.CBOT, new(2025, 12, 12))),\n                    \"20251103_ozc_minute_trade_american_call_41000_20251121.csv\",\n                    4.1m,\n                    OptionRight.Call,\n                    new DateTime(2025, 11, 21));\n\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Currencies.JPY, Market.CME, new(2025, 12, 15))),\n                    \"20251103_jpu_minute_trade_american_call_62.50000_20260109.csv\",\n                    0.00625m,\n                    OptionRight.Call,\n                    new DateTime(2026, 01, 09));\n\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Currencies.AUD, Market.CME, new(2025, 12, 15))),\n                    \"20251103_adu_minute_openinterest_american_put_6350_20251205.csv\",\n                    0.635m,\n                    OptionRight.Put,\n                    new DateTime(2025, 12, 05));\n\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Currencies.AUD, Market.CME, new(2025, 12, 15))),\n                    \"20251103_adu_minute_quote_american_call_8400_20260306.csv\",\n                    0.84m,\n                    OptionRight.Call,\n                    new DateTime(2026, 03, 06));\n\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Currencies.NZD, Market.CME, new(2025, 12, 15))),\n                    \"20251103_6n_minute_quote_american_call_5600_20260403.csv\",\n                    0.56m,\n                    OptionRight.Call,\n                    new DateTime(2026, 04, 03));\n\n                yield return new TestCaseData(\n                    Symbol.CreateCanonicalOption(Symbol.CreateFuture(Futures.Meats.LiveCattle, Market.CME, new(2025, 12, 31))),\n                    \"20251103_le_minute_quote_american_call_21800_20251205.csv\",\n                    2.18m,\n                    OptionRight.Call,\n                    new DateTime(2025, 12, 05));\n            }\n        }\n\n        [TestCaseSource(nameof(MinuteZipEntryFileNames))]\n        public void ReadSymbolFromZipEntryShouldParseFileNameWithFloatingNumber(Symbol rootSymbol, string fileNameCsv,\n            decimal expectedStrike, OptionRight expectedOptionRight, DateTime expectedExpiry)\n        {\n            var actualSymbol = LeanData.ReadSymbolFromZipEntry(rootSymbol, Resolution.Minute, fileNameCsv);\n\n            Assert.AreEqual(expectedStrike, actualSymbol.ID.StrikePrice);\n            Assert.AreEqual(expectedOptionRight, actualSymbol.ID.OptionRight);\n            Assert.AreEqual(expectedExpiry, actualSymbol.ID.Date);\n        }\n\n        public static string GenerateFilepathForTesting(string dataDirectory, string securityType, string market, string resolution, string ticker,\n                                                 string fileName)\n        {\n            string filepath;\n            if (resolution == \"daily\" || resolution == \"hour\")\n            {\n                filepath = Path.Combine(dataDirectory, securityType, market, resolution, fileName);\n            }\n            else\n            {\n                filepath = Path.Combine(dataDirectory, securityType, market, resolution, ticker, fileName);\n            }\n            return filepath;\n        }\n\n        private class ZipEntryNameData : BaseData\n        {\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n            {\n                var symbol = LeanData.ReadSymbolFromZipEntry(config.Symbol, config.Resolution, line);\n                return new ZipEntryNameData { Time = date, Symbol = symbol };\n            }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                var source = LeanData.GenerateZipFilePath(Globals.DataFolder, config.Symbol, date, config.Resolution, config.TickType);\n                return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.ZipEntryName);\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/LeanDataWriterTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\nusing QuantConnect.Securities;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\nusing NodaTime;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing QuantConnect.Lean.Engine.HistoricalData;\nusing QuantConnect.Tests.Algorithm;\nusing QuantConnect.ToolBox;\nusing System.Globalization;\n\nnamespace QuantConnect.Tests.ToolBox\n{\n    [TestFixture]\n    public class LeanDataWriterTests\n    {\n        private readonly string _dataDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n        private Symbol _forex;\n        private Symbol _cfd;\n        private Symbol _equity;\n        private Symbol _crypto;\n        private DateTime _date;\n\n        [OneTimeSetUp]\n        public void Setup()\n        {\n            _forex = Symbol.Create(\"EURUSD\", SecurityType.Forex, Market.FXCM);\n            _cfd = Symbol.Create(\"BCOUSD\", SecurityType.Cfd, Market.Oanda);\n            _equity = Symbol.Create(\"spy\", SecurityType.Equity, Market.USA);\n            _date = Parse.DateTime(\"3/16/2017 12:00:00 PM\");\n            _crypto = Symbol.Create(\"BTCUSD\", SecurityType.Crypto, Market.GDAX);\n        }\n\n        private List<Tick> GetTicks(Symbol sym)\n        {\n            return new List<Tick>()\n            {\n                new Tick(Parse.DateTime(\"3/16/2017 12:00:00 PM\"), sym, 1.0m, 2.0m),\n                new Tick(Parse.DateTime(\"3/16/2017 12:00:01 PM\"), sym, 3.0m, 4.0m),\n                new Tick(Parse.DateTime(\"3/16/2017 12:00:02 PM\"), sym, 5.0m, 6.0m),\n            };\n        }\n\n        private List<QuoteBar> GetQuoteBars(Symbol sym)\n        {\n            return new List<QuoteBar>()\n            {\n                new QuoteBar(Parse.DateTime(\"3/16/2017 12:00:00 PM\"), sym, new Bar(1m, 2m, 3m, 4m),  1, new Bar(5m, 6m, 7m, 8m),  2),\n                new QuoteBar(Parse.DateTime(\"3/16/2017 12:00:01 PM\"), sym, new Bar(11m, 21m, 31m, 41m),  3, new Bar(51m, 61m, 71m, 81m), 4),\n                new QuoteBar(Parse.DateTime(\"3/16/2017 12:00:02 PM\"), sym, new Bar(10m, 20m, 30m, 40m),  5, new Bar(50m, 60m, 70m, 80m),  6),\n            };\n        }\n\n        [Test]\n        public void LeanDataWriter_MultipleDays()\n        {\n            var leanDataWriter = new LeanDataWriter(Resolution.Second, _forex, _dataDirectory, TickType.Quote);\n            var sourceData = new List<QuoteBar>\n            {\n                new (Parse.DateTime(\"3/16/2021 12:00:00 PM\"), _forex, new Bar(1m, 2m, 3m, 4m),  1, new Bar(5m, 6m, 7m, 8m),  2)\n            };\n\n            for (var i = 1; i < 100; i++)\n            {\n                sourceData.Add(new QuoteBar(sourceData.Last().Time.AddDays(1),\n                    _forex,\n                    new Bar(1m, 2m, 3m, 4m),\n                    1, new Bar(5m, 6m, 7m, 8m),\n                    2));\n            }\n            leanDataWriter.Write(sourceData);\n\n            foreach (var bar in sourceData)\n            {\n                var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _forex, bar.Time, Resolution.Second, TickType.Quote);\n                Assert.IsTrue(File.Exists(filePath));\n                Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n                var data = QuantConnect.Compression.Unzip(filePath).Single();\n\n                Assert.AreEqual(1, data.Value.Count);\n                Assert.IsTrue(data.Key.Contains(bar.Time.ToStringInvariant(DateFormat.EightCharacter)), $\"Key {data.Key} BarTime: {bar.Time}\");\n            }\n        }\n\n        [TestCase(true)]\n        [TestCase(false)]\n        public void Mapping(bool mapSymbol)\n        {\n            LeanDataWriter.MapFileProvider = new Lazy<IMapFileProvider>(TestGlobals.MapFileProvider);\n\n            // asset got mapped on 20080929 to SPWRA\n            var symbol = Symbol.Create(\"SPWR\", SecurityType.Equity, Market.USA);\n            var leanDataWriter = new LeanDataWriter(Resolution.Daily, symbol, _dataDirectory, TickType.Trade, mapSymbol: mapSymbol);\n            var sourceData = new List<TradeBar>\n            {\n                new (new DateTime(2008, 9, 29), symbol, 10, 11, 12, 13, 2),\n                new (new DateTime(2008, 9, 30), symbol, 10, 11, 12, 13, 2),\n            };\n            leanDataWriter.Write(sourceData);\n\n            for (int i = 0; i < sourceData.Count; i++)\n            {\n                var bar = sourceData[i];\n                var expectedTicker = (i == 0 || !mapSymbol) ? \"SPWR\" : \"SPWRA\";\n                symbol = symbol.UpdateMappedSymbol(expectedTicker);\n\n                var filePath = LeanData.GenerateZipFilePath(_dataDirectory, symbol, bar.Time, Resolution.Daily, TickType.Trade);\n                Assert.IsTrue(File.Exists(filePath));\n                Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n                var data = QuantConnect.Compression.Unzip(filePath).Single();\n\n                Assert.AreEqual(!mapSymbol ? 2 : 1, data.Value.Count);\n                Assert.AreEqual($\"{expectedTicker}.csv\".ToLower(), data.Key, $\"Key {data.Key} BarTime: {bar.Time}\");\n                Assert.IsTrue(data.Value.Any(point => point.StartsWith(bar.Time.ToStringInvariant(DateFormat.TwelveCharacter), StringComparison.Ordinal)), $\"Key {data.Key} BarTime: {bar.Time}\");\n            }\n        }\n\n        [Test]\n        public void LeanDataWriter_CanWriteForex()\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _forex, _date, Resolution.Second, TickType.Quote);\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Second, _forex, _dataDirectory, TickType.Quote);\n            leanDataWriter.Write(GetQuoteBars(_forex));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            Assert.AreEqual(data.First().Value.Count, 3);\n        }\n\n        [TestCase(SecurityType.FutureOption, Resolution.Second)]\n        [TestCase(SecurityType.Future, Resolution.Second)]\n        [TestCase(SecurityType.Option, Resolution.Second)]\n        [TestCase(SecurityType.Option, Resolution.Daily)]\n        [TestCase(SecurityType.Future, Resolution.Daily)]\n        [TestCase(SecurityType.FutureOption, Resolution.Daily)]\n        public void LeanDataWriter_CanWriteZipWithMultipleContracts(SecurityType securityType, Resolution resolution)\n        {\n            Symbol contract1;\n            Symbol contract2;\n            if (securityType == SecurityType.Future)\n            {\n                contract1 = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 02, 01));\n                contract2 = Symbol.CreateFuture(Futures.Indices.SP500EMini, Market.CME, new DateTime(2020, 03, 01));\n            }\n            else if (securityType == SecurityType.Option)\n            {\n                contract1 = Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 1, new DateTime(2020, 02, 01));\n                contract2 = Symbol.CreateOption(\"AAPL\", Market.USA, OptionStyle.American, OptionRight.Call, 1, new DateTime(2020, 03, 01));\n            }\n            else if (securityType == SecurityType.FutureOption)\n            {\n                var underlying = Symbols.ES_Future_Chain;\n                contract1 = Symbol.CreateOption(underlying, Market.CME, OptionStyle.American, OptionRight.Call, 1, new DateTime(2020, 02, 01));\n                contract2 = Symbol.CreateOption(underlying, Market.CME, OptionStyle.American, OptionRight.Call, 1, new DateTime(2020, 03, 01));\n            }\n            else\n            {\n                throw new NotImplementedException($\"{securityType} not implemented!\");\n            }\n\n            var filePath1 = LeanData.GenerateZipFilePath(_dataDirectory, contract1, _date, resolution, TickType.Quote);\n            var leanDataWriter1 = new LeanDataWriter(resolution, contract1, _dataDirectory, TickType.Quote);\n            leanDataWriter1.Write(GetQuoteBars(contract1));\n\n            var filePath2 = LeanData.GenerateZipFilePath(_dataDirectory, contract2, _date, resolution, TickType.Quote);\n            var leanDataWriter2 = new LeanDataWriter(resolution, contract2, _dataDirectory, TickType.Quote);\n            leanDataWriter2.Write(GetQuoteBars(contract2));\n\n            Assert.AreEqual(filePath1, filePath2);\n            Assert.IsTrue(File.Exists(filePath1));\n            Assert.IsFalse(File.Exists(filePath1 + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath1).ToDictionary(x => x.Key, x => x.Value.ToList());\n            Assert.AreEqual(2, data.Count);\n            Assert.That(data.Values, Has.All.Count.EqualTo(3));\n        }\n\n        [Test]\n        public void LeanDataWriter_CanWriteCfd()\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _cfd, _date, Resolution.Minute, TickType.Quote);\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Minute, _cfd, _dataDirectory, TickType.Quote);\n            leanDataWriter.Write(GetQuoteBars(_cfd));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            Assert.AreEqual(data.First().Value.Count, 3);\n        }\n\n        [Test]\n        public void LeanDataWriter_CanWriteEquity()\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _equity, _date, Resolution.Tick, TickType.Trade);\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Tick, _equity, _dataDirectory);\n            leanDataWriter.Write(GetTicks(_equity));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            Assert.AreEqual(data.First().Value.Count, 3);\n        }\n\n        [Test]\n        public void LeanDataWriter_CanSupportUtf8Chars()\n        {\n            var symbol = Symbol.Create(\"币安人生usdt\", SecurityType.CryptoFuture, Market.Binance);\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, symbol, _date, Resolution.Tick, TickType.Trade);\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Tick, symbol, _dataDirectory);\n            leanDataWriter.Write(GetTicks(symbol));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            var entry = data.First();\n            Assert.AreEqual(entry.Key, \"20170316_币安人生usdt_tick_trade_perp.csv\");\n            Assert.AreEqual(entry.Value.Count, 3);\n        }\n\n        [TestCase(\"CON\")]\n        [TestCase(\"PRN\")]\n        [TestCase(\"AUX\")]\n        [TestCase(\"NUL\")]\n        [TestCase(\"COM0\")]\n        [TestCase(\"COM1\")]\n        [TestCase(\"COM2\")]\n        [TestCase(\"COM3\")]\n        [TestCase(\"COM4\")]\n        [TestCase(\"COM5\")]\n        [TestCase(\"COM6\")]\n        [TestCase(\"COM7\")]\n        [TestCase(\"COM8\")]\n        [TestCase(\"COM9\")]\n        [TestCase(\"LPT0\")]\n        [TestCase(\"LPT1\")]\n        [TestCase(\"LPT2\")]\n        [TestCase(\"LPT3\")]\n        [TestCase(\"LPT4\")]\n        [TestCase(\"LPT5\")]\n        [TestCase(\"LPT6\")]\n        [TestCase(\"LPT7\")]\n        [TestCase(\"LPT8\")]\n        [TestCase(\"LPT9\")]\n        [Platform(\"Win\", Reason = \"The paths in these testcases are only forbidden in Windows OS\")]\n        public void LeanDataWriterHandlesWindowsInvalidNames(string ticker)\n        {\n            var symbol = Symbol.Create(ticker, SecurityType.Equity, Market.USA);\n            var filePath = FileExtension.ToNormalizedPath(LeanData.GenerateZipFilePath(_dataDirectory, symbol, _date, Resolution.Tick, TickType.Trade));\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Tick, symbol, _dataDirectory);\n            leanDataWriter.Write(GetTicks(symbol));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            Assert.AreEqual(data.First().Value.Count, 3);\n        }\n\n        [TestCase(null, Resolution.Daily)]\n        [TestCase(null, Resolution.Second)]\n        [TestCase(WritePolicy.Merge, Resolution.Second)]\n        [TestCase(WritePolicy.Merge, Resolution.Daily)]\n        [TestCase(WritePolicy.Append, Resolution.Second)]\n        [TestCase(WritePolicy.Overwrite, Resolution.Second)]\n        public void RespectsWritePolicy(WritePolicy? writePolicy, Resolution resolution)\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _crypto, _date, resolution, TickType.Quote);\n            if (File.Exists(filePath))\n            {\n                File.Delete(filePath);\n            }\n\n            var loopCount = 3;\n            var dataPointsPerLoop = 2;\n            for (var i = 0; i < loopCount; i++)\n            {\n                var leanDataWriter = new LeanDataWriter(resolution, _crypto, _dataDirectory, TickType.Quote, writePolicy: writePolicy);\n                var quoteBar = new QuoteBar(Parse.DateTime(\"3/16/2017 12:00:00 PM\").AddHours(i), _crypto, new Bar(1m, 2m, 3m, 4m), 1,\n                    new Bar(5m, 6m, 7m, 8m), 2);\n\n                // same quote twice! it has the same time, so it will be dropped when merging\n                leanDataWriter.Write(Enumerable.Repeat(quoteBar, dataPointsPerLoop));\n\n                Assert.IsTrue(File.Exists(filePath));\n                Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n            }\n\n            var data = QuantConnect.Compression.Unzip(filePath).First().Value;\n\n\n            switch (writePolicy)\n            {\n                case WritePolicy.Overwrite:\n                    Assert.AreEqual(dataPointsPerLoop, data.Count);\n                    break;\n                case WritePolicy.Merge:\n                    Assert.AreEqual(loopCount, data.Count);\n                    if (resolution < Resolution.Hour)\n                    {\n                        var previousMs = 0;\n                        Assert.IsTrue(data.All(x =>\n                        {\n                            var milliseconds = int.Parse(x.Split(',')[0], NumberStyles.Number, CultureInfo.InvariantCulture);\n                            var result = previousMs < milliseconds;\n                            previousMs = milliseconds;\n                            return result;\n                        }));\n                    }\n                    break;\n                case WritePolicy.Append:\n                    Assert.AreEqual(dataPointsPerLoop * loopCount, data.Count);\n                    break;\n                case null:\n                    if (resolution >= Resolution.Hour)\n                    {\n                        // will merge by default\n                        Assert.AreEqual(loopCount, data.Count);\n                    }\n                    else\n                    {\n                        // overwrite\n                        Assert.AreEqual(dataPointsPerLoop, data.Count);\n                    }\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(writePolicy), writePolicy, null);\n            }\n        }\n\n        [Test]\n        public void LeanDataWriter_CanWriteCrypto()\n        {\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, _crypto, _date, Resolution.Second, TickType.Quote);\n\n            var leanDataWriter = new LeanDataWriter(Resolution.Second, _crypto, _dataDirectory, TickType.Quote);\n            leanDataWriter.Write(GetQuoteBars(_crypto));\n\n            Assert.IsTrue(File.Exists(filePath));\n            Assert.IsFalse(File.Exists(filePath + \".tmp\"));\n\n            var data = QuantConnect.Compression.Unzip(filePath);\n\n            Assert.AreEqual(data.First().Value.Count, 3);\n        }\n\n        [TestCase(SecurityType.Equity, TickType.Quote, Resolution.Minute)]\n        [TestCase(SecurityType.Equity, TickType.Trade, Resolution.Daily)]\n        [TestCase(SecurityType.Equity, TickType.Trade, Resolution.Hour)]\n        [TestCase(SecurityType.Equity, TickType.Trade, Resolution.Minute)]\n        [TestCase(SecurityType.Crypto, TickType.Quote, Resolution.Minute)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, Resolution.Daily)]\n        [TestCase(SecurityType.Crypto, TickType.Trade, Resolution.Minute)]\n        [TestCase(SecurityType.Option, TickType.Quote, Resolution.Minute)]\n        [TestCase(SecurityType.Option, TickType.Trade, Resolution.Minute)]\n        public void CanDownloadAndSave(SecurityType securityType, TickType tickType, Resolution resolution)\n        {\n            var symbol = Symbols.GetBySecurityType(securityType);\n            var startTimeUtc = GetRepoDataDates(securityType, resolution);\n\n            // Override for this case because symbol from Symbols does not have data included\n            if (securityType == SecurityType.Option)\n            {\n                symbol = Symbols.CreateOptionSymbol(\"GOOG\", OptionRight.Call, 770, new DateTime(2015, 12, 24));\n                startTimeUtc = new DateTime(2015, 12, 23);\n            }\n\n            // EndTime based on start, only do 1 day for anything less than hour because we compare datafiles below\n            // and minute and finer resolutions store by day\n            var endTimeUtc = startTimeUtc + TimeSpan.FromDays(resolution >= Resolution.Hour ? 15 : 1);\n\n            // Create our writer and LocalHistory brokerage to \"download\" from\n            var writer = new LeanDataWriter(_dataDirectory, resolution, securityType, tickType);\n            var brokerage = new LocalHistoryBrokerage();\n            var symbols = new List<Symbol>() {symbol};\n\n            // \"Download\" and write to file\n            writer.DownloadAndSave(brokerage, symbols, startTimeUtc, endTimeUtc);\n\n            // Verify the file exists where we expect\n            var filePath = LeanData.GenerateZipFilePath(_dataDirectory, symbol, startTimeUtc, resolution, tickType);\n            Assert.IsTrue(File.Exists(filePath));\n\n            // Read the file and data\n            var reader = new LeanDataReader(filePath);\n            var dataFromFile = reader.Parse().ToList();\n\n            // Ensure its not empty and it is actually for this symbol\n            Assert.IsNotEmpty(dataFromFile);\n            Assert.IsTrue(dataFromFile.All(x => x.Symbol == symbol));\n\n            // Get history directly ourselves and compare with the data in the file\n            var history = GetHistory(brokerage, resolution, securityType, symbol, tickType, startTimeUtc, endTimeUtc);\n            CollectionAssert.AreEqual(history.Select(x => x.Time), dataFromFile.Select(x => x.Time));\n\n            brokerage.Dispose();\n        }\n\n        /// <summary>\n        /// Helper to get history for tests from a brokerage implementation\n        /// </summary>\n        /// <returns>List of data points from history request</returns>\n        private List<BaseData> GetHistory(IBrokerage brokerage, Resolution resolution, SecurityType securityType, Symbol symbol, TickType tickType, DateTime startTimeUtc, DateTime endTimeUtc)\n        {\n            var dataType = LeanData.GetDataType(resolution, tickType);\n\n            var marketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            var ticker = symbol.ID.Symbol;\n            var market = symbol.ID.Market;\n\n            var canonicalSymbol = Symbol.Create(ticker, securityType, market);\n\n            var exchangeHours = marketHoursDatabase.GetExchangeHours(canonicalSymbol.ID.Market, canonicalSymbol, securityType);\n            var dataTimeZone = marketHoursDatabase.GetDataTimeZone(canonicalSymbol.ID.Market, canonicalSymbol, securityType);\n\n            var historyRequest = new HistoryRequest(\n                startTimeUtc,\n                endTimeUtc,\n                dataType,\n                symbol,\n                resolution,\n                exchangeHours,\n                dataTimeZone,\n                resolution,\n                true,\n                false,\n                DataNormalizationMode.Raw,\n                tickType\n            );\n\n            return brokerage.GetHistory(historyRequest)\n                .Select(\n                    x =>\n                    {\n                        // Convert to date timezone before we write it\n                        x.Time = x.Time.ConvertTo(exchangeHours.TimeZone, dataTimeZone);\n                        return x;\n                    })\n                .ToList();\n        }\n\n        /// <summary>\n        /// Test helper method to get dates for data we have in the repo\n        /// Could possibly be refactored and used in Tests.Symbols in a similar way\n        /// </summary>\n        /// <returns>Start time where some data included in the repo exists</returns>\n        private static DateTime GetRepoDataDates(SecurityType securityType, Resolution resolution)\n        {\n            // Because I intend to use this with GetBySecurityType here are the symbols we expect\n            // case SecurityType.Equity:   return SPY;\n            // case SecurityType.Option:   return SPY_C_192_Feb19_2016;\n            // case SecurityType.Forex:    return EURUSD;\n            // case SecurityType.Future:   return Future_CLF19_Jan2019;\n            // case SecurityType.Cfd:      return XAGUSD;\n            // case SecurityType.Crypto:   return BTCUSD;\n            // case SecurityType.Index:    return SPX;\n            switch (securityType)\n            {\n                case SecurityType.Equity: // SPY; Daily/Hourly/Minute/Second/Tick\n                    return new DateTime(2013, 10, 7);\n                case SecurityType.Crypto: // Coinbase (deprecated: GDAX) BTCUSD Daily/Minute/Second\n                    if (resolution == Resolution.Hour || resolution == Resolution.Tick)\n                    {\n                        throw new ArgumentException($\"GDAX BTC Crypto does not have data for this resolution {resolution}\");\n                    }\n                    return new DateTime(2017, 9, 3);\n                case SecurityType.Option: // No Data for the default symbol...\n                    return DateTime.MinValue;\n                default:\n                    throw new NotImplementedException(\"This has only implemented a few security types (Equity/Crypto/Option)\");\n            }\n        }\n\n        /// <summary>\n        /// Fake brokerage that just uses Local Disk Data to do history requests\n        /// </summary>\n        internal class LocalHistoryBrokerage : NullBrokerage\n        {\n            private readonly IHistoryProvider _historyProvider;\n\n            public LocalHistoryBrokerage()\n            {\n                var mapFileProvider = TestGlobals.MapFileProvider;\n                var dataProvider = TestGlobals.DataProvider;\n                var factorFileProvider = TestGlobals.FactorFileProvider;\n                var dataPermissionManager = new DataPermissionManager();\n\n                mapFileProvider.Initialize(dataProvider);\n                factorFileProvider.Initialize(mapFileProvider, dataProvider);\n\n                _historyProvider = new SubscriptionDataReaderHistoryProvider();\n                _historyProvider.Initialize(\n                    new HistoryProviderInitializeParameters(\n                        null,\n                        null,\n                        dataProvider,\n                        TestGlobals.DataCacheProvider,\n                        mapFileProvider,\n                        factorFileProvider,\n                        null,\n                        true,\n                        dataPermissionManager,\n                        null,\n                        new AlgorithmSettings()\n                    )\n                );\n            }\n\n            public override IEnumerable<BaseData> GetHistory(HistoryRequest request)\n            {\n                var requests = new List<HistoryRequest> {request};\n                var slices = _historyProvider.GetHistory(requests, DateTimeZone.Utc);\n\n                // Grab all the bar values for this\n                switch (request.TickType)\n                {\n                    case TickType.Quote:\n                        return slices.SelectMany(x => x.QuoteBars.Values);\n                    case TickType.Trade:\n                        return slices.SelectMany(x => x.Bars.Values);\n                    default:\n                        throw new NotImplementedException(\"Only support Trade & Quote bars\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/PsychSignalDataTests.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.ToolBox\n{\n    [TestFixture]\n    public class PsychSignalDataTests\n    {\n        [Test, Ignore(\"This test requires raw PsychSignal data\")]\n        public void FileHourMatchesDataTimeRealRawData()\n        {\n            var rawPath = Path.Combine(\"raw\", \"alternative\", \"psychsignal\");\n\n            foreach (var file in Directory.GetFiles(rawPath, \"*.csv\", SearchOption.TopDirectoryOnly).ToList())\n            {\n                var fileSplit = file.Split('_');\n\n                var hour = fileSplit[fileSplit.Length - 4].ConvertInvariant<int>();\n\n                // Read one line of the file, and compare the hour of the day to the hour on the file\n                var line = File.ReadLines(file).Last().Split(',');\n\n                // SOURCE[0],SYMBOL[1],TIMESTAMP_UTC[2],BULLISH_INTENSITY[3],BEARISH_INTENSITY[4],BULL_MINUS_BEAR[5],BULL_SCORED_MESSAGES[6],BEAR_SCORED_MESSAGES[7],BULL_BEAR_MSG_RATIO[8],TOTAL_SCANNED_MESSAGES[9]\n                var date = Parse.DateTime(line[2]).ToUniversalTime();\n\n                Assert.AreEqual(hour, date.Hour);\n            }\n        }\n\n        [Test]\n        public void FileHourMatchesFakeDataTime()\n        {\n            var line = File.ReadLines(Path.Combine(\"TestData\", \"00010101_05_example_psychsignal_testdata.csv\")).Last().Split(',');\n            var hour = 5;\n\n            var date = Parse.DateTime(line[2]).ToUniversalTime();\n\n            Assert.AreEqual(hour, date.Hour);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/BaseSymbolGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class BaseSymbolGeneratorTests\n    {\n        [Test]\n        [TestCase(2, 5)]\n        [TestCase(3, 3)]\n        [TestCase(1, 4)]\n        public void NextUpperCaseString_CreatesString_WithinSpecifiedMinMaxLength(int min, int max)\n        {\n            var symbolGenerator = new Mock<BaseSymbolGenerator>(Mock.Of<RandomDataGeneratorSettings>(), new RandomValueGenerator()).Object;\n            var str = symbolGenerator.NextUpperCaseString(min, max);\n            Assert.LessOrEqual(min, str.Length);\n            Assert.GreaterOrEqual(max, str.Length);\n        }\n\n        [Test]\n        public void NextUpperCaseString_CreatesUpperCaseString()\n        {\n            var symbolGenerator = new Mock<BaseSymbolGenerator>(Mock.Of<RandomDataGeneratorSettings>(), new RandomValueGenerator()).Object;\n            var str = symbolGenerator.NextUpperCaseString(10, 10);\n            Assert.IsTrue(str.All(char.IsUpper));\n        }\n\n        [Test]\n        [TestCase(SecurityType.Option)]\n        [TestCase(SecurityType.Future)]\n        public void ThrowsArgumentException_ForDerivativeSymbols(SecurityType securityType)\n        {\n            var symbolGenerator = new Mock<BaseSymbolGenerator>(Mock.Of<RandomDataGeneratorSettings>(), new RandomValueGenerator()).Object;\n            Assert.Throws<ArgumentException>(() =>\n                symbolGenerator.NextSymbol(securityType, Market.USA)\n            );\n        }\n\n        [Test]\n        public void ThrowIsSettingsAreNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                BaseSymbolGenerator.Create(null, Mock.Of<IRandomValueGenerator>());\n            });\n        }\n\n        [Test]\n        public void ThrowIsRundomValueGeneratorIsNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                BaseSymbolGenerator.Create(new RandomDataGeneratorSettings(), null);\n            });\n        }\n\n        internal static IEnumerable<Symbol> GenerateAsset(BaseSymbolGenerator instance)\n        {\n            var generateAsset = typeof(BaseSymbolGenerator).GetMethod(\"GenerateAsset\", BindingFlags.NonPublic | BindingFlags.Instance);\n            return (IEnumerable<Symbol>)generateAsset.Invoke(instance, new[] { (object)null });\n        }\n\n        internal static IEnumerable<Symbol> GenerateAssetWithTicker(BaseSymbolGenerator instance, string ticker)\n        {\n            var generateAsset = typeof(BaseSymbolGenerator).GetMethod(\"GenerateAsset\", BindingFlags.NonPublic | BindingFlags.Instance);\n            return (IEnumerable<Symbol>)generateAsset.Invoke(instance, new object[] { ticker });\n        }\n\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/DefaultSymbolGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class DefaultSymbolGeneratorTests\n    {\n        private const int Seed = 123456789;\n        private static readonly IRandomValueGenerator _randomValueGenerator = new RandomValueGenerator(Seed);\n\n        private BaseSymbolGenerator _symbolGenerator;\n        private DateTime _minExpiry = new(2000, 01, 01);\n        private DateTime _maxExpiry = new(2001, 01, 01);\n\n        [SetUp]\n        public void Setup()\n        {\n            // initialize using a seed for deterministic tests\n            _symbolGenerator = new DefaultSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.CME,\n                    Start = _minExpiry,\n                    End = _maxExpiry\n                },\n                _randomValueGenerator);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity)]\n        [TestCase(SecurityType.Index)]\n        public void ReturnsDefaultSymbolGeneratorInstance(SecurityType securityType)\n        {\n            Assert.IsInstanceOf<DefaultSymbolGenerator>(BaseSymbolGenerator.Create(\n                    new RandomDataGeneratorSettings() { SecurityType = securityType },\n                    Mock.Of<IRandomValueGenerator>()\n                ));\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity, Market.USA, true)]\n        [TestCase(SecurityType.Cfd, Market.FXCM, false)]\n        [TestCase(SecurityType.Cfd, Market.Oanda, false)]\n        [TestCase(SecurityType.Forex, Market.FXCM, false)]\n        [TestCase(SecurityType.Forex, Market.Oanda, false)]\n        [TestCase(SecurityType.Crypto, Market.GDAX, false)]\n        [TestCase(SecurityType.Crypto, Market.Bitfinex, false)]\n        public void GetAvailableSymbolCount(SecurityType securityType, string market, bool expectInfinity)\n        {\n            var expected = expectInfinity\n                ? int.MaxValue\n                : SymbolPropertiesDatabase.FromDataFolder().GetSymbolPropertiesList(market, securityType).Count();\n\n            var symbolGenerator = new DefaultSymbolGenerator(new RandomDataGeneratorSettings\n            {\n                SecurityType = securityType,\n                Market = market\n            }, Mock.Of<RandomValueGenerator>());\n\n            Assert.AreEqual(expected, symbolGenerator.GetAvailableSymbolCount());\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity, Market.USA)]\n        [TestCase(SecurityType.Cfd, Market.FXCM)]\n        [TestCase(SecurityType.Cfd, Market.Oanda)]\n        [TestCase(SecurityType.Forex, Market.FXCM)]\n        [TestCase(SecurityType.Forex, Market.Oanda)]\n        [TestCase(SecurityType.Crypto, Market.GDAX)]\n        [TestCase(SecurityType.Crypto, Market.Bitfinex)]\n        public void NextSymbol_CreatesSymbol_WithRequestedSecurityTypeAndMarket(SecurityType securityType, string market)\n        {\n            var symbolGenerator = new DefaultSymbolGenerator(new RandomDataGeneratorSettings\n            {\n                SecurityType = securityType,\n                Market = market\n            }, _randomValueGenerator);\n\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(symbolGenerator).ToList().ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n            Assert.AreEqual(securityType, symbol.SecurityType);\n            Assert.AreEqual(market, symbol.ID.Market);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Equity, Market.USA)]\n        [TestCase(SecurityType.Cfd, Market.FXCM)]\n        [TestCase(SecurityType.Cfd, Market.Oanda)]\n        [TestCase(SecurityType.Forex, Market.FXCM)]\n        [TestCase(SecurityType.Forex, Market.Oanda)]\n        [TestCase(SecurityType.Crypto, Market.GDAX)]\n        [TestCase(SecurityType.Crypto, Market.Bitfinex)]\n        public void NextSymbol_CreatesSymbol_WithEntryInSymbolPropertiesDatabase(SecurityType securityType, string market)\n        {\n            var symbolGenerator = new DefaultSymbolGenerator(new RandomDataGeneratorSettings\n            {\n                SecurityType = securityType,\n                Market = market\n            }, _randomValueGenerator);\n\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(symbolGenerator).ToList().ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            if (db.ContainsKey(market, SecurityDatabaseKey.Wildcard, securityType))\n            {\n                // there is a wildcard entry, so no need to check whether there is a specific entry for the symbol\n                Assert.Pass();\n            }\n            else\n            {\n                // there is no wildcard entry, so there should be a specific entry for the symbol instead\n                Assert.IsTrue(db.ContainsKey(market, symbol, securityType));\n            }\n        }\n\n        [Test]\n        [TestCase(SecurityType.Cfd, Market.FXCM)]\n        [TestCase(SecurityType.Cfd, Market.Oanda)]\n        [TestCase(SecurityType.Forex, Market.FXCM)]\n        [TestCase(SecurityType.Forex, Market.Oanda)]\n        [TestCase(SecurityType.Crypto, Market.GDAX)]\n        [TestCase(SecurityType.Crypto, Market.Bitfinex)]\n        public void NextSymbol_ThrowsNoTickersAvailableException_WhenAllSymbolsGenerated(SecurityType securityType, string market)\n        {\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            var symbolCount = db.GetSymbolPropertiesList(market, securityType).Count();\n\n            var symbolGenerator = new DefaultSymbolGenerator(new RandomDataGeneratorSettings\n            {\n                SecurityType = securityType,\n                Market = market\n            }, _randomValueGenerator);\n\n            for (var i = 0; i < symbolCount; i++)\n            {\n                var symbols = BaseSymbolGeneratorTests.GenerateAsset(symbolGenerator).ToList();\n                Assert.AreEqual(1, symbols.Count);\n            }\n\n            Assert.Throws<NoTickersAvailableException>(() =>\n                BaseSymbolGeneratorTests.GenerateAsset(symbolGenerator).ToList()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/DividendSplitMapGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class DividendSplitMapGeneratorTests\n    {\n        [TestCase(240, 0.9857119009006162)]\n        [TestCase(120, 0.9716279515771061)]\n        [TestCase(60, 0.9440608762859234)]\n        [TestCase(12, 0.7498942093324559)]\n        [TestCase(6, 0.5623413251903491)]\n        [TestCase(3, 0.31622776601683794)]\n        [TestCase(1, 0.03162277660168379)]\n        public void GetsExpectedLowerBound(int months, double expectedLowerBound)\n        {\n            var lowerBound = (double)DividendSplitMapGenerator.GetLowerBoundForPreviousSplitFactor(months);\n            Assert.AreEqual(expectedLowerBound, lowerBound, delta: 0.0000000000001);\n            Assert.IsTrue(Math.Pow(lowerBound, lowerBound * 2) >= 0.0009);\n        }\n\n        [TestCase(240)]\n        [TestCase(120)]\n        [TestCase(60)]\n        [TestCase(12)]\n        [TestCase(6)]\n        [TestCase(3)]\n        [TestCase(1)]\n        public void GetsValidNextPreviousSplitFactor(int months)\n        {\n            var lowerBound = DividendSplitMapGenerator.GetLowerBoundForPreviousSplitFactor(months);\n            var upperBound = 1;\n            var nextPreviousSplitFactor = DividendSplitMapGenerator.GetNextPreviousSplitFactor(new Random(), lowerBound, upperBound);\n            Assert.IsTrue(lowerBound <= nextPreviousSplitFactor && nextPreviousSplitFactor <= upperBound);\n            Assert.IsTrue(0.001 <= Math.Pow((double)nextPreviousSplitFactor, 2 * (double)months) && Math.Pow((double)nextPreviousSplitFactor, 2 * (double)months) <= 1);\n        }\n\n        [TestCase(240)]\n        [TestCase(120)]\n        [TestCase(60)]\n        [TestCase(12)]\n        [TestCase(6)]\n        [TestCase(3)]\n        [TestCase(1)]\n        public void PriceScaledBySplitFactorIsBounded(int months)\n        {\n            var maxPossiblePrice = 1000000m;\n            var minPossiblePrice = 0.0001m;\n            var lowerBound = DividendSplitMapGenerator.GetLowerBoundForPreviousSplitFactor(months);\n            var upperBound = 1;\n            var nextPreviousSplitFactor = DividendSplitMapGenerator.GetNextPreviousSplitFactor(new Random(), lowerBound, upperBound);\n            var finalSplitFactor = (decimal)Math.Pow((double)nextPreviousSplitFactor, 2 * (double)months);\n            Assert.IsTrue(0.0001m <= (maxPossiblePrice / finalSplitFactor) && (maxPossiblePrice / finalSplitFactor) <= 1000000000m, (maxPossiblePrice / finalSplitFactor).ToString());\n            Assert.IsTrue(0.0001m <= (minPossiblePrice / finalSplitFactor) && (minPossiblePrice / finalSplitFactor) <= 1000000000m, (minPossiblePrice / finalSplitFactor).ToString());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/FutureSymbolGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class FutureSymbolGeneratorTests\n    {\n        private const int Seed = 123456789;\n        private static readonly IRandomValueGenerator _randomValueGenerator = new RandomValueGenerator(Seed);\n\n        private BaseSymbolGenerator _symbolGenerator;\n        private DateTime _minExpiry = new(2000, 01, 01);\n        private DateTime _maxExpiry = new(2001, 01, 01);\n\n        [SetUp]\n        public void Setup()\n        {\n            // initialize using a seed for deterministic tests\n            _symbolGenerator = new FutureSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.CME,\n                    Start = _minExpiry,\n                    End = _maxExpiry\n                },\n                _randomValueGenerator);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Future)]\n        public void ReturnsFutureSymbolGeneratorInstance(SecurityType securityType)\n        {\n            Assert.IsInstanceOf<FutureSymbolGenerator>(BaseSymbolGenerator.Create(\n                new RandomDataGeneratorSettings { SecurityType = securityType },\n                Mock.Of<IRandomValueGenerator>()\n            ));\n        }\n\n        [Test]\n        public void GetAvailableSymbolCount()\n        {\n            Assert.AreEqual(int.MaxValue, _symbolGenerator.GetAvailableSymbolCount());\n        }\n\n        [Test]\n        public void GeneratesFutureSymbolWithCorrectExpiryDate()\n        {\n            var startDate = new DateTime(2020, 01, 01);\n            var endDate = new DateTime(2020, 01, 31);\n            var futureSymbolGenerator = new FutureSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.NYMEX,\n                    Start = startDate,\n                    End = endDate\n                },\n                _randomValueGenerator);\n\n            // Generate a future symbol using a specific ticker \"NG\"\n            var symbols = BaseSymbolGeneratorTests.GenerateAssetWithTicker(futureSymbolGenerator, \"NG\").ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n            var expiry = symbol.ID.Date;\n            bool hasExpiryFunction = FuturesExpiryFunctions.FuturesExpiryDictionary.TryGetValue(symbol.Canonical, out var expiryFuncWithTicker);\n            Assert.IsTrue(hasExpiryFunction);\n            // Add one month to simulate how the expiry function takes the first day of the next month and subtracts 3 business days\n            Assert.IsTrue(expiryFuncWithTicker(expiry.AddMonths(1)).Equals(expiry));\n            Assert.AreEqual(expiry, new DateTime(2020, 01, 29));\n            Assert.Greater(expiry, startDate);\n            Assert.LessOrEqual(expiry, endDate);\n\n            // Generate a future symbol without specifying ticker\n            symbols = BaseSymbolGeneratorTests.GenerateAsset(futureSymbolGenerator).ToList();\n            Assert.AreEqual(1, symbols.Count);\n            symbol = symbols.First();\n            expiry = symbol.ID.Date;\n\n            // Ensure the expiry falls within the configured start and end range\n            Assert.Greater(expiry, startDate);\n            Assert.LessOrEqual(expiry, endDate);\n        }\n\n        [Test]\n        public void GeneratesFutureSymbolWithCorrectExpiryDateOverWiderDateRange()\n        {\n            var startDate = new DateTime(2020, 01, 01);\n            var endDate = new DateTime(2024, 01, 31);\n            var futureSymbolGenerator = new FutureSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.NYMEX,\n                    Start = startDate,\n                    End = endDate\n                },\n                _randomValueGenerator);\n\n            var expiries = new HashSet<DateTime>();\n            for (int i = 0; i < 500; i++)\n            {\n                // Generate a future symbol using a specific ticker \"NG\"\n                var symbols = BaseSymbolGeneratorTests.GenerateAssetWithTicker(futureSymbolGenerator, \"NG\").ToList();\n                Assert.AreEqual(1, symbols.Count);\n                var symbol = symbols.First();\n                var expiry = symbol.ID.Date;\n                bool hasExpiryFunction = FuturesExpiryFunctions.FuturesExpiryDictionary.TryGetValue(symbol.Canonical, out var expiryFuncWithTicker);\n                Assert.IsTrue(hasExpiryFunction);\n                Assert.IsTrue(expiryFuncWithTicker(expiry.AddMonths(1)).Equals(expiry));\n                expiries.Add(expiry);\n            }\n            Assert.Greater(expiries.Count, 1);\n        }\n\n        [TestCase(\"TEST\")]\n        [TestCase(\"NG\")]\n        public void StopsExecutionAfterReturningSingleSymbolWhenNoExpiryFunctionOrValidExpiry(string ticker)\n        {\n            // Define a small date range that does not contain any valid expiries\n            var startDate = new DateTime(2020, 01, 15);\n            var endDate = new DateTime(2020, 01, 17);\n            var futureSymbolGenerator = new FutureSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.NYMEX,\n                    Start = startDate,\n                    End = endDate\n                },\n                _randomValueGenerator);\n\n            // Generate a future symbol using a specific ticker\n            var symbols = BaseSymbolGeneratorTests.GenerateAssetWithTicker(futureSymbolGenerator, ticker);\n            var enumerator = symbols.GetEnumerator();\n\n            // At least one symbol should be produced\n            Assert.IsTrue(enumerator.MoveNext());\n\n            // No additional symbol should be generated\n            Assert.IsFalse(enumerator.MoveNext());\n        }\n\n        [Test]\n        public void NextFuture_CreatesSymbol_WithFutureSecurityTypeAndRequestedMarket()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n\n            Assert.AreEqual(Market.CME, symbol.ID.Market);\n            Assert.AreEqual(SecurityType.Future, symbol.SecurityType);\n        }\n\n        [Test]\n        public void NextFuture_CreatesSymbol_WithFutureWithValidFridayExpiry()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n\n            var expiry = symbol.ID.Date;\n            Assert.Greater(expiry, _minExpiry);\n            Assert.LessOrEqual(expiry, _maxExpiry);\n        }\n\n        [Test]\n        public void NextFuture_CreatesSymbol_WithEntryInSymbolPropertiesDatabase()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(1, symbols.Count);\n\n            var symbol = symbols.First();\n\n            var db = SymbolPropertiesDatabase.FromDataFolder();\n            Assert.IsTrue(db.ContainsKey(Market.CME, symbol, SecurityType.Future));\n        }\n    }\n\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/OptionPriceModelPriceGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing QLNet;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing Cash = QuantConnect.Securities.Cash;\nusing Option = QuantConnect.Securities.Option.Option;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class OptionPriceModelPriceGeneratorTests\n    {\n        private Security _underlying;\n        private Option _option;\n\n        public OptionPriceModelPriceGeneratorTests()\n        {\n            _underlying = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(\"USD\", 0, 1m),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n\n            var optionSymbol = Symbol.CreateOption(\n                _underlying.Symbol,\n                _underlying.Symbol.ID.Market,\n                _underlying.Symbol.SecurityType.DefaultOptionStyle(),\n                OptionRight.Call,\n                20,\n                new DateTime(2022, 1, 1));\n\n            _option = new Option(\n                optionSymbol,\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new Cash(\"USD\", 0, 1m),\n                new OptionSymbolProperties(_underlying.SymbolProperties),\n                new CashBook(),\n                new RegisteredSecurityDataTypesProvider(),\n                new OptionCache(),\n                _underlying);\n        }\n\n        [Test]\n        public void ThrowsIfSecurityIsNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                _ = new OptionPriceModelPriceGenerator(null);\n            });\n        }\n\n        [Test]\n        public void ThrowsIfSecurityIsNotOption()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                _ = new OptionPriceModelPriceGenerator(_underlying);\n            });\n        }\n\n        [Test]\n        public void ReturnsNewPrice()\n        {\n            var priceModelMock = new Mock<IOptionPriceModel>();\n            priceModelMock\n                .Setup(s => s.Evaluate(It.IsAny<OptionPriceModelParameters>()))\n                .Returns(new OptionPriceModelResult(1000, NullGreeks.Instance));\n            _option.PriceModel = priceModelMock.Object;\n            var randomPriceGenerator = new OptionPriceModelPriceGenerator(_option);\n\n            Assert.AreEqual(1000, randomPriceGenerator.NextValue(50, new DateTime(2020, 1, 1)));\n        }\n\n        [Test]\n        public void WarmedUpIfNotQLOptionPriceModel()\n        {\n            _option.PriceModel = Mock.Of<IOptionPriceModel>();\n            var blackScholesModel = new OptionPriceModelPriceGenerator(_option);\n\n            Assert.True(blackScholesModel.WarmedUp);\n        }\n\n        [Test]\n        [TestCase(true)]\n        [TestCase(false)]\n        public void WarmedUpSameQLOptionPriceModel(bool warmUp)\n        {\n            var volatilityModel = new Mock<IQLUnderlyingVolatilityEstimator>();\n            volatilityModel.SetupGet(s => s.IsReady).Returns(warmUp);\n            _option.PriceModel = new QLOptionPriceModel(process => new AnalyticEuropeanEngine(process),\n                volatilityModel.Object,\n                null,\n                null);\n\n            var blackScholesModel = new OptionPriceModelPriceGenerator(_option);\n\n            Assert.AreEqual(warmUp, blackScholesModel.WarmedUp);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/OptionSymbolGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class OptionSymbolGeneratorTests\n    {\n        private const int Seed = 123456789;\n        private static readonly IRandomValueGenerator _randomValueGenerator = new RandomValueGenerator(Seed);\n\n        private BaseSymbolGenerator _symbolGenerator;\n        private DateTime _minExpiry = new(2000, 01, 01);\n        private DateTime _maxExpiry = new(2001, 01, 01);\n        private decimal _underlyingPrice = 100m;\n        private decimal _maximumStrikePriceDeviation = 50m;\n\n        [SetUp]\n        public void Setup()\n        {\n            // initialize using a seed for deterministic tests\n            _symbolGenerator = new OptionSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.USA,\n                    Start = _minExpiry,\n                    End = _maxExpiry\n                },\n                _randomValueGenerator,\n                _underlyingPrice,\n                _maximumStrikePriceDeviation);\n        }\n\n        [Test]\n        [TestCase(SecurityType.Option)]\n        public void ReturnsFutureSymbolGeneratorInstance(SecurityType securityType)\n        {\n            Assert.IsInstanceOf<OptionSymbolGenerator>(BaseSymbolGenerator.Create(\n                new RandomDataGeneratorSettings { SecurityType = securityType },\n                Mock.Of<IRandomValueGenerator>()\n            ));\n        }\n\n        [Test]\n        public void GetAvailableSymbolCount()\n        {\n            Assert.AreEqual(int.MaxValue,\n                new OptionSymbolGenerator(Mock.Of<RandomDataGeneratorSettings>(), Mock.Of<RandomValueGenerator>(), 100m,\n                    75m).GetAvailableSymbolCount());\n        }\n\n        [Test]\n        public void NextOptionSymbol_CreatesOptionSymbol_WithCorrectSecurityTypeAndEquityUnderlying()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(3, symbols.Count);\n\n            var underlying = symbols[0];\n            var option = symbols[1];\n\n            Assert.AreEqual(SecurityType.Option, option.SecurityType);\n            Assert.AreEqual(OptionRight.Put, symbols[1].ID.OptionRight);\n            Assert.AreEqual(SecurityType.Option, symbols[2].SecurityType);\n            Assert.AreEqual(OptionRight.Call, symbols[2].ID.OptionRight);\n\n            var underlyingOrigin = option.Underlying;\n            Assert.AreEqual(underlying.Value, underlyingOrigin.Value);\n            Assert.AreEqual(Market.USA, underlying.ID.Market);\n            Assert.AreEqual(SecurityType.Equity, underlying.SecurityType);\n        }\n\n        [Test]\n        public void NextOptionSymbol_CreatesOptionSymbol_WithinSpecifiedExpiration_OnFriday()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(3, symbols.Count);\n\n            foreach (var option in new[] { symbols[1], symbols[2] })\n            {\n                var expiration = option.ID.Date;\n                Assert.LessOrEqual(_minExpiry, expiration);\n                Assert.GreaterOrEqual(_maxExpiry, expiration);\n            }\n        }\n\n        [Test]\n        public void NextOptionSymbol_CreatesOptionSymbol_WithRequestedMarket()\n        {\n            for (int i = 0; i < 50; i++)\n            {\n                var price = _randomValueGenerator.NextPrice(SecurityType.Equity, Market.USA, 100m, 100m);\n                var symbolGenerator = new OptionSymbolGenerator(\n                    new RandomDataGeneratorSettings()\n                    {\n                        Market = Market.USA,\n                        Start = _minExpiry,\n                        End = _maxExpiry\n                    },\n                    _randomValueGenerator,\n                    price,\n                    50m);\n                var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n                Assert.AreEqual(3, symbols.Count);\n\n                var option = symbols[1];\n\n                Assert.AreEqual(Market.USA, option.ID.Market);\n            }\n        }\n\n        [Test]\n        public void NextOptionSymbol_CreatesOptionSymbol_WithinSpecifiedStrikePriceDeviation()\n        {\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(_symbolGenerator).ToList();\n            Assert.AreEqual(3, symbols.Count);\n\n            foreach (var option in new []{ symbols[1], symbols[2] })\n            {\n                var strikePrice = option.ID.StrikePrice;\n                var maximumDeviation = _underlyingPrice * (_maximumStrikePriceDeviation / 100m);\n                Assert.LessOrEqual(_underlyingPrice - maximumDeviation, strikePrice);\n                Assert.GreaterOrEqual(_underlyingPrice + maximumDeviation, strikePrice);\n            }\n        }\n\n        [Test]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 6, 4 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 6, 5 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 7, 2 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 6, 10 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 6, 11 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 8, 2 00:00:00\")]\n        [TestCase(\"2021, 6, 2 00:00:00\", \"2021, 6, 15 00:00:00\")]\n        public void OptionSymbolGeneratorCreatesOptionSymbol_WithExpirationDateAtLeastThreeDaysAfterMinExpiryDate(DateTime minExpiry, DateTime maxExpiry)\n        {\n            var symbolGenerator = new OptionSymbolGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Market = Market.USA,\n                    Start = minExpiry,\n                    End = maxExpiry\n                },\n                new RandomValueGenerator(),\n                _underlyingPrice,\n                _maximumStrikePriceDeviation);\n            var symbols = BaseSymbolGeneratorTests.GenerateAsset(symbolGenerator).ToList();\n            Assert.AreEqual(3, symbols.Count);\n\n            foreach (var option in new[] { symbols[1], symbols[2] })\n            {\n                var expiration = option.ID.Date;\n                Assert.LessOrEqual(minExpiry.AddDays(3), expiration);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/RandomDataGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Securities;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.Util;\nusing static QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator;\nusing QuantConnect.Algorithm;\nusing System.Linq;\nusing System.IO;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class RandomDataGeneratorTests\n    {\n        [Test]\n        [TestCase(\"2020, 1, 1 00:00:00\", \"2020, 1, 1 00:00:00\", \"2020, 1, 1 00:00:00\")]\n        [TestCase(\"2020, 1, 1 00:00:00\", \"2020, 2, 1 00:00:00\", \"2020, 1, 16 12:00:00\")] // (31 days / 2) = 15.5 = 16 Rounds up to 12 pm\n        [TestCase(\"2020, 1, 1 00:00:00\", \"2020, 3, 1 00:00:00\", \"2020, 1, 31 00:00:00\")] // (60 days / 2) = 30\n        [TestCase(\"2020, 1, 1 00:00:00\", \"2020, 6, 1 00:00:00\", \"2020, 3, 17 00:00:00\")] // (152 days / 2) = 76\n\n        public void NextRandomGeneratedData(DateTime start, DateTime end, DateTime expectedMidPoint)\n        {\n            var randomValueGenerator = new RandomValueGenerator();\n            var midPoint = QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator.GetDateMidpoint(start, end);\n            var delistDate = QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator.GetDelistingDate(start, end, randomValueGenerator);\n\n            // midPoint and expectedMidPoint must be the same\n            Assert.AreEqual(expectedMidPoint, midPoint);\n\n            // start must be less than or equal to end\n            Assert.LessOrEqual(start, end);\n\n            // delistDate must be less than or equal to end\n            Assert.LessOrEqual(delistDate, end);\n            Assert.GreaterOrEqual(delistDate, midPoint);\n        }\n\n        [TestCase(\"20220101\", \"20230101\")]\n        public void RandomGeneratorProducesValuesBoundedForEquitiesWhenSplit(string start, string end)\n        {\n            var settings = RandomDataGeneratorSettings.FromCommandLineArguments(\n                start,\n                end,\n                \"1\",\n                \"usa\",\n                \"Equity\",\n                \"Minute\",\n                \"Dense\",\n                \"true\",\n                \"1\",\n                null,\n                \"5.0\",\n                \"30.0\",\n                \"100.0\",\n                \"60.0\",\n                \"30.0\",\n                \"BaroneAdesiWhaleyApproximationEngine\",\n                \"Daily\",\n                \"1\",\n                new List<string>(),\n                100\n            );\n\n            var securityManager = new SecurityManager(new TimeKeeper(settings.Start, new[] { TimeZones.Utc }));\n            var securityService = GetSecurityService(settings, securityManager);\n            securityManager.SetSecurityService(securityService);\n\n            var security = securityManager.CreateSecurity(Symbols.AAPL, new List<SubscriptionDataConfig>(), underlying: null);\n            var randomValueGenerator = new RandomValueGenerator();\n            var tickGenerator = new TickGenerator(settings, new TickType[1] { TickType.Trade }, security, randomValueGenerator).GenerateTicks().GetEnumerator();\n            using var sync = new SynchronizingBaseDataEnumerator(tickGenerator);\n            var tickHistory = new List<Tick>();\n\n            while (sync.MoveNext())\n            {\n                var dataPoint = sync.Current;\n                tickHistory.Add(dataPoint as Tick);\n            }\n\n            var dividendsSplitsMaps = new DividendSplitMapGenerator(\n                        Symbols.AAPL,\n                        settings,\n                        randomValueGenerator,\n                        BaseSymbolGenerator.Create(settings, randomValueGenerator),\n                        new Random(),\n                        GetDelistingDate(settings.Start, settings.End, randomValueGenerator),\n                        false);\n\n            dividendsSplitsMaps.GenerateSplitsDividends(tickHistory);\n            Assert.IsTrue(0.099m <= dividendsSplitsMaps.FinalSplitFactor && dividendsSplitsMaps.FinalSplitFactor <= 1.5m);\n\n            foreach (var tick in tickHistory)\n            {\n                tick.Value = tick.Value / dividendsSplitsMaps.FinalSplitFactor;\n                Assert.IsTrue(0.001m <= tick.Value && tick.Value <= 1000000000, $\"The tick value was {tick.Value} but should have been bounded by 0.001 and 1 000 000 000\");\n            }\n        }\n\n        [TestCase(Resolution.Tick, 3.0, 33)]\n        [TestCase(Resolution.Second, 3.0, 33)]\n        [TestCase(Resolution.Minute, 3.0, 33)]\n        [TestCase(Resolution.Hour, 3.0, 33)]\n        [TestCase(Resolution.Daily, 3.0, 33)]\n        [TestCase(Resolution.Minute, 5.0, 20)]\n        [TestCase(Resolution.Minute, 10.0, 10)]\n        public void GetProgressAsPercentageShouldLogWhenProgressExceedsThreshold(Resolution resolution, double thresholdPercent, int expectedLogCount)\n        {\n            TimeSpan step = resolution switch\n            {\n                Resolution.Tick => TimeSpan.FromTicks(1),\n                Resolution.Second => TimeSpan.FromSeconds(1),\n                Resolution.Minute => TimeSpan.FromMinutes(1),\n                Resolution.Hour => TimeSpan.FromHours(1),\n                Resolution.Daily => TimeSpan.FromDays(1),\n                _ => throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null)\n            };\n\n            var start = new DateTime(2024, 1, 1, 0, 0, 0);\n            var end = start.AddTicks(step.Ticks * 100);\n\n            var current = start;\n            var logs = new List<double>();\n            var lastLoggedProgress = 0.0;\n\n            while (current <= end)\n            {\n                var progress = RandomDataGeneratorHelper.GetProgressAsPercentage(start, end, current);\n\n                if (progress - lastLoggedProgress >= thresholdPercent)\n                {\n                    logs.Add(progress);\n                    lastLoggedProgress = progress;\n                }\n\n                current = current.Add(step);\n            }\n\n            Assert.AreEqual(expectedLogCount, logs.Count);\n            Assert.IsTrue(logs.All(p => p >= 0 && p <= 100));\n        }\n\n        [Test]\n        public void RandomDataGeneratorCompletesSuccessfully()\n        {\n            var tempFolder = Path.Combine(Path.GetTempPath(), $\"LeanTest_{Guid.NewGuid()}\");\n            var originalDataFolder = Config.Get(\"data-folder\");\n            try\n            {\n                Directory.CreateDirectory(tempFolder);\n                Config.Set(\"data-folder\", tempFolder);\n                Globals.Reset();\n\n                var hourPath = Path.Combine(tempFolder, \"equity\", \"usa\", \"hour\");\n                var dailyPath = Path.Combine(tempFolder, \"equity\", \"usa\", \"daily\");\n                var factorFilesPath = Path.Combine(tempFolder, \"equity\", \"usa\", \"factor_files\");\n                var mapFilesPath = Path.Combine(tempFolder, \"equity\", \"usa\", \"map_files\");\n\n                // Create the required folders\n                Directory.CreateDirectory(hourPath);\n                Directory.CreateDirectory(dailyPath);\n                Directory.CreateDirectory(factorFilesPath);\n                Directory.CreateDirectory(mapFilesPath);\n\n                var settings = new RandomDataGeneratorSettings\n                {\n                    Start = new DateTime(2024, 1, 1, 9, 30, 0),\n                    End = new DateTime(2024, 1, 2, 16, 0, 0),\n                    SymbolCount = 1,\n                    Market = \"usa\",\n                    SecurityType = SecurityType.Equity,\n                    Resolution = Resolution.Hour,\n                    DataDensity = DataDensity.Dense,\n                    IncludeCoarse = false,\n                    QuoteTradeRatio = 1.0,\n                    RandomSeed = 123456,\n                    HasDividendsPercentage = 0,\n                    HasSplitsPercentage = 0,\n                    HasIpoPercentage = 0,\n                    HasRenamePercentage = 0,\n                    Tickers = new List<string>() { \"AAPL\" }\n                };\n\n                var generator = GetGenerator(settings);\n\n                Assert.DoesNotThrow(() => generator.Run());\n\n                var allFiles = Directory.GetFiles(tempFolder, \"*\", SearchOption.AllDirectories);\n                Assert.Greater(allFiles.Length, 0);\n\n                var hourFiles = Directory.GetFiles(hourPath, \"*.zip\");\n                Assert.Greater(hourFiles.Length, 0);\n            }\n            finally\n            {\n                Config.Set(\"data-folder\", originalDataFolder);\n                Globals.Reset();\n                Directory.Delete(tempFolder, true);\n            }\n        }\n\n        private static QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator GetGenerator(RandomDataGeneratorSettings settings)\n        {\n            var securityManager = new SecurityManager(new TimeKeeper(settings.Start, new[] { TimeZones.Utc }));\n\n            var securityService = new SecurityService(\n                new CashBook(),\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                new SecurityInitializerProvider(new FuncSecurityInitializer(security =>\n                {\n                    // init price\n                    security.SetMarketPrice(new Tick(settings.Start, security.Symbol, 100, 100));\n                    security.SetMarketPrice(new OpenInterest(settings.Start, security.Symbol, 10000));\n\n                    // from settings\n                    security.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(settings.VolatilityModelResolution);\n\n                    // from settings\n                    if (security is Option option)\n                    {\n                        option.PriceModel = OptionPriceModels.QuantLib.Create(settings.OptionPriceEngineName,\n                            _interestRateProvider.GetRiskFreeRate(settings.Start, settings.End));\n                    }\n                })),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(\n                    new SecurityPortfolioManager(securityManager, new SecurityTransactionManager(null, securityManager), new AlgorithmSettings())),\n                new MapFilePrimaryExchangeProvider(Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\")))\n            );\n\n            securityManager.SetSecurityService(securityService);\n\n            var generator = new QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator();\n            generator.Init(settings, securityManager);\n            return generator;\n        }\n\n        private static readonly IRiskFreeInterestRateModel _interestRateProvider = new InterestRateProvider();\n\n        private static SecurityService GetSecurityService(RandomDataGeneratorSettings settings, SecurityManager securityManager)\n        {\n            var algorithm = new QCAlgorithm();\n            algorithm.Securities = securityManager;\n            var securityService = new SecurityService(\n                new CashBook(),\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                new SecurityInitializerProvider(new FuncSecurityInitializer(security =>\n                {\n                    // init price\n                    security.SetMarketPrice(new Tick(settings.Start, security.Symbol, 100, 100));\n                    security.SetMarketPrice(new OpenInterest(settings.Start, security.Symbol, 10000));\n\n                    // from settings\n                    security.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(settings.VolatilityModelResolution);\n\n                    // from settings\n                    if (security is Option option)\n                    {\n                        option.PriceModel = OptionPriceModels.QuantLib.Create(settings.OptionPriceEngineName,\n                            _interestRateProvider.GetRiskFreeRate(settings.Start, settings.End));\n                    }\n                })),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(\n                    new SecurityPortfolioManager(securityManager, new SecurityTransactionManager(null, securityManager), new AlgorithmSettings())),\n                new MapFilePrimaryExchangeProvider(Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"))),\n                algorithm: algorithm);\n            securityManager.SetSecurityService(securityService);\n\n            return securityService;\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/RandomPriceGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\nusing System.Linq;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class RandomPriceGeneratorTests\n    {\n        private Security _security;\n\n        public RandomPriceGeneratorTests()\n        {\n            _security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(\n                    typeof(TradeBar),\n                    Symbols.SPY,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    false,\n                    false,\n                    false\n                ),\n                new Cash(\"USD\", 0, 1m),\n                SymbolProperties.GetDefault(\"USD\"),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n        }\n\n        [Test]\n        public void ReturnsSameAsReference()\n        {\n            var randomMock = new Mock<IRandomValueGenerator>();\n            randomMock.Setup(s => s.NextPrice(It.IsAny<SecurityType>(), It.IsNotNull<string>(), It.IsAny<decimal>(),\n                It.IsAny<decimal>()))\n                .Returns(50);\n            var randomPriceGenerator = new RandomPriceGenerator(_security, randomMock.Object);\n            _security.SetMarketPrice(new Tick(DateTime.UtcNow, Symbols.SPY, 10, 100));\n\n            var actual = randomPriceGenerator.NextValue(1, DateTime.MinValue);\n            randomMock.Verify(s => s.NextPrice(It.IsAny<SecurityType>(), It.IsNotNull<string>(), 55, 1), Times.Once);\n            Assert.AreEqual(50, actual);\n        }\n\n        [Test]\n        public void AlwaysReady()\n        {\n            var priceGenerator = new RandomPriceGenerator(_security, Mock.Of<IRandomValueGenerator>());\n            Assert.True(priceGenerator.WarmedUp);\n        }\n\n        [Test]\n        public void ComposeRandomDataGenerator()\n        {\n            Assert.NotNull(Composer.Instance.GetExportedValueByTypeName<QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator>(\"QuantConnect.ToolBox.RandomDataGenerator.RandomDataGenerator\"));\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/RandomValueGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing System;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class RandomValueGeneratorTests\n    {\n        private const int Seed = 123456789;\n        private RandomValueGenerator randomValueGenerator;\n\n        [SetUp]\n        public void Setup()\n        {\n            // initialize using a seed for deterministic tests\n            randomValueGenerator = new RandomValueGenerator(Seed);\n        }\n\n        [Test]\n        public void NextDateTime_CreatesDateTime_WithinSpecifiedMinMax()\n        {\n            var min = new DateTime(2000, 01, 01);\n            var max = new DateTime(2001, 01, 01);\n            var dateTime = randomValueGenerator.NextDate(min, max, dayOfWeek: null);\n\n            Assert.LessOrEqual(min, dateTime);\n            Assert.GreaterOrEqual(max, dateTime);\n        }\n\n        [Test]\n        [TestCase(DayOfWeek.Sunday)]\n        [TestCase(DayOfWeek.Monday)]\n        [TestCase(DayOfWeek.Tuesday)]\n        [TestCase(DayOfWeek.Wednesday)]\n        [TestCase(DayOfWeek.Thursday)]\n        [TestCase(DayOfWeek.Friday)]\n        [TestCase(DayOfWeek.Saturday)]\n        public void NextDateTime_CreatesDateTime_OnSpecifiedDayOfWeek(DayOfWeek dayOfWeek)\n        {\n            var min = new DateTime(2000, 01, 01);\n            var max = new DateTime(2001, 01, 01);\n            var dateTime = randomValueGenerator.NextDate(min, max, dayOfWeek);\n\n            Assert.AreEqual(dayOfWeek, dateTime.DayOfWeek);\n        }\n\n        [Test]\n        public void NextDateTime_ThrowsArgumentException_WhenMaxIsLessThanMin()\n        {\n            var min = new DateTime(2000, 01, 01);\n            var max = min.AddDays(-1);\n            Assert.Throws<ArgumentException>(() =>\n                randomValueGenerator.NextDate(min, max, dayOfWeek: null)\n            );\n        }\n\n        [Test]\n        public void NextDateTime_ThrowsArgumentException_WhenRangeIsTooSmallToProduceDateTimeOnRequestedDayOfWeek()\n        {\n            var min = new DateTime(2019, 01, 15);\n            var max = new DateTime(2019, 01, 20);\n            Assert.Throws<ArgumentException>(() =>\n                // no monday between these dates, so impossible to fulfill request\n                randomValueGenerator.NextDate(min, max, DayOfWeek.Monday)\n            );\n        }\n\n        [Test]\n        public void NextPrice_ReturnsZeroForOptionsZeroReferencePrice()\n        {\n            var price = randomValueGenerator.NextPrice(SecurityType.Option, Market.USA, 0m, 1m);\n            Assert.AreEqual(0m, price);\n        }\n\n        [Test]\n        public void NextPrice_ThrowsIfReferencePriceIsInvalid([Values] SecurityType securityType)\n        {\n            // Negative reference price\n            Assert.Throws<ArgumentException>(() =>\n                randomValueGenerator.NextPrice(securityType, null, -1m, 1m)\n            );\n\n            // Zero reference price\n            if (securityType != SecurityType.Option)\n            {\n                Assert.Throws<ArgumentException>(() =>\n                    randomValueGenerator.NextPrice(securityType, null, 0m, 1m)\n                );\n            }\n        }\n\n        [TestCase(0)]\n        [TestCase(-1)]\n        public void NextPrice_ThrowsIfMaximumPercentDeviationIsInvalid(decimal maximumPercentDeviation)\n        {\n            Assert.Throws<ArgumentException>(() =>\n                randomValueGenerator.NextPrice(SecurityType.Equity, null, 100m, maximumPercentDeviation)\n            );\n        }\n\n        [Test]\n        public void NextPrice_ReturnsSamePriceIfFailsToGetAValidOne()\n        {\n            // Default min price variation for crypto is 0.01\n            var maximumPercentDeviation = 0.45m;\n            var referencePrice = 0.1m; // too close to the minimum price variation\n\n            var price = randomValueGenerator.NextPrice(SecurityType.Crypto, Market.GDAX, referencePrice, maximumPercentDeviation);\n\n            Assert.AreEqual(referencePrice, price);\n        }\n\n        [Test]\n        public void NextPrice_PricesIsUpdatedEvenIfMaxPercentageDeviationIsLessThanMinPriceVariation()\n        {\n            // Default min price variation for crypto is 0.01\n            var maximumPercentDeviation = 0.45m;\n            var referencePrice = 2m;\n\n            // The maximum price variation is 0.45% of 2, which is 0.009, less than the minimum price variation of 0.01.\n            // The generated price will be rounded back to 2m, but this should be properly handled.\n\n            var price = randomValueGenerator.NextPrice(SecurityType.Crypto, Market.GDAX, referencePrice, maximumPercentDeviation);\n\n            Assert.AreNotEqual(referencePrice, price);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/SecurityInitializerProviderTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing Moq;\nusing NUnit.Framework;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox.RandomDataGenerator;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class SecurityInitializerProviderTests\n    {\n        [Test]\n        public void NotNull()\n        {\n            var securityInitializerProvider = new SecurityInitializerProvider(Mock.Of<ISecurityInitializer>());\n            Assert.NotNull(securityInitializerProvider.SecurityInitializer);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/RandomDataGenerator/TickGeneratorTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing QuantConnect.ToolBox.RandomDataGenerator;\n\nnamespace QuantConnect.Tests.ToolBox.RandomDataGenerator\n{\n    [TestFixture]\n    public class TickGeneratorTests\n    {\n        private Symbol _symbol = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n        private Security _security;\n        private ITickGenerator _tickGenerator;\n\n        [SetUp]\n        public void Setup()\n        {\n            var start = new DateTime(2020, 1, 6);\n            var end = new DateTime(2020, 1, 10);\n\n            // initialize using a seed for deterministic tests\n            _symbol = Symbol.Create(\"AAPL\", SecurityType.Equity, Market.USA);\n\n            _security = new Security(\n                SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork),\n                new SubscriptionDataConfig(typeof(TradeBar),\n                    _symbol,\n                    Resolution.Minute,\n                    TimeZones.NewYork,\n                    TimeZones.NewYork,\n                    true, true, false),\n                new Cash(Currencies.USD, 0, 0),\n                SymbolProperties.GetDefault(Currencies.USD),\n                ErrorCurrencyConverter.Instance,\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCache()\n            );\n            _security.SetMarketPrice(new Tick(start, _security.Symbol, 100, 100));\n            _security.SetMarketPrice(new OpenInterest(start, _security.Symbol, 10000));\n\n            _tickGenerator = new TickGenerator(\n                new RandomDataGeneratorSettings()\n                {\n                    Start = start,\n                    End = end\n                },\n                new TickType[3] { TickType.Trade, TickType.Quote, TickType.OpenInterest },\n                _security,\n                new RandomValueGenerator());\n\n        }\n\n        [Test]\n        public void NextTick_CreatesTradeTick_WithPriceAndQuantity()\n        {\n            var dateTime = new DateTime(2000, 01, 01);\n            var tick = _tickGenerator.NextTick(dateTime, TickType.Trade, 1m);\n\n            Assert.AreEqual(_symbol, tick.Symbol);\n            Assert.AreEqual(dateTime, tick.Time);\n            Assert.AreEqual(TickType.Trade, tick.TickType);\n            Assert.LessOrEqual(99m, tick.Value);\n            Assert.GreaterOrEqual(101m, tick.Value);\n\n            Assert.Greater(tick.Quantity, 0);\n            Assert.LessOrEqual(tick.Quantity, 1500);\n        }\n\n        [Test]\n        public void NextTick_CreatesQuoteTick_WithCommonValues()\n        {\n            var dateTime = new DateTime(2000, 01, 01);\n            var tick = _tickGenerator.NextTick(dateTime, TickType.Quote, 1m);\n\n            Assert.AreEqual(_symbol, tick.Symbol);\n            Assert.AreEqual(dateTime, tick.Time);\n            Assert.AreEqual(TickType.Quote, tick.TickType);\n            Assert.GreaterOrEqual(tick.Value, 99m);\n            Assert.LessOrEqual(tick.Value, 101m);\n        }\n\n        [Test]\n        public void NextTick_CreatesQuoteTick_WithBidData()\n        {\n            var dateTime = new DateTime(2000, 01, 01);\n            var tick = _tickGenerator.NextTick(dateTime, TickType.Quote, 1m);\n\n            Assert.Greater(tick.BidSize, 0);\n            Assert.LessOrEqual(tick.BidSize, 1500);\n            Assert.GreaterOrEqual(tick.BidPrice, 98.9m);\n            Assert.LessOrEqual(tick.BidPrice, 100.9m);\n            Assert.GreaterOrEqual(tick.Value, tick.BidPrice);\n        }\n\n        [Test]\n        public void NextTick_CreatesQuoteTick_WithAskData()\n        {\n            var dateTime = new DateTime(2000, 01, 01);\n            var tick = _tickGenerator.NextTick(dateTime, TickType.Quote, 1m);\n\n            Assert.GreaterOrEqual(tick.AskSize, 0);\n            Assert.LessOrEqual(tick.AskSize, 1500);\n            Assert.GreaterOrEqual(tick.AskPrice, 99.1m);\n            Assert.LessOrEqual(tick.AskPrice, 101.1m);\n            Assert.LessOrEqual(tick.Value, tick.AskPrice);\n        }\n\n        [Test]\n        public void NextTick_CreatesOpenInterestTick()\n        {\n            var dateTime = new DateTime(2000, 01, 01);\n            var tick = _tickGenerator.NextTick(dateTime, TickType.OpenInterest, 10m);\n\n            Assert.AreEqual(dateTime, tick.Time);\n            Assert.AreEqual(TickType.OpenInterest, tick.TickType);\n            Assert.AreEqual(typeof(OpenInterest), tick.GetType());\n            Assert.AreEqual(_symbol, tick.Symbol);\n            Assert.GreaterOrEqual(tick.Quantity, 9000);\n            Assert.LessOrEqual(tick.Quantity, 11000);\n            Assert.AreEqual(tick.Value, tick.Quantity);\n        }\n\n        [Test]\n        [TestCase(Resolution.Tick, DataDensity.Dense)]\n        [TestCase(Resolution.Second, DataDensity.Dense)]\n        [TestCase(Resolution.Minute, DataDensity.Dense)]\n        [TestCase(Resolution.Hour, DataDensity.Dense)]\n        [TestCase(Resolution.Daily, DataDensity.Dense)]\n        [TestCase(Resolution.Tick, DataDensity.Sparse)]\n        [TestCase(Resolution.Second, DataDensity.Sparse)]\n        [TestCase(Resolution.Minute, DataDensity.Sparse)]\n        [TestCase(Resolution.Hour, DataDensity.Sparse)]\n        [TestCase(Resolution.Daily, DataDensity.Sparse)]\n        [TestCase(Resolution.Tick, DataDensity.VerySparse)]\n        [TestCase(Resolution.Second, DataDensity.VerySparse)]\n        [TestCase(Resolution.Minute, DataDensity.VerySparse)]\n        [TestCase(Resolution.Hour, DataDensity.VerySparse)]\n        [TestCase(Resolution.Daily, DataDensity.VerySparse)]\n        public void NextTickTime_CreatesTimes(Resolution resolution, DataDensity density)\n        {\n            var count = 100;\n            var deltaSum = TimeSpan.Zero;\n            var previous = new DateTime(2019, 01, 14, 9, 30, 0);\n            var increment = resolution.ToTimeSpan();\n            if (increment == TimeSpan.Zero)\n            {\n                increment = TimeSpan.FromMilliseconds(500);\n            }\n\n            var marketHours = MarketHoursDatabase.FromDataFolder()\n                .GetExchangeHours(_symbol.ID.Market, _symbol, _symbol.SecurityType);\n            for (int i = 0; i < count; i++)\n            {\n                var next = _tickGenerator.NextTickTime(previous, resolution, density);\n                var barStart = next.Subtract(increment);\n                Assert.Less(previous, next);\n                Assert.IsTrue(marketHours.IsOpen(barStart, next, false));\n\n                var delta = next - previous;\n                deltaSum += delta;\n\n                previous = next;\n            }\n\n            var avgDelta = TimeSpan.FromTicks(deltaSum.Ticks / count);\n            switch (density)\n            {\n                case DataDensity.Dense:\n                    // more frequent than once an increment\n                    Assert.Less(avgDelta, increment);\n                    break;\n\n                case DataDensity.Sparse:\n                    // less frequent that once an increment\n                    Assert.Greater(avgDelta, increment);\n                    break;\n\n                case DataDensity.VerySparse:\n                    // less frequent than one every 10 increments\n                    Assert.Greater(avgDelta, TimeSpan.FromTicks(increment.Ticks * 10));\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(density), density, null);\n            }\n        }\n\n        [Test]\n        public void HistoryIsNotEmpty()\n        {\n            var history = _tickGenerator.GenerateTicks().ToList();\n            Assert.IsNotEmpty(history);\n            Assert.That(history.Select(s => s.Symbol), Is.All.EqualTo(_symbol));\n        }\n\n        [Test]\n        public void HistoryIsBetweenStartAndEndDate()\n        {\n            var start = new DateTime(2020, 1, 6);\n            var end = new DateTime(2020, 1, 10);\n            var history = _tickGenerator.GenerateTicks().ToList();\n            Assert.IsNotEmpty(history);\n            Assert.That(history.All(s => start <= s.Time && s.Time <= end));\n        }\n\n        [Test]\n        public void HistoryGeneratesOpenInterestDataAsExpected()\n        {\n            var start = new DateTime(2020, 1, 6);\n            var end = new DateTime(2020, 1, 10);\n            var history = _tickGenerator.GenerateTicks().ToList();\n            Assert.IsNotEmpty(history);\n            Assert.AreEqual(3, history.Where(s => s.TickType == TickType.OpenInterest).Count());\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/ToolBox/ToolBoxTests.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing NUnit.Framework;\nusing QuantConnect.Interfaces;\nusing System;\nusing System.Linq;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.Tests.ToolBox\n{\n    [TestFixture]\n    public class ToolBoxTests\n    {\n        [Test]\n        public void ComposeDataQueueHandlerInstances()\n        {\n            var type = typeof(IDataQueueHandler);\n\n            var types = AppDomain.CurrentDomain.Load(\"QuantConnect.ToolBox\")\n                .GetTypes()\n                .Where(p => type.IsAssignableFrom(p) && p.IsClass && !p.IsAbstract)\n                .ToList();\n\n            Assert.Zero(types.Count);       \n        }\n\n        [TestCase(\"--app=RDG --tickers=AAPL --resolution=Daily --from-date=20200820-00:00:00 --to-date=20200830-00:00:00\", 1)]\n        [TestCase(\"--app=RDG --resolution=Daily --from-date=20200820-00:00:00 --to-date=20200830-00:00:00\", 0)]\n        [TestCase(\"--app=RDG --tickers=AAPL,SPY,TSLA --resolution=Daily --from-date=20200820-00:00:00 --to-date=20200830-00:00:00\", 3)]\n        [TestCase(\"--app=RDG --tickers=ES --security-type=Future --resolution=Minute --destination-dir=/Lean/Data\", 1)]\n        public void CanParseTickersCorrectly(string args, int expectedTcikerCount)\n        {\n            var options = ToolboxArgumentParser.ParseArguments(args.Split(' '));\n            var tickers = ToolboxArgumentParser.GetTickers(options);\n\n            Assert.AreEqual(expectedTcikerCount, tickers.Count);\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/readme.md",
    "content": "QuantConnect Testing\n=============\n\nBefore starting any testing, follow the [installation instructions](https://github.com/QuantConnect/Lean#installation-instructions) to get LEAN running C# algorithms in your machine. \nFor any Python related tests please ensure you have followed the setup as described [here](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#install-python-36).\n\nIf the above installation, build, and initial run was successful than we can move forward to testing.\n\n\n## Visual Studio:\n\n### Locating Tests\n\n- Open Visual Studios\n- Open Test Explorer (\"Test\" > \"Test Explorer\")\n- The list should populate itself as it reads all the tests it found during the build process. If not, press \"Run All Tests\" and let VS find all of the tests.\n- From here select the tests you would like to run and begin running them.\n\n\n### Failed Test Logs\n\n- On a failed test, check the test for information by clicking on the desired test and selecting \"Open Additional Output\"\n- This will show the stack trace and where the code failed to meet the testing requirements. \n\n\n### Common Problems\n\n#### Having .NetFramework issues with testing?\n- Install [NUnit3TestAdapter](https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter) for VS\n\n#### Missing dependencies for Python Algorithm?\n- Use pip or conda to install the module.\n\n\n"
  },
  {
    "path": "ToolBox/AlgoSeekFuturesConverter/AlgoSeek.US.Futures.PriceMultipliers.1.1.csv",
    "content": "Globex,Product Name,MultipleFactor,Info\n10Y,Micro 10-Year Yield Futures,0.1,\n1S,Propane Non-LDH Mont Belvieu (OPIS) BALMO Futures,1,\n22,Argus Propane Far East Index BALMO Futures,1,\n2YY,Micro 2-Year Yield Futures,0.1,\n30Y,Micro 30-Year Yield Futures,0.1,\n5YY,Micro 5-Year Yield Futures,0.1\n6A,Australian Dollar Futures,0.01,\n6B,British Pound Futures,0.01,\n6C,Canadian Dollar Futures,0.01,\n6E,Euro FX Futures,0.01,\n6J,Japanese Yen Futures,0.0001,\n6L,Brazilian Real Futures,0.01,\n6M,Mexican Peso Futures,0.0001,\n6N,New Zealand Dollar Futures,0.01,\n6R,Russian Ruble Futures,0.0001,\n6S,Swiss Franc Futures,0.01,\n6Z,South African Rand Futures,0.0001,\nA0D,Mini European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,0.1,\nA0F,Mini Singapore Fuel Oil 180 cst (Platts) Futures,0.1,\nA1L,Gulf Coast ULSD (Platts) Up-Down BALMO Futures,1,\nA1M,Gulf Coast Jet (Platts) Up-Down BALMO Futures,1,\nA1R,Propane Non-LDH Mont Belvieu (OPIS) Futures,0.001,\nA32,European Propane CIF ARA (Argus) BALMO Futures,1,\nA3G,Premium Unleaded Gasoline 10 ppm FOB MED (Platts) Futures,0.1,\nA7E,Argus Propane Far East Index Futures,0.1,\nA7I,Gasoline Euro-bob Oxy NWE Barges (Argus) Crack Spread BALMO Futures,1,\nA7Q,Mont Belvieu Natural Gasoline (OPIS) Futures,0.001,\nA8J,Mont Belvieu Normal Butane (OPIS) BALMO Futures,1,\nA8K,Conway Propane (OPIS) Futures,0.001,\nA8O,Mont Belvieu LDH Propane (OPIS) BALMO Futures,1,\nA91,Argus Propane Far East Index vs. European Propane CIF ARA (Argus) Futures,0.1,\nA9N,Argus Propane (Saudi Aramco) Futures,0.1,\nAA6,Group Three ULSD (Platts) vs. NY Harbor ULSD Futures,0.01,\nAA8,Group Three Sub-octane Gasoline (Platts) vs. RBOB Futures,0.01,\nABS,Singapore Fuel Oil 180 cst (Platts) BALMO Futures,1,\nABT,Singapore Fuel Oil 380 cst (Platts) BALMO Futures,1,\nAC0,Mont Belvieu Ethane (OPIS) Futures,0.001,\nACD,Australian Dollar/Canadian Dollar Futures,0.01,\nAD0,Mont Belvieu Normal Butane (OPIS) Futures,0.001,\nADB,Brent Crude Oil vs. Dubai Crude Oil (Platts) Futures,0.1,\nAE5,Argus LLS vs. WTI (Argus) Trade Month Futures,1,\nAGA,Singapore Gasoil (Platts) vs. Low Sulphur Gasoil Futures,0.1,\nAJL,Los Angeles CARBOB Gasoline (OPIS) vs. RBOB Gasoline Futures,1,\nAJS,Los Angeles Jet (OPIS) vs. NY Harbor ULSD Futures,0.01,\nAJY,Australian Dollar/Japanese Yen Futures,1,\nAKL,Los Angeles CARB Diesel (OPIS) vs. NY Harbor ULSD Futures,0.01,\nAKZ,European Naphtha (Platts) BALMO Futures,1,\nANE,Australian Dollar/New Zealand Dollar Futures,0.01,\nAPS,European Propane CIF ARA (Argus) Futures,1,\nAR0,Mont Belvieu Natural Gasoline (OPIS) BALMO Futures,1,\nARE,RBOB Gasoline Crack Spread Futures,1,\nAUP,Aluminum MW U.S. Transaction Premium Platts (25MT) Futures,0.001,\nAVZ,Gulf Coast HSFO (Platts) BALMO Futures,1,\nAW,Bloomberg Commodity Index Futures,10,\nAYV,Mars (Argus) vs. WTI Trade Month Futures,1,\nAYX,Mars (Argus) vs. WTI Financial Futures,1,\nAZ1,Ethanol T2 FOB Rdam Including Duty (Platts) Futures,0.1,\nB0,Mont Belvieu LDH Propane (OPIS) Futures,0.001,\nB7H,Gasoline Euro-bob Oxy NWE Barges (Argus) Futures,0.1,\nBCF,Black Sea Corn Financially Settled (Platts) Futures,1,\nBIO,E-mini Nasdaq-100 Biotechnology Index Futures,1,\nBK,WTI-Brent Financial Futures,1,\nBOO,3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread (1000mt) Futures,0.1,\nBR7,Gasoline Euro-bob Oxy NWE Barges (Argus) BALMO Futures,1,\nBTC,Bitcoin Futures,100,\nBWF,Black Sea Wheat Financially Settled (Platts) Futures,1,\nBZ,Brent Last Day Financial Futures,1,\nCB,Cash-settled Butter Futures,0.001,\nCJY,Canadian Dollar/Japanese Yen Futures,1,\nCL,Crude Oil Futures,1,\nCNH,Standard-Size USD/Offshore RMB (CNH) Futures,0.01,\nCRB,Gulf Coast CBOB Gasoline A2 (Platts) vs. RBOB Gasoline Futures,0.01,\nCSC,Cash-Settled Cheese Futures,0.1,\nCSW,Clearbrook Bakken Sweet Crude Oil Monthly Index (Net Energy) Futures,0.1,\nCSX,WTI Financial Futures,1,\nCU,Chicago Ethanol (Platts) Futures,0.001,\nD1N,Singapore Mogas 92 Unleaded (Platts) Brent Crack Spread Futures,0.1,\nDC,Class III Milk Futures,1,\nDCB,Dubai Crude Oil (Platts) Financial Futures,0.1,\nDY,Dry Whey Futures,0.001,\nE6,Japan C&F Naphtha (Platts) BALMO Futures,1,\nE7,E-mini Euro FX Futures,0.001,\nEAD,Euro/Australian Dollar Futures,0.01,\nECD,Euro/Canadian Dollar Futures,0.01,\nEDP,Aluminium European Premium Duty-Paid (Metal Bulletin) Futures,1,\nEH,Ethanol Futures,0.1,\nEI,E-mini FTSE Emerging Index Futures,1,\nEMD,E-mini S&P MidCap 400 Futures,1,\nEN,European Naphtha (Platts) Crack Spread Futures,0.001,\nEPN,European Propane CIF ARA (Argus) vs. Naphtha Cargoes CIF NWE (Platts) Futures,0.1,\nES,E-mini S&P 500 Futures,1,\nESK,Euro/Swedish Krona Futures,0.01,\nETH,Ether Futures,1,\nEVC,Singapore Fuel Oil 380 cst (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,1,\nEWG,East-West Gasoline Spread (Platts-Argus) Futures,0.1,\nEWN,East-West Naphtha: Japan C&F vs. Cargoes CIF NWE Spread (Platts) Futures,0.1,\nEXR,\"RBOB Gasoline vs. Euro-bob Oxy NWE Barges (Argus) (350,000 gallons) Futures\",0.01,\nF1U,5-Year USD MAC Swap Futures,100,\nFO,3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread Futures,0.1,\nFRC,Freight Route TC14 (Baltic) Futures,1,\nFSS,1% Fuel Oil Cargoes FOB NWE (Platts) vs. 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,0.1,\nGC,Gold Futures,10,\nGCU,Gulf Coast HSFO (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,0.1,\nGD,S&P-GSCI Commodity Index Futures,1,\nGDK,Class IV Milk Futures,1,\nGE,Eurodollar Futures,1,\nGF,Feeder Cattle Futures,0.001,\nGNF,Non-fat Dry Milk Futures,0.001,\nHCL,WTI Houston Crude Oil Futures,1,\nHE,Lean Hog Futures,0.001,\nHG,Copper Futures,0.01,\nHH,Natural Gas (Henry Hub) Last-day Financial Futures,0.1,\nHO,NY Harbor ULSD Futures,0.01,\nHP,Natural Gas (Henry Hub) Penultimate Financial Futures,0.1,\nHRC,U.S. Midwest Domestic Hot-Rolled Coil Steel (CRU) Index Futures,1,\nHTT,WTI Houston (Argus) vs. WTI Trade Month Futures,1,\nIBV,USD-Denominated Ibovespa Index Futures,100,\nJ7,E-mini Japanese Yen Futures,0.00001,\nJA,Japan C&F Naphtha (Platts) Futures,0.1,\nJET,NY Buckeye Jet Fuel (Platts) vs. NY Harbor ULSD Futures,0.01,\nJTB,NY Buckeye Jet Fuel (Platts) vs. NY Harbor ULSD BALMO Futures,1,\nKE,KC HRW Wheat Futures,1,\nKRW,Korean Won Futures,0.00001,\nLBR,Lumber Futures,1,\nLBS,Random Length Lumber Futures,1,\nLE,Live Cattle Futures,0.001,\nLIB,7-year Eris Swap Futures,1,\nLID,4-year Eris Swap Futures,1,\nLIE,30-year Eris Swap Futures,1,\nLIT,2-Year Eris Swap Futures,1,\nLIW,5-year Eris Swap Futures,1,\nLIY,10-year Eris Swap Futures,1,\nLT,Gulf Coast ULSD (Platts) Up-Down Futures,0.01,\nM1B,Micro Gasoil 0.1% Barges FOB ARA (Platts) Futures,1,\nM2K,Micro E-mini Russell 2000 Index Futures,1,\nM35,Micro European 3.5% Fuel Oil Cargoes FOB Med (Platts) Futures,0.1,\nM5F,Micro Coal (API 5) fob Newcastle (Argus/McCloskey) Futures,1,\nM6A,E-micro Australian Dollar/American Dollar Futures,100,\nM6B,E-micro British Pound/American Dollar Futures,100,\nM6C,Micro USD/CAD Futures,100,\nM6E,E-micro Euro/American Dollar Futures,100,\nM6J,Micro USD/JPY Futures,100,\nM6S,Micro USD/CHF Futures,1000,\nMAE,Mini Argus Propane Far East Index Futures,0.1,\nMAF,Micro Singapore Fuel Oil 380CST (Platts) Futures,1,\nMBT,Micro Bitcoin Futures,100,\nMCD,E-micro Canadian Dollar/American Dollar Futures,100,\nMCL,Micro WTI Crude Oil Futures,1,\nME,Gulf Coast Jet (Platts) Up-Down Futures,0.01,\nMEF,Micro European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,0.1,\nMEE,Mini European Naphtha (Platts) BALMO Futures,1,\nMEO,Mini Gasoline Euro-bob Oxy NWE Barges (Argus) Futures,0.1,\nMES,Micro E-mini Standard and Poor's 500 Stock Price Index Futures,1,\nMET,Micro Ether Futures,1,\nMFB,Gulf Coast HSFO (Platts) Futures,1,\nMFF,Coal (API4) FOB Richards Bay (ARGUS-McCloskey) Futures,1,\nMGB,Mini Gasoil 0.1 Barges FOB Rdam (Platts) vs. Low Sulphur Gasoil Futures,0.1,\nMGC,E-micro Gold Futures,10,\nMGT,Micro Gold TAS,1,\nMIB,BTIC on Micro Bitcoin Futures,1,\nMIR,E-micro Indian Rupee/USD Futures,1,\nMJN,Mini Japan C&F Naphtha (Platts) Futures,0.1,\nMJY,E-micro Japanese Yen/American Dollar Futures,100,\nMM,New York Harbor Residual Fuel 1.0% (Platts) Futures,1,\nMMF,Mini 3.5% Fuel Oil Cargoes FOB MED (Platts) Financial Futures,0.1,\nMNC,Mini European Naphtha CIF NWE (Platts) Futures,0.1,\nMNH,Micro USD/CNH Futures,100,\nMNQ,Micro E-mini Nasdaq-100 Index Futures,1,\nMPS,Mini European Propane CIF ARA (Argus) Futures,2,\nMRB,BTIC on Micro Ether Futures,1,\nMSF,E-micro Swiss Franc/American Dollar Futures,100,\nMSG,Mini Singapore Gasoil (Platts) Futures,0.1,\nMTB,Mini Singapore Fuel Oil 380 cst (Platts) BALMO Futures,3,\nMTF,Coal (API2) CIF ARA (ARGUS-McCloskey) Futures,1,\nMTS,Mini Singapore Fuel Oil 380 cst (Platts) Futures,0.1,\nMYM,Micro E-mini Dow Jones Industrial Average Index Futures,100,\nN1B,Singapore Mogas 92 Unleaded (Platts) Futures,4,\nN1U,10-Year USD MAC Swap Futures,5,\nNBB,Naphtha Cargoes CIF NWE (Platts) Crack Spread (1000mt) BALMO Futures,6,\nNG,Henry Hub Natural Gas Futures,0.1,\nNIY,Nikkei/Yen Futures,100,\nNKD,Nikkei/USD Futures,100,\nNN,Henry Hub Natural Gas Last Day Financial Futures,0.1,\nNOK,Norwegian Krone Futures,0.001,\nNOO,Naphtha Cargoes CIF NWE (Platts) Crack Spread (1000mt) Futures,0.01,\nNQ,E-mini Nasdaq-100 Futures,1,\nPA,Palladium Futures,1,\nPAM,Micro Palladium Futures,1,\nPJY,British Pound/Japanese Yen Futures,1,\nPL,Platinum Futures,10,\nPLN,Polish Zloty Futures,0.001,\nPSF,British Pound/Swiss Franc Futures,0.01,\nQC,E-mini Copper Futures,0.01,\nQG,E-mini Natural Gas Futures,0.1,\nQI,E-mini Silver Futures,0.01,\nQM,E-mini Crude Oil Futures,0.1,\nQO,E-mini Gold Futures,1,\nR5O,Micro European FOB Rdam Marine Fuel 0.5% Barges (Platts) Futures,1,\nRB,RBOB Gasoline Futures,0.01,\nRBB,RBOB Gasoline Brent Crack Spread Futures,0.1,\nRF,Euro/Swiss Franc Futures,0.01,\nRP,Euro/British Pound Futures,0.001,\nRS1,E-mini Russell 1000 Index Futures,1,\nRSG,E-mini Russell 1000 Growth Index Futures,1,\nRSV,E-mini Russell 1000 Value Index Futures,1,\nRTY,E-mini  Russell 2000 Index Futures,1,\nRVR,Gulf Coast Unl 87 Gasoline M2 (Platts) vs. RBOB Gasoline Futures,0.01,\nRX,Dow Jones Real Estate Futures,10,\nRY,Euro/Japanese Yen Futures,1,\nSDA,S&P 500 Annual Dividend Index Futures,0.1,\nSE,Singapore Fuel Oil 380 cst (Platts) Futures,0.1,\nSEK,Swedish Krona Futures,0.001,\nS5O,Micro Singapore FOB Marine Fuel 0.5% (Platts) Futures,1,\nSI,Silver Futures,0.1,\nSIL,1000-oz. Silver Futures,0.1,\nSIR,Indian Rupee/USD Futures,1,\nSON,Quarterly IMM SONIA Futures,8,\nSP,S&P 500 Futures,1,\nSR1,One-Month SOFR Futures,9,\nSR3,Three-Month SOFR Futures,10,\nT7K,Gasoline Euro-bob Oxy NWE Barges (Argus) Crack Spread Futures,0.1,\nTIO,Iron Ore 62% Fe CFR China (TSI) Futures,1,\nTL,Freight Route TD3C (Baltic) Futures,11,\nTM,Freight Route TC2 (Baltic) Futures,1,\nTN,Ultra 10-Year U.S. Treasury Note Futures,100,\nTPY,Yen Denominated TOPIX Futures,1,\nTRI,S&P 500 Total Return Index Futures,1,\nUA,Singapore Fuel Oil 180 cst (Platts) Futures,0.1,\nUB,Ultra U.S. Treasury Bond Futures,100,\nUME,Urea (Granular) FOB Middle East Futures,1,\nUN,European Naphtha Cargoes CIF NWE (Platts) Futures,0.1,\nUV,European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures,0.1,\nVX,Cboe Volatility Index (VIX),1,\nWCW,Western Canadian Select Oil (Net Energy) Monthly Index Futures,1,\nWTT,WTI Midland (Argus) vs. WTI Trade Month Futures,1,\nXAB,E-mini Materials Select Sector Futures,1,\nXAE,E-mini Energy Select Sector Futures,1,\nXAF,E-mini Financial Select Sector Futures,1,\nXAI,E-mini Industrial Select Sector Futures,1,\nXAK,E-mini Technology Select Sector Futures,1,\nXAP,E-mini Consumer Staples Select Sector Futures,1,\nXAR,E-mini Real Estate Select Sector Futures,1,\nXAU,E-mini Utilities Select Sector Futures,1,\nXAV,E-mini Health Care Select Sector Futures,1,\nXAY,E-mini Consumer Discretionary Select Sector Futures,1,\nXAZ,E-mini Communication Services Select Sector Futures,1,\nXC,Mini-Corn Futures,100,\nXK,Mini Soybean Futures,100,\nXW,Mini-sized Chicago SRW Wheat Futures,100,\nYM,E-mini Dow ($5) Futures,100,\nYO,Sugar # 11 CME Globex Futures,0.01,\nZB,U.S. Treasury Bond Futures,100,\nZC,Corn Futures,1,\nZF,5-Year T-Note Futures,100,\nZL,Soybean Oil Futures,0.01,\nZM,Soybean Meal Futures,10,\nZN,10-Year T-Note Futures,100,\nZO,Oats Futures,1,\nZQ,30 Day Federal Funds Futures,1,\nZR,Rough Rice Futures,0.1,\nZS,Soybean Futures,1,\nZT,2-Year T-Note Futures,100,\nZW,Chicago SRW Wheat Futures,1,\n"
  },
  {
    "path": "ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesConverter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.ToolBox.AlgoSeekFuturesConverter\n{\n    using Processors = Dictionary<Symbol, List<List<AlgoSeekFuturesProcessor>>>;\n\n    /// <summary>\n    /// Process a directory of algoseek futures files into separate resolutions.\n    /// </summary>\n    public class AlgoSeekFuturesConverter\n    {\n        private readonly DirectoryInfo _source;\n        private readonly DirectoryInfo _remote;\n        private readonly string _destination;\n        private readonly List<Resolution> _resolutions;\n        private readonly DateTime _referenceDate;\n        private readonly HashSet<string> _symbolFilter;\n\n        /// <summary>\n        /// Create a new instance of the AlgoSeekFutures Converter. Parse a single input directory into an output.\n        /// </summary>\n        /// <param name=\"resolutions\">Convert this resolution</param>\n        /// <param name=\"referenceDate\">Datetime to be added to the milliseconds since midnight. Algoseek data is stored in channel files (XX.bz2) and in a source directory</param>\n        /// <param name=\"remote\">Remote directory of the .bz algoseek files</param>\n        /// <param name=\"source\">Source directory of the .csv algoseek files</param>\n        /// <param name=\"destination\">Destination directory of the processed future files</param>\n        /// <param name=\"symbolFilter\">Collection of underlying ticker to process.</param>\n        public AlgoSeekFuturesConverter(List<Resolution> resolutions, DateTime referenceDate, string remote, string source, string destination, HashSet<string> symbolFilter = null)\n        {\n            _source = new DirectoryInfo(source);\n            _remote = new DirectoryInfo(remote);\n            _referenceDate = referenceDate;\n            _destination = destination;\n            _resolutions = resolutions;\n            _symbolFilter = symbolFilter;\n        }\n\n        /// <summary>\n        /// Give the reference date and source directory, convert the algoseek data into n-resolutions LEAN format.\n        /// </summary>\n        public void Convert()\n        {\n            Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Copying remote raw data files locally.\");\n            //Get the list of available raw files, copy from its remote location to a local folder and then for each file open a separate streamer.\n\n            var files = GetFilesInRawFolder()\n                .Where(f => (f.Extension == \".gz\" || f.Extension == \".bz2\") && !f.Name.Contains(\"option\"))\n                .Select(remote => remote.CopyTo(Path.Combine(Path.GetTempPath(), remote.Name), true))\n                .ToList();\n\n            Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Loading {0} AlgoSeekFuturesReader for {1} \", files.Count, _referenceDate);\n\n            //Initialize parameters\n            var totalLinesProcessed = 0L;\n            var totalFiles = files.Count;\n            var totalFilesProcessed = 0;\n            var start = DateTime.MinValue;\n\n            var symbolMultipliers = LoadSymbolMultipliers();\n\n            //Extract each file massively in parallel.\n            Parallel.ForEach(files, file =>\n            {\n                try\n                {\n                    Log.Trace(\"Remote File :\" + file);\n\n                    var csvFile = Path.Combine(_source.FullName, Path.GetFileNameWithoutExtension(file.Name));\n\n                    Log.Trace(\"Source File :\" + csvFile);\n\n                    if (!File.Exists(csvFile))\n                    {\n                        // create the directory first or else 7z will fail\n                        var csvFileInfo = new FileInfo(csvFile);\n                        Directory.CreateDirectory(csvFileInfo.DirectoryName);\n\n                        Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Extracting \" + file);\n\n                        // Never time out extracting an archive; they can be pretty big\n                        // and take a while to extract depending on the computer running this application\n                        Compression.Extract7ZipArchive(file.FullName, _source.FullName, -1);\n                    }\n\n                    // setting up local processors\n                    var processors = new Processors();\n\n                    var reader = new AlgoSeekFuturesReader(csvFile, symbolMultipliers, _symbolFilter);\n                    if (start == DateTime.MinValue)\n                    {\n                        start = DateTime.Now;\n                    }\n\n                    if (reader.Current != null) // reader contains the data\n                    {\n                        do\n                        {\n                            var tick = reader.Current as Tick;\n\n                            if (tick.Symbol.ID.Symbol == \"VX\" && (\n                                tick.BidPrice >= 998m || tick.AskPrice >= 998m))\n                            {\n                                // Invalid value for VX futures. Invalid prices in raw data are 998/999\n                                continue;\n                            }\n                            //Add or create the consolidator-flush mechanism for symbol:\n                            List<List<AlgoSeekFuturesProcessor>> symbolProcessors;\n                            if (!processors.TryGetValue(tick.Symbol, out symbolProcessors))\n                            {\n                                symbolProcessors = new List<List<AlgoSeekFuturesProcessor>>(3)\n                                        {\n                                            { _resolutions.Select(x => new AlgoSeekFuturesProcessor(tick.Symbol, _referenceDate, TickType.Trade, x, _destination)).ToList() },\n                                            { _resolutions.Select(x => new AlgoSeekFuturesProcessor(tick.Symbol, _referenceDate, TickType.Quote, x, _destination)).ToList() },\n                                            { _resolutions.Select(x => new AlgoSeekFuturesProcessor(tick.Symbol, _referenceDate, TickType.OpenInterest, x, _destination)).ToList() }\n                                        };\n\n                                processors[tick.Symbol] = symbolProcessors;\n                            }\n\n                            // Pass current tick into processor: enum 0 = trade; 1 = quote, 2 = oi\n                            foreach (var processor in symbolProcessors[(int)tick.TickType])\n                            {\n                                processor.Process(tick);\n                            }\n\n                            if (Interlocked.Increment(ref totalLinesProcessed) % 1000000m == 0)\n                            {\n                                var pro = (double)processors.Values.SelectMany(p => p.SelectMany(x => x)).Count();\n                                var symbols = (double)processors.Keys.Count;\n                                Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Processed {0,3}M ticks( {1}k / sec); Memory in use: {2} MB; Total progress: {3}%, Processor per symbol {4}\", Math.Round(totalLinesProcessed / 1000000m, 2), Math.Round(totalLinesProcessed / 1000L / (DateTime.Now - start).TotalSeconds), Process.GetCurrentProcess().WorkingSet64 / (1024 * 1024), 100 * totalFilesProcessed / totalFiles, pro / symbols);\n                            }\n\n                        }\n                        while (reader.MoveNext());\n\n                        Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Performing final flush to disk... \");\n                        Flush(processors, DateTime.MaxValue, true);\n                    }\n\n                    processors = null;\n                    GC.Collect();\n                    GC.WaitForPendingFinalizers();\n\n                    Log.Trace(\"AlgoSeekFuturesConverter.Convert(): Finished processing file: \" + file);\n                    Interlocked.Increment(ref totalFilesProcessed);\n                }\n                catch(Exception err)\n                {\n                    Log.Error(\"Exception caught! File: {0} Err: {1} Source {2} Stack {3}\", file, err.Message, err.Source, err.StackTrace);\n                }\n            });\n\n\n        }\n\n        /// <summary>\n        /// Gets the files in raw folder.\n        /// </summary>\n        /// <returns>List of files in source folder</returns>\n        private IEnumerable<FileInfo> GetFilesInRawFolder()\n        {\n            var files = new List<FileInfo>();\n\n            var command = OS.IsLinux ? \"ls\" : \"cmd.exe\";\n            var arguments = OS.IsWindows ? \"/c dir /b /a-d\" : string.Empty;\n\n            var processStartInfo = new ProcessStartInfo(command, arguments)\n            {\n                CreateNoWindow = true,\n                WindowStyle = ProcessWindowStyle.Hidden,\n                UseShellExecute = false,\n                RedirectStandardOutput = true,\n                WorkingDirectory = _remote.FullName\n            };\n\n            using (var process = new Process())\n            {\n\n                process.StartInfo = processStartInfo;\n                process.Start();\n\n                while (!process.StandardOutput.EndOfStream)\n                {\n                    var line = process.StandardOutput.ReadLine();\n                    if (line != null)\n                    {\n                        files.Add(new FileInfo(Path.Combine(_remote.FullName, line)));\n                    }\n                }\n                process.WaitForExit();\n            }\n\n            return files;\n\n        }\n\n        /// <summary>\n        /// Private method loads symbol multipliers from algoseek csv file\n        /// </summary>\n        /// <returns></returns>\n        private Dictionary<string, decimal> LoadSymbolMultipliers()\n        {\n            const int columnUnderlying = 0;\n            const int columnMultipleFactor = 2;\n\n            return File.ReadAllLines(\"AlgoSeekFuturesConverter/AlgoSeek.US.Futures.PriceMultipliers.1.1.csv\")\n                    .Select(line => line.ToCsvData())\n                    // skipping empty fields\n                    .Where(line => !string.IsNullOrEmpty(line[columnUnderlying]) &&\n                                   !string.IsNullOrEmpty(line[columnMultipleFactor]))\n                    // skipping header\n                    .Skip(1)\n                    .ToDictionary(line => line[columnUnderlying],\n                                  line => line[columnMultipleFactor].ConvertInvariant<decimal>());\n        }\n\n        private void Flush(Processors processors, DateTime time, bool final)\n        {\n            foreach (var symbol in processors.Keys)\n            {\n                processors[symbol].ForEach(p => p.ForEach(x => x.FlushBuffer(time, final)));\n            }\n        }\n\n        /// <summary>\n        /// Compress the queue buffers directly to a zip file. Lightening fast as streaming ram-> compressed zip.\n        /// </summary>\n        public void Package(DateTime date)\n        {\n            var zipper = OS.IsWindows ? \"C:/Program Files/7-Zip/7z.exe\" : \"7z\";\n\n            Log.Trace(\"AlgoSeekFuturesConverter.Package(): Zipping all files ...\");\n\n            var destination = Path.Combine(_destination, \"future\");\n            Directory.CreateDirectory(destination);\n            var dateMask = date.ToStringInvariant(DateFormat.EightCharacter);\n\n            var files =\n                Directory.EnumerateFiles(destination, dateMask + \"*.csv\", SearchOption.AllDirectories)\n                .GroupBy(x => Directory.GetParent(x).FullName)\n                .ToList();\n\n            // Zip each file massively in parallel\n            Parallel.ForEach(files, file =>\n                //foreach (var file in files)\n            {\n                try\n                {\n                    var outputFileName = file.Key + \".zip\";\n\n                    // Create and open a new ZIP file\n                    var filesToCompress = Directory.GetFiles(file.Key, \"*.csv\", SearchOption.AllDirectories);\n                    var zip = ZipFile.Open(outputFileName, ZipArchiveMode.Create);\n\n                    foreach (var fileToCompress in filesToCompress)\n                    {\n                        // Add the entry for each file\n                        zip.CreateEntryFromFile(fileToCompress, Path.GetFileName(fileToCompress), CompressionLevel.Optimal);\n                    }\n\n                    // Dispose of the object when we are done\n                    zip.Dispose();\n\n                    try\n                    {\n                        Directory.Delete(file.Key, true);\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(\"Directory.Delete returned error: \" + err.Message);\n                    }\n                }\n                catch (Exception err)\n                {\n                    Log.Error(\"File: {0} Err: {1} Source {2} Stack {3}\", file, err.Message, err.Source, err.StackTrace);\n                }\n            });\n        }\n\n    }\n}\n"
  },
  {
    "path": "ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProcessor.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox.AlgoSeekFuturesConverter\n{\n    /// <summary>\n    /// Processor for caching and consolidating ticks;\n    /// then flushing the ticks in memory to disk when triggered.\n    /// </summary>\n    public class AlgoSeekFuturesProcessor\n    {\n        static private int _curFileCount = 0;\n        private string _zipPath;\n        private string _entryPath;\n        private Symbol _symbol;\n        private TickType _tickType;\n        private Resolution _resolution;\n        private LazyStreamWriter _streamWriter;\n        private string _dataDirectory;\n        private IDataConsolidator _consolidator;\n        private DateTime _referenceDate;\n        private static string[] _windowsRestrictedNames =\n        {\n            \"con\", \"prn\", \"aux\", \"nul\"\n        };\n\n        /// <summary>\n        /// Zip entry name for the futures contract\n        /// </summary>\n        public string EntryPath\n        {\n            get\n            {\n                if (_entryPath == null)\n                {\n                    _entryPath = SafeName(LeanData.GenerateZipEntryName(_symbol, _referenceDate, _resolution, _tickType));\n                }\n                return _entryPath;\n            }\n            set { _entryPath = value; }\n        }\n\n        /// <summary>\n        /// Zip file path for the futures contract collection\n        /// </summary>\n        public string ZipPath\n        {\n            get\n            {\n                if (_zipPath == null)\n                {\n                    _zipPath = Path.Combine(_dataDirectory, SafeName(LeanData.GenerateRelativeZipFilePath(Safe(_symbol), _referenceDate, _resolution, _tickType).Replace(\".zip\", string.Empty))) + \".zip\";\n                }\n                return _zipPath;\n            }\n            set { _zipPath = value; }\n        }\n\n        /// <summary>\n        /// Public access to the processor symbol\n        /// </summary>\n        public Symbol Symbol\n        {\n            get { return _symbol; }\n        }\n\n        /// <summary>\n        /// Accessor for the final enumerator\n        /// </summary>\n        public Resolution Resolution\n        {\n            get { return _resolution; }\n        }\n\n        /// <summary>\n        /// Type of this futures processor.\n        /// ASOP's are grouped trade type for file writing.\n        /// </summary>\n        public TickType TickType\n        {\n            get { return _tickType; }\n            set { _tickType = value; }\n        }\n\n        /// <summary>\n        /// If no data has been consolidated, do not write to disk\n        /// </summary>\n        public bool ShouldWriteToDisk()\n        {\n            return _consolidator.Consolidated != null;\n        }\n\n        /// <summary>\n        /// Create a new AlgoSeekFuturesProcessor for enquing consolidated bars and flushing them to disk\n        /// </summary>\n        /// <param name=\"symbol\">Symbol for the processor</param>\n        /// <param name=\"date\">Reference date for the processor</param>\n        /// <param name=\"tickType\">TradeBar or QuoteBar to generate</param>\n        /// <param name=\"resolution\">Resolution to consolidate</param>\n        /// <param name=\"dataDirectory\">Data directory for LEAN</param>\n        public AlgoSeekFuturesProcessor(Symbol symbol, DateTime date, TickType tickType, Resolution resolution, string dataDirectory)\n        {\n            _symbol = Safe(symbol);\n            _tickType = tickType;\n            _referenceDate = date;\n            _resolution = resolution;\n            _dataDirectory = dataDirectory;\n\n            // Setup the consolidator for the requested resolution\n            if (resolution == Resolution.Tick)\n            {\n                _consolidator = new IdentityDataConsolidator<Tick>();\n            }\n            else\n            {\n                switch (tickType)\n                {\n                    case TickType.Trade:\n                        _consolidator = new TickConsolidator(resolution.ToTimeSpan());\n                        break;\n                    case TickType.Quote:\n                        _consolidator = new TickQuoteBarConsolidator(resolution.ToTimeSpan());\n                        break;\n                    case TickType.OpenInterest:\n                        _consolidator = new OpenInterestConsolidator(resolution.ToTimeSpan());\n                        break;\n                }\n            }\n\n            var path = ZipPath.Replace(\".zip\", string.Empty);\n            Directory.CreateDirectory(path);\n\n            var file = Path.Combine(path, EntryPath);\n\n            try\n            {\n                _streamWriter = new LazyStreamWriter(file);\n            }\n            catch (Exception err)\n            {\n                // we are unable to open new file - it is already opened due to bug in algoseek data\n                Log.Error(\"File: {0} Err: {1} Source: {2} Stack: {3}\", file, err.Message, err.Source, err.StackTrace);\n                var newRandomizedName = (file + \"-\" + Math.Abs(file.GetHashCode()).ToStringInvariant()).Replace(\".csv\", string.Empty) + \".csv\";\n\n                // we store the information under different (randomized) name\n                Log.Trace(\"Changing name from {0} to {1}\", file, newRandomizedName);\n                _streamWriter = new LazyStreamWriter(newRandomizedName);\n            }\n\n            // On consolidating the bars put the bar into a queue in memory to be written to disk later.\n            _consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                _streamWriter.WriteLine(LeanData.GenerateLine(consolidated, SecurityType.Future, Resolution));\n            };\n\n            Interlocked.Add(ref _curFileCount, 1);\n            if (_curFileCount % 1000 == 0)\n            {\n                Log.Trace(\"Opened more files: {0}\", _curFileCount);\n            }\n        }\n\n        /// <summary>\n        /// Process the tick; add to the con\n        /// </summary>\n        /// <param name=\"data\"></param>\n        public void Process(Tick data)\n        {\n            if (data.TickType != _tickType)\n            {\n                return;\n            }\n\n            _consolidator.Update(data);\n        }\n\n        /// <summary>\n        /// Write the in memory queues to the disk.\n        /// </summary>\n        /// <param name=\"frontierTime\">Current foremost tick time</param>\n        /// <param name=\"finalFlush\">Indicates is this is the final push to disk at the end of the data</param>\n        public void FlushBuffer(DateTime frontierTime, bool finalFlush)\n        {\n            //Force the consolidation if time has past the bar\n            _consolidator.Scan(frontierTime);\n\n            // If this is the final packet dump it to the queue\n            if (finalFlush)\n            {\n                if (_consolidator.WorkingData != null)\n                {\n                    _streamWriter.WriteLine(LeanData.GenerateLine(_consolidator.WorkingData, SecurityType.Future, Resolution));\n                }\n\n                _streamWriter.Flush();\n                _streamWriter.Close();\n                _streamWriter = null;\n\n                Interlocked.Add(ref _curFileCount, -1);\n                if (_curFileCount % 1000 == 0)\n                {\n                    Log.Trace(\"Closed some files: {0}\", _curFileCount);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Add filtering to safe check the symbol for windows environments\n        /// </summary>\n        /// <param name=\"symbol\">Symbol to rename if required</param>\n        /// <returns>Renamed symbol for reserved names</returns>\n        private static Symbol Safe(Symbol symbol)\n        {\n            if (OS.IsWindows)\n            {\n                if (_windowsRestrictedNames.Contains(symbol.Value.ToLowerInvariant()))\n                {\n                    symbol = Symbol.CreateFuture(SafeName(symbol.Underlying.Value), symbol.ID.Market, symbol.ID.Date);\n                }\n            }\n            return symbol;\n        }\n        private static string SafeName(string fileName)\n        {\n            if (OS.IsWindows)\n            {\n                foreach (var name in _windowsRestrictedNames)\n                {\n                    // The 'con' restricted filename will corrupt the 'seCONed' filepath\n                    var restrictedFilePath = Path.DirectorySeparatorChar + name;\n                    var safeFilePath = Path.DirectorySeparatorChar + \"_\" + name;\n                    fileName = fileName.Replace(restrictedFilePath, safeFilePath);\n                }\n            }\n            return fileName;\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProgram.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Logging;\nusing System.Diagnostics;\nusing System.Globalization;\nusing QuantConnect.Configuration;\nusing System.Linq;\nusing System.IO;\n\nnamespace QuantConnect.ToolBox.AlgoSeekFuturesConverter\n{\n    /// <summary>\n    /// AlgoSeek Options Converter: Convert raw OPRA channel files into QuantConnect Options Data Format.\n    /// </summary>\n    public static class AlgoSeekFuturesProgram\n    {\n        public static void AlgoSeekFuturesConverter(string date)\n        {\n            // There are practical file limits we need to override for this to work.\n            // By default programs are only allowed 1024 files open; for futures parsing we need 100k\n            Environment.SetEnvironmentVariable(\"MONO_MANAGED_WATCHER\", \"disabled\");\n            Log.LogHandler = new CompositeLogHandler(new ILogHandler[] { new ConsoleLogHandler(), new FileLogHandler(\"log.txt\") });\n\n            // Directory for the data, output and processed cache:\n            var remoteDirectory = Config.Get(\"futures-remote-directory\").Replace(\"{0}\", date);\n            var sourceDirectory = Config.Get(\"futures-source-directory\").Replace(\"{0}\", date);\n            var dataDirectory = Globals.DataFolder;\n            var resolutions = Config.Get(\"resolutions\");\n            var cleanSourceDirectory = Config.GetBool(\"clean-source-directory\", false);\n\n            Log.Trace(\"CONFIGURATION:\");\n            Log.Trace(\"Processor Count: \" + Environment.ProcessorCount);\n            Log.Trace(\"Remote Directory: \" + remoteDirectory);\n            Log.Trace(\"Source Directory: \" + sourceDirectory);\n            Log.Trace(\"Destination Directory: \" + dataDirectory);\n\n            // Date for the option bz files.\n            var referenceDate = DateTime.ParseExact(date, DateFormat.EightCharacter, CultureInfo.InvariantCulture);\n\n            Log.Trace(\"DateTime: \" + referenceDate.Date.ToStringInvariant());\n\n            // checking if remote folder exists\n            if(!Directory.Exists(remoteDirectory))\n            {\n                Log.Error(\"Remote Directory doesn't exist: \" + remoteDirectory);\n                return;\n            }\n\n            // prepare tick types\n            var resolutionList = new[] { Resolution.Minute };\n\n            if (!string.IsNullOrEmpty(resolutions))\n            {\n                var names = resolutions.Split(new[] { ';' });\n                resolutionList =\n                    names\n                    .Where(x => !string.IsNullOrEmpty(x))\n                    .Select(name => (Resolution)Enum.Parse(typeof(Resolution), name, true)).ToArray();\n            }\n\n            Log.Trace(\"Resolutions: \" + string.Join(\";\", resolutionList.Select(x => x.ToString()).ToArray()));\n\n            // Convert the date:\n            var timer = Stopwatch.StartNew();\n            var converter = new AlgoSeekFuturesConverter(resolutionList.ToList() , referenceDate, remoteDirectory, sourceDirectory, dataDirectory);\n            converter.Convert();\n            Log.Trace($\"AlgoSeekFuturesConverter.Main(): {referenceDate.ToStringInvariant()} Conversion finished in time: {timer.Elapsed.ToStringInvariant(null)}\");\n\n            // Compress the memory cache to zips.\n            timer.Restart();\n            converter.Package(referenceDate);\n            Log.Trace($\"AlgoSeekFuturesConverter.Main(): {referenceDate.ToStringInvariant()} Compression finished in time: {timer.Elapsed.ToStringInvariant(null)}\");\n\n            if (cleanSourceDirectory)\n            {\n                Log.Trace($\"AlgoSeekFuturesConverter.Main(): Cleaning source directory: {sourceDirectory}\");\n\n                try\n                {\n                    Directory.Delete(sourceDirectory, true);\n                }\n                catch(Exception err)\n                {\n                    Log.Trace($\"AlgoSeekFuturesConverter.Main(): Error while cleaning source directory {err.Message}\");\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Future;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox.AlgoSeekFuturesConverter\n{\n    /// <summary>\n    /// Enumerator for converting AlgoSeek futures files into Ticks.\n    /// </summary>\n    public class AlgoSeekFuturesReader : IEnumerator<Tick>\n    {\n        private readonly Stream _stream;\n        private readonly StreamReader _streamReader;\n        private readonly HashSet<string> _symbolFilter;\n        private readonly Dictionary<string, decimal> _symbolMultipliers;\n        private readonly SymbolPropertiesDatabase _symbolProperties;\n\n        private readonly int _columnTimestamp = -1;\n        private readonly int _columnSecID = -1;\n        private readonly int _columnTicker = -1;\n        private readonly int _columnType = -1;\n        private readonly int _columnSide = -1;\n        private readonly int _columnQuantity = -1;\n        private readonly int _columnPrice = -1;\n        private readonly int _columnsCount = -1;\n\n        /// <summary>\n        /// Enumerate through the lines of the algoseek files.\n        /// </summary>\n        /// <param name=\"file\">BZ File for AlgoSeek</param>\n        /// <param name=\"symbolMultipliers\">Symbol price multiplier</param>\n        /// <param name=\"symbolFilter\">Symbol filter to apply, if any</param>\n        public AlgoSeekFuturesReader(string file, Dictionary<string, decimal> symbolMultipliers, HashSet<string> symbolFilter = null)\n        {\n            var streamProvider = StreamProvider.ForExtension(Path.GetExtension(file));\n            _stream = streamProvider.Open(file).First();\n            _streamReader = new StreamReader(_stream);\n            _symbolFilter = symbolFilter;\n            _symbolMultipliers = symbolMultipliers.ToDictionary();\n            _symbolProperties = SymbolPropertiesDatabase.FromDataFolder();\n\n            // detecting column order in the file\n            var headerLine = _streamReader.ReadLine();\n            if (!string.IsNullOrEmpty(headerLine))\n            {\n                var header = headerLine.ToCsv();\n                _columnTimestamp = header.FindIndex(x => x == \"Timestamp\");\n                _columnTicker = header.FindIndex(x => x == \"Ticker\");\n                _columnType = header.FindIndex(x => x == \"Type\");\n                _columnSide = header.FindIndex(x => x == \"Side\");\n                _columnSecID = header.FindIndex(x => x == \"SecurityID\");\n                _columnQuantity = header.FindIndex(x => x == \"Quantity\");\n                _columnPrice = header.FindIndex(x => x == \"Price\");\n\n                _columnsCount = new[] { _columnTimestamp, _columnTicker, _columnType, _columnSide, _columnSecID, _columnQuantity, _columnPrice }.Max();\n            }\n            //Prime the data pump, set the current.\n            Current = null;\n            MoveNext();\n        }\n        \n        /// <summary>\n        /// Parse the next line of the algoseek future file.\n        /// </summary>\n        /// <returns></returns>\n        public bool MoveNext()\n        {\n            string line;\n            Tick tick = null;\n            while (tick == null && (line = _streamReader.ReadLine()) != null)\n            {\n                // If line is invalid continue looping to find next valid line.\n                tick = Parse(line);\n            }\n\n            Current = tick;\n            return Current != null;\n        }\n\n        /// <summary>\n        /// Current top of the tick file.\n        /// </summary>\n        public Tick Current { get; private set; }\n\n        /// <summary>\n        /// Gets the current element in the collection.\n        /// </summary>\n        /// <returns>\n        /// The current element in the collection.\n        /// </returns>\n        object IEnumerator.Current => Current;\n\n        /// <summary>\n        /// Reset the enumerator for the AlgoSeekFuturesReader\n        /// </summary>\n        public void Reset()\n        {\n            throw new NotImplementedException(\"Reset not implemented for AlgoSeekFuturesReader.\");\n        }\n\n        /// <summary>\n        /// Dispose of the underlying AlgoSeekFuturesReader\n        /// </summary>\n        public void Dispose()\n        {\n            _stream.Close();\n            _stream.Dispose();\n            _streamReader.Close();\n            _streamReader.Dispose();\n        }\n\n        /// <summary>\n        /// Parse a string line into a future tick.\n        /// </summary>\n        /// <param name=\"line\"></param>\n        /// <returns></returns>\n        private Tick Parse(string line)\n        {\n            try\n            {\n                const int TradeMask = 2;\n                const int QuoteMask = 1;\n                const int OpenInterestMask = 11;\n                const int MessageTypeMask = 15;\n\n                // parse csv check column count\n                var csv = line.ToCsv();\n                if (csv.Count - 1 < _columnsCount)\n                {\n                    return null;\n                }\n\n                var ticker = csv[_columnTicker];\n\n                // we filter out options and spreads\n                if (ticker.IndexOfAny(new [] { ' ', '-' }) != -1)\n                {\n                    return null;\n                }\n\n                ticker = ticker.Trim('\"');\n\n                if (string.IsNullOrEmpty(ticker))\n                {\n                    return null;\n                }\n\n                // ignoring time zones completely -- this is all in the 'data-time-zone'\n                var timeString = csv[_columnTimestamp];\n                var time = DateTime.ParseExact(timeString, \"yyyyMMddHHmmssFFF\", CultureInfo.InvariantCulture);\n\n                var symbol = SymbolRepresentation.ParseFutureSymbol(ticker, time.Year);\n\n                if (symbol == null || !_symbolMultipliers.ContainsKey(symbol.ID.Symbol) ||\n                    _symbolFilter != null && !_symbolFilter.Contains(symbol.ID.Symbol, StringComparer.InvariantCultureIgnoreCase))\n                {\n                    return null;\n                }\n\n                // detecting tick type (trade or quote)\n                TickType tickType;\n                bool isAsk = false;\n\n                var type = csv[_columnType].ConvertInvariant<int>();\n                if ((type & MessageTypeMask) == TradeMask)\n                {\n                    tickType = TickType.Trade;\n                }\n                else if ((type & MessageTypeMask) == OpenInterestMask)\n                {\n                    tickType = TickType.OpenInterest;\n                }\n                else if ((type & MessageTypeMask) == QuoteMask)\n                {\n                    tickType = TickType.Quote;\n\n                    switch (csv[_columnSide])\n                    {\n                        case \"B\":\n                            isAsk = false;\n                            break;\n                        case \"S\":\n                            isAsk = true;\n                            break;\n                        default:\n                        {\n                            return null;\n                        }\n                    }\n                }\n                else\n                {\n                    return null;\n                }\n\n                // All futures but VIX are delivered with a scale factor of 10000000000.\n                var scaleFactor = symbol.ID.Symbol == \"VX\" ? decimal.One : 10000000000m;\n\n                var price = csv[_columnPrice].ToDecimal() / scaleFactor;\n                var quantity = csv[_columnQuantity].ToInt32();\n\n                price *= _symbolMultipliers[symbol.ID.Symbol];\n\n                switch (tickType)\n                {\n                    case TickType.Quote:\n\n                        var tick = new Tick\n                        {\n                            Symbol = symbol,\n                            Time = time,\n                            TickType = tickType,\n                            Value = price\n                        };\n\n                        if (isAsk)\n                        {\n                            tick.AskPrice = price;\n                            tick.AskSize = quantity;\n                        }\n                        else\n                        {\n                            tick.BidPrice = price;\n                            tick.BidSize = quantity;\n                        }\n\n                        return tick;\n\n                    case TickType.Trade:\n\n                        tick = new Tick\n                        {\n                            Symbol = symbol,\n                            Time = time,\n                            TickType = tickType,\n                            Value = price,\n                            Quantity = quantity\n                        };\n                        return tick;\n\n                    case TickType.OpenInterest:\n\n                        tick = new Tick\n                        {\n                            Symbol = symbol,\n                            Time = time,\n                            TickType = tickType,\n                            Exchange = symbol.ID.Market,\n                            Value = quantity\n                        };\n                        return tick;\n                }\n\n                return null;\n            }\n            catch (Exception err)\n            {\n                Log.Error(err);\n                Log.Trace(\"Line: {0}\", line);\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/Bz2StreamProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.IO;\nusing Ionic.BZip2;\n\nnamespace QuantConnect.ToolBox\n{\n    public class Bz2StreamProvider : IStreamProvider\n    {\n        /// <summary>\n        /// Opens the specified source as read to be consumed stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be opened</param>\n        /// <returns>The stream representing the specified source</returns>\n        public IEnumerable<Stream> Open(string source)\n        {\n            yield return new BZip2InputStream(File.OpenRead(source));\n        }\n\n        /// <summary>\n        /// Closes the specified source file stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be closed</param>\n        public void Close(string source)\n        {\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing QuantConnect.Lean.Engine.DataFeeds;\nusing DateTime = System.DateTime;\nusing Log = QuantConnect.Logging.Log;\nusing QuantConnect.Data.UniverseSelection;\nusing static QuantConnect.Data.UniverseSelection.CoarseFundamentalDataProvider;\nusing QuantConnect.Data.Fundamental;\n\nnamespace QuantConnect.ToolBox.CoarseUniverseGenerator\n{\n    /// <summary>\n    /// Coarse\n    /// </summary>\n    public class CoarseUniverseGeneratorProgram\n    {\n        /// <summary>\n        /// Has fundamental data source\n        /// </summary>\n        public const FundamentalProperty HasFundamentalSource = FundamentalProperty.CompanyReference_CompanyId;\n\n        private readonly DirectoryInfo _dailyDataFolder;\n        private readonly DirectoryInfo _destinationFolder;\n        private readonly IMapFileProvider _mapFileProvider;\n        private readonly IFactorFileProvider _factorFileProvider;\n        private readonly string _market;\n        private readonly FileInfo _blackListedTickersFile;\n\n        /// <summary>\n        /// Runs the Coarse universe generator with default values.\n        /// </summary>\n        /// <returns></returns>\n        public static bool CoarseUniverseGenerator()\n        {\n            var dailyDataFolder = new DirectoryInfo(Path.Combine(Globals.DataFolder, SecurityType.Equity.SecurityTypeToLower(), Market.USA, Resolution.Daily.ResolutionToLower()));\n            var destinationFolder = new DirectoryInfo(Path.Combine(Globals.DataFolder, SecurityType.Equity.SecurityTypeToLower(), Market.USA, \"fundamental\", \"coarse\"));\n            var blackListedTickersFile = new FileInfo(\"blacklisted-tickers.txt\");\n            var reservedWordPrefix = Config.Get(\"reserved-words-prefix\", \"quantconnect-\");\n            var dataProvider = new DefaultDataProvider();\n            var mapFileProvider = new LocalDiskMapFileProvider();\n            mapFileProvider.Initialize(dataProvider);\n            var factorFileProvider = new LocalDiskFactorFileProvider();\n            factorFileProvider.Initialize(mapFileProvider, dataProvider);\n            FundamentalService.Initialize(dataProvider, nameof(CoarseFundamentalDataProvider), false);\n            var generator = new CoarseUniverseGeneratorProgram(dailyDataFolder, destinationFolder, Market.USA, blackListedTickersFile, reservedWordPrefix, mapFileProvider, factorFileProvider);\n            return generator.Run(out _, out _);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CoarseUniverseGeneratorProgram\"/> class.\n        /// </summary>\n        /// <param name=\"dailyDataFolder\">The daily data folder.</param>\n        /// <param name=\"destinationFolder\">The destination folder.</param>\n        /// <param name=\"market\">The market.</param>\n        /// <param name=\"blackListedTickersFile\">The black listed tickers file.</param>\n        /// <param name=\"reservedWordsPrefix\">The reserved words prefix.</param>\n        /// <param name=\"mapFileProvider\">The map file provider.</param>\n        /// <param name=\"factorFileProvider\">The factor file provider.</param>\n        /// <param name=\"debugEnabled\">if set to <c>true</c> [debug enabled].</param>\n        public CoarseUniverseGeneratorProgram(\n            DirectoryInfo dailyDataFolder,\n            DirectoryInfo destinationFolder,\n            string market,\n            FileInfo blackListedTickersFile,\n            string reservedWordsPrefix,\n            IMapFileProvider mapFileProvider,\n            IFactorFileProvider factorFileProvider,\n            bool debugEnabled = false)\n        {\n            _blackListedTickersFile = blackListedTickersFile;\n            _market = market;\n            _factorFileProvider = factorFileProvider;\n            _mapFileProvider = mapFileProvider;\n            _destinationFolder = destinationFolder;\n            _dailyDataFolder = dailyDataFolder;\n\n            Log.DebuggingEnabled = debugEnabled;\n        }\n\n        /// <summary>\n        /// Runs this instance.\n        /// </summary>\n        /// <returns></returns>\n        public bool Run(out ConcurrentDictionary<SecurityIdentifier, List<CoarseFundamental>> coarsePerSecurity, out DateTime[] dates)\n        {\n            var startTime = DateTime.UtcNow;\n            var success = true;\n            Log.Trace($\"CoarseUniverseGeneratorProgram.ProcessDailyFolder(): Processing: {_dailyDataFolder.FullName}\");\n\n            var symbolsProcessed = 0;\n            var filesRead = 0;\n            var dailyFilesNotFound = 0;\n            var coarseFilesGenerated = 0;\n\n            var mapFileResolver = _mapFileProvider.Get(new AuxiliaryDataKey(_market, SecurityType.Equity));\n\n            var result = coarsePerSecurity = new();\n            dates = Array.Empty<DateTime>();\n\n            var blackListedTickers = new HashSet<string>();\n            if (_blackListedTickersFile.Exists)\n            {\n                blackListedTickers = File.ReadAllLines(_blackListedTickersFile.FullName).ToHashSet();\n            }\n\n            var securityIdentifierContexts = PopulateSidContex(mapFileResolver, blackListedTickers);\n            var dailyPricesByTicker = new ConcurrentDictionary<string, List<TradeBar>>();\n            var outputCoarseContent = new ConcurrentDictionary<DateTime, List<CoarseFundamental>>();\n\n            var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = Math.Max(1, Environment.ProcessorCount / 2) };\n            try\n            {\n                Parallel.ForEach(securityIdentifierContexts, parallelOptions, sidContext =>\n                {\n                    var coarseForSecurity = new List<CoarseFundamental>();\n                    var symbol = new Symbol(sidContext.SID, sidContext.LastTicker);\n                    var symbolCount = Interlocked.Increment(ref symbolsProcessed);\n                    Log.Debug($\"CoarseUniverseGeneratorProgram.Run(): Processing {symbol} with tickers: '{string.Join(\",\", sidContext.Tickers)}'\");\n                    var factorFile = _factorFileProvider.Get(symbol);\n\n                    // Populate dailyPricesByTicker with all daily data by ticker for all tickers of this security.\n                    foreach (var ticker in sidContext.Tickers)\n                    {\n                        var pathFile = Path.Combine(_dailyDataFolder.FullName, $\"{ticker}.zip\");\n                        var dailyFile = new FileInfo(pathFile);\n                        if (!dailyFile.Exists)\n                        {\n                            Log.Debug($\"CoarseUniverseGeneratorProgram.Run(): {dailyFile.FullName} not found, looking for daily data in data folder\");\n\n                            dailyFile = new FileInfo(Path.Combine(Globals.DataFolder, \"equity\", \"usa\", \"daily\", $\"{ticker}.zip\"));\n                            if (!dailyFile.Exists)\n                            {\n                                Log.Error($\"CoarseUniverseGeneratorProgram.Run(): {dailyFile} not found!\");\n                                Interlocked.Increment(ref dailyFilesNotFound);\n                                continue;\n                            }\n                        }\n\n                        if (!dailyPricesByTicker.ContainsKey(ticker))\n                        {\n                            dailyPricesByTicker.AddOrUpdate(ticker, ParseDailyFile(dailyFile));\n                            Interlocked.Increment(ref filesRead);\n                        }\n                    }\n\n                    // Look for daily data for each ticker of the actual security\n                    for (int mapFileRowIndex = sidContext.MapFileRows.Length - 1; mapFileRowIndex >= 1; mapFileRowIndex--)\n                    {\n                        var ticker = sidContext.MapFileRows[mapFileRowIndex].Item2.ToLowerInvariant();\n                        var endDate = sidContext.MapFileRows[mapFileRowIndex].Item1;\n                        var startDate = sidContext.MapFileRows[mapFileRowIndex - 1].Item1;\n                        List<TradeBar> tickerDailyData;\n                        if (!dailyPricesByTicker.TryGetValue(ticker, out tickerDailyData))\n                        {\n                            Log.Error($\"CoarseUniverseGeneratorProgram.Run(): Daily data for ticker {ticker.ToUpperInvariant()} not found!\");\n                            continue;\n                        }\n\n                        // Get daily data only for the time the ticker was\n                        foreach (var tradeBar in tickerDailyData.Where(tb => tb.Time >= startDate && tb.Time <= endDate))\n                        {\n                            var coarseFundamental = GenerateFactorFileRow(ticker, sidContext, factorFile as CorporateFactorProvider, tradeBar);\n                            coarseForSecurity.Add(coarseFundamental);\n\n                            outputCoarseContent.AddOrUpdate(tradeBar.Time,\n                                new List<CoarseFundamental> { coarseFundamental },\n                                (time, list) =>\n                            {\n                                lock (list)\n                                {\n                                    list.Add(coarseFundamental);\n                                    return list;\n                                }\n                            });\n                        }\n                    }\n\n                    if(coarseForSecurity.Count > 0)\n                    {\n                        result[sidContext.SID] = coarseForSecurity;\n                    }\n                    if (symbolCount % 1000 == 0)\n                    {\n                        var elapsed = DateTime.UtcNow - startTime;\n                        Log.Trace($\"CoarseUniverseGeneratorProgram.Run(): Processed {symbolCount} in {elapsed:g} at {symbolCount / elapsed.TotalMinutes:F2} symbols/minute \");\n                    }\n                });\n\n                _destinationFolder.Create();\n                var startWriting = DateTime.UtcNow;\n                Parallel.ForEach(outputCoarseContent, coarseByDate =>\n                {\n                    var filename = $\"{coarseByDate.Key.ToString(DateFormat.EightCharacter, CultureInfo.InvariantCulture)}.csv\";\n                    var filePath = Path.Combine(_destinationFolder.FullName, filename);\n                    Log.Debug($\"CoarseUniverseGeneratorProgram.Run(): Saving {filename} with {coarseByDate.Value.Count} entries.\");\n                    File.WriteAllLines(filePath, coarseByDate.Value.Select(x => CoarseFundamental.ToRow(x)).OrderBy(cr => cr));\n                    var filesCount = Interlocked.Increment(ref coarseFilesGenerated);\n                    if (filesCount % 1000 == 0)\n                    {\n                        var elapsed = DateTime.UtcNow - startWriting;\n                        Log.Trace($\"CoarseUniverseGeneratorProgram.Run(): Processed {filesCount} in {elapsed:g} at {filesCount / elapsed.TotalSeconds:F2} files/second \");\n                    }\n                });\n\n                dates = outputCoarseContent.Keys.OrderBy(x => x).ToArray();\n                Log.Trace($\"\\n\\nTotal of {coarseFilesGenerated} coarse files generated in {DateTime.UtcNow - startTime:g}:\\n\" +\n                          $\"\\t => {filesRead} daily data files read.\\n\");\n            }\n            catch (Exception e)\n            {\n                Log.Error(e, $\"CoarseUniverseGeneratorProgram.Run(): FAILED!\");\n                success = false;\n            }\n\n            return success;\n        }\n\n        /// <summary>\n        /// Generates the factor file row.\n        /// </summary>\n        /// <param name=\"ticker\">The ticker.</param>\n        /// <param name=\"sidContext\">The sid context.</param>\n        /// <param name=\"factorFile\">The factor file.</param>\n        /// <param name=\"tradeBar\">The trade bar.</param>\n        /// <param name=\"fineAvailableDates\">The fine available dates.</param>\n        /// <param name=\"fineFundamentalFolder\">The fine fundamental folder.</param>\n        /// <returns></returns>\n        private static CoarseFundamental GenerateFactorFileRow(string ticker, SecurityIdentifierContext sidContext, CorporateFactorProvider factorFile, TradeBar tradeBar)\n        {\n            var date = tradeBar.Time;\n            var factorFileRow = factorFile?.GetScalingFactors(date);\n            var dollarVolume = Math.Truncate((double)(tradeBar.Close * tradeBar.Volume));\n            var priceFactor = factorFileRow?.PriceFactor.Normalize() ?? 1m;\n            var splitFactor = factorFileRow?.SplitFactor.Normalize() ?? 1m;\n            var hasFundamentalData = CheckFundamentalData(date, sidContext.SID);\n\n            // sid,symbol,close,volume,dollar volume,has fundamental data,price factor,split factor\n            return new CoarseFundamentalSource\n            {\n                Symbol = new Symbol(sidContext.SID, ticker),\n                Value = tradeBar.Close.Normalize(),\n                Time = date,\n                VolumeSetter = decimal.ToInt64(tradeBar.Volume),\n                DollarVolumeSetter = dollarVolume,\n                PriceFactorSetter = priceFactor,\n                SplitFactorSetter = splitFactor,\n                HasFundamentalDataSetter = hasFundamentalData\n            };\n        }\n\n        /// <summary>\n        /// Checks if there is fundamental data for\n        /// </summary>\n        /// <param name=\"date\">The date.</param>\n        /// <param name=\"sid\">The security identifier.</param>\n        /// <returns>True if fundamental data is available</returns>\n        private static bool CheckFundamentalData(DateTime date, SecurityIdentifier sid)\n        {\n            return !string.IsNullOrEmpty(FundamentalService.Get<string>(date, sid, HasFundamentalSource));\n        }\n\n        /// <summary>\n        /// Parses the daily file.\n        /// </summary>\n        /// <param name=\"dailyFile\">The daily file.</param>\n        /// <returns></returns>\n        private static List<TradeBar> ParseDailyFile(FileInfo dailyFile)\n        {\n            var scaleFactor = 1 / 10000m;\n\n            var output = new List<TradeBar>();\n            using (var fileStream = dailyFile.OpenRead())\n            using (var stream = Compression.UnzipStreamToStreamReader(fileStream))\n            {\n                while (!stream.EndOfStream)\n                {\n                    var tradeBar = new TradeBar\n                    {\n                        Time = stream.GetDateTime(),\n                        Open = stream.GetDecimal() * scaleFactor,\n                        High = stream.GetDecimal() * scaleFactor,\n                        Low = stream.GetDecimal() * scaleFactor,\n                        Close = stream.GetDecimal() * scaleFactor,\n                        Volume = stream.GetDecimal()\n                    };\n                    output.Add(tradeBar);\n                }\n            }\n\n            return output;\n        }\n\n        /// <summary>\n        /// Populates the sid contex.\n        /// </summary>\n        /// <param name=\"mapFileResolver\">The map file resolver.</param>\n        /// <param name=\"exclusions\">The exclusions.</param>\n        /// <returns></returns>\n        private IEnumerable<SecurityIdentifierContext> PopulateSidContex(MapFileResolver mapFileResolver, HashSet<string> exclusions)\n        {\n            Log.Trace(\"CoarseUniverseGeneratorProgram.PopulateSidContex(): Generating SID context from QuantQuote's map files.\");\n            foreach (var mapFile in mapFileResolver)\n            {\n                if (exclusions.Contains(mapFile.Last().MappedSymbol))\n                {\n                    continue;\n                }\n\n                yield return new SecurityIdentifierContext(mapFile, _market);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/CoarseUniverseGenerator/SecurityIdentifierContext.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Auxiliary;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.ToolBox.CoarseUniverseGenerator\n{\n    /// <summary>\n    /// Auxiliary class for handling map files and SID.\n    /// </summary>\n    internal class SecurityIdentifierContext\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"SecurityIdentifierContext\"/> class.\n        /// </summary>\n        /// <param name=\"mapFile\">The map file.</param>\n        /// <param name=\"market\">The market.</param>\n        public SecurityIdentifierContext(MapFile mapFile, string market)\n        {\n            MapFile = mapFile;\n            SID = SecurityIdentifier.GenerateEquity(MapFile.FirstDate, MapFile.FirstTicker, market);\n            MapFileRows = MapFile.Select(mfr => new Tuple<DateTime, string>(mfr.Date, mfr.MappedSymbol)).ToArray();\n            Tickers = MapFile.Select(mfr => mfr.MappedSymbol.ToLowerInvariant()).Distinct().ToArray();\n            LastTicker = MapFile.Last().MappedSymbol.ToLowerInvariant();\n        }\n\n        /// <summary>\n        /// Gets the sid.\n        /// </summary>\n        /// <value>\n        /// The sid.\n        /// </value>\n        public SecurityIdentifier SID { get; }\n\n        /// <summary>\n        /// Gets the map file.\n        /// </summary>\n        /// <value>\n        /// The map file.\n        /// </value>\n        public MapFile MapFile { get; }\n\n        /// <summary>\n        /// Gets the map file rows.\n        /// </summary>\n        /// <value>\n        /// The map file rows.\n        /// </value>\n        public Tuple<DateTime, string>[] MapFileRows { get; }\n\n        /// <summary>\n        /// Gets the tickers.\n        /// </summary>\n        /// <value>\n        /// The tickers.\n        /// </value>\n        public string[] Tickers { get; }\n\n        /// <summary>\n        /// Gets the last ticker.\n        /// </summary>\n        /// <value>\n        /// The last ticker.\n        /// </value>\n        public string LastTicker { get; }\n    }\n}"
  },
  {
    "path": "ToolBox/CoarseUniverseGenerator/blacklisted-tickers.txt",
    "content": "ACCPW\nAFGL\nAITPU\nALIT\nALZH\nAMEHW\nAMQ\nANSBF\nARSGZ\nASHPF\nATEST\nATEST.A\nATEST.B\nATEST.C\nATEST.G\nATEST.H\nATEST.L\nATEST.Z\nBBRX\nBDFC\nBGSM\nBKSJZ\nBOLTW\nBOXLW\nBPTS\nCBUS\nCLO\nCNTX\nCTEST\nCTEST.A\nCTEST.B\nCTEST.C\nCTEST.D\nCTEST.E\nCTEST.F\nCTEST.G\nCTEST.H\nCTEST.I\nCTEST.J\nCTEST.K\nCTEST.L\nCTEST.M\nCTEST.N\nCTEST.O\nCTEST.P\nCTEST.Q\nCTEST.R\nCTEST.S\nCTEST.T\nCTEST.U\nCTEST.V\nCTEST.W\nCTEST.X\nCTEST.Y\nCTEST.Z\nCVTS\nDDOC\nDRMT\nEFRTF\nEGRGF\nEHR\nEMMSV\nFJP.B\nFKLYU\nFSNV\nFSPR\nFTPPP\nGBLK\nGCAA\nGLSS\nGNST\nHMU\nIBEX\nIDGX\nIGLEU\nILSAP\nIPOW\nIPOX\nJPACZ\nJPPXZ\nJPRMZ\nJPYOZ\nKLOX\nKRAT\nLBUY\nLBYAV\nLBYKV\nLRPRF\nLXL\nMBLTY\nMDQZZ\nMFCA\nMKVNF\nMOLC\nMOTA\nMOTAW\nMTEST\nMTEST.A\nMVC.H\nMVIR\nNEPG\nNTEST W\nNTEST.A\nNTEST.B\nNTEST.C\nNTEST.D\nNTEST.E\nNTEST.F\nNTEST.G\nNTEST.H\nNTEST.I\nNTEST.J\nNTEST.K\nNTEST.L\nNTEST.M\nNTEST.N\nNTEST.O\nNTEST.P\nNTEST.Q\nNTEST.R\nNTEST.S\nNTEST.T\nNTEST.U\nNTEST.V\nNTEST.W\nNTEST.X\nNTEST.Y\nNTEST.Z\nOFGIZ\nOTG\nPCIMU\nPCON\nPEER\nPEERW\nPMVAU\nPNTGV\nPOSHZ\nPRHR\nPRKU\nPRMCF\nPRMF\nPSAV\nPSRT\nPSWW\nPTCY\nPTEST\nPTEST.A\nPTEST.B\nPTEST.W\nPTEST.X\nPTEST.Y\nPTEST.Z\nREDX\nSCCI\nSLWD\nSNHVV\nSOHYP\nTDRRF\nTESTA\nTESTB\nTESTC\nTESTD\nTESTE\nTESTF\nTESTG\nTESTH\nTESTYX\nTFCPI\nTFIG\nUAVSU\nUREEW\nVMET\nVTEC\nVUZIW\nWNFM\nWSPT\nYAGEY\nYAGZD\nYAGZZ\nYQ\nZAZZT\nZBZX\nZBZZT\nZCZZT\nZDZZT\nZEXIT\nZEZZT\nZFZZT\nZGZZT\nZHZZT\nZIEXT\nZIZZT\nZJZZT\nZKZZT\nZLZZT\nZMZZT\nZNTRX\nZNZZT\nZOMHF\nZOZZT\nZPZZT\nZQZZT\nZRZZT\nZSZZT\nZTEST\nZTST\nZTZZT\nZUZZT\nZVV\nZVZZC\nZVZZT\nZWZZT\nZXIET\nZXZZT\nZYZZT\nZZZZIX\nZZZZT\n"
  },
  {
    "path": "ToolBox/ConsolidatorDataProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataProcessor\"/> that consolidates the data\n    /// stream and forwards the consolidated data to other processors\n    /// </summary>\n    public class ConsolidatorDataProcessor : IDataProcessor\n    {\n        private DateTime _frontier;\n        private readonly IDataProcessor _destination;\n        private readonly Func<IBaseData, IDataConsolidator> _createConsolidator;\n        private readonly Dictionary<Symbol, IDataConsolidator> _consolidators;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ConsolidatorDataProcessor\"/> class\n        /// </summary>\n        /// <param name=\"destination\">The receiver of the consolidated data</param>\n        /// <param name=\"createConsolidator\">Function used to create consolidators</param>\n        public ConsolidatorDataProcessor(IDataProcessor destination, Func<IBaseData, IDataConsolidator> createConsolidator)\n        {\n            _destination = destination;\n            _createConsolidator = createConsolidator;\n            _consolidators = new Dictionary<Symbol, IDataConsolidator>();\n        }\n\n        /// <summary>\n        /// Invoked for each piece of data from the source file\n        /// </summary>\n        /// <param name=\"data\">The data to be processed</param>\n        public void Process(IBaseData data)\n        {\n            // grab the correct consolidator for this symbol\n            IDataConsolidator consolidator;\n            if (!_consolidators.TryGetValue(data.Symbol, out consolidator))\n            {\n                consolidator = _createConsolidator(data);\n                consolidator.DataConsolidated += OnDataConsolidated;\n                _consolidators[data.Symbol] = consolidator;\n            }\n\n            consolidator.Update(data);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _frontier = DateTime.MaxValue;\n\n            // check the other consolidators to see if they also need to emit their working bars\n            foreach (var consolidator in _consolidators.Values)\n            {\n                consolidator.Scan(_frontier);\n            }\n\n            _destination.Dispose();\n            _consolidators.Clear();\n        }\n\n        /// <summary>\n        /// Handles the <see cref=\"IDataConsolidator.DataConsolidated\"/> event\n        /// </summary>\n        private void OnDataConsolidated(object sender, IBaseData args)\n        {\n            _destination.Process(args);\n\n            // we've already checked this frontier time, so don't scan the consolidators\n            if (_frontier >= args.EndTime) return;\n            _frontier = args.EndTime;\n\n            // check the other consolidators to see if they also need to emit\n            foreach (var consolidator in _consolidators.Values)\n            {\n                // back up the time a single instance, this allows data at exact same\n                // time to still come through\n                consolidator.Scan(args.EndTime.AddTicks(-1));\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/CsvDataProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\nusing QuantConnect.Data;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataProcessor\"/> that writes the incoming\n    /// stream of data to a csv file.\n    /// </summary>\n    public class CsvDataProcessor : IDataProcessor\n    {\n        private const int TicksPerFlush = 50;\n        private static readonly object DirectoryCreateSync = new object();\n        \n        private readonly string _dataDirectory;\n        private readonly Resolution _resolution;\n        private readonly TickType _tickType;\n        private readonly Dictionary<Symbol, Writer> _writers;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CsvDataProcessor\"/> class\n        /// </summary>\n        /// <param name=\"dataDirectory\">The root data directory, /Data</param>\n        /// <param name=\"resolution\">The resolution being sent into the Process method</param>\n        /// <param name=\"tickType\">The tick type, trade or quote</param>\n        public CsvDataProcessor(string dataDirectory, Resolution resolution, TickType tickType)\n        {\n            _dataDirectory = dataDirectory;\n            _resolution = resolution;\n            _tickType = tickType;\n            _writers = new Dictionary<Symbol, Writer>();\n        }\n\n        /// <summary>\n        /// Invoked for each piece of data from the source file\n        /// </summary>\n        /// <param name=\"data\">The data to be processed</param>\n        public void Process(IBaseData data)\n        {\n            Writer writer;\n            if (!_writers.TryGetValue(data.Symbol, out writer))\n            {\n                writer = CreateTextWriter(data);\n                _writers[data.Symbol] = writer;\n            }\n\n            // flush every so often\n            if (++writer.ProcessCount%TicksPerFlush == 0)\n            {\n                writer.TextWriter.Flush();\n            }\n\n            var line = LeanData.GenerateLine(data, data.Symbol.ID.SecurityType, _resolution);\n            writer.TextWriter.WriteLine(line);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var kvp in _writers)\n            {\n                kvp.Value.TextWriter.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Creates the <see cref=\"TextWriter\"/> that writes data to csv files\n        /// </summary>\n        private Writer CreateTextWriter(IBaseData data)\n        {\n            var entry = LeanData.GenerateZipEntryName(data.Symbol, data.Time.Date, _resolution, _tickType);\n            var relativePath = LeanData.GenerateRelativeZipFilePath(data.Symbol, data.Time.Date, _resolution, _tickType)\n                .Replace(\".zip\", string.Empty);\n            var path = Path.Combine(Path.Combine(_dataDirectory, relativePath), entry);\n            var directory = new FileInfo(path).Directory.FullName;\n            if (!Directory.Exists(directory))\n            {\n                // lock before checking again\n                lock (DirectoryCreateSync) if (!Directory.Exists(directory)) Directory.CreateDirectory(directory);\n            }\n\n            return new Writer(path, new StreamWriter(path));\n        }\n\n\n        private sealed class Writer\n        {\n            public readonly string Path;\n            public readonly TextWriter TextWriter;\n            public int ProcessCount;\n            public Writer(string path, TextWriter textWriter)\n            {\n                Path = path;\n                TextWriter = textWriter;\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/ExchangeInfoUpdater.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Securities;\nusing QuantConnect.Configuration;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Base tool for pulling data from a remote source and updating existing csv file.\n    /// </summary>\n    public class ExchangeInfoUpdater\n    {\n        private readonly IExchangeInfoDownloader _eidl;\n\n        public ExchangeInfoUpdater(IExchangeInfoDownloader eidl)\n        {\n            _eidl = eidl;\n        }\n\n        /// <summary>\n        /// Update existing symbol properties database\n        /// </summary>\n        public void Run()\n        {\n            var directory = Path.Combine(Globals.DataFolder, \"symbol-properties\");\n            var file = Path.Combine(directory, \"symbol-properties-database.csv\");\n            var baseOutputDirectory = Config.Get(\"temp-output-directory\", \"/temp-output-directory\");\n            var tempOutputDirectory = Directory.CreateDirectory(Path.Combine(baseOutputDirectory, \"symbol-properties\"));\n            var tmp = Path.Combine(tempOutputDirectory.FullName, \"symbol-properties-database.csv\");\n            if (File.Exists(tmp))\n            {\n                file = tmp;\n            }\n            else if (!File.Exists(file))\n            {\n                throw new FileNotFoundException(\"Unable to locate symbol properties file: \" + file);\n            }\n\n            // Read file data before to escape from clash if file == tmp\n            // Dispose off enumerator to free up resource\n            var fileLines = File.ReadLines(file).ToList();\n\n            using (var writer = new StreamWriter(tmp))\n            {\n                var fetch = false;\n                var filter = $\"{_eidl.Market},\";\n                foreach (var line in fileLines)\n                {\n                    if (!line.StartsWithInvariant(filter, true))\n                    {\n                        writer.WriteLine(line);\n                    }\n                    else if (!fetch)\n                    {\n                        WriteData(writer);\n                        fetch = true;\n                    }\n                }\n\n                if (!fetch)\n                {\n                    writer.WriteLine(Environment.NewLine);\n                    WriteData(writer);\n                }\n            }\n        }\n\n        private void WriteData(StreamWriter writer)\n        {\n            var existingSymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n            var entryPerSymbol = _eidl.Get().ToDictionary(newLine => {\n                var splitted = newLine.Split(',');\n                return new SecurityDatabaseKey(splitted[0], splitted[1], (SecurityType)Enum.Parse(typeof(SecurityType), splitted[2], true));\n            });\n\n            foreach (var existingEntry in existingSymbolPropertiesDatabase.GetSymbolPropertiesList(_eidl.Market))\n            {\n                if (!entryPerSymbol.ContainsKey(existingEntry.Key))\n                {\n                    // let's keep any existing which is no longer available, to take into account for delistings/removals\n                    entryPerSymbol[existingEntry.Key] = $\"{existingEntry.Key.Market},{existingEntry.Key.Symbol},{existingEntry.Key.SecurityType.ToLower()},{existingEntry.Value}\";\n                }\n            }\n\n            foreach (var upd in entryPerSymbol.OrderBy(x => x.Key.SecurityType).ThenBy(x => x.Key.Symbol))\n            {\n                writer.WriteLine(upd.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/FactorFileGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Generates a factor file from a list of splits and dividends for a specified equity\n    /// </summary>\n    public class FactorFileGenerator\n    {\n        /// <summary>\n        /// Data for this equity at daily resolution\n        /// </summary>\n        private readonly List<TradeBar> _dailyDataForEquity;\n\n        /// <summary>\n        /// The last date in the _dailyEquityData\n        /// </summary>\n        private readonly DateTime _lastDateFromEquityData;\n\n        /// <summary>\n        /// The symbol for which the factor file is being generated\n        /// </summary>\n        public Symbol Symbol { get; set; }\n\n        /// <summary>\n        /// Constructor for the FactorFileGenerator\n        /// </summary>\n        /// <param name=\"symbol\">The equity for which the factor file respresents</param>\n        /// <param name=\"pathForDailyEquityData\">The path to the daily data for the specified equity</param>\n        public FactorFileGenerator(Symbol symbol, string pathForDailyEquityData)\n        {\n            Symbol = symbol;\n            _dailyDataForEquity = ReadDailyEquityData(pathForDailyEquityData);\n            _lastDateFromEquityData = _dailyDataForEquity.Last().Time;\n        }\n\n        /// <summary>\n        /// Create FactorFile instance\n        /// </summary>\n        /// <param name=\"dividendSplitList\">List of Dividends and Splits</param>\n        /// <returns><see cref=\"FactorFile\"/> instance</returns>\n        public CorporateFactorProvider CreateFactorFile(List<BaseData> dividendSplitList)\n        {\n            var orderedDividendSplitQueue = new Queue<BaseData>(\n                                        CombineIntraDayDividendSplits(dividendSplitList)\n                                            .OrderByDescending(x => x.Time));\n\n            var factorFileRows = new List<CorporateFactorRow>\n            {\n                // First Factor Row is set far into the future and by definition has 1 for both price and split factors\n                new CorporateFactorRow(\n                    Time.EndOfTime,\n                    priceFactor: 1,\n                    splitFactor: 1\n                )\n            };\n\n            return RecursivlyGenerateFactorFile(orderedDividendSplitQueue, factorFileRows);\n        }\n\n        /// <summary>\n        /// If dividend and split occur on the same day,\n        ///   combine them into IntraDayDividendSplit object\n        /// </summary>\n        /// <param name=\"splitDividendList\">List of split and dividends</param>\n        /// <returns>A list of splits, dividends with intraday split and dividends combined into <see cref=\"IntraDayDividendSplit\"/></returns>\n        private static List<BaseData> CombineIntraDayDividendSplits(List<BaseData> splitDividendList)\n        {\n            var splitDividendCollection = new Collection<BaseData>(splitDividendList);\n\n            var dateKeysLookup = splitDividendCollection.GroupBy(x => x.Time)\n                                                .OrderByDescending(x => x.Key)\n                                                .Select(group => group)\n                                                .ToList();\n\n            var baseDataList = new List<BaseData>();\n            foreach (var kvpLookup in dateKeysLookup)\n            {\n                if (kvpLookup.Count() > 1)\n                {\n                    // Intraday dividend split found\n                    var dividend = kvpLookup.First(x => x.GetType() == typeof(Dividend)) as Dividend;\n                    var split = kvpLookup.First(x => x.GetType() == typeof(Split)) as Split;\n                    baseDataList.Add(new IntraDayDividendSplit(split, dividend));\n                }\n                else\n                {\n                    baseDataList.Add(kvpLookup.First());\n                }\n            }\n\n            return baseDataList;\n        }\n\n        /// <summary>\n        /// Recursively generate a <see cref=\"FactorFile\"/>\n        /// </summary>\n        /// <param name=\"orderedDividendSplits\">Queue of dividends and splits ordered by date</param>\n        /// <param name=\"factorFileRows\">The list of factor file rows</param>\n        /// <returns><see cref=\"FactorFile\"/> instance</returns>\n        private CorporateFactorProvider RecursivlyGenerateFactorFile(Queue<BaseData> orderedDividendSplits, List<CorporateFactorRow> factorFileRows)\n        {\n            // If there is no more dividends or splits, return\n            if (!orderedDividendSplits.Any())\n            {\n                factorFileRows.Add(CreateLastFactorFileRow(factorFileRows, _dailyDataForEquity.Last().Close));\n                return new CorporateFactorProvider(Symbol.ID.Symbol, factorFileRows);\n            }\n\n            var nextEvent = orderedDividendSplits.Dequeue();\n\n            // If there is no more daily equity data to use, return\n            if (_lastDateFromEquityData > nextEvent.Time)\n            {\n                decimal initialReferencePrice = 1;\n                factorFileRows.Add(CreateLastFactorFileRow(factorFileRows, initialReferencePrice));\n                return new CorporateFactorProvider(Symbol.ID.Symbol, factorFileRows);\n            }\n\n            var nextFactorFileRow = CalculateNextFactorFileRow(factorFileRows, nextEvent);\n\n            if (nextFactorFileRow != null)\n                factorFileRows.Add(nextFactorFileRow);\n\n            return RecursivlyGenerateFactorFile(orderedDividendSplits, factorFileRows);\n        }\n\n        /// <summary>\n        /// Create the last FileFactorRow.\n        /// Represents the earliest date that the daily equity data contains.\n        /// </summary>\n        /// <param name=\"factorFileRows\">The list of factor file rows</param>\n        /// <returns><see cref=\"CorporateFactorRow\"/></returns>\n        private CorporateFactorRow CreateLastFactorFileRow(List<CorporateFactorRow> factorFileRows, decimal referencePrice)\n        {\n            return new CorporateFactorRow(\n                _dailyDataForEquity.Last().Time.Date,\n                factorFileRows.Last().PriceFactor,\n                factorFileRows.Last().SplitFactor,\n                referencePrice\n            );\n        }\n\n        /// <summary>\n        /// Calculates the next <see cref=\"CorporateFactorRow\"/>\n        /// </summary>\n        /// <param name=\"factorFileRows\">The current list of factorFileRows</param>\n        /// <param name=\"nextEvent\">The next dividend, split or intradayDividendSplit</param>\n        /// <returns>A single factor file row</returns>\n        private CorporateFactorRow CalculateNextFactorFileRow(List<CorporateFactorRow> factorFileRows, BaseData nextEvent)\n        {\n            CorporateFactorRow nextCorporateFactorRow;\n            var t = nextEvent.GetType();\n\n            switch (t.Name)\n            {\n                case \"Dividend\":\n                    nextCorporateFactorRow = CalculateNextDividendFactor(nextEvent, factorFileRows.Last());\n                    break;\n                case \"Split\":\n                    nextCorporateFactorRow = CalculateNextSplitFactor(nextEvent, factorFileRows.Last());\n                    break;\n                case \"IntraDayDividendSplit\":\n                    nextCorporateFactorRow = CalculateIntradayDividendSplit((IntraDayDividendSplit)nextEvent, factorFileRows.Last());\n                    break;\n                default:\n                    throw new ArgumentException(\"Unhandled BaseData type for FactorFileGenerator.\");\n            }\n\n            return nextCorporateFactorRow;\n        }\n\n        /// <summary>\n        /// Generates the <see cref=\"CorporateFactorRow\"/> that represents a intraday dividend split.\n        /// Applies the dividend first.\n        /// </summary>\n        /// <param name=\"intraDayDividendSplit\"><see cref=\"IntraDayDividendSplit\"/> instance that holds the intraday dividend and split information</param>\n        /// <param name=\"last\">The last <see cref=\"CorporateFactorRow\"/> generated recursivly</param>\n        /// <returns><see cref=\"CorporateFactorRow\"/> that represents an intraday dividend and split</returns>\n        private CorporateFactorRow CalculateIntradayDividendSplit(IntraDayDividendSplit intraDayDividendSplit, CorporateFactorRow last)\n        {\n            var row = CalculateNextDividendFactor(intraDayDividendSplit.Dividend, last);\n            return CalculateNextSplitFactor(intraDayDividendSplit.Split, row);\n        }\n\n        /// <summary>\n        /// Calculates the price factor of a <see cref=\"Dividend\"/>\n        /// </summary>\n        /// <param name=\"dividend\">The next dividend</param>\n        /// <param name=\"previousCorporateFactorRow\">The previous <see cref=\"CorporateFactorRow\"/> generated</param>\n        /// <returns><see cref=\"CorporateFactorRow\"/> that represents the dividend event</returns>\n        private CorporateFactorRow CalculateNextDividendFactor(BaseData dividend, CorporateFactorRow previousCorporateFactorRow)\n        {\n            var eventDayData = GetDailyDataForDate(dividend.Time);\n\n            // If you don't have the equity data nothing can be calculated\n            if (eventDayData == null)\n            {\n                return null;\n            }\n\n            TradeBar previousClosingPrice = FindPreviousTradableDayClosingPrice(eventDayData.Time);\n\n            // adjust the dividend for both price and split factors (!)\n            var priceFactor = previousCorporateFactorRow.PriceFactor *\n                                (1 - dividend.Value * previousCorporateFactorRow.SplitFactor / previousClosingPrice.Close);\n\n            return new CorporateFactorRow(\n                previousClosingPrice.Time,\n                priceFactor.RoundToSignificantDigits(7),\n                previousCorporateFactorRow.SplitFactor,\n                previousClosingPrice.Close\n            );\n        }\n\n        /// <summary>\n        /// Calculates the split factor of a <see cref=\"Split\"/>\n        /// </summary>\n        /// <param name=\"split\">The next <see cref=\"Split\"/></param>\n        /// <param name=\"previousCorporateFactorRow\">The previous <see cref=\"CorporateFactorRow\"/> generated</param>\n        /// <returns><see cref=\"CorporateFactorRow\"/>  that represents the split event</returns>\n        private CorporateFactorRow CalculateNextSplitFactor(BaseData split, CorporateFactorRow previousCorporateFactorRow)\n        {\n            var eventDayData = GetDailyDataForDate(split.Time);\n\n            // If you don't have the equity data nothing can be done\n            if (eventDayData == null)\n            {\n                return null;\n            }\n\n            TradeBar previousClosingPrice = FindPreviousTradableDayClosingPrice(eventDayData.Time);\n\n            return new CorporateFactorRow(\n                    previousClosingPrice.Time,\n                    previousCorporateFactorRow.PriceFactor,\n                    (previousCorporateFactorRow.SplitFactor / split.Value).RoundToSignificantDigits(6),\n                    previousClosingPrice.Close\n                );\n        }\n\n        /// <summary>\n        /// Gets the data for a specified date\n        /// </summary>\n        /// <param name=\"date\">The current specified date</param>\n        /// <returns><see cref=\"TradeBar\"/>representing that date</returns>\n        private TradeBar GetDailyDataForDate(DateTime date)\n        {\n            return _dailyDataForEquity.FirstOrDefault(x => x.Time.Date == date.Date);\n        }\n\n        /// <summary>\n        /// Gets the data for the previous tradable day\n        /// </summary>\n        /// <param name=\"date\">The current specified date</param>\n        /// <returns>The last tradeble days data</returns>\n        private TradeBar FindPreviousTradableDayClosingPrice(DateTime date)\n        {\n            TradeBar previousDayData = null;\n            var lastDateforData = _dailyDataForEquity.Last();\n\n            while (previousDayData == null && date > lastDateforData.EndTime)\n            {\n                previousDayData = _dailyDataForEquity.FirstOrDefault(x => x.Time == date.AddDays(-1));\n                date = date.AddDays(-1);\n            }\n\n            return previousDayData;\n        }\n\n        /// <summary>\n        /// Read the daily equity date from file\n        /// </summary>\n        /// <param name=\"pathForDailyEquityData\">Path the the daily data</param>\n        /// <returns>A list of <see cref=\"TradeBar\"/> read from file</returns>\n        private static List<TradeBar> ReadDailyEquityData(string pathForDailyEquityData)\n        {\n            var dataReader = new LeanDataReader(pathForDailyEquityData);\n            var bars = dataReader.Parse();\n            return bars.OrderByDescending(x => x.Time)\n                         .Select(x => (TradeBar)x)\n                         .ToList();\n        }\n\n        /// <summary>\n        /// Pairs split and dividend data into one type\n        /// </summary>\n        private class IntraDayDividendSplit : BaseData\n        {\n            public Split Split { get; }\n            public Dividend Dividend { get; }\n\n            public IntraDayDividendSplit(Split split, Dividend dividend)\n            {\n                if (split == null)\n                {\n                    throw new ArgumentNullException(nameof(split));\n                }\n\n                if (dividend == null)\n                {\n                    throw new ArgumentNullException(nameof(dividend));\n                }\n\n                Split = split;\n                Dividend = dividend;\n                Time = Split.Time;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/FileStreamProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IStreamProvider\"/> that just returns a file stream\n    /// </summary>\n    public class FileStreamProvider : IStreamProvider\n    {\n        private readonly Dictionary<string, FileStream> _files = new Dictionary<string, FileStream>();\n\n        /// <summary>\n        /// Opens the specified source as read to be consumed stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be opened</param>\n        /// <returns>The stream representing the specified source</returns>\n        public IEnumerable<Stream> Open(string source)\n        {\n            yield return File.OpenRead(source);\n        }\n\n        /// <summary>\n        /// Closes the specified source file stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be closed</param>\n        public void Close(string source)\n        {\n            // it's expected that users will dispose the stream\n            // from the open call, this is used to clean up any\n            // other resources, for example a ZipFile stream\n            // when we returned a ZipEntry stream\n            _files.Remove(source);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var kvp in _files)\n            {\n                kvp.Value.Dispose();\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/FilteredDataProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataProcessor\"/> that filters the incoming\n    /// stream of data before passing it along to the wrapped processor\n    /// </summary>\n    public class FilteredDataProcessor : IDataProcessor\n    {\n        private readonly Func<IBaseData, bool> _predicate;\n        private readonly IDataProcessor _processor;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FilteredDataProcessor\"/> class\n        /// </summary>\n        /// <param name=\"processor\">The processor to filter data for</param>\n        /// <param name=\"predicate\">The filtering predicate to be applied</param>\n        public FilteredDataProcessor(IDataProcessor processor, Func<IBaseData, bool> predicate)\n        {\n            _predicate = predicate;\n            _processor = processor;\n        }\n\n        /// <summary>\n        /// Invoked for each piece of data from the source file\n        /// </summary>\n        /// <param name=\"data\">The data to be processed</param>\n        public void Process(IBaseData data)\n        {\n            if (_predicate(data))\n            {\n                _processor.Process(data);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _processor.Dispose();\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/GzipStreamProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.IO;\nusing Ionic.BZip2;\nusing Ionic.Zlib;\n\nnamespace QuantConnect.ToolBox\n{\n    public class GzipStreamProvider : IStreamProvider\n    {\n        private readonly Dictionary<string, Stream> _openedStreams = new Dictionary<string, Stream>(2);\n        \n        /// <summary>\n        /// Opens the specified source as read to be consumed stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be opened</param>\n        /// <returns>The stream representing the specified source</returns>\n        public IEnumerable<Stream> Open(string source)\n        {\n            var stream = new GZipStream(File.OpenRead(source), CompressionMode.Decompress);\n            _openedStreams.Add(source, stream);\n            yield return stream;\n        }\n\n        /// <summary>\n        /// Closes the specified source file stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be closed</param>\n        public void Close(string source)\n        {\n            Stream stream;\n            if (_openedStreams.TryGetValue(source, out stream))\n            {\n                stream.Close();\n            }\n            \n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var keyValuePair in _openedStreams)\n            {\n                keyValuePair.Value.Close();\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/IDataProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Specifies a piece of processing that should be performed against a source file\n    /// </summary>\n    public interface IDataProcessor : IDisposable\n    {\n        /// <summary>\n        /// Invoked for each piece of data from the source file\n        /// </summary>\n        /// <param name=\"data\">The data to be processed</param>\n        void Process(IBaseData data);\n    }\n\n    /// <summary>\n    /// Provides methods for creating data processor stacks\n    /// </summary>\n    public static class DataProcessor\n    {\n        /// <summary>\n        /// Creates a new data processor that will filter in input data before piping it into the specified processor\n        /// </summary>\n        public static IDataProcessor FilteredBy(this IDataProcessor processor, Func<IBaseData, bool> predicate)\n        {\n            return new FilteredDataProcessor(processor, predicate);\n        }\n\n        /// <summary>\n        /// Creates a data processor that will aggregate and zip the requested resolutions of data\n        /// </summary>\n        public static IDataProcessor Zip(string dataDirectory, IEnumerable<Resolution> resolutions, TickType tickType, bool sourceIsTick)\n        {\n            var set = resolutions.ToHashSet();\n\n            var root = new PipeDataProcessor();\n\n            // only filter tick sources\n            var stack = !sourceIsTick ? root \n                : (IDataProcessor) new FilteredDataProcessor(root, x => ((Tick) x).TickType == tickType);\n\n            if (set.Contains(Resolution.Tick))\n            {\n                // tick is filtered via trade/quote\n                var tick = new CsvDataProcessor(dataDirectory, Resolution.Tick, tickType);\n                root.PipeTo(tick);\n            }\n            if (set.Contains(Resolution.Second))\n            {\n                root = AddResolution(dataDirectory, tickType, root, Resolution.Second, sourceIsTick);\n                sourceIsTick = false;\n            }\n            if (set.Contains(Resolution.Minute))\n            {\n                root = AddResolution(dataDirectory, tickType, root, Resolution.Minute, sourceIsTick);\n                sourceIsTick = false;\n            }\n            if (set.Contains(Resolution.Hour))\n            {\n                root = AddResolution(dataDirectory, tickType, root, Resolution.Hour, sourceIsTick);\n                sourceIsTick = false;\n            }\n            if (set.Contains(Resolution.Daily))\n            {\n                AddResolution(dataDirectory, tickType, root, Resolution.Daily, sourceIsTick);\n            }\n            return stack;\n        }\n\n        private static PipeDataProcessor AddResolution(string dataDirectory, TickType tickType, PipeDataProcessor root, Resolution resolution, bool sourceIsTick)\n        {\n            var second = new CsvDataProcessor(dataDirectory, resolution, tickType);\n            var secondRoot = new PipeDataProcessor(second);\n            var aggregator = new ConsolidatorDataProcessor(secondRoot, data => CreateConsolidator(resolution, tickType, data, sourceIsTick));\n            root.PipeTo(aggregator);\n            return secondRoot;\n        }\n\n        private static IDataConsolidator CreateConsolidator(Resolution resolution, TickType tickType, IBaseData data, bool sourceIsTick)\n        {\n            var securityType = data.Symbol.ID.SecurityType;\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                case SecurityType.Cfd:\n                case SecurityType.Forex:\n                    return new TickConsolidator(resolution.ToTimeSpan());\n\n                case SecurityType.Option:\n                    if (tickType == TickType.Trade)\n                    {\n                        return sourceIsTick\n                            ? new TickConsolidator(resolution.ToTimeSpan())\n                            : (IDataConsolidator) new TradeBarConsolidator(resolution.ToTimeSpan());\n                    }\n                    if (tickType == TickType.Quote)\n                    {\n                        return sourceIsTick\n                            ? new TickQuoteBarConsolidator(resolution.ToTimeSpan())\n                            : (IDataConsolidator) new QuoteBarConsolidator(resolution.ToTimeSpan());\n                    }\n                    break;\n            }\n            throw new NotImplementedException(\"Consolidator creation is not defined for \" + securityType + \" \" + tickType);\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/IExchangeInfoDownloader.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Exchange Info Downloader Interface for pulling data from a remote source.\n    /// </summary>\n    public interface IExchangeInfoDownloader\n    {\n        /// <summary>\n        /// Market\n        /// </summary>\n        string Market { get; }\n\n        /// <summary>\n        /// Get exchange info coma-separated data\n        /// </summary>\n        /// <returns>Enumerable of exchange info for this market</returns>\n        IEnumerable<string> Get();\n    }\n}"
  },
  {
    "path": "ToolBox/IStreamParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Represents a type capable of accepting a stream and parsing it into an enumerable of data\n    /// </summary>\n    public interface IStreamParser : IDisposable\n    {\n        /// <summary>\n        /// Parses the specified input stream into an enumerable of data\n        /// </summary>\n        /// <param name=\"source\">The source of the stream</param>\n        /// <param name=\"stream\">The input stream to be parsed</param>\n        /// <returns>An enumerable of base data</returns>\n        IEnumerable<BaseData> Parse(string source, Stream stream);\n    }\n}"
  },
  {
    "path": "ToolBox/IStreamProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Defines how to open/close a source file\n    /// </summary>\n    public interface IStreamProvider : IDisposable\n    {\n        /// <summary>\n        /// Opens the specified source as read to be consumed stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be opened</param>\n        /// <returns>The stream representing the specified source</returns>\n        IEnumerable<Stream> Open(string source);\n\n        /// <summary>\n        /// Closes the specified source file stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be closed</param>\n        void Close(string source);\n    }\n\n    /// <summary>\n    /// Provides factor method for creating an <see cref=\"IStreamProvider\"/> from a file name\n    /// </summary>\n    public static class StreamProvider\n    {\n        /// <summary>\n        /// Creates a new <see cref=\"IStreamProvider\"/> capable of reading a file with the specified extenson\n        /// </summary>\n        /// <param name=\"extension\">The file extension</param>\n        /// <returns>A new stream provider capable of reading files with the specified extension</returns>\n        public static IStreamProvider ForExtension(string extension)\n        {\n            var ext = Path.GetExtension(extension);\n            if (ext == \".zip\")\n            {\n                return new ZipStreamProvider();\n            }\n            if (ext == \".bz2\")\n            {\n                return new Bz2StreamProvider();\n            }\n            if (ext == \".gz\")\n            {\n                return new GzipStreamProvider();\n            }\n\n            return new FileStreamProvider();\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/KaikoDataConverter/KaikoCryptoReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Logging;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing ZipEntry = Ionic.Zip.ZipEntry;\n\nnamespace QuantConnect.ToolBox.KaikoDataConverter\n{\n    /// <summary>\n    /// Decompress single entry from Kaiko crypto raw data.\n    /// </summary>\n    public class KaikoDataReader\n    {\n        private Symbol _symbol;\n        private TickType _tickType;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KaikoDataReader\"/> class.\n        /// </summary>\n        /// <param name=\"symbol\">The symbol.</param>\n        /// <param name=\"tickType\">Type of the tick.</param>\n        public KaikoDataReader(Symbol symbol, TickType tickType)\n        {\n            _symbol = symbol;\n            _tickType = tickType;\n        }\n\n        /// <summary>\n        /// Gets the ticks from Kaiko file zip entry.\n        /// </summary>\n        /// <param name=\"zipEntry\">The zip entry.</param>\n        /// <returns></returns>\n        public IEnumerable<BaseData> GetTicksFromZipEntry(ZipEntry zipEntry)\n        {\n            var rawData = GetRawDataStreamFromEntry(zipEntry);\n            return _tickType == TickType.Trade ? ParseKaikoTradeFile(rawData) : ParseKaikoQuoteFile(rawData);\n        }\n\n        /// <summary>\n        /// Gets the raw data from entry.\n        /// </summary>\n        /// <param name=\"zipEntry\">The zip entry.</param>\n        /// <returns>IEnumerable with the zip entry content.</returns>\n        private IEnumerable<string> GetRawDataStreamFromEntry(ZipEntry zipEntry)\n        {\n            using (var outerStream = new StreamReader(zipEntry.OpenReader()))\n            using (var innerStream = new GZipStream(outerStream.BaseStream, CompressionMode.Decompress))\n            using (var outputStream = new StreamReader(innerStream))\n            {\n                string line;\n                while ((line = outputStream.ReadLine()) != null)\n                {\n                    yield return line;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Parse order book information for Kaiko data files\n        /// </summary>\n        /// <param name=\"rawDataLines\">The raw data lines.</param>\n        /// <returns>\n        /// IEnumerable of ticks representing the Kaiko data\n        /// </returns>\n        private IEnumerable<Tick> ParseKaikoQuoteFile(IEnumerable<string> rawDataLines)\n        {\n            var headerLine = rawDataLines.First();\n            var headerCsv = headerLine.ToCsv();\n            var typeColumn = headerCsv.FindIndex(x => x == \"type\");\n            var dateColumn = headerCsv.FindIndex(x => x == \"date\");\n            var priceColumn = headerCsv.FindIndex(x => x == \"price\");\n            var quantityColumn = headerCsv.FindIndex(x => x == \"amount\");\n\n            long currentEpoch = 0;\n            var currentEpochTicks = new List<KaikoTick>();\n\n            foreach (var line in rawDataLines.Skip(1))\n            {\n                if (line == null || string.IsNullOrEmpty(line)) continue;\n\n                var lineParts = line.Split(',');\n\n                var tickEpoch = Parse.Long(lineParts[dateColumn]);\n\n                decimal quantity;\n                decimal price;\n\n                try\n                {\n                    quantity = ParseScientificNotationToDecimal(lineParts, quantityColumn);\n                    price = ParseScientificNotationToDecimal(lineParts, priceColumn);\n                }\n                catch (Exception ex)\n                {\n                    Log.Error($\"KaikoDataConverter.ParseKaikoQuoteFile(): Raw data corrupted. Line {string.Join(\" \", lineParts)}, Exception {ex}\");\n                    continue;\n                }\n\n                var currentTick = new KaikoTick\n                {\n                    TickType = TickType.Quote,\n                    Time = Time.UnixMillisecondTimeStampToDateTime(tickEpoch),\n                    Quantity = quantity,\n                    Value = price,\n                    OrderDirection = lineParts[typeColumn]\n                };\n\n                if (currentEpoch != tickEpoch)\n                {\n                    var quoteTick = CreateQuoteTick(Time.UnixMillisecondTimeStampToDateTime(currentEpoch), currentEpochTicks);\n\n                    if (quoteTick != null) yield return quoteTick;\n\n                    currentEpochTicks.Clear();\n                    currentEpoch = tickEpoch;\n                }\n\n                currentEpochTicks.Add(currentTick);\n            }\n        }\n\n        /// <summary>\n        /// Take a minute snapshot of order book information and make a single Lean quote tick\n        /// </summary>\n        /// <param name=\"date\">The data being processed</param>\n        /// <param name=\"currentEpcohTicks\">The snapshot of bid/ask Kaiko data</param>\n        /// <returns>A single Lean quote tick</returns>\n        private Tick CreateQuoteTick(DateTime date, List<KaikoTick> currentEpcohTicks)\n        {\n            // lowest ask\n            var bestAsk = currentEpcohTicks.Where(x => x.OrderDirection == \"a\")\n                                        .OrderBy(x => x.Value)\n                                        .FirstOrDefault();\n\n            // highest bid\n            var bestBid = currentEpcohTicks.Where(x => x.OrderDirection == \"b\")\n                                        .OrderByDescending(x => x.Value)\n                                        .FirstOrDefault();\n\n            if (bestAsk == null && bestBid == null)\n            {\n                // Did not have enough data to create a tick\n                return null;\n            }\n\n            var tick = new Tick()\n            {\n                Symbol = _symbol,\n                Time = date,\n                TickType = TickType.Quote\n            };\n\n            if (bestBid != null)\n            {\n                tick.BidPrice = bestBid.Price;\n                tick.BidSize = bestBid.Quantity;\n            }\n\n            if (bestAsk != null)\n            {\n                tick.AskPrice = bestAsk.Price;\n                tick.AskSize = bestAsk.Quantity;\n            }\n\n            return tick;\n        }\n\n        /// <summary>\n        /// Parse a kaiko trade file\n        /// </summary>\n        /// <param name=\"unzippedFile\">The path to the unzipped file</param>\n        /// <returns>Lean Ticks in the Kaiko file</returns>\n        private IEnumerable<Tick> ParseKaikoTradeFile(IEnumerable<string> rawDataLines)\n        {\n            var headerLine = rawDataLines.First();\n            var headerCsv = headerLine.ToCsv();\n            var dateColumn = headerCsv.FindIndex(x => x == \"date\");\n            var priceColumn = headerCsv.FindIndex(x => x == \"price\");\n            var quantityColumn = headerCsv.FindIndex(x => x == \"amount\");\n\n            foreach (var line in rawDataLines.Skip(1))\n            {\n                if (line == null || string.IsNullOrEmpty(line)) continue;\n\n                var lineParts = line.Split(',');\n\n                decimal quantity;\n                decimal price;\n\n                try\n                {\n                    quantity = ParseScientificNotationToDecimal(lineParts, quantityColumn);\n                    price = ParseScientificNotationToDecimal(lineParts, priceColumn);\n                }\n                catch (Exception ex)\n                {\n                    Log.Error($\"KaikoDataConverter.ParseKaikoTradeFile(): Raw data corrupted. Line {string.Join(\" \", lineParts)}, Exception {ex}\");\n                    continue;\n                }\n\n                yield return new Tick\n                {\n                    Symbol = _symbol,\n                    TickType = TickType.Trade,\n                    Time = Time.UnixMillisecondTimeStampToDateTime(Parse.Long(lineParts[dateColumn])),\n                    Quantity = quantity,\n                    Value = price\n                };\n            }\n        }\n\n        /// <summary>\n        /// Parse the quantity field of the kaiko ticks - can sometimes be expressed in scientific notation\n        /// </summary>\n        /// <param name=\"lineParts\">The line from the Kaiko file</param>\n        /// <param name=\"column\">The index of the quantity column </param>\n        /// <returns>The quantity as a decimal</returns>\n        private static decimal ParseScientificNotationToDecimal(string[] lineParts, int column)\n        {\n            var value = lineParts[column];\n            if (value.Contains('e', StringComparison.InvariantCulture))\n            {\n                return Parse.Decimal(value, NumberStyles.Float);\n            }\n\n            return lineParts[column].ConvertInvariant<decimal>();\n        }\n\n        /// <summary>\n        /// Simple class to add order direction to Tick\n        /// used for aggregating Kaiko order book snapshots\n        /// </summary>\n        private class KaikoTick : Tick\n        {\n            public string OrderDirection { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/KaikoDataConverter/KaikoDataConverterProgram.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Data;\nusing System.Diagnostics;\nusing QuantConnect.Logging;\nusing System.Collections.Generic;\nusing ZipFile = Ionic.Zip.ZipFile;\n\nnamespace QuantConnect.ToolBox.KaikoDataConverter\n{\n    /// <summary>\n    /// Console application for converting a single day of Kaiko data into Lean data format for high resolutions (tick, second and minute)\n    /// </summary>\n    public static class KaikoDataConverterProgram\n    {\n        /// <summary>\n        /// Kaiko data converter entry point.\n        /// </summary>\n        /// <param name=\"sourceDirectory\">The source directory where all Kaiko zipped files are stored..</param>\n        /// <param name=\"date\">The date to process.</param>\n        /// <param name=\"exchange\">The exchange to process, if not defined, all exchanges will be processed.</param>\n        /// <exception cref=\"ArgumentException\">Source folder does not exists.</exception>\n        /// <remarks>This converter will process automatically data for every exchange and for both tick types if the raw data files are available in the sourceDirectory</remarks>\n        public static void KaikoDataConverter(string sourceDirectory, string date, string exchange = \"\")\n        {\n            var timer = new Stopwatch();\n            timer.Start();\n            var folderPath = new DirectoryInfo(sourceDirectory);\n            if (!folderPath.Exists)\n            {\n                throw new ArgumentException($\"Source folder {folderPath.FullName} not found\");\n            }\n\n            exchange = !string.IsNullOrEmpty(exchange) && exchange.ToLowerInvariant() == \"gdax\" ? \"coinbase\" : exchange;\n\n            var processingDate = Parse.DateTimeExact(date, DateFormat.EightCharacter);\n            foreach (var filePath in folderPath.EnumerateFiles(\"*.zip\"))\n            {\n                // Do not process exchanges other than the one defined.\n                if (!string.IsNullOrEmpty(exchange) && !filePath.Name.ToLowerInvariant().Contains(exchange.ToLowerInvariant())) continue;\n\n                Log.Trace($\"KaikoDataConverter(): Starting data conversion from source {filePath.Name} for date {processingDate:yyyy_MM_dd}... \");\n                using (var zip = new ZipFile(filePath.FullName))\n                {\n                    var targetDayEntries = zip.Entries.Where(e => e.FileName.Contains($\"{processingDate.ToStringInvariant(\"yyyy_MM_dd\")}\")).ToList();\n\n                    if (!targetDayEntries.Any())\n                    {\n                        Log.Error($\"KaikoDataConverter(): Date {processingDate:yyyy_MM_dd} not found in source file {filePath.FullName}.\");\n                    }\n\n                    foreach (var zipEntry in targetDayEntries)\n                    {\n                        var nameParts = zipEntry.FileName.Split(new char[] { '/' }).Last().Split(new char[] { '_' });\n                        var market = nameParts[0] == \"Coinbase\" ? \"GDAX\" : nameParts[0];\n                        var ticker = nameParts[1];\n                        var tickType = nameParts[2] == \"trades\" ? TickType.Trade : TickType.Quote;\n                        var symbol = Symbol.Create(ticker, SecurityType.Crypto, market);\n\n                        Log.Trace($\"KaikoDataConverter(): Processing {symbol.Value} {tickType}\");\n\n                        // Generate ticks from raw data and write them to disk\n\n                        var reader = new KaikoDataReader(symbol, tickType);\n                        var ticks = reader.GetTicksFromZipEntry(zipEntry);\n\n                        var writer = new LeanDataWriter(Resolution.Tick, symbol, Globals.DataFolder, tickType);\n                        writer.Write(ticks);\n\n                        try\n                        {\n                            Log.Trace($\"KaikoDataConverter(): Starting consolidation for {symbol.Value} {tickType}\");\n                            List<TickAggregator> consolidators = new List<TickAggregator>();\n\n                            if (tickType == TickType.Trade)\n                            {\n                                consolidators.AddRange(new[]\n                                {\n                                    new TradeTickAggregator(Resolution.Second),\n                                    new TradeTickAggregator(Resolution.Minute),\n                                });\n                            }\n                            else\n                            {\n                                consolidators.AddRange(new[]\n                                {\n                                    new QuoteTickAggregator(Resolution.Second),\n                                    new QuoteTickAggregator(Resolution.Minute),\n                                });\n                            }\n\n                            foreach (var tick in ticks)\n                            {\n                                foreach (var consolidator in consolidators)\n                                {\n                                    consolidator.Update(tick);\n                                }\n                            }\n\n                            foreach (var consolidator in consolidators)\n                            {\n                                writer = new LeanDataWriter(consolidator.Resolution, symbol, Globals.DataFolder, tickType);\n                                writer.Write(consolidator.Flush());\n                            }\n                        }\n                        catch (Exception e)\n                        {\n                            Log.Error($\"KaikoDataConverter(): Error processing entry {zipEntry.FileName}. Exception {e}\");\n                        }\n                    }\n                }\n            }\n            Log.Trace($\"KaikoDataConverter(): Finished in {timer.Elapsed}\");\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/LazyStreamWriter.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing System.IO;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// This class wraps a <see cref=\"StreamWriter\"/> so that the StreamWriter is only\n    /// instantiated until WriteLine() is called.  This ensures that the file the StreamWriter is\n    /// writing to is only created if something is written to it. A StreamWriter will create a empty file\n    /// as soon as it is instantiated.\n    /// </summary>\n    public class LazyStreamWriter\n    {\n        private StreamWriter _streamWriter;\n        private readonly string _path;\n\n        /// <summary>\n        /// Constructor for the <see cref=\"LazyStreamWriter\"/>\n        /// </summary>\n        /// <param name=\"path\">Path to the file that should be created</param>\n        public LazyStreamWriter(string path)\n        {\n            _path = path;\n        }\n\n        /// <summary>\n        /// Wraps the WriteLine method of the StreamWriter.\n        /// </summary>\n        /// <param name=\"line\">The line to write</param>\n        /// <remarks>Will instantiate the StreamWriter if this is the first time this method is called</remarks>\n        public void WriteLine(string line)\n        {\n            PrepareStreamWriter();\n\n            _streamWriter.WriteLine(line);\n        }\n\n        /// <summary>\n        /// Wraps the <see cref=\"StreamWriter.Flush()\"/> method\n        /// </summary>\n        public void Flush()\n        {\n            if (_streamWriter != null)\n            {\n                _streamWriter.Flush();\n            }\n        }\n\n        /// <summary>\n        /// Wraps the <see cref=\"StreamWriter.Close()\"/> method\n        /// </summary>\n        public void Close()\n        {\n            if (_streamWriter != null)\n            {\n                _streamWriter.Close();\n            }\n        }\n\n        /// <summary>\n        /// Checks if the StreamWriter is instantiated. If not, it will instantiate the StreamWriter\n        /// </summary>\n        private void PrepareStreamWriter()\n        {\n            if (_streamWriter == null)\n            {\n                _streamWriter = new StreamWriter(_path);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/LeanDataReader.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Ionic.Zip;\nusing NodaTime;\nusing QuantConnect.Data;\nusing QuantConnect.Logging;\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// This class reads data directly from disk and returns the data without the data\n    /// entering the Lean data enumeration stack\n    /// </summary>\n    public class LeanDataReader\n    {\n        private readonly DateTime _date;\n        private readonly string _zipPath;\n        private readonly string _zipentry;\n        private readonly SubscriptionDataConfig _config;\n\n        /// <summary>\n        /// The LeanDataReader constructor\n        /// </summary>\n        /// <param name=\"config\">The <see cref=\"SubscriptionDataConfig\"/></param>\n        /// <param name=\"symbol\">The <see cref=\"Symbol\"/> that will be read</param>\n        /// <param name=\"resolution\">The <see cref=\"Resolution\"/> that will be read</param>\n        /// <param name=\"date\">The <see cref=\"DateTime\"/> that will be read</param>\n        /// <param name=\"dataFolder\">The root data folder</param>\n        public LeanDataReader(SubscriptionDataConfig config, Symbol symbol, Resolution resolution, DateTime date, string dataFolder)\n        {\n            _date = date;\n            _zipPath = LeanData.GenerateZipFilePath(dataFolder, symbol, date,  resolution, config.TickType);\n            _zipentry = LeanData.GenerateZipEntryName(symbol, date, resolution, config.TickType);\n            _config = config;\n        }\n\n        /// <summary>\n        /// Initialize a instance of LeanDataReader from a path to a zipped data file.\n        /// It also supports declaring the zip entry CSV file for options and futures.\n        /// </summary>\n        /// <param name=\"filepath\">Absolute or relative path to a zipped data file, optionally the zip entry file can be declared by using '#' as separator.</param>\n        /// <example>\n        /// var dataReader = LeanDataReader(\"../relative/path/to/file.zip\")\n        /// var dataReader = LeanDataReader(\"absolute/path/to/file.zip#zipEntry.csv\")\n        /// </example>\n        public LeanDataReader(string filepath)\n        {\n            Symbol symbol;\n            DateTime date;\n            Resolution resolution;\n            string zipEntry = null;\n\n            var isFutureOrOption = filepath.Contains('#', StringComparison.InvariantCulture);\n\n            if (isFutureOrOption)\n            {\n                zipEntry = filepath.Split('#')[1];\n                filepath = filepath.Split('#')[0];\n            }\n\n            var fileInfo = new FileInfo(filepath);\n            if (!LeanData.TryParsePath(fileInfo.FullName, out symbol, out date, out resolution, out var tickType, out var dataType))\n            {\n                throw new ArgumentException($\"File {filepath} cannot be parsed.\");\n            }\n\n            if (isFutureOrOption)\n            {\n                symbol = LeanData.ReadSymbolFromZipEntry(symbol, resolution, zipEntry);\n            }\n\n            var marketHoursDataBase = MarketHoursDatabase.FromDataFolder();\n            var dataTimeZone = marketHoursDataBase.GetDataTimeZone(symbol.ID.Market, symbol, symbol.SecurityType);\n            var exchangeTimeZone = marketHoursDataBase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType).TimeZone;\n\n            var config = new SubscriptionDataConfig(dataType, symbol, resolution,\n                                                    dataTimeZone, exchangeTimeZone, tickType: tickType,\n                                                    fillForward: false, extendedHours: true, isInternalFeed: true);\n\n            _date = date;\n            _zipPath = fileInfo.FullName;\n            _zipentry = zipEntry;\n            _config = config;\n        }\n\n        /// <summary>\n        /// Enumerate over the tick zip file and return a list of BaseData.\n        /// </summary>\n        /// <returns>IEnumerable of ticks</returns>\n        public IEnumerable<BaseData> Parse()\n        {\n            if (!File.Exists(_zipPath))\n            {\n                Log.Error($\"LeanDataReader.Parse(): File does not exist: {_zipPath}\");\n                yield break;\n            }\n\n            var factory = (BaseData) ObjectActivator.GetActivator(_config.Type).Invoke(new object[0]);\n\n            if (_config.Type.ImplementsStreamReader())\n            {\n                using (var zip = new ZipFile(_zipPath))\n                {\n                    foreach (var zipEntry in zip.Where(x => _zipentry == null || string.Equals(x.FileName, _zipentry, StringComparison.OrdinalIgnoreCase)))\n                    {\n                        // we get the contract symbol from the zip entry if not already provided with the zip entry\n                        var symbol = _config.Symbol;\n                        if(_zipentry == null && (_config.SecurityType == SecurityType.Future || _config.SecurityType.IsOption()))\n                        {\n                            symbol = LeanData.ReadSymbolFromZipEntry(_config.Symbol, _config.Resolution, zipEntry.FileName);\n                        }\n                        using (var entryReader = new StreamReader(zipEntry.OpenReader()))\n                        {\n                            while (!entryReader.EndOfStream)\n                            {\n                                var dataPoint = factory.Reader(_config, entryReader, _date, false);\n                                dataPoint.Symbol = symbol;\n                                yield return dataPoint;\n                            }\n                        }\n                    }\n                }\n            }\n            // for futures and options if no entry was provided we just read all\n            else if (_zipentry == null && (_config.SecurityType == SecurityType.Future || _config.SecurityType.IsOption()))\n            {\n                foreach (var entries in Compression.Unzip(_zipPath))\n                {\n                    // we get the contract symbol from the zip entry\n                    var symbol = LeanData.ReadSymbolFromZipEntry(_config.Symbol, _config.Resolution, entries.Key);\n                    foreach (var line in entries.Value)\n                    {\n                        var dataPoint = factory.Reader(_config, line, _date, false);\n                        dataPoint.Symbol = symbol;\n                        yield return dataPoint;\n                    }\n                }\n            }\n            else\n            {\n                ZipFile zipFile;\n                using (var unzipped = Compression.Unzip(_zipPath, _zipentry, out zipFile))\n                {\n                    if (unzipped == null)\n                        yield break;\n                    string line;\n                    while ((line = unzipped.ReadLine()) != null)\n                    {\n                        yield return factory.Reader(_config, line, _date, false);\n                    }\n                }\n                zipFile.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Returns the data time zone\n        /// </summary>\n        /// <returns><see cref=\"NodaTime.DateTimeZone\"/> representing the data timezone</returns>\n        public DateTimeZone GetDataTimeZone()\n        {\n            return _config.DataTimeZone;\n        }\n\n        /// <summary>\n        /// Returns the Exchange time zone\n        /// </summary>\n        /// <returns><see cref=\"NodaTime.DateTimeZone\"/> representing the exchange timezone</returns>\n        public DateTimeZone GetExchangeTimeZone()\n        {\n            return _config.ExchangeTimeZone;\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/LeanInstrument.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Represents a single instrument as listed in the file instruments.txt\n    /// </summary>\n    public class LeanInstrument\n    {\n        /// <summary>\n        /// The symbol of the instrument\n        /// </summary>\n        public string Symbol { get; set; }\n\n        /// <summary>\n        /// The name/description of the instrument\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// The instrument type\n        /// </summary>\n        public SecurityType Type { get; set; }\n\n        /// <summary>\n        /// The point value\n        /// </summary>\n        public double PointValue { get; set; }\n    }\n}"
  },
  {
    "path": "ToolBox/LeanParser.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IStreamParser\"/> that reads files in the lean format\n    /// </summary>\n    public class LeanParser : IStreamParser\n    {\n        /// <summary>\n        /// Parses the specified input stream into an enumerable of data\n        /// </summary>\n        /// <param name=\"source\">The source file corresponding the the stream</param>\n        /// <param name=\"stream\">The input stream to be parsed</param>\n        /// <returns>An enumerable of base data</returns>\n        public IEnumerable<BaseData> Parse(string source, Stream stream)\n        {\n            var pathComponents = LeanDataPathComponents.Parse(source);\n            var tickType = pathComponents.Filename.ToLowerInvariant().Contains(\"_trade\")\n                ? TickType.Trade\n                : TickType.Quote;\n\n            var dataType = GetDataType(pathComponents.SecurityType, pathComponents.Resolution, tickType);\n            var factory = (BaseData) Activator.CreateInstance(dataType);\n\n            // ignore time zones here, i.e, we're going to emit data in the data time zone\n            var config = new SubscriptionDataConfig(dataType, pathComponents.Symbol, pathComponents.Resolution, TimeZones.Utc, TimeZones.Utc, false, true, false);\n            using (var reader = new StreamReader(stream))\n            {\n                string line;\n                while ((line = reader.ReadLine()) != null)\n                {\n                    yield return factory.Reader(config, line, pathComponents.Date, false);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n        }\n\n        private Type GetDataType(SecurityType securityType, Resolution resolution, TickType tickType)\n        {\n            if (resolution == Resolution.Tick)\n            {\n                return typeof (Tick);\n            }\n\n            switch (securityType)\n            {\n                case SecurityType.Base:\n                case SecurityType.Equity:\n                    return typeof (TradeBar);\n\n                case SecurityType.Cfd:\n                case SecurityType.Forex:\n                case SecurityType.Crypto:\n                    return typeof (QuoteBar);\n\n                case SecurityType.Option:\n                case SecurityType.FutureOption:\n                case SecurityType.IndexOption:\n                    if (tickType == TickType.Trade) return typeof (TradeBar);\n                    if (tickType == TickType.Quote) return typeof (QuoteBar);\n                    break;\n            }\n            var parameters = string.Join(\" | \", securityType, resolution, tickType);\n            throw new NotImplementedException(\"LeanParser.GetDataType has not yet implemented: \" + parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/PipeDataProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IDataProcessor\"/> that simply forwards all\n    /// received data to other attached processors\n    /// </summary>\n    public class PipeDataProcessor : IDataProcessor\n    {\n        private readonly HashSet<IDataProcessor> _processors;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PipeDataProcessor\"/> class\n        /// </summary>\n        /// <param name=\"processors\">The processors to pipe the data to</param>\n        public PipeDataProcessor(IEnumerable<IDataProcessor> processors)\n        {\n            _processors = processors.ToHashSet();\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PipeDataProcessor\"/> class\n        /// </summary>\n        /// <param name=\"processors\">The processors to pipe the data to</param>\n        public PipeDataProcessor(params IDataProcessor[] processors)\n            : this((IEnumerable<IDataProcessor>)processors)\n        {\n        }\n\n        /// <summary>\n        /// Adds the specified processor to the output pipe\n        /// </summary>\n        /// <param name=\"processor\">Processor to receive data from this pipe</param>\n        public void PipeTo(IDataProcessor processor)\n        {\n            _processors.Add(processor);\n        }\n\n        /// <summary>\n        /// Invoked for each piece of data from the source file\n        /// </summary>\n        /// <param name=\"data\">The data to be processed</param>\n        public void Process(IBaseData data)\n        {\n            foreach (var processor in _processors)\n            {\n                processor.Process(data);\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            foreach (var processor in _processors)\n            {\n                processor.Dispose();\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/Program.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\nusing QuantConnect.Configuration;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Logging;\nusing QuantConnect.ToolBox.AlgoSeekFuturesConverter;\nusing QuantConnect.ToolBox.CoarseUniverseGenerator;\nusing QuantConnect.ToolBox.KaikoDataConverter;\nusing QuantConnect.ToolBox.RandomDataGenerator;\nusing QuantConnect.Util;\nusing System;\nusing System.IO;\nusing static QuantConnect.Configuration.ApplicationParser;\n\nnamespace QuantConnect.ToolBox\n{\n    public class Program\n    {\n        public static void Main(string[] args)\n        {\n            Log.DebuggingEnabled = Config.GetBool(\"debug-mode\");\n            var destinationDir = Config.Get(\"results-destination-folder\");\n            if (!string.IsNullOrEmpty(destinationDir))\n            {\n                Directory.CreateDirectory(destinationDir);\n                Log.FilePath = Path.Combine(destinationDir, \"log.txt\");\n            }\n            Log.LogHandler = Composer.Instance.GetExportedValueByTypeName<ILogHandler>(Config.Get(\"log-handler\", \"CompositeLogHandler\"));\n\n            var optionsObject = ToolboxArgumentParser.ParseArguments(args);\n            if (optionsObject.Count == 0)\n            {\n                PrintMessageAndExit();\n            }\n\n            var dataProvider\n                = Composer.Instance.GetExportedValueByTypeName<IDataProvider>(Config.Get(\"data-provider\", \"DefaultDataProvider\"));\n            var mapFileProvider\n                = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\"));\n            var factorFileProvider\n                = Composer.Instance.GetExportedValueByTypeName<IFactorFileProvider>(Config.Get(\"factor-file-provider\", \"LocalDiskFactorFileProvider\"));\n\n            mapFileProvider.Initialize(dataProvider);\n            factorFileProvider.Initialize(mapFileProvider, dataProvider);\n\n            var targetApp = GetParameterOrExit(optionsObject, \"app\").ToLowerInvariant();\n            if (targetApp.Contains(\"download\") || targetApp.EndsWith(\"dl\"))\n            {\n                var fromDate = Parse.DateTimeExact(GetParameterOrExit(optionsObject, \"from-date\"), \"yyyyMMdd-HH:mm:ss\");\n                var resolution = optionsObject.ContainsKey(\"resolution\") ? optionsObject[\"resolution\"].ToString() : \"\";\n                var market = optionsObject.ContainsKey(\"market\") ? optionsObject[\"market\"].ToString() : \"\";\n                var securityType = optionsObject.ContainsKey(\"security-type\") ? optionsObject[\"security-type\"].ToString() : \"\";\n                var tickers = ToolboxArgumentParser.GetTickers(optionsObject);\n                var toDate = optionsObject.ContainsKey(\"to-date\")\n                    ? Parse.DateTimeExact(optionsObject[\"to-date\"].ToString(), \"yyyyMMdd-HH:mm:ss\")\n                    : DateTime.UtcNow;\n                switch (targetApp)\n                {\n                    default:\n                        PrintMessageAndExit(1, \"ERROR: Unrecognized --app value\");\n                        break;\n                }\n            }\n            else\n            {\n                switch (targetApp)\n                {\n                    case \"asfc\":\n                    case \"algoseekfuturesconverter\":\n                        AlgoSeekFuturesProgram.AlgoSeekFuturesConverter(GetParameterOrExit(optionsObject, \"date\"));\n                        break;\n                    case \"kdc\":\n                    case \"kaikodataconverter\":\n                        KaikoDataConverterProgram.KaikoDataConverter(GetParameterOrExit(optionsObject, \"source-dir\"),\n                                                                     GetParameterOrExit(optionsObject, \"date\"),\n                                                                     GetParameterOrDefault(optionsObject, \"exchange\", string.Empty));\n                        break;\n                    case \"cug\":\n                    case \"coarseuniversegenerator\":\n                        CoarseUniverseGeneratorProgram.CoarseUniverseGenerator();\n                        break;\n                    case \"rdg\":\n                    case \"randomdatagenerator\":\n                        var tickers = ToolboxArgumentParser.GetTickers(optionsObject);\n                        RandomDataGeneratorProgram.RandomDataGenerator(\n                            GetParameterOrExit(optionsObject, \"start\"),\n                            GetParameterOrExit(optionsObject, \"end\"),\n                            GetParameterOrDefault(optionsObject, \"symbol-count\", null),\n                            GetParameterOrDefault(optionsObject, \"market\", null),\n                            GetParameterOrDefault(optionsObject, \"security-type\", \"Equity\"),\n                            GetParameterOrDefault(optionsObject, \"resolution\", \"Minute\"),\n                            GetParameterOrDefault(optionsObject, \"data-density\", \"Dense\"),\n                            GetParameterOrDefault(optionsObject, \"include-coarse\", \"true\"),\n                            GetParameterOrDefault(optionsObject, \"quote-trade-ratio\", \"1\"),\n                            GetParameterOrDefault(optionsObject, \"random-seed\", null),\n                            GetParameterOrDefault(optionsObject, \"ipo-percentage\", \"5.0\"),\n                            GetParameterOrDefault(optionsObject, \"rename-percentage\", \"30.0\"),\n                            GetParameterOrDefault(optionsObject, \"splits-percentage\", \"15.0\"),\n                            GetParameterOrDefault(optionsObject, \"dividends-percentage\", \"60.0\"),\n                            GetParameterOrDefault(optionsObject, \"dividend-every-quarter-percentage\", \"30.0\"),\n                            GetParameterOrDefault(optionsObject, \"option-price-engine\", \"BaroneAdesiWhaleyApproximationEngine\"),\n                            GetParameterOrDefault(optionsObject, \"volatility-model-resolution\", \"Daily\"),\n                            GetParameterOrDefault(optionsObject, \"chain-symbol-count\", \"1\"),\n                            tickers\n                        );\n                        break;\n\n                    default:\n                        PrintMessageAndExit(1, \"ERROR: Unrecognized --app value\");\n                        break;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"QuantConnect.ToolBox\")]\n[assembly: AssemblyProduct(\"QuantConnect.ToolBox\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"5c3d0688-07ac-4cd4-8f2e-e74ebcf32a88\")]\n[assembly: InternalsVisibleTo(\"QuantConnect.Tests\")]\n"
  },
  {
    "path": "ToolBox/QuantConnect.ToolBox.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>QuantConnect.ToolBox</RootNamespace>\n    <AssemblyName>QuantConnect.ToolBox</AssemblyName>\n    <TargetFramework>net10.0</TargetFramework>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\n    <Description>QuantConnect LEAN Engine: ToolBox Project - A collection of data downloaders and converters</Description>\n    <NoWarn>CA1062</NoWarn>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>QuantConnect.ToolBox.Program</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\Common\\Properties\\SharedAssemblyInfo.cs\" Link=\"Properties\\SharedAssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\LICENSE\">\n      <Pack>True</Pack>\n      <PackagePath></PackagePath>\n    </None>\n    <None Include=\"AlgoSeekFuturesConverter\\AlgoSeek.US.Futures.PriceMultipliers.1.1.csv\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Content Include=\"CoarseUniverseGenerator\\blacklisted-tickers.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Engine\\QuantConnect.Lean.Engine.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "ToolBox/README.md",
    "content": "![alt tag](https://cdn.quantconnect.com/web/i/20180601-1615-lean-logo-small.png) Lean Data ToolBox\n=========\n[![Slack Chat](https://img.shields.io/badge/chat-Slack-53c82b.svg)](https://www.quantconnect.com/slack)\n\n[Lean Home][1] | [Documentation][2] | [Download Lean][3]\n----------\n\n## Introduction ##\n\nLean Engine is an open-source algorithmic trading engine built for easy strategy research, backtesting and live trading. We integrate with common data providers and brokerages so you can quickly deploy algorithmic trading strategies.\n\nThe ToolBox project is a command line program which wraps over 15 tools.\n\n## Usage\n\nEach tool requires a different set of parameters, the only **required argument is '--app='**, which defines the target tool and is case insensitive.\n\nHelp information is available using the '--help' parameter.\n\nExample: --app=RandomDataGenerator --tickers=SPY,AAPL --resolution=Daily --from-date=yyyyMMdd-HH:mm:ss --to-date=yyyyMMdd-HH:mm:ss\n\n#### Available downloaders\n\n- **'--app='**\n\t- GDAXDownloader or GDAXDL\n\t- IBDownloader or IBDL\n\t- BitfinexDownloader or BFXDL\n- **'--from-date=yyyyMMdd-HH:mm:ss'** required\n- **'--tickers=SPY,AAPL,etc'** required\n- **'--resolution=Tick/Second/Minute/Hour/Daily/All'** required. **Case sensitive. Not all downloaders support all resolutions**, send empty for more information.\n- **'--to-date=yyyyMMdd-HH:mm:ss'** optional. If not provided 'DateTime.UtcNow' will be used\n\n#### Available Converters\n\n- **'--app='**\n\t- AlgoSeekFuturesConverter or ASFC\n\t\t- **'--date=yyyyMMdd'** reference date.\n\t- AlgoSeekOptionsConverter or ASOC\n\t\t- **'--date=yyyyMMdd'** reference date.\n\t- KaikoDataConverter or KDC\n\t\t- **'--market='** the exchange the data represents.\n\t\t- **'--tick-type=Quote/Trade'** the tick type being processed. Case insensitive.\n\t\t- **'--source-dir='** path to the raw Kaiko data.\n\t- QuantQuoteConverter or QQC\n\t\t- **'--source-dir='** directory where your QuantQuote order is extracted.\n\t\t- **'--destination-dir='** directory where Lean Data is located \"Lean/Data\".\n\t\t- **'--resolution='** resolution of the QuantQuote data.\n\n#### Other tools\n- **'--app='**\n\t- CoarseUniverseGenerator or CUG\n\n[1]: https://lean.quantconnect.com \"Lean Open Source Home Page\"\n[2]: https://lean.quantconnect.com/docs \"Lean Documentation\"\n[3]: https://github.com/QuantConnect/Lean/archive/master.zip\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/BaseSymbolGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Provide the base symbol generator implementation\n    /// </summary>\n    public abstract class BaseSymbolGenerator\n    {\n\n        /// <summary>\n        /// <see cref=\"IRandomValueGenerator\"/> instance producing random values for use in random data generation\n        /// </summary>\n        protected IRandomValueGenerator Random { get; }\n\n        /// <summary>\n        /// Settings of current random data generation run\n        /// </summary>\n        protected RandomDataGeneratorSettings Settings { get; }\n\n        /// <summary>\n        /// Exchange hours and raw data times zones in various markets\n        /// </summary>\n        protected MarketHoursDatabase MarketHoursDatabase { get; }\n\n        /// <summary>\n        /// Access to specific properties for various symbols\n        /// </summary>\n        protected SymbolPropertiesDatabase SymbolPropertiesDatabase { get; }\n\n        // used to prevent generating duplicates, but also caps\n        // the memory allocated to checking for duplicates\n        private readonly FixedSizeHashQueue<Symbol> _symbols;\n\n        /// <summary>\n        /// Base constructor implementation for Symbol generator\n        /// </summary>\n        /// <param name=\"settings\">random data generation run settings</param>\n        /// <param name=\"random\">produces random values for use in random data generation</param>\n        protected BaseSymbolGenerator(RandomDataGeneratorSettings settings, IRandomValueGenerator random)\n        {\n            Settings = settings;\n            Random = random;\n            _symbols = new FixedSizeHashQueue<Symbol>(1000);\n            SymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n            MarketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n        }\n\n        /// <summary>\n        /// Creates a ad-hoc symbol generator depending on settings\n        /// </summary>\n        /// <param name=\"settings\">random data generator settings</param>\n        /// <param name=\"random\">produces random values for use in random data generation</param>\n        /// <returns>New symbol generator</returns>\n        public static BaseSymbolGenerator Create(RandomDataGeneratorSettings settings, IRandomValueGenerator random)\n        {\n            if (settings is null)\n            {\n                throw new ArgumentNullException(nameof(settings), \"Settings cannot be null or empty\");\n            }\n\n            if (random is null)\n            {\n                throw new ArgumentNullException(nameof(random), \"Randomizer cannot be null\");\n            }\n\n            switch (settings.SecurityType)\n            {\n                case SecurityType.Option:\n                    return new OptionSymbolGenerator(settings, random, 100m, 75m);\n\n                case SecurityType.Future:\n                    return new FutureSymbolGenerator(settings, random);\n\n                default:\n                    return new DefaultSymbolGenerator(settings, random);\n            }\n        }\n\n        /// <summary>\n        /// Generates specified number of symbols\n        /// </summary>\n        /// <returns>Set of random symbols</returns>\n        public IEnumerable<Symbol> GenerateRandomSymbols()\n        {\n            if (!Settings.Tickers.IsNullOrEmpty())\n            {\n                foreach (var symbol in Settings.Tickers.SelectMany(GenerateAsset))\n                {\n                    yield return symbol;\n                }\n            }\n            else\n            {\n                for (var i = 0; i < Settings.SymbolCount; i++)\n                {\n                    foreach (var symbol in GenerateAsset())\n                    {\n                        yield return symbol;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Generates a random asset\n        /// </summary>\n        /// <param name=\"ticker\">Optionally can provide a ticker that should be used</param>\n        /// <returns>Random asset</returns>\n        protected abstract IEnumerable<Symbol> GenerateAsset(string ticker = null);\n\n        /// <summary>\n        /// Generates random symbol, used further down for asset\n        /// </summary>\n        /// <param name=\"securityType\">security type</param>\n        /// <param name=\"market\">market</param>\n        /// <param name=\"ticker\">Optionally can provide a ticker to use</param>\n        /// <returns>Random symbol</returns>\n        public Symbol NextSymbol(SecurityType securityType, string market, string ticker = null)\n        {\n            if (securityType == SecurityType.Option || securityType == SecurityType.Future)\n            {\n                throw new ArgumentException(\"Please use OptionSymbolGenerator or FutureSymbolGenerator for SecurityType.Option and SecurityType.Future respectively.\");\n            }\n\n            if (ticker == null)\n            {\n                // we must return a Symbol matching an entry in the Symbol properties database\n                // if there is a wildcard entry, we can generate a truly random Symbol\n                // if there is no wildcard entry, the symbols we can generate are limited by the entries in the database\n                if (SymbolPropertiesDatabase.ContainsKey(market, SecurityDatabaseKey.Wildcard, securityType))\n                {\n                    // let's make symbols all have 3 chars as it's acceptable for all security types with wildcard entries\n                    ticker = NextUpperCaseString(3, 3);\n                }\n                else\n                {\n                    ticker = NextTickerFromSymbolPropertiesDatabase(securityType, market);\n                }\n            }\n\n            // by chance we may generate a ticker that actually exists, and if map files exist that match this\n            // ticker then we'll end up resolving the first trading date for use in the SID, otherwise, all\n            // generated Symbol will have a date equal to SecurityIdentifier.DefaultDate\n            var symbol = Symbol.Create(ticker, securityType, market);\n            if (_symbols.Add(symbol))\n            {\n                return symbol;\n            }\n\n            // lo' and behold, we created a duplicate --recurse to find a unique value\n            // this is purposefully done as the last statement to enable the compiler to\n            // unroll this method into a tail-recursion loop :)\n            return NextSymbol(securityType, market);\n        }\n\n        /// <summary>\n        /// Return a Ticker matching an entry in the Symbol properties database\n        /// </summary>\n        /// <param name=\"securityType\">security type</param>\n        /// <param name=\"market\"></param>\n        /// <returns>Random Ticker matching an entry in the Symbol properties database</returns>\n        protected string NextTickerFromSymbolPropertiesDatabase(SecurityType securityType, string market)\n        {\n            // prevent returning a ticker matching any previously generated Symbol\n            var existingTickers = _symbols\n                .Where(sym => sym.ID.Market == market && sym.ID.SecurityType == securityType)\n                .Select(sym => sym.Value);\n\n            // get the available tickers from the Symbol properties database and remove previously generated tickers\n            var availableTickers = Enumerable.Except(SymbolPropertiesDatabase.GetSymbolPropertiesList(market, securityType)\n                    .Select(kvp => kvp.Key.Symbol), existingTickers)\n                .ToList();\n\n            // there is a limited number of entries in the Symbol properties database so we may run out of tickers\n            if (availableTickers.Count == 0)\n            {\n                throw new NoTickersAvailableException(securityType, market);\n            }\n\n            return availableTickers[Random.NextInt(availableTickers.Count)];\n        }\n\n        /// <summary>\n        /// Generates random expiration date on a friday within specified time range\n        /// </summary>\n        /// <param name=\"marketHours\">market hours</param>\n        /// <param name=\"minExpiry\">minimum expiration date</param>\n        /// <param name=\"maxExpiry\">maximum expiration date</param>\n        /// <returns>Random date on a friday within specified time range</returns>\n        protected DateTime GetRandomExpiration(SecurityExchangeHours marketHours, DateTime minExpiry, DateTime maxExpiry)\n        {\n            // generate a random expiration date on a friday\n            var expiry = Random.NextDate(minExpiry, maxExpiry, DayOfWeek.Friday);\n\n            // check to see if we're open on this date and if not, back track until we are\n            // we're using the equity market hours as a proxy since we haven't generated the option Symbol yet\n            while (!marketHours.IsDateOpen(expiry))\n            {\n                expiry = expiry.AddDays(-1);\n            }\n\n            return expiry;\n        }\n\n        /// <summary>\n        /// Generates a random <see cref=\"string\"/> within the specified lengths.\n        /// </summary>\n        /// <param name=\"minLength\">The minimum length, inclusive</param>\n        /// <param name=\"maxLength\">The maximum length, inclusive</param>\n        /// <returns>A new upper case string within the specified lengths</returns>\n        public string NextUpperCaseString(int minLength, int maxLength)\n        {\n            var str = string.Empty;\n            var length = Random.NextInt(minLength, maxLength);\n            for (int i = 0; i < length; i++)\n            {\n                // A=65 - inclusive lower bound\n                // Z=90 - inclusive upper bound\n                var c = (char)Random.NextInt(65, 91);\n                str += c;\n            }\n\n            return str;\n        }\n\n        /// <summary>\n        /// Returns the number of symbols with the specified parameters can be generated.\n        /// Returns int.MaxValue if there is no limit for the given parameters.\n        /// </summary>\n        /// <returns>The number of available symbols for the given parameters, or int.MaxValue if no limit</returns>\n        public abstract int GetAvailableSymbolCount();\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/DataDensity.cs",
    "content": "﻿namespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Specifies how dense data should be generated\n    /// </summary>\n    public enum DataDensity\n    {\n        /// <summary>\n        /// At least once per resolution step\n        /// </summary>\n        Dense,\n\n        /// <summary>\n        /// At least once per 5 resolution steps\n        /// </summary>\n        Sparse,\n\n        /// <summary>\n        /// At least once per 50 resolution steps\n        /// </summary>\n        VerySparse\n    }\n}"
  },
  {
    "path": "ToolBox/RandomDataGenerator/DefaultSymbolGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates a new random <see cref=\"Symbol\"/> object of the specified security type.\n    /// All returned symbols have a matching entry in the Symbol properties database.\n    /// </summary>\n    /// <remarks>\n    /// A valid implementation will keep track of generated Symbol objects to ensure duplicates\n    /// are not generated.\n    /// </remarks>\n    public class DefaultSymbolGenerator : BaseSymbolGenerator\n    {\n        private readonly string _market;\n        private readonly SecurityType _securityType;\n\n        /// <summary>\n        /// Creates <see cref=\"DefaultSymbolGenerator\"/> instance\n        /// </summary>\n        /// <param name=\"settings\">random data generation run settings</param>\n        /// <param name=\"random\">produces random values for use in random data generation</param>\n        public DefaultSymbolGenerator(RandomDataGeneratorSettings settings, IRandomValueGenerator random)\n            : base(settings, random)\n        {\n            _market = settings.Market;\n            _securityType = settings.SecurityType;\n        }\n\n        /// <summary>\n        /// Generates a single-item list at a time using base random implementation \n        /// </summary>\n        /// <returns></returns>\n        protected override IEnumerable<Symbol> GenerateAsset(string ticker = null)\n        {\n            yield return NextSymbol(Settings.SecurityType, Settings.Market, ticker);\n        }\n\n        /// <summary>\n        /// Returns the number of symbols with the specified parameters can be generated.\n        /// Returns int.MaxValue if there is no limit for the given parameters.\n        /// </summary>\n        /// <returns>The number of available symbols for the given parameters, or int.MaxValue if no limit</returns>\n        public override int GetAvailableSymbolCount()\n        {\n            // check the Symbol properties database to determine how many symbols we can generate\n            // if there is a wildcard entry, we can generate as many symbols as we want\n            // if there is no wildcard entry, we can only generate as many symbols as there are entries\n            return SymbolPropertiesDatabase.ContainsKey(_market, SecurityDatabaseKey.Wildcard, _securityType)\n                ? int.MaxValue\n                : SymbolPropertiesDatabase.GetSymbolPropertiesList(_market, _securityType).Count();\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/DividendSplitMapGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Data.Auxiliary;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates random splits, random dividends, and map file\n    /// </summary>\n    public class DividendSplitMapGenerator\n    {\n        private const double _minimumFinalSplitFactorAllowed = 0.001;\n\n        /// <summary>\n        /// The final factor to adjust all prices with in order to maintain price continuity.\n        /// </summary>\n        /// <remarks>\n        /// Set default equal to 1 so that we can use it even in the event of no splits\n        /// </remarks>\n        public decimal FinalSplitFactor { get; set; } = 1m;\n\n        /// <summary>\n        /// Stores <see cref=\"MapFileRow\"/> instances\n        /// </summary>\n        public List<MapFileRow> MapRows { get; set; } = new();\n\n        /// <summary>\n        /// Stores <see cref=\"CorporateFactorRow\"/> instances\n        /// </summary>\n        public List<CorporateFactorRow> DividendsSplits { get; set; } = new List<CorporateFactorRow>();\n\n        /// <summary>\n        /// Current Symbol value. Can be renamed\n        /// </summary>\n        public Symbol CurrentSymbol { get; private set; }\n\n        private readonly RandomValueGenerator _randomValueGenerator;\n        private readonly Random _random;\n        private readonly RandomDataGeneratorSettings _settings;\n        private readonly DateTime _delistDate;\n        private readonly bool _willBeDelisted;\n        private readonly BaseSymbolGenerator _symbolGenerator;\n\n        public DividendSplitMapGenerator(\n            Symbol symbol,\n            RandomDataGeneratorSettings settings,\n            RandomValueGenerator randomValueGenerator,\n            BaseSymbolGenerator symbolGenerator,\n            Random random,\n            DateTime delistDate,\n            bool willBeDelisted)\n        {\n            CurrentSymbol = symbol;\n            _settings = settings;\n            _randomValueGenerator = randomValueGenerator;\n            _random = random;\n            _delistDate = delistDate;\n            _willBeDelisted = willBeDelisted;\n            _symbolGenerator = symbolGenerator;\n        }\n\n        /// <summary>\n        /// Generates the splits, dividends, and maps.\n        /// Writes necessary output to public variables\n        /// </summary>\n        /// <param name=\"tickHistory\"></param>\n        public void GenerateSplitsDividends(IEnumerable<Tick> tickHistory)\n        {\n            var previousMonth = -1;\n            var monthsTrading = 0;\n\n            var hasRename = _randomValueGenerator.NextBool(_settings.HasRenamePercentage);\n            var hasSplits = _randomValueGenerator.NextBool(_settings.HasSplitsPercentage);\n            var hasDividends = _randomValueGenerator.NextBool(_settings.HasDividendsPercentage);\n            var dividendEveryQuarter = _randomValueGenerator.NextBool(_settings.DividendEveryQuarterPercentage);\n\n            var previousX = _random.NextDouble();\n\n            // Since the largest equity value we can obtain is 1 000 000, if we want this price divided by the FinalSplitFactor\n            // to be upper bounded by 1 000 000 000 we need to make sure the FinalSplitFactor is lower bounded by 0.001. Therefore,\n            // since in the worst of the cases FinalSplitFactor = (previousSplitFactor)^(2m), where m is the number of months\n            // in the time span, we need to lower bound previousSplitFactor by (0.001)^(1/(2m))\n            //\n            // On the other hand, if the upper bound for the previousSplitFactor is 1, then the FinalSplitFactor will be, in the\n            // worst of the cases as small as the minimum equity value we can obtain\n\n            var months = (int)Math.Round(_settings.End.Subtract(_settings.Start).Days / (365.25 / 12));\n            months = months != 0 ? months : 1;\n            var minPreviousSplitFactor = GetLowerBoundForPreviousSplitFactor(months);\n            var maxPreviousSplitFactor = 1;\n            var previousSplitFactor = hasSplits ? GetNextPreviousSplitFactor(_random, minPreviousSplitFactor, maxPreviousSplitFactor) : 1;\n            var previousPriceFactor = hasDividends ? (decimal)Math.Tanh(previousX) : 1;\n\n            var splitDates = new List<DateTime>();\n            var dividendDates = new List<DateTime>();\n\n            var firstTick = true;\n\n            // Iterate through all ticks and generate splits and dividend data\n            if (_settings.SecurityType == SecurityType.Equity)\n            {\n                foreach (var tick in tickHistory)\n                {\n                    // On the first trading day write relevant starting data to factor and map files\n                    if (firstTick)\n                    {\n                        DividendsSplits.Add(new CorporateFactorRow(tick.Time,\n                            previousPriceFactor,\n                            previousSplitFactor,\n                            tick.Value));\n\n                        MapRows.Add(new MapFileRow(tick.Time, CurrentSymbol.Value));\n                    }\n\n                    // Add the split to the DividendsSplits list if we have a pending\n                    // split. That way, we can use the correct referencePrice in the split event.\n                    if (splitDates.Count != 0)\n                    {\n                        var deleteDates = new List<DateTime>();\n\n                        foreach (var splitDate in splitDates)\n                        {\n                            if (tick.Time > splitDate)\n                            {\n                                DividendsSplits.Add(new CorporateFactorRow(\n                                    splitDate,\n                                    previousPriceFactor,\n                                    previousSplitFactor,\n                                    tick.Value / FinalSplitFactor));\n\n                                FinalSplitFactor *= previousSplitFactor;\n                                deleteDates.Add(splitDate);\n                            }\n                        }\n\n                        // Deletes dates we've already looped over\n                        splitDates.RemoveAll(x => deleteDates.Contains(x));\n                    }\n\n                    if (dividendDates.Count != 0)\n                    {\n                        var deleteDates = new List<DateTime>();\n\n                        foreach (var dividendDate in dividendDates)\n                        {\n                            if (tick.Time > dividendDate)\n                            {\n                                DividendsSplits.Add(new CorporateFactorRow(\n                                    dividendDate,\n                                    previousPriceFactor,\n                                    previousSplitFactor,\n                                    tick.Value / FinalSplitFactor));\n\n                                deleteDates.Add(dividendDate);\n                            }\n                        }\n\n                        dividendDates.RemoveAll(x => deleteDates.Contains(x));\n                    }\n\n                    if (tick.Time.Month != previousMonth)\n                    {\n                        // Every quarter, try to generate dividend events\n                        if (hasDividends && (tick.Time.Month - 1) % 3 == 0)\n                        {\n                            // Make it so there's a 10% chance that dividends occur if there is no dividend every quarter\n                            if (dividendEveryQuarter || _randomValueGenerator.NextBool(10.0))\n                            {\n                                do\n                                {\n                                    previousX += _random.NextDouble() / 10;\n                                    previousPriceFactor = (decimal)Math.Tanh(previousX);\n                                } while (previousPriceFactor >= 1.0m || previousPriceFactor <= 0m);\n\n                                dividendDates.Add(_randomValueGenerator.NextDate(tick.Time, tick.Time.AddMonths(1), (DayOfWeek)_random.Next(1, 5)));\n                            }\n                        }\n                        // Have a 5% chance of a split every month\n                        if (hasSplits && _randomValueGenerator.NextBool(_settings.MonthSplitPercentage))\n                        {\n                            // Produce another split factor that is also bounded by the min and max split factors allowed\n                            if (_randomValueGenerator.NextBool(5.0)) // Add the possibility of a reverse split\n                            {\n                                // A reverse split is a split that is smaller than the current previousSplitFactor\n                                // Update previousSplitFactor with a smaller value that is still bounded below by minPreviousSplitFactor\n                                previousSplitFactor = GetNextPreviousSplitFactor(_random, minPreviousSplitFactor, previousSplitFactor);\n                            }\n                            else\n                            {\n                                // Update previousSplitFactor with a higher value that is still bounded by maxPreviousSplitFactor\n                                // Usually, the split factor tends to grow across the time span(See /Data/Equity/usa/factor_files/aapl for instance)\n                                previousSplitFactor = GetNextPreviousSplitFactor(_random, previousSplitFactor, maxPreviousSplitFactor);\n                            }\n\n                            splitDates.Add(_randomValueGenerator.NextDate(tick.Time, tick.Time.AddMonths(1), (DayOfWeek)_random.Next(1, 5)));\n                        }\n                        // 10% chance of being renamed every month\n                        if (hasRename && _randomValueGenerator.NextBool(10.0))\n                        {\n                            var randomDate = _randomValueGenerator.NextDate(tick.Time, tick.Time.AddMonths(1), (DayOfWeek)_random.Next(1, 5));\n                            MapRows.Add(new MapFileRow(randomDate, CurrentSymbol.Value));\n\n                            CurrentSymbol = _symbolGenerator.NextSymbol(_settings.SecurityType, _settings.Market);\n                        }\n\n                        previousMonth = tick.Time.Month;\n                        monthsTrading++;\n                    }\n\n                    if (monthsTrading >= 6 && _willBeDelisted && tick.Time > _delistDate)\n                    {\n                        MapRows.Add(new MapFileRow(tick.Time, CurrentSymbol.Value));\n                        break;\n                    }\n\n                    firstTick = false;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets a lower bound that guarantees the FinalSplitFactor, in all the possible\n        /// cases, will never be smaller than the _minimumFinalSplitFactorAllowed (0.001)\n        /// </summary>\n        /// <param name=\"months\">The lower bound for the previous split factor is based on\n        /// the number of months between the start and end date from ticksHistory <see cref=\"GenerateSplitsDividends(IEnumerable{Tick})\"></param>\n        /// <returns>A valid lower bound that guarantees the FinalSplitFactor is always higher\n        /// than the _minimumFinalSplitFactorAllowed</returns>\n        public static decimal GetLowerBoundForPreviousSplitFactor(int months)\n        {\n            return (decimal)(Math.Pow(_minimumFinalSplitFactorAllowed, 1 / (double)(2 * months)));\n        }\n\n        /// <summary>\n        /// Gets a new valid previousSplitFactor that is still bounded by the given upper and lower\n        /// bounds\n        /// </summary>\n        /// <param name=\"random\">Random number generator</param>\n        /// <param name=\"lowerBound\">Minimum allowed value to obtain</param>\n        /// <param name=\"upperBound\">Maximum allowed value to obtain</param>\n        /// <returns>A new valid previousSplitFactor that is still bounded by the given upper and lower\n        /// bounds</returns>\n        public static decimal GetNextPreviousSplitFactor(Random random, decimal lowerBound, decimal upperBound)\n        {\n            return ((decimal)random.NextDouble()) * (upperBound - lowerBound) + lowerBound;\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/FutureSymbolGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Securities.Future;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates a new random future <see cref=\"Symbol\"/>. The generates future contract Symbol will have an\n    /// expiry between the specified time range.\n    /// </summary>\n    public class FutureSymbolGenerator : BaseSymbolGenerator\n    {\n        private readonly DateTime _minExpiry;\n        private readonly DateTime _maxExpiry;\n        private readonly string _market;\n\n        public FutureSymbolGenerator(RandomDataGeneratorSettings settings, IRandomValueGenerator random)\n            : base(settings, random)\n        {\n            _minExpiry = settings.Start;\n            _maxExpiry = settings.End;\n            _market = settings.Market;\n        }\n\n        /// <summary>\n        /// Generates a new random future <see cref=\"Symbol\"/>. The generates future contract Symbol will have an\n        /// expiry between the specified minExpiry and maxExpiry.\n        /// </summary>\n        /// <param name=\"ticker\">Optionally can provide a ticker that should be used</param>\n        /// <returns>A new future contract Symbol with the specified expiration parameters</returns>\n        protected override IEnumerable<Symbol> GenerateAsset(string ticker = null)\n        {\n            if (ticker == null)\n            {\n                // get a valid ticker from the Symbol properties database\n                ticker = NextTickerFromSymbolPropertiesDatabase(SecurityType.Future, _market);\n            }\n\n            var marketHours = MarketHoursDatabase.GetExchangeHours(_market, ticker, SecurityType.Future);\n            var expiry = GetRandomExpiration(marketHours, _minExpiry, _maxExpiry);\n\n            // Try to get the specific expiry function for this future, if available\n            var symbol = Symbol.CreateFuture(ticker, _market, SecurityIdentifier.DefaultDate);\n            if (!FuturesExpiryFunctions.FuturesExpiryDictionary.TryGetValue(symbol, out var expiryFunction))\n            {\n                // If no expiry function is found, return the future using the previously chosen expiry\n                yield return Symbol.CreateFuture(ticker, _market, expiry);\n                yield break;\n            }\n\n            // Get all valid expiries in range using the expiry function\n            // HashSet ensures unique expiry dates since multiple reference dates may map to same expiry\n            var validExpiries = new HashSet<DateTime>();\n\n            // Extends range by ±1 month to catch all potential expiries.\n            // Some futures (like NG) calculate expiry based on next month's date\n            // (e.g., \"3 business days before 1st of next month\"), so we need to look ahead.\n            // This buffer ensures we don't miss expiries near range boundaries.\n            for (var date = _minExpiry.AddMonths(-1); date <= _maxExpiry.AddMonths(1); date = date.AddDays(1))\n            {\n                // Calculate expiry date using the futures-specific function\n                var newExpiry = expiryFunction(date);\n\n                // Only include expiries within our target range\n                if (_minExpiry < newExpiry && newExpiry <= _maxExpiry)\n                {\n                    // Add to set of valid expiries (automatically handles duplicates)\n                    validExpiries.Add(newExpiry);\n                }\n            }\n\n            if (validExpiries.Count == 0)\n            {\n                yield return Symbol.CreateFuture(ticker, _market, expiry);\n                yield break;\n            }\n\n            // Randomly select one expiry from the valid set\n            var skip = Random.NextInt(validExpiries.Count);\n            expiry = validExpiries.Skip(skip).First();\n\n            // Return the future contract using the randomly selected valid expiry\n            yield return Symbol.CreateFuture(ticker, _market, expiry);\n        }\n\n        /// <summary>\n        /// There is no limit for the future symbols.\n        /// </summary>\n        /// <returns>Returns int.MaxValue</returns>\n        public override int GetAvailableSymbolCount() => int.MaxValue;\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/IPriceGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Defines a type capable of producing random prices\n    /// </summary>\n    /// <remarks>\n    /// Any parameters referenced as a percentage value are always in 'percent space', meaning 1 is 1%.\n    /// </remarks>\n    public interface IPriceGenerator\n    {\n        /// <summary>\n        /// Generates an asset price\n        /// </summary>\n        /// <param name=\"maximumPercentDeviation\">The maximum percent deviation. This value is in percent space,\n        ///     so a value of 1m is equal to 1%.</param>\n        /// <param name=\"referenceDate\">date used in price calculation</param>\n        /// <returns>Returns a new decimal as price</returns>\n        public decimal NextValue(decimal maximumPercentDeviation, DateTime referenceDate);\n\n        /// <summary>\n        /// Indicates Price generator warmed up and ready to generate new values\n        /// </summary>\n        public bool WarmedUp { get; }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/IRandomValueGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing System;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Defines a type capable of producing random values for use in random data generation\n    /// </summary>\n    /// <remarks>\n    /// Any parameters referenced as a percentage value are always in 'percent space', meaning 1 is 1%.\n    /// </remarks>\n    public interface IRandomValueGenerator\n    {\n        /// <summary>\n        /// Randomly return a <see cref=\"bool\"/> value with the specified odds of being true\n        /// </summary>\n        /// <param name=\"percentOddsForTrue\">The percent odds of being true in percent space, so 10 => 10%</param>\n        /// <returns>True or false</returns>\n        bool NextBool(double percentOddsForTrue);\n\n        /// <summary>\n        /// Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0\n        /// </summary>\n        /// <returns>A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.</returns>\n        double NextDouble();\n\n        /// <summary>\n        /// Returns a random integer that is within a specified range.\n        /// </summary>\n        /// <param name=\"minValue\">the inclusive lower bound of the random number returned</param>\n        /// <param name=\"maxValue\">the exclusive upper bound of the random number returned</param>\n        /// <returns>A 32-bit signed integer greater than or equal to minValue and less than maxValue.</returns>\n        int NextInt(int minValue, int maxValue);\n\n        /// <summary>\n        /// Returns a non-negative random integer that is less than the specified maximum.\n        /// </summary>\n        /// <param name=\"maxValue\">the exclusive upper bound of the random number to be generated.</param>\n        /// <returns>A 32-bit signed integer that is greater than or equal to 0, and less than maxValue.</returns>\n        int NextInt(int maxValue);\n\n        /// <summary>\n        /// Generates a random <see cref=\"DateTime\"/> between the specified <paramref name=\"minDateTime\"/> and\n        /// <paramref name=\"maxDateTime\"/>. <paramref name=\"dayOfWeek\"/> is optionally specified to force the\n        /// result to a particular day of the week\n        /// </summary>\n        /// <param name=\"minDateTime\">The minimum date time, inclusive</param>\n        /// <param name=\"maxDateTime\">The maximum date time, inclusive</param>\n        /// <param name=\"dayOfWeek\">Optional. The day of week to force</param>\n        /// <returns>A new <see cref=\"DateTime\"/> within the specified range and optionally of the specified day of week</returns>\n        DateTime NextDate(DateTime minDateTime, DateTime maxDateTime, DayOfWeek? dayOfWeek);\n\n        /// <summary>\n        /// Generates a random <see cref=\"decimal\"/> suitable as a price. This should observe minimum price\n        /// variations if available in <see cref=\"SymbolPropertiesDatabase\"/>, and if not, truncating to 2\n        /// decimal places.\n        /// </summary>\n        /// <exception cref=\"ArgumentException\">Throw when the <paramref name=\"referencePrice\"/> or <paramref name=\"maximumPercentDeviation\"/>\n        /// is less than or equal to zero.</exception>\n        /// <param name=\"securityType\">The security type the price is being generated for</param>\n        /// <param name=\"market\">The market of the security the price is being generated for</param>\n        /// <param name=\"referencePrice\">The reference price used as the mean of random price generation</param>\n        /// <param name=\"maximumPercentDeviation\">The maximum percent deviation. This value is in percent space,\n        ///     so a value of 1m is equal to 1%.</param>\n        /// <returns>A new decimal suitable for usage as price within the specified deviation from the reference price</returns>\n        decimal NextPrice(SecurityType securityType, string market, decimal referencePrice, decimal maximumPercentDeviation);\n\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/ITickGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Data.Market;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Describes main methods for <see cref=\"TickGenerator\"/>\n    /// </summary>\n    public interface ITickGenerator\n    {\n        /// <summary>\n        /// Generates and enumerates data points for current symbol\n        /// </summary>\n        IEnumerable<Tick> GenerateTicks();\n\n        /// <summary>\n        /// Generates a random <see cref=\"Tick\"/> that is at most the specified <paramref name=\"maximumPercentDeviation\"/> away from the\n        /// previous price and is of the requested <paramref name=\"tickType\"/>\n        /// </summary>\n        /// <param name=\"dateTime\">The time of the generated tick</param>\n        /// <param name=\"tickType\">The type of <see cref=\"Tick\"/> to be generated</param>\n        /// <param name=\"maximumPercentDeviation\">The maximum percentage to deviate from the\n        /// previous price, for example, 1 would indicate a maximum of 1% deviation from the\n        /// previous price. For a previous price of 100, this would yield a price between 99 and 101 inclusive</param>\n        /// <returns>A random <see cref=\"Tick\"/> value that is within the specified <paramref name=\"maximumPercentDeviation\"/>\n        /// from the previous price</returns>\n        Tick NextTick(\n            DateTime dateTime,\n            TickType tickType,\n            decimal maximumPercentDeviation\n            );\n\n        /// <summary>\n        /// Generates a random <see cref=\"DateTime\"/> suitable for use as a tick's emit time.\n        /// If the density provided is <see cref=\"DataDensity.Dense\"/>, then at least one tick will be generated per <paramref name=\"resolution\"/> step.\n        /// If the density provided is <see cref=\"DataDensity.Sparse\"/>, then at least one tick will be generated every 5 <paramref name=\"resolution\"/> steps.\n        /// if the density provided is <see cref=\"DataDensity.VerySparse\"/>, then at least one tick will be generated every 50 <paramref name=\"resolution\"/> steps.\n        /// Times returned are guaranteed to be within market hours for the specified Symbol\n        /// </summary>\n        /// <param name=\"previous\">The previous tick time</param>\n        /// <param name=\"resolution\">The requested resolution of data</param>\n        /// <param name=\"density\">The requested data density</param>\n        /// <returns>A new <see cref=\"DateTime\"/> that is after <paramref name=\"previous\"/> according to the specified <paramref name=\"resolution\"/>\n        /// and <paramref name=\"density\"/> specified</returns>\n        DateTime NextTickTime(DateTime previous, Resolution resolution, DataDensity density);\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/NoTickersAvailableException.cs",
    "content": "namespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Exception thrown when there are no tickers left to generate for a certain combination of security type and market.\n    /// </summary>\n    public class NoTickersAvailableException : RandomValueGeneratorException\n    {\n        public NoTickersAvailableException(SecurityType securityType, string market)\n            : base($\"Failed to generate {securityType} symbol for {market}, there are no tickers left\")\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/OptionPriceModelPriceGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing System;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities.Option;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Pricing model used to determine the fair price or theoretical value for a call or a put option price\n    /// by default using the Black-Scholes-Merton model\n    /// </summary>\n    public class OptionPriceModelPriceGenerator : IPriceGenerator\n    {\n        private readonly Option _option;\n\n        /// <summary>\n        /// <see cref=\"RandomPriceGenerator\"/> is always ready to generate new price values as it does not depend on volatility model\n        /// </summary>\n        public bool WarmedUp => _option.PriceModel is QLOptionPriceModel optionPriceModel && optionPriceModel.VolatilityEstimatorWarmedUp || _option.PriceModel is not QLOptionPriceModel;\n\n        /// <summary>\n        /// Creates instance of <see cref=\"OptionPriceModelPriceGenerator\"/>\n        /// </summary>\n        ///<param name=\"security\"><see cref=\"Security\"/> object for which to generate price data</param>\n        public OptionPriceModelPriceGenerator(Security security)\n        {\n            if (security == null)\n            {\n                throw new ArgumentNullException(nameof(security), \"security cannot be null\");\n            }\n\n            if (!security.Symbol.SecurityType.IsOption())\n            {\n                throw new ArgumentException($\"{nameof(OptionPriceModelPriceGenerator)} model cannot be applied to non-option security.\");\n            }\n\n            _option = security as Option;\n        }\n\n        /// <summary>\n        /// For Black-Scholes-Merton model price calculation relies <see cref=\"IOptionPriceModel\"/> of the security\n        /// </summary>\n        /// <param name=\"maximumPercentDeviation\">The maximum percent deviation. This value is in percent space,\n        ///     so a value of 1m is equal to 1%.</param>\n        /// <param name=\"referenceDate\">current reference date</param>\n        /// <returns>A new decimal suitable for usage as new security price</returns>\n        public decimal NextValue(decimal maximumPercentDeviation, DateTime referenceDate)\n        {\n            var underlying = _option.Underlying;\n            var price = underlying.Price;\n\n            var tick = new Tick(referenceDate, underlying.Symbol, price, price);\n            var contract = OptionContract.Create(referenceDate, _option, tick);\n\n            var parameters = new OptionPriceModelParameters(_option, null, contract);\n            return _option.PriceModel.Evaluate(parameters).TheoreticalPrice;\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/OptionSymbolGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates a new random option <see cref=\"Symbol\"/>.\n    /// </summary>\n    public class OptionSymbolGenerator : BaseSymbolGenerator\n    {\n        private readonly DateTime _minExpiry;\n        private readonly DateTime _maxExpiry;\n        private readonly string _market;\n        private readonly int _symbolChainSize;\n        private readonly decimal _underlyingPrice;\n        private readonly decimal _maximumStrikePriceDeviation;\n        private readonly SecurityType _underlyingSecurityType  = SecurityType.Equity;\n\n        public OptionSymbolGenerator(RandomDataGeneratorSettings settings, IRandomValueGenerator random, decimal underlyingPrice, decimal maximumStrikePriceDeviation)\n            : base(settings, random)\n        {\n            // We add seven days more because TickGenerator for options needs first three underlying data points to warm up\n            // the price generator, so if the expiry date is before settings.Start plus three days no quote or trade data is\n            // generated for this option\n            _minExpiry = (settings.Start).AddDays(7);\n            _maxExpiry = (settings.End).AddDays(7);\n            _market = settings.Market;\n            _underlyingPrice = underlyingPrice;\n            _symbolChainSize = settings.ChainSymbolCount;\n            _maximumStrikePriceDeviation = maximumStrikePriceDeviation;\n        }\n\n        /// <summary>\n        /// Generates a new random option <see cref=\"Symbol\"/>. The generated option contract Symbol will have an\n        /// expiry between the specified min and max expiration. The strike\n        /// price will be within the specified maximum strike price deviation of the underlying symbol price\n        /// and should be rounded to reasonable value for the given price. For example, a price of 100 dollars would round\n        /// to 5 dollar increments and a price of 5 dollars would round to 50 cent increments\n        /// </summary>\n        /// <param name=\"ticker\">Optionally can provide a ticker that should be used</param>\n        /// <remarks>\n        /// Standard contracts expiry on the third Friday.\n        /// Weekly contracts expiry every week on Friday\n        /// </remarks>\n        /// <returns>A new option contract Symbol within the specified expiration and strike price parameters along with its underlying symbol</returns>\n        protected override IEnumerable<Symbol> GenerateAsset(string ticker = null)\n        {\n            // first generate the underlying\n            var underlying = NextSymbol(_underlyingSecurityType, _market, ticker);\n            yield return underlying;\n\n            var marketHours = MarketHoursDatabase.GetExchangeHours(_market, underlying, _underlyingSecurityType);\n            var expiry = GetRandomExpiration(marketHours, _minExpiry, _maxExpiry);\n\n            var strikes = new HashSet<decimal>();\n            for (var i = 0; i < _symbolChainSize; i++)\n            {\n                decimal strike;\n                do\n                {\n                    // generate a random strike while respecting the maximum deviation from the underlying's price\n                    // since these are underlying prices, use Equity as the security type\n                    strike = Random.NextPrice(_underlyingSecurityType, _market, _underlyingPrice,\n                        _maximumStrikePriceDeviation);\n\n                    // round the strike price to something reasonable\n                    var order = 1 + Math.Log10((double)strike);\n                    strike = strike.RoundToSignificantDigits((int)order);\n                }\n                // don't allow duplicate strikes\n                while (!strikes.Add(strike));\n\n                foreach (var optionRight in new [] { OptionRight.Put, OptionRight.Call })\n                {\n                    // when providing a null option w/ an expiry, it will automatically create the OSI ticker string for the Value\n                    yield return Symbol.CreateOption(underlying, _market, underlying.SecurityType.DefaultOptionStyle(), optionRight, strike, expiry);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns the number of symbols with the specified parameters can be generated.\n        /// There is no limit for the options.\n        /// </summary>\n        /// <returns>returns int.MaxValue</returns>\n        public override int GetAvailableSymbolCount() => int.MaxValue;\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomDataGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Lean.Engine.DataFeeds.Enumerators;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates random data according to the specified parameters\n    /// </summary>\n    public class RandomDataGenerator\n    {\n        private RandomDataGeneratorSettings _settings;\n        private SecurityManager _securityManager;\n\n        /// <summary>\n        /// Initializes <see cref=\"RandomDataGenerator\"/> instance fields\n        /// </summary>\n        /// <param name=\"settings\">random data generation settings</param>\n        /// <param name=\"securityManager\">security management</param>\n        public void Init(RandomDataGeneratorSettings settings, SecurityManager securityManager)\n        {\n            _settings = settings;\n            _securityManager = securityManager;\n        }\n\n        /// <summary>\n        /// Starts data generation\n        /// </summary>\n        public void Run()\n        {\n            var tickTypesPerSecurityType = SubscriptionManager.DefaultDataTypes();\n            // can specify a seed value in this ctor if determinism is desired\n            var random = new Random();\n            var randomValueGenerator = new RandomValueGenerator();\n            if (_settings.RandomSeedSet)\n            {\n                random = new Random(_settings.RandomSeed);\n                randomValueGenerator = new RandomValueGenerator(_settings.RandomSeed);\n            }\n\n            var symbolGenerator = BaseSymbolGenerator.Create(_settings, randomValueGenerator);\n\n            var maxSymbolCount = symbolGenerator.GetAvailableSymbolCount();\n            if (_settings.SymbolCount > maxSymbolCount)\n            {\n                Log.Error($\"RandomDataGenerator.Run(): Limiting Symbol count to {maxSymbolCount}, we don't have more {_settings.SecurityType} tickers for {_settings.Market}\");\n                _settings.SymbolCount = maxSymbolCount;\n            }\n\n            Log.Trace($\"RandomDataGenerator.Run(): Begin data generation of {_settings.SymbolCount} randomly generated {_settings.SecurityType} assets...\");\n\n            // iterate over our randomly generated symbols\n            var count = 0;\n            var progress = 0d;\n            var previousMonth = -1;\n\n            foreach (var (symbolRef, currentSymbolGroup) in symbolGenerator.GenerateRandomSymbols()\n                .GroupBy(s => s.HasUnderlying ? s.Underlying : s)\n                .Select(g => (g.Key, g.OrderBy(s => s.HasUnderlying).ToList())))\n            {\n                Log.Trace($\"RandomDataGenerator.Run(): Symbol[{++count}]: {symbolRef} Progress: {progress:0.0}% - Generating data...\");\n\n                var tickGenerators = new List<IEnumerator<Tick>>();\n                var tickHistories = new Dictionary<Symbol, List<Tick>>();\n                Security underlyingSecurity = null;\n                foreach (var currentSymbol in currentSymbolGroup)\n                {\n                    if (!_securityManager.TryGetValue(currentSymbol, out var security))\n                    {\n                        security = _securityManager.CreateSecurity(\n                            currentSymbol,\n                            new List<SubscriptionDataConfig>(),\n                            underlying: underlyingSecurity);\n                        _securityManager.Add(security);\n                    }\n\n                    underlyingSecurity ??= security;\n\n                    tickGenerators.Add(\n                        new TickGenerator(_settings, tickTypesPerSecurityType[currentSymbol.SecurityType].ToArray(), security, randomValueGenerator)\n                            .GenerateTicks()\n                            .GetEnumerator());\n\n                    tickHistories.Add(\n                        currentSymbol,\n                        new List<Tick>());\n                }\n\n                using var sync = new SynchronizingBaseDataEnumerator(tickGenerators);\n\n                var lastLoggedProgress = 0.0;\n                Log.Trace(\"[0%] Initializing tick data generation\");\n                while (sync.MoveNext())\n                {\n                    var dataPoint = sync.Current;\n                    if (!_securityManager.TryGetValue(dataPoint.Symbol, out var security))\n                    {\n                        Log.Error($\"RandomDataGenerator.Run(): Could not find security for symbol {sync.Current.Symbol}\");\n                        continue;\n                    }\n\n                    tickHistories[security.Symbol].Add(dataPoint as Tick);\n                    security.Update(new List<BaseData> { dataPoint }, dataPoint.GetType(), false);\n\n                    // Calculate and log progress percentage when it increases by more than 3%\n                    var currentProgress = RandomDataGeneratorHelper.GetProgressAsPercentage(_settings.Start, _settings.End, dataPoint.EndTime);\n                    if (currentProgress - lastLoggedProgress >= 3.0)\n                    {\n                        Log.Trace($\"[{currentProgress:0.00}%] Generating tick data\");\n                        lastLoggedProgress = currentProgress;\n                    }\n                }\n                Log.Trace(\"[100%] Tick data generation completed successfully.\");\n                foreach (var (currentSymbol, tickHistory) in tickHistories)\n                {\n                    var symbol = currentSymbol;\n\n                    // This is done so that we can update the Symbol in the case of a rename event\n                    var delistDate = GetDelistingDate(_settings.Start, _settings.End, randomValueGenerator);\n                    var willBeDelisted = randomValueGenerator.NextBool(1.0);\n\n                    // Companies rarely IPO then disappear within 6 months\n                    if (willBeDelisted && tickHistory.Select(tick => tick.Time.Month).Distinct().Count() <= 6)\n                    {\n                        willBeDelisted = false;\n                    }\n\n                    var dividendsSplitsMaps = new DividendSplitMapGenerator(\n                        symbol,\n                        _settings,\n                        randomValueGenerator,\n                        symbolGenerator,\n                        random,\n                        delistDate,\n                        willBeDelisted);\n\n                    // Keep track of renamed symbols and the time they were renamed. \n                    var renamedSymbols = new Dictionary<Symbol, DateTime>();\n\n                    if (_settings.SecurityType == SecurityType.Equity)\n                    {\n                        dividendsSplitsMaps.GenerateSplitsDividends(tickHistory);\n\n                        if (!willBeDelisted)\n                        {\n                            dividendsSplitsMaps.DividendsSplits.Add(new CorporateFactorRow(new DateTime(2050, 12, 31), 1m, 1m));\n\n                            if (dividendsSplitsMaps.MapRows.Count > 1)\n                            {\n                                // Remove the last element if we're going to have a 20501231 entry\n                                dividendsSplitsMaps.MapRows.RemoveAt(dividendsSplitsMaps.MapRows.Count - 1);\n                            }\n                            dividendsSplitsMaps.MapRows.Add(new MapFileRow(new DateTime(2050, 12, 31), dividendsSplitsMaps.CurrentSymbol.Value));\n                        }\n\n                        // If the Symbol value has changed, update the current Symbol\n                        if (symbol != dividendsSplitsMaps.CurrentSymbol)\n                        {\n                            // Add all Symbol rename events to dictionary\n                            // We skip the first row as it contains the listing event instead of a rename event\n                            foreach (var renameEvent in dividendsSplitsMaps.MapRows.Skip(1))\n                            {\n                                // Symbol.UpdateMappedSymbol does not update the underlying security ID Symbol, which \n                                // is used to create the hash code. Create a new equity Symbol from scratch instead.\n                                symbol = Symbol.Create(renameEvent.MappedSymbol, SecurityType.Equity, _settings.Market);\n                                renamedSymbols.Add(symbol, renameEvent.Date);\n\n                                Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: {symbol} will be renamed on {renameEvent.Date}\");\n                            }\n                        }\n                        else\n                        {\n                            // This ensures that ticks will be written for the current Symbol up until 9999-12-31\n                            renamedSymbols.Add(symbol, new DateTime(9999, 12, 31));\n                        }\n\n                        symbol = dividendsSplitsMaps.CurrentSymbol;\n\n                        // Write Splits and Dividend events to directory factor_files\n                        var factorFile = new CorporateFactorProvider(symbol.Value, dividendsSplitsMaps.DividendsSplits, _settings.Start);\n                        var mapFile = new MapFile(symbol.Value, dividendsSplitsMaps.MapRows);\n\n                        factorFile.WriteToFile(symbol);\n                        mapFile.WriteToCsv(_settings.Market, symbol.SecurityType);\n\n                        Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: {symbol} Dividends, splits, and map files have been written to disk.\");\n                    }\n                    else\n                    {\n                        // This ensures that ticks will be written for the current Symbol up until 9999-12-31\n                        renamedSymbols.Add(symbol, new DateTime(9999, 12, 31));\n                    }\n\n                    // define aggregators via settings\n                    var aggregators = CreateAggregators(_settings, tickTypesPerSecurityType[currentSymbol.SecurityType].ToArray()).ToList();\n                    Symbol previousSymbol = null;\n                    var currentCount = 0;\n                    var monthsTrading = 0;\n\n                    foreach (var renamed in renamedSymbols)\n                    {\n                        var previousRenameDate = previousSymbol == null ? new DateTime(1, 1, 1) : renamedSymbols[previousSymbol];\n                        var previousRenameDateDay = new DateTime(previousRenameDate.Year, previousRenameDate.Month, previousRenameDate.Day);\n                        var renameDate = renamed.Value;\n                        var renameDateDay = new DateTime(renameDate.Year, renameDate.Month, renameDate.Day);\n\n                        foreach (var tick in tickHistory.Where(tick => tick.Time >= previousRenameDate && previousRenameDateDay != TickDay(tick)))\n                        {\n                            // Prevents the aggregator from being updated with ticks after the rename event\n                            if (TickDay(tick) > renameDateDay)\n                            {\n                                break;\n                            }\n\n                            if (tick.Time.Month != previousMonth)\n                            {\n                                Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: Month: {tick.Time:MMMM}\");\n                                previousMonth = tick.Time.Month;\n                                monthsTrading++;\n                            }\n\n                            foreach (var item in aggregators)\n                            {\n                                tick.Value = tick.Value / dividendsSplitsMaps.FinalSplitFactor;\n                                item.Consolidator.Update(tick);\n                            }\n\n                            if (monthsTrading >= 6 && willBeDelisted && tick.Time > delistDate)\n                            {\n                                Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: {renamed.Key} delisted at {tick.Time:MMMM yyyy}\");\n                                break;\n                            }\n                        }\n\n                        // count each stage as a point, so total points is 2*Symbol-count\n                        // and the current progress is twice the current, but less one because we haven't finished writing data yet\n                        progress = 100 * (2 * count - 1) / (2.0 * _settings.SymbolCount);\n\n                        Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: {renamed.Key} Progress: {progress:0.0}% - Saving data in LEAN format\");\n\n                        // persist consolidated data to disk\n                        foreach (var item in aggregators)\n                        {\n                            var writer = new LeanDataWriter(item.Resolution, renamed.Key, Globals.DataFolder, item.TickType);\n\n                            // send the flushed data into the writer. pulling the flushed list is very important,\n                            // lest we likely wouldn't get the last piece of data stuck in the consolidator\n                            // Filter out the data we're going to write here because filtering them in the consolidator update phase\n                            // makes it write all dates for some unknown reason\n                            writer.Write(item.Flush().Where(data => data.Time > previousRenameDate && previousRenameDateDay != DataDay(data)));\n                        }\n\n                        // update progress\n                        progress = 100 * (2 * count) / (2.0 * _settings.SymbolCount);\n                        Log.Trace($\"RandomDataGenerator.Run(): Symbol[{count}]: {symbol} Progress: {progress:0.0}% - Symbol data generation and output completed\");\n\n                        previousSymbol = renamed.Key;\n                        currentCount++;\n                    }\n                }\n            }\n\n            Log.Trace(\"RandomDataGenerator.Run(): Random data generation has completed.\");\n\n            DateTime TickDay(Tick tick) => new(tick.Time.Year, tick.Time.Month, tick.Time.Day);\n            DateTime DataDay(BaseData data) => new(data.Time.Year, data.Time.Month, data.Time.Day);\n        }\n\n        public static DateTime GetDateMidpoint(DateTime start, DateTime end)\n        {\n            TimeSpan span = end.Subtract(start);\n            int span_time = (int)span.TotalMinutes;\n            double diff_span = -(span_time / 2.0);\n            DateTime start_time = end.AddMinutes(Math.Round(diff_span, 2, MidpointRounding.ToEven));\n\n            //Returns a DateTime object that is halfway between start and end\n            return start_time;\n        }\n\n        public static DateTime GetDelistingDate(DateTime start, DateTime end, RandomValueGenerator randomValueGenerator)\n        {\n            var mid_point = GetDateMidpoint(start, end);\n            var delist_Date = randomValueGenerator.NextDate(mid_point, end, null);\n\n            //Returns a DateTime object that is a random value between the mid_point and end\n            return delist_Date;\n        }\n\n        public static IEnumerable<TickAggregator> CreateAggregators(RandomDataGeneratorSettings settings, TickType[] tickTypes)\n        {\n            // create default aggregators for tick type/resolution\n            foreach (var tickAggregator in TickAggregator.ForTickTypes(settings.SecurityType, settings.Resolution, tickTypes))\n            {\n                yield return tickAggregator;\n            }\n\n\n            // ensure we have a daily consolidator when coarse is enabled\n            if (settings.IncludeCoarse && settings.Resolution != Resolution.Daily)\n            {\n                // prefer trades for coarse - in practice equity only does trades, but leaving this as configurable\n                if (tickTypes.Contains(TickType.Trade))\n                {\n                    yield return TickAggregator.ForTickTypes(settings.SecurityType, Resolution.Daily, TickType.Trade).Single();\n                }\n                else\n                {\n                    yield return TickAggregator.ForTickTypes(settings.SecurityType, Resolution.Daily, TickType.Quote).Single();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomDataGeneratorHelper.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Provides helper methods for the Random Data Generator\n    /// </summary>\n    public static class RandomDataGeneratorHelper\n    {\n        /// <summary>\n        /// Calculates the progress percentage of the current time between a start and end time.\n        /// </summary>\n        /// <param name=\"start\">The start time of the process.</param>\n        /// <param name=\"end\">The end time of the process.</param>\n        /// <param name=\"currentTime\">The current time to evaluate progress.</param>\n        /// <returns>The progress as a percentage, rounded to two decimal places.</returns>\n        public static double GetProgressAsPercentage(DateTime start, DateTime end, DateTime currentTime)\n        {\n            var totalDuration = end - start;\n            return Math.Round((currentTime - start).TotalMilliseconds * 1.0 / totalDuration.TotalMilliseconds * 100, 2);\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomDataGeneratorProgram.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Configuration;\nusing QuantConnect.Data.Auxiliary;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\nusing QuantConnect.Securities.Option;\nusing QuantConnect.ToolBox.CoarseUniverseGenerator;\nusing QuantConnect.Util;\nusing System;\nusing System.Collections.Generic;\nusing QuantConnect.Logging;\nusing QuantConnect.Data;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Creates and starts <see cref=\"RandomDataGenerator\"/> instance\n    /// </summary>\n    public static class RandomDataGeneratorProgram\n    {\n        private static readonly IRiskFreeInterestRateModel _interestRateProvider = new InterestRateProvider();\n\n        public static void RandomDataGenerator(\n            string startDateString,\n            string endDateString,\n            string symbolCountString,\n            string market,\n            string securityTypeString,\n            string resolutionString,\n            string dataDensityString,\n            string includeCoarseString,\n            string quoteTradeRatioString,\n            string randomSeed,\n            string hasIpoPercentageString,\n            string hasRenamePercentageString,\n            string hasSplitsPercentageString,\n            string hasDividendsPercentageString,\n            string dividendEveryQuarterPercentageString,\n            string optionPriceEngineName,\n            string volatilityModelResolutionString,\n            string chainSymbolCountString,\n            List<string> tickers\n            )\n        {\n            var settings = RandomDataGeneratorSettings.FromCommandLineArguments(\n                startDateString,\n                endDateString,\n                symbolCountString,\n                market,\n                securityTypeString,\n                resolutionString,\n                dataDensityString,\n                includeCoarseString,\n                quoteTradeRatioString,\n                randomSeed,\n                hasIpoPercentageString,\n                hasRenamePercentageString,\n                hasSplitsPercentageString,\n                hasDividendsPercentageString,\n                dividendEveryQuarterPercentageString,\n                optionPriceEngineName,\n                volatilityModelResolutionString,\n                chainSymbolCountString,\n                tickers\n            );\n\n            if (settings.Start.Year < 1998)\n            {\n                Log.Error($\"RandomDataGeneratorProgram(): Required parameter --start must be at least 19980101\");\n                Environment.Exit(1);\n            }\n\n            var securityManager = new SecurityManager(new TimeKeeper(settings.Start, new[] { TimeZones.Utc }));\n            var securityService = new SecurityService(\n                new CashBook(),\n                MarketHoursDatabase.FromDataFolder(),\n                SymbolPropertiesDatabase.FromDataFolder(),\n                new SecurityInitializerProvider(new FuncSecurityInitializer(security =>\n                {\n                    // init price\n                    security.SetMarketPrice(new Tick(settings.Start, security.Symbol, 100, 100));\n                    security.SetMarketPrice(new OpenInterest(settings.Start, security.Symbol, 10000));\n\n                    // from settings\n                    security.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(settings.VolatilityModelResolution);\n\n                    // from settings\n                    if (security is Option option)\n                    {\n                        option.PriceModel = OptionPriceModels.QuantLib.Create(settings.OptionPriceEngineName,\n                            _interestRateProvider.GetRiskFreeRate(settings.Start, settings.End));\n                    }\n                })),\n                RegisteredSecurityDataTypesProvider.Null,\n                new SecurityCacheProvider(\n                    new SecurityPortfolioManager(securityManager, new SecurityTransactionManager(null, securityManager), new AlgorithmSettings())),\n                new MapFilePrimaryExchangeProvider(Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get(\"map-file-provider\", \"LocalDiskMapFileProvider\")))\n            );\n            securityManager.SetSecurityService(securityService);\n\n            var generator = new RandomDataGenerator();\n            generator.Init(settings, securityManager);\n            generator.Run();\n\n            if (settings.IncludeCoarse && settings.SecurityType == SecurityType.Equity)\n            {\n                Log.Trace(\"RandomDataGeneratorProgram(): Launching coarse data generator...\");\n\n                CoarseUniverseGeneratorProgram.CoarseUniverseGenerator();\n            }\n\n            if (!Console.IsInputRedirected)\n            {\n                Log.Trace(\"RandomDataGeneratorProgram(): Press any key to exit...\");\n                Console.ReadKey();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Brokerages;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Threading;\nusing QuantConnect.Logging;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    public class RandomDataGeneratorSettings\n    {\n        private static int MarketCode = 100;\n        private static readonly string[] DateFormats = { DateFormat.EightCharacter, DateFormat.YearMonth, \"yyyy-MM-dd\" };\n\n        public DateTime Start { get; init; }\n        public DateTime End { get; init; }\n        public SecurityType SecurityType { get; init; } = SecurityType.Equity;\n        public DataDensity DataDensity { get; init; } = DataDensity.Dense;\n        public Resolution Resolution { get; init; } = Resolution.Minute;\n        public string Market { get; init; }\n        public bool IncludeCoarse { get; init; } = true;\n        public int SymbolCount { get; set; }\n        public double QuoteTradeRatio { get; init; } = 1;\n        public int RandomSeed { get; init; }\n        public bool RandomSeedSet { get; init; }\n        public double HasIpoPercentage { get; init; }\n        public double HasRenamePercentage { get; init; }\n        public double HasSplitsPercentage { get; init; }\n        public double MonthSplitPercentage { get; init; }\n        public double HasDividendsPercentage { get; init; }\n        public double DividendEveryQuarterPercentage { get; init; }\n        public string OptionPriceEngineName { get; init; }\n        public int ChainSymbolCount { get; init; } = 1;\n        public Resolution VolatilityModelResolution { get; init; } = Resolution.Daily;\n        public List<string> Tickers { get; init; }\n        public static RandomDataGeneratorSettings FromCommandLineArguments(\n            string startDateString,\n            string endDateString,\n            string symbolCountString,\n            string market,\n            string securityTypeString,\n            string resolutionString,\n            string dataDensityString,\n            string includeCoarseString,\n            string quoteTradeRatioString,\n            string randomSeedString,\n            string hasIpoPercentageString,\n            string hasRenamePercentageString,\n            string hasSplitsPercentageString,\n            string hasDividendsPercentageString,\n            string dividendEveryQuarterPercentageString,\n            string optionPriceEngineName,\n            string volatilityModelResolutionString,\n            string chainSymbolCountString,\n            List<string> tickers,\n            double monthSplitPercentage = 5.0\n            )\n        {\n            var randomSeedSet = true;\n\n            int randomSeed;\n            int symbolCount;\n            int chainSymbolCount;\n            bool includeCoarse;\n            Resolution resolution;\n            double quoteTradeRatio;\n            DataDensity dataDensity;\n            SecurityType securityType;\n            DateTime startDate, endDate;\n            double hasIpoPercentage;\n            double hasRenamePercentage;\n            double hasSplitsPercentage;\n            double hasDividendsPercentage;\n            double dividendEveryQuarterPercentage;\n            Resolution volatilityModelResolution;\n\n            var failed = false;\n            // --start\n            if (!DateTime.TryParseExact(startDateString, DateFormats, null, DateTimeStyles.None, out startDate))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Required parameter --from-date was incorrectly formatted. Please specify in yyyyMMdd format. Value provided: '{startDateString}'\");\n            }\n\n            // --end\n            if (!DateTime.TryParseExact(endDateString, DateFormats, null, DateTimeStyles.None, out endDate))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Required parameter --to-date was incorrectly formatted. Please specify in yyyyMMdd format. Value provided: '{endDateString}'\");\n            }\n\n            // --tickers\n            if (!tickers.IsNullOrEmpty())\n            {\n                symbolCount = tickers.Count;\n                Log.Trace(\"RandomDataGeneratorSettings(): Ignoring symbol count will use provided tickers\");\n            }\n            // --symbol-count\n            else if (!int.TryParse(symbolCountString, out symbolCount) || symbolCount <= 0)\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Required parameter --symbol-count was incorrectly formatted. Please specify a valid integer greater than zero. Value provided: '{symbolCountString}'\");\n            }\n\n            // --chain-symbol-count\n            if (!int.TryParse(chainSymbolCountString, out chainSymbolCount) || chainSymbolCount <= 0)\n            {\n                chainSymbolCount = 10;\n                Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{chainSymbolCount}' for --chain-symbol-count\");\n            }\n\n            // --resolution\n            if (string.IsNullOrEmpty(resolutionString))\n            {\n                resolution = Resolution.Minute;\n                Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{resolution}' for --resolution\");\n            }\n            else if (!Enum.TryParse(resolutionString, true, out resolution))\n            {\n                var validValues = string.Join(\", \", Enum.GetValues(typeof(Resolution)).Cast<Resolution>());\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --resolution was incorrectly formatted. Default is Minute. Please specify a valid Resolution. Value provided: '{resolutionString}' Valid values: {validValues}\");\n            }\n\n            // --standard deviation volatility period span\n            if (string.IsNullOrEmpty(volatilityModelResolutionString))\n            {\n                volatilityModelResolution = Resolution.Daily;\n                Log.Trace($\"RandomDataGeneratorSettings():Using default value of '{resolution}' for --resolution\");\n            }\n            else if (!Enum.TryParse(volatilityModelResolutionString, true, out volatilityModelResolution))\n            {\n                var validValues = string.Join(\", \", Enum.GetValues(typeof(Resolution)).Cast<Resolution>());\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --volatility-model-resolution was incorrectly formatted. Default is Daily. Please specify a valid Resolution. Value provided: '{volatilityModelResolutionString}' Valid values: {validValues}\");\n            }\n\n            // --security-type\n            if (string.IsNullOrEmpty(securityTypeString))\n            {\n                securityType = SecurityType.Equity;\n                Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{securityType}' for --security-type\");\n            }\n            else if (!Enum.TryParse(securityTypeString, true, out securityType))\n            {\n                var validValues = string.Join(\", \", Enum.GetValues(typeof(SecurityType)).Cast<SecurityType>());\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --security-type is invalid. Default is Equity. Please specify a valid SecurityType. Value provided: '{securityTypeString}' Valid values: {validValues}\");\n            }\n\n            if (securityType == SecurityType.Option && resolution != Resolution.Minute)\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): When using --security-type=Option you must specify --resolution=Minute\");\n            }\n\n            // --market\n            if (string.IsNullOrEmpty(market))\n            {\n                market = DefaultBrokerageModel.DefaultMarketMap[securityType];\n                Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{market}' for --market and --security-type={securityType}\");\n            }\n            else if (QuantConnect.Market.Encode(market) == null)\n            {\n                // be sure to add a reference to the unknown market, otherwise we won't be able to decode it coming out\n                QuantConnect.Market.Add(market, Interlocked.Increment(ref MarketCode));\n                Log.Trace($\"RandomDataGeneratorSettings(): Please verify that the specified market value is correct: '{market}'   This value is not known has been added to the market value map. If this is an error, stop the application immediately using Ctrl+C\");\n            }\n\n            // --include-coarse\n            if (string.IsNullOrEmpty(includeCoarseString))\n            {\n                includeCoarse = securityType == SecurityType.Equity;\n                if (securityType != SecurityType.Equity)\n                {\n                    Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{includeCoarse}' for --security-type={securityType}\");\n                }\n            }\n            else if (!bool.TryParse(includeCoarseString, out includeCoarse))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --include-coarse was incorrectly formatted. Please specify a valid boolean. Value provided: '{includeCoarseString}'. Valid values: 'true' or 'false'\");\n            }\n            else if (includeCoarse && securityType != SecurityType.Equity)\n            {\n                Log.Trace(\"RandomDataGeneratorSettings(): Optional parameter --include-coarse will be ignored because it only applies to --security-type=Equity\");\n            }\n\n            // --data-density\n            if (string.IsNullOrEmpty(dataDensityString))\n            {\n                dataDensity = DataDensity.Dense;\n                if (securityType == SecurityType.Option)\n                {\n                    dataDensity = DataDensity.Sparse;\n                }\n                Log.Trace($\"RandomDataGeneratorSettings(): Using default value of '{dataDensity}' for --data-density\");\n            }\n            else if (!Enum.TryParse(dataDensityString, true, out dataDensity))\n            {\n                var validValues = string.Join(\", \", Enum.GetValues(typeof(DataDensity))).Cast<DataDensity>();\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --data-density was incorrectly formatted. Please specify a valid DataDensity. Value provided: '{dataDensityString}'. Valid values: {validValues}\");\n            }\n\n            // --quote-trade-ratio\n            if (string.IsNullOrEmpty(quoteTradeRatioString))\n            {\n                quoteTradeRatio = 1;\n            }\n            else if (!double.TryParse(quoteTradeRatioString, out quoteTradeRatio))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --quote-trade-ratio was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{quoteTradeRatioString}'\");\n            }\n\n            // --random-seed\n            if (string.IsNullOrEmpty(randomSeedString))\n            {\n                randomSeed = 0;\n                randomSeedSet = false;\n            }\n            else if (!int.TryParse(randomSeedString, out randomSeed))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --random-seed was incorrectly formatted. Please specify a valid integer\");\n            }\n\n            // --ipo-percentage\n            if (string.IsNullOrEmpty(hasIpoPercentageString))\n            {\n                hasIpoPercentage = 5.0;\n            }\n            else if (!double.TryParse(hasIpoPercentageString, out hasIpoPercentage))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --ipo-percentage was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{hasIpoPercentageString}'\");\n            }\n\n            // --rename-percentage\n            if (string.IsNullOrEmpty(hasRenamePercentageString))\n            {\n                hasRenamePercentage = 30.0;\n            }\n            else if (!double.TryParse(hasRenamePercentageString, out hasRenamePercentage))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --rename-percentage was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{hasRenamePercentageString}'\");\n            }\n\n            // --splits-percentage\n            if (string.IsNullOrEmpty(hasSplitsPercentageString))\n            {\n                hasSplitsPercentage = 15.0;\n            }\n            else if (!double.TryParse(hasSplitsPercentageString, out hasSplitsPercentage))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --splits-percentage was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{hasSplitsPercentageString}'\");\n            }\n\n            // --dividends-percentage\n            if (string.IsNullOrEmpty(hasDividendsPercentageString))\n            {\n                hasDividendsPercentage = 60.0;\n            }\n            else if (!double.TryParse(hasDividendsPercentageString, out hasDividendsPercentage))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --dividends-percentage was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{hasDividendsPercentageString}'\");\n            }\n\n            // --dividend-every-quarter-percentage\n            if (string.IsNullOrEmpty(dividendEveryQuarterPercentageString))\n            {\n                dividendEveryQuarterPercentage = 30.0;\n            }\n            else if (!double.TryParse(dividendEveryQuarterPercentageString, out dividendEveryQuarterPercentage))\n            {\n                failed = true;\n                Log.Error($\"RandomDataGeneratorSettings(): Optional parameter --dividend-ever-quarter-percentage was incorrectly formatted. Please specify a valid double greater than or equal to zero. Value provided: '{dividendEveryQuarterPercentageString}'\");\n            }\n\n            if (failed)\n            {\n                Log.Error(\"RandomDataGeneratorSettings(): Please address the errors and run the application again.\");\n                Environment.Exit(-1);\n            }\n\n            return new RandomDataGeneratorSettings\n            {\n                End = endDate,\n                Start = startDate,\n\n                Market = market,\n                SymbolCount = symbolCount,\n                SecurityType = securityType,\n                QuoteTradeRatio = quoteTradeRatio,\n                ChainSymbolCount = chainSymbolCount,\n\n                Resolution = resolution,\n\n                DataDensity = dataDensity,\n                IncludeCoarse = includeCoarse,\n                RandomSeed = randomSeed,\n                RandomSeedSet = randomSeedSet,\n\n                HasIpoPercentage = hasIpoPercentage,\n                HasRenamePercentage = hasRenamePercentage,\n                HasSplitsPercentage = hasSplitsPercentage,\n                MonthSplitPercentage = monthSplitPercentage,\n                HasDividendsPercentage = hasDividendsPercentage,\n                DividendEveryQuarterPercentage = dividendEveryQuarterPercentage,\n                OptionPriceEngineName = optionPriceEngineName,\n                VolatilityModelResolution = volatilityModelResolution,\n                Tickers = tickers\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomPriceGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Random pricing model used to determine the fair price or theoretical value for a call or a put option\n    /// </summary>\n    public class RandomPriceGenerator : IPriceGenerator\n    {\n        private readonly Security _security;\n        private readonly IRandomValueGenerator _random;\n\n        /// <summary>\n        /// Creates instance of <see cref=\"RandomPriceGenerator\"/>\n        /// </summary>\n        ///<param name=\"security\"><see cref=\"Security\"/> object for which to generate price data</param>\n        /// <param name=\"random\"><see cref=\"IRandomValueGenerator\"/> type capable of producing random values</param>\n        public RandomPriceGenerator(Security security, IRandomValueGenerator random)\n        {\n            _security = security;\n            _random = random;\n        }\n\n        /// <summary>\n        /// <see cref=\"RandomPriceGenerator\"/> is always ready to generate new price values as it does not depend on volatility model\n        /// </summary>\n        public bool WarmedUp => true;\n\n        /// <summary>\n        /// Generates an asset price\n        /// </summary>\n        /// <param name=\"maximumPercentDeviation\">The maximum percent deviation. This value is in percent space,\n        ///     so a value of 1m is equal to 1%.</param>\n        /// <param name=\"referenceDate\">date used in price calculation</param>\n        /// <returns>Returns a new decimal as price</returns>\n        public decimal NextValue(decimal maximumPercentDeviation, DateTime referenceDate)\n            => _random.NextPrice(_security.Symbol.SecurityType, _security.Symbol.ID.Market, _security.Price, maximumPercentDeviation);\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomValueGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Securities;\nusing QuantConnect.Util;\nusing System;\nusing System.Linq;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IRandomValueGenerator\"/> that uses\n    /// <see cref=\"Random\"/> to generate random values\n    /// </summary>\n    public class RandomValueGenerator : IRandomValueGenerator\n    {\n        private readonly Random _random;\n        private readonly MarketHoursDatabase _marketHoursDatabase;\n        private readonly SymbolPropertiesDatabase _symbolPropertiesDatabase;\n        private const decimal _maximumPriceAllowed = 1000000m;\n\n\n        public RandomValueGenerator()\n            : this(new Random())\n        { }\n\n        public RandomValueGenerator(int seed)\n            : this(new Random(seed))\n        { }\n\n        public RandomValueGenerator(Random random)\n            : this(random, MarketHoursDatabase.FromDataFolder(), SymbolPropertiesDatabase.FromDataFolder())\n        { }\n\n        public RandomValueGenerator(\n            int seed,\n            MarketHoursDatabase marketHoursDatabase,\n            SymbolPropertiesDatabase symbolPropertiesDatabase\n            )\n            : this(new Random(seed), marketHoursDatabase, symbolPropertiesDatabase)\n        { }\n\n        public RandomValueGenerator(Random random, MarketHoursDatabase marketHoursDatabase, SymbolPropertiesDatabase symbolPropertiesDatabase)\n        {\n            _random = random;\n            _marketHoursDatabase = marketHoursDatabase;\n            _symbolPropertiesDatabase = symbolPropertiesDatabase;\n        }\n\n        public bool NextBool(double percentOddsForTrue)\n        {\n            return _random.NextDouble() <= percentOddsForTrue / 100;\n        }\n\n        public virtual DateTime NextDate(DateTime minDateTime, DateTime maxDateTime, DayOfWeek? dayOfWeek)\n        {\n            if (maxDateTime < minDateTime)\n            {\n                throw new ArgumentException(\n                    \"The maximum date time must be less than or equal to the minimum date time specified\"\n                );\n            }\n\n            // compute a random date time value\n            var rangeInDays = (int)maxDateTime.Subtract(minDateTime).TotalDays;\n            var daysOffsetFromMin = _random.Next(0, rangeInDays);\n            var dateTime = minDateTime.AddDays(daysOffsetFromMin);\n\n            var currentDayOfWeek = dateTime.DayOfWeek;\n            if (!dayOfWeek.HasValue || currentDayOfWeek == dayOfWeek.Value)\n            {\n                // either DOW wasn't specified or we got REALLY lucky, although, I suppose it'll happen 1/7 (~14%) of the time\n                return dateTime;\n            }\n\n            var nextDayOfWeek = Enumerable.Range(0, 7)\n                .Select(i => dateTime.AddDays(i))\n                .First(dt => dt.DayOfWeek == dayOfWeek.Value);\n\n            var previousDayOfWeek = Enumerable.Range(0, 7)\n                .Select(i => dateTime.AddDays(-i))\n                .First(dt => dt.DayOfWeek == dayOfWeek.Value);\n\n            // both are valid dates, so chose one randomly\n            if (IsWithinRange(nextDayOfWeek, minDateTime, maxDateTime) &&\n                IsWithinRange(previousDayOfWeek, minDateTime, maxDateTime)\n            )\n            {\n                return _random.Next(0, 1) == 0\n                    ? previousDayOfWeek\n                    : nextDayOfWeek;\n            }\n\n            if (IsWithinRange(nextDayOfWeek, minDateTime, maxDateTime))\n            {\n                return nextDayOfWeek;\n            }\n\n            if (IsWithinRange(previousDayOfWeek, minDateTime, maxDateTime))\n            {\n                return previousDayOfWeek;\n            }\n\n            throw new ArgumentException(\"The provided min and max dates do not have the requested day of week between them\");\n        }\n\n        public double NextDouble() => _random.NextDouble();\n\n        public int NextInt(int minValue, int maxValue) => _random.Next(minValue, maxValue);\n\n        public int NextInt(int maxValue) => _random.Next(maxValue);\n\n        /// <summary>\n        /// Generates a random <see cref=\"decimal\"/> suitable as a price. This should observe minimum price\n        /// variations if available in <see cref=\"SymbolPropertiesDatabase\"/>, and if not, truncating to 2\n        /// decimal places.\n        /// </summary>\n        /// <exception cref=\"ArgumentException\">Throw when the <paramref name=\"referencePrice\"/> or <paramref name=\"maximumPercentDeviation\"/>\n        /// is less than or equal to zero.</exception>\n        /// <param name=\"securityType\">The security type the price is being generated for</param>\n        /// <param name=\"market\">The market of the security the price is being generated for</param>\n        /// <param name=\"referencePrice\">The reference price used as the mean of random price generation</param>\n        /// <param name=\"maximumPercentDeviation\">The maximum percent deviation. This value is in percent space,\n        ///     so a value of 1m is equal to 1%.</param>\n        /// <returns>A new decimal suitable for usage as price within the specified deviation from the reference price</returns>\n        public virtual decimal NextPrice(SecurityType securityType, string market, decimal referencePrice, decimal maximumPercentDeviation)\n        {\n            if (referencePrice <= 0)\n            {\n                if (securityType == SecurityType.Option && referencePrice == 0)\n                {\n                    return 0;\n                }\n                throw new ArgumentException(\"The provided reference price must be a positive number.\");\n            }\n\n            if (maximumPercentDeviation <= 0)\n            {\n                throw new ArgumentException(\"The provided maximum percent deviation must be a positive number\");\n            }\n\n            // convert from percent space to decimal space\n            maximumPercentDeviation /= 100m;\n\n            var symbolProperties = _symbolPropertiesDatabase.GetSymbolProperties(market, null, securityType, \"USD\");\n            var minimumPriceVariation = symbolProperties.MinimumPriceVariation;\n\n            decimal price;\n            var attempts = 0;\n            var increaseProbabilityFactor = 0.5;\n            do\n            {\n                // what follows is a simple model of browning motion that\n                // limits the walk to the specified percent deviation\n\n                var deviation = referencePrice * maximumPercentDeviation * (decimal)(NextDouble() - increaseProbabilityFactor);\n                deviation = Math.Sign(deviation) * Math.Max(Math.Abs(deviation), minimumPriceVariation);\n                price = referencePrice + deviation;\n                price = RoundPrice(price, minimumPriceVariation);\n\n                if (price < 20 * minimumPriceVariation)\n                {\n                    // The price should not be to close to the minimum price variation.\n                    // Invalidate the price to try again and increase the probability of it to going up\n                    price = -1m;\n                    increaseProbabilityFactor = Math.Max(increaseProbabilityFactor - 0.05, 0);\n                }\n\n                if (price > (_maximumPriceAllowed / 10m))\n                {\n                    // The price should not be too higher\n                    // Decrease the probability of it to going up\n                    increaseProbabilityFactor = increaseProbabilityFactor + 0.05;\n                }\n\n                if (price > _maximumPriceAllowed)\n                {\n                    // The price should not be too higher\n                    // Invalidate the price to try again\n                    price = -1;\n                }\n            } while (!IsPriceValid(securityType, price) && ++attempts < 10);\n\n            if (!IsPriceValid(securityType, price))\n            {\n                // if still invalid, use the last price\n                price = referencePrice;\n            }\n\n            return price;\n        }\n\n        private static decimal RoundPrice(decimal price, decimal minimumPriceVariation)\n        {\n            if (minimumPriceVariation == 0) return minimumPriceVariation;\n            return Math.Round(price / minimumPriceVariation) * minimumPriceVariation;\n        }\n\n        private bool IsWithinRange(DateTime value, DateTime min, DateTime max)\n        {\n            return value >= min && value <= max;\n        }\n\n        private static bool IsPriceValid(SecurityType securityType, decimal price)\n        {\n            switch (securityType)\n            {\n                case SecurityType.Option:\n                {\n                    return price >= 0;\n                }\n                default:\n                {\n                    return price > 0 && price < _maximumPriceAllowed;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/RandomValueGeneratorException.cs",
    "content": "﻿using System;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Provides a base class for exceptions thrown by implementations of <see cref=\"IRandomValueGenerator\"/>\n    /// </summary>\n    public class RandomValueGeneratorException : ApplicationException\n    {\n        public RandomValueGeneratorException(string message)\n            : base(message)\n        {\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/RandomDataGenerator/SecurityInitializerProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Interfaces;\nusing QuantConnect.Securities;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    public class SecurityInitializerProvider : ISecurityInitializerProvider\n    {\n        public ISecurityInitializer SecurityInitializer { get; }\n\n        public SecurityInitializerProvider(ISecurityInitializer securityInitializer)\n        {\n            SecurityInitializer = securityInitializer;\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/TickGenerator.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing QuantConnect.Data.Market;\nusing QuantConnect.Securities;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Generates random tick data according to the settings provided\n    /// </summary>\n    public class TickGenerator : ITickGenerator\n    {\n        private readonly IPriceGenerator _priceGenerator;\n        private Symbol Symbol => Security.Symbol;\n\n        private readonly IRandomValueGenerator _random;\n        private readonly RandomDataGeneratorSettings _settings;\n        private readonly TickType[] _tickTypes;\n\n        private MarketHoursDatabase MarketHoursDatabase { get; }\n        private SymbolPropertiesDatabase SymbolPropertiesDatabase { get; }\n        private Security Security { get; }\n\n        public TickGenerator(RandomDataGeneratorSettings settings, TickType[] tickTypes, Security security, IRandomValueGenerator random)\n        {\n            _random = random;\n            _settings = settings;\n            _tickTypes = tickTypes;\n            Security = security;\n            SymbolPropertiesDatabase = SymbolPropertiesDatabase.FromDataFolder();\n            MarketHoursDatabase = MarketHoursDatabase.FromDataFolder();\n\n            if (Symbol.SecurityType.IsOption())\n            {\n                _priceGenerator = new OptionPriceModelPriceGenerator(security);\n            }\n            else\n            {\n                _priceGenerator = new RandomPriceGenerator(security, random);\n            }\n        }\n\n        public IEnumerable<Tick> GenerateTicks()\n        {\n            var current = _settings.Start;\n\n            // There is a possibility that even though this succeeds, the DateTime\n            // generated may be the same as the starting DateTime, although the probability\n            // of this happening diminishes the longer the period we're generating data for is\n            if (_random.NextBool(_settings.HasIpoPercentage))\n            {\n                current = _random.NextDate(_settings.Start, _settings.End, null);\n                Log.Trace($\"\\tSymbol: {Symbol} has delayed IPO at date {current:yyyy MMMM dd}\");\n            }\n\n            // creates a max deviation that scales parabolically as resolution decreases (lower frequency)\n            var deviation = GetMaximumDeviation(_settings.Resolution);\n            while (current <= _settings.End)\n            {\n\n                var next = NextTickTime(current, _settings.Resolution, _settings.DataDensity);\n                // The current date can be the last one of the last day before the market closes\n                // so the next date could be beyond de end date\n                if (next > _settings.End)\n                {\n                    break;\n                }\n\n                if (_tickTypes.Contains(TickType.OpenInterest))\n                {\n                    if (next.Date != current.Date)\n                    {\n                        // 5% deviation in daily OI\n                        var openInterest = NextTick(next.Date, TickType.OpenInterest, 5m);\n                        yield return openInterest;\n                    }\n                }\n\n                Tick nextTick = null;\n                // keeps quotes close to the trades for consistency\n                if (_tickTypes.Contains(TickType.Trade) &&\n                    _tickTypes.Contains(TickType.Quote))\n                {\n                    // %odds of getting a trade tick, for example, a quote:trade ratio of 2 means twice as likely\n                    // to get a quote, which means you have a 33% chance of getting a trade => 1/3\n                    var tradeChancePercent = 100 / (1 + _settings.QuoteTradeRatio);\n                    nextTick = NextTick(\n                        next,\n                        _random.NextBool(tradeChancePercent)\n                            ? TickType.Trade\n                            : TickType.Quote,\n                        deviation);\n                }\n                else if (_tickTypes.Contains(TickType.Trade))\n                {\n                    nextTick = NextTick(next, TickType.Trade, deviation);\n\n                }\n                else if (_tickTypes.Contains(TickType.Quote))\n                {\n                    nextTick = NextTick(next, TickType.Quote, deviation);\n                }\n\n                if (nextTick != null && _priceGenerator.WarmedUp)\n                {\n                    yield return nextTick;\n                }\n\n                // advance to the next time step\n                current = next;\n            }\n        }\n\n        /// <summary>\n        /// Generates a random <see cref=\"Tick\"/> that is at most the specified <paramref name=\"maximumPercentDeviation\"/> away from the\n        /// previous price and is of the requested <paramref name=\"tickType\"/>\n        /// </summary>\n        /// <param name=\"dateTime\">The time of the generated tick</param>\n        /// <param name=\"tickType\">The type of <see cref=\"Tick\"/> to be generated</param>\n        /// <param name=\"maximumPercentDeviation\">The maximum percentage to deviate from the\n        /// previous price for example, 1 would indicate a maximum of 1% deviation from the\n        /// previous price. For a previous price of 100, this would yield a price between 99 and 101 inclusive</param>\n        /// <returns>A random <see cref=\"Tick\"/> value that is within the specified <paramref name=\"maximumPercentDeviation\"/>\n        /// from the previous price</returns>\n        public virtual Tick NextTick(DateTime dateTime, TickType tickType, decimal maximumPercentDeviation)\n        {\n            var next = _priceGenerator.NextValue(maximumPercentDeviation, dateTime);\n            var tick = new Tick\n            {\n                Time = dateTime,\n                Symbol = Symbol,\n                TickType = tickType,\n                Value = next\n            };\n\n            switch (tickType)\n            {\n                case TickType.OpenInterest:\n                    return NextOpenInterest(dateTime, Security.OpenInterest, maximumPercentDeviation);\n\n                case TickType.Trade:\n                    tick.Quantity = _random.NextInt(1, 1500);\n                    return tick;\n\n                case TickType.Quote:\n                    var bid = _random.NextPrice(Symbol.SecurityType, Symbol.ID.Market, tick.Value, maximumPercentDeviation);\n                    if (bid > tick.Value)\n                    {\n                        bid = tick.Value - (bid - tick.Value);\n                    }\n                    var ask = _random.NextPrice(Symbol.SecurityType, Symbol.ID.Market, tick.Value, maximumPercentDeviation);\n                    if (ask < tick.Value)\n                    {\n                        ask = tick.Value + (tick.Value - ask);\n                    }\n\n                    tick.BidPrice = bid;\n                    tick.BidSize = _random.NextInt(1, 1500);\n                    tick.AskPrice = ask;\n                    tick.AskSize = _random.NextInt(1, 1500);\n                    return tick;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(tickType), tickType, null);\n            }\n        }\n\n        /// <summary>\n        /// Generates a random <see cref=\"Tick\"/> that is at most the specified <paramref name=\"maximumPercentDeviation\"/> away from the\n        /// <paramref name=\"previousValue\"/> and is of the Open Interest\n        /// </summary>\n        /// <param name=\"dateTime\">The time of the generated tick</param>\n        /// <param name=\"previousValue\">The previous price, used as a reference for generating\n        /// new random prices for the next time step</param>\n        /// <param name=\"maximumPercentDeviation\">The maximum percentage to deviate from the\n        /// <paramref name=\"previousValue\"/>, for example, 1 would indicate a maximum of 1% deviation from the\n        /// <paramref name=\"previousValue\"/>. For a previous price of 100, this would yield a price between 99 and 101 inclusive</param>\n        /// <returns>A random <see cref=\"Tick\"/> value that is within the specified <paramref name=\"maximumPercentDeviation\"/>\n        /// from the <paramref name=\"previousValue\"/></returns>\n        public Tick NextOpenInterest(DateTime dateTime, decimal previousValue, decimal maximumPercentDeviation)\n        {\n            var next = (long)_random.NextPrice(Symbol.SecurityType, Symbol.ID.Market, previousValue, maximumPercentDeviation);\n            return new OpenInterest\n            {\n                Time = dateTime,\n                Symbol = Symbol,\n                TickType = TickType.OpenInterest,\n                Value = next,\n                Quantity = next\n            };\n        }\n\n        /// <summary>\n        /// Generates a random <see cref=\"DateTime\"/> suitable for use as a tick's emit time.\n        /// If the density provided is <see cref=\"DataDensity.Dense\"/>, then at least one tick will be generated per <paramref name=\"resolution\"/> step.\n        /// If the density provided is <see cref=\"DataDensity.Sparse\"/>, then at least one tick will be generated every 5 <paramref name=\"resolution\"/> steps.\n        /// if the density provided is <see cref=\"DataDensity.VerySparse\"/>, then at least one tick will be generated every 50 <paramref name=\"resolution\"/> steps.\n        /// Times returned are guaranteed to be within market hours for the specified Symbol\n        /// </summary>\n        /// <param name=\"previous\">The previous tick time</param>\n        /// <param name=\"resolution\">The requested resolution of data</param>\n        /// <param name=\"density\">The requested data density</param>\n        /// <returns>A new <see cref=\"DateTime\"/> that is after <paramref name=\"previous\"/> according to the specified <paramref name=\"resolution\"/>\n        /// and <paramref name=\"density\"/> specified</returns>\n        public virtual DateTime NextTickTime(DateTime previous, Resolution resolution, DataDensity density)\n        {\n            var increment = resolution.ToTimeSpan();\n            if (increment == TimeSpan.Zero)\n            {\n                increment = TimeSpan.FromMilliseconds(500);\n            }\n\n            double steps;\n            switch (density)\n            {\n                case DataDensity.Dense:\n                    steps = 0.5 * _random.NextDouble();\n                    break;\n\n                case DataDensity.Sparse:\n                    steps = 5 * _random.NextDouble();\n                    break;\n\n                case DataDensity.VerySparse:\n                    steps = 50 * _random.NextDouble();\n                    break;\n\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(density), density, null);\n            }\n\n            var delta = TimeSpan.FromTicks((long)(steps * increment.Ticks));\n            var tickTime = previous.Add(delta);\n            if (tickTime == previous)\n            {\n                tickTime = tickTime.Add(increment);\n            }\n\n            var barStart = tickTime.Subtract(increment);\n            var marketHours = MarketHoursDatabase.GetExchangeHours(Symbol.ID.Market, Symbol, Symbol.SecurityType);\n            if (!marketHours.IsDateOpen(tickTime) || !marketHours.IsOpen(barStart, tickTime, false))\n            {\n                // we ended up outside of market hours, emit a new tick at market open\n                var nextMarketOpen = marketHours.GetNextMarketOpen(tickTime, false);\n                if (resolution == Resolution.Tick)\n                {\n                    resolution = Resolution.Second;\n                }\n\n                // emit a new tick somewhere in the next trading day at a step higher resolution to guarantee a hit\n                return NextTickTime(nextMarketOpen, resolution - 1, density);\n            }\n\n            return tickTime;\n        }\n\n        private static decimal GetMaximumDeviation(Resolution resolution)\n        {\n            var incr = ((int)resolution) + 0.15m;\n            var deviation = incr * incr * 0.1m;\n            return deviation;\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/RandomDataGenerator/TooManyFailedAttemptsException.cs",
    "content": "﻿namespace QuantConnect.ToolBox.RandomDataGenerator\n{\n    /// <summary>\n    /// Exception thrown when multiple attempts to generate a valid random value end in failure\n    /// </summary>\n    public class TooManyFailedAttemptsException : RandomValueGeneratorException\n    {\n        public TooManyFailedAttemptsException(string method, int attempts)\n            : base($\"Failed to generate a valid value for '{method}' after {attempts} attempts.\")\n        {\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/RawFileProcessor.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing QuantConnect.Logging;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Processing harness used to read files in, parse them, and process them.\n    /// </summary>\n    public class RawFileProcessor : IDisposable\n    {\n        private DateTime? _start;\n        private readonly IStreamProvider _streamProvider;\n        private readonly IStreamParser _parser;\n        private readonly IDataProcessor[] _processors;\n\n        /// <summary>\n        /// Gets or sets a name used for logging\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RawFileProcessor\"/> class\n        /// </summary>\n        public RawFileProcessor(IStreamProvider streamProvider, IStreamParser parser, params IDataProcessor[] processors)\n        {\n            _streamProvider = streamProvider;\n            _parser = parser;\n            _processors = processors;\n        }\n\n        /// <summary>\n        /// Runs the raw file processor on the specified files\n        /// </summary>\n        /// <param name=\"name\">A name for the processor used for logging</param>\n        /// <param name=\"sources\">The raw files to be processed</param>\n        /// <param name=\"streamProvider\">Instance capable of reading the sources into a stream</param>\n        /// <param name=\"streamParser\">Instance capable of parsing the provided stream</param>\n        /// <param name=\"processors\">The data processors to process the parsed data</param>\n        /// <returns>True if the operation completed without error, otherwise false</returns>\n        public static bool Run(string name, IEnumerable<string> sources, IStreamProvider streamProvider, IStreamParser streamParser, params IDataProcessor[] processors)\n        {\n            using (var processor = new RawFileProcessor(streamProvider, streamParser, processors) { Name = name })\n            {\n                foreach (var zip in sources)\n                {\n                    try\n                    {\n                        processor.Process(zip);\n                    }\n                    catch (Exception err)\n                    {\n                        Log.Error(err);\n                        return false;\n                    }\n                }\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Perform processing on the specified source file\n        /// </summary>\n        /// <param name=\"source\">The source file to be processed</param>\n        public void Process(string source)\n        {\n            _start = _start ?? DateTime.UtcNow;\n\n            // process the source file\n            foreach (var stream in _streamProvider.Open(source))\n            {\n                using (stream)\n                {\n                    foreach (var data in _parser.Parse(source, stream))\n                    {\n                        foreach (var processor in _processors)\n                        {\n                            processor.Process(data);\n                        }\n                    }\n                }\n            }\n\n            Log.Trace(\"RawFileProcessor.Process({0}): Finished.\", source);\n            _streamProvider.Close(source);\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            _streamProvider.Dispose();\n            _parser.Dispose();\n            foreach (var processor in _processors)\n            {\n                processor.Dispose();\n            }\n\n            if (_start.HasValue)\n            {\n                var stop = DateTime.UtcNow;\n                Log.Trace(\"RawFileProcessor.Dispose({0}): Elapsed {1}\", Name, stop - _start);\n            }\n        }\n    }\n}"
  },
  {
    "path": "ToolBox/TemporaryPathProvider.cs",
    "content": "﻿/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Helper method that provides and cleans given temporary paths\n    /// </summary>\n    public static class TemporaryPathProvider\n    {\n        private static readonly Queue<string> TemporaryPaths = new Queue<string>();\n\n        // Gets a new temporary path\n        public static string Get()\n        {\n            var newPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToStringInvariant(null));\n            lock (TemporaryPaths)\n            {\n                TemporaryPaths.Enqueue(newPath);\n            }\n            return newPath;\n        }\n\n        /// <summary>\n        /// Recursively deletes all the given temporary paths\n        /// </summary>\n        public static void Delete()\n        {\n            List<string> paths;\n            lock (TemporaryPaths)\n            {\n                paths = TemporaryPaths.ToList(s => s);\n                TemporaryPaths.Clear();\n            }\n            Parallel.ForEach(paths, path =>\n            {\n                try\n                {\n                    Directory.Delete(path, recursive: true);\n                }\n                catch\n                {\n                    // pass\n                }\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/TickAggregator.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing QuantConnect.Data;\nusing QuantConnect.Data.Consolidators;\nusing QuantConnect.Data.Market;\nusing QuantConnect.Util;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Class that uses consolidators to aggregate tick data data\n    /// </summary>\n    public abstract class TickAggregator\n    {\n        protected TickAggregator(Resolution resolution, TickType tickType)\n        {\n            TickType = tickType;\n            Resolution = resolution;\n        }\n\n        /// <summary>\n        /// Gets the tick type of the consolidator\n        /// </summary>\n        public TickType TickType { get; protected set; }\n\n        /// <summary>\n        /// The consolidator used to aggregate data from\n        /// higher resolutions to data in lower resolutions\n        /// </summary>\n        public IDataConsolidator Consolidator { get; protected set; }\n\n        /// <summary>\n        /// The consolidated data\n        /// </summary>\n        public List<BaseData> Consolidated { get; protected set; }\n\n        /// <summary>\n        /// The resolution that the data is being aggregated into\n        /// </summary>\n        public Resolution Resolution { get; }\n\n        /// <summary>\n        /// Updates the consolidator with the specified bar.\n        /// </summary>\n        /// <param name=\"data\">The latest data observation.</param>\n        public virtual void Update(BaseData data)\n        {\n            Consolidator.Update(data);\n        }\n\n        /// <summary>\n        /// Return all the consolidated data as well as the\n        /// bar the consolidator is currently working on\n        /// </summary>\n        public List<BaseData> Flush()\n        {\n            var data = new List<BaseData>(Consolidated);\n            if (Consolidator.WorkingData != null)\n            {\n                data.Add(Consolidator.WorkingData as BaseData);\n            }\n\n            return data;\n        }\n\n        /// <summary>\n        /// Creates the correct <see cref=\"TickAggregator\"/> instances for the specified tick types and resolution.\n        /// <see cref=\"QuantConnect.TickType.OpenInterest\"/> will ignore <paramref name=\"resolution\"/> and use <see cref=\"QuantConnect.Resolution.Daily\"/>\n        /// </summary>\n        public static IEnumerable<TickAggregator> ForTickTypes(SecurityType securityType, Resolution resolution, params TickType[] tickTypes)\n        {\n            if (resolution == Resolution.Tick)\n            {\n                foreach (var tickType in tickTypes.Where(t => LeanData.IsValidConfiguration(securityType, resolution, t)))\n                {\n                    // OI is special\n                    if (tickType == TickType.OpenInterest)\n                    {\n                        yield return new OpenInterestTickAggregator(resolution);\n                        continue;\n                    }\n\n                    yield return new IdentityTickAggregator(tickType);\n                }\n\n                yield break;\n            }\n\n            foreach (var tickType in tickTypes.Where(t => LeanData.IsValidConfiguration(securityType, resolution, t)))\n            {\n                switch (tickType)\n                {\n                    case TickType.Trade:\n                        yield return new TradeTickAggregator(resolution);\n                        break;\n\n                    case TickType.Quote:\n                        yield return new QuoteTickAggregator(resolution);\n                        break;\n\n                    case TickType.OpenInterest:\n                        yield return new OpenInterestTickAggregator(resolution);\n                        break;\n\n                    default:\n                        throw new ArgumentOutOfRangeException(nameof(tickType), tickType, null);\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Use <see cref=\"TickQuoteBarConsolidator\"/> to consolidate quote ticks into a specified resolution\n    /// </summary>\n    public class QuoteTickAggregator : TickAggregator\n    {\n        public QuoteTickAggregator(Resolution resolution)\n            : base(resolution, TickType.Quote)\n        {\n            Consolidated = new List<BaseData>();\n            Consolidator = new TickQuoteBarConsolidator(resolution.ToTimeSpan());\n            Consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                Consolidated.Add(consolidated as QuoteBar);\n            };\n        }\n    }\n\n    /// <summary>\n    /// Use <see cref=\"TickQuoteBarConsolidator\"/> to consolidate trade ticks into a specified resolution\n    /// </summary>\n    public class TradeTickAggregator : TickAggregator\n    {\n        public TradeTickAggregator(Resolution resolution)\n            : base(resolution, TickType.Trade)\n        {\n            Consolidated = new List<BaseData>();\n            Consolidator = new TickConsolidator(resolution.ToTimeSpan());\n            Consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                Consolidated.Add(consolidated as TradeBar);\n            };\n        }\n    }\n\n    /// <summary>\n    /// Use <see cref=\"OpenInterestConsolidator\"/> to consolidate open interest ticks into a specified resolution\n    /// </summary>\n    public class OpenInterestTickAggregator : TickAggregator\n    {\n        public OpenInterestTickAggregator(Resolution resolution)\n            : base(resolution, TickType.OpenInterest)\n        {\n            Consolidated = new List<BaseData>();\n            Consolidator = new OpenInterestConsolidator(resolution.ToTimeSpan());\n            Consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                Consolidated.Add(consolidated as OpenInterest);\n            };\n        }\n    }\n\n    /// <summary>\n    /// Use <see cref=\"IdentityDataConsolidator{T}\"/> to yield ticks unmodified into the consolidated data collection\n    /// </summary>\n    public class IdentityTickAggregator : TickAggregator\n    {\n        public IdentityTickAggregator(TickType tickType)\n            : base(Resolution.Tick, tickType)\n        {\n            Consolidated = new List<BaseData>();\n            Consolidator = FilteredIdentityDataConsolidator.ForTickType(tickType);\n            Consolidator.DataConsolidated += (sender, consolidated) =>\n            {\n                Consolidated.Add(consolidated as Tick);\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "ToolBox/ZipStreamProvider.cs",
    "content": "/*\n * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); \n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Ionic.Zip;\n\nnamespace QuantConnect.ToolBox\n{\n    /// <summary>\n    /// Provides an implementation of <see cref=\"IStreamProvider\"/> that opens zip files\n    /// </summary>\n    public class ZipStreamProvider : IStreamProvider\n    {\n        private readonly object _sync = new object();\n        private readonly Dictionary<string, ZipFile> _zipFiles = new Dictionary<string, ZipFile>();\n\n        /// <summary>\n        /// Opens the specified source as read to be consumed stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be opened</param>\n        /// <returns>The stream representing the specified source</returns>\n        public IEnumerable<Stream> Open(string source)\n        {\n            lock (_sync)\n            {\n                var archive = new ZipFile(source);\n                _zipFiles.Add(source, archive);\n                foreach (var entry in archive)\n                {\n                    yield return entry.OpenReader();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Closes the specified source file stream\n        /// </summary>\n        /// <param name=\"source\">The source file to be closed</param>\n        public void Close(string source)\n        {\n            lock (_sync)\n            {\n                ZipFile archive;\n                if (_zipFiles.TryGetValue(source, out archive))\n                {\n                    _zipFiles.Remove(source);\n                    archive.Dispose();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (_sync)\n            {\n                foreach (var zipFile in _zipFiles.Values)\n                {\n                    zipFile.Dispose();\n                }\n                _zipFiles.Clear();\n            }\n        }\n    }\n}"
  },
  {
    "path": "compare_benchmarks.py",
    "content": "import sys\nimport json\n\nprint(f'Will compare benchmark results {sys.argv[2]} against reference {sys.argv[1]}')\n\nreferenceBenchmark = json.load(open(sys.argv[1]))\nnewBenchmark = json.load(open(sys.argv[2]))\n\nfailed = False\nfor language in [\"CSharp\", \"Python\"]:\n\n\tfor key, value in referenceBenchmark[language].items():\n\t\tif key not in newBenchmark[language]:\n\t\t\tfailed = True\n\t\t\tprint(f'Performance benchmark {key} language {language} was not found in new results')\n\t\t\tcontinue\n\t\tnewResult = newBenchmark[language][key]\n\n\t\t# allow 5% noise\n\t\texpectedValue = value[\"average-dps\"] * 0.90\n\t\tif expectedValue > newResult[\"average-dps\"]:\n\t\t\tfailed = True\n\t\t\tprint(f'Performance benchmark Failed for algorithm {key} language {language}. Was {str(newResult[\"average-dps\"])} expected as low as {str(expectedValue)}')\n\t\telse:\n\t\t\tprint(f'Performance benchmark Passed for algorithm {key} language {language}. Was {str(newResult[\"average-dps\"])} expected as low as {str(expectedValue)}')\n\nif failed:\n\texit(1)\n"
  },
  {
    "path": "google9161359af9633398.html",
    "content": "google-site-verification: google9161359af9633398.html"
  },
  {
    "path": "mypy.ini",
    "content": "# Global options:\n\n[mypy]\ndisable_error_code = var-annotated,has-type,union-attr\n\n[mypy-IPython.*,torch.*,langchain.*,langchain_core.*,langchain_community.*]\nfollow_imports = skip"
  },
  {
    "path": "readme.md",
    "content": "<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/f3581da5-1983-4f6c-af5a-55c79b37913a\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/0f8022d5-952d-418c-9011-2644830137d2\">\n  <img alt=\"lean-header\" width=\"100%\">\n</picture>\n<br />\n<br />\n\n[![Build Status](https://github.com/QuantConnect/Lean/workflows/Build%20%26%20Test%20Lean/badge.svg)](https://github.com/QuantConnect/Lean/actions?query=workflow%3A%22Build%20%26%20Test%20Lean%22) &nbsp;&nbsp;&nbsp; [![Regression Tests](https://github.com/QuantConnect/Lean/workflows/Regression%20Tests/badge.svg)](https://github.com/QuantConnect/Lean/actions?query=workflow%3A%22Regression%20Tests%22) &nbsp;&nbsp;&nbsp; [![LEAN Forum](https://img.shields.io/badge/debug-LEAN%20Forum-53c82b.svg)](https://www.quantconnect.com/forum/discussions/1/lean) &nbsp;&nbsp;&nbsp; [![Discord Chat](https://img.shields.io/badge/chat-Discord-53c82b.svg)](https://www.quantconnect.com/discord)\n\n\n[Lean Home][1] | [Documentation][2] | [Download Zip][3] | [Docker Hub][8] | [Nuget][9]\n\n#\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/09d7707d-619d-48e2-b6d9-ef2d2d61144b\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/aab2422c-f480-421d-9ad2-5a355843d82a\">\n  <img alt=\"features-header\" width=\"100%\">\n</picture>\n\nLEAN is an event-driven, professional-caliber algorithmic trading  platform built with a passion for elegant engineering and deep quant  concept modeling. Out-of-the-box alternative data and live-trading support.\n<br/>\n<br/>\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/d0ca17eb-307f-4155-b989-9afe502845b9\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/9135fa86-c3e3-48e6-bbf9-de97f17afb52\">\n  <img alt=\"feature-list\" width=\"100%\">\n</picture>\n\n<br/>\n<br/>\n\n#\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/f486e040-e350-4c9b-98c5-7b3902c0b7d8\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/d28fd3d4-dad8-4828-94a9-676ddb360bdd\">\n  <img alt=\"modular-header\" width=\"100%\">\n</picture>\nLEAN is modular in design, with each component pluggable and customizable. It ships with models for all major plug-in points.\n<br/>\n<br/>\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/7989d185-45cd-4a40-acef-6ff61d9d82f6\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/5f9cc976-a715-495a-9977-87961509d2e0\">\n  <img alt=\"modular-architecture\" width=\"100%\">\n</picture>\n\n#\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/9b7b7abf-b0f5-41a3-8a1b-a9400738b27a\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/1bb1dd23-dbc7-4a96-b556-edbae84012b5\">\n  <img alt=\"cli-header\" width=\"100%\">\n</picture>\n\n<img width=\"100%\" alt=\"lean-animation\" src=\"https://github.com/user-attachments/assets/09a32ba9-99ee-4fa9-9b33-d98dbf5d291f\">\n\nQuantConnect Lean CLI is a command-line interface tool for interacting with the Lean algorithmic trading engine, which is an open-source platform for backtesting and live trading algorithms in multiple financial markets. It allows developers to manage projects, run backtests, deploy live algorithms, and perform various other tasks related to algorithmic trading directly from the terminal. The CLI simplifies the workflow by automating tasks, enabling seamless integration with cloud services, and facilitating collaboration with the QuantConnect community. It's designed for quant developers who need a powerful and flexible tool to streamline their trading strategies. Please watch the [instructions videos](https://www.youtube.com/watch?v=QJibe1XpP-U&list=PLD7-B3LE6mz61Hojce6gKshv5-7Qo4y0r) to learn more.\n\n### Installation\n\n```\npip install lean\n```\n\n\n### Commands\n\nCreate a new project containing starter code\n\n```\nlean project-create\n```\n\nRun a local Jupyter Lab environment using Docker\n\n```\nlean research\n```\n\nBacktest a project locally using Docker\n\n```\nlean backtest\n```\n\nOptimize a project locally using Docker\n\n```\nlean optimize\n```\n\nStart live trading a project locally using Docker\n\n```\nlean live\n```\n\nDownload the [LEAN CLI Cheat Sheet](https://cdn.quantconnect.com/i/tu/cli-cheat-sheet.pdf) for the full list of commands.\n\n#\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/85b548f8-9fd1-47f1-9b10-d73b3cfc6b23\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/b6866983-adac-4461-ac2f-8642a72ef2a5\">\n  <img alt=\"modular-architecture\" width=\"100%\">\n</picture>\n<br>\n\n![diagram](https://github.com/user-attachments/assets/f482fae4-5908-4d95-a427-4b1d685c355c)\n\n#\n\n<picture >\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/user-attachments/assets/7b230a0d-6bf2-45bb-872e-c0faf4f1471e\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/user-attachments/assets/23b59138-aab5-43c3-91b0-20eff46ab21a\">\n  <img alt=\"modular-architecture\" width=\"100%\">\n</picture>\n\n\nThis section will cover how to install lean locally for you to use in your environment. **For most users we strongly recommend the LEAN CLI which is prebuilt and runs on all platforms.** Refer to the following readme files for a detailed guide regarding using your local IDE with Lean.\n<br/>\n\n* [VS Code](.vscode/readme.md)\n* [VS](.vs/readme.md)\n  \nTo install locally, download the zip file with the [latest master](https://github.com/QuantConnect/Lean/archive/master.zip) and unzip it to your favorite location. Alternatively, install [Git](https://git-scm.com/downloads) and clone the repo:\n\n```\ngit clone https://github.com/QuantConnect/Lean.git\ncd Lean\n```\n\n### macOS \n\nNOTE: Visual Studio for Mac [has been discontinued](https://learn.microsoft.com/en-gb/visualstudio/releases/2022/what-happened-to-vs-for-mac), use Visual Studio Code instead\n\n- Install [Visual Studio Code for Mac](https://code.visualstudio.com/download)\n- Install the [C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)\n- Install [dotnet 9 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0):\n- To build the solution, either:\n  - choose **Run Task** > **build** from the Panel task dropdown, or\n  - from the command line run\n    ```\n    dotnet build\n    ```\n- To run the solution, either:\n  - choose **Run and Debug** from the Activity Bar, then click **Launch**, or\n  - click F5, or\n  - from the command line run\n    ```\n    cd Launcher/bin/Debug\n    dotnet QuantConnect.Lean.Launcher.dll\n    ```\n\n### Linux (Debian, Ubuntu)\n\n- Install [dotnet 9](https://docs.microsoft.com/en-us/dotnet/core/install/linux):\n- Compile Lean Solution:\n```\ndotnet build QuantConnect.Lean.sln\n```\n- Run Lean:\n```\ncd Launcher/bin/Debug\ndotnet QuantConnect.Lean.Launcher.dll\n```\n\n### Windows\n\n- Install [Visual Studio](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)\n- Open `QuantConnect.Lean.sln` in Visual Studio\n- Build the solution by clicking Build Menu -> Build Solution (this should trigger the NuGet package restore)\n- Press `F5` to run\n\n### Python Support\n\nA full explanation of the Python installation process can be found in the [Algorithm.Python](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#quantconnect-python-algorithm-project) project.\n\n### Local-Cloud Hybrid Development. \n\nSeamlessly develop locally in your favorite development environment, with full autocomplete and debugging support to quickly and easily identify problems with your strategy. Please see the [CLI Home](https://www.lean.io/cli) for more information.\n\n## Issues and Feature Requests ##\n\nPlease submit bugs and feature requests as an issue to the [Lean Repository][5]. Before submitting an issue, please read the instructions to ensure it is not duplicated.\n\n## Mailing List ## \n\nThe mailing list for the project can be found on [LEAN Forum][6]. Please use this to ask for assistance with your installation and setup questions.\n\n## Contributors and Pull Requests ##\n\nContributions are warmly welcomed, but we ask you to read the existing code to see how it is formatted and commented on and ensure contributions match the existing style. All code submissions must include accompanying tests. Please see the [contributor guidelines][7]. All accepted pull requests will get a $50 cloud credit on QuantConnect. Once your pull request has been merged, write to us at support@quantconnect.com with a link to your PR to claim your free live trading. QC <3 Open Source.\n\nA huge thank you to all our contributors!\n\n<br/>\n\n<a href=\"https://github.com/QuantConnect/Lean/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=QuantConnect/Lean\" />\n</a>\n\n## Acknowledgements ##\n\nThe open sourcing of QuantConnect would not have been possible without the support of the Pioneers. The Pioneers formed the core 100 early adopters of QuantConnect who subscribed and allowed us to launch the project into open source. \n\nRyan H, Pravin B, Jimmie B, Nick C, Sam C, Mattias S, Michael H, Mark M, Madhan, Paul R, Nik M, Scott Y, BinaryExecutor.com, Tadas T, Matt B, Binumon P, Zyron, Mike O, TC, Luigi, Lester Z, Andreas H, Eugene K, Hugo P, Robert N, Christofer O, Ramesh L, Nicholas S, Jonathan E, Marc R, Raghav N, Marcus, Hakan D, Sergey M, Peter McE, Jim M, INTJCapital.com, Richard E, Dominik, John L, H. Orlandella, Stephen L, Risto K, E.Subasi, Peter W, Hui Z, Ross F, Archibald112, MooMooForex.com, Jae S, Eric S, Marco D, Jerome B, James B. Crocker, David Lypka, Edward T, Charlie Guse, Thomas D, Jordan I, Mark S, Bengt K, Marc D, Al C, Jan W, Ero C, Eranmn, Mitchell S, Helmuth V, Michael M, Jeremy P, PVS78, Ross D, Sergey K, John Grover, Fahiz Y, George L.Z., Craig E, Sean S, Brad G, Dennis H, Camila C, Egor U, David T, Cameron W, Napoleon Hernandez, Keeshen A, Daniel E, Daniel H, M.Patterson, Asen K, Virgil J, Balazs Trader, Stan L, Con L, Will D, Scott K, Barry K, Pawel D, S Ray, Richard C, Peter L, Thomas L., Wang H, Oliver Lee, Christian L..\n\n\n  [1]: https://www.lean.io/ \"Lean Open Source Home Page\"\n  [2]: https://www.lean.io/docs/ \"Lean Documentation\"\n  [3]: https://github.com/QuantConnect/Lean/archive/master.zip\n  [4]: https://www.quantconnect.com \"QuantConnect\"\n  [5]: https://github.com/QuantConnect/Lean/issues\n  [6]: https://www.quantconnect.com/forum/discussions/1/lean\n  [7]: https://github.com/QuantConnect/Lean/blob/master/CONTRIBUTING.md\n  [8]: https://hub.docker.com/orgs/quantconnect/repositories\n  [9]: https://www.nuget.org/profiles/jaredbroad\n"
  },
  {
    "path": "run_benchmarks.py",
    "content": "import os\nimport re\nimport sys\nimport json\nimport subprocess\nimport statistics\nfrom pathlib import Path\n\ndataPath = '../../../Data'\nif len(sys.argv) > 1:\n\tdataPath = sys.argv[1]\nprint(f'Using data path {dataPath}')\n\nresults = {}\nfor baseDirectory in [\"Algorithm.CSharp/Benchmarks\", \"Algorithm.Python/Benchmarks\"]:\n\n\tlanguage = baseDirectory[len(\"Algorithm\") + 1:baseDirectory.index(\"/\")]\n\tresultsPerLanguage = {}\n\n\tfor algorithmFile in sorted(os.listdir(baseDirectory)):\n\t\tif algorithmFile.endswith((\"py\", \"cs\")):\n\n\t\t\talgorithmName = Path(algorithmFile).stem\n\n\t\t\tif \"Fine\" in algorithmName:\n\t\t\t\t# we skip fundamental benchmarks for now\n\t\t\t\tcontinue\n\t\t\talgorithmLocation = \"QuantConnect.Algorithm.CSharp.dll\" if language == \"CSharp\" else os.path.join(\"../../../\", baseDirectory, algorithmFile)\n\t\t\tprint(f'Start running algorithm {algorithmName} language {language}...')\n\n\t\t\tdataPointsPerSecond = []\n\t\t\tbenchmarkLengths = []\n\t\t\tfor x in range(1, 3):\n\n\t\t\t\tsubprocess.run([\"dotnet\", \"./QuantConnect.Lean.Launcher.dll\",\n\t\t\t\t\t\"--data-folder \" + dataPath,\n\t\t\t\t\t\"--algorithm-language \" + language,\n\t\t\t\t\t\"--algorithm-type-name \" + algorithmName,\n\t\t\t\t\t\"--algorithm-location \" + algorithmLocation,\n\t\t\t\t\t\"--log-handler ConsoleErrorLogHandler\",\n\t\t\t\t\t\"--close-automatically true\"],\n\t\t\t\t\tcwd=\"./Launcher/bin/Release\",\n\t\t\t\t\tstdout=subprocess.DEVNULL,\n\t\t\t\t\tstderr=subprocess.DEVNULL)\n\t\t\t\tif x == 1:\n\t\t\t\t\t# skip first run\n\t\t\t\t\tcontinue\n\n\t\t\t\talgorithmLogs = os.path.join(\"./Launcher/bin/Release\", algorithmName + \"-log.txt\")\n\t\t\t\tfile = open(algorithmLogs, 'r')\n\t\t\t\tfor line in file.readlines():\n\t\t\t\t\tfor match in re.findall(r\"(\\d+)k data points per second\", line):\n\t\t\t\t\t\tdataPointsPerSecond.append(int(match))\n\t\t\t\t\tfor match in re.findall(r\" completed in (\\d+)\", line):\n\t\t\t\t\t\tbenchmarkLengths.append(int(match))\n\n\t\t\taverageDps = statistics.mean(dataPointsPerSecond)\n\t\t\taverageLength = statistics.mean(benchmarkLengths)\n\t\t\tresultsPerLanguage[algorithmName] = { \"average-dps\": averageDps, \"samples\": dataPointsPerSecond, \"average-length\": averageLength }\n\t\t\tprint(f'Performance for {algorithmName} language {language} avg dps: {averageDps}k samples: [{\",\".join(str(x) for x in dataPointsPerSecond)}] avg length {averageLength} sec')\n\n\tresults[language] = resultsPerLanguage\n\nwith open(\"benchmark_results.json\", \"w\") as outfile:\n\tjson.dump(results, outfile)\n"
  },
  {
    "path": "run_syntax_check.py",
    "content": "import os\nimport sys\nimport time\nimport tempfile\nimport re\nfrom pathlib import Path\nfrom subprocess import run\nfrom multiprocessing import Pool, Lock, freeze_support\n\ntarget_files = []\nlock = None\nstart_time = time.time()\n\n# to resolve imports of other algorithms\nexpanded_envs = os.environ.copy()\nexpanded_envs[\"MYPYPATH\"] = os.path.join(os.getcwd(), \"./Algorithm.Python\")\n\ndef init_pool(l):\n    global lock\n    lock = l\n\ndef log(message: str):\n    print(message)\n    with open('log.txt', \"a\") as file:\n        file.write(message)\n\ndef sync_log(message: str):\n    with lock:\n        log(message)\n\nfor subdir, dirs, files_in_folder in os.walk(\"./Algorithm.Python\"):\n    for file_name in files_in_folder:\n        file_path = subdir + os.sep + file_name\n        if file_path.endswith(\".py\"):\n            target_files.append(file_path)\ntarget_files.sort()\n\ndef adjust_file_contents(target_file: str):\n    try:\n        file = Path(target_file)\n        file_content = file.read_text(encoding='utf-8')\n        adjusted_import = 'from AlgorithmImports import *;from datetime import date, time, datetime, timedelta;import pandas as pd;import numpy as np;import math;import json;import os;'\n\n        tmp_file = tempfile.NamedTemporaryFile(prefix=f\"{file.name}_\", delete=False)\n        Path(tmp_file.name).write_text(\"# mypy: disable-error-code=\\\"no-redef\\\"\\n\" + file_content.replace(\"from AlgorithmImports import *\", adjusted_import), encoding='utf-8')\n        return tmp_file\n    except:\n        import traceback\n        sync_log(f\"{target_file} failed An exception occurred: {traceback.format_exc()}\")\n        return None\n\nspecific_order_attributes = ['limit_price', 'trigger_price', 'trigger_touched', 'stop_price', 'stop_triggered', 'trailing_amount', 'trailing_as_percentage']\n\nspecific_ibase_data_attributes = ['is_fill_forward', 'volume', 'open', 'high', 'low', 'close', 'bid', 'bid_size', 'ask', 'ask_size', 'last_bid_size', 'last_ask_size', 'bid_price', 'ask_price', 'last_price', 'period', 'tick_type', 'quantity', 'exchange_code', 'exchange', 'sale_condition', 'parsed_sale_condition', 'suspicious', 'update']\n\nspecific_indicator_attributes = ['is_ready', 'samples', 'name', 'current', 'update', 'reset', 'updated']\n\ndef should_ignore(line: str, prev_line_ignored: bool) -> bool:\n    result = any(to_ignore in line for to_ignore in (\n        # this (None and object) is just noise the variable was initialized with None or mypy might not be able to resolve base class in some cases\n        'None',\n        '\"object\"',\n        'Name \"datetime\" is not defined',\n        'Name \"np\" is not defined',\n        'Name \"pd\" is not defined',\n        'Name \"math\" is not defined',\n        'Name \"time\" is not defined',\n        'Name \"json\" is not defined',\n        'Name \"timedelta\" is not defined',\n        'be derived from BaseException',\n        'Argument 1 of \"update\" is incompatible with supertype \"IndicatorBase\"; supertype defines the argument type as \"IBaseData\"',\n        'Module has no attribute \"JsonConvert\"',\n        'Too many arguments for \"update\" of \"IndicatorBase\"',\n        'Signature of \"update\" incompatible with supertype \"IndicatorBase\"',\n        'has incompatible type \"Symbol\"; expected \"str\"',\n        # This methods take an indicator and consolidator which might be instances of custom\n        # indicator/consolidator Python classes that don't inherit from PythonIndicator or IDataConsolidator\n        'No overload variant of \"register_indicator\" of \"QCAlgorithm\" matches argument types',\n        'No overload variant of \"warm_up_indicator\" of \"QCAlgorithm\" matches argument types'\n    ))\n\n    if result or ('note: ' in line and prev_line_ignored):\n        return True\n\n    # Ignore accessing specific order types properties\n    order_attributes_match = re.search(r'error: \"Order\" has no attribute \"([^\"]+)\"', line)\n    if order_attributes_match and order_attributes_match.group(1) in specific_order_attributes:\n        return True\n\n    # Ignore accessing specific properties of common data types derived from IBaseData, like Tick, TradeBar and QoteBar\n    base_data_attributes_match = re.search(r'error: \"IBaseData\" has no attribute \"([^\"]+)\"', line)\n    if base_data_attributes_match and base_data_attributes_match.group(1) in specific_ibase_data_attributes:\n        return True\n\n    # Ignore accessing indicator properties. Useful for instance when adding indicators of different types\n    # to a list and then iterating over them, the common type will be IIndicatorWarmUpPeriodProvider\n    indicator_attributes_match = re.search(r'error: \"IIndicatorWarmUpPeriodProvider\" has no attribute \"([^\"]+)\"', line)\n    if indicator_attributes_match and indicator_attributes_match.group(1) in specific_indicator_attributes:\n        return True\n\n    # Ignore accessing specific properties of some models, just to reduce noise in regression algorithms asserting internal stuff.\n    # We don't expect users to be accessing properties of models like this in most cases\n    if re.search('error: \"(IBuyingPowerModel)|(IBenchmark)|(IMarginInterestRateModel)\" has no attribute \"([^\"]+)\"', line):\n        return True\n\n    # In some cases Python developers use the same variable and redefine it, this is not a problem in Python but mypy doesn't like it\n    if re.search(r'error: Incompatible types in assignment \\(expression has type \"([^\"]+)\", variable has type \"([^\"]+)\"\\)', line):\n        return True\n\n    return False\n\n\ndef run_syntax_check(target_file: str):\n    tmp_file = adjust_file_contents(target_file)\n    if not tmp_file:\n        return False\n\n    try:\n        algorithm_result = run([sys.executable, \"-m\", \"mypy\", \"--skip-cache-mtime-checks\", \"--skip-version-check\", \"--show-error-codes\",\n            \"--no-error-summary\", \"--no-color-output\", \"--ignore-missing-imports\", \"--check-untyped-defs\",  tmp_file.name], capture_output=True, text=True, env=expanded_envs)\n\n        output = ''\n        if algorithm_result.stderr:\n            output += algorithm_result.stderr\n        if algorithm_result.stdout:\n            output += algorithm_result.stdout\n\n        filtered_output = ''\n        prev_line_ignored = False\n        for line in output.splitlines():\n            ignored = not line.startswith(tmp_file.name) or should_ignore(line, prev_line_ignored)\n            if not ignored:\n                filtered_output += f\"{line}\\n\"\n            prev_line_ignored = ignored\n\n        if filtered_output:\n            sync_log(filtered_output)\n            return False\n        return True\n    except:\n        import traceback\n        sync_log(f\"{target_file} failed An exception occurred: {traceback.format_exc()}\")\n    finally:\n        tmp_file.close()\n        os.unlink(tmp_file.name)\n    return False\n\nif __name__ == '__main__':\n    freeze_support()\n\n    with Pool(12, initializer=init_pool, initargs=(Lock(),)) as pool:\n        if len(sys.argv) > 1:\n            target_files = [target for target in target_files if sys.argv[1] in target]\n        result = pool.map(run_syntax_check, target_files)\n        log(f\"ALGOS: {target_files}\")\n        log(str(result))\n        success_rate = round((sum(result) / len(result)) * 100, 1)\n        log(f\"SUCCESS RATE {success_rate}% took {time.time() - start_time}s\")\n        exit(0 if success_rate >= 98.6 else 1)\n"
  }
]